Current File : /home/mmdealscpanel/yummmdeals.com/mysql.tar
usr/bin/mysql000075500021256440150330714530007237 0ustar00ELF>7@�UE@8	@@@@��888�d;�d; hj;hj[hj[`�	�z
 pt<pt\pt\��TTTDDP�td�9�9�9FFQ�tdR�tdhj;hj[hj[��/lib64/ld-linux-x86-64.so.2GNUGNU�ug ��� �?L?�|1�I0��DI% �P�:�t
 ��B��@@iH PT�!H�
X��`9
6bH�PA�a��IRH�@$BH@Pm�@
 �(�
`@A�@/	&��AA��G��D��DJA��@T`�n �*AX��@PA �@�0 �@���A�AD
r#EP�a����$��`8A@�"� �d��	0 @�@�"�@�0�)�`���
@ ��&��@zP	X�PA#%�D �a��	� I�@�bQ�`�� X� 8 P����
#DQ�
��$�4��@@A ���� p�.�A
�$��£���$
$  %B�	$��DE�DA�Ј	dH ����H���! @!2��&`��<"H(`�Bd
�$E��,`�@� �E&�$dHT0Q'��@`@��@`�"@APA
$P�Q2R@�#	 ` �@@F4H
��(�X�e
�PtP@AY��@@�9`1 �I!�T0
��"���D�D`ڹ@��H@@��	��b�$QA�	� РRY�! @@PT�
��dD���T
�� �@Q;"X�@DB�@*�$BP��$Rw���� 0D��� �
��[ �1d�H�� 0`�  %��XRP}@". �@@0 �T�!
B@ �`l
�@HA�
	�0� �eH�
8�'J�J�$ APQZ�!`"�0�03~��')�@h�
B"���"��,H"�@���"L�$) V�@�@��@��B$H��b@�2 GI$S�[&U� 	<��@CD�0 �C@D�D)�@��AP$Ȥ�e���މ ��
	A�
	@_@'	x��D	()
!��������_���j ��P ��,S!�H	Q��*�B��$���+@D�ظ,p
2	�$%0PAV�7 ` 
 �@d)8�P� YL ��I@A@LPcU�` �L,� �@ �0�@ #�xA�c�� FZ�€D�H�$ A #@$$!&��`��B��0 X@:pAAc' ���9D
�A@�H�E P���	
�F#J!�q�D�`(Q0+B��@ p�N����"#B$�>`���6@��@'�
�@ @B���3@	"A���� J��C��I��
"�@e@!�@� @��H�dK�R$)B �`�TH�$PFRJp"XF  &` @Ap0a"
(�1 � �@�@TkT��@�`A @@C
P��D@U�QD��5�p���D
�� ; �D�b�	 8`e��d:��HP�H )H`AP@��@HH!��!	�M�$�Da &#� 

$&')+,-.03678;?@CFIKLMPTVWY\^`bdefknqrtuz{}����������������������������������������������������������	
"#$&).1678;=?ABGHJPQRSY\_afiknpruz{~���������������������������������������������������������������!"#%'*,.159=BCDFGILMQSUVXZ\^_abefhknqsvwxy}�������������������������������������������������������

!#$%&'*,./03578;?ABGKPQSUWY[]^_`abcghilpswyz|}�������������������������������������������������������
 !$&(*-.0123478:<=?@BDHJKMNOPQSUX[_`bcegijmpqsuwy{|}~�������������������������������������������������
 "&()*,-./24689<=?@ABCDEFGLNOPSUWZ[]_afjkmoqtuvyz{|}��������������������������������������������������������	"%&'-.1489?BDIJKNORSTUXZ[\`egimpqsty{�����������������������������������������������������������	 $&+.02368:;=>?@BEHKQTWZ`acefgilpsuvyz|���������������������5ljۈ�k��[����Ex�2Y���3?�R���nF��:d�c]@���6�\Y�ҿ�$b�����������lvyd5+I)���O��LA�t��垭�����G��2�A�h3�I�)k�|�@���9����rXvs��é��:����7��[�k�pa��˔�~����5����u$��
�0sC_��_M�N��t�x
�k���t�S��U�|�����|C�N҆���	?�M�C"����/E}��g�`G�Q��������-_
�Q
S
`2|�f�ʹ�N���7�`� 8�ۆ��ŖQ�{�J��ȣ6.?G}e9.��*=�>��2��dw�"��G)C�fCޞCD��Tzxkcu��7w�[��;�{_�FCb� �[���M�s��g)�����	y���p��(�'��)#���M�d�S
�jj�V[R֕8�c�֖K�ex�?'�Ҟt��K�쳨����t���h,9z�?v�A`H�G(��<Sz��wo��/�_�q���a6�M�k�zBl�H�n�7ڣ��qa���ٍ�L�
j;j�`����,+����v`�/9s�n�!T��mb�W�.Z�
��ݹ�$\8��Mj
�+���#����A��f2���i��-�NOi�2LX�%�d�3/��t^r���������˨[30B��!��Ǡ�Yr�F��r��]H ��d��3p�lz6�T���(&E���5�6������h&p5lH��Nf��G,\��PP��p������#4�P'e}�r*d���B��@񩠷���S�tb�#O�Ʌ��7����7
T���EI8JE��m��a*ߓƚ�v���BE��Ѫ�ڣ�2��Q�d���W�4�Q�Q��`��B���#�.��g݄0��O�t�����o]�s�o��
hI#!}��Q�h��w��Фu��;�Td%þ��Dnsv�0�8hE�c�ĤM���@�eP�M�j�8I� ��uװ�0�٫V>�̳�R���Fi�"~��?[����{���}�\�+X�\�_�R�ZjA;�+śQH��I���u4�F2����3 �`� ���u����Dy�Q��1��N��o����3����9�
��F����$m��N�$-�
�60�q��"��a��a�eK�X�$6�i&7cMuB,_��")xيS*���C���.HC��|J%6��*�V%��F����~8���iF�D٭K��,�J�i�P/���Lu>=~빣qʿ�5(�����z���~I��U�r�`ބ�tit�1���5+H]Q�B"D[:��(jؓ�]u�M�l�AHg���1�����h�Ǚ˘�B��c�����,_n�Ou2���Ҡ��e�l&8�;�'�c����3g2�R�C��!���c��Wǂ�u�x�=���
��W;���=�ܛd`��Swݨ��l"��oz���U�`�k�&"wC8��vG�a��,�gZ�MЛB�h�o�MԂzm���L�#$ֻ�Z��M(�5�1�Z�G��mNU�T+mL��Ɏ���^�KS�Z�Q�OmlMl&���1�M��p/n��$�t�Ci�=�O@��#�]��/;���Y�\�a�'�46�s�,F�ɣN�l�h!?]�П�M�$�ӂ9��ƫ���囀�r�j�,/Y�� ���b��FQ��5B���r�lu��d�"�u>�T!�>���iW=	��������ޢ�px�K��W��E+��+^)5H��gF��\=]
�����Uqt���� MhP�+�@�,��kn�F���!� ��պ��9fF1T9�K�Z5Rf�>Q�gqG�r���<�k���Kb��NΘ��҆�'#W��J�L�oj?ʑg�֍���?��y+��7��'&$L�n�#��Z���_�'�^�|�
i�N��6�ʦ��[�$�ݷ�ѕQ_����͹w�n�U�f�DJ��e���rbl��;���
�1�"�J�:*�",XN��?����Q��4`�Ӯ��hye1l�\
#�P��3�qwA���x;��%��?�=1� �,F�
��վ�ŸaB
m �	�{��D���5fBf�<��S��i�e&w���#��cʍ�l`qA���H5H|�h�n���v���}���ʬ�[@i��˥D'(��A�ޜ�c��
�$��͊���E��3��?�S$$.�mE\앺������f΍vS�^_��Ii�<��J?��'7�M�EF���G��y���ѥ�O�g�=�b"������8?�P�&(;'	쬄��&�=i&�帍�'B{�ή�����(�"��p�ҥa�� �@�TB��������7���2k�/gϙ18S("R��E�Tv�6R�yG����>{��1`d�2�3	���"� zc�paP�,Xi_
^���*��Qm[�)�^PCI�t�U5N��>0o�^j��>�"3�1���|�m���$�p�qX��n5�cAr��1��}n�7�햞�p3p����*�[�mc���Lk~���_Pj/�T�ϫc_����{��h&�j�EřP)Nd%����}.�Z��g��U'*v<�#�֣��4=%-�Y����4L�����%�4��L�`��z������V+��pE΃I�,��~��I�:��̋���uK�*ZtjE��\q�7�,���G@�l�|�{]_x
�s��T��������6=��f���Zg�9΋�mx[n�F,�R2�@��*�"���L���m�póX���AC!+�:f;���
���6b#�����~(��wnT9Q�8(�޽�h\�9"N/�d�GSk���3)Y����5�ɔ�����+��@��o;m.C��J?2=�@��V
��1FV% "p���Z�I
�7�eƲU�!�%V<�p[���=�u�~2��a(?��|�x���m	!�M��j|���S��7���̏8�ʷb�A�/��.��F8E��s�dƾ�͟��J�/���?֬�$�*���U"��E��u��~�Q��o�c�K\.�	q�%Z���̝\mO@$
N��|������2�c����ѷ�c:;��k��8����"I	4�Nǩ�Q�*�K#��{�n+�I6}⭸���?V�D��7BC�M��������F8@�;2�<k�
~���5A�} DI�{�����M�TI��R��6��,�gB!ĚUt�v]����6&���c�P��4�.����E$-C�Y��$_>�oV��
sB��*�J#��7���N�L	�.���%�n����#\���K"��9��'��8�+��o�7kW�{�{?�a��6��~���X޴��E���L�n��PD��>��D��bZ�v�v����;6�.�^��!YD:.���������u3b�턀MG{Vysۙ�Bϻ_��N`�3���`#�کQEC�lzm��-��	��#Nx�)d��KU7��=�j���	���j�%nB��4���Uj�tx*N�d2Y�M��i�C��mR��E��s�[�8Q�����R.d��/�g���tJ�?�7�0&X����#�uV؇ml��>�V6ۅi�I64:	W��a4=uv�,�maVZ��~��6�ۀ��6!�@ʺ{J�W�(X��f�s�F��@Ux|e,]�'�֝V�(�֗�_��_�w*(D��k)"�@���Բ��@{$b����x��g��@ਘ���@�*k?
=�^Q�svVI�ϙ�t�t���c~(N�J�},���+�����T1�@�eD/!8 ׌�:r�D��A�eD_A��5���E���/��招T����g�ԶA�ꌏna�}���#�r�Z����ʉ��%��KZ�`:c������
@�t����;E�8~�>�Y�0��	3H���9%�'ܻ��~_�w�2�&��;{'T*)�o���Bx�"'�d:�ڦ�]A�D�N`ao�r���ho~x���$Ї3~��n�X;�9���p
�n�,{��$?{%b�"СVz8�#N�`��0C�m��Xi�T$�=���*�s���g"�yCJd�fjKT�����.��x	$��z!r���e[��p�*�����b��{����tv
�_�7a��%�񩫵��c�\|�a6� qB_�MO]?�I�GrA�&p.�=ޣ�isW�����%3��̒�л�&4w�-��*CaL��ղK��Ɠ��@	�s�;R��������^����(FM��6O�c�I*&t�.߇�tcV�*�IksP��K}�)�!��� �7��(<s^���L�,8M�\�Jl��Jx�o���g6nܬ_������)"�,%M]��@�`���H&dn`�%�kH�"��&ac��̴oT�t��	�
����)�}�_�A�,+��Z�3in2
:�]��P�/�����b��k-����Y?@���ˆk��Հe��o*A�-vs�b%��u5���S�δ�c�
;���;^�Rр�Hj�7<�h��Kw�)Zmm����%�T���Q�r�_��n��D��,���LI��7��71�A���B$М� 쪰���HC�%��C��e7�ۣ�9�+%�3{���&��|s�6O^�2�
*B ��QUw5n7���3�����[���~�v�ײj�]'�t�ū�E����b,��q7��2����n"'� � 8�V�iP�T��z4DL���$�~�K`/����O�q93-�(�W>@y�K��
Ӑ�4�1�` ~zN�ʹ�ج�}��!����2�L6��&$'~�O����+3ǥ�݊�5�M�h��ʝ��㞃\��e�o�ۼvdQ��Z)��	�^H�$��g^/@��q��"��"��~��|>8Ԣ�F�Z�s�{"��2�t��#����`�5
�s
�C�gi�i�P_�	"d)���VZ	S]4YHhJ�:S<b�`�|ŸMҎ�ԓ
�/�kv�)��p�\��n���k'e`��z��\*ȃ�2'��ӹ��y���NF�u����ĻI�mj�e��
���(ގKx�ndq��&�,��i[(�Ĩ�:�y�}��P��+�$�[��ofrت3�ɾ>"��Ť��pd��@i�w�<��PA�G=������Ҋ7k0��7B��&��y�#�S
������E�)��u�e؍�|��'�f���C��;��{�"J���-�P��Wsm�I4e�#��ǩ��e��9����tF�a�4��7�)��o�����=�򯒘NQ+˺r�X�}��v�`]�w���O�1 �{,�[�j��Y�6!�ΐ�����V�ږ�GL�`";�?؂b ؂bbw�4�m�
d�|Mg�A�ң;�Ҷ�}�ӝ�y�PEz��uC.��U��ޔ��+K����@H�4yU�K`߀�m;�By�D��J�Ke"��i OG�Qm��T_�	��p�yn#��۱
�t���MH/���{|�p��N{L)QX�|�:��l�����
k$�n�!Ô�ݞ��~K���'� vɩ���g���3�v�s�((y=�Be�.�����������"Ǚ��$����A�2lu�a��;�4�h�x#�9��؇\Q�L�#=��ٿur�vH��*�p�*�p�vݑ@�,�]�'�I#�)�I��l;�����+by0�B��k�qz��k^�ȖĘ�����X�����~�r2��N ��s��ʻ��7Qw|;�YF� ��u	h���Mrb�$mZ��_H�6h 
D�"{`�0��Мr=�->���오Q���Y=�}3�y���(��׊�E���j'�D���Ϡw�4N��dB��ڋ��Pyg�*-a[s�t<���v���iY_���^��?4o/�b&R��E�:�B���j�'�	=�&m��v:N��q������[y'��<F���uƱ<_nq�	7'��L��z����_
%x�`���P�?�z��3��&
�n�Q)o>����Lw��a;���ՋȞZ�r����ԯt�|��"��p�����ܨ1W�/��9���!���UA6�Ql[��xO)m�����x 9�/�K�M��(7�qwݑ���D�sX�5Pn`l�у���}�Y0Z
4}��; �
}��.r���a�kh�%�~i6�9��r�0�[���j��|1��|I|��Z2���e�Ռ/���m"0KsT/	U�*����Z�r�G��
Q�����$L���n#|��'�w��$L�,�5� �x� �x��Z�nһ�r�y�‹&K8��`�geF7�u�y�	�ί��iSsJ��$�E~��AIS<->���;>�ɑO��~,[(����:��kqD���,���7�yF���ޜ|�	R�=���裞L�i�v�)*G�8�2c�z^��m�XV9�GՂ�5^s��OG���RȢ�P��q�6�N|!��ɾ1�#%�b����G��@Z���_>�M����[܃ٶ��|���ϥ{/]���
�t1]����D�2F�~��k��Ő�Y��v���r�L�����y�p�̈j/�SJB�?�� !�����V�ɚ����2�BR�^i�&���n�߉��\�wYD�N¦��>�H��
8Q�K:�O�a$�p+8�� �JZ����͊����	��wI�2J�������}X��9[������Dѯ��<�JR$�a�%�!B�=���f�?�ـ���	�V7b�J
T��}��H�P�,Ƀ�g��~a������!-�u�^��؆F�<�~!f&䍛(�fG�����/�
�k~	_2M.+(�J�q��Yj*/�|�=�h����a;+m�٠g��i���%��T�Q<ض P��嫐L
P�n��dR�7f;�[�5S����[���Z��-��\Re�.6��/���Q���O�,rS��)��b)�xbۣ+���c���
�&��,�4���k��s�5Y_Ĝ�j!���T�xdn;Ի��"�0����3��)U�3���'�o�N.6m��Y�
�3���!��v:��J����ʾC@!�.�w^�Uh{�	�a��q�bB<TEg���V�@��ة��p�:��Bnl�P�V��
?�Q��,꼾�I��f��Wm�х�L�M婰�n����A��!{��P�"؈��<��l�M�"o�b	U:K��|86q��݄�7c4?�9��O8�y�@�qfx��ź"�qJ�_(�
�iѐ2��Y�'�Ӏ7�T|��f���R�G�t($MLi�(��Ѹ���8�qpk	C����\JQ�k��f^KQ�
6��e5����&�-�4�<�|�bQn̤�N��w3��ůO�@��d�`w�a���������N���V��F[,zZ/�
B�x|bn!��|Yp���`����K������2��9TW-��ȾE��
a֛E��ۆ�j~��[�]�R%Z�h�}�_�[�`Z&n��A���h�u�t�o/��t�/��눲�Gy�ޏ&z_G��*�S��b#Ԓ!�4�c��=�K� �<�/��󮈍8�U4�u<���j���QB�8��2�1'a�;�2ط���K��~g��\\X]��t�o���I��nV˄�XP5��4��H�C���?�M#��	��	
	��`�
S�_�
$6W�;��z+N�
�e�{	�[d�s�
��j�4�	"Y�U���G%�^9:
�7v
�B���= 	?}
��
>,
��Zv�RJ�
	p
����IyI`	R	A	��n;��
�p	iT,i>�
d.H	
��	p�o1
_�	��l�U�0�	�	F�O��
a*	�	�m�	�xc���$��	2�O	v�A

�9�e|SG�+?��$
��y&
o
\
�	=�����nw�c
�	��`���	{�L+	�'9	C�}6�9�6M
L B��	R�����]i	��
K	�	1-" ����	�	60	��z�U~�R����� �3- 	���q{��י�]HӜ
p�x�y��`�`Nx3]x�
�8�&
0s�C�]��
�(b� @�`��v
P�˜
�D�џ

[3y��eX.
 a0�X
���w��e��
P��'
0��U
P�;Sp
��)�
�:�
�x�
�

Z?
P$��@��_�=l
`�
%u
�"
J�
�"J�

P�
�+�
x�@a��1�'b��o`�`��)@�`��
 �
)�8�7]�7
�1s�#
���L1�O
�bO`@]��
@�
�\W�ad��6�ens`Z\pJ~
@Ps@4
�)
?�
�
Ȥe��
��>��
�	iPвe[
�"��d�e^�
 d
�@
�%�]
�%Zs
 ���
 "
P�]�l
PA%ۋ
�	@ ]
��%~
�gP�~`�`�2
����Y��en��A]�2
�hU
�	*�
�	nˣ
��h
0G=
`{&<�N\p�e�H#e� ']`(��$e@�J�;]�X��e�o
 i	D�C
P1
C]H
#`�_��e~5
`��ؾe�kH�eJ�
`a	ҝ
�*���eey
��	/��
	0ʤ�:]����`�wZ
�*
��z
Ш
��
�=
ٚ`$] }��e�V'b��]`�`��c�6]�P
����
@�
�B�
0%
�'�� b��`�`�nA �`��&
���$*�A]tZ
`���Z`+b��_
0		�a
�Ak
p�	�`z�U\p����`�d��e���Q\p��
�G�YO
0s
��eX
�.5�
��]e
�Lj
��	����`�i��3]�נ
���
pN=��3]�
�ZP`
0\	�
p
�e
��
J 
�
��
*
 �^�s
����T

7�
�

}4
`n*V
�v�cq�`��
�a�z
 "j�
 �$�� �e�.�`�/
�"���eA#
`C (Qy#ek��;]��
���I*
P
	��
P�	
�M
P�
n�Q
p�Mj
`Eu�
@���
�=���
й	|{'
P�
8X7
�'
ШA�u
P�
��_ �`�ע
�_	Q�L
�d��J
0���m@�`��C
��
3'u

�]�خeY��n^�a�`�`�+T@�e\`��`�T��_�>��e�k
��#(
��	b>
��#
@�J�D
@	c�
��؂��e^
ZV$]F[�_\��?
�h1wc
0�	@*h
@�\�i �`�40
0�$}4
`09�]��,��
@	�� �e�C�*b�X���`���
���
@��
p`3��`�fj
0@׫
p��
@�`��8Ē]�u
�"��
�N	c��
e��
0[�`�`�<�e�
�	_΍x�eU
@�ԥ��]و
���
3	

`���b�� 
p�9�`
p�%nV��`��
@;_�
�h	/�8�e�+
��
��S
 �
P�=�
�
Sd�
��hB
�
FN�
�8
N�@cd��L
P�
��
`��
��
 2
7�
0p
$z|
`�	3�G
0�
hm
���-
� �l6
PaSaгe��
�Z'��
��	����`�|@
-��
�?i�j
"3o
`y
�Rz
`

{Y�a��3ؒ]K�
pN d�
�
m^
���:]Q��e�_���
0�r
0pa 
�p�]
0��+���`�l�
@�
�*�
 �fF�
�_�E
P�	i�r b��
�"]&
��w�Ya���`T\p���e@a@+`��
p�
/��`P\pW���b��
L�eb

  #�<@�e�>
�
h�v
�Ey�
б
Q)0�e�@
��
��eH�eZ�
(
�0���e�=�;]�N��`���
�'*)Z
�>�^��`��r
�&5��
�v���
�	u/
�*2�
0)�g
''_�{��eu�
@:7�l
>
ry�"b�=
 ���4
Ќ
��3]�"�PY+
`����])?�]WL
��i
Ps
*M�
�	]
`�#���`��p#e
��
v�5`a �^
��
�b
���Nx
�].��
P��o7
`0	F�@�en(�eb
p9
�x �\`,
pL9�`
`#�T�
0��2�
pi	'=,�`��n
`9n�
�
B�e�>
�;	9[a�a��&
�`6a
`W�/
@�	�4p�eE
�7olسe}
$P<
��
;�X
P8qja�e�&��]>IH�\�.
�^<7=
��*�
��AP�eFp
��
SnT�;]9_��`��l
P�
q�R
����
P�&h
�v	�`��e�@�e�� �]�)���`�MD
�
�!
�^w�H
�*z<���`�T!H7]�S
�
3P#
�QDW��evn��eq
�� 2w
`t�
��f
�~
m�6
p/
OA��e�
��.��
�-y��e�
�&	%'
 �)
�"O�
P�n�[
 %.�
 X~M
`�
����eՇ!�#�J
�,fb
�aE�
�?9r%
��,��e^8
�:	�G��eUI
��
vj�
@"_M
�6��q
^.�ڤe
`�z�
���8�e�@
P�
8�S�9{�0�e֡
�ih���`��`�`��I
����p
p"j~
��
`5s�\
��r�8
%|�>4�e�i
�� �s\s,
�"�~
�,��0P�epp��e0�y�P#e�{
 ���
P<�0
`�
��( a��?�[HB
�����e�!�A]N|p�]��dw
����]�$
��-
fKZg
`z	�͎@�`��U��ez�e6
4m& �ewr
P
	��
 v�`
p�
�~
@P	��
0�
+�
��1P
�u�
�CIT
0�	�B*L
`}	@��
Pa$
���{
��me���e:
��
j�Nȿe�
����
�:8,'
`���K
p�
G��X�e�<
�
�@Ԯe�f
@�$
п&^
`	�
��4N@;] �} �_��;
�H]#
����
�,gv$��e�,
0'	#7.
L^�H
 �
�V
P�KNk
P����
P0�
�&0���e�+�(`����`�i�
�_1�M\�e�
0�U�^
h\]�
�h+y
�]�-
���+R`�e�A
��*�5`�`��'
`���dT�eQs�@]8�t
�.=�
@&	6
 �
& �e���]�p�e��
 A�ڧ�A]��ep
 o?�_
�#I�e_[
`�
m�a��{
��	N1
 Z �N
�'��|
�$8
 ��M�9��`�e0z
#�5� dd�R
�T�U
@

�
��!�=��e0�E
M4&.
��
��%�`��
 <��
�9.4
Щ�"�
�
g�b`�`��� �`�W�
 �

E
�3�`
!
 �'
0�
��x
P�
��>
��bw
��	ϭ
@��x
�9	�y
��%
0��ͨ
��28�e�T
�Q�v
@�	D�
`���
Х��6
P[��~
Љ.�
��
��
0�
�2
P�];
�X��<
�����
�t���]�D�s\�
p�jU
P#�q��`�1
��`���
0
0�
5L
 hP4e
0�
2�o
@;
�p��e�*�e�=
�q
B?}
�n��3]�T
 a1
��
*����`��$�e�,x�e�
�S�3q
P
�!�
p�����:]����e�*
P@H�
`<	QfY��eL �e��`[\pE�
p?�3K
��9�
`	0� �b���
0�1gJ�`��
`)V
p
��,D�e�
�<;A
`"0{��`��
�
�
��
B^��`�{
�w	��D
�c
`Hk_
�#�|�!b�B�
��
�=�
��
0]V
0��.G87]��W\p#-0�eYed�&���eB�
0�S���S\p�
@ ��eF
����[
�#��;
�)_�W�e��
e�
�w�c
�k��d`(]�Cw
@	��H
�R���`��4
�1�n
�	m݃
!	�1 
�9Y�R
Pp� 
��9�W
�I��
��FT
p��sE@�`��Gt�e§Ծe؏
 �J�h`^��k
�:+g{
@�
&'g
P�0ɜ�es
�@�=
�	�U
`�h�
�"�
�~�
�AA[%
p�4�BP�e�k��`�]6
��
�q�e�{
 ����
`(Q
�4�k�;]1�
��	G���]��
�	��R
0e��
`_
�r�:]�2P7]�Q
�
�&[@�`�-k��`�܌��eU"
���k
P2���
`fbc�
 �
�d
��
�
��
<�e<%
�MQ
��d
�< �Фe�;
��G�a�1c
�-rƬ
�:	_�[X7]��
�g#��eج
�
}wd�_`Tn�`$b�!
0��@7]8~��e�$��e!)
0�
<S
0�(B
�L	z}m�e�t��e<h
P ��#
��	$��l^��H�eR
��^<��e�?
�?
M
�As<�e�
�
~��e�-H�eC��ep[
p.R2�̲e(
0��
@;,l
0�����e�d
�)bV�h�e4
���4
Pj	U�b
��;�,�;]NZ
Ш	�`
�_'r
0�{
�!H�I
_�8*
��%+Ap;]ހ��]��
p�
�
@
/�>
�
5�
0?
��
0�L.��eA8
P�	^<0� ]D�X#eT�`*`��M
��
��r�a`;]�|�3\p�
p<�66
���
��1W
 =%+�V\p�?�R\p�r
�6
��w��9~"�`�-%
Z��7�e�\�k\��e
^�
��v �`��
��	$
P�	���
P�
�@
P�
`��z
���f�a�I���e@
`=pCT�e�l
��
��u
?�,� �e@!оe�N��`��q
 �Z0
�|�=
 	Z����`��!
`r��Z
��#�u �`��|
�(C��
��	w]
`�+��@�`����`�a=`M\p�.

!5@
���>�
@���
Ш��
��U
�~�V�
0`3�;]D�
�!
rSa
:Lb
`��( 8`�Ғ
�1
'K
�.<BY
0<3
�%"�f
P]l
�]	P�
p(	|�P
P�d�_��ed
pM	_�
����#
P�t�T
� +�w
0���
0%],&
 �XV'
�
g)
����w
p˞
��
jIj
 ��
УZ�h�eEM�hdǙ
 0+��
�p
H@�
�M%
�v	n	~
�D�!�_d��\�e
@�
#E�e_�
��z
��Y���]``Y\pb�X�e�
`}6
�;��e�
���_�
 9
H>i
����O
�j1m 
(_�\�_�|_
��X�+
P�
p�7��]�Z
�)	$^m��e�(
p	�5
��2vo
��
3�%
�^E;
�Kp�0;]x
7/�7
��RQ�x#e�
�re��`�9�
�TnF
@	Uh'
@=��K
�YT��
�c�Z_ �`�_�
5
\c�
p?�8
�[%
@rhm��!@��9`��
��;�r
p��1�
P�	�L
��	n,�:7]f!
0�'�f
`���}(�e!!
�O<�"
П
6�7
����
`*m�r
�Yy�
��&��h;]�W
�yN�`
p�	KDp�eOGX�e��
 #�G
p�
LR
�
��
���9@�`��
�
��t�]�I
@�����*6) �`�2-`O\pfG
0�
��P
�
I��
0:	VxL
0C#�[
`L
�Xf@�`��lP�e�,��e5Q
�E�q
@K`�
P!Q�(]`�>
�9�D��e*a
Д
��.
�D	`
n
`I�B@�_��E �`��G��` *5@�` +F
@By�F�A]�V��e�{`�e0~{ȓ]
�L��@�e�
0$X
0�
t!A{);
 j	'"�
�
G	�m��e�
��
N
�&	.�
@!��!
��6
P��^P
@]	$ד
'��y
P�
0�}
=)b�
 ��p�T\p��
��
'�
��N
�>`�a� &g��P\p�0
�%�Z
`���
;�S��`��n
 �	9��e(U
0�
_
�m
0#�x �`��x
pt7���`�g2
p``5�gd��!
��H
`�|
*pv���e�
@���
`s��w
p;|��
 ��#��`�T@
�����
`���:
 �
GX�
��%��`��
м
*�R
Л
��$e�9
�4��P�e�W
��9Wx
09"(
�<={f
 -	���s\�# &b�='
�j�?U
`|�P
 %�zn �e8vv
03�p�
p�-
@`��ei"
 �	Ld3�xd��{
@�:܅
��.ʌ
�2�	�(;]�%
����h
�0
]v
�J	���
��ϒ
P�Q��
��
�sH�#b�dh
��
�*n
�1
I�g
P�
c�}
-w�`r]9F
�_H��]:X
P
H
@(	!�4
��	J^
���=m
Я	i�� b�r�
�p
�
��	�1
0�	d9p
�
&�<��e7��e0bI
�'*h�
�`��"`�`��%@�`��p
p���|
����_���
�,/N
�Gz�
`'	GfX
�e�ѩ
�
97(
 �
����fd��$
`T	�q
P���
�
Ed{
0<	&�]��e	.
�LPz
P
WW�
@
]}��`d�`�
p�	�&
P$
��F�A]|
/U#_
`��g�	\L(
�QV�\
��]�`��� �_�_T
'-Zo
�;��<
�Q�BĿe�n
���\�e�$^��B��`�ŏ
`#
�I�3]��{#e�/�]I
�\1���e"#
�W�@<`hO�W��e�
PS��IJe|+
���WS��]�b
��=ɬ
�
_VY
�&
��k
p��3x�^�sS �e0q
в�z$��e0q�e��c
�:V"
�&�G
0�
C�_��e0�
��'�) R]�a
`E
����
0�
A��x�eO��;`X?
@�v*�
`�L�
�Q!����e%
0X%�D
�A�x>
�a��
0��
p3
��e
 +�c��e�'
0,m
�h�Nm
��t@%b�sW�]�=Z
�_kt`$e }
�0	��)@�e�
8
	� �`��v`�e��
p�
�.s
@Z	,t
@ %�F
`w	_\�
@����ee�
���
`#�.
0�RJ;] �l
��
r��
@,]��
 $�
��I&
�%8���`�@R
0�'�=
�"�A`bd�q��4]��h�e"o
 �
��
 )	c��
�
6���e�4�e�Pa��`��9
�%�@
@%Z�\
��	l_��]q�
�<z*
@.
#��
@����
`�x�e_
��a(c
�
�

@)�B$
P-.�
0�� �epϦ
�?����]�
#B
���Y
�5q���ewG
�+	�MN
�.�(
��G%z
��D���`��'
�3 �`��Y��esi`�`�o�
�,��
���x<
0"5B]Vw
���
@�/
P�9Qu
���Vk@�e��
��	��
��
`�
��
�d��h�e@�
p�
Q�P�e�V
�"W
�'j�
д�Cy��`�
�tAH
��υ
��

�a
�[�<
�L�A
pE
/T}
�*��
Pe�
�)-I`�e��Q`L\plp��e�
���/
Pn	5�G
����l
@:7�n
`��2�
a�t"
�&	v
p,	���
�,
=
�F�_*�3]�:
�/=%p
 	��E
�F�5
.z�h
����+`X\p9��eC@
p�
�t
��Dk�
`.Z@�] :v
/eb]
�$g@�`���
�|'
��
<�H
��
`�Z
�
aß
�
R�
@
�ݦ
p�&�
`{	V�w
`)���
 ����
���&�
��NV�
�i	s���`��u��`�h
h�o
p+
"��[\p_((�e;��]�9
��?��`�K�
p@�4��e��
�����]H�]M\
��	�E�
��s�#
��	w�v
8C�c�e�U��]'
`��@
`c	�ū
����v
��

q
�v(
0;
>1@�`��8`�`��K
p�
��
��L`�_�n�
�:.�3
��-]
�	W�2@,b���@�erR \*�%$�e1�
P`a�(
@�, �`��9
�`j�0
PK	Jo
��m�l
��t��
�bk?
0��P
�4y.6
�
q:7�(b�P�].�
D	�G�
��	y
�GE�`p\��@�eH=
=Q��
��>�
P�g#
�8
@{
���e0A
`�
3�
�
Kk
#�N
`�
e�S]Gc`N\p
6 �`�DC
����R�A]��
 J	��
7��q
�
 ו
 �
=�Sd�e��
���#:L�e(|
��
��N
`z
f�
`�
��X�e9���e�XX�e�
�"�8
��`|
 ^S� ;]�5`V\p� `R\p�J �` V^
�1I�s��`��
��+
��e�(C�e�a��e�
��
��`�`��H�e�R
 Lz�1
��E� �9%�
�xa�
�'b�x<]�z�a���
0!
��
p+	s�_
@�
?D
�\�T�6]�`
0)#�1��eW-a����Z\p�f
p�d\
0�
��o�6]�`�e)
�3$��eJ��e�b
@v�C
P>��X��`��
��
F�s
��w
0�O�
��/��`�;
p!]�X
P"�`#e�I
@M;LP�e�[
�
n�`�:]�
^k,�e`n
p -1�
��wY
P�)>�
����q��]c�
�	�9��`��
� B�`�e#���`��.
���=��e�V
`Q
�X
�:��
�%$P
�
S�
P���

�:9�U
<
��*@	_�od�n[�i�
:CS`7]s�`�9@�9�T�M\p�Z�A]��
�#X�>��]K�3]=^0�e��
�_3���`�=:
0�Nn
�=�F�
�61!�A]�P
 �/j
���utЮe"{��e�}
 �	#�
	0���`�gb�	a�u��]
A�3]�M�o^���ijeth
0�4�j
�cj@`�e�J�ePX
�5`�`��
�'	�-
�4Q3
г
b�
��1��
�	0m�
 �O�'
'F6
0��p`�`��
P�1m8Ȳe2�
�x�
����ȳe{#
�
.�0��e�e�ed��|��` 0�
�ZV� 
���q�
@�w�
� 	A~)�X\p[
��
��3
��v>9
��4MKȒ]�w
��	��s
�](��@b]�
p��/
�%�H
�	;a8
p�
�}
���!�`_��)
P5i>��eM�
`�	p]
�os�
@,ؔ
����

��Y�$
p�rp:@^��u
��8��
p�5;
���V
`�
w@r
�_F�
�J}�i
P	k
Pa��S��e�s
���I`\\��L
�&FX�
�(w�
�
"�a}Ζ
��	D�
�	U�@�`��_
�8�}h٤e5
�<ri. ^��KВ]{�
`�=
@�$2
P�uO
��k�Z
PW�
F
��\
���D��e�&
`�	!W)
�
$1
@�
[�
0yC�H��e���e�H�9y-�m^��6�O\pLh
��Auw�de
�%��
��
Nr
pz
���
p�
N�=
��
�
 )2
@$
*�a 0,
�	ql1
p~
�t
�%�1
�M��1
`��6�
�8D��`a��
0r
�B
p]U D
P�4	
���NL
px	�I�ܳe��
���
 �RK>��`�zQ
��
k�
@�
�<d
��
�
�"�/
�,
��
X	,.
0�	N/
 �	s��`  7
��
a_CP�eDt
b��~ �` �
p9
�!/&�h�9u;
���V�)`�Q+
�:�	l
��-��e�S�\s�
P
�ã
 "2b��e	�
 1
..�
�{	��
8
�ig
p]	�
Щ
��
�8*ޒ
�8Ax
P��co
�k
zn*`b�vg �`�uu
��TTv��`��-@b�zkX�eT�
�'
p��
`�1`�
�� �Y�_�?�
��
Q?g
��Ui�`��
���lM8�e�g
PE
ʊp�e�c
p����
��p5��&]`)�e\�-
��R�
�58�
p���I��e�j@�`��t��erx
�%s}
�
��6@�e,}�']x
`�3:
��
9���e��
>h�
��
�3
 �
:1jD
��
 �^
p�œ
�� 48
�����`U\p�)]x
�m`Q\p�"
��
���
��*�Q
��>]�A]�F��`�F�
�;�]9
�"T
p_3$��`�1
P+8C
��!Uq
0�����`�[DȮe�S��e�
0�
�(
 �
�+
P�
��O�b�v� �`��
#�N�`�a��`��O�`���
9",
`��O4
\�PA
���
�Y
`�
Y��
0H
F�
�!�cD�eK�
��
bA?�pd�L
�3�R

��}0
 �%�]
`6M
��9%��
�"W4
���%�
���@�
��)
p�n��;]�x�`�#���ebd
�D|C�e��
��.
`NoS��e�
0� O'
�u
��L
�L�
p�
�I
3�9V�E\p��:]�
�E y�@�`�P�
@��V�
 �_ȭ
 :2�
�}_
�
��
���O
P2�A5`�`�:T
`�
XN
�zL@�_��K
��\q�
��Y���`�4P$e"
@��wؤe֖
@��>J
0�
1�j��`����d#
�;""��`�ߊ
0]Pb�Y\p)�
�:�C"��_�^B
`p
=�
p��<
 �]\
�j	�Ga(�e�8
 �>�FA�e�jD�e�n
�����`	\$X9`��J
��
�:
0u�o<
p5
$UE@�`�'W`&]`sI�e2v
 �A�
����{
�#�4
0I&1#
 
�w�
�*	�)`
�y�7�
����
;	�o
��	Tp
���#9
`��Q
`��ɋ
4��E��e��
`�
$�!
�u\
P�
>�]��e�g
�N�o
�:~
PY=�T
'	&�f
�[�fu
�9n	2�e���`�./ �`��
��
ˑ
@
.�
��/|�
pP�
@E�
p�
2=\
����x;]1g
�^�$H�e'���_��M�]��M
��iC�
��
CFO
к<~`F\��:�e���e?2
��g+@
 z
9T{
��C%��e�M
�	@�`E\p�*��e@3`3\p*e
`2
�j
�ms
��q�K��e�
�;	*��
�pT��]��x�P9e�`�`��
P�	��
�O>`��e��
�(�)�
`	��7
 �ց�`�sM
p6�d�a�kK�A]�Uh�e'n
��6�0
 )M
 :s�3��`�S 
p�
�Kl
@�1'��`�� 
_�W��a����]�Ke
P�Wa}
P�
A�(�e]R
y(b̀
@eTt
h�]YF
@R#J�)b�Pt
P��
0&F��
��>�/
��T�e
�
�x�\� $]0�B
`����`�t�
pl��
��
��eP
@48
@�%�e
p�$�i
�J�j@]��
�����
��
��n
0??��
��
3� &](��
���
��@
�C 
P/��>�A]
�`�F
�7
pix
�=
6�6
�
N]�]6n
�
{Z�
%rN
@�v~
$ԛ
��
�%8j���e7�

_�7
�\5�A@�`��F
`�y6z
@@O`W\p��
@;�W`S\p�^�L\pL�
��E�
��]
`Y�7>
�L9H�`��
>
n9
Х
&�
P�Ȅ��`��6
�(	.�'�e	h
d��v@7`�#�
�;=�`��\
 1Wqw
 �	�ɢ
e
��n
0L	�x�
`�o�97]2
�QRd
�!?�
� �:
��Y�;��`��C
p���h
`��
��	Hy
�O8|9
�
uIE��e�l
 <=�
�7��e>
P�&E�`�/r�eZ��:]�r�:]�
9d}�
�L�J
f	��g
�	 i
���v
�/	�d+�_�N:��`�8B
p#libpthread.so.0_ITM_deregisterTMCloneTable_ITM_registerTMCloneTablepthread_rwlock_tryrdlockpthread_cond_timedwaitpthread_mutex_initpthread_cond_destroypthread_mutexattr_settypepread64pthread_rwlock_trywrlocklseek64pthread_cond_signalpthread_mutexattr_destroypthread_setspecificpthread_cond_initpwrite64pthread_key_deletepthread_onceraisepthread_rwlock_rdlockpthread_cond_waitpthread_mutex_lockrecvpthread_mutex_destroypthread_mutexattr_init__errno_locationpthread_mutex_unlockpthread_getspecificsigactionpthread_rwlock_wrlockpthread_key_createpthread_createpthread_mutex_trylockpthread_cond_broadcastlibssl.so.1.1__gmon_start__SSL_get_verify_resultSSL_writeSSL_shutdownSSL_CTX_set_ciphersuitesSSL_CTX_use_certificate_chain_fileSSL_CTX_newSSL_clearSSL_set_fdSSL_CTX_get_cert_storeSSL_readOPENSSL_init_sslSSL_set_quiet_shutdownSSL_set_ex_dataSSL_CTX_use_PrivateKeySSL_CTX_check_private_keySSL_CTX_set_optionsSSL_get_errorSSL_get_peer_certificateTLS_client_methodSSL_connectSSL_CTX_freeSSL_CTX_set_default_verify_pathsSSL_CTX_set_cipher_listSSL_CIPHER_get_nameSSL_get_SSL_CTXSSL_get_ex_dataSSL_CTX_set_verifySSL_newSSL_CTX_load_verify_locationsSSL_get_current_cipherSSL_freelibcrypto.so.1.1EVP_PKEY_newX509_digestOpenSSL_versionERR_get_errorX509_check_ip_ascX509_STORE_set_flagsERR_peek_errorX509_verify_cert_error_stringX509_freeX509_STORE_load_locationsEVP_sha1X509_check_hostERR_reason_error_stringEVP_PKEY_freePEM_read_PrivateKeylibz.so.1compress2libdl.so.2dlclosedlsymdlopendlerrorlibncurses.so.6vidattrlibtinfo.so.6BCUPPCtgetnumtputstgototgetenttgetflagsetuptermtgetstrlibstdc++.so.6__gxx_personality_v0__cxa_guard_release__cxa_guard_acquirelibm.so.6libgcc_s.so.1_Unwind_Resumelibc.so.6fflushstrcpy__printf_chksprintfsetlocalembrtowctowlowerstrncmpstrrchr__longjmp_chkwcrtombgetpwuidunlinkat__fdelt_chkclosedirstrncpysigprocmask__stack_chk_failunlinkputcharselecttowupperstrpbrkpopengetpidiswalnumiswlower__ctype_get_mb_cur_maxstrtokendpwentstrtolisattyldivfdatasyncfgetsgetpwnamcallocstrlen__mbrlen__cxa_atexitsigemptysetgetaddrinfomemsetstrstrrmdirtcsetattrchdirmemcmpgetsockopttcflow__fxstat64_setjmppoll__fprintf_chksigaddsetctimeiswupperstdoutfputcfseeko64getrusagefputsstrtok_rstrnlenmemcpyfreopen64__memmove_chk__vsnprintf_chkmkostemp64strtoulsetsockoptgetpassstrcatstrcasecmpftello64__lxstat64nl_langinfoopendir__xstat64__ctype_b_locgetenvgetservbynamewcwidthsigdelsetioctl__snprintf_chk__memset_chkgetlogingetuidstrncasecmp__realpath_chkpclosegethostnameusleepgetcwdgeteuid__memcpy_chkclock_gettimelocaltimestrchr__vfprintf_chkreaddir64tcgetattr__ctype_toupper_loc__strcpy_chk__ctype_tolower_loc__cxa_finalizefreeaddrinfo__xpg_strerror_rfcntl64__sprintf_chkmemmovepthread_selffopen64accessopenat64strcmp__libc_start_mainsetpwentferrorstpcpysetenvstrcoll_edata__bss_start_Z18find_longest_matchP9hashtablePcjPj_rl_completion_case_foldthr_set_sync_wait_callbackrl_mark_rl_output_character_functionkey_memory_QUEUE_rl_digit_valuemthd_my_read_one_rowkey_memory_pack_frmmy_longlong10_to_str_8bitmy_charset_utf16_czech_uca_cifatal_error_handler_hookemacs_meta_keymap_rl_enable_metamysql_list_dbsmy_defaults_group_suffixmy_charset_ucs2_unicode_nopad_cirl_forward_bytemysql_fetch_fieldrl_redisplay_functionmy_charset_utf16_persian_uca_ci_Z25mysql_real_query_for_lazyPKcmmy_getwd_rl_with_macro_inputrl_yank_pop_rl_print_completions_horizontallyrl_vi_completemy_like_range_simpleread_history_rangemthd_stmt_read_execute_responsekey_WT_RESOURCE_condplugin_listmy_once_strduprl_forward_wordread_history_rl_clear_screenmy_strdupmy_b_safe_writewhere_history_ZN13Binary_string4copyERKS_my_b_flush_io_cacherl_variable_bindrl_backward_wordhistory_offset_Z16find_all_matchesP9hashtablePKcjPjmy_charset_8bit_handler_rl_term_autowrap_rl_search_getcharmy_time_to_wait_for_lockkey_memory_max_allocamy_charset_latin2_czech_csrl_getc_functionget_global_errmsgsmy_charset_utf16_handlerhistory_searchrl_attempted_completion_overmy_stream_openedgovlve_mutex_trylockma_field_extension_deep_dupfind_typecharset_name_binaryma_pvio_blockingmy_wildcmp_mb_binpvio_socket_fast_sendmy_charset_ujis_japanese_nopad_ci_Z22batch_readline_commandP14st_line_bufferPcmy_uca_collation_handler_nopad_utf8mb4_Z9tee_fputsPKcP8_IO_FILEmariadb_stmt_fetch_fieldsmy_mutex_endmysql_list_dbs_cont_rl_push_executing_macromysql_server_initrl_execute_nextma_zlib_decompressmysql_stmt_row_seek_rl_kill_kbd_macropvio_socket_async_readrl_completion_append_character_rl_output_meta_charsmysql_thread_endrl_initialize_funmapuca520_length_w2my_unicase_unicode520pvio_socket_closemy_charset_binmy_rmtreeget_typecharset_name_utf32_Z21completion_hash_cleanP9hashtable_Z22completion_hash_existsP9hashtablePcjmy_charset_utf8mb4_myanmar_uca_cimy_charset_utf8mb3_sinhala_uca_cimy_uca_collation_handler_utf8mb3my_charset_ucs2_thai_520_w2my_prognamerl_on_new_line_rl_move_cursor_relativerl_maybe_replace_linecopy_typelib_mariadb_compressmy_uca_collation_handler_nopad_ucs2my_hash_init2tls_protocol_versionrl_deprep_terminalmy_wildcmp_unicodemy_uca_collation_handler_generic_rl_add_macro_charmariadb_get_infoma_pvio_tls_get_protocol_version_id_Z9stringcmpPK13Binary_stringS1_rl_copy_keymapmy_mallocget_history_eventmy_messagemysql_stmt_store_result_cont_rl_lowercase_pmy_strxfrm_pad_desc_and_reverserio_pluginmy_charset_utf8mb4_esperanto_uca_cirl_char_searchmy_strxfrm_flag_normalizemysql_statmy_charset_ucs2_unicode_520_nopad_cimy_fopenmysql_closerl_noninc_forward_searchkey_BITMAP_mutexma_pvio_set_timeout_rl_keyseq_chain_disposemysql_fetch_lengthsmy_charset_filenamerl_vi_fWordmy_disable_flush_key_blockscharset_name_utf8mb4rl_vi_start_insertingmy_charset_ucs2_handlerrl_display_promptmy_uca_package_no_contractions_utf8mb3_rl_vi_textmod_command_rl_term_backspace_defaultMARIADB_DEFAULT_METHODSmy_charset_utf8mb3_german2_uca_ci_ZN6StringD1Evno_completionmysql_options4funmap_program_specific_entry_startmy_charset_sjis_japanese_nopad_cima_init_dynamic_arraymax_allowed_packetmysql_free_result_contma_hashtbl_updatemy_defaults_filecharset_name_utf16lemy_strxfrm_pad_nweights_unicodemy_charset_utf8mb4_icelandic_uca_ci_rl_callback_data_allocmy_charset_latin1_nopad_binrl_vi_overstrike_Z36convert_to_printable_required_lengthjmy_getopt_skip_unknownmysql_portmy_hash_sort_8bit_binmy_collation_is_known_idmy_getopt_prefix_matching_ZZNK21Client_field_metadata34print_data_type_related_attributesEP13Binary_stringE6formatinit_client_errsstrcontmysql_shutdown_contmy_strnxfrmlen_unicode_full_binmy_fcvtrl_vi_tilde_expandmy_charset_ucs2_unicode_520_cimy_setwd_my_signalsmy_hash_sort_latin1_demy_tellmysql_stmt_execute_contrl_completion_query_itemsmysql_stmt_fetch_cont_ZN6String6appendEPKcm_rl_pop_executing_macronet_write_timeoutstr2intma_pvio_has_datamy_charset_eucjpms_japanese_ci_Z7sortcmpPK13Binary_stringS1_PK15charset_info_stkey_memory_MY_STATkey_memory_IO_CACHErl_username_completion_function_rl_set_screen_sizemy_string_repertoire_rl_nsearch_callbackmysql_affected_rowsrl_menu_completerl_vi_arg_digitcharset_name_latin2my_charset_ucs2_persian_uca_cimy_uca_can_be_contraction_tail_ZN13Binary_string7replaceEjjPKcj_rl_screencharshistory_set_poskey_IO_CACHE_SHARE_cond_writerkey_memory_MY_BITMAP_bitmapMADB_OS_CHARSETkey_memory_SAFE_HASH_ENTRYmy_error_registermysql_set_server_optionmy_interval_timerkey_memory_DYNAMIC_STRINGrl_reset_line_state_ZN6String7set_intExbPK15charset_info_st_Z27mysql_store_result_for_lazyPP12st_mysql_resmysql_pingmysql_stmt_send_long_data_contmy_charset_repertoire_ZN6String12copy_alignedEPKcmmPK15charset_info_st_rl_arg_callback_rl_term_immysql_get_client_versionmy_charset_utf32_croatian_mysql561_uca_cimysql_thread_safemy_charset_cp1250_czech_csrl_dump_variables_rl_find_next_mbcharmysql_stmt_errormysql_client_builtins_ZN6String9set_asciiEPKcm_rl_term_gotomy_wc_to_printable_exmysql_ps_fetch_functionsrl_vi_char_searchrl_vi_delete_tomy_charpos_mbrl_bind_keypsi_rwlock_rdlockmy_unicase_mysql500ma_getsmy_charset_ucs2_spanish2_uca_cimy_charset_utf8mb3_turkish_uca_cirl_variable_valuemy_uca_collation_handler_nopad_multilevel_utf8mb4strmov_overlapprl_insert_mode_rl_term_up_defaultenabled_my_optionmysql_refreshcharset_name_big5rl_library_versionmy_charset_utf8mb4_nopad_binmy_wildcmp_ucarl_end_of_linemysql_real_querymysql_set_character_sethistory_total_bytesmthd_my_send_cmdmy_charset_utf8mb4_danish_uca_cimy_charset_latin1rl_invoking_keyseqsget_collation_numbermy_charset_utf32_hungarian_uca_cimy_thread_global_init_IO_stdin_usedmy_charset_utf16_turkish_uca_cimy_strxfrm_desc_and_reversemy_disable_lockingrl_arrow_keysrl_beg_of_linecleanup_dirnamerl_stop_outputmysql_stmt_next_resultrl_add_funmap_entrymy_wc_mb_binma_pvio_tls_initmy_charset_utf16le_nopad_binmy_hash_freemy_charset_utf8mb4_romanian_uca_cirl_set_keymy_hash_replacemy_hash_nextmy_charset_utf8mb4_lithuanian_uca_cikey_LOCK_timer_ZN13Binary_string9qs_appendEdma_pvio_tls_check_fpkey_THR_LOCK_charsetmysql_stmt_close_startrl_event_hookma_pvio_keepalivema_hashtbl_deletedebug_sync_C_callback_ptr_rl_isearch_callbackmysql_send_querymysql_real_escape_stringrl_get_termcapma_pvio_tls_readma_randominit_Z8tee_putciP8_IO_FILErl_restore_staterl_num_chars_to_readmysql_list_processesmy_charset_utf16_spanish2_uca_cirl_vi_fetch_historymysql_query_startmy_charset_utf32_unicode_520_nopad_cinormalize_dirname_ZN13Binary_string7set_hexEy_rl_pure_alphabeticrl_replace_linemy_tmp_file_created_rl_vi_last_commandrl_initialize_ZN6String27needs_conversion_on_storageEmPK15charset_info_stS2_my_print_default_filesmysql_kill_startmy_instr_mbmysql_get_parametersrl_character_lenmysql_free_resultmy_endmy_thread_dbug_idrl_start_kbd_macromake_typereadline_echoing_prl_save_staterl_set_retained_killsma_tls_write_asyncmysql_use_resultma_feoffind_type_with_warningrl_save_promptstrlengthma_pvio_tls_verify_server_certmy_max_str_mb_simplerl_resize_terminal_rl_dispatching_keymapmy_freopenmysql_next_result_startrl_ruboutmy_disable_async_iomy_charset_tis620_thai_nopad_cimysql_set_character_set_contmy_charset_ucs2_polish_uca_cimysql_num_rowsmy_strcasecmp_mb_binmy_charset_utf8mb3_vietnamese_cimy_charlen_8bitmysql_real_query_startmy_uca_collation_handler_multilevel_ucs2my_vfprintfmysql_kill_contvi_movement_keymapkey_memory_TREEmy_charset_utf8mb4_thai_520_w2bchangemy_uca_package_genericrl_readline_versionmysql_autocommitmysql_autocommit_contma_charset_binmy_uca_v400multi_alloc_rootrl_set_keyboard_input_timeouttilde_expansion_preexpansion_hookmy_charset_eucjpms_japanese_nopad_cikey_IO_CACHE_append_buffer_lockmy_register_filenamemy_uca_collation_handler_multilevel_utf8mb3my_atodrl_vi_redomy_charset_latin1_nopadmysql_reset_connection_startmy_uca_collation_handler_nopad_multilevel_ucs2my_charset_sjis_nopad_binmy_sync_dirmy_message_stderrmy_charset_ucs2_slovak_uca_ci_rl_compare_charsma_SHA1Finalmy_charset_utf8mb4_estonian_uca_cimy_xml_parser_freemysql_row_telllibgovernor_write_log_exrl_completer_quote_characterskey_memory_lf_slistgovlog_enabled_tags_rl_term_eipvio_socket_is_blockingrl_dump_functionsrl_add_undorl_dispatchingmy_uca_collation_handler_nopad_utf32my_charset_ucs2_lithuanian_uca_cimy_charset_euckr_korean_nopad_cimy_charset_ucs2_nopad_binma_pvio_register_callbackremove_historykey_memory_charsetsrl_vi_bword_rl_term_pcrl_clear_messagema_SHA1Initallocate_dynamicmy_xml_parser_create_rl_term_DChistory_get_timemy_charset_cp932_japanese_cihistory_set_history_statemysql_reset_connection_continit_io_cache_sharerl_deletemy_charset_utf32_icelandic_uca_cimysql_cset_escape_quotesmysql_fetch_field_directmy_charset_utf8mb3_czech_uca_cimy_context_install_suspend_resume_hookrl_vi_columnmy_charset_utf8mb3_polish_uca_cima_alloc_root_rl_qsort_string_compare_mariadb_read_optionsget_charset_rl_history_saved_pointmysql_client_plugin_initrl_bind_key_if_unboundma_open_ZZNK21Client_field_metadata34print_data_type_related_attributesEP13Binary_stringE4typerl_vi_insertion_modemariadb_convert_stringmy_have_got_alarm_rl_parsing_conditionalized_outmy_readlinkmariadb_get_charset_by_nameis_prefixmy_hash_sort_mb_nopad_binmy_charset_utf8mb3_romanian_uca_cimy_reallocset_malloc_size_cbmariadb_get_infovmy_strnncollsp_nchars_genericmy_utf16_unimy_charset_utf16le_binrl_attempted_completion_functionma_send_connect_attr_rl_argcxtmysql_stmt_initma_pvio_tls_set_connectionma_stmt_execute_generate_simple_request_ZN13Binary_string12copy_or_moveEPKcmdisabled_my_optionma_pvio_tls_writemy_charset_ucs2_unicode_cimy_charset_utf16_general_cirl_bind_keyseq_if_unbounddestroy_prepared_stmt_noopmy_charset_utf32_unicode_nopad_cimy_collation_8bit_nopad_bin_handlermy_unicase_pages_unicode520my_qsortrl_basic_quote_characters_Z14batch_readlineP14st_line_bufferbrl_history_search_forwardmy_charset_utf8mb4_latvian_uca_cirelease_configuration_dirsrl_make_keymapmysql_list_fieldsrl_set_signalsrl_dingma_stmt_execute_generate_bulk_requestma_save_session_track_inforl_unbind_key_in_maprl_filename_quote_characters_Z18batch_readline_endP14st_line_bufferrl_parse_and_bindma_pvio_start_sslvi_insertion_keymapmy_uca_package_utf8mb4my_charset_utf32_polish_uca_cimy_charset_utf8mb3_general_cima_pvio_is_blockingmy_uca_collation_handler_nopad_multilevel_utf8mb3my_uca_package_ucs2rl_kill_linemy_charset_utf8mb3_unicode_520_nopad_cimy_charset_utf32_romanian_uca_cimy_freema_pvio_connectmysql_stmt_fetch_startinit_glob_errsadd_history_timemysql_stmt_row_tell_rl_backspacema_free_roothistory_max_entriescurr_dirmy_uca_collation_handler_utf32_rl_update_finalpvio_socket_shutdownkey_THR_LOCK_heapmy_hash_sort_simple_nopadmy_charset_utf16le_general_cimysql_stmt_field_countpvio_socket_set_timeoutrl_kill_regionma_pvio_fast_sendmax_input_history_rl_control_keypadtilde_additional_suffixesma_pvio_tls_closerl_untranslate_keyseqmy_dirrl_delete_or_show_completionsrl_redisplayadd_compiled_extra_collationma_pop_dynamic_rl_complete_show_unmodified_rl_strindexrl_crlfma_pvio_get_handlemy_charset_utf16_icelandic_uca_cirl_forced_update_displayall_mysys_stages_rl_match_hidden_files_rl_meta_flagrl_on_new_line_with_promptrl_noninc_reverse_search_againmysql_num_fieldsrw_pr_destroymy_numchars_mbmy_charset_utf8mb4_unicode_520_nopad_cimy_charset_utf32_slovenian_uca_cirl_set_keymapmy_snprintf_rl_digit_palloc_history_entrymy_sync_dir_by_filekey_memory_LISTmy_memdupmysql_query_contmy_charset_utf8mb3_spanish_uca_cimy_charset_cp932_bin_ZN13Binary_string13qs_append_hexEPKcjrl_unix_filename_rubouttilde_expansion_failure_hookmy_mutex_initrl_completion_matchesrl_alphabeticmysql_send_query_contset_default_charset_by_namemysql_get_timeout_valuemysql_init_ps_subsystemrl_insert_closepsi_prlock_rdlock_rl_term_dc_ZN6String15append_semi_hexEPKcjPK15charset_info_strl_callback_handler_removemy_charset_utf8mb3_estonian_uca_cirl_terminal_namemy_uca_collation_handler_multilevel_utf32my_is_symlinkrl_visible_statsmy_errormysql_field_seekhome_dir_buffmy_caseup_mbrl_line_buffer_lenrl_backward_bytemthd_stmt_read_all_rows_rl_fix_point_ZN13Binary_string6shrinkEm_rl_read_mbcharmysql_stmt_free_result_startmysql_close_cont_Z8add_wordP9hashtablePcmy_uca_collation_handler_nopad_utf16govlve_slot_releasetest_if_hard_pathkey_THR_LOCK_openrl_abortmy_context_initmysql_session_track_get_firstmy_string_metadata_getma_pvio_tls_endrl_invoking_keyseqs_in_mapmy_xml_error_stringmy_charset_utf8mb3_unicode_ci_rl_vis_botlinma_pvio_closerl_ignore_completion_duplicatesmysql_stmt_data_seekrl_pointma_delete_dynamicrl_arg_signma_tls_get_finger_printmy_strnncoll_simplerl_history_search_backwardrl_blink_matching_parenmy_unicase_default_pagesmysql_hex_string_rl_char_search_internalmy_caseinfo_cp932my_uca_collation_handler_multilevel_utf8mb4mthd_my_skip_result_rl_any_typeinmy_charset_utf32_roman_uca_cima_net_write_commandmysql_stmt_preparemy_dirend_rl_move_vertmy_caseup_str_mbrl_function_of_keyseqrl_binding_keymapmysql_change_userrl_upcase_word_rl_dispatchmy_hash_sort_mb_binmy_charset_gbk_bin_rl_overwrite_charmysql_stmt_close_rl_mark_modified_linesma_charset_utf16le_general_cimysql_data_homemysql_get_proto_inforl_bind_key_if_unbound_in_mapmy_charset_utf32_danish_uca_cimy_charset_utf8mb4_general_cigetopt_ll_limit_valuerl_get_keymap_name_from_edit_modekey_memory_lf_dynarraymy_charset_utf16_unicode_cima_dynstr_reallocma_hashtbl_freemysql_thread_idmysql_real_query_contmy_hrtimemy_strnncollsp_padspace_binhistory_write_timestampsmysql_refresh_contmy_charset_gb2312_nopad_binmy_charset_utf8mb4_german2_uca_cirl_completion_quote_characterkey_thread_timer_rl_saved_line_for_historylist_lengthma_pvio_wait_io_or_timeoutrl_byte_orientedkey_memory_charset_loaderstrmake_rootrl_basic_word_break_charactersmy_readmy_charset_utf16_general_nopad_cimysql_next_resultrl_quoted_insertrl_directory_completion_hookrl_noninc_forward_search_againma_dynstr_setrl_tab_insertrl_line_buffermy_8bit_collation_flags_from_data_rl_insert_typeinmysql_stmt_reset_startmy_unicase_defaultrl_completion_entry_functionmy_wc_to_printable_genericlist_consmy_charset_get_contractionsmy_charset_utf8mb4_croatian_uca_ci_rl_term_upmy_charset_utf8mb4_unicode_cimy_charset_utf8mb4_persian_uca_cimy_xml_error_posmysql_session_track_get_nextmy_get_tty_password_rl_iscxtmy_charset_ucs2_croatian_mysql561_uca_cimysql_stat_contmysql_stat_startrl_stuff_char_ZN13Binary_string7set_hexEPKcj_rl_init_terminal_io_ZN13Binary_string15append_longlongExrl_gnu_readline_prndmy_charset_utf32_myanmar_uca_cimy_printv_error_rl_keymapmy_disable_symlinksrl_list_funmap_namesmy_charset_ucs2_romanian_uca_cimy_handle_options_init_variableskey_memory_my_err_headmy_snprintf_8bitpvio_socket_async_writeset_psi_server_rl_doing_an_undomy_pwritemy_thread_global_endmy_uca_package_utf8mb3my_convert_fixkey_file_charsethistory_word_delimiters_rl_possible_meta_prefixesmy_charset_utf8mb3_esperanto_uca_cirl_extend_line_buffermy_charset_utf32_general_nopad_cipsi_cond_timedwaitmy_copy_8bitmysql_select_db_contrl_dump_macrosmy_propagate_simple_rl_screenwidthmysql_stmt_next_result_cont_rl_enable_meta_key_my_sig_rememberquick_max_column_widthmy_load_pathrl_vi_insert_begmysql_stdinrl_copy_forward_wordmysql_real_connectmysql_list_tables_startmy_xml_error_linenoma_dynstr_append_memma_charset_latin1key_file_io_cachemy_defaults_extra_filemy_charset_utf16_nopad_binmy_hash_sort_simplesql_protocol_typelibmy_charset_utf32_vietnamese_cimy_charpos_8bitmy_uca_package_utf16govlve_slot_reserveunpack_fieldsma_invalidate_stmtsrl_visible_prompt_lengthma_net_readrl_kill_full_linema_charset_utf8_general_cimy_charset_is_ascii_based_rl_complete_mark_directories_rl_convert_meta_chars_to_asciirl_filename_quoting_functionrl_capitalize_wordkey_TMPDIR_mutex_Z8tee_putsPKcP8_IO_FILErl_get_keymap_namedelete_dynamic_with_callbackma_ll2strget_charset_by_csname_rl_find_completion_wordmy_crypt_ZN13Binary_string9qs_appendEPKdrl_restart_outputreplace_history_entrymy_charset_gbk_chinese_cimy_xml_set_value_handler_rl_to_upperrl_yank_nth_argreprepare_prepared_stmt_noop_Z25my_copy_with_hex_escapingPK15charset_info_stPcmPKcmmy_unicase_mysql500_pagesrl_vi_ruboutrl_endmy_fprintfmy_closemysql_debugdirname_partmy_seekmy_charset_euckr_korean_cimy_charset_big5_binmthd_stmt_flush_unbufferedkey_memory_THD_ALARMsql_protocol_names_librl_end_kbd_macro_ZN13Binary_string7reserveEmmrl_vi_search_againnet_buffer_lengthma_pvio_tls_cipher_rl_vi_done_insertingmy_thread_initmy_fstatmy_charset_utf8mb3_thai_520_w2my_charset_utf8mb3_croatian_uca_ci_rl_nscxtmy_charset_utf8mb3_roman_uca_cimy_uca_collation_handler_nopad_utf8mb3rl_vi_editing_modehas_pathmy_sleep_for_spacema_duplicate_resultset_metadatamysql_stmt_execute_startmy_charset_ucs2_german2_uca_cirl_copy_backward_wordfree_rowsmy_charset_ujis_binrl_free_undo_listrl_readline_namemy_strtoll10mysql_stmt_result_metadatarl_pre_input_hookma_net_endrl_completion_display_matches_hookcharset_name_euckrmysql_store_result_rl_scxt_allocmysql_net_store_lengthmy_like_range_genericmysql_list_fields_contmysql_select_db_startmy_vsnprintfma_init_donemthd_stmt_fetch_to_bind_ZN6String4copyEPKcmPK15charset_info_stS4_Pjmy_8bit_charset_flags_from_data_my_b_writema_tls_end_ZN13Binary_string20qs_append_hex_uint32Ejmy_uca_collation_handler_nopad_multilevel_utf16rl_discard_keymapint10_to_strkey_memory_KEY_CACHEmysql_querymy_lengthsp_8bitpsi_rwlock_tryrdlockcharset_name_tis620rl_numeric_argrl_forward_charmysql_select_db_rl_restore_tty_signalsmy_thread_destroy_internal_mutexreplace_history_datamy_thread_stack_sizemy_charset_utf8mb4_slovenian_uca_cirl_delete_horizontal_spacerl_deprep_term_functionkey_THR_LOCK_mallocmy_casedn_str_8bit_rl_screenheightkey_memory_charset_fileVERterminal_widthrl_complete_with_tilde_expansionmysql_read_query_resultmy_hash_searchSQLSTATE_UNKNOWN_rl_out_streammy_filename_rl_erase_at_end_of_line_rl_savestringgovlve_mutex_lockpvio_socket_get_handlemysql_stmt_param_countrl_reset_screen_sizeend_slave_io_cacherl_free_line_statemy_uca_collation_handler_utf16mysql_inforl_completereadlineinit_compiled_charsets_ZN6String23append_for_single_quoteEPKcmmysql_stmt_send_long_data_startrl_linefuncrl_forward_search_historyhistory_expansion_char_ZNK13Binary_string6strstrERKS_jmy_fdopenhistory_quotes_inhibit_expansionmariadb_deinitialize_sslhistory_expandmy_collation_8bit_simple_ci_handlerma_multi_commandmy_charset_utf8mb3_unicode_520_cimysql_field_countmy_mb_ctype_mb_rl_replace_textrl_completer_word_break_charactershandle_optionsmy_charset_utf16le_general_nopad_cimysql_shutdowndummy_fallback_client_pluginmy_thr_key_mysys_existsmy_charset_utf8mb4_binmy_charset_big5_chinese_nopad_cirl_callback_read_charmthd_supported_buffer_typemy_file_info_defaultmy_strxfrm_pad_unicoderl_key_sequence_lengthmy_syncrl_unix_word_ruboutmy_charset_tis620_binrl_insert_completions_ZNK6String5printEPS__Z14get_one_optionPK9my_optionPKcS3__Z20completion_hash_initP9hashtablejmy_casedn_ujiskey_file_cnfmy_once_root_blockmysql_get_host_infomy_charset_utf16_latvian_uca_cimy_convertmy_charset_utf8mb3_general_nopad_cimysql_escape_stringunpack_filenamehistory_comment_charmy_charset_ucs2_czech_uca_cimy_charset_latin1_german2_cimy_charset_ucs2_slovenian_uca_ci_rl_copy_undo_listkey_LOCK_alarmkey_THR_LOCK_mutex_rl_possible_control_prefixesrl_push_macro_input_rl_arg_overflowmy_collation_statistics_get_use_countma_init_alloc_root_rl_bind_stty_charsmy_renamerl_variable_dumperpvio_socket_wait_io_or_timeoutma_pvio_is_alivemysql_ssl_setmy_charset_utf16_binmy_strerrormy_numcells_mbmy_charset_utf32_german2_uca_cimy_charset_utf32_handlerrl_downcase_wordmysql_set_local_infile_defaultgetopt_double_limit_value_ZN13Binary_string9qs_appendEPKcmmysql_stmt_attr_setmy_getopt_error_reporter_my_b_readmysql_close_slow_part_contget_default_configuration_dirsmysql_ping_contmy_charset_get_by_namemy_strntoul_8bitmy_strndup_rl_set_the_linemy_charset_gb2312_binma_fcvtrl_unix_line_discardmy_charset_loader_init_mysys_rl_callback_datamy_charset_utf8mb4_handlerma_tls_get_ciphermysql_commitmy_context_spawnrl_editing_modedefault_dbug_option_rl_overwrite_ruboutrl_add_defunrl_do_undouca520_lengthkey_my_thread_var_suspendmy_charset_utf16_unicode_520_cima_tls_readmy_charset_utf32_turkish_uca_cimy_charset_utf8mb3_spanish2_uca_cimysql_next_result_contrl_last_funcstore_paramrl_copy_region_to_killmysql_change_user_start_rl_set_insert_modemy_uca_collation_handler_multilevel_utf16rl_bind_keyseq_in_mapmy_charset_utf8mb4_vietnamese_ciclear_historymy_strcasecmp_mblist_freemysql_dump_debug_infomy_charset_utf32_croatian_uca_cimy_charset_utf8mb3_latvian_uca_cilist_walk_rl_term_crrl_generic_bindkey_THR_LOCK_lockps_fetch_from_1_to_8_bytesmysql_commit_contmysql_character_set_namemy_charset_utf32_sinhala_uca_ci_my_thread_varrl_complete_internalsf_leaking_memoryma_net_initmy_charset_utf8mb4_hungarian_uca_cimysql_get_ssl_cipherrl_tilde_expand_rl_arg_initma_dynstr_appendmy_umask_dirrl_startup_hookmy_hash_first_from_hash_valuesystem_filenamemy_charset_sjis_japanese_cimy_realpathmysql_stmt_fetchrl_instreamstrcendmy_uca_v520_thmy_file_total_openedmy_charset_utf16_unicode_nopad_cimy_use_symdircharset_name_gbk_rl_dispatch_callbackgetopt_ulonglong2doubleproc_info_hook_rl_free_history_entrymy_uca_collation_handler_ucs2rl_directory_rewrite_hook_rl_make_prompt_for_searchmy_charset_ucs2_icelandic_uca_cimysql_store_result_start_ZN13Binary_string4fillEmcmysql_stmt_prepare_contmy_charset_utf8mb3_slovenian_uca_cima_tls_get_passwordrl_callback_handler_installmy_preadrl_backward_kill_linemy_uca_collation_handler_nopad_multilevel_utf32resolve_collationma_default_charset_inforl_insert_commentmthd_my_read_rows_rl_isearch_terminatorsrl_completion_suppress_appendrl_vi_bracktypema_hashtbl_searchmy_charset_ucs2_swedish_uca_cimy_strnxfrmlen_simplemysql_data_seekmy_xml_parsemariadb_compiled_charsetsrl_completion_found_quotemy_init_done_Z20completion_hash_freeP9hashtablepvio_socket_methodsmy_numcells_8bitpsi_prlock_wrlockmy_thread_destroy_common_mutexmy_deletemy_min_str_8bit_simplerl_overwrite_modemy_xml_set_user_datamy_charset_utf16_danish_uca_cirl_vi_searchrl_yank_last_argmy_copy_fix_mbmysql_real_connect_start_rl_in_streammy_charset_utf8mb3_bin_ZGVZNK21Client_field_metadata34print_data_type_related_attributesEP13Binary_stringE6formatmy_charset_utf32_lithuanian_uca_cipvio_socket_writerl_vi_bWordmy_charset_ucs2_turkish_uca_cimysql_stmt_bind_resultma_init_dynamic_stringrl_vi_undomysql_stmt_num_rowsmy_charset_utf8mb4_swedish_uca_ci_rl_start_using_historyreadline_internal_teardownma_scramble_41ma_net_clearmy_charset_utf16_myanmar_uca_cimy_collation_get_tailoringmy_uni_ctypemy_wc_mb_8bitsh_unset_nodelay_modepsi_mutex_lockgetopt_double2ulonglongnet_get_errorhistory_is_stifledrl_read_init_filemysql_fetch_rowmy_wc_to_printable_8bitmy_wildcmp_8bitlist_addmy_no_defaultsmy_charset_cp932_japanese_nopad_ciset_prealloc_rootmysql_client_plugin_deinitrl_already_promptedhistory_length_ZNK13Binary_string6strstrEPKcjjmysql_stmt_store_result_startmysql_send_query_startmy_charset_utf32_czech_uca_cimy_charset_utf8mb4_unicode_520_cimthd_stmt_read_prepare_responsemy_initrl_backward_charmy_charset_utf8mb4_roman_uca_cima_tls_verify_server_certrl_clear_pending_inputmy_hash_iteratemthd_my_read_query_resultmy_strnxfrm_unicode_full_bin_rl_pushed_input_availableMARIADB_APImysql_row_seekma_check_buffer_boundariesmy_charset_ucs2_croatian_uca_cimy_disable_syncrl_named_functionmy_charset_utf32_unicode_ciescape_string_for_mysqlmy_charset_utf32_estonian_uca_cimy_gcvt_rl_allow_pathname_alphabetic_charskey_memory_newstrnmovgovlve_mutex_unlockrl_expand_promptmy_charset_utf32_spanish2_uca_cirl_char_is_quoted_prl_vi_yank_toma_multi_mallocmy_strnncollsp_nchars_generic_8bit_rl_adjust_pointmy_once_alloctilde_expand_wordma_net_real_write_rl_want_redisplayrl_undo_commandreal_open_cached_filema_pvio_writewait_for_free_space_rl_comment_beginmy_fileno_rl_input_queuedmysql_get_optionmysql_fetch_row_startmy_charset_ucs2_latvian_uca_ciget_charset_namerl_macro_dumper_rl_kscxtcharset_name_eucjpmsrl_pending_inputmy_charset_utf8mb3_unicode_nopad_cimysql_errormy_uca_collation_handler_nopad_no_contractions_utf8mb4key_LOCK_uuid_generator_rl_callback_data_disposema_memdup_rootmy_strnxfrm_mb_internalrl_vi_change_charrl_reset_after_signalkey_THR_COND_threadsmysql_killrl_vi_overstrike_deletefree_defaultsmysql_get_server_name_ma_hashtbl_initmy_hash_resetrl_modifyingrl_discard_argumentconvert_dirnamemy_casedn_str_mbmy_init_mysys_psi_keys_rl_insert_charstrxnmovmy_print_variablesmy_caseup_str_8bitreset_root_defaultsmysql_get_charset_by_nrmy_charset_error_reportermy_charset_utf32_slovak_uca_cimy_fcloserl_unbind_function_in_maprl_transpose_charsmy_context_continuerw_pr_rdlockrw_pr_unlocksh_set_lines_and_columnskey_THR_LOCK_myisam_mmapmy_uca_collation_handler_multilevel_no_contractions_utf8mb3my_charset_utf16_esperanto_uca_cimysql_get_client_infoma_tls_closenew_ma_field_extensionmysql_stmt_bind_param_ZNK13Binary_string7strrstrERKS_jrl_get_keymapmy_charset_utf32_unicode_520_ci_rl_current_display_lineemacs_standard_keymapxfreemy_dont_interruptmy_charset_utf8mb4_czech_uca_cima_pvio_initmy_thread_endma_simple_commandmysql_stmt_store_resultrl_display_fixed_ZN6String16needs_conversionEmPK15charset_info_stS2_Pjmysql_rollback_startupdate_malloc_sizemy_charset_ucs2_binmy_file_limitmysql_server_endmy_printf_error_rl_uppercase_pmysql_client_register_pluginsh_single_quoterl_vi_set_markma_hashtbl_elementrl_explicit_arggloberrsrl_translate_keyseqmy_uca_collation_handler_nopad_multilevel_genericmysql_stmt_affected_rowsma_tls_start_rl_char_valuema_dynstr_append_quotedmy_charset_utf16_vietnamese_ci_ZN6StringD2Ev_rl_scxt_disposerl_cleanup_after_signaladd_historymysql_dump_debug_info_contmy_errmsgrl_erase_empty_linemy_charset_utf32_general_cimysql_set_local_infile_handler_rl_term_clreolrl_completion_word_break_hookrl_rubout_or_deleterl_tty_statushistory_subst_char_ZN6String6appendEPKcmPK15charset_info_stmysql_list_dbs_startrl_revert_linerl_insert_textmy_charset_utf16_hungarian_uca_cimy_strntoull10rnd_8bitmysql_fetch_fieldsmy_charset_utf16_roman_uca_cirl_getcma_pvio_cache_readpvio_socket_readmysql_find_charset_namema_readmysql_handle_local_infilemy_charset_utf8mb3_persian_uca_cirl_vi_deletepvio_socket_change_timeoutfn_ext_Z7hashpjwPKcjreadline_top_levelrl_prep_terminalmysql_net_read_packetrl_bind_keyseqmy_charset_tis620_nopad_binrl_noninc_reverse_searchhistory_tokenizemysql_commit_startrl_set_markis_file_markerget_charsets_dirkey_my_thread_var_mutexstr_to_TIMEmy_print_defaults_ZN13Binary_string10real_allocEmcharset_name_cp1250rl_vi_putmysql_stmt_more_results__data_start_mysql_stmt_use_resultmy_charset_cp932_nopad_binxreallocrl_end_undo_groupmy_fseekrl_vi_eof_maybemy_charset_utf8mb4_spanish_uca_cimy_charset_utf8mb3_icelandic_uca_cihistory_arg_extractPSI_servercharset_name_ujismy_open_rl_vi_initialize_linekey_memory_lf_nodexmalloc_rl_term_clrpagmy_charset_utf8mb4_sinhala_uca_cimy_hash_sortmy_charset_utf32_nopad_binmy_caseup_8bit_ZGVZNK21Client_field_metadata34print_data_type_related_attributesEP13Binary_stringE4typemy_charset_utf32_thai_520_w2my_fast_mutexattr_rl_clear_to_eol_ZN13Binary_string4copyEvreinit_io_cachemy_uca_collation_handler_no_contractions_utf8mb3_rl_enable_paren_matchingmy_casedn_mb_rl_abort_internalreadline_internal_charmy_charset_ucs2_danish_uca_ci_rl_get_char_lenma_hash_passwordmy_sync_countmy_charset_utf8mb4_unicode_nopad_ci_rl_arg_getcharma_delete_dynamic_elementtilde_additional_prefixesrl_vi_ewordrl_newline_rl_walphabeticrl_set_keymap_from_edit_moderead_user_namekey_THR_LOCK_netget_charset_numbermy_set_errorrl_vi_checkmy_strxfrm_pad_desc_and_reverse_nopadrl_catch_sigwinchhistory_get_history_statedirname_lengthrl_yankmy_collation_8bit_bin_handlermy_uca_package_utf32my_charset_ucs2_general_cima_int_hash_freemysql_stmt_sqlstatepvio_socket_connectmysql_warning_countzlib_client_pluginrl_maybe_unsave_linerl_vi_domoveclose_cached_fileremove_io_threadadd_compiled_collationrl_executing_keymapmysql_free_result_startrl_kill_wordpsi_rwlock_wrlockmy_charset_gb2312_chinese_nopad_cirl_tty_set_default_bindingsrl_completion_modekey_memory_MY_DIRrl_filename_completion_functionma_tls_initmysql_sqlstatema_hashtbl_insertmy_vsnprintf_exmysql_rollbackmy_uca_package_no_contractions_utf8mb4my_charset_utf8mb3_lithuanian_uca_ci_rl_free_match_listmy_xml_set_enter_handlerrl_unbind_command_in_map_ZN13Binary_string6appendEP11st_io_cachejmy_statrl_vi_next_wordrl_vi_first_printrl_vi_fword_my_b_getinit_slave_io_cache_rl_term_ipma_initma_make_scrambled_passwordmy_charset_utf16_croatian_uca_cirl_prep_term_functionmy_getopt_print_errorsmy_strcasecmp_8bitrl_special_prefixesrl_completion_typemy_charset_utf8mb4_general_nopad_cimy_charset_utf16_spanish_uca_cirl_vi_matchma_net_safe_readmy_charset_big5_chinese_cimy_assert_on_error_rl_clean_up_for_exit_rl_vi_set_last_ZN13Binary_string4copyEPKcmrl_set_paren_blink_timeoutmysql_get_server_inforl_kill_textmariadb_stmt_execute_directmysql_reset_connectionrl_backward_kill_wordmy_charset_utf16_estonian_uca_ciunstifle_historyma_pvio_readmysql_old_password_client_plugin_Z22completion_hash_updateP9hashtablePcjS1_mysql_close_startrl_display_match_list_rl_last_v_posmy_charset_ucs2_spanish_uca_cimy_charset_utf16_sinhala_uca_cikey_IO_CACHE_SHARE_mutexmy_max_str_8bit_simplemy_unicase_mysql500_page00key_COND_timer_rl_complete_show_allma_freeze_sizeseek_io_cachemy_charset_ucs2_roman_uca_cirl_completion_mark_symlink_dirsmysql_stmt_free_result_cont_ZN13Binary_string8set_fcvtEdjrun_plugin_authmy_hash_firstmy_propagate_complex_rl_page_completionsrl_backward_char_searchmy_casedn_8bitrl_exchange_point_and_markmy_uca_collation_handler_multilevel_no_contractions_utf8mb4_rl_isearch_dispatchmy_strntod_8bitmy_charset_utf8mb4_croatian_mysql561_uca_cimy_block_writema_get_dynamicpvio_socket_is_alivemy_charset_ucs2_general_mysql500_ci_rl_input_availablema_tls_set_connectionmy_uca_can_be_contraction_headmysql_stmt_warning_countrl_inhibit_completion_rl_term_ICmy_fill_8bitmariadb_cancelmy_once_extrasoundex_maplist_reversegovlog_unconditional_log_if_rl_keyseq_cxt_disposemysql_optionsvmy_strnxfrm_unicode_full_bin_internalpvio_socket_keepalivemy_ftellmysql_errno_ZN13Binary_string9qs_appendEymy_charset_ucs2_sinhala_uca_ci_rl_unget_charmy_context_yieldmy_scan_8bitrl_read_keycharset_name_sjismy_writeinit_io_cache_exttls_library_versionmthd_stmt_get_result_metadatamysql_stmt_param_metadatarl_maybe_save_linereadline_internal_setuppsi_rwlock_trywrlockcharset_name_gb2312rl_funmap_namesmy_min_str_mb_simplemysql_dump_debug_info_startma_endrl_macro_bind_ZN13Binary_string19copy_printable_hhhhEPK15charset_info_stS2_PKcmmy_charset_utf16_slovenian_uca_cimysql_read_query_result_contmysql_store_result_contrl_forward_rl_to_lower__libc_csu_initmysql_set_server_option_cont_rl_copy_undo_entrymysql_get_timeout_value_msescape_quotes_for_mysqlsh_get_env_valuekey_IO_CACHE_SHARE_condmy_getcputimeintern_filenamema_bmove_uppmy_uca_collation_handler_multilevel_genericmy_long10_to_str_8bitmadb_get_os_character_setrl_filename_completion_desiredmy_global_flagsmysql_unix_portarray_append_string_unique_ZN13Binary_string9qs_appendEimysql_stmt_next_result_startrl_refresh_linemy_hash_update_rl_undo_group_level_rl_set_cursor_ZN6String8strip_spEvmysql_change_user_cont_ZN13Binary_string16append_ulonglongEymy_string_stack_guardmy_charset_utf32_swedish_uca_cima_closemysql_stmt_attr_getmy_connect_asyncmy_charset_utf8mb4_spanish2_uca_cirl_vi_change_caseresolve_charsetmysql_initmysys_test_invalid_symlinkrl_emacs_editing_modemy_charset_utf16_polish_uca_ci_rl_disable_tty_signalsmy_cleanup_optionsmysql_list_processes_startmy_charset_utf8mb4_polish_uca_ci_rl_redisplay_after_sigwinchmysql_get_optionv_rl_term_forward_charmy_charset_eucjpms_binmove_root_rl_erase_entire_linestrxmovmy_hash_deletemy_charset_tis620_thai_cicreate_temp_fileTHR_KEY_mysysmy_strnxfrm_mb_nopadmy_hash_insertmysql_list_fields_startmy_charset_gbk_nopad_binlibgovernor_get_log_ex_propertiesmy_strnncollsp_simple_nopadmy_disable_copystat_in_redel_rl_keyseq_cxt_allocmysql_set_character_set_start_Z19batch_readline_initmP8_IO_FILEmy_strnncollsp_simple_ZN6String19set_or_copy_alignedEPKcmPK15charset_info_stmy_charset_utf8mb3_danish_uca_ci_Z19copy_if_not_allocedP6StringS0_jrl_undo_listmy_charset_ucs2_vietnamese_cirl_backward_rl_suppress_redisplayint2strmysql_get_server_version_ZN6String20append_parenthesizedElimy_hash_search_using_hash_valuemysql_more_resultshistory_truncate_filemy_lengthsp_binarymysql_authentication_dialog_askmy_charset_eucjpms_nopad_binrl_reverse_search_history_rl_rubout_charmy_charset_utf8mb3_croatian_mysql561_uca_cirl_function_dumpercopy_history_entrymy_uca_collation_handler_no_contractions_utf8mb4my_uca_contraction2_weightkey_KEY_CACHE_cache_lockmy_charset_utf16_unicode_520_nopad_ci_dig_vec_uppermy_charset_gb2312_chinese_cimysql_stmt_send_long_datarl_call_last_kbd_macromy_charset_latin1_binmariadb_field_attrrl_possible_completionsfind_set_from_flagsmy_unicase_default_page00my_freadmysql_stmt_reset_cont_rl_output_some_chars_rl_next_macro_keymy_charset_euckr_binmy_thread_end_wait_timemy_charset_utf8mb4_slovak_uca_cimthd_stmt_fetch_rowkey_THR_LOCK_myisamma_strdup_root_rl_fix_last_undo_of_typemy_string_repertoire_8bitmy_well_formed_char_length_8bitset_default_charsethistory_listmysql_shutdown_startrl_vi_prev_wordmariadb_reconnectmy_instr_simplerl_vi_yank_argmy_default_csnamefn_formatma_read_ok_packetrl_vi_append_mode_mariadb_compression_algorithm_strcharset_name_cp932my_charset_utf32_esperanto_uca_cikey_SAFEHASH_mutexmy_charset_sjis_binmy_numchars_8bitmy_charset_utf16_thai_520_w2my_mb_wc_8bit_Z20convert_to_printablePcmPKcmPK15charset_info_stm_mariadb_uncompresspvio_socket_has_datamy_strntol_8bitmy_charset_ucs2_myanmar_uca_ci_rl_enable_keypad_rl_is_mbchar_matchedrl_vi_movement_modemy_strnxfrm_simple_internalmysql_close_slow_part_rl_vi_reset_lastmy_charset_utf8mb3_general_mysql500_cimy_once_freekey_THR_LOCK_threadscharset_name_hashrl_do_lowercase_versionmysql_fetch_row_contcharset_name_utf16_rl_get_screen_sizemy_get_err_msg_rl_bell_preferencemy_charset_utf16_croatian_mysql561_uca_ci_ZN13Binary_string11realloc_rawEmfn_ext2my_strnxfrm_unicode_full_nopad_binemacs_ctlx_keymapsh_get_home_dirrl_vi_substmy_charset_gbk_chinese_nopad_cirl_transpose_wordsma_get_hash_keyvalmysql_load_plugin_vmy_charset_utf32_persian_uca_ci_my_b_encr_writemy_uca_collation_handler_nopad_multilevel_no_contractions_utf8mb3rl_filename_quoting_desired_rl_term_icrl_readline_statema_pvio_tls_connectunpack_dirnamema_tls_initialized_ZN13String_copier16well_formed_copyEPK15charset_info_stPcmS2_PKcmmrl_outstreammy_uni_utf16rl_tty_unset_default_bindingsmy_strtod_rl_arg_dispatchsafe_lexcstrdup_rootrw_pr_wrlockmy_mb_ctype_8bitma_scramble_323history_inhibit_expansion_functionpsi_mutex_trylockend_io_cachemy_uca_collation_handler_nopad_genericmy_charset_utf16_swedish_uca_cirl_vi_change_tomariadb_defaultsmy_strnxfrm_simple_nopadmysys_usage_idfind_typesetPSI_hook_rl_term_backspacekey_memory_my_compress_allocrl_replace_from_historymy_charset_utf32_binmysql_ping_startfree_charsets_mariadb_compress_allocrl_filename_dequoting_functioncompression_algorithmsmy_charset_utf16_german2_uca_cihistory_search_prefixhistory_search_pos_Z11tee_fprintfP8_IO_FILEPKczmy_strtoll10_8bitma_dynstr_freemy_charset_ucs2_estonian_uca_cimysql_ps_subsystem_initializedrl_completion_suppress_quotemysql_stmt_free_resultrl_get_previous_history_rl_internal_char_cleanupma_SHA1Updatemy_charset_utf8mb3_swedish_uca_cimy_context_destroymy_load_defaults_rl_init_line_statemy_progname_shortcurrent_historymy_strntoll_8bitma_alloc_dynamicrl_promptmysql_load_pluginmysql_set_server_option_startmysql_stmt_executema_tls_connect_rl_history_preserve_pointmysql_embeddedrl_get_next_history_mariadb_set_conf_option__libc_csu_finirl_delete_textrw_pr_initmysql_net_field_lengthmy_parse_charset_xmlmysql_list_processes_contrl_prefer_env_winsizema_tls_get_protocol_versionmy_wc_mb_utf8mb4_bmp_onlymysql_client_find_pluginpvio_socket_client_pluginma_strmakemy_charset_utf8mb3_hungarian_uca_cirl_reset_terminal_rl_complete_mark_symlink_dirsmy_open_parent_dir_nosymlinksmy_errorcheck_mutexattrmy_like_range_mbmysql_field_tellmy_charset_utf16_lithuanian_uca_cirl_make_bare_keymapmy_umaskmthd_stmt_get_param_metadatamy_thread_var_mutex_in_usemy_convert_using_funcmy_strntoull_8bitset_mysys_varmy_hash_sort_binmy_symlinkget_defaults_optionsma_zlib_compresspvio_callbackmysql_refresh_startmy_charset_utf8mb3_nopad_binmy_wildcmp_binmy_charset_utf8mb4_turkish_uca_ci_rl_reset_argumentmy_charset_utf32_latvian_uca_cimy_uca_collation_handler_utf8mb4mysql_list_tablesrl_bind_key_in_mapmysql_rollback_contullstr_rl_last_command_was_killmysql_get_socketinit_dynamic_array2mysql_get_charset_by_namema_pvio_tls_get_protocol_versionmysql_thread_initmysql_stmt_skip_paramsetmariadb_get_charset_by_nr_rl_strip_promptcharset_name_ucs2stage_waiting_for_table_level_lock_rl_init_eightbitmysql_find_charset_nrmy_charset_utf16_romanian_uca_cikey_memory_my_file_infomy_getopt_get_addrrl_vi_eWordkey_COND_alarm_rl_set_mark_at_posmysql_endmy_print_helpma_net_flushrl_vi_back_to_indentgetopt_ull_limit_valuemy_charset_ucs2_hungarian_uca_cimy_collation_get_by_namerl_copy_textthai_contractionsmariadb_client_errorsmysql_eof_ZNK6String21print_with_conversionEPS_PK15charset_info_stmy_atof_ZN6String35append_for_single_quote_using_mb_wcEPKcmPK15charset_info_strltty_set_default_bindingsmysql_optionsmy_charset_ucs2_esperanto_uca_ci_rl_horizontal_scroll_modewrite_historymysql_get_character_set_infomysql_stmt_errnomysql_stmt_close_contmy_default_record_cache_sizemysql_stmt_insert_idrl_vi_goto_markhistory_no_expand_charsmy_charset_euckr_nopad_binmy_thread_global_reinitmy_charset_ujis_japanese_cicharset_name_utf8mb3_rl_free_saved_history_linemy_charset_big5_nopad_binrl_universal_argumenthistory_basemy_collation_8bit_simple_nopad_ci_handlerrl_vi_end_wordmy_wildcmp_mball_charsetsma_gcvtnet_read_timeoutmy_error_unregisterrl_ignore_some_completions_functionmysql_read_query_result_startrl_insertpsi_cond_waitrl_executing_macrorl_vi_replacelist_deleterl_show_charrl_restore_promptmy_charset_ujis_nopad_binmy_b_appendmy_defaults_mark_filesmy_charset_utf8mb3_handlerrl_re_read_init_filestrfillmy_xml_set_leave_handlerma_hashtbl_nextmysql_close_slow_part_start_rl_terminal_can_insert_rl_eof_char_rl_dispatch_subseqrl_vi_append_eolmariadb_connectionpvio_socket_get_timeoutrl_unbind_keyrl_bind_keyseq_if_unbound_in_mapmy_min_str_8bit_simple_nopadmysql_real_connect_contmy_charset_ucs2_general_nopad_cimysql_stmt_resetmysql_list_tables_contmysql_insert_idma_stmt_execute_generate_requestmthd_my_real_connectkey_memory_defaultsma_tls_read_asyncstmt_set_errormy_error_unregister_allpvio_socket_blockingmy_hash_elementautoset_my_optionrl_end_of_historyrl_catch_signalsmy_once_memduphandle_sigintcharset_name_latin1rl_beginning_of_history_my_b_encr_readrl_get_keymap_by_namemy_strnxfrm_mbthai_contractions_w2my_min_str_mb_simple_nopadmysql_stmt_fetch_columnmy_unicase_turkish_rl_callback_funcmy_uca_collation_handler_nopad_multilevel_no_contractions_utf8mb4my_uca_collation_handler_nopad_no_contractions_utf8mb3mysql_native_password_client_pluginmy_charset_utf8mb3_myanmar_uca_cirl_donerl_clear_signals_rl_read_mbstringmy_charset_utf16_slovak_uca_cirl_digit_argumentappend_historymysql_stmt_prepare_startrl_begin_undo_groupnet_add_multi_commandmysql_autocommit_start_ZN6String8set_realEdjPK15charset_info_stma_tls_writempvio_infohistory_search_delimiter_charserrbuffhistory_getTHR_thread_countma_insert_dynamicrl_set_promptmy_file_openedmy_strnxfrm_simplemy_fwritemy_strnxfrmlen_unicodemy_charset_utf8mb3_slovak_uca_cima_net_writemy_uca_v520my_thread_namemy_time_initmysql_cset_escape_slashesmy_charset_utf32_spanish_uca_ci_rl_last_c_posstrend_rl_find_prev_mbcharmy_caseup_ujisrl_messagema_set_dynamic_dig_vec_lowerkey_memory_MY_TMPDIR_full_listGCC_3.0CXXABI_1.3GLIBC_2.2.5OPENSSL_1_1_0OPENSSL_1_1_1GLIBC_2.3.2GLIBC_2.28GLIBC_2.15GLIBC_2.17GLIBC_2.7GLIBC_2.14GLIBC_2.4GLIBC_2.11GLIBC_2.3GLIBC_2.3.4		
		
	
				
					
	� P&y;�� ӯkC�� ui	
N�� m	Z�{0mh�mZ�0ui	N�ri	v�
����������������ii
�����
��ii
�����®ii
ͮui	N�ti	׮hj[�7pj[ 6xj[�7�j[�j[�j[k��j[o��j[s��j[w��j[{��j[��j[���j[���j[���j[���j[���j[��k[��k[��k[��k[�� k[��(k[��0k[��@k[�|Hk[�|`k[�|hk[_��k[�|�k[i��k[�|�k[q��k[�|�k[z��k[�|�k[��l[�|l[�� l[�|(l[��@l[�|Hl[��`l[�|hl[���l[�|�l[���l[�|�l[���l[�|�l[���l[�|�l[ĸm[�|m[˸ m[�|(m[a�@m[�|Hm[Ը`m[�|hm[ܸ�m[�|�m[��m[�|�m[��m[�|�m[���m[�|n[�| n[�|(n[�@n[�|Hn[�`n[�|�n[���n[��n[�|�n[���n[P>	�n[>	�n[$��n[)��n[�|�n[��o[9� o[?�(o[�|8o[P�`o[V�ho[Z�po[�|�o[i��o[��o[s��o[�|�o[���o[д�o[��p[�|p[��8p[�@p[��Hp[�|Xp[���p[���p[���p[�|�p[�|�p[��p[˹�p[�|�p[�q[շq[ܹ q[�|0q[з@q[@	Hq[�A	Xq[/�`q[�hq[�|xq[ ��q[�C	�q[�C	�q[F��q[���q[�|�q[��q[��q[��q[�|r[-�0r[�8r[4�@r[�|Pr[�`r[�>	hr[�@	xr[��r[D��r[�|�r[
��r[���r[U��r[�|�r[÷�r[�?	�r[@?	s[�s[g�s[�|(s[x�Ps[~�Xs[��`s[�|ps[���s[��s[���s[�|�s["��s[�?	�s[�?	�s[v��s[���s[�|t[��(t[^�0t[ƺ8t[�|Ht[ںpt[״xt[��t[�|�t[S��t[�@	�t[�<	�t[���t[���t[�|�t[��t[�?	�t[�?	u[�u[�u[�| u[�Hu[%�Pu[-�Xu[�|hu[�|�u[@��u[F��u[�|�u[W��u[^��u[g��u[�|�u[{� v[��(v[��0v[�|@v[��hv[��pv[��xv[�|�v[���v[P��v[���v[�|�v[W��v[ͻw[Իw[�|w[�@w[�Hw[�Pw[�|`w[��w[
��w[
��w[�|�w[��w[^��w[��w[�|�w[ںx[:� x[!�(x[�|8x[B�`x[4�hx[:�px[�|�x[L��x[�>	�x[p>	�x[R��x[Z��x[�|�x[n��x[?	�x[ A	�x[��x[x�y[�|y[��8y[д@y[��Hy[�|Xy[���y[P��y[���y[�|�y[W��y[д�y[���y[�|�y[��z[��z[�� z[�|0z[�|Xz[��`z[ȼhz[�|xz[���z[��z[ۼ�z[�|�z[���z[P��z[��z[�|{[W�0{[�8{[�@{[�|P{[��x{[��{[��{[�|�{[��{[д�{[+��{[�|�{[��|[~�|[=�|[�|(|[��P|[��X|[M�`|[�|p|[���|[@��|[_��|[�|�|[W��|[~��|[i��|[�|}[��(}[_�0}[|�8}[�|H}[S�X}[�@	`}[@=	p}[_�x}[���}[�|�}[S��}[�@	�}[@=	�}[д�}[���}[�|�}[��~[д~[��~[�| ~[��H~[дP~[��X~[�|h~[���~[P��~[ʽ�~[�|�~[W��~[P��~[ս�~[�|�~[W� [^�([�0[�|@[{�h[�p[��x[�|�[��[@@	�[pB	�[��[��[�|�[��[@@	�[pB	�[��[���[�|�[#�(�[@@	0�[pB	@�[�H�[+�P�[�|`�[���[6���[<���[�|��[M���[p@	��[`@	Ѐ[6�؀[S��[�|�[M��[p@	�[`@	�[� �[�(�[�|8�[#�H�[@@	P�[pB	`�[�h�[]�p�[�|��[���[~���[g���[�|ȁ[���[ͻ��[r��[�|�[�8�[�@�[}�H�[�|X�[���[$���[����[�|��[��Ȃ[�Ђ[��؂[�|�[x��[F��[�� �[�|0�[F�X�[V�`�[��h�[�|x�[����[%���[����[�|��[�|�[��[þ��[�|�[��0�[�8�[;@�[�|P�[
�x�[״��[׾��[�|��[S���[�@	��[�<	��[�Ȅ[�Є[�|�[���[v��[���[�|(�[��P�[��X�[�`�[�|p�[����[9���[���[�|��[P��[���[��[�|�[��(�[��0�[�8�[�|H�[�|p�[:�x�[(���[�|��[B���[״��[4�Ȇ[�|؆[S��[�@	�[�<	�[���[@��[�| �[��0�[P>	8�[>	H�[�P�[I�X�[�|h�[�x�[�>	��[�@	��[����[S���[�|��[÷��[�?	ȇ[@?	؇[��[^��[�|��["��[�?	�[�?	 �[/�(�[f�0�[�|@�[ �P�[�C	X�[�C	h�[�p�[o�x�[�|��[-���[����[z���[�|Ј[��[�?	�[�?	��[շ�[���[�|�[з(�[@	0�[�A	@�[дH�[��P�[�|`�[����[4���[����[�|��[L���[�>	��[p>	Љ[~�؉[���[�|�[���[R� �[��(�[�|8�[ſH�[?	P�[ A	`�[�h�[οp�[�|��[���[@@	��[pB	��[���[߿��[�|Ȋ[�؊[@@	�[pB	�[���[��[�|�[� �[@@	(�[pB	8�[�@�[�H�[�|X�[�h�[@@	p�[pB	��[���[���[�|��[���[@@	��[pB	ȋ[�Ћ[(�؋[�|�[���[@@	�[pB	�[��[8� �[�|0�[�@�[@@	H�[pB	X�[�`�[J�h�[�|x�[���[@@	��[pB	��[���[[���[�|��[�Ќ[@@	،[pB	�[��[l���[�|�[��[@@	 �[pB	0�[�8�[}�@�[�|P�[�`�[@@	h�[pB	x�[���[����[�|��[���[@@	��[pB	��[�ȍ[��Ѝ[�|�[��[@@	��[pB	�[��[���[�|(�[�8�[@@	@�[pB	P�[�X�[��`�[�|p�[���[@@	��[pB	��[���[���[�|��[�Ȏ[@@	Ў[pB	�[��[��[�|�[��[@@	�[pB	(�[�0�[�8�[�|H�[�X�[@@	`�[pB	p�[�x�[���[�|��[���[@@	��[pB	��[���[�ȏ[�|؏[��[@@	�[pB	�[��[&��[�| �[�0�[@@	8�[pB	H�[�P�[A�X�[�|h�[�x�[@@	��[pB	��[���[V���[�|��[���[@@	Ȑ[pB	ؐ[���[j��[�|��[��[�?	�[�?	 �[��(�[z�0�[�|@�[�P�[�?	X�[�?	h�[��p�[��x�[�|��[���[�?	��[�?	��[����[����[�|Б[���[�?	�[�?	��[���[���[�|�[��(�[�?	0�[�?	@�[��H�[�P�[�|`�[��p�[�?	x�[�?	��[����[���[�|��[����[�?	��[�?	В[��ؒ[��[�|�[���[�?	�[�?	�[�� �[��(�[�|8�[��H�[�?	P�[�?	`�[��h�[�p�[�|��[����[�?	��[�?	��[����[���[�|ȓ[��ؓ[�?	�[�?	�[����[%��[�|�[�� �[�?	(�[�?	8�[��@�[4�H�[�|X�[��h�[�?	p�[�?	��[����[G���[�|��[����[�?	��[�?	Ȕ[��Д[V�ؔ[�|�[����[�?	�[�?	�[���[g� �[�|0�[��@�[�?	H�[�?	X�[��`�[u�h�[�|x�[����[�?	��[�?	��[����[����[�|��[��Е[�?	ؕ[�?	�[���[����[�|�[���[�?	 �[�?	0�[��8�[��@�[�|P�[��`�[�?	h�[�?	x�[����[����[�|��[����[�?	��[�?	��[��Ȗ[��Ж[�|�[���[�?	��[�?	�[���[���[�|(�[��8�[�?	@�[�?	P�[��X�[��`�[�|p�[����[�?	��[�?	��[����[���[�|��[��ȗ[�?	З[�?	�[6��[��[�|�[M��[p@	�[`@	(�[6�0�[+�8�[�|H�[M�X�[p@	`�[`@	p�[6�x�[>���[�|��[M���[p@	��[`@	��[6���[O�Ș[�|ؘ[M��[p@	�[`@	�[6��[a��[�| �[M�0�[p@	8�[`@	H�[6�P�[t�X�[�|h�[M�x�[p@	��[`@	��[6���[����[�|��[M���[p@	ș[`@	ؙ[6��[���[�|��[M��[p@	�[`@	 �[6�(�[��0�[�|@�[M�P�[p@	X�[`@	h�[6�p�[��x�[�|��[M���[p@	��[`@	��[6���[����[�|К[M��[p@	�[`@	��[6��[���[�|�[M�(�[p@	0�[`@	@�[6�H�[��P�[�|`�[M�p�[p@	x�[`@	��[6���[����[�|��[M���[p@	��[`@	Л[6�؛[���[�|�[M��[p@	�[`@	�[6� �[�(�[�|8�[M�H�[p@	P�[`@	`�[6�h�[�p�[�|��[M���[p@	��[`@	��[6���[,���[�|Ȝ[M�؜[p@	�[`@	�[6���[?��[�|�[M� �[p@	(�[`@	8�[6�@�[R�H�[�|X�[M�h�[p@	p�[`@	��[6���[c���[�|��[M���[p@	��[`@	ȝ[6�Н[t�؝[�|�[M���[p@	�[`@	�[6��[�� �[�|0�[M�@�[p@	H�[`@	X�[6�`�[��h�[�|x�[M���[p@	��[`@	��[״��[���[�|��[S�О[�@	؞[�<	�[״�[����[�|�[S��[�@	 �[�<	0�[״8�[��@�[�|P�[S�`�[�@	h�[�<	x�[״��[����[�|��[S���[�@	��[�<	��[״ȟ[��П[�|�[S��[�@	��[�<	�[״�[	��[�|(�[S�8�[�@	@�[�<	P�[״X�[�`�[�|p�[S���[�@	��[�<	��[״��[/���[�|��[S�Ƞ[�@	Р[�<	�[״�[/��[�|�[S��[�@	�[�<	(�[״0�[B�8�[�|H�[S�X�[�@	`�[�<	p�[״x�[U���[�|��[S���[�@	��[�<	��[״��[h�ȡ[�|ء[S��[�@	�[�<	�[״�[y��[�| �[S�0�[�@	8�[�<	H�[״P�[��X�[�|h�[S�x�[�@	��[�<	��[״��[����[�|��[S���[�@	Ȣ[�<	آ[״�[���[�|��[S��[�@	�[�<	 �[״(�[��0�[�|@�[S�P�[�@	X�[�<	h�[״p�[��x�[�|��[S���[�@	��[�<	��[״��[����[�|У[S��[�@	�[�<	��[״�[��[�|�[S�(�[�@	0�[�<	@�[״H�[�P�[�|`�[S�p�[�@	x�[�<	��[״��[(���[�|��[S���[�@	��[�<	Ф[״ؤ[;��[�|�[S��[�@	�[�<	�[״ �[R�(�[�|8�[S�H�[�@	P�[�<	`�[״h�[h�p�[�|��[S���[�@	��[�<	��[״��[|���[�|ȥ[S�إ[�@	�[�<	�[_���[���[�|�[S� �[�@	(�[@=	8�[_�@�[��H�[�|X�[S�h�[�@	p�[@=	��[_���[����[�|��[S���[�@	��[@=	Ȧ[_�Ц[��ئ[�|�[S���[�@	�[@=	�[_��[�� �[�|0�[S�@�[�@	H�[@=	X�[_�`�[��h�[�|x�[S���[�@	��[@=	��[_���[���[�|��[S�Ч[�@	ا[@=	�[_��["���[�|�[S��[�@	 �[@=	0�[_�8�[5�@�[�|P�[S�`�[�@	h�[@=	x�[_���[H���[�|��[S���[�@	��[@=	��[_�Ȩ[[�Ш[�|�[S��[�@	��[@=	�[_��[l��[�|(�[S�8�[�@	@�[@=	P�[_�X�[~�`�[�|p�[S���[�@	��[@=	��[_���[����[�|��[S�ȩ[�@	Щ[@=	�[_��[���[�|�[S��[�@	�[@=	(�[_�0�[��8�[�|H�[S�X�[�@	`�[@=	p�[_�x�[����[�|��[S���[�@	��[@=	��[_���[��Ȫ[�|ت[S��[�@	�[@=	�[_��[���[�| �[S�0�[�@	8�[@=	H�[_�P�[�X�[�|h�[S�x�[�@	��[@=	��[_���[���[�|��[S���[�@	ȫ[@=	ث[_��[.��[�|��[S��[�@	�[@=	 �[_�(�[K�0�[�|@�[S�P�[�@	X�[@=	h�[_�p�[b�x�[�|��[S���[�@	��[@=	��[���[x���[�|Ь[��[�B	�[ C	��[��[���[�|�[�(�[�B	0�[ C	@�[�H�[��P�[�|`�[�p�[�B	x�[ C	��[״��[����[�|��[S���[�@	��[@=	Э[_�ح[���[�|�[S��[�@	�[@=	�[_� �[��(�[�|8�[S�H�[�@	P�[@=	`�[_�h�[��p�[�|��[S���[�@	��[@=	��[_���[���[�|Ȯ[S�خ[�@	�[@=	�[_���[��[�|�[S� �[�@	(�[@=	8�[_�@�[/�H�[�|X�[S�h�[�@	p�[@=	��[_���[E���[�|��[S���[�@	��[@=	ȯ[_�Я[[�د[�|�[S���[�@	�[@=	�[_��[q� �[�|0�[S�@�[�@	H�[@=	X�[_�`�[��h�[�|x�[S���[�@	��[@=	��[_���[����[�|��[S�а[�@	ذ[@=	�[_��[����[�|�[S��[�@	 �[@=	0�[_�8�[��@�[�|P�[S�`�[�@	h�[@=	x�[_���[����[�|��[S���[�@	��[@=	��[_�ȱ[��б[�|�[S��[�@	��[@=	�[_��[��[�|(�[S�8�[�@	@�[@=	P�[_�X�[&�`�[�|p�[S���[�@	��[@=	��[_���[<���[�|��[S�Ȳ[�@	в[@=	�[_��[R��[�|�[S��[�@	�[@=	(�[_�0�[h�8�[�|H�[S�X�[�@	`�[@=	p�[_�x�[~���[�|��[S���[�@	��[@=	��[_���[��ȳ[�|س[S��[�@	�[@=	�[_��[���[�| �[S�0�[�@	8�[@=	H�[_�P�[��X�[�|h�[S�x�[�@	��[@=	��[_���[����[�|��[S���[�@	ȴ[@=	ش[_��[���[�|��[S��[�@	�[@=	 �[_�(�[�0�[�|@�[S�P�[�@	X�[@=	h�[_�p�[�x�[�|��[S���[�@	��[@=	��[_���[/���[�|е[S��[�@	�[@=	��[_��[E��[�|�[S�(�[�@	0�[@=	@�[_�H�[[�P�[�|`�[S�p�[�@	x�[@=	��[_���[q���[�|��[S���[�@	��[@=	ж[_�ض[���[�|�[S��[�@	�[@=	�[_� �[��(�[�|8�[S�H�[�@	P�[@=	`�[_�h�[��p�[�|��[S���[�@	��[@=	��[_���[����[�|ȷ[S�ط[�@	�[@=	�[_���[���[�|�[S� �[�@	(�[@=	8�[_�@�[��H�[�|X�[S�h�[�@	p�[@=	��[_���[���[�|��[S���[�@	��[@=	ȸ[_�и[&�ظ[�|�[S���[�@	�[@=	�[_��[<� �[�|0�[S�@�[�@	H�[@=	X�[_�`�[R�h�[�|x�[S���[�@	��[@=	��[_���[h���[�|��[S�й[�@	ع[@=	�[_��[~���[�|�[S��[�@	 �[@=	0�[_�8�[��@�[�|P�[S�`�[�@	h�[@=	x�[_���[����[�|��[S���[�@	��[@=	��[_�Ⱥ[��к[�|�[S��[�@	��[@=	�[״�[h��[�|(�[S�8�[�@	@�[�<	P�[״X�[��`�[�|p�[S���[�@	��[�<	��[״��[����[�|��[S�Ȼ[�@	л[�<	�[_��[���[�|�[S��[�@	�[@=	(�[_�0�[�8�[�|H�[S�X�[�@	`�[@=	p�[_�x�[$���[�|��[S���[�@	��[@=	��[����[��ȼ[�|ؼ[���[�?	�[�?	�[���[8��[�| �[��0�[�?	8�[�?	H�[��P�[H�X�[�|h�[��x�[�?	��[�?	��[���[Y���[�|��[���[@@	Ƚ[pB	ؽ[��[k��[�|��[��[@@	�[pB	 �[�(�[|�0�[�|@�[�P�[@@	X�[pB	h�[6�p�[��x�[�|��[M���[p@	��[`@	��[6���[����[�|о[M��[p@	�[`@	��[6��[���[�|�[M�(�[p@	0�[`@	@�[��H�[��P�[�|`�[��p�[P>	x�[>	��[$���[����[�|��[��п[9�ؿ[���[�|�[P��[V� �[�(�[�|8�[i�`�[�h�[�p�[�|��[����[д��[3���[�|�[���[���[K��[�|�[��8�[��@�[c�H�[�|X�[�|��[���[y���[�|��[��[շ�[���[�|�[з��[@	�[�A	�[/��[�� �[�|0�[ �@�[�C	H�[�C	X�[F�`�[��h�[�|x�[���[���[����[�|��[-���[���[����[�|�[��[�>	 �[�@	0�[�8�[�@�[�|P�[
�x�[����[���[�|��[÷��[�?	��[@?	��[���[0���[�|��[x��[~��[G��[�|(�[��P�[�X�[_�`�[�|p�["���[�?	��[�?	��[v���[t���[�|��[����[^���[����[�|�[ں(�[״0�[��8�[�|H�[S�X�[�@	`�[�<	p�[��x�[����[�|��[���[�?	��[�?	��[���[����[�|��[��[%��[���[�| �[�|H�[@�P�[�X�[�|h�[W���[^���[���[�|��[{���[����[6���[�|��[�� �[��(�[M�0�[�|@�[��h�[@�p�[e�x�[�|��[W���[_���[u���[�|��[S���[�@	��[@=	��[_��[���[�|�[S�(�[�@	0�[@=	@�[дH�[��P�[�|`�[����[P���[����[�|��[W���[P���[����[�|��[W��[^� �[��(�[�|8�[{�`�[�h�[��p�[�|��[���[@@	��[pB	��[���[���[�|��[���[@@	��[pB	��[���[��[�|�[#� �[@@	(�[pB	8�[ͻ@�[5�H�[�|X�[���[���[M���[�|��[���[���[^���[�|��[��[6��[v� �[�|0�[M�@�[p@	H�[`@	X�[6�`�[��h�[�|x�[M���[p@	��[`@	��[���[����[�|��[#���[@@	��[pB	��[^���[����[�|�[ں0�[�8�[��@�[�|P�[�x�[~���[����[�|��[����[ͻ��[����[�|��[��[��[���[�|(�[�P�[$�X�[�`�[�|p�[����[���[���[�|��[x���[F���[#���[�|�[�(�[V�0�[4�8�[�|H�[i�p�[%�x�[B���[�|��[�|��[���[T���[�|��[���[��[d��[�| �[
�H�[�P�[t�X�[�|h�[����[v���[����[�|��[����[����[����[�|��[�� �[9�(�[��0�[�|@�[P�h�[��p�[��x�[�|��[����[����[����[�|��[�|��[״�[���[�|�[S�(�[�@	0�[�<	@�[��H�[��P�[�|`�[��p�[P>	x�[>	��[���[����[�|��[���[�>	��[�@	��[����[���[�|��[÷�[�?	�[@?	�[� �[�(�[�|8�["�H�[�?	P�[�?	`�[/�h�[&�p�[�|��[ ���[�C	��[�C	��[���[5���[�|��[-���[����[F��[�|�[� �[�?	(�[�?	8�[շ@�[U�H�[�|X�[зh�[@	p�[�A	��[:���[d���[�|��[B���[:���[}���[�|��[B��[4��[�� �[�|0�[L�@�[�>	H�[p>	X�[4�`�[��h�[�|x�[L���[�>	��[p>	��[R���[����[�|��[ſ��[?	��[ A	��[R���[����[�|�[ſ�[?	 �[ A	0�[�8�[��@�[�|P�[�`�[@@	h�[pB	x�[���[����[�|��[���[@@	��[pB	��[����[���[�|��[���[�?	��[�?	�[���[+��[�|(�[�8�[�?	@�[�?	P�[6�X�[E�`�[�|p�[M���[p@	��[`@	��[6���[\���[�|��[M���[p@	��[`@	��[״��[w���[�|�[S��[�@	�[�<	(�[״0�[��8�[�|H�[S�X�[�@	`�[�<	p�[_�x�[����[�|��[S���[�@	��[@=	��[_���[����[�|��[S���[�@	��[@=	@�[��H�[дX�[��`�[дp�[>�x�[P���[^���[^���[z���[^���[���[д��[���[����[P���[P��[���[F��[� �[�0�[��8�[��H�[��P�[��`�[ʷh�[շx�[����[շ��[ڷ��[���[����[���[����[����[���[���[&���[:��[���[:� �[�(�[-�8�[��@�[дP�[V�X�[дh�[a�p�[д��[K���[д��[����[����[����[����[����[����[t���[����[���[��[��[�(�[��0�[�@�[ܵH�[�X�[��`�[�p�[�x�[���[(���[���[���[���[����[F���[M���[F���[X���[F��[;��[F��[�� �[v�0�[}�8�[v�H�[��P�[v�`�[k�h�[v�x�[���[���[���[���[���[���[���[���[���[V���[���[/��[ ��[/� �[�(�[/�8�[�@�[�P�[$�X�[�h�[շp�[շ��[���[д��[ߴ��[ߴ��[Y���[ߴ��[1���[
���[���[��[$��[*� �[�0�[҇@�[�P�[�`�[
p�[

��[
��[
��[
��[ 
��[&
��[[��[���[�[���[& �[@�(�[�8�[�@�[=P�[�X�[Qh�[���[��[����[x��[����[~��[@���[=���[����[��]�[^(�[��8�[�H�[Ђ`�[��h�[��p�[��x�[����[T���[����[\��[����[Sx��[����[����[����[����[����[`p^��[�_�[��_�[@�_ �[ (&(�[ '&0�[ && �[ %&(�[ $&8�[@<&X�[@;&�[@:&�[@9&(�[@8&8�[@7&H�[@6&��[@5&�[@4&h�[@3&��[@2&�[@1&�[@0&�[@/&(�[ ,`@�[ D*��[ C*8\ B*@\�@1H\�:1P\�41X\�,1`\�&1h\� 1p\�1x\�1�\�1�\�1�\�1�\��0�\��0�\��0�\��0�\��0�\��0�\��0�\��0�\��0�\��0�\��0�\��0\��0\��0(\��00\��08\��0@\��0H\��0P\��0X\�|0`\�r0h\�n0p\�h0x\�b0�\�^0�\�Z0�\�P0�\�J0�\�D0�\�>0�\�80�\�20�\�"0�\�0�\�
0@\�0H\�0P\��/X\��/`\��/	\��/	\��/	\��/ 	\��/(	\��/0	\��/8	\��/H	\��bh	\�e�	\�^d�	\�]d�	\�\d�	\�[d�	\�Zd�	\�Yd�	\�Xd�	\�Wd
\�Vd(
\�Ud8
\�TdH
\�SdX
\�Rdh
\�Qdx
\�Pd�
\�Od�
\�Nd�
\�Md�
\�Ld�
\�Kd�
\�Jd�
\�Id\�Hd\�Gd(\�Fd8\�EdX\�Ddh\�Cdx\�Bd�\�Ad�\�@d�\�?d�\�>d�\�=d�\�<d8\�;dH\�:dX\�9dh\�8dx\�7d�\�6d�\�5d�\�4dX\�3dx\�2d�\�1d�\�0d\�/d�\�.d\�-d8\�,dH\�+dx\�*d�\�)d\�(d(\�'d8\�&dX\�%dh\�$dx\�#d�\���\\�\���\T��\Sx�\��9�\�9\`�9\0�9(\!�9@\�9H\�9P\�9X\�9`\$�9�\2�9�\1�9�\0�9�\/�9�\8�9�\���\>�9�\J�9�\W�9\`�9\p�9(\��98\��9H\��9X\š9h\�9x\��9�\�9�\+�9�\B�9�\Y�9�\t�9�\��9�\��9�\��9\آ9\�9(\�98\p�9H\)�9X\��9h\��9x\ة9�\��9�\ �9�\X�9�\��9�\��9�\ت9�\�9�\0�9\`�9\��9(\��98\��9H\(�9X\X�9h\��9x\��9�\�9�\(�9�\X�9�\��9�\��9�\Э9�\��9�\ �9\H�9\p�9(\��98\Ȯ9H\�9X\�9h\@�9x\h�9�\��9�\��9�\�9�\�9�\8�9�\`�9�\��9�\��9\��9\8�9(\x�98\��9H\�9X\@�9h\��9x\��9�\��9�\0�9�\h�9�\��9�\ȹ9�\�9�\�9�\x�9�\��9�\Ҷ9�\�9 \��9 \�9 \1�9 \��9  \G�9( \Y�90 \��98 \v�9@ \��9H \��9P \(�9X \��9` \��9h \P�9p \x�9x \��9� \�9� \�9� \@�9� \h�9� \��9� \�9� \�9� \η9� \�9� \�9� \�9� \8�9� \h�9� \��9� \��9� \��9!\ �9!\X�9!\��9!\��9 !\�9(!\6�90!\@�98!\h�9@!\��9H!\��9P!\�9X!\0�9`!\p�9h!\��9p!\��9x!\(�9�!\I�9�!\X�9�!\��9�!\��9�!\g�9�!\w�9�!\��9�!\�9�!\��9�!\��9�!\и9�!\�9�!\8�9�!\�9�!\x�9�!\(�9"\`�9"\ �9"\X�9"\�9 "\��9("\�90"\�98"\��9@"\8�9`"\�h"\�"p"\�x"\ ��"\��"\@��"\	�"\ ��"\�"\��"\��"\���"\%�"\�-�"\8�"\�,�"\��"\ ��"\K�"\0�#\`#\�#\r#\�= #\�(#\p�0#\�8#\��@#\�H#\��P#\�X#\�`#\�h#\�~p#\�x#\P2�#\��#\3�#\��#\�1�#\��#\0��#\�#\@��#\�#\0��#\3�#\���#\B�#\���#\W�#\`�$\e$\��$\t$\� $\�($\ �0$\�8$\�@$\�H$\�>P$\�X$\��`$\�h$\�p$\�x$\���$\��$\��$\�$\���$\
�$\��$\�$\`��$\��$\���$\1�$\@��$\I�$\���$\`�$\p�%\o%\P%\�%\�. %\.(%\.0%\�8%\�1@%\AH%\-P%\�X%\ v`%\�h%\P�p%\@	x%\��%\h	�%\0��%\�	�%\P��%\�	�%\���%\��%\P��%\��%\@�%\��%\���%\��%\p��%\��%\��&\&\��&\"&\P� &\9(&\�90&\E8&\`�@&\	H&\��P&\QX&\@=`&\ah&\�p&\	x&\`#�&\l�&\���&\|�&\���&\��&\�"�&\��&\@:�&\��&\��&\��&\�/�&\��&\ 1�&\��&\�.'\�'\P�'\�'\�( '\�('\ +0'\8'\�3@'\H'\@)P'\X'\�'`'\*h'\'p'\9x'\ )�'\F�'\9�'\X�'\p�'\a�'\� �'\j�'\4�'\y�'\�=�'\��'\ 0�'\��'\�9�'\��'\�*(\�(\�%(\�(\03 (\�((\P/0(\�8(\ @(\�H(\кP(\�X(\0%`(\�h(\�%p(\x(\�#�(\�(\p�(\�(\��(\&�(\p9�(\5�(\�(\>�(\ A�(\K�(\�'�(\Y�(\�%�(\k�(\@;)\t)\�()\�)\# )\�()\00)\�8)\`@)\�H)\�"P)\�X)\`)`)\�h)\`p)\�x)\�?�)\��)\�6�)\��)\�)\��)\��)\	�)\�@�)\	�)\�?�)\	�)\�&�)\%	�)\P�)\1	�)\P2 *\�
(*\��]0*\�8*\��]@*\H*\`r]P*\X*\@b]`*\�xh*\ R]p*\�x*\ R]�*\��*\ R]�*\��*\B]�*\D�*\�A]�*\f�*\�]�*\*
�*\P�e+\8
+\H�e +\O
(+\�A]8+\\
@+\\�eP+\o
X+\��eh+\}
p+\��e�+\�
�+\�e�+\�
�+\خe�+\�
�+\��e�+\�
�+\Ȓ]�+\�
�+\Ԯe�+\�
,\IJe,\,\Ē](,\0,\��e@,\ H,\��eX,\,`,\��]p,\{x,\�]�,\��,\L�e�,\=�,\̲e�,\S�,\Ȳe�,\j�,\��e-\�-\�e-\�-\��e -\ӏ(-\��e0-\�8-\��e@-\�H-\��eP-\�X-\��e`-\�h-\��ep-\�x-\��e�-\f��-\��e�-\��-\x�e�-\��-\��e�-\��-\�e�-\��-\�e�-\��-\8�e�-\���-\�e�-\��-\�e.\.\(�e.\�.\0�e .\��(.\ �e0.\8.\@�e@.\ �H.\��eP.\X.\P�e`.\	h.\H�ep.\�x.\��e�.\�.\��e�.\�.\��e�.\�.\`�e�.\�.\�e�.\��.\�e�.\�
�.\p�
�.\�
/\��
/\@�/\P�/\`�
 /\p�
(/\ �
0/\�
8/\Ш
@/\0�
H/\��
P/\�
X/\��
`/\p�
h/\0�
p/\��
x/\��
�/\��
�/\ �
�/\P�
�/\0�
�/\��/\���/\�
�/\`��/\��/\@
�/\`��/\ 
0\б
0\��
0\�
0\`�
 0\0�
(0\��
00\@�
80\ �
@0\�
H0\ �
h0\P
p0\�x0\

�0\���0\��
�0\�
�0\Щ
�0\�
�0\��
�0\��
�0\ �
�0\�
�0\ �
�0\@
�0\��0\�
1\p�
1\��
1\�
1\`�
 1\0�
(1\��
01\��
81\ �
@1\@�
H1\ �
h1\P
p1\�
x1\p
�1\���1\��
�1\�
�1\Щ
�1\�
�1\��
�1\0�
�1\ �
�1\@�
�1\ �
�1\��
�1\��
�1\�
2\��
2\�
2\�
2\ �
 2\�
(2\�
02\�
82\�
@2\0�
H2\��
P2\�
X2\��
`2\p�
h2\0�
p2\��
x2\��
�2\��
�2\ �
�2\P�
�2\0�
�2\�
�2\��
�2\��
�2\�
�2\��2\@
�2\�
�2\�
3\�
3\��
3\ �
3\@
 3\�
(3\�
03\
83\ �
@3\`�
H3\p�
`3\�
h3\�
p3\�
x3\
�3\
�3\��
�3\ �
�3\@
�3\�
�3\�
�3\
�3\ �
�3\`�
�3\p�
�3\�
�3\�
�3\ 
�3\
4\�
4\��
4\ �
4\@
 4\�
(4\�
04\p
84\ �
@4\0�
H4\p�
h4\�
p4\p�
x4\�
�4\�
�4\
�4\�
�4\`�
�4\p�
�4\ �
�4\�
�4\Ш
�4\0�
�4\��
�4\�
�4\��
�4\p�
�4\0�
�4\��
�4\��
5\��
5\ �
5\P�
5\0�
 5\ 
(5\�
05\�
85\P
@5\�h5\0 
p5\ 
x5\�!
�5\б
�5\��
�5\�
�5\`�
�5\0�
�5\��
�5\@�
�5\ �
�5\�
�5\ �
�5\'
�5\�
�5\�(
6\б
6\��
6\�
6\Щ
 6\��
(6\��
06\��
86\ �
@6\�
H6\ �
h6\0 
p6\�
x6\�#
�6\p�
�6\��
�6\�
�6\`�
�6\0�
�6\��
�6\��
�6\ �
�6\@�
�6\ �
�6\'
�6\@%
�6\�*
7\p�
7\��
7\�
7\Щ
 7\��
(7\��
07\0�
87\ �
@7\@�
H7\ �
h7\@,
p7\�5
x7\��7\p3
�7\@0
�7\P0
�7\@
�7\��
�7\�
�7\0�
�7\ �
�7\0�
�7\p�
�7\�
�7\p�
�7\�
8\��
8\0;
8\�<
8\`�
 8\p�
(8\ �
08\�
88\Ш
@8\0�
H8\��
P8\�
X8\��
`8\p�
h8\0�
p8\��
x8\��
�8\��
�8\ �
�8\P�
�8\0�
�8\�;
�8\�:
�8\�
�8\P<
�8\��8\D
�8\�>
�8\�E
9\б
9\��
9\�
9\`�
 9\0�
(9\��
09\@�
89\ �
@9\�
H9\ �
h9\PJ
p9\p@
x9\�L
�9\б
�9\��
�9\�
�9\Щ
�9\�
�9\��
�9\��
�9\ �
�9\�
�9\ �
�9\D
�9\�B
�9\`G
:\p�
:\��
:\�
:\`�
 :\0�
(:\��
0:\��
8:\ �
@:\@�
H:\ �
h:\PJ
p:\�H
x:\0N
�:\p�
�:\��
�:\�
�:\Щ
�:\�
�:\��
�:\0�
�:\ �
�:\@�
�:\ �
�:\�
�:\p�
�:\�
;\�Q
;\�P
;\`S
;\`�
 ;\p�
(;\ �
0;\��8;\��@;\0�
H;\��
P;\�
X;\��
`;\p�
h;\0�
p;\��
x;\��
�;\��
�;\ �
�;\P�
�;\0�
�;\@R
�;\�O
�;\�
�;\S
�;\��;\^
�;\0T
�;\�`
<\б
<\��
<\�
<\`�
 <\0�
(<\��
0<\@�
8<\ �
@<\�
H<\ �
h<\ e
p<\�V
x<\h
�<\б
�<\��
�<\�
�<\Щ
�<\�
�<\��
�<\��
�<\ �
�<\�
�<\ �
�<\^
�<\�Y
�<\�b
=\p�
=\��
=\�
=\`�
 =\0�
(=\��
0=\��
8=\ �
@=\@�
H=\ �
h=\ e
p=\�[
x=\`j
�=\p�
�=\��
�=\�
�=\Щ
�=\�
�=\��
�=\0�
�=\ �
�=\@�
�=\ �
�=\�
�=\p�
�=\�
>\��
>\Pm
>\�n
>\`�
 >\p�
(>\ �
0>\�
8>\Ш
@>\0�
H>\��
P>\�
X>\��
`>\p�
h>\0�
p>\��
x>\��
�>\��
�>\ �
�>\P�
�>\0�
�>\0n
�>\�l
�>\�
�>\�n
�>\��>\�t
�>\�p
�>\�u
?\б
?\��
?\�
?\`�
 ?\0�
(?\��
0?\@�
8?\ �
@?\�
H?\ �
h?\�y
p?\�q
x?\0{
�?\б
�?\��
�?\�
�?\Щ
�?\�
�?\��
�?\��
�?\ �
�?\�
�?\ �
�?\�t
�?\Ps
�?\w
@\p�
@\��
@\�
@\`�
 @\0�
(@\��
0@\��
8@\ �
@@\@�
H@\ �
h@\�y
p@\`x
x@\�|
�@\p�
�@\��
�@\�
�@\Щ
�@\�
�@\��
�@\0�
�@\ �
�@\@�
�@\ �
�@\�
�@\p�
�@\�
A\��
A\�~
A\p�
A\`�
 A\p�
(A\ �
0A\�
8A\Ш
@A\0�
HA\��
PA\�
XA\��
`A\p�
hA\0�
pA\��
xA\��
�A\��
�A\ �
�A\P�
�A\0�
�A\��
�A\~
�A\�
�A\�
�A\��A\�
�A\�
�A\��
B\б
B\��
B\�
B\`�
 B\0�
(B\��
0B\@�
8B\ �
@B\�
HB\ �
hB\P�
pB\P�
xB\��
�B\��
�B\��
�B\�
�B\Щ
�B\�
�B\��
�B\��
�B\ �
�B\�
�B\ �
�B\�
�B\��
�B\�
C\p�
C\��
C\�
C\`�
 C\0�
(C\��
0C\��
8C\ �
@C\@�
HC\ �
hC\P�
pC\��
xC\��
�C\P
�C\��
�C\�
�C\Щ
�C\�
�C\��
�C\0�
�C\ �
�C\@�
�C\ �
�C\З
�C\К
�C\�D\�
D\��
D\ �
D\��
 D\��
(D\�
0D\��
8D\P�
@D\0�
HD\p�
hD\��
pD\��
xD\�
�D\��
�D\��
�D\Л
�D\ �
�D\��
�D\�
�D\P�
�D\��
�D\0�
�D\��
�D\�
�D\��
�D\p�
�D\0�
�D\��
�D\��
E\��
E\ �
E\P�
E\0�
 E\�
(E\��
0E\��
8E\�
@E\�`E\��
hE\�
pE\��
xE\��
�E\��
�E\��
�E\ �
�E\��
�E\��
�E\�
�E\��
�E\ �
�E\`�
�E\p�
�E\��
�E\�
�E\p�
�E\��
F\p�
F\��
F\ �
F\��
 F\��
(F\�
0F\0�
8F\ �
@F\0�
HF\p�
`F\P�
hF\��
pF\��
xF\�
�F\��
�F\�
�F\P�
�F\ �
�F\��
�F\�
�F\P�
�F\��
�F\0�
�F\��
�F\�
�F\��
�F\p�
�F\0�
�F\��
�F\��
G\��
G\ �
G\P�
G\0�
 G\�
(G\��
0G\��
8G\�
@G\��hG\�
pG\p�
xG\�
�G\@�
�G\��
�G\��
�G\`�
�G\p�
�G\ �
�G\�
�G\Ш
�G\0�
�G\��
�G\�
�G\��
�G\p�
�G\0�
�G\��
�G\��
H\��
H\ �
H\P�
H\0�
 H\��
(H\ �
0H\�
8H\�
@H\��
hH\P�
pH\@�
xH\�
�H\б
�H\��
�H\�
�H\`�
�H\0�
�H\��
�H\@�
�H\ �
�H\�
�H\ �
�H\ �H\�
�H\�I\б
I\��
I\�
I\Щ
 I\��
(I\��
0I\��
8I\ �
@I\�
HI\ �
hI\P�
pI\��
xI\��
�I\p�
�I\��
�I\�
�I\`�
�I\0�
�I\��
�I\��
�I\ �
�I\@�
�I\ �
�I\ �I\`�I\�J\p�
J\��
J\�
J\Щ
 J\��
(J\��
0J\0�
8J\ �
@J\@�
HJ\ �
hJ\��
pJ\��
xJ\�
�J\��
�J\`�J\��J\ �
�J\��
�J\�
�J\P�
�J\��
�J\0�
�J\��
�J\�
�J\��
�J\p�
�J\0�
�J\��
�J\��
K\��
K\ �
K\P�
K\0�
 K\�
(K\��
0K\��
8K\�
@K\�hK\�pK\xK\�K\@�K\��
�K\ �
�K\��
�K\��
�K\�
�K\��
�K\ �
�K\`�
�K\p�
�K\��K\�
�K\L\
L\��
L\ �
L\��
 L\��
(L\�
0L\0�
8L\ �
@L\0�
HL\p�
`L\jhL\01pL\�1xL\0��L\�3�L\��L\�
�L\��L\��
�L\ (�L\P�
�L\�
�L\ �
�L\j�L\01�L\ /�L\0�M\�3M\�M\�
M\�(M\��
0M\ (8M\P�
@M\@�
HM\ �
`M\jhM\�0pM\1xM\��M\@7�M\��M\�
�M\��M\��
�M\�2�M\P�
�M\�
�M\ �
�M\j�M\�0�M\/�M\�N\@,N\�N\�
N\�(N\��
0N\ (8N\P�
@N\@�
HN\ �
`N\jhN\PpN\xN\@��N\��N\��N\�
�N\��N\��
�N\@�N\P�
�N\�
�N\ �
�N\j�N\P�N\@�N\@�O\�O\�O\�
O\�(O\��
0O\@8O\P�
@O\@�
HO\ �
`O\jhO\�pO\ xO\��O\`#�O\��O\�
�O\��O\��
�O\��O\P�
�O\�
�O\ �
�O\j�O\��O\ �O\�P\`P\�P\�
P\�(P\��
0P\@8P\P�
@P\@�
HP\ �
`P\�khP\p+pP\`,xP\�s�P\0=�P\��P\�
�P\��P\��
�P\�/�P\P�
�P\�
�P\ �
�P\�k�P\p+�P\0/�P\�sQ\0=Q\�Q\�
Q\�(Q\��
0Q\�/8Q\P�
@Q\@�
HQ\ �
`Q\�khQ\@+pQ\0,xQ\�s�Q\07�Q\��Q\�
�Q\��Q\��
�Q\�1�Q\P�
�Q\�
�Q\ �
�Q\�k�Q\@+�Q\/�Q\�sR\P4R\�R\�
R\�(R\��
0R\�/8R\P�
@R\@�
HR\ �
`R\�khR\�	pR\`
xR\���R\�R\��R\�
�R\��R\��
�R\��R\P�
�R\�
�R\ �
�R\�k�R\�	�R\��R\��S\S\�S\�
S\�(S\��
0S\�8S\P�
@S\@�
HS\ �
`S\�khS\@	pS\p	xS\P��S\��S\��S\�
�S\��S\��
�S\ �S\P�
�S\�
�S\ �
�S\�k�S\@	�S\p�S\P�T\�T\�T\�
T\�(T\��
0T\�8T\P�
@T\@�
HT\ �
`T\PjhT\pT\�xT\|�T\ A�T\��T\�
�T\��T\��
�T\��T\P�
�T\�
�T\ �
�T\Pj�T\�T\��T\|U\ AU\�U\�
U\�(U\��
0U\�8U\P�
@U\@�
HU\ �
`U\PjhU\�pU\�xU\�{�U\�&�U\��U\�
�U\��U\��
�U\P!�U\P�
�U\�
�U\ �
�U\Pj�U\��U\��U\�{V\�#V\�V\�
V\�(V\��
0V\�8V\P�
@V\@�
HV\ �
`V\PjhV\�pV\��xV\0��V\0��V\��V\�
�V\��V\��
�V\���V\P�
�V\�
�V\ �
�V\Pj�V\��V\���V\0�W\0�W\�W\�
W\�(W\��
0W\��8W\P�
@W\@�
HW\ �
`W\PjhW\p�pW\��xW\��W\��W\��W\�
�W\��W\��
�W\P��W\P�
�W\�
�W\ �
�W\Pj�W\p��W\���W\�X\��X\�X\�
X\�(X\��
0X\��8X\P�
@X\@�
HX\ �
`X\jhX\P�pX\�xX\ ��X\���X\��X\�
�X\��X\��
�X\@��X\P�
�X\�
�X\ �
�X\j�X\P��X\@��X\ �Y\��Y\�Y\�
Y\�(Y\��
0Y\@�8Y\P�
@Y\@�
HY\ �
`Y\jhY\��pY\ �xY\��Y\`��Y\��Y\�
�Y\��Y\��
�Y\���Y\P�
�Y\�
�Y\ �
�Y\j�Y\���Y\ ��Y\�Z\`�Z\�Z\�
Z\�(Z\��
0Z\@�8Z\P�
@Z\@�
HZ\ �
`Z\jhZ\��pZ\��xZ\���Z\0��Z\��Z\�
�Z\��Z\��
�Z\���Z\P�
�Z\�
�Z\ �
�Z\j�Z\���Z\���Z\��[\0�[\�[\�
[\�([\��
0[\��8[\P�
@[\@�
H[\ �
`[\jh[\p�p[\��x[\`��[\���[\��[\�
�[\��[\��
�[\P��[\P�
�[\�
�[\ �
�[\j�[\p��[\���[\`�\\��\\�\\�
\\�(\\��
0\\��8\\P�
@\\@�
H\\ �
h\\@bp\\Pbx\\�M�\\��
�\\P^�\\�^�\\`�
�\\P:�\\p��\\�^�\\0`�\\`g�\\�C�\\pE�\\�`�\\p:�\\�<�\\ ?�\\�A]\�d]\0G]\Pc]\�L ]\@^(]\pb0]\�8]\�^@]\�h]\P�p]\��x]\Є�]\�r�]\���]\�
�]\��]\`:�]\��
�]\p�]\ �
�]\�
�]\ �
�]\��]\P��]\��^\�{^\��^\�
^\ � ^\`:(^\��
0^\P_8^\ �
@^\�
H^\ �
h^\P�p^\0�x^\��^\0u�^\���^\�
�^\��^\`:�^\��
�^\�b�^\ �
�^\@�
�^\ �
�^\���^\p��^\�_\�}_\��_\�
_\ � _\`:(_\��
0_\��8_\ �
@_\@�
H_\ �
h_\�p_\�x_\`��_\��_\���_\�
�_\ ��_\`:�_\��
�_\���_\ �
�_\@�
�_\ �
�_\^�_\ ^�_\`V`\��
`\V`\��`\`�
 `\P:(`\p�0`\�8`\0z@`\lH`\�CP`\pEX`\�f``\p:h`\�<p`\ ?x`\�A�`\�d�`\0Y�`\Pc�`\0{�`\pX�`\�X�`\��`\���`\��`\���`\@��`\��a\@�a\��a\�
a\� a\`:(a\��
0a\�V8a\ �
@a\�
Ha\ �
ha\@�pa\��xa\��a\�w�a\���a\�
�a\@��a\`:�a\��
�a\�V�a\ �
�a\�
�a\ �
�a\���a\���a\��b\ �b\��b\�
b\� b\`:(b\��
0b\��8b\ �
@b\@�
Hb\ �
hb\@�pb\��xb\��b\���b\���b\�
�b\@��b\`:�b\��
�b\���b\ �
�b\@�
�b\ �
�b\pR�b\�R�b\�Uc\��
c\PUc\@wc\`�
 c\P:(c\p�0c\`N8c\�P@c\`gHc\�CPc\pEXc\�e`c\p:hc\�<pc\ ?xc\�A�c\�d�c\0G�c\Pc�c\�L�c\�Q�c\�Q�c\��c\@w�c\��c\���c\���c\@�d\@�d\��d\�
d\�q d\`:(d\��
0d\@S8d\ �
@d\�
Hd\ �
hd\�pd\��xd\��d\�q�d\���d\�
�d\�q�d\`:�d\��
�d\@O�d\ �
�d\�
�d\ �
�d\���d\��d\p�e\ �e\��e\�
e\�q e\`:(e\��
0e\�S8e\ �
@e\@�
He\ �
he\�pe\��xe\p��e\`t�e\���e\�
�e\�q�e\`:�e\��
�e\`P�e\ �
�e\@�
�e\ �
�e\pR�e\�R�e\�Mf\��
f\�Mf\�vf\`�
 f\P:(f\p�0f\`N8f\�P@f\`gHf\�CPf\pEXf\�e`f\p:hf\�<pf\ ?xf\�A�f\�d�f\0G�f\Pc�f\�L�f\�Q�f\�Q�f\��f\�v�f\��f\���f\���f\�g\@�g\��g\�
g\�q g\`:(g\��
0g\@S8g\ �
@g\�
Hg\ �
hg\�pg\��xg\���g\���g\���g\�
�g\�q�g\`:�g\��
�g\@O�g\ �
�g\�
�g\ �
�g\���g\@��g\��h\ �h\��h\�
h\�q h\`:(h\��
0h\�S8h\ �
@h\@�
Hh\ �
hh\�ph\@�xh\з�h\���h\���h\�
�h\�q�h\`:�h\��
�h\`P�h\ �
�h\@�
�h\ �
�h\�
�h\p�
�h\�
i\��i\ �i\`�i\`�
 i\p�
(i\ �
0i\��8i\��@i\0�
Hi\��
Pi\�
Xi\��
`i\p�
hi\0�
pi\��
xi\��
�i\��
�i\ �
�i\P�
�i\0�
�i\@��i\���i\�
�i\��i\��i\���i\��i\��j\б
j\��
j\�
j\`�
 j\0�
(j\��
0j\@�
8j\ �
@j\�
Hj\ �
hj\��pj\��xj\���j\б
�j\��
�j\�
�j\Щ
�j\�
�j\��
�j\��
�j\ �
�j\�
�j\ �
�j\���j\���j\��k\p�
k\��
k\�
k\`�
 k\0�
(k\��
0k\��
8k\ �
@k\@�
Hk\ �
hk\��pk\��xk\0��k\p�
�k\��
�k\�
�k\Щ
�k\�
�k\��
�k\0�
�k\ �
�k\@�
�k\ �
�k\�
�k\p�
�k\�
l\��
l\@�l\��l\`�
 l\Po(l\�q0l\�58l\ 3@l\0�
Hl\��
Pl\�
Xl\��`l\p�
hl\0�
pl\��
xl\��
�l\��
�l\ �
�l\P�
�l\0�
�l\P��l\���l\�
�l\���l\��l\`I�l\�8�l\ Om\@�m\��m\�
m\`�
 m\0�
(m\��
0m\@�
8m\ �
@m\�
Hm\ �
hm\`]pm\�Cxm\�b�m\Pn�m\���m\�
�m\y�m\���m\��
�m\�<�m\P�
�m\�
�m\ �
�m\`I�m\@�m\Sn\ �n\��n\�
n\`�
 n\0�
(n\��
0n\��
8n\ �
@n\@�
Hn\ �
hn\`]pn\Yxn\`g�n\`��n\���n\�
�n\y�n\���n\��
�n\p?�n\P�
�n\@�
�n\ �
�n\�
�n\p�
�n\�
o\��
o\�Mo\��o\`�
 o\0�(o\P�0o\�8o\�@o\0�
Ho\��
Po\�
Xo\��
`o\p�
ho\0�
po\��
xo\��
�o\��
�o\ �
�o\P�
�o\0�
�o\P��o\���o\�
�o\���o\0��o\�
�o\p�
�o\`�p\0~p\��p\�
p\�x p\�V(p\��
0p\�8p\P�
@p\@�
Hp\ �
hp\�
pp\p�
xp\�
�p\��
�p\���p\��p\`�
�p\0��p\P��p\��p\��p\0�
�p\��
�p\�
�p\���p\p�
�p\0�
�p\��
�p\��
q\��
q\ �
q\P�
q\0�
 q\��(q\`�0q\�
8q\�@q\�hq\�pq\ xq\��q\�q\���q\�
�q\`�
�q\0�
�q\��
�q\@�
�q\ �
�q\�
�q\ �
�q\`&�q\��q\`-r\ 2r\��r\�
r\�x r\�V(r\��
0r\�8r\P�
@r\�
Hr\ �
hr\�pr\`	xr\P�r\`}�r\���r\�
�r\`�
�r\0�
�r\��
�r\��
�r\ �
�r\@�
�r\ �
�r\��r\��r\ s\�zs\��s\�
s\�x s\�V(s\��
0s\�8s\P�
@s\@�
Hs\ �
hs\`&ps\@#xs\0*�s\�y�s\���s\�
�s\�x�s\�V�s\��
�s\��s\P�
�s\@�
�s\ �
�s\�xd�s\�hd�s\�pdt\�t\�t\� t\Ћ(t\��
0t\�8t\��
@t\��
Ht\�
Pt\0�
Xt\ �
`t\0�
ht\p�
�~\`r]\@)\��]\�� \ R]0\��8\`0@\B]H\�
P\@�`\`�h\�	\x\��]�\�(�\P��\�d�\�(�\���\@b]�\`��\��`�\qp�\vЀ\q�\�@�\�P�\h^X�\�e`�\�e��\���\�^ȁ\T�\Ё\T�\ �\�0�\8_��\���\�_��\�e��\�e�\��\8`p�\���\���\�e��\�e�\��\�`��\me�\meP�\�`�\�bh�\�dep�\�de��\,�Є\�b؄\R�\�\R�\0�\'�@�\c��\9���\(c��\�e��\�e�\J� �\Pc(�\�e0�\�e��\S���\�c��\�e��\�e�\\��\d�\le�\le`�\u�p�\xdx�\he��\heЇ\
��\���\Xe�\Xe@�\��P�\�d��\����\�dȈ\�eЈ\�e �\��0�\e8�\�e@�\�e��\����\0e��\@e��\@e�\���\he�\] �\]p�\ր��\���\8e��\8e�\���\�eP�\�`�\�e��\q�Ћ\f؋\�e�\�e0�\8�@�\�H�\`eP�\`e��\'���\,���\�e��\�e�\A� �\Hf(�\�e0�\�e��\O���\pf��\0e��\0e�\a��\�f�\S�\�\S�\`�\\�p�\gЎ\���\(g�\|e�\|e@�\n�P�\HgX�\�e`�\�e��\����\�gȏ\peЏ\pe �\��0�\�g8�\�e@�\�e��\����\�h��\�e��\�e�\���\���\�e �\�ep�\Ё��\(i�\]��\�iP�\l�`�\�j��\݁В\0kؒ\He�\He0�\�@�\XkH�\�eP�\�e��\���\�k��\�e��\�e�\� �\xl(�\�e0�\�e��\���\�l��\@e��\@e�\]��\�l�\�]�\�]`�\�p�\(mx�\�e��\�eЕ\ ��\�m�\H�\�\H�\@�\7�P�\�mX�\�e`�\�e��\;���\0nȖ\P�\Ж\P�\ �\E�0�\Xn8�\�e@�\�e��\R���\�n��\�e��\�e�\_��\�n�\�e �\�ep�\g���\o��\�e��\�e�\s��\Po��\xe�\xeP�\��`�\�o��\��Й\�oؙ\�e�\�e0�\��@�\��H�\�eP�\�e��\����\�o�\b� �\0p(�\pe0�\pe��\Ƃ��\Xp��\�e��\�e�\ʂ�\�p�\�e�\�e`�\тp�\�px�\�e��\�eМ\܂�\q�\�e�\�e@�\�P�\HqX�\�e`�\�e��\���\pqȝ\�eН\�e �\��0�\�q8�\�e@�\�e��\���\�q��\�e��\�e�\��\r�\�e �\�ep�\���\0r��\�e��\�e�\���\/���\�e�\�eP�\e�`�\�r��\G�Р\Hsؠ\�e�\�e0�\R�@�\hsH�\PeP�\Pe��\W���\�s�\O �\�s��\_���\�s��\�e��\�e�\h��\ t`�\��p�\m�x�\�e��\�e@�\��_`�\��h�\��p�\��x�\����\���\����\����\����\Ã�\��\P��\҃�\��9�\�|(�\Ht0�\�@�\pSP�\�tX�\=�h�\0zx�\�t��\ր��\�n��\���\���\lȥ\
�Х\%��\��\u��\)��\p=�\.� �\&�0�\0�@�\PuH�\qX�\P�h�\H�p�\[���\�V��\pu��\c���\�V��\i���\��Ц\0��\�u�\]���\�e�\�u�\/ �\��0�\��8�\�H�\�UX�\��`�\��p�\p=��\Ä��\���\`v��\τ��\_���\�Ч\�nا\��\����\v�\��\Б �\@v(�\�8�\nH�\hvP�\e�`�\�kp�\�vx�\u{��\�}��\�v��\8z��\P���\�oȨ\���\�|�\��\�|�\y8�\�|@�\�`�\�|h�\$���\�|��\*y��\�|��\3�ة\�|�\B��\�|�\N�(�\�|0�\[�P�\�|X�\Y�x�\�|��\����\�|��\\�Ȫ\�|Ъ\g��\�|��\m��\�| �\u�@�\�|H�\�h�\�|p�\���\�|��\����\�|��\���\�|�\���\�|�\��0�\�|8�\:�X�\�|`�\����\�|��\���\�|��\��Ь\�|ج\����\�|�\�� �\�|(�\��H�\�|P�\̅p�\�|x�\Ӆ��\�|��\ׅ��\�|ȭ\ޅ�\�|�\��\�|�\�8�\�|@�\��`�\�|h�\p���\�|��\E���\�|��\�|خ\�|�\��\�|�\��(�\�|0�\�P�\�|X�\�x�\�|��\���\�|��\�ȯ\�|Я\��\�|��\��\�| �\�@�\�|H�\#�h�\�|p�\+���\�|��\q���\�|��\4��\�|�\:��\�|�\A�0�\�|8�\�X�\�|`�\z���\�|��\I���\�|��\Q�б\�|ر\W���\�|�\΋ �\�|(�\`�H�\�|P�\g�p�\�|x�\_���\�|��\m���\�|Ȳ\u��\�|�\��\�|�\��8�\�|@�\��`�\�|h�\����\�|��\đ��\�|��\��س\�|�\���\�|�\��(�\�|0�\��P�\�|X�\ņx�\�|��\І��\�|��\ۆȴ\�|д\��\�|��\��\�| �\�@�\�|H�\��h�\�|p�\����\�|��\���\�|��\	��\�|�\��\�|�\#�0�\�|8�\5�X�\�|`�\B���\�|��\1�9��\�|��\I�ж\�|ض\R���\�|�\�� �\�|(�\}H�\�|P�\:�p�\�|x�\\���\�|��\e���\�|ȷ\u��\�|�\���\�|�\��8�\�|@�\��`�\�|h�\
}��\�|��\����\�|��\��ظ\�|�\���\�|�\��(�\�|0�\��P�\�|X�\ʇx�\�|��\ч��\�|��\ևȹ\�|й\߇�\�|��\��\�| �\��@�\�|H�\�h�\�|p�\���\�|��\���\�|��\��\�|�\)��\�|�\ڑ0�\�|8�\}X�\�|`�\-���\�|��\2���\�|��\7�л\�|ػ\@���\�|�\J� �\�|(�\R�H�\�|P�\W�p�\�|x�\\���\�|��\c���\�|ȼ\j��\�|�\��\�|�\s�8�\�|@�\z�`�\�|h�\}��\�|��\����\�|��\��ؽ\�|�\���\�|�\��(�\�|0�\��P�\�|X�\��x�\�|��\����\�|��\��Ⱦ\�|о\���\�|��\ň�\�| �\Έ@�\�|H�\Ԉh�\�|p�\و��\�|��\߈��\�|��\��\�|�\��\�|�\�0�\�|8�\!}X�\�|`�\���\�|��\����\�|��\��\�|�\���\�|�\
� �\�|(�\�H�\�|P�\�p�\�|x�\���\�|��\#���\�|�\(��\�|�\1��\�|�\'}8�\�|@�\:�`�\�|h�\M���\�|��\X���\�|��\_���\�|��\e��\�|�\l�(�\�|0�\r�P�\�|X�\z�x�\�|��\���\�|��\����\�|��\����\�|��\���\�| �\��@�\�|H�\��h�\�|p�\����\�|��\����\�|��\ȉ��\�|��\`��\�|�\Ӊ0�\�|8�\ډX�\�|`�\7���\�|��\����\�|��\���\�|��\���\�|�\� �\�|(�\��H�\�|P�\��p�\�|x�\���\�|��\���\�|��\���\�|��\��\�|�\�8�\�|@�\-�`�\�|h�\2���\�|��\7���\�|��\<���\�|��\A��\�|�\F�(�\�|0�\N�P�\�|X�\W�x�\�|��\\���\�|��\;���\�|��\f���\�|��\p��\�| �\w�@�\�|H�\�h�\�|p�\����\�|��\���\�|��\����\�|��\���\�|�\��0�\�|8�\��X�\�|`�\����\�|��\����\�|��\����\�|��\����\�|�\�� �\�|(�\��H�\�|P�\��p�\�|x�\����\�|��\ތ��\�|��\z���\�|��\Ɗ�\�|�\̊8�\�|@�\֊`�\�|h�\����\�|��\���\�|��\���\�|��\:}�\�|�\�(�\�|0�\��P�\�|X�\�x�\�|��\���\�|��\���\�|��\���\�|��\0��\�| �\<�@�\�|H�\L�h�\�|p�\[���\�|��\k���\�|��\w���\�|��\���\�|�\��0�\�|8�\��X�\�|`�\����\�|��\Ë��\�|��\Ջ��\�|��\���\�|�\� �\�|(�\��H�\�|P�\�p�\�|x�\$���\�|��\-���\�|��\B���\�|��\W��\�|�\^�8�\�|@�\i�`�\�|h�\s���\�|��\~���\�|��\D���\�|��\���\�|�\��(�\�|0�\v�P�\�|X�\��x�\�|��\����\�|��\����\�|��\����\�|��\Č�\�| �\Ɍ@�\�|H�\Ҍh�\�|p�\C���\�|��\ٌ��\�|��\���\�|��\��\�|�\�0�\�|8�\��X�\�|`�\���\�|��\
���\�|��\���\�|��\���\�|�\$� �\�|(�\(�H�\�|P�\-�p�\�|x�\0���\�|��\5���\�|��\9���\�|��\��\�|�\L�8�\�|@�\T�`�\�|h�\]���\�|��\d���\�|��\����\�|��\1��\�|�\q�(�\�|0�\v�P�\�|X�\�x�\�|��\����\�|��\���\�|��\����\�|��\��\�| �\��@�\�|H�\��h�\�|p�\����\�|��\����\�|��\h���\�|��\���\�|�\��0�\�|8�\��X�\�|`�\����\�|��\Ǎ��\�|��\ύ��\�|��\ԍ��\�|�\܍ �\�|(�\�H�\�|P�\�p�\�|x�\����\�|��\���\�|��\����\�|��\��\�|�\�8�\�|@�\Z�`�\�|h�\���\�|��\���\�|��\"���\�|��\*��\�|�\4�(�\�|0�\?�P�\�|X�\F�x�\�|��\U���\�|��\c���\�|��\p���\�|��\x��\�| �\�@�\�|H�\��h�\�|p�\����\�|��\����\�|��\����\�|��\���\�|�\��0�\�|8�\��X�\�|`�\����\�|��\Ɏ��\�|��\Ҏ��\�|��\َ��\�|�\� �\�|(�\�H�\�|P�\�p�\�|x�\����\�|��\����\�|��\���\�|��\��\�|�\%�8�\�|@�\1�`�\�|h�\���\�|��\���\�|��\$���\�|��\.��\�|�\5�(�\�|0�\I�P�\�|X�\=�x�\�|��\P���\�|��\Y���\�|��\����\�|��\`��\�| �\j�@�\�|H�\q�h�\�|p�\~���\�|��\����\�|��\����\�|��\���\�|�\��0�\�|8�\�X�\�|`�\U���\�|��\����\�|��\����\�|��\����\�|�\�� �\�|(�\��H�\�|P�\��p�\�|x�\ŏ��\�|��\͏��\�|��\}���\�|��\֏�\�|�\�8�\�|@�\�`�\�|h�\����\�|��\���\�|��\���\�|��\"��\�|�\6�(�\�|0�\C�P�\�|X�\T�x�\�|��\_���\�|��\n���\�|��\}���\�|��\���\�| �\��@�\�|H�\��h�\�|p�\����\�|��\����\�|��\����\�|��\ΐ�\�|�\Ԑ0�\�|8�\ݐX�\�|`�\���\�|��\���\�|��\���\�|��\s���\�|�\�� �\�|(�\�H�\�|P�\�p�\�|x�\���\�|��\����\�|��\���\�|��\$��\�|�\/�8�\�|@�\9�`�\�|h�\C���\�|��\����\�|��\N���\�|��\���\�|�\ۊ(�\�|0�\S�P�\�|X�\`�x�\�|��\n���\�|��\w���\�|��\���\�|��\Y��\�| �\��@�\�|H�\��h�\�|p�\����\�|��\����\�|��\����\�|��\���\�|�\0�\�|8�\��X�\�|`�\‘��\�|��\Α��\�|��\ؑ��\�|��\ݑ��\�|�\� �\�|(�\�H�\�|P�\�p�\�|x�\����\�|��\���\�|��\
���\�|��\��\�|�\�8�\�|@�\�`�\�|h�\%���\�|��\����\�|��\)���\�|��\8��\�|�\@�(�\�|0�\F�P�\�|X�\O�x�\�|��\X���\�|��\j���\�|��\f���\�|��\m��\�| �\U�@�\�|H�\w�h�\�|p�\����\�|��\����\�|��\����\�|��\N��\�|�\��0�\�|8�\��X�\�|`�\����\�|��\����\�|��\����\�|��\����\�|�\ć �\�|(�\��H�\�|P�\h�p�\�|x�\Ē��\�|��\D���\�|��\ǒ��\�|��\Ғ�\�|�\ے8�\�|@�\ߒ`�\�|h�\���\�|��\���\�|��\���\�|��\��\�|�\�(�\�|0�\�P�\�|X�\�x�\�|��\���\�|��\&��\�|�\,��\�|��\2��\�| �\7�@�\�|H�\=�h�\�|p�\G���\�|��\K���\�|��\U��\�|�\\��\�|�\d�0�\�|8�\l�X�\�|`�\q���\�|��\v���\�|��\~��\�|�\����\�|�\�� �\�|(�\��H�\�|P�\��p�\�|x�\����\�|��\י��\�|�\ɕ�\�|�\œ�\�|�\ϓ8�\�|@�\ݓ`�\�|h�\���\�|��\O���\�|��\��\�|�\��\�|�\�(�\�|0�\��P�\�|X�\��x�\�|��\���\�|��\��\�|�\��\�|��\!��\�| �\-�@�\�|H�\6�h�\�|p�\>���\�|��\I���\�|��\S��\�|�\]��\�|�\d�0�\�|8�\l�X�\�|`�\x���\�|��\����\�|��\��\�|�\����\�|�\�� �\�|(�\��H�\�|P�\��p�\�|x�\����\�|��\����\�|�\���\�|�\���\�|�\B�8�\�|@�\ǔ`�\�|h�\Ҕ��\�|��\ؔ��\�|��\��\�|�\���\�|�\+�(�\�|0�\�P�\�|X�\�x�\�|��\���\�|��\��\�|�\��\�|��\"�]�| ]3�@]�|H]C�h]�|p]^��]�|�]x��]�|�]���]�|�]��]�|]��0]�|8]��X]�|`]���]�|�]Õ�]�|�]Е�]�|�]���]�|]� ]�|(]�H]�|P]�p]�|x]���]�|�]��]�|�]	��]�|�]�]�|]�8]�|@]#�`]�|h]*��]�|�]7��]�|�]D��]�|�]S�]�|]\�(]�|0]e�P]�|X]p�x]�|�]v��]�|�]���]�|�]|��]�|�]B�]�| ]P�@]�|H]��h]�|p]���]�|�]��]�|�]���]�|�]H�]�|]��0]�|8]��X]�|`]���]�|�]���]�|�]���]�|�]���]�|]�� ]�|(]��H]�|P]��p]�|x]і�]�|�]��]�|�]��]�|�]�]�|]��8]�|@]�`]�|h]��]�|�] ��]�|�]+��]�|�]5�	]�|	]9�(	]�|0	]=�P	]�|X	]A�x	]�|�	]O��	]�|�	]\��	]�|�	]k��	]�|�	]y�
]�| 
]��@
]�|H
]��h
]�|p
]���
]�|�
]���
]�|�
]͗�
]�|�
]�]�|]�0]�|8]�X]�|`]��]�|�]&��]�|�]*��]�|�]1��]�|]?� ]�|(]P�H]�|P]Z�p]�|x]g��]�|�]m��]�|�]��]�|�]k�
]�|
]v�8
]�|@
]��`
]�|h
]җ�
]�|�
]��
]�|�
]���
]�|�
]z�]�|]��(]�|0]��P]�|X]�x]�|�]���]�|�]���]�|�]���]�|�]��]�| ]��@]�|H]��h]�|p]���]�|�]���]�|�]ǘ�]�|�]͘]�|]ט0]�|8]ܘX]�|`]��]�|�]��]�|�]���]�|�]��]�|]� ]�|(]�H]�|P]�p]�|x]��]�|�]��]�|�])��]�|�]�]�|]$�8]�|@])�`]�|h]4��]�|�]8��]�|�]?��]�|�]J�]�|]V�(]�|0]b�P]�|X]i�x]�|�]p��]�|�]z��]�|�]���]�|�]\�]�| ]��@]�|H]��h]�|p]3��]�|�]���]�|�]���]�|�]��]�|]Ǚ0]�|8]#�X]�|`]���]�|�]ϙ�]�|�]ՙ�]�|�]��]�|]� ]�|(]֕H]�|P]��p]�|x]	��]�|�]��]�|�]��]�|�]�]�|]%�8]�|@].�`]�|h]6��]�|�]>��]�|�].��]�|�]�z]�|]<�(]�|0]I�P]�|x]�|�]R��]�|�]��9�]���]���]���]�}�]Ě�]�}�]ɚ�]ڤ�]0�]By]К@]�"H]�"P]�"X]�"`]�"h]�"p]�"x]�"�]`#�]P>�]#�]���]���]Љ�]#�] #�]0#�]P#�]p#�]�#�]�#�]��] Z�]@`]p<]PW]0)]- ]@�(]Pa0]Pp8]0�@]@rH] P]`rX]�`]`�h]0�p]��x]0��]���]@"�]�`�]P"�]`"�]`��]��]Щ�]���] %�]'�] X�]�j�]�!�]"�]0"]P ]@!]  ]0< ]0X(]�#0]$8]$@]P<H]�YP]0$X] $`]��h]p"p]@$x]`)�]0?�] )�]>�]PK	�]p?�]�2�] <�]P$�]P`�]��]��]��]��]�%�]`�]`]�]0] ]�# ]��(]P�0]`�8]@%@]`(H]P]@X]�`]`h]0p]@x]�]0�]�]��]P�]���]@�]�]��]p�]�(�]���]`s�]�p�]P��]�h]��]�k]�h]�� ]P	(]��0]�8]p@]��H]PP]�X]��`]/h]�,p]@]x]@�]���]�3]�]x3]�]��]b�]S�]l�0]��H]��`]R�x]O��]8��]
��]���]x��]�]܂ ]ʂ8]тP]��h]��]��]��]���]���]���]�� ]��( ]�@ ]n�X ]��p ]]�� ]ç� ]ۧ� ]�� ]��� ]g�!]�!];�0!]݁H!]��`!]�x!]&��!]2��!]=��!]��!]L��!]^�"]k� "]w�("]��8"]H�P"]σh"]���"]���"]���"]���"]���"]���"]��#]Ȩ(#]Ϩ@#]ڨX#]�p#]��#]���#]��#]��#]w��#]$� $]��($]��0$]��8$]��@$]«H$]ʫ`$]�h$]�p$]�x$]`~`%]�$]x%]�$]�%]�$]�%]�$]�%]�$]�%]�$]�%]�$] &]�&](&] ']0&]�']8&](]h&]�p&]I�x&]$��&]:��&]p	�&]��&]?��&]Z��&]:�']�	(']��0']�8']8�P']:�x']�$	�']��']\��']j��']:��']&	�']�%	�']@&	�']�&	(]��(]\�(]��0(]:�@(]�&	H(]�&	X(]`(]`(]`0	h(]�&	p(]p,	x(]@(	�(] -	�(]�+	�(]�)	�(]�*	�(]�0	�(]p(	�(]�'	�(]`'	�(]'	�(]0'	�(] )	�(]p+	�(]�(	)]�)]�)]�)]�()]�0)]�8)]�@)]�P)]�X)]��`)]��h)]��x)]��)]��)]��)]��)]��)]��)]-��)]4��)];��)]E��)]K��)]K�*]д*]V�*]a� *]K�(*]д0*]V�@*]V�H*]K�P*]дX*]V�h*]k�p*]K�x*]д�*]V��*]t��*]t��*]���*]���*]���*]t��*]���*]���*]���*]t��*]���*]��+]��+]t�+]�� +]��0+]��8+]��@+]��H+]��X+]ǵ`+]��h+]��p+]���+]���+]���+]���+]���+]ҵ�+]���+]���+]���+]ܵ�+]ܵ�+]��+]��+]��,]ܵ,]�,]� ,]�(,]ܵ0,]�8,]�H,]�P,]ܵX,]�`,]�p,]�x,]��,]��,]��,](��,]��,]��,]��,]��,]��,]��,]��,]2��,]��,]�-]�-];�-];� -]F�(-]M�8-]X�@-];�H-]F�P-]M�`-]M�h-];�p-]F�x-]M��-]b��-];��-]F��-]M��-]k��-]k��-]v��-]}��-]���-]k��-]v��-]}�.]}�.]k�.]v�.]}�(.]��0.]k�8.]v�@.]}�P.]��X.]��h.]��x.]���.]���.]���.]���.]���.]���.]���.]���.]���.]Ķ�.]Ķ/]϶/]ڶ /]Ķ0/]϶@/]϶H/]ĶX/]϶h/]�p/]Ķ�/]϶�/]��/]��/]��/]���/]��/]��/]��/]���/]��/]��/]��/]
�0]�0]�0]� 0]
�00]�80]�H0]�X0]�`0]�p0]��0] ��0]%��0]/��0] ��0]4��0]%��0]/��0] ��0]>��0]G��0]P��0]W��0]P�1]G�1]P�1]W� 1]^�(1]g�01]^�81]p�H1]z�P1]g�X1]^�`1]p�p1]��x1]���1]���1]���1]���1]���1]���1]���1]���1]÷�1]ʷ�1]з�1]շ2]з2]ڷ2]� 2]�(2]�82]�@2]��`2]�h2]�p2]�x2]��2]���2]÷�2]���2]÷�2]��2]"��2]��2]"��2]&��2]1��2]:��2]B�3]ߴ3]N�3]ߴ3]S�(3]Y�03]N�83]ߴ@3]S��3]��[�3]ht[�3]�o[�3]�w[�3]`��3]���3]���3]��3]0��3]X��3]���3]��4]��4]�4](�4]x� 4]��(4]��04]��84]��@4]��H4](�P4]h�X4]��`4]8�h4]��p4]��x4]���4]���4]�|�4]8��4]�|�4]l��4]���4]x��4]���4]���4]��4]��4]0��4]&��4]?��4]O��4]i�5]{�5]p�5]��5]�� 5]��(5]�05]P�85]��@5]��H5]�|P5]�|X5]�|`5]�|h5]�|p5]��x5]���5]�|�5]�|�5]���5]��5]���5]�|�5]��5]8��5]��5]6��5]`��5]�|�5]�|�5]�|�5]�|�5]�|6]�|6]�|6]�|6]L� 6]�|(6]��06]�|86]�|@6]��H6]�|P6]��X6](�`6]`�h6]��p6]��x6]��6]@��6]p��6]�|�6]f��6]��_�6]p�	�6]��7]��7] 7](7]@�
@7]ByH7]T�P7]��X7]@@
�7]�:]�7]��e�7]��9�7]��e�7]���7]��e�7]"��7]�e�7]2� 8]�e(8]C�88]��e@8]N�P8]��eX8]Y�h8]��ep8]n��8]��e�8]���8]��e�8]���8]��e�8]���8]��e�8]��8]��e9]�9]��e9]�(9]��e09]�@9]��eH9]�X9]��e`9]&�p9]��ex9]1��9]��e�9]F��9]��e�9]W��9]��e�9]e��9]��e�9]s��9]��e�9]��:]��e:]��:]��e :]��0:]��e8:]��H:]�eP:]��`:]��eh:]�x:]��e�:]��:]��e�:]��:]��:]`~
;]�|;]@;] ;]��
(;]��
0;]��e@;]��H;]��P;]��`;]@�
h;]��p;]�~x;]P�
�;]0�
�;]0�
�;]�|�;]�;]�;]-��;]���;]��<] <] <]�
(<]��
0<]��
8<]��
@<]��
H<]е
P<]�
X<]0�
`<]�
h<]�
p<] �
x<]�
�<]0�
�<]�
�<]@�
�<]�
�<]P�
�<] �
�<]`�
�<]p�
�<]�
�<]��
�<]��
�<]��
�<]��
�<]��
�<]��
�<]0�
=] �
=]б
=]�
=]�
 =]@�
(=]�
0=]�
8=]�
@=]��
H=] �
P=]P�
X=]0�
`=]��
h=]@�
p=]P�
x=]`�
�=]��
�=]и
�=]�
�=]��
�=]p�
�=]��
�=]��
�=]`�
�=]��
�=]p�
�=]��
�=]��
�=]��
�=]��
�=]��
�=]ж
>]��
>]�
>]в
>]�
 >]�
(>]�
0>]�
8>]@�
@>]@�
H>]��
P>]�
X>] �
`>]0�
h>]`�
p>]@�
x>]P�
�>]`�
�>]P�
�>]��
�>]��
�>]��
�>]��
�>]��
�>]��
�>]з
�>]�
�>]�
�>]�
�>]P�
�>]`�
�>]p�
�>]��
?]`�
?]p�
?]�
?]p�
 ?]`�
(?]p�
0?]�
8?]��
@?]�
H?]�
P?]�
X?] �
`?]��
h?]��
p?]0�
x?]д
�?]��
�?]0�
�?]��
�?]г
�?]P�
�?]�
�?]��
�?]�
�?]�
�?]�
�?]�
�?]@�
�?]�
�?] �
�?] �
�?]��
@]0�
@]@�
@]��
@]P�
 @]0�
(@]`�
0@] �
8@]@�
@@]p�
H@]�
P@]P�
`@]��
�@]���@](��@]P��@]x��@]���@]���@]��@]�|�@]��@]\�@]`��@]���@]���@]��@]���@](�A]X�A]zA]��A]�� A]P�(A]��0A]�8A]�@A]H�HA]��PA]��XA]�`A]@hA]hpA]�xA]��A]�A](�A]`�A]��A]��A]��A]�A]��]�A]њB]`�(B]`�8B]`�HB]�%XB]`�hB]`�xB]`��B]���B]�~�B] ��B]`��B]`��B] ��B]`��B]`�C]`�C]`�(C]P�8C]`�HC]��XC] 1hC]p�xC]�.�C]`��C]�(�C]`��C]�(�C]`��C]`��C]`��C]@D]`�D]`�(D]`�8D]`�HD]`�XD]`�hD]`�xD]`��D]`��D]`��D]`��D]`��D]`��D]`��D]`��D]`�E]`�E]`�(E]`�8E]`�HE]`�XE]`�hE]`�xE]`��E]`��E]`��E]`��E]`��E]`��E]`��E]`��E]`�F]`�F]`�(F]`�8F]`�HF]`�XF]`�hF]`�xF]`��F]`��F]`��F]`��F]`��F]`��F]`��F]`��F]`�G]`�G]`�(G]`�8G]`�HG]`�XG]`�hG]`�xG]`��G]`��G]`��G]`��G]`��G]`��G]`��G]`��G]`�H]`�H]`�(H]`�8H]`�HH]`�XH]`�hH]`�xH]`��H]`��H]`��H]`��H]`��H]`��H]`��H]`��H]`�I]`�I]`�(I]`�8I]`�HI]`�XI]`�hI]`�xI]`��I]`��I]`��I]`��I]`��I]`��I]`��I]`��I]��J]`�J]`�(J]`�8J]`�HJ]`�XJ]`�hJ]`�xJ]`��J]`��J]`��J]`��J]`��J]`��J]`��J]`��J]`�K]`�K]`�(K]`�8K]`�HK]`�XK]`�hK]`�xK]`��K]`��K]`��K]`��K]`��K]`��K]`��K]`��K]`�L]`�L]`�(L]`�8L]`�HL]`�XL]`�hL]`�xL]`��L]`��L]`��L]`��L]`��L]`��L]`��L]`��L]`�M]`�M]`�(M]`�8M]`�HM]`�XM]`�hM]`�xM]`��M]`��M]`��M]`��M]`��M]`��M]`��M]`��M]`�N]`�N]`�(N]`�8N]`�HN]`�XN]`�hN]`�xN]`��N]`��N]`��N]`��N]`��N]`��N]`��N]`��N]`�O]`�O]`�(O]`�8O]`�HO]`�XO]`�hO]`�xO]`��O]`��O]`��O]`��O]`��O]`��O]`��O]`��O]`�P]`�P]`�(P]`�8P]`�HP]`�XP]`�hP]`�xP]`��P]`��P]`��P]`��P]`��P]`��P]`��P]`��P]`�Q]`�Q]`�(Q]`�8Q]`�HQ]`�XQ]`�hQ]`�xQ]`��Q]`��Q]`��Q]`��Q]`��Q]`��Q]`��Q]`��Q]`�hR]�%xR]��R]�"�R]��R] ��R].�R]��R] �S]P�(S]��8S]p�HS]P�XS]`�hS]��xS] 1�S]p��S]�.�S]�(T]@(T]�XT]p�hT]�xT]@;�T]�&�T]�%�T]P��T]�9�T]��U]`U](U]�8U] )HU] )XU] )hU] )xU] )�U] )�U] )�U] )�U] )�U]�9�U]�%V]8V]�'HV]�"XV] 0hV]P/xV]0%�V]�9�V]��V]�'W]�(W]`)HW]�?XW]�?hW]�9xW]�9�W]#�W]�6�W]P2�W]�%X]p9X]P(X] A8X]'HX]�"XX] 0hX]P/xX]0%�X]�9�X]��X]�%�X]P��X]���X]��X]�@Y]�(Y]`)HY]�=XY]�?hY]�9xY]@�Y]#�Y]03�Y]P2�Y]�*Z]4�b]�"hc]���c]@:�c]���d]@=�d]�>Xf]��hf]��xf]���f]���f]���f]���f]���f]���f]���f]���f]��g]��g]��(g]��8g]��Hg]��Xg]��hg]��xg]���g]���g]���g]���g]���g]���g]���g]���h]�=8j]�-�r]�"�r]�,�r]�s]к8s]к�s]�9�s]�3t]�~8t]��ht]���t]p��t]`#u]P8u]��Hu] +hu]��xu]���u]���u]���u]���u]���u]���u]���u]���u]��(v]0�8v]@Hv]��Xv]@xv]���v]���v]���v]���v]���v]���v]���v]���v]��w]��w]��(w]��8w]��Hw]��Xw]��hw]��xw]���w]���w]���w]���w]���w]���w]���w]���w]��x]��(x]0�Xx] +�x] ��x]p��x]-�x]��(y]`�Hy]�hy]0��y]�9�y]���y]P��y]@)Hz]`#Xz]�,��]����]���]�Ȃ]0�؂]��]���]�"�]���]�~(�] �8�].H�]�X�] �h�]P���]����]p���]P���]`�ȃ]��؃] 1�]p���]�.�]@b]�]�(8�]`r]X�]��x�]@:��]`���]`���]`���]`�Ȅ]`�؄]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȅ]`�؅]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�Ȇ]`�؆]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȇ]`�؇]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�Ȉ]`�؈]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȉ]`�؉]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]����]`���]`���]`���]`�Ȋ]`�؊]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȋ]`�؋]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�Ȍ]`�،]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȍ]`�؍]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�Ȏ]`�؎]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȏ]`�؏]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�Ȑ]`�ؐ]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]`���]`���]`���]`�ȑ]`�ؑ]`��]`���]`��]`��]`�(�]`�8�]`�H�]`�X�]`�h�]`�x�]`���]�A��]�EВ]�Lؒ]@
�]C
�]��]��]A@�]�H�]�P�]�h�]����]?��]^��]i��]Г]ȓ]�]Г]0�ؓ]��9�]+��].0�]A{@�]��P�]�|`�]@zh�]@yp�]@x��]��[ظ]�.\�]�/\�]A{ �]��0�]�|@�]@zH�]@yP�]@xX�]@wx�]��[��]�.\��]`0\�]A{�]@��]�| �]@z(�]@y0�]@xX�]��[��]�.\��]�0\к]A{�]��]�|�]@z�]@y�]@x�]@w8�]��[x�]�.\��]`1\��] �]��] �]�] �]��]a}��]
���]�|��]`|��]`{��]`{�]�s\X�]�1\`�]�2\�^���^���^�|�^���^��^�~�^�[8^`4\@^`5\p^���^���^�|�^���^��^�~�^�}�^�[^`4\ ^�5\P^��`^��p^�|�^���^��^�~�^�[�^`4\^`6\0^��@^:�P^�|`^��h^�p^�~x^�}�^�[�^`4\�^�6\ ^�^ ^�^ ^��]  ^��]8 ^��]p#^��]�#^��]$^h�9 $^x�0$^�|@$^��H$^��P$^��X$^��h$^��p$^ �[x$^�s\�$^`F\�$^`7\�l^a�m^��m^�| m^`�(m^`�0m^`�Xm^��[�m^�7\�m^�8\�m^a��m^���m^�|n^`�n^`�n^`�n^`�8n^��[xn^�7\�n^`9\�n^a��n^I��n^�|�n^`��n^`��n^`�o^��[Xo^�7\`o^�9\�o^a��o^4��o^�|�o^`��o^`��o^`��o^`��o^��[8p^�7\@p^`:\xu^�`^�u^�T^�u^�H^�u^�<^�u^�0^�u^�$^p_��!�_���_�|�_��!�_��!�_��!�_��[	_�:\ 	_�;\P	_��!`	_��p	_�|�	_��!�	_��!�	_��!�	_��!�	_��[�	_�:\
_`<\0
_��!@
_��P
_�|`
_��!h
_��!p
_��!�
_��[�
_�:\�
_�<\_��! _Z�0_�|@_��!H_��!P_��!X_��!x_��[�_�:\�_`=\�_`�^�_`�^_`�^_`�^H_`�^_`�^_`�^(_`�^0_`�^8_`�^x_`�^�_`x^�_$�_)�_�| _�T"(_�S"0_�R"8_�Q"H_�O"X_�s\�_`F\�_�E\�_9��_?��_�|�_`N"�_`M"�_`L"_`K"_`I" _�s\`_`F\h_�E\�_д�_���_�|�_@H"�_@G"�_@F"�_@E"�_@C"�_�s\(_`F\0_�E\H_V�X_Z�h_�|x_ B"�_ A"�_ @"�_ ?"�_ ="�_�s\�_`F\�_�E\_� _s�0_�|@_<"H_;"P_:"X_9"h_7"x_�s\�_`F\�_�E\�_��_���_�| _�5" _�4" _�3"  _�2"0 _�0"@ _�s\� _`F\� _�E\� _��� _��� _�|� _�/"� _�."� _�-"� _�,"� _�*"!_�s\H!_`F\P!_�E\h!_�x!_˹�!_�|�!_�)"�!_�("�!_�'"�!_�&"�!_�$"�!_�s\"_`F\"_�E\0"_P�@"_��P"_�|`"_��!h"_��!p"_��!x"_�#"�"_��!�"_�s\�"_`F\�"_�E\�"_д#_��#_�|(#_�""0#_�!"8#_� "@#_�"P#_�"`#_�s\�#_`F\�#_�E\�#_F��#_���#_�|�#_`"�#_`"$_`"$_`"$_`"($_�s\h$_`F\p$_�E\�$_���$_ȼ�$_�|�$_�!�$_�!�$_�!�$_`"�$_�!�$_�s\0%_`F\8%_�E\P%_�`%_ۼp%_�|�%_�5"�%_�4"�%_�3"�%_`"�%_�0"�%_�s\�%_`F\&_�E\&_�(&_D�8&_�|H&_@"P&_@"X&_@"`&_@"p&_@"�&_�s\�&_`F\�&_�E\�&_P��&_�'_�|'_��!'_��! '_��!('_@"8'_��!H'_�s\�'_`F\�'_�E\�'_��'_g��'_�|�'_ 
"�'_ "�'_ "�'_ 
"(_ "(_�s\P(_`F\X(_�E\p(_~��(_���(_�|�(_"�(_"�(_"�(_"�(_"�(_�s\)_`F\ )_�E\8)_�H)_�X)_�|h)_�5"p)_�4"x)_�3"�)_"�)_�0"�)_�s\�)_`F\�)_�E\*_�*_� *_�|0*_`�!8*_`�!@*_`�!H*_"X*_`�!h*_�s\�*_`F\�*_�E\�*_v��*_���*_�|�*_�!+_�!+_�!+_�! +_�!0+_�s\p+_`F\x+_�E\�+_^��+_ƺ�+_�|�+_��!�+_��!�+_��!�+_��!�+_��!�+_�s\8,_`F\@,_�E\X,_�h,_�x,_�|�,_��!�,_��!�,_��!�,_��!�,_��!�,_�s\-_`F\-_�E\ -_%�0-_-�@-_�|P-_��!X-_��!`-_��!h-_��!x-_��!�-_�s\�-_`F\�-_�E\�-_@��-_F�._�|._`�! ._`�!(._`�!0._`�!@._`�!P._�s\�._`F\�._�E\�._^��._g��._�|�._@�!�._@�!�._@�!�._@�!/_@�!/_�s\X/_`F\`/_�E\x/_���/_���/_�|�/_ �!�/_ �!�/_ �!�/_ �!�/_ �!�/_�s\ 0_`F\(0_�E\@0_��P0_��`0_�|p0_�!x0_�!�0_�!�0_�!�0_�!�0_�s\�0_`F\�0_�E\1_��1_M�(1_�|81_�!@1_�!H1_�!P1_�!`1_�!p1_�s\�1_`F\�1_�E\�1_@��1__��1_�|2_`�!2_`�!2_`�!(2_`�!82_�s\x2_`F\�2_�3\�2_~��2_i��2_�|�2_"�2_"�2_"�2_�!�2_"3_�s\@3_`F\H3_�E\`3_дp3_���3_�|�3_��!�3_��!�3_��!�3_��!�3_��!�3_�s\4_`F\4_�E\(4_д84_��H4_�|X4_��!`4_��!h4_��!p4_��!�4_��!�4_�s\�4_`F\�4_�E\�4_P�5_ʽ5_�| 5_��!(5_��!05_��!H5_��!X5_�s\�5_`F\�5_�3\�5_P��5_���5_�|�5_��!�5_��!�5_��!6_��!6_��! 6_�s\`6_`F\h6_�E\�6_P��6_ս�6_�|�6_��!�6_��!�6_��!�6_��!�6_��!�6_�s\(7_`F\07_�E\H7_^�X7_�h7_�|x7_@�!�7_@�!�7_@�!�7_@�!�7_�s\�7_`F\�7_�3\8_ͻ 8_Ի08_�|@8_��!H8_��!P8_��!X8_��!h8_��!x8_�s\�8_`F\�8_�E\�8_��8_+��8_�|9_`�!9_`�!9_`�!09_`�!@9_�s\�9_`F\�9_�3\�9_��9_��9_�|�9_`�!�9_`�!�9_`�!�9_`�!�9_`�!:_�s\H:_`F\P:_�E\h:_^�x:_��:_�|�:_��!�:_��!�:_��!�:_��!�:_�s\;_`F\;_�3\0;_�@;_]�P;_�|`;_�)"h;_�("p;_�'"�;_�$"�;_�s\�;_`F\�;_�3\�;_~�<_g�<_�|(<_"0<_"8<_"P<_"`<_�s\�<_`F\�<_�3\�<_ͻ�<_r��<_�|�<_��!�<_��!=_��!=_��!(=_�s\h=_`F\p=_�3\�=_��=_}��=_�|�=_��!�=_��!�=_��!�=_��!�=_�s\0>_`F\8>_�3\P>_$�`>_��p>_�|�>_�T"�>_�S"�>_�R"�>_�O"�>_�s\�>_`F\?_�3\?_�(?_��8?_�|H?_ 
"P?_ "X?_ "p?_ "�?_�s\�?_`F\�?_�3\�?_F��?_��@_�|@_`"@_`" @_`"8@_`"H@_�s\�@_`F\�@_�3\�@_V��@_���@_�|�@_ B"�@_ A"�@_ @"A_ ="A_�s\PA_`F\XA_�3\pA_%��A_���A_�|�A_��!�A_��!�A_��!�A_��!�A_�s\B_`F\ B_�3\8B_�HB_þXB_�|hB_<"pB_;"xB_:"�B_7"�B_�s\�B_`F\�B_�3\C_�C_; C_�|0C_@"8C_@"@C_@"XC_@"hC_�s\�C_`F\�C_�3\�C_��C_��C_�|�C_�5"D_�4"D_�3" D_�0"0D_�s\pD_`F\xD_�3\�D_v��D_���D_�|�D_�!�D_�!�D_�!�D_�!�D_�s\8E_`F\@E_�3\XE_��hE_�xE_�|�E_�!�E_�!�E_�!�E_�!�E_�s\F_`F\F_�3\ F_9�0F_�@F_�|PF_`N"XF_`M"`F_`L"xF_`I"�F_�s\�F_`F\�F_�3\�F_���F_�G_�|G_ �! G_ �!(G_ �!@G_ �!PG_�s\�G_`F\�G_�3\�G_���G_��G_�|�G_�/"�G_�."�G_�-"H_�*"H_�s\XH_`F\`H_�3\xH_:��H_!��H_�|�H_@�!�H_@�!�H_@�!�H_@�!�H_@�!�H_�s\ I_`F\(I_�E\@I_:�PI_(�`I_�|pI_@�!xI_@�!�I_@�!�I_@�!�I_�s\�I_`F\�I_�3\J_дJ_��(J_�|8J_ �!@J_ �!HJ_ �!PJ_ �!`J_ �!pJ_�s\�J_`F\�J_�E\�J_~��J_���J_�|K_"K_"K_"K_ �!(K_"8K_�s\xK_`F\�K_�E\�K_$��K_��!�K_�|�K_��!�K_�T"�K_�S"�K_�R"�K_�O"L_�s\@L_`F\HL_`E\`L_9�pL_���L_�|�L_��!�L_`N"�L_`M"�L_`L"�L_`I"�L_�s\M_`F\M_`E\(M_V�8M_�HM_�|PM_ٝ!XM_ B"`M_ A"hM_ @"�M_ ="�M_�s\�M_`F\�M_`E\�M_�N_�N_�|N_�! N_<"(N_;"0N_:"HN_7"XN_�s\�N_`F\�N_`E\�N_��N_K��N_�|�N_�!�N_�5"�N_�4"�N_�3"O_�0" O_�s\`O_`F\hO_`E\�O_���O_c��O_�|�O_&�!�O_�/"�O_�."�O_�-"�O_�*"�O_�s\(P_`F\0P_`E\HP_�XP_y�hP_�|pP_?�!xP_�)"�P_�("�P_�'"�P_�$"�P_�s\�P_`F\�P_`E\Q_F� Q_��0Q_�|8Q_Y�!@Q_`"HQ_`"PQ_`"hQ_`"xQ_�s\�Q_`F\�Q_`E\�Q_��Q_��Q_�|R_t�!R_@"R_@"R_@"0R_@"@R_�s\�R_`F\�R_`E\�R_��R_0��R_�|�R_��!�R_ 
"�R_ "�R_ "�R_ "S_�s\HS_`F\PS_`E\hS_~�xS_G��S_�|�S_��!�S_"�S_"�S_"�S_"�S_�s\T_`F\T_`E\0T_v�@T_t�PT_�|XT_Þ!`T_�!hT_�!pT_�!�T_�!�T_�s\�T_`F\�T_`E\�T_^�U_��U_�| U_ޞ!(U_��!0U_��!8U_��!PU_��!`U_�s\�U_`F\�U_`E\�U_��U_���U_�|�U_��!�U_��!�U_��!V_��!V_��!(V_�s\hV_`F\pV_`E\�V_%��V_���V_�|�V_�!�V_��!�V_��!�V_��!�V_��!�V_�s\0W_`F\8W_`E\PW_@�`W_�pW_�|xW_1�!�W_`�!�W_`�!�W_`�!�W_`�!�W_�s\�W_`F\X_`E\X_^�(X_�8X_�|@X_K�!HX_@�!PX_@�!XX_@�!pX_@�!�X_�s\�X_`F\�X_`E\�X_���X_6�Y_�|Y_h�!Y_ �!Y_ �! Y_ �!8Y_ �!HY_�s\�Y_`F\�Y_`E\�Y_���Y_M��Y_�|�Y_��!�Y_�!�Y_�!�Y_�!Z_�!Z_�s\PZ_`F\XZ_`E\pZ_@��Z_e��Z_�|�Z_`�!�Z_`�!�Z_`�!�Z_`�!�Z_�s\[_`F\ [_`3\8[_P�H[_��X[_�|h[_��!p[_��!x[_��!�[_��!�[_�s\�[_`F\�[_`3\\_P�\_�� \_�|(\_��!0\_��!8\_��!@\_��!X\_��!h\_�s\�\_`F\�\_`E\�\_^��\_���\_�|�\_@�!]_@�!]_@�! ]_@�!0]_�s\p]_`F\x]_`3\�]_ͻ�]_5��]_�|�]_��!�]_��!�]_��!�]_��!�]_��!�]_�s\8^_`F\@^_`E\X^_�h^_M�x^_�|�^_`�!�^_`�!�^_`�!�^_`�!�^_�s\__`F\__`3\ __�0__^�@__�|H__ӟ!P__`�!X__`�!`__`�!x__`�!�__�s\�__`F\�__`E\�__^��__��`_�|`_��! `_��!(`_��!@`_��!P`_�s\�`_`F\�`_`3\�`_��`_���`_�|�`_�)"�`_�("�`_�'"a_�$"a_�s\Xa_`F\`a_`3\xa_~��a_���a_�|�a_"�a_"�a_"�a_"�a_�s\ b_`F\(b_`3\@b_ͻPb_��`b_�|pb_��!xb_��!�b_��!�b_��!�b_�s\�b_`F\�b_`3\c_�c_��(c_�|8c_��!@c_��!Hc_��!`c_��!pc_�s\�c_`F\�c_`3\�c_$��c_��c_�|d_�T"d_�S"d_�R"(d_�O"8d_�s\xd_`F\�d_`3\�d_��d_��d_�|�d_ 
"�d_ "�d_ "�d_ "e_�s\@e_`F\He_`3\`e_F�pe_#��e_�|�e_`"�e_`"�e_`"�e_`"�e_�s\f_`F\f_`3\(f_V�8f_4�Hf_�|Xf_ B"`f_ A"hf_ @"�f_ ="�f_�s\�f_`F\�f_`3\�f_%�g_B�g_�| g_��!(g_��!0g_��!Hg_��!Xg_�s\�g_`F\�g_`3\�g_��g_T��g_�|�g_<"�g_;"�g_:"h_7" h_�s\`h_`F\hh_`3\�h_��h_d��h_�|�h_@"�h_@"�h_@"�h_@"�h_�s\(i_`F\0i_`3\Hi_�Xi_t�hi_�|xi_�5"�i_�4"�i_�3"�i_�0"�i_�s\�i_`F\�i_`3\j_v� j_��0j_�|@j_�!Hj_�!Pj_�!hj_�!xj_�s\�j_`F\�j_`3\�j_���j_���j_�|k_�!k_�!k_�!0k_�!@k_�s\�k_`F\�k_`3\�k_9��k_���k_�|�k_`N"�k_`M"�k_`L"�k_`I"l_�s\Hl_`F\Pl_`3\hl_��xl_���l_�|�l_ �!�l_ �!�l_ �!�l_ �!�l_�s\m_`F\m_`3\0m_��@m_��Pm_�|`m_�/"hm_�."pm_�-"�m_�*"�m_�s\�m_`F\�m_`3\�m_:�n_d�n_�| n_�!(n_@�!0n_@�!8n_@�!Pn_@�!`n_�s\�n_`F\�n_`E\�n_:��n_}��n_�|�n_@�!�n_@�!o_@�!o_@�!(o_�s\ho_`F\po_`3\�o_�s\0p_`F\8p_�E\P�_!�#`�_�p�_�|��_ �#��_ �#��_ �#��_�[��_�=\�_�>\0�_!�#@�_�P�_�|`�_ �#h�_ �#p�_ �#x�_ �#��_�[ح_�=\�_`?\�_!�# �_S�0�_�|@�_ �#H�_ �#P�_ �#x�_�[��_�=\��_�?\�_!�#�_U��_�| �_ �#(�_ �#0�_ �#8�_ �#X�_�[��_�=\��_`@\д_@�_ش_@�_�_@�_��_@|_�_@p_��_� &��_���_�|�_�&�_�&�_�&8�_�[x�_�@\��_�A\��_� &��__���_�|��_�&��_�&��_�&��_��_�_�[X�_�@\`�_`B\��_� &��_^���_�|��_�&��_�&��_�&��_�[8�_�@\@�_�B\p�_� &��_����_�|��_�&��_�&��_�&��_��_��_�[�_�@\ �_`C\P�_��_X�_��_p�_��_x�_��_P�_!/&`�_��p�_�|��_ .&��_ -&��_ ,&��_ )&��_�s\��_`D\�_`3\0�_!/&@�_��P�_�|`�_ .&h�_ -&p�_ ,&��_ )&��_�s\�_`D\�_�3\�_!/& �_+�0�_�|@�_ .&H�_ -&P�_ ,&X�_ #&h�_ )&x�_�s\��_`D\��_�C\�_!/&�_3��_�| �_ .&(�_ -&0�_ ,&8�_ +&H�_ )&X�_�s\��_`D\��_`E\�_!/&�_���_�|�_ .&�_ -&�_ ,&�_ +&(�_ )&8�_�s\x�_`D\��_�E\�(`B*�(`&��(`�|�(`A*�(`@*�(`?*)` �[X)``G\`)``H\�)`B*�)`���)`�|�)`A*�)`@*�)`?*�)`>*�)` �[8*``G\@*`�H\p*`B*�*`f��*`�|�*`A*�*`@*�*`?*�*` �[+``G\ +``I\P+`B*`+`�p+`�|�+`A*�+`@*�+`?*�+`>*�+` �[�+``G\,`�I\(0`�`00`�`80`�`@0`��_P7` \*`7`5�p7`�|�7` 6`�7` 5`�7` 4`�7`�s\�7``J\8``3\08` \*@8`��P8`�|`8` 6`h8` 5`p8` 4`x8` G*�8`�s\�8``J\�8``K\9` \* 9`o�09`�|@9` 6`H9` 5`P9` 4`x9`�s\�9``J\�9`�3\�9` \*:`�:`�| :` 6`(:` 5`0:` 4`8:` G*X:`�s\�:``J\�:`�K\Ћ`S�9�`���`�|��`�| �`�a8�`�s\x�`�e\��``M\��`S�9��`��Ќ`�|،`�|�`�s\X�`�e\`�``M\��`S�9��`V���`�|��`@�*��`�s\8�`�e\@�`�M\p�`S�9��`A���`�|��`�|��`�a؎`�s\�`�e\ �`�M\P�`S�9`�`|�p�`�|x�`�\*��`�a��`�s\��`�e\�`�L\0�`S�9@�`k�P�`�|X�` `*��`�s\ؐ`�e\�`�M\�`S�9 �`Y�0�`�|8�`��*x�`�s\��`�e\��`�M\�`S�9�`&��`�|�``�*X�`�s\��`�e\��`�M\В`S�9�`��`�|��` �*8�`�s\x�`�e\��`�M\��`S�9��`�Г`�|ؓ` �*�`�s\X�`�e\`�`�M\��`S�9��`�^*��`�|��`��*��`�s\8�`�e\@�`�M\p�`S�9��`���`�|��`�*ؕ`�s\�`�e\ �`�M\P�`S�9`�`�p�`�|x�`��*��`�s\��`�e\�`�M\0�`S�9@�`�P�`�|X�`�*��`�s\ؗ`�e\�`�M\�`S�9 �`��0�`�|8�` �*x�`�s\��`�e\��`�M\�`S�9�`���`�|�`��*X�`�s\��`�e\��`�M\Й`S�9�`�^*�`�|��` �*8�`�s\x�`�e\��`�M\��`S�9��`��К`�|ؚ`��*�`�s\X�`�e\`�`�M\��`S�9��`}���`�|��`��*��`�s\8�`�e\@�`�M\p�`S�9��`l���`�|��` �*؜``	\�`�e\ �`�M\P�`S�9`�`[�p�`�|x�`��*��`�s\��`�e\�`�M\0�`S�9@�`J�P�`�|X�`P�*��`�s\؞`�e\�`�M\�`S�9 �`8�0�`�|8�`��*x�`�s\��`�e\��`�M\�`S�9�`(��`�|�` �*X�`�s\��`�e\��`�M\Р`S�9�`��`�|��`�*8�`�s\x�`�e\��`�M\��`S�9��`�С`�|ء``�*�`�s\X�`�e\`�`�M\��`S�9��`���`�|��`�*��`�s\8�`�e\@�`�M\p�`S�9��`߿��`�|��`��*أ`�s\�`�e\ �`�M\P�`S�9`�`οp�`�|x�`�|��`�s\��`�e\�`�M\ �`�M\(�``M\0�`�L\8�``L\P�`M�9`�`\�p�`�|x�`�|��`�a��`�s\��`�_\�``O\0�`M�9@�`E�P�`�|X�`�|��`�s\ئ`�_\�``O\�`M�9 �`��0�`�|8�`@�*x�`�s\��`�_\��`�O\�`M�9�`���`�|�`�|@�`�aX�`�s\��`�_\��`�O\Ш`M�9�`���`�|��`�\* �`�a8�`�s\x�`�_\��`�N\��`M�9��`��Щ`�|ة` `*�`�s\X�`�_\`�`�O\��`M�9��`����`�|��`��*��`�s\8�`�_\@�`�O\p�`M�9��`t���`�|��``�*ث`�s\�`�_\ �`�O\P�`M�9`�`c�p�`�|x�` �*��`�s\��`�_\�`�O\0�`M�9@�`R�P�`�|X�` �*��`�s\ح`�_\�`�O\�`M�9 �`?�0�`�|8�`��*x�`�s\��`�_\��`�O\�`M�9�`,��`�|�`�*X�`�s\��`�_\��`�O\Я`M�9�`��`�|��`��*8�`�s\x�`�_\��`�O\��`M�9��`�а`�|ذ`�*�`�s\X�`�_\`�`�O\��`M�9��`�^*��`�|��` �*��`�s\8�`�_\@�`�O\p�`M�9��`����`�|��`��*ز`�s\�`�_\ �`�O\P�`M�9`�`��p�`�|x�` �*��`�s\��`�_\�`�O\0�`M�9@�`��P�`�|X�`��*��`�s\ش`�_\�`�O\�`M�9 �`��0�`�|8�`��*x�`�s\��`�_\��`�O\�`M�9�`���`�|�` �*X�``	\��`�_\��`�O\ж`M�9�`���`�|��`��*8�`�s\x�`�_\��`�O\��`M�9��`��з`�|ط`P�*�`�s\X�`�_\`�`�O\��`M�9��`����`�|��`��*��`�s\8�`�_\@�`�O\p�`M�9��`t���`�|��` �*ع`�s\�`�_\ �`�O\P�`M�9`�`a�p�`�|x�`�*��`�s\��`�_\�`�O\0�`M�9@�`O�P�`�|X�``�*��`�s\ػ`�_\�`�O\�`M�9 �`>�0�`�|8�`�*x�`�s\��`�_\��`�O\�`M�9�`+��`�|�`��*X�`�s\��`�_\��`�O\н`M�9�`��`�|��`�|8�`�s\x�`�_\��`�O\��`�O\��``O\��`�N\��``N\о`@�9�`���`�|��`�|�`�:` �`�a8�`�s\x�`�k\��``S\��`@�9��`��п`�|ؿ`�|�`�:`�`�s\X�`�k\`�``S\��`@�9��`b���`�|��`@�*��`�:`��`�s\8�`�k\@�`�S\p�`@�9��`K���`�|��`�|��`�:`��`�a�`�s\�`�k\ �`�S\P�`@�9`�`$�p�`�|x�`�\*��`�:`��`�a��`�s\��`�k\�`�R\0�`@�9@�`�P�`�|X�` `*`�`�:`��`�s\��`�k\��`�S\�`@�9 �`��0�`�|8�`��*@�`�:`x�`�s\��`�k\��`�S\��`@�9�`.��`�|�``�* �`�:`X�`�s\��`�k\��`�S\��`@�9��`���`�|��` �*�`�:`8�`�s\x�`�k\��`�S\��`@�9��`���`�|��` �*��`�:`�`�s\X�`�k\`�`�S\��`@�9��`����`�|��`��*��`�:`��`�s\8�`�k\@�`�S\p�`@�9��`����`�|��`�*��`�:`��`�s\�`�k\ �`�S\P�`@�9`�`��p�`�|x�`��*��`�:`��`�s\��`�k\�`�S\0�`@�9@�`��P�`�|X�`�*`�`�:`��`�s\��`�k\��`�S\�`@�9 �`��0�`�|8�` �*@�`�:`x�`�s\��`�k\��`�S\��`@�9�`���`�|�`��* �`�:`X�`�s\��`�k\��`�S\��`@�9��`~���`�|��` �*�`�:`8�`�s\x�`�k\��`�S\��`@�9��`l���`�|��`��*��`�:`�`�s\X�`�k\`�`�S\��`@�9��`[���`�|��`��*��`�:`��`�s\8�`�k\@�`�S\p�`@�9��`H���`�|��` �*��`�:`��``	\�`�k\ �`�S\P�`@�9`�`5�p�`�|x�`��*��`�:`��`�s\��`�k\�`�S\0�`@�9@�`"�P�`�|X�`P�*`�`�:`��`�s\��`�k\��`�S\�`@�9 �`�0�`�|8�`��*@�`�:`x�`�s\��`�k\��`�S\��`@�9�`���`�|�` �* �`�:`X�`�s\��`�k\��`�S\��`@�9��`����`�|��`�*�`�:`8�`�s\x�`�k\��`�S\��`@�9��`����`�|��``�*��`�:`�`�s\X�`�k\`�`�S\��`@�9��`����`�|��`�*��`�:`��`�s\8�`�k\@�`�S\p�`@�9��`����`�|��`��*��`�:`��`�s\�`�k\ �`�S\P�`@�9`�`��p�`�|x�`�|��`�:`��`�s\��`�k\�`�S\ �`�Q\(�``Q\0�`�P\8�``P\@�`�S\H�``S\P�`�R\X�``R\p�``�9��`����`�|��`�|��`�:`��`�a��`�s\�``p\ �``W\P�``�9`�`w�p�`�|x�`�|��`�:`��`�s\��``p\�``W\0�``�9@�`R�P�`�|X�`@�*`�`�:`��`�s\��``p\��`�W\�``�9 �`��0�`�|8�`�\*@�`�:``�`�ax�`�s\��``p\��`�V\��``�9�`;��`�|�`�| �`�:`@�`�aX�`�s\��``p\��`�W\��``�9��`����`�|��` `*�`�:`8�`�s\x�``p\��`�W\��``�9��`h���`�|��`��*��`�:`�`�s\X�``p\`�`�W\��``�9��`�^*��`�|��``�*��`�:`��`�s\8�``p\@�`�W\p�``�9��`(���`�|��` �*��`�:`��`�s\�``p\ �`�W\P�``�9`�`�p�`�|x�` �*��`�:`��`�s\��``p\�`�W\0�``�9@�`�P�`�|X�`��*`�`�:`��`�s\��``p\��`�W\�``�9 �`��0�`�|8�`�*@�`�:`x�`�s\��``p\��`�W\��``�9�`���`�|�`��* �`�:`X�`�s\��``p\��`�W\��``�9��`����`�|��`�*�`�:`8�`�s\x�``p\��`�W\��``�9��`����`�|��` �*��`�:`�`�s\X�``p\`�`�W\��``�9��`����`�|��`��*��`�:`��`�s\8�``p\@�`�W\p�``�9��`����`�|��` �*��`�:`��`�s\�``p\ �`�W\P�``�9`�`y�p�`�|x�`��*��`�:`��`�s\��``p\�`�W\0�``�9@�`h�P�`�|X�`��*`�`�:`��`�s\��``p\��`�W\�``�9 �`U�0�`�|8�` �*@�`�:`x�``	\��``p\��`�W\��``�9�`B��`�|�`��* �`�:`X�`�s\��``p\��`�W\��``�9��`/���`�|��`P�*�`�:`8�`�s\x�``p\��`�W\��``�9��`���`�|��`��*��`�:`�`�s\X�``p\`�`�W\��``�9��`	���`�|��` �*��`�:`��`�s\8�``p\@�`�W\p�``�9��`����`�|��`�*��`�:`��`�s\�``p\ �`�W\P�``�9`�`��p�`�|x�``�*��`�:`��`�s\��``p\�`�W\0�``�9@�`��P�`�|X�`�*`�`�:`��`�s\��``p\��`�W\�``�9 �`��0�`�|8�`��*@�`�:`x�`�s\��``p\��`�W\��``�9�`_*�`�|�`�| �`�:`X�`�s\��``p\��`�W\��`�U\��``U\��`�T\��``T\��`�W\��``W\��`�V\��``V\�`H�9 �`+�0�`�|8�`�|`�`�ax�`�s\��``\\��``Y\��`H�9�`��`�|�`�|X�`�s\��``\\��``Y\��`H�9��`����`�|��`@�*8�`�s\x�``\\��`�Y\��`H�9��`����`�|��`�|�`�a�`�s\X�``\\`�`�Y\��`H�9��`H���`�|��`�\*�`�a��`�s\8�``\\@�`�X\p�`H�9��`8���`�|��` `*�`�s\�``\\ �`�Y\P�`H�9`�`��p�`�|x�`��*��`�s\��``\\�`�Y\0�`H�9@�`_*P�`�|X�``�*��`�s\�``\\�`�Y\�`H�9 �`��0�`�|8�` �*x�`�s\��``\\��`�Y\�`H�9�`���`�|�` �*X�`�s\��``\\��`�Y\�`H�9�`���`�|��`��*8�`�s\x�``\\��`�Y\��`H�9��`���`�|�`�*�`�s\X�``\\`�`�Y\��`H�9��`u���`�|��`��*��`�s\8�``\\@�`�Y\p�`H�9��`g���`�|��`�*�`�s\�``\\ �`�Y\P�`H�9`�`V�p�`�|x�` �*��`�s\��``\\�`�Y\0�`H�9@�`G�P�`�|X�`��*��`�s\�``\\�`�Y\aH�9 a4�0a�|8a �*xa�s\�a`\\�a�Y\�aH�9a%�a�|a��*Xa�s\�a`\\�a�Y\�aH�9�a��a�|�a��*8a�s\xa`\\�a�Y\�aH�9�a��a�|�a �*a`	\Xa`\\`a�Y\�aH�9�a���a�|�a��*�a�s\8a`\\@a�Y\paH�9�a��a�|�aP�*�a�s\a`\\ a�Y\PaH�9`a�pa�|xa��*�a�s\�a`\\a�Y\0aH�9@a�Pa�|Xa �*�a�s\�a`\\�a�Y\aH�9 a��0a�|8a�*xa�s\�a`\\�a�Y\�aH�9a��a�|a`�*Xa�s\�a`\\�a�Y\�aH�9�a���a�|�a�*8	a�s\x	a`\\�	a�Y\�	aH�9�	az��	a�|�	a��*
a�s\X
a`\\`
a�Y\�
aH�9�
aj��
a�|�
a�|�
a�s\8a`\\@a�Y\`a�Y\ha`Y\pa�X\xa`X\�a�[\�a`[\�a�Z\�a`Z\�a��,�a`�a�a��*�a`
a�a��,�a`�a�a@<`�a��*�a`
a�a�;``
a��,h
a��,p
a��,x
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a��,�
a�z,�
a�t,a�j,a�d, a�^,(a�V,0a�N,8a�H,@a�B,Ha�:,Pa�2,Xa�(,`a�,ha�,pa�,�a�,�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+�a��+8a��+@a��+Ha�n+Pa�f+Xa�b+ha�\+xa�V+�a�P+�a�J+�a�D+�a�>+�a�8+�a�2+�a�,+�a�&+�a� +�a�+�a�+�a�+�a�
+�a�+`}a��*h}a��*`�a��/h�a��/p�a��/x�a��/��a��/��a��/��a��/��a��/��a��/��a�}/��a�w/��a�q/��a�k/ȕa�e/Еa�_/ؕa�Y/�a�Q/�a�M/�a�G/��a�A/�a�=/�a�9/�a�3/�a�-/ �a�'/(�a�/0�a�/8�a�/@�a�/H�a�/P�a��.X�a��.`�a��.h�a��.p�a��.x�a��.��a��.��a��.��a��.��a��.��a��.��a��.��a��.��a��.��a��.Ȗa��.Жa��.ؖa��.�a��.�a�.�a�o.��a�].ȗa�W.`�a�S.h�a�O.p�a�K.x�a�G.��a�A.��a�=.��a�7.��a�1.��a�+.��a�%.��a�.��a�.�a�.(�a�
.0�a�.8�a��-@�a��-H�a��-P�a��-X�a��-`�a��-h�a��-p�a��-x�a��-��a��-��a��-��a��-��a��-��a��-��a��-Нa��-�a��-`�a��-h�a��-p�a��-x�a�-��a�y-�a�u-�a�q-�a�m-��a�i-�a�c-�a�]-�a�W-�a�Q-��a�K-�a�E-�a�?-�a�9-�a�3-�a�--�a�%-�a�- �a�-(�a�-0�a�	-`b�-hb��,hb��/pb@\PbH�9`bF�pb�|�bK1�bJ1�bI1�b�s\�b`\\b`]\0bH�9@b��Pb�|`bK1hbJ1pbI1xbI1�b�s\�b`\\�b�]\ bH�9  bz�0 b�|@ bK1H bJ1P bI1x b�s\� b`\\� b`^\� bH�9!b�!b�| !bK1(!bJ10!bI18!bI1X!b�s\�!b`\\�!b�^\�!bH�9�!b���!b�|"bK1"bJ1"bI1"bI18"b�s\x"b`\\�"b`_\�"bM�9�"b���"b�H1#b�s\X#b�_\`#b�`\�#bM�9�#bv��#b�H1�#b�s\8$b�_\@$b`a\p$bM�9�$bS��$b�H1�$b�s\%b�_\ %b�a\P%bM�9`%b<�p%b�H1�%b�s\�%b�_\&b`b\0&bL1@&b��P&b�H1�&b�s\�&b�b\�&b�c\'bL1 'b�0'b�H1x'b�s\�'b�b\�'b`d\�'bL1(b�H1(b�H1X(b�s\�(b�b\�(b�d\�(bL1�(b�H1�(b�H18)b�s\x)b�b\�)b`e\�)bS�9�)b��)b�H1*b�s\X*b�e\`*b�f\�*bS�9�*b���*b�H1�*b�s\8+b�e\@+b`g\p+bS�9�+b��+b�H1�+b�s\,b�e\ ,b�g\P,bS�9`,b��p,b�H1�,b�s\�,b�e\-b`h\0�b�P9@�bU�P�b�|`�b�O9h�b�N9p�b�M9��b@	\ؙb�h\�b�i\�b�P9 �b��0�b�|@�b�O9H�b�N9P�b�M9X�b�L9x�b@	\��b�h\��b`j\�b�P9�b���b�| �b�O9(�b�N90�b�M9X�b@	\��b�h\��b�j\Лb�P9�bܹ�b�|�b�O9�b�N9�b�M9�b�L98�b@	\x�b�h\��b`k\��b �b��b �bСb ubءb ibЩb ]bةb Qb�b Eb�b 9b��b -b�_d@�9�_d�9�_d�9`d��b`d��b`d��b8`d�s\x`d�k\�`d�l\�`d@�9�`du��`d�9�`d��b�`d��b�`d��b�`d��bad�s\Xad�k\`ad`m\�ad@�9�ad���ad�9�ad��b�ad��b�ad��b�ad�s\8bd�k\@bd�m\pbd@�9�bd|��bd�9�bd��b�bd��b�bd��b�bd��b�bd�s\cd�k\ cd`n\Pcd��`cd��pcd�|�cd�9�cd�9�cd�9�cd�9�cd�s\�cd�n\dd�o\0dd`�9@dd��Pdd�|`dd�9hdd�9pdd�9�dd�s\�dd`p\�dd`q\ed`�9 ed��0ed�|@ed�9Hed�9Ped�9Xed�9xed�s\�ed`p\�ed�q\�ed`�9fd4�fd�| fd�9(fd�90fd�9Xfd�s\�fd`p\�fd`r\�fd`�9�fd|��fd�|gd�9gd�9gd�9gd�98gd�s\xgd`p\�gd�r\�gd`�9�gd��gd�|�gd�9�gd�9�gd�9�gd�9hd�s\Xhd`p\`hd`s\�hd�d�hd��c�hd��c�hd��c�hd��c�hd��cpid��cxid��c�id��c�id��cxpd��c�pd�d�pd��c�pd��c�pd��c�pd��c�pd��cpqd��cxqd��c�qd��c�qd��cxxd��c�xd�{c�xd�oc�xd�cc�xd�Wc�xd�Kc�xd�?cyd�3chyd�'cpyd�cxyd�c�yd�c�yd��b�yd��b�yd��b�}d��b�}d��bx�d��b��d��b�e��c�e��c�e��c�e��c�e��c�e��cpe��cxe��c�e��c�e��cxe��c�e��9�e=��e�|�e �9�e �9�e �9�e �9�e��9�e�\�e�s\8	e`F\@	et\ 
e`	e8
ed	eP
eh	eh
ep	e�
e|	e�
e�	e�
e�	e\(\*X\Wp\��\��\��\��\��\��\��\�0]��;]R�;]�;]�w\ w\(w\0w\8w\@w\Hw\Pw\	Xw\
`w\hw\pw\
xw\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\�w\x\x\ x\!x\" x\#(x\$0x\%8x\&@x\'Hx\(Px\)Xx\*`x\+hx\,px\-xx\.�x\/�x\0�x\1�x\2�x\3�x\4�x\5�x\6�x\7�x\8�x\9�x\:�x\;�x\<�x\=�x\>y\?y\@y\Ay\B y\C(y\D0y\E8y\F@y\GHy\HPy\IXy\J`y\Khy\Lpy\Mxy\N�y\O�y\P�y\Q�y\R�y\S�y\T�y\U�y\V�y\X�y\Y�y\Z�y\[�y\\�y\]�y\^�y\_z\`z\az\bz\c z\d(z\e0z\f8z\g@z\hHz\iPz\jXz\k`z\lhz\mpz\nxz\o�z\p�z\q�z\r�z\s�z\t�z\u�z\v�z\w�z\x�z\y�z\z�z\{�z\|�z\}�z\~�z\{\�{\�{\�{\� {\�({\�0{\�8{\�@{\�H{\�P{\�X{\�`{\�h{\�p{\�x{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\��{\�|\�|\�|\�|\� |\�(|\�0|\�8|\�@|\�H|\�P|\�X|\�`|\�h|\�p|\�x|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\��|\�}\�}\�}\�}\� }\�(}\�0}\�8}\�@}\�H}\�P}\�X}\�`}\�h}\�p}\�x}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\��}\�~\�~\�~\�~\� ~\�(~\�0~\�8~\�@~\�H~\�P~\�X~\�`~\�h~\�p~\�x~\��~\��~\��~\��~\��~\��~\��~\��~\�~\�~\�~\�~\�~\�~\�~\��H��H�qjVH��t��H����5�aV�%�aV@�%�aVh����%zaVh�����%raVh����%jaVh����%baVh����%ZaVh����%RaVh����%JaVh�p����%BaVh�`����%:aVh	�P����%2aVh
�@����%*aVh�0����%"aVh� ����%aVh
�����%aVh�����%
aVh���%aVh����%�`Vh�����%�`Vh����%�`Vh����%�`Vh����%�`Vh����%�`Vh����%�`Vh�p����%�`Vh�`����%�`Vh�P����%�`Vh�@����%�`Vh�0����%�`Vh� ����%�`Vh�����%�`Vh�����%�`Vh���%�`Vh ����%z`Vh!�����%r`Vh"����%j`Vh#����%b`Vh$����%Z`Vh%����%R`Vh&����%J`Vh'�p����%B`Vh(�`����%:`Vh)�P����%2`Vh*�@����%*`Vh+�0����%"`Vh,� ����%`Vh-�����%`Vh.�����%
`Vh/���%`Vh0����%�_Vh1�����%�_Vh2����%�_Vh3����%�_Vh4����%�_Vh5����%�_Vh6����%�_Vh7�p����%�_Vh8�`����%�_Vh9�P����%�_Vh:�@����%�_Vh;�0����%�_Vh<� ����%�_Vh=�����%�_Vh>�����%�_Vh?���%�_Vh@����%z_VhA�����%r_VhB����%j_VhC����%b_VhD����%Z_VhE����%R_VhF����%J_VhG�p����%B_VhH�`����%:_VhI�P����%2_VhJ�@����%*_VhK�0����%"_VhL� ����%_VhM�����%_VhN�����%
_VhO���%_VhP����%�^VhQ�����%�^VhR����%�^VhS����%�^VhT����%�^VhU����%�^VhV����%�^VhW�p����%�^VhX�`����%�^VhY�P����%�^VhZ�@����%�^Vh[�0����%�^Vh\� ����%�^Vh]�����%�^Vh^�����%�^Vh_���%�^Vh`����%z^Vha�����%r^Vhb����%j^Vhc����%b^Vhd����%Z^Vhe����%R^Vhf����%J^Vhg�p����%B^Vhh�`����%:^Vhi�P����%2^Vhj�@����%*^Vhk�0����%"^Vhl� ����%^Vhm�����%^Vhn�����%
^Vho���%^Vhp����%�]Vhq�����%�]Vhr����%�]Vhs����%�]Vht����%�]Vhu����%�]Vhv����%�]Vhw�p����%�]Vhx�`����%�]Vhy�P����%�]Vhz�@����%�]Vh{�0����%�]Vh|� ����%�]Vh}�����%�]Vh~�����%�]Vh���%�]Vh�����%z]Vh������%r]Vh�����%j]Vh�����%b]Vh�����%Z]Vh�����%R]Vh�����%J]Vh��p����%B]Vh��`����%:]Vh��P����%2]Vh��@����%*]Vh��0����%"]Vh�� ����%]Vh������%]Vh������%
]Vh����%]Vh�����%�\Vh������%�\Vh�����%�\Vh�����%�\Vh�����%�\Vh�����%�\Vh�����%�\Vh��p����%�\Vh��`����%�\Vh��P����%�\Vh��@����%�\Vh��0����%�\Vh�� ����%�\Vh������%�\Vh������%�\Vh����%�\Vh�����%z\Vh������%r\Vh�����%j\Vh�����%b\Vh�����%Z\Vh�����%R\Vh�����%J\Vh��p����%B\Vh��`����%:\Vh��P����%2\Vh��@����%*\Vh��0����%"\Vh�� ����%\Vh������%\Vh������%
\Vh����%\Vh����%�[Vh����%�[Vh���%�[Vh���%�[Vh���%�[Vh���%�[Vh���%�[Vh��p�%�[Vh��`�%�[Vh��P�%�[Vh��@�%�[Vh��0�%�[Vh�� �%�[Vh���%�[Vh���%�[Vh����%�[Vh����%z[Vh����%r[Vh���%j[Vh���%b[Vh���%Z[Vh���%R[Vh���%J[Vh��p�%B[Vh��`�%:[Vh��P�%2[Vh��@�%*[Vh��0�%"[Vh�� �%[Vh���%[Vh���%
[Vh����%[Vh����%�ZVh����%�ZVh���%�ZVh���%�ZVh���%�ZVh���%�ZVh���%�ZVh��p�%�ZVh��`�%�ZVh��P�%�ZVh��@�%�ZVh��0�%�ZVh�� �%�ZVh���%�ZVh���%�ZVh����%�ZVh����%zZVh����%rZVh���%jZVh���%bZVh���%ZZVh���%RZVh���%JZVh��p�%BZVh��`�%:ZVh��P�%2ZVh��@�%*ZVh��0�%"ZVh�� �%ZVh���%ZVh���%
ZVh����%ZVh����%�YVh����%�YVh���%�YVh���%�YVh���%�YVh���%�YVh���%�YVh��p�%�YVh��`�%�YVh��P�%�YVh��@�%�YVh��0�}�H�}�t	�E��ZH���%����}�H�}�t	�E��ZH���
�����D���H��0���tƅD����^Z��,���H�����tƅ,����BZH��������l���H��X���tƅl����ZH������%�����H�����tƅ�����YH���x���I�$�%H�=��_�lH�5����鹄��L��H��L��������������H�5��H������H���H��L�����M��0H���H��L�������LH�5��H�P�U�y���H�5m�L���<�X���H�5T�H���#����+H�5;�L���
����UH��A��1�H��AUATSH��H��8L�-�WH�w(H�}�I�E���H��I�������M��tI�E��L���H��8��[A\A]]ú0H�5.�H�������w�wH�5�L���t����yUH��A�кH��AUATSH��H��8L�-&WH�w(H�}�I�E���H��I������M��tI�E��L���H��8��[A\A]]�UH��A��1�H��AUATSH��H��8L�-�WH�w8H�}�I�E���H��I��������M��tI�E��L���H��8��[A\A]]�UH��A�кH��AUATSH��H��8L�-eWH�w8H�}�I�E���H��I�������M��tI�E��L���H��8��[A\A]]�UH��A�кH��AUATSH��H��8L�-WH�w8H�}�I�E���H��I���F��M��tI�E��L���H��8��[A\A]]�UH��A�кH��AUATSH��H��8L�-�WH�w8H�}�I�E���H��I���4��M��tI�E��L���H��8��[A\A]]�UH��A��1�H��AUATSH��H��8L�-BWH�whH�}�I�E���H��I���%|��M��tI�E��L���H��8��[A\A]]�UH��A�кH��AUATSH��H��8L�-�WH�whH�}�I�E���H��I����{��M��tI�E��L���H��8��[A\A]]�UI��A��1�H��AVI��AUATSH��H��@L�-|WH�V(H�w0H�}�I�E���H��L��I�������M��tI�E��L���H��@��[A\A]A^]�UE��I�ȹH��AWI��AVI��AUATSH��H��HL�-WH�V(H�w0H�}�I�E���H��L��L��I�������M��tI�E��L���H��H��[A\A]A^A_]ú�H�5m�H�������CwA��H�
S�L��H���U�����>�w��n�vw�HwH�%UH��AVAUATSH��0������H������H�dH�%(H�E�1�H�p�_H��pGH�=yV���
�xVH�yV1Ҁ�-u��H��(�x�-t
��H�xu����SVH��xV1Ҁ�Cu��H��(�x�Ct
��H�xu����SVH��xV1Ҁ�du�H��(�x�dt
��H�xu��H��SVH�=^R�}SVH���^��H�5;RH��tH�=9R��H��1���"U1��H��H���^�UL�%��_H�=R���^H�=�^�ut���^A�$�"�^��^stdof��^��^��H��t	�8��1��������*�A�^��^�R�^H��QV���^H�;���������������H�3w_H������H������H�5�vVH�=�T��E���t21������G1��Z�H��H�=P�^���^����H���H������������H���^�����H������H�=�PI����H��t�H��1��SH��^H�=�P���H���\H��H�=��^�{�H�5��^H�=��^�h�I�EL�����H�
V7H�����H��QVL��H�H���^I�EH�H���^�"����I�EH���^H�I�EH���^H��=��^t\H�D�^H�P��BQVH��H�'�^H�����^�H��H�ƹ��{�^�QV��PV�W�^�������u0H�=��^�N�^�PH������1�H�0�gRH���^�=�^t1�谦H���^�=��^t
���^�=��^t
���^�=��^t
�
`PV�=��^t
�
MPV �=��^�|�^tH�=��^��=f�^H�?tVH�5X�^�#��to1����1�I�����1������L���H���0H�=y�^輢1��E����H�;������������������^�����H�=\�^A�$����uH�D�^ƀ��H�=	�^�tE1�1�1��@H�5��^��D���^H�
F�^H�G�^H�5H�^H�=I�^�E���;�=u�^u���^�=s�^��H�5�,��~�H�5�)��m�H�5���\�H��MVH�8��L��T��1��L���u�����f��t
H�qNVf��=��^��H�>aWH�
K�H�=EMH��x�H�}_�H�5�JH���H���_H�
H�XH�5aH�=MH�H���_H����5Z�=n�^u���^
u�^
n�^A����H�5I+H�������H������=�=(�^��@��茝�=)�^���^��1��(H�=3�^���^�p�1���B�=��^�~�H�w�^H�5>L��uMVH������� MV�������MV�������1�����1��G���1��p��������'���H�&LV�@H�0��H�R�^H������1�1�H�=>)�����X�^�
�^�'H�=��^1���'�^H���^���H�=T)��<��H�=+�^I����H�=�^I���d�5B�^M��M��H�=)�^H��1�H�M)��H�=�^�t<H�=�h<���H�=K�7�H����H�=�J�"��1�H���MH���^L�%��^M�������H�5�JL���]���uH���^����A�<$�����=��^�6L��H���ud1�H�ٺH�=|�^�1�H��H��H�p��IH�Z�^H���'L�R�^H��H�
�JH�ھ1�����\���H�='��P�H���;���H�=�I���7�L��H��D���1�H��H��H�p�VIH���^H��t,H�=՟��H�=��^L��H�
�II���1��N�L�����H�5��^1�L����]�������H�5�IL�����������H�=x�^�KJH�h�^����H�;L��H�5I1���L�%H�^���1��T��J�H��IV�,�H�=b'H������ �U1�H�V4UH�5��^H���^H���^H��ATL�%M�WSH���L�%��^H��f���^���^��1�H��H�5Y�^f�n�^H��3UL�%D�^H�A�^H�>�^�<�^��L�%��^1�H��H��3U[A\H���^H�5��^]H���^���^f�
��^�u�D��1�I��^H��H���PTL�FH�
�H�=h��HV�H�=��^H�z�^H9�tH�fHVH��t	�����H�=Q�^H�5J�^H)�H��H��H��?H�H�tH�MHVH��t��fD�����=%�^u+UH�=bGVH��tH�=�2U�9��d������^]������w������t<�F�H�L1�f����Љ��t
%�����1�H��H9�u��f.�1��ff.�f�U���0H��ATI��H��SH��1��!FH�CPH��t8H�sE1�1ɺ 1��3�H�l���D�#�CH�CH[1�A\]���C�[A\]�ff.�@UH��AWAVAUA��ATI���SH��L��H��(H�M��SHE����1�A��3H�CPL�4�H�U�M��tiD��H�E��	M�v M��tWE9>u�E9nu�I�~H�U�L�������u�H�{��E��G�H��t?I�vH�M��U�H�pH�I�FA�F�'DH�S�(H��H�U���I��H��u�H��(��[A\A]A^A_]�DH�U�L�`�D�hD�8H�����I�FH��t�H�M�1�H�I�FH�M�H�@A�FH�CPH��I�F H�CPL�4��ff.��UH��AVI����AUA��ATSH��L���SH1�A��3H�CPH��H��u�6fDH�[ H��t'D9#u�D9ku�H�{L���H���uܸ�D1�[A\A]A^]�ff.�f�UH��AWAVI��AUI����ATA��SH��L��H���SH1�A��3H�CPH��H��tOD��H�E��fDH�[ H��t7D;;u�D;cu�H�{H�U�L���D����u�E�&H��H��[A\A]A^A_]�A�1���ff.�f�UH��AWAVAUATI��H��S��H��8H�uȉ�H�M�A�T$H1�A��A�4$I�D$PL�<�M���
��H�E��DM� M����E;/u�A;_u�L�u�I�H�u�L�������u�A�G�E�I�GH�H�E�H�}�B�<7���D�kD��A�T$H1�A��A�4$I�D$PL�4�M��teD��H�E��
@M�v M��tOE;u�E;nu�I�~H�U�D�U�H�u����D�U���uϋE�A9FrH�}�M��E��D��B�<7u�f.�H�E��H��8L��[A\A]A^A_]��H�E�E1���אU1�H��SH��H��H�����H��u
H��[]�H�{PH��H��1�[]�S��UH��SH��H�����H�{PH��[]�C�>tKUH��AUI��ATI��S1�H��fD�SL��L��L�����H��A�<u�H��[A\A]]�f��f.�D1��ff.�f���^��UH��AWAVAUATSH�������L��fV��I�@@�DtfDH���H��Du�\t:��u�@�D��H�����u�1�H��H��[A\A]A^A_]�fDD�gH�_E��tعI�@@A��DtfDH���I��Du�A�D$�<>��H�!@H����H�����t���������I��A���%f.�� E��uV9�tcA�EI����t%<\u�A�}t�A��`t?A�EI����u��E����L9��������	�������@A8�uE:et���9�u�����E1��N��������I��A��<\t*D� E��t��9�t�A�EI�����w���<\u�A�}uE��tO�\��A�EI����D��t
@H���?u�D�gE���O���H�_1�L��dV�j����I�������H��1��^���fDI��E���,�� E��tD��9�tPA�FM�nM������M��<\u�A�~uE��t��\��f�M�nL��L���AA�F�M��A�E��~����I���(� E��uN9�t�M�~A�FM��M�����C���<\u�A�~t�A��`t-M�~L��L��M����A�F��f�A8�uE:ft�A���ff.�@UI�ɿ�Ѹ��H�5�H��ATS����z�^��9�w0L�%�=V�
I�4$��I�<$����P�^[A\]��)�H�
l;H�5�51���4���f�UH��AWM��AVM��AUI��ATI��SH��H���=)�^H�u��w�=8�^���H���^H���n�5�^����H���^H��t	�:��H�d�^H��t�:uj1�H�߾ �+H�߾!H�
�H��4�yAWH�u�L��5Q�^L��M��H��D�
Q�^�RZYH����H�e�[A\A]A^A_]�D�H����뇐�H����c���fDH�U�^�	H����/����L�
�^L��^H��H�
�^H��^H�5��^�H���^H�߾�IH���^H�߾�5H���^�]H���!���@H���^���s���f�UH��H��H�)<VH�8�i��H�U��T��1������u�E�f��t
H��<Vf���ff.�U� �H���ݐ1�]�f�UH��ATA��SH���:af/����Haf/����>af/�s`E��t+H����H�����[H�
:3A\]����fD�D,�H���1�[H�
3A\H�����]���f�f(��%�`�-�`�^�f(�fT�f.��f��`f/���H,�H���f���H*��YѺ
H��H���\��E����
� �E�� minH�xf�P����f(��%T`�-`�^�f(�fT�f.��F�`f/���H,�H���f���H*��Y�H���
H���\��E��P�
H��H��1H�5�1HF�H���B���E�H���g���Df(��%�_�-t_�^�f(�fT�f.����f_f/�s`�H,�H��xif���H*��Y�H���
H���\��E���
H��H�D1H�561HF�H������E�H�����D�\��H,�H��?H��y�H��H��f��H���H	��H*��X����H,�f���5�^fU��H*�f(����f(�fT��\�fV���^f/������fD�\��H,�H��?H�����H��H��f��H���H	��H*��X�������H,�f���5^fU��H*�f(����f(�fT��\�fV���]f/��{����b���fD�\��H,�H��?H�����H��H��f��H���H	��H*��X�������H,�f���5�]fU��H*�f(����f(�fT��\�fV��m]f/��c������fD�=�^t�fDUH��SH��H�=��^�;8H�5p/H�=
�^H�z�^�M?��t	H��[]�f�H�=��^��H��H��t�H���D�H��tH�0H��t�1���9H�,�^H��H��[]�"fDUH���VL�
�.L��.H�5{H��ATA���SH��e_H���0H��.PH��.PH�y�VH�H�1�����H�� E��tH�e�[A\]�f�H�=Q���H��1�H�5����H�5�[VH�=|9諌H�=�3�o��H�=h7V�H�e�H�=X7V[A\]�"ff.�@�=y�^u�=��^uH�5��+f�1��ff.�f�UH��AVAUATSH������H��������^�����]�^L�%��^���^��tFH�
��^�x�1�H�H��t��H��H��H�����pH9�u�5q�^L�%r�^M����L�5j�^L��E�nL�#L��� ��A9���H�[H�<�^H��u�I�F H�4�^H����L�`L�%�^M��tcH��t�H��H��[A\A]A^]�fD��^L�%��^���q���M��t3I�<$����H��I�D$H���^H��H��[A\A]A^]�fDH��u�H��1�H��[A\A]A^]�f�L���x��L�cH��L�%z�^M���^���I�F H�n�^H���:����O�^�=��^�P�@�^9�sCH�5�^H��H�����PH��H���@H�
�pH��H������9�u�=��^L�%��^����DH��H�M�H�=r�^���+�H��H���^H������L�`L�%��^M������������5��^L�bH���^L�%��^�����z�^L�aH�
�^L�%p�^�S���ff.�UH�=��^H��ATS�3H�=��^��3H�5^+H�=��^�;��t
[A\]�DH�=��^���H��H��t�H�����1�H�0I���5I�<$H�5+H�H�^�+���1�H���l5H��H�"�^��H��[A\]�A�H���^H��t�UH�5�H�=!�^H��AUATSH���`:��t\H�e�^H��tH��[A\A]]�DH�=��^�D��1�H����4H�.�^H��u�H��H��/[A\A]]��H�=��^���H��H��t�H����I��H��tsH�8tmH�=�^���H�����I�<$I������1�I�t�1H���^H��t0H�=B�^��H�=��^H������� f�I�4$H�x�)��H�������ff.��UH��AWAVAUATSH��H��H�EVVH�P@��Dt�H����Du�=?�^uH�5V)H���j��H���H�5�1VH���R��H��t4L�=f�YE1�H��A�	H�
cV�	I���L���P����H�5�(H���*H���YH��UVI���I)�H�r@D��H��DtH���H��Du�����=��^�%H�=VVE��t]H��UVL�=��YE1�H�E�I��DI���E1�M��L��I�$H��L���P��uI�$B�<(� I��(A��I�|$u�H��1�[A\A]A^A_]���=��^��L�%dUVH�=lUVL�e�t�E��E1�L�=)�Y��I��(A��I�|$t�I���E1�M��L��I�$H��L���P��u�I�$B�<(u�A�|$t�1�H����H��t��kH��� ���=]�^��tu���<���H�=��YE1�H��A�	H�
�T�	H����P������D�5�/VE�������H��TVH�E�H�}�Mc�H��K��[A\H��A]A^A_]�f�H�=hTVA���b������f.�UH��AWAVAUATSH��8L�gM���OD�o�H��L���NC�<,�CH��rWH�E�H�E�H�E�1��E�f�E�A�$����L�u�E1�A�I�FH�E��J���
�O� E��D؋E��P;E����U�H�U��A�\$A��I�����}��'�~���\���E��X;E��"H�U��]��\I�t$A�\$E�����C�<:��H�!H�����L���/�A�\$I����u��H�}�A���R�}�t	�E���-H��8[A\A]A^A_]�@;CsC�,L�c���DI�uH�{�{���u	H�CB�(L�c���D��`t(�L��L��蛵A�\$I�����@��"u�E��tD8�DD���I�������A����uȁ��w
��6��u�H�}�H����������H�E���E��P�U�H�U��\������H�E��E�=�w
����E�H�}��u�Hu�薪���+���H�E�H�M���E��P�
�����H�}����I���
���H������f�UH��SH��H���=�^u�CH��1�[]������CH��1�[]�UH�=�#H��AWI�׺
AVA���AUATI��SIc�H��L�-#+VI�M���I�uL���f��I�u� �x��A��tBH�C+V�s�L��H����H��t A�<$uQH��L��[A\A]A^A_]��A�$��H�=^(��L��H��H��I���C�
A�D�L���+�L����
�x�
u��@��ff.��UH��ATSH��H���H��P���H��X���L��`���L��h�����t#)�p���)M�)U�)]�)e�)m�)u�)}�H�EL��(���H�ھH��0���L��H��@���Dž(���Dž,���0H��8��������=u�^uH���[A\]�H�EL��H�ھH�=��^H��0���H��@���Dž(���Dž,���0H��8����l���H���[A\]�H�a)VH��H�5�!H�81����DUH��� H��SH������H�=c�^��^H���*H��t<H�s�1���+H�5�!H�.�^H��H��(VH�81��z���H��1�[]ÐH�5q�^�1��+H�^�^H�5G�
H���^H��(VH�81��7���H��1�[]�ff.�U�=,�^H��u#H�t(VH�5*!H�81����1�]��H�=i�^1������^H�P�^�ff.��utUH�5� f�P�^H�
(V�;�^stdoH�8H��1��2�^�6)VH�=�^�y���1�]�DUH��SH��dH�%(H�E�1�H��LVH�X@��DtH����Du� �(���H��u�fDH����Du�H������H��H�����
H9��H��LVH�J@�P��D(u�Rf��P��D(tEH��H9�u�ƅ��H�=��i��f�1�H�u�dH34%(�,H��[]Ð�=��^�����H���.�H������H��H�=�^H���^��
H��&VH��H�5�H�81������,�^�s������^�����=�^H���^����H��H�K&VH�5<�
H�81������-���������=��^�G���H�=0�^1��I����^H��^�"���f�H��%VH��H�5tH�81��u�������H�=��
�$���������f.�UH��SH��H������=L�^uH��[]��H�5��^H��H��[]����UH��ATI��SH�����H�޿
�����=��^u[A\]�H�5Y�^L�����H�5J�^[�
A\]���ff.��UH��AUI��ATSH��H�%V�=��^L�#tM�=n�^w�=��^u$H��1�[A\A]]�fDL���P����=w�^t�L���o��H��1�[A\A]]�f��
�^��u���^L���uA�D�����^��tr���^��uXL��L��������^���s���1�����g����H�
�!H�5N1�辺��H�;���^��� �~����@1�H�Uܾ�Ȼ����^���������^�f���f.�U�H��S���H��������w��H�=��^���=4�^u�L�^
;�^
4�^��H�=
�^�=�H�=F�^�A�1�H�=8�^�����xH�=fH�gHD��(����=M�^���= �^H�!�^H��^��^�T�=�^H��^H��^��^�H�=
�^H���^H���^���^�#H�=�^�#H�=�^�#H�=��^�#H�=��^�u#H�=�^�i#H�=�^�]#H�=��^�Q#H�=�^�E#H�=�^�9#H�=ڿ^�-#H�=f�^�!#���^��~-H���^�����^H�H�<���"�n�^����H�=��^�u�=J�^�M�=G�^����H�=��^���^�"����H�=��^���^�"���H�=��^���^�"�O���H���^H�����:����=�^u1H�=q�^��=������H�5e�^H�=V�^��3���H�(!VH�5CH�81�����ff.�f�UH��AUA��ATSH��8L�%� VdH�%(H�E�1��=~�^I�<$�iH�5LA31��[���1��$�H�
��^H���^E1�H�5��^L�JH��H�����������^���۾^���bH�=C�^L�m�����=��^�(L��I��L���H��H�
�LE�1�������^����L��
H����������!�%����t�H������D�H�JHDщ�@�L��H��L)��/H����=(�^H���I�<$H�51��A����=;�^u(H�E�dH3%(��H��8[A\A]]�f.��	�^���H�5�����Ox1�H�=���^��f.�I�<$L��H�p1�H�5��
������H�=�^�H=O�������N�^�w����I�<$H�551��n��(���f�I�<$H�H�5��
�I�D���?�^����赼��DUH��AWAVI��AUI��ATA��SH��H��V�=�^H���H������H�ٺ�H�=��>��E��uiH�
��^H��t
�=yV��L��H���H��1���w���H��迼���=��^�T�=��^��H�������[A\A]A^A_]ÐM����M��D��H�pH�߾1������m���fD��^���2L�=�VI�?�C����
��^�����=�^�����^����E����M���L��D��H�5�H��1����H�
��^H��tE�=qVt<H���H��1��v���H�
��^H��tH���H��1��T���@H��H�=��!���H��L���V������^�����=o�^���=f�^�����H���[A\A]A^A_]�f.�H��H��1��ڿ��H�
�^H���:���H���H��1�贿�������H�����F���D��H��H��1����������f.�H��踺���H���1��Y����,���@1�H�U̾蠳����^������=j�^����^�B���I�7��m����Ͽ^���5�������E���+���H��H�=����7����H�
H�5k�1��ֱ�����^����D��H�5�H��1�������UH��ATSH��dH�%(H�E�1�H�,@VH�X@��DtfDH����Du� �`���H��u�f�H��t��Du��ulL�%�V�==�^I�$��H�5��^H�=��^�a���1�H���^H����VH�5���1�H�u�dH34%(�H��[A\]Ð�=˷^��H������H��H����
H9�v3H�@?VH�J@�P��D(u���P��D(t	H��H9�u��H��H�=�^貶��H��H�=��^裶��H��VH��3���@1�H�5'�
H���/��ut��Vf���^I�$���^stdoH���^1����^�	���f�1�1�H�=�
�������V���fD�=ɶ^uH�������1��D�G��#=��UH�
�4H��SH��H��Hc�H����t$H�=��^1����{�^H�ܭ^@1�H��[]��H�=��
���1����H���VH90���\H������H���z1�1�H�=?�
����1��fD�������^�f���^1��l���f���^1��\���f�H�Y�V���^H92���������H���O�H���Y��H��H�=�^H��^�;�
H��VH��H�5�H�81��@��M�^1�����f�H���VH90t"��VH��t	�>���=�^�c��V1����@�H�=��^H���^��
H���^H�1��q����H�i�VH90�����^1��L���f�H�I�VH90���m�^1��,���f�H�)�VH90�����^1��z�^����H��VH90�@H���W�J�^1�������-�^1�����f�H�=�^�f�

�^H���H���l�H��H��^�����f.�H�=��
蔸��1��w���D����e����=�^�X����ڪ^�K��������=������^�0���fD�+V1�����f��N�^�f�^�^��������0�^1����D��V1�����f��/�^1�����1��������^��������Ҳ^�}�DH�=��^�<1��H����;H�k�^tH��fDH���@�x�8u�;t�C���^1��>���@�H��H�=V�\�
H�5VH��H��
H����������!�%����t�H�=�^�����D�H�JHDщ��H��1�H)��V����@H�H�5v�VH���>�<�^��������薳��fD��^���@���^1��y�����۲^1��d���f.����^1��I���H�58�^H�=1�^�ܰ��1��/���H�=��^1������^H��^�����;f�5�V������H�=�^�K�^��
H�5Ъ^H�=ɬ^�t���1�����H����1����fDH�=��^�\�H�51��9H���^�;���1��f.��=˰^u�=��^uH���F�fD1��D1�1�H�=��
�h��U1�1�A�H��hH��AUATI��SH�����H��H��dH�%(H�E�1�辻���A�T$A�Ņ�u���^���LI�t$�D���61�D����H�=G贱��H���;L��0���E1�H��H��L��1�H�oE��
L���b�������H��0����H���
H��to�1�H���RA��xY��`���A�T$I�|$H9�w��u
�
�A�T$I�t$1�D���i�D��HH�1�A�D$��H����1�H�M�dH3%(��H�ĸ[A\A]]��M��d�1�H������H�
GH������1�1�H�����DH�5!�^�¹D���5���DH�=�
�d���H��
H��HD��������ff.���=��^u_UH�6VH��H��ATSH�P@��Dt�H����Du� �H���H��t+H���ˬ���Ã��t31ۉ�[A\]�1�1�H�==�
���1�1�H�=p
��������������D� D��豨��1�D��H�����f�U��H��SH����H��H��dH�%(H�E�1���
�H�����H�����8H�����\H��肨��H��t51�1�H�=��
�=�1�H�}�dH3<%(��H��[]�fD�H��H�=�V��
H�5�VH��H��
H����������!�%����t�H�=��^�����D�H�JHDщ��H��H)�cV�q���fD1�1�H�=��
���V����>���ff.�UH��ATSH��H�=߭^��H�H��t
[1�A\]�H�=��^���8t�H�=��^�۳H�=��^I���ܲH�=��^���޲L���[H��A\]�
�ff.�f�UH��AUATSH��H��V�=�^L�#u
�
�^��t.�=�^u
H��1�[A\A]]�L������H��1�[A\A]]����^I��L���u8����=�^��ti�K�^��uOL��L�����6�^��t�1��c���닐�H�
�H�5�1��f���H�;�M�^��� �&����@1�H�Uܾ�p������^����������^�o���f�UH��AWAVAUATA��SH��HdH�%(H�E�1�H�=��^tH���^H�=�^H�3V����1�H�=	�^L�-�^荽H�5�2VH��t�L��H��(���H�3H��u�H�5H�=Ϋ^�����H�5H�=��^���t*H�E�dH3%(�
H��H[A\A]A^A_]�DH�=y�^贲H������H����H���H���KL�%L�^�!f.�H�0L���H��H����H������荭H��u�H������1�H���H��蟯H�=��^�pH��謹H�E�^H���>H������1�H�������f.�H��^H�H��H��������I��H���RH�01�H�=��^�t6I��H��t�H���$�H�͝^H�=f�^Lc�G�,$H�A�uH������Hc�H����H������H�H����H���^Mc�L������L������H�J��J��E1�H�������f.�I��H������� �I��H����L�H�������H�
L�������L�1�L��腥��H���^L��H�=��^L�,�K�H�=��^M�I�EH�֜^H�J�4 ���H������I�6H�=X�^M�,H���^L�<��M�I�H���^H�N�<(L���g���L��H�=�^���V��������H�g�^H�=�^H�J�4(������fDL������L�����#���@H�=ɨ^L�-ž^�H��H��u�H�0L���e�H���|H����H��u�H������f�H��踢��H��H�=n�^��������6���H��H�=U�^�p���"���L���C�H�������7�H���^H��y���H��H�=�^�1���p���@���^�������E�������H�	VH�5��
H�81�������@H�=ɧ^��H���L����
���H�=��^�H���3�������H������������Ȧ����=9�^u'�=Q�^uH�=ަ^tU1�H�����1�]�D1��ff.�f�UH��AWAVI��AUI��ATI��SH��H��dH�%(H�E�1��=�^tH�=�^�ڦ^�e�H�=�^�y�H�2�^H��t�H�=Ѧ^��H�M�^L��<���H�����=��^�X�=y�^�+�=o�^��H���V�H�=�H������������H�=\�^���=ܥ^�u
��^��L���%H�=0�^��<����e�M��L��L��D�
uVH��H�=�^A��Mc��|������H�=�^��H�=�^I����H�=ҥ^����L���H���N�H��VH�8菥���=��^�����H�]�dH3%(��H�ĸ[A\A]A^A_]��cAH��H���V���@H�I�^�H�XH���9H��+VH���HH���^�H�=%�^���^�Y��}�^ ���=ţ^u&�=ݤ^uH�=j�^t�=]Vt
��}���1��6���fDL��@���L�
R�^1�L�Q�^L�׺dH�
*�
�L��(����y���L��(����H�=��^L�������f�H��^�H�=]�^�����1ҾH�=B�^�}�����L��1�H�=$�^��<����Y��_���@H�	���oH�=��^�8����L��@���H�پH���
L���º
1�1�L���V����������U� H��AVAUATI��SH�����H��H�� D�-�VdH�%(H�E�1��H�M������H���
�H������H�5��^H��t	�8����VH�=��^A�D$H�
��^H���^E1������=�^D�-sVA��uJH�U�dH3%(D���H�� [A\A]A^]�@�=VH�=B�^H�53�^�f�H�=��^�4�H�
�
�H��I���1��f���H������H��^H��L��
H�
�
��H��LE�1��.���H������G����H��H������QH������1�H���+H�߾H���^���H�=��^I��H��t�1��L����H�]�^H��H�5K�^����	���f�U�=(VH��uC�=��^u1�1�H�=C�
]�)�f�H�=�^�1�]H�֦^�DH�=Q�
���1�1�����=�Vt��=�^u��=#�^u�H�=��^t�1�����w���f.�U��H��SH����H��H��dH�%(H�E�1�葽
�H�����H��t�8u21�1�H�=��
�Z�H�M�dH3%(��H��[]�D�� H���66H��ta���v1�1�H�=��
���fDH�pH�=e�^H��&V�iH��&VH�=�
H�@H�`�V���1��j���@H�=��
��1��S����X����U�@�H��ATSH����H��H��dH�%(H�E�1��H��H���q�
�H���d���H��t�8H��u71�1�H�=$�
�7�1�H�U�dH3%(��H��[A\]�fD�;��H�=�^H����H���C��������0�^A��='�^u
������8H��H�=.�^������H�=�^�U�=�tvH�=�^�2�H�=��^I���3�H�=�^���5�L���H���h��.����=��^t���^H�=��
�D�1�����DA��O���D��������H��H�=��^������f���@H�=�^��H��1��eH�Ɲ^A��u��=�^�{����=�^��H������c����=�V�V�������G�����=iV������I�����?�������ff.�@UH��ATSH��H��U�=w�^�r�^L�#u
�
I�^��t1�=x�^uH��1�[A\]�DL���`���H��1�[A\]�D��^L���uC�>������^��tt���^��uZL��H�=7�
�������^��t�1�躕�����H�
�
H�5F�
1�趔��H�;���^��� �v����@1�H�U������^���������^�d���f�UH��ATSH��H��U�=W�^�\�^L�#u
�
)�^��t1�=X�^uH��1�[A\]�DL���@���H��1�[A\]�D��^L���uC�����x�^��tt���^��uZL��H�=%�
�����m�^��t�1�蚔�����H�
�
H�5&�
1�薓��H�;�}�^��� �V����@1�H�U�蠔����^���������^�d���f�UH��ATSH��H���U�=7�^�<�^L�#u
�
	�^��t1�=8�^uH��1�[A\]�DL��� ���H��1�[A\]�D�ΐ^L���uC����X�^��tt�f�^��uZL��H�=�
����M�^��t�1��z������H�
��
H�5�
1��v���H�;�]�^��� �6����@1�H�U�耓���Ɖ^��������ϟ^�d���f�UH��S��H���P����=-�^uH��[]�H�5��^H����[]�,���ff.��UH��AUATI��SH��H�=N�
H�����H�{H����D�k�{L��uOB�</uHL���X���C��t
H�S���<
t
L��
�W���H��L��H�=��
[A\A]]�^��fD9CvB�/H�{��I�uH�{�cy��u	H�CB�(H�{�H�=>�
�t���@UH��AWAVH�E�I��AUI��ATE1�SH��8H�E�L��L��H�=1�^���Å���=�^t9H�rV1�L�m��=ŗ^D�u�H�E�H�E�f�U�u�=��^uvfDH�=٘^��H�=͘^I����H�=��^������L��H���:��H�=��^���ܝ=�uuA��to�=��Utf�����u]A���6���@��^��u�H���UH�8�7���H��UH�}�H�3����H�;�����}�H�}��N����E��E��@���H��8��[A\A]A^A_]�H��钟���UH�=��^H��AUATSH���'��
H�=.�
A���s���H�}����H�}�H��t�\�H�}�I��H��u��H��[A\A]]���H��H��tuI�����=�U��H���UH�8H�=��^L�%��
�	f�H�=��^H�KL�CL��1�H����H�}�諙H��H��uӀ=��UuH�=k�^�>���H�}���H��[A\A]]�f.�H�x1��
�P���A9��^�����DH�=9�^H�5+�
����H��H��^H���O���L�%�UH�5L�
1�I�<$�a��I�<$H�=ތ^�&����UH��AWAVAUATI��H��� SH��dH�%(H�E�1�����H��t9H��H��V�H�H@H��DtDH���H��Du��MH�=p�
��H�=��
���=ӕ^�L�=�VL�%�VL��`���A�	M��tf.�L��L���u���L��H�����D��)�H�T��	� H��f�C�H9�u�I�|$tnH���UA�$L��I��(M�D$�H�5o�
H�81��%��M�|$�M��u��=4�^uM1�H�u�dH34%(���~H�Ę[A\A]A^A_]�f�I��(M�|$�M���>����=�^t�H�=��^���H=��v�H�=��
�u��H�=|�
�g�����<'�H����
H��H��t+H�
V�@�H�I@�DtH����Du��BL��`���E1�H��1�L��
H���
�eL����
�=�^uHH�T�^I9�t0I�$�=`�^I�\$M�d$H�3�^��L�%.�^H�/�^H�= �^�sw�=�^u�E��������L��H����������!�%����t��L������D�H�VHD��H��L)��V����Å��\���H��X������Å��F���H��X���H�����1�H��X���A����A����H����H��X����•I��H�����=��U��H�Z�UH�H�p�^I�$H��H�5��
1�����I�T$H�=O�^1�H�5��
���I�T$H�=5�^H��t	�:�1�H�5�3����=;�U��H��X������c���L��`���E1�H��1�H�+�
�eL���@�
�'���H�=��^���^���F���A���jH���a�=��U�2H�t�UH�H���^A����H��X���蜔I��H���VH�H�=^�^H�5o�
1�����H�=��
��I�ED� E��tA��YH�=W�
H�\�
HE��d�I�U1�A�A�H�=�^H�5q�
�o��L�=e�
�YJ�(�D8�t8��YH��
H�=�
H��@���HD���O�������O���H��@���A��J�2H�=��^L��1��
��H��X���豓H��H��u�H�=z�^1�H�5�3�����=��U�S���H�=X�^�+���H��X����B���H�=��
���H�5��
L��近����tH�=��
�_�����E1�E1�����H�=��
1��A�H��X������H�5��
H�=��^���H�ӆ^H���Z���L�-��UH�5�
I�}�+��I�EH���^�3���H��X�����������H�=�
E1�A�E1����H�=#�
���r���H�5s�
H�=s�^�^���H�O�^H�������L�-�UH�5��
I�}���I�EH�$�^���H�5��
1����H�=
�^��������UH��AWAVAUATI��S1�H��(H�}��@�HH9�H�H@B�L��輑H��u�H�}�1��]�蹓�E�f�H�]�H���đH�E�H�����Ɏ^����1�H��E1��|��U�H�=j�^1�H�51�
����H���l�H�E��H�]�H��褓A9��KH���#��=N�UI���D��H�E�L�

�^H��L�$M�$M�����=r�^tA�}l?�H]�H�;��A�M��E)��!L�ο ��C�<L�
��^I��H;sg�=!�^tA�}l?tA���t���L�������f.�A�Ep�P�v
-���w�A�H�$�
L��1��萒���fDL�ο
�{�A�����f�H�5��
L��1������DH��U�H�5��
1�H�=��^�m��������E��7����A�Ep�P�v-�������L�ɺ�H�=t�
�}���M�$L�
��^���H��([A\A]A^A_]�ff.�UH��AWAVAUATL�$7SH��L9�tkH��H�=iV���vhH���L��H������~P��I��I��L�|I��A�}�H�5�^�U�M9�u�Mc�J�\3�I9�u�H��[A\A]A^A_]�@�;H�5ւ^H��@��t@��	t?@��
tI@��\t#���@H�=��
�����f.�H�=r�
����f�H�=\�
����f�H�=O�
����o���ff.�@U�!H�=c�
H��AUATSH��HdH�%(H�E�1����t'1�H�M�dH3%(��H�e�[A\A]]��H���UH�=��
L�e�H�3�N��H���VH��L�
��
L���
H�5v�
��0H���
PH���
PH���VH�H��_H�1����H�� H�=A�^�̐H�;H�5^�
H��1����L���0������H�=�^�\�H����H�;H��H�5a�
1�����=Ċ^t-�58�^���H�;H�5V�
1�����
�^����H�;1�H�
�^H�5?�
�a����=n�^H�h�
H��^HD�H�;1�H�5)�
�7���H�;H���U1�H�5'�
����H�=X�^裫H�;H�5!�
H��1�������H�;H�5�
H��1����H�=�^蚎H�;H�5�
��1�����H�=�^�k�H�;H�5�
H��1����H�=�^��H�����sH�=v�
�a��tH�=��^��=�����L��������.H�}��I��H��tyH�PL�-O�
H�;H�5��
H��ID�1��"���I�T$H�;H�5��
H��ID�1�����I�$H�;H�5��
H��ID�1����I�T$H�;H�5��
H��ID�1��̿��H�}���H�=��^�g�H�5�KH��訁��H����H�;�6�^1�H�5u�
舿���=E�^��H�=��^�O�I��H����H�=��^���8��� L���A���I��H����H��H�;L��H�53�
L)�1�����L�E�1Ҿ
H��������L���^�
I��H��t^H�E�L�m�H���5f��H*�1�L���­��H�3L�����A�<$ uI��A�<$ t�H�3�
�x�H�3L�����D�=��^tL�!�^���!H�;1�H�5��
�p�����^����H�
+�^H�,�^H�5��
1�H�;�C���H�3H�=��
�$������H��
VH�;H�5��
H�P1�����H�=E�^��H�;H�5h�
H��1�����$����H��^H�;H���1���H�5��
����=~�^�9���H�;H�5��
1�製���#���fD1��a������@� �N�����f�1��9������@� �&�������H�}��I��H��t7H�H�J�
H�;H�5��
H��HD�1�����I�UH�;1�H�5��
����H�}��?��"���f.�H�u�H����
H�;H�5<�
H��1����9���H�3H�=��
�������@H�ƒ�f�H��H	��H*��X�����
���ff.�f�U1�H��AWAVAUATSH��(H�}���H�5�{^H�=u�
�����=��U�e@H�]�H����H�E�H���'��^���H��豈H��1�H�E��#�H�5�{^H�=%�
H�E����@H�}��ωH�5`{^9���H�=�
�t�����H�M�H��H�HU��=��^��H��HE�L�)�xl?L�:L�5{^��D��M����E��t]��L�%hVL��M�lI�$A�H��t#:H�JVu�ffD:t\H��H�
H��u�����I��H�5�z^M9�u�I��L��H�=V�
��賿������fDH�=1�
蜿������H�zH��t�肿���L�)L�:L�5Kz^D��M���@���L��H�=�
�X���L�5)z^���@p�������v���������O�$/L���H�=��
���M9�v#A�H���
L��1��I������M9�u�O�d-M9�s�L��� I�����M9�u�L�5�y^��fDH�5�y^H��(H�=?�
[A\A]A^A_]鏾��H�5`y^H�=�
L�=��
L�5��
�n����&@A�}L��uT�Y���H�5*y^H�=��
�F���H�}��
�H�5y^H��H�������L���"���L�+H�5�x^M��u�H�=��
묋CH��t���H�I}VM�d@H�A�MH��t#:H�*}Vu�6fD:
t,H��H�H��u������I��H�5�x^M9�u��Q���H�xH��t�蒽����UH��AUATSH��H�=A�
H��H�*�UL� L��觽��H�{H����D�k�{L��uUB�</uNfDL���8����C��t
H�S���<
t
L��
�7�L��H�=��
�H���H��1�[A\A]]�9CvB�/H�{��I�uH�{�Ca��u	H�CB�(H�{�H�=�
�t���@UH��AWAVAUATSH��8�=̀^H�}��%fDH�]�H���|�I��H�E�H����H���T�H��I��H�E��Ņ�=��^I����xl?M�6M�?�%M����=��^��K�7M��tfDA�?H�5�v^I����I9�u�f�H�}��'�H�5�v^9���H�=5�
�̻����H�M�H��H�HE��=	�^tvM��tqH��L�1L�8L�zl?��M��t`�=�^ttO�,7M��tA�?H�5Ev^I����M9�u���g����H�=�3�D�������L�8L�1M��u�H�5�u^H�=��
�������"���f�L��L�����b��
���D�Bp�������v�����L���L�-�u^K�7��H�=d�
H�E�L���f���L;}�s/�]�L��L�}��H�A�
L��1��H��詃��I9�uދ]�O�|6M9�����L�� I����M9�u���b���f�L��L�����I���H�E�L�0H�E�L�8M�������H�5�t^H�=��
����������@p�������v���������H��t^O�,7��H�=|�
H��肅��M9�v#A�H�g�
H��1��I���ς��M9�u�O�l6M9������@H�޿ I����M9�u����DH��8[A\A]A^A_]À=d�U����E1�L�-��
I���DH�;A���<���L����H�5t^H��H������E��t�L������H�5�s^��ff.�U�H��AWAVAUATSH��H��(H����dH�%(H�E�1�H�#WHDž���HDž ���H�����1�f��,���H�����H�xH�����Dž(����`\H��踁��H��H��H��H)�H�D$H���=�|^H��������H��0���Dž��H������H��H������H������~I��H���
H�����H���^Dž@���H��0���H��H��8���1�f��D��������H���^�����H���1�L��D��8�������L������M�����8�����<���A9���
H�6wVL�rM����L�"L�H9�r%��@���=���H������H�4�[��u*H��0���L��L�����8���H�0����x��D�8���L������M��tsL�����8�����<���L�H9�r%��@���=��[H������H�4�'[��u3H��0���L��L�����8���H�0����@x��D�8���f�H������L���|���L�����M������8�����<���A9���H��uVL�jM���qL�"L�H9�r%��@���=��H������H�4�oZ��u*H��0���L��L�����8���H�0����w��D�8���L�����M��tmL�������8�����<���L�H9�r%��@���=���
H������H�4�Y��u-H��0���L��L�����8���H�0����w��D�8���E�GdA���J�3i^L�%,i^L��A���A����A����A���qA�� �7A��@�A�����A����A���yA���<A���A����D��%@A��������EA���A�� ��E����A�_lI�G8E�ohM�w@��H�������
��8���H���
H�=<�
L��0���H�х�HE�H�=��
HE�A�p���A�pL���
Ic<�L��H���~�����>���H��sVH�
!�
H��H��t��� ���f�H�
�
��1��(t���A����W �GE_NOH��H�ON_UPDATH�G�A����f�W�������H�BINCMP H��A����H�G�����f.�H�PART_KEY� D��H���H�G	f�wA�����
�P �G	GROUA��?��H��f�H�@�j�����GA����H���G�NUM �@���Dfo��
A� H��A���fD�O�G������GA����H���G�SET ����DA�P �G
H��
H�TIMESTAMH�G�A����fD�W����fo8�
H��A����G��k���@A� �ENUMA����H��fD�_��9����H�BINARY H��A��H�G��
���D� H��	A��H�ZEROFILLH�G�f�_�����@A� H��	A���H�UNSIGNEDH�G�fD�o����f.�A� �BLOBA���H��fD�w��q���f��G_KEYA��H��
H�MULTIPLEH�G� f�G��:���D�GEY A��H��H�UNIQUE_KH�G��	���fD�GA��H��H�PRI_KEY H�G�����f�H�NOT_NULLL�%�d^A��H��d^� I�|$	f��d^���fDH���{������H��pVH�
��
H��H��oq������H����1��lyH�u�U�H�5��
H�����H�����H�x�YH�����&wH����1ۀ=F�Ut�XH�=�t^��H�#�UH�H9P8HFP8H9�HCڃ�w�@d�Dڀ=Yt^�Ppt
�xl?�Q��A�H�H@��	������H�����WyH���������-D�$�� ����tH�����H�x�]�� ����X;�$�����H������� ����+H�����8vH�������� ����X;�$�����H������� ����H�����H�5j^�f����=!�U�f�H����H���vH�����H�����s^����H����vH�5�i^H�=.�
H���������1�H���wDž��DH������w����9��6���fD����H�����J��L� H�����M���9H������F�,�H�����uI��H�=0�UD��L��H�@@L�H�����H����P D��H��h^)€=hr^��tA�~l?��������XD�����A�H������B�<8��E��E9�s!@H�޿ ����A��H��h^E9�r�E��tNA�E�M�l�� ���I��H�[h^M9�t&A�<$H��@��t����I��H�9h^M9�u�@H��H�=��
�I����������DH9X@HCX@����f.���
�D������A���5������(���=�w
�����(���H�4H�����H�x�BQ���h���H�������� ����P�� ���H������+�>����J�v�������������\�����(���=���H�����H�4H����PH�������������� ����P�� ���H������H�������f�H�5�f^H�=��
�������A�E�M�|E��u�H� ���I��H��f^M9�t.A�<$H��@��t�������f�H�޿ ����H��f^A��E9�r��F���fDD��A�E�M�|E��u�I�� ���I��H�Cf^M9�t.A�<$H��@��t��t����f�H�޿ �c��H�f^A��E9�w�����fDA�L�%��
���fDA�Vp�������v���������H������H�ٺ�H�=|�
N�<�H�����L� O�,<�sv��M9�s$A�$�H��1�H�M�
��s��I��M9�u�D�����O�d?M9�vf�H�޿ ���I��M9�u�H�;e^����fDH�5)e^H�=��2�E����0���H�5e^H������m�����,�����H�E�dH3%(��H�e�[A\A]A^A_]�H�5�d^H�=U�
�+���H�����sH���<�����,���t�H�����ƅ,����j��L�cI9���H��0����D��8���H�0���� ��8���H�QiVL�pM���u�L� ��8�����<����
�L�cI9��%H��0����D��8���H�0���� ��8���H��hVL�hM���K�L� ��8�����<������H����1���qH�5�c^H�=K�
���A��Z�L�0L���g��H�=��UL��A��H���K�.�P H�S@I)�H�H�5��
H�=rc^L�H��IG�1��գ��H�����IoH��H��u�H�5Bc^H�=��2�^���H�5/c^H�����苨���6���H�����ƅ,������������@���=���H������J�4 �}L������H��0���B� �����@���=��]H������J�4 �CL���C���H��0���B� ����L�������L����������@���������@����o�����@����/�����@�����H�=�
M�O(M�GAT����D����AUAV�����SP1�RD��ARVH�5$�
QWH�=�a^A�wA�wA�w I��O���H��p��D������H��0���ƅD�������H�=��
�z���H�=��
�n���H�=��
�b���H�=|�
�V���H�=�
�J���H�=��
�>���H�=��
�2���H�=o�
�&���H�=t�
����H�=�
����H�=.�
����H�=�
���H�=.�
���H�=��
����H�=I�
����H�=>�
����H�=��
���H�=��
���H�=��
���H�=��
���H�=��
���H�=��
�~���H�=�
�r���H�=l�
�f���H�={�
�Z��������(����)��������@����i��������@������H�=��
����H��A������(i��H���q��H���q���U1�H��AWAVAUATSH��8H�}��nH�5�_^H�=��
����L�-�h^L����c����tb��H�DdVM�d�H�A�MH��t':H�"dVu�S:
�HH��H�H��u�H�5�_^������I��M9�u�H�5m_^H�=��
艤��H�}���mH�E�@H�]�H���lkH�E�H����qh^���H��E1��6lH�5_^H�=��
H�E��/���H�}��fmA9��DH�=�^^D��1�H�5s�
I���M���I��Le�M�<$L���b����tb��L�5+cVI�DH�E�f�I�A�H��t(:H�cVu�D@:�8H��H�
H��u�H�5m^^�����I��L;}�u�H�E�H��H�=L^^L�4I�>�1�H�5��
訞��H]�M�>�=�g^H�L�^^tA�|$l?����M������t^��L�5ibVL��I�\�I�A�H��t$8H�KbVu
�w�:tlH��H�
H��u������I��H�5�]^I9�u�I��H�5>�
L��1�����H�}�A����kA9������H�5o]^H�=/�
苢������fDH�zH��t��r����H�zH�5=]^H�������W�������f�H�5��
1�蒝���A�D$p�������v������L��M�$�L�EȾH�=��
�m��M9�L�E�v)M��A�H���
L��1��I���j��M9�u�M��L�dM��I9�s@L��� I������I9�u�L�{\^����fDL��H�=#�
艡��L�Z\^���DH�xH�5E\^H��������_������f.�H�5!\^H��8H�=��
[A\A]A^A_]�/���ff.�@UH��AWAVAUI��ATSH��HdH�%(H�E�1��=Cd^�e^uEH�pd^H9�t-H��=}d^H�_L�gH�Rd^�^
L�%Md^H�Nd^H�=?d^�HI�MA�EH�H9�szH�{�UH�r@�P��Dt�bf.��P��DuMH��H9�u�A�E1ۀ=�c^�uH�M�dH3%(����
H��H[A\A]A^A_]�fDH)�A�E��t��=vd^��D�51d^E����	�=Ud^t=A�}��	H�=��UE1�I�uA�H�
��
�H����P���j	腶A�uI�}��c^I�������Y^��A�Dž��k	�=�b^��A�E����I��1�H��S㥛� Dž����L��L������H������H��I�FH������H��H������f.��=zc^�cH�=�c^�lH������H���/�=c^�RD�%c^E���BH������ƅ����H������gH��u�c^
�b^�N�=��U��H�:�UH�H�PY^�=�b^L���������=�b^���=�b^��=�b^�uD�
jb^E��t
�=bb^��L����H������H���2L������2gL�
0�
H������H��IE��gH�
��
��L��I��I��1���6^���=��U��H�=Bb^�}g��tK�=�a^�lH�=%b^�PhH�=b^H���QgH�=
b^A���RgH��D��H��脤��������L���&~
H�=�a^I���g��H����L��L����_��L���ɝ��H�=�a^�gH��tH�=�a^�gH��褝��H�=b�
蘝��H������H���8�3f���+�=+a^�6H�=Wa^�gH�=Ka^I���fH�=<a^A���fL��D��H��趣��������H��������H�=
a^�x����`���~K�=�`^��H�=�`^�gH�=�`^I���fH�=�`^A���fL��D��H���I����������=x`^��H��������������1ۀ=F_^u��c^����4`^���@1�1�H�=�
������t���f��=`^����H�T�UH�8�`������� (f�������W�H��H������H��H+������[f��H*�H��������^��
�y���L���|
A�)fD�H������H���d���H�=�_^�dH����!H�=�_^H���2�dL�
�
H�=p_^H��L�����IE��|dH�
��
��L��I��I�پ1��[���H���fDH�������4����É������������A�ǀ=�^^��������D���������������������U����o�����, I�w�
fA�?H���^W
H� warningH�L�x�@H������L�x	�@s����f�H�Ѓ�f�H��H	��H*��X����f�H�=�T^�`�������L��������H�5��
H�=�V^�W��H�vT^H������H�F�UH�5��
H�;�ϔ��H�H�MT^���L���(��G���L��1����3bL������A9�����L���������fD�=y\^��D�T]^E���w���H�ľUH�8�t]��H�-�UL��H�3�R��H�;�Z]���I���DL�����ƅ���H�Query OKH������^���@H�=A]^�Lb��������1�����=�[^��5�\^�������H�.�UH�8��\��L�%��UL��I�4$���I�<$��\������DH�Empty seA�t�=�\^L�����H�����fD�����������=�U�!H���UH�H��R^H��������=�U�����H�=�R^�^���o���DH���U1�D� L���^H���G���1Ҁ=��Ut�PH�=\^t0H9P8HCP8��v
��������@d�D���DH9P@HCP@��D�=�[^����L���������fD�=z[^��������fD����������=�UA�Eۃ��������=H[^�H�5��
uJH�5��UH��H����������!��က��t�������D�H�BHDЉ��H��H)�H�5i�UL���AEL���ɍ������@�=�Z^���������H�=�Y^��Y^����fDH�=��
1��R������DH�ٻUL��H�0�v����!����H�
n�
H�5˴
�1��6R��� P^�l���H�5ɾ
H�=�R^�S��H��P^H������H�u�UH�5�
H�;���H�H�|P^����=�X^u
�=�Y^�(����
�Y^������H�,�UH�8��Y��L�%��UL��I�4$蹿��I�<$�Y�����薃���a����Y��D���������UH��AWAVAUI��ATSH��HdH�%(H�E�1��=SX^�Y^uEH��X^H9�t-H��=�X^H�_L�gH�bX^�^
L�%]X^H�^X^H�=OX^�<I�MA�EH�H9�szH���UH�r@�P��Dt�bf.��P��DuMH��H9�u�A�E1ۀ=�W^�uH�M�dH3%(����
H��H[A\A]A^A_]�fDH)�A�E��t��=�X^��D�5AX^E����	�=eX^t=A�}��	H�=��UE1�I�uA�H�
��
�H����P���j	蕪A�uI�}�X^I���ξ����M^��A�Dž��k	�=�V^��A�E����I��1�H��S㥛� Dž����L��L������H������H��I�FH������H��H������f.��=�W^�cH�=�W^��`H������H���/�=(W^�RD�%W^E���BH������ƅ����H������[H��u�#W^
�V^�N�=��U��H�J�UH�H�`M^�=�V^L���������=�V^���=�V^��=�V^�uD�
zV^E��t
�=rV^��L���,��H������H���2L������B[L�
@�
H������H��IE��'[H�
ö
��L��I��I��1���FR���=иU��H�=RV^�[��tK�=	V^�lH�=5V^�`\H�=)V^H���a[H�=V^A���b[H��D��H��蔘��������L���6r
H�=�U^I���\��H����L��L����S��L���ّ��H�=�U^�-[H��tH�=�U^�[H��贑��H�=r�
訑��H������H���8�CZ���+�=;U^�6H�=gU^�[H�=[U^I���ZH�=LU^A���ZL��D��H���Ɨ��������H�������$�H�=U^�u���`���~K�=�T^��H�=�T^�%[H�=�T^I���&ZH�=�T^A���'ZL��D��H���Y����������=�T^��H��������������1ۀ=VS^u�X^����DT^���@1�1�H�=��
�����t���f��='T^����H�d�UH�8�T������� (f�������g�H��H������H��H+������[f��H*�H��������^�
�y��L���p
A�)fD�H������H���d���H�=�S^��XH����!H�=�S^H���2�XL�
,�
H�=�S^H��L�����IE��XH�
��
��L��I��I�پ1��+O���H���fDH�������D����É������������A�ǀ=�R^���������D���������������������U����o�����, I�w�
fA�?H���nK
H� warningH�L�x�@H������L�x	�@s����f�H�Ѓ�f�H��H	��H*��X����f�H�=�H^�T�������L��������H�5��
H�=�J^�K��H��H^H������H�V�UH�5lj
H�;�߈��H�H�]H^���L���8��G���L��1����CVL������A9�����L���+������fD�=�P^��D�dQ^E���w���H�ԲUH�8�Q��H�=�UL��H�3�b���H�;�jQ���I���DL�����ƅ���H�Query OKH������^���@H�=QQ^�\V��������1�����=�O^��5�P^�������H�>�UH�8��P��L�%��UL��I�4$�˶��I�<$��P������DH�Empty seA�t�=�P^L�����H�����fD�����������=�U�!H�ɱUH�H��F^H���������=��U�����H�=�F^�R���o���DH���U1�D� L���RH���G���1Ҁ=��Ut�PH�=P^t0H9P8HCP8��v
��������@d�D���DH9P@HCP@��D�=�O^����L���������fD�=�O^��������fD���������=�UA�Eۃ��������=XO^�H�5��
uJH�5��UH��H����������!��က��t�������D�H�BHDЉ��H��H)�H�5y�UL���Q9L���ف������@�=�N^���������H�=�M^�N^�����fDH�=��
1��b������DH��UL��H�0膴���!����H�
~�
H�5ۨ
�1��FF���0D^�l���H�5ٲ
H�=�F^��G��H��D^H������H���UH�5��
H�;����H�H��D^����=�L^u
�=�M^�(����
�M^������H�<�UH�8��M��L�%��UL��I�4$�ɳ��I�<$��M������w���a����M��D���������UH��AWAVAUATSH�����@���@��F���dH�%(H�E�1��6L^@��u
�=M^���A^E1�E1�E1�HDž����=&M^����F����3
E�����tL^���DH��
E��t#H�֭
A��'tA��`H���
H���
HE؀=�L^��M��tL����L��H���K>�=�L^I���H���H�=C^H���1�H���
�EQ��L����F��I�ƀ=vL^u
��K^��uwA��tqE��ulL���|��H��t_L��H�=�K^�P������@�����L���UL����J^��?^��H�}�dH3<%(��"H���[A\A]A^A_]ÐH��J^H���0
�CD�� ���A�?�\
D�%K^E������K�7H��8���L9��L��M��ƅG���E��ƅH����o�H���D��(���L��L��0���H��8������L��0���D��(�����~hE���Lc�M̀=+K^�M��L9�8������=K^E�H�=��UuH�W@A���Dt	L9��T����_���E����M�aE���QA��/��A��*�\��H����OA�y/��A��A��9��\E1�f��={J^��A�M��L9�8����M���DE��L9��CI�ދ� ���M)�E���uZD��H��~JH�=I$YE1�L���	D��H���A�	H�
:�
H����PE����D�u��D��H������
E�V�II^D�;DI^��E��t
�=�I^�����D��L��H�=I^�4���q�����@����t����kH^���t���H�
�H^��H^H�H9���H��UH�r@�P��Dt���P��D�iH��H9�u���H^1������H�SD�`�I9�I�Q��H9������A������1��H���AoH��H9�u��D����)�I�H�9����������A�B�����A�B�����A�B�����A�B��ty�A�B��tm�A�B��ta�A�B��tU�A�B��tI�A	�B	��	t=�A
�B
��
t1�A�B��t%�A�B��t�A
�B
��
t
�A�BfDMc�I��L�M����fDA��`��A��\�����:M�aE����A��A��9���E1퀽G���H�St#H�
.�UA��H�I@�Du
H�C� H��H��D�H��ƅG����@���A�y-��M�aA��*����H����6���.A�y/��H���E�������E���u���A�Hހ�>�h���H�!@H��EE��P���f��=�F^tA�H���C�A�A�C�M�aL9�����L��H�=F^L��D)�� 1D��G���E1�ƅH����z���f.�D��E^M�aE��������W����A��*������H�������A�y/�^���A��*uE1�ƅH������f�A��#�6A��-�����M�aA��/�����A�y*��A�y*������H���A�y!�D�@��H���E���T�������L��H�5N�UD��(���L��0����[?
L��0���D��(������d���D�%
�UM̀=�E^��L9�t5��L��H�=�D^L��D)���/�=\E^tA�$<#�<-��H�=�D^H���D�5�D^�=�D^L��uB�<7t9�D^��B�7H�=iD^�<u��H���H�5TD^L�pH���/�ID^�=ND^H��u�<t95D^���H�5D^H�=	D^A�օ��t����D^E1��l���@M�aA��"��E����E�aE����A��N�H�=8^��A��C�
A��-�Hc��U���	H��H�=^�UL�$�L9�t"��L��H�=iC^L��0���D)��j.L��0���L��L��0���H�=BC^A�T$�������L��0���A�|$M�a����H���A�Auk��twL�55�U�
�I�܄�tfI�\$A:u�H�5�UH���-=
��t�A�<$t=��UE1�L����M�d�9���f���/t!I���Є�tA�T$<*u���L��f�I��E1�L������f�A�A<!����<M���=C^tA�H���C�A�A�C�I��L9��R��L��H�=6B^E1�D)�L��A��2-���D�rF^�Ā���������A�A��u�=T6^�E���)���1��\M�aH���C��L���@D��1���H��A��H�PH9�u��W����D��G���E1�ƅH����
���f.�I�vH�=}A^�0"��uH�mA^B�0H�=aA^�4r��H�������H�=DA^�_����9������f���E^����DH�
Y�UA�AH�I@H���D������������5�@^���2���L9��)����=yA^��E1�E1��9�fD�=Z@^�����H��_�8��H��tH�8L���UC���������L��腅�t���H�=.�
����@H�rH�=m@^H��0����!��uH�V@^H��0����H�5D@^�'����H�5i�UA�$H�N@H��D�rf�I��H���C�H�N@A�$H��Du�L9������#���@H����H�h?^H���kD�`@E���r��@����)?^�s��*�f�H���
�=6@^�\�D�5�?^H�5�6^E��uH���!@���=@^�4�H�5m6^H���?��� ��5�3^H�=�>^�=I��H����H��>^�=w3^L�s8uH���%:��L9���H�������>^u
A�?���H����������=~?^����H�=��Ut61�D:%��UH���Uu��H��(D:`��Z��H�xu�E�ĺP�1�L��p���H�
4�
L��(���L��L��0����;��L��0���1�1�L��詁��L��(��������D�cM�aH���C�\��DH�5��
��@Dž ������E1�A��b�f�A�y!�j����m���A�|$-�!���H���UA�D$H�R@�D�����L���8��L��H�=�=^I��H���(M�����D��H�=r=^D��H���I�v�D��H������!�H�L=^B�0��f.�H��H�=�UL�$����@�=�<^��H��<^1�H��<^��<^��;��H��P���H��P���H��H��0����:��H�=^H��H��������A��D��G���D��8����6�b<^;`<^�p���5M<^H�5><^D�4D�sL��E��t5L�cA��\u�D�sA��y��	H�=-�
A��Hc�H����D��G���D��8�����;^;�;^�P�{��;^H��;^�H��;^�e���fD��;^A��=����5�;^H�=�;^L�����E���H�x;^B�(�u;^�p����DHc��U���@H�������;^H������
H��:^H��:^H����
�@@����D��@�����:^�N�E1���������:^�:���fDA������A������I��I��HDž�����uH�����H�R:^M������{@�'
�-:^�����L��L��H����5��L��H���H�=�:^H��L���%E����	E1�L��D�5r:^E��������@L9�t"��L��H�=?:^L��H���D)��@%L��H����=�:^D�5+:^�u���E1�E1�L���f.���F�����D�%�9^E1�E���R�H��_�8�A}H��tH�8L��E1��~<�����)�L��E1�E1��~��L9�������f��b9^��=�w
����L9^H�4H�=19^�$���b���H�9^��9^�P�8���H�=9^�9^�-������E1�E1���DH�=�8^��L�5�8^M����f�L���4��H��L��H�=�8^H����#D�3�_���f���8^;�8^H�K�P���q8^H�b8^�'D�sH������f�H��0����43��H�5��2H���=��H��I���z3��H���m���f�H��H������Q�H�������)�k�d)щʃ�	�BL��p���Hc�f��
L���1
L)������=�8^�
L�50�
�����H�=�8^�=I������H��H���HcPH���TL�4�L����2��H�����f�H��H�������*A��H������)R��)�t4Lc���	,�67^;47^�P�Y�!7^H�7^�0fDL��p����
L��L���0
L)�H���9���fDH��H������	��fDL��p���Hc�������6^;�6^H�K�P�G��6^H��6^�	D�sH���O���f��=i7^L�5�
��� L���S
��D)����D�=97^�L�5͗
�����H�=@7^�XI���c���H��H���H�5�THc@L�4�L���R1���E���DH��H���H�5��
�H�=�5^�xH��HL�H���!D�3���DH��H����@��	������5^;�5^�P�9��5^H�{5^�0H��H����@����j5^;h5^H�K�P���Q5^H�B5^�;D�sH�����f�L�55^M���`����;d��L�5�4^M����L�5�5^M���;����	L�5��
�5���f.�H��H���L��p����@��l��(���Hc�������4^;�4^H�K�P����4^H��4^�\��f���+^���y+^���@L�5�4^M��������L�5Օ
����L�5�4^�t���@H��H����@��	�M����4^;4^�P��	�4^H��3^�0H��H����@�������3^;�3^H�K�P����3^H��3^�
D�sH���o���f�H��H���L��p����@�x��(���Hc����fD�=a4^L�k�H�=p4^��8H�5.�
H��I���-��H����L�5�6^L���.��L��H��H�=3^�_D�sL������f��
3^;3^H�K�P�5��2^H��2^� D�sH�����f���2^;�2^H�K�P����2^H��2^�"D�sH���_���f�D5�2^D;5�2^���A��H�=�2^D��H���I�v�ND��H������4����b�f.��:2^;82^L�C�H�
�
!2^H�
2^D�4D�sL������f�H)�1ۉ52^�����H�=2^��1^�'��������u1^��L�%ɹU�j�@D�5�1^L���o����E1���H�=�2^�7H�5R�
H��I���J+��H����H�C�{hI���H��^H��ub�H�=�^�35�����H�5�^H��
H����������!�%����t������D�H�JHDщ�@�H��H)�H�"^H�5;^H�=�0^�D�sL����L��L��H����,��L��H���H�=�0^H��L����f.�H�=�0^�������2���0^E1���H�;0^H�����f.��0^���
H�5��
H�=.0^�yD�sL�������/^�����0^=�w
����0^�50^H�=�/^L�� ���H��(���H���H��(���L�� ����������H��/^���/^�H�����/^;�/^�H���
�/^H�
�/^�0�����/^A��=�w
����q/^�5k/^H�=T/^H��(���L��=H��(����������H�//^B�0�,/^�P����&/^A��=�w
����/^�5	/^H�=�.^H��(���L���H��(������F���H��.^B�0��.^�P������.^A��=�w
�����.^�5�.^H�=�.^H��(���L��yH��(��������H�k.^B�0�h.^�P�i����b.^A��=�w
����K.^�5E.^H�=..^H��(���L��H��(����������H�	.^B�0�.^�P�W�����-^;�-^�P����-^H��-^�0H��H���������-^A��=�w
�����-^�5�-^H�=�-^H��(���L��H��(��������H�s-^B�0�p-^�P����j-^A��=�w
����S-^�5M-^H�=6-^H��(���L��H��(����������H�-^B�0�-^�P����-^A��=�w
�����,^�5�,^H�=�,^H��(���L��
H��(������(���H��,^B�0��,^�P����H�5t�
L���e&��H�����������H�5�
L���A&��H���eL��p���Hc=�0^�
L���%
L)������	H�5�
H�=",^�mD�sL������H�5�
H�=�+^�HD�sL�����[����H���VH��P�����H�5�j
�}+^H��H��P���1�HDžX���HDž`���Džh���f��l�����D�-�+^M��M��t}H��+^D��`���H��H�����d���M�I9�r+��h���=�w
�����h���J�4 H�{�,��u/H��X���L��B� H��H�����`���H�X����@)��D�`���L���Q&��L��H��H���3�H�5��
H���H��X���H���cD��`�����l���L��uB�<'t-9�d���wI�t$H�{�H��X�����uB�'H��X���1�1��n����l������H��X���ƅl���菍���\*^A��=�w
����E*^�5?*^H�=(*^L�����)���H�*^B�0�*^�P����*^A��=�w
�����)^�5�)^H�=�)^L���
����H��)^B�0��)^�P������)^A��=�w
�����)^J�40H�=�)^��(����o
��(������~�H�b)^B�0�_)^�H����Y)^A��=�w
����B)^�5<)^H�=%)^L��
�����H�)^B�0�)^�P�s�L�5�,^M�������L���/�&)��H�PH��LE�L���#$�������(^A��=�w
�����(^�5�(^H�=�(^L��(���L��	L��(������v�H�w(^B�0�t(^�P�E�H�=J�
�����(��1�H��L���H��H��H�P����N��E�����E���p���K�H���1���UH��AWAVAUATSH��xdH�%(H�E�1�H�V�UH�X@��Dt�H����Du� �"��H��u�ffDH����Du�H��������H��H���3E
H9�v2H��UH�J@�P��D(u�fD�P��D(t	H��H9�u��H��H���N11�1�H����CI��H���vH�ƿ@�I��H����H��&^�=�'^f�H��&^�5�&^H�
�&^�'^H��x���H��&^D�=�&^D��'^��'^1�H��p����x&^D�5p&^��h���H�_&^H��`���D��o���)*&^�D&^D�=?&^L�-.&^�0'^�����h���D��o���L��H��`������~�x���fD�5&^�5�%^1��p���D�'^H�
�%^)�%^D�=�%^��&^��&^�bDL������t�=�&^�����E�H�u�dH34%(����H��x[A\A]A^A_]����L������I��H�
�f
D��<�L��1��s"��1�1�L���i�����1�L����C1�1�H�=�f
�h�����x����1�1�H�=]f
��h�����Z����|%��ff.���=�$^uH������1�1�H�=�Z
�h���UH��SH���=�%^��%^���!����%^H��[]�@�u
�f�UH��H��@H���̇]�f.�UH��AUI��H��ATI��SH���B$��H��P����������u{��h���%�=@ti�0�H1��H��H��tPL���XEL�k0�1����C(�ʅH�CH��tH�CH�C ��@H�����1�H�ĘH��[A\A]]�ff.�f�UH��AWAVAUATSH��H��(H�G �u�H�GH���8
L�ku�H���8
��L9�u�C,�E̅����C(M��L�{I��I)�I��D�e�M)�M)�A�����H��H9S0��E���;�E��J�40J��C(H�sH�KI��L+E�A������H��H;S0�>�C(L��1��P�L�U�荆L�U�H��I��H�Cu��h���C@H��(L��[A\A]A^A_]Ð�K���C@fDE1���L9������{,�CDL�hI�ω}�L�k D�m�L)�H�PH��H)�H��t�H���H�p�L�1A�8
�	H�C8��z���DL��DL9�t$E��H��L��L�E�L���'��H�sL�E�L�H�s�;�L���ȑH����>���H�KH��ug�C,E��uID��HS�~CH�U�E�C�fD�C,���
���H�KI�E��CDI������f��y�
t��
H�K�H�SE��H�H�KH�SL�H�S �H�C H�K���DH������H��t+�}�uH��H��:
����L��H������f�H��1����fDH��t+UH��SH��H��H���H��H��[]����ff.�@UH��AWAVI��AUATSH��H��H����L�{L�cL�������H1�M)�L��I��B�T �&�H�E��~E�H�Cfl�CH����D��H�H�{E��uIE��L��L���k��H�CB� 
H�SA�E��C,H�C0HCH��H��[A\A]A^A_]Ð�G� H�{�fD�0�H1�蟁H��H���3���1���H����H�E�H��[A\A]A^A_]�f.�UH��ATL�fI��SL9�sT�WH��GL9�s4�H��uI�{L��H�1�f1�H����H�H��tD�c�C�1�[A\]�@[�A\]�fD�GH���L��f.��W1�H9���UH��ATD�fA��SD��H9�sx�H���WuF��H��H�1�f1�H��脀H��H��tI�S1���u[�1�CH�1�D�c[A\]�D��H�7H��H�1�f1�H���+�H��H��u�[�A\]�f���H�3H���}���sH��뒐@UH��AWI��AVAUI��ATI��SH��������H�������D�4�A�D$��
��tI9�vL���T�����u%I���M����L��I�t$L��PpM�,$A�D$1�H��[A\A]A^A_]�ff.��UH��ATI��S�@H��v-H�3��L���
H��t!H+�C[1�A\]�fD�A������t�[�A\]���OA��I�H��HL9�s>L�
��2D�H��H��I����I��A��G�D�A�A��A�I9�uыG�P�GÐfD��H�7�2�G��HA�ȃ�A��Mc�F�D��
�H���A�ȃ�A��A��F�D�@�
�H���A�ȃ�A��A��F�D�@�
�H��������
�H�2�P�G�ff.�UH��AUI��ATI��S��H������GFڍ4��tH9�vL���x�����uA�D$��L��L�����1�H��[A\A]]ÐUH��ATA��SH��H���]vH�3D��1����	�CH��1�[A\]��^�E��	����E�t�H��[A\]ÐfD1��t��U�GH��ATD�gSH��I�t$�Q�����uH�B�"[A\]�UH��ATI��S�FH���W�p��tH9�vH�������uA�D$�C��H�;1Ʌ�u�1�[A\]��I�4$�g ��H�;�K�ݐff.�UH��AUI��H�rATI��SH��H���G��tH9�vH��������uH�;L9�t6D�cE��uB�'1�H��[A\A]]�L��L�����H�;����CL9�u�L���Ɛf�UH��AUI��H�rATI��SH��H���G��tH9�vH�������uD�cH�;E��uB�'1�H��[A\A]]�L��L���u��H�;��L�
�VH�����L9�A��D	�H9�A��D�uL�RL9Vt
�L9�t�f�1��D���H��1�H��H�҉��ÐUH��AUI��ATH�M�I��SH��H�������uH�F�VI9���H9��� �uH��[A\A]]�����������9����u�1�L��H��H�����ǐff.��UH��AWM��AVI��AUATI��H��SH��A���H�u�H)�L�,A�T$I�uH9�w��u	�9�����u8I�|$H��1��&��I\$H�u�L��H������I�D$B�(1�E�l$M�<$H��[A\A]A^A_]�ff.�UH��H��ATSH��1�H��D���I��H��u>�H�M�I��H�u�uM�~E�A�\$1�A�D$E�A$H��[A\]�fDH��I��H��H��[A\]���f.�H�A�D$�!{뢐ff.�UH��AWM��AVI��L��AUI��H�M�ATM��SH��L��H��(H�u�L���������L;-�yUtiE��$��CH�{M�ޅ�tI9�vL��L�]�����L�]���u)H��H�{H�M�L��AWM��E��D���ʱ	L�#�CX1�ZH�e�[A\A]A^A_]Ð�M̅�t�A�M��L��H��H�u�����fDA�H�u�H�{L��L�#����H�e�[A\A]A^A_]Ðff.�UH��AUATI��SH��H��dH�%(H�E�1�H���v[L��p���1ɾ]�L����	H�
q�X��M��L��L��l���H�����H�M�dH3%(u(H�Ĉ[A\A]]�DL��p�����1�L���5�	��~��ff.�UH��SH��H��8L�A���tH�
��XL�M������H��8[]�fD�u*L�E��~E�1�H�u؉S�CE�H��8[]�H��CH�U�H�u�L�E���xH�U�H�u�L�E�믐UH��AVAUATS�GH9�vH��wE1��0[D��A\A]A^]�@I��H�vA��H���>���A�Ƅ�u�H�L��A��B� �{H)�H;���D�cD��[A\A]A^]�f.��G��tFH�7L�G�P�H��H�N@A��Du"�(f.��P�H�N@H��A��Dt�G��u��Ð1�����UH��AWAVAUI��ATI��SH��H�H��H�W������D����CE��E��DsI9�r#�C=�w
����C�sL��>�����u8H�CH��E��L��L�
%�XD��B�0H�E̋{H{PH�虮	CX1�ZH�e�[A\A]A^A_]���E��M��t�D�s�CM�I9�r!�C=�w
����CJ�40���u�H�CL��L��B�0�{H{����Dc1�닐ff.��UH��AVI��AUATS�GH��D�hI�u�_�A�Ą�u!H������L��B�(�sH3�
H+�C[D��A\A]A^]Ðf.�UH��AVI��AUATS�GH��D�hI�u��A�Ą�u!H��
L��B�(�sH3�
H+�C[D��A\A]A^]Ðf.�UH��AWE1�AVAUATSH��(H��uH�e�D��[A\A]A^A_]�DH��I�͉�I��H�I��H�M�L�����H�{A�DŽ���L;-�tUL��K�A���L��1�H��A���H��I��H��CH9�s9H�C�H��H�E̋{H{PH�M��E��L��D��E1�芬	CXZ�I����C=�w
����C�sL�U�H�M�H���������H�CH�M�L�U����D�k�CM�I9�r%�C=�w
����CJ�4(�|����H�CL��L��B�(�{H{���Dc����Eȅ���E���A)�D�m�M�L�H�qH�M��$���u���H�M�H�C1�E1���Uȋ{H{�l
���{�E�L��L��H�H{�$��Dk�4���A���)���UH��ATI��H��SH�]�H�sH��PdH�%(H�E�1��E�(�_

H��L���)H�P)�����H�M�dH3%(u	H��P[A\]�����ff.��GD�
A9�������U�ɉ�H��AUATSL�H�I�<L��H)�L�L�����L9�tfD�L�fL�n�
DH��I9�t`H�GD8P�u�L9�t6D�FD8u�L9�t'D�FD8GuϹ�D�H��D:D�u�H9�u�L)؃�[A\A]]�fD���D[�����A\A]]ø�����ff.��ыVH�6�����f��F9���9W������L�H�6��I�|�I�L�L�L�H�������H9���UH��ATM�a�SI�Y�E��fDH9�tkH��D8Au�H9�tgL�Y��A8A�u�L9�t`H�A�I�Q�E�E8Y�t��fDH��H��D�ZD8Xu�H9�u�L)�[A\��]�D���D[�����A\]��H���ظ�����L���͐@D�OD�21�E9���UE��A��L��H��AWE��AVE)�M��AUM��ATA��SH��H��(L)�xltI�GG�9I9���H�B��{L�H�M�L�]�H��I�48H�D)�L�D)�H����H�M�L�]�E��uLD{1�H��([A\A]A^A_]��H�?E��u@K�4 D��M�H�D)�L��0����fD��D��L��H;H�������DL�L��H��L�E�D�U�L�]����D�KH�;L�E�D�U�L�]��f��w���w
��6��wL�H��H�M�L�]�H�U�L�E�� ����2���H�L�E�H�M�L�]�B�H�U������f.�U�O1�H�H��ATS�_H9�s+H9�I��HB�H�H������¸��uI�$�D�1�[A\]Ð�UH��ATI��H�RSH���H;��
��Dc[A\]Ðf.�U1ɾ]H��SH��H���WH����	CH��[]Ðf�UH��H�H�E��E�]���f.�U�����H��ATSD�gH��L'Hc�L���
L)�C[A\]�@U�
H��ATSH��H��D�cL#L���
L)�C[A\]�@���D���A�������D9�IB�I��L9���UH��AWI��AVI��AUI��ATM��SH��H���wH9�w��uH��H�������uS�sI���M��M��L��H��H���H�E�PI����p(AWH�;蔤	H�� �CH�e�1�[A\A]A^A_]�@H�eظ[A\A]A^A_]�@��f.�H��D�F�WH���L�IH�H�7H��A��ff.�@UH��ATSD�g�^A9܉�IFԅ�tH�6H�?�����uD��)�[A\]�ff.��UH��AWAVAUA��ATI��SH��H���F��tA9����~��I9���H���T���s�{E��L�{H��tgI�T$H�KH9�rYH�<1H9�sP�CA�|$E1�H�H��H�H)�H)�H�
�i
L��)Ɖs1��P���I�vL�������u<H�CB�0�1D��tL9�sL��L������uLE9l$EFl$D�kE��uTI�$H�H��H��[A\A]A^A_]�I�uI�|$�Z���u
I�D$B�(H��L��[A\A]A^A_]�f.�H�{I�t$D���_���ff.�f�UJ�H��AWAVAUATSH��H�u�H�E�H9���I��I��I��I���)@Hc�L9�w`L��L��H��I����I�I)�L;m�sCI���H�U�L��L��������A�E��x>M��tA�I��I��I��L;m�r�@L��H+E�H��[A\A]A^A_]�f.�I��vڸ\xI��I��I��fA�G�A�E�H�5��2H�ƒ�H�����A�W��A�G��M���1��f�H��M��UH��L9�L�̮VH��L��A��L9�H��A��E�u;M9�t6L�HM9Jt,H��L�GL�MAPI��L��WH��u�d�	H�� ��fDH�GL���H��L�ML�EWH��A���ZY��ff.�UH��AWAVL�4AUI��ATI��SH��L9�siA�]��
�"~p��'ty��\tt����I�<$L��L��H����������Hc�L��L��H���=���M�l�I��M9�w�H��1�[A\A]A^A_]�fD��t\��
u��nA�D$I�L$�PA;D$��I�t$A�T$�\A�D$�PA;D$��I�L$A�T$��f.��0�f��Z�f�A�D$E�}�PA;D$��I�L$A�T$D�<�5���D�r�T���fDA�t$A�ׁ��w��6�A�t$L�H��H�M����H�MȄ�tmH���[A\A]A^A_]�f�A�t$A�ׁ��w��6�A�t$L�H������u�I�D$B�8A�D$I�T$�HA�L$�����I�D$B�8A�D$I�T$�pA�t$�\���A�t$�Ӂ��w��6�A�t$H�I�|$�����;���I�D$�A�D$I�T$�HA�L$D�<����@UH�H��AWI��AVAUI��ATI��SH��8H�E�H�E�H�E�H�GH�E�fDH�M�L��H�u�L��I����P(Hc؅��EI�L�uȋ��A�GH�H�rI��
����I��'��I��\��I���H�}�H�U��2�H�U����LI�GL���I�?A�GI�W���H�H�H�H����P0�����AGI��4���@M���I��
u�A�nH�}�H�U�������I�GH�U��\�I�?A�GI�W���H�H�H�H����P0����I�AGA�GH�}����H�H�rH�U��L���unI�GH�U�L���I�?A�GI�W���H�H�H�H����P0���%���u1I�?A�G�?I�W���H�H�H�H����P0����H��8�[A\A]A^A_]�fDA�Z��DA�0���Du�I�?A�G�?I�W���H�H�H�H����P0��������A�r���D�x���I��?�=����i���H��81�[A\A]A^A_]Ðff.�H��WH�wH�����ff.�UI��H��ATI��SH������L������H��@H�wH�dH�%(H�E�1�H�CH�������WH�����H��H�H�����1�Dž���f�����Dž������L��H���R���������%H�E�dH3%(u+H��@[A\]�f.�H�����ƅ����md�����H���R
��ff.�UH��AUATSH�\7�I9���M����H9���H����N�,
H��H9���L9���I��I���dDH��H)�H��~t�\xL�
�2H��f�F�A�I�Ã�I��A��G�D�^�A��F�H��H)�H��LM�I��H9�v&M9�v!A�<~�A���u��H�������)�H�I9�r�[A\A]]�f�A�$...[A\A]]Ð[1�A\A]]��I������I��I��1��ff.���H��Ð@UH��AWAVAUE1�ATSH����uH��D��[A\A]A^A_]�fDH����H�M�A��H�u�����SH�{I��L�<I�w�t�A�ń�u�H�CL�E�D��E1�H�U�L��B�8�{H{�7���C�f��tJH�F�WH��H9�s:U1�H��H��ATI��S�H����H�71�H����bD�cH�[A\]��Ðff.�UH��AVA��AUA��ATI��S�GH��DwI9�s}H�B�0I�t$E��{L��H;J�6I9D$s9H��L���n���t4�s�H�߅�HD��4���[�A\A]A^]�fD���Mt$Dk1�[A\A]A^]���w���w
��6��wL�H��� �����[���[A\A]A^]�f.�DH��<�vf<���<�tj<���H�B	H��B�����B����J��J����JH�� ���J������r�R���H�ÐH�BH���DH�BH��B�R�������H�BH��B�����B�R�����H��H�����H�ÐH���H��t<H�@(H��t3�@=���v����Mb����B����Mb�����fD1��DH���1�H��tH�R(H��t�B�DUH���H��P ]�����ff.��G;Gs�PH��HG�W�f�1��ff.�f�UH��ATSH����H�GxH��tG���E1�Q���w%L�gM��t=H�G H����L�`H�L�ghH�G L��[A\]�f�L�gM��u���D���u�L���H��H�OpH�W`�wH��A�P0��uL�c`H�L�chL��[A\]�E1��H�Cxƃ�ǀ�H�Cx�u���fDH�GhE1��_���H�OhH��tWH�H�GptN�W1�E1�L�L��!DH)�r�I�0H�1H��I��H��I9�t8H�H��tH��u�H����f.�1��DH��H�H��I9�u�H�Gp�ff.�@H�GH��t)H�H�V�H��u�f�H��H�H���tH��u�H�GhH�G ÐH�G H�GhH�w �ff.�@�G�w�f�H�����H�������x�f�H�ق
��H��ff.���G�ff.�������H�G��H��H��f�H�G�ff.�H�G �ff.��G�ff.����|�f�H��8��H��@��1�H��t����f�H���H��H�tY
HD��f.�H�������������H��P��H���H�@�@��f.�H��tRH���f��H���H�@H�FH���H�@�FFH�FH����@0�F(H����@4�F,������f�H�����1��ff.�f��ff.�@�lv�f.�UH��H�� fo�
dH�%(H�E�1��E�)E�H��t\L�I��D�I��H�������L
�A�H��N����L
�A�H�L9�u�H�H��H�U�dH3%(u��fD1����?���ff.�@���ff.�UH��ATI��SH����A�$H��[A\]�f�UH��AVAUATSL���M���e���H����LJ���|�H�4ňI����I��H���,ƀ�D��L��H��H���I�D$pH����P(I�D$H���PH�PH�o��o��o� I�$H��8H�A�D$I�D$ H���I�D$hI�D$H��0Hǃ�I�D$X��|AD$(A�D$AL$8AT$H[L��A\A]A^]�H�QVH����E1�LJ�����H�0��H�1V��ƃ�H���H�pp�u�ƃ�L��[A\A]A^]�f�E1��H��VH����ǃ��H�0�3�H��
V��ƃ�H���H�p@��ƃ��5���@L��E1������!���UH��AVAUATSL���M���E���H������|�H�4ňI�����I��H���H���A�~I�D$pH�����I�D$`H���GH��0�o�M�l$�o�E�t$�o� I�D$XA�D$I�\$xI�D$hHǃ�ǃ�AD$(AL$8AT$H[L��A\A]A^]��H��VH����LJ�����H�0���H�lVƃ�H�ppH���E1���ƃ�L��[A\A]A^]�f.�E1��H�VH����ǃ��H�0�c�H��V��ƃ�H���H�p@�@�ƃ��)���@L������H��
V�ǃ��H���H�0��H��Vƃ�H�p@�+���ff.���!ff.�H�?H��tH�8H��t�f.�1��ff.�f�UH�5�M
H��SH��H���H���!��H��tH����[]�fDH��H�5�{
��H����H����[]�f.�UH��AUATSH��H��H���H��t>L�'�GM�,�M9�sDI�<$I�����M9�w�H�����H������H�����H�����H�����H�����H�����H����~�H����r�H����f�H����Z�H��H�N�H���B�H���6�H���*�H����H�� ��H���H���bL�g(M��t(I�|$8��L�����H���H�@(H���H�?���H���H�x��H���H�����H���H�x��H���H�x��H���H����s�H���H����`�H���H����M�H���H����:�H���H����'�H���H�����H���H��0��H���H�HtH��0� H���H���tH����� H���H��P��H���H��X��H�����H���1�Hǃ�Hǃ�H��)�������H�H��[A\A]]�ff.�@UH��AVAUATSH���H��tFL�-�	VI��I��@H�{I�UM��1ɾ1�H�G8�g�H�[H��u�Idž�[A\A]A^]�f.�UH��AWI��AVI��AUI��ATSH��H��(H���H�E�H���H�E�H���H�E�H���H���H�E�H����bL�%PO
M��MD�H���L������M��MD�H���L�����1�1�1�H���H��M��Hǃ��\�H�5�w
H��A������E��uEH�}���H�}���H�}���H���u	M����H��(1�[A\A]A^A_]�fDH������H�����H������~E�D��E����~E�E���H��([A\A]A^A_]�f.�H�=�v
����@L�����H���H���a���H��VH����ǃ��H�0�C�H��V��ƃ�H���H�p@� �ƃ���f���ff.�@UH��AUI��ATA��H��SH��H���L��P���L��X�����t&)�`���)�p���)U�)]�)e�)m�)u�)}�D���H�����0H���M��t`H�EL�����M��H�� ����H��0�����Dž��� Dž���0H��(�����H���[A\A]]��A��$w�A��$/�����v��<w>��<wH��VA��$0���L�,��i����H��VA��$x�L�,��P����E���1�L��x
�����n���ff.�UH��AWAVAUATSH��xH�U�H�M�L�E���tH�e�[A\A]A^A_]��H�E�E�H�E�H�E�D�`H�E�A��w�L�hjH��p���H��L�}�L��x���H��1�A�uM��A�L��H��h����1��E� ��^_H��p���H���H��x���H�U�H�H��x���I�uI�UH�8���I�UH��x���H��p���H�PD��H�FH��H��H�zI���ŠI�EE�������E���/��ƒ�HU��E�L�"jL��H��h���M��1�1�A�t$A��2�ZYH��p���H��tdH��x���H�U�H�H��x���I�4$I�T$H�8��H��x���I�T$H��p���H�PH�FH���H�{��H�C�\���f.�H�aVH����ǃ��H�0��H�DV��ƃ�H���H�p@��ƃ����@H�U�H�BH�E�����UH��AWAVH�EAUATI��SH��H��hH�E�H�E�H�M�L�E�L�M��E�H�E����e�����F�����vm���v:���i����H��H�fD1�H��h[A\A]A^A_]����������H���I�$��f����7���������H���H��t�H���fD���?�)��������	�����@�����K�����Y������'��w{��#�"v@��%����&����8���������������Q������������H���H�������H�@���D��*������o����puuH���1�H��tH�z(���A�$�g������_���.��b������p����q�T��c�(H�yVH����ǃ�H�0���H�\�U��ƃ�H���H�����ƃ�����@��(��H��UH�H����D��`����a�h���H��tL�"�M���/���HU��AL�*�E���M��tM�m�ȃ�/��ƒ�HU��E�L�:M���A�H���H������H�xH�
����@8L��L	�A����������E1�M�����H���D��H�x0��#D��I��H��x���M���~H��H��p���A����H��p���H��x���H�DI�D�E;7r������������V���H���H���GH�@���D���O������������H���H�� �����\�|����Z�B��[����H���H������H�������f.���)�����H���H�����H������������������9����f���]t���^�T���H���H�������H������H���D��H�x0�M"H��I���"�D��A��I�DI�D�E9'w�����H���H������H���H���(���H��(����@H���1�H������H������f�H���H�����H�������@H���1�H��������x����f���;��r���f�H���H������[���H���)H��0�{���H���H��1����H��HH��!����H���H���H���H�@�?������P���f�H���H������H�������@H���1�H���N�����H�B���f�H���1�H������H��@����f�H�E��E� L�hH����M����H���H����H�����H���9��H���L����xH��H����L�����H�DI�E����fDH�����y������:����f.���������H�����@�������H���H��������H���1�H��t���A�$�{���H��tH���H��tH�I�$�E���/���ƒ�HU��E�H�H���<���H���1�H��t�Q��$���@H��H������H���H��������3����������H�� H�����f�H���1�H���N�������B���f�H��H�����M�������I�E���f.�H�U�H�BH�E��'����H�E�L�(H�PH�U�M�������H�BH�E�����H�U���DA��E97�K����&���H��U��������1��y���f�H�ɜ^H��H��H��H�8��
�H�5	H�=�]�-�ff.�f�U1�1�H��SH��1�H���������xH���H�{H��1��Hǃ�H��H)�������H�H��ƃ��T��H���H�������5��H���H����ƃQH�=Fh
ǃ��
ǃ�0000H���H���UH����0f���H����@H���ǃ�ƃ�H�����@xH��ƃ;H��[]��������H��H��tPƀ���H��\��H���H��t����A��H���H������H������H��1�[]��ff.�H�@��tH�H�VH�VH�H��fDH�VH������H�����u_LJ��0LJ�0000f�PH���Ƈ�H��t�@H�����H��8���tyH����` �U�H��SH��H��H�
��ULJ��H��H�1���H���U��ƃ�H���H�pp����ƃ�H���[]�D��H���H��tH���H��tH�@�UH����H�f
]��H��7
HD�ÐUH��AWAVAUATSH��H��H�U�H�M�L�E�L�M�dH�%(H�E�1�H�EDžp���H��x���H�E�L�`H�E���&�
������	�����R����!��%��#�d�>
��$t)��%��A�<$H����H
@H����1�H�M�dH3%(��H�e�[A\A]A^A_]�@��d�,����l�z����p��
�*��r���
��s��
��t��
Džp��� L�hL��L	��.M��t H���H���L��hM���9���H���H���L��p����D����	��H���H����H�x���M���
H���L�����H�C����������������ZH���>��M����L����H����������
�����������
�CH�������M���zL���6�H����*���f.����G�yH���H����H�8���M����H���L�����H�����f������A�$������f�����vU���l������A�$��P�}���D��n�L��H����V���fD��	��������A�$����)���f���h�T����f��|H������M���L�����H���������Z�����^��
����`�p
�Z��b�n��c��
H���H���H������M���BH���L���N�H����B���f���j�4�����H�������M���EL����H�������D��\���H���H����H����r��M����
H���L�����H������fD��*��vE��p�)��Y����o��	H���H����L����]���D��(���II�$H����H��0�0���H���H����H�9�H��hH���H����H��p���H%����H������Hǃ�����Hǃ�����Hǃ����Hǃ���H���UH��������v��H���H���v������������Q��H����\�������6��H�������������H�������������H����&���@H���H���WH������M���bH���L������H������H����T��M����L�����H�������H���M����E�$E����$H���H�����H���A�<$�@x�G����H���H���FH�������M����
L���L�����I���ƃ8���f�H������M����
L������H��������L�����H���H��h���H���tH��h�������������H��h����!���|���@Džp��� L�hH���H����
H��0����M����	M����	L���L�����I��0H������H���L��L��H��0����H���L��8���H���H����A�$��������H���H���x
H�x�W��M����	H���L�����H�C���fDA�$�������H������M��� 	L���c��H����W����H������M����	L���3��H���'����H�������H������M����	L������H�������A�$��;����H���H����
A�$��x���Ƈ9H��� ���@H��H�,��M���	L���{��H��H�o����H���H��t%L�h(M��tA�}�I�}8��L������������I��H���}	�M��tI�4$�H��HD�I�}8������EH���H���	L�h(�������H�x	I�����I��H���	L��H��I�W�l��H���O�l>L��H�����������L���!���H���UH����ǃ��H�0���H���U��ƃ�H���H�����ƃ���&���@H���H����
H�x���M���\H���L������H�C���fDDžp��� D�hH���H���	H��X�V��M���?L���L�����I��XH���H���qfD��`�z�f.�I�$H���UH��]�DH�������M��H��0
LD�L���6��H����*�f.�Džp��� L�hM�������M�������H���H���)
H�����L�����H���L��H�������L��I��H���������M�l��@A�$�����H����$��M���KL���s��H����g��A�$��8�P�H���H����H�xH�5�H�x0��H���H�@x���H���H����A�$��y���L���M����I�}H���1�M��t
L�������L��I�}0��I��H�����H��L�m����L��H��I��袙H���K�|4L)�H�QxL)�H)�H�Qx�P��L��H��I���r�H���L��L)�H�QxL)�H)�H�QxH���H��0�W�2�f�H���H���A�$�����H�����M���rL������H������H���H���wL��@���@A�$�����H���H���A�$��H��H���UH����ǃ�H�0�+��H���U��ƃ�H���H������ƃ���6�@Džp��� H��M�������H�L��I��H��P�������I��M���x���L������I��M���d���H���[���L�m�I�L��L��H��X����їL��L��L)�H�X���H��X���赗H��X���L)�L�,H���H���H�PxL�H������H�xH�oK�|7�N��I��H����L��H�����L�����H��P���I�|����H���L��H�x0��������H���Lhx��H�� ���M���]L������H�� ����H���H���LH��(�T��M���TH���L�����H��(��H�����H���H���uH��P���M���KH���L���L��H��P�@�H����0�A�$��Q� �Ƈ:��@H�����M����L������H������H���H����H����d��M����L���L�����I������H���Hǀ0��Hǃ�y�H���Hǀ��b�H���Hǀ��F���Hǃ��;�Hǃ��+�Hǃ���H���Hǀ���H���H����H���Hǀ����H���H�@���H���H�@��Hǃ��H���H�@��Hǃ �~�HǃH�n�H���HǀX���H���Hǀ(�@�Hǃ�0�Hǃ�� �Hǃ���H���HǀP��H���Hǀ�����H����j��H������������H���H������L���?��H���UH����ǃ��H�0�:��H���U��ƃ�H���H�p@���ƃ�����H��L�
���1�1�jL����H���1���^_���9����w���������H����t����������H����p���������H������������H�����������H�����������p��H�����������U��H����������:��H����n���������I��H����@���������H�������������H����
�������H����������H����Z������H����Y�������z��H��������_��H����S�������D��H����H�������)��H����m�������H���H���e�H����X�H��L�
���1�1�jL����H�x01���ZY���d����(���������H������L���D���q������H����(����e��H����������J��H����L�����/��H�����������H������������H�����������U1�H��AWI���&AVAUI��H�U�ATM��SH��H��(L�M�H�M��E����L��H�߾A��1����L��H�߾A	�1���H�M�H�߾A	�1�H����L��H�߾A	�1���L�M�H�߾A	�1�L���v�A	���H��([��A\A]A^A_]�ff.�1��I�f�H��H������t
�h����ff.�UH��SH����}�]1��61�H�=�L
�1��aI��uIH���]���tPH���]H�;��H���]�8t+1�1��Q��
������]H��[]�D���ΐH�5�L
H�=|
���Ǽ��H��t
�@f�����H�=cL
�)��H���p���1��
H������H��]H�;�_���fDH�5L
H�=HL
H�����H��t
H��6���DH�=7L
����H��u�����f.��=��]u�fDU1�H��SH���1���@H���]1�H�8��bH���]�;u,1��er��s�]�e�]H��[]�f.�1��I|���UH��AVAUH�EATSH��PH�E�H�E�H�M�L�E��E�H�E���#�IH�
�O
��H��Hc�H��@H���'H�H����@ �fD1�H��P[A\A]A^]ÐH����H���H���H������x���DH������`��DH����H���H��H����H���H��x����H���w�����Z���f.�H���WH�ǗH�:�8����H���7H������H���f��H���H�@H�BH���H�@�BBH�BH����@0�B(H����@4�B,�����H�������H���H�������H�@(H��������@����H�������H���H���w���H�@(H���j����@=���������Mb����B��E���DH���4���@H�iI
H��!�����E���/�DHE��8��H������H�H�@hH����H���UH������E���/��ƒ�HU��E�H�:H�������H�����H����H��hH����H����H���H�@pH��t���@H���wH��pH��X����H���W�����:���f.�H��UH�H�����fDH��UH�H�����fDH���H���H�����H����H���H������H�H�@`H�����H����H�H����H�x8H�����Yn����f�H����H�H���{H�x8H���n�9nH��Q����H�yz^H��A����H���WH�H���KH�x8H���>��mH������H���H�ǗH�:����H����H��E�����H���,H�u�H���a�E�����fDH����H���1�H�}�H�������L�e��
L�������
L��I��H�E�Mi�'H�xH�}�����
L��I��H�E�H�xH�}����K��H��I�T�H��+���@H��t;H���H�����@H��t#����H��E
��H��
HD�H���f���������fDH�����@H�E�����H�U�H�BH�E�����H��������H���G���H�R(H���:���H�zH���-���H�u��``�E���f������Mb�����P���1�����f�UH��H��H��E�����H��tH�u�H���
`�E����H��������H��t�H�R(H��t�H�zH��t�H�u���_�E���ff.�@U1�H��AUATSH��H���H�}�H��t`L�eغ
L������
L��H��H�E�Hi�'H�xH�}�轾���
L��I��H�E�H�xH�}�衾��K�T�H��H��H�H��[A\A]]�fDH���wUH��ATSH���H��H��t-L� M��t%I�$H�@`H��t��L���R���H���H�H���H��tH��PH�5#D
H������H���H��tWE1��	f�H���D��1�A��H��H�|�ZA��u�H���H�xH�@H��H�@`)��Hh1����H�H���贻��H���註��H���蜻��H���萻��H���脻��H����x���H����l���f�H��Hǃ�������� ��H���H���XE1��
H���D��1�A��H��H�|��YA��u�H���H�xH�@H��H�@`)��Hh1����H�H���H��tH�GH��tH��P`H���谺��H�����f�Hǃ�H����Hǃ�)����1�Hǃ�Hǃ����H�H���H��t�K������H�Hǃ�Hǃ�u[A\]�H��[A\]����@�ff.�@H+w �H9�w	H)�H9�����I��I��H��vD�G�H�w�����A��#�tCI)�H��L��L9�L��HF�麶��f.�H�A�UA��H��A��@A�AÐ�GH�wA��GA�A���H�����vE��������tG���tbH�P	H��P���P������H�@����f�H�PH���DH�PH��P�@�������H�PH��P���P�@�������H��H�H�����ÐUH��AWI��AVH�E�E1�AUATSH��(H�E�I�?tL���I�Ƹ����I9��:M���1I�_ �;���I���
�C�SL�cI�����f����L��E�n����L�e�A����I���H���x���H����j���H�CD�SH�}�H�E��CD�U��E�H�CH�E��K�SD�K�M�H�K	�U�H�M�D�M��S���H�M�D���I�H�L9���]�D�m�f�A���U�M���L����A���u�D���*��U��^�D
A���I�?����������I9�����fDI�?H��t�KYI�L��I���e�I���t
1�H���ajH��1Ҿ A������\hA���ILJ�ALJ|ILJ����t]�w���H�X�U���L������D�E�H�1�1�����*f�1ɾ�L��A�����H��UH�1��o��H��(L��[A\A]A^A_]�DH���U1ɾ�L��H�1��=��A����A������D����/�����<v}��w���vrA����{#I���t{H���U�H�0���I�����I���L��IF���A�����u�H�N�U1ɾ�L��H�1�����`���H�.�U1ɾ�L��H�1�����H�s�L�c	�n��ff.��UH��ATA�����SH��H�����L9�tH��w�H�C �8�u�[A\]�ff.�@UH��AWAVA��AUI��ATI��SH��H��8H�}��:����������H9��zH�[ H����H�]�H�E�����A�F�I��E1�E1�H�E�H�E�H�E��QH�u�H��H)�H9���H9���K�4�H�H�u�I�E�M��tA�L�}�A�vI�FI��L;u���I��H�}����H���u�K��I�E��fD�;��S����C�SH�}���Ћ��������S�C�����҉��9�t[H���H��hH;
UtDH��p1�1����5f.�H�E��������H�5?
ǀ��H���蕮��H��8��[A\A]A^A_]�@I�G1�I��A��ۻ������f�H��t+U1�H��SH��H�H���fH��H��[]����fD�ff.�@H��t[UH��SH��H��H�xH��t	���tEH�{���H�{tH�{(1��2fH�{`H��t贲��H��H��[]馲��fD��H����PH�Cxǀ�H�{�7���H�{u��ff.�UH��AWAVAUATA�����SH��xH�}�H�u��U����L9���`�H���n���H�E�H����I��H�@1Ҿ H��H�E�L�m��sc�E�I�F(L�u��PH��A�FPH�<�H��H��I�FHH��h����A�H��x���H��p����E�L��`���L�m�H�E�H�@ H�EȀ8�u
H���/H�E�H�}��H�@H�zcI��H����H��x���H�}�H�4�ZcI�D$H����H�E�H��p���L�e�H�h���L� I�D$L�<�U�L������E�E1�H�}�H�E��WL��M���e�N�4�H��L)�L9���L9���H�u�L��L���ݭ��L��H�u�C�.H��O�t.Lm�L9l@sL�l@A�WI�GL;}�t0H�}�I���.���I��I�D$I���u�J��A�WI�GL;}�u�M��I�D$H��L�8H�}����H��H;�`��������H�}����H�E��g�H�}�����H�]��H���Uǃ��H�0H�������ƃ�H�����H�5T;
���ƃ�H�E�H�E�H��x[A\A]A^A_]�DM��I���V�N�<�L��L)�H9��e���M9��\���H�u�L��H��腬��A�M�|H]�A�UI�EL;m����I��H�}����H��I�D$H���u�J���ʐH�E��[���H�]�H���U�ǃ��H�0H����
���H���U��ƃ�H���H�p@���ƃ�����H�}��r���H�]��H�Z�Uǃ��H�0H���詩��H�B�U��ƃ�H���H�p@膩��ƃ�H�E����H�E�H�H�������H�M�H�}�H�A���H�E��A�Q��������H�AH�E��Q�A����҉��9��3���H���H��hH;
.U����H��p1�1�������ff.�H���E��H�@��ff.�@UH��AUATA�SH��H��t-H��H��I��誧��E1�E1�L���H�����A�ą�tH��D��[A\A]]�DH����,���L��脳��H���H��D��[A\A]]�ff.�@UH��ATL��SH���H��t
1�L���K`L��1Ҿ �L^H�;ƃ;Hǃ�ǃ|Hǃ�ǃ�H��t5H�{t"H��E1�A�1�1Ҿ����H�;H��t�NH�H����H���t
1�L���_1Ҿ L���]H���Hǃ�ǃ|Hǃ�H��tVH�@(H��tMH�x0H��t#� ���H���H�@(H�@0H���H�@(H�xH��t��MH���H�@(H�@[A\]�ff.��H��E1�H��A�������UH��AWAVI��AUE1�ATI��SH��H��H���H��tD���I���uL��聥��I��H���L��t
1�L���^1Ҿ L���\E1�L��L��A��H��Hǃ�ǃ|Hǃ��(�����uDE��uH�����HtH��[A\A]A^A_]�H���H��H�@ H��[A\A]A^A_]��f��������f�Uf�H��AWE��AVI��AUATSH��H��H�EH�����H�����L�����H��(���dH�%(H�E�1�H���)�@���H�����H��P���HDžX����o	H�H����H���}	H���H���H����E1�1�H���8�H���輩��H���谩��f���E���lM���#A�>��,L���<���H�����H���|L��A�辯��H�����H��H��u�\f.�H�x�,I�����H��u�L���l���H����H���3I��H�����L��8���H�� ���� f��H�x�
1��ͪ��A�D$I��1�L��H�5�u
�î��H��H�����]H���j���H����H�S�H�XI�$�:H���E���H��u�E�|$�f�L���M���PHDž��HDž���ƅ��������L������H�W0
�"H���[�H�P0
�"H���G�H�L0
�"H���3�H�<0
�"H����H�50
�"H����H�&0
�"H�����!H��1�H�
0
H��/
�*���!H��1�H�
�.
H��/
�
��1��!H��H�
�
H��/
����M����販�����H��`���I��Lc�1�H������L��
��L������L��!H��H�i/
1����1��!H��H�
�
H�O/
�x������;H�����H��t�8uH���H�����H������VH�����H��t�8uH���H�����H��(����L�� ����~� ���ǃ��(���D��P���)�@���H��X���M���c�
H�=	
L��������EHDžH���E��uH���]D�8M��H��
LD�L�%��UH��`���M��L��@���D��P���DžT���I�L$XH���H�Ǻd�1�蔡��H��@���H��H�� �����EI��H���BH�� ���H���3I���;L���GH���H��tH�@(H��tH�xtH�@I���������M�uM����H�Y-
�"H��E�}�Y��H�N-
�"H���E��H�J-
�"H���1��H�:-
�"H�����H�3-
�"H���	��H�$-
�"H������!H��1�H�
-
H��,
�(���!H��1�H�
�+
H��,
����!H��1�H�
�	H��,
����A�>�����L��H��,
H��1��!��������fDD������@H���B����m���f�HDž��A�HDž����������������Z��������H��(�����H��
H��@���H��(���L�%i�UH��H���H��`���L�f
DžT���I�L$PH������f�H���H��(�������DH���H�����H�������H�=�+
襣��H�����H���w���H��
H������d���f�HDžH���E��������H�a�]H�H��t�H�
�
H��@�������D���A�����
A��/�����<v^A��w���vR��8tIL������H����L�����M��E���H�$�UH�
=.
H��H�1��x����H�����D���H������8���H�;H��t�[DH�H��L���u�H���t
1�L���qU1Ҿ L���rSH���Hǃ�ǃ|Hǃ�H��tVE1���H���D��1�A��H��H�|�b@A��u�H���H�xH�@H��H�@`)��Hh1����H�H����d���H����X���H����L���H����@���H����4���H����(���H�������H�Ef�Hǃ���������uH���H���H�x(��H���
�������H�M�dH3%(H������	H��[A\A]A^A_]�fDH���UH���H�H����H�������H� �UH����ǃ�
H�0�j���H��U��ƃ�H���H����D���ƃ�HDž���K���D�ӗ��H�
�(
��H��D�H���UH�1���������H��谫�����I�$�-����H�� ���ƅ����b���DH�Q�UH����ǃ��H�0蛚��H�4�U��ƃ�H���H��x�u���ƃ����f�H���H��t$H��0H��tH��8L���GH���L��H���U����H���H��tH�@(H��tH�xtH�@H��0H��tH�CXH�;L����@�0H��ǃ�0000fA�Vǃx
���H��(�����������L�k E�ED��xA��	��H�����H�1�	H���H��HD�H�����袤��H��	H��H�����H��@���H��HD��x���H���H����H������\���H���H����H������@���H���H���qH��H���H���c����H���D��`I�U�H�=&
H��H���H	E�������I�}H�� ����У��H�� ���H�����(���H��H��(���M�|舗��H��(���L�lA�EA�U�����A�U�A�U���H��PI�EI9�rA�EA�U
�����H��pI�E1�I9��	I�E,I9���H��p�����P�7I�u�	L�-�$
H����� ���H��(���H���T�j�H��(����� ���H���H���WH�EL�����L��H��H��h耟�������H��h t0L���I�EH���������PXI�EH����ƃ���puH�����tH�����H���H����L� �@M�,���;ƃ;��(���M9�sUM�<$L�����L��H��H������E���DH��踤��H���oH���w�H���߻����t�I��M9�w���(�����;�0�ǃ�0000fA�F���H�;�>=���H�;��+=H��������H���������H�����5����HDž��ƅ�����H���UH����ǃ��H�0�ԕ��H�m�U��ƃ�H���H�p@豕��ƃ��5���H��H�� ����֠��H�� ���H��H��������H��U�L��ǃ��H�0�^���ƃ�I�t$@H������A���ƃ�����DH���x������p������L���#<���H���UH����ǃ��H�0���H���U��ƃ�H���H�p@�Ɣ��ƃ�HDž���?���H���A�
�1�ǃ��I�L$8��B����
���Hǃ����I�EI�uI�E��r��A��I�M9��y���H�ֱU�L��ǃ��H�0�$���ƃ���I��$�H�������ƃ����A�EH�߉��A�EA�U��������A�EA�U����H	�pA�U��(����	�����(������������p�����A�EA�uH��������A�u�A�u���H�Ap�Z���H�=�
���� ���H��(���H������L���H��
ǃ��H���I��$���L�
f 
M��LD�1�谓���{���薏��I��$�L�_#
D�H�e�U��H��H�1�軨���F���D��L�-�
)�����H�6�U�L��ǃ�H�0脒��ƃ���I��$�H����d���ƃ����L���1���kI�E@�ǃ��TM1ɾ�H��I��H���UH�1�������H�����H���R�����襎��I��$�L�Z
D��
������f�UH��ATI��H��SH���ې��H��L��[H��A\]�	�f�UI��L�=
��H��ATI��SH����H��H��dH�%(H�E�1�H��H�
��LD�1��(���H��L���m�����1���uL���M���H�M�dH3%(uH��[A\]��-���ff.�f�UI��L��
��H��ATI��SH����H��H��dH�%(H�E�1�H��H�c
��LD�1�舑��H��L��������1���uL��譜��H�M�dH3%(uH��[A\]�荔��ff.�f�UH��ATI��SH�� dH�%(H�E�1�H�����H����H�]�I��1�L��
��H�����H�ڋ
H����������!�%����t�H������D�H�JHDщ�@�L��H��H)��#�H�]�dH3%(u+H�� [A\]�H�9�U1ɾ�H�1�营�����褓��@U@��H�k
�H�5N
HD�H����]�ff.�U�H�5�	H����]�f�U�H�5
H���{�]�f�UH��AUATI��SH��H��XdH�%(H�E�1�H����H���I��H����H�]�L�H1��L��
�@�?H��艏��H�ڋ
H����������!�%����t�L������D�H�JHDщ�@�H��H��H)������u4M��$��2DH��UI��1�L��L�
�
��H�1��+���A��$�H�}�dH3<%(uH��X[A\A]]��$���@UE1�E1��H��H��H�U�@�u������f�UE1�E1��H��H��H�U�@�u�������f�E1�E1�1�1Ҿ
��ff.��U1�E1�E1�1Ҿ	H��SH��H����H�����uH�S H��X�H�K �9t
H��H��[]�H���UH����ǃ��H�0����H���U��ƃ�H���H�pHH�����ƃ�H��H��[]H��ÐUE1�E1�1�1ҾH��SH��H�������t	��;uH��[]�@H��H��E1�E1�[1�1Ҿ]��ff.�UE1�E1��H��H��H�U�f�u���{���f�H���H��t$H�H��tH�H��tH���H��t��fDUH��ATS���H�������������E1�E1�1�1�ǃ��H��������H�5�
H��L���8���H���t
1�L����CL��1Ҿ ��Afo�
1�Hǃ�ǃ|Hǃ�ǃ��8[A\]�DH���H���H�����H���x�����u��8������;u[�A\]�D�������fDE1�E1�1�1ҾH���	���u���������UH��
��H��SH��H��Hc�H��f���H����1�H��[]�DH����H��1�[]�f.�H�����:w���H����1��f�H�GH+GH��H��vH����H��[]���fD�k���e�����ff.�UH��SH��H���O�����u�root�CH��[]�f.��+������D���H��tH�0H��H�ߺ[]��f��ی��H��H��u�H�=

跎��H��H��u�H�=�
裎��H��H��u�H�=�
菎��H��H��u�H�5]
�ff.�UH��AWAVI��AUATSH��H��(H�}�H��u�A�-�_H��臇��I��H��u�H���UH�xH��t_L�h(E1��fDI��I�}�A��H��t?H���g�����u�Mc�H�
Y�UK�dH���xwS�@H�e
Hc�H����H��([A\A]A^A_]�H�E�L�}�M��t�
1�L������H�E�H�
�UK�dH�}�L���4�1�茮������H��([A\A]A^A_]�M��tvA�>ME���E�L�}�M��t��
1�L��誎���E���E�L�}�M��t��
1�L��艎���E��y���H��K�dL��H�}�H�\�UH��������"���E1��M���DUH��AWAVI��AUATSH��H��(H�}�H���uH���w���H��H��H�y�x���H��L��I��H���7���L�������E1�M��E1�I��E1��I�I�H���DB ��E����<=�:����{����}��E����M���XI�pL9�vA�x}��A�E1�I��f�I9�v�M����L���j���H��(1�[A\A]A^A_]�f�<=���~���<;u^E��uML�U�M����A�I�@H�5�
L��H�E�����L�U����
L�E�E1�E1��v���fD<;uI���c���I�@M��u��ME�I���I���f�M��tsI�@E��u�A�L9�v�I��I��A�����fDE��u�M��t>I�@A�H9�vqH�5�
L���j�������H�}�L��L���S�������fDH���UH�}�M)�1ɾ�H�1��I���L���!���H��(�[A\A]A^A_]�DI��I������DH�}�L��L��E1�E1����L�E�L�U��V���fDH��L��L�U�H��L)�H������L�U�I��I���&���fDUH��AWI��AVAUATI��S1�H��H�EH��x���H��p���L��h���D��d���H��X���dH�%(H�E�1�H���H��tH���H�U����H;U��I��$��xH����H��h��M�����;L��諂��H���BL������H�xI������L��L��I��H���݅��M�A�M9���蘇��E1�M��E1�L��H���H�E1�I��L��P���M��E���pE����@��=�
��<{��<}��E����M���EI�XM9�vA�x}�qA�E1�f.�I9���I�UI��I�0H��Dr u�@��=���@��;�<E���!L��@���M����A�H�50
L��I�X輆��L��@�������E1�E1��D�=L���S���H�������H����H�5�
L���2���H��L�pH����f�I��$�H��x����uL��D��d�����X���L��L��h���H��p����I��XZ�X�1�1�1��tL��蝨��M������H��t��;�vH��L�m��*����?H��L��H��?HF�E1����L��gL���OI��H����I��$������H�H���PI��$�H����H����s���M����I��$�L��H��P���賌��H��P���H���I��$�H�L�(I�EXH�������uH��p���L��L��D��d�����X���L��h���H��x�����Y^I��H���&I��$�H�8�߅��I��$�H��@��;uI�X���f�I�XM���������ME��x����M����I�XE���Z���M9�A�LG��H����E��u�M��tVI�XA�I9���L��H���L��P���H�5�
L��L��P����!���L��P�������L��E1��������f�H���UL��H���1ɾ�L��P���H�M)�1�L����L��E1��Ʉ��H�M�dH3%(L����H�e�[A\A]A^A_]�@H���UI��$��t���@I���m���A�1�L)��?L�m�L��H��?f�L��HO�)E�)E�)E�)E��e��q���L�EA�����L��E1�H�	�U��H���H�ΜUH�1��,����>����H��P���L��L��E1����E1�����I��$�Hǀ�����L��H��L��L��@���L)�I��H������L��@���H�X�p����������I��$����@L��L��L���b����K���L��H���L��P���M���4����
����H��UI��$��E1�ADŽ$��H�0�5~��H�ΙU��AƄ$�I��$�H�p@�~��AƄ$���������ff.��UH��AVAUATSH��H�� dH�%(H�E�1�H���H��t H�H��tH�H��tH�@xH��t���q��;����5��-H����L����L���L���Ѡ���o���o��ƅl����o���o���o���o��)�p����o��)������o�)������o��o� )������o�0�o�@)�����H����o�P)������o�`)�����o�p)���)��)����)����)� ���)�0���)�@���)�P���H��`���H���H�H��tH�U�H�H���H�L���f�)�����M��tM�v(M��tA�~�,E1���1�H�hH���H���D��`L���H���H�����PWL������ZYH��tH���L��H�p������M��t1�1�L���#I���1����p���H��I����H�I���H���m���L�������/fD��1ɾ�H�߉��H�֘UH�1��4����H�u�dH34%(�_H�e�[A\A]A^]��M�d$M��t5I�|$�GP��t�H���U�GP1ɾ�H�1��:M�d$M��u������l���H���Hǃ�H�E�M��t1�1�L���"H�����Hǃ�Hǃ�H��)����1����H�ƃ�H�������H��L���H�H��H�H�X@�f���H��tH���y0H��葾1�Hǃ8����Hǃ�����@H�������@H�H������L��H�5����H������L�����H�������!�����}���UH��AWI��AVAUI��ATI��S��H��D�E�H�?��tA��;��H����A�������A�����I���H����H�H���xH�D�E�L��L���L���PpA�ƃ����I����0ALJ�ALJ�0000fA���AƇ�H��t�@���_���VILJ�L��ILJ8������M��H�S�	LD�I�����L��8�M��uL���w��H��E1�L���L���������A�����+I�?H��t�NI�L���o�I���I��tH��1�H�E��`0H�E�1�H�Ǿ �].L��ILJ�ALJ|ILJ������uEM��uL����v��I��E1�L��L���L���
�����I������u
�}��FE1�H��D��[A\A]A^A_]�f�A���������I��������I����yx�}���H�M�M���VA�$���<Lu �H�5u
L����|����uH�M��AxILJ�L��ILJ8�����\��M����L�M��WL�M���tI�?�M����A��������DI�?L�M��I�L�M�AƇ�L��L�M����L�M�������A����fDH��L���L��[A\A]A^A_]�=�DL��E1��}�������H9�I��XA�����DH���U1ɾ�L��H�1������u���H���U1ɾ�L��H�1�����U���ILJ�L��L�%��	ILJ8�����+�����fDH�A�U�ALJ��I���A�����H�0�u��H��U��AƇ�I���H�pp�`u��AƇ�����U� H���2,H��tf�@]�UH��AUI��ATSH��H������I��H��t,H�3H��t$H�[L��H���.�H��I�$HD�I�\$H��L��[A\A]]�fDUH��AWAVI��AUATS��H��H��H��`���H��H��8���H��H��p���D��_����|+H��H���H����I�H�H��h���H��x���H����H9��VH��L�-T
@H��x���H�@L�M���QH�pH�PH�HH���lH��L)�H��H�}�1�H����I��I)�L��H��H�u�H���H��H)�H��H�p H��H�U�H����H��L�@(H)�H��H�U�M����L��H)�H��H�U�H�P0H����L)�H��H�U�@����L�u�E1�M���DH��x���H�@H�
^
J�48H��p���N�4y�,K�<I�I�K�D}I���I��0u�H��`���H�CxH����@p�~H��x����H�@J�8�P�0����҉Sl�P�p���P�������P��D�2L�C8�x�{p�pD�H��D�D��D�Kd�@	�Ch��	��A���ƒ����uI��uf������sd��_�����H��x���H�@H�4�H����H��p����+H�C0H��x����C`H��H�C�H�H��x���H����H;�h��������f�H��8������H��p���1��6*HDžH���H��H���H�Ĩ[A\A]A^A_]�f�H�C0�w�����
�+�����������%���fDL��x����A�8I�FH�p8H+p0H��H��P����c���H��p�����@��������@���H��P���H��I��H�Cx��H��x���H�@H�x0L�T7�L9�����D�GD�?H�wJ�D��I9���E����H��0���E1�L��I��L��@����)fDL9�vkE�FE�>I�vN�4D��L9�rRE��xM��w�H��p���L��L��P����B*L��P���D��H��@���H��MD�H��H�H�L�BL9�w�fDH��x���H��0����A�8H�@�@���fDH�E�H��H���6���H��H�p H�E�H����L�@(H�E�M����H�ο�5���DH�%f�H�p H�E�H�ѿH�����몐H�E�L�ƿH�������H�E�H��uNL���f���f�I�F�y���H��H;�h����g���H��8�������{����A�8�H�����q���L���K���@UI��L���	����H��AUATL�����SH��L��H��dH�%(H�E�1�H��H���	HD�1�R�j�o��L��E1ɾHc�A�H������ZY���%H���H���H��Bp��1��҃��P(I��H����H���L��t
1�L���&L��1Ҿ �$���Hǃ�ǃ|Hǃ��Uo��I��H�����o�I�T$(L��H���o��o� A�@(H8PHH��0AƄ$�I�D$XI�MHA�L$��I�D$H��t'H�u�dH34%(L��u/H�e�[A\A]]�f.�L���hr��E1���L��������q���UE1�E1�1�1Ҿ
H��AUATSH��H���|������H���L��t
1�L���y%1Ҿ L���z#H�C H�}�Hǃ�ǃ|Hǃ�H�E��y���1��H��I��H����P(H��tME1�D��L��H��H�����H���H��t-D��|H��ǃ��x��H��[A\A]]�f�H��1�[A\A]]�UH��AWAVAUATSH��H����r��H���H��1�H��tH�pxH��H�M��~:H�M�H��H���H����H�H���G8����E1�fDD��H��0H�M�A���$�H��I���j��H��H��I���:L��L��O�|/H��I���m��L��M���j��L��H��I����9L��L��H��H���m��H�M�L�H���D9w8�{���H��H��[A\A]A^A_]ÐUH��AWI��AVAUATL��X���SH��H��H��X���L�o D���L��I�dH�%(H�E�1���p��I��8��p���H��L��I��@H��X����ɵ������H��X����B������A���I����@A���ALJ�AƇ�D9�t$I���H��hH;
��Tt
H��p1�1���H��X����H��L��H�pH��X����1������aH��X����B�
H��H��X��������A���L9��0r6A��r��H1�H�M�dH3%(��H�ĸ[A\A]A^A_]ÐL���h���H��X���I��H���uL��H��L��藴������A��r�t�I���H��te1�H��P������@I�����1���H��H�|�
��u�I���H��P���H�xH�@H��H�@`)��Hh1����H�L��X���M�L��X���A���@�
���M9���E1�f�Ic�M���A��H��I�I�}�2
I�EI��H�CH�CA��u����@I���H�������1��@I�����1���H��H�|�,��u�I���H�xH�@H��H�@`)��Hh1����H��P���fDI�������@L��L��H������H��X���H��L��H��I��������)H��X���I���J�0H��P���tL��H���A�H��X���H;�P�������H��`���H��H���H��p���H��@���H�E�H��(����f.�L���(���L��A��������H��X���H��L��H��I���N������~H��X���L��h���H��`���E���wJ�6I���IN�H��X���H�=��	H9��L������A��衲��H��X���H��L��H��I���ٱ�����	H��X���M���1�L��x���L��@���H��H����H��p���I��p1�A��hA�������L��X���M�L��X���I��?wRE��tMI���L��x���L��0���L��p���H�xL��L��8���L����e��L��8���L��0������DL9�P�������L��賱��I�Ń������n���L��薱��H��X���H��L��H��I���ΰ������H��X���L��h���H��`���M���D��1�H��H���I��pA��hA�������L��X���M�L��X���A���I���I����Uj��I�~�k��L��h���H��`���I���H��L���Lg��L��X���B�(����L�����H��X���H��L��H��I�������u,L��X���M�L��X�������fD胰�����fDI���H��tY1���I�����1���H��H�|�T��u�I���H�xH�@H��H�@`)��Hh1����H�H��UI����ALJ��H�0�]d��H��UAƇ�H���I������6d��AƇ����������@L��L��(����@L��L���&n��L��B�D-�踕H��tI���L��X������I���H��tQ1��I�����1���H��H�|�T��u�I���H�xH�@H��H�@`)��Hh1����H�H��UI����ALJ��H�0�]c��H��~UAƇ�H�p@����`g��UH��AWAVE1�AUATSH��H��(H���tH���E1��Bx<A��<��H���;��������I�ĸI9���H��H���H�E�t
1�H���H�}�1Ҿ �H�E�Hǃ�ǃ|Hǃ�H�E��:@H�����H�u�D��H���xH��A��褮��I�ĸ����I9�tOE��uJL�{ H�}�L�}��ѭ��I��H��u�H�u�L��H������H��([A\A]A^A_]��Bx�����H��(�����[A\A]A^A_]�@H���D���H�ApD�������H�}�K�'H9����H��H�}ȅ�uA��D������H���խ�������H9�t�H�K H�M�H���q����9��h����A�QE����������Q�A����҉��D9���H���H��hH;
[�TtqH��p1�1����bf���uA��D���H�Ap1�H����H����1����Q(H������H�U�A�D��H��H��E�����H���H�������D��|1�ǃ�H��([A\A]A^A_]�H�Ap��UH��AWAVI��H��AUATI��SH��H��H���JH�E�H���M���I��E1��rf�L���xI�G(H����H�s H���iL���VI�G H����H�s0H���\L���4I�G0H����H�3H���OL���I�H����H�sH���BL����I�GH���eH�sH���5L����I�GH���CH�sH���(L���I�GH���!�C\A�G\�ClA�Gl�CXA�GX�ChA�Gh�C`A�G`H�CxH��tH��L�����I�Gx�CdI��H��I��A�G�H�C�I�G�H�C�I�G��C�A�GȋC�A�G̋C�A�GԋC�A�GЋC�A�G�M9���H�s(H�������I�G(H�s H�������I�G H�s0H�������I�G0H�3H�������I�H�sH�������I�GH�sH������I�GH�sH������I�G����H�E�H�E�H��[A\A]A^A_]�D��H��H��H�FH��t*H�xH�@H�FH�H�1�H��tH�WH�1�����f.���H��H��L�@L�@���fDH�FxH��t��w��H���o1�Ðfo
��	��ff.�@1��Ƀ��f�H��t#H�?H��tH�GHH��tH���H��t��@��f��ff.�@�K���ff.�鋨��ff.�1��ff.�f�H�iaU��H��H��t H�H��tH�rH�H�H�H�x�fDH�H�x�ff.��H�FH�H��H��tH�AH�VH��H��tH�H�
�f.�H��t[UH��ATSH����u%DL�cH���a��L��M��u�[A\]��H�{L�c�`��H��L����`��M��u���f��ff.�@UH��ATI���SH���	b��H��tL�`H��H��[A\]���[1�A\]�f�H��H��u�&fDH���oH�Pf�H��u����ff.�@1�H��tf�H���H��u���ff.�@H��tPUH��AUI��ATI��SH��H���H�[H��tH�{L��A�Յ�t�H��[A\A]]�fDH��1�[A\A]]�1���UH��AUATSH���v1�H��H��[A\A]]�DI��H��eH�5=�	��I��H��t˾p��[��H��H����H�vp��I�EXH�SPA�T$H�CH�S H�H��tDI�T$1�H�ߋ����I�D$�H�ߋ��H�CH�I�D$�H�ߋ��H�CH��@��7[��H�CH��tH�CH��H�CH��[A\A]]�@L�CPM��tH�hwUI�|$1ɾ�H�1�A��H���^������H�9wUI�|$1ɾ�H�1��o�����fDH��tH�GHH�@pH��t��@��f�1��ff.�f�H��tH�GHH�@PH��t��@��f�H��tH�GHH�@XH��t��@��f�H��tH�GHH�H��t��D��f�H��t[UH��SH��H��H�8H��t��H�{8�]��H�CHH�@HH��tH���H�{H��t�]��H��H��[]�z]��f.��ff.�@H��tH�GHH�@`H��t��@��f�H��tKH�G@H��tbH���H��tVUH��SH��H�X(H��t�{uVH�GHH�@0H��t!H��@��[]��D��f.��H��[]�@H�GHH�@0H��t�@����D@����Ѓ�
@���у���xF��SH�C H��tH�s(���H�{8�\RH�C H��tH�s(1��ЋC�������D��@H��tH�GHH�@@H��t��@��f��H��t&H�OHH�I8H��tU@��H���]�������ff.�@UH��AWAVAUATSH��(H����I��H�@H��I��H��t1H���H��t%L�p(M��tA�~��H�UϾL���c���I�8H��ujI�GHH�@H��tmH��L��L����I��H��`]H�H��t M��DI�w@L��L��1��SH�[H��u�M��~Mo`H��(L��[A\A]A^A_]�DH��L���5	I���H��`]I�����M��H�H��u�I������fDI�8tL����I���b���I�GHA�O(H�@�M�H���JI�V8E1�H�U���y!�D1�I�v(��A�FutI�GHH�@H��tH��L��L����I��M��������8R�����t	������E�A�	A�FI�F H��tI�v(���H�}��
PI�F H��u�A�Ft�H��_]I�����H�H�����������H�U���1�I�v(��A�Fu�I�GHH�@H��tH��L��L����I��M���N����Q�����t	���9���I�F A�H��tI�v(���H�}��dOI�F H��u�A�Ft��R���M�OPM���E���H�rU1ɾ�H�1�A���*����UH��AVAUATSH���H�GH��t&H�_H�OI��I��I��H�H9���H���v
[A\A]A^]�����@H����H��H��~GI�t$L9�vI�D$J�.L��I�D$L����sf�����t�A���t�D�fA�D�H��[A\A]A^]��H)�L��H��H9�HO�H���U��I\$H��[A\A]A^]��H�I�~H��I���H�L�I�L�I)�B�0L)����H�됋A��D�A�D��H������t����UH��AWAVAUATSH��(H����H�G@H��I��I��H��t.H���H��t"L�p(M��tA�~��H�UϾ�v���I�8H��umI�GHH�@ H��tpH��L��L����I��H�]]H�H��tM��I�w@L��L���SH�[H��u�M��~MohH��(L��[A\A]A^A_]�f.�H��L���UI���H��\]E1�E1�H�H��u��f�H�8t
�t�I���j����G,I�N8H�M��E�����fDI�GHH��L��L���P(I��H���2����N�����t	�����E�A�
A�FI�F H��tI�v(���H�}��TLI�F H��t81�I�v(��A�Ft�H��[]I�����M��H�H������I��������A�F�X�����H�M�f�I�GHH��L��L���P(I��H���������M�����t��uOI�F A�H��tI�v(���H�}��KI�F H��t1�I�v(��A�Ft��V���f�A�Ft��H���H�-[]H�H�������@���ff.��H��tH�GHH�@hH��t��@��f�H��t#H�GH��tH;GrH�GHH�@xH��t��D��f�UH��ATSH����H�G@H����ǀ�H�G@�0f���ǀ�0000H�G@ƀ�H�G@H���H��t�BH�G@H��H���.H�C8H��tmH���A�Ą�uFH�C@H�����xurH���H���H��tO�>tJH�{8�1[��A��D��A\]�H�{8�WT��H�C8�A�D��[A\]�f.�H��t�:t��@H�{8�g��u�H�C@H���H��t��l���ff.�H����UH��AUATSH��H��L�-`Y]M�e@��uGM��t1L��I;\$uL���@�H��1�[A\A]]�H9^t�H�vH��u�H��1�[A\A]]�@���T��L��H�XH����I�EH��1�[A\A]]�fD��f.�D�J�L�WH��Mc��L�Q������Q��HD�A�A��	vD�A�A��vYD�A�A��w]D�A���D�:uOH��H��L9�tL1Ҁ8:��H�H��H)�L9�,��QЀ�	v��Q���w��Q��fDD�A��D�:t���@1��DUH� X]H��ATI��S�8t:���N��H��H��tI�$L��H�C�s�H�CH��t"H��[A\]�f�H�������DH��1��R����ff.��UH��ATI��S�1��Ä�u��[A\]�@L���x���[A\]Ð�+�ff.���ff.��K�ff.����ff.���ff.���ff.��K�ff.�UH���7���wH��WUH�]H���H��WU]H�@(�UH��AWI��AVI��AUATI��SH��dH�%(H�E�1�H�G�@L�h@�RR���@L��H��H������tkA��M������uZL���:�J��L��H��E�A���A��;�J��D9�u1��L��H���d���A��H����E��u&E1��OfDL����H��tH���sP��A�H�&gUL�W�	��L��H���H�iUH�1��_a��H�]�dH3%(D����H��[A\A]A^A_]��M��t�L��H�5�	L���I�I��H���m���A��L��������@L��L���X�H���7����
L���rI��H������:L���YI��L��H�������;�
H����������!�%����t������D�H�JHDщ��H��L)�9��s���L��H���������`���L����H�������H���O�����f.��
L����H��H��u+L��L���~�H���]����
L���H��H��t����fD�
L���{H��H����������DH���N��������M��fD��f.��f�H��H�GH�G H�w H�G(H�G0H��u�UH��AUL�jATI��SH��L��H���yO��H�CH�H��tL�e��~E�L�m�H�E�@H��[A\A]]�fDUH��AWAVI��AUI��ATSH�^H��H��H�H��tMH�JH9����G,�H�O,H�J��v
H�����H9�w�pfDH�JH9�saI��H�H��u�E�}(M�e D��I���L��H�CI9�LB�L���N��H��H����A��E�}(I�L�bI��L�bH�I�H�JH��H)�H)�HBH�JI;MsH�
I�I�MH�
I�UA�E,H��[A\A]A^A_]��H�H�H�GH�H�WH��G,H���@���H�J����I�U01�H��t�H�E��H�E��ff.��H����U��H��ATS��H�GI��H�H��u�$D�[L��I�D$H��tH��H�H9�u�H��u�I�<$H��u�vfD�+L��I�D$H��taH��H�H9�u�H��u�f�A$I�$H�HH�Q�H�PI�$H�I�D$([A\]��H�G1��V���f�f�A$H��u�I�D$([A\]�@�ff.�@UH��AUI��H��ATI��SH���E��L��H�XH���v���H��H��tH��L��H���pH��H��H��H��[A\A]]�ff.�@UH��ATI��H��SH���+���H��H��tH��L��H���%H��H��[H��A\]�f.�U1�H��H��PH�EH�u�H�E�H�E�H�U�H�ƺH�M�H�ML�E�L�M��E�H�E��/DA�ЍBJ�<t;��/��H��H�H��H��Hǃ�/v�H�9H�AtH�H��f��E��K��H��tsH�u�E��H�}H�u�H�u�H�u�I��H���.A�ȍQO�M��t9I�0��/w3Lʃ�H�H��H��Hփ�/v�H�WH�?H��tH�7H�z���É�H�����H���^���f.���wH�4PU��H���DH�!PUH�@�ff.��UH��AWAVI��AUI��ATI��SH��H��(\��(H��H�H��H��H)�H��H��H��H��H��H�zH�9�J��I��H��t5H���M�L��L��L��H�xH�@�Ph��u4I�UI�H9�s I�I�EH��L��[A\A]A^A_]��I�EL��E1���H����H�:�vWH���H�xtIUH��AVAUI��ATI��SH������I��H��t8H�H��L���E��L���H��1�[A\A]A^]��H�1��fDI�<$����fDUH��AWAVAUATSH��H�H��uH�E1�H�H��D��[A\A]A^A_]�@I��H��H��I��I���TI��I��H��t\I���M��L��H��L��H�xH�@�PpA�ń�uH�L��L��I�$��D��L���G���L��A��G���w���DA��g���DH�"M]�8u��H�M]��D�d�f.�H���H��t$�GPH�@H�H���H�H���1��f�H��d�GP�ff.��UH��ATI��SH��H�8�Z��������H9�t H�C8H�@ �8�t3I�$1�H���[A\]�H�Y���H��H[�A\]��H�9���I�$H��H�d�UH��SH���O`H�_8��t��8�����uc��tbH�_UH����ǃ��H�0�aA��H��\U��ƃ�H���H�pp�>A��ƃ�H��1�[]�fD��u��Pu��0ƇLJLJ
0000f���GP��uH�����H��H�@H��H��H��UH��AUI��ATA��H��SH��H���L��P���L��X�����t&)�`���)�p���)U�)]�)e�)m�)u�)}�D��H��
��T�A��$/���A��$w�H��M��t(��<vK��vFL���!@��H���[A\A]]���<���<��H��[UA��$0���L�,�H�EL�����M��H�� ����H��0�����Dž��� Dž���0H��(����}A��H���[A\A]]�����x���E���1�L���	���?@���DH�ZUA��$x�L�,��X���UH��ATSH��H��dH�%(H�E�1��P�)H���I��H��tB�GPH�@H�H���H�H���1�H�M�dH3%(��H��[A\]�D������"�G@H�U�I��A����E�H�8�E�H����P����H�������H�C8Hǃ�Hǃ�H�����H��H���H��P`����H���H�����CPH�RI�$H���H�H�������DH��[U1ɾ�H�1���������fDH�C8H�ߋ��H���H���1��������@$���I�$�d���fD����I�$�d�CP�l����pA��UH��AVAUATSH��H��L�o8dH�%(H�E�1�M����A��@����H�{@u.E1�H�U�dH3%(D����H��[A\A]A^]��E��A��A����H�����H��������H�C8Hǃ�Hǃ�Hǃ�ǀ��CPE����A��tH�C8H��t������f@A���8���H�spH���+����{d��� ���1�1�f.�H��yft)�Af�KdH��H��pH��H9����H�spH��yfu�H����H��pH9�w�����f�E���V����{PuH���X�CPH�C8��������K`���D���I���H��PxADž������ADž�H�G8A�0ǀ�0000fD���H�G8ƀ�H�G8H���H��t�@�0ƃǃǃ
0000f�����A�������H�8������S@H���L��I��E1����U�H�U�PA�ń��b���H�C8H�ߋ��H���H���1��������H�XU1ɾ�A�H�1�����Z����>�����w ����s#��v���������������UH���H��AWAVAUATI��SH��HH�E�H���H�E�H�E�H�E��@M�}I��$�I�|$8����I�Ǹ����I9�� I�D$8L�p I��w
A�>���H�}�I�w��I��H���6H�@L��L��I�EH�E�L�m�L�(I�}�l;��A��$�u���A�|$`I��1һ�G	��L�H�Eȅ��P����A�ut��I�t$XL���]H��H΋FpH�@M��Ic@����L�N@�Fd@tuM�@L�V8I��M9�MB�M9�v"L�F@I�D$XA�|$`�DpH�
D�]H�@HcD�HE��u#��I��9�������A�u��j���D��9��U������M��u�I�@H�F@I�D$XH�@d ���@pA�|$`H�@IcD��fDH�}��U�H�M��ȃ��H�M�IL$XH�΋Ip�U���w9�H��ǀt)H�=��]H�IH�L�H�N@HE�A�|$`�8����H9F@s�H�F@��@�pp�~���wH�vA�|$`IcD����f.�H�h@����fDI�D$8L��IDŽ$����H���H���1����H��H�[A\A]A^A_]�DH��TUL��1ɾ�H�1��}���H��H�[A\A]A^A_]�f����H�E�H�A�FA�vI�T$8��������I�T$8A��$�A�FA�v��������A��$�I�D$8���9�t$H���H��hH;
ٜTt
H��p1�1���I��$�I��$�H��H1�[A\A]A^A_]ÐUH��AVAUA�����ATE1�SH��H���GPH�8����A��@�{���L9���H�{8H�W D���H�U�E��u	�:��H��wˀ:�u��aF����tnH�U�H�K8�B�R��������H�C8���D9�t$H���H��hH;
�Tt
H��p1�1���E��uH�{8A��؁��L9��]����CPH��[A\A]A^]�L�e�H��L��H�U���L�����H�U�H�K8�B���������H�C8���D9�t�H���H��hH;
S�Tt�H��p1�1����x����UH��AWL�~AVL�u�AUE1�ATA�SH��H��(�W`H�E��B	��L�H�Eȅ��E�'tDH���H���CH���1�D���E���I��A��D9k`��A�E�'u�D��H�CxH�U�H��H)�H��H�T �����H�CxH�@X��H�8�H�PH�����H��HsXH�ϋFpH���]H�M�H{xH�@H��L��H�C8��Q�H���H�CxH�M�H�DH�HE�E��3����A��D9k`��H�}��H��(1�[A\A]A^A_]�fDH���H����H���L��D�������@D��H�KxH��H)�H��H�H�QH�����H�SxH�D H�SxH�H�:��H�BPH�SxH�H��h���DH�SxH�H�BH�����H��HsX�FpH�5O�]H�@H��Hc@����H�SxHE�H�H�:��H�BPH�SxH�
H����f�H��(�e[A\A]A^A_]�@H�JPH�
H�SxH��L���DH�QgH�QH�SxH�T����f.�H�PgH�PH�CxH�T����f.�H�PPH�H�CxH����DH�rPH�2H�SxH��O���DH�BgH�BH�CxH�D���f.�L��H�M��T}��H�M�����ff.�H���v7H����vH�����v5��H�G	H�w�f���H�Gf�w�@@�7H�G��f�wH��H�G��@�w�ff.��UH��AVAUATSH��Hc�H�� L�GpL���dH�%(H�E�1�H��H)�H��L�L�`�@`M����H�W8H������p��H����Bp����h������L��I)�I��O�T M����M���NA�2��	��[�����������L�+@����'L���h/��I��L��L�����H��M��tL��L��H���$2��H��L�H�1�f�H�]�dH3%(��H�� [A\A]A^]Ã�	�g�����X������+���j���!I�$H��ƈH�H���H�� @�q��H�����@�qH��AH�����PH��H��H������HH��P1�H��@�����uH�A�$�1�H��&���fDwbL�+��H��H)�H��I�H���UM���,L�0I�����������f���t�w9�����������
u<A�$H��H��b1�H�����=�r=��p���-����b���H�!LU1ɾ�H�1�����^���fDD��hE���i���H��pH��u��L���]H�RI��HcR���H��I��4�����������(���=��v���=������-���������X����A�D$A�|$ �E�I�|$�E�A�D$�E�A�D$�E�A�D$�E�A�D$�u�EԺ�
�U�H�3H�}˃�������t���t���T�f�T�@H1��F���fDA�$A�L$A�T$I�|$f�E�A�D$�M�A�L$�E�A�D$�M�A�L$�UψE��N�MӸ��E�H�3H�}ˉȃ������P��t���t���D�f�D�f.�H1����fDH�I�$H�1�H����H�A�$�1�H��t���@H�A�$�H�A�$�pA�$H����BA�$H����B1�H��8����H��pH����A�4
���fDM�$��(����H�E�L�FI��H���H�T�H�T�L)ƍ1H)����� �����1҉փ�L�7M�09�r�����D����I�|$��I�<$u
�������������f�H�U�L�FI��H���H�L�H�L�L)ƍ0H)��������1ɉ΃�L�7M�09�r�����DI�|$t(�	����f��������I�|$H�H��H��	I�|$�҃��E���DH��pH��t\H��L�4����1�L�����H����������T��T��3������ʋD��D����H��A�42���f�L�4��f����.��f�UH��AWI���AVAUATSH��8H�u��n0��I��H�E�H����A�G@I�~	A�FA�	H�}�A�I�GHA�FA�Gd���������H�CH=��
L��L��L��L�M��3��H���H�x	L�M�I��H�}�1�H��L�M���)��A�GhH]�H�]�L�M��H�E�H�pH��H�u�L)�A�h��E�gdL��H)�C�L$H��H9���E���T1���H��H)�H��IGp�xe�H`���̀���H�EȈhH�E�H�pA�GdH�u�9�r�H��L)��?M��H�E�A�GhL�H��8L��[A\A]A^A_]��A�����DA�Gd����H�E�E1�H�E��@�A`�����������������
����I��L��M)�L)�H9��I�GpH�H�HH��t�9ud�x`t^H�xtW���7A��E9gd����D��I�OpH��H)�H��H�H���Qf���I����Af�1�1��y����D��D��������AT	�fD��uWH�H����H�H�H	H����-�����w#��s҃�u$� ������D�������
v�H���]H�@H��HcHH�A�@M�I�D
L���U�L9�LC�L��L�M��o0��H��trJ�4(I���U�L�M�H�u����f��1����@H�U�D��1�L��L�M����H�u�L�M�I��M)������!��
�F���@H�9DU1ɾ�L��H�1����L��E1��b+��H�E�H����f���L��L�LL��L�M��/��H��t�H�4I��L�M�H�u�����H�Eȃ��hH�E�H�pA�GdH�u�9������������	�d���I�����f��Gd����L�O8��M������I��pH��H����H)�1�H���f�E�A��t]fDH��pH9�tWH��u�M���A�@pt�D��hE��t�L�GpM�D M��t�H���u�L��pM��uE�0A��u���1��DL��G��ff.�f�UH��AWI��AVAUATSH��HH�G8H�u�H�����p�H����@p���_d������*��I��H�E�H���HA�G@A�hI�L$A�$���T��H�MȻfA�|$H��H����31�fD��H��H)�H��IGp�xe�P`���΀���H�EȈpH�E�H�HH�M�A;wdr�A��hH�E�E1�H�E���u�1f�A��E;�h�I���H��tI�wpI���D��Є��D��L�������u�E�wdE��t�D��E1�D�m�H�E�H��E��H�E��N�E���AIƈH�E���t!�H�U�D��L��I���HDM��(�A��E;od�
D��I�W8H��H)�H��IGpH�����p�H����Bp��E��hE����H�P H����I����ND�2E����1ɸ�H�u�I��I��M)�M)�I9�����J�DL�L��M�L9�L��L�U�HC�H����+��L�U��M�H��tJ�4I��H�u�����f.�H�@U1ɾ�L��H�1���L��E1��*'��H�E�H�H��HL��[A\A]A^A_]�DE1��H`��w-��sX��tT��u*1ɸA���#�����������
v%L�^�]H�I�I��Hc@H�xH�����I���tvH�@@H�xH�������I��pH����H�}�D�4:���f��H�Eȃ��pH�E�H�HH�M�A9wd����,���f�D�m��7����A�����I��pH�8H����H���H�u�H�47H����[H�~H�F�Q���H�M�D�4
���f�H��;U��L��E1�L��	H��	H�H1�����q���1�H�MȻfA�t$�m���f.�E��hH�xE�������H�xH�����DH��tAH�u�H�7H�xH������X�L��H��H���)��H�������H�HI��H�M�������a���H��:UH�)�	��E1�H�H01��*�����H�M�H�E�L)�A�GhH����H�^=U1ɾ�L��H�1������X���H�xA��h������L�
�]H�II��Hc@��H�E�H�<���I��pH��t�H�E�H����ff.�f�H��`tVH���H�H��`H�W@�H�W@H���PH�W@H���PH�W@H���PHLJ`HLJ���UH��AUA��ATI��SH��H����h��t@���E��t+H��`H��t
H�E��#��H�E�H��`I�$H���H��[A\A]]��+��f�H��������tXv.���t^rl���tt���u4H���H�1�����tc��to��uH��H�1��D��f���x�1��DH��pH�1����h�1��D�GP�1���H�GHH�1��fD���1��@UH��AWAVAUATSH��H��H�8�Q�WPI���r��x���\H�p�Q�CdM��������H��H�{pL��H)�H���:���Cd�Ch����E1�L�%�']L�-�(Uf.�H�C8H�SpH���H�H8D��L�4�I)�I��L�H��t�z`�ф���H�SpL�H�z���zft�BfH�SpL�H�:���B`�����������������|H�B@@A��D9{d�R���f��0�Ch1�ƃ�ǃǃ
0000f��ƃH��[A\A]A^A_]�D��� �Cd����v�H�B@A��D9{d�����fD���W�qH�B@A��D9{d������V���fD��
t�w9����:��
uEH�B@A��D9{d�o�������f.�=�r=����-������H��8UH��1ɾ�H�1��u��H���[A\A]A^A_]ÐH�B@H�H�SpL��d���DL�bH�SpL��4����H��8U1ɾ�H�1����H���[A\A]A^A_]�@H�B@A��D9{d������E���DH�B@
A��D9{d�z����%���DL�jA��D9{d�^����	���f�H�B@A��D9{d�:������DH��7U1ɾ�H�1��h�����fDH�4�H)�H������H�CpH��t*��x1�H��H��H)�H�������x�h���H�b7U1ɾ�H��H�1��������ff.��UH��AWAVAUI��ATSH���OPH�uȅ��]�W`����H�}����H�xH��H)�H��H����H�u�E1�L�%o�	�6��A�U`����f.�I�E8H���H�H8D��H��H)�H�E�H��L�<H��tA�`�ф���I�ExH�H�x��H�8�xH�x�]A�`
w6A�G`Ic�L��f�I�ExH�DP(I�ExH�H�(@A��E9u`�R���Aƅ��0ADžADž
0000AƅfA��1�H��[A\A]A^A_]�fDI�ExH�DPI�ExH�H��f.�I�ExH�DPI�ExH�H��_����I�ExH�DPI�ExH�H��7����I�ExH�DPI�ExH�H������I�ExH�DPI�ExH�H�����H�HdH�H���H�HPH�I�ExH��u���DH�HgH�HI�ExH��R���@H��4U1ɾ�H�1��H��H���[A\A]A^A_]�@H��4UL��1ɾ�H�1����H���[A\A]A^A_]ÐI��@H�����H��I�ExH��taA�E`H��H)�H���D���DH�4U1ɾH�1����H���[A\A]A^A_]�@H���[A\A]A^A_]�H��3U1ɾ�L��H�1��i������ff.�@H���H�V�H��u�fDH��H�H���tH��u�H����GP�����f�H������Hf.�UH��SH��H���GP�����w`�����������H�C8H�u�H��H����Ph����H�C8H�u�H��H����PpH�S8�CP�0ǂ�H�S8ǂ�0000f���H�S8Ƃ�H�S8H���H��t�B�0ƃǃǃ
0000f��H��[]�f.���X�CP�.���f�H�12UH��1ɾ�H�1�����H���[]�f�H�S8�CPǂ�H��[]�@�d�f�UH��AUATSH��H���GP����9W`������H����H�CxL�$�I)�I��L�H�x ��H�H����H�H�H�H�GH�����H�GH�����H��H�OHHsX�FpH�SxH�
�]H�@L�H��L�j H�� �H�CxN�l  H��1�[A\A]]�f�H�1U1ɾH��H�1�����H��[A\A]]�DH�W1�H��t����H�GdH�G�i���H�GgH�G�L���H��PH��-���@�G`�ff.��UH��ATSL�g8H��M����ADŽ$�H�G8�0ǀ�0000f���H�G8ƀ�H�G8H���H��t�@�0H�{@ǃǃ
0000f��ƃu1�[A\]�@H�����H�������H�C8Hǃ�Hǃ�Hǃ�ǀ��CPH�C8�������H�{pH��t��sd���z���1�1�H��yft)�Af�KdH��H��pH��H9��Q���H�{pH��yfu�H����H��pH9�r��/���f��{Pu�H���X�CP�r���D�C`���t���I��$�H��PxADŽ$��U���fDH��.U1ɾ�H�1��h������ff.�U��H��ATI���S�'��H��H�����8����H��@H����L�c8I��$�H�� H��0H�C@�ճ���CPH�ߺI��$��0�f��ǃ
0000Hǃ������H��������H��@���H��[A\]��H��1����H��-U�ADŽ$��I��$�H�0���H��+U��AƄ$�I��$�H�p@����H��[AƄ$�A\]�ff.�@UH��SH��H��H�8��[�������H9���H�{8H�G �8����P�H���P�������P���4
H�s@�P�H����҉S`�P�H����҉Sd�P�@
������������Kd��tmH�C8H��H����PX��uH�S`��uX�Cd��um�CPH��1�[]�f.�H�a,U1ɾ�H��H�1����D�H��[]�@�C`��t�H�C8H��H����PP��uԋCd��t��x��tc9����C`���v���H�4�H��@H)�H���5��H�CxH���h����K`1�H��H��H)�H���L���-����H�4�H��H)�H������H�CpH�������Kd1�H��H��H)�H������`���H�Y+U1ɾ�H��H�1�������x�Cd����f.�UH�81�H���H��H�PpH���H�������P(H�ǸH��t�^��1�]ÐU1�H��ATI��SH��@H�8H���H�PpH���H�������P(H�ƸH��t A�L$`I�|$8E1�H���(���H��I�D$X��[A\]������f�UH��AUATSH��H��H�8dH�%(H�E�1�H�����S`E1�����A������{P����8D�������������C@H�U�I��A��E�������E�H����P���0H�{8H���H��P`A�ą���A��H�C8t�����u
�����H�C8H���H�5Q��H��HH���ǀ�H���H��H���������CPH�C8H��8�H�M�dH3%(D����H��[A\A]]�����C���H��(U�LJ��L� H�C8L��H����3��H�C8��ƀ�H��&UH�ppH�C8H������H�C8L��1ɾ�H��A�ƀ�1��#���N���fD1ɾ�H��A�H�Y(UH�1�����"���f�H�A(U�LJ��L�(H�C8L��H����
��H�C8��ƀ�H�
&UH�ppH�C8H����Y
��H�C81�L���H��ƀ�1��z�����DH���1�A��l��H�C8Hǃ�Hǃ�ǀ��c���H�C8H�ߋ��H���H���1�����9�����
��@UH��AWAVAUATSH��H��L�g8I��$�E��$�H�@HH��toL��Ѕ�tfH�C8I��$�I��$�H��H��8H���A��$�1������x��t�Cd�CPH���[A\A]A^A_]�f.�A��$|��tI��$���H�C8H��8H���I��$@H��A��$�������D9�t$H���H��hH;
�nTt
H��p1�1���A��$��0���I��$�ADŽ$�ADŽ$�0000fA��$�AƄ$�H��t�@�0ƃǃǃ
0000f����P�Ch�CPA��$|���{�C`��tA��$��tL��@1�L���6���A��$|L��H�4�H)�H��跾��H�CxH����A��$|L��H��薾��H�CXH���wA��$|H�{x1�H��H)�H�����A��$|�C`����E1��I��$�E��H�CXI��L�L��o�oJH�oR P �oZ0X0�ob@`@�ojPhP�or`p`�ozpxpI��$�L�H�p H��t&H�SXL��L�H�U��*���H�U�H�B I��$�L�H�pH��t&H�SXL��L�H�U����H�U�H�BI��$�L�H�pH��t&H�SXL��L�H�U��̿��H�U�H�BI��$�L�H�0H��t%H�SXL��L�H�U�螿��H�U�H�I��$�L�H�pH��t&H�SXL��L�H�U��p���H�U�H�BI��$�L�H�p(H��t&H�SXL��L�H�U��A���H�U�H�B(I��$�L�H�p0H��t&H�SXL��L�H�U�����H�U�H�B0I��$�L�H�pxH����L��A���f���H�SXJ�D*xD9{`�#���H�CH�������@��H��t	����H����H��XH�C8ǀ��CP�C`A9�$|�[����1ҐI��$��Ѓ�H���tpH�KX�tpI��$�H�t8H�KXH�t8I��$��tdH�KX�tdI��$��thH�KX�thI��$��tlH�KX�tlI��$�H�t@H�KXH�t@9S`�r���1�H��[A\A]A^A_]ÐH������H����ƃ8ADŽ$�H��X������s`��u�C`��H�{XI��$賣��I��$�H������H��!UH��1ɾ�H�1��G��H���[A\A]A^A_]�H�CXA��J�D(xD9{`�u����M���H�a!U1ɾ	H��H�1���������H�������¸���@������ff.��UH��AUATS1�H��D�o`E��t.I��������H��H��t&ƀ�I�D$XD�kH�CH��H��[A\A]]�@H�� U1ɾ�L��H�1��M����ff.�H��
��H������Gd�ff.��H���H���ÐUH��AWI�Ϲ0AVI��AUA��ATSH��H��H�G8ǀ�H�G8ǀ�0000f���H�G8ƀ�H�G8H���H��t�@�SP�0ǃǃ
0000f��ƃ����H�CpH����D9kd� D��L�$�I)�I��I�M��u1�A�|$ftH��[A\A]A^A_]�DI�O�H��H�M�����L��L��I�‹C@fE�jI�zA�L�U����L�U�I��H�M�A�D$fH�{8A��L��H����PL�Uȅ�A��uJL���B��H��D��[A\A]A^A_]�H��UH��1ɾ�H�1��u���H���[A\A]A^A_]ÐH�C8H�ߋ��H���H���1��>���L�U���H��UH��1ɾ�H�1�����H���[A\A]A^A_]ÐH����H�����1��ff.�f�1�H��tH�W8H��t
������f�UH��AUA��1�ATSH��H�ǐH��L���dH�%(H�E�1�艸��1�H������1�L���u���H�S81�H����ǂ�H�C8�0ǀ�0000f���H�C8ƀ�L�c8I��$�H��t�@L�c8E����A��$���ub�CP��t3�C@H�{8H�U�I��A����E�H����P����1�H�M�dH3%(��H��[A\A]]�@L�c8I��$�H��PxH�������u�H�C8ǀ��CP���r�����I��$�H�� �t���I��$�L�c8A��$����2����fDH�C8H�ߋ��H���H���1������:�������ff.�@UH��AVAUATSH��H��L�g8H�E�M�����GP�����Wd�������"��H�������H����Hǃ�H�u�1�H������I��H���	H�C8L��I��A���hH�M�L���H���@�����PL��A�����E����I��$����uI��$���HtzH��D��[A\A]A^]�f�����0���H�$U1ɾ�A�H�1�赼���H��tSH����誵��Hǃ�Hǃ������H���p�H��A��[A\D��A]A^]�D��8u$�H�C8H��H����PxH���_�����u�H�C8�CPǀ�H������f.�H�QUI��$��ADŽ$��L�(L�����H�.U��AƄ$�I��$�H�pp�o���L��H��1�AƄ$�1ɾ�A�茻��H��D��[A\A]A^]�@H�����H��H��X�r����CP���f.�H��A�[D��A\A]A^]�f.�H�C8H��A����H���H���1�����H��D��[A\A]A^]��H�AU1ɾ�A�H�1��Һ������ff.�f�UH��AVAUATSH�G8H��H�����P���������CP�������CPH�{8� ��A�Ņ��LL�c8A��$��aA��$|����I��$8A��$�H���I��$@H��A��$����9�t)I��$�H��hH;
�`TtH��p1�1���L�c8A��$�H�߉���������H�C8��|Hǃ��C`[D��A\A]A^]�fD�H���������fDǀ��H��U�A�L� H�G8L��H�������H�C8��ƀ�H��UH�ppH�C8H������H�C8L��H��1ɾ�ƀ�1�����[D��A\A]A^]��ADŽ$�L�c8A��$|��������fD�CP���@�S`L��@I��$���1�L��襱��A��$|I��$�L��轘��H�CXH�����C`L��H�4�H)�H������H��H�CxH�����S`H��1�H)�H��H������ƃ��\���fDH�C8�CPH��A����H���H���1����[D��A\A]A^]�DH�)U1ɾ�A�H�1�躷������DH�{x�d����1ɾ�H��A�H��UH�1��������A���������ff.�@UH��AWAVAUATSH��H��L�g8M���oADŽ$�H�G8A�0A��E��$�ǀ�0000fD���H�G8ƀ�H�G8H���H��t�@A�0H�{@ǃǃ
0000fD��ƃ��H�C8�CPE1�I��$8H���I��$@H��A��$�������D9�t$H���H��hH;
T]Tt
H��p1�1���A��$����ADŽ$�H��D��[A\A]A^A_]Ð�{P�nH�C8�������H�spH��tI�{d��tB1�1�H��yft%�Af�KdH��H��pH��H9�vH�spH��yfu�H����H��pH9�r�H�{@H�C8���SP��v;�����t1�����C`��u1E1�E��tK�CPH�C8���f����tփ�u��hH�������t�H�C8E1�ǀ�E��u��H��葸��A���@�s`���	���I��$�H��PxADŽ$����fDH���X�CP�K���H�!U1ɾ�A�H�1�貴���z���DH���X�CP�}���UH��SH�������H��vV�����v(��������ulH���1�H��[]�@���uPH�H��p1���f.���t[��to�������u�GP������Cd��x1��@H�9UH��1ɾH�1��ͳ��H���[]ÐH�H��w�H�GH1��a���@���1��M�������h1��6����H���1��'���f�H���1�����f�H�H��uH�����@H��1����f.��H�U�����1�H���h��CPH�U�H�Cp����UH��ATA�SH��t@H�G8H��H��tH�8t
��r����H����H��@A���V���H���N���D��[A\]�fDUH��AWAVAUATSH��H��L�g8dH�%(H�E�1�M���hI��I��H���uH���<�I�ź0ƃ�0ǃǃ
0000f��ADŽ$�H�C8ǀ�0000f���H�C8ƀ�H�C8H���H��t�@H�����I��$8H����CP��u}I��A�L��L��I��$��L��P���SH�C8�CPH�ߋ��H���H���1��z����H�M�dH3%(�|H��[A\A]A^A_]�I��$�D�8E����H��������u��H���.���H��@1�� ����C@H�U�I��H�CXA��L��H�C`�H�Cp�E�I��$��P���"���I��A�L��L��I��$��L��P�������I��$��E��tD��u/I��$���HuI��$�H�@@H��t
H��Є������1�����f�I��$����u��L���$f���������I��$��딾L���f������fDH�YU1ɾ�H�1�����q�����H�G@H��H���v
1���1��a����UH��AWAVAUATSH��dH�%(H�E�1�H����L�g8H��M����I��I��A��$pt>L��L��H����������H�M�dH3%(�<H��[A\A]A^A_]�fDI��$��@pt�A��$�u��L���e�����BI���uL�����I��H�C8�0ǃ�0ǃ
0000f��ƃǀ�H�C8ǀ�0000f���H�C8ƀ�H�C8H���H��t�@H�����I��$8H����CP���GI�����I��L��L��L�{@I��$�A�L���P���#�CPH��L�{@�?��u{�L���c����ujI��$���HuYI��$�H�@@H��t	H��Є�u?H������r���f�H�!U1ɾ�H�1�踭�����F���fDH��������XH�C8H��H����PxH������u�H���[����t�H���_��H��I����H��I���9��L��L��L���1�����CP�����fD�H�������toH�������u�H�C8H�ߋ��H���H���1�����i���@H������k���H�U1ɾ�H��H�1�譬����C����H��裥��H��@1�蕥���C@H�U�I��H�C`A��L��H�Cp��E�I��$��P�������.���DH�C8H�ߋ��H���H���1�����������ff.��1�H��tH�GX�@H��t+UH��SH��H��H�?H��t��{H��H��[]�d�@�ff.�@U��H��SH��H��H��H��tH�s�Q3�CH��[]��H�5�	�43H����[]��U��H��ATI��H��SI�$��#|H��H���tH�e��[A\]����H��UH��M��$�I�|$��A�D$L�B(�P1���XZH�e��[A\]�ff.��UH��AVI���AUI��ATI��S���H��t)I�L��H�5�~	L��L��H���ty1�H�H��tH�e��[A\A]A^]�L��L�s�<�����t8�K��u1L���)���L��C�.����L��H����1�����H��M��L�����H�~U�CL�B �P1���XZ��d���ff.�UH�h���H��H�
���H��H�U��~E�H�E�H��E�H�M��X�~E�H�E�E��h]�ff.�UH��L��xH�U�H�u��~E�L�E�E�H�M��X�~E�E��h]�UH��AVI��AUATA��SH��H�� dH�%(H�E�1�H��XHDž���t!H��htH��`t
H��puH��xH����������E�������H��xH�����L��I���X��t!�NfDIc�L��H���1����L��H�������`A��1�H�5�L	H���U1����H����/����H�����E1�E��twL������L��pH�JUL���H��DH�1UH�
|	H��E1��A�H�1��w���1�H�5#L	H����0H���>/H�������hL���)�D��H�M�dH3%(��H�� [A\A]A^]�H��U1ɾ�H�H��1�A����H������fDL������H�����A�L��pH�_UL��H�߉�1�H����1�H�5aK	H���0H���|.H������9�����f.���ff.�@f�H�G G����H�D������p��D����7�p�w�p�G$�w��
�����v!�H�O�H�O�H�G$�O�9�v)�P�H����P	�@
������H�H�G���D�G �pD�@�H����A�A�4�H�G$���H�p�O��vD�I�HB���O�H�O�@�GH���g���@�ff.�@UH��AWI��AVAUI��ATI��SH��H9�s*���H���I��M9��kI�E�DB u�M9��VE�M1�A��-��I�M9��II�M�A�<	�9I��������L��1��0H�N�QЀ�	w1L9�wn��H�<�H�ރ�0H�Hc�H��H9�wSH�^H�D�I9�u�L��L9���A�$����A��-��I��H��y3A�$"H��I���������@A�$"I��L9�uA�$"I9�v'���H��f�H��L9�tH��DB u�I9�tA�$H��L��[A\A]A^A_]�DI��L9�t9H��xH��I���@A�$"H���A�$"E1��L��E1��`���I���`���I���P���H�H9���L�A�A�<	�tUI��H��AVAUATI��������S1��9�M�JA�A�<	�'M9�wZA��K����0H�H�H��H9�wBM��M�BN�\�L9�u������D��I��E1�I9�v6fD�A�[A\L�A]A^]�@A�D��L9�tڿ����I9�w�I��F�A@��L9���	ǸA�u�A�8:u�I��I��I9��fI�x�G�<	�VI��������L��E1��,H�{�G�<	wZM9�wO@��O����0M�H�H��I9�w7L��L�CM�\9�M9�u�D�ؿ����I9�v9�A��,���@E1��6���A�D��M9�u���1��A�H�:�f�L9ƉA@��I��;��	ǸA�����A�8:����H��I��H9���I�x�G�<	��I��������I��E1��/I�{�G�<	wNM9�wC@��O����0M�H�H��I9�w+M��M�CM�T9�M9�u�D�п����I9�v'�A��L���A�D��L9�u���M��1�����AI��;�E����H�A1�L9��	���A�8.�����I���L)�H��HO�I�3I9��I�x�G�<	�I��������M��E1��8@I�8�G�<	��M9���@��O����0M�H�H��I9���I��M�L:�L9�u������I9�w[L�IH��wH��u	��L��L�IH�
I�I9�r�I��I9�tA���0<	v�1��%��������I��1����A��1�L�I�����"M9�t!�����I9�w�L�I���z���1�����1��ڸ����I9�w�L�IM��1����E1���f.�H�B�H��t H��H�H�fD��H��H���u��fD�Fd��H�w@������������������H�
D�AE��D�AA��A��E�D�IE�D�IA��G�D�AI�� E��D�AA��A��E�D�	�IE��D�L�GL�I�E1�8GetH��?I��H�GD�H2����u3L�H�OE�D�1�8Get
H�G���H�G�H2�f.�H�G@H2�@L�H�OE�D�L�H�OE�@D�AL�L�_E�BE�
A�JA��E���E�	A�J��D���A�KL�L�_E�BE�
A�JA����E�E�	A�J��D���A�K1�8Ge�I���H�G����;����L�A�HE���D�L�GA�L�G��A�H1�8Ge����H�G�f�����f�UH��AWI��AVAUI��ATSH��H)�H��HdH�%(H�E�1�����I�����5kLc�Hc�1�A�EL�������6L��L����1�BƄ%����H�����A���tA�EH�E�dH3%(u-H��H[A\A]A^A_]�f��5�A�5���f�UH��AVAUI��ATL�$7SH��H�}�H���-H��L9�sO�0�H��H��H�]�L9��H��DP u�I9�w�DI��I9���I�T$��DP u�L��H)�H�����;-H�{�9A�E I9��z�C<:�‰�<-��H�C��t(�����:��H���΀�-������I9�u�I9��ZH��B�<	�KI��������I��1��1f.�L9�����H����0H�H�H��H9���I��I�xH�t�I9�vI�P�B�<	v�1�H9��������H9���A�u����I9���H��'���?-��H��H)�H��uH��FɃ�d��lA�UI��M��M9��{H�O�QЀ�	�jH��������M��1��Bf�I�I�QЀ�	�gH9��,��H�4���0H�Hc�H��H9��M��M�QH�|�M9�u������H9���A�}M9�A��H����A���A�:-��I��L��M9���I�z�WЀ�	��I��������L��E1��3H�y�w�@��	��M9�ww@��O����0M�Hc�H��I9�w^H��H�QM�D:�H9�u������I9�wXE�EI��wNE��uIH�U�I9�t	�: ��A�EI�EI�EA�E$�8A�I9�u�f.�A�E f�A�E$����AEAEH��[A\A]A^]�@���d���H�}�L��H�U�L��H)������u�I�EA�EA�E$H��[A\A]A^]��A�E H�}�벸"�~���H�yL��H�U�L��H)�H�}��!������I���A�}�>���A�E$�T���I9��(���H��PЀ�	����H�p�I��1��4����"M9�����������H9����A�}���������D1���@UH��AWAVAUATI��SH��H��H��(�{`
�E����C`H��l	Hc�H��f��{eN�,&��L9���H�u����H�}�H���H��L9���H�H��DA u�L9�����0��	��H��������I��1��?�A�$�B�<	��I9����K����0H�H�H��H9��H��I��L�t�M9�u�E1��Bf.�H�U�J�4&��D�M̺E��u�{e��H=���H�K�H�S�H�C@H��([A\A]A^A_]��H�U�J�4&�[�D�E̺E��u�{e�#H=����H�K��H�S�H�S�bH�C@H��([A\A]A^A_]��H�U�J�4&��}̺��u�{e�������H9���H�K�H�S�����H�S�J��H�S�����JH�S�BH�C@H��([A\A]A^A_]�DH�U�J�4&�c����M�H�C���H�Cf�H�C@H��([A\A]A^A_]��H�U�J�4&�#����U�H�C�Z����H�Cf~H�C@H��([A\A]A^A_]�@H�SL�����H��([A\A]A^A_]�DH�CHL9�w/H�4L�H�S@H9�rwE1�I9�s
H�CB�(H�S@H�CL9��H�L� H��([A\A]A^A_]�L��H�U����u�I�ƅ�A��H�CD�8H�CL�0H�C@H��([A\A]A^A_]�M��I)�H��t�I9�H�{IF����H�S@�h���@�������H�H9����F���H���H����������f.�H���H������X���f.��E�"A�I9�tLM9�s3����H���I��M9��#���I�$�DB u�M9�����A�����I��E1��E�"A�M9�r���fDE1��UH��AUI��H��ATSH��H��� ��H�3L��H��I���d���L#H��[A\A]]�fDUH��AWI��AVI��AUATSH��H��L�oH��dH�%(H�E�1����A�OpI��A�F`������H��g	Hc�H��D��H��L����E��L#H�E�dH3%(�,H�e�[A\A]A^A_]�f.�D��H��P���H���>�I�V��P����I�V�b�f�D��H��L����I�EA�E�{���DH��P���D��H�����A�Gp��
�Av/������t&�E�1�L�m�L��L�������-������u�A�Gh��t������'�2��d���L�m�D��T����<D��P���H�
�g	�L��P��`���P��\���P��X���P1��p��H�� Hc��u���@A�Gh����������'��H��h���H�����DP��d���H�6	L�t3	QL�m���p���H�
7g	P��`���LD¾D��\����<L��P1�����H�� Hc�����D��X���H��L�m�D��T���D��P����<�L��PH�
�f	1����^_Hc����fD��p���H�g5	L�m�D��\���L��2	H�
�f	�<L��LD���d����P��`���P1��3��Hc�XY�:���f�Hc�H�f	�4�H��h���H��1�H��D��T���D��P���P��d���QP��`���P��\���P��X���L�m��<�PH�
Cf	L��1����H��0Hc����DHc�H��e	�4�H��h���H��1�H���_���H��h���H���������i��������UH��AUATI��SH��H��XdH�%(H�E�1�f/�e	����\	f(��%A\	f(�fT�f.�w+�{`
H�K�=�C`H�7d	Hc�H��f.��H,�f���%�[	fU��H*�f(����fT��\�f(�fV���~%Pe	f(���[	�-�[	fW�f(�fT�f.�v3�H,�f���5�[	fU��H*�f(����f(�fT��\�fV�fW��3���fD�{e��^[	f/����H,�H�H�SH���H����f�H��H	��H*��X���f��,���{e���f��*�f.ȹH�S��E��H�C@�H�E�dH3%(� H��X[A\A]]���{e���H,�f���H�S�H*�f.����E��H�C@�D�,��{ef�H�S�s��f��*�f.���E��H�C@�Z���f.��Z�.�f~�H�S��J��H�C@�'����A�|$h���H�{@+�+HFs@�L������1�L����EA�D$d@tYI�|$8H9�����H��+����I�tH��L�H��������M�d$8�,L��H�������0L��H)����L��H��L��H���K��v���fD�H,�H�H�Sf��H*�f.����E��H�C@�=���D�,�f��*�H�S�i������f��*��������f.�L������1�L���_?����f.��\��H,�H��?�V��������UH��SH��H��H��`H�t H�E��E�����H�H��[]��H�WH�H�G@H�H��[]�ff.�U(�H��AUATI��SH��H��XdH�%(H�E�1�/�a	v��a	(��%�a	T�.�w,�ZɃ{`
H�K�
�C`H�`	Hc�H����,�f���%`a	U��*�(����T��\�(�V��f.�W
a	�a	�%a	(�T�.�v,�,�f���-a	U��*�(����(�T��\�V��Z�fW
�`	�A�����{e��/�`	�y�H,�H�H�SH����H����f�H��H	��H*��X���fD�,���{e����f��*�f.ȹH�S��E��H�C@�H�E�dH3%(�H��X[A\A]]���{e�v�H,�f���H�S�H*�f.����E��H�C@�D�,��{ef�H�S�S��f��*�f.���E��H�C@�Z���f.��Z�f�H�C@�;���A�|$h�Z����H�{@+�+L������HFs@L��1�1��AA�D$d@tYI�|$8H9����H��+����I�tH��L�H���������M�d$8�,L��H�������0L��H)�����L��H��L��H���"����D�H,�H�H�Sf��H*�f.����E������D�,�f��*�H�S������f��*���������f.�L������1�L���?;�	���f.��\D^	�H,�H��?�u������@UH��SH��H��H��`�t�E��E�����H�H��[]ÐH�W�H�GH�G@�H�H��[]�UH��AWAUATI��SH��H��H��0dH�%(H�E�1��{`
���C`H�i\	Hc�H��@1�H��y8Ke��H�S�H�CH�8H�C@fDH�E�dH3%(��H�e�[A\A]A_]�H�C@�8�{euH��H���H�C�ˆH�C@�DH�S�LjH�S�b�{euH���H����H�C�ˆH�C@�v���fDH�C����@�8H�C�P��H�C���P��H�C���P�{e�������H9���H�C�H�C@����DH�S����H����f��H*��E̋E��E��%\	�A\	(ȉT�.�v,�,�f��(��%%\	U�(��*����T��X�V��M�.������E�/�[	���\�[	�H,�H��?H9����1����H�S���|H����f��H*��E�H�E��E��R	��Q	f(�H�fT�f.�v3�H,�f��f(��%�Q	fU�f(��H*����fT��X�fV��M�f.��Q�K�E��
vQ	f/��*�\��H,�H��?H9���� I�|$8�ICD$8H��H���H)�L�l$I����L�����
�)L)��A�D$d@toI9T$8I��MC|$8A�D��H9K@wL��H�����H�CD �����I�|
I�tH�M�H�E��A�H�E�D��L��0)�����H�M�H��E1���f���P	�lP	�H*��E�H�E��E�f(�H�fT�f.����M�f.�zu�E��H,������H�C�H�C@�h������H�H���H9��������f��tY	��Y	�H*��E̋E��E�(ȉT�.�w-�M�.�zu�E��H,����f�����fD�,�f��(��%5Y	U�(��*����T��X�V��f��H,�f��f(��%KO	fU�f(��H*����fT��X�fV������H��H��f�H���H	��H*��X��
����H��H��f�H���H	��H*��X��-������f��`��UH��SH��H��H��NdD�@�P�� ��E��D�@A��A��E�A��P��D�D�@H�� E��D�@A��A��E�D��@E��D�H��/���H�H��[]�@���fD�G`��t`��	t[UH��SH��H��L�
A�IE�A�A��A��A�A�A����NdH�Ѓ� H�HD����H�H��[]����~�ff.��G`��tH��
tCUH��SH��H��H��Nd�B���Ѓ� ��H��HD��R���H�H��[]�����fD�`t:UH��SH��H��H��Nd��� H��HD�����H�H��[]�f.�����fDUH��AVAUATI��S�~l?H��t)H�����H�3L��H��I�����L+[A\A]A^]�@L�7H���U��I��I�H�I�T$HH�4L�H9�r;E1�I�T$@L9�vA�D$`=�tJ=�tCI�D$L9��L+[A\A]A^]�@M��I)�I�T$@H��t�I9�I�|$IF��O���DI�D$B�0I�T$@��H��g]1��H�5��H���H�H����H�
g�H��H���H�����H�BH�'���H�B0H��8H�����H���H�BHH���H���H�5���H�B`H�
�H�BxH�����H����B H�B(�B8H�B@ǂ@HǂHǂ�Hǂ��BPH�BXǂ�Hǂ��BhH�Bp,ǂ�Hǂ�,ǂ����Hǂǂ�����Hǂ
H�� H���H�5����H��`��(���H��hH���H���H���H���H���H��xH��PǂX����Hǂ0Hǂ�H��Xǂ`����H���ǂ�����H��pǂx����H���ǂ�����H���ǂ�����H���ǂ�����H��hǂp����H���ǂ�����H���H��H�BH�� H��8H��PH���H��\H���ǂ����H�
�B����H��ǂ����H��(ǂ0����H��@ǂH����H���ǂ�������f.�@U��H��AWI��AVI��AUATI��SH��H��H��LD�H����H������D�h�E�I9�rbH��ID�H�����I�$H��tz�M�I�L$M��tL��L��H��跾��H�]��~E�1�L�u�E�AD$H��[A\A]A^A_]��K�D5�1�I��I��H���DA��E��t���fDH���[A\A]A^A_]�@H���UH��AVAUATI��SH��H���>���H�;I��D�pL;swA��L��L��L�k���1�[A\A]A^]�H�K1�I�D�H��H��H��H��t.H�C���H��H��H��u���H�G1��DH�KH����ff.�@1�H��t
HwH;ww�fDU1�H��SH��H��H�OH�D�H��H��H�CH�?H�����H��H���H��[]�ff.�UH��AWAVI��AUA��ATSH��H��(H�GH�U��M�H�tH�E��m���H�U�����A��H�CH�3�M�H�xH�{�H����L�U�E1�1��#@H�CH�3H�xH�{D�$A�GI��H9�saE�$E8�tA��\u�M��tH�CH�3I��H�xH�{�\�H�u�H��H�U�D�M�������uHL�U�H�U�D�M��f�H�CH�H�HH�K�M��H��(D��[A\A]A^A_]��A����UH��AVI��AUATI��SH�WH��H�?J�"H;Cr+H�s1�H�H��H��I�����H��H��t;H�H�SL�kH�L��L��袻��H�LcL�cB� 1�[A\A]A^]�����f�UH��ATI��H��SH���{���H��L��[H��A\]�I���f�H�H��t(UH��SH��H��H������H�H��[]�fD�ff.�@H��H���H���N�L�@���tL��H9�u���f����t1���uT��tm����f��uK������u�����u������u������u����u� �D��D�1��������DU1�H��AWAVAUD�oATSLcNE9��jE�Q�L�H�1�Ic�H��M�H�A�D�3D�`D��A��A��E9���A��E1�E1��I��A�P�D�	H��I��L�I�ԉ�L�I�� I)�L��D�I�H�� ��I��M9�s�D�#H�E����H�S�H9�v"�[���t�@D�
E��u
H��A��H9�w�D�WL�E��LcNE9���I��J�	M���H9�vI��H��A�9t�rqD�x1�@I��A�p��H��H�H)�H�‰A�H�� ��M9�s�H�Ic�H��D�E��u/H�A�H9�v"�q���t�fD���u
H��A��H9�r�D�WD��[A\A]A^A_]��x���D����DD�oLcNL�E9��0�����f�UA��H��AWAVAUI�Չ�AT��I��SH��(D�w�G�OA�E�~A9�~
���A9����!Hc�I�D�H�XH��tH�H�H�7��I�]��<���Hc�H�;I;E��I�E�K�sL�CH�CL���~.�B�L��1�D�M�H��H��H�M����H�M�D�M�I��I�I�4$IcD$H��A����A� 1�E)�D�D��I��H����D��	�A�@��~���H9�wޅ�A�8EE�D�sM;erkM;eseIcD$��I�D�H�PI�$L�`H��(H��[A\A]A^A_]��D�M��u��UĉM��.���D�M��u�H�ËUċM����f�L��踹���fDH��I�xH�FH��H�H9�H�~A��I9�@��A���H9�A��H��@��A����H��H��H9иHG�1�H��H��H���oAH��H9�u�H��H��H�<�H�I�H9�����A�H�FH9������FA�@H�FH9�������FA�@���DL�ǥI��H9������L�ǥI��H9�r����ff.�@UI��H��AWAVI��AUATSH��Lc_LcVE9�|D��I��Mc�I��Lc�E1�C�A9^A��EnA��$Ic�H��L�`M��tI�$H�P�Df.�A�D��L�bA��B�<���Hc�I�<H;B�4H�BE�l$E�|$Lc�M�D$I�D$I��M�$O�<(M9�vLL��L��L�M�L)�D�U�H��D�]�H��H��I�D$I9ǸHB�1����L�M�LcU�Lc]�I��M�	M�6O��O��M9�r�\I��M9�vII��A�y���t�L��L��1�H���A�D�:H��H��L�H�H�ƉB�H�� I9�wى2I��M9�w�M�<$M��~"A�O�I�G���t�DH�����u��u�A�\$H��L��[A\A]A^A_]�f.�L�M�D�U�D�]�����L�M�LcU�I��Lc]����ff.�UHc�1�H��AWAVAUATS1�H��D�gL��A��H��H�H��A��H��H�� A9��I��H��tD;g}+M�uIc�A��A��E�eH��L��[A\A]A^A_]�fDHcGI��I��D�pA����H��L�h M����I�UH�P M�uI�EI�pM�uIc@I�}L�E�H�����L�E�M;r1M;Gs+Ic@���_���I��H�PI�L�@�G���f.�L��蘵��M�u�0�����D��M�o��<���Hc�I�D=I;GwI�GE�uA�U�J���L�E��U�蕶��L�E��U�I����f�U��H��AWI��AVAUATI��S��H����������H�E�E1�L�5q�T���u&�toE����H��TI9���I����t�L��L��L������M;<$��M;|$��IcW���
I���H�rI�7L�zI��u��H�E�H��t0I;$��I;D$��H��Hc@��I��H�PH�H�HH��L��[A\A]A^A_]�D�2���L��L��L��A��^���I������fDL��L��L���B���H�E�M;4$rHM;t$sAIcF��XI��H�PI�L�pL�u�����L��H�E�贳��H�E�I������L��蘳��L�u�����I�����L�u�����H�}��g����#���f���H�6D	H��4�L�����I���5����UI��`H��AWAVA��AUM��ATA��SH��(H��@���H��0���H�pL������~����H����H��H�ʹH�����1�fl��H�fH~�L���H�� )�0���fօ���A����y$A���fH~�L�ȉ�H�� H	�H������D�ȉ
%�=���
�����f�f.�zHuFH�����H���A�0I�EL�����fE�]H�H�����H��([A\A]A^A_]�I�E �����D��E��H��8���L��M�UfH~Ɓ�H�� M�Ufo
�C	H	�f~�(���
A��AMD�H�������,������$
H��,������,����A�E�� A�UE���V
H�ٺ5E�����A��H�� )‰؁�H���?H�� H	�H������~����Dž���f���\mC	f��A*��Y
tC	�Y\C	�X\C	�X�f/��D,�����D)��p�A����
Ic�H�=B	H������������f/��o
Dž��A��1Ʌ���
�E���W
E��D)�D�����E1�A��A����������D�D�@������E��D������AO��G��H�L��8���L�����L�H9�@����nH��8���A���FH������������������(��H�7A	����������Q���f(��^-B	����@����A��A���A����A��A��t|A����A��A��tiA��t�Y
�A	��A��A��tOA��t�Y
�A	��A��A��t5A��tf���Y��tL�8@	@��t	�AYH0��I���u��^�D����E��t�
6	f/���f���*��Y��X
zA	fH~�fH~�H�� ����@H�� H	����������7�����D�����������H������,�f��A�x������Hc�L��?	�
A	�A^�H������\��*Ѓ�0H�{��\�f/��9�%[5	f(��\�f/���A��tTA�@���@	L�D�Y�f��H���Y��,��*؃�0�G��\�f/���f(��\�f/���L9�u�f֭���E��xHc�������"
������6A��3)Ӆ�H��P���AE�H�����D��H����H�H��P���H�����H�G�GH�H�H�G��~��~9ˉ�N�A)�)�)�E����H�����D��H�����D�������������H�����L��H��H������S�L;�0��������D�������L;�@�����IcU���WH��H���8���L���8���I�uI��@H��P���H�����H���H�H��P���H�����H�G�GH�H�H�GE���cH�������H�����u(H�����H�� ��tA����E��A����C���L	� )ƒ����)�A���E��~!H�����L��D�Ɖ����������I�Ņ�~(H�����H������މ�����Y�����H�������������H������CA9E��Hc�I�uH��H�H�fDH9�sdH��H���9t�sTH�����L��
���������H����H�����H�ھ
I���p����H�����������������A��uD������E���$���eL�����E���v������H�������H����H�\H�����H������H�����L���y�A�}��������0������HcC)lj�����u6I�UH��H�H��H9�sH��H���899t����������H�����IcD$�w�����)��SH�H��H�4I$�f�H9���H��H���89>t���L�����M��@A�N����Hc�H��H���8���H����H�H���8���H�w�W1��GH�7IcFM�M�I��M�4�IcGM�<��f�L��I��A�J�I��A�A�L�^H)�H)�H�ʉ�A�K�H�� ��M9�w�M9�v;M��L��H���N�I��H)�H�ʉ�A�I�H�� ��I9�w�I��M)�I��K�43��uf.�H��D�A��E��t�OD�G���)E�}E)�u?I�EMc�I��J�L�
@H9��7I��H��A�092t�A������DB�D��H9�0����YH9�@����LHcG��H��H���8���H�H���8���@�����H������L�w	��1���������2	��*E����������A�F�L9�����-H�����L��
�A�I��L9��EL�����H�߾
L����L��L���
H����I��L��������@H�����'�=���fDH��(���������l��,���� )����狍(���	��� A�M�D����ꉕ,���1Ʌ�A�U����A�ME���������Hc�D�����A�D��������0������u������u������u������x���@� D�)�E�A��2�� ���@)�A��A����D	�f�A���H*�fH~�H�� ���f~�H�� H	�H������~����Dž��������Dž��1Ʌ�x,D�D�����E1����fDDž��1Ʌ��t����1�)��f���fDH�����D��D�����������������D������H�����H�������H�����uH�����H�� ���i���E1�H�����HcPH��T���������1����u������u�������u���������@�p������)� ����������%������������f.��H��8��������H�L�L;�@���wyL��8����O�w�'������I��M��1�����D�A������H�����H�߾
���H��I�������1����f�H�lj���������������覥�������������H�Nj�����Z���@f���A*�f.�z�*�A���!�f.�I��M��� ���M��L����������E����A�D$E��D��D��������D������H��x�@Hc�������D������D�����D�������������������������D������H�����D�����D�����������������7�fDH��H���H���
H�H��H���H�G�GA�H�H�H�G�6������(���A�U��,������� )����M���f.��1�����@�A������f���*��Y��X
;5	fH~�fH~�H�� ����@H�� H	�fD�\5	H����������f/��fW
�2	f/��v�A��H��0���H�����D�����DI9�rKL;�@���sBIcE��H���H���I�ED�����H��������H���H���@L�������fD���H�=	3	��A��A���Blj���Y��;�����
4	�����Y����A�@�������A��Y
�3	��@���
���A��Y
�3	��@���\
���A��Y
�3	tk@����
���A��Y
^3	tL@����
��f��A��Y�t-L��1	@��t�AYH0��A�I���u�E�����f(����H��1	��E���P	���������B	�"����Y3	f/��������HDž���E1�H�����������1H�XH�����H��0�����M�����L9��L;�@�����IcD$������H��H���8���I�$L���8���H��0������E�}A�EH�����A�MH�����E�wA9�~D���A9�������H��8�����<���Hc�H�48H;�@�����
H��8����H�PH�xH�@H�8IcUI�uL��1҉�D�H��H���	ʉW��N���I9�w�ɉEE�D�xL;�0�����L;�@�����IcU��%H��H���8���I�ML���8���D�xf�H�����HcWA)�E���YH�0H��H�H�f�H9���	H��H���:99t��fH������f.�H9��H���K�H�S���9t��
H��0���I��H�����H9���H9�@�����H��Hc@��H��H���8���H�H��0���H���8����M�������H�����H������I9������H9��MH9�@����@H��Hc@�������H��H���8���H�H��0���H���8����u���Df(Ÿ��f�H��8���H�����H�� H;�@�����H��8���H�����H�H�x��A��Dž�����Dž����A�����L������H��0��������Y
\/	���1������[����Y
B/	���%�f(Ÿ��Hc�H��H���8���H������H�H���8����0����Y
/	�����H�����H���������H������z�E�d$A���~Ic�H��H���8���H���fH�H���8���H�����H�CH�CH�{H�HcFH��H���"���D�{�C�KE�wA9�~����A9�����EHc�H��L���8���M���-I�$H���8���I�D$I�t$I�4$HcCH�H�<�1��‹H��H���	ЉF��Q���H9�w�҉EE�E�|$H;�0����wH;�@����jHcC���g�H��H���8���H�H���8����K�@H�Ӏ{�0H�S�t����L��H������D������������H�����������D�����I���&�� D���������������D�����������H������L���fDH�����蔚��H��0������H������|���H��0����P���L��H������a���H�����D�x���HDž������D������E���r���D������E���B���,	��f�ɋ�����*��Yƒ�������Y��X
,	fH~�fH~�H�� ����@H�� H	��!�D������E���@H�����H��������A�UH��H������@)…��Hc�I�MH��H�H�fDH9���H��H���9t���L���������)lj��� ��H��8���H�G H;�@�����H��8���H�H�G���������I�EH��������uA�}�0E���'E�EA�EA�ME�xA9�~f����A9������Hc�H��H���8���H����H�H���8���H�{H�C1�H�;I�u��IcEH���H��H���	ʉW��N���H9�w�ɉEE�D�CL;�0����lL;�@����_IcE��H��H���8���I�UL���8���D�CH������GA)�E����Hc�H�H��H�H��H9���H��H���:98t���I��������H�����L��H��0����I���H��8���H�����H�� H;�@����H��8���H�����H�H�x���H�����������1��������f��H�����f(�H�_�^��,�f���*ɍA0��Y��\�f.��{�������L������H������_)	��H�|�DH9��"�Y�f��H��f(��^��,�f���*ɍA0�C��Y��\�f.�z��������*���A��H�����D�����L������"��������8���D������9H�������������H�������L��H��0������������H��0���H���������������f(ȸE1��c�H���ە����A�D��H��8���A��B�<���Hc�H�;H;�@�����H��8���D�cD�s�_����L��8�����<���Hc�I�<H;�@����cH��8���A�L$A�T$�������������H�_�<9��H�����H9����u�)@H9�t#H���C�H�S�<9t��H��0������H��H�����������0�C��Չ���������� ��������������U����������/��������H����H���X�f/��M���f.�zu	���<���H��0���H���7�I��H����L��H������9L���������� 艕��H�������x���������9t�������I�݃�1�������[���H�������������9t���������������1��N�L��H��0������������L��迓��D�C����H��8�����<���Hc�H�;H;�@�����H��8����K�S���I������J�� D������D����������蘔��D������D�����H���������������$��b���6��U��Y���H���d��������������@�������������I���������������������D��������������������D�����������H�Ë��������f(���m�H��H���r���H��0����9��s����h��<)‰����UH��AWAVL��`�A��L��X�AUM��I��H��T�ATH��P�I��S�H��dH�%(H�E�1������P�L9�I��A��I��`L9���A	���'��H��X��T�L��L)�A�υ�t
A�$-I�T$��������D�QL�Ƹ��xL��D9�t-��H���~�L�Z@�:A9�~�9�uۍx�B.H��D9�u���9����sD�S�A)�9�DO׉�)ǃ���9���H�zH��H��~�H�H��H��H�D��fo#	��fo#	fo
#	H���H�H�f�fo�H��f��f��H9�u�D�����fI~��H�A9���L�z�09���L�z�B0�p��L�z�B0�x9���L�z�B0�p9���L�z�B0�x9���L�z�B0�p9��~L�z�B0�x9�|oL�z�B0�p9�|`L�z	�B0�x	9�|QL�z
�B	0�p
9�|BL�z�B
0�x9�|3L�z�B0�p9�|$L�z
�B0��
9�|L�z�B
09�|	�B0L�z�E�����Ⱥ)�H�A)�9��PA�.I��E���L��AO�A��~}I�WL��H��~�H�H��H��fo_!	��fod!	fo
l!	H���H�L�fDfo�H��f��f��H9�u��fs�����A)�L�9��	L�x�0A����L�x�@0A����L�x�@0A����L�x�@0A����L�x�@0A����L�x�@0A��tL�x�@0A��tqL�x�@0A��tcL�x	�@0A��	tUL�x
�@	0A��
tGL�x�@
0A��t9L�x�@0A��t+L�x
�@0A��
tL�x�@
0A��t�@0L�x�A�M��tA�EE��tL�����L��L)�H�M�dH3%(��H�Ĩ[A\A]A^A_]�f.��0.L�Rf����ھ0L��L��0��D��?�L�ZH��@�L��L��H��ʈ��L��H�H��@�D��?�L��0�J��������I�����f�E��������"���f�E��tL���#����0�fA�<$M������A�E���������L���fI~���������ff.�Uf(�f�I��H��AWAVI��AUATLc�SL��I�H��dH�%(H�E�1�1�f/���)Éރ�t���N�L��`�f(��L��@�H��P�L��X�M����H�H��T�H��L��(�H��0�H��8�����D��P���H�L9�H��I��`L��@�A��H9���A	�A��'��M��tA�H��X�A�wbE1�H��H)ρ��A�wA������@��@��E�T1E���b�wA9�AM�9��A9���A9�@��@��E����)�9���A9�~D��M��tA�E��tH����H��C���D��P���H�D)�M��L��(�H��0�H��8��f(�������X�H��)�L9�A��I��`L9���A	�����D��T��P�E����M9��A�-I�v����I9��Å��2���*I�ɸ�L��D�XD9�������D��I��L�VE�Y�M9�D���9�u�9�~DŽ�t�L�V�F.M9�L����볉�A�D)�E)�����H�A9��PE1�1�;�H��A����~���E�O�D��P�E���E1�A�r)�1���@��)����9���E��tH����H�踉����H�H��0�M���f(�H��8�L��(��H����P�H��H��X�A���)�A����I��`D��P�H9�A��L9�@��A	�T��tM9��}M�^A�-�M��M9�sY�H�qI�{A���~(I9�v#I�{A�C.H9�sI9�w
�H9�s�I9�w�L9�siL�_�eM9�v
E��t�G-L�_A��c~YM9��M��L��M)�E��tH��袈���H�M�dH3%(L���)H�ĸ[A\A]A^A_]�I��A��c�fDA��	�&M9�s�D�Ⱥ����I�[������A)�A��0E�I��M)�낐E��tH��L��H�����L��H�A�0A�fE�M���]���A��T���A���E)�A�D��P����f�E�JA9�A��A�����@M�����D�Ⱥ��QI�[����B0k�dA�A)�I9��Q��������D��I�������0A�S�����DA�A)�L9�A��I��`D��P�L9�@��A	���M9��w��������D��I�������0A�S����f�1�M���0���A��'���@��A9�������H����I9������H���C�0�T�)�9�}�����A����������	E��������������1����@���D)����
���DA9�@��A�����@�������T���f�I�^A�0A����DL���x���L9�svH�F�0����I9���H�F�F.��t+I9�w�DI9�tSH���@�0��u�DžP�H�ƅ���I9��}1��'����L���������������I��f.�M��L��M)����f�A9������A����������p�������A��k���蛄��I���H�ƅ��D���I��H��M)����f.�UH��AWAVAUI��ATI�ԉ�SH��H��HdH�%(H�E�1�L��������~�����H����������������������e�&��f�6��d�5��g�4��h�3L�
G	H�X�TL�C�L��1�H���H�4�TH�1�蒕��M��tL�����H�}�dH3<%(H����H��H[A\A]A^A_]�E1��D�C9�rq����L�
�	9��u���H�C@H��tL������L���L���Ѕ�uGH�������H�=��\�8��H��tkH�o>]J��H�J���Z����L�
Q	�
���M������A�Ic�H��	�t��[���A���A���A���A���H�CHH��t��L�
	���菂��ff.�@�=Q�\��UH��AVAUL�-�=]ATSM��M�uI�$H��t&�H�CH�@HH��t��H�{H��tX�s��H�H��u�I��M9�u�f�H�=��\1���\A)EA)EA)E A)E0�%6��[H�=M�\A\A]A^]�q����H�H��u�I��M9��q����f��ff.�@Uf�H��AWAVI��AUI��ATSH��(�=f�\E�H�E���H�=Շ\谄��A�EM�}������e���f�
��d���g���h�"L�E�1�1�L��L�����I��@H�=q�\�|~��H��(L��[A\A]A^A_]�f.�H�i�TL�FL�
o	E1�H���H�@�TH�1�螒���@1�H�<]H��M��u	�4@H�H���b���L�cL��I�|$�#�����u��b���f.�H���5���L�cM���B����#���D��f���f���p���fD��`���fD��P���fDUH��AWAVAUA��ATI��SH��H�=�	H��(������L������dH�%(H�E�1�����0ǃ�I��H���ǃ�0000f���ƃ�H��t�@�=O�\��H�=ʅ\襂��E����H���H���LL�M���@��H�U	�PL������L�9	1�ATL����{��H�52	L���`���ZYH����L�������I��H����H�5]	H���
���I��H����E����D9(�oH�pL���C������L������H��L��L������������H�=ل\H����{���I�L�-	H�=��\��{��H�ΕTM��H���H���TH��M��1�H�1�����H�U�dH3%(H���ZH�e�[A\A]A^A_]ÐM��L�
�	ME����DH�a�TL�
k	H���덐A����A��e��A��f��A��d��A��g��A��h�8�����H��8]L�<�M��u�M�?M������I�GL��H�x������u�L�-	���@L�-	L���qz������@H�pL���������A���t<��e�%��f�&��d�'��g�(��h�D����f.�H�)8]H�L�,�M��u����f�M�mM������I�EL��H�x�3����u�L�-U	�J���L�-v	�;���@M������I�����������x��I�����1����f�����fD����fD��~���fDL��L�-�	�1y�����@��V��������������������{���UH��H���L��p���L��x�����t )E�)M�)U�)]�)e�)m�)u�)}�H�EL��8���Dž8��� H��@���H��P���Dž<���0H��H����:������Uf�H��AWAVAUATSH��H	dH�%(H�E�1��=ځ\�����HDž���t.1�H�]�dH3%(� H��H	[A\A]A^A_]��H�������1�H��L�%	�H�H�=��\�~������H�=(�\��,��L�-�5]f�H�=р\�B�\A)EA)EA)E A)E0�}��L�J�TM�:M��M����L������HDž����A����*��e����f����d����g���h�
L�
N
	H�_�TM�G�H��H���H�=�TH�1�蛋��I��M�>M���s���H�=�\�w��H�=�
	��z��H��H��H��u����H��H9��}����:u�H��A������x���I��I��f��;L����s��I��H��t#�L��1�D��H��1�M�l$�q������H��1ɺ����L��1��T���L���y���	�����E1��A�G9�������M��9�����I�G@H��t>L�����D������1�H������L��L���������L������D�������������H�������H�=	\D��������-��Lc�����H���}K�T�H�K�D����M���J���A�Ic�H�5�	�T��7����A����A����A���A���I�GHH��t��L�
A	�����w��@UH��AWI��AVI��AUA��ATSH��������eth��ftc��dt^��gtY��htTH��T�=>~\H���H�АTH���L�
�
	M��L��1��E1�����H��L��[A\A]A^A_]�=�}\�A��e��A��f��A��d��A��g��A��h��H��D��L��L��[1�A\1�A]A^A_]����I��L�
	�1�苈���1��=x}\��H��1]H��M��u
�0�H�H��t�L�cL��I�|$�y����u��+���fDH���n���L�cM�������\���D�뗸됸뉸낸�x���H���TH���H�u�TH����DUH��AVAUATSH��dH�%(H�E�1�H���~�?I��tvI��H�5�I���,o��H��tGL�5�|\I�H��txH�CXL��L��H��H�M�dH3%(H����H��[A\A]A^]�L��L���u��I��H��u
D1��@��Fw��H��H��t5�L�`�f�H�����d1��]���H��I�H���f����p���L���!t��1ɾ�L��H�X�TH�1�趆���H�����t��ff.��UH��ATSH��t���t=��tA�����[D��A\]�f.�H�i{\[A\]H�H�@XH�@���H��H��s��H��A���u��D��[A\]ÐH��t���t,��t������f�H�	{\H�H�@X�`�H��_x��ff.�@H��t���t,��tH�������H��z\H�H�@X�`�H�I�Ow��ff.�@H��t���t$��t1��@H�qz\H�H�@X�` �H�R�x���UH��AVAUATSH��H��pdH�%(H�E�1���o��L�3I����k��D� M����E��uFH���T��H��H�HhH���TH�1�A�VPH�E�dH3%(��H��p[A\A]A^]�L��p���D��dL���An��E��M���H�7�TH�
�	H��H�1�A�VP�f.�L���z��H���\���I��H���T1�H�߾�H�1�A�VP�b����hr���UH��ATL�%�x\S1�A�<$t	��[A\]�f�1�H�=7y\��u��H�=&y\�au��1��@�n����tE1��jv��H��-]�?H�d�H��1�H����v��H�5�	H���[k��H��t�A�$1�H�=�x\�0o����[A\]�f�UH��SH��H��w\�;uH��[]�@H�=�x\��t��H�=}x\���n��H��H�=jx\[]��q��UH��ATI��SHc�1�H���Ym��I��M��tH��L��H���m��I��L���(l��[A\]�UH��AWAVAUATSH��H�=	x\H��(�@t���kx��H���q��H����I��H����T�H����L���M����H�5E�L���3j��H�5>�L��H��M�A��I��*H��M��j��A��H�5�L��I��:H��MD���i��H�5��L��I����i��M���T��lA����H��tA����L��H��L���j��H��L���L��H�E�M��tM���H�� H��t	�>�yH��H��L���u����u_H��t5H��E1��J���H�=�v\�m��L����w��H��(L��[A\A]A^A_]�@H��u�L���h����t�f.�H���H��tTH�x�L���u��I��H��t9H���L��H�PH�p��s�����e����L���Mu�����P���DM����H�}���L�u�A�>�H�E��8H���nL����r��������H����1�L���v��L���hi��I��H����H��H��1��?i��H�=�u\��tt��k������f.�L���q�����w���H�� L���o�����`�������@H�x����� ���H�}���M���}L�u������{k��L���#v��L��E1��u���M���H�=�t\E1��Qk���6���@H�������I��>��������DH�=�t\�k��L����u�����H�}��MM�������A�>�����M��E1�L�}�L��@H�5��m��I��H������j��H�u�1�L��L��H�E��>n��L���fl��H�u�L���*t����t1��l��H�}�I����l��D������@���A��A��e�/���H�}���l��M���������DL��L���t���������H�E�L�u�I��L��L�u�H�E����f�1�H��@������DH�!�TL�E���H��H�H H��TH�1��@~��H�=Ys\��i��L���lt�����H�E��8uM���W����w���H��L���s�����W�����f.�U1�H��AWI��AVAUATSH��H�_H���^o��L� I��I�D$HL��Ph�Eτ�uI�D$H1�1�L��P8H��A������j��L�����H�߉��e��H���l�����uZD��H���g����t*��t%H���mq��H����L������VDI�D$HA����L��P0������u�I�����xt3H���q��H��u>I�_I�D$8H�X1�H����[A\A]A^A_]�fDI��u�I��u���f�H�ǻ�r����L��I��H�A�TH���H�+�TH�1��|���}�u�I�D$H1�1�L��P8�f�UH��AWAVI��AUA��ATSH��H�G@L�g8H���H�X(H�C8H�E�I�|$D��L���l��I�|$�A�Dž�~H��Ic�[A\A]A^A_]�f.����f����tD��uӃH�C H��tH�s(���H�}��`H�C H��t�H�s(1����{���f���ff.�UH��AWAVI��AUA��ATSH��H�G@L�g8H���H�X(H�C8H�E�I�|$D��L���n��I�|$�A�Dž�~H��Ic�[A\A]A^A_]�f.����e����tD��uӃH�C H��tH�s(���H�}��_H�C H��t�H�s(1����{���f���ff.�UH��AWI��AVA��AUI��ATSH��L�g�/I�}���5e����uPI�D$@�L�狐�I�D$H�P0��~1I�}D��L���bj���Å�~�H��Hc�[A\A]A^A_]�f.�I�}1���k��H�������ff.�UH��AWI��AVA��AUI��ATSH��L�g�/I�}���d����uPI�D$@�L�狐�I�D$H�P0��~1I�}D��L���rm���Å�~�H��Hc�[A\A]A^A_]�f.�I�}1��5k��H���M���ff.�UH��AUATSH��H��tnL�g�M��tMI��L���c��H��tH���o���L���f`��L���`����uB��u�1�L����n��I�EH����[A\A]]�fDH�����[A\A]]�fD���@UH��AWAVAUATSH��H���H�_A�H����1�H���Ij��H���I��L�0��H���d��H��H����M��$�L���a��E1�1�L��H��H���.l����tiI��$�1�H���h����tRH����`��H��}TL��H���DH��T��L��H�1�A�VPH��D��[A\A]A^A_]�fDH��E1��`����H��}TL��H����f�A���H�Y}TL�"�H����v���fDH��tH�H��tUH���Ij��]H���b��1��ff.�f�H����H�O1�H��t|UH��AVAUI��1�ATA��SH��H��H����h��H�{I���>c��H��H����A��?vD�w`��H�M�L��H��H���a����tyH���_���E�H��[A\A]A^]�f���H�q|TL��H���H�T~TL����H�1��v��H���2_��H��1�[A\A]A^]�1��DH�!|TL�B�H���뮐H�	|TL��H����f�H��tH�H��tUH���)k��]���@������f.�H�H��1�H�@8H�x��^��f.��UH��H��SH��H�?H�HH�pH���H�Z(H�P�p8�p0D�H(L�@ ����H�CXH�]�Z��DUH��H��SH��H�?H�pH���H�Z(H�P�����CH��[]�f�UH��SH��H�?H�GxH���H�X(�f��H�C�H��[]�ff.�@UH��SH��H�H�wH���H��H�Z(����C�H��[]�ff.�f�UH��SH��H�H�wH���H��H�Z(�����C�H��[]�ff.�f�UH��H��SH��H�?H�pH���H�Z(H�P�ɷ����CH��[]�f�UH��SH��H�?H���H�X(�tj��H�C�H��[]�UH��SH��H�?H�GxH���H�X(�����H��[]�UH��SH��H�?H���H�X(�Ե���H��[]��UH��H��SH��H�?H�HH�pH���H�Z(H�P�q����CH��[]�DUH��SH��H�H�wH���H��H�Z(����C�H��[]�ff.�f�UH��SH��H��wH���H��H�Z(�>���C�H��[]�ff.�UH��SH��H�?H���H�X(�d���C�H��[]�@UH��SH��H��wH���H��H�Z(����C�H��[]�ff.�UH��SH��H�H�wH���H��H�Z(�-���C�H��[]�ff.�f�UH��SH��H��wH���H��H�Z(�����C�H��[]�ff.�UH��SH��H�?H���H�X(�D���C�H��[]�@UH��SH��H�?H���H�X(����C�H��[]�@UH��SH��H�?H���H�X(�4��H�C�H��[]�UH��SH��H�H�wH���H��H�Z(����H�C�H��[]�ff.��UH��SH��H�H�wH���H��H�Z(�=��H�C�H��[]�ff.��UH��SH��H�?H���H�X(��H�C�H��[]�UH��H��SH��H�?H�pH���H�Z(H�P���H�CH��[]��UH��SH��H�?H���H�X(�a���C�H��[]�@UH��H��SH��H�?H�pH�W8H���H�Z(H�P�f����CH��[]�DUH��SH��H�?H�G8H���H�X(�[���C�H��[]�UH��SH��H�?H�G8H���H�X(�PD���C�H��[]�UH��SH��H�?H�G8H���H�X(��L���C�H��[]�UH��SH��H�?H�G8H���H�X(��e���C�H��[]�UH��SH��H�?H�G8H���H�X(�h���C�H��[]�UH��SH��H�?H�G8H���H�X(�@F���C�H��[]�UH��H��SH��H�?H�H�pH�W8H���H�Z(H�P�2V����CH��[]�f�UH��SH��H�?H���H�X(�t���C�H��[]�@UH��SH��H�?H���H�X(�d���C�H��[]�@UH��SH��H��wH���H��H�Z(�����C�H��[]�ff.�f�UH��SH��H�?H���H�X(�t}���C�H��[]�@UH��SH��H�?H�G8H���H�X(�p\���C�H��[]�H�w H�W(��UH��AWA��AVI��H�u�AUA��ATSH��H��H�G@H���L�`(����1�1�H���?��A�$�}�D��L���Y���Eą������T��I�Ƌ�P���v	����A�$E������
A�$I�D$ E�l$H��tI�t$(���I�|$8��QI�D$ H��t	I�t$(1���A�D$uW�}�H�M�L�EȺ��E��\X����u2�Eą�u(1�H����[A\A]A^A_]�fD��E1�A�$�l���A��������ff.�@UH��AUI��ATI��SH��hH�U�H���H�U�H�u��~E�H�5^���H�X(�EL�E�E�H�M��E�H�EH�{8)E��~E�H�Eи�HE E�L�M�)E�H�E��C��O1�f�S��u-H�SI�UH��h[A\A]]�f��C�H��h[A\A]]��H�isTI��$��ADŽ$��H�0�U��H�IqT��AƄ$�I��$�H�p@�U��1�AƄ$�I�EH��h[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�LO�C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H��rTH����dž��H�0��T��H�dpTAƄ$�H�ppI��$����T��1�AƄ$�I�EH��[A\A]]��H�rTI��$��ADŽ$��H�0�XT��H��oTAƄ$�H�p@�f�UH��AUI��ATI��SH��8H���H�U�H�U�H�u��~E�H�5^�H�X(H�M�E��CH�{8)E��M1�f�S��u-�SA�UH��8[A\A]]��C�H��8[A\A]]��H�IqTI��$��ADŽ$��H�0�S��H�)oT��AƄ$�I��$�H�p@�jS��1�AƄ$�A�EH��8[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�,M�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H�apTH����dž��H�0�R��H�DnTAƄ$�H�ppI��$����R��1�AƄ$�A�EH��[A\A]]��H��oTI��$��ADŽ$��H�0�8R��H��mTAƄ$�H�p@�f�UH��AUI��ATI��SH��H�FxH��tdH���H�u�H�U�H�5~�H�X(�CH�{8�K1�f�S��uQH�SI�UH��[A\A]]�fD�C�H��[A\A]]��H����X��I�EH��1�[A\A]]��I�D$x�ǀ��I�D$xH���H��nTH�0�QQ��I�D$x��ƀ�H��lTH�p@I�D$xH����$Q��I�D$xƀ�1�I�EH��[A\A]]�UH��AUI��ATI��SH��H�FxH���H�Y(�{tH�CH�{8�S��J�C�� �C��H�SI�UH��[A\A]]��H��[A\A]]�ǀ��H�Fx�H���H�nTH�0�gP��I�D$xƀ�H��kTH�ppI�D$x��H����:P��I�D$xƀ�1�I�EH��[A\A]]�f�I�D$x�ǀ��I�D$xH���H��mTH�0��O��I�D$xƀ�H�nkTH�p@�u���DUH��AUI��ATI��SH��(H���H�U�H�U�H�u��~E�H�5^�H�X(E��CH�{8)E��5I1�f�S��u1�SA�UH��([A\A]]���C�H��([A\A]]��H��lTI��$��ADŽ$��H�0�O��H��jT��AƄ$�I��$�H�p@��N��1�AƄ$�A�EH��([A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�H�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��kTH����dž��H�0�+N��H��iTAƄ$�H�ppI��$����N��1�AƄ$�A�EH��[A\A]]��H�qkTI��$��ADŽ$��H�0�M��H�QiTAƄ$�H�p@�f�UH��AUI��ATI��SH��(H���H�U�H�U�H�u��~E�H�5~�H�X(E��CH�{8)E��G1�f�S��u1�SA�UH��([A\A]]���C�H��([A\A]]��H��jTI��$��ADŽ$��H�0��L��H��hT��AƄ$�I��$�H�p@��L��1�AƄ$�A�EH��([A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�F�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��iTH����dž��H�0�L��H��gTAƄ$�H�ppI��$�����K��1�AƄ$�A�EH��[A\A]]��H�QiTI��$��ADŽ$��H�0�K��H�1gTAƄ$�H�p@�f�UH��AUI��ATI��SH��8H���H�U�H�U�H�u��~E�H�5��H�X(H�M�E��CH�{8)E���D1�f�S��u-�SA�UH��8[A\A]]��C�H��8[A\A]]��H��hTI��$��ADŽ$��H�0��J��H�ifT��AƄ$�I��$�H�p@�J��1�AƄ$�A�EH��8[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�lD�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��gTH����dž��H�0��I��H��eTAƄ$�H�ppI��$�����I��1�AƄ$�A�EH��[A\A]]��H�1gTI��$��ADŽ$��H�0�xI��H�eTAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5��H�X(�CH�{8��B1�f�S��u2H�SI�UH��[A\A]]���C�H��[A\A]]��H�yfTI��$��ADŽ$��H�0�H��H�YdT��AƄ$�I��$�H�p@�H��1�AƄ$�I�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�\B�C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H��eTH����dž��H�0��G��H�tcTAƄ$�H�ppI��$����G��1�AƄ$�I�EH��[A\A]]��H�!eTI��$��ADŽ$��H�0�hG��H�cTAƄ$�H�p@�f�UH��ATSH��H��H��teH�GxH��t\H���H�}�H�U�H�5��L�`(A�D$I�|$8��@1�fA�T$��u<H��[A\]�A�D$A�$H��[A\]�DH��谘��H��1�[A\]�DH�Cx�ǀ��H�CxH���H�3dTH�0�F��H�Cx��ƀ�H�bTH�p@H�CxH����hF��H�Cxƀ�1��Z���fDUH��ATI��SH�GxH���H�Z(�{tA�CH�{8�s�A@�C���C��[A\]�f.��[A\]�f�ǀ��H�Gx�H���H�gcTH�0��E��I�D$xƀ�H�TaTH�ppI�D$x��H����E��I�D$xƀ�1�[A\]��I�D$x�ǀ��I�D$xH���H��bTH�0�QE��I�D$xƀ�H��`TH�p@��UH�5�H��ATI��SH�U�H��H���H�}�H�X(�CH�{8�>1�f�S��uH��[A\]�fD�C�H��[A\]ÐH�abTI��$��ADŽ$��H�0�D��H�A`T��AƄ$�I��$�H�p@�D��1�AƄ$�H��[A\]�ff.�UH��ATI��SH���H�X(�{t5�CH�{8�s�U>�C��
�Cuw[A\]�f��[A\]�f�H��aTH����LJ�����H�0��C��H��_TAƄ$�H�ppI��$�����C��[1�AƄ$�A\]�DH�AaTI��$��ADŽ$��H�0�C��H�!_TAƄ$�H�p@�f�UH��SH��H��H��tH�?t	�$�����u
H��蘋��1�H��[]�ff.�@UH��SH��H�������uH�߉E��`����E�H��[]�fDUH��AUI��ATI��SH��HH�U�H�U�H���H�u��~E�H�5��L�E�H�X(E�H�M�)E��~E�H�{8E�)E��C�`<1�f�S��u,�SA�UH��H[A\A]]Ð�C�H��H[A\A]]��H��_TI��$��ADŽ$��H�0�@B��H��]T��AƄ$�I��$�H�p@�B��1�AƄ$�A�EH��H[A\A]]�ff.�@UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S��;�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H�_TH����dž��H�0�[A��H��\TAƄ$�H�ppI��$����5A��1�AƄ$�A�EH��[A\A]]�f.�H��^TI��$��ADŽ$��H�0��@��H��\TAƄ$�H�p@�f�UH��AUI��ATI��SH��(H���H�U�H�U�H�u��~E�H�5��H�X(E��CH�{8)E��E:1�f�S��u1�SA�UH��([A\A]]���C�H��([A\A]]��H��]TI��$��ADŽ$��H�0� @��H��[T��AƄ$�I��$�H�p@�?��1�AƄ$�A�EH��([A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�9�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��\TH����dž��H�0�;?��H��ZTAƄ$�H�ppI��$����?��1�AƄ$�A�EH��[A\A]]��H��\TI��$��ADŽ$��H�0��>��H�aZTAƄ$�H�p@�f�UH��AUI��ATI��SH��H���H�u�H�5+��U�H�U�H�X(�CH�{8�381�f�S��u/�SA�UH��[A\A]]�D�C�H��[A\A]]��H��[TI��$��ADŽ$��H�0�>��H��YT��AƄ$�I��$�H�p@��=��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�7�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��ZTH����dž��H�0�+=��H��XTAƄ$�H�ppI��$����=��1�AƄ$�A�EH��[A\A]]��H�qZTI��$��ADŽ$��H�0�<��H�QXTAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5W��H�X(�CH�{8�&61�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H��YTI��$��ADŽ$��H�0�<��H��WT��AƄ$�I��$�H�p@��;��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�5�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��XTH����dž��H�0�;��H��VTAƄ$�H�ppI��$����:��1�AƄ$�A�EH��[A\A]]��H�aXTI��$��ADŽ$��H�0�:��H�AVTAƄ$�H�p@�f�UH��AUI��ATI��SH��H���H�u�H�5{���U�H�U�H�X(�CH�{8�41�f�S��u/�SA�UH��[A\A]]�D�C�H��[A\A]]��H��WTI��$��ADŽ$��H�0��9��H��UT��AƄ$�I��$�H�p@��9��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�3�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��VTH����dž��H�0�9��H��TTAƄ$�H�ppI��$�����8��1�AƄ$�A�EH��[A\A]]��H�QVTI��$��ADŽ$��H�0�8��H�1TTAƄ$�H�p@�f�UH��AUI��ATI��SH��H���H�u�H�5���H�U�H�U�H�X(�CH�{8�21�f�S��u.�SA�UH��[A\A]]�@�C�H��[A\A]]��H��UTI��$��ADŽ$��H�0��7��H�yST��AƄ$�I��$�H�p@�7��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�|1�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��TTH����dž��H�0�6��H��RTAƄ$�H�ppI��$�����6��1�AƄ$�A�EH��[A\A]]��H�ATTI��$��ADŽ$��H�0�6��H�!RTAƄ$�H�p@�f�UH��AUI��ATI��SH��H���H�u�H�5����U�H�U�H�X(�CH�{8��/1�f�S��u/�SA�UH��[A\A]]�D�C�H��[A\A]]��H��STI��$��ADŽ$��H�0��5��H�iQT��AƄ$�I��$�H�p@�5��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�l/�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��RTH����dž��H�0��4��H��PTAƄ$�H�ppI��$�����4��1�AƄ$�A�EH��[A\A]]��H�1RTI��$��ADŽ$��H�0�x4��H�PTAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5��H�X(�CH�{8��-1�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H�yQTI��$��ADŽ$��H�0�3��H�YOT��AƄ$�I��$�H�p@�3��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�\-�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��PTH����dž��H�0��2��H�tNTAƄ$�H�ppI��$����2��1�AƄ$�A�EH��[A\A]]��H�!PTI��$��ADŽ$��H�0�h2��H�NTAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5'��H�X(�CH�{8��+1�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H�iOTI��$��ADŽ$��H�0�1��H�IMT��AƄ$�I��$�H�p@�1��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�L+�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��NTH����dž��H�0��0��H�dLTAƄ$�H�ppI��$����0��1�AƄ$�A�EH��[A\A]]��H�NTI��$��ADŽ$��H�0�X0��H��KTAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5G��H�X(�CH�{8��)1�f�S��u2H�SI�UH��[A\A]]���C�H��[A\A]]��H�YMTI��$��ADŽ$��H�0�/��H�9KT��AƄ$�I��$�H�p@�z/��1�AƄ$�I�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�<)�C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H�qLTH����dž��H�0�.��H�TJTAƄ$�H�ppI��$����.��1�AƄ$�I�EH��[A\A]]��H�LTI��$��ADŽ$��H�0�H.��H��ITAƄ$�H�p@�f�UH��AUI��ATI��SH��(H���H�U�H�U�H�u��~E�H�5^��H�X(E��CH�{8)E��'1�f�S��u1H�SI�UH��([A\A]]�fD�C�H��([A\A]]��H�9KTI��$��ADŽ$��H�0�-��H�IT��AƄ$�I��$�H�p@�Z-��1�AƄ$�I�EH��([A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�'�C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H�QJTH����dž��H�0�,��H�4HTAƄ$�H�ppI��$����u,��1�AƄ$�I�EH��[A\A]]��H��ITI��$��ADŽ$��H�0�(,��H��GTAƄ$�H�p@�f�UH��AUI��ATI��SH��(H���H�U�H�U�H�u��~E�H�5~��H�X(E��CH�{8)E��%1�f�S��u1H�SI�UH��([A\A]]�fD�C�H��([A\A]]��H�ITI��$��ADŽ$��H�0�`+��H��FT��AƄ$�I��$�H�p@�:+��1�AƄ$�I�EH��([A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�$�C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H�1HTH����dž��H�0�{*��H�FTAƄ$�H�ppI��$����U*��1�AƄ$�I�EH��[A\A]]��H��GTI��$��ADŽ$��H�0�*��H��ETAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5���H�X(�CH�{8�v#1�f�S��u2H�SI�UH��[A\A]]���C�H��[A\A]]��H�	GTI��$��ADŽ$��H�0�P)��H��DT��AƄ$�I��$�H�p@�*)��1�AƄ$�I�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S��"�C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H�!FTH����dž��H�0�k(��H�DTAƄ$�H�ppI��$����E(��1�AƄ$�I�EH��[A\A]]��H��ETI��$��ADŽ$��H�0�'��H��CTAƄ$�H�p@�f�UH��AUI��ATI��SH��8H���H�U�H�U�H�u��~E�H�5���H�X(H�M�E��CH�{8)E��Q!1�f�S��u-H�SI�UH��8[A\A]]�f��C�H��8[A\A]]��H��DTI��$��ADŽ$��H�0�0'��H��BT��AƄ$�I��$�H�p@�
'��1�AƄ$�I�EH��8[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�� �C��$�C��H�SI�UH��[A\A]]���H��[A\A]]�H�DTH����dž��H�0�K&��H��ATAƄ$�H�ppI��$����%&��1�AƄ$�I�EH��[A\A]]��H��CTI��$��ADŽ$��H�0��%��H�qATAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5���H�X(�CH�{8�F1�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H��BTI��$��ADŽ$��H�0� %��H��@T��AƄ$�I��$�H�p@�$��1�AƄ$�A�EH��[A\A]]�ff.�@UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S��C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��ATH����dž��H�0�;$��H��?TAƄ$�H�ppI��$����$��1�AƄ$�A�EH��[A\A]]�f.�H��ATI��$��ADŽ$��H�0��#��H�a?TAƄ$�H�p@�f�UH��AUI��ATI��SH��8H�F8H�U�H��txH���H�u�H�U�H�5����~E�H�M�H�X(E��CH�{8)E��1�f�S��u\�SA�UH��8[A\A]]�f.��C�H��8[A\A]]��H��L��H���/��A�EH��81�[A\A]]�f�I�D$8�ǀ��I�D$8H���H�a@TH�0�"��I�D$8��ƀ�H�I>TH�p@I�D$8H����"��I�D$8ƀ�1�A�EH��8[A\A]]�UH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S�X�C�� �C���SA�UH��[A\A]]�@�H��[A\A]]�ǀ��H�F8�H���H�w?TH�0��!��I�D$8ƀ�H�d=TH�ppI�D$8��H����!��I�D$8ƀ�1�A�EH��[A\A]]�f�I�D$8�ǀ��I�D$8H���H��>TH�0�Q!��I�D$8ƀ�H��<TH�p@�u���DUH��AUI��ATI��SH��H�F8H��tdH���H�u�H�U�H�5���H�X(�CH�{8�1�f�S��uQ�SA�UH��[A\A]]���C�H��[A\A]]��H���"��A�EH��1�[A\A]]��I�D$8�ǀ��I�D$8H���H�>TH�0�a ��I�D$8��ƀ�H��;TH�p@I�D$8H����4 ��I�D$8ƀ�1�A�EH��[A\A]]�UH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S��C�� �C���SA�UH��[A\A]]�@�H��[A\A]]�ǀ��H�F8�H���H�=TH�0�w��I�D$8ƀ�H�;TH�ppI�D$8��H����J��I�D$8ƀ�1�A�EH��[A\A]]�f�I�D$8�ǀ��I�D$8H���H��<TH�0����I�D$8ƀ�H�~:TH�p@�u���DUH��AUI��ATI��SH��H�F8H��tdH���H�u�H�U�H�5���H�X(�CH�{8�M1�f�S��uQ�SA�UH��[A\A]]���C�H��[A\A]]��H�����A�EH��1�[A\A]]��I�D$8�ǀ��I�D$8H���H��;TH�0���I�D$8��ƀ�H��9TH�p@I�D$8H�������I�D$8ƀ�1�A�EH��[A\A]]�UH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S��C�� �C���SA�UH��[A\A]]�@�H��[A\A]]�ǀ��H�F8�H���H��:TH�0���I�D$8ƀ�H��8TH�ppI�D$8��H�������I�D$8ƀ�1�A�EH��[A\A]]�f�I�D$8�ǀ��I�D$8H���H�1:TH�0���I�D$8ƀ�H�8TH�p@�u���DUH��AUI��ATI��SH��H�F8H��tdH���H�u�H�U�H�5^��H�X(�CH�{8��1�f�S��uQ�SA�UH��[A\A]]���C�H��[A\A]]��H�����A�EH��1�[A\A]]��I�D$8�ǀ��I�D$8H���H�A9TH�0���I�D$8��ƀ�H�)7TH�p@I�D$8H����t��I�D$8ƀ�1�A�EH��[A\A]]�UH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S�8�C�� �C���SA�UH��[A\A]]�@�H��[A\A]]�ǀ��H�F8�H���H�W8TH�0���I�D$8ƀ�H�D6TH�ppI�D$8��H������I�D$8ƀ�1�A�EH��[A\A]]�f�I�D$8�ǀ��I�D$8H���H��7TH�0�1��I�D$8ƀ�H��5TH�p@�u���DUH��AUI��ATI��SH��H�F8H��tdH���H�u�H�U�H�5.���H�X(�CH�{8�1�f�S��uQ�SA�UH��[A\A]]�fD�C�H��[A\A]]��H����%��A�EH��1�[A\A]]��I�D$8�ǀ��I�D$8H���H��6TH�0�A��I�D$8��ƀ�H��4TH�p@I�D$8H������I�D$8ƀ�1�A�EH��[A\A]]�fDUH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S���C�� �C���SA�UH��[A\A]]��H��[A\A]]�ǀ��H�F8�H���H��5TH�0�W��I�D$8ƀ�H��3TH�ppI�D$8��H����*��I�D$8ƀ�1�A�EH��[A\A]]�@I�D$8�ǀ��I�D$8H���H�y5TH�0����I�D$8ƀ�H�f3TH�p@�UH��AUI��ATI��SH��H�F8H��tdH���H�u�H�U�H�5���H�X(�CH�{8�=1�f�S��uQ�SA�UH��[A\A]]�fD�C�H��[A\A]]��H���&��A�EH��1�[A\A]]��I�D$8�ǀ��I�D$8H���H��4TH�0����I�D$8��ƀ�H�y2TH�p@I�D$8H�������I�D$8ƀ�1�A�EH��[A\A]]�fDUH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S��C�� �C���SA�UH��[A\A]]��H��[A\A]]�ǀ��H�F8�H���H��3TH�0���I�D$8ƀ�H��1TH�ppI�D$8��H�������I�D$8ƀ�1�A�EH��[A\A]]�@I�D$8�ǀ��I�D$8H���H�)3TH�0���I�D$8ƀ�H�1TH�p@�UH��AUI��ATI��SH��H�F8H��tdH���H�u�H�U�H�5��H�X(�CH�{8��1�f�S��uQ�SA�UH��[A\A]]�fD�C�H��[A\A]]��H�����A�EH��1�[A\A]]��I�D$8�ǀ��I�D$8H���H�A2TH�0���I�D$8��ƀ�H�)0TH�p@I�D$8H����t��I�D$8ƀ�1�A�EH��[A\A]]�fDUH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S�8�C�� �C���SA�UH��[A\A]]��H��[A\A]]�ǀ��H�F8�H���H�W1TH�0���I�D$8ƀ�H�D/TH�ppI�D$8��H������I�D$8ƀ�1�A�EH��[A\A]]�@I�D$8�ǀ��I�D$8H���H��0TH�0�9��I�D$8ƀ�H��.TH�p@�UH��AUI��ATI���H��SH��(I�D$8H��tnH���H�M�H�U�L�E�H�X(�u�H�5����L�e��CH�{8�1�f�S��uP�SA�UH��([A\A]]�D�C�H��([A\A]]��L��L������A�EH��(1�[A\A]]�@I�D$8�ǀ��I�D$8H���H��/TH�0�A��I�D$8��ƀ�H��-TH�p@I�D$8H������I�D$8ƀ�1�A�EH��([A\A]]�fDUH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S���C�� �C���SA�UH��[A\A]]��H��[A\A]]�ǀ��H�F8�H���H��.TH�0�W��I�D$8ƀ�H��,TH�ppI�D$8��H����*��I�D$8ƀ�1�A�EH��[A\A]]�@I�D$8�ǀ��I�D$8H���H�y.TH�0����I�D$8ƀ�H�f,TH�p@�UH��AUI��ATH�U�I��SH��H���H�u�H�5����H�X(�CH�{8�F
1�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H��-TI��$��ADŽ$��H�0� ��H��+T��AƄ$�I��$�H�p@���1�AƄ$�A�EH��[A\A]]�ff.�@UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S�	�C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��,TH����dž��H�0�;��H��*TAƄ$�H�ppI��$������1�AƄ$�A�EH��[A\A]]�f.�H��,TI��$��ADŽ$��H�0����H�a*TAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5׵��H�X(�CH�{8�61�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H��+TI��$��ADŽ$��H�0���H��)T��AƄ$�I��$�H�p@��
��1�AƄ$�A�EH��[A\A]]�ff.�@UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S��C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��*TH����dž��H�0�+
��H��(TAƄ$�H�ppI��$����
��1�AƄ$�A�EH��[A\A]]�f.�H�q*TI��$��ADŽ$��H�0���H�Q(TAƄ$�H�p@�f�UH��AUI��ATI��SH��H���H�u�H�5�����U�H�U�H�X(�CH�{8�#1�f�S��u/�SA�UH��[A\A]]�@�C�H��[A\A]]��H��)TI��$��ADŽ$��H�0���H��'T��AƄ$�I��$�H�p@����1�AƄ$�A�EH��[A\A]]�ff.�@UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S��C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��(TH����dž��H�0���H��&TAƄ$�H�ppI��$����
��1�AƄ$�A�EH��[A\A]]�f.�H�a(TI��$��ADŽ$��H�0�
��H�A&TAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H���H�u�H�5'���H�X(�CH�{8�1�f�S��u2�SA�UH��[A\A]]���C�H��[A\A]]��H��'TI��$��ADŽ$��H�0��	��H��%T��AƄ$�I��$�H�p@��	��1�AƄ$�A�EH��[A\A]]�ff.��UH��AUI��ATI��SH��H���H�X(�{tL�CH�{8�S��C��$�C���SA�UH��[A\A]]���H��[A\A]]�H��&TH����dž��H�0�	��H��$TAƄ$�H�ppI��$�������1�AƄ$�A�EH��[A\A]]��H�Q&TI��$��ADŽ$��H�0���H�1$TAƄ$�H�p@�f�UH��AUI��ATH�U�I��SH��H�F8H�u�H�5J���H���H�X(�CH�{8�1�f�S��u.�SA�UH��[A\A]]�@�C�H��[A\A]]��I�D$8�ǀ��I�D$8H���H�y%TH�0����I�D$8��ƀ�H�a#TH�p@I�D$8H������I�D$8ƀ�1�A�EH��[A\A]]�ff.�UH��AUI��ATI��SH��H�F8H���H�Y(�{tH�CH�{8�S�h�C�� �C���SA�UH��[A\A]]�@�H��[A\A]]�ǀ��H�F8�H���H��$TH�0����I�D$8ƀ�H�t"TH�ppI�D$8��H������I�D$8ƀ�1�A�EH��[A\A]]�f�I�D$8�ǀ��I�D$8H���H�$TH�0�a��I�D$8ƀ�H��!TH�p@�u���DUH��SH��H�GHH��H�#H��H�kH�[L�cL�k L�s(L�{0H�H�
H�C8H�K@��c8H�#1���[]�f�UH��SH��H�H�#H��H�CH�kH��H�CL�cI��H�C L�k I��H�C(L�s(I��H�C0L�{0I��H� H�
4H�C8H�C@H�K@H�KH�[H���H�#H�kL�cL�k L�s(L�{01���[]�ff.�H�H�'H��H�GH�oH��H�GH�_H��H�GL�gI��H�G L�o I��H�G(L�w(I��H�G0L�0I��H�G@H�
H�O@��1�ÐUf�H��ATI��SH��GG G0G@H����
��H�CPH��tL�f�H���H�P�H�SH)@�1�[A\]ø������fDH�PH��t�R	��f��f.�DUH��AWAVLc�AUATI��SH���WDH�_H�uȅ��f�HL����
1�M��tI�ExA��Hc�H��8
��H����H��I����J��E����L�@��i�tA�����D�pL�@H�u�L��L�����J�<0I�t$(H�\g�H��HD��J��H��pH�x��tH���H�x�f�PH��p���YH��H�����E1�H��L��L)�A��H���gZ��L��A�����E����E1��k1�M��tI�UxA��!H�H�|	�*	��H��hH��I��H��H
��H��H��h��H��ƃ8�H
��H��hI�|$(��H��H��pH��h����H��R ������H��H�����H!�H��h� �Wƃ9@�� t%���nH���H�x��H��h������puH��H��hA�H��hf�H��A�GH��hH��A�GH��hH��A�GH�CXA�GH�CXH��A�GH�CXH��A�GH�CXH��A�GH����AG	A�GA�G1�fA�GA�G��p�M�o H���{ƃ8��i��H���H��t	�>�ZL���Rw��L���J��M�DE���4H��p�Ā��� �	A�����E�0M�hH�u�L��L��M������fDH���A��lH����
����t A�D$DH��D��[A\A]A^A_]���;���I�|$��H�TD�H�TL�I�H���H�1��X���fDH�x�@���H���g���H���Y���H���K���H�� �=�����8�0���A��x@���;�������DH���8����H����H��p@���F���A��xuI���uI����$���H�0TL����H��H���H�TH�1��i��L��A��;��I�\$����Ic�H���G���-I�\$�w���fA�H�CXM�oA�GH�CXH��A�GH�CXH��A�G�����9�������fDA�M�hI�t$(H��pH��t�����$L��H���A�����kt(H����H��t��y�q�@��FшH��L)�L��H��H����F��u#H���CEA�Ņ�uL���4��������H��TL��D�H���H��T��H��H�1�������DI�D$ �H�p�D��H�x���@H���w���H���i���H���[���H�� �M�����8�T����B���fDI�D$ L��H�p�D��L�h���f�H����Bp��H�BhH���H�@hA�GH���H�@hH��A�GH���H�@hH��A�GH���H�@hH��A�G���f�H����C���������L��L���=��I�����D�L����C�����fDL���C��I�|$(L�h����H���H��p����f.�L��L��H��L)���D��uKH���SC��u?H�;������������f.�Mc�H�u�L��L���>���I��V���fD����H��TL�͖D�H������fDH��1ɾ�A�H��TH�1�����L�����I�\$����D����L����hH��H������I�EH���d���H��hH���H
H��h�G����蛶���hH��L���H���ԇ��H��I�EH��h�+���H�� H��h����H�G0H��tH��G8H�G0�G@�@UH��AUATI��SH��H���G@L�o��u
1�1������uZL���-G��H�¸����H9�tE�SLI�M ��I�$H��t�1@���t*@��t�C@H��[A\A]]�1���@H���B�I�$�ܸ������@UH��AVAUATSH��H�� H�wdH�%(H�E�1�D���E��udA�
L������L��H����x1�1�H��S��uA��u�E��uc1�H�M�dH3%(��H�� [A\A]A^]�fDH�����H�Ɨ�?H���H����Ff�G�F�G�E��g���H�SH�����H�����H���H���H���H�M�H��H)�H������H)Ɖ�����H�Ƃ��E������UH��AUATI��SH��H��8dH�%(H�E�1��HtXL���L�m�H��tI��$��:��1�1�H��S��������H�M�dH3%(��H��8[A\A]]�DH�u����1���xϸ���u�L�m��I��$�L������I��$�AƄ$��:�~���L�e�f�L���E�L��)E��E���Y�L��H��S���������R����p���H��G ��t��u-�H��鮟��fD�H��陟��f��ff.�@H�GH�8���@UH��AWI��AVAUA��ATI��SH��xH��pH��p���L��x����tZH���H��t	H�ZH��uZH��p���t;H��p����L��H����ALJ�I��H��uWH��p���L�5�T�G���H�<�H�K�HDغH��L��諃��I��H���?H��p���ALJ�t#H��p���H����������DE�LE�H���D�m�H��p���H�
����L�}�H��h����~�h���H��h���H�����H�E�I���H�E��h����E�)E��~�x���L��x���L�e��x���H��x���E�DI���L�u�H��tH��PH��tH�����H����I�G L��L���A�VX��uvI��CM�o A�}��lLcu�I����I�]H������A�V�)‰�I�D�U�H�E��H��L���F���I��H���Z���L�5#T�N���fDy����tQM�o Lcu�A�E<�t����V�H��x[A\A]A^A_]�@H��x����E�H�g�H�E��|���f�L���A��I�Ƹ����I9�tM�o A�E�A����u����H��T��L��D�H��TL��H���H�1��
���`����L�5IT���@A������9���H�bT1ɾ�L��H�1��
�������@��t�H�5T��L��1�1�H��
��H��x�[A\A]A^A_]�H�	TL��p���L��1ɾ�H�1��V
��H��x�[A\A]A^A_]�I�uL��L���ӈ�����f.�@UH��AVAUI��ATSH��H�� dH�%(H�E�1��HtVL���L�u�H��tI����:��1�1�H��S��������H�M�dH3%(��H�� [A\A]A^]�f�H�u����1���xЃ�	t
����u���L�u�I���Lc�L��L�����CƄ%�I����:�x���L�e�L��L���U�	L��H��S���������_����<���f.�f����ff.�U� H��S���H����H��t����������DډXH��[]�f�I��H��t(UH��H��H��L��E�AH����]��������f.�H��t#UI��H��H��I�L��H����]�����@��f����[1��fD1��=�[���H��t����Mb�L�$�������)�ø�����ff.��H��tH�H��tH��t	��1��f���f.�H��tH�H��t�@�������fD1��ff.�f�UH��H���E�H��t,H�?�H��t�?H�M��	�A��$�����f�ɸ�f�H��t{U�H��ATSH��H�H��t&�E�L�e�;1�A�L��������t
H��[A\]�@�E��;L��A������H��[A\]�fD��f.�H��tH�H��t�8�@��H������ff.�@UH��AUATSH��H��tVL�'E1�M��tH��A�<$���u'L���?���H�H��D��[A\A]]�f.��[���A�$����L�#A����H��A�[D��A\A]]�@H��t#H�H��tU�8�H���c��������]�@������f�H��t[H�1�H��tIU��H��H��H�E�H�}�f�E��1҉E�����¸��~�E��������1��ff.�f�UH��AVAUATSH��H����H�I��H����A��H�W@A��H���H��t3H��@t)H�u�1���������H����[A\A]A^]��H�E��A��L�m؉E������E��f�Eܸ����DD����{��8u�D��L������Ã��t߅�u��V��nH����[A\A]A^]ÐH��1ۉ�[A\A]A^]��I�E@A��D��}�H�����@H���É�[A\A]A^]�ff.��UH��AUATSH��H��tfL�'M��t^A�D$������H��t�E1�@8�t/A�D$A�<$�À���@���D�1����������t/A�\$H��D��[A\A]]�@H��A�[D��A\A]]�@�[�D�(H��[A\D��A]]�f.�H��tkU1�H��AUATSH��L�'M��tIH�U�I��1�H���#���A�<$H�u޹����u�1�H��I������M��xM�e1�H��[A\A]]�1��ff.�f�H��tsH�H��tkUH��AUATI��SH��H��D�(�
���8u.�@@L��H��D����H���t�H��[A\A]]�f.�H��H�����[A\A]]�fDH������H����UH��AWAVAUATSH��L�?M��tlH�u�D�g(I��I��A�������u,H�uȹ@L�����H���t�H��[A\A]A^A_]�@��uE��tD��L��������H��H�����[A\A]A^A_]�H������@H����UH��AWAVAUATSH��L�?M��tiH�u�D�g,I��I��A���S����u,H�uȹ@@L����i�H���t�H��[A\A]A^A_]�@��uE��t1�D��L��������H��H�����[A\A]A^A_]�H�������UH��AWAVAUATI��SH��HH�G@H�u��U�H���H��tH�@(H��t
�x�B1�A����M�,$H�E�M���A�D$$1�1�L�������غ�Mb�]���ػ����)�Hc�H�E���U�H�u�A�}��1�A���^�H+E�H;E�������D�8H�E��M�H�u����@B�@BD�>B�A���usA��t�A��t���U���t[��tW����8sH�����U�1�L����������E�A�}H�M�L�E̺��[���xgD�u�E��DD�H��HD��[A\A]A^A_]�f.�H�x1�1��c���A�L$$�U�L��H�u�近��A���f.�A������F���@D�3�A������H����H�?H�����Ѻ�MbU�����H��H�� ��)�Hc�i��H�E��~E�)�i��Hc�H�M�E�)E�t01���t	����?H�M��A������?H�M��A��u�����f.�H��t;H��������~i��A��B�D�$1�H��u
�f�i������D��f.�UH��AWAVAUATSH��dH�%(H�E�1�H����I��H����H�����6�I��H����H�M�|$�����L�{@E�t$D�s E����A���<�S$���S,���
�S(����1��P�H���;������E�uA���tD����A�E����H�;H��t�L�H�D�H�M�dH3%(��H��[A\A]A^A_]�fD1Ҿ����A��A�E����M�|$L���"�I��H��k�H��P���H�E�L�HH�xH���1�HDžR���L��H)���l���H��f��P���A�?@���kL��L�����nH���H���Q������	L�sPM��������I�|$M�D$��H��TD�H��TH�JH�1�A��E�u���f�L�KPM������H��TI�|$L��I1ɾ�H�1�A�Ѹ����L�{PM���T�����I�|$1ɾ�D�H�`TH�1�A��E�u�(�����H���C������������fDHDž���1�HDž����S�E�L$f�H��P���� �� H�����L�E1�H���)�P���)�`����
�f�H�)� ���H��(���I�D$)�0���H��H)�@���H���[H�����Dž����H����H�� ���H������G1�D������������H+����D������H9�q�������~�I�D$ѥ����H��HH����H�����1���A������A����҉���u�1�D������H+����D����H��~�L�SPM�������H��SI�|$��H�HH��TL��HH�1�A��E�u�X�����H���s������8���1��i���@H����jI�wL�����H�x��L�����A�P����H�� ���H�����H�����H�����4f�1�D�����B�������H+����D����H9�|hD��E��.�H����H�����H���I�<$���A�������A����҉�����u�1�D���������H+����D������H��~�L�SPM��t(H�q�SI�|$��M�$H�H(H�PTH�1�A��H�����H���
�����E�u����f��S$�H��� ��������1������1ҾH���!�������������� ���H�����������
���D���G���L�����M���7���A�}���tD������#�D�����A�~A�VD�����A�v���D����������A�E�nH�����H���I���H��tH�@(H��t
�x�QA�VI�vH���_���A��E���#H�C@H���H��tH�@(H��t�xu#1�1�H��D�������D����������H�����D������>�H�����D�����H��t�&�D�����E�uA����%E�������L�{PM���\������H��SI�|$��D�H�c�SH�JM�$H�1�A��E�u�#���f��QH�qH���������������H�����A�}H�I(H��uщ������A�E����D������M�v(M���;����
���H�����1�H��H�P0A�F1�I�N�����H�C@H�����H���H�@(H�X���K$�����H��H������'���A��I���H�@(H�@0�P���L�sPM���V����z��I�|$��H�Y�SD�H�G�SH�J H�1�A��E�u����A�}D�����������������D�����A�U������f�UH��SH����H����u1Ҹ������Cȃ�w5��D��{���C�K�s�H�H��H�1�H��tH��[]�@�?9�G���fD�CH���[]�ff.�f�UH��SH��H���W�OH�;Wt�r�щsH�H��[]��wH��������H��t�S�KH�S�S��f.�UH��SH��H���O;Ot$�W�σ��K��H;�F�1�H��[]�DH�u��_���H��H��t�SH�u���fD��͐�W1���t��H��W�WH��fDUH��AVAUI��ATA��S�GH���wH�?9�w(9SvBD��)�����H�1�����A�D$�sH�;�CD���L��L����1�[A\A]A^]��K�1������A����H��H��tH��sD�s�C�f���f�H��֋W9wv��H7H���%��D1�H���F��fDH�H��t0UH��SH��H��H�����H�H�CH��[]�fD���W�G�����W)��Ή���HH�H�����f.�H�H��tHUH��ATA�S�W��DEgD9gu[A\]�fDD���wH��H����D�cH�[A\]�f��f.�D1�H9�s3���y*���v%���w(H�WH9�r�G���<@������D1��D���w�H�OH9�r��w�N���?w��O�����?w�@���w���tɸ�f�1�H9�s8���y2���v-���w0H�WH9�r�G���<@������1�@��������1��D���w3H�OH9�r��w�N���?w��O�����?w�@���w���tƸÐ���w�H�OH9�r��w�N���?w��O�����?w��O�����?w�����x������u
@����v�������P_1���XwH)�H��~�W�J���>v��_��]v�D��f.���1���Y�����ff.���P��v�P 1���v�f.�H)�1�H��~��W��J���>vل�y���v�1����G<v�� @��v��f.���f.���_1�@��^�����@����_�����]v!���t1�������D�f���f.���P_1���Vw%H)�H��~�G<�t<�v���1��ff.�f���_1�@��W������<�t<�w1��f�H)�1�H��~��W�J���>v���}��ff.���1�@��~����ø�f.���f.�@����_�����]v!���t1�������D�f���f.���1�������D�f.���f.���f.����v"1����v����v����������v21����v(����v����v1���������H)�1�H��~�?y�G<�v<�u1�Ð��f.��1���y?��_�����]w<H��H)�H��~(�O�����]v|1����t
1����t8�����u�H)�H��~��G-���?������f.�H)�H��~��W����]w��G-���^�������ff.�@�1���y1��_�����]w�O�����]v���t1����t�D�G-���?������H)�H��~��W����]w��G-���^����ff.�H�W1�H9�r�����t1���������H�WH9�r��G��<��������ff.�����vH1�����w4��������}w'�W����>v@��y@���u��01�@��
�����f���1�@��}���H)�1�H��~W����vM���tH�W�J���>vD���|?H��~3��0��	w+�G<�v!<�t�G��0<
�������f.�1��D��f��G<v�� @��v��f.���f.���P��v�P 1���v�f.�H)�1�H��~��W��J���>vل�y���v�1��������=�wK����H�
'R��������H��H��H�|1t%��w H�5mpH��Hc�H���|��H�*R�f.�H��H���t9�u�Ð1���|���|���|��|빐UH��AWAVL�4NAUL�,
ATSH��H�u�L9��0I��H��I���!�I�T$L9�wxA�$H��I��L9�s<A�4vL��H��A�W@��uI�<'u�I�D$I9�rB�''H��fA�$I��L9�r�L��H+E�A�$H��[A\A]A^A_]����L�I9�sA�$H��H�����[A\A]A^A_]�I�T$�p�H9�H�S��I9�����8���/��1��H��@�oAH��H9�u�A�����A)�M�H�9����A�E�����BA�AA�����BA�AA�����BA�AA�����BA�AA�����BA�AA��tz�BA�AA��tl�BA�AA��t^�BA�AA��tP�B	A�A	A��	tB�B
A�A
A��
t4�BA�AA��t&�BA�AA��t�B
A�A
A��
t
�BA�Af�H�GI�H��������1��
f.�H���A�H�PH9�u���I��1��5���UH��AWAVAUATL�$NSH�
H��H�u�H9���I��I��I���[�H��L��A�U@����A�}4A�>vBA�U8A�>��v5@��uYf�I�GL9���A�?I��I��L9�vUA�}4w�A�>@����]@��
��@��
tm@��u��0I�GI9��}I��A�\A�I��L9�w�L��H+E�A�H��[A\A]A^A_]�D@��'t�@��\t�@��"�Z������r�f��n�f���L�I9�s.A�H��H�����[A\A]A^A_]�@�Z�N���fDI�V�p�I9�I�W��I9�����9���0��1��H��D�AoAH��H9�u�A�����A)�M�L�9����A�E�����BA�AA�����BA�AA�����BA�AA�����BA�AA�����BA�AA��ty�BA�AA��tk�BA�AA��t]�BA�AA��tO�B	A�A	A��	tA�B
A�A
A��
t3�BA�AA��t%�BA�AA��t�B
A�A
A��
t	�BA�A�H�GI�I�������1��
f.�H��A�A�H�PH9�u���I��1����ff.�@U1�H�5�2H��AVAUATS�g��H��tT�����I��H��tBL�-��SI�}H��t2I�] E1�f��;tL���c����t'H��(H�{�A��H��u�[H�6jA\A]A^]�fDK��[A\I�D�A]A^]�fDUH�5z.H��ATI��S�
����t^L��H�=�i���H��#R��H��iLD���H��H���tH�{L��������u�H��[A\]�fD1�H��[A\]�fD���I���ff.�UH��H�E�_H�����]�f���t<D�Dv��D���7H����?ʃ��։���1�D9�u��D��f.���t\UH��ATA��SH���:��H��G�Dd�L��D���H����?A��΃��։���1�D9�u�[A\]�@��f.�UH��AVA�։�AU�A��1�ATSH��H��H���G�D�eL�E�L�M��3���u_�~E�D�cA��H�����D�3E�D�kH�SC0uH�
���H�K@H��[A\A]A^]�H�
���H�K@H��[A\A]A^]�H�C8H���[A\A]A^]�fDUH��AUATI��SH��H�G8H��tC�WH�O��t/��H�YH��L�l�f.�I�D$8H�;H����I9�u�I�D$8I�|$��A�D$H��[A\A]]�fDUH��AWAVI��AUATSH��8D�H�u�E���A��D�oH�G@�օ�u�wH�}�A�]���!�A9�w	A��A�]�!�H�E�A�H�E��DD9�tDE��u~A�E1������I�F0H��INI��H�yH��t=�H�u��ЋU�H��E��u�H�u��&����u�A�^I�GH��8[A\A]A^A_]�A�VA��U�H���f�A�FE�nI��E�I�F0H��tHH�u�1�Ћu�H��A�V@A�U�!�9U�w	A��A�U�!�9��<���A�F����H��81�[A\A]A^A_]ÐA�vA��u�H�뷐�G����TUH��H��AWAVAUATA��SH��H��(L�oH�u�E�tA�������ufL�e�f.�D��H�C0H��M�|
I�H�����L��ЋU�H��H�u��������D�sI�GH��([A\A]A^A_]�H�E�H�E��%fD�H�u��ЋU�H��A9�t2E�7A���tFD��H�C0H��M�|
I�H��uȋS��U�H�A9�u�H�u�D���t�����z���E�7A���u��C����H��(1�[A\A]A^A_]�E�7A���������f��S��U�H�����1��ff.�f�UH��AWAVI��H��AUATSH��XH�u����H�E�H����E�^A�^A�F����M�fD�؉���)��E��M�9��cH�E�E1���H�E�H�E�L��E��H�E�I��H�E�H�E��\�E�_A�_E�S�D��!�9�w
D�����!�9U��(�E���I�EH�E�A�L�m�DA�]�����H��I�G0M�,I�}H����H�u�1�Ћu�H��A�W@E���w����E���A���CA��u H�E�H�M�E��H��A��H�HA���E��I�EA�]L�m�H�E�����z���L��E��I��D������uH�E�H�M��H�HE��A��A��uH�E�H�M������H�HA�^E�^E�S�I�F0��H����D�U�H�u�H�}�1�D�]��Ћu�D�]�D�U�H��D�U�D�]�A�V@D�U�A!�D9�wD�]�A��E�S�A!�E��H�E�I��K�<H9����oA�FH�{D�hA�F�E�I�F0H���yH�u�1�Ћu�H��A�V@�M��Q�!�A9�w	��ʃ�!‰�L�m�H��M)�I�I��H9��kH�M������H��I��H�KD��H��I��A9�u�D�*A�F�P1�A�VA;Vu�A�VH��X[A\A]A^A_]�@A�wA��u�H��
���fDA��t:A��u H�E�H�M�E��H��A��H�HA���E��I�EL�m�H�E����I�EE��A��H�E�H�E�A��E��L�m�H�E��i���I�EA��H�E��D���H�E�A�L�m�H�E��@���A�vA�>H}��u��?���DH�M������H�H����DA�vA��u�H����fDM������H��X�[A\A]A^A_]�@H�E�D�+H�C����UH��AWAVAUATSH��H�_��u�H��H[A\A]A^A_]�@�GI��I��L��E�H�G0H���3H�u�L��1�Ћu�H��A�T$@�M�D�A�D��!�9�w	��ʃ�!�H��L�L9j�����u�f.��H�ڃ���j���H��I�L9ku�A�D$D�p�A�D$E�t$��A9�sA�D$A�D$����H��I��L)�L�u�M�H���E�H������L9��1I�D$0I�~H����D�E�H�u�1�Ћu�D�E�H��D�E�A�T$@A�T$D�E�A�ÍB�D!�A9D$w��B�D!�H��M�H��L9���I�D$0I�zH���ND�]�H�u�1�D�E�L�U�H�M��Ћu�H�M�L�U�D�E�H��D�]�D�]�D�E�L�U�H�M�A�T$@A�t$A�|$H�M�L�U��V�D�E�D�]�!�9�w��V�!�H��I�4I9����AoH��H����H���AoA
f.�H��I��9�u�E��I�|$�C�I�T$81�H��������E�L����E�H��H[A\A]A^A_]���w�?�u�L����������n����ЉU�H��L�H�pH�s�0�3H���N���DA�t$A�$�u�H��f���@A�t$A�$�u�H�����@D�wD!�9�w�U����D!�A!�D9�w�u���D�F�A!������A9�t?�Ao�E�A�:@H��I��9�u�E��:A���D�Ao����H��H��D9�t��Ao&L�u�#I�����H��I�7�0A9�u�M�����H��1�����UH��AWI��AVAUATI��SH��8�GL�o�E��G�E�H�G@��u�O��H��ЋM��Q�A�։U�A!�D9u�w
���!�A��I�D$0H���2H�u�L��1�Ћu�H��A�T$@D�U�A!�D9U�wD�U�A��A��A!�1�E9���1��f.�D�3H��A�����D��H��L�L9{u�A�D$����H�{�H�}�H����E��I�D$0I��O�|I�H����D�U�H�u�1�Ћu�D�U�H��D�U�A�T$@D�e�D�U�A!�D9e�w�U���D�b�A!�E9����Ao�I��K�D%D� E9�u�D�0H�E�A�����I�G1�H��8[A\A]A^A_]�@A�t$A�<$�u�L�����@H��8�[A\A]A^A_]�@A�t$A�$�u�H��F���@A��H�E�H�C1�E�7H��8[A\A]A^A_]�����������A��H��L��oH������@1�9wv��H��HwH�F�f.�UH��AWAVAUI��ATA�����SH��H�����H�M�H�OHHOƇ�I��I���E�I����I�I)�t@H�;L��L����i��H���ƃ�A�����ƃ�H��L��[A\A]A^A_]���}�u�H�{H�sH�D7������C`�Cdt'�D7�����D7����T7�I�EH�{H�sH�D7L�47�����D7���A�D�$L��E����M9eICEH�H9sPv�E�M���'���H;sXr0L�1ɾ�A�����H���Sƃ�I�x@H�1�A�PP����L���I���I�v�j��H��tH�CH�CL�sPI�HCHL�sI���ƃ�A���������E1����ff.�@UH�@�SH��AVA�AUI���ATSL� H��L���ҽ��H�CH����H�����H��SL��L�cPƃ�L9"HC
L�+I�H���SL�cE1�H�KXH�H�CxH�C`�SlH�C H�Cƃ�ƃ�ƃ�ƃ�H�C0H�CHǃ�M��t#H�s(L���nc��L��1Ҿ�d��L���b��[D��A\A]A^]�ff.�UH��SH��H��H����H�CH��[]�ff.��H������uH�GH�G`H�G�f�UH��AVAUATSH��H��X���dH�%(H�E�1��������������I��I��I��Ƈ���I�L9��wL����H�L9��LL��I�}H��H)���g��H���舷��H��p����dD� Aƅ�H��D���F���M�U1�E��H�>�SI�ؾ�I�z@H�1�A�RPA���Aƅ��;�H�M�dH3%(�>H�Đ[A\A]A^]�H�z�w���H��H����L�@L��L��L���)���H��h���H��X���L��H��� v������H��h�������H��L��X����CI����X����S�Kf�L��I��H��L��X���I܈CA�Ed�P�CA�UdL9������@A���tL���v���Aƅ�1������H��SM�E1ɾ�H�I�x@1�A�PPAƅ��Aƅ������L���������1�1�1��-����@���H���1����uAUH��SH��H��H�wH�WH9�tH)����H�SH�S���t�Sd�S`H��[]�f��ff.�@UH��AVAUI��ATI��SH��H�H�{P���v
�����L�sI)�M9�sPH9{t7L��L���t���H�sH�SH��H)�L��������H�CM�M)�H�C���uIL9cPryH�{L��L���*���Lc1�[A\A]A^]�����L��H�������u4I����I���I�����w��H��A����H+CI)��I���[�A\A]A^]�f�L��L��H���B������������DUH��AWAVL�u�AUI��ATI��SH��H��dH�%(H�E�1�H������fD������E�H�{f�EċC`�P�E�H�CP�S`H=����#����H��A����H+SI)�I���
H9{�L��L�����H�sH�SH��H)�L��q�������H�{H�CPK�4>L)�H�{H9���A�х�t1�����D�D�D9�r�HS����L��H����������I���I����I���������L��L��H��fD�e�H���EƋC`�P�EljS`��z�����unM��tnL��L��H���c����������Vf�L�{I)�I�����L���:���f��L��H9��'���H���g������7�����H�M�dH3%(uH��[A\A]A^A_]����UH��AWI��AVAUATI��SH�YH��8D�E�dH�%(H�E�1�@�u�H�������H�E�A�A����H�E�D�����A���I��E�f�E���A�G`�P�E�A�W`M�WI)�M9���I9��H�u�L��L�U���I�wI�WL��L�U�H)�L��g���L�U���ufH�E�M)�A���N�I�GI�G��I�����w$�L�E�I���I�����I������}����L��L��L�E������tɻH�M�dH3%(���SH��8[A\A]A^A_]�I�P����E�����H��A����I+GI)�M9��
���L�E���L�E�M9wPr^I�L��L�����MwL��L��L���������l���H���M�A�A����H������j���I�ݺ�8�L��L��L���"�����t�� ���f�H�E�I�ͺH�E�f�]�1�H��A����]�uA�G`�HA�O`H�u�L���E������Å�����M��tL��L��L���b�����������}������L��1����������������UH��AWAVI��AUATSH��(�����L�o01�M���0H�E��E�I��L�e�H�E�L��H)�H����I�vH�<�G��A���G��D�D�A�L�U�E����I�BH9�rd�}�H�C�I�I������-I�FM��M�n@I)�J�T8M�N0H�C�I�V L)�H��
A����H��([A\A]A^A_]�@M��uSM�nHL��L���L�����H�E�H9���H�U�I�vHL��L��Iv�Sn�����[Lm�E1������I�~M)�L)�L��J�4?�Һ���H�G@H�W���H��L)�I�ň���H�CM��J�T>M�n@I)�L)��}�I�V M�N0�+H�������H�I���l���L�U�L�I����������E�M���T���I�~M)�L��J�4?�8����<���L�m�L���D�M�fHH=���t0Mf�����M�f H9������A�H��([A\A]A^A_]�fDL��1���I�FHH���L��L��H����I�FH���H=���tغ����M�fHMfH9�t@H�덐H���SM�AƆ�1ɾ�H�I�x@1�A�PPH��(�����[A\A]A^A_]�M�f �
���H����@H������u��DH�G`@��A��A����H�YR���t$9�t"H�PH1���H��H9�t�
����u�1��@Hc�H��H���ff.��UH�����H��tH�{o\H�1�]�@�]�f�UH��AVAUL�-�RATA�US��tNI��I�]E1��f.�H��H�C�A����t)H�3L���ֵ����u�Mc�[K��A\I�D�A]A^]�D[1�A\A]A^]�ff.�f�UH���w���H��tH��n\H�1�]�@�]�f�UH��ATL�%�[SI�$H��t9H�8H��t�@�c���I�$H�<H��H��u�[H��A\]�F���fD[A\]�ff.�U�8�H��AUATSH���d���L�%}�[H��I�$H����H�H���H�j�H��H�����������H�sL�kH�����H�����������H�sL�kH�����H�����������H�sL�kH�����H�����������H�s L�k H��t_�H����������_H�s(L�k(H��t:H�ǹ������;1�1��r���H��H��[A\A]]�@I��DH�=i�<���I�EH�3H���H��h�H����€�����H�sH�SH�����H����€�����H�sH�SH�����H����€���twH�sH�SH�����H����€���tRH�s H�S H���i�H����€���t-H�s(H�S(H���DH�ǹ��������DH�=h�L���I��H����I�$H�;H���#L��蘲���������H�{H�CH����L���w����������H�{H�CH����L���V������l���H�{H�CH����L���5������K���H�{ H�C H����L���������*���H�{(H�C(H��tL���������������f.�H�=@g�d���I��H������I�$H��H��[A\A]]�fDH������H��H�=�f����H����f�H��L�����H��H��H��A��?wD��H��t�8u�Rf���f.�H���ff.�UH��AWAVAUATSH��H��xH��x�H��H�5�H��`�����dH�%(H�E�1�H��H�����~���H����H��H����H���H�������HDž��)���H��tUH���H��h�H��tB1�H�5�G���7��I��H��u7H�}�dH3<%(���KH��x[A\A]A^A_]�H�Y ��H��h��ƅ��E1�E1�L����@L��L���9��H�����
���H����L��H�I��H��DQ t�H��H�H��DQ u�E��u<"t�<'t�<!��<;�y<\A��<[��H��p�L����E���A�����_����=H���J���H��p�H��I��I��u�I��I�G��DA u�A�D����M������I�AI�QA�I��DA t@I��I��DA u�L��H��p�H�����K���H����H��p�L�H�x���Dy H��t�H��H�x�H���Dy u�A���'�d��"�[H��I9�����L�@���@�1I��H��L9���A�7I�@��\u�M9�t�A�wI�@��b���/@��r���
@��s�	@��t�)�	I��H���f�H��� H����H���ȥ��H�������L�HL��L��p��)���L��p�H����L�H�P��DQ t@H��H�P��DQ u���H��H�=�b�����tg�H��H�=�b������E�������H��`�L��1�H��x�D�@��������fDH�H������E1��y�������H��`�1�L��H��x�D�@�������H���]H����H��赤��H����H�P�H�����DQ tf�H��H�P��DQ u�H�����H���L�����@I��I�7H����H���h�����u�A�ƅ���:���1�L����4���������I��@��'t
@��"�����H�����@��nu-�
I��H�����@��'��@��\��@��"���\A�wH��I��@�q��f����H��H��x�H��h���D�������H��H��p�����1�H��H��x�L�<H��h���L����L��p�I��'���A�ƅ���I����I��H������
I��H�������'I��H�������\I��H������"I��H������ I��H������b���f�UH��AWAVE1�AUATE1�SH��8H������H������������dH�%(H�E�1�H��t	�>�L�->�[H������L�=�nI�EN�0M��tEAWL�`�1�j/��H��菤���H��蒭��^_����I��I��0u�H�=�_�Ҩ��H��tKH�
MnH������I���QL��_�H��j/�1��)����H���,���ZY����D��H�U�dH3%(��H�e�[A\A]A^A_]�D������H������H��H�������|�����A��I����H��mI��H�������PL�_�H��j/�1�茣���H��菬��AXAY��1����`���������H������H��H�����������?���fD������H������H��H������������A������\���f.�f�H���[H�½SH�P�f.�H��jI��H�H�G���?H�GH��H��H��H)�H��H�H��H��H��H)�H)�L��H��L��H�7H)�H��H�H��H��H��H)�I)�L�G�f�H�L�G1�H�wH�@L�H��I�D!H��H�1�H��H�WH��xf��H*��^GÐH�ȃ�f�H��H	��H*��X��^GÐUH�H��H9�s|A�qV4A�A�5W0Pf��<	t.< t*L��M�Ã�?I��L�I�H��L�I1�L��H��L1�I�H��H9�u�A���A���L�M�L�E��~E�E�]�fDH�E�qV4H�E�5W0P�~E�E�]�f.�L�L9���H�FL�WH9�A��L9���A	�H�BH9���L9�A��D	�A����H�A�H����I��1�I�����o�of�H��L9�u�H��H���H�H�H�H9��Z�2�H�FI9��F�F2B�GH�FI9��/�F2B�GH�FI9���F2B�GH�FI9���F2B�GH�FI9����F2B�GH�FI9����F2B�GH�FI9����F2B�GH�FI9����F2B�GH�F	I9����F	2B	�G	H�F
I9�v{�F
2B
�G
H�FI9�vh�F2B�GH�FI9�vU�F2B�GH�F
I9�vB�F
2B
�G
H�FI9�v/�F2B�G�fD1�fDD�D2D�H��H9�u�ÐUH��AWI��AVL��@���AUI��ATI��SH��`���H��H��dH�%(H�E�1��L���v���L��H��L�� ���H���H��L���&H���^�L��H���nH��L���H���;�L��H���K�L��H���;H��L�����L��L��L���=���H�E�dH3%(uH�ĸ[A\A]A^A_]��ǡ���UH��ATI��H��SH��H��觜��H�}�H��H���8���L�M�L�E�L��H�
�eH������1�����H��[A\]�f.�UH��AVI��AUATSH��@H��t�:H��uA�H��@L��[A\A]A^]�DH��I��M�n����H��H�}�L������L��H�}�����L�e�H�U�H�u�H3U�H3u�L�����L�������Y(e��(�-�(f(�fT�f.�v3�H,�f���5i(fU��H*�f(����f(�fT��\�fV��X�dH���,��C�I9�u�L������Y�d�
G(�=(f(�fT�f.�w1�,�A0A0FA0FA0FA0FA0FA0FA0FM������fD�H,�f���%�'fU��H*�f(����f(�fT��\�fV��f.��U��H��H��PdH�%(H�E�1������B���"��H�FI��H�����E���H��Lc�L��c1�I���L�]���)�A�:H�LjU�H��I��H�I��H�Ɖ���)�@��A�:H��A�H��u��DI��I��A�C�I�P�B���u�H�u�dH34%(L��ur��D�B$��"wHH�FH��x��I��H���N����0I��f��@H�V�-H��H��H���I����f�E1��L�]�Lc�L�
c�4���耞��UH��AWAVAUATSH��0H��8���foc�o�ov�on fo�fo��of0�Of�f��fo�D�Wfq�fq�f�͋fg�fo�fg�D�f��fq��A��fq�fg�fo��fg�fo�f��E��f��fq�A����fq�fg扽@���E��fg�fo�f��D��L���f��fq�fDo�D��D���fg�fq�f�҉�H���fg�fo�fD`�D��P���f`�fDo�fo�fD`�fh�fh�fh�f`�fh�fo�f��fEo�fa�fDa�fEo�fAr�fr�fDa�fA�fDo�fi�fDa�fDi�fi�fAr�fr�fDi�fAr�fr�fE��fA�fA��fA��fA~�)}�D�e�f��f~�)m�fo�fo�A��9�y�Zfa�fa�fr�fr�fo��f��fo�fiʉ�D1�fa�fi�D1�D!�D�}�D!�fi�D1�fr�fa�1�fr�fr�fi��C���y�ZE��4�y�Zfr�f�f��f��щ�f�f���)m�f~�fA~��D��)E���A1�A��D��A��!���D1�A1�A��D�E��D�D�m�A!��A1�D�u�f~E�G���y�ZE�A��A��E�D���y�Z��1�!�1�A��>�y�ZD�E���A��D�A��A1�E!�A��A1�A����A��}����y�Z��D1�!��1��D����ϋM���1�y�ZD��1�D!�A��D1�F���y�ZΉ���Ή�D1�!���1�D�A��A��D�D�U�E���y�ZD��1�!��D1�D�A��A��D�D�U�G���y�ZA��A1�A!��A1�E�A��A��E�D�U�E��:�y�Z��1�!��1�D�E��A��D�E��3�y�Z��1�A��D!�A��1�A��D�D�D�]�E���y�Z��A��D1�!�1�D�A��E1�D�D�]��A1�D3M�E���y�ZD��A��A�1�A��!��D1�D�D�D�]�G���y�ZA��A��A1�A��A!��A1�E�D�U�E�E��E��9�y�Z��1�!��1�D�E��A��D�E��E1�D3M�D3M�A�E��E��1�y�Z��1�A1�3E�3E�D!�E1�D3U�A��1�A��E��D1�D�A��D��|���A��D�e�D�E��
�y�Z��D1�!���1�D�A��A��D�E��E��E1�D3M�A1�E1�A�E���y�ZD��A��!�A��D1��D�D�A���A1�F�����nE��A��A1��E�A��A1�A��E��E�D�E�A1��E��E1�D3E�A��E1�A�A��8���nA��}�E�D�m�A1�D1�A��A1�D1���E��E����7���nE1�A��A��u�A��E�D�m�D3m�D1�A��1�E1���E1�A�������nA�D��A͋M�1�D��D1�D1�D1�A��D���E1�A�������nD1�A�D��D1�A����AԋU�3U�3�|���1���F�����nD�E��A��D�D�]�D3]�E1�A1�A��D��l���G��;���nE��E1�E1�E�A��A��A��E�D�]�D3]�E1�A1�A��D��h���G��3���nE��E1�A1��E�E��A��E�D�]�D3]�A1�A1�A��D�]�G��+���nE��A1�E1�A��E�E��A��E�D�]�D3]�E1�D3�l���A��D��d���G��#���nA��E1�E1�E�E��A��E�A��D�]�D3]�A1�D3�h���A��D�]�E�����nD��D1�D1�A��A�D���D�D��|���D3]�A1�D3]�A��D�]�G��;���nE��E1�E1�A��E�A��A��E�D�}�E1�A1�D3�d���A��D�}�G��7���nE��E1�A1��E�E��A��E�D��|���E1�A1�D3}�A1�E1�A��D3�l���D3U�1�D��|���G��/���nE��A��A1�D��x���3E�G��"���nE1�A��A��D3�h���E�E��E1�D3M�A��E1�A�3�|���E�E�A�����nE��A��E�E��A��E��E��E��E1�E1�A��A�D���A�D��A��D��A��1�A1�E��D3�d���D1�A��1�D3�x���A��3}�1�A�D1�D��t���3u�G�����n��3�t���D�G��8���nA����D�E��A�؉�p���E1�E1�A��E�A��A��E�D�����nD��D1�F�����n��D��1��D���D��1�A���މ�D1��D�A��D��h���ދ�l���E!�D1�3�|���1�3M�D1�3]�D1����A�׍�ܼ���l���F��	ܼ�����D	�!���D	�	�D��x���Aɉ�D!���A1�D3�p���Aɉ�D���!�	��D�����É�h���B��ܼ���d���E��A	�A1�D��E��A��E��A!�!�E1�D3�l���D	�A��E���A����A��A�D�]�D	�D3]�D3�t���!�D��d���A��:ܼ���E1���D!�A��	�D��`���D���A��3ܼ�D��E��A!�	���D!�E��A	�A����D�A��A�A��3]���E!Ë]�3�|���D1�3�h�����B��ܼ�A�����u�E	�A!�E	�D�]�D3]�D�E1�E��D3�d���A��A��A�A��ܼ�D��	���D��A��!�D!�	�D�����Ƌ�p���1�3�`�����|�������B��ܼ�E�ȉ�\����U�E	�D��E��E!�!�D	�A��3�x���A��3�l���A��3U��D��A��D1�A��A��8ܼ���D��X���D��x���D	�D3�t���D3�h���������D3�\���D!�D!�	����Љ�‰؉�D1�!�D1؉lj��	���D!ȉ}�B��ܼ�	�D��lj�����E1�B��ܼ�A��A��A	�D��A���A!�!�D	�A��A���D��A�����d���A	�A!�D1�3�X���A����t���A��D�e�A��4ܼ�A��D1�A!��E	�A��D�A��A��A�`���1�3u��ƍ�ܼ��ى�T���D	�A�ȉ�D!�A!�A	�D���D�A�ȋ�p���A���D3�l���D1�3M�D1��A�΍�ܼ�D��D��	�D1�3U���D��A��A��!�D!�A�ŋ�p���	�D�����D1���D��D	��C��%ܼ�D��h�����D��A��D!�!�	Ή�����Ƌ�\���1�3�T�������D!���M���ܼ�����l���D	�D!�	�D1��ȉ����X���1�D1����B��ܼ�A��|�����d���A	�D��A���A1�A!�D!�D3}�D	�A��E1�A���A��D��A��G��ܼ�A	��D��A���A!�!�D	�A��A��A�D��A��D�E��D��`���E1�E1�D3E�A�A	�3]�E1�D��x���A��8ܼ�A��A!�A!��E	�D�A��A��A��}�1߉�3�|���	���A�؉Í�7ܼ���!�A!ȉ�t���A	�D���D�A�؋]�A�T���D1�D��\���D1���D1㉵p������bʉ�1�D1�A���D�����D1�3�x���D3e��Ɖu����bʉ�D1Ή�D��D1�A��׉�D1��1���D��D��X���D1�D1�3�t������bʉ�l���D��Ɖ�D1�3�|�����3U�ƋE�A�ӋU�D1�3�p������h���B���b�E��A1�D��A��1�A����D�A��A��3U�A1�C���b�D��d���D��x���E��A��A1�A��Aĉ����T���D1�3�l���E�A��A�A��	�bʉ�D�M�1�A��D��A1��A��A�D��1�A1ȉ�D3�h���1�A�A��A��8�b�D�ً}�E1�A�A��D1�3�t���A�3�d�������D1ፄ7�b�A�ʋ�p����M�E1�D1�A��D3u�A�1�D��3u����D1�l���A��b�D��D1�D1�E��D3�|����D1�A��D1��D��E1�1���E1�E��A���B��!�b���E1�AƉ�A1��A�B���b�D�]�A�D��E1���D3�t���Aŋ�h���D1�E��A1�1��E��D��|���D3�x���F���b�E1�D3�d���A��E�E��A1�A��A��E�A��G���b�E1�E1�A��E�E��A��E�D�U�E1�A1�A��E���b�D��D1�D1�D�E��A��D�A��D��x���D3�p���E1�A1�A�G��0�b�E��E1�E1�A��E�A��A��E�E��D��t���D3M�D1�E��A1�A��A��C��+�b�E��E1�A1��A���p���3�l���1�E�E���}�A1�A1�A��E1�A��C��"�b�D��h���A�D���D1�A�1���l���3�d���D1�1�E�ȋ}��D1�A��A���bʉ���D1�D1�1�D1�A��A1���b�D��A��D1�D��ډ�D1���A��ڋ�P���B���bʉ��L���D�E���E1�A1��A�H��8���A�D�0�P�H���D�D���D�@����HD�HD�hH��0[A\A]A^A_]�ff.��fo�O������GH�G�@UH��AWI��AVAUI���4�ATS�@H���G1�������?�A�w@��A�G�Ѓ�����)��A��A�G��M�tI9�v H��L��L��[A\A]A^A_]�7��������������tA�EA�����M�wL��H�U�L���M����MȸH�U�)�H9�w�A��K�t%L��H�U��d�H�UȍC�[@H9�r�I�H)��Z���f.�I�EI�~M��H��I�K�D%�K�D&�I)�M)�A�A��A���d���A��1��ƃ�M�1L�7D9�r��G���M�L)����A�EA�C�D%�C�D&��&���C�D%�fC�D&�����ff.�UH��ATI��SH��H��dH�%(H�E�1�H�FH�H�E�F����?��7�#�8)�H��H�5b�S�
���H��H�u�����H�{H���A�$���A�D$���A�D$�A�D$�CA�D$�CA�D$�C��A�D$�CA�D$�CA�D$�C
A�D$	�C��A�D$
�CA�D$�CA�D$�CA�D$
�C��A�D$�CA�D$�CA�D$�CA�D$�C��A�D$�CA�D$1�H�H�CTH)��K\���H�H�E�dH3%(uH��[A\]���x)�����过��f.�D�ff.�@H�GH�H�G�@U�H��AVAUATI���SH����I��$�H����I��H��L�m߻I��$�����0A�D�H��H��t I�D$@��t�A�D�H��H��u�A��Ao�
�#�AofA�F&�1�fo�L�AofA�F*fo�LA�F!!ft�ft�A�F,$"ft�A�F:	fA�N>A�F@f��fo
�LA�F\fA�V_f��A�F|A��Ao^ft�f���Aof f��A��Ao^ ft�ft�f���Aof0f��A� �Ao^0ft�ft�f���Aof@f��A�0�Ao^@ft�ft�f���AofPf��A�@�Ao^Pft�ft�f��f��A�P�Ao^`�Aof`�Ao��A�FXft�ft�A�FBf���Aofpf��A�`�Ao^pft�A�Fxft�f���Ao��f��A�pft��Ao��ft�f���Ao��f��A��ft��Ao��ft�f���Ao��f��A��ft��Ao��ft�f���Ao��f��A��ft��Ao��ft�f���Ao��f��A��ft��Ao��ft�f���Ao��f��A��ft��Ao��ft�f���Ao��f��A��ft�ft��Ao��ft�ft�f��f��f��f�A��A��A�FbA�FN A�Fn H��[A\A]A^]�D�C�H�U�L��L��E�I��$������j������I�D$@���<����A�D����H���[A\A]A^]�ff.������fDH��B\H��H���P�8����H��B\H����8���f.�UH��AWAVAUATI��H��@���SH��H��(H�����L���p�H��tD��p���I��~�H��([A\A]A^A_]�@H�B\H��L��8�L�I��H��t�L�=��SL��H���H��H�����H�5EA\L����I��6��HH����H����1�H��L����������ƅ���I��H�������XI��H���]�����H��L��L����H������I�������H�������XH��H���������H���=�L;�����uTH�����L��L������uL�����������������@L�����L��1�1�H�5�F��!��L���x����I�H�Ǻ%H�5NF���H��1�L����H�����Ɖ����I�������������I�H��H������(H�5�E�� �����H���S�H�����I���H���(���f�I�L��L������L��'H��E��L��H��L�ꋽ����:�H��L��������H������tH���ID�I�L����U���H���HE���ff.�f�UH�����H�����H���H�U��~E�H�E�H�����E�H�E�H��S���~E�H�J�RH���H��H�����]�@UH��SH��H��H�M�[H�0H��t%���;�H��H��H�]�1���IIf�H�=�D�t���t(E1�H�
�DH��1�H��
H�5�D�N��@H�5�DH�=�D�y��u�H��L���
L�
�DH��jL��H�
�DH�5�D��XZ�b���ff.�f�U�@1�H��ATSH���H�t�[dH�%(H�E�1�H��L���?�{���@1�H�=h�[��z��H��E1�H�5���jH�
lYV�A�@jH�5�<\jPH��=\j�8�u8H��01��f.�H�;H��tH�@t�����tH��H��L9�u�H�� ���L�����H�����L���I����lL��H��H�Index.xmf�P1�H�����H�E�dH3%(u	H�e�[A\]��	~��f��H�W�[H��H�<ЁOH�=�;\�<ff.�f�UH�(�[H��H��ATL�%�;\S�H��H�<ЁOL���<��u[A\]��H�SH�sL���:�o@C[A\]�f�UH��AWAVAUATSH��L�w M���2D�/H��E���;A����L�5��[D��M�$�M����M�t$M��tL�{L��L��������.�CD9k�aD9k�GAD$�A�D$��SA�$H�{0H��t��,�I�D$0H���^H�{H��tI�|$�QH�{ H��t)H�C(�H�p�>�I�D$ H��� H�C(I�D$(f�H�C 1�H�C(H�CXH�C8H��[A\A]A^A_]���f�1�H��[A\A]A^A_]��L�%a�[M��$@��I��M9�t�I�$H��t�H�p H��t�H�=nVVL��H����P@��u�I�$D�(D�+E��t�A���w��j������C���D�� �C���D����A�$H�{H��tI�|$��H�{ H��t)H�C(�H�p��I�D$ H����H�C(I�D$(H�{0H��t���I�D$0H����H�{@H��t-����I�D$@H����L���N����H�{HH��t���~�I�D$HH���`H�{PH��t���X�I�D$PH���:H�{XH��t���2�I�D$XH���H�{hH��t����I�D$hH����H�{8H��t���I�D$8H������AƄ$�H�=�fA��$�L�CA�D$L���A���€�A�����TE����H�$gWH���I��$�H���I��$�����w���A��$�H���
�"I��$�H���I��$����A��$����A��$����A��$����A�D$A��$�L���P������E���H�
�LWH��H���I��$�H���I��$�����w���A��$�
�L��H���I��$�H���I��$����A��$����A��$����A��$����A�D$H�A@A��$�I�D$@�����(���H���[A\A]A^A_]�@1����l�I�ċM�$�M��t�I�|$L��1�I�$IDŽ$�H��H)�������H�D�+���DA�$�_����1�M��L��D���'��1����H�C�H�p�]�I�D$H���?���H�CI�D$�"�����H�=3L����€����I����H�=L����€����*����H�=u�L����€����2E���UH�531WH��H���I��$�H���I��$�����w���A��$�
�L��H���I��$�H���I��$����A��$����A��$����A��$����A�D$H�F@A��$�I�D$@���������A�L$�%���DH�C�H�p��I�D$H������H�CI�D$���f.�H��KW�@���H�2WH�
�IW����H�=�L����€���u$E��uOH��V����H�>WH�5�/W����H�=�L����€���u!E����H�'W���H���V���������E����H��RI��$�H���RA�<$ADŽ$�I��$�H�I��$���I�|$���I�|$ ����I�|$@����I�|$P����I�|$H�����I�|$h�����I�|$Xu��tB��A�D$���E��u$H�n�R�N���H���V����H�֊R�6���H�ʜR�*���I�|$8u��P�����W�1����wH��{[��H�<���Ð��H�ǻ[H���f�H��{[��H��H�@8�ff.�H�=2\���[�j.f.�UH��AWI��H�5��AVAUI��H�=b�[ATSH��XdH�%(H�E�1��7y��H� {[I��L��@�
@I��M9�tWI�$H��t�H�p H��t�H�=.NVL��H����P@��u�I�$���t#H�M�dH3%(��H��X[A\A]A^A_]Ð�H�5�8L����t����ux1�L�e�M�E�@A��H�{8L����L��@��3越�
@H��L9�t7H�H��t�H�p H��t�H�=MVL��H����P@��u�H���Q���@1��F����r��@UH��AWAVAUATA��SH���dH�%(H�E�1�H��y[J��H��t�C
t4H��[J��H�U�dH3%(H����H���[A\A]A^A_]�H��5\I��I��H�x(�2{��H���`u���C�	��������uH�{@�,H�{P�!H�{H�H�{h�H�{X��H���H�H��tL��H��Є���H���H�H��tL��H��Є����KH��[J���f.�1�H�'5\H�x(H���jH�=5\�n�����f�L������L�{L��L������&�L��1�H��6H��L�����1��ɎL����L�����L��L��L�����C����@1��Q���f�H�CH�
%x[H�����L��@�DH��L9���H�H��t�H�pH��t�@ t�H�=%KVH�����H�����H����P@H�������u�H���C���w���9�o���H�
�w[H��H���[����B
�Q���H�{P�cH�{H�KH�{@�3H�{h�%���H�RhH�Sh����H�ɎSH���`��������L�{8M�����H�=(5L�����������M�W�]L��L������
j��H�������I��(L�����L9������L)�L�����L�ֹ!L��H��I���Pu��L��BƄ=���H���<������d���;�\���H��v[��H��H���F����@
�<���H�{X�1����C�'���H�@XH�CX����f.��C���H�J@H�K@���H�JHH�KH���H�JPH�KP����n��ff.��UH��H��AWAVI��H�=�[AUA��H�5K�ATL�%)SH����LD���s��L�=�HVH��u[I���L�H@H��H@H�E��f�I���L�H@H��H;]�tNH�H��t�H�pH��t�D�ht�L��L��A�х�u�H����tH��[A\A]A^A_]��I���L�H@H��L��L��A�х�tH��1�[A\A]A^A_]��H��t[L��@�	H��L9�t�H�H��t�H�pH��t�D�ht�I���L��L���P@��u�H���d���f�UH�5�H��S��H�=��[H���r��H������wH�
|t[��H��H��t9t
H��[]�fDH�B H�t�H��HD�H��[]��UH��AUATSH��HdH�%(H�E�1�H�z�SH�98t(��I��H�='�[H�5p��r�����v3A��uU1�H�M�dH3%(��H��H[A\A]]�f.�L������L�����L���L�����H��u��DL������L������L���"�I�t$��H�Index.xmH��lf�P�
ƅ����#�Te1�L��L����-�1��K�����k���UH��AVI��H�5��AUATI��H�=2�[SH��H�� dH�%(H�E�1��q��L��H�����L��A���
�E��uh��u#1�H�M�dH3%(ugH�� [A\A]A^]�f�H������H���A��l�H�Index.xmH��H��f�PL��1��d��f�H��D��L���R���H��u���j��fDUH��AUI��ATI��SH�� ���H��H���dH�%(H�E�1��L�L��L��H������H�M�dH3%(uH���[A\A]]��j��ff.��UH��AVI��H�=��[AUA��ATI��H�5/�SH��H�� dH�%(H�E�1��o��H��D��L�������un��u)1�H�M�dH3%(uoH�� [A\A]A^]��H������H������l�H�Index.xmH��H��f�PL��1����f�H�ډ�L������H��u��{����i��@UH��AVI��AUA��ATI��SH�� ���H��H��dH�%(H�E�1���L��D��L��H������H�M�dH3%(uH��[A\A]A^]��2i��f�UH��ATI�� SH��H���v���H��1�H��tH�[A\]�@L��H�[A\]�UH��ATI��H��SH�����H��1�H��tH�[A\]�f�L��H�[A\]�UH�B�H��AWAVAUO�,ATN�$SH��H��H�u�LE�L�M�A�I�L9���I��H��I��I���L��H��L��������|���<�;9<
�!<
������I�WL9�wSA�H��I��I9�w�L��H+E��I<'t<\t<"u�@I�WI9�r"A�\H��A�GI����fDHc�L�I9�sUH�E��L��H+E�A�H��[A\A]A^A_]�@��u��v�����0�f��r�f�H�S�x�I9�I�W@��H9���@��_���V��1��H���oAH��H9�u��A������A)�M�H�9����A�E�����BA�@A�����BA�@A�����BA�@A�����BA�@A�����BA�@A��t|�BA�@A��tn�BA�@A��t`�BA�@A��tR�B	A�@	A��	tD�B
A�@
A��
t6�BA�@A��t(�BA�@A��t�B
A�@
A��
t�BA�@@Hc�H��I�H�����fD�n����fD�Z����fD��1��
f.�H���A�H�PH9�u��I��1��	���UH�B�H��AWAVN�4AUATO�$SH��(H��H�u�LE��L�M�A�I�E�L9��!I��H��I��f��}�vJI���L��H��L�����~/Hc�L�I9�stH�E��L��H+E�A�H��([A\A]A^A_]��<'t)I�WL9�w�A�H��I��L9�r�L��H+E����I�GI9�r��''H��fA�I����DH�S�x�I9�I�W@��H9���@��7���.��1��H���oAH��H9�u�A��A��A���D��E)�I�4H�D9�����E�����B�FA�����B�FA�����B�FA�����B�FA�����B�FA��ty�B�FA��tl�B�FA��t_�B�FA��tR�B	�F	A��	tE�B
�F
A��
t8�B�FA��t+�B�FA��t�B
�F
A��
t�B�Ff.�Hc�H��I�H��x���fD��1��f�H���A�H�PH9�u���I��1�����U1�H�5��H��ATS�a��H��tV��<b��I��H��tDH�=RH�=�(�@H��H�;H��t$L���b����u�C��t��uH�CH��u
H���[A\]�@UH��AUI��ATI��SH�����H��H��dH�%(H�E�1���iL��H��H���vH�ǸH��t�L����l1�H�M�dH3%(uH��[A\A]]��Pb��U�@H��AUI��ATSH���qH����f�L��H��H��H�5@@ @0�5���H�=�A���&c��H��taH��H��L������A�H��H�5k�L�����H��H�5(L��A����A�E��H��H��[A\A]]�H��1�H��[A\A]]�H�=��b��H��u��ff.�f�UH��AWAVAUATI��SH��5H�����D����dH�%(H�E�1�H���3H�����H��I��1�H��H�����*�;~��H��1�L��L��1��~H����H�
��A�H��H��H���,H�� ��1�H��H��H�����
�H������8��%�=���H�;\��1����I��H���bH�QS��M��H�����H����H���HH��H����	I�GH����1�1��||I�H����	H���[�8�H�����E1�Dž��H����H����H�����H��H�����H�����H�����I�wH����I�H�������=d��H��H����H�::V���������L����L�h@H��A�DtfDI��A�$H��A�Du�<;�D<!�<[�
E����A���c���M��1�1҄�u�M@<#��1�I��A���t3��<'@��<"��@�t����@��t�<\��!�I��A���u;=L���JY��H��H��LE�A�F�A�DtI��A�F�A�Du�H������--L��L��H�����L)�f��@��{I��H����H�����H�����H�;��rH�� ��H����H�{H�����%�����A��T����.H���
���fDH�H�������I�wH���.���H��|S�H����H���PI��H������H��|S����L��H��$H���I���H�����b��1�H��H�c|SH�L��H��tH���lX��H��L��A�����fD@���?@8��\���@��#��1�1���������	��A�D$I�\$A�DtH���A�Du�
H�5�(H���MX�����-�H�5�(H���1X����������CH��A�D����CL�cA�DtDL���CL�cA�Du�L���W��H��P�A�DtfDH���P�A�Du��L9��NL���LW��H=��r�������H�ȻH�����L��H��D�@����J����<\����!�����f�H�����H��H��H�����Z�����f�H������a����t�VT���������������H��RH�����H�h"H�81���`��1��OD����H����H��#H�νR�H�81��`��I�wH���`I�?1��hyL��� ������H�M�dH3%(��H��5[A\A]A^A_]ø��H�����H�5�tSH�{����u�H����H�;�eoH�� ��H���v���H�{H�������������Y����C
L�c
A�D������H�85VL�cH�P@�C�DtDI��A�$�Du�L���hwH�
5V�P�H�I@�Dtf�H���P��Du�A�$I9�IC�"���'�I�UA�E=L9��]H�x���
I��H��L9��BA�$I�t$��\u�I9�t�A�L$I�t$��b�n����r�n����s�n��t���	I��H���I��A�D$I�\$A�Du�H���}T��L��P�A�DtH���P�A�Du��H9���� H���e�H�����H�������pH�����Dž���H��������D�����D�����H�����I��L(I�}�]#I��H��rSH�0I��H��u�I��I�6H����L���X[����u�L�����I�uH��A�DH�
.�L���#L��
H����������!�%����t������D�H�JHDщ��H��H+����H���w'����H�ҷH�����H�����H��D�@���H���������������;A�����D�����H�������� ���fD��nu*�
I��H��������'����\����"���\A�L$H��I��J����L���R��I�D��P�A�Dt�H���P�A�Du��H�ƹRL��H��D����L�����H�81��\���l���I���]L���Q��H��u��H���P�A�Du��L)�H�����L��H=�H�¸�HG�H��E1��;tH������H��H�p����A��A�������A���I�wH����I�?1��tL���m�1��K���A����H�VuS��H�5rH��H����H����1�1��rH�
'uSH��I�H��H����I�?I�G����L��������I�L$H9����:P�����H��I������H��tS�H����H���PH��H���x���H��tS�TH�5�H��H��� I�?1��sH�
ztSH�߉�H���(L���d�������?���D����H����H�e����I��H���R����
I��H���C���� I��H���4����"I��H���%����'I��H�������\I��H������D����L����H�
� H�J�RH���H�81��$Z���p���H��sS�H����H���PH��H������H��sS�PH�5�H��H��� I�?1��rH�
WsSH�߉�H���(L���A�1�����D����L����H�
= �O����;T��ff.�H9=	nS���DUH��AWAVAUATSH��H���[H�}�L�-��[H���[L�%��[�L���[H�GI�EH�I�$A�H����I���H��H�=���€�����I�AA�M�yA�H����H�ƹH�=������H��[M�wL+u�I���H���[�H�H���<I�uH��tH���[H9�t1�H�����I�]I�4$H��tH���[H9�t1�H����I�$H��D��[A\A]A^A_]�fDM�y1�L�5D�Kf�I�}��H�;��L��H����L��I���H��H�I��I�H��t:I�$H��u�H�5�H���L��I�t�H��I��I�$I�H��u��M��L+u�H�I�����DH�5�H���QL��I��a���H��I�E�{���f�A�H�=��S��H����fDH���W���M��L+u�I������H���7����j���f�UH��AWI��1�AVH�E�I��AUI��H��ATSH��H��L�%�\H������L����E1�A�<$H�����^H����H�����H���I�?����H��1ɺjHc�A�<$H��`���E1�A�H��H�������g�ZY����I�7H���������H�����)H���[H��I�8��H�I�}Dž@���H��H���L��P����t��D��I���CI�}u�@���H��@���L����H��0���H��[L������~����H�8�����)� ���H���i�8K���tL��H��H������_H�����H��I������@��������BE1�H��L���L�����A��E��H������Rf�D���@���H��H��I��I�uA���M��H�����H�<H�F�[H�0�vM����@���A9���H��P���D��M�,�H�<�I�}�lJ��H�� ���A�4H����^H��H��u�����H���R�2�H�=�H��W���H�e�[A\A]A^A_]�L�����DH�������h���H������DH�4�@�Y^H��H��t�D��h���L�`@H��`���L��J��M���L��H�_�[�8�lH�����Hc����H�����D�H�������M�'HcI��foM�foU�Sfo]�[ foe�c0�!�H���[�8��H����1�H������H�����H�
H�e�[A\A]A^A_]�fD�L���L�����H��I�ԉ�@���L��P���H�H�}�[L�#M���	L���H��H=������H�;�E1�H�� ���L��H���!����L�%�RI�$�2�H�=-�HU���H������������1�H����1��_����������A�FH�
����h���H��fSK��h����P��h���I��H�����D��h���Hc���^���I�7K�<�H���J��H�����D��h�����5����L����H���cH�����L�(H�����H�� ���H���M������L������jfDH�	�[L�#M��t:L���YG��H=�w*H�߫H���E1�L��H��������������H�����H�����L�(M������A�}t�L�=��L��HDž���L�������8�#L�=�eSM��t�L�%�eS�fDI��M�<$M��t�L���F��L��H���F��H�H���w�H���E1�L��L��L������y�����j���L�%íRH��1�H��I�<$�P������L�-ҪL��HDž���L������C�8��L�-�dSM���
���H��dSL�� ���@L����E��H=�wE1�1�L��L��L���e����D���H��L�+M��u����@L��������@I���H�5�A�L�-&H�1���B��H������8I��~(fDI�L����J� 1�I���B��A9�H�=ԩ�zN�������1����H���������L���-���DL���[�T���@U1�H��H��@�oG��oO��oW��o_�H�}�)E�)M�)U�)]��\���UH��AWAVI��L��p���AUATSH��xdH�%(H�E�1�H�!�HDžx���H��p����H�=��8H�4cSLD��M��H��[H�8H��t,�M��H�E�dH3%(��H��x[A\A]A^A_]�f�L���XH��t#H��RL��H�0�AI��H�=����H������E1�1ɺH��H��H��h���H�;\�8�dVH���l�H��H����H�0L������H����DI�?M��uO�f.�H��[H�8H��t#H�R�RH�0�H��H�C�R� H�0�I��I��I�<$tZH�3�>t�1�L���������~u�.H��I�$E1�H��L��H�
�1�I����eH��RL��H�0�0H��I�<$u�H��H�3H���A���H��h���1��Z����H���R�4�H�=.H��O�����G��ff.�@UH��AUI��ATSH������H�W�R�H�=H��;O��I�}tlM��H�3� I���H��I�|$�H�3�rG��I�<$u�L�%��[I�<$u.�3H�3� I���gH��I�}�H�3�;G��H�3I�<$�/G��I�}u�H��H�=�[A\A]]�K��f�UH��SH�]�H��hdH�%(H�E�1�H��H��HD��L���OH��H���!d1��H���R�H�M�dH3%(uH��h[]��gF���UH��H��H���H�E�H�M�L�E�H�E��PP�E��ÐUH��L�M��~E�L�ML�U L�](�E0L�NPEfo!FM��t@L�U��~E�A��H��(L�]���F�H��%H�N@1�E�F0H�E]��L�Q����ff.�@UH��AUATSH��H��H�G��t;H�W`H�GH��t*L�o(��H��M�d�
fDH�S`I��I�}���M9�w�H�C`H�{(��H�CH��[A\A]]�f�UH��AUATSH��H��H�G��t;H�W`H�GH��t*L�o(��H��M�d�
fDH�S`I��I�}���M9�w��C0H�CH��[A\A]]�UH��AWAVAUI��ATSH��8H�OH�U�L�E�H���H�GI��H�P�!�H9�wH���A�!�A��H�E�H�E��Lf.�I9�tlE��t(I�F�KH�P�!�I9V��H���!�A9���D�;E1�A�����D��I�NPH��I^(H�{H��tV�H�u���H�U�H��M��u�I�~hE1�I��H�M�H����P���t���H�E�D�8H�CH��8[A\A]A^A_]�DI�VI�6H�U�H�묍P���!�A9��b���H�E������H��81�[A\A]A^A_]�DUH��H��L�E������ff.�f�UH��AVI��AUI��ATI��SH��H�GXH��uH�WH�{hL���M��L��L��H�߉�[A\A]A^]�H����UH��H��H�M������ff.�f�������UH��H��AWI��AVAUI��ATSH��8L�w(H�M�H�u�E�$A����H����L�m�E��I��L�m�L�m�DD��I�D$PH��L�H�{H����H�u���H�U�H��I�|$hE1�I��L��H����P����E��H�E�D� H�CH��8[A\A]A^A_]�DH�E�H�E��&fD�H�u���H�U�H��I9�t3D�#A���tVD��I�OPH��L�H�{H��u�I�WI�7H�U�H�I9�u�I�hE1�M��H�M�L��H����P���d���D�#A���u�H�E������H��81�[A\A]A^A_]��D�;A���������f�I�T$I�4$H�U�H����1��DUH��AWAVAUATI��H��SH��XI�D$PH�u�H���'�H�u��H�U�I��I�|$hL��A�T$X�E�A�D$ t-H�Mȉ�L��L���\���H��t�H��X[A\A]A^A_]�I�|$(��H��t�I�t$M�\$A�����M�T$(I��L��I��L)�H��H�M�H��1�I9��:L�n�I��D#m�M9�wH���#u�H��I�<2H9��x�oI�L$�WI�\$L�A�L�KA!�M9�wH���L)�!�H��H��I�H9��D�����H��H��fD��H��I��9�u�H�E�H�G�E��GI�D$H�P1�I�T$I;T$���H�I�T$H��X[A\A]A^A_]�fDI�t$M�\$L�n�L��L!�I9��[H��H���D!�H;U������M���H�WH�U��H�}�D�E���L9�teH��I�<D�OM�ȅ�t�M����������u$H�u�L�]�H������L�^D�]��D�^D�GH�w�H�}�D�E�H�u�L9�u��ʃ���uH�u�H�}�H�~�}�������~����uH�M������H�K�M��KI�t$M�\$L�n�������t;��uH�u�H�������H�s�u��sD�GH�_D�E�H�]�H������@H�_��D�E���H�]�H��H������V�D!����H�w��H�u�H�������H�E��H��D�M����@I�T$I��M,$H�U�������������D������UH��AWAVAUATSH��8L�M��u�H��8[A\A]A^A_]�f�H�GPI��H��L�wL�g(H����H�u�1�L���H�U�H��H�{h�SXI�v���!�I9���L��H���!�H��I�L9i�����u�|���f��H������l���H��I�L9hu�H�{L�KH��I��I��H�{I��L�]�O�L9��H���U���L9���A�xH�SL�[L�z�H��I��H�}�L!�I9��oH��H���!�H��H��H�M�L�H9��W�OI!�I��M9�wH���D!�H��M�<L9����oH�M�H���AoH��f.���H��I��9�u�u��0H�{(�B�H�S`1�H���b����E�L����E�H��8[A\A]A^A_]��H�WH�7H�U�L��j���DL�K����A�V�!��m���DL�}�I�SI!�L9��M��I��A��E!�H!�H9�wI��A�������E!�E9����Ao�E��f.�H��I��9�u�E��
�����fD�J�!�����Ao  ���H�{H�W�H�{I��H�SI��H��L�U�O�H9�sH�{�H���E�H�ȃ�������ЉU�H��L��o��H�M�H����M9��G����Ao(H�U�(H��fDH��I�4�09�u��e���E�~�E!���f�UH��AWAVAUI��ATI��SH��8H�GPH�U�H�M�H�����H�u�L���H�U�H��I�|$hH��A�T$X�E�A�D$ �#H�}�I�\$(M�t$E�|$I�D$X�lH�U�I�|$hH�u���M�V���D!�I9���L��H���!ЋU�D!�I9��aL��H���#}���E1��fD�2I�Ѓ������H��H��H�L9ju�9���D���M���JE�I��I��I�H9��gA�@A!�M9�wI��A��A!�D9����AoDI��J�3D�0D9�u�0�E�A�����A�@1�M�hH��8[A\A]A^A_]�L�}�H�M�H�ډ�M��L����I��H�������I9�u'�H�U�L��H��L�����H�������I9�t�H��8[A\A]A^A_]�@I�|$H�}����f.�H�WH�H�U�H��.���DA�~�#}����@A�V�!��u���DA�L�j��E��B1�A�0�f�A��������D��L�
I��I��I��Ao
H9�u6H9�tM�M�h�E�A�����A�@1��=�����E��B1��(���H��L��D��L��\���1�H9wvH��Hw(H�F�ff.�����tH��HG(H�P�ff.��H�G��tyUH��AWI��AVI��AUI��ATD�`�SI��1�I��H���fDH��I9�t/I�G(L��H�|A�Մ�t�H���[A\A]A^A_]��H��1�[A\A]A^A_]�1��f.�f��H�O���t%H��f���/HD�H�����u�H�AH)��fD1��ff.�f�UH�к�H��SH��H��H��t
H)�H=�HN�H���SH9�t�P���/t��t
�/H��f�P�H��[]�ff.��UH��AVI��AUI��H��ATSH���D���H��L��H�I���r���[L)�I�L��A\A]A^]�U�/H��ATI��S�5���.H��H��ID�H���50��H��t[A\]�H��[A\]�Rff.��U�/H��ATI��S�l5���.H��H��ID�H���U5��H��t[A\]�H��[A\]�LRf.�f����tVH��fDH���� u-�H����� t��u�H��H)��f��� tH�����u���fDH����H����ff.�UH��AWAVI��AUI��ATL������SL��D��H��HH������H������H������dH�%(H�E�1��`���M�|H��t	���MH������1�L����������������u=�.L���.��H��t+L)���u+L�����H�=��I��H������1��(fDL�����H������H��������.��L������L��1H����������!� ��t����€�D�H�qHDΉ�@�H��L�L)�H�H���w
I������@�TL���<�����L��L��H=�HF���P�� �����0H�]�dH3%(L���rH��H[A\A]A^A_]���À�����L���χ�������L������L��L��L�������IPH������1�L���X���L��������H��H��L)�L��Hc�H)��P�T���L��L���:�V���L��L���E7�=���1�L��L���3��.���fDM9�t{L��L��L��������1��L������L��H��L���OH������H���
1�������E1������H������L��H����0��1�L��H���A����@L������L��L���L��L�������/��L������I���U�����1��Uf�H�������H�������vq������uDH���H�5\H�
eHD�H�5
H�M�H�
��~E�HE�H�M�E���H�у�������v)H���]�D��u��@t�H��[H�H�����H��H���]�fDH����H���H����f���@�L���H���[��H��H�H����ff.�UH��AUI��ATI��SH��H���H�{(��9��H����3�����H��������H����L9������L�k0�DH�{`��9��H��L���R4��H���H��t	L9��s0H���u�H��t	L9��sH���ǃ�H���H�{(H����H���H-��H��1�[A\A]]�L�k0��u&H���[A\A]]�H�{`�&9��H��L���3��H���H��t	L9��s������u�H��t�L9��r��{����H���H��uiH�{h��'����fD���x���L�chL�-]�DH����A8��H��L���/3�������u��@���H��MSH���`����H��MSH���p�f�UH��AWAVI��AUI��ATSH��H��xH9w0t1������H�{MSA���L�U�M���E���H�H��X����I�L�U��D��L��L��x���A��H��p�����L��x���H��I���OH��p���L��1�D��L��x����L�L��x���H�����H��LSM���Adž�E���H�H��X�D��L��I����I��H��uhL��H��L��D����H��uI1�H��x[A\A]A^A_]�fDAdž�����H��x�����[A\A]A^A_]�f�A�����f�H�9LSL�ǹ�H��L��p���H�p�H���L��H��L��D��膳L��p����H��H��x���H��KSHD�L��H���H��x����6���DH��KSL��`���L��1�L��h�����H��H���L��1�D��H��p����աL��h���1�H��x���H�nKSL��H���H��x���L��`����Z���ff.�@UH��AWAVI��AUATI��SH��(L�/L�m��m����Eą�t�E�H��([A\A]A^A_]�@I�$M��$�L)�u5��DH�z0H�U��K&��H�U�H�z(H����H��M��O)��L)�t�H�u�I9�$�L��I��MF�$��
���I���L��L���)��I���ALJ�L�I���H�E�I���I��$����H�z`���H���X���H�9JSH�U�H���xH�U��;���H�JSH���`H�U��=����UH��AWI��AVI��AUATSH��H�����L�gL+g L'����M�� A��L)�L9�vcE1�H���L)胻�I��tH�CL)�I9�LG�M����M���
ǃ�M����~C L�#1�fl�C�L9c��Hǃ��H�Ĉ[A\A]A^A_]�@H�ISD����H�}�H�D��XI��H���1�1�L��D���2�H�����H���ǃ�H����H9����Dǀ�H���H9�u�����DH���H��t"H9�t�ǀ�H���H9�u�H���H�}��L�
KHSD���L��`���H��x���H�C L��h���D��H��X���I�D��p�����XD��p���L��h���H��I��L��`�����H��x���H��X���L��D��L��p����p�L��p���H��H�s I9��aH�����L��x����~�x���H��x���L�#�x���H��x����~�x���fl�f�CM��tL��L���d&��1��'���DL��L�
NGSD���H�}�%�H��X���L)�D��H��x���H���L��`���H��p���I�D��h�����XD��h���L��`���H��I���6H��p���H��x���D��L���m�I��L9�x���t1�����I���ǃ�DD��D����c���f�L+�X���M�M�M�E1������D�����)����H��L��L��p���H��x����?%��H��x���H�s L�#L��p���D�H��x�����~�x������ǃ�fl�C���fD�������L�#�H��ESL�Ϲs1�L��p���H�	�H���1�1�L��D����L��p���1�H��x���H��ESL��H���H��x������f�I�L��L��P���L��L��h�����H���L��p���D��`�����D��`���H��x���L��H��X���D��蹕L��p���L��h���H��H��x���L��P�������H�ɸLE�I�H��p���L��L��L��x�����L��x���H��p������DI�L��L��h�����D��P���H���H��x�����D��P���H��p���L��H��x���D����H��p���L��h���I��L��`�����t?H���HD�x���I�L��p���L���L��p����M���H���HE�I���"���H���HE���ff.�f�UH��AWAVAUATSH��H���H��x���HDžh���H��`���H���H�E�I��I��H��P����DH�H)�%�N�,A���tI�FL)�I9�LG�M���XL��L�������A������VH�?CSA���H�H��X��tL���H��P�����I��H���N1�1�L�����P�H�����H��BSA���H�H��XI������H��P���H��p���I�N H��X�����I��H���!H��p���H��X�����L���1�H��I�F H���H�HE�I9�I�FH�C�H��p����E�H��`���A���M�>���I�FL���H���M���A���I�`A���H���aI�0���I�(H���3L��� ��I�v H��p����I�vAdž���L9�L��x���IG�L��H��� ��H�h���H�I^H��x���I)��M�NM+N MI���L��M�ρ�J��!����I��I)�L9�������H)�H��L�%�I)�M�����f.�H��`������A���H���I�^H���I�v I�����H)�H�C�H��p��������I�F 1�HDžp�������I�F1��p���@H��@SH���`���H��@SH���x���1�H�Ę[A\A]A^A_]�@H��@SL�ǹ�L��L��H���H���H���H��X�����L��H��p�����H��p���L��H���H�Ã�uYH���HE�H�"@SL��H�������L��h��������Y����L��I�vAdž���@H���ID��f.�H��?SL�ǹ�1�L��X���H���H���1�1�L�����ڕL��X���1�H��p���H�s?SL��H���H��p����[���I���A������H�{`���H��u$H�{0���H�{(H��u$H�������v���H�
?SH���x��H��>SH���`��UH�GPH��AWAVAUI��ATI��SH��H�xH��x���H��p����v)��H�P�#��I�]M��I+] I]I9]��I�u8M�}@H��x���I)�M9�L��IF�H��H��h����l��I�u8H��h���H�I�u8I)���M��I�} H��x���I)�L���8��I�U H��x���I�E@I�}xI�UH�L�I�UI�E8I�]M}H����H��p������1�M����H�Ę[A\A]A^A_]�@H��=SE���L�}��L��H�D����XI��H����1�1�H��D����H����-H�ڸ M��ADž���H)�L9���I���M�UH)�I)�I9�LG�M���$E1�M�������I�}xH���I�}P���I�u I�]L��H��x���J�6J�>H��p����~�p���H��p����p���AE����1����f.�E)�E����p����L��E���L��%�H)�D���H��h���I���H��`���H��<SH���XI��H����H��`���H��h���D��H��x����H�����M��H�x���H�I)�H9�h��������1������I���E����L��L��P���H��h���I�E D��D��X���H��`���H��;SH���XD��X���L��P���H��I����H��h���H��`���L��D���D�I��I�����M9��V���I�u L��M)�L�H��x����u��L�x�������f�I�}xA���H���pH��p���������H���fDH�);SH���`����H�;SH���`����H��:SL�׹W1�L��`���H�1�H���1�1�H��D����L��`���1�H��h���H��:SL��H���H��h�������f.�H��:SL��L��X����iH���H��h���H���H��x���H��`���D��H��h�����H��`���L��X������
H���HD�h���H��`���H�:SL��H���H��`������f�I�}xE���H�������H��9SH���`�{����H��9SL��L��L��X���D��L�����H���H���L��P���D��L���H��h���H��`���L��D���	�L��X���I��H��h�����t;L��P���M���LE�H�99SL��L��H������H���HE����I���IE�I����ff.�UH��AWE��AVA��AUI��ATSH��H����|���L��h������LJ�L�HLJ�H�G LJ�HLJ�������|����+IDž�IDž�H��uH�A7SH��H����A����|���M�I���I��?A��M�A�� I��@A��M���I���I��@������|����H�EH��p����~�p���HDžX�������%y���I���I�E fl�A��I�E@I�EI�E(I�EH��X���L��ADž�I�E��|���A������1�H�Ĉ[A\A]A^A_]�f�HDžX��������E���I�H�UH�]L!ȃ�@��O�����|�����H����L�%F�[I9�I��MC�A�<$sEL��p���M��@H��L���}yI�E H���K�vA�<$H��H#�p���I9�I��MC�r�M���f�L�%�6SH�}��	I�$��XI��H����1�D���@�H��H�����1�H9�h�����A�������H�EH�=�[H��@H�:HDEH�E����I9�I��L�%S�[MC�A�<$O�t?HsrL��`���L��M��H��p���I��L��M���H��p���L���qxI�F H���(K�M��;H��H#�`���L9�LC�O�l?Hw�L��H��p���M��I��H��L��H���#xI�E H���V�����@I9�I��L�%��[MC�A�<$O�4?sjL��h���L��M��H��p���I��L��M��H��p���L���wI�F H���@K��;H��H#�h���I9�I��MC�O�,?r�L��H��p���M��I��H��L��H���twI�E H���Q���H�M��y���H��h���L��p���J�8I�]P�~�p���I�EJ�:H��fl�L��p���I�E(H��4SA���~�h���I�U0H�I�U@�p���I�U8H�	�[A���:I�MH�P@H�5Y�[H��I�Ex����I�E ���@H�M��y���H��p���L��`�����|����~�`���I�E@I�Efl�A���~�p���L��p����p���H��p���A���~�p���fl�AE(�
���L��h���M��A��M)�L�I�EH��f�H��3SH�}��D��L��`���H�L��p�����XL��p���L��`���H��I����1ɺ1�D��L��`���L��p����}�L��`���L��p���H��h���1�H9�HC���A���H��X���H)�H�H9�HG����f�HDžX����������H��p����4�H��p����8�A����,���I�$H���L��1���L��`�����1�D���C�L��`���1�H��p���I�$L���H��p�������H�S2S��1�L��L��X���H���H�L��`�����1ɺ1�D���j�1�L��H��p���H�2SH���H��p���L��`���L��X�������L��M��I��H�u��y���H��h������M��H�u��y���H��p������L��M��I���ߐUH�(�[E�ɋH��P�u�����@U1�H��ATI��SH���H��1���sH�ǸH���!�oA$�oKAL$�oS AT$ �o[0A\$0�oc@Ad$@�okPAl$P�os`At$`�o{pA|$p�o��A�$��o��A�$��o��A�$��o��A�$��o��A�$��o��A�$��o��I�|$ A�$�H�s H����p��H�SI�D$ H�H+S I�T$HCH+C I�D$H���H��uI��$�1�L���[A\]�@H��H���H9�u�L���1�I��$�[A\]�H���H��H9�u��H��H���H9�u�H���H� ��sf�H�W H�GH�H)�H�H9�vH9�wH)�H�H�w�f.�UH��LJ�H�U�H9wHFw�~E�H�7fl�G]�UH��H��AUI��ATSH��H��H�wL�gI)�u5L��H��H������t�����x
A�D���H��[A\A]]�H��L��M)��
��H��L��f�UH��AWA��AVAUI��ATI��SH��H��L�5�.SH���[I��:�P@H�5��[H��H�C(�J��H�
��[I�H�S0H��H�Uȋ9�P`H�U�1�H�C`H�����H�
�[I�H�ShH��H�Uȋ9�P`H�U�1�H���H�����D���D���ǃ�I�E Hǃ�H���H�*�Hǃ�L���I���I���M��tH���I��$�I��$�H��[A\A]A^A_]�ff.�@U�H��H��H�u������u
�E����ɸ�ÐUH��AWAVAUATSH��H��h���������uh������H�s0L�c@I)�tNL��H������u@H�H9CsH�CH�S0I�H���A��H��H�S@L)�H��H�CHfD1�H��h[A\A]A^A_]������A���8E����H�{xL�sP����L�����L�{0L�k@M)���H���D���H�}��H��D��H��x���H�{,SH���XI��H����H��x���L��L��D���ѓH����H�C@H+C8HCH�C0L+H���A��H��H�C8L)�H��H�C@H�SHE������H�{xH���'H�{P�~
�����f�H�{xH����L���[
��H��h1�[A\A]A^A_]�f.��{����H������k��������ǃ�������������H�x+SL�׹�L��L��p���H���H���L��L��D��H��x����L��p����H��H��x���H�$+SID�L��H���H��x�������H��*SH���`����L�{0L�k@M)������+���f�H��*SH���`����ff.�UH��AWAVAUA��ATI��SH��H��xE��uYH�H9�����H�O(���jH�WH)�H�I9���A�����H�������t��oD����H�C L�#ǃ�H���H�C@H�CH�C(���@uJA��L)�H�H�CHH�C����D���H��ǃ��0��1�H��x[A\A]A^A_]��HS0H�SHM��t�����t�H�CH���[1�1�H��H�Cǃ�H�C@�f.����������t>���@��E����H�C L�#ǃ�H�C@H�CH�C(H�C�9���f�H�S@H+S(HH�S��H�w@H��H)�H�I9���A���A��uLI)�H�C����L�H�K@������@t?�H���"������b����a���DA����I)�L�H�K����L�5y(SD���D��x���H�}��I�D����XD��x���H��I����1ɺ1�D��D��x����{~D��x���H�C����A����������@������H���HW0LJ�H�WH����H�W1҃�����H�w����+���I�D��l���L��1�L��p�����H�����1ɺ1�D����}L��p���I�1�H��x���L���H��x���D��l����5���f�UH��AWAVAUATSH��H��H���HH;G��H�@L�cHI��I��I)�L�����Lc@�H���n���A�ƅ�u_M)�tDM�L�;L��H��L���H�3A��L��H)�I�E��uM��tH�{@L)�L��L����Lk@H��D��[A\A]A^A_]�@A����;��A������I����A�$�ǃ������DUI��H��AWI��AVAUATI��SH��H��xL�/I9���H�0&SL���H�H��p���D���H�I��L��x���H��XI9��YA)�H�}��D����L��x���L��p���H��I���nL��L��L��D��L��x�����tL��x���1�H��tǃ����������M�M�M)�L�+�1�H�{ L�sHI)�M�M9���M��L��L)�M)�H�M9�s+L��L�Ή�x����J��H�S ��x���L�H;S@v~H�S@�x�L��L�Ή�h���L��p���L��x������L��p���K�'L��x���L)�h���M�LC L;C@I��vL�C@M��t$L��L��H�߉�x����y�����x����������E�H��x��[A\A]A^A_]��H�}��D����L��x���L��p���H��H����L��L��L��D���s���H�Y$SL�߹vL��L��h���H���H���L��L��D��L��p���L��x���L���HsL��h����H��H��x���H��#SID�L��H���H��x���L��p����)����H��#SL���sH��H��H���L��L��D��L��p���L��x���L���r�H��H��H��x���H�v#SLE�H�L����H��x���������UH��AUATI��SH��H���H9���H�{(���H���y�����D�h�D���IDŽ$�L9�������t&H�{(H����H���a��E��tDH��[A\A]]ÐH���H����H�{h�G���H�{`H����H�{0������H���L�chH����L��L�c0�H��H�{`H��uwL���7��H�{(H��tH�G"SH��PHH�C(H��H��[A\A]]�����Hǃ��!�����v������H��!SH���`����H��!SH��PhH�C`�o���fDH��!SH���p����H��!SH���x����H��!SH��PhHǃ�����ff.�UH��AWI��AVAUL�oPATI��SH��H��xH�x�P��L�����I�@M�wHI)�I9�r?H��L���$��I�xI_@H���L�����1�H��x[A\A]A^A_]�f.�L��L��M�L)�����Mw@1�L���A����H���wI�@�f.�I���I��H�}��E���A���H��H��x���H�} SD��D��p���H���XD��p���H��I����H��x���L��L��D���‡H��uUL)�M�Mw�n���fDI�xH����L����������f�H��SH���`����I�xH����L���c��������ALJ��������fDH��SL��L��L��p���D��l����;H���H���D��l���L��L��H��x���D����L��p����H��H��x���H�OSID�L��H���H��x�����H�,SH���`����H�SH���`�.���f����tH�G@H�H9OHr	H��u1�Ð����c���UH��ATI��SH��H�����Lc@1�[A\]�UH��AUATE1�SH��H��H���t-����HLJ�u_H�{ �vbH�CH�C ���tMHǃ�D��ǃ�H�CHHǃ�H��[A\A]]�����A��뒐H�{xL�kPH��tH��SH��PHH�CxL������@UH��AWAVL������I��AUATSH��8�dH�%(H�E�1��..ƅ����/f������������A�G���ZL������H�^M��L����H��H��H���S��Q��tz��/u�H���/L)�H��vFH�H�A�?f9x���H��~��H���/��H��t���.u��x�/u�H�H�H����H��u�A�<$f9�����uLI���t���@L)�H��L��L�����H��H�u�dH34%(��H��8[A\A]A^A_]���H���/�w���H�H��!���f.�A�w@8p��=���L9����P�L�@���~����.ubM9�tA�x�/�"H�={�[1ҾL�������(Q��tL������I�HI�@���H�5I�[L������x�/��L�@�M9���A�8/tqL���	@�9/tkH��L9�s�y~tuH�A�R���I�D$L���E���fDM9�t�x�/u�H��[H�2H������L�������P���/tjL�@�����L��D�y~tA�f9u�A�G8Au�I�xL������H���/H�@����@1�L�������H���f�M9��6���L���E���L�@��P����L�@��	�������@U��H��SH��H���ZH��H)�[]�UH��AUATI��SH��H��(dH�%(H�E�1�H9�tVH�����H��L�����H������H�4H)�L��)L��H�M�dH3%(u0H��([A\A]]�f�L������L��L������R���f�UH��AWAVAUATL������SH��H��(dH�%(H�E�1��.���1ҾL����N��������uKM��A�UI����������!�%����t������D�I�ULD���I��M)�t</�rH��H�����I��H���3H�̋[H�0H����H��H���������H������I��H�@�B�|>�/LD�I����M9�A��A ��2L��H���w�����u
J�4;�>/�.����������M9�sME��tHH�G�[L��L��H�0�9�����u/B��=����/u$K�4<I�|$ƅ����~�E,�
��������ufL��H������tWL��H����������!�%����t������D�H�VHD��H��L)�Hހ>���./�Cf�DH�E�dH3%(u~H��([A\A]A^A_]��H���@�L��L��1�L�@H���,��m����������A�ƅ�u����fD�~H�{�\+����H���H+�s�������ff.�UH��ATI��SH����H��H��dH�%(H�E�1����H�؋H����������!ʁ ��t����€�D�H�HHD���@�H��H)�t*�����/t ��H=u;Ƅ��/Ƅ��H��L���-���H�u�dH34%(u'H��[A\]�f�H��H��Ƅ��/Ƅ�����f�UH��AWAVAUATI��SH������H��H��(dH�%(H�E�1����������~t2H��L�����H�M�dH3%(�LH��([A\A]A^A_]�f�������/I����L�{�/L�����I��H����A�UA�EH�{���������������I��A�U���M���l���M� M���_���H��L��L)�J�T0H��������H������I��H�H=�+���H��M��tC�|7�/I�F�J�<3u
H�<I��fDL9�rKI�<I�tH����L��L��H���_�����f.�H���[L�kL�8�S���DL������fDL���PI������C���UH��AWAVH������I��AUI��ATSH������H��H��(dH�%(H�E�1����H��H��I������M�L��I�����J�8H���w@J�<;L��H�P��H��L�����H�M�dH3%(u#H��([A\A]A^A_]�@L��L���}��������fDUH��AUL�l�ATI��SH��H��H�>H��u�fDH��H�;H��tL�������u�I9�w
�@H�H��H�CH��u�L�#1�H��[A\A]]�UH��AWI��AVAUI��ATM��SH��H��HdH�%(H�E�1�H���L���@H�E�t��S����M��H�;�L�u��LD�L��L���/H��I���XXXX�XXfA�GA�G��I�WD)�H�H����(1�H��L���۽��L��H��� �L����Å���H�}��~M���L����G]A�ƅ����Ws��D� ����L���0	�;sD� �pfD������H��1���I������A�ƅ����C����_����A���u3����@M���L����\A��E��xH�j�[H�H�M�dH3%(D����H��H[A\A]A^A_]Ð�rA������$���$�f�A��H��H���L��1��
D��M���L���\A�ƃ���j�������H�=Z��M���M�H��H��H�8�HD������L�����p���fDH�ٺ��1�H�5"���[S�����i�f�H�� � f�~8HC�H�FH�� H�F H�F L��H��H�F0���F(f�F.1�f�F,H��u	��UL��H��AUL�iATI��SH��L��H���NSH�CH�H��tL�hH�L�`H�H�H��[A\A]]�f�U� H��AVAUATI��SH��H�� HB�H�� H�w H����H�GI��H�ZH��t
H9X��I�<$M��H��tJH�WH9�u!�@I��H��H��t-H�WH9���H�GH�H��H9�u�I��SI�>H��u�A�T$.A�|$8H��H�����cRH��t6L�m��~E�H�]�E�@I�H�I�D$I�H��[A\A]A^]�fDI�D$H��[A\A]A^]�f�I�|$H��[A\A]A^]�ff.�UH��AVAUATI��SH�^H��H��H�H���H9Z���G,�Hf��	f�O,H�BvH=���H9�w��DH�JH9���I��H�H��u�E�t$(H�CA�T$.A�|$8A��M�t$ I9�LB������L���<QH��H����A�D$(L�pI��L�pH�I�EH�HH��H)�H)�HBH�JI;L$sH�
I�MI�L$H�
I�T$H��[A\A]A^]�fDM9�u�1�M��fA�D$,H�J�f.�M���0����H�H�H�GH�H�W1�f�W,H�H��t�H�B����I�T$01�H��t�H�E��H�E��z���ff.�f�UH��H��PH�EH�u�1�H�E�H�E�H�U�H�M�H�ML�E�I��L�M��E�H�E��.DA�эBK�<t;��/��L����H��H��Hƃ�/v�H�9H�AtH�H��f.��E�����H��tsH�uH�}й�E�H�u�I��H�}�H��H���.@A�ȍQO�M��t9I�0��/w3Lʃ��H��H��Hփ�/v�H�WH�?H��t
H�7H�z��@�É�H�����H���]���ff.�f�@����U��H��ATS��H�GI��H�H��u�#@�[PI�D$H��tH��H�H9�u�H��u�I�<$H��u�vfD�+PI�D$H��taH��H�H9�u�H��u�f�A$I�$H�HH�Q�H�PI�$H�A�D$(1�fA�D$,[A\]��H�G1��O����f�A$H��t��H�H��u�`fDH��H�HH�Q�H�PH�H��u�H��H�GH�H��tf.�H�pH�V�H�PH�H��u�1�H�Gf�W,�G(�H��뻐H�GH��t �H9�rH�PH�H9�r7H�H��u�H�H��t �H9�rH�PH�H9�rH�H��u��fDH�G�H�FH��tH�O��H��H�H�H��H�GH��u�H�F�f�UH��ATI��H�rSH���:���H��H��t	H��u
�[H��A\]ÐH��L��H���r�H����ff.�f�UH��ATI��H��SH���k�H��L��[H��A\]���f�UH��ATI��H��SH�����H��H��tH��u[H��A\]�fDH��L��H�����[A\H��]H����UH��JH��SH��H��H��uH��H��[]�fD����H��H��[]�f�UH��AVAUI��ATSH��H����t^H�u��-cH�����}�1�H���w��}�A�ą�x�x�� t���8��E��u(�ǀu[H��D��[A\A]A^]���A����fD���I���{iA����t�A�L���1��Z��H��L��E1��e��A��H��A��[D��A\A]A^]�f�H��E1�[D��A\A]A^]�A������:���f�UH��AWAVAUI��ATSH��HH�������@dH�%(H�E�1��/f�������GH���<�PI�ƅ���H������E1�L�%KH������H������H�������$fD�c�������A�VA��A9���D���L��H��IL�L�������tйL��H�=�������t�H������E1�L��1�H��������H�CH������H�������@%�=@�`����������`���L���������mE�������DL���XEL���0�H�U�dH3%(u H��H[A\A]A^A_]�������f.�f�UH��ATSH��SH��t;{w
�fD9{sH�H��u�[1�A\]�@9{w�A���SD��+{H��H��tۀ8t�[A\]�@UH��AUI��ATS��H���H��@���H��H���L��P���L��X�����t&)�`���)�p���)U�)]�)e�)m�)u�)}�dH�%(H��(���1����,���H����H�MH��0���H�=�1ZDž���L�� ���H�����L�����H��H�����L��Dž���0�H��SL��L���H��(���dH3%(u-H���[A\A]]�L�� ����پH�{�L���C����ff.��UH��AUI��ATA��SH���H��H���L��P���L��X�����t&)�`���)�p���)U�)]�)e�)m�)u�)}�dH�%(H��(���1�H�EH��H�� ���H�=0ZH�����L�����H��0���H��Dž���Dž���0H������L��H��D��H��S�H��(���dH3%(uH���[A\A]]���UH��AUI��H��AT�A��SH�����H��H��dH�%(H�E�1���L��H��D��H�LS�H�E�dH3%(uH��[A\A]]�� �H�!S� �UH��AUI��ATA�ԺS��H��H�"�[�8�SFH��tnH��RL�h�XD�`H��tg;Zs�#9Zw+H��H�H��u�H�H�H��1�[A\A]]�H�
��RfDD9bw�H���bGH���[A\A]]�f�H���[A\A]]�H�
I�R��H�9�RH��t<H�-�R�H��H�H��t%9xu�9pu�UH�H��H�
H����F1�]�D��f�UH��SH��H�=�RH��tH��FH��H��u�H��RH��RH���RH��[]��UH��AWAVAUATI��SH��H��(dH�%(H�E�1�@��������H�u������a�E�H�F�eH��f���I��H����H��� H�S;r5H�6p[H�H�M�dH3%(L���H��([A\A]A^A_]�DLc�H�SL��H��I��L�8H�N�[�8M��GI�H��o[H�H��o[H�H��SH�B�D0�f.�@��tz��@�����������a�E�H�u��E�+H�F����f�����I���aA�A��������aH�ھ��1��y������@H�u��E�rH�F�����E�w���ff.�f����ff.�UH��AVAUE1�ATI��SH���H���R;sH�
�RH�H��H�H‹r��u2H������Å�xGH��n[H�(M��tL���\D��[A\A]A^]ÐL�*H�H��H��D���Å�y�����I���`A�A���t�L���1��q����ff.�@UH��AWAVAUI��ATI��SHc�H��(dH�%(H�E�1�������H�uÃ������a�E�H�F�e��f��C�I��H����H��m[H�H�]�R;s2L�=��RH��I�HًA����H�Vm[�(I��DH�}�dH3<%(L����H��([A\A]A^A_]�f.���t3��@uk���������a�E�H�u��E�+H�F�<���fDH�u��E�rH�F�%����H�E�[L��L��H�M��8�DH�M�H��R���@�E�w�f��;��H����^�A����6�����1������ ����z��f.�UH��SH��H������tH��H�����[]�DH��H��[]�J�f.��;�ff.����ff.�UH��AWAVI��AUI��H���ATL��I��SH���v�H��I9����e��I��A��uLE�'E�����DD��^L��D� �-�����A��H�����HE�H��H��[A\A]A^A_]�@L����E�'��uAA��t�L���C�����蜾D���	H��1�����t���A���HE�뛐L���������a�D���H��1��Z���E�'�9���f�H������^���@UH��AWAVAUI��ATI��SH��H��(H�M����H�E�H�E�L��H�ھL����I��H9����-��I����\A��I���tLu�M�L)�Lu���tgL�������u#�E�uH�]�L�H��(H��[A\A]A^A_]�@H������E�t�L��E�/�������i�D���H��1��b����H�u�1�1�L������:����E�t�1��f.�@UA��H��ATI��SH���H��P���H��X���L��`���L��h�����t#)�p���)M�)U�)]�)e�)m�)u�)}�H�EH��>RDž(���H��0���H��@���Dž,���0H��8���A��t?H�;A��tVH��(���L�����H�3�
���H�;���H���[A\]ÐH��	�H�=����H�;�f�H����H�=ר��H�;�f�UH�ʨH��AUI��ATI��SH��H�O�UH���H��P@����H���H�YL��H��P@����H���H��sL��H��P@����H���H�U�L��H��P@��tUH���H�@�L��H��P@��t:H���H��iL��H��P@��tL�<�RL��I�U1�H�5��A�H��1�[A\A]]��H���[A\A]]��UH��AWAVAUATA��SH��H���I��A��#L�-|<R@I�u� A���.�A��u���ƒ��,���OL��D)�H)�H�H9���L�-/<RA�O�Mc�L��L)�I��I�I9�w�>f.�I��I9�t+A�<$ u��;I�uH����L9�r��
f�H���; t�I�u�
A���I�u� �r�A��u�L��A�H)�H��9�f���H��H�5	71�H�Mȿ���H�M�H��[A�A\A]A^A_]�L�-V;R��H��A��I�u�
����DUH��AWAVAUATSH��8L�*M�}M���V��H�M�H�U��u�H�}�H�E��E�H�E�M�4M9�tcL�e��3D�#��H�UϹ_H�����-t��9�uwI��I��M9�t*A�I�$��-�U�u���-t������_H���DH�E�L�(H�E�I�u�<��H���R�8t�U�H�E���u@H�0�E�fDI��pM�}M���?����]ȃ�t?H��8��[A\A]A^A_]�fDH�8�������]�I��pM�}M�������fDH�E�L�
5�R�H�5I�H�M��U�L�1�A�뙻�1��DfH~��f.�UH��H�}��E�]ÐUH��AWAVAUATI��H��SH��H��I�L$`dH�%(H�E�1��H��HD�H��~I�D$PH9�s
�H��uH��1�I�T$0��?H��uH=���~
�����1�M�l$HH��H��I9�~L��I9�:H����H9��H�}�dH3<%(uvH��[A\A]A^A_]�f.�H��u�H��RH������L��L�0�"�H������H��I����M��I�$H�5r�H���1�A��L���@��t�I�������UH��AWAVI��AUI��ATSH��H��L�>�����H�uȺ
L���I������A�<$"t'H�}����t��L�p���Ic�L���@L�A�RL��L��1�H�5��1�A��
H��1�[A\A]A^A_]�fDA�f��L�����L��L��1�����H��[A\A]A^A_]�fDA����I��@I��@A���I��@A�@�u���D�	�E1�L�
e�R��1�M��L��H�5S�1�A��1����H���H��[A\A]A^A_]�ff.�UI��H��AWAVAUATI��SH��H��dH�%(H�E�1�H�FPH9����H����H�S0��?H��u������H9�����E�HE�H�K`H��~	1�H��H��H�{HI��H9�w<M����I9�A�H�u�dH34%(��H��[A\A]A^A_]��H��L9�v�M��u�H�L�RH������L�0��H������L��I���s�M��H��H��H�5~�1�A��L���@L��1�����fD@���c���H��I������f.�H�G0��?H���GUH��ATI��SH��H���Hc�H��f�H��t"H�>�C6H�̖[�H�ދ8�8I�$[A\]�@H��t�I�$[A\]�f�H��1�H���s���I�$[A\]�f.�H��1�H������I�$[A\]�f.���@Hc�H��1�H���(���A�$�f���H��1�H������A�$�o����H�W`H��H��?H��H1�H)�H��x?I�$H��H��H!�H	�H��HD�I�$�.����H������A$����DH�������D��UH��AWAVAUATI��SH��H��(�?-H����I��H�M����H�uȺ
H���I�����A�>"H�M�I��t$L�E�A���t��H�=4���Hc�H���H��H�5��L���R1�1�A�A�$
1�H��([A\A]A^A_]��I��2@A�4$��u?L��L��1��{���H��([A\A]A^A_]�@H��H�5��@A�$	A�E1�L�
j�R1���I��H�5[�1�A�A�$��t�1��q����I��(�f�I���w����I��
�g����I���W����I��<�G����UH��ATI��SH��H��H�P�E����H�{H�E������M��]�f.
�af(�zKuIf/�v#M��tX�A�$H��f(�[A\]��f(�1�M��u�H��f(�[A\]��f/�v�f/�w�f(ѸM��u��U�f(�f(�H�H�
7�R��H�5���U�H��[A\f(�]�f.�UH��AVAUI��ATI��SH��H���E�H����H��������I�E0��?H��wrH���Hc�H��f.�I�u(H�U�L����\H��MЅ�t>H�=�UH��dL��H����P@���'I�E(��H��H��H�fD1�H�e��[A\A]A^]��I�] H���\���H�`[L��R1��
I�MH�5+�H�1�A��f�H���RL� �	����H�U�L��L���a���H�fD�]Ѕ��u���H��_[M�EL��1�L�
��RH�5�H�1�A�H�e��[A\A]A^]��H�U�L��L�����H��@L���0��H�U�I�}(M��RH�U�I�M@A��RH��7�]H�H�}�XZ�f����
�g���@I�u(1�L���W��������H�H��/����H�U�L��L���1��������f.�L��L��������fDI�E`M�u`L��L��H��?I1�I)���I�}`��y������H�L��H��H!�I	΅�LD�L�3���@H�U�L��L���������f�H�;�/H�9�R�H�5�,L9 H�k�[IE�8�1H�H���L�����M���f.�H���RL9 H�T,IE�H�����I��$�H�U�L��H�u�H�E��d�H�E؀8u�uԅ�u1�L�����������H�
��RI�U1�1�H�5ڜ��E�
f����
H�u�L���W��H�U؀:�,���I�U(�H9��L�������������
H�u�L�����H�U؀:��I�M(H��H��	��H��H������H����ff.�UH��AWAVI��AUATSH���H��`���H���RH��x���H��h���dH�%(H�M�1Ƀ/H�H��H��:��H�8�0w��M�>��H��x���������HcI��H������I9���H��*1�L������Dž����A��H��p���ƅ�����3f��;-��H������D��M��A��H�H��L9�����vvM�g������I�M��u�H���v����t�I�wH��V[�>H��p���������I���8��H������D��A�FA��H�H��H�H�4�L9�����w�D������D��L��������uI���L�<�I�Dž����H�M�dH3%(�������H�e�[A\A]A^A_]�f.��C���������������<-���{��H��x���M��ƅ�����(����@H��x����(����f�H��`���H�9�'���I��H�)DI�t$ H��t
I�T$PL������A�D$0�tAH�:U[1�1�L��H��H��H��t0I�T$@L��I��p���I�<$u�I����fDI�t$H��u�I��pI�<$u���f�H�sH�{H��8����.���H��8����=H����H)�H����H��8���H�غ�H������H)�=�G‰���H�CH��X���H�þ=H���c�H��H)ހ8=��4�����H��`���H��X���H������H�� ���H������H������H��H��������HDž(�������
����ƅ3���E1�ƅ����L������I�@0H�ƒ�?H����Dž��������I�XA�@8���'
I�@0��?H��(�����H����H���R�8t"H��X[I�H�5�H�L���R1�1�A�H��x���M��Dž����ƅ�����(�|���L�c1�L��x���D��X���H������H��`���M��1�H�;H������H��M�~u-�5DA�$H��A9�tKH�zpH�zpH�������D�GM�~E��u�H����H��8���ƅ����H��X���H���.���fDH�w0H���?H���L�O8H�����A���wA�|$��I�D$L�%�[H������H�wH������1��������������H��p���H������H������H��h����Є��L���@I�������D��X���������������H��x����(����fD���H��Q[�8�(��X���H������I��A�$-ƅ����H�I��A��L�$����������H�GH��p���H�������H��h���H�������Є�uGH��������[���fDH�k�R�8��A�mH���Dž�����)���@A�mH�������Dž�������������I�FH���3I�VA�mM��H������I���_����A�mH����������������@H���R�8t$H��U[L���RH�5ё1�A�$H�1�A�A�mL��1�Dž�����=����H�yU[H���H�H��&RH�81����H����������DH��uH�G�H��������T���H��p���H������H��h����Ћ�T������QH����������L�����H�XH��`���H��X���H������H��(���H������H������H��H�� ���H������9����_���H����2���H���ƅ3���DžP���DžT���ƅ����Dž���H��H���D�����L������L�����L��������P���H��H��@���H��H���H��H�H9��L��X���I���:fD����H��_B��A��-tB��9���I��I��L9���M�7M�,$A��-u�A��-t��ʻ���_H��A�mH������Dž�����r���H���R�8t7H������L���R1�H�5��L������H��X���L�H�bS[H�1�A�H��x���M��Dž����ƅ�����(�0���H������H���H����������!�%����t��D��X��������D�H�VHD�L�‰��H��M[H������H��H)��D��X���H�Ë���������H��x���M�牅����ƅ�����)���H���R�8t8H��H���H��I��1�H��R[L���R������H�5�I��H�1�A�Y^H��x���Dž�����(D��T���Hc�T���H�
ˁQH��H��H���H���6H�
������P�������f�H��X���H��@����<-t<_u���P����AH�X�����4�����)ȉ�4�����T������0��3������DȈ�3���H��X���H�� ���H�������4���H�����������ts��������T���D�����L������L�����L�����������E1Ʌ�����H��(���H��t	�80��H� �RE1�H�H��(�������H��DžP���DžT���H��H������H���R�8t)H��P[D��1�L���RH�5Y�H�1�A�H������A�mH���Dž�����c���ƅ��������E1Ƀ�T���A���?���H�Z�R�8tG������H��1L��L��X���LE�H�<P[H�e��H�H�^!RH�81��D��H��x���M����X�������������oDž�����������D�����L�����L���������H�J[�8��H���R��2�����"��t1H��O[L���R1�H�5r�������H��8���@��H�1�A�H��x������X�������������H��x���M��ƅ������,�H��R��2�����������t&H�O[L��RH�5�1�H��X���H�1�A�H��x���M��Dž����ƅ�����(����3�����H��(�����H��N[I�H�5h�H����ƅ2������M��ƅ�����v��t1H�rN[L�{�R1�H�5j�������H��8���@��H�1�A�H��x������X���������������H��x���M��Dž�������L������������uH��(�����H��(���D��H��L�����������������u����L������H��p���H��(���L��H��h����Є�������H��x������(M���{�H��(���H��t	�80�H�f�RE1�H�H��(����$�H��x����(H��(����81��L�-��UI��H��L��I���L��P@����I���H�[9L��L��P@����H��(����80tAL��(���I���H���L��L���P@��tI���H���L��L��P@���5H���R�H�0H��p���H������M��H��h����Ј��������i�H��x���ƅ����Dž����
�(�I�H������3����}����E���@H������I�D��M��A��ƅ����H�H����(M��Dž����ƅ�������A�@0@��������I�1�H�5׌H��K[L���R��@��H�1�A�������H��x���M��Dž����
�(��H��x���M��Dž������m�H��x����(H�c�R�H�0����x����*����x� ���H�8�RH�H��(�����H��RH�H��(����W���������tII�GI��H��(���H��t1H��x���M���(���H��x���M�����ƅ�����)��I��H���R�8t"H��J[I�H�5�1�L���RH�1�A�H��x���M��ƅ����Dž�����(�i�H�������M��L�
j�RL��(���H�5܊H�H�BJ[H�1�A�ƅ�����'������H�?��UH��AUL�-~ATSH��H���7DH��D[1�H��1�L��I��M��t
H�C0��?H��
tPH��pH�;taL�c H�C0M��tH�ƒ�?H��
t
��u�L�c�I�<$�WI�$H�C0��f�I�<$H��p�3I�$H�;u�H��[A\A]]�f.��ff.�@H�H����UH��AWAVAUATI��SH��8�H��RI�|$H��tD�?t?�������A��I�D$0�@�t��?H��
��H����H����H�3�
�F���I�D$0��?H���dH���ZH��
��I��pI�$H����I�|$t�A�T$����������8�A�H�8LH�
��HD�H�5��1�耯���I�$�8�����H�5�1��[���M�4$H��RA�>@��t.�H�3@��_u�-�m���I��A�>@��u�M+4$E�A�D$8���4I�L$0H�ʃ�?H���H�����0����H��������H�
�H��H�5ۃ1��诮��1�A�|$8��A�tE�9���f.�I�|$@������H�
��1�H�5���e���M�,$A�}@��t(�H�3@��_u�-�}���I��A�}@��u�H�=[�I��p���I�$H���C���H��8[A\A]A^A_]�H�5�J�1�A������b���DH�3� ����A�u�a���f�H�=9�E���A�I��A���H�3� A���ϼ��A��u�OL�-��M��D)�M)�H�L9���f�Mc��OL)�I��M�M9�w�<�I��M9�t+A�? u�A�}H�3I���_���M9�r���I��A�} t�H�3�
A��2���f�H�3� �#���A��u�M��A�M)�I��9�g���L��H�5�1�L�Eȿ譬��I�D$0L�Eȃ�?G�,H��
�l���I�D$(L�=��D�0�If�H�3�
賻��I�|$1������H�=���$����o����I�D$(L�=2�D�0H�@I�|$H�0�8���H������D��L������I�T$(��H�RH�:����A�����A�V�H�E�H��L�e�H�U�H�=ĀA���Y�I��A��H�3� A�����A��u�H�3�,L�%���պ��H���M��A�NI)��O)�H�L9���A�O@Hc�M��I)�M�M9�w�f�I��M9���A�? u�DA�<$H�3I���g���M9�r��dI�D$(L�=̅�D�r�����f�����H�
H��H�5�1���ڪ��1�A�|$8��A�tE�d���DI��A�<$ t�H�3�
A����f�H�3� �ӹ��A��u�M��M)�I��9����L��H�5k1��M��L�E��[���H�E�L�u�L�E��M�H�@(B�4H�@J�<0I�����L�u�L9u��M���L�e��	���@H�
�H��[/�C���D�H�
�H�m[/���ff.��UH��AWAVAUI��ATSH��H�?dH�%(H�E�1�H����M��"fD�+�����9�B�I��pI�<$H��u�H�=�A�A� �>������1�L���H�
�H�5�~�K����-L�%�R�DA9޿-AD�I�4$A���_���A��Ku�I�4$�
�K���I�}u:���H�a<[1�L��1�H�=�I��M��uI��pI�}��A�E0�u�M�uM��t�M�}A�?@����f�I�4$@��_u�-�̷��I��A�?@��u�L��I+EA��9�s�I�4$� A��螷��A9�r�I�E0��?H���nH�
Q�Hc�H���H�E�dH3%(��H��[A\A]A^A_]�E1��I�E`H�=9H�H��H1�H��?H)�I���8�H��#HE�褳�����H�=
}蓳�����A�>H�=�H��#HE��s�������A�H�5��1�舧�����A�H�5�|�1��m������I�H�5�|�1��R����t���I�H�5��1��7����Y���I�>H��������H������=���L������I�>�
L����L���Dz������I�>H�-|H��HD�謲�����I�}(I�6�k;H��蓲�����M�>M����H�=�
�v��������A��H�5�{膦�����M�6M����I�}(����~1�E1��:H�{
H���*�I�}(D9?v^D����:E��H�Z
H��H�n{HE�H�5{�1�����A���H�+H�5�zHE�1�A�����I��u��
�������H�=E{螱�����"�9���E1��
A��I������I�}(D97����A��t�D���2:I���H��zH�5�HE�H��1��m�������fDU�H��H��H�u�芫��HiE�ʚ;HE���ff.��U1�H��H��H�u��]���H�U�H��S㥛� HiM�@B�H��H��H��H��H���ff.�@U�H��H��H�u��
���1҅�u'H�U�HiM�H��(\��(H��H��H��H��H��H����H����UH��AUATI��SH��H��L�-;[A�}��H������谧��H��t;H������x�/t�/f���H��L����1�H��[A\A]]��A��t��%���H����*����1����������뾐H�V�L�����H��1�[A\A]]�������ø������1���/����~t��1��/u�H�I<[H�:H��t�UH������]�������ff.�UH��AVAUI��ATS�H��H�=?
��tH��</tb�%���A�ą�t.�I���I���*A�A���uV[D��A\A]A^]�f.�H���H�����uTH��9[�D��[A\A]A^]�fD�{H�=�
HE���H��1������[D��A\A]A^]�H��H�F9[��H���y��x�/�i���)��/�DD��[A\A]A^]��U�/H���b���]H�����f.�UH��ATS1�H��H��5[�8tH����[A\]�@�H��5[H�=��L�%`�RH�U�R�H�o6[A�$���H�蕪��H��te�����H�
�UH�q@��H���������Du�1���0@�ƍt6L�E���1�H������E�
�A�$H�=�����H��t]����H�
x�UH�q@�f�H��������Du�1���0@�ƍt6L�E���1�H���w��E�
���TH��
RH�=z4[L�%�9[H�p4[H�H�^4[H�G4[H�8H��	I�$H�j9[H�H��tH���rq��H�I�$�&0��*��uCH�=`�?���L�%89[I�$H��tH�=5[H������I�$�g���H����[A\]�@H�����[A\]���
����fD�
���fDUH��AVAUATSH��H��3[dH�%(H�E�1��;��H��	RA��L� @����H��R�8����H�P�RD�O�H�0A���XD��fo5t�f��fo-X�H�Ffo��fo��fo=.�f��H��H�TH��oH�oH��@�DoH����oH�A�Ɉ��fo�fv�f��f��ff�fv�fDo�fv�fD�fA��f�f��H9�u�fo�D��fs���f��fo�fs�f��fo�fs�fA~�f��fo�fs�f��f~щ�H���T��t�����&���P9�v_H���T��t��������P9�v=H���T��t���������9�vH���D��t����������D	��r�1������
A��uM�)�*��-H���R�8�Ч��H��6[��H�E�dH3%(��H�e�[A\A]A^]�1�H��@���股����u�H��P���f��f�H��H��X������H�KY�8��m4�����H��������H�<�H��H��?������H������L������������L��p���������H��������H)�H��H���������H���������H*�H��@���H��H�<�H��H��?H���^�H��H��H��H)�H��H��`���L���H*���^�豩��H��P����H���RL������L��H���1��ܻ�L����	�S���DA�������A������A������A���
���E1�1�1��{����ƣ��fDU�H�5s�RH�=�|H��SH��H�}�RH��H��H�5��RH�=~|�PH��H�5@�RH�=e|�PH��H�5�RH�=L|�PH��H�5��RH�=3|�P H��H�5��RH�=|H�@(H��[]��f�H�6H�?饥��DH��t3UH��SH��H�H����BH�{81��+���H��H��[]�D��H��鑤���UH��AVAUI��ATI��SH��tBH��H��H����w�����t����H����!��1�A��ubH��[A\A]A^]�fDH�]a[���8�H��H��t�H��L��������t�贚��I���l!A�H�߉���D�S!L���
�1��=���H��[A\A]A^]ÐU�H��AWAVH������AUI��H�5�ATSH��H����dH�%(H�M�1ɀ?H�����HE�H�����x�/I��t�/I��f�0H���������H��H���%L�=�d[L��xH�� A�?�I��H���H��tAH��H�@1ɺAUA�?A�H��A�H������d=ZY��tNH�����H���ڥ��1�A���~H�M�dH3%(H����H�e�[A\A]A^A_]�f�A�?I��8M�����L��L��0����-���L��%@H�����H�� ���H�����H�����H���?�x.��H�����L�@uGL��L��輴��H�� ���H���.���1�H�����H�����H��(����>��t��	����1��L��L���H�L��L������豞��H�����L��L��������I����R���L������L��L���0���H�� ���H���������L��L���@���H���]������f��x����f�x.�������fD���H�����1�葷���^���@�×��H���{���8���f�H������A�� uH���H�AH��H��A�A����H���H�
����P$�pH�x��M���Ϟ��f.�D�ff.�@H���H��HD�H�C�RH�8��UH��AWAVA��AUATI��SH����u
H�]+[L H����H�������L�nI��M�}L���P���H��H����L��H��L��D��H��H����Hc��M�L	�H�C�H��RH�����M�L���C�H���R��A�� uH��H��[A\A]A^A_]�@L��1�H���ә���ېA� A�L��輟��H��H���l����+���I����A��L���A��t:H�{�RH�
H�y�RH�
H���g���L��D�1�衵���N���@H��u1��V���L��D�1��x����=���H��tkUH��AUATSH��H��L�g�H��RH�W��M��H�I��L���H���RD��H����L)���H��H�{�[A\A]]�z���f.��ff.�@UH��AWAVAUATSH��H��H����H��L�n�I��}�H��I�|$�H�M�H�sM��茡��I��I��H����E��L��H��L��A���}�I��I��H	�I�G�H��RH����H��A��A�G�H���RL)��H��L��[A\A]A^A_]Ð��@�d���H��H��H��[A\A]A^A_]�>���fDI9�vM���fD�C���I���A�M��E��u�E�t�H�ھ�1��ճ���}���L���X�����fDUH��ATI��SH��H��H������H��H��tH��L��H���"���H��[H��A\]��UH��AVI��AUA��H��ATI��S����L��D��H�XH���r���H��H��tH��L��H���̘��H��[H��A\A]A^]�ff.�f�UH��ATI��SH��H��H�s�'���H��H��tH��L��H��聘���H��[H��A\]�f�UH��AUI��ATI��SH��H�^�QH�8����A�Ā��H���QA��H�3uaH�r+[H�8H��t!�}���H���H�=:f����H�3L���Y���H�3�
�l���H�;H��[A\A]]隚��f.���F���H�+[H�3H�8H��u��f�H��[A\A]]�DUH��AVAUI��ATL�gSH��%[I��L�M����I�II9���E1��DH�HI��L9�sZI�I9�LB�H��u�L��I��I�D$H�
�RL9�D�2LC�M9�LF�L���I���H��tjL�pI��L�pH�H�H�HH��H)�L)�HXA�� H�HuH��[A\A]A^]��L��H��1���H��[A\A]A^]�E1��q���L����U���H���
�1�A���t�L���1�����ff.�UH��AUI��ATI��SH���x���L��H�XH�����H��H��tH��L��H���3���H��H��H��[A\A]]�f�UH��ATI��SH��H��H���h���H��H��tH��L��H����H��[H��A\]��UH��ATL�%+$[SI�<$H��tf�H�蘘��H��H��u�I�$[A\]�UH��AVAUATSH���u
H��$[HH�d�R;8sXH�
��RHc�H��H�H‹r��t=L�*H�H��D�c���A�ą�t{���I���A����td�F�;���A�ą�uH�$[�([D��A\A]A^]�D裏��I���[A�M���t�E1�H��L��1���@H���1���M��t�L������f�UH��AWAVI��AUATM��SH����x5H��#[���H�i�R;8s	A�� tlH����[A\A]A^A_]�A������H����������A��t���8�DD�A��@�L��L��H��D��1��~����@H�1�RHc�A��L��H��L�H�vY[I�͋8I�L�E�����L�E�I�H��"[H�H��RH�F�|(�?���UH��AVAUI��ATA��SH��H����u
H��"[HH�r�RD�0��uBD��D��L��1���蔛��A��I��L��D������H��[A\A]A^]�@H�u�L����
H��t*D��}�H��D���
1��N����}�A�ą�x������A������DUH��AWAVAUI��ATSL��H��(A���}�H�u�H�M�u
H��![H�i���I��I��H��A����H�E�txM����A�$H�M�L��H�u��}��ܙ��I��I9�����A�$���t
I��������I�G�H���������E1���DM����A�$H�M�L��H�u��}��d���I��I9�t$�gA�$���t-I���t<I�G�H���w2��t�M�H��(L��[A\A]A^A_]��+��I�G�H���v�A�<$t���t;I����9��}�D� ��sH�޿��@H��D��1�H���֫���I���t�H�}��{���I������r����A�<$u����@E1�A�$H�M�L��H�u��}��r���I��I9��.����qA�$�����I�����I�G�H�����L}�M)�M�L}��E1�A�$H�M�L��H�u��}��
���I��I9����	A�$���t
I���������I�G�H����|L}�M)�M�L}��H�}��y������}�I�����D� �rH�޿	��@H��D��1�H��芪���@���D�{������A�<$�Q�������A�<$�A�������E1������UH��AWAVI��AUI��ATI��SL��H��(A���}�u
H��[H�E�H�E��}�L��L��L���P���I��I9�������H�E���H�Mȋ	�I���t
L}�M�M)�M�����H�؃�߅�HE���8tB��8zt8I�G�H���v���8�w�����u[L}�H��(L��[A\A]A^A_]�D�� tË}��;qD�}�H��D���|<D�����E��-���fD��t�E1��fDI�������t���}�D� ��pH�޿��@H��D��1�H���ݨ���i����UH��AWAVAUATI��SH��H��8���}�H�u�u
H�F[H�ވ��I��I��H��A����H�E���M����A�EH�u�L��}�����I��I9��5�PA�M�����I�����M��0M���M�������t�f����IL�}�H�}���E1�L�u��@M���wA�EH�u�L��}��x���I��I9�t_�A�M���tI�����M��u$��t���M��M���M����n���A�����I�G�H�������tYK�7H��8[A\A]A^A_]�fD�M��@M���M�������A���u	�������I�G�H����I����1�H�}��+1�M����H��8[H��A\A]A^A_]ÐE1�A�EH�u�L��}��v���I9�H�E����
A�MH�U��ɉ�"H����X�M�H�U��
H�U��M���H�����t��\���@H�E�A�EH�u�L��}����I��L9��$�8
A�M���tnI�����M��uu��t�L�}�������}̉M��mH�ދM��	��@H��1�H������������c�����f�I���g�����M��M���M���t�A���ttI�G�H�����L}�M)�L}��&���fD�M�H�U��tH�U��M���H���N������tH�B�H���w?HU�I)�I��c�����u��Y���fD��u�����fD1����L�u����L�}�I���tQI���������}̉M���lH�ދM����@H��1�H���Ф��L���k���H�E��L��E1����L��I����I���H�E����f.�UH��AWAVI��AUI��ATI��SH��(dH�%(H�E�1������tS薄���8H�����E��A���������H�M�dH3%(����H��([A\A]A^A_]���A���t�L������L�����H������L��L�������hU��H������L��L���VU��L��L�����u�L��L������Å��p���L��L��1��u������W���f�1�L��������$����i
�����fD�S
L��L��D��1��9��������ߊ��f.�DUH��AVAUI��ATA��S�ڈ��H��H���tH��[A\A]A^]�D�+���I����	A�A���t���	D��D�(�j1��!H��D��1�财���f�U1ɺH��AVAUI��1�ATA��S�q���H��H���tH��[A\A]A^]�@賂��I���k	A�A���t��[	D��D�(�@j1��!H��D��1��<����f.��f.�D1��ff.�f�UH��AVAUI�պ�ATI��H��SH��L���<�����xH��1ۉ�[A\A]A^]�D����I����A����t!A�������t�L��1��1�蝡���H��L�������fDUH��AVI��AUI��ATI��S跁����uC��A���u��[A\A]A^]�DL��L��1������ۉ�[A\A]A^]�f��[���H���D�A�������D�t�L��L��1�1�������[A\A]A^]�UH���H��H��H��p������1҅�u�E�1�%�=���ɉ��DUH��AVAUI�պATI��SH��H����H��H��dH�%(H�E�1��"���H��t5��H��L���]�1�H�M�dH3%(unH��[A\A]A^]�@�c���I���A�A���u(1�H��L���35��8�����D�����H��1���1��П����y���f�U�H��AWAVL������AUATSH��(H������H������H��L��dH�%(H�E�1�踤�8��I��A�����I�^L��������/��f��</to��tDH�����t</u��f�>.tNf�>..tAH��I9����*D��1��Յ��A�Ņ�x/A���tD��蠎��E��H�����~u�����E1�A���tD���n���fDH�M�dH3%(L��uKH��([A\A]A^A_]���~��E1�����~��E1��$�H������L������L)�D�8I������fDH�=A[H�52[ÐUH�[H��AVAUATS�8��H�FI[I��A��H�H�[H��t&��D���N����Ã��u$��+~��D� A��u:D���*����Ã��t�uH��[H��t[�Љ�[A\A]A^]���}��D� fD�D� E��u������H�y[H��t��A�� t$D����t	A��	u1ۉ�[A\A]A^]�A��t��MD��D� �2e��H��D��1��+�����f�UH�[aH��H��AUI��ATS�H���?HD�1������x2L���A��H�� ���L��D���øE������E�H����[A\A]]�UH��ATSL����H��H�����H������L��H�� dH�%(H�E�1��N��H��L���F���H�M�dH3%(uH�� [A\]����fD�ff.�@UH��AUATSH��H���RL�-EG[H�NB[H�L��:�P@L�%�I[L��I�E(L������L�-I[H�CB[H��:L��P@L��L��I�E(���L�-�G[H�CB[H��:L��P@L��1�I�E(�Ά��L�-H[H�B[H��:L��P@L��L��I�E(覆��L�-�H[H��A[H��:L��P@L��L��I�E(�~���L�-7H[H��A[H��:L��P@L��L��I�E(�V���H�H�PA[H��F[�:H��P@L��H��H�C(H��[A\A]]�$���@UH��SH��H�F[H�{(H��tH�`�RH��PHH�C(H�����H��G[H�{(H��tH�3�RH��PHH�C(H���͂��H�vF[H�{(H��tH��RH��PHH�C(H��蠂��H��F[H�{(H��tH�٠RH��PHH�C(H���s���H��G[H�{(H��tH���RH��PHH�C(H���F���H��F[H�{(H��tH��RH��PHH�C(H������H�BE[H�{(H��tH�R�RH��PHH�C(H��H��[]���fDUH��SH��H��E[H�{(H��tH��RH��PHH�C(H��誁��H�E[H�{(H��tH��RH��PHH�C(H���}���H��E[H�{0H��uH��H��[]鏈���H���RH��PhH�C0�ԐH��R�8�2���f�UH��AWAVAUATSH�������������+���L�%T�RH��D[H�J?[I�$H�ދ:�P@L�=CF[H��H�C(L���ă��H�=D[H��>[I�$�:H��P@H��L��H�C(蛃��H�E[H��>[I�$�:H��P`H��1�H�C0�����>���H�xhH��L�p@H��tI�$�PHH�ChL��L�k�S���H�{8H��uZL���r���H�o>[I�$L���:�P@L��L��H�Ch����I�$H�5>[L��:�P`L��1�H�C8H��[A\A]A^A_]�q����I�$�PhH�C8�ff.�@H���RH���8�?���ff.�@UH���g���1�H��tH���H��]�@H��[���=a[tUH���.���H��t	H�]Ð1�]�@1��D�=1[�uÐUH��AUATSH��(���H��1�H��tH��([A\A]]�f�����{��H��H�EظH��t�����H�]���|��L�%+�RH�=[H���L�k@I�$�:L��P@H�5D[L��L�kH�Ch薁��H��<[I�$L��:�P`1�L��H�C8���H�.�RH�gB[H�H��H�{(H�T�H�E�H����,���H�����H�'[H�{(H��H�E��~E�H�[H�E�fl���H��[�H��uH����z��H�E�ƀ�1�����I�$��`��ff.�1��=�[��UH��AUATSH��H��[��[�;uH�=��R1���y�������H��RL�%zA[H��;[H��:L��P@L�-�B[L��I�D$(L���Q���L�%�@[H�c;[H��:L��P@L��L��I�D$(�(���H�];[H�H��A[�:H��P`1�H��H�C0�}��������E�t�H��[A\A]]�D�{����E�H��[A\A]]�@����H���QH� Y�H�81��q�����f.�UH��AVAUATS�P���L�%ٚRH��I�$��81����H��t	���u[A\A]A^]�fDH�{hL�k@H��tI�$�PHH�ChL��L�k�0|��H�{8H����L���K���L�-@[I�}(�����L���~��H��[�*t%I�}(H��u<L����x��H��[A\A]A^]�|��@L�59@[I�~0H��u4L���s���fDI�$��`�@I�$�PhH�C8�i���I�$��p�UH��AUATSH�����H�;�RH�SZ��/�DH�F?[Hi���
Hi�ʚ;H�H��H��	H��H��H��H�U�Hi�ʚ;H)�H�{(H�M������H���}��L�%�[L�m��'H�=i?[H�0�����L��H���3~����nt.��>t)A�$��u�H�{(H��ugH���w����������"@A�$��u(H�{(H��uPH���ww���b����s[H��[A\A]]�H�I�QH��V�H�81��#���H���RH���`�H���RH���`�f.�UH��AWAVAUI��ATI��SH��H�����}�u
H�g[H�E�H�E�M�����}�L��L���s��I��I9���H���t
HE�I�I)��q��I���u���A���k������H�؃�߅�HE��T����8tO�J����8ztEI�F�H���v��6����8t�M�����Eȅ�tQ��utLu�H��L��[A\A]A^A_]�fD�� t��}���XD�}�H��D���$$D�����E��*���fDA��E�����D��t�E1��fDI�������t�����}�D� �|XH�޿��@H��D��1�H���m����P����I������3���@UH��SH��H��=[H���Hz���H���~��H��=[H���,z��H��H�߾[]�~��f�UH�=�=[H���r��H�=�=[]�r��U1�H��SH��H���z��H�{(1��x��H�CX1��C`H��[]�ff.�f�UH��SH��H�(H���~��H����w��H��1�[]�f.�UH��SH��H���Oz���CXH���st��H��1�[]�f.�UH��ATSH���!z���SX��t �C\L�c(f�H��L����z���CX��u�k\�C`1�[A\]�ff.�@UH��SH��H���`t�W\�G`��u+H����s��H��1�[]�f��y���kXu�C\��t�fDH�{(��n����f.��1����UH��AWAVAUATSH��(L�~I�H����A��I���q��L�}�E��A��D�m�I�<A��E1�H��PUE1�L�JPD�E�L9���E���*L�4L����H��H��L9����
��=����,��D�;D��L��G�<9G8<t�@��tH9�w#E��t
���,t��=t�Uȅ�u
�u�A���u�H�u�I��J��H���b���E���)L9�� A���'�Eȅ���E���H��([A\A]A^A_]�fDH9�v �� t���
�� �|H��H9�u�E�H��([A\��A]A^A_]�fD�3�4�����;�(�����DL���H��H��H9�tKD�D�2L��L��G�<G8<1t����DE��������,�{�����=������m�����;�����W���f��;�L���L��������H��(1�[A\A]A^A_]ø�������DUH��AWAVAUI��1�ATI��SH��H�����A�ƅ�~H��D��[A\A]A^A_]�fDM�|$L�%�Q�;I�<$�L��H��P�1���x��I�I�<$H��P1��I�_L�-�P�x��I�OH��t"I�<$L��1�H���x��H�H��u�I�4$�
�t���V���fDI��L��H�sP1���Ox���y���f.�H�h�97vH�WH��t��H���D��u���U��H��SH��H��H�����H��H��H��[]�hq���UH��AWAVAUATSH���������?I����I��1�E1�A�D��H��A����u�fDH�����t<,u�t�{H���L����������xL��H��I	Ā;t#A�H���E1�H��L��[A\A]A^A_]�E1�A���ff.�@UH��AWAVAUATSH��H����I�� H��H�}�����I��H����A�$H�߃�H�4@H�����I�FH����A�$H�T�I�VA�$A�I�t$H����H��踅��I�FH��t]I�FA�$��t{E1��#fDI�D$A����I�F��E9,$I�FvSD��H�}�L�<�I�D$��I�D$H�4��
���I�H��u�E1�H��L��[A\A]A^A_]�DI�F�fDA�H��A�I�F���ff.�f�UH��H��AWAVAUATS�u�D��L�H�U�H�]H�M�H�I9��(H��JU�L�PP�؎R�E�H�ގRH�EЅ��H�G�E�E1�H�E�H�E�H�H�E�H����H�}�1�DA��D�L9��A���,����=��D��A��L��G�4E84t>������,����=���_L��D��I��A�C8��H��L�_H9�u����H�E�H��H�<�H���Z���H�EL)�L�H�E�0H�E��}�H��t1H�U�L	�H!�[A\A]A^A_]��H�EL�E1�D�H�����H�U�L	�H!���L��DE��u��� t�f���� ��H��H9�w�A��D9e���DH�U��H��L	�H�]�H���B���H9��9����8=�0����U����%���H�]�L�M������E1�L�hA�9E��I9�����P��=����,��@��D��L��A�C8"t:�����,����=��E�aI����L��G�$"E8$urH��I�YH9�u�A�yH��@��t0H�]�I��N��M���a���E��A�9I9��[���L��@��u�A��H��A����H�]�H	]��f�L��D@��u��� t�\@��� uPH��H9�w��DA�y��f���,�l�����=������^���f�D�O����fD��,�g�����=�.����Y���f�E���x���L��A��D9e������}��r����E�H9��u����8,H�P�X���I�����f.�A��u
L}���@H�]�H�}�H��tI	��fDH�����H	]��f.�H�EL�D�H������>���f.��ff.�@1��ff.�f��ff.�@1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f��ff.�@1��ff.�f�1��ff.�f��ff.�@�ff.�@1��ff.�f��ff.�@1��ff.�f��ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f��ff.�@1��ff.�f��ff.�@�ff.�@�ff.�@1��ff.�f�1��ff.�f�1��ff.�f�1��ff.�f��ff.�@1��ff.�f��ff.�@�ff.�@1��ff.�f��ff.�@1��ff.�f��ff.�@1��ff.�f�1��ff.�f�1��ff.�f��ff.�@1��ff.�f�H�1��fDH�1��fD�ff.�@1��ff.�f�1��ff.�f�H��H��H��L����d��ff.�@H�1��fD�ff.�@1��ff.�f��ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@�ff.�@H���RH�8�DUH��SH���H��L�UE��ua1Ҹ�A�����DC�A��vEC��CD9�D�CDFȉs�{D�KL�S H�H��t?I��L�S H��1�[]�D�CD�CD�K�s�{L�S H�H��u�E��t�A��L���f��H�H��u��C�DUH��SH��H����C;{t��H���Hȉ{H��[]��sH�S ��{���t,H�����H��H��ts�{���C��uF�����H!s �&H��PH��H��H�3���H��H��t>�{���C�SH�S�|����H�3H��H���
`���{H�����C�@1��W����UH��SH��H���O;Ot$�W�σ��K��H;��_��1�H��[]�DH�u����H��H��t�SH�u���fD��͐�W1���t��H��W�WH��fD1�9w��U1�H��ATS�OH�����H�W �ȉ��wA�̋��u)H��PH��H��H�3���H��H��tGH�1�D�c[A\]ÐH�����H��t*�S�SH��H�3��^��H�������H!C ��f���[�A\]�ff.�UH��AUI��ATI��S��H���G9�w'9WvOA�|$��1�)�����I<$�\���CA�D$A�T$L����I$H���f^��1�H��[A\A]]�f��������¸��u�A�D$��H��֋W9wv��H7H���^��D1�H���6\��fDUH��SH��H���G!u
H�?H��t����H�H�CH��[]�ff.��W�G�����W)��Ή���HH�H����d��f.�UH��AVAUI��ATS�GH���tI��E1�f�H��A��A��A�EH�E9ew�[L��A\A]A^]�I���f�H�O ��u/H�7H��t'UH��ATA�S�G��DEgD9gw[A\]�D��D���WH���H���j��D�cH�[A\]�f.�@UH��SH��H�=`S���H�=�Y���H�=h9U���H�=|8U��H�=�6U��H�=�5U��H�=x7U��H�=,�R��H�=@�R�{�H�=T�R�o�H�=h�R�c�H�=�IZ�W�H�=P\S�K�H�=d[S�?�H�=xZS�3�H�=�YS�'�H�=eS��H�=�KT��H�=KT��H�=JT���H�=0IT����H�=D�S����H�=X�S����H�=l�S����H�=��S���H�=t�T���H�=��T���H�=��T���H�=��T���H�=�+U���H�=�*U�s��H�=�)U�g��H�=)U�[��H�=tkU�O��H�=�jU�C��H�=�iU�7��H�=�hU�+��H�=�yU���H�=�xU���H�=xU���H�= wU���H�=�aW����H�=�_W����H�=�^W����H�=�]W����H�=�`W���H�=JV���H�=�8V���H�= IV���H�=4HV���H�=HGV���H�=\FV�w��H�=pEV�k��H�=�DV�_��H�=�CV�S��H�=�BV�G��H�=�AV�;��H�=�@V�/��H�=�?V�#��H�=�>V���H�=>V���H�=$=V���H�=8<V����H�=L;V����H�=`:V����H�=t9V����H�=�6V����H�=|8V���H�=03V���H�=D2V���H�=�5V���H�=�4V���H�=�3V�{��H�=41V�o��H�=H0V�c��H�=��W�W��H�=�W�K��H�=$�W�?��H�=8�W�3��H�=��Y�'��H�=�Y���H�=ԣY���H�=�Y���H�=��Y���H�=�.V����H�=$V����H�=�-V����H�=�,V����H�=�+V���H�=�*V���H�=*V���H�=)V���H�=0(V���H�=D'V���H�=X&V�s��H�=l%V�g��H�=�$V�[��H�=�#V�O��H�=�"V�C��H�=�!V�7��H�=� V�+��H�=�V���H�=�V���H�=V���H�=`V���H�=V����H�=�V����H�=�V����H�=PV����H�=dV���H�=�V���H�=�V���H�=�V���H�=ԞY���H�=�Y���H�=��Y�w��H�=�Y�k��H�=�V�_��H�=�V�S��H�=�V�G��H�=�V�;��H�=�V�/��H�=�V�#��H�=�V���H�=�
V���H�=
V���H�=V����H�=,V����H�=@
V����H�=T	V����H�=hV����H�=|V���H�=�V���H�=�V���H�=�V���H�=�V���H�=�V�{��H�=4V�o��H�=�V�c��H�=��U�W��H�=��U�K��H�=$�U�?��H�=8�U�3��H�=L�U�'��H�=��U���H�=��U���H�=(gW���H�=<fW���H�=�cW����H�=�bW����H�=8eW����H�=LdW����H�=�aW���H�=�`W���H�=��U���H�=<�U���H�=��U���H�=��U���H�=��U�s��H�=�U�g��H�= �U�[��H�=4�U�O��H�=H�U�C��H�=\�U�7��H�=p�U�+��H�=��U���H�=��U���H�=��U���H�=��U���H�=��U����H�=��U����H�=��U����H�=�U����H�=$�U���H�=x�U���H�=,�U���H�=��U���H�=��U���H�=h�U���H�=|�U�w��H�=��U�k��H�=��U�_��H�=��U�S��H�=l^W�G��H�=�]W�;��H�=�\W�/��H�=�[W�#��H�=��U���H�=0�U���H�=�U���H�=��U����H�=��U����H�=�U����H�=�U����H�=(�U����H�=<�U���H�=P�U���H�=d�U���H�=x�U���H�=��U���H�=��U�{��H�=��U�o��H�=��U�c��H�=��U�W��H�=��U�K��H�=�U�?��H�=�U�3��H�=l�U�'��H�= �U���H�=��U���H�=��U���H�=\�U���H�=p�U����H�=��U����H�=��U����H�=��U����H��STH�{ tf�H��H�������H�{ u�H��1�[]Ð��Q��ff.��ff.�@UH��SH����t3��gfff�����)��9�t;H��wR�<H�H��[]��H���x��A�<H�ھD��1��\l��A�X�<1��DH�5�1��im����H�9wR��UH��H��H���H��H��tR�f����@���H��I��E1ɹAP�����E1�HLJ�H�G �@��ZYɅ����Ƈ��ff.�@UH���H��SH��H��dH�%(H�E�1����u1�H���1�H����A�P�]�������H�M�dH3%(u
H��[]���R��ff.�H� t9UH��SH�����LJ�������R����yH��[]�H����1�[]�Ѻ����f.�DUH��AVAUI��ATI��SH��H��dH�%(H�E�1��>~u�~/tH��������t?��H��L���oL��H�M�dH3%(�
H��[A\A]A^]�f��;.u
�{/��H�5�H���L��u	M����E1�A�H����L��D��L�����1�)�L��莥�����g���L���H����������!�%����t��J�4+L������D�H�WHD�����H��L)�H)�L��n����L�����H��E1�L��L��1�L���o���f�A�A��C����
Q��f.�UH��AWAVAUATSH��H������dH�%(H�E�1�H����H�F�I��I��Dž����H��H�H������Hc�H��H���H)�H�D$H���H��H����H������I��H��x���H��H�������L)�H������H������1�H+�����I��H��H��	�uH��H������H��I��H��H������H��H�H������H��(�UH��H��H��I��I��H�H�H������L��H��H��p���H��A��H��p���H��h���H�H��`������RH��p���H������H��A��H��p�������H��H��H��p���A�ԅ���H��h���H��H��p���H������H��N�0H�L��L��h���H��H��X���A��L��h���H��X����������������j
L�JI�HM9�K�4(I�@@��H9���@��D-I�M�H��@��H9���@���)-H9ƿIC�1�H��H����Ao�o,A,H��H9�u�I��I���K�J�L9����8D�D�@�9H�xH9����xD�QD�P@�yH�xH9��d�xD�QD�P@�yH�xH9��F�xD�QD�P@�yH�xH9��(�xD�QD�P@�yH�xH9��
�xD�QD�P@�yH�xH9����xD�QD�P@�yH�xH9����xD�QD�P@�yH�xH9����xD�QD�P@�yH�x	H9����x	D�Q	D�P	@�y	H�x
H9�vx�x
D�Q
D�P
@�y
H�xH9�v^�xD�QD�P@�yH�xH9�vD�xD�QD�P@�yH�x
H9�v*�x
D�Q
D�P
@�y
H�xH9�v�p�y@�x@�qL��X���H��H������L��P���H��h���A��L��X�������	H��h���L��P����&L������H��H��L��A�ԅ���H������H������A�ԅ���H������H������A�ԅ���H������L������J�(M)�H������L��L���J��I�E�H�������H������L��H��A��J�+��y�IfDM)�L��L��A�ԅ�x�L9��������I�LH�υ�t%H�I�6H�3I�M)�I9��]H����H�sH�CI9�I�vA��H9�@��A��wH������A��H9�@��A���[H9�A�MC�1�L��H����o�AoAH��H9�u�L��H���H�I�6L9��[����3D�D�@�0H�sH9��A����sD�@D�C@�pH�sH9��#����sD�@D�C@�pH�sH9������sD�@D�C@�pH�sH9�����sD�@D�C@�pH�sH9������sD�@D�C@�pH�sH9�������sD�@D�C@�pH�sH9�������sD�@D�C@�pH�sH9��o����sD�@D�C@�pH�s	H9��Q����s	D�@	D�C	@�p	H�s
H9��3����s
D�@
D�C
@�p
H�sH9������sD�@D�C@�pH�sH9�������sD�@D�C@�pH�s
H9������s
D�@
D�C
@�p
H�sH9�������sD�@M)�D�C@�pI9�������H������L��H+�����H)����]���iH������H�qH9��[�~�����L������H�����������H������)�H��x���H9����������H�E�dH3%(�)H�e�[A\A]A^A_]�H��L9��^���K�<.M)��R���H������M��I��L�H������H9������L������L��p���H������H9�������H��K�D-H������L��I��H��� f�I�I�4I�6I�M��L9�������M��M��L��H������M)�L���Ѕ��r��������u�H������M�VJ�48I�FH��L)�M9�A��H������A��E���L�W�I��A��H9�A��E���wH9�HG�1�I��I���f��Ao�AoAAH��I9�u�I��I���K�K�I9��'����:D�D�@�8H�zH9��
����zD�@D�B@�xH�zH9�����zD�@D�B@�xH�zH9������zD�@D�B@�xH�zH9�������zD�@D�B@�xH�zH9�������zD�@D�B@�xH�zH9��w����zD�@D�B@�xH�zH9��Y����zD�@D�B@�xH�zH9��;����zD�@D�B@�xH�z	H9������z	D�@	D�B	@�x	H�z
H9�������z
D�@
D�B
@�x
H�zH9�����zD�@D�B@�xH�zH9������zD�@D�B@�xH�z
H9�������z
D�@
D�B
@�x
H�zH9�������r�xM��@�z@�pL9������w���f�I��L�����H������H9���������L������L��p���H������H�H�H��H������H�HH������H�������G����L��DA�$�I��H��A�L$��P�I9�r�����H������L��@�2D�H��H��D�B�@�p�H9�r�����H�������������_���L��������������������I�H�H��H������I�H�A�ԅ�x,H������H������A�ԅ��0����	����������H������H������H�H�H�H�������������0H������H�H��H�H�
H�A��H��p�������H��H��H��p���A�ԅ��� H��h���H��H��p���H������H��N�0H�L��L��h���H��H��X���A��L��h���H��X������L��X�������������
H������H�H�H�H�H������L��H��H��N�1H��p���H�L��L��h���H��H��X���A��L��h���H��X�������L��h���H��H������H��X���A��L��h������H������L��L��h���A��H������H+��������?H��H������H������A��H���������bH��p���H�����H��H��p���H��H������A��H���������SH��H������H������A��H���������_H��H������H��A��H����������H������H��H������A��H���������EH��H������H������A��L������H������M��H���������D������H������E���vH������H�
H�H�H����H�������~�����H�����������L������)���I�H�
L��X���I�H�H��H��h���H������A��L��X������Y���H��h���H������H�
H�H�H������H+�����H��������H��p������H�H�1H�2H�H��H������H��A��H�������������H�H�H������H��H������H�
H�A��H�������������H������H�L������H�H�H�H�������k������L��h������.H������I�H�H�I�H��H������H������A��H�������������H������H�H�H�H��p���H��p���H�H�H��H��H������A��H�������������H��p������D������E����H������H�H�H�
H�����D������E������I�NL������H������I�qJ�/L9�H�G@��L9���@���I�M�H��@��H9���@����H9¹IC�1�H��H����o�o,,H��H9�u�H��H������H���H�H�H9��~��3@�0�H�HH9��f�H�s@�p�KH�HH9��J�H�s@�p�KH�HH9��.�H�s@�p�KH�HH9���H�s@�p�KH�HH9����H�s@�p�KH�HH9����H�s@�p�KH�HH9����H�s@�p�KH�HH9����H�s@�p�KH�H	H9����H	�s	@�p	�K	H�H
H9�vn�H
�s
@�p
�K
H�HH9�vV�H�s@�p�KH�HH9�v>�H�s@�p�KH�H
H9�v&�H
�s
@�p
�K
H�HH9�v�P�K�H�SL������H�������l������H��p�������H�H�
H�H����D������E���v���N�*L�JL�R��������������L������M�PK�4(L9�L�QI�@@��M9���@��\I�U�H��@��H9���@���AH9ƿIC�1�H��H����Ao�o<A<H��H9�u�I��H������I���L�J�L9����8D�D�@�:H�xH9����xD�BD�@@�zH�xH9��d�xD�BD�@@�zH�xH9��F�xD�BD�@@�zH�xH9��(�xD�BD�@@�zH�xH9��
�xD�BD�@@�zH�xH9����xD�BD�@@�zH�xH9����xD�BD�@@�zH�xH9����xD�BD�@@�zH�x	H9����x	D�B	D�@	@�z	H�x
H9�vx�x
D�B
D�@
@�z
H�xH9�v^�xD�BD�@@�zH�xH9�vD�xD�BD�@@�zH�x
H9�v*�x
D�B
D�@
@�z
H�xH9�v�p�z@�x@�rH��p���H�����H��L��h���H��H������H��p���A��H���������U���H��p���L��h��������������H������H������H�H�H�H��S�1�������������������H��X���������L�JH������H������L������H�t>H9�K�(I�@@��M9�@��@��lI�u�H��@��H9�@��@���PH9��IC�1�H��H����Ao�o4A4H��H9�u�H��H������H���H�H�H9����0�:@�8@�2H�pH9��t�p�z@�x@�rH�pH9��W�p�z@�x@�rH�pH9��:�p�z@�x@�rH�pH9���p�z@�x@�rH�pH9���p�z@�x@�rH�pH9����p�z@�x@�rH�pH9����p�z@�x@�rH�pH9����p�z@�x@�rH�p	H9����p	�z	@�x	@�r	H�p
H9�vs�p
�z
@�x
@�r
H�pH9�vZ�p�z@�x@�rH�pH9�vA�p�z@�x@�rH�p
H9�v(�p
�z
@�x
@�r
H�pH9�v�H�r@�p�JH������H+�����H��H������H������A��H���������S������H������L������J�4*H�BH��M�AH��H��p���@��L9���@���I�M�H��@��H9���@����H9ƿIC�1�H��H����o�AoAH��H9�u�I��H������I���J�
L�L9����8D�	D�@�9H�xH9����xD�ID�H@�yH�xH9��d�xD�ID�H@�yH�xH9��F�xD�ID�H@�yH�xH9��(�xD�ID�H@�yH�xH9��
�xD�ID�H@�yH�xH9����xD�ID�H@�yH�xH9����xD�ID�H@�yH�xH9����xD�ID�H@�yH�x	H9����x	D�I	D�H	@�y	H�x
H9�vx�x
D�I
D�H
@�y
H�xH9�v^�xD�ID�H@�yH�xH9�vD�xD�ID�H@�yH�x
H9�v*�x
D�I
D�H
@�y
H�xH9�v�p�y@�x@�qH��h���H������H��L��X���A��H��h�������H��H��H��h���A�ԅ��NH������L��H��H��N�1H��p���H�L��L��h���H��H��X���A��L��h���H��X������9�L��X���H��H������H��h���A��L��X�������H��h������fDL������H������M�AL�WL9�J�/H�G@��M9���@���I�U�H��@��H9���@����H9��IC�1�H��H����o�Ao44AH��H9�u�H��H������H������H���H�H�H9����0�:@�8@�2H�pH9��t�p�z@�x@�rH�pH9��W�p�z@�x@�rH�pH9��:�p�z@�x@�rH�pH9���p�z@�x@�rH�pH9���p�z@�x@�rH�pH9����p�z@�x@�rH�pH9����p�z@�x@�rH�pH9����p�z@�x@�rH�p	H9����p	�z	@�x	@�r	H�p
H9�vs�p
�z
@�x
@�r
H�pH9�vZ�p�z@�x@�rH�pH9�vA�p�z@�x@�rH�p
H9�v(�p
�z
@�x
@�r
H�pH9�v�H�r@�p�JL������H������L��p���H������A��L����������L������H������H������A�ԅ��5�L������H������H������H������L������H�TH9�K�(I�@@��M9���@��?I�U�H��@��H9���@���$H9��IC�1�H��H����Ao�o<A<H��H9�u�H��H������H������H���H�H�H9����y�@H������L�@H������H������H��J�/H�GH��@��L9���@��:I�U�H��@��H9���@���H9��L������IC�1�H��H����o�Ao<<AH��H9�u�H��H������H������H���H�H�H9�����0�:@�8@�2H�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�pH9��o��p�z@�x@�rH�pH9��R��p�z@�x@�rH�pH9��5��p�z@�x@�rH�pH9����p�z@�x@�rH�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�p	H9�����p	�z	@�x	@�r	H�p
H9�����p
�z
@�x
@�r
H�pH9�����p�z@�x@�rH�pH9��j��p�z@�x@�rH�p
H9��M��p
�z
@�x
@�r
H�pH9��0��H�r@�p�J��H������L������H�t7K�(H9�H�rI�@@��I9�@��@��WI�u�H��@��H9�@��@���;H9��IC�1�H��H����Ao�o4A4H��H9�u�H��H������H���H�H�H9����0�:@�8@�2H�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�pH9��g��p�z@�x@�rH�pH9��J��p�z@�x@�rH�pH9��-��p�z@�x@�rH�p	H9����p	�z	@�x	@�r	H�p
H9�����p
�z
@�x
@�r
H�pH9�����p�z@�x@�rH�pH9�����p�z@�x@�rH�p
H9�����p
�z
@�x
@�r
H�pH9����H�r@�p�J�k�H������N�*L�JL�WL9�L�R��L9������I�E�H����M9�������M9ȾIC�1�H��H����o�o,,H��H9�u�H��H������H���H�:H�H9�����H������L�@I�NJ�4+H��H�C��L9�����0I�U�H����H9��„��H9ƹH������IC�1�H��H����o�o$$H��H9�u�H��H������H���H�;H�H9����:@�8�
H�HH9��g�H�z@�x�JH�HH9��K�H�z@�x�JH�HH9��/�H�z@�x�JH�HH9���H�z@�x�JH�HH9����H�z@�x�JH�HH9����H�z@�x�JH�HH9����H�z@�x�JH�HH9����H�z@�x�JH�H	H9����H	�z	@�x	�J	H�H
H9�vo�H
�z
@�x
�J
H�HH9�vW�H�z@�x�JH�HH9�v?�H�z@�x�JH�H
H9�v'�H
�z
@�x
�J
H�HH9�v�H�r@�p�JH������L��H��H��N�1H��p���H�L��L��h���H��H��X���A��L��h���H��X�����������L�QL9�L�RN�*@��L9�L�J��@���	I�E�H��@��M9���@����	M9ȾIC�1�H��H����o�oH��H9�u�H��H���H�:H�H9����0�9@�8@�1H�pI9��u�p�y@�x@�qH�pI9��X�p�y@�x@�qH�pI9��;�p�y@�x@�qH�pI9���p�y@�x@�qH�pI9���p�y@�x@�qH�pI9����p�y@�x@�qH�pI9����p�y@�x@�qH�pI9����p�y@�x@�qH�p	I9����p	�y	@�x	@�q	H�p
I9�vt�p
�y
@�x
@�q
H�pI9�v[�p�y@�x@�qH�pI9�vB�p�y@�x@�qH�p
I9�v)�p
�y
@�x
@�q
H�pI9�v�p�y@�x@�qH��H������H��L��X���L��h���L��p���A��H�����������L��p���L��h���L��X���H������I�NH�H9�@��L9���@��+I�@�H)�H��@��M9���@���
L�ǸH)�M9�HB�1�H��H����o�o$$H��H9�u�I��I���J�
J�4L9����8D�D�@�>H�xI9����xD�ND�H@�~H�xI9��e�xD�ND�H@�~H�xI9��G�xD�ND�H@�~H�xI9��)�xD�ND�H@�~H�xI9���xD�ND�H@�~H�xI9����xD�ND�H@�~H�xI9����xD�ND�H@�~H�xI9����xD�ND�H@�~H�x	I9����x	D�N	D�H	@�~	H�x
I9�vy�x
D�N
D�H
@�~
H�xI9�v_�xD�ND�H@�~H�xI9�vE�xD�ND�H@�~H�x
I9�v+�x
D�N
D�H
@�~
H�xI9�v�xD�FD�@@�~H������H��H������H��p���A��H���������F�H��p�����H������H������L������H�T:I9�I�PK�4)@��I9�I�A��@���I�U�H��@��H9���@����H9ƿIC�1�H��H����Ao�Ao$A$AH��H9�u�I��H������I���L�K�L9�����8D�D�@�:H�xH9��h��xD�BD�@@�zH�xH9��J��xD�BD�@@�zH�xH9��,��xD�BD�@@�zH�xH9����xD�BD�@@�zH�xH9�����xD�BD�@@�zH�xH9�����xD�BD�@@�zH�xH9�����xD�BD�@@�zH�xH9�����xD�BD�@@�zH�x	H9��x��x	D�B	D�@	@�z	H�x
H9��Z��x
D�B
D�@
@�z
H�xH9��<��xD�BD�@@�zH�xH9����xD�BD�@@�zH�x
H9����x
D�B
D�@
@�z
H�xH9�����p�z@�x@�r���H��p����g�L��p����3�L��X����_���H������H��H��p���L9�p���I�NJ�4+@��H;�����H�C��@���I�M�H��@��H9���@���hH9ƹIC�1�H��H����o�oH��H9�u�H��H���H�;H�H9��O�������H��h����c���H������L�P��H������H���8D�	H��H��D�H�@�y�H9�w��)�H������H�������0�:H��H��@�x�@�r�H9�w���H������H���8D�H��H��D�@�@�z�H9�w���H��L���8D�H��H��D�P�@�y�H9�w����H��H���8D�H��H��D�H�@�~�I9�w����H������H�������0�:H��H��@�x�@�r�H9�w�����H����:H��H��@�x��J�H9�w����H������H�������0�:H��H��@�x�@�r�H9�w����H�������0�:H��H��@�x�@�r�H9�w��e�H������H��`����0�9H��H��@�x�@�q�H9�w����H�������A�8H��I��@�x�A�P�H9�w���H���0�9H��H��@�x�@�q�I9�w��#���H������H����:H��H��@�x��J�H9�w����H������H���0�9H��H��@�x�@�q�I9�w�����H�������0�:H��H��@�x�@�r�H9�w�������fDH��=RH���;:s5H��=RHc�H��HH�H��t%��x�R��H�HD��H���H�;���UH��AWAVAUATSH��H�DRL�=��L�#L��H�;H�=��\�L�5U�H�=�L���F�L�-��H�=�L���0�H�5�H�=���H�5��H�=��
�H�5��H�=v�L��H�=k��L��H�=`�ٝL��H�=U�ʝH�5s�H�=F距H�5P�H�=7褝H�5M�H�=(葝L�#H��[A\A]A^A_]�ff.�@UH��ATL�%#�ZSH��I�<$H��t����H��u4I�$H��}H���ZH��H��K�H�ܯZ�1�[A\]�H������H�x�g^H��H�����I�$H���UH���ZH��ATL�%��ZSH�H���ZH�H���ZH�I�$H�a�ZH�H��t��H�h�ZH���RH�8H�_�Z�0��uH���H9t}H��t
H�-�Z���u3���H��AR���t/H���ZH�H��t>[A\]��f.��K���f��i��q%H���ZH�H��u�[A\]�DH��t�H���Z���u���I�4$H��H������I�<$�I��H���a���`���ff.��UH��AVAUATA��S�_H���ZH��toH�;ttL�-��ZL���\��H�x��\L��H�����1��I����8L�5Z�Z�m^1�L�����cH���H�=:�ZL������L������H�;t�31��苹E��u.H��ZH������H�x�^\H��[A\H��A]A^]���[1�A\A]A^]�ff.�f�UH��SH��H�D@R�8��uH�C@RH�
|PRH9��H�p�Z���tH�w�Z;��H�`�Z�3��u:H���R�H��Z�H�ݬZ���t���uH��[]�f.�H���Z���t�H��ZH�5��H90u�H���Z�H���Zu�H��[]�q�H��R�H�x�Z�
�����O���fD�'�#���fDH���Z�H���Z�H���Z�H�
�ZH�H���Z��@H��ZH�H�g�Z�ff.�U�8H���ZH���ZH�H��@�@ H�P(�@0*]�fD���ff.�UH��SH��H�h�ZH�;H��t�H�G(H�����H�;H��u�H��[]�DU�G�H��AWAVA��AUI��ATS��H����wH�>R�8����L�=�ZA���Lc�L��H��I�T�<��<������H��=RD� E��u!H��=RH�5NRH90u���Bf�E1�H��D��[A\A]A^A_]�����#H��Z����YH���Z��I���@���H��[A\A]A^A_]�/����7�2���@L�bM���K���L���s��H�x�XL��H���/��H���5�R���f�H�BH���#H;�zQ�&H�
7�ZL�%8�Z��H�U�A� L�)H�
�<RA�$�9H�
�<R�9��H���ZA�'�A�$�0�������H�U�H�BH;�zQ�����H�թZH����D�VE1����H�BH����H�
H<R�	������!H�Z�ZH�
{�ZE�'�H�A��taA�� �����H�M�DE�����E��H�M��CH��X L�hH�PH�����҉PH���ZA� H��	���fDA��@H�M�E�'�P?A�'�H�Mȅ��*�E����H�1��H�M��$���H�Mȃ��A�����������I���
E���������H�M�A���&9H�M�L�)�}���f.�H�I�ZH�
j�ZE�'�H�A��������C���A��PH�M�E�'�>A�'�H�M��>���fDI���lE��t}��A������8����H��X H�P�L�h���D1�I������fD�����������H�R:R�ߋH�K:R�0����A�'���A���������y�w���@��f4����L;-ywQtwH�0�ZH�
Q�ZE�'�H�A���������fDH����L��[A\A]A^A_]������t
L����L������H�B�D`t����H�B����1�H�U��9H�Uȅ�t	H�B�m���H�r������A����������A������97�����H�M�A������#7H�M�L�)�z����H�q�Z1�H�0���ff.�@UH��SH��H�`�ZH�=y�Z�S�Z������E��5����t&H�b�R�H�ɪZ�H��Z��u~H���Z�8��t~H���Z��?<��������H�
l8R�	���tq9���ץZ��H�i8RH�0�1���H�b�Z���uH���Z�u�90������H��1�[]�@軩H�D�Z��k���f�H�a�Z�0��u3�����H�K�Z����H�4�Z�H���[]�f��
��
�I���� �Z��
uK�9���f���c���DH���Z�����H���[]��9֤Z��H���Z�0�ȅ�����Z���@���Z���u�1���UH��AVAUATS��H��H�p�ZH�0��uH��H;�tQt$H;uQt3�H��[A\A]A^]���D�����tPH������f�Lc��I��I�E�4$M�l$A�$I�D$�{���E�4$M�l$H��[A\A]A^]�DH�}�Lc��t��H�}�H�B�D`t���
��H�}�H�B���UH��ATSH��H����w �����G0L�c���tX��tdI��$�����������H�S(H�
�ZH�H��t�B0H�߉E��B����E�H��[A\]�fDL�������u�@�+���H��Z� ���1�H��[A\]�L�%�ZA�$��tP��@A�$�49A�$$��NjSH�s�!�����s ����1���f�H�A�ZH�H��t��B0H��[A\]�D��PA�$��8A�$$���뮉��3H�u�ZL� ������
������2H�Z�ZL� �������DUD�h�ZH��ATSH�C�ZE��tf���H�*�Z�#�����9����H�
�ZH�H��Z�H��4R�������l�[1�A\]�DH���Z�H�H���rH�
��ZH�H���GH�
��ZL�%1�ZH�H���ZI�<$H��qL�%*�ZI�<$H���=�xDH��3R�8������轍1��V�H��Z�0��ui�D�H�=}tR��H�=DR��H�=�3R��H�i�R���u{H�T�ZH�8t~��
�Z��������;
���fDH�-�R���t�H�<�ZH���ZH�
2�Z�(�+��g���H�I3RH�8�16�5���@�N�{���fDH�!�RH�H��p���fDH�1pQH�H����fDH�ipQH�H��|���fDH�=p贙H��I�$����H���Z���yNI�$�o���UH��SH��H���Z�8�t{�����H�B�RH�H��tH�3�Z�:���R���H���Z���u8�;������t������H��H��RH�H��t���EH��H��[]���̐�51����H����H�D�ZH�q�Z��H�6�Z��GH��Z�~��GH���ZH�H�GH���Z��GH�؞ZH���ZG ��G0H���Z��G4H��1RH�H�G8H�ĞZH�H�G@H�V1RH���Z��~�GHH�C1R��GLH�c�Z��GPH�w�ZH�5�ZGX��GhH���ZH�H�GpH���R��GxH���R��G|1�ø�����DH���	�H�2�Z��WH�*�Z��WH��Z�H�GH���ZH��ZH��WH���Z�H�W H� �ZH�H�W(H���ZH��W0H�՝Z��W4H���Z�H�W8H�d0RH�H�W@H���ZH��WHH�90R��WLH�10R��WPH�Q�Z�H�WXH�l�ZH�H�W`H�V�ZH��WhH��Z�H�WpH���ZH��WxH���R�H�v�R�W|�1�ø������UHc@�Z�JH��AVAUL�-�ZATI��SH��5$�ZI�E9�}P�L�4��bKHc�ZI�I�MH��H�у���ZL�!I�MH�4�H�^H�D�[A\A]A^]���@H�lj5��ZHc�H���(KHc��ZI�E�ff.�UH��ATD�%��ZSE��uBH��QH�=��H�3H��A������H�{�H��u�H�0�Z�B�ZD� [A\]�fDUH��AWAVAUATSH�����L�=�ZI�H�H��thA�E1�E1�1��1�H�I�T$I�DH��I�DI�H�H��t0I��E9��A��L��Ic�H���/JI��I�H��E1�E1�H�
�L��L������H��L��[A\A]A^A_]ÐU�H����IH��H����H��H�B�H9�u�]�f.�UH��SH��H�����1�D��H�LH�LH��H��u�H��[]�UH���w���H�
�H��H���f�H�
H��H9�u�H��H���H��H���H���H��f.�H�
H��H9�u�]�f�H��tNUH��ATL��SH�_��<uH�;����H��L9�t�C�<u�H�;H�����L9�u�[A\]��f.�f�U�H��SH��H�=��ZH���S1H���Z�5
�Z���Z��H�H�h�Z��;H��H�}�Z[]��fD�5~�ZH��te�u_UH��AUATSH��D�g�_H�
\�ZD)�D�kA9�}PH���ZHc�Ic�H��H0� ��H��Ic��D�H��[A\A]]�f.���~H�
�Z�Ð��D��C!����A�T=��)�H��)�Ɖ5ٙZHc��GH��H�˙Z�v���ff.�UH��AWAVAUATSH�����Z��~e���}A��A��1�L�%��Z�@����ZA9�t:��tVE�<$���t�-b�ZE9<$u�D������,��F�ZA9�uǐ��u
�F�Z��u"H��1�[A\A]A^A_]�E��Z���"�F��Z��f.�UH��S��H����Z��t��~
����ʘZH��1�[]Ð�u��ØZ�!�u���f�UH��SH��H�X�ZH���ZH�H�3�Z�@���-�#���a��wH�o�ZH��
H���Z��1�H��[]��/D��������UH��SH��H��ZH�1�ZH�H�ÛZ�@��]-�#���`t5��a��wHH�H�D�Z�����t7H���Z�1�H��[]�f.�H���Z�H���Z�H��1�[]��C�������f�H���Zfv�H�:�Z����)ӖZ)ܖZ)�Z)�Z)��Z)�Z� �����f�H��yR��yR��yR�i��Z�@H��yR�5wyR�myR�8�f.�����t"U��H�=��H���X���]H�������D��UH�ԕZH��AVAUATA��S�0��uH�J(R�yR�H�7(R��xR�H��xR�>�Z�8��it?��auH�[�ZH��t�8uyH�(RH�0�������Z��[A\A]A^]�H�!�ZH��tˀ8t��A�\$�E��tH�=�Z��葡���u��L�-�ZA�M��Q1��@H���ZL�-��Z�A9E|j�A�\$�E��tH�=��Z���9����u��A�E��~��b���H��v$H���ZA�u���tK��1�A�u�%���DA�u��f��+���E�uH��t
H�z�Z���t1A��E�u�m����H�ѓZ�H�8�<�A�E�����a�败E9u�0����A�E�%���ff.�@�ff.�H��ZU�H��t��1��E1�]Ð1��$�41�]�UH���ZH��ATS�����t:A����CH��wR)؅�~D�����[1�A\]�f�1�1��g�[1�A\]�1��Y�[1�A\]�f�UH��Nt��nu蝉1�]�f��N�F�1�]�f�UH��S��H����/t ��?u;�ƚ�߾?�ڈH��1�[]Ð諚�߾/�߈H��1�[]�fD�?H��1�[]�f�H���ZD�H�G�ZE�P�L�����H�5��Z�A9���UH��ATS�Hc�A9�A�A�À� �À�	����t<�BH��0f.��A�A9���A��H���� A�Ā�	��A��tE��uՀ� �À�	���t0�BH�E��t&�A��� �€�	��	�A9���H����u݃���tH�5��Z�A9��L���[1�A\]�1��f�H�Q�ZL���t_f�H�5��Z���~PHc�A�< tV<	tRA�D�< t9<	t5�B�H��fDA�H���� t��	t	�H���y�����u�1�Ã��t�Hc�A�<	t< u��B�H�@�‰��~�A�H���� t�	t��H��ZD�H���ZE�Q�L���tk@H�5��Z�A9�~YHc�A�< t	<	t���A9�~8Hc�A��� t��	u"�AH�����A9�~A�H���� t�	t��u����u�1��fD�� t<��	�A��H���u�+f.�A�H���� t��	t
�H��A9��믃����UH��AWA��AVAUATSH��H��ZD�0H���ZA�v�L� E����H���ZD�+D9����u��}���Ic��u�M�<H�B�AL����A��_��A�� @��A��	��@��tSE9�A�M@��Hc�@��t@�M�A��H�8L��B�Gu)A��_t#A�� @��A��	A��D!�A9�A��H��D��u��� t��	u8E9�~3��A�EIc�D)�H�H�L�
@H��H9�t�A��� t�	t�A��E���	���H��1�[A\A]A^A_]�E9�~݉�A�MD)�Hc�L�Lf.��M�A��H�8L��B�Gu
A��_�_���H��I9�u�A���UH��AWAVA��AUATSH��H��ZL�(E���Bf�L�%m�ZA�$���&Hc�E�|A�L�A�� tA��	t�� �y��	�p�M�����H�U�H�0H���Vf������_��	�I���N��A��_��f������t��A�$����Hc�A�L�� t��	u$�S�Hc҉�A�$��~rA�LH���� t�	t�H�0H��V����_����Hc��%I�tH��qu)@��_t#H��@�� t@��	tD�CA�$��y��E�$A��E������H��1�[A\A]A^A_]�fD���0���f���.���A��_�$��������S�Hc�f.�D�BA�$��x�I�|H�0H���~u�@��_t��f���Hc�A�$A�L�E�|�u���D��xtUH���ZH��ATA��S���tK�����u����Hc�H��DPu��D�����[1�A\]����D�����[1�A\]���9[1�A\]�@������x|H��ZH��ZUH��ATA��S����;~I�����u���Hc�H��DPu��D�����[1�A\]�fD��D�����[1�A\]���8[1�A\]�@�����f�����UH��AWAVAUATSH��H�x�ZL�-m�ZD� A�MA�D$�9���H��Z��L�8�Hc�A�< t<	t��A�MA9��
Hc�A��� t	��	���AH�D�H�A��A�EA9�~yA�H���� t�	tމ}��v���H�Ӌ}�H��QuvA�vHc���_u/�h�M�7L�C�Hu)A��_t#H��A�� tA��	t�N�A��A�uA9��@A�M���t��E9��#���H��1�[A\A]A^A_]�f�A�VHc�f��J�A��A�UA9�~�M�L�H��C�Hu�A��_t�랍A�A�E�A���'���1��f�UH��ATS��xFA��������u���Hc�H��DPu��D���<���1�[A\]�D��D�����[1�A\]��6��������
�遪�H�9RH�RR�58�ZH�1��fDUH��S��H���@�H���޿[]���ff.�UH�@�ZH��ATL�%0�ZS��A�$;}DH���ZHc�H�2��� t.��	t)�T�� t��	t�E����A�$��A�$��*tH��=tS��\t��1��EX[1�A\]�fD�	�NSH�?R�߾��)���[1�A\]�f��*�&S��@�?�S[1�A\]�ff.�@U1�H��S��H���~�H��R�߾�����H��1�[]�UH��AVAUL�-)�ZATA��SH��ZA�E9|$H��RD������[1�A\A]A^]���D�3H��t
H��Z���t
A��D�3�@D���S�D93u�A�E��fDU�H��S��H���[��޿�O���H��1�[]�fDU�H��S��H�����޿���H��1�[]�fDUH��SH���
1�Z��u]��Z�ƒ��at-��CtxH�Q�Z���~�����H��[]�fDH�!�ZH�8H��t��<���f.���H���Z���ZH�H�8H��[]�	�f���f�UH��SH��H���Z���~
��@�H�RH�R)RH�����H�[�Z��@t
@�H��1�[]�f.����
@�H��1�[]�f���0uH��R�8u
H��Z���t
�m�D�鞘ff.�UH��AUA��ATA��SH�������tUH���ZH���Z�3;0|YA�]�E��t�D�����@����u�D���>�H��1�[A\A]]Ð��Ic�H��DPu��@H�لZ��H�8�/���ff.�UH��SH��H��Z���tH��Z;tH��1�[]�fD���3H��v
H���Z���t���3���H�Y�Z�H�8��H���Z98|H���Z���81��fDU�H���R�1�]�ff.�UH��AWI��AVAUA��ATSH��(L�%V�ZH�S�ZH�
4�ZA�$�@���#�A���uH��(�����[A\A]A^A_]����H�=��A���o�H����H��RH�E�H��ZH�
u�ZD��D�5��ZD�;H�A�W�Ic�� H�1HcH�U��H�E�H�0�&��H�
7�ZH�U�D�;H��E�<$�3A9�~A�4$A��H�h�Z�D9��A���A��A��A9��lA��WA��D9�A��D9���A��t	E���YA��c��D9��H��ZA�$D�8H��(1�[A\A]A^A_]��A�FЃ�	��L�5�R�A�6A�H��Z�u��H�yRH�E�蠃��ui�'��Dž�x#H�M�H�H��H�8uH�
X�H9H����$��0��	w:H�5��Z���t	A����PA�H�n�Z��7���t�����}�� ��}��H���U�A�%����@�A��j�#�A��A��!���@H��(1�[A\A]A^A_]���}��U��u���McƋuȋU�H��}�H�
d�ZB�D@�d�����D�ËuȋU�H��}�H�
<�ZB�<�WA���B���fDD9��A9���A��W�����D���D9��L�Ic�A�< t<	u+A��Ic�A��A�$9���A�<H��@�� t�@��	t�E������D9���H�	Ic��< ��<	��A��E�<$���A�&�"����L�Ic�A�< t<	t
A��E�<$���A��c������&�����U��u��E�Ic��uȋU�H�H�
*�Z�Dx�����b��uȋU�H�H�
�Z�<�W�����fDE�<$�(����D9�����D�z����E9��	���A�E���v
A��y�����H�#�ZH��ZD�����ÒD�-܀ZH��(1�[A\A]A^A_]�ff.�UH��S��H�������t]��Z������H�u��D����Å����u�H�=����H���Z�2H��t=H���Z�8�H����[]�fD��Hc�H��DPt��$�d�f�H�Q�Z90~����2�fD�=�Z�=�i����,������ff.��UH��AWAVD��AUATS��H��(D9�����Z����H�߲ZH�ủߋ�E��[���A�Ņ���D�}�H�=��D����L�%��ZH���=A�������A��W����tH�
��Z�E�;~��'Z����H�HZH��t	�8�"H�O�ZA�4$�8� �H�=!ZH��t	�?�H��(D��[A\A]A^A_]�f���Hc�H��DP�
����$��	�����Ic�H�H�u��Dp�>�����H�u�H��<�W���-���fD�{H���ZA�4$�8�D9�����~ZH�R��E1�H�
R�0���:���DH�5a�ZA�$;�������A�$�����=~Z�E�N��������fD蛉�������Hc�H��DP�t����e�����)A��������DUH��AVAUATA��SH��H�˰Z�����D�3tdD��H�u��@���A�ą����u�H�=����L�-�ZH��tZ�UA�u�;��u�D�3H��D��[A\A]A^]�D���Ic�H��DPt��$�L�{����H�1�ZA�E;}���A�E���(A������ff.�����UH��AVAUL�-�ZATA��SA�U��������L�5ͯZA�>H��v
H�ٌZ���t3�;A9EANE1ۉ��A���~A;Et1��[A\A]A^]�fDH�{Z�����H�8�h�A�>�D���#���[A\A]A^]������(������ff.�f�UH��AWAVAUATSH��HL�%�ZdH�%(H�E�1�H���Z�A9$|*1�H�U�dH3%(�1H��H[A\A]A^A_]�fD���y�H��vH�̋Z�����E1��DD����+�����t�H���ZE�,$D;(}�H�
zZIc�H�	���I��9�u����I��H��H��tT�_�H�F�<�E��t]�D����!���A�$D9�}��A�$D����d������j���D���O������H�F�<�E��u�1���j��:���DH�QyZL�}�A�4$H�E�L��H�8螫������)�H�E�I��H�E�H�E��g���E�����H�}�L����E�4$�N���xH��D��1���B���A�$A9�~��A�$H�}�詅�$������*���H��ZIc4$�9�����H��xZ)�L��L��Hc�H0��D�u�D����D�����N�������tD�����E����B���1���F����ff.�@����UH��AVA��AUATL�%x�ZS��E�,$E������~���H��v
H�m�Z���tw���A�<$H��v
H�Q�Z���t3)�A�<$��xD���)�1�[A\A]A^]�fDA�$1���@H��wZ���H�8����A�$�f.���D��薈A�<$������$������ff.�f�UH��AWAVAUI��ATSH��(L�%�wZdH�%(H�E�1�A�$@�
A�$$���� ��H��vH�s�Z�����H���Z��wZH�H��{Z�E�e����������L�m����޿�T�A���޿E��tTL�5�ZH�ުZE�>D;8}>����A�D9�}��A��v��H��v�H�ɇZ���u�L�����f��[��1�H�M�dH3%(u<H��([A\A]A^A_]�fD��H�u���������f��������$�@U�H����H�5�ZH��Z��
9�}<H��uZH�:Hc���� t��	u!��H�@�9�~�H���� t�	t�1�]�ff.������fDU��H��S��H����;tN��,tI��T� ~n��f����tu��uZ��uZ@�vZ��t^�
vZ�5�uZ��5zuZ�
vZ��ڃ�;E�5huZH����H��uZ[]� ���Fu��EuZ�����7uZ�����DH�uZ��u(�H�=�uZ�O�5
uZ����uZ����H�����H�c�ZH���tZ�PH�X�ZH�H��1�[]�@��tZ��tZ�������tZ������tZ����������[t+~9���{t$�������}t1���]���D�����f.����(t�1���)�����f.�UH��AWAVAUATS��H��H�ڧZL�%gsZHcI�$�<I���l�������A��H���ZA����E��A���Q��H��t
H���Z���tD����xXI�$Hc��<����A9��^A9�����A��
��H��t�H�`�Z���u�I�<$1҉��=��S�9�D‰Å�y��H�������[A\A]A^A_]�fDL�=�ZH�5��ZA���;�d�޿�x�H�զZHcI�$�<�q���A�Ņ�t�E���1H���Z�D��L�=��ZA��؉E��N��H��t
H���Z���tE��A9�P���I�$Hc��<����9E�t:D9�����A��	��H��t�H�\�Z���u�I�<$��1ɺ�$����A��u�H��Z�H��1�[A\A]A^A_]�A���`�����@���H��H��ZHc�	���H��Z�
��t/���DH���Z�޿D�(�J�H���ZHcD9�tI�$�<�>���A�Ņ�t�����f�H�}�ZD�0�QH�������[A\A]A^A_]�ff.�f�UH��AWAVAUATA��SH��(��qZdH�%(H�E�1�������qZ�E��]����A���8��L�m��D�޿�D�A���޿E��tTL�5ѤZH�ΤZE�>D;8}>��A�D9�}��A��f��H��v�H���Z���u�L���}�f��K�1��t�H�M�dH3%(����H��([A\A]A^A_]�L�-QpZA�E�uN��@A�E�A�e�������H��v H�9�Z���u��H�u���s�Ð��pZ���D��	H��~ZH�H��~ZH�3���H��W���������J������f�UH��S��H���WpZ��u1���S@�Ǎ|�c�H���߾c[]�g��H�apZ�OpZH��t
H�RH�1��UH������H�
=��H�.pZH��H���H�
H��H9�u�H�}�H�
6��H���H��H���H���H���H��R���uH�=L�H9��tH�lRH�1�]�H�����ff.��UH��ATSH��nZ�A��A��t4H�-}ZH�5���E1�H�H�}ZH�0D��[A\]�f.���@���#���a��wH�8�ZH��
H�ynZ��D��[A\]��A�����믐UH��ATSH�
nZ�A��A��t4H��|ZH�
���E1�H�H��|ZH�D��[A\]�f.���@���#���`t.��a��w@H�H��mZ�����t/H���Z�D��[A\]�@H�i�Z�H�t�Z�D��[A\]��AA������f��=JoZ���2U�5?oZH��ATS����H�mZH�8���A��H�̢Z�����H��lZH��nZH�8����f��k���8���H�ھD���|����x�H��lZ��nZ��nZ� ���ud[A\]�DH�=)oZ����H�=�nZ�����H�=oZ���H��nZH�5�nZ1������\nZ�&����NnZ��t�1�H�5MnZ����[A\�*nZ]�@1����
���@�ff.�@UH��kZH�8H���]������Q�1�]�ff.�f�UH��kZH�8H���-��1����$�1�]�UH��AVAUL�m�ATI��SH��`dH�%(H�E�1�H�|kZH�8����L��T��1������������L�u��I��L�����E�������E�u��E��u��U��M���tH��L�8uH�=��H�x@@��tH��L�>uH���H�F��tH��L�9uH��H�A��tH��I�A�<$uH�X�I�D$H�E�dH3%(u8H��`[A\A]A^]��A�}�6�����L��T���!�������W���1����f�H�QjZ�����(lZ��tH��H��8uH�N�H�P�lZ��tH��H��8uH�,�H�P��kZ��tH��H��8uH�
�H�P��kZ��tH��Hǀ?uH��H�G�UH��AWAVAUATSH��hD��kZdH�%(H�E�1�E����D�}kZA��E���MH�^iZH��x���H�8����H�ھTA�ĉ�1��������k���L�m��H��L��D����������E�u�H�E�L�5��QfoE�foM�H��jZ�E�foU�)�jZ��jZA�)
�jZ)�jZ���~�
�jZ�}jZL�5�hZ�
�jZ�
ujZ��jZ�
�jZ�
TjZA��
wjZ�
LjZ�
kjZ�
4jZ�
_jZ�
0jZ�
SjZ�
jZf�
FjZ�
jZ�
;jZ�
jZf�
/jZ�
�iZ�
$jZ�
�iZ�
jZ����L���Q�u��M��}�E��E�E���O@��tH��H5�7Q�>���tH��H
�7Q�9����tH��H�7Q�8��@��t!H�j�QH��H��8��f.��6iZH�
[gZ����E������t	H�5�Q��u��U���0��0tE��t��ρ�����U��ʃ�f�u��U���t%�����E��E���;�W�L��D�������x�H���Z�����H��fZH�8�]���
�hZA���hZ��t1�H�5�hZ������hZH�E�dH3%(��H��h[A\A]A^A_]�fD����<�����t��_u�H�<fZ��@H��QD�E���}H�=��Q����A��[����H�=�hZ�t��H�=hZ�h���H�=�hZ���H�hZH�5yhZ1��R����gZ�f���H�ھTD���p�����H�a�QH�8�Y���A������H�I�QL�@��tH��I�0�:����t
H��I��:t_��tH��L��8t?@��tH��Lǀ?uH���H�G�gZ��������E����H�Y�H�P�H�
��H�J�H�
��H�H�p���H�
)�H�H�:���H�5��H�q����L�I�L�F���H�59�H�r�0�����fZ���
����������UH��AWAVAUATSH��D�%�eZE��tE1�H��D��[A\A]A^A_]�fDL�-IdZH��eZI�}���A��H��D���3��������eZu�foH��eZL�5@eZfo
�eZfo�eZH�YeZI�}��eZ)eZ)
!eZ)*eZ�<eZ�%	eZ��%�dZ�����.��A���f��+���8H��uS�L��D���=����x���dZ�
���f.������8�$���A���������I�}L�%�dZ���A���	�L��D��������������;t���dZ��u�DUH��bZH��ATSH�8H�XdZ�S��A���fD�S���8u.�H�ھD���h����x���cZ[1�A\]�[�����A\]�fDUH��AVAUI��ATI��S�j��H�x��L�5�eZL��H��I�H�{�����M��t
I��A�EH��[A\A]A^]��UH��SH��H�(bZ��t�Vf.����@�S��#��ƒ�߃� tv��Ytq��Nt\��tW��u��������
t_��
tZ��Qt9��@���#��ƒ�߃� t/��Yt*��Nt��t��u�����@1�H��[]��H���[]ø��ff.�f�UH��AUATA��SH��dH�%(H�E�1���tLH�7�ZHc��t<H�
5dZD�	E���IH�
�`ZH�	�D�9�t�UԸ���f�1Ҹ���t`Hc�@�tԉډ�H��cZHc��D��0��uoH���ZH���Z�9����H�]�dH3%(��H�Ĩ[A\A]]�@H�
�cZD�E��u�H�
�CR�	��t�Hc҈Lԉډ����]E��L��@����I��L��H��t
H�R�Z���tl�����u��X���%�=@ti=���H���ZH��Z�9��L������2���f���1����������뒐H�}��'l���f�H�1CR���t�H�$_ZH���ZH�2Hc���to��uk�|�/t�H�=�1��k�u���H�}���k�d���f.�L��L��������*�����X���%�=@�����'���D��/����������UH��AWAVAUATSH��L�%�bZ���H��M��tL�����H��bZH�=�bZH��t�T��H�=}bZH��t�C��H�=dbZH��t�2��H���j��H�x��H��H���&���;H�<bZ��H���>��H�x��H��H������/H��H��H�bZ���I��H����H�=�aZH�p����A�D$H��aZH������H�x�iH��H�����H�=�aZH��aZ�?~�H�@aZH�H��t	H�=�aZ��H�0aZH�H��tH�=�aZ�Ѕ���H���ZD�E��t7H��`ZH�H��t(H���ZH�=;aZ�2��H�=0aZH�����H�!aZH�=*aZ����H�aZI��H�aZH��tO�;tJH�?�Z�8��t=H�.`ZH�H��t.H��ZH�ߋ2��H�=�`ZH�����H��`ZL�%�`ZH�������`ZH��_Z�M���GL�����H��H���D�-i`ZD�cE����H�@R�0����A��.��L�cL���T��I��H�B`ZH�����8.��H��_ZH�=`Z���t	�?~������xH��Hc�L��
L�5�_ZH��I��L�����Hc�A�|>�/tA�D=/�{Hc�L�L�����H��L��[A\A]A^A_]�@A��.�#�{tf�{.�=���L�%�_ZM���-���L�����H��H�����H�=r_ZH��t�X��H�]_ZH�=N_ZH��t���H�9_ZH�=*_ZH��t����H�_ZL�-_ZM���G���L��E1�����H��^Z�,���f.�H��ZL�=�^Z�E�7����A��A��9��E��A��D9���D9��
���L�cL�����I��A9������Ic�L��L���$�����+���L�%u^ZM�����������I�~��H��L��[H��A\A]A^A_]���fDE8������L�cL���#��I��A9��z���Ic�L��L���i���������L�%�]ZM���d������@�U����I�΋U�H��DH�������E���U�H�F�$������U��X��I�̋U�H��DH�������E��H�B�����fD�H�3)�-�����x�����������.H�>]Z�@�L���H���5���xH��Hc�L��H�5]ZH��I������H�]ZHc��|8�/�$���A�D=/�{Hc�L������H�=�\Z���H��\ZH������H�x�RH��H�����H��\Z�r����VH�=�\ZH���W��H��\Z����L�c1�H��L���H��H��L�p�����ff.�f�UH��H��SH���H��`���H��������tb��x����/�����@tK�%�� t>�#��`t1�@���t$�=���t�|��t
���t1�H�Ę[]�f.��H�������uٸ*���UH��AWAVAUATSH��H��@�����L���H��P���dH�%(H�U�1҃��!���E���L�w��M��H�D�H��X���H�b�ZH��`���H�E�H��x���H�E�H��p���H�E�H��h���f��۽��H��vH�.hZD�E����H��`����I�ED�0���YE��E����I�EE1�D� H�E�H�E�H�E�H�E�E��u7��E9�����I�ELc�F�<0E��tsI�EF�$0E��te�@���H��v�H��gZD�E��u�H�E�I�MA�؉�L�M�H�U�I�}H�E��y���t%I�}H��h���L����ڃ��\�N��z�����E�9�N�I���]�L9�X���������`H��P����RH��P����8���E�E1���JH��@���H�H��`����:����H��XZH�E��0��t2H��XZH�H��t#H���Z�
��tH��8R����CDH��@���Hc�L����H�
��H�xH������H��P����&���;E�������A�L�u�Lc�L��@���M���@I��D9�L�����K��H��P���L��H���1�����u�H��@���L�u�H��H�8L��蔾��D9�L����MH�}�H��t�Y��H��@���H�B�0�DH�E�1�E1�H�E�H�E�H�E��cf�E���G���I�EF�4 A��D9�tuE���,�������H��vH�ZeZD�E����E9�������I�ELc�F�4 E��A��D9�u����I��H��Dpt�����A��H�D�<��q����D�u��w���H�}�H��Dx�o����ߺ���u�H�D�4��Z����M�uM�L��艼��H�M�H��x���L��H���3��MeL��I���d���H�M�H��p���L��H������}�����}�A�ĉE��ؿ���E�A9�������A��B�\3�N�����f�H�E�H�E��	���H��H����H�x�wH��@���H��H��H�袿��H�U�dH3%(��L�����H�Ę[A\A]A^A_]�H��@���H��H�rL���q�����Lcu�A�~Hc����H��@���H��P���L��H�8�C������L�u�H��@���L��H�pH�8�$������H�`�ZA�������E���H��`����[���H�C�ZH��P����2��H��P���H�E������UH��AWAVAUATSH��8L�7M���KH�d5R�u�H�}������H��TZH�H�����E����}I�~�B�D��H��I�|�u�L����M�.M����I�NI�F�H��u	�5D��H���VH�x�u�9�}���)L��L�����L�����H�E�L�0�H��8[A\A]A^A_]�DI�H��t.1�fDHc�H��I�<�u�H�
;�I�~��m��I�H���¹��H�x�I�H��H���~���I�vH�E�H����M��1�L�m�@M�'L���%�����tqI��I�w��H��u�{Hc�H����I��I�FH���I�V��@H��I�4L9�t?H��H���I�tH�B�H��t4Hc���f�L��I���ľ��M�o�I�wH���c���뀐H��H�B�H��u�H�I�>L9�t菾��H�E�I���tL��M���x������I�_H��H���A�����u�H���U���I�G��H��81�[A\A]A^A_]��L���(���H�E�H�1��B���fD�����fDI�GI�>L9�t���H�E�I��\�����L�m����I�I�F����f.�UH��ATSH��H��H����H�*RZH�8H��t|H�RZ���toH�J2R���tbA���2@��uEH��QZH�U�H�0H��tDH������H��t7H�.2RH�H��t(H�U�H��D��H��[A\]��f�H�U��׶��H�U�H��u�H��H��[A\]�f�UH��AWAVL�u�AUI��ATE1�SL��H���H������dH�%(H�E�1�����H�E�I�DH�����H��0���H�����f������<�U<�H�����H�����L��H��H)��i���H�����H��tO��0���H��������H�����A�Dž��DH�H�lMZH�߾E�H��9��H�����v���H��PZ�0��u.H�M�dH3%(D����H���[A\A]A^A_]�fDL�5�PZH��0RA�t�H������I9���A�M�A�E������H��t����3H�.H������H�������JH�BPZH��(���H�H��tH��(�����H��(���H��胵��L��I���x���A�|Hc��H��(���H��H���)���H��(���Icǀ|�/��H��/�/H�|L�����A����2�H��0���H�����H�߅�u��H���%�=@��謺�������H��(���A�E�蕺�����I�A���F���f�L�=�KZ�^A��H��I�7�D���I�7�?�7���I����L�=qKZ�^I�7����I�D�;A��@H�����A��A��9�t&H�����A��H�����I��F���fD������Ÿ��I�ϋ����H��DHt����A��H��<��H����H��A��蝹�������A�E�H��(���膹��E������DH��JZD��A��H�0�R����_���D</����H�������@����</�����H�������x���������A��Ic�H��������������H��(���A�/A�E��޸���a���f�L���hGA�H��(�����uB�H��0���H���ֺ��H��(�����u��H���%�=@t<脸������H���P�A�������H�H�����������H���A�/�����x����H����UH��AVAUATA��SH��H��H��LZD�)H�8H��tH�xLZ�0��tH��,R������E���ZE���QH��HZIc�I��H��D�D��D8��0A8�lA8�tA8�u1�E8.��A)��H��|ZD��L�������WL9�� H��L��[A\A]A^]�T���@A��E����A��H�M����H���N���H��KZH�M�H�0H���7���H��H�M�諼��H���"���H��+RH�H������H�M�D��H��H���I��H����H�M��E��t����D8��/���E���&���H��GZIc�H��D�����H�KZH�0H���f���H��{ZD��H�ߋH��[A\��A]A^]��Vf.���H��[A\A]A^]�A�����H�
GZIc�H�	�D�8��q����c���H�YGZH98t4H��JZ�!���uH��JZ�@����	E��f��
"KZ�?��u��UH��AWAVAUATSH��8H��zZH�}�H�u�D� H�6JZH�H������H�E�H����H�JZH�8��E�����E�1�E1�E1�L�53FZE����I�Ic����'����\�����H��IZ��U�H�8�Ʈ��H��t1H�
NzZ�U�A�G���'����"���M�����۬��H��vH�.WZD�E����A��E9��]�������H�
�yZD�)E9�u����I�Ic�H������H��HZH�H�����u̅��g�U�D��H��Ѕ��t�U�H�}�������U�H���ZH�)RE1�H�8H��t$�։U��έ���U�H��tH�SyZD+ A��DM�H�uHZH�8H��t��螭��D��H��uH�#yZD��f�H�E�H��t�}̉8H�E�H��t�H��8��[A\A]A^A_]�fDH�1HZH�H�E�H�HZH�8����H��xZD�(E9��~H�?DZ1��E�H�Ic�H����E1��h����8��X���H�uxZ1�D� �G����I�>D��1ɺ�NxA���H���fD�M��"����f��E�L�5�CZ�ݪ��I�H��H�xZ�0v#H�$UZ�8��uH��1��zI�A���@D�n�H��wZD�(Ic�H�E����H�}�H�M��։U��&���H��t�H��FZ�U�H�H����D�E�E����H�M�D��H��Ѕ��X���H�wwZI�1�HcI��H�����M�A��1�����M��'�"���f�H�}��։U�被���U����f.�1��	���f�H�}��։U��r���H��t݋U��{���D�1��E�L�5sBZ���1ۅ��R������1���UH��AWAVAUATS�ZH��XH�%xZH�}��uȋ�]��u��ș���Ẽ�t'�ډ��Ѝ@�9�EƉE̅��A�E��E��E�H��%RD�E�����
�H�_wZD�E���H�E�L�hM����I��H�LEZE1��D�}�H�E�@H�E�A��L����t`�/���L��H��tN�8tI�xH�xu?H�x��P�L9�v"��/u
���/t#H��H�G��W�L9�u�L��/��L��@L���@�I�|���tH�}��<D��}̅��-�(�H��$R�Eȋ����tH��vZ���9����E�H��M�,�M���%���H��X[A\A]A^A_]���HcE����\D�E�H�E�H���E�E��H�E��E�H��H�E��E��U�9U����}���H�E�H�U�L�$M����H��CZ�]�E1�]�H�E�H�E�Hc�HE�H�E�DH�E�L��0��tc�/�Q���L��H��tQ�8tL�xH�xuBH�x��P�L9�v%��/u���/t#H��H�G��W�L9�u�L��/�L��@L��A����D;u�|f��H�
�#R�E��9����tH�kuZ���9��U�9U���f��E��U�H�E�H�m�;U��E�����H��X[A\A]A^A_]�D�e�A)�E��~+L�-}?ZE1�f.�I�u� A������E9�u�9]��Z���H]�H�E�HE�L�$�M��������<���f�D�e�A)�E����L�-?ZE1�fDI�u� A��讴��E9�u�����H��>Z��H�=�H�贴��H�;�l����������[����������DE����H�����L�-�>Z��H�=��I�M�Y���I�}������F��A���E�������A���DEȉE�����H�E�HcuȺH�
��H�x�ó���������EȍD�����E����H���z���H���q���H�����UH��AWAVAUATSH��H��HH�}�dH�%(H�E�1�H�bBZ�8�{kH�[H����H�E��E�A�L�u�H�E�DH��@Z���tc�/H���f���H��tQ�8tL�x�ZH�P��H�H9�v)��/u����/��H��H�B��J�H9�u�H�ڀ�/�aH��E1�E1�����I����E�DIc�Hހ>t]�<��<���U�H�}�L��D)�Hc�药��H�����H��t&�}�A������Ic���H�H�Aŀ>u��E�D��D9�DM�H�E�I��J�\�D�m�H�����H�@Z�^�H�H��tgD���H�}���H�E�dH3%(��H��H[A\A]A^A_]�f�A��A��I�����@A��A������H�X�����H��R�9�|��7�U�H�}����)�����fH��@Z��n���H��fDH������{�L�%�;Z��1�H�і�I�<$�ۮ��I�<$�"���L�%�;Z�f��[�A�$@��A�$$��ƒ�߃� �g�����Y�^�����N��������u��)���H�E�H�H�R>Z���td�/H�����H��tR�8tM�xuH�P��H�H9�s*��/u����/tH��H�B��J�H9�u�H�ڀ�/uH��H��@�s�H�E�H��H�0�T��_��eH�C?Z��$���H�����H�X���5��`eH�?Z����H����D���@H��t;UH��ATI��SH�?H��tI�\$@�ۨ��H��H�{�H��u�[L��A\]�¨��f��ff.�@UH��AWI��AVAUA�
ATA�S1�H��H�}ȿX�P�I��H�@�K�&I��K�&��H�}�A��H��H��t/��D9�u׍sL��H�U�D�k
Hc�H����H�U�I���@��tD��t'H�Uȉ�L����H��L��[A\A]A^A_]��I�FI�FI����L��E1��ͧ����ff.�UH��AVAUATS��H��H��8ZH�
��H9�H�=�<ZH��t臧��H�=�<ZH��t�v���H�CRL�%�;Z�j<Z�\<Z�H��;ZH�L<Z�%H��;ZA�$�H�~;Z�H��;Z�H�|mZ�H��;ZL�(M���WL�5<lZ�E�1���;ZA�>��;Z�=�;Z����A�6�=�;Z���}��
�;ZI��H��;ZH�mZ��;Z�5�;Z�8H��lZ�H�.;ZH�H���,L����H�;ZH���
�H�X;ZH���A�4$H�=D;Z�����H�
0;Z��;ZH�9�����H��H�|�u�5�:Z�5�:Z���f���:Z�x�����:Z��u	����Hc‹5�:Z�H�<�H�
�:Z�m�Hc�:ZH��:ZH�=�:ZH��H���\����q:Z�5o:ZH�߉��U����:ZH��1�[A\A]A^]�@�
�����L��L�����H�<:ZH������K�H�=$:ZH��t�
���H�=:ZH�:ZH��t���H��9Z1��/:ZH��[A\A]A^]�f.�H�}�H�5�9Z���A�>�5�9Z��9Z����@L�-������@H�
�9ZH���������H�=|9ZH��t�b���H�g9Z1���9ZH��[A\A]A^]�fD�c��5%9Z�H�=99ZH�
9Z������UH��AWAVAUATS��H��8H�v8ZL�-G5Z�H��RA�M@�H�}8Z�8H�$8Z�H�8Z�H��8Z�H�jZ�H��4ZL� M��tL���ȝ��H�x�O�L��H��脡��I��H�*8ZH�H�E�H���rH��hZ�E�E1��E���E����$H��hZ��D���U�����u��M�I��H��iZ�0H�tiZ�H��7ZH�H�����U�D��L����H��7ZH�����H�E��E�H��tH�0L��蓤���������E�L��蠢��H�}��uH�7ZH�}ȋ0���A�ƅ�����*������?uTH�}����H�}��R���M��t(H�.3ZL��H�8����L��������7Z�%���A�e����E1��L���@teH��Q�پH���H�81��|�����M��tL���ڡ��A�e����A�H��8D��[A\A]A^A_]�f.���	t��!u�H�}�L�H�GA�8t"1�H��L��D����H�M����K�H�}�H�GH������!������@��H�E�Q������r�H�}����f��
���R���H�u�L���j����G���DH�u�H�}ĉU��@��U��E�H�GfZD�8���H�A��H�E��~����H�]����E���t	E����H�fZD���0��?H��eZH�{D�8H���H��L�}�fDL������H��I���8>H�=�4�,>L;3t'L��H���K���H�;H��u�莻H�}�����DH��H�;H��u���f��K�M��tL�������\5ZE1�A�e�����(���@��M��tL���ޟ���,5ZA�e��������H�
�0ZIc�H�	:D���A������U����>����0���H�?�U��M��u��n��H�}�����DH�;H�U����H��I���$=H�=�3�=L;3�����L���7������f�H��eZD�E��uiH�j0ZH���H9t>H��3Z���uQH��3Z���t�@����f.��	����fD�
"4Z��u��?���@�cK�!���fD�?���fD�*�v���fD��utUH��SH��H��H�=�3ZH��t�_������~��3Z@��@��@��H��3ZH���v���H�x��H��H���2���H�k3Z�6���H��1�[]�D1��DUH��AWAVAUI��ATSH���'���H�<�H)�H����A�]H��I�Ą�uL���\MA�D$-M�|$$fA�4$M�t$�Ã�uGA�\M�f�eI��A�A�]��tL�ÍP���v���tX�������M�t$M��\t��"uTI��A�\M�fA�A�]��u�A�$H��H��[A\A]A^A_]�DM�t$A�$\�eI���p����M��M���]���D�\CH�Mȃ�@M�|$fA�$A�D$-诛��H��H�M�L�0A�V��tzH�M�H�U��͔��H�U�H�M�H��4�@��9���H�M�M�t$H�U�衔��H�U�H�M�H�������fD�\CM�t$A�D$-�?fA�$I�����DH�U��t'H�M�莔��H�U�H�M�H�H���M�t$�f���f�M�t$�����Hc�A�D^�a���H�M��K���H��H�M�H��f.�UH��AWAVAUATS���H���s�I�ă�t{��������L�hI�ƹ��A���C���wP��A�\����A�E2�X0M�,4��0A�<A�]A�H��L��[A\A]A^A_]�fD�\e�@f���f���"����\uR��A�\Hc��f��ڸ\C��@A�D$-��@fA�$M�t$M�l$L��A9�t5A�1����\t���u�M��L���c���@�\C-?�@�Y�����U��x����U�H�B�yH�M���tK螒��H�]�H�M�H������ty脒��H������A���������t�U�苒��L�8H�E�H��A�뻈U����U�H�B�Dx�)���H����H�M�����H�M�H�Hc��DA�h����,���L�8���H���H����UH�m�H��H��AWI��AVAUATL�fSH��8H�҉}�HE�H�E�1�H�M��D<ug��1����I�<$I��1��E���L�M�M��H�M�H��I��H��LEȋE̅�uH��H�T*Z�H�81�蕝��L�����L�������I������A�D$�<�t���M����L������Hc�H�J������1�H�U�H�M����H��I���ג��H�M�H�<�Z�L��H��I��茖��H�U�L��I�<�|���L���d���I�4$�}�L��1���I�����L���D������V���H��8[A\A]A^A_]�f���t[��1��R���I���D��H�M�Hc�H�U����L��H��I�����H�U�H�M�I�H���\A�eA��a���D�����I������dH��t�?uH�jR�1��DU�
1�H���`������H�H�?R�1�]�f��H��t�?u�UH��ATL�%�\ZSH��I�<$H��t�!���H���Y���H�x���H��H������I�$1�[A\]�f.�UH��SH��H��t�?uH���Q�1�H��[]��H�5�$H��豕����t]H�5�bH��螕����tJH�5��H��苕����t�H�5@H���x�����t�H�5l�H���e�����u'H�:�Q��f�H�)�Q�H��1�[]ø�b���UH��AWAVAUATI��SH��Hc�+Z�
�+ZH��+Z�r9�|.H������H��Hc�
y+Z���Hcq+ZH�n+Z�rH��&Z�5Z+Z��D�+E����A�$��t:<	��< ��I�D$�H���� ����	���H����u�L�=i&ZM�7M��t�H�5\�L���-��������H�5F�L��������u=I��H�55�L�����������H���Q9�H��1�[A\A]A^A_]�H�	
RL��H�0�ޓ�������L��@L�=�%Z�M�7M���Y����p���DL�����H�x�o�L��H��褒���-H��I���D���H��t�I��L��L���m�����tI�7L���^�����A��L��D�+�M����G������)Z���Hc�)ZH��)Z�r�C���fDH�5�L������1҅�H��Q���9�����U�H�5��H��SH��H��裔����tO�H�5ƀH��苔����tH���[]�H���QH�
*�QH�
H�t�Q�H��[]�H�i�QH�
��QH�
H�L�Q�H��[]�ff.���(Z��t&��H��(Z��(ZH��H��#Z�1��@H���PUH�8��(ZH��u(H�
�H�:��1��n���1�]�f.�D�i(ZH�
j(Z1�L�
�H����8���1�]�@�.(Z��t6~"H�%(Z�8t#��H��	H���8tH9�u�H�;#Z�8�1��f�H���PUH�8�(ZH��u(H�
�H���1�辖��1�]�f.�D��'ZH�
�'Z1�L�
ɂH�7�舖��1�]�@����xiH��QD�G�H�
A��w6L���QE�E��t'���u=$H�H��H���H�p1��DHc�H���9H�H�XZH�t8H�1��UH��ATI��SH��t���w���H��L��茅��[1�A\]�DUH��ATSH�B�QL�#H��G���L�#[A\]�ff.�@1��)���f�H��1����fDH�VH��1��
�H��H9�t �z�u�H9:u�H�H���H9�u��fDUH��AWI��AVAUATSH��(�����I����E1�E1�L�
��L��}I�����A��A��������A�UIc�Hc�L�I�4>��\u�������fA�T$��Ct��MuA�|>-t�q�@��H�"@��Ic4�L��D�L���������ul�A�]Hc�L��3@�Ɖ�9��~��Hc�A��A��;tA��Ic�A������K���@Ic�L��L�D�"1��H��([A\A]A^A_]Ã�M��A�EH�E�$�A��?tA��A��9��sD���A���A��Ic�A�����DA���A��Ic�A����f�A���A��Ic�A����f�A���A��Ic�A��u���f�A���\A��Ic�A��U���f�A�}��0Hc�L��1D�^�A����A�}�D��Hc�L��1D�^�A���bA���D��Ic�L�A���	���A���
A��Ic�A�����f�A���
A��Ic�A����f�A���A��Ic�A����f�A���A��Ic�A��u���f�A���A��Ic�A��U���f�A���	A��Ic�A��5���f�L�E�E�e�U��M��}����M̋U�L�
�~H�8Ic�L��zL�E�L�D�B�D_L���?A��E�[��H�A��woA�uHc�L�D� B�Dg�A��A�D$����~�<wWA���Ic�L�A�������A���A��Ic�A��v���f.�L���1�����A�HЃ�7@��B��|���A�D$��~Ѓ�7<B�뗐H�
��QA�E�	��tH�
��QH�	����PH�A�|\��A�EH�A��Ȁ�����L�E��U�@�u��@���H�űU�L�
I}H�L��yL�E�H��Dp�G����P����M̋U�L�
}H�L�fyL�E���������H��E1��G���L�E��U��Ҋ��I�̋U�L�E�H�L�
�|L�$y�DH�Z�������U�L�
�|L�yH�L�E�B�����7���A�|C����A�|-����A�EH�E�$�����A��?tA��A��9�tOA��D��ȀA���A��Ic�A�����A���A��Ic�A����A�����E������A�����L�E��U����I�̋U�L�E�H�L�
�{L�?x�DHt������U�L�
�{L�"xH�L�E�B�����Ȁ�`���ff.�UH��AWAVAUATSH��H�}�H�U�H�����>H����H��H�M�规��H�|�-�H�U�H��H��H�E�����E������}�H�M����L�e�E1�E1�1�L�=�PZ�eA��D�U����L�s���D�U��}�H�CH��D��M��t!����L;5��Pt��L��E1�I�I��A9���A�$D�S�A��w'L�|�QA���t�����u
H���fDHc�A��H��H�D�A9��M���A��tA��uH�KH���U�H�u�I����}�H�sI�A9��w���H�}��$����E�H��H[A\A]A^A_]�f�H�KM������I�I���A����<�"����
���H�{H�M��E��Ј���E�H�M��u����}��E�����u�H�}�譈���H�}�袈���E������r���fDH���QH��H��1�H�����f�H��H��H��1����H��H��H��1����UH��AVI��AUI��H��ATSH��H���p���H�|��H�U�H��H��I���T�����u(L��L��L�����[���H����[A\A]A^]�@L������ۇ����f�H���7UH��AUATSH��H����H�x�y�H��H��讅��H�_ZI��H�;H��t臇��A�u@��"��@��'���E�A�E< ��<	��D��I�E��f��H��H���U��P��� t��	u�M���L���W���H�|���H�U�L��H��H��;���HcE�H�L������H��1�[A\A]]��E�A�EM�e@8�tS��tOD��I�E���	@@8�t��H��H���U��P���u��o������f.�M��L���S���DL���F����U�G�H��AUATSH�������\M��Z-@��f�
�Z��t3����A���\t	��"�cH�
�ZB�\�"D�e��jZ\�H�
[Z@�4H�PZ�H��[A\A]]Ð������z��@�ǀ��A���\C��@�Z-A��@f�	ZA��9��M����}��e����}�L�(A�D]����������}��H�A��H���<�������tC����E1�������e���Z\�H�
{Z����fD�\C�?�aZ-�f�SZH�
LZ����f��1�H�
2Z����DHc�H�
ZIc����fD�|��E��H�B�����t:�|��H�B�<��9����}��Q����}�H��DX� ���E����f.��k|��H�Jc�A�DEt��|��H��O|��H�B��H������ff.�UH��AUI��ATSH����x��H�DJZH�L�#M��t9H���H��L�c�M��t#I�<$L��跂����u�I�D$H��[A\A]]�H��1�[A\A]]�UH��SH��H������H��tH��H��H��[]�i�f�H��1�[]��H����H���������H��QH�����uz�����H�vH��H��H��D�A��t�1���uVH��tD�H�F�f����<ueH�������H��H��D�A��u���t0H�vH����y���1���H���QH�0�B���f�H��t��H�F�H��t�H���ÐH��tkUH��AUI��ATI��1�SL��H��H�����H��H����H;��P���uH;��P�tH��[A\A]]�H��L��L��H��[A\A]]���1��ff.�f�UH��H��@�}�H�}��E��g�����DUH��H��H���Q@�}�H�}�H��E��=�����ff.�H���QH��!����UH��AWAVI��AUI��H�5�nATE1�SH�T�PH���fDH��H�s�A��H��tgL���7���A�Dž�u�Mc�H��PK�dL�t�M��tA�U�҈U���A�K�dE�>H��@��H��1�[A\A]A^A_]�@L�%�AP1�H�5CnM���I��I�7��H��t�L�������u�Hc�H�[I�D�H��t�H��L��[A\A]A^A_]��H�59�L���q�����a����Uπ�1�Z���E1�A�}A���I���H�H�5�mH���6����t3H�5�mH���#�����.�����QH��Q��t�����H�(�Q�8�K�������UH��AWAVAUATSH��H��(H��u�f�H����< t�<	t���<#��<$��H�\Z�:��<"��I��1�1�������tZ�� ����:���VHc҃�	u-�f���:���� �{H����	�����L�$�ȅ�u�H�5W�H��M���}������E1�A�EE���>�;"���-H���~��H�5xlH��L�xLD�E1�L�}�L�=?P�fDI��I�w�A��H���H�}��}����u�Mc�H��>PI��F�|(L�-��QI�uH��u�,�I��I�uH��tH���k�H��t�A�������A��L�-^�QI�uH��u�!I��I�uH��tH���+�H��t�A�πA�$��'�r��"�iH�5�kL����|�����H�͡QH�F�QH�uοD�}�H��E��
�DE1�H��(D��[A\A]A^A_]��{�����tc��\����"�:�VHc��<����tA��\����"���VHc��<����t�փ�\te��"���|H������u�H���PH�8��Z���ID��ZH�
�Z1�L�
�jH� j�A��k����1����֍FH��<t���Hc��<�����1���뒃�:u�|=�p��������VA�$E1�Hc�L�,E�}H�5��H��H�M��U��n{�����E���A��	��A�� ��L���@< �e<	�]H���CH�S��u�H��L�%�PH�5ti�fDI��I�t$�H��tbL����z����u�H���&v��H�T�H9����2@��	t @�� t�~@�B�< t<	u��H��H�J�H9�s�@��t	H9�w�AH��L��E1��
������DI��A�E���!< t�<	t�����E���#A�� �U�H�M�t	M��A��	u6H�D�J)�f�D�8�I��E����H��A�� t�A��	t�A��'����Lc�I�A�M�ȅ������H�{��\toD8����rLc�I�A�E��������\tID8��`�BH�L�,A�M�΅�������ƒ�\t#A8��J�LL�,H���΅�u������D�jMc�I�A�}�j�����Lc�I�A�M�ȅ��_����M����I���D���������Hc�L�$���A��"����Hc�L�,A�E������<	�
���H�D��H����	����I����u������BH�����u����H����������< t�<	t��~����SH�{�� t	��	�'��H�C��fD��I��H���� t�	t�M���t-Hc�H�D)��fDH���� td��	t_��4I�DŽ�u�L�-�:P1�H�5Of�I��I�u��H���L���w��A�ƅ�u�Hc�H��:PL��H���T�6����FA�H�L�<A���t��� t��	u�H�D��I�DŽ��u���H���� t�	t��b���H�E�D�8����L���r��D�}��E���tH�I�D�8u�H�Y�QI�t$H�}�H���������!����������VHc�L�,��t�VA�$M��Hc�L�,A�$A�E�}�z���H���PD�5�
ZH�8E��ttD��
ZH�
�
Z1�L�
�eH��d�E1��M|������L����D��H��������v��Mc�H�B�Dh�P����o��H�F�<�A���?���H�
 eH��d�1���{�����H���q��H�x��I���C��tDL��1���'D@��u#<"t,�Hc�1��DH��H����tkH��<\u�Hc�����L���A�$L��'tS��"tN���L��H���=�L����v������H�
�dH�d�1��6{��A����L�뤉��_�����p����tH�I�D�8u�H�q�QI�t$L��H����I��1���������L���%����rH��H����M���:���ff.�UH��AWA��AVAUATSH��H��H�=�Z�5�Z�H��@����H��I���
x������1�1���L���{������L��p���I�����I�~��8����l���8���L��H��I�ʼn���w����8���I�Ɖ��|��E���sMc�L��M�A��[u��M����E���
��
ZL��A���
ZM9���L9���L���H)׀:
u�f�H�C�|�
tH�É�H�4H9�u�L����I�Ԅ�tE<	t< u&�I����A�$D)�˄�td< t�<	t�Hcۄ�t<#tL����D�2
ZA��I�TD�"
ZL9��Y���L���qt��1��
ZH�Ĩ[A\A]A^A_]�Hc��H��1�1��X���H�=�	ZH9����H��t�"t��H���Zn��H�x��H��H���r��H��	Z���L����s��L����s���k����y������{���k��L���H��8����s��H��8�����J����zk����>���UH��H��t'�?uH�=�a1��d���H�=sa��t11�]�Q����H�=	ZH��u�H�=`a�8�H��H��t��fD1�]�@H�	Z�:udU�
H��AVL�5�ZAUD�-�ZATD�%�ZSH����l��H��t�A�t$H������[L�5�ZD�-�ZD�%�ZA\A]A^]�@1��ff.�f�UH�5�_H��AUI��ATE1�SH��~PH���DH��H�s�A��H��tL���q����u�Mc�H��~PI��J�t H��H��[A\A]]�f.�H;=��Pt3H;=X�Pt2H;=�Pt1H;=n�Pt0H;=��P�H�/`HE��H� _�H�%`�H�(`�H����@H��t
H��QH�8�UH�������H��t
H������1҉�]�ff.�@H���QH��DH���Q���t��uH���QH���QH��@H�q�QH�
�QH��fDU1�H��SH����������H����[]�H�-�Q�H�C^��t��H��H�I�HE��fDUH�5�^H��SH��H���o����u4H�͔Q�H����t��H��]H�=�]HE�H��[]�@H�5�^H���o������H�5�^H���o������H�5�ZH���o�����H�5�^H���lo����uXH�)ZH�H��t�H��1��O��H��H�����H��H�=�Z�Ok��H���'p����ZH�yZ�I���@H�5z^H���o����1����*���H��QH�8���H���������H������H������H�)5ZH��]H�H��HD�H��[]ÐH�y�Q� H�
r��H�=�ZD�1��Wk��H��Z���H��[]����D��ZH��Z�z���DUH�5�\H��AUI��ATE1�SH�|PH���DH��H�s�A��H��tGL���m����u�Mc�H��{PH���K�dH�D����H�#;HD�H��H��[A\A]]�@L�%�/PH�-\�
I��I�$H��t�H��L���m����u�H��H��[A\A]]�r���f�UH��AVAUATS�c��H��t[H�I��H��t8L�-��YH�XL�%0�fDI�}L��1�H���r��H�K�H��u�[L��A\A]A^]�n���[A\A]A^]��UH��AWE1�AVE1�AUATSH��XH�}�H�u��E��E��"�<�h���`I��I����L��H�E�D��H���<u�H�E�H�tH��t�H�}����H��H�E�H��t�H�8H����A��\Lce�D�u���A��"D�u���I��	�D���@�U���H���M�D��H����@H�E�HcщM�H�H�M��)f�O�,'H��I��K�'H�;H���H�+g��H�x責I��I�����}��;�}��a�}����\�E�A�EA�EH�3L���lr��H�;�l���E��E�9E��t����E�
Hcu�L��H���`�I���X����H�E�H�M�H9L�����1����I�ċE̍X;]��4Lcm�I���]�O�$�K�D�I���`���H��XL��[A\A]A^A_]�D�E�A�EA�E�?���fDH���Q���tH�E�������\eA�EfA�E����fDH�}��k������f.��E�A��9E�t5H�
�YH�����L��1���Hg������\C-?�@�����;j��H�H�E��H�U���uW�����j��H�u�H��0��uND�E��A�E\M-�\����E�
Hcu�L��H���ܪI�����@�c��H�u�H��0���t�b��H�u�H�D�0�1�����b��H�u�H�U�H�Hc0�DBt��c��H�H�U��b��H�u�H�U�H��0H��D������b��H�H�E���H�Y�QH�0�Q����UH��AWAVAUATSH���}��w_��L�-p�Y�
I��I�u�j��M�'M����I���L����H���QH��H�2���I�ƋE̅�ttM���KI�L��H��t/I�}M��H�RX1��H���Bn��H�{��i��H�H��u�L���i��I��M�g�M�������H��[A\A]A^A_]�f�I�}L��M��uH��W�1���m����H��W�I�^1��m��I�I�F0H��t�H�]�I��H�;H��5I�}L��WLE�H��W�1��m��H�H��tyH��I9�u�I�M��H�=�WH�]���o��I�>H������fD�h��H��H�{�H��u����f�I�}L��H�W1���m�������H�]��f.�H��-ZU�H��uH���Y�8���\"1�]��H�i�Y��H�=��-H��0o���ff.�H���Q1�H�01��M��ff.�f�H�)-ZU�H��uH�$�Y�8�����!1�]��H��Y��H�=A�-H��n���ff.�UH�P�QH�
�TH��AVAUL�-�TATL�%��YSH�RtP����L�5���H�SH�L��H��I�ՋL�s3��tM��I�<$1��H��U�k��M��u�L�-�'PH�pTL�5�UfDH������I��H����I�<$H��L��1�I���Jk��I�]H��u�[A\A]A^]��L�5�2��H�SH�L��H��I�ՋL�6���uM��I�<$1��H�GU��j��M��u�L�-L'PH��SL�5(UH���&���I��H��t7I�<$H��L��1�I���j��I�]H���V���H�����I��H��u�I��I�]H��u��4���DI��I�]H���������f.�H�	+ZU�H��uH��Y�8�!����1�]��H��Y��H�=!�-H��l���f.�@UH��ATL�%;�YSHcW8H��H�GI�<$H�4��Jc���)H�=�YH��t�$e��H�C�{<H�CH��Y�C��Y�C89�}.)�1�����C|��x,H�9*Z�[A\]�
*f.�)�1��7�C|��yԋC89C<t I�<$��^���K4H��)Z�C|�
�fD�C0��UH��AVAUA��ATSH�����?I�����!E1��0�H���(E�����)`�C�H�i-searchH�SA�f�s	H�L��E��-b��Mc�B�3': H��H�=��1��'H���c��H�z�Q[A\A]H�A^]��D�^���x!A��Hc�蝣H���(E���m����C�A�H�reverse-H�i-searchH�C�)`H�K	f�C�Z���D�!�F�H���(E��u+H�i-search�CA�H�K�)`f�K	�+���D�)`�CA�H�reverse-H�i-searchH�CH�K	f�S��ff.��UH��AUA����ATA��SH��賢f�H��D�(D�`@H�@H�@H�@(H�(Z��C0H��'Z��C4��f�H�CP�C8�C<H��C@�CXH�CpH�CxHǃ�H��[A\A]]�fDUH��SH��H��H�H��t�6b��H�{ H��t�(b��H�{H��t�b��H��H��[]�b��ff.��UH��AUI��ATSH��H�A�Y�@聉�#�A�EXA����Y��H��v
H�5Z���tH��D��[A\A]]ÐA�}XI�u\��^�A�EXA��H��[D��A\A]]�f�UH��AWI��AVAUATA��SH��8��xeH�^�QHc�H��H�8uOH�@H;��P�>H;��PthH;f�P�	���/	������u�GX����������FA�_XI������Z��H��t=����1�H��8��[A\A]A^A_]�1��G@�ƃ��wXI����qZ��H��u��X��H��vmH�
ZA�X���u`��xtA�\��A�]�������G�=�w}辇�{���f��ۂ���c����虇�T���A�X��x��~<�G�=�v��5����w*H�9RHc�H��1��G@�ƃ��wX�.�����u�A�WA�G��9�����W��H����H�-Z�0����I�\��Y��H����IcWI�O�rA�wA�w\@�4����IcWI�O�rA�wA�w]@�4����IcWI�O�rA�wA�w^@�4���rIcWI�O�rA�wA�w_@�4���QIcWI�O�rA�wA�w`@�4���0IcWI�O�rA�wA�wa@�4���IcWI�O�rA�wA�wb@�4����IcWI�O�rA�wA�wc@�4����IcWI�O�rA�wA�wd@�4��	��IcWI�O�rA�wA�we@�4��
��IcWI�O�rA�wA�wf@�4��tnIcWI�O�rA�wA�wg@�4��tQIcWI�O�rA�wA�wh@�4��
t4IcWI�O�rA�wA�wi@�4��uIcGI�W�HA�OA�Oj�IcGI�W�A�WTE�g|E�ox���A�GTA�G�E�A�G�������O��ƒ��E�HcẼ�U�A�WH�E�f��M�D+m̅��yE�����U̅�tAM�oM�wp��A�_TA�E�g|�Ic�L��A8Eu�H�U�L���W����uЋE�IcWP1����A�GI�GH�<�I�@�H�7"ZA�W|A�wI��A�GP��A�G<1��3������A�G������I�WA�GH��A�WA�GE�oxE�g|�U����IcW8I�G1������H�<��1�A�W0H��!Z�A�W4H��!Z�� �}!�j���A�G�E̅��rH�=	�Y��H������YI���@A�GHc��H�5��YI�GH���
Z�����YA�wI�A�G��1��N����8���H�&!ZL�%#!ZD�0EwE94$��H���YD��H�;�X ���_�����S��H��vH���YD�E���EE�nE9,$~<H�;D��� ���O_��t&�fS��H��vH���Y�8����A��E9,$�D��IcWA�OD)�I�G�|9���E9�~WH�3Ic΍zA�H��6@�4A�FA9�~3E)�H�A�U�L�LIcWH�3I�OHƍzH��A��6@�4L9�u�IcWI�G�
���H��ZL�%�ZIcWD�(A�$A�D9��yD)�A�wI�G�|
9��H�W�YIc͍rA��A�wH�	�Ic�E9,$~&IcGH�3I�OH֍xH��A��6@�4A9$�I�GIcW�w����GX����������N�����I�A�GHc���I�G�����E9����E̅�����I�OM�wp�f.�A�_TA�E�g|E9�|9Ic��L�8u�H�U�H��H�M��3T��H�M����w���A�_TA�E�g|E9�}�McOPHc�H��M��I�A�G(H�U�N�4��E��DD;U�}ZLu�A�E�oPD;m�tYM�gM�I�<$I�p�]S��I�@I��A�GxH��t�I�4$�8u�L�U���Z��L�U���t�D;U�|�E�oxE1��@�EȻ��A�G��A�G<A�GP����A�_TIcOPHc�H��I��H�H�U�L�4��DD;M�}ZLu�A�E�oPx�M�gM�I�<$I�p�R��I�@I��A�GxH��t�I�4$�8u�L�M��Z��L�M���t�D;M�|��E�oxE��D+e�E�g|����?��i����GX����������<���A�_T�y����GX����������"���IcGI�W�HA�OD�$���A�GE�g|E�ox�t*A��E�g|����H�;D�����A������E9��p���A��E�g|��������������f��T1H��A�WHc��=�I�GE;,$����IcW���H�;��D���qA������TH��A�WHc��IcWI�G���f�U1�H��AWAVAUATA���SH��L�-&�YA�M���H��E��y�HH�v�YH��HH�H��HD�H����a�I���)�M����I�>������H��I�|�u�zHc�H���S(� ��S(H�C����I�H�H��{(��~#�I���H�1H�KH�4H��;S(|�Hc�L�4�H�#�YH�H���H�H�CL�=��YJ�0�C8�C(A��A���CP��C����}��CH�C�I�?D�cTH�{p��O��L�%H�YH�{�CxH��ZI�$�s����C|1����1�A�EuI�H���H�sXH������t71�H�߉E����E�A�e���I�$������H��[A\A]A^A_]�H�߉E����E�빿1����@L�=��YI�?�O��H�x蘔I�7H�C H����R��H�S H�CJ�0�����E1����������f����ff.�UH��ATSH���a�sXH�����A��1�E��~[A\]��t61�H�����H���YH�H�w�Y� ���1�E��[��A\]�@H�����f.�@UH��S��H��H���YHc=W�QH���N9���9���Hc�H�
��YH�rL�L�1L�M9�A��H�I9�@��A�����������A��fo
�1�f�A)�D���H��DAAH��H9�u�D�҃���A9��$Hc����S9��Hc����S9���Hc����S9���Hc����S9���Hc����S9���Hc����S9���Hc����S9���Hc����S9�~xHc����S	9�~fHc����S
9�~THc����S9�~BHc����S9�~0Hc����S
9�~Hc҃���9�~Hc����H�=0�Y��H��[]���H��9�~���H��9����fD�9����=@�QHc�H�=��Y衑H�=��YHc5#�QH���Y臑�=�QH���Y���D9�}	���QHc��>�Hc=��QH�h�Y�+��=��QH�N�Y���f����Q���s����B�Y��7�Y��Hc='�YH�4�YH���ːHc=�YH��YH��贐H��YH���Y�H���Y�H��[]�ff.��UH��AWE1�AVI��AUA��ATS��H��8�U�dH�%(H�E�1�H�E���~FL�e����t<A�)�E9�~2Ic�1�Hc�L��L��OT�����r�A����I�$E9��fDD��D)�A��D9}�~qH�E�L�e�H�E��'��t\�}�A�)��N�����H�A�D9}�~<Ic�H�}�Hc�L��L���S�����r�A����A��I�$D9}��f�E��D+E�H�}�dH3<%(C�(uH��8[A\A]A^A_]���N��f�UH��AWAVAUATSH��H��XH�}�H�u�H�U�H�M�L�E��cG��H���H�}��I��H��H���Y�����{E1�E1�E1�Hc���H�]��E�H�E�I���E��E��E�H�E��l�<����F��H��vH�6�Y����$�E��I��A��H��A�G�E��uH�iZD9 �E�NE�A��E���E�H���������E��t�<�k�nF��H��vH���Y������I���E�H��A�G��f�H���hH��H��H�}����G��H�����H�{�ՍH�u�H���	L��L�u�H��H�E�M��tH���!H��A�H�E�H��t�H�E�H��t�H�}��CH�E�H�����H�u���)H�}�I�ٹ�I)�D��L�M���L�M���D)�D�V��?H�SI9�I�W��H9�����)A�����1��H��@�oAH��H9�u��E�Ӄ���A)�I�<H�9�����E�����Q�WA�����Q�WA�����Q�WA�����Q�WA����Q�WA��tr�Q�WA��te�Q�WA��tX�Q�WA��tK�Q	�W	A��	t>�Q
�W
A��
t1�Q�WA��t$�Q�WA��t�Q
�W
A��
t
�Q�WI��M�L�E����A�A9��l���H�}���D���S���E��V���H�}�H�CH�WH9���L��H+U�H��E1�r��u�H���L����H��ZD; �E�A�MẺE�H�E�H��tD� H�E�H��t�}��8H�E�H��t�ủ0H�E�H��t�}ĉ8H�E�H��X[A\A]A^A_]��H�]�A�H�����Du�����H��E1����DD��1��f�H���A�H�JH9�u�����H���/E���D���f.�UH��AWAVAUATI��SH��(��B��L��H�����D��H��H��Y�0�����{E1�L��E1�Hc��]��E�H�E�I���_D<���{B��H��vH���Y������I��A��H��A�G��M̅�uH�ZD9(�����E�H���V����KE��t�<�.�B��H��v
H�d�Y���t^�I��H��A�G��D�D��H�þL���C��H������H�{聉H��(L��[H��A\A]A^A_]�G���I��L���M)�D��L�M��L�M�A��E)�A�z��WI�WH9�H�S��I9����������D��1��H��@�oAH��H9�u�E�Ӊ�A���D��D)�H�4L�E9���D�D�����D�^D�Y����D�^D�Y����D�^D�Y����D�^D�Y����D�^D�Y���}D�^D�Y��toD�^D�Y��taD�^D�Y��tSD�^	D�Y	��	tED�^
D�Y
��
t7D�^D�Y��t)D�^D�Y��tD�^
D�Y
��
t
�V�QfDH��H�I�E�������E�A9��������D��L���4�������H��E1�H�������A�H�E�H��([A\A]A^A_]ÐH��A��z������1��
f.�H���A�H�JH9�u��g����UH��AUATSH��H��H�=��YH��t�OG��H�=��YH��t�>G��H���Y1�H���Y�l�Y�F�Y�D�Y�.�Y�@�YH�����;���
H���F��I��H����H�xL���Y1�1�H���YH�5��Y�'���E�l$H��1�A�D$E1�H�
��YH�5��YH���Y1����H�=��YE�l$H���Y1�H��t�@�����Y���YH��[A\A]]ÐH�u�YL�b�YH��1�H�
Z�YH�5k�Y���1�H�e�YH�f�YH��t
H���9@���‹=�Y�;�YH��[A\A]]�H���YH��t�H���Y���Y�H���Y�H���Y�H���YH��tH����Y1��UH��AVAUATSH���YH�;�?���x1��l�L�%��YM���DH�=M�YL���MC��H�=6�YL���>C��L�+�
L���ND��H��I��MD�L���L?��I��A���=��H��vH�d�Y�����H���YD�0H���QE1�H�
��Y���H��ZA��D D��A���E�����������YH�=��YH�5k�YH��1�1�@�H�����A�D�A9�}�Hc�H�<�D�7H�H�H�Y���YH�1�[A\A]A^]�E��[H��Y��M���D�.�YH�=?�Y������L�#����H�=��-��G���f.�D��1�L���#�H���Y����DUH���YH��H��u�fDH���@��8u����H��Q���Y�1�]�f�UH��AWAVAUA��ATSH��H�I�YH�u�D�5��Y�8��tE1�L�%2�YE��A�$�N;��H��v0H���YD�8E����E���<D9=Q�Y��A9�tO�;��H��A�$vH�5]�Y�‹6��t��D)�E��tSA�wD)�9�|HH�}�Q���u+D9�|c�HE�<$H��[A\A]A^A_]�DE���H�a	Z9u�DH�Y	ZL�5�r�1�H�8L���hG��A�$D9�}��f:��H����H���Y���uH�8	ZH�8H����L�5�r�
H�	ZH�8L�����G��A9�u��D���@��YE)�����fDH�}�1�D���"�A��D9=�Y�������D9������H�M�Hc�A��A)�H���YL�4H�DI�fDA�>H�3I���pH��M9�u����fDD)�����~���H�2ZH��q�H�8�FF��E�������L�u�A�E�H�n�YM�lf�A�>H�3I���H��M9�u��N���fDUH��AWAVAUATSH��L�5��YA�9�tiH��Z9:|^A��A��A)�E��~hL�=�Y1��I�7�
���G��A9�u�H�tZH�q�H�8�E��H�i�Y�E�&H��[A\A]A^A_]�f�L�-!ZI�}H��tՀ?t�D)�Å�~�E1��	DI�}H��p�A���E��D9�u���U�G�H��AWAVAUATS��H��L�%3�YI�4$��w:H���YA����tO���F��I�<$�?��H��D��[A\A]A^A_]�D����A�@�ǀu�A�A��ADH�����H�=�,A��F��I�4$���[A�A���	�l���A��H����@�H�=�/A��@�@F��A��9�tHI�4$E���5���@A����ubH����?H�=�/�E��I�4$�����=��Hc�I�4$E��H��DP����H�u�E����6��H�u�H�B�����A�����ff.�@��xSUH��S@��H��@��	t`���~&��t�D=��H��DX@������H��[]�@��u���fDH���Y�����E�����H����[]��)���UH������H��YH����7�YH�H��HD�H���YH�1�]��H�	�YH���YH���YH���YH���YH���Y���Y���Y�|�Y���Y���Y�b�Y���Y�~�Y�X�Y���Y�x�Y�>�Y�T�Y�J�Y��Y�:�Y�0�Y��Y�f�UH��H���H��X���H��`���H��h���L��p���L��x�����t )E�)M�)U�)]�)e�)m�)u�)}�H�EI�����H��@���L��8���H��P����H�=��YH��H���Dž8���Dž<���0�L9��H�=l�YtrH�+�YH�=��YH�i�YL�V�YH�
S�YH�8H�5a�Y1���1�H�Y�YH�Z�YH��t
H���-6����H�l�Q�.�Y�1�����������Y�z���ff.��UH�=�YH��H��t�;��H�=��YH��t�;��H���Y]H���YH���YH���YH�~�YH���Y�a�Y�W�Y���Y�O�Y�E�Y�s�Y�A�Y�7�Y�Q�Y�'�Y��Y�K�Y��Y���Y��Y���Y���Y��Y�f�H���YUH�H���YH��H����Y��uH�/�Q�1�]���H��Q���Y�1�]�@UH��AWAVAUATA��SH�����L�-��YI�]H�����
H���v9��H��tYH�XH���u4���xI��Hc��yH��E����Mc�F�$*B�D*��Y���/�YH��H��[A\A]A^A_]�D�;tCH���4���xI��Hc�Ic��yL�sH��E��tI�uH����7��H��H�D� B�2듐�A��`yH����H��H���7��H���Z���DUH��AUATA��SH����vE��~v1�L�-��Y���I�u� �(@���CA9�u�D���vH�5)�Y1�H�
�Y�fD�‹���H���B9�u�H���Y�H��[A\A]]�DD���Hv��fDH���YH�H��tH�:i�H���=��DUH��AUATSH����uH��[A\A]]�@A��~)L�-��Y1�f.�I�u� ���O?��A9�u�H�;�YD H��[A\A]]�DUH��AWE��AVAUA��ATSH��H�}�H�u��U�D�M�dH�%(H�E�1��0��H��H���YH��h������H�R�Y�����H�=��Y9����/��H��vH�'�YD�0E����Ic�H����
H�]������
H�}�H��I��:t�JD���tA:$�OH��I��H��H)�H9�|�D��+E��U��E�D;m��>�;�5I�ދU��DA�>tI��B�2)�A9��I9���D;}��{A�<$M��t(�M��@A�}tI��B�)D)�A9��M9���!„�����.��H��vH�'�Y�8���
M�]�M�~�M9�vJI9�vEA�F�A:E�u:A�1��< DE�I��I��I9�vM9�v	A�A:t�E����M��M��H�-�Y�U�����\�5v�Y��x������H�
�YD�j�YD�E���VH��YH�8�ED9B�Y�8H��h���D�E���%D;E��H��`���D��p���L�]���-��L�]�D��p���H��H��`���vH�
�Y���Y�:��t	���Y��H��h���9��H��e�D�E�H��`���H��H�0�YL��p���H�8�I:��D�E�H�=��YD���Fr�A-��D�E�L��p���H��H��`����kH�~�Y����ZE��~'H�=X�YD��1�L�]�H��p����3�H��p���L�]�H��h���+�Y���Y��H�u��}�H��p���L�]��!��,��L�]�H��p���H��v+H���Y�0��uH��h����=��Y98u
�{�YL��H��X���L)�L��`���H��H��p���L��H)؉�)É]��@,��L��`���H��X���H����H���Y������]����H���YD�E���
���H�=��Y+�Y9����H�}�QD�E����H�
��YD�	E������E�L�%��Y��A;$�����+��H����H���YD�E����HcE�H���Y�<���~���H�]�H�E�H�]��U+��H�u�H��H��H�u�H�u�H���+7��H��H�@H����H���v�}��1�������d��Lc��E�~CH�-�Y��x���1�D��p���I��H��H�E�I�u�<H���9��A9�拍x���D��p���H��h���A�$H�E���*��H�]�H�M�H�}�H��H���6��H��������}������N�3H�sH���sH�}�H�4H��1�H������L��H��H��H�P��6��H�u�H�}�L���F/���X����E9�D��H�]�H�u�AN�H��Lc�E�L���m,�����5�E�L�Le��E����9E��wDžx���H�u��}�L�]��=�L�]�L��L��`���L)�H��H��p���L��H)؉�)lj��}��)��H����H���YL��`��������H�}��E�1�I)�A9�~D�ډ�����H�}�L���E�H)�9�~	����)ËU���uNH�
�Y���uA�_�Y;�x����U�t0�)���U�+�x���U��}�H����H�[�YӋ��E�f�L��L)�H�M���(��H�M�A��H��v4H�-�YD�E���AH�}�L��u�H)�9�~����H�M�A��@����H�u�Y�����C�	9�}H�`�YH�8��H�7�Y�;E���;E�����tH��Q����dA�?��H��Y���tH��h���������(��H��tH�j�YD�(E��t)�E�9�t"��H���PA��H�("�H�81��Y4��H���YH�8H������1��/��H�&`�H���4���u�L���lH��h���L��p���HcE�D��)ƅ�~1I�L���vlD��1�)څ�~
1�L�����H��h����H�E�dH3%(�	H�Ę[A\A]A^A_]�D��+E��U��E�D;m�����f�I�޺D;}�����@L�=��YI�?H����A��C�	A��D9��zH���YD�E��tH��h���D�E��u�E���Yt����H��p������B�����L���k�������A��������}�L�]��T��_&��L�]�H���j���H���Y���x������S����E����R����E���x�������1�L�]����&��L�]�H��tH�_�Y���������#�Y�������H��h������f�H�E�H�E�E9��'E����H�E��8��H�}�1�D�m�L�e�H�}�H�}�H��A��D��p���I��H��x����Mf�D��1ɺL����H�}�D��1ɺHc���I��L�Lc�M��Le�D9u����;�	L��x���E��D��L��H�M�H�U��x���u���+E�D�m��E�D��+E�D��p����E������L��D�M���iH��h���D�M�D�o����L�}�L��1�L)�L�����L�}�L��1�H�I�H�E�H)�H�����H�u�H�L�I9�����M9�����H�E�A�L��H���H�E�H�E�E��H��X���H�]�L��P���I��H��x���L��@����Vf.�L��`���A�? �H��DD�1�D���O�1�D��L��Lc��?�I�Lc�M�L;�X���v\L;�P���vSH�U�M��M��L��L��x���I)�M)�H��H�E��D��I�L��p���L��`�����L��p������a���E��L��@���L��H���H��X���L��P������DD�M���~��L���FhH��h���D�M�DL+u�L+m�E��E)��%#��H��v7H�x�Y�8��u*E���D��E1�E�������H�}�1��/��A)�@E�������H�|�Q�0��t?�}�9}�}7E��~#H��YE1�H�3� A���1��E9�u�H��h���D �C���D�����6���fDE1�E1�L��1�1�L��L�]����L�]������A�?��A�;���L�]��>"��L�]�H��vH���Y�����I����L�e�H�]��E��E���H���YH�8H��t	�?��L�-��YI�}H��t-�?t(D�s�L�=7Z�I�}L���A���.��A���u�u�L���fH�0�YH�8H������?���H��Y��b.���������v����E�9��Y�;���D��x���E���+���H�M�D�M��:!��D�M�H�M�H��tH���YD�E���9���A�?�/����E����$�����L���e�W���H���YD;�D���H���YH�H��t	�8���?�#�����L�-+Y�I�?L�����-�����u����@M����E����E1�Ic�Le�H]�D�}�D�m����g ��L�]�H��vH���Y�0���/I�����E��E�����D�m�D��p���D�u�����D�m�D��p���D�m�D�u���H�}�D��1��6��D��A��E����������H�E��3@80����Mc�H��H��L���Q"�����5������H�E�H�ٸY�H�3�������s.��H��h���H�}�A�$��?���H�E����������H��W�H���:,���^���H�E�L��1ɺH)�H���l�H�u�H�L���L��L�}�1ɺL)�L���D�L�]�H�I����� ��-���T���D��D��H��D�E���&��D�E�H�:WH��D���+������H��h���D����H�ԷY� H�3�w-��H��h���H�u�A�$��>���H�E����������H���YH�E�A��8H�3�&-���E���w��c%��UH��AWAVAUATSH��dH�%(H�E�1�H�.�YD�E���#H�ӻYH�;��H�ҼYH�E�H����H�=�Y�wH���YE1����Y����D�(H�E�E����H���Y�8H���YH��P���t�H���YH�H;tH�=��Y�H���YH��t�=��Y�������Y����F�<+A�G;��Q�hH�E�H�5m�YHc�J�< Mc�� ��L�e�H�E�B� +7�Y�%�YH��YHc�Y1�H�=�Y�D-�Y� ��H���YD;(�KA��E�1�E1�D��x����C�H���Y������E�A9�~H�=кYD������A)�H�,�YI��D���A9�|w�Y��D�{H��vH���Y����.H���Y�A��H�=q�Y����u
I�YH�2�YB�0�	��H���_���H���YI��D���A)�A9�}�D�}�D��x�������H��vH�*�Y����`H��YH�E�H�E�Džl��������H�j�YE1�Džh���Džp���H�E�H�X�YH��`���H�E�H��X����1f�H���YD90u�E�D�=>�Y��l���A�D$���wH�߳Y�������	��A��
�f����A���� ��A����H�E�H�u�E�g�0^H�5��YA�E;�A���?H�E�A��Mc�B� Ic�H�E�H�]�YD9(?���YH�=��Y�P�;U��O	H���Y�E�HcU�E1�D�<���p�����Ic�H�E��T��H��H�E��vH���YD�E���mA��A9���H�E�Ic�H��x���H�D�$8D���
��H��v=H�]�Y���u0H�}���	H�}��Q�}��i ���ƅ��IƉ�h����51�QA�W9��e����H�=��Y��t����5�QHc��xaHc5�QH�=z�YH�{�Y�^a��t���H�E�H�]�Y������F�9���D��1��A9�~H�E�Hc��D0�>H��P���D�E��tD�
�YE��u9���H���YLc�E1�1ҋ
9�YH�5�Y�L�Y�H=�YL��A���H���YD�0����
H���Y��Y;�Y�~E9�uD��)�;
ͶY��E��@A)�E��A9�H�5x�Y�=��YAN�L�)߉��Y�����h�YH���YH�8�) ��H�
J�YH�c�Y�Q�YH�5.�YH�
'�YH�
P�YH�I�Y�3�Y�-�YH��P���H�5�Y�H��`���H�
�Y�0���Y��t�
�Y1���u�
�Y��YH�E�dH3%(�^H�Ĉ[A\A]A^A_]�f��{aH���H��YH�8�H�E�A�*A�A�fD�H�`�Y����Ic�E��H�E��O���f�1�1��G���R��H�+�YH�E��k���f��������������f.��J�Y��D9���
H�H�YH�E�H���Y�������
A�L$9���L�u�L�u�D�m�E��A�̉]�������A��D9���1�E9�}D��D��L������H�
A�Y�9�~�D��L�u�E��]�D�m�H�}���1���D�e���A�������
f�Y�$���DD������A�D
��)�)�H���Y��D)��F�$*A9��VE��D9������A��H�}�� H}�A�H�����Hc�I��H�E��u���fDDu�H�E�H�M�D)�H��X���Ic�Hc�H0�!��H�E�H�E��A9��i����H�E�H�M�����Y��y�E�D�=t�Y��l����t�YH�=}�Y�P�;U���Lce�I�D$H��D�<�H��`���H�]�D�E���eH���YH�H���R�8�IH��P����E�D�E��t�5H�Y�������H�a�Y�/�YD9;��
1�H�E�D�}�D�u�L�-��YH�E�I��L�e�L�m��B�H���YE��Hc|�B��)�H=|�Y�/�M��tfL9}��/
H�=��YM��M�gD��A�]�Y�YJ��F��HcD�A)�H&�YH��H���YD98}�H�}�1�E�����M��u����H��v9H�b�Y��Yu(A�E9�t ��Y9�~;�Y})�A�E�E���T��Y�E�A9E���E�)؉ѱY�*���@H��`���H�}�E�gH}������H�4�YH�H�����8���q�YH�z�Y��J�;M����E�HcU�E1�D�$�Ic�I��H�E�����D�#��H��vH�v�YD�E����H�E�H�u�A��A���0Ic�H�E�H���YD;(������C���H�}�E�gH}��H�
��YA�E�^A��9M����YH�=��Y�H�;M���H���Y�E���p���A�HcM�D�$��4��?���������@�]����7��H��H��DX������a��H����{���DH�}�H�����E��1�H}�H�
M�����H���YA�E�9����Ӌ��YH��YD)�J�;M����E�HcU�B�;A�A)݉�A��Ic�H�E��W����
��YD)�A��H���Y�q�;u����E�HcM�C�4<D)�A�Չ4�D9�����A��H�}�� H}�A�H�����Hc�I��H�E�����A���x������8�YH�H�4��XHc5"�YH�=3�YH�$�YH����XH�=�YH��Y�p����H�E�Džh���H�E�����H���YD�
��Y�VUUUD�֮YHc=��Y�H�R�YD��E��D���YD)�A)��0EÅ���DD�����)��F�D9�������D��)������E��������A9��wD��H�u�Hc�E1��<H���Y�0��������U���YH�H�4���WHc5��YH�=�YH��YH���WH�=�Y�U�H��Y�4����D��E��L�u�D�m�D�e��]�A���r��H�lj�x����
��YHc�H�4��_W��x���H���Y����DH�!�Y��h���Džp����B�.9���H���YD90���E�D�D9�~HD��L��x���H�}���H�u��L)�I�LH�E�H�8f�H�B� B�"I��L9�u�D}�Ic�H�E���h������y�E��D��x���1�D�}�A���/DH�٭YA����p���E1�Ic�D�$�����A9���H�G�YA��D;(|���YH�=��Y�p�D9����q�YH�H�4��2VHc5[�YH�=l�YH�]�YH���VH�=M�YH�N�Y�p�����H�lj%�YHc�H�4���UH��Y�!���f�H���Y��YE��A)݋���A���E9��8���D;=�Y�+���D)�������H�l�Y�����DD�}�D��x���E���4�D����YH�H�4��QUH��H���Y����f�H�tH��h���
H��I���`��H��t�5��YL�p���|L���Q��E�|H�É3�YA�G;y�Q��Hc�H�]�L��J�<#���Ic���Y�H�E����Y���@��E������������A��E1��U�DH������H�߉��Q�ȪY���D������E�D�=u�Y��l����3���D9�����A�_D��E��D�u�Hc�D�m�E1�L�u��8�H�Y�YA��Ic�D�<�D�$�H���Y�1�C�4 H��9���A�D� ��A��A��H�5��Y�9�|Ӌ�YH�=��Y�P�D9���D�E��٪YH�H�4��SHc5êYH�=ԪYH�ŪYH���|SH�=��YD�E�H���Y�T���H�n�YE1�E1����H���Y�@���@H���YH�M�H�}�H�E�H�E�HcH��YH�0�#��H�E�H�E��y�9T�Y�f���;<�Y�Z����	��H��H���Y�8A�E��H�K�Y�����)Dž��#����������Y�����A��%�H�=��Y)�Hc�5�Q�}RHc5�QH�=�YH���Y�cR���YH�E�H�b�YE�|�@��H�ljm�YHc�H�4��-RH�f�Y���H�
�Y�u��D�f9�~kD9�|fL�m��$f�H���Y�8�2��H�ۧYA��I��D; <H��YD��Jc(H�Y����H��1��J��H���YD9 u�H��������H���Y�M��H���Y��l���9��D��l���E���=Hc�l���H���Y���YD�$�D)����E���D�m�A��Ic�D�u�D��p���H�E�����D�e�D���
�A�A��������E���i������a���A9�AO��U���������	��H��tH�Y�YD�8E���L���D��l���E���L�����Y���H�u���YÅ��-H�E������H�ħY���YD�"D)�9��a���H��vH�޲YD�E��tH�E�9��Ic��H5N�Y��������~�Y���YӅ��H�[�Y�9�YD� D)��t��fD��8�����A��H�=�Y�����%�)�)�Hc�5_�Q��OHc5S�QH�=̦YH�ͦY�OH�E�H���Y���H���YH��`�����M��H��H�E�I)�D���LA��~H�E��x�
�[���H�E�YH�8H���H���H��?��P��H�1�Y��%���D�����H�}��=���3H�}�H��vH���Y����iD�~��I�D�e�A�����)ȉ��"��H���Y�%�Y��O�����H��vH�<�Y���YD� E��t	��Y�PH�E��9�����H��YH�������H�h�YH�8H��tH�?��w��H�ФY��H���vK�q��H����H���Y�������~H�=��Y��1�肽���l�YH�u�)Љ����*��A��H��v-H�z�Y���u ��~Ic���H=��Y1��=���++�YA��H�E��D9��U���D)���;KH�E�D�(�?���H��Y�ƤYD� D)��'���H�}�1���H�=ŤYA�����H�E��ãY��J���H���Y���YD� D)�H�E������D��������H�1�YH�8H��tH��=��0���;Kff.�UH��AVAUATSH��Y�;��t
H��Y���t;���L�%/�Y���JI�<$���H�ԢY�[A\A]A^]��H��YHc�Hc�H���Y�<u����;���H�H�Q���t%HcH�
��YL�-M�YH��HcT���<�)�A;}tL�%��Y�n���DHY�Y���X�Y����H��I�����1��b��L�%k�YIcEI�4$A�|�����$���UH��AWAVAUATSH��H���YH�8H���dL�%e<�L������H���YL�5��YH�8A�H����L�����H���Y���~1����L�%�Y�
M�,$L���
��H����H�X���H���YH��L���YH�
��YH�5��Y1�I�$�»��1�H���YH���YH��t
H���a���‰i�Y�T��M�,$H��[A\A]A^A_]�M��DH���YD�(E��~!L�="�Y1�I�7� �����A9�u�E.H���YL��E�.H�8������f�H��[A\A]A^A_]����D�H���ff.�H���Y���u�f�UH��SH��H�0�Y�;�I��H���Y�H�8�
��H��1��[]�r/��f�UH��SH��H���YH�;H��tH��:����H�؟Y�1����H�;H��tH�T:�����H���Y�H���YH�8H��[]�	���H�i�YH�5��Y�H�q�Y�H���Y)�H�H9t1���~�Й������H���Y+��DUH��ATA��SH���Y���4=H���YH��vD��1��ҁ#���[A\]�DUH��AVAUATSH��H��~QD�E��t�=)�Y���Q�57�Y����H�\~Q���t
��Y��tH�Ā1�[A\A]A^]�f.�L�����H��@���I�|$�8	��H�1���H�{�E�H��@����	��H�=ˠY�	��H������H�޿�
	��fo�����fo�����fo�����fo����)��Yfo���fo��fo����fo����)
l�Yfo� ���H��0���)f�YH������)h�Y)%q�Y)-z�Y)5��Y)=��Y)��YH���YH���D��Y����DH�=I�Y�4���H�=8�Y��
���H�='�Y��
���H�=�Y�
���H�=�Y�
���H�=�Y�
���H�=�Y�
���H�=ҞY�}
����A�Y���&����5O�Y������H�=$�YL��������H��Y1�H�5��Y���L��@���I�}�c��H��	I�|$�E�H��@���L�������=��H�=N�Y�1��L��L���1��H9�������fo�����fo�����H��0���fo�����)
��Yfo����fo���)��Yfo��fo����fo����fo� ���H�P�Y)٢Y)%�Y)-�Y)5�Y)=��Y)
�Y)�YH�=��Y�AI�}�h��I�|$H��@����E��P��H�=��Y�D��L��L���D��H9�������fo�����H��0���fo�����fo�����)q�Yfo����fo���fo��fo����H�ڡYfo����fo� ���)%C�Y)-L�Y)5U�Y)=^�Y)g�Y)
p�Y)y�Y)��YH�=��Y�4I�}�{��I�|$H��@����E��c��H�=��Y�W��L��L���W��H9�������fo�����H��0���fo�����fo�����)%D�Yfo����fo���fo��fo����H���Yfo����fo� ���)-�Y)5�Y)=(�Y)1�Y)
:�Y)C�Y)L�Y)%U�YH�=͞Y�'I�|$H��@����E����H�=P�Y�s��L��L���s��H9�������fo�����H��0���fo�����fo�����)-�Yfo����fo���fo��fo����H�i�Yfo����fo� ���)5ҞY)=۞Y)�Y)
�Y)��Y)��Y)%�Y)-�YH���YH��� H��t
���Y��I�}���I�|$H��@����E��}��H�=�Y�q��L��L���q��H9�������fo�����H��0���fo�����fo�����)5��Yfo����fo���fo��fo����H�'�Yfo����fo� ���)=��Y)��Y)
��Y)��Y)��Y)%��Y)-ƜY)5ϜYH�=G�Y�I�}���I�|$H��@����E����H�=��Y���L��L�����H9�������fo�����H��0���fo�����fo�����)=1�Yfo����fo���fo��fo����H���Yfo����fo� ���)�Y)
�Y)�Y)�Y)%'�Y)-0�Y)59�Y)=B�YH�=��Y��I�}���I�|$H��@����E����H�=�Y���L��L�����H9�������fo�����H��0���fo�����fo�����)��Yfo����fo���fo��fo����H�
�Yfo����fo� ���)
v�Y)�Y)��Y)%��Y)-��Y)5��Y)=��Y)��YH�=-�Y��1ҿH�5Y�Y�k�Y�����2���DH��`���H�5r�Y�������H��`���H�5R�Y��������L��H�5��Y��l������L��H�5��Y��L������L��H�56�Y��,������L��H�5��Y��������L��H�56�Y���������L��H�5��Y��������L��H�56�Y��������UH��SH��H�atQ���t	�=�YtfH�GtQ���t	�=�YtH�Ĩ1�[]�@H��P���H�{�8���H�ڿH�5ٖY�4���1����YH�Ĩ[]�fDH��P���H�{���H�ڿH�5��Y��H�ڿH�5E�Y���H�ڿH�5�Y����H�ڿH�5}�Y���H�ڿH�5)�Y���H�ڿH�5u�Y���H�ڿH�5��Y�|�����Y���ff.�f�UH���'�H�PrQH�H��t���%]���ff.�H�1rQH�H��tUH�!�Y�:H���]�<�@�3�UH���7�?H��tH�@��K��]饒DUH��AUATSH��H�Q�Y��̀���w���A��H����pu��u���H�Ĉ[A\A]]��{�������L��`���L���W���L��1�1��[���D��L�����D������1�L���9���������UH��S��H�������t-H���Y���t��H�=������H������H��[]�f�����Hc�H���Qt�H��[]�UH��S��H���������u&H�P�Y���t��H�=m������1�H����H����[]��UH��SH����9�����8��##H��YH�-�Y� ��H�;tf��H�;u�H���YH�=�Y�H���fD���ff.�UH���g91�]�UH��ATA��S9�~A���D)�{Hc�Hc���:Ic�H��H��H��YH��H0�����[A\]�fDUH��AUATSH��L�-��YA�u9�|5L�%��Y��I�$���H��A�uHc��:A�uI�$9�~�H��[A\A]]�p��UH��AWAVAUATSH��H���Y�H���YD�(H�=�YD�a�L�A9���Ic�I�<I�����~tW��	@�ƀ� ��@���$E��y
���E���w�E�D$�@�� ��@��	��H��!�D�������u�Ic�I��I�LE���f�E���9E�F@�� ��@��	@��	��E9�@��H��@��uҀ�~tEH��1�[A\A]A^A_]�@Ic�A�<~�5���H�=����D��D��H���Й�fDE��E)�A�}A��Hc�Mc��9L��H��H��YH��H�0L��D�B�+H��跇H��I������D��D��L���n��\���Lc�A��C�9L���
���fDUH��AWAVI��AUATSH��H��H����H��I��A�����A9�FMc�D�,�DH��D��)�A9�*L��L��H���d�����u�H��H��[A\A]A^A_]�fD1���@H�6H�?�5�D��01���	���@�G��ff.�������t1��DUH��S��H������Hc�H��xH��[]f��	���������t1��DUH��S��H�����Hc�H��xH��[]f��
����UH��ATS�������t��[A\]���{���Lc�H�B�D`t����H�B����[A\]�f.�UH��ATS�������t��[A\]���+���Lc�H�B�D`t��X�H�B����[A\]�f.������t1��DUH��S��H�����Hc�H��DxH��[]���ff.�UH��SH��H����xHc��6H��H��H��[]��UH��AWAVA��AUI��ATSH��L�%�YH�
��YA�$��usH�����ؓY��
��sH�ω5ÓYHc�L�<�L���,6I�w�H���YH��H�H�A�$��u%L�.���YH��1�[A\A]A^A_]�f��n�Y�X�H��QLc�J�4���t�H�H��H�E���L��I���	�I�|�5I��E����H�u�H���W�L��H����H�}����L�����H��YN�<��b�����Y��45H��H�ڒYH��H��'���H�9H�MȻ	�7���H�MȺPH�qH������HH�����DL��H����H�u�H���	��X���@UH�=g�YH��t)H�/�Y�8�D�HcE�YH�F�YH�<�荒1�]��������]�ff.�f�UH��YH��AVAUATSH�H;,VPt
H;�UP��H��YH����Hc֑YL�4�L����L�%��YE�,$D��)�xh��t$H��YHc�A�H:8uOHc�L������u@D����>��-�YA�$y�o�Y���j�Y1�����1�[A\A]A^]������������ff.��UH��AWAVA��AUA��ATA��SH���!5A��E��~1���5��A9�u��5D��H���5H����H�D��D����IH��H����8tf�fH���Y�8訴H�%Q���t+H����H�����f1�H��[A\A]A^A_]�DD�������H�=<�跐��1H�����������0������DUH��H��H��YH�
��H9tmH���Y�=4hQ1����Y�hQ���Y��t�=hQ���1҅��‰ƏY��@�$���1҅��‰��Y������Y��u^��gQ��~4��Y���Yx�|�Y�fD�n�Y�d�Y1��w�����ډ�gQR�Y�L�Yy�����u��}��E
�u��}��ff.�f�1��ff.�f�9�tLUH��AUATA��S��H���U�����D��I��訐1�A9�L��@������H���Y�H��1�[A\A]]�H���Y�1����x\UH��ATSH���YD�#�f��3D9�uH�Q�8t[1�A\]�@D���`���H��Q�8u�H�+�Y�1�[A\]�f����	f���xlUH��ATSH��YD�#薖�3D9�uH��QD�#�8t'[1�A\]�f�D�����H�uQD�#�8u�H���YD� 1�[A\]��������f���xdUH��ATL�%��YSA�$��t>��<�A�4$9�t���}���H�
Q�8uA�$H�F�Y�1�[A\]�D�#.[1�A\]�@��ff.���xlU�H��ATSH�
�YD�#�ѓ�3D9�uH��QD�#�8t"[1�A\]�@D�����H�uQD�#�8u�H���YD� 1�[A\]�������fDUH���g
H���Y1��H���Y�0���H�c�Y��h
1�]�@U��H��SH��H�R�Y�;����A�����AN�D�@�H��YH������Hc��D�< t<	u!��Hc�f��։��t;�D�H��< t�<	t��Hc����T�H���� t
��	t�Ɖ��u�A��A���u����H�KQ�8t	H��1�[]ËH���Y�H��1�[]��`,H��1�[]�A��A���t�A��A����?����ff.�f�UH��SH��H�D�YD�E������D��I��N�H��~YL���Hc�A�T�������/w)I��s#�F�H�����A�T���tb��/����	���� ���uI��/�V���Hc҄�u$�7�H���� A�Ã�	��A�u��/t���A�L���u��������\���D���t���H�Q�8t#H��1�[]��H��I���R����d����H��Y�H��1�[]��*H��1�[]�UH��SH��H��Y�;��u��*H��1�[]�@1���H�~Q��8u�H���Y�H��1�[]�f�UH��ATL�%��YSH���YA�<$�39�t��1��A9$@��H�����H��}Y�1�[A\]��UH��AVAUL�-A�YATSH�K�YA�u�;9�A��DN�t'��A�u�;I����1�A�E9@��L������H�}Y���ˋD�#1�[A\A]A^]�ff.�f�����U1�H��AWAVAUATS��H��L�-��YL�%��YE�}E�4$蘏A�$1���A�E�'�A�uA�<$9�u+H��|YE�}E�4$�H��1�[A\A]A^A_]�����A�U1�A9$@��H���U�����	f�����U1�H��AWAVAUATS��H��L�-��YL�%	�YE�}E�4$舐A�$1���A�E�׎A�uA�<$9�u+H��{YE�}E�4$�H��1�[A\A]A^A_]���+�A�U1�A9$@��H����������f�UH��AVA��AUATA��S�+A���2,D��H���+H����H�D��D���@H��H��t|�8tc�H�+�Y�8�@�H��
Q���t#H��苇H�����1�[A\A]A^]�D�����H�=�}�W���D�'H���s��������'������UH��AVA��� AUA��ATA��SH���)H���YH�H�
D�pD�hH�D�`H�XH�[A\A]A^]�ff.�@UH��AUATSH��L�%t�YM�,$M��t;L���fDH�����I�$H��tH�I�$�C��u�H�{����fDI�$H��L��1�[�����A\A]]��/�UH��AVAUATI��SL�oD�w� �0(D�pH��L�hH�@H�M�d$M��tL���t�H�x�'L��H���0�I��L�cH��[A\A]A^]�ff.�f�H��tgUH��AUATSH��H���f���H�I��I��H��u�-fDI�$H�H��tI��H���9���M��u�H�I��H��u�H�H��L��[A\A]]��>���ff.�@UH��AWAVAUE1�ATE1�SH���E�H��YL�3M����L�=�xYL�
҄YA�VA�7A����A�����������+��t^��ui����A������A��A�7I�L��H��*.L�����L�3M���z���fD1�H��[A\A]A^A_]��E���A������A������L��A�I�H���-L���m�E��������DE�fA�����A���u
H�=��YD�'A�F�Ẽ�����������H�=r�Y��Ẽ������@�u�D���-�H�J�YA�L�3L�
}�YD� �I����H�-�YI�~D�"蝃H�H�x��A�L�3L�
H�Y�����H�=��Y��E��{����H�=ݪYD�'�G�����#L�#�����L�
�YA�'����A�I�$L��H��,L���G�H���[A\A]A^A_]�H���YH�H��t;xu�"f.�9xtH�H��u��D�p�P1��ff.�@U1�1�1��H���l���H�U�Y�1�]�ff.�U1�1�1��H���<���H�%�Y�(1�]�ff.�UH��AUATA��S��H��9�u
H��1�[A\A]]É�A��D�����I���d���L��D���1�����D���1ɿ�����o���H��1�[A\A]]�f�UH��SH��H���YH�;tJf.��k���H�;u�H��Q���uH��Y�H��Y�H��1�[]�D��!H��1�[]�f���~0UH��S��H������t�����u��!H��1�[]�1��f�U�H���"#H��YH��YH���Y�PH�ɀYH�H�P]��UH��SH��H�����H���Y���YH�H�LtY�H��[]��UH��SH��H�h�YH�;H��t���H�=\�YH��c�YH��t6H�GH��G�N�YH�H�,�Y��H�;tH��[]�f.�H��sY� ����H��[]�ff.��UH��SH��H��YH�H��u�^fD�K���H�H��tKHc�YH�����t�H�5bsY���
�Y�6��t!��HtHcɀ<
u�E������E��@1�H��[]�ff.�@UH��S��H��Hc
VY�5TYH�QY�Q9�|*H��tE��H�lj55YHc��q!Hc
"YH�#Y�Q�YHc҈�H��[]�f���~Y��!Hc
�~YH��~Y�Q�f�UH��SH��H�=�~YH��t��H��~YH��~Y��~Y��~YH�;H��t���H�$rYH��s~Y� ��H��[]�ff.�UH��AUATSH��H��qY�A��A��ubH��qY���u!�~Y���H��D��[A\A]]�@L�-�}YM��t�L���|��H�x� L��H���8��H���������W�A������ff.�@UH��ATSH��H�=�}Y��H�8qY���uI�_���t5f�L�%y}Y��L�����H�x�L��H�����H��������u�H��1�[A\]�f���-}YH�.}Y���}YH��H��1�[A\]�@�}����}��i���H��pY�tAH�ZpY�5�|Y��H�
�|Y���)�Hc�1���"����|Y�	���f�UH���7������]�����f.��UH��ATSL�e�H��H��fDH������L��������tT��t"�s�����t,��t�H��oY������u�����H��[A\]��H���(�����qi��y����E�H��[A\]�ff.��~Y9~Y�����ff.�f���}Y��}Y9�~0��)��ȃ���u�f���x3��}YHc�H��{Y@�<�Ð��)Ɖ����t������}Y��������}Y9�}Y�����ff.�f��*SQ��x�= SQ�ff.�@UH��AWAVAUL�����ATSH��H��nYH�8����L��Lc�H��1���H�L��P���H��L����H�L��A��#�D��L������A���?)�I��L	�������A�L��1�L	��P���L��HcsRQL������HDž����H������������H��[��A\A]A^A_]�ff.�UH��ATS��A������D��������[A\]�ff.�UH��ATS�����5'|YHc$|Y�I��H�X9�tc�L�
'QL�zYE1�)ٍBA�<=�AO�Hc�@��H��I�8uGL�p�L9Xu:�@�;H��9�u���{YHc�L��L���y[L��A\]���f���{Y������~{YHcs{Y9�~_)Ѓ���t,���t1�JH�WyY@�<�����Mʉ
:{Y�f�H�QlY�8H��lY�
��)����UH��AWAVL�����AUATSH��8L�%FlYDž����I�<$����L��Hc�H��1�H���H�L��P���H��L����H�H��H������A������H����������H�����?)�I��L	��������1ҍ{L��L	��P���L��Hc
PQL������HDž����H���������������H�������T���I��1��!��A�Ń����������������yY�
�yY9��#)��9�}��������=�~YA�����B���������tBL�-cOQ�!f���
t+�������P���������tI�<$A�U�������
u�f�A���E1�H��8D��[A\A]A^A_]��A�>t�1Ҿ��1��z����߉�A��1����d��H����������Q��D���߉�����1��:������������{���������D��E1��8����f���)ȃ�����fD���8��������������'����H��iY�8H��iY�1���H��iY�H��iY� ����1��UH��AUATSH��H�liY�H�JiY���t���H����[A\A]]�f.������Å�u�L�%�uY�
�wYHc�wYI�$H��t89�t\�PH�
�uY�����MЉ؉�wYH��[A\A]]�D9�u�H�]MQH��hYH�H�:H��[A\A]]��@L�-�Y��A�]��u=�b�����x"I�$H���:���HcNwY;DwY�j�����A�E�
�����
�	���UH��AWAVAUATSH��8dH�%(H�E�1�H�E�H�E������F�I��L�}�A�H��H�EhYH�E�H�E�H�E��@E���v���H�}�L��L��C�D%�L��#����H���tH���t@H��t+H�U�dH3%(D��uNH��8[A\A]A^A_]�f.�A�EA���H�E�I��H�E�L;e��y�����E1�����fDUHc�H��AWA��AVI��1�AUL��I��ATSH��(dH�%(H�E�1��Z��E��~XA�E�M��L�m�I�DH�E��&�H�9gYI���@�u����#�A��L;e�tE�<$L��L��I�E�—���t�H�M�dH3%(D��uH��([A\A]A^A_]������UH��SH��H���o���H��fY�H��YH��S���5vY��u)H�
JQ� vYH�H��tH��eY�:�����H��[]镶��DH���YH�H�SfY� ������uY��t+H��IQ��uYH�H��tUH���]����fD������UH��S���H���k�H�@H��[]�f.�H��t�v��fD�ff.�@UH��ATSH��H�֚YH�8�DH�=��Y�o�oO�oW �o_0)CtY�og@�ooP)
BtY�ow`�op)AtY�o���o��):tY�o���o��H���)%,tY)-5tY)5>tY)=GtY)PtY)
YtY)btY)ktYH�ttY���������H��dY��€�>���������� ��H�QsYH�H���ML�%6sYI�<$��H�;�~H�o�YD�E���#��輵��H��H��GQH�H��t�����H�t�YH����sY�H��cYH��8����sY��uPH�A�YH�8tC�����sY��u)H�eGQ�{sYH�H��tH�LcY�:���k�����fDH�qcY�0��������H��cY��с�	��7�€�����H��gYH�8�}�����H�jcY�%�=�������fDH��gY�:���o���H�`GQ�E�H��gY�E��H��Y�
���B������DI�<$H��t�E�����I�$�E�E��$����E��V���@H�IbYH�8�	���H��bY�%��t6H�-bYH�:H���#���������۾����� ���s΅������E�辴��H�gY�E��H�W�YD�
E���������fD�ۻ�����fD苵������fDH�QFQ�H��fYfo%�pYfo-�pYfo5�pY�fo=�pYH��YH�lqYfo$qYfo
,qY fo1qYfo%�pYhfo-qYfo-�pYp fo5�pYx0fo=�pYH���`@hPp`xp��������H��[A\]ÐH��1P�A�H�=��H�����;��H��qYH�8�WH��[A\]�H��Y�8�BfH�aY���u��%=�������u��)����z���@H�ٔYH�0�a���U1�H��AWAVH�U�A���TAUATSH��(�L�����DE����H�,pY����������A��L�-�YL�%�YA�E����A�$����H�=�7�M���Y�M�H���1��
H�ljM������M�A�$�ƅ�^A�$D����~0A�]���@L�-}�Y�����L�%m�Y��A�E����A�4$H�=pY��H�=T�A������A�$��A�]����E���E�}E����H�=�oY�<H�=����A�4$��A�E���A�$P�P��_A�E��P�u��]�E���H��nY����nL�%��YL�-��YA�4$A�]���fA�߅��U�����~�����WH�VCQ�A�$��u��A�$A�EH��Y�H��([A\A]A^A_]�@L�%9�YL�-6�YA�4$A�]���������u�E1����fDH�=:�XH��to�
1�H�����A�E�Å������A�4$�T���f�A�4$�����D������A�E��~0�����f�A�4$����A�]�f.�A���H����L�%i�YL�-f�Y�����A��A�$����A�E�����q���D��A���D���A�4$D�����1�A���L���H��tH��Y��H��tH��Y���ff.�@UH�`]YH�8H������1�]�����H�1]Y���u�f�UH�0]YH�8H���������a���H�RAQH�����H9t]����]隿��f.�UH��AWAVAUATSH��(H����H�_�YH��L�%M�YE1�H�H�L�YI�$H�H��\YH�8H��t���A��H��H��HD�H��@QH��lYH�
����H9
�2H��tH�����H�=�lYH��t����H���YH��@QH�klYH�E�L�5��Y��H�QlY����A�������H�,�YH�lYH��kY�H��$I�$H�j�YH��kYH�H�i�YH��kYH�H��YH��kYH�H���YH�4kYH�H�ƐYH�kYH�H���YH�kYH�H���YH�kYH�H��jYH��jYH��jYH�kYH�kYH��jYH�}jYH�v�YH���Y��jYH�H�KjY�H�:+P�H��>QH�H��*PH�H��*PH�H��(1�[A\A]A^A_]�@1�D���������\�O�hA��B���DH���H�=hjYH����H��H�E�������H�E�H���OH�E�L���DH�;H�u�H��L�s��4��I�I9�u�H�%�Y��iYH�1�H��t�H�G*PI�<$�H�a�YH�H��)PH�H���YH�H��)PH��RH�=ۡ�F�����H��=Q�H�ΎY����4H���Y����#H�ԎY�H�:�H��hYH�=����������x�iYL�=_aH���PH�1,QH�=�hYL��L�#H���E��L�5�bH�=�hYL����E��L�-OjH�=�hYL���E��H�5iiH�=�hY�E��H�5FkH�=_hY�E��H�5CkH�=<hY�E��H�5`{H�=!hY�tE��H�=�PH�=VhYL��H��[E��H�=<hYL���LE��H�=%hYL���=E��H�5�hH�=hY�*E��H�5�jH�=�gY�E��H�5�jH�=�gY�E��H�5�zH�=�gY��D��H���PH�=�gYL��H���D��H�=�gYL����D��H�=�gYL���D��H�5chH�=�gY�D��H�5@jH�=YgY�D��H�5=jH�=6gY�D��H�5ZzH�=gY�nD��L�#����fDH�=θ��������������H� I�$���1�D���F��������H�9gY���@A�����������H�=�&E1��aPL�%R�YH��H�P�YI�$H�H�B�YH�H��VYH�8H����������H�=��\�����t�����fYH�wfYH�tfY�Y�������H��H�|fYH�mfY��������H�OfY���f.�H�A�YH�:����H���YH�8�������f�UH��ATA��SH��H�:Q�;�tVE��~AH�.�YD� ��~ZH��Y��2��t�0H�ʊY�0H��[A\]�����2�ݐ��~�H��Y�H�	UY�u�H�8�^����u��H�ŠY�2�ff.��[���ff.��ReY����U�@H��AWAVI��AUL�-��OATE1�SL��H��D�?�fDA��H��A��t:H��A8�u�H�;L���L����u�I��K�D%H�H��[A\A]A^A_]�DH��1�[A\A]A^A_]��1��ff.�f�UH��Y�H�ۉYH����]���1�]�f�UH��SHc޾H��H��H�5�YH�����H9�uH��[]ÐH�Y$P�
�H�=��H�H��[]���f.�UH��AVAUL�-��YATA��SI�}H��t:E��~&1�L�5���f�I�}L�����L��A9�u�[1�A\A]A^]�@E��~�L�-��Y1�f.�I�u������A9�u�[1�A\A]A^]�ff.�@UH�H�Y�
H�0H������1�]�@UH��SH��H��RY���tzH���P���t<1ۃ�t
H����[]�@H�=cYH��tH���{��H����[]�f�H�	#P�H�3���H�;1��2���H����[]�f�������f���bY��t&H�=�bYH��tH����	��f��ff.�@��u$H�=bYH��t$H�Y������H�=bYH��u��ff.�H��aYH��t4H�
�aYH��t(��uH�}�P9:tH����uH���q�����H���`��UH��!PH���H���H�81�H����������f�UH���w���H��t]�H�=l����@UH��H��t�r��H��t]�H���@�����H�=B����f�H��t�ֿ��fD�f.�DU�H�����H�SaY�@H�H���Y��PH���Y��P�#aY�P�aY��t�@]�ff.�f�H��WH��`YH�l�Y�H�o�Y�W��G��`Y�Gt
��`Y�@H�E�Y�H�0�Y��ff.�f�UH��AVAUL�-�`YATSM��tQI�]H��tHI��E1�f�H�;I������H�{I�����I�]�A�E�H��u�[D��A\A]A^]�DE1�[A\D��A]A^]�f�H���Y��fDH���Y98|%��x!H�=`YtH�p�Y�8���1��ff.�f�H��_Y��H�9�YHcH�;�Y;tH��_YH��tH���f.�1��ff.�f�H�
��Y1����t��H�o_Y�Hc�H���ff.�f�H�ɄYH�
΄Y�;t���H�8_YH�H���f�1��ff.�f�H�%3Q+8H���Y98~��xH��^YH��tHc�H���@1��ff.�f�UH��ATSH���H��H�u����I��H��tH���D���H�x����H��H������H��H�]��~E�L��I�D$E�A$H��[A\]�fDH��tH�H��tH�_^Y�8t1�ÐH���
1�逾��UH���YH��ATI��SHcH�^YH�\�H�{H��t�b���L��蚶��H�x�!���L��H���V���H�C[A\]�ff.�f�UH��ATSH��t4H��H�?H��t����H�{H��t����H��L�c���L��[A\]�f�E1���ff.�UH��AUATI��SH��XH���YdH�%(H�E�1��X]Y��tH�͂Y�;��9]Y������H�9��T���1�L�m��t���L��@L�ɮI����?1��Q���L��H����������!�%����t������D�H�WHD���@�H��L)�H������L��H������H��\YL��H����1����HcH��\YH��HcH�D�H�E�dH3%(��H��X[A\A]]Ð�F\Y2���l����H�7\Y����f.���t�H�\YH�8H��t�8����H�\Y1���~f�H�L�H��H��9�H��/Q������2H�=�[Y��[YH�H�4������H��[Y�����>���ff.�UH��AUATSH��H��t^H��H�?1�1����L�cI��M��tL�����H�x���L��H��跷��I��M�eH�CI�EH��L��[A\A]]�f.�H��E1�[L��A\A]]�ff.�@UH��AWAVAUE1�ATSH����x~H�m�Y98~sHc߿I��I�����L��I��H��ZYL�,��T���H�x����L��H������M�~I�M�eL���-���H�x���L��H�����I�FH�vZYL�4�H��L��[A\A]A^A_]�����|uH��Y���th9�~dL�;ZYM��tX��yZ�������teD�P�A�����1��
�H��I��H��tH;qDD�H�HI9�u��uE��xMc�K��H�P�DHc�I��H��t�H9pt��D�x�1��
�H�HH9�tH��I��H��t�H9qu�H�Q������ff.�@��xDH�5�~Y9>~9H�bYYH��t-Hc�H��fDH�L�H���H��9������1��DUH��AWAVAUATS�H��L�=�~Y��I�E�7A9���A)މ}�E1�A�F�L�,�DH��XYJ�< I����M9�u�H��,QA�D�E�H��XYD�0)�E����Hc�H�<�H��H��H�B@��H9���@���A������1���H����oH��H9�u�ރ�9�tH�H�‰�H�…۸O�Hc�H��H�A�H��}Y�XY�H��}Y�H��[A\A]A^A_]��1��@1�fDH��H��H��9���ff.�H�-}Y��WY���t
��WY�f����ff.�f��~WY�f�UH�pWYH��ATL�%�|YS1�A�$��~#�H�<��w���H�HWYH��H��A9$�H��|YA�$�[A\]�@UHc�H��AWA��AVAUATSH���H�UȄ�t*D��I��H�=��I��D����H�U�H��tA�D$A��H��D��[A\A]A^A_]ÐD��H�=s�H�U�轮��H�U�H��t<A�L8�����&���>���&��E��E1���$t@�fDD��H�="�H�U��e���H�U�H���A�GHc�A��A�\���Z���H�A*QL� �F@E��uc��L���!���H���5�����H�=çA������H��DE�Ic�A�\��������\u�A�GA��A�|
t�A��'DD����A���A9�DD��fD��$������<uA�D<-t<<uA��E�|$����؃�<<�����(����؃�<<t�A�G��$�r�����E1�����ff.�UH��AWAVAUATSH��HH��������� ��M�t�����D�E���RE1�H�U�E1��u�E��I��H�}��E�H�E�L�e��H�EȉE��E�A��	t
A�� ��H�}�Ic�A�WH�D)�@D�D�,I��E����H��A�� t�A��	t�H�qTYD8��L�u�D��L���5���A��D9�����Lc�D)�M΍SHc�HcҀ}�t�E�D9�|A9�~	H�E��M��D�m�A��D9m���H�E�H�M�H��L�,�N�)L�]���H��L��H���I���L�]�H�M��I�J�D)E�H�E�E�����H�E�H��H[A\A]A^A_]�@H��'QH�H��H��uFMc�E��1ۺO�4�;����E�
Hcu�H�}�H�U�H����H�U�H�E��C���f.�E�}L��Ic�M�4H�\A�6@��tnI����H��H�[�s�A��@��t,L������H��u�D��H�E�Mc�D)�SN�4Hc�Hc����D��I��D)�SHc�Hc����E��M���B������r���H�E����f.�UH��H��AWAVAUI��ATS��H��H�U�D� H�E�H�u�H��L�E�dH�4%(H�u�1�D��H�E�H�E���sIcĉ�M�tH�E�I�ǃ�A�@�u����l9E��}D���4DA�>\�Su��C�D=;E�D�Lc�O�t=A���tH��;E�ty�4���H��v�H��RY���u�H�u�L���r���~�Lc�O�t=A���u�DA9�|D�}�u>1�H�u��H�}�dH3<%(��H��H[A\A]A^A_]�A9�|1��}����׉U�D)��Hc��\��U�A9����H�M��D@�|0�E�ĉ�H��A9�}=Ic�H�M�A�|
E�D$@��\u�E�L
D;M�u�Mc�C�|E�D$�f�Hc�H��H�u��>A�>�,������$����}�t���D��1�H����D��1���u���D�����H��1������fDUH��AWAVAUATSH��HH�u�Hc�U�dH�%(H�U�1�H�P$Q�8��H�ȍII���M�Hc�H�D�9H�M�D8��`�A��-�9A�G�<	��E1�A��?u�E�HcE�A�L�H�E�D�8E���[H�E�D�e�H�]�H�E��o�A��:wH�L���VH�WPYH�8H��tA��莧��H���5�;U��)��
� A��Ic�L�D�;E���I褥��H��vH��OY�����E���t����<
t<?u�E��D+}�A�Hc��&�Ic�I��E���A�E1��;?��A�H�E�D� A�}�H��NYH���pL���
���H���E���H�x���H��H������L�%�{I��E��H��sYA���!���E�������t��������L��A�ԉƅ�y�H��sYL���蒬��1�H�U�dH3%(H����H��H[A\A]A^A_]��E�1���H�fDA��E�|��A���|Q�H��A�WЀ�	v�H�E�D����t{��H��t�H��@��������E�H�H�D�8H�E�A�G�<	������f�H�E�D��L��H�H���'oH�u�H����m���E���F�d ������H�e!QH��rY�)����j���DE��D+}�A�Hc��M�Ic�I��E��uBA�EH�E�D� L�%?z�s���f.�E��D+}�A�Hc��
�Ic�I��E��tf�H�u�H��L��H�M��=���H�M�I�D
�E��t�������u����I��H�rY��E���H�=�LY�u�H��t�ͪ���u�H�={LYL�-|LYH��t�u�诪���u�I�<$H�U�1�����I�ŋE������M����Hc�M�t���~1��I�|�H���b����E�9��H�I�|�I�\�H��t��;���H��H�{�H��u�L���&���L�5�KYI�$���fDL�%�x����@H�%qYH�u����
H��Q���|��l�H��������<���L���Ʃ���E1�뙿��H�]�D�e�I�����H��pYL��H��pY�苩���������1Ҿ����1���f�UH��AWAVA��AUATS��H��H��(����H����H�8I������DH��H�pA��I�|�u�E��C�|7�D��H���A�|�A����H���A��$tqA�vA9�A��A����$D�9�s
E��u��x9�~[E1�E��t$A�G�L��M�t��H�;H��謨��L9�u�L��蟨��H��(L��[A\A]A^A_]�DE�w�D��E1��@�$Hc�1�H�E�I��fDK�<�U�I��萢���UȍTA�E�A9��zHc���I���D9�|B1�1�H�]��Hc�I�4�L�U�����I�<�H���A����U�C�A9�������A�F�]�D9�AO�1�1��E�H�E�I��H�E��D�]�H�E�L�U���H�0踥��H�E�H�8�ܡ���U�H�E�ЍPH�Hc�A�D A�D=;]�|�Hc�H�E�D;u��B������1�E1��8���E1�������I����i���f�UH��AWAVAUATSH���H��P���H��@���dH�%(H�M�1�H����H��Q�8�V���L��P����L��H�E�����H�QH��H�E���t���A�:�v�{Hc��k�L��I��H�OQI�}�A�EA�E�:sfA�E耤���؃���t�������H�E�E1�E1��E�Dž4���Džp���Dž0���Džx���H��8����F�E���D9��YA�GH�u�Ic�A��Džx���Hc�A��D�$>�D9�t����
D��x���Ic�E�dE��u��˝��H��vH�HYD�E���Z	H�\QD: ��H�?GYD: t$A��"�
�A����\A����2
Mc�E��t'C�t%�@���kH�QH�8���H���S��t���D)���Hc����K�t%H��H��迣��H)�E�$D;e��~Ic�H��H}�E�����H�������t���D�pD9�t��������DH��@���H�]�H�L9�P���tL��詤����p������u
��0���1�����H�]�dH3%(��H���[A\A]A^A_]��A��'�NA��\��E���D9���H�]�Ic�A�GA��Džx���A���\Hc���/����Mc�K�\%�3��tqH��QH�8貝��H��t]�E���D9��
H�]�A�GIc�A��C�T%A�Lj;Hc��������E�@H�}�Hcu���H�E����fDH��8�����H��H�D�u��H��`��������m���Hcu�H��vH��EY�8���O���*1�H�u�L���l�D�U�I��M����Ic�D��1�L����:uA�JHc�A�T���%�
��*�-��$����-����^���r�@��	�������A1�H�fD���|J�A�T��H���r�@��	v�^����*����-�K�M���L��D��h������D��h���H��I���
H�#DYI9���L���r���H�x��L��H���.���L��H������DžX����E�Dž\�����(���A��H�E�Džp���Džh���H�� ���Ic�A�|:��DA�D<g��<a��<GuDžp���A��Ic�D�u�A�D�Pڀ�R��H�
���Hc�H��f�Dž\���xA��f�Ic�D�u�A�|:t���\���A��D�u���t@��q�Y��\���x��H���Q���H�x���H��H���
���I��H��L�����H���'������yL��`���H��L���ܞ��H���Ġ����0���D�u�A�<$t0H��`������E�$D;e���H��`���Ic�H}�E��蒞��H��`����v���1���X�����A����p����y����/H���{���L�`H��twL���z���H�x��L��H���6���H��I�������E�L��D�p���@�.H���+���H��t+��E�D�p�����.H������I��H��u�A���r���f�A��<s�<L�����A9��S���讗��H����H��AYD� �E�E����Hc�E�d��H�� ���1�D��E�L�(AYL��1��r�I��H����H�=AYH��t�5���L�5AYH�=�@YH��t����H�� ���L��1�D��L��@Y����&H��H��@Y詘��H���lD�
�@YD
�@YIc�D��H������D��@YL��@YI��E����D��H���D��,���E1�1�L�����M��H�����E��L���6D��\��E9���A�Ic�A���D��D95@Y�Hc�D�pA���&u���?YB� D9���Ic�H�5�?YH��!���D%�?YD���D��X���A�����Dž\���qA�����D�/H�����H��������DE���!A�: �u��A�w�A�rHc�H��I��L�襘��fo}�fE�fH�tory modI�NH��`���A�FifiefE�~AF�L���H���D���H��@���H�}�L�0�1��������L9�P��������L��E������E�����@Džh���A��Ic�D�u�A�D�`�����E���D9���C�t%A�GH�]�Ic�A��A��@�4Hc������f���H�=��Q���H����A�FH�u�1��E��E�H�1QH�}��E���E��E���D�U�I���&���H�M�f�H�}�A��H��H��h���H��H��`���D��\���I��D��X���I��H��)E��A�$H��h���H��E��H���]���uE�wC�D=I��I��L9�`���u�D��\���D��X���H��h����
H����������!�%����t������D�H�rHD։��H��H+�h���H�������}�D�E��9�|)��Ѓ���H�}�Hc��1��H�E�H��h���Ic�H}��:����]���D��L�ھ$�$D��p���L��h����M���L��h���D��p���I��H��<YI9���	M�������L��L��h�������H�x���L��h���H��L��趘��H�����fD��#�-���E�VL�]�D�U��Y���fDD�u�D�
9<YE���q
H��D��H���蕔��D��H���A9���E1���L�����E��D�����I��Ic�DžH���Dž���E����H�5�;YI�<�8�VE�fC�,9��D;�H���~bD��p���E��tVIc�A���t-< t<	u%A�VHc�fDA�A�Ԅ�tH��< t�<	t�D��L����,�������,�����H���E��Ic�E���`�����,;Y��,���D)�xA��Hc����H��L��H��I���\���Hc�:YH�5�:YI�<�E���Hc5�:Y��,���Hc=�:YA�6H�)�H�L�Hc�L�����Mc�L��C����D��h���E���w��p�������D�����L�����L�㉅h���D�u�����f�IcՉ�,����2�����,����������������+�4�����4����E���D9���H�}�Ic�A�GA��A���"Hc���T�fD�E���D9���Ic�A�GA�t�H����D��4���E�fE����H��9YD�E����Ic�A�D���
<'�A�FH�f�A�TA��H����t��'u�D��D)��Hc�L�C�H��L��h����[��Ic�H��I�t
H��H��H��x���莒��L��h���H��B�蚑��A�;]���	Ic�L��x���H}�E�t$L���B���L��A���'���Džx����6���E���D9��)Ic�Ic�A�GE��A�LH�]�A�LjHc������E�@H�}�Hcu����H�E����fD��^����$�M��+��H���Ȑ��H�x�O��H��H��脔��H��@���H�1�����"8YL��M��E�t�芐����h���D�-8YDž������5���1��QHc�A�D�p�@��	����1�Lc�D���tP�C�D
D��I���HЀ�	v�$��9���	��Lf�L�%�7Y��D��h����M�M���-L�����H�x�r��L��H��觓��D��h���I���>���}�D��)�����H�}�Hc�E��O��H�E��X�fD�E�@H�}�Hcu��/��H�E��e���fDH�E�����L��E1�E1�1�L�u�M��I��L��x���E��I���k@A��\�S��D��t
A��"�lH��6Y���t*A��"��E��u
A��'��A��\���Lc�Hc�O�,<A�E���$蜌��H��vH��6Y����%H�"6YG�L<E�m�E�Ȅ�t	D8�� H�

QD�8E8��D���E��tH�
QD��H�8���H�����S�l���@A�T5���'����"�����1�L���I[�M������H�A�T��'����"��������L�ھ$�D��h����M��)�D��h���H��I���<��L���I��D��h���� �<$�X�U���������DH��x���L���QU�������������tFC�D<���������H��QD��`���D��h���H�8辌��D��h���D��`���H�������H��QD�(1��w���h���L��L�����D�����D�u���Džh�������H��YYH�H������L��Ѕ��Z���H��P���H�
)Q�D�)D8���E�L��P��������H��@���H�M�H��1���f��D)�A���h���L��M���E���D�-�3YD��H���Dž�������fD���Hc�A�T�>�f.�E8�t
A��'�	����S����f��E�@H�}�Hcu����H�E��I�fD�E�@H�}�Hcu��_��H�E��E���fD�E�@H�}�Hcu��?��H�E����fD�U�E��D)�Lc�A�|$Hc����L��H��I��H���6���K�D&�erC�&:C�D& fo�f�PH��`����@�����D�E�@H�}�Hcu����H�E�����]�D��H�}�)؃���Hc�E����H�E������Q����U�����E���9����SA������H��`���Hc��C��H��`����i�H�}��>���H��P���H���o���H�x���H��H���+���H��@���H�1��}����$�M���L��8����pL��L���5SHcE�L��I�|��Q���P�E��N�A������A�|&�5�Ic�D�p�)�E�H��H��H���Ic��s��L�=L1YH��H���H����H�
'QD�)���F�,hH��Ic��>��L�=1YH����I��M��Ic�L�����H�����D��,���L��L��L��H�������L��H���D�%�0YL��0Y�~�E��l�Hc�A�<'�)������C��H���u�������'tA���H����u�����H�=t0Y�h�L�5O0YM��t
A�>���B0Y�C�H�ع�!��r�@��v�� u����H��t���t
��'uڃ���Hc����H���'I��H�p���tH��<'t8�P���v< t�H��H��uڿ'f�>����'�A�H���F�'�F���'\''H����H���uI������M���H�}�)ȃ���Hc�E����H�E��G���H��@���H�M�H�1�L9�P������L���o���Dž0������D��(���D�e�E)�A�|$Mc�Hc����Ic�I��L�L��L���N���K�D&C�&:fo<�C�D& �@ledH��`�������H�������D��(���D�e�E)�A�|$Mc�Hc����Ic�L��I��L�H�����K�D&H�titutionC�&:C�D& fo��H�xH��`����@舌��H��而���7�HcU�H��E�d���D��D)�{Hc�Hc��%��K�t%H��I��H���b���fo�A�:A�D H��`���AD�������D�����E���4�E��D+�(���Mc�A�|$Hc����Hc�(���I�����H��P���E����l���E1����L�����H�x���L��H��踉��H��H�v-Y�م���_-Y�`��Ɋ��f�UH��AUATSH��H��t.H��覅��H�x�-��H��H��H��[A\A]]�X����H�={B�I��H��tTH���d����x
Lc�Hc�I�\$����L��H������H�.historyB� /H��H�H��@H��H��[A\A]]��A��L�-���ff.�@UH��AWAVA��AUATSH��(���1�����������AH�E�H��1���迏������FA��H��QYD��D90N�]����I��H�mQY���)�9��SH�,YD�:E���0��Hc�E1�)�M�$�H�DI���I�$H�yH��t�?tH�M��%���H�M�E�|H�9I������E�|I9�u�Ic�H�E�H������H��H����H��PY���+u�9�~\H�v+YD�"E������Hc�)�M�<�H�DM�4ƐI�Ic�I��H�H�0�k���I�G�H�8菃��D�D�`H��
M9�u�H�U�H��D��E1��˂��H��y��D� H������D���N���H�}�����H��(D��[A\A]A^A_]���Hc�)�M�$�H�DI��I�$I��H�8����E�|I9�u���f���Hc�E1�)�M�<�H�DM�4��4fDH�1I��蔆��I�G�H�8踂��D�D�`H��
M9��%���I�Ic�H�H�qH��t��>t��V���I�H�x�z���D�D�`H�Ic��
I�H��f�H�}���������D� ����f.�����H�}�D� ���D���'�������f�H�E�H�}�����ff.�@U1�H��AWAVAUA��ATS��H��� ���1���I��H��1��܌������H��@����ƿA��莈������UH��p���H�����H�zH��8���蔈��H��8���H��I����H��D���f�������D��H��8����O���H��8���E��Lc�DH�M���~hM9�scH��(YL��L��1�D��DI9�@��9���@��tG�H��<
u�H��D8t܃�����s~��L�����葆���uL��1�f.�H�_E1�I9�w
�Ff�H��L9�s;�{�
H��u�H�S�H9�s
�{�
���C����u@��A9�~H��H��L9�r�L��1��"���L������H�ĸ��[A\A]A^A_]�fDH�5�'YL��8���I��:t�H��(�����0��������0���L��8���H��(�����M��t�L��H��0�����8������E1���8���H��0����V���苅����g�����K}��D����訌��L���`����A����C�������}��D������D��o���L���'���L����������f.���|�����tD���=���L���������D����#���L���ۄ�����fD�����1�����@U1�H��AWAVAUATS��H���#���1���I��H��1��߉������VH��@����ƿA��萅������G��X���%�=��IL��p���I����`I�臅��I��H����L��D��H���]���D��I���R���E���Mc�K�|5����xI9��oH��%YH�����H��9
u	1�8��)�H�q�H�υ�tI9�r�L9�vZH�g%Y��fDH�~�H��I9�t<H���>
u�8t�H�^I9�s'���L��1��È��A�ǃ�����1�L���V���L���N���H�Ę��[A\A]A^A_]�f.��z��������z��D����Q�����D����;����f�t��z����DD��������z����m���H��L��H��D��L)�1�H)��G|��D���߉���<���f.�D��1��Ɖ���+���H��H�����fD��1�H����1����H��IY��01����f.��UH�=hwH���
H��t[�8tV1�H������H�����1҄�t0��C����P���H�=1wH����€��҅�up��]�fDH�=w�H��t�8u�H�=�v�H��t	�8�z���1�1��W��H�e�H��HD�1�H���?��H���c���1�]��Àxt�H�+Y��H�-�P�H�Y���]�f.�UH��ATS���H�qFYH�#Y�#Y�3�5#Y��t9��"YL�%�"Y��9�}4H��YA�$^I�|$HcH�0��{��HcA�D[A\]��fD��L��5�"YHc����I��H��"Y��UH��AVAUATSH��t�?H��tw�=�"Y��xm�A��A��xL����D��A�������t8L�%�YA�$�;^�D��H���NA�$$�������u0D������#�>E��H�[EY��,���[1�A\A]A^]Ð�k���D�����q������tĉ�!Y�Q����=�!Y���T������L�%��PI��A�$��u}H��DYI�}1���	 ��A�$��tOL�%�!YI�<$H��t�H��DY�I�$�H��DY��}D��[�A\A]A^]���3���몐������w���@H�{D����M���ff.�@UH�8DYH��ATS�W4H��H�=� Y�H�0DY���u&H��th�C���sTH�=� Y[A\]�)���f��C8�� YH��t�~��H�~YL� L����x��H�x�R���L��H���|��H�� Y�k����蔼���B��H��Y� ���������[A\]��UH��AWAVAUATA��S��H���}�����sL�- YD��
 Y�]E1���{�����A��聿����t:H�>Y�A�}^�uD��L���L�#���������D���C���M���H��BYI�>1�����H�z�P����LL�%�YI�<$H��t�H��BY�^YI�$��H��BY�H��1�[A\A]A^A_]�@諾��D����豾������e����Y荾���=Y��萾���۾����I��聾��H�=�YI�H��t�8���m�H��Y����L�-�YD���Y�����M���������ͺ��H��AY��Y�H��AY�H��AY�H���[A\A]A^A_]��I�}D���4K����H��� ~�����a����m����+������fD��t\UH�d
YH��ATA��SH���H;O�OtH;f�Ot�����Y��t-1��؅�@���1Ít6���[A\)�]���D1��DD���[A\]�f.���t\UH��YH��ATA��SH���H;��OtH;��Ot�?����mY��t-1��؅�@���1Ít6���[A\)�]����D1��DD���[A\]��f.�UH��AWAVAUA���ATA��1�SH�����H��A���u�H�C8D�kT�CP�aH�bYE��L�-$@YH�H��YH��H�
@YA�E��:DD�D���@��H�=<�I��H��1��=��L���zz��L�%�YA�$�Ѐ�A�$H�GYH�1�����L�{\� ����!���H���P�H��� ��A�ƅ�t>��
t9~b����~'��tƒ�u\A�U����D����0�f���
u:H��1�����A�ŸE����H��[A\A]A^A_]Ð��t;��t���t1�q��H��v
H��Y���tyD����,&�F����蛷���v�>���C0�S4A�EH��>Y��=��A�$$����H���[A\A]A^A_]�D���Y������@L��������1�H�����H��YA�$$����H�1�A��������f���?��E����ff.���/������E��{���ff.�UH�=�YH��H��t����]�������蓶�������]�ff.��UH�=`YH��H��t��������]��������S��������]�ff.��UH��AUATI��SH�������
����~>���E����ur��軈��H�L�P�H���[A\A]]�f������t?����o��H��vH��Y�����޿�!$����u�L�-�<YA�U��tt�޿��-�x�����
u�L��1��1�����y�H��[A\A]]�1�L�����H��YH�H�QY� ����1�����H��[A\A]]����<��A�D$0A�EH�<YA�T$4��
;��H�Y� ������fD���щ�����@賴����;��A�T$0H��;Y��f�I�|$\�&����UH��SH��H���p��H�<�����H�P�'�f�H��H��t(��΅�t@�2��'u�\'�B'H��f�r�H��uع'f�
H��[]�ff.�@UH��AUA���ATA��SH��胵��E��H�
��H��H��H�����1��pq��H�޺H�=a��|x��H���tu����:���E��H�
@�H��H��H�����1��'q��H�޺H�=���3x��H��H��[A\A]]�!u����u��ff.�UH���o�����t��H��tH�@ ]�DU1�1��H��S��H���y����x*��%u
H��[]�H���߀�[1�]��x���������f�UH��AWAVAUATSH��H�����?~H���:�GL�o����</���n��H���%����SI�Ā�/�}���u��	fDH��A�T��L�,H�H��t��/u�I�D��H�,YH�H��tL���I��H����L��E1���p��H����L����s��H��L��[A\A]A^A_]�DH�=�*���H��H����L����m���;I����H����m��A�|I��Hc�Mc��A���I��E����H��H���jq��K�<&L���^q���z���f��{m��H�x����H��H��H��[A\A]A^A_]�)q��f�H�)YH�H���}L���I��H��tpL���(m��A�?I����xHc�蠲��I��L��L����p��L���r������D���H��H�������L����l����Hc��\���I��H���+����H���l��H�x�?���H��H���tp��I�����@L���l��A�?H��tgL���l���|H�E�Hc����H�U�I��H��Hcڅ�tL���&p��I�<L���p��L���r��L���q���&���DE1�������xHc�襱��I��H���DL�����L���k��A�|H��Hc��x���I�ƅ�����L��H���o��Hc�L��L��o��L���|q�����H������ff.�@U�~H��AWI��AVAUATSH��X�k��L��H���wk��H���>��Hc��E���H�E�A�1ۄ��fD<~�H���PL��L� �.k��I�ʼnE�M��������I�$�]�E1�L�e�H�E�A�E�H�E�L�m�M��K�/D�m�H�E�H�E�L�pH�E�I��H��u�	�I��M�f�M����L���j��H�}�L��H��H���k����uыE�I�ދ]�B�D0���E�Lc�U�O�,7��9M��[Hc�H]�L��L��H��H�]��?k��H���PL��L� �Mj�����
A�}/�D�p�M��L�m�M��I�FA�H�E�E�F�M���%I�]H���M�eL�m�E����I��I�\$�H����H����i��H��L��H���(j����u�D��	]�L�m��Eą��WLc�O�|5�{Hc��,���L��L��H��H���kj��B�3H�����H��I���3o��L���ki���Mȍ;]���Hc}�L��H}��m��L���o��A�����M���]�E1����E�9M�������E��M�H�}��D�p�E�Hc�豮��H�E�����L�m�E��I��L9u�twA�?/I�FtmI�����DI�EL9m�t6I�����fD�U�H�}��D�p�E�Hc��G���H�E��2���fD�]�L�m��B�+Mc��E�O�,7�����D��L�m����@H�E��H�E�H��X[A\A]A^A_]�fD1��w������Hc��E�貭��H�E����f�H���P�:@B	1��fDUH��4Y��H���XH���迫����1���2��H��X� �����]ÐUH���/��H��4Y�H���X�]�ff.�UH�=�bH��SH��H��P�0H��P�01��&0��H�g�X�@觔���#�H��[]�ff.�f�UHc�H��AUATI��H��SH��H�ҐPH�8uH�
�H9H�D��H�
�3Y@���FЋ��	wAH�5��XH�=�PD�E��tD�G��B�@������H��[A\A]]���-uCH���X�0��u6H�3�P����H��P�����H���[A\A]]����tH���P�8���N0���)1��L�-J�XH�3D��A�e�����V��A�U���a���H�2Y����E�u?H�@�P��E��@���fD��t3L�%�XA�$�tYH��2Y�1�����1�����f�H�U�P� ����@H���X����D�����9���@��@A�$�̒��A�$$�A���o/���J0��A�$$����H�3H��[D��A\A]]��U��ff.�f�UH��SH���r���H�ǎPH�,�X� 1��t.H��[]��{�����x7��H��1Y�81������~�t�������tи��f��n��������@H�Q�P�H�H�P�H���X�H�z1Y��ff.�UH��ATA��S���H�r�X�tBH�C1YD��81�����H��PH�=B_�0H�ԍP�01���,��1�[A\]��D���(����-fD�{�����x7��H��0Y�81������~�t�������t�[�A\]�fD�m��[�����A\]ÐUH��ATA��S�!���H��0Y�Ë�u"��D��1��V���[A\��]���������v-���Q.��H�r�X�߁ �����m���[1�A\]�fDUH���'����".���}���1�]�f�H��t;UH��SH��H��H�?H��t��h��H�{H��t�h��H��H��[]�h��fD�ff.�@UH��SH���b���H��
YH�;H��t���H�H��[]�UH��ATS�4���H��tMH��YH�H9Xt=H� �XL� 谩��H��L����î��H�8H���h��H�{H��t�
h��H���h��[1�A\]�ff.�UH��SH��H�
YH�H��tHH�81��H�;H�LYH�WH�����H�	-YH��H��,Y�H��1�[]�fD軥��H��1�[]�f�UH��AUATSH��H��	YH�;tH��1�[A\A]]�f������H�H�$�XL� L���qa��H�x���L��L�+H���*e��H��YI�EH�H�H�@H�PH��1�[A\A]]�UH��SH��H�	YH�;H��t��H�H��1�[]�U1�H��SH��H��H�?�jH�SH�'YH�5��PH�
�+YH�H��+Y�6�H��+Y����u��H��[]ÐUH������2����]���1�]�f�UH��AUATS��H�����Q��L�-D�PA�E��������E1�����I�ă�t����H��u�L��M����H��1�1�����H�Y���uIH�+Y�H�

+Y�‰H�5��P�6��uZH���PH�=��PH98t�H��1�[A\A]]�f�H��*YA�U����t�H�
�*Y9���H�5L�P��‹6��t���u�9кD�H�x*Y�H��1�[A\A]]�f�H�m*YH�
j*Y��	��uJ����A�U���f�����H��1�[A\A]]�fDH����[A\A]]�7�9�D�뷉���f�UH��S��H��� ���H���ލx[]�P���UH��ATS������u
[1�A\]�fD����L�%��PA�$������蛦��H�����u�H��1�1��q���H�bY���uLH�u)Y�H�
h)Y�‰H�5��P�6��u]H���PH��PH9�o����1�[A\]��H�))YA�$����t�H�
)Y9���H�5��P��‹6��t���� ���9кD�H��(Y�����D[��A\]�5���DH��(YH�
�(Y��	��u*������A�$虥��H��������K���[1�A\]�@9�D��׉����f�H�	�P�8�fDU�H��S��H������H��P�޿��j��H��1�[]�@U��H���P�H�����H���PH�B�PH�1�]�ff.�H���XU�H��t/1���~1��R���1�]�fD��>���1�]�f.�H�9�P1��8������1�]�f�UH��AWAVAUATE1�SH��H�����?��I���B\��H��A�ą���H�E'Y�0H���X�<;8��L�5&'YIc>9���Hc�L�=��XMc�)��I��H�H��B�
Ic>�9�~�L��Hc�I?�\��H��XA�6���u,��uH��XH�H��t�xtW�1ɿ��w��A�6H��&Y�A�6�I�Hc��H��D��[A\A]A^A_]�fD�3f��H�d&Y�0�,���9pu���+P����V�P�fDL�=��X�H���ff.��UH��AWA��AVAUATSH��9�~����A��H�&Y�D9�}9�A��O���A�D��DI�E��D��E)��Ne���D)�D9���L�5Q�XIc�Ic�M�M�0E�E�0D�H��E)�A9��H��X���u4H��D��D��1���v���I�D)�H��H��D��[A\A]A^A_]�f�H���_����fDL�5��X��H�-%YH�*%Y�
�9�~*���tH��$Y�
9�}��@��y��D��y����@UH��AUI��ATA��S��H���z���sD�����H��$YL��D� �)������z��H����[A\A]]�DUH��AUA��ATI��SH���hY��H��H���X9~:H���XL��H�8�]��H�Y$Y�E��u*H���[A\A]]����fD���c������u����f�UH��SH����xCH�$Y�t%9�)��H��1�[]���赜�����y��H��1�[]�H����[]�UH��SH����xcH��#Y�t,H��#Y��:��~H�
&�P�Ƌ	������)Ή�9�|�:��y�H��1�[]�f��
�)������DH����[]�#���UH��AUATA��S��H����U��H��tcH�,Y���uV����t?L�-�"YA�E��~UL�%~�XfDI�<$��ƃ���$��~����u)A�EH��1�[A\A]]�H��D���[A\A]]���@A�E�k���H��1�[A\A]]�fDH����D��[��A\A]]�f�UH��AVAUATA��S���U��H��t%H�^�X���u����u&[1�A\A]A^]�D���[A\A]A^]�^���fDL�%"YL�5��X�ڹA�4$I�>��!L�-�!Y��A�u9�|
H�s�P���tIA9$t;A�EA�$��y�A�E�|���f.���D��[A\��A]A^]�\���@�c���뾐I�>��#���ff.�@���ff.�����ff.�H�=!Y�1��H�1!Y�H�$!Y�1��ff.�UH��AVA��AUATS���o�FL�%� YA�<$���3L�-r�Xf.��S��I�}A�4$H��vH��X�����^���� ���;_������A�$��u0��fD�^��������_������A�$�����S��I�}A�4$H��v�H�a�X���u���A"I�}���f��^����v���^�����t���A�$���l����R��I�}A�4$H��v�H��X���u����!I�}���f�A��tA�4$������[1�A\A]A^]���!I�}�����[��A\A]A^]�ff.��UH��AVA��AUATS���t��H�QYL�-NY�3A9u��L�%��XI�<$����]�������3A�E9�����Q���3H��vH��X��������3A9u�_����3A;u}MI�<$�$���]]����t9�tQ���3H��v�H��X���u�I�<$����Ɖ3A;u|�f�A��t�3A;u�>���[1�A\A]A^]���A�E�39��=���I�<$�����\����������P���3H��v�H�C�X���u�I�<$���
���fDI�<$���������[��A\A]A^]�����UH��AWAVAUATA��SH��h�u�1�dH�%(H�E�1�H��YHc�)���H��YD�8E��y��Ic�A��D����H�E��s��D9���H�E��E�L�-��XH��x���H�E�H�E�H�E�H�E��Z@�}�����O��H��tH�<�X���u
A�Ā����	�}��"A������rI�ED�$Ic�A9�~MI�}���7A���O��H��vH��X�8���D�sD���L[�����l���Ic��E�A9��H��YD�81�H�M�dH3%(��H��h[A\A]A^A_]���u���tY�O��H���K���H�c�X����:���A�Ā����-���D��I�uLc�H�M�)�H�}�Hc�L��Z���-��N��H��tH��X������E�A����������kU��Ic�H�H�U��DP�����N��H�U�H�D�$�����I�}�����A�������U��Ic�H�H�U��DP�t����N��H�U�H�D�$��_�����E�A�Ā����_���D��I�uLc�H�M�)�H�}�Hc�L���Y���]����c\�����!������DV���@f�I�uD��Lc�H�M�)�H�}�L�Hc��Y���}�t��]����Z�����������RS��9�����H�U�H��x������N��HcЅ�~�D�I�}H��x���L��YP������oT��ff.�@UH���wK�������H���X1�H�0���1��(���3��H���X�1�]�f�H�5�XU�H��u�zG�����H���X�1�]�@���1�]��UH��AUA��ATSH��H���X�@�!|���#�A�ĩ���tt��B��~I��C����D���bL��D��D��H��vH���X������p���H��1�[A\A]]���AucD��D�����H��1�[A\A]]���R��Ic�H�D��DZ�s����L��H�����B�h���D��D���8�H��1�[A\A]]����H��1�[A\A]]�fD�K��D��D��H��v
H���X���t"����H��1�[A\A]]�����V���fD�K����F���fDUH��AWE1�AVAUATSH��XdH�%(H�E�1����EA��A���*K��H���XH�y�X����GD�=8�XE��
D�5,�XE��Lc2�XH�#�XH�}�L�50�XH�
�XL��D�m�A�[D�]�Lc�G�,L��L�]�H�E����XL�e��V��L�]�D�U�H����H����H���DA�G��E�D���XH���X=���A�����1�����I��A�f.�A��E��L��EN�D����H�A�D���E)�u�L����Q���%�XDH�M�dH3%(D����H��X[A\A]A^A_]�A�F�D�m�D�m��E�=���A��t�I��H��tH���XD�8E��t:�5s��A�Dž�tD��E1��u��끐�E�H�}��E��E����g����H�}����m�X�H�����E�����I��H�E��H�E�A��E�H�E�M��E1��H�U�H�u�L��A���K��I��M�D;u�|����@A�~Hc��|���I��H�E�H�E��A�H�E�M��E1��H�U�H�u�L��A��K��I��M�E9��Mc�M�A�L��E1����X��L���;P���V���fDH�E��L��L��H��H�E��UU��A�G�B�D%��Q�X=�v:A���Y���A��A��
A�~D�u�Hc�規��I��E���������DE��D��A�~Hc��}���I��E������I���=���f���V���I��I������H�E�A�H���X���f��L��L���E����XH�5��XD���X�E��DL��A�G�H�m�X=�vA���}�����׎��I�����A�E��Hc����I���?����#N��UH��AUATSH��H���XD�'H��XH�H���X�@��Fv��A�ŋ�ƒ⿉�tH��D��D��[A\A]]�.���fD�|���ސUH��AUATA��SH��H���X�t1D���y��H�B�XH�
[���H�H�9�XH�H��1�[A\A]]Ð��z����u���@��u��A�ŋ�ƒ⿉�tH��D��D��[A\A]]����|����f��	�v���fDH�	YU�H���XH��0��t#H��YH��Y�;�����D�H���P�H���X��H�_qP���tUH�N�X���uH���X���u,1�]��H��Y�H��Yt�H�]�X���t��?��1�]�fD�W��H���P�8�MH����u���G���f�1��ff.�f�UH��AWAVAUATSH��L�%Y�u�A�$�Eȅ���A������L�=��X1�E1���u̿A����Ic$I��<H����
���E9�u��g��A��BH���XA�4$���ty�}��Z��H��YE�,$D;(|)�g��H��1�[A\A]A^A_]�A�4$��f.�� �����E�,$��fD�#���H���[A\A]A^A_]���}����fD��f��1��Z���ff.������UH��AWAVAUATA��S��H��L�-�YH��YE�uD;0����H���XD�8E��tS�nC��D���H��v
H���X���t.���A�uD��E1��Y��E�uH��D��[A\A]A^A_]�@���А�C��A�}H��v
H�j�X���t$�w���f.����yf�H���X����H�8�A�}����؈��A������o���ff.�f�UH��AWAVAUATSH��8dH�%(H�E�1���<�e����e��1�H�M�dH3%(��H��8[A\A]A^A_]��A��A���5B��H��v
H���X���tu�-e��H�E�1�L�=TYL�5QYH�E����A9�t���A��H��v
H�F�X���t(D���s���A�A9}�D������@H�}��o���H�u��D���Ls���u�����H��f�H�imP�8t�������������UH��AVAUATSH��YD�#E������H���XD�(E��t&�A��3D��E1��tW��[D��A\A]A^]���A���3H��H���XH�t
H�R�X���t\�~�D��Hc׉;D�4��H�Y�;u��G��A��H��DP@t�H���X���u8E1��D������f��H����D��lj���N���A������	���������7����v���A������'���ff.���x,H�y
Y���t&H�lP���t
���D�#������I���UH��� ��������]�f�H�1
Y���tH� 
Y;t�����[���ff.�UH��ATSH��YD�#E����H�=w�XIc�H��D�< t<	��A�D$�H���ƉA�ą�t�T�H���� t�	t�H��Y�9�}}H�?Hc��< t<	u%��Hc�D�Ɖ9�~�H���� t�	t�D9�tAD���1�D�#E��x9[1�A\]�H�CY���~�H���X1�H�8�< t�<	t�fDA��E��y��1�[A\]�D���Y���ff.�H��Y���tH��Y;t�����ۧ��ff.�U�H��ATS�o�H��YH�H���XH���}���t/H���w@��A�ą�tP�H��XH�28uIc�H���@����t0H�����H���P��
��0���[1�A\]�f�H�-Y�8B�4'����@���t�#A�H��3�~���H��3�ff.�@���fD���fD����fDUH��AWA��AVAUATSH����uH��D��[A\A]A^A_]�fDH�}
YA���E���D��D�3�L�D��D��D�+�>�D�;D������E9�t{A9�|v��D���M��I��D��D��H�E��I��I����_��D��D��D�+���L�m�L���t��M�D��D�;E1�����L���Y�D�3��_��L���yD��L���qD���$���藂���E�A�����������1����UH��AWAVAUATSH��H��	Y����XL�-u	YA�}�FA���*_��D�;E;}��L�5��X�<���3H��vH�R�X������F�A)ljA�Hc�蔃��I��E��~1A�G�1��@H�ʋI�>�Hc��A�LH�JH9�u�Ic�L���;B�4?���3I�>�D���1����L���*��^��L���MC��1�H��[A\A]A^A_]�@��I�>��
�I���fD�#;���3H��v
H�t�X���tL�5��XD�~�D�;A����L�5��X�I�>�1
A�������������r���ff.�f�UH��AWA��AVI��AUATSH��H��Y�}̉uȋ�����E��E��E�����L�-�YD�uȅ�~
A9]�L�%0�X�}�I�<$���1ɺ�|�À}�t(��I�<$1ɺ���V9�����A�UI�<$E��L����7��t˃m��}�����H�
 Y��M̅��_���H��1�[A\A]A^A_]�fDI�<$1҉��9�tg��A�UI�<$E��L�������tԃm��}�tl��H�
�Y��U̅�t���������}�����y��H�������[A\A]A^A_]�D����@��1�������I�<$1҉��k�3���I�<$1ɺ���D낅��+����E��E��������k����DU�H��AVAUATL�e�SH�� D�odH�%(H�E�1�H���XH�H���XD�w��L���<i����x0��L��D�������H�U�dH3%(u%H�� [A\A]A^]�D�ۉ�L��D���������p?��UH��ATS��H�� dH�%(H�E�1�H�e�X��u\L�eоL���h����x/��L�����.���H�M�dH3%(u\H�� [A\]�fD�ۉ�L��������������j��H���XH�5���H��@H��@����H���XH�01���>��ff.�UH��ATS��H�� dH�%(H�E�1�H���X��u\L�eоL����g����x/��L��������^���H�M�dH3%(u\H�� [A\]�fD�ۉ�L�����-������#j��H���XH�5����H��@����H��@H���XH�01����=��ff.�H��Y98|H��Y�81��f�������f.�H���X���u	H��Y�8���DH�yYH�
�Y�;~�����UH���M|�������]�fD���t�H�
XY�1�1��2�f.��UH��ATI��SH���8��M��t11�L��H��H����A��H���t6H���t0H���D�[A\]�D1�H��H���5��H���t�H���u���I�$��UH��AWI��AVE��AUI��ATSHc�H��I��H�H��H��L�M��^���L�Mȅ�~~Ic�L�ΉE�L�H��H�U��>����M�9�u_��~[H�U��8uP��~>A��A��Mc�Mc�C�7C8D%u1�q��H����H��:L�uH9�u��fD1�H��[A\A]A^A_]��UH��AWI��AVAUI��ATA��SH����6��E����A9���E����A��1�M��u�{f.����H��E�D9�}7D��Hc�L��1�)�L�Hc��7@��H�PH��w̓�I�D9�|�fD��D)�H��[A\A]A^A_]�@���H��E�A9�~�D��Hc�1�)�L�Hc��3��H�PH��wЃ�A9���fD1�뤸�����D)�1�D9�|IE��~5Hc�H��1@87u6A�p��H���D�H��:T�uH9�u���1��ff.�f�UH��ATSHc�I��H�H�� dH�%(H�E�1�H���X���u
�[5���P�D9�#�H�M�dH3%(u>H�� [A\]��D)�H�M�H�}�H��Hc�H�E���>��H��H���w��E���9��ff.�UA�H��AWAVAUATSH��8dH�%(H�E�1���H�E�DIƅ���L�m�D�Ɖ�D�E�L��I��A�����D�E�F�$E9�~	����E������E��L�}��fDH��tSA��؃���tGMc�D�E�M�L���E4��L��L��L��H����=��D�E�H�PH��w���A��I�E����u��H�M�dH3%(D���H��8[A\A]A^A_]�L�}�@Mc�K�4L�E�H��H�u���3��H�u�L��L��H���w=��L�E�H�����H��t�}�A��7����t�����u�Mc�K�H���3��H��L��L��H���.=��H��H��u5�?@A�Ic�L�H���O3��H��L��L��H���<��H��H�@�H���w�}��7����t�E���
���DA����I�E�r���@E��E�����L�}��]�����7��fDUH��AWAVAUATE1�SH��8dH�%(H�E�1�H�E�����I����A���2��A��9������=E����H�E�E1�L�u�H�E��H���D�E��9�~FA��D��Ic�H�}�L��D)�L�D�E�Hc��;��D�E�H�PH��w��I�E��D�9��E��@H�M�dH3%(D����H��8[A\A]A^A_]�H�E��E�E1�L�u�H�E��'H��t[�}��E�� 6���U����E�AEljE�A�D9�~9D��Ic�H�}�L��D)�L�Hc��N;��H���r�I��D�}���fDD�e��W����E���H����E1��8����C6��UH��AWA��AVAUATSH��H�>�XD�(E��u
H��P���u�x�E1�H�ĸD��[A\A]A^A_]ÿ�V�H�'�P�H��X���8����X�A��]��A��}tA��)��A������f�Dž4���{��x�H�3�XE1�Dž0���L�0H�,�PH�H��8���H��u9�`H��8���D��D��,�����/��D��,���H��EE�@������{���Hc�E�E���[E9�u�������Y���Hc�E�$H��8���D���s/��H��u�E9��5D9�4���uƃ�0���u�L��P���1��L����H�L�%��XI�<$�.4��I�<$A���"4��Hc��j9��D��HDž@�������A�6��?)�H��H	��P���HcR�PH��H���H�l�XD� �H���P�L��@���1�1�L����23��H�?�XD� ����Dž4���(�{����Dž4���[�k����HcÿA�4�؉�A9�t 9�4���tR���(���HcЉ�A�4A9�u����DE����������0�����������������������DUH��ATL�%ӘPSL��t;H�$���H�޿)�Ǣ��L��H�޿]跢��L��H�޿}[A\]飢��H�i������P��~�=��P�f.�DUH��AWAVAUATSH��8H��X�����E�H���E�?�<L�=��XA����*9���I���Uȉu��4u��L��H�E��-��A��A��E�Ic�H�E���y
�}����M̅���9]���H�M�Hc�H��L�0L���P-��A��A9����}����E�E)�E�Dž���E����E�$L��D�uȉ]�D�m�D��I��E���f�A��I��A9�sE:/u�H�U�L��L���?-����uۋ]�E��H���X�H��8D��[A\A]A^A_]�f.�H�M�Hc�H��L�0L���,��A��A9��J��������fD�]�D�m�������E��t%A�A8$��H�U�L��L���,������H��XE1���i���DE���R���E�$Ic�L�}��]�D�m�I�D��E���f���I�����tTE:.u�L��L��L���A,����u�A�ދ]�E��������y4�X��
���@�U̍C�����H�����D�]�D�m����	����A��������E1����ff.�f�1��i���f���V���fDUH��AVAUA��ATA��SH���wr��D��A���|r��D��H��������t�Wr����D���]r����[A\A]A^]�f�UH��AUI��L��ATH)�I��SH��H��H9�s/J�4H�<
H��/H��L��L��H��[A\A]]�-���H�H�<��4����f�H�B�H��t H��H�H�fD��H��H���u��fDH����H9�sI���>@��yOL�VI9�wN��_@��XwE�~�G�<>v@���v4@���t.L��I��H9�sM��u�H��L)�I�0I�@�H����f�UH��L)�H��H�u��~E�fl�A]�1���ff.�@H9���������^�����U����9���=��������=��������=�������=)����2�_��r����G�������=�F����j��=-
���������)��0�1�������f.�H�H�5���F��t/H�rH9���f��f���D@�2�����H�H�5���F�f�H�H�5��F랐H�H�5���F뎐H�H�5���F�{���Hc�H��#�p�h���H�H�5/��F�S���fD������f.�H�H�5G;�F�+���fDH�H�5�&�F����fD�������H�H�5�&�F��@H9����:��~_L�BL9����O_1���Xw�R�J���>v�J_��]v���׍��^��=�&v.��@����0v@H�������H�>���H�H��8�B��Hc��H����ÐHc�H����x�ݸ����ø�����@H9�sK����y'H�FH9�r<��_1���Xw�V�J���>v��_��]v����f.������ø�����@H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.����[�@���f�������[f�������6f�������[f��*�����6f������_[f��\�����6f������[f=��k���6f��G�[�� Zf=	����U6f=��{��Yf=��{���5f=V�k��=Wf=��;f��`��0��O4�è��f��+��f��Y��5f����*���T�E���f��v����#2f�������DRf=���f��Z�����8/�����f����n���]f������ROf=�����+�����f���8��=Lf=���f��������'�ó��f��_����ö����f��]�����*f����^f�����S��=I�ö��f�������O#f��>����TFf=H�(f�����������f������Df=��]f��a��R�������f��
�N��)f����&f��^����YA�����f������f�������?f=�����Gf=������=f=����If=3�����<f=�����f=�����;f=��l��f=��\��);f=��F��@
f=�6���:f��\� ��*	f=����8:f��(����0f=�����:f��c����[f��H�����9f������f��|�����9f�������f��6�x���9f��	�b��^f���R���9f���<��Ff���,���9f�����9f�����4f����f��}���f���tHf��~���f�����f�����f�����f���tf���tf����@���D�É��D�B����f�������f.��T����f.�������f.��è���f.�����f.����øE���ø����ø����øó��øö��ø���ø����ø~��ø}��øy��øv��øl��øe��øU��ø���ø���øk��ø���øU��ø_��øO��øu���ø����ø�����f.�UH��H��AWAVAUO�,ATI��S��H��(�MH�u��M�H��H�H�wXH�M�H�u�M9���H9��|���}M��I��H��uW�DA�>��A�~��	��������f��A�H9M��
A�GI��I����L;}�sLM9�sG���I��$�L��L��L���I�O���A�H�u�I�����A�I��L;}�r��EA��L��L��D�M�H�M�H�u�H��([A\A]A^A_]�DA�>��A�~��	��������f��A�H9M�waI��I����L9}�v�M9�v���tXI��$�L��L��L���I�O���A�I��A�I����I�����A�GI���fD1��-���L�}��$���I�������UH��H��AWAVAUO�,ATI��S��H��(�MH�u��M�H��H�H�wXH�M�H�u�M9���H9��|���}M��I��H��uW�DA�>��A�~��	��������f��A�H9M��
A�GI��I����L;}�sLM9�sG���I��$�L��L��L���I�O���A�H�u�I�����A�I��L;}�r��EA��L��L��D�M�H�M�H�u�H��([A\A]A^A_]��DA�>��A�~��	���������f��A�H9M�waI��I����L9}�v�M9�v���tXI��$�L��L��L���I�O���A�I��A�I����I�����A�GI���fD1��-���L�}��$���I�������UH�I�H��S���DŽ��L�NL9�r(��_@��Xw�~D�O�A��>����_@��]��I9����9�A��@����A�A�H�YI9�rA��_A��X�����A�)�udL�L�H9��c���I9�v^���yOH�yI9�rF����_<Xw<�AD�H�A��>v.��_<]v'E1۸ E1ҁ��E��tA�뛐)�[]������[]�1���@I9�w;���f�I9�v��9A�A�A��@���'����fD��9f��A����@��y�A�A����f�D�IA�Y_��]w��D	�A�����A�Y���>v��>���f�UL�I�L�!zH��ATS�fD��DŽ��H�VI9�r&��_@��Xw�V�z�@��>� ��_��]�I9�����ׄ���A��L�aM9�r
��_@��X�����)�uqL�H�I9��j���I9�vu���y^H�QI9�rU�Ѓ�_<XwK�A�x�@��>v>��_<]v7� 1�E1ہ����t#��@Hc�H�
y�)�[A\]�[�����A\]�fD1���@I9�v;�H�A��A��ׄ��&���HcҿA��5���f�I9�w�뙐��f���������q���A������f��yD�g�A��>w��	������D�g_A��]v������UH�I�H��S���DŽ���L�NL9�r,��_@��Xw#�~D�D�O�A��>����_@��]���A�L9���D�	A�D��E��yAL�YM9�r+��_@��Xw"�y�D�_�A��>����_@��]��A���A�D)�uDL�L�H9��C���L9�s.E1Ҹ �@A�L9��w����� uA���@1�[]�fA��A��A�L9��F����� []�f.�f��A�D���v���ff.�f�UH�I�H��ATS�fD��DŽ���L�VL9�r(��_@��Xw�~D�W�A��>����_@��]��L9����9�A��@���
A�A�H�YI9�rA��_A��X����A�)���L�L�H9��_���L9��������H�yI9�������_<X���AD�P�A��>vz��_<]vs� E1�E1ہ��E��t]A��DL9�s+�9A�A�A��@���?�����fDL9�r;1�E����[A\]�[1�A\]�f��������f�)���@��9f��A����@��y�A�A�����D�QA�Z���>w��D	�A�����A�Z_��]v��-���DH�I�M���DUH��ATS�D��DŽ���L�VL9�r,��_@��Xw#�~D�D�W�A��>����_@��]���A�L9���D��D��E��y?H�YI9�r*��_@��Xw!�yD�!�_���>����_@��]��A����D)�uOH�L�I��tAH9��@���L9�s3E1۸ 뇐A�L9��w����� uA�L�I��u�D1�[A\]ÐfA��A��A�L9��>���[�� A\]�fA���E���s���1��f.�H�I�M���DUH��ATS�D��DŽ���L�VL9�r,��_@��Xw#�~D�D�W�A��>����_@��]���A�L9���D��D��E��y?H�YI9�r*��_@��Xw!�yD�!�_���>����_@��]��A����D)�uOH�L�I��tAH9��@���L9�s3E1۸ 뇐A�L9��w����� uA�L�I��u�D1�[A\]ÐfA��A��A�L9��>���[�� A\]�fA���E���s���1��f.�UH�I�L�RrH��ATS����DŽ���L�NL9�r,��_@��Xw#�~D�D�O�A��>����_@��]���A�L9����9A��@��ynH�YI9�r.A��_A��Xw$D�ID�!A�Y���>��A��_A��]�����A�)�ubL�L�H9��I���L9�sL�9E1۸ A��@��x�Hc�A�A�<:�ŐH�A�A�L9��`����� uA��D1�[A\]ÐfA��A��A�L9��.���[�� A\]�fA��A�A���`���ff.��UH�I�L��pH��AUATS�D��DŽ��L�VL9�r(��_@��Xw�~D�W�A��>���_@��]�L9���9�A��@���5�A�L�iM9�rA��_A��X�P���A�)���H�L�H9��`���L9��������H�yI9�������_<X���AD�P�A��>����_<]��� E1�1ہ��E��tA���L9�sC�9H��A�A�A��@���0���Hc�A�A�<;�@����L9�rS1�E����[A\A]]�f�[1�A\A]]���������f�Hc�H�6o�:)��fD��9f��A����@��yӻA����D�QE�j�A��>w��D	�A����E�j_A��]v����@H�I�M���uUL��nH��AUATS�@��DŽ���L�VL9�r+��_@��Xw"�~�D�W�A��>����_@��]����L9����9A��@��ytL�aM9�r/A��_A��Xw%D�QD�)E�b�A��>��A��_A��]�����A�)�usL�H�I��teH9��D���L9�sW�91۸ A��@��x�Hc�A�A�<;�DH��A�L9��W����� u�H�I��u��1�[A\A]]��f���ûL9�����[�� A\A]]ÐfA��A�A���G���1��f�H�I�M���uUL�)mH��AUATS�@��DŽ���L�VL9�r+��_@��Xw"�~�D�W�A��>����_@��]����L9����9A��@��ytL�aM9�r/A��_A��Xw%D�QD�)E�b�A��>��A��_A��]�����A�)�usL�H�I��teH9��D���L9�sW�91۸ A��@��x�Hc�A�A�<;�DH��A�L9��W����� u�H�I��u��1�[A\A]]��f���ûL9�����[�� A\A]]ÐfA��A�A���G���1��f�HLJ��1��f�H���ff.��1��ff.�f�H9�s�H����������f�H9�s#1�H���v��@�2���������f�UL�H�9H��SI�L9�s>I��f�H��D�H����?L�I��I��I��I��L�H1�I9�u�H�RH�H�9I�[]�DH�H��vpI��I��L9�sd�P�L9�v��� uUH���P�I9�u�L�VI��M9�v;�� u6I9�sA�x�    t�6@�x�    uH��I9�r��@�x� u	H��H9�r�H)�H������H9�r���ff.�@UH��AWE��AVI��AUATM��SH��H��(D�mD�UH�}�H� �XH�H��tH�Mȋ} ��H�M�D�U��ucL9��U������D9�tjD9�u0�H��H�H�{�@88u/I9����PD9�t5D9�tpH��D9�uH��L9�HD�L9�u��H�e�[A\A]A^A_]�@�E9�t;H��I9����A��D9�t�D9���L9���H����fD�I9�t�H�qH�{L9����QA9���L9�t�H�qH��I9�vU�QA9�uL9��a���H��H��I9�tJ�D9�t�H��A9�����X���fD1�I9���H�e�[A\A]A^A_]�H��I9�t���1��
���1�L9�������������H��H����H��H���L9�t�L9�t�H�AH�E�A��D9�t_�E ���E��I9�t��H��D8�u�E�H��H�M�E��H�}�M��L��H��PARAUD�]�D�U����H�� D�UD�]�����i���L;e�t�H�AD�YH�E��ff.�@H��H���5��DUH��H��SH��H���\��H��H��[]�f�UI��H��AWAVAUI��ATI��S��I��H��H9�D�}HG�L9�IG�H��tL9�u5A)��EE��L��H��K�"I�E��[L��A\A]A^A_]�T�@L��H��L����
��I���ff.�f�UI9�H��AVE��AUI��MF�ATI��SL��M��tH��L��H��������uE��D��AD�)�[A\A]A^]�fDUL9�IG�M9�H��ATI��SL��IF�H9�HF�H��tH��H�������uD��)�[A\]�UL9�H��ATI��L��IF�SL��H��tH��H���Y����uD��)�[A\]�ff.�UI��H��AWAVAUI��ATI��S��I��H��H9�D�}HG�L9�IG�L9�tL��H��L���	��I��A)��EE��L��H��K�"I�E��[L��A\A]A^A_]�8��1�I9���UH��AVAUATSM����H��N�$L)�L�L9����L�iL�qH���f�H��I9���H�z8_�u�M9�t;D�YD8u�M9�t,D�YD8Zu̸�DD�H��D:\�u�I9�u�E��t*H)�A����}A�yA�yvA�yD�A�yE�A�[A\A]A^]�@���U���t�I�A�A��[1�A\A]A^]�DUL9�H��ATI��L��IF�SL��H��tH��H���y����uD��)�[A\]�ff.�UL9�H��AVE��AUM��LF�ATI��SL��M��tH��L��H���/����uE��D��AD�)�[A\A]A^]�fDUH��AWE��AVI��AUATM��SH��H��H���XD�mH�}�H�H��tH�Mȿ��H�Mȅ�uhL9�t|�1D�E�������A9��MH��A9�u/�xH��H�y�C�8u/I9�tC�QA9���A9�tIH��A9�uH�AI9�HE�I9�u��H�e�[A\A]A^A_]�D1�I9���H�e�[A\A]A^A_]Ð�I9�t�H�OH�SI9����wA9���I9�t�H�OH��I9��}�wA9�uI9�t�H��H��I9�t��1A9�t�A9�����H�����A9�t�H��I9�t.�Uf.��A��9�tA9�u6I9�tuH��H��I9�u�1�����H��I9��$����1��H���I9�t�I9�t:H�GH�E�A��A9���D�mM��E��D�UfD�H��D8�tI9�u�������H���6���DH�C�I9�t�EH��H�M�E��jH�}�M��L��PH��ARD�U���H�� ���f���I9�D�Uu��L;e��q���D�WH�GD�mM��H�E�E��D�U�e���ff.�f�H��t'�<v$< u0H���<v< uH��H9�u�1�Ð������f.���f.�UH��SH��H��I9�IF�H�<H9���D�D�H�FL�IE8�ukH9���D�VD�YH�FL�IE8�t"�If�H��I��D�P�E�Y�E8�u)H9�u�I9�t/v=L��L��H)�����H����[]�fDH��A��D)�[]�f�H��1�[]��H)�H��[H��]����I��H���H���f�UH��SH��L9�IG�M9�MG�L9�M��LF�N�L9����D�H�~H�YD8�unI9����FD�AH�~H�qL�D8�t"�Jf.�H��H���G�D�F�D8�u*H9�u�L9�t0s>L��H��L)��0���H����[]��H��D)�[]�fDH��1�[]��H��L)�[H��]����H���H���f.��H9����H�ǃ���D��_���A��>v[L�BL9����J���H�
>eH��A�H�H��u(�G<v�� 1�@��w�B�P���>v=�P�1���|v3�f�H��dH��BH���f.�H����������f.������ø�����@1�H9�r�7�H��H��H9�v��y_@��>v��y�H��H��H9�w��D�ff.�@H9�sS����y#�y_@��>vH�FH9�r;�A<v�� 1���v��F�P���>v
�P�1���|w��@�����ø�����ff.��H9���H����I���>@��yCH�FH9�rD�WA��vXD�W A��vN��_@��>vUH��L)�H��H�u��~E�fl�A]�H��I��H9�vM��u�H��L)�I�0I�@�@D�VE�Z�A��>vE��y�A���w�H���f�1���ff.��H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.���~+1�H����w3H��b�p�lj�f����t=�f�H9�s+@�2�ø�����@H�BH9�r�f�:��fD������f.�UH�I�H��ATS�fD��x_@��>�(��� H�~H9�r�x@�����x @�������A��A�I9�vy�D�P_A��>������L�QM9�rD�PA����D�P A�����E����A�)lj�u!L�L�H9��B���1�E1ۿ E1�I9�w�[A\]�D�N�>E�Q�A��>vA���A��|�C���f���A�A����=�����E������[�����A\]�f.���A��A������@D�QD�!A�Z���>vA�€A��|����fA��A��E��t�A������UH�I�L��`
H��AUATS�D��x_@��>�(��� H�~H9�r�x@�����x @���������A�I9�vx�D�X_A��>������L�YM9�rD�XA����D�X A�����E����A�)lj�u H�L�H9��C���1�1ۿ E1�I9�w�[A\A]]�D�N�>E�Y�A��>vA���A��|�C���f����A����=���@A���E���y���[�����A\A]]�A�<��A������D�YD�)E�c�A��>vA�ÀA��|����fA��A��E��t�A�����ff.�UH�I�H��S���x_@��>������H�~H9�r�x@���
�x @�����A�L9�� �9D�W_A��>vl@��ygL�QM9�rD�WA����D�W A��v~���A�)���L�L�H9��[���L9����9E1ɸ D�W_A��>w�D��A��D��A�L9��e���- ��A��D�Q�E�Z�A��>vA�€A��|�b���f��A����\���fD�~D�D�O�A��>v
�ǀ@��|���fA��A�A��L9����- []�f�1�[]�ff.�UH�I�H��AUATS�@��x_@��>������H�~H9�r�x@�����x @�����A�A�L9�se�9�__��>v|@��ywH�YI9�r�_�����_ �������E��tSA�)�u0L�L�H9��Z���E1۸ E1�L9�r�1�E����E����[A\A]]�f.���E��u�[�����A\A]]�@��A�A��H���@�~D�D�W�A��>v
�ǀ@��|����fA��A�A��A�������YD�)D�c�A��>v�À��|����fA��A��E���h���A�����D[1�A\A]]��H�I�M����UH��ATS�D��x_@��>������H�~H9�r�x@�����x @�����A�I9����9D�__A��>vl@��ygL�YM9�rD�_A����D�_ A�������A�)�ulL�L�I��t^H9��U���I9�vP�9E1Ҹ D�__A��>w���A��D��A�I9��e���- uA�L�I��u�1�[A\]�f��~D�D�W�A��>v
�ǀ@��|����fA��A�A��I9�����[- A\]��D�YD�!A�[���>vA�ÀA��|����fA��A�A������1�ÐH�I�M����UH��ATS�D��x_@��>������H�~H9�r�x@�����x @�����A�I9����9D�__A��>vl@��ygL�YM9�rD�_A����D�_ A�������A�)�ulL�L�I��t^H9��U���I9�vP�9E1Ҹ D�__A��>w���A��D��A�I9��e���- uA�L�I��u�1�[A\]�f��~D�D�W�A��>v
�ǀ@��|����fA��A�A��I9�����[- A\]��D�YD�!A�[���>vA�ÀA��|����fA��A�A������1�ÐUH�I�L�
2X
H��ATS����x_@��>������H�~H9�r�x@����x @���
�A�L9��0�9D�__A��>vt@��yoL�YM9�rD�_A����D�_ A�������A�)���L�L�H9��W���L9����9E1Ҹ D�__A��>w�f�A�<9A����A�A���L9��X���- ��A��fDD�YD�!A�[���>vA�ÀA��|�V���fA��A�A���N���@�~D�D�W�A��>v
�ǀ@��|����fA��A�A��L9�����[- A\]��1�[A\]�f�UH�I�L�rV
H��AVAUATS���x_@��>������H�~H9�r�x@�����x @������A�L9�sj�9D�g_A��>v{@��yvL�aM9�rD�gA����D�g A�������E��tSA�)�u/H�L�H9��U���1۸ E1�L9�r�1�E����E����[A\A]A^]�@A�<:��E��u�[�����A\A]A^]�DA��A����;����~�D�_�A��>v
�ǀ@��|�
���f��A��û����D�aD�1E�l$�A��>vA�ĀA��|����fA��A��E���i���A�����f�[1�A\A]A^]�DH�I�M����UL��T
H��AUATS�@��x_@��>������H�~H9�r�x@�����x @�����A�I9����9�__��>vf@��yaH�YI9�r�_�����_ ��������)�u{H�L�I��tmH9��\���I9�v_�9E1۸ �__��>w�@A�<:����f�A�A���I9��`���- uA�L�I��u�1�[A\A]]���~�D�_�A��>v
�ǀ@��|����f��A���I9�����[- A\A]]��YD�)D�c�A��>v�À��|�
���fA���A������1��ff.��H�I�M����UL��R
H��AUATS�@��x_@��>������H�~H9�r�x@�����x @�����A�I9����9�__��>vf@��yaH�YI9�r�_�����_ ��������)�u{H�L�I��tmH9��\���I9�v_�9E1۸ �__��>w�@A�<:����f�A�A���I9��`���- uA�L�I��u�1�[A\A]]���~�D�_�A��>v
�ǀ@��|����f��A���I9�����[- A\A]]��YD�)D�c�A��>v�À��|�
���fA���A������1��f.�f�UH��AWAVAUATSE��tL9�IG�H�M�Lc�Ic�H��H�u�I��E1�L�=I�N�E�L��H)�L9��4�E�E1Ƀ�t���`��I��A��E�Mc�H��H)�H9�}$D�K��F�$L��E��uNH��H��H)�H9�|�D��A����A�A�E���YH�U�A�����[A\A]A^A_]��A���6L�bL��H)�H9����R�<L��u$fDH��H��H)�H9��O���D�B�<t�H9���A����A�A�A��I�һH�U�L�U�D)�A�݅��d���E���[���L��H)�L9�����Lce�E�K��L��F�E��tFA��tQA�����I�����f.�L�E��E�A����f.�I���U���L�����I�XI��I)�M9���E�@B�<I��u#DI��M��I)�M9�����E�B�<t�}���M9����}������+EԉE�L��L�E�H�E�����H�U�E1�L���N�cH�M�L�
�D��8�u]I�QL���@I��I)�M9�}EH��D8u<D�
H��E��u߉�H�U�H�M�Lc�H�K�NI��N�DG� I�����DI�CI����M����u���H�U�H�M�L���A��H���A���A���tH��D��D)��)����E�L�%ڰNA�cH��L�E�D�M�A8�uZL�CI����L��H)�H9�}?I��E8u6E�I��E��u�L�E�D�M�HcE�H�|�NL��H��H�DF�$�s���M�D$�E�I��E�L��E��u�L�E�D�M�I���I���V���L���Q���I���Q����H����UH�H��AWL�}L�U AVL�uAUATO�>SH9���M9����D8���D8��}E��E��H�Q
M���U�D��F�E��tbA��A���wnA�I��I��A�@�H��H��H9�tSM9�tN�@D8��+D8��"8�u�L�NI9�t�FL��D��F�E��u�H���D��F�E��u�L���GtL��L)�H�}(H�H�E0L�8M9���I�BI9�I�@��I9������I�C�L)�H����L��fo
\
fo\
1�L)�H��H����AAH��H9�u�H��H���I�I�H9��.I�@A� A�9I9��I�@A�@ A�B9I9��I�@A�@ A�B9I9���I�@A�@ A�B9I9���I�@A�@ A�B9I9���I�@A�@ A�B9I9���I�@A�@ A�B9I9���I�@A�@ A�B9I9�t|I�@	A�@ A�B9I9�tiI�@
A�@	 A�B	9I9�tVI�@A�@
 A�B
9I9�tCI�@A�@ A�B9I9�t0I�@
A�@ A�B9I9�tI�@A�@
 A�B
9I9�t
A�@ A�B9[1�A\A]A^A_]�M��f��G����H�E(L�8H�E0L�8����M)�1�A� A�9H��L9�u�[1�A\A]A^A_]�M������UMc�L�E�NH��AWA�AVAUATSH��8D�mH�u�H�U�D��L�Eȃ�A��DD�L��E1�1�f�D��Hc���D!�A��H��L)�L9�}$D�I�<�L��F�E��u2H��H��L)�L9�|܃�������H�EȹA��k�A����H�XH��L)�L9����@�<H��u"fDH��H��L)�L9��k�����<t�HMÃ�H��D��H�E�H�U�)ˉ�E���-���L;u��#���H�u�F�6I��E������E��yL;u�rGH��8L��[A\A]A^A_]�H�������L��A��A���t6H���E��t�L;u�s�E1��L�}�H�}�� L��L�L)�M����뙉M�H�2�N�cL�u��E�D�e�I��@8�usI�KH���f.�H��L)�L9�}UH��D8uLD�H��E��u�D�e��M�HcE�H�ͪNH��H�DD�0H��E�������L;u������@I�L$�E�I���9I��@���l���D�e��M�H����UH��AWAVAUATSH��t=�|� H�z�Lc�u2H��t*�|� H�B�t�{�|� H�P��qH��H��u�E1�M��t@B�|� I�P�Mc�u4H��t,B�|� I�@�t�"@�|� H�P��H��H��u�E1�H�M�H��H��E1�H�u�E1�H��H)�L9��(E1�A��tE���QA��H��A�Mc�H��H)�L9�})H�ߩN�N��H��A���uLH��H��H)�L9�|�D��A����A�@�E���KH�U�A�����[A\A]A^A_]�fD���/H�BH��H)�I9����RA�<H��u#fDH��H��H)�L9��L����A�<t�A��HM�A�@�A��I�һH�U�L�U�D)�A�م��r���E���i���H��H)�L9�����Mc�H��ND�J��L��F�E��t4A��tFA�����H�����H�}�A�A����H���m����H�����H�_I��I)�M9����<8H��uH��I��I)�M9��+���D�B�<t�M9���A����A���1����D)�A��H��H�}�H�E�����f.�H�U�E1�L���N�cH�M�L��D��8�u[I��H���f�I��I)�M9�}EI��8u=A�H����u��H�U�H�M�Hc�H�=�NH��H�|;F�'H������I�CI����M����u���H�U�H�M�H���@A��H���A���@���t0H��D��)��'���H���Lc����H��DLc����D�E�L�%��NA�cH��~H�}�H�u�1�A8�uaH�{I���L��H)�L9�}MH��E8uDD�I��E��u�D�E�H�}��u�H�u�HcE�H�E�NL��H��H�DB��S����I�|$��I��D�H��E��u�D�E�H�}��u�I��H�u��H���2���H������f.�f�H����H9���I���>@��y[L�^I9�wZ@���tT@���tND�VD�׃�߃�A@��vA���t4A���v.L��I��H9�sM��u�H��L)�I�0I�@�H����f�UH��L)�H��H�u��~E�fl�A]�1���ff.�@H9����:��~_L�BL9����O1���}wE�R�у�߃�A��v�J��}w,��׍��~��=�GvM�����]3vH�������f�H�>���Hc�H�fc�x��Hc��H�����H�H���B�ߐ�����ø�����@H9�sK����y<H�FH9�r.��1���}w)�V��у�߃�A��v��1���~���ø�����f�������f.�H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.�H9���������_���=�����9���=��������=��������=
������=���������]������=F�����j��=%
����T��=�+�����=����1����wBHc�H�<P
�p�fDH�H�5�_�F��tH�rH9�r
f��f��ø�����@�2���H�H�5�V�F뾐H�H�5w\�F뮐H�H�5GR�F랐H�H�5w�
�F뎐H�H�5'M�F�{���fDH�H�5OL�F�c���fDH�H�5ת
�F�K���fD������H�H�5YS
�F�-���H�H�5'Q
�F����ff.�UH�I�H��S���DŽ��L�NL9�r/��@��}w&�~A��A���A��AA�����@��}�I9����9�A��@���A��L�YM9�rA��A��}����A�)�uqL�L�H9��]���I9�vh���yQH�yI9�rH����<}w>D�ID�ȃ�߃�A<v,� 1�E1�E�YA��}�������t
A��f������[]��1�[]����I9�v��9A��A��@���.�����I9�v���9f��A����@��yA�����fD)��@��D	υ��r���A�����D�IE��A���A��AA���$�����D	���ff.�UH�I�L��TH��ATS����DŽ��KL�NL9�r/��@��}w&�~A��A���A��AA������@��}��I9��J�9�A��@����A��L�aM9�rA��A��}�\���A�)�uqL�L�H9��]���I9�vh���yQH�yI9�rH����<}w>D�ID�ȃ�߃�A<v,� 1�E1�E�aA��}�������t
A��f������[A\]�fD[1�A\]�f�I9�vs��9f��A����@����f�Hc�H��S�:)��fDI9�v;�9H�A��A�A��@�����Hc�A�A�<:������c���fD��D	υ��J���A������A������D�IE��A���A��AA�������D	��ff.�UH�I�H��S����DŽ���L�NL9�r3��@��}w*�~D�A��A���A��AA������@��}���A�L9���D�	A�D��E��yHL�YM9�r2��@��}w)�y�A��A���A��AA������@��}��A���A�D)�uFL�L�H9��5���L9�s0E1Ҹ �fDA�L9��n����� uA���@1�[]�fA��A��A�L9��=����� []�f.�f��A�D���t���ff.�f�UH�I�H��ATS�fD��DŽ��L�VL9�r/��@��}w&�~A��A���A��AA���0��@��}�#L9����9�A��@���6A�A�H�YI9�rA��A��}�1���A�)���L�L�H9��X���L9��������H�yI9�������<}��D�QD�Ѓ�߃�A<voE1� E1�A�Z��}�����E��tLA��z����L9�s#�9A�A�A��@���6�����fD1�E����[A\]�[1�A\]Ð�������f�L9�s���9f��A����@��yA�A�����D)��@��D	�E��t�A�����D�QD�Ӄ�߃�A���'�����D	���H�I�M���TUH��ATS��D��DŽ���L�VL9�r3��@��}w*�~D�A��A���A��AA������@��}���A�I9���D��D��E��yDH�YI9�r/��@��}w&�yD�!����߃�A������@��}��A����D)�uH�L�I��tH9��4���I9�w1�[A\]��E1۸ �p���A�I9��^����� u�A��@fA��A��A�I9��5���[�� A\]�fA���E���o���1��f.�H�I�M���TUH��ATS��D��DŽ���L�VL9�r3��@��}w*�~D�A��A���A��AA������@��}���A�I9���D��D��E��yDH�YI9�r/��@��}w&�yD�!����߃�A������@��}��A����D)�uH�L�I��tH9��4���I9�w1�[A\]��E1۸ �p���A�I9��^����� u�A��@fA��A��A�I9��5���[�� A\]�fA���E���o���1��f.�UH�I�L��LH��ATS����DŽ���L�NL9�r3��@��}w*�~D�A��A���A��AA������@��}���A�L9����9A��@��ysH�YI9�r3A��A��}w)D�ID�!D�˃�߃�A����A��A��}�����A�)�ufL�L�H9��=���L9�sP�9E1۸ A��@��x�Hc�A�A�<:��DH�A�A�L9��W����� uA��D1�[A\]ÐfA��A��A�L9��%���[�� A\]�fA��A�A���\���ff.��UH�I�L�KH��AUATS�D��DŽ��L�^L9�r/��@��}w&�~A��A���A��AA���X��@��}�KL9���9�A��@���N�A�L�iM9�rA��A��}�l���A�)���H�L�H9��Y���L9��������H�yI9�������<}��D�YD�؃�߃�A<��E1� 1�E�kA��}�����E��tqA��v���fDL9�s;�9H��A�A�A��@���'���Hc�A�A�<:�7����1�E����[A\A]]Ð[1�A\A]]���������f�L9�s���9f��A����@��x6fDHc�H�6I�:)��fD��D	�E��t�A����f��A��}���D�YE��A���A��AA�������D	��ff.�H�I�M����UL��HH��AUATS��@��DŽ���L�VL9�r2��@��}w)�~�A��A���A��AA������@��}����I9����9A��@����L�aM9�r6A��A��}w,D�QD�)E��A���A��AA����A��A��}�����A�)�uL�H�I��tH9��2���I9�w
1�[A\A]]�@�91۸ A��@���t���Hc�A�A�<;�f�H��A�I9��>����� u����f���ûI9�����[�� A\A]]�f�fA��A�A���I���1��f�H�I�M����UL�GH��AUATS��@��DŽ���L�VL9�r2��@��}w)�~�A��A���A��AA������@��}����I9����9A��@����L�aM9�r6A��A��}w,D�QD�)E��A���A��AA����A��A��}�����A�)�uL�H�I��tH9��2���I9�w
1�[A\A]]�@�91۸ A��@���t���Hc�A�A�<;�f�H��A�I9��>����� u����f���ûI9�����[�� A\A]]�f�fA��A�A���I���1��f�H9���H����I���>@����H�FH9�w.@����|@���v@���t�~@���ts@���vmH���-L�VI9�w\@���uV�F<�tN<�vJ�F<�vB<�t>L��I��H9�sM��u�H��L)�I�0I�@�fDH����f��~��_@��>v�UH��L)�H��H�u��~E�fl�A]�1��f�H9���������_�����]wHH�zH9����J���H�
�HH��A�H�H��uw�R�������_��]vf1��@=�tq=�u�H�BH9�rC�B�J���H�
=HH��A�H�H��u!�B��_<]w��B��_<]w������ø������H����H�BH9�r-�B�P_��>�h���H��H���������ø�����@1�H9�r�W����t+��x7H��H��H9�v����u�H��H��H9�w��@H��H����fDH��H����fD�ff.�@H9�������y>H�FH9������t1�A_<]wB�F��_<^�����À��u$�F�P_1���]v=�@�F�H_���>v71��@H�FH9�sǀ��u��F��_<^�����F��_<^���Ð�������ø�����ff.��H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.���H9���@�2��f�1�H����wHH�=�E�wf��f�<wu7H��E�<p�pf����t8H�BH9�re���f�zø�����@H�rH9�r�f���fDH�����H��>w�H�BH9�rȃ�@���@�r�f.������ø�����@UH�I�H��S�����
H�~H9�r'<��\�x_@��]���~D�O_A��]�OI9���9�@���[A�A�L�IM9���@���t{D�O_A��]��D�IA�Y_��]vm���E����A�)���L�L�H9��D���I9����9@����H�AI9���E1�E1۸ @���u�D�IA�Y_��>w���A��D	�E��tTA��@I9�v;�9A�A�@���j���L�IM9��,������A��R���D�[]ø����[]��1���@�~D�O_A��>�����I9�v����	��9@��yA�A����)��@H�~H9��v���<��n����^�{_@��]�]����^�{_@��]�L���I9��`����F�9f����
�@��y�A�A��@����L�IM9��[���@����Q����YD�K_A��]�?����YD�I��_��]�*���fA��A�����E�����A������UH�I�L�
�BH��ATS������H�~H9�r'<��T�x_@��]���~D�W_A��]�GI9����9�@���KA��L�YM9���@���tzD�__A��]��D�YE�c_A��]vl������A�)��L�L�H9��E���I9���9@����H�AI9���E1�1۸ @���u�D�YE�c_A��>w���A��D	߅���A��f.�I9����9A�A��@������A�<9A��O������A��;�����~D�W_A��>�����I9�vA����	��9@���
DH��@�:)�[A\]�fD[�����A\]�fD��ސ1���@H�~H9��V���<��N����^�{_@��]�=����^�{_@��]�,���I9�v��F�9f����
�@���p���A��� ���L�YM9��C���@����9���D�YA��_A��]�&���D�aD�YA��_A��]����fA��A�����������A�����@A������UH�I�H��S������H�~H9�r'<����x_@��]��~D�O_A��]���A�L9����9@��y2L�QM9�r#@���trD�W_A��]�D�QE�Z_A��]vd���A�)�u?L�L�H9��^���L9�s)E1ɸ ��A�L9�r��� u
A���1�[]�D�QE�Z_A��>w�A����D	�A����~D�O_A��>�)�������A�	�L9��&����� []ÐH�~H9������<�������^�{_@��]����^D�N�{_@��]����fA��A��A�
����L�Y@������M9�����YD�S_A��]����D�Q�YA��_A��]�����f���ˁ��)������L�����ff.�UH�I�L�
�=H��ATS�������H�~H9�r'<���x_@��]�?�~D�W_A��]��A�L9��
�9@��ygL�YM9�r*@�����D�__A��]�HD�YA�[_��]�����A�)�u`L�L�H9��W���L9�sJ�9E1Ҹ @��x�A�<9A���DA�A�L9��k����� uA���1�[A\]ÐD�YA�[_��>�x���A����D	�A��o���f��~D�W_A��>���������A�	�L9������[�� A\]��H�~H9�����<�������^�{_@��]������^D�V�{_@��]�����fA��A��A�
����H�Y@��������I9������D�YA��_A��]�����D�YD�aA��_A��]�����fA��A�́��)����H���|���ff.�@UH�I�H��ATS�fD����
H�~H9�r'<��l�x_@��]���~D�W_A��]�_L9���9�@���sA��L�QM9���@���tzD�W_A��]��D�QE�b_A��]vl�������A�)���L�L�H9��E���L9����9@����H�AI9���E1�1۸ @���u�D�QE�b_A��>w���A��D	ׅ�tnA��fDL9�s;�9A��@���j���L�QM9��,������A��R���fD1�E����[A\]�[1�A\]�f��������f��~D�W_A��>�����L9�s�����	��9@��yA�����f�)��@H�~H9��^���<��V����^�{_@��]�E����^�{_@��]�4���L9��H����F�9f����
�@��y�A���(���L�QM9��K���@����A���D�QA��_A��]�.���D�aD�QA��_A��]����fA��A����������A�����ff.��H�I�M���UH��ATS�D�����H�~H9�r'<����x_@��]���~D�W_A��]���A�I9����9@��y9L�YM9�r*@�����D�__A��]��D�YA�[_��]�����A�)�uL�L�I��tH9��Q���I9�w1�[A\]�DE1Ҹ �fDA�I9��p����� u�A��@�~D�W_A��>�9�������A�	�I9��6���[�� A\]��D�YA�[_��>�P���A����D	�A��G����H�Y@����,���I9��#���D�YA��_A��]����D�YD�aA��_A��]�����fA��A�́��)��
���H������H�~H9��v���<��n����^�{_@��]�]����^D�V�{_@��]�G���fA��A��A�
��9���1��H�I�M���UH��ATS�D�����H�~H9�r'<����x_@��]���~D�W_A��]���A�I9����9@��y9L�YM9�r*@�����D�__A��]��D�YA�[_��]�����A�)�uL�L�I��tH9��Q���I9�w1�[A\]�DE1Ҹ �fDA�I9��p����� u�A��@�~D�W_A��>�9�������A�	�I9��6���[�� A\]��D�YA�[_��>�P���A����D	�A��G����H�Y@����,���I9��#���D�YA��_A��]����D�YD�aA��_A��]�����fA��A�́��)��
���H������H�~H9��v���<��n����^�{_@��]�]����^D�V�{_@��]�G���fA��A��A�
��9���1��UH�I�L�R4H��AUATS�D����H�~H9�r'<����x_@��]��~D�__A��]�wL9���9�@���;A�A�H�YI9���@���tx�__��]�`�YD�k_A��]vl���E�����)���L�H�H9��G���L9����9@����H�AI9���E1۸ E1�@���u��YD�k_A��>w�����	�E��ty��f�L9�s3�9A�A�A�@���/���A�<:��a����1�E����[A\A]]�f������2���[1�A\A]]���������f�H��2�:)�뱐�~D�__A��>�����L9�s�����	��9@����A�A����@H�YI9������@���������Y��_��]�����D�i�YA��_A��]�p���f�������E���L�����d���f�H�~H9����<�����^�{_@��]�����^�{_@��]����L9������F�9f����
�@����A�A����@��H�
�1�)����f.�H�I�M���4UL�Y1H��AUATS�@�����H�~H9�r'<���x_@��]�?�~D�__A��]��A�I9��
�9@��yyH�YI9�r(@������__��]�J�YD�c_A��]������)�uH�L�I��tH9��T���I9�w1�[A\A]]�fD�9E1۸ @��x�A�<:��@A�A�I9��[����� u�A����YD�c_A��>�n�������	߻�g���@�~D�__A��>���������A�	�I9������[�� A\A]]�DH�~H9�����<�������^�{_@��]������^D�^�{_@��]�����fA��A��A�
����L�a@��������M9�������Y��_��]������YD�i��_��]�����fA��A�́��)������L������1��f.�H�I�M���4UL�	/H��AUATS�@�����H�~H9�r'<���x_@��]�?�~D�__A��]��A�I9��
�9@��yyH�YI9�r(@������__��]�J�YD�c_A��]������)�uH�L�I��tH9��T���I9�w1�[A\A]]�fD�9E1۸ @��x�A�<:��@A�A�I9��[����� u�A����YD�c_A��>�n�������	߻�g���@�~D�__A��>���������A�	�I9������[�� A\A]]�DH�~H9�����<�������^�{_@��]������^D�^�{_@��]�����fA��A��A�
����L�a@��������M9�������Y��_��]������YD�i��_��]�����fA��A�́��)������L������1��f.�H����H9�sI���>@��yGL�VI9�wN��_@��VwE�F<�t=<�v9L��I��H9�sM��u�H��L)�I�0I�@�fDH����f.�UH��L)�H��H�u��~E�fl�A]�1��ff.�@H9����:��~gL�BL9����O_1���VwK�R�J_��]w?��ׁ������=7v<�����=NvW��!0��]GvYH�������@H�>���H�H��-�B��Hc��H�����f�H�H��(�B�֐Hc�H�&��x�Ÿ����ø�����@H9�s;����y*H�FH9�r��_1���Vw�F��_<^�����ø�����@������f.�H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.�H9���������\���=8����9���=��������=��������=�������=)��������	�
�����=TM�����c����f����a��=�����1����wJHc�H����p�f�H�H�5��F��t H�rH9�r
��f��f��ø�����fD@�2���H�H�5���F�f�H�H�5���F랐H�H�5���F뎐H�H�5G��F�{���fDH�H�5��F�c���fDH�H�5Dž�F�K���fDH�H�5��F�3���fD������H�H�5���F�����H�I��|���DŽ���L�NL9�r��_@��Vw
�~��_@��]vdI9�vd�9�A��@��yA�L�YM9�rA��_A��V�����A�)�uL�L�H9�w�1�I9�������f.�I9�w3��DI9�v��9A�A��@��x�A��f�)��D��9f��A����@��y�A��_����D�IE�Y_A��]�[�����D	�A��V���ff.��H�I�L�34H9���UH��S��D���L�NL9�r��_@��Vw
�^�{_@��]vyI9�v|�9�A��@��yLA�H�YI9�rA��_A��V�����A�)�uL�L�H9�w�1�I9�����[]�fDHc�H��3[]�:)��DI9�wS��АI9�v��9H�A�A�A��@���q���Hc�A�A�<:���@1�I9������@��9f��A����@���w���A��&���@D�IA�Y_��]�'�����D	�A��"���ff.�f�H�I��D��DŽ���L�NL9�r��_@��Vw�~D���_@��]���A�L9���D�	A�D��E��y4L�YM9�r��_@��Vw�yD���_@��]�A���A�D)�uEL�L�H9��^���L9�s)E1Ҹ ��A�L9�r��� uA���1��D��fA��A�A��L9��P����� �@fA��E��A��z���ff.��H�I�H9���UH��S��DŽ���L�VL9�r��_@��Vw�^�{_@��]��L9����9�A��@����A�H�YI9�rA��_A��V�����A�)�uL�L�H9��w���1�L9�����[]�DL9�s �9A�A��@��x�A��f�L9�r#1�E��[]���1�L9������@)��@��9f��A����@��y�A��O���D�QA�Z_��]�T�����D	�A��O���DH�I�M���3UH��S����DŽ���L�VL9�r��_@��Vw�^D��{_@��]���A�I9���D��D��E��y2H�YI9�r��_@��Vw�y���_@��]��A����D)�uRH�L�I��tDH9��[���I9�v6E1۸ �@A�I9�w��� uA�L�I��u�f�1�[]�fA��A�A��I9��H����� []�f.�f��D�ӻ�i���1��ff.�H�I�M���3UH��S����DŽ���L�VL9�r��_@��Vw�^D��{_@��]���A�I9���D��D��E��y2H�YI9�r��_@��Vw�y���_@��]��A����D)�uRH�L�I��tDH9��[���I9�v6E1۸ �@A�I9�w��� uA�L�I��u�f�1�[]�fA��A�A��I9��H����� []�f.�f��D�ӻ�i���1��ff.�UH�I�L��-H��S�f���DŽ���L�NL9�r��_@��Vw�^D��{_@��]���A�L9����9A��@��y`H�YI9�r A��_A��VwD�I�A��_A��]�����A�)�ufL�L�H9��e���L9�sP�9E1۸ A��@��x�Hc�A�A�<:��DH�A�A�L9��j����� uA��D1�[]�fA��A�A��L9��8����� []�f.�f��A����V���ff.�H�I�L�S,H9���UH��ATS��DŽ���L�^L9�r��_@��Vw�^�{_@��]��L9����9�A��@�����L�aM9�rA��_A��V�����A�)�uH�L�H9��x���1�L9�����[A\]�L9�s0�9H��A�A��@��x�Hc�A�A�<:�@L9�r;1�E��[A\��]�fD1�L9������@Hc�H�F+�:)��fD��9f��A����@��yӻ�(���D�YE�c_A��]�,�����D	�A��'���DH�I�M���UUL��*H��ATS�fD��DŽ���L�VL9�r��_@��Vw�^D��{_@��]����I9����9A��@��yfL�aM9�r!A��_A��VwD�QD�!A��_A��]�����A�)�unL�H�I��t`H9��_���I9�vR�91۸ A��@��x�Hc�A�A�<;�H��A�I9��j����� u�H�I��u��1�[A\]�f�fA���A��I9��(���[�� A\]ÐfA��A�A���L���1��f�H�I�M���UUL�i)H��ATS�fD��DŽ���L�VL9�r��_@��Vw�^D��{_@��]����I9����9A��@��yfL�aM9�r!A��_A��VwD�QD�!A��_A��]�����A�)�unL�H�I��t`H9��_���I9�vR�91۸ A��@��x�Hc�A�A�<;�H��A�I9��j����� u�H�I��u��1�[A\]�f�fA���A��I9��(���[�� A\]ÐfA��A�A���L���1��f�H����H9�sI���>@��yGL�VI9�w@���t@���t�F�x�@��>vM<�|IUH��L)�H��H�u��~E�fl�A]�@H��I��H9�sM��u�H��L)�I�0I�@�@L����1���ff.�@H9����:��~oL�BL9�r|�O1���}w�R�J���>v�J���~v�������~��=}vH�������f�H�H����Bf��H������H�>��������ø�����@UH��AWA��AVAUI��H��ATH�SH��(�]I�MXH�u�H�}ȉ]�K�H�M�I9���H9���E����M��I��H��u}�[fDA�$H�
��f��������-���i�����T��I�V�Af-��f��A�6H9U��:A�FI��I��A��L;u�sQI9�sLE���6I���H��L��L������o���H�}�I��I��A��A�D$��A�F�L;u�r��EE��L��L��D�M�H�M�H�u�H��([A\A]A^A_]��p@A�$H�
�f��������-���i�����T2��I�V�Af-��f��A�6H9U�wfI��I��A��L9u��n���L9��e���E��tSI���H��L��L������t���A�$I��I��A�F�벐I�������A�FI���fDE1�����L�u����I�����UH��AWA��AVAUI��H��ATH�SH��(�]I�MXH�u�H�}ȉ]�K�H�M�I9���H9���E����M��I��H��u}�[fDA�$H�
��f��������-���i�����T��I�V�Af-��f��A�6H9U��:A�FI��I��A��L;u�sQI9�sLE���6I���H��L��L������o���H�}�I��I��A��A�D$��A�F�L;u�r��EE��L��L��D�M�H�M�H�u�H��([A\A]A^A_]��o@A�$H�
��f��������-���i�����T2��I�V�Af-��f��A�6H9U�wfI��I��A��L9u��n���L9��e���E��tSI���H��L��L������t���A�$I��I��A�F�벐I�������A�FI���fDE1�����L�u����I�����H9�sK����y'H�FH9�r<��1���}w�V�J���>v�€��~v����f.������ø�����@H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.�H9��������\���=��������=�������=�������=)�������=�����r����G�������=�Q�������=�����0�1����wDHc�H�%�p��H�H�5��F��tH�rH9�r
f��f��ø�����@�2���H�H�5���F뾐H�H�5���F뮐H�H�5G��F랐H�H�5*�F뎐H�H�5��F�{���fDH�H�5O��F�c���fDH�H�5�'�F�K���fD������f�UH�I�H��S�����H�~H9�r(�x@��}w�~D�O�A��>���ǀ@��~��I9����9�@����A�A�L�YM9�r
D�_A��}vK���A�)�upL�L�H9��l���I9����9@��yKH�AI9�rB�G<}w;E1ɸ E1�D�YA�[���>vrA�[���~vi���E��tA��fD�����[]��I9�w[�[]�I9�v��9A�A�@���5���볐1��@)��@��D	�E��t�A��+���f.���9f����@��y�A�A�����ff.�f�UH�I�H��S������H�~H9�r,�x@��}w#�~D�D�O�A��>���ǀ@��~���A�L9����9@��y=L�QM9�r.D�WA��}w$D�Q�E�Z�A��>��A�€A��~�}���A�)�u?L�L�H9��N���L9�s)E1ɸ ��A�L9�r��� u
A���1�[]�fA��A�A��L9��T����� []�f.�f��A����}���ff.�UH�I�H��ATS�fD�����H�~H9�r(�x@��}w�~D�W�A��>���ǀ@��~��L9����9�@����A�A�H�YI9�r�_��}vW���A�)���L�L�H9��j���L9����9@����H�AI9����G<}wyE1�E1۸ �YD�c�A��>vxD�c�A��~vn���E��tKA��L9�s#�9A�A�@���M����֐L9�rK1�E����[A\]�[1�A\]Ð�������f�)���@��	�E��t�A�������9f����@��y�A�A�����ff.�f�H�I�M���EUH��ATS�D�����H�~H9�r,�x@��}w#�~D�D�W�A��>���ǀ@��~���A�L9����9@��y=L�YM9�r.D�_A��}w$D�YD�!A�[���>��A�ÀA��~�����A�)�uWL�L�I��tIH9��H���L9�s;E1Ҹ �f�A�L9��u����� uA�L�I��u�D1�[A\]ÐfA��A�A��L9��<���[�� A\]�fA��A�A���k���1��f�H�I�M���EUH��ATS�D�����H�~H9�r,�x@��}w#�~D�D�W�A��>���ǀ@��~���A�L9����9@��y=L�YM9�r.D�_A��}w$D�YD�!A�[���>��A�ÀA��~�����A�)�uWL�L�I��tIH9��H���L9�s;E1Ҹ �f�A�L9��u����� uA�L�I��u�D1�[A\]ÐfA��A�A��L9��<���[�� A\]�fA��A�A���k���1��f�UI�L�e�L�^*RH��AVL�42AUATS�����-H�~I9�r(�x@��}w�~D�O�A��>���ǀ@��~��I9����9�@���A��L�aM9�r
D�gA��}vI����)�uzL�H�I9��n���I9����9@��yUH�AI9�rL�G<}wEE1ɸ 1�D�aE�l$�A��>��E�l$�A��~�������t��������[A\A]A^]�f��f����D����A�|9�I9���[�A\A]A^]ÐI9�v��9A�A��@������A�<:�����1��@H��(R�:)��{���fD��A	�E��A��D��A��A��F�l/���D�����Ei�C�<,A�<{f�������)����������A��-�i����9A�Cf-��@���N����A���UH�I�L�"�L�(RH��ATS������H�~H9�r(�x@��}w�~D�O�A��>���ǀ@��~�������L9��:A��9@��ybH�YI9�r&�_��}w�YD�c�A��>���À��~������)�uXH�L�H9��W���L9�sB�9E1ɸ @��x�A�<:���fDA�A�L9��p����� t��D1�[A\]�f��f��D������-���i����A�|9�A��A�Cf-���@�f��D����A��A��F�d'������i��D�A�<{f��������D[���A\]�ff.�f�UH�I�L�b&RH��AWL�=V�AVAUATS�f.�����H�~H9�r(�x@��}w�~D�W�A��>��ǀ@��~�L9��+�9�@���JA�A�L�iM9�r
D�oA��}v[���A�)���L�L�H9��h���L9����9@����H�AI9����G<}��E1Ҹ E1�D�iE�u�A��>��E�u�A��~�����E����A��v���DL9�s[�9A�A�A�@���0���A�<;A��?���fD�f����D����A�|:�L9����1�E����[A\A]A^A_]�D[1�A\A]A^A_]�������ِH��$R�:)��ɐ��A	�E��A��D��A��A��F�t7�����i��D�A�<f����E��t�A����@��A�A�-�i����9A�Gf-��@���.�������H�I�M����UL��#RH��AVL�5��AUATS������H�~H9�r(�x@��}w�~D�W�A��>���ǀ@��~�������I9��RA��9@��yoL�aM9�r,D�gA��}w"D�aE�l$�A��>��A�ĀA��~�����A�)�uiL�L�I��t[H9��J���I9�vM�9E1Ҹ @��x�A�<;A����A�A�I9��`����� uL�I��u�fD1�[A\A]A^]�D�f��D������-���i����A�|:�A��A�Ff-���@�9f����D��D����A�ԁ�A��i��G�d%�D�A�A�<~f��������[���A\A]A^]�1��ff.�H�I�M����UL��!RH��AVL�5��AUATS������H�~H9�r(�x@��}w�~D�W�A��>���ǀ@��~�������I9��RA��9@��yoL�aM9�r,D�gA��}w"D�aE�l$�A��>��A�ĀA��~�����A�)�uiL�L�I��t[H9��J���I9�vM�9E1Ҹ @��x�A�<;A����A�A�I9��`����� uL�I��u�fD1�[A\A]A^]�D�f��D������-���i����A�|:�A��A�Ff-���@�9f����D��D����A�ԁ�A��i��G�d%�D�A�A�<~f��������[���A\A]A^]�1��f.�@H9�s�H�q��PH���@������f.�UH�I�E1�1�H��ATL�%�SH�0�L9���E��A��D	�H9�r@��tN��tZ1�@��u�>H��A�<�<;E��uD�H��G�F�D8�u7���D8�u/E1҉��@��[A\��]�fD1�E��[A\��]�E��@��[A\D)�]��L�	M�H�<H��vzH��H��H9�sn�G�H9�v< u^H���G�H9�u�L�^I��L9�vD< u@I9�����    t�����    uH��I9�r��@�� uH��H9�r�L�	M��f.�UL�ȇH��ATSH�ۈ�0f�L��H��I����?L�H��L��H��H�I1�H9�vBD�&L�ȃ�?L��F�$#L�Hc�I��M��A�I��L�M�bI1���u�H��M��H9�w�[A\L�	]M��H9��I����M���ff.�UM�A��H�H��AWAVD�uAUATSM9���H9���E����L��H��L�=��L�-ֆ�8@A��vW��tSL�ZD�bE�B�L9�L����H��I9�vA��t=E��E��t5D�L�ZL9�G���D�D�G�dE�B�E��u�H��L��I9�w�[E��A\�EA]A^A_]�VH��E����H��E1���ff.�UH��H�I�E1�E1�H�59�H��SH��H���&�D�H��F�F�E8��}A��H9�rE��t8L9�rE��tF1�E��uD�H��B�F�E��t�E8�uGE1��fDE��uW1�L9�r>H��[]�D�E��u�H��H��[H)�]�=z��DE��H��A��D)�[]�L��H��H)��z����밸�����ff.�f�H9�sK1�H����w*H��H�6ENH��H��H��t@�����
��t	�D�1�H�����@������f.�UH��AWI��AVI��AUI��ATI��SL��H��8H�	$XD�M�H�H��t
�} �Ѕ��I9��LA�����L��A�M��D�E�M��I��9E��9Euf�1f.�Lc�O�M9�L�]���L��L��L��L�U��z{������L�U�L�]�M�M��I9�trA�;E��;E��9E�uI�FH9�LE�I���H��L��L������z���M9�t5I�EXA�I�~I�wA��8uI��I��I9�u�E1�M9�A����A�H�e�D��[A\A]A^A_]���E��E9Et8L��M��M��I��I��L9���H��L��I���f.��E�M9�tYI���L��L��L�����~II���L��L��L���Hc�L���LO�I��L9���A�;Eu|M9�u�D�E��8���f�I����I���L��H��L�����Hc�Hڃ�HO�I��M9��A���;Et�;EuYL9�tII���L��H��L��������H���A�9E�������f�u�M��E1�M9�A�����A��������L��I��H��L9���M9�t��ˆE�;E���I���H��L��L�����H��L���ǃ��O�L���E�I���������fI���H��L��L�����Hc�L���IN�H�U��E�IFX��E�M9��L����E H�]��]����E��oHc�I�LL9�H�M�w}L��L���x��H�M���ujI�͋E�H��D�M�L��L�E�H�M�L��L��P�EP�EP�E���H�� ����M9�����M9�������u�I���L��L��L�������~FI���L��L��L�������~%I���L��L��L�����Hc�L�LO��I���A�EI�VX�}�@8<u�I���7���E1����I�GH9��f���A�I��@�}��U���I�GH�E����A�����ff.�UH��AWI��AVI��AUI��ATI��SL��H��8H�iXD�M�H�H��t
�} �Ѕ��I9��LA�����L��A�M��D�E�M��I��;E��;Eug�1f.�Lc�O�M9�L�]���L��L��L��L�U���v������L�U�L�]�M�M��I9�tjA�$;E��;E��;E�uI�D$H9�LE�I���H��L��L��������x���M9�t3I�T$I�GA�7A84$u I��I��I9�u�E1�M9�A���f�A�H�e�D��[A\A]A^A_]���E��E9Et8L��M��M��I��I��L9���H��L��M��I�����E�M9�tZI���L��L��L�������~II���L��L��L�����Hc�L���LO�I��L9���A�$;Eu{M9�u�D�E��7����I����I���L��H��L�����Hc�Hڃ�HO�I��M9��E�D;Ut�D;UuYL9�tII���L��H��L��������H���A�$9E��������u�M��E1�M9�A�����A��������L��M��I��H��L9���M9�t�D;U���D�U�H��L��L��I��$����H��L�����ǸO�L��E�I��$����D�U����YD�U�H��L��L��I��$����D�U�Hc�L���IN�H�U�M9��I����E H�]�D�U��]����E��nHc�I�L9�H�M�w~L��L����s��H�M���ukI�΋E�H��D�M�L��L�E�H�M�L��L��P�EP�EP�?���H�� ����M9�����M9�������u�I��$�L��L��L�����~HI��$�L��L��L�����~&I��$�L��L��L���Hc�L�LO��I���A�;E�u�I���>���E1����I�GH9��e���E�WI���X���I�GH�E�����A�����UH��AWAVAUL�,ATSH��H�M�L9���I��H��M��I��M����f�I���L��H��L��������I�Wx�H���IH�R��H��H���5�SH�RH��H��� �@H��I�T$=��)H��L��I�̈I9�w�L��H+E�H��[A\A]A^A_]�H��L��I�̈I9�v�I���L��H��L�������~UI�Wx�H����H�R��H��H��tu�SH�RH��H��td�H��I�T$=�~���I��A�L$��@�I��H��A�A�D$��q���fD�I��H��A�A�D$��(���fDA�$�CI��H��A�D$��1���fDA�$�CI��H��A�D$����fD��I��A�L$������H��1�[A\A]A^A_]�ff.�@UH��AVAUI��ATS�>L�gPtyI��H��A���I���H��L��H�����~H�HÀ;u�H��[A\L)�A]A^]�D��{A��H�CH��u�H��[A\L)�A]A^]�f.�H��H��[A\L)�A]A^]�ff.�UH��AVAUI��ATS�>L�gHtyI��H��A���I���H��L��H�����~H�HÀ;u�H��[A\L)�A]A^]�D��{A��H�CH��u�H��[A\L)�A]A^]�f.�H��H��[A\L)�A]A^]�ff.�L�GHE1����@L�GPA��q����UH��AVI��AUATI��SL�oPH���A���������A��$�I��$�H��L��H�����~-��H�TL��f�H��H���H�8K�uOH9�u�I��H���f�A��$�I��$�L��L��L���A��3H�SI�FA�|
A8|5t�[�A\A]A^]�8�[A\��A]A^��]ÐUH��H���EjP�EP�I����UH��AWAVAUATSH��H9�sZI��I��H��E1�A��I���L��H��L�������AN�I��H�I�L9�w�H��L��[A\A]A^A_]�@E1���ff.�UH��AWI��AVAUATSH��H��H�u�H9�spH��tkI��I��A��I���L��H��L�����AN�H�I�I��tL9�w�H�M�H�CI)�H)�M��ID�H��[A\A]A^A_]��L�u���f.�UH��AWI��AVAUI��ATM��SH��H��8L9�L��H�u�IF�L�M�L�EH��H���H�L����L�M�H��H�EL�0L��H)�H�E���H�EH�xt_H�E�L�I�HE�I)�L�m�M��I��H�E�t7I���H��L��L�������~;Hc�M�\
L9]���M��L+M�LM�H�EL�0H�E�H��8[A\A]A^A_]�@L9�w��u�H�EH�x��H�M�L��?L��I����P0��~�H�I��I�I���c����fDH�}�H��H��L�M�H�M���u��L�M�H�M�����@H��L��L��L�]�H�M��zn��H�M�L�]�I�M���f.�L�p�g����I9�v1���UH��AWAVAUATSH��(M����H��L)�H�H9�shL�M�M��I��I��H�M�E1�H�u�fDI���E1�M��L��H�M�L��L���P��twI���H��L��L�������~$H�A��I�I9�r�1�H��([A\A]A^A_]�DI��A��L9�w���f��U���t�I�A�A��E��t1H�E�M��L+U��}�D�PD�hvD�PE�D�P�@H��(�[A\A]A^A_]�@UH��I��L�H��AWI��AVI��AUO�,ATSL��H��8H�u�L�GXH9�r�L9���L9��iA����^L9U��TL�e�M��u?�DA�H��I��A�D$�A���A�L9�������M9������y�I���L��H��L��L�U�L�E���L�E�L�U����Lc�O�M9�v	M��M��M)�L��H��L��L�U�L�E�L�]�L�M��l��A�L�M�L�]�L�U���L�L�E�M��A�L9��^���L��H+E�H��8[A\A]A^A_]�@�A�$H��I��A���A�I9�vɅ�t�M9�v����y�I���L��H��L��L�U���L�Uȃ�~�Lc�O�M9�rDL��H��L��L�U�L�M�L�E��Jk��L�E�L�M�L�U�L�M���fD�����M��M��M)��DM����L9���L�e��'�A�H��I��A�D$�A�/L9���������y�I���L��H��L��L�E���L�Eȃ�~7��td��tO��u��3H�SI�D$A�4$H�Z�L�`��f�H��L����L�e�L9�rPH��81�[A\A]A^A_]��I��H��A�D$��I��H��A�D$��@A�$H��I��A�/L9��5������y�I���L��H��L�������~.��tA��t,��u��3H�SI�D$A�4$H�Z�L�`��H��L�����I��H��A�D$��I��H��A�D$��DUH��AUI��ATL�$SL��H��H���M�H�M��Z���H��D�ML��jD�E�H�H��L���?H�e�[A\A]]�ff.�@UH��AUI��ATL�$SL��H��H���M�H�M����H��D�ML��jD�E�H�H��L���@H�e�[A\A]]�ff.�@H��H���m��DUL�H�9H��SI�L9�s>I��f�H��D�H����?L�I��I��I��I��L�H1�I9�u�H�RH�H�9I�[]�DH�H��vpI��I��L9�sd�P�L9�v��� uUH���P�I9�u�L�VI��M9�v;�� u6I9�sA�x�    t�6@�x�    uH��I9�r��@�x� u	H��H9�r�H)�H������H9�r���ff.�@UH��AWAVI��AUL�,L��ATSH��H���H�M�L��H��������~nL�E�M��teHc�M�x�I�L�$I��thM9�s�a�I��H��L��H���Og��H��I�I9�@��I����H�@��u�H��L��[L)�A\A]A^A_]�DH��1�[A\A]A^A_]��I����ff.�1��ff.�f�UH��AWAVI��AUL�,L��ATSH��H���H�M�L��H��������~nL�E�M��teHc�M�x�I�L�$I��thM9�s�a�I��H��L��H���of��H��I�I9�@��I����H�@��u�H��L��[L)�A\A]A^A_]�DH��1�[A\A]A^A_]��I����ff.�UH��AWAVI��AUATSH��L�<1�H��xH�u(H�} �M�H�EL�mD�E�H��x���H�u0H�}�I�L��E���H��p���D�M�dH�4%(H�u�1�H�E�H�EL�m�I��H�E���H�}�H�E�L9�L�m���L;e�����^	L9��U	L�E�L��I��M��I��@�:E���:E��J:E��AI���L��L��H��L�E����L�E����#Hc�H�I9���L�H9U���H�{I�L$I9�D�X�I�uA��H9���D	�A��A��D!�I9���I9�A��D	Ʉ��I9���H9�������P�1�1�����f��o��AD
AH��9�w��E��D�މ�A)�L�I�<L�9��A���E���A�A�A�GA����A�A�A�GA����A�A�A�GA����A�A�A�GA����A�A�A�GA����A�A�A�GA����A�A�A�GA��ttA�A�A�GA��tcA�A	�A	�G	A��	tRA�A
�A
�G
A��
tAA�A�A�GA��t0A�A�A�GA��tA�A
�A
�G
A��
tA�A�A�GH��H�I�I�I��L9���L;e�����t	M�������L��H+E�H��p���H�}�H�H��x���H�L9���I�D$I9�I�E��I9�����MH�G�L)�H���<L)�foD�	1�H��H��H����ADAH��H9�u�H��H���I�I�H9��VH�}�I�D$A�E A�$ H9��:I�D$A�E A�D$ H9��!I�D$A�E A�D$ H9��I�D$A�E A�D$ H9���I�D$A�E A�D$ H9���I�D$A�E A�D$ H9���I�D$A�E A�D$ H9���I�D$A�E A�D$ H9���I�D$	A�E A�D$ H9�tvI�D$
A�E	 A�D$	 H9�taI�D$A�E
 A�D$
 H9�tLI�D$A�E A�D$ H9�t7I�D$
A�E A�D$ H9�t"I�D$A�E
 A�D$
 H9�t
A�E A�D$ f�1�H�]�dH3%(��H��x[A\A]A^A_]�@H�}�H�K�3M�L$tI9�w`A�uH��I��A�4$M�����f�H�SL9��_���H���i���D��1���H���A�TA�H�PH9�u��B���f�H�}�L��`���L��h���H�M���H�M�L��h�����L��`���tFL��h����CH�M�:E�t::E�t5H�}���L��`����s�L��`���H�M���L��h����	�3�!���H�}�L��H+E�M��I���A�@HDEH9�I���H��x�����I9���H�L����`H�W�L)�H���O�A~��L)�fo%R&H��H��fl�H����Ɉfo�L�fi�Dfo�H��fa�fo�fa�fi�fa�f��fg�@�H9�u�H��H���I�H9��cI���H�]�A�$I�D$H9��FI���A�D$I�D$H9��,I���A�D$I�D$H9��I���A�D$I�D$H9���I���A�D$I�D$H9���I���A�D$I�D$H9���I���A�D$I�D$H9���I���A�D$I�D$H9���I���A�D$I�D$	H9�tzI���A�D$	I�D$
H9�tdI���A�D$
I�D$H9�tNI���A�D$I�D$H9�t8I���A�D$I�D$
H9�t"I���A�D$
I�D$H9�tI���A�D$H��p���H�}L�e�H�]�L��H]I�L$
H�8I���L��I������H��I��I��A��A���A�E I�EH9��N���I��I�DH9�r�H��s+M���H��t�A�$A�MM��t�A�L�fA�L�뺐I�$I�}L��H��I�MI�L�I�L�I)�J�*L)�H���H��H�S�3L��`���H�}�L��h���H�M���{H�M�L��h���H��L��`��������I�������L9M�������I��H�KI��A�E�A�$I�D$�sM��I�����H�E�1�L)�f.�A�D A� H��H9�u��7���H��@I���I��A�D$�L9�u��i���A�$A�MA�L�A�L����L�e�1������^��ff.�@UH�1�H��AWI��AVAUATSH��1�H��hH�E�H�E HED����M�H�E�H�EL�uLuD�E�I��D�M�H�E���L;eL�m H�E�L�e��H�E�H�E�H�E�H��x���L��M��I��H�M�H��H�u�L��I����P(���-H�H�u�H�H�E�H9���L�M�L9���L�U�L9��H�E�L�U�L�M�H��tuH���9�L�M�L�U���t]L�U�H�M�H��L��I���L�M�H��x����P(L�M�L�U���~.H�u�I9���I9���H�}��E����M������H�u�I���L��L��L���P0��~5H�H�M�L��H�u�I�I���L���P0��~H�I�H�m�����@L��M��I��L��L��H+UH+E H�M(H�]0H�H�A���H�E1�L��A���H��I���L��H��L��L)�E1�H)�PxH�U�L��L��I���A���L)�H)�PxH����H��hD��[A\A]A^A_]�f�H�M�H��H�u�L��I����P(����H�H�I���L��L��L��H�u��P0����������I���L��L��L��I����P0�����H�I���H�M�L��I�I���L���P0���������������A��4����I��H��1�I��K�<.�W��H�}�H��1�L���V������fDH�U�H�u��M�H�}��wHcM�H������f�8�����H�E�H����H��H�L��L��H�E�I���L��H�u��P0������H�H�M�L��H�u�I�I���L���P0����H�u�H�I�H�u����fDL��M��I�������
���L��M��H�}(I��L��H+EA�GHDEH�H�E0H�}H�8���1�1����L��H�}M��I��H�E0H�8H�E(H�8����UH��H���EjP�EP�Y�����UH��AWAVAUATSH��H9���I��H��I��E1�L�m��!@H-I�WI��H=��LC�L9�s]I���L��H��L��L���P(��~YH�H�H�E�H=��w�H��H�5%NH����H��H�H�JH��t8��H�N�|8L9�r�H��L��[A\A]A^A_]�@H���f.�Hc��E1���UH��SH��H�u�H��H����P(��~
H�U�H����v�H��[]��H��H��H��H
��NH�qH��t����H��[]�D����f����H���tH���ff.�L9�M��L�WXLF�E��tL��1��"fD�<D�H��A�<:G�
D8�u$I9�u�1�I9���I9�B��f�@��D)���UI9�H��ATSH��L�_XIF�H�H9���D�D�H�~L�aG�G�E8���H9����FH�~�qE�E�3H�AH�E8�t'�H���w�H��E�3�p�E�3E8�uiH9�u�1�I9�tUIG�HG�������G�H)�H�H9�s3�A�s A�@8�t�9f��A�@8�u#H��H9�u�1�[A\]�A��[A\D)�]�@��[A\��@8�]G��H���u���L���m����M9�MF�L9�IG����ff.�f�E1��8����H�OP�����tH��@H�������u�H)��1��ff.�f�H�OH�����tH��@H�������u�H)��1��ff.�f�H��H�WPH�<H9�t1�fDD�>F�D�9H��H9�u��H��H�WHH�<H9�t1�fDD�>F�D�9H��H9�u��L�OP1���H����t(�<D�H��G�A�<9D8�t�@��D)��D1��ff.�f�H9����f��e�@H9�s+H�Gh�
�H�H�H��u�:�������������f.�H9�sXH�GpH�HH��t%fD�8H9�w
D�@I9�sH��H�HH��u�1��fDH��H)�������H����	���ø�����ff.�f�UL�H��ATM� SH�_XH�9L9�s<M���I��H��A��?�M�I��I��I��I��L�H1�I9�u�H�RI�[H�9M� A\]�ff.�@L�H����H���}L��H��H9�sqA�A�L9�sf�< uaI��A�A�L9�u�L�VI��L9�vF< uBM9���A�y�    t�DA�y�    uI��M9�r��A�A�< u!I��L9�r�L��H)����L9�s�A�A�L�WXI�Q�E�Z E:u�H9�sQI�A�E�I�G:
t
�;DL��H9�t �P�L�H�E:t�I��L��H)����@I��L��H)��z���H����I���w���L9��e����i���ff.�@UA�H��AWAVAUATL�$SL9�sN�H�W@I��I��Du�ADA�I��Dt.I��M9�u�A�!1�M��tI�0[A\A]A^A_]�t�D�>I����1��A��-�	E1�A��+�M��E1�1��f�����I��E�:�M9�t7A��@��	vA��@��wlA��@��9�}9�v�A�I��E�:M9�u�M9��W���M��tM�E��tc���wH��H��E���D���[H��A\A�"A]A^A_]�A��@��w�A����9��N���A�����D��x��E�����[����A\A�"A]A^A_]�f�I��A�E�;M9�������@I����f.�UA�H��AWAVAUATL�$SL9�sRH�W@�I��H��Du�DDA�H��Dt1I��M9�u�A�!1�M����[A\I�0A]A^A_]�t��>I����1��@��-��E1�@��+��M��E1�1�������I���M9�t7E�:A��@��	vA��@��wTA��@��9�}9�v�A�I��M9�u�M9��S���M��tM�E��uwH��H��E��HD�[A\A]A^A_]��A��@��w�A����9��f���A��I��A�M9��4�������I����f.�[�����A\A�"A]A^A_]�f�UH��AWAVAUL�,ATSA�L9�sNH�W@�I��H��Du�@DA�H��Dt-I��M9�u�A�!1�M��tI�0[A\A]A^A_]�t��>I��Lc�H�����1�I��I�Ɖ�@��-��E�@��+�M��1�E1��@��M��@��I��I�M9�t4A��{�@��	v�{�@��wp�{�@��9�}M9�v��I��M9�u�M9��H���M��tM��Eԅ�tZH��I9�wL��H�؅��-���A�"H��[A\A]A^A_]Ð�{�@��w��{��f�9��N����놐L��M��x�����A�"H��������[A\A]A^A_]�@�E�I��M9��������I����f.�UH��AWAVAUL�,ATSA�L9�sRH�W@�I��H��Du�DDA�H��Dt1I��M9�u�A�!E1�M��tI�0L��[A\A]A^A_]�t��>I��Lc�H�����1�I��@��-���E�@��+��M��E1�E1��!���M��@��I��I�M9�t5A��{�@��	v�{�@��wp�{�@��9�}I9�v�A�I��M9�u�M9��G���M��tM�E����H��I9��5���L��H�؀}�LE�[L��A\A]A^A_]���{�@��w��{��f�9��N���A���E�I��M9���������f.�I����f.�A�"I�����L��[A\A]A^A_]�@1��ff.�f�UI��E��H��AWAVI��AUATM��SH��H��(H���WD�mD�}H�H��t!H�M�H�}ȋ} D�M���L�]�H�M���D�U�utL9��j������A9�twA9�uA��H��I�SX�s�H�H�8�42@84:u/I9����PD9�t1D9�tlH��A9�uH��L9�HD�I9�u��H�e�[A\A]A^A_]øE9�t;H��I9������D9�t�D9���I9��H������I9�t�H�qH�{L9����QA9���I9������H�qH��I9�vY�QA9�uI9��a���H��H��I9�tN�D9�t�H��A9������T���f.�1�I9���H�e�[A\A]A^A_]�H��I9�t���1�����1�L9������L9�t�I9�tAH�AH�E���D9���I�KX����EȋE ���E���}�H��@8<t"I9�u�������H��H���H��H���H����E�H��H�M�E��L��M��L��H��PAWAUD�U�L�]����H�� L�]�D�U����Q���I9�t�I�KX�L;e��a���H�A�QH�E��P���f.�UH��AWH�EAVAUL�,1�ATL�eSD���LeH�] I��L9eA��L;U��A���"L9��H�UH�I���>fDE8�tcE8��2D�X�E�Z�H��M9�L��H��A��M9�A��E��tMI9�tHD�H�CL�RA8�u�L�~M9�t��VL���P�A�R��fDA�B�H����P���L��H+UH�}0H�H�}(H�M9���H�PI9�I�R��H9�����&I�T$�L)�H���L��foI�	1�L)�H��H���DAH��H9�u�H��H���I�H�H9��I�R� A� I9��I�R�@ A�B I9���I�R�@ A�B I9���I�R�@ A�B I9���I�R�@ A�B I9���I�R�@ A�B I9���I�R�@ A�B I9���I�R�@ A�B I9�tuI�R	�@ A�B I9�tcI�R
�@	 A�B	 I9�tQI�R�@
 A�B
 I9�t?I�R�@ A�B I9�t-I�R
�@ A�B I9�tI�R�@
 A�B
 I9�t	�@ A�B [1�A\A]A^A_]�@H�M(H��H+EH�s�GHDEL���L���H�H�E0H�MH�H�BL��H)�H9���H9�@��	�M9�@��L9�A��D	�!�I�t$�H)�H��@��@���YH�I9�@��L9���@��?�~��H��fo-g
1�H���f��fl��Ɉfo�fi�Dfo�$fa�fo�fa�fi�fa�f��fg�H��H9�u�H��H���H�H�H9�����H����H�BI9������BH����CH�BI9�������BH����CH�BI9�������BH����CH�BI9��v����BH����CH�BI9��[����BH����CH�BI9��@����BH����CH�BI9��%����BH����CH�BI9��
����BH����CH�B	I9�����B	H����C	H�B
I9������B
H����C
H�BI9�������BH����CH�BI9�������BH����CH�B
I9�������B
H����C
H�BI9��h����BH����C�U���fDM)�1�� A� H��L9�u�[1�A\A]A^A_]�H��L�U1��r���1�f��H���@�4H��H9�u���H��H)��f�H���ff.��H)�H��I�@H9�HF�H�I�0�@�+u
�G�V
)��ff.�@H9�s�H�W@�T����1Ҹ�������UH�H��AWAVAUATSH9��/H�PRL�P@�f.�H��H9���H��A�Du�@ը�u
H��H9���L�V	L9�LB�L9��e�D�X�A��	�TH��1��DD�;E�_�A��	�>H��E��H��I�CI9�u�L9���E��1�A)�E�*M��E�e�A��	��I��������L9�vI��L9��fA���\H��E��I��A��I�DM��L9�w�H����D)�E1��L��I��E����fDH��I�1�A�![A\A]A^A_]�fDM�@��-u5���PH����Ѓ�"A�1����*����H����M�[A\A�A]A^A_]��A��.�U���H���E1�1�E���g���I9��&E�A���A��E�M�SL9��E�sE�n�D��A���fM�SL9�����~A��-u`L9���A�sD�n�A��	��1�A��-u2��fD�4�E��I��A�tuL9���E�2E�n�A��	w{D�3A��~�M��M�H�����A�"�������H��������@��-�����H�������I��L9������w���M�RL��M������1�A��-u���M�Ӑ���s���E��tH����u���H��M�����@��-�jH���]���A�"H�����������E1�A��4I��������A��L9�uM�ZA�H�����H���UD)�I9�r���I��L9������E�E�j�A��	v�E���*�������A�H������I��1�����@��-�����H�������A�"1��T����4�E��I��A�tuL9����E�2E�n�A��	����A��A)�A��~�M��M�1�A��	���H��������H9��;���H�4�H�6�������H9��!���H��H���������@H9�����H��H���u����H����H���������y�����H�5C^Hc�H�4�1�H��H�H9�H���C���I9����E�+E�U�A��	M��w1A�E)��E�*E�]�A��	wC�I��L9�u�I�����1�M��A��.�����M�ZL9����E�RE�j�A��	v�X���DE�E�j�A��	�A���I��L9�u����A��-�����M�Ӆ���������H��H9�����A�"H�����ff.����f.�UH��H��H��H��H���L��p���L��x�����t )E�)M�)U�)]�)e�)m�)u�)}�H�EH��8���Dž8��� H��@���H��P���Dž<���0H��H����T��ff.�@H�����H�к��H��HD�L��H�H��H��	f�UH��H��ATI��SH��PdH�%(H�E�1��E�M��y����1�I���������L��I��A�@0H��H�э��)ЈE�I��	��L�]�I�s@fDH�ȃ�0H��I��H��D��E�D)��H��H��u�I��AI)�M9�MG�L���e9��I�H�]�dH3%(u>H��P[A\]�f�I���-I��H����K����A�H�u���/;��ff.�@UH��I��H��SH��XdH�%(H�E�1�M��y�����1��E�M����L�U�I�r@y/L��L�U�H���������H��I�r?H�����A)�A��0D�E�I��I���������fDL��A��0H��I��H�����A)�D�I��H��u�I�R@H)�I��L9�L��IF�H�
�68��H��H�]�dH3%(uAH��X[]�D�E�0H�uߺ��f�I���-I��H���������9��ff.�UH��H��SH��H��H9�H���H��HF�H����5��H��H��[]�ff.�UH��H��SH��H��H9�H���H��HF�H���5��H��H��[]�ff.�H�����v5��fDUH��AUATI��SL��H��L9�L�mIG�L9�HF�H��u&I�I�EH��M�eH��[A\A]]�f�H��H��H���">����H��H��H���3f���t��tf1���tO�fDH9���H�@��D��H������DtH��H9�u�H��H)��fD�>.tC�f.�H9�s[H�@��DuMH������Du�H��H9�u��H�FH9�t"�~0t���80u�H��H9�u��1�ø��1�I9��UH��AWAVAUATSM����H��N�4L)�L�L9����H�XL�yH��D�,H�AH�E��f.�L��M9���L�RA�B�D8,u�M9�tL�AA��8u�L;u�t5�B�Y�8u�����D�$H���B8'u�I9�u�E��t+I)�A�A���}E�QE�QvE�QE�E�QE�A�[A\A]A^A_]�f����U���t�I�A�A��1�[A\A]A^A_]�ff.�L�M���xU�1�H��AWAVAUATI��H����SH��H�����H����tH��H=��A�Af��t���A��H�<[H��D��=��E��t,f9�=��A��fDF�=��f9�=��fC�=��A��D��H�<[A��H��H��fD��=��f��=��D��=��H=�z���L����H����I��1�H�
���L���Z=��f.�A�I�E���0A�W
A�O)ʃ�Lc�L����I�GH����L��1�H���1����H������H����t;I�$A��0f9�r�fA;G
w�f��t�)�H�HȀ8Lj��H����uŃ�I�����S����A�UH����H�H��tc�o���L�����S��H��I�� H��H�����Ao$I��H�	H��H9�u�Hc�H����H��Hf�1���H��[A\A]A^A_]Í{Hc�H����H����H�H��t΅�t��o������^���똸�fDH��H)��f�H�H��vpH��H��H9�sd�P�H9�v��� uUH���P�H9�u�H�~H��H9�v;�� u6H9�s:�x�    t�/@�x�    uH��H9�r��@�x� u	H��H9�r�H)��H9�r��fDUE��H��AWI��AVI��AUATM��SH��H��H���WD�mH�H��tH�MȿD�M���H�M�D�]���u}L9����1D�E�������A9��bH��A9�u@�DH��I�GX�S�H�y�1�80u/I9�t?�QA9���A9�tMH��A9�uH�AI9�HE�I9�u��H�e�[A\A]A^A_]Ð1�I9���H�e�[A\A]A^A_]�f��I9�t�H�OH�SI9����wA9��I9�t�H�OH��I9��|�wA9�uI9�t�H��H��I9�t��1A9�t�A9������H�����A9�t�H��I9�t-�Mf.����9�tA9�u7I9�tH��H��I9�u�1�����H��I9������1��H���I9�t�I9�tCH�GH�E���A9���I�OX��D�mM��D�E��D�U�H��D:$tI9�u�������H���-���@H�C�I9�t�EH��H�M�E��jM��L��H��PL��ARD�UD�]��s�H�� ���W���I9�t�I�OXD�]�D�U�L;e��]���H�G�WH�E��L���f��L�WXA��H��H9�vA�Ӊ�I9�sE��L��L9�t:I�I9�sa1��A�<A�<:@�<H��H9�u�9D)߉9�f�L�L9�s'��H��A��V�I9�u���f.�D)�1��9��H�whH��tGH��H���H��H9�t7f�8v� 1�1��fDH��H���t#�V9�t��f�1��D�0���@���DUH��ATI��SH���~���	C�H�{Hf���ƃ� t1H�{Pt*H�{@t#H�{htI��$�H�spH�{h[A\]���[�A\]�fDH�WX1�H��t�Ja8JAs1�:JB����
�H�XtWUH��SH��H������H�sX	CH��t1����1���8�v	H�����H��H=u�H��1�[]ø�ff.��1��ff.�f���%�@��?u��H��N��fD��A����A����A����������?A��?A��DE�@����@��t/���A�E��F�A���D!�E!��A��D	�D	�A	�@��t/���A�E��F�A���D!�E!��A��D	�D	�A	�@��t/���A�E��F�A���D!�E!��A��D	�D	�A	ȃ� t&���Fξ��!�A!��A��D	�	�A	�D	��@A���E��D��D�A���D!�E!��A��D	�D	�A	������A���A��!�A���%���MH9��tH�V�H��H��H)�H)�H��v6H��fv�H���H��oH��f�@�H9�u�H��H���H�H9���H�G�H9���H�G�WH9���H�G�WH9���H�G�WH9���H�G�WH9���H�G�WH9���H�G�WH9���H�G�WH9�vvH�G	�WH9�vjH�G
�W	H9�v^H�G�W
H9�vRH�G�WH9�vFH�G
�WH9�v:H�G�W
H9�v.�WÐ��t%H��H9�s��H��H���W��FH9�r��fDH��H9�w����H��H����ЈW��FH9�v��f��ff.�@UD��H��AWAVI��AUI��ATI��SH��H��H9�A��%��E�E��tME��tHA��@tyD���I��H��D�M�I)����E9�EG�E��L���L�L��A�PxI9�D�M�A�NjMD��H��L������U̅�tE��u2H��H��L)�[A\A]A^A_]�D�MD��H��L������E̅�t�M���L��H��L��H)�A���L��A�Px�ff.��UH��AUI��ATI��SH��H���M�H�M����H��D�MH��jD�E�J�#H�L�����H�e�[A\A]]�f�UH��AWI��AVAUE��ATI��SH��H��L9�MA��A��E��twE��trA��@u2D��H��L�����E��uwH��H��L)�[A\A]A^A_]�f.�D���M��H��D�M�I)�E9�EG�1�E��L��L���%��I9܋MD�M�A��D��H��L���H���E��t�E��t�fDL��H��1�H)�L���%���q���UH��AUI��ATI��SH��H���M�H�M��~���H��D�MH��jD�E�J�#H�L������H�e�[A\A]]�f�H9����H�ǃ���D��_���A��>v[L�BL9����J���H�
�IH��A�H�H��u(�G<v�� 1�@��w�B�P���>v=�P�1���|v3�f�H��IH��BH���f.�H����������f.������ø�����@��H��\tUH9�s`@�2���1�H����w3H�I�p�ƅ�t"=�~�H�rH9�r
f��f��ø����Ð�_���f�������f.�1�H9�r�7�H��H��H9�v��y_@��>v��y�H��H��H9�w��D�ff.�@UA�A�\H��H��j�%���H9�sS����y#�y_@��>vH�FH9�r;�A<v�� 1���v��F�P���>v
�P�1���|w��@�����ø�����ff.��H9���H����I���>@��yCH�FH9�rD�WA��vXD�W A��vN��_@��>vUH��L)�H��H�u��~E�fl�A]�H��I��H9�vM��u�H��L)�I�0I�@�@D�VE�Z�A��>vE��y�A���w�H���f�1���ff.��H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.�UH�I�H��ATS�fD��x_@��>�(��� H�~H9�r�x@�����x @�������A��A�I9�vy�D�P_A��>������L�QM9�rD�PA����D�P A�����E����A�)lj�u!L�L�H9��B���1�E1ۿ E1�I9�w�[A\]�D�N�>E�Q�A��>vA���A��|�C���f���A�A����=�����E������[�����A\]�f.���A��A������@D�QD�!A�Z���>vA�€A��|����fA��A��E��t�A������UH�I�L�EH��AUATS�D��x_@��>�(��� H�~H9�r�x@�����x @���������A�I9�vx�D�X_A��>������L�YM9�rD�XA����D�X A�����E����A�)lj�u H�L�H9��C���1�1ۿ E1�I9�w�[A\A]]�D�N�>E�Y�A��>vA���A��|�C���f����A����=���@A���E���y���[�����A\A]]�A�<��A������D�YD�)E�c�A��>vA�ÀA��|����fA��A��E��t�A�����ff.�UH�I�H��S���x_@��>������H�~H9�r�x@���
�x @�����A�L9�� �9D�W_A��>vl@��ygL�QM9�rD�WA����D�W A��v~���A�)���L�L�H9��[���L9����9E1ɸ D�W_A��>w�D��A��D��A�L9��e���- ��A��D�Q�E�Z�A��>vA�€A��|�b���f��A����\���fD�~D�D�O�A��>v
�ǀ@��|���fA��A�A��L9����- []�f�1�[]�ff.�UH�I�H��AUATS�@��x_@��>������H�~H9�r�x@�����x @�����A�A�L9�se�9�__��>v|@��ywH�YI9�r�_�����_ �������E��tSA�)�u0L�L�H9��Z���E1۸ E1�L9�r�1�E����E����[A\A]]�f.���E��u�[�����A\A]]�@��A�A��H���@�~D�D�W�A��>v
�ǀ@��|����fA��A�A��A�������YD�)D�c�A��>v�À��|����fA��A��E���h���A�����D[1�A\A]]��H�I�M����UH��ATS�D��x_@��>������H�~H9�r�x@�����x @�����A�I9����9D�__A��>vl@��ygL�YM9�rD�_A����D�_ A�������A�)�ulL�L�I��t^H9��U���I9�vP�9E1Ҹ D�__A��>w���A��D��A�I9��e���- uA�L�I��u�1�[A\]�f��~D�D�W�A��>v
�ǀ@��|����fA��A�A��I9�����[- A\]��D�YD�!A�[���>vA�ÀA��|����fA��A�A������1�ÐH�I�M����UH��ATS�D��x_@��>������H�~H9�r�x@�����x @�����A�I9����9D�__A��>vl@��ygL�YM9�rD�_A����D�_ A�������A�)�ulL�L�I��t^H9��U���I9�vP�9E1Ҹ D�__A��>w���A��D��A�I9��e���- uA�L�I��u�1�[A\]�f��~D�D�W�A��>v
�ǀ@��|����fA��A�A��I9�����[- A\]��D�YD�!A�[���>vA�ÀA��|����fA��A�A������1�ÐUH�I�L�
�<H��ATS����x_@��>������H�~H9�r�x@����x @���
�A�L9��0�9D�__A��>vt@��yoL�YM9�rD�_A����D�_ A�������A�)���L�L�H9��W���L9����9E1Ҹ D�__A��>w�f�A�<9A����A�A���L9��X���- ��A��fDD�YD�!A�[���>vA�ÀA��|�V���fA��A�A���N���@�~D�D�W�A��>v
�ǀ@��|����fA��A�A��L9�����[- A\]��1�[A\]�f�UH�I�L��:H��AVAUATS���x_@��>������H�~H9�r�x@�����x @������A�L9�sj�9D�g_A��>v{@��yvL�aM9�rD�gA����D�g A�������E��tSA�)�u/H�L�H9��U���1۸ E1�L9�r�1�E����E����[A\A]A^]�@A�<:��E��u�[�����A\A]A^]�DA��A����;����~�D�_�A��>v
�ǀ@��|�
���f��A��û����D�aD�1E�l$�A��>vA�ĀA��|����fA��A��E���i���A�����f�[1�A\A]A^]�DH�I�M����UL�	9H��AUATS�@��x_@��>������H�~H9�r�x@�����x @�����A�I9����9�__��>vf@��yaH�YI9�r�_�����_ ��������)�u{H�L�I��tmH9��\���I9�v_�9E1۸ �__��>w�@A�<:����f�A�A���I9��`���- uA�L�I��u�1�[A\A]]���~�D�_�A��>v
�ǀ@��|����f��A���I9�����[- A\A]]��YD�)D�c�A��>v�À��|�
���fA���A������1��ff.��H�I�M����UL�I7H��AUATS�@��x_@��>������H�~H9�r�x@�����x @�����A�I9����9�__��>vf@��yaH�YI9�r�_�����_ ��������)�u{H�L�I��tmH9��\���I9�v_�9E1۸ �__��>w�@A�<:����f�A�A���I9��`���- uA�L�I��u�1�[A\A]]���~�D�_�A��>v
�ǀ@��|����f��A���I9�����[- A\A]]��YD�)D�c�A��>v�À��|�
���fA���A������1��f.�f�H9�s+�
H��<�H�H�H��u�:������@������f.�H9�s;H��H�
��M��H��H��t@�����
��tÐ�1�H�����@������f.�UH��AWI��AVAUATSH��H����I��A�����H��L��L�5�+RL�-�>�!@Hc�A��A��H����H��H���H�_�H�q��y�H��Hc�M�L�H��A�D�A�T$��DE� tpH��tj�Q�H��f��A�D�ucA�y~�H��H��L�E�L�M����L�M�L�E�H��A�AH��A�D�C�D8�H���k���H��L��[A\A]A^A_]�f�A�y�C����f�H�qH�_��.���UH��AWI��AVA��AUI��ATSH��L��H��H��L9�LF�M��L�����L��H�����E��D�MH��M9�L��MG�L9�J�IG�H��jH�A)�����}ZYyI9�wH�e�[A\A]A^A_]�L��H�4A���L��H)�I����PxH�e�L��[A\A]A^A_]�ff.�@UI��J�tH��AWM��AVI��AUATSH��xdH�%(H�E�1�H��P�`E1�H��p���N�l3M��� B�3M����C�D=L��H�����L��L��I�����I9�H��IF�H�<3H9��ND�E�MH�SI�ME8���H9��6D�CE�MH�SI�ME8�t�xH��H��D�B�D�I�E8�uaH9�u�1�I9�t��H)�H��H����	���؉�DM��tL���t��H�u�dH34%(����H��x[A\A]A^A_]��A��D)���L��H��L�������DL��L��H��H��h������H��h��������1�H��`���L��h����q��L��h���H��`���H��I���w���DI)�L���	�����.���L��H�����H������F��fDUI��H��AWI��AVAUM��ATSH��H��xdH�%(H�E�1�E��tL9�IG�J�t+L�cH��P�}L��p���L��H��M�L���
��L��L��L��Ƅp����
��C�,H��L�����L��L���|���L��L���A����H�M�dH3%(����H��x[A\A]A^A_]��1�L��h�����p��L��h���H��I��H��I�L���*
��A�L��L��L���
��C�,H��L�����L��L�����L��L�������H��p���I9��`���L����q���S�������ff.�f�UH��AWI��AVA��AUI��ATSH��L��H��H��L9�LF�M��L�����L��H���p���E��D�MH��M9�L��MG�L9�J�IG�H��jH�A)����}ZYyI9�wH�e�[A\A]A^A_]�L��H�<1�H)��O
��H�e�L��[A\A]A^A_]�ff.�f�UI��H��AWAVAUATSL��H��xdH�%(H�E�1�L9�IG�M9�IF�I��H�tH��P�ZE1�L��p���O�|4M���C�4H����A�L��L���t���H��L��I���f���I9�H��IF�I�<4I9��OA�$A�M�T$M�O8���L9��<A�T$A�OM�T$M�O8�t�zf�I��I��A�R�A�I�8�ubI9�u�1�I9�t��H)�L��H������؉�fDM��tL����o��H�}�dH3<%(����H��x[A\A]A^A_]����)��H��H��L���
�����DL��L��L��H��h����s
��H��h���������1�H��`���L��h�����m��L��h���H��`���I��I���}���DI)�L���������6���fDM��L������DL�������UI��J�tH��AWI��AVI��AUATM��SH�ZH��xdH�%(H�E�1�H��Pw}L��p���L��L�L���	��L��H��L��BƄ=p����	��B�#L��L���i���H��L���^���H��L���#����H�M�dH3%(����H��x[A\A]A^A_]�D�1�L��h����l��L��h���L��I��H��H�L���
	��L��H��L��C�D=���B�#L��L������H��L������H��L���
����H��p���I9��]���L���m���P�����
��f.�f�UH��ATI��SH��H�I�L$H9��xH���<&����<=����</��<<��A�D$ H�CH9��8�{<�.A�D$ H�CH9���{<�A�D$ H�CH9����{<��A�D$ H�CH9�H�����{<���I�|$I�L$A�$H��[A\]��<
t
B�P���w>H��H9�����1���f�<[��<|uH�K�	�f�< t�<\��P߀�]����0H�=�SVH�u�H��H����P(����Hc�H�E�I�|$H�A�D$$��<���f�H����-���H�CH9��E��@��]t+H��H9�t���[u�H��H��H9�u����H��u�H�H�����@H�K����f�H�K�A�D$ ���f�H�K����f�I�|$H�ٸ�x���fDH�SH9�s�{ut+A�D$$H�K��P���fDH���S���H��1��8���L��RV�sM�@@A�|0y�A�D$$�/�p���vC�p���w@��7��x9A�t$$H�����A�D$$H9�t$��pЃ�	wƉ���H���������W��H�Ѹ���ff.�@���1�H�D1�H�񋗐H��H��f����1�H�D1�H��������H��H��H���H9��g�����1����vu����������L�FL9��BD�NE�A�A��?wG�V�€��?w;A���w���t0H��E���Ҹ���I��I	�L	�H��1�A�������H����L�FL9����V�€��?w�H���Ҹ��H	�H��fD���w�L�FL9���D�NE�A�A��?w��V�€��?w��v�ƀ@��?�r�������]���A���v1�����X���H��E��@���ҁ�I���I	�H��L	�H	�H�7�f������ø����ø����ø������H�G�@0��t��t@��t+H�tHH�1��fDH�aHH�� ��H�IHH��ËG$��G(H���H����f���f�W 1�f�W"H�W H����H���vH�����H���Q҃ ��H�����H�WH�OH9������xHH�wH���G(H�W�G$L�FH�v�6��I�0H�H�FH�f�8��H�PH���<���<���L�BI9����r�ƀ@��?w~H��@��L��%�H	�H�wH�WH9��I����I���G(D�G$L�NO��M����H�vB�4��H�I�AH�f�8�c���H9�����������f�<�v$@H�G0���H�H9�v{H�O����@L�JI9�w�D�RE�B�A��?w��r�ƀ@��?w�A���w<�t�H��E��@��L��%�I��L	�H	��#���fDH�YFH��������H�W���ÐUH�8FH��AUATL��`���SH�]�H��L�E�M�D�eH��h���H�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��5@L����A��H�E�f�8u:H������E��~^D9�uYH��`����f��t�H�PH��`���D�H�E�f�8t�H�PH�U��D9�uE���D��H�Ĉ)�[A\��A]]��E��t�1҅�y�H�Ĉ��[A\A]]�ff.�f�UE��H��H��AQM��I��H��H��H�w`������ff.��������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L��3���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��L���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH�HCH��AUATL��`���I��SH�]�H��H��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��CDL������A��H�E�f�8uGH�����E����D9�������H��`����f��t�H�PH��`���D�H�E�f�8t�H�PH�U��D9�uE���E��������I�T$I�L$�H�	��Hc�D�QA9���H�]��@H���P�����~"A9���H�E�f�8t�H�PH�U�����H�Ĉ1�[A\A]]�f.����q������i���I�D$I�T$�H���H��BA9�ubL��`����f�L������A��E��~�D9�u;H��`���f�8t�H�PH��`���D���DH�ĈA)�[D��A\A]]�@H�ĈD��)�[A\A]]�ff.�f�M��I��H��H��H�w`����ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��R�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UI��H��AWAVL�]�AUATSH��hL�O`H��x���M�2M�8L��p���I�AI�I�H�	��H��AH�}�H�@H�u�H�1���H�u�H�}���H�E�L�M�H�}��rf�L��������~qE1�9���L�������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��x���L�0H��p���L�8H��h[A\A]A^A_]�L���h�����~�9�u E��H�E�E�ef�8t�H�xH�}����f�D��I�wH�RH�<V��H��L��M���?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H�U�L�H1�I��H9�u����f�UH��>H��AVAUL�]�ATI��SL��H��@L�)H�O`H�u�H�M�0H�E�1�H�u�H�M�H�}��\L�������~aL���?J�1������Hc�H��L��H��H�L1�H�у�?M�lI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�,$L�3H��@[A\A]A^]��UI��L�Q�H��AVAUATM��SH��H��@H�FH�UH�H�FD�H��tvA�$��tnA�����A��H�AD�(D�0fA��E��t>f�x�;M9�wNL��L9�vD��H����A�A�,$H��@[A\A]A^]��I��H��u�H��@L��[A\A]A^]�fDfE�+E�4$I�CI��E�^�E�$H����E��t�I���M����L�M�I�L�M�H��<H�u�H�E�H�}�L9�v�I��H��<L�u�1�M)�I��M�f��uffDL����…��`�����I�CA�M9�uA�,$�)���DI��A�S�A�$��A�$L9��&���������H�E��f��t�H�PH�U���L�L�M�H�U��C���I�����UH��AWA��AVI��AUI��ATL�$SL��H��(�E@��H���L��L��PH��M�^`I��PL��L�E�L��L��L��D�}�L�]�����Y^H��I9���D�}�u�A������L�]�I�CI�S�H���H��BL��H)����f��9�Gօ���D�B�����A�����@��H��H	�H��H	�H��H	�H��H	�H��H	�H��H	ȉ��H����H	�H��H�E�H�E�H�LH��f.�foE�H��@�H9�u�։у��)�H�C9�t9f�8��t1f�x��t(f�x��tf�x��tf�x��t
f�x
��tf�xJ�\C�U1�L��H���=��E��tiI9�vdI�F`H�PH�@�H���H��BH�����DH��H�w`�M�L��AQL��M��L�E��I���H��XZI9�w/�U1�H��L������H�e�H��L)�[A\A]A^A_]�f.�D�}A���U1�H��L�����E��t�I�F`H�PH�@�H���H��B��I9�v�H��H���I9�v�I�t$�H)�H��H�tpH���P�I9�v/H�X�H9��e�����U1�H��L���"��E������E���H���=�����H���w���f�UH��AWAVAUI��ATL�$H��SH��0L�`D�u�M�AQL��M��L�E�L���&���ZYH��I9��p�E̅���A��@��A�0L���у� A�0E���H)����9�G�A�����nD�B�A������@��D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�H��H��H�|;�foE�H��@�H9�u�A�щ�A��D��D)�H�CD9�tN@�0�H��tC@�p�H��t7@�p�H��t+@�p�H��t@�p�H	��t@�p
�H��t@�p�H
J�\C1�D��L��H���s��E��t6I9�v1f�L��H��1�H)�L�����1�D��H��L���8��H�e�H��L)�[A\A]A^A_]�1�D��H��L�����A��t��D1�D��H��L������E��t��f���H������fDUI��H��H��0H�wH�WL�]�H9�sT���xM��H��A�B(H�M�I�JI�rA�B$H�yH�I�	��H�H�H�AI�f�8t�H�PI����f�L���x���~dI�JHc�IrI�rH�E�H;��H����H��A�B(A�R$H�yHc�H�<�H��tvH�I���H�H�GI�f�8u�I�R�:���I�RI�J�����H9��v���I�B0���H�H9�r2I�R�����DH��5I�������L���H���I�J�����ff.�UH��5H��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL���@�����H�E�f�8u7L���,�����~X9�uTH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u���)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.��������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L��C���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UM��I��H��H��H�w`H��H��j����ff.�@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH��2H��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL���`�����H�E�f�8uDL���L�������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u��ƅ�������I�UI�M�H�	��Hc��Q9���L�e���L�������~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L���8����Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H��/H�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}������~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}�������~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH�H.H��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H�������~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UL�Q�H��AWAVAUM��ATI��SH��H��HH�FH�UH�H�FD�H��ttA�E��tlA�����A��H�AD�D�0fA��E��t<f�x�1I9�wLH��I9�vD��H���+A�mH��H[A\A]A^A_]��I��H��u�H��HH��[A\A]A^A_]�@fD�H�CA�]I��D�[�E�]H����E��t�H���O����L�M�I�L�M�H�n,H�u�H�E�H�}�I9�v�M��H�S,L�}�1�I)�I��I�f��u]fDL��� ����…��`���H�C�3L9�uA�m�+����H���S�A�E��A�EI9��/������'���H�E��f��t�H�PH�U���@L�L�M�H�U��K���H�����UH��AWA��AVI��AUI��ATL�$SL��H��(�E@��H���L��L��PH��M�^`I��PL��L�E�L��L��L��D�}�L�]�����Y^H��I9���D�}�u�A������L�]�I�CI�S�H���H��BL��H)����f��9�Gօ���D�B�����A�����@��H��H	�H��H	�H��H	�H��H	�H��H	�H��H	ȉ��H����H	�H��H�E�H�E�H�LH��f.�foE�H��@�H9�u�։у��)�H�C9�t9f�8��t1f�x��t(f�x��tf�x��tf�x��t
f�x
��tf�xJ�\C�U1�L��H���͹��E��tiI9�vdI�F`H�PH�@�H���H��BH�����DH��H�w`�M�L��AQL��M��L�E��I���H��XZI9�w/�U1�H��L���_���H�e�H��L)�[A\A]A^A_]�f.�D�}A���U1�H��L���%���E��t�I�F`H�PH�@�H���H��B��I9�v�H��H���I9�v�I�t$�H)�H��H�tpH���P�I9�v/H�X�H9��e�����U1�H��L��貸��E������E���H���=�����H���w���f�UH��AWAVAUI��ATL�$H��SH��0L�`D�u�M�AQL��M��L�E�L���&���ZYH��I9��p�E̅���A��@��A�0L���у� A�0E���H)����9�G�A�����nD�B�A������@��D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�H��H��H�|;�foE�H��@�H9�u�A�щ�A��D��D)�H�CD9�tN@�0�H��tC@�p�H��t7@�p�H��t+@�p�H��t@�p�H	��t@�p
�H��t@�p�H
J�\C1�D��L��H������E��t6I9�v1f�L��H��1�H)�L���M��1�D��H��L���ȶ��H�e�H��L)�[A\A]A^A_]�1�D��H��L��蠶��A��t��D1�D��H��L��耶��E��t��f���H������fDUH��AWAVAUATSH��H��8���dH�%(H�E�1�H����L��@���I��I��E1�I�����L��H��0����.DH��H���1�I���H��0���H�H)�tLM9�vGK��H�A�H��	v�H��H���H��AH��v�H��H�1"1�I���H��0���H�H)�u�@H��8���1�M��H�
�!H��!���|�H�E�dH3%(uH�Ĩ[A\A]A^A_]�L��@������f.�UH�B�H��AWI��AVAUATSH��XH�E�1�H�}�H�M�L�E�L�M��E�H�E�M���=H�u�fDH�E�I��H��vzL�m�M��@I��w_H�E�L�p H�@H��H�PI��I9�sBN�$�I���K�<�uA�~RuL��L��L��������lI��XL9�w�I��I��u�H�E�H�M�H���H;�SH�ω�H�I��H��H���:H�w�����H�QH���H�E�H�u�H�m�H�U�L�}�f��H9���f����I��fA�G�H��H��u�H�U�L�}�H�}�����L�}��E�H�M�H�}�1�fA�H�9H��X[A\A]A^A_]�DA�~RuL��L��L�������tI��XL9�w�A����M��M��H�u�H�U�I�M0Le�L�}�L)u��H9��J���fDH�U�L�}�H9U��V���f���DE��E��B���f�L�m�M��M���@H��H���������H��H���vH������@���H���Q�����B��f
�1�f�M�H�M�f�U�f�E����ff.��UH��AWAVAUL�,ATSH��h���H��x����M�L�E�L�M��E������EI��I��1ۃ�?�E��E��@�E�H�E�H�E�DD�]�E��t�E����I�W`H��H)�A�GL�4‹E��E���H���u�L�M�L��L�E�L��L��L����AYAZI9��B�U̅��7D�E�E���*A�~0L����փ� A�~0�H)����9�Gʅ���D�Y�A����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H�U�A��H�U�H��I��N�DDfoE�H��B�L9�u�A��A��A��D��E)�H�PA9�t[@�:@�rA��tN@�z@�rA��t@@�z@�rA��t2@�z@�rA��t$@�z@�r	A��t@�z
@�rA��t@�z@�r
J�DXD�UH��L��1�H�E��t���H�E�I��H��9]��0���M9�v
�E��yL��H+�x���H�e�[A\A]A^A_]��H���u�L�M�L��L�E�L��L��L�����^_I9�v��U̅��v����M����k���I�NI�v�	H�6��Hc�D�NL��H)���D��D��f��9�Gʅ��3���D��D�A���A��A����@��E��@��H��L	�H��H	�H��L	�H��H	�H��L	�H��H	���H����L	�H��H�U�H�U�H�t0H��foM�H��J�H9�u�A�ɉ�A��D��D)�H�PD9�t9f�:��t1f�z��t(f�z��tf�z��tf�z��t
f�z
��tf�zJ�D@�S���L��L��1�L)�M���5���o���I���X���A��H�������H���fDUH��AWAVAUL�,ATSH��h���H��x����M�L�E�L�M��E������EI��I��1ۃ�?�E��E��@�E�H�E�H�E�DD�]�E��t�E����I�W`H��H)�A�GL�4‹E��E���H���u�L�M�L��L�E�L��L��L���G�AYAZI9��B�U̅��7D�E�E���*A�~0L����փ� A�~0�H)����9�Gʅ���D�Y�A����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H�U�A��H�U�H��I��N�DDfoE�H��B�L9�u�A��A��A��D��E)�H�PA9�t[@�:@�rA��tN@�z@�rA��t@@�z@�rA��t2@�z@�rA��t$@�z@�r	A��t@�z
@�rA��t@�z@�r
J�DXD�UH��L��1�H�E�脬��H�E�I��H��9]��0���M9�v
�E��yL��H+�x���H�e�[A\A]A^A_]��H���u�L�M�L��L�E�L��L��L�����^_I9�v��U̅��v����M����k���I�NI�v�	H�6��Hc�D�NL��H)���D��D��f��9�Gʅ��3���D��D�A���A��A����@��E��@��H��L	�H��H	�H��L	�H��H	�H��L	�H��H	���H����L	�H��H�U�H�U�H�t0H��foM�H��J�H9�u�A�ɉ�A��D��D)�H�PD9�t9f�:��t1f�z��t(f�z��tf�z��tf�z��t
f�z
��tf�zJ�D@�S���L��L��1�L)�M���E���o���I���X���A��H�������H���fDUf�H��AUATL���SH��H��)��A)D$A)D$ �?��H�����H���H���tH���H���tnH���H���t]H���H���tLH���H���t;H���H�
�H����1���H�Ĩ1�[A\A]]�f�L��DHcS$H��;t4H���H�
H��1�H�D��H�Ĩ1�[A\A]]�H�CH�o{(L�k(�oK8H�C );)KL����������H����:H���H���tIH���H���t8H���H���t'H���H���tH��������H����HcC$H��ok(�os8H�CH)+)sH�C �`���foKPfoS`fo[pfo��)�@���fo��fo��)�P���fo��fo��)�`���fo��fo��)�p���)m�)u�)}�)M�)U�)]Ѓ��t��	�[L���I�D$I�|$ I;D$r7H�I�T$(H�4�H���H��I�D$��H��I�D$ H������I�D$H�PH��fo�@���I�T$H��focPH� fok`hfospp fo��x0fo��`@fo��fo�P���hPfo��fo�`���p`fo��fo�p���xpfo��fo}���foM�fo�����)[P)c`)kp)��)��)��foU�fo]�foE�foe�)��)��)��)��H�Ĩ[A\A]]�fDH�CH�oS(L���o[8H�C ))[�_���;���H�{PL�cP�	H�{XH�CX�H�{`H�C`��H�{hH�Ch��H�{pH�Cp��H�{xH�Cx��H���H�����H���H�����H���H�����H���H���ttH���H�
e��f�H�CH�o{(L���oC8H�C );)C�o���;ƃ���H�����H���H�
^���L��HcS$H��;������o[(�ok8))kH�CHL��H�C ����;����H�{P�;H�{XH�SXtxH�{`H�S`tmH�{hH�ShtbH�{pH�SptWH�{xH�SxtLH���H���t;H���H���t*H���H���tH�������H���@HcC$H��ok(�os8)+)s�<���HcC$�oS(L���o[8H���H�CH)H�C )[�'���;�3���H��������HcC$H���H�CHL���oK(�oS8H�C ))S�����;��H���HcC$�x�����L������L���@���UH��H��AWAVAUATE1�SH��H���H�����dH�4%(H�u�1��H�_8H����HDžP���f�)�@���H��H���H�G`)� ���)�0���H����E1�H��(���H��`����L��H����L��P����H�H������/L��H������~����H��L���H�H�H�� ���L��H�����H��h���I�\$(H��@��������X������fo�P���H��p���H���x���fo�`���H������������q����P�������I���vD�H�5|H���������H�5�SA��I�F�o�x����o�����L��H������)�P���)�`���H��p��������P������gH��h���L��X���L��@���I)�I���m���I���`�H�57H�������uA�F�l���fD�H�5H���������A�F�=�����H�5�H�������uH���RA�I�F�����I���k����H�5jH���r����uA�F0������H�5`H���L�����)���A�F0����H����������H���H�G`H����fo�`���0fo�p���xfo�����h fo�����p0fo�����x@fo�����hPfo�����@`fo����ppfo�����fo����fo������fo������fo� �����������G��H�bNH���H�����E1�H��@������@H�u�dH34%(D���KH��[A\A]A^A_]��H���S�S���@M�t$(M�l$PE1����j�o�x����o�����L��H������)�P���)�`���H��p����6��L���L���H���P����������hH�������ZH�������tH�������pH�������lH�������hH������dH������`H������_H������H������I��$�H�
<H�z��1����H��h���H��`����H��L��H���L��0���H)�L��H��HG��K�A�E~M��L�H���H�5I��$��~HD�H�9
1��c�H�����H��@������H�����A��;����H��H�5�(1�1�������DI��$�H�
�
H��
��1���H��h�������f.�H��h���H��X���H)�H�����H����H�5�
H��������HDž0����o�x����o�����L��H������)�P���)�`���H��p�������P���������H��h���H��X���H)�H�����H��@���H�����H���������H�5�
H���������H������H�@H�Pp��t���Hc�H������tI��$�H�
����H�������o�x���L���o�����H������)�P���)�`���H��p����#�����P�������I��$�H�
:�g������X�o�x����o�����I�|$(H������)�P���)�`���H��p����¾���� ���=�Q=��H���H�@`H���BH���H�~x���$������H�������������H�H���Dž���L����I��DI�H��0���A�D$0H��A�G0H��@���H��H�H9�sBH�HPH9���H�I�4$H9�v�H�HPH9���H�H9���H�H9�w�H��L�����H��H��A���I�GH�������L�,�L��A���I�GH�������I�I�t$H�����I�I�t$L�����H��0���H��@���1�H��H��L�L������L9�sQA��4D�HQI�wH�H�x�+�	I�WH�H��I9�vH�xXt�H���I9�w�A|$����������C�E1�M��H������I�EL;�����I��M�gJ��K�<�u�I�GB�<(t�B�(I�FI�H�������	B�<(H���H��H��������I�$H���]���I�GH����1�H�<���1��.���_��t�>@�8���d�����E���I�FI�OI�~B�4(I�GH�H�<B�(��H�A@����H�H�4w��r�H�>H�8��L�D>�L�D8�H�xH��H)��H)���H����H�5�H���������PH�������H�5�H���������H������H�@H���Hc‰�t������f��
H�5�H���|�������H��������H�5�H���R�������
H�5�H���6�������H�5�H���������HDž0����{���f�I��$�H�
���@H�NH�����$���H�GxH�i�S�����H���Ƈ���fD�H�5jH���������H������H�@H�PxHc‰�t�������HDž0���������PM�L$A���AD�8���������fD�>�ɉ8�t��t����D���t�f�t�������I�$H�������I�GH����1�H�<�C���D��1��I�GI�WB�(H���H�<B����I��L����I��I���vH-N�����H=�Q�@���BЉ�Dƒ�f
�E1�f���f�GfD�G��u�I�EL;����3���f�M���������H��@���H�����H9������L����I����DH�����H���hH��I�O��E1�H��I;w ��I���L�$�M��t�����M�$T�1H���fM��I��L��L��L���b�����IcW0H�����������H���MH�4I�L4�fH�����H�àH9������8H�H���cH�{�xH�{��H�{��H�{ ��H�{(��H�{0�QH�{8�VH�{@�[E1�H�{HA��I��	H�SPH����H�{X��H�{`�H�{h�-H�{p�21�H�{x��H����P����w���������i���H��� H�{H�K�H�{H�K�
H�{H�K��H�{ H�K ��H�{(H�K(��H�{0H�K0��H�{8H�K8��H�{@H�K@��H�{H�=H�����L��H���k���v���fDH�����H�R��1����Q����H�����H�Z��1����1����D����p�L�CPA��Ɂ�IW(���@
�����P�L�S`�H�KXM��@H�H����IW(@:�I9�u�H��I�0E�ɹ�����Dρ�IW(
I�WI�w H��H�JH��H�H�LI9�@��L9���@��FH�H�H���8�okPH��H��*�Ao2rH��uK�o{pz f�H��tH��D�JRL�b0M��I��L��L��L���1��I�G�����I�H H�J �fDHDž���M���O���IcG0����fA�$H�àH9���������L����1�1�I�|$A�����uy��f���@@�8D��H�BH��H��X%�IG(@8I�GH�<�H�<xI�G H��H�:H�8H�zH�@H�xD�HRI�G�R0�P01�f�P4I9L$�UI�T$ H�H�D�JR%�IG(�8E���p�����@�8��i���H��DH��(���H�RxH�L�3H�SPM���(���H�{��H�{��H�{��H�{ ��H�{(��H�{0��H�{8��H�{@��E1�H�{HA��I��	���DH���fA�l4���P����7���f��-���H�KPH�
H�KXH�JH������H�K`H�JH������H�KhH�JH�������H�KpH�J H�������H�CxH�B(���@H�������������9����I�\$8I��8I��8H����������H�1��U���f�E1�������2���fDA�����D�����fDA����DA����D����fD�����fDA��z���DA��j���DHc����L�����H��H�PH��H��A���I�G H�����A���I�G(H�����I� H��1��H���I�G(H�xH�Hǀ�H��H)���1����H��u���@A�����DA����DA����D�L�S`�I���f������H�O D�@H�����H����1�H���E�H��@����������r���H������J�K��H�5��H��������H������H�@H���Hc‰�t������f.�H���H��N���H�Fx�!H�z�R��D��p������g�����B��u
��,���fD�o�x���)�P����o�����H������L��)�`���H��p����̯��L���t����6���P������:���p�������u�����u��,����o�x���)�P����f����g����� ���Dž$���L��(����J���f.�H�����	����
H�5�H���~���������
H�5�H���b��������H�������
H�5�H���8�������H�������H�5��H��������t�
H�5��H����������HDž0����W�fD�H�5�H���ĺ����uXH������H�@H���Hc‰�t������H�KH�_����H�H�����H�o�1�������fDH��������H�5d�H���F�����u"H������H�@H���Hc‰�t����F�f��H�5F�H�����������H�5E�H�������hH������H�@H���Hc‰�t����������H�58�H��讹�����y�H�5-�H��蒹����������H�5!�H���v������H������H�@H���Hc‰�t����r�fDA��K�DA��;�DA��+�DA���DA���DA���DA����DA����DH��
NH�Vx����H�I�S��@H�����H��@���E1���d�@�������A�H�F�RfD����y�H���M��H������H�@H���Hc‰�t����Q�H������H�@H���Hc‰�t����1�DL��DHc�t���H���P�������o�x����o�����)�P���)�`���H������L��H��p����U�����P������)�H��������H��������H��������H��������H��������H�������H�������H�������H������H�����6�I��$�f�Hc�t���H��o�x����o�����)�P���)�`�������I�T$X����I�T$`����I�T$h����I�T$p���I�T$x���I��$����I��$�����n���H�����������H�5�H���l����������H������H�@H���Hc‰�t����h�I��$��7������(���Dž,��������$���L��(������I��$����L�����I�T$X����I�T$`����I�T$h����I�T$p���I�T$x���I��$����I��$����I��$����H���A�H�H �1������������ ���Dž$���L��(����z����H�5�H���I��������H������H�@H���Hc‰�t����E�H�����	v�
H�5��H���������
���H��@���H������������$���L��(�������(���Dž,�����������f.�H�ɆRH�xƇ� H�@@H�G@t�~�fDH��	NH�Gx�h��UH��SH��H��H�}�RH�xƇ� H�@@H�G@��H���+���uw���H�S`��t8H�zuV�q�H��PH��H)�H���f�H��8H�z�u*H9�u�H�	�RH���H;
tUH;Jt7H;JtpH;JtVH��[]�@H���[]�@H��NH�Gx�]���H���RH�RH����@H���RH�H����H�n�RH�RH����H�Z�RH�RH�������f.�UH��SH��H��H�M�RH�xƇ� H�@@H�G@��H�������uw���H�S`��t8H�zuV�q�H��PH��H)�H���f�H��8H�z�u*H9�u�H�9lRH���H;
tUH;Jt7H;JtpH;JtVH��[]�@H���[]�@H��NH�Gx�]���H��kRH�RH����@H��kRH�H����H��kRH�RH����H��kRH�RH�������f.�UH�H�H��AWAVAUATSH����]L�UH�����H�}�H�}�H��P�����M��H��X���H�L�E�M�H�����H�}�H��`���1҉����H�� ���H��P���H��h���L�E�H�E�H�u�H������H������`fDH�PA�E1�H��P���D�8H�E��M����f����H�P1�H�U��A)���H��P���E��I)�M)��M���]f��u�H�E�D�pA���kH��h���A�H�PH�@�H���H�D�<BH�E��M���v���fDf���p���H�u�H�U�E1�H9��c����X��H���E�H�� ���H�M��E�H�u�H�yH�I�	��H�H�H�AH�E�f�8��H�PA��H�U��D��I9������H�E��@uH�E�H�PH�@�H���H��BA)�D��E���A������H�����E���@�d��������VM9��kA��E���@f.�f���7���H��X���H��`���E1�H9����������H����x���H�� ���H��h���Džt���H��X���H�yH�I�	��H�H�H�AH��P���f�8��H�PA��H��P���D�8D��I9���H�E�E1��@uH��h���H�PH�@�H���H�D�<BE��A��}���DH��������pH��h���Hc�H�X���H��X���H�� ���H;��H����H����x�����t���H�yHc�H�<�H���H�I���H�H�GH��P���f�8��H��`���A�����@H���P������ H�}�Hc�Hu�H�u�H�� ���H;�9H����H���U��E�H�OH�H��H���H����H�H�AH�E�f�8�WH�U�A������f.�H�E��@uH�E�H�PH�@�H���H��BA)�1�E�������E��H���D��[A\A]A^A_]�DH�����A������A�Dž��*��������E1���tH��h���H�PH�@�H���H�D�<BA�FA�I��I9������H�E�E��@�DE����f.�H�����A��耥��������������1���tH�E�H�PH�@�H���H��BA�UH��I9�r%A)����DA�E1�E1������H�U�D��D��)�BDD��R����H��X���H��`���H9���H�M�A������H�H9�HC�A��H��X������H�U�H�E�H9��/���H�u����H�H9�HC�A��H�E��������H������A��H�E�����{����H������A��A���H��P����x���H�PH��P���D�8A�FI���]���DH�PA�MH�U���#���A���������A����fDUH��D�UARAQM��I��H��H��H�w`������ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW�s���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH���H��AWAVAUATSH��H�u�L�UH��h����]H��P���H��X���H�M��L�E�Mȃ�H��H���H�u�H��`���1�H��P���H�}�L�E�H�E�H�}�H��0���H��@���H��8����\H�PA�1�H��P���D�H�E��M����f����H�PE1�H�U��A)��FH��P�����M)�I)��M���Ff��u�H�E��p����H��h���A�H�PH�@�H���H�D�BH�E��M���x����f���w���H�E�H�}�E1�H9��a�������H�U�H���E��M�H�E�L�jH�R���I�MHc�H�QH�U�f�:�	H�BA��H�E��M9�����H�E��@uH�E�H�PH�@�H���H��BA)�E��E��u-A������L��8���A�Gt��tM9��?A��E��H�ĨD��[A\A]A^A_]�fDf���O���H��X���H��`���1�H9��6�����H��h���H����x���Džt���H��X���L�GH��?��I�8H�H�GH��P���f�8��H�P��H��P���D���I9���H�E�E1�@uH��h���H�PH�@�H���H�D�BD��A����f.�H��@��L��%�H	�L��h���H��X���I9��H����H����x�����t���M�HM��M���M�@A�<8��H�I�AH��P���f�8�|��H9�����E1Ʌ�tH��h���H�PH�@�H���H�D�B�FA�H��I9�����H�E�D��@�DE�����@<�v$<��,L�AI9�w�y�ǀ@��?����f�H9��w���H�E�A������H�H9�HGʃ�H��X�������fDH��L�u�E��H�ȁ�H�E�L	�I;��H����H���U��M�M�nM�l�M���1M�vA���Hc�I�TUH�U�f�:�oA��H9������1���tH�E�H�PH�@�H���H��BA�PI��I9���A)���f����v+�����H�HH9�rD�xE�o�A��?����fDH9�v�H�U����H�H9�HB�A��H�E�����\���DH�E��@uH�E�H�PH�@�H���H��BA)�E1��[������w�H�HH9�r�D�xE�w�A��?w�D�hA�ŀA��?�p������u
A����a���H��E��E��H��I�����H�E�L	�L�u�L	�I;�n���H��0���A��H�E��������<����L�II9�����D�aE�D$�A��?�����y�ǀ@��?�����<�u
A��������H��E��@��L��%�I��L	�H	����DA�1�E1�����H�U�D��E��)�BDD��2����H��@����4���A�����������H��H�������A����������������H�PH��P���D��FH�����fDH�BA��H�E�����@H��0�����A���H��P����m���A��������A��=���fDUH��D�UARAQM��I��H��H��H�w`�o�����ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH��AWI��AVI��AUATSH��H���H�u�H�U�H�@(L�E�D�M�H�E�H�PCWH�H��t
�} �Ѕ���H�E�H�E�H�E�H�E�L;u�u�L9u���H�M�L��H�u�L��H�E��Ѕ���L�e�HcUL9���H�I�HcE�L9�u
L9u���H�M�H�U�L��H�u�H�E��Ѕ��DH�L�e�HE�HcEL9�t�E���L�m�E���l���D��I�_`D��D�e�����E��E1�A��L��H�H��H��p���L��H��H��h���D��H��x���H9�w H�CL��M��tH�CA�����M�@I9���H�CJ��H����H�s�}�B���H�BH��`���H����M����A�8f98�]H��p���H��h����<>�H��X���H9���H��P���H�?H��L��L��0���H��8���D��@���L��H����e���H��P���H9�X���L��H���D��@���H��8���L��0����]����A������H�S8E1�H9�x���w H�CHL��M��tH�C@�A����M�@I9���H�CHJ��H����H�K@�u�B���H�BM����H�����fA9uJH��p���D�$H��h���D�,M9��AK�$H��L���z���M9��}���Y���f��H�e�[A\A]A^A_]�@1�M9�������H�M�L��H�u�L��H�]��Ӆ�~�H�H�M�H�U�L��I�H�u��Ӆ�~�H�L�e�HE��f����1�M9����������{������p���H��`����p���H��`���H�L��L��8���H��@���D��H���L��P���L��`���芗�����"���H��X���L��`���L��8���H��@���A�@D��H���L��P�������fDK�T-H��L��L�E��4���������L�E�C�h���������fDH�]�1�H9]���H�e�[A\A]A^A_]Å������B�c�q���H�]�L;u�taH�]�L�m�H�M�L��H�u�L��A�ՉÅ��U���H�E�I9�tXHcUH9�uWH�M�H�U�L��H�u�A�Յ��)���H�HE�Lc�M�L;u�u�1�����H�]�1�H9]���H�e�[A\A]A^A_]�Lc�M���H�]�H9]���L�m�L��H�u�L��H�E�L��Ѕ������H�I�HcE�H�]�H9E�u	I9��bH�E�H��X����E ����P���H�M�H�U�L��H��X���H�E��ЉE����h���A���L�u�L�m���h������
L��I�_`E��D��H��D��A��E1�H�E�L��H���H��H��p���H��x���D��H��`���H9�w!H�CN�$�M��tH�CA��B���M�$DH9�p�����H�CH�4�H����H�SA���
��L�FM����M����A�$fA9��H�E�D�H��x���D�M9���K�L��L��L��(���H��0���L��8���L��@���L��H���螔��L��@���L��(���L��H���L��8���M9�H��0����k���%��h�����H�S8E1�H;�`���r!H�CHN�$�M��tH�C@A��B���M�$DH;�p�����H�CHH�4�H����H�S@�
A����H�FM����H�����fA9$��H�E�D�,H��x���D�4M9���K�T-H��L��譓��M9�����u[HcE�HE�H��L����P���H�u�D�M�L�E�H�M�H�U�P�EP�EP���H�� ������H�]�H9]��d�����������HcE�HE���1�M9������1�M9����K�6H��L��������u�C�t�c�����u�C�Y���K�L��L��H��8���L��@���L��H����Ւ����u�L��H���H��8���L��@���C�T�@������e���B�k���H�M�H��H�u�L��H�E��Ѕ��$���H�H�H�]��t���fDUH��H���EjP�EP�������H�G`H��t)Hc�H��H)�H��H�|t
H�D��1��ff.�f�H�G���0���ff.�H�G���0���ff.�Uf�H��AWAVAUATSH��H)E�L�w)E�)E�H���AH�U�I��L�~�H�u�A��5DH�I�|$I�I�H�W(N�t�I��%��t<�I��L9m�t0I�|$0I�L$L��L��H����P(���I����I�|$H�E�H��N�4�J�t�������tSI�L$H�AH�Y H��H�PL�<�L9�s5I��wNfDJ�<�u�{RuH�u�L��H��輐����tpH��XI9�w�I��I��tEI�L$H���x�����{RuH�u�L��H��H�M��w���H�M���t'H��XI9�w�I���1�H��HH��[A\A]A^A_]�@H�C2H�E��~E�BD�A)$��ff.�L�H�OL��L�A(%�A�<yNH���H9tB�G$��G(Lc�%�L�VH�OL�A(A�@tL�AH�A O��O�XN��L9�rfDUH��AUI��H�yATI��SH��L��H�������tRH��L��H��L��[A\A]]���f.�L;Ht7f.�H��XI9�v��xRt�L;u���f.�H��1�[A\A]]�H�P2H�G$H��UH���H��AWAVAUATSH����]L�mH��X���L�E�H�Mȃ�H��`���1�M����H�� ���H�����H��P���H�����H�]�H���H��P���H��h���H�}�L�E�H�E�H�u�H�}�H������H������a@Dž���H�P1�H��P���D�8H�E��M����f����H�PE1�H�U��A)���H��P�����M)�I)��M����f��u�H�E��X���zH��h���Dž���H�PH�@�H���H�D�<BH�E��M���t����f���s���E1���H�U�H�HE�H�� ���H;�.H�ztCH��H�r(�����t*H�����H�����L���8���H����H�� ���H�U�H����A��H���E��M�H�rHc�H�4�H���<H�R�
��H�H�FH�E�f�8��H�}�H�M�H�U�H�����H����P(���0���H�U�H�E�H9��������1���tH�E�H�PH�@�H���H��BA�T$I��I9��'A)�@E��u5������I���H����@t�������tM9��>A��E��H���D��[A\A]A^A_]�f�f�������1�L������f�H��h���H�H�X���H�� ���H;�pH�ztBH��H�r(�����t)H�����L��L�����H���5H�� ���H��h���H������H����x�����t���H�rHc�H�4�H���2H�R�
��H�H�FH��P���f�8�(H�}�H��`���L��H��X���H����P(���!���H��X���H��`���H9��:�����E1���tH��h���H�PH�@�H���H�D�<BDž����CH��I9��x���H�E�D��@�DE��_���@H�E��@uH�E�H�PH�@�H���H��BA)�E1������Dž���1�E1�����@H�U�D��E��)�BDD������H������\���A�Dž��������I9��H�E�E1��@uH��h���H�PH�@�H���H�D�<BDž���D������H��������…�����f.�M9������H�E��@uH�E�H�PH�@�H���H��BA)�E������H��������A���H��P����4���@H������A�����H�E��f.�H�PH�U���p���H�PH��P���D�8�����f.�H�M����H�H9�HC�A�����H�E��*���f.�H�M�A������H�H9�HCƒ�H��X�������H�x�P0tTH�xt`H�x tlH�x(������A�����H�xD�x0t*H�xtIH�x t/H�x(��������!�����������뮸�����뛸����A��������Dž������ff.�UH��D�UARAQM��I��H��H��H�w`�����ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH���H��AWAVAUATSH�� ���H���L�E�M�D�ML�uH�����H��P���H��X���A��H�H�����H�]�L��E��H��`���1�H��P���H��h���H�}�L�E�H�E�H�u�H�}�H���H�����H������YH�PA�1�H��P���D�(H�E��M����f���hH�PE1�H�U��A)��dH��P�����M)�H)��H���^f��u�H�E��X���.H��h���A�H�PH�@�H���H�D�,BH�E��M���x����f���w���H�U�H�u�L�RI9��+D��BE1��zI����H�L�L��B��H�L�H�� ���H=����H9���H�E����H�H9�HG�A��H�U����M9������H�E��@uH�E�H�PH�@�H���H��BA)�E��E��u<A������E��L�����H�ML��L�uA�GtE��tI9��'A��E��H���D��[A\A]A^A_]�f���7���H��X���L��`���L�WM9����G1��wH����H�H�H��G��H�H�H�� ���H=����I9��'H�E�A������H�L9�IG���H��X�����H9���H�E�E1�@uH��h���H�PH�@�H���H�D�,B��A�����H�E��@uH�E�H�PH�@�H���H��BA)�E1����H�����H�M訂��H�M�����P���f.�1�E��tH�E�H�PH�@�H���H��BA�T$I��I9���A)��?���H�����L�e�E���H�M��A������fDE1�E��tH��h���H�PH�@�H���H�D�,B�CA�H��H9������H�E���@�DE��s���@A�1�E1��_����L�]�L�U�I9�VI�{tYH��I�s(�����t@H�����H�����L��H�MD�������.�D������H�MH���CH�� ���L�]�H����A��H���E��U�I�sHc�H�4�H���o���I�{���H�H�FH�E�f�8��H�U�H�u�L�RL9������:�BD�JH����H�I�I�<�B��H�H�H�� ���H=���D������L��h���I��L��X���I9�I�{tFH��I�K(�����t-H�����H�����L��� �H���oH�� ���L��h���H������H����x�����t���I�KHc�H��H������I�s���H�H�AH��P���f�8��H��X���L��`���L�WM9�r:��G�wH����H�H�H��G��H�H�H�� ���H=������L���A����H�U�D��E��)�BDD��q���E1�����1�����H���L���A���H��P����&���H���A�����H�E����H�PL��H��P���D�(�����H�PH�U������H�x�P0toH�xtaH�x tSH�x(������A����H�xL��D�h0t[H�xtHH�x t5H�x(����������A����������봸뭸릸��W������K������?���A�����UH��D�UARAQM��I��H��H��H�w`������ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH���H��AWAVAUATSH���H�}�H�]H��X���HʋMH���I�܃�H�}�H�� ���L�E�Mȉ����H�M�H�����H��P���H��`���1�H��P���H��h���L�E�H�E�H�u�H������H�����H������e�H�PE1�Dž���H��P���D�8H�E��M����f����H�PH�U��01�A)��H��P���D��I)�H)��H���f��u�H�E��H��A����H��h���Dž���H�PH�@�H���H�D�<BH�E��M���q���Df���l���H�u�L�U�E1�H�~I9����f�������V��H�M�H�}��Hc�H�� ���H9�[H�ytEH��H�y(���47��t,H�����H�����L���=�H���TH�� ���H�M���H����A���U�Hc҉E�H�qH�4�H���
H�I���H�H�FH�E�f�8�sH�u�L�U�H�~I9�r,��ƒ����!���H�~I9�r�N�ʃ����FL9��]�����1���tH�E�H�PH�@�H���H��BA�vH��I9��.A)�E��u5���������H����@t�������tL9���A��E��H���D��[A\A]A^A_]Ðf������H��X���L��`���E1�H�wI9����@����	�W���Hc�H�� ���H��h���H��X���H9��H�ytHH��H�y(���47��t/H�����H�����H���w�H����H�� ���H��h�����H����A����t���Hc҉�x���H�qH�4�H���H�I���H�H�FH��P���f�8��H��X���L��`���H�wI9�r,��ƒ����	���H�wI9�r�O�ʃ����L9��������E1���tH��h���H�PH�@�H���H�D�<BDž���A�EI��H9�����H�E�A��@�DE����fD�V����%����

�VH�M�H�}���Hc�H�� ���H9�����DH������A�����H�E�D��I9������H�E��@uH�E�H�PH�@�H���H��BA)�D���h�����W����%����

�W��Hc�H�� �������f�H�E��@uH�E�H�PH�@�H���H��BA)�1����Dž���E1�E1�����H�U�D��)��BD��DD�����H������Lw��A�Dž��<����?�H������,w���ƅ��E�������DH������A��A���H��P���D��H9��iH�E�E1��@uH��h���H�PH�@�H���H�D�<BDž���A���
���fDH�PH�U�D���0�\���DH�PH��P���D�8D���@H�E����H�I9�IB�A��H�u��������f.�H�E�A������H�L9�IG�A��H��X����&���fDH�x�p0tUH�xt\H�x tcH�x(������A�����H�xD�x0t+H�xt@H�x t+H�x(������A��������벸�ܸ뤸��A������%���Dž�������ff.��UH��D�UARAQM��I��H��H��H�w`������ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW�C���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH��H��AWAVAUATSH���H�}�L�mH������H�}��}M��H��X���Hʃ�L�E�Mȉ����H�� ���H�����H��P���H�����H�}�H��`���1�H��P���H��h���L�E�H�E�H�u�H���H������d�Dž���H�P1�H��P���D�8H�E��M����f���|H�PE1�H�U��A)���H��P�����M)�I)��M����f��u�H�E��X���JH��h���Dž���H�PH�@�H���H�D�<BH�E��M���t����f���s���E1�H�u�H�U�H9������H�U�H��H�� ���H�u�H�zt:H�J(���t*H�����H�����L���x�H����H�� ���H�U��E��E�H�JH�R���H�H�H�BH�E�f�8�@H�PA��H�U��M9�����H�E��@uH�E�H�PH�@�H���H��BA)�E��E��u5����������H�������@t�������tM9���A��E��H���D��[A\A]A^A_]�f�������L�����1�H��X���H��`���H9��������H��h���H��H�� ���H��X���H�zt9H�J(���t)H�����L��L���*�H����H�� ���H��h�����x���Džt���H�JH�R���H�H�H�BH��P���f�8� H�P��H��P���D�8��I9���H�E�E1��@uH��h���H�PH�@�H���H�D�<BDž���D������L���(o�����PH��h���H�H�X���H�� ���H;��H�ytBH��H�q(�����t)H�����L��L����H����H�� ���H��h���H����H����x�����t���H�qHc�H�4�H���-H�I���H�H�FH��P���f�8�#���%���H������Tn�����<H�M�H�HE�H�� ���H;��H�ytCH��H�q(�����t*H�����H�����L���L�H����H�� ���H�M�H����H���E��U�H�qHc�H�4�H����H�I���H�H�FH�E�f�8�}A������@H�E��@uH�E�H�PH�@�H���H��BA)�E1������H���������n��A�Dž����������E1���tH��h���H�PH�@�H���H�D�<BDž����CH��I9�����H�E�D��@�DE�����H�����A���`n���…��������1���tH�E�H�PH�@�H���H��BA�T$I��I9�r*A)����f.�Dž���1�E1��?���@H�U�D��E��)�BDD�����H�PH��P���D�8�CH�����fDH�PA��H�U���>���@H�U�H�E�H9��9���H�u����H�H9�HC�A�����H�E�����f�H��X���H��`���H9��s���H�M�A������H�H9�HCƒ�H��X�������H���A�����H�E�����H�����A���H��P�������@H�x�P0tTH�xtH�x tqH�x(������A��K����H�xD�x0tBH�xt/H�x tH�x(��������x�������e������Y������M����떸�A������E���Dž����q���ff.�UH��D�UARAQM��I��H��H��H�w`������ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH���H��AWAVAUATSH���H�}�L�}H������H�}��}M��H��X���Hʃ�L�E�Mȉ����H�� ���H�����H��P���H�����H�}�H��`���1�H��P���H��h���L�E�H�E�H�u�H���H������`�H�PA�1�H��P���D�(H�E��M����f���8H�PE1�H�U��A)���H��P�����M)�I)��M����f��u�H�E��X���H��h���A�H�PH�@�H���H�D�,BH�E��M���x���f�f���o���H�U�H�u�E1�H9�������(H��H�� ���H�U�H�U�H�ztHH�J(���t8H�����H�����L��D������!��D�����H���)H�� ���H�U��E��E�H�JH�R���H�H�H�BH�E�f�8�"H�PA��H�U��M9������H�E��@uH�E�H�PH�@�H���H��BA)�E��E���3A�������H������L�uE��M��L�}�@�
���������M9��A��E����fDf�����H��X���L��`���1�L9�������3H��h���H��H�� ���H��X���H�zt=H�J(���t-H�����H�����L������H���H�� ���H��h�����x���Džt���H�JH�R���H�H�H�BH��P���f�8�$H�P��H��P���D�(��I9��H�E�E1�@uH��h���H�PH�@�H���H�D�,BD��A�����H����%�H	�H�� ���H��h���H��X���H9��H�ytFH��H�q(�����t-H�����H�����L�����H����H�� ���H��h���H����H����x�����t���H�qHc�H�4�H���H�I���H�H�FH��P���f�8�*H��X���L��`�����L9��"��������E1��tH��h���H�PH�@�H���H�D�,B�CA�H��I9�����H�E�D��@�DE����fD<�v$<���H�VI9�r�~�O���?�����L9��o���H�E�A������H�I9�IB��H��X�������fDH��@��H�M�H�M�%�H	�H�� ���H9�H�ytQH��H�q(�����t8H�����H�����L��D��������D�����H���H�� ���H�M�H����H���E��U�H�qHc�H�4�H���TH�I���H�H�FH�E�f�8�uH�U�H�u�A��H9��-��������1���tH�E�H�PH�@�H���H��BA�T$I��I9���A)�E������@E��H���D��[A\A]A^A_]�<�v,<���H�JH9�w�z�ǀ@��?�����f.�H9��g���H�E����H�H9�HG�A��H�U���������H�E��@uH�E�H�PH�@�H���H��BA)�E1�����<�w�H�JH9�w�D�RE�J�A��?������z�ǀ@��?�o���A���w<��a���H��E��@��H�M�%�I��H�M�L	�H	�H�� ���H9���H���A�����H�E��]���D<��h���H�VI9��[���D�FA�x�@��?�H����N�����?�8���<�u
A����*���H��@����%�H��H	�H	�H�� ������@A�1�E1��o���H�U�D��E��)�BDD����H�����A���b���…���������H��������b��A�Ņ����������H�PA��H�U���d���@H�PH��P���D�(�CH�����fDH�����A���H��P������@H�x�P0t\H�x��H�x tuH�x(������A����DH�xD�h0tBH�xt/H�x tH�x(������������뽸��
�������������뒸�A��������A�����f�UH��D�UARAQM��I��H��H��H�w`������ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH��AWAVAUL�-��ATSH����EH�]H��X���H�H�� ���L�E�M�H�������I��H��P���H�����H�M�H��`���L�ꉅ���1�H���L��P���H��h���H�}�L�E�L�m�H�u�H�}�L�����H�������c@H�BE1�Dž���H��P���D�:H�U��M����f���H�BE1�H�E��A)���H��P���D��M)�H)��H����f��u�H�E��H��A���EH��h���Dž���H�PH�@�H���H�D�<BH�U��M���p���@f���l���H�u�H�E�H�~H9�����vH�}�H�}����Hc�H�� ���H97��E1�H�OH����L�G(%�A�����H��%�A�<�:H;�����-�E���E�Hc�%�H��(���A�@�
H�G L��J�AH��H9�r��H��XH9����xRt�H;u�H9pu�H�P2H�E�H�U�H�x�4H�x�>H�x �HE1�H�x(A��A���@0E�f.�M9��B���H�E��@uH�E�H�PH�@�H���H��BA)�E��E���GH���D��[A\A]A^A_]�fDf�������H��X���H��`���H�NH9�����vH��X���H��h������Hc�H�� ���H97�IE1�@L�GM���#H�O(%�����H��%��<��H;��������t������x���Hc�%�H��(����@��H�G K��I�HH��H9�r�pH��XH9�vg�xRt�H;u�H9pu�HDžt���H�P2H��P���H�x��H�x��H�x ��1�H�x(����D�x0F�4)�@H�������tH�����H�����H���-��H��u�H�� ���H��h���f.�H��@��E�uH����x�����t���H�WH�H��H����H�w�4��Hc�H�rH��P���f�:��H��X���H��`���H�NH9��4��vH��X������Hc�H�� ���H;7��E���6���fDH���'����tH�����H������L���M��H������H�� ���H�}�f�H��@��E�MH���M��E�H�WH�H��H���xH�w�4��Hc�H�rH�U�f�:�(H�u�H�E�H�NH9�����vH�M����Hc�H�� ���H;7� E�������H�E��@uH�E�H�PH�@�H���H��BA)�E1�E����������������H����@�����������������L9���A��E���w���f.�Dž���E1�E1��?���H�������Y��A�Dž��Y�����E1���tH��h���H�PH�@�H���H�D�<BDž���A�FI��H9�����H�E�A��@�DE�����f�H�������tY��������������1���tH�E�H�PH�@�H���H��BA�QI��I9�r	A)������H�U�D��E��)��BDD�����H�BH��P���D�:D��H9��\H�E�E1��@uH��h���H�PH�@�H���H�D�<BDž���A������H�BH�E�����E�uH�����A���H��P���D���E�MH�����H�E�������E1�@H9��v���H�U�A������H�H9�HG�A��H��X����E1�DH9������H�U����H�H9�HG�A�����H�u�����A��r���A��G���A������|���A�������g���A������R���A��������Dž�������f.�UH��D�UARAQM��I��H��H��H�w`������ff.�f��������U��H��H��AWM��AVM��AUI��ATE1�SH��H��(H�U�H��H)�H�u�H��H��H�E��f.�I��8L;e�t>�EH�s`M��M��H�M�H�U�H��PL�AW�C���ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@UH��AWAVAUATSH��HH�H�GH��L�@(��A�<yTH��H9tH�W$��W(Lc�L�FH�GL�H(A�@t#H�PH�X L��J�JH��H9���fDH�u�I��I��H��H�x1��������(f�M�t$I�_A�)E�A�)E�)E�I�|$0I�L$L��H��H����P(���VH�I�L$I�H�H�Q(N�t�I��%�D�<tE�H��I��u�@H�E�H�yN�<�J�t��F����tSI�L$H�AH�Y H��H�PL�4�L9�s5I��t~fDJ�<�u�{RuH�u�L��H����U����t(H��XI9�w�I��I����I�L$�w����H�C2H�E��~E�BD�A)$H��HH��[A\A]A^A_]�fD�{RuH�u�L��H��H�M��wU��H�M���t�H��XI9�w�A�����H;Kt9f�H��XH9��S����{Rt�L;u���fDI���U���fD1��q���H�C2H�G$H��]���DUH��ATSL�e�H��H��0�f�H�KH�HCH�E�H;��H�yt5H��H�q(�����tL��H���.���H����H�E�H�KH����H���C(�S$H�qHc�H�4�H����H�I���H�H�FH�f�8��H�{0H�KL��H�SH����P(���J���H�SH�K�����H9�sH�C0���H�H9�rgH�S���H��0[A\]�@H���H�H��0���[A\]��H����R��H��0[A\]��H�PH��H��0[A\]��@0�H�K����@UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H��H�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}�������~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}��_�����~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH�h�H��AWAVI��AUATSH��hL�M�LML�M�H�E�H�u�H�}�H9���E����I��I��H��I)�I��J�4"1�L�e�H��p���f.�f��u[L��D��|���H�M��8���D��|���H�M���~HL�k�#H;�p����N�UL��L��1��v(��H��hL��[A\A]A^A_]�@H�PH�U������E@�7I�GI�WH)����H���H��B��f��D9�DF�E���A�x����҃��
����H��H	�H��H	�H��H	�H��H	�H��H	�H��H	�D���H����H	�H��H�E�H�E�H�TH��fDfoE�H��@�H9�u�D��D�ƒ��)�H�CA9�t9f�0��t1f�p��t(f�p��tf�p��tf�p��t
f�p
��tf�pL�l{���DH���C�A��H9�vE��tH�E���W����I������M���r���D��H���m���ff.�f�UH��AWM��AVAUI��ATI��SH�H��D�uA��@tH����M�L��L��P�M�I��AVI�t$`A��L��AQH��M��L���R���ZYE��yH9�wH�e�L)�[A\A]A^A_]�@I�T$`H�JH�R�H�	��Hc��QH�P��H��@�r�H9�v�H�B�
H��H9�w��ff.�@UH�H�H��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL���0�����H�E�f�8uDL����������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U����~9�tƅ�������I�UI�M�H�	��Hc��Q9���L�e���L�������~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L�������Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UH���H��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL���p�����H�E�f�8u7L���\���9�uX��~TH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U����~9�t�)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.�UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L�����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH���H��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H�����~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UH�H��AWAVAUATSH�����H��8�����T���L��X���L��H�����d���H�U����U�EM�I��I��E1�L��@�����?��`����E��@��P���H�E�H�E��2�UL��L��1�L��p������L��p���M��I��D9�d�������`�����t	�ED��s�J��I�U`L)�H��H��h���A�E�H��X���H�E�H�5ԎH�E�H�u�H�}�H��@���L�m�H�}�L9��PD��T���E���@L)�1�H��H��I�L��H��p���H��f��uPfDH�}����~LL�K�#H;�p�������H���C�A��H9]���E����H�E��f��t�H�HH�M�������P�������H��h���H�M��x0��փ� �x0�H)����D9�AG̅��n�Q�����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H��p���A��H��x���H��I��N�Dfo�p���H��@�L9�u�A��A��A��D��E)�H�CA9�t[@�8@�pA��tN@�x@�pA��t@@�x@�pA��t2@�x@�pA��t$@�x@�p	A��t@�x
@�pA��t@�x@�p
��L�LC���H�ƋEH�M�L��L��X���D��T���L��I��P��H����:�ZYI��D9�d����z���L9u�v�E�u<L��H+�8���H�e�[A\A]A^A_]�I�������M�������H�]�L��1�H��L)�I���iE����I���A��H������UH��H��AWAVI��AUL�,ATSH��hL�`L�E�M�L�E�H�E�L�}�H�}�L9��MH�Ӆ��I��H�}�I��H��p���J�&I��1�H��x���f��u[H��p����M�����M���~T��I�t$A�$L;�x�����H��L)�U1�L���)��H��hH��[A\A]A^A_]��H�pH�u������E@�A�0L����փ� A�0�L)����9�Fȅ���D�I�A���~@����D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�L��H��I�|<fDfoE�H��@�H9�u�A�ˉ�A��D��D)�I�DD9�tN�@�p��tC�P@�p��t7�P@�p��t+�P@�p��t�P@�p	��t�P
@�p��t�P@�p
O�dL�U1�L��L�������E�tkM9�vf�L��1�L��L)�� C�����I��A�D$���M9�va��tH�E��0�����I��D�U1�L��L���h���E�u�L��L)��.����1�����f���L������L��L��L)����UH��ATI��SH��0H�wH�WH�NH9��5��FH�OH�O���Hc�H�E�H;��H�]��VH�y���H�H�FI�$f�8��I�t$I�T$H�~H9�����FI�|$���Hc�H�E�H;w}H�yt3H�q(�����tH��L���u�H����H�E�I�L$H����H��A�D$(A�T$$H�qHc�H�4�H���K���L����?��H��0[A\]�f.�H�9�I�$H��0���[A\]��H�PI�$�H��0[A\]�@�����H9�s�I�D$0���H�H9�wI�t$�����@0�I�T$����w���f.�UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H�r�H�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}�������~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}��/�����~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH��H��AWAVI��AUATSH��hL�M�LML�M�H�E�H�u�H�}�H9���E����I��I��H��I)�I��J�4"1�L�e�H��p���f.�f��u[L��D��|���H�M�����H�M�D��|�����~HL�k�#H;�p����N�UL��L��1����H��hL��[A\A]A^A_]�@H�PH�U������E@�7I�GI�WH)����H���H��B��f��D9�DF�E���A�x����҃��
����H��H	�H��H	�H��H	�H��H	�H��H	�H��H	�D���H����H	�H��H�E�H�E�H�TH��fDfoE�H��@�H9�u�D��D�ƒ��)�H�CA9�t9f�0��t1f�p��t(f�p��tf�p��tf�p��t
f�p
��tf�pL�l{���DH���C�A��H9�vE��tH�E���W����I������M���r���D��H���m���ff.�f�UH��AWM��AVAUI��ATI��SH�H��D�uA��@tH����M�L��L��P�M�I��AVI�t$`A��L��AQH��M��L���R���ZYE��yH9�wH�e�L)�[A\A]A^A_]�@I�T$`H�JH�R�H�	��Hc��QH�P��H��@�r�H9�v�H�B�
H��H9�w��ff.�@UH�ȂH��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL��������H�E�f�8uDL���������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u��ƅ�������I�UI�M�H�	��Hc��Q9���L�e���L���X�����~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L�������Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UH��H��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL���@�����H�E�f�8u7L���,�����~X9�uTH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u���)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.�UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L�����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH�(}H��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H���x��~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UH�H��AWAVAUATSH�����H��8�����T���L��X���L��H�����d���H�U����U�EM�I��I��E1�L��@�����?��`����E��@��P���H�E�H�E��2�UL��L��1�L��p����y��L��p���M��I��D9�d�������`�����t	�ED��s�J��I�U`L)�H��H��h���A�E�H��X���H�E�H�5T{H�E�H�u�H�}�H��@���L�m�H�}�L9��PD��T���E���@L)�1�H��H��I�L��H��p���H��f��uPfDH�}����~LL�K�#H;�p�������H���C�A��H9]���E����H�E��f��t�H�HH�M�������P�������H��h���H�M��x0��փ� �x0�H)����D9�AG̅��n�Q�����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H��p���A��H��x���H��I��N�Dfo�p���H��@�L9�u�A��A��A��D��E)�H�CA9�t[@�8@�pA��tN@�x@�pA��t@@�x@�pA��t2@�x@�pA��t$@�x@�p	A��t@�x
@�pA��t@�x@�p
��L�LC���H�ƋEH�M�L��L��X���D��T���L��I��P��H����:�ZYI��D9�d����z���L9u�v�E�u<L��H+�8���H�e�[A\A]A^A_]�I�������M�������H�]�L��1�H��L)�I����1����I���A��H������UH��xH��AWAVI��AUL�,ATSH��hL�`L�E�M�L�E�H�E�L�}�H�}�L9��MH�Ӆ��I��H�}�I��H��p���J�&I��1�H��x���f��u[H��p����M����M���~T��I�t$A�$L;�x�����H��L)�U1�L�����H��hH��[A\A]A^A_]��H�pH�u������E@�A�0L����փ� A�0�L)����9�Fȅ���D�I�A���~@����D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�L��H��I�|<fDfoE�H��@�H9�u�A�ˉ�A��D��D)�I�DD9�tN�@�p��tC�P@�p��t7�P@�p��t+�P@�p��t�P@�p	��t�P
@�p��t�P@�p
O�dL�U1�L��L���S���E�tkM9�vf�L��1�L��L)��/�����I��A�D$���M9�va��tH�E��0�����I��D�U1�L��L�������E�u�L��L)��.����1�����f���L������L��L��L)����H�WH�O�����H9���UH��ATI��SH�]�H��0�����H��H�E�I�T$I�T$H�ztH�J(���uLA�D$(A�D$$H�JH�R���H�H�H�BI�$f�8�H�PI�$�H��0[A\]�DH��L���
��H����H�E�I�T$�f�<��<���H�rH9����z�ǀ@��?��H��@��%�H	�H�E�I�L$I�t$H9�KH�yt6H��H�q(�����tH��L���p��H���<H�E�I�L$H����H��A�D$(A�T$$H�qHc�H�4�H����H�I���H�H�FI�$f�8���I�T$I�L$H9��l���H��0�����[A\]�fD<�v4@I�D$0���H�H9�vpI�L$������fD��H�rH9�w�D�JE�A�A��?w��z�ǀ@��?w�A���w<�t�H��E��@��%�I��L	�H	�H�E����I�T$����0���fDH�isI�$�������L���*�������@0���f�UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H��rH�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}�������~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}��/�����~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH�hqH��AWAVI��AUATSH��hL�M�LML�M�H�E�H�u�H�}�H9���E����I��I��H��I)�I��J�4"1�L�e�H��p���f.�f��u[L��D��|���H�M�����H�M�D��|�����~HL�k�#H;�p����N�UL��L��1��v��H��hL��[A\A]A^A_]�@H�PH�U������E@�7I�GI�WH)����H���H��B��f��D9�DF�E���A�x����҃��
����H��H	�H��H	�H��H	�H��H	�H��H	�H��H	�D���H����H	�H��H�E�H�E�H�TH��fDfoE�H��@�H9�u�D��D�ƒ��)�H�CA9�t9f�0��t1f�p��t(f�p��tf�p��tf�p��t
f�p
��tf�pL�l{���DH���C�A��H9�vE��tH�E���W����I������M���r���D��H���m���ff.�f�UH��AWM��AVAUI��ATI��SH�H��D�uA��@tH����M�L��L��P�M�I��AVI�t$`A��L��AQH��M��L���R���ZYE��yH9�wH�e�L)�[A\A]A^A_]�@I�T$`H�JH�R�H�	��Hc��QH�P��H��@�r�H9�v�H�B�
H��H9�w��ff.�@UH�HnH��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL��������H�E�f�8uDL���������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u��ƅ�������I�UI�M�H�	��Hc��Q9���L�e���L���X�����~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L�������Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UH��kH��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL���@�����H�E�f�8u7L���,�����~X9�uTH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u���)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.�UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L�����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH��hH��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H���x��~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UH�H��AWAVAUATSH�����H��8�����T���L��X���L��H�����d���H�U����U�EM�I��I��E1�L��@�����?��`����E��@��P���H�E�H�E��2�UL��L��1�L��p������L��p���M��I��D9�d�������`�����t	�ED��s�J��I�U`L)�H��H��h���A�E�H��X���H�E�H�5�fH�E�H�u�H�}�H��@���L�m�H�}�L9��PD��T���E���@L)�1�H��H��I�L��H��p���H��f��uPfDH�}����~LL�K�#H;�p�������H���C�A��H9]���E����H�E��f��t�H�HH�M�������P�������H��h���H�M��x0��փ� �x0�H)����D9�AG̅��n�Q�����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H��p���A��H��x���H��I��N�Dfo�p���H��@�L9�u�A��A��A��D��E)�H�CA9�t[@�8@�pA��tN@�x@�pA��t@@�x@�pA��t2@�x@�pA��t$@�x@�p	A��t@�x
@�pA��t@�x@�p
��L�LC���H�ƋEH�M�L��L��X���D��T���L��I��P��H����:�ZYI��D9�d����z���L9u�v�E�u<L��H+�8���H�e�[A\A]A^A_]�I�������M�������H�]�L��1�H��L)�I���i����I���A��H������UH�dH��AWAVI��AUL�,ATSH��hL�`L�E�M�L�E�H�E�L�}�H�}�L9��MH�Ӆ��I��H�}�I��H��p���J�&I��1�H��x���f��u[H��p����M����M���~T��I�t$A�$L;�x�����H��L)�U1�L���)�H��hH��[A\A]A^A_]��H�pH�u������E@�A�0L����փ� A�0�L)����9�Fȅ���D�I�A���~@����D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�L��H��I�|<fDfoE�H��@�H9�u�A�ˉ�A��D��D)�I�DD9�tN�@�p��tC�P@�p��t7�P@�p��t+�P@�p��t�P@�p	��t�P
@�p��t�P@�p
O�dL�U1�L��L�����E�tkM9�vf�L��1�L��L)�� �����I��A�D$���M9�va��tH�E��0�����I��D�U1�L��L���h�E�u�L��L)��.����1�����f���L������L��L��L)����UH��ATSL�e�H��H��0H�sH�SH9��������H�SH��H�E�H�sH�ztH�J(���uC�C(�C$H�JH�R���H�H�H�BH�f�8t�H�PH��H��0[A\]�fDL��H�����H���)H�E�H�S�f.�L���x������H�KH�HCH�E�H;��H�yt5H��H�q(�����tL��H���.���H����H�E�H�KH����H���C(�S$H�qHc�H�4�H����H�I���H�H�FH�f�8���������fDH�SH�K�����H9�����H�C0���H�H9�rFH�S������f.�H��_H��������@H���������@0���H�K������@UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H�"_H�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}������~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}�������~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH��]H��AWAVI��AUATSH��hL�M�LML�M�H�E�H�u�H�}�H9���E����I��I��H��I)�I��J�4"1�L�e�H��p���f.�f��u[L��D��|���H�M����H�M�D��|�����~HL�k�#H;�p����N�UL��L��1���H��hL��[A\A]A^A_]�@H�PH�U������E@�7I�GI�WH)����H���H��B��f��D9�DF�E���A�x����҃��
����H��H	�H��H	�H��H	�H��H	�H��H	�H��H	�D���H����H	�H��H�E�H�E�H�TH��fDfoE�H��@�H9�u�D��D�ƒ��)�H�CA9�t9f�0��t1f�p��t(f�p��tf�p��tf�p��t
f�p
��tf�pL�l{���DH���C�A��H9�vE��tH�E���W����I������M���r���D��H���m���ff.�f�UH��AWM��AVAUI��ATI��SH�H��D�uA��@tH����M�L��L��P�M�I��AVI�t$`A��L��AQH��M��L���R���ZYE��yH9�wH�e�L)�[A\A]A^A_]�@I�T$`H�JH�R�H�	��Hc��QH�P��H��@�r�H9�v�H�B�
H��H9�w��ff.�@UH�xZH��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL�������H�E�f�8uDL���������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u��ƅ�������I�UI�M�H�	��Hc��Q9���L�e���L��������~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L������Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UH��WH��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL������H�E�f�8u7L��������~X9�uTH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u���)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.�UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L�����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH��TH��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H���(��~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UH�H��AWAVAUATSH�����H��8�����T���L��X���L��H�����d���H�U����U�EM�I��I��E1�L��@�����?��`����E��@��P���H�E�H�E��2�UL��L��1�L��p����)�L��p���M��I��D9�d�������`�����t	�ED��s�J��I�U`L)�H��H��h���A�E�H��X���H�E�H�5SH�E�H�u�H�}�H��@���L�m�H�}�L9��PD��T���E���@L)�1�H��H��I�L��H��p���H��f��uPfDH�}��?��~LL�K�#H;�p�������H���C�A��H9]���E����H�E��f��t�H�HH�M�������P�������H��h���H�M��x0��փ� �x0�H)����D9�AG̅��n�Q�����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H��p���A��H��x���H��I��N�Dfo�p���H��@�L9�u�A��A��A��D��E)�H�CA9�t[@�8@�pA��tN@�x@�pA��t@@�x@�pA��t2@�x@�pA��t$@�x@�p	A��t@�x
@�pA��t@�x@�p
��L�LC���H�ƋEH�M�L��L��X���D��T���L��I��P��H����:�ZYI��D9�d����z���L9u�v�E�u<L��H+�8���H�e�[A\A]A^A_]�I�������M�������H�]�L��1�H��L)�I���	����I���A��H������UH�HPH��AWAVI��AUL�,ATSH��hL�`L�E�M�L�E�H�E�L�}�H�}�L9��MH�Ӆ��I��H�}�I��H��p���J�&I��1�H��x���f��u[H��p����M��l��M���~T��I�t$A�$L;�x�����H��L)�U1�L���Y��H��hH��[A\A]A^A_]��H�pH�u������E@�A�0L����փ� A�0�L)����9�Fȅ���D�I�A���~@����D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�L��H��I�|<fDfoE�H��@�H9�u�A�ˉ�A��D��D)�I�DD9�tN�@�p��tC�P@�p��t7�P@�p��t+�P@�p��t�P@�p	��t�P
@�p��t�P@�p
O�dL�U1�L��L������E�tkM9�vf�L��1�L��L)��P�����I��A�D$���M9�va��tH�E��0�����I��D�U1�L��L������E�u�L��L)��.����1�����f���L������L��L��L)����UH��ATSH��H��0H�sH�L�FI9�w3��F�NH����H�H�H��F��H�H�H�E�H=��v6�����H9�sH�C0���H�H9���H�s���H��0[A\]�@L�KL�e�L�CI9��I�ytH��I�I(�������H����H���C(�S$I�IHc�H��H����I�q���H�H�AH�f�8��H�sH�{L�FL9��:�����F�NH����H�H�H��F��H�H�H�E�H=�������<���@H�{H��0���[A\]�fDL��H�����H��u=H�E�L�K�4���H��KH��������H���W������H�PH������@0���f.�UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H�rKH�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}������~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}������~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH��IH��AWAVI��AUATSH��hL�M�LML�M�H�E�H�u�H�}�H9���E����I��I��H��I)�I��J�4"1�L�e�H��p���f.�f��u[L��D��|���H�M�����H�M�D��|�����~HL�k�#H;�p����N�UL��L��1����H��hL��[A\A]A^A_]�@H�PH�U������E@�7I�GI�WH)����H���H��B��f��D9�DF�E���A�x����҃��
����H��H	�H��H	�H��H	�H��H	�H��H	�H��H	�D���H����H	�H��H�E�H�E�H�TH��fDfoE�H��@�H9�u�D��D�ƒ��)�H�CA9�t9f�0��t1f�p��t(f�p��tf�p��tf�p��t
f�p
��tf�pL�l{���DH���C�A��H9�vE��tH�E���W����I������M���r���D��H���m���ff.�f�UH��AWM��AVAUI��ATI��SH�H��D�uA��@tH����M�L��L��P�M�I��AVI�t$`A��L��AQH��M��L���R���ZYE��yH9�wH�e�L)�[A\A]A^A_]�@I�T$`H�JH�R�H�	��Hc��QH�P��H��@�r�H9�v�H�B�
H��H9�w��ff.�@UH��FH��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL��������H�E�f�8uDL���������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u��ƅ�������I�UI�M�H�	��Hc��Q9���L�e���L���(�����~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L������Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UH�DH��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL��������H�E�f�8u7L�������~X9�uTH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U��9�u���)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.�UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L�����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH�(AH��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H���H��~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UH�H��AWAVAUATSH�����H��8�����T���L��X���L��H�����d���H�U����U�EM�I��I��E1�L��@�����?��`����E��@��P���H�E�H�E��2�UL��L��1�L��p����y��L��p���M��I��D9�d�������`�����t	�ED��s�J��I�U`L)�H��H��h���A�E�H��X���H�E�H�5T?H�E�H�u�H�}�H��@���L�m�H�}�L9��PD��T���E���@L)�1�H��H��I�L��H��p���H��f��uPfDH�}��_��~LL�K�#H;�p�������H���C�A��H9]���E����H�E��f��t�H�HH�M�������P�������H��h���H�M��x0��փ� �x0�H)����D9�AG̅��n�Q�����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H��p���A��H��x���H��I��N�Dfo�p���H��@�L9�u�A��A��A��D��E)�H�CA9�t[@�8@�pA��tN@�x@�pA��t@@�x@�pA��t2@�x@�pA��t$@�x@�p	A��t@�x
@�pA��t@�x@�p
��L�LC���H�ƋEH�M�L��L��X���D��T���L��I��P��H����:�ZYI��D9�d����z���L9u�v�E�u<L��H+�8���H�e�[A\A]A^A_]�I�������M�������H�]�L��1�H��L)�I�������I���A��H������UH��<H��AWAVI��AUL�,ATSH��hL�`L�E�M�L�E�H�E�L�}�H�}�L9��MH�Ӆ��I��H�}�I��H��p���J�&I��1�H��x���f��u[H��p����M����M���~T��I�t$A�$L;�x�����H��L)�U1�L�����H��hH��[A\A]A^A_]��H�pH�u������E@�A�0L����փ� A�0�L)����9�Fȅ���D�I�A���~@����D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�L��H��I�|<fDfoE�H��@�H9�u�A�ˉ�A��D��D)�I�DD9�tN�@�p��tC�P@�p��t7�P@�p��t+�P@�p��t�P@�p	��t�P
@�p��t�P@�p
O�dL�U1�L��L���S���E�tkM9�vf�L��1�L��L)������I��A�D$���M9�va��tH�E��0�����I��D�U1�L��L�������E�u�L��L)��.����1�����f���L������L��L��L)����UH��ATI��SH��0I�t$H�H�NH9���H�]���<����F��I�L$I�L$�Hc�H�E�H9�;H�yt8H��H�y(���47��tH��L���:���H���MH�E�I�L$��H����A�D$$H�A�T$(H�qH�4�H����H�I���Hc�H�VI�$f�8��I�t$I�|$H�NH9�r(��Ѓ�<��/���H�NH9�rD�FD����<�t7�����H9�v!I�D$0���H�H9���I�t$���H��0[A\]��F��A����A����
�B��VI�L$I�L$��Hc�H�E�H9����H�C8I�$H��0���[A\]ÐL����H��0[A\]��H�PI�$�H��0[A\]��@0�_���I�|$����P���ff.��UI��H��AWAVAUATSH��xL�O`H��p���M�;M�0L��h���I�AI�I�H�	��H��AH�}�H��7H�u�H�1���H�u�H�}�H�}�H�}���H�E�L�M�H��x����lf�H�}��w�����~qE1�9���L��������?��L�Hc�H��L��H��H�H��L1�H�ʃ�?I�TI��H��H��H��H�H�E�H1�I���f��t�H�PH�U�����H��p���L�8H��h���L�0H��x[A\A]A^A_]��H�}�������~�9�u'E��H�E�E�ef�8t�H�xH�}����f�D��I�vH�RH�<V��H��L��M����?I��L�H�U�L�H��L1�H��I�ȃ�?I��I�TI��H��x���L�H1�I��H9�u�����fDUH�6H��AWAVI��AUATSH��hL�M�LML�M�H�E�H�u�H�}�H9���E����I��I��H��I)�I��J�4"1�L�e�H��p���f.�f��u[L��D��|���H�M����D��|���H�M���~HL�k�#H;�p����N�UL��L��1����H��hL��[A\A]A^A_]�@H�PH�U������E@�7I�GI�WH)����H���H��B��f��D9�DF�E���A�x����҃��
����H��H	�H��H	�H��H	�H��H	�H��H	�H��H	�D���H����H	�H��H�E�H�E�H�TH��fDfoE�H��@�H9�u�D��D�ƒ��)�H�CA9�t9f�0��t1f�p��t(f�p��tf�p��tf�p��t
f�p
��tf�pL�l{���DH���C�A��H9�vE��tH�E���W����I������M���r���D��H���m���ff.�f�UH��AWM��AVAUI��ATI��SH�H��D�uA��@tH����M�L��L��P�M�I��AVI�t$`A��L��AQH��M��L���R���ZYE��yH9�wH�e�L)�[A\A]A^A_]�@I�T$`H�JH�R�H�	��Hc��QH�P��H��@�r�H9�v�H�B�
H��H9�w��ff.�@UH��2H��AVAUL��`���I��ATL�e�SH�ĀH��h���H�L�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��AfDL�������H�E�f�8uDL���������9�������H��`����f��t�H�PH��`����H�E�f�8t�H�PH�U����~9�tƅ�������I�UI�M�H�	��Hc��Q9���L�e���L�������~!9���H�E�f�8t�H�PH�U�����H��1�[A\A]A^]�@���{������s���I�EI�U�H���H�D�$BD9�u[L��`����f.�L���x����Å�~�A9�u5H��`���f�8t�H�PH��`������H��)É�[A\A]A^]��H�쀉�D)�[A\A]A^]�fDM��I��H��H��H�w`���ff.��������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t6H�s`H�U�M��M��L��H��L��r�����t�H��[A\A]A^A_]��H��1�[A\A]A^A_]�1��@UH�(0H��AVAUL��`���ATL�e�SH�ĀH��h���H�D�mL�E�M�H��p���1�H��`���H��x���H�}�L�E�H�E�H�u�H�}��3DL�������H�E�f�8u7L������9�uX��~TH��`����f��t�H�PH��`����H�E�f�8t�H�PH�U����~9�t�)�H�쀉�[A\��A]A^]��E��t�1҅�y�H�쀉�[A\A]A^]�fDUE��H��H��AQM��I��H��H��H�w`������ff.�UM��I��H��H��H�w`H��H��j�����ff.�@�������U��H��H��AWM��AVI��AUE1�ATE��SH��H��(H�U�H��H)�H�u�H��H��H�E��f�I��8L;m�t>H��H�s`H�M�M��ATH�U�M��H��L�����ZY��t�H�e�[A\A]A^A_]�fDH�e�1�[A\A]A^A_]�1��@�������U��H��H��AWM��AVI��AUI��H��ATH)�E1�SH��H��H��H��H�u�H�E��fDI��8L;e�t>H��H�s`H�U�L��jM��M��H��L��\���ZY��t�H�e�[A\A]A^A_]��H�e�1�[A\A]A^A_]�1��ff.��UH�H-H��AWAVAUI��ATM��SH�]�H��HL�1H�O`H�u�H�M�8H�E�1�H�u�H�M�H�}��bf�H�����~aL���?J�9������Hc�H��L��H��H�L1�H�у�?M�tI��L��H��H��I�H�E�I1��f��t�H�PH�U����u�M�uM�<$H��H[A\A]A^A_]�ff.��UH�H��AWAVAUATSH�����H��8�����T���L��X���L��H�����d���H�U����U�EM�I��I��E1�L��@�����?��`����E��@��P���H�E�H�E��2�UL��L��1�L��p���虻��L��p���M��I��D9�d�������`�����t	�ED��s�J��I�U`L)�H��H��h���A�E�H��X���H�E�H�5t+H�E�H�u�H�}�H��@���L�m�H�}�L9��PD��T���E���@L)�1�H��H��I�L��H��p���H��f��uPfDH�}��/��~LL�K�#H;�p�������H���C�A��H9]���E����H�E��f��t�H�HH�M�������P�������H��h���H�M��x0��փ� �x0�H)����D9�AG̅��n�Q�����@��D��D��H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�H��L	�A��A��H��p���A��H��x���H��I��N�Dfo�p���H��@�L9�u�A��A��A��D��E)�H�CA9�t[@�8@�pA��tN@�x@�pA��t@@�x@�pA��t2@�x@�pA��t$@�x@�p	A��t@�x
@�pA��t@�x@�p
��L�LC���H�ƋEH�M�L��L��X���D��T���L��I��P��H����:�ZYI��D9�d����z���L9u�v�E�u<L��H+�8���H�e�[A\A]A^A_]�I�������M�������H�]�L��1�H��L)�I���	���I���A��H������UH��(H��AWAVI��AUL�,ATSH��hL�`L�E�M�L�E�H�E�L�}�H�}�L9��MH�Ӆ��I��H�}�I��H��p���J�&I��1�H��x���f��u[H��p����M��\��M���~T��I�t$A�$L;�x�����H��L)�U1�L���ɷ��H��hH��[A\A]A^A_]��H�pH�u������E@�A�0L����փ� A�0�L)����9�Fȅ���D�I�A���~@����D��H��H	�H��L	�H��H	�H��L	�H��H	�H��L	�H��H	����H�E���H�E�L��H��I�|<fDfoE�H��@�H9�u�A�ˉ�A��D��D)�I�DD9�tN�@�p��tC�P@�p��t7�P@�p��t+�P@�p��t�P@�p	��t�P
@�p��t�P@�p
O�dL�U1�L��L���s����E�tkM9�vf�L��1�L��L)�������I��A�D$���M9�va��tH�E��0�����I��D�U1�L��L�������E�u�L��L)��.����1�����f���L������L��L��L)����H�H�GH�<�H�yH��H9�r�&fDH��XH9�vH90u�H9Pu�H�xu�H��0�1��f.�1��ff.�f�1��ff.�f�UH�H��AWAVAUI��ATA��SH��H��XH���L�E�L�M�L�p(H�E�H�U�A��E�H�E�H�M�H��H�u�L��A�օ���H�U�H�� tv!H��+t
H��-u�u�H�H���f.�H��	t����1�H�]�I��A���E�1ۉU��E�f.�H�M�L��H�u�L��A�օ���H�U�H�I�H�B�H��	v:H�B�H��w"H�B�H�E�A9�~,;]�wxtfA����fDH�B�H��w
H�B�H�E�A9��H�E�H��tL�8L9}���M���uD�����U��؅���H��X[A\A]A^A_]ËU�H9�s���E��4���@���wP�E���uIH��XH��H��[A\A]A^A_]�@�q���H�E�H��tL�8H�E��TH��X1�[A\A]A^A_]�H�E��"H��XH��[A\A]A^A_]��H�E��"H��X����[A\A]A^A_]�f�H�}�H��tH���H�}����3��!�H��X1�[A\A]A^A_]�f�H�E��!H��X1�[A\A]A^A_]�DUH�H��AWAVAUI��ATA��SH��H��XH���L�E�L�M�L�p(H�E�H�U�A��E�H�E�H�M�H��H�u�L��A�օ��}H�U�H�� tv!H��+t
H��-u�u�H�H���f.�H��	t����1�H�]�I��A���E�1ۉU��E�f.�H�M�L��H�u�L��A�օ���H�U�H�I�H�B�H��	v:H�B�H��w"H�B�H�E�A9�~,;]�wxtfA����fDH�B�H��w
H�B�H�E�A9��H�E�H��tL�8L9}����M���ut�U�H��H�؅�HD�H��X[A\A]A^A_]�fD�U�H9�s���E��4���@u�H�E�H��tL�8H�E��TH��X1�[A\A]A^A_]��H�E��"H��X�����[A\A]A^A_]�f�H�}�H��tH���H�}����3��!�H��X1�[A\A]A^A_]�f�H�E��!H��X1�[A\A]A^A_]�DUH�H��AWAVL�}�AUI��ATSH��H��hH����M�L�E�L�p(L�M�H�U�A��E�H�M�H��L��L��A�օ���H�U�H�� tvH��+t
H��-u�u�H�H����H��	t�Hc}�H�����1�I���E�H��H�}�H��x���1�H�U�H�E�H�M�L��L��L��A�օ���H�U�H�I�H�B�H��	v;H�B�H��w#H�B�H�E�9E�~-H;]�wxtnH�]�H��@H�B�H��w
H�B�H�E�9E��H�E�H��tL� L9�x����(�M���uAH��H�����U�����H��h[A\A]A^A_]��U�H9�v��E��4���@H��H9�wQ�E���uJH��hH��H��[A\A]A^A_]�D�i���H�E�H��tL� H�E��TH��h1�[A\A]A^A_]�H�E��"H��hH��[A\A]A^A_]�DH�E��"H��hH��������[A\A]A^A_]�DH�}�H��tH���H�}����3��!�H��h1�[A\A]A^A_]�f�H�E��!H��h1�[A\A]A^A_]�DUH�H��AWAVL�}�AUI��ATSH��H��hH����M�L�E�L�p(L��x���H�U�A��E�H�M�H��L��L��A�օ���H�U�H�� tvH��+t
H��-u�u�H�H���@H��	t�Hc}�H�����1�I���E�H��H�}�H�]�1�H�U�H�E�fDH�M�L��L��L��A�օ���H�U�H�I�H�B�H��	vCH�B�H��w+H�B�H�E�9E�~5H;]���tzH�]�H���H�B�H��w
H�B�H�E�9E��H�E�H��tL� L9e����E���u|H��H9�tH��H��E�HE�H��hH��[A\A]A^A_]�D�U�H9��z���@�E�����@u�H�E�H��tL� H��x���1��T�f�H��x���H������"�f.�H�}�H��tH���H��x����1ۃ�3��!��Z���f�H��x���1��!�=���ff.��UH��AWAVAUI��ATI��SH��H��XdH�%(H�E�1��E�M��y����L��A�p0L�}�E1�H���������H��H����H���)�@�u�I��	��I���������H�}��H�ȍq0H��I��H����H���)�@�7H��u�E��txI�L���G�-�-L9�ssI���fDH�I��I�M9�s%A�7@��tH��L��L��L��I��$��P0���I)�Ic�H�]�dH3%(ujH��X[A\A]A^A_]ÐI��I�L9�s@��u�1���@H���������I��L��H��A�@0H��H�����)ЈE�I��	vA�����H�}��.�������UH��AWAVAUI��ATI��SH��H��XdH�%(H�E�1�����L���E�1�M����M���kH��H�}�I���������I��I��I��C���)ƃ�0@�u�I���������L��A�p0H��I��H����I���)�@�7H��u܅���I�L���G�-�-L9���I���fDH�I��I�M9�s%A�7@��tH��L��L��L��I��$��P0���I)�Ic�H�]�dH3%(��H��X[A\A]A^A_]�D�E�M��xWuEI��E�0�0L�}�L9��q���1���I�1�L9�s�@��t�I���N���f�1�H�}����DL��H��t
I������E�0H�}�������H�}����UH��AWAVAUATSH��xH�u�H�U�H�M�H���zI��I��L�u�I��$�L�h(H�H�E�H)�H��H��?H�H��H�f�H��L��L��L��A�Յ��)L�E�H�I�I�� t�I��	t�H�E�I��-���I��+�&HDžh���HDžp���\/�+HDžx����
�E�I��0��I��0I��	��I�GH9�H�]�HG�L��H�E�H�M�L��L��L��A�Յ��xH�U�H��9w��0��	��H�؋}�H�M�H��H�څ�L�9HE�H��x[A\A]A^A_]�f.�I9�u$�VfDH�}�0�LH�I�L9��7H��L��L��L��A�Յ��@H�E�H�M��!H�E�H�1�H��x[A\A]A^A_]�f.�H��L��L��L��A�Յ�~�H�L�E�HDžh���I��E�HDžp���\/�+HDžx����
����H����H�H�JI����������H��L��L��L��A�Յ��K���H�L�E�HDžh���I��E�HDžp������HDžx����_�G���DI��H�]�L��I9������I�GL�E�M��H9�H��`���HF�E1�L�}�H�]�M��L��H�E��H�M�H��L��L��A�Յ������H�U�H��9w��0��	vNM��L�E�L�}�I��L��H��"�u�L)�H��L��H�E�L�M�M��L��I�؅�IE��q���f.�H���H�K��L�<BH;]��n���I��H�]�M��L�E�L�}�L9��NL�M�H��L��L��L�E�L��L�]�A�Յ������H�M�L�E�L�M�L�Q�I��	�L�]�H�I�L9��6L�U�H��L��L��L�M�L��L�E�L�]�A�Յ������L�}�L�]�L�E�L�M�I��9L�U���A��0A��	��H�I�H�E�H�H9�t7L�U�H��L��L��L�M�L�E�A��L�E�L�M���L�U�~�Eȃ�0<	��L;�x�����K��E��I�GL;�x�����H��vHI��H�K��H��H������1��j���I�GE1�����L9�`����0���Mi�ʚ;H�E�H�M�H��M�K�H��H�څ�HE����H��TH�M��U�L��K��L�M�I�B�������H��H9�wPt@H���i���L9�p����;���H9�h����.���H�E�D�E��"H�����E���1����H��?�#���H�E��"H������f.�E1���tL���@UH��H��AWI��AVL�u�AUATI��H��SH��H��(H���L�E�H�u�L��L�h(A��L�E���~1H�}� t�(f�H�}� uH�L��L��H��I�L��A�Յ��M��L+E�H��(L��[A\A]A^A_]��H�H�VH9�w���x�uH��H9�v�x� t�H)���H�BH9���D�D�����<�t+1�@���t�BA��A��Mc�L�ø�����fDH�BH9�r��J1��σ�@���u��BA�����RA������
A�A���H�H���fD������f.�UH��AWAVAUI��ATI��SH��H��HH���K�<H�U�H�}�M�}xH�H(H�@0H�M�H�M�H�E�H�H�E�H�M�H9�rZ�s�H�u�I97r#H��I�GH��H��H��t@��H�v�4�H�u�H�M�L��L��H�E���D9�u*Mc�L�M�H9]�vH�M�H��H�u�L��H�E���A�ƅ��H�E�H��H[A\A]A^A_]�f�UH��AWAVI��AUATSH�H��HH���L�gxH�}�L�)M�8H�M�H�@(L�E�H�E�H�E�H�E�H9�ry��H��I�t$��H��H�4�H��tH��L�H�M���H��L��H���?I�J�>L��H��H��H�L1�H�փ�?M�\7I��I��I��I��I�I1�M��L9�v=H��L��H�u�H�}�H�E��Ѕ�~%H�U�I9$�g���H�E�������{���H�E�L�(H�E�L�8H��H[A\A]A^A_]�UH��AVM��AUI��ATI��SH���H���PM��L��L��H��H��[A\A]A^]���UH��AWAVAUI��ATI��SH��H��HH���K�<H�U�H�}�M�}xH�H(H�@0H�M�H�M�H�E�H�H�E�H�M�H9�r[�t�H�u�I97r$H��I�GH��H��H��t@��H�v�t�H�u�H�M�L��L��H�E���D9�u*Mc�L�M�H9]�vH�M�H��H�u�L��H�E���A�ƅ��H�E�H��H[A\A]A^A_]ÐUI��H��L��H��H��H���H�u��P(��ff.�@UH��AWI��AVAUATSH��8H�M�L�E�H��toI��I��L�m�H���H�I�H��tUI���L��L��L��L���P(���M9��L�}��~E�IG�H�E�H�E�E�H�E�H��8H)�[A\A]A^A_]ÐH�E�H�@L�8H�E�H��8[A\A]A^A_]�ff.�UH��AVI��AUI��ATE1�SH����H�I��H�I���L��H��L��������[L��A\A]A^]�H��tkUH��AWI��AVI��AUI��ATI��SH��H��I���H��L��L�������~H�I�I��u�L��L)��DH�CL)�H��[A\A]A^A_]�f�1��ff.�f�UL�H�9H��SI�L9�s>I��f�H��D�H����?L�I��I��I��I��L�H1�I9�u�H�RH�H�9I�[]�DUH��AUM��ATI��SH��H��H����PI�4$M�UL�L9�s8L��@H���I��H����?I��H�H��H��L�H1�I9�u�H�@I�I�4$M�UH��[A\A]]�@UH��AWAVAUATSH��8H�u�L�M�H9��
����H��H�E�I��M��H)�H�E�I��I��H��H�H�]�H��@H�M�L��H�u�L��I����P(����H�U�H�I�H������H��H��UH��H��H��t��H�R�T�H�U���H�C�H;]�uA�,$H+E�H��8[A\A]A^A_]�DH���S�A�$��A�$L9�s���Y���H��H+E�H��8[A\A]A^A_]�H�E�����������1��H�BH9�ro�:�L��(��H�>I���w+1�H����w L�BL9�rF�RH��H���H���v�H����H��
%�H	�HH���@�����ø�����ff.��H�H�VH9�w��H��H9�vf�x� t�H)��ff.��H�BH9�r?�
�B�zH����H�H�H��B��H�H�H=H��������D������f�H�H�VH9�w�"��x�u�x�u�x�uH��H9�v�x� t�H)��ff.�H�H�FL�	M�H9���UH��AWAVAUATSD��F�^I����H�L�L��F��H�L�H=��vL�	M�[A\A]A^A_]�@L�wxH��I�H�]�M��I��H9E���M1���E1�M��I��M�M1�L��M���?I��M�\L��M�M1�L���?M�L	I��I��M��I��I�M1�H9��i����~��F�H��D�^�H����H�I�I�<�F���H�H�H=���0����O����I��I�~M��M�zI��A��?��J�<�M�H��tCH�[�D�H����H��L��M�M1�I��L��I����?E��I���M�������H��H��H��I��I�M1�D��L�σ�?I�A��M������L�	M��f�H�FH9�r1��>u1��~�����������f.�H��tsH�~H9�r�>t-1�UH9�HG�H��H�u��~E�H�U�E�A]�@�~w�H��H��t&H�wH9�r�~�u�~�vH)�H��H��릐H����H��I�@H��I�0�f�H����UH��AWAVAUATSH�H)�L�@LI�I��I�L9����>���~���~���FH��<	t< u*H��I9��c�?u.�u�u�G< t�<	tրu�u
�-�V��?t�!1�H�2[A\A]A^A_]���u݀u
�+��E1ɻA��
A�\/�+�u��0���G��0<	w�L�g$H�w��M9�MF�I9���t3�7�~u1�~��0@��	w$H��@��H��H�GL9����>u�~t�H�2H��[H��E��A\A]HE�A^A_]�fD����~�q�~�g�~0�]H��H�wI9�u�1���!1�H�2�H���I9������?�������?���������L�O�����M9������H���L��A����A��_A��?�|����x������m���H���D���L��M9�����M�|$$L��M9�M��MF�E1��=��u5�u/�w��0@��	w"@��O�l�N�,nH�wI9���H���?t�H��H�5;�!H�:L)�H��H��I�L��H��E��ID�����L�OM9�����H���L��A�\/�+A��
E1��!���H�����H��(I9�IF�1�I��H9��;����'���DH��(I��I9�IF�1�H9���������I9����>���~���~��D�~E�g�A��	��H��E��I9����~���~���~��D�~E�w�A��	��H�~H�:I9�t"�~u�~	u�~
u�V��0��	��I9���Ik�
A��H�I9������Mk�dH��H��L�H����H��I9��o���Hi�ʚ;H�2L�H��H��E��HE��[������H�:H��
H��Ik�
H�J�4 E��tY�H��?H9�w@t0H��H��� ���M9��u���H9��l����"H��E��������H��?����"���H������@H)�H��H���DH)�H��H9�H�JHG��f�H��H9������H�BH9�r��R���H�H��ø�����f.�H�BH9�r1�H����wf���f�2��������f�UH��I�H��SH�H�WxH9�sU�H��H9�rD�~�D�N�H��L�Z��D�Lc�M��I��O��M��t@��H�<E��I9�r	I����v[]�I9�r�D�Q�D�I�H9�w�[]�M��I����ff.�@H�H�GxL�	M�H9���H��H9���UH��AUATSH�X�fDH��H9�rD�V��F�A��A�Mc�M��I��J��H��tE��K�<RD�l�M��I��L�σ�?J�A��H��L��H��H�L1�H�ǃ�?M�L;I��M��I��I��M�I1�H9��x���[A\L�	A]]M��L�	M��ff.��UH��I�H��SH�H�WxH9�sV�H��H9�rE�~�D�N�H��L�Z��D�Lc�M��I��O��M��t%@��H�<E�L�I9�r	I����v"[]��I9�r�D�Q�D�I�H9�w�[]�M��I�����H���6H�B���D��I��I��I��H��
��A��@��UH��H	�H��H��L	�H��H	�H��L	�H��H	�H��L	�H��H	�L��H��H�E�H��H�E�H��H��foE�H��@�H9�u�L��H��H��H�4FH��H�zI9�t[f��H�B�f�H��vJH�B�f�NH��v<H�B�f�NH��v.H�B�f�NH��v H�B�f�NH��vH��f�N
H��vf�N]�f��f�H��v*H�B�f�NH��vH�B�f�NH��vH�B�f�NH��w�H�B�f�NH��v�H��f�N
H��v�f�N�ff.�H)�H��H���fDH)�H�	H�rH9�HB��ff.�f�H��H�<	H)�H9�v1UH��H�E��tH��H�U�H�U��~E�H��E�A]�H�I�@H��I�0�ff.�UH�H�FH��SH9�w�D�z�uH��H9�v�z� t�L�	I�H9�s=H��I��f�L��D�H����?L�I��I��M��I��L�I1�H9�u�H)�H�H�L�	I�[]�f�UH��AWI��AVAUL������ATI��S��H��XH������������L������L������dH�%(H�E�1�H���H���HG�L�p(H������H�H������H��H�������"DH�I�H������H�P�H��dwH���C�H������L��L��L��A�օ��L������H�ڋ�����L��H������L������M��H)�H���v��I�H������H��A��$�H)�H��H�����I�H�M�dH3%(uH��X[A\A]A^A_]�虸��f�UH��AWAVAUL������ATI��S��H��XH������H������L������dH�%(H�E�1�H���H���HG�H��L�p(H������A�H�H������I��H�������"@H�H�H������H�P�H��dwI��A�G�H������H��L��L��A�օ��H������L������H������L�;H��L��耑H�A��$�H������L)�H��H�����H�H�E�dH3%(uH��X[A\A]A^A_]��g����UH��AWI��AVI��Hc�AUL�m�ATI�M
L��M��SH��(dH�%(H�E�1�H����P0L��Hc�I)�M�r�H��H��L�����H��H�I9�s�K�>H)�uH�E�dH3%(u6H��([A\A]A^A_]�H�E�dH3%(uH��(1�H��[A\A]A^A_]鹲��褶��@UH��AUATI��SH��Hc�L�,H�U�H�J
H��8dH�%(H�E�1�H����P0L9�svI���u�H��L��H��H��I��vAH�ʉu�fnM�H��H��fp�H�f.�H��H9�u�H��H��H��H9�tH�C�3I9�vH�C�sI9�v�sH�E�dH3%(uH��8[A\A]]��˵��ff.�UH��AWAVL�t�AUI��ATSH��H��L�E�L�M�dH�%(H�E�1�H�EDžh��� H��p���H�E�H��x��������L�}�L���!f�<%t\I9�t'��I��H���C�A�D$I�L$��u��H��L)��H�}�dH3<%(��H�Ĉ[A\A]A^A_]�f��AL�a�PӀ�v�PЀ�	w!�I��A�$�PЀ�	v�PӀ�v�<lu
A�D$I��<s��<dt%<ut!I9��p����%H��f�C��G���fDL��H)�H���H�����h�����/���у�H�x�����h���Hc9<d�����
L��荭f�L���!�E�������L���H��H���C����u����fD��h�����/�a�ƒ�H�x�����h���H�
L��H)�H����H��H��P���H��X���觮��H��P���H��X���L��!H�4f�H9�wH��H�B�H���>���L�CH�L9�@��H9�@��@���H�p�H����H�x�1�1�H��H����ofo�fo�H��f`�fh�S\SH��H9�w�H��H��H��H��H�H�H)�H9�����CH����C�A�CH�����C�A�CH�����C�A�CH�����C�A�C	H�����C
�A�CH�����C�A�C
H�����C�A�CH��ts�C�A�CH��	tb�C�A	�CH��
tQ�C�A
�CH��t@�C�A�CH��t/�C�A�CH��
t�C�A
�CH��t
�C�A�Cf�L�����H����L�KL��H�
0�!��H��H���C�H9�u����1��o���f�H��p���H�BH��p������f�H��p���H�QH��p������������L��蜪L���!f��
���H�
��!�������ff.�UH��AWAVI��AUL�,ATSH��L�E�L�M�dH�%(H�E�1�H�EDžh��� H��p���H�E�H��x��������H��L�}�L�+�!f�<%tmH�CI9�w4�L)�H��H�}�dH3<%(��H�Ĉ[A\A]A^A_]�f�E1��CfD�#�I�̈SH��A�D$I�L$��u�H�C�@�AL�a�PӀ�v�PЀ�	w!�I��A�$�PЀ�	v�PӀ�v�<lt+<s��<dt/<ut+H�CI9��B����%H���A�D$I����@L��H)�H��?�n�����h�����/���у�H�x�����h����<d����L���
�Ψf�L���!�E�������L��@�H��H���C��C��C����u����fDH�FH�����@��h�����/��ƒ�H�x�����h���L�
L��H)�M����L��H��P���L��X����ϩ��H��P���L��X���L�@�!H��f�H9�wH��H�B�H���O���H�<�I�I9�@��H9���@��JH�H�H���<H�p�H��1�H��H��I��fo�fo�H��I��fo�fo�H��@�Cofo�f`�fh�f`�fh�fo�f`�fh�Z�j�R�r�H9�r�H��H��H��H��H�I�H)�H9���E1��CfD�A��CH���rE1��CfD�SA�A�CH���T1��C
f�sA�A�CH���81��Cf�SA�A�CH���1��Cf�CA�A�CH���1��Cf�CA�A�CH����1��Cf�CA�A�CH����1��Cf�CA�A�CH����1��C"f�C A�A�C#H��	��1��C&f�C$A�A	�C'H��
txE1��C*fD�[(A�A
�C+H��t^E1��C.fD�S,A�A�C/H��tD1��C2f�s0A�A�C3H��
t,1��C6f�S4A�A
�C7H��t1��C:f�C8A�A�C;f�H�����H����H�{L��L�
��!�I��H���C��C�A�A��C�I9�u��fDH��p���H�BH��p�������H��p���H�QH��p����R���Hc�L��������)�L�H�!f��V���L�
2�!����訫���UH��H���wx�EP�EP�8��fDUH��H���EjP�EP����UM�H��AWAVI��AUL�,ATL��I��SH���M�H�M��3�I�I9��~D�}�U�A�������E@��M���H��I)�L9�LF�1�L��L�U����L�U��U1�L��L�H���o}��E��t2I9�v-DL��H��1�H)�L��车����U1�H��L���8}��H��H��L)�[A\A]A^A_]��U1�H��L���}��E��t��f�UM�H��AWAVAUI��ATL�$SH��D�UL9��TI��A�˅���I�PI9��AL��H��H��I�|@��B��r����H�s�#H9�u(I��M)�1�D��L���}|��H��L��[A\A]A^A_]�H���C�A��I9���E����H��I9�s�E��A��A��@tzL��C�H��D�UH)�H9�HG�1�H��H�M��|���H�M�D�UL��H�D��1�H����{��E��tII9�vD�L��1�H��H)��@����N���E��H��A��fD1�D��H��L���{��E��u�L)�I�������E��A����E1���H���2���I��H��M)�����fDUM�H��AWAVAUL�,ATL��I��SH���M�H�M�D�u���I�I9�vA�U�E��A����tA��@uR1�D��H��L���{��E��t%H��L���H��D1�D��H��L����z��H��H��L)�[A\A]A^A_]�H��L���%1�D��L��H�H���z��E��t�I9�v��fDUM�H��AWAVAUI��ATL�$SH��D�uL9�����I�xI9��H��H��M�DP��G��W�H�s��Ј#I9�u(I��M)�1�D��L���z��H��L��[A\A]A^A_]�H���C���I9�����t9H��I9�s�E��A��A��@u,1�D��H��L���y��E��uKL)�I���E��A���ԉ�H��L���1�D��L��H�H���y��E��t�I9�v�f.�L��H���%L�$M)��D���E1��/���E��H��A���o���H���W���I��H��M)�����f�H����w7H�BH9�ryH��1����H���tf���f�2ø������1�H����w�H�BH9�r�H��H��@�rH����؈H��H��
�BH��H������܈B�ø�����ff.�@H�� ��H=�vQH����vHH����1�H��wMH�BH9�r?H����H��
��%�	Ƹ���܉2��H�BH9�rf�2�ø������������f.�UM�H��AWAVL�4AUATI��SH��D�]L9���I�Յ���I�@I9��A�0A�XM��1�A�xH����Hc�H�H�4A�X��Hc�H�H����vED�ہ�A��@�f�1�D��L��L���Pw�����HM)�M��H��L��[A\A]A^A_]�L��A�����H��L�H�����+H��H�5�TH��H�4�H��t��H�[�\���I�wA�I9�uI��M)�1�D��L����v���DI��A�_���M9������H��I9�r7�P��X��p�H����Hc�H�H��X���Hc�H�H�����L���L��D��L)��A��@��L���L��D�]H)�H9�HG�1�H��H�M�蟟��H�M�D�]L��I�D��1�L���v��������M9������L��1�L��L)��`������D�һ�����E1���D��I�����_����D�ہ��J���I��1��+���M��L��M)����f�H��L�^H�L9�r5D�D�VI��M�D�N�vA����Mc�Hc�M�L�H����v�f.�L�WxI�H��I92r0I��I�zI��J�<�H��t@��H�4v�t�I9�r�H����vÐI9�r�H��I���A�H��@�q�@�y�H��H��@�y�L9�r�A�{�A�s�E�K�H����Hc�I�I�<1A�s���Hc�H�H�����`�����1���t	��H9�s�H�NH9�r���~H��H��N��Hc�H��~��Hc�H�H�� u�H�B�I��H)�H��H��L�f.�I��L9�v8M9�t�A�9A�IE�AH����Hc�I�I�<A�I��Hc�H�H�� t�L��H)���UM�H��AWAVL�4AUATI��SH��D�UL9��pI�Յ��mI��M9��pH��L�=F�TH��H��H�@A�p�A�@����Hc�H��H��M��M��t@��H�vA�D�H��H��H�s�H9�u'I��M)�1�D��L���$s��H��L��[A\A]A^A_]�f�H���C���I9�������I��M9��p���H��L)�E��A��A��@ttL���D�UH)�H9�HG�1�H��H��H�M�����H�M�D�UL��H�D��1�H���r��E��tEI9�v@f�L��1�H��H)�����G���E��A��1�D��H��L���Nr��E��u�L)�I������fDE1����E��H��A���ÐH��1��4���I��H��M)������UM�H��AWAVAUATL�$SH��H��D�mL9��H���PI��M9��[H��L�x�TI��H�f�A�@�A�p����Hc�I��I��K�4�H��t��H�@�|�I��I��I�vE�I9�u(I��I)�1�D��H���]q��H��L��[A\A]A^A_]�I��A�~���M9�����t@I��M9��s���E��A��A��@u31�D��L��H���q��E��uNI)�M���fDE��A����@��L��L���C�1�D��H��I�L���p��E��t�M9�v�fDL��L���e�M�$I)��<���f�E1������E��I��A���[���fDI���=���M��L��I)����f�UL�H�9H��SI�L9�s>I��f�H��D�H����?L�I��I��I��I��L�H1�I9�u�H�RH�H�9I�[]�DUI��L��1�H��AWAVAUATSH��(D���L�uI��H����M9�M��L�E�I��H�M�H��L�]���M����I)�1�I��L��L��L�U���L�U�H�u�L��K�<������L��H��H���L�����L�]�L�E�9���H���L�L��H�߾?�P0;��L�]�L�E�tD�~E�1�fl�AH�e�[A\A]A^A_]�fDH�e�L��[A\A]A^A_]�**��f.�H��H�uȉ�L��AVH��H)�M�M�J�>M)�I�4�)��H�u�I�v^_���H�e�[A\H�A]A^A_]�DH��H�Mȉ�L��AVH)�M�M�L�L�M)�H���)��ZY�D1��ff.�f�H�I��\�H�F�>H9�������A�A�I9�v?L�Y�M9�s8�E��tnA�)lj�uL�L�H9�w�1�E1ҿ E1�I9�w��@�f����E��t1A��f��>�A�A�f�����w���������f.�UH�I�H��S�PH�~�H9����A�A�L9�s<H�Y�9I9�sF���E��tsA�)�u(L�L�H9�r�E1۸ E1�L9�r�1�E����E��tQ[]�fD�9f����E��t)A�봐�A�A�f�����v���D�����[]��1�[]�ff.�H�I�H9�sKH�~�H9�sq�����L9���A�L�I�9M9�s4���A�)�u8L�L�H9�r�L9�sML�IE1Ҹ �9M9�r��9A�f����)�t��@�f����L9�r�� u�H���b���@1��DA��t���D����f�H�I�M��uQ�H�~�H9�st�����I9���A�L�Q�9M9�s:���A�)�u>L�L�I��tQH9�w�I9�vGL�QE1۸ �9M9�r��9A�f����)�t�Ð�f����I9�w�� u�H��I��u�1��A��y���D����f�H�I�M��uQ�H�~�H9�st�����I9���A�L�Q�9M9�s:���A�)�u>L�L�I��tQH9�w�I9�vGL�QE1۸ �9M9�r��9A�f����)�t�Ð�f����I9�w�� u�H��I��u�1��A��y���D����f�H�BH9�r'1�H����w!H��f���H��f�r�B�Ð������f.�H��H�H9�s>L�^L9�r5D�D�VI��M�D�N�vA����Mc�Hc�M�L�H����v�DL�WxI�H��I92r0I��I�zI��J�<�H��t@��H�4v�4�I9�r�H����v�f�I9�r�H���A�H��@�q�@�y�H��H��@�y�L9�v�I��L9�r�A�{�A�s�E�K�H����Hc�I�I�<1A�s���Hc�H�H�����[����UH��H���EjP�EP������UH��H���EjP�EP�����UH��H���wx�EP�EP����fDUH��H���wx�EP�EP�x���fDH9��/����%UH��AVAUATL�aSM9��D�	I��I��H��I)�A�����D��I���I������f����t[�IA��L�-��TA�L��Ic�I��I��O�l�M����E��O�IC�\���I��L�`D�L9�u�*L��f�L)�[A\A]A^]�@H���X��:D�O�D�
H9�v�E��t�L�aM9�r�D�	D�˃����Z���L�IM9�r��I����u�L�ɻ��E���z���DE���m���1��1�널UH��AWAVI��AUL�,H�U�ATI��L��SL��H���M�L��M����I�I9�v|D�}�U�A�������E@��M���H��I)�L9�LF�1�L��L�U�����L�U��U1�L��L�H���f��E��t0I9�v+L��H��1�H)�L���ݏ����U1�H��L���Xf��H��H��L)�[A\A]A^A_]��U1�H��L���0f��E��t��f�UH��AWAVAUL�,H�U�ATI��L��SL��H���M�L��M�D�u���I�I9�vC�U�E��A����tA��@uT1�D��H��L���e��E��t'H��L���l�H���1�D��H��L���e��H��H��L)�[A\A]A^A_]�H�����1�D��L��H�H���]e��E��t�I9�v�뚐UH�I�H��AVSH9�sSH�~�H9�����D���L9���A�L�I�9M9�s1���A�D��)�uL�L�H9�r�L9���1�[A^]��L�
��Tf������M��A�M��t���H�<[A�|����L�
V�Tf����D��M��M��t��H�[E�t�L9�r!D��� u�H�������E1�A� �=���f�A��0���D[���A^]�DUH�I�H��AVAUATS�XDH�~�H9����A�A�L9�sBH�Y�9I9�sVD���E����A�D)�u,L�L�H9�r�E1۸ E1�L9�r�1�E����E����[A\A]A^]�fD�L�%F�Tf����D��M�$�M��t��H�<[E�t�E��tiA��f��L��Tf������I�<�H��t#��A�A�H�[�D�� ����A�A������[�����A\A]A^]�f.�[1�A\A]A^]�DH�I�M���6UH��AVATS�ZfDH�~�H9�����D���L9���A�L�Q�9M9�sP���A�D��)�uL�L�I��t
H9�w�L9�r1�[A\A^]�f�L�QE1�A� �9M9�r��L���Tf������M�$�A�M��t���H�<[A�|��f.��L���Tf����D��M��M��t��H�[E�t�L9�rD��� �e���H���K���DA�����D[���A\A^]�1���UH�I�H��S�qH�F�>H9�r
@��u�F<vw���A��A�I9�vPL�I�M9�r
��u	�Y��vr�E����A�)lj�uL�L�H9�w�E1�1�� E1�I9�w�[]���~��A�A�����~Ǹ�x�����A��A�����D�D�ID�E��tA��w���D�����[]��UI�H��AVL�42ATS�^fDH�F�>I9������A��A�I9�vCL�Y�M9�s@�E����A�)lj�uL�L�I9�w�E1�1�� E1�I9�w�[A\A^]�f��L���Tf������M��M��t��H�[A�D�E��trA��f.��L�
V�Tf������M��M��t#��A�H�@A�|��A��0����A��A�����f.�[�����A\A^]�@H�I�H9�sjH�~�H9�r��uD�NA��vz�����L9�sLA�L�I�9M9�r@��uD�YA���~���A�)�uL�L�H9�r�L9�r1������f�E1Ҹ �fD�FA��A���D�D�ND�L9��u����� u�H���4���fD�y��A��A����D�D�ID�A��g����UH�I�H��ATS�j�H�~�H9�r��u
�~@��vv�A��L9�sNL�Q�9M9�r@��uD�aA��vm�������A�)�u&L�L�H9�r�E1۸ 1�L9�r�1�E������to[A\]�f��F��A������~��x���fD�y��A��A����D�D�QDׅ�tA��|���D[�����A\]�fD[1�A\]ÐH�I�M���
UH��S�wf.�H�~�H9�r��uD�VA���������I9���A�L�Q�9M9�r@��u	�Y��v?���A�)�uL�L�I��t
H9�w�I9�w	1�[]�@E1۸ �fD�y��A������D�D�QD�A��D�FA��A���D�D�VD�I9��Z����� u�H���}���fD���[]�1��@H�I�M���
UH��S�wf.�H�~�H9�r��uD�VA���������I9���A�L�Q�9M9�r@��u	�Y��v?���A�)�uL�L�I��t
H9�w�I9�w	1�[]�@E1۸ �fD�y��A������D�D�QD�A��D�FA��A���D�D�VD�I9��Z����� u�H���}���fD���[]�1��@UH�I�H��AVSH9�sSH�~�H9�����D���L9���A�L�I�9M9�s1���A�D��)�uL�L�H9�r�L9���1�[A^]��L�
�Tf������M��A�M��t���H�<[A�|����L�
��Tf����D��M��M��t��H�[E�t�L9�r!D��� u�H�������E1�A� �=���f�A��0���D[���A^]�DUH�I�H��AVAUATS�XDH�~�H9����A�A�L9�sBH�Y�9I9�sVD���E����A�D)�u,L�L�H9�r�E1۸ E1�L9�r�1�E����E����[A\A]A^]�fD�L�%��Tf����D��M�$�M��t��H�<[E�t�E��tiA��f��L���Tf������I�<�H��t#��A�A�H�[�D�� ����A�A������[�����A\A]A^]�f.�[1�A\A]A^]�DH�I�M���6UH��AVATS�ZfDH�~�H9�����D���L9���A�L�Q�9M9�sP���A�D��)�uL�L�I��t
H9�w�L9�r1�[A\A^]�f�L�QE1�A� �9M9�r��L�q�Tf������M�$�A�M��t���H�<[A�|��f.��L�6�Tf����D��M��M��t��H�[E�t�L9�rD��� �e���H���K���DA�����D[���A\A^]�1���H�I�M���6UH��AVATS�ZfDH�~�H9�����D���L9���A�L�Q�9M9�sP���A�D��)�uL�L�I��t
H9�w�L9�r1�[A\A^]�f�L�QE1�A� �9M9�r��L�!�Tf������M�$�A�M��t���H�<[A�|��f.��L���Tf����D��M��M��t��H�[E�t�L9�rD��� �e���H���K���DA�����D[���A\A^]�1���UM�H��AWAVAUATL�$SH��H��D�mL9��H���PI��M9��[H��L�8�TI��H�f�A�@�A�p����Hc�I��I��K�4�H��t��H�@�|�I��I��I�vE�I9�u(I��I)�1�D��H���U��H��L��[A\A]A^A_]�I��A�~���M9�����t@I��M9��s���E��A��A��@u31�D��L��H����T��E��uNI)�M���fDE��A����@��L��L����1�D��H��I�L���T��E��t�M9�v�fDL��L���%�M�$I)��<���f�E1������E��I��A���[���fDI���=���M��L��I)����f�UH�I�H��S�yH�~�H9�r��u
�~@��vv��A��A����I9�vTL�I�M9�r��u
�Y�����E���A�)lj�uL�L�H9�w�1�E1ۿ E1�I9�w�[]��FH�������H�H��FH�H������I��H���TI��J��H����@��A�A�H�<�|���=���f�D�IH��H��A��%�Mc�L�D�IL�H=��v5E��tLA�����*����A����A�����DH��L�
V�TH��M��M��uE��u�����[]�@��H�@A�D�E��t�A�����@�A�A��v���f�H�I�H9�sjH�~�H9�r��uD�NA��vj�A�L9��JL�I�9M9�r@��uD�YA�������A�)�uL�L�H9�r�L9���1������FI��A�����H�I��FI�I������H�>�TM��I��N��D��M��t
E��K�IA�D�L9����� u�H�������D�IL��H��A�����Mc�L�D�IL�H����wcI��L�
��TI��O��M��t\@��H�<A�|�A��
���@E1Ҹ ����A����L9�������� ��A��������A����A����f.�UH�I�H��ATS�s�H�~�H9�r��u�~@������A�L9�sSL�Q�9M9�r@��uD�aA�������E���A�)�u+H�L�H9�r�1۸ E1�L9�r�1�E����E���![A\]�@�FH�������H�H��~H�H=����I��H�=]�TI��J�<�H�������A�H�@�D��/����D�QL��H��A�����Mc�L�D�QL�H����vE��t2A�����&���fDI��L���TI��O��M��u)E��u6[�����A\]�f�����A����@��H�<A�|�E��t�A������A��y���[1�A\]ÐH�I�M����UH��S�sf.�H�~�H9�r��uD�VA�����A�I9��AL�Q�9M9�r@��u	�Y��vC���A�)�uL�L�I��t
H9�w�I9�w
1�[]��E1۸ �fDD�QH��H��A�����Mc�L�D�QL�H������H��L���TH��M��M����@��H�<A�|�A��e���@�FI��A�����H�I��FI�I����wAH�*�TM��I��N��D��M��t
E��K�RA�D�I9�wP�� �!���H������@A����I9�������� []�fDA��������A����A����1���H�I�M����UH��S�sf.�H�~�H9�r��uD�VA�����A�I9��AL�Q�9M9�r@��u	�Y��vC���A�)�uL�L�I��t
H9�w�I9�w
1�[]��E1۸ �fDD�QH��H��A�����Mc�L�D�QL�H������H��L���TH��M��M����@��H�<A�|�A��e���@�FI��A�����H�I��FI�I����wAH�Z�TM��I��N��D��M��t
E��K�RA�D�I9�wP�� �!���H������@A����I9�������� []�fDA��������A����A����1���UH�I�H��S��>L�N��L9�r%A��A��A�����L�NL9�r��<��%����A�A�I9�vo�H�YA��I9�r%�Ã�����H�YI9�rA��A�����E���?A�)lj�u!L�L�H9��T���1�E1ۿ E1�I9�w�[]���F��L�
��T�Hc�H��I��H����@��A�A�H�<�|���<���f�D�I��H���TD�Lc�I��N��M��t��H�@A�D�E����A��E���fD�F��<������A����A�����fDD�IA��A������E��t0A��������A�A����f.������[]��UH�I�H��S�H�FH9�r'�F�ǃ�@�����H�~H9�r��<�� �>�A�A����I9�vpH�AI9�r)�AA��A��A�����L�IM9�r��<�����E���.A�)lj�u!L�L�H9��S���1�E1ۿ E1�I9�w�[]�fD�>��L�
��T�Hc�H��I��H����@��A�A�H�<�|���=���D�	��H���TD�Lc�I��N��M��t��H�@A�D�E��t~A��K����F��<������A����A�����fD�A��<���E��t,A������@�A�A����f������[]��UM�H��AWAVAUATL�$SH��H��D�mL9�������M�PM9���A�0A�@I��A�xH����H�H�H�4A�@��H�H�H=��vME��A��A��@�1�D��L��H���F��E���8I)�M��H��L��[A\A]A^A_]��H��A�����H�H=����H��H�5�TH��H�4�H��t��H�@�D���I�wA�?I9�uI��I)�1�D��H���#F��뇐I��A�G���M9�������I��M9��*���A�r�A�B�A�z�H����H�H�H�4A�B���H�H�H=����H=���L���D�Ǹ���d���fD��L��L����1�D��H��I�L���E��E������M9�����fDL��L����M�$I)�����E1������E��I��A���u���fDE��A���`���I���D���M��L��I)�����UH�I�H��ATS�fDH�FD�H9�r+�~A����A��A�����L�NL9�r��<����A����A�I9�vtH�AD�	I9�r+�AA��A��A��A���u{L�aM9�rA��A�����A���E���,A�)lj�u H�L�H9��I���1�1ۿ E1�I9�w�[A\]�����A�D��d���D��D�E����A�뛐D�^D�؃�<�������A���A��D��A��A����
D�B��~A���8�����D�aE��A��A���������A��%A��A��D���
E�C�!D�IB��E��tA����f�[�����A\]�fDUH�I�H��S��>L�N��L9�r%A��A��A�����L�NL9�r��<�������A�A�I9�vk�H�YA��I9�r!�Ã���uxH�YI9�rA��A������E���#A�)lj�u!L�L�H9��X���1�E1ۿ E1�I9�w�[]��F��A�A�Ǹ�k����D�I��D�E����A��@D�ND�ȃ�<�� ����F��A��A���A��A���
�B��~��8����D�ID�˃��������Y��A��%A����
�A��AA��E��tA����f������[]��H�I�H9���L�NL9�r'�~����<���H�FH9�r
��@�����A��L9��bH�yI9�r+�yA��A��A�����L�IM9�r
��@������9A����)���L�L�H9��_���L9���1��@���L�3�T�Hc�H��I�<�H��t��H�@�D�L9����� uHL������D�	��L��TD�Lc�I��O��A�M���n���@��H�<A�|�)��a�����E1Ҹ �����F��<�����A��������f��y��@��������A��������A����D�� �@H�I�H9����L�N��L9�r'A��A��A�����L�NL9�r
��@�����A�L9��h�9L�QA��M9�r(A��A��A�����L�QM9�rA��A��������A�)���L�L�H9��]���L9���1��f��~��L�r�T�Hc�H��I�<�H��t��H�@�D�L9����� uPL�������D�I��L�)�TD�Lc�I��O��A�M���g���@��H�<A�|�)��Z����fDE1۸ ����~��@�������A���������D�IA��A�����A������DA����D�� �ff.��UH�I�H��ATS�fD�L�V��L9�r'A��A��A�����L�VL9�r
��@����#�A��L9�sm�9L�aA��M9�r(A��A��A�����L�aM9�rA��A����������9A�)�u.L�L�H9��X���E1۸ 1�L9�r�1�E�������[A\]�@�~��L�z�T�Hc�H��I�<�H������A��H�@�D��6���f�D�Q��L�%1�TD�Lc�I��O��M��t
@��H�<A�|���t}A��?���f��~��@�������A���������f.�D�QA��A��������t)A�������f�A���}���[�����A\]�fD[1�A\]�f�UH�I�H��AVS�fDH�FH9�r'�~����<���H�FH9�r
��@����(�A���L9�smH�yI9�r+�yA��A��A�����L�QM9�r
��@�����9������+A�)�u.L�L�H9��Z���E1۸ 1�L9�r�1�E�������[A^]�fD���L�{�T�Hc�H��I�<�H������A��H�@�D��5���f.�D���L�52�TD�Lc�I��O��M��t
@��H�<A�|���tnA��>����F��<�����A���������@�y��@��������t#A�������A�����[�����A^]�fD[1�A^]�f�H�I�M����UH��S��L�VL9�r'�~����<���H�FH9�r
��@�����A��I9��QH�yI9�r+�yA��A��A�����L�QM9�r
��@������9A����)�uL�L�I��tH9��]���I9�w1�[]�E1۸ �fD���L���T�Hc�H��I�<�H��t��H�@�D�I9����� u�L���D���H�R�TD�Lc�I��J��A�H���_���@��H�<�|��N���@�F��<����A����������y��@����
���A�����	����A����D�� []�1��ff.�@H�I�M����UH��S���L�V��L9�r'A��A��A�����L�VL9�r
��@�����A�I9��W�9H�YA��I9�r%��������H�YI9�rA��A��������A�)�uL�L�I��tH9��^���I9�w	1�[]�@E1۸ �fD�~��L�·T�Hc�H��I�<�H��t��H�@�D�I9����� u�L���f�D�Q��H���TD�Lc�I��J��A�H���]���@��H�<�|��L����~��@������A���������D�QA��A�������A�������DA����D�� []�1���H�I�M����UH��S���L�V��L9�r'A��A��A�����L�VL9�r
��@�����A�I9��W�9H�YA��I9�r%��������H�YI9�rA��A��������A�)�uL�L�I��tH9��^���I9�w	1�[]�@E1۸ �fD�~��L��T�Hc�H��I�<�H��t��H�@�D�I9����� u�L���f�D�Q��H���TD�Lc�I��J��A�H���]���@��H�<�|��L����~��@������A���������D�QA��A�������A�������DA����D�� []�1���H�I�M����UH��S��L�VL9�r'�~����<���H�FH9�r
��@�����A��I9��QH�yI9�r+�yA��A��A�����L�QM9�r
��@������9A����)�uL�L�I��tH9��]���I9�w1�[]�E1۸ �fD���L�#�T�Hc�H��I�<�H��t��H�@�D�I9����� u�L���D���H��TD�Lc�I��J��A�H���_���@��H�<�|��N���@�F��<����A����������y��@����
���A�����	����A����D�� []�1��ff.�@H�I�H9����L�N��L9�r'A��A��A�����L�NL9�r
��@������A�L9��`�9L�YA��M9�r$A��A��A���ulL�YM9�rA��A��������A�)�uZL�L�H9��e���L9�rQ1��fD�~��A��L9�r��� u$L���-����D�I��D�A�)�t��f.�E1Ҹ �K���D�ND�σ�@��������~��A��A�%A����
�B��~��8��DD�YE��A��A�������D�I��A����A��A��
A�C�<D�IB��A����fD�� �@UH�I�H��SH9���L�N�L9�r/D�VE��D��A��A�����L�NL9�r
��@�����A�L9��=L�I�9M9�r&D�YD��E�ك���u^H�YI9�r
A��A���tk���A�)�uL�L�H9��`���L9�r71�[]�f�A��D�A�L9�r��� u�L���,����A��A�D�벐E1Ҹ �f����YA��A��A��������A����
A����E�;��A�<D�IB��A��U���@D�ND�σ�@������A����
A��A��A�<A��A�B��~��8���@�� []�f.�UH�I�H��ATS�fD�L�V��L9�r'A��A��A�����L�VL9�r
��@�������A�L9�sn�9L�aA��M9�r(A��A��A�����L�aM9�rA��A��������E���0A�)�u/H�L�H9��W���1۸ E1�L9�r�1�E����E���[A\]�f.��~���A���T����D�Q��D�E����A��@D�VD�׃�@��������~��A���%A��A���
�B��~��8����D�QE��A��A�������D�a��A����A��A��
D�A��yA��:E��tA�����[�����A\]�fD[1�A\]ÐUH�I�H��AUATS�@H�~�H9�r/D�VE��D��A��A�����L�^L9�r
��@�������A�L9�ssL�Y�9M9�r0D�aE��E��A��A�����L�iM9�rA��A��������E���-A�)�u/H�L�H9��L���1۸ E1�L9�r�1�E����E���[A\A]]�DA���D�A��T����A��D�E����A���D�^D�߃�@�������A����
�A��A��A�<A��A�B��~��8����D�iE��A��A�������A����
A��A��E�<A��C�<+D�YB��E��tA�����@[�����A\A]]�@[1�A\A]]��H�I�M����UH��S���L�V��L9�r'A��A��A�����L�VL9�r
��@�������I9��X�9L�YA��M9�r(A��A��A�����L�YM9�rA��A��������A�)�uL�H�I��tH9��\���I9�w1�[]�f�1۸ ���~����I9��q����� u�L����D�Q��D�A��DD�VD�׃�@���� ����~��A���%A����
�B��~��8���fDD�QE��A��A�������D�Y��A����A��A��
D�A��yA��:A������ []�1���H�I�M����UH��ATS�DL�V�L9�r-D�^D��D�߃�����L�VL9�r
��@������A�I9��SL�Q�9M9�r/�YA��A��A��A����L�aM9�rA��A��������A�)�uL�L�I��tH9��S���I9�w1�[A\]��E1۸ �fDA��D�A�I9��g����� u�L����A���D�VD�׃�@����$���A����
A��A��A�<A��A�B��~��8���@D�aE��A��A����"�������
��A��D�;A��C�<"D�QB��A����[�� A\]�1��DH�I�M����UH��ATS�DL�V�L9�r-D�^D��D�߃�����L�VL9�r
��@������A�I9��SL�Q�9M9�r/�YA��A��A��A����L�aM9�rA��A��������A�)�uL�L�I��tH9��S���I9�w1�[A\]��E1۸ �fDA��D�A�I9��g����� u�L����A���D�VD�׃�@����$���A����
A��A��A�<A��A�B��~��8���@D�aE��A��A����"�������
��A��D�;A��C�<"D�QB��A����[�� A\]�1��DH�I�M����UH��S���L�V��L9�r'A��A��A�����L�VL9�r
��@�������I9��X�9L�YA��M9�r(A��A��A�����L�YM9�rA��A��������A�)�uL�H�I��tH9��\���I9�w1�[]�f�1۸ ���~����I9��q����� u�L����D�Q��D�A��DD�VD�׃�@���� ����~��A���%A����
�B��~��8���fDD�QE��A��A�������D�Y��A����A��A��
D�A��yA��:A������ []�1���H�H�FH9�w�f��z�uH��H9�v�z� t�H�GxL�	M�H9���H��H9���UH��AUATSH�X�
@H��H9�rD�V��F�A��A�Mc�M��I��J��H��tE��K�<RD�l�M��I��L�σ�?J�A��H��L��H��H�L1�H�ǃ�?M�L;I��M��I��I��M�I1�H9��x���[A\L�	A]]M��L�	M��ff.��H�H�FH9�w�#f��z�u�z�u�z�uH��H9�v�z� t�H�FL�	M�H9�r2�D�^H��I��F��H�L�D�^A��Mc�L�H=��vL�	M���UH��H��AWAVAUATSL�wxI�H�]�M��I��H9E���M1̻���E1�M��I��M�M1�L��M�̃�?I��M�\:L��M�M1�L�ȃ�?I�D	I��H��L��H��H�I1�H9�r9�F��~�H��H��H��~���Hc�H��~���Hc�H�H=���X���L�	M�[A\A]A^A_]�I��I�~M��M�zI��A��?��J�<�M�H��t?H�[�D�H��H��H����L��M�M1�I����L��I����?E��I�M������H��H��H��I��I�M1�D��L���?I�A��M������DH9���H����I���>@����H�FH9�w.@����|@���v@���t�~@���ts@���vmH���-L�VI9�w\@���uV�F<�tN<�vJ�F<�vB<�t>L��I��H9�sM��u�H��L)�I�0I�@�fDH����f��~��_@��>v�UH��L)�H��H�u��~E�fl�A]�1��f�1�H9�r�W����t+��x7H��H��H9�v����u�H��H��H9�w��@H��H����fDH��H����fD�ff.�@H9���������_�����]wHH�zH9����J���H�
#|'H��A�H�H��uw�R�������_��]vf1��@=�tq=�u�H�BH9�rC�B�J���H�
�{#H��A�H�H��u!�B��_<]w��B��_<]w������ø������H����H�BH9�r-�B�P_��>�h���H��H���������ø�����@H9�������y>H�FH9������t1�A_<]wB�F��_<^�����À��u$�F�P_1���]v=�@�F�H_���>v71��@H�FH9�sǀ��u��F��_<^�����F��_<^���Ð�������ø�����ff.��H9�sK���~#H��H���H�BH9�r!@�r���@�2���������f.�������f.���H9���@�2��f�1�H����wHH�=�y%�wf��f�<wu7H��y!�<p�pf����t8H�BH9�re���f�zø�����@H�rH9�r�f���fDH�����H��>w�H�BH9�rȃ�@���@�r�f.������ø�����@UH��AWAVAUATL�$SH��H�M�L�M�L9��jI��H��M��I��fDI���L��H��L���������I�~xHc��SH�����H����CH����H�@H��H����H�}����H�I�W=�������A�7�"H�rL�z�I9��g���L��H+E�H��[A\A]A^A_]�f��I��H��A�DA�G��f��I��H��H��tH�RH��H���e���E��CI��H��A�G��=�RL��I���l���fD�@�:����D�H��u�E�H��D�I���DH��1�[A\A]A^A_]�L�������L�GHE1��D���@L�GPA��1����UH�I�H��S�����
H�~H9�r'<��\�x_@��]���~D�O_A��]�OI9���9�@���[A�A�L�IM9���@���t{D�O_A��]��D�IA�Y_��]vm���E����A�)���L�L�H9��D���I9����9@����H�AI9���E1�E1۸ @���u�D�IA�Y_��>w���A��D	�E��tTA��@I9�v;�9A�A�@���j���L�IM9��,������A��R���D�[]ø����[]��1���@�~D�O_A��>�����I9�v����	��9@��yA�A����)��@H�~H9��v���<��n����^�{_@��]�]����^�{_@��]�L���I9��`����F�9f����
�@��y�A�A��@����L�IM9��[���@����Q����YD�K_A��]�?����YD�I��_��]�*���fA��A�����E�����A������UH�I�L�
�t)H��ATS������H�~H9�r'<��T�x_@��]���~D�W_A��]�GI9����9�@���KA��L�YM9���@���tzD�__A��]��D�YE�c_A��]vl������A�)��L�L�H9��E���I9���9@����H�AI9���E1�1۸ @���u�D�YE�c_A��>w���A��D	߅���A��f.�I9����9A�A��@������A�<9A��O������A��;�����~D�W_A��>�����I9�vA����	��9@���
DH�s)�:)�[A\]�fD[�����A\]�fD��ސ1���@H�~H9��V���<��N����^�{_@��]�=����^�{_@��]�,���I9�v��F�9f����
�@���p���A��� ���L�YM9��C���@����9���D�YA��_A��]�&���D�aD�YA��_A��]����fA��A�����������A�����@A������UH�I�H��S������H�~H9�r'<����x_@��]��~D�O_A��]���A�L9����9@��y2L�QM9�r#@���trD�W_A��]�D�QE�Z_A��]vd���A�)�u?L�L�H9��^���L9�s)E1ɸ ��A�L9�r��� u
A���1�[]�D�QE�Z_A��>w�A����D	�A����~D�O_A��>�)�������A�	�L9��&����� []ÐH�~H9������<�������^�{_@��]����^D�N�{_@��]����fA��A��A�
����L�Y@������M9�����YD�S_A��]����D�Q�YA��_A��]�����f���ˁ��)������L�����ff.�UH�I�L�
�o)H��ATS�������H�~H9�r'<���x_@��]�?�~D�W_A��]��A�L9��
�9@��ygL�YM9�r*@�����D�__A��]�HD�YA�[_��]�����A�)�u`L�L�H9��W���L9�sJ�9E1Ҹ @��x�A�<9A���DA�A�L9��k����� uA���1�[A\]ÐD�YA�[_��>�x���A����D	�A��o���f��~D�W_A��>���������A�	�L9������[�� A\]��H�~H9�����<�������^�{_@��]������^D�V�{_@��]�����fA��A��A�
����H�Y@��������I9������D�YA��_A��]�����D�YD�aA��_A��]�����fA��A�́��)����H���|���ff.�@UH�I�H��ATS�fD����
H�~H9�r'<��l�x_@��]���~D�W_A��]�_L9���9�@���sA��L�QM9���@���tzD�W_A��]��D�QE�b_A��]vl�������A�)���L�L�H9��E���L9����9@����H�AI9���E1�1۸ @���u�D�QE�b_A��>w���A��D	ׅ�tnA��fDL9�s;�9A��@���j���L�QM9��,������A��R���fD1�E����[A\]�[1�A\]�f��������f��~D�W_A��>�����L9�s�����	��9@��yA�����f�)��@H�~H9��^���<��V����^�{_@��]�E����^�{_@��]�4���L9��H����F�9f����
�@��y�A���(���L�QM9��K���@����A���D�QA��_A��]�.���D�aD�QA��_A��]����fA��A����������A�����ff.��H�I�M���UH��ATS�D�����H�~H9�r'<����x_@��]���~D�W_A��]���A�I9����9@��y9L�YM9�r*@�����D�__A��]��D�YA�[_��]�����A�)�uL�L�I��tH9��Q���I9�w1�[A\]�DE1Ҹ �fDA�I9��p����� u�A��@�~D�W_A��>�9�������A�	�I9��6���[�� A\]��D�YA�[_��>�P���A����D	�A��G����H�Y@����,���I9��#���D�YA��_A��]����D�YD�aA��_A��]�����fA��A�́��)��
���H������H�~H9��v���<��n����^�{_@��]�]����^D�V�{_@��]�G���fA��A��A�
��9���1��H�I�M���UH��ATS�D�����H�~H9�r'<����x_@��]���~D�W_A��]���A�I9����9@��y9L�YM9�r*@�����D�__A��]��D�YA�[_��]�����A�)�uL�L�I��tH9��Q���I9�w1�[A\]�DE1Ҹ �fDA�I9��p����� u�A��@�~D�W_A��>�9�������A�	�I9��6���[�� A\]��D�YA�[_��>�P���A����D	�A��G����H�Y@����,���I9��#���D�YA��_A��]����D�YD�aA��_A��]�����fA��A�́��)��
���H������H�~H9��v���<��n����^�{_@��]�]����^D�V�{_@��]�G���fA��A��A�
��9���1��UH�I�L��f)H��AUATS�D����H�~H9�r'<����x_@��]��~D�__A��]�wL9���9�@���;A�A�H�YI9���@���tx�__��]�`�YD�k_A��]vl���E�����)���L�H�H9��G���L9����9@����H�AI9���E1۸ E1�@���u��YD�k_A��>w�����	�E��ty��f�L9�s3�9A�A�A�@���/���A�<:��a����1�E����[A\A]]�f������2���[1�A\A]]���������f�H��d)�:)�뱐�~D�__A��>�����L9�s�����	��9@����A�A����@H�YI9������@���������Y��_��]�����D�i�YA��_A��]�p���f�������E���L�����d���f�H�~H9����<�����^�{_@��]�����^�{_@��]����L9������F�9f����
�@����A�A����@��H�
�c)�)����f.�H�I�M���4UL��c)H��AUATS�@�����H�~H9�r'<���x_@��]�?�~D�__A��]��A�I9��
�9@��yyH�YI9�r(@������__��]�J�YD�c_A��]������)�uH�L�I��tH9��T���I9�w1�[A\A]]�fD�9E1۸ @��x�A�<:��@A�A�I9��[����� u�A����YD�c_A��>�n�������	߻�g���@�~D�__A��>���������A�	�I9������[�� A\A]]�DH�~H9�����<�������^�{_@��]������^D�^�{_@��]�����fA��A��A�
����L�a@��������M9�������Y��_��]������YD�i��_��]�����fA��A�́��)������L������1��f.�H�I�M���4UL�9a)H��AUATS�@�����H�~H9�r'<���x_@��]�?�~D�__A��]��A�I9��
�9@��yyH�YI9�r(@������__��]�J�YD�c_A��]������)�uH�L�I��tH9��T���I9�w1�[A\A]]�fD�9E1۸ @��x�A�<:��@A�A�I9��[����� u�A����YD�c_A��>�n�������	߻�g���@�~D�__A��>���������A�	�I9������[�� A\A]]�DH�~H9�����<�������^�{_@��]������^D�^�{_@��]�����fA��A��A�
����L�a@��������M9�������Y��_��]������YD�i��_��]�����fA��A�́��)������L������1��f.����1�H�D1�H��H��ff.�����H�F1�H��H�@�ff.��H9����:@��yo1�@���ve@���vq@���wYL�BL9�rKD�BA�H���?wB�R�€��?w6A���w@���t*H������H��H��%�H	�H	�H��ø����ÐH�>���L�BL9�r-�R�€��?w�H���Ҹ��H	�H�>�f������ø�����@H��H9���H����H�BH9���H��@����@H=?�H��h)D�BE����H��P��H��?�	H��c)D�BE����H�GH9��%H��H��a)H������WH��H������WH���H������0�W�G��DH�Yb)�<0��H�BH9����@H�����H���L���H��c)D�BE���]���D����������B0�G����A)��A��0D�G��H���H=�w�H��c)D�BE��u�H�����H��?�����H�0b)D�BE������@�2��������ø����ø�����ff.�UI��H��L��H��H��H���H�u��P(��ff.�@UH��AWI��AVAUATSH��8H�M�L�E�H��toI��I��L�m�H���H�I�H��tUI���L��L��L��L���P(���M9��L�}��~E�IG�H�E�H�E�E�H�E�H��8H)�[A\A]A^A_]ÐH�E�H�@L�8H�E�H��8[A\A]A^A_]�ff.�H9��W�:@��y1�@���vv@����}@�����L�BL9��2D�BA�H���?wG�R�€��?w;A���w@���t/H�����Ҹ���H��H	�H	�H��1�A������H�>���L�BL9����R�€��?w�H���Ҹ��H	�H��fD@���w�L�BL9���D�JE�A�A��?w��J�����?w��R�€��?�y���@����c���A���v1�@����]���H��E�����Ɂ�I���I	�H��L	�H	�H�ø����ø����ø����ø������H9���H��w!H�z�����H9����@�2�fDH�����H������1�H����w`H�z�����H9�����H����?H���Ȁ�B���H����?H���ɀ�J��H����?@���ɀ@�2�JÐ������f.�H�z�H9�sʸ�����@H�z�����H9�rϸ��ff.�@UH��AUI��ATSH��(dH�%(H�E�1���,���H�E�dH3%(�,H��([A\A]]�f�H�]�H���L�$Hc�H�S
H��H����H��M�LM9���H��I��M���A���2f.�H����H��t�A�M����I�I�M9�rBM��H��r�H�I�xH��I�H��I�H�L�I�L�L��I�H)�H)�H�H���H�M9�s�M9�����H�E�dH3%(uFH��(L��L�� [L)�A\A]]�1$����A��L�A�L��j���D�L�fA�L��U�����'��UA�A�\H��H��j腾��H9�������v_1����wTH�~H9����~�W���?w;�V�€��?w/�V�€��?w#���t@��������u{�f�1�@�����������y�1����v��wH�FH9�rd�F���<@������H�~H9�rC�~�W���?w��V�€��?w�@���w���t���fD��f������ø����ø����ø�������L�GxH��H��1���t.D���y)<�v<����W�€��?�H��H)����I��M�HI��O��M��t��H�@A�D�A�H��vGA�H=�v$H=��w�A��H��A��?��A�ɀD�IA�A��H��A��?�A�ʀD�QH׈L�����E����c����<��S���D�WE�J�A��?�@����W�€��?�0���<�u
A����"���H��E����%�I��L	�H	к����H����%�H	�I�PI��I��N�ʺM�������A���/���@H��wH9���@�2���H���w'H�BH9�rtH���?H���΀��@�r���f�1�H����w:H�BH9�r,H��H�����H���?H���΀��?@�r�Ȁ�B�ø�����f.������ø�����@���yi1����v^���vm�����D�NE�A�A��?wA�N�����?w5A���w���t*H��E���ɸ���I��I	�L	�H��A���w{�H�����N�����?w�H���ɸ��H	�H�����w�D�NE�A�A��?w��N�����?w��v�ƀ@��?w����t�A���v1����t�H��E��@���Ɂ�I���I	�H��L	�H	�H�7�f.�UH��AUATSH��H��H�L�ox����EI��L�U�L�]؄�us�9f�H�
�TH�@I��H���@H�E�H�����H��TH�@H��H���PH�U�H�E�H9���I�$�����������y�L��L���,�������H�I�H�E�I9Er�H��I�UH��H��H���w�����H�@�D�H�E�H����h���f�H��L��������~iH�H�U�H�I9U�^���H��I�EH��H��H���F�����H�R�T�H�E�H�U�H9��7���H��)�[A\A]]�D1���@����H��L���$��H��[A\A]]�f��L�GxH��H��1���t.D���y)<�v<����W�€��?�H��H)����I��M�HI��O��M��t��H�@A��A�H��vGA�H=�v$H=��w�A��H��A��?��A�ɀD�IA�A��H��A��?�A�ʀD�QH׈L�����F����d���f�<��S���D�WE�J�A��?�@����W�€��?�0���<�u
A����"���H��E����%�I��L	�H	к����H����%�H	�I�PI��I��N�ʺM�������A���.���@H����UH��SH9���I��fD�>@���v7@����}H��H�u�L)�H9����~E�H�u�E�A[]�fD@����@���v�@�����H�~H9�r��F���<?w�H��I����I�@H��I�0[]�DH�^H9��v���D�^A�C�<?�e����FD�P�A��?�S����F���<?�D���@�����A���v
@����*���H���f�H��I���|���H9������H��L)�H�u�1������L�VL9����D�^A�C�<?�����F���<?����@���u
A��������L���fDA���������r���I�@H��I�0�1��fDH���UH��H9����<�v#1�H�u��~E�H�u�E�A]�f.�H�τ�yI<�v<�wiL�NL9�r�F���<?��H��H)�H9�w�H�u�1��~E�H�u�E�A�DH��H��tcH9�vu�<�v�H��H)��n����L�VL9�r�D�^E�K�A��?w�D�NA���A��?w�<�u
A����z���L���fDL���I�@H��I�0]�1��^���H��H)��S����I�@H��I�0ÐH9�ss�1����vø��y�1����v��wH�FH9�rV�F���<@������H�~H9�r5�~�W���?w��V�€��?w�@���w���t���fD�����ø����ø�����fDUH�I�H��ATS�fD�����<�v)H�~H9�r <��x�^�{�@��?��I9����9�@����A�A�@���v	L�YM9�sA���A�)�ueL�L�H9��t���I9�vO�9@���v~H�AI9�ruE1�E1Ҹ @���wt�YD�[�A��?�����E��tGA���1�[A\]ÐI9�v�9A�A�@���Y����ʐ[�A\]�fD�������f�L�YM9�r�@���w�D�aA�\$���?�|���D�YA�ÀA��?�i���@���w
A����Y������E������A	�D	�E��t�A����f�H�~H9������<������D�VE�J�A��?�x����^�{�@��?�g���<�w
A����Y���I9�� �����E��@��A�A��%�D	�A�	��9@���E������f.�)����f�I9�������@��%�	��9@��y�A�A������E�ہ�D	�E�������A����ff.��H�I�L�WxH9���UH��H��SD�>@��y8@���v%@����L�NL9�r�^D�K�A��?�uH)�[]��M�J�M�	M��t_L�C�<�H��vQH���w`L�XM9�r�I��I��A��D�A��A��?A�ɀD�HL��Hc�H�H9��`���H)�[]�f.�I9��z���@�8H����fDH�����^���L�XM9��Q���I��I��A���D�I����?I���πA��?@�xA�ɀD�HL���|���@�������L�NL9������^D�K�A��?��D�^A�ÀA��?�������w
@�������H��E�ɻI�����L	�E��L	�M�JI��I��O��M�������@�����H��E�Ɂ�L	�M�JI��I��O��M��t@����v���D��~���1��H�I�L�WxH9���UH��H��SD�>@��y8@���v%@����L�NL9�r�^D�K�A��?�uH)�[]��M�J�M�	M��t_L�C�|�H��vPH���w_L�XM9�r�I��I��A��D�A��A��?A�ɀD�HL��Hc�H�H9��_���H)�[]�f�I9��z���@�8H����fDH�����^���L�XM9��Q���I��I��A���D�I����?I���πA��?@�xA�ɀD�HL���fD@�������L�NL9������^D�K�A��?��D�^A�ÀA��?�������w
@�������H��E�ɻI�����L	�E��L	�M�JI��I��O��M�������@�����H��E�Ɂ�L	�M�JI��I��O��M��t@����v���D�����1��UL�H��AUATL�gxSH�I�H9�s1@���y9<�v"<���L�VL9�r�v�ƀ@��?�[[A\L�A]]I��fDD��H��M9$��M��I�D$E��I��J��H��t%O�IJ���G
���D�hE��I���M��A��?I�L��L��H��L�L1�I��A��?N�\
H��M��I��I��M�I1�H9��*���[A\L�A]]I��DA��A���f.�<��%���L�VL9�����D�NE�i�A��?�����v�ƀ@��?��A���w<����I��A��I��H��A���I	�@��L��I	������D�hE��I�������I��@��L��I��A��I	����ff.�H�H��vpI��I��L9�sd�P�L9�v��� uUH���P�I9�u�L�VI��M9�v;�� u6I9�sA�x�    t�6@�x�    uH��I9�r��@�x� u	H��H9�r�H)�H�����H9�r���ff.�@UH�I�H��ATS�fD�A����'<�v#H�~H9�r<����^�{�@��?����A�L9����9@��y:@���v.L�QM9�r%@������YD�S�A��?�yf����A�)���L�L�H9��U���L9���E1ɸ �f.�H�~H9��c���<��[���D�VE�J�A��?�H����^�{�@��?�7���A���w<��)�����E��@��A��%�D	�A�	�f.�L9������� �U����@1�[A\]ÐL�QM9��#���@�������D�aA�\$���?����D�YA�ÀA��?��@���w
A����������E��������	�D	�)�u�L������D[�� A\]��@��A�%�	��R������E�ҁ�D	�A����DUH�I�H��AUATS�@�����<�v)H�~H9�r <���^�{�@��?��L9����9�@����A�A�@���v	H�YI9�sM���A�)���L�L�H9��p���L9���9@�����H�AI9�ryE1�E1۸ @������Y�À��?�����E��tIA�뒐L9�s�9A�A�@���Y����ؐ1�E����[A\A]]Ð[1�A\A]]���������f�H�~H9���<����D�^E�S�A��?�����^�{�@��?����<�w
A��������L9�s���E��@��A�A��%�D	�A�	��9@��������%���fDH�YI9�����@��������D�iE�e�A��?����Y�À��?����A���w
@�������E�����A�����D	�	�E�������A��B����)�����f�L9��������@��%�	��9@��y�A�A�������ہ�	�E�������A�����ff.�H�I�M���<UH��AUATS��A����/<�v+H�~H9�r"<����^�{�@��?��f��A�I9����9@��y:@���v.L�YM9�r%@������YD�[�A��?��f����A�)���L�L�I����H9��C���I9���E1Ҹ �H�~H9��c���<��[���D�^E�S�A��?�H����^�{�@��?�7���A���w<��)�����E��@��A��%�D	�A�	�f.�I9������� uL�I���Y���D1�[A\A]]��L�YM9�����@����	���D�iE�e�A��?������Y�À��?���A���w
@���������E�����A�����D	�	�)�u�L���������@��A�%�	�I9��O���[�� A\A]]Ð��E�ہ�D	�A��q���1��f�H�I�M���<UH��AUATS��A����/<�v+H�~H9�r"<����^�{�@��?��f��A�I9����9@��y:@���v.L�YM9�r%@������YD�[�A��?��f����A�)���L�L�I����H9��C���I9���E1Ҹ �H�~H9��c���<��[���D�^E�S�A��?�H����^�{�@��?�7���A���w<��)�����E��@��A��%�D	�A�	�f.�I9������� uL�I���Y���D1�[A\A]]��L�YM9�����@����	���D�iE�e�A��?������Y�À��?���A���w
@���������E�����A�����D	�	�)�u�L���������@��A�%�	�I9��O���[�� A\A]]Ð��E�ہ�D	�A��q���1��f�UH�I�H��ATS�fD�����<�v)H�~H9�r <����^�{�@��?��I9����9�A�A�@���:@���v	L�IM9�sI���A�)�uuL�L�H9��t���I9�v_�9@����BH�AI9��5E1Ҹ E1�@������YD�K�A��?�~���E����A���1�[A\]ÐI9���L�
�T�9H�@A�A�A�D�@���5���H�<A�|�A��<���H��@��%�H	�H�=!\TI��I��J�<�H���5I9�vQ��H�@�D��9A�A�@������DL�
TH�<I�<�A������I9���[�A\]�DE��������������fDH�~H9��;���<��3���D�VE�J�A��?� ����^�{�@��?����<�w
A�������H��E��@��I��%�L	�H	�H�=[TI��I��J�<�H���K���I9��K�����H�@�D��9A�A�@���������f.�L�IM9�����@�������D�aE�L$�A��?������Y�À��?���@���w
A�������E����H��I�����I	�L	�L�
cZTH��H��M��M����@��H�<A�|�E�������A��/���fDH��E�Ɂ�L	�L�
ZTH��H��M��M���T���@��H�<A�|�E���N���A�����I9���������f.�E��u�����fDUH�I�H��ATS�fD�����<�v)H�~H9�r <����^�{�@��?�7��A�L9���9@��yh@���v.L�QM9�r%@������YD�S�A��?�)f����A�)�urL�L�H9��Y���L9�s\�9E1ɸ @��x�L��SH�<I�<�A���f�L���SH�@A�I���@L9��S����� t��
�1�[A\]�f�L�Q@����b���M9��Y���D�aA�\$���?�F���D�YA�ÀA��?�3���A���w
@����#���H����E��H�="PTH��H�����H	�L	�I��I��N�߉�M��t��H�IA�|�)��Z���L�����H�~H9��s���<��k���D�VE�J�A��?�X����^�{�@��?�G���A���w<��9���H��E��@��I��%�L	�H	�H�=wOTI��I��J�<�A�H���������A�H�@�D�����[�� A\]��H��@��%�H	�H�=OTI��I��J�<�H��tY��A�H�@�D��K���H��E�ҁ�L	�L��NTI��I��O��M��t#@��H�<A�|�A����A��P���A����f.�UH�I�H��AUATS�@�����<�v)H�~H9�r <����^�{�@��?�7�L9���9�A��@���c@���v	L�QM9�sP���A�)���L�L�H9��q���L9����9@����CH�AI9��6E1۸ 1�@����2D�QA�€A��?�w������A��f�L9�sKL���S�9H�@A��A�D�@���9���H�<A�|�A��@���L9����1�E����[A\A]]Ð[1�A\A]]��H��@��%�H	�H�=�LTI��I��J�<�H���	L9�s���H�@�D��9A��@�������fDL���SH�<I�<�A���������������^���fDL�QM9�����@�������D�iE�U�A��?�����D�aA�ĀA��?�����@���w
A��������E��E��H��I�����M	�L	�L�LTI��I��O��M���.@��H�<A�|����W���A�����@H�~H9������<������D�^E�S�A��?�p����^�{�@��?�_���<�w
A����Q���H��E��@��I��%�L	�H	�H�=oKTI��I��J�<�H������L9��"�����H�@�D��9A��@�������s���H��E�ҁ�L	�L�KTI��I��O��M���a���@��H�<A�|����W���A�����L9����������������1����H9��D����:I9��1UL�OI�A�H��ATSD�E��xP@A�A�I9�r�*L��[H)�A\]�E�H��I�A�D�S�D�H9�v�I��E��t�I9�v�D�I�A�E��y�A���v�A���wPL�YM9�r��I�����?w�I����A��I	�L��L��H��A�A�L9��u���I�AE��f.�A����^���L�YM9��Q���D�aA�\$���?�>����I�����?�.���A���w
A�������I������A���H��I	�I	�L���l���1��UH��AWAVI��AUL�,H�U�ATI��L��SL��H���M�L��M��}���I�I9�v|D�}�U�A�������E@��M���H��I)�L9�LF�1�L��L�U����L�U��U1�L��L�H�����E��t-I9�v(L��H��1�H)�L���m�����U1�H������H��H��L)�[A\A]A^A_]�fD�U1�H��L�����E��t��f�H�I�M���UH��AUATS������<�v)H�~H9�r <���^�{�@��?�/��A�I9����9@��yj@���v&L�YM9�r@����S�YD�[�A��?�!����A�)��~L�L�I��tpH9��W���I9�vb�9E1Ҹ @��x�L���SH�<I�<�A����H���SH�@A�H���@I9��K����� uL�I��u��1�[A\A]]��H�~H9�����<�����D�^E�S�A��?���^�{�@��?����A���w<�����H��E��@��I��%�L	�H	�H�=�FTI��I��J�<�A�H���U�����A�H�@�D��?����L�YM9������@��������D�iE�e�A��?������Y�À��?�����A���w
@����v���H��E����H�=5FTH��I�����L	�H	�H��H��H�߉�H��t��H�I�|�)������L���;���@H��@��%�H	�H�=�ETI��I��J�<�H��tn��A�H�@�D��[���H��E�ہ�L	�L��ETH��H��M��M��t"@��H�<A�|�A����[�� A\A]]�A����A��C���1��ff.�f�UH�I�H��ATS�fD�����<�v)H�~H9�r <����^�{�@��?�7��A�L9���9@��yh@���v.L�QM9�r%@������YD�S�A��?�)f����A�)�urL�L�H9��Y���L9�s\�9E1ɸ @��x�L���SH�<I�<�A���f�L���SH�@A�I���@L9��S����� t��
�1�[A\]�f�L�Q@����b���M9��Y���D�aA�\$���?�F���D�YA�ÀA��?�3���A���w
@����#���H����E��H�=�KTH��H�����H	�L	�I��I��N�߉�M��t��H�IA�|�)��Z���L�����H�~H9��s���<��k���D�VE�J�A��?�X����^�{�@��?�G���A���w<��9���H��E��@��I��%�L	�H	�H�=KTI��I��J�<�A�H���������A�H�@�D�����[�� A\]��H��@��%�H	�H�=�JTI��I��J�<�H��tY��A�H�@�D��K���H��E�ҁ�L	�L�hJTI��I��O��M��t#@��H�<A�|�A����A��P���A����f.�UH�I�H��AUATS�@�����<�v)H�~H9�r <����^�{�@��?�7�L9���9�A��@���c@���v	L�QM9�sP���A�)���L�L�H9��q���L9����9@����CH�AI9��6E1۸ 1�@����2D�QA�€A��?�w������A��f�L9�sKL�D�S�9H�@A��A�D�@���9���H�<A�|�A��@���L9����1�E����[A\A]]Ð[1�A\A]]��H��@��%�H	�H�=�HTI��I��J�<�H���	L9�s���H�@�D��9A��@�������fDL���SH�<I�<�A���������������^���fDL�QM9�����@�������D�iE�U�A��?�����D�aA�ĀA��?�����@���w
A��������E��E��H��I�����M	�L	�L��GTI��I��O��M���.@��H�<A�|����W���A�����@H�~H9������<������D�^E�S�A��?�p����^�{�@��?�_���<�w
A����Q���H��E��@��I��%�L	�H	�H�=�FTI��I��J�<�H������L9��"�����H�@�D��9A��@�������s���H��E�ҁ�L	�L��FTI��I��O��M���a���@��H�<A�|����W���A�����L9����������������1����H�I�M���UH��AUATS������<�v)H�~H9�r <���^�{�@��?�/��A�I9����9@��yj@���v&L�YM9�r@����S�YD�[�A��?�!����A�)��~L�L�I��tpH9��W���I9�vb�9E1Ҹ @��x�L���SH�<I�<�A����H���SH�@A�H���@I9��K����� uL�I��u��1�[A\A]]��H�~H9�����<�����D�^E�S�A��?���^�{�@��?����A���w<�����H��E��@��I��%�L	�H	�H�=�DTI��I��J�<�A�H���U�����A�H�@�D��?����L�YM9������@��������D�iE�e�A��?������Y�À��?�����A���w
@����v���H��E����H�=DTH��I�����L	�H	�H��H��H�߉�H��t��H�I�|�)������L���;���@H��@��%�H	�H�=�CTI��I��J�<�H��tn��A�H�@�D��[���H��E�ہ�L	�L�xCTH��H��M��M��t"@��H�<A�|�A����[�� A\A]]�A����A��C���1��ff.�f�H�I�M���UH��AUATS������<�v)H�~H9�r <���^�{�@��?�/��A�I9����9@��yj@���v&L�YM9�r@����S�YD�[�A��?�!����A�)��~L�L�I��tpH9��W���I9�vb�9E1Ҹ @��x�L�{�SH�<I�<�A����H�Y�SH�@A�H���@I9��K����� uL�I��u��1�[A\A]]��H�~H9�����<�����D�^E�S�A��?���^�{�@��?����A���w<�����H��E��@��I��%�L	�H	�H�=wATI��I��J�<�A�H���U�����A�H�@�D��?����L�YM9������@��������D�iE�e�A��?������Y�À��?�����A���w
@����v���H��E����H�=�@TH��I�����L	�H	�H��H��H�߉�H��t��H�I�|�)������L���;���@H��@��%�H	�H�=�@TI��I��J�<�H��tn��A�H�@�D��[���H��E�ہ�L	�L�H@TH��H��M��M��t"@��H�<A�|�A����[�� A\A]]�A����A��C���1��ff.�f�H9���D�E���xI9��oUL�WI�B�H��ATSD�	E��xnf.�K�IL�
��SI���X��A�B�I9�r�*L��[H)�A\]�@A�H��I�B�D�K�D�
H9�v�I��I9�v�E��t�D�	I�B�E��y�A���v�A���wpL�YM9�r��I�����?w�I����A��I	�L��L��L�
?TH��M��M��tE��K�IE�L�L��H��A�B�L9��M���I�BE�
�^���A����:���L�YM9��-���D�aA�\$���?�����I�����?�
���A���w
A��������I������A���H��I	�I	�L���L���1��UH��AWAVI��AUL�,H�U�ATI��L��SL��H���M�L��M��=���I�I9�v|D�}�U�A�������E@��M���H��I)�L9�LF�1�L��L�U���L�U��U1�L��L�H���
���E��t-I9�v(L��H��1�H)�L���]���U1�H���ۼ��H��H��L)�[A\A]A^A_]�fD�U1�H��L��谼��E��t��f�H�I�L�_xH9���UH��H��ATS�>�@����@���v%@�����L�NL9�r�^D�K�A��?�[H)�A\]�@@���w�L�NL9�r��^D�S�A��?w�D�NA���A��?w�D�fA�ĀA��?w�@��������v@���t�H��E��E��E�Ɂ�I���L	�I��L	�L	�@I9;r!I��M�KI��O��M��t
@��H�<A�|�I9��E���H��w+L�HM9��2���H�@�8L��H9����[H)�A\]�@H���vH�����H������L�HM9����A��H��A��?H��A�ʀD�PA��H��A��?H��A�ʀD�PA��H��A��?@��A�ʀD�P�b����L�HM9�s�[H)�A\]��@����v���L�NL9��]���D�VE�J�A��?�J����^�À��?�:���@���u
A����*���H��E��D�ӻ���I��L	�L	�����L�HM9��%���[H)�A\]�H��E�ɻ��L	��U���������������1��ff.��H�I�L�_xH9���UH��H��ATS�>�@����@���v%@�����L�NL9�r�^D�K�A��?�[H)�A\]�@@���w�L�NL9�r��^D�S�A��?w�D�NA���A��?w�D�fA�ĀA��?w�@��������v@���t�H��E��E��E�Ɂ�I���L	�I��L	�L	�@I9;r I��M�KI��O��M��t@��H�<A�<�I9��F���H��w,L�HM9��3���H�@�8L��H9����[H)�A\]�DH���vH�����H������L�HM9����A��H��A��?H��A�ʀD�PA��H��A��?H��A�ʀD�PA��H��A��?@��A�ʀD�P�a����L�HM9�s�[H)�A\]��@����v���L�NL9��]���D�VE�J�A��?�J����^�À��?�:���@���u
A����*���H��E��D�ӻ���I��L	�L	�����L�HM9��%���[H)�A\]�H��E�ɻ��L	��U���������������1��ff.��UH�I�H��AUATS�@�����<�v)H�~H9�r <����^�{�@��?�7�I9����9�@���A�A�@���v	L�YM9�sI���A�)�umL�L�H9��t���I9�vW�9@�����H�AI9��}E1ɸ E1�@���w|�YD�[�A��?�����E��tOA���1�[A\A]]��I9�v�9A�A�@���I����[�A\A]]�@������f�L�YM9�r�@�����L�YM9��v���@����l���D�aA�\$���?�Y���D�YA�ÀA��?�F���D�iA�ŀA��?�3���@���w
A����#���@���u
A���������E����E�����A��D	�	�D	�E���A���A����fDH�~H9��3���<���H�~H9�����<�����D�NE�Y�A��?�����^�{�@��?���^D�S�A��?���<���<���A���v������I9��������E��E��A�%A��A	�@���9��D	�A�D	�@�����������D�NE�Y�A��?�e����^�{�@��?�T���A�����<���L�VL9��5����>���D�aA�\$���?�����D�YA�ÀA��?�����A�����@�����L�iM9������4���@)����f�I9��������@��%�	��9@��y�A�A�������E�ہ�D	�E���w���A����@I9��O�����@��E��A�%�A��A�	��9D	�@���d�������f���E���ہ����D	�	�E�������A��E���@A����)������L�H�M�UH��AVAUATL�gxSL9�s1f����y9���v#����L�NM9�r�v�ƀ@��?�[A\H�A]A^M�]�f�H��I9$��H��M�L$D��H��M����M��t&K�vI���G
��$�RD����f.�I��A��?O�LI��M��I��M�L1�I��A��?O�L
I��I��I��L�H1�I�ZH����vQI��H��I��	A��?��I�I��I��I��L�H1�I9�������$���D��A������k���I�������w{H�^I9����D�nE�M�A��?�����v�ƀ@��?����A���w	��������H��E��@�����I��L	�H	�H�������RD������������v���L�vM9��i���D�nA�]���?�W���D�NA���A��?�D����v�ƀ@��?�3������tX���u
A�������H����@��E��H����I��H	�H	�L��L	�����f�H��@����H	�L�����A��������ff.�H�H��vpI��I��L9�sd�P�L9�v��� uUH���P�I9�u�L�VI��M9�v;�� u6I9�sA�x�    t�6@�x�    uH��I9�r��@�x� u	H��H9�r�H)�H�����H9�r���ff.�@UH�I�H��AUATS�@�A����_<�v#H�~H9�r<����^�{�@��?����A�L9����9@��y:@���v.L�QM9�r%@����+�YD�S�A��?��f����A�)���L�L�H9��U���L9���E1ɸ �f.�H�~H9��c���<��{H�~H9��N���<��F����~D�_�A��?�4����^D�S�A��?�"����^D�K�A��?����<���<��O@���v���������E��A��%��D	�A�	�A����	�fDL9������� �����@1�[A\A]]��L�QM9����@�����L�QM9�����@��������YD�[�A��?�����D�QA�€A��?�����D�iE�e�A��?�����@���A��@��������v	E���j�����E��E��E��A����A��D	�D	�D	�A��E���f��~D�_�A��?�����^D�S�A��?�����@�����<���L�NL9�������v����YD�[�A��?����D�QA�€A��?���������@�����L�aM9����������fD[�� A\A]]�fD��@��A�%�	��*������E�ҁ�D	�A��Y�����E��A��A�%���D	�	�������E��E�ہ��A��D	�A�D	�����@���������������y�������UH�I�H��ATS�fD�����<�v)H�~H9�r <����^�{�@��?��I9����9�A�A�@���:@���v	L�YM9�sA���A�)�umL�L�H9��t���I9�vW�9@���v;H�AI9�r2E1ɸ E1�@������YD�[�A��?�����E��u�[�����A\]�f�1�[A\]�f�I9���L���S�9H�@A�A�A�D�@���5���H�<A�A�|��<���H��@��%�H	�H�A+TI��I��J��H��tQI9�vU@��H�<�D��9A�A�@�������L�9�SH�<I�<�A������I9��W[�A\]�DH�~H9��[���<���H�~H9��F���<��>���D�NA�y�@��?�+����^�{�@��?�����^�{�@��?�	���<�@��<���A���v	@�����I9��l����9@���
A����A�����L�YM9��E���@�����L�YM9��.���@����$���D�aE�\$�A��?�����YD�[�A��?������YD�[�A��?���A���w
@�������@���u
A�������E������A�����b����D�aA�\$���?�����D�YA�ÀA��?�����A�����@�����L�YM9��k����h���@D�NE�Q�A��?������^�{�@��?�����A�����<���H�~H9�������n����H��E�ہ�L	�L��(TH��H��M��M��t(@��H�<A�|�E������A��x����E��u�����fD���Y���f�H��E���ہ��H��L	�L�Q(TH	�H��H��M��M���@��H�<A�|�E���a���A����f�H��@��E��%�I��H	�H��'TI	�L��H��H��H����I9������E��K�<R�D��9A�A�@���s�������A����6���@���-���I9�������9@���A���@��Hk�H�6LA�A��x����1���I9��p���D���z����E�������g���H�H���UH�I�H��AVAUATSH9���fD����<�vQH�~H9�rH<���^�{�@��?�WH�~H9�r&H�~H9�r<�wD�^E�S�A��?��fDL9����9�@����A�A�@���v	H�YI9�sQ���A�)���L�L�H9��H���L9����9@�����H�AI9��}E1�E1۸ @���wt�Y�À��?�d���E��tQA�뒐L9�s�9A�A�@���Y����ؐ1�E����[A\A]A^]��[1�A\A]A^]�D������ِH�YI9�r�@����}H�YI9��|���@����r���D�qE�f�A��?�_����Y�À��?�O���D�iA�ŀA��?�<���@���w
A����,���@���u
A���������E��E����A������D	�D	�	�E���L���A����f�H�~H9��3���<�����D�^E�S�A��?���^�{�@��?����A�����<��zH�^H9�����^�À��?����<�A��<���A���v	E�������L9����������@��A�%��	�	�A��A���	��9@�����������fDD�qE�f�A��?������Y�À��?���A�����@�����L�iM9������t����)����^�{�@��?� ����������ہ�	�E�����A�����fDL9��������@��%�	��9@��y�A�A���������E����A��	�D	�E���~���A����L9��B�����@��E��A�%�A��	��9D	�A�@���g������A����n����-���ff.�f�H9��7�:1�@����D��L�
�)C�<��@��@uoH�BH9���B��tZD�@��zA��OwZD��E�Q�A��OwLG��A��G�D�A��i.Mc�L��)G�BfE��tL����1��D��@t{L�BL9���H�
<)D�1�E��x��<9��x�D�JE��t��RB�	���x���x�A����A���D��H�H���@L����A��@u�H���D�����ø����ø�����ff.�H�I�M����UH��AVAUATS���A����o<�v+H�~H9�r"<����^�{�@��?��f��A�I9����9@��y:@���v.L�YM9�r%@����;�YD�[�A��?��f����A�)���L�L�I����H9��C���I9���E1Ҹ �H�~H9��c���<���H�~H9��N���<��F���D�VA�Z���?�4����~�ǀ@��?�#���D�vE�^�A��?����<�A��<��\A���v	E������E��D��@��A��%��D	�D	�A�	�f.�I9������� uL�I������D1�[A\A]A^]�DL�YM9�����@�����L�YM9������@��������D�aA�\$���?�����D�qE�^�A��?�����D�qE�n�A��?�y���@���A��@�����A���v	E���X�����E����E�����A��D	�	�D	�A��6���f.�D�aA�\$���?�
���D�qE�^�A��?�����A�����@�����L�iM9������H���D�VA�Z���?�r����~�ǀ@��?�a���A�����<���L�^L9��B�������D��@��A�%�	�I9��/���[�� A\A]A^]����E�ہ�D	�A��I�����E���ہ����D	�A�	��&�����@����A�%���	�	����1��A�����������A����|��������H�I�M����UH��AVAUATS���A����o<�v+H�~H9�r"<����^�{�@��?��f��A�I9����9@��y:@���v.L�YM9�r%@����;�YD�[�A��?��f����A�)���L�L�I����H9��C���I9���E1Ҹ �H�~H9��c���<���H�~H9��N���<��F���D�VA�Z���?�4����~�ǀ@��?�#���D�vE�^�A��?����<�A��<��\A���v	E������E��D��@��A��%��D	�D	�A�	�f.�I9������� uL�I������D1�[A\A]A^]�DL�YM9�����@�����L�YM9������@��������D�aA�\$���?�����D�qE�^�A��?�����D�qE�n�A��?�y���@���A��@�����A���v	E���X�����E����E�����A��D	�	�D	�A��6���f.�D�aA�\$���?�
���D�qE�^�A��?�����A�����@�����L�iM9������H���D�VA�Z���?�r����~�ǀ@��?�a���A�����<���L�^L9��B�������D��@��A�%�	�I9��/���[�� A\A]A^]����E�ہ�D	�A��I�����E���ہ����D	�A�	��&�����@����A�%���	�	����1��A�����������A����|��������I��H�wx�@�L�
�SH�@I��I���@��xfH�=��SH�IH��H���IH9���I�H�
����������y�<�v<���A�x�ǀ@��?�EH��L���R��f����v�����z�ǀ@��?w�H��@����H	��H�I��H�~I��J�<�H���d�����H�I�L�H9��Y���)��D<������E�PA�z�@��?�p���E�XE�K�A��?�]���A���w<��O���@��H��E��H��%�L	�H	�����������D�RA�z�@��?����D�ZE�K�A��?�����u
A������@��E��H��H�����L	�H	�����@H��@��%�H	��I�I��H�~I��J�<�H���.�����H�@�D������1���)�������ff.�UH�I�H��S������<�v)H�~H9�r <����^�{�@��?����A�L9��|�9@��y`@���v&L�QM9�r@������YD�S�A��?������A�)�urL�L�H9��a���L9�s\�9E1ɸ @��x�L��SH�<I�<�A���f�L�ɽSH�@A�I���@L9��[����� t��
�1�[]�L�QM9��k���@����YL�QM9��T���@����J���D�YE�S�A��?�7����YD�S�A��?�%����YD�S�A��?����@���A��@�����A���v	E����A�������f�H�~H9������<�vH�~H9��z���<��r���D�NA�y�@��?�_����^�{�@��?�N����^�{�@��?�=���<�@��<���A���v	@��� ���A���������D�NE�Q�A��?������^�{�@��?���A����
<��H�~H9������r���D�YA�[���?�����D�QA�€A��?���@����
A����L�QM9��������D�� []�f�H��@��%�H	�H�yTI��I��J��H��tY@��A�H�<�D�����f�H��E�ҁ�L	�L�8TI��I��O��M��t%@��H�<A�|�A��<�����A����A��$���H��@��E��%�I��H	�H��TI	�L��H��H��H��tE��A�K�<R�D��7���H��E���ہ��H��L	�L��TH	�I��I��O��M��tD@��H�<A�|�A����A����
����.���A����q����g���D��A����A��Z���ff.�UH�I�H��AUATSH9��������<�vQH�~H9�rH<��p�^�{�@��?�OH�~H9�r&H�~H9�r<�w�~D�W�A��?�8�L9����9�A�A�@���J@���v	H�YI9�sI���A�)���L�L�H9��H���L9����9@���v9H�AI9�r0E1Ҹ E1�@�����Y�À��?�����E��u�[�����A\A]]ÐL9�sKH�$�S�9H�@A�A��D�@���J���H�<A��|��R���L9����1�E����[A\A]]Ð[1�A\A]]��H��@��%�H	�H�iTI��I��J��H��t�L9�s�@��H�<�D��9A�A�@�������L�i�SH�<I�<�A�����H�YI9������@����AH�YI9����@�������D�iA�]���?�����Y�À��?������Y�À��?�����A���w
@��������@���u
A��������E�������A���������H�~H9�����<�������~D�_�A��?������^D�S�A��?�����@�����<���L�VL9��x����^D�S�A��?�f���<�A��<���@���v	E���I���L9��@����9@���
A����A��D���fDD�iE�e�A��?������Y�À��?�����A�����@�����H�YI9��l�������^D�S�A��?�E�������H���ہ�H	�H�9TI��I��J��H��t @��H�<�|�E������A����E��u�����������H����E����I��H	�H��TL	�I��I��J��H����@��H�<�|�E�������A��<���H��E��E��%�I��I	�H�|TM	�L��H��H��H����L9������E��K�<[�D��9A�A�@�����������@��������E�������L9��w����9@���7���@��Hk�HLA�A��x������L9��:���D���E���&�������H�H���ff.�f�H�I�M���8UH��ATS�D�����<�v)H�~H9�r <���^�{�@��?����A�I9��$�9@��yj@���v&L�YM9�r@����C�YD�[�A��?������A�)��~L�L�I��tpH9��W���I9�vb�9E1Ҹ @��x�L��SH�<I�<�A����H��SH�@A�H���@I9��K����� uL�I��u��1�[A\]�f�H�~H9�����<��gH�~H9������<����D�VA�z�@��?�����^�{�@��?�����^�{�@��?�����<�@��<���A���v	@�������A�������@L�YM9�����@�����L�YM9������@��������D�aE�\$�A��?������YD�[�A��?�|����YD�[�A��?�j���@���A��@����A���v	E���I���A�����E���f�D�aA�\$���?����D�YA�ÀA��?�
���A����@����L�YM9�����h���D�VE�Z�A��?������^�{�@��?�x���A����<��H�~H9��Y������@H��@��%�H	�H��
TI��I��J��H��tt@��A�H�<�D�����f.�H��E�ہ�L	�L�H
TH��H��M��M��t @��H�<A�|�A�����[�� A\]�A��	�����A����H��E���ہ��H��L	�L��	TH	�H��H��M��M����@��H�<A�|�A����H��@��E��%�I��H	�H��	TI	�L��H��H��H��tCE��A�K�<[�D�����1��A����_������A�������8���A��9���D��A����ff.�@H�I�M���8UH��ATS�D�����<�v)H�~H9�r <���^�{�@��?����A�I9��$�9@��yj@���v&L�YM9�r@����C�YD�[�A��?������A�)��~L�L�I��tpH9��W���I9�vb�9E1Ҹ @��x�L�{�SH�<I�<�A����H�Y�SH�@A�H���@I9��K����� uL�I��u��1�[A\]�f�H�~H9�����<��gH�~H9������<����D�VA�z�@��?�����^�{�@��?�����^�{�@��?�����<�@��<���A���v	@�������A�������@L�YM9�����@�����L�YM9������@��������D�aE�\$�A��?������YD�[�A��?�|����YD�[�A��?�j���@���A��@����A���v	E���I���A�����E���f�D�aA�\$���?����D�YA�ÀA��?�
���A����@����L�YM9�����h���D�VE�Z�A��?������^�{�@��?�x���A����<��H�~H9��Y������@H��@��%�H	�H�TI��I��J��H��tt@��A�H�<�D�����f.�H��E�ہ�L	�L��TH��H��M��M��t @��H�<A�|�A�����[�� A\]�A��	�����A����H��E���ہ��H��L	�L�QTH	�H��H��M��M����@��H�<A�|�A����H��@��E��%�I��H	�H�TI	�L��H��H��H��tCE��A�K�<[�D�����1��A����_������A�������8���A��9���D��A����ff.�@H9��D�E���I9���UL�OI�A�H��AWAVAUATSD������E��xt�K�RL�}�SI��D�PD����A�A�I9�r�*L��[H)�A\A]A^A_]�f�E�H��I�AD�:E�W�D�H9�v�I��E��t�I9�v�D�I�A�E��y�A���v�A���wwL�aM9�r�D�YA�ÀA��?w�L��E��H����L	�H��L��TH��M��M��t��H�IA�L���A�A�L9��G���A�	I�AL���Y���fDA���wjL�aM9��%���D�qE�n�A��?����D�YA�ÀA��?�����A���u
A������L��E��E��H��I�����L	�L	��K���A��������L�aM9������D�yE�_�A��?�����D�qE�n�A��?�����D�qA�ƀA��?�x���A���t!A���vA����b���f��ع�����1��A����G���A��E��E��H��I��L	�L	�H����w����ff.�@UH��AWAVI��AUL�,H�U�ATI��L��SL��H���M�L��M��m���I�I9�v|D�}�U�A�������E@��M���H��I)�L9�LF�1�L��L�U��d���L�U��U1�L��L�H���݀��E��t-I9�v(L��H��1�H)�L���-�����U1�H��諀��H��H��L)�[A\A]A^A_]�fD�U1�H��L��耀��E��t��f�D�H�xH��H��1�E��t6�A�E���~<�v<�wD�YE�C�A��?�+H��H)��Ð<��pD�QE�J�A��?w�D�YE�C�A��?w�A���w<�t�H��E��E��I��%�L	�A�L	��H9rI��L�GI��O��M��t��H�@A��H��w&�A�L�L�D�E���+����S���fDH=���H=����H=���)���A��H��A��?H
A�ȀD�BA�A��H��A��?��A�ʀD�RA��H��A��?�A�ʀ�D�R�m���H��E��A�%�L	�H;���A��H��A��?�A�Ȁ�D�BA��(���fDA��x���D<��u���D�QE�J�A��?�b���D�YE�C�A��?�O���D�YA�ÀA��?�<���<�tfA���v<��*���H��E��E��E��I��%I��L	�A�L	�L	��\���@I��L�GI��O��A�M���S�������A�������뜐D�H�xH��H��1�E��t6�A�E���~<�v<�wD�YE�C�A��?�+H��H)��Ð<��pD�QE�J�A��?w�D�YE�C�A��?w�A���w<�t�H��E��E��I��%�L	�A�L	��H9r I��L�GI��O��M��t��H�@A�D�H��w%�A�L�L�D�E���*����R���DH=���H=����H=���)���A��H��A��?H
A�ȀD�BA�A��H��A��?��A�ʀD�RA��H��A��?�A�ʀ�D�R�n���H��E��A�%�L	�H;���A��H��A��?�A�Ȁ�D�BA��)���fDA��x���D<��u���D�QE�J�A��?�b���D�YE�C�A��?�O���D�YA�ÀA��?�<���<�tfA���v<��*���H��E��E��E��I��%I��L	�A�L	�L	��\���@I��L�GI��O��A�M���S�������A�������뜐UH��AWI��AVAUI��ATM��SH��H��HH���H�U�D�M�L�p(H��KUH�H��t
�}(�Ѕ��LH�E�H�E�H�E�H�E�L9���L��H��H�u�L��A�օ��L�E�HcUL9���H�H�HcE�L9�u	I9��8H�M�L��H�u�L��A�օ���H�HcUI�H�E�H9���H�} H�U���H�u A�}H�H9���I��H�vI��J�4�H��t��H�RH�������RH�U�H9���H�M H��H��H�IH��H��t�����H�@H�����@H�E�H9�u(I9����1�L9}���H�e�[A\A]A^A_]���H�e�[A\A]A^A_]�@H�E������H9��o���H�U����H�E��H9�t��f�L��H��H�u�L��A�օ�~�H�H�M�L��H�u�H�L��A�օ�~�H�I�H�E����@�@�?�����R���1�L;}���H�e�[A\A]A^A_]��H�E�H�E�L9�taL�E�L��H��H�u�L��A��Lc�E������H�E�H9E�t>HcUD�E�H9�u6H�M�L��H�u�L��A�օ�����LcE�H�I�L�I9�u�1�����L���L9}��L��H��H�u�L��A�օ������H�H�HcE�H9E�u	I9��FH�E�H�]�H�]�H�E��E(L�e�L�e ���E�H��L��H�u�L��A�օ��K���H�U�H�M�M��t|I�4$A�}H9���I��M�D$I��O��M��t��H�RI��������RH�U�H9���I��I�t$I��J�4�H��t�Ɂ��H�IH��t~�IH�M�H�I�H9�tL9��L������������E�D�M�H��L��L�E�H�M�L��P�EATP�EP���H�� ����u���H�E�������d���H�E��H�U����뉋I뀋R�@���L��H��H�u�L��A�օ��&���H�H����@UH��j�E�u P�EP�j������UH��H���wx�EP�EP������fDUH��H���wx�EP�EP�����fDH9�s;H��t6H��H�A�H9�wH)��H�A�A H��t�H9�v�H�����1��ff.�f�H9�sH�G�H9�r	H)��H���H�F�H��H)�H��H�LGH���B� H9�vH�B�H9�u�H)��H����f�UH��AWAVAUL�,H�U�ATI��L��SL��H���M�L��M�D�u茶��I�I9�vC�U�E��A����tA��@uT1�D��H��L���u��E��t$H��L���<���H���1�D��H���cu��H��H��L)�[A\A]A^A_]�fDH�����1�D��L��H�H���-u��E��t�I9�v�뚐UM�H��AWAVAUATI��SH�H���M�D�mH9��U���]M9��lH�VH�F@E�H�p�E��xKH�=ĐSK�4RH�4��~H�Ɖ��h�H9�wlL)�I��1�D��L���t��H��L��[A\A]A^A_]��A���v%A�����M�XM9�rA�x�ǀ@��?��I��H9�w@M)���@�8I��I�փm�H9����M̅��H��H��M9��5���E��A��A��@�	1�D��L��L����s��E���(M)��?����A����q���I�xI9��d���E�pE�^�A��?�Q���E�@A���A��?�>���A���u
A����.���I��E��E��A���I��M	�M	�I����I��@��M��A��I	�L��H�5�SH��H�4�H��tE��K�<RD�T�L��H��H��@�x�H9��d���I��D�����DE��A�������U�L��H���R���1�D��L��I�L����r��E�����L9�����DL��H���m���I�����DE1����E��I��A�����fDI���c���I��H��M)����f�UH��AWAVAUL�,H�U�ATI��L��SL��H���M�L��M�D�u�,���I�I9�vC�U�E��A����tA��@uT1�D��H��L���q��E��t$H��L�����H���1�D��H����q��H��H��L)�[A\A]A^A_]�fDH��� ���1�D��L��H�H���q��E��t�I9�v�뚐UM�H��AWAVAUL�,ATI��SH��L9�������M9��A�0@���H��L��L�=@�(I�H�=5�(H�EȐ@��A�<�y@��@��M�XM9���A�@�����p�A�P��OwPD��E�r�A��OwB�4���A�t2Ё�iHc�L�5�(A�4vf�����@uA��@���I�pI9��s����g����[A�p@���MD�7A�p�47E���6���.����I���A��B��Hc�������������H�s�H;]���H���C���I9�������M9�v
A�0@�������D�uA���E@���U1�H��L���o��E����L)�I���P@I��H��H��H�5V�SH�4�H��t��H�@�D���H�s�H;]��`���I��M)�U1�L���\o��H��L��[A\A]A^A_]�f.�L���V����D�uA���S���I9��5���I��H��M)��@M��1�1��_���@��H��L���[����U1�L��H�H����n��E������I9�����fDL��H���u���L�,M)��M���f���M����DE1������D�uH��A�����ff.�f�UH��AWAVAUL�,H�U�ATI��L��SL��H���M�L��M�D�u�\�I�I9�vC�U�E��A����tA��@uT1�D��H��L���m��E��t$H��L�����H���1�D��H����m��H��H��L)�[A\A]A^A_]�fDH��� ���1�D��L��H�H���m��E��t�I9�v�뚐UH��AWAVAUATSH��8H�u�L�M�H9����I�υ���H�E�I��I��M��H�E�H��DH�M�L��H�u�L��I����P(��~lH�U�H�I�H�CH��H���L9�r!A�/H+E�H��8[A\A]A^A_]�f.�H��H�CH���KI9�v�H���S�A���A�I9�v���x���H��H+E�H��8[A\A]A^A_]�1��fDUM�H��AVI��AUATL�$SL��H���M�D�mH�M����I�A��@t.I9����U܅�tH�CfDH�����I9�wJ�U�H��1�D��H��L���,l��A��tL9�sH�C�I9�wEH��H��H��L)�[A\A]A^]�@H�K�CI9�v�H���C� I9�v#H����u��E��H�S�CI9�w&H��묉U�1�D��H��L���k��A��t�H�����@ H���j���ff.�f�UM�H��AWAVI��AUL�,ATL��I��SH���M�H�M�����I�I9��~D�}�U�A�������E@��M��H��I)RL9�LF�1�L��L�U��u���L�U��U1�L��L�H����j��E��t1I9�v,@L��H��1�H)�L���=�����U1�H��L���j��H��H��L)�[A\A]A^A_]��U1�H��L���j��E��t��f�H����vWH9�sr���H�z�����H9�����H����?H���Ȁ�B���H����?@���ɀ@�2�J�f�H9�sH��w%H�z�H9�r@�2�������f.�H����v���H�z�����H9�r
��fD���f.�DUH��AWAVAUATSE��tL9�IGЉU�Lc�Mc�I��D�E�I��E1��E��D1�E��u3D�u�D��E��~'�I��H��)A�������I��L��H)�L9��D�mԉ�E��u5D�E�E��~,�I��H�f)�E������I����)Ѕ�������L��H)�L9��X���A�E���d���H�)�����j���M�޿cE1�I)�H�O�KH�w1M9��L��A:;t�f�I��I)�M9��@:8��H���:H��@��u�E���Mc�H���KI��B�\+I��L��H)�L9���f��}�A�$����H�Y)���������L��cE1�H)�L�-��KH��0H�E�L;U���L��A8<$t��I��I)�M9���@:8��H���:H��@��u؋Uԅ���Mc�H�3�KI��B�T2	I���v����H�CA��H���8H��@�������L��E�������f�Mc�H��KI��B�\+	����[A\A]A^A_]�DI�EA��I���8H��@�������U�L����Z���Mc�H���KI��B�T2�U���ff.�UH��AWAVAUATSH�H�}�H�UL�] HUL�UH9�t|H9Utv�L�5�
)E1�L�%�
)�D�D8�t[D8�tVA�<>@�� A�:�>AE�I��H��I��A�<<A�{�H9�t)L9�t$�>@8�u�L�~I9�t��~L��봸DH�]�L��H�u(H+M�CHDMH�]H�H�M0H�L9���I�KI9�I�J@��I9���@���H�J�L)�H����H��fo
w1�fv�L)�H��H����A
AH��H9�u�H��H���I�I�H9��.I�JA� A��H9��I�JA�B A�C�H9��I�JA�B A�C�H9���I�JA�B A�C�H9���I�JA�B A�C�H9���I�JA�B A�C�H9���I�JA�B A�C�H9���I�JA�B A�C�H9�t|I�J	A�B A�C�H9�tiI�J
A�B	 A�C	�H9�tVI�JA�B
 A�C
�H9�tCI�JA�B A�C�H9�t0I�J
A�B A�C�H9�tI�JA�B
 A�C
�H9�t
A�B A�C�[A\A]A^A_]�fDL)�1�A�
 A��H��H9�u�[A\A]A^A_]�f�UH��AWAVAUATSH��(�]H�u��؃���D�H���D�M�I��Mc�M��1�E1�f�L��L)�L9�|uE���<�U�����A�M��H�
�)A�A�����t]I������D����H�u�H�P�H��I9�w�H��([A\A]A^A_]�@A�E��u�H�
�	)A�����u�L��L�ČK�cE1�L)�H�M�H�
�+L;M���L��A:2t$��H��L)�I9���@:2��H���1H��@��u�E����Mc�H�
U�KI��B�L)I������I9�����H��([A\A]A^A_]��������I9�����H�}�L��1�H)�H�請��H��(L��[A\A]A^A_]�f�I�SA��I���2H��@������L��E���Z���f�Mc�H�
��KI��B�L)	�L�������u����|���1��u����UH��AWAVAUATSH��tE�|� H�z���H��t1�|� H�B�t!�sf.��|� H�P��aH��H��u��E�1�M���gB�|� I�@��iH���NB�|� I�x�t�(D�|9� H�G��H��H��u��E�I��I���E�E1��DE1�E��u5D�m�E��E��~)�I��H�)A�D�A�����I��L��H)�H9��$D�e�D��E��u7�]ą�~0�I��H��)�E�D�A����I��D��D)؅���E����L��H)�H9��Q���A�E���^���H�})D�A����d���M��A�cE1�I)�L�%��KL�
�(L9��5L��E:t%�(�H��H)�H9��D:�I��E�H��E��u�E���Mc�H�T�KI��F�L+I��L��H)�H9�����D�]�A�E�����H��)D�A������L�лcE1�H)�L�-�KL�(H�E�H9}���L��A:t#��I��I)�I9���:��I��A�H����u�D�U�E����Mc�H���KI��F�\3	I���a����I�D$A��I��D�I��E�������L��E������Mc�H�6�KI��F�L+	�����[A\A]A^A_]�DI�EA��I���I�Ä�����L��D�U�E���R���fDMc�H�ևKI��F�\3�G���H��@�E�Hc����H��f��}�Hc����D1������U�Hc��~���D�E�Ic�����f�UH��AWAVI��AUE1�ATL�%n
)SH�
H��H�}ȉu�H9�s$f�M��DA�7L���\���H��tI��L9�w�H��1�[A\A]A^A_]�DL9�v�M�wL9�w�"�I��L9�tGA�6L������H��t�M9�t�D9m�r��1�L��茄��H�M�B�)I��L9��g����DI����ff.�UH��H��AWI��AVAUATL�%LJKSH��OH��L��@@H��L��H��H�M��^���H�Mȅ�A��uB�<;tLI��I�\$H��u�M���L��1�E1�H�54)�A���H��D��[A\A]A^A_]�f.�A�$��������	��=-u�I���I���H�S@I;��r8I���H��@�H��H���I�����I���H����I���H�1�1�1�H�5�)H���R���H���
���I���B���fD�������/���IDž�Aƅ�����I���1�IDž�IDž�H��A)�A������H������A�����DUH��AWI��AVI��AUATL�%�KSH��MH��H�}��L��H��L��袃��A�Ņ�uB�<;t$I��I�\$H��u�E1�H��D��[A\A]A^A_]ÐH�E�H��@A�$=�����=�����=��4�=�u�L���H���I�T$@H;��r9H���I��$@�H��H���H�����H���H���IL���I�1�H�5��1�L���@=�����=��,��H���H�G@H;��r<H���H��@�H���H���H�����H���H����H���H��1�1�I��H�5���1��	���L�����H�����D��	��=��y���H���H�G@H;��r<H���H��@�H���H���H�����H���H���#H���H��1�1�I��H�5���b���f�=���=������H���H�G@H;��r<H���H��@�H���H���H�����H���H����H���H��1�1�I��H�5�����H���H�G@H;��r<H���H��@�H���H���H�����H���H���7H���H��1�1�I��H�5���v���fDH���H�G@H;��r<H���H��@�H���H���H�����H���H����H���H��1�1�I��H�5������fDH���tH���H��H���H���H���{���H��H���[A\A]A^A_]��f.�H���H�G@H;��r<H���H��@�H���H���H�����H���H���H���H��1�1�I��H�5��F���fDH���H�G@H;��r<H���H��@�H���H���H�����H���H����H���H��1�1�I��H�5}�����fDH���H�G@H;��r8H���H��@�H���H���H�����H���H��t+H���H��1�1�I��H�5���j���f.�A�����DH���H�G@H;��r8H���H��@�H���H���H�����H���H��t�H���H��1�1�I��H�5����f.�H���H�G@H;��r<H���H��@�H���H���H�����H���H���7���H���H��1�1�I��H�5���v���fDH���H�G@H;��r<H���H��@�H���H���H�����H���H������H���H��1�1�I��H�5������fDUH��AWAVI��AUATL�%'GSH�RKH��8H�U�L��L�� H�u�M��M)�f�L��L��L����|����uC�<<t'H��L�cM��u��E��E�H�e�[A\A]A^A_]Ð�L�m��E�M��@��|w�H�5Y)��Hc�H��fDH�}�?w�H�]�I��$�L��H����~��AƄ���L�}�M�M9�s�������H�7~KL�u�H�H��H�E�H�E�H�E��L�L���I�H�M�M��E��H�����L��1�M���+}��L���{��H��M9�����A�E<\������H�=��SL��L��H�u�H����P(������Lc�H�E�H��@L���H���K�4&H�V@H;���Y���H���H��@�H��H���H�����H���H���!����E��j���DA��$�D������I��$���M��$�L���z��Ic�M��$�I��H��|KH��H�E�L�L�H�p@I;�$�rPI��$�H��L�E�H�M�L���H��@�I��$�A��H��I��$�H���M��$�L�E�H�M��E�AUI�H�����M��L��P1��{��L����y��I�$�XZAƄ$��t����I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�������I��$�I�$�D�E�M��H�
&)I��f�H������1���z��L���5y��I�$��������.H�s{KI��$�Hc�L�<�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H������I��$�I�$�M��D�E�L��I���D���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���a���I��$�I�$�M��D�E�H�
�)I������@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�����I��$�I�$�M��D�E�H�
S)I���D���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���a���I��$�I�$�M��D�E�H�
��(I������@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�����I��$�I�$�M��D�E�H�
(�(I���D���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���a���I��$�I�$�M��D�E�H�
��(I������@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�����I��$�I�$�M��D�E�H�
�(I���D���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���a���I��$�I�$�M��D�E�H�
w�(I������@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�����I��$�I�$�M��D�E�H�
�(I���D���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���a���I��$�I�$�M��D�E�H�
Q�(I������@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�����I��$�I�$�M��D�E�H�
��(I���D���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���a���I��$�I�$�M��D�E�H�
/�(I������@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H���`	I��$�D�E�M��H�
��(1�I�$�H������I���&t��L���~r��I�$�H�}�����A�E�P������0A��$����f.�I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H������I��$�I�$�M��D�E�H�
z�(I���t���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�������I��$�I�$�M��D�E�H�
5�(I����@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H������I��$�I�$�M��D�E�H�
��(I���t���@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�������I��$�I�$�M��D�E�H�
�(I����@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H������I��$�I�$�M��D�E�H�
k�(I���t���@H�M��?M��$BH��?HG�H�˃��]������tA�EA��$B���AƄBM��$��f��
1�L���w��A��$����@�
1�L����v��A��$���@M�t$@H�M�L��L�����M��$ ��f.�M��$AH�M�L��L����M��$8�d��H�]�I��$BL�5�(H�E�1�L�I9�s:L�e�I���M��DA�4$L���m��H���2I��L9�w�L�e�H�E�I��$H���@M��$AH�M�L��L����M��$(����M��$AH�M�L��L�����M��$0���H�E��H�5h�(L��H��HN�H9��������A��$� �K�DH�M��I�|$ H��HG�H�˃���������tA�EA�D$ ���$A�D I��$�[m��I��$���fD�
1�L����t��A��$����@I��$�H�E�H�H�P@I;�$�rAI��$�H��@�I��$�H���I��$���I��$�H�����I��$�I�$�M��D�E�H�
��(I���\�@H�M��H��HG�H�˃��f������tA�EA�$���A�L��M��$��Wl��I��$����f.�I9�����M�l$L9�w�I��L9�t_A�uL���k��H��t�M9������A��������1�L���s��H�M�fB��yBI��L9��>���I���a���fDI���H�E�A��m�DI�EI9�v�A�}uu�H�	�SH�P@A�E�|y�I�EI9��4A�E�|�$L��A�L)��fDC�D5�|y	I��I9�u�H�E����I�EI�t$M��H��I�$��I�T�I�T�L��H)�I)�ȃ���������1҉у�I�<
H�<9�r��g���H�E��H�5�L��H��HN�H9�������XA��$��E��.�I�EI�t$(M��H��I�D$ ��I�T�H�T�H��H)�I)�ȃ�������1҉у�M�
L�9�r�����I�EI��$JM��H��I��$B��I�T�I�T�L��H)�I)�ȃ���������1҉у�I�<
H�<9�r��m���Ic�H�;lKM��$�L�<�H�E�L�H�H@I;�$�r?I��$�H��@�H��H���I��$���H��I��$�H�����M��$�I�M��D�E�L��H������L�����E�����H�E��	H�5��(L��H��	HN�H9������u!A��$��E����E���H�E��H�5��(L��H��HN�H9�������t�A��$��E��\�A�EA��$B��A�T�A�T��*���A�EA�D$ ��A�T��T�����A�EA�$��A�T�A�T�������A�T�fA�T������A�T�fA�T�������A�T�f�T�����H�E�A����DU�f�H��AWI��AVI��AUI��ATL�����SI��$�H������H��H��(	dH�%(H�E�1�)�����ƅ����HDž�����H�H��螛H�5g�H���?�H�5��H��� �H�5	�H���1�L��H��L�m��2�L��L��H���ԓH�߅�A��A��裛H�E�H���������E��u%H�M�dH3%(D��uzH�e�[A\A]A^A_]�@H����H���g��H�� H��w�H���ƛH��I���˛H��I����H��E��L��AWD�@���H�
��(1��Xh��XZ�t����k��ff.���G
 tH��u#H��t(H�H9�r�fDH��H9�t�>y��@��f�UH��AWI��AVAUI��ATI��SH�����u
�F
 ��M����M�4A�EI�EM9�s[H�]��H�}�vA�MH�I�EI�M9�v7I���L��L��H��L���P(���A�U��A�U��u$I��I�EM9�w�H��[A\A]A^A_]�����|����H�L��L��H������A�EH��[A\A]A^A_]�@A�EI�E�fDUH��AVI��AUATSH��H�����tjL�$L�m���H�}�w9H�H�I���L��H��L��L���P(��ڸH��[A\A]A^]��H���[A\A]A^]�fD�G
 u�������ff.��G%��������ff.�������t���������!��f�H�OhH��t�f���{�u���UH��AWI��AVE��AUI��ATI��SH��H��HD�M�dH�%(H�E�1�H�F�H��^vH����.H��(��H=�vI���L��L��H��L���P0�����E��M��H��L�I9���H��H��)A��H�����H��H�����<H�ڃ�H������A�G
 ���M�L��@�}��U��E�D�u�A�I���L��H��L��H�@0A������;Eu#�EH�A����D���t�A���D1�fDH�}�dH3<%(��H��H[A\A]A^A_]�fD�����)����H�F�H������H��
���������9E�u��E�Hø�y������D)��f�A�E�E�uA�MA�}A�U�b����mg��ff.�f�UH�GhA�\H��H��tf���\tA�.H��\u�.H��A�j������ff.�@UD���A�\H��H��AQ�����f�UM�H��AWI��AVH�E�I��AUL�,7ATI��S1�H��8H�}�L�E�L�M�H�E�H�M�H�U�H�u�H�}�U��~bH�H�u�HE��fDu.H�}�?t'H�E�?���?L��L��L��A�օ�~�H�I��H�E �L��H+E�H��8[A\A]A^A_]�@u��H�E��?H�E�?�����}+H�E�H�M�H9�s�H�����?H�E�?H�E��z�����؃��?H�E�?H�HE��\���U�BH��ATSAAL�U�� ��A9�A��EF�A�����D�㩀���t�K������u?���H��H����w��u)A�H�e�D��[A\]�fDH��H���G���t����y�L���H����D)�M�[0AR�M���A�r(AQE�I��L������H�� H�e�A�A)�[D��A\]��H���H����H�@0ARM���A�r(AQE��I��H������H�� H�e�A��[D��A\]�D���2����UM�H��AWAVAUL�,ATSH��XH���L�e H�u�H�}H�M�H�@(L�E�L�M�H�E�H���L�x0H�EH�@I�$�lH�E�I��H��L��H�E�H�M�H�u�H�}�H�E��Ѕ�~|H�HE�H�u�H�E��@H�E�?�?L��H��L��A�ׅ�su!H�}�?tI�<$u�H�E�I�$��f�H��H+E�H�}H�M�H�H��X[A\A]A^A_]��uFH�EH�x��H�E�H��H�E��v���fDH�H�H�mtwH�E�H�E�H���*���@���|+I�<$tk��H�E�?�?H�HE�H�E��3���fDH�U�H9U��R���H�EH�x�|���H�P�s���H�}�H�x�f���H�}�H��H+E�H�}�� ���H�U�I�$�1������UH�H��AWM��AVL�u�AUM��I��L��ATI��SH��H��(H���L�M����H�E�M��L��L�M�K�T=H��L)�H�E�H���L����L�E�L��L��H���H�U�H��M)�PH��([A\A]A^A_]�ff.�M9�H���MF�L9�IG�`�U1�H��AWAVAUD�oATSLcNE9��jE�Q�L�H�1�Ic�H��M�H�A�D�3D�`D��A��A��E9���A��E1�E1��I��A�P�D�	H��I��L�I�ԉ�L�I�� I)�L��D�I�H�� ��I��M9�s�D�#H�E����H�S�H9�v"�[���t�@D�
E��u
H��A��H9�w�D�WL�E��LcNE9���I��J�	M���H9�vI��H��A�9t�rqD�x1�@I��A�p��H��H�H)�H�‰A�H�� ��M9�s�H�Ic�H��D�E��u/H�A�H9�v"�q���t�fD���u
H��A��H9�r�D�WD��[A\A]A^A_]��x���D����DD�oLcNL�E9��0�����f�UHc�L��M�Q�H��E�A�D��A�������������u������u�������u������x����@��� ��)���
~d��I9�v<A�Q����D��
�?H�� H	�H�E��E�]�fD�1��t���@1҅�t�D����1���
�?H�� ��D��1�)���
�?H�� I9�vA�Q���NA��A	�L	�H�E��E�]����I9�v�M�Q�A�Q��A���D��A����D��A���D	���
�?H�� L9�sA�r�D����	�H�����H!�H	�H�E��E�]�f�)�M�Q�A���DUH��ATI��SH��H��I�@ H����H�I�H L�HH�@L���ρ�������A�$A��A����AE����;�������I������A��A�A��A��E	�D��D�P��1Ʌ��x�����H���)��A��2Hc�D�A�T���������W�������u�������u�������u������x����@� Dʉ�)ʉH��[A\]�DA��f���LA�E1�E��uA��E��A��uA��A��A���A��A��A��u
A��A����� A��D)�A�����@����A� @��u@���p��A�!�x��@������B������
�5D)‰H��[A\]�@I�@H�H I;H��I�HH�H�x�����1����@f��tcD�lj�A�E1�E��u��E���uA������uA������tTE�B ���A���f�A��A�A������A�A���A���f�A��D�PE1��������A�@���E�B!�������A�������E��t����@� H�U�H�u��]��H�U�H�u����f���A�"���f���A��A�A��A���:����A��A��A� �!���ff.�@UA��H��AWAVAUI�Չ�AT��I��SH��(D�w�G�OA�E�~A9�~
���A9����!Hc�I�D�H�XH��tH�H�H�7��I�]��<���Hc�H�;I;E��I�E�K�sL�CH�CL���~.�B�L��1�D�M�H��H��H�M��eV��H�M�D�M�I��I�I�4$IcD$H��A����A� 1�E)�D�D��I��H����D��	�A�@��~���H9�wޅ�A�8EE�D�sM;erkM;eseIcD$��I�D�H�PI�$L�`H��(H��[A\A]A^A_]��D�M��u��UĉM��[��D�M��u�H�ËUċM����f�L���8Z���fDH��I�xH�FH��H�H9�H�~A��I9�@��A���H9�A��H��@��A����H��H��H9иHG�1�H��H��H���oAH��H9�u�H��H��H�<�H�I�H9�����A�H�FH9������FA�@H�FH9�������FA�@���DL�ǥI��H9������L�ǥI��H9�r����ff.�@UI��H��AWAVI��AUATSH��Lc_LcVE9�|D��I��Mc�I��Lc�E1�C�A9^A��EnA��$Ic�H��L�`M��tI�$H�P�Df.�A�D��L�bA��B�<���Hc�I�<H;B�4H�BE�l$E�|$Lc�M�D$I�D$I��M�$O�<(M9�vLL��L��L�M�L)�D�U�H��D�]�H��H��I�D$I9ǸHB�1��wS��L�M�LcU�Lc]�I��M�	M�6O��O��M9�r�\I��M9�vII��A�y���t�L��L��1�H���A�D�:H��H��L�H�H�ƉB�H�� I9�wى2I��M9�w�M�<$M��~"A�O�I�G���t�DH�����u��u�A�\$H��L��[A\A]A^A_]�f.�L�M�D�U�D�]��X��L�M�LcU�I��Lc]����ff.�UH��AVAUATSH��H��HcFD�gA)��=H�?H��H�H�DH9���H��H��D�0D91t�sH��A�H��H��D�kA���
Ic�H��H�AH����H�H�QH�x�@1�H�8D�`HcSL�L�I��M��HcVI�4��	fDH��I��A�Q�I��H�_H)�A�H�H)�H��A�ԉS�H�� ��L9�w�M9�v:H��L��H���V�H��H)�H��A�ԉW�H�� ��I9�w�I�{�L)�H��H�E��uf.�H���A����t�D�PH��[A\A]A^]ÐA����D�kA�������D��A�H�BA��B�<���Hc�H�8H;JwH�JD�hD�p����DH�u��V��H�u���f�H�BH��t0H�H�JH�H�P�@H�H�XH��[A\A]A^]�H�BH�H H;JwH�JH�H�X뵿 �KV����f�UHc�E1�H��AWAVAUATSHc�H��D�gL��C��H��H�H��C��I��H�� E9��I��H��tD9g~+M�uIc�A��A��E�eH��L��[A\A]A^A_]�fDHcGI��I��D�pA����H��L�h M���I�UH�P M�uI�EI�pM�uIc@I�}L�E�H���2Q��L�E�M;r)M;Gs#Ic@���_���I��H�PI�L�@�G���f�L����S��M�u�8�����D��M�o��<���Hc�I�D=I;GwI�GE�uA�U�R���L�E��U���T��L�E��U�I����f�U��H��AWI��AVAUATI��S��H����������H�E�E1�L�5q?T���u&�toE����H��?TI9���I����t�L��L��L������M;<$��M;|$��IcW���
I���H�rI�7L�zI��u��H�E�H��t0I;$��I;D$��H��Hc@��I��H�PH�H�HH��L��[A\A]A^A_]�D�2���L��L��L��A�����I������fDL��L��L������H�E�M;4$rHM;t$sAIcF��XI��H�PI�L�pL�u�����L��H�E���Q��H�E�I������L����Q��L�u�����I�����L�u�����H�}��Q���#���f���H���(L��H��4�1����I���3���ff.�@UI��`H��AWAVA��AUATA��SH��H��@���H��0���H�pL������~����H��H������H�ʹH�����1�fl�1��H�fH~�L�����H�� )�0�����(�������y������,�������2����P	f�f.�(���zJuHH�������H������0I�AL�����fA�9H�H�����H��[A\A]A^A_]�@H��(���L�����H��$���H�wH�� �������,���I�ʼn���%������� �����$�����(����D��2A�� �C�@D)��獊��	�f���A��H*�fH~�fH~�H�� �����H�� H	�f��H�����f�������*��Y
���\���Y���X���X�f/��D,��
)֍^�A���kIc�H��(��f/�(����&A��E1�Dž����JDE���E��E)�D����E1�A��A����	�����D�D�X����E��D��AO��G��H�H��8���H�����H�H9�@�����	H��8������>������(�������
��H�K�(�����Љ�@�������f(��^���������)��������H���tu���~���te��t�Y
�������tN��t�Y
a������t7��tf���Y��t"H�
[�(��t�YI0��H���u�fD�^������t�
��f/���f���*��Y��X
�fH~�fH~�H�� ����@H�� H	�E��������D��H������,�f�ҍQ�Hc�H�5�(������
���^�H������\��*Ѓ�0H�V�\���(������(���f/����-��f(��\�f/�����tc�A��T�H�L�Y�f��H���Y��,��*؃�0�\���(����B���(���f/��df(��\�f/��%H9�u���(�����$�����x��������	��3E���@
F�	�H��P���H����H�H��P���H�C�CH�H�H�CE��~��~D9�D��N�A)�A)�)�E����H�����D��H�߉����D����D����D������H���H�����L��H��H���s�L;�0���D�����H��D����D����������pL;�@����cIcE���8H��H���8���I�uL���8���I��H��P���H�����H����H�H��P���H�����H�G�GH�H�H�GE���#H�������H��(���u"��,����tA����E��A��`�A���� )ƒ��~�)�A�A��E��~=H�����L��D�։����D����D�����������D����D����I�Ņ�~8H�����H�������D����D�����J�D����D����H������������H������GA9E��Hc�I�MH��H�H��H9�s^H��H���290t�sNH�����L��1Ҿ
D���������H��1Ҿ
H�����I����D����D���H��A��u	E����
E����
I��E����
H�����A�C�L�dH���L�����H�����L���a�E�e�������0����HcCA)�u/I�uH��H�H�	@H9�sH��H���89:t�E�A��H�����H�����L����P����HcPA�u)��I�}H��L�H�
@L9��H��I���
A9t����������B�T�H;�0����lH;�@����_Hcx��H��L���8���L�H���8������(���H�����L�	��E���
A	��
��������A�G�L9������H�����L��1Ҿ
���I��L9��L�����H��1Ҿ
L����L��L��1Ҿ
H����I��L����C���H�������'���fDH��(������� ���E1�H����H�� ��H���?H�� H	��`���Dž�E1Ʌ�x,D�D����E1���DDž�E1Ʌ������A�1�A)����H�����D�������D�����D����D�����6�D����D����H�����D�����H�������H��(��������u��,���������E1�H�����HcPH��T�������*�1����u������u�������u��������
��@�p���<���)� �2���DH�lj���������E����������������P����H�����H��1Ҿ
��H��I���������� ����1�����f�f���A*�f.�z���A�����f�E����A�D$D��E��D���D����H��P����Hc������D�����D����D����D������FF�������D�����H�����D����D����D����������� D)�������A�A������f���*��Y��X
�fH~�fH~�H�� ����@H�� H	�D�\��H����������f/���(����O	fW
��f/������HDž���E1�A��1�D����L����������H���(�؉����ʉ���Y��������-����¸�Y������������Y������������;
�Y��������������M
�Y��������������I�Y�������l������5��f�����Y��K���H�
��(��t
�YA0���H���u�@���!���f(�����@Hc�H���(��E����	E���{	�|����Y9�A�HDž���f/�(����c���H���������1��1L�`H��0���H�����H9��H;�@������V��'Hc�H��H���8���H�H���8���H��0���fDM����H��tJI9�tEH9���H;�@������S��'Hc�H��H���8���H�H���8���H��0���fDL9���L;�@����zA�V��!Hc�H��H���8���I�L���8���H��0���I9��L;�@����
IcE��H���H���I�ED����H������A�$���H�����L� ��A�uA�EL�����A�MD�~A9�~fD���A9������H��8�����<���Hc�L�8L;�@�����	L��8����H�PH�xH�@H�8IcUI�ML��1�A��@�H��H���D	‰W�D�A�A��I9�w�E��D�AE��pL;�0����WL;�@����JIcU��!H��H���8���I�ML���8����pfDH�����HcW)օ���H�0H��H�H�H9��	H��H���:99t���H������f.�H9��HI��A�L$�I�T$���9t�I�ň
�<����f(ĸ�2�f�H��8���H�����H�� H;�@�����H��8���H�����H�H�x�1��Dž��A��A��N��Y
���������������6+� ������Y
\�����f(ĸ��Hc�H��H���8���H������H�H���8������Y
����r�H�����H��D��D�����D���H������D�sA����Ic�H��L���8���M����I�$H���8���I�D$I�|$I�D$I�$HcCH�sD���H���1;��E�L$A�D$A�L$D���E�yA9�~f����A9�����Hc�H��L���8���M����I�H���8���I�vI�FI�6IcD$I�$H�<�1���f.��H��H���	ЉF��Q���H9�w�҉EE�E�NL;�0����dL;�@����WIcD$�����H��H���8���I�$L���8������I��A�|$�0I�T$�t�I�����L��H����������D����D����D�������<��H�����D�����D����D����I�Ջ�����t� �����D�����D����D������=�������D�����H�����D����D��������L���X<������H������D<��H��0���� ����L���(<��H��0������H���<��H��0����H���L��H������;��H������p����E���C����������_��S���f�ɋ����*��Y~��Y��X
7�fH~�fH~�H�� ����@H�� H	��(���)Ɖ� ���!H�����H�����1Ҿ�g�A�UH��H������@)…��,Hc�I�MH��H�H��H9���H��H���:98t�I������y����2��{�HDž���E1��[���I�E���uA�}�0���(A�uA�EA�MD�fA9�~
���A9������Hc�H��H���8���H����H�H���8���H�xH�@H�8IcUI�ML��1�A��f��H��H���D	‰W�D�A�A��I9�w�E��D�AE�pL;�0����L;�@����IcU��H��H���8���I�ML���8����pH������W)օ���Hc�H�0H��H�H��H9��.H��H���99:t��gI��H�������M��@�0����H���������I���1���H��8���H�C H;�@�����H��8���H�H�C����(���H�����f��f(�L�c�^��,�f��*��A0�Y��\���(������(���f.���A���XH�����A�C��M�H�T�fDI9��2�Y�I��f��f(��^��,�f���*ɍA0�Y��\���(���A�D$���(���f.�z�����멐�w����8���DI���)����9������M��������H��0���I�ԉ������������f(��1��K�L��D�����7��D������L��8�����<���Hc�I�>H;�@�����H��8���A�NA�V���A�D��L��8���A��B�<���Hc�I�<H;�@�����H��8���E�t$E�|$��������L�b�<9�L9����t1H������H9�t&I��A�D$�I�L$�<9t��H��0������I��H����������0A�D$���������������������������8����������������������I��H���M��H������9L�����L���X�f/���(����gf.�zu	���VH��0���I����������T����������9t������I�Ń�1�����|��������!�L��H������5��H������p����������9�>��������H�����1E��M��NLj�O�H��8�����<���Hc�L�8L;�@����L��8����H�P�
���� �����D�����D����D����D������6�������D�����H��D����D����D���������I�����f(���T�I��������f��B�����������������������D����D����6����������I��D����D�����D�����5��D���I�����������@���������������������5������������������L��I������H��0�������B�������<)‰��e�UH��AWAVL��`�A��L��X�AUM��I��H��T�ATH��P�I��S�H��dH�%(H�E�1��I���P�L9�I��A��I��`L9���A	���'��H��X��T�L��L)�A�υ�t
A�$-I�T$��������D�QL�Ƹ��xL��D9�t-��H���~�L�Z@�:A9�~�9�uۍx�B.H��D9�u���9����sD�S�A)�9�DO׉�)ǃ���9���H�zH��H��~�H�H��H��H�D��fo����fo��fo
��H���H�H�f�fo�H��f��f��H9�u�D�����fI~��H�A9���L�z�09���L�z�B0�p��L�z�B0�x9���L�z�B0�p9���L�z�B0�x9���L�z�B0�p9��~L�z�B0�x9�|oL�z�B0�p9�|`L�z	�B0�x	9�|QL�z
�B	0�p
9�|BL�z�B
0�x9�|3L�z�B0�p9�|$L�z
�B0��
9�|L�z�B
09�|	�B0L�z�E�����Ⱥ)�H�A)�9��PA�.I��E���L��AO�A��~}I�WL��H��~�H�H��H��fo���fo$�fo
,�H���H�L�fDfo�H��f��f��H9�u��fs�����A)�L�9��	L�x�0A����L�x�@0A����L�x�@0A����L�x�@0A����L�x�@0A����L�x�@0A��tL�x�@0A��tqL�x�@0A��tcL�x	�@0A��	tUL�x
�@	0A��
tGL�x�@
0A��t9L�x�@0A��t+L�x
�@0A��
tL�x�@
0A��t�@0L�x�A�M��tA�EE��tL���/��L��L)�H�M�dH3%(��H�Ĩ[A\A]A^A_]�f.��0.L�Rf����ھ0L��L��0��D��?�L�ZH��@�L��L��H��*��L��H�H��@�D��?�L��0�J��������I�����f�E��������"���f�E��tL����.���0�fA�<$M������A�E���������L���fI~�������-��ff.�Uf(�f�I��H��AWAVI��AUATLc�SL��I�H��dH�%(H�E�1�1�f/���)Éރ�t���N�L��`�f(��L��@�H��P�L��X�M����H�H��T�H��L��(�H��0�H��8��u��D��P���H�L9�H��I��`L��@�A��H9���A	�A��'��M��tA�H��X�A�wbE1�H��H)ρ��A�wA������@��@��E�T1E���b�wA9�AM�9��A9���A9�@��@��E����)�9���A9�~D��M��tA�E��tH����H��-��D��P���H�D)�M��L��(�H��0�H��8��f(��Y����X�H��)�L9�A��I��`L9���A	�����D��T��P�E����M9��A�-I�v����I9��Å��2���*I�ɸ�L��D�XD9�������D��I��L�VE�Y�M9�D���9�u�9�~DŽ�t�L�V�F.M9�L����볉�A�D)�E)�����H�A9��PE1�1�;�H��A����~���E�O�D��P�E���E1�A�r)�1���@��)����9���E��tH����H��x+����H�H��0�M���f(�H��8�L��(�������P�H��H��X�A���)�A����I��`D��P�H9�A��L9�@��A	�T��tM9��}M�^A�-�M��M9�sY�H�qI�{A���~(I9�v#I�{A�C.H9�sI9�w
�H9�s�I9�w�L9�siL�_�eM9�v
E��t�G-L�_A��c~YM9��M��L��M)�E��tH���b*���H�M�dH3%(L���)H�ĸ[A\A]A^A_]�I��A��c�fDA��	�&M9�s�D�Ⱥ����I�[������A)�A��0E�I��M)�낐E��tH��L��H���)��L��H�A�0A�fE�M���]���A��T���A���E)�A�D��P����f�E�JA9�A��A�����@M�����D�Ⱥ��QI�[����B0k�dA�A)�I9��Q��������D��I�������0A�S�����DA�A)�L9�A��I��`D��P�L9�@��A	���M9��w��������D��I�������0A�S����f�1�M���0���A��'���@��A9�������H����I9������H���C�0�T�)�9�}�����A����������	E��������������1����@���D)����
���DA9�@��A�����@�������T���f�I�^A�0A����DL���x���L9�svH�F�0����I9���H�F�F.��t+I9�w�DI9�tSH���@�0��u�DžP�H�ƅ���I9��}1��'����L���������������I��f.�M��L��M)����f�A9������A����������p�������A��k����[&��I���H�ƅ��D���I��H��M)����ff.�f�UH��I���H��AWAVL��`�AUATSH��H��x�H����H�dH�%(H�]�1��I��`L�����~���H����H����H�pfl�H����1�H��)����H�HDž��I9��>M��H�
�(A�E��	<$�d��Hc�H���Džd�I��L9���A�M1���0���AЃ�	��M��1�E1�E1��*C�<�D�ty�I�ZA��H9�v4A�J�yЃ�	�	I��A��~�A��Ӎ�I�ZA���DA�H9�w�Džh�E��Dž��Džp��YA�M��0��I��L9�u�H��f�f�H��x��d�H���t:fWĵ�0f�Džd������I��L9�����H��x�f�L�H������tf��f/���g�(H�E�dH3%(��H�ĸ[A\A]A^A_]�f.��σ�.��Dž��E��1Ƀ�߃�E�B��D	�	��m���H�{H9���Dž��D�KA��+tA��-uDž��H�{H9���D�I��Džh�E�z�A��	��A��0t�@D�A��0��H��H9�u�Džh�I��H���@�h�(��Džd�����Dž��I�ZE��1�H9�v`�;D�W�D����A��	�����A��"D����yD��X�E������fDH���E�J�A����I��H��fDDžh�E������h�+���E����p�E���AD��f�A����H*�AN�����A��	�t�Q�H�5��(f��Hc��H*��Y��X�����A���CD��)��p�����ƒ�tHc�H�
W�(�Y��������w=4�N������
���G�Y�������t>��B�Y�������I��\�Y���������������H�H�{�(����P�Y���fH~�����H�� ������|�����|��H��������Dž��H�����1ɐ	��x���f��/������p����������{�Ǻ%D��)�D)��9�������H���(D)�Hc��Yʉ�)�Hc��Y���������f��z
Dž��A�Q�9��8�����A��	��1��Ƀ�9����������I��`�<�A�׃�Hc�I�;H9��H����M��A�t$I�D$E�|$I�$H�E�t$I�D$A��	�M�}	E�p�L��E��D��P�O�l5
L��X�H��H�L��L����@H���S�L���
H�ǃ�0�%��L9�u�E��I��H��X�D��P�H��H�N�l0E9�}?A��L����L��E)�O�t
DI��A�U�L��H�Ǿ
��0����M9�u�I�ċ�p�1�����H��(�+�h�L�����I�I���X�I�D$H��H�H����H��8�H����H��@�H�����h�H��0�H����D�hA���+Ic�H��H�����H���H�H�����H�CH�CH��H�H�{H�H����Hc@H�����H��0�L����H��8�H��@�H�w�Q���L����I��M����I�H����I�FA�FI�H�I�F���������h��X�D�$8����+���D��3�<0�����|	A�6A)�G�<A�D���D��E9�AN�D9�AODž�~	A)�A)�A)ċ�h����E��~H����L��D�����I�ŋ�p��~H�����X�H���O��H��E��~H����H��D������H��E��~H����L��D�����I��H����H��L���F���H�p�@I��IcVH�89���H��L�I�f.�L9���H��I���A9t��hL����L����M��M��I��H��(��uH�������H������
H��������t)H�P9H�����~����Y�������H����H9��H;����
HcW����DI9���L;�����IcW���
DI9���L;�����IcU����DI9��WL;����JIcT$���l@I9��L;����
IcF��H��H�����I�L����������u���D�����H�����P�診��A�vI�>H����f(�fI~�茺��A�WA+V�����+����fH~Ƌ�P���fH~��D��H�� �H�� H	�H��P��~�P��^���(f/��e���H����H�������H����H���M�q�(���f���������ց������VD�������E����������
\�(f/�r(�H,������t��f���H*҅�ufW����fH~�)�fH~�H�� Ή�H��H�� H�� H	�H�� ��� �H��P��Y�P��X�f.
�������UH����I9��oL;����bIcM��H��H�����I�UH����L�����H9��IH;����<HcK��#H��H�����H�H����H�����DI9���L;�����IcN��H��H�����I�H����L�����I9���L;�����IcW�����H��H�����I�L���������@A�D��H����A��B�<���Hc�H�;H;�����H����D�kD�{���f.�L�����H����I9��^���L������K���L�����H����H9������H���h��H��������@H����L��D��P�����H����L��H��I�����L;���D��P���L;����tIcU���OH��H�����I�uL�����I��������X�D��h�)��k���@�Y
X�f(�f(х�����fW0����fH~����H�� ��)�H��H�� H	�H��P��~�P��-����H����L����M��M��L����I��H��(�H�…���	�������с������L���%��������@H��H�� H���������X����������L����I�F H;�����H����H�I�F�
���fDL��H�� �D��P����H�� �D��P�I���t���@��P��������@H�� H��P���P��Y��X���fH~�����H�� �ׁ�������|��H��������fH~�H9���H��������H��H�� H��P���P��Y��X����������9�����������������,�f���*��\�f(ȅ�uPH�������H����u=�E�(f/��T���L����L����M��M��H����I��H��(��������(f/�w�f/
�(�
����f��[��H���<�����f(������L������������L������H�������@L�����H�����t���@L�����H�����4���@H�����|��H��������m�fD��P��������I��
A�	�I�f��8�f/��&�Y
��f(�f(�fW���!����� �F��I���=���fDHc�H��L�����M����I�$I�D$H������2�f.�I������I���P���؉ƒ�tHc�H�
=�(�^��������[����������������
Ԫ(���Dž���Y��f��N�Y
��(���I����Y
��(���,��i�Y
��(����Y
~�(f(���������tP����k�����)х�~4����Dž����4�9	Dž��p����fDf��f.��R��L�HDž��f���������%�=��1���D�E��u	��� ���A�FD�NA�NA9�~����A9������Hc�H��L�����M����I�H�����I�xI�@I�8IcFI�L��1���@�H��H���	ЉG��Q���I9�w�҉H����AE�H��A�pI9��L;����	A�N��/Hc�H��H�����I�H����L�����A�pH���A�M)΅���Hc�I�8H��H�7Iu�fDH9�sH��H��D�D9t��BM�����DH��H�����H�H����H������%�DH��H�����I�$H����L������t�@H��H�����I�EH����L������$�@H��H�����I�H����L��������DH������(�KH��H������D�h�(�������Hc�H���(�Y������t�D��������E��t!�с�����w��A�kA)�D����9��z���Dž�������������f���p�����D����D+�h�H���(Ic��^��������f��σ�.�L9��I�]H9��!E�EA��0��)���D�A��0u�H��H9�u�H���2�f�D��A�@σ�vtE1�1�E1�E1�Dž����f.�D��H��P�D��X�����D��H��P�I��D��X����I�C A�1����A��0�����E1�I��1�E1����������1���D���������������Dž��P������������������fDH����H�������H����M��D�������E�����΁�������M�Ɓ�p���HDž��H����L��L�����8
��L����H����A�pH�������L������<���Hc�I�8H;�����H����A�HA�P�$���H��1��
���D��1��
���������������f(����������A����A�<A���p����AO�A��	fDE��G�4�A��E�zE�A9�~�D9�~6H��h�D��f.��W�����E�?��E)�D9��H��h��p�D�A����1�A�����������G��A�<A���p�눁��M��Dž��������������������L����L����M��M��H����I��H��(��(�������Dž��j�������f(�1��;�������X�������n�����U����t����AD��X�I��E1�����E1�1�A���X�C��D�4O1�������������H��p���p�����@H��H�� H�����\���f.<���������F������
(�(���Dž��j�Y��U���������������X�D��h��p���������X�D��h�I����p�����>���H����L����M��M��L����I��H��(��KH��H����H�����2������������!��������]���L��p�A��0I��I��L9�v)E�E�i�A��	wA��N�G��I��G�TQ�L9�w�L��L��p�D��h�H)�H��LA��NC�����t.I���h�L������ ����!Љ�����������I��L�����Džh�N��F��L��L9��g�E1�1�E1�1�Dž��E1��H�D�����E����ff.�UH����H��H��H�U�H�u�H�E�����f.�@UH��AVAUATI���SH��PdH�%(H�E�1�����L�5^�(H�������F���"��Lc�H��1��E�I��H�]�H�lj����)�@��A��E�I9�w"�L��H�����A�H�LjH��u�L���H��H���S�H�H�Q���u�H�u�dH34%(uWH��P[A\A]A^]�fDL�5�(H�����S����F$��"w&H��x	���K���f�A�$-H��I�����6���D1�����ff.�@UH��H��PdH�%(H�E�1���y	H����H���E�I���������I��G0H��H�����)�H��	H�}�E�v5f.�H�ȃ�0H��I��H�����)��H��H��u��@H��H���G�H�V�B���u�H��H�u�dH34%(u��fD�-H��H���]�������@1��@�H��8�u���u��fD1��DU�����H��SH��H�����H��H��[]�U�
H��SH��H������H��H��[]�UH��AWAVAUATSH���jL�L9�sPH���N�L�P@H��A�D
H��u�:@D�L��C�Dt'H��I9�u��!1�H�>[A\A]A^A_]�t��H��<-����<+��A�A�\/�+��
E1�<0tz��0<	w�L�Q	L�A��M9�MF�M9���y��H����I��H�AM9���A�8�OЀ�	v�H��L�H��E��HE�[A\A]A^A_]Ð�y@��0��L��L�AM9�u�1�L�H��H��E��HE���f�L�A�����M9������AA�L��A������_A��-���f.����t;H�
r�NL�A@��A�DH��u����A�D0��H�����u�H�u����DM��M9�����I�J	I9�I��MF�M��E1��"fD@��O�4�N�4wI�L9���I��A�?��0@��	v�D��H�u�(L�>D)�H��I�[A\L��A]H��E��ID�A^A_]��L�AM9����A��
L��E1�A�A�\/�+����L����H�u�<-������H��
I9�I��MF�1�M9��3����,���f�M9���A�8�OЀ�	��M�W��M9���A�x��0@��	��I��L�>M9�tA�p��0@��	��H9���H��@��H�O��H��vHH��K��H��H��H��
���M��I9������Hi�ʚ;L�L�H��H��E��HE����H��TL�H��K�<�H�xH�E��tUH��H9�wNt5H��H�����M9�r�k���I9��b����"H�����E���{���H���l���H���d����"�Y���fDUH��AWAVI��H��AUE��ATSH��L)�H��HH�U�D�M�dH�%(H�E�1�H��vM��H��tL�}�A��dtyA��itsA��u�9A��pt{A��o�1�A��X�L�������L)�I��L��L9�r
H�M�I9�tdK�&H�M�dH3%(��H��H[A\A]A^A_]�fD�����L�������f��0xI�w1ɺfA�����DH�E�H9�H��HF�I9�sXH��L)�E�t1H�ھ0L��H�M��-��A��pH�M�u+H��vgA�Fx�E�0�f�H�ھ L��H�M���H�M�I�L��H��L���������f�1ɺL������@�
L�����������E�x���ff.�UM��H��AWAVI��AUI��ATI)�M��SM�}H��H��XH�u��EH�M��E�H��yH���E�H��H�}�M��H��* LD���L��L��L�U����L�U�I9��L�m�K�,E1�H���L��L��H��L�E����H�M�L)�E���}���E��I�D
H;E���H�}�H��L��H�M��@E��H�M���H��X[A\A]A^A_]�@I�rL��L�U�����L�U�H��I9�IF�I9�wL�m�L��H9��mL�E1��H���f�H�}�H��L��H�M���E��H�M��XH��E1�H9U��}���H�u�Iͺ H��L)��)H��X[A\A]A^A_]�f.�D��f�H�E�H�)E�I9���I�H�M�H�E�L�i�`I9���E���L�u�M��I��H���"DL��L��L��M��I��L9��[I���H��L��L��E�<$������O�A��`u��I�FH9E�vA�`I��Lc�K�>H9E�w�DH�E�1��E1�}��o���J�)����f�I�E1����@H��w2A��L�������E���.L��H��H�M���H�M��I�T�A�����E1�L�u�M��I��E���$fDL��L��H��I��I��L9e���D��A�wA�$L��L�tŰ���������RH�U�)�I���A��L������OЃ���`uI�FH9E����A�`I��Hc�I�H9E��o�������f�H�u�H�}�� H�M�H)�L)���H�M�H�E������L�u�H�HE��I9������E����A�@�H�LŰI��H���f�������H�U�H����A�A�@�H�LŰH������P�H���ׅ�t1��ƃ��1.9�r�L�,I�EH��A�E`H+M������L�u�I��H�@I9�w����H�M�H������A�A�@�H�TŰI��H��t>�E���g����^���H��H��I9������E��������{����H���J���H�ʸ���6���f�UH��ATI��SH�����~|�B��׃�Pw*H�H�
	�JH�V�H��H�4���;t1H��[A\]�@H��H�����H9�t�I�T$�H��H����;u�I�T$�H��H�5��(�oH��[A\]��H�V�H�M�(H�5�(HE��EH��[A\]�ff.�f�Uf�H��AWI��AVL��@���AUM��ATM��S1�H���H��0�H���dH�%(H�E�1�H�"�NL��(�L��8�I��H�x@H��@�I���I��H�Y�AA�B ��`uA�B H�q���AH��H��-u
���AH��H��AB��*�T��E1�D7u�>f.�L����K�4��B�L�pM��uA�J �AL�YH��Du�M�J�AI�s��.�xI�B��L��H�]�H��DŽ
D�L���l����z����puAǁt�f.�L��A�H��M�B��
@�I�r(<%�O��u�FfDH���FH�V��t<%u��5H�J�RI�r0I��E1�H��Dt.���K��H����0L�P�H��Du�M9�MB�H��I��8�]���D��D�1����H����0H�PH��uA�J H���H��Du�I9�LB�H��H��H��I�R�SL�L�[�dH�s�@�CA�J ��.�����A�K<*��D��1�B�Du�fDL�����NH��L�^��0H�PH��Du��NI�RH���‰��2����Aǁt�A�S<l����I���H�����F���fDAǁt���A�CI��H���"���f���I�C1�D7�@��H�4�H���Q�H�r�0H��D7u�I9�L�XH�pLB�H��A�J I�RH��L��d�B�P�@�i����I�sA�CI�����fDH��L�ބ�����f�L��M��L��(�L��8�H��H)�H���p���M��tcH��@�I��H�=v�(I�fD�2�N���+w3��Hc�H���A�M����a�΃�IuA�M��BH�� H9�u�J��L���H���(L)�M�d�8H��@���H���DA�6�F�<+���Hc�H��DA�M��/���΃�IuA�MHcH�J�DD�BA�ME������/�
�΃�IuA�MH�H�J�K���DA�M��/���΃�IuA�MH�H�J� ���f.�I�FH����X�I�FA�F tH����P�H=��t
H���HF�L��L)�H��H9�HF�@��f�tL����1ɿ�3��I�M9���I�v(I�V0L��L)�H)�H9�HO�I�I9�vH��L��I��8�VI��M9�������H�]�dH3%(�PH�e�[A\A]A^A_]�DI�FM�FH��L��H�A�F �tI��N��P�I�N�tH��H��
P�1�@��TH��0�L����RL��P��^_I��M9��2���H����c���DE�^ M�VA��tI��N��P�K�E��A�dL�� �I9�D��(�IB�1�H��I�FH��8�H��L��H��H��P�H����^�D��(�L�� �I��H��8�L)�H�������I�G����L���H��(� "fA�L���D�� �L�����D�� �j1�L���H��8�M��H��(�H��0�ASM����ZYI��H9�8������"I�����I�FI�NH��H��H�A�F tH��H��
P�I�DI9�s
L��L)�H��H��L��H��8����H��8�I����@E�N I�VA��tH��H��P�I�FD��L��L��H��H��P���I���W����M9�����I�FI��H��H��P�A�G��*���f.�I�uH�NI�M�)���I�uH�NI�M���@��d�����@��i�����/wj�΃�IuA�M�H�Z�s���I�uH�NI�M�6���H��I�����I�uH�NI�M���L��1��F���I����H���H���������I�uH�NI�M땉�I���H�����I�R�����O��ff.�@UI��L�T�H��AWAVAUATSH���H��8���dH�%(H�E�1������H��@���M��I��H��0���<%tSM9�tA�EH��I���CH�K��u��L��L)�A�EH�}�dH3<%(�4H�e�[A\A]A^A_]�H�=1�N�QH�YE1�H�w@H��D���`��<-��<*�A�H�K��/�+�ƒ�IWA�Hc�CH��A���<.�!<l�W1�<p��<zu
�C�H��<s�g<T�_<b���p�@����<d��<i���p�@�� ��H��!H����A����6��/�����IOA�H�	D�L��L��E��L�� ���L��(�����L��(���L�� ���I���}������1�D������H����0H�PD���H��DD�H���H��Du�A���<.�����C<*�A�H�s��/������IOA��CLc1H��<l�����@�C<l�H������fD�CH��<*�=����C����AH�YA�<-�������1�A��	fDH����H��D�CH�K��0H�PL��H��ED�B�Du�A��$�qH�����f�I�WH�BI�G�����<M�<M9��/���A�E%I������f�H�w@��H��E1��D��������K��H����0L�4H�H��Du��u���@A���/�T����IOA�1��;TH��8���L����M��L�� ���PATL�	H��L��L��(�����^_I��L��(���L�� ����Y���@A���������/������IOA�Hc	�z����A���/�d�ƒ�IWA�K�D5H�2I9�s
M��M)�I��L��L��M�L�� ���L��(�������L��(���L�� �������f��C�H�����fDI�OH�AI�G������/������IOA��	����@I�OH�AI�G�a����I�OH�AI�G����A�G=����ƒ�IWA�G���I����t�I��H��IF�L��L�� ���L)�L��(���H��H9�HG���f��L��1ɿ�ּ��L��(���L�� ���I����I�WH�BI�G����I�OH�AI�G�	����DI�OH�AI�G�?����I�WH�BI�G�3����L��1��ֶ��L��(���L�� ���I��5���I��1��D���<c�����M9��-���A���/w�ƒ�IWA��I��A�E����I�WH�BI�G��A���/�1�ƒ�IWA�K�D5Hc
L��E��I9�A�dL�����IB�1�L�� ��������H��H��(�����L�� ���L�����I��H��(���L)�H���l���I�E�������L�����H�� ���� "fA�EL��0���L�����L���z�jM��1�ATL��(���M��H�� ���H��8���L���Q�ZYI9�I��L�����L���������"I������H��8���I��M��L��H�KL��L��0������L��0���L)�����I�WH�BI�G�����q��I��H��H��H��H�=��N�����UH��H���H��h���L��p���L��x�����t )E�)M�)U�)]�)e�)m�)u�)}�H�EH��8���Dž8���H��@���H��P���Dž<���0H��H����c����ÐUH��AWI��AVL������AUE1�ATA�6S�H��(H������H������dH�%(H�E�1��+DH�A��tW�H��1�A���H��I��H��t:H������L��H��L������H��H�C�H9�wAE��t�L��H��	J��A��u�1�H�M�dH3%(uYH��([A\A]A^A_]�DH������L��H�������"��H�������������I�E��t�L���������I������������UH��H���H��`���H��h���L��p���L��x�����t )E�)M�)U�)]�)e�)m�)u�)}�H�EH��8���Dž8���H��@���H��P���Dž<���0H��H����\�����f.�UH��H��?H��AWM��AVI��AUI��ATSH��H1�H��H)�H��?H��H��H��I�H1�H)�H�r�NH9�HO�H�H@��D�yf�H���H��Du�<+��DžL�������<-��H��<0ufDH���:0t�E1�L��P��������0C��9�}:I��I���dB�
E��N�$
�A�<	vэA�<�����7C��9�|�L9���A��E���yIc�Hc��P������H�H9�� A��Hc�E1�H��Ic�I�������Ic�H�����Hc�H9���H�I��A��H�L��H��IɅ��H��L��@���D��H���L��8����	��D��H���L��@���E��u%Hc�P���L��8������Hc�H9���L��M���L������M9���M���fD�A��A�����������W���f��GH��DžL����d���f�L9���A�����@�S��E1��"H�ĨL��[A\A]A^A_]�D�GH��DžL�����������E1�I��������f.�H��I9�tI��M9��*����"E1��f.�H���������E1��!�k���DH���H�H��tH���@8�u��@H���H��H�P�z�u��f.�H��t+UH��SH����H��H������H��H��[]�fDH����f�H��H���H���N�L�@���tL��H9�u���f�H�H����H���N�L�@���tL��H9�u��DUH��H�EH�U�H�E�H�E�H�M�L�E�L�M��E�H�E�H��tiI��L�MH�WH��A��f.�H��H��H���N��J���u�A��/wD��A��I�4
H��u��]��I�1I�IH��t�I���H���]�f.�DUH�H��AVSH�EH�E�H�E�H�M�L�E�L�M��E�H�E�H����I��A�L�UH9����H�_���tZH9�tvD�BI��H�JH�GI)�D�GL�E��u�&�H���y�L�@A�x�@��tL��H9�u��[A^]�H���H��A��/w'D��A��L�H�H��tH9��x���H���[A^]ÐL��I����H���[A^]�f.�f�UI��H��H��AWAVI��AUATSH��xL�� L��dH�%(H�E�1�A�M9���</��L����</��L��L�c��C�M9�u�M��L��M)�</��I��M��tEL9���H��L��H��L��h���H��p���L��x������L��x���H��p�����L��h���urA�M��X����1�M��tH��L��L��A��A�$M�� H�u�dH34%(�8H�e�[A\A]A^A_]�fDM��M)�I���M���f�H��A�L�m�L��IG�L��L��x���I��I�Ϲ L�����L��x���B�D=�M��t{I��� H��MF�L�E�L��L������H��M��L��P�L�
�(1�����B�D%��~��X�Z�"���f�M������L��L��L��L)�A�����M��L��(L��1�������-������L��E1��A���I�_M��I������9����@��I��I��H���$���UH��AVAUI��ATI�MI��SH��H�� H��H��I��I)�I�4H9���H9�s�/H�� H�xH�� L��L�����H�� L�H�� ����t(H��HH��� L��L��H��[A\A]A^]��DH��HH��t;H��H�� H��[A\H)�A]A^]��fDHǃ�L�� [A\A]A^]��H��H�����H�AH��H��H��H9�HB�H��H��tBH��1�1��V@��H��H��J�<2H���H�� H������[A\A]A^]�H��1�1��$>��H��H���L���I�VH���H���q��H����1��8���f�UH��AWAVAUATSH��H��0H��8H9�v9�L�%�(A�tKH�C�D�H��A�t2H��H��0H9�u�H�H��8H�F�EH��[A\A]A^A_]ÐH�]��~E�H�Cfl�)L��8I9�s`H�C	I9���I���3I��H�=��(@�u��*���U�H���H��I��0I�I�^�H��[A\A]A^A_]�f��;<!--u�H��0M�EH�BI9�w�3f�H�P�H��H��0L9�tH��I9�r�f�x�--u܀x�>u�H��0H�VH���C[A\A]A^A_]��H�<![CDATAH9�*����{[� ���I��H��0L9�r�fDH��H��0L9��|�8]u�x]u�x>u�H��H��0H�F�D�����"����'���UA��h���H�CI��0L9�s5�SA�t*H�����H��A�tH��I��0L9�u�I�I�FH9�s1�
A�u���
A���H��I�H9�u�I����H�CI��0L9�s:I��s@82t.H���f.�I�H���2@80tH��I��0L9�u�I�FI9�8vH��I��0I�H�JI�A�tZ�S�`���H��I�FH9��i����H�A�u��Y����H���D[A\A]A^A_]�H9�r��4���f.�I�FH9�s��rA�4t)H���H��I�H9��w����1H��A�4u��P�H��A�u�U�����R�H��A��;���H��I�FH9�w��*���@UH��AWAVAUATSH��H��8H��H��(H��0H�� H�<H��8H9���L�-�(L�u�L�}�D�><��H�u��><tWL�FL���DH�H�y�<tH��H��H��0H9�r�H�E���gH9�tH��PH��tH)�H���H��8H��0H9�r�H��1��:t"H�F-INPUTfoc�(H�CC�H��8[A\A]A^A_]�@L��H��������Ct���D�_L��H�������/�{��!����?���E�E1��E���I��H�u�H�U��CH��H)��������m���DL��H���������It
��Su.E��t)L��H���i�������=����I���SuE��u���/�`�U���t*��?�r1�1�H�������������L��H���������E���t1�1�H�߉M������M���������>�������!��3�.H��(Hc�H��L��H�������It	��S��H�u�H�U��CH��H)��������e���H��PH��tH�u�H�U�H��H)�Ѕ��A���H�u�H�U�H��H)��6�����������!���f�H�u�H�U��CH��H)��f�����t����DH9�������A�D
�`L��DH��H�M�H9��i���D�H�IC�Du��H�A�D
�I���H���f��J�H��A�D
�2���H��H�E�H9�w�����H�E�H�p	H�E�H�u�H�P�H��PH�U�H����������L��H���]�����I�xH�u�H�U�H��H)��!������L��H���.������7���L��H��A������E��E��C���L��H��E1�����E��E��"���1�1�H����������L��H���������z�����!��3��H��(Hc�H���H�A�D
��������L�
�}(H�{L��}(�����1�����6���L�
�}(��L�
�}(��L�
�}(�L�
�}(�L�
�}(�L�
�}(�L�
�}(�L�
eA�L�
�}(�L�
�<�L�
�O�t�����!��3��H��(Hc�H���!��3�,H�I�(Hc�H���!��3��H���(Hc�H��L�
`OH�{L�6}(����L�
�@��L�
�|(��L�
�|(��L�
.OH�{L�!}(���L�
�|(��L�
�|(��L�
�|(��L�
<��L�
}@��L�
�|(�L�
�|(�L�
�|(�L�
�|(�L�
�|(�L�
l|(�L�
�;�O���L�
{|(�C���L�
g|(�7���L�
S|(�+���L�
K|(����L�
G|(����L�
C|(����L�
|(���L�
TNH�{L��{(����L�
�?��L�
�{(��L�
�{(��L�
=;��L�
�{(��L�
�{(�L�
�{(�L�
�{(�L�
�{(�L�
�{(�L�
�{(�L�
�MH�{L��{(���L�
�{(��L�
\{(��L�
n{(��L�
�:��L�
r{(��L�
 ?�L�
P{(�L�
K{(�L�
J{(�L�
I{(�L�
{(�@UH��H�1�H��H�G�H��HLJPH��H)���`���H�H���Hǂ�H�E��~E�fl��]�f�H��H��t,UH��SH��H��H���p3��HǃH��[]�fD��H��P��H��H��H��X��H��@��H�G�ff.�H��(H��0H9�sH��f.��:
HD�H��H9�u�H)��ff.��H��(H��0H9��H�q�H��H��H)�H)�H���f��f��f��H��H���fo=d(fo5��H�f��oH��ft�f��fo�fh�f`�fo�fi�fa�f��fo�fi�fa�f��f��f��H9�u�fo�H��fs�H���f��H�fo�fs�f��f~�H9��`1��:
@���H�rH9��@1��z
@���H�rH9��'1��z
@���H�rH9��1��z
@���H�rH9���1��z
@���H�rH9���1��z
@���H�rH9���1��z
@���H�rH9���1��z
@���H�rH9���1��z
@���H�r	H9�v|1��z	
@���H�r
H9�vg1��z

@���H�rH9�vR1��z
@���H�rH9�v=1��z
@���H�r
H9�v(1��z
@���H�rH9�v�z
������@1��1�����DUH��AUI��ATSH��H��H�����L��H��H�PI�����H��J�#[A\A]]�@D�H��E��t)H����H��D8�t�
��u�H��D�E��u�1�����AWI��AVI��AUA��ATL�%LJUH�-TJSL)�H���'��H��t1��L��L��D��A��H��H9�u�H��[]A\A]A^A_�ff.������H��H���Stage: %d of %d '%.*s' %6.3g%% of stage done%s  Ver %s Distrib %s, for %s (%s) using %s %s
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Usage: %s [OPTIONS] [database]
select @@version_comment limit 1Returning to default PROMPT of %s
No previous outfile available, you must give a filename!Currently logging to file '%s'
%s -- sorry, cannot connect to server to kill query, giving up ...
%s -- sending "%s" to server ...
Default pager wasn't set, using stdout.
Not allowed in the sandbox modeDELIMITER cannot contain a backslash characterWARNING: --server-arg option not supported in this configuration.WARNING: option '--enable-cleartext-plugin' is obsolete.DELIMITER must be followed by a 'delimiter' character or stringReading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=%lu,MAX_JOIN_SIZE=%luUnknown default character set %sNo connection. Trying to reconnect...Usage: \C charset_name | charset charset_nameCharacter sets with mbminlen>1 are not supportedUSE must be followed by a database namepopen() failed! defaulting PAGER to stdout!
Many help items for your request exist.To make a more specific request, please type 'help <item>',
where <item> is one of the followingYou asked for help about help category: "%s"
For more information, type 'help <item>', where <item> is one of the following
Please check if 'help tables' are loaded.
Please try to run 'help contents' for a list of all accessible topics

General information about MariaDB can be found at
http://mariadb.org
Note that all text commands must be first on line and end with ';'
For server side help, type 'help contents'
*************************** %d. row ***************************
select DATABASE(), USER() limit 1
All updates ignored to this database
select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database limit 1
Note that you are running in safe_update_mode:
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used.
Max number of examined row combination in a join is set to: %lu

Field %3u:  `%s`
Org_field:  `%s`
Catalog:    `%s`
Database:   `%s`
Table:      `%s`
Org_table:  `%s`
Type:       %s%s%.*s%s
Collation:  %s (%u)
Length:     %lu
Max_length: %lu
Decimals:   %u
Flags:      %s

<?xml version="1.0"?>

<resultset statement="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Ignoring query to other databaseASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: 'Can't initialize batch_readline - may be the input source is a directory or a block device.Welcome to the MariaDB monitor.  Commands end with ; or \g.Your %s connection id is %lu
Server version: %s
Couldn't allocate memory for temp histfile!
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Usage: \. <filename> | source <filename>Failed to open file '%s', error: %dCan't initialize batch_readlineAbort 'source filename' operations in case of errorsEnable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time.No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.Automatically switch to vertical output mode if the result is wider than the terminal width.Don't use history file. Disable interactive behavior. (Enables --silent.)Binary mode allows certain character sequences to be processed as data that would otherwise be treated with a special meaning by the parser. Specifically, this switch turns off parsing of all client commands except \C and DELIMITER in non-interactive mode (i.e., when binary mode is combined with either 1) piped input, 2) the --batch mysql option, or 3) the 'source' command). Also, in binary mode, occurrences of '\r\n' and ASCII '\0' are preserved within strings, whereas by default, '\r\n' is translated to '\n' and '\0' is disallowed in user input.Directory for character set files.Write column names in results.Don't write column names in results.Display column type information.Preserve comments. Send comments to the server. The default is --skip-comments (discard comments), enable with --comments.Use compression in server/client protocol.Notify the server that this client is prepared to handle expired password sandbox mode even if --batch was specified.Number of seconds before connection timeout.This is a non-debug version. Catch this and exit.Check memory and open file usage at exit.Print some debug info at exit.Default authentication client-side plugin to use.Set the default character set.Obsolete option. Exists only for MySQL compatibility.Execute command and quit. (Disables --force and history file.)Continue even if we get an SQL error. Sets abort-source-on-error to 0Ignore space after function names.SQL Command to execute when connecting to MariaDB server. Will automatically be re-executed when reconnecting.Write line numbers for errors.Don't write line number for errors.Enable LOAD DATA LOCAL INFILE.The maximum packet length to send to or receive from server.Automatic limit for rows in a join when using --safe-updates.Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.The buffer size for TCP/IP and socket communication.Ignore statements except those that occur while the default database is the one named at the command line.Pager to use to display results. If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.Password to use when connecting to server. If password is not given it's asked from the tty.Directory for client-side plugins.Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).Print the query if there was an error. Is only enabled in --batch mode if verbose is not set (as then the query would be printed anyway)Get progress reports for long running commands (like ALTER TABLE)Set the command line prompt to this value.The protocol to use for connection (tcp, socket, pipe).Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.Maximum number of characters displayed in a column header when using --quickWrite fields without conversion. Used with --batch.Reconnect if the connection is lost.Only allow UPDATE and DELETE that uses keys.Synonym for option --safe-updates, -U.Disallow commands that access the file system (except \P without an argument and \e).Refuse client connecting to server if it uses old (pre-4.1.1) protocol.Automatic limit for SELECT when using --safe-updates.Send embedded server this as a parameter.Show warnings after every statement.Be more silent. Print results with a tab as separator, each row on new line.The socket file to use for connection.Enable SSL for connection (automatically enabled with other flags).CA file in PEM format (check OpenSSL docs, implies --ssl).CA directory (check OpenSSL docs, implies --ssl).X509 cert in PEM format (implies --ssl).SSL cipher to use (implies --ssl).X509 key in PEM format (implies --ssl).Certificate revocation list (implies --ssl).Certificate revocation list path (implies --ssl).TLS protocol version for secure connection.Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.Append everything into outfile. See interactive help (\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.Flush buffer after each query.User for login if not current user.Write more. (-v -v -v gives the table output format).Output version information and exit.Print the output of a query (rows) vertically.Wait and retry if connection is down.Switch to another charset. Might be needed for processing binlog with multi-byte charsets.Clear the current input statement.Reconnect to the server. Optional arguments are db and host.Send command to MariaDB server, display result vertically.Send command to MariaDB server.Disable pager, print to stdout.Don't show warnings after every statement.Set PAGER [to_pager]. Print the query results via PAGER.Execute an SQL script file. Takes a file name as an argument.Get status information from the server.Execute a system shell command.Set outfile [to_outfile]. Append everything into given outfile.Use another database. Takes database name as argument.%*sprogram_name days  day  hours  hour %.3f sec%d secSELECT DATABASE()Linux10.6.22-MariaDBreadlinex86_64select USER()@\g 	[mariadb] Error logging to file '%s'
PROMPT set to '%s'
Outfile disabled.
PAGER set to stdout
No outfile specified!Logging to file '%s'
%*s
AbortedByeWriting history-file %s
QUERY ^C
Ctrl-CKILL %s%lu%s -- query killed.
%s -- connection killed.
ERROR at line %lu in file: '%s'ERROR %d (%s)ERROR %dPAGER set to '%s'
viEDITORVISUALCommand '%.40s' failedUsage: \! shell-commandshow databasesshow tables%.64s.%.64sauto*** NONE ***Connection id:    %luCurrent database: %.128s
Can't connect to the server
Charset changedCharset is not foundDatabase changedSandbox mode.Show warnings disabled.Show warnings enabled.----------------------------
show warnings%s (Code %s): %s
categories:topics:help 'help Name: '%s'
Description:
%sExamples:
%s   %s

Nothing foundhelp 'contents'List of all client commands:%s(\%c) %s
%*s: 0x%02XNULL
\0\t\n\\
Connection id:		%lu
Current database:	%s
Current user:		%s
SSL:			Cipher in use is %s
SSL:			Not in useCurrent pager:		%s
Using outfile:		'%s'
Using delimiter:	%s
Server:			%s
Server version:		%s
Protocol version:	%d
Connection:		%s
Insert id:		%s
Server characterset:	%s
Db     characterset:	%s
Client characterset:	%s
Conn.  characterset:	%s
UNIX socket:		%s
TCP port:		%d
Protocol:		Compressed
%.*s			 &nbsp; <TABLE BORDER=1><TR><TH></TH></TR><TD></TD></TABLE> (BITDATETIMENEWDECIMALDOUBLEENUMFLOATGEOMETRYINT24LONGLONGLONG_BLOBMEDIUM_BLOBNEWDATESHORTTINYTINY_BLOBVAR_STRING?-unknown-?type=format= unknows=0x%04x+ %-*s || 
  <row>
	<field name=""></field>
" xsi:nil="true" />
  </row>
</resultset>
\GNo query specified
SET %ld %s in setQuery OK, %ld %s affectednot_connected(none)unknown(unknown)pm   /*>     `>     ">     '>     -> Localhostlocalhost localhostgethostname(2) failedUnknown command '\%c'.\N [\d]> MYSQL_PS1PAGERMYSQL_HOSTstdoutTERMmagic-spaceMYSQL_HISTFILE%s/.mysql_history/dev/nullReading history-file %s
%s.TMPhelpDisplay this help and exit.Synonym for -?abort-source-on-errorno-auto-rehashauto-vertical-outputbatchbinary-as-hexPrint binary data as hexbinary-modecharacter-sets-dirskip-column-namescolumn-type-infocommentscompressconnect-expired-passwordconnect_timeoutDatabase to use.debugdebug-checkdebug-infodefault-authdefault-character-setdelimiterDelimiter to be used.enable-cleartext-pluginexecuteConnect to host.htmlProduce HTML output.ignore-spacesinit-commandskip-line-numbersmax-allowed-packetmax-join-sizenamed-commandsnet-buffer-lengthno-beepTurn off beep on error.one-databaseplugin-dirportprint-query-on-errorprogress-reportspromptquickquick-max-column-widthrawreconnectsafe-updatesi-am-a-dummysandboxsecure-authselect-limitserver-argshow-warningssigint-ignoreIgnore SIGINT (CTRL-C).silentsslssl-cassl-capathssl-certssl-cipherssl-keyssl-crlssl-crlpathtls-versionssl-verify-server-certOutput in table format.unbuffereduserverboseverticalwaitProduce XML output.embeddedmysql_SERVERmariadb_SERVERmariadb-clientclient-serverclient-mariadbSynonym for `help'.clearSet statement delimiter.editEdit command with $EDITOR.egoexitExit mysql. Same as quit.Display this help.nopagernoteeDon't write into outfile.nowarningPrint current command.Change your mysql prompt.quitQuit mysql.Rebuild completion hash.sourcesystemcreate tablecreate databaseshow fields fromshow keys fromload data fromalter tableset optionunlock tablesAFTERAGAINSTAGGREGATEALGORITHMALTERANALYZEANYASCASENSITIVEAUTO_INCREMENTAVGAVG_ROW_LENGTHBACKUPBDBBEFOREBEGINBERKELEYDBBETWEENBIGINTBOOLBOOLEANBOTHBTREEBYBYTECALLCASCADECASCADEDCHAINCHANGECHANGEDCHARSETCHECKCHECKSUMCLIENTCLOSECOLLATECOLLATIONCOLUMNCOLUMNSCOMMENTCOMMITCOMPACTCOMPRESSEDCONCURRENTCONDITIONCONNECTIONCONSISTENTCONSTRAINTCONTINUECONVERTCREATECROSSCUBECURRENT_DATECURRENT_TIMECURRENT_TIMESTAMPCURRENT_USERCURSORDATABASEDATABASESDAY_HOURDAY_MICROSECONDDAY_MINUTEDAY_SECONDDEALLOCATEDECDECLAREDEFAULTDEFINERDELAYEDDELAY_KEY_WRITEDELETEDESCDESCRIBEDES_KEY_FILEDETERMINISTICDIRECTORYDISABLEDISCARDDISTINCTDISTINCTROWDIVDROPDUALDUMPFILEDUPLICATEDYNAMICEACHELSEELSEIFENABLEENCLOSEDENGINEENGINESERRORSESCAPEESCAPEDEVENTSEXECUTEEXISTSEXITEXPANSIONEXPLAINEXTENDEDFALSEFASTFETCHFIELDSFIRSTFIXEDFLOAT4FLOAT8FLUSHFORFORCEFOREIGNFOUNDFROMFULLFULLTEXTFUNCTIONGEOMETRYCOLLECTIONGET_FORMATGLOBALGRANTGRANTSGROUPHANDLERHASHHAVINGHELPHIGH_PRIORITYHOSTSHOUR_MICROSECONDHOUR_MINUTEHOUR_SECONDIDENTIFIEDIGNOREIMPORTINDEXESINFILEINNERINNOBASEINNODBINOUTINSENSITIVEINSERTINSERT_METHODINT1INT2INT3INT4INT8INTEGERINTERVALINTOIO_THREADISOLATIONISSUERITERATEINVOKERKILLLANGUAGELASTLEADINGLEAVELEAVESLEFTLEVELLIMITLINESLOCALLOCALTIMELOCALTIMESTAMPLOCKSLOGSLONGBLOBLONGTEXTLOOPLOW_PRIORITYMASTERMASTER_CONNECT_RETRYMASTER_HOSTMASTER_LOG_FILEMASTER_LOG_POSMASTER_PASSWORDMASTER_PORTMASTER_SERVER_IDMASTER_SSLMASTER_SSL_CAMASTER_SSL_CAPATHMASTER_SSL_CERTMASTER_SSL_CIPHERMASTER_SSL_KEYMASTER_USERMATCHMAX_CONNECTIONS_PER_HOURMAX_QUERIES_PER_HOURMAX_ROWSMAX_UPDATES_PER_HOURMAX_USER_CONNECTIONSMEDIUMMEDIUMBLOBMEDIUMINTMEDIUMTEXTMERGEMIDDLEINTMIGRATEMINUTE_MICROSECONDMINUTE_SECONDMIN_ROWSMODMODEMODIFIESMODIFYMULTILINESTRINGMULTIPOINTMULTIPOLYGONMUTEXNAMESNATIONALNATURALNCHARNEWNEXTNONONENOTNO_WRITE_TO_BINLOGNUMERICNVARCHAROFFSETOLD_PASSWORDOPENOPTIMIZEOPTIONOPTIONALLYORDEROUTEROUTFILEPACK_KEYSPARTIALPHASEPRECISIONPREPAREPREVPRIMARYPRIVILEGESPROCEDUREPROCESSPROCESSLISTPURGEQUERYQUICKREADSREALRECOVERREDUNDANTREFERENCESREGEXPRELAY_LOG_FILERELAY_LOG_POSRELAY_THREADRELEASERELOADRENAMEREPAIRREPEATABLEREPLACEREPLICATIONREPEATREQUIRERESETRESTORERESTRICTRESUMERETURNRETURNSREVOKERIGHTRLIKEROLLBACKROLLUPROUTINEROW_FORMATRTREESAVEPOINTSCHEMASCHEMASSECOND_MICROSECONDSECURITYSELECTSEPARATORSERIALSERIALIZABLESESSIONSHARESHOWSHUTDOWNSLAVESNAPSHOTSMALLINTSOMESONAMESOUNDSSPATIALSPECIFICSQLEXCEPTIONSQLSTATESQLWARNINGSQL_BIG_RESULTSQL_BUFFER_RESULTSQL_CACHESQL_CALC_FOUND_ROWSSQL_NO_CACHESQL_SMALL_RESULTSQL_THREADSQL_TSI_SECONDSQL_TSI_MINUTESQL_TSI_HOURSQL_TSI_DAYSQL_TSI_WEEKSQL_TSI_MONTHSQL_TSI_QUARTERSQL_TSI_YEARSTARTSTARTINGSTATUSSTOPSTORAGESTRAIGHT_JOINSTRIPEDSUBJECTSUPERSUSPENDTABLESTABLESPACETEMPORARYTEMPTABLETERMINATEDTHENTIMESTAMPADDTIMESTAMPDIFFTINYBLOBTINYINTTINYTEXTTRAILINGTRANSACTIONTRIGGERTRIGGERSTRUETRUNCATETYPESUNCOMMITTEDUNDEFINEDUNDOUNICODEUNIONUNIQUEUNKNOWNUNLOCKUNSIGNEDUNTILUPDATEUPGRADEUSAGEUSEUSER_RESOURCESUSE_FRMUSINGUTC_DATEUTC_TIMEUTC_TIMESTAMPVALUESVARBINARYVARCHARACTERVARIABLESVARYINGWARNINGSWHENWHEREWHILEVIEWWITHWORKX509XAYEAR_MONTHZEROFILLABSACOSADDDATEADDTIMEAES_ENCRYPTAES_DECRYPTAREAASINASBINARYASTEXTASWKBASWKTATANATAN2BENCHMARKBINBIT_COUNTBIT_ORBIT_ANDBIT_XORCASTCEILCEILINGBIT_LENGTHCENTROIDCHAR_LENGTHCHARACTER_LENGTHCOALESCECOERCIBILITYCONCAT_WSCONNECTION_IDCONVCONVERT_TZCOTCRC32CROSSESCURDATECURTIMEDATE_ADDDATEDIFFDATE_FORMATDATE_SUBDAYNAMEDAYOFMONTHDAYOFWEEKDAYOFYEARDECODEDEGREESDES_ENCRYPTDES_DECRYPTDIMENSIONELTENCODEENDPOINTENVELOPEEQUALSEXTERIORRINGEXTRACTEXPORT_SETFIELDFIND_IN_SETFLOORFROM_DAYSFROM_UNIXTIMEGET_LOCKGEOMETRYNGEOMETRYTYPEGEOMCOLLFROMTEXTGEOMCOLLFROMWKBGEOMETRYCOLLECTIONFROMTEXTGEOMETRYCOLLECTIONFROMWKBGEOMETRYFROMTEXTGEOMETRYFROMWKBGEOMFROMTEXTGEOMFROMWKBGLENGTHGREATESTGROUP_CONCATGROUP_UNIQUE_USERSIFNULLINET_ATONINET_NTOAINSTRINTERIORRINGNISCLOSEDISEMPTYISNULLIS_FREE_LOCKIS_USED_LOCKLAST_INSERT_IDISSIMPLELAST_DAYLAST_VALUELCASELEASTLNLOAD_FILELOG2LOG10LOWERLPADLTRIMMAKE_SETMAKEDATEMAKETIMEMASTER_GTID_WAITMASTER_POS_WAITMAXMBRCONTAINSMBRDISJOINTMBREQUALMBRINTERSECTSMBROVERLAPSMBRTOUCHESMBRWITHINMD5MIDMINMLINEFROMTEXTMLINEFROMWKBMPOINTFROMTEXTMPOINTFROMWKBMPOLYFROMTEXTMPOLYFROMWKBMONTHNAMEMULTILINESTRINGFROMTEXTMULTILINESTRINGFROMWKBMULTIPOINTFROMTEXTMULTIPOINTFROMWKBMULTIPOLYGONFROMTEXTMULTIPOLYGONFROMWKBNAME_CONSTNOWNULLIFNUMGEOMETRIESNUMINTERIORRINGSNUMPOINTSOCTET_LENGTHOCTPERIOD_ADDPERIOD_DIFFPIPOINTNPOSITIONPOWPOWERQUOTERADIANSRANDRELEASE_LOCKREVERSEROUNDROW_COUNTRPADRTRIMSEC_TO_TIMESESSION_USERSUBDATESIGNSHASHA1SLEEPSOUNDEXSQRTSRIDSTARTPOINTSTDSTDDEVSTDDEV_POPSTDDEV_SAMPSTR_TO_DATESTRCMPSUBSTRSUBSTRINGSUBSTRING_INDEXSUBTIMESYSDATESYSTEM_USERTIME_FORMATTIME_TO_SECTIMEDIFFTO_DAYSUCASEUNCOMPRESSUNCOMPRESSED_LENGTHUNHEXUNIX_TIMESTAMPUPPERUUIDVARIANCEVAR_POPVAR_SAMPVERSIONWEEKDAYWEEKOFYEARYEARWEEKd:t:o,/tmp/mariadb.traceJanFebMarAprMayJunJulAugSepOctNovDecSunMonTueWedThuFriSat&amp;<&lt;&gt;&quot;15.1���p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p����p����X��p��p��p��p��p��p����p��p��p��p��H��p��(��p��p����p��p����p��p��p��p��p��p��p��p��p��p��p��p��p��p������p��p��p��p��p��p��p��p��H��p��p��p��(��p��p����p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p��p�����p������p��p��p��������������p�����p��p������p��p��p��p��p��p��p��p��p��p��p��p��p������p��p��p��p�������������������R��^��j��v�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������"��.��:��F��
���=���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���F���G��G���G���G���G���G��XA���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���G���A���G���G���G��hC���G���G���G���G���G���C���C���C���G��0D��xD���G���D���G���G���G��E���G���G��0E���G���G���F���G���G���G��hE���E���G���G���G��hC���G���G���G���E���E��F��HF��pF���G��xB��C��(C��A�� B��PB���G���A��delimiter�@0C�?�C �@N@��.A�������AUTO_INCREMENT NO_DEFAULT_VALUE3.3.16-maria-utf8mb4mysql_change_user()MySQLtcpMYSQL_TCP_PORT/var/lib/mysql/mysql.sockMYSQL_UNIX_PORTMARIADB_UNIX_PORT10.6.22mysql_close()mysql_native_passwordmysql_old_password_client_name_client_version_os_server_host_pid_platformlibmariadbMYSQL_PWD5.5.5-compiled_inSetting intital databaseCan't connect to server (%d).%SHOW DATABASES LIKE '%s'SHOW TABLES LIKE '%s'KILL %luSET autocommit=1SET autocommit=0SET NAMES %smysql_reset_connection()UNKNOWN_USERLOGNAMELOGINconnection://load%s%c%scharacter_set_clientreturn-found-rowsinteractive-timeoutconnect-timeoutdisable-local-infileshared-memory-base-namemulti-resultsmulti-statementsmulti-queriesreport-data-truncationssl-fpssl-fp-listssl-fplistssl-passphraseserver-public-keybind-addressssl-enforcerestricted-authunix_socketservernamepasswdtls-fptls-fplisttls-keytls-certtls-catls-capathtls-crltls-crlpathtls-ciphertls-passphrasetls-enforcetls-verify-peerzstd-compression-levelUnknown or undefined error code (%d)Unknown or undefined error codehandshake: reading initial communication packetReceived error packet before completion of TLS handshake. The authenticity of the following error cannot be verified: %d - %s0���p���`��� �������������� ��������������������x���0���`���8��� �������`���@���������г������0���p���P���8��� ��������������������P��������������G�#����k�(\ XPTHL0123456789ABCDEF��������@�@pvio_socketSSLv3TLSv1.0TLSv1.1TLSv1.2TLSv1.3UnknownFingerprint verification of server certificate failednonezlibzstdBulk operationIM001LT��U���T���T���T���T��DU��,T���T���T��,T��,T��,T���T��Unknown errorrbLoad data local infile forbidden ���P������������������ ���������� �������������������������������������X�������ܜ������D���̝����������������������������������������������L�����ԡ����������������������4��������\�������l���4���4�������4���4���4���4������@B��'�d
@B��'�d
%04u-%02u-%02u%s%02u:%02u:%02u.%0*u%s%02u:%02u:%02u%04u-%02u-%02u %02u:%02u:%02u%04u-%02u-%02u %02u:%02u:%02u.%0*u�����K�?_}��7y�ACn����F��?�O8M20�Hw�Z<�s�Ou�?$@Y@@�@��@j�@��.A�cA�חAe��A _�B�vH7B��mB@�0�B�ļ�B4&�kC��7y�AC�؅W4vC�Ngm��C=�`�X�C@��x�DP����KD��M��D0000000000000000�?aCoc���?��`�(��?�y�PD�?<�s�Ou��7y�ACn����F��?�O8M20�Hw�Z$@@@�?Unknown client plugin typeOut of memorynot initialized/usr/lib64/mysql/plugininvalid plugin nameit is already loadedtype mismatchnot a pluginname mismatchMARIADB_PLUGIN_DIR%s/%s%s.so()[]!@#$%^&/*;.,'?\LIBMYSQL_PLUGINSinvalid typeIncompatible client plugin interface_mysql_client_plugin_declaration_efdghTLS/SSL error: %s (%d)  Invalid (empty) hostnameFinger print buffer too smallUnable to get server certificateValidation of SSL server certificate failedinvalid finger print of server certificatereading authorization packetdummy_fallback_authDummy fallback pluginLGPLR.J.Silk, Sergei GolubchikNative MySQL authenticationSSL is required, but the server does not support itsending connection information to serversending authentication informationSergei Golubchik, R.J. Silk, Georg RichterOld (pre 4.1) authentication pluginGeorg Richterzlib compresson pluginMariaDB virtual IO plugin for socket communication����ޏ��׏������latin1utf8mb3utf8US-ASCIIasciiBig5big5BIG5CP866IBM 866cp866IBM-1252Catalan Spaincp1252CP1252ISCII-DEVHindiISO-8859-1ISO_8859-1ISO8859-1ISO88591ISO-8859-13latin7ISO_8859-13ISO8859-13ISO885913ISO-8859-15latin9ISO_8859-15ISO8859-15ISO885915ISO-8859-2latin2ISO_8859-2ISO8859-2ISO88592ISO-8859-7greekISO_8859-7ISO8859-7ISO88597ISO-8859-8hebrewISO_8859-8ISO8859-8ISO88598ISO-8859-9latin5ISO_8859-9ISO8859-9ISO88599ISO-8859-4ISO_8859-4ISO8859-4ISO88594ISO-8859-5ISO_8859-5ISO8859-5ISO88595KOI8-Rkoi8rKOI8RKOI8-Ukoi8uKOI8Ukoi8tKOI8-TSJISSHIFT_JISsjisShift-JISansi1251Cyrilliccp1251CP1251armscii8ArmenianASMSCII-8armscii-8big5hkscsBig5-HKSCScp1255HebrewCP1255eucCNGB-2312gb2312GB2312eucJPUJISujiseucKREUC-KReuckrEUCKReuctwEUC-TWgb18030GB 18030-2000GB18030gbkGBKgeorgianpsGeorgiangeostd8GEORGIAN-PSUTF8UTF-8utf-8icelandiclatvianromanianslovenianpolishestonianspanishswedishturkishczechdanishlithuanianslovakspanish2persianesperantohungariansinhalagerman2vietnamesecroatianbig5_chinese_cidec8dec8_swedish_cicp850cp850_general_ciCP850hp8hp8_english_ciHP-ROMAN8koi8r_general_cilatin1_swedish_ciLATIN1latin2_general_ciLATIN2swe7swe7_swedish_ciascii_general_ciujis_japanese_cisjis_japanese_cihebrew_general_ciHEBREWtis620tis620_thai_ciTIS620euckr_korean_cikoi8u_general_cigb2312_chinese_cigreek_general_ciGREEKcp1250cp1250_general_ciCP1250gbk_chinese_cilatin5_turkish_ciLATIN5armscii8_general_ciARMSCII-8utf8mb3_general_ciucs2ucs2_general_ciUCS-2BEcp866_general_cikeybcs2keybcs2_general_cimaccemacce_general_ciCP1282macromanmacroman_general_ciMACINTOSHcp852cp852_general_ciCP852latin7_general_ciLATIN7cp1251_general_cicp1256cp1256_general_ciCP1256cp1257cp1257_general_ciCP1257binaryarmscii8_bingeostd8_general_cicp932cp932_japanese_ciCP932eucjpmseucjpms_japanese_ciEUC-JP-MSlatin2_czech_cslatin1_german1_cicp1251_bulgarian_cilatin1_danish_cifilenamelatin7_estonian_cslatin2_hungarian_cicp1251_ukrainian_cilatin2_croatian_cicp1257_lithuanian_cilatin1_german2_cicp1250_czech_cslatin7_general_csmacce_bincp1250_croatian_ciutf8mb4_general_ciutf8mb4_binlatin1_binlatin1_general_cilatin1_general_cscp1251_bincp1251_general_csmacroman_binutf16utf16_general_ciUTF16utf16_binutf16leUTF16LEcp1257_binutf32utf32_general_ciUTF32utf32_binascii_bincp1250_bincp1256_bincp866_bindec8_bingreek_binhebrew_binhp8_binHPROMAN-8keybcs2_binkoi8r_binkoi8u_binutf8mb3_tolower_cilatin2_binlatin5_binlatin7_bincp850_bincp852_binswe7_bingeostd8_binutf8mb3_binbig5_bineuckr_bingb2312_bingbk_binsjis_bintis620_binucs2_binujis_binlatin1_spanish_cicp932_bincp1250_polish_cieucjpms_binEUCJP-MSutf16_unicode_ciutf16_icelandic_ciutf16_latvian_ciutf16_romanian_ciutf16_slovenian_ciutf16_polish_ciutf16_estonian_ciutf16_spanish_ciutf16_swedish_ciutf16_turkish_ciutf16_czech_ciutf16_danish_ciutf16_lithunian_ciutf16_slovak_ciutf16_spanish2_ciutf16_roman_ciutf16_persian_ciutf16_esperanto_ciutf16_sinhala_ciutf16_german2_ciutf16_croatian_mysql561_ciutf16_unicode_520_ciutf16_vietnamese_ciucs2_unicode_ciucs2_icelandic_ciucs2_latvian_ciucs2_romanian_ciUCS2-BEucs2_slovenian_ciucs2_polish_ciucs2_estonian_ciucs2_spanish_ciucs2_swedish_ciucs2_turkish_ciucs2_czech_ciucs2_danish_ciucs2_lithuanian_ciucs2_slovak_ciucs2_spanish2_ciucs2_roman_ciucs2_persian_ciucs2_esperanto_ciucs2_hungarian_ciucs2_sinhala_ciucs2_german2_ciucs2_croatian_ciucs2_unicode_520_ciucs2_vietnamese_ciucs2_general_mysql500_ciutf32_unicode_ciutf32_icelandic_ciutf32_latvian_ciutf32_romanian_ciutf32_slovenian_ciutf32_polish_ciutf32_estonian_ciutf32_spanish_ciutf32_swedish_ciutf32_turkish_ciutf32_czech_ciutf32_danish_ciutf32_lithuanian_ciutf32_slovak_ciutf32_roman_ciutf32_persian_ciutf32_esperanto_ciutf32_hungarian_ciutf32_sinhala_ciutf32_german2_ciutf32_croatian_mysql561_ciutf32_unicode_520_ciutf32_vietnamese_ciutf8mb3_icelandic_ciutf8mb3_latvian_ciutf8mb3_romanian_ciutf8mb3_slovenian_ciutf8mb3_polish_ciutf8mb3_estonian_ciutf8mb3_spanish_ciutf8mb3_swedish_ciutf8mb3_turkish_ciutf8mb3_czech_ciutf8mb3_danish_ciutf8mb3_lithuanian_ciutf8mb3_slovak_ciutf8mb3_spanish2_ciutf8mb3_roman_ciutf8mb3_persian_ciutf8mb3_esperanto_ciutf8mb3_hungarian_ciutf8mb3_sinhala_ciutf8mb3_german2_ciutf8mb3_unicode_520_ciutf8mb3_vietnamese_ciutf8mb3_croatian_ciutf8mb3_general_mysql500_ciutf8mb4_unicode_ciutf8mb4_icelandic_ciutf8mb4_latvian_ciutf8mb4_romanian_ciutf8mb4_slovenian_ciutf8mb4_polish_ciutf8mb4_estonian_ciutf8mb4_spanish_ciutf8mb4_swedish_ciutf8mb4_turkish_ciutf8mb4_czech_ciutf8mb4_danish_ciutf8mb4_lithuanian_ciutf8mb4_slovak_ciutf8mb4_spanish2_ciutf8mb4_roman_ciutf8mb4_persian_ciutf8mb4_esperanto_ciutf8mb4_hungarian_ciutf8mb4_sinhala_ciutf8mb4_german2_ciutf8mb4_croatian_mysql561_ciutf8mb4_unicode_520_ciutf8mb4_vietnamese_cigb18030_chinese_cigb18030_bingb18030_unicode_520_ciutf8mb3_general_csutf8mb4_0900_ai_ciutf8mb4_de_pb_0900_ai_ciutf8mb4_is_0900_ai_ciutf8mb4_lv_0900_ai_ciutf8mb4_ro_0900_ai_ciutf8mb4_sl_0900_ai_ciutf8mb4_pl_0900_ai_ciutf8mb4_et_0900_ai_ciutf8mb4_es_0900_ai_ciutf8mb4_sv_0900_ai_ciutf8mb4_tr_0900_ai_ciutf8mb4_cs_0900_ai_ciutf8mb4_da_0900_ai_ciutf8mb4_lt_0900_ai_ciutf8mb4_sk_0900_ai_ciutf8mb4_es_trad_0900_ai_ciutf8mb4_la_0900_ai_ciutf8mb4_eo_0900_ai_ciutf8mb4_hu_0900_ai_ciutf8mb4_hr_0900_ai_ciutf8mb4_vi_0900_ai_ciutf8mb4_0900_as_csutf8mb4_de_pb__0900_as_csutf8mb4_is_0900_as_csutf8mb4_lv_0900_as_csutf8mb4_ro_0900_as_csutf8mb4_sl_0900_as_csutf8mb4_pl_0900_as_csutf8mb4_et_0900_as_csutf8mb4_es_0900_as_csutf8mb4_sv_0900_as_csutf8mb4_tr_0900_as_csutf8mb4_cs_0900_as_csutf8mb4_da_0900_as_csutf8mb4_lt_0900_as_csutf8mb4_sk_0900_as_csutf8mb4_es_trad_0900_as_csutf8mb4_la_0900_as_csutf8mb4_eo_0900_as_csutf8mb4_hu_0900_as_csutf8mb4_hr_0900_as_csutf8mb4_vi_0900_as_csutf8mb4_ja_0900_as_csutf8mb4_ja_0900_as_cs_ksutf8mb4_0900_as_ciutf8mb4_ru_0900_as_ciutf8mb4_ru_0900_as_csutf8mb3_myanmar_ciutf8mb3_thai_520_w2utf8mb4_croatian_ciutf8mb4_myanmar_ciutf8mb4_thai_520_w2ucs2_myanmar_ciucs2_thai_520_w2utf16_croatian_ciutf16_myanmar_ciutf16_thai_520_w2utf32_croatian_ciutf32_myanmar_ciutf32_thai_520_w2big5_chinese_nopad_cidec8_swedisch_nopad_cicp850_general_nopad_cihp8_english_nopad_cikoi8r_general_nopad_cilatin1_swedish_nopad_cilatin2_general_nopad_ciswe7_swedish_nopad_ciascii_general_nopad_ciujis_japanese_nopad_cisjis_japanese_nopad_cihebrew_general_nopad_citis620_thai_nopad_cieuckr_korean_nopad_cikoi8u_general_nopad_cigb2312_chinese_nopad_cigreek_general_nopad_cicp1250_general_nopad_cigbk_chinese_nopad_cilatin5_turkish_nopad_ciarmscii8_general_nopad_ciutf8mb3_general_nopad_ciucs2_general_nopad_cicp866_general_nopad_cikeybcs2_general_nopad_cimacce_general_nopad_cimacroman_general_nopad_cicp852_general_nopad_cilatin7_general_nopad_cimacce_nopad_binutf8mb4_general_nopad_ciutf8mb4_general_nopad_binlatin1_nopad_bincp1251_nopad_bincp1251_general_nopad_cimacroman_nopad_binutf16_general_nopad_ciutf16_nopad_binutf16le_general_nopad_cicp1256_general_nopad_cicp1257_nopad_bincp1257_general_nopad_ciutf32_general_nopad_ciutf32_nopad_binutf16le_nopad_binarmscii8_nopad_binascii_nopad_bincp1250_nopad_bincp1256_nopad_bincp866_nopad_bindec8_nopad_bingreek_nopad_binhebrew_nopad_binhp8_nopad_binkeybcs2_nopad_binkoi8r_nopad_binkoi8u_nopad_binlatin2_nopad_binlatin5_nopad_binlatin7_nopad_bincp850_nopad_bincp852_nopad_binswe7_nopad_binutf8mb3_nopad_binbig5_nopad_bineuckr_nopad_bingb2312_nopad_bingbk_nopad_binsjis_nopad_bintis620_nopad_binucs2_nopad_binujis_nopad_bingeostd8_general_nopad_cigeostd8_nopad_bincp932_japanese_nopad_cicp932_nopad_bineucjpms_japanese_nopad_cieucjpms_nopad_binutf16_unicode_nopad_ciutf16_unicode_520_nopad_ciucs2_unicode_nopad_ciucs2_unicode_520_nopad_ciutf32_unicode_nopad_ciutf32_unicode_520_nopad_ciutf8mb3_unicode_nopad_ciutf8mb3_unicode_520_nopad_ciutf8mb4_unicode_nopad_ciutf8mb4_unicode_520_nopad_ciChinese for Taiwan Multi-byte set/etc/etc/mysqlMARIADB_HOMEMYSQL_HOMEincludedirinclude%s%cmy.%s%s%c.my.%sCreating an event failed (Errorcode: %d)Bind to local interface '-.%64s' failed (Errorcode: %d)Connection type doesn't support asynchronous IO operationsServer doesn't support function '%s'File '%s' not found (Errcode: %d)Error reading file '%s' (Errcode: %d)Bulk operation without parameters is not supportedUnsupported version %d. Supported versions are in the range %d - %dInvalid or missing parameter '%s'.Authentication plugin '%s' couldn't be found in restricted_auth plugin list.Parse error in connection string (offset %d)Error while loading plugin '%s'Error while uncompressing packetError while retrieving parameter from callback functionError while uncompressing packet (File: %.*s start_pos=%ld).Checksum verification failed (File: %.*s start_pos=%ld). Reported checksum is %x, while calculated checksum is %x.Binary log protocol error (File: %.*s start_pos=%ld): Log format %d not supported.Binary log error (File: %.*s start_pos=%ld): Unknown event type (%d) with flag 'not_ignorable'.Binary log error (File: %.*s start_pos=%ld): %s.File '%s' is not a binary log fileInvalid client flags (%lu) specified. Supported flags: %luServer returned an error packet without further informationCan't connect to local server through socket '%-.64s' (%d)Can't connect to server on '%-.64s' (%d)Can't create TCP/IP socket (%d)Unknown server host '%-.100s' (%d)Protocol mismatch. Server Version = %d Client Version = %dLost connection to server during queryCommands out of sync; you can't run this command nowCan't wait for named pipe to host: %-.64s  pipe: %-.32s (%lu)Can't open named pipe to host: %-.64s  pipe: %-.32s (%lu)Can't set state of named pipe to host: %-.64s  pipe: %-.32s (%lu)Can't initialize character set %-.64s (path: %-.64s)Got packet bigger than 'max_allowed_packet'No data supplied for parameters in prepared statementInvalid buffer type: %d (parameter: %d)Shared memory connection failed during %s. (%lu)Connection with old authentication protocol refused.Prepared statement contains no metadataThis feature is not implemented or disabledLost connection to server at '%s', system error: %dServer closed statement due to a prior %s function callThe number of parameters in bound buffers differs from number of columns in resultsetCan't connect twice. Already connectedPlugin %s could not be loaded: %sAn attribute with same name already existsPlugin doesn't support this functionInvalid statement handleRead error: %s (%d)Write error: %s (%d)Semi sync request error: %sCan't create UNIX socket (%d)Server has gone awayClient run out of memoryWrong host infoLocalhost via UNIX socket%-.64s via TCP/IPError in server handshake%-.64s via named pipeTLS/SSL error: %sReceived malformed packetStatement is not preparedData truncatedInvalid parameter numberBuffer type is not supportedShared memory: %-.64sWrong or unknown protocolHY000%08lx%08lx�����A?@P@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ��������#Eg����ܺ�vT2/builddir/build/BUILD/cl-MariaDB106-10.6.22/mariadb-10.6.22/mysys/charset.cError while parsing '%s': %s
/usr/share/mysqlcharsets//usrutf8_utf8mb%c_%s.xml[import 646ANSI_X3.4-1968euc-CNeuc-JPeuc-KRgeorgian-psiso88591iso885913iso88592iso88597iso88598iso88599roman8Shift_JISshiftjisx0213tis-620~/--no-defaults--defaults-file=--defaults-extra-file=--defaults-group-suffix=--print-defaultsMYSQL_GROUP_SUFFIX.cnf----file-marker----Warning: World-writable config file '%s' is ignored
/builddir/build/BUILD/cl-MariaDB106-10.6.22/mariadb-10.6.22/mysys/my_default.cWarning: skipping '%s' directive as maximum includerecursion level was reached in file %s at line %d
error: Wrong '!%s' directive in config file: %s at line %d
error: Wrong group definition in config file: %s at line %d
error: Found option without preceding group in config file: %s at line: %d
Could not open required defaults file: %s
Fatal error in defaults handling. Program aborted
%s would have been started with the following arguments:

Default options are read from the following files in the given order:Internal error initializing default directories listThe following groups are read:
The following options may be given as the first argument:
--print-defaults          Print the program argument list and exit.
--no-defaults             Don't read default options from any option file.
The following specify which files/extra groups are read (specified before remaining options):
--defaults-file=#         Only read default options from the given file #.
--defaults-extra-file=#   Read this file after the global files are read.
--defaults-group-suffix=# Additionally read default groups with # appended as a suffix.includeincludedirEnter password: /builddir/build/BUILD/cl-MariaDB106-10.6.22/mariadb-10.6.22/mysys/mf_iocache.c/tmptmp.TMPDIR%s/#sql/fd=%dO_TMPFILE is not supported on %s (disabling future attempts)..Unknown error %dWarning: Info: truefalseoffskip%s: unknown variable '%s'%s: unknown option '--%s'%s: unknown option '-%c', . One of: . Any combination of:   -%c%s%s=name%s %s=#%s  to disable.)%s,(No default value)%-*s%s%s%s=%u
%ld
%g
(Disabled)disableenablemaximumlooseautosetoption '%s': boolean value '%s' wasn't recognized. Set to OFF.Using unique option prefix '%.*s' is error-prone and can break in the future. Please use the full name '%s' instead.option '%s': signed value %s adjusted to %sInteger value out of range for int64: '%s' for %sUnknown suffix '%c' used for variable '%s' (value '%s'). Legal suffix characters are: K, M, G, T, P, Eoption '%s': unsigned value %s adjusted to %sIncorrect unsigned value: '%s' for %sInteger value out of range for uint64: '%s' for %soption '%s': value %g adjusted to %g%s: Maximum value of '%s' cannot be setInvalid decimal value for option '%s'
%s: Error while setting value '%s' to '%s'%s: ambiguous option '--%s-%s' (--%s-%s)%s: variable prefix '%s' is not unique%s: ambiguous option '--%s' (%s, %s)%s: %s: Option '%s' used, but is disabled
%s: option '--%s' cannot take an argument%s: ignoring option '--%s' due to invalid value '%s'%s: automatically set option '--%s' cannot take an argument%s: automatic setup request is unsupported by option '--%s'%s: option '--%s' requires an argument%s: ERROR: Option '-%c' used, but is disabled
%s: option '-%c' requires an argument (Automatically configured unless set explicitly). Takes a comma-separated list of option=value pairs, where value is on, off, or default, and options are: %*s(Defaults to on; use --skip-  Use 'ALL' to set all combinations.
Variables (--variable-name=value)Value (after reading options)
and boolean options {FALSE|TRUE}@V��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��PV��pV��`V��pV��pV��pV���U��pV��V��pV��pV�� V��pV��pV��pV��0V��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��pV��PV��pV��`V��pV��pV��pV���U��pV��V��pV��pV�� V��pV��pV��pV��0V���V���V���V���V��W���V���V���V���V���V��lV���V���V���V��lW���V��,W��X��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX���X��PX���X��PX��PX��PX���X��PX���X��PX��PX��X��PX��PX��PX���X��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX��PX���X��PX���X��PX��PX��PX���X��PX���X��PX��PX��X��PX��PX��PX���X���X���X��$Z��Z���Z��tY��Y��tY��Y���Z���Z���X���Y��TX��[���Y��<Z��z��!x��2x��Rx��mx���x���x���x���x���x���x��z��y��2y��Oy��oy���w��UMASKUMASK_DIRmysysstatement_timerSAFE_HASH::mutexCOND_alarmCOND_timerIO_CACHE_SHARE::condIO_CACHE_SHARE::cond_writermy_thread_var::suspendTHR_COND_threadsWT_RESOURCE::condBITMAP::mutexIO_CACHE::append_buffer_lockIO_CACHE::SHARE_mutexKEY_CACHE::cache_lockLOCK_alarmLOCK_timermy_thread_var::mutexTHR_LOCK_charsetTHR_LOCK_heapTHR_LOCK_lockTHR_LOCK_mallocTHR_LOCK::mutexTHR_LOCK_myisamTHR_LOCK_netTHR_LOCK_openTHR_LOCK_threadsTMPDIR_mutexTHR_LOCK_myisam_mmapLOCK_uuid_generatorWaiting for table level lock
User time %.2f, System time %.2f
Maximum resident set size %ld, Integral resident set size %ld
Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld
Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld
Voluntary context switches %ld, Involuntary context switches %ld
��������������������Y@TCPSOCKETPIPE01230120022455012623010202.no_name/builddir/build/BUILD/cl-MariaDB106-10.6.22/mariadb-10.6.22/mysys/my_thr_init.cCan't initialize threads: error %d
Error in my_thread_global_end(): %d threads didn't exit
No option given to %s
Unknown option to %s: %s
Alternatives are: '%s','%s'defaultRetry in %d secs. Message reprinted in %d secsCan't create/write to file '%s' (Errcode: %M)Error reading file '%s' (Errcode: %M)Error writing file '%s' (Errcode: %M)Error on close of '%s' (Errcode: %M)Out of memory (Needed %u bytes)Error on delete of '%s' (Errcode: %M)Error on rename of '%s' to '%s' (Errcode: %M)Unexpected end-of-file found when reading file '%s' (Errcode: %M)Can't unlock file (Errcode: %M)Can't read dir of '%s' (Errcode: %M)Can't get stat of '%s' (Errcode: %M)Can't change size of file (Errcode: %M)Can't open stream from handle (Errcode: %M)Can't get working directory (Errcode: %M)Can't change dir to '%s' (Errcode: %M)Warning: %d files and %d streams is left open
Disk is full writing '%s' (Errcode: %M). Waiting for someone to free space... (Expect up to %d secs delay for server to continue after freeing disk space)Can't create directory '%s' (Errcode: %M)Character set '%s' is not a compiled character set and is not specified in the '%s' fileOut of resources when opening file '%s' (Errcode: %M)Can't read value for symlink '%s' (Errcode: %M)Can't create symlink '%s' pointing at '%s' (Errcode: %M)Error on realpath() on '%s' (Errcode: %M)Can't sync file '%s' to disk (Errcode: %M)Collation '%s' is not a compiled collation and is not specified in the '%s' fileFile '%s' not found (Errcode: %M)File '%s' (fileno: %d) was not closedCan't change ownership of the file '%s' (Errcode: %M)Can't change permissions of the file '%s' (Errcode: %M)Can't seek in file '%s' (Errcode: %M)Can't change mode for file '%s' to 0x%lx (Errcode: %M)Warning: Can't copy ownership for file '%s' (Errcode: %M)Failed to release memory pointer %p, %zu bytes (Errcode: %M)Lock Pages in memory access rights requiredWarning: Charset id '%d' csname '%s' trying to replace existing csname '%s'Can't lock file (Errcode: %M)Warning: '%s' had %d linksMemcntl %s cmd %s errorUNOPENEDOAOBOCODOHOFabortaccept-linearrow-key-prefixbackward-bytebackward-charbackward-kill-linebackward-kill-wordbeginning-of-historybeginning-of-linecall-last-kbd-macrocapitalize-wordcharacter-searchcharacter-search-backwardclear-screencopy-backward-wordcopy-forward-wordcopy-region-as-killdelete-char-or-listdelete-horizontal-spacedigit-argumentdo-lowercase-versiondowncase-worddump-functionsdump-macrosdump-variablesemacs-editing-modeend-kbd-macroend-of-historyend-of-lineexchange-point-and-markforward-backward-delete-charforward-byteforward-charforward-search-historyhistory-search-backwardhistory-search-forwardinsert-commentinsert-completionskill-whole-linekill-regionmenu-completenext-historyoverwrite-modepossible-completionsprevious-historyquoted-insertre-read-init-fileredraw-current-linereverse-search-historyrevert-lineself-insertstart-kbd-macrotab-inserttranspose-charstranspose-wordstty-statusundouniversal-argumentunix-filename-ruboutunix-line-discardunix-word-ruboutupcase-wordyankyank-last-argyank-nth-argyank-popvi-append-eolvi-append-modevi-arg-digitvi-back-to-indentvi-bWordvi-bwordvi-change-casevi-change-charvi-change-tovi-char-searchvi-columnvi-completevi-deletevi-delete-tovi-eWordvi-editing-modevi-end-wordvi-eof-maybevi-ewordvi-fWordvi-fetch-historyvi-first-printvi-fwordvi-goto-markvi-insert-begvi-insertion-modevi-matchvi-movement-modevi-next-wordvi-overstrikevi-overstrike-deletevi-prev-wordvi-putvi-redovi-replacevi-ruboutvi-searchvi-search-againvi-set-markvi-substvi-tilde-expandvi-yank-argvi-yank-tonon-incremental-forward-search-historynon-incremental-reverse-search-historynon-incremental-forward-search-history-againnon-incremental-reverse-search-history-again_*\AaIiCcDdPpYyRrSsXx~ hl^$0ftFT;,%wbeWBE| l|h^0bB l|hwW^0bB l|h^0%bB--More--"' 	
"\'`@$><=;|&{(Display all %d possibilities? (y or n)
readline: bad value %d for what_to_do in rl_complete
"%s%s": "%s"
%s%s outputs %s
audiblevisibleterm=mode=emacs$endif without matching $ifreadline: %s: line %d: %s
readline: %s
C-\M-bind-tty-special-charsbell-styleblink-matching-parenprefer-visible-bellDELunknown parser directiveno closing `"' in key bindingprefix-meta/etc/inputrcINPUTRC~/.inputrcvi-insertemacs-metaemacs-ctlx#comment-begincompletion-query-itemsisearch-terminatorskeymap\C-%c# %s (not bound)
"%s": %s
%s is not bound to any keys
%s can be found on "%s"%s...
%s is set to `%s'
set %s %s
emacs-standardvi-movevi-commandEscapeLFDNewlineRETReturnRuboutSPCSpaceTabbyte-orientedcompletion-ignore-caseconvert-metadisable-completionenable-keypadexpand-tildehistory-preserve-pointhorizontal-scroll-modeinput-metamark-directoriesmark-modified-linesmark-symlinked-directoriesmatch-hidden-filesmeta-flagoutput-metapage-completionsshow-all-if-ambiguousshow-all-if-unmodifiedvisible-statsendifelseotherMetaControl-C-CTRL-$else found without matching $ifprint-completions-horizontally8���8���8���8���8���8���8���8���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������؀������������������������������������������������������8��������������X���
�������G�������������\%oreadline: debug: insert_some_chars: count (%d) != col (%d)
/-_=~.#$readline: readline_callback_read_char() called with no handler!
colidumbxnkmMTWrite failed
@7DCclcrdceiimkDkHkIkdkhklkummmopcupvbvs%s: out of virtual memory
xmallocxreallocX%lu()
<>;&|$"'`:$*%^ 	
;&()|<> 	

=�l���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���n���l���n���n���n���n���n���n���n���n���n���n��pn���n��hl���l��l���n���n���n��k��event not foundbad word specifiunrecognized hisno previous subssubstitution faiLC_ALLLC_CTYPELANGPOSIX ~	~(arg: %d) J�W�Y�[�_�`�c�d�g�h�k�l�o�p�s�t�w�x�{�|�ơǡʡˡȡɡ\�M�O�Q�R�S�T�}�~���������̡͡Ρޡߡ���L�M�N�I���C�H���]�^���ϡA�СD�A���������������������G�F�աס֡H�I�ϢТѢҢӢԢբ֢עآ٢ڢۢܢݢޢߢ���������B�ġ������������������������������@�A�B�C�a�U�b�N�΢J���D�xܥ�v�����{�E�Fج�}�z�yܣ�|�{�~�����{�h���������һջ׻ֻӻԻ���[�����\�M�K���I�J�F�F�N�H�L����������������G���n�l�m������w�x��E�G�F���P�m�l�k�����X��V�Y�W�����¨�˿��˭�����������������@�����Ю��������Э�����������EԢ���F�~�|�}�����Iص�H�Kر�Jث�������������Gا�}����ܬ�����|�~ܡܤ�������������j�k���i�ػڻٻ�������G�H�O�I��������o����A���G�Lض����ܦܯ���������n�o�m�ۻl���ܻ��P�J���p�t��q���u��s�y����B��������ܧܳ���s�p���r���q�����ݻ��]���^�_���`�Q�N�K�P�S�L�R�O�M�����������w�v��x�~��}�z��{�|�H�I���S�n�Q�R�o��ŵ�q�E��G���F�W���C�t�����Q�R�D�a��ñ�S��Ų�M�����������u�v���������޻���������������߻����c�b���d�V�U�T�T����A�@�������}���{�~�|�y�@�z������J�K�p�����O�P�H��i�������������C�B������ä���q�r����W�D����X�Aç��L�M�T�Q�������Nص����ܷ�z�|�������w�x�{�y�������g������e�[������f�Y�Z�U�[�Y�X�V�Z�W�E�J�F�I���H�G�D�B�E�Cè���F���@Ĩ�Aħ���Q�N�O�P�r�V�U�t�s�����I�`�X����������������仾�h�����Gí�BĬ���u�R�S���t�s�u���������H�O���������������~������}���������������i��\���k�j���������l�a�_�^�]�`�\�K�^�]�_�N�L�M�R�K�Q�T�S�P�O�������J�H�I�����C����D�X�W�U�T�����Y�v���w�W�v�V�w���a�Y�����P�Uﻭ����`�W�V�Lò���������������ह�ࣹ�������������������������������n�q�s�����r�������t�p���m�o�c�f�d�c�i�h�g�b�b�a�e�d�Z�^�[�]�\�Y�_�b�`�a�@���X�c�����������Mï������E�FĴ��������������`�^���]�c�a���\�Z�[���_���b�x�~�y�[š�Z�}�|�Y�{�X�z�}���~�{���x�|�����y�z���R���S������J�v�j���kƴ�����z��������������l�u�e�j�m�f�d�k��N��f�d�e���\Ť��ż������b�����I������������h�v�w�������n�q�p�o�g�h�f�e�g�Oü��P���������G���g�i�h�������������T�U�V�K�cƶ���x�i������J�{Ƭ�r�������������������z�y���i������S�R�Q�^Ũ�]ũ���L����������������������|�����������{�}�x�v��w�s�y�t�r�u��|�j�{�z�~�j�m�l�t�o�s�q�p�n�k�C�B�D�A�u�������������X�����������W�U�T�������J�������K�����������������I�H���������l�o�V�m�s�q�k�v�j���r�n���u�t�����������`���������_��Ŵ������������ű����Ŭ�p�����������Z�\�_�[�`�Y�W���]�����X�^��M������Z�\�[�y�x�w�z�s�t����������������������������������������������}�����~���o���k�����p��������l���m�n�����z�{�~�|�v�y��}�E����F¦�w�������������Y���������������������Z���[�M�x�����O���P�������N�����������������������������������L�������}�{�������|�x���~���z���w���������y��������������a����bŽ�����dſ�������������cŻ������������������������������������������i�n�d�g���k�r���e�o�s�j�c�m�l�q�p��h�b�f�N�O�a�������������]�^�`�_�b�a�|�{������x�|��}������P�Q���������������G��������Q�S���R��������e����c�������������T�����³�����t�����d����H�u�¶��r����q���L�J�K�I���\��������������f��v�w���d�}�u��ܶ�����������x�R�e�~��������쪹]����g���y������������������^���ĸ�������|�{�z����M�����}��f�����N�����~������������hŽ����Ļ�������i�j��������������T����S�g�j�i�h��s�eÿ������t������@�B�C�E�V�T�W�U�Fɣ�O�Mɢ���B�A�@�C�����èX���P���c�ꦱ�Y���D�d�@�D�[�G�\���E�G�F���Ĩ��A�A�E�^�]��Ũ��K�ö�ܲ�F���ƨG�H�_�����Qɭ����ǨȨE�`�������ɨʨF�G������H�����Rɱ�������T�Sɵ�����J�K�L�M�I�P�j�f�i�Q�a�h�N�O�H�e�g�������ɮ������饱�����ɶ����������ɸɯ�����������f�B��g��D�����[����`�h�d������G�]����C�����b�^���Z��e�E�H��@�F��c�A�i�\��_�a�ب����Ш��˨ըΨ��֨�˼����ި٨�˵�ۨϨ������Ԩ�˴�Ө��ר��Ҩͨܨ��ݨ������ڨ�˲���Ѩ��̨��V�J�����I�Q�]�������K�����Y�P�X�������T�����[�N�W�M�������U�R���Z�����O�\�S�L�H���׭��ѭ֭��������ĭͭڭέ��ǭ��ܭӭ�����п�̭˭��ϭ[�ƭ��խԭʭ������ɭ��ҭ���í­��Эŭ٭ۭ��ح������������ȭc�W���\�bԲ�UԶ�Y�RԴ�VԹ���g�Q���f���XԱ�S�O�]�P�N�Z�`�aԷ�[�^�M�_���d��L�T�eԼ�����������ȳ^�W�ų_�U�X�ijY�dz]�S�R�ɳʳƳ˳Q�\�Z�T�óV�ʶĶ��Ͷ���ƶǶ��Ŷ��˶����̶��ɶ���ܼ���ȶ��ζ���ܹ�����������ಹ��������������ஹ�ହ�෹���హ����൹�������������������������������������觾�詾���訾����v���w���������u�������x�_������������l�k��I�a�����S�R���������J�I�K��ߨ�^�Y���Z�°\�[�`�]���^�J������K�������@�L����ݭ��N�T�U�A�j�`�_�����ð��U���a��ޭ߭��V�B���M�N�k��������������������h�a���@�������L�Z�İͳ��Bɿ�Y�W�X��M�N�b�����¤��Z�k�F���D�E���G�C�l��m�n�P�O�S�Q�R�����������������c�����h���d�g�f�e�b��������������������ѳŰi�k�j�l�ưγϳгж��������Ѷ϶A�Bỹ��Z�@�A�B�D�����C����������O�\�[�H���U�V�T�W�o�p�������l���k�i�j���ǰn�ʰm��ɰȰԳӳҳҶնֶԶӶC�D���E�������y���U�c�äV�ĤŤ]�^�I�q�����m���̰˰c�b�P�Ƥ_�ͰC�l�`���K�J���X��o�׶EἹ����Ǥ����аΰϰQ�d�͢ʤɤȤc�b�m��������n�ճR�ˤe�d�r���W�g�f�L�M�s�Y�Z�������o����D�̤��t�u����������p�p�����d�ֳe�FόF���X�h�ѰS�e�ΤͤϤ������q����O�f�j�y�t�o�n�u�s�l�z�m�i�x�w�v�k�r�q�{�p�S�Y�U�[���X�N�Q�T�P�W�Z�O�R�V�\�~�{�g�|�[�]�u�p���}�_�a���h�x�t�v�\�m�v�s�d�n�o�w�l�j�k�q���^�r���f�c�z�b���e�i�`���y�����O�����������P�������I�K�M�����L�E�A���D�I�R�����C�����F�H�����Q�M���S�J���G�B�@���N�H��K���x���t���}���r���CΣ�OΥ�y�E�B�w��ͦ�J�|�LΩ�s�~�{�@Ρ�F�G�z���v�u���D�N�D�������@������������������B�C���A��C����F����B����@�Gѡ�E�D�������������A�w�䰧��߰|�۰���v�{�z��ᰥ���s�����ְٰ~�Ӱ��ڰ��tԤ�ݰu�x�}�ްܰ��װұذy��ణ�հ԰q�r�j�׳ڳu��x�سq�޳䳽��n��۳�v���{�o�f�s�m��y�ݳ��߳ܳ�z�l�r�t�h�w�ٳg����i�����p��������������޶�����������ܶ����߶��ڶ�����������ݶ��ض������۶_�ٶ�����͹ȹU�Q�K�¹��TΌN�P�S�Ĺ˹ŹI�ƹǹL�̹J�O�ùH�ɹ����M�R�ʹG�M�G�D�G�S�T�J�B�L���R�F�I�H�H�C�E�K�A���k��������O�N�P��䲾@�E�����B鶾��A�����������C�輾�軾D�@�Q���F鷾������{���������}���~�����z���|���P���������`�����V��������Q���A�Y�@�X�W�Z������������m�o�n���Ŧ������I�}�|�_�^���]���y�����w�z���x�����T���H�I�E�F����밫��|������ϹιI�H�G�k�g�Y�n�o�b�f���d�c���e�a�`�������}���������{��ʬ�~�������|���Y���[�Z�@�X�W���������������V���\�A�����U���T�Z���X�^�U�Y�[�]�W�V�Q�Rέ�����S�\���P�S�R�W�N�Q�P�T�X�G�J�O�U�I�J�����V�M�H�L�����ԯԽ��������ԴԼ����ԾԹԲԦذ��������Ե���������ﰻԶ�K���������������ة��������������إ�}���رخ����Kѫ����~ذد����������������������������������������������������]�йc�չ_�f�W�׹ѹ\�U�[�d�ҹֹZ�`�e�V�Թ^�b�h�X�a�ӹg�Y�Y�K�W�V�M�R�N�Q�\���[�J�P�Z�O�L�X�M��O�J�L���N�þP�¾I�K�������������S�R�����a�b�c�B�[�����h�Ф��_�������عi�S�Z���B�`�Y�L�����i�~�p�g�h�]���ڹ۹ٹj�ѤӤҤ[�Ԥ��q���i�j�������a�C�_�`�^�Z���������a�b���M�N�O����������ݹܹj�]�ľ����k�������l�o�����n�������q�p�m�k��������ʹʸ��������ʳʮ������ʻʷʭ������ʺʫ�g�o�O�H�p�S�D�K�f�E�d�L�P�c�Q�J�M�r�i�T�R�n�l�I�k�G�F�j�h�q�m�e�N�����oθ�g�c�s�b���lξ�����pο�V�v�d�f�m�q�u�r�k�n�h�ëj�i�tκ�e�«��\�b�[�`�P�U�_�\�a�Q�[�T�R�c�S�W�X�Z�Y�]�^�d����������@�������������C������D���������������������B�������������A�����������������@������ؽ���B���������������G�C��ض����A�D����غط����ؼ�E������ص���B�@�C��D�@��F����������A��A���������B���E�n����z�p�v�k�y�x�|�u�޹t��m�߹{��o�r�w�q�l�s�U�a�X�W�Z�\��_�V�T�]�[�Y�_�^�c�^�`�b�`�W�V�U�X�Q�R�Z�S�ž\�[�T���������Y�������������ƾT������\�]�C��������l�m�n�դ����r�s���������s�U�u�t�V�ī]�e���E�G���F��}�Ǿ����^�p�r���s�v�t�u�w������ʻ���W�X�v�x�z�w�{�y�ȫūǫɫƫf�w�h�g�c�_�`�b�d�a�f�e�J�����I�H�G�K�F�����I�����K���H�J���H�I�J���~��칡������f���g�e�d�]�Ⱦ����d�_�o�x�ʫi�g�N�M�L�L�M����ɾp�\�֤t���y�|�K�q�פ����������N�L���r���ؤuɧ���������Y�~���Z�}�Ϋx�ͫ˫̫j�h�k�i�j�^���P�Q�O���h�i�a������Ĩ�K�٤s�w�v�z�������������������ħ�����§����ç��h�b�]̣�e�c�\�i�l�g�`̥�f̦�a�d�[�_�ķ���^�j̢����ΤΪΣΥ�}�{��Ω�y�Ы�Ψ���|�z�ϫ��~��έ�o�n�l�k�n�p�o�s�q�pѮ�r�m�l�m�q�r�S�R�����T���X�A�Z�V�^�[���U�����C��W�B�\����]���Y�D�@�������Q�����������������������������R���O���O���P���������S�V�N�P�U�T�C���R�D�M�Q�����������������������e�g�k�h�c�b�l�j�j�m�d�i�k�f�a�f�`�e�^�h�d�i�c�_�g�j�b�����������r��D�E�`������r�q�����t�{����ʵ�_�u�������ŧt�W�v�w�x�ڤѫ��S�y�]�����x�|���Ƨ����n̬���m̩�o̪���ҫԫ�ΰαβδ�ӫt�s�v�u�b�F�a�c�`�U�E�V���W���T�Z�\�E�[�Y�X�����������q�o�m�p�n�l��m�k�l�n���������n��z���~���}���F�ۤ��իX�y�z���ȧ����ɧ������ǧ���������β�֫�ιζκ�׫y�u�w�w�x�x�v���G�J�K�H�g�f�d�e�I�h�Z�[�\�]�_�a�H�G�Y�`�^�������������p�s��r�t�q�t�u�o�s�s�q�p�r�o�f�F�G���U���ʧث{�ܤ����˧����٫��|���I�}�ݤޤ�����ɢ���̧q�r�s�����p̸�ګ��z�z�y�i�L�j�M�]�b������u�v�ʾt�s��t���k���J�U�Χͧ۫{�m�C�n�l�^���v�L�����ϧ��Ч��w�v̻�����u�ݫ���ܫ�ޫ߫�}�|�{�O�o�r�p�N�u�q�P�t�s����a�_�`���K�d�L�c�w�x���w�����u���@�H�I�ߤ��{�ҧԧ�����������ɤ�ӧѧ����x���������y���ا֧������է�������ק�����������̢�~̮̩��©�̭�㫬�éȩƩ��|̥�ͩ��䫦��ɩ�����{�ʩ�˩ǩ̩��z̫�ĩ}̡̤�ũ�����Ρ���������������������Τ���~�}���|�����쫡�򫢮��~�뫦���﫥��Χ����v��Ѧ��Ѩ���Sլѣ�x�Q�������R������ѯ������ѭѧ���y���w�z�U�^�d�|���e�`ժ���Vբ���~�T�b�e�I�c�ء�����]��a�{���d��Y�b�W�Xէ���[ի�_դ�\���f�c���Z�}�k�o�@�Q�m�D�q�e�F�S�i�l�G�H�N�s�T�J�O�C�^�U�r�A�P�]�p�N�M�t�E��j�B�K�M�R�g�L�P�h�\���p�h���l�n�k�[�j�_���Z�@�q���X�i�m��O�f�g�A�W�Y�V�o�������}���G�F���|���E���C�D����z�n��᣼��{�����������H�y�B�z���������~�y�~�ξx��娼��̾��嬼x�����v�����}�����w�;�姼���孼��|�{�˾��z���о��~���Ѿ��|���y�{�Ӿ��Ҿ��}�Ͼ����������V�����������������������g�j�i�h�a�J�b�A������t���������|ɳ���������ڧ٧��ϩΩ�ѭ���u�r�`�a�t�v�u�����I����宼Ծ��W¹������ѩЩҩ������Ѱ���v�Q��~��}ɷ������������ɪ����������ɩ�����������������ߧ�����������өާ����ۧ�������������������ݧܧ�᩾̷�ܩ侀̺̼̿���̴�詸���٩���⩶�שة֩���ԩ��ߩթ����䩵�کݩީ�����۩���A�����@�����ѱ�C�����������������B������E������������������β�D�����������ѿ���������f�������ѺѼ�}սѾ����ѿѸ��ѵѶѹ����ѻ��ѻ�î®���������ѷ����������g���˱ʱ��y�u�rզպ���wը�����̱ɱ{�j�ȱ��iս�����s�±��h�x���q�DZtդ�ƱR���oո�ñ��x�n�l�~հ�ı��w�|յ���������p�űm�z�v�T�S�k�d�z�j�Y�g�w�}�k�n�|�\�m�l�~�U�y�����i�_٥�p�h�q٭���f�e�c�]٤�����V���W�{���y�����X�o�x�`�[٩�a�^���p�|ݱݶݪ�l���i�z�{�b�k���n�o����ݸ�j�d���}ݺݨݩ�~ݴݫݵݭ�e���h�f��ݰݬ���S���m�����g�c���ݮ�����������Q�����L�K�����������O���b�����R��导����T��尼��������������N���P�U���������J���������嵼��������������Zٲ����¼��M������������������峼üؾپ���߾־ݾ��۾վܾ��׾޾������������ھ����������������������Y­�X�^���\�]�����Z���k�������[�B�E�F�D�G�l�C�N�d�M�L�K�c�e�����������u���������ũ���rٯ�����������F�����G���ĮŮ��ӱϱ��ֱձαѱԱбv�ͱ������u�xٰ�s�w�t�q���V����ļ��żƼ�������������H��y�������������Ʈرױz�{�r���W���礸������H�ٱ|ٵ�s�������_������I���Ǯ������Ȯ��۱ܱ��ݱڱ}�~پ�Y�X�����J�I�O�^�J�餹�������������������������������������@����������������������������P�M�����S�K���N�Q���L���O�R��������������Юɮ̮Ϯ��ʮ��ήˮ��ͮ��߱�խ�ޱ����ծ�౩��������������٨��������ݦټ��١�����y���v�w�u������{��ݻ����x�t�z���\�����Z�[�����ȼǼ����ʼ��ɼ�����澻���������辳�徶���������������`�n�K�m�Q�R�f�P�����Ū�����������T�Ѯ�Ұ����̳��|����뤳���B�A��������ҮӮԮ���´����z���a�g���������������ɵ�����������ɴ����������C��G�B�E��������@�A��A�@�F���D���W���C�M�N�F�X�H���S���I���������V���Q�O�����������J�P�D�������R�����U���E�L�����T�G�K���[�\�i�V�L�b�J�[�E�e�R��A�D��Q�a�`�F�X���_�`�c�Z�K�S�f�Y�a�m�V�X�C�j�c�]�@�l�g�I�k�P�H�d�\�T�^�b�G�Z�Y�O�_�U�W���h��]�N�M�B�^�W�U��������߮�����������ծ������ݮ�������������������֮ڮ��������ۮ����خ׮�������������ٮܮ���յչ������ս����հ������������������������������ղ�����������ճ�������鱺��������շջ������ޮ����������ִѴ��Ҵ������δ����Ĵ��Ǵƴ״������ɴŴ��д����̴���ٰٵٯ�˴���ݱ�ϴ����ʴ�ٴ���ʹôٴ������ȴ�ټپ����٪�Ӵմ�ٹ��Դ�������������ݦ������������������������������������ݨ������������ݬ����������ݡ����ݯ����ݣ��ݰ����������ݪ���~�ش�ݿ����ݥ��ݢ��ݭ�����������J�H�^�F�X�}�_�B�]�G�U�d�]�[�@�Z�o�Q�a�m�I�^�K�Y�g�D�k�a�M�C��W�h�`��e�S�f�E�P�L�N�`�_�n�O�b���T�c�l�j�A�V�i�b�R�\�����������ͼ����ؼ������ռ������������Ѽ������μּ��׼��������Լ����ټӼ����������м����ϼ̼��Ҽ˼�������������������������������������������������������������������������������������E����A��H�����I�����D�J���@����G�����������C��F�B�c���h�i�b�������f�����e���g�d�������Q�N�W�V�T�O�r�P�q��S�p�X�R�M���o�L�V�U�U�h�Y�Z�T�X�S��W�������������v��������V���������Y���d��������������������۴����ܴڴ��������ݲ���p�c�e�q�d�ۼڼ����������K����j�Y�w����B�Z�[�n�������k������\���e�o�f�p�������������������޴��ݴ����f�g�h�����ܼ����������L��l�Z���_�q�g����ߴ������i�j�ݼ޼��������`��C�H�r����h�s�i�����j�B�A����C�@�@�A��������A�B�@���ݷ�k������������M���[���¥��]�a�~ɻ���I�J�^���t�k�l���D������B������r����å��ƥ��ťĥD��������@�ŦƦ�������¦����Ħ�ɼ�E�����æ[�Y�L�Q�S�L�M�U�R�O�Q�V�Z�X�Z�K�M�\�T�W�E�G�^�U�N�J�Y�V�H�I�C�O�P�[�]�P�N�S���\�W�R�]�F�T�K�X�D�j�z���q�K�b�e�B����m�o���v�h�f�g�u�G�p����n�s���J�u�y�c�I�M��O�@�l���k�}�r���u�x�|�A�F�~�w�i�_�d���`�N��������{���t���a���L�|ϡ���w��ϪϬ�t�v�{�Iҭ��ϭ�{�s�d�~���x�zϥ�}�}�pϨ���z���mϪ�x�����oϫ�^�H�|�w�v�nϬ����ϩ���yϡ�qϢ���rϦ�y�~�L��C�U�[�W�J�M�F�G�J���V�_�E���@�N�B�O�Y�D�h�H����H�E�f�Z�g�a�S�b�\�e�c�I�T����A�G�`�F�Q�C�i�P�K��K���X�]�e�����R�P�G�����[���U���G�D�����g�����d�X�c�N�����O�I�E���@�Q�Y�B������D�^�F�\�������S�����H���F�J���h�b���_�]�f���a�R��`�A�E���W���V�T�L�K���C�����M�A�Z��������I�����M�D�������J�C����U�V��H����������������D�������������B���S�K��Q���W��A����G�E�B���C�O�L�T��@�F�G��F�E�����P�N�R���@�a�`�F޽�_�I�J�Ƿh�·^�C�ȷ��R�H�K�c޸�j�b��W�̷˷ŷi޹�U�L�Y�e�ͷ��T�M�ķ÷P�Z�d�G�Q޼�[�ɷ��N޿�E�S�g����V�l�X�f�ƷO޺�ʷ�D�]�\��⭺}�⢺n⯺w�m�ⱺq��s���u���S殺}�o��⣺���u�~����|�|�v�t���z�w�x������z���~���p��y�x�����{���t⪺�⤺��s����r⥺���{��y�߼�����v�D�N��M�Y��K�O��F��R�����T�C�^���W�[�`�U�I�����L��H�_���a��V��\��J��E��嫺A�Z�B�@��X���Q�P�]�G����I���@���A���H�C���O��B�����D�F�E�D�J�G���F���������E�B���@���������A�����N�C����Q����S�Y�W����Z�R��V�U�[����T�����X�P���q����o�����������p���m��n�������s�r���x�_�e�y�\�v�s�g�w�t�^�a�b�c�f���]�u�d�h�`�]�j�`�k�h�_�\�^�b�e�d�g�[�i�c�f�i�a����������x�����y������ŭ�������W�eƣ�l�������ǦA�^�_�b�_�`�a�X�Z�U�R�T�����Vͣ�S�P͡�W�Qͥ�Y��������������������ϱ����ϵ��ϵ�����w�x�y�P�L�n�v�{�Q�l�r�k�u�q�M�O�z�j�m�s�t�|�p�N�m�N�P�L�X�J�W�i�H�[�R�l�S�V�Z�O�T�j�k�Y�M�I�[�Q�U�K�H�I�e�O�Y�b�X�L�`�^�_�J�c�\�Z�K�]�a�M�d�p�w�yޡ�ڷk�ҷz�׷��η}�m�~�l�ܷx�Ϸ��Էq�ٷ|�o�v�r�n�ѷطַӷ۷зu�շN�{�s�t������������������⵺�����������g�d�p�j�l��f�n�m�k�q�h�o���c�e�b�r�i�J�Q�U�S�K�I�L�M�H�U�V�G�V�Q�O�L�P�N�R�R�M�N�O�P�K�T�S�W�X�T���\�b�`����^����a�]�_��w��t�u��v����l��m�z�k�j�i�{�l�j�k��������������y��������������R�ݷ��n���b���}�������Ϲ�f�P���޷����|��g��ɦB�Ȧe�d�c�`�����[����Ϻ������ϻ��ҡ�~�S�]�^�o�\�_�R�p�Q�k�j�h�i�lڦޥީ��ާ޹����⺺��s�t�Y�Z�r�}�q�p�n�o���l�������ǥ��C�D�f�b�aˬ�e�g�c�f�g�d�_;�]�d�����e�a�b�\ͯ�^ͮ�c�`��Ͻ����Ͽ����ϼ�����ҥ���X�W�U��ҩ�T�V���g֣Ҫ�b�f�e�n�y�h�c�m�t�s�a�d�u�r�q�`�i�p�w�T�v�s�V�u�o�q�t�r�U�x�S�߷�ެު��ᷮ����⻺��ޯ���������v���u�~�}�{�z�w�x�y�|��_�\�]�W�[�a�`�^�d�e���c�y��x�~���m�n�m���z����ȥ��Y�v�j�ɥ���E�l�j�k�h�h�i�m���k�g�j�f͵�i�������l�h�¬Ŭ�����Ͽ�������������Ĭ������������������ì�ҫҶ��ҹҺҬҸҵҳҷ�_�]������һҲ�^���Z�\�x�m�k�l�s�t�p�{�u�r�o�y�n�w�z�q�y�[�x�w�v�|�~���`����ڢ�Z��ڥ�[�a�b���X�}�{ڣ�z�_�|ڤڪ�Y�^�\�]�W�鷷�跻������޳��޺޸޹޵޴�������������⾺���������������������������@�b�A������������i�f�e�g�f�Z�c�X�\�[�d�h�Y�m�z���j�h�k�n��l�g�B�E�u�@�o�F���D�{�A�C�G�v�t���s�n����������Ų�ʥnͼҽ�}���]���{ų�˥o�`������ҿ�~���������������º���i�^�_�r�o�p�q�I�H�|�w��̥Ƭ����ͥ�ң�c�d�ΥϥF�j�i�Ǭ�Ϭ�Хѥҥӥk�l�n�m���r�p�q�����ˬɬʬȬ`�d�c���b�a�����{�z֤���f�e����ڧ����������B�j�s��å�|�ԥs�����úo�p�t͸�����ϬЬͬά����̬��h�i�����n�l�����k�j�e�������m���f�g����֢֭�|�~֤֣�}�������k�j���h���l���m���g�i����گ������������������������������������Ǻ��ƺ��ź������Ⱥ�������������E�C�H�I���F���G�ĺ��D�l�k�s�m�r�o�`�q�a�b�p�n���t���w�u�v���M���N�}�O�~�L�P�J���x��o�K�p����~��}�����Ѭ��n�o�եʦG�q�m���ҬӬԬ����o�������q���p���J������x�Q�q�p���֥u�p�r�����K�t�R�r�ץ��׬��ج֬լ��q�r�s����֯��ڱ�s������ɺʺL�d�u�c�y�S�s�إn�x�wͼ�vͽ�y���۬ڬ����߬ެ٬���������ܬ��ݬ������������������u�v���������w�t������ֲֵ֭֮֬������ַ��ִ��ֳ��ھںڻ�����ڽ��t��������������C�������κF���D�����E���A���B�������@���̺��ͺ��������˺��N����Q�O���M���P�}���~�v�z�y�w�f�g�e�x�{�|�h�@�����{�A�����|���z�~�}�U�¥¢���T�{���y�z�t�w�u�v�����������f�٥�����ڥo�������x���u�G�B���|�x�ۥ��z�|�~�}�{Ϳ�������������������������|���������������z����������Ң�����y��ҥ���}���~�{������ֵַ��ֶֺ�������v����������������ڸ�w�����x���������N���Q��������������M�L�H���O�P�������J�K�������к�����Ժ����Ѻ��Ӻ�������I���Һ��T���X�V�Ϻ����S�����U�R��������Y�����W�j�������������l�i����k���F����E�C���D������V�G������Z�W���[�]�\�X�Y�����~��}����z�}�y�q�{�|�~�r�t�s����������ܥr�����ª��������������ҧ��������Ҧ����������Ҭ����������ֻּ��ּ��ֿ��������������R����S�T���A����׺պֺC�B�����@����������������m�H���I���_�^����á�������������V�ݥr�q�p���Īê����������������Ҳ������������������������������־�}�������|�z���{���y�A����Z�������X�@�W�\�[�Y���I�H�D�غG�F�ٺ^���_�[�]�Z�\���p����E�r�q�n�o�����J�������`�¨©������ã�������ޥH�s���ƪŪ��@���������ҷ�������������������~���D�]�^�C�B�J�ۺںK�L�a�`�������������s���K�����¬�u���ߥA��Ҹ��������ڣ���E�ܺM�ݺvĥ�˦Ǫ����B�C�@�Bӹ�D�G�E�F�C�Һ�H�A���Ʋ��ò��Dz����������Ų²����IJ��Ȳ�����������������������ڧ����ڥ��ڬ��ګ��ڭ�������������a�P�S�G�L�F�c�J�H�b�O�N�K�M�I��R�_�Q�]��X��N�P��U�T�W��R�Q��ߺS��Y�[�V�O��i�޺\���b���c�e����������`�h�d�f�g�v�����j��������t���x�������Q�y����w���{����z�������������O��������N��������������L�������P�M������u�c�a�g��e�d��j��k�h��i�b�­«�f�l����ðê����îïó�x��������w�y����������������Ţ���������������X�Y�m�~�̦��E�F�D��G�H�I�I�O�Mӻ�K�L�N�J�ɲ��˲��ʲ���گ������������V�d�T�e�U�f��a�^�`���_�����k�����a���������|�}���W�S�X�T�V�R�U�����������z�{�A��@�����ͦt���Ȫ��L��J��������K������Z�ǯS�Y�ïR�X�V�¯įUӽ�T�ȯůɯƯQ�P�W��������������ϲֲӲٲزԲ������в����Ѳ������Ҳ��ײͲղ��̲�������ڲ������ڴ�����l����������������ڳ�������ڶ��ڻ�β����h�]�_�a�e�[�Y�j�`�d�\�X�W�b�Z�^�k�i�f�g�c�r��j�x�t��x�e�u�b�w�f�����v�p�����c�q��s���h�g�d�l�i�m�y��n�o�k�����p�y�u���r�v���l���t�����s�w���q���n�����z�r�m�����{���o�������~����������꨿���������������ꣿ�ꦿ���������ꤿ��������_���Y�i���a�]���d�g���\���e�������`�Z�h���c���^���b�[���f�����n�t��w�µ�o�v�q�·�m���s�u��r�p���øô��������÷�����õ��~�}ĭ���������������B�������Ź�@�B���A�l�Φ��o�ʯڲ�����j����������C���I�ɪu�M�`�[�_�]�˯^�\�����@�i�j�n�o�h�k�g�m�@�p�z�|���}������������������ü�D��ź�Ϧ˪ʪO��N�b�̯��a�ܲ������۲B�C�A�s�m�l�n�r�q�����~����꪿y�x�ý�üð����ЦP��e�ίd�c�ͯ������ݲ��޲����߲����D�o�p�~�C�A�B�{�|�}���桽����歿�꫿����k����z�{����l������ѦҦ��̪ϯQ���ӦA�R�S�@�B�ԦT�ѯf�ӯЯүA��@��q��������������զs˪�C�U�h�ԯg�կC��B�D��F�G�E��t�u�E����D�������p�o�m�n�q�|�¾����Ť�֦��w�µv�F�צ��ئ٦��v�w�w�t�v�y�u�{�z�x�x�ѪϪ��ΪӪժҪ�ͬ�֪Ъ|�Ԫ����ͪ[�G�H�]�W�Z�c�a�I�g�L�d�\�Y�I�b�D�e�V�_�F�K�`�O�M�X�J�^�N�E�f�گ�د֯j�ޯۯl�ݯk�i�n���H�o�m�ׯٯܯ߯�N��E�G�H�P�L�J�M�Q���F�O���K�I���ȵQ�O�ʵJۡ�ɵN�K�ŵ˵P�ǵM�G�ƵL�̵ĵõw�u�{�sߢ�x�r�{���}�v�~�|�~�y�x�y�}�͵|�t�z�����L�H�M������J���K�����I�A�D稽C秽������@�榽B�����걿�������������꯿��������t�����x�z�w�v�u�s�����r���y�������¡�}�~�����ô�ij��E���C�D���ڦתR�N�{���ۦ��S���ܦP�T�U�V�O���ݦتh��p��Wۤ�P���|��µ�ަ٪�R�εQ���E�ߦϵ��R�঱�i�Q�r�����q�W�T�V����S��U�X�Y�Zۦ����ߨ�����S�J�F�I�K�H�G����괿����������������������F����}�}��X�[�A�J�K�M��N�L��ˣ�{��ˡ���|�z�y�}�~�~�j���ܪ�ͷ�۪��ߪ����������Ϳ�����ݪ�����ڪ�͸�����ઽ�쯻�ު�������b�\�d�a�q�t�]�k�V�`�c�e���w�U���Y�W�R�o�~�s�vХ�f�}�^�xФ�u�y�|�mУ�{�l�p�_�Z�S�X�T�g�nХ�[�z�A����v���}�����~���x�|ӵ���Ӥ���t�������s������r�\ۦ�z��{ӡ��uӯ��Ӷ���ӰӧӢ���w���y�^�`�e�y���]����h�o�u�b�i�@�w�r����n�j�\��a�Y�����f�c��s��d�z�l�k�����Z�_�p�v�A�[�g�m��x�q�t���l�`�׵}۪ۧ�յhۣ�i�w��s�ߵt�]���赡�u۬�p������n�z��Եrۭ�k�d�o�c�a�е��jۨ���صݵٵ�~�ڵv�f�ҵ^ۢ۫�e�൰�q�m�ѵ�|��x�ֵܵ޵ӵ�y�g�{�bۦ���_�����U����ߵߩ�����߱��߿������߰����߲��������߶��������߶����߱�������۵�߸߯��߾����߲����߫����ߴ��������������ߺߪ��ߧ��߭��������������߮�`���������X�����[���Y�������������������������Z�����]�����a�U�^����W���V���T�c�\��������b���_���������s�t�g�f�b紽��v�u��_�c�]�p�a�w�Z�X�d�n�i綽O�m�����[�R�U�{�\�S�Q�N���e篽��`�h穽x�|竽W�k�o�T�y粽��L絽r�V�j�P�^�Y筽��l�}�z�q�M���I�@�C���E��A�G븿������L�F���U�O��F�귿J�T뿿Q��D�H�B�V�S�P빿������W뽿M�K�N�S�@�E�R�D��A�����M�O���Q�I�P�B���R�J�G��U�����H�T�K����L��V��C�N��������~����³������������������������������°�������������������������������������������������������������ĩĦ����������Ĭ���ī���������ļ�������������J�����K�I�G�H�L�������������E�F�G����O��h��ӷ�@�B�|�{�굸�������~�X�Z�Y���W�������������Ч���i�k�j�����ӿ�A���F������ӽ�C����ӻ��������H��Ӿ��ӹ�G�D����Ӻ�E�B�L���K��׫�H�F�~שקפ׬׭ׯװ�}�E��ס׮�G���I�D���M�J���������߽۱�쵶�ﵺ۸����۵�����ۼ۷۹ۻ���������ߺ�����������¸����ø������ĸ�����������㻸j�������e�������g�����h�������m�����������������i���l�����f�����d��������������߲�����½��k����翽������绽�����缽�羽����������繽�纽�罽d���a븽��k�g�e�`�o�Ŀ\�h�i�_�^�l�b�]�c�n�[�m�j�¿��ÿf���Y�]�Z�a�g�\�p�j�_�k�f�m�^���`�n�X�l�d�c�h�[���b�i�e���������������������o����¥������������������������������������������������������������������������į�������B�E�A���C�����D�Q�O�N�@�P�F�M��������������ž�����Z�n�������妪�������G����l�����N�����Ÿ��ýĽſ������Э�m�����I�����������J�N���M�������K�L���P���U���T�����R�����S��׻׽׷׾�O����׵����״���Q����������������������������͸����������ϸǸθ����ʸȸ���ɸ˸��Ƹ̸��t�B�A���v�@���n�p����r�q�����s�����o�����ƽ��ʽ������Ž��ǽȽ��ɽ��������u�p�|�ʿw�y�ȿq�u�x�ƿɿ{�s�t�z�r�v�ǿr�q�w���s�t�u�x�����������������v����������������������������������I���K���H�J���R��������H�I�K�J�P��n������������W�V����������иC�F�E�D�������̿˿��y�{�z������������T�S�[�����o�����������C�����A�@�B�Ѹ���D�I�G�H�������}�|�}��������L�U�����L���q�r�����p�T�R�Q�X�P�Y���V�S�W�U�O�_�Y���^�`�Z�[���X���]���\�D�F���E������I��������C�������������B�����@���G�������A�����H�߸ڸո�ָҸ�޸�׸ܸӸԸP�M�E�J��Q��ٸG�O�K�N�L�ݸF�ظL�x�{�N���M�}�ϽO���K䦻y�۸|�z�~���w�������J�ֽҽٽ��ڽ����˽����ս��Խ��ν����ͽ��ӽнؽ����̽������׽������۽ҿ����~�����Ϳӿ��ϿٿԿ���п��ڿ���ۿؿѽο��ܿտ��ѿֿ׿�����������������������������~�������������������������������������������������������A�O���������������@�B�����C��������������������������Ĵ����ij���@�N�M�P�Q�A�V�[���X�W�Z�Y�C���B�@�A������@�M�N�g�m����������R�P�������D�D�����Z�a�T�S�ܽ��ݽ����vƨ�����b�������H��V�U�W�Q�R䨻ݿ޽޿��������F�E��\�[���������I�Y�Z�X������������߿���������G�����s�t�]�^�������h�f�c�g�e�d�J����L�Q���S�R�U�����O�K�M���T�P�N��������[�T�������S�U�����������߽�������������併������࿴������������������H�I���J�������R�B�S�\��Ŭ�E�B���j�i�\�]�����꽺���v�u���_�����������X���W���V�_�b�`�a�e�^�f�c�d఻V������������������L�N�K�M���T�o���w���������l���k���������`����[�^���Y���l�]�����������\�_���Z��h��o�n���p��m�r�i�k��g�j�q�s�����[�a�Y�b�X�]�c�`�_�^�W�\�Z����A�C�@���E�B��F��D���������������������������������������������������������E�������A�@��C�����B����������D�R���O�S���Q�����P���T����ľ�����������C�E�V�D�U�a���`���^�]�b�c�F�_�����\�Q�P�O�p�����nƭ�`���������U������y�x�c���a���b�����m�������n�����C�A�E�F�L�H�J�B��I�K�D�G��b�@��a�c���u�w�v�{�x�t�y�z���|�g�f�d�e䳻������M�N�I�J���������K�L�H�@�������G����������������������������F�G�H���I�����X�Y�W�V�Z���������������X�Y�W�F�d���e�H�G���d�@�������|�GŰ�d�A�[�������������������������������д�|��У�~�{���}�������z�j�����g�n�i�����l�����h�e���k���m�f�����p�z�v���~�w�|�r�o�q�}���u�x�t�y���{�s���M�e�O�g�i�N�f�j�h�G���O�~�P�E���J���C�B�M�L�K�I�N�}�D�F�H�������������������R�C�A�S�D�B�Q�P��O�����E�����������������������������������Ŷ�U�o�R�S�Q�T��˧ˬ˨˷����˹�������������������мй��������п��������׺����������q�����p�r��������������ע����׷�������l�V���W�Tܣ�n�S�Y�X�k�\�R�[�P�Z�U�m���������Q�����R�����n�q�i�m�»l�j�p�k�h�o�Y�H�J�V�W�U�Q�G�Z�T�F�I�X�����������K�L�M�]�\�����[�\�Z�f��Ż�����u�t�@�A��s������פ�����_�a�]�`�o�^�p�s�U�T�S����s�u�ƻûŻĻt�r�a�^�_�M�`�[�\�J�K�]�L�������������������������������O�P�N�R�����_���Q�^������������]�H�I���C�]��q�oƼ���V��Ľ�����q�������B�x�v�z�D�y�w�CԨ�������Bث���@�ת�C�����צ�A���m�l�j�b�q�e�o�v�n�y�u�c�i�w�h�x�z�k�r�s�w�u�t�f�r�v�t�s�d�g�p�����������a���W�Y�e���Z�\�f�[�d�����b���^���c������`���������X�g�]��������_��������������x�ǻ��z�̻л����Ȼ���ɻ��������~��ѻͻ|��˻��ʻ���y�λ��{����w�v���ϻ��}��R�Z�U����g�P��O�V�e�T�q�c�d�N���X�t�y�s���o�w�u�h�b�}�W�~�x�m�k�f�n�{�j�z��S�v�|�r�l�Q���p�Y�i�������D�A��C����������B�@��������@������C�E��E�����������B��������A��������D�����������������������������������������������������������������������������������������`�Y���T�c�[���e�U���_�������a���W�X�]�b�����j�g�k�^�Z�h�j�\���������d�f���i�S�V�s�c���q�a���l�h���r�b�e���t�m�p�������i�d�����`�������o���k�u��g�n���B����f����@����������D��������A��������C������������������a�f�O�h�I�d�j�N�J�K�`�g�M�e�L�_�c�b�^�i���m�p�l�n�o�i�j�g�k�h��ų�K�M�L�N���J�������D��S�R�T�_�U�^�V�r�u�t�h�s�r�p�q�w�������U�V�P�Q�R�T�W�S���O�@�B�C�����q�r�m�n�u�v�y�z�i�j�E�e�f�����âĢŢƢǢȢɢʢˢ�ƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿ�������������������������������������������������������������������������������������������������������������ƣ���������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰ���t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������������������������w�x�z�{�|�}�u�t�s�r�q���������~�������������b�c�d�e�f�g�h�i�p�o�n�m�l�k�j�v�y���������������������������������������V�X���������E�L�K�������¡J���K�������������������¢�������������ԡۡ�������������ܡڡݡء١������������D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s����DzǴǵǶǷǸǹǺ��ǼǽǾǿ���������������������������������������������������������������������������������F�G�D���X�ӡP�ѡҡBN\N�QS�SNNGN�N�V�n\s_N�QN.N�N�N�N�N�Q�RlS�S WY,Y\�]�e�k�kl?r1N<N�N�N�N�N�N�NRSLS"W#WY/Y�[�[\;\t\s\^�^�^�_	bPbl6lCl?l;l�r�r�s�y���OO,O�NO�NO�NOOOO"OOO�NO�QR	RR�R"SSMS�ST�V�V.W*W4W<Y�Y|Y�Y{Y~YwYYV[\%\|\z\{\~\�]u^�^__t_�_�_�_\b^bdbabfbbbYb`bZbeb�e�e>g9g8g;g:g?g<g3glFlRl\lOlJlTlKlLlqp^r�r�r�s*uvuzQx�|���}��M�~�����������"�$� �#�VO;ObOIOSOdO>OgORO_OAOXO-O3O?OaO�Q�QRR!R�R�R	ScSrS�S�S0T7T*TTTETTT%TT=TOTAT(T$TGT�V�V�VAWEWLWIWKWRWY@Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�[�[(\*\�\�\�\�\�\�\�\�\�\�\�]
^^�^�^�^�^�^__x_v_�_�_�_�_�_�_�_�_�_�_�_�_�_�_`�_:b�b�b�b�b�b�bqb{bzbpb�b�bwb}brbtb7e�e�e�e�e�eEgGgYgUgLgHg]gMgZgKg�kllxlglkl�l�l�lqlolil�lml�l�l�lflslel{l�ltpzpcr�r�r�r�r�r�r�r�s�s�s�s�s:u9u�u�u�v=y4�����������������������������x�ɏ��������������0�(�/�-�3N�O|O�O}O�O�OvOtO�O�OwOLO�OjO�OyO�OxO�O�O�O�O�O�O�OkOnO�Q�Q�Q5R2R3RFR1R�R
SS<S�S�S�TT�T�T�T�TkTzT~TeTlTtTfT�ToTaT`T�TcTgTdT�V�VoWrWmWkWqWpWvW�WuW{WsWtWbWhW}WYEY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Yb[e[�[�[D\G\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\^^^(_"_#_$_T_�_~_}_�_�_-`&``2``4`
``3```,`"`
``.````	``b=b�b�b�b�b�b�b�b�b�b�b�b�b�b�b=e�e�e	f�efff�eff
ff�eff�f
g�glg�g�gvg{g�g�g�gtg�g�gzg�g�g�g�g}g�gxgyg�g%k�k~k�kl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l0m�l�l�l�l�l�l�l�p�p�p�p�p�p�p�p�p�p�pjr�r�r�r�r�r�r�r�r�r�r�s�s�s�s�s�s�s�s�t�t?u@u>u�u�u�v�v�v�v�v�w�w�w�w�w�wBy?y�yxz{z�zu|�|5������������� ���������������������������������‚��Â����p�o�m�n�V�ҏˏӏ͏֏Տ׏����������9�=�<�:�C��O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�ODRIR�R�R=S|S�S�S�S�S�T�T�T�T�T�T
��T�T�T�T�T�T�TpT�T�T�TrT�T�T�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�X
YSY�Y�Y�YZ�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�[L\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�]!^"^#^ ^$^�^�^�^�^�^�^_._V_�_7`9`T`r`^`E`S`G`I`[`L`@`B`_`$`D`X`f`n`BbCb�b
cc�bcc�b�bcc�b�bccc�bc�b�bAeCe�e�e6f!f2f5ff&f"f3f+f:ff4f9f.fgg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g(k�k�k�k�k�k�k l!l(m4m-mm<m?mm
m�l3mmm:mmmmmBmmm7mmm@mm m,mm"m	mm�p�p�p�p�p�p�p�p�pArIrJrlrprsrnr�r�r�r�r�r�r�r�r�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�t�t.uGuHu�u�uyv�vwwww
w�v�v�v�w�wxxxxxxx	xxxJyLyKyEyDy�y�y�y�y�y�z~z�z{{z|x|y||�|�|}}}X�������7�؀ǀ�рȀ€Ѐŀ�ـ܀ʀՀɀπ׀�̀��!���ق�������Ղ:��ւ����������������w�t�|�s�A�N�g�j�i�Ӊ��r�����񐽐��ՐŐ��ǐːȐԑӑT�O�Q�S�J�N�PPPP"P0PP�O�O3P7P,P�O�OPP P'P5P/P1PPZQ�Q�Q�Q�Q�Q�Q�QaRZRRR^R_RURbR�RS�S&U�TUU�T�T�TU�TUU�TUU�T
U�T�T�T�TUUUWW�W2X�W�W�W�W�W�W�W�W�W�W�W�W�WYJYZZ-Z.ZZZZ
ZZ3Zl[�[�[�[\V\T\�\�\�\�\�\]�\)^(^�^�^�^�^3_0_g_]`Z`g`A`�`�`�`�`�`�`�`�`�`�`�`�`�`bFb�bcVc,cDcEc6cCc�c9cKcJc<c)cAc4cXcTcYc-cGc3cZcQc8cWc@cHcJeFe�e�e�e�eJf_fGfQfgghhIh2h3h;hKhOhh1hh5h+h-h/hNhDh4hhhh&h(h.hMh:h%h h,k/k-k1k4kmk���k�k�k�k�k�k�k%lzmcmdmvm
mam�mXmbmmmom�m�m�mm�m^mgm`m�mpm|m_m�m�m/mhm�m~m�m�mm�m{m}mum�m�p�p�p�p�p9�p�p�p�p�p�p�p�p�p�p�p�p�pBrxrwrvrs�r�r�r�r�r�rs�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�t�t�t�t!u[u_u�u�u�u�u�u�u�u�u�v�vwwwww#wwwww"w'w#x,x"x5x/x(x.x+x!x)x3x*x1xTy[yOy\ySyRyQy�y�y�y�y�y�y�y�y�y�z�z�z�z�z�z�z�z{{{{{{
{{	{{�|�|�|�|�|�|�|}}}}}}}}}}}\a^`][������>�9�����������/�%�3�-�D��Q�%�V�?�A�&��"�B�N��*��<�M��$� �7�/�)�G�E�L�S��,�K�'�H�S�R���������������������������������������������C�D�m�u�v�r���q��o���~�t�|��G�W�{�����v�x�������юӎ��������������֐�ِڐ�ߐ�ؐېאܐ�P�N�O�Ց�ڑ\�_����ߚ/�NpPjPaP^P`PSPKP]PrPHPMPAP[PJPbPPEP_PiPkPcPdPFP@PnPsPWPQP�QkRmRlRnR�R�R-S�SuUvU<UMUPU4U*UQUbU6U5U0URUEUU2UeUNU9UHU-U;U@UKU
WW�WX�W�W�W�WX�W�WX�WX�W�WX�W�W�W�W�W�WX�WX�WXX�W�W�W
XX\Y`ZXZUZgZ^Z8Z5ZmZPZ_ZeZlZSZdZWZCZ]ZRZDZ[ZHZ�Z>ZMZ9ZLZpZiZGZQZVZBZ\Zr[n[�[�[Y\]]]] ]](]
]&]%]]0]]#]].]>^4^�^�^�^�^�^6_8_�_�_�_�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`2cec�c�c}c�c�c�c�c�c�c�coc�c�cnc�cuc�cmc�c|c�c;c�cxc�c�c�c�cpcSe�eefaf[fYf\fbfgyh�h�h�hmhnh�h�hVioh�h�h�huhth�h�hwh�h|hkhrh�h�hqh~h�h�h�h�h�h�hxh{h�h�h�h}h6k3k7k8k�k�k�k�k�k*l�m�m�m�mtn�m�m�m�m�m�mn�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�p
q�pq�pq�pq�pq�p�pqqq�p�pqqq~r{r|rrsssss
ss�rss�s�s�s�stt�stt�s�s�stt�stducu�u�u�u�u�u�u�u�v�v�v9w/w-w1w2w4w3w=w%w;w5wHxRxIxMxJxLx&xExPxdygyiyjycykyay�y�y�y�y�y�z�z�z5{G{4{%{0{"{${3{{*{{1{+{-{/{2{8{{#{�|�|�|�|5}=}8}6}:}E},})}A}G}>}?}J};}(}c���������������G�C�H��%���-��,��!��'��"��8�3�:�4�2�t���������z�s���t���������u�����}�������������~������������������v���Y�V�����†��ņ����Ȇ������̆������Æ����R�����������������������������������������։ىՉ0�'�,��9�;�\�]�}���}�{�y���������؎ގݎ܎׎��$�����!�������Ԑ���V�X�Z�S�U������������z�����|�m�k�q�o���j��嘗��P�P�P�P�P�P�P�P�P�PhP�P�P�P�P_Q�QSS�S�S�U�U�U�UwUEV�U�U�U�U�U�U�U�U�U}U�U�UU�U�U�UW)X7XXX'X#X(X�WHX%XXX3X?X6X.X9X8X-X,X;XaY�Z�Z�ZzZ�Z�ZxZ�Z|Z�Z�Z�Z�Z7Z�Z�Z�Z�Z�Z�Z{Z}Z�Z�Z�Z�Z�Z�[�[�[�[�[�[�[\0\7]C]k]A]K]?]5]Q]N]U]3]:]R]=]1]Y]B]9]I]8]<]2]6]@]E]D^A^X_�_�_�_�`�`�`�`�`�`a�`
aaa�`a�`�`�`�`aaaa�`aaJb�c�c�c�c�c�c�c�c�d�c�c�c�c�c�c�cad�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c2egejede\eheee�e�e�e�e�e�e|flf{f�fqfyfjfrfgi�hi�h*i�h�h�hi�h�h�h�h�hii�h�hi�hipi�hi�h�hi�h�h�h�h�hi
ii�h�h�h�h�h�h�hi�h�hi%i�h9k;k?k<k�k�k�k�k�k�k�k�k0l�mFnGnnIn�n<n=nEnbn+n?nAn]nsnn3nKn@nQn;nn.n^nhn\nan1n(n`nqnkn9n"n0nSnen'nxndnwnUnynRnfn5n6nZn qq/q�p.q1q#q%q"q2qq(q:qqKrZr�r�r�r�r�rss0s"s1s3s's2s-s&s#s5ss.t,t0t+ttt!t-t1t$t#tt)t t2t�t/uoulu�u�u�u�u�u�u�u�u�v�v�vFwGwDwMwEwJwNwKwLw�w�w`xdxex\xmxqxjxnxpxixhx^xbxtysyrypyz
zzzz�z�z�zJ{;{D{H{L{N{@{X{E{�|�|�|�|X}o}c}S}V}g}j}O}m}\}k}R}T}i}Q}_}N}>?ef����Q�O�P���ԀC�J�R�O�G�=�M�:���������<�=�?�u�;�σ��#�����������ƃȃ�ヿ��݃�؃���˃΃փ��Ƀ	��ރ��ƒ�Ճ��ǃу��Ã��ă��׃��ۃ��؆��ӆ�چ�݆�܆��׆�цH�V�U���׈�������������������Ɉ������݉ډۉN�M�9�Y�@�W�X�D�E�R�H�Q�J�L�O�_���������������������؍Ӎ͍Ǎ֍܍ύՍٍȍ׍ō������������������-�4�/��,����������������a�d�_�b�`��
�%���&�����������'���$�����{���������~���������–ȖÖ��l�p�n��������N�N�N�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�QzRxR{R|R�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UWSXhXdXOXMXIXoXUXNX]XYXeX[X=XcXqX�X�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�[�[�[\3\q]c]J]e]r]l]^]h]g]b]�]O^N^J^M^K^�^�^�^�^�^@_�_�_�`IaJa+aEa6a2a.aFa/aOa)a@a bh�#b%b$b�c�c�cdd	d d$d3dCdddd9d7d"d#dd&d0d(dAd5d/d
dd@d%d'dd�cd.d!ddoe�e�e�f�f�f�f�f�f�f�fxf gfi_i8iNibiqi?iEiji9iBiWiYiziHiIi5ili3i=iei�hxi4iii@ioiDiviXiAitiLi;iKi7i\iOiQi2iRi/i{i<iFkEkCkBkHkAk�k
��k�k�k�k�k�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nGqTqRqcq`qAq]qbqrqxqjqaqBqXqCqKqpq_qPqSqDqMqZqOr�r�r�r�r�r<sBs;s:s@sJsIsDtJtKtRtQtWt@tOtPtNtBtFtMtTt�t�t�t�tuyuwu�i�uvv�u�u�u�u�uv�u�u�u�u�u�v�v�vUw_w`wRwVwZwiwgwTwYwmw�w�x�x�x�x�x�x�x�x�x�xyx�x�x�x{x|y�y}yyyzzzzzz"zzzz�z�z�z�zf{d{m{t{i{r{e{s{q{p{a{x{v{c{�|�|�|�}�}�}�}}�}z}�}{}�}|}�}�}�}}}�}mkghl�����!�d�`�w�\�i�[�b�r�!g^�v�g�o�D�a��I�D�@�B�E��?�V�v�y�����e�Q�@���g�0�M�}�Z�Y�t�s�]��^�7�:�4�z�C�x�2�E�)�كK�/�B�-�_�p�9�N�L�R�o�ń��;�G�6�3�h�~�D�+�`�T�n�P��������ֆ��M����	����
��ֈˈ͈Έވۈڈ̈Ј����߉�����܉�v����a�?�w�����u�����t�z�<�K�J�e�d�f�������̌h�i������������������������Ѝ�����������������R�?�D�I�=��
�������n�o�H�R�0�:�f�3�e�^���.�J�F�m�l�O�`�g�o�6�a�p�1�T�c�P�r�N�S�L�V�2�������������������������s�w�x�r��
��������������������[���眀����P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�Q�R�R�R�R0S�S'VVVV�UVVVVV�UVV�U�U�X|X�X�X�X�XXtX�XzX�X�X�XvX�X�X{X�X�X�XkY�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Zw[�[�[c\�]�]}]�]z]�]w]�]�]�]~]|]�]y]]X^Y^S^�^�^�^�^�^�^�^�^�^D_C_o_�_,a(aAa^aqasaRaSarala�ataTaza[aea;ajaaaVa)b'b+b+dMd[d]dtdvdrdsd}dudfd�dNd�d^d\dKdSd`dPdd?dldkdYdedwdse�e�f�f�fgg"g�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iJkMkKk�k�k�k�k�k�k�n�n�no%o�n7o�n.o	oNooo'oo;oo�n
o6oso�n�n-o@o0o<o5o�nooCoo�n�n9oo�n:oo
ooo!o�q�q�q�q�q�q�q{q�q�q�qDrSr�r�r�rCsMsQsLsbtstqtutrtgtntuuu}u�uvvvvv
vv�v�w|w�w�wnw�wow~w�w�x�x�x�x�x~x�x�x�x�x�x�x�x�y�y�y�y�y�y�y�y�y�y�y+zJz0z/z(z&z�z�z�z�z�{�{�{�{�{�{�{�{�{�{�{�{�R�{�{�{�|�|�|�|�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}s����$�]�\��������������������������΄„������������̈́������Є����������DŽ̄��������ք����τ��ׄԄ҄ۄ����a�3�#�(�k�@�.��!���C�,�A�>�F� �2�*�-�<��:�1�5�B�&�'�8�$��0�����������������눝���������艫�����������=�h�i�Ռό׌��	����
���
������������
�#�� �"����$�!��z�r�y�s�����v���z���������������y�������������}���������������~���������-�������X�}�z�~�������{������Η͗������������Ù������™��Ǚ����>�?�`�a�_������PQ0Q�PQQ�P�PQQ�P
Q�R�R�R�RHVBVLV5VAVJVIVFVXVZV@V3V=V,V>V8V*V:VW�X�X�X�X�X�X�X�X�X�X�Z�Z�Z�Z�Z[�Z[�Z[[[[g\�]�]�]�]�]�]�]�]�]�]�]�]i^]^`^\^�}�^�^�^I_�_�a�aya�a�a�a�a�a�a�a�a�a�a�a�a�afa�a-bndpd�d�d�d�d�d�d�d�d�d�d�dhd�d�dvezeye{e�e�e�f�f�f�f�f�f�fjjj�i�ij�i�i j�i�i�ijj�i'j�i�ij�i�i@jj�i�i
j�i�i	jjj%jj�i&jj�ijQk�k�k�k�kll�klAo&o~o�o�o�o�o�o�oboOo�oZo�ovolo�oUoroRoPoWo�o�o]ooaoko}ogo�oSo�oioo�ocowojo{o�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�r�rXsRs^s_s`s]s[sasZsYsbs�t�t�t�t�t}t�t�t|tytuu~u%vvvvv#vv(vv�v�v�v�v�w�w�w�w�x�x�x�x�x�x�x�x�x�x�x�y�y�y�y�y�yvk9z�z�z�z�{�{�{�{�{�{�{�{�{�|�|�|�|�}�}�}�}�}�}~�}�}�}�}�}�}�}v���������d�g����������������O�S�R�P�N�Q�$�;���)��	�
��
�'����+������*�������������(��.�������1�&������� �0���/�b�V�c�d�w��s�X�T�[�R�a�Z�Q�^�m�j�P�N�_�]�o�l�z�n�\�e�O�{�u�b�g�i�Z������������	����������ϊƊ��ӊъԊՊ��׊����Ŋ؊Ê����ي>�M����ߌٌ�ڌ݌猠������� �#�%�$�.������&�'��������,�$��� �#���s�p�o�g�k�/�+�)�*�2�&�.���������������ВÒĒ��ْ��ϒ�ߒؒ�גݒ̒�’�ʒȒΒ�͒Ւɒ�ޒ�ђӒ���ƒ��|�������������Ӗ���Z�������Зϗ��&�)�(� ��'�����������ܙ͙ϙәԙΙəؙ֙˙י̙�������F�C�g�t�q�f�v�u�p�h�d�l����������������������Ӟ��QQQQQ�Q4S�SpV`VnVsVfVcVmVrV^VwVWW�X�X�X�X�X�X�X�X[[[![[[[[([[ [[�[�]�]�]�]�]�]�]�]�]�]�]�]�]g^h^f^o^�^�^�^�^�^K_�_�a�a�a�a�a�a�a�a�a�a�a�a�d�d�d�d�d�d�d�d�d�d�d3ee|e�e�f�f�f�f�f�f�f�f�f�f#g4jfjIjgj2jhj>j]jmjvj[jQj(jZj;j?jAjjjdjPjOjTjojij`j<j^jVjUjMjNjFjUkTkVk�k�k�k�k�klll�o�o�o�o�o�o�o^o�o�o�o�o�op�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�r�risfsgslsesksjst�t�t�t�t�t�tu�u/v-v1v=v3v<v5v2v0v�v�v�w�w�w�w�w�w�w�w�w�w�x�x�x�x�x�x�x�x�x�x�x�x�yDzHzGz�z�z�z�z�z�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�|�|�|�|�|~!~~~~ ~~~~~~"~~~~
~~%~$~C{|z��*�)�l��������������������������U�V�W�V�E�k�M�S�a�X�@�F�d�A�b�D�Q�G�c�>�[�q�N�n�u�U�g�`���f�]�T�e�l�c�e�d�������������������y������������������������&�0�-�.�'�1�"�)�#�/�,�������݊��ߊ�Ȋފ�����������������l�n�����3�>�8�@�E�6�<�=�A�0�?���6�.�5�2�9�7�4�v�y�{�����3�5�6�����������'������z�8�<��#���F�-��
�˒���%������4��$���)�9�5�*������	�������͕����������������Ԗ����������5�/�2�$��'�)�����������癹���������������3�������|�~�{���������z���}���%�� ���)���"��������������՞֞���=�&Q%Q"Q$Q Q)Q�R�V�V�V�V�V�V~V�VV�V�X�X�X�X-[%[2[#[,['[&[/[.[{[�[�[�]l^j^�_�_�a�a�a�a�a�a�a�a�a�d�d�d�d�d�d�e�e�e�e�f�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jj�j�j�j�j�j[k�k	l�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�qssnsos�t�t�t�t�t�t�t�t�tuuuu�uCvHvIvGv�v�v�w�w�w�w�w�w�w�w�w�x�xy�x�x�xy�x�xy�y�y\z[zVzXzTzZz�z�z�z||�{|�{�{|�{|�{|	|||�{�{|�{�{|
|�|-~<~B~3~H�8~*~I~@~G~)~L~0~;~6~D~:~E~}��,���ā́ʁŁǁ���[�Z�\�����������������{�������w�|�����z�x�W�����������������������y�v�������h�������Ň������������ɇLJ̇����ćʇ����������އ��5�3�<�>�A�R�7�B���������������"�����
������O�p�r�q�o�������o�N�M�S�P�L�G�C�@���~�8�����������������������d�V�G�|�X�\�v�I�P�Q�`�m���L�j�y�W�U�R�O�q�w�{�a�^�c�g���N�Y�Ǖ��ɕÕŕ�������� ���������������՗ԗ�A�D�J�I�E�C�%�+�,�*�3�2�/�-�1�0�����������������������������������H�������������������������3�A�g�6�.�/�1�8�0�E�B�C�>�7�@�=��-���������Ȟڞ����$�#�"�T���1Q-Q.Q�V�V�V�V�V�VpY<[i\j\�]m^n^�a�a�a�a�a�a�a�a�a�a�de�d�dee�d�e�e�f�f�f�j�j�j�j�j�j�j�j�j�j�j^k�klpp
ppppp�op�o&p�o�o
pr�q�qr�qvs�t�t�t�t�t�t�t�tuu\vdvYvPvSvWvZv�v�v�v�w�w�xyyy	yyyy�y�y_z|)|| ||-||&|(|"|%|0|\~P~V~c~X~b~_~Q~`~W~S~����u�сҁЁ_�^���ƅ��Ņ������Džą��˅΅ȅŅ����҅$�������i����ۇ���߇��ԇ܇Ӈ�؇㇤�ׇه���݇S�K�O�L�F�P�Q�I�*�'�#�3�0�5�G�/�<�>�1�%�7�&�6�.�$�;�=�:�B�u������������\�b�`�W�V�^�e�g�[�Z�a�]�i�T�F�G�H�K�(�:�;�>�������������������������������������������������������������ҕӕѕ��זږ�]ߖؖݖ#�"�%�����������������חٗ֗ؗ��P�Q�R���A�<�:���	�
���
������ܚ���)�5�J�L�K�ǛƛÛ��������ӛ��ě����\�S�O�J�[�K�Y�V�L�W�R�T�_�X�Z�����ߞ���%�+�*�)�(�L�U�4Q5Q�R�R�S�V�V�V�V�V�V�X�X�XY=[>[?[�]p^�_�aee
e	eee�e�e�e�f�j�j�j�j�j�j�j�j�j�j�j�j�j`k�klp'p pp+p!p"p#p)pp$pp*pr
rrrr�r�r�r�r�r�t�t�t�tu`v�w�w�w�wyy!yyyy�ygzhz3|<|9|,|;|�|�|v~u~x~p~w~o~z~r~t~h~KJ�����x�ׁՁd�a�c����م��څׅ��؅߅�܅х���ޅ���������	���������
��b�Z�[�W�a�\�X�]�Y���������P�H�J�@�S�V�T�K�U�Q�B�R�W�C�w�v�����	���������m�x�s�j�o�{�ŽR�Q�O�P�S���@�?�����ޓǓϓ“ړГ���̓ٓ���ʓԓ��ՓēΓ��ғ�}�ڕە�)�+�,�(�&�������ݗޗߗ\�Y�]�W���������H�G�C�������%��$��"� �'�#����š�
���7����ޛ����ԛכ�ܛٛ�՛�ڛw���������q���x�������}�k�t�u�p�i���s�{���o�y����h���������-�@�A�M�V�W�X�7S�V�V�V�XE[�]�]�^�^�_�_�aeeee�e�f�f�f�j�j�j�j�j�j�j�j<p5p/p7p4p1pBp8p?p:p9p@p;p3pAprr�r}s|s�t�v�v�v�v�w�w�w�w�w%y#y'y(y$y)y�ynzlzmz�zI|H|J|G|E|�|{~~~�~�~��y�ہف�h�i�"�����������	�����������c�f�����`�j�]�h�c�e�g�m���������Y�V�W�U�X�Z���C�A������������� �������(��
������������	���
����������ޕ�ߕ.�/���������`�b�c�_���˜P�N�Y�L�K�S�2�4�1�,�*�6�)�.�8�-�ǚʚƚ�����������@������	�����������������������������������������������������������0�.�[�`�^�]�Y���:Q9Q�R�R�V�V�VH[G[�]�]�^�aek�jk�jkCpDpJpHpIpEpFprrr~sujv�w-y1y/yT|S|�|�~�~�~�~�~�~M�0�݁�*�&��#���'�.�!� �)��%�)��� �$��+�J�m�i�n�k���y�x�E�z�{���������^�[�]�F�D�E���?�;�6�)�=�<�0�9�*�7�,�@�1����5�:����d�ɘƘ��X�V�9�=�F�D�B�A�:�?�͚����:�R�+���,�#�(�)�$�!���������ǝʝϝ��ŝÝ����Ν������ȝ����̝��͝��z���������1�N�e�d����N�V�V�VqYK[L[�]�]�^!e e&e"ekk	k
lUpVpWpRprr�rs�t�t�t�tmv�v5y�ypzqzW|\|Y|[|Z|�|�|�~O�ށk�4�5�3�,�2�6�,�(�&�*�%�q�������~�������������������������`�b�G�L�P�J�K�O�G�E�H�I�F�?��j�i�˘T�[�N�S�T�L�O�H�J�I�R�P�К�+�;�V�U�F�H�?�D�9�3�A�<�7�4�2�=�6�۝ҝޝڝ˝Нܝѝߝ�ٝ؝֝��՝ݝ���5�3�2�B�k�����=Q�R�X�XrYM[�]/�O_bbb)e%e�e�fkkk�k[pZp"r�s�s�spv�wg|f|�~l�:�@�9�<�1�;�>�0�2�.�3�v�t�s�����������E����d�c���b�U�]�W�^�ėŗ�V�Y��� �R�X�P�J�M�K�U�Y�L�N����������������������žО����8�7�6�C�O�q�p�n�o��V�VN[m\-e�f�fk_pap]p`p#r�t�t�w8y�y�yj|�~�m�C�8�7�5�K�����������������‘k�h�i��F�C�G�Ǘ�^�՚Y�c�g�f�b�^�`����������	���������F�t�u�v��V.e�ekkkkbp&r�r�w�w9yi|k|�|�~�~�~�~��F�G�H�y�z�|�{�������������n�m�o�q�s�I�r�_�h�n�m��
���������	�G�x�{�z�y�Wfpo|<�����Ñt�x�v�u�`�t�s�q�u�����
���hpep�|j�>�=�?�������ɎK�s�t�̘a���d�f�g�$���H�bk'rL���������i�h�.��)rK�����y���uvk�z��ipjp��~�I����x��ψ�XR`�|�Z0�00�" ����0�& % P�d�R��T�U�V�W�\� 1� 3���4�O��	�5�6�[�]�7�8�009�:�00;�<�
00=�>�0	0?�@�0
0A�B�00C�D�Y�Z�[�\�]�^�    005 2 ��
�; �0�%�%�%�%�%&&�%�%�%�%�%�%�2!> ��?���I�J�M�N�K�L�_�`�a��
����"���f"g"`""R"a"b�c�d�e�f�<")"*"�" ""�"�3�3+"."5"4"@&B&A&	&�!�!�!�!�!�!�!�!%"#"�����<���0��� �!	!i�j�k��3�3�3�3�3�3�3�3�3�YQ[Q^Q]QaQcQ�U�t�|�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%<%4%,%$%%�%%%�%%%%%m%n%p%o%P%^%j%a%�%�%�%�%q%r%s%����������`!a!b!c!d!e!f!g!h!i!!0"0#0$0%0&0'0(0)0��DS��!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�������������������������������������������������1111	1
111
1111111111111111111 1!1"1#1$1%1&1'1(1)1�����NYNNNCN]N�N�N�N?QeQkQ�QRR�RSAS\S�S	NNN
N+N8N�QENHN_N^N�N�N@QR�RCS�S�SW�XY'YsYP[Q[S[�[\"\8\q\�]�]�]�]�]�]r^�^__MbNN
N-N0N9NKN9\�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NCQAQgQmQnQlQ�Q�QRRR�R�R�RS9SHSGSES^S�S�S�S�S�X)Y+Y*Y-YT[\$\:\o\�]{^�^__�_b6bKbNb/e�e�e�e�e�e�fg(g kbkyk�k�k�kl4lkp*r6r;rGrYr[r�r�sNNNNN;NMNONNN�N�N�N�N�N�N�N�N�N�NEQDQ�Q�Q�Q�Q�Q�Q
R�R�RSSSS�NJSISaS`SoSnS�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�V�VY.Y1YtYvYU[�[<\�]�]�]^^s^|^___�_
bSbTbRbQb�e�e.g,g*g+g-gck�kll8lAl@l>l�r�s�s�t�tuu(u)u0u1u2u3u�u}v�v�v�v�w�w�w:y�ytz�zNNRNSNiN�N�N�N�N�N	OO
OO
OOOO�N�N�N�N�N�NOOIQGQFQHQhQqQ�Q�QRRRRR�RS!S SpSqS	TTT
TTTTTT
TTTTTT�V�V�V3W0W(W-W,W/W)WYY7Y8Y�YxY�Y}YyY�Y�YW[X[�[�[�[�[�[\y\�]^v^t^__�_�_bb
bbcb[bXb6e�e�e�e�e�f�f	g=g4g1g5g!kdk{kl]lWlYl_l`lPlUlal[lMlNlpp_r]r~v�zs|�|6������3��������������n�r�~�k�@�L�c��!�2N�NMOOOGOWO^O4O[OUO0OPOQO=O:O8OCOTO<OFOcO\O`O/ONO6OYO]OHOZOLQKQMQuQ�Q�Q%R$R)R*R(R�R�R�R�R#SsSuST-TT>T&TNT'TFTCT3THTBTT)TJT9T;T8T.T5T6T T<T@T1T+TT,T�V�V�V�VJWQW@WMWGWNW>WPWOW;W�X>Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y][\[Z[[[�[�[�[,\@\A\?\>\�\�\�\�\�]^�^�^�^�^__d_b_w_y_�_�_�_�_�_�_�_�_bb�b�b�b�bvb�bmb�b|b~bybsb�bob�bnb�b�b�b�b9e;e8e�e�f_gNgOgPgQg\gVg^gIgFg`gSgWgek�kBl^l�l�l�l�l�l�ljlzl�lpl�lhl�l�l}l�lrl~ltl�lvl�l�l�l�lvp|p}pxpbrar`r�r�r�s,u+u7u8u�v�v�w�y�y�yvz�|U��������������o���������҉�7�F�U���d�p�����ʎ����Əŏď�]����������I�Ƒ̑2�.�1�*�,�&NVNsN�N�N�N�N�NoO�O�OsOOlO�O�O�O�OpOuO�OiO{O�O~O�O�OzOTQRQUQiQwQvQxQ�Q�Q;R8R7R:R0R.R6RAR�R�RRSTSSSQSfSwSxSyS�S�S�SsTuT�TxT�T�T{TwT�T�T�T|T�TqTvT�T�TbThT�T}T�T�V�WwWjWiWaWfWdW|WYIYGYHYDYTY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y_[d[c[�[�[�[�[�[�[\H\E\F\�\�\�\�\�\�\�\^^^^^^x^�^�^�^�^�^�^&_'_)_�_�__|_�_�_�_�_�_``/`5``*``!`'`)`+``bb?b>b@bb�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b>e�e�e�efffffffff
ff
ggmg�g�gqg�gsgwg�g�g�gogpgg�g~g�gug�g�g|gjgrg#kfkgkkll�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�p�p�p�p�p,r-r8rHrgrir�r�r�r�r�r�s�s�s�s�s=u�u�u�u�v�v�v�v�w�w>y@yAy�y�yzzyz�z�|T�������������������������
���������������������������������N�q�Rh�ˎΏԏя��������Ǒёw����@�?�;�D�B����R�^��N�N�N�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OWQ�Q�Q�QNRCRJRMRLRKRGR�R�R�R�R
SWS{S�S�S�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�V�W�W�W�W�W�W�W�WUYQYOYNYPY�Y�Y�Y�Y�YZ�Y�Y�Y�YZ�Yi[�[�[�[�[�[\N\O\M\K\�\�\�]^%^^}^�^�^�^_-_e_�_�_�_�_�_�_�_`` `%``(`M`p`h`b`F`C`l`k`j`d`Ab�bc	c�b�bc�b�bc�b�b�b�b�b�bcc?eEe�e�e�e%f-f f'f/ff(f1f$f�f�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�gjk�k�k�k�k�kl�lm2m*mAm%mm1mmm;m=m>m6mm�l9m'm8m)m.m5mm+m�p�p�p�p�p�p�p�p�p0rrrortr�r�r�r�s�s�s�s�s�s�su-uOuLuNuKu�u�u�u�u�uxv�v�v�v�v�v�v�vw�v�v	ww�v�vw�wxxx
xFyIyHyGy�y�y�y�y�yz�z�z�z}|}}}	}}}}8����
��6�ր�ڀÀĀ̀�ۀ΀ހ�݀�"�����ۂ����	�҂ׂ��܂Ԃтނӂ߂��P�y�{�z�M�k���ԉ�������t�s���͎̎���������ʐΐ��ÐK�J�͑��P�K�L�M�b�i�˗�����ۘߘ����XN�NP
P#P�O&P%P�O)PPP<PPPPP�OPP(P�O!PPPP�O�O-P*P�O+P	P|Q�Q�Q�Q�Q�Q�Q�QVR\RTR[R]R*SS�S�S�S�TUU7U�T�T�TU�TU�T�T�T	U�T�T�T'UU�TUWW�W�W�W�W	XYWYXYZYZZZZZZ�Y Z#Z)Z%ZZ	Zk[X\�[�[�[�[�[�[�[�[\Q\U\P\�\�\�\�\�\�\�\]�\�]-^+^�^�^�^1_�_�_�_Y`c`e`P`U`m`i`o`�`�`�`�`�`�`�`�`Gb�bc�bNc>c/cUcBcFcOcIc:cPc=c*c+c(cMcLcHeIe�e�e�eBfIfOfCfRfLfEfAf�fggg!h8hHhFhSh9hBhTh)h�hhLhQh=h�gPh@h<hCh*hEhhhAh�k�k�k#l'l(l&l$l�ljm�m�m�mfmxmwmYm�mlm�mnmZmtmim�m�mym�mem�m�p�p�p�p�p�p9ryr�r�r�r�r�r�s�s	t�s�s�s�sTu]u\uZuYu�u�u�u�u�u�u�u�u�u�u�v�v�v�v�v)ww w(w�w0x'x8xx4x7x%x-x xx2xUyPy`y_yVy^y]yWyZy�y�y�y�y�y�y�y�z�z�z{{�|!}}}
} }"}}}}}}
}}}:_��������=�?��������������
��������*�+�(�,���+�R�T�J�8�P�I�5�4�O�2�9�6��@�1�(�C�T�����������������p�w�����}�y������
������H�z�y�����w���ҎԎώ�������������������ݐ�R�M�L�ؑݑבّܑ��b�c�a�[�]�d�X�^���☬���ؚ%�2�<�~NzP}P\PGPCPLPZPIPePvPNPUPuPtPwPOPPoPmP\Q�Q�QjRoR�R�R�R�RSSS?S@S>S�S�fFUjUfUDU^UaUCUJU1UVUOUUU/UdU8U.U\U,UcU3UAUWUWW	W�WX
XX�W�W�WX5X�W�W YbY6ZAZIZfZjZ@Z<ZbZZZFZJZp[�[�[�[�[�[�[	\\\`\\\]\]]]]]"]])]]]$]']]�]8^6^3^7^�^�^�^�^�^5_7_W_l_i_k_�_�_�_�_�_�_�_`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`bbHb�c�crc�c�c�cwcgc�c�cqc�c�c�c�ckc�c�c�c�c�c�c�c�c�c{cichczc]eVeQeYeWe_UOeXeUeTe�e�e�e�e�e�e�e]fZfdfhfff^f�f�Rg�h�h�h�h�hhvh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h2k�k�k�k+l�m�m�m�m�m�m�m�m�m�mn�m�m�m�m�m�m�m�m�m�m�m�mn�m�m�m�m�m�m�m�m�m�m�m�m�m�m�p	q
q�p�p=r}r�rsssss�st
ttt�s
t�t�t�tu"ueufubupu�u�u�u�u�u�u�v�v�v�v7w>w<w6w8w:wkxCxNxeyhymy�y�z�z {({{,{&{{{.{�|�|�|F}C}q}.}9}<}@}0}3}D}/}B}2}1}=������J�F�/��#�+�)�0�$��5�7�6�9�������x�������������������w�{�|�����U�j_dž����Ć��Ɔˆ����ɆS�������������������*��#�%�1�-���"�I�Z�������������g�f�����ێߎ�
���#������ ��"�������W�Α������鑉�j�u�s�x�p�t�v�w�l������z�z��Z��u�������P�P�P�P�P�P�P�P�Pg�QrRtRuRiR�R�R�RZS�S{U�U�U|U�U�U�U�U�U�U�U�U�U�U�U�U�U>U�U�U�U�U�U~U�U�U�U
W/X*X4X$X0X1X!XX X�X�X`YwZ�ZZ�Z�Z�Zs[q[�[�[�[�[
\\1\L]P]4]G]�]E^=^@^C^~^�^�^�^�^<_m_�_�_�_�`�`�`�`�`a#a�`a�`�`�`ha�`a�`	aaabIb�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cvc�c�c�cRd�c�c^efebece�e�e�enfpftfvfof�fzf~fwf�f�fgg�h�h�h�h�hi�h�h�h�h�h�h�h�h�h�h
iii�h�hni�h>k:k=k�k�k�k�k.l/l,l/n8nTn!n2ngnJn n%n#nn[nXn$nVnnn-n&non4nMn:n,nCnn>n�n�nnNncnDnrnin_nqq&q0q!q6qnqqLr�r�r6s%s4s)s:t*t3t"t%t5t6t4t/tt&t(t%u&ukuju�u�u�u�u�u�u�u{v|v�v�v�v�vOw�w]xlxox
zzzzz�z�z�z�z�zI{V{F{P{R{T{M{K{O{Q{�|�|^}P}h}U}+}n}r}a}f}b}p}s}�U���R���U�T�K�Q�N�9�F�>�L�S�t�������
��������W�
���̃���ʃ8���܃�ԃ߃[�߆ن�Ԇۆ�ІކW���ˆ������;�`�U�^�<�A�T�[�P�F�4�:�6�V�a���������������������������������΍ݍˍڍэ̍ۍƍ��������.�5�1�8�2�6����	���c�e�ϑ��#�	��
������������������������}�������r�����ŖĖƖǖ��̗��������혮���Þ͞ў�N�P�P�P�P�P�P�P�P�P�P�PRwR}R�R�R�R�R�R/S�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UWW^XQXXXWXZXTXkXLXmXJXbXRXKXgY�Z�Z�Z�Z�Z�Z�Z�Z�Zi]o]L^y^�^�^_Y_�_�_aaHaa�`a�`aaNaLaDaMa>a4a'a
aa7a!b"bd>dd*d-d=d,dddd
d6ddddle�e�e�f�f�f�f�f�f�f�fg�imiZiwi`iTiui0i�iJihiki^iSiyi�i]ici[iGkrk�k�k�k�k�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nNqYqiqdqIqgq\qlqfqLqeq^qFqhqVq:rRr7sEs?s>sotZtUt_t^tAt?tYt[t\tvuxuv�uv�u�u�u�u�u�u�v�v[wkwfw^wcwywjwlw\wewhwbw�w�x�x�x�x�x�x|x�x�xxzyy�y,��yzz zzzz�z�zw{�{`{n{g{�|�|�|�}y}�}�}�}[}nijr���V�X�����q�p�x�e�n�s�k�y�z�f��G���w�=�1�u�f�k�I�l�[�<�5�a�c�i�m�F�^�\�_��������������
�Y�߈Ԉو܈؈݈�ʈՈ҈���k�r�s�f�i�p���|�c���q���m�b�n�l�y�{�>�h�b�����ʌnjȌČ��̌Ō�ߍ�����捲��	���
�����K�J�S�B�T�<�U�P�G�O�N�M�Q�>�A���l�j�i�ɑ7�W�8�=�@�>�[�K�d�Q�4�I�M�E�9�?�Z���������͖˖ɖʖ��������V�t�v����
�����������������霂��� ��P�P�P�P�P�P�P�P�P�P�P�PbQ�Q�R�R1S�S�UVVV�UVV	V
VV�UVVVV�UWWuX~X�X�X�XyX�X}X�X%Y"Y$YjYiY�Z�Z�Z�Z�Z�Z�Zu[�[�[�[�[�[�[�[�[�[
\b\�]�][^c^U^W^T^�^�^
_F_p_�_Ga?aKawabaca_aZaXaua*b�dXdTd�dxd_dzdQdgd4dmd{dre�e�e�e�f�f�f�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iIkLk3l3oo�no�n)o>o o,ooo"o�n�no1o8o2o#oo+o/o�o*o�no�n�n�n�q�q}q�q�q�q>r�r�rDsPsdtctjtptmtu�u'v
vv	vv�v�v�w}wwaw�x�x�x�x�x�x�y�y�y.z1z�z�z�z�z�{�{�{u{�{�{�{�{�{�{�{�|�|�|�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}p���^�Z���P�����������������K�Ʉ��ƄĄ��������˄����ӄ����фʄ?��;�"�%�4��U�7�)���������������������������������������j�����ӌьҌk�������������`�X�\�c�Y�^�b�]�[����u�x�w�t�x���������{�������|���������������������̖Җ�|��������������	��������A�B��󜼞;�J�QQ�P�P�PQQ	QQ�Q�R�R�R�R�R�R�S.V;V9V2V?V4V)VSVNVWVtV6V/V0V�X�X�X�X�X�X�X�XmY	[�Z[�Z[[�[�[�[�[d\e\�]�]b^_^a^�^�^�^�^�^�^H_q_�_�_vagana]aUa�a|apaka~a�a�a�a�a�a�a�a�a�a.bidodyd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�duewexe�f�f�f�f#jj�ijjj�i!jj
j�ijj�ijPkNk�k�k�k?o|o�oQofoTo�omo[oxono�ozopodo�oXo�noo`o_o�q�q�q�qVr�rNsWsit�t�t~t�tu v)vv$v&v!v"v�v�v�v�w�w�w�w�w�x�x�x�x�x�x�x�x?z<z@z=z7z;z�z�z�{�{�{�{�{�{�{�{�{�|�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}uw��&��������������=���,�-���#�!���%������t�v�`�f�x�h�Y�W�L�S�[�]������
���ҊNJĊ��ˊ����ɊŠ����֊͊����ۊL�N�l��ތ������܌��m�����+���"��)��!�������)�&�*���%�i�n�h�m�w�0�-�'�1���������Œ����꒬�������Ғǒ𒲒�������	�`�������!�+����
����ݙЙߙۙљՙҙٙ����'�E�D�w�o��	������Ξ�XR�QQQQQ�Q�Q�Q�R�R�RYVkVyViVdVxVjVhVeVqVoVlVbVvV�X�X�X�XnY[4[x[�[\J_�a�a�a�a�a�a�a�a�a0b�d�d�d�d�d�d�d�d�d�d�d�d�d�dte�f�f�f�f�f�f=j8j:jYjkjXj9jDjbjajKjGj5j_jHjYkwkl�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�q�q�q�q�q�qhs�t�t�t�t�t�tu
u4v8v:v�v�v�w�w�w�w�x�x�x�x�yMzNzFzLzKz�z�{|�{�{�{�{�{�{�|�|
~~~~#~~~	~~y����(����������X�Y�J�Y�H�h�i�C�I�m�j�^�����������a�*�2�%�+�!����������܊�����������k�m����D�1�4�B�9�5�;�/�8�3�����u�t�x�r�|�z�4��� �6���3�/�"���+����&�!��.����������Ֆ���
���[�\�f���0�8�;�7�-�9�$��(���!����񙸚�����(����#�&�(���؞Ԟ����*QQ!Q2Q�R�V�V�V�V�V�V�X�X�X�X0[*[$[z[7\h\�]�]�]�]k^L_�_�a�a�a�a�a2b4b�d�d�d�d�d�d�d�d�d�d�e�e�f�f�j�j�j�j�j�j�j~j�j�j�j\k�k�kl�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�q�q�q5rFrpsrs�t�t�t�tFvBvLv�v�w�w�w�w�w�w�w�x�x�x�xy�y�yWz�z|
|�{�{|�{�|�|�|�|�|�|�|.~>~F~7~2~C~+~=~1~E~A~4~9~H~5~?~/~D��q�r�p�o�s�ƁÁ��������Ɂ���	�q�����~�����������������g���ч��҇Ƈ������ȇˇ;�6�D�8�=�������
� ����A�?�s�������������I�K�H�J�D�>�B�E�?��}���������9�������M���(�u�J�e�K��~�l�[�p�Z�T�ʕ˕̕ȕƕ����֖����ӗF���5������������;�?���Ϟޞܞݞ۞>�K��S�V�V�X�X8[]_�a3b�d�d�de�d�d�d�e�f&g�j�j�j�j�j�j�j�j_kxk�k	pp�op�opp�q�q�q�qwsus�t�tuVvXvRv�w�w�w�wy�yazbz`z�z�z+|'|*||#|!|�|T~U~^~Z~a~R~Y~H��w�v�́ρ
�υ��ͅЅɅ����������������(�9�,�+�P��Y�c�f�d�_�U���I�M�����������Б����������������������ԕ֕ЕՕ�ܖٖۖޖ$���������M�O�L�N�S���>�?�=�.��������O�N�M�ʛɛ��ț��Q�]�`���,�3Q�V�X�X�X�[���^�a�a�a�aee�f�f�j�j�j�jpp(pppppr
rXr�rxszs�t�t�t�u�u_vav�wy�ykziz>|?|8|=|7|@|k~m~y~i~j~�s~���؁�݅�Յ������
�����`�_�V�^�A�\�X�I�Z�N�O�F�Y��
�|�r���v�l�z�t�T�N������������ѓߓÓȓܓݓ֓�͓ؓ�ד�ܕ���*�'�a�ܗ��^�X�[���E�I���
���֛ۛ��a�r�j�l����������R�V�V�V�V�V�X@[C[}[�[�]�a�aeee�f'g�j>p0p2pr{s�tbvev&y*y,y+y�z�zL|C|M|�|�|��}~|~�~L�ځf�����������
���d�����p�l�f�o�_�k��
�����������ˑ�����0�ĘR�Q���+�0�7�5��
�y����/�_�c�a�7Q8Q�V�V�VYl\�]�a�aee�e�f�jk�j�kLpr�r�t�tiv�wP|�~�~��-��#�"�!��j�l���t�w�}��������_�����.�3�5�:�8�2�+��8�9�2���g�e�W�E�C�@�>�ϚT�Q�-�%�����������\�f�g�<Q;Q�V�V�V[�]�]N_�a$e
kakQpXp�s�t�unvlv�y`|_|~�}�߁r�o�����������a�H�D�Q�R�=�>�×��k�U�U�M�Қ�I�1�>�;�ӝם4�l�j����V�]b#e+e*e�fk�t�zd|c|e|�~�~�~�8�?�1�������c�`�d�h�o�\�Z�[�W�ӚԚњT�W�V�坟���V�X,e^pqvrv�wP�6�9�b�������w����j�B�H�D�Ɨp�_�"�X�_�����|�}��w�r��^kcpl|n|;�������r�p�q�^�֚#�̞dp�w��w�ɗb�e��~����ő}�~�|�w�x���T���(rj�1���r|�0�0�00A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO`$a$b$c$d$e$f$g$h$i$t$u$v$w$x$y$z${$|$}$	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\][^_EABCDEFGHIJKLMNOPQRSTUVWXYZ{|}Y�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� big5	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� binary	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��N���}�L���~���������������������������������������������������������ƒÃăŃƃǃȃɃʃ˃̃̓΃σЃу҃ӃԃՃփF�@�A�B�C�D�E�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�p�q�r�s�t�u�w�x�y�z�{�|�}�~�������������������������������������v�]�\�e�f�g�h�����d�c���������������T�U�V�W�X�Y�Z�[�\�]�@�A�B�C�D�E�F�G�H�I���������ˁ́́݁΁ށ�������假���ځa�ȁɁ���������������߁��������������ہ��܁@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S����������������������������������������������������������������������������������������������������@�A�B�V�X�Y�Z�q�r�s�t�u�v�w�x�y�z�����k�l���������������������������������������������������������������������������‚ÂĂłƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂قڂۂ܂݂ނ߂������������������J�K�T�U�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������E�[�R�S�����������������e�i�`�c�a�k�j�d�l�f�n�_�m�b�g�h�~�������r�s�o�p�q�u�t���ꈚ������O�㏺�s�^���N���������u��������h�����������ۊO�厥�����T�v�V���R�h娘揩��������������T�������\����������]�݌܌�j�i�����������S����划���������������l�Y�m�������w����������e�d�����t��W�����i��ߗȈ����‹������C�j�k��l�˜Ɉތꊚ���x���`���Ę���L�m�f�����ϒA�Șʈ�Z���C�̑��n�ǘ]�ØŘ�ƘC�ΘјϘ����ɘ͘�g���Ҙʘp����˘Иo�r�Ә̘q���ˈ����D������N���֕W����a�r�s�טܘژ՘��ؘۘ٘ە֘M���ݘޘC��o�U������v���q�Œ{����|����ߘw�؎�u��l�㘑����ϗ�`����t�z��x���̈Ε��������y�Î������U�����T���{�P�����Íb���B�����X�C�͋@�A�������l�D�}���E�H�F�m�G�I�|�K�J�ƕV�M�N���L��Q�P�O�ԘR���S�D�זU�T�W�V�X�Y����Z�[�������~���[�Ɩe���Z�\�}���]�����S�_�`�����Z�a��������T���b�c��~�f���e�čg���h�`�i�j�k��ʎ����n�l���m�y�o�p�q�~�u�s�t�r��v���w�����x�y�y�������Ùz���Ë{�}�����}����~���M�����ʓ��o�������n�����ؐ��������Y����������ʕ��������������������h���䒍���퍎���O�����U�������܍��������菛�������n�����c���������������͗�����������w�������w��J�������N�����u���E�ו������������������啫�����΋����M���������َ��ܖ�������������������k�����x���������ٔ��������C�������\��������ߌ����™ڔ��쑦��P���m�ę�T�řƙK��늌���p���ə��ș��ʙ���˙З����̙Ι͙~�X�}�ϙЙ����љ��Q�ҙ����y�F�o�����f���������ՙb�p���Ì�ٙ@�������ڙؙ‰䑶�j�E�����i�ۙܙh�e���g�ݒD�����@���f���N���i�۔�܊ߙ���z������ݙ�ޙC������ۓ������������Č��������a���������B�������@���]��P���D��C���i�A�������ƍE���N�F�G�����L�K�N�M�J���S���O�H���I���S�B���Y�X�O���P��U���R��[�V�W�T�Z�Q�`�e�a�\�f�P���h�A�^���b�[���슅�c�_���i�g�r�i���d��c�m�k���p�j�n�l�k�o�r�w�u�t�Q�Éq�s���R�v�܉����}�{�|�~�\�X�x�y��������������ӓ������d���������X�����������������������������d���l����c�����͈}���Ō������ޕ����������������������y�����ݍ\�n����������ϋV�������B���������R���ؒ��������^�����C�_��������������������������������W��u�������|���x�����͑��š‘ÚĚƚ����ꁉ��g��̚��ۗ�ȚY�˚��h�����˒Ǎǚ��U�ɚŚo�͚m���Κ���Ē��Кn�њ֚����՚ϚҚԚ��Ǖךd���ؚٚ��ښܚۚޚӚ�ߚݚm�p�s�ᚺ�누�ْ������ϕ蚟�ĉ�[�O�Ǚg���������V���v������Έ�����ޓ���t��_���z��������������������������D�������z�@�D�A�@�ܔϖD�J�W�d�����B�E���ÑW�i�F�����ȍ��G�o�n���ƌ��ψK�L�I�W���H�ÖP�����p�Ј��Q�O���R�P�N�P�M�ؕ�V�W���S�K�k�U���X�w�Y�T���}�Z�Q�[�_�\�ʼn^���]���k�d�a���`�b�c�e�f��h�g�i��l�ڒd�j�m�n�q�o�p�q�r�E�s�������t�u�y�F�ЖG�njv�w�w���x���y�z�{�}�~����F���v�����G���@�����蒶�X����q�鐺�G���{�ɍQ�����Ɖ��e�h���⎃��Г������x�������������Q���@�lj��������J�˞R�������������������Α�����ˎ��������ш��q��������������������ޖ��ċA�����ڎK��s���A�Nj��������͓��r�����������W���j�Ǝw�������ԓR�������򊨛������Z������Бx�����݊������������������㉴��������������s��������������R���śěÛ����›������ɛƛț��Ǜ������ʛ����˛̛ϛΛ͛����՛ћЛқӛ֛�����כԛ؛ފٛ��ۛڛܛݛ�B�����H���I���ޛ��Ȍߛ��b��J���F�Ћs�z��������������t�ȐёA������X���蛝��y��훋�����������N���K����c�H����L���ݔ������X�M�{���x���Ɍ�����N�f�����p�����L�����f�@�C�D�B�_���F�E�A�G�H�I�L�J�K�M����N����U�O���ٕP�M�Q���T��������U�|�����V���O�o����햷�ʌW�X�^��������Y�J�e�Z�g�[���\�]�_���`�a�b�S�R�c�`�F���ʍV���j�d���e�e�f��ޔi�����h�g�a�ґm�k�j������l�k�]���p�o�n�q��r���z�s���������O�t�J�S�K���E�u�u�Y�Z���z�����w�����y�O�x�v���|�������{���|������v�ӑ}�}�����������������������������������P�����������~�������p�����������������b�������������������������������I���x���Y���ߔ{�������������Փf���������ɐ��҈����y���S�đ���z�������䎷�����D�������������ӈ��������������Ŝ�Ɯ�Ĝǜ��ÜȜɜ����œԑQ���T�֜�̜͜Μ՜Ԝ����Ҝd�S�Ϝ��ќԈӜʜМלc�˜|�J�ڜޜ����ߜܜٜ�؜ݜ����e��ۜ���������蜧���������������圜��������������^����������ʐ����@���A��B�C�Y�D�E�F�Ցˌߖ[���G����ˍH�ő���K�I�L�J�M�����}��N�Q���Z�O�V���P�c�}�R�S�W���T�R�ܐe�����┫������Z�����c�S�]�d�_�f�b�a���[���Y����U�X�S�ِ��`�q���g���@�h�m�i���n�A���E�\���k�w�l�ˆg�������j�����U��Ҕp�}���J�q�s�o�ߕ��{���̎��~�����x����P�v�|���{���u�z�r�t�@�|�|���̍T�y�ڐT�����[�w�d�f�͒}�~�������������`����K�g����������������h�������������r�������������g��ې��E����������̖������T�����Q����P�������d�B��o�h�����i������������^���������F���C���[������������������������������������x�������������U�����̌��ĝ�q�~�ݝs�ŝ��ǝƝ��U�֓h���ȝ��G�~�ɝʝ˝��|�Đk�֍��l���͝ΎΝ��ҋː��ϝa�f�z�V�Н����{�ӝѝԝ��ҝ��՝��֝��؝םٝڝ����U���|���{���۝��ߝ�V�ޝ�����ݝ������Ո̐�����f��t���������c�������E�蝞�W���W��N����������A���Ӕ��i�������q�ŋ�ɉ�����g�È���������b���\�A����������@�ܓ��B���C�j���D�F�G�H�ȋg�X�I�J������f�֙]�\�֑ō���L������K�񍽒L�N�]���M���N�O�ؖ����{�D�Q��p�S�V�U�����R�T�W�����Ljލ��ێ�Z�m�X���Y��ۖ[�\����a�Y�t�^���ܝ�n�f�`���”f���]�c�b�͐��ї��ʉ}�g�e���d�_�͌k�i�ˉg�m�s���Ƒ��u�A�t���^�����_�ђM�p�o�q�n�v�l�j�r�h�����Ď�����`��̒ȓh����I�x�Z���z�����}��j���i�͍{���j����y�Ĉ|�~�ˋK���j�������V���O���������������~���������[������������挜����B�������������������d�ǖ�������_���������I�����������X���������o�����ֈ������A�Œ����������������������������̓������֒k�����ȑ��^�������퓾���ž��Ƌ��|�����ɋ������O�y�����T��|�ҞP�՞�Y�ԞӞОĞ�Þ֞ΞɞƞǞϞ��̞\�ƒ��ʞŞȞl���͞מ�ߞ؞��ޞݞΒ��۞ٞ���������W�ڞ➾�͖�������~�ў����������M�������k��@�ɓ�������h��������@�w�������K�G���F�E�B��D�C�I�E�L���H�J�����M�Q�N���O�ܞR�S�T�U�����Ӌ��~�W�V�Y�\�ԋ��\�[�]�̉V�^���`�_�a�b�c�~��������c���΍�d�e���f�g�i�h�w�}��c�j�l�B�k�m�n�o�p�q�s�r�t���i�u�E�k�v�a�ʚB�w�x�ꕈ�œy�����іz�|�{�~�}�����������C���������X�i�Ô���`���Ĕ����������𓇟]�r�����������������D�������������ד������B���������v��������͉����������������������򐑔���@�����������A�g���D�������ב��j���m��������������Òk�^���F�������������h���������l�����Y�_�Q�\�������C�Z���������O�������@�ܗ����A�U�t���������Ɵ����җßB�i�şʟ��ȟŸW�ɟ��ğ˟����̟[�D�~�����C���ǟY�E�����ύ��a�k���П����ߟٟ��n�ԟݟ��Q�H���֟��͟ϟ`��F�۟I�ӟڟ��؟ܟΌÏX�G�ҟN�՟Ο��џןp��������ퟹ������a�������n��M��J���Ŗ�����������ؑ�����H�B���ޟ��Y�����R��A�����������В����Q�@������N�I�����R�K઒H�גk�E�D�M�G�F�L���C�K�O�P���U�T�V�Y�b�S�L�W�����Q�Z�X�]�[�^�a�Z�G�����\�`��_�J�M���d�h�f�N�O�b�c�g�e�m�m�j�i�l�ғn����P���o�q�p��r��s�Ή��D���܎ЍQ�F�����u�t�R�x�Y�{�v�z�y�_�׈b��}�G���~�|�w�B���T���S����క����ŏR�ďV�W������������U��������Əϔ��ώ������F���o�����n�����M�����Y�R�������ӗ������z�����W�����C�י�������Z�������������ܒ�������ݎ��ꖩ��u��������ЕŔ��v��������Ė����S�q�������������ҍ���������]�������Ɣ[������\����������ό���_���������Ɠ����K���T���������Җ����—]�����L�������P�Q�������������b�������l���_�����������ʋ���ߊ�����`���ω��a�X�����d�b����c���]�ǔ����f���������e������g�i�h�j���ԗՋ��i������������l�������ڗk��������������������l�����m�����Š��������Z�@�Z�A���B�C�D�F�G�E�r�I�H�n�K�J�L�M�O�N���Q�P�Êr�[�RᶐY���S�p��T���c�R�b�\�j������U�V�[�Y�X�E�W�؈��Ȕ��\�Z�{�����L�^᪗l�_�]�Ԕ`�a�o�و�f�c��b�E�i�d�e�h�g�D�a�`�^�j�k�l�n�m�u�v��p�r�t�]�u�sᾎo�q�a�Ǐx�w�y�������z�ɒ|���{��������s�����}�~������������������������×�������ȕ������������������������o��ᒔS���p���I�F�c�������H��������s�q�r�t�����������M���u�~�m�v������ᐓ��X��ῖ��ĊՔ������ږӖ��������ȏ�����Ŋ������^��������������������v���������“��r���������������������˕u�ė�����������������������ᵖ�����m����Z��ḋΐ����������Ӎ��x�u�ԍm�C�j�v�{���y�ɏz���d�������{���������V����O��q�����ɕא������m�������������֔����A�@⁖���C�B�ʏD�b�F�E�G�����I�H�|����ЎJ�V�_�F���S�P�O�c�L�N�j�_�M�K�I�ˏ[�Ս��Q�R�h�֋\�T�S�Љ��������T���U�W�X�H�Y�Z�[�׋щÓG���\�H�ȉb�]��d�`�a≔`�^���_�̏ڈH�b���c�Ő��B�d�e�t�ŗg�f��i��l�j�҉m�k�e����m�s�o�ϐn�����n�p�q�r�n�t�����u��v���˓ސ�w�����y�{�x�z�A�|�E���q�~���M����������}��⧗�������������������͏���v�����G�����[�����^�|���Ɗ�������������Ώ���J���}�y���������������M�����؋�������}������������������������͕Ӊ������������Z����������NJ\���������ߐ��͔��ѕz��������Žē������U���������������ә�������Ȋ��������������������А��������������������ĕ���̋H���������������e�S�l��������⟊Ϗ�����������������⸐������ЌW�������������f���Ɨ������������n���I�@��g���C��[�R���B�юh�������A�f�a�����ےF�ݗ׍G�a�I�Џ��H�I���g�D�J���E�o�M�Q㋌L�U�i�����R���O�P���N�K�G����W�T�V�S�p���X㎑e�a�[�_�ۈZ�b�f�j�ԖԒ\���d�Y�]�^㻈Ȗ]�ً���Η����g���c�h�j���m�i�ҕɊɖ܈l���k����n�u�o�v�r���Ȏt�q�w�p�c�D�k�s��{�~�|��z�`�ѐɔ}�x�@�q�J���D�U���������y�������J���������[������\�����Z������������ʊ���������������������������ߍr�u�����l�딭�����������r����������������Q�A�`�����������H����������K��������������ˊ����|���s�V�l���Ҏ���㧎ϑ��k�Ֆ���������������^��������������������������������㮒��E�����W��������㣔��]�����яI�����̊Ҍ�����b�����m�n���x�݈��_�w�ّ����������E�ӌ������������E�\�����Ɛe�����Ґr���������E�]���B�A���t���D�C�o�r�T�H�I��G���F�J�����B�ڑN�O�K�L�M�p�U�Q�����G�P�S�R�c�V�W�V�X�Z�^�[�Y�^�\�]���d�_�`�a���c�b�e�f�g�b��h�՗��L���v�i�j�P�k�l�m�n�o介��p��q�Ɏr���s�ܕڊC�w���M�t�q�u�ʔ��w�Ǒ����v�D�x���z�y�|�{�}���~�͊�������Ǘ��F���������������Ŏ��H������m�c�ԉF�|�ڋ����������ۑc���Չ����������ꋗ�ϓp����������Ζ��։������s�������������������䃒����������t�`���r���������׉���������������������Ί��������䜔������������e�ۋ��ىҏ��؍p������؉ԌH��������������专����G���ވ�������������������䎗����t����������䟓�����䒑������K������䘕����ӏN���֖f����������������䓑����~���u���W����䪖������`�H�@���������̕���������U�����Ӓ��������@�ה��ԏǎB�����C���������n�������J�P�Q�D���N�F�H�R�G�K����L�O�E�E�I�F�d�O��������V�T�m�S���U�W�X�[�Y���Z�˔M���\�a唑`�A�b�h�]�_�^�P�A�d�c�����e�f�g�Ռs�i�|������j�k���l������q�r�m�\�n�a�o�p�z�t�w�s�u�v�֎x�`�u�a�{�^���|����}�~�g�ؔ�����������I��������������w������������������X�������I����������ډ����������������Z���������������������������������������I�a�������������������y�����������������O�s�����p�X���q�Տ��t���߈\���������������܋����U�ܑ�����������������������ь������ٍ����啑����T����������������֏�������廐��������������J���]�����������������������������݋��A�@�C�B�D�P�E�F�G漐v�H���e�I�J橌K�K���`�L�o�M�O旗N�e�P�Q�R�ϊS�T�U�V�p�W�X�Y��G�Z�[�\�����]�v�u�`���_���P�^�L�a�b�׏��c�K�ݐ���i�d�f���؏e�h�i�����g�ُ]�f���r�m�w�����l�l�k�F�l�b�Y�ڏ��j�o�p�n�֌_���F�s���a�U�v����r�w��t�u�q��ǓN�ۉ�b�����z�x�k���Њy�z�ȗ_�{�泒����������~�|�@�����}����攏����d�y��������������������u�ӎ��w�������T���ދ�������������������戕��x������c������������]�̝����Q���������J�����������L���������ؓۏ����������^������������e��������L�����v�n�݉̔��ъӐ���晒�����M��惔ݑ�\���f����G���d���������G���o���^���܏������������q���������w��������桑�����������������Ԑ͎��q��������拕��N�����z������������������������������Ր��׌����H���H���������x���������H����������@�D�A��B�C�J�E�֐G�I�F�L�R�K�M�N�Q�P�O�S�R��U�T�V�W�Y�X�g�Z��[�]�^�_�\�`�Ԏa�O�R�����b��]�c�f���e�d�y�g�r�i�ڍh�q�k�m��j�l�p�n�P�o�r�y�֗S�s�A�u�t�x�`�w���v�{�z�y�Q�|�}�~���D�����h�����������������C�J�_���ӕҒ��H�I���v�}�ߋԕ������މ�痔R���q���������ǒޑ������t�����秓������r���瀐��ʒ���笑���秈A���ߑT�i����툝�N���ٓ��x�����V�^�Օ߉����繓B�ሦ����������k���y�����K���Վ��������J�I��ɗ�������Ҋ�������W�ߓM���׎������@��x�Y�����S�������s�X���s�����������A�����ѓ��U�ގz����������|������珗V�����y���_���������������X���ݏ������������������Δэߎ���碗d��ʗ�����B����瘊j�������ޒ����t������������������ݓb����������n����،������S�����������������甉������ޏ�z���g��e���_�L����������������K��������N�����������ݕs�e�����e����|���K��獐��@�B������A�C��ыd��B���^�E�D�F���^��t�ՒK��b�G�H�L�J����I�ߏ��O�����Ȓ�Z�M�N�L�P�V��Y�X�L�Q�R�U�W����Z�T�S��^�_�`�]�\���[�d�b��c�a���e�f�h���ӊg�s�i�l�j�k�m�o�p�q�t�r�u�w�v����x�M�y�•z�J�[�Պ�Ԋ{�|�}�~���֊t�}��������{����������ň����������������������������h�j���ɑ�������~���Õ�����@�w���׊������A���’˗���褗��z�����G��@���K���u�����脌ۍ��B�ח�������������ꗯ��ǐ�����Y��W�ٌ���蓎���G����ԙ�������J�ᐴ���_�뗋���d�������k���������������������������I��P�����������������������Ð�����r�ʖ������v���x���C�����������������ƈ�������f���������ڕ������������؊����B��蹉����C���ŕ��������{�����a��Дړ��̗z�����j���o�����p����������z�{���犰���^�ޗ��ڌ�����@�B�A���C�D�E�F�H�G�I����H�Q�J�K���Z�є������O���L�ݖM�{�a�`�N��O�P�R�S�U�Q�T���يV�W�X�Y�Z�\�[�^�a�]�_�`�b����c�d遍��e�]�n�f�g�y��h���ʑw�����m���l�j�k�i�w�n�o�p�q�s�r�x�t�v�R�u�����x�ˑy���z���}�|�~�{����������������������������[������������������@�������������E���������������������������������T�����S�@�����飖������������D�B���A�����C��驕������������L���N�D�����E���������������I����������~���������F������������邊k�����������������h������������V�������L���ؗ����������������������P�–Γ���鼓���������������������鰎���������������D�C�E�L�@�A�����B�H�Q�J�G�F�K�H�G�{�L�M�N�I���O�ߒS�T�R�Q�W�P�U�V�Y�X�[�\�]�h�Z���^�J�_�`�a�b���c�d���e�f�g�h�k�i�[�j��l�ٗmꞔn�p�q�oꍍ˖����������s�o�t�u�v�K���w���ٖ�x�z�y�{�|�}�~���������������C�ی��l�����@�����V��������������������������������s���@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������X�^�u�}�~�����������������������������������I�I�W���������V�i�j���{�C�|�D�^�O�P�Q�R�S�T�U�V�W�X�F�G�������H���`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�m�_�n�O�Q�M�����������������������������������������������������o�b�p�`��������������������������������������������������������������������ʁP�U���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������000���0�����0�0�@��>��?��0�0�0�00�N000�0  �<�^�%"\�& %     �	�00;�=�[�]�0	0
000
00000�
�����`"��f"g""4"B&@&�2 3 !�������
� ��&&�%�%�%�%�%�%�%�%�%�%�%; 0�!�!�!�!0""�"�"�"�"*")"'"("��!�!"" "�"#""a"R"j"k""=""5"+","+!0 o&m&j&  ! ��%����������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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������������������������������������������������ !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$`!a!b!c!d!e!f!g!h!i!I33"3M33'3363Q3W3
3&3#3+3J3;3�3�3�3�3�3�3�3{300!�3!!�2�2�2�2�2122292~3}3|3R"a"+"."""�" ""�"5")"*"�NUZ?��Ta(c�Y"�u��Pz�`�c%n�ef������h'W�eqb�[�Y{��b}�}��b�|���[�^	c�fHhǕ��Og�N
OMO�OIP�V7Y�YZ	\�`apafi�pOupu�y�}�}À�c��U�z�;S�N�N�W�����xN�X�n8�2z(���/�AQpS�T�T�V�Y_��m�-�b�p�����T�S�[�p��oS\��zN�x��&nVUk�;��Y�Sfm�t��BV�NK��O���S�U0[q_ f�fh8l�l)m[t�vNz4��[�`�풲m�u�vř�`������i�S�QW0XDY�[�^(`�c�c�lo�pqYq�q?s~v�т��`�[��iX�eZl%u�Q.YeY�_�_�b�e*j'k�k�s�V�,��Ğ�\�l{�QK\�aƁvharYN�OxSi`)nOz�NS�NUO=O�OsO�R�S	VY�Z�[�[�y�f�g�gLk�lkp�s�y�y<z�{��ۂ�w��Ӄf���)V���N�����O�\bYr;u偽�����Ŗ�ՙ�NO��VJX�X�^�_*`�`b`�ab�b9eA�ff�hwmppLu�vu}�����������Q�RY�T�[]ha�i�m�x˄W�r�����lm��ن�W�gΆ��R�VT�^�b�d<h8h�krs�xkz��҉k��퐣���i�f[�\}iM�N��c {+jj�h
�_orR�Up`�b;mn�n[��D�N9��Si:j��*h\Q�z��ܑ��[V(�"h�1��|Rł�t~N�O�Q�[
R�R�R�]�U*X�Y�[�[�[r^y^�`aca�a�cbe�gSh�h>kSkWl"o�oEo�tu�vw�z�{!|�}6���f�����̊����Q�������e�ӗ(��8N+T�\�]�sLv<w�\�����T�X�OOqS�UhV�WGY	[�[�\^~^�_�c:g�e�eg�h�h_j0^�kl}luHyc[z}�_�����w�̎���<��N}PQ�Y�[/b�b�d:k�r�uGy�����p��cʃ��	TT�UThXjp�'xug͞tS�[�P��NEN�NO�S8T�[_%`Qe=gBlrl�lxptvz�z{}�|f}�e[r�SE\�]�b�bc nZ�1�ݍ��o�yZ��N�N�N�O�O�PGQ�zqQ�QTS!SS�S�U�X�\7_J_/`P`m`cYeKj�l�r�r�w����N�����W�Z��N�Q-\�fmi@\�fui�sPh�|�P�RGW�]&��e#k=k4t�y�yK{�}��̃�_�9�яёT��]N6P�S:S�r�s�w悯�ƙșҙwQa^��UzzvP�[G���2N�j�Q\H\�c�z�lt�a��z�q���|hp~Qhl��RT����͎�fS��Ay�O�PRDQSU-W�s�WQYb_�_u`vaga�a�c:dleofBhnfu=z�|L}�}K~k�J�͆�c�f��������Ώ��Rb�d�o��Ah�P kzlTotzP}@�#�g�N9P&PeP|Q8RcR�UWX�Z�^�a�a�brci)j}r�r.sxoxy}w������Ҏc�u�z�U��x�CQ�S�S{^&_n�n�s�sC}7����P�NNP�S|T�V�Yd[�]�^'_8bEe�gVn�r�|������N����7�ǖg���N�N
OHSIT>T/Z�_�_�`�h�jZt�x����w���^Nɛ�N|O�OPPIQlQ�R�R�R�S�STT�UQW�W}YT[][�[�]�]�]x^�^�^�^_R`La�b�b�c;efCf�fmg!h�h�i_l*mim/n�n2u�vlx?z�|}}^}�}������T���*�R�L�a������ʐu�q�?x����M����ؚ;�[R�R�ST�X�b�oj�_���KQ;RJT�V@zw�`�ҞDs	op�u�_�`���r��dk��N�VdW�XZZh`�aff9h�h�m�u:}n�B��NPO�SUo]�]�]�g�lstxP���߈PW�^+c�P�P�Qg�T^X�Y�[i_Mb�c=hskn}pǑ�rx&xmy�e0}܃��	���dR(WPgj���QBW*�:X�i���T]�W�x��\OJR�T>d(fg�g�zV{"}/�\h��9{S�Q7R�[�b�d�d-g�k��і�v֛Lc����vRf	N�P�Sq\�`�dce_h�q�s#u�{�~����یx���e�f�k�N�N:OO:R�S�S�U�V�X�Y�Y�YP[M\^+^�_`c/e\[�e�e�e�gbk{klEsIy�y�|}+}���󁖉^�i�f����nj܌̖��ok�N<O�OPQW[�[HacBf!k�n�l>r�t�u�x:y�3�ꁔ���Pl�_X�+��z���[�N�S�W1Y�Z�[�`no�uꌟ[��{rP�g��a\J�~��Q\hcf��enq>y}��ʎn�dž��P�R:\Sg|p5rL�ȑ+���[1_�`;N�S�[Kb1g�k�r�s.zk���R���Q�SjT�[�c9j�}��V�ShT�[1\�]�Oa�b2m�y�yB}M~�����F�r���t�/�1�K�l�Ɩ���NOOEQAS�_b�gAlncs&~͑���SY�[�m]y.~�|~X�q�QS���O�\%f�w�z����Q�_�eoi�k�m�ndo�v}�]u�����QR@b�f�fn�^�}r�f�������R�SsY�^�_U`�d��PQ�R SGS�S�TFU1UVhY�Y<Z�[\\\\�^�^�^p_b�b�b�cwcff-fvf~g�hj5j�l�m	nXn<q&qgq�uw]xyey�y�z{�|9}��փ��I�]���<�T�s�a�ތ��f�~������
NNNWN�QpR�W4X�X"[8^�`�dagVgDm�rsucz��r��� �1V�W���b
i�k�qT~w�r��ߘU���;\8O�O�OU Z�[�[�_Na/c�eKf�h�ixm�m3u�uw^y�y3}は�����:�����2�ݑ��N�NRuX�X\u=\N�
�ŏc�m�%{ϊ�b��V�S�9T�W%^�c4l�paw�|�p�B�T�����^tĚ]i]pe�g��ۖncIgiŃ������ozd�[N,p]u/f�Q6R�R�Y�_'`b?eteftf�hhcknrru�v�|V��X�������ˊ���R�Y��ez���-^�`b�ef�g�wMzM|>~
���d��_��xR�b�cBd�b-��z�{���v}�I��NHQCS`S�[\\�]&bGb�dh4h�lEmm�g\oNq}q�ez�{�}J~�z��9���n�Ό��x�w���������MR�U8o6qhQ�yU~���|LVQX�\�c�f�fZi�r�u�uyVy�y�| }D}�4�;�a� ��PuR�S�S	P�U�XOY=r�[d\S�`�`\c�c?c�c�d�e�f�]�i�io�q�N�u�v�z�|�}�}a�I�X�l�����ňp��m������P�X�aӁ5�� ��OtPGRsSo`Ic_g,n����O^\ʌ�e�}RS��vQ�cX[k[
\
dQg\��NY*YplQ�>UX�Y�`Sb�g5�Ui@�ę(�SOX�[��\/^�_ `Ka4b�f�l�n΀�Ԃ�����.���۞ۛ�N�S'Y,{��L����n'pSSDU�[Xb�b�b�l�o"t�8��o��8��Q���S�SFOT���jY1��]�z���h7��rH�=j��9NXSVfW�b�c�eNk�m[n�p�w�z�{�}=�ƀˆ��[��V�X>_�e�f�j�k7uNJ$P�w0W_e`zf`l�uzn��E����{\u�zQ{Ą��y�z6��Z@w-N�N�[�_�b<f�g�lk�w�;�N��Йj&p*s�W���NFQ�Q�U�[^3^�^_5_k_�_�ac�fgnoRr:u:wt�9�x�v���܊��󍚒w����RWc�vg�l�sÌ��s�%m�Xi�i�����u�ZXh�c�iCO,o�g��&��}T�?ipojW�X,[,}*r
T㑴��NNO\PuPCR��HT$X�[^�^�^�^_�`�b:c�c�h@l�x�yz�}G���D����-�ؑ��lXd�due�n�v{i�ѓ�n�T�_�dM��D�xQkX)YU\�^�m�~u���[��pO�k�o0u��NQT5XWX�Y`\�_�e\g!n{v߃����M�%x:x�R�^WtY`PZQ�Q�QRUTXXXWY�[�\�]�`�b-dqgCh�h�h�v�mon�mop�qS_�uwyI{T{R{�|q}0Rc�i����F�����v�-�0�ؕ�P�RTX\�a�dm�w�z��S����\�?S�_�_�myrcw�y�{�k�r��haj�Q�z4iJ\����[I�pxVo\�`fe�lZ�A��QT�f
�HY���QMN�Q���XpzcK�bi��~wuWS`iߎ�]l�N<\_�Sь��y��^�esNeQ�Y?\�N�Y�_���o�yby�[q�+s�qt^�_{c�d�q�|CN�^KN�W�V�`�o
}��3����������]�b�d��wg�l>m6t4xFZu�����O�^�b�cWeog�vLr̀��)�M�
P�W�Z�hsidq�r���X�j����y�w)�/OeRZS�b�g�l}v�{�|6�����f or~�������Q�{rx�{��H{�ja^��Qu`ukQb��nzv���Op�bO{���zVYX䆼�4O$RJS�S�S^,d�eg>lNlHr�r�sTuA~,�酩��{Ƒiq��=cifju�v�xC��*SQS&T�Y�^|_�`Ibyb�b�e�k�l�u�v�x�y�}w���������^�ۘj8|�P>\�_�g�k5t	w�;��gz9S�u�f_��񃘀<_�_buF{<�gh�Y�Z}~v,��Oj_j7lo�thyh�U�y��^�c�u�yׂ(�򒜄�-��Tl_�e\mp��ӌ;�Oe�t
N�N�W+YfZ�[�Q^�^`vbwe�enfnm6r&{P�����\����t��D��O�dfk�a�j��\Si��z�W�OoR�_E^
g�yy�����m_Ub�l�Nir��R;TtV�X�anbqnY�|�|}�e^�NuOuQ@Xc^s^
_�g&N=���[�s|��P�XVv�x%R�w��{OP	YGr�{�}��ԏM��O�R)Z_���O��WUcik+u܈�Bz�R�XUa
b�f�k?|�#P�OSFT1XIY�[�\�\)]�^�bgc>e�eg�l�l�p2x+~ހ������*�J���Ғ���l�ON�N�PVRJW�Y=^�_�_?b�fg�g�h�Q!}���������~�2� T,�S�P\S�X�d4ggrfwFz��R�l�kXL^TY,g��Q�vid�xT����W�Y'f�g�k�T�iU^���g���gR�]h�N�O�S�b+g�lď�Om~��Nba�n+o�sT*gE��]�{�\�[�Jnфz��Y�|l w�R"Y!q_r�w'�a�iZZ�Q
T}Tf�v������Y]r�nMQ�h�}�}b���xd!j��Y_[�ks�v�}���2Q(gٞ�vbg�R�$\;b~|��OU�`}��S_N�QY:r6�Α%_�w�Sy_}��3���V��g��S�	aa�lRv�8�/UQO*Q�R�S�[}^�`�a�c	g�ggn�m6s7s1uPyՈ��J�����Ė��Y�NYON��?���P|^�Y�[�^�c�c�d�fJi�im�n�q(u�z��I�Ʉ��!�
�e�}�
�~a�b2k�ltm���m�����eg��<���ma}=�j�qNuSP]k�oͅ-���)RTe\Ng�ht�t�uψ�̑�x��_�s�zN��ceu�RAm�n	tYukx�|���z���Ona�e\��N�N�P!N�Q�[�e�h�msBv�wz�|o�Ҋ|�ϑu���R�}+P�S�g�m�q3t�*���W���`tAX�m/}^��N6O�O�Q�R�]`�s<yӂ4�����
���b��ftkR�R�pˆ�^K`�a#oIq>|�}o��#�,�BTo��j�pŒ�2��RAZ�^_g|i�ijmobr�r�{�~�K�ΐmQ���y��2�֊-P�Tq�jkČ��`�g�N�N�k���h�i~n�xU�_NN*N1N6N<N?NBNVNXN�N�Nk��N�
_�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N	OZO0O[O]OWOGOvO�O�O�O{OiOpO�OoO�O�OQ�O�O�O�O�O�O�O�O�O�OP(PP*P%PPO�O!P)P,P�O�OPPCPGPgUPPPHPZPVPlPxP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P	QQQQQQQ!Q:Q7Q<Q;Q?Q@QRQLQTQbQ�ziQjQnQ�Q�Q�V�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QU��Q�Q�Q�Q�QRRRR'R*R.R3R9RORDRKRLR^RTRjRtRiRsRR}R�R�R�RqR�R�R�����R�R�R�R�R�R�R�R�R�R��R�R�R�R�RSS8u
SSSSS#S/S1S3S8S@SFSESNISMS�Q^SiSnSY{SwS�S�S�S�S�S�S�S�S�S|ٖ�S�f�q�S�S�S�ST=T@T,T-T<T.T6T)TTNT�TuT�T_TqTwTpT�T{T�TvT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUU�T�T�T�T�T9U@UcULU.U\UEUVUWU8U3U]U�U�U�T�U�U{U~U�U�U�U|U�U�U�U�U�U�U�U�U�U�U�UV�UV�U�UV�UNVPV�q4V6V2V8VkVdV/VlVjV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW�VW	WWW
WWWW�UW&W7W8WNW;W@WOWiW�W�WaWW�W�W�W�W�W�W�W�W�W�W�W�W
X�W�WXXXrX!XbXKXpX�kRX=XyX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XY
YYY�h%Y,Y-Y2Y8Y>Y�zUYPYNYZYXYbY`YgYlYiYxY�Y�Y^O�O�Y�Y�Y�Y�Y�Y�Y�Y%ZZZZ	ZZ@ZlZIZ5Z6ZbZjZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[2[�Z*[6[>[C[E[@[Q[U[Z[[[e[i[p[s[u[x[�ez[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\
\\ \"\(\8\9\A\F\N\S\P\O\q[l\n\bNv\y\�\�\�\�Y�\�\�\�\�\�\�\�\�\�\�\�\�\�]�\]]]\]]]]]"]]]]L]R]N]K]l]s]v]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^6^7^D^C^@^N^W^T^_^b^d^G^u^v^z^��^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^_	_]_\____)_-_8_A_H_L_N_/_Q_V_W_Y_a_m_s_w_�_�__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�`�_!`````)``1```+`&``:`Z`A`j`w`_`J`F`M`c`C`d`B`l`k`Y`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�_�`�`�`�`Maaa�`�`a�`�`a!a�`�`
aaGa>a(a'aJa?a<a,a4a=aBaDasawaXaYaZakataoaeaqa_a]aSaua�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�ay�a�a�a�a�a�a�a�a�a�abb	b
bbbbb!b*b.b0b2b3bAbNb^bcb[b`bhb|b�b�b~b�b�b�b�b�b�b�b�b�b�b�b�b�d�b�b�b�b�b�b�b�bc�b�b'ccc�b�bPc>cMcdOc�c�c�c�cvc�c�c�c�c�ckcic�c�c�c�c�c�c�c�c�cd4ddd&d6ded(ddgdodvdNd*e�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	��d�d�b�d�d,e�d�d�d�de�deee$e#e+e4e5e7e6e8eKuHeVeUeMeXe^e]erexe�e�e���e�e�e�e�e�e�e�e�e�e�e�e�e�e�erg
ff�esg5f6f4ffOfDfIfAf^f]fdfgfhf_fbfpf�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f?f�f�f�f�f�fggg&g'g8�.g?g6gAg8g7gFg^g`gYgcgdg�gpg�g|gjg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�jhFh)h@hMh2hNh�h+hYhchwhh�h�h�h�h�h�h�h�j�hth�h�h�hi�h~hi�hi�h"i&i�hi�h�h�h�h6iii�h�h%i�h�h�h(i*ii#i!i�hyiwi\ixikiTi~ini9iti=iYi0iai^i]i�iji�i�i�i�i�i�i�i�i�[�i�i�i�i�i.j�i�i�i�i�i�i�ijj�i
k�i�i�ij�ij�ij�i
jj�j#jjDjjrj6jxjGjbjYjfjHj8j"j�j�j�j�j�j�j�j��j�j�j�j�j�j�j�j�j�j�j�j�jk��jkk1�k8k7k�v9k�GkCkIkPkYkTk[k_kakxkykk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k��llll$l#l^lUlbljl�l�l�l�l�l~lhlsl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmM�6m+m=m8mm5m3mmmcm�mdmZmymYm�m�m�o�m�mn
n�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m-nnn.nnrn_n>n#nkn+nvnMnnCn:nNn$n�nn8n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nAooLp�n�n�n?o�n1o�n2o�n>oo�n�ozoxo�o�ooo[o�omo�o|oXo�o�o�ofo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o	pp�oppp�opptoppp0p>p2pQpcp�p�p�p�p�p�p�p�p�p�p�p�p	q�pqqeqUq�qfqbqLqVqlq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q
rrr(r-r,r0r2r;r<r?r@rFrKrXrtr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rPs
ssss4s/s)s%s>sNsOs؞Wsjshspsxsus{szs�s�s�s�s�s�s�s�s�ttot%t�s2t:tUt?t_tYtAt\titptctjtvt~t�t�t�t�t�t�t�s�t�t�t�t�t�t�t�t�t�tuuuuu
uuuu&u,u<uDuMuJuIu[uFuZuiudugukumuxuvu�u�utu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�u�uv
v	vv'v v!v"v$v4v0v;vGvHvFv\vXvavbvhvivjvgvlvpvrvvvxv|v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v/��vwww)w$ww%w&ww7w8wGwZwhwkw[weww~wyw�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx&y x*yEx�xtx�x|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyy,y+y@y`yWy_yZyUySyzyy�y�y�yK��y�y�y�y�y�y�y�y�y�y�yz
zzz zz�y1z;z>z7zCzWzIzazbziz��pzyz}z�z�z�z�z�z�z�z�z�z�z�z�z���z�z�z�z�z�z�z�z�z�z�z�z�z�z{{
{{3{{{{5{({6{P{z{{M{{L{E{u{e{t{g{p{q{l{n{�{�{�{�{�{�{�{�{�{]{�{�{�{�{�{�{�{�{�{||�{�{`||||�{�{|
|�{#|'|*||7|+|=|L|C|T|O|@|P|X|_|d|V|e|l|u|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|;��|�|�|�|�|}}}}
}E}K}.}2}?}5}F}s}V}N}r}h}n}O}c}�}�}[}�}}}�}�}�}�}�}�}�}�}=~�}�}�}�}�}�}�}�}�}�}�}�}�}~
~#~!~~1~~	~~"~F~f~;~5~9~C~7~2~:~g~]~V~^~Y~Z~y~j~i~|~{~�~�}}~��~�~�~�~�~�~�~�~�~�~�~�~8:ELMNPQUTX_`higx�����������������q�����������ܘ�������!�(�?�;�J�F�R�X�Z�_�b�h�s�r�p�v�y�}�����������������Q��ۀ�ـ݀Āڀր	����)�#�/�K���F�>�S�Q���q�n�e�f�t�������������������_�������������������Ɂ́сف؁ȁځ߁�����������
�
���)�+�8�3�@�Y�X�]�Z�_�d�b�h�j�k�.�q�w�x�~���������������߂҂���������ނ�܂	�ق5�4��2�1�@�9�P�E�/�+���������������#�������|���s�u����������΃���؃��������
�"� ���8����m�*�<�Z���w�k���n���i�F�,�o�y�5�ʄb�������ل̈́��ڄЄ��Ƅք��!������,������@�c�X�H�A��K�U�������������m�����ꅇ���w�~���Ʌ��υ��ЅՅ݅�܅��
��������"��0�?�M�UNT�_�g�q�����������������ĆƆ��Ɇ#���Ԇކ��߆ۆ���������	�
���
�4�?�7�;�%�)��`�_�x�L�N�t�W�h�n�Y�S�c�j����������ˇ����Ї֖��ć��LJƇ������
��������҇���"�!�1�6�9�'�;�D�B�R�Y�^�b�k���~���u�}���r�����������������������ÈĈԈ؈و݈����������
��C��%�*�+�A�D�;�6�8�L��`�^�f�d�m�j�o�t�w�~�������������������������������ډ܉݉��������%�6�A�[�R�F�H�|�m�l�b���������������������Ċ͊Šڊ���������ފۊ������� �3���&�+�>�(�A�L�O�N�I�V�[�Z�k�_�l�o�t�}�����������������:�A�?�H�L�N�P�U�b�l�x�z���������������|���b��������������Ȍ����ڌ��������
���
��N��͌��g�m�q�s���������ύڍ֍̍ۍˍ��ߍ���	�������B�5�0�4�J�G�I�L�P�H�Y�d�`�*�c�U�v�r�|�����������������������������Ǝ����ŎȎˎێ������
����������&�3�;�9�E�B�>�L�I�F�N�W�\�b�c�d�������������ڏ������������!�
����'�6�5�9���O�P�Q�R��I�>�V�X�^�h�o�v���r���}���������������������Hbې���2�0�J�V�X�c�e�i�s�r�������������������������ɑˑБ֑ߑ�ۑ����������,���^�W�E�I�d�H���?�K�P���������Z�ϒ��������D�.��"��#�:�5�;�\�`�|�n�V�����������֓ד��ؓÓݓГȓ�������6�+�5�!�:�A�R�D�[�`�b�^�j�)�p�u�w�}�Z�|�~����������������������������������ʕ�oÕ͕̕Օԕ֕ܕ���!�(�.�/�B�L�O�K�w�\�^�]�_�f�r�l���������������������������Ζ˖ɖ͖M�ܖ
�Ֆ�����������$�*�0�9�=�>�D�F�H�B�I�\�`�d�f�h��Rk�q�y���|���z���������������������×Ɨȗ˗ܗ�O���z������8�$�!�7�=�F�O�K�k�o�p�q�t�s���������ĘØƘ���	����!���$� �,�.�=�>�B�I�E�P�K�Q�R�L�U�������������ߙۙݙؙљ�����������+�7�E�B�@�C�>�U�M�[�W�_�b�e�d�i�k�j���������ϚњӚԚޚߚ��������������"�#�%�'�(�)�*�.�/�2�D�C�O�M�N�Q�X�t���������������������ʛ��ƛϛћқ���ԛ�:������	������
��.��%�$�!�0�G�2�F�>�Z�`�g�v�x����	�����*�&���#��D���A�?�>�F�H�]�^�d�Q�P�Y�r�������o�z���������ĝ��������Ɲϝٝӝ���������u�y�}���������������������������a�̞ΞϞОԞܞޞݞ������������������v�!�,�>�J�R�T�c�_�`�a�f�g�l�j�w�r�v�������/X�iY�dt�Q�q�~�H���܄�O�p1f�h���fE_(N�N�NOO9OVO�O�O�O�O�O@P"P�OPFPpPBP�P�P�PJQdQ�Q�Q�QR�R�R�R�RSS$SrS�S�S�S��T�T�T�T�UYWeW�W�W�W���X�XYSY[Y]YcY�Y�YV[�[/u�[�[\�\�\�\']S]�B]m]�]�]�]!_4_g_�_�_]`�`�`�`�` a�`a7a0a�ab�b�c`d�d�dNeff;f	f.ff$fefWfYf�sf�f�f�f�f�fg)�fg�gRh�ghDh�h�hi��i�i0jkjFjsj~j�j�j�k?l\l�lol�lm�mom�m�m�m�m�m�m9n\n'n<n�n�o�o�opp(p�p�pqq\qFqGq��q�q�r�r$s�ws�s�s�s�s�st�s&t*t)t.tbt�t�tuou�v�v�v�v�v�Fw�R!xNxdxzx0y����y��y�z�z��z�{�H}\}�}�}�}R~G���b��ǃ��H���S�Y�k���� �!�����7�y�����ߊ"���S�����v�#�ώ$�%�g�ސ&��'�ڑבޑ������
�:�@�<�N�Y�Q�9�g���w�x��גْВ'�Ւ�Ӓ%�!���(������p�W���Ɠޓ��1�E�H����)�����3�;�C�M�O�Q�U�W�e�*�+�'�,���N�ٚܚu�r��������p�k�-��ўp!q!r!s!t!u!v!w!x!y!�������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�p!q!r!s!t!u!v!w!x!y!`!a!b!c!d!e!f!g!h!i!����12!!!5"�~�H���܄�O�p1f�h���fE_(N�N�NOO9OVO�O�O�O�O�O@P"P�OPFPpPBP�P�P�PJQdQ�Q�Q�QR�R�R�R�RSS$SrS�S�S�S��T�T�T�T�UYWeW�W�W�W���X�XYSY[Y]YcY�Y�YV[�[/u�[�[\�\�\�\']S]�B]m]�]�]�]!_4_g_�_�_]`�`�`�`�` a�`a7a0a�ab�b�c`d�d�dNeff;f	f.ff$fefWfYf�sf�f�f�f�f�fg)�fg�gRh�ghDh�h�hi��i�i0jkjFjsj~j�j�j�k?l\l�lol�lm�mom�m�m�m�m�m�m9n\n'n<n�n�o�o�opp(p�p�pqq\qFqGq��q�q�r�r$s�ws�s�s�s�s�st�s&t*t)t.tbt�t�tuou�v�v�v�v�v�Fw�R!xNxdxzx0y����y��y�z�z��z�{�H}\}�}�}�}R~G���b��ǃ��H���S�Y�k���� �!�����7�y�����ߊ"���S�����v�#�ώ$�%�g�ސ&��'�ڑבޑ������
�:�@�<�N�Y�Q�9�g���w�x��גْВ'�Ւ�Ӓ%�!���(������p�W���Ɠޓ��1�E�H����)�����3�;�C�M�O�Q�U�W�e�*�+�'�,���N�ٚܚu�r��������p�k�-��ў	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� cp932//Ch0011

#$%&'()*+,�	

 !�	

 !""""""

 

 ������㡱�������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��A�=Z��`^dy�}{��B�>[��a_ez�~|T���9�����CG��P��Xn�p��b�U���:�
����DH��Q��Yo�q��c�	

 !"#$%&'()*+,-./0123456789:;<=>?@AGHLNSTUVZ[\`adijknruz{|}������AGHLNSTUVZ[\`adijknruz{|}����	

�B�]�^o���pqs�����B�]�^o��pqs����lCDEF_IKJOQRPYWM�bcefgh�mwvxy~t�lCDEF_IKJOQRPYXM�bcefgh�mwvxy~t�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������         (((((                  HFGHIJKLMNO	�#$',-.158=>?@B	�#$',-.158=>?@B"!3246DCE"!3246DCE/ 
&%()+*0:9<;A7/ 
&%()+*0:9<;A7����������� *,.39;=EGMWY[aioy{}��)+-28:<DFLVXZ`hnxz|~�CAecgk���
B@dbfj���]
?"(&$57KIOQUS_sqwu�m\	>!'%#46JHNPTR^rpvt�l����������������������������������Ԫ���������������������������� *,.39;=EGMWY[aioy{}��������)+-28:<DFLVXZ`hnxz|~�����մ���������������������������������C�Ae��cgk�ۅ��
�B�@d��bfj�ᄈ]
?"(&$57KIOQUS�_sqwu�m�\	>!'%#46JHNPTR�^rpvt�l�                9999999999999999������������������������������������������������������������������£ãģţƣǣȣɣʣˣ̣ͣΣϣУѣңӣԣգ֣ףأ٣ڣۣ��ݣޣߣ���������������������������������������ˡ̡����͡ܣ���������ͭ�Ϣи�����������������������������������������������������ѢңҧҨҩҪҫҭҲҾ������������������������������������������������������������������������������������ԥիծո����������ۥܥ������޳������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A�B���C�D���������E�F�G�H�I�����������������J�����������K�L���M�N�O���P�Q�R�S�T�U�V�����W�������X�Y�Z�a�b�c�����d�e���f�g�h���i�j�k�l�m�n�o�p�q�r���s���t�u�v�w�x�y�°z�����ð������İ��������������������������������������Űư����ǰ����Ȱɰ��ʰ����������˰̰��Ͱΰϰа����ѰҰӰ԰������հ������ְ��������������װذ��ٰڰ۰������������ܰݰް��߰�����᰽���������Á��ā���ŁƁǁ�ȁɁ�ʁˁ́�́΁ρ�ЁсҁӁԁՁցׁ�؁�فځہ܁݁ށ߁��������������������������������������������������������������������A�B�C�D���E�F�G���H�I�J���K�L�M�N�O�P�Q�R���S�T�����U�V�W�X�Y�Z�����a�b���c�d�e���f�g�h�i�j�k�l�����m���n���o�p�q�r�s�t���u�v�w���x�y�z�������������������������������������������������������������������������������±��ñı����������űƱ����DZ������ȱ����������������������ɱʱ������������˱����������������������‚ÂĂłƂǂȂ̱ɂʂ˂̂͂΂ςЂͱαт҂ϱӂԂՂбւׂ؂قڂۂ܂ѱұ݂ӱނ߂������Ա���ձ���ֱ���������������������������ױرA�B�ٱC�D�ڱ۱ܱE�F�G�H�I�J�ݱޱK�߱L��M�N�O�P�Q�R��S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s���t�u��v�w���x��y�z��������鱄�걅��챆���������𱊃񱋃����򱎃󱏃�������������������������������������������������������������������������������������������������������������������������������������ƒÃăŃƃǃȃɃʃ˃̃̓΃σЃу҃ӃԃՃփ׃؃كڃۃ܃݃ރ߃�შ�����⃫���僬�������샭���탯����������󃲲�����������������������A�B���C�D���E���F�G�H�I�J�K���L�M�N���O�P�Q���R�S�T�U�V�W�X�Y�Z�a�����b�c�d�e���f�g���h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������������������²��ò��������������IJŲ��Ʋ��DzȲɲ��������ʲ˲������������̲����������������������Ͳβ������������ϲв����������������������������������„ÄѲĄńƄDŽȄɄҲʄ˄̄Ӳ̈́΄τԲЄф҄ӄԄՄքղֲׄ؄لײڄۄ܄݄ބ߄ز�������������������������������ٲڲ����۲����A�ܲB�C�D�E�F�G�ݲ޲߲H��I���J�K�L�M�N��O�P�Q�R�S�T�U��V�W�X�Y�Z�a�b�c�d�e�f���g�h�i�j�k�l���m�n��o�p�q��r�s�t�u�v�w�x���y�z��������������������ﲋ�����𲎅�������������򲕅������������������󲟅�����������������������������������������������������������������������������…������Å��ą��ŅƅDž��ȅɅʅ˅̅ͅ΅υЅх҅ӅԅՅօׅ؅مڅۅ܅݅ޅ߅�����兢����煤���ꅥ�������񅦳��򅨳󅩳�����������������������������������A�B�C�����D�����������E���F�������G�H���I�J�K���L�M�N�O�P�Q�R�����S���³óT�U�V�W�X�Y�ijųZ�a�Ƴb�c�d�dze�f�g�h�i�j�k�ȳl�m�n�o�ɳp�q�r�s�t�u�v�w�x�y�z�����������������������������������������������ʳ˳��̳ͳ������γ��ϳг��������ѳҳ��ӳԳճ����������ֳ׳س����ٳ������ڳ��������������۳ܳ��ݳ޳߳�������������ᳺ���⳼�����㳿�����†ÆĆņ��Ɔdž��ȆɆ�ʆˆ̆�͆Άφ�Іц҆ӆԆՆֆ׆؆نچۆ܆݆ކ߆�������������������������������������������������������A�B�C�D�E�F�G�H�I�J���K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s���t�u�v���w�x�y���z���������������������������������������������������������������������������������������������������������������������������������������������������������������������������‡ÇćŇƇLJȇɇʇ��ˇ͇̇·χЇч��҇ӇԇՇևׇ؇هڇۇ܇݇އ߇������������쇵������򇷴������������������������A�B�C�D�E�����F�G�H�I�J�K���L�M�N�O�P�Q�R�����S�T�U���V�W�X�Y�Z�a�����b�c�´d�e�f�ôĴŴg�h�i�j�k�ƴǴl�ȴm�ɴʴn�o�p�˴q�̴r�s�t�ʹu�v�w�δx�y�z���������������������������������ϴд����Ѵ������Ҵ��Ӵ����������Դմ��ִ��״��������ش��ٴڴ۴��ܴ����ݴ޴ߴ�ᴦ�������䴩�����鴪�������촭�����������������������𴹈��󴺈�������������ˆÈĈňƈLjȈɈʈˈ͈̈ΈψЈш҈ӈԈՈֈ׈؈وڈۈ܈݈ވ߈�����������������������������������������������������������A���B���C���D�E���F�����G�H���I�J�K���L�M�N�O�P�Q�R�����S�������T�U�V�W�X�Y���Z�a�b���c�d�e���f�g�h�i�j�k�l�m�n�o�p�����q�r�s�t�u�v���w�x�y���z�����������������������������������������������������������������������������������������������������µ������õ������ĵ��������������������������������������ŵ������‰ÉĉʼnƉljȉɉʉˉ͉̉ΉωЉщƵ҉ӉԉՉ։׉؉ǵىډۉȵ܉݉މɵ߉������ʵ˵�̵��������͵������������������������A�B�C�D�E�F�G�H�I�J�K�εϵL�M�еN�O�P�ѵQ�R�S�T�U�V�W�ҵӵX�ԵY�յZ�a�b�c�d�e�ֵf�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�׵y�z�����������ص����������������������������������������ٵ������������ڵ������۵������ܵ����������������ݵ��޵��ߵ������������൶�����ᵹ�����⵼�����������Š�ÊĊŊƊ�NJȊɊʊˊ̊��͊Ί�ϊЊ��ъ�ҊӊԊՊ֊��׊�؊�يڊۊ܊݊ފ�ߊ��������������������������������������A�B�C�D�E�F�����G���������H�I�J�K�L�����M�N���O�P�Q���R�S�T�U�V�W�X�����Y�������Z�a�b�c�d�������e�f���g�h�i���j�k�l�m�n�o�p�����q�������r�s�t�u�v�w�x�y�z���������������������������������������������������������������������������������������������������������������������������������������������������������‹Ëċŋ������ƋNj��ȋɋʋ��ˋ̋͋΋ϋЋы����ҋ¶öĶӋԋՋ֋׋؋Ŷًڋۋ܋݋ދߋ������������ƶ���������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�ǶȶQ�R�ɶS�T�U�ʶV�W�X�Y�Z�a�b�c�d�e�f�g�˶h�i�j�k�l�m�̶n�o�p�q�r�s�t�Ͷu�v�w�x�y�z���������������������������ζ������������������������������������������������������϶������ж��������������������������������������������ŒÌČŌƌnjȌɌʌˌ̌͌ΌόЌьҌӌԌՌ֌׌،ٌڌی܌݌ތѶҶߌ�Ӷ���Զ������նֶ����׶�������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�ضR�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�ٶs�t�u�ڶv�w�x�۶y�z�����������ܶݶ������޶��������������������������������������������������������������������߶ණ���ᶭ����㶯��������������嶶�涷���������������綿������Íč�ōƍǍȍɍʍˍ��͍̍΍ύЍэҍӍԍՍ�֍׍؍�ٍڍۍ�܍ݍލߍ���������������������������������������������������������������������A���B�C�D�E�F�G�H�����I�������J�K�L�M�N�O�����P�Q���R�S�T�U�V�W�X�Y�Z�a�b�c�d�e���f���g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������������������������������������������������������������������������������������������������������������������������������������·����÷������ķ��������������ŷƷ��ǷȷɷŽÎĎŎƎǎʷȎɎʎ˷ˎ͎̎ΎώЎюҎӎԎՎ֎̷׎ͷ؎َڎێ܎ݎގߎηϷ��з���ѷ�������ҷӷ�Է�շ������ַ���׷����������������A�B�C�D�E�F�G�H�طI�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�ٷi�j�k�l�m�n�o�ڷp�q�r�۷s�t�u�ܷv�w�x�y�z�����ݷ޷��߷��ළ�����������᷋�����ⷎ�����㷑���������������䷙�巚�淛������������跡���鷣�����귦��������������췭��������������ﷵ�������������������������ÏďŏƏǏ�ȏɏʏˏ̏͏Ώ�ϏЏяҏӏԏՏ֏׏؏ُڏۏ܏ݏޏߏ�����������������������������������������������������A�B���C�D�E���F�G�H�I�J�K�L�����M���N���O�P�Q�R�S�T�����U�V���W�X�Y���Z�a�b�c�d�e�f�����g���h�����i�j�����k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�������������������������������������������������������������������������������������������������������������������������������¸����ø��ĸŸƸ����Ǹ������ȸ��������������ɸʸ��˸̸͸θ����������ϸи��ÐĐŐƐѸǐȐɐʐː̐͐ΐϐАѐҐҸӐԐՐ֐אِؐڐېܐݐސߐ���������������������ӸԸ����ո������ָ��׸��������A�ظٸB�ڸC�۸ܸD�E�F�G�ݸ޸߸H�I��J�K�L��M�N�O�P�Q�R�S���T����U�V�W�X�Y�Z���a�b��c�d�e��f�g�h�i�j�k�l�m�n�o����p��q�r�s�t��u�v�w�x�y�z��������������������������������������������񸖑�󸗑�����������������������������������������������������������������������������������������������������‘ÑđőƑǑȑɑʑˑ̑͑ΑϑБёґӑԑՑ֑בّؑڑۑ��ܑݑޑ��ߑ�ᑢ��������鑣�ꑤ�둥������񑦹�������������������������A���B���C�D�E�F�G�H�I�J�������K���L�M���������N�O�P�Q�R�����S���T���U�V�W���X�����Y�Z�a���b�c�d���e�f�g�h�i�j�k�l���m���n�o�p�q�r�s�t�u���v�w�x�y�z�����������������������������������������������������������������������������������������������������¹������ù������Ĺ��������������Ź����ƹ������’ÒĒŒƒǹǒȒɒȹʒ˒̒ɹ͒ΒϒВђҒӒʹԒՒ˹֒גْؒڒےܒݒޒߒ�����������������������������̹͹����ι����Ϲй��ѹA�B�C�D�E�ҹӹF�ԹչֹG�׹H�عI�J�ٹڹ۹ܹݹK�L�޹߹���M�N�O�P���Q��R��S�T�U��V�W���X�Y��Z�a�b��c�d�e�f�g�h�i���j����k�l�m��n�o���p�q��r�s�t�u�v�w�x�y�z���������������������������������������������������������������������������������������������������������������������������������������������������������������������“Óēœ����Ɠ������Ǔȓɓʓ˓̓����͓Γ��ϓГѓ��ғӓԓՓ֓דؓٓ��ړ������ۓܓݓ��ޓߓ����⓷�����������������������������������������������A�B�C�D�E�F�����G���H���I�J�K�L�M�N���O�P�Q�ºR�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�úg�h�i�j�k�l�m�ĺn�o�p�q�r�s�t�u�v�w�x�y�z�������������ź��������������ƺǺ����Ⱥ������ɺ��������������ʺ˺��������������������̺������ͺ����������������������������������������������κϺ����к����ѺҺӺԺ”ÔĔŔƔպֺǔ׺Ȕغɔʔ˔ٺں̔ۺ͔ΔϔДєҔӔܺԔՔ֔הؔٔڔ۔ܔݔޔݺߔ������޺���������������������������������A�B�ߺ�C�D��E�F�G��H�I�J�K�L�M�N�O�P�Q�R�S��T�U�V�W�X�Y��Z�a�b��c�d�e��f�g�h�i�j�k�l��m�n��o��p�q�r�s�t�u���v�w��x�y�z����������������ﺈ�𺉕�����������������������������������������������������������������������򺭕��󺯕�������������������������������������������������������•��Õ��ĕŕƕǕȕ����ɕ������ʕ˕͕̕Ε������ϕЕ��ѕҕӕ��ԕՕ֕וٕؕڕ����ە������ܕݕޕߕ�ᕲ����������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�����Y�Z���a�b�����c�d�e�f�g�h�i���j�k�������l�m�n�o�p�q���r�s�t�u�v�w�x�y�z���������������������������������������������������������������������»û��ĻŻƻ������������������������������������������������������������������–ǻȻÖĖɻŖƖǖʻȖɖʖ˖̖͖Ζ˻̻ϖЖіͻҖӖԖՖ֖זٖؖږۖܖݖޖߖ���������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�λR�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�ϻs�t�u�v�w�x�y�z�������������������������л������������ѻһ����ӻ������Ի��������������ջ����ֻ��׻����������������������������������������������������������������—×ėŗƗǗȗɗʗ˗̗͗ΗϗЗїҗӗԗ՗֗חؗٗڗۗܗݗޗߗ���������������������������������ػ������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�ٻR�S�T�U�V�W�ڻX�Y�Z�ۻa�b�c�ܻd�e�f�g�h�i�j�ݻ޻k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z���������������������������������������������߻໗���ộ�����⻜��������������代�廤�滥������������軫��껬����������������𻳘��󻴘���������������������������������˜ØĘ����Ř������ƘǘȘɘʘ˘����̘͘��ΘϘИ��јҘӘԘ՘֘ט����ؘ��٘��ژۘܘݘޘߘ����☩���嘪�������옫����𘬼��������������������������������������������������A�B�C�D���E�����F�G���H�I�J���K�L�M�N�O�P�Q�����R�¼üļS�T�U�V�W�X�żƼY�Z�Ǽa�b�c�ȼd�e�f�g�h�i�j�ɼʼk�˼̼ͼl�m�n�o�p�q�μr�s�t�ϼu�v�w�мx�y�z�������������������Ѽ������������ҼӼԼ��ռ������ּ��׼����������ؼټ��ڼ��ۼ������ܼ����ݼ޼����߼������༦�����������������������ἲ�����������⼸�����㼻�����伾�������™Ùę�řƙ��Ǚșəʙ˙̙͙�ΙϙЙ�љҙә�ԙՙ֙יؙٙڙ��ۙ�ܙݙޙߙ��������������������������������������������������������A�B�C�D�����E���F���G���H�����I���J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b���c�d�e�f�g�h�i�����j�k���l�m�n���o�p�q�r�s�t�u���v�w�x�y���z���������������������������������������������������������������������������������������������������������������������������������������������������������������������½����������šÚĚŚƚǚȚɚʚ˚͚̚ΚϚКњҚӚԚ՚֚ךؚٚښۚܚݚޚýĽߚ�Ž��ƽǽ������Ƚɽʽ�˽�̽����ͽ�νϽ�нѽ���ҽ�����������ӽԽ����սֽ����A�B�C�׽ؽٽD�E�ڽF�G�H�۽I�J�K�L�M�N�O�ܽݽP�Q�޽߽R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r��s�t�u�v�w�x�y�z������������������������������������������������������⽛���㽝�����你�彡����������罦����齨�����������꽮�����뽱�����콴���������������������������›ÛěśƛǛțɛʛ˛̛͛ΛϛЛћқӛԛ՛֛כ؛ٛڛۛܛݛޛߛ�����������������������������������������A��B�C���D��E�F�G�H�I��J�K�L���M�N�O�P�Q�R�����S�T���U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i���j�k�l�m�n�o�p���q�r�s�t�u�v�w�x�y�z�������������������������������������������������������������������������������������������������������������������������������������������������œ����ÜĜ��ŜƜǜ��Ȝɜʜ˜̜͜Μ����ϜМќ��ҜӜԜ՜֜ל��؜ٜڜۜܜݜޜߜ����������ꜭ�������񜮾���������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N���O�P�Q���R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z���������������������������������������������������������������������������������������������������������������������������������������������������������������������ÝĝŝƝǝ¾þȝľɝžʝ˝̝͝ΝϝƾǾНѝȾɾʾҝ˾̾;ӝԝ՝֝ξϾоםѾҾӾ؝ٝڝԾվ۝־׾ܝݝؾޝߝ�پ�������ھ۾�ܾݾ޾������߾�����������������������������A���B�C�D��E�F�G��H�I�J�K�L�M�N�O��P�Q�R�S�T�U�V�W�X�Y���Z�a���b����c�d�e�f�g���������������h���i���j�����k�l���m�n�o���p�q�r�s�t�u�v�����w���x���y�z���������������������������������������������������������������������������������������������������������������������������������¿������ÿĿſ��ƿ����ǿȿɿ��ʿ��˿��̿��������Ϳο����Ͽ������п��������������ѿҿ��ӿԿտžÞĞŞƞǞֿ׿Ȟɞؿʞ˞̞͞ΞϞОўҞӞԞٿ՞֞ڿמۿ؞ٞڞ۞ܞݞܿݿޞߞ޿���߿���������������������������������������������A��B�C�D�E�F�G���H�I��J�K�L����M�N�O�P�Q���R��S���T�U�V�W�X�Y�����Z�a���b�c�d���e�f�g�h�i�j�k�����l�m�����n�o�p�q�r�s�����t�u���v�w�x���y�z�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ÿ����������ßğş�Ɵǟȟ�ɟʟ˟̟͟Οϟ�Пџ�ҟӟԟ՟֟ן؟ٟ��ڟ۟�ܟݟޟ���ߟ�������������������������������������������������������������A�B�C�D���E����F�G�H�I�J�K���L�M��N��O��P�Q�R�S�T�U�V���W�X�Y�Z���a�b�c�d�e�f���g�h�i���j�k�l���m�n�o�p�q�r�s�t�u�v�w�x�y�z��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� àĠŠƠǠȠɠʠˠ̠͠ΠϠРѠҠӠԠՠ֠נؠ٠ڠ۠����ܠݠ��ޠߠ࠹�ᠺ�����栻���砽�蠾������������������������������������������A�B�C��D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V���W�X�Y�Z�a�b��c�d�e��f�g�h��i�j�k�l�m�n�o���p��q��r�s�t�u�v�w���x�y��z���������������������������������������������������������������������������A��B�C�D�E�F�G��H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z��a�b�c�d�e�f�g��h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z��������������������������������������������������������������������A�B�C��D�E�F�G�H�I�J��K�L�M�N�O�P�Q�R�S�T�U���V�W��X�Y�Z��a�b�c�d�e�f�g���h��i���j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z������������������������������������������������������������������������������¢ž����¤ ��¦�A�B���C���D���E�F���G�H�I�J��¬�K��®¯�L�M�N�O�P�Q��±�R�S���T�U�V���W�X�Y�Z�a�b�c��µ�d��·¸�e�f�g�h�i�j���k�l�m���n�o�p�q�r�s�t�u�v�w�x�y�z��������„���������������������������������������������������������A�B�C�D�E��½�F�G���H�I�J���K�L�M�N�O�P�Q����R�������S�T�U�V�W�X���Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r���s�t�u�v�w�x���y�z������������������������������������’�����������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�����U�V���W�X�Y���Z�a�b�c�d�e�f�����g���h���i���j�k�l�m�����n�o�p�q�r�s���t�u�v�w�x�y�z����������…��������������Œ��������������������������������������Ÿ���A�B�C�D�E���F�G�H���I�J�K���L�M�N�O�P�Q�R�����S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w���x�y�z����������„����†������‰����������������������“������������™���������������A�B�C�D�E�F�G�H�I�J�K�����L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s���t�u�v�w�x�y�z������������������������������������������•�����������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O���P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d���e�f���g���h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z��������������������������������������’������•����������������œ�������Ÿ���A�B�����C�D���E���F���G�H�I�J�K�L�M����N��¡âã�O�P�Q�R�S��å�T�U���V�W�X���Y�Z�a�b�c�d�e��é�f��ëì�g�h�i�j�k�l���m�n�o���p���q���r�s�t�u�v�w�x���y�z������Ã�����������������������������������������������������������A�B�C�D��ô�E�F���G�H�I���J�K�L�M�N�O�P��ø�Q��úû�R�S�T�U�V�W��ý�X�Y���Z�a�b���c�d�e�f�g�h�i����j���k���l�m�n�o�p�q���r�s�t���u�v�w�x�y�z��������������������Ê��������������Ñ������Ô�������������������������A�B�C���D�E�F�G�H�I�����J�K���L�M�N���O�P�Q�R�S�T�U�����V���W���X�Y�Z�a�b�c���d�e�f���g�h�i���j�k�l�m�n�o�p�q�r�s�t�u���v�w�x�y�z������������������������������������������������������������Þ�������A�B�C���D�E�F�G�H�I�J�����K���L���M�N�O�P�Q�R���S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g���h�i�j�k�l�m�n�o�p�q�r�����s�t���u�v�w���x�y�z������������Å��Æ��Ç������������Í��������������������������������������à�A�B�C�D�E�F���G�H�I���J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f���g�h�i���j�k�l���m�n�o�p�q�r�s�����t���u���v�w�x�y�z����Â������Å������È��������������Ï��������Ó�������������Ù����Û������Þ�����A�B�C�D����E���F���G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n��Ģ�o�p���q�r��ĥĦ�s�t�u�v�w�x��Ĩ�y���z��ā������������Ĭć����ĉ������Č��������������İē��Ĕ��ĕ������������Ĵě����ĝ������Ġ�A�B�C�D�E�F��ĸ�G��ĺĻ�H�I�J�K�L�M��Ľ�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f���g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�������������������������������ď����đ������ē����������������Ě������ě���������������A�B���C�D�E���F�G�H�I�J�K�L�����M���N���O�P�Q�R�S�T���U�V�W���X�Y�Z���a�b�c�d�e�f�g�����h�������i�j�k�l�m�n���o�p�q�r�s�t�u�v�w�x�y�z����������������������������������Đ����Ē������ĕ����������������Ĝ��ĝ��Ğ�����A�B�C�����D�E���F�G�H���I�J�K�L�M�N�O���P�Q�R�S���T�U�V�W�X�Y���Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s���t�u�v�w�x�y���z��������������ć��������������������������������������Ě�������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�����U�V���W�X�Y���Z�a�b�c�d�e�f�����g���h���i�j�k�l�m�n���o�p�q���r�s�t���u�v�w�x�y�z��������������ć������������č�����������������������������������������A�B�C�D�E�F����G�H���I�J�K���L�M�N�O�P�Q�R��Ţ�S���T���U�V�W�X�Y�Z���a�b�c���d�e�f���g�h�i�j�k�l�m���n�o�p�q�r�s�t�u�v�w�x��Ū�y�z��Ł������ń��������������Ůŋ������Ŏ�������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��ű�P�Q���R�S�T���U�V�W�X�Y�Z�a��ŵ�b���c���d�e�f�g�h�i��Ź�j�k���l�m�n��ż�o�p�q�r�s�t��ž�u�����v�w�x�y�z������ł����ń������Ň����������������Ŏ������ŏ������������ŕ�����������������������A�B�C�D�E�F�G�H���I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�����q�r���s�t�u���v���w�x�y�z������ł������Ń��������������ʼn����ŋ������Ŏ����������������ŕ��Ŗ��ŗ������������ŝ������Š�A�B�C�D�E�F�G�H�I�J�K�L�M�N���O�P�Q�R�S�T�U���V�W�X���Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�����v�w���x�y�z��Ł����������������ň��ʼn��Ŋ��������Ŏ��ŏ������Œ�����������������������������A�B�C�D�E�F�G�H���I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i���j�k�l���m�n�o�p�q�r�s�t�u�v�w�x�y�z��Ł��ł������������ň�������������������������������������������������A�B����C�D���E�F�G���H�I�J�K�L�M�N����O���P���Q�R�S�T�U�V���W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o���p�q�r�s�t�u�v���w�x�y�z������������������������������������������������ƣƘ����ƚ������Ɲ�������A�B�C��Ƨ�D�E�F���G�H�I�J�K�L���M�N�O���P�Q�R���S�T�U�V�W�X�Y���Z�a�b�c���d�e�f�g�h�i��Ư�j�k���l�m��Ʋ�n���o�p�q�r�s��Ƶ�t���u�v�w�x�y�z������ƃ������Ɔ������Ɖ��������������ƻƐ��������������������ƽƚ����Ɯ������Ɵ���A�B�C�D�E����F���G���H�I�J�K�L�M�������N���O�P�Q���R���S�T�U�V�W�����X�������Y�Z�a���b�c�����d�e���f�g�h���i�j�k�l�m�n�o�����p�������q�r�s�t�u�v�����w�x�y�z�����������������������������������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�����S�T���U�V�W���X�Y�Z�a�b�c�d�����e�������f�g�h�i�j�k�����l�m���n�o�p���q�r�s�t�u�v�w�����x���y���z������������Ɔ������Ɖ������ƌ����������������Ɠ������ƕ������������ƛ�����������A���B�C�D�E�F�G�H�I���J���K�L�M�N�O�P�Q�R����S�T���U�V�W���X�Y�Z�a�b�c�d����e���f���g�h�i�j�k�l���m�n�o�p�q�r�s�t�u�v�w�x�y�z��������������LJ���������������������������������������������������A�B�C�D�E�F�G�H���I�J�K���L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h���i�j�k���l�m�n���o�p�q�r�s�t�u�v���w���x�y�z������������ǫdž����Lj����ǮNJ��Nj����������DZǐ��Ǒ��ǒ������������ǘ�����������������A�B�C�D�E�F�G�H�I�J�K���L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s���t�u�v���w�x�y���z��������������LJ����lj����������������Ǒ������ǔ������Ǘ��������������Ǟ����Ǡ���A�B�C�D�E�F���G�H�I���J�K�L���M�N�O�P�Q�R�S�����T���U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z������������Dž����LJ������NJ����������������Ǒ��ǒ��Ǔ��������������Ǚ����Ǜ������Ǟ�����A���B�C�����D���E���F�G�H�I�J�K�����L�M���N�O�P���Q�R�S�T�U�V�W�����X�������Y�Z�a�b�c�d���e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x���y�z���������������������������������������������������������������������A�B���C�D�E���F���G�H�I�J�K�����L���M���N�O�P�Q�R�S�����T�U���V�W�X���Y�Z�a�b�c�d�e�����f���g���h�i�j�k�l�m����n�o��p�q�r��s�t�u�v�w�x�y���z���ǁ‚ƒ„…†�LJˆ‰�NJ‹Œ¡ȍŽ‘’“”¢ȕ–—˜™š›œž£Ȥȟ ¥�A�B�Cæ�D�E�F�Gç�H�Ièȩ�Jê�Kë�L�M�Nì�O�PíȮ�Q�Rï�S�T�Uð�V�W�X�Y�Z�a�b�c�d�eñ�fò�g�h�i�j�k�lóȴ�m�nõ�o�p�q�r�s�t�u�v�w�x�y�zÁÂöȃ÷ȄÅÆÇÈÉøȹȊËúȌÍÎûȏÐÑÒÓÔÕÖüȗýȘþșÚÛÜÝÞÿȟà�A��B�C�D��E�F�G�H�I�J�K�L���M���N�O�P�Q�R�S�T�U�����V�W���X�Y�Z���a�b�c�d���e�f���g�h���i���j�k�l�m�n�o���p�q�r���s�t�u���v�w�x�y�zāĂ��ȃĄąĆ��ȇĈĉĊċČ����ȍĎ��ȏĐđ��ȒēĔĕĖėĘęĚěĜĝ��ȞğĠ�A�B�C�����D�E���F�G�H���I�J�K�L�M�N�O�����P���Q���R�S�T�U�V�W�����X�Y���Z�a�b���c�d�e�f�g�h�i���j�k���l���m�n�o�p�q�r�����s�t���u���������v�w�x�y�zŁ����Ȃ��ȃ��ȄŅņ��ȇň��ȉŊŋ��ȌōŎ��ȏŐőŒœŔŕ���ȖŗŘ�șŚśŜŝŞ��ȟŠ��A�B�C��D�E�F�G�H�I�J���K��L��M�N�O�P�Q�R���������������������������������������������������������������������ؽ��������������������׶�����������������̢���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ѯ�������������������������������������������������������������������������̾�������������������������������������������������������������������������������������������ܰ��������������������������������������������������������������������������������������������������������������������������������������߾߻�������ݦ��ΰ���������������������޺�����������˥��������ܭ����������ޣ��������������������Τ��������������������������п����������ܹ������ӵ֤������������������������������������ޡ����ӷ����������������������������������������������������������������٥�������̵������������������������������������������������������������̨����۷�������������������ʧ�������������������������������������������������������������������������������������������������������������������к���������������������Ϳױ��������������������������������������������������������������������������ݷ������������������ע�������������������޻з����������������������������۱���������ͥ�������Ҥ�����������������������������ִ�����������������Ψ��������������������������ҡϨ���������������������������������������ʰ������������������Ͻ���������������������������ϯͣ����Я��ʻ������������������ԣ٨�����������������������٩�������������������������������������������������������������������������������������������������������������������������������������������޸�����������������������������������������������������ֳ�������������������������������������������������������������������ϯ����������������������������������˼�������������������������Ϋ��������������������������������������������������������������������������������������������Ъ���������������������������Я����д������������������������ҿ���������������������������������������������������˯����������������������������������������������������ڰ����������������������������������ͦ������������̵������������������������������������ε��������˾������������������������������ڨ�����������������������������ް����������������������������ӳ�����������������������������������������������������������������������������������������������������������������������������������������������������������������ͧ����������Ы�����������������������������������������������������������������ܹ�����������������������������Ө��������߬˼���������������������������������������������������������������������������������Ӳ��������������ް����������������������׭������������������������������������������������������������������������������������������������������������������������������������������������Ӥ�������������������������������ڴ���������������������˴���������̾������������ر��������������̯������������ջ���������������������������ʫ�����������������������������������������������������ծ۶������������������������������������������������������ٹ������������ˬ��������������������������������������������������������������������Ѻ�������������������������������������٫�����������������������������ڳ������������ٹ�����������������������������ֺ��������������������������������������������Ϋ�����������������������������������ʤ��������������ݦ�����������������������������Ю�������������������������������������������������������������Ͱ������������������������������������������������������������������������������������ʻ������������������������������������վ������������������������������������������������������Ѣ������������������������������׺������������������������������������Ѱ���������ͫ�������ʮʮ������ۻ����������������ʰҺ��������������������������������̨�������������������������������������������������������۲��Ѹ����������������������������Բ���������������������������٢���������������������������������������������������������������������������������ڧ�������������������������������������������������������������������������������������������������������������������������ֲ������������������������Ծ���������������������������޵��������������������ˮ���������������������Ѫ��������������ة���ޯ�������������������������������������������������������������������������������η����������������������������������̼���������������������Ͼ�������������������������������������������������ˤ������������������������ڪ���۵������������������������������׵��������ͮ�������������������������������ͻ������������������ذ������������������������ֳ��������������������������������������������������������������������������������������������������������������������������������������������������������˩��������������������������������������������������ֿ���������������غ�����������������������������������������������������������������������������������������������߳������������Գ�����������������������������������������������������լ������������������������������������������������������������������������������������ڦ��������������������ܴ���������������������ׯ������������������������������������������������������ߢ��������������������������������������ۿ��������������������������������������������������������������������������Ѥ������������������������������������������������������������������������������������������������������������������������������������������������������ԡ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������֯�������������������������������޵��ѷѳ�������������������������������������������������Т��Գ����ܶ���Ω�����������������������������������������������Գʦ������������������������������������������������������Ϣ������������������������������������������������������������Ч������������������������������ڹ������������������������������������������������֭����������������������������������������������������������������������ڣ����������ε����������������׬����������������������������������޴�������������������������������Ѫ�������������������������������������������������������������������٣������������������������������������Կ�����������������������������������������������������������������������������������������������������������������������������������������������������������׿��������Ͷ����̸����������������ۤ�����������������������������������������������ݰ���������������������������������أ����������������������������������������������������������������������������������������������������������������������������������������������������ٴ���������������������������ͷ�����۵������������������������������������������������������ݵ�����������������������������ף������������������������������������������������������������������������������������������������������������������������������������Ϲ���������������������������������������������Է��ۿ�����������������������������˥���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ܮ�������������������������������������������������������������������������������������������Ϭ���������������������������������٦�������������������������������������������������������������������������������������������������������������������������������������������������������������������������ݯ���ާ������Ρ������������������������������������������������������������������������������������й���������������������������������������������������������˰Բ����������������������������������������������������������������־����������������������������������������������������������������������������������α���������������������������������ܧ�������������������������������Թ������������������������������������������س�������������������������������������������������������������������������������٬������������������������������������������������������������������������������������������������������������������������������������������������ѱ����������͹����֧�����������������������������������������������������������������ɧʧ˧̧ͧ����ܧݧާ������ԧէ֧קا����������������������������������������������㧿�����§çħŧƧǧȧΧϧЧѧҧӧڧۧ�짦���ᢼ�������ߧ��������������������������������롲���������������������������������������������������������������������ªêĪŪƪǪȪɪʪ˪̪ͪΪϪЪѪҪӪԪժ֪תت٪ڪ۪ܪݪުߪ��������������������������������������������������������������������������������������«ëīūƫǫȫɫʫ˫̫ͫΫϫЫѫҫӫԫի֫׫ث٫ګ۫ܫݫޫ߫�����������������������������������������������������������������������������������������¤äĤŤƤǤȤɤʤˤ̤ͤΤϤФѤҤӤԤդ֤פؤ٤ڤۤܤݤޤߤ�������������������������������������������������������������������������©éĩũƩǩȩɩʩ˩̩ߢ����������������������������������¨èĨŨƨǨȨɨʨ˨̨ޢ����������������������������ͩΩϩЩѩҩөԩթ֩שة٩ک۩ܩݩީߩ�������ͨΨϨШѨҨӨԨը֨רب٨ڨۨܨݨިߨ�����������������ȦǦ����¦������ƦŦ����Ħæ������ɦʦ��˦̦������ͦΦ��ϦЦ����ѦҦ����ӦԦ����զ֦����צئ����٦ڦ��ۦܦ��ݦަߦ����䦶�Ƣ��âǢȢˢʢɢ̢������������ߡޡ¢ۡݡܡĢŢڡ١Ϣ΢ТѢϡΡ������������ۢ͢ܢݢڢ����������ӢԢ������ǡȡء�������������ɡ�������٧ʡ���������������������������������������������������������բآ֢٢ע������ӡ��ԡ���������ġС��������������š����֡��ա¡á������������ѡҡ����������������¥åĥťƥǥȥɥʥ˥̥ͥΥϥХѥҥӥԥե֥ץإ��������������������������������������������������������������������������������������������ѬҬӬԬլ֬ج٬ڬ۬ܬݬެ߬������������������׬����ס�������ơ��������Ң��������������������������������������������������������������������������=OsOGP�P�R�SuT�T	V�Z�[�f�g�g�gLk�s�u<zۂ�W���6�Ȍύ���ՙ;RtSTj`da�k�s���҉���O
R�XxY�Yr^y^�a�cFg�gh�oNvw�xz�z!|��n�q�늓�kN�U�f4n�x�z[��N����RNW*XL]a�a!bbe�gDjnu�u�v�w:}��Q�R���#S�\2uۀ@���[RX�Y�\]�^:_J_wa_lzu�u�|s}�}�T�!���A����M�G��N�NP�QOX7a>aha9e�io�u�v�v�{��˄������U�[QW��|���(P�SE\�]�bnc�d�d n�p[yݍ��}�E���~N�NeP�]�^aWiq�T�G�u�+�^N�Ppg@h	Q�R�R�j�w�Ԟ�R/`�HP�a�c�d<h�j�o������X}r�ruy}m~����t�c�Q��bzlToP}:#�|QJa�{�W����N�OP�PQ�R�RSpW�X�^�_va�a�dleof�f�f�h�m�p�p�t�t�t�ulx�x�z�zE}�}�?����f�����8�Z���OSU:XQYc[F\�`bBh�h�h�nLuxv�x=z�|k~|~���?���ĝ�S�SJTqT�V�Yd[;\�^�b7eEere�f�g�i�l�u�v~w?z���������1��������.�ǖg�ؚ��T�e�f�h@z7�`��VdW]f�h�h�n(t���hl����OlQqQ�RT[�]P`m`�b�c;e�szz������2N�[b�g�t�yӃ�����N�K�F��^�i�����Q�[�[ca�h>kLp/t�t�{PŃ����ܕ(�.R]`�b��OIQ!S�X�^�f8m�p�r�sP{�[�fS�ckVN�PJX�X*`'a�b�iA��[}��_��N�P�T�U[�]�]*eNe!hKj�r�v�w^}���N�߆�N�ʐ�U���NEN]N�N�OwQ�R@S�S�S�TVuW�W�[�]�^�a�bQe�g�g�iPk�k�kBl�nxp�r�st�w�wvz}	����
�߂b�3��������d���ҙE��ם��W@\ʃ������T�z�و͎�XH\�c�z�[_yz�z����&P8R�RwSW�brc
k�m7w�SWsh�v�Օ:g�jpom�̎K��wfxk��<���S-WNY�c�i�sEx�z�z�|u���s�5����RGWGu`{̃��XjKQKR�Rb�hui���P�R�R�a�e9h�i~tK{��냲�9�яI�	��N�Y�df�j4t�y�y��~��_�
�&�O�S%`qbrl}f}�NbQ�w��OOvQ�Q�UhV;W�W�WYGY�Y�[�\]�]~^�_�b�e�egg^g�h�h_j:k#l}l�l�m�s&t*t�t�txuu�x�xAyGyHyzy�{}�}��-����O�H�w�!�$��Q���e����}vO	T�bThё�U:Q��Z�a
��b�b��������������������f�Vq��� �OczcWS!��g`isn"�7u#�$�%�
}&�'�r��VZ(�)�*�+�,�CN-�gQHY�g�.�sYt^�d�y�_l`�b{c�[�[�R/�tY)_`0�1�2�Yt3�4�5�6�7�8�љ9�:�;�<�=�>�?�@�A�B�C��oD�E������`F�G�f�H�I�?\J�K�L�M�N�O�P�Q��Z%�{g}R�S�T�U�V�W���X�Y�<\�l?S�nY6�9N�NFO�UW�XV_�e�e�j�kMn�w�z|�}ˆ��2�[��d�ozs�uT�VUMW�a�d�f�m[nmo�o�uC���A���NJZ���lSuT{�]�UXXXb^b�d�hvu�|����N�WnW'Y
\�\6^�_4b�d�s��������۞�[�_�`PR0RW5XWX\`\�\�]�^�_�`c�cdCh�h�j�m!n�n�o�q�vyw�y;z�����H���S���M�v�ܗ�kpXr�rhscw�y�{�~���X�`fe�e�f�lq�qZ��mN�z�N�Q�Q�RT�aqgPh�hm|o�u�w�z�c���\Q�e\g�g�u�zs�Z�F��-�o\����A�o�
��_�]Yj�q{vI{��'�0��U�a[�iv�?�������\�m�p�sa}=�]�j��^��NuSkk>pr-��LR��P]�d,ek�oC|�~ͅd����b؁��^gjm�rtot��ސ�O
]�_
��Q�ceu�NPiQ�Q�hj�|�|�|o�Ҋ�ϑ�O7Q�RBT�^na>b�e�j�o*y܅#���b�j���Ξ�R�fwkp+yb�B��ab#e#oIq�t�}o��&�#�J��QR�Rm�pˆ�^�e�k�o>|us�N6O�V_��\�]`�s-{��F��4���H��a��O�o�y�����R`��d�d�j^opr�v��\���2�o���u��xy�}Ƀ����֊�X_'g'p�t`|~�!Q(pbr�xŒڌ��N�P�[�^�e�qBv�wJ���|�'����XAZb\j�mo;v/}7~�8��K��R�e�g�iAm�np	t`tYu$vkx,�^�mQ.bx��O+P]�m�}*��_Daha����R���Q�Q^iz�}�u��O)R�STUe\�`Ng�hlm�r�rt�tb��ul|y���ψ�̑Б�ɛT~o�q�t������W����g�m3t��,x�z {�|idjt�u�x�x��T����[U^ o������NMS)Z�]N_ba=cif�f�n+ocp�w,��;��E�;�U�b+g�l	�j�z��N�Y�_�_g�}T��+�������W�Y�Z�['f�g�h�kdqu��㌁�E����L�@���_[ls�v�v��Q��MQ�Q�R�h�lw w�}�}b����n��Q
T}Tf�f'i�n�v�w�„��i�����O�Q�R�Y=^Uaxdyd�f�g!j�k�k_rarAt8w�w�����(���(g�lgr�vfwFz��k�l"Y&g��oS�X�Y�^�c4fsg:n+s�zׂ(��R�]�a�a
b�b�d�eYifk�k!q�s]uF~��j�����'�a��X؞PR;TOU�evl
}}^������R�lirsT�Z>\K]L_�_*g�hci<nDn	ws|������a��\�`
a�aOe�e�el�l�s�s�}���[��]RZS�bd�d4g8j�l�s�t�{�|~��6�������4OJS�S�S�b,de�e�i�lXo�sTu"v�v�v�x�x,yF},��ԏ���R�b�d$nQo|vˍ��b��C�#P�PJW�Y(\G^w_?b>e�e�e	f�g�i�n�x!}����+�������*����2���
P�Oc��W�_�b�cogCnq�v̀ڀ���)�M�j�/OpO^�g"h}v~vD�a^
jiq�qjud�A~C��ܘOO{p���Q^�h>lNl�l�r�{��l:t�P�R�X�d�j�tVv�x��9�e�^S_��������%R�wI��NPuQ[\w^f:f�g�h�pu�u�y�z'� ���O!X1X�[nfekmzn}o�s+u�܈�\��O�PS\S�[�_
g�yy�/�����9�;����,gvN�OIY\�\�\gc�h�p�q+t+~��"�Ғ�
N�N�O�PVRoR&T�T�W+YfZZ[u[�[�^f�vbwe�enm�n6r&{?|6P�Q���@����������t����ܑ�D�ٙ�SR)TtV�XTYnY�_�anbf~lq�v�|�|}�����g�[O__�b)]g�h|xC~l�N�PS*SQS�YbZ�^�`�aIbyb�e�g�i�k�k�k�k�lh�5t�ux�x�y�y�|�}���>���船�l����^�ۘ;��V*[l_�e�j�k\m�op]r�s��ӌ;��a7lX��MN�N�N�N:O<OO�O�P�S�SU�U�V�XbYZ�[�[\�]+^�_`hc�e�e�g�g�h{k�l�l#n	pEsx>y@y`y�y�{}r}��
���фdž߈P�^��܌f�������ߙ��JRi�gj��P*Rq\ceUl�s#u�u�{��x�0�wN�d�k^q��	Nk�Ig�hn���k��c�o���
N�P�PQFU�UV@[\�\8^�^�^�^�`QhajXn=r@r�r�vey�{���s�a�ތ�^X�t���Ul�az"}r�rru%um�{�X�X�]�^�^�_U`�bcMe�f�f�fh�h�r^tn{n}�}r���������͞ �YmY-^�`fsf�gPl�m_o�w�xƄˑ+��N�PHQ�U[�[Gb~e�e2n}qtDt�t�tlv�y�}U~�z���9���u��x���%�M���hSQ\Ti�l)m+n���;�-����g�aR�f�k�~��
���]�e�m�qn��W�Y�['`�`bf_f)s�s�vwl{V�r�e�����N�Rrkmz9{0}o����S/VQX�[\\�]@b�cd-f�h�l�m�np�p�q&u�u�uv{�{+| }9},�m��4�
�a�������7��Ol\_g�m�|�~���k[�]
d��\�ᘇs�[�`~g�m�����7Rp�Qp�x��p�ב�O�S�U�V�W�X�Z�[�\�\%^a
bKb�cd6exe9j�k4lm1o�q�rxst�t&vaw�yWz�z�|�}�}a~�)�1���ڄꅖ�����8�B���l�����������֖����Ӛ��S~XYp[�[�mZo�q!t�t�����]�_�_B`�ehoiSj�k5m�m�s�v�wM{}#��@��c�b�Ċ������bS��e�]']i]_t��h��o�b�6�r�NXN�P�RGSbfi~�^��OS6V�Y�Z8\N\M\^_C`�e/fBf�g�gs�w:y���̈́��f�i��U�z��W�[_o`�b
i�k\n�q�{U�X���ߘ��8O�O�O{T Z�[<a�ehf�q3u^y3}N�じ���΅�
�����q�ŏ1Y�[�[�`�[\�_�lr��mpu�����NASs�ٖl�N�ORQ^U%Z�\bYr������Y��?�Ŗ�	�]�
X�\�]D^�`a�cj%n�T�N��w��[�\	cOfHh<w����T����e�ˎ��5U�\�]�^�fLv�Ǖ�X�b�r(��N.Y`;f�k�y&��S�T�W]a�f�m�x~���D��S|b�c�m
~K�M��jL���_N;P�QY�`�c0i:r6�t�Α1_u�v�}�o���免�w�oOx�y��XC[Y`�ceme�fz�Ji#jmplq�u
v�ypz{��|�D�}�����}�~�
�W�_�eov�y����Z�l�Q�a�b�jƁCP0Xf_	q���|[��O<Q�VDY�c�m�]mi�Q�NYO������Y����_k]l���ty���E�9�?�]�����������N���Wy_f�����uy~o����[��V'X�YZ�[���^����Pc;c��=i�l�l�m�m�mo���p6qYq���q�q��Oxox��u{�}��/~��M�ߎ������[������������`�m���q�������S�������g���p0q0tv�҂�����}��f���qI�����KX�����]q_�� f�fyi�i8l�l6nAo�op/pPq�qps��[t���t�vNz�~�����`�Ώ��H��������BN*P��R�S�fml�o
swbz��݅���Ԉc�}�k����������N
O�O�PHS>T3T�UbX�XgYZ�[�`���aVe�edf�hZl�o�p�qRs}{���2��K\�lDs�s:��netviz~
�@Q�X�d�tupv���͖T�&n�t�z�z�نx��IZ�[�[�hicm�st,t�x�}��U���L�.���f�_�e�gjl�s-PZjk�wYl]�]%sOu�����P�Q/X-Y�Y�Y�[�����]�bd�d�d���f��Hj���qdt���z�zG~^~�p��� �Y����R�~a2ktm~%����O�P�Q�R�W�X�[�^Ba�i�mgn�n�qbt(u,us�8�Ʉ
���ޓ��NQOvP*Q�S�S�S�[�[$\a�a�e[r�s@t�vPy�y�y}���Յ^�G���ꑅ����Rg_�e1f/h\q6z��
��N�Rj�k�o�q���S�K�����1��N�qĖCQ�S�TWW�W�Z�Z�[(`?a�c�l9mrn�n0r?sWtт��E�`��b�X��g��^�MOIP�PqS
W�YZ	\pa�f-n2rKt�}À�f�?�_�[���U�˗O�sN�OQjQ�/U�Uz[�[|^}^�^�`�`a	a�c8e	g��g�g�aibi�l'm�8n��o6s7s�\t1u�Rv���}��8�Ո��ۊ�0�B�J�>�z�I�ɑn���	X��k������AQkY9\��do�s�����������bph}����Wi`Ga�k������YNT�m-�p����c�l���Q�a�����OPQ�[a�a�di�k�u�w�d�����c���p����N�N
O��7Y�Y��]_[_!`����>r�s�pu�u�y��3����Q��������������7p�v�����N�NRpS�T�V�Y�[_�_nn��j}5�����m�w���NZO~O�X�e�n8������N�X�Y�YA`�z��O�ÌeQDS�������NiRU[���N:R�T�Y�YP[W[\[c`Ha�n�pnq�s�t�u�x+}��(��Ʌ�nj̖\O�R�V�e(f|p�p5r�}��L���r�q[�h�kzo�v�\�f[o�{*|6�ܖN�N S4X�X�XlY\3^�^5_�c�fVgj�jk?oFr��Ps�t�z�|x�߁灊�l�#���υ݈���w����Q�T(W�[MbPg=h�h=n�n}p!~����	�K�N�-r�{͊�GONO2Q�T�Y�^�bugnij�ln�r*s�u�{5}��W���[��������Ζ_��R
T�Z�[Xdue�n�r���vMz{M|>~�{�+�ʌd��_���i�ѓCOzO�PhQxQMRjRaX|X`Y\U\�^�`0bh�kl�oNq t0u8uQurvL{�{�{�{�~n�>�I�?���"�+���Z�k��R*b�bYmdv�z�{v}`S�\�^8o�p�|���ޞ�czdv�N�N�N\PuPHT�Y�[@^�^�^�_�`:c?ete�evfxf�ghi�jck@l�m�mn^np�p�s�s:u[w�x�yz}z�|�}G��ꊞ�-�J�ؑf�̒ ��V�\���6R�R|U$X^_�`�c�h�omy,{́������D���d���=�L�J��OFQ�Q�R2V_k_�c�d�eAf�f�fg�h�h�ionogq�q*r�t:wVyZy�y z�z�|�|D}p~������T������� �m��;�Ֆ��e|��ÓX[
\RS�bs'P�[�_�`ka�h�m.t.zB}�}1~k�*�5�~��POPW�]�^+cj;NOO�OZP�YĀjThT�UOY�[�]�^]f1g�g*h�l2mJn�o�p�s�uL|},}�}�ۆ;���p���3�1�N�R�D�Й�z�|�OQ�Q�W�[�\Yf=jZm�n�oqou�z"�!�u�˖���-N�NF�͑}S�jkiAlz��X�a�f�b�pu�uR~��I��KN�S�T0W@W�_ccod/e�ezf�g�gbk`l�l,o�w%xIyWy}���󁝂����������r��vz7zT~w�U�UuX/c"dIfKfmh�i�k%m�n�sht�t[u�u�vw�w�y	~~��/���:�ь뎰�2���c�s���O�S�Y�Z^Nh�t�u�y�z����̍폟eg���WWo�}/���Ɩ�_�a�oN�OP�S�Uo]�]!kdk�x�{��I�ʎn�Ic>d@w�z/��j��d�o�q�t�t�z|�~�|�~��
�}��L�9R�[�d-g.}�P�SyXXaYa�a�e�z����	P!PuR1U<Z�^p_4a^ef6f�f�i�n2os!v�z9�Y�փ���P�W�[�[i_�c&x�}܃!�Ǒ���Q�gV{���Q�Y�`U�P��TR:\}ab�b�d�e�n v
�`�_����NCS�U)Y�]�d�l�m�sz�����w���!�Ɨ�Q�T�U�_�d�o�}�M�5��P\�l�mu�w=|d|y�ŠX�Y^wcRr�ukw܊����^tf�m}���ˊQ�֛�CR�f�m�n�}�.�^�ԚRR�T�a�b�b�hiZi5j�p&q]xyy�y
z��x�ՂI�I�����b������O�V�q�w����[�_Qg���SZX�[�`�a`d=~p�%����d�P]g�X�b�cixijkn�v�y��)�ϊ�����K�������ۖ6�
�N\u]y�zQ{�{.~ĄY�t����%f?iCt�Q.gܞEQ�_�l�]�w��`�����S9T4V6Z1\�p�Z��큣���_��tP�N�S�`,nd\�O$P�U�\_^e`�h�l�m�q�u�uavzIz�}�}n􁩆�ɖ��R�GR�R혪�N�go�O�[�g�lxmt'xݑ|�ć�y1z�_�N�T>U�X�Y�`Sb�b6gUi5�@���ݙ,PSSDU|W�Xb��dkf�g�o�o"t8t�8�QTVfWH_�aNkXp�p�}��jY+��cw=���TX-d�i�[^on�i�LQ�S*Y `Ka�kpl�l{΀Ԃƍ������d�o�deNQTW�_avh��uR{q}�X�i�*��9�xPWY�Y�b�*�]ayr֕aWFZ�]�b�d�dwg�l>m,r6t4xw��ۍ�$RBWgHr�t�����*�kQ�SLciOU�`We�lmLr�rz����m_�o�p��a�OOPAbGr�{�}�M������jWs^�g
�U� T[c^�^
_�e��=���[�HOS
SS�T�TW^`�b�bUc��lfm�u2xހ/�ނa�����������E^�f�fpr��O}Rj_SaSgjo�thyh�y�ǘĘC��TzSi��J�����|_�b�u�v���B�9S<_�_�l�sbu�uF{����ON<�NUO�SY�^0f�lUtw�f���P����Xx[P�����[h`�`�eWl"o�opU�����P�ӗrRD��Q+T�TcU�U�j�m�}f���w�y�T�T�v䆤�ԕ\��N	O�Y�Z�]R`�bmgAh�l/n8��*��	���NUP�T�WZYi[�[�awiwm#p���r�犂�홸��R8hPx^OgG�L��NT�V�s���	�W���SV�X[�1��a�j{sҎGk��W�UYrk�i��O�\&_�a[f�l�p�s�s�s)wMwC}b}#~7�R�
��I�o�Q[tz@���Z�OTS>Y�\>cym�r����ϒ0��NDQR�Wb_�l�npPp�p�q�sitJ���a��������nQW_�`ga�fY�J�����NN�N|T�X�X}Y�\'_6bHb
fgf�kim�mVn�n�o�o�o]p�r%tZt�t�v\y�|~ဦ�k���N�_�t�w�j����e��`bw�ZZf�m>n?tB��_�`{�T_^l�l*m�p}y��;�S�T[:jkpuu�y�y���q�A���t���d+e�x�xkz8N�UPY�[{^�`�cakefShneq�t}��i�%�;m�n>sA�ʕ�QL^�_M`�`0aLaCfDf�i�l_n�nboLq�t�v�{'|R�W�Q���Þ/S�V�^�_b`�`�affg�j�m�oppjsj~��4�Ԇ��Č�Rrs�[kj��T�V][He�e�f�h�m�m;r��u�M��OP�ST<T�U�U?^�_=gfq�s��R�RdX�Xq�q�q����f���U�fJq1�IS�U�kY_�_�c�fGq����O:d�pfug�d`N���GQ�QS6m��ўf#k�p�uTy\}� k=kFk8Tp`=m���P�Q�UkV�V�Y	[^�a�a1b^f�f�q�q�q�r�yz�p�������
������!�"�#�%�&�'�(�)�*�+�.�2�3�4�5�6�7�:�;�=�>�?�A�B�C�D�E�F�G�H�I�J�L�N�O�P�Q�R�S�U�V�W�Y�Z�[�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�r�s�u�v�y�{�|�}�~����������������������������������������������������������������������������¬ìŬƬǬɬʬˬͬάϬЬѬҬӬԬ֬ج٬ڬ۬ܬݬެ߬����������������������������	�
����������������!�"�#�$�%�&�'�(�*�+�.�/�0�1�2�3�6�7�9�:�;�=�>�?�@�A�B�C�F�H�J�K�L�M�N�O�Q�R�S�U�V�W�Y�Z�[�\�]�^�_�`�b�d�e�f�g�h�i�j�k�n�o�q�r�w�x�y�z�~�������������������������������������������������������������������������������������������������������������­íŭƭǭɭʭ˭̭ͭέϭҭԭխ֭׭ح٭ڭۭݭޭ߭�������������������������������������
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�2�3�5�6�9�;�<�=�>�?�B�D�G�H�I�K�O�Q�R�S�U�W�X�Y�Z�[�^�b�c�d�f�g�j�k�m�n�o�q�r�s�t�u�v�w�z�~������������������������������������������������������������������������������������������������������������������������®îŮƮǮȮɮʮˮήҮӮԮծ֮׮ڮۮݮޮ߮����������������������������������������	�
�������������������� �!�"�#�$�%�&�'�(�)�*�+�.�/�1�3�5�6�7�8�9�:�;�>�@�D�E�F�G�J�K�L�M�N�O�Q�R�S�T�U�V�W�X�Y�Z�[�^�_�`�a�b�c�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�z�{�|�}�~����������������������������������������������������������������������������������������������������������������¯ïįůƯʯ̯ϯЯѯүӯկ֯ׯدٯگۯݯޯ߯����������������������������������������	�
��
��������������� �!�"�#�$�%�&�'�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�F�G�I�K�M�O�P�Q�R�V�X�Z�[�\�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�~��������������������������������������������������������������������������������°ðưʰ˰̰ͰΰϰҰӰհְװٰڰ۰ܰݰް߰�����������������������������������������������
�
����������� �!�"�&�'�)�*�+�-�.�/�0�1�2�3�6�:�;�<�=�>�?�B�C�E�F�G�I�J�K�L�M�N�O�R�S�V�W�Y�Z�[�]�^�_�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�z�{�}�~��������������������������������������������������������������������������������������������������������������±ñıűƱDZȱɱʱ˱ͱαϱѱұӱձֱױرٱڱ۱ޱ�������������������������������������	�
�
���������������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�5�6�7�8�9�:�;�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�Y�Z�[�]�^�_�a�b�c�d�e�f�g�j�k�l�m�n�o�p�q�r�s�v�w�x�y�z�{�}�~��������������������������������������������������������������������������������������������������²òIJŲƲDzʲ˲ͲβϲѲӲԲղֲײڲܲ޲߲��������������������	�
���
������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�W�Y�Z�]�`�a�b�c�f�h�j�l�m�o�r�s�u�v�w�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������³óƳdzɳʳͳϳѳҳӳֳسڳܳ޳߳���������������������������������������������	�
���
����������������!�"�#�$�%�&�'�*�,�-�.�/�0�1�2�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�R�S�U�V�W�Y�Z�[�\�]�^�_�b�d�f�g�h�i�j�k�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������´ôŴƴǴɴʴ˴̴ʹδϴѴҴӴԴִ״شٴڴ۴޴ߴ����������������������������������������	�
���
�������������� �!�"�#�&�+�,�-�.�/�2�3�5�6�7�9�:�;�<�=�>�?�B�F�G�H�I�J�N�O�Q�R�S�U�V�W�X�Y�Z�[�^�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������µõŵƵǵȵɵʵ˵εҵӵԵյֵ׵ٵڵ۵ܵݵ޵ߵ�������������������������������������������������	�
���
��������������� �!�"�#�$�&�'�(�)�*�+�-�.�/�0�1�2�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�e�f�g�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������¶öĶŶƶǶȶɶʶ˶̶Ͷζ϶жѶҶӶնֶ׶ضٶڶ۶ܶݶ޶߶�������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�*�+�-�.�1�2�3�4�5�6�7�:�<�=�>�?�@�A�B�C�E�F�G�I�J�K�M�N�O�P�Q�R�S�V�W�X�Y�Z�[�\�]�^�_�a�b�c�e�f�g�i�j�k�l�m�n�o�r�t�v�w�x�y�z�{�~������������������������������������������������������������������������������������������·÷ķŷƷȷʷ˷̷ͷηϷзѷҷӷԷշַ׷طٷڷ۷ܷݷ޷߷������������������������������������
��
�������������� �!�"�#�&�'�)�*�+�-�.�/�0�1�2�3�6�:�;�<�=�>�?�A�B�C�E�F�G�H�I�J�K�L�M�N�O�P�R�T�U�V�W�X�Y�Z�[�^�_�a�b�c�e�f�g�h�i�j�k�n�p�r�s�t�u�v�w�y�z�{�}�~������������������������������������������������������������������������������������������������������������������������¸ĸƸǸȸɸʸ˸͸θϸѸҸӸոָ׸ظٸڸ۸ܸ޸������������������������������������	�
���
������������������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�>�?�A�B�C�E�F�G�H�I�J�K�M�N�P�R�S�T�U�V�W�Z�[�]�^�_�a�b�c�d�e�f�g�j�l�n�o�p�q�r�s�v�w�y�z�{�}�~��������������������������������������������������������������������������������������������������������¹ùĹŹƹǹʹ˹͹ӹԹչֹ׹ڹܹ߹������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�:�;�=�>�?�A�C�D�E�F�G�J�L�O�P�Q�R�V�W�Y�Z�[�]�^�_�`�a�b�c�f�j�k�l�m�n�o�r�s�u�v�w�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������ºúźƺǺɺʺ˺̺ͺκϺкѺҺӺԺպֺ׺ںۺܺݺ޺ߺ����������������������������������������������	�
�����������������!�"�#�$�%�&�'�(�*�,�-�.�/�0�1�2�3�7�9�:�?�@�A�B�C�F�H�J�K�L�N�Q�R�S�U�V�W�Y�Z�[�\�]�^�_�`�b�d�e�f�g�h�i�j�k�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������»ûŻƻǻɻʻ˻̻ͻλϻѻһԻջֻ׻ػٻڻۻܻݻ޻߻���������������������������������������
������� �!�"�#�&�(�*�+�,�.�/�2�3�5�6�7�9�:�;�<�=�>�?�B�F�G�H�J�K�N�O�Q�R�S�T�U�V�W�X�Y�Z�[�\�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������¼üżƼǼȼɼʼ˼̼μҼӼԼּ׼ټڼۼݼ޼߼��������������������������������������
���
����������������� �!�"�#�%�&�'�(�)�*�+�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�A�B�C�D�E�F�G�J�K�M�N�O�Q�R�S�T�U�V�W�Z�[�\�]�^�_�`�a�b�c�e�f�g�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������½ýĽŽƽǽȽɽʽ˽̽ͽνϽнѽҽӽֽ׽ٽڽ۽ݽ޽߽������������������������������������������	�
��������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�F�G�I�J�K�M�O�P�Q�R�S�V�X�\�]�^�_�b�c�e�f�g�i�k�l�m�n�o�r�v�w�x�y�z�~������������������������������������������������������������������������������������������������������������������¾þľžƾǾȾɾʾ˾̾;ξϾҾӾվ־پھ۾ܾݾ޾߾�������������������������������������������
���
�������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�B�C�E�F�G�I�J�K�L�M�N�O�R�S�T�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������¿ÿĿƿǿȿɿʿ˿οϿѿҿӿտֿ׿ؿٿڿۿݿ޿�������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�R�S�T�U�V�W�Y�Z�[�]�^�_�a�b�c�d�e�f�g�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������	�
���
�������������!�"�%�(�)�*�+�.�2�3�4�5�7�:�;�=�>�?�A�B�C�D�E�F�G�J�N�O�P�Q�R�S�V�W�Y�Z�[�]�^�_�`�a�b�c�f�j�k�l�m�n�o�q�r�s�u�v�w�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
��������������!�"�#�$�%�&�'�*�,�.�0�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�R�S�U�V�W�Y�Z�[�\�]�^�_�a�b�c�d�f�g�h�i�j�k�n�o�q�r�s�u�v�w�x�y�z�{�~€‚ƒ„…†‡Š‹ŒŽ‘’“”•–—™šœžŸ ¡¢£¦§©ª«®¯°±²³¶¸º»¼½¾¿��������������������������������������������������������������������������������������������������
��������������� �!�"�#�&�'�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�j�k�m�n�o�q�s�t�u�v�w�z�{�~�ÀÁÂÃÅÆÇÉÊËÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ������������������������������������������������������������������������������������������������������	�
���
������������������ �!�"�#�%�&�'�(�)�*�+�-�.�/�1�2�3�5�6�7�8�9�:�;�>�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�f�g�i�j�k�m�n�o�p�q�r�s�v�w�x�z�{�|�}�~�āĂ㥹ĆćĈĉĊċČčĎďĐđĒēĕĖėĘęĚěĝĞğĠġĢģĤĥĦħĨĩ��īĬĭĮįİıIJijĴĵĶķĹĺĻĽľĿ����������������������������������������������������������������������������������������������������������������	�
��
���������������� �!�"�#�$�%�&�'�*�+�-�.�/�1�2�3�4�5�6�7�:�<�>�?�@�A�B�C�F�G�K�O�P�Q�R�V�Z�[�\�_�b�c�e�f�g�i�j�k�l�m�n�o�r�v�w�x�y�z�{�~�ŁłŃŅņňʼnŊŋŎŐŒœŔ��řŚśŝŞşšŢţŤťŦŧŨŪūŬŭŮůŰűŲųŶ��źſ���������������������������������������������������������������������	�
��
�������������� �!�"�#�&�'�)�*�+�/�1�2�6�8�:�<�=�>�?�B�C�E�F�G�I�J�K�L�M�N�O�R�V�W�X�Y�Z�[�^�_�a�b�c�d�e�f�g�h�i�j�k�m�n�p�r�s�t�u�v�w�z�{�}�~�ƁƂƃƄƅƆƇƊƌƎƏƐƑƒƓƖƗƙƚƛƝƞƟƠơƢƣƦ��ƪƫƬƭƮƯƲƳƵƶƷƻƼƽƾƿ�����������������������������������������������������������������������������������������	�
��
���������������"�#�%�&�'�)�*�+�,�-�.�/�2�4�6�8�9�:�;�>�?�A�B�C�E�F�G�H�I�K�N�P�Y�Z�[�]�^�_�a�b�c�d�e�f�g�i�j�l�m�n�o�p�q�r�s�v�w�y�z�{�ǀǁǂdžNjnjǍǏǒǓǕǙǛǜǝǞǟǢǧǨǩǪǫǮǯDZDzdzǵǶǷ��ǹǺǻǾ����������������������������������������������������������������������������������������������������	���
������������!�"�#�%�&�'�(�)�*�+�.�0�2�3�4�5�6�7�9�:�;�=�>�?�A�B�C�D�E�F�G�J�K�N�O�P�Q�R�S�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�r�s�u�v�w�y�{�|�}�~�ȂȄȈȉȊȎȏȐȑȒȓȕȖȗȘșȚțȜȞȠȢȣȤ��ȦȧȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȾȿ��������������������������������������������������������������������������������������������������	�
���000�% & �0� %"<�<"    000	0
000
00000���`"d"e""4"�2 3 !+!���B&@& "�"#""a"R"�; &&�%�%�%�%�%�%�%�%�%�%�%�!�!�!�!�!0j"k""=""5"+","""�"�"�"�"*")"'"("��������������� �!�"�#�$�%�&�'�(�)�*�+�-�.�/�0�1�2�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�R�S�U�V�W�Y�Z�[�\�]�^�_�b�d�e�f�g�h�i�j�k�m�n�o��!�!""�^�����������."""�	!0 �%�%�%�%d&`&a&e&g&c&�"�%�%�%�%�%�%�%�%�%�%�%h&&&&&�  ! �!�!�!�!�!m&i&j&l&22!�3"!�3�3!!� �q�r�s�u�v�w�x�y�z�{�}�~�ɀɁɂɃɄɅɆɇɊɋɍɎɏ��ɒɓɔɕɖɗɚɜɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮ��ɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿ���������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;��=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]���������������������������������������������
����������������� �!�"�#�$�%�&�'�(�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�112131415161718191:1;1<1=1>1?1@1A1B1C1D1E1F1G1H1I1J1K1L1M1N1O1P1Q1R1S1T1U1V1W1X1Y1Z1[1\1]1^1_1`1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1{1|1}1~11�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1G�H�I�J�K�N�O�Q�R�S�U�V�W�X�Y�Z�[�^�b�c�d�e�f�g�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�~�ʀʁʂʃʅʆ��ʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧ�p!q!r!s!t!u!v!w!x!y!`!a!b!c!d!e!f!g!h!i!�������������������������������������������������ʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʾʿ�����������������������������������������������������������������������������������������������������	�
�%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%%%%%%%%
%%%!%"%&%'%)%*%-%.%1%2%5%6%9%:%=%>%@%A%C%D%E%F%G%H%I%J%��
����������������"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�B�C�D�E�F�G�J�K�M�N�O�Q�R�S�T�U�V�W�Z�[�\�^�_�`�a�b�c�e�f�g�h�i�j�k�l˕3�3�3!�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3&!�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3m�n�o�p�q�r�s�t�u�v�w�z�{�|�}�~�ˀˁ˂˃˄˅ˆˇˈ��ˊˋˌˍˎˏːˑ˒˓˔˕˖˗˘˙˚˛˝˞˟ˠˡˢˣ��˥˦˧˨˩˪˫ˬ˭ˮ˯˰˱˲˳˴˵˶˷˹˺˻˼˽˾˿������������&2?A�R��fJ`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2q2r2s2t2u2v2w2x2y2z2{2�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$�S!T!��[!\!]!^!�������������������������������������������������������������������������������������������������������������	�
���������������� �#�$���'138@B�S��gKI222222222	2
222
222222222222222�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$t$u$v$w$x$y$z${$|$}$~$$�$�$�$���t  � � � � %�&�*�+�-�/�1�2�3�4�5�6�7�:�?�@�A�B�C�F�G�I�J�K�M�N�O�P�Q�R�S�V�Z�[�\�]�^�_�a�b�c�e�g�i�j�k�l�m�n�o�q�r�s�t�v�w�x�y�z�{�|�}�~�̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓�A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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�1�2�3�4�5�6�7�8�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�]�^�_� !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNOa�b�c�e�f�g�h�i�j�k�n�p�r�s�t�u�v�w�y�z�{�|�}�~�̀��͇͉͍͎͂̓̈́͆͊͋͌ͅ͏͓͖͙͚͐͑͒͗͛͟͝͞��ͣͦͨͪͫͬͭͮͯ͢͡ͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ�����������������������������������������������������������������������������������������������������������	�
��
�����������������"�#�%�&�'�)�*�+�,�-�.�/�2�4�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�Z�[�]�^�b�c�d�e�f�g�j�l�n�o�p�q�r�s�v�w�y�z�{�}�~�΀΁΂΃ΆΈΊ΋Ό΍ΎΏΒΓΕΖΗΙ��ΛΜΝΞΟ΢ΦΧΨΩΪΫήίΰαβγδεζηθικ��μνξο��������������������������������������������������������������������������������������������������������	�
�������������� �$�,�-�/�0�1�8�9�<�@�K�M�T�X�\�p�q�t�w�x�z�����������������������������������������������������������ĬȬ̬լ׬�������������������������	�
���
��������������!�"�#�%�&�'�(�)�*�+�.�2�3�4�5�6�7�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�V�W�Y�Z�[�]�^�_�`�a�b�c�f�h�j�k�l��
����� �)�,�-�4�5�8�<�D�E�G�I�P�T�X�a�c�l�m�p�s�t�u�v�{�|�}��������������������������ĭȭЭѭӭܭ������������	��
��0�1�4�7�8�:�@�A�C�E�F�J�L�M�N�P�T�V�\�]�_�`�a�e�h�i�l�p�x�m�n�o�r�s�u�v�w�y�z�{�|�}�~�ρςστφχψωϊϋύ��ϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϢϣϤϥϦϧϩ��ϫϬϭϮϯϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿ���������������������y�{�|�}���������������Į̮ͮϮЮѮخٮܮ��������
��,�-�0�2�4�<�=�?�A�B�C�H�I�P�\�]�d�e�y�����������������������ǯȯɯ˯ͯίԯܯ�������������(�D�E�H�J�L�N�S�T�U�W�Y�������������������������������������������������������������������������������������	�
���
����������������� �!�"�#�$�%�&�'�(�)�*�+�,�]�|�}�������������������������������������������������������İŰǰȰɰаѰ԰ذ���	�����������#�$�%�(�,�4�5�7�8�9�@�A�D�H�P�Q�T�U�X�\�`�x�y�|�������������������������̱бԱܱݱ.�/�0�1�2�3�6�7�9�:�;�=�>�?�@�A�B�C�F�H�J�K�L�M�N�O�Q�R�S�U�V�W�Y�Z�[�\�]�^�_�a�b�c�d�e�f�g�h�i�j�k�n�o�q�r�s�u�v�w�x�y�z�{�~�ЀЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГД�߱����������������� �4�<�X�\�`�h�i�t�u�|�������������������������������������Ȳɲ̲вҲزٲ۲ݲ����������������������������������T�U�V�X�[�\�^�_�d�e��ЖЗИЙКЛМНОПРСТУЦЧЩЪЫЭЮЯабв��жиклмноп������������������������������������������������������������������������������������g�i�k�n�p�q�t�x�������������������������ijųȳ˳̳γгԳճ׳ٳ۳ݳ������� �(�)�+�4�P�Q�T�X�`�a�c�e�l���������������������Ĵȴдմܴݴ�������������$�%�'�(�)�*�0�1�4�8�����	�
��������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�2�3�5�6�7�9�;�<�=�>�?�B�F�G�H�I�J�K�N�O�Q�R�S�U�V�W�X�Y�Z�[�^�`�b�c�d�e�f�g�i�j�k�m�@�A�C�D�E�K�L�M�P�T�\�]�_�`�a�������������������������������ĵ̵͵ϵеѵص�����%�,�4�H�d�h���������������Զ�����(�)�,�/�0�8�9�;�D�H�L�T�U�`�d�h�p�q�s�u�|�}���������������������n�o�p�q�r�s�t�u�v�w�x�y�z�{�}�~�рстухцчщъ��ьэюяѐёђѓєѕіїјљњћќѝўџѢѣѥѦѧ��ѪѫѬѭѮѯѲѴѶѷѸѹѻѽѾѿ�����������������������������ј�����������������������Ƿɷ������������	�������$�%�(�,�4�5�7�8�9�@�D�Q�S�\�]�`�d�l�m�o�q�x�|���������������øŸ̸иԸݸ߸������������� �<�=�@�D�L�O�Q�X�Y�\�`�h�i�����������������������������������������������������������������������������������������
���
������������������ �!�"�#�$�%�&�'�(�)�k�m�t�u�x�|�������������������������������ȹɹ̹ιϹйѹҹعٹ۹ݹ޹�������������������8�9�<�@�B�H�I�K�M�N�S�T�U�X�\�d�e�g�h�i�p�q�t�x�������������������������������ĺȺغٺ��*�+�.�/�1�2�3�5�6�7�8�9�:�;�>�@�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�]�^�_�`�a�b�c�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�҂҃҅҆҇҉ҊҋҌ���
����� �)�+�4�5�6�8�;�<�=�>�D�E�G�I�M�O�P�T�X�a�c�l�������������������ĻȻлӻ�����������	���
�������������$�%�'�)�-�0�1�4�8�@�A�C�D�E�I�L�M�P�]��������������������ҎҏҒғҔҖҗҘҙҚқҝҞҟҡҢңҥҦҧҨҩҪҫҭ��үҰҲҳҴҵҶҷҺһҽҾ������������������������������������������������������������������������������������ҙ�����������������������������ļͼϼмѼռؼܼ����������	���$�,�@�H�I�L�P�X�Y�d�h�����������������������������������Խսؽܽ�������
������D�E�H�L�N�T�U�W�Y�Z�[�`�a�d������������	�
�������������"�#�$�&�'�*�+�-�.�/�1�2�3�4�5�6�7�:�>�?�@�A�B�C�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�h�j�p�q�s�t�u�{�|�}���������������������оѾԾ׾ؾ�������	������@�A�D�H�P�Q�U�����ſ̿ͿпԿܿ߿�<�Q�X�\�`�h�i������������������������������������������������������j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�~�ӁӂӃӅӆӇ��ӉӊӋӎӒӓӔӕӖӗӚӛӝӞӟӡӢӣӤӥӦӧӪӬӮ��ӰӱӲӳӵӶӷӹӺӻӽӾӿ���������������������������������������������������� �#�$�&�'�,�-�/�0�1�6�8�9�<�@�H�I�K�L�M�T�U�X�\�d�e�g�h�i�p�t�x����������������������������������������������������
������� �(�)�+�-���������������������������������������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�/�1�2�4�H�P�Q�T�X�`�e�l�m�p�t�|�}�ˆ‰˜›¤¥¨¬­´µ·¹����������������������������	��
������$�%�(�)�E�h�i�l�p�r�x�y�|�}ÄÈÌ��������������������������$�,�0�8�9�:�;�<�=�>�?�A�B�C�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�]�^�_�a�b�c�e�f�g�h�i�j�k�l�n�p�q�r�s�t�u�v�w�z�{�}�~ԁԃԄԅԆԇԊԌԎԏԐԑԒԓԕԖԗԘԙԚԛԜԝ�4�<�=�H�d�e�h�l�t�u�yĀĔĜĸļ������������������(�)�,�0�8�9�;�=�D�E�H�I�J�L�M�N�S�T�U�W�X�Y�]�^�`�a�d�h�p�q�s�t�u�|�}ŀńŇŌōŏőŕŗŘŜŠũŴŵŸŹŻżŽž��������������������ԟԠԡԢԣԤԥԦԧԨԪԫԬԭԮԯ԰ԱԲԳԴԵԶԷԸ��ԺԻԼԽԾԿ�������������������������������������������������������������������������������������������������������������������������������������������$�%�(�,�-�.�0�3�4�5�7�9�;�@�A�D�H�P�Q�S�T�U�\�]�`�l�o�q�x�y�|ƀƈƉƋƍƔƕƘƜƤƥƧƩưƱƴƸƹƺ�����������������������������������	�
��
���������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�>�?�A�B�C�E�F�G�H�I�J�K�N�P�R�S�T�U�V�W�Z�[�]�^�_�a�b�c������������������ �!�$�(�0�1�3�5�7�<�=�@�D�J�L�M�O�Q�R�S�T�U�V�W�X�\�`�h�k�t�u�x�|�}�~ǃDŽDžLJLjljNJǎǐǑǔǖǗǘǚǠǡǣǤǥǦǬǭǰǴǼǽǿ���������������������������
�d�f�g�j�l�n�o�p�q�r�s�v�w�y�z�{�}�~�ՀՁՂՃՆՊՋ��ՍՎՏՑՒՓՔՕՖ՗՘ՙ՚՛՜՝՞՟ՠաբգդզէ��թժիլխծկհձղճմյնշոչպջռսվտ���������������������� �$�,�-�/�1�8�<�@�H�I�L�M�T�p�q�t�x�zȀȁȃȅȆȇȋȌȍȔȝȟȡȨȼȽ�����������������������������
����,�4�P�Q�T�X�`�a�c�l�p�t�|ɈɉɌɐɘəɛɝ��������������������������������������������������������������������������������������������	�
���
�������������!�"�#�%�&�'�(�)�*�+�,�.�/�0�1�2�3�4�5�6�7�:�;������������������������������������	���
���)�L�M�P�T�\�]�_�`�a�h�}ʄʘʼʽ���������������������������� �!�A�H�I�L�P�X�Y�]�d�x�y˜˸����������
�����!�"�'�(�)�,�.�0�8�9�;�=�>�?�A�B�C�D�F�G�J�L�N�O�P�R�S�V�W�Y�Z�[�]�^�_�`�a�b�c�d�e�f�h�j�k�l�m�n�o�r�s�u�v�w�x�y�z�{�|�}�~�ր��ւքֆևֈ։֊֋֎֏֑֖֛֢֣֤֥֦֧֪֚֒֓֕֗֘֙֜֞֠֩�<�=�>�D�E�H�L�T�U�W�X�Y�`�d�f�h�p�ų̴̵̸̘̙̜̠̩̫̬̭̼���������������������	�������$�(�,�9�\�`�d�l�m�o�q�x͈͔͕ͤͥͧͩ͘͜Ͱ���������������������� �!�$�(�0�1�3�5��ֱֲֳִֵֶַָֺּֽ֭֮֯־ֿ������������������������������������������������������������������������������������������������	�
���
�������X�Y�\�_�`�a�h�i�k�m�t�u�x�|΄΅·ΉΐΑΔΘΠΡΣΤΥάέ��������������������������� �$�,�-�/�0�1�8�T�U�X�\�d�e�g�i�p�q�t�xπυόϡϨϰ�����������������������-�4�5�8�<���������!�"�#�$�%�&�'�*�,�.�/�0�1�2�3�6�7�9�:�;�=�>�?�@�A�B�C�E�F�H�J�K�L�M�N�O�R�S�U�Z�[�\�]�^�_�b�d�f�g�h�j�k�m�n�o�q�r�s�u�v�w�x�y�z�{�~�׀ׂ׃ׅׄ׆ׇ׊׋�D�E�G�I�P�T�X�`�l�m�p�t�|�}ЁФХШЬдезй��������������������������������������
�0�1�4�8�:�@�A�C�D�E�L�M�P�T�\�]�_�a�h�l�|фшѠѡѤѨѰѱѳѵѺѼ��������	��,�-�0�4�<�=�?�A�H�\��׎׏בגדהוזחךלמןנסעף�dҀҁ҄҈ҐґҕҜҠҤҬұҸҹҼҿ��������������������������������
�������� �!�%�(�)�,�0�8�9�;�<�=�D�E�|�}ӀӄӌӍӏӐӑӘәӜӠӨөӫӭӴӸӼ�������������������������������@�D�\�`�d�m�o�x�y�|�ԀԂԈԉԋԍԔԩ��������������������������<�=�@�D�L�M�O�Q�X�Y�\�`�e�h�i�k�m�t�u�x�|ՄՅՇՈՉՐե������������������������������������������ �$�-�8�9�<�@�E�H�I�K�M�Q�T�U�X�\�g�i�p�q�tփօ֌֍֐ְֹֻ֔֝֟֡֨֬���������������������������������� �(�)�+�-�4�5�8�<�D�G�I�P�Q�T�V�W�X�Y�`�a�c�e�i�l�p�t�|�}ׁ׈׉׌אטיכם�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� euckr	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¢�������Ģ����������������������������ª��ЪҪѪԪتӪ������򪰩Ω����������������������������«��éЫҫѫԫثӫ̩�����Щ󫧪��������������������������������©������������������������������������ĩǪǫŪūƪƫĪũ��ƩȪȫɪɫǩʪʫ̪̫˪˫��ɩ��ȩͪͫϪϫΪΫʩ��˩ת׫֪֫��ͩ٪٫۪۫ڪګܪܫݪݫߪ߫ުޫ���૯�ϩ�������������������������������êëժի������������������������������������������������������§çħŧƧǧȧɧʧ˧̧ͧΧ����������������������������������������������������������������������������������������������������°ðİŰưǰȰɰʰ˰̰Ͱΰ��ϰаѰҰӰ԰հְװذٰڰ۰ܰݰް�����������������߰������������������������������������������������������������������������������������������±ñıűƱDZȱɱʱ˱̱ͱαϱбѱұӱԱձֱױرٱڱ۱ܱݱޱ��߱�������������������������������������������������������������������������������������������������������²òIJŲѲ��ƲDzȲɲʲ˲̲ͲβϲвҲӲԲղֲײزٲڲ۲ܲݲ޲߲�������������������������������������������������������������������������������������������������������������³óijųƳdzȳɳʳ˳̳ͳγϳгѳҳӳԳճֳ׳سٳڳ۳ܳݳ޳߳�������������������������������������������������������������������������������������������������������������´ôĴŴƴǴȴɴʴ˴̴ʹδϴдѴҴӴԴմִ״شٴڴ۴ܴݴ޴ߴ�������������������������������������������������������������������������������������������������������������µõĵŵƵǵȵɵʵ˵̵͵εϵеѵҵӵԵյֵ׵صٵڵ۵ܵݵ޵ߵ�����������������������������������������������������������������������������������������������������������¶öĶŶƶǶȶɶʶ˶̶Ͷζ϶жѶҶӶԶնֶ׶ضٶڶ۶ܶݶ޶߶�������������������������������������������������������������������������������������������������������������·÷ķŷƷǷȷɷʷ˷̷ͷηϷзѷҷӷԷշַ׷�طٷڷ۷ܷݷ޷߷��������������������������������������������������������������������������������������������������������¸øĸŸƸǸ��ȸɸʸ˸̸͸θиѸϸҸӸԸոָ׸ظٸڸ۸ܸݸ޸߸��������������������������������������������������������������������������������������������������������¹ùĹŹƹǹȹɹʹ˹̹͹ιϹйѹҹӹԹչֹ׹عٹڹ۹ܹݹ޹߹�����������������������������������������������������������������������������������������������������������ºúĺźƺǺȺɺʺ˺̺ͺκϺкѺҺӺԺպֺ׺غٺںۺܺݺ޺ߺ���������������������������������������������������������������������������������������������������������������»ûĻŻǻȻɻʻƻ˻̻ͻλϻлѻһӻ׻ջ��Իֻػٻڻۻܻݻ޻߻�����������������������������������������������������������������������������������������������������������¼üļżƼǼȼɼʼ˼̼ͼμϼмҼѼӼԼռּ׼ؼټڼۼܼݼ޼߼�����������������������������������������������������������������������������������������������������������½ýĽŽƽǽȽɽʽ˽̽ͽνϽнѽҽӽԽսֽ׽ؽٽڽ۽ܽݽ޽߽�������������������������������������������������������������������������������������������������������������¾þľž��ƾǾȾɾʾ˾̾;ξϾоѾҾӾԾվ־׾ؾپھ۾ܾݾ޾߾�����������������������������������������������������������������������������������������������������������¿ÿĿſƿǿȿɿʿ˿̿ͿοϿпѿҿӿԿտֿ׿ؿٿڿۿܿݿ޿߿����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������£¤¥����¨©ª����­������������³����������¹º��¼��¾���������������������������������������������������������������������������������������������¿��������������������������������������������������ê��������ï����òó����ö÷����û����þ�����������������������������������������������������������������������������������������������������������������������������������áĢ��������ħ������īĬĭ��į��ı��ijĴ����ķ��Ĺ����ļ��������������������������������������������������������������������������������������������������������������������������������������������ť��ŧ��ũ����Ŭŭ��ů����������������������ź����������������������������������������������������������������������������������������������������������������������������������������š����������Ƨ��Ʃ��ƫ��ƭƮ����Ʊ��Ƴ��Ƶ��������������ƽ���������������������������������������������������������������������������������������������������������������������������������������������ǧ��������������ǯ��������Ǵǵ��Ǹ������������ǿ�������������������������������������������������������������������������������������������������������������������������������Ȣ��������������������ȭ��������Ȳȳ����ȶ����ȹȺ����Ƚ������������������������������������������������������������������������������������������������������������������������������������ɤ��������ɩ����ɬɭ����������������������ɸ��ɺɻɼ����ɾ���������������������������������������������������������������������������������������������������������������������������������������������ʩ������ʭ��ʯ����ʲʳ����ʶ������ʺ�����������������������������������������������������������������������������������������������������������������������������������������ˤ��������˩��˫��������˰����˳����˶����������������˿��������������������������������������������������������������������������������������������������������������������������̢̣����������̩������̴̵̭̮̯̰̱̲̳������̹��̻������̿���������������������������������������������������������������������������������������������������������������������������������ͣ��ͥ������ͩ��������ͮͯͰ����ͳ����������͹��������;Ϳ�������������������������������������������������������������������������������������������������������������������������͡����Υ��ΧΨ��ΣΪ��������ί��αβ������������θ����λμ���ξ�������������������������������������������������������������������������������������������������������������������������������������ϧϨ����������Ϯ��ϰϱ������������ϸ������������Ͽ��������������������������������������������������������������������������������������������������������������������������������ХЦ������Ъ��Ь����аб��������е��и��к��ж����������������������������������������������������������������������������������������������������������������������������������������������ѥ����������ѫ����Ѯ��������������������ѹ��ѻ��ѽѾ����������������������������������������������������������������������������������������������������������������������������ѡ������ҥҦ��������������Ү������Ҳ����������Ҹ����������������������������������������������������������������������������������������������������������������������������������������������Ӧ��������ӫ��ӭ��������������ӵ��ӷӸ������Ӽӽ�����������������������������������������������������������������������������������������������������������������������������ӡ����ԣ������ԧ����ԪԫԬԭ��ԯ԰���������Զ��Ը������Լ��Ծ�������������������������������������������������������������������������������������������������������������������������������գդե������թժ��լ����կ������������ն������պ�����������������������������������������������������������������������������������������������������������������������������������������֣����֦��������֫֬����������������������������������־������������������������������������������������������������������������������������������������������������������������������ף����������������������ׯװ��ײ����׵������������׼��׾����������������������������������������������������������������������������������������������������������������������������������أ������������ت��ج��خد��ر��������صض������غػ����������������������������������������������������������������������������������������������������������������������������������������٥٦٧����٫����ٮ��������������ٶٷٸ����ٻ����ٽپ�����������������������������������������������������������������������������������������������������������������������������������ڢ��ڤ��ڦ��ڨک��ګ������������������ڵ���渷����ں��ڼڽھ�������������������������������������������������������������������������������������������������������������������������������ۣ��ۥ��ۧ��۩۪����������������۳����۶����۹ۺۻۼ۽۾�����������������������������������������������������������������������������������������������������������������������������������������ܧܨܩ������ܭ��������ܲ����������������ܻܼ��ܾ�����������������������������������������������������������������������������������������������������������������������������ܡݢݣ��������ݨ��ݪ��ݬ������ݰݱݲ����ݵݶݷݸ��������������������������������������������������������������������������������������������������������������������������������������������ޢ����������ިީ����ެޭ������������޴޵������޹��޺������޾������������������������������������������������������������������������������������������������������������������������������ޡ������ߥ����ߨ����߫��߭��������߱������������߹�������߽��߿����������������������������������������������������������������������������������������������������������������������������ߡ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������â	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������^���������"!�!���������������������	
RSTUVWXYZ[\^_�&2A?J�Rf���'138B@IK�S�g���������
����" $�����0*.(469=;CGE������PL�TXVZ\`^db����l�pjrnh����t�xvy}{�������	
������!%�����+/)57:><DHF������QM�UYW[]a_ec����m�qksoi����u��wz~|NNNNNN#N$N(N+N.N/N0N5N@NANDNGNQNZN\NcNhNiNtNuNyNN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NOOOOOOOOOOO.O1O`O3O5O7O9O;O>O@OBOHOIOKOLOROTOVOXO_OcOjOlOnOqOwOxOyOzO}O~O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OPPPP
PPPPPPPPPPP"P'P.P0P2P3P5P@PAPBPEPFPJPLPNPQPRPSPWPYP_P`PbPcPfPgPjPmPpPqP;P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQQQQQ
QQ�PQQQQQQQ#Q'Q(Q,Q-Q/Q1Q3Q4Q5Q8Q9QBQJQOQSQUQWQXQ_QdQfQ~Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRRRRRRRR"R(R1R2R5R<RERIRURWRXRZR\R_R`RaRfRnRwRxRyR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSS
SSSSSSSSSS%S'S(S)S+S,S-S0S2S5S<S=S>SBSLSKSYS[SaScSeSlSmSrSyS~S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STTT!T'T(T*T/T1T4T5TCTDTGTMTOT^TbTdTfTgTiTkTmTnTtTT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUUUU	UU
UUU*U+U2U5U6U;U<U=UAUGUIUJUMUPUQUXUZU[U^U`UaUdUfUU�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVV
V
VVVVVVV,V0V3V5V7V9V;V<V=V?V@VAVCVDVFVIVKVMVOVTV^V`VaVbVcVfViVmVoVqVrVuV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWWW
WWWWWWW W"W#W$W%W)W*W,W.W/W3W4W=W>W?WEWFWLWMWRWbWeWgWhWkWmWnWoWpWqWsWtWuWwWyWzW{W|W~W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXX	X�WX
XXXX X&X'X-X2X9X?XIXLXMXOXPXUX_XaXdXgXhXxX|XX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYYYA�Y!Y#Y$Y(Y/Y0Y3Y5Y6Y?YCYFYRYSYYY[Y]Y^Y_YaYcYkYmYoYrYuYvYyY{Y|Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZZ
ZZZZZ#Z$Z'Z(Z*Z-Z0ZDZEZGZHZLZPZUZ^ZcZeZgZmZwZzZ{Z~Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[[4[[[[![%[-[8[A[K[L[R[V[^[h[n[o[|[}[~[[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\#\&\)\+\,\.\0\2\5\6\Y\Z\\\b\c\g\h\i\m\p\t\u\z\{\|\}\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]
]]+]#]$]&]']1]4]9]=]?]B]C]F]H]U]Q]Y]J]_]`]a]b]d]j]m]p]y]z]~]]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^
^^^^^^ ^.^(^2^5^>^K^P^I^Q^V^X^[^\^^^h^j^k^l^m^n^p^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^________!_"_#_$_(_+_,_._0_4_6_;_=_?_@_D_E_G_M_P_T_X_[_`_c_d_g_o_r_t_u_x_z_}_~_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_`
`
```````$`-`3`5`@`G`H`I`L`Q`T`V`W`]`a`g`q`~``�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`aa
aaaaaaaaaaaa"a*a+a0a1a5a6a7a9aAaEaFaIa^a`alaraxa{a|aa�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbbbbbb b"b#b'b)b+b9b=bBbCbDbFbLbPbQbRbTbVbZb\bdbmbobsbzb}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bcc
cc
ccccc)c*c-c5c6c9c<cAcBcCcDcFcJcKcNcRcScTcXc[cecfclcmcqctcucxc|c}cc�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c	d
dddddd d"d$d%d)d*d/d0d5d=d?dKdOdQdRdSdTdZd[d\d]d_d`dadcdmdsdtd{d}d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deee	e
eeeeeeeee"e&e)e.e1e:e<e=eCeGeIePeReTe_e`egekeze}e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�efff	f
fffffff!f"f#f$f&f)f*f+f,f.f0f1f3f9f7f@fEfFfJfLfQfNfWfXfYf[f\f`faf�fjfkflf~fsfuffwfxfyf{f�f|f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fgggggg g"g3g>gEgGgHgLgTgUg]gfglgngtgvg{g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�gRhhhhh(h'h,h-h/h0h1h3h;h?hDhEhJhLhUhWhXh[hkhnhohphqhrhuhyhzh{h|h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hi	i
iiiiii1i3i5i8i;iBiEiIiNiWi[icidieifihiiilipiqirizi{ii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjjjj j$j(j0j2j4j7j;j>j?jEjFjIjJjNjPjQjRjUjVj[jdjgjjjqjsj~j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkkkk	kkkkkkk$k(k+k,k/k5k6k;k?kFkJkMkRkVkXk]k`kgkkknkpkuk}k~k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�klll	l
llllll&l'l(l,l.l3l5l6l:l;l?lJlKlMlOlRlTlYl[l\lklmloltlvlxlyl{l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmm
mmmmmm&m'm(mgl.m/m1m9m<m?mWm^m_mamemgmompm|m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnnn"n'n2n6n9n;n<nDnEnHnInKnOnQnRnSnTnWn\n]n^nbncnhnsn{n}n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�noo
oo
ooooo&o)o*o/o0o3o6o;o<o-oOoQoRoSoWoYoZo]o^oaoboholo}o~o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�opppp
pp p#p/p4p7p9p<pCpDpHpIpJpKpTpUp]p^pNpdpeplpnpupvp~p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqqqqqqq q+q-q/q0q1q8qAqEqFqGqJqKqPqRqWqZq\q^q`qhqyq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrr	rrrrrr$r+r/r4r8r9rArBrCrErNrOrPrSrUrVrZr\r^r`rcrhrkrnrorqrwrxr{r|rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rsssss
ssssss"s$s's(s,s1s2s5s:s;s=sCsMsPsRsVsXs]s^s_s`sfsgsiskslsnsosqswsys|s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�stttt
tttt$t&t(t)t*t+t,t-t.t/t0t1t9t@tCtDtFtGtKtMtQtRtWt]tbtftgthtktmtntqtrt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuu u!u$u'u)u*u/u6u9u=u>u?u@uCuGuHuNuPuRuWu^u_uauouquyuzu{u|u}u~u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvvvv
vvvvvvvvvvvv#v%v&v)v-v2v3v5v8v9v:v<vJv@vAvCvDvEvIvKvUvYv_vdvevmvnvovqvtv�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vww
wwwwwwwww"w(w-w.w/w4w5w6w9w=w>wBwEwFwJwMwNwOwRwVwWw\w^w_w`wbwdwgwjwlwpwrwswtwzw}w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx	x
xxxx!x"x#x-x.x0x5x7xCxDxGxHxLxNxRx\x^x`xaxcxdxhxjxnxzx~x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy�x�x�x�x�xyyyyyyy y%y'y)y-y1y4y5y;y=y?yDyEyFyJyKyOyQyTyXy[y\ygyiykyryyy{y|y~y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzz	z
zzzzzz!z'z+z-z/z0z4z5z8z9z:zDzEzGzHzLzUzVzYz\z]z_z`zezgzjzmzuzxz~z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{{#{'{){*{+{-{.{/{0{1{4{={?{@{A{G{N{U{`{d{f{i{j{m{o{r{s{w{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|||||	||||||| |%|&|(|,|1|3|4|6|9|:|F|J|U|Q|R|S|Y|Z|[|\|]|^|a|c|g|i|m|n|p|r|y|||}|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}}	}}}}}}}}#}&}*}-}1}<}=}>}@}A}G}H}M}Q}S}W}Y}Z}\}]}e}g}j}p}x}z}{}}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~�}�}�}�}�}�}�}�}�}�}�}~~~~~~~ ~'~(~,~-~/~3~6~?~D~E~G~N~P~R~X~_~a~b~e~k~n~o~s~x~~~�~�~�~�~�~�~�~�~�~�~�~<;=>?CDGORS[\]acdefmq}~�������������������������������������
�
���������� �$�&�,�.�0�4�5�7�9�:�<�>�@�D�`�d�f�m�q�u���������������������Ȁ̀πҀԀՀ׀؀������������������� �$�'�,�0�5�:�<�E�G�J�L�R�W�`�a�g�h�i�m�o�w���������������������������������ˁÁŁʁ΁ρՁׁہ݁ށ�������������������������!�"�(�2�4�:�C�D�E�F�K�N�O�Q�V�\�`�c�g�m�t�{�}����������������������������������������������������������������ƂЂՂڂ������������������
��T�����!�"�,�-�.�0�3�7�:�<�=�B�C�D�G�M�N�Q�U�V�W�p�x�}������������������������������������������ǃɃσЃуԃ݃S������������
�������/�9�E�G�H�J�M�O�Q�R�V�X�Y�Z�\�`�d�e�g�j�p�s�t�v�x�|�}�����������������������������������„DŽȄ̄τӄ܄������2���������������"�#�$�%�'�*�+�/�3�4�6�?�F�O�P�Q�R�S�V�Y�\�]�^�_�`�a�b�d�k�o�y�z�{�}������������������������������������������������…Džʅ˅΅��؅څ߅������������
���������!�'�)�6�8�:�<�=�@�B�F�R�S�V�W�X�Y�]�`�a�b�c�d�i�l�o�u�v�w�z�������������������������������������������Æņц҆Ն׆چ܆���熈�������������������!�#�(�.�/�1�2�9�:�<�=�>�@�C�E�M�X�]�a�d�e�o�q�r�{�������������������������������������������������������ȇɇʇ·Շևهڇ܇߇���������������	�
�������������(�-�.�0�2�5�:�<�A�C�E�H�I�J�K�N�Q�U�V�X�Z�\�_�`�d�i�q�y�{���������������������������ʈˈ͈̈Έш҈ӈۈވ��������
��������� �&�'�(�0�1�2�5�9�:�>�@�B�E�F�I�O�R�W�Z�[�\�a�b�c�k�n�p�s�u�z�{�|�}���������������������������������ԉՉ։׉؉��������������������� �"�$�&�+�,�/�5�7�=�>�@�C�E�G�I�M�N�S�V�W�X�\�]�a�e�g�u�v�w�y�z�{�~������������������������������������������ÊƊȊɊʊъӊԊՊ׊݊ߊ����������������
�-�0�7�<�B�C�D�E�F�H�R�S�T�Y�M�^�c�m�v�x�y�|�~�����������������������8�9�=�>�E�G�I�K�O�Q�S�T�W�X�[�]�Y�c�d�f�h�i�m�s�u�v�{�~�������������������������ŌƌɌˌό֌Ռٌ݌����������������	����e�i�l�n������������������������������������������ōƍǍȍʍ΍эԍՍ׍ٍ���������������� �!�"�#�&�'�1�3�6�7�8�9�=�@�A�K�M�N�O�T�[�\�]�^�a�b�i�l�m�o�p�q�y�z�{�������������������������������������������ÎĎǎώюԎ܎������������������� �!�#�%�'�(�,�-�.�4�5�6�7�:�@�A�C�G�O�Q�R�S�T�U�X�]�^�e�������������������������Əʏˏ͏ЏҏӏՏ������������������(�)�/�*�,�-�3�4�7�?�C�D�L�[�]�b�f�g�l�p�t�y�������������������������������������������̐��ÐĐŐǐȐՐאِؐܐݐߐ�Ґ�������������
��������� �%�"�#�'�)�.�/�1�4�6�7�9�:�<�=�C�G�H�O�S�W�Y�Z�[�a�d�g�m�t�y�z�{�������������������������������������������������������‘Ñőӑԑבّڑޑ����������������������	�
���������#�$�%�&�(�.�/�0�3�5�6�8�9�:�<�>�@�B�C�F�G�J�M�N�O�Q�X�Y�\�]�`�a�e�g�h�i�n�o�p�u�v�w�x�y�{�|�}������������������������������������������������������’ÒŒƒǒȒ˒̒͒ΒВӒՒגْؒܒݒߒ����������������
��������!�$�%�'�)�*�3�4�6�7�G�H�I�P�Q�R�U�W�X�Z�^�d�e�g�i�j�m�o�p�q�s�t�v�z�}����������������������������������������������������ēœƓǓɓʓ˓͓̓ӓٓܓޓߓ������������������	�
�������.�/�1�2�3�4�;�?�=�C�E�H�J�L�U�Y�\�_�a�c�h�k�m�n�o�q�r�����x�y�~�������������������������������������ƕȕɕ˕Еѕҕӕٕڕݕޕߕ�����"�$�%�&�,�1�3�7�8�9�:�<�=�A�R�T�V�W�X�a�n�t�{�|�~��������������������������������������ʖҖ�]ؖږݖޖߖ������	����!�"�#�(�1�3�A�C�J�N�O�U�W�X�Z�[�c�g�j�n�s�v�w�x�{�}������������������������������������������������ėŗǗɗʗ̗͗ΗЗїԗחؗٗݗޗ�ۗ����������
��
������ �#�&�+�.�/�0�2�3�5�%�>�D�G�J�Q�R�S�V�W�Y�Z�b�c�e�f�j�l���������������������˜ŘȘ̘������������������"�&�'�+�1�2�3�4�5�9�:�;�<�@�A�F�G�H�M�N�T�X�Y�[�\�^�_�`�������������������������Ùəәԙٙڙܙޙ��������������������� �"�#�$�'�-�.�3�5�6�8�G�A�D�J�K�L�N�Q�T�V�]���������������������������ÚƚȚΚКҚ՚֚ךۚܚ�����������������������	���
�������� �&�+�-�3�4�5�7�9�:�=�H�K�L�U�V�W�[�^�a�c�e�f�h�j�k�l�m�n�s�u�w�x�y������������������������������������������������������������ǛțΛЛכ؛ݛߛ���������������������������"�#�&�'�(�)�*�1�5�6�7�=�A�C�D�E�I�J�N�O�P�S�T�V�X�[�]�^�_�c�i�j�\�k�h�n�p�r�u�w�{�������������/�0�2�3�4�:�<�E�=�B�C�G�J�S�T�_�c�b�e�i�j�k�p�v�w�{�|�~�������������������������������������������Ýǝɝʝԝ՝֝םڝޝߝ���������
������������z�{�|�������������������������������������������ƞȞ˞՞ߞ��������������	������������"�&�*�+�/�1�2�4�7�9�:�<�=�?�A�C�D�E�F�G�S�U�V�W�X�Z�]�^�h�i�m�n�o�p�q�s�u�z�}�������������������������p!q!r!s!t!u!v!w!x!y!`!a!b!c!d!e!f!g!h!i!��12!!!�p�N�P�QS$S��TYW���X�[�\S]��_�` aNe;fef�)�h��kj�j�m�m(p��u�v�v�0y�����z���}�}�b���� �!��"���v�#�$�%�ސ&��'�(����)�;�M�Q�*�+�,���ٚr�-�ў�������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����ޡ����ߡ���������������������������������������������������¦æĦŦƦǦȦɦʦ˦̦ͦΦϦЦѦҦӦԦզ֦צئ������������������������������������������������������������������ѧҧӧԧէ֧ا٧ڧۧܧݧާߧ������������������ק����ơǡȡɡ����šġ�������������������������������������͢΢ϢߢТࢺ��������ܢ¡ʢˢ�������������������������ݢ��ޢ���������������������������������������������������������������������������������������������������������������������������������������������������������ҡӡԡա֡סء١ڡۡ����̡͡��������������������������������������������������������������������¤äĤŤƤǤȤɤʤˤ̤ͤΤϤФѤҤӤԤդ֤פؤ٤ڤۤܤݤޤߤ����������������������������������������������������������������������������������������������¥åĥťƥǥȥɥʥ˥̥ͥΥϥХѥҥӥԥե֥ץإ٥ڥۥܥݥޥߥ���������������������������������������ƭʭ��ĭ­̭˭ŭͭǭϭ��έíȭɭ߭���ӭԭЭѭҭ֭խ�������澰�徼��ɿ��Я�Ф���ֵ����������������ݴ��缧����е�׵����ø�����辫е������������������л������������߸޸����������дед˶������������ļ�������Ϳ��ο������ص����кЩ�ƻŻ�¿��������������ʰ�о�Ķ����������˰��ɲ�ٵ��������������ǻ����������̰�Ļ�������������������Ф�������²�������Ȼ��������������������Ͱ����������������������ӽ�������������������������������������������������ĸ����������������ڼ���������������������������ΰ��������������ż���������������������ź���У��ĺ������϶�Ѣ��������˥�����������Ѫ����������ѯ�������ѱѰ����������������Ѹѷ��Ѻ���������ä��������������������������Ѭ���������ʶ����������߱�����ƺ��������������̼�����ѽ����������������������������������ڽ���ÿ������ѥ�Ŷ�������������Ѯ��ѧ����н������Ͽ�������������������������������������������ɻ�����������Ѱ������������޺�������������������ij�ѭ������������ò������幢ң����ϥ������������������������Ҫ��������ʭ�����ж�ҫ��������ұ�ۼ��������ʲ������Ҷ��ҽ�����������������������Ҥ����ƿҽ����ң���Ҿ����ȴ��¨��Ʊ�������������Ҭ������ѵ���ҷ�����������������������߿��ޱ��������������˵�ڵ������ǽ��������ñ���Ÿ��ҡ�«�������IJ�¸�˻����ʻ����ɵƳ�ȵ�ĥ��ƾ̡�����������������޴��������۵������������������������������������������Ƹ������������������������������麱�����������ɢ������Ⱥ�������Ө������Ӭ����������������������ӣ������Ӱ������¶Ӧ��������Ӹ��ӻ������������ӱ���������Ӽӭ�������������ʵ�����ı��������������̻������������Ų���Ө�����޲�����������������������������������������ų������������������������������������������ͻ���������ϰ޿��Ǹ����������������౤����������Ե�ߺ�����ԫ������Ѷ���ԯ������������������Ե������������������������������Ծ���������������������������������������������������������������������Ź���ɺ����������п��ν������������������������������������������������������������λѿ��Լ����������������������Ʋ���Ͱ���Ƚ��������������������������а�������������������������������ԩ��ԥ��������������ա�������������������������������ʺ����лϻ��ȸ��Ѱ�խ����������̱�����ѻҰ�������������ձ�������ո����լ��������������������ղ���ս�Dz�������������������������������������ű������������һ��������������ڻ������ɸ��س�����գ������������������°����������������ĸ�����¼ҵ������ܵ˺��㱬�Ȳ����ɽ�����Ʃ��������������������ա�ɲ�������ի��ܳ�����������������������ͼ�խ�����Ӱ��ҿ�ճƮ����������������ƶ�����ܼ����Կ�Ȣ�ɶ�������ư�ӻ�բ֡����������ȼ���������������������������֨���ٳ�ֱ�ߴ�ְ����������Ʈ�岶ֻ����������Խ���������ֳֽ��������������������������������������������ź�����������������������������������������������ʸ�֦�����������ҶԻ��������������������ջ��¢����������������������������������־������ʯ���������ָ��ͩ������������������ʹ���������º˸��ð����������έ����dz���ץ����ɳ��צע��ש����׫��׮���į�������������׮���ʵסб����ƶ�ݵ����צʰ������̹�̸��������������������������������������׳������̺�ɦ�������Ʊ�����������������·�������ק�������ž���������������۽����Ƨ����׫�����������ֻ�˻�������������������������������������������׻����޵�׭�����������������������������������������������������׳����÷�����ס�������������ؤ��ע�縪���ٱ���ǭ����׬ذ������Ů��������������԰�ب���״��½�����ض�漹ؼ��إ���������ؿ�հ��򶦰�����������������������������²��ص����������������˷���ŷ��������ְ��������ķ����������������������������Ʒ�����������������ة��������������������������������������������ؿ����������������������ٺ����٧���͸����꽨������ͺ�����������������������������ٵ����ٷٶ������ͳٴٸ��ŵٳ���ٴ����ȭ��������١������þ�������������������¶��ٴ���������ȳ糡����������٢����������ػ��İ��������٧�ú��������������������������μ���������ٹ��Ʊ��������������������ݳ�٫�κ��������汼���ŵǷ��������������������������͹����������������������������������������ȷ���������������������������������������ǣ����ɳ����ͧ���������������ڬڧŮ����������ڳ���������������������ں��ټڰ�ٻ�ھ�ڿ������ʯ�θ������ߵ�������ڵ�����������ɷ����������������������غ����������м����Զ�����»��ۻ��������ܻ�����ڹ�����������������������ƶ��ݻ�ܽ���������������������̪�װ�����DZս����������������������������������������������������ʷ��������Ƕ���˲��������Ű��������û���������������������콤������������ʶȱ���������Ҿ�����Ǻ����������ĭۯ����Į���۰�������˥�������۷۶��������������ɰຼ�ݼ������۫º���̼۽��������ǿ�������ϵ�������������������������̲޻���������ϸ����Ͳ�����������������ǿ˻�������������������������������Ƽ����������ɱ�������������������˳��ʳϺ���˷����ư����Ͷ����˵�������������������������������������������������������ģ���������������������������ܣ�������ū�������������ܽ������ذ����ۢ�����������񳡸��۰�����������������������ɸ����ܿ������������ܷ�ȶ��ݽ�Ǽ�˶�ܶܳ���ڳ���ܵ��ݱ�����������������������������������ܽ��������������������������������������������������������������������߳�������������������̵����������������������������������������������ܥݤ���������ݫ������ݯ��Ͱ�����������緡�ն�����ݷݺݽ�ֶ��������β����������������߻������������к�����������������޽�Ļ���ݣ������������������ݥ�������̳��������������������������������������������������������ʱ�������������������ݾ����������������������������������ݣ�������������������ϲ��̡ޣ�¾������������������������������������������˱�Ͱ����������Ʀ���̱���������ި������������޴����޳���������������������þ����������������ձ�����������޿�����ʽ���������������������������߽�������޺����Ѻľ��½̷����������������ޯ������ެ��������������������иž�����������������Ͼ��������޻������¹���������������������������������������������������������������������������������������������ô�����������߬ĩ������������ߧ߭���������´���߷����������²߻����߼�������깨����ͽ����������������������������������������������������������в�ť��޼Һ���������ߺ����������ٰ����������������������߲�����Ǿ��ƾ�������������������Ⱦ����Ѽ����������������Ͻ����������������������������������ߤ�������������������������������߼���̫����������������������������������������������Ժ����������������������������������Ѹ���������������ƹ����������������������������í��������Ͳ�������������ý������ͳ������������̶������������Ѳ���������������������������������������׶���������������ͱ���������������������������������Ĵ�������������ɢ��������������ɪ����������������Ŵӿ�������������ʵ��ų�ù���ô���貶���������ڦ���ڰ�����ν���æ��������ͷ���������۰��������������������������������������ֱ���������᾿����������ɾ�������������������������������������������������������������������������������������������������������Ť��Ǵ��������Ĺ����������������������������������αױ�����������������ƴ�ȹ���������������ʾ������Ǵ�����⿿������������������������������������������������������ֽ�����������������������������������������⺶�����������պ����ֺε������ܹ��˾��Ź�������������ⷳ����������������������γ������������������������������̾������������������Ҽ�㷷����������������˽�������;��׺��������ض�ϵ���Ҳ�ġ������������������ٶӲ�ƨ������ʲ���������������������ξܰ���������������������������������Բη��ƹ����������ϱ������������ϳ������������������������������㦷��������������������������������������������Ͼ����׽�����������������ó�ȴ������������о�������޳ڿ�������������������ڶ���������������������������������ղ���������ǧ������������ɴ���������������������������ļ����������������������������������ʴ�������������������������������������������������ζ������������������ͽ�������䡴Ѿ������������������������Ҹ�������������ǹ���������������Ϸ�������ȹ����������㽣�Ӽɹ�鵶ʢ������������ٺ��¿��Ҿ��������������з��������ʹ�ͼ���������ů���������������ѷ�¹���������ݰ������˹���Ľ�������彰����۶��������������������������˴��ް���������������������ʼ��������Ľ��̽�������������������������ҷ�������������������������������������������������������������̴��������������������������ӷ��������ȯ�������ͱ�����������������沷����������������������������������������ʹ���������ͷ�͹��Լ���橼����̹�����������������������������������������������������榿�����������������ϩ���Ӿ������δԸ�����������ιϹ����߰������������������ո��������������������Ϯ���ӵ��������������������տ�ɥ���й�����������������Ģʣ��¯��������ѹ�������˨�������˷��������������ǽ������������������������ÿ���������������籱���������罶�������˼��������ܴ��ؽ�ɮ���ҹ����������ǿ���������������������ϴ�����������秿��������������Ǽ������������Ŀֲ��ݷܶ����������������ײ���������������ѱ�����������ز������Է����������������������§������շ����ӹ�����ٲ�������������������д��������������������Ƶݶ��۲Ծ��ں��������ڲָ�������������������������������������������������������������������������������������վ����������������������������������踳���������������������ü��������������������������������־ɼ��������������Ϣ����������������������������������駻ſ�������������������������ƻ��Ȯ��������������������ݢ���������������׸Ե��������������������������������������������������ؼ����ַ³��������������������������������������������������������������������������������������ܲ�����������������������������ͳ���������������������������µ�����������������������������������Թ����ѽ����ұ׾��չ������������������޶��������������������������������Ӹ������ۺ���������������������������ؾ����������������������������������������������������߶���������������������������Ǫ��뫸�����ǭ�г�������ƿ������Ѵ�������ѳ�����������������ľ�׷ֿ����������­�����پ�������������ǿ��ھ������������۾�����ӱ��ط��������͵�Ϻ�ܾ��������ظ��ﻧ������������������������������ݲ��õ����������Ҵ��ۿ�����������������������������������������ڱ���������������������ֹռ������������������������������������ٷ�����ĵ���������������������������������������������������ݾ��빮з���ɹ�����������˾�������������׹��߲����Ӵ�����������쮵�������Ƚ�������������������������쿻�޾������������������ع�������������������������ϼ��ҳ����������������۱��������������������������������ٸ����������������������������������������������������������������������������������������ȿ������������ּ����������������������ڷ��ӳ��ܺ������������������������������������������������������������������ɿ�����������������ë����������������׿޷�������������������ҽ������������������յ�������������������������¤����������ʿ������������������Ϳ���Ს����ƣ�㰨�������������������׼����彭�����α��ȳ�����Դ���������������ټ���������ٹ������������Գ��������������������������������ݿ��������������ڹ������������������߾��������������������Ӻ������Ž�������������˿�������������������ó��������������ڸ��������������������������۹���ƽ���������������������������������Ա��������ݹ������������Ӷ��⼣���������������������è��������������������������������������������������������������⾪Ƽ�����������������մ������������������������������������������﫳��״ִ����������شճ޹��������ܱ����������ǰ����������������������������������������������߹��¸��������ؿ��ٴ�������������Ϋ��������������¡����ֳ������ݺ�������������������α������������۸��������������������������������������������̿��������������������������������������������������������������������׳��ٿ�������������������Ȱ�������ǵ����������������������ڴ����������������ʺĢ���ܿ���������������۷�����ˬ�б���������������۳ܳ��鴲������ܸ�������������������������������������һ������������������±���������������۴�����������������������¶��������������������������ر������������������������������ٽ��������������������������������������ö�����������������������������������������������������������������������������������ݯ��䴵������������������������������ʸ����������˭������������������������������������߷��������������������������������������������������������������������������������������������������������������������򲼩���������������������������������������ܷ�����������������������������������������������������������������������������������������������������������е��������������������������������������������������ݸ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ʡˡ��ܡ��ݡ������������������������������䡩�����£ãģţƣǣȣɣʣˣ̣ͣΣϣУѣңӣԣգ֣ףأ٣ڣΡ��ϡ������������������������������������Сáѡ����̢���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~000���0�����0�0�@��>��?��0�0�0�00�N000�0  �<�^�%"\�& %     �	�00;�=�[�]�0	0
000
00000�
�����`"��f"g""4"B&@&�2 3 !�������
� ��&&�%�%�%�%�%�%�%�%�%�%�%; 0�!�!�!�!0""�"�"�"�"*")"'"("��!�!"" "�"#""a"R"j"k""=""5"+","+!0 o&m&j&  ! ��%����������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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������������������������������������������������ !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$`!a!b!c!d!e!f!g!h!i!I33"3M33'3363Q3W3
3&3#3+3J3;3�3�3�3�3�3�3�3{300!�3!!�2�2�2�2�2122292~3}3|3R"a"+"."""�" ""�"5")"*"�NUZ?��Ta(c�Y"�u��Pz�`�c%n�ef������h'W�eqb�[�Y{��b}�}��b�|���[�^	c�fHhǕ��Og�N
OMO�OIP�V7Y�YZ	\�`apafi�pOupu�y�}�}À�c��U�z�;S�N�N�W�����xN�X�n8�2z(���/�AQpS�T�T�V�Y_��m�-�b�p�����T�S�[�p��oS\��zN�x��&nVUk�;��Y�Sfm�t��BV�NK��O���S�U0[q_ f�fh8l�l)m[t�vNz4��[�`�풲m�u�vř�`������i�S�QW0XDY�[�^(`�c�c�lo�pqYq�q?s~v�т��`�[��iX�eZl%u�Q.YeY�_�_�b�e*j'k�k�s�V�,��Ğ�\�l{�QK\�aƁvharYN�OxSi`)nOz�NS�NUO=O�OsO�R�S	VY�Z�[�[�y�f�g�gLk�lkp�s�y�y<z�{��ۂ�w��Ӄf���)V���N�����O�\bYr;u偽�����Ŗ�ՙ�NO��VJX�X�^�_*`�`b`�ab�b9eA�ff�hwmppLu�vu}�����������Q�RY�T�[]ha�i�m�x˄W�r�����lm��ن�W�gΆ��R�VT�^�b�d<h8h�krs�xkz��҉k��퐣���i�f[�\}iM�N��c {+jj�h
�_orR�Up`�b;mn�n[��D�N9��Si:j��*h\Q�z��ܑ��[V(�"h�1��|Rł�t~N�O�Q�[
R�R�R�]�U*X�Y�[�[�[r^y^�`aca�a�cbe�gSh�h>kSkWl"o�oEo�tu�vw�z�{!|�}6���f�����̊����Q�������e�ӗ(��8N+T�\�]�sLv<w�\�����T�X�OOqS�UhV�WGY	[�[�\^~^�_�c:g�e�eg�h�h_j0^�kl}luHyc[z}�_�����w�̎���<��N}PQ�Y�[/b�b�d:k�r�uGy�����p��cʃ��	TT�UThXjp�'xug͞tS�[�P��NEN�NO�S8T�[_%`Qe=gBlrl�lxptvz�z{}�|f}�e[r�SE\�]�b�bc nZ�1�ݍ��o�yZ��N�N�N�O�O�PGQ�zqQ�QTS!SS�S�U�X�\7_J_/`P`m`cYeKj�l�r�r�w����N�����W�Z��N�Q-\�fmi@\�fui�sPh�|�P�RGW�]&��e#k=k4t�y�yK{�}��̃�_�9�яёT��]N6P�S:S�r�s�w悯�ƙșҙwQa^��UzzvP�[G���2N�j�Q\H\�c�z�lt�a��z�q���|hp~Qhl��RT����͎�fS��Ay�O�PRDQSU-W�s�WQYb_�_u`vaga�a�c:dleofBhnfu=z�|L}�}K~k�J�͆�c�f��������Ώ蛇Rb�d�o��Ah�P kzlTotzP}@�#�g�N9P&PeP|Q8RcR�UWX�Z�^�a�a�brci)j}r�r.sxoxy}w������Ҏc�u�z�U��x�CQ�S�S{^&_n�n�s�sC}7����P�NNP�S|T�V�Yd[�]�^'_8bEe�gVn�r�|������N����7�ǖg���N�N
OHSIT>T/Z�_�_�`�h�jZt�x����w���^Nɛ�N|O�OPPIQlQ�R�R�R�S�STT�UQW�W}YT[][�[�]�]�]x^�^�^�^_R`La�b�b�c;efCf�fmg!h�h�i_l*mim/n�n2u�vlx?z�|}}^}�}������T���*�R�L�a������ʐu�q�?x����M����ؚ;�[R�R�ST�X�b�oj�_���KQ;RJT�V@zw�`�ҞDs	op�u�_�`���r��dk��N�VdW�XZZh`�aff9h�h�m�u:}n�B��NPO�SUo]�]�]�g�lstxP���߈PW�^+c�P�P�Qg�T^X�Y�[i_Mb�c=hskn}pǑ�rx&xmy�e0}܃��	���dR(WPgj���QBW*�:X�i���T]�W�x��\OJR�T>d(fg�g�zV{"}/�\h��9{S�Q7R�[�b�d�d-g�k��і�v֛Lc����vRf	N�P�Sq\�`�dce_h�q�s#u�{�~����یx���e�f�k�N�N:OO:R�S�S�U�V�X�Y�Y�YP[M\^+^�_`c/e\[�e�e�e�gbk{klEsIy�y�|}+}���󁖉^�i�f����nj܌̖��ok�N<O�OPQW[�[HacBf!k�n�l>r�t�u�x:y�3�ꁔ���Pl�_X�+��z���[�N�S�W1Y�Z�[�`no�uꌟ[��{rP�g��a\J�~��Q\hcf��enq>y}��ʎn�dž��P�R:\Sg|p5rL�ȑ+���[1_�`;N�S�[Kb1g�k�r�s.zk���R���Q�SjT�[�c9j�}��V�ShT�[1\�]�Oa�b2m�y�yB}M~�����F�r���t�/�1�K�l�Ɩ���NOOEQAS�_b�gAlncs&~͑���SY�[�m]y.~�|~X�q�QS���O�\%f�w�z����Q�_�eoi�k�m�ndo�v}�]u�����QR@b�f�fn�^�}r�f�������R�SsY�^�_U`�d��PQ�R SGS�S�TFU1UVhY�Y<Z�[\\\\�^�^�^p_b�b�b�cwcff-fvf~g�hj5j�l�m	nXn<q&qgq�uw]xyey�y�z{�|9}��փ��I�]���<�T�s�a�ތ��f�~������
NNNWN�QpR�W4X�X"[8^�`�dagVgDm�rsucz��r��� �1V�W���b
i�k�qT~w�r��ߘU���;\8O�O�OU Z�[�[�_Na/c�eKf�h�ixm�m3u�uw^y�y3}は�����:�����2�ݑ��N�NRuX�X\u=\N�
�ŏc�m�%{ϊ�b��V�S�9T�W%^�c4l�paw�|�p�B�T�����^tĚ]i]pe�g��ۖncIgiŃ������ozd�[N,p]u/f�Q6R�R�Y�_'`b?eteftf�hhcknrru�v�|V��X�������ˊ���R�Y��ez���-^�`b�ef�g�wMzM|>~
���d��_��xR�b�cBd�b-��z�{���v}�I��NHQCS`S�[\\�]&bGb�dh4h�lEmm�g\oNq}q�ez�{�}J~�z��9���n�Ό��x�w���������MR�U8o6qhQ�yU~���|LVQX�\�c�f�fZi�r�u�uyVy�y�| }D}�4�;�a� ��PuR�S�S	P�U�XOY=r�[d\S�`�`\c�c?c�c�d�e�f�]�i�io�q�N�u�v�z�|�}�}a�I�X�l�����ňp��m������P�X�aӁ5�� ��OtPGRsSo`Ic_g,n����O^\ʌ�e�}RS��vQ�cX[k[
\
dQg\��NY*YplQ�>UX�Y�`Sb�g5�Ui@�ę(�SOX�[��\/^�_ `Ka4b�f�l�n΀�Ԃ�����.���۞ۛ�N�S'Y,{��L����n'pSSDU�[Xb�b�b�l�o"t�8��o��8��Q���S�SFOT���jY1��]�z���h7��rH�=j��9NXSVfW�b�c�eNk�m[n�p�w�z�{�}=�ƀˆ��[��V�X>_�e�f�j�k7uNJ$P�w0W_e`zf`l�uzn��E����{\u�zQ{Ą��y�z6��Z@w-N�N�[�_�b<f�g�lk�w�;�N��Йj&p*s�W���NFQ�Q�U�[^3^�^_5_k_�_�ac�fgnoRr:u:wt�9�x�v���܊��󍚒w����RWc�vg�l�sÌ��s�%m�Xi�i�����u�ZXh�c�iCO,o�g��&��}T�?ipojW�X,[,}*r
T㑴��NNO\PuPCR��HT$X�[^�^�^�^_�`�b:c�c�h@l�x�yz�}G���D����-�ؑ��lXd�due�n�v{i�ѓ�n�T�_�dM��D�xQkX)YU\�^�m�~u���[��pO�k�o0u��NQT5XWX�Y`\�_�e\g!n{v߃����M�%x:x�R�^WtY`PZQ�Q�QRUTXXXWY�[�\�]�`�b-dqgCh�h�h�v�mon�mop�qS_�uwyI{T{R{�|q}0Rc�i����F�����v�-�0�ؕ�P�RTX\�a�dm�w�z��S����\�?S�_�_�myrcw�y�{�k�r��haj�Q�z4iJ\����[I�pxVo\�`fe�lZ�A��QT�f
�HY���QMN�Q���XpzcK�bi��~wuWS`iߎ�]l�N<\_�Sь��y��^�esNeQ�Y?\�N�Y�_���o�yby�[q�+s�qt^�_{c�d�q�|CN�^KN�W�V�`�o
}��3����������]�b�d��wg�l>m6t4xFZu�����O�^�b�cWeog�vLr̀��)�M�
P�W�Z�hsidq�r���X�j����y�w)�/OeRZS�b�g�l}v�{�|6�����f or~�������Q�{rx�{��H{�ja^��Qu`ukQb��nzv���Op�bO{���zVYX䆼�4O$RJS�S�S^,d�eg>lNlHr�r�sTuA~,�酩��{Ƒiq��=cifju�v�xC��*SQS&T�Y�^|_�`Ibyb�b�e�k�l�u�v�x�y�}w���������^�ۘj8|�P>\�_�g�k5t	w�;��gz9S�u�f_��񃘀<_�_buF{<�gh�Y�Z}~v,��Oj_j7lo�thyh�U�y��^�c�u�yׂ(�򒜄�-��Tl_�e\mp��ӌ;�Oe�t
N�N�W+YfZ�[�Q^�^`vbwe�enfnm6r&{P�����\����t��D��O�dfk�a�j��\Si��z�W�OoR�_E^
g�yy�����m_Ub�l�Nir��R;TtV�X�anbqnY�|�|}�e^�NuOuQ@Xc^s^
_�g&N=���[�s|��P�XVv�x%R�w��{OP	YGr�{�}��ԏM��O�R)Z_���O��WUcik+u܈�Bz�R�XUa
b�f�k?|�#P�OSFT1XIY�[�\�\)]�^�bgc>e�eg�l�l�p2x+~ހ������*�J���Ғ���l�ON�N�PVRJW�Y=^�_�_?b�fg�g�h�Q!}���������~�2� T,�S�P\S�X�d4ggrfwFz��R�l�kXL^TY,g��Q�vid�xT����W�Y'f�g�k�T�iU^���g���gR�]h�N�O�S�b+g�lď�Om~��Nba�n+o�sT*gE��]�{�\�[�Jnфz��Y�|l w�R"Y!q_r�w'�a�iZZ�Q
T}Tf�v������Y]r�nMQ�h�}�}b���xd!j��Y_[�ks�v�}���2Q(gٞ�vbg�R�$\;b~|��OU�`}��S_N�QY:r6�Α%_�w�Sy_}��3���V��g��S�	aa�lRv�8�/UQO*Q�R�S�[}^�`�a�c	g�ggn�m6s7s1uPyՈ��J�����Ė��Y�NYON��?���P|^�Y�[�^�c�c�d�fJi�im�n�q(u�z��I�Ʉ��!�
�e�}�
�~a�b2k�ltm���m�����eg��<���ma}=�j�qNuSP]k�oͅ-���)RTe\Ng�ht�t�uψ�̑�x��_�s�zN��ceu�RAm�n	tYukx�|���z���Ona�e\��N�N�P!N�Q�[�e�h�msBv�wz�|o�Ҋ|�ϑu���R�}+P�S�g�m�q3t�*���W���`tAX�m/}^��N6O�O�Q�R�]`�s<yӂ4�����
���b��ftkR�R�pˆ�^K`�a#oIq>|�}o��#�,�BTo��j�pŒ�2��RAZ�^_g|i�ijmobr�r�{�~�K�ΐmQ���y��2�֊-P�Tq�jkČ��`�g�N�N�k���h�i~n�xU�_NN*N1N6N<N?NBNVNXN�N�Nk��N�
_�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N	OZO0O[O]OWOGOvO�O�O�O{OiOpO�OoO�O�OQ�O�O�O�O�O�O�O�O�O�OP(PP*P%PPO�O!P)P,P�O�OPPCPGPgUPPPHPZPVPlPxP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P	QQQQQQQ!Q:Q7Q<Q;Q?Q@QRQLQTQbQ�ziQjQnQ�Q�Q�V�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QU��Q�Q�Q�Q�QRRRR'R*R.R3R9RORDRKRLR^RTRjRtRiRsRR}R�R�R�RqR�R�R�����R�R�R�R�R�R�R�R�R�R��R�R�R�R�RSS8u
SSSSS#S/S1S3S8S@SFSESNISMS�Q^SiSnSY{SwS�S�S�S�S�S�S�S�S�S|ٖ�S�f�q�S�S�S�ST=T@T,T-T<T.T6T)TTNT�TuT�T_TqTwTpT�T{T�TvT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUU�T�T�T�T�T9U@UcULU.U\UEUVUWU8U3U]U�U�U�T�U�U{U~U�U�U�U|U�U�U�U�U�U�U�U�U�U�U�UV�UV�U�UV�UNVPV�q4V6V2V8VkVdV/VlVjV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW�VW	WWW
WWWW�UW&W7W8WNW;W@WOWiW�W�WaWW�W�W�W�W�W�W�W�W�W�W�W�W
X�W�WXXXrX!XbXKXpX�kRX=XyX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XY
YYY�h%Y,Y-Y2Y8Y>Y�zUYPYNYZYXYbY`YgYlYiYxY�Y�Y^O�O�Y�Y�Y�Y�Y�Y�Y�Y%ZZZZ	ZZ@ZlZIZ5Z6ZbZjZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[2[�Z*[6[>[C[E[@[Q[U[Z[[[e[i[p[s[u[x[�ez[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\
\\ \"\(\8\9\A\F\N\S\P\O\q[l\n\bNv\y\�\�\�\�Y�\�\�\�\�\�\�\�\�\�\�\�\�\�]�\]]]\]]]]]"]]]]L]R]N]K]l]s]v]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^6^7^D^C^@^N^W^T^_^b^d^G^u^v^z^��^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^_	_]_\____)_-_8_A_H_L_N_/_Q_V_W_Y_a_m_s_w_�_�__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�`�_!`````)``1```+`&``:`Z`A`j`w`_`J`F`M`c`C`d`B`l`k`Y`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�_�`�`�`�`Maaa�`�`a�`�`a!a�`�`
aaGa>a(a'aJa?a<a,a4a=aBaDasawaXaYaZakataoaeaqa_a]aSaua�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�ay�a�a�a�a�a�a�a�a�a�abb	b
bbbbb!b*b.b0b2b3bAbNb^bcb[b`bhb|b�b�b~b�b�b�b�b�b�b�b�b�b�b�b�b�d�b�b�b�b�b�b�b�bc�b�b'ccc�b�bPc>cMcdOc�c�c�c�cvc�c�c�c�c�ckcic�c�c�c�c�c�c�c�c�cd4ddd&d6ded(ddgdodvdNd*e�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	��d�d�b�d�d,e�d�d�d�de�deee$e#e+e4e5e7e6e8eKuHeVeUeMeXe^e]erexe�e�e���e�e�e�e�e�e�e�e�e�e�e�e�e�e�erg
ff�esg5f6f4ffOfDfIfAf^f]fdfgfhf_fbfpf�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f?f�f�f�f�f�fggg&g'g8�.g?g6gAg8g7gFg^g`gYgcgdg�gpg�g|gjg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�jhFh)h@hMh2hNh�h+hYhchwhh�h�h�h�h�h�h�h�j�hth�h�h�hi�h~hi�hi�h"i&i�hi�h�h�h�h6iii�h�h%i�h�h�h(i*ii#i!i�hyiwi\ixikiTi~ini9iti=iYi0iai^i]i�iji�i�i�i�i�i�i�i�i�[�i�i�i�i�i.j�i�i�i�i�i�i�ijj�i
k�i�i�ij�ij�ij�i
jj�j#jjDjjrj6jxjGjbjYjfjHj8j"j�j�j�j�j�j�j�j��j�j�j�j�j�j�j�j�j�j�j�j�jk��jkk1�k8k7k�v9k�GkCkIkPkYkTk[k_kakxkykk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k��llll$l#l^lUlbljl�l�l�l�l�l~lhlsl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmM�6m+m=m8mm5m3mmmcm�mdmZmymYm�m�m�o�m�mn
n�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m-nnn.nnrn_n>n#nkn+nvnMnnCn:nNn$n�nn8n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nAooLp�n�n�n?o�n1o�n2o�n>oo�n�ozoxo�o�ooo[o�omo�o|oXo�o�o�ofo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o	pp�oppp�opptoppp0p>p2pQpcp�p�p�p�p�p�p�p�p�p�p�p�p	q�pqqeqUq�qfqbqLqVqlq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q
rrr(r-r,r0r2r;r<r?r@rFrKrXrtr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rPs
ssss4s/s)s%s>sNsOs؞Wsjshspsxsus{szs�s�s�s�s�s�s�s�s�ttot%t�s2t:tUt?t_tYtAt\titptctjtvt~t�t�t�t�t�t�t�s�t�t�t�t�t�t�t�t�t�tuuuuu
uuuu&u,u<uDuMuJuIu[uFuZuiudugukumuxuvu�u�utu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�u�uv
v	vv'v v!v"v$v4v0v;vGvHvFv\vXvavbvhvivjvgvlvpvrvvvxv|v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v/��vwww)w$ww%w&ww7w8wGwZwhwkw[weww~wyw�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx&y x*yEx�xtx�x|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyy,y+y@y`yWy_yZyUySyzyy�y�y�yK��y�y�y�y�y�y�y�y�y�y�yz
zzz zz�y1z;z>z7zCzWzIzazbziz��pzyz}z�z�z�z�z�z�z�z�z�z�z�z�z���z�z�z�z�z�z�z�z�z�z�z�z�z�z{{
{{3{{{{5{({6{P{z{{M{{L{E{u{e{t{g{p{q{l{n{�{�{�{�{�{�{�{�{�{]{�{�{�{�{�{�{�{�{�{||�{�{`||||�{�{|
|�{#|'|*||7|+|=|L|C|T|O|@|P|X|_|d|V|e|l|u|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|;��|�|�|�|�|}}}}
}E}K}.}2}?}5}F}s}V}N}r}h}n}O}c}�}�}[}�}}}�}�}�}�}�}�}�}�}=~�}�}�}�}�}�}�}�}�}�}�}�}�}~
~#~!~~1~~	~~"~F~f~;~5~9~C~7~2~:~g~]~V~^~Y~Z~y~j~i~|~{~�~�}}~��~�~�~�~�~�~�~�~�~�~�~�~8:ELMNPQUTX_`higx�����������������q�����������ܘ�������!�(�?�;�J�F�R�X�Z�_�b�h�s�r�p�v�y�}�����������������Q��ۀ�ـ݀Āڀր	����)�#�/�K���F�>�S�Q���q�n�e�f�t�������������������_�������������������Ɂ́сف؁ȁځ߁�����������
�
���)�+�8�3�@�Y�X�]�Z�_�d�b�h�j�k�.�q�w�x�~���������������߂҂���������ނ�܂	�ق5�4��2�1�@�9�P�E�/�+���������������#�������|���s�u����������΃���؃��������
�"� ���8����m�*�<�Z���w�k���n���i�F�,�o�y�5�ʄb�������ل̈́��ڄЄ��Ƅք��!������,������@�c�X�H�A��K�U�������������m�����ꅇ���w�~���Ʌ��υ��ЅՅ݅�܅��
��������"��0�?�M�UNT�_�g�q�����������������ĆƆ��Ɇ#���Ԇކ��߆ۆ���������	�
���
�4�?�7�;�%�)��`�_�x�L�N�t�W�h�n�Y�S�c�j����������ˇ����Ї֖��ć��LJƇ������
��������҇���"�!�1�6�9�'�;�D�B�R�Y�^�b�k���~���u�}���r�����������������������ÈĈԈ؈و݈����������
��C��%�*�+�A�D�;�6�8�L��`�^�f�d�m�j�o�t�w�~�������������������������������ډ܉݉��������%�6�A�[�R�F�H�|�m�l�b���������������������Ċ͊Šڊ���������ފۊ������� �3���&�+�>�(�A�L�O�N�I�V�[�Z�k�_�l�o�t�}�����������������:�A�?�H�L�N�P�U�b�l�x�z���������������|���b��������������Ȍ����ڌ��������
���
��N��͌��g�m�q�s���������ύڍ֍̍ۍˍ��ߍ���	�������B�5�0�4�J�G�I�L�P�H�Y�d�`�*�c�U�v�r�|�����������������������������Ǝ����ŎȎˎێ������
����������&�3�;�9�E�B�>�L�I�F�N�W�\�b�c�d�������������ڏ������������!�
����'�6�5�9���O�P�Q�R��I�>�V�X�^�h�o�v���r���}���������������������Hbې���2�0�J�V�X�c�e�i�s�r�������������������������ɑˑБ֑ߑ�ۑ����������,���^�W�E�I�d�H���?�K�P���������Z�ϒ��������D�.��"��#�:�5�;�\�`�|�n�V�����������֓ד��ؓÓݓГȓ�������6�+�5�!�:�A�R�D�[�`�b�^�j�)�p�u�w�}�Z�|�~����������������������������������ʕ�oÕ͕̕Օԕ֕ܕ���!�(�.�/�B�L�O�K�w�\�^�]�_�f�r�l���������������������������Ζ˖ɖ͖M�ܖ
�Ֆ�����������$�*�0�9�=�>�D�F�H�B�I�\�`�d�f�h��Rk�q�y���|���z���������������������×Ɨȗ˗ܗ�O���z������8�$�!�7�=�F�O�K�k�o�p�q�t�s���������ĘØƘ���	����!���$� �,�.�=�>�B�I�E�P�K�Q�R�L�U�������������ߙۙݙؙљ�����������+�7�E�B�@�C�>�U�M�[�W�_�b�e�d�i�k�j���������ϚњӚԚޚߚ��������������"�#�%�'�(�)�*�.�/�2�D�C�O�M�N�Q�X�t���������������������ʛ��ƛϛћқ���ԛ�:������	������
��.��%�$�!�0�G�2�F�>�Z�`�g�v�x����	�����*�&���#��D���A�?�>�F�H�]�^�d�Q�P�Y�r�������o�z���������ĝ��������Ɲϝٝӝ���������u�y�}���������������������������a�̞ΞϞОԞܞޞݞ������������������v�!�,�>�J�R�T�c�_�`�a�f�g�l�j�w�r�v�������/X�iY�dt�Q�q���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� eucjpmsdec8_swedish_nopad_ci[import dec8_swedish_ci][import cp850_general_ci][import hp8_english_ci][import koi8r_general_ci][import latin2_general_ci][import swe7_swedish_ci][import ascii_general_ci][import hebrew_general_ci][import koi8u_general_ci][import greek_general_ci][import cp1250_general_ci][import latin5_turkish_ci][import armscii8_general_ci][import cp866_general_ci][import keybcs2_general_ci][import macce_general_ci][import macroman_general_ci][import cp852_general_ci][import latin7_general_ci][import cp1251_general_ci][import cp1256_general_ci][import cp1257_general_ci][import geostd8_general_ci]	

 !"#$%&'()*+,-./0123456789:;<=>?@ACDHKMNOPRSTVWY[\]_bdfghik������ACDHKMNOPRSTVWY[\]_bdfghik���������������_�`bkl����������_�`bkl���U�B����_����m���U�����B_�T�Tm]AAAATGDDKLKKPPHHXWZYYY�]ddddib_]AAAATGDDKLKKPPHHXWZYYY�]ddddib�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� � � &   ! �0 `9 R�}��    "   �"!a: S�~x������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@AQSW[egikuwy{}������������������AQSW[egikuwy{}������������������������������������������������������������������������������AAAAAAAS[[[[kkkkW��������������AAAAAAAS[[[[kkkkW��������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�   &   ! 0 9     "   : ����������������������������������������������������������������������!	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_@ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�   &   ! 0 9 ���    "   "!: ����������V���������������W�����.���y"6*;`CE�L���rAZj�{}�/��
�z#7+<aDF�M���sB[k�|~�	

 !"#$%&'()*+,-./0123456789:;<=>?@AMOUWacgioqu{}������������������AMOUWacgioqu{}��������������������������������������������������������������A������������AAiAOAAWWOW�Wcqiu�}}���� u������AiAOAAWWOW�Wcqiu�}}����àu������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� ~ � &   ! �0 9 R���    "   "!: S 
 ����������������������������!"#$%&'()*+,-./0123456�789:@ABC�D�EFGH�����IJ��KLMN�OP�Q�R��  	

 !"#$%&'()*+,-./0123456789:;<=>?@AEGJLRUWY]_aceglnprtv{}��������AEGJLRUWY]_aceglnprtv{}�������Ď�T��������j��Υ�����������j���ݶ�����������������������������������������������������������C�D����INOPQ��[\����i����x�yz���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRStUVWXYZ[\_^_`ABCDEFGHIJKLMNOPQRStUVWXYZ{|~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrsTuvwxyz[\]^_`abcdefghijklmnopqrsTuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� 	

 !"#$%&'()*+,-./0123456789:;<=>?@ACEGIKMOQSUWY[]_acegikmoqs������BDFHJLNPRTVXZ\^`bdfhjlnprt����݁�ބ������姝������������羽��𷸙�}����������~�����������uwy{���������������������������vxz|����������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ S &   ! � 0 	9 
R    "   "!Y: Z\[_�^�����������V����Q!T�XUW !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO	

 !"#$%&'()*+,-./0123456789:;<=>?@ACEGIKMOQSUWY[]_acegikmoqs������ACEGIKMOQSUWY[]_acegikmoqs����݁�ރ������姝������������利��𷷙�}����������}�����������uwy{���������������������������uwy{���������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� � � &   ! �0 `9 R�}��    "   �"!a: S�~x������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@AQSW[egikuwy{}������������������BRTX\fhjlvxz|~������������������������������������������������������������������������������CEGIKMOU]_acmoqsY��������������DFHJLNPV^`bdnprtZ���������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� � � &   ! �0 `9 R�}��    "   �"!a: S�~x������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@AQSW[egikuwy{}������������������AQSW[egikuwy{}������������������������������������������������������������������������������CEGIKMOU]_acmoqsY��������������CEGIKMOU]_acmoqsY��������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ACDHKMNOPRSTVWY[\]_bdfghik������ACDHKMNOPRSTVWY[\]_bdfghik���������������`�_blk����������`�_blk���T�A����_����k���T�����A_�T�Tk]AAAATGDFKKKKPPHJWWYYYY�]ddddib_]AAAATGDFKKKKPPHJWWYYYY�]ddddib�	

0234567+89:\;,<=vz|~������>?]^_@A�������������������������BCDEFG������������������������HIJK u!V"Yspq#t$Z%MQP&TUWXr./'�([)NS*1�efg�Lh�i�aj-k�l`}Omno�{�bwxy������������������������c��������������������������d����R	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������� ��� ����V��������� �����W�����.���y"6*;`CE�L���rAZj�{}�/��
�z#7+<aDF�M���sB[k�|~ 	

0234567+89:\;,<=vz|~������>?]^_@A�������������������������BCDEFG�������������������������HIJK u!V"Yspq#t$Z%MQP&TUWXr./'�([)NS*1�efg�Lh-i�aj-k�l`}Omno�{�bwxy������������������������c��������������������������d����R	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������           H  	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����o�B�PQ�y��9:��=>Z[��deA�
����}~�z_���%�%�%%$%��^c%Q%W%]%{|%%4%,%%%<%Z%T%i%f%`%P%l%��G��%%�%�%bn�%���CDH`aT�Up��c������������qXY�%�	

 !"#$%&'()*+,-./0123456789:;<=>?@AGHLOTUVWZ[\^_bghilqtuvwx{������AGHLOTUVWZ[\^_bghilqtuvwx{�����HtOAAtHH\ObbW{AHO\\bb\\llbtqq\�HAWbtAA{{OO�{Hl�������AAOl����{{�������AA��������LLLOL`WWO����qt�bpb```llititxxq���������tii��	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����ޏ��ӊ�׍�����♕�������������餤�������������������������������������������������׷����������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������������������������������ظ�������������������������ԉ�塌������ߢ�������������������������         (((((                  H����������������������H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������  ����" ����"!��`"��"�d"e"��"""�+"��������"�H""��& ����RS      ��%�xD � 9 : ��! �  0 �����������������1����������	

 !"#$%&'()*+,-./0123456789:;<=>?@AIPRSWY`aghipqry����������������AIPRSWY`aghipqry���������������AAPSqr�AAAAAAPSSSSaaaaqrrrrr������������������Hr��������������Hr����W������AAr���������ٓ������������ASASSaaaarr�r���a����������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������́���������������󆠡�������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������ʈ������������������������䉐���������𘜞������������         (((((                  H����������������������   	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������
�yz�������  ���" ����"!�`"#./*d"e"+6""B;<=>9:EFC�"DG"��& �HP�QL      ��%MTUX9 : YVW`  aZ[�de�}~j��kn�opqrs��7{A|"�	

 !"#$%&'()*+,-./0123456789:;<=>?@AFGJLRSUVZ[]bbgopquy������������AFGJLRSUVZ[]bbgopquy�����������AAALAg�AAGAGGGL��JVJLLLgLggg�LL���L����u���L��SVVV��V[��]]]]]]]bbb��bb�����bgggg��������gqqq��qqqu��uuuAyyV���gg����������[�]�S�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRStUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRStUVWXYZ{|}~�������焉��������ꑔ�����򝝆��������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrsTuvwxyz[\]^_`abcdefghijklmnopqrsTuvwxyz{|}~����������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���d
9�>:���~}���o����`=�Xe����HGn�aYUT�����%�%�%%$%a%b%V%U%c%Q%W%]%\%[%%%4%,%%%<%^%_%Z%T%i%f%`%P%l%g%h%d%e%Y%X%R%S%k%j%%%�%�%�%�%�%������������"��)"a"�e"d" #!#�H"�"�" ��%�	

 !"#$%&'()*+,-./0123456789:;<=>?@ADEGIPQRSTUVWXZ^_`cfhlmnor������ADEGIPQRSTUVWXZ^_`cfhlmnor�����EhIGAGfEIIVSVVAAIrrZZZhhoZhcVo`fASZhXXhZc```���������������������������������������������������܀e����݊����ޅ���������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWhYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H��������������������������H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?�%�%�%%$%a%b%V%U%c%Q%W%]%\%[%%%4%,%%%<%^%_%Z%T%i%f%`%P%l%g%h%d%e%Y%X%R%S%k%j%%%�%�%�%�%�%@ABCDEFGHIJKLMNOQTW^�"�" ��%�	

 !"#$%&'()*+,-./0123456789:;<=>?@ACEGIKMOQSUWY[]_acegikmoqs������ACEGIKMOQTUWY[]_acegikmoqs�����uwy{}��������������������������uwy{}���������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������ߐ����������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������A'��)(�� .],-_& \[^1a2b3c4d5e6f7g8h9i:j;k<l=m>n?o@pAqBrCsDtEuFvGwHxIyJzK{L|M}N~OP�Q�R�S�T�U�V� '	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������0^�����������������������������1_�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCEFGHJKMNOPQRTUVWYZ\]^_`abcdefABCEFGHJLMNOPQRTUVWYZ\]^_`���������������������������������������������������������������������AAAAAAADFFFFLLLLIQRRRRS�RZZZ[LXWAAAAAAADFFFFLLLLIQRRRRS�RZZZ[KX_	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGH�JKLMNOPQRSTUVWXYZ{|}~���������������������������������������������������������������������������������������������������������������������������I�	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefgh�jklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������������������������������������������������i�������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ACDFGJKLMPQRSTUVWXY[\_`aN�bcdefgACDFGJKLMPQRSTUVWXY[\_`aN�hijk�����������������������������������������������������������������BO����H�E��I����Z�������^��]�����O����H�E��I����Z�������^��]����	

 !"#$%&'()*+,-./0123456789:;<=>?@ACDHKMNOPRSTVWY[\]_bdfghik������ACDHKMNOPRSTVWY[\]_bdfghik��������������������������������������A�T�T_�a_bk��k�A�T�T_��a_bk��k]AAAATGDFKKKKPPHJWWYYYY�]ddddib_]AAAATGDFKKKKPPHJWWYYYY�]ddddib�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�   &   ! 0 `9 Zd}y    "   "!a: [e~z���A�����^����{���B�����_�=�>|T���9�����CG��P��Xn�p��b�U���:�
����DH��Q��Yo�q��c�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCFIJKLMNOPRSUVWXY[\]^_`acdefghABCFIJKLMNOPRSUVWXY[\]^_`a{|}~����������Z�Z[bb����������Z�Z[bb ��P�A�Y��Y����b���P�����AY�P�PbXAAAAPECDIIIIMMFGSSUUUU�X\\\\`[YXAAAAPECDIIIIMMFGSSUUUU�X\\\\`[�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������       H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������� ������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������ɻϽ��������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������������ܷ��߻��������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~������������������������������������Ʉ�ˈ̇���Ѝ�Ҍ����Ոև���ڍ����������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~%%%%%%%$%,%4%<%�%�%�%�%�%�%�%�% #�%" "H"d"e"�!#����P%Q%R%QTT%VWW%X%Y%Z%[%�]%^%_%`%a%c%f%g%h%i%j%�l%�N01F45D3E89:;<=>?O@ABC62LK7HMIGJ.&$%/ !"#,+(-)'*	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������Lj�Ȍ�����̈́����҈�ӌ�����؄�ڣ���������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~                                   �� ��     �     �� ��     �  ����������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_ abcdefghijklmnopqrstuvwxyz{|}~                                   �� ��     �     �� ��     �  ���������������������������������������������������������������         (((((                  H���������������������� 	

 !"#$%&'()*+,-./0123456789:;<=>?@AGHLNSTUVZ[\`adijknruz{|}������AGHLNSTUVZ[\`adijknruz{|}����xN	
ggVVANggdxuxgx�AVdu^o�g�pqs�����B�]�Ao��pqs����lADEF_IKJNQRPVWM�bcdfgg�mwuxx~t�dADEF_IKJNQxPVXM�bcdfgg�mwuxx~t�	./012

,345678'9:;]<(=>vz|~������?@^_`AB������������������������CDEFGH������������������������IJKLWZtqru [!NRQ"UVXYs*+#�$\%OT&-�fgh�Mi�j�bk)l�ma}Pnop�{�cwxy�����􊢠��ߞ����������d�����ڍ�������������������e�����S	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~����������������������������������������������> ��������������� ���������������������������  	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~���������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H  	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� � � &   ! �0 `9 R�}��    "   �"!a: S�~x������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������AAAA[][CEEEEIIIIDNOOOO\�\UUUYY��AAAA[][CEEEEIIIIDNOOOO\�\UUUYY�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ|}~��ABCDEFGHIJKLMNOPQRSTUVWXYZ���������������������������������������������a���������������a�������[\]^_`bcdefghijklmnopqrstuvwxyz{[\]^_`bcdefghijklmnopqrstuvwxyz{	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� 	

 !"#$%&'()*+,-./0123456789:;<=>?�ABCDEFGHIJKLMNOPQRSTUVWXYZ����_�abcdefghijklmnopqrstuvwxyz����	

 !"#$%&'()*+,-./0123456789:;<=>?EABCDEFGHIJKLMNOPQRSTUVWXYZ\][Y_EABCDEFGHIJKLMNOPQRSTUVWXYZ\][Y�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?`abcdefghijklmnopqrstuvwxyz{|}~_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� 	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~����������������������������������A�=Z��`^dy�}{��B�>[��a_ez�~|T���9�����CG��P��Xn�p��b�U���:�
����DH��Q��Yo�q��c�	

 !"#$%&'()*+,-./0123456789:;<=>?@ADEHIKLMNOPQSTVXYZ[^_`abcdhijklmADEHIKLMNOPQSTVXYZ[^_`abcdnopq����������������������������������B�R�Q\��][^e�gf�B�R�Q\��][^e�gfZCCCCQFEGIJIINNH�UTWVVV�Z____c^�ZCCCCQFEGIJIINNH�UTWVVV�Z____c^�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H����������������������H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~%%%%%%%$%,%4%<%�%�%�%�%�%�%�%�% #�%""H"d"e"�!#����P%Q%R%QS%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%�N01F45D3E89:;<=>?O@ABC62LK7HMIGJ.&$%/ !"#,+(-)'*	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������壤�������������岳������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~��������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� 	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������ �����������������������������������������������������������`a�x������� ������%��	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\][^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~������������������������������������������������������������������߮�����إ��Ц����������ܧ�������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������������ݨ�����ï�����������������������������������������������������������������������������         (((((                  H����������������������                                         	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� � � &   ! �0 `9 R�}��    "   �"!a: S�~x������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������AAAAAAACEEEEIIII�NOOOOO�OUUUUY�SAAAAAAACEEEEIIII�NOOOOO�OUUUUY�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������������������������%�%�%%$%����c%Q%W%]%��%%4%,%%%<%��Z%T%i%f%`%P%l%������1���%%�%�%���%������������������ ������������%�	

 !"#$%&'()*+,-./0123456789:;<=>?@AQSUYcegitvxz|������������������AQSUYcegitvxz|�����������������T�]GKCMT_a[qokKM]OO���������㌽�Em��~~����������EGC��������������II��������WW_a[smoq�����kل�����������������翼������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~���A�A��EEEIII�����O�OUUY�������AIOU�����������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~����������������������������������������������������������������������������������������������������������������������������� 000000  (((((000000000000 00000H����������������������0 	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������R�����x�����������������������S������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������AAAA\[\CEEEEIIIIDNOOOO]��UUUYY��AAAA\[\CEEEEIIIIDNOOOO]��UUUYY�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� H!#"###g!%#&#'#(#)#*#+#,#-#.#/#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#+!i!j!~#$#qD/p&<0pyC8E;Q1p2p3p4p5p<QlQ7p6p'TRM8p:p9p;p<pk8=ph:>p?pi>@pl6ApBpCpDp5HEpFpGptEHpIpJp=wKpLpMpNpOpW:PpQpRpSpTpUpVpXp%SWpYp:u9Bdwewfwgwhw4BjwkwsBptotiBawbwF;dYrJh@$pZ:-G,Dlwmwnwpwowqwtwswrwuwvwimjmkm<v=v>v&6>XD9;X1\sJwwxwyw{wzwG1|w}w~wkF4l]33v4vdA5v6v7v8v9v:v#H;vzA(9hmj9_YcSOv3BPvQvRvSvTvVv+1WvXvYvZv[v\v]v^vJO_v`vavbvcvdvp@evfvgvhvivjvkvlvmvnvovpvqvrvsvtv(>uvvvwvxvzHyvzv{v|v}v~v!w"w#w$w%w&w'w(wn1)w*w+w,w-w[A.w/w;R!6_FrMIU}HOIBO"X;2kS$Xs3(WRG'X@JpG{15RT4+6?K)X*6=AOQ%I-Xv8>Q\cPVa7.4YA<XhM$5*NwVv@Y>/XKDC>1X4CeR.VZN'Uu:&7V@9FREGGT9K3RR?XE>rF2R0OgOiJ@XrBRBiH,GKAhSyUBJ~6!XZSw?FT%;AXeN.>(XGQ)P=XoYvM:?;=%:`Rz2`:6DmO)>$MAAWGqYtYKHiXZR2JJHlXjXFXv=MFp3kXq=i=THS4XBV2PWKJ{KLU68IOZYpX*GnXz4nATRmXGRoXGCvQYVrXuX~<[<NH]7B7sFxXARiN?<|7%7]PZVESo;a;qX!I0N+4sXKIvXWBwX1NyX.2@9#Yi0fAlIEKFK$Yh5+5;NM5!WtWSSeLN:"Y\Y`S}Xp7wW~XzX!YcD6StX]Y{XeEP@pQ[0Q<&Y%Y,Y.Y+Y9J)Y6V^3(Y}@LJ*Y'Y0Y16)9@R@OBBD=lU`2HGk?-Y/YjNn:VGc1Y4m64Y!?^YNG~@8YWK}75Y7Y#1aS9YEP6Y1Y2Y)A3Ys<^P)8c>=Y:Y30BYDY61?Y95s>HLr:PRCYh=+3EYk>FY;Y_D>YAY@Y.U5VcGHYY<JY<YKY+FIYvW#M!=LY<E5MMYGY%3~?58|@x0v4NYOY"4PY_4A0QY5IqORYEAVY.IUYTYWY[K)='FSYXYYYeH\@y6#XJT*TVPd3WUHOb9K?bCR6CMnYpY3556$>kH+HK0+9yAbY<@29X9KPx1dF_>d5HWxQf<^J=<fYgXZDT8=Ha2YT0CaC"Z_H4P|>)EZ9#Z)T$Z{Y,6k7y1|Ye3v>v?1Rd@36~Y}Y;>`F<W!Z9Ar5hAu<U4]A}D8<27o7lY>F-?K;J5I[WP9M<0v3w;J[/:dT65s5VXPHV7PGWX/?;[XXLP.;>kPAuArTU844u3>IPEYE{@p1YXN9=5ZXFV"K/H2IL4L?t9[X\Xg6A<jLwO]X0GP9#=^LJF`X^X_X~0g>#Jt<18n8bXK=dXcX|EeXfX&A0Hl0&9S<qN=[SA/6zV,EY=>[?[x@">M@@[FJ*2BScC+QB[U@C[1?<DZGD[hYWI49pNHT|0R4YPiYK^kY0X/;11W3NXQT3=o?;OPXK7QX%FxG=RRXdD.J'G&X}IgN\;k0*;-P01dW?W%5tBOD)272e12_<U(?,BUX1BTXTN`Z@N4X.C!S#N4<4HQBm>6PaZdG'3r6|Lz@w@9QaQGX^2e@q:HX-TaOIXJXCOx3G>KXL[%HXO~HN2VSf20<QS+K47"7eJ!H\Jd1pPQEE[~5Z?E9d>mA6_5_;VP=YUH0#6I?(L3_7JRSOX6RE:>K>L7_p54_uST3w8:_O:*<u5,M{Cs:t@BMrO8_EO@B9_pB}>_ALMwRM7A_D_q7I0V6T7,:}LT?1KtF(VE_bN33|N54GNp:aN=Q@_t4J3f8;_ED<_=_>_;E?_B_1TC_:GXNXDJ_O_\VI_Z_6NG:N_H_^EkIt:|CW>F_M_XE&UM:L>=S@8dVG_>9'?|AK_L_P_[_e_W_V_IWc_d_ke'RR_)?[TH?T_LO]_JQ^_'07FS_e:_6[M~9UT__lO%0g_Q_FQU_X_Y_\_);`_a_b_f_h_4Sg86Ej_ZI(ADD^?xO\Un_82_:l_A[dQtK=4&0q_FLr_m_i_k_o_p_=;s_t_#;[J(N'`*3&`!`~_YM|_z_P?DWLIx_!0}_{_"`(`H7!F6I2@u_>EDXy_vD#`$`%`%P4`dL1`&?/`9N+`FI.@.`m:0:)`v_3`8`-49`2OH:0`zP,`{Tw_gE-`wS6`7`D`aP<`I`J`>`*`$IA`2`HJC`5`KNCKM`F`B`K`:`?`@`E`G`H`L`;`TKU`V`R`P`N<Q`B8EXjPoBO`=`T`S`W`\`X`vV03lW;KZ`{NY:a`]`-Rb`[`Y`_```^`d`wF,XkTf`IJe`A8g`h`i`c`?:gLj`yOk`BH@=RDl`m`tGDKn`X;6XrRo`EMZ6q`0T'@Q4'Np`r`L9z9<Ms`TFt`2T&Hv`u`w`AM%JZTW[Y[X[g9\[][X5Z[[[!3_[x;7V`[y>;7P[.L2?5;xWS?i?a<3L^[S0kNX79WBF$@9Lg[a[:Fc[h[wEj[i[@?f[e[94,@"Bb[d[MPm[]@r[b6s[R[89+Tl[Q?p[Q[f5k[e?n[q[y[!9#0qBG3o[x[RFt[u[w[v[~[rS:2}[$\{[z[|[`Ey;#\%\CLQ6@]!\"\5Gi6'\&\)\$1L50?_QB6(\zKsk\K~KAL{H*\nL+\S[/\,\3>{J-\JI9D=G.\vTfP+DU6T[Z1U[V[>:@H?JIH3WyIG?x:<R:b&48148DOgY&ObMmY`69R;99b7bs4lL+Lr72XkQ;:'J7MDRd?P<a6E^F^<[YQfFNDn7\7|?`WuF<1H^1=WLJ^I^l5]IB0.E+ELDi<}KC:yegHze}M1W>8hBQH{eJ6K<}Q!fnC$f~e%fWMA7|e}e#f]D(f'fCC^F*f7D"f<Jc=C9&fUP/N)f0f&R*=-f/fQ@LR'<1fvRKW~M^M&B+f,f?=.f3f2f6f8foDHDj>oI7fp6dCiS4f5f"H=f9fEFqM;f<fi;>f:f7@$S?ftICfDfvP=CDCBfAfGf1OtkJfEf^<)I5<SOHfIfNfPfQfKfU5LfOf[DFfMfRfTfSfUfxYVfWfSW]f^fW?PTVWf4oKZfCXNW"POC_f><B9[f'Q":OB+XkJne\fu7fHuD2e~D|K3e,UnSXJ20NKjMj:5e4eZWY9fV(6pMKR&15Jh3sIM?{PRJ6eB;\O,9WT&:gQ|OR<7e]Hm?v1^KE<D<zR\C\?;8BC.:"T^G/Dl2Q9;eHA/U<e>eg4T6BK0Q<5YJb7dI+=>NpW!PYI{6Xfb<>3PIYf"3L^HSM^"RN^M>O^,J|R_3jeaD!>2NrDV>(Fc2S>|GkLl=]N:JAFle<P9UmetJ@MEBoeDBpexeMM=IYR(alSjKqF,a'a)a*a/am2+aZ8-a.a0a:51a3a8aRQ6a5akA7a@T2a:a604ay?9a;a>a<aEV?O=a?aMBk6xSMGe7~>@aAaGag3iF^4BQHaFaEaCaBa@18UDaKaLaJazoSaRa6GIaNaPaTaQaMaOaUaVaWaXaZa[a!N]g(4]V2Q23$9sWIG^>.9WNn2O[:<QRHKM0oOcYm=R1PJ<2'K+7&J#Ox`JU{`z`AE{L1Ay`cV/2DV[5x4!V/Oo0|`!a#3}`~`1C]C"ay7O;#a;D$a%a&a14I8=FjD"2RP[gC;WSDSc9Ob/WlGS124QbrP.BPbb?&SW5Rbj5mC}8.8SEO7TbSbH6yW%MXbVb|J5?9SUbWb.AH@[bZb*@NA\b]b^bH[SQ"M(=C^%X*?M[lRzF*ED^W1._=J1_-9}R%8k:Z3\5EUVCRO!;seretedMuH/5?Gve0lfei915<BhegeieMRjaNP.MeQJ2k1r1mECU0S\a]a[R93K1yMwU^a6>}4_a\:`a2;IBaalP=MbaC5GEcadaySea-Qfa"NgaB5haU;DP`bX1dRabI<LHcb~l}l/_bb>V|M&CCcRVgbhbGSlbl?mbeb@3nDnbCPv:ib^73;,LKKdbfbjbkbwbtbuTsb-EzUBE@2obrb/A<K!5yb1<qbTP9TubV9vbSGpb\W!mxb%m~bQJ5AP;V?c:!K&m#m"mV;'mtP$m^:w6!c26qL'9"O!GR?q6zb{b}b|bUD"cAS'cDG$O)c7:(cZ;#c$c*c&crNFS<;CTzD(m|P%cuC-c/12cB<,c?5iG0c*>oMs;hL/c1c'O.c)N];k5e>R2M391+cQ2,5_9h6kO7cL;GHJP8cn3)mzSdS*m9cbR5c^SP83c6c_74c"@:c8TH4;cE;wIeI=D+m}B[;.??N<c6?o1wT>c-m?c):,m=c@c6:.68PC0.m/mA@Ac3EBc2\0mj8lN'jgPyJVH7OI3RNd=^cr;(j=U]F)j*j,j+j.j-jX=/j>BA4w4';flel?7yKb1glHIhlilVJP^E2zTKFG0r4SHPM8?[?$G4V)@Q^(IoQ$Eg063EHb0v7zEs6RUP3<<-3q>Q0VRcJ%W6M669?[U'8WER^Y?UB@G$;(1jE{E'L'1V5(DS^:Qi3rCw7tV#5p24DiD-@T^h0DE`AU9\>XMN0OMV^P>>WU^PU]0bD#Bp<5S9@!E&2qT(@CJW^|U09-H)KY^=?4F'W0JCDV3R98V|j40f?tLZM?VNBNN"L.PSD25X^uU7<S;$02El4qU}jZ^&MlMfN\^1M&@=W[^F04:SIsDh>62L@pKq<;;75uEf^c^]>_^74]=`^mDFO`5^6ZJt5e^FUa^ML~FEE4Rr>SB=L83S=X?FMZQk4d^]^g^~j0Bb^@V'5t2h^r^m^q^`HaWo^hCaLe2>Rn^k^UN'4+?>>R=i^.T^^j^?@l^s2i8'BA=u^x^+2$4j4&Iv^QKc8w^z^y^BLa0n4:e/Pk2!kt^cIs^Z0!Rw1/Lp^$K*U{^]4&D}^~C!D!_LA|^o>2FE3vH:K~^$_2W73CAKG%2i4+WlD"_#_%_3:&_^@CIY2fG'_\G(_"kSK*_)_A2JE+_\TAH,_p>-_'V7j6kUJ|XD8%9E7~UJ9'PMtP5tCH>7k=0L=2AV1(3R8"IX68k4>}JCG{Us7DN+Us13l_05l76OAzu1PeUSNo=b3+86U=mO69KBP=76l)JTE9l8lCB7l}P:l;leW<l=llF^NH<UH)5I><VgT.QqP8j9j:j5:1Ju?zM@j:0>j%@;j}2wCh;WRtN?j<jCjGP3S:4ACrWQUGJEjDjGjFjgVTOKjN;z=NILj9I~OJjNTMjOjmMIjNjnN^;?3UF0>zNgG'>PjGV@A]TQj>ORjnJ/E50TjSj_t:D)1_eUjoJVjWjXFXjYj;TzG7R|8Bj\2|BxTfLnWBTPSCksE~7Tk7K^kJ@{M/3ZF|k>D4N)D>1}TuJlVSFd6z;`P1IST(HK8>h<I;hn@SPD2e4<hHUE6=hxJ\8uL4@nQ?hBh<:-1\==jChFhKhLhIKe0+<99AhwMJhvNmUVADh6C{9&VHh`JfT@hEhGh9Gc7Ih]?RhWhUh\<O<[h^hZhz1X03DL8bF>HaHOhThVhq9XhuW{D\hi2Qhm<B?MhyVxAq2_hAJYh$Uj1;UNhPh06Sh]h8@wJ(K\Fu@ih#PrhjV`hahyQK:y8q8TTohnhlhp9RLfh&Nr?80qhph@Wdh)M#I8;[=jhbhcheh55ghEGkhmh0=.Wxhuh0Mvh:Ahh7Cp0thwh#9RINC`Nf@sK]L5PaJshl<yh^CeFw9t0XW,<oEDL&i-I"ib@C?~hW9{h$iNR#i2V5W'i7=|h}h!iVM,R2i)i*4;4+i(P%i~3,ic@*i9i8i.izh(i,?1i:i%B/iE8-i\S4i5i7iGiF@Ei0i;iq0<i%U>i?iAiqA6H=iBiCi3i6i1;@iw<DiFiJiNi[2Hi.7KiLiAU#DXia:Ii#STiWiPiOiAGRiYiH3SipOMiw3ViZi4L-OUi\i[i^iQi]i_iJC7GN46;@P#l7E{S$l%l[Fn?&l'l*P8Gh8(l9V}UK4=2dNgFaMu4@K_<bicijQeiy4di3QbJP2hifigi3Viijikili/l9EN6sRn5Y;1lcRcN8D?C>69XH1O1Q1~EP1+C1U$kA::L%k'k(k&k)k+k*k,kOJ5XqC%CxF-kJD.k/k0kU7z71kbG3k$:uQ102k4k*5HBhG5k.K_c@S[Y!M-VsG`Yc;::bc+O`cGI9:4QacjH/9-=X3[N@LhcictM-L3<jckcZP{FZ7_GJRVNdclcrIA3gccFec3mfc3IfE59;Ccc=E$AYBW2mc&;-DpcZ>{cucS:P7MSNVSUA94UXQ9PvG*H42ZCnc|coc(7wctc:7"Evc]E(2|F`D"Wa@yczc}c)Lsc>SC14mqcrcxc:PCFsT~c`='d&dsQ#d)dwH4O(d.deB46r="di:*d,d}6^V2d-d!dn;]M"GIEwA$d3G,===%dGWb2+dC</dk;0d(E1dcU#?:d7d;d=dVFF:K@!84d!T#:~=<d?MyD{OfI?SQO3d8d9diLNLT@5d0A6dPNA;S5sH'=GU,I"8JdLdDQ:R-:T:Cdm5MW@d}O?d\AJLgJWDTLHdGdAdDd-5YSFdyRc44;nI>4l;MQmL5meG(TKdUWBd%=EdfSIdxI>deS~GI6|T32WdBNMd<N[8VdJ?NSlCHEXdDMOdTdUd~:fO?URdPdNdeM*J#@&=SdH8gd4T[doAidgR_d`d*O]KZdQded\HcdgDbdad|3hda5LWfd,;RWOLxkddv9MVYd\dzB^dKBD@PBu12LN5od/FaFud)Bl@]Qnd.Dmdvdtd~B]dpd~JDUqdzQkdldrd+NKE1G:BjdJA6L13{dsdzd}d|dN3:3wdydxdlE=@hT"eD0$e#e$<%e!e~dt1(e)e&e'e*eYF+e-e,e/e.e`90e1ep;alpCF5R;iAnTD>FWVTS2>lAj/B64WQ432H;?@lKV?lAlElf>?LZE<>Fl~1Dl(Uc5Bl6Ac3Cl8KC@~LRAHlf:S@rVLQ>?37UIGlb;LL}=HH)OiMkEi7IQ8:IlJl@;Klbl:1Y79=LlfQMl;HQlSlM;e<Ol7I:CclUUPlsVRlNlTlUl?I(O\P,Q[HVluNlJZlYl>0WlXldl<HGA\l`Q[loT]lF[^l,1_l`l&W@E<k.0t>88/RV0y53X,K]c,Ff0FE9k:k;k@Q#Erj2D5DN@sjADoNpjtj|I#GXL~Nujvj,Og@wj?6xjyjzj{jqj.Hka87lama4WnaoaLSqaq?paR571sara|:ta79Q>|D]:F=uawa@6AO(JvaxU|Sxa|ayazaj@~a!bG@{a}a%bTA#b(b~2"bMCB2'b&b$b)b+bIPmV(C,bWO.bo:`i-b*b+;3T0b/bai1b2b3b!L4b5b~PJBqSuM`gagA>jBdgcgfM5Cbg7;VOaAighgtg#2jgfglgkg:IdUeg)7ggngsgiVmgrgqg`0ugrGE@m@pApgvgvK"h!hAWzgyg{gwg~g}g|gUAYG}ECEmG#h&h%h'hw:xg$hpH*I)he9~Q(h*h-h.h'A/h0h,h4h+h1h5h2h3h7h6hO9,p-p0Fj0?H_MMN1j2j?FI43jgUy]4j5j6jJ80_uIpLzI{ICS&K&8.pB18eoLISW<jIg5PDi5.n-;^g/n)32n1ng=0n7NOEtAN[3nsPTBhF,74nk3{;5n\g6n.=bqhJIRZp[p\pFAm8N>^p1E]pqQ`pL0j=_R_p/4h7fpep#FapbpC4cpnU[LR>2<hpgpdp!2"V8S7>,HjpwQLV[:ip;64M&F!Akpnpmppplp>;op5LrpU3T1sptpvpa4qpwpzpxpup}pyp|p~p!qAN$q#qvA{p]Jq4q11L&q'q,qNU)q3H"q+q(q%q*q)0-q/q1q0q.q"Q2q3qo9G5W0Y0mTD5T=J;'p^8(p(0)pnM*p+p$FeVdqeqsC[SQVhE/SfRAn;05UNQ`<P:x?G8A5LE"JKCBn?D"6lm$C1V`OomNE\6!Jmmpmqm<C4?nmtmrmfU_Csmvm#U#QumPCwmt?l>xmwL[QEWvU|m{mymzm}m&>/K!n=6"n@D~m^=G2C6%n:X#n&niCr3'n$n9O(nwB)n*n+^3FFGuVI52K+n+M,n0U-nDvG[#4,Cfq8JSR*VroX>C=soL6+0/J6m7myN/7s?8mkB0I9mvF3?<mxEPQ)W:m;mbQ?m@mDmHmFmNmhUImGm>miEFFiIRTAmBmCmEmy@!4h9PmQmJmOmxN6KLmMmuORmrA2SKm7Ho<pEVmo55B-0iK.1TmkMb5UmSmWmz5XmYm\mL1vEn<Zm<Lj2[mkDE4u0_mZ@h4ME]mD?^m%D`mamcmWAG;8=bmdmfmemgm>Jjlq@gIklnFllmFmlplfWslqlnlol#WqInKtlrliOvl1F@<ul;5v;wlwY{=;Bxlyl#8zl{l|lmS.Xk@]GL:cP=K:MQ8|1oGVVF?kCuoXCbWwoS3XGmQHVxovo};F3U=FR`;!O|o{oyoL3TI0K~o^0IV}om3UvHN"p!p>5Z<|;e8BD#pkK&p(Q?>nG6q7qU?)48q;MTG-U9q:qOG$ROV;qQ=04=>\4QN_?=qz?<q?q>q@qAq~A"AzJ>U:>9>BU"?/M5q_=K6qVCsDsM8FsGsJ0EsIsqKKs&PJ1HsOsQ5WsRsTsSs{7?1NsJsZ5PsQsUsMsc<}AVsZsLsH5n=\s$7p?~V2Mp4_2XsYs8I]s^sas_scsbs[sj?o3`s)Gr<ks?9ds-2~;cKmsis\9nsesfsjsaBlsoshs}<dOpsgsrs-W*Fssqs(B]8usts[4vswsxs:@i@qE{szsX4~sys|s}s!t#tI;"t$t>2&t%t.<WCaY`@LtQW[7Nt#AIFV43UPtOtQtZKRtAT`V`78A;ASt,>b4TtUt+>Vt[tWtZt}:XtYtb8GL\tZ2SCcT7?]t4Eit5OINXKwKt=OW[@uPjtktltcw17mtkWntyf@>zfl:{fKO|f<T6<}f~fM<RH3N!g?4"g4IY8ID]WZBW7=VFND7&E#g_O$g%g&g7AiWpI8O/VUV'gm0(g)g\IoR->*gs0^Ha=+gFH,gf;x8$Q-ggBx>J=3M.g/gn>ePgKPLL<0g(<wP1gxP2g3gB44g5g~I,N`C7gA1q38g9g[W@U:gLB:W;g<g=gj<eCB@>g?g)<@gAg6gP6BgCgDg:;^5FB`1Eg5TFg?8HgGgl7Igx2JgKgLgMgNgOgPg'SuKQgRgSgTgIIUgVgWgXgYgI=Zg>sW81H?s@sAs^9xMhX1:^B7n#79n8nU0;nVUoWCV=npJ<n>n@n?nrQ<G@Ca8gAFt_PGt[O:HHtItJtKtzY~8qepS`tLNa34qnRathObtLGT5d4dtctetftgt2:?0ht-7mR+RO@<?#k_UHjsqx6#KMDgqhq{8iqD:ETR0jqkqlqmqnqoqqqpqUErqz6tq.RG^JK\3"5"9tDuqvqDA{A0Vwqxq*A8F[>yqO4zq2m1m`K^RAKXUbH_@!<Ak$PbVG6X8@kN8?k&3I9+Vt7J7g<>7FkGk90O?Ek}SHkIkN7BkDkvIWVMU2POk8NPk(531Rk%LVESkQk_ENk$JUk{0z:7XcqJkKkLkMkVk@fYkh?HRWk\kl8Xk:=XP70]k\D,V`4vB9<Zk[k`TjFTD_k'EuY12dkE=bkck,8QMekak3A"FsLfk0@8Rgk/8-8hk;GsMjkkkmkHPrknkqkyH|Qlkik98YOeDokpkZLHMr0vkuk22`8wkl1EL$D%Oyk"lrEzkEI_b~kNM!l[17S\R}k{k<30jTW+tt3AVBViUJ>'t(R(t)t*tK>_S`IaIBsfJrL6b4KhN[V-t.t/t2t=:3tc00t1t"=U26t7tf602OO4t,45t8t9t'M:t;t<tRK=t>t?t^t<Ah<+I^Que3\UR4\,05\Z=9\BX7\sSVI:\6\;\"C<\E\=\_N%VO\M\R\f=+B8\K\N\>\R7E0G\>PA\(;<7L\F\?\[G?Q@\J\P\-NB\C\H\I\T2Q\UK7T[\_\&Lf\gC\\A?Y\z069e\S\D\V\tH`?;I=1"SZ\U\;F^\BW/C67QG)Cb\X\k\T\]\%>W\`\c\d\x\a\"]g\k<D4#Cg2z\r\o\|\n\pRh2WHcH{\m\w\u\#>t\]2s\v<h\D;s@T<i\j\q\v\y\45YHg;~\}\+S!]#]%]qR$]&]'])RI:)]6]1]4]0]NFr@/Il\.]7]p\/]8],]9]3]-]*D(]3@+A*]+]2]q;5](S:];]'CR]<]Q]=9U>z>J:J]E]?]K2C]K]$2U]>]PFP]T]bAF7N]O]D]=]M]QLI]B]HC<F.NL]H]A]F]\B)S*SS]tOxHf]G]`]dBa]W]xVY]X]p8V]OF-6b]y:aTg]P4Z]{?c]_]]]Y5[]\]^]/=d]e]u]ICbKr]aXQFt]tUs]p]l]o]h]nPXHn]i]j]rKm]M16@;<q]w]v]k]nE{]$^#^x]oC{BaU5N}]L2hD_J>Gz]|]~]"^*0N1,^&^6=oH!^%^)^(^'^-^LT3^*^.^Y@!16^1^2^&Q5^/^0^=P4^mJ9^8^7^;^e=X2jC:^:E<^YL*7eT=^?^"DA^>^@^:UB^.r";2B0EGB/riP]S=kf30r1r-Jg:3r5r4rdK:O2r4JORlBCN8rv07r>rO2AQ:r<riT;r6r?r=r9rGrDrFrJrBr@rEr{VAryG_IHrF905CrIrPrVrW;Ur\MkVRrTrr8KrNryB]ULrMrOrSrYr<Sj6qJd7WrXrZr]r[r\rQQQrIMON)Vcr[C`r/@lr^rarhrbrgrfrir_rdrjr,Seru2rr+PurH;yrprvrxrzrsrqr{:{5orwrmrnrkr&s#s"strZH{r%sxC}r's)s$s|r+s*s]B.s0s!s1s,s/s~r-s2s4s(s3s5s7P8syY9s7sdH6s:s;s@4Cn<s=s*Q,tFPPP\QNOV=CQb:iaBRBq92m1Cq@ID3rY%KDqTVEq@tFq,TGq@0AtBt|4[E;LdP`MHqsY;1.O$8JqKqC2QA0WIqLqNqvYaR#TCt9HDtMqOqc?PqTqVqQqQIaEcB|9SqUqS9[qV:}0YqXqRqZqWqlHJM]q=e\q^q_qeOEts=`qaqwN*R{q28{<[9f9YCSJhj@@u>ijjjkjljmjnjojG={u}u~u|ub=!v%4"v#v2lTQjY$v:n2U~S\LDJ@e%v/>)F%ZF<)6<8OH%<&Z'ZVLCH(Z}F5QiR6QG<2=d;)Z*ZHQ+ZmPo6[BOKm7hIC7w>$V,Z-Z@FgW6J)U_KoU.Z_VJ40Z/ZkR1Z2Z3ZTJ4Z+J5Z6ZO3oV7Z0;.58Z9Zn9/QhR:ZC8jOo2;Z<Zk=\NoS=ZsN>ZUSe;?Z5KPK@ZkGnVAZ5EA6BZL7N?CZDZ-KEZw5FZBA;WGZ8LjR1DHZ}5Q;IZ3PJZKZ=NLZMZNZw2QZOZhQPZUCRZSZTZUZ;P%Ry0VZ+GWZw=!CXZYZ}C7LZZ[Z>@WF\Z]Z4G^Z_ZH9m;96xtytcM9u`ksO?;@:%TYatu*1r2uuwuQ:vu2Cyuxu41jU:819F2pTMO\0KUu;JV770L6Fa1:9|Va9!7z<Zj[jyLs9\j{43CQ7X:]jtT^jV<_;_j^A8B_TJW`jajdjbjcj^I38D6ejjJMIM4YbbEfj5@8Wgj,W|HSXMX^TyTDI.SS8`3bIvtU:wt_Wqt08TUO8pFC3rt,3=TwGttstKL$HutcW?E@u;uCuBu:VAu>TDuLuO0x5IuJu\EEuFuGuKu`>Huz8PuSug?r9<uMu7BxLy<NuOuQue6RuUu=uTu;Sl3$LVuWua>Xu_L[uH2YWYuZu\ubu`u_u]uau^udueucL?e85cuhu#Lfugu>uD1?uE5d2luiuW6mujukuZ4jTnuy3ouqupurusumI*9{Gc6IL&j53~Tl9yPmi*WniVBmHd:oipiqiaVrisiuitiviwiaGxiXTyiN=zi{iO=|i(8>A}i21T;u9~i!j"j#jx7-<dJN`/T=O7U$j^U%jAP<9G4Y11@f1g1h1=3hHAe_1IAo4(GXSyF8Q}9uB-SKT|=Be57Ce9;bUx=6T%N,AY3vLFeDeHeJeGeO5HF|5EevJIeTCE1#<7WKMMKJJSLLeKefD!Q7QMePe8MpVOe]5>MQe:6(Md9EJQ3YKlTRej7NeUe~4VeSeTe]R_BF1bS]6lKWevSi1t6ZeXeYe@5ER\e^e]e2G#R[ebTZU`eqWae\1{QbedeceeeXRK5_guZxZvZwZzZOPGDn00PyZJS*:"[qG|Z{Z[I}Z![^W~ZZA%[tS'[$[([<=I@#[&[#V)[-[.[,[B:$?+[*[GT?2/[y90[;3&5<61[u62[I14[3[5[7[6[8[9[:[OSztuGCWdE|t}t{tF>oPS7MT*L"u!u(:~tVK$uR@j3*M%u#u4=(u)uM=8Ca?aK*u&u'upD,u<4mWW4+u.u-u/uQPQC)H0u1u2u3u4u5u7u6u8uI2TSMJo@XV0R?Ap=*8x<FvGvHvIvJvLvKviwMvNvDnEnFnkU$6HnGnInJn%GKnLn07v5MnOnNnF8PnQnRn[6.3SVFD51V8SnTn?TUG{>YN39VnUnXnWn%EYnZn.G[n/G\n'2]n^n_n`nanjWbncnX<dnKSzL,2eAen&G-Cfngnhninjnknlnmnnnonpnqnrntnsnun-MABvnwnxn!Uyn3Ozn{n|n}n!o~n"ou8zC#o$oB=?Ry2%o&o'oxR(o}V)oLF*o+o4A,ozOxK.o-oz3x9/o0obP1o2of7?P3o4o5oqH`L6o7o8o9o:o`U;om4*C<o=o>o?o}N@o`B846Wu=GOCoAoBoDo'6|<b>LCEoFoGoOoHoIoJoBGqoM6KoLoMoF6>CNoPoQoRorUSowDToxDUoVod8w0WoXoYoZo[o\o]o^o5>ao_o`obocoMAdoeofogohoiojokoloX@mo-AnooopobO$3ECEcAIFcU1JN34rHGcPOHcd<IcJcFC"UVDk9ENKcvCLc'7s8R:McNcDTOcPcKQQcRcScTcVQUc{2;@Vc+@WcXcYcZc[c78bZS6dZcZfZnHeZ@7tQuRsUW=hWhZgZ"0SMiZ=8J<=B$BB3jZ*B0D5=^OkZBI]1lZ86:T}3mZITUOcEnZoZpZjAUL]OgS!BqZeKrZfK~Rt8sZ/06OOUmKtZDc%A?v@vAvQD8HcQ[PEQ/<M9toF4:SBv{3Cvq5EvjS'v)Q)v(vcAW@"1mNhP+vvO*vpU,v9Ct;.v-v^DXA*K<O/v0v1v6BT0yE2v`G&v8>2>e5G7??RCfCLXo8y=%QP00w1w,P002w3w4wJGO>7w6w^15w8w9w$NMH+:8h9h:hB>tROTXI3R%6jG|qnO3KkPoggMK9Y6}qd0LK~q$T-BlADF1>!rU<"r#r$rCR5FGM%r1SE?bL&r'rUQn6(r)r_5*r+r|2,r-r'Hg7)l*l+l,l.F-l.lI73J8bOwPwM2QwSwRw;b"<<b=b>b?b@bAb97{R$=NJ%1GKBb|6DHCbH=}1Dbv6EbYDFbZO]9Gb!@Hbv2IbsAJbKbxBLbMbNbWJ8XeYcO%p0\mB&TTM1Q[3}G52?B`f;JafbfT>cf$WUMef]<dfffgfnB>=hffB':ifjfR3iQ%?kfoFlfmfnf-Fof'Ipfqfrf9esftfbBufvfhVwfxfG9;w:w>w<w!:?w@wBwAwDwCwEwFwGwhK_8TwUwVwXwZwWw[wYwWW\w]w^w_w`wK[*Xwem9}?j;IwGFHwJwLwKwMw:NNw'De"f"g"h"i"j"k"l"m"n"!!"!#!(!)!4!5!6!7!8!9!:!;!>!?!~!2!3!<!=!!$"$#$$$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%$!E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(_(`(a(b(c(d(e(f(g(h(i(Y"Z"["\"]"^"_"`"a"b"E"F"G"H"I"J"K"L"M"N"O"P"Q"R"S"T"U"V"W"X"1"2"3"4"5"6"7"8"9":";"<"=">"?"@"A"B"C"D"$)%)&)')()))*)+),)-).)/)0)1)2)3)4)5)6)7)8)9):);)<)=)>)?)@)A)B)C)D)E)F)G)H)I)J)K)L)M)N)O)P)Q)R)S)T)U)V)W)X)Y)Z)[)\)])^)_)`)a)b)c)d)e)f)g)h)i)j)k)l)m)n)o)v!u!x!w!t!s!p!r!q!o!n!b!a!*!,!.!/!0!1!-!k!d!e!y!f!m!q"r"s"t"u"v"w"x"y"z"{"|"{!|!z!}!J!G!F!L!X!^!O!N!D!E!I!H!R!S!`!_!C!K!W!V!U!Y!T!\!]!Z![!Q!M!P!&!%!!&"&#&$&%&&&'&(&)&*&+&,&-&.&/&0&1&2&3&4&5&6&7&8&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&''!'"'#'$'%'&'(')'*'+','-'.'/'0'1'2'3'4'5'6'7'8'9':';'<'='>'?'@'A'Q'R'S'T'U'V'X'Y'Z'['\']'^'_'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'W'h!l!'!c!@!A!$("(((&(:(,(*(0(.(B!4(2(9(!(%('()(-(1(#(+(/(3(5(6(7(8(JU?��W(c�T	U�T�vLv<��w~��x1r����(l�[�O	c�f�\��Hh��f�v�QVe�q����PeY�a�o��LcRb�S'T{kQ�u�]�bˍv��b�]W8�b8r}v�g~vFdpO%��bz�e�s,dsb,���gHrnb�b4O�tJS�R�~��.^�h�i���~�h�x��Q��P$�ނހS�eR�����O!Xq��[�b�b�fy���rog�x�`QSS��̀���
P�rY�`q��TY�,g({)]�~-u�lf���<�;��k�{|_�xք=��k�k�k^�^�u�]e
_�_���X�[�����,�Ab�O�S^S������M�hj_��h�֜�a+R*vl_�e�o�n�[HduQ�Q�gN�y|��p�uv^�s�d�b���lZS�Rd”�{/O^6����$n�ls�Uc\S�Te��W
N^ek?|�`�ds��PgMb"�lw)�Ǒi_܃!���S���k�`�`p͂1��N�lυ�d�|�i�fI��SV{�O�QKmB\m��c�S,�6��g�x=d�[�\�]��b�gz�d�cI���� �N���fs:W\8^�P���S^eEu1U!P���b��g2Vno�]5T�pf�ob�d�c{_�o�ば�\hf�_�lH���l��d�y�WYjbHTXNz�`�oڋb����yT�ucS`lߏ_p�;���O:\d���e�pEQ�Qk�]�[�bl�tu� zay{�N�~�wN�R�Qqj�S���ϖ�nd�Zi@x�P�wd�Y�c�]z=i O9��U2N�u�zb^�^�R9T�pvc$��W%f?i��U�m�~"�3b�~�u(��x̖��Ha�t͋dk:RP�!kj�q��VS�NN�Q�|��|�O��{�zgd]�P�v�|�m�QgX[�[�x�dd�c+c�-d��T{)vSb'YFTyk�P4b&^�k�N7����_.� `=��b9NUS���cƀ�e.lFO�`�mދ9_ˆS_!cZQa�chRccH�P�\wy�[0R;z�`S��v�_�_�vl�op{vI{�w�Q��$XNO�n�Le{�r�m��Z�b�^0W��,{^_����c�n�x�pxQ[��W5uCO8u�^�``Y�m�k�x�SՖ�QR�c
T���̍9r�xv��
��SN�v�S��v��-��[��"NN�Qc��a�Rh�Ok`�Qm\Q�b�ea�F���u��cw�k�r�r��5XywL�\g@����^!n�Y�z�w;��k�eXQQ��[�X(Tr�fe��V���vA��c�TY:Y�W��5g��5�AR�`X���\E��O����%Zv`�S|bO���i`�?Q3�\u�1m�N0��SZO{OON��l�s�^ju�
j�w��A~�Q�p�Sԏ�)��rm��lJW���e��?b2��Y�N���~>e�^�aUޘ��*S�� T���^�l9���Z�)TlR�~_Wq~l�|KY�N�_$a�|0N\�g��\�Θ�u�p"��Q��IY�Q[O&T+Ywe��u[vb�b��E^l&{O�O
gnm�m�y��_+u�b���Oܑ�e/�Q��^P�t�oR��K�
Y�P�N�6ry���[��D��Y�TvVV�9e�i���v�nr^uFg�g�z��v�a�ybec��QR��8���~�\/n`g�{�vؚ����|dP�?zJT�TLkdb=��urRi�[�<h�����*NT�~9hߍ��f�^��W?��h�];e�Rm`���O��lQ�[_�]^l�b!�qQ���R�l߂�r�W�g-�Y��ǃ�T�{0O�ld[�Y��Sʆ��7���Ee~��Vǖ.R�tPR�[c�VN�b*`�hsQ�[�Q‰�{��P�`Lp/�IQ^�ptĉ-WExR_����h�<��xvBh�g�5�=R���n�h��V�g��Ǐ�T��i[wm&l�N�[��c��a���+T�m�[�Q�UU��dMc�e�a�`
qWlIl/Ymg*��X�Vj��kݐ}Y��SimuT�Uw�σ8h�y�TUOT�v����l�mk��d�:�?Vў�u�_�rh`�T�N*ja�R`p��T�py�?�*m�[_�~�U�O4s<T�SPT|TNN�_Zt�Xk��t��r�|Vn'_N�,U�b�N�l7b���TNS>s�n;uRS݋�i�_`�mOW"k�sSh؏bc�`$U�ub�q�m�[{^R�LaĞ�xW�'|�v�Q�`LqCfL^M`�pp%c���_b`Ԇ�V�k�`gaIS�`ff?��yO�pGl����~d�fZZB�Qm�mA�;mOkp��b�`
�'�xy�Q>W�W:gxu=z�y�{��e����o��!��Y�~		T�g�h��M|Ɩ�S%`�urlsS�Z�~$c�Q
��]߄�b�Qc[OmyBR�`Nm�[�[�����e�_E��Y�~�~	V�g9YsO�[�RZ���>�2u��GP<z�N�g~��Z|k�vZW\:{�Nq|Q��p�xY'��h�g�xwx�bac�{�OjR�QP��it���1���.��{�NeP0�QRo�n�n�m�^�P�Y\Fm_l�u��hhVY�� Sq�M�I�iy&q���NʐGm��Z�Vd��w�O��r҉z�4�~RYeu�����S�z�c�c�v�yW�6�*b�R��Thpgwckw�zm�~��YbɅ��LuP�N�u�J\�]K{�eё�N%m_�'}&��N(�ۏs�Kf�yя�pxm=\�RF�bQ�[wvf���N�`�|�|�~�Nf�of��Y��Xle\��_�uV��z�z�Q�p�z�cvz�~�s�ENxp]NR��SQe�e����T1\�u���b�r�uE\y�ʃ@\�T�w>N�lZ��bnc�]wQݍ�/��O�S�`�pgRPcC�Z&P7wwS�~�d+e�b�cP5rɉ�Q���~GW̃���QT�\�O�zZmᐏ��U�TaS�T_�cwi�Qha
R*X�RNW
xw�^wa�|[b�b�N�p��b�p`�wWۂ�g�h�x���y�X�T�S4nKQ;R�[����CU�Ws`QW-TzzP`T[�c�b�Scb�[�g�T�z�w��^�8Y�Wc��WWw{�O�_�[>k!SP{�rFh�w6w�e�Q�N�v�\�zu�NYA��P��'a�ndWfFc�V�bib�^��W�b�U!�J���fU��egV�݄jZh�b�{�pQ�o0��cȉ�a�p�nt�i�r�^ΐgjm^c�Rbr�lO�Yj��p�m�RPN��m�~��x/}!Q�W�d��{|�l�h^i�Q�S�h�rΞ�{�r�yotNg̑��<y��T�Th=N�S�R>x�S)R�P�O�O�u�z�|�l���R�t�T�OT���ޏp��^`�m^[e8���K`�p�~�|�Q�h�|o�$N��ϑ~f�N��dJ��P�u�q�[��fo�N�dc��^�eRˆ�p�Rs3t�g�x�4N��ޜ�m�QA�T�b�s���Ô6O��Qupu��\���S�N�n	t�ikx��YuR$vAm�gmQ��K��T<{�z���W�bG�|iZd�{oK���bS���^�p�cdSO������x2��B��^o�yU_F�.bt�Tݔ�O�ee\a\Q�/l�_�s�n�~�\cj[�nuSqN�ceu�bn�&O�N�l�~�����W;�#��{����=�m���~�Y���sx��l���VT�WpN��VSȏ	��w����n��fba+o)���+��vl�_��+s���k�wƔoS��Q=^��8�HN�s�g�hv�	�dq�l	w�ZA��k�'f�[�Y�Z���N����j�v0�s�h_[/w��a��|���%_s|�yʼn�l��[B^�h w�~�QMQ�R)Zb�ׂ�c�wЅ�y:n�^�Y�mpl�b�vOe�`��f��#��
T}T,�xdyd�!j���xidT��b+g���X؞�l o�[L��_r�g�bar�N�Y�k�X�fU^�RUa(g�vfwgrFz�b�TPT����Z�~lCNvY�HYWS7u���V c�|`���mbT���Q�Z���Y�*P�l<\�b`O?S{���n+��bt^�x�d{c�_Z��?\OcB�}[nUJ�M��m�`�g�r�Q�[�b�l[rmb���~�Sm�Q_tY�R`sY�fP��u*c�a�|���T'k%��kՅUTvP�ljU��,r^`6t�b�cLr�_Cn>meXo�v�x�vTu$R�SSN�^�e*�ր�b�T(R�p��э�lxTڀ�W�T�j�M�iO�l�U�v0x�b�p�om_��h|x�{��gO�gc�xoWx9�yb�b�R5t�kdU>��u�v9S�u�PA\l��{OPGr��ؘo�thy�d�w�b��+��TX�RNjW��
�s^�Q�tċO\aW�l��FZ4xD�돕|VRQb���N��a�郲��W4gWnffm1��fpg:khb�YN�Qo�g�lvQ�hGYgkfu]�P��eHyAy��w��\^NO/TQYxhVlď_}l�l���cp`=murfb��ŔCS��~{�N&�~NԞ����MR\oc�Em4�XL] kIk�g[TT���X7�:_�bGj9�re�`eh�wTN�O�]���d��\�O�zR�N/`�z���O�N�y4t�R���d�y�[�lR�{�"l>PSn�dtf0l�`w����^<twz�yN��tBl�VK��l��:SƆ�f��H\q� n�S6Z�����SW��Cg���lhQ�u�b�r8R�R:�p8vtSJ��inx��و�6q�q�Q�g�t�Xe�V��v�pb�~�`�p�X�N�N�_�N��R�Y�~Tb�N�eb8�Ʉc����q�n�[�~�Q�c�g��9��Qz[�Y��sN]leQ%�o�.�J�^t��m�1_�dm(�n�Ü^X[�	N�SOceQh�U'Nd��kb�Z_tr��m�h�P��x@g9R�l�~�PeU^q[{Rf�s�Igq\ R}qk��U��da����UUlGb.�X$OFUO�Lf
N\�hNc
z�p���R��\�T���~bYJ�dž�
�f�Dd\Qa�m>y��7x3u{T8O���m Z�~^y�l�[vZu��Nan�Xu%urrGS�~w�viR܀#W^1Y�r�en׋8\q�AS�w�b�e�Nߘ���[Ƌ�S�wON\v��Y_:y�XN�g�N�b����R/f�UlV��N�Oʑp�l^C`�[ƉՋ6eKb���[�[�c.U�S&v}Q,��g�h�k�b���S��m�ufNN�p[�q���f�fr�͞ �^\/g�h_g
b�z�X�^pe1oU`7R
�Tdp�)u^h�b��S=r�4lawz.T�wz���Uxg�p�e�d6V`�y�SN{k���[�U�V:O<Or��]~g8�`����[����dX��d�Uςe��O }��|�PQX�n�[ɋ��x����{}������~Ӛ�x�\WzB���_yY[_c{ф�hU)t"}�@bLX�N�[yYTXmscK��΀Ԃ�b�S�l^�*Y`plMWJd*�+v�n[W�j�umo-��fW�k���x�c�S�pdlXX*dX�h��U�|P���m���p�c�m�n�~�Ch��mv���WYyr�~��u���hTR"���c��D�|USO�f�V�`�mCRI\)Y�mkX0uul`�F�cag�:w�4���^�S,T�p@l�^\P�N�^:cG��Phn��wTܔd_�zvhEcR{�~�uwP�b4Y��Q�y�z�V�_��m`\WTTQMn�V�c����*��To\���bXb1�5�@�n�|�-i�Y�b>Uc�Tن<mZ�t��jkYL�/_~n�s}�8N�p�[�x=cZf�v�`�[IZNU�jl�s�N�gQ�_�eg�_�YZ�]�_qS�ݏEh�V/U�`:NMo�~ǂ��YO*O>\�~*g�sTOuÀ�UO�MO-n�	\pakSv)n���e���~;T3z
}��U��tc��m�zb�egS�c�l�]\T��LNal�K\�e���h>T4T�kfk�NBcHS�
O�O^W
b��dfir�R�R�`�f�q�g�Rx�wpf;V8T!�zrzo`^�`��Y�`�q�p�nPl�r�j��-^`N�Z�U�m�|��b�~�w~�#S����f�\�O�rN�SYT�c(�HQ�N���~�T$�T�7��m&_�Z>fi��s.s�Sz�����[w�P��~�v�Sv����{D�XnaN�ey��`�T�Ny��]aj�PTa�'�]x�JR�T�V��m�[�mSf\][!h��xU{HeTi�NGkN���OSc:d���e����Q�hxS���a�l�l"�Q\�����#k���e�_�_�OE�fe�)s�`tQR�Wb_��L���x^Og'`�YDQ�Q��SylĖ�qO�O�=g�U��y���~�Xb�Z�V{��_��ĄW��S�e�^\ud`n}Z�~�~i��U�[�`�e�s	�cv)w�~t���f[tz�@��R�q�_�e�[o��]�k[l����
�ŏ�S�b&�-�@T+N��Yr��]Y��mŖ�T�N��	q�T	��p�m�v%Nx��\�^�����p�lDY�c<wM�os�0X�q�Sx��Uf_0q�[����k.Y/��yhglboO�u�m3�'l�N�u{Q7h>o��p��YvtGd'\e��z#��Y�T�o����0iNV6�7rΑ�Q_Nu��cN�S�fK�Y�mN�X;S�c�O
Oc���7YW��y�N�u�l�[�Y]_i��P�]YN�w�Nz��bf��y\�Ny_Ɓ8����u�NԈa�k�_IN�v�n㋮�
�ы_���~5�k��V�k�4��YT���m�[n�9\_��pS�1jtZp��^(��$�%�g�G�Ώb��vq_��lx f�T�bcOÁ�u�^͖
����T�l�m8l`�R(u}^O�`�_$\1u�����r�l8nI�	g�S�SQOɑ��S|^�m�N�v�i^�a�YO�O>�|�	ann���N1Z�N\�y�[틽�s�W����TG��U�\�_a2k�r����tm�[Ո��k�m�3�
n�QCQ�W���S�c���VXTW?s�n܏т?a(`b��f�~��Í���\�|g�`���N�Sh�AQЏt�]�Uf��U[S8xBg=h�T~p�[}��Q(W�Te�f^�C��l�m��|�Q���g�e�o����jV ��vvp�q#��bR�l<�`�X�a�f`�Nb�U#n-gg���(wh�i�TMN�pȋXd�e�[�z:P�[�w�ky��|�l�v�e��-]U\8�h`Sb�z[n�~j�zp_3o _�c�mVgN^&��N��4v���b-f~b�lu�gqiFQ���Sn��b�T����ُYm�s�ewu'x������O�g�uʋ�/cG�5���#cAw�_�r�N`te�bck?e'^�uѐ�����g/e1T��w���AlKN�~L��v
i�kgb<P�O@Wcbk���S�e�~�_c�c��n^�\6Rzf�yz(��p�u�n�l�z-N�v�_��w��~�y��͑�NO�hT�]2m̋�|t���^�T�v�[<f���s*hۆ1g*s��ۋ��z�pnq�b�w1V;NW��g�R��.���Q{OO�l]y{��b*r�bNxl��dZ��{ih�^ň�Y�d�X�ri%���X�`W��QIc�bSSLh"t�L�DU@w|pJmyQ�TD��Y�n�m\[+}�N}|�nP[�
nW[��h*��[�~;`�~��p�OY�c�y��RS�eVyŋ;��~���~4V��gj
\u�(f�]PO�gZP\OPW�^�NN@QN�^ESN�NN2�l[iV(N�y?NSGN-Y;rnSl�V䀗��k~w�6N�N�\NiN�N��[[lUV�N�S�S�S�S�Se�]�S�S&S.S>S\�fScSRRR-R3R?R@RLR^RaR\R��}R�R�R�R�R�QT�N�N�N�N�N�N�N�NO�N"OdO�N%O'O	O+O^OgO8eZO]O_OWO2O=OvOtO�O�O�O�O~O{O�O|O�O�O�O�O�O�O�O�O�O�O�O�O)PLP�O,PP.P-P�OPP%P(P~PCPUPHPNPlP{P�P�P�P�P�PQ�P�P�P�PQQ�N=lXOeO�O��Flt|nQ�]ɞ���QY�R
S�S�QYUQ�NVQ�Nn����N�҈�y4[���Q�Q�Q�Q�Q�Q�Q�Q��������������‹Ëˋϋ΋ҋӋԋ֋؋ً܋ߋ����������������������������� �!�%�'�*�+�.�/�2�3�5�6�iSzS�"�!�1�*�=�<�B�I�T�_�g�l�r�t���������������������������������ϐŐ��АĐǐӐ��ܐאې����"��#�1�/�9�C�F�
RBY�R�R�R�R�T�R�R�R�S�q�w�^�Q�Q/��S_Zu�]LW�W�W~X�X�X�X)W,W*W3W9W.W/W\W;WBWiW�WkW�W|W{WhWmWvWsW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WX
X�W�WXXXDX XeXlX�X�X�X�X����ay�}��������������������������Ȃʂ゘�����˂̂������������Ă΂���	������܂�҂؂���ӂ������Ղ�Q�[�\����<�4�1���^�/�O�G�C�_�@��`�-�:�3�f�e�h��i�l�j�m�n���x���������������|�����}���{���������������؃X��݃��փ�8���ԃ߃�������Ń��&���\�Q�Z�Y�s�����z���x�<�F�i�v�����1�m���̈́Є愽�ӄʄ���������������
u8��9��:�V�;�����Y�H�h�d�^�z��wC�r�{���������y�������������Ӆ��܅��'��)��<��^_<YAY7�UYZYXYS"\%\,\4\Lbjb�b�b�b�b�b�b"c�b9cKcCc�c�cqczc�c�cmc�c�cic�c�c�c�c�c�c�c�c�cRd�c�cEdAddd dd&d!d^d�dmd�dzd�d�d�d�d�d�d�d�d�d	e%e.e_�_u__S�S�S�S�S�STTTKTRTSTTTVTCT!TWTYT#T2T�T�TwTqTdT�T�T�TvTfT�T�T�T�T�T�T�T�T�T�TrT�T�T�T�T�T�T�T�T�T�T�T�T�T�TU�T U�TU�T"U#UUU'U*UgU�U�UIUmUAUUU?UPU<U7UVUuUvUwU3U0U\U�U�U�U�U�U�U�U�U~U�U�U{U�U�U�U�U�U�U�U�UV�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U��VVVV$V#V�UV'V-VXV9VWV,VMVbVYV\VLVTV�VdVqVkV{V|V�V�V�V�V�V�V�V�V�V�V�VW
W	WW^^^^1^;^<^7^D^T^[^^^a^�\z\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]']&].]$]]]]X]>]4]=]l][]o]]]k]K]J]i]t]�]�]�]s��]�]s_w_�_�_�_�_�_�_�_�_�_�_�_b�a_�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rs�rs�r�rss!s
ssss"s9s%s,s8s1sPsMsWs`slsos~s�%Y�$YYc�g�h�i�j�k�l�t�w�}����������������������^�^�^�^�^�^�^�^�^�^S��^�^�^�^�^���_�_�_�_`�_`�_�_�_``�_�_�_`5`&```
`)`+`
`?`!`x`y`{`z`B`j`}`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�` a&aa#a�`aa+aJaua�a�a�a�a�a�a�_����������������
���
��������,N?rb5lTl\lJl�l�l�l�l�lhliltlvl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l9m'mmCmHmmmmm+mMm.m5mmOmRmTm3m�mom�m�m^m�m�m\m`m|mcmn�m�m�mn�m�mn�m�m�mn�mn�m+nnnNnkn�n_n�nSnTn2n%nDn�n�n�n�n-o�n�n�n�n�n�n�n�n�n�n�n�nboFoGo$oo�n/o6oKoto*o	o)o�o�o�oxoro|ozo�o�o�o�o�o�o�o�o�o�o�op#pp9p5pOp^p�[�[�[�[�[�[/u��4d�[�[0��[G����ӏՏ����������&��
��!�5�6�-�/�D�Q�R�P�h�X�b�[��ft�}���������P_W_V_X_;\�TP\Y\q[c\f\�*_)_-_t�<_;�n\�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ�YZ�Y�Y�YZ	Z2Z4ZZ#ZZ@ZgZJZUZ<ZbZuZ쀪Z�ZwZzZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z	[[[2[7[@[\\Z[e[s[Q[S[b[u�w�x�z��}����������������������������������������~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~
�~�~�~�~!"#$%&'*+,-/01235z^u�]>u���s�s�s�s�s�s�s�s�s�s�s�s�s�s�s|�
t�s�s�s�s�st*t[t&t%t(t0t.t,tttAt\tWtUtYtwtmt~t�t�t�t�t�t�t�t�t�t�t�t�t�t���LgSg^gHgig�g�gjgsg�g�gug�g�g�g�gwg|g�g	h�g
h�g�gh�g�g�g�g�gh�g�g�gh�g�g2h3h`hahNhbhDhdh�hhUhfhAhgh@h>hJhIh)h�h�hthwh�hkh�hni�hi i�h$i�hiiWi�hiqi9i`iBi]i�iki�i�ixi4i�i�i�i�i�ificiyi�i�i�i�i�i�i�i�i�i�i�i�i�i�i/j�ijjej�iDj>j�jPj[j5j�jyj=j(jXj|j�j�j�j�j�j7sRs�k�k�k�k�k�k�k�k�k�k�kk�m�q�r�s�u�v�x�w�y�z�|�~���������������������Ύbbbb"b!b%b$b,b��t�t�tuuu4e�e�e�e
ffrgfff�p�ff4f1f6f5f�_fTfAfOfVfafWfwf�f�f�f�f�f�f�f�f�f2�3�6�;�=�@�E�F�H�I�G�M�U�Y�ljʉˉ̉ΉωЉщnr�r]rfror~rr�r�r�r�r�rc2c�c?d�d��k�k�k�k�klll
lllll!l)l$l*l2l5eUekeMrRrVr0rb�R��������
g����������������ۀ€Āـ̀׀g݀����
���g�Z�6��,��2�H�L�S�t�Y�Z�q�`�i�|�}�m�g�MX�Z�������n����́&gʁ������$k7k9kCkFkYkјҘӘ՘٘ژ�k@_�k�eQ��e�e�e�e�e�e�e�e�e�p�p�p�p�p�p�p�p�p�p�pqqq/q1qsq\qhqEqrqJqxqzq�q�q�q�q�q�q�q�q�qr(rlpqfq�q>b=bCbHbIb;y@yFyIy[y\ySyZybyWy`yoygyzy�y�y�y�y�y�_�_<`]`Z`g`A`Y`c`�`a
a]a�a�a�a�ab����l�l�m�w�wx	xxxx�e-xxx9x:x;xx<x%x,x#x)xNxmxVxWx&xPxGxLxjx�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy�xy$yy4y���������vw
w�vwww"ww-w&w5w8wPwQwGwCwZwhwbweww�w}w�w�w�w�w�w�w�w�w:u@uNuKuHu[uruyu�uXa_H�htqy�~�v�v2�������������������������������������������������������������������ĔȔɔʔ˔͔̔ΔДєҔՔ֔הٔؔ۔ޔߔ���������������������������	�
�
�������������"�*�+�)�,�1�2�4�6�7�8�<�>�?�B�5�D�E�F�I�L�N�O�R�S�T�V�W�X�Y�[�^�_�]�a�b�d�e�f�g�h�i�j�k�l�o�q�r�s�:��w�wɖ�y�y�y�yzG]zzzz9z7zQzϞ��pz�v�v�v�v�v�t�t,u �"�(�)�*�+�,�2�1�6�8�7�9�:�>�A�B�D�F�G�H�I�K�L�N�Q�U�W�Z�[�\�^�c�f�g�h�i�j�k�l�q�m�s��u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�uvvvvv
v%vvvvv<v"v v@v-v0v?v5vCv>v3vMv^vTv\vVvkvov��zxzyz�z�z�z�z�z�z�z�z�z�zd�i�r�}������ƈ����Ɉ�Έ���������!����
�4�+�6�A�f�{��u倲v�v�w���� �"�%�&�'�)�(�1��5�C�F�M�R�i�q���x�������������������������������M�T�l�n��z�|�{�����������������������Ć��Ά��������Ɇφ�������І�ކ�߆؆ц�����
�
�	�#�;��%�.��>�H�4�1�)�7�?���"�}�~�{�`�p�L�n���S�c�|�d�Y�e�������҇Ƈ������������凬�����ˇӇ��ч��ʇۇ�������
��!�9�<�6BDE��z�z{{{{
{+{{G{8{*{{.{1{ {%{${3{>{{X{Z{E{u{L{]{`{n{{{b{r{q{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|�{�{||||*|&|8|A|@|������D�!�"�#�-�/�(�+�8�;�3�4�>�D�I�K�O�Z�_�h�~�����؈߈^�������||Ie�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|n��f����������|w}�}�}G~�~����s���������g�m�G�I�J�P�N�O�d�b�a�p�i�o�}�~�r�t�y�����������������������������U�~�����Y�i���������č֍׍ڍލ΍ύۍƍ���������	������,�.�#�/�:�@�9�5�=�1�I�A�B�Q�R�J�p�v�|�o�t�������������x������������e։މډ܉���>�&�S���������*�-�0�>����������������������
�������ΖҖ�w����Ȓ>�j�ʓ��>�k������������#z����������������������������������������������������������������������ĜŜƜǜʜ˜̜͜ΜϜМӜԜ՜ל؜ٜܜݜߜ�|�������������������������X�����������ښ˚̚њE�C�G�I�H�M�Q��
�.�U�T�ߚ�����������#�����;~����������֓����۞ܞݞ�ߞ������"�,�/�9�7�=�>�D� !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO�����+���M���k���������1111	1
111
1111111111111111111 1!1"1#1$1%1&1'1(1)1%%%%%%%%%	%
%%%
%%%%%%%%%%%%%%%%%%% %!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%000�0���00 ^� &     000	0
000
0000000���6"'"("""*")""7""�"%" "#�"+"."a"L"H"=""`"n"o"d"e""5"4"B&@&�2 3 !����0 �!&&�%�%�%�%�%�%�%�%�%; �!�!�!�!0�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$t$u$v$w$x$y$z${$|$}$~$$�$�$�$�$�$�$�$�$`$a$b$c$d$e$f$g$h$i$ 2!2"2#2$2%2&2'2(2)2`!a!b!c!d!e!f!g!h!i!j!k!��������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]��A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\][^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}Y�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� gb2312U�������������������h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������硥���������������������������������������������������������£ãģţƣǣȣɣʣˣ̣ͣΣϣУѣңӣԣգ֣ףأ٣ڣۣܣݣޣߣ�����������������������������������������V���W�������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��ҡ�@���A�B�C���������Ϣػ���D����E����ǧ��F������Դ���˩�G�H�I���J�����K��ɭ�L���������M�N��O���P��Q���R��ͤ����S���پ��T�U�V���W�þX��ش���Y����Χ�����Z�������[�Թ\�˳��]�^���ž�ƲҰ���_�`�a�b���c�d���e�f�g�h�i�j�����k���l�m�n�o�p�q�r�s�t�u���v�w�x�y�z�{�|��}����~������������ԥ����ή������؃��ѩЄ���������ͺ����������ຶĈ��ϩ�������������ٌ��ٍ����������ؑ������Ҳ������������𳔁���齕���Ӵ�����˜�ֲ������ն��ϙ��������تǜ��؝�����Ҟ����ؠ������á������Ѥ����إ����ۼ�������ȩ�ݷ��·���Ƭ���������������ҳ����ο������е����������������غ����ɰΫ����ؽ������ؾ�������������Á��ā�Ł�Ɓ��ǁ��ȁ�ˤ�Ɂʁˁ́́�΁ρ��ЁсҁӁԁՁ��͵������ց��ׁκ؁����������ء���فځ������ہ��܁��݁ށ�߁���۰��Ѽ��づ����灬ٮ�聫ٹ���끩ٶ����޳�����������������������������������������@�Ľ�����뿭�A���B����C�D�E�F�G���H�I�J�K�L�M�N�O�P��Q�R�S�ٴ��T�U�V�W���X�Y�Z��������[�\�]�^�_����`���a��٣��ӹ�b���c���d�e���f��٩���g�h���Щ�i��j���k�l�m�n���o���p�q�r���s�t�u�v�w�x�y�z�{�|�}�~����ٶ����ق�������󾅂��������҈��ى���轋�����������뾏��ٻ��Đ����ّ����������������������՜��֝��Ǟ��������٢�����ټ�٥������٨��٫Ʃ����������ٮ��������ײ��ͳ��������������������������������‚ÂĂłƂǂȂɂ�ŵ�ʂ˂̂��͂΂�٥���ςЂт҂��ӂԂ��Ղւׂ؂��قڂۂ܂݂ނ߂��������������������٢�����ߴ����������������������ٵ��@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q���R�S�T�U�V�W���X�Y�Z��[�\�]�^�_�`�a�b�c�d�e��ٮ�f�g�h�i�������j�k�l�m���n���o�p�q�r�s���t�u�v�w�x�y�z�{�|�}�����~������ق������������Ȉ�������������������������������������������������������������������������������������������Գ�������մ���⹵�˿���÷�����Ҷ���������ټ���������������ƒÃă��Ńƃ��ǃȃ��Ƀʃ˰������˃����̃ع�����߾���̓�����΃σ������Ѓу��҃ӃԸ��ԃՃ���փ׃؃ك��ڃۃ�â���܃��݃����ރ߃�ڹუ�⃩Ԥ������٬����������������탳������������ס�������������մ������������@�A�B��C���D�E�����F�G��H�I�J�K�L�M���N���O���˻P�Q�ʵR�����S��ͼ������ۯ�T��Զ������U�V�ַ����W���X�Y�����Z�[��Ю�\�]�^��������ո��_���`�a���b�c�d���e�f�g����h��i���ιj���k�l���m�n��֢˯Ȳ�̴̿o��p���������q�r�s�t�u�v���w��ذ�x�y�й��z�{���|���}�~��������؃��؄����؆���������羊������������������������������������؛�˽�����؝����������Ţ��������������ة����ث�������������������찦�Ӽ�ν�������������֬�ٽ�ۿ۷��������������������������„Ä����ĄńƄ��DŽȄɄ��ʄ��˄��̄̈́΄τ��Є�ф҄ӄ��Ԅ��Մքׄ؄لڄ��ۄ܄݄ބ��߄��������������������������􄴹�������������Ҵ������������������@�A�B�C��د���D�׳��E�F���G�H����I���J�K���L�M�N�˷O�P�Q���R�S�T�U�V�W�X�Y�Z�[���ǽ�\�]�����^���_���`���a�����ܻ�b�c�d�����e����׿�f�������g�h���i���j�屲߼ը����ر�k�����l���m���n�o��خáӣ�p�������q���r���s�t�u�v���w�x���y����z�{���|�������}�~�����������޲������񺈅���؊��ԋ������؍����ώ���Ǿ���������ؓ��������������ۚ��������Ȟ������ϡ���β������������沰��ӫ˴��������������ʬ�������Э��Ů������������ڿŹ����ߵ߻�н��Ȱ��ɿ�̳߷��Ӵ��ض�ź�˾̵����߶������ӹ�Գ�����߻�Ϻ��������������ϸ��Ͻ��¹��¾�������������ͷ��…��Åą�ɰֶԷŅ����Կ����ƅ����Dž�γ�ȅɅ�ε�ʅ���˅��̅��ͅ΅��υЅ�хʳ҅渻�ӅԅՅօ��ׅ�߽߾߻ſ��߱���؅����مڅۅ܅݅��ޅ��߅����������������߶��Ǻ��������������׾��������������ͺ��̾���������߾�����������������������@�����A����������������B���C���D�ȿ��E�F�G���H�I���J���K��ߧ�����L��M�߶�����N�O����ϥ���������������P���Q�����R������ߴ�S�T�U�V�W�縶����ɨ���X�Y�޿��Z�[�\�����]�^�_�`�a�b���c�ߺ��d���e���f�g�h�i��˽�j���k�l�m�n�o�������p�q���r�s�t�u�v�w���x�y�z�{���|����߽�}�~��߀����߂������ʨΧળ�����������������ߌ���ߍ��ߎ�п�׏��ɐ����ߡ������������ߗ��������ߢ����������ࠆ������ȷ�����ƶɲ��ߦ����Ũ����ĩ���������������Я������̱��ಆ����Ϋ��ɳ����������െ�����߸��ๆ���ໆ�������྆����Ⱥ����†ÆĆņƆdž��ȆɆʆˆ̆͆ΆφІ��ц��҆��ӆ��Ԇ��Ն��ֆ���׆؆نچۆ����܆݆ކ��߆�������ㆾ����䆲����������ꆵ��������������������������������������������������������@�A���μB�C���D�¸��E�F�G�H�I�J�K�L���M�N���O�P����Q�R�S�����T�U���V�W�X�Y�����Z�[�\��ְ�]���^���_�`���a���b�c�d�ٺe�f�g�h�i�j�k�l�m�n�o�p������q�r�s�t�u���v�w�������x�y���z�{�|�}�~����������Ƭ������ʄ��������������������������������������������������������������̟������ࢇ�����������������������������ϱ����������������������༇����������‡��ÇćŇƇ��LJȇɇʇˇ͇̇·χЇч҇Ӈ��ԇՇևׇ؇هڇۇ܇��݇އ��߇��������ػ���������ڶ��������釰��뇧�Ѵ�퇧��������̹�������������������������������@�A�B�C�D�E�F�G�H�I���J�K���L�M�N���O�P�Q�R�������S��������صT�U���V�W�X�Y�Z��ۡ���[�\���]���^���_�`�a�b���c�d���e��ۮ̲�����ӿf�g�h�i�j��k�l�ἳ���Ӱ��ط����m�n���o���p����ۺ���q���r���s�t�u���v�w����x�y�z�����{�|�}�~������������ہ����������ۅ�����������ۊ�������������ⶑ����������۸����ە�ѿ�ۖ��ۗ�浘���忙������ۜ��۝������۠������������������������������������°���dz�۲����۴����۵������۷����۹��Ӻ��������۽���������ˆÈĈ��ň��ƈLjȈɈ��ʈˈ̈�����͈Έ��ψЈ��ш��҈ӈԈѶ��Ոֈ׈��؈��وڈۈ��܈݈ވ�߈�ሧ����刦�戩ܤ���̵����툰������������¶����������������@�A�B�C�D�E���F�G�H�I�J�K�L�����M�N�O���P�Q���R�S�T���U�V�W�X�Y���Z�[�\�]�^�_���`�a�b�c�d��̫�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u���v��ܬ�w���x���y�z�{���|�}�~������������ɹą����������Ǯ܊��������Ѝ�����������������ն�������������������������������������ۧ�������ڱ�������ۮ����������������������۹�������������������‰ÉĉʼnƉljȉɉ��ʉˉ͉̉Ήω����Љ��щ��҉ӉǿԉՉ��։׉��؉ىډۉ܉݉މ߉�����≸�����牴���������٦����������񉻹��������̫�����ѻ����������������м����@�A�B�C��޼�D���E�F������G�ܷH�I�����J���K�L����ޱ�����M���N�O�P�Q�R��S���T�U�°V�W�X�Y�Z�[�\�]�^�_�`�a�b��ū�c���d���e�f�g�úh�i�j�������k��׾���l���m�n���o�p�q�r�ʶ˼s�t��ѡ�u���v�w�x�y���z�{�|�}������~��������恊���Ĩ惊���慊�����������Ë��ƌ����掊�������������ĕ�������ʘ��������ù���ЯΜ�����枊�ҟ����栊���������楊������Ҩ��������������������������������淊�Ҹ������׻��ͼ��ͦ«�濽��潊���濊����Š��Ê��ĊŊƊNJ��ȊɊʊ��ˊ̊���͊Ί��ϊ�ЊъҊ��ӊԊՊ֊׊؊ي�Ӵ�ڊ��ۊ��܊݊ފߊ����㊹�����������ͻ������������������������������@���A�B�C�D���E�F���G�H�I�J�K�L�M�N�O��ӿ�����P�Q���R�S�T�U���V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g���h�i�j�k�l�m�n�����o�p�q�r�s�t�u�v�w�x�y�z�{�|���}�~�������������υ��놋���戋���������捋��޼�ɏ������������������ϗ����������朋�杋�枋�柋�����梋������յ���榋���樋���Ī��櫋���������氋����������������������������������‹ËċŋƋ��Njȋɋʋˋ̋͋΋ϋЋыҋ����ӋԋՋ֋׋؋ًڋۋ܋݋ދߋ��������������������������������������������@�A�B�C�D�E�F�G�����H���׿��I�����������ע�J���K�L��澼¹���M�N�����O���P�Q�R�����S���T���U�V�W�X���Y�Z���[�\����]��˳��^����ʲ�_�����`�a��b�c�d���e���f���ٹ�֨����Ҧ���g����Ϳ���ʶ�»h�i�j��Ϭ�k�l�m�n���o�p������Ҽq�����r�s�t�����u�v�żw�ļ����ܿx�y�z�{���|�}�~��À����ԁ������������������ǯ�첊�ѹ������������Տ����������唌�啌�������������Զ�˰Ѽ������ʞ�⷟����ɡ����������פ��������Ш��ɩ�������⼫������ɭ��梳���������޲����޳��Ҵ��������޸�������;�����޾��������߳���ġ�����־����ŒӾÌČ�������Ōƌ������njȌɌ��ʌˌ̌��͌ΌόЌ��ь����Ҍ��ӌ����ԌՌ֌׌،ٌڌ����ی��܌݌ތߌ����Ҩ����������������쌬��������������ڸ���ẵ�����������������������@�����A�B�C���D���E���F��ᶰG�H�I�J���K���L���M�N���O�P�Q�R�S�T���U�V�W�X�Y�Z���[�\�]�^�_�`���a�b�c�d�e�f�g���h�i������j��k���l�m���n�o��p�q�r�s�t�u�v�w�x�y���z�{�|�}�~�����၍����糃������������Ɖ���������޴���я��������ᓍ���ᕍ���������ᚍ���ᛍ�����������៍���������ᤍ�����������������ᬍ���������������ﴍ������Ƕ�������������������������Í��čōƍǍȍɍʍˍ͍̍΍��ύ����Ѝэ��ҍӍԍՍ��֍׍؍ٍڍۍ܍ݍލߍ�����������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U���V�W�X�Y�Z�[�\�]�^�_�`�a�b���c�d�e�f�g�h�i���j�k�l�m�n�o�p�q�r�s�t�u�v���w�����x�y��Ѳ�z�{�������޾��|���}�~���ۀ�������Ͱ�����σ���������������ұ�ʼ����˫����ʌ������Ϗ�������������̓������֯���۵�������������������֜�����������ﰡ����࣎���������ᣳ�������ê��������î���������������ϻ����������������ļ�����������Ž��ÎĎ�ᱴŎƎǎȎɎʎˎ͎̎ΎώЎюҎӎɸ����Ԏ��Վ��֎��û����׎���؎َڎ��ێ��ӱ܎ݎ����ގߎ��Ю����⿦�׵�������㎮����Ϸ��������ȶ������펥�����������ʵ������������������������@�A�B����C�D�E�F�G�H�����I�J��K�L�M�N���O�P�Q�R�S�T�U�V�W�X�Y�Z���[���\�]�^�_�`�a�b�c�d���e��Ѣ�f�g���h�i�j��ޥت�����ƪ�k�l�m���n�ױ��o�p�q���r���s���t���u����v�w�ڳx�y�z�ܵ��{�|�}�~����ϡ������偏���像�̈́��ȅ����������������nj��协�����쐏�����������������������������埏鹱����������塏�������ҥ��������Ш��ͩ��Ѫ���ʲ뱬���ŭ����հӯ��ᰏ�����᳏�Ҵ���˱����������ḏ��������ܺ�᲻���ẏ�����н��;�����õ������ÏďŏƏ��Ǐȏɏʏˏ̏��͏��ΏϏ���ЏяҏӏԏՏ��֏µ׏؏ُڏ��ջۏ܏ݏޏߏ����ر��������ɼ��������������ͦ�������������������������������������������������������޷��������������@�A���B�C������D�E���F������G�H���I�����J�K�����L�M�N������й��ֹ��O�P�Q���R�S�T�U�V���W�X�Y�Z�[��ס�\�]���^������_�`�a�b�c�d�e���f�лg�h�ֿi��j�k���l�m�n����o�p���q�r�s�t�ֻ����u�v���޺���㲶�̧�w��ϡ�x�y�ҿz�{��|�������Ģ�}���~��������ǂ��������φ����㷺���������㌐ڻ���㎐������㑐�㒐���ӓ����������ԗ��Ę�����Х㚐�Û��㯱���㝐����¼�����㿵�����������������ǰ㪐�������ͭ���������󻲐�����̵����㷐�㸐�Ϯ㹐��ݻ������������Ҳͳ������Ѳ��߹�����Ϸ�̻ÐĐ����ŐƐǐȐɐ���ʐː̐͐��ΐ����ϐАѐ�����ҐӐԐՐ֐��אِؐڐ��ېܐݐސи��ߐ��߷ᐴ���䐺������������������������������������@�ȴA���B�ŻC���D�E���F�G�H���I�J�K�L�M�N�O���P�Q�R�S���T�U�V�W�ۻ��X�Y�Z�[�\�]�^���_�`�a�b���c���d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v��w�x���y�z�{�|�}���~����������������퇑�����������������㩺�퐑���㒑�������������������㜑�������������������������������Ъ�ð���������������㱑����������������������������������‘ÑđőƑǑȑɑʑˑ̑͑Αϑ��БёґӑԑՑ֑בؑ��ّڑۑܑݑޑ��ߑ���Χ�����ȷ�ɳ������������Ʃ���摪�瑬��葮������ؽ푯�����������������������쿷��������������������Ų��@�A���ǰ���B�C�D���E�F���G�H�I�J�K�L�M�ۿN�O��Ǵ�P����ި��Ѥ�簶���Q�R��S�T���U�V���W�X��Y���г��Z�[�\���]�^�_�`��Ѱa�b�c�d�e�f����ʥ�g��Ͷ�����h�����i�j�k���ٿ���l�����m�n���o�p��ŧ�q�r�s�t���u�v�w�ֵx�y�z���{��޺��|���}�~������֣����ĭ��ށ������չ��ܾ��ΰ������о������ݰ�����ć�����𼉒�ӹ��Ŧ��Ԋ���������Ռ������ȩˎ��޽����������Ƨװ��ē�ֳҹ����������괰��������濜����̞��������͢��������¥��΢̮��IJ���շ�ӻ����������촩������լ����ꮒ�����������ަʹ����Ͷ����������޺��ͦ������׽���ư������达���������’ÒĒŒƒǒȒɒ���ʒ񼻻��˒̒͒��Β��ϒВђ��ݾҒӒ��ԒՒ֒ג��ݽْؒ����ڒےܒݒ��ޒ�ߒ���޶�������������������蒴�������������̸��ӽ�ؿ�������������������������֧������������@�A�B���C���D�E���F�G�H���������I��J�K�L���M�N�O�P�Q�R�S���T�����U���V�W�X�Y�Z�����[�\�ҽ]�^�_�`���a���b���c���d�e�f�g���h����鸧�i�j���k�l�m�n�o����p�q�����r�s�괦�t�u�v�w�x�y�����z��{����|�}�~����ށ������̄��������������勓���������А���벒��듓�ޔ�������ڰ������̗��������������ޞ��˟������բ����������ާ���������������ݴ���İ������޳��������������������áġ߽���������“Ó�ē���œ��ƓǓȓɓʓ˓͓̓Γų��ϓГ���ѓғ��ӓԓՓ֓��דؓٓړۓ��ܓݓޓߓ����ǥ��⓫�������瓢ߣ�蓥�铳���쓦��������������ٲ����������������ߢ���@�A�B���C�D�E���F���G���H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`���a�b�c�d�e�f�g�h���i�j�k�l�m�n�o�p���q�r�s�t�u���v�w�x�y�z�{�|�}�~��������߃���������𾈔���ߧ֊�����������ʎ���ĸ��������ŷ�Ւ���������ʹ���������е�����Ý�Ⱦ�������뽰����̽������ֱ��������Ҹ�ɨ���ض���������봾�������ʱ��Dz��ճ���󷵔������������������������”Ô��ĔŔƔ���ǔȔɔ��߰ʔ��˔͔̔��Δ�ϔ����Дє��Ҕ��ӔԔ��Ք��֔��ה��ؔ϶ٔ����ڔ۔ܔݔޔߔ�ᔽ��㔶�������甹���·�����к�씻�������������������������ȼ�����ȩ�ɾ����������и��굺@�A�B�C����D�E���F�G�H�I�J���K�����L�M���N�O�P���Q���R����S�T�U����ο�V�W�X���Y�Z�[���\��г�]�^�_�`���a�����b�c�d�e���f���g���h�i�������j�k�l�m�n���o���p�q���r�λs�t�u�v�w�x�y�����z�{���|�}������������~����́��������ꅕ�ꆕ���Έ�޻���������������ư��Ώ������ǒ����ꓕ���֕��������������ԛ��꜕���Ϟ��������ꢕ�������ʦ��������ŵ������������ꯕ����������������������������Ľ�����������•Õĕŕ��ƕǕȕɕ��ʕ˕͕̕ΕϕЕѕҕӕԕՕ֕וٕؕڕەܕݕޕߕ������������������������������������Ƿ��������ܲ������������������@�A�B�C���������D���E�F���G�H�I�����J��K�L�M���N���O���P�Q�R�S�T�U���V���W��Ωľ���X���Y���Z�[����\�]�^�_���`�a���b�c���d��Ԩ�e�f�˸g����h�i���j����IJ�k���l�m���n�o�p�q�r�Ŷs����ܸ��t�u�v���w�x��ѿ���y�z���{���ܽ|�����}���~��耖�������脖��尅��������������芖�͋��茖�������ΐ��������Ք���蕖�Ö������藖�������Ԛ��蛖���蜖��㷝��螖ݿ�蟖���衖��ܼϼ�袖���������������誖����������������������ذ��̸�ƾ��ȵ����������踖���׹��ĺ��軖��鲽����������–Ö¿���Ė���ŖƖǖȖɖʖ˖̖��͖����ΖϖЖі��Җ걻����谶��Ӗ��Ԗ��Ֆ��֖ז���ٖؖږۖܖ��ݖޖߖ����������������������������˺��������������������������������ͣ����۽������������@�A�B�C������赵�������谽��D���E�F�G�H�I�J�K�L���M����N�O�P�Q�R�S�T�U�V���W���X����Y�Z�[�\�]�^�_�`���a�b�c���d�e�f���g�h�i�j�k�l�m�n�o�p���q�r�s������t�u�v�w���x��̵�y�z���{���|�}�~���������������켇��舗�����������Î��Ə���������������ז��������ř����������̞����頗�������������������ɪ���������ÿ��������׹���貗�������鶗�����ҹ����������龗�ֵ׿�������—×ėŗƗǗȗɗʗ˗̗���͗Ηϗ��Зїҗӗԗ՗֗ח��ؗٗ��ڗۗܗ��ݗޗߗ����㗪�䗻��旫����������������������������������������@�A���B�C���D�E�F�G���H�I���J�K���L�M�N�O�P������Q�R���S�T�U���V�ŸW���X��Ӵ���Y�Z�[���\�]�^�_�`�a����b�c���d�e����f�g�h�i�j�k�l�m�n�o����p�q���r���s�t�u���v�w��x�y���z�{�|���}�~��������郘���������������鋘�錘�鍘���������鑘���������������������隘�����������������������馘�������骘������������������۲���鵘��������������������������˜ØĘŘƘǘȘɘʘ����˘̘͘ΘϘИ��ј��ҘӘԘ՘֘ט��ؘ�٘ژۘܘ��ݘ��ޘߘ������������������������������������������������ȳ����@�A�B�C�D���E�F�G���H�I�J�K�L�M�N�O�P�Q�R���S�T�U�V�W�X�Y���Z�[���\�]�^���_�`�a���b�c�d�e�f�g�h�i�j���k�����l�m�n�o�p���q�r�s�t�u�v�w�x���y�z�{�|�}�~������邙���Ã�����������������������������������������������������������������������������������������������������������������������������™ÙęřƙǙșəʙ˙̙͙ΙϙЙљҙәԙՙ֙יؙٙڙۙܙݙޙߙ�����������������������δ���У������������������@�A�B���C�D�E�F���G�����H�I�J��K�L�M�N���O�P����Q���R�S��T�U�V�W�X�Y�Z�[�\�]�^�_���`�a�b�c�d�e�f�g����˴������h�i���j�k�l�m�n�o�p�q�r�s�t�u�v�w���x���߼y�z�{�|���������}�����~�����в���遚���������酚���և��������銚���������鏚���������������闚�����������������ζ���Ҡ��������������ٻ�쨚���Ҫ����������ί��İ��ñ�������ȱϱѱ�ų�б���õ����������պ�����������������šÚĚ��Śƚǚ��Ț��ɚʚ˚��͚̚Κ��ϚКњҚӚԚ՚����֚ךؚٚښ��ۚ�ʵ���ܚ��ƭ���ݚ����շޚߚ��ᚱ���⚳�㚤��ѱ������暪�����皵�蚮��������������ͭ������������������������������������@�A������ȯ���س��B�C���D�E�F�������G�H�I�J�K���L���M���N���O�P���Q�R�S���ڷT�U�������V�����W����X�Y���Z�[�����\�]�����^�_�`�a���b���c�d�e���f���g���Ť���ײh��㦻��i���ھj�k����Ӻl�m�n�o�з��p����������q�r�s�t����u�v�w��ȴ�x���y�z�{���|�}����㨷����~������������ń����Ũ��ƅ��Ć����׈��㉛�������㋛�ӌ�ñ�����㍛�������㎛��ཐ����䒛���䔛�����ѣ䗛�䘛�����ț��������ϟ����� �����������������򽨛�䩛��麪䫛���䭛�����ֲ䯛�䰛�����䳛��͢��Ŵ��������䷛�Ǭ����丛��ⲹ���ü�些뻰�ű仛�������գ���������›Û��ěś��ƛǛƺ�țɛʛ����˛̛͛Λ��ϛЛ����ћқӛ��ԛ՛֛כ؛��ٛڛ��ۛܛ����ݛޛ��ߛ���ᛳ�⛸���������������������ӵ��ȧ��լɢ������������𛭺��Ժ�������������������Ͽ��������@�A�B�C���D�E�F�G���H�����I�J�K����L��䭵M�N���O���P�Q�R�S����T���U�V���W���X�Y�Z��[���\��̵�]�^�_�`�a�b�c�d���e�f�g�h���i�������j�����k�l���m����n�o���p�q���r�s���ɶt��Գ���u�v�w���x���y���z�۸{�|���}�ʿ~������ӂ��Ã������������������䋜�����������������䓜���������䗜�����ϙ����՛������䞜���������������������䩜���䫜�����������������������������ͪʺ������������侜��ȸ����œÜĜ���ŜƜǜȜɜʜ˜��̜͜Μ�ϜМ��ќҜ��ӜԜ��՜��֜ל��؜ٜڜۜ��ܜ����ݜ��ޜ����ߜ��������������������������������������������������������������������������@�A�B�C�εD�E�F�G���H�I�J�K�L�M�N�O���P�Q�R���S�T���U�V�W�X�Y���Z�[�\������]�^�_�`�a�b�c�d�e�f���g�h�i���j�k�l�m������n���o���p���q���r�s���t�u�v�w�x�y�z���{�|�}�~����������䃝�����䆝�·��������������������ő������ǔ��•������䘝������������������̱��������䤝�䥝�����䨝�䩝�䪝������������γ���������䴝������Ŷ�������������������������ÝĝŝƝ��ǝȝɝʝ˝��̝͝ΝϝНѝҝӝԝ՝֝İם؝��ٝڝ��۝ܝݝޝߝ��ᝥ������睡�����������������������������������@�A�B�C�D�E�F�G����H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h���i�j�k�l�m�n�o�p����q�r�s�t�u�v�w���x�y�z�{�|�}�~����������������������办�����卞����������������������������������๟����塞���������������������������寞��������������������������û�Ƶһ������������ľ��žÞ��Ğ��Ӳ��ŞƞǞȞ��ɞʞ˞�¶�̞͞Ξ��ϞОў��Ҟ�Ȼ���ӞԞ��՞֞���מ؞ٞڞ۞ܞݞޞߞ������澿��ż�����������������������������������������������������������@�A�B���C�D�E�F���G��������H������I���J�K�L�M�N�O�P���Q���R�S�T��U�V�W�X�Y�Z�[�\�]�^�_��Ѹ�`�a�b�c�d���e�f���g�����h��캱ٷi�j�k�l�m�n�o�p�q�r�s���t�u�v�w�x�y�z�{�������|�}�~����ȁ����������������������������쏟�������쓟ͻ��引��������������������������좟�ɣ����������è������쩟���������֮��������챟�������쵟�춟���ɸ������������Ͼ�������Ÿ��ßğşƟ��ǟȟɟʟ��˟̟͟���ΟϟПџҟ����ӟԟ՟֟ן؟ٟ��ڟ۟ܟ��ݟޟߟ��������������������������������������������������@�A�B�C�D�E�F�G�H�I���J�K�L�M���N���O�P�Q�R�S�T���U�V�W�X�Y�Z�[�\�]�^���_�`�a�b�c�d�e�f�g�h�i�j���k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������삠�������������������쌠�׍��Ŏ������뮰���������ְ�����ؕ��˖��㗠��������������氞������Ź론�������률�����먠���Ѫ��ū��ꬠ�ĭ������������ı��β����������궠���ɸ����Ǻ�������ν��������������� àĠŠƠ����Ǡ��Ƞ��ɠʠ��ˠ̠͠ΠϠРѠҠӠԠՠ֠��נؠ٠ڠ۠ܠݠޠߠ��⠮���㠸��������破�������������������ҵ��񠷱�����������������������Ѿ����@�A���B�ݺƽC�D�E�F�G�H����I�J����Ϩ�������K�L����M�����N�O�P�Q���R���S�T�U�V�W�X���Y�Z�[��\�]�^�_���`�����a�b�c���²���d�e����f�g���h�i�j����֨ì�k���l�m���n�o��p�q�����r�s�t�u�����v�w�x�y�z�{�|�}�~����������K���↪�釪�������⋪���������������⓪����������������������̞��⟪��@�A�B�C�D�E�F�G�H�I�J�K���L�M�N�O�P���Q�R���S���T���U�V���W�X���Y�Z�[�\���]�^�_�`���a�b�c���d�e���f�g�h�i�j�k���l���m�n��緻��o����p�q�r���s�t��磲u�v�w�x���y���z�{�|�}�~�����ɀ����Ղ��穷�烫�������������犫�������玫�֏��������瓫�甫�畫����ఘ��������眫��������@�A�B�C�D�E�F�G�H�I�J���K���L�M����N�O�P�Q����R�S�T�U�V�W�X�Y�Z����[�\�]�^�_�`���a�b����c���d���e���f���g���h�i�������j�k�l�m�n���o�p�q�r���s�t�u�v�w�x�y�z�{�|�}�~����������������臬�般����艬�ȪɊ��������������������������藬��幙����������Ѩ螬����@�A�B���C����D���E�F�G���H�I�J���K�L���M���N�O�P�Q�R�S�T�U�V�W�X���Y���Z�[�\�]�^�_�`�a�����b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q���r�s�t�u�v�w�x�y�z�{�|�}�~����������������������芭����������������Ϲ���𔭭𕭰�갿Ȗ��͗��������������αꞭ����@���A���ɴB�C�D�E�F�G�H���I�J�K�L���M�N�O�P�Q�R�S�T���U���V���W���X�Y�Z�[�ʸ���\���]�^���_�`�a�b�c���d�e��Ӧ�f�����±g�������׼��h��i����j��k�l���m���n�o�p�q���r�s���t�u����v����w�x�y�z���{�|�}�~���۳��Ѐ������������������ƈ����������������������볓�����������������目�����������@�A�B���C�D�E���F�����G���H����I��ξJ�K���L�������M���̰�N�O�P�Q�R�����S�������������ôT�U�����V�W���Ҿ��X�Y�Z�������[��ָӷ���\�]���^�_�`�a���b���ۺ��c���d�e���f�g���h�i�j�������k�������l�����m�n�o�p�����q�r�ճs�t�u�v�Աw�x���y�z�����{���|���}�~�����������������������񌯍����Τ񏯣�����ʑ�����̓��񔯕��񖯗����թ񘯙��Ț������񝯫��񞯟���@�A�B�C�D�E�F�����G�H�I�J�K�L���M���N�O�P�Q�R���S���T�U�V�W���X�Y�Z�[�\�]�^���_�`�a���b�c�d�e�f�g�h�i��j�k�ǵl�װٰm�n�o���p�ĵq�Խʻ��r�s�޸t�u���v�w���x���y�z���{�|���}�~�����������������������������������Ƒ��������񔰕������������������Þ����Ӡ�@�����A���B���C�D�������кE���F�Ǹ����G�H���I�J�K���L�M�N�O�P���Q�R�S�T�U�V�W�X��Ģ�Y����Z���[�\�]�����^�_���`�ܶa�b���c�d���e�f������g���h���i�j�k�l�m�n�o�p�q�r�s�����t�u�v�w�����x���y�z�{���|��գ�}�~����큱�Â�������������퇱�̈��щ�������Ռ��퍱�����퐱����������������혱������������������@�A�B�C��ˡD����E���F�G�޽DzH�I�J�K�L�M�N�O�P�Q�R�S�öT�U�V���أ��W�X�Y����Z�[�\�]�^�_�����`�a����b�c�d�e�f�g�h�i�j�k�l�m����n���o�p���q���r���ɵs���t�u�v���w�x���y���z�{�|�}�~��Հ������������������������������ۏ����������������������������񛲜����������Ҡ���@���A�ؾB�ý��̶��C�D�E�F���G�H���I���J�K�L�M��ί����°�N�O�P�Q�R�S���T�U��Ƴ�V�W�X����Y���Z��׺��[���\����]���^�_�`���a�������b���c�d����e�f���g�h�i���j�k������������l���m���n�o�p�q��r���s�t�u�v���w���x���y���z�{�������|�}�~������ς�����������������������������Ȏ���������������6��������Ś�������������@�A�B���C��D�E��­���F�G���H���I�J�K����L�������M�N���O���P���Q���R�̱S�T�U�V�W�X�Y�Z��������[�\�]�^���_�`�a�b���c�d�Ŵe�f�g���h�i�j�����k�l�m�n���o�p�q���Ŀr�s�t���u�v�w�x�y�z�{�|�}�~����������Ą������퇴���������팴�퍴�������ǻ���������������������횴������������@�A�B�C�D�E���F�G�H�I�J�K�L�M�N�O���P�Q�R�S�T���U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c���d�e�f�g�h������i���j�����k�l�m�n���o�����p�q�r�s�t�u�v�w�x���y�z�����{�|��������������}���~����ρ���Ƃ������������쇵�������������������쏵�����������������억�������욵��������������@�A�B�C�D�E�F���G�H�I�J�K�L�M�N�O�P�Q�R���S�T�U�V�W�X�Y�Z�[�\�]���^�_�`�a�b��Ӯ��c���̺d��н�e���f�g�Ѹh�i���j���k���l�m�n�ƿ��o�p���q�r���s�t�u�v�w�x���y�z�{���ӳ|�����}���~�����Ƴ��������������ս�����ҋ�໌����ώ������������̳���ɰ˖������������ް�����֟���@���A��B�C��D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R���S�T�U���V���W���ڼ��X��Y�Z�[�\�]�^���_�`�a�b�c�d�e�f�g�h���i�j�k�l�m���n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������ъ����Ƕ��տ������������͏��ǭՐ��񑷺񒷓������ǖ��������֙�����ѽ����������ܴ�Ξ�߿�񟷠�@�A�����B���C�D�E����F�G�H�I�J���K�L�M�N�O�P�Q�R�S�T�U���V�W�X�Y�Z�[�\�]�^�_�`���a�b�c�d�e�f�g�h�i�j���k�l���m�n�o�p�������q�r���s��͵�t�u�v�w�x�y�߽z�˶{�|�}�~��������������󅸆���͸����������ʰ�������ˎ������󑸦В���ʱ�󔸕�����ѵ�������󛸜����������������ڵ����@�A���B���C�D�E�F���G��H���I���J�K�L�M�N�O���P���Q�ȵR����S�T����ֲ�U��V�߲W���X����Y���Z�[���\���]�^�_�`�a�b�c�d�e�f�g���h�i�����j�k���l��m��n���o�p���q��r�s�t�u���v�w�x�y�z�{�|���}�~��󀹁����������˄����������󈹉���ܹ�󋹌�����������������������ϑ����󓹔����󖹗��������������󞹟���@��ת�A�B�C�D���E�F�G�H���I���J�K�L�M�N�ݸ��O�P���Q�R�S�۴T�U�V����W�X�Y���Z�[�\���]�^��_�`�a�b�c���d�e�f�g���h���i�j�k�l�m�n�o�p�شq�r�s����t�u���v�w�x�y�z�{���|�}�~������������􅺆�����������ɻ�����􍺎���������������������������������������@�A�B�C�D�E�F�G�H�I���J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�����o�p�q�r�s�t������u�v�w�x�y�z�{�|�}�~���۷��������������������Ɗ�ִ�Ջ������������ˎ�������֑�������෕������������������������ⴟ�������@�A���B�C�D���E�����F���G�����H�I�J�K�L�M�N������O�ڲP�Q���R�S��Է�T�U�V�W�X�Y�Z���[�\�]�^�_�`���a�b�c�d�e�f�g�h���i�j���k�l�m�n�o�p�q�r�s�t�u�v�w�x���y�z�{�|�}�~��������������������������������ˏ��ː�������������ח��������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v���w�x�y�z�{�|�}�~��􀽁���������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L���M�N�O�P�Q�R�S���T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������􋿌�����������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c���d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{���|�}�~����������Զ����ͼ�ȳΡ������ٸ�ā�����׷����ķ�����ţ��Ϥ������ɸϯ��֧�������ҭ������Ὣ��Ȅ������ѭ����ʽ�ͮ����Ѕ�����̼�稼�б��в��´���ɬ��÷�������պ��º׻���������穼������ж�����纻޵�������翸����췊���������������������������������������ɽ���׸���ȍ����������������������������������޹�͟����ر�@��·�A���B�C�D�E���F���հG�H�I�J�K�������L�M�N���O�P�����Q���R�S�T�U���V�W�X�Y���Z�[���\�]�^�_�`�a�b�c���d���e���f�g�h�i�j��k�l�m�n�o��p�q�������r���s�t���u�v���w�x�y�z�{�|�}�����~��������������������Ӈ����Ή�����᳌����������ґ����������������Ǚ�����������Ե����@�����A�B���C�D�E�F���G²���H���I�J�K�L�M�N�O­���P�Q�R«��S¼�������T�U�V�W����X�Y���Z���[�����ĺ��Ұ\�]���^�_�`���a���b�c�������������d�e�f�g�h�i���j��k��������l�m�ܳn¢�o¢�p�q����r�s��t�u�v�������w�x�y�z��{ª�|�}�~¸ƀ�۾�‚ƒ„…†‡ˆ‰Š‹ŒŽ��ϴ�‘’“”��–—˜™š›œžŸ �@ò��A�B�����C����D���E����F�G�H�I�J�K��L�Mä�N���O�Ƕظ��θPÿ릳ɹ��Q��ʷR�S�T�缾���U��빰ϿV����W���X�Y���Z�[�η\���������ղ������]è�^�_�`�a�bó����c�d�e�f�g�h�i�����j����������k�l��m�n÷���o��������������p�����������qú�r���s÷�t�����u�v�w�xì�y�z�{��|�}�¹�~À��������������فñ������Ž�ÅÆ���ÈÉÊËÌÍÎÏÐÑÒÓ���Õì�������ØÙ���ó��ÜÝÞßâƠ�@�A�B�C�D�E���F���Gİ�����H�I�Jį���K������L�M�N�����O�P�Q�R�S���T�U�V�W���X���Y���Z�[�\����]����^�_���`�a�b�cĹ��������������d��e�f�g�h�i��jIJ�k�l�m�n��o��p�q�r�s�t�u��v�w��̤ĥ�x�y�z�{�|��}�~Ģ���Ł��㥹ĆćĈĉ��ɊċČčĎď����đĒē��͡�۱�Ӕĕ��ҖėĘ����ěĜĝĞğĠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�Nż�O�P�QŰ�R�S���Tū��U�V�W�X�Y����Z�[�\�]�^�_���ʾ`ŧ�aŨҨ��bŪ�˾��c�d�e�f�g�����h�i���j���k���l�m�n�o�p�qŶ��r�����sŭ���t�u�v�wŲ�xŽ���㰰�yű�ղzŶ��涰��ϴ�{ŵ�|�}Ÿ�~ŀŁłŃŹ�Ņŧ͆ź�Ż�ʼnŊż�ŌōŎŏŐőŒ��˓Ž�ŕŖŗž�řŚśŜŝŞşſ��@�A�B�C����Dƫ����E�F�G�HƳ���I�Jƴܬ���K�L�ڽMƹ�N�O�P���QƷ���R��ɺܶ�Sƻܢ�T�U�V�WƼ��ܽ�X�Y��Υ�Z���[���\�]���潫�^Ƹ����ܾ�ҷŰ�ܾ�ܨ�_Ƽ���`�a��ܿ���b�c�dƿ��e�f���g�h���i�jƭ���k�������Բ����lƷ����ܦ���m�����n�o����p��������q��������r�s�t�uƻ�v�w�xƽ�yƢ�z�{���|�}���~ƻƀ��܁ƂƃƄƅ��ׯö��ǩ��������܆Ƈ��܈ƥ��܉��܊Ƌ����܌�܍Ǝ��ܢ��܏ƐƑƒƓƔƕƖƗƘ��Ĵ�ƚƣ��ܛ��ܜ��ܝ������貞�����ܟ��ܠ�@�A��B�C��D�Eǣ���F�ݲG�H�I�J�K������ĻL��M�N�O�P�Q�Լ����R����ܴ�S�����ܫӡݣݥ��Ҥݦݧݩ�T�U�V�W�X�Y�Z�ɺ��[�\Ƕݱݴ�]�^�_�`�a�b�cǰ���d�e��f�g�h�iǯ�j�k�l��ܮ�m�n�o�pǷ�q�r��ܯ�sǸ�tǬ�u�v�w�x�y�z�{ǹݳݭݪ�|�}�~ǀǨݳ����ݫ݁Dz��ݨӺ݂ǻݧÃDŽ��ݼ݅džLJ��݈ǽ��NJ�վ����Ǎ�ʺ�ǏǐǑ��ݒ��ݓǿݔǕǖ�˲�ݗ��ݤ��ݘǙǚǾݛǜǝ����ݞǟǠ�@�A����ƷB�C�D�E�F�����G�H�I���J�K�LȽ�M�����N���O�P�Q�R����üƮ���S���T�U�V�W�X�Y��Z�[�\�����]�^�_�`�a�bȩӪ������c�d�e�f�g�h�i�j���k�l�m�n�o�p���q�r�s�����t�u�v�w�x�y�z�{���|�}�~ȀȁȂȃȄȅȆ��݇ȈȉȊȋ�֌�������ݍȎȏȐ��Ƒȭ��ȓȔȕȖ��ݗ�����ݘșȚ�д���ݜ���ݝ��ݞ��ݟȠ�@�A�B�C�D�ٵE�F�G�H�������Iɯ���J���K�L�M�N�O�P�Q�R��S���T�U���V�W�X�Y���Z�[�\�]�^�_�`�a�b�c�d�e�f���g�h���i���j�k�l�������m�n���o���p���q�r���s�t�u�v�����w�x���y�z�����{���|�}�ͱ~ɀɁɂɃɄɶ��ɻ��݆ɇ�݈���݉ɊɋɌɍ��Ŏɏɐ�ݑɒɓɔɕɖɗɘəɚɛɤޜɝɣޞɟɠ�@�A�B�C�D�E�F�G�H��I�J�K�L���M��N�O�P���Q�Rʵ�S�T�U�V��W�̲X�Y�Z�[�\�]�^�_�`�����a�b�c�d�e�f�g�h�i�jʾ���ݢު�αk�l�m�n�oʬ�p�q�r�sʦ޶���t�u�v�w�x�y�z�{�|�}�~ʡހʁʥނʃʄʅʩކʇʈʉʊʨދʌʍʧގʏʐʑʒʓʔʕʖʭޗ��Ԙʙʚʛʳުޮޜʝ���ʟʠ�@�Aˡ���B˱�C�D�E�F�G�H�I˲�J�K�L�M�N�O�P�Q�R�S�T˦ѵ�U�V�W�X�Y�Z�[˯�\�]�^˰�_˽�`�a�b˴��ʹ�c�d�e�f�g�h˸�i˷�j�k�l�m�n�o�p˻�q�r�s�t�u�v�w��x�y�z�{�|�ز��}�~˺ހ˺Ł˂˃˄˅ˆ˼އˈˉˊˋˌˍ��̎ˏːˑ˪��˓˔˕˖˗˘˙˚˛˜˝˞˟ˠ�@�A���B�C�D̽�E�F�G�H�I̿�J�K�L�M�N�O�P�Q�R�S�T̢�U�V�W�X��Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h̾�i��j�k�l�m�n�o�p�q�r�s�t�u�v�w̺�x�y�z���{�|�}�~̮̀́̂̃̄̅̆̇̈̉̊̋򢻲°��Œ̯̍�̏̐̑̒��Г̔̕��Ӗ̗̘̽�̛̜̝̞̟̠̚�泰�@ͱ�A�Bͭ�C�D�E�F�G�H�I�纳����˺ϲ������J�K�L�M�N�O�P��θ��Q�R�S�T�U;�V�ϲW�X�Y�Z�[�\�Ѻ�]�^�_�`�aͼ���b�cͻ����d͹�e�f�������g�h������i�j�k���l�m�n�o�p��q�r�s��t����u���ƹ��v�w���������x�y�׻z�{�|�����}���~̀�����͂̓̈́��͇͈͆���͊͋���Œ�����������͎͏���Ӑ͓͑͒�궔��ʕ����͗͘���������͚���͜͝͞�������͠��Ω�@���A���B���C�Dί�����E���F�G�H���I�J�K�L���M�N���O�P���Q�R���S�T�U���V�W�����X�Y�Z�[�\�]�^ά���_�`���aΫ�b�c�d�e��f�g�h�Ȼi��j�k�l�m�n�o���p�q����r�s�t�u�v�w�x�y���z���{�|�}��~���΁΂΃��������΅Ά����Σ�Ή΢�΋�����ȍΎΏΐΑ��ΓΔΥ�ΖΗΘΙΚΛ�ÜΝΞΟΠ�@�A�B��C�Dϧ���E��F�G�Hϫ�IϪ�J�K�L�M���N�OϮ�P�Qϰ�R�S�T�U�Vϡ�W�X�Yϱ��Z�[�\�]�^ϯ���_�`�a�b�c�d�eϲ�f�g�h�iϴ�j�k�l�mϨ�n�o�p�qϳ�r�s�tϵ�u�v�w�x�y�z�{�|�}�~ϷЀρςσϸ�υφχ�وωϊϋόύϹ�ϏϐϑϒϓϔϕϷ���ȶ�ϘϙϚϺ�ϜϝϞϟϻ��@�A�B�C�D�E�F�G�H�I�J�K�L�M���N�O�P�Q�R�Sм�T�Uн�V�W�XЪ�Y�Z�[Ь���\�]�^�_�`�a�����b�c�d�e�f�g���h�i�ֽj���k�l�m�n�o�p�q��������r�s����t��iju���vХ�w���x�y�z�{���|�}�~ЀЁ������Ь�������Ѕ���Ї�����ʼnЊЋЌл̍ЎЏ��АБВГД��͕ЖЗИЙ�����ٛМНОПРл�@Ѯ�A�B�CѤ�D�E�F�G�H���I�J�K�L���M�N�O�P�ò�Q�RѰ���S�T���U�V�W�X���Y�Z�[��\��ң�]�^����_�`�a�b�c���d�e��������f�g���h�i�j�k�l�m�n�����o�����p�q�r����s�t���u���v�w�x�ӹy�z�{�|�}�~р���туфх�ֺ�����шщъы�������эюяѐ���ђѓ��Ȕѕії�����љњћѽ�ѝў�������@�A�B�C�D�E�F�G�H���I�J���K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c����d�e�f�g�h�i���j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}���~Ҁҁ�΂Ҫ҃��҅Ҳ��҇҈҉ҊҋҌҍҎҏҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^��۹_����������������`���������ǽa�b�c��d�e�f��g��h��i�j�k�l��mӡ���n�o�p�qӢ�r�s�tӣ�u�v�wӲ�x�y�z�{�|�}�~ӀӁӂӃӄ��хӆӇӈӉӊ��ًӌӍӎӏӐӑӒӓӔӕӖӗӘәӚӛӜӝӞӟӠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_Ԥ�`�a�b�c�d�e�f�g�hԺ�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ԀԁԂԃԄԅԆԇԈԉԊԋԌԍԎԏԐԑԒԓԔԕԖԗԘԙԲ՚ԛԜԝԞԟԠ�@�A�B�C�D�E�F�G����H�I�J�K�L�M�N�O���P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖ՗՘ՙ՚՛՜՝՞՟ՠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b��c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~րց֥��փքօֆևֈ։֊֋֌֍֎֏֐֑֖֛֚֒֓֔֕֗֘֙֜֝֞֟֠�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_ׯ�`�a�b�c�dש�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~׀ׁׂ׃ׅׄ׆ׇ׈׉׊׋׌׍׎׏אבגדהוזחטץ�Ƽ�����ȥ��ڧ����Ȩ�ƙ׵��Ҷ�Ǽ�ײ�仩ڪ��ѫ�����›������÷���֬ڭ���׶ʜש����ծ���ʴ�گڝ��ұڲڳ��ʴګʵڶ�ϳ�ַڰ����ڹ���Һ�ø��ﲻڼڞ�����ӽ��ξ���廿ڵ��������ڵ����̷ο���ڭ����������ڸ̟��ұ����ѻ�ڳ����ڽ�������������������ڠ������ڻХ���ګ����������÷����ھ������ڴ�����ȹ@�A�B�C�D�E�F�G�H��I�J�K�Lع���M��N�O���P�Q�R�S�T�U�V�Wع�X�Y�Z�[���\�]�^�_�`�a��Ͽ�b�c�d�e�f�g�h����i�j�k�l�m�n�o���p�q�r�s���t�u�v�w�x�y�z��{�|��}�~؀�Ѻ���زÂ؃؄؅؆؇؈���؊؋���؍؎؏ؘؙؚؐؑؒؓؔؕؖؗ؛؜؝؞؟ؠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ـفقكلمنهوىيًٌٍَُِّْٕٖٜٟٓٔٗ٘ٙٚٛٝٞ٠�@�A�B�C�D�E�F�G�H�I�J�K�L�M�Nڴ��պ�Oڱ�Ʋ����ܰ����ַ��̶�ᱺ���ṡ�������������ѷغ������ּ߻��������������������ɳ�Ķ������ʹP�Q�������Rڸ�����������S���ɮ�Ӹ�T����U�V�W�պX��Y�Z���[�\�����ϸ��]�^�_�`�a�b�c�d�e�óf�g���h�i�j�kڽ��l�m�n�o�p���q�r���s�t�u�v�w�x�y�z�{�|���}�~ڀڤȁڂڃڄڅچڇڈډڊڋڌڍ����׿���ڐڻ��������ں���ڕږھ������ڙښڛ�ϰ���������Şڟڠ�@���A�B���C�����D�E�F���G�H�I��J���K�L۷�M�N�O��P��Q������R��S�T�U�V�W�X�Y۽�Z�[�\����]��^�_ۤ�`�a�b�c��d�e�f�g�h�i�j�k����l�m����n�o�p�q�r�Ȳ��s��t���u��v�w�x��y�z�{���|�}��~ۀ������̂ۃۿ帵��̄ۅۆۇۈ���ۊۋیۍێ۾��ېۑےۓ۔ەۖۗۘۙۚ�ı�ۜۿ��۞�ŵ䲟����׶@��A��B�C�D�E�F��G�H�ڴI���J�K�L��M��N�O�P�Q�R�S�T���U�V�W��X�Y�Z�[�\�]�^��_��`�a�b�c�d�e�f�g�h�i�j�k��ɪ�l�m��n�o��p�q�r�s�t�u�v���w�x�y�z�{�|�}�~܀܁܂܃܄܅܆܇܈܉܊ܦ�܌܍܎܏ܐܑܒܓܔܕܖܗܘܙܚܛܜܝܞܟܠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~݂݄݆݈݀݁݃݅݇݉݊݋݌ݍݎݏݐݑݒݓݔݕݖݗݘݙݚݛݜݝݞݟݠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`޵�����a����������������������������������νb���Ͻ�騸���鲱Ի����cޡ�����d�����ԽϷդ��ե�м�e�Ǵٱf�g�hޱ�i�j�k�l���m��n�o�p�q޽���r�s�t�u��v�w�߱x�y�z���{�|ި���}�Ƹ�~���€ށނރބޭӅ�������嵷��ވ޹��Չ���ԥά�ٳ�ދ�̌������������ϵ�Ǝ�����ʐޑ���ޓޔ���ű���ޖޗ޷טޙ��������������Ěޛޡѷ������޸�����ݵ�޾͟��庶��@ߨ��A���ѳ�������B�C�D���E�F�G�H�I�J�����K�L�M�N�O�����P���Q�R���ƱS���T�U�ݶ��V���W�X��Y�Z�[�\�]��^��������_�`�a�����b�c���d�e�f�g�h�i����jߣ�k�l���m�n�o�p�����q�r�s�t�u�����v�w�x�y�z�{�|���}�ܱ��~�����߁߂߃���߅���߇߈߉ߊ��ҋ�˵�����ڎ�ڏ�ڐ�ڑߒߓ�����Ĕߕ�ߗߘ߰Й�ښ��Ӫ����Ǜ�����ڜߡ������ߞߥ۟ߠ���@�A�ۤ�B��C�D༽E�F�G���ۦۣ�H��I�J�K��L�M�N�۬�ºO�P�Qि��R�S�T���Կ�U�V��W�X��Y�Z�[�\໳]�^�_঵`�a�b�c༶��d�e�f�g��h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�ɱ|�}�~��ہ���۵ۄ�����������ۏ�ې�������ۗ���������۠�@��A�B������������C�ƾD�E�F�G���H�I�ӷJ�K��Ԫ�L�M���������N�O�P��Q��R�ͥ�������S�ͽ����˪�T�U�V�����W�X�Y�Z�[�\ἴ]���^�״����_�`�����a�b�c�d�e�f�g��é�h�i�j�k�l�m���n�o�p�q�r�s�t�u�����v�w�x�y���z�{�|�}�~������������ɲ�����ʌ���ְҿ�������������᪸����������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������@�A�B�C�D�E��F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^��_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s��t�u�v�w�x�y�z�{�|�}�~������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b��c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������@�A�B�C�D�E�F�G��H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N��O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z��{�|�}�~�����������������������������դ��������������谷����������Ƹ������۶�����ĵ�ָ���������γ�����������������������������������ؼ����̬����ǭØ�����������������������������������������������������ã��½�������Ҩ�֩��ƞ������ˮ��������б��淿г������̶������ջ��ü���������¸����@���������臨���������A���������������Ͷ��B�����ƶ����C���������D����E����������������F���������G��ﵾ������H�������������������������I���������J�K���L�M�N�O�P�Q�R�S餳T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[��������\�ձ�γ���������������â�����������]꧷�Һ��������^���������������������_�������`�����a그��b�Ӷc�����d�e�f�g�h�i�j���k�l�m���n�o���������׽p�q�r�s�������tꢰ��u���v꽸ʼ�¤�³��w�°ĵ�x�y���z�{�|�����}�~����ݱ�����چ긶�ԇ�����������Ŋ��ڋ������ڐ�������ϑ��������������ӡž��ڟ����@���A����B�C�D��E�F��گ���G�H���I�J�K�L�M�N�O�P�Q�R���S�T�U�V�W�X�Y�Z���[�\���]�^�_�`�a�b�����c����d�e����ѯ�͹f���g�h�ƴ�����i�j��k�l��m�n�o�p�q�r�s�t�u�v��w�x�y�z�{�|�}��ӧ���~��������������뢱������΍��Ы����ϐ��լ��Ñ�����������ė���������˞�ϟ��@�A�B�C�D�E�F�G�H�I�J�K�L�M��N�O�P�Q�R�԰��S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i��Ǧ�j�k츾l�m첾n��o�p�Ƿq쿿����r�s���t�u�v��w�x�y�z�{�|�}�~���с�а���������������������Д찰�������������ǜ�����@�A�ϾB�C�D�E�F�G�H�I�J�K�ޱL�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����Ȃ�����¾�������҈����ɉ������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�ҥ�����ϳ�������˹ٶ������ԭ���Ʊ���ռF���G���ҵ�H��ͥ�I��ſ��J�������ߵ���K�����L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q��r�s����t��u�v�ƭ��w�x�y�ɷ��z�{�|�}�~�������������������������������������@�A�B�C�D��E�F�ͲG�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c��d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������𢼘������⹷�Ҥ��ʥ��˙���������Ƚ��������Ğ������ݹ������@���A��������������ʸ�����B�C�D�E�F�G�H�I�J�K�L��M�N��O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q��¦��ͱ�۳��R󵲿��������Ծ�������ݼ��������S����§���T���ҳ��U�V���������W�X������Y��������������������Z��ǹ[�\�]�^�_�`�a��b�c�d�e����f�g�h�i�j�����k�l��m�n�o�p�q���r�s�t�u��v���w�x�y�z�߸{�|�}�~������������������������������������������������מ���@��A�B�C�D�E�F��G�H�I��J�K�L�M�N�O�P�Q�R�S�T��U�V�W��X�Y�Z�[�\�]�^�_�`�a�b���c�d��e�f�g�h�i�j�k�l���m�n�o�p������q����r�s�t��u��v��w�x��y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����Ӂ�����������������������������������������������Ϗ����������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[��į𦼰��\��Ż�]��������^���_�����`��͸�����a�b�븽��c�������������������d�����e���f�g�h���i���j�������k���l�m�n�o���׺p�����������������q�r�����s���t�u�v�w�x�y�z�{�|�}�����~��������������������������������������������������������������������@�A�B�C�D�E�F�G�H���I�J�K���L�M���N���O�P�Q�R�S�ƻT�U�V�W���X�Y�Z�����[�ں\�]���^�_�`���a�b����c���d��e�f��g��h��i�j�k�l���m�n�o�p�q�r�s�t�u���v�����w���x�y�z�{�|�}�~����������������������؇���Ĺ�������،��܍������������ʓ���������������������������������@�A�B�C�D���E���F�DZG�����H�I�J�K�L���M�N�O�P�Q�R�S�T�U�V�W��ƴ�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������ݳ���������������������Ȼ�������������������������������������ٗ���������J�K�L�M�N�O�P�Q�R�S�T�����������Z�I�����������e���������������������������������������@�A�B�C�D�E�F�G�H�������������������������������������������������������������������¤äĤŤƤǤȤɤʤˤ̤ͤΤϤФѤҤӤԤդ֤פؤ٤ڤۤܤݤޤߤ��������������������a�b�f�g�������������������������������������������������������������������¥åĥťƥǥȥɥʥ˥̥ͥΥϥХѥҥӥԥե֥ץإ٥ڥۥܥݥޥߥ�����������������������`�c�d�ŨƨǨȨɨʨ˨̨ͨΨϨШѨҨӨԨը֨רب٨ڨۨܨݨިߨ����������٢ڢۢܢݢޢߢ���ŢƢǢȢɢʢˢ̢͢΢ϢТѢҢӢԢբ֢עآ����������������������������������¢âĢ������������������������������������������������������������©éĩũƩǩȩɩʩ˩̩ͩΩϩЩѩҩөԩթ֩שة٩ک۩ܩݩީߩ����������������T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������\�C���D�����������E������F����G�H��Y�����������������������������������������������I�J�K�L�ʡǡơM�̡ءޡN�ϡO�Ρġšɡȡҡӡ�ߡáˡס֡աP�١ԡܡݡQ�R�ڡۡ��ѡ͡S�С�졧�������������������������¡����������������������������������������������@�A�B���������������������������������������������������¦æĦŦƦǦȦɦʦ˦̦ͦΦϦЦѦҦӦԦզ֦צئ������������������������������������������������������������������ѧҧӧԧէ֧ا٧ڧۧܧݧާߧ������������������קNNNNNNNN N!N#N&N)N.N/N1N3N5N7N<N@NANBNDNFNJNQNUNWNZN[NbNcNdNeNgNhNjNkNlNmNnNoNrNtNuNvNwNxNyNzN{N|N}NN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NOOOOOOOOOOOOOOOOO!O#O(O)O,O-O.O1O3O5O7O9O;O>O?O@OAOBODOEOGOHOIOJOKOLOROTOVOaObOfOhOjOkOmOnOqOrOuOwOxOyOzO}O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OPPPPPPPPP	P
PPPPPPPPPPPP P"P#P$P'P+P/P0P1P2P3P4P5P6P7P8P9P;P=P?P@PAPBPDPEPFPIPJPKPMPPPQPRPSPTPVPWPXPYP[P]P^P_P`PaPbPcPdPfPgPhPiPjPkPmPnPoPpPqPrPsPtPuPxPyPzP|P}P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQQQQQQ	Q
QQ
QQQQQQQQQQQQQQQQQQ Q"Q#Q$Q%Q&Q'Q(Q)Q*Q+Q,Q-Q.Q/Q0Q1Q2Q3Q4Q5Q6Q7Q8Q9Q:Q;Q<Q=Q>QBQGQJQLQNQOQPQRQSQWQXQYQ[Q]Q^Q_Q`QaQcQdQfQgQiQjQoQrQzQ~QQ�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRR	RRRRRRRRRRR!R"R#R%R&R'R*R,R/R1R2R4R5R<R>RDRERFRGRHRIRKRNRORRRSRURWRXRYRZR[R]R_R`RbRcRdRfRhRkRlRmRnRpRqRsRtRuRvRwRxRyRzR{R|R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSSSSS	S
SSSSSSSSSSSSS"S$S%S'S(S)S+S,S-S/S0S1S2S3S4S5S6S7S8S<S=S@SBSDSFSKSLSMSPSTSXSYS[S]SeShSjSlSmSrSvSyS{S|S}S~S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STTTTTTTTTT"T$T%T*T0T3T6T7T:T=T?TATBTDTETGTITLTMTNTOTQTZT]T^T_T`TaTcTeTgTiTjTkTlTmTnToTpTtTyTzT~TT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUUUUUU
UUU
UUUUUUUUUUUUUU!U%U&U(U)U+U-U2U4U5U6U8U9U:U;U=U@UBUEUGUHUKULUMUNUOUQURUSUTUWUXUYUZU[U]U^U_U`UbUcUhUiUkUoUpUqUrUsUtUyUzU}UU�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVVVVVV
VV
VVVVVVVVVVVVV V!V"V%V&V(V)V*V+V.V/V0V3V5V7V8V:V<V=V>V@VAVBVCVDVEVFVGVHVIVJVKVOVPVQVRVSVUVVVZV[V]V^V_V`VaVcVeVfVgVmVnVoVpVrVsVtVuVwVxVyVzV}V~VV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWWWWWWW
WWWWWWWWWWWWWWWWW W!W"W$W%W&W'W+W1W2W4W5W6W7W8W<W=W?WAWCWDWEWFWHWIWKWRWSWTWUWVWXWYWbWcWeWgWlWnWpWqWrWtWuWxWyWzW}W~WW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXXXX	X
XXXXXXXXXXXXXXXX"X#X%X&X'X(X)X+X,X-X.X/X1X2X3X4X6X7X8X9X:X;X<X=X>X?X@XAXBXCXEXFXGXHXIXJXKXNXOXPXRXSXUXVXWXYXZX[X\X]X_X`XaXbXcXdXfXgXhXiXjXmXnXoXpXqXrXsXtXuXvXwXxXyXzX{X|X}XX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYY	Y
YYYYYYYYYYYYY Y!Y"Y#Y&Y(Y,Y0Y2Y3Y5Y6Y;Y=Y>Y?Y@YCYEYFYJYLYMYPYRYSYYY[Y\Y]Y^Y_YaYcYdYfYgYhYiYjYkYlYmYnYoYpYqYrYuYwYzY{Y|Y~YY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ
ZZ
ZZZZZZZZZZZZZZ!Z"Z$Z&Z'Z(Z*Z+Z,Z-Z.Z/Z0Z3Z5Z7Z8Z9Z:Z;Z=Z>Z?ZAZBZCZDZEZGZHZKZLZMZNZOZPZQZRZSZTZVZWZXZYZ[Z\Z]Z^Z_Z`ZaZcZdZeZfZhZiZkZlZmZnZoZpZqZrZsZxZyZ{Z|Z}Z~Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[[[[[[[
[[[
[[[[[[[[[[[[[[[[[ [!["[#[$[%[&['[([)[*[+[,[-[.[/[0[1[3[5[6[8[9[:[;[<[=[>[?[A[B[C[D[E[F[G[H[I[J[K[L[M[N[O[R[V[^[`[a[g[h[k[m[n[o[r[t[v[w[x[y[{[|[~[[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\\\\\
\\\\\\\\\\ \!\#\&\(\)\*\+\-\.\/\0\2\3\5\6\7\C\D\F\G\L\M\R\S\T\V\W\X\Z\[\\\]\_\b\d\g\h\i\j\k\l\m\p\r\s\t\u\v\w\x\{\|\}\~\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]]]]	]
]]]
]]]]]]]]]]]]]] ]!]"]#]%](]*]+],]/]0]1]2]3]5]6]7]8]9]:];]<]?]@]A]B]C]D]E]F]H]I]M]N]O]P]Q]R]S]T]U]V]W]Y]Z]\]^]_]`]a]b]c]d]e]f]g]h]j]m]n]p]q]r]s]u]v]w]x]y]z]{]|]}]~]]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^	^
^^
^^^^^^^ ^!^"^#^$^%^(^)^*^+^,^/^0^2^3^4^5^6^9^:^>^?^@^A^C^F^G^H^I^J^K^M^N^O^P^Q^R^S^V^W^X^Y^Z^\^]^_^`^c^d^e^f^g^h^i^j^k^l^m^n^o^p^q^u^w^y^~^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^___	__
___________!_"_#_$_(_+_,_._0_2_3_4_5_6_7_8_;_=_>_?_A_B_C_D_E_F_G_H_I_J_K_L_M_N_O_Q_T_Y_Z_[_\_^___`_c_e_g_h_k_n_o_r_t_u_v_x_z_}_~__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_``	```````````"`#`$`,`-`.`0`1`2`3`4`6`7`8`9`:`=`>`@`D`E`F`G`H`I`J`L`N`O`Q`S`T`V`W`X`[`\`^`_```a`e`f`n`q`r`t`u`w`~`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`aaaaa
aaaaaaaaaaaaaaaa!a"a%a(a)a*a,a-a.a/a0a1a2a3a4a5a6a7a8a9a:a;a<a=a>a@aAaBaCaDaEaFaGaIaKaMaOaPaRaSaTaVaWaXaYaZa[a\a^a_a`aaacadaeafaiajakalamanaoaqarasatavaxayaza{a|a}a~aa�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbbbbbb	bbbbbbb b#b&b'b(b)b+b-b/b0b1b2b5b6b8b9b:b;b<bBbDbEbFbJbObPbUbVbWbYbZb\b]b^b_b`babbbdbebhbqbrbtbubwbxbzb{b}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bccccc
ccc
ccccccccccc&c'c)c,c-c.c0c1c3c4c5c6c7c8c;c<c>c?c@cAcDcGcHcJcQcRcScTcVcWcXcYcZc[c\c]c`cdcecfchcjckclcocpcrcsctcucxcyc|c}c~cc�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cddddd	d
d
dddddddddddd"d#d$d%d'd(d)d+d.d/d0d1d2d3d5d6d7d8d9d;d<d>d@dBdCdIdKdLdMdNdOdPdQdSdUdVdWdYdZd[d\d]d_d`dadbdcdddedfdhdjdkdldndodpdqdrdsdtdudvdwd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deeeeeeee
eee
eeeeeeeeeeeeeeeee e!e"e#e$e&e'e(e)e*e,e-e0e1e2e3e7e:e<e=e@eAeBeCeDeFeGeJeKeMeNePeReSeTeWeXeZe\e_e`eaedeeegeheiejemeneoeqeseuevexeyeze{e|e}e~ee�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�efffff	ff
fffffffffff!f"f#f$f&f)f*f+f,f.f0f2f3f7f8f9f:f;f=f?f@fBfDfEfFfGfHfIfJfMfNfPfQfXfYf[f\f]f^f`fbfcfefgfifjfkflfmfqfrfsfufxfyf{f|f}ff�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fggggggggggggggggggg g!g"g#g$g%g'g)g.g0g2g3g6g7g8g9g;g<g>g?gAgDgEgGgJgKgMgRgTgUgWgXgYgZg[g]gbgcgdgfgggkglgngqgtgvgxgygzg{g}g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�ghhhhh
hhhhhhhhhhhh h"h#h$h%h&h'h(h+h,h-h.h/h0h1h4h5h6h:h;h?hGhKhMhOhRhVhWhXhYhZh[h\h]h^h_hjhlhmhnhohphqhrhshuhxhyhzh{h|h}h~hh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hiiiiiii	i
iiiiiiiiiiiiiiii!i"i#i%i&i'i(i)i*i+i,i.i/i1i2i3i5i6i7i8i:i;i<i>i@iAiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiUiViXiYi[i\i_iaibidieigihiiijilimioipirisitiuivizi{i}i~ii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjjjjj	jjj
jjjjjjjjjjjjjjjj j"j#j$j%j&j'j)j+j,j-j.j0j2j3j4j6j7j8j9j:j;j<j?j@jAjBjCjEjFjHjIjJjKjLjMjNjOjQjRjSjTjUjVjWjZj\j]j^j_j`jbjcjdjfjgjhjijjjkjljmjnjojpjrjsjtjujvjwjxjzj{j}j~jj�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkkkkkkkkk	k
kkk
kkkkkkkkkkkkkkkkkkk%k&k(k)k*k+k,k-k.k/k0k1k3k4k5k6k8k;k<k=k?k@kAkBkDkEkHkJkKkMkNkOkPkQkRkSkTkUkVkWkXkZk[k\k]k^k_k`kakhkikkklkmknkokpkqkrksktkukvkwkxkzk}k~kk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�kllllll	l
lllllllll l#l%l+l,l-l1l3l6l7l9l:l;l<l>l?lClDlElHlKlLlMlNlOlQlRlSlVlXlYlZlblclelflglklllmlnlolqlslulwlxlzl{l|ll�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmmmmmm	m
m
mmmmmmmmmmmm m!m"m#m$m&m(m)m,m-m/m0m4m6m7m8m:m?m@mBmDmImLmPmUmVmWmXm[m]m_mambmdmemgmhmkmlmmmpmqmrmsmumvmymzm{m}m~mm�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnnnnnnnn	nnnnnnnnnnnn"n&n'n(n*n,n.n0n1n3n5n6n7n9n;n<n=n>n?n@nAnBnEnFnGnHnInJnKnLnOnPnQnRnUnWnYnZn\n]n^n`nanbncndnenfngnhninjnlnmnonpnqnrnsntnunvnwnxnynzn{n|n}n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nooooooo
ooo
ooooooooooooooo!o"o#o%o&o'o(o,o.o0o2o4o5o7o8o9o:o;o<o=o?o@oAoBoCoDoEoHoIoJoLoNoOoPoQoRoSoToUoVoWoYoZo[o]o_o`oaocodoeogohoiojokolooopoqosouovowoyo{o}o~oo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�oppppppppp	p
ppp
pppppppppppppppp p!p"p$p%p&p'p(p)p*p+p,p-p.p/p0p1p2p3p4p6p7p8p:p;p<p=p>p?p@pApBpCpDpEpFpGpHpIpJpKpMpNpPpQpRpSpTpUpVpWpXpYpZp[p\p]p_p`papbpcpdpepfpgphpipjpnpqprpsptpwpypzp{p}p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqqqqqqqqq
qqqqqqqqqqqq q!q"q#q$q%q'q(q)q*q+q,q-q.q2q3q4q5q7q8q9q:q;q<q=q>q?q@qAqBqCqDqFqGqHqIqKqMqOqPqQqRqSqTqUqVqWqXqYqZq[q]q_q`qaqbqcqeqiqjqkqlqmqoqpqqqtquqvqwqyq{q|q~qq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r)r+r-r.r/r2r3r4r:r<r>r@rArBrCrDrErFrIrJrKrNrOrPrQrSrTrUrWrXrZr\r^r`rcrdrerhrjrkrlrmrprqrsrtrvrwrxr{r|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r000����00 ^� &     000	0
000
0000000���6"'"("""*")""7""�"%" "#�"+"."a"L"H"=""`"n"o"d"e""5"4"B&@&�2 3 !����0 �!&&�%�%�%�%�%�%�%�%�%; �!�!�!�!0p!q!r!s!t!u!v!w!x!y!�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$t$u$v$w$x$y$z${$|$}$~$$�$�$�$�$�$�$�$�$`$a$b$c$d$e$f$g$h$i$ 2!2"2#2$2%2&2'2(2)2`!a!b!c!d!e!f!g!h!i!j!k!��������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]��A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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������������������������������������������������5�6�9�:�?�@�=�>�A�B�C�D�;�<�7�8�1�3�4� !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO���  % 5 !	!�!�!�!�!""#"R"f"g"�"P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%	&�"000�����+���M���k���������QDHa1111	1
111
1111111111111111111 1!1"1#1$1%1&1'1(1)1!0"0#0$0%0&0'0(0)0�2�3�3�3�3�3�3�3�3�3�3�30���!!12 �0�0�0�0�00�0�0I�J�K�L�M�N�O�P�Q�R�T�U�V�W�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�h�i�j�k�0%%%%%%%%%	%
%%%
%%%%%%%%%%%%%%%%%%% %!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rsssssss	sss
ssssssssss s#s$s&s's(s-s/s0s2s3s5s6s:s;s<s=s@sAsBsCsDsEsFsGsHsIsJsKsLsNsOsQsSsTsUsVsXsYsZs[s\s]s^s_sasbscsdsesfsgshsisjsksnspsqsrssstsusvswsxsyszs{s|s}ss�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�stttttttt
ttttttttttttttt t!t#t$t't)t+t-t/t1t2t7t8t9t:t;t=t>t?t@tBtCtDtEtFtGtHtItJtKtLtMtNtOtPtQtRtStTtVtXt]t`tatbtctdtetftgthtitjtktltntotqtrtstttutxtytzt{t|t}tt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuuuuuu	u
uuuuuuuuuuuuu u!u"u#u$u&u'u*u.u4u6u9u<u=u?uAuBuCuDuFuGuIuJuMuPuQuRuSuUuVuWuXu]u^u_u`uaubucuduguhuiukulumunuoupuqusuuuvuwuzu{u|u}u~u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvvv	vv
vvvvvvvvvvvv!v#v'v(v,v.v/v1v2v6v7v9v:v;v=vAvBvDvEvFvGvHvIvJvKvNvOvPvQvRvSvUvWvXvYvZv[v]v_v`vavbvdvevfvgvhvivjvlvmvnvpvqvrvsvtvuvvvwvyvzv|vv�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vJU?��W(c�T	U�T�vLv<��w~��x1r����(l�[�O	c�f�\��Hh��f�v�QVe�q����PeY�a�o��LcRb�S'T{kQ�u�]�bˍv��b�]W8�b8r}v�g~vFdpO%��bz�e�s,dsb,���gHrnb�b4O�tJS�R�~��.^�h�i���~�h�x��Q��P$�ނހS�eR�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vwwwww
wwwwwwwwwwwwwwwww!w#w$w%w'w*w+w,w.w0w1w2w3w4w9w;w=w>w?wBwDwEwFwHwIwJwKwLwMwNwOwRwSwTwUwVwWwXwYw\w�����O!Xq��[�b�b�fy���rog�x�`QSS��̀���
P�rY�`q��TY�,g({)]�~-u�lf���<�;��k�{|_�xք=��k�k�k^�^�u�]e
_�_���X�[�����,�Ab�O�S^S������M�hj_��h�֜�a+R*vl_�e�o�n�[HduQ�Q�gN�y|��p]w^w_w`wdwgwiwjwmwnwowpwqwrwswtwuwvwwwxwzw{w|w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�uv^�s�d�b���lZS�Rd”�{/O^6����$n�ls�Uc\S�Te��W
N^ek?|�`�ds��PgMb"�lw)�Ǒi_܃!���S���k�`�`p͂1��N�lυ�d�|�i�fI��SV{�O�QKmB\m��c�S,�6��g�x=d�[�\�]��b�gz�d�cI���� �N���fs�w�w�w�w�w�w�w�w�w�w�w�w�w�wxxxxxx
xxxxxxxxxx x!x"x$x(x*x+x.x/x1x2x3x5x6x=x?xAxBxCxDxFxHxIxJxKxMxOxQxSxTxXxYxZx[x\x^x_x`xaxbxcxdxexfxgxhxixoxpxqxrxsxtxuxvxxxyxzx{x}x~xx�x�x�x�x:W\8^�P���S^eEu1U!P���b��g2Vno�]5T�pf�ob�d�c{_�o�ば�\hf�_�lH���l��d�y�WYjbHTXNz�`�oڋb����yT�ucS`lߏ_p�;���O:\d���e�pEQ�Qk�]�[�bl�tu� zay{�N�~�wN�R�Qqj�S���ϖ�nd�Zi�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyyyyy	y
yyy@x�P�wd�Y�c�]z=i O9��U2N�u�zb^�^�R9T�pvc$��W%f?i��U�m�~"�3b�~�u(��x̖��Ha�t͋dk:RP�!kj�q��VS�NN�Q�|��|�O��{�zgd]�P�v�|�m�QgX[�[�x�dd�c+c�-d��T{)vSb'YFTyk�P4b&^�k�N7����_.�
yyyyyyyyyyyyyyyyy y!y"y#y%y&y'y(y)y*y+y,y-y.y/y0y1y2y3y5y6y7y8y9y=y?yByCyDyEyGyJyKyLyMyNyOyPyQyRyTyUyXyYyaycydyfyiyjykylynypyqyrysytyuyvyyy{y|y}y~yy�y�y�y�y�y�y�y�y�y�y�y�y�y `=��b9NUS���cƀ�e.lFO�`�mދ9_ˆS_!cZQa�chRccH�P�\wy�[0R;z�`S��v�_�_�vl�op{vI{�w�Q��$XNO�n�Le{�r�m��Z�b�^0W��,{^_����c�n�x�pxQ[��W5uCO8u�^�``Y�m�k�x�SՖ�QR�c
T���̍9r�xv��
��S�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzzzz	z
zzzzzzzzzzzzzN�v�S��v��-��[��"NN�Qc��a�Rh�Ok`�Qm\Q�b�ea�F���u��cw�k�r�r��5XywL�\g@����^!n�Y�z�w;��k�eXQQ��[�X(Tr�fe��V���vA��c�TY:Y�W��5g��5�AR�`X���\E��O����%Zv`�S|bO���i`�?Q3�\u�1m�Nzz!z"z$z%z&z'z(z)z*z+z,z-z.z/z0z1z2z4z5z6z8z:z>z@zAzBzCzDzEzGzHzIzJzKzLzMzNzOzPzRzSzTzUzVzXzYzZz[z\z]z^z_z`zazbzczdzezfzgzhzizjzkzlzmznzozqzrzszuz{z|z}z~z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z0��SZO{OON��l�s�^ju�
j�w��A~�Q�p�Sԏ�)��rm��lJW���e��?b2��Y�N���~>e�^�aUޘ��*S�� T���^�l9���Z�)TlR�~_Wq~l�|KY�N�_$a�|0N\�g��\�Θ�u�p"��Q��IY�Q[O&T+Ywe��u[vb�b��E^l&{O�O
g�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{{{{	{{
{{{{{{{{{{{{!{"{#{'{){-{nm�m�y��_+u�b���Oܑ�e/�Q��^P�t�oR��K�
Y�P�N�6ry���[��D��Y�TvVV�9e�i���v�nr^uFg�g�z��v�a�ybec��QR��8���~�\/n`g�{�vؚ����|dP�?zJT�TLkdb=��urRi�[�<h�����*NT�~9hߍ��f�^�/{0{2{4{5{6{7{9{;{={?{@{A{B{C{D{F{H{J{M{N{S{U{W{Y{\{^{_{a{c{d{e{f{g{h{i{j{k{l{m{o{p{s{t{v{x{z{|{}{{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�W?��h�];e�Rm`���O��lQ�[_�]^l�b!�qQ���R�l߂�r�W�g-�Y��ǃ�T�{0O�ld[�Y��Sʆ��7���Ee~��Vǖ.R�tPR�[c�VN�b*`�hsQ�[�Q‰�{��P�`Lp/�IQ^�ptĉ-WExR_����h�<��xvBh�g�5�=R���n�h��V�g��Ǐ�T�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{||||||||	|
|
|||||||||||||||| |!|"|#|$|%|(|)|+|,|-|.|/|0|1|2|3|4|5|6|7|9|:|;|<|=|>|B|��i[wm&l�N�[��c��a���+T�m�[�Q�UU��dMc�e�a�`
qWlIl/Ymg*��X�Vj��kݐ}Y��SimuT�Uw�σ8h�y�TUOT�v����l�mk��d�:�?Vў�u�_�rh`�T�N*ja�R`p��T�py�?�*m�[_�~�U�O4s<T�SPT|TNN�_Zt�Xk��t��r�|VnC|D|E|F|G|H|I|J|K|L|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|[|\|]|^|_|`|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|u|v|w|x|y|z|~||�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|'_N�,U�b�N�l7b���TNS>s�n;uRS݋�i�_`�mOW"k�sSh؏bc�`$U�ub�q�m�[{^R�LaĞ�xW�'|�v�Q�`LqCfL^M`�pp%c���_b`Ԇ�V�k�`gaIS�`ff?��yO�pGl����~d�fZZB�Qm�mA�;mOkp��b�`
�'�xy�Q>W�W:gxu=z�y�{�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}}}}}}}}	}}}
}}}}}}}}}}}}}}}}}}}!}#}$}%}&}(})}*},}-}.}0}1}2}3}4}5}6}��e����o��!��Y�~		T�g�h��M|Ɩ�S%`�urlsS�Z�~$c�Q
��]߄�b�Qc[OmyBR�`Nm�[�[�����e�_E��Y�~�~	V�g9YsO�[�RZ���>�2u��GP<z�N�g~��Z|k�vZW\:{�Nq|Q��p�xY'��h�g�xwx�bac�{�OjR�QP��it���1���.��{�N7}8}9}:};}<}=}>}?}@}A}B}C}D}E}F}G}H}I}J}K}L}M}N}O}P}Q}R}S}T}U}V}W}X}Y}Z}[}\}]}^}_}`}a}b}c}d}e}f}g}h}i}j}k}l}m}o}p}q}r}s}t}u}v}x}y}z}{}|}}}~}}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}eP0�QRo�n�n�m�^�P�Y\Fm_l�u��hhVY�� Sq�M�I�iy&q���NʐGm��Z�Vd��w�O��r҉z�4�~RYeu�����S�z�c�c�v�yW�6�*b�R��Thpgwckw�zm�~��YbɅ��LuP�N�u�J\�]K{�eё�N%m_�'}&��N(�ۏs�Kf�yя�pxm�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}=\�RF�bQ�[wvf���N�`�|�|�~�Nf�of��Y��Xle\��_�uV��z�z�Q�p�z�cvz�~�s�ENxp]NR��SQe�e����T1\�u���b�r�uE\y�ʃ@\�T�w>N�lZ��bnc�]wQݍ�/��O�S�`�pgRPcC�Z&P7wwS�~�d+e�b�cP5rɉ�Q���~GW̃���QT�\�}�}�}�}�}~~~~~~~~~	~
~~~
~~~~~~~~~~~~~~~~~~~ ~!~"~#~$~%~&~'~(~)~*~+~,~-~.~/~0~1~2~3~4~5~6~7~8~9~:~<~=~>~?~@~B~C~D~E~F~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~Z~[~\~]~�O�zZmᐏ��U�TaS�T_�cwi�Qha
R*X�RNW
xw�^wa�|[b�b�N�p��b�p`�wWۂ�g�h�x���y�X�T�S4nKQ;R�[����CU�Ws`QW-TzzP`T[�c�b�Scb�[�g�T�z�w��^�8Y�Wc��WWw{�O�_�[>k!SP{�rFh�w6w�e�Q�N�v�\�zu�NYA��P^~_~`~a~b~c~d~e~f~g~h~i~j~k~l~m~n~o~p~q~r~s~t~u~v~w~x~y~z~{~|~}~~~~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~
79;<=>?@ACFGHIJKLMNORS��'a�ndWfFc�V�bib�^��W�b�U!�J���fU��egV�݄jZh�b�{�pQ�o0��cȉ�a�p�nt�i�r�^ΐgjm^c�Rbr�lO�Yj��p�m�RPN��m�~��x/}!Q�W�d��{|�l�h^i�Q�S�h�rΞ�{�r�yotNg̑��<y��T�Th=N�S�R>x�S)R�P�O�OVY[\]^`cdefgklmopsuvwxz{|}����������������������������������������������������������������������u�z�|�l���R�t�T�OT���ޏp��^`�m^[e8���K`�p�~�|�Q�h�|o�$N��ϑ~f�N��dJ��P�u�q�[��fo�N�dc��^�eRˆ�p�Rs3t�g�x�4N��ޜ�m�QA�T�b�s���Ô6O��Qupu��\���S�N�n	t�ikx��YuR$vAm�gmQ��K��T<{�z����������������������	�
����������!�#�$�+�,�-�.�/�0�2�4�9�:�<�>�@�A�D�E�G�H�I�N�O�P�Q�S�U�V�W�Y�[�\�]�^�_�`�a�b�c�d�e�f�g�h�k�l�m�n�o�p�r�s�t�u�v�w�x�y�z�{�|�}����W�bG�|iZd�{oK���bS���^�p�cdSO������x2��B��^o�yU_F�.bt�Tݔ�O�ee\a\Q�/l�_�s�n�~�\cj[�nuSqN�ceu�bn�&O�N�l�~�����W;�#��{����=�m���~�Y���sx��l���VT�WpN��VSȏ	��w����n��fba+o~���������������������������������������������������������ŀǀȀɀʀˀπЀрҀӀԀՀ؀߀�������������������������������� �!�"�#�$�%�&�'�(�)�*�+�-�.�0�3�4�5�7�9�:�;�<�=�?�)���+��vl�_��+s���k�wƔoS��Q=^��8�HN�s�g�hv�	�dq�l	w�ZA��k�'f�[�Y�Z���N����j�v0�s�h_[/w��a��|���%_s|�yʼn�l��[B^�h w�~�QMQ�R)Zb�ׂ�c�wЅ�y:n�^�Y�mpl�b�vOe�`��f��#��
T}T,�xd@�A�B�C�D�E�G�I�M�N�O�R�V�W�X�[�\�]�^�_�a�b�c�d�f�h�j�k�l�o�r�s�u�v�w�x�����������������������������������������������������������������������������������������������āŁǁȁɁˁ́΁ρЁсҁӁyd�!j���xidT��b+g���X؞�l o�[L��_r�g�bar�N�Y�k�X�fU^�RUa(g�vfwgrFz�b�TPT����Z�~lCNvY�HYWS7u���V c�|`���mbT���Q�Z���Y�*P�l<\�b`O?S{���n+��bt^�x�d{c�_Z��?\OcB�}[nUJ�M��m�`�g�r�Q�[ԁՁցׁ؁فځہ܁݁ށ߁�������������������������������	�
������������� �$�%�&�'�)�.�2�:�<�=�?�@�A�B�C�E�F�H�J�L�M�N�P�Q�R�S�T�U�V�W�Y�[�\�]�^�`�a�b�c�d�e�f�g�i��b�l[rmb���~�Sm�Q_tY�R`sY�fP��u*c�a�|���T'k%��kՅUTvP�ljU��,r^`6t�b�cLr�_Cn>meXo�v�x�vTu$R�SSN�^�e*�ր�b�T(R�p��э�lxTڀ�W�T�j�M�iO�l�U�v0x�b�p�om_��h|x�{��gO�gc�xoWx9�yb�b�R5t�kj�k�l�m�q�u�v�w�x�{�|���������������������������������������������������������‚ÂłƂɂЂւقڂ݂��������������������������
��
���������� �!�"�#�$�%�&�)�*�.�0�2�7�;�=�dU>��u�v9S�u�PA\l��{OPGr��ؘo�thy�d�w�b��+��TX�RNjW��
�s^�Q�tċO\aW�l��FZ4xD�돕|VRQb���N��a�郲��W4gWnffm1��fpg:khb�YN�Qo�g�lvQ�hGYgkfu]�P��eHyAy��w��\^NO/TQYxhVlď_}l�l���c>�?�A�B�D�E�H�J�K�L�M�N�S�U�V�W�X�Y�]�b�p�q�r�s�t�u�v�y�z�~����������������������������������������������������������������������������ƒÃăƃȃɃ˃̓΃Ѓу҃ӃՃ׃كڃۃރ���������p`=murfb��ŔCS��~{�N&�~NԞ����MR\oc�Em4�XL] kIk�g[TT���X7�:_�bGj9�re�`eh�wTN�O�]���d��\�O�zR�N/`�z���O�N�y4t�R���d�y�[�lR�{�"l>PSn�dtf0l�`w����^<twz�yN��tBl�VK��l��:SƆ�f��H\q� n�����������������������	�
������������� �!�"�#�)�*�+�,�-�.�/�0�2�3�4�5�6�7�9�:�;�>�?�@�A�B�C�D�E�G�H�I�J�K�L�M�N�O�P�R�S�T�U�V�X�]�^�_�`�b�d�e�f�g�h�j�n�o�p�r�t�w�y�{�|��S6Z�����SW��Cg���lhQ�u�b�r8R�R:�p8vtSJ��inx��و�6q�q�Q�g�t�Xe�V��v�pb�~�`�p�X�N�N�_�N��R�Y�~Tb�N�eb8�Ʉc����q�n�[�~�Q�c�g��9��Qz[�Y��sN]leQ%�o�.�J�^t��m�1_�dm(�n�Ü^X[�	N�S}�~����������������������������������������������������������������������������������������������„ÄńƄDŽȄ˄̄΄τ҄ԄՄׄ؄لڄۄ܄ބ����������������������������������OceQh�U'Nd��kb�Z_tr��m�h�P��x@g9R�l�~�PeU^q[{Rf�s�Igq\ R}qk��U��da����UUlGb.�X$OFUO�Lf
N\�hNc
z�p���R��\�T���~bYJ�dž�
�f�Dd\Qa�m>y��7x3u{T8O���m Z�~^y�l�[vZu��Nan�Xu%urrGS�~������	�
��
�������������� �"�#�$�%�&�'�(�)�*�-�.�/�0�1�2�3�4�5�6�>�?�@�A�B�D�E�F�G�K�L�M�N�O�P�Q�R�S�T�U�W�X�Z�[�\�]�_�`�a�b�c�e�f�g�i�j�k�l�m�n�o�p�q�s�u�v�w�x�|�}������w�viR܀#W^1Y�r�en׋8\q�AS�w�b�e�Nߘ���[Ƌ�S�wON\v��Y_:y�XN�g�N�b����R/f�UlV��N�Oʑp�l^C`�[ƉՋ6eKb���[�[�c.U�S&v}Q,��g�h�k�b���S��m�ufNN�p[�q���f�fr�͞ �^\/g�h_g
b�z�X�^pe1o��������������������������������������������������������������������������������������������������…ÅąŅƅDžȅʅ˅̅ͅ΅х҅ԅօׅ؅مڅۅ݅ޅ߅�������������������������U`7R
�Tdp�)u^h�b��S=r�4lawz.T�wz���Uxg�p�e�d6V`�y�SN{k���[�U�V:O<Or��]~g8�`����[����dX��d�Uςe��O }��|�PQX�n�[ɋ��x����{}������~Ӛ�x�\WzB���_yY[_c{ф�hU)t"}�@bLX�N�[yYTX������������������	�
���
����������������� �!�"�#�$�%�&�(�*�+�,�-�.�/�0�1�2�3�4�5�6�7�9�:�;�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�R�S�U�V�W�X�Y�[�\�]�_�`�a�c�d�e�f�g�h�i�j�mscK��΀Ԃ�b�S�l^�*Y`plMWJd*�+v�n[W�j�umo-��fW�k���x�c�S�pdlXX*dX�h��U�|P���m���p�c�m�n�~�Ch��mv���WYyr�~��u���hTR"���c��D�|USO�f�V�`�mCRI\)Y�mkX0uul`�F�cag�:w�4���^�S,T�pm�o�p�r�s�t�u�v�w�x���������������������������������������������������������������������������������†ÆņȆ̆͆҆ӆՆֆ׆چ܆݆���������������������������������������@l�^\P�N�^:cG��Phn��wTܔd_�zvhEcR{�~�uwP�b4Y��Q�y�z�V�_��m`\WTTQMn�V�c����*��To\���bXb1�5�@�n�|�-i�Y�b>Uc�Tن<mZ�t��jkYL�/_~n�s}�8N�p�[�x=cZf�v�`�[IZNU�jl�s�N�gQ�_�eg�_�YZ���� �$�&�'�(�*�+�,�-�/�0�2�3�5�6�8�9�:�<�=�@�A�B�C�D�E�F�J�K�M�O�P�Q�R�T�U�V�X�Z�[�\�]�^�_�a�b�f�g�h�i�j�k�l�m�o�q�r�s�u�w�x�y�z�����������������������������������������������������������]�_qS�ݏEh�V/U�`:NMo�~ǂ��YO*O>\�~*g�sTOuÀ�UO�MO-n�	\pakSv)n���e���~;T3z
}��U��tc��m�zb�egS�c�l�]\T��LNal�K\�e���h>T4T�kfk�NBcHS�
O�O^W
b��dfir�R�R�`�f�q�g�Rx�wpf;V8T!�zr��������������������������������������‡ÇćŇLJȇɇ͇̇·χЇԇՇևׇ؇هڇ܇݇އ߇�����������������������������������������	���
��������������� �#�zo`^�`��Y�`�q�p�nPl�r�j��-^`N�Z�U�m�|��b�~�w~�#S����f�\�O�rN�SYT�c(�HQ�N���~�T$�T�7��m&_�Z>fi��s.s�Sz�����[w�P��~�v�Sv����{D�XnaN�ey��`�T�Ny��]aj�PTa�'�]x�JR�T�V��m�[�mSf$�%�&�'�(�)�*�+�,�-�.�/�0�1�3�4�5�6�7�8�:�;�=�>�?�A�B�C�F�G�H�I�J�K�N�O�P�Q�R�S�U�V�X�Z�[�\�]�^�_�`�f�g�j�m�o�q�s�t�u�v�x�y�z�{�|���������������������������������������������������������������\][!h��xU{HeTi�NGkN���OSc:d���e����Q�hxS���a�l�l"�Q\�����#k���e�_�_�OE�fe�)s�`tQR�Wb_��L���x^Og'`�YDQ�Q��SylĖ�qO�O�=g�U��y���~�Xb�Z�V{��_��ĄW��S�e�^\ud`n}Z�~�~i��U�[�`�e�s����������������������������������ÈĈLjȈʈˈ͈̈ψЈшӈֈ׈ڈۈ܈݈ވ��������������������������������	���
������������� �"�#�$�&�'�(�)�,�-�.�/�1�2�3�5�7�	�cv)w�~t���f[tz�@��R�q�_�e�[o��]�k[l����
�ŏ�S�b&�-�@T+N��Yr��]Y��mŖ�T�N��	q�T	��p�m�v%Nx��\�^�����p�lDY�c<wM�os�0X�q�Sx��Uf_0q�[����k.Y/��yhglboO�u�m3�'l�N�u{Q7h>o��p��Yvt8�9�:�;�<�=�>�?�@�B�C�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�`�a�b�c�d�e�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�|�}�~���������������������������������������������������������������Gd'\e��z#��Y�T�o����0iNV6�7rΑ�Q_Nu��cN�S�fK�Y�mN�X;S�c�O
Oc���7YW��y�N�u�l�[�Y]_i��P�]YN�w�Nz��bf��y\�Ny_Ɓ8����u�NԈa�k�_IN�v�n㋮�
�ы_���~5�k��V�k�4��YT���m�[n�9\_����������������������������������������������������������������É͉ӉԉՉ׉؉ىۉ݉߉������������������������������������������	�
���
�����������������pS�1jtZp��^(��$�%�g�G�Ώb��vq_��lx f�T�bcOÁ�u�^͖
����T�l�m8l`�R(u}^O�`�_$\1u�����r�l8nI�	g�S�SQOɑ��S|^�m�N�v�i^�a�YO�O>�|�	ann���N1Z�N\�y�[틽�s�W����TG��U�\�_a2k�r������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�z�{�|�}�~����tm�[Ո��k�m�3�
n�QCQ�W���S�c���VXTW?s�n܏т?a(`b��f�~��Í���\�|g�`���N�Sh�AQЏt�]�Uf��U[S8xBg=h�T~p�[}��Q(W�Te�f^�C��l�m��|�Q���g�e�o����jV ��vvp�q#��bR�l<�`�X�a�f`�Nb�U#n-gg�����������������������������������������������������������������������������������������������������������������������������ŠÊĊŊƊNJȊɊʊˊ̊͊ΊϊЊъҊӊԊՊ֊׊؊يڊۊ܊݊ފߊ������(wh�i�TMN�pȋXd�e�[�z:P�[�w�ky��|�l�v�e��-]U\8�h`Sb�z[n�~j�zp_3o _�c�mVgN^&��N��4v���b-f~b�lu�gqiFQ���Sn��b�T����ُYm�s�ewu'x������O�g�uʋ�/cG�5���#cAw�_�r�N`te�bck?e���������������������������������������������	�
���
������������������� �!�"�#�$�%�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�'^�uѐ�����g/e1T��w���AlKN�~L��v
i�kgb<P�O@Wcbk���S�e�~�_c�c��n^�\6Rzf�yz(��p�u�n�l�z-N�v�_��w��~�y��͑�NO�hT�]2m̋�|t���^�T�v�[<f���s*hۆ1g*s��ۋ��z�pnq�b�w1V;NW��g�R��.���Q{F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�g�h�i�j�k�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������NjЋ�	��OO�l]y{��b*r�bNxl��dZ��{ih�^ň�Y�d�X�ri%���X�`W��QIc�bSSLh"t�L�DU@w|pJmyQ�TD��Y�n�m\[+}�N}|�nP[�
nW[��h*��[�~;`�~��p�OY�c�y��RS�eVyŋ;��~���~4V��gj
\u�(f�]PO�gZP\OPW�^8�9�:�;�<�=�>�?�@�B�C�D�E�H�J�K�M�N�O�P�Q�R�S�T�V�W�X�Y�[�\�]�^�_�`�c�d�e�f�g�h�i�l�m�n�o�p�q�r�t�u�v�w�{�|�}�~���������������������������������������������������������������������������������NN@QN�^ESN�NN2�l[iV(N�y?NSGN-Y;rnSl�V䀗��k~w�6N�N�\NiN�N��[[lUV�N�S�S�S�S�Se�]�S�S&S.S>S\�fScSRRR-R3R?R@RLR^RaR\R��}R�R�R�R�R�QT�N�N�N�N�N�N�N�NO�N"OdO�N%O'O	O+O^OgO8eZO]O����������������������������������������ŒÌČŌƌnjȌɌʌˌ̌͌ΌόЌьҌӌԌՌ֌׌،ٌڌی܌݌ތߌ��������������������������������������������������	�
���
�_OWO2O=OvOtO�O�O�O�O~O{O�O|O�O�O�O�O�O�O�O�O�O�O�O�O)PLP�O,PP.P-P�OPP%P(P~PCPUPHPNPlP{P�P�P�P�P�PQ�P�P�P�PQQ�N=lXOeO�O��Flt|nQ�]ɞ���QY�R
S�S�QYUQ�NVQ�Nn����N�҈�y4[���Q�Q�Q�Q��������������� �Q�R�W�_�e�h�i�j�l�n�o�q�r�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������ōǍȍɍʍ͍ЍҍӍԍ�Q�Q�Q�Q��������������‹Ëˋϋ΋ҋӋԋ֋؋ً܋ߋ����������������������������� �!�%�'�*�+�.�/�2�3�5�6�iSzS�"�!�1�*�=�<�B�I�T�_�g�l�r�t�����������������������������Ս؍ٍ܍����������������������������
�������������� �!�$�%�&�'�(�+�-�0�2�3�4�6�7�8�;�<�>�?�C�E�F�L�M�N�O�P�S�T�U�V�W�X�Z�[�\�]�^�_�`�a�b�c�d�e�g�h�j�k�n�q�����ϐŐ��АĐǐӐ��ܐאې����"��#�1�/�9�C�F�
RBY�R�R�R�R�T�R�R�R�S�q�w�^�Q�Q/��S_Zu�]LW�W�W~X�X�X�X)W,W*W3W9W.W/W\W;WBWiW�WkW�W|W{WhWmWvWsW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�Ws�u�w�x�y�z�{�}�~�����������������������������������������������������������������������������������������������������������ŽÎĎŎƎǎȎɎʎˎ͎̎ώЎюҎӎԎՎ֎׎؎َڎێ܎ݎގߎ�����X
X�W�WXXXDX XeXlX�X�X�X�X����ay�}��������������������������Ȃʂ゘�����˂̂������������Ă΂���	������܂�҂؂���ӂ������Ղ�Q�[�\����<�4�1���^�/�O�G�C�_�@��`�-�:�3�f�e����������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�h��i�l�j�m�n���x���������������|�����}���{���������������؃X��݃��փ�8���ԃ߃�������Ń��&���\�Q�Z�Y�s�����z���x�<�F�i�v�����1�m���̈́Є愽�ӄʄ���������������
u8��9��:�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�j�������������������������������������������������������ÏƏɏʏˏ̏͏Ϗҏ֏׏ڏ����������������������������V�;�����Y�H�h�d�^�z��wC�r�{���������y�������������Ӆ��܅��'��)��<��^_<YAY7�UYZYXYS"\%\,\4\Lbjb�b�b�b�b�b�b"c�b9cKcCc�c�cqczc�c�cmc�c�cic�c�c�c�c�c�c�c�c�cRd�c�cEdAddd dd&d!d^d�dmd�d��#�$�%�'�(�)�*�+�,�0�1�2�3�4�7�9�:�=�?�@�C�E�F�H�I�J�K�L�N�T�U�V�Y�Z�\�]�^�_�`�a�d�f�g�i�j�k�l�o�p�q�r�s�v�w�x�y�z�{�|�~���������������������������������������������������������������������zd�d�d�d�d�d�d�d�d�d	e%e.e_�_u__S�S�S�S�S�STTTKTRTSTTTVTCT!TWTYT#T2T�T�TwTqTdT�T�T�TvTfT�T�T�T�T�T�T�T�T�T�TrT�T�T�T�T�T�T�T�T�T�T�T�T�T�TU�T U�TU�T"U#UUU'U*UgU�U�UIUmUAUUU?UPU<UÐƐȐɐː̐͐ҐԐՐ֐ِؐڐސߐ���������������������������������	�
���
����������������� �!�$�%�&�'�(�)�*�+�,�-�.�0�2�3�4�5�6�7�8�:�;�<�=�>�?�@�A�B�D�7UVUuUvUwU3U0U\U�U�U�U�U�U�U�U�U~U�U�U{U�U�U�U�U�U�U�U�UV�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U��VVVV$V#V�UV'V-VXV9VWV,VMVbVYV\VLVTV�VdVqVkV{V|V�V�V�V�V�V�V�V�V�V�V�VW
W	WW^^^^1^;^<^E�G�H�Q�S�T�U�V�X�Y�[�\�_�`�f�g�h�k�m�s�z�{�|���������������������������������������������������������������������������������������������‘ÑđőƑȑˑБґӑԑՑ֑בّؑڑۑݑޑߑ������7^D^T^[^^^a^�\z\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]']&].]$]]]]X]>]4]=]l][]o]]]k]K]J]i]t]�]�]�]s��]�]s_w_�_�_�_�_�_�_�_�_�_�_�_b�a_�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rs�rs�r��������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E��rss!s
ssss"s9s%s,s8s1sPsMsWs`slsos~s�%Y�$YYc�g�h�i�j�k�l�t�w�}����������������������^�^�^�^�^�^�^�^�^�^S��^�^�^�^�^���_�_�_�_`�_`�_�_�_``�_�_�_`5`&```
`)`+`
`?`!`x`y`{`z`B`F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������j`}`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�` a&aa#a�`aa+aJaua�a�a�a�a�a�a�_����������������
���
��������,N?rb5lTl\lJl�l�l�l�l�lhliltlvl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l��������������������������������������������������’ÒĒŒƒǒɒʒ˒̒͒ΒϒВђҒӒԒՒ֒גْؒڒےܒݒޒߒ��������������������������������������������������	�9m'mmCmHmmmmm+mMm.m5mmOmRmTm3m�mom�m�m^m�m�m\m`m|mcmn�m�m�mn�m�mn�m�m�mn�mn�m+nnnNnkn�n_n�nSnTn2n%nDn�n�n�n�n-o�n�n�n�n�n�n�n�n�n�n�n�nboFoGo$oo�n/o6oKoto*o	o)o�o�o�oxoro|ozo�o
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�k��o�o�o�o�o�o�o�o�o�op#pp9p5pOp^p�[�[�[�[�[�[/u��4d�[�[0��[G����ӏՏ����������&��
��!�5�6�-�/�D�Q�R�P�h�X�b�[��ft�}���������P_W_V_X_;\�TP\Y\q[c\f\�*_)_-_t�<_;�n\�Y�Y�Y�Y�Y�Yl�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������“ÓēœƓǓȓɓ˓͓̓�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ�YZ�Y�Y�YZ	Z2Z4ZZ#ZZ@ZgZJZUZ<ZbZuZ쀪Z�ZwZzZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z	[[[2[7[@[\\Z[e[s[Q[S[b[u�w�x�z��}����������������������������������������~�~�~�~�~�~ΓϓГѓғӓԓՓדؓٓړۓܓݓޓߓ��������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.��~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~
�~�~�~�~!"#$%&'*+,-/01235z^u�]>u���s�s�s�s�s�s�s�s�s�s�s�s�s�s�s|�
t�s�s�s�s�st*t[t&t%t(t0t.t,t/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������ǔϔӔԔڔ��� �ttAt\tWtUtYtwtmt~t�t�t�t�t�t�t�t�t�t�t�t�t�t���LgSg^gHgig�g�gjgsg�g�gug�g�g�g�gwg|g�g	h�g
h�g�gh�g�g�g�g�gh�g�g�gh�g�g2h3h`hahNhbhDhdh�hhUhfhAhgh@h>hJhIh)h�h�hthwh�hkh�hni�hi i�h'�3�=�C�H�K�U�Z�`�n�t�u�w�x�y�z�{�|�}�~�������������������������������������������������������������������������������������������������������������������������������������•ÕĕŕƕǕȕɕʕ˕$i�hiiWi�hiqi9i`iBi]i�iki�i�ixi4i�i�i�i�i�ificiyi�i�i�i�i�i�i�i�i�i�i�i�i�i�i/j�ijjej�iDj>j�jPj[j5j�jyj=j(jXj|j�j�j�j�j�j7sRs�k�k�k�k�k�k�k�k�k�k�kk�m�q�r�s�u�v�x�w�y�z�|�~�����������͕̕ΕϕЕѕҕӕԕՕ֕וٕؕڕەܕݕޕߕ��������������� �#�$�%�&�'�(�)�+�,�-�/�0�7�8�9�:�>�A�C�J�N�O�Q�R�S�V�W�X�Y�Z�\�]�^�`�c�e�f�k�m�n�o�p�q�s�x�y�z�{�|�}�~����������������������������Ύbbbb"b!b%b$b,b��t�t�tuuu4e�e�e�e
ffrgfff�p�ff4f1f6f5f�_fTfAfOfVfafWfwf�f�f�f�f�f�f�f�f�f2�3�6�;�=�@�E�F�H�I�G�M�U�Y�ljʉˉ̉ΉωЉщnr�r]rfror~rr�r�r�r�r�rc2c�c������������������������������������������������������������������������–ÖȖʖ˖ЖіӖԖ֖זٖؖږۖܖݖޖߖ������������������������������
��������������� �?d�d��k�k�k�k�klll
lllll!l)l$l*l2l5eUekeMrRrVr0rb�R��������
g����������������ۀ€Āـ̀׀g݀����
���g�Z�6��,��2�H�L�S�t�Y�Z�q�`�i�|�}�m�g�MX�Z�������n����́&gʁ��!�"�#�$�%�&�'�(�)�+�,�.�/�1�3�4�5�6�7�:�;�<�=�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�T�U�W�X�Z�\�]�_�c�d�f�g�h�j�k�l�m�n�o�p�q�r�u�w�x�y�z�{�}�~����������������������������������������������������$k7k9kCkFkYkјҘӘ՘٘ژ�k@_�k�eQ��e�e�e�e�e�e�e�e�e�p�p�p�p�p�p�p�p�p�p�pqqq/q1qsq\qhqEqrqJqxqzq�q�q�q�q�q�q�q�q�qr(rlpqfq�q>b=bCbHbIb;y@yFyIy[y\ySyZybyWy`yoygyzy�y�y�y�y�y�_�_����������������������������������������������������������—×ėŗƗǗȗɗʗ˗̗͗ΗϗЗїҗӗԗ՗֗חؗٗڗۗܗݗޗߗ��������������������������������������	�
���
��<`]`Z`g`A`Y`c`�`a
a]a�a�a�a�ab����l�l�m�w�wx	xxxx�e-xxx9x:x;xx<x%x,x#x)xNxmxVxWx&xPxGxLxjx�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy�xy$yy4y���������vw
w�vwww"ww-w&w5w8wPwQwGwCwZwhw����������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�bweww�w}w�w�w�w�w�w�w�w�w:u@uNuKuHu[uruyu�uXa_H�htqy�~�v�v2�������������������������������������������������������������������ĔȔɔʔ˔͔̔ΔДєҔՔ֔הٔؔ۔ޔߔ�������o�p�q�r�s�t�����������������������������������������������������������������˜ØĘŘƘǘȘɘʘ˘̘͘ϘИԘ֘טۘܘݘ�������������������������������������������������������������������	�
�
�������������"�*�+�)�,�1�2�4�6�7�8�<�>�?�B�5�D�E�F�I�L�N�O�R�S�T�V�W�X�Y�[�^�_�]�a�b�d�e�f�g�h�i�j�k�l�o�q�r�s�:��w�wɖ�y�y�y�yzG]zzzz�	�
�������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�V�W�X�Y�Z�[�\�]�^�_�`�a�b�d�f�s�x�y�{�~�������9z7zQzϞ��pz�v�v�v�v�v�t�t,u �"�(�)�*�+�,�2�1�6�8�7�9�:�>�A�B�D�F�G�H�I�K�L�N�Q�U�W�Z�[�\�^�c�f�g�h�i�j�k�l�q�m�s��u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�uvvvvv
v%vvvv��������������������������������������������������������������������������������™ÙęřƙǙșəʙ˙̙͙ΙϙЙљҙәԙՙ֙יؙٙڙۙܙݙޙߙ�����������������������������v<v"v v@v-v0v?v5vCv>v3vMv^vTv\vVvkvov��zxzyz�z�z�z�z�z�z�z�z�z�zd�i�r�}������ƈ����Ɉ�Έ���������!����
�4�+�6�A�f�{��u倲v�v�w���� �"�%�&�'�)�(�1��5�C�F�M�R�i�q���x��������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y���������������������������M�T�l�n��z�|�{�����������������������Ć��Ά��������Ɇφ�������І�ކ�߆؆ц�����
�
�	�#�;��%�.��>�H�4�1�)�7�?���"�}�~�{�`�p�L�n���S�c�|�d�Y�e�������҇Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�r�������������������������������������������������ÚĚƚǚȚɚʚ͚ΚϚКҚԚ՚֚ךٚښۚܚݚޚ��������������������������������������Ƈ������������凬�����ˇӇ��ч��ʇۇ�������
��!�9�<�6BDE��z�z{{{{
{+{{G{8{*{{.{1{ {%{${3{>{{X{Z{E{u{L{]{`{n{{{b{r{q{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|�{�{|||�	�
���
���������������� �!�"�$�%�&�'�(�)�*�+�,�-�.�0�1�3�4�5�6�7�8�9�:�=�>�?�@�F�J�K�L�N�P�R�S�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|*|&|8|A|@|������D�!�"�#�-�/�(�+�8�;�3�4�>�D�I�K�O�Z�_�h�~�����؈߈^�������||Ie�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|n��f����������|w}�}�}G~�~����s���������g�m�G�I�J�P�N�O�d�|�}�~��������������������������������������������������������������������������������������������������������������������������������������›ÛěśƛǛțɛʛ˛̛͛ΛϛЛћқӛԛ՛֛כ؛ٛڛۛb�a�p�i�o�}�~�r�t�y�����������������������������U�~�����Y�i���������č֍׍ڍލ΍ύۍƍ���������	������,�.�#�/�:�@�9�5�=�1�I�A�B�Q�R�J�p�v�|�o�t�������������x������������e։މډ܉ܛݛޛߛ��������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;����>�&�S���������*�-�0�>����������������������
�������ΖҖ�w����Ȓ>�j�ʓ��>�k������������#z����������������������������������������������������������������������ĜŜƜǜʜ˜<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�}�~�������������������������������������������œȜɜќҜڜۜ��̜͜ΜϜМӜԜ՜ל؜ٜܜݜߜ�|�������������������������X�����������ښ˚̚њE�C�G�I�H�M�Q��
�.�U�T�ߚ�����������#�����;~����������֓����۞ܞݞ�ߞ������"�,�/�9�7�=�>�D������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������������������������ÝĝŝƝǝȝɝʝ˝̝͝ΝϝНѝҝӝԝ՝֝ם؝ٝڝ۝ܝݝޝߝ��������������������������������������������������	�
���
������������������$�'�.�0�4�;�<�@�M�P�R�S�T�V�Y�]�_�`�a�b�e�n�o�r�t�u�v�w�x�y�z�{�|�}���������������������������������������������������������������������������������������������������������žÞŞƞǞȞʞ˞̞ОҞӞ՞֞מٞڞޞ�����������������������������������	�
���������������!�#�$�%�&�'�(�)�*�+�-�.�0�1�2�3�4�5�6�8�:�<�?�@�A�B�C�E�F�G�H�I�J�K�L�M�N�O�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������,�y������
�������� �!�#�$�'�(�)��!�7�B�,�+�
9I4c&(L������S�F�NI�IXA�8�J��	�Jd?��9�9.-�!A"
>�,�.�\FG�/&7�,o2�:p-�QN�@)	'&J� �)9fLz:Y;�
Gz1G��H�C%�HQLL
�%}f@oP5�?���<�B`K�8	��7�5�9	j2
A�Hs��?
"Rr/iL�A�A�I�Dq|��/B
�~.u"N=	�2�F�DOC�.�-�D�E�Ro4Q�/�I�:�I�P�)�Rrp4�'P�?H�O��B�4�8�@��C�`1,��p�4�%E 8�>��#XI%�JP+�E��(R)Z�	�F_R&6%�:��;D.���	�PU�
�( �9�=d8�>-�C�>�L|B�E>�"hA�I]T&�d�2�6q/�A�+�B\EY?	�Q�#O:�ND-}G�L�D#
�GQ��sHx�%�?�#�}T�=�9�**<d<E�/N1gA;d�cQGTT)�:�$�V;T>iA�-���HA7]3K�	x2\6UR�6@�L�=�G��<A�F	�8�!_7 �H��H�O�
*GL�E\O��o�Q�+��I�D�F���PL>!�Ni7@�:�Q
;�B�M6�.^N��)�x<�n�A�7�2� ��6%UD�KwH\<�;HHY�Q�N���$�K�NqT�/�:7�L�O�T�7UzR�O�32Gn�D'(&y0�B&�(*L2C_<bK�OS�7'3��>�T%1n$	3a1�
�P@9z@�=i
�i�C' �'1�C�C,I
�I3��R��6�IT!a.�>J�
�"	?7�N���<�
j�#�-�2+{A5.4�-��&)�"�NMd�N
R�:�K��3�	�%�<]@(�
�j5�9��%�)�N�.�<�G�$:-�NHE�>���G
9g9�2"�58�q#�?p-e&wL
\=	1�'Jl*`5BG`*���o*�RE�E�J�!SI.+'9�*d c"�+��D~+	<#/�,"2��:�*p>�h�3y�Je�%�3,�Sd]:l
'
B�|}��Pt�,�Quyu!��0�" �5H�2�C
s?� %��4�,-'$R�UVY7��[�"�@Z�N��)OqM�
"\\�%��1]<T/�Z�3�/�&G�c�>0A��84�v!^.��>�(%�/n7Y"�VbO�S&} �'��LMj<WXR��TV,D%�RG�2"gD�Q�I�R\,c$� ^"H=?KD�,�"[�&"�l,T
5$�K"� �3�(zm�!�+|�E�AJ�F�@�8k$�(z0E93��!5�C3J� l� 0>~ ;
�)�F�F)�%V	k5#5 N��H*����I�/��<����
U-�PI��!�q4~[3��"��L|q5
1#&&8;���4qB�!�G4�F�-�T9rB�?�?kD(
��9�A�DP=H�3�7;
�E)5#~��A�6&@UP5�F:zO0/XX3�F�Q0*=8�=�T�M�%�����G�%	�#�%iG�G�M��&
6�4C"�$�6S����
i9�/�69�Sx�:o@}6'�547

:�+(*�E"T��H�.�.I�
�3�s�O?A�,uF��jB!�(��*�1BA#N8
y8�>�@��8� �/�@�)S5>"9�R�=wB�I�1�0)T�E�I�C��4�>1�H���S?Uu�;C��1A�}B�R�9LD�"p�<�F�~$>NEEL�-'E
1��M(14*�T�}Cg$�0p&$�+)B;2:NL]^h"�Ifc>%C�?%F4A	�NG��1"�3�*=B"f&^$)7ET�@�J2�2�
O�_L�=�#�Abu.�S`5D�C�>kA�@���1�1\
F?0T�~�G�1`Pg&0CK�O�q)y-�4<�y<�b
MePoRi_?M�NeH�+�LN��*BR
@F7�E�g�-s&M�6
%3�G1
�/��K�?^K�/��N�=}H�27�K�~D�)8L6H?4=/4A�2�S�$X?��;��6��,�2���%�T�Pw,Q<#|
��!`<p7hYD)(D�{��.CO��0�
�)��i<�H�6$ZD>�)\5o$]D=2#D��)*3!<l
�F��Tm
3�TBj
;M�#B2�&�E4�J�F.f:�G1K��O�Rc.��D+�Mt�K�"�L�/�
�D6�
�D20�J�T7.3+$�;��BI_@0xR��F�*U=O(�C�K.�J$�*HrP2%�'
/->,�G�%d(�'Q,w
�	�040�C�*�B��"mG�?K �#�;0D�{YS.1D�=%�q�%�Jo)�N�:7?O��N�R	$!.R5�'=�J(.�>�!oM�G0$N�?��>n>�F5�5��;��J�#V)�4@�M�4x"61�M�M G�>�>�>�>G)LJ+)6)G�>�=1�(�"��L-2.2�S�
!2�BW7�-],`�Q�F�I�3;4"�>a�IQ�
/u<v4`Q��;�@H��(4>]F20'�Ry��Q��H/�+��)�=
�J�=P
*oH�tD!HmDn9�Y�d!�
p�
E~C��I�IKB�Ee�3^�*5�KF!H[Z$� �]P�&.{��HG�4_;�3�?j j)QG"�
XZ<�
_�!vJiQ�S�1k �-"G#�-�1	M���$��FH#�28W-f>�	��=&�LS��LV*@U6�H�JT�L��xH���*	?1�WR��66w�!�0�$AE��i?F�B��"cK�Ky!;�8s+�@�	}>25DR�%�/��Np=oAQ�F�P�`G�!�@�D�'�T$��/hz	�(�(�.�2�*x,�>:=(V�Q P�!��	qQ��2tf�G�;BO�2z@�S3�7�7@'1�"fn:52�u�8��5<�,L�6<�I"SN�23,"MJ0��H<;<$� q�
t5�2�F,$gB��F�
W6�$�"e(nGC<a@r((~6�%'��FsG�$Rp?�6kS/I�)SnS�h#��En#{9D*3~9CIx���O8>;E51'�YE�DL-�B�Mb*V�3�.G2�*'+�	-O�Y�<
<|G~EN= V/� nD�AH�i!�OG��FS�@�0�A
�&kN�U9k��,)H	./2��.W�B��M%
�_��@%R�.kMR%N��	� ]S�G�,�D=v�?�3�S)P-�MV>!C�I�^,�"8���ER�P�+��2'#Tb5]7H�)�SS �5p���C8� C���-bQ�PyC&++!�"�G2,�&v/�GLOG'8�8u�4�:ZC�7�	�D5*��,"���=,E-}L�0j-�Q$`S�0�>�CFAPGlA�ATG~L�:�%�ST1*C�SY�(o�#(�+1��F'D�9�1$�AA-<��]=�-�4n+D2�>Eg?�#�JiR^-�W)�I#�JG �%�+C/P�
�H,-�6~M>M�?i6�*2
^6z3%A|2x�+���vIXR��+�K	FA�?Q!4=�D+?>&w*f5T:I0v@G?<�o��EN>S�T~H�M�5M6�'�*/�)*#�3�P�MB�5&,#K;�-�<5/<$Y-�:04J/M.F*=I�!�K�-W�;SO�$SP
b6�)�0ovA+3.?�O�+:C;C�,�&�%Z[�
tQ�EAIRB3#�5�G���*�o	CNJ,�X9i;�2.&F�D�-gOJ���-8.�)�=�
��L�0�546-<G<7K�2N�+{_8DE�-��'�M$�Gt'�-!$C@K:�5`+B%-)tG�R#$� �S�D�:�;BLFS�;�+E2�F�-T%fFU�,.AK.)6�3>"6�HTIJ�S�RU�8jI�=9�	J5��C�O�
S8k+d"��NwM4��P:1.���3�82.G.�Q�L��"3.x �3��84.Y8U@�D�"�U!_J�I��3�
��)�07S�"�9S�F�9#�
R)*�9�7?,�&ZC[CV#�?�&,*�?�?�?mH�&#CR���>��tBn�d=��8�P�D�-�A�A*E(�0D=�D)$�D� � �&� �R�D�-<?�Bk%��
V�'�5�A=8�
%I�M��H��AX�>x?k2w1�	U
UBHT )_F�0w%�=x4	?0�"y4�0�=4'
�0+�>`F4�"�)�~��(��4bI�,�8�@�i+P%�r@IL~�&qH��oD\G5�A-S%L�C�5�
.8�	q>�o�B�J�L[$�!RC+5�
�;�&N �#�+J#K#�T��F;X)Y)G'[Q�J}&Q8@
0k�Tw"Z�J�S3O��L*H�S4+H=�I�Q>9�S�!)�G�*,+��=�A�LKT�#"[G\G?@LTI`;�!{3�1~>�A�@�}<�5sf�'�A3X��2�K.��8�6�:TT��&�!�
2j>>(�O�O���4�2g�T�
�
>B0M�/�'�C%~3�8Gp$�O�&�&���T)� �H��H� �OPJgFI-II�I.cC��D"\~�T�?�5�
�'��LN�J#6��%d�'�'wK)B4 ��K#oGO-57	W/)��.uGvG�G#wG�"� %	�&@"11^48Q*PkI��;5�/�wN$�-(�.�Q	T
�_,g,�I�I�0#2� '6�9:C3�P�8K5
K�0P�h?
D7�1��,Q�E@J��0�/�<t+��<04Rq7W�O�,�S��Q���P�+3{M+��
�+�
�jC�#����=.O9�*�3C�Fd�^S�F�>�I�Q�=�Q�Cr>z�"�*-L]��	�#��:�9�3M�+�:�C��@@�'�B�:�Q��3��*(
K
�(5J�
�>g:�D�+		wA;U"�"��2'�&f((�KC�=�KC%�=�F�0A-Bb; �G�N(I=�6>G9�"AP�GL8�O�<ZA	�PcI� �7sMi��O��2�/�8/<��L�Z"�Dm
��x9+�o?!��(rs�I�I�I�M�M�@�G�L�	��Kb0
�S'?t&R�?
5'�?�A@?�	�Qj>QXB��Q�jR�#�D�5@9;�A@��AQ}0!=�
Q�~
S	�H��*(�C�4�$�57��5��I9�AiK�+�@�AuxB�y?��Lx1v<�>l2�LE�?�B�!U �I��+`/a"�?-�=�[ LVa>L�yB��K;F��vF�/�9�A<�K`,D")9~B�$'�"�,�QpD�=��vL1MDQ:�4CU
dIOE�'@
�7�4�M�/�
b�C1*�KtM�/�M
Mt>�aP'�^3E=|�2�A�)
J#�	�A%O$�J�%S-��A�
	�*�%	U1I"�=Z)�A�!��-.��O|M���&M��4.<I=�-���D��;mT��K�
X-_N�4%�MT=,
F�?�B@�F��+�K2�7�Ju	{*(2"�d3�G_6nT�6K855N;�1�H�:	��y _�-Dz!!Q�K��Fn8*�!�B��KKH�%�6�<�J�E<cN4,~0�,�i
���h,�OI>:;5�N��%�.�:K)�7�>�)R28�3{uQ+(� h1c1<M�0�&+�K
�QJ>�	2�4�/74�e
	&�04#��	KK`BaBn
7<�Q#;!Dqjq$�$<C,�&xA�� C�CR<�8�/QJ
Cd.o
S<V�:I�@x�3�3� �."8KRJ'	7V!h�>G�#�Bm
�LK�(+�+(�1Y,�#�*�
R�.�
PHDR�"�"�K��'�+�	�� $j4F{5�)� |8P&+-D+�<!sSB�M|�z��lNQ
#�O�2�1M�G�B�O�B�B�4�9<=c*��7lI�I�G74�$�H6�NP�WLo">8/�>y�A�
�50m2alL�A�Q�Q�
}G�"/��@��M�3M8QFNz?f-�0�01�O&N��Q-1�H�PXOH��-�HR
�/?�*z4A�OD/�,n2�>eC\ w#2=2*.�>
qDU�Qy#tuo.�P�t�,�&YO(�� �&@ G&C�L�>�7=�	*76"�*p.��/�b7�6sD5����u>12O�:�H� ~?}�T�H�O�(�:�>�2@�?�3�7�+�*b�
	A� �MlT�=e>K�6�TAW1�	�6L)�32G��1�9H2H'GQh&��-��GQ��G=�T/"�.97,��*�6�/�.�Q��aG&-A80�?�6�-A9oT�P�F�<,H��G�T�E"�J=�#�#v	�{>&��
D�Dz2:	yH�?�
�@pT�K�3�535�
�;�;�5�/�!�H�
QQ�.�#k4\C�+�jo7�;~O
/�%�<��QJ?�B�@�2r=�P��.�4�OpA
8�!�5�6��;�}
N��v2�:*&�	
�(?(sT��O�2�<W�,zX�K��Q.�)�["�
8�>�yT2~��HRU2>�0a$7�CV6��N?J=C�	H-�A��-'"Q5��c<N
G	� DNm�S/?1�34?�;K3A�K6-�(�SO1�Q�
7�3L�"<
�DI� I��*:+�<�
$K �HT6II�-���9.�
R��#O,d�D�&$<a�:P(J)�5RQH�$��9U�-kC^!�%�#�xKg((]2^2c2�#CBK�*}yKR�D8�)�*E+
�N0)%<�%�O?�
$$�%��-�F�!�I�t�0�b",�A�	��Ep	�Pe�Li�Ef.�\J	"�G.X>VDh.H�B,ij1�P�9�&�4ZE�I�7�S`J/&�8%`DaD[F}1�1� �O�O{�L$g@{8{��L%Z>��J�2�4�O�S�S�S�3�&�S
�R�nw/L�,�1�/�'��.BP�I�7;Rrg0s�O�"w;�L���iD�=�;S�E�H�8�+�+�>sdA�Y|8��F+�3�KG1O�e8] #H�=F�0�P9'�h,9�E�{T-9�@Tn���'�"�=�8F#�"���Q>��CEI!�CF#�R�A�8bPcPI��?�=�S�T�R�7�-�A�1 QJ��?�&��?AD�7F}IdN*�E�+�H�K�9H@�3|* -�/Hy�H�;81�}!t�@	
2��G�%�*�N�D��,�-P�Y0F:�&T<W�0�&bBSJ
II�%<<7>ED]8LP�aJ�CEv7���G�I96+�%�	�"�H�(6�'�)1)S7�<�G�R�M�I��9��8@O��Et�Jf38$0u:'��4�.�=R$�T",��>[1 KRT�?8>Y$r$�'�0�9=�5q�
n%:4��	�J662mL(A�F%T�5�>T-*�	�I��UI�[7�?�.*QB�M
R�Bt�9K�DS.�
�:�M�O*��@�I�-�F��DbH�<PXN�T}8WU(�:-�B�:RB�i,�I�H�H.9�-�eI�-�#�/�,R
�VH��9�7�:(8-�K�QZOX
[1��x�O�:Sb/#9�F�H��'�*�%�5�N�6�K�F2�PmI�C�P�%�6�!��5[�5��S�
�I�0�T0MX�O�%�J�I39)6nIu"�3�6zF�f�,}N�.Kf�'�O�F�6�P�={#p"Li6�A>$�'�X1�@1!	;M40L(�/oSaFz>�NOL�&(MQ�5"���?�.L�=�D�(�"C�:�:��3�K i#�St9@q
%��B��<�Q�#�%�S%2�])��2�1��fP�.���	�N�%MM��4�?���	�O�1M�GM�4J�5]1�S2�#�T�T2[	�3�-�?�(�D�
A " �	�T�2�F0�S�S��/?�
��*0�T�B�
��OQ 5�,e��/�7wI68x�I@�?�ST�~I;B�G�G��L�AQ0�gH��E�60H�#bGI+#�#Y:�-?��,}*"��=�LL�HFIH�PR0ItI':�L�?�*L=�u6��$�4�C91<�@H8�
0�6J�OA�.w+�I�;�H57�M5T+,;��H~�2�)�M�5�8TQ�@�=�5�<�O_:�8�!�A�d1_�;/�<�{�Pv.�O�2�2�*�E@�S?(3[H���Q�
�'�6BB?+&��K�2����>X7k�/9L���.@JO�!]^�)lPgS�$V${	%iE�3:>O$;�$�(`&+.(+	%;�!\�(��PeO�9�)�,]H�=�/%S675�@9GnFG�FxQ�T%;1�9Y:#�P�7B�NJ,|A�5 '�'03�C�6��O�$?N,:8�	�<+,;!=<�J�.0?A.o69>GOQ4h5/�2q�'�$PcB�86T�6��;Y��9�'=-�J�w7�T2F�	/ �TbJ>1�R�
n;�0�	�
.S����^9�2�
�I|�:�7�%�J�<<�+�1�>��"\2�-<.GIgeKy.�3�G�1�+OP��X#�0�
��+�KR_2�$�$�6�(�%V)�+��.�(RT��M�%#�S�:&��
�3�Rl(qG�%�R�	��:l.ZM�'�#�lCjL 2Dw'FK�K$L~K�Cl.M�$N 	:8�T)5�4��aM�)�%X2)�
!!xG%$$�R�$g%T4-hMz'7u92�E		2�!�I� �B�E�(#9$�"9:^�EE
�3�!�"�!9��J�LD	I6Ad<�.�O=v�E�/dB^D�EB0&cJ��L�~wx^ s2$
7F
7ERc;d;�%O�L�%e�WPa,b,�H�8�E� &2N4
;�3JY>�H��	�PON�@�
P=
�7�J��;#]=
��K&����	S�3J+7"E3zH�Fu<5:�.QHI7D�*m�0�M*N*0�&E�6�,)?�F1�5SC O4��.j/# ]p�6~*�6�98?��;�6�(�,#%:>�5�O�6�O+�(� �1Hq-�)82�A�3G^LH:NQ��
:�$�-�m�/O�+��MAt?���>**;4�012#A$A�>�9Q�Q72KLs6*!Q50#R(/� �M.�E�E'N~GU
�K�P.�*e+v
)/��Q/|SyN�'Ox�*|N�>z%Q+[IIe=N:�"���IB)RZ<O�R�KZ��/�
;�	�: wF~8� �V
�JaR�H�N�	@�)�:)E�6�QKHA�!�)�?=�,�$3IS+�4�09D�D;�"`3W �0PE�Q,,+A{4�Ie�8�/���&G43@%6*	L�`J�K$7T%�;&��J!>j$Jx
�C;�	y/�Ch8t#�0F)�-d>RD>��>�%:�:�$ :�/N$@Ew9�
PJ"�?�>[�@ 8X&��;b3�
� ��JkR�/��Y1�&
�( �$�P�0�=
M�-�(n+rJ'[)�4M�-S�}M�#�3�2�Q�J#?xM�@�6�yM"�8�6�170�A{M6���.U4�=��@=�?,6��GhY+S*K�GB�8�*�N�
-~]
�?&2	2�*o=.@�l'�E���JK�8E�P]<�L�
,�8g>�8�K$ ��>�V4h<�'��M'-�4L�4cSu&�1C��S*_K�#�%(@�B`K�0��;�M�%�H�*�S�	<�K?+�6`O�8k)�)�?�N�A�@�2O�8g7N�J;�;�8_!/�@��+���B*�Q(Kv�H;!w�JJ:�WD&MvE�X�Q�i"s8�7x+��(��K���K�
*�3�L�F)	]B@(�'��vQ��2&���>�.�<�H?By+�<�7W&L?1
��/DT�!�/P�
�E�K6GV�&q"=}�Kr�D�9 W#�E�Q=0� *�0�
��yA�.�@*;�2�B�B�;R,�6&;�P!7J�Qm?"<�F5#�H�>�6���9:1�&@77�	�[��$��2<N�'�G��>COu7�B�(H.�L'�8�
�O�DDMY9hFe'*T�K��I&�I��P*O
UJj;?0� �;�3�Se.��/7��@�
�;�:>7�R&^+�8�9�+I.pKqK	+�1�TA�<�J�J%���3-$Y!u@���2rK��#"��*f^@�)�N�(�%�KRH�(�:R�K��?;�D/`8f��+�'�7�	���Ch(�36�%�,D{KV;d@kF�R�'�#)���#�9q'|K_+1N&hCK'yJ��
l5$�:�M�S�8�$$(�4�K�2d!�GK�6�N3)�G>%a+�7&<�
��K��R2$
$9-q?7)�FqCH HlM$�C�C;JS�O�DO
�N�1*RAT.�@1�I�/�!/�!A/�,�&&�D'(��B�P�R"-P6�D�D�'�SL/�;DH>7@cR��E*5�`EaETC�J.AeRtH49�?">{F�N�!�B6FQ�0G/M	!l	e�&&�N	41�=�S>�S$f7�EZ
�5��A�9��F�"� D�ApSM!b�D��A�(�G 'O#��>�A�OACp fA���04�6�A4EJ�M>0��?�8��7�7r-��?x	!#FR�B,�D&E��!K�RJ@�>�7�A�.�.�3G���*y@tO
46��Z4e;1H�&H�N�N"-H9w&P�<5	
2�D�B�AN��A;N�,�74�Hz+&hKqA �G�2�]�(�/(�/J;CJ>� XT �I�Q}@�'Z�.�5�[#[HO�BBDJ_Dl
��
I�F�G�F3X!�
S?8�Rn:EM�&��7S�F*$�*�<VJ��*XYmKdJiF�#<�B?5vT&S�Rm'�?eJ�DMP���.�:6�F�
�
�H
.$i6�%�,�6 )�#��F�"E:�&�%m(!�&�G+B�D�'I�x5
N/$*�
� X	C+�<0$�R&${'nM5P�PM/�	@0� �H�T4S�!�N
�2�K�2/"	�M�LuO�3O;L��	L.��;�5&*�*�G~�:JL��,E5�4>T8*8"F2%15�<A�4�V��!% �
�B1�)��)�6~@$%9;>13B�%��&�.k0J,B�
#@�5�
0�d�Sz�!�G�JjmS�"NR�,�/ \IE?7'�/�-�HCLxFD
�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZZZZZZZZ	Z
ZZZ
ZZZZZZZZZZZZZZZZZZZ Z!Z"Z#Z$Z%Z&Z'Z(Z)Z*Z+Z,Z-Z.Z/Z0Z1Z2Z3Z4Z5Z6Z7Z8Z9Z:Z;Z<Z=Z>Z"%HFHDv~]BJJKLMNmpXZ\^`bdfrshj�����������������|���������������SRGOP�CABKE�OP���������L����N?Z@ZAZBZCZDZEZFZGZHZIZJZKZLZMZNZOZPZQZRZSZTZUZVZWZXZYZZZ[Z\Z]Z^Z_Z`ZaZbZcZdZeZfZgZhZiZjZkZlZmZnZoZpZqZrZsZtZuZvZwZxZyZzZ{Z|Z}Z~ZZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�ZY`gnu|����\�\�\�\�\�\X_fmt{��������������W^elsz��������������V]dkry�����\�\'I<�6|:ZA�'H1��8�\�\Zahov}�������\�\�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z
Dy $&TU\cjqx��(+~��-/���������������������
023459���������������������	
<>@E�Z[[[[[[[[[	[
[[[
[[[[[[[[[[[[[[[[[[[ [!["[#[$[%[&['[([)[*[+[,[-[.[/[0[1[2[3[4[5[6[7[8[9[:[;[<[=[>[?[@[A[B[C[D[E[F[G[H[I[J[K[L[M[N[O[P[Q[R[S[T[U[V[W[X[Y[Z[[[\[][^[������������������������������������������������������������
 "$&(*,�\�\�\�\�\�\�\�\�\�\�\_[`[a[b[c[d[e[f[g[h[i[j[k[l[m[n[o[p[q[r[s[t[u[v[w[x[y[z[{[|[}[~[[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�������������������������������������������������������������	
!#%')+����\�\�\�\�\�\�\�\�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\\\\\\	\
\\\
\\\\\\\\\\\\\\\\\\ "$&(*,.02468:<>@�\�\�\�\�\�\�\�\!#%')+-/13579;=?A�\�\�\�\�\�\�\nqY[]_aceg�\�\ik=A�\RW�\�\�\�\�\�\�\�\�\\ \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\0\1\2\3\4\5\6\7\8\9\:\;\<\=\>\?\@\A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z\[\\\]\^\_\`\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z\{\|\}\~\BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~���\�\�\�\�\�\�\�\�\�\�\�\�\�\�\CEGIKMOQSUWY[]_acegikmoqsuwy{}���\�\�\�\�\�\�\�\�\�\�\�\�\G:IIQ������{�����������������������
)*+����,-./3579;=?><:8640@12������QzMtu�\�\�\�\�\�\�\�\�\�\�\��������������������\���\��\�\�\�\-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\[bipw~���%Q�����������)FC�\��R�\�\�\�\]	
�]�]w�]�]STUV678!#*',;?lox}�1.]]]]]]]]]	]
]]]
]]]]]]]]]]]]]��������������������������������������������	
 !"#$%&'(]]]]]] ]!]"]#]$]%]&]'](]}"OC��>P��Fc7�;>e$7*�A�B�QQG,7G/�.�Dj�1T	K�#��2L#�G~T�QQ�F�&,OT���@�M5�>G{DR
L�H�;,(,�:�)�M�3M�8��2*J�P��*��,��alO���m�&�E6>�HB:D95-�� ���"dCeC:.UUUUUUU U!U"U#U$U%U&U'U(U)U*U+U,U-U.U/U0U1U2U3U4U5U6U7U8U9U:U;U<U=U>U?U@UAUBUCUDUEUFUGUHUIUJUKULUMUNUOUPUQURUSUTUUUVUWUXUYUZU[U\U]U^U_U`UaUbUcUdUeUfUgUhUiUjUkUlUmUnUoUpUqUrUsUtUuUvU�x.
+�&J-<�9i(�;�CA+m5P-�)nC�1!�+�S](�:94��$RUC�oL�1pL
	WfA��G�*��M� HN� �E
�0�2�I��0(F�7y�7�e5�8*8�;�T�'��P�2�%0�BfR(GzE'H�E;�3�J�F��C�BLy
�Ez/�$|
K�@��	=nAwUxUyUzU{U|U}U~UU�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�ULA�	N!�*#>�CL,FVGCF}E'�AK'�%��;��?��0�O7�+M�#�+�8@�=a�	��b�(��)�2�S�3f���-�L�*|F=E
6�+�K@`6��D/NS	E&�4�F��'�8�5�;�H�@tA�P	jK�)�<�'�%B$�=�2�� 8P��9��U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVVVVVVVVV	V
VVV
VVVVVVVVVVVVVVVVVVV V!V"V#V$V%V&V'V(V)V*V+V,V-V.V/V0V1V2V\#<SDI�1U�Na4�,&�*�J@�@SA�
�EIO�F�4�
�&�&4-;_Z���'L�[��N�
	�V<��7p;y=�
�Lj(��9�T�#lB#3Fg6A��$��%R6�%�N4V=hT;�#(n(�%1$GKF+�C4�
�N�pQ�%h9�C�2��/�F
��+T?3V4V5V6V7V8V9V:V;V<V=V>V?V@VAVBVCVDVEVFVGVHVIVJVKVLVMVNVOVPVQVRVSVTVUVVVWVXVYVZV[V\V]V^V_V`VaVbVcVdVeVfVgVhViVjVkVlVmVnVoVpVqVrVsVtVuVvVwVxVyVzV{V|V}V~VV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�fIr� �
�'�
+�S�0�R�'�)K28CA(|�.=S!'}Au
�@;K�Gl=.��3/8��j6�:=8�(�nO��0&5�*���;�'�,+N��h=�,�<wD?-�,�,
k=����QC)/5IQ�L�L�,O!
J�'S
�S��		�>�$?�'$'��
�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VB0]Y
�9�Q-�+�R�B�E�	yF�1�Bw�|TTFHQT�Q�g7�-�<>::@J<[
�*w
Dh><*D6;1iy9+JYP��)�&��=�`
��+�!G>q8HR�Q4M�3H|	>��@��"�J!B�EJP|�.�$Pu8FWJ�T�:
7�I(J(�3O�&23�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWWWWWWWWW	W
WWW
WWWWWWWWWWWWWWWWWWW W!W"W#W$W%W&W'W(W)W*W+W,W-W.W/W0W1W2W3W4W5W6W7W8W9W:W;W<W=W>W?W@WAWBWCWDWEWFWGWHWIWJWKWLW�'s$DC >

KEC��?q.SM!@�K�$�%�9v
''�*
SHMQ�*�%
�#a:F�KK�K'<��):);)��7JKT3m�Nm*�.�?'j,��/G�P��
�2kDD�� Ot�HD
I��E�%v0�3�Y/W445cO�7!8!�RgOhO�O��1SKTS\]Y[Zdlrq{�}������������������	"%&#4<EB�.FQJHWZX`Yfgkyvzswx��������������������������.P����?aL�gX4�
�(�O %��E�/�c(�EyR�
���%�?�1�Mi=�DB}�+,09,N�.�r*{C59HQ�H08���P�"�i8�*k,
S�P69��-@T4	�U+�'%>cg-#,DF�P(Hq,VRl,�*&3Q��	�� �*�C�Au#�7�=�k?%I94�&Q=�����������
+'(;FEMTU]dkeqz}���������������������
 !67,EFH>ON^v�����������������%�#f;� ;0��(K�R�L��)�B4E1��N���*�F�=�E[A�-+�@l"�
_	
4�,^!O&PXJ�\"�,-:
2(
�)`�.:B*1^8�&W	^I�E�,�_I��PP�*�
�6B.�F�H�+�+�0�+�$�"F�+p(+(*nB�<�!�R�3M;:O"!P8�������%+!4
$�5&jfih�pqt�v�����������������������������#(9.GHEPJOY^[afhvu�����������KlR
JO�MP9�1&T�AXPq",*
� �%��@��!�Q���YP[;U?�m,�M�)?��,�R�.�0@'Z/�$��0�K�"7"�4�R2�'2�(;@�CWG�/�$d�3r@#3)9".5�C$D�L
D�B�(�KC	Q	�G27k#�*1�(�	�.�:�S;"�G�SK"�	�1T�3	�����								&	*	,	$	2	3	<	E	T	P	J	U	Z	d	g	c	q	e	f	h	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�		
 
%




A
<
:
6
P
X
N
V
s
t
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�&5!�+�55�$�JrA�1_)G-c6dGC?$K"Q@A:�P�B�
 =\-t=2O�=5
3�)';��'j:�<A�/$#v=�Bi1
&@RN�#�.�H@S�2��/�'�(�!W�	�J�$f022m_T�d)R�7t$KO`�BG��N3�%aBP43OM�S�""$O�$�
�
#&+-803?BJLqSR�	Y`ahncuz��������������������I��-3EG:Q\Zibc|����������������������


�



��
IA5�
�I�/�/�L�02��!�TMh6]/�ETH�)HC�"�$�$R�%�%�D5^/HK�%((�,
:$�yG�5�M�;�)�DcH1RORPR1I�8KL�Q�=j+9;�*g�(�LMAS{�BIQpq!:�k8�j#d�<��TV'�(�
mQ��
.6L�JT��P�MPA]C
,
'
$
&
-
K
G
R
c
S
^
_
W
]
a
{
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
!#'$�O,B@OmeZR]l�����������������������������2HRQ<I�*Z:o.�P�Ku�<`:�)�;�F�1PMM�:�q
�q;`%g.?+�
�%N]Q�N�$6�D_>�5'TC�I�B�-4e�-NAQ&BQ�L�"��/�-�%
L�/A'�-�TJQ` �&>�Q���J�S�Q�5�S_.�\4O":l#3=|>!Gg)�(�U�S�6�Qo#�$!(#)/1B:6JNOehlunsmv���������������������������1-;/JBIFKdXUas{p������������������,+/.;�/
'�T(ME)F)?I�B'	B��.IIRUT�E�	�
G&	T=M�E�Qb��5k;	6�!��*R
�(�:N�K�@)4�#YJ�m3�$D+1��S>>�T)s;i.7�i5�.UM�0+�>�@�	��")m7�SF%Y
G[L+8O�Hf$�H��E?�R�1APK�HD�	g"g
�S�EBHUZQPWaeuhkt����{������������������������*5',&)<H?]c`dghq{z���r|��������������<1(��:��SAM?"G4�H�H�=-	w=�� �&B�A�"Q3P�"�"�	��&�N`N34�O(r3�8z:2
\�1��8.�+�4SB'�'�]�:ix�,J�9t�4�0!%HS&�
�`?��!��$�/!
2*�R|?�:;�3�F~S�Mr!0�I\j7�B�R�,ac3,�
|/L'%70�XWd_`\chYk����}�t{r�v�swu�x��������������!$.-('&<=QCFNDR]dck���x��������������������.)��
9i*;94,�)��4*
�J�H�|#��;-60wYR�#~
��>%F$B �/E>�B�Q�	;;SU�=s��"8N�.CD1�#�T�.���;�dL�HP�QJ7�R�(�&Q!CdOnV2R!o�TSF�;`C�0E��8�M})8AiC:�xE�*�����������'$&54B?AFibVmUYXW�w��|}��������������������
#8?UFCOBEJnyrw���������������;�(Svk3&4�+�2p�8@N��<N�
�6Q
.�2FD6/��S�
O7)S�2�'����2=G7^0t0VM�>"OP7��I"�m"�0�NSC(�-�;_��;�$R&%DF�+Q7�
�&@
o,>#
��;u$-D�(a9�N�1�.�1!0
� �(�(pG�
�60S0`2&b9���-)+86_^DA]CK?<ios������������������������ "!.0(<=?_g[PLN������������������$@#�L	N��P<X=.�
�I�1�<ZS�Rx�9�R�2�S=�(q(�;?�KdM�#(s3$&$h2N>R�4%&�TG%�8�)�KN�SmM�#8ZP,8�.�-�P?2�O���A-7�!
6�];�J^PV+<�f r,�R
;j)>�&dS^`$ �4��C8Y%N�(( �1l�O���
,76=<LJIMecbdot�����������������������(9K>vO�UkhfiXdWY`]����������������(5B%;�2�6�<)�+�TQ%%�D��.8�wE[hS�<�6m�L,�6�6�.n
b&�"X��9,�C�>.�%U6.�=3$K:��Q�DL�_�R�F�M]]L�}?�5�@H4�,�SW>V.���9��/�P.7a�Q�00N�5J
��y�~N(��Q_1�
eN�B*�D48�S�4 K#)1ry����p��vx�w���������������������YD<@I;dn|w}���������������������������+JFC,"GP#M'S�7GH+?�P
�82R,C�T���4s,�9�T�"0�5x�Dp�R�
�_� �"�����<|D�"��4��)GFV�C3�*>�5�=�J�$�D� �D>V:��Cm� � 

�@�P)�	[4�9�F>D�|3�uE=�E�Do�B9�=R;"p#�7SQ^G��.3('6>1&|stvr������������������!����������' C87;G5}WS \lw�ab�����������������������������E�5VT^	|�%)^&�
5�7�1�S�1�?�2�C}9@�<�?7�?[�S���`)�'�1�O��`'�+g1h3u=WT��T�A
TBEk&��k6�+5MtT�)�E*K�7�1�E�C�"�Cd6�+C�
}�+Y*�M�D�k:'4��
�+�@�V@T>-�+�DH&YTA��J#=���'8$52<!,96#E^QP�|v�bk{sl`������������������� �����   : > = < { V m Q Z o � w b P l _ e � � � � � � � � !� � � 
!� � � � )!3!.!'!(!G!RiN�	�
�B�MuT�E�8�?�"7nKZJ�S�-��/�R��5:lN�Bn�5�<�AN�PeS6��N�<�C+;�P�T�<���H,%�;�GhB�T�$TS�2!*zQ
)�,h0&PFwTTx7t;)\FI�6;,�2�C@7�E_5QFx;3MOUZQ�7�6�&WM��&!	�TgC!P!J!D!L!a!`!b!�'h!j!{!o!w!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"
"""""%")"'"("5"3"E"R"Q"S"V"]"`"e"s"t"z"~"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"### #�5�p6�E�_�T B�2BN��8�-7��3���qJm.y;rJ=7<62��2$.1�F�1�/�H�,�$�D�T�"�K�E�$C�r(�LK�y5C�T�T�)oB'$�$Q&S�5�R�P��BK�<aN�Ce�D��R1��0�CDP82K�TA<�2�@DK�$H<s(}:"0#,#-#D#E#f#s#x#v#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$$$($)$?$A$:$=$6$P$\$_$b$d$|$}$$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%*%+%%%%V%M%N%^%K%
%�%m%�%o%j%q%�%i%p%�%v%~%Q5%8_�R��*�+�=� 4:8��S)M�\a:�)�'M^.	�@��
�'� �+QP})"0fl4)N+�%H.L,LD)YH��2�NEJSxI�5M5�2��C.JMH�2�2�L��M�{7V|74&s.�2z
1bW
z,�B�/�#�/�'�Q�47B}D�A"o'DI7p{�
K7�%l%�%t%}%h%%Q%�%�%�%�%&�%�%�%�%&&(&A&:&9&7&[&U&W&\&S&d&r&v&t&o&q&�&&�&~&�&�&}&�$�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'�&'''+'<'S'^'_'C','O'>'.'D'3'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'f
Fk
ZT�?6�	i0&�4��&�/O3�� F�
{$8;9�[6��=�/'
�4Ng �
h)�#O3(Y�$�Km�I�32N+
ceQfQ�PO		Q1LW?�=!G�=7��8�&:�L��@�E�0DE�=H �"&&�@8#&&�8�:�=?#.{QA
=.V3k�=�=�'(((((!(<(B(F(D(S(Q(_(R(W(�(}(~(�(�(�(L(�(�(�(�(�(�(�(�(�(�()�(�(	)))))))�()#)$)")()=)>)A)B)K)S)N)M)P)Q)i)t)|)p)u)x)y)z)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)	*****(AP�:;JP�I<4$"�}�9
�5C6�M3Ba/*/LT5�@�10�A�A&"��8�4j=(T�CQ�-�/BT�(C�,}4�!?
H+/�	QE,CTM�	�={�*tDuD�)vD'.�@�@dEu2L%�&h7>�*�l8j�<� �cEE�>�	�>�V-,0��$Pa;Fi&:U*+*3*/*�*)*A*I*Q*X*K*L*h*a*p*q*x*�*s*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+
+�*++&+%+X+8+@+;+1+4+/+M+l+h+g+|+m+q+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+,,
,	,,,/,,$,,6,9,=,^)P0��4ld
l-�,�5m8� �0�A�*a6Ma
w)�.p�[-�9eNGR6�>M@�W���2Z?z9�<;�S9J�&�0�D)�.��(�./%��>S�(��K�(oF<>�-�&�a D�<�yQ���$I�CU;l/SQ
�"h.! � �#1&�>�1���Fb-A�NC,R,D,E,K,H,U,X,[,p,,�,d,z,y,f,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,e-�,�,�,�,-�,�,-	----0-@-T-R-]-_-i-k-�,s-t-z-�-�-~-{-�-�-�-�-�-�-7G�-�-�-�-�-�-�-�-�-�-�-�-.�-
..�-)./...6.+.�CjEE`#�#?Go(	�N�)�4�N5)�-�N;2A@�&=��I�
�+.�@PQfE�;wC405�LEI �E8�<Q9b<C1D1�`�=�B�
��.<�2[(R'�B44/�":�N�%�LG$>6�-
 �[TB�,��>[J�4(
pF�H�
�
�2�(�I�l�1-.E.K.O.U.R.^.].Z.n.}.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.///
/////'/1/3/>/B/C/G/F/K/N/U/W/_/c/i/m/k/g/{/t/s/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/00�(t(�
:��0�G�G��$�=�=��/�I1�+��L9T^?;�Q�>+@�1�@�5��R-� ���
n*�5l�J*L�IS3+0X |%�K�IS�-�sE�H�BX{OS��-��*8��l@�S�Q���-aF��%�5kj	�L{:T�&JAYI�D-�{L�SVC*QR000�/'0-0>050C0K0H0F0]0e0c0o0x0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�01111"1 1$1210111513191F1E1\1^1P1V1K1G1O1f1M1J1{1�1|1~1�1�1�1t1�1�1s1�1�1�1�1�1�1�1�12�1�1�1�1�1�1282�R����>(� 3"
�0��$�9_S�|L�4@	%���5�J~JNE;�	m	KA��A�So,bS�T�>I4�;n	�/�*=E*B	/!SG�H�h�?LW.�7�C�@g-�,�>u-B*�f�4]�T�#�(s@�-M#!1�N[�\)�
i�O�*%��3� �3H<�$3�;$2%2>202<2C2*232N2+2I2w2�2u2v2p2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�233	33"33333;3L3J3F3B3?3D3R3U3W3Z3\3v3u3t3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�34�3444P4=464E4?4�4m4�4n4�4w4u4�4�:y3��?`�R�'N<n=�
��v���#E7�GuI�7���P6?��J�*[/>"4�!�C�?�L�L�@&F(-�@�D�,�aK}#~#y�+�TU�T6YBI��4�5)��/kl��Gi>�S�3Z+�78��RAD@(�?���HG;�4�P��8�#QT�4�4�4�4�4�45�45�4�4�4�4555%5$5'5(57595/5-5L5N5Z5^5a5d5p5v5w5u5z55�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5666!6(6=61656%6E6D6B6G6R6Z6X6m6x6w66�6�6�6�6�6�6�6�6�6�6�6�6fH~M�*N�9MS�g5UF/#E@5L�:�J�8��8N�P.6�%&5�M�%E �A�
�E�>�'���2�T�0��M�
*M	/#1�,<BI9N�6�5+�;),�:�'=Be@$���<�)F�H�rT�U�=}/�#;8U$Z'��=j*>�R�&�0$4���@�>�>M:J) ��(�P�$�6�6�6�6�6�6�6�6�67�6�677/7(7#7'7$7%7>7C7H7N7R7d7�7Z7T7X7r7_7}7~7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7
8888888188!88838-8$8G8N8O8V8f8c8o8j8z8w8�8�8v8�8�2*eGa'�Y�9-�(8�7.�F[x�>8LF��\+,(5R�0�{+�-}� �Js7�J�y	37j"�2�)�O&%W@��2�8+�.��n6�$�L-3�
B��)=N�L�(�5�$=!06N9#+:G�E��
RAjl:!D�B�'jN�7��;f'GM�B�:f.FmN?M�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�89999	999999/99+9S999!9,9F9W9299 9D9&999*9(9$9%9j9k9o9m9q9v9u9r9|9t9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�R�9�9�9�9�9�9�9�9�9�9DB������C�?�+�$��@8�2&�!�M�R=m<�O�;C�4�D��9Z�6�F�Hn&�0\@;.�
�)p02�N�	�P8�-sK&&D�1_
�E#+��+�#4n3aCFC/;�(lJ�E�DmJ�#�$.4�Q�H�,�g�:B<�>453�@�'��.hrN��%�9�R�9�9�9�9�9�9�9�9�9:::::%:#:&:/:(:):1:::7:6:U:h:e:P:L:J:I:x:�:~:�:{:�:�:�:y:�:�:�:�:�:�:�:�:�:�:�:?:�:�:�:;;;;;;;;;7;<;=;@;O;P;N;X;g;Z;r;b;h;\;};�;�;�;�;�;�;�;�;�;�;�;�;�;��;w%'!F�3�#:?�Aq6r6�1k(�:�>@*uN�0�L�F.�"F/4�:��Zn5zJmC\M5 5&6&�J�2EK�'\>5Nu'�H�*g#$3�
%*�$�$a�[Q�@#n?%5�$s�)g#�(��6=�$58D�J8)�*�R:D��E�/�E�(���u �gG�O�O�"��B�9�;�;�;�;�;�;�;�;<<<
<<<<<#< <(<?<2<8<4<+<K<O<L<a<[<X<Y<f<|<~<w<z<�<v<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<==
=	==&=(==6=K=S=F=B=>===[=^=q=c=m=f=�=�=�=�=�=�=�=�=�=�=�=�=�=�@4�	�8� [P�7^L!,T�C��*B
A2�@�M�M0!�1$>�1�M� H�3�1TR�,�?EFt�W5P/�-

�0(
h �%�rO<0Q.C����O�=�]K��L=*��&;I3C�% J�0q�7yI�?u,e3	4�$E�\4o�>D	0S-F�Pj^CH$��M7Lye
�M�=�=�=�=�=�=>> >->=>>'>>(>B>A>C>@>H>K>R>Q>]>^>`>b>o>s>x>v>y>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>???
?,?(?3?5?A?>?I?B???P?V?^?b?n?e?j?{??r?�?w?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�: �16MS!b:a)�%�<X#1X��R@0�M�;�2y6�-S@l&_��y�?�[+��#��=�*�E�+K�8F�G6�?��M�*�@e6�D�B-K�8�
l<�R\T%=�M+�#�(4CBAN�4kK~~o:�B�@&�5�9A�E`�IsC�I�-��P�)]J�@oK�<7R�?�?�?�?@@�?	@@�?@@,@<@-@'@(@)@*@i@{@k@m@n@u@�@j@w@t@q@|@h@�@�@�@�@�@�@�@�@�@�@�@�@�@�@A�@AAA
AAA)A'A-A A%A,A*A=ACAGAAA@A>AeAYAjA[AuA]AgA^A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�AB�A�A�A��:�1�=�7��(�@R~	�40�Lb5(�3�J��@'D"*qP�P�)��'/%
*(D��,�Tq:,4�<|Q�/�4��&�jB�BS�v$
!!�J��K-.D�,�
�Fr:�
�	�
b%�7�I]�2��C8�3}Kp�%8O#F�R(OfDG*�D�16��S�����$��#,�%�A�A�A�AB�A�A�A�A�A�A�AFB8B6B4B:BWBVBSBuB�BsBzB�B�B�B�B�B�B�B�B�B�B�B�B�B�BC�B�BC�B$C#C/C-C C'C"C6CPCQCuC�CrC�C�C�CzC�CxCvC�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C	DDD�COD+DD�C�C<D@Di4 .u(�5D�R(A%	(</�H&01-�MK�90B��45�*��R�S��.d/ZR�)Dk!�+�B�!�M�4U'EF�9+>(7C��@�
�
�@�
�StL]I�/^.RH
�IRR�EQwDU5FQ,!nV5?'��HU��7i �cF�PqI�.����Q�QX5J�>�,(AF_P~4?DIDQDJDTDSDPDcDbDdDeD�DhDrD�DjDyDlDzD�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�DEEEEEE
E E(E#E"E!E5E9E7E:E8EGEFEREIEMEUEVE[E]EbEtE�E~ExE|E{E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�EFF*F+F'FM2+�G
C
�"�5�7t,m*6�RQ�Jf!.E7N#�-�9Tm#Z%� 88��P�'1JkfS$:O5W%�ExR#�<�M['H
��
j&n/���G��Q�1�1�1"`1N=R9D�
�DY#��E�E�M��L�>�G2S/7
PN�;.f�5�M-�Q��6�-3K�i�"
&'%�85F9F@F?FVFWF^FZFmFtF�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�FGG	GG-G$G/G'G,GUGEGRG_GJGCGHGfGZGMGLG�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G
HHH
HHHHHH$HHEH>HFHCHXH\HjHhHaH�H
)^J��DC�@z�7��PUS��?
�N�A�C�F��5*�#%O��u;j.|3&�
�9W<��#S�Q�;�9[?c9b�DN�	�#(NBC$xP!
O �N�8 �J$G�A���O�in$�:�GR� Y0v*o+p+�+<9�:w�P� u+�=&�H�Q9!@B�HlH�HvH{HpH�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H&I8I-I9I7I0I+I,I�IRI|ItIOIpI�IVIYIaI�I�I�I�I�I�I�I�I�I�I�I�I�I�I�IhJJ/J�I�I0J(JAJ�I�IJ)J�I�IJ�I�IgJJ�I�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�7�?�B�=�L$��3?/ 0,tKS�4�O��
i~)�4�"@!�4�)"$a87��G�=B4�4�Q;	�f
IT�4�K9���_4E�-D�(fO�E�7RjF"$B�I�(!.B�G2BIG;�C4D4���F��6�<�EhZ
�5�F�J�72�>��F�J�3GKK/KK=KK+KYKZK[KXKiKTKvKVK�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�KLL�KLL+L'L&L>L@LSLLL=L?LYL`LeLrL�L�L�L�LjLvL�LuL�LbL�L�LgLL�L�L�L�L�L�L�L�LM�L�L�L!MMMM%MM�L�L,MdH�:X8�J�D� =Dh-r	L�QSE�E		8XG�6�S�EJJ;
�98��E�PS-QH4T�O���W'JZHF- /�R!Jn �H�O?zI�4EP�0�XE�4;��T�<�R�hP�K�E�F2J
�L9NXD�8`L��4xzU��C�?<8�
�6+8,�/cGTE�FMM MM@M�LvMzMrM�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M1NN.N!NINCNWNkN]N[NgNVNxN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NO�N�N�N�N�N
OOO	O5O;ODOEOAOSOlO]O_OmOoO��=I�$�R�"�"5A�Q�5@W$��"B	>h
3�UL<"G3}3�9��L[D�	��C7A�Av�:b~~3:�P4:�3	:� "�4">Dl;�??C	
�;FJ�,�J�/0�S�`	�Sj19<�SX@ �3k/QO�TW2�Sy&R�Bl)Z8y\T0�L�E\0Z9F[9�]sOqO|O�O�OWO�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OP�O�O�O�OPPPPPPPP%PP+P,P6P7P?PFPGP:PIP9PTPVP\PgPpPzP{P�PP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQ�PQ�P�P�P�P#QQ$Q*Q�[R�DK=1�=[�1HMTASfB��J�AC#-	��R4H�G�F��.l1�,I�@E�<zR�7�0<#
��uK7+GD�+iB�2b	~F*=0;�5
Z2`9��M�D)D�<�H�HXQ�Lh,0%M,N,�7sP<,&O�T&6(��.�GB�S��tP�I��#*1	dE��ENO7)Q+Q(Q&Q6Q:Q3Q7QUQ;Q=QKQ5Q2Q<QjQaQkQlQ^QdQ_Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q!R-R(R/R1R+R@R?RSRKRLR]R`R\RbR^RpRR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSS�RSSSS%BiO*1QM-�#��K![�TY�WSS,=OyO963D<>O@1�8$F�NG<�
{;C^2 &t.KIx�OT�{J|J�7|5|.�2,�;&}R��IK�]M��wP&F�N�$b8�@��%�IKyP�G�
�@�
�H�}5K
$�	�D".��N�J�
�OH��>�5KEWE�dRU8�E�RSSS-S2S3S5S8SESQSPSRSaS\SeS[SrSjSlSwSxSuS�S}S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S1T�S T2T!T8T?T7TcTNT^TFTHTjTzT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUU
UUUUU)]*]+],]-]B2f�B�qEBB�&:�(�1[%�
r�9�C�R RHH#�>JJ�,���
�*"�v �B��R\TBB�@�5`TXsJ�0�,�/=�,RLv,�:�+"��"%�-��L]�>J*BiJ� �
E<$!�P�M���<Jv�?�0��<
O�Q�A��-�6�/��	�<-��xL�0|�>_HkH4Q9�DK#2MM�<�Rz-�+r1O+�6�,O8��G� ^:I�G��0q'##O�)L�
�I�@Hp"�p!�#!�7f?�"a0� 3�KJ��?�5"P�$�6�I�,�5�L)0�FQ?\A���!�RC.c!�K�I%CSC9�TE�[0$�)
�8�"�={I+
y*B�('y�S0T��E6O���NE.K�F�P�7��`4�7F�NtR�#�N�a	�7�=o/�@C�)Sm;�e<#$RE#P��+�nN��N�#��V�8�VS�T�6'O�&nJo�	�?R�SkNTOx
�N�G-1�7>?�-�{?AL�"�!�R�I�=e�[.�,�
�G%A4O%�L�0�K�:��2�6�.�S�9�)�@�@=�F"c f�GxD��?kT"(�<��._
�ARH��/>F:
>�>�742�TNN�A�F{��#�1>#��:�:P>�G�u*�D')1�lK�)�$��&NC�?�K!IC�N��9�G�GSF (�N�M�qR�N�A,>�B�	�	�B�<�T�%�74�3XC�S� �3)
��	�B�O� �-
�
�}F�=y
�;AABKP!;�J+ T>5�s�(�
*4T'=�4o
�733/�NZ=:�N/A�!� �	��MK�17?"JBX'�*y"�2S	 �:b+AR!,AGT��7�.R d-{�;;Ps4WI�"�$�_&8@�4'Q��E@3m�"�A�T�S5@�LT8�^;s	8|F�H�MF�g�SZ0@,�
;B9r+iP<O)3� �G�O�	O�q�A,2G��U$E��Q�-�Tg
0�?�=@EB�3�"'*&A���/�H�=/r �-�I���R54S�Cb
g�Qp��* �9�>.D���,�9�
3++U�1AY@��. 	.b)�(�$�?5�Tl3k1D]T�/Q�LT��K��O�	?�<L�T�.T�>�2�O�+=��'�N��
�(�&o<
1;kB%#$}Q�2~Q/aT&�N�-�>2 C<R<�;c�Q�R�"{B�YN�%�Kn�A	0,<�G� 4G�J�O�0�7�Tr'��
��)�4�7��+�E�D�:�D!�J�2�
	G:-HT4J�S�9H�K
�?!Ay�P�"*0QIs%u1��(�T(K	??|-�,�G�oq!a7�7Q-��J�	�8��F�&�MhQ�	J0�-	L!&'�;33|&<�� Q3@�
bAN�-�Q�%R�
�@(('C�@$r5�D#.�;�4�S�TpB#%!)'/
48=z	K$�5�)sF, M"N"�G�*�!�47(�$~Q�G:=�
OKiM>	pOx-!�ME	
F��5i7�"�9�>t	
��,�1T*]6�"{2GS@��/�>�6

v"��J�$���M*�K]&0
�D%0�J��-�22v?JE�1�C�GG)N��u%�X �/�Qt6tC���3�A�2y1\72�RW"�Ie,��0�'5�,�c5�3

8'�-Kf*UK�3�+�7�2gI~5��? >E�R�=!3�5;E�4_�F ,�1�w
u�)WK�4�"KY'
��P��"JH�/*ghQ/S6�=�R�Q|H�!#J�3M9�0"& "4�(|!5rR�N�Q�7x&8M�7L�I5kP�?l�3uR�-b'nP�Oz&T7�?���!�I�/�2��-�0�5c)�.a&f66�5HBC<2��"LG�9�TM�@P�O�L�@�!t�P�Bq2���);^�R�!y�8�@/L��*L�%w>�B!D;
L%�D�?;$K�1�1�A�:�-Z1:�9��=�L��.�>`
�.G�T�
��?\KcM2��5�C�?�x!
2.#ZB���.�=&(�.
FS�P�8P6{,	/�@|�%��>:]$fK+M;�*�^B-&?'�M�(�/	IS�@�qFvP0�Od�$Yv'�7�!��I��S(^MmJ�$�/�%�%v(*'�gRZ&�@��T@�#�XF�DG��IJ`.b.�P�)I�5��8I6r�ZL�II1VO�?�>�S�m��'RL	�-S
i	S�<?�4FxML-iIc�&�FH�LJ4^m�I�4k"�E�&��F!l6�T�+��1y�DF�?\J�@�:�~<76�FfCf3%�43�.G+�I�"�%��I�A�NO/�K�&��l9�*�>Y	[5�`�{N�Im)H!�=�Hc�,��\ 1�&y2^OG�3�L�F�
#�M�9$�=:�O�.�6�)'KrQV�P�A�%�;I��#@�� fLmR�M�H=��M�.�
Q;�G,
=�8�PLbN���@-�H�
�F�;q.
�M;�)PT9�g
";Pz-(3
��5X28FAM�I��&\9�)��O�<94%�M%L�)e%�=�1V7hL$6�?��!��DK8�M���Y �R?�"G�8r"jP�DN(�TO�106E�S��T8-�I�<�?9gM
_"�
�$UOR`H�V�I�r%��c��3�JzN_!�B��'P,.W>-�KM:�"Q8��&`I�C��)[^E2I�.�"r��+,+�O\.��,�)�	h$�EA[O�;�N�AU"�O�.�+�&KS0P�<�}B7��|�&E5BV�.I$NG�	��(^DA8$e��B�4:DS1�3hR�T�0�#�-L��C! �K36I�*�6$�9�L\N�#�C�C�:{<%,�AF6T�TI3A�C3N3�Kz*'	��&:S3*3�E��F�CO@.Q�*�&8
+I��"�+�"2&�N��KW�G��Nz�K[
�=4$�%�9'��-%	#>�K)#��:�J\
?$(�"�@j�3�;�".�]	�;�Wv-��p�<:�>
~/�$�{0b1&KZ�:v+�/� �&1((�.�3M("�
}!BI�6�/36�--�?�-O)�/'FL�L�3�L�M�?�Qu/�<�
O�-B�N�%�L�G�TU*0
��P�M�_=2�0�
�N�TLK&1�T@�($:G�<�O:<�SCC�U<d4�oNO�!�:�
�pN�K��O�u0�XM1%�NII�F<�0k.}J�G~J�-?6�
�Gx'I+J+�-	E4�8L+�G3=9d95%���I�&�
/P,�0L49�PgQ+?)a-�k7<3
@A*"PFps�152v1r4�FsC�#!
"QbyE�3d*�+�Iq�F�Pi$�#�:+G�;D�H"� �5�Ha?�N@�L�;(�S�*�8�:�!P�&��I�L
�8�F"H��#UB��HQ�4U7584�:�)Q.GN�BJ/�5�"s9~;�� �%�LUC�Jf"E/T��L2AN3�1:*�5h�:�BJc�8�>�A�.G2R49�/�H�JD�w	0E��MJ2���,�D�� L*�J}2��6�5 	X.6MN�I�3�/�m�J4!�$J3R[B��5�<�!�M`(w-�@jT�-�>N9�+l�!\'���-�/-M�:UaL���P9O9�=s 5;4I�r)�-�7;3+�KC@x@�*D-�O}� �&�D�F}=��;�J�Q�8t<�>vB�5�LQ
_I�C��L�;�:B,hE��6SS3-(0`AoI/_E�C*?��L������D'9K�D�
��bA�Q�.u
aA�!	Z�:.N.�/�UHU}-	�IZIG>%Gr!�F~2�8�;JF1P����8�
�8.Sc
�N�0.>2=�Ok*O2>�%N�/H�{,�9Q�,�-.rX�,P<I8�I[:�"g!1>1Es�I
5���8�,��J:!sR�
�C2>},�$<9M�E�5�T�Q�7h
_B2E5�/�=�R�,,�"�HC9CjE;!<�$�.0/6]+@I�J5"ZN�:@2�"e#�IA=�4a3?E	�?�
�`N+#�%�S=3�;�2�KT,3�
'!+}=:�9DG@T,�!�;�(g#�Q$M��B�@���415�s=65�!iS/�2:�1:Xw�M�,�+Dd+z1�@z�?�$��9�'V(	H�:�6'e*�)<F/
?V,"�M8L7�!�2c:x-�[{6V9="c4DoP�E�N=����K�)�*L$�?�D>N6(;BM�
>:\rw� �z�?Rm:� D�L�=�"�SH)3E�3t83I)�H�
QO �C�>*1(%#/|6�	w]%�<�&S�Pk>�'�T� 	�M�9��<�e)!"g'�/�(.%�2p/� �+�0@�&F�P�JD�R��E\�<�F��'��FK6;IA�#@�S�  ��A�*��R�1�A�:��S60�8�W8�(�9�D0G�+��:��E�/�FFA�*�G�3"8E*eK71�%N6�;��Ei<-/',�gKD$���)�F&�R>I�(/F	�9i:t7�75>��#�T�/��/�C�FyS�$VO"�;^#��@pTQD.�T�><F�1�2�SOIM�]*��=BJ&�<���9�P�( +�(4{��#-"�zA-�?��
C
C�{&c�*!HL&�gC��>@�?�6��>!�P,=xO#6H	�B�L>"�8�_@�4P@o3�8I#�.3K;_%p
�O&66)1���Sf�DzK
No�S�+l�
f+HLk	F.P2S2�A�&Y2��GcA�O^I-Cc
�2/^U%K4DC=H5#�?��(6�Y4�B�M�;�'C�&� �D�+v;�#�g�>�Q�!�Q$��\B �a�.R+-�cMI	5:�FG_A�L�3�O>xT�I�+c�\p:#�F~P��P:RTmE�H�*�.a��2�*A���B&�;�!�HIz.�@6�<�;�2�D:qG/�u�6:T;A<K�=�'�!�;:7�:�?i�P�PM$oJ�M�<.HB^��)� �:�T�;�;��@�,�(�;�.�T�>qERFM&�9*�,)�$TDJ.kL�:�~R^7Y3G�5�98&��0]R%�0C?)C�;\1@�owj��~�.�M�=�AIA,90��0
%5G�2|0��$�OB�7��-�):���.�SQ� ��N�:|�T�I�.�;�C9N0%�1"vS��Q�A�'�7[�O/�CH:XL�R{u?�"��@�'�6yT�I�(?"�2op1�p<$*�K���l�9K(�E�'�Nj�9%�B'B�!:lPa2�	�(F�/1��2�0'7�E�C�	A#u:�'N-��0z;�83�49Hq<�C!��T�&q3x$+�D�N_=R	�F�K!{.Y=B1�=�=P5�7n!$|;�(� �_M"&(N�/�9�D�R	��"q��D=N'�1��7�wx9�'5�?�S"�C=�+nW:=)�S�+�PO6^%-J��d0*�$:,�6�D�&FO��23��T^HA*�N�K%/@-�+� �!�'�
�0�+G2�E�F+uH�)TB"'&�1"K�1�P#�G�?�S3e2�S�$�=��Do��	� Z��J�iT�F�,S4�Sh�-��3�KKC#>.�Eno�2VR�+E%�$j�T�"�7�/�#�F:�!)t�(JC�"
(w(p$P��H��Cq3B �$.�$T�4&/�)�T9)�N&.&!�<�R$�6H*E�/E;*�F�Q�B�L�1�\	 *�L�M�BZ-��<��0Kr	1FP(1��4�(��N�@O@fN�<�AM�12�)y%0�+�Hu6��
�	��C��.S
-�Q�P�'��0X(�B�CL�Q4??Q;'6D�%?�	�!�$�F�5�Q�P.Q1>z#�O)ce%)� ��E��$� .T�;I'�
G��2CP�Q%K�T;�<�5j�'��#����	!�&H+�*�)�9�7��*YG�O�l7m!�!Wn�6�64CD�,�B:�vO`-�O�/�B]'?��6����]�Y,!7q#X$�(�=L7- NN��4#'�97r#;G�@hG��JM�@����4�H�@��@�J�#@5v)kY&�<j /p8!-aOC&$��0D #4m�	�(MC IF�*dK�P�;�;�DLj`@:��5�R�D��2e1�
�<�R�N�3?!/3�3�(�TB. �M�$jG'WRL�c,9�7~=KN<&r03
��TJ�5�\�!Z(�Q�I�P��%rH89�Q�4�(dP�-�?�#�5�/z=.�;�!�B5X���1�"�<�q0�!�B���/�
��;�@�@@s!�p�;��$�D�I�Q�JH��x8f/%DN�Q�/�	�t4=~'?���9�s\LE!A3+E���B�7�81�P|C�
h/JU)�J�o	�(�8WC�J�R)H�5�B�
�G�J�L�?�- �T1�(�&p@��2i���!�
��N�.='�iROA01��#�)<Z0O�D*N���Ng*�L	�-�1�8�H#	�G `'}F#�*,�>�F�H*B7-=19�"hI�Q�S���P�#Q42^<�s�9B(�LQ�4*��0P*mA�/q �J0�!_3�;V�=��G)NN�A�<�
��B�J�6�5�&�>0S;:MbCK�-$P�
�JR((B�%�%�LQJ�3K2�N� ��N�L�
M;e�:�
�N�KZ!B�'6%$-kF�N���,�7�,7,/4Nd
H��*��
���,}	wOc'm1vRz�O�J*S�>h'�4K�An'o'|�J�Vt*�,�=�6�9
	�(<1�40�
�B,UG�J"6N
1Y
��:L�M��MA�5�MY6<��S�,nH�2�'we!Y(zg8�RU��P�4DQf1{)G�"�6�O0�PW+�>s)�E/�?�-41G��LPT@?0)-�+Y?��9�	�K�)��<�Q�O�+�6y7�)�)SN�')+��A�@�#IBtJy
=`M�' 
�//;H$@%@�B6*++�$�%
z%#
(y'���%���3`=�P�	�3��b=��+��=�!I-L��5)��A�5�3Y.�J�6�,~,�T�<J�H�<mJtR/��J��<�� 2�=�KL;�=NFT"c�;P&"'nL�A:IG7�D
BP�6t �:bc�9Jk�G�#qLx/R*�O-�-�'�IH.@E�2�8�
S>F�;�H&H�A*�*	�G�'M�?�F�>�'*�7hNBJFM�o;hC!aL�
�EBx%��9�:�B�Q|4U0+@Q��P�=�1��B�SeBo5�<J<��#�#�D�
-4.4�P3�,��.�<�;�D/���#r<9(�93YFc����(oCi2�\?�$@�5E�*"5�Z@M34	�# 6sN8b@�p�<2tNUe@��]?��C�DC\�N�$�/�:KvN�/��J�C)�H0�3#�C*:�E�I�E��:##�1ga�.�5WH=T,5M2,�<2$�*�*A�-�L�bF�+�
�E@	GG�S~b~�%�'}O#>F�#? -E9*�B3�O~B-�A2!-A�	�RwKF&mP��6�3�4:��+O�!�QRp�E�+X">�+)
�8uMoIF;AT
�,�#�k�;�F�-y.M�?|N/9
"/�0�'R	��$�3��[@��#[8�I�I�!C�0�$�=sU>�#tn)>�	�KN�a\�>�>�0�#�>TTrH�#@<b[2�!���3�I�6/=��kG�@�!�KCSlGiCE�I�M�6���#�$y$w0c?�)M�H�:3��F�G��@6+�I;<0z6�:#�*�!.,s0�	�!�&��=�5g=��P�7�?�>0��%�G0$-%ULO�� ���I�0(P�&�>D`7�*b�.y<a �r2��!��CMQ��!�0_ �M�,M<�8::9BF�;��-�/b�!�$33L�	kC-�H�	��Jt!�R>K;�4�pC�0x('%.5>��0�K�K�$L�?�B�OZ�6><�&�OF�7� es:c@8H�H�:�!�6w�'KB�'l0m0�'opq�&r7�rE H�O\:�H�'�y��8�'<�:?�O�>�5"M� ^
�J���;�J S�IU���<���=�:�P9��5�=�q��H3>07�=
Q7�
g<�+6m$�#�<:"POX%r��D)�'l!�E$�3
 U�2�.C�
"S#��l/� 3<Ti3~!d:�=�:�`H(�2�*�,�� �,�'GJZ�an< *{)�K�TMF�!,1�('�#?1P�2�SpJUn6RR8��Q�*Tn,�9�(,�D$�!�5��CNH� 6�$Bm-�cW!�);�L	B�H��]9]�S��C�Ir
�P�@��.qN�������<9�@�B�:�<HS�B=#�'�:�<I�@P,�<*�[MpE��6B#XS�7p
z
J`�5�	�@�C�O:+�GW,��C�)�N5-8�>���$�A�K!���P7�-�q5H���A�0��K�pM��P`W\(�4�	S:�Q�eE&))%�$M5C=sA�+������*�A�H�6K�P�'�&��RM%�(c-'6{%�7�%L��!I
�OX/S)FKGsI�Ql$�A�2C17�R�L@�LcL4
�#8J�oG(��6I/J7�-�>�>����CN[�0�D�)#M�Us??/
�F!SVQ/E�5�6QN�@sQM
�(L8�� ?=J�41�4��02P�M�/�R| 'S�. �/�N�d'�P�;�OH9�??�:�'�)W0�<R�5�<��F�4A8�7?�R�J�)wRs
	�'0 �:�3?*j
�,}��`�)�K�O�'�J�
��#kJ�30��4J�:�A�3�S"�H�=��!�L�Fz �L*IS�,�5��*/}
P�0"�%�	)&�x�
M=� ^�2�)(�#J
}P�2;6%/�F�E2!���$+T:	�:��$�<�.0(�w.�,*.
Q'0.�7#�0<�1uN$c�>F�>Z!��	E�:�(zS|R8X0a#�<�#bT#"�1�1�G��6�G��H�A_0`0�2���2��L2=�4�BdT#6t:�#?g�:d2�	R�'�/�<LB���G�M�T�6�7�1R:�(MB�)P�,�s�4RbM�EG
2;6D'�O=�'%?'���=�G�)�Or��K�!T�?S.�)�6�>6�0�t2>4�l��*"0v6VC����J�	d��%LY5�O 4T'�	PL4mE-�QX:�4�=#�1�-HW*r8RP�7QA%�
;�2�3�1�A7M���;J0�=5l?J$+~�5*-H#�!��:�L L1(b4[*�3�*F*C�J"I?�0�R�G(�(=�C::9 PB�H%u�5�JQEx3IT;#:>@F@G@�L%J��4�9=3�"�>�U0�LW;K/D@/L�T,�&:(3D�N;=��"y(HH3�!>3z$�6Q#+�kE[5k
Z#�M�/gQ=��\*I%�5�4
�#�/1S�7�;T=�%�W=�/�:�)�MB
�<7/_9��j0�<B�C9RP�9^*�/�/�7"+�&�+@%��4�,K�3�B79�RyL��&�@P-T4�0��8O:�%�:�=M
h"�YC]G�4
Q6!J9?�.�7BD�3Og3#S�6�29?�6
L"�MD�P6#��/
�%�4
.;�+��(�QeT0:��#�1!&�P�/�)�6** 7�E�&f2g22-�#?.�s5��a-��B�;���jMkM�Gn�DffT�'i�7�*�1�1��EQM�>o1n&�n0�1�E�
�G�O�L�
�5|.u?0��L�j377j�>�,�\8��M0�(�@�b(�N�O�,!L^0I,��B��N�
T�#�RsLzL{
�B�-�.1e7�I�0R���^(�RO�A�7N@+p9��
+w3�-O]447��2�;�k<B�BT+'�%�=�A�S��&�T�6��N��E6l4���IP'�A$S
L0�fJc+nQ�1�1�H�
��4� �&T�N%-|PxD
+��RrIj�4�/i' ?Ne4�0N�!�@ �@#L�0�-E<���O� r�8`
�;��9��C&� @NP�RK�&�)?>�IjJ�`@�|"bC�N�$Q�!nEn?!0=�+�7�O�;�3�Ln-uP���:UAg4z71��=a%;7<7�!+�	7%�T"B�KC8T�1�3�Co-�0�=?C5,�Q�G�8�	�>�$]#e/�)=�E�<w$e1&B� c%�F9�?�3eFI���;���2oQ�m7�%?UR�;"#3�_C�B7�_&�g2
R�9wQV)JRJ m�V06./n1�
!A1�K�R''��&�T�D�Q�|,gE�, 0�� �7fTp3��Rb�#��-uJb#�(��>f)s'�T:%#+gTR�-�LN�8E8�3=�E�R�#hT%�
59O�?�?�L�6�O&�G0414w:H��6��B2?�e9�6%F�@��<A;/�6�'�)9�8�T=�;�H��K�2�1�@�6J8#&��$<,7�=�4�F8* ;R3T�3y�L�%�@�=
�/�M7�Jy�C�)�	F ��=
T�J�L�A�+�M$?tS�;�  �)� �
�3))�A�N�,�':�DL�L�0�-a(�:���;Z�T@#��C�F�)%&��8�=�87��3j'�T�_#���-�-��8Tn�+4���6OBj4�84�R�34DS�K	P�!sF�eM�4�C�F3;��T�7�7z�'�F�+mBOO�Cp���":O�6�O��8f%	�$�9�A69�E*�9�%�&�)�+�P�Cz("I%C�
��>-�LO00�!4>7O��"�O<!�K�1B8t�-=�@�?	5�8/��@JB'��1�;��H�$rF*,�K��7�Td%�H�.3�)� 619�S>{"uM���!�8()2�"���*?�Gm&"D�?
�C�G�=�<�KRT#Z*]5�=TlE
5����&G,8<+�=!�R>+�1�8'
!<L�BJI�4�<%�3��UVLVA�G/Bf4jO�O�-�I@�%�l�G�8�Q6��8�-,��MWQ!�3�P�@��8CM�iH!!00w�P��G�F0Q���@�.
�26k'�+J!?�+�%*	R��M��4#D
t
 �Hs8RKMHLM�F�=MMx=5K:A'��YQ�G1*Du�&�R7H.=}�(86�,��5�oEMWNWOWPWQWRWSWTWUWVWWWXWYWZW[W\W]W^W_W`WaWbWcWdWeWfWgWhWiWjWkWlWmWnWoWpWqWrWsWtWuWvWwWxWyWzW{W|W}W~WW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W{R
�)2�-�*)v&�>y1?nTA� YMI[!\!v#B]!1 l>=1=���"�~AD8�#
$/�(#0�9T��S�/h4b2
��(C5�3 �>�F�M�1;% I{SP"�c#�8�1?vJwJ@T�#cq1�� !xJ�T]�9�9q
�+6�244=�5=N_*U��>�G��M�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXXXXXXXXM0d#�*�>KG�A6 d���JK�MC�@�8�
�<�B�6�'�v��;h���J�H�Gd�%{=n"=
=�J�>�)4DV|=�	��>�P��HLI�.r
R�'�K�(:�S�LWA !�JI<v:��JHNK4;����&�GX�KCLC�>�)�TfMPK�(�>MClF�JD0�9�)1B	X
XXX
XXXXXXXXXXXXXXXXXXX X!X"X#X$X%X&X'X(X)X*X+X,X-X.X/X0X1X2X3X4X5X6X7X8X9X:X;X<X=X>X?X@XAXBXCXDXEXFXGXHXIXJXKXLXMXNXOXPXQXRXSXTXUXVXWXXXYXZX[X\X]X^X_X`XaXbXcXdXeXfX�Im+O�L�O#I<HE0@.+K+QK+8NgM�$o{((:NRK!�4J%<)�8�DE'dF-nRNAU#Q2��M;�%4HJ�@�'�IJEI��O+:�(�l'GC�!zG�K5_6T/+S�=+�L�'�	@!�&�-�A!A�%�CrG_B+�%
PD�1|'{G7�)�6	��+gXhXiXjXkXlXmXnXoXpXqXrXsXtXuXvXwXxXyXzX{X|X}X~XX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�+�\/�4�4�,��C�#�+
��4�+F,Z,�T�.\��6a=[>^�"~
JJP
�B�>�,�2��G�*�GN�
@G�G�G�P�P"
�MI�*�O�G�|(_,�MJ�40	N?�R\Q$+��&?	(	}+3T�aW�M�W�Ms<�<�9!�@A�"?;R�4�8�89�=7 B�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYYYYY	Y
YYY
YYYYYYYYYYYYYYYYYYY Y!Y"Y�8 �Gm>w:�C�$�H�A�A��D�E�@kOr.;-�1�O'TekK
�	�	��F�J�D�)Of9T
�GM �=v'p'�
5�D�J.��H�TN�L�
�I�-*O��4UN�G�.A�J��T�#G��J�'9/:/�G(
(�!�}'�c44�b�#!�DN7$V&\%�&#Y$Y%Y&Y'Y(Y)Y*Y+Y,Y-Y.Y/Y0Y1Y2Y3Y4Y5Y6Y7Y8Y9Y:Y;Y<Y=Y>Y?Y@YAYBYCYDYEYFYGYHYIYJYKYLYMYNYOYPYQYRYSYTYUYVYWYXYYYZY[Y\Y]Y^Y_Y`YaYbYcYdYeYfYgYhYiYjYkYlYmYnYoYpYqYrYsYtYuYvYwYxYyYzY{Y|Y}Y~YY�Y�A�:M�16G L%vk�8�}\DCE�
.]/]0]1]2]3]4]5]6]7]8]9]:];]<]=]>]?]@]A]B]C]D]E]F]G]H]I]J]K]L]M]N]O]P]Q]R]S]T]U]V]W]X]Y]Z][]\]]]^]_]`]a]b]c]d]e]f]g]h]i]j]k]l]m]n]o]p]q]r]s]t]u]v]w]x]y]z]{]|]}]�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� gbkEEESEEE	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������AAAAAA\CEEEEIIIIDNOOOOO��UUUUY�SAAAAAA\CEEEEIIIIDNOOOOO��UUUUY�Y	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������AAAA�A\CEEEEIIIIDNOOOO���UUU�Y��AAAA�A\CEEEEIIIIDNOOOO��UUU�Y�Y���������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~� � � &   ! �0 `9 R�}��    "   �"!a: S�~x������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������AAAA\[\CEEEEIIIIDNOOOO]��UUUYY��AAAA\[\CEEEEIIIIDNOOOO]��UUUYY�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� Hlatin1?
d�'��@B����ʚ;�T�vH����rN	@z�Z�Ƥ~��o�#�]xEcd����
�#NJ	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[_�]^_`abcdefghijklmnopqrstuvwxyz{|}~������N�ʁ��}�L���~���������������������������������������������������������ƒÃăŃƃǃȃɃʃ˃̃̓΃σЃу҃ӃԃՃփF�@�A�B�C�D�E�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�p�q�r�s�t�u�w�x�y�z�{�|�}�~�������������������������������������v�]�\�a�e�f�g�h�����d�c�������������������ˁ́́݁΁ށ����|��假�ځȁɁ�������������߁��������������ہ܁���������������������������������������������������������������������������������������������������@�A�B�V�X�Y�Z�q�r�s�t�u�v�w�x�y�z�����k�l�`�����������������������������������������������������������������������‚ÂĂłƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂قڂۂ܂݂ނ߂������������������J�K�T�U�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������E�[�R�S�ꈚ������O�㏺�s�^���N���������u������������������ۊO�厥�����T�v�V���R�h娘揩��������������T�������\����������]�݌܌�j�i�����������S����划���������������l�Y�m�������w����������e�d�����t��W������ߗȈ����‹������C��˜Ɉތꊚ���x���`���Ę���L�f�����ϒA�Șʈ�Z���C�̑��ǘ]�ØŘ�ƘC�ΘјϘ����ɘ͘�g���Ҙʘ���˘ИӘ̘��ˈ����D������N���֕W����r�טܘژ՘��ؘۘ٘ە֘M���ݘޘC��o�U��������q�Œ{����|����ߘ؎��l�㘑����ϗ�`�������̈Ε��������Î������U�����T���P�����Íb���B�����X�C�͋@�A�������l�D���E�H�F�m�G�I�K�J�ƕV�M�N���L��Q�P�O�ԘR���S�D�זU�T�W�V�X�Y����Z�[���������[�Ɩe���Z�\�}���]���S�_�`�����Z�a��������T���b�c��~�f���e�čg���h�`�i�j�k��ʎ��n�l���m�y�o�p�q�~�u�s�t�r��v���w���x�y�y�������Ùz���Ë{�}�����}��~���M�����ʓ��o�������n�����ؐ��������Y��������ʕ��������������������h���䒍���퍎���O�����U�������܍��������菛�������n�����c���������������͗�������w��������J�������N���u���E�ו����������������啫�����΋����M���������َ��ܖ���������������k�����x�������ٔ��������C�������\��������ߌ����™ڔ��쑦��P���m�ę�T�řƙK�����p���ə��ș��ʙ�˙З����̙Ι͙~�X�}�ϙЙ��љ��Q�ҙ����y�F�o�����f�������ՙb�p���Ì�ٙ@�������ڙؙ‰䑶�j�E�����i�ۙܙh�e���g�ݒD�����@���f���N���i�۔�܊ߙ���z������ݙ�ޙC������ۓ������������Č������a�������B�����@���]��P���D��C���i�A�������ƍE���N�F�G�����L�K�N�M�J�S���O�H���I���S�B���Y�X�O���P��U���R��[�V�W�T�Z�Q�`�e�a�\�f�P�h�A�^���b�[���슅�c�_���i�g�r�i���d��c�m�k���p�j�n�l�k�o�r�w�u�t�Q�Éq�s���R�v�܉����}�{�|�~�\�X�x�y��������������ӓ������d���������X�����������������������������d���l����c�����͈}���Ō������ޕ����������������������y�����ݍ\�n����������ϋV�������B�����R���ؒ��������^�����C�_��������������������������W��u�������|���x�����͑��š‘ÚĚƚ����ꁉ��g��̚��ۗ�ȚY�˚��h�����˒Ǎǚ��U�ɚŚo�͚m���Κ���ĒКn�њ֚��՚ϚҚԚ��Ǖךd���ؚٚ��ښܚۚޚӚ�ߚݚm�p�s�ᚺ�누�ْ������ϕ�ĉ�[�O�Ǚg���������V���v������Έ�����ޓ���t��_�z��������������������D�������z�@�D�A�@�ܔϖD�J�W�d�����B�E�ÑW�i�F���ȍ��G�o�n���ƌ��ψK�L�I�W���H�ÖP�����p�Ј��Q�O���R�P�N�P�M�ؕ�V�W���S�K�k�U���X�w�Y�T���}�Z�Q�[�_�\�ʼn^���]���k�d�a���`�b�c�e�f��h�g�i��l�ڒd�j�m�n�q�o�p�q�r�E�s�����t�u�y�F�ЖG�njv�w�w���x���y�z�{�}�~����F���v�����G���@�����蒶�X����q�鐺�G���{�ɍQ�����Ɖ��e�h�⎃��Г������x�����������Q���@�lj��������J�˞R�����������������Α�����ˎ��������ш��q������������������ޖ��ċA�����ڎK��s���A�Nj��������͓��r�����������W���j�Ǝw�������ԓR�������򊨛����Z������Бx�����݊����������������㉴������������s��������������R���śěÛ����›��ɛƛț��Ǜ����ʛ��˛̛ϛΛ͛����՛ћЛқӛ֛�כԛ؛ފٛۛڛܛݛ�B�����H���I���ޛ��Ȍߛ��b��J���F�Ћs�z��������������t�ȐёA������X���蛝��y��훋�����������N���K����c�H����L���ݔ������X�M�{���x���Ɍ�����N�f�����p�����L�����f�@�C�D�B�_���F�E�A�G�H�I�L�J�K�M����N����U�O���ٕP�M�Q���T��������U�|�����V���O�o��햷�ʌW�X�^������Y�J�e�Z�[���\�]�_���`�a�b�S�R�c�`�F�ʍV���j�d���e�e�f��ޔi�����h�g�a�ґm�k�j������l�k�]���p�o�n�q��r���z�s�������O�t�J�S�K���E�u�u�Y�Z���z���w�����y�O�x�v���|�������{���|������v�ӑ}�}�����������������������������������P���������~�������p�����������������b���������������������������I���x���Y���ߔ{�������������Փf�������ɐ҈����y���S�đ��z�������䎷�����D�������������ӈ�����������ŜƜĜǜ��ÜȜɜ����œԑQ���T�֜�̜͜Μ՜Ԝ����Ҝd�S�Ϝ��ќԈӜʜМלc�˜|�J�ڜޜ����ߜܜٜ؜ݜ����e��ۜ���������蜧���������������圜��������������^���������ʐ����@���A��B�C�Y�D�E�F�Ցˌߖ[���G����ˍH�ő���K�I�L�J�M�����}��N�Q���Z�O�V���P�c�}�R�S�W���T�R�ܐe����┫������Z�����c�S�]�d�_�f�b�a���[���Y����U�X�S�ِ��`�q���g���@�h�m�i���n�A���E�\���k�w�l�ˆg�������j�����U��Ҕp�}���J�q�s�o�ߕ��{���̎��~�����x����P�v�|���{���u�z�r�t�@�|�|���̍T�y�ڐT�����[�w�d�f�͒}�~�������������`����K�g���������������h�������������r�������������g��ې��E���������̖������T�����Q���P�������d�B��o�h�����i�����������^���������F���C���[������������������������������������x�������������U�����̌��ĝq�~�ݝs�ŝ��ǝƝ��U�֓h���ȝ��G�~�ɝʝ˝��|�Đk�֍��l���͝ΎΝ��ҋː��ϝa�f�z�V�Н����{�ӝѝԝ��ҝ��՝��֝��؝םٝڝ����U���|���{���۝��ߝV�ޝ����ݝ������Ո̐���f�t�������������E�蝞�W���W��N������A���Ӕ��i������q�ŋ�ɉ�����g�È�������b��\�A���������@�ܓ��B���C�j���D�F�G�H�ȋg�X�I�J�����֙]�\�֑ō���L�����K�񍽒L�N�]���M���N�O�ؖ����{�D�Q��p�S�V�U�����R�T�W�����Ljލ��ێ�Z�m�X���Y��ۖ[�\���a�Y�t�^���ܝ�n�f�`���”f���]�c�b�͐��ї��ʉ}�g�e���d�_�͌k�i�ˉg�m�s�Ƒ��u�A�t���^�����_�ђM�p�o�q�n�v�l�j�r�h�����Ď�����`�̒ȓh����I�x�Z���z�����}��j���i�͍{���j���y�Ĉ|�~�ˋK���j�������V���O���������������~���������[������������挜����B�������������������ǖ������_���������I�����������X���������o�����ֈ������A�Œ����������������������������̓������֒k�����ȑ��^�������퓾��ž��Ƌ��|�����ɋ������O�y�����T��|�ҞP�՞Y�ԞӞОĞ�Þ֞ΞɞƞǞϞ��̞\�ƒ��ʞŞȞl���͞מߞ؞��ޞݞΒ��۞ٞ���������W�ڞ➾�͖�������~�ў���������M������k��@�ɓ������h��������@�w�������K�G���F�E�B��D�C�I�E�L���H�J���M�Q�N���O�ܞR�S�T�U�����Ӌ��~�W�V�Y�\�ԋ��\�[�]�̉V�^���`�_�a�b�c�~��������c���΍�d�e���f�g�i�h�w�}��c�j�l�B�k�m�n�o�p�q�s�r�t���i�u�E�k�v�a�ʚB�w�x�ꕈ�œy����іz�|�{�~�}�����������C���������X�i�Ô�`���Ĕ��������𓇟]�r���������������D�����������ד������B���������v��������͉����������������������򐑔���@���������A�g���D�������ב��j�m��������������Òk�^���F�������������h���������l�����Y�_�Q�\�����C�Z�������O�������ܗ����U�t���������Ɵ����җßi�şʟ��ȟŸW�ɟ��ğ˟����̟[�~�������ǟY�����ύ��a�k���П����ߟٟ��n�ԟݟ��Q���֟��͟ϟ`��۟ӟڟ��؟ܟΌÏX�ҟN�՟Ο��џןp��������ퟹ������a�������n��M����Ŗ�����������ؑ�����H�B���ޟ��Y�����R��A�����������В����Q�@������N�I�����R�K઒H�גk�E�D�M�G�F�L���C�O�P���U�T�V�Y�b�S�W�����Q�Z�X�]�[�^�a�Z�G�����\�`��_�J���d�h�f�b�c�g�e�m�m�j�i�l�ғn������o�q�p��r��s�Ή��D���܎ЍF�����u�t�x�Y�{�v�z�y�_�׈�}�G���~�|�w�B��������క����ŏR�ď������������������Əϔ��ώ������F���o�����n�����M�����R�������ӗ������z�����W�����C�י�������������������ܒ�������ݎ��ꖩ��u��������ЕŔ��v��������Ė����S�q�������������ҍ���������]�������Ɣ��������������ό���_���������Ɠ����K���T���������Җ����—����L�������P�Q�������������b�������l�������������ʋ���ߊ�������ω��X����������]�ǔ�������������������ԗՋ��i������������l�������ڗ���������������������������Š��������Z�@�Z�A���B�C�D�F�G�E�r�I�H�K�J�L�M�O�N���Q�P�Êr�[�RᶐY���S�p��T�c�R�b�\�j������U�V�[�Y�X�E�W�؈��Ȕ��\�Z�{�����L�^᪗l�_�]�Ԕ`�a�و�f�c��b�E�i�d�e�h�g�D�a�`�^�j�k�l�n�m�u�v��p�r�t�]�u�sᾎo�q�a�Ǐx�w�y�������z�ɒ|���{��������s�����}�~������������������������×�������ȕ������������������������o��ᒔS�����I�F�c�������H������������������M���u�~�m�v������ᐓ��X��ῖ��ĊՔ������ږӖ��������ȏ�����Ŋ������^����������������������������“��r���������������������˕u�ė�����������������������ᵖ�����m����Z��ḋΐ����������Ӎ��u�ԍm�C�j�v�{���ɏ��d���������������V����O��q�����ɕא������m�������������֔����A�@⁖���C�B�ʏD�b�F�E�G�����I�H����ЎJ�V�_�F���S�P�O�c�L�N�j�_�M�K�I�ˏ[�Ս��Q�R�h�֋\�T�S�Љ����T���U�W�X�H�Y�Z�[�׋щÓG���\�H�ȉb�]��d�`�a≔`�^���_�̏ڈH�b���c�Ő��B�d�e�t�ŗg�f��i��l�j�҉m�k�e����m�s�o�ϐn�����n�p�q�r�n�t�����u��v���˓ސ�w�����y�{�x�z�A�|�E���q�~���M����������}��⧗�����������������͏���v�����G���[�����^�|���Ɗ�������������Ώ���J���}�y���������������M�����؋�������}������������������������͕Ӊ������������Z����������NJ\���������ߐ��͔��ѕz��������Žē������U���������������ә�������Ȋ��������������������А��������������������ĕ���̋H���������������e�S�l��������⟊Ϗ�����������������⸐������ЌW�������������f���Ɨ������������n���I�@��g���C��[�R���B�юh�������A�f�a�����ےF�ݗ׍G�a�I�Џ��H�I���g�D�J�E�o�M�Q㋌L�U�i�����R���O�P���N�K�G����W�T�V�S�p���X㎑e�a�[�_�ۈZ�b�f�j�ԖԒ\�d�Y�]�^㻈Ȗ]�ً���Η����g���c�h�j���m�i�ҕɊɖ܈l���k����n�u�o�v�r���Ȏt�q�w�p�c�D�k�s��{�~�|��z�`�ѐɔ}�x�@�q�J�D�U���������y�������J���������[����������Z������������ʊ�������������������������ߍr�u�����l�딭�����������r��������������Q�A�`�����������H����������K��������������ˊ����|���s�V�l���Ҏ���㧎ϑ��k�Ֆ���������������^��������������������������������㮒��E�����W��������㣔��]�����яI�����̊Ҍ�����b�����m�n���x�݈��_�w�ّ����������E�ӌ������������E�\�����Ɛe�����Ґr���������E�]���B�A���t���D�C�o�r�T�H�I��G���F�J�����B�ڑN�O�K�L�M�p�U�Q�����G�P�S�R�c�V�W�V�X�Z�^�[�Y�^�\�]���d�_�`�a���c�b�e�f�g�b��h�՗��L���v�i�j�P�k�l�m�n�o介��p��q�Ɏr���s�ܕڊC�w���M�t�q�u�ʔ��w�Ǒ����v�D�x���z�y�|�{�}���~�͊�������Ǘ��F���������������Ŏ��H������m�c�ԉF�|�ڋ����������ۑc���Չ����������ꋗ�ϓp��������Ζ��։������s�������������������䃒����������t�`���r�������׉�������������������Ί��������䜔����������e�ۋ��ىҏ��؍p������؉ԌH������������专����G���ވ�������������������䎗��t����������䟓�����䒑������K������䘕����ӏN���֖f��������������䓑����~���u���W����䪖������H�@���������̕���������U�����Ӓ��������@�ה��ԏǎB���C���������n�����J�P�Q�D���N�F�H�R�G�K����L�O�E�E�I�F�d�O������V�T�m�S���U�W�X�[�Y���Z�˔M���\�a唑`�A�b�h�]�_�^�P�A�d�c�����e�f�g�Ռs�i�|������j�k���l������q�r�m�\�n�a�o�p�z�t�w�s�u�v�֎x�`�u�a�{�^���|����}�~�g�ؔ�����������I��������������w������������������X�������I����������ډ����������������Z���������������������������������������I�a�����������������y�����������������O�s�����p�X���q�Տ��t���߈\���������������܋����U�ܑ�����������������������ь������ٍ����啑����T����������������֏�������廐��������������J�������������������������������݋��A�@�C�B�D�P�E�F�G漐v�H���e�I�J橌K�K���`�L�o�M�O旗N�e�P�Q�R�ϊS�T�U�V�p�W�X�Y��G�Z�[�\�����]�v�u�`���_�P�^�L�a�b�׏��c�K�ݐ���i�d�f���؏e�h�i�����g�ُ]�f���r�m�w�����l�l�k�F�l�b�Y�ڏj�o�p�n�֌_���F�s���a�U�v����r�w��t�u�q��ǓN�ۉ�b���z�x�k���Њy�z�ȗ_�{�泒����������~�|�@�����}��攏����d�y��������������������u�ӎ��w�������T���ދ�����������������戕��x������c����������]�̝����Q���������J�����������L���������ؓۏ����������^������������e��������L�����v�n�݉̔��ъӐ���晒�����M��惔ݑ�\���f����G���d���������G���o���^���܏������������q�����w��������桑���������������Ԑ͎��q��������拕N�����z������������������������������Ր��׌����H���H���������x���������H����������@�D�A��B�C�J�E�֐G�I�F�L�R�K�M�N�Q�P�O�S�R��U�T�V�W�Y�X�g�Z��[�]�^�_�\�`�Ԏa�O�R���b��]�c�f���e�d�y�g�r�i�ڍh�q�k�m��j�l�p�n�P�o�r�y�֗S�s�A�u�t�x�`�w���v�{�z�y�Q�|�}�~���D�����h�����������������C�J�_���ӕҒ��H�I���v�}�ߋԕ������މ�痔R���q���������ǒޑ������t�����秓������r���瀐��ʒ���笑���秈A���ߑT�i����툝�N���ٓ��x�����V�^�Օ߉����繓B�ሦ����������k���y���K���Վ��������J�I��ɗ�������Ҋ�������W�ߓM���׎������@��x�Y���S�������s�X���s�������A�����ѓ��U�ގz����������|������珗V�����y���_���������������X���ݏ������������������Δэߎ���碗d��ʗ�����B��瘊j�����ޒt�����������ݓb���������n����،��S��������������甉������ޏz�g��e���L���������������K�������N�����ݕs�e�������|�K��獐��@�B���A�C�ыd��B���^�E�D�F����t�ՒK�b�G�H�L�J���I�ߏ��O�����ȒZ�M�N�L�P�V�Y�X�L�Q�R�U�W���Z�T�S�^�_�`�]�\���[�d�b�c�a���e�f�h�ӊg�s�i�l�j�k�m�o�p�q�t�r�u�w�v����x�M�y�•z�J�[�ՊԊ{�|�}�~���֊t�}��������{����������ň����������������������������h�j���ɑ�������~���Õ�����@�w���׊������A���’˗���褗��z�����G��@���K���u�����脌ۍ�B�ח�������������ꗯ��ǐ�����Y��W�ٌ���蓎���G����ԙ�������J�ᐴ���_�뗋���d�������k���������������������������I�P�������������������Ð�����r�ʖ������v���x���C�����������������ƈ�������f���������ڕ������������؊����B��蹉����C���ŕ��������{�����a��Дړ��̗z�����j���o�����p����������z�{���犰��^�ޗڌ�����@�B�A���C�D�E�F�H�G�I����H�Q�J�K���Z�є������O���L�ݖM�{�a�`�N��O�P�R�S�U�Q�T�يV�W�X�Y�Z�\�[�^�a�]�_�`�b����c�d遍e�]�n�f�g�y��h���ʑw�����m���l�j�k�i�w�n�o�p�q�s�r�x�t�v�R�u�����x�ˑy���z���}�|�~�{����������������������������[����������������������������E���������������������������������T�����S�@�����飖������������D��������驕������������L���N�������������������I����������~��������������������邊k�����������������h������������V�������L���ؗ����������������������P�–Γ���鼓���������������������鰎���������������D�C�E�L�@�A�����B�Q�J�F�K�H�G�{�L�M�N�I���O�ߒS�T�R�Q�W�P�U�V�Y�X�[�\�]�h�Z���^�_�`�a�b���c�d���e�f�g�h�k�i�[�j��l�ٗmꞔn�p�q�oꍍ˖����������s�o�t�u�v���w���ٖ�x�z�y�{�|�}�~���������������C�ی��l�����@�����V��������������������������������s���I���������i�j���{�C�D�^�O�P�Q�R�S�T�U�V�W�X�F�G�������H���`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�m�n�O�Q�M�����������������������������������������������������o�b�p����������������������������������������������������������������P���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������000���0�����0�0�@��>��?��0�0�0�00�N000�0  �\0 \�& %     �	�00;�=�[�]�0	0
000
00000�"����`"��f"g""4"B&@&�2 3 !�������
� ��&&�%�%�%�%�%�%�%�%�%�%�%; 0�!�!�!�!0""�"�"�"�"*")"'"("��!�!"" "�"#""a"R"j"k""=""5"+","+!0 o&m&j&  ! ��%����������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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������������������������������������������������ !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%�NUZ?��Ta(c�Y"�u��Pz�`�c%n�ef������h'W�eqb�[�Y{��b}�}��b�|���[�^	c�fHhǕ��Og�N
OMO�OIP�V7Y�YZ	\�`apafi�pOupu�y�}�}À�c��U�z�;S�N�N�W�����xN�X�n8�2z(���/�AQpS�T�T�V�Y_��m�-�b�p�����T�S�[�p��oS\��zN�x��&nVUk�;��Y�Sfm�t��BV�NK��O���S�U0[q_ f�fh8l�l)m[t�vNz4��[�`�풲m�u�vř�`������i�S�QW0XDY�[�^(`�c�c�lo�pqYq�q?s~v�т��`�[��iX�eZl%u�Q.YeY�_�_�b�e*j'k�k�s�V�,��Ğ�\�l{�QK\�aƁvharYN�OxSi`)nOz�NS�NUO=O�OsO�R�S	VY�Z�[�[�y�f�g�gLk�lkp�s�y�y<z�{��ۂ�w��Ӄf���)V���N�����O�\bYr;u偽�����Ŗ�ՙ�NO��VJX�X�^�_*`�`b`�ab�b9eA�ff�hwmppLu�vu}�����������Q�RY�T�[]ha�i�m�x˄W�r�����lm��ن�W�gΆ��R�VT�^�b�d<h8h�krs�xkz��҉k��퐣���i�f[�\}iM�N��c {+jj�h
�_orR�Up`�b;mn�n[��D�N9��Si:j��*h\Q�z��ܑ��[V(�"h�1��|Rł�t~N�O�Q�[
R�R�R�]�U*X�Y�[�[�[r^y^�`aca�a�cbe�gSh�h>kSkWl"o�oEo�tu�vw�z�{!|�}6���f�����̊����Q�������e�ӗ(��8N+T�\�]�sLv<w�\�����T�X�OOqS�UhV�WGY	[�[�\^~^�_�c:g�e�eg�h�h_j0^�kl}luHyc[z}�_�����w�̎���<��N}PQ�Y�[/b�b�d:k�r�uGy�����p��cʃ��	TT�UThXjp�'xug͞tS�[�P��NEN�NO�S8T�[_%`Qe=gBlrl�lxptvz�z{}�|f}�e[r�SE\�]�b�bc nZ�1�ݍ��o�yZ��N�N�N�O�O�PGQ�zqQ�QTS!SS�S�U�X�\7_J_/`P`m`cYeKj�l�r�r�w����N�����W�Z��N�Q-\�fmi@\�fui�sPh�|�P�RGW�]&��e#k=k4t�y�yK{�}��̃�_�9�яёT��]N6P�S:S�r�s�w悯�ƙșҙwQa^��UzzvP�[G���2N�j�Q\H\�c�z�lt�a��z�q���|hp~Qhl��RT����͎�fS��Ay�O�PRDQSU-W�s�WQYb_�_u`vaga�a�c:dleofBhnfu=z�|L}�}K~k�J�͆�c�f��������Ώ��Rb�d�o��Ah�P kzlTotzP}@�#�g�N9P&PeP|Q8RcR�UWX�Z�^�a�a�brci)j}r�r.sxoxy}w������Ҏc�u�z�U��x�CQ�S�S{^&_n�n�s�sC}7����P�NNP�S|T�V�Yd[�]�^'_8bEe�gVn�r�|������N����7�ǖg���N�N
OHSIT>T/Z�_�_�`�h�jZt�x����w���^Nɛ�N|O�OPPIQlQ�R�R�R�S�STT�UQW�W}YT[][�[�]�]�]x^�^�^�^_R`La�b�b�c;efCf�fmg!h�h�i_l*mim/n�n2u�vlx?z�|}}^}�}������T���*�R�L�a������ʐu�q�?x����M����ؚ;�[R�R�ST�X�b�oj�_���KQ;RJT�V@zw�`�ҞDs	op�u�_�`���r��dk��N�VdW�XZZh`�aff9h�h�m�u:}n�B��NPO�SUo]�]�]�g�lstxP���߈PW�^+c�P�P�Qg�T^X�Y�[i_Mb�c=hskn}pǑ�rx&xmy�e0}܃��	���dR(WPgj���QBW*�:X�i���T]�W�x��\OJR�T>d(fg�g�zV{"}/�\h��9{S�Q7R�[�b�d�d-g�k��і�v֛Lc����vRf	N�P�Sq\�`�dce_h�q�s#u�{�~����یx���e�f�k�N�N:OO:R�S�S�U�V�X�Y�Y�YP[M\^+^�_`c/e\[�e�e�e�gbk{klEsIy�y�|}+}���󁖉^�i�f����nj܌̖��ok�N<O�OPQW[�[HacBf!k�n�l>r�t�u�x:y�3�ꁔ���Pl�_X�+��z���[�N�S�W1Y�Z�[�`no�uꌟ[��{rP�g��a\J�~��Q\hcf��enq>y}��ʎn�dž��P�R:\Sg|p5rL�ȑ+���[1_�`;N�S�[Kb1g�k�r�s.zk���R���Q�SjT�[�c9j�}��V�ShT�[1\�]�Oa�b2m�y�yB}M~�����F�r���t�/�1�K�l�Ɩ���NOOEQAS�_b�gAlncs&~͑���SY�[�m]y.~�|~X�q�QS���O�\%f�w�z����Q�_�eoi�k�m�ndo�v}�]u�����QR@b�f�fn�^�}r�f�������R�SsY�^�_U`�d��PQ�R SGS�S�TFU1UVhY�Y<Z�[\\\\�^�^�^p_b�b�b�cwcff-fvf~g�hj5j�l�m	nXn<q&qgq�uw]xyey�y�z{�|9}��փ��I�]���<�T�s�a�ތ��f�~������
NNNWN�QpR�W4X�X"[8^�`�dagVgDm�rsucz��r��� �1V�W���b
i�k�qT~w�r��ߘU���;\8O�O�OU Z�[�[�_Na/c�eKf�h�ixm�m3u�uw^y�y3}は�����:�����2�ݑ��N�NRuX�X\u=\N�
�ŏc�m�%{ϊ�b��V�S�9T�W%^�c4l�paw�|�p�B�T�����^tĚ]i]pe�g��ۖncIgiŃ������ozd�[N,p]u/f�Q6R�R�Y�_'`b?eteftf�hhcknrru�v�|V��X�������ˊ���R�Y��ez���-^�`b�ef�g�wMzM|>~
���d��_��xR�b�cBd�b-��z�{���v}�I��NHQCS`S�[\\�]&bGb�dh4h�lEmm�g\oNq}q�ez�{�}J~�z��9���n�Ό��x�w���������MR�U8o6qhQ�yU~���|LVQX�\�c�f�fZi�r�u�uyVy�y�| }D}�4�;�a� ��PuR�S�S	P�U�XOY=r�[d\S�`�`\c�c?c�c�d�e�f�]�i�io�q�N�u�v�z�|�}�}a�I�X�l�����ňp��m������P�X�aӁ5�� ��OtPGRsSo`Ic_g,n����O^\ʌ�e�}RS��vQ�cX[k[
\
dQg\��NY*YplQ�>UX�Y�`Sb�g5�Ui@�ę(�SOX�[��\/^�_ `Ka4b�f�l�n΀�Ԃ�����.���۞ۛ�N�S'Y,{��L����n'pSSDU�[Xb�b�b�l�o"t�8��o��8��Q���S�SFOT���jY1��]�z���h7��rH�=j��9NXSVfW�b�c�eNk�m[n�p�w�z�{�}=�ƀˆ��[��V�X>_�e�f�j�k7uNJ$P�w0W_e`zf`l�uzn��E����{\u�zQ{Ą��y�z6��Z@w-N�N�[�_�b<f�g�lk�w�;�N��Йj&p*s�W���NFQ�Q�U�[^3^�^_5_k_�_�ac�fgnoRr:u:wt�9�x�v���܊��󍚒w����RWc�vg�l�sÌ��s�%m�Xi�i�����u�ZXh�c�iCO,o�g��&��}T�?ipojW�X,[,}*r
T㑴��NNO\PuPCR��HT$X�[^�^�^�^_�`�b:c�c�h@l�x�yz�}G���D����-�ؑ��lXd�due�n�v{i�ѓ�n�T�_�dM��D�xQkX)YU\�^�m�~u���[��pO�k�o0u��NQT5XWX�Y`\�_�e\g!n{v߃����M�%x:x�R�^WtY`PZQ�Q�QRUTXXXWY�[�\�]�`�b-dqgCh�h�h�v�mon�mop�qS_�uwyI{T{R{�|q}0Rc�i����F�����v�-�0�ؕ�P�RTX\�a�dm�w�z��S����\�?S�_�_�myrcw�y�{�k�r��haj�Q�z4iJ\����[I�pxVo\�`fe�lZ�A��QT�f
�HY���QMN�Q���XpzcK�bi��~wuWS`iߎ�]l�N<\_�Sь��y��^�esNeQ�Y?\�N�Y�_���o�yby�[q�+s�qt^�_{c�d�q�|CN�^KN�W�V�`�o
}��3����������]�b�d��wg�l>m6t4xFZu�����O�^�b�cWeog�vLr̀��)�M�
P�W�Z�hsidq�r���X�j����y�w)�/OeRZS�b�g�l}v�{�|6�����f or~�������Q�{rx�{��H{�ja^��Qu`ukQb��nzv���Op�bO{���zVYX䆼�4O$RJS�S�S^,d�eg>lNlHr�r�sTuA~,�酩��{Ƒiq��=cifju�v�xC��*SQS&T�Y�^|_�`Ibyb�b�e�k�l�u�v�x�y�}w���������^�ۘj8|�P>\�_�g�k5t	w�;��gz9S�u�f_��񃘀<_�_buF{<�gh�Y�Z}~v,��Oj_j7lo�thyh�U�y��^�c�u�yׂ(�򒜄�-��Tl_�e\mp��ӌ;�Oe�t
N�N�W+YfZ�[�Q^�^`vbwe�enfnm6r&{P�����\����t��D��O�dfk�a�j��\Si��z�W�OoR�_E^
g�yy�����m_Ub�l�Nir��R;TtV�X�anbqnY�|�|}�e^�NuOuQ@Xc^s^
_�g&N=���[�s|��P�XVv�x%R�w��{OP	YGr�{�}��ԏM��O�R)Z_���O��WUcik+u܈�Bz�R�XUa
b�f�k?|�#P�OSFT1XIY�[�\�\)]�^�bgc>e�eg�l�l�p2x+~ހ������*�J���Ғ���l�ON�N�PVRJW�Y=^�_�_?b�fg�g�h�Q!}���������~�2� T,�S�P\S�X�d4ggrfwFz��R�l�kXL^TY,g��Q�vid�xT����W�Y'f�g�k�T�iU^���g���gR�]h�N�O�S�b+g�lď�Om~��Nba�n+o�sT*gE��]�{�\�[�Jnфz��Y�|l w�R"Y!q_r�w'�a�iZZ�Q
T}Tf�v������Y]r�nMQ�h�}�}b���xd!j��Y_[�ks�v�}���2Q(gٞ�vbg�R�$\;b~|��OU�`}��S_N�QY:r6�Α%_�w�Sy_}��3���V��g��S�	aa�lRv�8�/UQO*Q�R�S�[}^�`�a�c	g�ggn�m6s7s1uPyՈ��J�����Ė��Y�NYON��?���P|^�Y�[�^�c�c�d�fJi�im�n�q(u�z��I�Ʉ��!�
�e�}�
�~a�b2k�ltm���m�����eg��<���ma}=�j�qNuSP]k�oͅ-���)RTe\Ng�ht�t�uψ�̑�x��_�s�zN��ceu�RAm�n	tYukx�|���z���Ona�e\��N�N�P!N�Q�[�e�h�msBv�wz�|o�Ҋ|�ϑu���R�}+P�S�g�m�q3t�*���W���`tAX�m/}^��N6O�O�Q�R�]`�s<yӂ4�����
���b��ftkR�R�pˆ�^K`�a#oIq>|�}o��#�,�BTo��j�pŒ�2��RAZ�^_g|i�ijmobr�r�{�~�K�ΐmQ���y��2�֊-P�Tq�jkČ��`�g�N�N�k���h�i~n�xU�_NN*N1N6N<N?NBNVNXN�N�Nk��N�
_�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N	OZO0O[O]OWOGOvO�O�O�O{OiOpO�OoO�O�OQ�O�O�O�O�O�O�O�O�O�OP(PP*P%PPO�O!P)P,P�O�OPPCPGPgUPPPHPZPVPlPxP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P	QQQQQQQ!Q:Q7Q<Q;Q?Q@QRQLQTQbQ�ziQjQnQ�Q�Q�V�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QU��Q�Q�Q�Q�QRRRR'R*R.R3R9RORDRKRLR^RTRjRtRiRsRR}R�R�R�RqR�R�R�����R�R�R�R�R�R�R�R�R�R��R�R�R�R�RSS8u
SSSSS#S/S1S3S8S@SFSESNISMS�Q^SiSnSY{SwS�S�S�S�S�S�S�S�S�S|ٖ�S�f�q�S�S�S�ST=T@T,T-T<T.T6T)TTNT�TuT�T_TqTwTpT�T{T�TvT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUU�T�T�T�T�T9U@UcULU.U\UEUVUWU8U3U]U�U�U�T�U�U{U~U�U�U�U|U�U�U�U�U�U�U�U�U�U�U�UV�UV�U�UV�UNVPV�q4V6V2V8VkVdV/VlVjV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW�VW	WWW
WWWW�UW&W7W8WNW;W@WOWiW�W�WaWW�W�W�W�W�W�W�W�W�W�W�W�W
X�W�WXXXrX!XbXKXpX�kRX=XyX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XY
YYY�h%Y,Y-Y2Y8Y>Y�zUYPYNYZYXYbY`YgYlYiYxY�Y�Y^O�O�Y�Y�Y�Y�Y�Y�Y�Y%ZZZZ	ZZ@ZlZIZ5Z6ZbZjZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[2[�Z*[6[>[C[E[@[Q[U[Z[[[e[i[p[s[u[x[�ez[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\
\\ \"\(\8\9\A\F\N\S\P\O\q[l\n\bNv\y\�\�\�\�Y�\�\�\�\�\�\�\�\�\�\�\�\�\�]�\]]]\]]]]]"]]]]L]R]N]K]l]s]v]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^6^7^D^C^@^N^W^T^_^b^d^G^u^v^z^��^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^_	_]_\____)_-_8_A_H_L_N_/_Q_V_W_Y_a_m_s_w_�_�__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�`�_!`````)``1```+`&``:`Z`A`j`w`_`J`F`M`c`C`d`B`l`k`Y`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�_�`�`�`�`Maaa�`�`a�`�`a!a�`�`
aaGa>a(a'aJa?a<a,a4a=aBaDasawaXaYaZakataoaeaqa_a]aSaua�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�ay�a�a�a�a�a�a�a�a�a�abb	b
bbbbb!b*b.b0b2b3bAbNb^bcb[b`bhb|b�b�b~b�b�b�b�b�b�b�b�b�b�b�b�b�d�b�b�b�b�b�b�b�bc�b�b'ccc�b�bPc>cMcdOc�c�c�c�cvc�c�c�c�c�ckcic�c�c�c�c�c�c�c�c�cd4ddd&d6ded(ddgdodvdNd*e�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	��d�d�b�d�d,e�d�d�d�de�deee$e#e+e4e5e7e6e8eKuHeVeUeMeXe^e]erexe�e�e���e�e�e�e�e�e�e�e�e�e�e�e�e�e�erg
ff�esg5f6f4ffOfDfIfAf^f]fdfgfhf_fbfpf�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f?f�f�f�f�f�fggg&g'g8�.g?g6gAg8g7gFg^g`gYgcgdg�gpg�g|gjg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�jhFh)h@hMh2hNh�h+hYhchwhh�h�h�h�h�h�h�h�j�hth�h�h�hi�h~hi�hi�h"i&i�hi�h�h�h�h6iii�h�h%i�h�h�h(i*ii#i!i�hyiwi\ixikiTi~ini9iti=iYi0iai^i]i�iji�i�i�i�i�i�i�i�i�[�i�i�i�i�i.j�i�i�i�i�i�i�ijj�i
k�i�i�ij�ij�ij�i
jj�j#jjDjjrj6jxjGjbjYjfjHj8j"j�j�j�j�j�j�j�j��j�j�j�j�j�j�j�j�j�j�j�j�jk��jkk1�k8k7k�v9k�GkCkIkPkYkTk[k_kakxkykk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k��llll$l#l^lUlbljl�l�l�l�l�l~lhlsl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmM�6m+m=m8mm5m3mmmcm�mdmZmymYm�m�m�o�m�mn
n�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m-nnn.nnrn_n>n#nkn+nvnMnnCn:nNn$n�nn8n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nAooLp�n�n�n?o�n1o�n2o�n>oo�n�ozoxo�o�ooo[o�omo�o|oXo�o�o�ofo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o	pp�oppp�opptoppp0p>p2pQpcp�p�p�p�p�p�p�p�p�p�p�p�p	q�pqqeqUq�qfqbqLqVqlq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q
rrr(r-r,r0r2r;r<r?r@rFrKrXrtr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rPs
ssss4s/s)s%s>sNsOs؞Wsjshspsxsus{szs�s�s�s�s�s�s�s�s�ttot%t�s2t:tUt?t_tYtAt\titptctjtvt~t�t�t�t�t�t�t�s�t�t�t�t�t�t�t�t�t�tuuuuu
uuuu&u,u<uDuMuJuIu[uFuZuiudugukumuxuvu�u�utu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�u�uv
v	vv'v v!v"v$v4v0v;vGvHvFv\vXvavbvhvivjvgvlvpvrvvvxv|v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v/��vwww)w$ww%w&ww7w8wGwZwhwkw[weww~wyw�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx&y x*yEx�xtx�x|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyy,y+y@y`yWy_yZyUySyzyy�y�y�yK��y�y�y�y�y�y�y�y�y�y�yz
zzz zz�y1z;z>z7zCzWzIzazbziz��pzyz}z�z�z�z�z�z�z�z�z�z�z�z�z���z�z�z�z�z�z�z�z�z�z�z�z�z�z{{
{{3{{{{5{({6{P{z{{M{{L{E{u{e{t{g{p{q{l{n{�{�{�{�{�{�{�{�{�{]{�{�{�{�{�{�{�{�{�{||�{�{`||||�{�{|
|�{#|'|*||7|+|=|L|C|T|O|@|P|X|_|d|V|e|l|u|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|;��|�|�|�|�|}}}}
}E}K}.}2}?}5}F}s}V}N}r}h}n}O}c}�}�}[}�}}}�}�}�}�}�}�}�}�}=~�}�}�}�}�}�}�}�}�}�}�}�}�}~
~#~!~~1~~	~~"~F~f~;~5~9~C~7~2~:~g~]~V~^~Y~Z~y~j~i~|~{~�~�}}~��~�~�~�~�~�~�~�~�~�~�~�~8:ELMNPQUTX_`higx�����������������q�����������ܘ�������!�(�?�;�J�F�R�X�Z�_�b�h�s�r�p�v�y�}�����������������Q��ۀ�ـ݀Āڀր	����)�#�/�K���F�>�S�Q���q�n�e�f�t�������������������_�������������������Ɂ́сف؁ȁځ߁�����������
�
���)�+�8�3�@�Y�X�]�Z�_�d�b�h�j�k�.�q�w�x�~���������������߂҂���������ނ�܂	�ق5�4��2�1�@�9�P�E�/�+���������������#�������|���s�u����������΃���؃��������
�"� ���8����m�*�<�Z���w�k���n���i�F�,�o�y�5�ʄb�������ل̈́��ڄЄ��Ƅք��!������,������@�c�X�H�A��K�U�������������m�����ꅇ���w�~���Ʌ��υ��ЅՅ݅�܅��
��������"��0�?�M�UNT�_�g�q�����������������ĆƆ��Ɇ#���Ԇކ��߆ۆ���������	�
���
�4�?�7�;�%�)��`�_�x�L�N�t�W�h�n�Y�S�c�j����������ˇ����Ї֖��ć��LJƇ������
��������҇���"�!�1�6�9�'�;�D�B�R�Y�^�b�k���~���u�}���r�����������������������ÈĈԈ؈و݈����������
��C��%�*�+�A�D�;�6�8�L��`�^�f�d�m�j�o�t�w�~�������������������������������ډ܉݉��������%�6�A�[�R�F�H�|�m�l�b���������������������Ċ͊Šڊ���������ފۊ������� �3���&�+�>�(�A�L�O�N�I�V�[�Z�k�_�l�o�t�}�����������������:�A�?�H�L�N�P�U�b�l�x�z���������������|���b��������������Ȍ����ڌ��������
���
��N��͌��g�m�q�s���������ύڍ֍̍ۍˍ��ߍ���	�������B�5�0�4�J�G�I�L�P�H�Y�d�`�*�c�U�v�r�|�����������������������������Ǝ����ŎȎˎێ������
����������&�3�;�9�E�B�>�L�I�F�N�W�\�b�c�d�������������ڏ������������!�
����'�6�5�9���O�P�Q�R��I�>�V�X�^�h�o�v���r���}���������������������Hbې���2�0�J�V�X�c�e�i�s�r�������������������������ɑˑБ֑ߑ�ۑ����������,���^�W�E�I�d�H���?�K�P���������Z�ϒ��������D�.��"��#�:�5�;�\�`�|�n�V�����������֓ד��ؓÓݓГȓ�������6�+�5�!�:�A�R�D�[�`�b�^�j�)�p�u�w�}�Z�|�~����������������������������������ʕ�oÕ͕̕Օԕ֕ܕ���!�(�.�/�B�L�O�K�w�\�^�]�_�f�r�l���������������������������Ζ˖ɖ͖M�ܖ
�Ֆ�����������$�*�0�9�=�>�D�F�H�B�I�\�`�d�f�h��Rk�q�y���|���z���������������������×Ɨȗ˗ܗ�O���z������8�$�!�7�=�F�O�K�k�o�p�q�t�s���������ĘØƘ���	����!���$� �,�.�=�>�B�I�E�P�K�Q�R�L�U�������������ߙۙݙؙљ�����������+�7�E�B�@�C�>�U�M�[�W�_�b�e�d�i�k�j���������ϚњӚԚޚߚ��������������"�#�%�'�(�)�*�.�/�2�D�C�O�M�N�Q�X�t���������������������ʛ��ƛϛћқ���ԛ�:������	������
��.��%�$�!�0�G�2�F�>�Z�`�g�v�x����	�����*�&���#��D���A�?�>�F�H�]�^�d�Q�P�Y�r�������o�z���������ĝ��������Ɲϝٝӝ���������u�y�}���������������������������a�̞ΞϞОԞܞޞݞ������������������v�!�,�>�J�R�T�c�_�`�a�f�g�l�j�w�r�v�������/X�iY�dt�Q�q	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� sjis�������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~����������������������������������	

 !"#$%&'()*+,-./0123456789:��������?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[��������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\][^_EABCDEFGHIJKLMNOPQRSTUVWXYZ{|}Y�����������������������������������������������������������������������������������������������������������������������������
' (&$)
		

*+, !"#$%&'(% !"#$%&'(-)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVXGY�ZG[G\�]�^�_�`ab'c'd'e'f'ZG 
$22
22	8W!@@@@	@
@@@
@@"#�tis620Expansion%s too long: '%s'\u%04XCharacter%s expectedContraction%s is too longcontextSyntax error[version 4.0.0][version 5.2.0][shift-after-method expand][shift-after-method simple][strength 1][strength 2][before primary][before 1][before secondary][before 2][before tertiary][before 3][before quaternary][before 4][first non-ignorable][last non-ignorable][first primary ignorable][last primary ignorable][first secondary ignorable][last secondary ignorable][first tertiary ignorable][last tertiary ignorable][first trailing][last trailing][first variable][last variable]Logical positionShiftEOF%s at '%s'utf16_hungarian_ciutf16_lithuanian_ciutf32_spanish2_ciutf8mb3_croatian_mysql561_ciutf8mb3_unicode_ciucs2_croatian_mysql561_ci%s: no level #%d data for this Unicode version.Shift character out of range: u%04XReset character out of range: u%04XCan't reset before a primary ignorable character U+%04lX[shift-after-method expand][version 5.2.0]&\u108C<\u1037<\u1038<\u1037\u1038&\u102C<<\u102B&\u1032<\u1031\u102C<<\u1031\u102B<\u1031\u102C\u103A<<\u1031\u102B\u103A&\u1034<\u1036<\u102D\u102F<\u1000\u1039<<\u1000\u103A<\u102C\u1000\u1039<<\u102C\u1000\u103A<<\u102B\u1000\u1039<<\u102B\u1000\u103A<\u102D\u1000\u1039<<\u102D\u1000\u103A<\u102F\u1000\u1039<<\u102F\u1000\u103A<\u1031\u1000\u1039<<\u1031\u1000\u103A<\u1031\u102C\u1000\u1039<<\u1031\u102C\u1000\u103A<<\u1031\u102B\u1000\u1039<<\u1031\u102B\u1000\u103A<\u102D\u102F\u1000\u1039<<\u102D\u102F\u1000\u103A<\u1001\u1039<<\u1001\u103A<\u102C\u1001\u1039<<\u102C\u1001\u103A<<\u102B\u1001\u1039<<\u102B\u1001\u103A<\u102D\u1001\u1039<<\u102D\u1001\u103A<\u102F\u1001\u1039<<\u102F\u1001\u103A<\u1031\u1001\u1039<<\u1031\u1001\u103A<\u1031\u102C\u1001\u1039<<\u1031\u102C\u1001\u103A<<\u1031\u102B\u1001\u1039<<\u1031\u102B\u1001\u103A<\u102D\u102F\u1001\u1039<<\u102D\u102F\u1001\u103A<\u1002\u1039<<\u1002\u103A<\u102C\u1002\u1039<<\u102C\u1002\u103A<<\u102B\u1002\u1039<<\u102B\u1002\u103A<\u102D\u1002\u1039<<\u102D\u1002\u103A<\u102F\u1002\u1039<<\u102F\u1002\u103A<\u1031\u1002\u1039<<\u1031\u1002\u103A<\u1031\u102C\u1002\u1039<<\u1031\u102C\u1002\u103A<<\u1031\u102B\u1002\u1039<<\u1031\u102B\u1002\u103A<\u102D\u102F\u1002\u1039<<\u102D\u102F\u1002\u103A<\u1003\u1039<<\u1003\u103A<\u102C\u1003\u1039<<\u102C\u1003\u103A<<\u102B\u1003\u1039<<\u102B\u1003\u103A<\u102D\u1003\u1039<<\u102D\u1003\u103A<\u102F\u1003\u1039<<\u102F\u1003\u103A<\u1031\u1003\u1039<<\u1031\u1003\u103A<\u1031\u102C\u1003\u1039<<\u1031\u102C\u1003\u103A<<\u1031\u102B\u1003\u1039<<\u1031\u102B\u1003\u103A<\u102D\u102F\u1003\u1039<<\u102D\u102F\u1003\u103A<\u1004\u103A\u1039<<\u1004\u103A<\u102C\u1004\u103A\u1039<<\u102C\u1004\u103A<<\u102B\u1004\u103A\u1039<<\u102B\u1004\u103A<\u102D\u1004\u103A\u1039<<\u102D\u1004\u103A<\u102F\u1004\u103A\u1039<<\u102F\u1004\u103A<\u1031\u1004\u103A\u1039<<\u1031\u1004\u103A<\u1031\u102C\u1004\u103A\u1039<<\u1031\u102C\u1004\u103A<<\u1031\u102B\u1004\u103A\u1039<<\u1031\u102B\u1004\u103A<\u102D\u102F\u1004\u103A\u1039<<\u102D\u102F\u1004\u103A<\u1005\u1039<<\u1005\u103A<\u102C\u1005\u1039<<\u102C\u1005\u103A<<\u102B\u1005\u1039<<\u102B\u1005\u103A<\u102D\u1005\u1039<<\u102D\u1005\u103A<\u102F\u1005\u1039<<\u102F\u1005\u103A<\u1031\u1005\u1039<<\u1031\u1005\u103A<\u1031\u102C\u1005\u1039<<\u1031\u102C\u1005\u103A<<\u1031\u102B\u1005\u1039<<\u1031\u102B\u1005\u103A<\u102D\u102F\u1005\u1039<<\u102D\u102F\u1005\u103A<\u1006\u1039<<\u1006\u103A<\u102C\u1006\u1039<<\u102C\u1006\u103A<<\u102B\u1006\u1039<<\u102B\u1006\u103A<\u102D\u1006\u1039<<\u102D\u1006\u103A<\u102F\u1006\u1039<<\u102F\u1006\u103A<\u1031\u1006\u1039<<\u1031\u1006\u103A<\u1031\u102C\u1006\u1039<<\u1031\u102C\u1006\u103A<<\u1031\u102B\u1006\u1039<<\u1031\u102B\u1006\u103A<\u102D\u102F\u1006\u1039<<\u102D\u102F\u1006\u103A<\u1007\u1039<<\u1007\u103A<\u102C\u1007\u1039<<\u102C\u1007\u103A<<\u102B\u1007\u1039<<\u102B\u1007\u103A<\u102D\u1007\u1039<<\u102D\u1007\u103A<\u102F\u1007\u1039<<\u102F\u1007\u103A<\u1031\u1007\u1039<<\u1031\u1007\u103A<\u1031\u102C\u1007\u1039<<\u1031\u102C\u1007\u103A<<\u1031\u102B\u1007\u1039<<\u1031\u102B\u1007\u103A<\u102D\u102F\u1007\u1039<<\u102D\u102F\u1007\u103A<\u1008\u103A<\u102C\u1008\u103A<<\u102B\u1008\u103A<\u102D\u1008\u103A<\u102F\u1008\u103A<\u1031\u1008\u103A<\u1031\u102C\u1008\u103A<<\u1031\u102B\u1008\u103A<\u102D\u102F\u1008\u103A<\u1009\u1039<<\u1009\u103A<\u102C\u1009\u1039<<\u102C\u1009\u103A<<\u102B\u1009\u1039<<\u102B\u1009\u103A<\u102D\u1009\u1039<<\u102D\u1009\u103A<\u102F\u1009\u1039<<\u102F\u1009\u103A<\u1031\u1009\u1039<<\u1031\u1009\u103A<\u1031\u102C\u1009\u1039<<\u1031\u102C\u1009\u103A<<\u1031\u102B\u1009\u1039<<\u1031\u102B\u1009\u103A<\u102D\u102F\u1009\u1039<<\u102D\u102F\u1009\u103A<\u100A\u1039<<\u100A\u103A<\u102C\u100A\u1039<<\u102C\u100A\u103A<<\u102B\u100A\u1039<<\u102B\u100A\u103A<\u102D\u100A\u1039<<\u102D\u100A\u103A<\u102F\u100A\u1039<<\u102F\u100A\u103A<\u1031\u100A\u1039<<\u1031\u100A\u103A<\u1031\u102C\u100A\u1039<<\u1031\u102C\u100A\u103A<<\u1031\u102B\u100A\u1039<<\u1031\u102B\u100A\u103A<\u102D\u102F\u100A\u1039<<\u102D\u102F\u100A\u103A<\u100B\u1039<<\u100B\u103A<\u102C\u100B\u1039<<\u102C\u100B\u103A<<\u102B\u100B\u1039<<\u102B\u100B\u103A<\u102D\u100B\u1039<<\u102D\u100B\u103A<\u102F\u100B\u1039<<\u102F\u100B\u103A<\u1031\u100B\u1039<<\u1031\u100B\u103A<\u1031\u102C\u100B\u1039<<\u1031\u102C\u100B\u103A<<\u1031\u102B\u100B\u1039<<\u1031\u102B\u100B\u103A<\u102D\u102F\u100B\u1039<<\u102D\u102F\u100B\u103A<\u100C\u1039<<\u100C\u103A<\u102C\u100C\u1039<<\u102C\u100C\u103A<<\u102B\u100C\u1039<<\u102B\u100C\u103A<\u102D\u100C\u1039<<\u102D\u100C\u103A<\u102F\u100C\u1039<<\u102F\u100C\u103A<\u1031\u100C\u1039<<\u1031\u100C\u103A<\u1031\u102C\u100C\u1039<<\u1031\u102C\u100C\u103A<<\u1031\u102B\u100C\u1039<<\u1031\u102B\u100C\u103A<\u102D\u102F\u100C\u1039<<\u102D\u102F\u100C\u103A<\u100D\u1039<<\u100D\u103A<\u102C\u100D\u1039<<\u102C\u100D\u103A<<\u102B\u100D\u1039<<\u102B\u100D\u103A<\u102D\u100D\u1039<<\u102D\u100D\u103A<\u102F\u100D\u1039<<\u102F\u100D\u103A<\u1031\u100D\u1039<<\u1031\u100D\u103A<\u1031\u102C\u100D\u1039<<\u1031\u102C\u100D\u103A<<\u1031\u102B\u100D\u1039<<\u1031\u102B\u100D\u103A<\u102D\u102F\u100D\u1039<<\u102D\u102F\u100D\u103A<\u100E\u1039<<\u100E\u103A<\u102C\u100E\u1039<<\u102C\u100E\u103A<<\u102B\u100E\u1039<<\u102B\u100E\u103A<\u102D\u100E\u1039<<\u102D\u100E\u103A<\u102F\u100E\u1039<<\u102F\u100E\u103A<\u1031\u100E\u1039<<\u1031\u100E\u103A<\u1031\u102C\u100E\u1039<<\u1031\u102C\u100E\u103A<<\u1031\u102B\u100E\u1039<<\u1031\u102B\u100E\u103A<\u102D\u102F\u100E\u1039<<\u102D\u102F\u100E\u103A<\u100F\u1039<<\u100F\u103A<\u102C\u100F\u1039<<\u102C\u100F\u103A<<\u102B\u100F\u1039<<\u102B\u100F\u103A<\u102D\u100F\u1039<<\u102D\u100F\u103A<\u102F\u100F\u1039<<\u102F\u100F\u103A<\u1031\u100F\u1039<<\u1031\u100F\u103A<\u1031\u102C\u100F\u1039<<\u1031\u102C\u100F\u103A<<\u1031\u102B\u100F\u1039<<\u1031\u102B\u100F\u103A<\u102D\u102F\u100F\u1039<<\u102D\u102F\u100F\u103A<\u1010\u1039<<\u1010\u103A<\u102C\u1010\u1039<<\u102C\u1010\u103A<<\u102B\u1010\u1039<<\u102B\u1010\u103A<\u102D\u1010\u1039<<\u102D\u1010\u103A<\u102F\u1010\u1039<<\u102F\u1010\u103A<\u1031\u1010\u1039<<\u1031\u1010\u103A<\u1031\u102C\u1010\u1039<<\u1031\u102C\u1010\u103A<<\u1031\u102B\u1010\u1039<<\u1031\u102B\u1010\u103A<\u102D\u102F\u1010\u1039<<\u102D\u102F\u1010\u103A<\u1011\u1039<<\u1011\u103A<\u102C\u1011\u1039<<\u102C\u1011\u103A<<\u102B\u1011\u1039<<\u102B\u1011\u103A<\u102D\u1011\u1039<<\u102D\u1011\u103A<\u102F\u1011\u1039<<\u102F\u1011\u103A<\u1031\u1011\u1039<<\u1031\u1011\u103A<\u1031\u102C\u1011\u1039<<\u1031\u102C\u1011\u103A<<\u1031\u102B\u1011\u1039<<\u1031\u102B\u1011\u103A<\u102D\u102F\u1011\u1039<<\u102D\u102F\u1011\u103A<\u1012\u1039<<\u1012\u103A<\u102C\u1012\u1039<<\u102C\u1012\u103A<<\u102B\u1012\u1039<<\u102B\u1012\u103A<\u102D\u1012\u1039<<\u102D\u1012\u103A<\u102F\u1012\u1039<<\u102F\u1012\u103A<\u1031\u1012\u1039<<\u1031\u1012\u103A<\u1031\u102C\u1012\u1039<<\u1031\u102C\u1012\u103A<<\u1031\u102B\u1012\u1039<<\u1031\u102B\u1012\u103A<\u102D\u102F\u1012\u1039<<\u102D\u102F\u1012\u103A<\u1013\u1039<<\u1013\u103A<\u102C\u1013\u1039<<\u102C\u1013\u103A<<\u102B\u1013\u1039<<\u102B\u1013\u103A<\u102D\u1013\u1039<<\u102D\u1013\u103A<\u102F\u1013\u1039<<\u102F\u1013\u103A<\u1031\u1013\u1039<<\u1031\u1013\u103A<\u1031\u102C\u1013\u1039<<\u1031\u102C\u1013\u103A<<\u1031\u102B\u1013\u1039<<\u1031\u102B\u1013\u103A<\u102D\u102F\u1013\u1039<<\u102D\u102F\u1013\u103A<\u1014\u1039<<\u1014\u103A<\u102C\u1014\u1039<<\u102C\u1014\u103A<<\u102B\u1014\u1039<<\u102B\u1014\u103A<\u102D\u1014\u1039<<\u102D\u1014\u103A<\u102F\u1014\u1039<<\u102F\u1014\u103A<\u1031\u1014\u1039<<\u1031\u1014\u103A<\u1031\u102C\u1014\u1039<<\u1031\u102C\u1014\u103A<<\u1031\u102B\u1014\u1039<<\u1031\u102B\u1014\u103A<\u102D\u102F\u1014\u1039<<\u102D\u102F\u1014\u103A<\u1015\u1039<<\u1015\u103A<\u102C\u1015\u1039<<\u102C\u1015\u103A<<\u102B\u1015\u1039<<\u102B\u1015\u103A<\u102D\u1015\u1039<<\u102D\u1015\u103A<\u102F\u1015\u1039<<\u102F\u1015\u103A<\u1031\u1015\u1039<<\u1031\u1015\u103A<\u1031\u102C\u1015\u1039<<\u1031\u102C\u1015\u103A<<\u1031\u102B\u1015\u1039<<\u1031\u102B\u1015\u103A<\u102D\u102F\u1015\u1039<<\u102D\u102F\u1015\u103A<\u1016\u1039<<\u1016\u103A<\u102C\u1016\u1039<<\u102C\u1016\u103A<<\u102B\u1016\u1039<<\u102B\u1016\u103A<\u102D\u1016\u1039<<\u102D\u1016\u103A<\u102F\u1016\u1039<<\u102F\u1016\u103A<\u1031\u1016\u1039<<\u1031\u1016\u103A<\u1031\u102C\u1016\u1039<<\u1031\u102C\u1016\u103A<<\u1031\u102B\u1016\u1039<<\u1031\u102B\u1016\u103A<\u102D\u102F\u1016\u1039<<\u102D\u102F\u1016\u103A<\u1017\u1039<<\u1017\u103A<\u102C\u1017\u1039<<\u102C\u1017\u103A<<\u102B\u1017\u1039<<\u102B\u1017\u103A<\u102D\u1017\u1039<<\u102D\u1017\u103A<\u102F\u1017\u1039<<\u102F\u1017\u103A<\u1031\u1017\u1039<<\u1031\u1017\u103A<\u1031\u102C\u1017\u1039<<\u1031\u102C\u1017\u103A<<\u1031\u102B\u1017\u1039<<\u1031\u102B\u1017\u103A<\u102D\u102F\u1017\u1039<<\u102D\u102F\u1017\u103A<\u1018\u1039<<\u1018\u103A<\u102C\u1018\u1039<<\u102C\u1018\u103A<<\u102B\u1018\u1039<<\u102B\u1018\u103A<\u102D\u1018\u1039<<\u102D\u1018\u103A<\u102F\u1018\u1039<<\u102F\u1018\u103A<\u1031\u1018\u1039<<\u1031\u1018\u103A<\u1031\u102C\u1018\u1039<<\u1031\u102C\u1018\u103A<<\u1031\u102B\u1018\u1039<<\u1031\u102B\u1018\u103A<\u102D\u102F\u1018\u1039<<\u102D\u102F\u1018\u103A<\u1019\u1039<<\u1019\u103A<\u102C\u1019\u1039<<\u102C\u1019\u103A<<\u102B\u1019\u1039<<\u102B\u1019\u103A<\u102D\u1019\u1039<<\u102D\u1019\u103A<\u102F\u1019\u1039<<\u102F\u1019\u103A<\u1031\u1019\u1039<<\u1031\u1019\u103A<\u1031\u102C\u1019\u1039<<\u1031\u102C\u1019\u103A<<\u1031\u102B\u1019\u1039<<\u1031\u102B\u1019\u103A<\u102D\u102F\u1019\u1039<<\u102D\u102F\u1019\u103A<\u101A\u1039<<\u101A\u103A<\u102C\u101A\u1039<<\u102C\u101A\u103A<<\u102B\u101A\u1039<<\u102B\u101A\u103A<\u102D\u101A\u1039<<\u102D\u101A\u103A<\u102F\u101A\u1039<<\u102F\u101A\u103A<\u1031\u101A\u1039<<\u1031\u101A\u103A<\u1031\u102C\u101A\u1039<<\u1031\u102C\u101A\u103A<<\u1031\u102B\u101A\u1039<<\u1031\u102B\u101A\u103A<\u102D\u102F\u101A\u1039<<\u102D\u102F\u101A\u103A<\u101B\u1039<<\u101B\u103A<\u102C\u101B\u1039<<\u102C\u101B\u103A<<\u102B\u101B\u1039<<\u102B\u101B\u103A<\u102D\u101B\u1039<<\u102D\u101B\u103A<\u102F\u101B\u1039<<\u102F\u101B\u103A<\u1031\u101B\u1039<<\u1031\u101B\u103A<\u1031\u102C\u101B\u1039<<\u1031\u102C\u101B\u103A<<\u1031\u102B\u101B\u1039<<\u1031\u102B\u101B\u103A<\u102D\u102F\u101B\u1039<<\u102D\u102F\u101B\u103A<\u101C\u1039<<\u101C\u103A<\u102C\u101C\u1039<<\u102C\u101C\u103A<<\u102B\u101C\u1039<<\u102B\u101C\u103A<\u102D\u101C\u1039<<\u102D\u101C\u103A<\u102F\u101C\u1039<<\u102F\u101C\u103A<\u1031\u101C\u1039<<\u1031\u101C\u103A<\u1031\u102C\u101C\u1039<<\u1031\u102C\u101C\u103A<<\u1031\u102B\u101C\u1039<<\u1031\u102B\u101C\u103A<\u102D\u102F\u101C\u1039<<\u102D\u102F\u101C\u103A<\u101D\u103A<\u102C\u101D\u103A<<\u102B\u101D\u103A<\u102D\u101D\u103A<\u102F\u101D\u103A<\u1031\u101D\u103A<\u1031\u102C\u101D\u103A<<\u1031\u102B\u101D\u103A<\u102D\u102F\u101D\u103A<\u101E\u1039<<\u101E\u103A<\u102C\u101E\u1039<<\u102C\u101E\u103A<<\u102B\u101E\u1039<<\u102B\u101E\u103A<\u102D\u101E\u1039<<\u102D\u101E\u103A<\u102F\u101E\u1039<<\u102F\u101E\u103A<\u1031\u101E\u1039<<\u1031\u101E\u103A<\u1031\u102C\u101E\u1039<<\u1031\u102C\u101E\u103A<<\u1031\u102B\u101E\u1039<<\u1031\u102B\u101E\u103A<\u102D\u102F\u101E\u1039<<\u102D\u102F\u101E\u103A<\u101F\u1039<<\u101F\u103A<\u102C\u101F\u1039<<\u102C\u101F\u103A<<\u102B\u101F\u1039<<\u102B\u101F\u103A<\u102D\u101F\u1039<<\u102D\u101F\u103A<\u102F\u101F\u1039<<\u102F\u101F\u103A<\u1031\u101F\u1039<<\u1031\u101F\u103A<\u1031\u102C\u101F\u1039<<\u1031\u102C\u101F\u103A<<\u1031\u102B\u101F\u1039<<\u1031\u102B\u101F\u103A<\u102D\u102F\u101F\u1039<<\u102D\u102F\u101F\u103A<\u1020\u103A<\u102C\u1020\u103A<<\u102B\u1020\u103A<\u102D\u1020\u103A<\u102F\u1020\u103A<\u1031\u1020\u103A<\u1031\u102C\u1020\u103A<<\u1031\u102B\u1020\u103A<\u102D\u102F\u1020\u103A<\u1021\u103A<\u102C\u1021\u103A<<\u102B\u1021\u103A<\u102D\u1021\u103A<\u102F\u1021\u103A<\u1031\u1021\u103A<\u1031\u102C\u1021\u103A<<\u1031\u102B\u1021\u103A<\u102D\u102F\u1021\u103A<\u105E<\u105F<\u103B<\u103C<\u1060<\u103D<\u1082<\u103E<\u103B\u103D<\u103C\u103D<\u103B\u103E<\u103C\u103E<\u103D\u103E<\u103B\u103D\u103E<\u103C\u103D\u103E&\u1021\u102D<<<\u1023&\u1021\u102E<<<\u1024&\u1021\u102F<<<\u1025&\u1021\u1030<<<\u1026&\u1021\u1031<<<\u1027<<<\u1028&\u1021\u1031\u102C<<<\u1029&\u1021\u1031\u102C\u103A<<<\u102A&\u102D\u1019\u103A<\u102D\u1036<\u102D\u1019\u103A\u1037<\u102D\u1036\u1037<\u102D\u1019\u103A\u1038<\u102D\u1036\u1038&\u102F\u1019\u103A<\u102F\u1036<\u102F\u1019\u103A\u1037<\u102F\u1036\u1037<\u102F\u1019\u103A\u1038<\u102F\u1036\u1038&\u1021\u102F\u1036<<<\u1025\u102F\u1036&\u1021\u102D\u1000\u1039<<<\u1023\u1000\u1039&\u1021\u102D\u1000\u103A<<<\u1023\u1000\u103A&\u1021\u102F\u1000\u1039<<<\u1025\u1000\u1039&\u1021\u102F\u1000\u103A<<<\u1025\u1000\u103A&\u1021\u1031\u1000\u1039<<<\u1027\u1000\u1039&\u1021\u1031\u1000\u103A<<<\u1027\u1000\u103A&\u1021\u1031\u102C\u1000\u1039<<<\u1029\u1000\u1039&\u1021\u1031\u102C\u1000\u103A<<<\u1029\u1000\u103A&\u1021\u1031\u102C\u1000\u1039<<<\u1029\u1031\u102C\u1000\u1039&\u1021\u1031\u102C\u1000\u103A<<<\u1029\u1031\u102C\u1000\u103A&\u1021\u102D\u1001\u1039<<<\u1023\u1001\u1039&\u1021\u102D\u1001\u103A<<<\u1023\u1001\u103A&\u1021\u102F\u1001\u1039<<<\u1025\u1001\u1039&\u1021\u102F\u1001\u103A<<<\u1025\u1001\u103A&\u1021\u1031\u1001\u1039<<<\u1027\u1001\u1039&\u1021\u1031\u1001\u103A<<<\u1027\u1001\u103A&\u1021\u1031\u102C\u1001\u1039<<<\u1029\u1001\u1039&\u1021\u1031\u102C\u1001\u103A<<<\u1029\u1001\u103A&\u1021\u1031\u102C\u1001\u1039<<<\u1029\u1031\u102C\u1001\u1039&\u1021\u1031\u102C\u1001\u103A<<<\u1029\u1031\u102C\u1001\u103A&\u1021\u102D\u1002\u1039<<<\u1023\u1002\u1039&\u1021\u102D\u1002\u103A<<<\u1023\u1002\u103A&\u1021\u102F\u1002\u1039<<<\u1025\u1002\u1039&\u1021\u102F\u1002\u103A<<<\u1025\u1002\u103A&\u1021\u1031\u1002\u1039<<<\u1027\u1002\u1039&\u1021\u1031\u1002\u103A<<<\u1027\u1002\u103A&\u1021\u1031\u102C\u1002\u1039<<<\u1029\u1002\u1039&\u1021\u1031\u102C\u1002\u103A<<<\u1029\u1002\u103A&\u1021\u1031\u102C\u1002\u1039<<<\u1029\u1031\u102C\u1002\u1039&\u1021\u1031\u102C\u1002\u103A<<<\u1029\u1031\u102C\u1002\u103A&\u1021\u102D\u1003\u1039<<<\u1023\u1003\u1039&\u1021\u102D\u1003\u103A<<<\u1023\u1003\u103A&\u1021\u102F\u1003\u1039<<<\u1025\u1003\u1039&\u1021\u102F\u1003\u103A<<<\u1025\u1003\u103A&\u1021\u1031\u1003\u1039<<<\u1027\u1003\u1039&\u1021\u1031\u1003\u103A<<<\u1027\u1003\u103A&\u1021\u1031\u102C\u1003\u1039<<<\u1029\u1003\u1039&\u1021\u1031\u102C\u1003\u103A<<<\u1029\u1003\u103A&\u1021\u1031\u102C\u1003\u1039<<<\u1029\u1031\u102C\u1003\u1039&\u1021\u1031\u102C\u1003\u103A<<<\u1029\u1031\u102C\u1003\u103A&\u1021\u102D\u1004\u1039<<<\u1023\u1004\u1039&\u1021\u102D\u1004\u103A<<<\u1023\u1004\u103A&\u1021\u102F\u1004\u1039<<<\u1025\u1004\u1039&\u1021\u102F\u1004\u103A<<<\u1025\u1004\u103A&\u1021\u1031\u1004\u1039<<<\u1027\u1004\u1039&\u1021\u1031\u1004\u103A<<<\u1027\u1004\u103A&\u1021\u1031\u102C\u1004\u1039<<<\u1029\u1004\u1039&\u1021\u1031\u102C\u1004\u103A<<<\u1029\u1004\u103A&\u1021\u1031\u102C\u1004\u1039<<<\u1029\u1031\u102C\u1004\u1039&\u1021\u1031\u102C\u1004\u103A<<<\u1029\u1031\u102C\u1004\u103A&\u1021\u102D\u1005\u1039<<<\u1023\u1005\u1039&\u1021\u102D\u1005\u103A<<<\u1023\u1005\u103A&\u1021\u102F\u1005\u1039<<<\u1025\u1005\u1039&\u1021\u102F\u1005\u103A<<<\u1025\u1005\u103A&\u1021\u1031\u1005\u1039<<<\u1027\u1005\u1039&\u1021\u1031\u1005\u103A<<<\u1027\u1005\u103A&\u1021\u1031\u102C\u1005\u1039<<<\u1029\u1005\u1039&\u1021\u1031\u102C\u1005\u103A<<<\u1029\u1005\u103A&\u1021\u1031\u102C\u1005\u1039<<<\u1029\u1031\u102C\u1005\u1039&\u1021\u1031\u102C\u1005\u103A<<<\u1029\u1031\u102C\u1005\u103A&\u1021\u102D\u1006\u1039<<<\u1023\u1006\u1039&\u1021\u102D\u1006\u103A<<<\u1023\u1006\u103A&\u1021\u102F\u1006\u1039<<<\u1025\u1006\u1039&\u1021\u102F\u1006\u103A<<<\u1025\u1006\u103A&\u1021\u1031\u1006\u1039<<<\u1027\u1006\u1039&\u1021\u1031\u1006\u103A<<<\u1027\u1006\u103A&\u1021\u1031\u102C\u1006\u1039<<<\u1029\u1006\u1039&\u1021\u1031\u102C\u1006\u103A<<<\u1029\u1006\u103A&\u1021\u1031\u102C\u1006\u1039<<<\u1029\u1031\u102C\u1006\u1039&\u1021\u1031\u102C\u1006\u103A<<<\u1029\u1031\u102C\u1006\u103A&\u1021\u102D\u1007\u1039<<<\u1023\u1007\u1039&\u1021\u102D\u1007\u103A<<<\u1023\u1007\u103A&\u1021\u102F\u1007\u1039<<<\u1025\u1007\u1039&\u1021\u102F\u1007\u103A<<<\u1025\u1007\u103A&\u1021\u1031\u1007\u1039<<<\u1027\u1007\u1039&\u1021\u1031\u1007\u103A<<<\u1027\u1007\u103A&\u1021\u1031\u102C\u1007\u1039<<<\u1029\u1007\u1039&\u1021\u1031\u102C\u1007\u103A<<<\u1029\u1007\u103A&\u1021\u1031\u102C\u1007\u1039<<<\u1029\u1031\u102C\u1007\u1039&\u1021\u1031\u102C\u1007\u103A<<<\u1029\u1031\u102C\u1007\u103A&\u1021\u102D\u1009\u1039<<<\u1023\u1009\u1039&\u1021\u102D\u1009\u103A<<<\u1023\u1009\u103A&\u1021\u102F\u1009\u1039<<<\u1025\u1009\u1039&\u1021\u102F\u1009\u103A<<<\u1025\u1009\u103A&\u1021\u1031\u1009\u1039<<<\u1027\u1009\u1039&\u1021\u1031\u1009\u103A<<<\u1027\u1009\u103A&\u1021\u1031\u102C\u1009\u1039<<<\u1029\u1009\u1039&\u1021\u1031\u102C\u1009\u103A<<<\u1029\u1009\u103A&\u1021\u1031\u102C\u1009\u1039<<<\u1029\u1031\u102C\u1009\u1039&\u1021\u1031\u102C\u1009\u103A<<<\u1029\u1031\u102C\u1009\u103A&\u1021\u102D\u100A\u1039<<<\u1023\u100A\u1039&\u1021\u102D\u100A\u103A<<<\u1023\u100A\u103A&\u1021\u102F\u100A\u1039<<<\u1025\u100A\u1039&\u1021\u102F\u100A\u103A<<<\u1025\u100A\u103A&\u1021\u1031\u100A\u1039<<<\u1027\u100A\u1039&\u1021\u1031\u100A\u103A<<<\u1027\u100A\u103A&\u1021\u1031\u102C\u100A\u1039<<<\u1029\u100A\u1039&\u1021\u1031\u102C\u100A\u103A<<<\u1029\u100A\u103A&\u1021\u1031\u102C\u100A\u1039<<<\u1029\u1031\u102C\u100A\u1039&\u1021\u1031\u102C\u100A\u103A<<<\u1029\u1031\u102C\u100A\u103A&\u1021\u102D\u100B\u1039<<<\u1023\u100B\u1039&\u1021\u102D\u100B\u103A<<<\u1023\u100B\u103A&\u1021\u102F\u100B\u1039<<<\u1025\u100B\u1039&\u1021\u102F\u100B\u103A<<<\u1025\u100B\u103A&\u1021\u1031\u100B\u1039<<<\u1027\u100B\u1039&\u1021\u1031\u100B\u103A<<<\u1027\u100B\u103A&\u1021\u1031\u102C\u100B\u1039<<<\u1029\u100B\u1039&\u1021\u1031\u102C\u100B\u103A<<<\u1029\u100B\u103A&\u1021\u1031\u102C\u100B\u1039<<<\u1029\u1031\u102C\u100B\u1039&\u1021\u1031\u102C\u100B\u103A<<<\u1029\u1031\u102C\u100B\u103A&\u1021\u102D\u100C\u1039<<<\u1023\u100C\u1039&\u1021\u102D\u100C\u103A<<<\u1023\u100C\u103A&\u1021\u102F\u100C\u1039<<<\u1025\u100C\u1039&\u1021\u102F\u100C\u103A<<<\u1025\u100C\u103A&\u1021\u1031\u100C\u1039<<<\u1027\u100C\u1039&\u1021\u1031\u100C\u103A<<<\u1027\u100C\u103A&\u1021\u1031\u102C\u100C\u1039<<<\u1029\u100C\u1039&\u1021\u1031\u102C\u100C\u103A<<<\u1029\u100C\u103A&\u1021\u1031\u102C\u100C\u1039<<<\u1029\u1031\u102C\u100C\u1039&\u1021\u1031\u102C\u100C\u103A<<<\u1029\u1031\u102C\u100C\u103A&\u1021\u102D\u100D\u1039<<<\u1023\u100D\u1039&\u1021\u102D\u100D\u103A<<<\u1023\u100D\u103A&\u1021\u102F\u100D\u1039<<<\u1025\u100D\u1039&\u1021\u102F\u100D\u103A<<<\u1025\u100D\u103A&\u1021\u1031\u100D\u1039<<<\u1027\u100D\u1039&\u1021\u1031\u100D\u103A<<<\u1027\u100D\u103A&\u1021\u1031\u102C\u100D\u1039<<<\u1029\u100D\u1039&\u1021\u1031\u102C\u100D\u103A<<<\u1029\u100D\u103A&\u1021\u1031\u102C\u100D\u1039<<<\u1029\u1031\u102C\u100D\u1039&\u1021\u1031\u102C\u100D\u103A<<<\u1029\u1031\u102C\u100D\u103A&\u1021\u102D\u100E\u1039<<<\u1023\u100E\u1039&\u1021\u102D\u100E\u103A<<<\u1023\u100E\u103A&\u1021\u102F\u100E\u1039<<<\u1025\u100E\u1039&\u1021\u102F\u100E\u103A<<<\u1025\u100E\u103A&\u1021\u1031\u100E\u1039<<<\u1027\u100E\u1039&\u1021\u1031\u100E\u103A<<<\u1027\u100E\u103A&\u1021\u1031\u102C\u100E\u1039<<<\u1029\u100E\u1039&\u1021\u1031\u102C\u100E\u103A<<<\u1029\u100E\u103A&\u1021\u1031\u102C\u100E\u1039<<<\u1029\u1031\u102C\u100E\u1039&\u1021\u1031\u102C\u100E\u103A<<<\u1029\u1031\u102C\u100E\u103A&\u1021\u102D\u100F\u1039<<<\u1023\u100F\u1039&\u1021\u102D\u100F\u103A<<<\u1023\u100F\u103A&\u1021\u102F\u100F\u1039<<<\u1025\u100F\u1039&\u1021\u102F\u100F\u103A<<<\u1025\u100F\u103A&\u1021\u1031\u100F\u1039<<<\u1027\u100F\u1039&\u1021\u1031\u100F\u103A<<<\u1027\u100F\u103A&\u1021\u1031\u102C\u100F\u1039<<<\u1029\u100F\u1039&\u1021\u1031\u102C\u100F\u103A<<<\u1029\u100F\u103A&\u1021\u1031\u102C\u100F\u1039<<<\u1029\u1031\u102C\u100F\u1039&\u1021\u1031\u102C\u100F\u103A<<<\u1029\u1031\u102C\u100F\u103A&\u1021\u102D\u1010\u1039<<<\u1023\u1010\u1039&\u1021\u102D\u1010\u103A<<<\u1023\u1010\u103A&\u1021\u102F\u1010\u1039<<<\u1025\u1010\u1039&\u1021\u102F\u1010\u103A<<<\u1025\u1010\u103A&\u1021\u1031\u1010\u1039<<<\u1027\u1010\u1039&\u1021\u1031\u1010\u103A<<<\u1027\u1010\u103A&\u1021\u1031\u102C\u1010\u1039<<<\u1029\u1010\u1039&\u1021\u1031\u102C\u1010\u103A<<<\u1029\u1010\u103A&\u1021\u1031\u102C\u1010\u1039<<<\u1029\u1031\u102C\u1010\u1039&\u1021\u1031\u102C\u1010\u103A<<<\u1029\u1031\u102C\u1010\u103A&\u1021\u102D\u1011\u1039<<<\u1023\u1011\u1039&\u1021\u102D\u1011\u103A<<<\u1023\u1011\u103A&\u1021\u102F\u1011\u1039<<<\u1025\u1011\u1039&\u1021\u102F\u1011\u103A<<<\u1025\u1011\u103A&\u1021\u1031\u1011\u1039<<<\u1027\u1011\u1039&\u1021\u1031\u1011\u103A<<<\u1027\u1011\u103A&\u1021\u1031\u102C\u1011\u1039<<<\u1029\u1011\u1039&\u1021\u1031\u102C\u1011\u103A<<<\u1029\u1011\u103A&\u1021\u1031\u102C\u1011\u1039<<<\u1029\u1031\u102C\u1011\u1039&\u1021\u1031\u102C\u1011\u103A<<<\u1029\u1031\u102C\u1011\u103A&\u1021\u102D\u1012\u1039<<<\u1023\u1012\u1039&\u1021\u102D\u1012\u103A<<<\u1023\u1012\u103A&\u1021\u102F\u1012\u1039<<<\u1025\u1012\u1039&\u1021\u102F\u1012\u103A<<<\u1025\u1012\u103A&\u1021\u1031\u1012\u1039<<<\u1027\u1012\u1039&\u1021\u1031\u1012\u103A<<<\u1027\u1012\u103A&\u1021\u1031\u102C\u1012\u1039<<<\u1029\u1012\u1039&\u1021\u1031\u102C\u1012\u103A<<<\u1029\u1012\u103A&\u1021\u1031\u102C\u1012\u1039<<<\u1029\u1031\u102C\u1012\u1039&\u1021\u1031\u102C\u1012\u103A<<<\u1029\u1031\u102C\u1012\u103A&\u1021\u102D\u1013\u1039<<<\u1023\u1013\u1039&\u1021\u102D\u1013\u103A<<<\u1023\u1013\u103A&\u1021\u102F\u1013\u1039<<<\u1025\u1013\u1039&\u1021\u102F\u1013\u103A<<<\u1025\u1013\u103A&\u1021\u1031\u1013\u1039<<<\u1027\u1013\u1039&\u1021\u1031\u1013\u103A<<<\u1027\u1013\u103A&\u1021\u1031\u102C\u1013\u1039<<<\u1029\u1013\u1039&\u1021\u1031\u102C\u1013\u103A<<<\u1029\u1013\u103A&\u1021\u1031\u102C\u1013\u1039<<<\u1029\u1031\u102C\u1013\u1039&\u1021\u1031\u102C\u1013\u103A<<<\u1029\u1031\u102C\u1013\u103A&\u1021\u102D\u1014\u1039<<<\u1023\u1014\u1039&\u1021\u102D\u1014\u103A<<<\u1023\u1014\u103A&\u1021\u102F\u1014\u1039<<<\u1025\u1014\u1039&\u1021\u102F\u1014\u103A<<<\u1025\u1014\u103A&\u1021\u1031\u1014\u1039<<<\u1027\u1014\u1039&\u1021\u1031\u1014\u103A<<<\u1027\u1014\u103A&\u1021\u1031\u102C\u1014\u1039<<<\u1029\u1014\u1039&\u1021\u1031\u102C\u1014\u103A<<<\u1029\u1014\u103A&\u1021\u1031\u102C\u1014\u1039<<<\u1029\u1031\u102C\u1014\u1039&\u1021\u1031\u102C\u1014\u103A<<<\u1029\u1031\u102C\u1014\u103A&\u1021\u102D\u1015\u1039<<<\u1023\u1015\u1039&\u1021\u102D\u1015\u103A<<<\u1023\u1015\u103A&\u1021\u102F\u1015\u1039<<<\u1025\u1015\u1039&\u1021\u102F\u1015\u103A<<<\u1025\u1015\u103A&\u1021\u1031\u1015\u1039<<<\u1027\u1015\u1039&\u1021\u1031\u1015\u103A<<<\u1027\u1015\u103A&\u1021\u1031\u102C\u1015\u1039<<<\u1029\u1015\u1039&\u1021\u1031\u102C\u1015\u103A<<<\u1029\u1015\u103A&\u1021\u1031\u102C\u1015\u1039<<<\u1029\u1031\u102C\u1015\u1039&\u1021\u1031\u102C\u1015\u103A<<<\u1029\u1031\u102C\u1015\u103A&\u1021\u102D\u1016\u1039<<<\u1023\u1016\u1039&\u1021\u102D\u1016\u103A<<<\u1023\u1016\u103A&\u1021\u102F\u1016\u1039<<<\u1025\u1016\u1039&\u1021\u102F\u1016\u103A<<<\u1025\u1016\u103A&\u1021\u1031\u1016\u1039<<<\u1027\u1016\u1039&\u1021\u1031\u1016\u103A<<<\u1027\u1016\u103A&\u1021\u1031\u102C\u1016\u1039<<<\u1029\u1016\u1039&\u1021\u1031\u102C\u1016\u103A<<<\u1029\u1016\u103A&\u1021\u1031\u102C\u1016\u1039<<<\u1029\u1031\u102C\u1016\u1039&\u1021\u1031\u102C\u1016\u103A<<<\u1029\u1031\u102C\u1016\u103A&\u1021\u102D\u1017\u1039<<<\u1023\u1017\u1039&\u1021\u102D\u1017\u103A<<<\u1023\u1017\u103A&\u1021\u102F\u1017\u1039<<<\u1025\u1017\u1039&\u1021\u102F\u1017\u103A<<<\u1025\u1017\u103A&\u1021\u1031\u1017\u1039<<<\u1027\u1017\u1039&\u1021\u1031\u1017\u103A<<<\u1027\u1017\u103A&\u1021\u1031\u102C\u1017\u1039<<<\u1029\u1017\u1039&\u1021\u1031\u102C\u1017\u103A<<<\u1029\u1017\u103A&\u1021\u1031\u102C\u1017\u1039<<<\u1029\u1031\u102C\u1017\u1039&\u1021\u1031\u102C\u1017\u103A<<<\u1029\u1031\u102C\u1017\u103A&\u1021\u102D\u1018\u1039<<<\u1023\u1018\u1039&\u1021\u102D\u1018\u103A<<<\u1023\u1018\u103A&\u1021\u102F\u1018\u1039<<<\u1025\u1018\u1039&\u1021\u102F\u1018\u103A<<<\u1025\u1018\u103A&\u1021\u1031\u1018\u1039<<<\u1027\u1018\u1039&\u1021\u1031\u1018\u103A<<<\u1027\u1018\u103A&\u1021\u1031\u102C\u1018\u1039<<<\u1029\u1018\u1039&\u1021\u1031\u102C\u1018\u103A<<<\u1029\u1018\u103A&\u1021\u1031\u102C\u1018\u1039<<<\u1029\u1031\u102C\u1018\u1039&\u1021\u1031\u102C\u1018\u103A<<<\u1029\u1031\u102C\u1018\u103A&\u1021\u102D\u1019\u1039<<<\u1023\u1019\u1039&\u1021\u102D\u1019\u103A<<<\u1023\u1019\u103A&\u1021\u102F\u1019\u1039<<<\u1025\u1019\u1039&\u1021\u102F\u1019\u103A<<<\u1025\u1019\u103A&\u1021\u1031\u1019\u1039<<<\u1027\u1019\u1039&\u1021\u1031\u1019\u103A<<<\u1027\u1019\u103A&\u1021\u1031\u102C\u1019\u1039<<<\u1029\u1019\u1039&\u1021\u1031\u102C\u1019\u103A<<<\u1029\u1019\u103A&\u1021\u1031\u102C\u1019\u1039<<<\u1029\u1031\u102C\u1019\u1039&\u1021\u1031\u102C\u1019\u103A<<<\u1029\u1031\u102C\u1019\u103A&\u1021\u102D\u101A\u1039<<<\u1023\u101A\u1039&\u1021\u102D\u101A\u103A<<<\u1023\u101A\u103A&\u1021\u102F\u101A\u1039<<<\u1025\u101A\u1039&\u1021\u102F\u101A\u103A<<<\u1025\u101A\u103A&\u1021\u1031\u101A\u1039<<<\u1027\u101A\u1039&\u1021\u1031\u101A\u103A<<<\u1027\u101A\u103A&\u1021\u1031\u102C\u101A\u1039<<<\u1029\u101A\u1039&\u1021\u1031\u102C\u101A\u103A<<<\u1029\u101A\u103A&\u1021\u1031\u102C\u101A\u1039<<<\u1029\u1031\u102C\u101A\u1039&\u1021\u1031\u102C\u101A\u103A<<<\u1029\u1031\u102C\u101A\u103A&\u1021\u102D\u101B\u1039<<<\u1023\u101B\u1039&\u1021\u102D\u101B\u103A<<<\u1023\u101B\u103A&\u1021\u102F\u101B\u1039<<<\u1025\u101B\u1039&\u1021\u102F\u101B\u103A<<<\u1025\u101B\u103A&\u1021\u1031\u101B\u1039<<<\u1027\u101B\u1039&\u1021\u1031\u101B\u103A<<<\u1027\u101B\u103A&\u1021\u1031\u102C\u101B\u1039<<<\u1029\u101B\u1039&\u1021\u1031\u102C\u101B\u103A<<<\u1029\u101B\u103A&\u1021\u1031\u102C\u101B\u1039<<<\u1029\u1031\u102C\u101B\u1039&\u1021\u1031\u102C\u101B\u103A<<<\u1029\u1031\u102C\u101B\u103A&\u1021\u102D\u101C\u1039<<<\u1023\u101C\u1039&\u1021\u102D\u101C\u103A<<<\u1023\u101C\u103A&\u1021\u102F\u101C\u1039<<<\u1025\u101C\u1039&\u1021\u102F\u101C\u103A<<<\u1025\u101C\u103A&\u1021\u1031\u101C\u1039<<<\u1027\u101C\u1039&\u1021\u1031\u101C\u103A<<<\u1027\u101C\u103A&\u1021\u1031\u102C\u101C\u1039<<<\u1029\u101C\u1039&\u1021\u1031\u102C\u101C\u103A<<<\u1029\u101C\u103A&\u1021\u1031\u102C\u101C\u1039<<<\u1029\u1031\u102C\u101C\u1039&\u1021\u1031\u102C\u101C\u103A<<<\u1029\u1031\u102C\u101C\u103A&\u1021\u102D\u101E\u1039<<<\u1023\u101E\u1039&\u1021\u102D\u101E\u103A<<<\u1023\u101E\u103A&\u1021\u102F\u101E\u1039<<<\u1025\u101E\u1039&\u1021\u102F\u101E\u103A<<<\u1025\u101E\u103A&\u1021\u1031\u101E\u1039<<<\u1027\u101E\u1039&\u1021\u1031\u101E\u103A<<<\u1027\u101E\u103A&\u1021\u1031\u102C\u101E\u1039<<<\u1029\u101E\u1039&\u1021\u1031\u102C\u101E\u103A<<<\u1029\u101E\u103A&\u1021\u1031\u102C\u101E\u1039<<<\u1029\u1031\u102C\u101E\u1039&\u1021\u1031\u102C\u101E\u103A<<<\u1029\u1031\u102C\u101E\u103A&\u1021\u102D\u101F\u1039<<<\u1023\u101F\u1039&\u1021\u102D\u101F\u103A<<<\u1023\u101F\u103A&\u1021\u102F\u101F\u1039<<<\u1025\u101F\u1039&\u1021\u102F\u101F\u103A<<<\u1025\u101F\u103A&\u1021\u1031\u101F\u1039<<<\u1027\u101F\u1039&\u1021\u1031\u101F\u103A<<<\u1027\u101F\u103A&\u1021\u1031\u102C\u101F\u1039<<<\u1029\u101F\u1039&\u1021\u1031\u102C\u101F\u103A<<<\u1029\u101F\u103A&\u1021\u1031\u102C\u101F\u1039<<<\u1029\u1031\u102C\u101F\u1039&\u1021\u1031\u102C\u101F\u103A<<<\u1029\u1031\u102C\u101F\u103A&\u1031\u102C\u1000\u103A\u1000\u103B=\u1031\u102C\u1000\u103A\u103B&\u1014\u103A\u1014\u102F\u1015\u103A=\u1014\u103A\u102F\u1015\u103A&\u1031\u101E\u1039\u101E=\u1031\u103F&\u102D\u101E\u1039\u101E=\u102D\u103F&\u102F\u101E\u1039\u101E=\u102F\u103F&\u1021\u102D\u101E\u1039\u101E<<<\u1023\u103F&\u1021\u102F\u101E\u1039\u101E<<<\u1025\u103F&\u101E\u1039\u101E=\u103F&\u1014\u103E\u102D\u102F\u1000\u103A<<\u104C&\u101B\u103D\u1031\u1037<<\u104D&\u101C\u100A\u103A\u1038\u1000\u1031\u102C\u1004\u103A\u1038<<\u104E\u1004\u103A\u1038&\u1021\u102D<<\u104F&\u101C\u1000\u103A\u101A\u102C=\u101C\u1000\u103A\u103B\u102C&\u101E\u1019\u102E=\u101E\u1039\u1019\u102E&\u1011\u1019\u1004\u103A\u1038=\u1011\u1039\u1019\u1004\u103A\u1038&\u101C\u1000\u103A\u1018\u1000\u103A=\u101C\u1039\u1018\u1000\u103A &A << \u00E0 <<< \u00C0 << \u1EA3 <<< \u1EA2 << \u00E3 <<< \u00C3 << \u00E1 <<< \u00C1 << \u1EA1 <<< \u1EA0  < \u0103 <<< \u0102 << \u1EB1 <<< \u1EB0 << \u1EB3 <<< \u1EB2 << \u1EB5 <<< \u1EB4 << \u1EAF <<< \u1EAE << \u1EB7 <<< \u1EB6  < \u00E2 <<< \u00C2 << \u1EA7 <<< \u1EA6 << \u1EA9 <<< \u1EA8 << \u1EAB <<< \u1EAA << \u1EA5 <<< \u1EA4 << \u1EAD <<< \u1EAC &D  < \u0111 <<< \u0110 &E << \u00E8 <<< \u00C8 << \u1EBB <<< \u1EBA << \u1EBD <<< \u1EBC << \u00E9 <<< \u00C9 << \u1EB9 <<< \u1EB8  < \u00EA <<< \u00CA << \u1EC1 <<< \u1EC0 << \u1EC3 <<< \u1EC2 << \u1EC5 <<< \u1EC4 << \u1EBF <<< \u1EBE << \u1EC7 <<< \u1EC6 &I << \u00EC <<< \u00CC << \u1EC9 <<< \u1EC8 << \u0129 <<< \u0128 << \u00ED <<< \u00CD << \u1ECB <<< \u1ECA &O << \u00F2 <<< \u00D2 << \u1ECF <<< \u1ECE << \u00F5 <<< \u00D5 << \u00F3 <<< \u00D3 << \u1ECD <<< \u1ECC  < \u00F4 <<< \u00D4 << \u1ED3 <<< \u1ED2 << \u1ED5 <<< \u1ED4 << \u1ED7 <<< \u1ED6 << \u1ED1 <<< \u1ED0 << \u1ED9 <<< \u1ED8  < \u01A1 <<< \u01A0 << \u1EDD <<< \u1EDC << \u1EDF <<< \u1EDE << \u1EE1 <<< \u1EE0 << \u1EDB <<< \u1EDA << \u1EE3 <<< \u1EE2 &U << \u00F9 <<< \u00D9 << \u1EE7 <<< \u1EE6 << \u0169 <<< \u0168 << \u00FA <<< \u00DA << \u1EE5 <<< \u1EE4  < \u01B0 <<< \u01AF << \u1EEB <<< \u1EEA << \u1EED <<< \u1EEC << \u1EEF <<< \u1EEE << \u1EE9 <<< \u1EE8 << \u1EF1 <<< \u1EF0 &Y << \u1EF3 <<< \u1EF2 << \u1EF7 <<< \u1EF6 << \u1EF9 <<< \u1EF8 << \u00FD <<< \u00DD << \u1EF5 <<< \u1EF4&C <  \u010D <<< \u010C < \u0107 <<< \u0106 &D <  d\u017E <<< \u01C6 <<< D\u017E <<< \u01C5 <<< D\u017D <<< \u01C4    <  \u0111 <<< \u0110 &L < lj <<< \u01C9 <<< Lj <<< \u01C8 <<< LJ <<< \u01C7 &N < nj <<< \u01CC <<< Nj <<< \u01CB <<< NJ <<< \u01CA &S < \u0161 <<< \u0160 &Z < \u017E <<< \u017D& \u0D96 < \u0D82 < \u0D83 < \u0D9A < \u0D9B < \u0D9C < \u0D9D< \u0D9E < \u0D9F < \u0DA0 < \u0DA1 < \u0DA2 < \u0DA3< \u0DA5 < \u0DA4 < \u0DA6< \u0DA7 < \u0DA8 < \u0DA9 < \u0DAA < \u0DAB < \u0DAC< \u0DAD < \u0DAE < \u0DAF < \u0DB0 < \u0DB1< \u0DB3 < \u0DB4 < \u0DB5 < \u0DB6 < \u0DB7 < \u0DB8< \u0DB9 < \u0DBA < \u0DBB < \u0DBD < \u0DC0 < \u0DC1< \u0DC2 < \u0DC3 < \u0DC4 < \u0DC5 < \u0DC6< \u0DCF< \u0DD0 < \u0DD1 < \u0DD2 < \u0DD3 < \u0DD4 < \u0DD6< \u0DD8 < \u0DF2 < \u0DDF < \u0DF3 < \u0DD9 < \u0DDA< \u0DDB < \u0DDC < \u0DDD < \u0DDE < \u0DCA&C < \u010D <<< \u010C < \u0107 <<< \u0106&D < d\u017E = \u01C6 <<< d\u017D <<< D\u017E = \u01C5 <<< D\u017D = \u01C4   < \u0111 <<< \u0110&L < lj = \u01C9  <<< lJ <<< Lj = \u01C8 <<< LJ = \u01C7&N < nj = \u01CC  <<< nJ <<< Nj = \u01CB <<< NJ = \u01CA&S < \u0161 <<< \u0160&Z < \u017E <<< \u017D&O < \u00F6 <<< \u00D6 << \u0151 <<< \u0150&U < \u00FC <<< \u00DC << \u0171 <<< \u0170& C < \u0109 <<< \u0108& G < \u011D <<< \u011C& H < \u0125 <<< \u0124& J < \u0135 <<< \u0134& S < \u015d <<< \u015c& U < \u016d <<< \u016c& \u066D < \u064E < \uFE76 < \uFE77 < \u0650 < \uFE7A < \uFE7B < \u064F < \uFE78 < \uFE79 < \u064B < \uFE70 < \uFE71 < \u064D < \uFE74 < \u064C < \uFE72& \uFE7F < \u0653 < \u0654 < \u0655 < \u0670& \u0669 < \u0622 < \u0627 < \u0671 < \u0621 < \u0623 < \u0625 < \u0624 < \u0626& \u0642 < \u06A9 < \u0643& \u0648 < \u0647 < \u0629 < \u06C0 < \u06CC < \u0649 < \u064A& \uFE80 < \uFE81 < \uFE82 < \uFE8D < \uFE8E < \uFB50 < \uFB51 < \uFE80  & \uFE80 < \uFE83 < \uFE84 < \uFE87 < \uFE88 < \uFE85 < \uFE86 < \u0689 < \u068A& \uFEAE < \uFDFC& \uFED8 < \uFB8E < \uFB8F < \uFB90 < \uFB91 < \uFED9 < \uFEDA < \uFEDB < \uFEDC& \uFEEE < \uFEE9 < \uFEEA < \uFEEB < \uFEEC < \uFE93 < \uFE94 < \uFBA4 < \uFBA5 < \uFBFC < \uFBFD < \uFBFE < \uFBFF < \uFEEF < \uFEF0 < \uFEF1 < \uFEF2 < \uFEF3 < \uFEF4 < \uFEF5 < \uFEF6 < \uFEF7 < \uFEF8 < \uFEF9 < \uFEFA < \uFEFB < \uFEFC& I << j <<< J & V << u <<< U &C <  ch <<< Ch <<< CH&L <  ll <<< Ll <<< LL&N < \u00F1 <<< \u00D1& A < \u00E4 <<< \u00C4& C < \u010D <<< \u010C& H < ch <<< Ch <<< CH& O < \u00F4 <<< \u00D4& S < \u0161 <<< \u0160& Z < \u017E <<< \u017D& C << ch <<< Ch <<< CH< \u010D <<< \u010C& E << \u0119 <<< \u0118 << \u0117 <<< \u0116& I << y <<< Y& S  < \u0161 <<< \u0160& Z  < \u017E <<< \u017D& Y << \u00FC <<< \u00DC << \u0171 <<< \u0170& Z  < \u00E6 <<< \u00C6 << \u00E4 <<< \u00C4 < \u00F8 <<< \u00D8 << \u00F6 <<< \u00D6 << \u0151 <<< \u0150 < \u00E5 <<< \u00C5 << aa <<<  Aa <<< AA& C < \u010D <<< \u010C & H <      ch <<<      Ch <<< CH& R < \u0159 <<< \u0158& S < \u0161 <<< \u0160& Z < \u017E <<< \u017D& C < \u00E7 <<< \u00C7 & G < \u011F <<< \u011E & H < \u0131 <<< \u0049 & O < \u00F6 <<< \u00D6 & S < \u015F <<< \u015E & U < \u00FC <<< \u00DC & Y <<\u00FC <<< \u00DC & Z < \u00E5 <<< \u00C5 < \u00E4 <<< \u00C4 << \u00E6 <<< \u00C6 < \u00F6 <<< \u00D6 << \u00F8 <<< \u00D8 & N < \u00F1 <<< \u00D1 & S < \u0161 <<< \u0160  < \u007A <<< \u005A  < \u017E <<< \u017D & W < \u00F5 <<< \u00D5 < \u00E4 <<< \u00C4 < \u00F6 <<< \u00D6 < \u00FC <<< \u00DC & A < \u0105 <<< \u0104 & C < \u0107 <<< \u0106 & E < \u0119 <<< \u0118 & L < \u0142 <<< \u0141 & N < \u0144 <<< \u0143 & O < \u00F3 <<< \u00D3 & S < \u015B <<< \u015A & Z < \u017A <<< \u0179 < \u017C <<< \u017B& C < \u010D <<< \u010C & S < \u0161 <<< \u0160 & Z < \u017E <<< \u017D & A < \u0103 <<< \u0102 < \u00E2 <<< \u00C2 & I < \u00EE <<< \u00CE & S < \u0219 <<< \u0218 << \u015F <<< \u015E & T < \u021B <<< \u021A << \u0163 <<< \u0162 & C < \u010D <<< \u010C & G < \u0123 <<< \u0122 & I < \u0079 <<< \u0059 & K < \u0137 <<< \u0136 & L < \u013C <<< \u013B & N < \u0146 <<< \u0145 & R < \u0157 <<< \u0156 & S < \u0161 <<< \u0160 & Z < \u017E <<< \u017D & A < \u00E1 <<< \u00C1 & D < \u00F0 <<< \u00D0 & E < \u00E9 <<< \u00C9 & I < \u00ED <<< \u00CD & O < \u00F3 <<< \u00D3 & U < \u00FA <<< \u00DA & Y < \u00FD <<< \u00DD & Z < \u00FE <<< \u00DE < \u00E6 <<< \u00C6 << \u00E4 <<< \u00C4 < \u00F6 <<< \u00D6 << \u00F8 <<< \u00D8 < \u00E5 <<< \u00C5 &AE << \u00E6 <<< \u00C6 << \u00E4 <<< \u00C4 &OE << \u0153 <<< \u0152 << \u00F6 <<< \u00D6 &UE << \u00FC <<< \u00DC 	                                                                                                                                                                                                    H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            � � � � � � � � �                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �   � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �   � �                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  a a a a a a a a a                                                                                                                                                         Y   Y    Y  Y  Y  Y  Y  Y   Y  Y  Y  Y  Y  Y      Y  Y  Y  Y   Y     Y  Y  Y  Y  Y     Y  Y  Y  Y                                                                                                                                                                                                                                        Y                                          � � � �                             � � � �                                                                                                                                                 `
                                              � � � �                                                          �                                                                                                                                                         �    � �                                                                                                                                                                                                                                                                                                                             � � �                                                                                                                                                                                                                                                                                                                                      d d d d d d d d d d                                                                                                                       � �                                                                                                                                                                                � �                                                     � � � � � � � � �                                                   � �     �       �         � � � � � � � �                    �                       �                                                                                                                  X                                                                                                                                                                HI                                                                                                               ��                                                                          ���� ����������                                                                                                                                                                                                                                                                � �                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          � � �������������                                                                                         �                                                                                                                                                 �                                                ������                                   Z                               ��  �           � � �� �� � � � � � � � � �  � � � � �  �  � �  � �  � � � � � � � � �                                                                                       � �           � �                                                                                                                                                                                                                                                                                                                                             	    n n n n n n n n n n                                                                                       ~ ~ ~ ~ ~ ~ ~ ~ ~ ~                                                                                                     $ %                                                               y y y y y y y y y y                                 *+,                                                                                                                                                              � � � � � � � � � �                                                 
                                                                                                                                                                                                   o o o o o o o o o o                                                                                         Y  Y                                                                     Z Z Z Z Z     Z Z Z Z Z Z                                                                                                                                                                      � � � � � � � � � �                                                                     �         __                                                                                                                  ��                I         I        H           H                      H   H   H H H       H  H      H              H   H       H               I             H       H   H  H            I     I   H    I     I   I  H      H     H             I  I      I   I  H H   I    H     I  H                                 H    H  H         H              I    H       H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Z Z Z Z  Z  Z \ Z Z Z   Z Z    Z                                                                                     �                          � � � � � � � � �BCDEFG   H  H                         H  H  H  H  H  H  H  H  H  H  H  H   H  H  H       H I  H I  H I  H I  H I                       H    HI    H               H  H  H  H  H  H  H  H  H  H  H  H   H  H  H       H I  H I  H I  H I  H I                       H   H H H H    H                                                                                                                                   Y Y   Y  Y Y Y  Y Y Y Z Y   Y    Y  Y     Y Y Y       Y  Y  Y Y Y Y  Y     Y Z Y Y Z    Y Y Y  Y Z       Y   Y   Y Z Y      Y  Y       Y   Y  Y Y   Y    Y  Y  Y  Y Z                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               _*"                                                                                                                                                                                                                                                   T                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       T     T   T                        T  T                                 T   T   T  T                       T  T           T T T T T   T T   T T       T T   T T   T T                                   T T T T                                                 T T T T       T T T T                                            }                                 C                                                                                                                                                        �                       T T                   T                               T T T                                                                                                                                                                                                                                                            JKLLMNOPaaaQRbbbbSbbbaTUVWaa````_                " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2   " * "5 *5 "2 *2   " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2   " * "5 *5 "2 *2   " * "5 *5 "2 *2 "E *E  *  *5  *2  *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E 5 2 5 2 5 2 5 2 5 2 5 2 5 2   " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E " * "5 *5 "2 *2 "E *E 7 [ 5  2  E E 7 [ 5 2      E 5  2  E E 5 2 5 2  5 2 E 7 [ G5 G2   E GE 7 [ 5 2  5 2 E 7 [ G5 G2 " * E GE 7 [ 5 2 * 5 2    5  2  E E 5 2 5 2     v v R R p p { { V2 V2 R R p p { { V V x x [5 [5 [2 [2 x x z z V7 V7 R R [ [ R R p p G G V V y y z z G2 G2 2 2 p p { { p p p[ p[ { { x x 2 2 R R p p R R p p { { x x N2 N2 NG NG [5 [5 [2 [2 2 2 R R R R p p p[ p[ { { R R p p 2R 2R AR AR pR pR R R p p { { x x u u z z x x N2 N2 [G [G N N p p 5 5 2 2 G G R R p p R R G G R R < < p p { { { G C C   ZR   Y   p p d d <2 <2 <5 <5 <d <d <N <N p< p< 72 72 75 75 7d 7d 7N 7N p7 p7 p p d d N N <2 <2 <5 <5 <d <d <N <N p< p< d d p p p p d d <2 <2 <5 <5 <d <d <N <N p< p< h2 h2 h5 h5 hd hd hN hN hp hp p p d d h2 h2 h5 h5 hd hd hN hN hp hp 5 5 p p d d N N                                                      Y                                                                             Z Y                                     Y                                 __`_______ ____``_  Y Y      V Z Y            Z                       `_`                                                       )         x x x x x x x x x x       � � � � � � � � � �                                                                                                                          �    �             ����                                               �                                                                                                                � � � � � � � � � �                                                                                                                                                                                            6789:;<=>   s s s s s s s s s s       t t t t t t t t t t                                                                                                                                                               ?@A           p p p p p p p p p p                                                                                                                                 q q q q q q q q q q r                                                      � � � � � � � � � �                                                                                                                                                                                                                                                                                                                                                                                                                                            12345_______          _   | | | | | | | | | |       } } } } } } } } } }                                                                                                                                                                        Y   Y Z  Y  Y   Z \ ]     Y Z \ ]     Y Z \  Y Z  Y  Y  Y     Y \ ] ^  Y Z  Y Z Y   Y Z  Y  Y          Y Z Y Z      Y Y                                                                                                                �          c c c c c c c c c                                                                                                                                                                                                    -./          z z z z z z z z z z                                                                   0   { { { { { { { { { {                                                                                                        '                              w w w w w w w w w w w w w w w w w w w w   &                                                       Z                   '(                                                             Z Z Z                                                                                                                                           u u u u u u u u u u                                                                                                               !"#   v v v v v v v v v v                                          ��                                                                                                   m m m m m m m m m m                        ��                                                                                                                             ���                                                                                                   k k k k k k k k k k         k k k k k k k   ��                                                        �                                          l l l l l l l l l l                 ���                                                        �                                � �         i i i i i i i i i i                  �                                                                                                    j j j j j j j j j j                 ���                                                �   �     �                             � � �   �        g g g g g g g g g g��               ���                                                        �                                          h h h h h h h h h h                ����                                      �        �   �       �                    52    � � � � � � � �       e e e e e e e e e e                 ���                                                        �                                 � �  �       f f f f f f f f f f                                        ��  ������������������                                                                                                                                                                                                                                  �   Z        Z           Z      \ \ \����������������_`_`                                                                                                                      b b b b b b b b b b                               Y Y Y���������                                                                        ��������������������  _ _ _ _ _ _ _ _ _ _      �                                                                                    �  �                 �        ` ` ` ` ` ` ` ` ` `    Z Z                                                                                                                                                   ������������� � ��  �                                                            5 G            5                                                                   5 G            5                                     �_*"_       Z Z                                                7 7                                [ [           [ [                52<N[c7RGdCMA__efg_"*_````_h`````nopuvwVY````xy`z{!`|}aaT~```___52E"G2_```___``___````_�``_`__`��`                                   2 2  2 2 2  2  2 2 G2                          G G 2 2 2 2 G2                          G G 2 2 2       2 G                                              e e g g e e g g e e g g e e g g e e g g e e g g w w w w   A A       R R V V G[ G[ N[ N[ R R R[ R[ [ [                                                                                                                                                                                                                        [ [ 7 7 Y Y 2 2 < < R R A A A A } } [ [ 7 7 R R Y Y A A < < 7 7 R R V V < < } } N N [ [ 7 7 Y Y R      < < V V  2 2 V V A A Y Y } } 2 2 V V A A     [ [ 7 7 M M Y  Y  2 2 V V A A 2 2 < < V V A A V V A A   N N [ [ 7 7 C C M M Y Y < < < < G 2 2 R R A A Z                                  h h              h h                      A  A  A             A A A A A A A A G[ G[ G2 G2 GA GA G5 G5  G[ G[ R[ R[ Y [ Y [   A A A A Y Y Y[ Y[ A A A       2 2   5 5 C2 C2 Y 2 Y 2 T2 T2                                                                                                                                            5 2 < N G C Y  V 5 2 < G 5 2 < G Y N 5 2 < N G  T 5 2 < G 2  Y  5 2 < N G C Y  V 5 2 < G 5 2 < G Y N 5 2 < N G  T 5 2 < G 2  G		������������������������������������������������������������	��
������
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������€�À�Ā�ŀ�ƀ�ǀ�Ȁ�ɀ�ʀ�ˀ�̀�̀�΀�π�Ѐ�р�Ҁ�Ӏ�Ԁ�Հ�ր�׀�؀�ـ�ڀ�ۀ�܀�݀�ހ�߀���������������������������������������������������������������������������A�)�����A����3�A�)�A���A�™A���������0�A��A�@�A�����������A�g���Π��������������A�����V�A���A���A��A��A��A�;��������� ��!��"��#��$��%��&��'��(��)��*��+��,��-��.��/��0��1��2��3��4��5��6��7��8��9��:��;��<��=��>��?��@��A��B��C��D��E��F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�>�@�w�@�A�@�i�@�x�@������@�4�@�/�@�n���3�@���@�����Ѿ@���@�n���^�����@���@�9�@��@������@�J�@�}�@�w�@�����%�@�E���c�@�������@�(�@�5�@�P����@���@�����5����@�z�@�������@�����������@�G�@�\�@�q�@���@������@�$���6�@�>�����@�p�����@������������D��������@���������������3�@��@��@��@�J���9�@�����F��������@�N�@���@�������&�@�V���������@���@����/�@�@�@�J�@�O���|���������@���������@��@����'�����@������@��@��@������@�c����@��@��@�E���4���(���G���Y�����@�z���>�@���@���A��������#�A�`�����A�p���_�����A���A�����A�>�@�������������������A��A��A�����k�A���A���A���@���A���A���A���A����<�A��A��A�c�A���A�#�A���A��A�W�A�S�A�ʃA�̃A�܃��6���k�������+�A��A��A������A�d���,���]���a�����������k�A�P�A�\�A�g�A�i�A���A���A��A��A�y�A�(�A�k�A�������A��A������A�`�A�c���g�A�׈A�ވ��5�A�������������f���������A���A��A���A�U�����A���A���A��A�w���/����A�ˍA���A����ވA�ԎA�8���҅���A���A��A����.�A��A�8�A�גA�ؒA�|�A���A������A�������A�����w�����A�Ö@���A�#���E������n���v�A����
���������A��A��@�=�@�8�@�A���"�@�`�@���@���@��@�z�@���@���@���������:�@�M�@�T�@�d�@�w��������@�g�@�����K�@���@���@���@���@�����ߑ@���@����ߴ@�;�@�F�@�r�@�w����@���@���@���@���@��@��@��@�I�@�Q�@�Z�@�s�@�}�@��@��@����,�@�p�@���@�����c�@���@���@��@���@�8�@�H�@�h�@���@���@��@�S�@�c�@���@���@���@���@���@���@��@��@��@�Q�@�t�@��@���@���@���@�
�@���@�2�@�1�@������@���@���@��@��@�"�@�b��������@���@��@�'�@���@�f��������@��@�>�@�>���ș@���@���@���@������@���@��@�S�@�"�����@�`�@�n�@���@������@�C����@�n�@�k�@�|�@���@�����/�@���@�(�@�=�@�i���b�������|�@���@���@���@�������@�����1���1�A��@�"�@�"���Ǹ��������@�b�@�k����@���@���@���@���@�����:����@�����Ԧ@���@�H�@�L�@�N�@�L�@�z�@���@���@���@���@���@���@���@��@��@�]�@���@���@�P����@�=�@���@�h�@���@������@�"�@���@�����.�@�i�@�~�@���@�w���l�@�O�@�l���
�@���@���@�I����@���������@���@���@��@���A�������@��@��@�!�@�^�@�S���ó��I�@���@���@�R�@�����m�@���@��@������@�B�@���@���@�������@������@�!�����@�T���N�@�r�@���@���@��������������@�N�����@���@���@�g�@��2++�����������������	��
������
�����@�K�@�W�@���'+@���@��A��@�)�@���@� �@�!�@���@�M�@���@���@���@��@�B�@��A���@���@�9�@��@���@�U�@��@�	�A�J�@���@�-�@���@��A�p�@�S��2��3��4��5��6��7��8��9��:��;��<��=��>��?�G@�,�HG@�	�HG@���HG@���HG@���HG@�S�HG@��HG@���HG@�W�H�I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������4444	4
444
44�����
�������%�=�P�k�����������0�_�m����������3�S�{��������GH=�=P���/��0�%�2��3��4��5��6��7��8��9��:��;��<�m�>���@��A��C��D��E���G��H��I��{_{P��{�O��P��Q��R��S��T��U��V���X��Y��Z��[��\��]��^���`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��z�0_�}��~����������������������������������=�������P���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno�,��-��.��/�pqrstuvwxyz{|}~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������JNPQRTUWXYZ[`ccghijkmBJQTi`[EFGIJNPQRTUWXYZ[`QcghijkmFEFGIJNPQRTUWXYZ[`ccghijkmBJQTi`[EFGIJNPQRTUWXYZ[`QcghijkmFEFGIJNPQRTUWXYZ[`ccghijkmBJQTi`[EFGIJNPQRTUWXYZ[`QcghijkmFEFGIJNPQRTUWXYZ[`ccghijkmBJQTi`[KK������	

	

	

	

	

3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{�����	������EFGIJNPQRTUWXYZ[`QcghijkmFEFGIJNPQRTUWXYZ[`ccghijkmBJQTi`[EFGIJNPQRTUWXYZ[`QcghijkmFEFGI����%��Pk������0_m�����3S{�����%=Pk����0_m����3S{����%�:�Pk���?��0_�E���G��H��I�3S{����Q�%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{����%=Pk���U��0_m����3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{�������=P�������������������m������3S{����%=P���������0_m������3S{����%=Pk����0_m����3S{����%=Pk����0_m����3S{~

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�W��X��Y��Z��[��\��]��^��_�	

����������r��s��t��u��v��w��x��y��z��{��|��}��~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABC�F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{�'��(����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST�������������������������������:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�/��0��1��2��3��4��5��6��7��8��9��:��;��<��=��>��?��@��A��B��C��D��E��F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������´�ô�Ĵ�Ŵ�ƴ�Ǵ�ȴ�ɴ�ʴ�˴�̴�ʹ�δ�ϴ�д�Ѵ�Ҵ�Ӵ�Դ�մ�ִ�״�ش�ٴ�ڴ�۴�ܴ�ݴ�޴�ߴ����������������������������������������������������������������������������9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9:::::::::	:
:::
::::::::::::::::::: :!:":#:$:%:&:':(:):*:+:,:-:.:/:0:1:2:3:4:5:6:7:8:9:::;:<:=:>:?:@:A:B:C:D:E:F:G:H:I:J:K:L:M:N:O:P:Q:R:S:T:U:V:W:X:Y:Z:[:\:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:}:~::�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8999999999	9
999
9999999999999999999 9!9"9#9$9%9&9'9(9)9*9+9,9-9.9/909192939495969798999:9;9<9=9>9?9@9A9B9C9D9E9F9G9H9I9J9K9L9M9N9O9P9Q9R9S9T9U9V9W9X9Y9Z9[9\9]9^9_9`9a9b9c9d9e9f9g9h9i9j9k9l9m9n9o9p9q9r9s9t9u9v9w9x9y9z9{9|9}9~99�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7888888888	8
888
8888888888888888888 8!8"8#8$8%8&8'8(8)8*8+8,8-8.8/808182838485868788898:8;8<8=8>8?8@8A8B8C8D8E8F8G8H8I8J8K8L8M8N8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8\8]8^8_8`8a8b8c8d8e8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}8~88�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6777777777	7
777
7777777777777777777 7!7"7#7$7%7&7'7(7)7*7+7,7-7.7/707172737475767778797:7;7<7=7>7?7@7A7B7C7D7E7F7G7H7I7J7K7L7M7N7O7P7Q7R7S7T7U7V7W7X7Y7Z7[7\7]7^7_7`7a7b7c7d7e7f7g7h7i7j7k7l7m7n7o7p7q7r7s7t7u7v7w7x7y7z7{7|7}7~77�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7	

	

	

	

	
	

	
��	
				

	
		

������������c��d��e��f��g��h��i��j��k��l��m��n��o������t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¤�ä�Ĥ�Ť�Ƥ�Ǥ�Ȥ�ɤ�ʤ�ˤ�̤�ͤ�Τ�Ϥ�Ф�Ѥ�Ҥ�Ӥ�Ԥ�դ�֤�פ�ؤ�٤�ڤ�ۤ�ܤ�ݤ�ޤ�ߤ���������������������������������������������������������������������������-6.6/606162636465666768696:6;6<6=6>6?6@6A6B6C6D6E6F6G6H6I6J6K6L6M6N6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6\6]6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6w6x6y6z6{6|6}6~66�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������£�ã�ģ�ţ�ƣ�ǣ�ȣ�ɣ�ʣ�ˣ�̣�ͣ�Σ�ϣ�У�ѣ�ң�ӣ�ԣ�գ�֣�ף�أ�٣�ڣ�ۣ�ܣ�ݣ�ޣ�ߣ���������������������������������������������������������������������������-5.5/505152535455565758595:5;5<5=5>5?5@5A5B5C5D5E5F5G5H5I5J5K5L5M5N5O5P5Q5R5S5T5U5V5W5X5Y5Z5[5\5]5^5_5`5a5b5c5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5s5t5u5v5w5x5y5z5{5|5}5~55�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5666666666	6
666
6666666666666666666 6!6"6#6$6%6&6'6(6)6*6+6,6-4.4/404142434445464748494:4;4<4=4>4?4@4A4B4C4D4E4F4G4H4I4J4K4L4M4N4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4\4]4^4_4`4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x4y4z4{4|4}4~44�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4555555555	5
555
5555555555555555555 5!5"5#5$5%5&5'5(5)5*5+5,5-3.3/303132333435363738393:3;3<3=3>3?3@3A3B3C3D3E3F3G3H3I3J3K3L3M3N3O3P3Q3R3S3T3U3V3W3X3Y3Z3[3\3]3^3_3`3a3b3c3d3e3f3g3h3i3j3k3l3m3n3o3p3q3r3s3t3u3v3w3x3y3z3{3|3}3~33�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3444444444	4
444
4444444444444444444 4!4"4#4$4%4&4'4(4)4*4+4,4�������������������	��
������
�������������������������������������� ��!��"��#��$��%��&��'��(��)��*��+��,��-��.��/��0��1��2��3��4��5��6��7��8��9��:��;��<��=��>��?��@��A��B��C��D��E��F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~�����������������������������	

��������Ð�Đ�Ő�Ɛ�ǐ�Ȑ�ɐ�ʐ�ː�̐�͐�ΐ�ϐ�А�ѐ�Ґ�Ӑ�Ԑ�Ր�֐�א�ؐ�ِ�ڐ�ې�ܐ�ݐ�ސ�ߐ����������������������������������������������������������������������������������������������	��
������
�������������������������������������� ��!��"��#��$��%��&��'��(��)��*��+��,��-��.��/��0��1��2��3��4��5��6��7��8��9��:��;��<��=��>��?��@��A��B��C��D��E��F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_�	

6789:;<=>?@ABCDEFGHIJK���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ž�Î�Ď�Ŏ�Ǝ�ǎ�Ȏ�Ɏ�ʎ�ˎ�̎�͎�Ύ�ώ�Ў�ю�Ҏ�ӎ�Ԏ�Վ�֎�׎�؎�َ�ڎ�ێ�܎�ݎ�ގ�ߎ���������������������������������������������������������������������������&(&('((((()(*(+(+(,(,(-(-(.(.(/(/(0(0(1(2(2(3(3(4(4(5(5(6(6(7(7(8(9(:(;(<(<(=(=(>(>(?(?(@(A(A(B(C(D(E(E(F(F(G(G(H(H(I(I(J(K(L(M(M(N(N(O(O(P(P(Q(R(�I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Œ�Ì�Č�Ō�ƌ�nj�Ȍ�Ɍ�ʌ�ˌ�̌�͌�Ό�ό�Ќ�ь�Ҍ�ӌ�Ԍ�Ռ�֌�׌�،�ٌ�ڌ�ی�܌�݌�ތ�ߌ���������������������������������������������������������������������������o2p2q2r2s2t2u2v2w2x2y2z2{2|2}2~22�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�6��7��8���������2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�V��W�	�����2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�s��t��u��v��w�	�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‹�Ë�ċ�ŋ�Ƌ�Nj�ȋ�ɋ�ʋ�ˋ�̋�͋�΋�ϋ�Ћ�ы�ҋ�Ӌ�ԋ�Ջ�֋�׋�؋�ً�ڋ�ۋ�܋�݋�ދ�ߋ���������������������������������������������������������������������������FGHI��JK�����	��
���LMNOP��QRS��TUVWXYZ[\]^_`abcdefghijklmn�4��5��6��7��;��<��=��>�o	�����H��I��J��K��L��M��N��O�����������Y��Z��[��\��]��^��_�R2S2T2U2V2W2X2Y2Z2[2\2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Š�Ê�Ċ�Ŋ�Ɗ�NJ�Ȋ�Ɋ�ʊ�ˊ�̊�͊�Ί�ϊ�Њ�ъ�Ҋ�ӊ�Ԋ�Պ�֊�׊�؊�ي�ڊ�ۊ�܊�݊�ފ�ߊ���������������������������������������������������������������������������rstuvwxyz{|}~������������������~00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�:��;��<��=��>���@��A��B��C��D��E��F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰�É�ĉ�ʼn�Ɖ�lj�ȉ�ɉ�ʉ�ˉ�̉�͉�Ή�ω�Љ�щ�҉�Ӊ�ԉ�Չ�։�׉�؉�ى�ډ�ۉ�܉�݉�މ�߉���������������������������������������������������������������������������22222 2����!2�	�"2#2$2%2&2'2(2)2*2+2,2-2.2/202122232425262728292:2;2<2=2>2?2@2A2B2C2D2E2F2G2H2I2J2K2L2M2�6�N2O2�9��:��;�P2�=��>�Q2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�V��������`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ˆ�È�Ĉ�ň�ƈ�Lj�Ȉ�Ɉ�ʈ�ˈ�̈�͈�Έ�ψ�Ј�ш�҈�ӈ�Ԉ�Ո�ֈ�׈�؈�و�ڈ�ۈ�܈�݈�ވ�߈����������������������������������������������������������������������������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�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0111111111	1
111
1111111111111111111 1!1"1#1$1%1&1'1(1)1*1+1,1-1.1/101112131415161718191:1;1<1=1>1?1@1A1B1C1D1E1F1G1������	

�������������������������������������������������������������������������„�Ä�Ą�ń�Ƅ�DŽ�Ȅ�Ʉ�ʄ�˄�̄�̈́�΄�τ�Є�ф�҄�ӄ�Ԅ�Մ�ք�ׄ�؄�ل�ڄ�ۄ�܄�݄�ބ�߄����������������������������������������������������������������������������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��
MN�$��%��&��'��(��)��*��+��,��-��.��/��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�K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�23����33333333	3
333
3333333333333333333 3!3"3#3$3�ă�Ń�ƃ�ǃ%3&3'3(3)3*3+3,3�����փ�׃�؃�ك�ڃ�ۃ�܃�݃�ރ�߃����������������������������������������������������������������������������������������������	��
������
�������������������������������������� ��!��"��#��$��%��&��'��(��)��*��+��,��-��.��/��0��1��2��3��4��5��6��7��8��9��:��;��<��=��>��?��@��A��B��C��D��E��F��G��H��I��J��K��L��M��N��O��P��Q��R��S��T��U��V��W��X��Y��Z��[��\��]��^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~���00102030405060708090:0;0<0=0>0?0@0A0B0C0D0E0F0G0H0I0J0K0L0���������M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0�т�҂�ӂ�Ԃ�Ղ�ւ�ׂ�؂�ق�ڂ�ۂ�܂�݂�ނ�߂��������������������������������������������������������������������������������������	

OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr�4��5��6�
st
uvwx
yz{|}~
�������
�������������������
����� !"#$%���������������&'()*+,-./01��������������������������������������������������������������������������������������������������������������������Á�ā�Ł�Ɓ�ǁ�ȁ�Ɂ�ʁ�ˁ�́�́�΁�ρ23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^������H1I1J1K1L1M1N1O1P1Q1R1S1��T1U1V1W1X1Y1Z1[1\1]1^1_1`1a1b1c1d1e1f1g1h1i1j1k1l1m1�'�n1o1p1q1r1s1t1u1v1w1x1y1z1{1|1}1~11�1�;��1�1�>��1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�N��O��1�1�1�1�1�1�1�1�1�1�1�1�1�1�^��_��`��a��b��c��d��e��f��g��h��i��j��k��l��m��n��o��p��q��r��s��t��u��v��w��x��y��z��{��|��}��~����1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1222222222	2
222
22222222222222������������������n�b�c_��WP4#�\	

GCTUVsV%=Pk����0_m����3S{����^%=Pk����0_m����3S{����X[�AB@3C++++++8+9+:+&+�+++++++++++ +!+"+#+$+%+&+'+(+)+*+++,+-+.+/+0+1+2+3+4+5+6+7+8+9+:+;+<+=+>+?+@+D+-*�)�)�*�)�*�*�)�)�)�*�*�*�*�*�*�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)������������.*/*0*1*2*3*������4*5*6*7*8*9*������:*;*<*=*>*?*������@*A*B*�����������WY�����@�����	������������������������������������������4@�GCnsIJ�����������������������'���(���)���*���+���,���-���.���/���,+�GHEF?@=>ABCDAB4@���S�CGsn,�GHb_WP#TVU��g�^�cV��l���m���n���o���u������������������������������������������������������������������++++11114444====CCOOPPPP+�+�+�+�+�+�+�+����������P�O�P�O�P�O�P�O�P�������1��������OPOPOP�O�P�O�P�O�P�O�P�O�P�O�P�O�P�������1���������������1�=�=1������������11��OP��@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���1��������1��1�1��1��1��1��1��1P�1O��������O�1��1��1��11�11�������11��1��1��P�1��1��11�11��O��1��11�1�111P�111111O111P1O�1�11�11+�1+�P+�O+��+��+�1+�1+1�+1�1��1�11�P1��1�11��1�1��������1��=1�=114�14�O4�14�14�O41P41OP11P11��P��P��O��P��O�1P�1O�1P��O�1O��O��P��P��P+�P+1PP�PP�PP1P11P1P4�P1�+�11P1P4��1�P+�111+�14����P��P1�P1P��P11�1�11��P4�P�������������������������������������������������������������������������������������������������������������������������+\+\�++=���1�1��+1��C++P=C�+1�+O�+O
�++=�+
�+�+=�Q�+Q�������������1�O�P�������1�O�P�������1�O�P���1�O�P���1���1�����1�������1���1�������1�11�1�1���1OP�1OP����+1OP+�+�+�+1+O+P1�1�1�111O1P4�4�4�414O4P=�=1=O=PP�P�P�P1POPP��O�����1�4�O�P�����1�4�O�P�����1�4�O�P�����1�4�O�POPOP�+1OP+1+O+P1�114�4�41444O4POP�P�P1P4POPP�������1�=�������1�=�������1�=�1���1���1���1�������1�����1�������1�1�1�1���1�1���+1+�+�+�+1+=1�1�1�114�4�4�414==�=1=P�P�P�P1P=�1�=�1�=�1�=�1�=�1�=�1�=+1+1414=P1P=OPOPOP�O�P�O�P�O�����0�����033��������	���
���������
����������������HJH9H?RJHA���������������eeek\_`fghoqPpppp\\\]^_`ab��7�deffg��=�h��?�ij��B�ll��E�mnopqa]fl\g������������������������������������������������������    $$$$""""556666BB????>>>>\\\\�������������������������������������������������������������������������������������������������������������������GGFFHHG�KKEEIITTTTOO�����B�B�C�C�G�G�F�F�H�H�T�T�T�O�O�OQQQQ@��@���@���@��@���@��@���A�;�A�L�A�M�A���@���@�@�@���A��A��@�Z�A��@�t�A��A��@���@�*�@��@�<�@�^�@�e�@���A�V�@���@���A��A��A�!�A���A�#�A�$�A�8�A���A�'�A�(�A�)�A��A���A�(�A�����.���/�@���@���@�M�@���@���@�Q�@���@��@�h�@�@�@���@�d�@�n�@���@�h�@���@���@�O�@���@���@���@�w�@��@�"�@�n�@�+�@�"�@���@�>�@�I�@�H�@�P�@�V�@�]�@���@���@�@�@���@���@��@�	�@�A�@�r�A��A��A�y�A�y�A�W�A��A���A��A�9�A�ӌA��A���A�8�A��A���A�;�@�u�����A����n���o�@�&�@���@�h�@���@�E�@���@���@���@���@�U�@���@���@�Z�@���@�D�@�T�@�b�@�(�@���@���@�i�@���@���@�N�@��@���@�`�@���@�4�@���@��@�R�@�V�@�t�@��@��@�V�@�y�@���@�A�@���@���@�"�@��@�n�@���@�5�@���@�*�@�q�@��@�;�@��@��@��@��@��@�J�@�@�@��@���@���@�{�@�[�@��@�>�A��A�R�A��A�y�A�A�A���A���A���A���A�ˊA��A���A��A�9�A���A��A�8�A�r�A���A�v�A�|�A��A�V�A�ۗA���A��A�;�A��A�����J���D���ճ���������9���I��������A�C�A��������������������������������������������������������������������������������������������������������������������������������A�H�@���A�ʎA�Ȍ@���@�2�@���A���A���@�Q�A�ё@���@�H�@���@�i�@���A�?�A���A���A���@��@��@���@���A�=�A�j�A��@���@�u�@��@��A�-�A��@�P�@���A�ͅA�d�@���A�؁A��@���@��@�j�@���A�ΐ@���@���@���@���@���@��@��A��A��A�\�A��A�2�A�o�A���@���@��@���A�ɃA��A��A�֊@���@��@�`�A�~�@�b�@��A�ŒA���@���@�b�@��@���@��@�/�@�7�A�K�@���A���@���@���@��@���A��A�u�A���@���@��A���@�9�@���@��@���@�p�@��@���@���@���@�
�@���@�x�@�"�@���@�^�@��A�I�A���@���A���@���@���A��@���@�e�@���@�i�@���@���@��A�o�A�ҊA�ϑ@���@�B�@�s�@���@���@���@�*�A���A�j�A���A�Ξ@���@���@�w�A�b�@�t�@���@��@���@�#�@�I�@���@��@��A�o�A�&�A��A�#�A�J�@��@���@���@���A�ˆA���@���@���@�{�@���@�>�@�u�@���@���@���@���@��@���@�i�@���A�F�A�4�A���A�H�A��@���@���A���A���@���@���@���@���@�?�@���@��@���@�B�A���A�|�A���@���A�.�@���@�{�@���@�A�@���@�	�@�Y�@�k�@��A�^�@�m�@�.�A�x�@�+�@��@���A�*�@���@�D�@��@���A���@�)�@��@�e�@��@�N�@���@���@��@��@�y�A�ψA��A�̑A��@�?�@���@��@���@���A���A���A�W�A���@���@���A��@��@� �@���@���@���A�X�@���A�6�@�:������������������������������	���
���������
��������������������������������������������������������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������u*v*w*x*y*z*{*|*}*~**�*�*�*�*�*�*�*�*�*�*�*�*�����������������*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+++++++++	+
+++
++++++++���������������������������������������������	���
���������
��������������������������������������������������������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������RSTUVWXYZ[\]^_`abcdefghijkluvwxyz{|mnopqrst�}������	

������������������������a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~##�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#��7���8���9���:���;���<���=���>���?��#�#�#�#�#�#�#�#�#�#�#�#�#�#��N���O�	

��Z���[������!�!�!�!�!�!�!�!�!�!�!�!""""�"�!
"`"a"b"���"_"��|���}���~��������������������������������������         	 
   
                  ��ê��Ī��Ū��ƪ��Ǫ��Ȫ��ɪ��ʪ��˪��̪��ͪ��Ϊ��Ϫ��Ъ��Ѫ��Ҫ��Ӫ��Ԫ��ժ��֪��ת��ت��٪��ڪ   ��������������������������������������������������������������������������������������������������������������	

�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!���!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!��T���U���V���W���X���Y���Z���[���\���]���^��***************** *!*"*#*$*%*&*'*(*)***+*��}���~�����#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$$$$$$$$	$
$$$
$$$$$$$$$$$$$$$%$$$ $!$#$$$$"$$$&$������i���������	

��ک��۩��ܩ��ݩ�������������������������������������������������������������������������������������������������������������~�������������������������������������`abc��,���-���.���/�de�f��:���;���<���=���>���?�� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������x���y���z���{���|���}���~�������������������������������������������������������������������������Ũ��ƨ��Ǩ��Ȩ��ɨ��ʨ��˨��̨��ͨ��	

��ڨ��ۨ��ܨ��ݨ��ި��ߨ��������������������������&'()*+,-./0123456789:;<=>?@ABCDEFG��3�3����������SS{{{{��OO))**++88::����������������������{�{����������������iQl�
N�PP�����VV��33HIJ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������§��ç��ħ��ŧ��Ƨ��ǧ��ȧ��ɧ��ʧ��˧��̧��ͧ��Χ��ϧ��Ч��ѧ��ҧ��ӧ��ԧ��է��֧��ק��ا��٧��ڧ��ۧ��ܧ��ݧ��ާ��ߧ�����������������������������������������������������������������������������������������j�kS)T)U)V)W)X)Y)Z)[)\)])^)_)>�}�(�(�(_(^)q(^)�(^)�(_)�(^)�(_)�(_)�(^)�(^))^))^)$)_)+)^)	

�($)��,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?�55BB��PPWWllyyzz����������`���a���llww�������[��t���u���v���w���x���y���z���{��R��$$::""����$$))		KK��������������������������������`)a)b)c)d)e)f)g)h)i)j)k)l)m)n)o)p)q)r)s)t)u)v)w)x)y)z){)|)})~))�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)��m?F~��������������������������������S(T(U(V(W(X(Y(Z([(\(](^(_(`(a(b(c(d(e(f(g(h(i(j(k(l(m(n(o(p(q(r(s(t(u(v(w(x(y(z({(|(}(~((�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�()))))))))	)
)))
))))))))))))))))))) )!)")#)$)%)&)')()))*)+),)-).)/)0)1)2)3)4)5)6)7)8)9):);)<)=)>)?)@)A)B)C)D)E)F)G)H)I)J)K)L)M)N)O)P)Q)R)u/v/w/x/y/z/{/|/}/~//�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/00�������������
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
	
��Ǥ��Ȥ��ɤ��ʤ��ˤ��̤��ͤ��Τ��Ϥ0	0
000
0000000000000000000 0!0$0"0%0#0&0'0(0)0*0+0,0-0.0/0000000=�u.v.w.x.y.z.{.|.}.~..�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�./////////	/
///
/////////////////// /!/"/#/$/%/&/'/(/)/*/+/,/-/.///0/1/2/3/4/5/6/7/8/9/:/;/</=/>/?/@/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/[/\/]/^/_/`/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u-v-w-x-y-z-{-|-}-~--�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-.........	.
...
................... .!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4.5.6.7.8.9.:.;.<.=.>.?.@.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.[.\.].^._.`.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u,v,w,x,y,z,{,|,},~,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,---------	-
---
------------------- -!-"-#-$-%-&-'-(-)-*-+-,---.-/-0-1-2-3-4-5-6-7-8-9-:-;-<-=->-?-@-A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z-[-\-]-^-_-`-a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u+v+w+x+y+z+{+|+}+~++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+,,,,,,,,,	,
,,,
,,,,,,,,,,,,,,,,,,, ,!,",#,$,%,&,',(,),*,+,,,-,.,/,0,1,2,3,4,5,6,7,8,9,:,;,<,=,>,?,@,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,[,\,],^,_,`,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,�����������������������������	���
���������
��������������������������������������������������������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
+.+�(++=+0+++D+1+++�=++*+D+++D+%+++D++!++�(++�+�+D+!++�5+++<++;+&+(++?+<+�+?+D++D+3++++*+�+9+<+�+=+$+�+?++?++;+5++?+6+�(+=++?+@+&+(++;+5++;+5+(+D++=+"++?++?+�,++�!++=+)++�2++++=++D+%+�5+ +<+D++"+D+%+"+D+(+$+�!+'+ +(+=+(+D+)+-+-+&+(+.++&+.+�"+D+(+.+�&+.+�>+=+/++!+(+=+/++=+/++/+=+0++;+&+(+0++�(+0+&+ ++=+0+;+D+1++$+�=+1+#+1+*+/+1+=+&+1+D+!+1+� +1+�$+2++D+(+2+=+(+2+D+2+D+(+2+�=+2+�D+3+++?+3++=+3+&+.+3+=++3+D+ +:+D+4++?+D+4+<+4+<+.+�=+6++6++(+D+6+�(+=+8+�(+8+�=+9++D+<+&+(+=+<+;+=+/+�=+�0+=+>+5+>+D+(++D+@+&+(+@���@���@���@���	@���
@���@���@���
@���@���@���@���@���@���	@���
@���@���@���
@���@���@���@���@���@���	@�����PS%��{�=P_P_P_�S@�s�@��@�-�@���@�'�@�c�@��@���@�*�@��@��@�>��mW_%_%�%=0=0��m�W�W�_������_�����3��W0_0P00�_m_W___=____=_____=_______��_����P�P_�P_�mW_�{m{W{_{{_{��m�W�_��_�m_m�_�%�===P=_�=��P%������m_30_0m0��0�_%_�0_�0����_���_���{�%{____@���@���@���	@���
@���@���@���
@���@���@���@���@���@���	@���
@���@���@���
@���@���@���@���@���@���	@���
@���@���@���
@���@���@���@����0��)��)��)��)��)��)��)��)��)��)��)��)��)��)��).*��).*��).*��).*��).*��).*��).*��).*��).*��).*��).*��).*��).*��).*��);*��)6*�)2*�*��)6*�);*����@���@����@�	��@����@����@�m��@���@�k��@�]��@�A��@���@�k��@�4��@�(��A�ё�@���@����@�*��@�	��@�>��@�
��@�y��A����@�]��@����@����@�|��@�f��@���@���A�nj�@�T��@�m��@���A���A��@�O�@�|�@���@���	

�3k	

	
�)�)�)�)�)�)�)�)�)�)�)�)�)�)�).*�).*�).*�).*�).*�).*�).*�).*�).*�).*�).*�).*�).*�).*�).*�*�)6*�);*�)A*�);*
@��@���@�	�@���@���@�m�@��@�k�@�]�@�A�@��@�k�@�4�@�(�A�ё@��@���@�*�@�	�@�>�@�
�@�y�A���@�]�@���@��@�7�@�s�A�i�@�*�@�p�@���A��@��@���@�c�@�
�@�-�@��@���@���@�;�@���@�f�@��@��A�nj@�T�@��
							
			
	
@��@��@��	@��
@��@��@��
@��@��@��@��@����k��k{03P+++++++++++ +!+"+#+$+%+&+'+(+)+*+++,+-+.+/+0+1+2+3+4+5+6+7+8+9+:+;+<+=+>+?+@+A+B+C+�������������������E+F+G+H+J+K+L+M+N+O+R+S+T+U+W+X+Y+Z+[+\+]+^+_+a+b+d+e+f+g+h+i+j+l+p+q+r+s+I+P+V+t+��.���/���0��)�)�*�)�*�*�)�)�)�*�*�*�*�*�*�)�)�)�)�)�)�)�)�)�)�)�)�)�)�).*/*0*1*2*3*4*5*6*7*8*9*:*;*<*=*>*?*@*A*B*-*�)�)�*�*�*�*�*�*�*�)�*�*�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�*�***	*Q*R*U*^*_*a*k*n*����@��@���@�	�@���@�
�@�-�@��@�2�@�Y�@��@��@�)�@�0�@���E+[+S+N+c+c+`+_+r+^+q+r+o+Q+d+f+m+n+k+q+F+K+O+R+����������������������������������������������������������������������������������������������������+ +!+(+++.+/+0+1+2+5+;+<+=+>+?+
@�t� +6+=>?@ABCDEFGHIJKLMN0���	

1�����@�A�@�D�@�E��3+!+u	
��@�++++++++++++++++++++++ + +!+!+"+"+#+#+$+$+%+%+&+&+&+'+'+(+(+)+*+++,+-+.+.+.+/+/+/+0+0+0+1+1+1+2+2+2+3+4+5+6+7+8+8+9+9+:+:+;+<+=+>+?+@+@+A+B+C+D++++�������� !��:+<+2++++++++++++++++++++++ + +!+!+"+"+#+#+$+$+%+%+&+&+&+'+'+(+(+)+*+++,+-+.+.+.+/+/+/+0+0+0+1+1+1+2+2+2+3+4+5+6+7+8+8+9+9+:+:+;+<+=+>+?+@+@+A+B+C+D++++@+A+B+C+3���+(+@��@�(�@�6�@�?�@�Y�@���@���@���@���@�?�@�e�@�k�@���@���@���@���@���@��@���@���@��@��@�8�@�A�@�\�@�i�@���@���@���@���@���@��@���@��@�
�@��@�'�@�s�@�P�@���@���@��@�"�@�8�@�n�@�q�@���@���@���@���@�r�@�z�@��@���@���@��@��@�P�@�a�@�s�@���@��@�6�@�K�@�/�@�4�@���@���@���@���@���@���@���@��@�(�@� �@�b�@�y�@���@���@���@���@��@��@�4�@�k�@�*�@�6�@�;�@�?�@�G�@�Y�@�[�@���@���@���@���@���@��@��@�(�@�0�@���@���@�v�@�}�@���@���@��@��@��@��@�:�@���@���@�t�@��@���@�s�@���@�6�@�Q�@���@���A��A��A��A�3�A��A���A��A��A��A���A��A��A��A�n�A�r�A�x�A�M�A�k�A�@�A�L�A�c�A�~�A���A�҉A��A�7�A�F�A�U�A�x�A���A�d�A�p�A���A���A�ʎA���A���A���A���A�I�A�ƑA�̑A�ёA�w�A���A��A���A���A��A�Q�A�^�A�b�A�i�A�˗A��A��A��A���A�ۘA�ߘA���A���A���A���A�ؚA�ߚA�%�A�/�A�2�A�<�A�Z�A��A�u�A��A���A���A�ÞA�͞A�ўA���A���A��A��A� �A�;�A�J�A�R�A���A���A�����֯��ׯ��د��ٯ��گ��ۯ��ܯ��ݯ��ޯ��߯����������������������������������������������������������������������������~)*+,���-.�/0���������/����12��3456789:;<����uQ����2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~����@�6�@���@�[�@�Z�@�Y�@���@���@���@��@��@�\�@�i�@��@��@�"�@�#�@�"�@�#�@���@�z�@�Q�@�P�@���@���@�L�@�5�����@���@���@��@�z�@���@��@�5�@�:�@�l�@�+�@�+�@�,�@�[�@���@���@���@��@�:�@�;�@���@���@���@�S�@�R�@�S�@�S�@�R�@���@���@���A��A���A��A���A���A�y�A�y�A�y�A�N�A�d�A���A��A���A�҉A�҉A���A��A���A�f�A���A���A���A���A���A�w�A�x�A��A��A��A��A��A�R�A��A�u�A�ΘA�ޘA�ߘA��A��A�c�A���A�l�A���A�<�A�|�A��A�u�A���A�ĞA���A�J�A�P�A�R�A��A���A���A���A���A���������������������������������������������������������������	
!#%'+-�)/��&���'���(���)���*���+���,���-���.���/�������������������������������������������������������f���g���h���i���j���k���l���m���n���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~����(9BKq�������1:Cl%&'(������������������������������������pqrstuv����wxyz{|}����~�����������������������������ǭ���������ϭ���������׭���������߭����
C]ox������%GL�����B�huz����������������������������������������������������/��������������������������������������������������_�??@��<��((��f!�������u��z{�qqrrssttuuwwxxyyzz{{||~~����������������������������vv}}������������������������������������������|q{*+,-./������������������������������{|�L�����������������������������������������������	

��M���N���O� !"#$%&'()��Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������«��ë��ī��ū��ƫ��ǫ��ȫ��ɫ��ʫ��˫��̫��ͫ��Ϋ��ϫ��Ы��ѫ��ҫ��ӫ��ԫ��ի��֫��׫��ث��٫��ګ��۫��ܫ��ݫ��ޫ��߫������������������������������������������������������������������������������������������������������������
�
�
�
�
�
�
�
�
�
�
�
uuuu�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJGGUUUUUUKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������������������������������������������������������������	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	








	























 
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
 !"#$s
t
u
v
w
x
y
z
{
|
}
~

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�

�
�
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������








	
























 
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
���'	(	)	*	���+	,	-	.	��
����/	0	1	2	3	4	5	6	7	8	9	:	;	<	=	>	?	@	A	B	C	D	E	F	G	H	I	J	��(�K	L	M	N	O	P	Q	R	S	T	U	V	W	X	Y	Z	[	\	]	^	_	`	a	b	c	d	e	f	g	h	i	j	k	l	m	��L�n	��N�o	p	q	r	��S���T���U�s	t	u	v	w	x	y	z	{	��_���`�|	}	~		�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�		

	

	

�	�������������	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�����	�	�	�	�	�	�	�	�	�	�	�	�	�	�����	�	�	�	�	�	�	�	�	�	�	��˧�	��ͧ��Χ��ϧ�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	%&'(�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm6
7
8
9
:
;
<
=
nopqrstuvwxyz{|}~�����������������������������������|}~��������������������������0
1
2
3
4
5
���������������������������������������������������������������������											
			
	���	������������																	 	!	"	#	$	%	&	>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=
 !"#$%&'()*+,-./012��'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?�3456789:;<=��K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_�	

	

����	�
���
������	�
���
�����	�
���
������	�
���
�����%�=�P�k�����������0�_�m����������3�S�{��������%=Pk����0_m����3S{����%=Pk����0_m����3S{����	

	

%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM=>NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������	
��������������������������������������������������������������������������������@ABCCDEFGGHIIJLMNO\]^_`abcdegijklmnooppqrstuuuuuuvvvvvvwxyz{|}~��������������������������������������U�������������TV���������������������������������������������������������������������������������������������������	
����
���� !"#$\=\=K=�=\�=\S��K���������00�mm����������_3k03_���m���%=�kk��_�\]^_����[GG[O����PPk��`����]]]]]]
]
]
	]
]
]]
]

]
]
]�������{{{�{��{�����������0=P_�������{{{�{��{�����������0=P_012NN345]���������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?










))*+,-Z��������jklm������n	
egrrrrrrssssssv��wnnxz|}o]sssnnsaSpqXE{Yi.y��rrrr�������
��e���f���g���h���i����r���s�	

P\U�m	

P\U�����k��{������������������������������������������������������������������������������������������������������ ��à��Ġ��Š��Ơ��Ǡ��Ƞ��ɠ��ʠ��ˠ��̠��͠��Π��Ϡ��������������������������������������������������������EEEEEEEEEEEEEEEEJJJJJJ������JJJJJJ������PPPPPPPPPPPPPPPPRRRRRRRRRRRRRRRRZZZZZZ��F���G�ZZZZZZ��N���O�hhhhhhhh��X�h��Z�h��\�h��^�hmmmmmmmmmmmmmmmmEEJJPPRRZZhhmm��~����EEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPmmmmmmmmmmmmmmmmEEEEE����EEEEEEERPPP��şPPJJPPPRRRR��ԟ��՟RRRRRR��ܟhhhh``hhhhhh`������mmm����mmZZmmm����%%%%%%==PPPPPPPPPPkkkkkkkkkk������������������00000000______mmmmmmmm��������������������33333333SSSSSSSSSS{{{{�����������������������3��
 jkkkkkkkkkkkkkkkk����������������������������SSSSSSSSSSSSSS��������0000����2ATUo��
"9cv������������7WXYq���HV\alak%1Pkv���0_mu����3S�%Pk{����_������3SXm{FGIij��S{FG`ijZ3V�dw��=��x�3���_z4W��#He���%��� `t����.`�!=JP���a���IH4frx�q��!>[vW������Q��k�{=PP��04cmq�����������������������������������������������������������������������������} ~  � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��8���9���:������	

��J���K���L�� � � 	

�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������œ��Ü��Ĝ��Ŝ��Ɯ��ǜ��Ȝ��ɜ��ʜ��˜��̜��͜��Μ��Ϝ�����������������������������������������������������������#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#��L���M���N���O�	

���h��&���������������������}���~���� !"#%&'()*+,-./0123468:;<>579?@ABCDE������������$=	

����������������������������������›��Û��ě��ś��ƛ��Ǜ��ț��ɛ��ʛ��˛��̛��͛��Λ��ϛ��Л��ћ��қ��ӛ��ԛ��՛��֛��כ��؛��ٛ��ڛ��ۛ��ܛ��ݛ��ޛ��ߛ�����������������������������������������������������������������������������������������������������������l!m!n!o!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~!!�!�!�!�!�!�!�!�!��������############ #!#"###$#%#&#'#(#)#*#+#,#-#.#/#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?#@#I#J#K#L#M#N#A#:#`#:#C#D#E###/#/#F#G#H#��_�`#O#Q#R#R#S#T#U#V#W#X#B#P#_#Y#Z#\#]#^#[#��}���~�	

������������������������	

������������������������������������������������������������������������������������������������������������������������š��Ú��Ě��Ś��ƚ��ǚ��Ț��ɚ��ʚ��˚��̚��͚��Κ��Ϛ��К��њ��Қ��Ӛ��Ԛ��՚��֚��ך��ؚ��ٚ��ښ��ۚ��ܚ��ݚ��ޚ��ߚ������������������������������������������������������������������������������������������������������������ � � � � � � � � � � � � � � � � � � � � !!!!!!!!���������!	!
!!!
!!!!!!!��,���-���.���/�!!!!!!!!!��<���=���>���?����A���B���C�rz	

�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"��n���o��"�"�"�"�"��u���v���w���x���y���z���{���|���}���~�����"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�����������������"�"�"�"�"�"#########	#
###
#######��ʙ��˙��̙��͙��Ι��ϙ	

��ۙ��ܙ��ݙ�"#�"##����������������������������������;�de'(<�����	

������������������/$1$4$:$<$?$A$D$E$F$K$M$P$R$W$Y$Z$[$b$e$h$m$q$t$v$x${$�$�$�$�$�$�$�$�$.$2$5$;$=$@$B$G$L$N$Q$S$X$c$f$i$n$�$r$w$|$�$�$�$�$k$3$6$9$C$>$H$}$T$V$O$\$d$g$o$y$�$�$�$�$�$j$s$7$~$u$z$p$��x���y���z���{���|���}���~����'$($)$*$+$,$-$0$8$$I$l$�$�$�$�$�$�$�$�$�$�$�$�$�$�$U$J$]$^$�$�$�$�$_$�$`$a$�$�$�$�$�$���������������������'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'����������������������������������������!!! !!!"!#!$!%!&!'!(!)!��
�*!+!,!-!.!/!0!���������������������������������1!2!3!4!5!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E!����7���8���9���:���;���<���=���>���?�F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!Y!��T���U���V���W���X���Y���Z���[���\���]���^���_�Z![!\!]!^!_!`!a!b!c!d!e!f!��m�g!h!i!��q�j!k!��t���u���v���w���x���y���z���{���|���}���~����c"d"e"f"g"h"i"j"k"l"m"n"o"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~""�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"��g������"��ޗ��ߗ	

������������������	

������������������������*'+','-'.'/'0'1'2'3'4'5'6'7'8'9':';'<'='>'?'@'A'B'C'D'E'F'G'H'I'J'K'L'M'N'O'P'Q'R'S'T'U'V'W'X'Y'Z'['\']'^'_'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'r's't'u'v'w'x'y'z'{'|'}'~''�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'���&�&�&�&�&�&�&�&�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'	
������������(((((((((((((((((((((((( (	(
(
(
(
((((((
(
((((((((((((((((((((((((((((("(#((!($(%(%(%(	((jkl((((((��������������������������������������������������������"&#&$&%&&&'&(&)&*&+&,&-&.&/&0&1&2&3&4&5&6&7&8&9&:&;&<&=&>&?&@&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z&[&\&]&^&_&`&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z&{&|&}&~&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'''''''''	'
'''
''''''''''''''''''' '!'"'#'$'%'&'''(')'%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%{%|%}%~%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%&&&&&&&&&	&
&&&
&&&&&&&&&&&&&&&&&&& &!&	

��������� !"#$)*+,-./023456789;<=>?@ABDEFGHIJKLMNOPQRSTUVWXYZ[`abcdefgmno��[���\���]���^��_�`abcy�	

%&'()*+,-./��}���~����$%&'mnop\]^_hijk !"#$%�������������������������$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%%%%%%%	%
%%%
%%%%%%%%%%%%%%%%%%% %!%"%��������������������������������������������	

 !"#)*+,-./012345678:;<=>?@ACDEFGHIJLMNOPQRST��I�UVWX��N���O�YZ[\]^_��W�`��Y�abcd��^���_�efghijklrstuvwxyz{|}~����������������������������������������������������������������������������������������������������������ƒ��ǒ�����������������ג�����������������������������������)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)*********	*
***
**,*-*.*/*0*1*2*3*4*5*6*7*8*9*:*;*<*=*>*?*@*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*[*\*]*^*_*`*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!""""	"
"""""$"%"&"'"(")"."/"0"1"2"2"6"8":"="B"F"9"H"D"M"N""""""M""	

������""*"+","-">"?"@"A"�!�!" "�!""�!I"O"P""#"J"K"Q"R"S"T"U"�!!"""7"4";"<"�!�!�!�!�!�!�!�!�!�!""""3"C"E"L"V"X"Z"["W"Y""\"	

]"^"5"G"���������������	
!#%'+-�)/��Ɛ��ǐ��Ȑ��ɐ��ʐ��ː��̐��͐��ΐ��ϐ�������������
 "$&*,�(.01234��������������g z hij���������������kflmnopqrst	

	

uvwxy! $ & & f ( * , . ��H�0 2 4 6 6 f 8 : < > > f @ B D F F f H J L N N f P R T V X Z ] _ a c e g ! b Z # \ ��m���n���o���p�m n o r s t u v w x y z { p q | �i j k l ����������������" % ' ' f ) + - / ����1 3 5 7 7 f 9 ; = ? ? f A C E G G f I K M O O f Q S U W Y [ ^ ` b d f h " b Q Y [ ����z{|}~����������͏�������������ُ��ڏ��ۏ��܏��ݏ��ޏ��ߏ��������������������������������������������������������������������������������������������������������������pqrstuvwxyz{|}~��������������������������������������������;���<���=���>���������g	

����\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~������������������������������������������������������������������������������������������������������������������������������������������������Ŏ���ǎ��Ύ��ώ	

��ڎ��ێ������ގ��ߎ������������������������������������������������������������������������������������������������������������������������������
��������������������������������)�������������������:���;���<�����������E������I���N���O���P���Q���R���S���T���U���V���X���Y���Z���[���\���]���^���_�������d���e�	

 !"#$��v���w���x�_������������������	

������������ !"#$%&'()*+,-.����/01234567����8��������9:;<=>?��Ǎ��ȍ��ɍQ��ˍ��̍��͍��΍@ABCDE��ՍF��׍GKLMNOPI������������������������������������������������������HJ���������������������������������������������������01234568��
�:;<���=>?@ABCDEGHJKLMNOPQRSTU��)�VWXYZ[\]^d��4�_`abc��:���;���<�efghijkl��E�opq��I�rstu��N���O���P���Q���R���S���T�vw��W�FI��Z���[���\���]���^���_�79mn��d���e�	

��p���q���r���s���t���u���v���w�\������������xyz{|}~����������������������������������������������������������������������������Ō�����Ɍ������Ό��ό��Ќ��ь��Ҍ��ӌ��Ԍ����׌��،��ٌ��ڌ��ی��܌��݌���ߌ���������	

���]^������������������������������������������������������������������
������������������������������������)����������1�����4��������:���;�����������E���F�����I���J������N���O���P���Q���R���S���T���U�����X���Y���Z���[�����^��������d���e�	

T���r���s���t���u���v���w���x���y���z���{���|���}���~���������������������������������	
������������
�������������������������������������������� !"����������������#$%&'��Ë��ċ��ŋ()*��ɋ+,-.��΋��ϋ���ы��ҋ��Ӌ��ԋ��Ջ��֋/��؋��ً��ڋ��ۋ��܋��݋��ދ��ߋ������������������	

UVWXYZ�[��������������������������CDHI@A��������
����JE������BFNOPQRSTUVWXYZ[\]^_`a��)�bcdefgi��1�jj��4�kK��7�KL��:���;���=�mnopq��C���D���E���F�rs��I���J�tuv��N���O���P�M��R���S���T���U���V���W���X�OPUl��]�c��_���`���a���b���c���d���e�	

G?>h��v���w���x���y���z���{���|���}���~������������xyz{|}~��������������������������������������������������������������������������������Ɗ�����ʊ�����Ί��ϊw��ъ��Ҋ��ӊ��Ԋ��Պ��֊��׊��؊��ي��ڊ��ۊ��܊��݊��ފ��ߊ���������	

�����������������������������������������������������������������������������������������������������������������:���;���������������������O�����V���W���������������	

�����s���t���u���v���w���x��������������������������	��������

���� !"#$%&����(������������*+,-��������./012345��ʼn��Ɖ89��ɉ��ʉ:;<<��ω��Љ��щ��҉��Ӊ��ԉ��Չ��։=��؉��ى��ډ��ۉ��މ%67������	

')��S���������������������������������������������.���/�PQRSTUVWXYZ[\]^��?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ˆ��È��Ĉ��ň��ƈ��Lj��Ȉ��Ɉ��ʈ��ˈ��̈��͈��Έ��ψ��Ј��ш��҈��ӈ��Ԉ��Ո��ֈ��׈��؈��و��ڈ��ۈ��܈��݈��ވ��߈��������������������������������������������������������������������������������������������������������������JKLMNOx�������_`aacbdefhiijklnopqqrssuvwxy`ac��K���L�gmt�������������	
&)*23:;<0����������YZ[MN]^���z}~���������������������{|�������������������������������������������������������������������������������	

�����������������������������������R�:q
��������������������������fhMfh�67NOD������Iw�� �����������������������'(VWX+14=COP��_�	

d89Z�������C�G�P���������������������������������������
 !"#$%,-./95678>�B??@DEFGHIJKQRSLTU\\�BCPP��	

��1A����##mm������ffnn��\\��[[gg������&���'���(���)���*���+���,���-���.���/���0�56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ��W���X�[��p5v���`�56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ9V����H$������������������������������ȅ��Ʌ��ʅ��˅��̅��ͅ��΅��υ\]^_`abcdeffghhiijkllmmnopq���������������aaaeee���������������������������������������������������16>h���%�C������
%:C]ox��������%GLSX`mu{������
%:C]ox��������%GLSX`mu{�����16>h���%�C

hh������������������������L))dd��������		��GGWWSSOO����������������  ..66;;??�KKbb��||22ss�������������%%--������qq������**��\\������k��S=P�_�3{�OOoo��LL��x���y�RedfC�������������������E�JPR����Z����hmREFGIJNPQRTUWXYZ[`����cghijkmRhEJPRhEFGIJNPQRTUWXYZ[`ccghijkmRhZhmTERFQhhhi[TER__MMKK^^nn��������������T`cSQJKppc]]bedfkkkk������������SSSS33����|e����kk����������M�J	P%��BB;<�-[�pp������!5�JX\�{����������a����@DIRmrfx�q����������	!*/OF[v���[�����!59)���,4�P�P�P�33!3J��00�=Aei�����	������

�����������������������0�	

========PPPPkkkkkkkkkk�������������������������0000000000mmmmmmm���������k�k������333388SSSSSSSSSSSS�����������-599���FFX\aa��v{�������$$;Wmx|����������!&>BBFSSv������������3�%)-1P�P�P�000mmm����SSSSSSSSSSvkk����������P�P�P�����mmkk��
n�b�c_��WP4#�\	

GCTUVsV%=Pk����0_m����3S{����^%=Pk����0_m����3S{����X[
o����YQT�W"UKQWR���]	]]	tk=kkkk����Pm�����S�SSSS��k=kkkk����Pm�����R�SSSS���		���Q~���w���(/!]�)*+,-./012=:,-.U�3J`m�����!.[d�����DQZ^j���3J`m�����!.[d�����DQZ^j�0�3��f��7.�RSTUVuvwcRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}��bcdefg	

|hij�klmnopqrst������������������������������������������������������������/1 ���������������������������������������������
�
����������������������������������������������������������$���%���&���'���(���)���*���+���,���-���.���/�]]('����������������89��/7]��S�:=UQ(���������(!,.-��g������l���m���n���o���u�GHHIILLMMOOOOPPRRRRVVWWWWXXXX^^^^ddddeeeeiijjuuvv���������������������������������������������������������������������H�H�I�I�M�M�P�P��������d�^�^�e�e����������^�d�e���u�u�u�u��������������������d�d�^�^�e�e����������^�d�e���u�u�u�u�^�d�e���������^�d�e�^�d�e����PP����@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O�W^�Wd^Wd^Wd�We�W�^W�dW�e^�d^�dd��d���d^�^d�^���d��d��^�������dd�dd����d��d��^���e��e�������d��e��e���d��d�������^��������������������e��e���d����d��d��d��^^�^^�e��e���d��d�d^�d��d��^d�^��e^�e����������^e��^����d��d��^��^��^�������������Re�W^�W^�We�We�W��W��^��^d�^���e��d��d��d��^�����d��^�����������d���d�d��������^d�e��^�����^��^d^d�d^��^����Rd�����^�����e��^�������������������������������������������������������������������������������������������������������������������������������P���P�Ru�d�i����u������������������^�	^�P��u�P�O��������O^OdO�O�O�R^RdReR�R�R�W^WdWeW�W�W�X^X�X�X�^d^�d^d�e^ede��^�d�e���d���^�d�e���d�����^���^���^�d�e�������d�������P�^�d�e���������^�d�e�������^�d�e�������^�d�e�������^�������^�d�e������ju�OuOvO�O�O�O�RuRvR�R�R�R�WuWvW�W�W�W�XuXvX�X�X�X����������P���������������P���u�v����������u�v��������O^OdOeO�O�R^RdReR�R�W^WdWeW�W�X�^d^�d^d�e^e��^�d�e���d�e���^�d�e���d���^���^���^�d�e���d���^�d�e�����^�d�e�����^�d�e���^�d�e�����^����^�d�e����O�O�R�R�W�W�X�X�������������������������������������������d������.�����.����������	���
���������
����������������'���������������:::@145;<=DF(EEEE111234567��7�9:;;<��=�=��?�>?��B�AA��E�BCDEF62;A1<KKSSSSTTTTUUUUZZZZ]]]]YYYY��������````____aaaaccccppooqqkk~~ww������������������������������������������������������������������������������������������������������������������������������������������������������������������G������������OPOPO�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�����@��@���@���@��@���@��@���A�;�A�L�A�M�A���@���@�@�@���A��A��@�Z�A��@�t�A��A��@���@�*�@��@�<�@�^�@�e�@���A�V�@���@���A��A��A�!�A���A�#�A�$�A�8�A���A�'�A�(�A�)�A��A���A�(�A�����.���/�@���@���@�M�@���@���@�Q�@���@��@�h�@�@�@���@�d�@�n�@���@�h�@���@���@�O�@���@���@���@�w�@��@�"�@�n�@�+�@�"�@���@�>�@�I�@�H�@�P�@�V�@�]�@���@���@�@�@���@���@��@�	�@�A�@�r�A��A��A�y�A�y�A�W�A��A���A��A�9�A�ӌA��A���A�8�A��A���A�;���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A�H�@���A�ʎA�Ȍ@���@�2�@���A���A���@�Q�A�ё@���@�H�@���@�i�@���A�?�A���A���A���@��@��@���@���A�=�A�j�A��@���@�u�@��@��A�-�A��@�P�@���A�ͅA�d�@���A�؁A��@���@��@�j�@���A�ΐ@���@���@���@���@���@��@��A��A��A�\�A��A�2�A�o�A���@���@��@���A�ɃA��A��A�֊@���@��@�`�A�~�@�b�@��A�ŒA���@���@�b�@��@���@��@�/�@�7�A�K�@���A���@���@���@��@���A��A�u�A���@���@��A���@�9�@���@��@���@�p�@��@���@���@���@�
�@���@�x�@�"�@���@�^�@��A�I�A���@���A���@���@���A��@���@�e�@���@�i�@���@���@��A�o�A�ҊA�ϑ@���@�B�@�s�@���@���@���@�*�A���A�j�A���A�Ξ@���@���@�w�A�b�@�t�@���@��@���@�#�@�I�@���@��@��A�o�A�&�A��A�#�A�J�@��@���@���@���A�ˆA���@���@���@�{�@���@�>�@�u�@���@���@���@���@��@���@�i�@���A�F�A�4�A���A�H�A��@���@���A���A���@���@���@���@���@�?�@���@��@���@�B�A���A�|�A���@���A�.�@���@�{�@���@�A�@���@�	�@�Y�@�k�@��A�^�@�m�@�.�A�x�@�+�@��@���A�*�@���@�D�@��@���A���@�)�@��@�e�@��@�N�@���@���@��@��@�y�A�ψA��A�̑A��@�?�@���@��@���@���A���A���A�W�A���@���@���A��@��@� �@���@���@���A�X�@���A�6�@�:��"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"#########	#
###
################### #!#"###$#%#&#'#(#)#*#+#,#-#.#/#0#1#2#3#4#5#6#7#8#9#:#;#<#=#����������������������������������������������������������������Ǥ��Ȥ��ɤ��ʤ��ˤ��̤��ͤ��Τ��Ϥ��Ф��Ѥ��Ҥ��Ӥ��Ԥ��դ��֤��פ��ؤ��٤��ڤ��ۤ��ܤ��ݤ��ޤ��ߤ������������������������������������������������������������������������������������������������������������!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"""""""""	"
"""
""""""""""""""""""" "!"""#"$"%"&"'"(")"*"+","-"."/"0"1"2"3"4"5"6"7"8"9":";"<"=">"?"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~""�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � !!!!!!!!!	!
!!!
!!!!!!!!!!!!!!!!!!! !!!"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~!!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�������������������������������������������������������������������������������         	 
   
                     ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������������������������������������	���
���������
��������������������������������������������������������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvRkeRzmRR�nRRzSg�YS�bTV�U^YeUWV�^VrWSyWxceW|yW|�W�pXWXgXvyXzaX|X|YxrX|sezX|}ceYxrYxre�Yz_S|Y|iZ^[zf[o\SYz\�br]y�Y_�b_�ea^d]eze�fjjcekSck_�ekck{zlR^ezlYzl[lzmRxcemSemc]Uzmx�nYazn`nglnzcn�^n]naoS�eozeo�o�eozo�pSY|pSzpckpzYp�]w�qY|�qyqykzsWsWe�sezueuzvR�ycezyxzlzmz{r{�eZ�}ce)@���*@���+@���,@���-@���.@���/@���0@���1@���2@���*)@���**@���*+@���*,@���*-@���*.@���*/@���*0@���*1@���*2@���+)@���+*@���++@���+,@���+-@�����3m33J3��D�`m[m[+m[,�@�s�@��@�-�@���@�'�@�c�@��@���@�*�@��@��@�>��3d3�3[3!3!J[J�J`3.!`3.��d�����[�!��j!�j[�j��j�j�.[.m.!.�[d[�[[[`[![[[+`[+[+![+[[,`[,[,![,[7�[7�+�3!�3[�3��3�3m�3m7��3m7�+��d���[��DdD�D[D!D[D�QdQ�Q[Q!Q[Q!	[	3][]J�```m`7!�`�]mJ�^�3���d!!![!.[.d.��.Z[J[�.[�.���][]��[�����DQJD7[37[*@���+@���,@���-@���.@���/@���0@���1@���2@���*)@���**@���*+@���*,@���*-@���*.@���*/@���*0@���*1@���*2@���+)@���+*@���++@���+,@���+-@���+.@���+/@���+0@���+1@���+2@���,)@���,*@����3.�b��d��e��g��h��i��k��m��n��p��q��r��s��t��b���d���e���g���h���i���k���m���n���p���q���r���s���t���n���m�n���m�t������@�Ή�@��Ή�@�	Ή�@��։�@��Ή�@�mщ�@�Ή�@�kщ�@�]Ή�@�AӉ�@���@�k��@�4��@�(��A�ё��@�׉�@����@�*��@�	��@�>���@�
ԉ�@�y��A�����@�]���@��҉�@��Ή�@�|ԉ�@�fۉ�@���@�ω�A�nj��@�TӉ�@�m���@�ω�A�ꁉ�A����D���E���F���G���H���I���J���K���L���M���N���O���+*+++,+-+.+/+0+1+2,),*,+,,,-,.bdeghikmnpqrstb�d�e�g�h�i�k�m�n�p�q�r�s�t�p�b�n�m���~��
@��@���@�	�@���@���@�m�@��@�k�@�]�@�A�@��@�k�@�4�@�(�A�ё@��@���@�*�@�	�@�>�@�
�@�y�A���@�]�@���@��@�7�@�s�A�i�@�*�@�p�@���A��@��@���@�c�@�
�@�-�@��@���@���@�;�@���@�f�@��@��A�nj@�T�@��,/,0,1,2-)-*-+-,---.-/-0-1-2.)*@��+@��,@��-@��.@��/@��0@��1@��2@��*)@��**@��*+@��������D.mRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������-���.���/���0�bcdefg	

|hij�klmnopqrst����������������������vw $&+/1~57����������������IJ����������������
�
@��@���@�	�@���@�
�@�-�@��@�2�@�Y�@��@��@�)�@�0�@���������������������������������������������������������������������±��ñ��ı��ű��Ʊ��DZ��ȱ��ɱ��ʱ��˱��̱��ͱ��α��ϱ��б��ѱ��ұ��ӱ��Ա��ձ��ֱ��ױ��ر��ٱ��ڱ��۱��ܱ��ݱ��ޱ��߱������������������������������������������������Y]^ehklmnorxyz{|	7f��
]s)�����������
�
��������+����
*+,-./012,	�
�
@�A�@�D�@�E�p^��
�
��@�RRSSTTUUVVWWXXYYZZ[[\\]]^^__``aabbcccddeefghijkkklllmmmnnnooopqrstuuvvwwxyz{|}}~��TWZ��������

wy-RRSSTTUUVVWWXXYYZZ[[\\]]^^__``aabbcccddeefghijkkklllmmmnnnooopqrstuuvvwwxyz{|}}~��TWZ}~�.[e@��@�(�@�6�@�?�@�Y�@���@���@���@���@�?�@�e�@�k�@���@���@���@���@���@��@���@���@��@��@�8�@�A�@�\�@�i�@���@���@���@���@���@��@���@��@�
�@��@�'�@�s�@�P�@���@���@��@�"�@�8�@�n�@�q�@���@���@���@���@�r�@�z�@��@���@���@��@��@�P�@�a�@�s�@���@��@�6�@�K�@�/�@�4�@���@���@���@���@���@���@���@��@�(�@� �@�b�@�y�@���@���@���@���@��@��@�4�@�k�@�*�@�6�@�;�@�?�@�G�@�Y�@�[�@���@���@���@���@���@��@��@�(�@�0�@���@���@�v�@�}�@���@���@��@��@��@��@�:�@���@���@�t�@��@���@�s�@���@�6�@�Q�@���@���A��A��A��A�3�A��A���A��A��A��A���A��A��A��A�n�A�r�A�x�A�M�A�k�A�@�A�L�A�c�A�~�A���A�҉A��A�7�A�F�A�U�A�x�A���A�d�A�p�A���A���A�ʎA���A���A���A���A�I�A�ƑA�̑A�ёA�w�A���A��A���A���A��A�Q�A�^�A�b�A�i�A�˗A��A��A��A���A�ۘA�ߘA���A���A���A���A�ؚA�ߚA�%�A�/�A�2�A�<�A�Z�A��A�u�A��A���A���A�ÞA�͞A�ўA���A���A��A��A� �A�;�A�J�A�R�A���A���A�����֯��ׯ��د��ٯ��گ��ۯ��ܯ��ݯ��ޯ��߯�������������������������������������������������
�
�
�
�
�
�
�
�
�
�
�
���������������������������������������������	���
���������
��������������������������������������������������������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~����@�6�@���@�[�@�Z�@�Y�@���@���@���@��@��@�\�@�i�@��@��@�"�@�#�@�"�@�#�@���@�z�@�Q�@�P�@���@���@�L�@�5�����@���@���@��@�z�@���@��@�5�@�:�@�l�@�+�@�+�@�,�@�[�@���@���@���@��@�:�@�;�@���@���@���@�S�@�R�@�S�@�S�@�R�@���@���@���A��A���A��A���A���A�y�A�y�A�y�A�N�A�d�A���A��A���A�҉A�҉A���A��A���A�f�A���A���A���A���A���A�w�A�x�A��A��A��A��A��A�R�A��A�u�A�ΘA�ޘA�ߘA��A��A�c�A���A�l�A���A�<�A�|�A��A�u�A���A�ĞA���A�J�A�P�A�R�A��A���A���A���A���A��������������������������������������������������




 
!
"
#
$
%
&
'
(
�������������������������������������������������������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������«��ë��ī��ū��ƫ��ǫ��ȫ��ɫ��ʫ��˫��̫��ͫ��Ϋ��ϫ��Ы��ѫ��ҫ��ӫ��ԫ��ի��֫��׫��ث��٫��ګ��۫��ܫ��ݫ��ޫ��߫����������������������������������������������������������������������������������������������������������� 	!	"	#	$	%	&	'	(	)	*	+	KKKK,	-	.	/	0	1	2	3	4	5	6	7	8	9	:	;	<	=	>	?	@	A	B	C	D	E	F	G	H	I	J	K	L	M	N	O	P	Q	R	S	T	U	V	W	X	Y	Z	[	\	]	^	_	`	a	b	c	d	e	f	g	h	i	j	k	l	m	n	o	p	q	r	s	t	u	v	w	x	y	z	{	|	}	~		�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	==------�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	








	


















89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������������������������������������������������������������������������������������������������������������											
			
																	��		)
*
+
,
-
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
	

 !"#$%&'(���|}~���������
����������������������������������(��������������������������������������L����N�������S���T���U����W����������_���`����������������������*+,-./012*)*+,-./012*)*+,-./012*)�������������������������������������������	
��������������§��ç��ħ��ŧ��Ƨ��ǧ��ȧ��ɧ��ʧ��˧��̧��ͧ��Χ��ϧ
 !"#$%&'������������()*+,-./01234567����	

��� !"#$%&'()*/0123456+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_+
,
-
`abcdefghijklm��~����nopqrstuvw)*+,-.xy��������������������������������������������������������z{����������������������������������������������������������������������������������������������������������������������������������¦��æ��Ħ��Ŧ��Ʀ��Ǧ��Ȧ��ɦ��ʦ��˦��̦��ͦ��Φ��Ϧ��Ц��Ѧ��Ҧ��Ӧ��Ԧ��զ��֦��צ��ئ��٦��ڦ��ۦ��ܦ��ݦ��ަ��ߦ���������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������������������������������������������������������������������������������������������������������������������������������������������'���(���)���*���+���,���-���.���/���0���1���2���3���4���5���6���7���8���9���:���;���<���=���>���?��������������K���L���M���N���O���P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_�*+,-./012*)***+*,*-*.*/*0*1*2+)�*��+��,��-��.��/��0��1��2��*)��**��*+��*,��*-��*.��*/��*0��*1��*2��+)�*]+],]-].]/]0]1]2]*)]**]*+]*,]*-]*.]*/]*0]*1]*2]+)]�3��J��`��m�������������������!��.��[��d���������������������D��Q��Z��^��j�3J`m�����!.[d�����DQZ^j3J`m�����!.[d�����DQZ^j)***+*,*-*.*/*0*1*2+)*+,-./012*))�����	

 !"#��$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~����������������������������������������������������������������������������ѣ��ң��ӣ��ԣ��գ��֣��ף��أ��٣��ڣ��ۣ��ܣ��ݣ��ޣ��ߣ����������������������������������������������������������������������������������������������������������� !!"$%&'456789:;<=>?@ABCDEEFFGHIJKKKKKKLLLLLLMNOPQRSTUVWXYZ[\X]^^_`_aabcdefghijklmnopqrstuvw-xxyz{|}~���e,.z{����������������������������������������������������������������������������������������������������������������������������������������������3�`3��`J`�`��`���J���������..�dd�����������[�.[�j�	�j�!3J`�����[�1234���3Z��<����'����mm������L���M���N���O���P���Q���R�*�,+�,*�.+�.,�.-�.*�/.�/*�1,�1.�10�1*��������DDD�D��D����ZZZ�Z��.`m[�������DDD�D��D����ZZZ�Z��.`m[�
�
�
�
����������������������������������������������������������������������������������������������������������������������������������������	

											%%&'()2xyz{�������]]]]]]�	���������������|}�QQ\��������UUUQQU�����<���*���U���V�������X���Y���Z���[���\���]���^�	��d���e���f���g���h���i�)���r���s�-./012(4-��d)*+,-./012(4-������������������������������������������������������������������������ !"#$%&'(������������������������������������������������������������������ ��à��Ġ��Š��Ơ��Ǡ��Ƞ��ɠ��ʠ��ˠ��̠��͠��Π��Ϡ����������������������������������������������������������������������������������������������������������������������������������������������������������F���G���������N���O���X���Z���\���^�																����������		��~������������������������������������																����������������������ş�������������ԟ��՟��������ܟ������			����		��			
����33JJJJJJ``mmmmmmmmmm����������������������������!!!!!!........[[[[[[dddddddd������������������������������DDDDQQQQQQQQQQZZZZ^^jjjjjj�Q^3������������������333333333333333333333333��������������������������������������������^^^^^^^^������������������������7<=Wdq���%:_m������������#$%;HUn�������38JVm�����!.[dl����Q3>B=Jm�����![~�����$7D������D��&��l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ý��ĝ��ŝ��Ɲ��ǝ��ȝ��ɝ��ʝ��˝��̝��͝��Ν��ϝ��Н��ѝ��ҝ��ӝ��ԝ��՝��֝��ם��؝��ٝ��ڝ��۝��ܝ��ݝ��ޝ��ߝ���������������������������������������������������������������������������������������������������������������������������������������������������������������,���-���.���/������������<���=���>���?�
��A���B���C�T[)*+,-./012��������������������������������n���o��������u���v���w���x���y���z���{���|���}���~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������™��Ù��ę��ř��ƙ��Ǚ��ș��ə��ʙ��˙��̙��͙��Ι��ϙ��Й��љ��ҙ��ә��ԙ��ՙ��֙��י��ؙ��ٙ��ڙ��ۙ��ܙ��ݙ��ޙ��ߙ{|}~����������������������������^5cJK#$6d����)*+,-./012������������������������������	
!$&(+0148;<=>����������2"',69?@������-�)7:35A#�.%* ��x���y���z���{���|���}���~�������������/�BDEGHKMNPRTUIS�
CFJLQVWOX��������������������������������������������������������������������������������������������������˜��Ø��Ę��Ř��Ƙ��ǘ��Ș��ɘ��ʘ��˘��̘��͘��Θ��Ϙ��И��ј��Ҙ��Ә��Ԙ��՘��֘��ט��ؘ��٘��ژ��ۘ��ܘ��ݘ��ޘ��ߘ��������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������	
jk��7���8���9���:���;���<���=���>���?�
��T���U���V���W���X���Y���Z���[���\���]���^���_� !"#$%&'()*+��m�,-.��q�/0��t���u���v���w���x���y���z���{���|���}���~����lmnopqrstuvwxyz{|}~���������������������������������������������������noM���ޗ��ߗ)*+,-./012������������������)*+,-./012���������������������������������������������������������������������������������������������������	

 !e*;DEFGHI��w���x���y���z���{���|���}���~����
"#$%&'()*+,-./0123456789:;��������������<<=Y==>>??WX???@ABCCCCCD\EFFFFGGGHHIIJJKLMNNNNNOOOPPPLQRRRSSTTUVZ^_[]`aaaENNOPJSRR>>�������������������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'([)+,-./0123456789:<=>?@ABCJKLMNOPQRSTUVWXYZ\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������������������	

��������������� !"#$%&'()*+,-./0123456789:;<=>?@ABCDE��G�FGHIJKLMNOPQRSTUVWX��[���\���]���^���_���`�EbFGHIZr*+,-./012�
�
�
�
�
�
�
�
�
�
�
��}���~������������������������������������������������������������������������������������������������������������������������������������YZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������������������������������������������������������������������������������������������ !"���#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a��G�b��I�cdef��N���O�ghijklm��W�n��Y�opqr��^���_�stuvwxyz{|}~�������������������������������������������������������������������������������������������������������������������������ƒ��ǒ���������ϒ���������ג��������������������������������������bcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������Z���[���\���]���^�����������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ������������������������123456789:;<=>?@ABCDEFGHIJKLMNQRST��"�UVWXY��(�Z[��+�`abcdef��3���4���5�k��:���;���<���=���>���?�)*+,-./012lmOP\]^_ghij��Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~���������������������������������������������������������������������������������������������������������������������������������������������������������������������Ɛ��ǐ��Ȑ��ɐ��ʐ��ː��̐��͐��ΐ��ϐ�������������������������������	��������q������������������Z[\��	
]L^_`abcdef)*+,-./012*+,-./012)ghi����jkVXZZ�\^`b��H�dfhjj�lnprr�tvxzz�|~����������������V����k���l���m���n���o���p�������������������������������������WY[[�]_ac����egikk�moqss�uwy{{�}����������������W��������lmnopqrstuvwxy��͏��Ώz��Џ��я��ҏ��ӏ��ԏ��Տ��֏��׏��؏��ُ��ڏ��ۏ��܏��ݏ��ޏ��ߏ������������������������������������������������������������������������������������������������������������������������������������������	

��;���<���=���>� !"#$%Y)*+,-./012����\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~��������&'����(��������)*����+��������,������������������������-./0����1234567����89:����;����<��������=>����?@ABCDEFGHIJK����LMN��������OPQRS��Ŏ��ǎTU��Ύ��ώ)*+,-./012��ڎ��ێ>1>8��ގ��ߎ��������������������������������������������������������������������������������������������������������������������UVWXYZ[]��
�_`a���bcdefghijklmnopqrstuvwx��)�yz{|}~�����������:���;���<���=���������D���E������I�������N���O���P���Q���R���S���T���U���V����X���Y���Z���[���\���]���^���_�\^��b���c���d���e�)*+,-./012��p���q���r���s���t���u���v���w���x���y���z���{���|���}���~���������������������������������������������������������������������������������������������������������Ǎ��ȍ��ɍ���ˍ��̍��͍��΍��������Ս���׍�����������������������������������������������������������������������������������������������������������������������������
��������������������������������)�������������4��������:���;���<���=���E�	��I�

��N���O���P���Q���R���S���T���W���X���Y���Z���[���\���]���^���_�����b���c���d���e�)*+,-./012��p���q���r���s���t���u���v���w���x���y���z���{���|���}���~������������������������ !"#$%&'()*+,-./0123����456789:;<C����=>?@A��������BEFGHIJK��ŌLMN��ɌOPQR��Ό��ό��Ќ��ь��Ҍ��ӌ��ԌST��׌��،��ٌ��ڌ��ی��܌��݌D��ߌ������������)*+,-./012�����������������������������������������������������������������]^_`abce��
����gh������ijklmnopqrstuvwxyz{|}~��)���������1�����4��������:���;����������D���E���F�����I���J������N���O���P���Q���R���S���T���U�����X���Y���Z���[�wx��^��df��b���c���d���e�)*+,-./012Q���r���s���t���u���v���w���x���y���z���{���|���}���~������������������������������������������������������������������������������������������������������������������������������������������������������Ë��ċ��ŋ�����ɋ������΋��ϋ��Ћ��ы��ҋ��Ӌ��ԋ��Ջ��֋���؋��ً��ڋ��ۋ��܋��݋��ދ��ߋ���������������������*+,-./012�
�
�
RSTUVWX����������������������������������������
�������������������������������)�	
��1���4�
���7�����:���;���=���C���D���E���F���I���J���N���O���P���Q���R���S���T���U���V���W���X������]���_���`���a���b���c���d���e�)*+,-./012�����u���v���w���x���y���z���{���|���}���~������������ "$����%&'����()*+,-./0123456789:;<=����>?@ABCD����EF����GHIJK��������LMNOPQRSV��ƊWXY��ʊZ[\��Ί��ϊ��ъ��Ҋ��ӊ��Ԋ��Պ��֊��׊��؊��ي��ڊ��ۊ��܊��݊��ފ��ߊ!#TU������)*+,-./012�����������������������������������������������������������Z[\]^_`acefghijklmnopqrstuvwxyz{|}~��������������������:���;��������������������N���O�Y��U���V���W�mnotyz��bd��hi)*+,-./012���q���r���s���t���u���v���w���x���y���z���{���|���}���~��������������������������������������������������������������������������������������������������������������ʼn��Ɖ����ɉ��ʉ�����Ή��ω��Љ��щ��҉��Ӊ��ԉ��Չ��։���؉��ى��ډ��ۉ����މ�����������)*+,-./012��*+,-�
�
P��������������������p`a?@ABCDY����������������������������������������K���L������P���Q���R���S���T���U���V���W���X���Y���Z���[���\���]���^���_���`���a���b���c���d���e���f���g���h���i���j���k���l���m���n���o���p���q���r���s���t���u���v���w���x���y���z���{���|���}���~�����������������	

���������������������������������������������������������������������������‡��Ç��ć��Ň��Ƈ��LJ��ȇ��ɇ��ʇ��ˇ��̇��͇��·��χ��Ї��ч��҇��Ӈ��ԇ��Շ��և��ׇ��؇��ه��ڇ��ۇ��܇��݇��އ��߇����������������������������������������������������������������������������������������������������������������������������	���
����12LM���������������;���������X�� �GHILMOPRVWX^deijuv����������;���<���=���>���?�������������Y���Z���[���\���]���^���_�)*+,-./012�34�Q�KJNGPG�G�G�GYZS[\T]Ufg_`hacklmnopqrswxyz{|}~�������������������������������������b��������������������_���Nt�)*+,-./012���G��DDIInn{{������������������������������������������������������ ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/���0�

 !"#$%&'()*+,-./��W���X�0��S0W���`�

 !"#$%&'()*+,-./+����>"�������������������������������������Ņ��ƅ��Dž��ȅ��Ʌ��ʅ��˅��̅��ͅ��΅��υ123456789:;;<==>>?@AABBCDEF���������������666:::����������������������������������������������RREJZs�����|!},04@R^j|��������9=Ya��������,04@R^j|��������9=Ya��������RREJZs�����|!}II����������������������55UUQQMM��K����������4488<<ffNN����������������--11AA]]iiqqEEuuyy�^^��������mm����τ((VV  $$bbooww||����������%%))ee������������������������������������X���Y���Z���[���\�3���`m�[�DZ��p���q���r���s���v���w���x���y����{���|���}�:�������������������
�g������������	���������������������	���������������������	��	��������������



����#����������������3333����������������������r���ss33����������^^Kz��7���8���9���:���;���<���=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O�>BFX�ivz������������+��?CGO7<`nvh�����������������'@IMVWbw{������N���*2���mjmm{��i�~.�.j��/3������Q^������� !"#$%&'()*+,-./�.�Z�012345678�9:;<=>?@ABCDEFGHI333333````````mmrr����������������������������������!!�.......g.g66dddddd�d~~������������������������QQ^^^jjjjjj�RX\\���eevz~~jQ��������&&;S7nr������������@Iffoo������������mjmjmj...ddd33�����333388����!!����mjmjmj����dd3388��	Q~���w���(/!]�)*+,-./012=:,-.U�3J`m�����!.[d�����DQZ^j���3J`m�����!.[d�����DQZ^j�0�3	R
1��3�/ �J)+,
��g*��*�-*�+,�-V3333338`���������d�����+�^���3333338`���������d�����*�^�^(null)UTF-32 UnicodeUTF-16LE Unicodeutf16le_binutf16le_general_ciUTF-16 Unicode	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� utf16le
d�'��@B����	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¢�â������Ģ����������������������������ª��ЪҪѪԪتӪ������򪰩Ω����������������������������«��éЫҫѫԫثӫ̩�����Щ󫧪��������������������������������©������������������������������������ĩǪǫŪūƪƫĪũ��ƩȪȫɪɫǩʪʫ̪̫˪˫��ɩ��ȩͪͫϪϫΪΫʩ��˩ת׫֪֫��ͩ٪٫۪۫ڪګܪܫݪݫߪ߫ުޫ���૯�ϩ�������������������������������êëժի������������������������������������������������������§çħŧƧǧȧɧʧ˧̧ͧΧ�����������������������������������������������������������������������������������������°ðİŰưǰȰɰʰ˰̰ͰΰϰаѰҰӰ԰հְװذٰڰ۰ܰݰް�����������������߰������������������������������������������������������������������������������������������±ñıűƱDZȱɱʱ˱̱ͱαϱбѱұӱԱձֱױرٱڱ۱ܱݱޱ��߱�������������������������������������������������������������������������������������������������������²òIJŲѲƲDzȲɲʲ˲̲ͲβϲвҲӲԲղֲײزٲڲ۲ܲݲ޲߲�����������������������������������������������������������������������������������������������������������³óijųƳdzȳɳʳ˳̳ͳγϳгѳҳӳԳճֳ׳سٳڳ۳ܳݳ޳߳�����������������������������������������������������������������������������������������������������������´ôĴŴƴǴȴɴʴ˴̴ʹδϴдѴҴӴԴմִ״شٴڴ۴ܴݴ޴ߴ�����������������������������������������������������������������������������������������������������������µõĵŵƵǵȵɵʵ˵̵͵εϵеѵҵӵԵյֵ׵صٵڵ۵ܵݵ޵ߵ�����������������������������������������������������������������������������������������������������������¶öĶŶƶǶȶɶʶ˶̶Ͷζ϶жѶҶӶԶնֶ׶ضٶڶ۶ܶݶ޶߶�����������������������������������������������������������������������������������������������������������·÷ķŷƷǷȷɷʷ˷̷ͷηϷзѷҷӷԷշַ׷�طٷڷ۷ܷݷ޷߷��������������������������������������������������������������������������������������������������������¸øĸŸƸǸȸɸʸ˸̸͸θиѸϸҸӸԸոָ׸ظٸڸ۸ܸݸ޸߸��������������������������������������������������������������������������������������������������������¹ùĹŹƹǹȹɹʹ˹̹͹ιϹйѹҹӹԹչֹ׹عٹڹ۹ܹݹ޹߹�����������������������������������������������������������������������������������������������������������ºúĺźƺǺȺɺʺ˺̺ͺκϺкѺҺӺԺպֺ׺غٺںۺܺݺ޺ߺ�����������������������������������������������������������������������������������������������������������»ûĻŻǻȻɻʻƻ˻̻ͻλϻлѻһӻ׻ջԻֻػٻڻۻܻݻ޻߻�����������������������������������������������������������������������������������������������������������¼üļżƼǼȼɼʼ˼̼ͼμϼмҼѼӼԼռּ׼ؼټڼۼܼݼ޼߼�����������������������������������������������������������������������������������������������������������½ýĽŽƽǽȽɽʽ˽̽ͽνϽнѽҽӽԽսֽ׽ؽٽڽ۽ܽݽ޽߽�����������������������������������������������������������������������������������������������������������¾þľžƾǾȾɾʾ˾̾;ξϾоѾҾӾԾվ־׾ؾپھ۾ܾݾ޾߾�����������������������������������������������������������������������������������������������������������¿ÿĿſƿǿȿɿʿ˿̿ͿοϿпѿҿӿԿտֿ׿ؿٿڿۿܿݿ޿߿��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������£¤¥����¨©ª����­����������³����������¹º��¼��¾�������������������������������������������������������������������������������������������¿��������������������������������������������������ê��������ï����òó����ö÷����û����þ���������������������������������������������������������������������������������������������������������������������������������áĢ��������ħ������īĬĭ��į��ı��ijĴ����ķ��Ĺ����ļ��������������������������������������������������������������������������������������������������������������������������������������������ť��ŧ��ũ����Ŭŭ��ů��������������������ź��������������������������������������������������������������������������������������������������������������������������������������š����������Ƨ��Ʃ��ƫ��ƭƮ����Ʊ��Ƴ��Ƶ��������������ƽ���������������������������������������������������������������������������������������������������������������������������������������������ǧ��������������ǯ��������Ǵǵ��Ǹ������������ǿ���������������������������������������������������������������������������������������������������������������������������Ȣ��������������������ȭ��������Ȳȳ����ȶ����ȹȺ����Ƚ������������������������������������������������������������������������������������������������������������������������������������ɤ��������ɩ����ɬɭ��������������������ɸ��ɺɻɼ����ɾ�������������������������������������������������������������������������������������������������������������������������������������������ʩ������ʭ��ʯ����ʲʳ����ʶ������ʺ�����������������������������������������������������������������������������������������������������������������������������������������ˤ��������˩��˫��������˰����˳����˶����������������˿��������������������������������������������������������������������������������������������������������������������������̢̣����������̩������̴̵̭̮̯̰̱̲̳������̹��̻������̿�������������������������������������������������������������������������������������������������������������������������������ͣ��ͥ������ͩ��������ͮͯͰ����ͳ����������͹��������;Ϳ�������������������������������������������������������������������������������������������������������������������������͡����Υ��ΧΨ��ΣΪ��������ί��αβ����������θ����λμ��ξ�������������������������������������������������������������������������������������������������������������������������������������ϧϨ����������Ϯ��ϰϱ������������ϸ������������Ͽ��������������������������������������������������������������������������������������������������������������������������������ХЦ������Ъ��Ь����аб��������е��и��к��ж��������������������������������������������������������������������������������������������������������������������������������������������ѥ����������ѫ����Ѯ��������������������ѹ��ѻ��ѽѾ��������������������������������������������������������������������������������������������������������������������������ѡ������ҥҦ��������������Ү������Ҳ����������Ҹ����������������������������������������������������������������������������������������������������������������������������������������������Ӧ��������ӫ��ӭ��������������ӵ��ӷӸ������Ӽӽ�����������������������������������������������������������������������������������������������������������������������������ӡ��ԣ������ԧ����ԪԫԬԭ��ԯ԰��������Զ��Ը������Լ��Ծ�������������������������������������������������������������������������������������������������������������������������������գդե������թժ��լ����կ������������ն������պ�����������������������������������������������������������������������������������������������������������������������������������������֣����֦��������֫֬����������������������������������־������������������������������������������������������������������������������������������������������������������������������ף����������������������ׯװ��ײ����׵������������׼��׾��������������������������������������������������������������������������������������������������������������������������������أ������������ت��ج��خد��ر��������صض������غػ����������������������������������������������������������������������������������������������������������������������������������������٥٦٧����٫����ٮ��������������ٶٷٸ����ٻ����ٽپ���������������������������������������������������������������������������������������������������������������������������������ڢ��ڤ��ڦ��ڨک��ګ������������������ڵ���渷����ں��ڼڽھ�������������������������������������������������������������������������������������������������������������������������������ۣ��ۥ��ۧ��۩۪����������������۳����۶����۹ۺۻۼ۽۾���������������������������������������������������������������������������������������������������������������������������������������ܧܨܩ������ܭ��������ܲ����������������ܻܼ��ܾ�����������������������������������������������������������������������������������������������������������������������������ܡݢݣ��������ݨ��ݪ��ݬ������ݰݱݲ����ݵݶݷݸ��������������������������������������������������������������������������������������������������������������������������������������������ޢ����������ިީ����ެޭ������������޴޵������޹��޺������޾����������������������������������������������������������������������������������������������������������������������������ޡ������ߥ����ߨ����߫��߭��������߱������������߹������߽��߿��������������������������������������������������������������������������������������������������������������������������ߡ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������~���������"!�!���������������������	
RSTUVWXYZ[\^_�&2A?J�Rf���'138B@IK�S�g���������
����" $�����0*.(469=;CGE������PL�TXVZ\`^db����l�pjrnh����t�xvy}{�������	
������!%�����+/)57:><DHF������QM�UYW[]a_ec����m�qksoi����u��wz~|NNNNNN#N$N(N+N.N/N0N5N@NANDNGNQNZN\NcNhNiNtNuNyNN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NOOOOOOOOOOO.O1O`O3O5O7O9O;O>O@OBOHOIOKOLOROTOVOXO_OcOjOlOnOqOwOxOyOzO}O~O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OPPPP
PPPPPPPPPPP"P'P.P0P2P3P5P@PAPBPEPFPJPLPNPQPRPSPWPYP_P`PbPcPfPgPjPmPpPqP;P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQQQQQ
QQ�PQQQQQQQ#Q'Q(Q,Q-Q/Q1Q3Q4Q5Q8Q9QBQJQOQSQUQWQXQ_QdQfQ~Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRRRRRRRR"R(R1R2R5R<RERIRURWRXRZR\R_R`RaRfRnRwRxRyR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSS
SSSSSSSSSS%S'S(S)S+S,S-S0S2S5S<S=S>SBSLSKSYS[SaScSeSlSmSrSyS~S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STTT!T'T(T*T/T1T4T5TCTDTGTMTOT^TbTdTfTgTiTkTmTnTtTT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUUUU	UU
UUU*U+U2U5U6U;U<U=UAUGUIUJUMUPUQUXUZU[U^U`UaUdUfUU�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVV
V
VVVVVVV,V0V3V5V7V9V;V<V=V?V@VAVCVDVFVIVKVMVOVTV^V`VaVbVcVfViVmVoVqVrVuV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWWW
WWWWWWW W"W#W$W%W)W*W,W.W/W3W4W=W>W?WEWFWLWMWRWbWeWgWhWkWmWnWoWpWqWsWtWuWwWyWzW{W|W~W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXX	X�WX
XXXX X&X'X-X2X9X?XIXLXMXOXPXUX_XaXdXgXhXxX|XX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYYYA�Y!Y#Y$Y(Y/Y0Y3Y5Y6Y?YCYFYRYSYYY[Y]Y^Y_YaYcYkYmYoYrYuYvYyY{Y|Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZZ
ZZZZZ#Z$Z'Z(Z*Z-Z0ZDZEZGZHZLZPZUZ^ZcZeZgZmZwZzZ{Z~Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[[4[[[[![%[-[8[A[K[L[R[V[^[h[n[o[|[}[~[[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\#\&\)\+\,\.\0\2\5\6\Y\Z\\\b\c\g\h\i\m\p\t\u\z\{\|\}\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]
]]+]#]$]&]']1]4]9]=]?]B]C]F]H]U]Q]Y]J]_]`]a]b]d]j]m]p]y]z]~]]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^
^^^^^^ ^.^(^2^5^>^K^P^I^Q^V^X^[^\^^^h^j^k^l^m^n^p^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^________!_"_#_$_(_+_,_._0_4_6_;_=_?_@_D_E_G_M_P_T_X_[_`_c_d_g_o_r_t_u_x_z_}_~_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_`
`
```````$`-`3`5`@`G`H`I`L`Q`T`V`W`]`a`g`q`~``�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`aa
aaaaaaaaaaaa"a*a+a0a1a5a6a7a9aAaEaFaIa^a`alaraxa{a|aa�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbbbbbb b"b#b'b)b+b9b=bBbCbDbFbLbPbQbRbTbVbZb\bdbmbobsbzb}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bcc
cc
ccccc)c*c-c5c6c9c<cAcBcCcDcFcJcKcNcRcScTcXc[cecfclcmcqctcucxc|c}cc�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c	d
dddddd d"d$d%d)d*d/d0d5d=d?dKdOdQdRdSdTdZd[d\d]d_d`dadcdmdsdtd{d}d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deee	e
eeeeeeeee"e&e)e.e1e:e<e=eCeGeIePeReTe_e`egekeze}e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�efff	f
fffffff!f"f#f$f&f)f*f+f,f.f0f1f3f9f7f@fEfFfJfLfQfNfWfXfYf[f\f`faf�fjfkflf~fsfuffwfxfyf{f�f|f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fgggggg g"g3g>gEgGgHgLgTgUg]gfglgngtgvg{g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�gRhhhhh(h'h,h-h/h0h1h3h;h?hDhEhJhLhUhWhXh[hkhnhohphqhrhuhyhzh{h|h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hi	i
iiiiii1i3i5i8i;iBiEiIiNiWi[icidieifihiiilipiqirizi{ii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjjjj j$j(j0j2j4j7j;j>j?jEjFjIjJjNjPjQjRjUjVj[jdjgjjjqjsj~j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkkkk	kkkkkkk$k(k+k,k/k5k6k;k?kFkJkMkRkVkXk]k`kgkkknkpkuk}k~k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�klll	l
llllll&l'l(l,l.l3l5l6l:l;l?lJlKlMlOlRlTlYl[l\lklmloltlvlxlyl{l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmm
mmmmmm&m'm(mgl.m/m1m9m<m?mWm^m_mamemgmompm|m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnnn"n'n2n6n9n;n<nDnEnHnInKnOnQnRnSnTnWn\n]n^nbncnhnsn{n}n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�noo
oo
ooooo&o)o*o/o0o3o6o;o<o-oOoQoRoSoWoYoZo]o^oaoboholo}o~o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�opppp
pp p#p/p4p7p9p<pCpDpHpIpJpKpTpUp]p^pNpdpeplpnpupvp~p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqqqqqqq q+q-q/q0q1q8qAqEqFqGqJqKqPqRqWqZq\q^q`qhqyq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrr	rrrrrr$r+r/r4r8r9rArBrCrErNrOrPrSrUrVrZr\r^r`rcrhrkrnrorqrwrxr{r|rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rsssss
ssssss"s$s's(s,s1s2s5s:s;s=sCsMsPsRsVsXs]s^s_s`sfsgsiskslsnsosqswsys|s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�stttt
tttt$t&t(t)t*t+t,t-t.t/t0t1t9t@tCtDtFtGtKtMtQtRtWt]tbtftgthtktmtntqtrt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuu u!u$u'u)u*u/u6u9u=u>u?u@uCuGuHuNuPuRuWu^u_uauouquyuzu{u|u}u~u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvvvv
vvvvvvvvvvvv#v%v&v)v-v2v3v5v8v9v:v<vJv@vAvCvDvEvIvKvUvYv_vdvevmvnvovqvtv�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vww
wwwwwwwww"w(w-w.w/w4w5w6w9w=w>wBwEwFwJwMwNwOwRwVwWw\w^w_w`wbwdwgwjwlwpwrwswtwzw}w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx	x
xxxx!x"x#x-x.x0x5x7xCxDxGxHxLxNxRx\x^x`xaxcxdxhxjxnxzx~x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy�x�x�x�x�xyyyyyyy y%y'y)y-y1y4y5y;y=y?yDyEyFyJyKyOyQyTyXy[y\ygyiykyryyy{y|y~y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzz	z
zzzzzz!z'z+z-z/z0z4z5z8z9z:zDzEzGzHzLzUzVzYz\z]z_z`zezgzjzmzuzxz~z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{{#{'{){*{+{-{.{/{0{1{4{={?{@{A{G{N{U{`{d{f{i{j{m{o{r{s{w{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|||||	||||||| |%|&|(|,|1|3|4|6|9|:|F|J|U|Q|R|S|Y|Z|[|\|]|^|a|c|g|i|m|n|p|r|y|||}|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}}	}}}}}}}}#}&}*}-}1}<}=}>}@}A}G}H}M}Q}S}W}Y}Z}\}]}e}g}j}p}x}z}{}}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~�}�}�}�}�}�}�}�}�}�}�}~~~~~~~ ~'~(~,~-~/~3~6~?~D~E~G~N~P~R~X~_~a~b~e~k~n~o~s~x~~~�~�~�~�~�~�~�~�~�~�~�~<;=>?CDGORS[\]acdefmq}~�������������������������������������
�
���������� �$�&�,�.�0�4�5�7�9�:�<�>�@�D�`�d�f�m�q�u���������������������Ȁ̀πҀԀՀ׀؀������������������� �$�'�,�0�5�:�<�E�G�J�L�R�W�`�a�g�h�i�m�o�w���������������������������������ˁÁŁʁ΁ρՁׁہ݁ށ�������������������������!�"�(�2�4�:�C�D�E�F�K�N�O�Q�V�\�`�c�g�m�t�{�}����������������������������������������������������������������ƂЂՂڂ������������������
��T�����!�"�,�-�.�0�3�7�:�<�=�B�C�D�G�M�N�Q�U�V�W�p�x�}������������������������������������������ǃɃσЃуԃ݃S������������
�������/�9�E�G�H�J�M�O�Q�R�V�X�Y�Z�\�`�d�e�g�j�p�s�t�v�x�|�}�����������������������������������„DŽȄ̄τӄ܄������2���������������"�#�$�%�'�*�+�/�3�4�6�?�F�O�P�Q�R�S�V�Y�\�]�^�_�`�a�b�d�k�o�y�z�{�}������������������������������������������������…Džʅ˅΅��؅څ߅������������
���������!�'�)�6�8�:�<�=�@�B�F�R�S�V�W�X�Y�]�`�a�b�c�d�i�l�o�u�v�w�z�������������������������������������������Æņц҆Ն׆چ܆���熈�������������������!�#�(�.�/�1�2�9�:�<�=�>�@�C�E�M�X�]�a�d�e�o�q�r�{�������������������������������������������������������ȇɇʇ·Շևهڇ܇߇���������������	�
�������������(�-�.�0�2�5�:�<�A�C�E�H�I�J�K�N�Q�U�V�X�Z�\�_�`�d�i�q�y�{���������������������������ʈˈ͈̈Έш҈ӈۈވ��������
��������� �&�'�(�0�1�2�5�9�:�>�@�B�E�F�I�O�R�W�Z�[�\�a�b�c�k�n�p�s�u�z�{�|�}���������������������������������ԉՉ։׉؉��������������������� �"�$�&�+�,�/�5�7�=�>�@�C�E�G�I�M�N�S�V�W�X�\�]�a�e�g�u�v�w�y�z�{�~������������������������������������������ÊƊȊɊʊъӊԊՊ׊݊ߊ����������������
�-�0�7�<�B�C�D�E�F�H�R�S�T�Y�M�^�c�m�v�x�y�|�~�����������������������8�9�=�>�E�G�I�K�O�Q�S�T�W�X�[�]�Y�c�d�f�h�i�m�s�u�v�{�~�������������������������ŌƌɌˌό֌Ռٌ݌����������������	����e�i�l�n������������������������������������������ōƍǍȍʍ΍эԍՍ׍ٍ���������������� �!�"�#�&�'�1�3�6�7�8�9�=�@�A�K�M�N�O�T�[�\�]�^�a�b�i�l�m�o�p�q�y�z�{�������������������������������������������ÎĎǎώюԎ܎������������������� �!�#�%�'�(�,�-�.�4�5�6�7�:�@�A�C�G�O�Q�R�S�T�U�X�]�^�e�������������������������Əʏˏ͏ЏҏӏՏ������������������(�)�/�*�,�-�3�4�7�?�C�D�L�[�]�b�f�g�l�p�t�y�������������������������������������������̐��ÐĐŐǐȐՐאِؐܐݐߐ�Ґ�������������
��������� �%�"�#�'�)�.�/�1�4�6�7�9�:�<�=�C�G�H�O�S�W�Y�Z�[�a�d�g�m�t�y�z�{�������������������������������������������������������‘Ñőӑԑבّڑޑ����������������������	�
���������#�$�%�&�(�.�/�0�3�5�6�8�9�:�<�>�@�B�C�F�G�J�M�N�O�Q�X�Y�\�]�`�a�e�g�h�i�n�o�p�u�v�w�x�y�{�|�}������������������������������������������������������’ÒŒƒǒȒ˒̒͒ΒВӒՒגْؒܒݒߒ����������������
��������!�$�%�'�)�*�3�4�6�7�G�H�I�P�Q�R�U�W�X�Z�^�d�e�g�i�j�m�o�p�q�s�t�v�z�}����������������������������������������������������ēœƓǓɓʓ˓͓̓ӓٓܓޓߓ������������������	�
�������.�/�1�2�3�4�;�?�=�C�E�H�J�L�U�Y�\�_�a�c�h�k�m�n�o�q�r�����x�y�~�������������������������������������ƕȕɕ˕Еѕҕӕٕڕݕޕߕ�����"�$�%�&�,�1�3�7�8�9�:�<�=�A�R�T�V�W�X�a�n�t�{�|�~��������������������������������������ʖҖ�]ؖږݖޖߖ������	����!�"�#�(�1�3�A�C�J�N�O�U�W�X�Z�[�c�g�j�n�s�v�w�x�{�}������������������������������������������������ėŗǗɗʗ̗͗ΗЗїԗחؗٗݗޗ�ۗ����������
��
������ �#�&�+�.�/�0�2�3�5�%�>�D�G�J�Q�R�S�V�W�Y�Z�b�c�e�f�j�l���������������������˜ŘȘ̘������������������"�&�'�+�1�2�3�4�5�9�:�;�<�@�A�F�G�H�M�N�T�X�Y�[�\�^�_�`�������������������������Ùəәԙٙڙܙޙ��������������������� �"�#�$�'�-�.�3�5�6�8�G�A�D�J�K�L�N�Q�T�V�]���������������������������ÚƚȚΚКҚ՚֚ךۚܚ�����������������������	���
�������� �&�+�-�3�4�5�7�9�:�=�H�K�L�U�V�W�[�^�a�c�e�f�h�j�k�l�m�n�s�u�w�x�y������������������������������������������������������������ǛțΛЛכ؛ݛߛ���������������������������"�#�&�'�(�)�*�1�5�6�7�=�A�C�D�E�I�J�N�O�P�S�T�V�X�[�]�^�_�c�i�j�\�k�h�n�p�r�u�w�{�������������/�0�2�3�4�:�<�E�=�B�C�G�J�S�T�_�c�b�e�i�j�k�p�v�w�{�|�~�������������������������������������������Ýǝɝʝԝ՝֝םڝޝߝ���������
������������z�{�|�������������������������������������������ƞȞ˞՞ߞ��������������	������������"�&�*�+�/�1�2�4�7�9�:�<�=�?�A�C�D�E�F�G�S�U�V�W�X�Z�]�^�h�i�m�n�o�p�q�s�u�z�}��������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~������̢�ޡ����ߡ���������������������������������������������������¦æĦŦƦǦȦɦʦ˦̦ͦΦϦЦѦҦӦԦզ֦צئ������������������������������������������������������������������ѧҧӧԧէ֧ا٧ڧۧܧݧާߧ������������������ק����¡ơǡȡɡ����šġ���������������͢΢ϢߢТࢺ���ݡ���ܢʢˢ������������������������ݢޢ�����������������������������������������������������������������������������������������������������������������ҡӡԡա֡סء١ڡۡ����̡͡��������������������������������������������������������������������¤äĤŤƤǤȤɤʤˤ̤ͤΤϤФѤҤӤԤդ֤פؤ٤ڤۤܤݤޤߤ����������������������������������������������������������������������������������������������¥åĥťƥǥȥɥʥ˥̥ͥΥϥХѥҥӥԥե֥ץإ٥ڥۥܥݥޥߥ�������������������������������������澰�徼��ɿ��Я�Ф���ֵ����������������ݴ��缧����е�׵����ø�����辫е������������������л������������߸޸����������дед˶������������ļ�������Ϳ��ο������ص����кЩ�ƻŻ�¿��������������ʰ�о�Ķ����������˰��ɲ�ٵ��������������ǻ����������̰�Ļ�������������������Ф�������²�������Ȼ��������������������Ͱ����������������������ӽ�������������������������������������������������ĸ����������������ڼ���������������������������ΰ��������������ż���������������������ź���У��ĺ������϶�Ѣ��������˥�����������Ѫ����������ѯ�������ѱѰ����������������Ѹѷ��Ѻ���������ä��������������������������Ѭ���������ʶ����������߱�����ƺ��������������̼�����ѽ����������������������������������ڽ���ÿ������ѥ�Ŷ�������������Ѯ��ѧ����н������Ͽ�������������������������������������������ɻ�����������Ѱ������������޺�������������������ij�ѭ������������ò������幢ң����ϥ������������������������Ҫ��������ʭ�����ж�ҫ��������ұ�ۼ��������ʲ������Ҷ��ҽ�����������������������Ҥ����ƿҽ����ң���Ҿ����ȴ��¨��Ʊ�������������Ҭ������ѵ���ҷ�����������������������߿��ޱ��������������˵�ڵ������ǽ��������ñ���Ÿ��ҡ�«�������IJ�¸�˻����ʻ����ɵƳ�ȵ�ĥ��ƾ̡�����������������޴��������۵������������������������������������������Ƹ������������������������������麱�����������ɢ������Ⱥ�������Ө������Ӭ����������������������ӣ������Ӱ������¶Ӧ��������Ӹ��ӻ������������ӱ���������Ӽӭ�������������ʵ�����ı��������������̻������������Ų���Ө�����޲�����������������������������������������ų������������������������������������������ͻ���������ϰ޿��Ǹ����������������౤����������Ե�ߺ�����ԫ������Ѷ���ԯ������������������Ե������������������������������Ծ���������������������������������������������������������������������Ź���ɺ����������п��ν������������������������������������������������������������λѿ��Լ����������������������Ʋ���Ͱ���Ƚ��������������������������а�������������������������������ԩ��ԥ��������������ա�������������������������������ʺ����лϻ��ȸ��Ѱ�խ����������̱�����ѻҰ�������������ձ�������ո����լ��������������������ղ���ս�Dz�������������������������������������ű������������һ��������������ڻ������ɸ��س�����գ������������������°����������������ĸ�����¼ҵ������ܵ˺��㱬�Ȳ����ɽ�����Ʃ��������������������ա�ɲ�������ի��ܳ�����������������������ͼ�խ�����Ӱ��ҿ�ճƮ����������������ƶ�����ܼ����Կ�Ȣ�ɶ�������ư�ӻ�բ֡����������ȼ���������������������������֨���ٳ�ֱ�ߴ�ְ����������Ʈ�岶ֻ����������Խ���������ֳֽ��������������������������������������������ź�����������������������������������������������ʸ�֦�����������ҶԻ��������������������ջ��¢����������������������������������־������ʯ���������ָ��ͩ������������������ʹ���������º˸��ð����������έ����dz���ץ����ɳ��צע��ש����׫��׮���į�������������׮���ʵסб����ƶ�ݵ����צʰ������̹�̸��������������������������������������׳������̺�ɦ�������Ʊ�����������������·�������ק�������ž���������������۽����Ƨ����׫�����������ֻ�˻�������������������������������������������׻����޵�׭�����������������������������������������������������׳����÷�����ס�������������ؤ��ע�縪���ٱ���ǭ����׬ذ������Ů��������������԰�ب���״��½�����ض�漹ؼ��إ���������ؿ�հ��򶦰�����������������������������²��ص����������������˷���ŷ��������ְ��������ķ����������������������������Ʒ�����������������ة��������������������������������������������ؿ����������������������ٺ����٧���͸����꽨������ͺ�����������������������������ٵ����ٷٶ������ͳٴٸ��ŵٳ���ٴ����ȭ��������١������þ�������������������¶��ٴ���������ȳ糡����������٢����������ػ��İ��������٧�ú��������������������������μ���������ٹ��Ʊ��������������������ݳ�٫�κ��������汼���ŵǷ��������������������������͹����������������������������������������ȷ���������������������������������������ǣ����ɳ����ͧ���������������ڬڧŮ����������ڳ���������������������ں��ټڰ�ٻ�ھ�ڿ������ʯ�θ������ߵ�������ڵ�����������ɷ����������������������غ����������м����Զ�����»��ۻ��������ܻ�����ڹ�����������������������ƶ��ݻ�ܽ���������������������̪�װ�����DZս����������������������������������������������������ʷ��������Ƕ���˲��������Ű��������û���������������������콤������������ʶȱ���������Ҿ�����Ǻ����������ĭۯ����Į���۰�������˥�������۷۶��������������ɰຼ�ݼ������۫º���̼۽��������ǿ�������ϵ�������������������������̲޻���������ϸ����Ͳ�����������������ǿ˻�������������������������������Ƽ����������ɱ�������������������˳��ʳϺ���˷����ư����Ͷ����˵�������������������������������������������������������ģ���������������������������ܣ�������ū�������������ܽ������ذ����ۢ�����������񳡸��۰�����������������������ɸ����ܿ������������ܷ�ȶ��ݽ�Ǽ�˶�ܶܳ���ڳ���ܵ��ݱ�����������������������������������ܽ��������������������������������������������������������������������߳�������������������̵����������������������������������������������ܥݤ���������ݫ������ݯ��Ͱ�����������緡�ն�����ݷݺݽ�ֶ��������β����������������߻������������к�����������������޽�Ļ���ݣ������������������ݥ�������̳��������������������������������������������������������ʱ�������������������ݾ����������������������������������ݣ�������������������ϲ��̡ޣ�¾������������������������������������������˱�Ͱ����������Ʀ���̱���������ި������������޴����޳���������������������þ����������������ձ�����������޿�����ʽ���������������������������߽�������޺����Ѻľ��½̷����������������ޯ������ެ��������������������иž�����������������Ͼ��������޻������¹���������������������������������������������������������������������������������������������ô�����������߬ĩ������������ߧ߭���������´���߷����������²߻����߼�������깨����ͽ����������������������������������������������������������в�ť��޼Һ���������ߺ����������ٰ����������������������߲�����Ǿ��ƾ�������������������Ⱦ����Ѽ����������������Ͻ����������������������������������ߤ�������������������������������߼���̫����������������������������������������������Ժ����������������������������������Ѹ���������������ƹ����������������������������í��������Ͳ�������������ý������ͳ������������̶������������Ѳ���������������������������������������׶���������������ͱ���������������������������������Ĵ�������������ɢ��������������ɪ����������������Ŵӿ�������������ʵ��ų�ù���ô���貶���������ڦ���ڰ�����ν���æ��������ͷ���������۰��������������������������������������ֱ���������᾿����������ɾ�������������������������������������������������������������������������������������������������������Ť��Ǵ��������Ĺ����������������������������������αױ�����������������ƴ�ȹ���������������ʾ������Ǵ�����⿿������������������������������������������������������ֽ�����������������������������������������⺶�����������պ����ֺε������ܹ��˾��Ź�������������ⷳ����������������������γ������������������������������̾������������������Ҽ�㷷����������������˽�������;��׺��������ض�ϵ���Ҳ�ġ������������������ٶӲ�ƨ������ʲ���������������������ξܰ���������������������������������Բη��ƹ����������ϱ������������ϳ������������������������������㦷��������������������������������������������Ͼ����׽�����������������ó�ȴ������������о�������޳ڿ�������������������ڶ���������������������������������ղ���������ǧ������������ɴ���������������������������ļ����������������������������������ʴ�������������������������������������������������ζ������������������ͽ�������䡴Ѿ������������������������Ҹ�������������ǹ���������������Ϸ�������ȹ����������㽣�Ӽɹ�鵶ʢ������������ٺ��¿��Ҿ��������������з��������ʹ�ͼ���������ů���������������ѷ�¹���������ݰ������˹���Ľ�������彰����۶��������������������������˴��ް���������������������ʼ��������Ľ��̽�������������������������ҷ�������������������������������������������������������������̴��������������������������ӷ��������ȯ�������ͱ�����������������沷����������������������������������������ʹ���������ͷ�͹��Լ���橼����̹�����������������������������������������������������榿�����������������ϩ���Ӿ������δԸ�����������ιϹ����߰������������������ո��������������������Ϯ���ӵ��������������������տ�ɥ���й�����������������Ģʣ��¯��������ѹ�������˨�������˷��������������ǽ������������������������ÿ���������������籱���������罶�������˼��������ܴ��ؽ�ɮ���ҹ����������ǿ���������������������ϴ�����������秿��������������Ǽ������������Ŀֲ��ݷܶ����������������ײ���������������ѱ�����������ز������Է����������������������§������շ����ӹ�����ٲ�������������������д��������������������Ƶݶ��۲Ծ��ں��������ڲָ�������������������������������������������������������������������������������������վ����������������������������������踳���������������������ü��������������������������������־ɼ��������������Ϣ����������������������������������駻ſ�������������������������ƻ��Ȯ��������������������ݢ���������������׸Ե��������������������������������������������������ؼ����ַ³��������������������������������������������������������������������������������������ܲ�����������������������������ͳ���������������������������µ�����������������������������������Թ����ѽ����ұ׾��չ������������������޶��������������������������������Ӹ������ۺ���������������������������ؾ����������������������������������������������������߶���������������������������Ǫ��뫸�����ǭ�г�������ƿ������Ѵ�������ѳ�����������������ľ�׷ֿ����������­�����پ�������������ǿ��ھ������������۾�����ӱ��ط��������͵�Ϻ�ܾ��������ظ��ﻧ������������������������������ݲ��õ����������Ҵ��ۿ�����������������������������������������ڱ���������������������ֹռ������������������������������������ٷ�����ĵ���������������������������������������������������ݾ��빮з���ɹ�����������˾�������������׹��߲����Ӵ�����������쮵�������Ƚ�������������������������쿻�޾������������������ع�������������������������ϼ��ҳ����������������۱��������������������������������ٸ����������������������������������������������������������������������������������������ȿ������������ּ����������������������ڷ��ӳ��ܺ������������������������������������������������������������������ɿ�����������������ë����������������׿޷�������������������ҽ������������������յ�������������������������¤����������ʿ������������������Ϳ���Ს����ƣ�㰨�������������������׼����彭�����α��ȳ�����Դ���������������ټ���������ٹ������������Գ��������������������������������ݿ��������������ڹ������������������߾��������������������Ӻ������Ž�������������˿�������������������ó��������������ڸ��������������������������۹���ƽ���������������������������������Ա��������ݹ������������Ӷ��⼣���������������������è��������������������������������������������������������������⾪Ƽ�����������������մ������������������������������������������﫳��״ִ����������شճ޹��������ܱ����������ǰ����������������������������������������������߹��¸��������ؿ��ٴ�������������Ϋ��������������¡����ֳ������ݺ�������������������α������������۸��������������������������������������������̿��������������������������������������������������������������������׳��ٿ�������������������Ȱ�������ǵ����������������������ڴ����������������ʺĢ���ܿ���������������۷�����ˬ�б���������������۳ܳ��鴲������ܸ�������������������������������������һ������������������±���������������۴�����������������������¶��������������������������ر������������������������������ٽ��������������������������������������ö�����������������������������������������������������������������������������������ݯ��䴵������������������������������ʸ����������˭������������������������������������߷��������������������������������������������������������������������������������������������������������������������򲼩���������������������������������������ܷ�����������������������������������������������������������������������������������������������������������е��������������������������������������������������ݸ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ʡˡ��ܡ��������������������������������䡩�����£ãģţƣǣȣɣʣˣ̣ͣΣϣУѣңӣԣգ֣ףأ٣ڣΡϡ������������������������������������Сáѡ���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~000���0�����0�0�@��>��?��0�0�0�00�N000�0  �\0 \�& %     �	�00;�=�[�]�0	0
000
00000�"����`"��f"g""4"B&@&�2 3 !�������
� ��&&�%�%�%�%�%�%�%�%�%�%�%; 0�!�!�!�!0""�"�"�"�"*")"'"("��!�!"" "�"#""a"R"j"k""=""5"+","+!0 o&m&j&  ! ��%����������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�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�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������������������������������������������������ !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%�NUZ?��Ta(c�Y"�u��Pz�`�c%n�ef������h'W�eqb�[�Y{��b}�}��b�|���[�^	c�fHhǕ��Og�N
OMO�OIP�V7Y�YZ	\�`apafi�pOupu�y�}�}À�c��U�z�;S�N�N�W�����xN�X�n8�2z(���/�AQpS�T�T�V�Y_��m�-�b�p�����T�S�[�p��oS\��zN�x��&nVUk�;��Y�Sfm�t��BV�NK��O���S�U0[q_ f�fh8l�l)m[t�vNz4��[�`�풲m�u�vř�`������i�S�QW0XDY�[�^(`�c�c�lo�pqYq�q?s~v�т��`�[��iX�eZl%u�Q.YeY�_�_�b�e*j'k�k�s�V�,��Ğ�\�l{�QK\�aƁvharYN�OxSi`)nOz�NS�NUO=O�OsO�R�S	VY�Z�[�[�y�f�g�gLk�lkp�s�y�y<z�{��ۂ�w��Ӄf���)V���N�����O�\bYr;u偽�����Ŗ�ՙ�NO��VJX�X�^�_*`�`b`�ab�b9eA�ff�hwmppLu�vu}�����������Q�RY�T�[]ha�i�m�x˄W�r�����lm��ن�W�gΆ��R�VT�^�b�d<h8h�krs�xkz��҉k��퐣���i�f[�\}iM�N��c {+jj�h
�_orR�Up`�b;mn�n[��D�N9��Si:j��*h\Q�z��ܑ��[V(�"h�1��|Rł�t~N�O�Q�[
R�R�R�]�U*X�Y�[�[�[r^y^�`aca�a�cbe�gSh�h>kSkWl"o�oEo�tu�vw�z�{!|�}6���f�����̊����Q�������e�ӗ(��8N+T�\�]�sLv<w�\�����T�X�OOqS�UhV�WGY	[�[�\^~^�_�c:g�e�eg�h�h_j0^�kl}luHyc[z}�_�����w�̎���<��N}PQ�Y�[/b�b�d:k�r�uGy�����p��cʃ��	TT�UThXjp�'xug͞tS�[�P��NEN�NO�S8T�[_%`Qe=gBlrl�lxptvz�z{}�|f}�e[r�SE\�]�b�bc nZ�1�ݍ��o�yZ��N�N�N�O�O�PGQ�zqQ�QTS!SS�S�U�X�\7_J_/`P`m`cYeKj�l�r�r�w����N�����W�Z��N�Q-\�fmi@\�fui�sPh�|�P�RGW�]&��e#k=k4t�y�yK{�}��̃�_�9�яёT��]N6P�S:S�r�s�w悯�ƙșҙwQa^��UzzvP�[G���2N�j�Q\H\�c�z�lt�a��z�q���|hp~Qhl��RT����͎�fS��Ay�O�PRDQSU-W�s�WQYb_�_u`vaga�a�c:dleofBhnfu=z�|L}�}K~k�J�͆�c�f��������Ώ蛇Rb�d�o��Ah�P kzlTotzP}@�#�g�N9P&PeP|Q8RcR�UWX�Z�^�a�a�brci)j}r�r.sxoxy}w������Ҏc�u�z�U��x�CQ�S�S{^&_n�n�s�sC}7����P�NNP�S|T�V�Yd[�]�^'_8bEe�gVn�r�|������N����7�ǖg���N�N
OHSIT>T/Z�_�_�`�h�jZt�x����w���^Nɛ�N|O�OPPIQlQ�R�R�R�S�STT�UQW�W}YT[][�[�]�]�]x^�^�^�^_R`La�b�b�c;efCf�fmg!h�h�i_l*mim/n�n2u�vlx?z�|}}^}�}������T���*�R�L�a������ʐu�q�?x����M����ؚ;�[R�R�ST�X�b�oj�_���KQ;RJT�V@zw�`�ҞDs	op�u�_�`���r��dk��N�VdW�XZZh`�aff9h�h�m�u:}n�B��NPO�SUo]�]�]�g�lstxP���߈PW�^+c�P�P�Qg�T^X�Y�[i_Mb�c=hskn}pǑ�rx&xmy�e0}܃��	���dR(WPgj���QBW*�:X�i���T]�W�x��\OJR�T>d(fg�g�zV{"}/�\h��9{S�Q7R�[�b�d�d-g�k��і�v֛Lc����vRf	N�P�Sq\�`�dce_h�q�s#u�{�~����یx���e�f�k�N�N:OO:R�S�S�U�V�X�Y�Y�YP[M\^+^�_`c/e\[�e�e�e�gbk{klEsIy�y�|}+}���󁖉^�i�f����nj܌̖��ok�N<O�OPQW[�[HacBf!k�n�l>r�t�u�x:y�3�ꁔ���Pl�_X�+��z���[�N�S�W1Y�Z�[�`no�uꌟ[��{rP�g��a\J�~��Q\hcf��enq>y}��ʎn�dž��P�R:\Sg|p5rL�ȑ+���[1_�`;N�S�[Kb1g�k�r�s.zk���R���Q�SjT�[�c9j�}��V�ShT�[1\�]�Oa�b2m�y�yB}M~�����F�r���t�/�1�K�l�Ɩ���NOOEQAS�_b�gAlncs&~͑���SY�[�m]y.~�|~X�q�QS���O�\%f�w�z����Q�_�eoi�k�m�ndo�v}�]u�����QR@b�f�fn�^�}r�f�������R�SsY�^�_U`�d��PQ�R SGS�S�TFU1UVhY�Y<Z�[\\\\�^�^�^p_b�b�b�cwcff-fvf~g�hj5j�l�m	nXn<q&qgq�uw]xyey�y�z{�|9}��փ��I�]���<�T�s�a�ތ��f�~������
NNNWN�QpR�W4X�X"[8^�`�dagVgDm�rsucz��r��� �1V�W���b
i�k�qT~w�r��ߘU���;\8O�O�OU Z�[�[�_Na/c�eKf�h�ixm�m3u�uw^y�y3}は�����:�����2�ݑ��N�NRuX�X\u=\N�
�ŏc�m�%{ϊ�b��V�S�9T�W%^�c4l�paw�|�p�B�T�����^tĚ]i]pe�g��ۖncIgiŃ������ozd�[N,p]u/f�Q6R�R�Y�_'`b?eteftf�hhcknrru�v�|V��X�������ˊ���R�Y��ez���-^�`b�ef�g�wMzM|>~
���d��_��xR�b�cBd�b-��z�{���v}�I��NHQCS`S�[\\�]&bGb�dh4h�lEmm�g\oNq}q�ez�{�}J~�z��9���n�Ό��x�w���������MR�U8o6qhQ�yU~���|LVQX�\�c�f�fZi�r�u�uyVy�y�| }D}�4�;�a� ��PuR�S�S	P�U�XOY=r�[d\S�`�`\c�c?c�c�d�e�f�]�i�io�q�N�u�v�z�|�}�}a�I�X�l�����ňp��m������P�X�aӁ5�� ��OtPGRsSo`Ic_g,n����O^\ʌ�e�}RS��vQ�cX[k[
\
dQg\��NY*YplQ�>UX�Y�`Sb�g5�Ui@�ę(�SOX�[��\/^�_ `Ka4b�f�l�n΀�Ԃ�����.���۞ۛ�N�S'Y,{��L����n'pSSDU�[Xb�b�b�l�o"t�8��o��8��Q���S�SFOT���jY1��]�z���h7��rH�=j��9NXSVfW�b�c�eNk�m[n�p�w�z�{�}=�ƀˆ��[��V�X>_�e�f�j�k7uNJ$P�w0W_e`zf`l�uzn��E����{\u�zQ{Ą��y�z6��Z@w-N�N�[�_�b<f�g�lk�w�;�N��Йj&p*s�W���NFQ�Q�U�[^3^�^_5_k_�_�ac�fgnoRr:u:wt�9�x�v���܊��󍚒w����RWc�vg�l�sÌ��s�%m�Xi�i�����u�ZXh�c�iCO,o�g��&��}T�?ipojW�X,[,}*r
T㑴��NNO\PuPCR��HT$X�[^�^�^�^_�`�b:c�c�h@l�x�yz�}G���D����-�ؑ��lXd�due�n�v{i�ѓ�n�T�_�dM��D�xQkX)YU\�^�m�~u���[��pO�k�o0u��NQT5XWX�Y`\�_�e\g!n{v߃����M�%x:x�R�^WtY`PZQ�Q�QRUTXXXWY�[�\�]�`�b-dqgCh�h�h�v�mon�mop�qS_�uwyI{T{R{�|q}0Rc�i����F�����v�-�0�ؕ�P�RTX\�a�dm�w�z��S����\�?S�_�_�myrcw�y�{�k�r��haj�Q�z4iJ\����[I�pxVo\�`fe�lZ�A��QT�f
�HY���QMN�Q���XpzcK�bi��~wuWS`iߎ�]l�N<\_�Sь��y��^�esNeQ�Y?\�N�Y�_���o�yby�[q�+s�qt^�_{c�d�q�|CN�^KN�W�V�`�o
}��3����������]�b�d��wg�l>m6t4xFZu�����O�^�b�cWeog�vLr̀��)�M�
P�W�Z�hsidq�r���X�j����y�w)�/OeRZS�b�g�l}v�{�|6�����f or~�������Q�{rx�{��H{�ja^��Qu`ukQb��nzv���Op�bO{���zVYX䆼�4O$RJS�S�S^,d�eg>lNlHr�r�sTuA~,�酩��{Ƒiq��=cifju�v�xC��*SQS&T�Y�^|_�`Ibyb�b�e�k�l�u�v�x�y�}w���������^�ۘj8|�P>\�_�g�k5t	w�;��gz9S�u�f_��񃘀<_�_buF{<�gh�Y�Z}~v,��Oj_j7lo�thyh�U�y��^�c�u�yׂ(�򒜄�-��Tl_�e\mp��ӌ;�Oe�t
N�N�W+YfZ�[�Q^�^`vbwe�enfnm6r&{P�����\����t��D��O�dfk�a�j��\Si��z�W�OoR�_E^
g�yy�����m_Ub�l�Nir��R;TtV�X�anbqnY�|�|}�e^�NuOuQ@Xc^s^
_�g&N=���[�s|��P�XVv�x%R�w��{OP	YGr�{�}��ԏM��O�R)Z_���O��WUcik+u܈�Bz�R�XUa
b�f�k?|�#P�OSFT1XIY�[�\�\)]�^�bgc>e�eg�l�l�p2x+~ހ������*�J���Ғ���l�ON�N�PVRJW�Y=^�_�_?b�fg�g�h�Q!}���������~�2� T,�S�P\S�X�d4ggrfwFz��R�l�kXL^TY,g��Q�vid�xT����W�Y'f�g�k�T�iU^���g���gR�]h�N�O�S�b+g�lď�Om~��Nba�n+o�sT*gE��]�{�\�[�Jnфz��Y�|l w�R"Y!q_r�w'�a�iZZ�Q
T}Tf�v������Y]r�nMQ�h�}�}b���xd!j��Y_[�ks�v�}���2Q(gٞ�vbg�R�$\;b~|��OU�`}��S_N�QY:r6�Α%_�w�Sy_}��3���V��g��S�	aa�lRv�8�/UQO*Q�R�S�[}^�`�a�c	g�ggn�m6s7s1uPyՈ��J�����Ė��Y�NYON��?���P|^�Y�[�^�c�c�d�fJi�im�n�q(u�z��I�Ʉ��!�
�e�}�
�~a�b2k�ltm���m�����eg��<���ma}=�j�qNuSP]k�oͅ-���)RTe\Ng�ht�t�uψ�̑�x��_�s�zN��ceu�RAm�n	tYukx�|���z���Ona�e\��N�N�P!N�Q�[�e�h�msBv�wz�|o�Ҋ|�ϑu���R�}+P�S�g�m�q3t�*���W���`tAX�m/}^��N6O�O�Q�R�]`�s<yӂ4�����
���b��ftkR�R�pˆ�^K`�a#oIq>|�}o��#�,�BTo��j�pŒ�2��RAZ�^_g|i�ijmobr�r�{�~�K�ΐmQ���y��2�֊-P�Tq�jkČ��`�g�N�N�k���h�i~n�xU�_NN*N1N6N<N?NBNVNXN�N�Nk��N�
_�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N	OZO0O[O]OWOGOvO�O�O�O{OiOpO�OoO�O�OQ�O�O�O�O�O�O�O�O�O�OP(PP*P%PPO�O!P)P,P�O�OPPCPGPgUPPPHPZPVPlPxP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P	QQQQQQQ!Q:Q7Q<Q;Q?Q@QRQLQTQbQ�ziQjQnQ�Q�Q�V�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QU��Q�Q�Q�Q�QRRRR'R*R.R3R9RORDRKRLR^RTRjRtRiRsRR}R�R�R�RqR�R�R�����R�R�R�R�R�R�R�R�R�R��R�R�R�R�RSS8u
SSSSS#S/S1S3S8S@SFSESNISMS�Q^SiSnSY{SwS�S�S�S�S�S�S�S�S�S|ٖ�S�f�q�S�S�S�ST=T@T,T-T<T.T6T)TTNT�TuT�T_TqTwTpT�T{T�TvT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUU�T�T�T�T�T9U@UcULU.U\UEUVUWU8U3U]U�U�U�T�U�U{U~U�U�U�U|U�U�U�U�U�U�U�U�U�U�U�UV�UV�U�UV�UNVPV�q4V6V2V8VkVdV/VlVjV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW�VW	WWW
WWWW�UW&W7W8WNW;W@WOWiW�W�WaWW�W�W�W�W�W�W�W�W�W�W�W�W
X�W�WXXXrX!XbXKXpX�kRX=XyX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XY
YYY�h%Y,Y-Y2Y8Y>Y�zUYPYNYZYXYbY`YgYlYiYxY�Y�Y^O�O�Y�Y�Y�Y�Y�Y�Y�Y%ZZZZ	ZZ@ZlZIZ5Z6ZbZjZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[2[�Z*[6[>[C[E[@[Q[U[Z[[[e[i[p[s[u[x[�ez[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\
\\ \"\(\8\9\A\F\N\S\P\O\q[l\n\bNv\y\�\�\�\�Y�\�\�\�\�\�\�\�\�\�\�\�\�\�]�\]]]\]]]]]"]]]]L]R]N]K]l]s]v]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^6^7^D^C^@^N^W^T^_^b^d^G^u^v^z^��^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^_	_]_\____)_-_8_A_H_L_N_/_Q_V_W_Y_a_m_s_w_�_�__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�`�_!`````)``1```+`&``:`Z`A`j`w`_`J`F`M`c`C`d`B`l`k`Y`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�_�`�`�`�`Maaa�`�`a�`�`a!a�`�`
aaGa>a(a'aJa?a<a,a4a=aBaDasawaXaYaZakataoaeaqa_a]aSaua�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�ay�a�a�a�a�a�a�a�a�a�abb	b
bbbbb!b*b.b0b2b3bAbNb^bcb[b`bhb|b�b�b~b�b�b�b�b�b�b�b�b�b�b�b�b�d�b�b�b�b�b�b�b�bc�b�b'ccc�b�bPc>cMcdOc�c�c�c�cvc�c�c�c�c�ckcic�c�c�c�c�c�c�c�c�cd4ddd&d6ded(ddgdodvdNd*e�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	��d�d�b�d�d,e�d�d�d�de�deee$e#e+e4e5e7e6e8eKuHeVeUeMeXe^e]erexe�e�e���e�e�e�e�e�e�e�e�e�e�e�e�e�e�erg
ff�esg5f6f4ffOfDfIfAf^f]fdfgfhf_fbfpf�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f?f�f�f�f�f�fggg&g'g8�.g?g6gAg8g7gFg^g`gYgcgdg�gpg�g|gjg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�jhFh)h@hMh2hNh�h+hYhchwhh�h�h�h�h�h�h�h�j�hth�h�h�hi�h~hi�hi�h"i&i�hi�h�h�h�h6iii�h�h%i�h�h�h(i*ii#i!i�hyiwi\ixikiTi~ini9iti=iYi0iai^i]i�iji�i�i�i�i�i�i�i�i�[�i�i�i�i�i.j�i�i�i�i�i�i�ijj�i
k�i�i�ij�ij�ij�i
jj�j#jjDjjrj6jxjGjbjYjfjHj8j"j�j�j�j�j�j�j�j��j�j�j�j�j�j�j�j�j�j�j�j�jk��jkk1�k8k7k�v9k�GkCkIkPkYkTk[k_kakxkykk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k��llll$l#l^lUlbljl�l�l�l�l�l~lhlsl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmM�6m+m=m8mm5m3mmmcm�mdmZmymYm�m�m�o�m�mn
n�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m-nnn.nnrn_n>n#nkn+nvnMnnCn:nNn$n�nn8n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nAooLp�n�n�n?o�n1o�n2o�n>oo�n�ozoxo�o�ooo[o�omo�o|oXo�o�o�ofo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o	pp�oppp�opptoppp0p>p2pQpcp�p�p�p�p�p�p�p�p�p�p�p�p	q�pqqeqUq�qfqbqLqVqlq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q
rrr(r-r,r0r2r;r<r?r@rFrKrXrtr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rPs
ssss4s/s)s%s>sNsOs؞Wsjshspsxsus{szs�s�s�s�s�s�s�s�s�ttot%t�s2t:tUt?t_tYtAt\titptctjtvt~t�t�t�t�t�t�t�s�t�t�t�t�t�t�t�t�t�tuuuuu
uuuu&u,u<uDuMuJuIu[uFuZuiudugukumuxuvu�u�utu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�u�uv
v	vv'v v!v"v$v4v0v;vGvHvFv\vXvavbvhvivjvgvlvpvrvvvxv|v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v/��vwww)w$ww%w&ww7w8wGwZwhwkw[weww~wyw�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx&y x*yEx�xtx�x|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyy,y+y@y`yWy_yZyUySyzyy�y�y�yK��y�y�y�y�y�y�y�y�y�y�yz
zzz zz�y1z;z>z7zCzWzIzazbziz��pzyz}z�z�z�z�z�z�z�z�z�z�z�z�z���z�z�z�z�z�z�z�z�z�z�z�z�z�z{{
{{3{{{{5{({6{P{z{{M{{L{E{u{e{t{g{p{q{l{n{�{�{�{�{�{�{�{�{�{]{�{�{�{�{�{�{�{�{�{||�{�{`||||�{�{|
|�{#|'|*||7|+|=|L|C|T|O|@|P|X|_|d|V|e|l|u|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|;��|�|�|�|�|}}}}
}E}K}.}2}?}5}F}s}V}N}r}h}n}O}c}�}�}[}�}}}�}�}�}�}�}�}�}�}=~�}�}�}�}�}�}�}�}�}�}�}�}�}~
~#~!~~1~~	~~"~F~f~;~5~9~C~7~2~:~g~]~V~^~Y~Z~y~j~i~|~{~�~�}}~��~�~�~�~�~�~�~�~�~�~�~�~8:ELMNPQUTX_`higx�����������������q�����������ܘ�������!�(�?�;�J�F�R�X�Z�_�b�h�s�r�p�v�y�}�����������������Q��ۀ�ـ݀Āڀր	����)�#�/�K���F�>�S�Q���q�n�e�f�t�������������������_�������������������Ɂ́сف؁ȁځ߁�����������
�
���)�+�8�3�@�Y�X�]�Z�_�d�b�h�j�k�.�q�w�x�~���������������߂҂���������ނ�܂	�ق5�4��2�1�@�9�P�E�/�+���������������#�������|���s�u����������΃���؃��������
�"� ���8����m�*�<�Z���w�k���n���i�F�,�o�y�5�ʄb�������ل̈́��ڄЄ��Ƅք��!������,������@�c�X�H�A��K�U�������������m�����ꅇ���w�~���Ʌ��υ��ЅՅ݅�܅��
��������"��0�?�M�UNT�_�g�q�����������������ĆƆ��Ɇ#���Ԇކ��߆ۆ���������	�
���
�4�?�7�;�%�)��`�_�x�L�N�t�W�h�n�Y�S�c�j����������ˇ����Ї֖��ć��LJƇ������
��������҇���"�!�1�6�9�'�;�D�B�R�Y�^�b�k���~���u�}���r�����������������������ÈĈԈ؈و݈����������
��C��%�*�+�A�D�;�6�8�L��`�^�f�d�m�j�o�t�w�~�������������������������������ډ܉݉��������%�6�A�[�R�F�H�|�m�l�b���������������������Ċ͊Šڊ���������ފۊ������� �3���&�+�>�(�A�L�O�N�I�V�[�Z�k�_�l�o�t�}�����������������:�A�?�H�L�N�P�U�b�l�x�z���������������|���b��������������Ȍ����ڌ��������
���
��N��͌��g�m�q�s���������ύڍ֍̍ۍˍ��ߍ���	�������B�5�0�4�J�G�I�L�P�H�Y�d�`�*�c�U�v�r�|�����������������������������Ǝ����ŎȎˎێ������
����������&�3�;�9�E�B�>�L�I�F�N�W�\�b�c�d�������������ڏ������������!�
����'�6�5�9���O�P�Q�R��I�>�V�X�^�h�o�v���r���}���������������������Hbې���2�0�J�V�X�c�e�i�s�r�������������������������ɑˑБ֑ߑ�ۑ����������,���^�W�E�I�d�H���?�K�P���������Z�ϒ��������D�.��"��#�:�5�;�\�`�|�n�V�����������֓ד��ؓÓݓГȓ�������6�+�5�!�:�A�R�D�[�`�b�^�j�)�p�u�w�}�Z�|�~����������������������������������ʕ�oÕ͕̕Օԕ֕ܕ���!�(�.�/�B�L�O�K�w�\�^�]�_�f�r�l���������������������������Ζ˖ɖ͖M�ܖ
�Ֆ�����������$�*�0�9�=�>�D�F�H�B�I�\�`�d�f�h��Rk�q�y���|���z���������������������×Ɨȗ˗ܗ�O���z������8�$�!�7�=�F�O�K�k�o�p�q�t�s���������ĘØƘ���	����!���$� �,�.�=�>�B�I�E�P�K�Q�R�L�U�������������ߙۙݙؙљ�����������+�7�E�B�@�C�>�U�M�[�W�_�b�e�d�i�k�j���������ϚњӚԚޚߚ��������������"�#�%�'�(�)�*�.�/�2�D�C�O�M�N�Q�X�t���������������������ʛ��ƛϛћқ���ԛ�:������	������
��.��%�$�!�0�G�2�F�>�Z�`�g�v�x����	�����*�&���#��D���A�?�>�F�H�]�^�d�Q�P�Y�r�������o�z���������ĝ��������Ɲϝٝӝ���������u�y�}���������������������������a�̞ΞϞОԞܞޞݞ������������������v�!�,�>�J�R�T�c�_�`�a�f�g�l�j�w�r�v�������/X�iY�dt�Q�q���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� ujis0123456789abcdef������������������������������������������������	���������������������������������������

���������������������������������������������������������������������������������������������������������������������������������������������������������`�P��@��0�� 	p	�	
`
�
P��@��0
`�P��@��0�� p�`�P��@��0 !"#$%&'()*123456789:;<=>?@ABCDEFGHIJ9��)y�	i	�		
Y
�
�
I��9��)y�i�	Y��I��ll��\\����L	L�	��	�<
<�
��
�,,||��ll��
\
\mm��

]]����M	M�	��	�=
=�
��
�--}}��mm��


]
]nn��^^����N	N�	�p�>
>�
��
�..~~��nn��
^
^oo��__����O	O�	��	�?
?�
��
�//��o�_p	P	P�	��	�@
@�
��
�00����  pp��
`
`qq��aa��	Q	Q�	��	�A
A�
��
�11����!!qq��
a
arr��bb��	R	R�	��	�B
Bs�c�S�s�c�	S	�	�C��3��	C
�
�
3�ct�d�
c
t�d�	T��D��4�T	�	�	D
�
�
4��$t�d�$t�
d
�U��E��	�	E
�
u�ev�fu�
e
v�f�V��F��6��&v�w�g�W�w�g�	W	�	�G��7��'�	G
�
�
7��'w�gx�hw�
g
x�h�X�����	�	�	8��x�V	�	�	F
�hy��	
h
�
�
��I��9���	�	�&9��6�v�
 !"#$%&'()*ghiklmnopq�789:;<=>?@ABCDEFGHIJ�����������s�t�u�v�w�x�y�z����������������������������������������'(	)
*+,
-./0123456789:WwXxYyZz[{\|]}^~_`�a�b�c�rd�e�f��a�
���
QQv����R
f
A	AWG	�'�
�	�1�
���!!qq��
a�
YQ
Q�I	bb��yR��	�B�	�2
2�
��
�""rr��bb��
Rcc��SS����C	C�	��	�3�
��
��	##ss��cc��
S
Sdd��TT����D	D�	��	�4
4�
��
��
$tt��dd��
T
Tee��U��E��	5
51
�
�%��6��&v�f�Vg�W��G��7��'w�g�Wh�X��H��8��(x�h�Xi�	Y��I��9��)y�i�	Yj�
Z��J��:��*z�j�
Zk�����STU��W��X�	
�H�KL�NOPQR !"#$%&'()*ghijklmnopqrstuwxYZ�������������������������������	
����
A��1��!
2��"r�	b	0�� p�	`	�	
P
�
�
@��0�� 
1��!q�	a	�	
Q
�
0�� p�`�P��@��0�� 1��!q�a�Q��A��1��!2��"r�b�	�
R
R�
��
�BB����22����"
"33����##ss	c	c�	�
S
S�
��
�CC����33����#
#44����$$tt��	d	d�	�
T
T�
��
�D����44����$
$55��%%uu��	e	e�	�
U
U�
��
�EE����55����%
%66����
V
V�
��
�FF����66��'w�	g	�	
W
�
�
G��7��'
8��(x�	h	�	
X
�
�
H��8���'w�g�W��G��7��'8��(x�h�X��H��8���������������������������������������������������x
������������	
 "$&(*,.246!#%')+-/13579;=?ACEGJLNPRTVXZ\8:<>@BDFHIKMOQSUWY[]^`bdfhjlnprtvy{}_acegikmoqsuwz|~�����������������������������������������������������������������������������������������������������������������$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$!�"�#�$�%�&�$x���D`!'���0(Px`��*l��%	z��1Ea!(����
2�*Rz��	+m��&
|���2Fb!)����,T|��
,n��'~��3Gc!*�����.V~��-o��(���4Hd!+����0X���.���)
��5Ie!,���
2Z����
/Y���*���6Jf!-�����4\����8��+���7Kg!.����6^����9[����,`���8Lh!/����:8����:���-b���9Mi!0�=�;:b����;]��.d���:Nj!1���>�<d���<��/f���;Ok!2� ����>f���=_��h���<Pl!3�����@h���>���j���=Qm!4����"��Bj���?���l���
>Rn!5����$�Dl���H��n���?So!6����&�AFn��I�� p���@T7��(� Hp��Jh��!r���AU8��*"Jr��Ki��"t���B9���,���$Lt��(Lj���#v���C:���.&Nv��)Mk��A�B�C�D�E�F�0DXy���tp!G����	1]q���)Qy���"d���1EY{��auq!H����3^r���+S{��#e����2FZ}���bvr!I����
4_s���-U}��$f���3G[��cws!J����5`t��/W��%g��4H\���dxt!K����6au��	1Y���&Pp���5I]��eyu!L���7bv��3[����'Qq���6J^���fzv!M����8cw��
5]����0Rr��7K_���g{w!N����9Pdx��7_����1Ss���8La���h|x!O����Qey��9a����2Tt���9Mc���i}y!P����<Rfz��;c����3Uu��:Ne���j~z!Q����Sg{��=e���4Vv���;Og���k{!R����?Th|��?g���5Ww���<Pi���l�|!S����!@Ui}��Ai���6x���=Qk��	m�}!T����#Vj~��Ck���7y���>Rm���n�~!U����%Wk��Em���@z���?So���
o�!V����'Xl���Go���A{�@Tq���p�W���)Ym���!Iq���B`|��AUs���q�X���+Zn���#Ks���Ca}���BVu���rY���-[o���%Mu��� Db���CWw���sZ���/\p���'Ow���!Ec���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� utf8mb4_nopad_binUTF-8 Unicode	

 !"#$%&'()*+,-./0123456789:;<=>?@ABIDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abidefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !��"#$%&'()				



������������������������������������������������������������������������������������������������ɤ����������������������������́��΁���ҁӺԹ��������ہܺݹ��‚�߱�������������������·����������������������󸽽����������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~����������������������������������������������������������������������������������������������ާ������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������������ߨ���������������������������������������������������������������������������������         (((((                  H����������������������       H�����������������������㥹�������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�   &   ! 0 `9 Zd}y    "   "!a: [e~z���A�����^����{���B�����_�=�>|T���9�����CG��P��Xn�p��b�U���:�
����DH��Q��Yo�q��c�cp1250 	
Unknown LDML tag: '%.*s' &primarycompilednopad[version %.*s][import %.*s][suppress contractions %.*s][optimize %.*s][shift-after-method %.*s][strength %.*s][alternate %.*s][backwards %.*s][normalization %.*s][caseLevel %.*s][caseFirst %.*s][hiraganaQ %.*s][numeric %.*s][variableTop %.*s][match-boundaries %.*s][match-style %.*s] / %.*s[before %.*s]at line %d pos %d: %s<<<<%.*s|%.*s=%.*s|%.*s<<<<%.*s=%.*sxml/versionxml/encodingcharsetscharsets/max-idcharsets/copyrightcharsets/descriptioncharsets/charsetcharsets/charset/primary-idcharsets/charset/binary-idcharsets/charset/namecharsets/charset/familycharsets/charset/descriptioncharsets/charset/aliascharsets/charset/ctypecharsets/charset/ctype/mapcharsets/charset/uppercharsets/charset/upper/mapcharsets/charset/lowercharsets/charset/lower/mapcharsets/charset/unicodecharsets/charset/unicode/mapcharsets/charset/collationcharsets/charset/collation/idu��u����0�u��u��(���u��u�������������x��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��������u����u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u����H���H���H����H����H����u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��H�����������������u��u��u��u��u��u��u��u��u��u��u��u��u��u��������������u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u��u������������u��u��u��u��u��u��u��u��u��u��u��u��u��u�����u��u��u��u��u��u��u��u��u����utf8mb4ucs2utf32utf16utf8mb3latin2charsets/charset/collation/namecharsets/charset/collation/ordercharsets/charset/collation/flagcharsets/charset/collation/mapcharsets/charset/collation/versioncharsets/charset/collation/suppress_contractionscharsets/charset/collation/optimizecharsets/charset/collation/shift-after-methodcharsets/charset/collation/rules/importcharsets/charset/collation/rules/import/sourcecharsets/charset/collation/settingscharsets/charset/collation/settings/strengthcharsets/charset/collation/settings/alternatecharsets/charset/collation/settings/backwardscharsets/charset/collation/settings/normalizationcharsets/charset/collation/settings/caseLevelcharsets/charset/collation/settings/caseFirstcharsets/charset/collation/settings/hiraganaQuaternarycharsets/charset/collation/settings/numericcharsets/charset/collation/settings/variableTopcharsets/charset/collation/settings/match-boundariescharsets/charset/collation/settings/match-stylecharsets/charset/collation/rulescharsets/charset/collation/rules/resetcharsets/charset/collation/rules/pcharsets/charset/collation/rules/scharsets/charset/collation/rules/tcharsets/charset/collation/rules/qcharsets/charset/collation/rules/icharsets/charset/collation/rules/xcharsets/charset/collation/rules/x/extendcharsets/charset/collation/rules/x/pcharsets/charset/collation/rules/x/scharsets/charset/collation/rules/x/tcharsets/charset/collation/rules/x/qcharsets/charset/collation/rules/x/icharsets/charset/collation/rules/x/contextcharsets/charset/collation/rules/pccharsets/charset/collation/rules/sccharsets/charset/collation/rules/tccharsets/charset/collation/rules/qccharsets/charset/collation/rules/iccharsets/charset/collation/rules/reset/beforecharsets/charset/collation/rules/reset/first_non_ignorablecharsets/charset/collation/rules/reset/last_non_ignorablecharsets/charset/collation/rules/reset/first_primary_ignorablecharsets/charset/collation/rules/reset/last_primary_ignorablecharsets/charset/collation/rules/reset/first_secondary_ignorablecharsets/charset/collation/rules/reset/last_secondary_ignorablecharsets/charset/collation/rules/reset/first_tertiary_ignorablecharsets/charset/collation/rules/reset/last_tertiary_ignorablecharsets/charset/collation/rules/reset/first_trailingcharsets/charset/collation/rules/reset/last_trailingcharsets/charset/collation/rules/reset/first_variablecharsets/charset/collation/rules/reset/last_variable E� E� E� E� E�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF� E�pF�pF�pF�pF�pF�pF�pF�pF�pF�pF�E�pF� D�}��7y�ACn����F��?�O8M20�Hw�Z<�s�Ou�?$@Y@@�@��@j�@��.A�cA�חAe��A _�B�vH7B��mB@�0�B�ļ�B4&�kC��7y�AC�؅W4vC�Ngm��C=�`�X�C@��x�DP����KD��M��D���������������ؗ�Ҝ<3���#�I9=��D��2�����[%Co�d(h@�����A�5�����?5�5�?�5�����?�0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
d�'��@B����unknown errorUndefined handler error 125Index is corruptedTable file is corruptedOut of memory in engineUndefined handler error 129Incorrect file formatOld database fileNo record read before updateNo more room in record fileNo more room in index fileToo big rowWrong create optionsCannot add a child rowCannot delete a parent rowNo savepoint with that nameNon unique key block sizeTable is read onlyRead page with wrong checksumIndex corruptedUndo record too bigInvalid InnoDB FTS Doc IDTablespace already existsToo many columnsRow in wrong partitionDisk fullSequence has been run outError during commitCannot select partitionsTransaction was abortedInternal error/check (Not system error)Internal error < 0 (Not system error)Didn't find the key on read or updateDuplicate key on write or updateInternal (unspecified) error in handlerSomeone has changed the row since it was read (even though the table was locked to prevent it)Wrong index given to a functionCommand not supported by the engineRecord was already deleted (or record file crashed)No more records (read after end of file)Unsupported extension used for tableDuplicate unique key on write or updateUnknown character set used in tableConflicting table definitions in sub-tables of MERGE tableTable is crashed and last repair failedTable was marked as crashed and should be repairedLock timed out; Retry transactionLock table is full;  Restart program with a larger lock tableUpdates are not allowed under a read only transactionsLock deadlock; Retry transactionForeign key constraint is incorrectly formedThe table does not exist in the storage engineThe table already existed in the storage engineCould not connect to the storage engineUnexpected null pointer found when using spatial indexThe table changed in the storage engineThere's no partition in the table for the given valueRow-based binary logging of row failedIndex needed in foreign key constraintUpholding foreign key constraints would lead to a duplicate key error in some other tableTable needs to be upgraded before it can be usedFailed to get next auto increment valueFailed to set row auto increment valueUnknown (generic) error from engineRecord was not updated. New values were the same as original valuesIt is not possible to log this statementThe event was corrupt, leading to illegal data being readThe table is of a new format not supported by this versionThe event could not be processed. No other handler error happenedFatal error during initialization of handlerFile too short; Expected more data in fileToo many active concurrent transactionsRecord not matching the given partition setIndex column length exceeds limitTable is being used in foreign key checkRow is not visible by the current transactionOperation was interrupted by end user (probably kill command?)Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You may have retry or dump and restore the table to fix thisToo many words in a FTS phrase or proximity searchTable encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.Foreign key cascade delete/update exceeds max depthTablespace is missing for a tableSequence values are conflictingCannot initialize encryption. Check that all encryption parameters have been set,c��b��b��b��b��b��b��c��b��b��b�Tc��b��b��b��b��b��b��b��b��b��c�,c�Tc��b��b��b��b�Tc��b��b��b��b��b�Tc�Tc��b��b��c��b�Tc��b��b�Tc�dd�|c�|c�|c�|c�|c�|c��c�|c�|c�|c��e�|c�|c�|c�|c�|c�|c�|c�|c�|c��e�,f��e�|c�c�c�|c��e�|c�|c�|c�|c�|c��e��e�|c�|c��c�|c��e�|c�|c��e�'</%s>' unexpected ('</%s>' wanted)'</%s>' unexpected (END-OF-INPUT wanted)%s unexpected (ident or '/' wanted)%s unexpected (ident or string wanted)--><![CDATA[?=/<>!END-OF-INPUTunknown tokenCDATA'=''<''>''/''?''!'IDENT%s unexpected (ident wanted)%s unexpected ('?' wanted)%s unexpected ('>' wanted):��C��C��C��C��C��C��C��C��C��C��C��C��C��1��C��C��C��C��C��C��C��C��C��C��C��C��(����C��
��C��C��C���������C��C��C����C��C��C��C��C��C��C��C��C��҃���ˀ����������������������������������������€�����������������������������������������݀�Ԁ������������
������������������������������������������������ ��)��)��)��)��)��)��)��)��)��)��)��)��)����)��)��)��)��)��)��)��)��)��)��)��)�����������)��)��)������؁�)��)��)��)��)��)��)��)��)��)��)��)��)�����ρ�Ѐ�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�Ā�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�������������܀�܀�܀��������܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�܀�������������������������������������������������������������������������p�g�^�������U�������������������>�y�unexpected END-O















;F��H�PFPX��JkX��P�X�pR�X�HS�X��[�X��\Y�f*Y�t�GY�h��Y�t��Y���Y�ļ	Z��"Z���'Z����Z�H��Z����Z��[�0�y[�X��[���=\����\����\���`]� ��]�H�G^����^��	�^�`S i��Sj�8Fk�xFPk��F�k��F m��F�m�G@n�DG�o�tG�o��Gp��G`p��Gpp��G�p�TH�s��H`t��H v��Hpv��H�v�I�z�HI@{�tI |��IP|��I�~��I��J��LJ����Jp��K���(K���XK����K����K����K���K0��LP��(L���PL��|L0���L���Lp���L��,MИ�TM��hMО��M���M���M���N��,Np��XN����N`���N����N0��O ��4O���\Oа��O���O0���OP��Pp��,P���TP����P���PP���P0��,Q���XQ����Q ���Q����Q���RP��8R���R0���R ���R�S�'��S�*��S�*��S+�0H@+�T,�8T�.�hT/��T00��T�0��T�1�,U 2�XU�2��U�2��U�3��U�3��U@4�V�4�$V�4�LVp5�xV�5��V06��V�6��VP7�W�7�@W9�xW�9��W@:��W�:�X;�X@<�XX�<��X=��X�>��X`?��X@@�<YP@�PY@A��Y�B��Y C�ZPC�<Z�C�\Z�C�|Z�C��ZD��Z�D�[E�[PE�8[�F��[�G��[`H��[�J�4\�M�l\�M��\�N��\�O�$]�O�8]�P�d]�P��]�Q��]�R��]�R��]S�^ S�$^PS�8^@T�h^�T�|^U��^0U��^@U��^PU��^`U��^pU��^�U�_�U�_�U�0_�U�D_�U�X_�U�l_�U��_�U��_V��_V��_ V��_0V��_PV��_`V�`pV� `�V�4`�V�H`�V�\`W�p`W��` W��`0W��`@W��`PW��`�W��`X�a X�0aZ�da \��a0\��a`\��a�\��a�_�b`�8bb�pb`c��b�e��b o��b0o�cPo� cpo�4cq�`c q�tcPq��c0r��cpr��cP���c ��(d0��<d`��Pd���td ���d@���dP���d����dP��$e��Te��he���|e@���e����e���e���(f��Lf���xf0���fP���f���f@��g`��$g`��\g0���g`���g���g���h���(h���Hhм�hh���h���h0���h`���h���i0��0i���Xi���xi0���i ���i���j���Hj@���j���jP���j���k���8k0��`k����k����k����k���l���Dl����l����l@���l`���l����l���m���m���(m��<m��Pm ��dm0��xmp���m����m���mP���m���n��� n ��Xn����n����n����n����n���n����n���o���Lo���`o����o����o���o`��p���(p���<p��lp����pP���p���p��q��$q ��8q0��Lq@��`qP��tq`���qp���q����qP��q`�r��0rP�`rP��r���r���r �sP�s�Ds���sP	��s`	��sp	��s�	��s�	�tP
�0t@�Tt���t���t���t���t��,u�XuP��u���u�!��u&�v�&�v�,�Hv�-�tv�-��vP.��v`2��v�5�,w06�@w@6�TwP6�hw`6�|w�7��w9��w9��w�:�xP<�Hxp>�tx�>��x ?��x0?��x@B��x�H�8yI�`yI�ty I��y0I��y@I��y@K��yPK�z`K�zpK�0z�K�Dz`M�pz�P��z�S��z�V�${@X�P{�X�t{`[��{�[��{@_��{P_��{�_�|�_�D|p`�p|pa��|�a��|b��|�d�}�d�$}�e�8}�g�h}�k��}�k��}�m��}pn�~�r�<~`w��~�w��~`{��~`�$��L���xЃ�� �������@������8���\�Ћ���Ў������܀p�� �А�@���p��������������0�����������<�0��l�0�������Ȃ��������(���X�����������p���� ��(�p��X����x�p����0���`������<� ��P�p��d����x������p��Ѕ����������L����|�`����0��܆����p��<���l�`����������������0���H�P��h�������������ȈP����������(����H� ��h�`������������ȉ���P������(����H���h�0����`�������Ȋ�������P��(����H����h������ ����P��ȋ�����������(� ��H�P��h��������������Ȍ ���0����p��,����d���������؍�����T�@����@��Ȏ`���`��<���x����������$���`�������̐�����8���X�	�x�
���0��0�$�P
�`�@���`�ԒP��p�H�`�������p����0���h�������ܔ�����P�������ĕ�����8���t�� ���"��#� � $�\� %���@&�З0'��P(�D��)����*����+��0-�<�P.�|��/����0����1�4�3�t�@4���`5���6�,��7�l��8���:��@;�$�0<�\�P=���@>�М`?��P@�D�pA���`B����C���D�,��E�h� F����F��� G�Ğ�G���G���P�0�pQ�\��R����S���T�ȟT�ܟ�W� ��X�P�Y�d�@Y����Y����Y�Ƞ�Y�ܠ�Y��Z��0Z��`Z�,��Z�P�@[���p[����[��� \���\���]�@�p^�t��^���p_�Ԣ `���`�D��b�t�`c����c����l��0m���m�4��m�X�n�l��n����n���0o�Ф`o���o��@p�,�q�@�Pq�T�pq�h��q�|��q���r���@r����r�̥�r���r���r���r��s�0�@s�D�`s�X�ps�l��s����s����s��� t����t�Цpu���u��� v���v� ��v�4�w�H��w�\�z��� }�̧�}���P~�,�p~�P��~�d�0�����Ĩp���Ё�$�@��d�`������Щ@���`��(�0��X�@����p������������@���`��<�`��l�������ܫ ���p������(� ��X�P���������P���������� �Щ�P���h�`��|������p����`��̭`������� �`��P����x�0����P��������p������$����8����l�������������������د �������� ��D�P��X���������İ���ذ������� ���p��D�����������@���P���0��<����h���������Ȳ0���p�� �`��P������P�������Գ������4���H�p��x���� �ȴ`�����P	�@��	�h��	����
����Եp�����0���P�0
�|�P
����ܶ�����H�������������`������� �@�H���t�����P���`��p��P!�|��#���%��+��0�D�6���`=����=�غ?��@?���?�8�@�d�@A���pA���PD���G�4��H�`��K����M�ؼP��PP�@� Q�p�T���0T����T��PW��0X�D��Y�t��Z���[�о�]��p^�(��_�`�@a���pb����c�� d��Pd���d�0��d�T� e���`e���pf��h��ph�D��i�p��j���k��k���k�� l�4�pl�X�0n���@n���o����p����p� �q�4�q�H�0r�x�@s���Pt���`u���v�0�Px�`�`x�t�px����y���0{���|�0��}�t�`���P����`��� ��@���l������0����`������(����<���`�����0����0���P�� ����X�`�������� ����`����p����@��(�`��X�p��l������������������$���H�P��t������`�����������$� ��H�`��p�P����P��������0��(����X������P���������@���P��0�`��D����p���������������� ��(�0��<�P��p������0����@������������ �p��D����X���������� ����0����`�� ����\�����0��t������ ����p������ ����@���`�0��������������0�� �0��P�P��d������`���������������$���8� ��L�0��`�@��t�P����`����p������������������������������(����<����P���d���x� ����0����@����P����`����p���������������,����@����T����h����|�������������� ����0����@����P���`���p��0����D����X����l���������������������������������� ���0�� �@��4�P��H�`��\�p��p�����������������������������������������$� ��8�0��L�@��`�P��t�`����p�����������������������������������(����<���P���d� ��x�0����@����P����`����p��������������������,����@����T����h����|��������� ����0����@����P����`���p������0����D����X����l����������������������������� ����0���@�� �P��4�`��H�p��\����p�����������������������������������������$� ��8�0��L�@��`�P��t�`����p���������@��������p������0�@��l����������@����p��������0��@����h����|������@����P��������P������@� ��p�`0����0����1���`2���3�<��4�l��5����5����5���06���@6����6���;�T��;�h��=����>����?��@B�0��B�T��C�h�E����E��� F����F�� G� �`G�@��G�`�0H����H���`I���0J���J�4��J�X��K����K���L���0L���`L���@N��PN� ��N�D��N�t�O���pO���pP��� Q��R���S�H��U�x�V����V���0X� ��X�L��X�`��X�t��X����Y���Z����Z���Z�4��Z�T��[��� \���`\���]����]���]�,�Pb�t� c���Pe���0f���g�8��i�d��j���l���pl����l���m�8�@n�L��p����r����r����s��� t�(��t�`�0v���`v����v����w���w���x�0��}�`� �����������Ѐ��@��<����t������0����0�����,����\�К��� ����p����0��0���`�0���� ����Ь������$�@��8�P��L�`��`����� ����@����@������4���X��������������@�����0�`��D����h������п������� ���@����P��(�p��<����P����d��������������P��(����P����d����� ����P���`�����$����T�@��������� �������������(�0��H�@��\����p���������������`������8����h����|�������������`���� ��(����H�P��p��������������`�����@�P��p�`����p�������0��`�$��T�p	������`�� 
���`
����L���x�`������0�����0�4�T`�xp�������*�0�C�`�C�t�D��pF���F��@G��G�0�G�TR��@S��pS���S���S�pT�8�T�` U���U���U���U��V��`V� X�L�X�|�X���X���X���X��0Y���Y�$�Y�PZ�p@Z���[��@\�� ]� ^�@0_�h@_�|�_��`���`�a�8�a�h�a���b�� d���d��d�8Pe�`f���f���g�	�g�,	`h�T	�h�|	`i��	�k��	l�
0l�$
`l�D
�l�t
@m��
�m��
�m��
n��n�( o�L�o�p@p���p���q���q�r� �r�L�r�`0s�tPs��ps��Pt���t��@u�
�u�(
@x�X
`x�l
�x��
�y��
�z��
`{��{�<0|�\`|�|�|��`���p�����������8@��``��������������(P��P�������������0���������,А�L��l ��������������`���p����� ���4��H0��\p��p���� ���P�����������4���`0������`���К�������p��0`��`��� ���`���p�����4`��h0��� ������ ��p��<���P���h����P���������� ���X@���������0��P��0���T���x�����������������0@��`�������p���������(���`p�������p���������P��<���\����`������� ���������80��xP�������������P��(���X������P������� �� ���P��x����������������, ��@���p`����������@�� ���\ �� p�� ��  �� �� !�4!0�h!P��!`��!���!��4"	�T"0	�h"@
��"p
��"P��"`��"p��"��#��<#0�|#��#���#��$P�0$��D$��X$��x$`��$0��$0��$��%0�8%@�d%���%���%��% �&��0&��D&��X&  ��&� ��&� ��&P!��&@#��&$�'`$�$'�$�8'�*�L'�,�|'`.��'0��'�1�(@3�4( 5�d(�6��(�7��(P9�)p;�4)=�l)�>��)�>��)�>��)�>��)�>��)?�*p?�0*@�D*�B�|*�B��*�B��*@C��*�C�+�C�0+D�T+�D��+�E��+�E��+@F�,�H�H, I�\,J��,K��,�K��, L�-�L�-PM�4-�M�H- N�\-�O��-�Q��-0S��-�T�.�V�T.@X��.Z��.�[��.�]�(/@_�`/@c��/Pc��/pf��/�h�0�m�800n�X0�n�l0Po��0�o��0�q��0ps��0�u�1w�01�x�`1`z��1�{��1P}�2��020��h2Ђ��2����2Є��2@���2���2`��30��$3Љ�P3����3����3���3���4��D4 ��|4���4`���4���(5P��H50��\5���p5���5����5���5P���5����5���06��d6`���6����60��7���87��p7����7P���7����7���8��8p��,8��@8���l8���8����8��9P��89���l9P���9����9���:���@:���T:����:����:����:���;0��(;���\;`���;p���; ���;���4<���H<���\<����<����<p���<��=���8=���l=p���=����=0���=@��>���0>@��D>��|> ���>����>���>`��(?���H?`��t?���?���?p���?����?���@��$@��8@P��L@���`@���t@���@���@P���@����@0���@p���@0��<A��xA���A`��Ap�B �@B��xB���B���B
��B 
��BP
��B �C0�(C��HC��\C��C0��Cp��C���C���C �$D0�8D�LD`��D���D��D���D@�(E��<EP �PE� �|E� ��EP!��E`!��E�"��Ep$��Ep%� F�%�HF�&�xF�&��F�'��F@(��F�(��F�(��F )�G�)�0G@*�DG�+�tG�-��GP/��G1�H�2�<H`4�tH 6��H�7��H�9�I`;�HI�;�\I�;�pI=��I�=��I�?�J@A�4JB�hJD��J`E��J�H��J�H�K�H�KpJ�,K K�@K�L�TK�M��KN��K�N��K�N�L�O�<L�Q�tL�Q��L�R��LPT��L U�M�V�PM�Y��M�[��M@]��M@^� Np^�@N0_�|N`_��N `��Nb�O0b�(O�b�dO�d��O�e��OPg��O0j�,P`l�\P�m��P0p��P t��Px�Q�~�XQ���QP���Q����Q����Q���$R���DRp���R���R���R�S��LS��lS@���S`���S����S0���S0��T`��LT���lTP���T���T@���T��4U��dU0���U����UP���U���V@��LV��|V0���V����V���W ��(W���dWP���W����W���X��0X���`X����X����Xp���Xp�Y��<Y��\Y���YP��Y0�Z��0Z�	�`Z@��Z
��Z`��Z0�([ �d[@�x[���[���[ �\P�$\�`\���\���\`��\ �(]��l]�!��]�#��]�$��]�&�8^�&�L^p'��^p(��^�(��^�(��^�)�4_P*�p_0+��_�.��_�1��_�3�$``5�T`�7��`�8��`p:��`�:�a@;�@a@<�pap<��a�<��a`=��a >�(b?�Tb�B��bpE��b@G��bI�c`K�Dc0L�tc N��c@N��c�N�d�O�0d P�PdPP�pdQ��d�Q��d�R�e`V�De Y�te [��e�\��e@_�f`�Dfb��f b��f�b��f�c�gd� g0d�@g�d�|g�e��g�f��g@j�hm�DhPm�Xh`m�lhpm��h�o��h r�$i�t�|i�v��ipx��i0z�j��Dj���pj����j`���j@���j`���j���k���Hk���hkp���k����k@���k��� l ��HlP��|l���l���l`���l����lp��m���m0��8m���m ���m@���mP���m����m����mP��n0��DnГ�pn@���nP���np���nЕ��nP���n���,o���\o����o`���o���o��� p���@p���`p����p`���p0���p��� q@��4qЪ�Hq0��xq0���q���q����qp��rв�$rp��`r���trP���r0���r���rз��r����r��s��s��<s ��\s@��|s`���s����s���tp��@t���lt���t@���tP��u���4u���Hu���|u����u����u��v`��8v���lv���v����v����v@��w��Dw���xw����w����w���x���4x���`x����x@���x���x���x��y���Hy���typ���y@���y���y���z���@z���tzp���z@���z��{��,{��X{���{���{ ��{@��{��{`��{0�|��D|��X|�l|�
��|�
��|���|��$}��T}���}���}���}0�0~� �p~� ��~� ��~�!��~P#��~�#��~@$��%�(�&�<0(�lP(��P)���*���+���,��0.���/� �`1�\��2��� 3����5�Ѐ�7���9�8��;�l�`<����>���PA���C���E�X��I����L����P��R��S�H�@V���`Y���0]��``� ��c�\� e��� f����h���k�L��o�|�pr���s����v��`|�(����\� ��p�����������`��L�Е���`��ȇ���P��T�P����Ф���P����Ы�������,�0��L����`�Ь�t������`��ԉ0���`��4�0��d� ����@��Ċ@��������8�о�l�������؋�������8�P��p��������Ќ��������p��P����d����x��������̍0���P������T�`�������� ��Ȏ��������,���\��������������p���p��L���|�P"����)�ܐ H��PH�0��I�\�PJ����J����J����J�ؑ�N���P�H��U���PV����_���g���g�$�Ph�D�pi�t�j���m�ȓ m��@m����m� ��m�8��m�P��n�x��o����q���s�$��w�l����p�����ܕ�����������,���@�@��T����h����������p���zRx��#�/D$4(��FJw�?;*3$"\�$�C(p�$�qA�J
B�H�C
HP,�%�DA�C
F���E�F��
F(�0&�sA�C
B�G�F��_,��&��A�C
D��E�G�D�l
D,(�&�_A�C
H����G�4
I$X$(�=A�E
A�]
DP�<(� A�C
A�V(�<(�QF�C
B�E�D�rJ�����p(��l(�zPLRx�
#� $���&�NQ�N
F(8$(�QA�C
M�����p
G$dX+�~A�[
C��y
H,��+��A�C
B�E�E�E�D��
F�@-�BA�C
}�p-�A�M
H,�p-�
A�C
B�H�W
Kb
N(,P1��Q�C
E�t
CD�A�(X�1��A�_
B�I�B
C\�x2�#8��2��A�C
K�����
GA
GV
J(��4��A�J
C��l
Fj,|5�4Q�Q
I���_
Fx
H40�6��A�C
I�����s
H
C0x9��wLA�C
M�����j
E,zPLRx�e#�������4`
�)L$�h;�=A�C
A�_
DT,�;��A�J
B�J�L��D�i
H(<@<�A�C
C���
DOh=�(| =��A�K
E�]
BA��=�RA�J
]
H��=�KF�e
_ �$>�A�C
H��
B$ @�=A�C
A�[
HP(48@�TA�C
B�D�b
D_,`l@�6A�C
B�J��q
Ge
C�|A��A�H
A�(�0D�kA�C
B�J��u
K4�tF�yA�C
D��E�E�H��
BE
K$�I��A�C
J���
B8tK�(L�K��R�J
A�C
Hk��x4Q�8(�`Q��A�T
D��D�S
H0�4S��J�M
C��JD���P��� ��S�"A�H
A��
G(�T�sA�C
C��]
DF,<U�A�C
I���r
AT
D,l�U��A�C
H����K��
F��Z�3]�E
HF�,��Z��A�C
D��E�E�D��
D(� ^��A�H
F���D��
E$	�_��A�J
W
NO
Q @	\`�A�H
A�h
F$d	Ha�1A�M
C��x
G(�	`c�A�C
G��w
FR
F(�	Td�A�C
G��w
FR
F(�	He�A�C
G��w
FR
F$
<f�4A�C
A�Z
AO(8
Tf��A�C
D��D�q
K0t�f�Y�FA�C
H��E�E�H�2
A��tF,�
h�oA�J
I���K
A�
K,�
Li��A�C
H����S�G
J(�o�rA�C
H����D�a,<Pr�A�C
H����I�~
E$l@s�CA�O
I���w
H,�hy��A�E
M������
E$��|��A�C
E����
D,��}��A�C
M�����5
A4,
����DA�H
I������
A�.p��@�D(l���A�E
M������,�t���A�C
F���M���
G,�4���A�C
F���M���
G0���$NDA�C
P������
B�v�$1D D
8��
A�C
N����,h
4���A�C
P�����K
A�
���(�
��,A�C
E�b$�
0��A�i
B�H��$�
(���A�C
B�H�K��,����A�C
I�����
B L`��1F�C
A�X�A�0p|��A�C
D��H����
BR,�h���A�C
B�I�T
EI
G8�����O�C
B�I�U
FnJ���H���(\���A�C
B�G��E�H�i(<���XA�C
B�D�o
GWh���Y|@���$����_A�C
B�E�D�O(���YA�C
B�D�j
D` �8��@Q�J
B�E�]$T��aA�C
B�D�~
H(0���}A�C
B�I�D�A
D(\���`A�C
B�I�D�|
A�$��_(�p��sA�C
B�I�D�q
D(�����A�C
B�E�G��L�s,�8���A�F
C��O
GQ
O4$���A�C
B�E�H�I�D��
BP(\����A�C
D��D�v
F(����A�C
A�l
Gl
D,�h��vA�C
G����`
EE����O@����#K�C
F���E�D��D������H������$<���UA�C
B�H���F$d��UA�C
B�H���F(�P���A�C
B�N����V
F$���bA�C
B�G�O
A<�\���Y�G
E����G����H����KA���� ���
T4����F�C
B�E�rF���H���IA���A���E���F���H�����T�L
B�H�E�E�D�p
Hh������H������ ����GA�K
C��w ���%A�C
B�H�V ��-A�J
A�`@��A�C
M `��,A�H
C��_ �(��,A�H
C��_8�4���k�C
B�E�E�E�D�p
ESE����������! ����4A�C
C��l4��SA�C
F���E�D��
Dm
K$zRx�������,J��
(����A�G
M������
K �����G�]
}
Gi4�\��|A�C
D��F�E�H�~
G
J4����A�G
B�G��E�H��
G�P,��(t8���;A�F
B�D��
K$zPLRx�q�"����,��$�:4����"A�C
E����
CN
BH
H���(����A�C
F���J��U
G$H��QW�H
B�D�cH���8pL���A�C
B�E�E�D�e
GX
Hp���������K��������A�J
D���#,���A�C
C��O
JL
DL���`L��?tx�����������|���x���t���p��l��h��(d��<`��P\��dX��xT���P���L���H���D���P���L��
H��D��,@��@<��XT���h���|����|���x�� �t���A�C
}
G��� ���A�C
B�D�S0���A�C
G����
D]
C0H���A�C
G�����
H]
K|����|��#$����VA�J
E�a
G]$����A�C
E����$�x��fA�C
G����Z4����A�C
B�E�E�F���
GU
K(T���UA�C
B�E�G��
H(���9A�C
M�����_
H,����	A�C
L����D��
H� ���(�(4��A�G
A�
HoD�
�X�
�($l�
��q�H
A�XF���x�?a�C
M(����A�C
I������
E(�L&��A�E
B�L��I�D���&� �&�% 4'�6A�C
E�y
F X$(�yQ�E
E�J
K(|�(� A�C
O����k
B�t.� �p.�aA�C
c
Ip$��.��A�E
I���z,$/��J�C
C��_
AD�B�A�8�1�L�1��`2��,t�2�TA�C
B�I�L���G
F ��5�1A�C
B�G�c,��5��A�C
D��E�E�D��
E�
���  p7�1F�E
A�X�A�(0 �7��F�C
A�J�A�S��,\ 8��A�C
H����K��
F� �<�(� �<��A�C
D��K�
Fh$� �<�TA�C
B�H�E� (>�4!4>��A�C
D��E�E�D��
A\
D,@!�>��A�G
B�E�H����	
G p!�R�'A�C
B�G�U$�!�R��A�W
B�D�o
A$�! S��A�W
B�D�o
A$�!�S��A�C
B�H��
D"PT�%A�]
F,"`T�A�O
FL"`T�A�O
F(l"`T�A�C
D��D��
A�"DU�'A�N
W�"TU�'A�N
W�"dU�$�"pU��A�R
A�x
D[$#�U�UA�R
A�_
EX<#0V�'A�N
W,\#@V�pq�C
C���
Fz
F8�#�W��J�L
A�s
FU
KT
�A�KO��(�#4X��A�C
A�`
Kb
N4�#�X��A�C
D��H����
AS
A4,$0Z��A�C
D��H����
JB
F,d$�\��A�C
B�I���D��
E(�$Xc�8A�C
G�����
H8�$lg�]A�C
B�G��E�D� 
J
J�$�k� A�H
V$%�k�ZA�C
B�F��M,D%�k��A�C
D��H����
C(t%8q��A�W
D��H�q
K(�%�r��A�R
E����
JL(�%�s�A�C
I�����,�%�t� A�C
B�I���H�g
B<(&t|��A�C
D��H���
Dc
Ea
A(h&�~�kA�C
D��K��D�S�&8��F�&t���&���1�&����&���.�&ā�'��� '���4'���H'���\'���4p'܁�&(�'���aF�C
C��d
Hh���(�'<��7A�C
B�I�[
FF�'P��1�'|��!4(���XF�C
B�E�D�m
GLA����,<(���ZA�C
I���U
F�
El(��#�(���(���($�� �(0��aF�C
A�F�A��(|��8�(����[�C
E�e�A�W��KE��X��0)<��D)H��1X�G
CN�(d)h���A�C
M������
F8�)��8A�C
G����@
Eg
Ih
H(�)��tA�C
M������
K�)D��*P��., *l��2A�C
C���
De
K8P*|���J�C
E���z
D[
EiG�����*���$�*���tA�J
B�D�|
C(�*��/A�C
B�D�Q
EN�*��+��+��0+܍�D+؍�X+ԍ�l+Ѝ� �+̍�-A�C
T
HH,�+؍��A�C
B�E�G��K�
H�+X��$�+P���y�C
B�F�D�A,,���TA�C
D��E�F���
H,D,���J�F
C���
HsE���$t,���QA�C
B�H�H�z �,��6A�C
B�G�h �,��#A�E

A�,��$,�,4���A�C
D��E�E�D��
H8(-Ĕ�zX�C
D��E�D�pH�����P�����,d-���A�C
M�����b
E�-����-����-����-���D,�-ȕ�}A�C
B�D�u
AW
I .���A�C
E�x
G08.���A�C
B�E�G��
D�
H$l.0���A�C
C��k
F(�.����A�C
G����\
I�.���98�.���A�J
H����H��
Fn
J�(/\��iA�C
D��H�D��
D8</���EA�C
B�F�F�E�G�S
G
Ex/���d(�/���A�C
G����D
A,�/ī�gA�C
B�S����g
H�/���,�/����A�C
B�N�����
F(,0`���a�C
B�E�D�P
AX0��l0���<�0���A�C
I������
F�
B[
EL�0|���A�C
F���J��]
G3
En
Bc
ES
A1���9$1��81��L1��0`1ܾ�WA�C
A��
Kv
J[
E,�1��<A�C
E����
Cj
F�1��$�1���A�C
C���
E(2���QA�H
B�I��
Hh(,2��A�C
A��
Kk
EX2���?A�P
m x2��hA�E
B�D�[�2`��(�2\��A�C
E���W
H<�2@��4A�C
I������
K�
B�
D$3@��uA�C
E���J
ED3���X3���l3����3���@�3����A�C
B�J�E�F���
F�
An
B^�3D���3@��4<��48��((4D���A�C
B�H��
EDT4���A�C
G�����
C�
F�
E}
Kw
I8�4���QA�C
G����
G�
I
F,�4����A�C
I�����1
B(5����A�C
E�B
E~
B 45���ZA�C
B�G�L,X5$���A�C
I�����?
D�5���(�5����A�C
M�����p
G�5T�� �5P��1F�C
A�\�A�$6l��HA�E
A�a
HW((6����A�E
B�G�a
HK,T6����A�C
B�J�E�I�F
D�6���RA�X
x�6��=A�C
x,�6(��eA�C
B�G��D��
D�6h��7d��!,7����A�C
B�G��E�H�X
F@L7 ���]�F
F���K�w
E������P������7���*�7����,�7����A�C
B�G��F���
J4�7d��|A�C
D��E�I�i
AG
I` 8���mA�C
H����D�P
HX
Hr
Fw
I{
EZ
FL
D|
D$�8���:A�C
B�I��j,�8���A�C
B�E�H����
K(�8`���A�C
D��D��
H$94�RA�C
A�k
HY(09l��A�F
D��D��
H$\9�PA�C
A�i
B_(�9(�NA�C
F���D��
A �9L	��K�C
A�|E�� �9�	�rN�C
A�NH�� �9$
�ZN�C
A�vH�� :`
�JG�C
A�jK��0@:�
��A�C
F���D�m
E[
Et:8��0�: ��A�H
B�E�G��D��
HC@�:���J�C
F���D�x
Ax�����P�����;H�UY�E
A�u,$;��(A�C
D��E�F��
I(T;���A�C
B�G��D�g
H �;��'A�C
B�G�U �;��1I�C
A�\G���;�.�;0��,�;���A�E
F���G���
D, <<��A�F
F���J�H�H
I,P<���A�F
D��L����
K(�<��wA�H
I�����_
G,�<���A�E
B�I���D��
F,�<��� A�J
D��E�E�K��
A,=`;�rA�C
D��V�S�R�B
K,<=�@��A�N
D��G��D�:
A,l= H��A�C
F���E�F��
A<�=�I��N�C
D��J��m
�I�B�B�A�F`�����,�=pJ��A�G
D��E�J���
K,>�K�OA�C
F���E�D��
B<>P�xA�C
s(\>pP�|A�G
P�����P
H8�>�S��A�C
B�E�E�J��t
BZ
E(�>HU�$A�C
N����z
D,�>LV�oA�C
C��^
KK
U^ ?�V�A4?�V�AH?W�9(\?0W�A�C
G����y
D(�?X��A�C
B�H�O
C�$�?�X�MA�C
E�R
Eh �?�X�=A�C
B�D�r,@�X�A�C
I�����~
E,0@�]�~A�E
B�N�����
G,`@_��A�C
D��E�J��N
K,�@�_��A�C
D��E�J��N
K,�@L`��A�C
B�E�E�J��[
K,�@�`��A�C
B�E�E�J��[
K, A,a��A�C
I���l
GQ
G(PA�a�JA�C
M������
G|A�b�#O�C
F�T�A�b�U�C
D��G�D�_J�����H�����DD�����H������A�c�&O�C
FH�B�c�,B�c�KA�F
E�~LB�c�7A�F
E�jlBd�1A�C
E�g�B d�3A�C
E�i�B@d�3A�C
E�i�B`d�7A�F
E�j�B�d�-A�C
E�cC�d�-A�C
E�c,C�d�)A�C
E�_LC�d�;A�F
E�nlC�d�3A�C
E�i�C�d�2A�C
E�h�Ce�,A�C
E�b�C e�2A�C
E�h�C@e�3A�C
E�iD`e�2A�C
E�h,D�e�,A�C
E�bLD�e�,A�C
E�blD�e�-A�C
E�c�D�e�4A�C
E�j�D�e�4A�C
E�j�D�e�-A�C
E�c�Df�8A�F
E�kE f�,A�C
E�b,E0f�;A�F
E�nLEPf�0A�C
E�flE`f�0A�C
E�f�Epf�0A�C
E�f�E�f�0A�C
E�f�E�f�0A�C
E�f�E�f�0A�C
E�fF�f�>A�F
E�q,F�f�,A�C
E�bLF�f�,A�C
E�blF�f�3A�C
E�i�Fg�,A�C
E�b�F g�0A�C
E�f�F0g�	,�F,g�1A�C
B�E�I�F���
G4G<h�$A�C
B�E�H��
CP
Hk8HG4i�A�C
B�E�H�E
HL
Dh
H4�Gj��A�C
B�E�H�Y
DP
Hk8�G�j�A�C
B�E�H�D
IL
Dh
H<�G�k�A�C
B�E�H�N
GP
HX
H|88H�l�;A�C
B�E�H�I
DL
Dv
J4tH�m��A�C
B�E�H�U
HP
Hk8�Hpn�A�C
B�E�H�D
IL
Dh
H4�HTo��A�C
B�E�H�U
HP
Hk8 Ip�A�C
B�E�H�D
IL
Dh
H4\Iq��A�C
B�E�H�Y
DP
Hk8�I�q�A�C
B�E�H�D
IL
Dh
H4�I�r��A�C
B�I�H�A
HP
Hk8Jds�A�C
B�E�H�E
HL
Dh
H0DJHt��A�C
C��U
DR
FR
F4xJu�A�C
B�D�{
KF
Jh
H0�J�u��A�J
B�L�p
GN
Ba4�J�v��A�C
B�D�s
CF
JZ
FKPw�1A�C
A�k<Kpw�*A�C
A�d4\K�w�A�C
B�E�H�k
BP
Hh8�KXx�A�C
B�E�H�E
HL
De
K4�K<y��A�C
B�E�H�U
HP
Hk8Lz�A�C
B�E�H�D
IL
Dh
H4DL�z��A�C
B�E�H�G
FP
Hk8|L�{�A�C
B�E�H�D
IL
Dh
H4�L�|��A�C
B�I�H�@
IP
Hk8�L<}�A�C
B�E�H�D
IL
Dh
H4,M ~��A�C
B�E�H�G
FP
Hk8dM�~�A�C
B�E�H�D
IL
Dh
H4�M���A�C
B�E�H�H
EP
Hk8�Mt��A�C
B�E�H�D
IL
Dh
H4NX���A�C
B�E�H�G
FP
Hk8LN��A�C
B�E�H�D
IL
Dh
H4�N���A�C
B�I�H�@
IP
Hk8�N���A�C
B�E�H�D
IL
Dh
H4�N����A�C
B�I�H�@
IP
Hk84OH��A�C
B�E�H�D
IL
Dh
H4pO,���A�C
B�I�H�A
HP
Hk8�O��A�C
B�E�H�E
HL
Dh
H4�Oȇ��A�C
B�E�H�V
GP
Hk8P���A�C
B�E�H�E
HL
Dh
H4XPt���A�C
B�E�H�V
GP
Hk8�P<��A�C
B�E�H�E
HL
Dh
H4�P ���A�C
B�I�H�A
HP
Hk8Q؋�A�C
B�E�H�E
HL
Dh
H4@Q����A�C
B�E�H�Z
CP
Hk8xQ���A�C
B�E�H�E
HL
Dh
H4�Qh���A�C
B�I�H�A
HP
Hh8�Q ��A�C
B�E�H�E
HL
De
K<(R��=A�C
B�E�H�b
KP
H^
J|8hR��;A�C
B�E�H�H
EL
Dv
J<�R��A�C
B�E�H�M
HP
HX
H|8�R��;A�C
B�E�H�H
EL
Dv
J< S��A�C
B�E�H�M
HP
HX
H|8`S̔�;A�C
B�E�H�H
EL
Dv
J<�S�A�C
B�E�H�M
HP
HX
H|8�S���;A�C
B�E�H�H
EL
Dv
J<T���A�C
B�E�H�N
GP
HX
Hy8XT���0A�C
B�E�H�I
DL
Ds
E<�T���A�C
B�E�H�N
GP
HX
Hy8�Th��0A�C
B�E�H�I
DL
Ds
E<U\��A�C
B�E�H�N
GP
HX
Hy8PU<��0A�C
B�E�H�I
DL
Ds
E<�U0��*A�C
B�E�M�Z
FP
H[
Ey8�U ��0A�C
B�E�H�I
DL
Ds
E4V���A�C
B�I�H�A
HP
Hh8@V̟�A�C
B�E�H�E
HL
De
K4|V����A�C
B�I�H�A
HP
Hh8�Vh��A�C
B�E�H�E
HL
De
K4�VL���A�C
B�E�H�H
EP
Hh8(W��A�C
B�E�H�E
HL
De
K4dW���A�C
B�I�H�@
IP
Hk8�W���A�C
B�E�H�D
IL
Dh
H4�W����A�C
B�I�H�D
EP
H|8XL��;A�C
B�E�H�H
EL
Dv
J LXP��WA�C
A�PA pX����A�C
A���X��_$�XT��ZA�G
B�D�D
A�X���,�X��� 	A�C
D��G��H��
I(Y����a�C
D��D�c
A(@Y��-A�C
G�����
G(lY��A�C
D��D�n
F�Y��A�Y0��@�Y,���A�C
B�G��E�H�Q
E
Au
A,Z���A�C
D��F��o
C4Z���HZ���7A�H
A�lhZ���6I�S
FN� �ZԸ�.F�R
FJ��Z��
�Zܸ�
�Zظ�%�Z��&�Z��# [,��GA�C
y
CA,4[X���F�H
G��v
EiG���d[���!(x[Թ�|A�C
I���x
Kk�[(��.N�J
KE��[8��cP�M
sH�<�[���$A�C
K����Y
Hn
BP
Hk0$\x���A�C
I���f
ES
EU(X\��sF�E
I���[A����0�\H���N�C
D��D�|
KQG����4�\����J�C
M�����Q
EsA������4�\���J�C
M�����Q
EpA������,(]����A�C
H����H�a
K,X]$���]�L

H\
D\D��]���F,�]���A�C
P�����
G$�]����A�C
A�V
Eb �]��VA�C
A�g
D ^T��_A�C
A�m
F<^���(P^����A�C
D��E�D�S
D|^ ��* �^<��9I�C
A�dG���^X��&0�^t��QI�C
B�G�T
G]C����^���w_���$_���68_���L_��H`_<��&t_X���_T��6�_���3�_����_���2�_����_���`���`���6(`���<`��P`���d`���-x`��=�`@��&�`\����`����`���D�`���]�`��nah��&a���H,a����4@aL��`A�C
D��F�K���
Hd
D4xat��A�C
H����E��
Fc
E,�aL���A�L
G����m
GQ,�a����A�J
B�D�P
GI
G b��A�C
R4b��F$HbT��fE�C
B�D�ME���4pb����A�C
B�L�H��j
DW
AY$�b$��zA�C
D��H�i4�b|��_A�C
D��L����
Dv
B<c���cM�G
H����D��
D�
Dh������4Hc���A�C
D��P����
E
E0�c����A�C
M�����Z
EG
I<�c8��,A�C
B�I���H�|
Ek
Ex
H�c(��,d0���A�C
F���E�G��
H(<d���A�J
B�H�K���hd���$A�C
A�^�d���(�d���PA�C
N����

D �d���QP�C
A�yC��0�d0��A�C
D��E�D��
DU
C, e��A�C
D��F�E�D��
A,Pe����A�C
B�I���D�L
A<�el���A�C
D��L����
EQ
G�
A�e��/�e(��D �ed��'A�C
W
EF,fp��sA�C
D��N��L
FJ$<f���'A�C
W
EF(df���UA�C
B�H�w
KD0�f����A�M
I���$
E
G�fh��5(�f���.A�C
I������
A,g���A�C
D��G��K�
F4gx��Lg���n`g��_$tg(���A�F
z
G]�g����,�g����A�C
B�E�I�E�D��
A �g\�VA�C
B�G�H,h���A�C
B�L���`
F$4h�@A�E
�
F(\h ��A�C
M�����r�h��,�h���A�C
B�G��M��Z
L$�h�qA�C
B�D�N
H�hX�iT�0iP��A�H
F���M�f
F[Pi�
di�xi�,�i ��A�C
H����K�D
E�i��lA�Q
Y �i  ��A�C
A�m
N$j� �'A�J
J��
A(j�!�#(<j�!�^A�M
B�H�`
H]<hj$"��A�C
M�����/
HX
H�
E�j�*��j�*��j�*��j�*�,�j+�LA�C
B�N��Q���
B,(k$,�A�C
H����K�X
AV���4lk�/�NA�J
D��L�L�L��
Ho
I$�k1�iA�J
A�}
GX$�kP1�A�C
L���e
K(�k82��A�C
B�N��K�^
C( l�2�dA�C
B�E�D�O
A,Ll03��A�C
B�L�E�K�U
I,|l�3�nA�C
B�E�E�D�T
A(�l 4�@A�C
B�I�\
EO(�l44�@A�C
B�G�Y
JO,mH4��A�G
F���F�I��
E,4m7�pA�G
D��H��I�
D$dmH9�|A�L
C��k(�m�9��A�C
B�E�D�k
A,�m�9��A�H
B�J���
DO
A,�m�:�5
A�C
H����K�B
An�G�,,n�G�nA�C
M�����0
G8\n�I��A�C
B�K�E�I���
A
G�nTQ��nPQ�9A�E
r,�npQ�!A�C
D��V���
C$�npS��A�C
B�J���$$oT�iA�C
A�^
ALoPT�/A�C
j lo`T��A�C
l
H$�o�T�wA�C
E���m$�o$U�mA�C
E���c0�olU�KA�C
F���J���
Fzp�V�A�C
N(4p�V�HA�C
B�E�E�D�o`p�V�A�C
N<�p�V��L�G
B�G��J���
F�
Hp������4�pX�A�C
H����K�e
D
G0�pd[�GA�C
M�����\
C�
I4,q�^��A�C
F���E�H�e
Dc
Edqa�xqa�<�q a��I�C
B�E�E�E�I�A
IPA�������qpa�3 �q�a�TA�K
A�F$r�a�@A�C
B�E�I��k(,r�a�DA�H
B�D�e
DG(Xrb�DA�H
B�D�e
DG�r8b�b0�r�b�
A�C
D��E�E�K��
I$�rpe�A�G
�
Fi
G0�rXf��A�C
B�E�H��
DW
A zRx�����(ן�v4`s�g�aA�C
D��E�F��
G^
J,�sj�9A�C
D��G��H�d
E,�sk�A�C
B�E�H����
E,�s�p�A�C
P�����O
E,(t�u��A�G
F���E�K��
E_A��,ltp{�_A�C
B�E�E�F���
J�t���A�P
J(�t���}A�E
B�D�G
Ed�t��7�t ��]q�C
h(u`��nA�F
B�F��E
D,Hu���!A�C
B�G��E�D�
 xu���/A�H
W
HA4�u����A�C
I������
H-
K�`ߝ�,�uD��WA�C
F���E�D��
H(vt���A�C
I������
E,Dv8��A�F
B�I���D��
I0tv���A�C
D��H�~
B�
L�$��,�v���gA�C
B�G��F�D�^
K�a��� wܒ�Pq�C
B�D�U,$w���A�C
D��D�|
H,Tw����A�C
D��V���
H�wh�� A�H
A�U(�wh���A�C
D��D�j
J,�wܖ�rA�C
H����H��
H$x,���A�C
B�D��
C,(x���A�C
H����D�]
C0Xxd���A�C
K��E�F���
E$�x��pA�C
B�G�D�^,�x8���A�C
B�G��E�D��
B$�x����a�F
B�F�D�z4y@��"A�H
F���H��
GU
CQ(Dy8���A�C
F���D�
G py���#A�C


A,�y���OK�F
C���
H`����yأ�]�y$��.$�y@��CA�C
B�H�`
B zh��'A�C
B�G�U(8zt��IA�C
B�G�\
GU$dz���7A�J
A�U
GN8�z���A�C
D��F��f
Dn
JR
A0�z����A�C
F���M��i
H(�z��\A�C
C��l
Ec(({$��$A�C
B�F���
A(T{(���A�C
B�E�K��
A(�{��pA�C
B�M�D�S
A�{0��	4�{,���A�C
B�E�I�^
Aj
CO
A�{���Nn�L
HF� |��HA�C
E�~,<|���A�C
H����D��
Fl|���(�|����A�C
D��E�D�]
B,�|@���A�C
F���E�D��
K$�|���6A�C
A�]
FI}ȭ�}ĭ�,,}���A�C
D��E�P�H�f
E,\}���A�C
F���E�D��
E$�}���A�F
B�K��
B,�}x��A�J
B�E�H��
HO,�}X��kA�C
H����D�:
A,~���{A�C
M�����
GD~��X~��A�C
J,x~Գ�/A�C
H����G��
K8�~Դ��A�C
D��E�F���
Gq
G�,�~(��FA�F
H����D��
H@H��YR�C
B�D�@
EM
CU
KU
K����0Xd��yA�C
H����D��
Hk
E0�����A�C
B�D�]
IW
IU0�l��A�C
D��E�D��
H�
I,�H���A�C
D��O����
K($�����K�C
B�J���K����HP�����M�C
H����H�l
D������A������,�����zA�C
F���M���
À@��$A�H
Z�P��=A�E
d�p��  �l��HA�H
{<D�����J�C
D��D�b
IHH����F������8��Bp�C
F<��h���A�C
D��F��G
Ka
Gw
Aw�(��A�H
F4�(��*A�C
C��\
E�
EO
I(<� ���A�C
N����*
D h�����A�V
E����`�� ��\��9F�C
A�c�A�Ăx��0؂t���A�C
D��E�D�@
Gv,���A�H
M���T���
J<���P����,d���mA�C
D��G��H��
EDnj��(��4��qF�C
E���N�B�B�A�0ԃ���*A�C
I������
B]
K ����9A�C
B�D�n(,����SA�C
B�E�H�D�{ X����>A�C
B�D�s,|�����A�C
B�E�H�~
Oj0�����%A�C
D��E�E��
HX
A$����NA�C
B�E�H�z ����9A�C
B�D�n$,����=A�C
B�H�n(T�����A�C
G�����
F,������A�C
D��G��H�u
D(��|���A�C
D��E�D�b
E,܅��A�C
F���F��
D,���hA�C
D��E�E�D��
F4<�@��3A�C
H����D�q
Gf
B,t�H��aA�C
D��E�E�K�g
D(�����nA�C
D��E�D�Y
F(І��vA�J
D��G�D�Y
E�� �����((����A�C
D��J�G�a
F4T�x���A�C
B�E�E�D�^
F^
J|����;A�K
l(�����A�C
D��J�D�]
E0؇���jA�H
D��S���
A���0 ���A�J
G����w
AZ
D$T���pA�M
B�F��Y$|� ��jA�C
C��]
A��h��$��d��<A�C
I���* �|��JA�C
E�< �����A�C
E�s
L(�$�,<� �QA�C
M�����)
Fl�P���\�A�C
W��\�$��X�+J�C
Q
BCE�$܉'��_A�K
E���M$�8�eQ�C
I���Y
J6��<@�l�6P�C
I����
FSE����H����0��l� A�C
G����v
G
I zRx������(���$����bA�N
E���M$���_A�K
E���M$<���bA�N
E���M$d�S��bA�N
E���M$�����bA�N
E���M$��NJ�_A�K
E���M$܋���bA�N
E���M$�8��mA�K
B�H���V(,�}��zA�N
B�E�H���[$X���CA�C
I����
A\���H,�����A�C
F���E�D��
GČ8�GA�C
E�y�h�A�J
M�h�3A�E
A�k$���&A�C
A�`D���&A�C
A�` d���AA�C
C��y ����SA�C
A�h
CT���KM�C
M�����
Gy
G�������H������P
A,���A�C
F���G�D�d
G4��� H���8Q�F
A�Z�A�(l�	��A�C
M������
A(���	�3A�C
M������
F,�
�FA�F
I�����W
I���������0���D���X���l�������������������Џ������������ ���4���H���\���p�����������������|�Ԑx��t���p��l�$�h�8�d�L�`�`�\�t�X���T���P���L�đH�ؑD��@��<��8�(�4�<�0�P�,�d�(�x�$��� �������Ȓ�ܒ�����
��
,��@��
�T��
�h��
�|��
���
����
����
�̓�
���
���
���
���
�0��
�D��
�X��
�l��
����
����
����
����
�Д�
���
����
���
� ��
�4��
�H��
�\��
�p��
����
����
����
����
�ԕ�
���
����
��|
�$�x
�8�t
�L�p
�`�l
�t�h
���d
���`
���\
�ĖX
�ؖT
��P
��L
��H
�(�D
�<�@
�P�<
�d�8
�x�4
���0
���,
���(
�ȗ$
�ܗ 
��
��
��
�,�
�@�
�T�
�h�
�|�
�������������̘��������������0���D���X���l������� �����A�C
A�m
F ��d
��A�C
A�g
D ܙ�_A�C
A�m
F�L�8�X��L�E
C��J
Bp���H���I(P����A�C
B�E�D�W
J|�0�*��L�5A�C
A�o��l�&$��GA�C
D��F��t4���bR�C
B�G�TF���H���a$$���_
A�C
E�U
L� �`�� t���A�C
E�u
B���� ����qA�P
N
I ��rA�J
A�`
A,�8�AH�C
E�_
AI�A�,$�X�vA�C
D��E�D�e
J,T���:1A�C
P�����
A���M�X(��N�A�C
M������$Ȝ�N�}A�C
B�H�F
D,�LO�$A�J
B�H��
Lr
F, �LP��A�C
F���D��
HJ(P�Q�
A�C
E�|
Kz
F|��Q�<��R���(R�:A�H
pĝHR�؝DR�;A�C
E�q<��dR�)A�F
D��E�F���
DD
L�
E8�TW�0L�`W��A�C
E��
E]
CP
H0���X��A�C
G����C
JR
F4���Y�[A�C
C��r
Gl
DZ
F$��Z�`A�J
C��l
F �]��A�C
E�{
D8��]�L��^�(d��_��A�M
D��I�D�]
D ��`�ZA�C
B�H�K,��H`��A�C
M��������`�6A�H
l��`�=A�C
A�w$�a�nA�C
i$D�ha�TF�C
B�H�A��� l��a�ZA�H
A�K4���a��R�C
I���GK����X����(Ƞtb��A�C
M������
B �c�GA�C
A�i
B �Dc�hA�C
E�R
A(<��c��A�C
E�\
KZ
Ah�d�G|�@d�,��\d���hd�)G�L
FO�(ġxd��A�J
F���D�w
D�,f� �(f�0H�E
Q
BO,(�4f�^A�J
C��o
CO
AM X�df�.A�C
R
JM,|�pf�^A�C
A�i
BY
GM$���f��s�C
C���A���Ԣxg���h��,���h��A�C
B�N����+
A,,�@j��A�C
D��L���e
G4\�l�E�J
B�D�r
IP
HKE���4��Xl��S�C
B�D�u
GP
HKE���4̣�l��I�C
M�����$
CK������(�n�]A�C
C��s
FP
A0�<n�D�8n�X�Dn�"A�C
A�X0x�Tn��A�J
B�H�l
Ge
C`��o�0A�E
A�h(̤o��A�C
D��I�D�o
D��to�*A�H
A�_��o�*A�H
A�_(8��o��A�C
E�@
GB
N$d�p�wA�C
E�L
KV��pp�2(���p��A�C
B�E�H�[
B ̥ q�pA�C
E�`
G�lq�2a�H
HD��q��A�C
B�G��J��@
I
H
H X��u��A�C
A�d
G,|��v�+A�C
D��I����
J(���x��A�C
F���H�p
F@ئ4y��I�C
D��I�D�\
GwI�����G�����(��y��A�C
M�����H
G@H�4|��I�C
B�G��H�d
GH�����G�����,���|�lA�C
F���J��%
G�� ~�dA�H
Zܧp~�
(�l~�YA�E
A��
E�
E���V80����A�C
I������
G�
A�,l�P���A�C
H����H��
A�����9A�C
A�o �����d�C
�
A(�����A�C
C��~
Kq
A4����A�C
C��~
K{
EY
A4D�x��AO�I
C���
F{
EP���|����#A�M
T����� A�M
Q,�����IA�C
D��F�H�
H���������,�H��A�C
M�����(
G(D�8��}A�C
M�����`
G(p����zQ�J
C��N
DI(����XA�C
D��E�D�F(Ȫ���A�C
E��
HK
A(����hA�C
D��K��
E4 ����sA�C
M�����
Eu
K X�D���A�F
A��
K,|����A�C
P������
A4��`���A�C
M������
F�
H(�(���A�C
C���
D],�����A�C
D��F�E�D�
GT@�L�� J�C
F���D��
�B�B�B�A�I��B�E�B�A�W�����L
D����P,��P��PA�C
M�����
G4ܬp���A�C
I������
Ev
D,�����A�C
I������
C$D�x��AF�C
B�D�d�E�A�,l�����A�C
B�G��H�G��
H8��`���A�C
G����h
E}
K�
G,حԸ��A�C
I�����H
K��������
0����
$D����{E�C
A�iF��,l�P��6A�C
F���J���
F(��`��A�C
I������
G,ȮT���A�M
B�I���I�T
J��$��Ga�J
[ �T��VQ�C
B�H�w(<�����A�C
E�_
H�
A,h�$��IA�C
H����H�+
A,��D���A�O
A�s
Dd
Dd ȯ����x�L
a
Kk$�0���H�L
a
Kk����p (���+A�C
B�D�` L� ��!A�C
C��Yp�,����(��
��$��:,��P��A�C
B�N����
A,ܰ@��
A�C
M�����|
C� �� �,��4�(��(H�$��wA�C
B�E�I��O
E<t�x��hJ�C
E����
DH����P����$�����RA�F
I����
B,ܱ���mA�C
B�J��L
DL$� ��9A�C
A�]
NH4�8���0H���sF�C
B�E�I�{
DN�B�B�A�|�`��A�C
V��`��%A�C
`��p��4вl���A�C
D��E�L�D��
EU
C,�����	A�C
I�����?
A,8�d��}A�C
B�J�����
D h����\A�C
f
Fk,�����sM�H
B�I�I�H�zE�����$��@��fA�J
B�E�D�O����\���������!A�C
\,����@����:T��� A�E
E�Tt���*0��$���A�J
A�
E
B~
J,������A�J
B�E�D�e
Ey,�P��yA�C
G����X
MH,�����A�C
B�E�L����
FL���(`����A�C
M������
J�����RH�E
Z
I��������RH�E
Z
I(�\���A�Q
D��I�H��
I����RH�E
Z
I$,�0���A�C
B�H�s
O(T�����A�C
D��F���
G$��<���A�C
B�J�H�������DA�C
A�z(ȶ���wA�C
B�J��~
Bf,�H���
A�C
B�I���H��
A,$����XA�E
H����M��
AT���h���,|���rA�C
C��a
Hs
E(�� ��4A�C
A��
D;,ط4�.A�C
B�E�E�F��
A,�4��A�C
I�����
H48���iA�C
H����H�/
M�
B,p��
��A�C
E���%
B_��<�`(�����A�C
G����4
A��>A�J
r,�<�zA�C
F���J���
F(0����A�C
M������
J(\�P��A�F
I�����J
F4�����F�C
A�y
EP��`��K���9A�C
t�,�� ���4A�C

I����A�J
c 8���LH�M
Y
B[,\���A�C
H����H�~
F(�����A�C
D��H�z
F(��4��i�C
I���N
EB,���A�C
B�G��M��
	
D,��)��A�C
P�����i
CD�(B�%(X�DB�
A�C
G����L
I0��(C��A�C
M������
Jf
J ���D�NQ�C
E�o�A� ܻ�D�xA�C
E�j�E�K �XE�;A�C
B�D�p(8�tE�)
A�C
N����S
K(d�xO�3A�C
H�w
Ey
G���P�%A�C
\���P�-P�L
C�м�P�+A�C
b(��P��A�C
L���
A$�0Q�]A�C
A�x
C\ D�hQ�HA�C
A�Bh��Q�jA�C
E����Q����Q�
A�C
H ���Q�JA�C
B�D�$ܽR�`A�C
I���N(�8R��A�C
M������
E,0��S�|A�C
D��H���a
G`��S�t��S����S����S�8Q�C
A�[��T�8Q�C
A�[(ܾ0T�FA�C
C��P
Ie(�TT�FA�C
C��P
Ie4�xT�5Q�C
A�\T��T�-A�C
A�c,t��T��A�C
D��E�J���
C ��(V�CA�K
j
AK(ȿTV��A�J
G�����
D,�W��A�C
D��E�E�H��
F$$��W�A�C
_
EX
HL��X�(`��X�]E�C
D��D�A����,���X�gE�C
C��h
EeC���,��0Y�wE�C
C��k
JgI���,��Y�rE�C
B�H�@
FKE���,��Y�zE�H
C��k
EgI���L� Z�<A�C
w0l�@Z�A�E
E��
AS
AM
A,��[�=A�C
E��
Hf
AM$�,\�WA�C
E�Z
En ��d\�IA�C
B�H�z$��\�sA�C
D��J��`4D��\��I�E
I�����`
I`������4|�`]��I�E
I�����`
I`������,���]��A�C
B�G��D�{
D(��x^�QA�C
B�J�E�D�w$��^�yA�C
I���g$8�_�sA�C
F���D�d(`�\_�qF�C
E���]A�������T�0���_�MA�C
F���E�H��
Ht���a�A���a�"A�N
R�b�"A�N
R,(�b�nA�C
D��D�X
AH$X�Tb�nA�C
E�Q
FM ���b�7E�C
A�jA�����b�8A�H
n���b�9A�C
A�s$���b��A�C
E�\
KS �`c��A�C
E�w 0��c��A�C
A�a
J T�Hd�rA�C
E�h$x��d��A�C
I���~
E,��e��A�C
G��b
Ck
E���e�`Q�C
K���e�(��e��A�C
C��`
Id0�Lf�D�Xf�iX��f�l��f�(���f��A�C
F���Q��� ���g�%A�C
C��]$���g��A�C
C���
N��$h�y,��h�yA�C
D��S����
I<��j�P��j�4d��j� A�C
I���h
KZ
Fb
F(���k��A�C
M������
K0���l��A�F
B�E�J�J���
A ��@m�kA�C
A�a ��m�]�C
C�@��m�&A�C
A�``��m�,t��m��A�C
G��S
B
A���r�,���r� A�E
H��Q����
E���u�!���u�A�M
H$��u�VQ�M
e
�MA�,D��u�A�C
M�����z
E$t��|��A�C
B�H�B
H��@}�8��<}��O�H
D��E�I�D�U
FPH���������}�'A�W
N$��}�VA�C
A�i
Ba,4��}��A�C
D��I�D�~
Exd�h~�A�R
H0��h~��A�C
E�j
Ee
Cf
J���~�1���5��,�P��h�.A�^
�|�A�C
K
A0�|�.A�C
P
DP���d���SA�H
I����<����,����wA�C
D��J��P
FN��`��
��\��3��������3,����#@�̀�3T����3 h�$��jA�C
C��b��p��0 �����SA�J
B�D�A$��ȁ�EA�C
C��v
C(�����A�C
D��H�
B(�����A�C
I���X
KP(D����A�C
F���J���p�������h��K,�����bA�C
I�����*
I����#���� �����\A�J
B�H�F,�8���A�F
B�N����G
B,D�����A�C
M������
E,t�h��A�F
F���F��
D,��X��?A�C
M�����C
D��h��,��d��7A�C
D��H����
F0�t���A�C
P������
I,L����A�C
I���f
Md
D,|�����A�C
D��L����
D,��P���A�E
F���F���
G����,����JA�E
I�����v
K �,��4�(��,L�0��A�J
^
G]
Cu$|����A�C
C��f
K0������A�C
G�����
B�
H(�����A�J
C��t
Ng4�x��A�C
H����D��
E�
I8<�`��vE�J
B�D�|�B�C�R���F�B�A�8x����vE�J
B�D�|�B�C�R���F�B�A�4����NA�C
F���J�J�P
B�
F������� ���4A�J
P
MK 8�4��4A�J
P
MK4\�P���A�C
D��H�M
C�
Dw
A ����qA�C
A�k$��4���A�C
B�J�H������������A�C
V,����NA�L
A�^
DR
E0D����1A�C
M������
F�
N0x�����A�H
B�N����H
G��@��_Y�]
h�����%A�C
`�����CA�J
E�r4�����A�F
D��L�u
D@
H D����|A�C
E�f
Ah����50|����A�C
B�D�N
HI
GN(�����jA�C
B�D�g
Oi�����A�C
R �����AF�C
A�j�A� ���0A�C
E�f @���eA�C
C��]$d�h��nA�C
E�P
GM(������A�C
I���Y
J_����-A�C
E�c ��$��_A�E
A�W��`��A�C
R<�`���A�C
E����
CV
JA
GL
L\���� A�C
A�V8|����nA�C
C��R
G�
H^
J{
E�����
�����<A�H
A�q����5A�Z
Y,� ��WH�E
T
GM
KV,<�P��TA�C
H����H��
G,l�����A�C
B�N�����
C��@��L$��|��KA�C
B�E�D�{(�����wA�C
B�E�H�B
K,����]A�C
E�_
H_
AH$4�(��}A�C
E�M
JX8\�����A�C
D��D�s
AO
IY
GQ8�����A�C
F���D�n
DM
Kw
I�������������������,$�����A�C
B�H���^
D_,T�H���A�C
B�H����
D�,�����QA�C
H����H�T
H�����>A�C
y ����9H�E
^
EHD��$��JA�C
B�J��l
D\
DD
DQ
Go
A,@�,��mA�C
B�N�����
D$p�l��oA�C
I���P
K,������A�C
D��H�~
B{
E��$��
$�� ���H�P
`
Hi
G����0����$A�C
M������
D@
HDL����I�C
H����D�{
Ex������P������(�����A�C
M�����G
H��|��@�����%I�C
G����D
Ip�����P������t��Gx�C
K8����%,L����A�C
C���
A~
A|����%$������A�H
C��z
J��t��
��p��
��l��
(��h��	A�C
B�N����U
G< �L���K�C
M������E������H������4`�����A�C
B�E�L����
Gr
F(��T���A�H
F���I�j
F$������A�C
C��b
G$��p���A�C
C��b
G���&(�4��<�@��E[�C
KG�$\�p��mA�C
B�D�x
F(������A�C
B�E�E�F���,��\���A�C
B�G��E�H��
E��,��S$��x���A�C
C��P
I(����
A�I
M������
D0H�����A�C
H����H��
D(|�@���A�C
B�Q����x
A$����YA�C
B�H�z
H����,�����A�C
M�����4
K�x��(�t��
$<�p��NA�C
D��E�D�|,d����^A�C
B�K�D�o
L����*�����q�I
RA���`�����<�������\�4��V�����,0�L��A�F
F���F�D�
J,`����A�F
F���F�D�
J(�����A�I
A��
DG
A,��0��A�Q
C��
DI
G(���	�CA�I
A��
D]
K,���A�I
C��O
DF
J4H���VP�C
C��
B_
AS���4���
�VP�C
C��
B_
AS���,���dA�P
C��
B_
A,��D�A�P
E���p
JH
H4�4��P�J
E���)
H^
BT����8P����P�J
E���)
H^
BT������������������������. ����[A�J
A�N�8��4(���aA�C
B�E�G��D��
E�
A`���t���A�F
A�U,�����A�F
F���E�D�Q
I(��X�JA�F
B�E�I�D�n ��|�@A�M
B�D�k ���5A�F
B�K�`(8���xA�F
F���E�D�]<d��L�C
G�����E�����H�����j ����5A�F
B�K�`(���JA�F
B�E�I�D�n4��(��A�C
B�E�G��D��
FV
B,���F8@����A�C
A��
GM
CH
HL
E<|�`��A�C
E��
HI
GH
HL
L�� ������A���d��t��D�I
RA�� �V,�` �f,@�� ��A�I
C���
DU
K,p�<"��A�P
E����
D\
D(���#��A�I
A�{
JD0��@%��A�I
E����
KS
E�4��&��P�C
C��
J@
Ht���48�4(��P�C
C��
J@
Ht���(p��)��A�P
C���
HF4��@+��A�P
G�����
EZ
F�4���,��P�J
E���
H
Aq����4�P.��P�J
E���
H
Aq����(D��/��A�C
I������
Ip��3�	4���3� A�F
B�J�M����
AS
A,���6�xA�M
B�Q����=
A,���8��A�C
I�����<
G�@=����I
RA�<��=��P�|>�Vd��>�Vx�?��(���@��A�I
A�
ID
D,���B�"A�P
C��
GF
J(���D�SA�I
A�	
D]
K,��E��A�I
C��W
DF
B4D��G�fP�C
C���
IO
AS���4|��H�fP�C
C���
IO
AS���,���I�tA�P
C��*
B_
A,��HK�2A�P
E���x
BH
H4�XM��P�J
E����
En
JT����4L��N��P�J
E����
En
JT������(P����I
RA����P����Q�a��PR�����R�V��HS��(�T��A�I
A�d
AG
I,4�xV��A�P
C���
GI
G(d�(Y��A�I
A��
DV
B,���Z�AA�P
C��

B`
H,��]��A�I
C��o
DF
J4���_�0P�C
C���
F`
H����4(��a�0P�C
C���
F`
H����,`��c��A�P
E���`
JX
H8��\f�FP�J
E����
G�
F�����<��ph�FP�J
E����
G�
F�������j��q�I
RA�,�k��@��k�FT�l�Vh�Tl��|�n�$8��,o�cW�C
A��
GL
LH��P����`p�$0��|q�;P�C
A��
FlD��P��0��r�EP�C
A��
D]
KR��0H��s�EP�C
A��
D]
KR��(|��t�RA�P
A�
D]
K8���u�kW�C
C���
DAG���P���4��(w�gP�J
C��	
J^
BT���4�`x�gP�J
C��	
J^
BT���T��y��@�I
RE�t�z��,���z�)A�C
B�G��P��*
I,���|�)A�C
B�G��P��*
I���~�\���~�V�<��($�����A�I
A��
IL
D(P�,��2A�I
A��
D]
K,|�@���A�I
C��7
DF
B4�����WP�C
C��
B_
AT���4����WP�C
C��
B_
AT���0���@A�T
B�I���

Cn
B(P����A�W
C���
J�4|����iA�P
B�N�����
FL
D4�����P�J
B�L���
F�A�����4������P�J
B�L���
F�A�����$�X��&08�t���A�N
B�H�x
GL
DO$l���B��J
C���D���,��(���A�M
D��I����
E0�����A�Y
A��
FV
JQ
A�����V0����A�C
B�E�E�E�D�>
I0@�l���A�C
B�E�E�E�D�>
I0t�Ȝ�A�C
F���K���
D(4������A�C
D��F��L
Fe
KQ4����A�C
D��F��L
Fe
KQ����,����,@�����A�C
B�G��D��
APp�<��A�C
T(��<��uA�C
M�����Z
E,������A�C
B�J����w
I,����A�C
B�G��E�D��
E0�p��<Q�C
M������
F�8P�|��{A�L
B�E�E�G��+
Eq
A$�����QA�C
B�E�H�}$�����QA�C
B�E�H�}�0�� �,��[A�J
A�N�h���4(����A�C
D��E�N���
FP
H`����4t�����A�C
D��E�N���
FP
H,�� ��
A�C
D��H���
E,���IA�I
B�J����0
J�0��A�C
T(,�0���A�C
M������
E(X���wA�C
A�r
Ij
F��8����D��h0�����/A�F
C���
DK
EK
D������������3�й�30����0D���0X�4��Cl�p����l��6�����c ����aA�G
B�D�R�@��1<�l���A�J
H����E�R
A�
DU
C8 ����A�J
H����E�V
A�
Hn<\�P���A�C
F���G��Y
A�
BK
E8�����A�C
F���G��]
A�
Ik�d��4�`���A�I
D��G��D��
A�
A4$�����A�C
J���H�E��
E�
A\�@��p�<����8����D����P��)4��l���A�F
I�����Q
GO
I��������A�L
s,�p��'$@����A�F
B�H��
J h�t��"A�I
E��
F�����2A�F
A�i�����2A�F
A�i����
$����`A�C
D��D�z
J���������@0����EL�C
I������C������H������l4t�����M�J
H����R�
Au�������� �������4�����A�F
B�E�G��D��
BV
J���� ����k(4����jA�C
B�D�N
HI`�<��  t�H��dH�C
A�QA������������Y������,�x���A�F
D��E�E�D��
F$H��NA�C
B�E�D�~,,p���A�C
B�G��E�D�O
K$\ ��NA�C
B�E�D�~�H������v�p��A����A�O
L����d����D�I
RA����V,(����A�I
C���
DU
K,Xt���A�P
E����
D\
D(����A�I
A�{
JD0�x���A�I
E����
KS
E�4�����P�C
C��
J@
Ht���4 l���P�C
C��
J@
Ht���(X����A�P
C���
HF4�x���A�P
G�����
EZ
F�4����P�J
E���
H
Aq����4�����P�J
E���
H
Aq����,��6@<��F,Tx�� A�C
B�N�����
C0�h���A�C
B�E�E�F��v
Dp,����A�K
B�E�L���!
H,���SA�F
B�G��F���
D0���A�C
B�E�E�F��v
Db,L���
A�F
I�����@
H,|p��DA�K
B�E�G��D��
F$����!A�C
B�H��
H��������)�����<���$���,8d�A�J
D��H��
HZhD�%A�G
\8�T��P�J
B�E�E�E�E�q
GPA���������!A�S
L8����P�J
B�E�E�P�G�[
HPA������4 l�A�J
D��K�;
K�
ERXD�8lP��P�J
B�E�E�P�G�S
HPA������,����A�F
Q�����
A$�T��A�J
J���D��0���A�J
F���D��
HY
G04�	��A�C
B�E�E�E�E�
K,h4�*A�C
F���E�L��
D8�4�EA�F
f
C�
FP
HI
AJ,�H��A�J
D��I�I��
HY�%A�G
\8$(��P�J
B�E�E�E�E�q
GPA������`��!A�S
L8����P�J
B�E�E�P�G�[
HPA������8�@��A�J
D��L�I�'
E�
HQ���8	��P�J
B�E�E�P�G�S
HPA������,H	t��A�F
M�����
H(x	��A�J
F���E�D��4�	���A�G
F���E�D��
H[
E0�	P��A�C
B�E�E�E�E�
K,
��*A�C
F���E�L��
D,@
��&A�C
P�����
D,p
���A�G
B�N�����
F,�
l��A�C
F���K��B
I,�
,#��A�C
F���K��B
I8�&��A�G
D��H��
CD
D�
G,<P-�VA�F
H����K��
Il�K�8(��K�&A�C
A��
EK
E(��L�&A�C
A��
EK
E,��M��A�J
P������
FTT�#A�C
^8(dT��P�J
B�E�E�E�D�r
GPA������,d�T�jA�J
P�����
G�(\�#A�C
^8�8\��P�J
B�E�E�E�D�r
GPA������<��\�
	A�C
B�E�O���
ES
A�
A0
�e�A�C
TP
�e�3d
�e�x
�e�,�
�e��A�G
M�����n
E@�
Pg��i�C
B�I�D�a�B�B�A�����LA����,h�"A�J
P������
J0o�#A�C
^8Po��P�J
B�E�E�E�D�r
GPA������,��o��A�J
I�����K
A�0w�#A�C
^8�@w��P�J
B�E�E�E�D�r
GPA������,�w��A�J
P�����
BH��#A�C
^8h���P�J
B�E�E�E�D�r
GPA������,�(��RA�J
P������
D�X��#A�C
^8�h���P�J
B�E�E�E�D�r
GPA������,0���	A�J
P������
A`|��#A�C
^8�����P�J
B�E�E�E�D�r
GPA������,����A�C
F���Q���
G���#A�C
^8���P�J
B�E�E�E�D�r
GPA������,Ht��kA�C
M������
G8x���lA�C
C��
EW
IP
HR
A,����A�F
M�����
H,����CA�J
D��L����
E,����A�C
B�G��E�D�e
E8DH���A�J
D��L�I�'
E�
HQ����8����P�J
B�E�E�P�G�S
HPA������,�|���A�J
D��I�I��
HYL��%A�G
\ \��!A�S
L8@l���P�J
B�E�E�E�E�q
GPA������8|���P�J
B�E�E�P�G�[
HPA������(�t���A�J
F���E�D��,�(���A�F
P�����E
D,����A�J
D��E�K���
H4D8���A�C
B�H�
KX
HS
E,|����A�F
M�����
H,�@��CA�J
D��L����
E,�`���A�C
B�G��E�D�e
E8���A�J
D��L�I�'
E�
HQH���8\����P�J
B�E�E�P�G�S
HPA������,�4���A�J
D��I�I��
HY���%A�G
\���!A�S
L8$���P�J
B�E�E�E�E�q
GPA������8D����P�J
B�E�E�P�G�[
HPA������(�,���A�J
F���E�D��,����A�F
P�����E
D,�`���A�J
D��E�K���
H@���W�C
B�D��
F!
Gp���H���,PL���A�F
M�����
H,����CA�J
D��L����
E,����A�C
B�G��E�D�e
E8�����A�J
D��L�I�'
E�
HQ`��80l���P�J
B�E�E�P�G�S
HPA������,l����A�J
D��I�I��
HY����%A�G
\����!A�S
L8�����P�J
B�E�E�E�E�q
GPA������8T���P�J
B�E�E�P�G�[
HPA������(T����A�J
F���E�D��,�����A�F
P�����E
D,����A�J
D��E�K���
H$�����A�C
C���
G,d���A�F
M�����
H,8��CA�J
D��L����
E,h$���A�C
B�G��E�D�e
E8�����A�J
D��L�I�'
E�
HQ�x��8�����P�J
B�E�E�P�G�S
HPA������,$����A�J
D��I�I��
HYT���%A�G
\t���!A�S
L8�����P�J
B�E�E�E�E�q
GPA������8�l���P�J
B�E�E�P�G�[
HPA������(����A�J
F���E�D��,8����A�F
P�����E
D,h$���A�J
D��E�K���
H,�����A�C
C��|
E�
G,�T���A�F
M�����
H,����CA�J
D��L����
E,(���A�C
B�G��E�D�e
E8X����A�J
D��L�I�'
E�
HQ�h��8�t���P�J
B�E�E�P�G�S
HPA������,�����A�J
D��I�I��
HY���%A�G
\4���!A�S
L8T����P�J
B�E�E�E�E�q
GPA������8�\���P�J
B�E�E�P�G�[
HPA������(�����A�J
F���E�D��,�����A�F
P�����E
D,(���A�J
D��E�K���
H<X����A�C
B�H�>
D^
BP
HS
A,�d���A�F
M�����
H,���CA�J
D��L����
E,�$���A�C
B�G��E�D�e
E8( ���A�J
D��L�I�'
E�
HQd x��8x ����P�J
B�E�E�P�G�S
HPA������,� ����A�J
D��I�I��
HY� ��%A�G
\!��!A�S
L8$!���P�J
B�E�E�E�E�q
GPA������8`!l���P�J
B�E�E�P�G�[
HPA������(�!���A�J
F���E�D��,�!����A�F
P�����E
D,�!$��A�J
D��E�K���
H("��C<"��P"��Td"��{A�F
F���E�D�Y
AC
El
D_
I]
Cm
CZH�"�+A�F
F���E�D�S
GH
H]
Cm
CZT#���A�F
D��F�F��]
DB
Fl
Db
Fb
Fm
CZ,`#,�4A�F
D��F�F��k
F,�#<
�A�C
F���E�D�
B,�#���A�C
F���E�D�
F4�#��A�C
M�����D
Ke
K(($���Q�F
B�E�H��G�jT$�)h$$��(|$���A�C
F���E�D��(�$t�A�C
D��H���(�$h�=A�C
B�E�E�D�d(%|��A�C
F���E�D��,%0�!A�L
S0L%@��A�C
B�N����z
Ba(�%��PA�C
B�E�E�D�{0�%��sF�C
B�E�E�E�D�OC������ �%<�[A�J
A�N$&x�|A�C
B�E�D�l0,&��0A�C
M������
Ft
D`&���t&H�$�&d�N�&��54�&���W�C
I�����@
E_�������&d�&�&���V�O
VE�L'���J�C
I������
H�
Gx������L������l'�#��'|#��'�#��'�#�&�'�#�.(�'�#��A�I
A�d
AT
D(�'0$��d�C
E����D����(((�$��A�I
A�e
HT
DT(X%�br�N
�A�t(�&�
�(�&��(�&�RP�C
iD� �(�&�~A�J
A�q,�(L'�7A�C
B�G��I�D�
A,)\(�)A�C
F���I�D�
A4@)\)��A�C
B�E�H�M�H�g
Ab
E(x)�)��A�C
D��D��
A,�)�*��A�C
D��G�F���
C,�)/�hA�C
D��E�N���
C*X4�A�C
U$*X4�A�C
T,D*X4��A�F
D��E�I�H��
D,t*(5��A�F
F���E�I�y
D,�*�6��A�F
F���I�H�~
D,�*87�gA�F
F���E�I�q
D+x8��+9��,,+�9�^A�F
D��H��H��
A\+�;��p+�<��,�+H=��A�F
D��H��H��
C,�+�>��A�F
H����E��
D �+h@�[A�J
A�N8,�@��A�K
M������
GQ
OJ
FD,B�X,B��,l,�B��A�I
A�v
G
ID�,pC���,,D���,�D���,�E�6�,�E��-�F�A�C
T -�F�A�C
T@-�F�A�C
U`-�F�A�C
U@�-�F�?T�C
F���E��
Eh�����C�����,�-�G��A�C
D��E�J�N��
D,�-�H��A�C
F���J�N��
D($.(I�A�I
C��g
D�4P.J�[A�I
G�����
G�
KJ0�.DK�HP�C
E���n
J�A����(�.`L�A�I
A��
Ig,�.DM�<A�F
B�G��}
C�/TN��0,/@O�A�I
C���
Ca
GF(`/P�P�C
A��
ExA��(�/Q�P�C
A��
ExA��(�/R�A�I
C��g
D�4�/�R�[A�I
G�����
G�
KJ00 T�HP�C
E���n
J�A����0P0<U�HP�C
E���n
J�A����,�0XV��A�F
H����E��
D(�0�W��A�I
A��
A�
E�0|Y��0�0([��A�I
C���
E�
CN0(1�\��P�C
A��
I�
Gf��0\1`^��P�C
A��
I�
Gf��(�1�_��A�I
A��
H(�1�a��A�I
A��
G�,�1tc�=A�F
H����E��
I(2�e��A�I
C���
D(D2Hg��A�I
A��
D�p2�h���2�j��0�2Tl��A�I
C���
E
GF0�2 n��A�I
C���
G�
GF(3�o��P�C
A��
D�A��(,3�q��P�C
A��
E�A��(X3$s��P�C
A��
E�A��(�3�t��P�C
A��
D�A���3lv��(�3x��A�I
A��
C�0�3�y��A�I
C���
K�
GF0$4X{��A�I
E����
F�
EH(X4$}��P�C
A��
C�A��,�4�~��P�C
C���
H�A���,�4h���P�C
C���
H�A���(�4���P�C
A��
C�A��(5����F�C
E����D����,<5������G
I������
Dl5@�����I
RA��5��a�5\���5h����5��V�5`���4�5���A�C
H����I��
J�
A(6���<6���(P6����A�I
A�d
AG
I,|6���A�P
C���
GI
G(�6����A�I
A��
DV
B,�6���AA�P
C��

B`
H,7����A�I
C��o
DF
J4874��0P�C
C���
F`
H����4p7,��0P�C
C���
F`
H����,�7$���A�P
E���`
JX
H8�7��FP�J
E����
G�
F�����<8���FP�J
E����
G�
F�����T8��h8��|8 ����8ܢ���8���!A�L
S0�8����A�C
B�N����z
Ba�8$��x9����, 9|��mA�C
B�J��v
J�
FP9���A�O
Lp9�����9���|�9����9���,�9����A�C
E���Y
Fe�9��|8:����J�C
A�K
GJ
F���O��,@:���/J�C
h
K�
AS�p:����,�:x���A�I
C���
Bi
G0�:���
T�F
A�}
He
K:��0�:Զ�
T�F
A�}
Hf
J:��0;����A�F
D��E�F
J�
IP;L���,d;غ�+A�I
C��a
B
A,�;ؼ��A�I
E���
BH
H8�;h��NP�C
E���p
H�
B[����8<|��NP�C
E���p
H�
B[����,<<����A�I
C��
B�
F,l<@��A�I
C��
JG
I,�<0���A�I
E���_
BH
H,�<���P]�K
C��d
A����,�<����A�C
D��E�J�N��
G8,=���#P�C
E��� 
H�
AV����,h=���A�I
C��
JG
I,�=����A�I
E���_
BH
H8�=D��#P�C
E��� 
H�
AV����8>8��#P�C
E��� 
H�
AV����,@>,���_�K
C��~
E���,p>����A�C
D��E�J�N��
GD�>\���T�F
C��F
E�
E�
H�
Di���D�>����T�F
C��F
E�
F�
H�
Di���,0?,��_A�I
E����
Hk
E(`?\���K�C
F���E�D
C�?����0�?L���A�I
E����
Ha
G4�?����A�I
C���
JF
J�
F0@0��SA�I
G����O
HJ
F@@\��RHT@����P�C
G�����
F�
H_�����C�����H�@<���P�C
G�����
F�
H_�����C������@��%,A��BA�I
A�	
D�
C40A	�cA�I
E���
B^
BH
H@hAD��P�C
C�� 
JW
A����C���@�A���P�C
C�� 
JW
A����C���D�A��Q_�K
I�����J
C�������C������,8B���A�C
D��E�J�N��
GhB��|B0�<�B��|A�C
B�G��E�D�z
HS
E�
I�B�"�A�C
S�B�"�A�C
UC�"�A�C
U0C�"�CDC#�N,XCT#��A�C
F���J�N�
G,�C�#��A�F
H����D��
H,�C�&��A�C
F���J�N�
G,�C$'�#A�F
F���F�H�*
K,D$*��A�C
F���J�N�
G0HD�*��A�C
M������
KE
A(|D�+�A�F
B�G��L��
E,�Dt,��A�F
D��E�I�H��
D�DD-��,�D.��A�C
I������
F0E�0��A�C
I������
Ge8PE\3�8A�C
M������
E�
Iv
J,�E`5��A�C
I�����M
F,�E 9��A�C
D��E�E�H�H
F,�E�9��A�F
B�I���H�{
K4F`;��A�C
B�E�G��H�T
B�
L,TF�A��A�C
D��G��H�g
B,�FXV�tA�L
B�E�E�E�P��
E�F�W�>4�F�W�
A�C
B�G��E�H��
Hs
E0G�X��A�C
B�H���Y
IQ
G4GY�HG$Y�90\GPY��A�C
B�E�E�E�D�H
G�G[�AA�M
r�G<[�A�P
L,�G<[�A�F
B�I�E�F�D��
E4H,\�)A�F
C��g
G`
H@
A,8H$]��A�F
F���K���
H,hH�^��A�F
B�E�I�H�D�q�HD_�,�HP_��A�E
F���G���
D0�H�`��A�N
�
Gh
Hm
C,ILb�qA�C
B�D�(
F�
E,@I�e��A�F
F���J�H�H
I,pIh��A�F
D��L����
K0�I�i�7A�C
G����S
B�
A(�I�k�wA�I
I�����f
G,JLm��A�E
B�I���D��
F,0Jo�`A�J
D��G��K��
E,`JL��rA�C
D��V�S�R�B
K,�J����A�N
D��G��D�:
A,�J��"A�N
W�����
K �J��"A�J
V(K��!A�C
F���J��
G @K���A�C
�
GdKȸ�+|K�� A�H
A�U�K�� A�H
A�U<�K��
A�C
I�����`
A�
B@
H,�K����A�C
D��H�F���
G4,L@���A�F
D��E�H�H��
E�
K0dL���A�C
B�D�y
E@
Hb,�L����	A�G
B�E�N��D�
F(�L����A�K
P������
D�L���M���A�C
z,(M��A�C
B�E�I�E�G��
F XM����A�C
�,|M`���A�J
B�E�E�F��]
F�M0���M8��$�M@��7F�C
A�_G��NX��.Np��+$4N����A�C
|
HX4\N���A�F
G���
Ay
BS,�N���`A�I
D��L���
G@�N���A�C
D��I�D��
Gh
H_
Il
DDO����A�C
M�����m
Bv
Jh
H�
A(PO��|A�C
I������
E|Op��^A�W
E �O���9M�C
A�`G���O����O����O����O���P���$P���48P���;$LP��<A�C
B�F��otP(��8D�PP��eF�E�E �E(�H0�H8�G@n8A0A(B BBB�Px����������������/�� �����&{�i�'���'��
�'� ��'�!��'��;����?�B��I�E�����~����7 6�7�j[k�o�s�w�{�����������������������������|�|���e��|_����f��|i����g��|q����h��|z����i��|�����j��|�����k��|�����l��|�����m��|�����n��|�����o��|�����p��|�����q��|ĸ���r��|˸���s��|a����t��|Ը���u��|ܸ���v��|����w��|����x��|�����y��|���z��|���{��|����|��|�@`����|Aa�������|���P>	>	$�)��|��9�?��|RP�V�Z��|i��s��|�Q��д���|���	����|T��
�����|�N�|�˹�|��շܹ�|�Qз@	�A	
/���|� ��C	�C	F����|�����|j-��4��|����>	�@	�D��|jU
���U��|�÷�?	@?	�g��|�ox�~����|�������|�"��?	�?	v����|��� ^�ƺ�|ں!״��|�S��@	�<	#�����|���?	�?	$���|b�%%�-��|�|&@�F��|-'W�'^�g��|'{�(�����|T��)�����|�o��3P����|�W�9ͻԻ�|��;���|��?
�
��|�@^���|ں\:�!��|B�_4�:��|�L��>	p>	aR�Z��|�n�?	 A	�x��|T��д���|���P����|�W�д���|��������|�|��ȼ�|�o���ۼ�|T��P���|�W����|T�����|��д+��|���"~�=��|���*��M��|�o��+@�_��|-'W�,~�i��|���-_�|��|�S��@	@=	._����|�S��@	@=	/д���|���0д���|���1д���|���2P�ʽ�|�W�4P�ս�|�W�5^���|'{�6����|�@@	pB	7���|�@@	pB	8����|�#�@@	pB	:�+��|��<6�<��|M�p@	`@	=6�S��|M�p@	`@	>���|�#�@@	pB	A�]��|��B~�g��|���Cͻr��|��D�}��|b�E$����|��F����|�ox�GF����|�F�HV����|��I%����|�|J�þ�|�Q��K�;�|jU
�L״׾�|�S��@	�<	M���|�o��Nv����|���O����|�o��P9���|RP�Q����|T��R����|�|]:�(��|B�S״4��|�S��@	�<	T��@��|���P>	>	U�I��|����>	�@	V��S��|�÷�?	@?	W�^��|�"��?	�?	X/�f��|� ��C	�C	Y�o��|j-�Z��z��|���?	�?	[շ���|�Qз@	�A	^д���|���`4����|�L��>	p>	c~����|���bR����|�ſ?	 A	e�ο�|�@@	pB	f�߿�|�@@	pB	g���|�@@	pB	h���|�@@	pB	i���|�@@	pB	j�(��|�@@	pB	k�8��|�@@	pB	l�J��|�@@	pB	m�[��|�@@	pB	n�l��|�@@	pB	o�}��|�@@	pB	p����|�@@	pB	q����|�@@	pB	r����|�@@	pB	s����|�@@	pB	t���|�@@	pB	u���|�@@	pB	v���|�@@	pB	x���|�@@	pB	y���|�@@	pB	z�&��|�@@	pB	{�A��|�@@	pB	|�V��|�@@	pB	���j��|���?	�?	���z��|���?	�?	������|���?	�?	������|����?	�?	������|����?	�?	�����|����?	�?	�����|����?	�?	�����|����?	�?	������|����?	�?	�����|����?	�?	�����|����?	�?	���%��|����?	�?	���4��|����?	�?	���G��|����?	�?	���V��|����?	�?	���g��|����?	�?	���u��|����?	�?	������|����?	�?	������|����?	�?	������|����?	�?	������|����?	�?	������|����?	�?	������|����?	�?	������|����?	�?	�����|����?	�?	�6���|M�p@	`@	�6�+��|M�p@	`@	�6�>��|M�p@	`@	�6�O��|M�p@	`@	�6�a��|M�p@	`@	�6�t��|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�6���|M�p@	`@	�6���|M�p@	`@	�6�,��|M�p@	`@	�6�?��|M�p@	`@	�6�R��|M�p@	`@	�6�c��|M�p@	`@	�6�t��|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�״��|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״	��|�S��@	�<	�״��|�S��@	�<	�״/��|�S��@	�<	w״/��|�S��@	�<	�״B��|�S��@	�<	�״U��|�S��@	�<	�״h��|�S��@	�<	�״y��|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״���|�S��@	�<	�״��|�S��@	�<	�״��|�S��@	�<	�״(��|�S��@	�<	�״;��|�S��@	�<	�״R��|�S��@	�<	�״h��|�S��@	�<	�״|��|�S��@	�<	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_���|�S��@	@=	�_�"��|�S��@	@=	�_�5��|�S��@	@=	�_�H��|�S��@	@=	�_�[��|�S��@	@=	�_�l��|�S��@	@=	�_�~��|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_����|�S��@	@=	�_���|�S��@	@=	�_���|�S��@	@=	�_�.��|�S��@	@=	�_�K��|�S��@	@=	�_�b��|�S��@	@=	��x��|����B	 C	�����|����B	 C	�����|����B	 C	�״���|�S��@	@=	�_����|�S��@	@=	_����|�S��@	@=	_����|�S��@	@=	_���|�S��@	@=	_���|�S��@	@=	_�/��|�S��@	@=	_�E��|�S��@	@=	_�[��|�S��@	@=	_�q��|�S��@	@=	_����|�S��@	@=		_����|�S��@	@=	
_����|�S��@	@=	_����|�S��@	@=	_����|�S��@	@=	
_����|�S��@	@=	_���|�S��@	@=	_�&��|�S��@	@=	_�<��|�S��@	@=	_�R��|�S��@	@=	_�h��|�S��@	@=	_�~��|�S��@	@=	_����|�S��@	@=	_����|�S��@	@=	_����|�S��@	@=	_����|�S��@	@=	_����|�S��@	@=	_���|�S��@	@=	_���|�S��@	@=	_�/��|�S��@	@=	_�E��|�S��@	@=	_�[��|�S��@	@=	 _�q��|�S��@	@=	!_����|�S��@	@=	"_����|�S��@	@=	#_����|�S��@	@=	$_����|�S��@	@=	%_����|�S��@	@=	&_����|�S��@	@=	(_���|�S��@	@=	)_�&��|�S��@	@=	*_�<��|�S��@	@=	,_�R��|�S��@	@=	/_�h��|�S��@	@=	0_�~��|�S��@	@=	1_����|�S��@	@=	2_����|�S��@	@=	3_����|�S��@	@=	@״h��|�S��@	�<	A״���|�S��@	�<	B״���|�S��@	�<	`_����|�S��@	@=	a_���|�S��@	@=	b_�$��|�S��@	@=	������|����?	�?	���8��|����?	�?	���H��|����?	�?	��Y��|�@@	pB	��k��|�@@	pB	��|��|�@@	pB	�6����|M�p@	`@	�6����|M�p@	`@	�6����|M�p@	`@	�����|���P>	>	$����|��9����|RP�V���|i����|n��д3��|R��	�K��|T��
��c��|�N�|�y��|��շ���|�Qз@	�A	
/����|� ��C	�C	F����|������|j-�����|����>	�@	���|�Q
�����|�÷�?	@?	�0��|�ox�~�G��|����_��|�"��?	�?	v�t��|��� ^����|ں!״���|�S��@	�<	#�����|���?	�?	$����|b�%%����|�|&@���|-'W�'^���|'{�(��6��|T��)��M��|�o��+@�e��|-'W�-_�u��|�S��@	@=	._����|�S��@	@=	/д���|R��2P����|�W�3P����|�W�5^����|'{�6����|�@@	pB	7���|�@@	pB	8���|�#�@@	pB	9ͻ5��|��:�M��|��;�^��|��<6�v��|M�p@	`@	=6����|M�p@	`@	>����|�#�@@	pB	@^����|ںA����|��B~����|���Cͻ���|��D����|b�E$���|��F���|�ox�GF�#��|��HV�4��|i�I%�B��|�|J�T��|n��K�d��|�Q
�M�t��|T��Nv����|���O�����|�o��P9����|RP�Q�����|T��R�����|�N�|S״���|�S��@	�<	T�����|���P>	>	U����|����>	�@	V����|�÷�?	@?	W���|�"��?	�?	X/�&��|� ��C	�C	Y�5��|j-�Z��F��|���?	�?	[շU��|�Qз@	�A	\:�d��|B�]:�}��|B�_4����|�L��>	p>	`4����|�L��>	p>	aR����|�ſ?	 A	bR����|�ſ?	 A	e����|��@@	pB	{����|��@@	pB	�����|���?	�?	���+��|���?	�?	�6�E��|M�p@	`@	�6�\��|M�p@	`@	�״w��|�S��@	�<	�״���|�S��@	�<	�_����|�S��@	@=	�_����|�S��@	@=	��д��д>�P�^�^�z�^��д���P�P���F�����������ʷշ��շڷ����������&�:���:��-���дV�дa�дK�д������������t�����������ܵ������(������F�M�F�X�F�;�F���v�}�v���v�k�v����������V��/� �/��/���$��շշ�дߴߴY�ߴ1�
���$�*��҇��









  
 &
	[���&@���=�Q���x��~@�=�������]��^���~���Ђ��������T���\��Sx������������`p^���_����_��@�_ (& '& && %& $&@<&@;&@:&@9&@8&@7&@6&@5&@4&@3&@2&@1&@0&@/&�� ,` D* C* B*�@1�:1�41�,1�&1� 1�1�1�1�1�1��0��0��0��0��0��0��0��0��0��0��0��0��0��0��0��0��0��0��0��0�|0�r0�n0�h0�b0�^0�Z0�P0�J0�D0�>0�80�20�"0�0�
0�0�0��/��/��/��/��/��/��/��/��/��/����b���e�^d�]d�\d�[d�Zd�Yd�Xd�Wd�Vd�Ud�Td�Sd�Rd�Qd�Pd�Od�Nd�Md�Ld�Kd�Jd�Id�Hd�Gd�Fd�Ed�Dd�Cd�Bd�Ad�@d�?d�>d�=d�<d�;d�:d�9d�8d�7d�6d�5d�4d�3d�2d�1d�0d�/d�.d�-d�,d�+d�*d�)d�(d�'d�&d�%d�$d�#d���\����T��Sx����9~�9 � `�9��0�9"!"!!�9�9�9�9�9$�92�91�90�9/�98�9��>�9J�9W�9`�9p�9��9��9��9š9�9��9�9+�9B�9Y�9t�9
��9��9��9آ9�9	�9p�9)�9��9��9
ة9d��9e �9fX�9g��9h��9iت9��9�0�9�`�9���9���9���9�(�9�X�9���9���9��9�(�9,X�9-��9.��9/Э90��91 �92H�9@p�9A��9BȮ9C�9D�9E@�9Fh�9r��9_��9`�9a�9b8�9c`�9|��9���9���9�8�9�x�9���9��9�@�9���9���9���9�0�9�h�9��9ȹ9�9�9x�9��9Ҷ9�9��9�91�9��9G�9Y�9��9v�9��9��9(�9��9��9P�9x�9��9�9�9@�9h�9��9�9�9η9�9�9�98�9h�9��9��9��9 �9X�9��9��9�96�9@�9h�9��9��9�90�9p�9��9��9(�9I�9X�9��9��9g�9w�9��9�9��9��9и9�98�9�9x�9(�9`�9 �9X�9�9��9�9�9��98�9��"� ��@�	 �����%�-8�,� �K0�`�r�=�p�����������~�P2�3��1�0�@�0�3��B��W`�e��t�� �����>������������
�`����1@�I��`p�oP��...��1A-� v�P�@	�h	0��	P��	���P��@����p������"P�9�9E`�	��Q@=a�	`#l��|����"�@:����/� 1��.�P���(� +�3@)�'*'9 )F9Xpa� j4y�=� 0��9��*��%�03�P/� �к�0%��%�#p�&p95> AK�'Y�%k@;t�(�#�0�`��"�`)�`��?��6���	�@	�?	�&%	P1	P2�
��]���]`r]@b]�x R]� R]� R]�B]D�A]f�]*
P�e8
H�eO
�A]\
\�eo
��e}
��e�
�e�
خe�
��e�
Ȓ]�
Ԯe�
IJeĒ]��e ��e,��]{�]�L�e=̲eSȲej��e��e���eӏ��e���e���e���e���e���ef���e�x�e���e��e��e�8�e���e��e(�e�0�e�� �e@�e ���eP�e	H�e���e��e��e`�e�e��e�
p�
�
��
@�P�`�
p�
 �
�
Ш
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
����
`��@
`� 
б
��
�
`�
0�
��
@�
 �
�
 �
P
�

����
�
Щ
�
��
��
 �
�
 �
@
��
p�
��
�
`�
0�
��
��
 �
@�
 �
P
�
p
����
�
Щ
�
��
0�
 �
@�
 �
��
��
�
��
�
�
 �
�
�
�
�
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
�
��
��
�
�@
�
�
�
��
 �
@
�
�

 �
`�
p�
�
�
�


��
 �
@
�
�

 �
`�
p�
�
�
 

�
��
 �
@
�
�
p
 �
0�
p�
�
p�
�
�

�
`�
p�
 �
�
Ш
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
 
�
�
P
�0 
 
�!
б
��
�
`�
0�
��
@�
 �
�
 �
'
�
�(
б
��
�
Щ
��
��
��
 �
�
 �
0 
�
�#
p�
��
�
`�
0�
��
��
 �
@�
 �
'
@%
�*
p�
��
�
Щ
��
��
0�
 �
@�
 �
@,
�5
�p3
@0
P0
@
��
�
0�
 �
0�
p�
�
p�
�
��
0;
�<
`�
p�
 �
�
Ш
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
�;
�:
�
P<
�D
�>
�E
б
��
�
`�
0�
��
@�
 �
�
 �
PJ
p@
�L
б
��
�
Щ
�
��
��
 �
�
 �
D
�B
`G
p�
��
�
`�
0�
��
��
 �
@�
 �
PJ
�H
0N
p�
��
�
Щ
�
��
0�
 �
@�
 �
�
p�
�
�Q
�P
`S
`�
p�
 �
����0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
@R
�O
�
S
�^
0T
�`
б
��
�
`�
0�
��
@�
 �
�
 �
 e
�V
h
б
��
�
Щ
�
��
��
 �
�
 �
^
�Y
�b
p�
��
�
`�
0�
��
��
 �
@�
 �
 e
�[
`j
p�
��
�
Щ
�
��
0�
 �
@�
 �
�
p�
�
��
Pm
�n
`�
p�
 �
�
Ш
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
0n
�l
�
�n
��t
�p
�u
б
��
�
`�
0�
��
@�
 �
�
 �
�y
�q
0{
б
��
�
Щ
�
��
��
 �
�
 �
�t
Ps
w
p�
��
�
`�
0�
��
��
 �
@�
 �
�y
`x
�|
p�
��
�
Щ
�
��
0�
 �
@�
 �
�
p�
�
��
�~
p�
`�
p�
 �
�
Ш
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
��
~
�
�
��
�
��
б
��
�
`�
0�
��
@�
 �
�
 �
P�
P�
��
��
��
�
Щ
�
��
��
 �
�
 �
�
��
�
p�
��
�
`�
0�
��
��
 �
@�
 �
P�
��
��
P
��
�
Щ
�
��
0�
 �
@�
 �
З
К
��
��
 �
��
��
�
��
P�
0�
p�
��
��
�
��
��
Л
 �
��
�
P�
��
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
�
��
��
�
���
�
��
��
��
��
 �
��
��
�
��
 �
`�
p�
��
�
p�
��
p�
��
 �
��
��
�
0�
 �
0�
p�
P�
��
��
�
��
�
P�
 �
��
�
P�
��
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
�
��
��
�
���
p�
�
@�
��
��
`�
p�
 �
�
Ш
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
��
 �
�
�
��
P�
@�
�
б
��
�
`�
0�
��
@�
 �
�
 �
 �
�б
��
�
Щ
��
��
��
 �
�
 �
P�
��
��
p�
��
�
`�
0�
��
��
 �
@�
 �
 `�p�
��
�
Щ
��
��
0�
 �
@�
 �
��
��
�
��
`� �
��
�
P�
��
0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
�
��
��
�
��@��
 �
��
��
�
��
 �
`�
p�
��

��
 �
��
��
�
0�
 �
0�
p�
j01�10��3��
���
 (P�
�
 �
j01 /0��3��
���
 (P�
@�
 �
j�01�@7��
���
�2P�
�
 �
j�0/�@,��
���
 (P�
@�
 �
jP@����
���
@P�
�
 �
jP@@����
���
@P�
@�
 �
j� �`#��
���
�P�
�
 �
j� �`��
���
@P�
@�
 �
�kp+`,�s0=��
���
�/P�
�
 �
�kp+0/�s0=��
���
�/P�
@�
 �
�k@+0,�s07��
���
�1P�
�
 �
�k@+/�sP4��
���
�/P�
@�
 �
�k�	`
����
���
�P�
�
 �
�k�	�����
���
�P�
@�
 �
�k@	p	P����
���
 P�
�
 �
�k@	pP����
���
�P�
@�
 �
Pj�| A��
���
�P�
�
 �
Pj�| A��
���
�P�
@�
 �
Pj���{�&��
���
P!P�
�
 �
Pj���{�#��
���
�P�
@�
 �
Pj���0�0���
���
��P�
�
 �
Pj���0�0���
���
��P�
@�
 �
Pjp�������
���
P�P�
�
 �
Pjp��������
���
��P�
@�
 �
jP�� �����
���
@�P�
�
 �
jP�@� �����
���
@�P�
@�
 �
j�� ��`���
���
��P�
�
 �
j�� ��`���
���
@�P�
@�
 �
j������0���
���
��P�
�
 �
j������0���
���
��P�
@�
 �
jp���`�����
���
P�P�
�
 �
jp���`�����
���
��P�
@�
 �
@bPb�M��
P^�^`�
P:p��^0``g�CpE�`p:�< ?�A�d0GPc�L@^pb��^�P���Є�r���
�`:��
p �
�
 �
�P����{���
 �`:��
P_ �
�
 �
P�0��0u���
�`:��
�b �
@�
 �
��p���}���
 �`:��
�� �
@�
 �
��`�����
 �`:��
�� �
@�
 �
^ ^`V��
V��`�
P:p��0zl�CpE�fp:�< ?�A�d0YPc0{pX�X������@���@����
�`:��
�V �
�
 �
@�����w���
@�`:��
�V �
�
 �
������ ����
�`:��
�� �
@�
 �
@���������
@�`:��
�� �
@�
 �
pR�R�U��
PU@w`�
P:p�`N�P`g�CpE�ep:�< ?�A�d0GPc�L�Q�Q�@w�����@�@����
�q`:��
@S �
�
 �
�����q���
�q`:��
@O �
�
 �
���p� ����
�q`:��
�S �
@�
 �
���p�`t���
�q`:��
`P �
@�
 �
pR�R�M��
�M�v`�
P:p�`N�P`g�CpE�ep:�< ?�A�d0GPc�L�Q�Q��v������@����
�q`:��
@S �
�
 �
����������
�q`:��
@O �
�
 �
��@��� ����
�q`:��
�S �
@�
 �
�@�����
�q`:��
`P �
@�
 �
�
p�
�
�� �`�`�
p�
 �
����0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
@����
�������б
��
�
`�
0�
��
@�
 �
�
 �
������б
��
�
Щ
�
��
��
 �
�
 �
������p�
��
�
`�
0�
��
��
 �
@�
 �
����0�p�
��
�
Щ
�
��
0�
 �
@�
 �
�
p�
�
��
@���`�
Po�q�5 30�
��
�
��p�
0�
��
��
��
 �
P�
0�
P����
���`I�8 O@����
`�
0�
��
@�
 �
�
 �
`]�C�bPn���
y����
�<P�
�
 �
`I@S ����
`�
0�
��
��
 �
@�
 �
`]Y`g`����
y����
p?P�
@�
 �
�
p�
�
��
�M��`�
0�P���0�
��
�
��
p�
0�
��
��
��
 �
P�
0�
P����
��0��
p�
`�0~���
�x�V��
�P�
@�
 �
�
p�
�
��
���`�
0�P���0�
��
�
��p�
0�
��
��
��
 �
P�
0�
��`��
��� ����
`�
0�
��
@�
 �
�
 �
`&�`- 2���
�x�V��
�P�
�
 �
�`	P`}���
`�
0�
��
��
 �
@�
 �
�� �z���
�x�V��
�P�
@�
 �
`&@#0*�y���
�x�V��
�P�
@�
 �
��xd���hd���pd���Ћ��
���
��
�
0�
 �
0�
p�
{���&>����X
xPhj[xj[���o��	`9
�w\�����2	���o���o����o�o�����o�,pt\�������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������&6FVfv��������  & 6 F V f v � � � � � � � � !!&!6!F!V!f!v!�!�!�!�!�!�!�!�!""&"6"F"V"f"v"�"�"�"�"�"�"�"�"##&#6#F#V#f#v#�#�#�#�#�#�#�#�#$$&$6$F$V$f$v$�$�$�$�$�$�$�$�$%%&%6%F%`r]@)��]�� R]��`0B]�
@�`��	\��]�(P��d�(��@b]`���������������P;�������q?vqI��h^�e�e��^T�\T�\�A8_��_�e�e�B8`���e�e��`meme��b�de�de	,��bR�\R�\'�Nc9�(c�e�eJ�cPc�e�eS�C�c�e�e\�dleleu�xdhehe��
�D��XeXe
��#�d���d�e�e��Te�e�e��0e@e@e	��he]]	ր�8e8e	��&�e�e�e	q�ff�e�e8�h�`e`e
'�H,��e�eA�iHf�e�eO�pf0e0e	a��fS�\S�\\�Lg��(g|e|en�Hg�e�e����gpepe@B����������G�g�e�e���h�e�e@  ��b���e�eЁo(i]��i	l�p�j	݁0kHeHe	�PXk�e�e��k�e�e�xl�e�e��l@e@e
]��l�]�]	�q(m�e�e ��mH�\H�\���������������7�r�m�e�e;�0nP�\P�\E�UXn�e�eR�U�n�e�e_��n�e�eg�o�e�es�Poxexe������������o	���o�e�e�����e�e��s�ob�S0ppepe
ƂXp�e�eʂ	�p�e�e	т
�p�e�e	܂q�e�e	�Hq�e�e	�pq�e�e	�� �q�e�e	�!�q�e�e	�r�e�e	�0r�e�e��t/��e�ee��r	G�nHs�e�eR�uhsPePe
W�v�sOV�s_�E�s�e�eh�w t��Xm��e�e��_���������������Ã�?P�҃��9C�|Ht�cpS�t=�r0z�tրd�n��el
�%�G�u)�qp=.�&�g0�PuqhP�H�[�n�Vpuc�t�Vi���w0��u]�P�e�u/p�����R�U����qp=Ä�#`vτ_�-��n�.��v�sБ@v�!nhve�T�k�vu{u�}�v8zWP��o���|��|y�|��|$��|*y�|3��|B��|N��|[��|Y��|���|\��|g��|m��|u��|��|��|���|���|���|���|:��|���|��|���|���|���|���|̅�|Ӆ�|ׅ�|ޅ�|��|��|���|p��|E��|�|�|��|���|��|��|��|��|��|��|��|#��|+��|q��|4��|:��|A��|��|z��|I��|Q��|W��|΋�|`��|g��|_��|m��|u��|��|���|���|���|đ�|���|���|���|���|ņ�|І�|ۆ�|��|��|��|���|���|��|	��|��|#��|5��|B��|1�9�|I��|R��|���|}�|:��|\��|e��|u��|���|���|���|
}�|���|���|���|���|���|ʇ�|ч�|և�|߇�|��|���|��|��|��|��|)��|ڑ�|}�|-��|2��|7��|@��|J��|R��|W��|\��|c��|j��|��|s��|z��|}�|���|���|���|���|���|���|���|���|���|ň�|Έ�|Ԉ�|و�|߈�|��|��|��|!}�|��|���|��|��|
��|��|��|��|#��|(��|1��|'}�|:��|M��|X��|_��|e��|l��|r��|z��|��|���|���|���|���|���|���|���|ȉ�|`��|Ӊ�|ډ�|7��|���|��|��|��|���|���|��|��|��|��|��|-��|2��|7��|<��|A��|F��|N��|W��|\��|;��|f��|p��|w��|��|���|��|���|���|���|���|���|���|���|���|���|���|���|���|ތ�|z��|Ɗ�|̊�|֊�|���|��|��|:}�|��|���|��|��|��|��|0��|<��|L��|[��|k��|w��|���|���|���|���|Ë�|Ջ�|��|��|���|��|$��|-��|B��|W��|^��|i��|s��|~��|D��|���|���|v��|���|���|���|���|Č�|Ɍ�|Ҍ�|C��|ٌ�|��|��|��|���|��|
��|��|��|$��|(��|-��|0��|5��|9��|��|L��|T��|]��|d��|���|1��|q��|v��|��|���|��|���|��|���|���|���|���|h��|���|���|���|���|Ǎ�|ύ�|ԍ�|܍�|��|��|���|��|���|��|��|Z��|��|��|"��|*��|4��|?��|F��|U��|c��|p��|x��|��|���|���|���|���|���|���|���|���|Ɏ�|Ҏ�|َ�|��|��|��|���|���|��|��|%��|1��|��|��|$��|.��|5��|I��|=��|P��|Y��|���|`��|j��|q��|~��|���|���|���|���|��|U��|���|���|���|���|���|���|ŏ�|͏�|}��|֏�|��|��|���|��|��|"��|6��|C��|T��|_��|n��|}��|���|���|���|���|���|���|ΐ�|Ԑ�|ݐ�|��|��|��|s��|���|��|��|��|���|��|$��|/��|9��|C��|���|N��|���|ۊ�|S��|`��|n��|w��|��|Y��|���|���|���|���|���|���|�|���|‘�|Α�|ؑ�|ݑ�|��|��|��|���|��|
��|��|��|��|%��|���|)��|8��|@��|F��|O��|X��|j��|f��|m��|U��|w��|���|���|���|N��|���|���|���|���|���|���|ć�|���|h��|Ē�|D��|ǒ�|Ғ�|ے�|ߒ�|��|��|��|��|��|��|��|��|&��|,��|2��|7��|=��|G��|K��|U��|\��|d��|l��|q��|v��|~��|���|���|���|���|���|י�|ɕ�|œ�|ϓ�|ݓ�|��|O��|��|��|��|���|���|��|��|��|!��|-��|6��|>��|I��|S��|]��|d��|l��|x��|���|��|���|���|���|���|���|���|���|���|B��|ǔ�|Ҕ�|ؔ�|��|���|+��|��|��|��|��|��|"��|3��|C��|^��|x��|���|���|���|���|���|Õ�|Е�|���|��|��|��|���|��|	��|��|��|#��|*��|7��|D��|S��|\��|e��|p��|v��|���||��|B��|P��|���|���|��|���|H��|���|���|���|���|���|���|���|���|���|і�|��|��|��|���|��|��| ��|+��|5��|9��|=��|A��|O��|\��|k��|y��|���|���|���|���|͗�|��|��|��|��|&��|*��|1��|?��|P��|Z��|g��|m��|��|k��|v��|���|җ�|��|���|z��|���|���|��|���|���|���|���|���|���|���|���|ǘ�|͘�|ט�|ܘ�|��|��|���|��|��|��|��|��|��|)��|��|$��|)��|4��|8��|?��|J��|V��|b��|i��|p��|z��|���|\��|���|���|3��|���|���|���|Ǚ�|#��|���|ϙ�|ՙ�|��|��|֕�|���|	��|��|��|��|%��|.��|6��|>��|.��|�z�|<��|I��|�|R��|��9�������}Ě�}ɚڤ0�ByК�"�"�"�"�"�"�"�"`#P>#����Љ# #0#P#p#�#�#� Z@`p<PW0)-@�PaPp0�@r `r�`�0���0���@"�`P"`"`��Щ�� %' X�j�!"0"P @!  0<0X�#$$P<�Y0$ $��p"@$`)0? )>PK	p?�2 <P$P`�����%``�0 �#��P�`�@%`(@�`0@0�P��@�p�(��`s�pP��h���k�h��P	���p��P���/�,@]@���3]x3]d�eb�S�fl�����hR�O�g8�i
�j��kx��܂ʂт�������n���������'n�(��	]�
çlۧm�m��g��;�݁��Y�Z&�Z2�[=�]�#L�^�&k�rw���H�iσe��g��f��Y��Z������ȨϨڨ��[��&��rw�*$���������«ʫ���`~q��o�#�ſt[Am-�j�d�8n헧��?�O>�.	���8/�t#�����ڰͼ3�&�N|.�[�Ӿr��؇/�P�kpnJ�ؕ�nq�&�fƭ$6Z�B<T�c�sU��e�(�U��܀��n����_�S�$]�$]�$]�$]�$]�$]

�$]�&] ']�'](]�I�$�:�p	�?�Z�:��	���8�:��$	h�\�j�:�&	�%	@&	�&	e��\���:��&	�&	`(]`0	�&	p,	@(	 -	�+	�)	�*	�0	p(	�'	`'	'	0'	 )	p+	�(	���������������������-�4�;�E�K�K�дV�a�K�дV�V�K�дV�k�K�дV�t�t�������t�������t�������t�������������ǵ��������������ҵ������ܵܵ����ܵ���ܵ���ܵ������(��������2����;�;�F�M�X�;�F�M�M�;�F�M�b�;�F�M�k�k�v�}���k�v�}�}�k�v�}���k�v�}�������������������������ĶĶ϶ڶĶ϶϶Ķ϶�Ķ϶�������������
����
������� �%�/� �4�%�/� �>�G�P�W�P�G�P�W�^�g�^�p�z�g�^�p�������������������÷ʷзշзڷ������������÷��÷�"��"�&�1�:�B�ߴN�ߴS�Y�N�ߴS� <@��[ht[�o[�w[`������0�X��������(�x�����������(�h���8����������|8��|l���x�������0�&�?�O�i�{�p��������P������|�|�|�|�|�����|�|������|�8��6�`��|�|�|�|�|�|�|�|L��|���|�|���|��(�`������@�p��|f����_p�	���� 7]@�
'ByT���@@
��:]��e��9��e����e"��e2��eC���eN���eY���en���e����e����e����e���e���e���e���e���e&���e1���eF���eW���ee���es���e����e����e����e���e����e���e���e��`~
@���|@;]��
��
��e������@�
���~P�
����0�
0�
�|�;]-����� <]�
��
��
��
��
е
�
0�
�
�
 �
�
0�
�
@�
�
P�
 �
`�
p�
�
��
��
��
��
��
��
0�
 �
б
�
�
@�
�
�
�
��
 �
P�
0�
��
@�
P�
`�
��
и
�
��
p�
��
��
`�
��
p�
��
��
��
��
��
ж
��
�
в
�
�
�
�
@�
@�
��
�
 �
0�
`�
@�
P�
`�
P�
��
��
��
��
��
��
з
�
�
�
P�
`�
p�
��
`�
p�
�
p�
`�
p�
�
��
�
�
�
 �
��
��
0�
д
��
0�
��
г
P�
�
��
�
�
�
�
@�
�
 �
 �
��
0�
@�
��
P�
0�
`�
 �
@�
p�
�
P�
��
��(�P�x�������|�\`��������(�X�z����P�����H������@h��(`�����]њ`�`�`��%`�`�`����~ �`�`� �`�`�`�`�P�`��� 1p��.`��(`��(`�`�`�@`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`���`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`��%��"� �.� �P���p�P�`��� 1p��.�(@�p��@;�&�%P��9��`� ) ) ) ) ) ) ) ) )�9�%�'�" 0P/0%�9��'�`)�?�?�9�9#�6P2�%p9P A'�" 0P/0%�9��%P�����@�`)�=�?�9@#03P2�*4�"��@:��@=�>�����������������������������������������������������=�-�"�,�кк�9�3�~����p�`#P�� +��������������������0�@��@����������������������������������������������������0� + �p�-��`��0��9��P�@)`#�,����0����"���~ �.� �P���p�P�`��� 1p��.@b]�(`r]��@:`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`���`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�i�A�E d�L@
C
��A�������?����^!^iГ]�]0���9+.���� �@�@��0A�A��0B�B��0C�C��0D�D��0E�E��0F�F��0G�G��0H�H��0I�I��0J�J��0K�K��0L�L��0M�M��0N�N��0O�O��0P�P��0Q�Q��0R�R��0S�S��0T�T��0U�U��0V�V��0W�W��0X�X��0Y�Y��0Z�Z��0[�[��0\�\��0]�]��0^�^��0_�_��0`�`��0a�a��0b�b��0c�c��0d�d��0e�e��0f�f��0g�g��0h�h��0i�i��0j�j��0k�k��0l�l��0m�m��0n�n��0o�o��0p�p��0q�q��0r�r��0s�s��0t�t��0u�u��0v�v��0w�w��0x�x��0y�y��0z�z��0{�{��0|�|��0}�}��0~�~��0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0�����0��������������������������������������������#����$����%����&����'����(����)����*����+����,����-����.����/����0����1����2����3����4����5����Q����6����7����8����9����:����;����<����=����>����?����@����A����B����C����D����E����F����G����H����I����J����K����L����M����N����O����`$����a$����b$����c$����d$����e$����f$����g$����h$����i$����t$����u$����v$����w$����x$����y$����z$����{$����|$����}$����?����?�@�W��A�X��B�Y��C�Z�D�\��E�]��F�^��G�_��H�`��I�a��J�b��K�c��L�d��M�e��N�f��O�g��P�h��Q�i��R�j��S�k��T�l��U�m��V�n��W�o��X�p��Y�q��Z�r��[�s��D�\��E�]��F�^��G�_��H�`��I�a��J�b��K�c��L�d��M�e��N�f��O�g��P�h��Q�i��R�j��S�k��T�l��U�m��V�n��W�o��X�p��Y�q��Z�r��[�s��t�t�1u�u�1v�v�1w�w�1x�x�	1y�y�
1z�z�1{�{�1|�|�
1}�}�1~�~�1����1����1����1����1����1����1����1����1����1����1����1����1����1����1����1����1���� 1����!1����"1����#1����$1����%1����&1����'1����(1����)1�����������������������������?����?££?ãã?ģģ?ţţ?ƣƣ?ǣǣ?ȣȣ?ɣɣ?ʣʣ?ˣˣ?̣̣?ͣͣ?ΣΣ?ϣϣ?УУ?ѣѣ?ңң?ӣӣ?ԣԣ?գգ?֣֣?ףף?أأ?٣٣?ڣڣ?ۣۣ?ܣܣ?ݣݣ?ޣޣ?ߣߣ?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?����?����?@�@���A�A��B�B�<�C�C��D�D��E�E�0F�F��G�G��H�H��I�I� �J�J�!K�K�	!L�L�i�M�M�j�N�N�k�O�O��3P�P��3Q�Q��3R�R��3S�S��3T�T��3U�U��3V�V��3W�W��3X�X��Y�Y�YQZ�Z�[Q[�[�^Q\�\�]Q]�]�aQ^�^�cQ_�_��U`�`��ta�a��|b�b��%c�c��%d�d��%e�e��%f�f��%g�g��%h�h��%i�i��%j�j��%k�k��%l�l��%m�m��%n�n��%o�o��%p�p��%q�q�<%r�r�4%s�s�,%t�t�$%u�u�%v�v��%w�w�%x�x�%y�y��%z�z�%{�{�%|�|�%}�}�%~�~�m%����n%����p%����o%����P%����^%����j%����a%�����%�����%�����%�����%����q%����r%����s%������������������������������������������������������`!����a!����b!����c!����d!����e!����f!����g!����h!¢¢i!ââ!0ĢĢ"0ŢŢ#0ƢƢ$0ǢǢ%0ȢȢ&0ɢɢ'0ʢʢ(0ˢˢ)0̢̢��͢͢DS΢΢��Ϣ�!�Т�"�Ѣ�#�Ң�$�Ӣ�%�Ԣ�&�բ�'�֢�(�ע�)�آ�*�٢�+�ڢ�,�ۢ��-�ܢ��.�ݢ��/�ޢ��0�ߢ��1����2����3����4����5����6��@�7��A�8��B�9��C�:�Ϣ�A�Т�B�Ѣ�C�Ң�D�Ӣ�E�Ԣ�F�բ�G�֢�H�ע�I�آ�J�٢�K�ڢ�L�ۢ��M�ܢ��N�ݢ��O�ޢ��P�ߢ��Q����R����S����T����U����V�TA{���|@z@y@x��[�� �.\�/\AA{���|@z@y@x@w��[� �.\`0\TA{@��|@z@y@x��[�� �.\�0\aA{��|@z@y@x@w��[� �.\`1\ �] �] �]?1a}
��|`|`{`{�s\��1\�2\J�@�p!K�A�q!L�B�r!M�C�s!N�D�t!O�E�u!P�F�v!Q�G�w!R�H�x!S�I�y!J�@�`!K�A�a!L�B�b!M�C�c!N�D�d!O�E�e!P�F�f!Q�G�g!R�H�h!S�I�i!T�T��U�U��V�V��W�W��X�X�12Y�Y�!Z�Z�!![�[�5"\�\��~]�]��^�^�H�_�_���`�`�܄a�a��Ob�b��pc�c�1fd�d��he�e���f�f��fg�g�E_h�h�(Ni�i��Nj�j��Nk�k�Ol�l�Om�m�9On�n�VOo�o��Op�p��Oq�q��Or�r��Os�s��Ot�t�@Pu�u�"Pv�v��Ow�w�Px�x�FPy�y�pPz�z�BP{�{��P|�|��P}�}��P~�~�JQ����dQ�����Q�����Q�����Q����R�����R�����R�����R�����R����S����S����$S����rS�����S�����S�����S����������T�����T�����T�����T�����U����YW����eW�����W�����W�����W���������������X�����X����Y����SY����[Y����]Y����cY�����Y�����Y����V[�����[����/u�����[�����[����\�����\�����\�����\����']����S]���������B]����m]�����]�����]�����]����!_����4_����g_�����_�����_����]`�����`�����`�����`�����`���� a���`��a��7a��0a���a��b���b���c��`d���d���d��Ne��f��f��;f��	f��.f��f��$f��ef��Wf��Yf�����sf���f���f���f���f���f��g��)���fg���g��Rh���g��h��Dh���h�����hi������i���i��0j��kj��Fj��sj��~j���j���j���k����?l����\l�����l����ol�����l����m�����m����om@�@��rA�A�$sB�B��C�C�wsD�D��sE�E��sF�F��sG�G��sH�H��sI�I�tJ�J��sK�K�&tL�L�*tM�M�)tN�N�.tO�O�btP�P��tQ�Q��tR�R�uS�S�ouT�T��vU�U��vV�V��vW�W��vX�X��vY�Y��Z�Z�Fw[�[��R\�\�!x]�]�Nx^�^�dx_�_�zx`�`�0ya�a��b�b��c�c��d�d��ye�e��f�f��yg�g��zh�h��zi�i��j�j��zk�k��{l�l��m�m�H}n�n�\}o�o��}p�p��}q�q��}r�r�R~s�s�Gt�t��u�u��v�v��w�w�b�x�x��y�y�ǃz�z���{�{�H�|�|���}�}�S�~�~�Y�����k���������������� �����!���������������������7�����y�����������������ߊ����"�����������S�������������������������v�����#�����ώ����$�����%�����g�����ސ����&����������'�����ڑ����ב����ޑ����������������������������������
�����:�����@�����<�����N�����Y�����Q�����9�����g�����������w�����x����������ג����ْ����В����'�����Ւ���������Ӓ����%�����!�����������(��������������������������p�����W�����������Ɠ����ޓ����������1�����E�����H����������������)�����������������3�����;�����C�����M�����O�����Q�����U�����W�����e�����*�����+�����'�����,�����������N�����ٚ����ܚ����u�����r����������������������������p�����k�����-����������ў����?����?T���p!U���q!V���r!W���s!X���t!Y���u!Z���v![���w!\���x!]���y!��������������������@�@�`$A�A�a$B�B�b$C�C�c$D�D�d$E�E�e$F�F�f$G�G�g$H�H�h$I�I�i$J�J�j$K�K�k$L�L�l$M�M�m$N�N�n$O�O�o$P�P�p$Q�Q�q$R�R�r$S�S�s$T���`!U���a!V���b!W���c!X���d!Y���e!Z���f![���g!\���h!]���i!^�^�?_�_�I3`�`�3a�a�"3b�b�M3c�c�3d�d�'3e�e�3f�f�63g�g�Q3h�h�W3i�i�
3j�j�&3k�k�#3l�l�+3m�m�J3n�n�;3o�o��3p�p��3q�q��3r�r��3s�s��3t�t��3u�u��3v�v�?w�w�?x�x�?y�y�?z�z�?{�{�?|�|�?}�}�?~�~�{3����0����0����!�����3����!!�����2�����2�����2�����2�����2����12����22����92����~3����}3����|3����R"����a"����+"����."����"����"�����"���� "����"�����"����5"����)"����*"����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?‡‡?ÇÇ?ćć?ŇŇ?ƇƇ?LJLJ?ȇȇ?ɇɇ?ʇʇ?ˇˇ?̇̇?͇͇?··?χχ?ЇЇ?чч?҇҇?ӇӇ?ԇԇ?ՇՇ?ևև?ׇׇ?؇؇?هه?ڇڇ?ۇۇ?܇܇?݇݇?އއ?߇߇?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?@�p�A�q�B�r�C�s�D�t�E�u�F�v�G�w�H�x�I�y�J�z�K�{�L�|�M�}�N�~�O���P���Q��� R���!S���"T���#U���$V���%W���&X���'Y���(Z���)[���*\���+]���,^���-_���.`���/a�a�?b�b�?c�c�?d�d�?e�e�?f�f�?g�g�?h�h�?i�i�?j�j�?k�k�?l�l�?m�m�?n�n�?o�o�?@�p�0A�q�1B�r�2C�s�3D�t�4E�u�5F�v�QG�w�6H�x�7I�y�8J�z�9K�{�:L�|�;M�}�<N�~�=O���>P���?Q���@R���AS���BT���CU���DV���EW���FX���GY���HZ���I[���J\���K]���L^���M_���N`���O����?����?����?����?����?����?����?����?����?����?����?����?����?����%����%����%����%����%����%����%����,%����$%����4%����<%����%����%����%����%����%����%����#%����3%����+%����;%����K%���� %����/%����(%����7%����?%����%����0%����%%����8%����B%����?����?����?„„?ÄÄ?ĄĄ?ńń?ƄƄ?DŽDŽ?ȄȄ?ɄɄ?ʄʄ?˄˄?̄̄?̈́̈́?΄΄?ττ?ЄЄ?фф?҄҄?ӄӄ?ԄԄ?ՄՄ?քք?ׄׄ?؄؄?لل?ڄڄ?ۄۄ?܄܄?݄݄?ބބ?߄߄?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?@�@��0A�A��0B�B��0C�C��0D�D��0E�E��0F�F��0G�G��0H�H��0I�I��0J�J��0K�K��0L�L��0M�M��0N�N��0O�O��0P�P��0Q�Q��0R�R��0S�S��0T�T��0U�U��0V�V��0W�W��0X�X��0Y�Y��0Z�Z��0[�[��0\�\��0]�]��0^�^��0_�_��0`�`��0a�a��0b�b��0c�c��0d�d��0e�e��0f�f��0g�g��0h�h��0i�i��0j�j��0k�k��0l�l��0m�m��0n�n��0o�o��0p�p��0q�q��0r�r��0s�s��0t�t��0u�u��0v�v��0w�w��0x�x��0y�y��0z�z��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����?����?����?����?����?����?����?����?�����������������ƒ���Ã���ă���Ń���ƃ���ǃ���ȃ���Ƀ���ʃ���˃���̃���̓���΃���σ���Ѓ���у���҃���Ӄ���ԃ���Ճ���փ�����?����?����?����?����?����?����?����?�����������������ƒ���Ã���ă���Ń���ƃ���ǃ���ȃ���Ƀ���ʃ���˃���̃���̓���΃���σ���Ѓ���у���҃���Ӄ���ԃ���Ճ���փ�׃׃?؃؃?كك?ڃڃ?ۃۃ?܃܃?݃݃?ރރ?߃߃?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?@�@�?A�A�?B�B�?C�C�?D�D�?E�E�?F�F�?G�G�?H�H�?I�I�?J�J�?K�K�?L�L�?M�M�?N�N�?O�O��P�P��Q�Q��R�R��S�S��T�T��U�U��V�V��W�W��X�X��Y�Y�?Z�Z�?[�[�?\�\�?]�]�?^�^�?_�_�?`���!�a���"�b���#�c���$�d���%�e���&�f���'�g���(�h���)�i���*�j���+�k���,�l���-�m���.�n���/�o���0�p���1�q���2�r���3�s���4�t���5�u���6�v���7�w���8�x���9�y���:�z�z�?{�{�?|�|�?}�}�?~�~�?����?`���A�a���B�b���C�c���D�d���E�e���F�f���G�g���H�h���I�i���J�j���K�k���L�l���M�m���N�n���O�o���P�p���Q�q���R�r���S�s���T�t���U�u���V�v���W�w���X�x���Y�y���Z�����?����?����?����?����A0����B0����C0����D0����E0����F0����G0����H0����I0����J0����K0����L0����M0����N0����O0����P0����Q0����R0����S0����T0����U0����V0����W0����X0����Y0����Z0����[0����\0����]0����^0����_0����`0����a0����b0����c0‚‚d0ÂÂe0ĂĂf0łłg0ƂƂh0ǂǂi0ȂȂj0ɂɂk0ʂʂl0˂˂m0̂̂n0͂͂o0΂΂p0ςςq0ЂЂr0ттs0҂҂t0ӂӂu0ԂԂv0ՂՂw0ււx0ׂׂy0؂؂z0قق{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��?��?��?����?����?����?����?����?����?����?����?@�@�0A�A�0B�B�0C�C��D�D��E�E��0F�F��G�G��H�H��I�I��J�J��0K�K��0L�L��M�M�@�N�N��O�O�>�P�P��Q�Q�?�R�R��0S�S��0T�T��0U�U��0V�V�0W�W��NX�X�0Y�Y�0Z�Z�0[�[��0\�\� ]�]� ^�^��_�_�<�`�`�^�a�a�%"b�b�\�c�c�& d�d�% e�e� f�f� g�g� h�h� i�i��j�j�	�k�k�0l�l�0m�m�;�n�n�=�o�o�[�p�p�]�q�q�0r�r�	0s�s�
0t�t�0u�u�0v�v�
0w�w�0x�x�0y�y�0z�z�0{�{��|�|�
�}�}��~�~����������������`"��������������f"����g"����"����4"����B&����@&���������2 ����3 ����!���������������������������������������
����� ����������&����&�����%�����%�����%�����%�����%�����%�����%�����%�����%�����%�����%����; ����0�����!�����!�����!�����!����0����?����?����?����?����?����?����?����?����?����?����?����"����"�����"�����"�����"�����"����*"����)"����?����??ÁÁ?āā?ŁŁ?ƁƁ?ǁǁ?ȁȁ'"ɁɁ("ʁʁ�ˁˁ�!́́�!́́"΁΁"ρρ?ЁЁ?сс?ҁҁ?ӁӁ?ԁԁ?ՁՁ?ցց?ׁׁ?؁؁?فف?ځځ "ہہ�"܁܁#݁݁"ށށ"߁߁a"��R"��j"��k"��"��="��"��5"��+"��,"��?��?��?��?��?��?��?��+!��0 ��o&��m&��j&����  ����! ���������?����?����?����?�����%`�����|����~�[�� `4\`5\_A�����|����~�}�[�� `4\�5\`����	�|����~�[�� `4\`6\_a��:��|����~�}�[�� `4\�6\�^�^��]��]��]��]��]Ah�9x��|���������� �[�s\� `F\`7\@�@�?A�A���B�B���C�C��D�D��E�E��F�F��G�G��H�H��I�I��J�J�
�K�K��L�L�
�M�M��N�N��O�O��P�P��Q�Q��R�R��S�S��T�T��U�U��V�V��W�W��X�X��Y�Y��Z�Z� �[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�!�b�b�"�c�c�#�d�d�%�e�e�&�f�f�'�g�g�)�h�h�*�i�i�+�j�j�-�k�k�.�l�l�/�m�m�0�n�n�1�o�o�2�p�p�3�q�q�4�r�r�5�s�s�6�t�t�7�u�u�8�v�v�:�w�w�;�x�x�<�y�y�=�z�z�>�{�{�?|�|�?}�}�?~�~�?��?����?����?�����@�����A�����B�����C�����D�����E�����F�����G�����H�����I�����J�����K�����L�����M�����N�����O�����P�����Q�����R�����S�����T�����U�����V�����W�����X�����Y�����Z�����[�����]�����^�����_���Ѭ��Ҭ��Ӭ��Ԭ��լ��֬��׬��ج��٬��ڬ��۬��ܬ��ݬ��ެ��߬��������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/¬¬?ìì?ĬĬ?ŬŬ?ƬƬ?ǬǬ?ȬȬ?ɬɬ?ʬʬ?ˬˬ?̬̬?ͬͬ?άά?ϬϬ?ЬЬ?��Ѭ0��Ҭ1��Ӭ2��Ԭ3��լ4��֬5��׬Q��ج6��٬7��ڬ8��۬9��ܬ:��ݬ;��ެ<��߬=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O��?��?��?����?����?����?����?����?����?����?����?����?����?����?@�@�?A�A���B�B���C�C���D�D���E�E���F�F���G�G���H�H���I�I���J�J���K�K���L�L���M�M���N�N���O�O���P�P���Q�Q���R�R���S�S���T�T���U�U���V�V���W�W���X�X���Y�Y���Z�Z���[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a���b�b���c�c���d�d���e�e���f�f���g�g���h�h���i�i���j�j���k�k���l�l���m�m���n�n���o�o���p�p���q�q���r�r���s�s���t�t���u�u���v�v���w�w���x�x���y�y���z�z���{�{�?|�|�?}�}�?~�~�?��?����?�������������������������������������������������������������������	�����
�������������������������������������������������������������������������������� �����#�����$�������������������'I��1����3����8����@����B���������S��������������g����K����I����2����2����2����2����2����2����2����2����2����	2����
2����2����2����
2����2����2����2©©2éé2ĩĩ2ũũ2ƩƩ2ǩǩ2ȩȩ2ɩɩ2ʩʩ2˩˩2̩̩2ͩͩ�$ΩΩ�$ϩϩ�$ЩЩ�$ѩѩ�$ҩҩ�$өө�$ԩԩ�$թթ�$֩֩�$שש�$ةة�$٩٩�$کک�$۩۩�$ܩܩ�$ݩݩ�$ީީ�$ߩߩ�$���$���$���$���$���$���$���$��t$��u$��v$��w$��x$��y$��z$��{$��|$��}$��~$��$���$���$�����$�������������������t ���� ����� ����� ����� ����� ����?@�@�?A�A�m�B�B�n�C�C�o�D�D�p�E�E�q�F�F�r�G�G�s�H�H�t�I�I�u�J�J�v�K�K�w�L�L�z�M�M�{�N�N�|�O�O�}�P�P�~�Q�Q��R�R���S�S���T�T���U�U���V�V���W�W���X�X���Y�Y���Z�Z���[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a���b�b���c�c���d�d���e�e���f�f���g�g���h�h���i�i���j�j���k�k���l�l���m�m���n�n���o�o���p�p���q�q���r�r���s�s���t�t���u�u���v�v���w�w���x�x���y�y���z�z���{�{�?|�|�?}�}�?~�~�?��?����?�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������&����?����2����?����?����A���������R��������������f����J����?����`2����a2����b2����c2����d2����e2����f2����g2����h2����i2����j2����k2����l2����m2����n2����o2����p2¨¨q2èèr2ĨĨs2ŨŨt2ƨƨu2ǨǨv2ȨȨw2ɨɨx2ʨʨy2˨˨z2̨̨{2ͨͨ�$ΨΨ�$ϨϨ�$ШШ�$ѨѨ�$ҨҨ�$ӨӨ�$ԨԨ�$ըը�$֨֨�$רר�$بب�$٨٨�$ڨڨ�$ۨۨ�$ܨܨ�$ݨݨ�$ިި�$ߨߨ�$���$���$���$���$���$���$���$��`$��a$��b$��c$��d$��e$��f$��g$��h$��i$��j$��k$��l$��m$����n$���������S!����T!��������������[!����\!����]!����^!����?@�@�?A�A��B�B��C�C�
�D�D��E�E��F�F��G�G��H�H��I�I��J�J��K�K��L�L��M�M��N�N��O�O��P�P��Q�Q��R�R��S�S�"�T�T�#�U�U�$�V�V�%�W�W�&�X�X�'�Y�Y�(�Z�Z�)�[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�*�b�b�+�c�c�,�d�d�-�e�e�.�f�f�/�g�g�0�h�h�1�i�i�2�j�j�3�k�k�4�l�l�5�m�m�6�n�n�7�o�o�8�p�p�9�q�q�:�r�r�;�s�s�<�t�t�=�u�u�>�v�v�?�w�w�@�x�x�B�y�y�C�z�z�D�{�{�?|�|�?}�}�?~�~�?��?����?����E�����F�����G�����J�����K�����M�����N�����O�����Q�����R�����S�����T�����U�����V�����W�����Z�����[�����\�����^�����_�����`�����a�����b�����c�����e�����f�����g�����h�����i�����j�����k�����l������3�����3�����3����!�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3�����3§§�3çç�3ħħ�3ŧŧ�3ƧƧ�3ǧǧ�3ȧȧ�3ɧɧ�3ʧʧ�3˧˧�3̧̧�3ͧͧ�3ΧΧ�3ϧϧ�3ЧЧ�3ѧѧ�3ҧҧ�3ӧӧ�3ԧԧ�3էէ�3֧֧�3קק�3اا�3٧��&!ڧڧ�3ۧۧ�3ܧܧ�3ݧݧ�3ާާ�3ߧߧ�3���3���3���3���3���3���3���3���3���3���3���3���3���3���3���3���3��?��?��?��?��?����?����?����?����?����?����?����?����?����?����?����?@�@�?A�A�G�B�B�H�C�C�I�D�D�J�E�E�K�F�F�N�G�G�O�H�H�Q�I�I�R�J�J�S�K�K�U�L�L�V�M�M�W�N�N�X�O�O�Y�P�P�Z�Q�Q�[�R�R�^�S�S�b�T�T�c�U�U�d�V�V�e�W�W�f�X�X�g�Y�Y�i�Z�Z�j�[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�k�b�b�l�c�c�m�d�d�n�e�e�o�f�f�p�g�g�q�h�h�r�i�i�s�j�j�t�k�k�u�l�l�v�m�m�w�n�n�x�o�o�y�p�p�z�q�q�{�r�r�|�s�s�~�t�t��u�u���v�v���w�w���x�x���y�y���z�z���{�{�?|�|�?}�}�?~�~�?��?����?����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������p!����q!����r!����s!����t!����u!����v!����w!����x!����y!����?����?����?����?����?����`!����a!����b!����c!����d!����e!����f!����g!����h!����i!����?����?����?����?����?����?����?����¥��å��ĥ��ť��ƥ��ǥ��ȥ��ɥ��ʥ��˥��̥��ͥ��Υ��ϥ��Х��ѥ��ҥ��ӥ��ԥ��ե���֥���ץ���إ���٥٥?ڥڥ?ۥۥ?ܥܥ?ݥݥ?ޥޥ?ߥߥ?��?����¥��å��ĥ��ť��ƥ��ǥ��ȥ��ɥ��ʥ��˥��̥��ͥ��Υ��ϥ��Х��ѥ��ҥ��ӥ��ԥ��ե���֥���ץ���إ�������?����?����?����?����?����?����?@�@�?A�A�q�B�B�r�C�C�s�D�D�u�E�E�v�F�F�w�G�G�x�H�H�y�I�I�z�J�J�{�K�K�}�L�L�~�M�M��N�N���O�O���P�P���Q�Q���R�R���S�S���T�T���U�U���V�V���W�W���X�X���Y�Y���Z�Z���[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a���b�b���c�c���d�d���e�e���f�f���g�g���h�h���i�i���j�j���k�k���l�l���m�m���n�n���o�o���p�p���q�q���r�r���s�s���t�t���u�u���v�v���w�w���x�x���y�y���z�z���{�{�?|�|�?}�}�?~�~�?��?����?��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�����
���������������
����������������������������������������������������������������������������������������������� ����!�£�"�ã�#�ģ�$�ţ�%�ƣ�&�ǣ�'�ȣ�(�ɣ�)�ʣ�*�ˣ�+�̣�,�ͣ�-�Σ�.�ϣ�/�У�0�ѣ�1�ң�2�ӣ�3�ԣ�4�գ��5�֣��6�ף��7�أ��8�٣��9�ڣ��:�ۣۣ;�ܣܣ�ݣݣ=�ޣޣ>�ߣߣ?���@����A�£�B�ã�C�ģ�D�ţ�E�ƣ�F�ǣ�G�ȣ�H�ɣ�I�ʣ�J�ˣ�K�̣�L�ͣ�M�Σ�N�ϣ�O�У�P�ѣ�Q�ң�R�ӣ�S�ԣ�T�գ��U�֣��V�ף��W�أ��X�٣��Y�ڣ��Z�����[�����\�����]����������?Ua����|`�`�`���[�� �7\�8\a����|`�`�`�`���[�� �7\`9\Ua�I�	�|`�`�`���[�� �7\�9\!a�4��|`�`�`�`���[�� �7\`:\�`^�T^�H^�<^�0^�$^����?����b!����c!����d!����e!����f!����g!����h!����i!��������������12����!����!!�����p�����N�����P�����Q����S����$S����������T����YW���������������X�����[�����\����S]����������_�����`���� a����Ne����;f����ef���������)�����h��������������kj�����j�����m�����m����(p��������������u�����v�����v���������0y�������������������������z���������������}�����}���������b���������������� �����!����������"���������������v�����#�����$�����%�����ސ����&����������'�����(����������������)�����;�����M�����Q�����*�����+�����,�����������ٚ����r�����-�����ў����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����p!����q!����r!����s!����t!����u!����v!����w!����x!����y!����`!����a!����?������?�������������������������������������������������������������������������������	������
������������������������������������������������������������������������������������������������?������!������%���������������������ª�«��ê�ë��ī�ī�?Ū�ū�+ƪ�ƫ�/Ǫ�ǫ�)Ȫ�ȫ�5ɪ�ɫ�7ʪ�ʫ�:˪�˫�>̪�̫�<ͪ�ͫ�DΪ�Ϋ�HϪ�ϫ�FЪ�Ы��Ѫ�ѫ��Ҫ�ҫ��Ӫ�ӫ��Ԫ�ԫ��ժ�ի��֪�֫�Qת�׫�Mت�ث��٪�٫�Uڪ�ګ�Y۪�۫�Wܪ�ܫ�[ݪ�ݫ�]ު�ޫ�aߪ�߫�_એ૏e᪏᫏c⪏⫏�㪏㫏�䪏䫏�媏嫏�檏櫏m窏竏�誏諏q骏髏kꪏ꫏s몏뫏o쪏쫏i����摒𢡊������u��������w������z������~������|������?������?������?������?������?������?������?������?������?��������������������������������������������������������������������������������������������������
����������������������������������������������������������������?������������������"������ ������$���������������������ª�«��ê�ë��Ī�i0Ū�ū�*ƪ�ƫ�.Ǫ�ǫ�(Ȫ�ȫ�4ɪ�ɫ�6ʪ�ʫ�9˪�˫�=̪�̫�;ͪ�ͫ�CΪ�Ϋ�GϪ�ϫ�EЪ�Ы��Ѫ�ѫ��Ҫ�ҫ��Ӫ�ӫ��Ԫ�ԫ��ժ�ի��֪�֫�Pת�׫�Lت�ث��٪�٫�Tڪ�ګ�X۪�۫�Vܪ�ܫ�Zݪ�ݫ�\ު�ޫ�`ߪ�߫�^એ૏d᪏᫏b⪏⫏�㪏㫏�䪏䫏�媏嫏�檏櫏l窏竏�誏諏p骏髏jꪏ꫏r몏뫏n쪏쫏h����摒𢡊������t�����x��v������y������}������{������?������?������?������?������?������?������?������?������?����������©�������?���ĩ�&������?���Ʃ�2������?���ȩ�A���ɩ�?������?���˩�J���̩�����ͩ�R������?���ϩ�f���Щ��������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?����������©�é�é�����ĩ�'Iũ�1���Ʃ�3ǩ�ǩ�8���ȩ�B���ɩ�@ʩ�ʩ�I���˩�K���̩�����ͩ�SΩ�Ω�����ϩ�g���Щ��ѩ�ѩ�?ҩ�ҩ�?ө�ө�?ԩ�ԩ�?թ�թ�?֩�֩�?ש�ש�?ة�ة�?٩�٩�?ک�ک�?۩�۩�?ܩ�ܩ�?ݩ�ݩ�?ީ�ީ�?ߩ�ߩ�?੏੏?ᩏᩏ?⩏⩏?㩏㩏?䩏䩏?婏婏?橏橏?穏穏?詏詏?驏驏?꩏꩏?멏멏?쩏쩏?��??祐祐?��?��?��?��?��?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?§��ç��ħ��ŧ����Ƨ����ǧ����ȧ����ɧ����	ʧ����
˧����̧����ͧ����Χ����ϧ�ϧ�?Ч�Ч�?ѧ�ѧ�?ҧ�ҧ�?ӧ�ӧ�?ԧ�ԧ�?է�է�?֧�֧�?ק�ק�?ا�ا�?٧�٧�?ڧ�ڧ�?ۧ�ۧ�?ܧ�ܧ�?ݧ�ݧ�?ާ�ާ�?ߧ�ߧ�?৏৏?᧏᧏?⧏⧏?㧏㧏?䧏䧏?姏姏?槏槏?秏秏?觏觏?駏駏?ꧏꧏ?맏맏?짏짏?��??紐紐?��?��?§��Rç��Sħ��Tŧ����UƧ����Vǧ����Wȧ����Xɧ����Yʧ����Z˧����[̧����\ͧ����^Χ����_������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?¦�¦�?æ�æ�?Ħ�Ħ�?Ŧ�Ŧ�?Ʀ�Ʀ�?Ǧ�Ǧ�?Ȧ�Ȧ�?ɦ�ɦ�?ʦ�ʦ�?˦�˦�?̦�̦�?ͦ�ͦ�?Φ�Φ�?Ϧ�Ϧ�?Ц�Ц�?Ѧ�Ѧ�?Ҧ�Ҧ�?Ӧ�Ӧ�?Ԧ�Ԧ�?զ�զ�?֦�֦�?צ�צ�?ئ�ئ�?٦�٦�?ڦ�ڦ�?ۦ�ۦ�?ܦ�ܦ�?ݦ�ݦ�?ަ�ަ�?ߦ�ߦ�?এএ?ᦏ��⦏��㦏��䦏��妏����榏榏?福����規規?馏����ꦏ����릏릏?즏������??憐憐?��?ᦏ��⦏��㦏��䦏��妏�����������福����������馏����ꦏ�����������즏����������?������?������?����?����`$����a$����b$����c$����d$����e$����f$����g$����h$����i$����j$����k$����l$����m$����n$����o$����p$����q$����r$����s$����`!����a!����b!����c!����d!����e!����f!����g!����h!����i!����?����I3����3­­"3ííM3ĭĭ3ŭŭ'3ƭƭ3ǭǭ63ȭȭQ3ɭɭW3ʭʭ
3˭˭&3̭̭#3ͭͭ+3έέJ3ϭϭ;3ЭЭ�3ѭѭ�3ҭҭ�3ӭӭ�3ԭԭ�3խխ�3֭֭�3׭׭?حح?٭٭?ڭڭ?ۭۭ?ܭܭ?ݭݭ?ޭޭ?߭߭{3��0��0��!���3��!!���2���2���2���2���2��12��22��92��~3��}3��|3��R"��a"��+"��."��"����"�����"���� "����"�����"����5"����)"����*"����?����?����?����?��ѧ��ҧ��ӧ��ԧ��է��֧��ק��ا��٧��ڧ��ۧ��ܧ��ݧ��ާ��ߧ��������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/§§?çç?ħħ?ŧŧ?ƧƧ?ǧǧ?ȧȧ?ɧɧ?ʧʧ?˧˧?̧̧?ͧͧ?ΧΧ?ϧϧ?ЧЧ?��ѧ0��ҧ1��ӧ2��ԧ3��է4��֧5��קQ��ا6��٧7��ڧ8��ۧ9��ܧ:��ݧ;��ާ<��ߧ=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O��?��?��?����?����?����?����?����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�٦٦?ڦڦ?ۦۦ?ܦܦ?ݦݦ?ަަ?ߦߦ?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?������������������������������������������������������?����?����?����?����?����?����?���!�£�"�ã�#�ģ�$�ţ�%�ƣ�&�ǣ�'�ȣ�(�ɣ�)�ʣ�*�ˣ�+�̣�,�ͣ�-�Σ�.�ϣ�/�У�0�ѣ�1�ң�2�ӣ�3�ԣ�4�գ��5�֣��6�ף��7�أ��8�٣��9�ڣ��:�ۣۣ?ܣܣ?ݣݣ?ޣޣ?ߣߣ?��?���A�£�B�ã�C�ģ�D�ţ�E�ƣ�F�ǣ�G�ȣ�H�ɣ�I�ʣ�J�ˣ�K�̣�L�ͣ�M�Σ�N�ϣ�O�У�P�ѣ�Q�ң�R�ӣ�S�ԣ�T�գ��U�֣��V�ף��W�أ��X�٣��Y�ڣ��Z�����?����?����?����?����?����?�����%�����%�����%�����%�����%�����%�����%����; ����0�����!�����!�����!�����!����0����?����?����?����?����?����?����?����?����?����?����?����"����"�����"�����"�����"�����"����*"����)"¢¢?ââ?ĢĢ?ŢŢ?ƢƢ?ǢǢ?ȢȢ?ɢɢ?ʢʢ'"ˢˢ("̢̢�͢͢�!΢΢�!ϢϢ"ТТ"ѢѢ?ҢҢ?ӢӢ?ԢԢ?բբ?֢֢?עע?آآ?٢٢?ڢڢ?ۢۢ?ܢܢ "ݢݢ�"ޢޢ#ߢߢ"��"��a"��R"��j"��k"��"��="��"��5"��+"��,"��?��?��?��?��?��?��?����+!��0 ��o&����m&����j&����  ����! ���������?����?����?����?�����%����?b��!���|��!��!��!��[�� �:\�;\a��!���|��!��!��!��!��[�� �:\`<\b��!���|��!��!��!��[�� �:\�<\a!��!Z��|��!��!��!��!��[�� �:\`=\`�^`�^`�^`�^`�^`�^`�^`�^`�^`�^`�^`x^!$�)��|�T"�S"�R"�Q"�O"�s\� `F\�E\!9�?��|`N"`M"`L"`K"`I"�s\� `F\�E\д���|@H"@G"@F"@E"@C"�s\� `F\�E\!V�Z��| B" A" @" ?" ="�s\� `F\�E\!�s��|<";":"9"7"�s\� `F\�E\	!����|�5"�4"�3"�2"�0"�s\� `F\�E\
! �����|�/"�."�-"�,"�*"�s\� `F\�E\!�˹�|�)"�("�'"�&"�$"�s\� `F\�E\P����|��!��!��!�#"��!�s\� `F\�E\д���|�""�!"� "�"�"�s\� `F\�E\!F����|`"`"`"`"`"�s\� `F\�E\��ȼ�|�!�!�!`"�!�s\� `F\�E\�ۼ�|�5"�4"�3"`"�0"�s\� `F\�E\!�D��|@"@"@"@"@"�s\� `F\�E\P���|��!��!��!@"��!�s\� `F\�E\!�g��| 
" " " 
" "�s\� `F\�E\!~����|"""""�s\� `F\�E\���|�5"�4"�3""�0"�s\� `F\�E\���|`�!`�!`�!"`�!�s\� `F\�E\!v����|�!�!�!�!�!�s\� `F\�E\ !^�ƺ�|��!��!��!��!��!�s\� `F\�E\$!���|��!��!��!��!��!�s\� `F\�E\%!%�-��|��!��!��!��!��!�s\� `F\�E\&!@�F��|`�!`�!`�!`�!`�!�s\� `F\�E\'!^�g��|@�!@�!@�!@�!@�!�s\� `F\�E\(!�����| �! �! �! �! �!�s\� `F\�E\)!�����|�!�!�!�!�!�s\� `F\�E\*��M��|�!�!�!�!�!�s\� `F\�E\+@�_�	�|`�!`�!`�!`�!�s\� `F\�3\,~�i��|"""�!"�s\� `F\�E\0д���|��!��!��!��!��!�s\� `F\�E\1д���|��!��!��!��!��!�s\� `F\�E\2P�ʽ
�|��!��!��!��!�s\� `F\�3\3!P����|��!��!��!��!��!�s\� `F\�E\4P�ս�|��!��!��!��!��!�s\� `F\�E\5^���|@�!@�!@�!@�!�s\� `F\�3\9!ͻԻ�|��!��!��!��!��!�s\� `F\�E\:�+�
�|`�!`�!`�!`�!�s\� `F\�3\;!���|`�!`�!`�!`�!`�!�s\� `F\�E\@^���|��!��!��!��!�s\� `F\�3\A�]�	�|�)"�("�'"�$"�s\� `F\�3\B~�g�
�|""""�s\� `F\�3\Cͻr�
�|��!��!��!��!�s\� `F\�3\D�}�	�|��!��!��!��!�s\� `F\�3\E$����|�T"�S"�R"�O"�s\� `F\�3\F���	�| 
" " " "�s\� `F\�3\GF���
�|`"`"`"`"�s\� `F\�3\HV����| B" A" @" ="�s\� `F\�3\I%����|��!��!��!��!�s\� `F\�3\J�þ	�|<";":"7"�s\� `F\�3\K�;	�|@"@"@"@"�s\� `F\�3\M��
�|�5"�4"�3"�0"�s\� `F\�3\Nv���
�|�!�!�!�!�s\� `F\�3\O���
�|�!�!�!�!�s\� `F\�3\P9��	�|`N"`M"`L"`I"�s\� `F\�3\Q���	�| �! �! �! �!�s\� `F\�3\R ����|�/"�."�-"�*"�s\� `F\�3\\!:�!��|@�!@�!@�!@�!@�!�s\� `F\�E\]:�(��|@�!@�!@�!@�!�s\� `F\�3\^д���| �! �! �! �! �!�s\� `F\�E\c~����|""" �!"�s\� `F\�E\$���!�|��!�T"�S"�R"�O"�s\� `F\`E\9����|��!`N"`M"`L"`I"�s\� `F\`E\V���|ٝ! B" A" @" ="�s\� `F\`E\���|�!<";":"7"�s\� `F\`E\	�K��|�!�5"�4"�3"�0"�s\� `F\`E\
 ��c��|&�!�/"�."�-"�*"�s\� `F\`E\�y��|?�!�)"�("�'"�$"�s\� `F\`E\F����|Y�!`"`"`"`"�s\� `F\`E\���|t�!@"@"@"@"�s\� `F\`E\�0��|��! 
" " " "�s\� `F\`E\~�G��|��!""""�s\� `F\`E\v�t��|Þ!�!�!�!�!�s\� `F\`E\ ^����|ޞ!��!��!��!��!�s\� `F\`E\$����|��!��!��!��!��!�s\� `F\`E\%%����|�!��!��!��!��!�s\� `F\`E\&@���|1�!`�!`�!`�!`�!�s\� `F\`E\'^���|K�!@�!@�!@�!@�!�s\� `F\`E\(��6��|h�! �! �! �! �!�s\� `F\`E\)��M��|��!�!�!�!�!�s\� `F\`E\+@�e��|`�!`�!`�!`�!�s\� `F\`3\2P����|��!��!��!��!�s\� `F\`3\3P����|��!��!��!��!��!�s\� `F\`E\5^����|@�!@�!@�!@�!�s\� `F\`3\9ͻ5��|��!��!��!��!��!�s\� `F\`E\:�M��|`�!`�!`�!`�!�s\� `F\`3\;�^��|ӟ!`�!`�!`�!`�!�s\� `F\`E\@^����|��!��!��!��!�s\� `F\`3\A����|�)"�("�'"�$"�s\� `F\`3\B~����|""""�s\� `F\`3\Cͻ���|��!��!��!��!�s\� `F\`3\D����|��!��!��!��!�s\� `F\`3\E$���|�T"�S"�R"�O"�s\� `F\`3\F���| 
" " " "�s\� `F\`3\GF�#��|`"`"`"`"�s\� `F\`3\HV�4�
�| B" A" @" ="�s\� `F\`3\I%�B��|��!��!��!��!�s\� `F\`3\J�T��|<";":"7"�s\� `F\`3\K�d��|@"@"@"@"�s\� `F\`3\M�t��|�5"�4"�3"�0"�s\� `F\`3\Nv����|�!�!�!�!�s\� `F\`3\O�����|�!�!�!�!�s\� `F\`3\P9����|`N"`M"`L"`I"�s\� `F\`3\Q�����| �! �! �! �!�s\� `F\`3\R �����|�/"�."�-"�*"�s\� `F\`3\\:�d��|�!@�!@�!@�!@�!�s\� `F\`E\]:�}��|@�!@�!@�!@�!�s\� `F\`3\�s\� `F\�E\�����������������������������������������������+�������������������M�������������������k�������������������������������������������������?����?����?����?����?����?����?¨¨?èè?ĨĨ?ŨŨ1ƨƨ1ǨǨ1ȨȨ1ɨɨ	1ʨʨ
1˨˨1̨̨1ͨͨ
1ΨΨ1ϨϨ1ШШ1ѨѨ1ҨҨ1ӨӨ1ԨԨ1ըը1֨֨1רר1بب1٨٨1ڨڨ1ۨۨ1ܨܨ1ݨݨ1ިި1ߨߨ1�� 1��!1��"1��#1��$1��%1��&1��'1��(1��)1��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?����?����?��������������ѧ��ҧ��ӧ��ԧ��է��֧��ק��ا��٧��ڧ��ۧ��ܧ��ݧ��ާ��ߧ��������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/§§?çç?ħħ?ŧŧ?ƧƧ?ǧǧ?ȧȧ?ɧɧ?ʧʧ?˧˧?̧̧?ͧͧ?ΧΧ?ϧϧ?ЧЧ?��ѧ0��ҧ1��ӧ2��ԧ3��է4��֧5��קQ��ا6��٧7��ڧ8��ۧ9��ܧ:��ݧ;��ާ<��ߧ=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O��?��?��?����?����?����?����?����?����?����?����?����?����?�������������������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�٦٦?ڦڦ?ۦۦ?ܦܦ?ݦݦ?ަަ?ߦߦ?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?����?����?��������������������������������������������������������	�����
���������������
����������������������������������������������������������������������������������������������� ����!�£�"�ã�#�ģ�$�ţ�%�ƣ�&�ǣ�'�ȣ�(�ɣ�)�ʣ�*�ˣ�+�̣�,�ͣ�-�Σ�.�ϣ�/�У�0�ѣ�1�ң�2�ӣ�3�ԣ�4�գ��5�֣��6�ף��7�أ��8�٣��9�ڣ��:�ۣۣ;�ܣܣ<�ݣݣ=�ޣޣ>�ߣߣ?���@����A�£�B�ã�C�ģ�D�ţ�E�ƣ�F�ǣ�G�ȣ�H�ɣ�I�ʣ�J�ˣ�K�̣�L�ͣ�M�Σ�N�ϣ�O�У�P�ѣ�Q�ң�R�ӣ�S�ԣ�T�գ��U�֣��V�ף��W�أ��X�٣��Y�ڣ��Z�����[�����\�����]����������������������?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$¢¢�$ââ�$ĢĢ�$ŢŢt$ƢƢu$ǢǢv$ȢȢw$ɢɢx$ʢʢy$ˢˢz$̢̢{$͢͢|$΢΢}$ϢϢ~$ТТ$ѢѢ�$ҢҢ�$ӢӢ�$ԢԢ�$բբ�$֢֢�$עע�$آآ�$٢٢`$ڢڢa$ۢۢb$ܢܢc$ݢݢd$ޢޢe$ߢߢf$��g$��h$��i$��?��?�� 2��!2��"2��#2��$2��%2��&2��'2��(2��)2��?��?��`!��a!��b!��c!����d!����e!����f!����g!����h!����i!����j!����k!����?����?������V!�#��| �# �# �#�[�� �=\�>\!�#��| �# �# �# �#�[�� �=\`?\V!�#S�
�| �# �# �#�[�� �=\�?\!!�#U��| �# �# �# �#�[�� �=\`@\@�_@�_@�_@|_@p_	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\][^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}Y�����������������������������������������������������������������������������������������������������������������������������@�@�?A�A�?B�B�?C�C�?D�D�?E�E�?F�F�?G�G�?H�H�?I�I�?J�J�?K�K�?L�L�?M�M�?N�N�?O�O�?P�P�?Q�Q�?R�R�?S�S�?T�T�?U�U�?V�V�?W�W�?X�X�?Y�Y�?Z�Z�?[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�?b�b�?c�c�?d�d�?e�e�?f�f�?g�g�?h�h�?i�i�?j�j�?k�k�?l�l�?m�m�?n�n�?o�o�?p�p�?q�q�?r�r�?s�s�?t�t�?u�u�?v�v�?w�w�?x�x�?y�y�?z�z�?{�{�?|�|�?}�}�?~�~�?�������?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?��ѧ��ҧ��ӧ��ԧ��է��֧��ק��ا��٧��ڧ��ۧ��ܧ��ݧ��ާ��ߧ��������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/§§?çç?ħħ?ŧŧ?ƧƧ?ǧǧ?ȧȧ?ɧɧ?ʧʧ?˧˧?̧̧?ͧͧ?ΧΧ?ϧϧ?ЧЧ?��ѧ0��ҧ1��ӧ2��ԧ3��է4��֧5��קQ��ا6��٧7��ڧ8��ۧ9��ܧ:��ݧ;��ާ<��ߧ=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O��?��?��?����?����?����?����?����?����?����?����?����?����?������@�@�?A�A�?B�B�?C�C�?D�D�?E�E�?F�F�?G�G�?H�H�?I�I�?J�J�?K�K�?L�L�?M�M�?N�N�?O�O�?P�P�?Q�Q�?R�R�?S�S�?T�T�?U�U�?V�V�?W�W�?X�X�?Y�Y�?Z�Z�?[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�?b�b�?c�c�?d�d�?e�e�?f�f�?g�g�?h�h�?i�i�?j�j�?k�k�?l�l�?m�m�?n�n�?o�o�?p�p�?q�q�?r�r�?s�s�?t�t�?u�u�?v�v�?w�w�?x�x�?y�y�?z�z�?{�{�?|�|�?}�}�?~�~�?�������?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�٦٦?ڦڦ?ۦۦ?ܦܦ?ݦݦ?ަަ?ߦߦ?��5���6���9���:���?���@���=���>���A���B���C���D���?��?��;���<���7���8���1���?��3�����4�����?����?����?����?����?����?����?����?����?������@�@�?A�A�?B�B�?C�C�?D�D�?E�E�?F�F�?G�G�?H�H�?I�I�?J�J�?K�K�?L�L�?M�M�?N�N�?O�O�?P�P�?Q�Q�?R�R�?S�S�?T�T�?U�U�?V�V�?W�W�?X�X�?Y�Y�?Z�Z�?[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�?b�b�?c�c�?d�d�?e�e�?f�f�?g�g�?h�h�?i�i�?j�j�?k�k�?l�l�?m�m�?n�n�?o�o�?p�p�?q�q�?r�r�?s�s�?t�t�?u�u�?v�v�?w�w�?x�x�?y�y�?z�z�?{�{�?|�|�?}�}�?~�~�?�������?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?��������������������������������������������	�����
���������������
����������������������������������������������������������������������������������������������� ����!�£�"�ã�#�ģ�$�ţ�%�ƣ�&�ǣ�'�ȣ�(�ɣ�)�ʣ�*�ˣ�+�̣�,�ͣ�-�Σ�.�ϣ�/�У�0�ѣ�1�ң�2�ӣ�3�ԣ�4�գ��5�֣��6�ף��7�أ��8�٣��9�ڣ��:�ۣۣ;�ܣܣ<�ݣݣ=�ޣޣ>�ߣߣ?���@����A�£�B�ã�C�ģ�D�ţ�E�ƣ�F�ǣ�G�ȣ�H�ɣ�I�ʣ�J�ˣ�K�̣�L�ͣ�M�Σ�N�ϣ�O�У�P�ѣ�Q�ң�R�ӣ�S�ԣ�T�գ��U�֣��V�ף��W�أ��X�٣��Y�ڣ��Z�����[�����\�����]������������@�@�?A�A�?B�B�?C�C�?D�D�?E�E�?F�F�?G�G�?H�H�?I�I�?J�J�?K�K�?L�L�?M�M�?N�N�?O�O�?P�P�?Q�Q�?R�R�?S�S�?T�T�?U�U�?V�V�?W�W�?X�X�?Y�Y�?Z�Z�?[�[�?\�\�?]�]�?^�^�?_�_�?`�`�?a�a�?b�b�?c�c�?d�d�?e�e�?f�f�?g�g�?h�h�?i�i�?j�j�?k�k�?l�l�?m�m�?n�n�?o�o�?p�p�?q�q�?r�r�?s�s�?t�t�?u�u�?v�v�?w�w�?x�x�?y�y�?z�z�?{�{�?|�|�?}�}�?~�~�?�������?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?���p!���q!���r!���s!����t!����u!����v!����w!����x!����y!����?����?����?����?����?����?�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$�����$¢¢�$ââ�$ĢĢ�$ŢŢt$ƢƢu$ǢǢv$ȢȢw$ɢɢx$ʢʢy$ˢˢz$̢̢{$͢͢|$΢΢}$ϢϢ~$ТТ$ѢѢ�$ҢҢ�$ӢӢ�$ԢԢ�$բբ�$֢֢�$עע�$آآ�$٢٢`$ڢڢa$ۢۢb$ܢܢc$ݢݢd$ޢޢe$ߢߢf$��g$��h$��i$��?��?�� 2��!2��"2��#2��$2��%2��&2��'2��(2��)2��?��?���`!���a!���b!���c!����d!����e!����f!����g!����h!����i!����j!����k!����?����?������W� &�
�|�&�&�&�[�� �@\�A\A� &_��|�&�&�&��_�[g� �@\`B\W� &^��|�&�&�&�[�� �@\�B\a� &���|�&�&�&��_�[g� �@\`C\��_��_��_��_/!/&���| .& -& ,& )&�s\� `D\`3\/!/&��
�| .& -& ,& )&�s\� `D\�3\A!/&+��| .& -& ,& #& )&�s\� `D\�C\!/&3��| .& -& ,& +& )&�s\� `D\`E\!!/&���| .& -& ,& +& )&�s\� `D\�E\@�p�A�q�B�r�C�s�D�t�E�u�F�v�G�w�H�x�I�y�J�z�K�{�L�|�M�}�N�~�O���P���Q��� R���!S���"T���#U���$V���%W���&X���'Y���(Z���)[���*\���+]���,^���-_���.`���/a�a�?b�b�?c�c�?d�d�?e�e�?f�f�?g�g�?h�h�?i�i�?j�j�?k�k�?l�l�?m�m�?n�n�?o�o�?@�p�0A�q�1B�r�2C�s�3D�t�4E�u�5F�v�QG�w�6H�x�7I�y�8J�z�9K�{�:L�|�;M�}�<N�~�=O���>P���?Q���@R���AS���BT���CU���DV���EW���FX���GY���HZ���I[���J\���K]���L^���M_���N`���O����?����?����?����?����?����?����?����?����?����?����?����?����?����%����%����%����%����%����%����%����,%����$%����4%����<%����%����%����%����%����%����%����#%����3%����+%����;%����K%���� %����/%����(%����7%����?%����%����0%����%%����8%����B%����?����?����?„„?ÄÄ?ĄĄ?ńń?ƄƄ?DŽDŽ?ȄȄ?ɄɄ?ʄʄ?˄˄?̄̄?̈́̈́?΄΄?ττ?ЄЄ?фф?҄҄?ӄӄ?ԄԄ?ՄՄ?քք?ׄׄ?؄؄?لل?ڄڄ?ۄۄ?܄܄?݄݄?ބބ?߄߄?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?@�@��0A�A��0B�B��0C�C��0D�D��0E�E��0F�F��0G�G��0H�H��0I�I��0J�J��0K�K��0L�L��0M�M��0N�N��0O�O��0P�P��0Q�Q��0R�R��0S�S��0T�T��0U�U��0V�V��0W�W��0X�X��0Y�Y��0Z�Z��0[�[��0\�\��0]�]��0^�^��0_�_��0`�`��0a�a��0b�b��0c�c��0d�d��0e�e��0f�f��0g�g��0h�h��0i�i��0j�j��0k�k��0l�l��0m�m��0n�n��0o�o��0p�p��0q�q��0r�r��0s�s��0t�t��0u�u��0v�v��0w�w��0x�x��0y�y��0z�z��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����?����?����?����?����?����?����?����?�����������������ƒ���Ã���ă���Ń���ƃ���ǃ���ȃ���Ƀ���ʃ���˃���̃���̓���΃���σ���Ѓ���у���҃���Ӄ���ԃ���Ճ���փ�����?����?����?����?����?����?����?����?�����������������ƒ���Ã���ă���Ń���ƃ���ǃ���ȃ���Ƀ���ʃ���˃���̃���̓���΃���σ���Ѓ���у���҃���Ӄ���ԃ���Ճ���փ�׃׃?؃؃?كك?ڃڃ?ۃۃ?܃܃?݃݃?ރރ?߃߃?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?@�@�?A�A�?B�B�?C�C�?D�D�?E�E�?F�F�?G�G�?H�H�?I�I�?J�J�?K�K�?L�L�?M�M�?N�N�?O�O��P�P��Q�Q��R�R��S�S��T�T��U�U��V�V��W�W��X�X��Y�Y�?Z�Z�?[�[�?\�\�?]�]�?^�^�?_�_�?`���!�a���"�b���#�c���$�d���%�e���&�f���'�g���(�h���)�i���*�j���+�k���,�l���-�m���.�n���/�o���0�p���1�q���2�r���3�s���4�t���5�u���6�v���7�w���8�x���9�y���:�z�z�?{�{�?|�|�?}�}�?~�~�?����?`���A�a���B�b���C�c���D�d���E�e���F�f���G�g���H�h���I�i���J�j���K�k���L�l���M�m���N�n���O�o���P�p���Q�q���R�r���S�s���T�t���U�u���V�v���W�w���X�x���Y�y���Z�����?����?����?����?����A0����B0����C0����D0����E0����F0����G0����H0����I0����J0����K0����L0����M0����N0����O0����P0����Q0����R0����S0����T0����U0����V0����W0����X0����Y0����Z0����[0����\0����]0����^0����_0����`0����a0����b0����c0‚‚d0ÂÂe0ĂĂf0łłg0ƂƂh0ǂǂi0ȂȂj0ɂɂk0ʂʂl0˂˂m0̂̂n0͂͂o0΂΂p0ςςq0ЂЂr0ттs0҂҂t0ӂӂu0ԂԂv0ՂՂw0ււx0ׂׂy0؂؂z0قق{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��?��?��?����?����?����?����?����?����?����?����?@�@�0A�A�0B�B�0C�C��D�D��E�E��0F�F��G�G��H�H��I�I��J�J��0K�K��0L�L��M�M�@�N�N��O�O�>�P�P��Q�Q�?�R�R��0S�S��0T�T��0U�U��0V�V�0W�W��NX�X�0Y�Y�0Z�Z�0[�[��0\�\� ]�]� ^�^��_�_�<�`�`�^�a�a�%"b�b�\�c�c�& d�d�% e�e� f�f� g�g� h�h� i�i��j�j�	�k�k�0l�l�0m�m�;�n�n�=�o�o�[�p�p�]�q�q�0r�r�	0s�s�
0t�t�0u�u�0v�v�
0w�w�0x�x�0y�y�0z�z�0{�{��|�|�
�}�}��~�~����������������`"��������������f"����g"����"����4"����B&����@&���������2 ����3 ����!���������������������������������������
����� ����������&����&�����%�����%�����%�����%�����%�����%�����%�����%�����%�����%�����%����; ����0�����!�����!�����!�����!����0����?����?����?����?����?����?����?����?����?����?����?����"����"�����"�����"�����"�����"����*"����)"����?����??ÁÁ?āā?ŁŁ?ƁƁ?ǁǁ?ȁȁ'"ɁɁ("ʁʁ�ˁˁ�!́́�!́́"΁΁"ρρ?ЁЁ?сс?ҁҁ?ӁӁ?ԁԁ?ՁՁ?ցց?ׁׁ?؁؁?فف?ځځ "ہہ�"܁܁#݁݁"ށށ"߁߁a"��R"��j"��k"��"��="��"��5"��+"��,"��?��?��?��?��?��?��?��+!��0 ��o&��m&��j&����  ����! ���������?����?����?����?�����%X B*&��|A*@*?* �[�� `G\`H\
A B*���|A*@*?*>* �[�� `G\�H\X B*f��|A*@*?* �[�� `G\`I\
a B*��|A*@*?*>* �[�� `G\�I\�`�`�`��_	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� Y \*5��| 6` 5` 4`�s\� `J\`3\A \*���| 6` 5` 4` G*�s\� `J\`K\Y \*o�
�| 6` 5` 4`�s\� `J\�3\a \*��| 6` 5` 4` G*�s\� `J\�K\         (((((                  H���������������������� M2 @p�Ap�Bp�Cp�Dp�@q�Aq�Bq�Cq�Dq�@r�Ar�Br�Cr�Dr�@s�As�Bs�Cs�Ds�@t�At�Bt�Ct�Dt�@u�Au�Bu�Cu�Du�@v�Av�Bv�Cv�Dv�@w�Aw�Bw�Cw�Dw�@	x�A	x�B	x�C	x�D	x�@
y�A
y�B
y�C
y�D
y�@z�Az�Bz�Cz�Dz�@{�A{�B{�C{�D{�@
|�A
|�B
|�C
|�D
|�@}�A}�B}�C}�D}�@~�A~�B~�C~�D~�@�A�B�C�D�@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@��A��B��C��D��@ ��A ��B ��C ��D ��@!��A!��B!��C!��D!��@"��A"��B"��C"��D"��@#��A#��B#��C#��D#��@$��A$��B$��C$��D$��@%��A%��B%��C%��D%��@&��A&��B&��C&��D&��@'��A'��B'��C'��D'��@(��A(��B(��C(��D(��@)��A)��B)��C)��D)��@*��A*��B*��C*��D*��@+��A+��B+��C+��D+��@,��A,��B,��C,��D,��@-��A-��B-��C-��D-��@.��A.��B.��C.��D.��M2�{� S�9���|�|�a�s\	�� �e\`M\e� S�9���|�|�s\	�� �e\`M\|� S�9V��|@�*�s\	�� �e\�M\{� S�9A��|�|�a�s\	�� �e\�M\�� S�9|��|�\*�a�s\	�� �e\�L\�� S�9k��| `*�s\	�� �e\�M\�� S�9Y��|��*�s\	�� �e\�M\z� S�9&��|`�*�s\	�� �e\�M\y� S�9��| �*�s\	�� �e\�M\x� S�9��| �*�s\	�� �e\�M\w� S�9�^*�|��*�s\	�� �e\�M\v� S�9��|�*�s\	�� �e\�M\u� S�9��|��*�s\	�� �e\�M\t� S�9��|�*�s\	�� �e\�M\s� S�9���| �*�s\	�� �e\�M\r� S�9���|��*�s\	�� �e\�M\q� S�9�^*�| �*�s\	�� �e\�M\p� S�9���|��*�s\	�� �e\�M\o� S�9}��|��*�s\	�� �e\�M\n� S�9l��| �*`	\	�� �e\�M\m� S�9[��|��*�s\	�� �e\�M\l� S�9J��|P�*�s\	�� �e\�M\k� S�98��|��*�s\	�� �e\�M\j� S�9(��| �*�s\	�� �e\�M\i� S�9��|�*�s\	�� �e\�M\h� S�9��|`�*�s\	�� �e\�M\g� S�9��|�*�s\	�� �e\�M\f� S�9߿�|��*�s\	�� �e\�M\e� S�9ο�|�|�s\	�� �e\�M\�M\`M\�L\`L\�� M�9\��|�|�a�s\	�� �_\`O\�� M�9E��|�|�s\	�� �_\`O\�� M�9���|@�*�s\	�� �_\�O\�� M�9���|�|�a�s\	�� �_\�O\�� M�9���|�\*�a�s\	�� �_\�N\�� M�9���| `*�s\	�� �_\�O\�� M�9���|��*�s\	�� �_\�O\�� M�9t��|`�*�s\	�� �_\�O\�� M�9c��| �*�s\	�� �_\�O\�� M�9R��| �*�s\	�� �_\�O\�� M�9?��|��*�s\	�� �_\�O\�� M�9,��|�*�s\	�� �_\�O\�� M�9��|��*�s\	�� �_\�O\�� M�9��|�*�s\	�� �_\�O\�� M�9�^*�| �*�s\	�� �_\�O\�� M�9���|��*�s\	�� �_\�O\�� M�9���| �*�s\	�� �_\�O\�� M�9���|��*�s\	�� �_\�O\�� M�9���|��*�s\	�� �_\�O\�� M�9���| �*`	\	�� �_\�O\�� M�9���|��*�s\	�� �_\�O\�� M�9���|P�*�s\	�� �_\�O\�� M�9���|��*�s\	�� �_\�O\�� M�9t��| �*�s\	�� �_\�O\�� M�9a��|�*�s\	�� �_\�O\�� M�9O��|`�*�s\	�� �_\�O\�� M�9>��|�*�s\	�� �_\�O\�� M�9+��|��*�s\	�� �_\�O\�� M�9��|�|�s\	�� �_\�O\�O\`O\�N\`N\��@@�9���|�|�:`�a�s\	�� �k\`S\��@@�9���|�|�:`�s\	�� �k\`S\��@@�9b��|@�*�:`�s\	�� �k\�S\��@@�9K��|�|�:`�a�s\	�� �k\�S\b�@@�9$��|�\*�:`�a�s\	�� �k\�R\a�@@�9��| `*�:`�s\	�� �k\�S\`�@@�9���|��*�:`�s\	�� �k\�S\��@@�9.��|`�*�:`�s\	�� �k\�S\��@@�9��| �*�:`�s\	�� �k\�S\��@@�9��| �*�:`�s\	�� �k\�S\��@@�9���|��*�:`�s\	�� �k\�S\��@@�9���|�*�:`�s\	�� �k\�S\��@@�9���|��*�:`�s\	�� �k\�S\��@@�9���|�*�:`�s\	�� �k\�S\��@@�9���| �*�:`�s\	�� �k\�S\��@@�9���|��*�:`�s\	�� �k\�S\��@@�9~��| �*�:`�s\	�� �k\�S\��@@�9l��|��*�:`�s\	�� �k\�S\��@@�9[��|��*�:`�s\	�� �k\�S\��@@�9H��| �*�:``	\	�� �k\�S\��@@�95��|��*�:`�s\	�� �k\�S\��@@�9"��|P�*�:`�s\	�� �k\�S\��@@�9��|��*�:`�s\	�� �k\�S\��@@�9���| �*�:`�s\	�� �k\�S\��@@�9���|�*�:`�s\	�� �k\�S\��@@�9���|`�*�:`�s\	�� �k\�S\��@@�9���|�*�:`�s\	�� �k\�S\��@@�9���|��*�:`�s\	�� �k\�S\��@@�9���|�|�:`�s\	�� �k\�S\�Q\`Q\�P\`P\�S\`S\�R\`R\��`�9���|�|�:`�a�s\	�� `p\`W\��`�9w��|�|�:`�s\	�� `p\`W\��`�9R��|@�*�:`�s\	�� `p\�W\B�`�9���|�\*�:`�a�s\	�� `p\�V\��`�9;��|�|�:`�a�s\	�� `p\�W\A�`�9���| `*�:`�s\	�� `p\�W\@�`�9h��|��*�:`�s\	�� `p\�W\��`�9�^*�|`�*�:`�s\	�� `p\�W\��`�9(��| �*�:`�s\	�� `p\�W\��`�9��| �*�:`�s\	�� `p\�W\��`�9��|��*�:`�s\	�� `p\�W\��`�9���|�*�:`�s\	�� `p\�W\��`�9���|��*�:`�s\	�� `p\�W\��`�9���|�*�:`�s\	�� `p\�W\��`�9���| �*�:`�s\	�� `p\�W\��`�9���|��*�:`�s\	�� `p\�W\��`�9���| �*�:`�s\	�� `p\�W\��`�9y��|��*�:`�s\	�� `p\�W\��`�9h��|��*�:`�s\	�� `p\�W\��`�9U��| �*�:``	\	�� `p\�W\��`�9B��|��*�:`�s\	�� `p\�W\��`�9/��|P�*�:`�s\	�� `p\�W\��`�9��|��*�:`�s\	�� `p\�W\��`�9	��| �*�:`�s\	�� `p\�W\��`�9���|�*�:`�s\	�� `p\�W\��`�9���|`�*�:`�s\	�� `p\�W\��`�9���|�*�:`�s\	�� `p\�W\��`�9���|��*�:`�s\	�� `p\�W\��`�9_*�|�|�:`�s\	�� `p\�W\�U\`U\�T\`T\�W\`W\�V\`V\�� H�9+��|�|�a�s\	�� `\\`Y\�� H�9��|�|�s\	�� `\\`Y\�� H�9���|@�*�s\	�� `\\�Y\�� H�9���|�|�a�s\	�� `\\�Y\�� H�9H��|�\*�a�s\	�� `\\�X\�� H�98��| `*�s\	�� `\\�Y\�� H�9���|��*�s\	�� `\\�Y\�� H�9_*�|`�*�s\	�� `\\�Y\�� H�9���| �*�s\	�� `\\�Y\�� H�9���| �*�s\	�� `\\�Y\�� H�9���|��*�s\	�� `\\�Y\�� H�9���|�*�s\	�� `\\�Y\�� H�9u��|��*�s\	�� `\\�Y\�� H�9g�
�|�*�s\	�� `\\�Y\�� H�9V��| �*�s\	�� `\\�Y\�� H�9G��|��*�s\	�� `\\�Y\�� H�94��| �*�s\	�� `\\�Y\�� H�9%��|��*�s\	�� `\\�Y\�� H�9�
�|��*�s\	�� `\\�Y\�� H�9��| �*`	\	�� `\\�Y\�� H�9���|��*�s\	�� `\\�Y\�� H�9��|P�*�s\	�� `\\�Y\�� H�9��|��*�s\	�� `\\�Y\�� H�9��| �*�s\	�� `\\�Y\�� H�9���|�*�s\	�� `\\�Y\�� H�9���|`�*�s\	�� `\\�Y\�� H�9���|�*�s\	�� `\\�Y\�� H�9z��|��*�s\	�� `\\�Y\�� H�9j��|�|�s\	�� `\\�Y\�Y\`Y\�X\`X\�[\`[\�Z\`Z\����,`�a����*`
a	.42�s�s�	q�����,`�a�@<`����*`
a�;`	.42�s�s�	q���,��,��,��,��,��,��,��,��,��,��,��,��,��,��,��,�z,�t,�j,�d,�^,�V,�N,�H,�B,�:,�2,�(,�,�,�,�,��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+�n+�f+�b+�\+�V+�P+�J+�D+�>+�8+�2+�,+�&+� +�+�+�+�
+�+��*��*��/��/��/��/��/��/��/��/��/�}/�w/�q/�k/�e/�_/�Y/�Q/�M/�G/�A/�=/�9/�3/�-/�'/�/�/�/�/�/��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.�.�o.�].�W.�S.�O.�K.�G.�A.�=.�7.�1.�+.�%.�.�.�.�
.�.��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-�-�y-�u-�q-�m-�i-�c-�]-�W-�Q-�K-�E-�?-�9-�3-�--�%-�-�-�-�	-�-��,����/@\	��2� s�s�	�!Z� H�9F��|K1J1I1�s\�� `\\`]\#� H�9���|K1J1I1I1�s\�� `\\�]\Z� H�9z��|K1J1I1�s\�� `\\`^\�� H�9��|K1J1I1I1�s\�� `\\�^\#� H�9���|K1J1I1I1�s\�� `\\`_\=� M�9���H1�s\�� �_\�`\<� M�9v��H1�s\�� �_\`a\=� M�9S�	�H1�s\�� �_\�a\<� M�9<��H1�s\�� �_\`b\>� L1���H1�s\�� �b\�c\8� L1��H1�s\�� �b\`d\>� L1�H1�H1�s\�� �b\�d\8� L1�H1�H1�s\�� �b\`e\7� S�9��H1�s\�� �e\�f\6� S�9���H1�s\�� �e\`g\7� S�9�	�H1�s\�� �e\�g\6� S�9���H1�s\�� �e\`h\������?�������������������������������������������������������������������������������	������
������������������������������������������������������������������������������������������������?������!������%���������������������ª�«��ê�ë��ī�ī�?Ū�ū�+ƪ�ƫ�/Ǫ�ǫ�)Ȫ�ȫ�5ɪ�ɫ�7ʪ�ʫ�:˪�˫�>̪�̫�<ͪ�ͫ�DΪ�Ϋ�HϪ�ϫ�FЪ�Ы��Ѫ�ѫ��Ҫ�ҫ��Ӫ�ӫ��Ԫ�ԫ��ժ�ի��֪�֫�Qת�׫�Mت�ث��٪�٫�Uڪ�ګ�Y۪�۫�Wܪ�ܫ�[ݪ�ݫ�]ު�ޫ�aߪ�߫�_એ૏e᪏᫏c⪏⫏�㪏㫏�䪏䫏�媏嫏�檏櫏m窏竏�誏諏q骏髏kꪏ꫏s몏뫏o쪏쫏i����摒𢡊������u��������w������z������~������|������?������?������?������?������?������?������?������?������?��������������������������������������������������������������������������������������������������
����������������������������������������������������������������?������������������"������ ������$���������������������ª�«��ê�ë��Ī�i0Ū�ū�*ƪ�ƫ�.Ǫ�ǫ�(Ȫ�ȫ�4ɪ�ɫ�6ʪ�ʫ�9˪�˫�=̪�̫�;ͪ�ͫ�CΪ�Ϋ�GϪ�ϫ�EЪ�Ы��Ѫ�ѫ��Ҫ�ҫ��Ӫ�ӫ��Ԫ�ԫ��ժ�ի��֪�֫�Pת�׫�Lت�ث��٪�٫�Tڪ�ګ�X۪�۫�Vܪ�ܫ�Zݪ�ݫ�\ު�ޫ�`ߪ�߫�^એ૏d᪏᫏b⪏⫏�㪏㫏�䪏䫏�媏嫏�檏櫏l窏竏�誏諏p骏髏jꪏ꫏r몏뫏n쪏쫏h����摒𢡊������t�����x��v������y������}������{������?������?������?������?������?������?������?������?������?����������©�������?���ĩ�&������?���Ʃ�2������?���ȩ�A���ɩ�?������?���˩�J���̩�����ͩ�R������?���ϩ�f���Щ��������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?����������©�é�é�����ĩ�'Iũ�1���Ʃ�3ǩ�ǩ�8���ȩ�B���ɩ�@ʩ�ʩ�I���˩�K���̩�����ͩ�SΩ�Ω�����ϩ�g���Щ��ѩ�ѩ�?ҩ�ҩ�?ө�ө�?ԩ�ԩ�?թ�թ�?֩�֩�?ש�ש�?ة�ة�?٩�٩�?ک�ک�?۩�۩�?ܩ�ܩ�?ݩ�ݩ�?ީ�ީ�?ߩ�ߩ�?੏੏?ᩏᩏ?⩏⩏?㩏㩏?䩏䩏?婏婏?橏橏?穏穏?詏詏?驏驏?꩏꩏?멏멏?쩏쩏?��??祐祐?��?��?��?��?��?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?§��ç��ħ��ŧ����Ƨ����ǧ����ȧ����ɧ����	ʧ����
˧����̧����ͧ����Χ����ϧ�ϧ�?Ч�Ч�?ѧ�ѧ�?ҧ�ҧ�?ӧ�ӧ�?ԧ�ԧ�?է�է�?֧�֧�?ק�ק�?ا�ا�?٧�٧�?ڧ�ڧ�?ۧ�ۧ�?ܧ�ܧ�?ݧ�ݧ�?ާ�ާ�?ߧ�ߧ�?৏৏?᧏᧏?⧏⧏?㧏㧏?䧏䧏?姏姏?槏槏?秏秏?觏觏?駏駏?ꧏꧏ?맏맏?짏짏?��??紐紐?��?��?§��Rç��Sħ��Tŧ����UƧ����Vǧ����Wȧ����Xɧ����Yʧ����Z˧����[̧����\ͧ����^Χ����_������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?������?¦�¦�?æ�æ�?Ħ�Ħ�?Ŧ�Ŧ�?Ʀ�Ʀ�?Ǧ�Ǧ�?Ȧ�Ȧ�?ɦ�ɦ�?ʦ�ʦ�?˦�˦�?̦�̦�?ͦ�ͦ�?Φ�Φ�?Ϧ�Ϧ�?Ц�Ц�?Ѧ�Ѧ�?Ҧ�Ҧ�?Ӧ�Ӧ�?Ԧ�Ԧ�?զ�զ�?֦�֦�?צ�צ�?ئ�ئ�?٦�٦�?ڦ�ڦ�?ۦ�ۦ�?ܦ�ܦ�?ݦ�ݦ�?ަ�ަ�?ߦ�ߦ�?এএ?ᦏ��⦏��㦏��䦏��妏����榏榏?福����規規?馏����ꦏ����릏릏?즏������??憐憐?��?ᦏ��⦏��㦏��䦏��妏�����������福����������馏����ꦏ�����������즏����������?������?������?����?��ѧ��ҧ��ӧ��ԧ��է��֧��ק��ا��٧��ڧ��ۧ��ܧ��ݧ��ާ��ߧ��������� ���!���"���#���$���%���&���'���(���)���*���+���,���-���.���/§§?çç?ħħ?ŧŧ?ƧƧ?ǧǧ?ȧȧ?ɧɧ?ʧʧ?˧˧?̧̧?ͧͧ?ΧΧ?ϧϧ?ЧЧ?��ѧ0��ҧ1��ӧ2��ԧ3��է4��֧5��קQ��ا6��٧7��ڧ8��ۧ9��ܧ:��ݧ;��ާ<��ߧ=���>���?���@���A���B���C���D���E���F���G���H���I���J���K���L���M���N���O��?��?��?����?����?����?����?����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�����?����?����?����?����?����?����?����?�������¦���æ���Ħ���Ŧ���Ʀ���Ǧ���Ȧ���ɦ���ʦ���˦���̦���ͦ���Φ���Ϧ���Ц���Ѧ���Ҧ���Ӧ���Ԧ���զ���֦���צ���ئ�٦٦?ڦڦ?ۦۦ?ܦܦ?ݦݦ?ަަ?ߦߦ?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?����?������������������������������������������������������?����?����?����?����?����?����?���!�£�"�ã�#�ģ�$�ţ�%�ƣ�&�ǣ�'�ȣ�(�ɣ�)�ʣ�*�ˣ�+�̣�,�ͣ�-�Σ�.�ϣ�/�У�0�ѣ�1�ң�2�ӣ�3�ԣ�4�գ��5�֣��6�ף��7�أ��8�٣��9�ڣ��:�ۣۣ?ܣܣ?ݣݣ?ޣޣ?ߣߣ?��?���A�£�B�ã�C�ģ�D�ţ�E�ƣ�F�ǣ�G�ȣ�H�ɣ�I�ʣ�J�ˣ�K�̣�L�ͣ�M�Σ�N�ϣ�O�У�P�ѣ�Q�ң�R�ӣ�S�ԣ�T�գ��U�֣��V�ף��W�أ��X�٣��Y�ڣ��Z�����?����?����?����?����?����?�����%�����%�����%�����%�����%�����%�����%����; ����0�����!�����!�����!�����!����0����?����?����?����?����?����?����?����?����?����?����?����"����"�����"�����"�����"�����"����*"����)"¢¢?ââ?ĢĢ?ŢŢ?ƢƢ?ǢǢ?ȢȢ?ɢɢ?ʢʢ'"ˢˢ("̢̢�͢͢�!΢΢�!ϢϢ"ТТ"ѢѢ?ҢҢ?ӢӢ?ԢԢ?բբ?֢֢?עע?آآ?٢٢?ڢڢ?ۢۢ?ܢܢ "ݢݢ�"ޢޢ#ߢߢ"��"��a"��R"��j"��k"��"��="��"��5"��+"��,"��?��?��?��?��?��?��?����+!��0 ��o&����m&����j&����  ����! ���������?����?����?����?�����%����?[�P9U��|�O9�N9�M9@	\�� �h\�i\�P9���|�O9�N9�M9�L9@	\�� �h\`j\[�P9���|�O9�N9�M9@	\�� �h\�j\!�P9ܹ�|�O9�N9�M9�L9@	\�� �h\`k\ �b �b ub ib ]b Qb Eb 9b -b	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~�����������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������         (((((                  H���������������������� ()*+,-./0	1	
2
34
5
6789:;<=>?@ABCDEFG H !I!"J"#K#$L$%M%&N&'O'()*+,-./0	1	
2
34
5
6789:;<=>?@ABCDEFG H !I!"J"#K#$L$%M%&N&'O'PPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�	�	�
�
�
�������
�
�
������������������������������������������������������� � � �!�A�!�"�B�"�#�C�#�$�D�$�%�E�%�&�F�&�'�G�'�(�H�(�)�I�)�*�J�*�+�K�+�,�L�,�-�M�-�.�N�.�/�O�/�0�P�0�1�Q�1�2�R�2�3�S�3�4�T�4�5�U�5�6�V�6�7�W�7�8�X�8�9�Y�9�:�Z�:�;�;�;�<�<�<�=�=�=�>�>�>�?�?�?�@�@�@�!�A�!�"�B�"�#�C�#�$�D�$�%�E�%�&�F�&�'�G�'�(�H�(�)�I�)�*�J�*�+�K�+�,�L�,�-�M�-�.�N�.�/�O�/�0�P�0�1�Q�1�2�R�2�3�S�3�4�T�4�5�U�5�6�V�6�7�W�7�8�X�8�9�Y�9�:�Z�:�[�[�[�\�\�\�]�]�]�^�^�^�_�_�_�`�`�`�a�a�a�b�b�b�c�c�c�d�d�d�e�e�e�f�f�f�g�g�g�h�h�h�i�i�i�j�j�j�k�k�k�l�l�l�m�m�m�n�n�n�o�o�o�p�p�p�q�q�q�r�r�r�s�s�s�t�t�t�u�u�u�v�v�v�w�w�w�x�x�x�y�y�y�z�z�z�{�{�{�|�|�|�}�}�}�~�~�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�	�	�
�
�
�������
�
�
������������������������������������������������������� � � �!�!�!�"�#�"�"�#�"�$�%�$�$�%�$�&�'�&�&�'�&�(�)�(�(�)�(�*�+�*�*�+�*�,�-�,�,�-�,�.�/�.�.�/�.�0�0�0�1�1�1�2�3�2�2�3�2�4�5�4�4�5�4�6�7�6�6�7�6�8�9�8�8�9�8�:�;�:�:�;�:�<�=�<�<�=�<�>�?�>�>�?�>�@�A�@�@�A�@�B�C�B�B�C�B�D�E�D�D�E�D�F�G�F�F�G�F�H�I�H�H�I�H�J�K�J�J�K�J�L�M�L�L�M�L�N�O�N�N�O�N�P�Q�P�P�Q�P�R�S�R�R�S�R�T�U�T�T�U�T�V�W�V�V�W�V�X�Y�X�X�Y�X�Z�[�Z�Z�[�Z�\�]�\�\�]�\�^�_�^�^�_�^�`�a�`�`�a�`�b�c�b�b�c�b�d�e�d�d�e�d�f�g�f�f�g�f�h�i�h�h�i�h�j�k�j�j�k�j�l�m�l�l�m�l�n�o�n�n�o�n�p�p�p�q�q�q�r�r�r�s�s�s�t�t�t�u�u�u�v�v�v�w�w�w�x�x�x�y�z�y�y�z�y�{�|�{�{�|�{�}�y}�~��~�~��~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������§§§çççħħħŧŧŧƧƧƧǧǧǧȧȧȧɧɧɧʧʧʧ˧˧˧̧̧̧ͧͧͧΧΧΧϧϧϧЧЧЧѧѧѧҧҧҧӧӧӧԧԧԧէէէ֧֧֧קקקااا٧٧٧ڧڧڧۧۧۧܧܧܧݧݧݧާާާߧߧߧ������������������������������������������������������������������������������������������������������������������������������������������������������������	�	�	�
�
�
�������
�
�
������������������������������������������������������� � � �!�!�!�"�"�"�#�#�#�$�$�$�%�%�%�&�&�&�'�'�'�(�(�(�)�)�)�*�*�*�+�+�+�,�,�,�-�-�-�.�.�.�/�/�/�0�0�0�1�1�1�2�2�2�3�3�3�4�4�4�5�5�5�6�6�6�7�7�7�8�8�8�9�9�9�:�:�:�;�;�;�<�<�<�=�=�=�>�>�>�?�?�?�@�A�@�@�A�@�B�C�B�B�C�B�D�E�D�D�E�D�F�G�F�F�G�F�H�I�H�H�I�H�J�K�J�J�K�J�L�M�L�L�M�L�N�O�N�N�O�N�P�Q�P�P�Q�P�R�S�R�R�S�R�T�U�T�T�U�T�V�W�V�V�W�V�X�Y�X�X�Y�X�Z�[�Z�Z�[�Z�\�]�\�\�]�\�^�_�^�^�_�^�`�`�`�a�a�a�b�c�b�b�c�b�d�e�d�d�e�d�f�g�f�f�g�f�h�i�h�h�i�h�j�k�j�j�k�j�l�m�l�l�m�l�n�n�n�o�o�o�p�p�p�q�q�q�r�r�r�s�s�s�t�t�t�u�u�u�v�v�v�w�w�w�x�x�x�y�y�y�z�z�z�{�{�{�|�|�|�}�}�}�~�~�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¦¦¦æææĦĦĦŦŦŦƦƦƦǦǦǦȦȦȦɦɦɦʦʦʦ˦˦˦̦̦̦ͦͦͦΦΦΦϦϦϦЦЦЦѦѦѦҦҦҦӦӦӦԦԦԦզզզ֦֦֦צצצئئئ٦٦٦ڦڦڦۦۦۦܦܦܦݦݦݦަަަߦߦߦ����������������������������������������������������������������������������������������������������������������������������������-��-��-��-��-��-��-��-��-��	-��
-��-��-��
-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-�� -��!-��"-��#-��$-��%-�&-&-&-'-'-'-(-(-(-)-)-)-*-*-*-+-+-+-,-,-,-------.-.-.-/-/-/-0-0-0-1-1-1-2-2-2-3-3-3-4-4-4-5-5-5-6-6-6-7-7-7-8-8-8-9-9-9-:-:-:-;-;-;-<-<-<-=-=-=->->->-?-?-?-@-@-@-A-A-A-B-B-B-C-C-C-D-D-D-E-E-E-F-F-F-G-G-G-H-H-H-I-I-I-J-J-J-K-K-K-L-L-L-M-M-M-N-N-N-O-O-O-P-P-P-Q-Q-Q-R-R-R-S-S-S-T-T-T-U-U-U-V-V-V-W-W-W-X-X-X-Y-Y-Y-Z-Z-Z-[-[-[-\-\-\-]-]-]-^-^-^-_-_-_-`-`-`-a-a-a-b-b-b-c-c-c-d-d-d-e-e-e-f-f-f-g-g-g-h-h-h-i-i-i-j-j-j-k-k-k-l-l-l-m-m-m-n-n-n-o-o-o-p-p-p-q-q-q-r-r-r-s-s-s-t-t-t-u-u-u-v-v-v-w-w-w-x-x-x-y-y-y-z-z-z-{-{-{-|-|-|-}-}-}-~-~-~----�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-,0,,,1,,,2,,,3,,,4,,,5,,,6,,,7,,,8,,	,9,	,
,:,
,,;,,,<,,
,=,
,,>,,,?,,,@,,,A,,,B,,,C,,,D,,,E,,,F,,,G,,,H,,,I,,,J,,,K,,,L,,,M,,,N,,,O,, ,P, ,!,Q,!,",R,",#,S,#,$,T,$,%,U,%,&,V,&,',W,',(,X,(,),Y,),*,Z,*,+,[,+,,,\,,,-,],-,.,^,.,/,/,/,,0,,,1,,,2,,,3,,,4,,,5,,,6,,,7,,,8,,	,9,	,
,:,
,,;,,,<,,
,=,
,,>,,,?,,,@,,,A,,,B,,,C,,,D,,,E,,,F,,,G,,,H,,,I,,,J,,,K,,,L,,,M,,,N,,,O,, ,P, ,!,Q,!,",R,",#,S,#,$,T,$,%,U,%,&,V,&,',W,',(,X,(,),Y,),*,Z,*,+,[,+,,,\,,,-,],-,.,^,.,_,_,_,`,a,`,`,a,`,b,kb,c,}c,d,}d,:e,:>f,>g,h,g,g,h,g,i,j,i,i,j,i,k,l,k,k,l,k,m,Qm,n,qn,o,Po,p,Rp,q,q,q,r,s,r,r,s,r,t,t,t,u,v,u,u,v,u,w,w,w,x,x,x,y,y,y,z,z,z,{,{,{,|,|,|,},},},~,?~,,@,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,$$$$$$$$$$$$$$$$$$$$$$$$$$$	$	$	$
$
$
$$$$$$$
$
$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ $ $!$!$!$"$"$"$#$#$#$$$$$$$%$%$%$&$&$&$'$'$'$($($($)$)$)$*$*$*$+$+$+$,$,$,$-$-$-$.$.$.$/$/$/$0$0$0$1$1$1$2$2$2$3$3$3$4$4$4$5$5$5$6$6$6$7$7$7$8$8$8$9$9$9$:$:$:$;$;$;$<$<$<$=$=$=$>$>$>$?$?$?$@$@$@$A$A$A$B$B$B$C$C$C$D$D$D$E$E$E$F$F$F$G$G$G$H$H$H$I$I$I$J$J$J$K$K$K$L$L$L$M$M$M$N$N$N$O$O$O$P$P$P$Q$Q$Q$R$R$R$S$S$S$T$T$T$U$U$U$V$V$V$W$W$W$X$X$X$Y$Y$Y$Z$Z$Z$[$[$[$\$\$\$]$]$]$^$^$^$_$_$_$`$`$`$a$a$a$b$b$b$c$c$c$d$d$d$e$e$e$f$f$f$g$g$g$h$h$h$i$i$i$j$j$j$k$k$k$l$l$l$m$m$m$n$n$n$o$o$o$p$p$p$q$q$q$r$r$r$s$s$s$t$t$t$u$u$u$v$v$v$w$w$w$x$x$x$y$y$y$z$z$z${${${$|$|$|$}$}$}$~$~$~$$$$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$!!!!!!!!!!!!!!!!!!!!!!!!!!!	!	!	!
!
!
!!!!!!!
!
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! !!!!!!!"!"!"!#!#!#!$!$!$!%!%!%!&!�&!'!'!'!(!(!(!)!)!)!*!k*!+!�+!,!,!,!-!-!-!.!.!.!/!/!/!0!0!0!1!1!1!2!N!2!3!3!3!4!4!4!5!5!5!6!6!6!7!7!7!8!8!8!9!9!9!:!:!:!;!;!;!<!<!<!=!=!=!>!>!>!?!?!?!@!@!@!A!A!A!B!B!B!C!C!C!D!D!D!E!E!E!F!F!F!G!G!G!H!H!H!I!I!I!J!J!J!K!K!K!L!L!L!M!M!M!2!N!2!O!O!O!P!P!P!Q!Q!Q!R!R!R!S!S!S!T!T!T!U!U!U!V!V!V!W!W!W!X!X!X!Y!Y!Y!Z!Z!Z![![![!\!\!\!]!]!]!^!^!^!_!_!_!`!p!`!a!q!a!b!r!b!c!s!c!d!t!d!e!u!e!f!v!f!g!w!g!h!x!h!i!y!i!j!z!j!k!{!k!l!|!l!m!}!m!n!~!n!o!!o!`!p!`!a!q!a!b!r!b!c!s!c!d!t!d!e!u!e!f!v!f!g!w!g!h!x!h!i!y!i!j!z!j!k!{!k!l!|!l!m!}!m!n!~!n!o!!o!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�	�
���
����	�
���
���������������( �)!�*"�+#�,$�-%�.&�/'�( �)!�*"�+#�,$�-%�.&�/'�80�91�:2�;3�<4�=5�>6�?7�80�91�:2�;3�<4�=5�>6�?7�H@�IA�JB�KC�LD�ME�FFFGGGH@�IA�JB�KC�LD�ME�NNNOOOPP�YQ�RR�[S�TT�]U�VV�_W�XXXYQ�ZZZ[S�\\\]U�^^^_W�h`�ia�jb�kc�ld�me�nf�og�h`�ia�jb�kc�ld�me�nf�og��p��q��r��s��t��u��v��w��x��y��z��{��|��}�~~~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������p��q��������������������������������������r��s��t��u��������������������������������������������v��w��������������������������������������������z��{��������������������������������������x��y��|��}�������������AABBBBBB	C	C
D
D
D
DDDDDDDEEEEEEEEEEFF !G !G"#H"#H$%H$%H&'H&'H()H()H*+H*+H,-I,-I./I./I01K01K23K23K45K45K67L67L89L89L:;L:;L<=L<=L>?M>?M@AM@AMBCMBCMDENDENFGNFGNHINHINJKNJKNLMOLMONOONOOPQOPQORSORSOTUPTUPVWPVWPXYRXYRZ[RZ[R\]R\]R^_R^_R`aS`aSbcSbcSdeSdeSfgSfgShiShiSjkTjkTlmTlmTnoTnoTpqTpqTrsUrsUtuUtuUvwUvwUxyUxyUz{Uz{U|}V|}V~V~V��W��W��W��W��W��W��W��W��W��W��X��X��X��X��Y��Y��Z��Z��Z��Z��Z��Z��H��T��W��Y���`�S��������������A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��E��E��E��E��E��E��E��E��E��E��E��E��E��E��E��E��I��I��I��I��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��U��U��U��U��U��U��U��U��U��U��U��U��U��U��Y��Y��Y��Y��Y��Y��Y��Y������������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxx}�y}�zzz{{{|||c,}c,~~~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~�������������������������������������������������������������������������������������������������-��-��-��-��-��-��-��-��-��	-��
-��-��-��
-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-�� -��!-��"-��#-��$-��%-�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������		





 !  ! "#""#"$%$$%$&&&'''((()))***+++,,,---...///0001a12b23c34d45e56f67g78h89i9:j:;k;<l<=m=>n>?o?@p@AqABrBCsCDtDEuEFvFGwGHxHIyIJzJK{KL|LM}MN~NOOP�PQ�QR�RS�ST�TU�UV�VWWWXXXYYYZZZ[[[\\\]]]^^^___```1a12b23c34d45e56f67g78h89i9:j:;k;<l<=m=>n>?o?@p@AqABrBCsCDtDEuEFvFGwGHxHIyIJzJK{KL|LM}MN~NOOP�PQ�QR�RS�ST�TU�UV�V���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PQRSTUVWX	Y	
Z
[\
]^#_0123456789:;<=>? @ !A!"B"#C#$D$%E%&F&'G'(H()I)*J*+K+,L,-M-.N./O/0123456789:;<=>? @ !A!"B"#C#$D$%E%&F&'G'(H()I)*J*+K+,L,-M-.N./O/PQRSTUVWX	Y	
Z
[\
]^#_`a``a`bcbbcbdeddedfgffgfhihhihjkjjkjlmllmlnonnonpqppqprsrrsrtuttutvwtvwtxyxxyxz{zz{z|}||}|~~~~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������-��-��#��#��#��#��#��#��'��'��������+��+������������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDD�E�FFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopqppqprsrrsrtttuuuvwvvwvxxxyyyzzz�{��|��}�~~~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{��|��}�AAAAEEEE	I	I
I
I
O
OOORRRRUUUUSSTTHH � !!!"#""#"$%$$%$&'A&'A()E()E*+O*+O,-O,-O./O./O01O01O23Y23Y444555666777888999:e,:;<;;<;=�=>f,>~,?~,,@,ABAABAC�CD�DE�EFGFFGFHIHHIHJKJJKJLMLLMLNONNONo,Po,m,Qm,p,Rp,�S��T�UUU�V��W�XXX�Y�ZZZ�[�\\\]]]^^^___�`�aaabbb�c�dddeeefffggg�h��i�jjjb,kb,lllmmmnnn�o�pppn,qn,�r�sssttt�u�vvvwwwxxxyyyzzz{{{|||d,}d,~~~���������������������������D�D������E�E���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AAAAAACC	C	C
C
C
C
CDDEEEEEEEEEEGGGG !G !G"#G"#G$%H$%H&'&&'&()I()I*+I*+I,-I,-I./I./I0iII1I23223245J45J67K67K8889:L9:L;<L;<L=>L=>L?@??@?ABAABACDNCDNEFNEFNGHNGHNIIIJKJJKJLMOLMONOONOOPQOPQORSRRSRTURTURVWRVWRXYRXYRZ[SZ[S\]S\]S^_S^_S`aS`aSbcTbcTdeTdeTfgffgfhiUhiUjkUjkUlmUlmUnoUnoUpqUpqUrsUrsUtuWtuWvwYvwYx�YyzZyzZ{|Z{|Z}~Z}~ZSSC�C�S��������������T��������V��W��������������Y��[��������`��c�����i��h�������=�=����o��r� � �u���O��O�����������������������������������������U��U��������������������������������������������������������������������������������������A��A��I��I��O��O��U��U��U��U��U��U��U��U��U��U�����A��A��A��A��������������G��G��K��K��O��O��O��O��������J�����������G��G��������N��N��A��A������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AaABbBCcCDdDEeEFfFGgGHhHIiIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ[[[\\\]]]^^^___```AaABbBCcCDdDEeEFfFGgGHhHIiIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ{{{|||}}}~~~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y�����S��A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y���x�Y			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AaABbBCcCDdDEeEFfFGgGHhHI1IJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ[[[\\\]]]^^^___```AaABbBCcCDdDEeEFfFGgGHhH0iIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ{{{|||}}}~~~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y��������A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y���x�Y���������������������������	�	�	�
�
�
�������
�
�
������������������������������������������������������� � � �!�A�!�"�B�"�#�C�#�$�D�$�%�E�%�&�F�&�'�G�'�(�H�(�)�I�)�*�J�*�+�K�+�,�L�,�-�M�-�.�N�.�/�O�/�0�P�0�1�Q�1�2�R�2�3�S�3�4�T�4�5�U�5�6�V�6�7�W�7�8�X�8�9�Y�9�:�Z�:�;�;�;�<�<�<�=�=�=�>�>�>�?�?�?�@�@�@�!�A�!�"�B�"�#�C�#�$�D�$�%�E�%�&�F�&�'�G�'�(�H�(�)�I�)�*�J�*�+�K�+�,�L�,�-�M�-�.�N�.�/�O�/�0�P�0�1�Q�1�2�R�2�3�S�3�4�T�4�5�U�5�6�V�6�7�W�7�8�X�8�9�Y�9�:�Z�:�[�[�[�\�\�\�]�]�]�^�^�^�_�_�_�`�`�`�a�a�a�b�b�b�c�c�c�d�d�d�e�e�e�f�f�f�g�g�g�h�h�h�i�i�i�j�j�j�k�k�k�l�l�l�m�m�m�n�n�n�o�o�o�p�p�p�q�q�q�r�r�r�s�s�s�t�t�t�u�u�u�v�v�v�w�w�w�x�x�x�y�y�y�z�z�z�{�{�{�|�|�|�}�}�}�~�~�~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������$$$$$$$$$$$$$$$$$$$$$$$$$$$	$	$	$
$
$
$$$$$$$
$
$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ $ $!$!$!$"$"$"$#$#$#$$$$$$$%$%$%$&$&$&$'$'$'$($($($)$)$)$*$*$*$+$+$+$,$,$,$-$-$-$.$.$.$/$/$/$0$0$0$1$1$1$2$2$2$3$3$3$4$4$4$5$5$5$6$6$6$7$7$7$8$8$8$9$9$9$:$:$:$;$;$;$<$<$<$=$=$=$>$>$>$?$?$?$@$@$@$A$A$A$B$B$B$C$C$C$D$D$D$E$E$E$F$F$F$G$G$G$H$H$H$I$I$I$J$J$J$K$K$K$L$L$L$M$M$M$N$N$N$O$O$O$P$P$P$Q$Q$Q$R$R$R$S$S$S$T$T$T$U$U$U$V$V$V$W$W$W$X$X$X$Y$Y$Y$Z$Z$Z$[$[$[$\$\$\$]$]$]$^$^$^$_$_$_$`$`$`$a$a$a$b$b$b$c$c$c$d$d$d$e$e$e$f$f$f$g$g$g$h$h$h$i$i$i$j$j$j$k$k$k$l$l$l$m$m$m$n$n$n$o$o$o$p$p$p$q$q$q$r$r$r$s$s$s$t$t$t$u$u$u$v$v$v$w$w$w$x$x$x$y$y$y$z$z$z${${${$|$|$|$}$}$}$~$~$~$$$$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$!!!!!!!!!!!!!!!!!!!!!!!!!!!	!	!	!
!
!
!!!!!!!
!
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! !!!!!!!"!"!"!#!#!#!$!$!$!%!%!%!&!�&!'!'!'!(!(!(!)!)!)!*!k*!+!�+!,!,!,!-!-!-!.!.!.!/!/!/!0!0!0!1!1!1!2!2!2!3!3!3!4!4!4!5!5!5!6!6!6!7!7!7!8!8!8!9!9!9!:!:!:!;!;!;!<!<!<!=!=!=!>!>!>!?!?!?!@!@!@!A!A!A!B!B!B!C!C!C!D!D!D!E!E!E!F!F!F!G!G!G!H!H!H!I!I!I!J!J!J!K!K!K!L!L!L!M!M!M!N!N!N!O!O!O!P!P!P!Q!Q!Q!R!R!R!S!S!S!T!T!T!U!U!U!V!V!V!W!W!W!X!X!X!Y!Y!Y!Z!Z!Z![![![!\!\!\!]!]!]!^!^!^!_!_!_!`!p!`!a!q!a!b!r!b!c!s!c!d!t!d!e!u!e!f!v!f!g!w!g!h!x!h!i!y!i!j!z!j!k!{!k!l!|!l!m!}!m!n!~!n!o!!o!`!p!`!a!q!a!b!r!b!c!s!c!d!t!d!e!u!e!f!v!f!g!w!g!h!x!h!i!y!i!j!z!j!k!{!k!l!|!l!m!}!m!n!~!n!o!!o!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�	�
���
����	�
���
���������������( �)!�*"�+#�,$�-%�.&�/'�( �)!�*"�+#�,$�-%�.&�/'�80�91�:2�;3�<4�=5�>6�?7�80�91�:2�;3�<4�=5�>6�?7�H@�IA�JB�KC�LD�ME�FFFGGGH@�IA�JB�KC�LD�ME�NNNOOOPP�YQ�RR�[S�TT�]U�VV�_W�XXXYQ�ZZZ[S�\\\]U�^^^_W�h`�ia�jb�kc�ld�me�nf�og�h`�ia�jb�kc�ld�me�nf�og��p��q��r��s��t��u��v��w��x��y��z��{��|��}�~~~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������p��q��������������������������������������r��s��t��u��������������������������������������������v��w��������������������������������������������z��{��������������������������������������x��y��|��}�������������AABBBBBB	C	C
D
D
D
DDDDDDDEEEEEEEEEEFF !G !G"#H"#H$%H$%H&'H&'H()H()H*+H*+H,-I,-I./I./I01K01K23K23K45K45K67L67L89L89L:;L:;L<=L<=L>?M>?M@AM@AMBCMBCMDENDENFGNFGNHINHINJKNJKNLMOLMONOONOOPQOPQORSORSOTUPTUPVWPVWPXYRXYRZ[RZ[R\]R\]R^_R^_R`aS`aSbcSbcSdeSdeSfgSfgShiShiSjkTjkTlmTlmTnoTnoTpqTpqTrsUrsUtuUtuUvwUvwUxyUxyUz{Uz{U|}V|}V~V~V��W��W��W��W��W��W��W��W��W��W��X��X��X��X��Y��Y��Z��Z��Z��Z��Z��Z��H��T��W��Y���`�S��������������A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��E��E��E��E��E��E��E��E��E��E��E��E��E��E��E��E��I��I��I��I��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��O��U��U��U��U��U��U��U��U��U��U��U��U��U��U��Y��Y��Y��Y��Y��Y��Y��Y������������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///0001a12b23c34d45e56f67g78h89i9:j:;k;<l<=m=>n>?o?@p@AqABrBCsCDtDEuEFvFGwGHxHIyIJzJK{KL|LM}MN~NOOP�PQ�QR�RS�ST�TU�UV�VWWWXXXYYYZZZ[[[\\\]]]^^^___```1a12b23c34d45e56f67g78h89i9:j:;k;<l<=m=>n>?o?@p@AqABrBCsCDtDEuEFvFGwGHxHIyIJzJK{KL|LM}MN~NOOP�PQ�QR�RS�ST�TU�UV�V���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PQRSTUVWX	Y	
Z
[\
]^#_0123456789:;<=>? @ !A!"B"#C#$D$%E%&F&'G'(H()I)*J*+K+,L,-M-.N./O/0123456789:;<=>? @ !A!"B"#C#$D$%E%&F&'G'(H()I)*J*+K+,L,-M-.N./O/PQRSTUVWX	Y	
Z
[\
]^#_`a``a`bcbbcbdeddedfgffgfhihhihjkjjkjlmllmlnonnonpqppqprsrrsrtuttutvwtvwtxyxxyxz{zz{z|}||}|~~~~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������-��-��#��#��#��#��#��#��'��'��������+��+������������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDD�E�FFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AAAAEEEE	I	I
I
I
O
OOORRRRUUUUSSTTHH   !!!"#""#"$%$$%$&'A&'A()E()E*+O*+O,-O,-O./O./O01O01O23Y23Y444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRR�S��T�UUU�V��W�XXX�Y�ZZZ�[�\\\]]]^^^___�`�aaabbb�c�dddeeefffggg�h��i�jjjkkklllmmmnnn�o�pppqqq�r�sssttt�u�vvvwwwxxxyyyzzz{{{|||}}}~~~������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AAAAAACC	C	C
C
C
C
CDDEEEEEEEEEEGGGG !G !G"#G"#G$%H$%H&'&&'&()I()I*+I*+I,-I,-I./I./I0iII1I23223245J45J67K67K8889:L9:L;<L;<L=>L=>L?@??@?ABAABACDNCDNEFNEFNGHNGHNIIIJKJJKJLMOLMONOONOOPQOPQORSRRSRTURTURVWRVWRXYRXYRZ[SZ[S\]S\]S^_S^_S`aS`aSbcTbcTdeTdeTfgffgfhiUhiUjkUjkUlmUlmUnoUnoUpqUpqUrsUrsUtuWtuWvwYvwYx�YyzZyzZ{|Z{|Z}~Z}~ZSS����S��������������T��������V��W��������������Y��[��������`��c�����i��h��������������o��r�����u���O��O�����������������������������������������U��U��������������������������������������������������������������������������������������A��A��I��I��O��O��U��U��U��U��U��U��U��U��U��U�����A��A��A��A��������������G��G��K��K��O��O��O��O��������J�����������G��G��������N��N��A��A������������			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AaABbBCcCDdDEeEFfFGgGHhHIiIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ[[[\\\]]]^^^___```AaABbBCcCDdDEeEFfFGgGHhHIiIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ{{{|||}}}~~~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y��������A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y���x�Y			





   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AaABbBCcCDdDEeEFfFGgGHhHIiIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ[[[\\\]]]^^^___```AaABbBCcCDdDEeEFfFGgGHhHIiIJjJKkKLlLMmMNnNOoOPpPQqQRrRSsSTtTUuUVvVWwWXxXYyYZzZ{{{|||}}}~~~��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y�����S��A��A��A��A��A��A�����C��E��E��E��E��I��I��I��I�����N��O��O��O��O��O��������U��U��U��U��Y���x�Y                                                                        ����������������������������������������������������                                  .�@@�9�9�9��b��b��b�s\�� �k\�l\-�@@�9u��9��b��b��b��b�s\�� �k\`m\.�@@�9���9��b��b��b�s\�� �k\�m\-�@@�9|��9��b��b��b��b�s\�� �k\`n\�(�����|�9�9�9�9�s\�� �n\�o\S�`�9���|�9�9�9�s\�� `p\`q\!�`�9���|�9�9�9�9�s\�� `p\�q\S�`�94��|�9�9�9�s\�� `p\`r\��`�9|��|�9�9�9�9�s\�� `p\�r\!�`�9��|�9�9�9�9�s\�� `p\`s\�d��c��c��c��c��c��c��c��c��c��c�d��c��c��c��c��c��c��c��c��c��c�{c�oc�cc�Wc�Kc�?c�3c�'c�c�c�c��b��b��b��b��b��b��b��c��c��c��c��c��c��c��c��c��c��c"A��9=��| �9 �9 �9 �9��9�\�s\� `F\t\q��o�#�ſt[Am-�j�d�8n헧��?�O>�.	���8/�t#�����ڰͼ3�&�N|.�[�Ӿr��؇/�P�kpnJ�ؕ�nq�&�fƭ$6Z�B<T�c�sU��e�(�U��܀��n����_�S`	ed	eh	ep	e|	e�	e

�	eGA$3a1X?7GA$3a1@7�PGA$3p1113PuPGA*GA$annobin gcc 8.5.0 20210514GA$plugin name: gcc-annobinGA$running gcc 8.5.0 20210514GA*GA*GA!
GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*GOW*GA*cf_protectionGA+omit_frame_pointerGA+stack_clashGA!stack_realign
GA*FORTIFYPePGA+GLIBCXX_ASSERTIONSmariadb-10.6.22-1.module_el8.10.0+6931+d7068c7f.x86_64.debugP+��7zXZ�ִF!t/��E�F�]?�E�h=��(a�K"�`}�T:ז�v[�U)D�y�A�_����]2������_�MÞp��:�}���vv�g�k��Zb�Gi��8� y���L�/��\��0�#�_��N:(��ɯhϨ���QS��7�ʤ�6�zF���:�m���)ʟ'����=J9����{85���(�5'�K�]�����e���u0x�le����iad�M������s�����/�C?$��F�R��P�p�Ȕ�C���o^C5è�T�/�J�@���
:��0y'Ǩ��aq�9:�[B�5�п��-iA�s(G��0���0-�^�Y,o_�u3Y��"&R���Wh�:�pJ� �v$���!�WB����R���Vu	#�rU�j޵+��A*Ѕ~"��Y�f�lͳ�8�
E�U�	ȟ�Y�Cbz�pLE��֧=¢3\$��$B��HGh�1)�Ď�Kp����]a�n��1���4��l�?7��[.b�!g�u��~�_��I!D|fV�[���פ�D2�ނb��QKK'q�qًfMy���ٸ5�\&�!뽶�[��]W��"2d:"p2�ldt[ <M�3��K�(.?n+ɖ�m���@�ߛ���s,��sD'׌W�V,�.��'��>��t5�&{4�JF���}���B�	�a��뱿�#L�},��_�y���%�=�����z�=~An�(rH�I�/4;��ʈұ.�����i*Ɛ�C�ד0boei�X�{Sy�XH2�~&�=��
��A׾�nĩd\lz��d�B�#k��!(u�_K�oK��9�/��&�(咿�"�[�a�%~�#?<e�,42? ���j�Q��{��._x čт�b��f�3�K,�z�
�� ��R��gдd���PE��b����vwC>��Z���?��ƿ�j�wHA���>~%��Z�6!�y�����#�~4�Z6!���;��dԍ�P�kё��R��1~�5x���k���4�L�u����?^~>�xT�0�Fw#ԧ�=�=��!7hր�K��r�\촧��Ҧ�"#���RBͼ�W�(z��Y4�����Dn�Kv����BEJ>$Ɽ2��%�c���b�M�U:h�i}���Ƣ́�����~V�U;��qj-�~�
-#%Ȇ�%�s9�t\ڀn���c	����A���b�(�Qѱ?��˖j�Lz�e�A�/t�0�2��_�"�^��9�[�
K�n����|�|����¶�N�w�j�*����?&�j}����=��В����z�r+�7/3��8CCͲ�F���y��eR<6-�IS:3ܶ���[��33B�y��`�ߪ@�IVOIoR�Rn�_g�C��]6a}m�N:�2$�'��>�u��ׄ�cþg�M8f�t�����xN��a�1�
��B~�y�S=��`q4���P��Yx�ˍ���({&Ήc*b*T�UJ<^�|����q��i�&$���`˘>��OfL��w���]�R�
{�l^�f玹���+{��{�s����� w}k¢�o�
9��-
d �	uElj��0��w__��/JV���5��	��Ip��X�8��<�TqT={bqS��������W1�^g��С�F���]�$;���:_��W�W#�ś}$wĨ�[��/��SՔ����_$b�0��9������FmR@"�`�e��(J*�s�^�I(�q��W�቗w���2��l�ҁ����:^�Z�òiހSLt4�|B4�s8F-'�7(e��n�#��wQri��-t�#ܬ�sL�D�d`�
}8;�n�Y����J�ُivuC�j����e�����p��10?���*��>O��a��6���X�ʽ�>0��G���S��A���e�6/����V+܆�DBΆ-'a����4 #}��N@${�55!sq�X��+��s�L#��=@� ��*�?E�M6�_ȴ�b�Rڵ��܍�}��q]o�K%�����2��N<@\>�l�����&�vi(��2�n�
'�~���0�?�-���~O=�������)^A��5&N���TZ��WQ��w���*�|
j���%�H��cvuW?�����Ǿ�.�0P���C�:�lN5'6�v�n�:��C	{�i���h���U2�>�V44;�`a���i�
.pk*���b���{XXa�qHt����I�i���,�t��t#��=L�Й���H���-�~�G/��[>��̛(��e��ŞF��a;���[1��L�,
IJ��#�0�����9i��$�"ѡ������8���O�;)����&OF_'�1��'\*JWL�k�ؿ�8@a���K%����Zq�����1�q͓K���WyrCwg-���m`͛�YWəPI����ug����DM���k,�s�L���4'��r�d�I�&5�$£�mf`����]J�Y��8c�V_�5��D��O��t���
�7t��,�mI��"F���G-��!�'!�8B�kv�YR7�X�yT)���&΍VD@�����)�cL��j�")>H�G�EԖH=�7&f��ޙ/ �A�]NS�q�p���G�fHF����w�X�lM� ����L�k
BN]
���QSe4�E?a%؇���Q����L��Y
�j�eҘ<j2�Oף"5.-����"�P��[�du��&��a5yJM(����=�"�|j���gt`Q��&�N�V,�9�ij��~K�<衼��UJ��z����*ESN��{�̜�fӍ�NG:����W��Pd�(�J�?@�^�s�A��)X�g������Mv���!DyM:R���ڼ7	�	|x ��_Ao�p�D��.���? �
��
i�/�$c��)u�0w"=�v\�s-�9�R�f��Hͷ�M�-	�h���K'�	BC���	�HS�'�-5�.�S̤�?��';ُ���/��ԩ��ρ�+�]�]b2���ˮ�%� ����^�+��xQ�G�f�+.��u�Z��JRҩ�6�\�K�a*��|*������u��/"�u���ښc��hSB�F�\����D4ZO!��\��*�P�ˢ�t�����:}:-�;.�������7�ln4A`xs�*Z
��L��;��-^j)�-���0'�gS�#f����@��c����Đ��2;�?��W�1gϩ;�+��
�����뀠uYV�pZ��;B�\%�p0��f�~,��%��o4k$%oa&��2�����d�5}Y&���]G��<-�N�Hk��%6�(V��X�tSP�|��?*�lBk-걬��"|�������bUL|�J���e��vSxng�Z�������bN��k�p9L,��δka�n����i� �>4�锐^�:`���,9��
G��L��fm��#z.����
U4ᝍ+�Џ �����#L@%�������%΀&�x|�}Nz��"� �j��0�UxcfH��e9C�u-L��[0��=�lI�K'�wk�R���v�5�ڌ�|)��(�C��8��r��`n��K�s���u�������ǎ�w��t���	oK��~�m:��Q�k�s�i�����{
�_#vH�"�$�����R���1�E=@��]�l�yy�_�|�y
8��c��
�)a!2�(9fǼ�U��|�n�M��X�^�0'���ZG�b@���	Ԉ����d�dY��rd�]I�S��}3�*����M�K�� s��a�/��(\���U��o%ԝ_�[X!������P��`��̱�w%0�F�ïӧ4N^���L�CQh��LY��T���"�8��b1�3rK�Ua\8�ڀ�h�g�څ������s��&Oc�;����.(�&0��0t�~d9N�z��ּR~L��P����z$���/e���3y��8'�W|����
�B�;�Hw��2*& v�[�"?�#b^ʋ���ʼ����/�#�xx�w] ��U3�`lܬ�b�y���*=mR|+�;��%�ʨ3�3��ں�H0��gm�YRϨ+'ts;�Я�.���>��o�����mmO��I��ƐL�
�k���~
%��W�ֵ$���p� N�z}�Kj�G�z�\4V_'E���>,B�8��YZ�$�x�Vf�1y��W��̮�9���v���_�9���I3QrF�g�{<g;�R򈔲0>�c�1'/%�Ju̧���\��[�K�}������R��YQ(f���wv�Ud�z
+��e뒡
4T�k�#M��	4���KF<�B�5� !3%���v%2vo*���wv	
��S ��#`�nP�Gl�.��QD�U�\|}1v�F����p��R%���q��ޮ�@���)�t#�3sk�����$��j�nP��l,���~��/��=���@��ӿ���e��������55կ�D�!I~��csIRO#��>LJ��N1�}�2�{t]�a^�=�{d $�Q��������}q�٩n���I�?��Z/X��`���M�迃}Dn�V
H�B1P>eJzxZ��1 kx��P��Egn<+�����̇IHMC�:W�d��w�J`.�����i�������P�E��/6@c8�ÔF����<��%��`Vg1%�X�:b�y��}��\��z/�9�y����s��Ǫ��0O�wB����h0��}/sJ�f&�+�|,���9˕���RX�j�Ϥ&��N3���k�s�YP�lXS��c�h��J�N	�O�/��o��d!z��y2Y�ah���"�l���:��D�PVo�RB	�Rp������
.LA�#м�a8�)�0�B2��ƒ��;��\LV�v��S�:��k��O���P���94�XB)I�/,_���˽`�#ĝ�����m.�Z���M��wdžݺ1�fR
�7�=��Z���}5�#	���T�4����=`^P��j����R��p����u���qz#�n �w�pG��3�}�}�����<hB��6�D._@�m2��{�[�.g�]�A1-��X�+鍗8��3*X�Rg�]��z��mo�'ws�	gl�1�Kժ^��~�!+�4�Z�?�(�b���+�D�W�^�:�r�#�]/(�ɚ���Ļs�G��8�ĝ�+�om�V��yCo#�8&B��h wK�5@6,��GF�!��8��yƩ�鰡>t�'�C�#c�̡��p*�Y4]�����T4�� ���;�־�����K�;}z�)�	@���‡�D<8:?!�JU�z,N	�c�ДIf��A�m(��f�oK���c����:�	�R�r�\�6�=G!MݦԤg�l�J4��ab�<������&ۑB��5O���6shef���V�0O�I���O`/<TN$3ӴO��]s�}:��(c�Y�d����t4Hs	[�1z�}i�t�6,̱fb��E��|���ʚ�t�~.�֣��a�i0Q�f�j��e�|l)�e�u���Y�<�A��(�n|���k2d����N�2|s�Z�.��F��A,��U��ԋ�8얘Ao�f��2��ҍl,�,z��at�Ť(�^���t��D�D��/�)E�W�+ud�G:;��������� �.O	}PE�%�%q���i��R��u�}f�~�ϧf�0Of'��A���N�o~�m=�4�tV�8�x~s���zk�m4c�Z`uZX�v0	��\���S�i�3��/�}!�9Đ�m��Ö+^1��0ԓ�Nq*�h1�CM���t��k/���.�f��c;�P&�m��s�]�����Iˀ�W+.�t���~J(EÓ�L5�c3��R��Gz�s��I�4�L�0A�YC*v��f�4^��{����2�J���~��\�b���]I4z;�	O�Ruc�4�RE���	��qӢ�=����^`L�9�Ƹ��U�eyu��1�:�&�*�TK�b�J��b
�8OW첉���J��	��/x&We�A�����
 Sda����۹)G�_�qi�#�M���-
�,ޣ������L���ܤ'X�;���A;�eKp)Zq
Yp���vKf�oH��4IĨ�J�!"M���,S�m���۴%��`�H|R���t�Ռ7�.Ke�{�?]�ƟL���}�+���[�[��:��"Z'���m����*�{*=��ʡ�
�2\A�,���k�iaU�Ga&Hϝ�
Fۨ;{��
�qe���.�v�]"�p�$�˔XS� �F�}*NFZ������y)��N��/�PJ��Cf��6���)��`0nG�� r,��Pq
��������cJ���շ`���2���p�u0��u�N��Uw�I^�XNS�CL�.k��
��b�6[��	�FY,�*���3D2
bSg������'К,l��!ŠC��^=}�a�G��|�
���HZ[l�=���IU=�p�GZJ�(;w��>k‰��
�j����֦W
uh^��w?~�I���`57�@�(M:�o��h|�l2�O��PU�J���qg�Qv8c"����Co �1�R��k�vWW��w��M*by�O���w��"���x(/���e�Y�̙_s@tV���B�N���: �A6s�|�g}NC�e�g=��d��CT�+�i5��*.����L�UEBpG�=>��{��Bj�8E����D#���u�%�M�Ck9��;H���-}�2�~a�m
mqB&nal�!��i���;�u
Ҍ�l�&���3��Ink�^vt�t�q:��\kl�~�h3�-Xk����o�#+5V$�3��R�2�t��a�#f�V��LK��(=W�,‚��O��{��E�&���Sl��Q��Dr���5sv���Z���[pc(XO$�K�
YTc�*�tL�����
��e����\O��$��b�o'�d��qs���*�P�
�8}k�af�f��U�i�,ܚ��[��j@5�M��)�!8Ɵ0�4��,�V`��N�7'[�A�;�p�wU�3Q7�ѷ�q]���"�fJ@�@��E�t0��t��P	5Av+��
o�ض���UqS8�}֑��������
d��b��G��Z��*1֊!�0Q���j�7�5M�Z�y6��C���@>� x���܌��mׯ�`��Dp�� �`��F�#}q\K��[L
f������}�(�����^�G)Q�j3JW�;.���3�]==�H�b�U���st��9Zhp�⇹�)���
���7��~m�$^H���FjB�hk�_��1h0[�9�Md��d����io�Xq����+�A����:�e��%�<��)%�^�_��(
�N8�E��\f۸�r-\P����?���	f���y']Ԛ/�c��4BX�σ�J��}*�$�[�1�B�;�&"wGŠ�(CO���>�Q4��s���RB�gc�3�|�̾!��%�2���z��kƨ�Z�6dɤ:p�*U[���<�9��΄�w�S&��!�h��Nwc2��EfM��t��+�D��z.d�u���?o�YJ6J�	E?����R�4�2͟�[jT�V����v[q���v�Y�^»U���W���g�ֽg�����xc���v���*����&���Y�y���J�߰F��pT&�f��"����O��v�:��݂_��ٯ�=4�)�58�%ec�z��n���4p��Ϟ}���v?�À�]	�UKP
=�_$�u/�[�O(*�X�������	��E��uV
,��T@ `0��P2�w�=�&D�N5<6ȯA��>��Ґ�oأ'd���;$���+����yV�S�b��Rũ�=vW�!GL�žqV�Ru�ɷ�rfW�@�s�*AR���r吾np�D
��uw�;C�F��=�;�*x��Mmak�<8�Ƚ� RH	�	J����?�9y
��h�ʂ1Y�3xK����V洢�T�}}��1�%��$s�洞�9��v��"�C��J�|e&��NU
I��dj~����'u��;e�jSK����1\�=�9�_p����:��D��ې�eU�Ɵ5����k��]X;��.����G|�Nsu�3�h4�ح~���R��v
p4�R�W��}O4٤���̟���������IV�g���:z:�CC�f{�{�T�ԓ�Y���vV�qz=�f}r?��l��3h�GȪ�qc��cw���@Z{�� �:j�����/���ކ���/T�$Z
;�=�V_P^RC#�QQ�&��1c�Z@��``��V{g���X���M��=N����A=�wV��C+�t���rϘ�D񏟩ߧ�Ms-�#pPʱe1�W&F��Փ�k��o�@g�?ť����Ë:2���n�W�U�h��ޮt1O��ׂ�	�����P�G��sˣ�/I����)�&?:��Һ�v�P�x��Q㐘�0�zF�(_�B���-��-��C��`�i`�n��������zj��.7��[0lٲo���a�{D��~_5q5�P����"�����
�/�J�vF��N-z��FUǃ�)��ܠY'.G���A�6)`[�W��$I�j$9�u�-�l;q>0���ߒ���ǻI�12y���ejq��/�dr4,�&�ס
ۣ��=ϓ�x�09?]�1��	%�%��R��Q�iV�-R�74^j"�|9��.5�Hfhoyv�\�������{k�>��>_t�P~�%ܦ�́t�N�1OQ�+�&}��;L��q��jO:V��I�c�[-�)I�l��n�,2�8�6��Zڴ��A��Yn]d�&����v�����t~@[2�b\P(ɛ(3�U�QL}^��	,�U;1�$??�TեW�� A�;�W{��#	_՜��. �&%L��':��"���C8����tf}�
f�����k�^OA����:�}���yG)�!�m2~d������:v������J<�������˜4$~�r<K�I�,'T�|%�9{�i.cly��y'�X4�U��E$�%dF.��[���&�1���Y�9H���2&z	
a�c~̀Z�qO�:���j�@���U!Lo��E�i��k@'�,�'�.�L�/���^&�CԠ���{���@��:�S�eO���!P�,?�@^��[J��Ď�"�y�єecܲ�e7u�Y�b���)�sQNw��K#��36G6� Ӯ�Ƣ�DB_-G��w�`=��wYc2�I��@�����g$p;�s���;�������4`�覞����CIR���js�!\�d�r�a�w��m)o�|J���Iir��j�K{�5u*���(���X��A�E�������R�V�������'ʑg��L���ʎԀ�C�fD8�<p
�
��Ҩ�ͅ8���l����4	��D��&�+$q�,@N?� Ȭ��X�Q���e<����M�5����t�s�Ĺ�t��\�֑�w��d�i�ț7I�Av���M)`����=��;�o�&�j0P�߱I�h>	{�hԝFO4l�Y�.�/�B.���5����i��;�s��Y2Cu�K#ϲ�92�sJ9	���q�Az����ObR����cx�q2��;l�m
>S����sw�m\�u�w�	���
kn|�0�h���d�cOU�q;�u-$��o�ɴQS,J�"X��9-�*���a$2�h*��ȧ���\R�n��X`���F�6O�?�/'��L��Mf��0
�U� �����/k�>bD���mW�cV��J�JnUln��d�@�^v���b��ǂ�����qj���BY�
�b������"�b8AKW&����v�1�"=0���	����t���?!��%5����I�	��mU�UC*I�Í�Ny�N�h����Š�O�
H#1"�J
��4�Wޞ���Bԃ���\�N�8}���ӈ���WT��?�1<p��+���x�ڲ$8�Ѳ�7'ūО�`�o�딢>s� M;�PT���I�>;c����"��ۿ���mօH.�~`�A�#1	k�פ�m��J�XI��S
��$}�>N2^LQ�:��V��_����`5��v_{͵����e�=@<M���[��y���x鞽;��-$�tM�!_������+/u�'�
��Z�(�F$
i��'���h�G���q�7��r`*Aj�>�H�{:�S�����	�T��@��T(��.K3�d٥3�O���=JS�H�"u
į�a����
�������4�}f�,`�g��^�0�6�Zo��E:��'��.
��cl9�,h�[�R[�2̽
��pj(H%I
��Z혷�Gd��rO���A�.���sA�i�V��#��jQ��X���@d3NX��t��)��
L4<��r#� �۠}"t��!H�b_J��#�s(*ҙ�qí���V�Ő�f��,�8Z�_t�$���B�ѽ��,"E��'�����>b���#��h����᱘�$:?ߙ���2R=?���b?�Ll.�& ��)��B/Ůx:�^�
{�5^B�Q�P�B<��"8����?Yac2;<F��,�A
����a�8�eE;���km["]�8:ڤ>=���*�����@��-v')�^���i�N��O����_��.�3�-��Թ,bNsW������~�ߦ��8���Y�z��vo��Z�z=���{՘���I��v<�0�����t��Ff���h����t+���a�쭫���7�m��cs��&)��	"���+z��*��J�I?c�������� ݧTD��ҶU|� �{$��a�f��Oo�K��d>d��W��]ԃ	?G"��h��UZ�]Ϫ!.�í�?~^��j(�R>������T��v%R (�w��N��@��/"6� ��T,��Ykn,��ő�VP�J��춎�U+�Y��<�cFo������G�0�*m�K1T}K��g?��!p�E#�gs�
QG�SH=��y^�R����(��Ռf��W��é�@@���9�Ҝ��&{Bi;���K�/NI��n�:�|A
�+"���vi i�c�̳"�A��*1�
�"(���A4lSo��?>�0�IC�?Tg�\N����(�����],n9;�
���,0;zk�oЭ�`��60����^����=��mfSpG	:���V�n��r}��1�K�7���.�\$q�`θ}K�+աG�5���Z�?�W�2���Dʥ^~����s�V�5Y���䙄�t�mD����,
k'U�6�wj���0�1��K
๺�3��1܎]�{p��u��v"���l�q^�Qw���z}�.)�Ii��v���A�v�k]�n=�-�_?m��f�ͺ�LF\
]�>�<�U�08��~���m���-��۠|�.6�U'���L�(v3%�D��rR�$2�8#��Prj�O�6��x/���Q��2k3z��8�Ky<K��-r�N�0�ʨ�������}nr�AA1��u3�*J�k-K���Q
��{��Ӄ�P:'�'�>�y��niV�E�Sg �9y�s~▅F��YO�/�?<��]/�Q����˲c�����;�t�t�R(On��?���#�	�L4m�IN�=�]�w!�ml�����چ�n��J�Z��M�A[P���%-Υ�\�P��7s,��j|y�����G�[��wگ���}h����h��
I�@B��%��e�Cڜ����,D"�f0�QTYl����fQxʝl�x�]�5֣!ZTG=���i�B�z5�X���K@SJX>~�`1��W��H��L�}��2�`����V('I���5�ۺ#�~���c��>�=��� �� Hf�$c!_�0�/�0��v��?5��`�ij˨$�O@(y6hq��I(b��X��4Z�p�}�0?t�'���^��n	����KA�i���09ޮr�bZH��L:z��/�BgpͲ�8�uHH��UY:dn�������m	�}�B9"!(W!��hx�i�� (��V��g5w���W�>]��^�	��VG!�+�Wy�f��U�zQJ,���np�Ru%>Zn�a|XSw��hh<o���yl��GK�~��-+�ˋ�oN����3l�.�
K�dџ�ú�OXm��9��	����h�JC�o`�AUQ3Zy@w����?�ox�R�!w�4����S0���qU�J`�a��U���!u�)��T�[Q�F�98.%�ľ�U)����џ���,�������وePؼ��'�"h~�K��|\E{�|�G�%4�5��,�V[0ct���d�	��2v��
��ٟB������J��)��J��%�1���g�������r=�*�+���^/�a�QW��S�^�V�UH=�^M�y�n�{�S%�:@K��(�5l���A���]Q"|�_A�;7"���W;��0o[Q��5��1h�s^]oԖ����Ҧ.�j���}R

���r�mat���Y.r��]A�t�/NU&5�2�1�����
b��B�-$��S��s\����4�.9y�oؽ1��n�����	/�x{�P�Z��ѱ0#��
��
����'R~̊#΁�zSa}�W��O�ˑW������W�s=DQv3U�ȑ�4��9	;u�Y2���ݔ�{�O����i�j�)AS9���ۗ|���st�6����g��2����/��$G<�)�a�c?�=��Ӱ)@fp(m"&��$�A����o.���
��I`��~�.	-�o�dd�ִ�7�[i��a)%öv1�}�a�R���+�FJK��/��$�[����5��@�1���?�i�m!����$I�=m"_���Fy����킗1Z�ZJh�\�5=�;u�nb�SYװ�{�E�#3ƚ��C��VC�h�;_�����ŏ�
�sr���C"_4u��!LM�.��U��Y�f��_����fe�-���vQ�Ym���d��84"�u�{̫�^�t�"�6w���U@�}c��UШ�������9��b{=�8��)�wyX5@�����
�T��S��l���+=f�>��Q�^��!3�p�����*����r����"���HiW�L�����aU��h���fU�^5��QN����Z?���9�q�ci�y���՝�B\�*�6��L��"7��o�²:+�>;{[J��=_���
�kٯjzs�$_���S�7�ޞޅ�D��g���;�Q���: \�G�r�\�ht�E��r��&��`&J����iZ�/�a��w�ꏿu.����K�}�c�(t@�g��פn�_K%b:�r��
D�2ŽPL9��"j��QG��3��΄��c~��c��{��.�����WL�q���o��Ϣ�,top|���fȍ���;�����D�ɕ?:�<�1b\tn���A�.��7��0M�j�4�s��e�Y���ND����Yf��&ѥ���n黇O:�/Yd�y��$�xd8���~�����Gk���
�"��=ؕmz��N4;g�Av��N�t{�0{9����bU{�TZ��Su)�����^xf��)���;}ɡW�+�.���K�����W�:�*hU���&-����^�&��X�L]�LF+Z��rPk��l����	"�����TΦ�ñ�i���]1�ҵ��q������y6��w��&�%��xWI�u�
W��?FrY67,Q4��M>M�mY�-�!m������ےשx�?��
\��T�8Z�KWu����R��E��l�r�x�Ts�qc�������Wphws��̸�>U��s��x>��)Ӝ���Pz��I��ٛ�l�♷��)�����4� H����_>�����w$LJD�
&����\�/�%��Y�C��+fS���:#�(4q�;z�[X�6K:M��0_u���m{�F�>�8%�#��WKJ�y,�(l<�'��ёZ5��K�
}Y:]w(�|�-a�S��2wT2�;'3Ca���V7�H���y\!���	��z�O�g���6�sl���'W��A�89����gx���;p�)��+NJ�z�|��@�V�X:Q4j�"p��J{�Szk\l6�L��]|n���yRsA�c�;�d�ݵ"���`�?T��o��ҍ���r�^Y�vd7���ڲ^↓�bI�u��Tj"��g�l<&�p�T&�(�!+����~U��{�g74�R2���¯o��d�PW�40���x����F�F��u���eg�Q�r�o(i�wV�Rka�W���{��^�J�l�7E}0
�Uo���*Q�)����|���uC��(v� �`B�NH[�E�S_��6��#�Ie`�ʣ�K�[)��c���J���awShD�M�;��<��ٝ5�_��zw�%g��9A���2�w�軎�> y^�[�\�d
'�s��`��5��x0)�ʴQB������|[�j�$�ۼ�A���.�wk���|w�Y.��O�p�H+��;�gP�1��J���C��ٳ���2�h#_�>5/0]R���}�X7x�M�"�'h�5�c����Q��x�{L򢋐��O�i�?��1})^����yڅ9�$0`�bu�7(u��R���u� 9[�9��P̎�ٸ�q��^�j��~��'���gLX���&>p��U�S*��q��C�����n?�|��N����h`���є�#	a@�+E��3[�m��TG�Zn�p_�	�����4�d���l`���ˆ�Pά$��C�@{��s/A��v/�9�I�7������&==7���I��E��[,i$��D�I���
�n�'����
��<3AyA�`wŇ�~�7��{����$	!�� ��e鯃yOi-��o?�B�[[��M�e���U��I�^�Cd��/���0���2Ϝ��69�A#_HF�"�9���~�`dXt ��$��|C��[�'K�^&
uje71^�a�'��-�˼$��Z����+��#�yL�`�1�0xmOE\��A+c�@�¡ѣv��&��jtK��w��!in+�ҖDz#�Sg��Ҥa\�U� ��v�R�"��U�v*����RQ���b���X�r���y�
@o{
�z9�q���֥n
��T�}�*��5���g"���]!־a��&��-U�9�>��8ȏd�:������!�9�8��)�hu7
��m��̏˶
��2�W�n�p�*Cs-'����ka��]
���z�%OlYѐ]�|G4�.sןwL��	�bn�i����Va���K$�i���Q-���e��V�b2�w��zp�D��HR�b�Zk��4�Gf�Y���Kz�~����MF��$�?�Xo�򻔀H2�Ե��������2�8ZJ��S�Y{�tM�nL�_R��t���`s�M?+D~QH%M�w:rVU����n�AJӍ7��A�eZF��!����)$=��7��m:�nQ�;��F�4�j^s�?�&a*��P����H� ��.V�e�t����HR������:ܝ�]|F�-g�X�Rs:���6|	��s%��;�yo�P�5�{���&�h�)�f�A�2T��+mh���$O�_osou�Jas[�\%�U���&S(�S)�TR&U�d4���;ȱ�H>�S��*[g�<�k1�����`��i�mK%��>�~�(�5h$��j!(6GW����t�
eqr�V"ܳ�O��$����
��ag��L�	�f˹�X���ְ	�*��g=
֓6�j�:��2q�K���I�yy]�N��7[�?m3~���Ek-����fϹS4�k��`Ͼ$KΕ�C���rNJ�Q*�!�88Z��u�0EЎ�}��mB��.�����Dyb��B���Uב�QZR��j�ƚ��zX��=4U{\�8yp�g�����-�rxl�e�!]�n��Y�#�w(�Q� X3
�9RK�8��`���v�`h�M��$�5*�R��
r�d�L}��2Bƍ�ΝQ"�V�s ���q�c=�z�ph4��]d����K�жH� pn��ip@ʈI�V�8q��-�
��W\�Fl�z5h=���%���HhqS��i4��D�G
���ԟq�U�L$�Z�Ps4�z�x����'�P�<u���Q6��Hm��O�rb�6�lk��x��ӈ� �I�^�	"��'�CR=}��;�փ�����P՗z��̘��$����~8�<�׆Ah������D?�U)n�rԭ�]3��!��‘�D�N�Am�-�lN)W�#���u�N�ڠ
Ʃ�h��	E9� �,F��%��t��؈�����9M`���'EZ%�b	<|�f�'	W��V�H�r��?[���9��%[��`��b��N1����A|��}K����Î�Y۲�,fq���R��(����)��_8�;݇qА�߄C���Vy!��x��>��>.��Ju���^
u�a���&(�@��=�����2��Q���q.�E�o����<j[���#s�fTY�	3���b�UI�ɤ���X� !�b�wD��	�#r�����c���۞c�"���i����>����	b�XE��w���0��V\T^����;֨��9�����~=��ٻ2�ك���B��q0d�ZB>>�e�9$�C�'P��}"�4k�w�wg.l���u�1�fBbᾁ�
�o���͝V���3{.б�"��:�M
�����'��ʑ>��5ޡ8��L_�4x��ëG�Yo]f�ft�|���L���DA33�yo�%���D�Z'}�?�D��i�qN���\���o�$�׺�:�;�y��x����#�v�Q��)ï܇���"�.$h�d�k=͈]𙭎*;���M�d��i�P,����ֵ���ۭ��5��=���:$��tnz�0!X9V�9Γ�x��4�yN�6/[@�V��p�.cE�Z��T��(.2O�����C�Շ ��k�/�]�$�zxs3q:{MF���K/'�M\�a\�'��dO�)�	��.�����Z�^C��s�tw��n�GgL���R�ʨ���;�'FP�1UZ�
�O�q��W3]5Ocn�{��):Z��;��v
�wԂ�Zm0Q0�Z���5߇��w��Q��oF~y��D�܌G�jH\��f�U3��*�_�!��ɤ�_�ruK�o�O�$�x��I�u8:0�e�&��V���:T��}��0�q7��3�E�n��H��{.��7��k��SA�C�P*J��n}i}�;
֕��]��Jk�����k���>PG�o��}����SC�v�*�@�n���Ƹr�'������oH��een�IY鈪DV���G�[M$wz!C}�^�c�l���ZE�hyz2�߱��&�d��\%Bb_4���z$VB��נ-/��#�ز�!�������q���ѐ��f9ؠ��24x ����$�L5�v��vc1���5��׵���i��PBi<�*F&�H	�������&�U"����A���4'�\��B?�6HG���� "h���1\����nLn\��q�]����y�՚(�Fʞ�sS�2��'�P&ӹ�׈w�y����g��+mY -�e�H��ا����WUT�ry�6d����o�&�f��� 4>��W_�Z6R��~�E�S��)����ɍ����;i��g�YZ.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.gcc_except_table.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88TT !tt$4���o���6>`9`9h�F�	�	�N���o����^[���o���j����2tB�����~XXy����P%P%%+�xPxP
��P�P`|( ��9�9F� : :�P�d;d;��hj[hj;�xj[xj;��j[�j;�	 �pt\pt<��w\w<���\�<Ȋ ��
e�
E@�  ��
El4
ED%x
E�FhTE4czech/errmsg.sys000064400000231730150343472770007721 0ustar00��*o�	�=�659>9CM1,2B,636:@T459F<$*$@"*@3KFH".!G1#% /'&&#1.6##0&"))(CJG2CIL*!9THSOC!\LR2`$ !5JA0*(�,$%'#O*"A�~Dx!.-C+#{DdX6;�:(%�LNcjC%b7!Y'K?/(+6767:9>e%-<=Dg,.7O07j#E''4h)H`>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?58|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7#FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�-i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;In�hashchkisamchkNEANONemohu vytvořit soubor '%-.200s' (chybový kód: %M)Nemohu vytvořit tabulku %`s.%`s (chybový kód: %M)Nemohu vytvořit databázi '%-.192s' (chybový kód: %M)Nemohu vytvořit databázi '%-.192s'; databáze již existujeNemohu zrušit databázi '%-.192s', databáze neexistujeChyba při rušení databáze (nemohu vymazat '%-.192s', chyba %M)Chyba při rušení databáze (nemohu vymazat adresář '%-.192s', chyba %M)Chyba při výmazu '%-.192s' (chybový kód: %M)Nemohu číst záznam v systémové tabulceNemohu získat stav '%-.200s' (chybový kód: %M)Chyba při zjišťování pracovní adresář (chybový kód: %M)Nemohu uzamknout soubor (chybový kód: %M)Nemohu otevřít soubor '%-.200s' (chybový kód: %M)Nemohu najít soubor '%-.200s' (chybový kód: %M)Nemohu číst adresář '%-.192s' (chybový kód: %M)Nemohu změnit adresář na '%-.192s' (chybový kód: %M)Záznam byl změněn od posledního čtení v tabulce '%-.192s'Disk je plný (%s), čekám na uvolnění nějakého místa ... (chybový kód: %M)Nemohu zapsat, zdvojený klíč v tabulce '%-.192s'Chyba při zavírání '%-.192s' (chybový kód: %M)Chyba při čtení souboru '%-.200s' (chybový kód: %M)Chyba při přejmenování '%-.210s' na '%-.210s' (chybový kód: %M)Chyba při zápisu do souboru '%-.200s' (chybový kód: %M)'%-.192s' je zamčen proti změnámTřídění přerušenoPohled '%-.192s' pro '%-.192s' neexistujeGot error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionNemohu najít záznam v '%-.192s'Nesprávná informace v souboru '%-.200s'Nesprávný klíč pro tabulku '%-.200s'; pokuste se ho opravitStarý klíčový soubor pro '%-.192s'; opravte ho'%-.192s' je jen pro čteníMálo paměti. Přestartujte daemona a zkuste znovu (je potřeba %d bytů)Málo paměti pro třídění. Zvyšte velikost třídícího bufferuNeočekávaný konec souboru při čtení '%-.192s' (chybový kód: %M)Příliš mnoho spojeníMálo prostoru/paměti pro threadNemohu zjistit jméno stroje pro Vaši adresuChyba při ustavování spojeníPřístup pro uživatele '%s'@'%s' k databázi '%-.192s' není povolenPřístup pro uživatele '%s'@'%s' (s heslem %s)Nebyla vybrána žádná databázeNeznámý příkazSloupec '%-.192s' nemůže být nullNeznámá databáze '%-.192s'Tabulka '%-.192s' již existujeNeznámá tabulka '%-.100T'Sloupec '%-.192s' v %-.192s není zcela jasnýProbíhá ukončování práce serveruNeznámý sloupec '%-.192s' v %-.192sPoužité '%-.192s' nebylo v group byNemohu použít group na '%-.192s'Příkaz obsahuje zároveň funkci sum a sloupcePočet sloupců neodpovídá zadané hodnotěJméno identifikátoru '%-.100T' je příliš dlouhéZdvojené jméno sloupce '%-.192s'Zdvojené jméno klíče '%-.192s'Zdvojený klíč '%-.192T' (číslo klíče %d)Chybná specifikace sloupce '%-.192s'%s blízko '%-.80T' na řádku %dVýsledek dotazu je prázdnýNejednoznačná tabulka/alias: '%-.192s'Chybná defaultní hodnota pro '%-.192s'Definováno více primárních klíčůZadáno příliš mnoho klíčů, je povoleno nejvíce %d klíčůZadáno příliš mnoho část klíčů, je povoleno nejvíce %d částíZadaný klíč byl příliš dlouhý, největší délka klíče je %dKlíčový sloupec '%-.192s' v tabulce neexistujeBLOB column %`s can't be used in key specification in the %s tablePříliš velká délka sloupce '%-.192s' (nejvíce %lu). Použijte BLOBMůžete mít pouze jedno AUTO pole a to musí být definováno jako klíčCould not delete gtid domain. Reason: %s.%s (%s): normální ukončení%s: přijat signal %d, končím!%s: ukončení práce hotovo%s: násilné uzavření threadu %ld uživatele '%-.48s'Nemohu vytvořit IP socketTabulka '%-.192s' nemá index odpovídající CREATE INDEX. Vytvořte tabulku znovuArgument separátoru položek nebyl očekáván. Přečtěte si manuálNení možné použít pevný rowlength s BLOBem. Použijte 'fields terminated by'Soubor '%-.128s' musí být v adresáři databáze nebo čitelný pro všechnySoubor '%-.200s' již existujeZáznamů: %ld  Vymazáno: %ld  Přeskočeno: %ld  Varování: %ldZáznamů: %ld  Zdvojených: %ldChybná podčást klíče -- není to řetězec nebo je delší než délka části klíčeNení možné vymazat všechny položky s ALTER TABLE. Použijte DROP TABLENemohu zrušit (DROP %s) %`-.192s. Zkontrolujte, zda neexistují záznamy/klíčeZáznamů: %ld  Zdvojených: %ld  Varování: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataNeznámá identifikace threadu: %luNejste vlastníkem threadu %lldNejsou použity žádné tabulkyPříliš mnoho řetězců pro sloupec %-.192s a SETNemohu vytvořit jednoznačné jméno logovacího souboru %-.200s.(1-999)Tabulka '%-.192s' byla zamčena s READ a nemůže být změněnaTabulka '%-.192s' nebyla zamčena s LOCK TABLESYou should never see itNepřípustné jméno databáze '%-.100T'Nepřípustné jméno tabulky '%-.100s'Zadaný SELECT by procházel příliš mnoho záznamů a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v pořádku, použijte SET SQL_BIG_SELECTS=1Neznámá chybaNeznámá procedura %-.192sChybný počet parametrů procedury %-.192sChybné parametry procedury %-.192sNeznámá tabulka '%-.192s' v %-.32sPoložka '%-.192s' je zadána dvakrátNesprávné použití funkce groupTabulka '%-.192s' používá rozšíření, které v této verzi MariaDB neníTabulka musí mít alespoň jeden sloupecTabulka '%-.192s' je plnáNeznámá znaková sada: '%-.64s'Příliš mnoho tabulek, MariaDB jich může mít v joinu jen %dPříliš mnoho položekŘádek je příliš velký. Maximální velikost řádku, nepočítaje položky blob, je %ld. Musíte změnit některé položky na blobPřetečení zásobníku threadu: použito %ld z %ld. Použijte 'mariadbd --thread_stack=#' k zadání většího zásobníkuV OUTER JOIN byl nalezen křížový odkaz. Prověřte ON podmínkyTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerNemohu načíst funkci '%-.192s'Nemohu inicializovat funkci '%-.192s'; %-.80sPro sdílenou knihovnu nejsou povoleny cestyFunkce '%-.192s' již existujeNemohu otevřít sdílenou knihovnu '%-.192s' (errno: %d, %-.128s)Nemohu najít funkci '%-.128s' v knihovněFunkce '%-.192s' není definovánaStroj '%-.64s' je zablokován kvůli mnoha chybám při připojování. Odblokujete použitím 'mariadb-admin flush-hosts'Stroj '%-.64s' nemá povoleno se k tomuto MariaDB serveru připojitPoužíváte MariaDB jako anonymní uživatel a anonymní uživatelé nemají povoleno měnit heslaNa změnu hesel ostatním musíte mít právo provést update tabulek v databázi mysqlV tabulce user není žádný odpovídající řádekNalezených řádků: %ld  Změněno: %ld  Varování: %ldNemohu vytvořit nový thread (errno %M). Pokud je ještě nějaká volná paměť, podívejte se do manuálu na část o chybách specifických pro jednotlivé operační systémyPočet sloupců neodpovídá počtu hodnot na řádku %luNemohu znovuotevřít tabulku: '%-.192sNeplatné užití hodnoty NULLRegulární výraz vrátil chybu: %sPokud není žádná GROUP BY klauzule, není dovoleno současné použití GROUP položek (MIN(),MAX(),COUNT()...) s ne GROUP položkamiNeexistuje odpovídající grant pro uživatele '%-.48s' na stroji '%-.64s'%-.100T příkaz nepřístupný pro uživatele: '%s'@'%s' pro tabulku %`s.%`s%-.32s příkaz nepřístupný pro uživatele: '%s'@'%s' pro sloupec '%-.192s' v tabulce '%-.192s'Neplatný příkaz GRANT/REVOKE. Prosím, přečtěte si v manuálu, jaká privilegia je možné použítArgument příkazu GRANT uživatel nebo stroj je příliš dlouhýTabulka '%-.192s.%-.192s' neexistujeNeexistuje odpovídající grant pro uživatele '%-.48s' na stroji '%-.64s' pro tabulku '%-.192s'Použitý příkaz není v této verzi MariaDB povolenVaše syntaxe je nějaká divnáZpožděný insert threadu nebyl schopen získat požadovaný zámek pro tabulku %-.192sPříliš mnoho zpožděných threadůZrušeno spojení %ld do databáze: '%-.192s' uživatel: '%-.48s' (%-.64s)Zjištěn příchozí packet delší než 'max_allowed_packet'Zjištěna chyba při čtení z roury spojeníZjištěna chyba fcntl()Příchozí packety v chybném pořadíNemohu rozkomprimovat komunikační packetZjištěna chyba při čtení komunikačního packetuZjištěn timeout při čtení komunikačního packetuZjištěna chyba při zápisu komunikačního packetuZjištěn timeout při zápisu komunikačního packetuVýsledný řetězec je delší než 'max_allowed_packet'Typ použité tabulky (%s) nepodporuje BLOB/TEXT sloupceTyp použité tabulky (%s) nepodporuje AUTO_INCREMENT sloupceINSERT DELAYED není možno s tabulkou '%-.192s' použít, protože je zamčená pomocí LOCK TABLESNesprávné jméno sloupce '%-.100s'The storage engine %s can't index column %`sVšechny tabulky v MERGE tabulce nejsou definovány stejněKvůli unique constraintu nemozu zapsat do tabulky '%-.192s'BLOB sloupec '%-.192s' je použit ve specifikaci klíče bez délkyVšechny části primárního klíče musejí být NOT NULL; pokud potřebujete NULL, použijte UNIQUEVýsledek obsahuje více než jeden řádekTento typ tabulky vyžaduje primární klíčTato verze MariaDB není zkompilována s podporou RAIDUpdate tabulky bez WHERE s klíčem není v módu bezpečných update dovolenoKlíč '%-.192s' v tabulce '%-.192s' neexistujeNemohu otevřít tabulkuHandler tabulky nepodporuje %sProvedení tohoto příkazu není v transakci dovolenoChyba %M při COMMITChyba %M při ROLLBACKChyba %M při FLUSH_LOGSChyba %M při CHECKPOINTSpojení %lld do databáze: '%-.192s' uživatel: '%-.48s' stroj: '%-.64s'%-.64s (%-.64s) bylo přerušenoYou should never see itBinlog closed, cannot RESET MASTERPřebudování indexu dumpnuté tabulky '%-.192s' nebylo úspěšnéChyba masteru: '%-.64s'Síťová chyba při čtení z masteruSíťová chyba při zápisu na masterŽádný sloupec nemá vytvořen fulltextový indexNemohu provést zadaný příkaz, protože existují aktivní zamčené tabulky nebo aktivní transakceNeznámá systémová proměnná '%-.*s'Tabulka '%-.192s' je označena jako porušená a měla by být opravenaTabulka '%-.192s' je označena jako porušená a poslední (automatická?) oprava se nezdařilaSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionZvojený klíč '%-.64T' (číslo klíče '%-.192s')Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTPřístup pro uživatele '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionZdvojený klíč (číslo klíče '%-.192s')Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disableditalian/errmsg.sys000064400000233637150343472770010256 0ustar00���-o��=�125=9[V9767+23:;BP@49E;2&+2@+(@8INL'LE>+!)+(&L;6! ,*#+*>K5CBC*'8 jIX\?�SR0`(0@PH� 6,($1T(&?
v~Ox+80"H9&oMDu>5�C+sAE^k7(YF#Y I:8!5:;9:=EJ�$-NIY�*4Af7-4')++`#E/)PT)Gbz�{TkqHJ3,K`MO0eI7]XX1/48OW4EJgc2E0d 4GF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w>_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?28|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7/FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�)i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkNOSIImpossibile creare il file '%-.200s' (errno: %M)Impossibile creare la tabella %`s.%`s (errno: %M)Impossibile creare il database '%-.192s' (errno: %M)Impossibile creare il database '%-.192s'; il database esisteImpossibile cancellare '%-.192s'; il database non esisteErrore durante la cancellazione del database (impossibile cancellare '%-.192s', errno: %M)Errore durante la cancellazione del database (impossibile rmdir '%-.192s', errno: %M)Errore durante la cancellazione di '%-.192s' (errno: %M)Impossibile leggere il record dalla tabella di sistemaImpossibile leggere lo stato di '%-.200s' (errno: %M)Impossibile leggere la directory di lavoro (errno: %M)Impossibile il locking il file (errno: %M)Impossibile aprire il file: '%-.200s' (errno: %M)Impossibile trovare il file: '%-.200s' (errno: %M)Impossibile leggere la directory di '%-.192s' (errno: %M)Impossibile cambiare la directory in '%-.192s' (errno: %M)Il record e` cambiato dall'ultima lettura della tabella '%-.192s'Disco pieno (%s). In attesa che qualcuno liberi un po' di spazio... (errno: %M)Scrittura impossibile: chiave duplicata nella tabella '%-.192s'Errore durante la chiusura di '%-.192s' (errno: %M)Errore durante la lettura del file '%-.200s' (errno: %M)Errore durante la rinominazione da '%-.210s' a '%-.210s' (errno: %M)Errore durante la scrittura del file '%-.200s' (errno: %M)'%-.192s' e` soggetto a lock contro i cambiamentiOperazione di ordinamento abbandonataLa view '%-.192s' non esiste per '%-.192s'Rilevato l'errore %M dal gestore delle tabelle %sStorage engine %s of the table %`s.%`s doesn't have this optionImpossibile trovare il record in '%-.192s'Informazione errata nel file: '%-.200s'File chiave errato per la tabella : '%-.200s'; prova a riparaloFile chiave vecchio per la tabella '%-.192s'; riparalo!'%-.192s' e` di sola letturaMemoria esaurita. Fai ripartire il demone e riprova (richiesti %d bytes)Memoria per gli ordinamenti esaurita. Incrementare il 'sort_buffer' al demoneFine del file inaspettata durante la lettura del file '%-.192s' (errno: %M)Troppe connessioniFine dello spazio/memoria per i threadImpossibile risalire al nome dell'host dall'indirizzo (risoluzione inversa)Negoziazione impossibileAccesso non consentito per l'utente: '%s'@'%s' al database '%-.192s'Accesso non consentito per l'utente: '%s'@'%s' (Password: %s)Nessun database selezionatoComando sconosciutoLa colonna '%-.192s' non puo` essere nullaDatabase '%-.192s' sconosciutoLa tabella '%-.192s' esiste gia`Tabella '%-.100T' sconosciutaColonna: '%-.192s' di %-.192s e` ambiguaShutdown del server in corsoColonna sconosciuta '%-.192s' in '%-.192s'Usato '%-.192s' che non e` nel GROUP BYImpossibile raggruppare per '%-.192s'Il comando ha una funzione SUM e una colonna non specificata nella GROUP BYIl numero delle colonne non e` uguale al numero dei valoriIl nome dell'identificatore '%-.100T' e` troppo lungoNome colonna duplicato '%-.192s'Nome chiave duplicato '%-.192s'Valore duplicato '%-.192T' per la chiave %dSpecifica errata per la colonna '%-.192s'%s vicino a '%-.80T' linea %dLa query e` vuotaTabella/alias non unico: '%-.192s'Valore di default non valido per '%-.192s'Definite piu` chiave primarieTroppe chiavi. Sono ammesse max %d chiaviTroppe parti di chiave specificate. Sono ammesse max %d partiLa chiave specificata e` troppo lunga. La max lunghezza della chiave e` %dLa colonna chiave '%-.192s' non esiste nella tabellaBLOB column %`s can't be used in key specification in the %s tableLa colonna '%-.192s' e` troppo grande (max=%lu). Utilizza un BLOBPuo` esserci solo un campo AUTO e deve essere definito come chiaveCould not delete gtid domain. Reason: %s.%s (%s): Shutdown normale%s: Ricevuto segnale %d. Interruzione!%s: Shutdown completato%s: Forzata la chiusura del thread %ld utente: '%-.48s'Impossibile creare il socket IPLa tabella '%-.192s' non ha nessun indice come quello specificatato dalla CREATE INDEX. Ricrea la tabellaL'argomento 'Field separator' non e` quello atteso. Controlla il manualeNon possono essere usate righe a lunghezza fissa con i BLOB. Usa 'FIELDS TERMINATED BY'Il file '%-.128s' deve essere nella directory del database e deve essere leggibile da tuttiIl file '%-.200s' esiste gia`Records: %ld  Cancellati: %ld  Saltati: %ld  Avvertimenti: %ldRecords: %ld  Duplicati: %ldSotto-parte della chiave errata. La parte di chiave utilizzata non e` una stringa o la lunghezza e` maggiore della parte di chiaveNon si possono cancellare tutti i campi con una ALTER TABLE. Utilizzare DROP TABLEImpossibile cancellare (DROP %s) %`-.192s. Controllare che il campo chiave esistaRecords: %ld  Duplicati: %ld  Avvertimenti: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataThread id: %lu sconosciutoUtente non proprietario del thread %lldNessuna tabella usataTroppe stringhe per la colonna %-.192s e la SETImpossibile generare un nome del file log unico %-.200s.(1-999)La tabella '%-.192s' e` soggetta a lock in lettura e non puo` essere aggiornataNon e` stato impostato il lock per la tabella '%-.192s' con LOCK TABLESYou should never see itNome database errato '%-.100T'Nome tabella errato '%-.100s'La SELECT dovrebbe esaminare troppi record e usare troppo tempo. Controllare la WHERE e usa SET SQL_BIG_SELECTS=1 se e` tutto a postoErrore sconosciutoProcedura '%-.192s' sconosciutaNumero di parametri errato per la procedura '%-.192s'Parametri errati per la procedura '%-.192s'Tabella '%-.192s' sconosciuta in %-.32sCampo '%-.192s' specificato 2 volteUso non valido di una funzione di raggruppamentoLa tabella '%-.192s' usa un'estensione che non esiste in questa versione di MariaDBUna tabella deve avere almeno 1 colonnaLa tabella '%-.192s' e` pienaSet di caratteri '%-.64s' sconosciutoTroppe tabelle. MariaDB puo` usare solo %d tabelle in una joinTroppi campiRiga troppo grande. La massima grandezza di una riga, non contando i BLOB, e` %ld. Devi cambiare alcuni campi in BLOBThread stack overrun:  Usati: %ld di uno stack di %ld.  Usa 'mariadbd --thread_stack=#' per specificare uno stack piu` grandeTrovata una dipendenza incrociata nella OUTER JOIN. Controlla le condizioni ONTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerImpossibile caricare la funzione '%-.192s'Impossibile inizializzare la funzione '%-.192s'; %-.80sNon sono ammessi path per le librerie condivisaLa funzione '%-.192s' esiste gia`Impossibile aprire la libreria condivisa '%-.192s' (errno: %d, %-.128s)Impossibile trovare la funzione '%-.128s' nella libreriaLa funzione '%-.192s' non e` definitaSistema '%-.64s' bloccato a causa di troppi errori di connessione. Per sbloccarlo: 'mariadb-admin flush-hosts'Al sistema '%-.64s' non e` consentita la connessione a questo server MariaDBImpossibile cambiare la password usando MariaDB come utente anonimoE` necessario il privilegio di update sulle tabelle del database mysql per cambiare le password per gli altri utentiImpossibile trovare la riga corrispondente nella tabella userRows riconosciute: %ld  Cambiate: %ld  Warnings: %ldImpossibile creare un nuovo thread (errno %M). Se non ci sono problemi di memoria disponibile puoi consultare il manuale per controllare possibili problemi dipendenti dal SOIl numero delle colonne non corrisponde al conteggio alla riga %luImpossibile riaprire la tabella: '%-.192s'Uso scorretto del valore NULLErrore '%s' da regexpIl mescolare funzioni di aggregazione (MIN(),MAX(),COUNT()...) e non e` illegale se non c'e` una clausula GROUP BYGRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s'Comando %-.100T negato per l'utente: '%s'@'%s' sulla tabella %`s.%`sComando %-.32s negato per l'utente: '%s'@'%s' sulla colonna '%-.192s' della tabella '%-.192s'Comando GRANT/REVOKE illegale. Prego consultare il manuale per sapere quali privilegi possono essere usatiL'argomento host o utente per la GRANT e` troppo lungoLa tabella '%-.192s.%-.192s' non esisteGRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s' sulla tabella '%-.192s'Il comando utilizzato non e` supportato in questa versione di MariaDBErrore di sintassi nella query SQLIl thread di inserimento ritardato non riesce ad ottenere il lock per la tabella %-.192sTroppi threads ritardati in usoInterrotta la connessione %ld al db: '%-.192s' utente: '%-.48s' (%-.64s)Ricevuto un pacchetto piu` grande di 'max_allowed_packet'Rilevato un errore di lettura dalla pipe di connessioneRilevato un errore da fcntl()Ricevuti pacchetti non in ordineImpossibile scompattare i pacchetti di comunicazioneRilevato un errore ricevendo i pacchetti di comunicazioneRilevato un timeout ricevendo i pacchetti di comunicazioneRilevato un errore inviando i pacchetti di comunicazioneRilevato un timeout inviando i pacchetti di comunicazioneLa stringa di risposta e` piu` lunga di 'max_allowed_packet'Il tipo di tabella usata (%s) non supporta colonne di tipo BLOB/TEXTIl tipo di tabella usata (%s) non supporta colonne di tipo AUTO_INCREMENTL'inserimento ritardato (INSERT DELAYED) non puo` essere usato con la tabella '%-.192s', perche` soggetta a lock da 'LOCK TABLES'Nome colonna '%-.100s' non correttoThe storage engine %s can't index column %`sNon tutte le tabelle nella tabella di MERGE sono definite in maniera identicaImpossibile scrivere nella tabella '%-.192s' per limitazione di unicita`La colonna '%-.192s' di tipo BLOB e` usata in una chiave senza specificarne la lunghezzaTutte le parti di una chiave primaria devono essere dichiarate NOT NULL; se necessitano valori NULL nelle chiavi utilizzare UNIQUEIl risultato consiste di piu` di una rigaQuesto tipo di tabella richiede una chiave primariaQuesta versione di MariaDB non e` compilata con il supporto RAIDIn modalita` 'safe update' si e` cercato di aggiornare una tabella senza clausola WHERE su una chiaveLa chiave '%-.192s' non esiste nella tabella '%-.192s'Impossibile aprire la tabellaIl gestore per la tabella non supporta il %sNon puoi eseguire questo comando in una transazioneRilevato l'errore %M durante il COMMITRilevato l'errore %M durante il ROLLBACKRilevato l'errore %M durante il FLUSH_LOGSRilevato l'errore %M durante il CHECKPOINTInterrotta la connessione %lld al db: ''%-.192s' utente: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFallita la ricostruzione dell'indice della tabella copiata '%-.192s'Errore dal master: '%-.64sErrore di rete durante la ricezione dal masterErrore di rete durante l'invio al masterImpossibile trovare un indice FULLTEXT che corrisponda all'elenco delle colonneImpossibile eseguire il comando richiesto: tabelle sotto lock o transazione in attoVariabile di sistema '%-.*s' sconosciutaLa tabella '%-.192s' e` segnalata come corrotta e deve essere riparataLa tabella '%-.192s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallitaAttenzione: Alcune delle modifiche alle tabelle non transazionali non possono essere ripristinate (roll back impossibile)La transazione a comandi multipli (multi-statement) ha richiesto piu` di 'max_binlog_cache_size' bytes di disco: aumentare questa variabile di mariadbd e riprovareQuesta operazione non puo' essere eseguita con un database 'slave' '%2$*1$s' che gira, lanciare prima STOP SLAVE '%2$*1$s'Questa operaione richiede un database 'slave', configurarlo ed eseguire START SLAVEIl server non e' configurato come 'slave', correggere il file di configurazione cambiando CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logImpossibile creare il thread 'slave', controllare le risorse di sistemaL'utente %-.64s ha gia' piu' di 'max_user_connections' connessioni attiveSi possono usare solo espressioni costanti con SETE' scaduto il timeout per l'attesa del lockIl numero totale di lock e' maggiore della grandezza della tabella di lockI lock di aggiornamento non possono essere acquisiti durante una transazione 'READ UNCOMMITTED'DROP DATABASE non e' permesso mentre il thread ha un lock globale di letturaCREATE DATABASE non e' permesso mentre il thread ha un lock globale di letturaArgomenti errati a %sA '%s'@'%s' non e' permesso creare nuovi utentiDefinizione della tabella errata; tutte le tabelle di tipo MERGE devono essere nello stesso databaseTrovato deadlock durante il lock; Provare a far ripartire la transazioneLa tabella usata (%s) non supporta gli indici FULLTEXTImpossibile aggiungere il vincolo di integrita' referenziale (foreign key constraint) a `%s`Impossibile aggiungere la riga: un vincolo d'integrita' referenziale non e' soddisfattoImpossibile cancellare la riga: un vincolo d'integrita' referenziale non e' soddisfattoErrore durante la connessione al master: %-.128sErrore eseguendo una query sul master: %-.128sErrore durante l'esecuzione del comando %s: %-.128sUso errato di %s e %sLa SELECT utilizzata ha un numero di colonne differenteImpossibile eseguire la query perche' c'e' un conflitto con in lock di letturaE' disabilitata la possibilita' di mischiare tabelle transazionali e non-transazionaliL'opzione '%s' e' stata usata due volte nel comandoL'utente '%-.64s' ha ecceduto la risorsa '%s' (valore corrente: %ld)Accesso non consentito. Serve il privilegio %-.128s per questa operazioneLa variabile '%-.64s' e' una variabile locale ( SESSION ) e non puo' essere cambiata usando SET GLOBALLa variabile '%-.64s' e' una variabile globale ( GLOBAL ) e deve essere cambiata usando SET GLOBALLa variabile '%-.64s' non ha un valore di defaultAlla variabile '%-.64s' non puo' essere assegato il valore '%-.200T'Tipo di valore errato per la variabile '%-.64s'Alla variabile '%-.64s' e' di sola scrittura quindi puo' essere solo assegnato un valore, non lettoUso/posizione di '%s' sbagliatoQuesta versione di MariaDB non supporta ancora '%s'Errore fatale %d: '%-.320s' dal master leggendo i dati dal log binarioSlave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYImpossibile creare il server esterno '%s' poiché esiste giàThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionValore duplicato '%-.64T' per la chiave '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAccesso non consentito per l'utente: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionValore duplicato per la chiave '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmysql-log-rotate000064400000001576150343472770007734 0ustar00# This logname can be set in /etc/my.cnf
# by setting the variable "log-error"
# in the [mysqld] section as follows:
#
# [mysqld]
# log-error=/var/lib/mysql/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
# content:
#
# [mysqladmin]
# password = <secret> 
# user= root
#
# where "<secret>" is the password. 
#
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !

/var/lib/mysql/mysqld.log {
        # create 600 mysql mysql
        su mysql mysql
        notifempty
        daily
        rotate 3
        missingok
        compress
    postrotate
	# just if mariadbd is really running
	if test -x /usr/bin/mysqladmin && \
	   /usr/bin/mysqladmin ping &>/dev/null
	then
	   /usr/bin/mysqladmin --local flush-error-log \
              flush-engine-log flush-general-log flush-slow-log
	fi
    endscript
}
romanian/errmsg.sys000064400000233157150343472770010436 0ustar00���,o�	�=�0+4AEEE2=4D%3233?PC'-@.@*-@',I;YgI)*HD-' +*(')773%#,/%3'//I,CU{*!BU[U�P�N?<`'(06J1-'�7-#*$S-#N��Yx!,3@* rF}uBO�C$%5wXJ`_A#~DZ-P<1-GHHEI8AFb"-9fj�)3Gf/-=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?28|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7.FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EEDYfi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�)i,j"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!))KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!mQ:A-%)Q)(-)PP;I��hashchkisamchkNUDANu pot sa creez fisierul '%-.200s' (Eroare: %M)Nu pot sa creez tabla %`s.%`s (Eroare: %M)Nu pot sa creez baza de date '%-.192s' (Eroare: %M)Nu pot sa creez baza de date '%-.192s'; baza de date exista dejaNu pot sa drop baza de date '%-.192s'; baza da date este inexistentaEroare dropuind baza de date (nu pot sa sterg '%-.192s', Eroare: %M)Eroare dropuind baza de date (nu pot sa rmdir '%-.192s', Eroare: %M)Eroare incercind sa delete '%-.192s' (Eroare: %M)Nu pot sa citesc cimpurile in tabla de system (system table)Nu pot sa obtin statusul lui '%-.200s' (Eroare: %M)Nu pot sa obtin directorul current (working directory) (Eroare: %M)Nu pot sa lock fisierul (Eroare: %M)Nu pot sa deschid fisierul: '%-.200s' (Eroare: %M)Nu pot sa gasesc fisierul: '%-.200s' (Eroare: %M)Nu pot sa citesc directorul '%-.192s' (Eroare: %M)Nu pot sa schimb directorul '%-.192s' (Eroare: %M)Cimpul a fost schimbat de la ultima citire a tabelei '%-.192s'Hard-disk-ul este plin (%s). Astept sa se elibereze ceva spatiu... (Eroare: %M)Nu pot sa scriu (can't write), cheie duplicata in tabela '%-.192s'Eroare inchizind '%-.192s' (errno: %M)Eroare citind fisierul '%-.200s' (errno: %M)Eroare incercind sa renumesc '%-.210s' in '%-.210s' (errno: %M)Eroare scriind fisierul '%-.200s' (errno: %M)'%-.192s' este blocat pentry schimbari (loccked against change)Sortare intreruptaView '%-.192s' nu exista pentru '%-.192s'Eroarea %M obtinuta din handlerul tabelei %sStorage engine %s of the table %`s.%`s doesn't have this optionNu pot sa gasesc recordul in '%-.192s'Informatie incorecta in fisierul: '%-.200s'Cheia fisierului incorecta pentru tabela: '%-.200s'; incearca s-o repariCheia fisierului e veche pentru tabela '%-.192s'; repar-o!Tabela '%-.192s' e read-onlyOut of memory. Porneste daemon-ul din nou si incearca inca o data (e nevoie de %d bytes)Out of memory pentru sortare. Largeste marimea buffer-ului pentru sortare in daemon (sort buffer size)Sfirsit de fisier neasteptat in citirea fisierului '%-.192s' (errno: %M)Prea multe conectiuniOut of memory.Nu pot sa obtin hostname-ul adresei taleProst inceput de conectie (bad handshake)Acces interzis pentru utilizatorul: '%s'@'%s' la baza de date '%-.192s'Acces interzis pentru utilizatorul: '%s'@'%s' (Folosind parola: %s)Nici o baza de data nu a fost selectata incaComanda invalidaColoana '%-.192s' nu poate sa fie nullBaza de data invalida '%-.192s'Tabela '%-.192s' exista dejaTabela '%-.100T' este invalidaColoana: '%-.192s' in %-.192s este ambiguaTerminarea serverului este in desfasurareColoana invalida '%-.192s' in '%-.192s''%-.192s' nu exista in clauza GROUP BYNu pot sa grupez pe (group on) '%-.192s'Comanda are functii suma si coloane in aceeasi comandaNumarul de coloane nu este acelasi cu numarul valoareiNumele indentificatorului '%-.100T' este prea lungNumele coloanei '%-.192s' e duplicatNumele cheiei '%-.192s' e duplicatCimpul '%-.192T' e duplicat pentru cheia %dSpecificandul coloanei '%-.192s' este incorect%s linga '%-.80T' pe linia %dQuery-ul a fost golTabela/alias: '%-.192s' nu este unicValoarea de default este invalida pentru '%-.192s'Chei primare definite de mai multe oriPrea multe chei. Numarul de chei maxim este %dPrea multe chei. Numarul de chei maxim este %dCheia specificata este prea lunga. Marimea maxima a unei chei este de %dColoana cheie '%-.192s' nu exista in tabelaBLOB column %`s can't be used in key specification in the %s tableLungimea coloanei '%-.192s' este prea lunga (maximum = %lu). Foloseste BLOB mai bineDefinitia tabelei este incorecta; Nu pot fi mai mult de o singura coloana de tip auto si aceasta trebuie definita ca cheieCould not delete gtid domain. Reason: %s.%s (%s): Terminare normala%s: Semnal %d obtinut. Aborting!%s: Terminare completa%s: Terminare fortata a thread-ului %ld  utilizatorului: '%-.48s'Nu pot crea IP socketTabela '%-.192s' nu are un index ca acela folosit in CREATE INDEX. Re-creeaza tabelaArgumentul pentru separatorul de cimpuri este diferit de ce ma asteptam. Verifica manualulNu poti folosi lungime de cimp fix pentru BLOB-uri. Foloseste 'fields terminated by'Fisierul '%-.128s' trebuie sa fie in directorul bazei de data sau trebuie sa poata sa fie citit de catre toata lumea (verifica permisiile)Fisierul '%-.200s' exista dejaRecorduri: %ld  Sterse: %ld  Sarite (skipped): %ld  Atentionari (warnings): %ldRecorduri: %ld  Duplicate: %ldComponentul cheii este incorrect. Componentul folosit al cheii nu este un sir sau lungimea folosita este mai lunga decit lungimea cheiiNu poti sterge toate coloanele cu ALTER TABLE. Foloseste DROP TABLE in schimbNu pot sa DROP %s %`-.192s. Verifica daca coloana/cheia existaRecorduri: %ld  Duplicate: %ld  Atentionari (warnings): %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataId-ul: %lu thread-ului este necunoscutNu sinteti proprietarul threadului %lldNici o tabela folositaPrea multe siruri pentru coloana %-.192s si SETNu pot sa generez un nume de log unic %-.200s.(1-999)Tabela '%-.192s' a fost locked cu un READ lock si nu poate fi actualizataTabela '%-.192s' nu a fost locked cu LOCK TABLESYou should never see itNumele bazei de date este incorect '%-.100T'Numele tabelei este incorect '%-.100s'SELECT-ul ar examina prea multe cimpuri si probabil ar lua prea mult timp; verifica clauza WHERE si foloseste SET SQL_BIG_SELECTS=1 daca SELECT-ul e okayEroare unknownProcedura unknown '%-.192s'Procedura '%-.192s' are un numar incorect de parametriProcedura '%-.192s' are parametrii incorectiTabla '%-.192s' invalida in %-.32sColoana '%-.192s' specificata de doua oriFolosire incorecta a functiei groupTabela '%-.192s' foloseste o extensire inexistenta in versiunea curenta de MariaDBO tabela trebuie sa aiba cel putin o coloanaTabela '%-.192s' e plinaSet de caractere invalid: '%-.64s'Prea multe tabele. MariaDB nu poate folosi mai mult de %d tabele intr-un joinPrea multe coloaneMarimea liniei (row) prea mare. Marimea maxima a liniei, excluzind BLOB-urile este de %ld. Trebuie sa schimbati unele cimpuri in BLOB-uriStack-ul thread-ului a fost depasit (prea mic):  Folositi: %ld intr-un stack de %ld.  Folositi 'mariadbd --thread_stack=#' ca sa specifici un stack mai mareDependinta incrucisata (cross dependency) gasita in OUTER JOIN.  Examinati conditiile ONTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerNu pot incarca functia '%-.192s'Nu pot initializa functia '%-.192s'; %-.80sNici un paths nu e permis pentru o librarie sharedFunctia '%-.192s' exista dejaNu pot deschide libraria shared '%-.192s' (Eroare: %d, %-.128s)Nu pot gasi functia '%-.128s' in librariaFunctia '%-.192s' nu e definitaHost-ul '%-.64s' e blocat din cauza multelor erori de conectie. Poti deploca folosind 'mariadb-admin flush-hosts'Host-ul '%-.64s' nu este permis a se conecta la aceste server MariaDBDumneavoastra folositi MariaDB ca un utilizator anonim si utilizatorii anonimi nu au voie sa schimbe setarile utilizatorilorTrebuie sa aveti privilegii sa actualizati tabelele in bazele de date mysql ca sa puteti sa schimati parolele altoraNu pot gasi nici o linie corespunzatoare in tabela utilizatoruluiLinii identificate (matched): %ld  Schimbate: %ld  Atentionari (warnings): %ldNu pot crea un thread nou (Eroare %M). Daca mai aveti memorie disponibila in sistem, puteti consulta manualul - ar putea exista un potential bug in legatura cu sistemul de operareNumarul de coloane nu corespunde cu numarul de valori la linia %luNu pot redeschide tabela: '%-.192s'Folosirea unei value NULL e invalidaEroarea '%s' obtinuta din expresia regulara (regexp)Amestecarea de coloane GROUP (MIN(),MAX(),COUNT()...) fara coloane GROUP este ilegala daca nu exista o clauza GROUP BYNu exista un astfel de grant definit pentru utilzatorul '%-.48s' de pe host-ul '%-.64s'Comanda %-.100T interzisa utilizatorului: '%s'@'%s' pentru tabela %`s.%`sComanda %-.32s interzisa utilizatorului: '%s'@'%s' pentru coloana '%-.192s' in tabela '%-.192s'Comanda GRANT/REVOKE ilegala. Consultati manualul in privinta privilegiilor ce pot fi folositeArgumentul host-ului sau utilizatorului pentru GRANT e prea lungTabela '%-.192s.%-.192s' nu existaNu exista un astfel de privilegiu (grant) definit pentru utilizatorul '%-.48s' de pe host-ul '%-.64s' pentru tabela '%-.192s'Comanda folosita nu este permisa pentru aceasta versiune de MariaDBAveti o eroare in sintaxa RSQLThread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.192sPrea multe threaduri aminate care sint in uzConectie terminata %ld la baza de date: '%-.192s' utilizator: '%-.48s' (%-.64s)Un packet mai mare decit 'max_allowed_packet' a fost primitEroare la citire din cauza lui 'connection pipe'Eroare obtinuta de la fcntl()Packets care nu sint ordonati au fost gasitiNu s-a putut decompresa pachetul de comunicatie (communication packet)Eroare obtinuta citind pachetele de comunicatie (communication packets)Timeout obtinut citind pachetele de comunicatie (communication packets)Eroare in scrierea pachetelor de comunicatie (communication packets)Timeout obtinut scriind pachetele de comunicatie (communication packets)Sirul rezultat este mai lung decit 'max_allowed_packet'Tipul de tabela folosit (%s) nu suporta coloane de tip BLOB/TEXTTipul de tabela folosit (%s) nu suporta coloane de tip AUTO_INCREMENTINSERT DELAYED nu poate fi folosit cu tabela '%-.192s', deoarece este locked folosing LOCK TABLESNume increct de coloana '%-.100s'The storage engine %s can't index column %`sToate tabelele din tabela MERGE nu sint definite identicNu pot scrie pe hard-drive, din cauza constraintului unic (unique constraint) pentru tabela '%-.192s'Coloana BLOB '%-.192s' este folosita in specificarea unei chei fara ca o lungime de cheie sa fie folositaToate partile unei chei primare (PRIMARY KEY) trebuie sa fie NOT NULL; Daca aveti nevoie de NULL in vreo cheie, folositi UNIQUE in schimbResultatul constista din mai multe liniiAceast tip de tabela are nevoie de o cheie primaraAceasta versiune de MariaDB, nu a fost compilata cu suport pentru RAIDYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionCimpul '%-.64T' e duplicat pentru cheia '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAcces interzis pentru utilizatorul: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)Trebuie sa iti schimbi parola folosind SET PASSWORD inainte de a executa aceasta comandaFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionCimpul e duplicat pentru cheia '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTParola ta a expirat. Pentru a te loga, trebuie sa o schimbi folosind un client ce suporta parole expirateFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uRolul %`s este invalidUtilizatorul curent este invalidRolul '%s' nu poate fi acordat catre: %sRolul '%s' nu poate fi revocat de la: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Acces refuzat, acest cont este blocatApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedComanda folosită nu este permisă deoarece clientul sau serverul MariaDB a dezactivat această capabilitateNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledhungarian/errmsg.sys000064400000231470150343472770010602 0ustar00��z)o�	�=�107BGDJ&(:2$005?L$1-0=.&4$@%'B9SH<&1KM-!!-!0'#:='%$1!'"'.>:1CQ@*@\TM\9XSL.`"$!4F6�3*'('Y2&B
swFx(45!J4#qSKf$:�M,:c>Un]B&c?Z%VP +118*1M>KZ-9.Q�*<>P3/G$&((V#63_ <I>�iLSq6L876FCE-JC7+7;$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?78|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"72FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�.i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I�hashchkisamchkNEMIGENA '%-.200s' file nem hozhato letre (hibakod: %M)A %`s.%`s tabla nem hozhato letre (hibakod: %M)Az '%-.192s' adatbazis nem hozhato letre (hibakod: %M)Az '%-.192s' adatbazis nem hozhato letre Az adatbazis mar letezikA(z) '%-.192s' adatbazis nem szuntetheto meg. Az adatbazis nem letezikAdatbazis megszuntetesi hiba ('%-.192s' nem torolheto, hibakod: %M)Adatbazis megszuntetesi hiba ('%-.192s' nem szuntetheto meg, hibakod: %M)Torlesi hiba: '%-.192s' (hibakod: %M)Nem olvashato rekord a rendszertablabanA(z) '%-.200s' statusza nem allapithato meg (hibakod: %M)A munkakonyvtar nem allapithato meg (hibakod: %M)A file nem zarolhato. (hibakod: %M)A '%-.200s' file nem nyithato meg (hibakod: %M)A(z) '%-.200s' file nem talalhato (hibakod: %M)A(z) '%-.192s' konyvtar nem olvashato. (hibakod: %M)Konyvtarvaltas nem lehetseges a(z) '%-.192s'-ba. (hibakod: %M)A(z) '%-.192s' tablaban talalhato rekord megvaltozott az utolso olvasas otaA lemez megtelt (%s). (hibakod: %M)Irasi hiba, duplikalt kulcs a '%-.192s' tablabanHiba a(z) '%-.192s' zarasakor. (hibakod: %M)Hiba a '%-.200s'file olvasasakor. (hibakod: %M)Hiba a '%-.210s' file atnevezesekor '%-.210s'. (hibakod: %M)Hiba a '%-.200s' file irasakor. (hibakod: %M)'%-.192s' a valtoztatas ellen zarolvaSikertelen rendezesA(z) '%-.192s' nezet nem letezik a(z) '%-.192s'-hozGot error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionNem talalhato a rekord '%-.192s'-benErvenytelen info a file-ban: '%-.200s'Ervenytelen kulcsfile a tablahoz: '%-.200s'; probalja kijavitani!Regi kulcsfile a '%-.192s'tablahoz; probalja kijavitani!'%-.192s' irasvedettNincs eleg memoria. Inditsa ujra a demont, es probalja ismet. (%d byte szukseges.)Nincs eleg memoria a rendezeshez. Novelje a rendezo demon puffermeretetVaratlan filevege-jel a '%-.192s'olvasasakor. (hibakod: %M)Tul sok kapcsolatElfogyott a thread-memoriaA gepnev nem allapithato meg a cimbolA kapcsolatfelvetel nem sikerult (Bad handshake)A(z) '%s'@'%s' felhasznalo szamara tiltott eleres az '%-.192s' adabazishozA(z) '%s'@'%s' felhasznalo szamara tiltott eleres. (Hasznalja a jelszot: %s)Nincs kivalasztott adatbazisErvenytelen parancsA(z) '%-.192s' oszlop erteke nem lehet nullaErvenytelen adatbazis: '%-.192s'A(z) '%-.192s' tabla mar letezikErvenytelen tabla: '%-.100T'A(z) '%-.192s' oszlop %-.192s-ben ketertelmuA szerver leallitasa folyamatbanA(z) '%-.192s' oszlop ervenytelen '%-.192s'-benUsed '%-.192s' with wasn't in group byA group nem hasznalhato: '%-.192s'Statement has sum functions and columns in same statementAz oszlopban levo ertek nem egyezik meg a szamitott ertekkelA(z) '%-.100T' azonositonev tul hosszuDuplikalt oszlopazonosito: '%-.192s'Duplikalt kulcsazonosito: '%-.192s'Duplikalt bejegyzes '%-.192T' a %d kulcs szerintRossz oszlopazonosito: '%-.192s'A %s a '%-.80T'-hez kozeli a %d sorbanUres lekerdezesNem egyedi tabla/alias: '%-.192s'Ervenytelen ertek: '%-.192s'Tobbszoros elsodleges kulcs definialasTul sok kulcs. Maximum %d kulcs engedelyezettTul sok kulcsdarabot definialt. Maximum %d resz engedelyezettA megadott kulcs tul hosszu. Maximalis kulcshosszusag: %dA(z) '%-.192s'kulcsoszlop nem letezik a tablabanBLOB column %`s can't be used in key specification in the %s tableA(z) '%-.192s' oszlop tul hosszu. (maximum = %lu). Hasznaljon BLOB tipust inkabbCsak egy auto mezo lehetseges, es azt kulcskent kell definialniCould not delete gtid domain. Reason: %s.%s (%s): Normal leallitas%s: %d jelzes. Megszakitva!%s: A leallitas kesz%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.48s'Az IP socket nem hozhato letreA(z) '%-.192s' tablahoz nincs meg a CREATE INDEX altal hasznalt index. Alakitsa at a tablatA mezoelvalaszto argumentumok nem egyeznek meg a varttal. Nezze meg a kezikonyvben!Fix hosszusagu BLOB-ok nem hasznalhatok. Hasznalja a 'mezoelvalaszto jelet' A(z) '%-.128s'-nak az adatbazis konyvtarban kell lennie, vagy mindenki szamara olvashatonakA '%-.200s' file mar letezikRekordok: %ld  Torolve: %ld  Skipped: %ld  Warnings: %ldRekordok: %ld  Duplikalva: %ldRossz alkulcs. A hasznalt kulcsresz nem karaktersorozat vagy hosszabb, mint a kulcsreszAz osszes mezo nem torolheto az ALTER TABLE-lel. Hasznalja a DROP TABLE-t helyetteA DROP %s %`-.192s nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-eRekordok: %ld  Duplikalva: %ld  Warnings: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataErvenytelen szal (thread) id: %luA %lld thread-nek mas a tulajdonosaNincs hasznalt tablaTul sok karakter: %-.192s es SETEgyedi log-filenev nem generalhato: %-.200s.(1-999)A(z) '%-.192s' tabla zarolva lett (READ lock) es nem lehet frissiteniA(z) '%-.192s' tabla nincs zarolva a LOCK TABLES-szelYou should never see itHibas adatbazisnev: '%-.100T'Hibas tablanev: '%-.100s'A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT okayIsmeretlen hibaIsmeretlen eljaras: '%-.192s'Rossz parameter a(z) '%-.192s'eljaras szamitasanalRossz parameter a(z) '%-.192s' eljarasbanIsmeretlen tabla: '%-.192s' %-.32s-banA(z) '%-.192s' mezot ketszer definialtaA group funkcio ervenytelen hasznalataA(z) '%-.192s' tabla olyan bovitest hasznal, amely nem letezik ebben a MariaDB versiobanA tablanak legalabb egy oszlopot tartalmazni kellA '%-.192s' tabla megteltErvenytelen karakterkeszlet: '%-.64s'Tul sok tabla. A MariaDB csak %d tablat tud kezelni osszefuzeskorTul sok mezoTul nagy sormeret. A maximalis sormeret (nem szamolva a blob objektumokat) %ld. Nehany mezot meg kell valtoztatniaThread verem tullepes:  Used: %ld of a %ld stack. Hasznalja a 'mariadbd --thread_stack=#' nagyobb verem definialasahozKeresztfuggoseg van az OUTER JOIN-ban. Ellenorizze az ON felteteleketTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerA(z) '%-.192s' fuggveny nem toltheto beA(z) '%-.192s' fuggveny nem inicializalhato; %-.80sNincs ut a megosztott konyvtarakhoz (shared library)A '%-.192s' fuggveny mar letezikA(z) '%-.192s' megosztott konyvtar nem hasznalhato (hibakod: %d, %-.128s)A(z) '%-.128s' fuggveny nem talalhato a konyvtarbanA '%-.192s' fuggveny nem definialtA '%-.64s' host blokkolodott, tul sok kapcsolodasi hiba miatt. Hasznalja a 'mariadb-admin flush-hosts' parancsotA '%-.64s' host szamara nem engedelyezett a kapcsolodas ehhez a MariaDB szerverhezNevtelen (anonymous) felhasznalokent nem negedelyezett a jelszovaltoztatasOnnek tabla-update joggal kell rendelkeznie a mysql adatbazisban masok jelszavanak megvaltoztatasahozNincs megegyezo sor a user tablabanMegegyezo sorok szama: %ld  Valtozott: %ld  Warnings: %ldUj thread letrehozasa nem lehetseges (Hibakod: %M). Amenyiben van meg szabad memoria, olvassa el a kezikonyv operacios rendszerfuggo hibalehetosegekrol szolo reszetAz oszlopban talalhato ertek nem egyezik meg a %lu sorban szamitott ertekkelNem lehet ujra-megnyitni a tablat: '%-.192sA NULL ervenytelen hasznalata'%s' hiba a regularis kifejezes hasznalata soran (regexp)A GROUP mezok (MIN(),MAX(),COUNT()...) kevert hasznalata nem lehetseges GROUP BY hivatkozas nelkulA '%-.48s' felhasznalonak nincs ilyen joga a '%-.64s' host-on%-.100T parancs a '%s'@'%s' felhasznalo szamara nem engedelyezett a %`s.%`s tablaban%-.32s parancs a '%s'@'%s' felhasznalo szamara nem engedelyezett a '%-.192s' mezo eseten a '%-.192s' tablabanErvenytelen GRANT/REVOKE parancs. Kerem, nezze meg a kezikonyvben, milyen jogok lehetsegesekA host vagy felhasznalo argumentuma tul hosszu a GRANT parancsbanA '%-.192s.%-.192s' tabla nem letezikA '%-.48s' felhasznalo szamara a '%-.64s' host '%-.192s' tablajaban ez a parancs nem engedelyezettA hasznalt parancs nem engedelyezett ebben a MariaDB verziobanSzintaktikai hibaA kesleltetett beillesztes (delayed insert) thread nem kapott zatolast a %-.192s tablahozTul sok kesletetett thread (delayed)Megszakitott kapcsolat %ld db: '%-.192s' adatbazishoz, felhasznalo: '%-.48s' (%-.64s)A kapott csomag nagyobb, mint a maximalisan engedelyezett: 'max_allowed_packet'Olvasasi hiba a kapcsolat soranHiba a fcntl() fuggvenybenHelytelen sorrendben erkezett adatcsomagokA kommunikacios adatcsomagok nem tomorithetok kiHIba a kommunikacios adatcsomagok olvasasa soranIdotullepes a kommunikacios adatcsomagok olvasasa soranHiba a kommunikacios csomagok irasa soranIdotullepes a kommunikacios csomagok irasa soranEz eredmeny sztring nagyobb, mint a lehetseges maximum: 'max_allowed_packet'A hasznalt tabla tipus (%s) nem tamogatja a BLOB/TEXT mezoketA hasznalt tabla tipus (%s) nem tamogatja az AUTO_INCREMENT tipusu mezoketAz INSERT DELAYED nem hasznalhato a '%-.192s' tablahoz, mert a tabla zarolt (LOCK TABLES)Ervenytelen mezonev: '%-.100s'The storage engine %s can't index column %`sA MERGE tablaban talalhato tablak definicioja nem azonosA '%-.192s' nem irhato, az egyedi mezok miattBLOB mezo '%-.192s' hasznalt a mezo specifikacioban, a mezohossz megadasa nelkulAz elsodleges kulcs teljes egeszeben csak NOT NULL tipusu lehet; Ha NULL mezot szeretne a kulcskent, hasznalja inkabb a UNIQUE-otAz eredmeny tobb, mint egy sort tartalmazAz adott tablatipushoz elsodleges kulcs hasznalata kotelezoEzen leforditott MariaDB verzio nem tartalmaz RAID support-otOn a biztonsagos update modot hasznalja, es        WHERE that uses a KEY columnA '%-.192s' kulcs nem letezik a '%-.192s' tablabanNem tudom megnyitni a tablatA tabla kezeloje (handler) nem tamogatja az %sAz On szamara nem engedelyezett a parancs vegrehajtasa a tranzakcioban%M hiba a COMMIT vegrehajtasa soran%M hiba a ROLLBACK vegrehajtasa soran%M hiba a FLUSH_LOGS vegrehajtasa soran%M hiba a CHECKPOINT vegrehajtasa soranAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add a child row: a foreign key constraint failsCannot delete a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDuplikalt bejegyzes '%-.64T' a '%-.192s' kulcs szerintToo many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTA(z) '%s'@'%s' felhasznalo szamara tiltott eleresSET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDuplikalt bejegyzes a '%-.192s' kulcs szerintLong database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledgerman/errmsg.sys000064400000246606150343472770010106 0ustar00���Co��=�115ECWc0,75.0/4>LGG23?7(.!>)'G:!GX>1KM$$.!.*+X=+!4/*-22=EB5J]y*!!7`UmS"C!�c51`+5MQ7$#�.*)'.a2"L��[x$5*#B4'tRW�9:�N+'�KI\a4*gDMl5P>'40-:1>;IIg<?ji�*CC�><@g7B!%@o"FfZ��lt�HJDG\RT<]sDGon.J/!ULb-\?[V):,<-.EQ(66&7@9$*.F3j}D5�0MU.02V@`]@g(�~oR�N\9'� +8f_1)�3V'+3']3D ',H01��+A$&##G&Ah>(+7<?O^7(;+<?Lmc�[?FC%&S9?/K0>(&6/F';QE3:F/"57$PC4%DiT`6aAC*HF.5J-?=[����2`Y@KDQX1xhoFQ�)AQ&(�\�f�fKBfgG�Hm�#L?V PC89E
	G4Z*�TjKlTM=d]bT'Z2�5;NJBI[BMp9@H3L%)[Ju�Ml5LD";f�HN># 11U]e CB�"J,22P'!3('[a\+�tl<D1>P�I?(>0\Q/@E�I>CD5F��99c$**1A,<<34IY,21JI@B02FO�0l<@74t



(B*$0.92#j+*nK*F-;JRV3�����{�|���[ce�]:;)I7!_UIP3;!7Jq9B"72FLH<��WkT;B54������
�V/bBEh<:8<-".�aF=JM�>-1>?R5��7F���_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��df.#*S,EED6fi?)i"�fztSK^g�>08_*,�/(@31UL09!(�,i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A!^@�D���Udu!KL�(#>3;74.+/6,@B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1)1'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ0A-%)Q)(-)PP;I��hashchkisamchkNeinJaKann Datei '%-.200s' nicht erzeugen (Fehler: %M)Kann Tabelle %`s.%`s nicht erzeugen (Fehler: %M)Kann Datenbank '%-.192s' nicht erzeugen (Fehler: %M)Kann Datenbank '%-.192s' nicht erzeugen. Datenbank existiert bereitsKann Datenbank '%-.192s' nicht löschen; Datenbank nicht vorhandenFehler beim Löschen der Datenbank ('%-.192s' kann nicht gelöscht werden, Fehler: %M)Fehler beim Löschen der Datenbank (Verzeichnis '%-.192s' kann nicht gelöscht werden, Fehler: %M)Fehler beim Löschen von '%-.192s' (Fehler: %M)Datensatz in der Systemtabelle nicht lesbarKann Status von '%-.200s' nicht ermitteln (Fehler: %M)Kann Arbeitsverzeichnis nicht ermitteln (Fehler: %M)Datei kann nicht gesperrt werden (Fehler: %M)Kann Datei '%-.200s' nicht öffnen (Fehler: %M)Kann Datei '%-.200s' nicht finden (Fehler: %M)Verzeichnis von '%-.192s' nicht lesbar (Fehler: %M)Kann nicht in das Verzeichnis '%-.192s' wechseln (Fehler: %M)Datensatz hat sich seit dem letzten Zugriff auf Tabelle '%-.192s' geändertFestplatte voll (%s). Warte, bis jemand Platz schafft ... (Fehler: %M)Kann nicht speichern, Grund: doppelter Schlüssel in Tabelle '%-.192s'Fehler beim Schließen von '%-.192s' (Fehler: %M)Fehler beim Lesen der Datei '%-.200s' (Fehler: %M)Fehler beim Umbenennen von '%-.210s' in '%-.210s' (Fehler: %M)Fehler beim Speichern der Datei '%-.200s' (Fehler: %M)'%-.192s' ist für Änderungen gesperrtSortiervorgang abgebrochenView '%-.192s' existiert für '%-.192s' nichtFehler %M von Speicher-Engine %sDiese Option gibt es nicht in Speicher-Engine %s für %`s.%`sKann Datensatz in '%-.192s' nicht findenFalsche Information in Datei '%-.200s'Fehlerhafte Index-Datei für Tabelle '%-.200s'; versuche zu reparierenAlte Index-Datei für Tabelle '%-.192s'. Bitte reparierenTabelle '%-.192s' ist nur lesbarKein Speicher vorhanden (%d Bytes benötigt). Bitte Server neu startenKein Speicher zum Sortieren vorhanden. sort_buffer_size sollte im Server erhöht werdenUnerwartetes Ende beim Lesen der Datei '%-.192s' (Fehler: %M)Zu viele VerbindungenKein Speicher mehr vorhanden.Kann Hostnamen für diese Adresse nicht erhaltenUngültiger HandshakeBenutzer '%s'@'%s' hat keine Zugriffsberechtigung für Datenbank '%-.192s'Benutzer '%s'@'%s' hat keine Zugriffsberechtigung (verwendetes Passwort: %s)Keine Datenbank ausgewähltUnbekannter BefehlFeld '%-.192s' darf nicht NULL seinUnbekannte Datenbank '%-.192s'Tabelle '%-.192s' bereits vorhandenUnbekannte Tabelle '%-.100T'Feld '%-.192s' in %-.192s ist nicht eindeutigDer Server wird heruntergefahrenUnbekanntes Tabellenfeld '%-.192s' in %-.192s'%-.192s' ist nicht in GROUP BY vorhandenGruppierung über '%-.192s' nicht möglichDie Verwendung von Summierungsfunktionen und Spalten im selben Befehl ist nicht erlaubtDie Anzahl der Spalten entspricht nicht der Anzahl der WerteName des Bezeichners '%-.100T' ist zu langDoppelter Spaltenname: '%-.192s'Doppelter Name für Schlüssel vorhanden: '%-.192s'Doppelter Eintrag '%-.192T' für Schlüssel %dFalsche Spezifikation für Feld '%-.192s'%s bei '%-.80T' in Zeile %dLeere AbfrageTabellenname/Alias '%-.192s' nicht eindeutigFehlerhafter Vorgabewert (DEFAULT) für '%-.192s'Mehrere Primärschlüssel (PRIMARY KEY) definiertZu viele Schlüssel definiert. Maximal %d Schlüssel erlaubtZu viele Teilschlüssel definiert. Maximal %d Teilschlüssel erlaubtSchlüssel ist zu lang. Die maximale Schlüssellänge beträgt %dIn der Tabelle gibt es kein Schlüsselfeld '%-.192s'BLOB-Feld %`s kann beim %s Tabellen nicht als Schlüssel verwendet werdenFeldlänge für Feld '%-.192s' zu groß (maximal %lu). BLOB- oder TEXT-Spaltentyp verwenden!Falsche Tabellendefinition. Es darf nur eine AUTO_INCREMENT-Spalte geben, und diese muss als Schlüssel definiert werdenCould not delete gtid domain. Reason: %s.%s (%s): Normal heruntergefahren%s: Signal %d erhalten. Abbruch!%s: Herunterfahren beendet%s: Thread %ld zwangsweise beendet. Benutzer: '%-.48s'Kann IP-Socket nicht erzeugenTabelle '%-.192s' besitzt keinen wie den in CREATE INDEX verwendeten Index. Tabelle neu anlegenFeldbegrenzer-Argument ist nicht in der erwarteten Form. Bitte im Handbuch nachlesenEine feste Zeilenlänge kann für BLOB-Felder nicht verwendet werden. Bitte 'fields terminated by' verwendenDatei '%-.128s' muss im Datenbank-Verzeichnis vorhanden oder lesbar für alle seinDatei '%-.200s' bereits vorhandenDatensätze: %ld  Gelöscht: %ld  Ausgelassen: %ld  Warnungen: %ldDatensätze: %ld  Duplikate: %ldFalscher Unterteilschlüssel. Der verwendete Schlüsselteil ist entweder kein String, die verwendete Länge ist länger als der Teilschlüssel oder die Speicher-Engine unterstützt keine UnterteilschlüsselMit ALTER TABLE können nicht alle Felder auf einmal gelöscht werden. Dafür DROP TABLE verwendenDROP %s: Kann %`-.192s nicht löschen. Existiert es?Datensätze: %ld  Duplikate: %ld  Warnungen: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataUnbekannte Thread-ID: %luSie sind nicht Eigentümer von Thread %lldKeine Tabellen verwendetZu viele Strings für Feld %-.192s und SET angegebenKann keinen eindeutigen Dateinamen für die Logdatei %-.200s(1-999) erzeugenTabelle '%-.192s' ist mit Lesesperre versehen und kann nicht aktualisiert werdenTabelle '%-.192s' wurde nicht mit LOCK TABLES gesperrtYou should never see itUnerlaubter Datenbankname '%-.100T'Unerlaubter Tabellenname '%-.100s'Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET MAX_JOIN_SIZE=# verwendenUnbekannter FehlerUnbekannte Prozedur '%-.192s'Falsche Parameterzahl für Prozedur '%-.192s'Falsche Parameter für Prozedur '%-.192s'Unbekannte Tabelle '%-.192s' in '%-.32s'Feld '%-.192s' wurde zweimal angegebenFalsche Verwendung einer GruppierungsfunktionTabelle '%-.192s' verwendet eine Erweiterung, die in dieser MariaDB-Version nicht verfügbar istEine Tabelle muss mindestens eine Spalte besitzenTabelle '%-.192s' ist vollUnbekannter Zeichensatz: '%-.64s'Zu viele Tabellen. MariaDB kann in einem Join maximal %d Tabellen verwendenZu viele FelderZeilenlänge zu groß. Die maximale Zeilenlänge für den verwendeten Tabellentyp (ohne BLOB-Felder) beträgt %ld. Einige Felder müssen in BLOB oder TEXT umgewandelt werdenThread-Stack-Überlauf. Benutzt: %ld von %ld Stack. 'mariadbd --thread_stack=#' verwenden, um bei Bedarf einen größeren Stack anzulegenOUTER JOIN enthält fehlerhafte Abhängigkeiten. In ON verwendete Bedingungen überprüfenTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerKann Funktion '%-.192s' nicht ladenKann Funktion '%-.192s' nicht initialisieren: %-.80sKeine Pfade gestattet für Shared LibraryFunktion '%-.192s' existiert schonKann Shared Library '%-.192s' nicht öffnen (Fehler: %d, %-.128s)Kann Funktion '%-.128s' in der Library nicht findenFunktion '%-.192s' ist nicht definiertHost '%-.64s' blockiert wegen zu vieler Verbindungsfehler. Aufheben der Blockierung mit 'mariadb-admin flush-hosts'Host '%-.64s' hat keine Berechtigung, sich mit diesem MariaDB-Server zu verbindenSie benutzen MariaDB als anonymer Benutzer und dürfen daher keine Passwörter ändernSie benötigen die Berechtigung zum Aktualisieren von Tabellen in der Datenbank 'mysql', um die Passwörter anderer Benutzer ändern zu könnenKann keinen passenden Datensatz in Tabelle 'user' findenDatensätze gefunden: %ld  Geändert: %ld  Warnungen: %ldKann keinen neuen Thread erzeugen (Fehler: %M). Sollte noch Speicher verfügbar sein, bitte im Handbuch wegen möglicher Fehler im Betriebssystem nachschlagenAnzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %lu übereinKann Tabelle'%-.192s' nicht erneut öffnenUnerlaubte Verwendung eines NULL-WertsRegexp Fehler %sDas Vermischen von GROUP-Feldern (MIN(),MAX(),COUNT()...) mit Nicht-GROUP-Feldern ist nicht zulässig, wenn keine GROUP-BY-Klausel vorhanden istFür Benutzer '%-.48s' auf Host '%-.64s' gibt es keine solche Berechtigung%-.100T Befehl nicht erlaubt für Benutzer '%s'@'%s' auf Tabelle %`s.%`s%-.32s Befehl nicht erlaubt für Benutzer '%s'@'%s' und Feld '%-.192s' in Tabelle '%-.192s'Unzulässiger GRANT- oder REVOKE-Befehl. Verfügbare Berechtigungen sind im Handbuch aufgeführtDas Host- oder User-Argument für GRANT ist zu langTabelle '%-.192s.%-.192s' existiert nichtEine solche Berechtigung ist für User '%-.48s' auf Host '%-.64s' an Tabelle '%-.192s' nicht definiertDer verwendete Befehl ist in dieser MariaDB-Version nicht zulässigFehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagenVerzögerter (DELAYED) Einfüge-Thread konnte die angeforderte Sperre für Tabelle '%-.192s' nicht erhaltenZu viele verzögerte (DELAYED) Threads in VerwendungAbbruch der Verbindung %ld zur Datenbank '%-.192s'. Benutzer: '%-.48s' (%-.64s)Empfangenes Paket ist größer als 'max_allowed_packet' BytesLese-Fehler bei einer Verbindungs-Pipefcntl() lieferte einen FehlerPakete nicht in der richtigen Reihenfolge empfangenKommunikationspaket lässt sich nicht entpackenFehler beim Lesen eines KommunikationspaketsZeitüberschreitung beim Lesen eines KommunikationspaketsFehler beim Schreiben eines KommunikationspaketsZeitüberschreitung beim Schreiben eines KommunikationspaketsErgebnis-String ist länger als 'max_allowed_packet' BytesDer verwendete Tabellentyp (%s) unterstützt keine BLOB- und TEXT-FelderDer verwendete Tabellentyp (%s) unterstützt keine AUTO_INCREMENT-FelderINSERT DELAYED kann für Tabelle '%-.192s' nicht verwendet werden, da sie mit LOCK TABLES gesperrt istFalscher Spaltenname '%-.100s'Die Speicher-Engine %s kann die Spalte %`s nicht indizierenNicht alle Tabellen in der MERGE-Tabelle sind gleich definiertSchreiben in Tabelle '%-.192s' nicht möglich wegen einer Eindeutigkeitsbeschränkung (unique constraint)BLOB- oder TEXT-Spalte '%-.192s' wird in der Schlüsseldefinition ohne Schlüssellängenangabe verwendetAlle Teile eines PRIMARY KEY müssen als NOT NULL definiert sein. Wenn NULL in einem Schlüssel benötigt wird, muss ein UNIQUE-Schlüssel verwendet werdenErgebnis besteht aus mehr als einer ZeileDieser Tabellentyp benötigt einen Primärschlüssel (PRIMARY KEY)Diese MariaDB-Version ist nicht mit RAID-Unterstützung kompiliertMariaDB läuft im sicheren Aktualisierungsmodus (safe update mode). Sie haben versucht, eine Tabelle zu aktualisieren, ohne in der WHERE-Klausel ein KEY-Feld anzugebenSchlüssel '%-.192s' existiert in der Tabelle '%-.192s' nichtKann Tabelle nicht öffnenDie Speicher-Engine für diese Tabelle unterstützt kein %sSie dürfen diesen Befehl nicht in einer Transaktion ausführenFehler %M beim COMMITFehler %M beim ROLLBACKFehler %M bei FLUSH_LOGSFehler %M bei CHECKPOINTAbbruch der Verbindung %lld zur Datenbank '%-.192s'. Benutzer: '%-.48s', Host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog geschlossen. Kann RESET MASTER nicht ausführenNeuerstellung des Index der Dump-Tabelle '%-.192s' fehlgeschlagenFehler vom Master: '%-.64s'Netzfehler beim Lesen vom MasterNetzfehler beim Schreiben zum MasterKann keinen FULLTEXT-Index finden, der der Feldliste entsprichtKann den angegebenen Befehl wegen einer aktiven Tabellensperre oder einer aktiven Transaktion nicht ausführenUnbekannte Systemvariable '%-.*s'Tabelle '%-.192s' ist als defekt markiert und sollte repariert werdenTabelle '%-.192s' ist als defekt markiert und der letzte (automatische?) Reparaturversuch schlug fehlÄnderungen an einigen nicht transaktionalen Tabellen konnten nicht zurückgerollt werdenTransaktionen, die aus mehreren Befehlen bestehen, benötigten mehr als 'max_binlog_cache_size' Bytes an Speicher. Btte vergrössern Sie diese Server-Variable versuchen Sie es noch einmalDiese Operation kann bei einem aktiven Slave '%2$*1$s' nicht durchgeführt werden. Bitte zuerst STOP SLAVE '%2$*1$s' ausführenDiese Operation benötigt einen aktiven Slave. Bitte Slave konfigurieren und mittels START SLAVE aktivierenDer Server ist nicht als Slave konfiguriert. Bitte in der Konfigurationsdatei oder mittels CHANGE MASTER TO behebenKonnte Master-Info-Struktur '%.*s' nicht initialisieren. Weitere Fehlermeldungen können im MariaDB-Error-Log eingesehen werdenKonnte Slave-Thread nicht starten. Bitte System-Ressourcen überprüfenBenutzer '%-.64s' hat mehr als 'max_user_connections' aktive VerbindungenBei diesem Befehl dürfen nur konstante Ausdrücke verwendet werdenBeim Warten auf eine Sperre wurde die zulässige Wartezeit überschritten. Bitte versuchen Sie, die Transaktion neu zu startenDie Gesamtzahl der Sperren überschreitet die Größe der SperrtabelleWährend einer READ-UNCOMMITTED-Transaktion können keine UPDATE-Sperren angefordert werdenDROP DATABASE ist nicht erlaubt, solange der Thread eine globale Lesesperre hältCREATE DATABASE ist nicht erlaubt, solange der Thread eine globale Lesesperre hältFalsche Argumente für %s'%s'@'%s' ist nicht berechtigt, neue Benutzer hinzuzufügenFalsche Tabellendefinition. Alle MERGE-Tabellen müssen sich in derselben Datenbank befindenBeim Versuch, eine Sperre anzufordern, ist ein Deadlock aufgetreten. Versuchen Sie, die Transaktion neu zu startenDer verwendete Tabellentyp (%s) unterstützt keine FULLTEXT-IndizesFremdschlüssel-Beschränkung kann nicht hinzugefügt werden für `%s`Hinzufügen oder Aktualisieren eines Kind-Datensatzes schlug aufgrund einer Fremdschlüssel-Beschränkung fehlLöschen oder Aktualisieren eines Eltern-Datensatzes schlug aufgrund einer Fremdschlüssel-Beschränkung fehlFehler bei der Verbindung zum Master: %-.128sBeim Ausführen einer Abfrage auf dem Master trat ein Fehler auf: %-.128sFehler beim Ausführen des Befehls %s: %-.128sFalsche Verwendung von %s und %sDie verwendeten SELECT-Befehle liefern unterschiedliche Anzahlen von Feldern zurückAugrund eines READ-LOCK-Konflikts kann die Abfrage nicht ausgeführt werdenDie gleichzeitige Verwendung von Tabellen mit und ohne Transaktionsunterstützung ist deaktiviertOption '%s' wird im Befehl zweimal verwendetBenutzer '%-.64s' hat die Ressourcenbeschränkung '%s' überschritten (aktueller Wert: %ld)Kein Zugriff. Hierfür wird die Berechtigung %-.128s benötigtVariable '%-.64s' ist eine lokale Variable und kann nicht mit SET GLOBAL verändert werdenVariable '%-.64s' ist eine globale Variable und muss mit SET GLOBAL verändert werdenVariable '%-.64s' hat keinen VorgabewertVariable '%-.64s' kann nicht auf '%-.200T' gesetzt werdenFalscher Argumenttyp für Variable '%-.64s'Variable '%-.64s' kann nur verändert, nicht gelesen werdenFalsche Verwendung oder Platzierung von '%s'Diese MariaDB-Version unterstützt '%s' nichtSchwerer Fehler %d: '%-.320s vom Master beim Lesen des binären LogsSlave-SQL-Thread hat die Abfrage aufgrund von replicate-*-table-Regeln ignoriertVariable '%-.192s' ist eine %s-VariableFalsche Fremdschlüssel-Definition für '%-.192s': %sSchlüssel- und Tabellenverweis passen nicht zusammenOperand sollte %d Spalte(n) enthaltenUnterabfrage lieferte mehr als einen Datensatz zurückUnbekannter Prepared-Statement-Handler (%.*s) für %s angegebenDie Hilfe-Datenbank ist beschädigt oder existiert nichtZyklischer Verweis in UnterabfragenFeld '%s' wird von %s nach %s umgewandeltVerweis '%-.64s' wird nicht unterstützt (%s)Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werdenSelect %u wurde während der Optimierung reduziertTabelle '%-.192s', die in einem der SELECT-Befehle verwendet wurde, kann nicht in %-.32s verwendet werdenClient unterstützt das vom Server erwartete Authentifizierungsprotokoll nicht. Bitte aktualisieren Sie Ihren MariaDB-ClientAlle Teile eines SPATIAL-Index müssen als NOT NULL deklariert seinCOLLATION '%s' ist für CHARACTER SET '%s' ungültigSlave läuft bereitsSlave wurde bereits angehaltenUnkomprimierte Daten sind zu groß. Die maximale Größe beträgt %d (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)ZLIB: Nicht genug SpeicherZLIB: Im Ausgabepuffer ist nicht genug Platz vorhanden (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)ZLIB: Eingabedaten beschädigtRow %u was cut by %s)Zeile %lu enthält nicht für alle Felder DatenZeile %lu gekürzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibtFeld auf Vorgabewert gesetzt, da NULL für NOT-NULL-Feld '%s' in Zeile %lu angegebenOut of range value for column '%s' at row %luDaten abgeschnitten für Feld '%s' in Zeile %luSpeicher-Engine %s wird für Tabelle '%s' benutztUnerlaubte Mischung von Sortierreihenfolgen (%s, %s) und (%s, %s) für Operation '%s'Kann einen oder mehrere der angegebenen Benutzer nicht löschenKann nicht alle Berechtigungen widerrufen, die für einen oder mehrere Benutzer gewährt wurdenUnerlaubte Mischung von Sortierreihenfolgen (%s, %s), (%s, %s), (%s, %s) für Operation '%s'Unerlaubte Mischung von Sortierreihenfolgen für Operation '%s'Variable '%-.64s' ist keine Variablen-Komponente (kann nicht als XXXX.variablen_name verwendet werden)Unbekannte Sortierreihenfolge: '%-.64s'SSL-Parameter in CHANGE MASTER werden ignoriert, weil dieser MariaDB-Slave ohne SSL-Unterstützung kompiliert wurde. Sie können aber später verwendet werden, wenn ein MariaDB-Slave mit SSL gestartet wirdServer läuft im Modus --secure-auth, aber '%s'@'%s' hat ein Passwort im alten Format. Bitte Passwort ins neue Format ändernFeld oder Verweis '%-.192s%s%-.192s%s%-.192s' im SELECT-Befehl Nr. %d wurde im SELECT-Befehl Nr. %d aufgelöstFalscher Parameter oder falsche Kombination von Parametern für START SLAVE UNTILEs wird empfohlen, mit --skip-slave-start zu starten, wenn mit START SLAVE UNTIL eine Schritt-für-Schritt-Replikation ausgeführt wird. Ansonsten gibt es Probleme, wenn ein Slave-Server unerwartet neu startetSQL-Thread soll nicht gestartet werden. Daher werden UNTIL-Optionen ignoriertFalscher Indexname '%-.100s'Falscher Katalogname '%-.100s'Änderung der Query-Cache-Größe auf %llu fehlgeschlagen; neue Query-Cache-Größe ist %luFeld '%-.192s' kann nicht Teil eines FULLTEXT-Index seinUnbekannter Schlüssel-Cache '%-.100s'MariaDB wurde mit --skip-name-resolve gestartet. Diese Option darf nicht verwendet werden, damit diese Rechtevergabe möglich istUnbekannte Speicher-Engine '%s''%s' ist veraltet. Bitte benutzen Sie '%s'Die Zieltabelle %-.100s von %s ist nicht aktualisierbarDas Feature '%s' ist ausgeschaltet, Sie müssen MariaDB mit '%s' übersetzen, damit es verfügbar istDer MariaDB-Server läuft mit der Option %s und kann diese Anweisung deswegen nicht ausführenFeld '%-.100s' hat doppelten Wert '%-.64s' in %sFalscher %-.32T-Wert gekürzt: '%-.128T'Fehlerhafte Tabellendefinition. Es kann nur eine einzige TIMESTAMP-Spalte mit CURRENT_TIMESTAMP als DEFAULT oder in einer ON-UPDATE-Klausel gebenUngültige ON-UPDATE-Klausel für Spalte '%-.192s'Dieser Befehl wird im Protokoll für vorbereitete Anweisungen noch nicht unterstütztFehler %d '%-.200s' von %sTemporärer Fehler %d '%-.200s' von %sUnbekannte oder falsche Zeitzone: '%-.64s'Ungültiger TIMESTAMP-Wert in Feld '%s', Zeile %luUngültiger %s-Zeichen-String: '%.64T'Ergebnis von %s() war größer als max_allowed_packet (%ld) Bytes und wurde deshalb gekürztWidersprüchliche Deklarationen: '%s%s' und '%s%s'Kann kein %s innerhalb einer anderen gespeicherten Routine erzeugen%s %s existiert bereits%s %s existiert nichtDROP %s %s ist fehlgeschlagenCREATE %s %s ist fehlgeschlagen%s ohne passende Marke: %sNeudefinition der Marke %sEnde-Marke %s ohne zugehörigen AnfangZugriff auf nichtinitialisierte Variable %sPROCEDURE %s kann im gegebenen Kontext keine Ergebnismenge zurückgebenRETURN ist nur innerhalb einer FUNCTION erlaubt%s ist in gespeicherten Prozeduren nicht erlaubtDas Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wird ignoriert. Diese Option wird in MariaDB 5.6 entferntDas Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wurde in SET SQL_LOG_BIN übersetzt. Diese Option wird in MariaDB 5.6 entferntAusführung der Abfrage wurde unterbrochenFalsche Anzahl von Argumenten für %s %s; erwarte %u, erhalte %uUndefinierte CONDITION: %sKein RETURN in FUNCTION %s gefundenFUNCTION %s endete ohne RETURNCursor-Anweisung muss ein SELECT seinCursor-SELECT darf kein INTO habenUndefinierter CURSOR: %sCursor ist schon geöffnetCursor ist nicht geöffnetNicht deklarierte Variable: %sFalsche Anzahl von FETCH-VariablenKeine Daten - null Zeilen geholt (fetch), ausgewählt oder verarbeitetDoppelter Parameter: %sDoppelte Variable: %sDoppelte Bedingung: %sDoppelter Cursor: %sALTER %s %s fehlgeschlagenSubquery-Wert wird nicht unterstützt%s ist in gespeicherten Funktionen und in Triggern nicht erlaubtDeklaration einer Variablen oder einer Bedingung nach der Deklaration eines Cursors oder eines HandlersDeklaration eines Cursors nach der Deklaration eines HandlersFall für CASE-Anweisung nicht gefundenKonfigurationsdatei '%-.192s' ist zu großNicht wohlgeformter Dateityp-Header in Datei '%-.192s'Unerwartetes Dateiende beim Parsen des Kommentars '%-.200s'Fehler beim Parsen des Parameters '%-.192s' (Zeile: '%-.192s')Unerwartetes Dateiende beim Überspringen des unbekannten Parameters '%-.192s'ANALYZE/EXPLAIN/SHOW kann nicht verlangt werden. Rechte für zugrunde liegende Tabelle fehlenDatei '%-.192s' hat unbekannten Typ '%-.64s' im Header'%-.192s.%-.192s' ist nicht %sFeld '%-.192s' ist nicht aktualisierbarSELECT der View enthält eine Subquery in der FROM-KlauselSELECT der View enthält eine '%s'-KlauselSELECT der View enthält eine Variable oder einen ParameterSELECT der View verweist auf eine temporäre Tabelle '%-.192s'SELECT- und Feldliste der Views haben unterschiedliche Anzahlen von SpaltenView-Merge-Algorithmus kann hier momentan nicht verwendet werden (undefinierter Algorithmus wird angenommen)Die aktualisierte View enthält nicht den vollständigen Schlüssel der zugrunde liegenden TabelleView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themKann eine %s nicht von innerhalb einer anderen gespeicherten Routine löschen oder ändernGOTO ist im Handler einer gespeicherten Prozedur nicht erlaubtTrigger '%s' existiert bereitsTrigger existiert nicht'%-.192s' des Triggers ist ein View, temporäre Tabelle oder SequenceAktualisieren einer %s-Zeile ist in einem %s-Trigger nicht erlaubtEs gibt keine %s-Zeile im %s-TriggerFeld '%-.192s' hat keinen VorgabewertDivision durch 0Falscher %-.32s-Wert: '%-.128T' für Feld '`%.192s`.`%.192s`.`%.192s` in Zeile %luNicht zulässiger %s-Wert '%-.192T' beim Parsen gefundenCHECK OPTION auf nicht-aktualisierbarem View %`-.192s.%`-.192sCHECK OPTION fehlgeschlagen: %`-.192s.%`-.192sBefehl %-.32s nicht zulässig für Benutzer '%s'@'%s' in Routine '%-.192s'Bereinigen alter Relais-Logs fehlgeschlagen: %sPasswort-Hash sollte eine Hexdaezimalzahl mit %d Stellen seinZiel-Log im Binlog-Index nicht gefundenFehler beim Lesen der Log-Index-DateiServer-Konfiguration erlaubt keine Binlog-Bereinigungfseek() fehlgeschlagenSchwerwiegender Fehler bei der Log-BereinigungEin zu bereinigendes Log wird gerade benutzt, daher keine BereinigungUnbekannter Fehler bei Log-BereinigungInitialisierung der Relais-Log-Position fehlgeschlagen: %sSie verwenden keine BinärlogsDie Schreibweise '%-.64s' ist für interne Zwecke des MariaDB-Servers reserviertWSAStartup fehlgeschlagenKann Prozeduren mit unterschiedlichen Gruppen noch nicht verarbeitenSELECT muss bei dieser Prozedur ein GROUP BY habenKann bei dieser Prozedur keine ORDER-BY-Klausel verwendenBinärlogs und Replikation verhindern Wechsel des globalen Servers %sKann Datei nicht abbilden: %-.200s, Fehler: %MFalsche magische Zahlen in %-.64sVorbereitete Anweisung enthält zu viele PlatzhalterLänge des Schlüsselteils '%-.192s' kann nicht 0 seinView-Text-Prüfsumme fehlgeschlagenKann nicht mehr als eine Basistabelle über Join-View '%-.192s.%-.192s' ändernKann nicht ohne Feldliste in Join-View '%-.192s.%-.192s' einfügenKann nicht aus Join-View '%-.192s.%-.192s' löschenOperation %s schlug fehl für %.256sXAER_NOTA: Unbekannte XIDXAER_INVAL: Ungültige Argumente (oder nicht unterstützter Befehl)XAER_RMFAIL: DEr Befehl kann nicht ausgeführt werden, wenn die globale Transaktion im Zustand %.64s istXAER_OUTSIDE: Einige Arbeiten werden außerhalb der globalen Transaktion verrichtetXAER_RMERR: Schwerwiegender Fehler im Transaktionszweig - prüfen Sie Ihre Daten auf KonsistenzXA_RBROLLBACK: Transaktionszweig wurde zurückgerolltEs gibt diese Berechtigung für Benutzer '%-.48s' auf Host '%-.64s' für Routine '%-.192s' nichtGewährung von EXECUTE- und ALTER-ROUTINE-Rechten fehlgeschlagenRücknahme aller Rechte für die gelöschte Routine fehlgeschlagenDaten zu lang für Feld '%s' in Zeile %luUngültiger SQLSTATE: '%s'%s: bereit für Verbindungen.
Version: '%s'  Socket: '%s'  Port: %d  %sKann Wert aus Datei mit Zeilen fester Größe nicht in Variable ladenSie dürfen keinen Benutzer mit GRANT anlegenFalscher %-.32s-Wert: '%-.128T' für Funktion %-.32sTabellendefinition wurde geändert, bitte starten Sie die Transaktion neuDoppelter Handler im selben Block deklariertOUT- oder INOUT-Argument %d für Routine %s ist keine VariableRückgabe einer Ergebnismenge aus einer %s ist nicht erlaubtKann kein Geometrieobjekt aus den Daten machen, die Sie dem GEOMETRY-Feld übergeben habenEine Routine, die weder NO SQL noch READS SQL DATA in der Deklaration hat, schlug fehl und Binärlogging ist aktiv. Wenn Nicht-Transaktions-Tabellen aktualisiert wurden, enthält das Binärlog ihre Änderungen nichtDiese Routine hat weder DETERMINISTIC, NO SQL noch READS SQL DATA in der Deklaration und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_function_creators verwenden)Sie haben keine SUPER-Berechtigung und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_function_creators verwenden)Sie können keine vorbereitete Anweisung ausführen, die mit einem geöffneten Cursor verknüpft ist. Setzen Sie die Anweisung zurück, um sie neu auszuführenDie Anweisung (%lu) hat keinen geöffneten CursorExplizites oder implizites Commit ist in gespeicherten Funktionen und in Triggern nicht erlaubtEin Feld der dem View '%-.192s.%-.192s' zugrundeliegenden Tabelle hat keinen VorgabewertRekursive gespeicherte Routinen und Triggers sind nicht erlaubtZu großer Skalierungsfaktor %llu für '%-.192s' angegeben. Maximum ist %uZu große Genauigkeit %llu für '%-.192s' angegeben. Maximum ist %uFür FLOAT(M,D), DOUBLE(M,D) oder DECIMAL(M,D) muss M >= D sein (Feld '%-.192s')Sie können Schreibsperren auf der Systemtabelle nicht mit anderen Tabellen kombinierenKann nicht mit Fremddatenquelle verbinden: %.64sBei der Verarbeitung der Abfrage ist in der Fremddatenquelle ein Problem aufgetreten. Datenquellenfehlermeldung: %-.64sDie Fremddatenquelle, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung:  %-.64sKann föderierte Tabelle nicht erzeugen. Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes FormatDer Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes FormatKann föderierte Tabelle nicht erzeugen. Fremddatenquellenfehlermeldung:  %-.64sTrigger im falschen SchemaThread-Stack-Überlauf: %ld Bytes eines %ld-Byte-Stacks in Verwendung, und %ld Bytes benötigt. Verwenden Sie 'mariadbd --thread_stack=#', um einen größeren Stack anzugebenRoutinen-Body für '%-.100s' ist zu langDer vorgabemäßige Schlüssel-Cache kann nicht gelöscht werdenAnzeigebreite außerhalb des zulässigen Bereichs für '%-.192s' (Maximum = %lu)XAER_DUPID: Die XID existiert bereitsDatetime-Funktion: %-.32s FeldüberlaufKann Tabelle '%-.192s' in gespeicherter Funktion oder Trigger nicht aktualisieren, weil sie bereits von der Anweisung verwendet wird, die diese gespeicherte Funktion oder den Trigger aufriefDie Definition der Tabelle '%-.192s' verhindert die Operation %-.192s auf Tabelle '%-.192s'Die vorbereitete Anweisung enthält einen Aufruf einer gespeicherten Routine, die auf eben dieselbe Anweisung verweist. Es ist nicht erlaubt, eine vorbereitete Anweisung in solch rekursiver Weise auszuführenEs ist nicht erlaubt, innerhalb einer gespeicherten Funktion oder eines Triggers AUTOCOMMIT zu setzenInvalid definerView '%-.192s'.'%-.192s' hat keine Definierer-Information (altes Tabellenformat). Der aktuelle Benutzer wird als Definierer verwendet. Bitte erstellen Sie den View neuSie brauchen die SUPER-Berechtigung, um einen View mit dem Definierer '%-.192s'@'%-.192s' zu erzeugenDer als Definierer angegebene Benutzer ('%-.64s'@'%-.64s') existiert nichtWechsel des Schemas von '%-.192s' auf '%-.192s' ist nicht erlaubtKann Eltern-Zeile nicht löschen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%s)Kann Kind-Zeile nicht hinzufügen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%s)Variable '%-.64s' muss mit `...` geschützt oder aber umbenannt werdenKein Definierer-Attribut für Trigger '%-.192s'.'%-.192s'. Der Trigger wird mit der Autorisierung des Aufrufers aktiviert, der möglicherweise keine zureichenden Berechtigungen hat. Bitte legen Sie den Trigger neu an'%-.192s' hat altes Format, Sie sollten die '%s'-Objekt(e) neu erzeugenRekursionsgrenze %d (durch Variable max_sp_recursion_depth gegeben) wurde für Routine %.192s überschrittenRoutine %-.192s (interner Code %d) konnte nicht geladen werden. Weitere Einzelheiten erhalten Sie, wenn Sie SHOW WARNINGS ausführenUngültiger Routinenname '%-.192s'Aktualisierung erforderlich. Bitte zum Reparieren "REPAIR %s %`s" eingeben!AGGREGATE wird bei gespeicherten Funktionen nicht unterstütztKann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %u)%`s.%`s enthält View-RekursionIn der %-.192s-Klausel wird das die Nicht-Gruppierungsspalte '%-.64s' verwendetDer verwendete Tabellentyp (%s) unterstützt keine SPATIAL-IndizesTrigger können nicht auf Systemtabellen erzeugt werdenFührende Leerzeichen werden aus dem Namen '%s' entferntLesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagenBenutzernameHostnameString '%-.70T' ist zu lang für %s (sollte nicht länger sein als %d)Die Zieltabelle %-.100s von %s ist nicht einfügbarTabelle '%-.64s' ist unterschiedlich definiert, nicht vom Typ MyISAM oder existiert nichtZu tief verschachtelte SELECT-AnweisungenName '%-.64s' wurde zu ''Das erste Zeichen der Zeichenkette FIELDS TERMINATED ist mehrdeutig; bitte benutzen Sie nicht optionale und nicht leere FIELDS ENCLOSED BYDer auswärtige Server '%s' kann nicht erstellt werden, da er bereits vorhanden istDie externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung:  %-.64sSpeicher-Engine '%-.64s' der Tabelle unterstützt die Option '%.64s' nichtFehler in der SQL-Syntax: %-.64s-PARTITIONierung erfordert Definition von VALUES %-.64s für jede PartitionNur %-.64s-PARTITIONierung kann VALUES %-.64s in der Partitionsdefinition verwendenMAXVALUE kann nur für die Definition der letzten Partition verwendet werdenUnterpartitionen dürfen nur HASH- oder KEY-Partitionen seinWenn Sie Unterpartitionen auf einer Partition definieren, müssen Sie das für alle Partitionen tunFalsche Anzahl von Partitionen definiert, stimmt nicht mit vorherigen Einstellungen übereinFalsche Anzahl von Unterpartitionen definiert, stimmt nicht mit vorherigen Einstellungen übereinKonstante oder Random-Ausdrücke in (Unter-)Partitionsfunktionen sind nicht erlaubtAusdrücke in %s müssen konstant seinFelder in der Feldliste der Partitionierungsfunktion wurden in der Tabelle nicht gefundenEine Feldliste ist nur in KEY-Partitionen erlaubtDie Partitionierungsinformationen in der frm-Datei stimmen nicht mit dem überein, was in die frm-Datei geschrieben werden kannDie %-.192s-Funktion gibt einen falschen Typ zurückFür %-.64s-Partitionen muss jede Partition definiert seinWerte in VALUES LESS THAN müssen für jede Partition strikt aufsteigend seinVALUES-Werte müssen vom selben Typ wie die Partitionierungsfunktion seinMehrfachdefinition derselben Konstante bei Listen-PartitionierungPartitionierung kann in einer Abfrage nicht alleinstehend benutzt werdenDas Vermischen von Handlern in Partitionen ist in dieser Version von MariaDB nicht erlaubtFür die partitionierte Engine müssen alle %-.64s definiert seinEs wurden zu vielen Partitionen (einschließlich Unterpartitionen) definiertRANGE/LIST-Partitionierung kann bei Unterpartitionen nur zusammen mit HASH/KEY-Partitionierung verwendet werdenErzeugen einer spezifischen Handler-Datei fehlgeschlagenIn der Partitionierungsfunktion sind BLOB-Spalten nicht erlaubtA %-.192s must include all columns in the table's partitioning functionEine Anzahl von %-.64s = 0 ist kein erlaubter WertPartitionsverwaltung einer nicht partitionierten Tabelle ist nicht möglichPartitioned tables do not support %sFehler in der Partitionsliste bei %-.64sEs lassen sich nicht sämtliche Partitionen löschen, benutzen Sie statt dessen DROP TABLECOALESCE PARTITION kann nur auf HASH- oder KEY-Partitionen benutzt werdenREORGANIZE PARTITION kann nur zur Reorganisation von Partitionen verwendet werden, nicht, um ihre Nummern zu ändernREORGANIZE PARTITION ohne Parameter kann nur für auto-partitionierte Tabellen verwendet werden, die HASH-Partitionierung benutzen%-.64s PARTITION kann nur für RANGE- oder LIST-Partitionen verwendet werdenEs wurde versucht, eine oder mehrere Partitionen mit der falschen Anzahl von Unterpartitionen hinzuzufügenEs muss zumindest eine Partition hinzugefügt werdenZumindest eine Partition muss mit COALESCE PARTITION zusammengefügt werdenEs wurde versucht, mehr Partitionen als vorhanden zu reorganisierenDoppelter Partitionsname: %-.192sEs es nicht erlaubt, bei diesem Befehl binlog abzuschaltenBei der Reorganisation eines Satzes von Partitionen müssen diese in geordneter Reihenfolge vorliegenDie Reorganisation von RANGE-Partitionen kann Gesamtbereiche nicht verändern, mit Ausnahme der letzten Partition, die den Bereich erweitern kannPartitionsfunktion in dieser Version dieses Handlers nicht unterstütztPartitionszustand kann nicht von CREATE oder ALTER TABLE aus definiert werdenDer Handler %-.64s unterstützt in VALUES nur 32-Bit-IntegersPlugin '%-.192s' ist nicht geladenFalscher %-.32s-Wert: '%-.128T'Tabelle hat für den Wert %-.64s keine Partition%s darf nicht mehr als einmal angegegeben werdenAnlegen von %s fehlgeschlagenLöschen von %s fehlgeschlagenDer Handler unterstützt keine automatische Erweiterung (Autoextend) von TablespacesEin Größen-Parameter wurde unkorrekt angegeben, muss entweder Zahl sein oder im Format 10MDie Zahl für die Größe war korrekt, aber der Zahlanteil darf nicht größer als 2 Milliarden seinÄnderung von %s fehlgeschlagenSchreiben einer Zeilen ins zeilenbasierte Binärlog fehlgeschlagenTabellendefinition auf Master und Slave stimmt nicht überein: %sSlave, die mit --log-slave-updates laufen, müssen zeilenbasiertes Loggen verwenden, um zeilenbasierte Binärlog-Ereignisse loggen zu könnenEvent '%-.192s' existiert bereitsSpeichern von Event %s fehlgeschlagen. Fehlercode der Speicher-Engine: %MUnbekanntes Event '%-.192s'Ändern des Events '%-.192s' fehlgeschlagenLöschen von %s fehlgeschlagenINTERVAL ist entweder nicht positiv oder zu großENDS ist entweder ungültig oder liegt vor STARTSAusführungszeit des Events liegt in der Vergangenheit. Event wurde deaktiviertÖffnen von mysql.event fehlgeschlagenKein DATETIME-Ausdruck angegebenYou should never see itYou should never see itLöschen des Events aus mysql.event fehlgeschlagenFehler beim Kompilieren des Event-BodysAlter und neuer Event-Name sind gleichDaten der Spalte '%s' zu langKann Index '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung benötigtDie Syntax '%s' ist veraltet und wird in MariaDB %s entfernt. Bitte benutzen Sie statt dessen %sEine Log-Tabelle kann nicht schreibgesperrt werden. Es ist ohnehin nur Lesezugriff möglichLog-Tabellen können nicht gesperrt werdenYou should never see itSpaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MariaDB %d, jetzt unter %d. Bitte benutzen Sie mariadb-upgrade, um den Fehler zu behebenKann nicht aus dem zeilenbasierten Binärlog-Format herauswechseln, wenn die Sitzung offene temporäre Tabellen hatDas Binärlog-Format kann innerhalb einer gespeicherten Funktion oder eines Triggers nicht geändert werdenYou should never see itAnlegen temporärer Tabellen mit Partitionen nicht möglichPartitionskonstante liegt außerhalb der PartitionsfunktionsdomäneDiese Partitionierungsfunktion ist nicht erlaubtFehler im DDL-LogIn VALUES LESS THAN dürfen keine NULL-Werte verwendet werdenFalscher PartitionsnameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.192T' für Schlüssel '%-.192s' auftrittInterner Scheduler-Fehler %dFehler während des Startens oder Anhalten des Schedulers. Fehlercode %MEngine kann in partitionierten Tabellen nicht verwendet werdenKann Logdatei '%-.64s' nicht aktivierenDer Server wurde nicht mit zeilenbasierter Replikation gebautDer Server hat keine zeilenbasierte ReplikationRekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiertDie Operation kann nicht fortgesetzt werden, da Event Scheduler deaktiviert ist.An dieser Stelle sind nur Ganzzahlen zulässigSpeicher-Engine %s kann für Logtabellen nicht verwendet werdenSie können eine Logtabelle nicht '%s', wenn Loggen angeschaltet istKann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen zwei Tabellen umbenannt werden: die Logtabelle zu einer Archivtabelle, und eine weitere Tabelle zu '%s'Falsche Anzahl von Parametern beim Aufruf der nativen Funktion '%-.192s'Falscher Parameter beim Aufruf der nativen Funktion '%-.192s'Falsche Parameter beim Aufruf der gespeicherten Funktion '%-.192s'Die Funktion '%-.192s' hat denselben Namen wie eine native FunktionDoppelter Eintrag '%-.64T' für Schlüssel '%-.192s'Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal ausAusführungszeit des Events liegt in der Vergangenheit, und es wurde ON COMPLETION NOT PRESERVE gesetzt. Das Event wurde unmittelbar nach Erzeugung gelöschtExecution Zeitpunkt des Ereignisses in der Vergangenheit liegt, und es war NACH ABSCHLUSS Set nicht erhalten. Die Veranstaltung wurde nicht verändert. Geben Sie einen Zeitpunkt in der ZukunftDer Vorfall %s passierte auf dem Master. Meldung: %-.64sTabelle hat für einige bestehende Werte keine PartitionUnsichere Anweisung ins Binärlog geschrieben, weil Anweisungsformat BINLOG_FORMAT = STATEMENT. %sFataler Fehler: %sRelaylog-Lesefehler: %sRelaylog-Schreibfehler: %sErzeugen von %s fehlgeschlagenMaster-Befehl %s fehlgeschlagen: %sBinärlogging nicht möglich. Meldung: %sView %`s.%`s hat keinen ErzeugungskontextErzeugungskontext des Views%`s.%`s ist ungültigErzeugungskontext der gespeicherten Routine%`s.%`s ist ungültigBeschädigte TRG-Datei für Tabelle %`s.%`sTrigger für Tabelle %`s.%`s haben keinen ErzeugungskontextTrigger-Erzeugungskontext der Tabelle %`s.%`s ist ungültigErzeugungskontext des Events %`s.%`s ist ungültigKann Tabelle für den Trigger %`s.%`s nicht öffnenKann gespeicherte Routine %`s nicht erzeugen. Beachten Sie die WarnungenYou should never see itDer BINLOG-Anweisung vom Typ %s ging keine BINLOG-Anweisung zur Formatbeschreibung voranBeschädigtes Replikationsereignis entdecktUngültige Spaltenreferenz (%-.64s) bei LOAD DATAZu bereinigende Logdatei %s wurde nicht gefundenXA_RBTIMEOUT: Transaktionszweig wurde zurückgerollt: ZeitüberschreitungXA_RBDEADLOCK: Transaktionszweig wurde zurückgerollt: Deadlock entdecktVorbereitete Anweisungen müssen noch einmal vorbereitet werdenDie DELAYED-Option wird für Tabelle '%-.192s' nicht unterstütztDie Master-Info-Struktur existiert nicht '%.*s'Option <%-.64s> ignoriertEingebaute Plugins können nicht gelöscht werdenPlugin wird verwendet und wird erst beim Herunterfahren deinstalliert%s Variable '%s' ist nur lesbar. Benutzen Sie SET %s, um einen Wert zuzuweisenSpeicher-Engine %s unterstützt für diese Anweisung kein Rollback. Transaktion wurde zurückgerollt und muss neu gestartet werdenUnerwartete Daten vom Heartbeat des Masters: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itFehler beim Parsen einer Konflikt-Funktion. Meldung: %-.64sSchreiben in Ausnahme-Tabelle fehlgeschlagen. Meldung: %-.128s"Kommentar für Tabelle '%-.64s' ist zu lang (max = %u)Kommentar für Feld '%-.64s' ist zu lang (max = %u)FUNCTION %s existiert nicht. Erläuterungen im Abschnitt 'Function Name Parsing and Resolution' im ReferenzhandbuchDatenbankTabellePartitionUnterpartitionTemporärUmbenanntZu viele aktive simultane TransaktionenNicht-ASCII-Trennargumente werden nicht vollständig unterstütztDebug Sync Point Wartezeit überschrittenDebug Sync Point Hit Limit erreichtInformationselement '%s' für DuplikatbedingungUnbehandelte benutzerdefinierte WarnbedingungUnbehandelte benutzerdefinierte Nicht-gefunden-BedingungUnbehandelte benutzerdefinierte AusnahmebedingungRESIGNAL bei nicht aktivem HandlerSIGNAL/RESIGNAL kann nur mit einer Bedingung (CONDITION) benutzt werden, die bei SQLSTATE definiert wurdeDaten gekürzt für Bedingungselement '%s'Daten zu lang für Bedingungselement '%s'Unbekannte Locale: '%-.64s'Die angeforderte Server-ID %d steht im Konflikt mit der Startoption --replicate-same-server-id für den SlaveQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itPartitionsfeld '%-.192s' ist ein DuplikatInkonsistenz bei der Benutzung von Spaltenlisten für PartitionierungPartitionsspaltenwerte sind vom falschen TypZu viele Felder in '%-.192s'MAXVALUE kann nicht als Wert in VALUES IN verwendet werdenFür den Partionierungstyp %-.64s darf es nicht mehr als einen Wert gebenZeilenausdrücke in VALUES IN sind nur für Mehrfeld-Spaltenpartionierung erlaubtFeld '%-.192s' ist für diese Art von Partitionierung von einem nicht zulässigen TypDie Gesamtlänge der Partitionsfelder ist zu großCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' ist veraltet und wird in einer zukünftigen Version entfernt werdenNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerEin raumbezogener Index (SPATIAL) darf nur Spalten geometrischen Typs enthaltenComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTBenutzer '%s'@'%s' hat keine ZugriffsberechtigungSET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeKann %s.%s nicht einlesen. Tabelle ist wahrscheinlich beschädigtThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesFremdschlüssel-Beschränkung für Tabelle '%.192s', Datensatz '%-.192s' würde zu einem doppelten Eintrag in Tabelle '%.192s', Schlüssel '%.192s' führenFremdschlüssel-Beschränkung für Tabelle '%.192s', Datensatz '%-.192s' würde zu einem doppelten Eintrag in einer Kind-Tabelle führenSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logSpaltenanzahl von %s.%s falsch. %d erwartet, aber %d gefunden. Tabelle ist wahrscheinlich beschädigtSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionKann Spalte '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung '%-.192s' benötigtKann Spalte '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung '%-.192s' der Tabelle %-.192s benötigtSpalte '%-.192s' kann nicht NOT NULL sein: wird für eine Fremdschlüsselbeschränkung '%-.192s' SET NULL benötigtDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDoppelter Eintrag für Schlüssel '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Öffnen von %s.%s fehlgeschlagenConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnbekannte Abfrage-ID: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'Sie sind nicht Eigentümer von Abfrage %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Spaltenanzahl von %s.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MariaDB %d, jetzt unter %d. Bitte benutzen Sie mariadb-upgrade, um den Fehler zu behebenTrigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s fehlgeschlagen: %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave-SQL-Thread hat die Abfrage '%s' ignoriertAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disablednorwegian/errmsg.sys000064400000230337150343472770010620 0ustar00��!'o��=�025<<KM.'4*#..155L9-,=3%-(@"$C7J[I%-D:%'1*) B#$),&-#$!7:>1CP2*#9]CTL$<sF@'` /0B2 �-&!*L$ :�vAx,$"9'"e?gj./�2rB;P[/&U:"D @4*)+*+*849Y -:>E[&':f/-=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E*)2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%wG_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?,8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7%FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�#i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;Ig�hashchkisamchkNEIJAKan ikke opprette fila '%-.200s' (Feilkode: %M)Kan ikke opprette tabellen %`s.%`s (Feilkode: %M)Kan ikke opprette databasen '%-.192s' (Feilkode: %M)Kan ikke opprette databasen '%-.192s'; databasen eksistererKan ikke fjerne (drop) '%-.192s'; databasen eksisterer ikkeFeil ved fjerning (drop) av databasen (kan ikke slette '%-.192s', feil %M)Feil ved sletting av database (kan ikke slette katalogen '%-.192s', feil %M)Feil ved sletting av '%-.192s' (Feilkode: %M)Kan ikke lese posten i systemkatalogenKan ikke lese statusen til '%-.200s' (Feilkode: %M)Kan ikke lese aktiv katalog(Feilkode: %M)Kan ikke låse fila (Feilkode: %M)Kan ikke åpne fila: '%-.200s' (Feilkode: %M)Kan ikke finne fila: '%-.200s' (Feilkode: %M)Kan ikke lese katalogen '%-.192s' (Feilkode: %M)Kan ikke skifte katalog til '%-.192s' (Feilkode: %M)Posten har blitt endret siden den ble lest '%-.192s'Ikke mer diskplass (%s). Venter på å få frigjort plass... (Feilkode: %M)Kan ikke skrive, flere like nøkler i tabellen '%-.192s'Feil ved lukking av '%-.192s' (Feilkode: %M)Feil ved lesing av '%-.200s' (Feilkode: %M)Feil ved omdøping av '%-.210s' til '%-.210s' (Feilkode: %M)Feil ved skriving av fila '%-.200s' (Feilkode: %M)'%-.192s' er låst mot oppdateringerSortering avbruttView '%-.192s' eksisterer ikke for '%-.192s'Mottok feil %M fra tabell håndterer %sStorage engine %s of the table %`s.%`s doesn't have this optionKan ikke finne posten i '%-.192s'Feil informasjon i filen: '%-.200s'Tabellen '%-.200s' har feil i nøkkelfilen; forsøk å reparer denGammel nøkkelfil for tabellen '%-.192s'; reparer den!'%-.192s' er skrivebeskyttetIkke mer minne. Star på nytt tjenesten og prøv igjen (trengte %d byter)Ikke mer sorteringsminne. Vurder å øke sorteringsminnet (sort buffer size) for tjenestenUventet slutt på fil (eof) ved lesing av filen '%-.192s' (Feilkode: %M)For mange tilkoblinger (connections)Tomt for tråd plass/minneKan ikke få tak i vertsnavn for din adresseFeil håndtrykk (handshake)Tilgang nektet for bruker: '%s'@'%s' til databasen '%-.192s' nektetTilgang nektet for bruker: '%s'@'%s' (Bruker passord: %s)Ingen database valgtUkjent kommandoKolonne '%-.192s' kan ikke vere nullUkjent database '%-.192s'Tabellen '%-.192s' eksisterer alleredeUkjent tabell '%-.100T'Felt: '%-.192s' i tabell %-.192s er ikke entydigDatabase nedkobling er i gangUkjent kolonne '%-.192s' i tabell %-.192sBrukte '%-.192s' som ikke var i group byKan ikke gruppere på '%-.192s'Uttrykket har summer (sum) funksjoner og kolonner i samme uttrykkFelt telling stemmer verdi tellingIdentifikator '%-.100T' er for langFeltnavnet '%-.192s' eksisterte fra førNøkkelnavnet '%-.192s' eksisterte fra førLike verdier '%-.192T' for nøkkel %dFeil kolonne spesifikator for felt '%-.192s'%s nær '%-.80T' på linje %dForespørsel var tomIkke unikt tabell/alias: '%-.192s'Ugyldig standardverdi for '%-.192s'Fleire primærnøkle spesifisertFor mange nøkler spesifisert. Maks %d nøkler tillattFor mange nøkkeldeler spesifisert. Maks %d deler tillattSpesifisert nøkkel var for lang. Maks nøkkellengde er is %dNøkkel felt '%-.192s' eksiterer ikke i tabellenBLOB column %`s can't be used in key specification in the %s tableFor stor nøkkellengde for kolonne '%-.192s' (maks = %lu). Bruk BLOB istedenforBare ett auto felt kan være definert som nøkkelCould not delete gtid domain. Reason: %s.%s (%s): Normal avslutning%s: Oppdaget signal %d. Avslutter!%s: Avslutning komplett%s: Påtvinget avslutning av tråd %ld  bruker: '%-.48s'Kan ikke opprette IP socketTabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Gjenopprett tabellenFelt skiller argumentene er ikke som forventet, se dokumentasjonenEn kan ikke bruke faste feltlengder med BLOB. Vennlisgt bruk 'fields terminated by'Filen '%-.128s' må være i database-katalogen for å være lesbar for alleFilen '%-.200s' eksisterte alleredePoster: %ld  Fjernet: %ld  Hoppet over: %ld  Advarsler: %ldPoster: %ld  Like: %ldFeil delnøkkel. Den brukte delnøkkelen er ikke en streng eller den oppgitte lengde er lengre enn nøkkel lengdenEn kan ikke slette alle felt med ALTER TABLE. Bruk DROP TABLE istedenKan ikke DROP %s %`-.192s. Undersøk om felt/nøkkel eksistererPoster: %ld  Like: %ld  Advarsler: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataUkjent tråd id: %luDu er ikke eier av tråden %lldIngen tabeller i brukFor mange tekststrenger kolonne %-.192s og SETKan ikke lage unikt loggfilnavn %-.200s.(1-999)Tabellen '%-.192s' var låst med READ lås og kan ikke oppdateresTabellen '%-.192s' var ikke låst med LOCK TABLESYou should never see itUgyldig database navn '%-.100T'Ugyldig tabell navn '%-.100s'SELECT ville undersøke for mange poster og ville sannsynligvis ta veldig lang tid. Undersøk WHERE klausulen og bruk SET SQL_BIG_SELECTS=1 om SELECTen er korrektUkjent feilUkjent prosedyre %-.192sFeil parameter antall til prosedyren %-.192sFeil parametre til prosedyren %-.192sUkjent tabell '%-.192s' i %-.32sFeltet '%-.192s' er spesifisert to gangerInvalid use of group functionTable '%-.192s' uses a extension that doesn't exist in this MariaDB versionA table must have at least 1 columnThe table '%-.192s' is fullUnknown character set: '%-.64s'Too many tables; MariaDB can only use %d tables in a joinToo many columnsRow size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBsThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededCross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerCan't load function '%-.192s'Can't initialize function '%-.192s'; %-.80sNo paths allowed for shared libraryFunction '%-.192s' already existsCan't open shared library '%-.192s' (errno: %d, %-.128s)Can't find symbol '%-.128s' in libraryFunction '%-.192s' is not definedHost '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'Host '%-.64s' is not allowed to connect to this MariaDB serverYou are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settingsYou must have privileges to update tables in the mysql database to be able to change passwords for othersCan't find any matching row in the user tableRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory you can consult the manual for any possible OS dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192sInvalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionSomething is wrong in your syntaxDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sAll tables in the MERGE table are not defined identicallyCan't write, because of unique constraint, to table '%-.192s'BLOB column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetMottok feil %d '%-.200s' fa %sMottok temporary feil %d '%-.200s' fra %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYKan ikke opprette utenlandsk server '%s' fordi den allerede eksistererThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionLike verdier '%-.64T' for nøkkel '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTTilgang nektet for bruker: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionLike verdier for nøkkel '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmagic000064400000002676150343472770005576 0ustar00#
# Add the following to the end of your /etc/magic file to get the 'file'
# command to recognize some MariaDB / MySQL files.
#
0       beshort           0xfe01        MariaDB/MySQL table definition file
>2      byte            x               Version %d
0       belong&0xffffff00 0xfefe0700    MariaDB/MySQL MyISAM index file
>3      byte            x               Version %d
0       belong&0xffffff00 0xfefe0800    MariaDB/MySQL MyISAM compressed data file
>3      byte            x               Version %d
0       belong&0xffffff00 0xfefe0900    MariaDB Aaria index file
>3      byte            x               Version %d
0       belong&0xffffff00 0xfefe0A00    MariaDB Aaria compressed data file
>3      byte            x               Version %d
0       belong&0xffffff00 0xfefe0500    MariaDB/MySQL ISAM index file
>3      byte            x               Version %d
0       belong&0xffffff00 0xfefe0600    MariaDB/MySQL ISAM compressed data file
>3      byte            x               Version %d
0       string           \376bin        MariaDB/MySQL replication log
0       belong&0xffffff00 0xfefe0b00
>4      string          MARIALOG        MariaDB Aria transaction log file
>>3     byte            x               Version %d
0       belong&0xffffff00 0xfefe0c00    MariaDB Aria control file
>3      byte            x               Version %d
0       belong&0xffffff00 0xfefe0b00    MariaDB DDL recovery log
>3      byte            x               Version %d
mysql_test_data_timezone.sql000064400000024255150343472770012420 0ustar00-- Copyright (C) 2007 MySQL AB
-- Use is subject to license terms
-- 
-- 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 Street, Fifth Floor, Boston, MA  02110-1335  USA

INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES   ('MET', 1), ('UTC', 2), ('Universal', 2),    ('Europe/Moscow',3), ('leap/Europe/Moscow',4),    ('Japan', 5);
INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)   VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');
INSERT INTO time_zone_transition   (Time_zone_id, Transition_time, Transition_type_id) VALUES   (1, -1693706400, 0) ,(1, -1680483600, 1)  ,(1, -1663455600, 2) ,(1, -1650150000, 3)  ,(1, -1632006000, 2) ,(1, -1618700400, 3)  ,(1, -938905200, 2) ,(1, -857257200, 3)  ,(1, -844556400, 2) ,(1, -828226800, 3)  ,(1, -812502000, 2) ,(1, -796777200, 3)  ,(1, 228877200, 2) ,(1, 243997200, 3)  ,(1, 260326800, 2) ,(1, 276051600, 3)  ,(1, 291776400, 2) ,(1, 307501200, 3)  ,(1, 323830800, 2) ,(1, 338950800, 3)  ,(1, 354675600, 2) ,(1, 370400400, 3)  ,(1, 386125200, 2) ,(1, 401850000, 3)  ,(1, 417574800, 2) ,(1, 433299600, 3)  ,(1, 449024400, 2) ,(1, 465354000, 3)  ,(1, 481078800, 2) ,(1, 496803600, 3)  ,(1, 512528400, 2) ,(1, 528253200, 3)  ,(1, 543978000, 2) ,(1, 559702800, 3)  ,(1, 575427600, 2) ,(1, 591152400, 3)  ,(1, 606877200, 2) ,(1, 622602000, 3)  ,(1, 638326800, 2) ,(1, 654656400, 3)  ,(1, 670381200, 2) ,(1, 686106000, 3)  ,(1, 701830800, 2) ,(1, 717555600, 3)  ,(1, 733280400, 2) ,(1, 749005200, 3)  ,(1, 764730000, 2) ,(1, 780454800, 3)  ,(1, 796179600, 2) ,(1, 811904400, 3)  ,(1, 828234000, 2) ,(1, 846378000, 3)  ,(1, 859683600, 2) ,(1, 877827600, 3)  ,(1, 891133200, 2) ,(1, 909277200, 3)  ,(1, 922582800, 2) ,(1, 941331600, 3)  ,(1, 954032400, 2) ,(1, 972781200, 3)  ,(1, 985482000, 2) ,(1, 1004230800, 3)  ,(1, 1017536400, 2) ,(1, 1035680400, 3)  ,(1, 1048986000, 2) ,(1, 1067130000, 3)  ,(1, 1080435600, 2) ,(1, 1099184400, 3)  ,(1, 1111885200, 2) ,(1, 1130634000, 3)  ,(1, 1143334800, 2) ,(1, 1162083600, 3)  ,(1, 1174784400, 2) ,(1, 1193533200, 3)  ,(1, 1206838800, 2) ,(1, 1224982800, 3)  ,(1, 1238288400, 2) ,(1, 1256432400, 3)  ,(1, 1269738000, 2) ,(1, 1288486800, 3)  ,(1, 1301187600, 2) ,(1, 1319936400, 3)  ,(1, 1332637200, 2) ,(1, 1351386000, 3)  ,(1, 1364691600, 2) ,(1, 1382835600, 3)  ,(1, 1396141200, 2) ,(1, 1414285200, 3)  ,(1, 1427590800, 2) ,(1, 1445734800, 3)  ,(1, 1459040400, 2) ,(1, 1477789200, 3)  ,(1, 1490490000, 2) ,(1, 1509238800, 3)  ,(1, 1521939600, 2) ,(1, 1540688400, 3)  ,(1, 1553994000, 2) ,(1, 1572138000, 3)  ,(1, 1585443600, 2) ,(1, 1603587600, 3)  ,(1, 1616893200, 2) ,(1, 1635642000, 3)  ,(1, 1648342800, 2) ,(1, 1667091600, 3)  ,(1, 1679792400, 2) ,(1, 1698541200, 3)  ,(1, 1711846800, 2) ,(1, 1729990800, 3)  ,(1, 1743296400, 2) ,(1, 1761440400, 3)  ,(1, 1774746000, 2) ,(1, 1792890000, 3)  ,(1, 1806195600, 2) ,(1, 1824944400, 3)  ,(1, 1837645200, 2) ,(1, 1856394000, 3)  ,(1, 1869094800, 2) ,(1, 1887843600, 3)  ,(1, 1901149200, 2) ,(1, 1919293200, 3)  ,(1, 1932598800, 2) ,(1, 1950742800, 3)  ,(1, 1964048400, 2) ,(1, 1982797200, 3)  ,(1, 1995498000, 2) ,(1, 2014246800, 3)  ,(1, 2026947600, 2) ,(1, 2045696400, 3)  ,(1, 2058397200, 2) ,(1, 2077146000, 3)  ,(1, 2090451600, 2) ,(1, 2108595600, 3)  ,(1, 2121901200, 2) ,(1, 2140045200, 3)  ,(3, -1688265000, 2) ,(3, -1656819048, 1)  ,(3, -1641353448, 2) ,(3, -1627965048, 3)  ,(3, -1618716648, 1) ,(3, -1596429048, 3)  ,(3, -1593829848, 5) ,(3, -1589860800, 4)  ,(3, -1542427200, 5) ,(3, -1539493200, 6)  ,(3, -1525323600, 5) ,(3, -1522728000, 4)  ,(3, -1491188400, 7) ,(3, -1247536800, 4)  ,(3, 354920400, 5) ,(3, 370728000, 4)  ,(3, 386456400, 5) ,(3, 402264000, 4)  ,(3, 417992400, 5) ,(3, 433800000, 4)  ,(3, 449614800, 5) ,(3, 465346800, 8)  ,(3, 481071600, 9) ,(3, 496796400, 8)  ,(3, 512521200, 9) ,(3, 528246000, 8)  ,(3, 543970800, 9) ,(3, 559695600, 8)  ,(3, 575420400, 9) ,(3, 591145200, 8)  ,(3, 606870000, 9) ,(3, 622594800, 8)  ,(3, 638319600, 9) ,(3, 654649200, 8)  ,(3, 670374000, 10) ,(3, 686102400, 11)  ,(3, 695779200, 8) ,(3, 701812800, 5)  ,(3, 717534000, 4) ,(3, 733273200, 9)  ,(3, 748998000, 8) ,(3, 764722800, 9)  ,(3, 780447600, 8) ,(3, 796172400, 9)  ,(3, 811897200, 8) ,(3, 828226800, 9)  ,(3, 846370800, 8) ,(3, 859676400, 9)  ,(3, 877820400, 8) ,(3, 891126000, 9)  ,(3, 909270000, 8) ,(3, 922575600, 9)  ,(3, 941324400, 8) ,(3, 954025200, 9)  ,(3, 972774000, 8) ,(3, 985474800, 9)  ,(3, 1004223600, 8) ,(3, 1017529200, 9)  ,(3, 1035673200, 8) ,(3, 1048978800, 9)  ,(3, 1067122800, 8) ,(3, 1080428400, 9)  ,(3, 1099177200, 8) ,(3, 1111878000, 9)  ,(3, 1130626800, 8) ,(3, 1143327600, 9)  ,(3, 1162076400, 8) ,(3, 1174777200, 9)  ,(3, 1193526000, 8) ,(3, 1206831600, 9)  ,(3, 1224975600, 8) ,(3, 1238281200, 9)  ,(3, 1256425200, 8) ,(3, 1269730800, 9)  ,(3, 1288479600, 8) ,(3, 1301180400, 9)  ,(3, 1319929200, 8) ,(3, 1332630000, 9)  ,(3, 1351378800, 8) ,(3, 1364684400, 9)  ,(3, 1382828400, 8) ,(3, 1396134000, 9)  ,(3, 1414278000, 8) ,(3, 1427583600, 9)  ,(3, 1445727600, 8) ,(3, 1459033200, 9)  ,(3, 1477782000, 8) ,(3, 1490482800, 9)  ,(3, 1509231600, 8) ,(3, 1521932400, 9)  ,(3, 1540681200, 8) ,(3, 1553986800, 9)  ,(3, 1572130800, 8) ,(3, 1585436400, 9)  ,(3, 1603580400, 8) ,(3, 1616886000, 9)  ,(3, 1635634800, 8) ,(3, 1648335600, 9)  ,(3, 1667084400, 8) ,(3, 1679785200, 9)  ,(3, 1698534000, 8) ,(3, 1711839600, 9)  ,(3, 1729983600, 8) ,(3, 1743289200, 9)  ,(3, 1761433200, 8) ,(3, 1774738800, 9)  ,(3, 1792882800, 8) ,(3, 1806188400, 9)  ,(3, 1824937200, 8) ,(3, 1837638000, 9)  ,(3, 1856386800, 8) ,(3, 1869087600, 9)  ,(3, 1887836400, 8) ,(3, 1901142000, 9)  ,(3, 1919286000, 8) ,(3, 1932591600, 9)  ,(3, 1950735600, 8) ,(3, 1964041200, 9)  ,(3, 1982790000, 8) ,(3, 1995490800, 9)  ,(3, 2014239600, 8) ,(3, 2026940400, 9)  ,(3, 2045689200, 8) ,(3, 2058390000, 9)  ,(3, 2077138800, 8) ,(3, 2090444400, 9)  ,(3, 2108588400, 8) ,(3, 2121894000, 9)  ,(3, 2140038000, 8)  ,(4, -1688265000, 2) ,(4, -1656819048, 1)  ,(4, -1641353448, 2) ,(4, -1627965048, 3)  ,(4, -1618716648, 1) ,(4, -1596429048, 3)  ,(4, -1593829848, 5) ,(4, -1589860800, 4)  ,(4, -1542427200, 5) ,(4, -1539493200, 6)  ,(4, -1525323600, 5) ,(4, -1522728000, 4)  ,(4, -1491188400, 7) ,(4, -1247536800, 4)  ,(4, 354920409, 5) ,(4, 370728010, 4)  ,(4, 386456410, 5) ,(4, 402264011, 4)  ,(4, 417992411, 5) ,(4, 433800012, 4)  ,(4, 449614812, 5) ,(4, 465346812, 8)  ,(4, 481071612, 9) ,(4, 496796413, 8)  ,(4, 512521213, 9) ,(4, 528246013, 8)  ,(4, 543970813, 9) ,(4, 559695613, 8)  ,(4, 575420414, 9) ,(4, 591145214, 8)  ,(4, 606870014, 9) ,(4, 622594814, 8)  ,(4, 638319615, 9) ,(4, 654649215, 8)  ,(4, 670374016, 10) ,(4, 686102416, 11)  ,(4, 695779216, 8) ,(4, 701812816, 5)  ,(4, 717534017, 4) ,(4, 733273217, 9)  ,(4, 748998018, 8) ,(4, 764722818, 9)  ,(4, 780447619, 8) ,(4, 796172419, 9)  ,(4, 811897219, 8) ,(4, 828226820, 9)  ,(4, 846370820, 8) ,(4, 859676420, 9)  ,(4, 877820421, 8) ,(4, 891126021, 9)  ,(4, 909270021, 8) ,(4, 922575622, 9)  ,(4, 941324422, 8) ,(4, 954025222, 9)  ,(4, 972774022, 8) ,(4, 985474822, 9)  ,(4, 1004223622, 8) ,(4, 1017529222, 9)  ,(4, 1035673222, 8) ,(4, 1048978822, 9)  ,(4, 1067122822, 8) ,(4, 1080428422, 9)  ,(4, 1099177222, 8) ,(4, 1111878022, 9)  ,(4, 1130626822, 8) ,(4, 1143327622, 9)  ,(4, 1162076422, 8) ,(4, 1174777222, 9)  ,(4, 1193526022, 8) ,(4, 1206831622, 9)  ,(4, 1224975622, 8) ,(4, 1238281222, 9)  ,(4, 1256425222, 8) ,(4, 1269730822, 9)  ,(4, 1288479622, 8) ,(4, 1301180422, 9)  ,(4, 1319929222, 8) ,(4, 1332630022, 9)  ,(4, 1351378822, 8) ,(4, 1364684422, 9)  ,(4, 1382828422, 8) ,(4, 1396134022, 9)  ,(4, 1414278022, 8) ,(4, 1427583622, 9)  ,(4, 1445727622, 8) ,(4, 1459033222, 9)  ,(4, 1477782022, 8) ,(4, 1490482822, 9)  ,(4, 1509231622, 8) ,(4, 1521932422, 9)  ,(4, 1540681222, 8) ,(4, 1553986822, 9)  ,(4, 1572130822, 8) ,(4, 1585436422, 9)  ,(4, 1603580422, 8) ,(4, 1616886022, 9)  ,(4, 1635634822, 8) ,(4, 1648335622, 9)  ,(4, 1667084422, 8) ,(4, 1679785222, 9)  ,(4, 1698534022, 8) ,(4, 1711839622, 9)  ,(4, 1729983622, 8) ,(4, 1743289222, 9)  ,(4, 1761433222, 8) ,(4, 1774738822, 9)  ,(4, 1792882822, 8) ,(4, 1806188422, 9)  ,(4, 1824937222, 8) ,(4, 1837638022, 9)  ,(4, 1856386822, 8) ,(4, 1869087622, 9)  ,(4, 1887836422, 8) ,(4, 1901142022, 9)  ,(4, 1919286022, 8) ,(4, 1932591622, 9)  ,(4, 1950735622, 8) ,(4, 1964041222, 9)  ,(4, 1982790022, 8) ,(4, 1995490822, 9)  ,(4, 2014239622, 8) ,(4, 2026940422, 9)  ,(4, 2045689222, 8) ,(4, 2058390022, 9)  ,(4, 2077138822, 8) ,(4, 2090444422, 9)  ,(4, 2108588422, 8) ,(4, 2121894022, 9)  ,(4, 2140038022, 8)  ,(5, -1009875600, 1);
INSERT INTO time_zone_transition_type (Time_zone_id,  Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES   (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')  ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')  ,(2, 0, 0, 0, 'UTC')  ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')  ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')  ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')  ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')  ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')  ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')  ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')  ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')  ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')  ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')  ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')  ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')  ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');
INSERT INTO time_zone_leap_second   (Transition_time, Correction) VALUES   (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22);
systemd/mariadb.service000064400000013153150343472770011234 0ustar00# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades.  If you want to customize, the
# best way is to create a file "/etc/systemd/system/mariadb.service",
# containing
#	.include /usr/lib/systemd/system/mariadb.service
#	...make your changes here...
# or create a file "/etc/systemd/system/mariadb.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file mariadb.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# https://mariadb.com/kb/en/mariadb/systemd/
#
# Copyright notice:
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

[Unit]
Description=MariaDB 10.6.22 database server
Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target

[Install]
WantedBy=multi-user.target


[Service]

##############################################################################
## Core requirements
##

Type=notify

# Setting this to true can break replication and the Type=notify settings
# See also bind-address mariadbd option.
PrivateNetwork=false

##############################################################################
## Package maintainers
##

User=mysql
Group=mysql

# CAP_IPC_LOCK To allow memlock to be used as non-root user
# These are enabled by default
AmbientCapabilities=CAP_IPC_LOCK

# PrivateDevices=true implies NoNewPrivileges=true and
# SUID auth_pam_tool suddenly doesn't do setuid anymore
PrivateDevices=false

# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full



# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=true

# Prevent accessing /home, /root and /run/user
ProtectHome=true

# Execute pre and post scripts as root, otherwise it does it as User=
PermissionsStartOnly=true



# Perform automatic wsrep recovery. When server is started without wsrep,
# galera_recovery simply returns an empty string. In any case, however,
# the script is not expected to return with a non-zero status.
# It is always safe to unset _WSREP_START_POSITION environment variable.
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
 VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
 && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"

# Needed to create system tables etc.
# ExecStartPre=/usr/bin/mysql_install_db -u mysql

# Start main service
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
# Use the [Service] section and Environment="MYSQLD_OPTS=...".
# This isn't a replacement for my.cnf.
# _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster
ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION

# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"



KillSignal=SIGTERM

# Don't want to see an automated SIGKILL ever
SendSIGKILL=no

# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s

UMask=007

##############################################################################
## USERs can override
##
##
## by creating a file in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
## and adding/setting the following under [Service] will override this file's
## settings.

# Useful options not previously available in [mysqld_safe]

# Kernels like killing mariadbd when out of memory because its big.
# Lets temper that preference a little.
# OOMScoreAdjust=-600

# Explicitly start with high IO priority
# BlockIOWeight=1000

# If you don't use the /tmp directory for SELECT ... OUTFILE and
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
PrivateTmp=false

# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
# this is the same value as used in SysV init scripts in the past
# Galera might need a longer timeout, check the KB if you want to change this:
# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout
TimeoutStartSec=900
TimeoutStopSec=900

# Set the maximium number of tasks (threads) to 99% of what the system can
# handle as set by the kernel, reserve the 1% for a remote ssh connection,
# some monitoring, or that backup cron job. Without the directive this would
# be 15% (see DefaultTasksMax in systemd man pages).
TasksMax=99%

##
## Options previously available to be set via [mysqld_safe]
## that now needs to be set by systemd config files as mysqld_safe
## isn't executed.
##

# Number of files limit. previously [mysqld_safe] open-files-limit
LimitNOFILE=32768

# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=

# Nice priority. previously [mysqld_safe] nice
# Nice=-5

# Timezone. previously [mysqld_safe] timezone
# Environment="TZ=UTC"

# Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
# (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
# Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=

# Flush caches. previously [mysqld_safe] flush-caches=1
# ExecStartPre=sync
# ExecStartPre=sysctl -q -w vm.drop_caches=3

# numa-interleave=1 equalivant
# Change ExecStart=numactl --interleave=all /usr/sbin/mariadbd......

# crash-script equalivent
# FailureAction=
systemd/use_galera_new_cluster.conf000064400000001244150343472770013641 0ustar00#
# Install as /etc/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf
#
# MariaDB uses /usr/bin/galera_new_cluster
#
# This is here to help guide people that may have used Percona mysql@bootstrap
# to the correct implementation.

[Unit]

ConditionPathExists=

[Service]

Type=oneshot
Restart=no

# Don't install or try to prepare for galera SST.
ExecStartPre=

# Override the multi instance service for a bootstrap start instance
ExecStart=
ExecStart=/usr/bin/echo "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster"
ExecStart=/usr/bin/false

# This isn't a service meant to execute anything but a message
ExecStartPost=
systemd/mariadb@.service000064400000023301150343472770011330 0ustar00# Multi instance version of MariaDB
#
# Use this if you run multiple instances of MariaDB on a single server.
#
# This systemd service is not suitable for Galera as specialised SST recovery
# scripts are needed.
#
#
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades.  If you want to customize, the
# best way is to create a file "/etc/systemd/system/mariadb@.service",
# containing
#	.include /usr/lib/systemd/system/mariadb@.service
#	...make your changes here...
# or create a file "/etc/systemd/system/mariadb@.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file mariadb@.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# https://mariadb.com/kb/en/mariadb/systemd/
#
# Copyright notice:
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
#
# MULTI INSTANCES
#
# When multiple instances of MariaDB are running on a server they need to
# ensure that they don't conflict with each other. This includes elements
# like network ports, sockets and data directories listed under CONFLICTING
# VARIABLES below. The systemd environment variable MYSQLD_MULTI_INSTANCE
# controls each instance to ensure it is run independently. It is passed to
# mariadbd and mysql_install
#
# By default, a group suffix exists and within the default configuration
# files, a group [mariadbd.{instancename}] is read for each service. Other
# default groups, like [server.{instancename}] and [mariadb.{instancename}],
# are also read. For each instance, one of the groups will need to contain
# the conflicting variables listed below under CONFLICTING VARIABLES.
#
# The MYSQLD_MULTI_INSTANCE environment used is:
#    Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=/usr'
#
#
# APPLYING YOUR MULTI INSTANCE MECHANISM
#
# To apply one of the non-default multi-instance mechanisms, create a file
# "/etc/systemd/system/mariadb@.service.d/multi.conf" containing:
#
#   [Service]
#   Environment=MYSQLD_MULTI_INSTANCE="...."
#
# Include any other settings you which to override. Directives like Exec* are
# lists and adding a directive will append to the list. You can clear the list
# by starting with "Directive=" and no value. Follow this by the list that you
# do want. See the systemd.unit(5) manual page for more information.
#
# Then run "systemctl daemon-reload".
#
#
# EXAMPLE MYSQLD_MULTI_INSTANCE CONFIGURATIONS
#
# Configuration File Based Mechanism:
#
# This has a configuration file per instance.
#
#   [Unit]
#   ConditionPathExists=/etc/my.%I.cnf
#
#   [Service]
#   Environment=MYSQLD_MULTI_INSTANCE=--defaults-file=/etc/my.%I.cnf
#
# Here you need to create a configuration file /etc/my.%I.cnf for each
# instance, each containing the conflicting variables to separate instances.
#
#
# Multi User Based Mechanism:
#
# Here each user (the instance name) has their own mysql instance.
#
# Create instances in users home directory with abstract socket:
#
#   [Service]
#   User=%I
#   ProtectHome=false
#   ExecStartPre=
#   ExecStartPre=/usr/bin/mysql_install_db $MYSQLD_MULTI_INSTANCE \
#       --auth-root-authentication-method=socket --auth-root-socket-user=%I
#   Environment=MYSQLD_MULTI_INSTANCE="--defaults-file=/home/%I/my%I.cnf \
#       --datadir=/home/%I/mysqldatadir --skip-networking --socket=@mysql-%I"
#
#
# Command Line Mechanism:
#
# This is a good way run multiple instance where there is little difference
# in configuration between instances.
#
#   [Service]
#   Environment=MYSQLD_MULTI_INSTANCE="--socket=/run/mysqld/%I.sock \
#                        --datadir=/var/lib/mysqld-multi/%I \
#                        --skip-networking"
#
#
# CONFLICTING VARIABLES
#
# A number of MariaDB system variables may conflict. The main ones that need to
# be set because their default values will conflict are:
#   * socket
#   * port
#   * datadir
#
#
# PRE-10.4
#
# Before 10.4 MYSQLD_MULTI_INSTANCE was effectively --defaults-file=/etc/my.cnf.d/my%I.cnf
# As /etc/my.cnf included these files it was a bad choice as an
# existing single instance would include all these files. If you want to
# continue a file based multi-instance mariadbd, recommend the Configuration File
# Based Mechanism above and moving /etc/my.cnf.d/my%I.cnf files to /etc/my%I.cnf.
#
#
# SELINUX
#
# As basic selinux rules are written around a single instance of MariaDB you may need
# to define labels for the files and network ports of all instances.
#
# See: https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#selinux
#
#
# STARTING
#
# Start the instance: systemctl start mariadb@{instancename}.service
#
#
# DOCUMENTATION:
#
# Read https://mariadb.com/kb/en/mariadb/systemd/ regarding customisation.
#
# Also see systemd man pages: systemd.unit(5), systemd.exec(5) and
# systemd.service(5)

[Unit]
Description=MariaDB 10.6.22 database server (multi-instance %I)
Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target

# Negated condition here is because 10.3 and before had /etc/my.cnf.d/my%I.cnf
# as the configuration difference for multiple instances. This condition here
# to prevent an accidental change during an upgrade in the case the user
# created these file(s).
#
## See Environment=MYSQLD_MULTI_INSTANCE below for current recommended options.
ConditionPathExists=!/etc/my.cnf.d/my%I.cnf


[Install]
WantedBy=multi-user.target


[Service]
##############################################################################
## Core requirements
##

Type=notify

# Setting this to true can break replication and the Type=notify settings
# See also bind-address mariadbd option.
PrivateNetwork=false

##############################################################################
## Package maintainers
##

# CAP_IPC_LOCK To allow memlock to be used as non-root user
# These are enabled by default
AmbientCapabilities=CAP_IPC_LOCK

# PrivateDevices=true implies NoNewPrivileges=true and
# SUID auth_pam_tool suddenly doesn't do setuid anymore
PrivateDevices=false

# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full



# Requires kernel 4.14 or later and SELinux transition rule for mysqld_t
# (https://github.com/systemd/systemd/issues/3845)
# NoNewPrivileges=true

# Prevent accessing /home, /root and /run/user
ProtectHome=true

# Needed to create system tables etc.
ExecStartPre=/usr/bin/mysql_install_db $MYSQLD_MULTI_INSTANCE

# Start main service
# A few variables are here:
# * MYSQLD_MULTI_INSTANCE - control how multiple instances are distinguisable
# * MYSQLD_OPTS - user definable extras - not a replacement for my.cnf
#
# Note 1: Place $MYSQLD_OPTS at the very end for its options to take precedence.
ExecStart=/usr/sbin/mariadbd $MYSQLD_MULTI_INSTANCE $MYSQLD_OPTS



KillSignal=SIGTERM

# Don't want to see an automated SIGKILL ever
SendSIGKILL=no

# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s

UMask=007

##############################################################################
## USERs can override
##
##
## by creating a file in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
## and adding/setting the following below [Service] will override this file's
## settings.

# Useful options not previously available in [mysqld_safe]

# Kernels like killing mariadbd when out of memory because its big.
# Lets temper that preference a little.
# OOMScoreAdjust=-600

# Explicitly start with high IO priority
# BlockIOWeight=1000

# If you don't use the /tmp directory for SELECT ... OUTFILE and
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
PrivateTmp=false

# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
# this is the same value as used in SysV init scripts in the past
# if you need a longer timeout, check the KB:
# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout
TimeoutStartSec=900
TimeoutStopSec=900

# Set the maximium number of tasks (threads) to 99% of what the system can
# handle as set by the kernel, reserve the 1% for a remote ssh connection,
# some monitoring, or that backup cron job. Without the directive this would
# be 15% (see DefaultTasksMax in systemd man pages).
TasksMax=99%

# Controlling how multiple instances are separated. See top of this file.
# Note: This service isn't User=mysql by default so we need to be explicit.
# It is as an option here as a user may want to use the MYSQLD_MULTI_INSTANCE
# to run multiple versions.
Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I'

# While you can override these, you shouldn't leave them empty as that
# will default to root.
User=mysql
Group=mysql

##
## Options previously available to be set via [mysqld_safe]
## that now needs to be set by systemd config files as mysqld_safe
## isn't executed.
##

# Number of files limit. previously [mysqld_safe] open-files-limit
LimitNOFILE=32768

# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=

# Nice priority. previously [mysqld_safe] nice
# Nice=-5

# Timezone. previously [mysqld_safe] timezone
# Environment="TZ=UTC"

# Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
# (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
# Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=

# Flush caches. previously [mysqld_safe] flush-caches=1
# ExecStartPre=sync
# ExecStartPre=sysctl -q -w vm.drop_caches=3

# numa-interleave=1 equalivant
# Change ExecStart=numactl --interleave=all /usr/sbin/mariadbd......

# crash-script equalivent
# FailureAction=
systemd/mariadb-extra@.socket000064400000001007150343472770012300 0ustar00
[Unit]

Description=MariaDB 10.6.22 database server (socket activation extra port multi-instance %I)
Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/

[Socket]

Service=mariadb@%i.service

# An "extra" as a descriptor name that means treat these ListenStreams as
# the same as an extra_port.
# Ref: https://mariadb.com/kb/en/thread-pool-system-status-variables/#extra_port

FileDescriptorName=extra

ListenStream=@mariadb-extra-%I
ListenStream=/var/lib/mysql/mysql.sock-extra-%I

systemd/mariadb@.socket000064400000001104150343472770011155 0ustar00
[Unit]
Description=MariaDB 10.6.22 database server (socket activation multi-instance %I))
Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/

[Socket]

##############################################################################
## USERs can override
##
##
## by creating a file in /etc/systemd/system/mariadb.socket.d/MY_SPECIAL.conf
## and adding/setting the following under [Socket] will override this file's
## settings.

SocketUser=mysql
SocketMode=777

ListenStream=@mariadb-%I
ListenStream=/var/lib/mysql/mysql.sock-%I

# Backlog=150
wsrep_notify000075500000011563150343472770007244 0ustar00#!/bin/sh -eu

# This is a simple example of wsrep notification script (wsrep_notify_cmd).
# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
# and fill them on every membership or node status change.
#
# Edit parameters below to specify the address and login to server:
#
USER='root'
PSWD='rootpass'
#
# If these parameters are not set, then the values
# passed by the server are taken:
#
HOST="127.0.0.1"
PORT=3306
#
# Edit parameters below to specify SSL parameters:
#
ssl_cert=""
ssl_key=""
ssl_ca=""
ssl_capath=""
ssl_cipher=""
ssl_crl=""
ssl_crlpath=""
ssl_verify_server_cert=0
#
# Client executable path:
#
CLIENT="mysql"
#
# Name of schema and tables:
#
SCHEMA="wsrep"
MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status"

WSREP_ON='SET wsrep_on=ON'
WSREP_OFF='SET wsrep_on=OFF'

BEGIN="CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
    idx  INT UNIQUE PRIMARY KEY,
    uuid CHAR(40) UNIQUE, /* node UUID */
    name VARCHAR(32),     /* node name */
    addr VARCHAR(256)     /* node address */
) ENGINE=MEMORY;
CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
    size   INT,      /* component size   */
    idx    INT,      /* this node index  */
    status CHAR(16), /* this node status */
    uuid   CHAR(40), /* cluster UUID */
    prim   BOOLEAN   /* if component is primary */
) ENGINE=MEMORY;
BEGIN"
END="COMMIT; $WSREP_ON"

configuration_change()
{
    echo "$WSREP_OFF; DROP SCHEMA IF EXISTS $SCHEMA; $BEGIN;"

    local idx=0

    for NODE in $(echo "$MEMBERS" | sed s/,/\ /g)
    do
        echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
        # Don't forget to properly quote string values
        echo "'$NODE'" | sed  s/\\//\',\'/g
        echo ");"
        idx=$(( $idx+1 ))
    done

    echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"

    echo "$END;"
}

status_update()
{
    echo "$WSREP_OFF; $BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
}

trim_string()
{
    if [ -n "${BASH_VERSION:-}" ]; then
        local pattern="[![:space:]${2:-}]"
        local x="${1#*$pattern}"
        local z=${#1}
        x=${#x}
        if [ $x -ne $z ]; then
            local y="${1%$pattern*}"
            y=${#y}
            x=$(( z-x-1 ))
            y=$(( y-x+1 ))
            printf '%s' "${1:$x:$y}"
        else
            printf ''
        fi
    else
        local pattern="[[:space:]${2:-}]"
        echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
    fi
}

COM='status_update' # not a configuration change by default

STATUS=""
CLUSTER_UUID=""
PRIMARY=0
INDEX=""
MEMBERS=""

while [ $# -gt 0 ]; do
    case $1 in
    '--status')
        STATUS=$(trim_string "$2")
        shift
        ;;
    '--uuid')
        CLUSTER_UUID=$(trim_string "$2")
        shift
        ;;
    '--primary')
        arg=$(trim_string "$2")
        [ "$arg" = 'yes' ] && PRIMARY=1 || PRIMARY=0
        COM='configuration_change'
        shift
        ;;
    '--index')
        INDEX=$(trim_string "$2")
        shift
        ;;
    '--members')
        MEMBERS=$(trim_string "$2")
        shift
        ;;
    esac
    shift
done

USER=$(trim_string "$USER")
PSWD=$(trim_string "$PSWD")

HOST=$(trim_string "$HOST")
PORT=$(trim_string "$PORT")

case "$HOST" in
\[*)
    HOST="${HOST##\[}"
    HOST=$(trim_string "${HOST%%\]}")
    ;;
esac

if [ -z "$HOST" ]; then
    HOST="${NOTIFY_HOST:-}"
fi
if [ -z "$PORT" ]; then
    PORT="${NOTIFY_PORT:-}"
fi

ssl_key=$(trim_string "$ssl_key");
ssl_cert=$(trim_string "$ssl_cert");
ssl_ca=$(trim_string "$ssl_ca");
ssl_capath=$(trim_string "$ssl_capath");
ssl_cipher=$(trim_string "$ssl_cipher");
ssl_crl=$(trim_string "$ssl_crl");
ssl_crlpath=$(trim_string "$ssl_crlpath");
ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");

SSL_PARAM=""

if [ -n "$ssl_key$ssl_cert$ssl_ca$ssl_capath$ssl_cipher$ssl_crl$ssl_crlpath" ]
then
    SSL_PARAM=' --ssl'
    [ -n "$ssl_key" ]     && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
    [ -n "$ssl_cert" ]    && SSL_PARAM="$SSL_PARAM --ssl-cert='$ssl_cert'"
    [ -n "$ssl_ca" ]      && SSL_PARAM="$SSL_PARAM --ssl-ca='$ssl_ca'"
    [ -n "$ssl_capath" ]  && SSL_PARAM="$SSL_PARAM --ssl-capath='$ssl_capath'"
    [ -n "$ssl_cipher" ]  && SSL_PARAM="$SSL_PARAM --ssl-cipher='$ssl_cipher'"
    [ -n "$ssl_crl" ]     && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
    [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
    if [ -n "$ssl_verify_server_cert" ]; then
        if [ "$ssl_verify_server_cert" != "0" -o \
             "$ssl_verify_server_cert" = "on" ]
        then
            SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
        fi
    fi
fi

case "$STATUS" in
    'joined' | 'donor' | 'synced')
        "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
                      "-h'$HOST'" "-P$PORT"$SSL_PARAM
        ;;
    *)
        # The node might be shutting down or not initialized
        ;;
esac

exit 0
estonian/errmsg.sys000064400000230727150343472770010452 0ustar00��(o�)�=�,,1?BOS*-/;'--24@@1.-B0).$@"&=5%HDD"z-@?+!($##9&-')'&$9G4%CZv* 
15;uK B�VL,`18?6!�/,"'&N'G|v>x%8#&>+)�=UR+3�1%qJBU35(]:F(O@$!03<<Aa-9KMi",8>0&0 "$$a#7DU$9US�iLSq6W4P+EBD8TC4+AE$'"/1T,BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?-8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7)FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�$i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;Io�hashchkisamchkEIJAHEi suuda luua faili '%-.200s' (veakood: %M)Ei suuda luua tabelit %`s.%`s (veakood: %M)Ei suuda luua andmebaasi '%-.192s' (veakood: %M)Ei suuda luua andmebaasi '%-.192s': andmebaas juba eksisteeribEi suuda kustutada andmebaasi '%-.192s': andmebaasi ei eksisteeriViga andmebaasi kustutamisel (ei suuda kustutada faili '%-.192s', veakood: %M)Viga andmebaasi kustutamisel (ei suuda kustutada kataloogi '%-.192s', veakood: %M)Viga '%-.192s' kustutamisel (veakood: %M)Ei suuda lugeda kirjet süsteemsest tabelistEi suuda lugeda '%-.200s' olekut (veakood: %M)Ei suuda identifitseerida jooksvat kataloogi (veakood: %M)Ei suuda lukustada faili (veakood: %M)Ei suuda avada faili '%-.200s' (veakood: %M)Ei suuda leida faili '%-.200s' (veakood: %M)Ei suuda lugeda kataloogi '%-.192s' (veakood: %M)Ei suuda siseneda kataloogi '%-.192s' (veakood: %M)Kirje tabelis '%-.192s' on muutunud viimasest lugemisest saadikKetas täis (%s). Ootame kuni tekib vaba ruumi... (veakood: %M)Ei saa kirjutada, korduv võti tabelis '%-.192s'Viga faili '%-.192s' sulgemisel (veakood: %M)Viga faili '%-.200s' lugemisel (veakood: %M)Viga faili '%-.210s' ümbernimetamisel '%-.210s'-ks (veakood: %M)Viga faili '%-.200s' kirjutamisel (veakood: %M)'%-.192s' on lukustatud muudatuste vastuSorteerimine katkestatudVaade '%-.192s' ei eksisteeri '%-.192s' jaoksGot error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionEi suuda leida kirjet '%-.192s'-sVigane informatsioon failis '%-.200s'Tabeli '%-.200s' võtmefail on vigane; proovi seda parandadaTabeli '%-.192s' võtmefail on aegunud; paranda see!Tabel '%-.192s' on ainult lugemiseksMälu  sai otsa. Proovi MariaDB uuesti käivitada (puudu jäi %d baiti)Mälu sai sorteerimisel otsa. Suurenda MariaDB-i sorteerimispuhvritOotamatu faililõpumärgend faili '%-.192s' lugemisel (veakood: %M)Liiga palju samaaegseid ühendusiMälu sai otsa. Võimalik, et aitab swap-i lisamine või käsu 'ulimit' abil MariaDB-le rohkema mälu kasutamise lubamineEi suuda lahendada IP aadressi masina nimeksVäär handshakeLigipääs keelatud kasutajale '%s'@'%s' andmebaasile '%-.192s'Ligipääs keelatud kasutajale '%s'@'%s' (kasutab parooli: %s)Andmebaasi ei ole valitudTundmatu käskTulp '%-.192s' ei saa omada nullväärtustTundmatu andmebaas '%-.192s'Tabel '%-.192s' juba eksisteeribTundmatu tabel '%-.100T'Väli '%-.192s' %-.192s-s ei ole üheneServeri seiskamine käibTundmatu tulp '%-.192s' '%-.192s'-s'%-.192s' puudub GROUP BY klauslisEi saa grupeerida '%-.192s' järgiLauses on korraga nii tulbad kui summeerimisfunktsioonidTulpade arv erineb väärtuste arvustIdentifikaatori '%-.100T' nimi on liiga pikkKattuv tulba nimi '%-.192s'Kattuv võtme nimi '%-.192s'Kattuv väärtus '%-.192T' võtmele %dVigane tulba kirjeldus tulbale '%-.192s'%s '%-.80T' ligidal real %dTühi päringEi ole unikaalne tabel/alias '%-.192s'Vigane vaikeväärtus '%-.192s' jaoksMitut primaarset võtit ei saa ollaLiiga palju võtmeid. Maksimaalselt võib olla %d võtitVõti koosneb liiga paljudest osadest. Maksimaalselt võib olla %d osaVõti on liiga pikk. Maksimaalne võtmepikkus on %dVõtme tulp '%-.192s' puudub tabelisBLOB column %`s can't be used in key specification in the %s tableTulba '%-.192s' pikkus on liiga pikk (maksimaalne pikkus: %lu). Kasuta BLOB väljatüüpiVigane tabelikirjeldus; Tabelis tohib olla üks auto_increment tüüpi tulp ning see peab olema defineeritud võtmenaCould not delete gtid domain. Reason: %s.%s (%s): MariaDB lõpetas%s: sain signaali %d. Lõpetan!%s: Lõpp%s: Sulgen jõuga lõime %ld  kasutaja: '%-.48s'Ei suuda luua IP socketitTabelil '%-.192s' puuduvad võtmed. Loo tabel uuestiVäljade eraldaja erineb oodatust. Tutvu kasutajajuhendigaBLOB-tüüpi väljade olemasolul ei saa kasutada fikseeritud väljapikkust. Vajalik 'fields terminated by' määrangFail '%-.128s' peab asuma andmebaasi kataloogis või olema kõigile loetavFail '%-.200s' juba eksisteeribKirjeid: %ld  Kustutatud: %ld  Vahele jäetud: %ld  Hoiatusi: %ldKirjeid: %ld  Kattuvaid: %ldVigane võtme osa. Kasutatud võtmeosa ei ole string tüüpi, määratud pikkus on pikem kui võtmeosa või tabelihandler ei toeta seda tüüpi võtmeidALTER TABLE kasutades ei saa kustutada kõiki tulpasid. Kustuta tabel DROP TABLE abilEi suuda kustutada (DROP %s) %`-.192s. Kontrolli kas tulp/võti eksisteeribKirjeid: %ld  Kattuvaid: %ld  Hoiatusi: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataTundmatu lõim: %luEi ole lõime %lld omanikÜhtegi tabelit pole kasutuselLiiga palju string tulbale %-.192s tüübile SETEi suuda luua unikaalset logifaili nime %-.200s.(1-999)Tabel '%-.192s' on lukustatud READ lukuga ning ei ole muudetavTabel '%-.192s' ei ole lukustatud käsuga LOCK TABLESYou should never see itVigane andmebaasi nimi '%-.100T'Vigane tabeli nimi '%-.100s'SELECT lause peab läbi vaatama suure hulga kirjeid ja võtaks tõenäoliselt liiga kaua aega. Tasub kontrollida WHERE klauslit ja vajadusel kasutada käsku SET SQL_BIG_SELECTS=1Tundmatu vigaTundmatu protseduur '%-.192s'Vale parameetrite hulk protseduurile '%-.192s'Vigased parameetrid protseduurile '%-.192s'Tundmatu tabel '%-.192s' %-.32s-sTulp '%-.192s' on määratletud topeltVigane grupeerimisfunktsiooni kasutusTabel '%-.192s' kasutab laiendust, mis ei eksisteeri antud MariaDB versioonisTabelis peab olema vähemalt üks tulpTabel '%-.192s' on täisVigane kooditabel '%-.64s'Liiga palju tabeleid. MariaDB suudab JOINiga ühendada kuni %d tabelitLiiga palju tulpasidLiiga pikk kirje. Kirje maksimumpikkus arvestamata BLOB-tüüpi välju on %ld. Muuda mõned väljad BLOB-tüüpi väljadeksThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededRistsõltuvus OUTER JOIN klauslis. Kontrolli oma ON tingimusiTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerEi suuda avada funktsiooni '%-.192s'Ei suuda algväärtustada funktsiooni '%-.192s'; %-.80sTeegi nimes ei tohi olla kataloogiFunktsioon '%-.192s' juba eksisteeribEi suuda avada jagatud teeki '%-.192s' (veakood: %d, %-.128s)Ei leia funktsiooni '%-.128s' antud teegisFunktsioon '%-.192s' ei ole defineeritudMasin '%-.64s' on blokeeritud hulgaliste ühendusvigade tõttu. Blokeeringu saab tühistada 'mariadb-admin flush-hosts' käsugaMasinal '%-.64s' puudub ligipääs sellele MariaDB serverileTe kasutate MariaDB-i anonüümse kasutajana, kelledel pole parooli muutmise õigustTeiste paroolide muutmiseks on nõutav tabelite muutmisõigus 'mysql' andmebaasisEi leia vastavat kirjet kasutajate tabelisSobinud kirjeid: %ld  Muudetud: %ld  Hoiatusi: %ldEi suuda luua uut lõime (veakood %M). Kui mälu ei ole otsas, on tõenäoliselt tegemist operatsioonisüsteemispetsiifilise veagaTulpade hulk erineb väärtuste hulgast real %luEi suuda taasavada tabelit '%-.192s'NULL väärtuse väärkasutusregexp tagastas vea: %sGROUP tulpade (MIN(),MAX(),COUNT()...) kooskasutamine tavaliste tulpadega ilma GROUP BY klauslita ei ole lubatudSellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s'%-.100T käsk ei ole lubatud kasutajale '%s'@'%s' tabelis %`s.%`s%-.32s käsk ei ole lubatud kasutajale '%s'@'%s' tulbale '%-.192s' tabelis '%-.192s'Vigane GRANT/REVOKE käsk. Tutvu kasutajajuhendigaMasina või kasutaja nimi GRANT lauses on liiga pikkTabelit '%-.192s.%-.192s' ei eksisteeriSellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s' tabelile '%-.192s'Antud käsk ei ole lubatud käesolevas MariaDB versioonisViga SQL süntaksisINSERT DELAYED lõim ei suutnud saada soovitud lukku tabelile %-.192sLiiga palju DELAYED lõimesid kasutuselÜhendus katkestatud %ld andmebaasile: '%-.192s' kasutajale: '%-.48s' (%-.64s)Saabus suurem pakett kui lubatud 'max_allowed_packet' muutujagaViga ühendustoru lugemiselfcntl() tagastas veaPaketid saabusid vales järjekorrasViga andmepaketi lahtipakkimiselViga andmepaketi lugemiselKontrollaja ületamine andmepakettide lugemiselViga andmepaketi kirjutamiselKontrollaja ületamine andmepakettide kirjutamiselTulemus on pikem kui lubatud 'max_allowed_packet' muutujagaValitud tabelitüüp (%s) ei toeta BLOB/TEXT tüüpi väljuValitud tabelitüüp (%s) ei toeta AUTO_INCREMENT tüüpi väljuINSERT DELAYED ei saa kasutada tabeli '%-.192s' peal, kuna see on lukustatud LOCK TABLES käsugaVigane tulba nimi '%-.100s'The storage engine %s can't index column %`sKõik tabelid MERGE tabeli määratluses ei ole identsedEi suuda kirjutada tabelisse '%-.192s', kuna see rikub ühesuse kitsendustBLOB-tüüpi tulp '%-.192s' on kasutusel võtmes ilma pikkust määratlemataKõik PRIMARY KEY peavad olema määratletud NOT NULL piiranguga; vajadusel kasuta UNIQUE tüüpi võtitTulemis oli rohkem kui üks kirjeAntud tabelitüüp nõuab primaarset võtitAntud MariaDB versioon on kompileeritud ilma RAID toetaKatse muuta tabelit turvalises rezhiimis ilma WHERE klauslitaVõti '%-.192s' ei eksisteeri tabelis '%-.192s'Ei suuda avada tabelitAntud tabelitüüp ei toeta %s käskeSeda käsku ei saa kasutada transaktsiooni seesViga %M käsu COMMIT täitmiselViga %M käsu ROLLBACK täitmiselViga %M käsu FLUSH_LOGS täitmiselViga %M käsu CHECKPOINT täitmiselÜhendus katkestatud %lld andmebaas: '%-.192s' kasutaja: '%-.48s' masin: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterEi suutnud leida FULLTEXT indeksit, mis kattuks kasutatud tulpadegaEi suuda täita antud käsku kuna on aktiivseid lukke või käimasolev transaktsioonTundmatu süsteemne muutuja '%-.*s'Tabel '%-.192s' on märgitud vigaseks ja tuleb parandadaTabel '%-.192s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestusHoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi keridaMitme lausendiga transaktsioon nõudis rohkem ruumi kui lubatud 'max_binlog_cache_size' muutujaga. Suurenda muutuja väärtust ja proovi uuestiThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesKasutajal %-.64s on juba rohkem ühendusi kui lubatud 'max_user_connections' muutujagaAinult konstantsed suurused on lubatud SET klauslisKontrollaeg ületatud luku järel ootamisel; Proovi transaktsiooni otsast alataLukkude koguarv ületab lukutabeli suuruseUuenduslukke ei saa kasutada READ UNCOMMITTED transaktsiooni käigusDROP DATABASE ei ole lubatud kui lõim omab globaalset READ lukkuCREATE DATABASE ei ole lubatud kui lõim omab globaalset READ lukkuVigased parameetrid %s-leKasutajal '%s'@'%s' ei ole lubatud luua uusi kasutajaidVigane tabelimääratlus; kõik MERGE tabeli liikmed peavad asuma samas andmebaasisLukustamisel tekkis tupik (deadlock); alusta transaktsiooni otsastAntud tabelitüüp (%s) ei toeta FULLTEXT indekseidCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sViga käsu %s täitmisel: %-.128sVigane %s ja %s kasutusTulpade arv kasutatud SELECT lausetes ei kattuEi suuda täita päringut konfliktse luku tõttuTransaktsioone toetavate ning mittetoetavate tabelite kooskasutamine ei ole lubatudMäärangut '%s' on lauses kasutatud topeltUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionKattuv väärtus '%-.64T' võtmele '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTLigipääs keelatud kasutajale '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionKattuv väärtus võtmele '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledswedish/errmsg.sys000064400000231643150343472770010276 0ustar00���)o��=�,-0$:FR-%D3#))6*?M82/?2$+*@C/'YE;*3GL%)" )70%()!*#'<D9"CUP*0_GOT :nMY+S#44H0 �1+#"+L"$L|~;�$55!J>)�M`]+-&=.pM8L$;3c>9;O:6 (*)+)+5BG]-;3;o#'6{055e#7,,.T@NUq�]oh,I0@1DCE7WT69,--8'!+7O#BBNI.2+3!5HC!3=$#6,'#0&=t4:oa-LN.*&A/CG-T��XG�=!L9oR9`M5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%wH_IZTD6@BH`.K<a+ALH<GKNCp8>H/G%'R?l{?+?B<"@M�B=4"(/6MX38}< +(= ,)@W?$�`L.D1DPi?04)D4%02�C>>?'8|�80X)%,6%45-&1Z)/"@I+1%#3>n'l4422m


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B$=5FLH<��WkT;B54������
�V/b8Eh:?;G,"-�aH=JM�>78>?R5��6F��x_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`>-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ8A-%)Q)(-)PP;I��hashchkisamchkNOYESKan inte skapa filen '%-.200s' (Felkod: %M)Kan inte skapa tabellen %`s.%`s (Felkod: %M)Kan inte skapa databasen '%-.192s' (Felkod: %M)Databasen '%-.192s' existerar redanKan inte radera databasen '%-.192s'; databasen finns inteFel vid radering av databasen (Kan inte radera '%-.192s'. Felkod: %M)Fel vid radering av databasen (Kan inte radera biblioteket '%-.192s'. Felkod: %M)Kan inte radera filen '%-.192s' (Felkod: %M)Hittar inte posten i systemregistretKan inte läsa filinformationen (stat) från '%-.200s' (Felkod: %M)Kan inte inte läsa aktivt bibliotek. (Felkod: %M)Kan inte låsa filen. (Felkod: %M)Kan inte använda '%-.200s' (Felkod: %M)Hittar inte filen '%-.200s' (Felkod: %M)Kan inte läsa från bibliotek '%-.192s' (Felkod: %M)Kan inte byta till '%-.192s' (Felkod: %M)Posten har förändrats sedan den lästes i register '%-.192s'Disken är full (%s). Väntar tills det finns ledigt utrymme... (Felkod: %M)Kan inte skriva, dubbel söknyckel i register '%-.192s'Fick fel vid stängning av '%-.192s' (Felkod: %M)Fick fel vid läsning av '%-.200s' (Felkod %M)Kan inte byta namn från '%-.210s' till '%-.210s' (Felkod: %M)Fick fel vid skrivning till '%-.200s' (Felkod %M)'%-.192s' är låst mot användningSorteringen avbrutenFormulär '%-.192s' finns inte i '%-.192s'Fick felkod %M från databashanteraren %sStorage engine %s of the table %`s.%`s doesn't have this optionHittar inte posten '%-.192s'Felaktig fil: '%-.200s'Fatalt fel vid hantering av register '%-.200s'; kör en reparationGammal nyckelfil '%-.192s'; reparera registret'%-.192s' är skyddad mot förändringOväntat slut på minnet, starta om programmet och försök på nytt (Behövde %d bytes)Sorteringsbufferten räcker inte till. Kontrollera startparametrarnaOväntat filslut vid läsning från '%-.192s' (Felkod: %M)För många anslutningarFick slut på minnet.Kan inte hitta 'hostname' för din adressFel vid initiering av kommunikationen med klientenAnvändare '%s'@'%s' är ej berättigad att använda databasen %-.192sAnvändare '%s'@'%s' är ej berättigad att logga in (Använder lösen: %s)Ingen databas i användningOkänt kommandoKolumn '%-.192s' får inte vara NULLOkänd databas: '%-.192s'Tabellen '%-.192s' finns redanOkänd tabell '%-.100T'Kolumn '%-.192s' i %-.192s är inte unikServern går nu nedOkänd kolumn '%-.192s' i %-.192s'%-.192s' finns inte i GROUP BYKan inte använda GROUP BY med '%-.192s'Kommandot har både sum functions och enkla funktionerAntalet kolumner motsvarar inte antalet värdenKolumnnamn '%-.100T' är för långtKolumnnamn '%-.192s finns flera gångerNyckelnamn '%-.192s' finns flera gångerDublett '%-.192T' för nyckel %dFelaktigt kolumntyp för kolumn '%-.192s'%s nära '%-.80T' på rad %dFrågan var tomIcke unikt tabell/alias: '%-.192s'Ogiltigt DEFAULT värde för '%-.192s'Flera PRIMARY KEY användaFör många nycklar använda. Man får ha högst %d nycklarFör många nyckeldelar använda. Man får ha högst %d nyckeldelarFör lång nyckel. Högsta tillåtna nyckellängd är %dNyckelkolumn '%-.192s' finns inteBLOB column %`s can't be used in key specification in the %s tableFör stor kolumnlängd angiven för '%-.192s' (max= %lu). Använd en BLOB inställetDet får finnas endast ett AUTO_INCREMENT-fält och detta måste vara en nyckelCould not delete gtid domain. Reason: %s.%s (%s): Normal avslutning%s: Fick signal %d. Avslutar!%s: Avslutning klar%s: Stänger av tråd %ld; användare: '%-.48s'Kan inte skapa IP-socketTabellen '%-.192s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellenFältseparatorerna är vad som förväntades. Kontrollera mot manualenMan kan inte använda fast radlängd med blobs. Använd 'fields terminated by'Textfilen '%-.128s' måste finnas i databasbiblioteket eller vara läsbar för allaFilen '%-.200s' existerar redanRader: %ld  Bortagna: %ld  Dubletter: %ld  Varningar: %ldRader: %ld  Dubletter: %ldFelaktig delnyckel. Nyckeldelen är inte en sträng eller den angivna längden är längre än kolumnlängdenMan kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE iställetKan inte ta bort (DROP %s) %`-.192s. Kontrollera att begränsningen/fältet/nyckel finnsRader: %ld  Dubletter: %ld  Varningar: %ldTable '%-.192s' är använd två gånger. Både för '%s' och för att hämta dataFinns ingen tråd med id %luDu är inte ägare till tråd %lldInga tabeller angivnaFör många alternativ till kolumn %-.192s för SETKan inte generera ett unikt filnamn %-.200s.(1-999)Tabell '%-.192s' kan inte uppdateras emedan den är låst för läsningTabell '%-.192s' är inte låst med LOCK TABLESYou should never see itFelaktigt databasnamn '%-.100T'Felaktigt tabellnamn '%-.100s'Den angivna frågan skulle läsa mer än MAX_JOIN_SIZE rader.  Kontrollera din WHERE och använd SET SQL_BIG_SELECTS=1 eller SET MAX_JOIN_SIZE=# ifall du vill hantera stora joinsOkänt felOkänd procedur: %-.192sFelaktigt antal parametrar till procedur %-.192sFelaktiga parametrar till procedur %-.192sOkänd tabell '%-.192s' i '%-.32s'Fält '%-.192s' är redan använtFelaktig användning av SQL grupp functionTabell '%-.192s' har en extension som inte finns i denna version av MariaDBTabeller måste ha minst 1 kolumnTabellen '%-.192s' är fullOkänd teckenuppsättning: '%-.64s'För många tabeller. MariaDB can ha högst %d tabeller i en och samma joinFör många fältFör stor total radlängd. Den högst tillåtna radlängden, förutom BLOBs, är %ld. Ändra några av dina fält till BLOBTrådstacken tog slut:  Har använt %ld av %ld bytes.  Använd 'mariadbd --thread_stack=#' ifall du behöver en större stackFelaktigt referens i OUTER JOIN.  Kontrollera ON-uttrycketTabell hanteraren kan inte indexera NULL kolumner för den givna index typen. Ändra '%-.192s' till NOT NULL eller använd en annan hanterareKan inte ladda funktionen '%-.192s'Kan inte initialisera funktionen '%-.192s'; '%-.80s'Man får inte ange sökväg för dynamiska bibliotekFunktionen '%-.192s' finns redanKan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d, %-.128s)Hittar inte funktionen '%-.128s' in det dynamiska biblioteketFunktionen '%-.192s' är inte definieradDenna dator, '%-.64s', är blockerad pga många felaktig paket. Gör 'mariadb-admin flush-hosts' för att ta bort alla blockeringarnaDenna dator, '%-.64s', har inte privileger att använda denna MariaDB serverDu använder MariaDB som en anonym användare och som sådan får du inte ändra ditt lösenordFör att ändra lösenord för andra måste du ha rättigheter att uppdatera mysql-databasenHittade inte användaren i 'user'-tabellenRader: %ld  Uppdaterade: %ld  Varningar: %ldKan inte skapa en ny tråd (errno %M)Antalet kolumner motsvarar inte antalet värden på rad: %luKunde inte stänga och öppna tabell '%-.192sFelaktig använding av NULLFick fel '%s' från REGEXPMan får ha både GROUP-kolumner (MIN(),MAX(),COUNT()...) och fält i en fråga om man inte har en GROUP BY-delDet finns inget privilegium definierat för användare '%-.48s' på '%-.64s'%-.100T ej tillåtet för '%s'@'%s' för tabell %`s.%`s%-.32s ej tillåtet för '%s'@'%s' för kolumn '%-.192s' i tabell '%-.192s'Felaktigt GRANT-privilegium använtFelaktigt maskinnamn eller användarnamn använt med GRANTDet finns ingen tabell som heter '%-.192s.%-.192s'Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s' för tabell '%-.192s'Du kan inte använda detta kommando med denna MariaDB versionDu har något fel i din syntaxDELAYED INSERT-tråden kunde inte låsa tabell '%-.192s'Det finns redan 'max_delayed_threads' trådar i användingAvbröt länken för tråd %ld till db '%-.192s', användare '%-.48s' (%-.64s)Kommunkationspaketet är större än 'max_allowed_packet'Fick läsfel från klienten vid läsning från 'PIPE'Fick fatalt fel från 'fcntl()'Kommunikationspaketen kom i fel ordningKunde inte packa up kommunikationspaketetFick ett fel vid läsning från klientenFick 'timeout' vid läsning från klientenFick ett fel vid skrivning till klientenFick 'timeout' vid skrivning till klientenResultatsträngen är längre än max_allowed_packetDen använda tabelltypen (%s) kan inte hantera BLOB/TEXT-kolumnerDen använda tabelltypen (%s) kan inte hantera AUTO_INCREMENT-kolumnerINSERT DELAYED kan inte användas med tabell '%-.192s', emedan den är låst med LOCK TABLESFelaktigt kolumnnamn '%-.100s'The storage engine %s can't index column %`sTabellerna i MERGE-tabellen är inte identiskt definieradeKan inte skriva till tabell '%-.192s'; UNIQUE-testDu har inte angett någon nyckellängd för BLOB '%-.192s'Alla delar av en PRIMARY KEY måste vara NOT NULL;  Om du vill ha en nyckel med NULL, använd UNIQUE iställetResultet bestod av mera än en radDenna tabelltyp kräver en PRIMARY KEYDenna version av MariaDB är inte kompilerad med RAIDDu använder 'säker uppdateringsmod' och försökte uppdatera en tabell utan en WHERE-sats som använder sig av en nyckelNyckel '%-.192s' finns inte in tabell '%-.192s'Kan inte öppna tabellenTabellhanteraren för denna tabell kan inte göra %sDu får inte utföra detta kommando i en transaktionFick fel %M vid COMMITFick fel %M vid ROLLBACKFick fel %M vid FLUSH_LOGSFick fel %M vid CHECKPOINTAvbröt länken för tråd %lld till db '%-.192s', användare '%-.48s', host '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Fel från master: '%-.64s'Fick nätverksfel vid läsning från masterFick nätverksfel vid skrivning till masterHittar inte ett FULLTEXT-index i kolumnlistanKan inte utföra kommandot emedan du har en låst tabell eller an aktiv transaktionOkänd systemvariabel: '%-.*s'Tabell '%-.192s' är trasig och bör repareras med REPAIR TABLETabell '%-.192s' är trasig och senast (automatiska?) reparation misslyckadesWarning:  Några icke transaktionella tabeller kunde inte återställas vid ROLLBACKTransaktionen krävde mera än 'max_binlog_cache_size' minne. Öka denna mariadbd-variabel och försök på nyttDenna operation kan inte göras under replikering; Du har en aktiv förbindelse till '%2$*1$s'. Gör STOP SLAVE '%2$*1$s' förstDenna operation kan endast göras under replikering; Konfigurera slaven och gör START SLAVEServern är inte konfigurerade som en replikationsslav. Ändra konfigurationsfilen eller gör CHANGE MASTER TOKunde inte initialisera replikationsstrukturerna för '%.*s'. See MariaDB fel fil för mera informationKunde inte starta en tråd för replikeringAnvändare '%-.64s' har redan 'max_user_connections' aktiva inloggningarMan kan endast använda konstantuttryck med SETFick inte ett lås i tid ; Försök att starta om transaktionenAntal lås överskrider antalet reserverade låsUpdateringslås kan inte göras när man använder READ UNCOMMITTEDDROP DATABASE är inte tillåtet när man har ett globalt läslåsCREATE DATABASE är inte tillåtet när man har ett globalt läslåsFelaktiga argument till %s'%s'@'%s' har inte rättighet att skapa nya användareFelaktig tabelldefinition; alla tabeller i en MERGE-tabell måste vara i samma databasFick 'DEADLOCK' vid låsförsök av block/rad. Försök att starta om transaktionenTabelltypen (%s) har inte hantering av FULLTEXT-indexKan inte lägga till 'FOREIGN KEY constraint' för `%s`'FOREIGN KEY-konflikt:  Kan inte skriva barnFOREIGN KEY-konflikt:  Kan inte radera faderFick fel vid anslutning till master: %-.128sFick fel vid utförande av command på mastern: %-.128sFick fel vid utförande av %s: %-.128sFelaktig använding av %s and %sSELECT-kommandona har olika antal kolumnerKan inte utföra kommandot emedan du har ett READ-låsBlandning av transaktionella och icke-transaktionella tabeller är inaktiveratOption '%s' användes två gångerAnvändare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)Du har inte privlegiet '%-.128s' som behövs för denna operationVariabel '%-.64s' är en SESSION variabel och kan inte ändrad med SET GLOBALVariabel '%-.64s' är en GLOBAL variabel och bör sättas med SET GLOBALVariabel '%-.64s' har inte ett DEFAULT-värdeVariabel '%-.64s' kan inte sättas till '%-.200T'Fel typ av argument till variabel '%-.64s'Variabeln '%-.64s' kan endast sättas, inte läsasFel använding/placering av '%s'Denna version av MariaDB kan ännu inte utföra '%s'Fick fatalt fel %d: '%-.320s' från master vid läsning av binärloggenSlav SQL tråden ignorerade frågan pga en replicate-*-table regelVariabel '%-.192s' är av typ %sFelaktig FOREIGN KEY-definition för '%-.192s': %sNyckelreferensen och tabellreferensen stämmer inte överensOperand should contain %d column(s)Subquery returnerade mer än 1 radOkänd PREPARED STATEMENT id (%.*s) var given till %sHjälpdatabasen finns inte eller är skadadCyklisk referens i subqueriesKonvertar kolumn '%s' från %s till %sReferens '%-.64s' stöds inte (%s)Varje 'derived table' måste ha sitt eget aliasSelect %u reducerades vid optimieringTabell '%-.192s' från en SELECT kan inte användas i %-.32sKlienten stöder inte autentiseringsprotokollet som begärts av servern; överväg uppgradering av klientprogrammetAlla delar av en SPATIAL index måste vara NOT NULLCOLLATION '%s' är inte tillåtet för CHARACTER SET '%s'Slaven har redan startatSlaven har redan stoppatUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luAnvänder handler %s för tabell '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredFelaktigt index namn '%-.100s'Felaktigt katalog namn '%-.100s'Storleken av "Query cache" kunde inte sättas till %llu, ny storlek är %luKolumn '%-.192s' kan inte vara del av ett FULLTEXT indexOkänd nyckel cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadTabell %-.100s använd med '%s' är inte uppdateringsbar'%s' är inte aktiverad; För att aktivera detta måste du bygga om MariaDB med '%s' definieradMariaDB är startad med %s. Pga av detta kan du inte använda detta kommandoColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYDet gick inte att skapa främmande server '%s' eftersom den redan finnsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntaxfel: %-.64s PARTITIONering kräver definition av VALUES %-.64s för varje partitionEndast %-.64s partitionering kan använda VALUES %-.64s i definition av partitionenMAXVALUE kan bara användas i definitionen av den sista partitionenSubpartitioner kan bara vara hash och key partitionerSubpartitioner måste definieras på alla partitioner om på enAntal partitioner definierade och antal partitioner är inte likaAntal subpartitioner definierade och antal subpartitioner är inte likaKonstanta uttryck eller slumpmässiga uttryck är inte tillåtna (sub)partitioneringsfunktionerUttryck i %s måste vara ett konstant uttryckFält i listan av fält för partitionering med key inte funnen i tabellenEn lista av fält är endast tillåtet för KEY partitionerPartitioneringsinformationen i frm-filen är inte konsistent med vad som kan skrivas i frm-filen%-.192s-funktionen returnerar felaktig typFör %-.64s partitionering så måste varje partition definierasVärden i VALUES LESS THAN måste vara strikt växande för varje partitionVärden i VALUES måste vara av samma typ som partitioneringsfunktionenMultipel definition av samma konstant i list partitioneringPartitioneringssyntax kan inte användas på egen hand i en SQL-frågaDenna mix av lagringsmotorer är inte tillåten i denna version av MariaDBFör partitioneringsmotorn så är det nödvändigt att definiera alla %-.64sFör många partitioner (inkluderande subpartitioner) definieradesDet är endast möjligt att blanda RANGE/LIST partitionering med HASH/KEY partitionering för subpartitioneringMisslyckades med att skapa specifik fil i lagringsmotorEtt BLOB-fält är inte tillåtet i partitioneringsfunktionerA %-.192s must include all columns in the table's partitioning functionAntal %-.64s = 0 är inte ett tillåten värdePartitioneringskommando på en opartitionerad tabell är inte möjligtPartitioned tables do not support %sFel i listan av partitioner att %-.64sDet är inte tillåtet att ta bort alla partitioner, använd DROP TABLE iställetCOALESCE PARTITION kan bara användas på HASH/KEY partitionerREORGANIZE PARTITION kan bara användas för att omorganisera partitioner, inte för att ändra deras antalREORGANIZE PARTITION utan parametrar kan bara användas på auto-partitionerade tabeller som använder HASH partitionering%-.64s PARTITION kan bara användas på RANGE/LIST-partitionerADD PARTITION med fel antal subpartitionerÅtminstone en partition måste läggas till vid ADD PARTITIONÅtminstone en partition måste slås ihop vid COALESCE PARTITIONFler partitioner att reorganisera än det finns partitionerDuplicerat partitionsnamn %-.192sDet är inte tillåtet att stänga av binlog på detta kommandoNär ett antal partitioner omorganiseras måste de vara i konsekutiv ordningReorganisering av rangepartitioner kan inte ändra den totala intervallet utom för den sista partitionen där intervallet kan utökasPartition function not supported in this version for this handlerPartition state kan inte definieras från CREATE/ALTER TABLE%-.64s stödjer endast 32 bitar i integers i VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartitionskonstanten är utanför partitioneringsfunktionens domänDenna partitioneringsfunktion är inte tillåtenError in DDL logDet är inte tillåtet att använda NULL-värden i VALUES LESS THANFelaktigt partitionsnamnTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine inte användas i en partitionerad tabellCannot activate '%-.64s' logThe server was not built with row-based replicationAvkodning av base64 sträng misslyckadesRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDublett '%-.64T' för nyckel '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesDetta är inte säkert att logga i statement-format, för BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabasTabellPartitionSubpartitionTemporärNamnändradToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerMisslyckades läsa från .par filenVärden i VALUES för partition '%-.64s' måste ha typen INTAnvändare '%s'@'%s' är ej berättigad att logga inSET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Attributet '%-.64s' är olika mellan partition och tabellTabellen att byta ut mot partition är partitionerad: '%-.64s'Tabellen att byta ut mot partition är temporär: '%-.64s'Subpartitionerad tabell, använd subpartition istället för partitionOkänd partition '%-.64s' i tabell '%-.64s'Tabellerna har olika definitionerHittade en rad som inte passar i partitionenOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Tabellen att byta ut mot partition har foreign key referenser: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () klausul för en icke partitionerad tabellHittade en rad som inte passar i någon given partitionYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index stöds ej för partitionerade tabellerInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesFOREIGN KEY constraint för tabell '%.192s', posten '%-.192s' kan inte uppdatera barntabell '%.192s' på grund av nyckel '%.192s'FOREIGN KEY constraint för tabell '%.192s', posten '%-.192s' kan inte uppdatera en barntabell på grund av UNIQUE-testSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDublett för nyckel '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsHittade en rad i fel partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteDet finns ingen tabell som heter '%-.192s.%-.192s' i handlernTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlav SQL tråden ignorerade '%s' pga tabellen är deladAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledjapanese/errmsg.sys000064400000245661150343472770010423 0ustar00���Ao��=�H3Nic]p@:DI@NHNNZ;N<FPF,(;$@56ma-~�xW<\?4-2-#015:5C.-*03*<51>JG0C�o*%E G*uyo�6B"�f-2`#:%BKIC3$�2HE11.^2!,L	�^x08=9`E3�`i�O/�>3-/vQn�xN/nJ�^2dK1)7::C:CG49j$-�KO�Kfo>%LL2466_B,FCM|0?Va�i���jt"m%4ik-x|73@C+4+24ag8Z|ZZ>=2P3Ppj(.:28pF70,(;Y�GB+1��.Elx.CJO/sU:| ���X�i'-A?5�6dOq�SD�1E:@)2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

AOM%wK_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?98|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7!FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�0i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkNOYESファイル '%-.200s' を作成できません。(エラー番号: %M)%`s.%`s テーブルが作れません.(errno: %M)データベース '%-.192s' を作成できません。(エラー番号: %M)データベース '%-.192s' を作成できません。データベースはすでに存在します。データベース '%-.192s' を削除できません。データベースは存在しません。データベース削除エラー ('%-.192s' を削除できません。エラー番号: %M)データベース削除エラー (ディレクトリ '%-.192s' を削除できません。エラー番号: %M)ファイル '%-.192s' の削除エラー (エラー番号: %M)システム表のレコードを読み込めません。'%-.200s' の状態を取得できません。(エラー番号: %M)作業ディレクトリを取得できません。(エラー番号: %M)ファイルをロックできません。(エラー番号: %M)ファイル '%-.200s' をオープンできません。(エラー番号: %M)ファイル '%-.200s' が見つかりません。(エラー番号: %M)ディレクトリ '%-.192s' を読み込めません。(エラー番号: %M)ディレクトリ '%-.192s' に移動できません。(エラー番号: %M)表 '%-.192s' の最後の読み込み時点から、レコードが変化しました。ディスク領域不足です(%s)。(エラー番号: %M)書き込めません。表 '%-.192s' に重複するキーがあります。'%-.192s' のクローズ時エラー (エラー番号: %M)ファイル '%-.200s' の読み込みエラー (エラー番号: %M)'%-.210s' の名前を '%-.210s' に変更できません (エラー番号: %M)ファイル '%-.200s' の書き込みエラー (エラー番号: %M)'%-.192s' はロックされています。ソート処理を中断しました。ビュー '%-.192s' は '%-.192s' に存在しません。Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this option'%-.192s' にレコードが見つかりません。ファイル '%-.200s' 内の情報が不正です。表 '%-.200s' の索引ファイル(key file)の内容が不正です。修復を試行してください。表 '%-.192s' の索引ファイル(key file)は古い形式です。修復してください。表 '%-.192s' は読み込み専用です。メモリが不足しています。サーバーを再起動してみてください。(%d バイトの割り当てに失敗)ソートメモリが不足しています。ソートバッファサイズ(sort buffer size)の増加を検討してください。ファイル '%-.192s' を読み込み中に予期せずファイルの終端に達しました。(エラー番号: %M)接続が多すぎます。メモリが不足しています。mariadbd やその他のプロセスがメモリーを使い切っていないか確認して下さい。メモリーを使い切っていない場合、'ulimit'の設定等で mariadbd のメモリー使用最大量を多くするか、スワップ領域を増やす必要があるかもしれません。IPアドレスからホスト名を解決できません。ハンドシェイクエラーユーザー '%s'@'%s' の '%-.192s' データベースへのアクセスを拒否しますユーザー '%s'@'%s' を拒否します.uUsing password: %s)データベースが選択されていません。不明なコマンドです。列 '%-.192s' は null にできません。'%-.192s' は不明なデータベースです。表 '%-.192s' はすでに存在します。'%-.100T' は不明な表です。列 '%-.192s' は %-.192s 内で曖昧です。サーバーをシャットダウン中です。列 '%-.192s' は '%-.192s' にはありません。'%-.192s' はGROUP BY句で指定されていません。'%-.192s' でのグループ化はできません。集計関数と通常の列が同時に指定されています。列数が値の個数と一致しません。識別子名 '%-.100T' は長すぎます。列名 '%-.192s' は重複してます。索引名 '%-.192s' は重複しています。'%-.192T' は索引 %d で重複しています。列 '%-.192s' の定義が不正です。%s : '%-.80T' 付近 %d 行目クエリが空です。表名/別名 '%-.192s' は一意ではありません。'%-.192s' へのデフォルト値が無効です。PRIMARY KEY が複数定義されています。索引の数が多すぎます。最大 %d 個までです。索引のキー列指定が多すぎます。最大 %d 個までです。索引のキーが長すぎます。最大 %d バイトまでです。キー列 '%-.192s' は表にありません。BLOB column %`s can't be used in key specification in the %s table列 '%-.192s' のサイズ定義が大きすぎます (最大 %lu まで)。代わりに BLOB または TEXT を使用してください。不正な表定義です。AUTO_INCREMENT列は1個までで、索引を定義する必要があります。Could not delete gtid domain. Reason: %s.%s (%s): 通常シャットダウン%s: シグナル %d を受信しました。強制終了します!%s: シャットダウン完了%s: スレッド %ld を強制終了します (ユーザー: '%-.48s')IPソケットを作成できません。表 '%-.192s' に以前CREATE INDEXで作成された索引がありません。表を作り直してください。フィールド区切り文字が予期せぬ使われ方をしています。マニュアルを確認して下さい。BLOBには固定長レコードが使用できません。'FIELDS TERMINATED BY'句を使用して下さい。ファイル '%-.128s' はデータベースディレクトリにあるか、全てのユーザーから読める必要があります。ファイル '%-.200s' はすでに存在します。レコード数: %ld  削除: %ld  スキップ: %ld  警告: %ldレコード数: %ld  重複: %ldキーのプレフィックスが不正です。キーが文字列ではないか、プレフィックス長がキーよりも長いか、ストレージエンジンが一意索引のプレフィックス指定をサポートしていません。ALTER TABLE では全ての列の削除はできません。DROP TABLE を使用してください。Can't DROP %s %`-.192s; check that it existsレコード数: %ld  重複数: %ld  警告: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for data不明なスレッドIDです: %luスレッド %lld のオーナーではありません。表が指定されていません。SET型の列 '%-.192s' のメンバーの数が多すぎます。一意なログファイル名 %-.200s.(1-999) を生成できません。表 '%-.192s' はREADロックされていて、更新できません。表 '%-.192s' は LOCK TABLES でロックされていません。You should never see itデータベース名 '%-.100T' は不正です。表名 '%-.100s' は不正です。SELECTがMAX_JOIN_SIZEを超える行数を処理しました。WHERE句を確認し、SELECT文に問題がなければ、 SET SQL_BIG_SELECTS=1 または SET MAX_JOIN_SIZE=# を使用して下さい。不明なエラー'%-.192s' は不明なプロシージャです。プロシージャ '%-.192s' へのパラメータ数が不正です。プロシージャ '%-.192s' へのパラメータが不正です。'%-.192s' は %-.32s では不明な表です。列 '%-.192s' は2回指定されています。集計関数の使用方法が不正です。表 '%-.192s' は、このMariaDBバージョンには無い機能を使用しています。表には最低でも1個の列が必要です。表 '%-.192s' は満杯です。不明な文字コードセット: '%-.64s'表が多すぎます。MariaDBがJOINできる表は %d 個までです。列が多すぎます。行サイズが大きすぎます。この表の最大行サイズは BLOB を含まずに %ld です。格納時のオーバーヘッドも含まれます(マニュアルを確認してください)。列をTEXTまたはBLOBに変更する必要があります。スレッドスタック不足です(使用: %ld ; サイズ: %ld)。必要に応じて、より大きい値で 'mariadbd --thread_stack=#' の指定をしてください。OUTER JOINに相互依存が見つかりました。ON句の条件を確認して下さい。Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler関数 '%-.192s' をロードできません。関数 '%-.192s' を初期化できません。; %-.80s共有ライブラリにはパスを指定できません。関数 '%-.192s' はすでに定義されています。共有ライブラリ '%-.192s' を開く事ができません。(エラー番号: %d, %-.128s)関数 '%-.128s' は共有ライブラリー中にありません。関数 '%-.192s' は定義されていません。接続エラーが多いため、ホスト '%-.64s' は拒否されました。'mariadb-admin flush-hosts' で解除できます。ホスト '%-.64s' からのこの MariaDB server への接続は許可されていません。MariaDB を匿名ユーザーで使用しているので、パスワードの変更はできません。他のユーザーのパスワードを変更するためには、mysqlデータベースの表を更新する権限が必要です。ユーザーテーブルに該当するレコードが見つかりません。該当した行: %ld  変更: %ld  警告: %ld新規にスレッドを作成できません。(エラー番号 %M) もしも使用可能メモリーの不足でなければ、OS依存のバグである可能性があります。%lu 行目で、列の数が値の数と一致しません。表を再オープンできません。: '%-.192s'NULL 値の使用方法が不適切です。regexp がエラー '%s' を返しました。GROUP BY句が無い場合、集計関数(MIN(),MAX(),COUNT(),...)と通常の列を同時に使用できません。ユーザー '%-.48s' (ホスト '%-.64s' 上) は許可されていません。コマンド %-.100T は ユーザー '%s'@'%s' ,テーブル %`s.%`s に対して許可されていませんコマンド %-.32s は ユーザー '%s'@'%s'
 カラム '%-.192s' テーブル '%-.192s' に対して許可されていません不正な GRANT/REVOKE コマンドです。どの権限で利用可能かはマニュアルを参照して下さい。GRANTコマンドへの、ホスト名やユーザー名が長すぎます。表 '%-.192s.%-.192s' は存在しません。ユーザー '%-.48s' (ホスト '%-.64s' 上) の表 '%-.192s' への権限は定義されていません。このMariaDBバージョンでは利用できないコマンドです。SQL構文エラーです。バージョンに対応するマニュアルを参照して正しい構文を確認してください。'Delayed insert'スレッドが表 '%-.192s' のロックを取得できませんでした。'Delayed insert'スレッドが多すぎます。接続 %ld が中断されました。データベース: '%-.192s' ユーザー: '%-.48s' (%-.64s)'max_allowed_packet'よりも大きなパケットを受信しました。接続パイプの読み込みエラーです。fcntl()がエラーを返しました。不正な順序のパケットを受信しました。圧縮パケットの展開ができませんでした。パケットの受信でエラーが発生しました。パケットの受信でタイムアウトが発生しました。パケットの送信でエラーが発生しました。パケットの送信でタイムアウトが発生しました。結果の文字列が 'max_allowed_packet' よりも大きいです。Storage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columns表 '%-.192s' はLOCK TABLESでロックされているため、INSERT DELAYEDを使用できません。列名 '%-.100s' は不正です。The storage engine %s can't index column %`sMERGE表の構成表がオープンできません。列定義が異なるか、MyISAM表ではないか、存在しません。一意性制約違反のため、表 '%-.192s' に書き込めません。BLOB列 '%-.192s' をキーに使用するには長さ指定が必要です。PRIMARY KEYの列は全てNOT NULLでなければいけません。UNIQUE索引であればNULLを含むことが可能です。結果が2行以上です。使用のストレージエンジンでは、PRIMARY KEYが必要です。このバージョンのMariaDBはRAIDサポートを含めてコンパイルされていません。'safe update mode'で、索引を利用するWHERE句の無い更新処理を実行しようとしました。索引 '%-.192s' は表 '%-.192s' には存在しません。表をオープンできません。この表のストレージエンジンは '%s' を利用できません。このコマンドはトランザクション内で実行できません。COMMIT中にエラー %M が発生しました。ROLLBACK中にエラー %M が発生しました。FLUSH_LOGS中にエラー %M が発生しました。CHECKPOINT中にエラー %M が発生しました。接続 %lld が中断されました。データベース: '%-.192s' ユーザー: '%-.48s' ホスト: '%-.64s'%-.64s (%-.64s)You should never see itバイナリログがクローズされています。RESET MASTER を実行できません。ダンプ表 '%-.192s' の索引再構築に失敗しました。マスターでエラーが発生: '%-.64s'マスターからのデータ受信中のネットワークエラーマスターへのデータ送信中のネットワークエラー列リストに対応する全文索引(FULLTEXT)が見つかりません。すでにアクティブな表ロックやトランザクションがあるため、コマンドを実行できません。'%-.*s' は不明なシステム変数です。表 '%-.192s' は壊れています。修復が必要です。表 '%-.192s' は壊れています。修復(自動?)にも失敗しています。トランザクション対応ではない表への変更はロールバックされません。複数ステートメントから成るトランザクションが 'max_binlog_cache_size' 以上の容量を必要としました。このシステム変数を増加して、再試行してください。This operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstこの処理は、稼働中のスレーブでなければ実行できません。スレーブの設定をしてSTART SLAVEコマンドを実行してください。このサーバーはスレーブとして設定されていません。コンフィグファイルかCHANGE MASTER TOコマンドで設定して下さい。'master info '%.*s''構造体の初期化ができませんでした。MariaDBエラーログでエラーメッセージを確認してください。スレーブスレッドを作成できません。システムリソースを確認してください。ユーザー '%-.64s' はすでに 'max_user_connections' 以上のアクティブな接続を行っています。SET処理が失敗しました。ロック待ちがタイムアウトしました。トランザクションを再試行してください。ロックの数が多すぎます。読み込み専用トランザクションです。グローバルリードロックを保持している間は、DROP DATABASE を実行できません。グローバルリードロックを保持している間は、CREATE DATABASE を実行できません。%s の引数が不正です'%s'@'%s' is not allowed to create new users不正な表定義です。MERGE表の構成表はすべて同じデータベース内になければなりません。ロック取得中にデッドロックが検出されました。トランザクションを再試行してください。The storage engine %s doesn't support FULLTEXT indexes`%s` 外部キー制約を追加できません。親キーがありません。外部キー制約違反です。子レコードがあります。外部キー制約違反です。マスターへの接続エラー: %-.128sマスターでのクエリ実行エラー: %-.128s%s コマンドの実行エラー: %-.128s%s の %s に関する不正な使用法です。使用のSELECT文が返す列数が違います。競合するリードロックを保持しているので、クエリを実行できません。トランザクション対応の表と非対応の表の同時使用は無効化されています。オプション '%s' が2度使用されています。ユーザー '%-.64s' はリソースの上限 '%s' に達しました。(現在値: %ld)アクセスは拒否されました。この操作には %-.128s 権限が(複数の場合はどれか1つ)必要です。変数 '%-.64s' はセッション変数です。SET GLOBALでは使用できません。変数 '%-.64s' はグローバル変数です。SET GLOBALを使用してください。変数 '%-.64s' にはデフォルト値がありません。変数 '%-.64s' に値 '%-.200T' を設定できません。変数 '%-.64s' への値の型が不正です。変数 '%-.64s' は書き込み専用です。読み込みはできません。'%s' の使用法または場所が不正です。このバージョンのMariaDBでは、まだ '%s' を利用できません。致命的なエラー %d: '%-.320s' がマスターでバイナリログ読み込み中に発生しました。replicate-*-table ルールに従って、スレーブSQLスレッドはクエリを無視しました。変数 '%-.192s' は %s 変数です。外部キー '%-.192s' の定義の不正: %s外部キーの参照表と定義が一致しません。オペランドに %d 個の列が必要です。サブクエリが2行以上の結果を返します。'%.*s' はプリペアードステートメントの不明なハンドルです。(%s で指定されました)ヘルプデータベースは壊れているか存在しません。サブクエリの参照がループしています。列 '%s' を %s から %s へ変換します。'%-.64s' の参照はできません。(%s)導出表には別名が必須です。Select %u は最適化によって減らされました。特定のSELECTのみで使用の表 '%-.192s' は %-.32s では使用できません。クライアントはサーバーが要求する認証プロトコルに対応できません。MariaDBクライアントのアップグレードを検討してください。空間索引のキー列は NOT NULL でなければいけません。COLLATION '%s' は CHARACTER SET '%s' に適用できません。スレーブはすでに稼働中です。スレーブはすでに停止しています。展開後のデータが大きすぎます。最大サイズは %d です。(展開後データの長さ情報が壊れている可能性もあります。)ZLIB: メモリ不足です。ZLIB: 出力バッファに十分な空きがありません。(展開後データの長さ情報が壊れている可能性もあります。)ZLIB: 入力データが壊れています。Row %u was cut by %s)行 %lu はすべての列へのデータを含んでいません。行 %lu はデータを切り捨てられました。列よりも多いデータを含んでいました。列にデフォルト値が設定されました。NOT NULLの列 '%s' に 行 %lu で NULL が与えられました。Out of range value for column '%s' at row %lu列 '%s' の 行 %lu でデータが切り捨てられました。ストレージエンジン %s が表 '%s' に利用されています。照合順序 (%s,%s) と (%s,%s) の混在は操作 '%s' では不正です。Cannot drop one or more of the requested users指定されたユーザーから指定された全ての権限を剥奪することができませんでした。照合順序 (%s,%s), (%s,%s), (%s,%s) の混在は操作 '%s' では不正です。操作 '%s' では不正な照合順序の混在です。変数 '%-.64s' は構造変数の構成要素ではありません。(XXXX.変数名 という指定はできません。)不明な照合順序: '%-.64s'このMariaDBスレーブはSSLサポートを含めてコンパイルされていないので、CHANGE MASTER のSSLパラメータは無視されました。今後SSLサポートを持つMariaDBスレーブを起動する際に利用されます。サーバーは --secure-auth モードで稼働しています。しかし '%s'@'%s' は古い形式のパスワードを使用しています。新しい形式のパスワードに変更してください。フィールドまたは参照 '%-.192s%s%-.192s%s%-.192s' は SELECT #%d ではなく、SELECT #%d で解決されました。START SLAVE UNTIL へのパラメータまたはその組み合わせが不正です。START SLAVE UNTIL で段階的にレプリケーションを行う際には、--skip-slave-start オプションを使うことを推奨します。使わない場合、スレーブのmariadbdが不慮の再起動をすると問題が発生します。スレーブSQLスレッドが開始されないため、UNTILオプションは無視されました。索引名 '%-.100s' は不正です。カタログ名 '%-.100s' は不正です。Query cache failed to set size %llu; new query cache size is %lu列 '%-.192s' は全文索引のキーにはできません。'%-.100s' は不明なキーキャッシュです。MariaDBは --skip-name-resolve モードで起動しています。このオプションを外して再起動しなければ、この権限操作は機能しません。'%s' は不明なストレージエンジンです。'%s' は将来のリリースで廃止予定です。代わりに %s を使用してください。対象表 %-.100s は更新可能ではないので、%s を行えません。機能 '%s' は無効です。利用するためには '%s' を含めてビルドしたMariaDBが必要です。MariaDBサーバーが %s オプションで実行されているので、このステートメントは実行できません。列 '%-.100s' で、重複する値 '%-.64s' が %s に指定されています。不正な %-.32T の値が切り捨てられました。: '%-.128T'不正な表定義です。DEFAULT句またはON UPDATE句に CURRENT_TIMESTAMP をともなうTIMESTAMP型の列は1つまでです。列 '%-.192s' に ON UPDATE句は無効です。This command is not supported in the prepared statement protocol yetエラー %d '%-.200s' が %s から返されました。一時エラー %d '%-.200s' が %s から返されました。Unknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaスレッドスタック不足です(使用: %ld ; サイズ: %ld ; 要求: %ld)。より大きい値で 'mariadbd --thread_stack=#' の指定をしてください。Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)対象表 %-.100s は挿入可能ではないので、%s を行えません。Table '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY外部サーバー '%s'は既に存在するため、作成できませんThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native function'%-.64T' は索引 '%-.192s' で重複しています。Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAccess denied for user '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionは索引 '%-.192s' で重複しています。Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledserbian/errmsg.sys000064400000234455150343472770010257 0ustar00��o/o��=�...55FS+.75'/18:7PE-2=( '$@&*B4,VQ<1';A$8'4"9( '+$2$*DF<.CO�*Dk[qh@�}k.`#8Dh>�14&&$M('!R~�Sx&58 I5#�Gfw8>�4+"'vFDYuI$WF$[0SL(*#(%7#5\LG}-DJ]~';Ly//;2466kF:/A=B`(K_D�����Rp;_O\Z\&=R~=2AL$'-?[c$BVJI/9-,"1LF(3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?+8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7)FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�"i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I�hashchkisamchkNEDANe mogu da kreiram file '%-.200s' (errno: %M)Ne mogu da kreiram tabelu %`s.%`s (errno: %M)Ne mogu da kreiram bazu '%-.192s' (errno: %M)Ne mogu da kreiram bazu '%-.192s'; baza već postojiNe mogu da izbrišem bazu '%-.192s'; baza ne postojiNe mogu da izbrišem bazu (ne mogu da izbrišem '%-.192s', errno: %M)Ne mogu da izbrišem bazu (ne mogu da izbrišem direktorijum '%-.192s', errno: %M)Greška pri brisanju '%-.192s' (errno: %M)Ne mogu da pročitam slog iz sistemske tabeleNe mogu da dobijem stanje file-a '%-.200s' (errno: %M)Ne mogu da dobijem trenutni direktorijum (errno: %M)Ne mogu da zaključam file (errno: %M)Ne mogu da otvorim file: '%-.200s' (errno: %M)Ne mogu da pronađem file: '%-.200s' (errno: %M)Ne mogu da pročitam direktorijum '%-.192s' (errno: %M)Ne mogu da promenim direktorijum na '%-.192s' (errno: %M)Slog je promenjen od zadnjeg čitanja tabele '%-.192s'Disk je pun (%s). Čekam nekoga da dođe i oslobodi nešto mesta... (errno: %M)Ne mogu da pišem pošto postoji duplirani ključ u tabeli '%-.192s'Greška pri zatvaranju '%-.192s' (errno: %M)Greška pri čitanju file-a '%-.200s' (errno: %M)Greška pri promeni imena '%-.210s' na '%-.210s' (errno: %M)Greška pri upisu '%-.200s' (errno: %M)'%-.192s' je zaključan za upisSortiranje je prekinutoView '%-.192s' ne postoji za '%-.192s'Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionNe mogu da pronađem slog u '%-.192s'Pogrešna informacija u file-u: '%-.200s'Pogrešan key file za tabelu: '%-.200s'; probajte da ga ispraviteZastareo key file za tabelu '%-.192s'; ispravite gaTabelu '%-.192s' je dozvoljeno samo čitatiNema memorije. Restartujte MariaDB server i probajte ponovo (potrebno je %d byte-ova)Nema memorije za sortiranje. Povećajte veličinu sort buffer-a MariaDB server-uNeočekivani kraj pri čitanju file-a '%-.192s' (errno: %M)Previše konekcijaNema memorije.Ne mogu da dobijem ime host-a za vašu IP adresuLoš početak komunikacije (handshake)Pristup je zabranjen korisniku '%s'@'%s' za bazu '%-.192s'Pristup je zabranjen korisniku '%s'@'%s' (koristi lozinku: '%s')Ni jedna baza nije selektovanaNepoznata komandaKolona '%-.192s' ne može biti NULLNepoznata baza '%-.192s'Tabela '%-.192s' već postojiNepoznata tabela '%-.100T'Kolona '%-.192s' u %-.192s nije jedinstvena u kontekstuGašenje servera je u tokuNepoznata kolona '%-.192s' u '%-.192s'Entitet '%-.192s' nije naveden u komandi 'GROUP BY'Ne mogu da grupišem po '%-.192s'Izraz ima 'SUM' agregatnu funkciju i kolone u isto vremeBroj kolona ne odgovara broju vrednostiIme '%-.100T' je predugačkoDuplirano ime kolone '%-.192s'Duplirano ime ključa '%-.192s'Dupliran unos '%-.192T' za ključ '%d'Pogrešan naziv kolone za kolonu '%-.192s''%s' u iskazu '%-.80T' na liniji %dUpit je bio prazanTabela ili alias nisu bili jedinstveni: '%-.192s'Loša default vrednost za '%-.192s'Definisani višestruki primarni ključeviNavedeno je previše ključeva. Maksimum %d ključeva je dozvoljenoNavedeno je previše delova ključa. Maksimum %d delova je dozvoljenoNavedeni ključ je predug. Maksimalna dužina ključa je %dKljučna kolona '%-.192s' ne postoji u tabeliBLOB column %`s can't be used in key specification in the %s tablePreviše podataka za kolonu '%-.192s' (maksimum je %lu). Upotrebite BLOB poljePogrešna definicija tabele; U tabeli može postojati samo jedna 'AUTO' kolona i ona mora biti istovremeno definisana kao kolona ključaCould not delete gtid domain. Reason: %s.%s (%s): Normalno gašenje%s: Dobio signal %d. Prekidam!%s: Gašenje završeno%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.48s'Ne mogu da kreiram IP socketTabela '%-.192s' nema isti indeks kao onaj upotrebljen pri komandi 'CREATE INDEX'. Napravite tabelu ponovoArgument separatora polja nije ono što se očekivalo. Proverite uputstvo MariaDB server-aNe možete koristiti fiksnu veličinu sloga kada imate BLOB polja. Molim koristite 'fields terminated by' opcijuFile '%-.128s' mora biti u direktorijumu gde su file-ovi baze i mora imati odgovarajuća prava pristupaFile '%-.200s' već postojiSlogova: %ld  Izbrisano: %ld  Preskočeno: %ld  Upozorenja: %ldSlogova: %ld  Duplikata: %ldPogrešan pod-ključ dela ključa. Upotrebljeni deo ključa nije string, upotrebljena dužina je veća od dela ključa ili handler tabela ne podržava jedinstvene pod-ključeveNe možete da izbrišete sve kolone pomoću komande 'ALTER TABLE'. Upotrebite komandu 'DROP TABLE' ako želite to da uraditeNe mogu da izvršim komandu drop 'DROP %s' na %`-.192s. Proverite da li ta kolona (odnosno ključ) postojiSlogova: %ld  Duplikata: %ld  Upozorenja: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataNepoznat thread identifikator: %luVi niste vlasnik thread-a %lldNema upotrebljenih tabelaPreviše string-ova za kolonu '%-.192s' i komandu 'SET'Ne mogu da generišem jedinstveno ime log-file-a: '%-.200s.(1-999)'Tabela '%-.192s' je zaključana READ lock-om; iz nje se može samo čitati ali u nju se ne može pisatiTabela '%-.192s' nije bila zaključana komandom 'LOCK TABLES'You should never see itPogrešno ime baze '%-.100T'Pogrešno ime tabele '%-.100s'Komanda 'SELECT' će ispitati previše slogova i potrošiti previše vremena. Proverite vaš 'WHERE' filter i upotrebite 'SET OPTION SQL_BIG_SELECTS=1' ako želite baš ovakvu komanduNepoznata greškaNepoznata procedura '%-.192s'Pogrešan broj parametara za proceduru '%-.192s'Pogrešni parametri prosleđeni proceduri '%-.192s'Nepoznata tabela '%-.192s' u '%-.32s'Kolona '%-.192s' je navedena dva putaPogrešna upotreba 'GROUP' funkcijeTabela '%-.192s' koristi ekstenziju koje ne postoji u ovoj verziji MariaDB-aTabela mora imati najmanje jednu kolonuTabela '%-.192s' je popunjena do krajaNepoznati karakter-set: '%-.64s'Previše tabela. MariaDB može upotrebiti maksimum %d tabela pri 'JOIN' operacijiPreviše kolonaPrevelik slog. Maksimalna veličina sloga, ne računajući BLOB polja, je %ld. Trebali bi da promenite tip nekih polja u BLOBPrepisivanje thread stack-a:  Upotrebljeno: %ld od %ld stack memorije.  Upotrebite 'mariadbd --thread_stack=#' da navedete veći stack ako je potrebnoUnakrsna zavisnost pronađena u komandi 'OUTER JOIN'. Istražite vaše 'ON' usloveTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerNe mogu da učitam funkciju '%-.192s'Ne mogu da inicijalizujem funkciju '%-.192s'; %-.80sNe postoje dozvoljene putanje do share-ovane bibliotekeFunkcija '%-.192s' već postojiNe mogu da otvorim share-ovanu biblioteku '%-.192s' (errno: %d, %-.128s)Ne mogu da pronadjem funkciju '%-.128s' u biblioteciFunkcija '%-.192s' nije definisanaHost '%-.64s' je blokiran zbog previše grešaka u konekciji.  Možete ga odblokirati pomoću komande 'mariadb-admin flush-hosts'Host-u '%-.64s' nije dozvoljeno da se konektuje na ovaj MariaDB serverVi koristite MariaDB kao anonimni korisnik a anonimnim korisnicima nije dozvoljeno da menjaju lozinkeMorate imati privilegije da možete da update-ujete određene tabele ako želite da menjate lozinke za druge korisnikeNe mogu da pronađem odgovarajući slog u 'user' tabeliOdgovarajućih slogova: %ld  Promenjeno: %ld  Upozorenja: %ldNe mogu da kreiram novi thread (errno %M). Ako imate još slobodne memorije, trebali biste da pogledate u priručniku da li je ovo specifična greška vašeg operativnog sistemaBroj kolona ne odgovara broju vrednosti u slogu %luNe mogu da ponovo otvorim tabelu '%-.192s'Pogrešna upotreba vrednosti NULLFunkcija regexp je vratila grešku: %sUpotreba agregatnih funkcija (MIN(),MAX(),COUNT()...) bez 'GROUP' kolona je pogrešna ako ne postoji 'GROUP BY' iskazNe postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s'%-.100T komanda zabranjena za korisnika '%s'@'%s' za tabelu %`s.%`s%-.32s komanda zabranjena za korisnika '%s'@'%s' za kolonu '%-.192s' iz tabele '%-.192s'Pogrešna 'GRANT' odnosno 'REVOKE' komanda. Molim Vas pogledajte u priručniku koje vrednosti mogu biti upotrebljeneArgument 'host' ili 'korisnik' prosleđen komandi 'GRANT' je predugačakTabela '%-.192s.%-.192s' ne postojiNe postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s' tabeli '%-.192s'Upotrebljena komanda nije dozvoljena sa ovom verzijom MariaDB serveraImate grešku u vašoj SQL sintaksiProlongirani 'INSERT' thread nije mogao da dobije traženo zaključavanje tabele '%-.192s'Previše prolongiranih thread-ova je u upotrebiPrekinuta konekcija broj %ld ka bazi: '%-.192s' korisnik je bio: '%-.48s' (%-.64s)Primio sam mrežni paket veći od definisane vrednosti 'max_allowed_packet'Greška pri čitanju podataka sa pipe-aGreška pri izvršavanju funkcije fcntl()Primio sam mrežne pakete van redaNe mogu da dekompresujem mrežne paketeGreška pri primanju mrežnih paketaVremenski limit za čitanje mrežnih paketa je istekaoGreška pri slanju mrežnih paketaVremenski limit za slanje mrežnih paketa je istekaoRezultujuči string je duži nego što to dozvoljava parametar servera 'max_allowed_packet'Iskorišteni tip tabele (%s) ne podržava kolone tipa 'BLOB' odnosno 'TEXT'Iskorišteni tip tabele (%s) ne podržava kolone tipa 'AUTO_INCREMENT'Komanda 'INSERT DELAYED' ne može biti iskorištena u tabeli '%-.192s', zbog toga što je zaključana komandom 'LOCK TABLES'Pogrešno ime kolone '%-.100s'The storage engine %s can't index column %`sTabele iskorištene u 'MERGE' tabeli nisu definisane na isti načinZbog provere jedinstvenosti ne mogu da upišem podatke u tabelu '%-.192s'BLOB kolona '%-.192s' je upotrebljena u specifikaciji ključa bez navođenja dužine ključaSvi delovi primarnog ključa moraju biti različiti od NULL;  Ako Vam ipak treba NULL vrednost u ključu, upotrebite 'UNIQUE'Rezultat je sačinjen od više slogovaOvaj tip tabele zahteva da imate definisan primarni ključOva verzija MariaDB servera nije kompajlirana sa podrškom za RAID uređajeVi koristite safe update mod servera, a probali ste da promenite podatke bez 'WHERE' komande koja koristi kolonu ključaKljuč '%-.192s' ne postoji u tabeli '%-.192s'Ne mogu da otvorim tabeluHandler za ovu tabelu ne dozvoljava %s komandeNije Vam dozvoljeno da izvršite ovu komandu u transakcijiGreška %M za vreme izvršavanja komande 'COMMIT'Greška %M za vreme izvršavanja komande 'ROLLBACK'Greška %M za vreme izvršavanja komande 'FLUSH_LOGS'Greška %M za vreme izvršavanja komande 'CHECKPOINT'Prekinuta konekcija broj %lld ka bazi: '%-.192s' korisnik je bio: '%-.48s' a host: '%-.64s'%-.64s (%-.64s)You should never see itBinarni log file zatvoren, ne mogu da izvršim komandu 'RESET MASTER'Izgradnja indeksa dump-ovane tabele '%-.192s' nije uspelaGreška iz glavnog servera '%-.64s' u klasteruGreška u primanju mrežnih paketa sa glavnog servera u klasteruGreška u slanju mrežnih paketa na glavni server u klasteruNe mogu da pronađem 'FULLTEXT' indeks koli odgovara listi kolonaNe mogu da izvršim datu komandu zbog toga što su tabele zaključane ili je transakcija u tokuNepoznata sistemska promenljiva '%-.*s'Tabela '%-.192s' je markirana kao oštećena i trebala bi biti popravljenaTabela '%-.192s' je markirana kao oštećena, a zadnja (automatska?) popravka je bila neuspelaUpozorenje: Neke izmenjene tabele ne podržavaju komandu 'ROLLBACK'Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againOva operacija ne može biti izvršena dok je aktivan podređeni '%2$*1$s' server. Zadajte prvo komandu 'STOP SLAVE '%2$*1$s'' da zaustavite podređeni serverOva operacija zahteva da je aktivan podređeni server. Konfigurišite prvo podređeni server i onda izvršite komandu 'START SLAVE'Server nije konfigurisan kao podređeni server, ispravite konfiguracioni file ili na njemu izvršite komandu 'CHANGE MASTER TO'Nisam mogao da inicijalizujem informacionu strukturu glavnog servera, proverite da li imam privilegije potrebne za pristup file-u 'master.info' '%.*s'Nisam mogao da startujem thread za podređeni server, proverite sistemske resurseKorisnik %-.64s već ima više aktivnih konekcija nego što je to određeno 'max_user_connections' promenljivomMožete upotrebiti samo konstantan iskaz sa komandom 'SET'Vremenski limit za zaključavanje tabele je istekao; Probajte da ponovo startujete transakcijuBroj totalnih zaključavanja tabele premašuje veličinu tabele zaključavanjaZaključavanja izmena ne mogu biti realizovana sve dok traje 'READ UNCOMMITTED' transakcijaKomanda 'DROP DATABASE' nije dozvoljena dok thread globalno zaključava čitanje podatakaKomanda 'CREATE DATABASE' nije dozvoljena dok thread globalno zaključava čitanje podatakaPogrešni argumenti prosleđeni na %sKorisniku '%s'@'%s' nije dozvoljeno da kreira nove korisnikePogrešna definicija tabele; sve 'MERGE' tabele moraju biti u istoj bazi podatakaUnakrsno zaključavanje pronađeno kada sam pokušao da dobijem pravo na zaključavanje; Probajte da restartujete transakcijuUpotrebljeni tip tabele (%s) ne podržava 'FULLTEXT' indekseNe mogu da dodam proveru spoljnog ključa na `%s`Cannot add or update a child row: a foreign key constraint failsNe mogu da izbrišem roditeljski slog: provera spoljnog ključa je neuspelaError connecting to master: %-.128sError running query on master: %-.128sGreška pri izvršavanju komande %s: %-.128sPogrešna upotreba %s i %sUpotrebljene 'SELECT' komande adresiraju različit broj kolonaNe mogu da izvršim upit zbog toga što imate zaključavanja čitanja podataka u konfliktuMešanje tabela koje podržavaju transakcije i onih koje ne podržavaju transakcije je isključenoOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesPromenljiva '%-.192s' je %s promenljivaIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDupliran unos '%-.64T' za ključ '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTPristup je zabranjen korisniku '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDupliran unos za ključ '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmysqld_multi.server000075500000003034150343472770010536 0ustar00#!/bin/sh
#
# A simple startup script for mysqld_multi by Tim Smith and Jani Tolonen.
# This script assumes that my.cnf file exists either in /etc/my.cnf or
# /root/.my.cnf and has groups [mysqld_multi] and [mysqldN]. See the
# mysqld_multi documentation for detailed instructions.
#
# This script can be used as /etc/init.d/mysql.server
#
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 64 36
# description: A very fast and reliable SQL database engine.
#
# Version 1.0
#

### BEGIN INIT INFO
# Provides:          mysqld_multi
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop multiple mysql database server daemon instances
# Description:       Controls multiple MariaDB database server daemon instances
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=mysqld_multi
DESC=mysqld_multi

basedir=/usr
bindir=/usr/bin

if test -x $bindir/mysqld_multi
then
  mysqld_multi="$bindir/mysqld_multi";
else
  echo "Can't execute $bindir/mysqld_multi from dir $basedir";
  exit;
fi

case "$1" in
    'start' )
        "$mysqld_multi" start $2
        ;;
    'stop' )
        "$mysqld_multi" stop $2
        ;;
    'report' )
        "$mysqld_multi" report $2
        ;;
    'restart' )
        "$mysqld_multi" stop $2
        "$mysqld_multi" start $2
        ;;
    *)
        echo "Usage: $0 {start|stop|report|restart}" >&2
        ;;
esac
wsrep.cnf000064400000006622150343472770006416 0ustar00# This file contains wsrep-related mysqld options. It should be included
# in the main MySQL configuration file.
#
# Options that need to be customized:
#  - wsrep_provider
#  - wsrep_cluster_address
#  - wsrep_sst_auth
# The rest of defaults should work out of the box.

##
## mysqld options _MANDATORY_ for correct opration of the cluster
##
[mysqld]

# (This must be substituted by wsrep_format)
binlog_format=ROW

# Currently only InnoDB storage engine is supported
default-storage-engine=innodb

# to avoid issues with 'bulk mode inserts' using autoinc
innodb_autoinc_lock_mode=2

# Override bind-address
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=0.0.0.0

##
## WSREP options
##

# Enable wsrep
wsrep_on=1

# Full path to wsrep provider library or 'none'
wsrep_provider=none

# Provider specific configuration options
#wsrep_provider_options=

# Logical cluster name. Should be the same for all nodes.
wsrep_cluster_name="my_wsrep_cluster"

# Group communication system handle
#wsrep_cluster_address="dummy://"

# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=

# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
#wsrep_node_address=

# Address for incoming client connections. Autodetect by default.
#wsrep_node_incoming_address=

# How many threads will process writesets from other nodes
wsrep_slave_threads=1

# DBUG options for wsrep provider
#wsrep_dbug_option

# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1

# Maximum number of rows in write set
wsrep_max_ws_rows=0

# Maximum size of write set
wsrep_max_ws_size=2147483647

# to enable debug level logging, set this to 1
wsrep_debug=0

# convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0

# how many times to retry deadlocked autocommits
wsrep_retry_autocommit=1

# change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1

# retry autoinc insert, which failed for duplicate key error
wsrep_drupal_282555_workaround=0

# enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0

# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status  - new status of this node
# --uuid    - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index   - index of this node in the list
wsrep_notify_cmd=

##
## WSREP State Transfer options
##

# State Snapshot Transfer method
wsrep_sst_method=rsync

# Address which donor should send State Snapshot to.
# Should be the address of THIS node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
#wsrep_sst_receive_address=

# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
wsrep_sst_auth=root:

# Desired SST donor name.
#wsrep_sst_donor=

# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0

# Protocol version to use
# wsrep_protocol_version=
mysql_system_tables.sql000064400000073554150343472770011422 0ustar00-- Copyright (c) 2007, 2018, Oracle and/or its affiliates.
-- Copyright (c) 2008, 2019, 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

--
-- The system tables of MySQL Server
--

set sql_mode='';

set @orig_storage_engine=@@default_storage_engine;
set default_storage_engine=Aria;

set system_versioning_alter_history=keep;

set @have_innodb= (select count(engine) from information_schema.engines where engine='INNODB' and support != 'NO');
SET @innodb_or_aria=IF(@have_innodb <> 0, 'InnoDB', 'Aria');

CREATE TABLE IF NOT EXISTS db (   Host char(255) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, Delete_history_priv enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY /*Host */(Host,Db,User), KEY User (User) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='Database privileges';

-- Remember for later if db table already existed
set @had_db_table= @@warning_count != 0;

CREATE TABLE IF NOT EXISTS global_priv (Host char(255) binary DEFAULT '', User char(128) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='Users and global privileges';

set @exists_user_view= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user');

set @exists_user_view_by_root= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost');

set @need_sys_user_creation= (( NOT @exists_user_view) OR @exists_user_view_by_root);

CREATE TEMPORARY TABLE tmp_user_sys LIKE global_priv;
INSERT INTO tmp_user_sys (Host,User,Priv) VALUES ('localhost','mariadb.sys','{"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}');
INSERT IGNORE INTO global_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;

CREATE DEFINER='mariadb.sys'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT
  Host,
  User,
  IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password,
  IF(JSON_VALUE(Priv, '$.access') &         1, 'Y', 'N') AS Select_priv,
  IF(JSON_VALUE(Priv, '$.access') &         2, 'Y', 'N') AS Insert_priv,
  IF(JSON_VALUE(Priv, '$.access') &         4, 'Y', 'N') AS Update_priv,
  IF(JSON_VALUE(Priv, '$.access') &         8, 'Y', 'N') AS Delete_priv,
  IF(JSON_VALUE(Priv, '$.access') &        16, 'Y', 'N') AS Create_priv,
  IF(JSON_VALUE(Priv, '$.access') &        32, 'Y', 'N') AS Drop_priv,
  IF(JSON_VALUE(Priv, '$.access') &        64, 'Y', 'N') AS Reload_priv,
  IF(JSON_VALUE(Priv, '$.access') &       128, 'Y', 'N') AS Shutdown_priv,
  IF(JSON_VALUE(Priv, '$.access') &       256, 'Y', 'N') AS Process_priv,
  IF(JSON_VALUE(Priv, '$.access') &       512, 'Y', 'N') AS File_priv,
  IF(JSON_VALUE(Priv, '$.access') &      1024, 'Y', 'N') AS Grant_priv,
  IF(JSON_VALUE(Priv, '$.access') &      2048, 'Y', 'N') AS References_priv,
  IF(JSON_VALUE(Priv, '$.access') &      4096, 'Y', 'N') AS Index_priv,
  IF(JSON_VALUE(Priv, '$.access') &      8192, 'Y', 'N') AS Alter_priv,
  IF(JSON_VALUE(Priv, '$.access') &     16384, 'Y', 'N') AS Show_db_priv,
  IF(JSON_VALUE(Priv, '$.access') &     32768, 'Y', 'N') AS Super_priv,
  IF(JSON_VALUE(Priv, '$.access') &     65536, 'Y', 'N') AS Create_tmp_table_priv,
  IF(JSON_VALUE(Priv, '$.access') &    131072, 'Y', 'N') AS Lock_tables_priv,
  IF(JSON_VALUE(Priv, '$.access') &    262144, 'Y', 'N') AS Execute_priv,
  IF(JSON_VALUE(Priv, '$.access') &    524288, 'Y', 'N') AS Repl_slave_priv,
  IF(JSON_VALUE(Priv, '$.access') &   1048576, 'Y', 'N') AS Repl_client_priv,
  IF(JSON_VALUE(Priv, '$.access') &   2097152, 'Y', 'N') AS Create_view_priv,
  IF(JSON_VALUE(Priv, '$.access') &   4194304, 'Y', 'N') AS Show_view_priv,
  IF(JSON_VALUE(Priv, '$.access') &   8388608, 'Y', 'N') AS Create_routine_priv,
  IF(JSON_VALUE(Priv, '$.access') &  16777216, 'Y', 'N') AS Alter_routine_priv,
  IF(JSON_VALUE(Priv, '$.access') &  33554432, 'Y', 'N') AS Create_user_priv,
  IF(JSON_VALUE(Priv, '$.access') &  67108864, 'Y', 'N') AS Event_priv,
  IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv,
  IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv,
  IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv,
  ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type,
  IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher,
  IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer,
  IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject,
  CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions,
  CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates,
  CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections,
  CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections,
  IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin,
  IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string,
  IF(IFNULL(JSON_VALUE(Priv, '$.password_last_changed'), 1) = 0, 'Y', 'N') AS password_expired,
  ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role,
  IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role,
  CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time
  FROM global_priv;

-- Remember for later if user table already existed
set @had_user_table= @@warning_count != 0;

CREATE TABLE IF NOT EXISTS roles_mapping ( Host char(255) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Role char(128) binary DEFAULT '' NOT NULL, Admin_option enum('N','Y') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, UNIQUE (Host, User, Role)) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='Granted roles';

CREATE TABLE IF NOT EXISTS func (  name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (name) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin   comment='User defined functions';


CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci comment='MySQL plugins';


CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host varchar(2048) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(128) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(108) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner varchar(512) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) engine=Aria transactional=1 CHARACTER SET utf8mb3 comment='MySQL Foreign Servers table';


CREATE TABLE IF NOT EXISTS tables_priv ( Host char(255) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor varchar(384) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') COLLATE utf8mb3_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8mb3_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin   comment='Table privileges';

CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv;
INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Delete');
INSERT IGNORE INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;

CREATE TABLE IF NOT EXISTS columns_priv ( Host char(255) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8mb3_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin   comment='Column privileges';


CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 comment='help topics';


CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name  char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 comment='help categories';


CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id  int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 comment='keyword-topic relation';


CREATE TABLE IF NOT EXISTS help_keyword (   help_keyword_id  int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 comment='help keywords';


CREATE TABLE IF NOT EXISTS time_zone_name (   Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY /*Name*/ (Name) ) engine=Aria transactional=1 CHARACTER SET utf8mb3   comment='Time zone names';


CREATE TABLE IF NOT EXISTS time_zone (   Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8mb3_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY /*TzId*/ (Time_zone_id) ) engine=Aria transactional=1 CHARACTER SET utf8mb3   comment='Time zones';


CREATE TABLE IF NOT EXISTS time_zone_transition (   Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY /*TzIdTranTime*/ (Time_zone_id, Transition_time) ) engine=Aria transactional=1 CHARACTER SET utf8mb3   comment='Time zone transitions';


CREATE TABLE IF NOT EXISTS time_zone_transition_type (   Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, `Offset` int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY /*TzIdTrTId*/ (Time_zone_id, Transition_type_id) ) engine=Aria transactional=1 CHARACTER SET utf8mb3   comment='Time zone transition types';


CREATE TABLE IF NOT EXISTS time_zone_leap_second (   Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY /*TranTime*/ (Transition_time) ) engine=Aria transactional=1 CHARACTER SET utf8mb3   comment='Leap seconds information for time zones';

CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8mb3_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob NOT NULL, body longblob NOT NULL, definer varchar(384) collate utf8mb3_bin DEFAULT '' NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH', 'EMPTY_STRING_IS_NULL', 'SIMULTANEOUS_ASSIGNMENT', 'TIME_ROUND_FRACTIONAL') DEFAULT '' NOT NULL, comment text collate utf8mb3_bin NOT NULL, character_set_client char(32) collate utf8mb3_bin, collation_connection char(32) collate utf8mb3_bin, db_collation char(32) collate utf8mb3_bin, body_utf8 longblob, aggregate enum('NONE', 'GROUP') DEFAULT 'NONE' NOT NULL, PRIMARY KEY (db,name,type)) engine=Aria transactional=1 character set utf8mb3 comment='Stored Procedures';

CREATE TABLE IF NOT EXISTS procs_priv ( Host char(255) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8mb3_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL, Grantor varchar(384) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8mb3_general_ci DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin   comment='Procedure privileges';


-- Create general_log if CSV is enabled.
SET @have_csv = (SELECT support FROM information_schema.engines WHERE engine = 'CSV');
SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8mb3 comment="General log"', 'SET @dummy = 0');

PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

-- Create slow_log if CSV is enabled.

SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, query_time TIME(6) NOT NULL, lock_time TIME(6) NOT NULL, rows_sent BIGINT UNSIGNED NOT NULL, rows_examined BIGINT UNSIGNED NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, rows_affected BIGINT UNSIGNED NOT NULL) engine=CSV CHARACTER SET utf8mb3 comment="Slow log"', 'SET @dummy = 0');

PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL default '', name char(64) CHARACTER SET utf8mb3 NOT NULL default '', body longblob NOT NULL, definer varchar(384) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode  set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8mb3_bin, collation_connection char(32) collate utf8mb3_bin, db_collation char(32) collate utf8mb3_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) engine=Aria transactional=1 DEFAULT CHARSET=utf8mb3 COMMENT 'Events';

SET @create_innodb_table_stats="CREATE TABLE IF NOT EXISTS innodb_table_stats (
	database_name			VARCHAR(64) NOT NULL,
	table_name			VARCHAR(199) NOT NULL,
	last_update			TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	n_rows				BIGINT UNSIGNED NOT NULL,
	clustered_index_size		BIGINT UNSIGNED NOT NULL,
	sum_of_other_index_sizes	BIGINT UNSIGNED NOT NULL,
	PRIMARY KEY (database_name, table_name)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0";

SET @create_innodb_index_stats="CREATE TABLE IF NOT EXISTS innodb_index_stats (
	database_name			VARCHAR(64) NOT NULL,
	table_name			VARCHAR(199) NOT NULL,
	index_name			VARCHAR(64) NOT NULL,
	last_update			TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	/* there are at least:
	stat_name='size'
	stat_name='n_leaf_pages'
	stat_name='n_diff_pfx%' */
	stat_name			VARCHAR(64) NOT NULL,
	stat_value			BIGINT UNSIGNED NOT NULL,
	sample_size			BIGINT UNSIGNED,
	stat_description		VARCHAR(1024) NOT NULL,
	PRIMARY KEY (database_name, table_name, index_name, stat_name)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0";

SET @create_transaction_registry="CREATE TABLE IF NOT EXISTS transaction_registry (
	transaction_id			BIGINT UNSIGNED NOT NULL,
	commit_id			BIGINT UNSIGNED NOT NULL,
	begin_timestamp			TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
	commit_timestamp		TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
	isolation_level			ENUM('READ-UNCOMMITTED', 'READ-COMMITTED',
					'REPEATABLE-READ', 'SERIALIZABLE') NOT NULL,
	PRIMARY KEY (transaction_id),
	UNIQUE KEY (commit_id),
	INDEX (begin_timestamp),
	INDEX (commit_timestamp, transaction_id)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0";

SET @str=IF(@have_innodb <> 0, @create_innodb_table_stats, "SET @dummy = 0");
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

SET @str=IF(@have_innodb <> 0, @create_innodb_index_stats, "SET @dummy = 0");
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

SET @str=IF(@have_innodb <> 0, @create_transaction_registry, "SET @dummy = 0");
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

SET @cmd="CREATE TABLE IF NOT EXISTS slave_relay_log_info (
  Number_of_lines INTEGER UNSIGNED NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.', 
  Relay_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'The name of the current relay log file.', 
  Relay_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The relay log position of the last executed event.', 
  Master_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.', 
  Master_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The master log position of the last executed event.', 
  Sql_delay INTEGER NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.', 
  Number_of_workers INTEGER UNSIGNED NOT NULL,
  Id INTEGER UNSIGNED NOT NULL COMMENT 'Internal Id that uniquely identifies this record.',  
  PRIMARY KEY(Id)) DEFAULT CHARSET=utf8mb3 STATS_PERSISTENT=0 COMMENT 'Relay Log Information'";

SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_aria);
-- Don't create the table; MariaDB will have another implementation
#PREPARE stmt FROM @str;
#EXECUTE stmt;
#DROP PREPARE stmt;

SET @cmd= "CREATE TABLE IF NOT EXISTS slave_master_info (
  Number_of_lines INTEGER UNSIGNED NOT NULL COMMENT 'Number of lines in the file.', 
  Master_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.', 
  Master_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The master log position of the last read event.', 
  Host CHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The host name of the master.',
  User_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The user name used to connect to the master.', 
  User_password TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The password used to connect to the master.', 
  Port INTEGER UNSIGNED NOT NULL COMMENT 'The network port used to connect to the master.', 
  Connect_retry INTEGER UNSIGNED NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.', 
  Enabled_ssl BOOLEAN NOT NULL COMMENT 'Indicates whether the server supports SSL connections.', 
  Ssl_ca TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.', 
  Ssl_capath TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The path to the Certificate Authority (CA) certificates.', 
  Ssl_cert TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the SSL certificate file.', 
  Ssl_cipher TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the cipher in use for the SSL connection.', 
  Ssl_key TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the SSL key file.', 
  Ssl_verify_server_cert BOOLEAN NOT NULL COMMENT 'Whether to verify the server certificate.', 
  Heartbeat FLOAT NOT NULL COMMENT '', 
  Bind TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server', 
  Ignored_server_ids TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The number of server IDs to be ignored, followed by the actual server IDs', 
  Uuid TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The master server uuid.', 
  Retry_count BIGINT UNSIGNED NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.', 
  Ssl_crl TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The file used for the Certificate Revocation List (CRL)', 
  Ssl_crlpath TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The path used for Certificate Revocation List (CRL) files', 
  Enabled_auto_position BOOLEAN NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.', 
  PRIMARY KEY(Host, Port)) DEFAULT CHARSET=utf8mb3 STATS_PERSISTENT=0 COMMENT 'Master Information'";

SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_aria);
-- Don't create the table; MariaDB will have another implementation
#PREPARE stmt FROM @str;
#EXECUTE stmt;
#DROP PREPARE stmt;

SET @cmd= "CREATE TABLE IF NOT EXISTS slave_worker_info (
  Id INTEGER UNSIGNED NOT NULL, 
  Relay_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, 
  Relay_log_pos BIGINT UNSIGNED NOT NULL, 
  Master_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, 
  Master_log_pos BIGINT UNSIGNED NOT NULL, 
  Checkpoint_relay_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, 
  Checkpoint_relay_log_pos BIGINT UNSIGNED NOT NULL, 
  Checkpoint_master_log_name TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, 
  Checkpoint_master_log_pos BIGINT UNSIGNED NOT NULL, 
  Checkpoint_seqno INT UNSIGNED NOT NULL, 
  Checkpoint_group_size INTEGER UNSIGNED NOT NULL, 
  Checkpoint_group_bitmap BLOB NOT NULL, 
  PRIMARY KEY(Id)) DEFAULT CHARSET=utf8mb3 STATS_PERSISTENT=0 COMMENT 'Worker Information'";

SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_aria);
-- Don't create the table; MariaDB will have another implementation
#PREPARE stmt FROM @str;
#EXECUTE stmt;
#DROP PREPARE stmt;

CREATE TABLE IF NOT EXISTS proxies_priv (Host char(255) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Proxied_host char(255) binary DEFAULT '' NOT NULL, Proxied_user char(128) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor varchar(384) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY /*Host*/ (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=Aria transactional=1 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='User proxy privileges';

-- Remember for later if proxies_priv table already existed
set @had_proxies_priv_table= @@warning_count != 0;

-- The following needs to be done both for new installations
-- and for upgrades
CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv;
INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now());
REPLACE INTO tmp_proxies_priv SELECT 'localhost',IFNULL(@auth_root_socket, 'root'), '', '', TRUE, '', now() FROM DUAL;
INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0;
DROP TABLE tmp_proxies_priv;

--
-- Tables unique for MariaDB
--

CREATE TABLE IF NOT EXISTS table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='Statistics on Tables';

CREATE TABLE IF NOT EXISTS column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varbinary(255) DEFAULT NULL, max_value varbinary(255) DEFAULT NULL, nulls_ratio decimal(12,4) DEFAULT NULL, avg_length decimal(12,4) DEFAULT NULL, avg_frequency decimal(12,4) DEFAULT NULL, hist_size tinyint unsigned, hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB'), histogram varbinary(255), PRIMARY KEY (db_name,table_name,column_name) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='Statistics on Columns';

CREATE TABLE IF NOT EXISTS index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) engine=Aria transactional=0 CHARACTER SET utf8mb3 COLLATE utf8mb3_bin comment='Statistics on Indexes';

-- Note: This definition must be kept in sync with the one used in
-- build_gtid_pos_create_query() in sql/slave.cc
SET @cmd= "CREATE TABLE IF NOT EXISTS gtid_slave_pos (
  domain_id INT UNSIGNED NOT NULL,
  sub_id BIGINT UNSIGNED NOT NULL,
  server_id INT UNSIGNED NOT NULL,
  seq_no BIGINT UNSIGNED NOT NULL,
  PRIMARY KEY (domain_id, sub_id)) CHARSET=latin1
COMMENT='Replication slave GTID position'";
SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_aria);
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

set default_storage_engine=@orig_storage_engine;

--
-- Drop some tables not used anymore in MariaDB
--

drop table if exists mysql.ndb_binlog_index;
drop table if exists mysql.host;
mysql.server000075500000030611150343472770007161 0ustar00#!/bin/sh
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind

# MariaDB daemon start/stop script.

# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.

# Comments to support chkconfig on Red Hat Linux
# chkconfig: 2345 64 36
# description: A very fast and reliable SQL database engine.

# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop MariaDB
# Description: MariaDB is a very fast and reliable SQL database engine.
### END INIT INFO

# have to do one of the following things for this script to work:
#
# - Run this script from within the MariaDB installation directory
# - Create a /etc/my.cnf file with the following information:
#   [mysqld]
#   basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
#   and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
#   below.
#
# If you want to affect other MariaDB variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MariaDB configuration files.

# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MariaDB configuration files.

basedir=
datadir=

# Default value, in seconds, afterwhich the script should timeout waiting
# for server start.
# Value here is overridden by value in my.cnf.
# 0 means don't wait at all
# Negative numbers mean to wait indefinitely
service_startup_timeout=900

# Lock directory for Red Hat / SuSE.
lockdir='/var/lock/subsys'
lock_file_path="$lockdir/mysql"

# The following variables are only set for letting mysql.server find things.

if [ -e /usr/share/lve/dbgovernor/utils/mysql_export ]; then
. /usr/share/lve/dbgovernor/utils/mysql_export
else
get_limit(){
    return
}
set_big_limit(){
    return
}
set_old_limit(){
    return
}
fi


# Set some defaults
mariadbd_pid_file_path=
if test -z "$basedir"
then
  basedir=/usr
  bindir=/usr/bin
  if test -z "$datadir"
  then
    datadir=/var/lib/mysql
  fi
  sbindir=/usr/sbin
  libexecdir=/usr/sbin
else
  bindir="$basedir/bin"
  if test -z "$datadir"
  then
    datadir="$basedir/data"
  fi
  sbindir="$basedir/sbin"
  if test -f "$basedir/bin/mariadbd"
  then
    libexecdir="$basedir/bin"
  else
    libexecdir="$basedir/libexec"
  fi
fi

# datadir_set is used to determine if datadir was set (and so should be
# *not* set inside of the --basedir= handler.)
datadir_set=

#
# Use LSB init script functions for printing messages, if possible
# Include non-LSB Red Hat init functions to make systemctl redirect work
init_functions="/etc/init.d/functions"
lsb_functions="/lib/lsb/init-functions"
if test -f $lsb_functions; then
  . $lsb_functions
fi

if test -f $init_functions; then
  . $init_functions
else
  log_success_msg()
  {
    echo " SUCCESS! $@"
  }
  log_failure_msg()
  {
    echo " ERROR! $@"
  }
fi

PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
export PATH

mode=$1    # start or stop

[ $# -ge 1 ] && shift

case `echo "testing\c"`,`echo -n testing` in
    *c*,-n*) echo_n=   echo_c=     ;;
    *c*,*)   echo_n=-n echo_c=     ;;
    *)       echo_n=   echo_c='\c' ;;
esac

parse_server_arguments() {
  for arg do
    val=`echo "$arg" | sed -e 's/^[^=]*=//'`
    case "$arg" in
      --basedir=*)  basedir="$val"
                    bindir="$basedir/bin"
		    if test -z "$datadir_set"; then
		      datadir="$basedir/data"
		    fi
		    sbindir="$basedir/sbin"
                    if test -f "$basedir/bin/mariadbd"
                    then
                      libexecdir="$basedir/bin"
                    else
                      libexecdir="$basedir/libexec"
                    fi
		    libexecdir="$basedir/libexec"
        ;;
      --datadir=*)  datadir="$val"
		    datadir_set=1
	;;
      --log-basename=*|--hostname=*|--loose-log-basename=*)
        mariadbd_pid_file_path="$val.pid"
	;;
      --pid-file=*) mariadbd_pid_file_path="$val" ;;
      --service-startup-timeout=*) service_startup_timeout="$val" ;;
      --user=*) user="$val"; ;;
    esac
  done
}

# Get arguments from the my.cnf file,
# the only group, which is read from now on is [mysqld]
if test -x "$bindir/my_print_defaults";  then
  print_defaults="$bindir/my_print_defaults"
else
  # Try to find basedir in /etc/my.cnf
  conf=/etc/my.cnf
  print_defaults=
  if test -r $conf
  then
    subpat='^[^=]*basedir[^=]*=\(.*\)$'
    dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
    for d in $dirs
    do
      d=`echo $d | sed -e 's/[ 	]//g'`
      if test -x "$d/bin/my_print_defaults"
      then
        print_defaults="$d/bin/my_print_defaults"
        break
      fi
    done
  fi

  # Hope it's in the PATH ... but I doubt it
  test -z "$print_defaults" && print_defaults="my_print_defaults"
fi

user='mysql'

su_kill() {
  if test "$USER" = "$user"; then
    kill $* >/dev/null 2>&1
  else
    su - $user -s /bin/sh -c "kill $*" >/dev/null 2>&1
  fi
}

#
# Read defaults file from 'basedir'.   If there is no defaults file there
# check if it's in the old (depricated) place (datadir) and read it from there
#

extra_args=""
if test -r "$basedir/my.cnf"
then
  extra_args="--defaults-extra-file= $basedir/my.cnf"
else
  if test -r "$datadir/my.cnf"
  then
    extra_args="--defaults-extra-file= $datadir/my.cnf"
  fi
fi

parse_server_arguments `$print_defaults $extra_args --mysqld mysql.server`
parse_server_arguments "$@"

# wait for the pid file to disappear
wait_for_gone () {
  pid="$1"           # process ID of the program operating on the pid-file
  pid_file_path="$2" # path to the PID file.

  i=0
  crash_protection="by checking again"

  while test $i -ne $service_startup_timeout ; do

    if su_kill -0 "$pid" ; then
      :  # the server still runs
    else
      if test ! -s "$pid_file_path"; then
        # no server process and no pid-file? great, we're done!
        log_success_msg
        return 0
      fi

      # pid-file exists, the server process doesn't.
      # it must've crashed, and mysqld_safe will restart it
      if test -n "$crash_protection"; then
        crash_protection=""
        sleep 5
        continue  # Check again.
      fi

      # Cannot help it
      log_failure_msg "The server quit without updating PID file ($pid_file_path)."
      return 1  # not waiting any more.
    fi

    echo $echo_n ".$echo_c"
    i=`expr $i + 1`
    sleep 1

  done

  log_failure_msg
  return 1
}

wait_for_ready () {

  i=0
  while test $i -ne $service_startup_timeout ; do

    if $bindir/mysqladmin ping >/dev/null 2>&1; then
      log_success_msg
      return 0
    elif kill -0 $! ; then
      :  # mysqld_safe is still running
    else
      # mysqld_safe is no longer running, abort the wait loop
      break
    fi

    echo $echo_n ".$echo_c"
    i=`expr $i + 1`
    sleep 1

  done

  log_failure_msg
  return 1
}
#
# Set pid file if not given
#
if test -z "$mariadbd_pid_file_path"
then
  mariadbd_pid_file_path=$datadir/`uname -n`.pid
else
  case "$mariadbd_pid_file_path" in
    /* ) ;;
    * )  mariadbd_pid_file_path="$datadir/$mariadbd_pid_file_path" ;;
  esac
fi

# source other config files
[ -f /etc/default/mysql ] && . /etc/default/mysql
[ -f /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql
[ -f /etc/conf.d/mysql ] && . /etc/conf.d/mysql

case "$mode" in
  'start')
    # Start daemon

    # Safeguard (relative paths, core dumps..)
    cd $basedir

    echo $echo_n "Starting MariaDB"
    if test -x $bindir/mysqld_safe
    then
      # Give extra arguments to mysqld with the my.cnf file. This script
      # may be overwritten at next upgrade.
      $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mariadbd_pid_file_path" "$@" &
      wait_for_ready; return_value=$?

      # Make lock for Red Hat / SuSE
      if test -w "$lockdir"
      then
        touch "$lock_file_path"
      fi

      exit $return_value
    else
      log_failure_msg "Couldn't find MariaDB server ($bindir/mysqld_safe)"
    fi
    ;;

  'stop')
    # Stop daemon. We use a signal here to avoid having to know the
    # root password.
    get_limit
    set_big_limit
    sleep 2

    if test -s "$mariadbd_pid_file_path"
    then
      mariadbd_pid=`cat "$mariadbd_pid_file_path"`

      if su_kill -0 $mariadbd_pid ; then
        echo $echo_n "Shutting down MariaDB"
        su_kill $mariadbd_pid
        # mysqld should remove the pid file when it exits, so wait for it.
        wait_for_gone $mariadbd_pid "$mariadbd_pid_file_path"; return_value=$?
      else
        log_failure_msg "MariaDB server process #$mariadbd_pid is not running!"
        rm "$mariadbd_pid_file_path"
      fi

      # Delete lock for Red Hat / SuSE
      if test -f "$lock_file_path"
      then
        rm -f "$lock_file_path"
      fi
      set_old_limit
      exit $return_value
    else
      log_failure_msg "MariaDB server PID file could not be found!"
    fi
    set_old_limit
    ;;

  'restart')
    # Stop the service and regardless of whether it was
    # running or not, start it again.
    if $0 stop  "$@"; then
      if ! $0 start "$@"; then
        log_failure_msg "Failed to restart server."
        exit 1
      fi
    else
      log_failure_msg "Failed to stop running server, so refusing to try to start."
      exit 1
    fi
    ;;

  'reload'|'force-reload')
    get_limit
    set_big_limit
    sleep 2
    if test -s "$mariadbd_pid_file_path" ; then
      read mariadbd_pid <  "$mariadbd_pid_file_path"
      su_kill -HUP $mariadbd_pid && log_success_msg "Reloading service MariaDB"
      touch "$mariadbd_pid_file_path"
    else
      log_failure_msg "MariaDB PID file could not be found!"
      set_old_limit
      exit 1
    fi
    set_old_limit
    ;;
  'status')
    # First, check to see if pid file exists
    if test -s "$mariadbd_pid_file_path" ; then
      read mariadbd_pid < "$mariadbd_pid_file_path"
      if su_kill -0 $mariadbd_pid ; then
        log_success_msg "MariaDB running ($mariadbd_pid)"
        exit 0
      else
        log_failure_msg "MariaDB is not running, but PID file exists"
        exit 1
      fi
    else
      # Try to find appropriate mariadbd process
      mariadbd_pid=`pgrep -f $libexecdir/mariadbd`

      # test if multiple pids exist
      pid_count=`echo $mariadbd_pid | wc -w`
      if test $pid_count -gt 1 ; then
        log_failure_msg "Multiple MariaDB running but PID file could not be found ($mariadbd_pid)"
        exit 5
      elif test -z $mariadbd_pid ; then
        if test -f "$lock_file_path" ; then
          log_failure_msg "MariaDB is not running, but lock file ($lock_file_path) exists"
          exit 2
        fi
        log_failure_msg "MariaDB is not running"
        exit 3
      else
        log_failure_msg "MariaDB is running but PID file could not be found"
        exit 4
      fi
    fi
    ;;
  'configtest')
    # Safeguard (relative paths, core dumps..)
    cd $basedir
    echo $echo_n "Testing MariaDB configuration syntax"
    daemon=$bindir/mariadbd
    if test -x $libexecdir/mariadbd
    then
      daemon=$libexecdir/mariadbd
    elif test -x $sbindir/mariadbd
    then
      daemon=$sbindir/mariadbd
    elif test -x `which mariadbd`
    then
      daemon=`which mariadbd`
    else
      log_failure_msg "Unable to locate the mariadbd binary!"
      exit 1
    fi
    help_out=`$daemon --help 2>&1`; r=$?
    if test "$r" != 0 ; then
      log_failure_msg "$help_out"
      log_failure_msg "There are syntax errors in the server configuration. Please fix them!"
    else
      log_success_msg "Syntax OK"
    fi
    exit $r
    ;;
  'bootstrap')
      if test "$_use_systemctl" == 1 ; then
        log_failure_msg "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster"
        exit 1
      fi
      # Bootstrap the cluster, start the first node
      # that initiate the cluster
      echo $echo_n "Bootstrapping the cluster.. "
      $0 start $other_args --wsrep-new-cluster
      exit $?
      ;;
  *)
      # usage
      basename=`basename "$0"`
      echo "Usage: $basename  {start|stop|restart|reload|force-reload|status|configtest|bootstrap}  [ MariaDB server options ]"
      exit 1
    ;;
esac

exit 0
hindi/errmsg.sys000064400000256245150343472770007730 0ustar00���Ro�!�=�

DAJ����Q^dgAJ@]`���K]e]\OC�DH��(>@=,�mlxf @3I*O2F18:p[;2E^7$hK,���V��
*2�'`.����Er<���W`+@N,sH;3/06xgCbG�d5+�-�vAxRm$H9'T�jT/�2L33rB;P\xCU��DV@TS3ZId`dc\w|X2vd>J�Oo�fT8w=>@BBV#73_D<I>�iLSq6��7zFCE<iJC�+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*�A/CG-T��XG�=!A2o;R4RU5,y.E))2%D,58*K>'<os�� =.K"!-6$4A0F-"(-7:BP7&"5%/4ANH�<28,{/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*x!!A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/;;6MX>38}<K;+(=D Q)@W?$�`L�7'52;Pi?,4!D4%�2�C>>?+8|�80f;)%,6%45-&1Z)/"@I+1%#3>n'l4422m
 (6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;[;77_UI;3;!7Jq9BM7EFLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�"i,g"�94a9JlEH]9��b`C6:?M0v/JB4>4,:.�[�`U>M`Z-<?+.A^@�D���Udu/==NHKL�L_>3;��xw/^C�B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkनहींहाँफ़ाइल '%-.200s' नहीं बन सका (errno: %M)टेबल '%`s.%`s' नहीं बन सका (errno: %M)डेटाबेस '%-.192s' नहीं बन सका (errno: %M)डेटाबेस '%-.192s' नहीं बन सकता है; यह डेटाबेस पहले से ही मौजूद हैडेटाबेस '%-.192s' ड्रॉप नहीं कर सकते हैं; यह डेटाबेस मौजूद नहीं हैडेटाबेस ड्रॉप में त्रुटि हुई ('%-.192s' हटा नहीं सकते, errno: %M)डेटाबेस ड्रॉप में त्रुटि हुई ('%-.192s' rmdir नहीं कर सकते, errno: %M)'%-.192s' के हटाने पर त्रुटि हुई (errno: %M)सिस्टम टेबल से रिकॉर्ड नहीं पढ़ सके'%-.200s' की अवस्था प्राप्त नहीं कर सके (errno: %M)Working डाइरेक्टरी प्राप्त नहीं कर सके (errno: %M)फ़ाइल लॉक नहीं कर सके (errno: %M)फ़ाइल '%-.200s' नहीं खोल सकते (errno: %M)फ़ाइल '%-.200s' नहीं मिला (errno: %M)'%-.192s' की डायरेक्टरी नहीं पढ़ सके (errno: %M)'%-.192s' डायरेक्टरी में नहीं बदल सके (errno: %M)रिकॉर्ड टेबल '%-.192s' पिछली बार पढ़े जाने के बाद से बदल गया हैडिस्क पूरी तरह से भरा हुआ है (%s); कुछ स्थान खाली करें (errno: %M)टेबल '%-.192s' में DUPLICATE KEY मौजूद होने के कारण नहीं लिख सके'%-.192s' के बंद पर त्रुटि हुई (errno: %M)फ़ाइल '%-.200s' पढ़ने में त्रुटि हुई (errno: %M)'%-.210s' का नाम '%-.210s' बदलने पर त्रुटि हुई (errno: %M)फ़ाइल '%-.200s' लिखने में त्रुटि हुई (errno: %M)फ़ाइल '%-.192s' में कोई बदलाव नहीं कर सकतेSORT निरस्तVIEW '%-.192s', '%-.192s' के लिए मौजूद नहीं है%M त्रुटि %s स्टोरेज इंजन सेस्टोरेज इंजन %s में यह विकल्प उपलब्ध नहीं है (टेबल: %`s.%`s)'%-.192s' में रिकॉर्ड नहीं मिलाफ़ाइल '%-.200s' में गलत जानकारी हैटेबल '%-.200s' का इंडेक्स CORRUPT हो गया है; इसे REPAIR करने की कोशिश करेंटेबल '%-.192s' के लिए पुरानी KEY फ़ाइल; इसे REPAIR करने की कोशिश करेंटेबल '%-.192s' READ-ONLY हैOut of memory; restart server and try again (needed %d bytes)Out of sort memory, consider increasing server sort buffer sizeUnexpected EOF found when reading file '%-.192s' (errno: %M)अत्यधिक कनेक्शनOut of memory.आपके I.P. ऐड्रेस के लिए होस्टनेम प्राप्त करने में विफल रहेसंपर्क स्थापित करते समय त्रुटि हुई (BAD HANDSHAKE)यूज़र '%s'@'%s' को डेटाबेस '%-.192s' की अनुमति नहीं हैयूज़र '%s'@'%s' को अनुमति नहीं है (पासवर्ड का उपयोग: %s)किसी भी डेटाबेस का चयन नहीं किया गया हैअज्ञात आदेशकाँलम '%-.192s' NULL नहीं हो सकताअज्ञात डाटाबेस '%-.192s'टेबल '%-.192s' पहले से ही मौजूद हैअज्ञात टेबल '%-.100T'काँलम '%-.192s' अस्पष्ट है (टेबल: %-.192s)सर्वर बंद हो रहा हैअज्ञात काँलम '%-.192s'(टेबल: '%-.192s')'%-.192s' GROUP BY में नहीं है'%-.192s' पर GROUP नहीं कर सकतेStatement has sum functions and columns in same statementकॉलम की गिनती मूल्य की गिनती के समान नही हैपहचानकर्ता का नाम '%-.100T' बहुत लंबा हैसमान कॉलम '%-.192s' मौजूद हैसमान KEY '%-.192s' मौजूद हैसामान प्रवेश '%-.192T' KEY %d के लिएकॉलम '%-.192s' के लिए गलत कॉलम विनिर्देशक%s के पास '%-.80T' लाइन %d मेंक्वेरी खली थीटेबल या उसका उपनाम '%-.192s' अद्वितीय नहीं है'%-.192s' के लिए अवैध डिफ़ॉल्ट मानकई PRIMARY KEY परिभाषितबहुत सारी KEYS निर्दिष्ट हैं; अधिकतम %d KEYS की अनुमति हैबहुत सारे KEY के भाग निर्दिष्ट हैं; अधिकतम %d भागों की अनुमति हैनिर्दिष्ट KEY बहुत लंबी थी; KEY की अधिकतम लंबाई %d बाइट हैKEY कॉलम '%-.192s' टेबल में मौजूद नहीं हैBLOB कॉलम %`s टेबल %s में KEY विनिर्देश में इस्तेमाल नहीं किया जा सकताकॉलम की लंबाई कॉलम '%-.192s' के लिए बड़ी है (अधिकतम = %lu); BLOB या TEXT का उपयोग करेंगलत टेबल परिभाषा; टेबल में केवल एक AUTO_INCREMENT कॉलम हो सकता है और इसे एक KEY के रूप में परिभाषित किया जाना चाहिएCould not delete gtid domain. Reason: %s.%s (%s): सामान्य शटडाउन%s: सिग्नल %d मिलने के कारण सिस्टम बंद किया जा रहा है!%s: शटडाउन पूर्ण%s: %ld थ्रेड बंद किया जा रहा है (यूज़र: '%-.48s')IP SOCKET नहीं बना सकतेCREATE INDEX में इस्तेमाल की गयी सूचि टेबल '%-.192s' में उपलब्ध नहीं है; टेबल को पुनः बनायेंफील्ड विभाजक आर्गुमेंट गलत है; मैनुअल की जाँच करेंBLOBs को निश्चित लंबाई की पंक्ति के साथ प्रयोग नहीं किया जा सकता है; 'FIELDS TERMINATED BY' का इस्तेमाल करेंफ़ाइल '%-.128s' डेटाबेस डायरेक्टरी में या सभी के द्वारा पठनीय होना चाहिएफ़ाइल '%-.200s' पहले से मौजूद हैरिकॉर्ड: %ld हटाए गए: %ld छोड़ दिए गए: %ld चेतावनी: %ldरिकॉर्ड: %ld डुप्लिकेट: %ldIncorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keysALTER TABLE का इस्तेमाल कर सभी कॉलम्स को हटाया नहीं जा सकता; DROP TABLE का इस्तेमाल करें%s %`-.192s को ड्रॉप नहीं कर सकते हैं; कृपया जाँच करें कि यह मौजूद हैरिकॉर्ड: %ld डुप्लिकेट: %ld चेतावनी: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataअज्ञात थ्रेड ID: %luआप थ्रेड %lld के OWNER नहीं हैंकोई टेबल का इस्तेमाल नहीं हुआToo many strings for column %-.192s and SETएक अनूठा लॉग-फ़ाइल नाम %-.200s.(1-999) उत्पन्न नहीं कर सकेटेबल '%-.192s' READ लॉक से बंद है और उसे बदल नहीं सकतेटेबल '%-.192s' LOCK TABLES से बंद नहीं हैYou should never see itडेटाबेस नाम '%-.100T' गलत हैटेबल  नाम '%-.100s' गलत हैSELECT कमांड MAX_JOIN_SIZE पंक्तियों से भी ज्यादा की जांच करेगा; कृपया WHERE क्लॉज़ को जाचें अथवा SET SQL_BIG_SELECTS=1 या SET MAX_JOIN_SIZE=# का इस्तेमाल करेंअज्ञात त्रुटि हुईअज्ञात प्रोसीजर '%-.192s'प्रोसीजर '%-.192s' के लिए पैरामीटर की संख्या गलत हैप्रोसीजर '%-.192s' के लिए पैरामीटर्स गलत हैंटेबल '%-.192s', %-.32s में नहीं मिलाकॉलम '%-.192s' दो बार निर्दिष्ट किया गया हैग्रुप फंक्शन का अवैध उपयोगटेबल '%-.192s' जिस इक्स्टेन्शन का उपयोग कर रहा है, वह इस MariaDB संस्करण में उपलब्ध नहीं हैएक टेबल में कम से कम एक कॉलम होना चाहिएटेबल '%-.192s' पूरा भरा हैअज्ञात CHARACTER SET: '%-.64s'बहुत अधिक टेबल्स, MariaDB एक JOIN में केवल %d टेबल्स का उपयोग कर सकता हैबहुत अधिक कॉलम्सRow size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBsThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededCross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerफंक्शन '%-.192s' लोड नहीं किया जा सकाफंक्शन '%-.192s' को प्रारंभ नहीं किया जा सका; %-.80sNo paths allowed for shared libraryफंक्शन '%-.192s' पहले से मौजूद हैCan't open shared library '%-.192s' (errno: %d, %-.128s)Can't find symbol '%-.128s' in libraryफंक्शन '%-.192s' की परिभाषा नहीं मिलीहोस्ट '%-.64s' को कई कनेक्शन में त्रुटियों के कारण ब्लॉक कर दिया गया है; 'mariadb-admin flush-hosts' का इस्तेमाल कर अनब्लॉक करेंहोस्ट '%-.64s' को इस MariaDB सर्वर से कनेक्ट करने के लिए अनुमति नहीं हैआप MariaDB का उपयोग एक बेनाम यूज़र की तरह कर रहे हैं; बेनाम यूज़र्स को 'यूज़र सेटिंग्स' बदलने की अनुमति नहीं हैYou must have privileges to update tables in the mysql database to be able to change passwords for othersयूज़र टेबल में रिकॉर्ड नहीं मिलाRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bugColumn count doesn't match value count at row %luटेबल '%-.192s' फिर से खोल नहीं सकतेNULL मान का अवैध उपयोगregexp में '%s' त्रुटि हुईMixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be usedGRANT के लिए होस्ट या यूज़र आर्गुमेंट बहुत लंबा हैटेबल '%-.192s.%-.192s' मौजूद नहीं हैThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'यह कमांड इस MariaDB संस्करण के साथ इस्तेमाल नहीं किया जा सकता हैआपके SQL सिंटेक्स मैं गलती है; सही सिंटेक्स के लिए अपने MariaDB सर्वर संस्करण के मैन्युअल की सहायता लेंDelayed insert thread couldn't get requested lock for table %-.192sबहुत से DELAYED थ्रेड्स उपयोग में हैंAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)'max_allowed_packet' से भी बड़ा एक पैकेट मिलाकनेक्शन पाइप से एक READ त्रुटि हुईfcntl() से एक त्रुटि हुईपैकेट्स क्रम में नहीं प्राप्त हुएसंचार पैकेट UNCOMPRESS नहीं कर सकेसंचार पैकेट्स पढ़ते समय एक त्रुटि हुईसंचार पैकेट्स पढ़ने के दौरान टाइमआउटसंचार पैकेट्स लिखते समय एक त्रुटि हुईसंचार पैकेट्स लिखने के दौरान टाइमआउटरिजल्ट स्ट्रिंग 'max_allowed_packet' से लंबा हैस्टोरेज इंजन %s BLOB/TEXT कॉलम्स को सपोर्ट नहीं करतास्टोरेज इंजन %s AUTO_INCREMENT कॉलम्स को सपोर्ट नहीं करताINSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLESकॉलम नाम '%-.100s' गलत हैस्टोरेज इंजन %s, कॉलम %`s को इंडेक्स नहीं कर सकताUnable to open underlying table which is differently defined or of non-MyISAM type or doesn't existCan't write, because of unique constraint, to table '%-.192s'BLOB/TEXT column '%-.192s' used in key specification without a key lengthPRIMARY KEY के सभी भागों को NOT NULL होना चाहिए; यदि आपको एक KEY में NULL की जरूरत है, तो UNIQUE का उपयोग करेंपरिणाम एक से अधिक पंक्ति का हैइस प्रकार के टेबल को एक PRIMARY KEY की आवश्यकता हैMariaDB का यह संस्करण RAID सपोर्ट के साथ कॉम्पाईल्ड नहीं हैYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKEY '%-.192s', टेबल '%-.192s' में मौजूद नहीं हैटेबल नहीं खुल सकता हैइस टेबल का स्टोरेज इंजन '%s' को सपोर्ट नहीं करताYou are not allowed to execute this command in a transactionCOMMIT के दौरान %M त्रुटि हुईROLLBACK के दौरान %M त्रुटि हुईFLUSH_LOGS के दौरान %M त्रुटि हुईCHECKPOINT के दौरान %M त्रुटि हुईAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionअज्ञात सिस्टम वैरिएबल '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesयूज़र %-.64s के पहले से ही 'max_user_connections' से अधिक सक्रिय कनेक्शन्स हैंइस स्टेटमेंट में आप केवल CONSTANT EXPRESSIONS का उपयोग कर सकते हैंLock wait timeout exceeded; try restarting transactionलॉक्स की कुल संख्या लॉक टेबल के साइज से अधिक हैUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lock%s को गलत आर्ग्यूमेंट्स'%s'@'%s' को नए यूज़र्स बनाने की अनुमति नहीं हैIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionस्टोरेज इंजन '%s' FULLTEXT इन्डेक्सेस को सपोर्ट नहीं करताCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luस्टोरेज इंजन %s का इस्तेमाल टेबल '%s' के लिए  किया जा रहा हैIllegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workअज्ञात स्टोरेज इंजन '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s पहले से ही मौजूद है%s %s मौजूद नहीं है%s %s को ड्रॉप करने में असफल रहे%s %s को बनाने में असफल रहे%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN को केवल FUNCTION में इस्तेमाल किया जा सकता है%s को STORED PROCEDURE में इस्तेमाल नहीं किया जा सकता हैThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sFUNCTION %s में कोई RETURN हैFUNCTION %s RETURN के बिना समाप्त हो गयाCursor statement must be a SELECTCursor SELECT must not have INTOCURSOR %s अपरिभाषित हैCURSOR पहले से ही खुला हैCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %s%s %s को ALTER करने में असफल रहेSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTRIGGER '%s' पहले से मौजूद हैTRIGGER मौजूद नहीं हैTrigger का '%-.192s' एक व्यू, टेम्पररी टेबल या सीक्वेंस हैUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default value0 से विभाजनIncorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgefseek() विफल रहाFatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'स्टोरेज इंजन से auto-increment का मान पढ़ने में असफल रहेयूज़र का नामहोस्ट का नामString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than once%s को बनाने में असफल रहे%s को हटाने में असफल रहेThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billion%s को ALTER करने में असफल रहेWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s''%-.192s' EVENT को ALTER करने में असफल रहे%s को हटाने में असफल रहेINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledmysql.event को खोलने में असफल रहेNo datetime expression providedYou should never see itYou should never see itEVENT को mysql.event से हटाने मैं असफल रहेError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itअस्थाई टेबल को पार्टिशन्स के साथ नहीं बनाया जा सकताPartition constant is out of partition function domainThis partition function is not allowedDDL लॉग में त्रुटि हुईNot allowed to use NULL value in VALUES LESS THANपार्टीशन का नाम गलत हैTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereस्टोरेज इंजन %s को लॉग टेबल्स के लिए इस्तेमाल नहीं किया जा सकता हैYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDuplicate entry '%-.64T' for key '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %s%s को बनाने मैं असफल रहेMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manualडेटाबेसटेबलपार्टीशनसब-पार्टीशनअस्थायीRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transaction%.64T के लिए निर्दिष्ट पथ बहुत लंबा है'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureperformance_schema का अवैध उपयोगTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or trigger.par फ़ाइल से पढ़ने में असफल रहेVALUES value for partition '%-.64s' must have type INTयूज़र '%s'@'%s' को अनुमति नहीं हैSET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDuplicate entry for key '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB केवल READ-ONLY मोड में हैSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see itस्टोरेज इंजन %s COMPUTED कॉलम्स को सपोर्ट नहीं करताअज्ञात विकल्प '%-.64s'गलत मान '%-.64T' विकल्प '%-.64s' के लिएYou should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setकम से कम 'in_to_exists' या 'materialization' optimizer_switch फ्लैग 'ON' होना चाहिएQuery cache is disabled (resize or similar command in progress); repeat this command laterक्वेरी कैश ग्लोबल स्तर पर DISABLED है और आप इसे केवल सत्र के लिए ENABLE नहीं कर सकतेView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyकनेक्शन को समाप्त कर दिया गया हैYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteटेबल '%-.192s.%-.192s' इंजन में मौजूद नहीं हैTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logअज्ञात क्वेरी ID: %lldBad base64 data as position %uअमान्य रोल विनिर्देश %`sवर्तमान यूज़र अमान्य हैरोल '%s', %s को प्रदान नहीं कर सकतेरोल '%s', %s से हटाया नहीं जा सकाCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' एक VIEW हैWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionटेबल %`s की परिभाषा बहुत बड़ी हैप्लग-इन '%-.192s' पहले से ही इन्स्टॉल्ड हैQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itयूज़र '%-.64s'@'%-.64s' को नहीं बना सकते; यह पहले से ही मौजूद हैयूज़र '%-.64s'@'%-.64s' को ड्रॉप नहीं कर सकते; यह मौजूद नहीं हैरोल '%-.64s' को नहीं बना सकते; यह पहले से ही मौजूद हैरोल '%-.64s' को ड्रॉप नहीं कर सकते; यह मौजूद नहीं हैCannot convert '%s' character 0x%-.64s to '%s'गलत डिफ़ॉल्ट मान '%-.128T' कॉलम '%.192s' के लिएआप क्वेरी %lld के OWNER नहीं हैंEngine-independent सांख्यिकी कॉलम '%s' के लिए एकत्रित नहीं किया जा रहा हैAggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmysql_sys_schema.sql000064400002272311150343472770010674 0ustar00-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

SET NAMES utf8;
SET @sql_log_bin = @@sql_log_bin;
SET sql_log_bin = 0;

CREATE DATABASE IF NOT EXISTS sys DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;

-- If the database had existed, let's recreate its db.opt:
-- * to fix it if it contained unexpected charset/collation values
-- * to create it if it was removed in a mistake
ALTER DATABASE sys CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;

USE sys;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: version
--
-- Shows the sys schema and mysql versions
--
-- mysql> select * from sys.version;
-- +-------------+---------------+
-- | sys_version | mysql_version |
-- +-------------+---------------+
-- | 1.5.0       | 5.7.8-rc      |
-- +-------------+---------------+
-- 

CREATE OR REPLACE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW version (
  sys_version,
  mysql_version
) AS 
SELECT '1.5.1' AS sys_version, 
        version() AS mysql_version;
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- Table: sys_config
--
-- Stores configuration options for sys objects
--

CREATE TABLE IF NOT EXISTS sys_config (
    variable VARCHAR(128) PRIMARY KEY,
    value VARCHAR(128),
    set_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    set_by VARCHAR(128)
) ENGINE = Aria;



-- Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

-- NOTE: This needs to be replicated within the sys_config_clean.inc file

INSERT IGNORE INTO sys.sys_config (variable, value) VALUES
    ('statement_truncate_len', 64),
    ('statement_performance_analyzer.limit', 100),
    ('statement_performance_analyzer.view', NULL),
    ('diagnostics.allow_i_s_tables', 'OFF'),
    ('diagnostics.include_raw', 'OFF'),
    ('ps_thread_trx_info.max_length', 65535);

FLUSH TABLES sys.sys_config;

-- Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- Trigger: sys_config_insert_set_user
--
-- Sets the user that inserts configuration
--
--

DROP TRIGGER IF EXISTS sys_config_insert_set_user;


-- Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- Trigger: sys_config_update_set_user
--
-- Sets the user that updates configuration
--
--


DROP TRIGGER IF EXISTS sys_config_update_set_user;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS extract_schema_from_file_name;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION extract_schema_from_file_name (
        path VARCHAR(512)
    )
    RETURNS VARCHAR(64) 
    COMMENT '
             Description
             -----------

             Takes a raw file path, and attempts to extract the schema name from it.

             Useful for when interacting with Performance Schema data 
             concerning IO statistics, for example.

             Currently relies on the fact that a table data file will be within a 
             specified database directory (will not work with partitions or tables
             that specify an individual DATA_DIRECTORY).

             Parameters
             -----------

             path (VARCHAR(512)):
               The full file path to a data file to extract the schema name from.

             Returns
             -----------

             VARCHAR(64)

             Example
             -----------

             mysql> SELECT sys.extract_schema_from_file_name(\'/var/lib/mysql/employees/employee.ibd\');
             +----------------------------------------------------------------------------+
             | sys.extract_schema_from_file_name(\'/var/lib/mysql/employees/employee.ibd\') |
             +----------------------------------------------------------------------------+
             | employees                                                                  |
             +----------------------------------------------------------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
    RETURN LEFT(SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(path, '\\', '/'), '/', -2), '/', 1), 64);
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS extract_table_from_file_name;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION extract_table_from_file_name (
        path VARCHAR(512)
    )
    RETURNS VARCHAR(64) 
    COMMENT '
             Description
             -----------

             Takes a raw file path, and extracts the table name from it.

             Useful for when interacting with Performance Schema data 
             concerning IO statistics, for example.

             Parameters
             -----------

             path (VARCHAR(512)):
               The full file path to a data file to extract the table name from.

             Returns
             -----------

             VARCHAR(64)

             Example
             -----------

             mysql> SELECT sys.extract_table_from_file_name(\'/var/lib/mysql/employees/employee.ibd\');
             +---------------------------------------------------------------------------+
             | sys.extract_table_from_file_name(\'/var/lib/mysql/employees/employee.ibd\') |
             +---------------------------------------------------------------------------+
             | employee                                                                  |
             +---------------------------------------------------------------------------+
             1 row in set (0.02 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
    RETURN LEFT(SUBSTRING_INDEX(REPLACE(SUBSTRING_INDEX(REPLACE(path, '\\', '/'), '/', -1), '@0024', '$'), '.', 1), 64);
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS format_bytes;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION format_bytes (
        -- We feed in and return TEXT here, as aggregates of
        -- bytes can return numbers larger than BIGINT UNSIGNED
        bytes TEXT
    )
    RETURNS TEXT
    COMMENT '
             Description
             -----------

             Takes a raw bytes value, and converts it to a human readable format.

             Parameters
             -----------

             bytes (TEXT):
               A raw bytes value.

             Returns
             -----------

             TEXT

             Example
             -----------

             mysql> SELECT sys.format_bytes(2348723492723746) AS size;
             +----------+
             | size     |
             +----------+
             | 2.09 PiB |
             +----------+
             1 row in set (0.00 sec)

             mysql> SELECT sys.format_bytes(2348723492723) AS size;
             +----------+
             | size     |
             +----------+
             | 2.14 TiB |
             +----------+
             1 row in set (0.00 sec)

             mysql> SELECT sys.format_bytes(23487234) AS size;
             +-----------+
             | size      |
             +-----------+
             | 22.40 MiB |
             +-----------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
  IF bytes IS NULL THEN RETURN NULL;
  ELSEIF bytes >= 1125899906842624 THEN RETURN CONCAT(ROUND(bytes / 1125899906842624, 2), ' PiB');
  ELSEIF bytes >= 1099511627776 THEN RETURN CONCAT(ROUND(bytes / 1099511627776, 2), ' TiB');
  ELSEIF bytes >= 1073741824 THEN RETURN CONCAT(ROUND(bytes / 1073741824, 2), ' GiB');
  ELSEIF bytes >= 1048576 THEN RETURN CONCAT(ROUND(bytes / 1048576, 2), ' MiB');
  ELSEIF bytes >= 1024 THEN RETURN CONCAT(ROUND(bytes / 1024, 2), ' KiB');
  ELSE RETURN CONCAT(ROUND(bytes, 0), ' bytes');
  END IF;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS format_path;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION format_path (
        in_path VARCHAR(512)
    )
    RETURNS VARCHAR(512) CHARSET UTF8
    COMMENT '
             Description
             -----------

             Takes a raw path value, and strips out the datadir or tmpdir
             replacing with @@datadir and @@tmpdir respectively. 

             Also normalizes the paths across operating systems, so backslashes
             on Windows are converted to forward slashes

             Parameters
             -----------

             path (VARCHAR(512)):
               The raw file path value to format.

             Returns
             -----------

             VARCHAR(512) CHARSET UTF8

             Example
             -----------

             mysql> select @@datadir;
             +-----------------------------------------------+
             | @@datadir                                     |
             +-----------------------------------------------+
             | /Users/mark/sandboxes/SmallTree/AMaster/data/ |
             +-----------------------------------------------+
             1 row in set (0.06 sec)

             mysql> select format_path(\'/Users/mark/sandboxes/SmallTree/AMaster/data/mysql/proc.MYD\') AS path;
             +--------------------------+
             | path                     |
             +--------------------------+
             | @@datadir/mysql/proc.MYD |
             +--------------------------+
             1 row in set (0.03 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
  DECLARE v_dir VARCHAR(1024);
  DECLARE v_path VARCHAR(512);

  DECLARE path_separator CHAR(1) DEFAULT '/';

  IF @@global.version_compile_os LIKE 'win%' THEN
    SET path_separator = '\\';
  END IF;

  -- OSX hides /private/ in variables, but Performance Schema does not
  IF in_path LIKE '/private/%' THEN
    SET v_path = REPLACE(in_path, '/private', '');
  ELSE
    SET v_path = in_path;
  END IF;

  -- @@global.innodb_undo_directory is only set when separate undo logs are used
 
  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'innodb_data_home_dir'), '');
  
  IF v_path IS NULL THEN
    RETURN NULL;
  END IF;

  IF v_path LIKE CONCAT(@@global.datadir, IF(SUBSTRING(@@global.datadir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, @@global.datadir, CONCAT('@@datadir', IF(SUBSTRING(@@global.datadir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;

  IF v_path LIKE CONCAT(@@global.tmpdir, IF(SUBSTRING(@@global.tmpdir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, @@global.tmpdir, CONCAT('@@tmpdir', IF(SUBSTRING(@@global.tmpdir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;

  
  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'innodb_data_home_dir'), '');
  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, v_dir, CONCAT('@@innodb_data_home_dir', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;

  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'innodb_log_group_home_dir'), '');
  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, v_dir, CONCAT('@@innodb_log_group_home_dir', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;

  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'slave_load_tmpdir'), '');
  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, v_dir, CONCAT('@@slave_load_tmpdir', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;


  SET v_dir = IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'innodb_undo_directory'), '');
  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, v_dir, CONCAT('@@innodb_undo_directory', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;

  IF v_path LIKE CONCAT(@@global.basedir, IF(SUBSTRING(@@global.basedir, -1) = path_separator, '%', CONCAT(path_separator, '%'))) ESCAPE '|' THEN
    SET v_path = REPLACE(v_path, @@global.basedir, CONCAT('@@basedir', IF(SUBSTRING(@@global.basedir, -1) = path_separator, path_separator, '')));
    RETURN v_path;
  END IF;

  RETURN v_path;
END$$

DELIMITER ;
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS format_statement;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION format_statement (
        statement LONGTEXT
    )
    RETURNS LONGTEXT
    COMMENT '
             Description
             -----------

             Formats a normalized statement, truncating it if it is > 64 characters long by default.

             To configure the length to truncate the statement to by default, update the `statement_truncate_len`
             variable with `sys_config` table to a different value. Alternatively, to change it just for just 
             your particular session, use `SET @sys.statement_truncate_len := <some new value>`.

             Useful for printing statement related data from Performance Schema from 
             the command line.

             Parameters
             -----------

             statement (LONGTEXT): 
               The statement to format.

             Returns
             -----------

             LONGTEXT

             Example
             -----------

             mysql> SELECT sys.format_statement(digest_text)
                 ->   FROM performance_schema.events_statements_summary_by_digest
                 ->  ORDER by sum_timer_wait DESC limit 5;
             +-------------------------------------------------------------------+
             | sys.format_statement(digest_text)                                 |
             +-------------------------------------------------------------------+
             | CREATE SQL SECURITY INVOKER VI ... KE ? AND `variable_value` > ?  |
             | CREATE SQL SECURITY INVOKER VI ... ait` IS NOT NULL , `esc` . ... |
             | CREATE SQL SECURITY INVOKER VI ... ait` IS NOT NULL , `sys` . ... |
             | CREATE SQL SECURITY INVOKER VI ...  , `compressed_size` ) ) DESC  |
             | CREATE SQL SECURITY INVOKER VI ... LIKE ? ORDER BY `timer_start`  |
             +-------------------------------------------------------------------+
             5 rows in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
  -- Check if we have the configured length, if not, init it
  IF @sys.statement_truncate_len IS NULL THEN
      SET @sys.statement_truncate_len = sys_get_config('statement_truncate_len', 64);
  END IF;

  IF CHAR_LENGTH(statement) > @sys.statement_truncate_len THEN
      RETURN REPLACE(CONCAT(LEFT(statement, (@sys.statement_truncate_len/2)-2), ' ... ', RIGHT(statement, (@sys.statement_truncate_len/2)-2)), '\n', ' ');
  ELSE 
      RETURN REPLACE(statement, '\n', ' ');
  END IF;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS format_time;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION format_time (
        -- We feed in and return TEXT here, as aggregates of
        -- picoseconds can return numbers larger than BIGINT UNSIGNED
        picoseconds TEXT
    )
    RETURNS TEXT CHARSET UTF8
    COMMENT '
             Description
             -----------

             Takes a raw picoseconds value, and converts it to a human readable form.
             
             Picoseconds are the precision that all latency values are printed in 
             within Performance Schema, however are not user friendly when wanting
             to scan output from the command line.

             Parameters
             -----------

             picoseconds (TEXT): 
               The raw picoseconds value to convert.

             Returns
             -----------

             TEXT

             Example
             -----------

             mysql> select format_time(342342342342345);
             +------------------------------+
             | format_time(342342342342345) |
             +------------------------------+
             | 00:05:42                     |
             +------------------------------+
             1 row in set (0.00 sec)

             mysql> select format_time(342342342);
             +------------------------+
             | format_time(342342342) |
             +------------------------+
             | 342.34 us              |
             +------------------------+
             1 row in set (0.00 sec)

             mysql> select format_time(34234);
              +--------------------+
             | format_time(34234) |
             +--------------------+
             | 34.23 ns           |
             +--------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
  IF picoseconds IS NULL THEN RETURN NULL;
  ELSEIF picoseconds >= 604800000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 604800000000000000, 2), ' w');
  ELSEIF picoseconds >= 86400000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 86400000000000000, 2), ' d');
  ELSEIF picoseconds >= 3600000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 3600000000000000, 2), ' h');
  ELSEIF picoseconds >= 60000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 60000000000000, 2), ' m');
  ELSEIF picoseconds >= 1000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000000000, 2), ' s');
  ELSEIF picoseconds >= 1000000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000000, 2), ' ms');
  ELSEIF picoseconds >= 1000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000, 2), ' us');
  ELSEIF picoseconds >= 1000 THEN RETURN CONCAT(ROUND(picoseconds / 1000, 2), ' ns');
  ELSE RETURN CONCAT(picoseconds, ' ps');
  END IF;
END$$

DELIMITER ;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS list_add;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION list_add (
        in_list TEXT,
        in_add_value TEXT
    )
    RETURNS TEXT
    COMMENT '
             Description
             -----------

             Takes a list, and a value to add to the list, and returns the resulting list.

             Useful for altering certain session variables, like sql_mode or optimizer_switch for instance.

             Parameters
             -----------

             in_list (TEXT):
               The comma separated list to add a value to

             in_add_value (TEXT):
               The value to add to the input list

             Returns
             -----------

             TEXT

             Example
             --------

             mysql> select @@sql_mode;
             +-----------------------------------------------------------------------------------+
             | @@sql_mode                                                                        |
             +-----------------------------------------------------------------------------------+
             | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
             +-----------------------------------------------------------------------------------+
             1 row in set (0.00 sec)

             mysql> set sql_mode = sys.list_add(@@sql_mode, ''ANSI_QUOTES'');
             Query OK, 0 rows affected (0.06 sec)

             mysql> select @@sql_mode;
             +-----------------------------------------------------------------------------------------------+
             | @@sql_mode                                                                                    |
             +-----------------------------------------------------------------------------------------------+
             | ANSI_QUOTES,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
             +-----------------------------------------------------------------------------------------------+
             1 row in set (0.00 sec)

            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    CONTAINS SQL
BEGIN

    IF (in_add_value IS NULL) THEN
        SIGNAL SQLSTATE '02200'
           SET MESSAGE_TEXT = 'Function sys.list_add: in_add_value input variable should not be NULL',
               MYSQL_ERRNO = 1138;
    END IF;

    IF (in_list IS NULL OR LENGTH(in_list) = 0) THEN
        -- return the new value as a single value list
        RETURN in_add_value;
    END IF;

    RETURN (SELECT CONCAT(TRIM(BOTH ',' FROM TRIM(in_list)), ',', in_add_value));

END$$

DELIMITER ;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS list_drop;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION list_drop (
        in_list TEXT,
        in_drop_value TEXT
    )
    RETURNS TEXT
    COMMENT '
             Description
             -----------

             Takes a list, and a value to attempt to remove from the list, and returns the resulting list.

             Useful for altering certain session variables, like sql_mode or optimizer_switch for instance.

             Parameters
             -----------

             in_list (TEXT):
               The comma separated list to drop a value from

             in_drop_value (TEXT):
               The value to drop from the input list

             Returns
             -----------

             TEXT

             Example
             --------

             mysql> select @@sql_mode;
             +-----------------------------------------------------------------------------------------------+
             | @@sql_mode                                                                                    |
             +-----------------------------------------------------------------------------------------------+
             | ANSI_QUOTES,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
             +-----------------------------------------------------------------------------------------------+
             1 row in set (0.00 sec)

             mysql> set sql_mode = sys.list_drop(@@sql_mode, ''ONLY_FULL_GROUP_BY'');
             Query OK, 0 rows affected (0.03 sec)

             mysql> select @@sql_mode;
             +----------------------------------------------------------------------------+
             | @@sql_mode                                                                 |
             +----------------------------------------------------------------------------+
             | ANSI_QUOTES,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
             +----------------------------------------------------------------------------+
             1 row in set (0.00 sec)

            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    CONTAINS SQL
BEGIN

    IF (in_drop_value IS NULL) THEN
        SIGNAL SQLSTATE '02200'
           SET MESSAGE_TEXT = 'Function sys.list_drop: in_drop_value input variable should not be NULL',
               MYSQL_ERRNO = 1138;
    END IF;

    IF (in_list IS NULL OR LENGTH(in_list) = 0) THEN
        -- return the list as it was passed in
        RETURN in_list;
    END IF;

    -- ensure that leading / trailing commas are remove, support values with either spaces or not between commas
    RETURN (SELECT TRIM(BOTH ',' FROM REPLACE(REPLACE(CONCAT(',', in_list), CONCAT(',', in_drop_value), ''), CONCAT(', ', in_drop_value), '')));

END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_is_account_enabled;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_is_account_enabled (
        in_host VARCHAR(60), 
        in_user VARCHAR(16)
    ) 
    RETURNS ENUM('YES', 'NO')
    COMMENT '
             Description
             -----------

             Determines whether instrumentation of an account is enabled 
             within Performance Schema.

             Parameters
             -----------

             in_host VARCHAR(60): 
               The hostname of the account to check.
             in_user (VARCHAR(16)):
               The username of the account to check.

             Returns
             -----------

             ENUM(\'YES\', \'NO\', \'PARTIAL\')

             Example
             -----------

             mysql> SELECT sys.ps_is_account_enabled(\'localhost\', \'root\');
             +------------------------------------------------+
             | sys.ps_is_account_enabled(\'localhost\', \'root\') |
             +------------------------------------------------+
             | YES                                            |
             +------------------------------------------------+
             1 row in set (0.01 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC 
    READS SQL DATA 
BEGIN
    RETURN IF(EXISTS(SELECT 1
                       FROM performance_schema.setup_actors
                      WHERE (`HOST` = '%' OR in_host LIKE `HOST`)
                        AND (`USER` = '%' OR `USER` = in_user)
                    ),
              'YES', 'NO'
           );
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_is_consumer_enabled;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_is_consumer_enabled (
        in_consumer varchar(64)
   )
   RETURNS enum('YES', 'NO')
    COMMENT '
             Description
             -----------

             Determines whether a consumer is enabled (taking the consumer hierarchy into consideration)
             within the Performance Schema.

             Parameters
             -----------

             in_consumer VARCHAR(64): 
               The name of the consumer to check.

             Returns
             -----------

             ENUM(\'YES\', \'NO\')

             Example
             -----------

             mysql> SELECT sys.ps_is_consumer_enabled(\'events_stages_history\');
             +-----------------------------------------------------+
             | sys.ps_is_consumer_enabled(\'events_stages_history\') |
             +-----------------------------------------------------+
             | NO                                                  |
             +-----------------------------------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC 
    READS SQL DATA 
BEGIN
    RETURN (
        SELECT (CASE
                   WHEN c.NAME = 'global_instrumentation' THEN c.ENABLED
                   WHEN c.NAME = 'thread_instrumentation' THEN IF(cg.ENABLED = 'YES' AND c.ENABLED = 'YES', 'YES', 'NO')
                   WHEN c.NAME LIKE '%\_digest'           THEN IF(cg.ENABLED = 'YES' AND c.ENABLED = 'YES', 'YES', 'NO')
                   WHEN c.NAME LIKE '%\_current'          THEN IF(cg.ENABLED = 'YES' AND ct.ENABLED = 'YES' AND c.ENABLED = 'YES', 'YES', 'NO')
                   ELSE IF(cg.ENABLED = 'YES' AND ct.ENABLED = 'YES' AND c.ENABLED = 'YES'
                           AND ( SELECT cc.ENABLED FROM performance_schema.setup_consumers cc WHERE NAME = CONCAT(SUBSTRING_INDEX(c.NAME, '_', 2), '_current')
                               ) = 'YES', 'YES', 'NO')
                END) AS IsEnabled
          FROM performance_schema.setup_consumers c
               INNER JOIN performance_schema.setup_consumers cg
               INNER JOIN performance_schema.setup_consumers ct
         WHERE cg.NAME       = 'global_instrumentation'
               AND ct.NAME   = 'thread_instrumentation'
               AND c.NAME    = in_consumer
       );
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_is_instrument_default_enabled;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_is_instrument_default_enabled (
        in_instrument VARCHAR(128)
    ) 
    RETURNS ENUM('YES', 'NO')
    COMMENT '
             Description
             -----------

             Returns whether an instrument is enabled by default in this version of MySQL.

             Parameters
             -----------

             in_instrument VARCHAR(128): 
               The instrument to check.

             Returns
             -----------

             ENUM(\'YES\', \'NO\')

             Example
             -----------

             mysql> SELECT sys.ps_is_instrument_default_enabled(\'statement/sql/select\');
             +--------------------------------------------------------------+
             | sys.ps_is_instrument_default_enabled(\'statement/sql/select\') |
             +--------------------------------------------------------------+
             | YES                                                          |
             +--------------------------------------------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC 
    READS SQL DATA 
BEGIN
    DECLARE v_enabled ENUM('YES', 'NO');

    -- Currently the same in all versions
    SET v_enabled = IF(in_instrument LIKE 'wait/io/file/%'
                        OR in_instrument LIKE 'wait/io/table/%'
                        OR in_instrument LIKE 'statement/%'
                        OR in_instrument LIKE 'memory/performance_schema/%'
                        OR in_instrument IN ('wait/lock/table/sql/handler', 'idle')
               /*!50707
                        OR in_instrument LIKE 'stage/innodb/%'
                        OR in_instrument = 'stage/sql/copy to tmp table'
               */
                      ,
                       'YES',
                       'NO'
                    );

    RETURN v_enabled;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_is_instrument_default_timed;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_is_instrument_default_timed (
        in_instrument VARCHAR(128)
    ) 
    RETURNS ENUM('YES', 'NO')
    COMMENT '
             Description
             -----------

             Returns whether an instrument is timed by default in this version of MySQL.

             Parameters
             -----------

             in_instrument VARCHAR(128): 
               The instrument to check.

             Returns
             -----------

             ENUM(\'YES\', \'NO\')

             Example
             -----------

             mysql> SELECT sys.ps_is_instrument_default_timed(\'statement/sql/select\');
             +------------------------------------------------------------+
             | sys.ps_is_instrument_default_timed(\'statement/sql/select\') |
             +------------------------------------------------------------+
             | YES                                                        |
             +------------------------------------------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC 
    READS SQL DATA 
BEGIN
    DECLARE v_timed ENUM('YES', 'NO');

    -- Currently the same in all versions
    SET v_timed = IF(in_instrument LIKE 'wait/io/file/%'
                        OR in_instrument LIKE 'wait/io/table/%'
                        OR in_instrument LIKE 'statement/%'
                        OR in_instrument IN ('wait/lock/table/sql/handler', 'idle')
               /*!50707
                        OR in_instrument LIKE 'stage/innodb/%'
                        OR in_instrument = 'stage/sql/copy to tmp table'
               */
                      ,
                       'YES',
                       'NO'
                    );

    RETURN v_timed;
END$$

DELIMITER ;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_is_thread_instrumented;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_is_thread_instrumented (
        in_connection_id BIGINT UNSIGNED
    ) RETURNS ENUM('YES', 'NO', 'UNKNOWN')
    COMMENT '
             Description
             -----------

             Checks whether the provided connection id is instrumented within Performance Schema.

             Parameters
             -----------

             in_connection_id (BIGINT UNSIGNED):
               The id of the connection to check.

             Returns
             -----------

             ENUM(\'YES\', \'NO\', \'UNKNOWN\')

             Example
             -----------

             mysql> SELECT sys.ps_is_thread_instrumented(CONNECTION_ID());
             +------------------------------------------------+
             | sys.ps_is_thread_instrumented(CONNECTION_ID()) |
             +------------------------------------------------+
             | YES                                            |
             +------------------------------------------------+
            '

    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    DECLARE v_enabled ENUM('YES', 'NO', 'UNKNOWN');

    IF (in_connection_id IS NULL) THEN
        RETURN NULL;
    END IF;

    SELECT INSTRUMENTED INTO v_enabled
      FROM performance_schema.threads 
     WHERE PROCESSLIST_ID = in_connection_id;

    IF (v_enabled IS NULL) THEN
        RETURN 'UNKNOWN';
    ELSE
        RETURN v_enabled;
    END IF;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_thread_id;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_thread_id (
        in_connection_id BIGINT UNSIGNED
    ) RETURNS BIGINT UNSIGNED
    COMMENT '
             Description
             -----------

             Return the Performance Schema THREAD_ID for the specified connection ID.

             Parameters
             -----------

             in_connection_id (BIGINT UNSIGNED):
               The id of the connection to return the thread id for. If NULL, the current
               connection thread id is returned.

             Example
             -----------

             mysql> SELECT sys.ps_thread_id(79);
             +----------------------+
             | sys.ps_thread_id(79) |
             +----------------------+
             |                   98 |
             +----------------------+
             1 row in set (0.00 sec)

             mysql> SELECT sys.ps_thread_id(CONNECTION_ID());
             +-----------------------------------+
             | sys.ps_thread_id(CONNECTION_ID()) |
             +-----------------------------------+
             |                                98 |
             +-----------------------------------+
             1 row in set (0.00 sec)
            '

    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    RETURN (SELECT THREAD_ID
              FROM `performance_schema`.`threads`
             WHERE PROCESSLIST_ID = IFNULL(in_connection_id, CONNECTION_ID())
           );
END$$

DELIMITER ;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_thread_account;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_thread_account (
        in_thread_id BIGINT UNSIGNED
    ) RETURNS TEXT
    COMMENT '
             Description
             -----------

             Return the user@host account for the given Performance Schema thread id.

             Parameters
             -----------

             in_thread_id (BIGINT UNSIGNED):
               The id of the thread to return the account for.

             Example
             -----------

             mysql> select thread_id, processlist_user, processlist_host from performance_schema.threads where type = ''foreground'';
              +-----------+------------------+------------------+
              | thread_id | processlist_user | processlist_host |
              +-----------+------------------+------------------+
              |        23 | NULL             | NULL             |
              |        30 | root             | localhost        |
              |        31 | msandbox         | localhost        |
              |        32 | msandbox         | localhost        |
              +-----------+------------------+------------------+
              4 rows in set (0.00 sec)

              mysql> select sys.ps_thread_account(31);
              +---------------------------+
              | sys.ps_thread_account(31) |
              +---------------------------+
              | msandbox@localhost        |
              +---------------------------+
              1 row in set (0.00 sec)
            '

    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    RETURN (SELECT IF(
                      type = 'FOREGROUND',
                      CONCAT(processlist_user, '@', processlist_host),
                      type
                     ) AS account
              FROM `performance_schema`.`threads`
             WHERE thread_id = in_thread_id);
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_thread_stack;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_thread_stack (
        thd_id BIGINT UNSIGNED,
        debug BOOLEAN
    )
RETURNS LONGTEXT CHARSET latin1
    COMMENT '
             Description
             -----------

             Outputs a JSON formatted stack of all statements, stages and events
             within Performance Schema for the specified thread.

             Parameters
             -----------

             thd_id (BIGINT UNSIGNED):
               The id of the thread to trace. This should match the thread_id
               column from the performance_schema.threads table.
             in_verbose (BOOLEAN):
               Include file:lineno information in the events.

             Example
             -----------

             (line separation added for output)

             mysql> SELECT sys.ps_thread_stack(37, FALSE) AS thread_stack\\G
             *************************** 1. row ***************************
             thread_stack: {"rankdir": "LR","nodesep": "0.10","stack_created": "2014-02-19 13:39:03",
             "mysql_version": "5.7.3-m13","mysql_user": "root@localhost","events": 
             [{"nesting_event_id": "0", "event_id": "10", "timer_wait": 256.35, "event_info": 
             "sql/select", "wait_info": "select @@version_comment limit 1\\nerrors: 0\\nwarnings: 0\\nlock time:
             ...
            '
SQL SECURITY INVOKER
NOT DETERMINISTIC
READS SQL DATA
BEGIN

    DECLARE json_objects LONGTEXT;

    /*!50602
    -- Do not track the current thread, it will kill the stack
    UPDATE performance_schema.threads
       SET instrumented = 'NO'
     WHERE processlist_id = CONNECTION_ID();
    */

    SET SESSION group_concat_max_len=@@global.max_allowed_packet;

    -- Select the entire stack of events
    SELECT GROUP_CONCAT(CONCAT( '{'
              , CONCAT_WS( ', '
              , CONCAT('"nesting_event_id": "', IF(nesting_event_id IS NULL, '0', nesting_event_id), '"')
              , CONCAT('"event_id": "', event_id, '"')
              -- Convert from picoseconds to microseconds
              , CONCAT( '"timer_wait": ', ROUND(timer_wait/1000000, 2))  
              , CONCAT( '"event_info": "'
                  , CASE
                        WHEN event_name NOT LIKE 'wait/io%' THEN REPLACE(SUBSTRING_INDEX(event_name, '/', -2), '\\', '\\\\')
                        WHEN event_name NOT LIKE 'wait/io/file%' OR event_name NOT LIKE 'wait/io/socket%' THEN REPLACE(SUBSTRING_INDEX(event_name, '/', -4), '\\', '\\\\')
                        ELSE event_name
                    END
                  , '"'
              )
              -- Always dump the extra wait information gathered for statements
              , CONCAT( '"wait_info": "', IFNULL(wait_info, ''), '"')
              -- If debug is enabled, add the file:lineno information for waits
              , CONCAT( '"source": "', IF(true AND event_name LIKE 'wait%', IFNULL(wait_info, ''), ''), '"')
              -- Depending on the type of event, name it appropriately
              , CASE 
                     WHEN event_name LIKE 'wait/io/file%'      THEN '"event_type": "io/file"'
                     WHEN event_name LIKE 'wait/io/table%'     THEN '"event_type": "io/table"'
                     WHEN event_name LIKE 'wait/io/socket%'    THEN '"event_type": "io/socket"'
                     WHEN event_name LIKE 'wait/synch/mutex%'  THEN '"event_type": "synch/mutex"'
                     WHEN event_name LIKE 'wait/synch/cond%'   THEN '"event_type": "synch/cond"'
                     WHEN event_name LIKE 'wait/synch/rwlock%' THEN '"event_type": "synch/rwlock"'
                     WHEN event_name LIKE 'wait/lock%'         THEN '"event_type": "lock"'
                     WHEN event_name LIKE 'statement/%'        THEN '"event_type": "stmt"'
                     WHEN event_name LIKE 'stage/%'            THEN '"event_type": "stage"'
                     WHEN event_name LIKE '%idle%'             THEN '"event_type": "idle"'
                     ELSE '' 
                END                   
            )
            , '}'
          )
          ORDER BY event_id ASC SEPARATOR ',') event
    INTO json_objects
    FROM (
          /*!50600
          -- Select all statements, with the extra tracing information available
          (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, 
                  CONCAT(sql_text, '\\n',
                         'errors: ', errors, '\\n',
                         'warnings: ', warnings, '\\n',
                         'lock time: ', ROUND(lock_time/1000000, 2),'us\\n',
                         'rows affected: ', rows_affected, '\\n',
                         'rows sent: ', rows_sent, '\\n',
                         'rows examined: ', rows_examined, '\\n',
                         'tmp tables: ', created_tmp_tables, '\\n',
                         'tmp disk tables: ', created_tmp_disk_tables, '\\n',
                         'select scan: ', select_scan, '\\n',
                         'select full join: ', select_full_join, '\\n',
                         'select full range join: ', select_full_range_join, '\\n',
                         'select range: ', select_range, '\\n',
                         'select range check: ', select_range_check, '\\n', 
                         'sort merge passes: ', sort_merge_passes, '\\n',
                         'sort rows: ', sort_rows, '\\n',
                         'sort range: ', sort_range, '\\n',
                         'sort scan: ', sort_scan, '\\n',
                         'no index used: ', IF(no_index_used, 'TRUE', 'FALSE'), '\\n',
                         'no good index used: ', IF(no_good_index_used, 'TRUE', 'FALSE'), '\\n'
                         ) AS wait_info
             FROM performance_schema.events_statements_history_long WHERE thread_id = thd_id)
          UNION 
          -- Select all stages
          (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info
             FROM performance_schema.events_stages_history_long WHERE thread_id = thd_id) 
          UNION */
          -- Select all events, adding information appropriate to the event
          (SELECT thread_id, event_id, 
                  CONCAT(event_name , 
                         IF(event_name NOT LIKE 'wait/synch/mutex%', IFNULL(CONCAT(' - ', operation), ''), ''), 
                         IF(number_of_bytes IS NOT NULL, CONCAT(' ', number_of_bytes, ' bytes'), ''),
                         IF(event_name LIKE 'wait/io/file%', '\\n', ''),
                         IF(object_schema IS NOT NULL, CONCAT('\\nObject: ', object_schema, '.'), ''), 
                         IF(object_name IS NOT NULL, 
                            IF (event_name LIKE 'wait/io/socket%',
                                -- Print the socket if used, else the IP:port as reported
                                CONCAT(IF (object_name LIKE ':0%', @@socket, object_name)),
                                object_name),
                            ''),
                         /*!50600 IF(index_name IS NOT NULL, CONCAT(' Index: ', index_name), ''),*/'\\n'
                         ) AS event_name,
                  timer_wait, timer_start, nesting_event_id, source AS wait_info
             FROM performance_schema.events_waits_history_long WHERE thread_id = thd_id)) events 
    ORDER BY event_id;

    RETURN CONCAT('{', 
                  CONCAT_WS(',', 
                            '"rankdir": "LR"',
                            '"nodesep": "0.10"',
                            CONCAT('"stack_created": "', NOW(), '"'),
                            CONCAT('"mysql_version": "', VERSION(), '"'),
                            CONCAT('"mysql_user": "', CURRENT_USER(), '"'),
                            CONCAT('"events": [', IFNULL(json_objects,''), ']')
                           ),
                  '}');

END$$

DELIMITER ;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS ps_thread_trx_info;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION ps_thread_trx_info (
        in_thread_id BIGINT UNSIGNED
    ) RETURNS LONGTEXT
    COMMENT '
             Description
             -----------

             Returns a JSON object with info on the given threads current transaction, 
             and the statements it has already executed, derived from the
             performance_schema.events_transactions_current and
             performance_schema.events_statements_history tables (so the consumers 
             for these also have to be enabled within Performance Schema to get full
             data in the object).

             When the output exceeds the default truncation length (65535), a JSON error
             object is returned, such as:

             { "error": "Trx info truncated: Row 6 was cut by GROUP_CONCAT()" }

             Similar error objects are returned for other warnings/and exceptions raised
             when calling the function.

             The max length of the output of this function can be controlled with the
             ps_thread_trx_info.max_length variable set via sys_config, or the
             @sys.ps_thread_trx_info.max_length user variable, as appropriate.

             Parameters
             -----------

             in_thread_id (BIGINT UNSIGNED):
               The id of the thread to return the transaction info for.

             Example
             -----------

             SELECT sys.ps_thread_trx_info(48)\\G
             *************************** 1. row ***************************
             sys.ps_thread_trx_info(48): [
               {
                 "time": "790.70 us",
                 "state": "COMMITTED",
                 "mode": "READ WRITE",
                 "autocommitted": "NO",
                 "gtid": "AUTOMATIC",
                 "isolation": "REPEATABLE READ",
                 "statements_executed": [
                   {
                     "sql_text": "INSERT INTO info VALUES (1, \'foo\')",
                     "time": "471.02 us",
                     "schema": "trx",
                     "rows_examined": 0,
                     "rows_affected": 1,
                     "rows_sent": 0,
                     "tmp_tables": 0,
                     "tmp_disk_tables": 0,
                     "sort_rows": 0,
                     "sort_merge_passes": 0
                   },
                   {
                     "sql_text": "COMMIT",
                     "time": "254.42 us",
                     "schema": "trx",
                     "rows_examined": 0,
                     "rows_affected": 0,
                     "rows_sent": 0,
                     "tmp_tables": 0,
                     "tmp_disk_tables": 0,
                     "sort_rows": 0,
                     "sort_merge_passes": 0
                   }
                 ]
               },
               {
                 "time": "426.20 us",
                 "state": "COMMITTED",
                 "mode": "READ WRITE",
                 "autocommitted": "NO",
                 "gtid": "AUTOMATIC",
                 "isolation": "REPEATABLE READ",
                 "statements_executed": [
                   {
                     "sql_text": "INSERT INTO info VALUES (2, \'bar\')",
                     "time": "107.33 us",
                     "schema": "trx",
                     "rows_examined": 0,
                     "rows_affected": 1,
                     "rows_sent": 0,
                     "tmp_tables": 0,
                     "tmp_disk_tables": 0,
                     "sort_rows": 0,
                     "sort_merge_passes": 0
                   },
                   {
                     "sql_text": "COMMIT",
                     "time": "213.23 us",
                     "schema": "trx",
                     "rows_examined": 0,
                     "rows_affected": 0,
                     "rows_sent": 0,
                     "tmp_tables": 0,
                     "tmp_disk_tables": 0,
                     "sort_rows": 0,
                     "sort_merge_passes": 0
                   }
                 ]
               }
             ]
             1 row in set (0.03 sec)
            '

    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    DECLARE v_output LONGTEXT DEFAULT '{}';
    DECLARE v_msg_text TEXT DEFAULT '';
    DECLARE v_signal_msg TEXT DEFAULT '';
    DECLARE v_mysql_errno INT;
    DECLARE v_max_output_len BIGINT;
    -- Capture warnings/errors such as group_concat truncation
    -- and report as JSON error objects
    DECLARE EXIT HANDLER FOR SQLWARNING, SQLEXCEPTION
    BEGIN
        GET DIAGNOSTICS CONDITION 1
            v_msg_text = MESSAGE_TEXT,
            v_mysql_errno = MYSQL_ERRNO;

        IF v_mysql_errno = 1260 THEN
            SET v_signal_msg = CONCAT('{ "error": "Trx info truncated: ', v_msg_text, '" }');
        ELSE
            SET v_signal_msg = CONCAT('{ "error": "', v_msg_text, '" }');
        END IF;

        RETURN v_signal_msg;
    END;

    -- Set configuration options
    IF (@sys.ps_thread_trx_info.max_length IS NULL) THEN
        SET @sys.ps_thread_trx_info.max_length = sys.sys_get_config('ps_thread_trx_info.max_length', 65535);
    END IF;

    IF (@sys.ps_thread_trx_info.max_length != @@session.group_concat_max_len) THEN
        SET @old_group_concat_max_len = @@session.group_concat_max_len;
        -- Convert to int value for the SET, and give some surrounding space
        SET v_max_output_len = (@sys.ps_thread_trx_info.max_length - 5);
        SET SESSION group_concat_max_len = v_max_output_len;
    END IF;

    SET v_output = (
        SELECT CONCAT('[', IFNULL(GROUP_CONCAT(trx_info ORDER BY event_id), ''), '\n]') AS trx_info
          FROM (SELECT trxi.thread_id, 
                       trxi.event_id,
                       GROUP_CONCAT(
                         IFNULL(
                           CONCAT('\n  {\n',
                                  '    "time": "', IFNULL(sys.format_time(trxi.timer_wait), ''), '",\n',
                                  '    "state": "', IFNULL(trxi.state, ''), '",\n',
                                  '    "mode": "', IFNULL(trxi.access_mode, ''), '",\n',
                                  '    "autocommitted": "', IFNULL(trxi.autocommit, ''), '",\n',
                                  '    "gtid": "', IFNULL(trxi.gtid, ''), '",\n',
                                  '    "isolation": "', IFNULL(trxi.isolation_level, ''), '",\n',
                                  '    "statements_executed": [', IFNULL(s.stmts, ''), IF(s.stmts IS NULL, ' ]\n', '\n    ]\n'),
                                  '  }'
                           ), 
                           '') 
                         ORDER BY event_id) AS trx_info

                  FROM (
                        (SELECT thread_id, event_id, timer_wait, state,access_mode, autocommit, gtid, isolation_level
                           FROM performance_schema.events_transactions_current
                          WHERE thread_id = in_thread_id
                            AND end_event_id IS NULL)
                        UNION
                        (SELECT thread_id, event_id, timer_wait, state,access_mode, autocommit, gtid, isolation_level
                           FROM performance_schema.events_transactions_history
                          WHERE thread_id = in_thread_id)
                       ) AS trxi
                  LEFT JOIN (SELECT thread_id,
                                    nesting_event_id,
                                    GROUP_CONCAT(
                                      IFNULL(
                                        CONCAT('\n      {\n',
                                               '        "sql_text": "', IFNULL(sys.format_statement(REPLACE(sql_text, '\\', '\\\\')), ''), '",\n',
                                               '        "time": "', IFNULL(sys.format_time(timer_wait), ''), '",\n',
                                               '        "schema": "', IFNULL(current_schema, ''), '",\n',
                                               '        "rows_examined": ', IFNULL(rows_examined, ''), ',\n',
                                               '        "rows_affected": ', IFNULL(rows_affected, ''), ',\n',
                                               '        "rows_sent": ', IFNULL(rows_sent, ''), ',\n',
                                               '        "tmp_tables": ', IFNULL(created_tmp_tables, ''), ',\n',
                                               '        "tmp_disk_tables": ', IFNULL(created_tmp_disk_tables, ''), ',\n',
                                               '        "sort_rows": ', IFNULL(sort_rows, ''), ',\n',
                                               '        "sort_merge_passes": ', IFNULL(sort_merge_passes, ''), '\n',
                                               '      }'), '') ORDER BY event_id) AS stmts
                               FROM performance_schema.events_statements_history
                              WHERE sql_text IS NOT NULL
                                AND thread_id = in_thread_id
                              GROUP BY thread_id, nesting_event_id
                            ) AS s 
                    ON trxi.thread_id = s.thread_id 
                   AND trxi.event_id = s.nesting_event_id
                 WHERE trxi.thread_id = in_thread_id
                 GROUP BY trxi.thread_id, trxi.event_id
                ) trxs
          GROUP BY thread_id
    );

    IF (@old_group_concat_max_len IS NOT NULL) THEN
        SET SESSION group_concat_max_len = @old_group_concat_max_len;
    END IF;

    RETURN v_output;
END$$

DELIMITER ;

-- Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS quote_identifier;

DELIMITER $$

-- https://dev.mysql.com/doc/refman/5.7/en/identifiers.html
-- Maximum supported length for any of the current identifiers in 5.7.5+ is 256 characters.
-- Before that, user variables could have any length.
--
-- Based on Paul Dubois' suggestion in Bug #78823/Bug #22011361.
CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION quote_identifier(in_identifier TEXT)
    RETURNS TEXT CHARSET UTF8
    COMMENT '
             Description
             -----------

             Takes an unquoted identifier (schema name, table name, etc.) and
             returns the identifier quoted with backticks.

             Parameters
             -----------

             in_identifier (TEXT):
               The identifier to quote.

             Returns
             -----------

             TEXT

             Example
             -----------

             mysql> SELECT sys.quote_identifier(''my_identifier'') AS Identifier;
             +-----------------+
             | Identifier      |
             +-----------------+
             | `my_identifier` |
             +-----------------+
             1 row in set (0.00 sec)

             mysql> SELECT sys.quote_identifier(''my`idenfier'') AS Identifier;
             +----------------+
             | Identifier     |
             +----------------+
             | `my``idenfier` |
             +----------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    NO SQL
BEGIN
    RETURN CONCAT('`', REPLACE(in_identifier, '`', '``'), '`');
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS sys_get_config;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION sys_get_config (
        in_variable_name VARCHAR(128),
        in_default_value VARCHAR(128)
    )
    RETURNS VARCHAR(128)
    COMMENT '
             Description
             -----------

             Returns the value for the requested variable using the following logic:

                1. If the option exists in sys.sys_config return the value from there.
                2. Else fall back on the provided default value.

             Notes for using sys_get_config():

                * If the default value argument to sys_get_config() is NULL and case 2. is reached, NULL is returned.
                  It is then expected that the caller is able to handle NULL for the given configuration option.
                * The convention is to name the user variables @sys.<name of variable>. It is <name of variable> that
                  is stored in the sys_config table and is what is expected as the argument to sys_get_config().
                * If you want to check whether the configuration option has already been set and if not assign with
                  the return value of sys_get_config() you can use IFNULL(...) (see example below). However this should
                  not be done inside a loop (e.g. for each row in a result set) as for repeated calls where assignment
                  is only needed in the first iteration using IFNULL(...) is expected to be significantly slower than
                  using an IF (...) THEN ... END IF; block (see example below).

             Parameters
             -----------

             in_variable_name (VARCHAR(128)):
               The name of the config option to return the value for.

             in_default_value (VARCHAR(128)):
               The default value to return if the variable does not exist in sys.sys_config.

             Returns
             -----------

             VARCHAR(128)

             Example
             -----------

             -- Get the configuration value from sys.sys_config falling back on 128 if the option is not present in the table.
             mysql> SELECT sys.sys_get_config(''statement_truncate_len'', 128) AS Value;
             +-------+
             | Value |
             +-------+
             | 64    |
             +-------+
             1 row in set (0.00 sec)

             -- Check whether the option is already set, if not assign - IFNULL(...) one liner example.
             mysql> SET @sys.statement_truncate_len = IFNULL(@sys.statement_truncate_len, sys.sys_get_config(''statement_truncate_len'', 64));
             Query OK, 0 rows affected (0.00 sec)

             -- Check whether the option is already set, if not assign - IF ... THEN ... END IF example.
             IF (@sys.statement_truncate_len IS NULL) THEN
                 SET @sys.statement_truncate_len = sys.sys_get_config(''statement_truncate_len'', 64);
             END IF;
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    READS SQL DATA
BEGIN
    DECLARE v_value VARCHAR(128) DEFAULT NULL;
    DECLARE old_val INTEGER DEFAULT NULL;

    -- Check if we have the variable in the sys.sys_config table
    SET v_value = (SELECT value FROM sys.sys_config WHERE variable = in_variable_name);
  
    -- Protection against the variable not existing in sys_config
    IF (v_value IS NULL) THEN
        SET v_value = in_default_value;
    END IF;

    RETURN v_value;
END $$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS version_major;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION version_major ()
    RETURNS TINYINT UNSIGNED
    COMMENT '
             Description
             -----------

             Returns the major version of MySQL Server.

             Returns
             -----------

             TINYINT UNSIGNED

             Example
             -----------

             mysql> SELECT VERSION(), sys.version_major();
             +--------------------------------------+---------------------+
             | VERSION()                            | sys.version_major() |
             +--------------------------------------+---------------------+
             | 5.7.9-enterprise-commercial-advanced | 5                   |
             +--------------------------------------+---------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    NO SQL
BEGIN
    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', 1);
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS version_minor;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION version_minor ()
    RETURNS TINYINT UNSIGNED
    COMMENT '
             Description
             -----------

             Returns the minor (release series) version of MySQL Server.

             Returns
             -----------

             TINYINT UNSIGNED

             Example
             -----------

             mysql> SELECT VERSION(), sys.server_minor();
             +--------------------------------------+---------------------+
             | VERSION()                            | sys.version_minor() |
             +--------------------------------------+---------------------+
             | 5.7.9-enterprise-commercial-advanced | 7                   |
             +--------------------------------------+---------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    NO SQL
BEGIN
    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', 2), '.', -1);
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP FUNCTION IF EXISTS version_patch;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' FUNCTION version_patch ()
    RETURNS TINYINT UNSIGNED
    COMMENT '
             Description
             -----------

             Returns the patch release version of MySQL Server.

             Returns
             -----------

             TINYINT UNSIGNED

             Example
             -----------

             mysql> SELECT VERSION(), sys.version_patch();
             +--------------------------------------+---------------------+
             | VERSION()                            | sys.version_patch() |
             +--------------------------------------+---------------------+
             | 5.7.9-enterprise-commercial-advanced | 9                   |
             +--------------------------------------+---------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    NO SQL
BEGIN
    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', -1);
END$$

DELIMITER ;

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: innodb_buffer_stats_by_schema
-- 
-- Summarizes the output of the INFORMATION_SCHEMA.INNODB_BUFFER_PAGE 
-- table, aggregating by schema
--
-- 
-- mysql> select * from innodb_buffer_stats_by_schema;
-- +--------------------------+------------+------------+-------+--------------+-----------+-------------+
-- | object_schema            | allocated  | data       | pages | pages_hashed | pages_old | rows_cached |
-- +--------------------------+------------+------------+-------+--------------+-----------+-------------+
-- | mem30_trunk__instruments | 1.69 MiB   | 510.03 KiB |   108 |          108 |       108 |        3885 |
-- | InnoDB System            | 688.00 KiB | 351.62 KiB |    43 |           43 |        43 |         862 |
-- | mem30_trunk__events      | 80.00 KiB  | 21.61 KiB  |     5 |            5 |         5 |         229 |
-- +--------------------------+------------+------------+-------+--------------+-----------+-------------+
--

DELIMITER $$

BEGIN NOT ATOMIC
  DECLARE EXIT HANDLER FOR SQLEXCEPTION
  BEGIN
  END;
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW innodb_buffer_stats_by_schema (
  object_schema,
  allocated,
  data,
  pages,
  pages_hashed,
  pages_old,
  rows_cached
) AS
SELECT IF(LOCATE('.', ibp.table_name) = 0, 'InnoDB System', REPLACE(SUBSTRING_INDEX(ibp.table_name, '.', 1), '`', '')) AS object_schema,
       sys.format_bytes(SUM(IF(ibp.compressed_size = 0, 16384, compressed_size))) AS allocated,
       sys.format_bytes(SUM(ibp.data_size)) AS data,
       COUNT(ibp.page_number) AS pages,
       COUNT(IF(ibp.is_hashed = 'YES', 1, NULL)) AS pages_hashed,
       COUNT(IF(ibp.is_old = 'YES', 1, NULL)) AS pages_old,
       ROUND(SUM(ibp.number_records)/COUNT(DISTINCT ibp.index_name)) AS rows_cached 
  FROM information_schema.innodb_buffer_page ibp 
 WHERE table_name IS NOT NULL
 GROUP BY object_schema
 ORDER BY SUM(IF(ibp.compressed_size = 0, 16384, compressed_size)) DESC;
END$$
DELIMITER ;


-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$innodb_buffer_stats_by_schema
-- 
-- Summarizes the output of the INFORMATION_SCHEMA.INNODB_BUFFER_PAGE 
-- table, aggregating by schema
--
-- mysql> select * from x$innodb_buffer_stats_by_schema;
-- +--------------------------+-----------+--------+-------+--------------+-----------+-------------+
-- | object_schema            | allocated | data   | pages | pages_hashed | pages_old | rows_cached |
-- +--------------------------+-----------+--------+-------+--------------+-----------+-------------+
-- | mem30_trunk__instruments |   1769472 | 522272 |   108 |          108 |       108 |        3885 |
-- | InnoDB System            |    704512 | 360054 |    43 |           43 |        43 |         862 |
-- | mem30_trunk__events      |     81920 |  22125 |     5 |            5 |         5 |         229 |
-- +--------------------------+-----------+--------+-------+--------------+-----------+-------------+
--

DELIMITER $$
BEGIN NOT ATOMIC
  DECLARE EXIT HANDLER FOR SQLEXCEPTION
  BEGIN
  END;
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$innodb_buffer_stats_by_schema (
  object_schema,
  allocated,
  data,
  pages,
  pages_hashed,
  pages_old,
  rows_cached
) AS
SELECT IF(LOCATE('.', ibp.table_name) = 0, 'InnoDB System', REPLACE(SUBSTRING_INDEX(ibp.table_name, '.', 1), '`', '')) AS object_schema,
       SUM(IF(ibp.compressed_size = 0, 16384, compressed_size)) AS allocated,
       SUM(ibp.data_size) AS data,
       COUNT(ibp.page_number) AS pages,
       COUNT(IF(ibp.is_hashed, 1, NULL)) AS pages_hashed,
       COUNT(IF(ibp.is_old, 1, NULL)) AS pages_old,
       ROUND(IFNULL(SUM(ibp.number_records)/NULLIF(COUNT(DISTINCT ibp.index_name), 0), 0)) AS rows_cached 
  FROM information_schema.innodb_buffer_page ibp 
 WHERE table_name IS NOT NULL
 GROUP BY object_schema
 ORDER BY SUM(IF(ibp.compressed_size = 0, 16384, compressed_size)) DESC;
END$$
DELIMITER ;

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: innodb_buffer_stats_by_table
-- 
-- Summarizes the output of the INFORMATION_SCHEMA.INNODB_BUFFER_PAGE 
-- table, aggregating by schema and table name
--
-- mysql> select * from innodb_buffer_stats_by_table;
-- +--------------------------+------------------------------------+------------+-----------+-------+--------------+-----------+-------------+
-- | object_schema            | object_name                        | allocated  | data      | pages | pages_hashed | pages_old | rows_cached |
-- +--------------------------+------------------------------------+------------+-----------+-------+--------------+-----------+-------------+
-- | InnoDB System            | SYS_COLUMNS                        | 128.00 KiB | 98.97 KiB |     8 |            8 |         8 |        1532 |
-- | InnoDB System            | SYS_FOREIGN                        | 128.00 KiB | 55.48 KiB |     8 |            8 |         8 |         172 |
-- | InnoDB System            | SYS_TABLES                         | 128.00 KiB | 56.18 KiB |     8 |            8 |         8 |         365 |
-- | InnoDB System            | SYS_INDEXES                        | 112.00 KiB | 76.16 KiB |     7 |            7 |         7 |        1046 |
-- | mem30_trunk__instruments | agentlatencytime                   | 96.00 KiB  | 28.83 KiB |     6 |            6 |         6 |         252 |
-- | mem30_trunk__instruments | binlogspaceusagedata               | 96.00 KiB  | 22.54 KiB |     6 |            6 |         6 |         196 |
-- | mem30_trunk__instruments | connectionsdata                    | 96.00 KiB  | 36.68 KiB |     6 |            6 |         6 |         276 |
-- ...
-- +--------------------------+------------------------------------+------------+-----------+-------+--------------+-----------+-------------+
--

DELIMITER $$
BEGIN NOT ATOMIC
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW innodb_buffer_stats_by_table (
  object_schema,
  object_name,
  allocated,
  data,
  pages,
  pages_hashed,
  pages_old,
  rows_cached
) AS
SELECT IF(LOCATE('.', ibp.table_name) = 0, 'InnoDB System', REPLACE(SUBSTRING_INDEX(ibp.table_name, '.', 1), '`', '')) AS object_schema,
       REPLACE(SUBSTRING_INDEX(ibp.table_name, '.', -1), '`', '') AS object_name,
       sys.format_bytes(SUM(IF(ibp.compressed_size = 0, 16384, compressed_size))) AS allocated,
       sys.format_bytes(SUM(ibp.data_size)) AS data,
       COUNT(ibp.page_number) AS pages,
       COUNT(IF(ibp.is_hashed = 'YES', 1, NULL)) AS pages_hashed,
       COUNT(IF(ibp.is_old = 'YES', 1, NULL)) AS pages_old,
       ROUND(SUM(ibp.number_records)/COUNT(DISTINCT ibp.index_name)) AS rows_cached 
  FROM information_schema.innodb_buffer_page ibp 
 WHERE table_name IS NOT NULL
 GROUP BY object_schema, object_name
 ORDER BY SUM(IF(ibp.compressed_size = 0, 16384, compressed_size)) DESC;
END$$
DELIMITER ;
-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$innodb_buffer_stats_by_table
-- 
-- Summarizes the output of the INFORMATION_SCHEMA.INNODB_BUFFER_PAGE 
-- table, aggregating by schema and table name
--
-- mysql> select * from x$innodb_buffer_stats_by_table;
-- +--------------------------+------------------------------------+-----------+--------+-------+--------------+-----------+-------------+
-- | object_schema            | object_name                        | allocated | data   | pages | pages_hashed | pages_old | rows_cached |
-- +--------------------------+------------------------------------+-----------+--------+-------+--------------+-----------+-------------+
-- | InnoDB System            | SYS_COLUMNS                        |    131072 | 101350 |     8 |            8 |         8 |        1532 |
-- | InnoDB System            | SYS_FOREIGN                        |    131072 |  56808 |     8 |            8 |         8 |         172 |
-- | InnoDB System            | SYS_TABLES                         |    131072 |  57529 |     8 |            8 |         8 |         365 |
-- | InnoDB System            | SYS_INDEXES                        |    114688 |  77984 |     7 |            7 |         7 |        1046 |
-- | mem30_trunk__instruments | agentlatencytime                   |     98304 |  29517 |     6 |            6 |         6 |         252 |
-- | mem30_trunk__instruments | binlogspaceusagedata               |     98304 |  23076 |     6 |            6 |         6 |         196 |
-- | mem30_trunk__instruments | connectionsdata                    |     98304 |  37563 |     6 |            6 |         6 |         276 |
-- ...
-- +--------------------------+------------------------------------+-----------+--------+-------+--------------+-----------+-------------+
--
DELIMITER $$
BEGIN NOT ATOMIC
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$innodb_buffer_stats_by_table (
  object_schema,
  object_name,
  allocated,
  data,
  pages,
  pages_hashed,
  pages_old,
  rows_cached
) AS
SELECT IF(LOCATE('.', ibp.table_name) = 0, 'InnoDB System', REPLACE(SUBSTRING_INDEX(ibp.table_name, '.', 1), '`', '')) AS object_schema,
       REPLACE(SUBSTRING_INDEX(ibp.table_name, '.', -1), '`', '') AS object_name,
       SUM(IF(ibp.compressed_size = 0, 16384, compressed_size)) AS allocated,
       SUM(ibp.data_size) AS data,
       COUNT(ibp.page_number) AS pages,
       COUNT(IF(ibp.is_hashed, 1, NULL)) AS pages_hashed,
       COUNT(IF(ibp.is_old, 1, NULL)) AS pages_old,
       ROUND(IFNULL(SUM(ibp.number_records)/NULLIF(COUNT(DISTINCT ibp.index_name), 0), 0)) AS rows_cached 
  FROM information_schema.innodb_buffer_page ibp 
 WHERE table_name IS NOT NULL
 GROUP BY object_schema, object_name
 ORDER BY SUM(IF(ibp.compressed_size = 0, 16384, compressed_size)) DESC;
END$$
DELIMITER ;
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: innodb_lock_waits
--
-- Give a snapshot of which InnoDB locks transactions are waiting for.
-- The lock waits are ordered by the age of the lock descending.
--
-- Versions: 5.1+ (5.1 requires InnoDB Plugin with I_S tables)
--
-- mysql> SELECT * FROM x$innodb_lock_waits\G
-- *************************** 1. row ***************************
--                 wait_started: 2014-11-11 13:39:20
--                     wait_age: 00:00:07
--                wait_age_secs: 7
--                 locked_table: `db1`.`t1`
--                 locked_index: PRIMARY
--                  locked_type: RECORD
--               waiting_trx_id: 867158
--          waiting_trx_started: 2014-11-11 13:39:15
--              waiting_trx_age: 00:00:12
--      waiting_trx_rows_locked: 0
--    waiting_trx_rows_modified: 0
--                  waiting_pid: 3
--                waiting_query: UPDATE t1 SET val = val + 1 WHERE id = 2
--              waiting_lock_id: 867158:2363:3:3
--            waiting_lock_mode: X
--              blocking_trx_id: 867157
--                 blocking_pid: 4
--               blocking_query: UPDATE t1 SET val = val + 1 + SLEEP(10) WHERE id = 2
--             blocking_lock_id: 867157:2363:3:3
--           blocking_lock_mode: X
--         blocking_trx_started: 2014-11-11 13:39:11
--             blocking_trx_age: 00:00:16
--     blocking_trx_rows_locked: 1
--   blocking_trx_rows_modified: 1
--      sql_kill_blocking_query: KILL QUERY 4
-- sql_kill_blocking_connection: KILL 4
-- 1 row in set (0.01 sec)
--
DELIMITER $$
BEGIN NOT ATOMIC
  DECLARE EXIT HANDLER FOR SQLEXCEPTION
  BEGIN
  END;
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW innodb_lock_waits (
  wait_started,
  wait_age,
  wait_age_secs,
  locked_table,
  locked_index,
  locked_type,
  waiting_trx_id,
  waiting_trx_started,
  waiting_trx_age,
  waiting_trx_rows_locked,
  waiting_trx_rows_modified,
  waiting_pid,
  waiting_query,
  waiting_lock_id,
  waiting_lock_mode,
  blocking_trx_id,
  blocking_pid,
  blocking_query,
  blocking_lock_id,
  blocking_lock_mode,
  blocking_trx_started,
  blocking_trx_age,
  blocking_trx_rows_locked,
  blocking_trx_rows_modified,
  sql_kill_blocking_query,
  sql_kill_blocking_connection
) AS
SELECT r.trx_wait_started AS wait_started,
       TIMEDIFF(NOW(), r.trx_wait_started) AS wait_age,
       TIMESTAMPDIFF(SECOND, r.trx_wait_started, NOW()) AS wait_age_secs,
       rl.lock_table AS locked_table,
       rl.lock_index AS locked_index,
       rl.lock_type AS locked_type,
       r.trx_id AS waiting_trx_id,
       r.trx_started as waiting_trx_started,
       TIMEDIFF(NOW(), r.trx_started) AS waiting_trx_age,
       r.trx_rows_locked AS waiting_trx_rows_locked,
       r.trx_rows_modified AS waiting_trx_rows_modified,
       r.trx_mysql_thread_id AS waiting_pid,
       sys.format_statement(r.trx_query) AS waiting_query,
       rl.lock_id AS waiting_lock_id,
       rl.lock_mode AS waiting_lock_mode,
       b.trx_id AS blocking_trx_id,
       b.trx_mysql_thread_id AS blocking_pid,
       sys.format_statement(b.trx_query) AS blocking_query,
       bl.lock_id AS blocking_lock_id,
       bl.lock_mode AS blocking_lock_mode,
       b.trx_started AS blocking_trx_started,
       TIMEDIFF(NOW(), b.trx_started) AS blocking_trx_age,
       b.trx_rows_locked AS blocking_trx_rows_locked,
       b.trx_rows_modified AS blocking_trx_rows_modified,
       CONCAT('KILL QUERY ', b.trx_mysql_thread_id) AS sql_kill_blocking_query,
       CONCAT('KILL ', b.trx_mysql_thread_id) AS sql_kill_blocking_connection
  FROM information_schema.innodb_lock_waits w
       INNER JOIN information_schema.innodb_trx b    ON b.trx_id = w.blocking_trx_id
       INNER JOIN information_schema.innodb_trx r    ON r.trx_id = w.requesting_trx_id
       INNER JOIN information_schema.innodb_locks bl ON bl.lock_id = w.blocking_lock_id
       INNER JOIN information_schema.innodb_locks rl ON rl.lock_id = w.requested_lock_id
 ORDER BY r.trx_wait_started;
 END$$
DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$innodb_lock_waits
--
-- Give a snapshot of which InnoDB locks transactions are waiting for.
-- The lock waits are ordered by the age of the lock descending.
--
-- Versions: 5.1+ (5.1 requires InnoDB Plugin with I_S tables)
--
-- mysql> SELECT * FROM x$innodb_lock_waits\G
-- *************************** 1. row ***************************
--                 wait_started: 2014-11-11 13:39:20
--                     wait_age: 00:00:07
--                wait_age_secs: 7
--                 locked_table: `db1`.`t1`
--                 locked_index: PRIMARY
--                  locked_type: RECORD
--               waiting_trx_id: 867158
--          waiting_trx_started: 2014-11-11 13:39:15
--              waiting_trx_age: 00:00:12
--      waiting_trx_rows_locked: 0
--    waiting_trx_rows_modified: 0
--                  waiting_pid: 3
--                waiting_query: UPDATE t1 SET val = val + 1 WHERE id = 2
--              waiting_lock_id: 867158:2363:3:3
--            waiting_lock_mode: X
--              blocking_trx_id: 867157
--                 blocking_pid: 4
--               blocking_query: UPDATE t1 SET val = val + 1 + SLEEP(10) WHERE id = 2
--             blocking_lock_id: 867157:2363:3:3
--           blocking_lock_mode: X
--         blocking_trx_started: 2014-11-11 13:39:11
--             blocking_trx_age: 00:00:16
--     blocking_trx_rows_locked: 1
--   blocking_trx_rows_modified: 1
--      sql_kill_blocking_query: KILL QUERY 4
-- sql_kill_blocking_connection: KILL 4
-- 1 row in set (0.01 sec)
--

DELIMITER $$
BEGIN NOT ATOMIC 
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$innodb_lock_waits (
  wait_started,
  wait_age,
  wait_age_secs,
  locked_table,
  locked_index,
  locked_type,
  waiting_trx_id,
  waiting_trx_started,
  waiting_trx_age,
  waiting_trx_rows_locked,
  waiting_trx_rows_modified,
  waiting_pid,
  waiting_query,
  waiting_lock_id,
  waiting_lock_mode,
  blocking_trx_id,
  blocking_pid,
  blocking_query,
  blocking_lock_id,
  blocking_lock_mode,
  blocking_trx_started,
  blocking_trx_age,
  blocking_trx_rows_locked,
  blocking_trx_rows_modified,
  sql_kill_blocking_query,
  sql_kill_blocking_connection
) AS
SELECT r.trx_wait_started AS wait_started,
       TIMEDIFF(NOW(), r.trx_wait_started) AS wait_age,
       TIMESTAMPDIFF(SECOND, r.trx_wait_started, NOW()) AS wait_age_secs,
       rl.lock_table AS locked_table,
       rl.lock_index AS locked_index,
       rl.lock_type AS locked_type,
       r.trx_id AS waiting_trx_id,
       r.trx_started as waiting_trx_started,
       TIMEDIFF(NOW(), r.trx_started) AS waiting_trx_age,
       r.trx_rows_locked AS waiting_trx_rows_locked,
       r.trx_rows_modified AS waiting_trx_rows_modified,
       r.trx_mysql_thread_id AS waiting_pid,
       r.trx_query AS waiting_query,
       rl.lock_id AS waiting_lock_id,
       rl.lock_mode AS waiting_lock_mode,
       b.trx_id AS blocking_trx_id,
       b.trx_mysql_thread_id AS blocking_pid,
       b.trx_query AS blocking_query,
       bl.lock_id AS blocking_lock_id,
       bl.lock_mode AS blocking_lock_mode,
       b.trx_started AS blocking_trx_started,
       TIMEDIFF(NOW(), b.trx_started) AS blocking_trx_age,
       b.trx_rows_locked AS blocking_trx_rows_locked,
       b.trx_rows_modified AS blocking_trx_rows_modified,
       CONCAT('KILL QUERY ', b.trx_mysql_thread_id) AS sql_kill_blocking_query,
       CONCAT('KILL ', b.trx_mysql_thread_id) AS sql_kill_blocking_connection
  FROM information_schema.innodb_lock_waits w
       INNER JOIN information_schema.innodb_trx b    ON b.trx_id = w.blocking_trx_id
       INNER JOIN information_schema.innodb_trx r    ON r.trx_id = w.requesting_trx_id
       INNER JOIN information_schema.innodb_locks bl ON bl.lock_id = w.blocking_lock_id
       INNER JOIN information_schema.innodb_locks rl ON rl.lock_id = w.requested_lock_id
 ORDER BY r.trx_wait_started;
END$$
DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: schema_object_overview
-- 
-- Shows an overview of the types of objects within each schema
--
-- Note: On instances with a large number of objects, this could take
--       some time to execute, and is not recommended.
--
-- mysql> select * from schema_object_overview;
-- +---------------------------------+---------------+-------+
-- | db                              | object_type   | count |
-- +---------------------------------+---------------+-------+
-- | information_schema              | SYSTEM VIEW   |    59 |
-- | mem30_test__instruments         | BASE TABLE    |     1 |
-- | mem30_test__instruments         | INDEX (BTREE) |     2 |
-- | mem30_test__test                | BASE TABLE    |     9 |
-- | mem30_test__test                | INDEX (BTREE) |    19 |
-- ...
-- | sys                             | FUNCTION      |     8 |
-- | sys                             | PROCEDURE     |    16 |
-- | sys                             | VIEW          |    59 |
-- +---------------------------------+---------------+-------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_object_overview (
  db,
  object_type,
  count
) AS
SELECT ROUTINE_SCHEMA AS db, ROUTINE_TYPE AS object_type, COUNT(*) AS count FROM information_schema.routines GROUP BY ROUTINE_SCHEMA, ROUTINE_TYPE
 UNION 
SELECT TABLE_SCHEMA, TABLE_TYPE, COUNT(*) FROM information_schema.tables GROUP BY TABLE_SCHEMA, TABLE_TYPE
 UNION
SELECT TABLE_SCHEMA, CONCAT('INDEX (', INDEX_TYPE, ')'), COUNT(*) FROM information_schema.statistics GROUP BY TABLE_SCHEMA, INDEX_TYPE
 UNION
SELECT TRIGGER_SCHEMA, 'TRIGGER', COUNT(*) FROM information_schema.triggers GROUP BY TRIGGER_SCHEMA
 UNION
SELECT EVENT_SCHEMA, 'EVENT', COUNT(*) FROM information_schema.events GROUP BY EVENT_SCHEMA
ORDER BY DB, OBJECT_TYPE;


--
-- View: schema_auto_increment_columns
--
-- Present current auto_increment usage/capacity in all tables.
--
-- mysql> select * from schema_auto_increment_columns limit 5;
-- +-------------------+-------------------+-------------+-----------+-------------+-----------+-------------+---------------------+----------------+----------------------+
-- | table_schema      | table_name        | column_name | data_type | column_type | is_signed | is_unsigned | max_value           | auto_increment | auto_increment_ratio |
-- +-------------------+-------------------+-------------+-----------+-------------+-----------+-------------+---------------------+----------------+----------------------+
-- | test              | t1                | i           | tinyint   | tinyint(4)  |         1 |           0 |                 127 |             34 |               0.2677 |
-- | mem__advisor_text | template_meta     | hib_id      | int       | int(11)     |         1 |           0 |          2147483647 |            516 |               0.0000 |
-- | mem__advisors     | advisor_schedules | schedule_id | int       | int(11)     |         1 |           0 |          2147483647 |            249 |               0.0000 |
-- | mem__advisors     | app_identity_path | hib_id      | int       | int(11)     |         1 |           0 |          2147483647 |            251 |               0.0000 |
-- | mem__bean_config  | plists            | id          | bigint    | bigint(20)  |         1 |           0 | 9223372036854775807 |              1 |               0.0000 |
-- +-------------------+-------------------+-------------+-----------+-------------+-----------+-------------+---------------------+----------------+----------------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER
VIEW schema_auto_increment_columns (
  table_schema,
  table_name,
  column_name,
  data_type,
  column_type,
  is_signed,
  is_unsigned,
  max_value,
  auto_increment,
  auto_increment_ratio
) AS
SELECT TABLE_SCHEMA,
       TABLE_NAME,
       COLUMN_NAME,
       DATA_TYPE,
       COLUMN_TYPE,
       (LOCATE('unsigned', COLUMN_TYPE) = 0) AS is_signed,
       (LOCATE('unsigned', COLUMN_TYPE) > 0) AS is_unsigned,
       (
          CASE DATA_TYPE
            WHEN 'tinyint' THEN 255
            WHEN 'smallint' THEN 65535
            WHEN 'mediumint' THEN 16777215
            WHEN 'int' THEN 4294967295
            WHEN 'bigint' THEN 18446744073709551615
          END >> IF(LOCATE('unsigned', COLUMN_TYPE) > 0, 0, 1)
       ) AS max_value,
       AUTO_INCREMENT,
       AUTO_INCREMENT / (
         CASE DATA_TYPE
           WHEN 'tinyint' THEN 255
           WHEN 'smallint' THEN 65535
           WHEN 'mediumint' THEN 16777215
           WHEN 'int' THEN 4294967295
           WHEN 'bigint' THEN 18446744073709551615
         END >> IF(LOCATE('unsigned', COLUMN_TYPE) > 0, 0, 1)
       ) AS auto_increment_ratio
  FROM INFORMATION_SCHEMA.COLUMNS
 INNER JOIN INFORMATION_SCHEMA.TABLES USING (TABLE_SCHEMA, TABLE_NAME)
 WHERE TABLE_SCHEMA NOT IN ('mysql', 'sys', 'INFORMATION_SCHEMA', 'performance_schema')
   AND TABLE_TYPE='BASE TABLE'
   AND EXTRA='auto_increment'
 ORDER BY auto_increment_ratio DESC, max_value;

--
-- View: x$schema_flattened_keys
--
-- Helper view for the schema_redundant_keys view.
--
-- mysql> select * from sys.x$schema_flattened_keys;
-- +---------------+---------------------+------------------------------+------------+----------------+-----------------+
-- | table_schema  | table_name          | index_name                   | non_unique | subpart_exists | index_columns   |
-- +---------------+---------------------+------------------------------+------------+----------------+-----------------+
-- | mem__advisors | advisor_initialized | PRIMARY                      |          0 |              0 | advisorClassId  |
-- | mem__advisors | advisor_schedules   | advisorClassIdIdx            |          1 |              0 | advisorClassId  |
-- | mem__advisors | advisor_schedules   | PRIMARY                      |          0 |              0 | schedule_id     |
-- | mem__advisors | app_identity_path   | FK_7xbq2i81hgo0xlvnb6rr77s21 |          1 |              0 | for_schedule_id |
-- | mem__advisors | app_identity_path   | PRIMARY                      |          0 |              0 | hib_id          |
-- ...
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER
VIEW x$schema_flattened_keys (
  table_schema,
  table_name,
  index_name,
  non_unique,
  subpart_exists,
  index_columns
) AS
  SELECT
    TABLE_SCHEMA,
    TABLE_NAME,
    INDEX_NAME,
    MAX(NON_UNIQUE) AS non_unique,
    MAX(IF(SUB_PART IS NULL, 0, 1)) AS subpart_exists,
    GROUP_CONCAT(COLUMN_NAME ORDER BY SEQ_IN_INDEX) AS index_columns
  FROM INFORMATION_SCHEMA.STATISTICS
  WHERE
    INDEX_TYPE='BTREE'
    AND TABLE_SCHEMA NOT IN ('mysql', 'sys', 'INFORMATION_SCHEMA', 'PERFORMANCE_SCHEMA')
  GROUP BY
    TABLE_SCHEMA, TABLE_NAME, INDEX_NAME;

--
-- View: schema_redundant_keys
--
-- Shows indexes which are made redundant (or duplicate) by other (dominant) keys.
--
-- mysql> select * from sys.schema_redundant_indexes\G
-- *************************** 1. row ***************************
--               table_schema: test
--                 table_name: rkey
--       redundant_index_name: j
--    redundant_index_columns: j
-- redundant_index_non_unique: 1
--        dominant_index_name: j_2
--     dominant_index_columns: j,k
--  dominant_index_non_unique: 1
--             subpart_exists: 0
--             sql_drop_index: ALTER TABLE `test`.`rkey` DROP INDEX `j`
-- 1 row in set (0.20 sec)
-- 
-- mysql> SHOW CREATE TABLE test.rkey\G
-- *************************** 1. row ***************************
--        Table: rkey
-- Create Table: CREATE TABLE `rkey` (
--   `i` int(11) NOT NULL,
--   `j` int(11) DEFAULT NULL,
--   `k` int(11) DEFAULT NULL,
--   PRIMARY KEY (`i`),
--   KEY `j` (`j`),
--   KEY `j_2` (`j`,`k`)
-- ) ENGINE=InnoDB DEFAULT CHARSET=latin1
-- 1 row in set (0.06 sec)
-- 

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER
VIEW schema_redundant_indexes (
  table_schema,
  table_name,
  redundant_index_name,
  redundant_index_columns,
  redundant_index_non_unique,
  dominant_index_name,
  dominant_index_columns,
  dominant_index_non_unique,
  subpart_exists,
  sql_drop_index
) AS
  SELECT
    redundant_keys.table_schema,
    redundant_keys.table_name,
    redundant_keys.index_name AS redundant_index_name,
    redundant_keys.index_columns AS redundant_index_columns,
    redundant_keys.non_unique AS redundant_index_non_unique,
    dominant_keys.index_name AS dominant_index_name,
    dominant_keys.index_columns AS dominant_index_columns,
    dominant_keys.non_unique AS dominant_index_non_unique,
    IF(redundant_keys.subpart_exists OR dominant_keys.subpart_exists, 1 ,0) AS subpart_exists,
    CONCAT(
      'ALTER TABLE `', redundant_keys.table_schema, '`.`', redundant_keys.table_name, '` DROP INDEX `', redundant_keys.index_name, '`'
      ) AS sql_drop_index
  FROM
    x$schema_flattened_keys AS redundant_keys
    INNER JOIN x$schema_flattened_keys AS dominant_keys
    USING (TABLE_SCHEMA, TABLE_NAME)
  WHERE
    redundant_keys.index_name != dominant_keys.index_name
    AND (
      ( 
        /* Identical columns */
        (redundant_keys.index_columns = dominant_keys.index_columns)
        AND (
          (redundant_keys.non_unique > dominant_keys.non_unique)
          OR (redundant_keys.non_unique = dominant_keys.non_unique 
          	AND IF(redundant_keys.index_name='PRIMARY', '', redundant_keys.index_name) > IF(dominant_keys.index_name='PRIMARY', '', dominant_keys.index_name)
          )
        )
      )
      OR
      ( 
        /* Non-unique prefix columns */
        LOCATE(CONCAT(redundant_keys.index_columns, ','), dominant_keys.index_columns) = 1
        AND redundant_keys.non_unique = 1
      )
      OR
      ( 
        /* Unique prefix columns */
        LOCATE(CONCAT(dominant_keys.index_columns, ','), redundant_keys.index_columns) = 1
        AND dominant_keys.non_unique = 0
      )
    );

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: ps_check_lost_instrumentation
-- 
-- Used to check whether Performance Schema is not able to monitor
-- all runtime data - only returns variables that have lost instruments
--
-- mysql> select * from ps_check_lost_instrumentation;
-- +----------------------------------------+----------------+
-- | variable_name                          | variable_value |
-- +----------------------------------------+----------------+
-- | Performance_schema_file_handles_lost   | 101223         |
-- | Performance_schema_file_instances_lost | 1231           |
-- +----------------------------------------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW ps_check_lost_instrumentation (
  variable_name,
  variable_value
)
AS
SELECT variable_name, variable_value
  FROM performance_schema.global_status
 WHERE variable_name LIKE 'perf%lost'
   AND variable_value > 0;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: latest_file_io
--
-- Shows the latest file IO, by file / thread.
--
-- mysql> select * from latest_file_io limit 5;
-- +----------------------+----------------------------------------+------------+-----------+-----------+
-- | thread               | file                                   | latency    | operation | requested |
-- +----------------------+----------------------------------------+------------+-----------+-----------+
-- | msandbox@localhost:1 | @@tmpdir/#sqlcf28_1_4e.MYI             | 9.26 us    | write     | 124 bytes |
-- | msandbox@localhost:1 | @@tmpdir/#sqlcf28_1_4e.MYI             | 4.00 us    | write     | 2 bytes   |
-- | msandbox@localhost:1 | @@tmpdir/#sqlcf28_1_4e.MYI             | 56.34 us   | close     | NULL      |
-- | msandbox@localhost:1 | @@tmpdir/#sqlcf28_1_4e.MYD             | 53.93 us   | close     | NULL      |
-- | msandbox@localhost:1 | @@tmpdir/#sqlcf28_1_4e.MYI             | 104.05 ms  | delete    | NULL      |
-- +----------------------+----------------------------------------+------------+-----------+-----------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW latest_file_io (
  thread,
  file,
  latency,
  operation,
  requested
) AS
SELECT IF(id IS NULL, 
             CONCAT(SUBSTRING_INDEX(name, '/', -1), ':', thread_id), 
             CONCAT(user, '@', host, ':', id)
          ) thread, 
       sys.format_path(object_name) file, 
       sys.format_time(timer_wait) AS latency, 
       operation, 
       sys.format_bytes(number_of_bytes) AS requested
  FROM performance_schema.events_waits_history_long 
  JOIN performance_schema.threads USING (thread_id)
  LEFT JOIN information_schema.processlist ON processlist_id = id
 WHERE object_name IS NOT NULL
   AND event_name LIKE 'wait/io/file/%'
 ORDER BY timer_start;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$latest_file_io
--
-- Shows the latest file IO, by file / thread.
--
-- mysql> SELECT * FROM x$latest_file_io LIMIT 5;
-- +------------------+------------------------------------------------------------------------------------+-------------+-----------+-----------+
-- | thread           | file                                                                               | latency     | operation | requested |
-- +------------------+------------------------------------------------------------------------------------+-------------+-----------+-----------+
-- | root@localhost:6 | /Users/mark/sandboxes/msb_5_7_2/data/ps_helper/user_summary_by_statement_type.frm~ |    26152490 | write     |      4210 |
-- | root@localhost:6 | /Users/mark/sandboxes/msb_5_7_2/data/ps_helper/user_summary_by_statement_type.frm~ | 30062722690 | sync      |      NULL |
-- | root@localhost:6 | /Users/mark/sandboxes/msb_5_7_2/data/ps_helper/user_summary_by_statement_type.frm~ |    34144890 | close     |      NULL |
-- | root@localhost:6 | /Users/mark/sandboxes/msb_5_7_2/data/ps_helper/check_lost_instrumentation.frm      |   113001980 | open      |      NULL |
-- | root@localhost:6 | /Users/mark/sandboxes/msb_5_7_2/data/ps_helper/check_lost_instrumentation.frm      |     9553180 | read      |        10 |
-- +------------------+------------------------------------------------------------------------------------+-------------+-----------+-----------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$latest_file_io (
  thread,
  file,
  latency,
  operation,
  requested
) AS
SELECT IF(id IS NULL, 
             CONCAT(SUBSTRING_INDEX(name, '/', -1), ':', thread_id), 
             CONCAT(user, '@', host, ':', id)
          ) thread, 
       object_name file, 
       timer_wait AS latency, 
       operation, 
       number_of_bytes AS requested
  FROM performance_schema.events_waits_history_long 
  JOIN performance_schema.threads USING (thread_id)
  LEFT JOIN information_schema.processlist ON processlist_id = id
 WHERE object_name IS NOT NULL
   AND event_name LIKE 'wait/io/file/%'
 ORDER BY timer_start;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: io_by_thread_by_latency
--
-- Show the top IO consumers by thread, ordered by total latency
--
-- mysql> select * from io_by_thread_by_latency;
-- +---------------------+-------+---------------+-------------+-------------+-------------+-----------+----------------+
-- | user                | total | total_latency | min_latency | avg_latency | max_latency | thread_id | processlist_id |
-- +---------------------+-------+---------------+-------------+-------------+-------------+-----------+----------------+
-- | root@localhost      | 11580 | 18.01 s       | 429.78 ns   | 1.12 ms     | 181.07 ms   |        25 |              6 |
-- | main                |  1358 | 1.31 s        | 475.02 ns   | 2.27 ms     | 350.70 ms   |         1 |           NULL |
-- | page_cleaner_thread |   654 | 147.44 ms     | 588.12 ns   | 225.44 us   | 46.41 ms    |        18 |           NULL |
-- | io_write_thread     |   131 | 107.75 ms     | 8.60 us     | 822.55 us   | 27.69 ms    |         8 |           NULL |
-- | io_write_thread     |    46 | 47.07 ms      | 10.64 us    | 1.02 ms     | 16.90 ms    |         9 |           NULL |
-- | io_write_thread     |    71 | 46.99 ms      | 9.11 us     | 661.81 us   | 17.04 ms    |        11 |           NULL |
-- | io_log_thread       |    20 | 21.01 ms      | 14.25 us    | 1.05 ms     | 7.08 ms     |         3 |           NULL |
-- | srv_master_thread   |    13 | 17.60 ms      | 8.49 us     | 1.35 ms     | 9.99 ms     |        16 |           NULL |
-- | srv_purge_thread    |     4 | 1.81 ms       | 34.31 us    | 452.45 us   | 1.02 ms     |        17 |           NULL |
-- | io_write_thread     |    19 | 951.39 us     | 9.75 us     | 50.07 us    | 297.47 us   |        10 |           NULL |
-- | signal_handler      |     3 | 218.03 us     | 21.64 us    | 72.68 us    | 154.84 us   |        19 |           NULL |
-- +---------------------+-------+---------------+-------------+-------------+-------------+-----------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW io_by_thread_by_latency (
  user,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency,
  thread_id,
  processlist_id
)
AS
SELECT IF(processlist_id IS NULL, 
             SUBSTRING_INDEX(name, '/', -1), 
             CONCAT(processlist_user, '@', processlist_host)
          ) user, 
       SUM(count_star) total,
       sys.format_time(SUM(sum_timer_wait)) total_latency,
       sys.format_time(MIN(min_timer_wait)) min_latency,
       sys.format_time(AVG(avg_timer_wait)) avg_latency,
       sys.format_time(MAX(max_timer_wait)) max_latency,
       thread_id,
       processlist_id
  FROM performance_schema.events_waits_summary_by_thread_by_event_name 
  LEFT JOIN performance_schema.threads USING (thread_id)
 WHERE event_name LIKE 'wait/io/file/%'
   AND sum_timer_wait > 0
 GROUP BY thread_id, processlist_id, user
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$io_by_thread_by_latency
--
-- Show the top IO consumers by thread, ordered by total latency
--
-- mysql> select * from x$io_by_thread_by_latency;
-- +---------------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+
-- | user                | total | total_latency  | min_latency | avg_latency     | max_latency  | thread_id | processlist_id |
-- +---------------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+
-- | root@localhost      | 11587 | 18007539905680 |      429780 | 1120831681.6667 | 181065665560 |        25 |              6 |
-- | main                |  1358 |  1309001741320 |      475020 | 2269581997.8000 | 350700491310 |         1 |           NULL |
-- | page_cleaner_thread |   654 |   147435455960 |      588120 |  225436198.0000 |  46412043990 |        18 |           NULL |
-- | io_write_thread     |   131 |   107754483070 |     8603140 |  822553303.0000 |  27691592500 |         8 |           NULL |
-- | io_write_thread     |    46 |    47074926860 |    10642710 | 1023367631.0000 |  16899745070 |         9 |           NULL |
-- | io_write_thread     |    71 |    46988801210 |     9108320 |  661814075.0000 |  17042760020 |        11 |           NULL |
-- | io_log_thread       |    20 |    21007710490 |    14250600 | 1050385336.0000 |   7081255090 |         3 |           NULL |
-- | srv_master_thread   |    13 |    17601511720 |     8486270 | 1353962324.0000 |   9990100380 |        16 |           NULL |
-- | srv_purge_thread    |     4 |     1809792270 |    34307000 |  452447879.0000 |   1018887740 |        17 |           NULL |
-- | io_write_thread     |    19 |      951385890 |     9745450 |   50072763.0000 |    297468080 |        10 |           NULL |
-- | signal_handler      |     3 |      218026640 |    21639800 |   72675421.0000 |    154841440 |        19 |           NULL |
-- +---------------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$io_by_thread_by_latency (
  user,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency,
  thread_id,
  processlist_id
)
AS
SELECT IF(processlist_id IS NULL, 
             SUBSTRING_INDEX(name, '/', -1), 
             CONCAT(processlist_user, '@', processlist_host)
          ) user, 
       SUM(count_star) total,
       SUM(sum_timer_wait) total_latency,
       MIN(min_timer_wait) min_latency,
       AVG(avg_timer_wait) avg_latency,
       MAX(max_timer_wait) max_latency,
       thread_id,
       processlist_id
  FROM performance_schema.events_waits_summary_by_thread_by_event_name 
  LEFT JOIN performance_schema.threads USING (thread_id)
 WHERE event_name LIKE 'wait/io/file/%'
   AND sum_timer_wait > 0
 GROUP BY thread_id, processlist_id, user
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: io_global_by_file_by_bytes
--
-- Shows the top global IO consumers by bytes usage by file.
--
-- mysql> SELECT * FROM io_global_by_file_by_bytes LIMIT 5;
-- +--------------------------------------------+------------+------------+-----------+-------------+---------------+-----------+------------+-----------+
-- | file                                       | count_read | total_read | avg_read  | count_write | total_written | avg_write | total      | write_pct |
-- +--------------------------------------------+------------+------------+-----------+-------------+---------------+-----------+------------+-----------+
-- | @@datadir/ibdata1                          |        147 | 4.27 MiB   | 29.71 KiB |           3 | 48.00 KiB     | 16.00 KiB | 4.31 MiB   |      1.09 |
-- | @@datadir/mysql/proc.MYD                   |        347 | 85.35 KiB  | 252 bytes |         111 | 19.08 KiB     | 176 bytes | 104.43 KiB |     18.27 |
-- | @@datadir/ib_logfile0                      |          6 | 68.00 KiB  | 11.33 KiB |           8 | 4.00 KiB      | 512 bytes | 72.00 KiB  |      5.56 |
-- | /opt/mysql/5.5.33/share/english/errmsg.sys |          3 | 43.68 KiB  | 14.56 KiB |           0 | 0 bytes       | 0 bytes   | 43.68 KiB  |      0.00 |
-- | /opt/mysql/5.5.33/share/charsets/Index.xml |          1 | 17.89 KiB  | 17.89 KiB |           0 | 0 bytes       | 0 bytes   | 17.89 KiB  |      0.00 |
-- +--------------------------------------------+------------+------------+-----------+-------------+---------------+-----------+------------+-----------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW io_global_by_file_by_bytes (
  file,
  count_read,
  total_read,
  avg_read,
  count_write,
  total_written,
  avg_write,
  total,
  write_pct
) AS
SELECT sys.format_path(file_name) AS file, 
       count_read, 
       sys.format_bytes(sum_number_of_bytes_read) AS total_read,
       sys.format_bytes(IFNULL(sum_number_of_bytes_read / NULLIF(count_read, 0), 0)) AS avg_read,
       count_write, 
       sys.format_bytes(sum_number_of_bytes_write) AS total_written,
       sys.format_bytes(IFNULL(sum_number_of_bytes_write / NULLIF(count_write, 0), 0.00)) AS avg_write,
       sys.format_bytes(sum_number_of_bytes_read + sum_number_of_bytes_write) AS total, 
       IFNULL(ROUND(100-((sum_number_of_bytes_read/ NULLIF((sum_number_of_bytes_read+sum_number_of_bytes_write), 0))*100), 2), 0.00) AS write_pct 
  FROM performance_schema.file_summary_by_instance
 ORDER BY sum_number_of_bytes_read + sum_number_of_bytes_write DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$io_global_by_file_by_bytes
--
-- Shows the top global IO consumers by bytes usage by file.
--
-- mysql> SELECT * FROM x$io_global_by_file_by_bytes LIMIT 5;
-- +------------------------------------------------------+------------+------------+------------+-------------+---------------+------------+---------+-----------+
-- | file                                                 | count_read | total_read | avg_read   | count_write | total_written | avg_write  | total   | write_pct |
-- +------------------------------------------------------+------------+------------+------------+-------------+---------------+------------+---------+-----------+
-- | /Users/mark/sandboxes/msb_5_5_33/data/ibdata1        |        147 |    4472832 | 30427.4286 |           3 |         49152 | 16384.0000 | 4521984 |      1.09 |
-- | /Users/mark/sandboxes/msb_5_5_33/data/mysql/proc.MYD |        347 |      87397 |   251.8646 |         111 |         19536 |   176.0000 |  106933 |     18.27 |
-- | /Users/mark/sandboxes/msb_5_5_33/data/ib_logfile0    |          6 |      69632 | 11605.3333 |           8 |          4096 |   512.0000 |   73728 |      5.56 |
-- | /opt/mysql/5.5.33/share/english/errmsg.sys           |          3 |      44724 | 14908.0000 |           0 |             0 |     0.0000 |   44724 |      0.00 |
-- | /opt/mysql/5.5.33/share/charsets/Index.xml           |          1 |      18317 | 18317.0000 |           0 |             0 |     0.0000 |   18317 |      0.00 |
-- +------------------------------------------------------+------------+------------+------------+-------------+---------------+------------+---------+-----------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$io_global_by_file_by_bytes (
  file,
  count_read,
  total_read,
  avg_read,
  count_write,
  total_written,
  avg_write,
  total,
  write_pct
) AS
SELECT file_name AS file, 
       count_read, 
       sum_number_of_bytes_read AS total_read,
       IFNULL(sum_number_of_bytes_read / NULLIF(count_read, 0), 0) AS avg_read,
       count_write, 
       sum_number_of_bytes_write AS total_written,
       IFNULL(sum_number_of_bytes_write / NULLIF(count_write, 0), 0.00) AS avg_write,
       sum_number_of_bytes_read + sum_number_of_bytes_write AS total, 
       IFNULL(ROUND(100-((sum_number_of_bytes_read/ NULLIF((sum_number_of_bytes_read+sum_number_of_bytes_write), 0))*100), 2), 0.00) AS write_pct 
  FROM performance_schema.file_summary_by_instance
 ORDER BY sum_number_of_bytes_read + sum_number_of_bytes_write DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: io_global_by_file_by_latency
--
-- Shows the top global IO consumers by latency by file.
--
-- mysql> select * from io_global_by_file_by_latency limit 5;
-- +-----------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
-- | file                                                      | total | total_latency | count_read | read_latency | count_write | write_latency | count_misc | misc_latency |
-- +-----------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
-- | @@datadir/sys/wait_classes_global_by_avg_latency_raw.frm~ |    24 | 451.99 ms     |          0 | 0 ps         |           4 | 108.07 us     |         20 | 451.88 ms    |
-- | @@datadir/sys/innodb_buffer_stats_by_schema_raw.frm~      |    24 | 379.84 ms     |          0 | 0 ps         |           4 | 108.88 us     |         20 | 379.73 ms    |
-- | @@datadir/sys/io_by_thread_by_latency_raw.frm~            |    24 | 379.46 ms     |          0 | 0 ps         |           4 | 101.37 us     |         20 | 379.36 ms    |
-- | @@datadir/ibtmp1                                          |    53 | 373.45 ms     |          0 | 0 ps         |          48 | 246.08 ms     |          5 | 127.37 ms    |
-- | @@datadir/sys/statement_analysis_raw.frm~                 |    24 | 353.14 ms     |          0 | 0 ps         |           4 | 94.96 us      |         20 | 353.04 ms    |
-- +-----------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW io_global_by_file_by_latency (
  file,
  total,
  total_latency,
  count_read,
  read_latency,
  count_write,
  write_latency,
  count_misc,
  misc_latency
) AS
SELECT sys.format_path(file_name) AS file, 
       count_star AS total, 
       sys.format_time(sum_timer_wait) AS total_latency,
       count_read,
       sys.format_time(sum_timer_read) AS read_latency,
       count_write,
       sys.format_time(sum_timer_write) AS write_latency,
       count_misc,
       sys.format_time(sum_timer_misc) AS misc_latency
  FROM performance_schema.file_summary_by_instance
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$io_global_by_file_by_latency
--
-- Shows the top global IO consumers by latency by file.
--
-- mysql> select * from x$io_global_by_file_by_latency limit 5;
-- +--------------------------------------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
-- | file                                                                                 | total | total_latency | count_read | read_latency | count_write | write_latency | count_misc | misc_latency |
-- +--------------------------------------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
-- | /Users/mark/sandboxes/msb_5_7_2/data/sys/wait_classes_global_by_avg_latency_raw.frm~ |    30 |  513959738110 |          0 |            0 |           5 |     132130960 |         25 | 513827607150 |
-- | /Users/mark/sandboxes/msb_5_7_2/data/sys/innodb_buffer_stats_by_schema_raw.frm~      |    30 |  490149888410 |          0 |            0 |           5 |     483887040 |         25 | 489666001370 |
-- | /Users/mark/sandboxes/msb_5_7_2/data/sys/io_by_thread_by_latency_raw.frm~            |    30 |  427724241620 |          0 |            0 |           5 |     131399580 |         25 | 427592842040 |
-- | /Users/mark/sandboxes/msb_5_7_2/data/sys/innodb_buffer_stats_by_schema.frm~          |    30 |  406392559950 |          0 |            0 |           5 |     104082160 |         25 | 406288477790 |
-- | /Users/mark/sandboxes/msb_5_7_2/data/sys/statement_analysis_raw.frm~                 |    30 |  395527510430 |          0 |            0 |           5 |     118724840 |         25 | 395408785590 |
-- +--------------------------------------------------------------------------------------+-------+---------------+------------+--------------+-------------+---------------+------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$io_global_by_file_by_latency (
  file,
  total,
  total_latency,
  count_read,
  read_latency,
  count_write,
  write_latency,
  count_misc,
  misc_latency
) AS
SELECT file_name AS file, 
       count_star AS total, 
       sum_timer_wait AS total_latency,
       count_read,
       sum_timer_read AS read_latency,
       count_write,
       sum_timer_write AS write_latency,
       count_misc,
       sum_timer_misc AS misc_latency
  FROM performance_schema.file_summary_by_instance
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: io_global_by_wait_by_bytes
--
-- Shows the top global IO consumer classes by bytes usage.
--
-- mysql> select * from io_global_by_wait_by_bytes;
-- +--------------------+--------+---------------+-------------+-------------+-------------+------------+------------+-----------+-------------+---------------+-------------+-----------------+
-- | event_name         | total  | total_latency | min_latency | avg_latency | max_latency | count_read | total_read | avg_read  | count_write | total_written | avg_written | total_requested |
-- +--------------------+--------+---------------+-------------+-------------+-------------+------------+------------+-----------+-------------+---------------+-------------+-----------------+
-- | myisam/dfile       | 163681 | 983.13 ms     | 379.08 ns   | 6.01 us     | 22.06 ms    |      68737 | 127.31 MiB | 1.90 KiB  |     1012221 | 121.52 MiB    | 126 bytes   | 248.83 MiB      |
-- | myisam/kfile       |   1775 | 375.13 ms     | 1.02 us     | 211.34 us   | 35.15 ms    |      54066 | 9.97 MiB   | 193 bytes |      428257 | 12.40 MiB     | 30 bytes    | 22.37 MiB       |
-- | sql/FRM            |  57889 | 8.40 s        | 19.44 ns    | 145.05 us   | 336.71 ms   |       8009 | 2.60 MiB   | 341 bytes |       14675 | 2.91 MiB      | 208 bytes   | 5.51 MiB        |
-- | sql/global_ddl_log |    164 | 75.96 ms      | 5.72 us     | 463.19 us   | 7.43 ms     |         20 | 80.00 KiB  | 4.00 KiB  |          76 | 304.00 KiB    | 4.00 KiB    | 384.00 KiB      |
-- | sql/file_parser    |    419 | 601.37 ms     | 1.96 us     | 1.44 ms     | 37.14 ms    |         66 | 42.01 KiB  | 652 bytes |          64 | 226.98 KiB    | 3.55 KiB    | 268.99 KiB      |
-- | sql/binlog         |    190 | 6.79 s        | 1.56 us     | 35.76 ms    | 4.21 s      |         52 | 60.54 KiB  | 1.16 KiB  |           0 | 0 bytes       | 0 bytes     | 60.54 KiB       |
-- | sql/ERRMSG         |      5 | 2.03 s        | 8.61 us     | 405.40 ms   | 2.03 s      |          3 | 51.82 KiB  | 17.27 KiB |           0 | 0 bytes       | 0 bytes     | 51.82 KiB       |
-- | mysys/charset      |      3 | 196.52 us     | 17.61 us    | 65.51 us    | 137.33 us   |          1 | 17.83 KiB  | 17.83 KiB |           0 | 0 bytes       | 0 bytes     | 17.83 KiB       |
-- | sql/partition      |     81 | 18.87 ms      | 888.08 ns   | 232.92 us   | 4.67 ms     |         66 | 2.75 KiB   | 43 bytes  |           8 | 288 bytes     | 36 bytes    | 3.04 KiB        |
-- | sql/dbopt          | 329166 | 26.95 s       | 2.06 us     | 81.89 us    | 178.71 ms   |          0 | 0 bytes    | 0 bytes   |           9 | 585 bytes     | 65 bytes    | 585 bytes       |
-- | sql/relaylog       |      7 | 1.18 ms       | 838.84 ns   | 168.30 us   | 892.70 us   |          0 | 0 bytes    | 0 bytes   |           1 | 120 bytes     | 120 bytes   | 120 bytes       |
-- | mysys/cnf          |      5 | 171.61 us     | 303.26 ns   | 34.32 us    | 115.21 us   |          3 | 56 bytes   | 19 bytes  |           0 | 0 bytes       | 0 bytes     | 56 bytes        |
-- | sql/pid            |      3 | 220.55 us     | 29.29 us    | 73.52 us    | 143.11 us   |          0 | 0 bytes    | 0 bytes   |           1 | 5 bytes       | 5 bytes     | 5 bytes         |
-- | sql/casetest       |      1 | 121.19 us     | 121.19 us   | 121.19 us   | 121.19 us   |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     | 0 bytes         |
-- | sql/binlog_index   |      5 | 593.47 us     | 1.07 us     | 118.69 us   | 535.90 us   |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     | 0 bytes         |
-- | sql/misc           |     23 | 2.73 ms       | 65.14 us    | 118.50 us   | 255.31 us   |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     | 0 bytes         |
-- +--------------------+--------+---------------+-------------+-------------+-------------+------------+------------+-----------+-------------+---------------+-------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW io_global_by_wait_by_bytes (
  event_name,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency,
  count_read,
  total_read,
  avg_read,
  count_write,
  total_written,
  avg_written,
  total_requested
) AS
SELECT SUBSTRING_INDEX(event_name, '/', -2) event_name,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(min_timer_wait) AS min_latency,
       sys.format_time(avg_timer_wait) AS avg_latency,
       sys.format_time(max_timer_wait) AS max_latency,
       count_read,
       sys.format_bytes(sum_number_of_bytes_read) AS total_read,
       sys.format_bytes(IFNULL(sum_number_of_bytes_read / NULLIF(count_read, 0), 0)) AS avg_read,
       count_write,
       sys.format_bytes(sum_number_of_bytes_write) AS total_written,
       sys.format_bytes(IFNULL(sum_number_of_bytes_write / NULLIF(count_write, 0), 0)) AS avg_written,
       sys.format_bytes(sum_number_of_bytes_write + sum_number_of_bytes_read) AS total_requested
  FROM performance_schema.file_summary_by_event_name
 WHERE event_name LIKE 'wait/io/file/%' 
   AND count_star > 0
 ORDER BY sum_number_of_bytes_write + sum_number_of_bytes_read DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$io_global_by_wait_by_bytes
--
-- Shows the top global IO consumer classes by bytes usage.
--
-- mysql> select * from x$io_global_by_wait_by_bytes;
-- +-------------------------+-------+---------------+-------------+-------------+--------------+------------+------------+------------+-------------+---------------+-------------+-----------------+
-- | event_name              | total | total_latency | min_latency | avg_latency | max_latency  | count_read | total_read | avg_read   | count_write | total_written | avg_written | total_requested |
-- +-------------------------+-------+---------------+-------------+-------------+--------------+------------+------------+------------+-------------+---------------+-------------+-----------------+
-- | innodb/innodb_data_file |   151 |  334405721910 |     8399560 |  2214607429 | 107444600380 |        147 |    4472832 | 30427.4286 |           0 |             0 |      0.0000 |         4472832 |
-- | sql/FRM                 |   555 |  147752034170 |      674830 |   266219881 |  57705900850 |        270 |     112174 |   415.4593 |           0 |             0 |      0.0000 |          112174 |
-- | innodb/innodb_log_file  |    22 |   56776429970 |     2476890 |  2580746816 |  18883021430 |          6 |      69632 | 11605.3333 |           5 |          2560 |    512.0000 |           72192 |
-- | sql/ERRMSG              |     5 |   11862056180 |    14883960 |  2372411236 |  11109473700 |          3 |      44724 | 14908.0000 |           0 |             0 |      0.0000 |           44724 |
-- | mysys/charset           |     3 |    7256869230 |    19796270 |  2418956410 |   7198498320 |          1 |      18317 | 18317.0000 |           0 |             0 |      0.0000 |           18317 |
-- | myisam/kfile            |   135 |   10194698280 |      784160 |    75516283 |   2593514950 |         40 |       9216 |   230.4000 |          33 |          1017 |     30.8182 |           10233 |
-- | myisam/dfile            |    68 |   10527909730 |      772850 |   154822201 |   7600014630 |          9 |       6667 |   740.7778 |           0 |             0 |      0.0000 |            6667 |
-- | sql/pid                 |     3 |     216507330 |    41296580 |    72169110 |    100617530 |          0 |          0 |     0.0000 |           1 |             6 |      6.0000 |               6 |
-- | sql/casetest            |     5 |     185261570 |     4105530 |    37052314 |    113488310 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |               0 |
-- | sql/global_ddl_log      |     2 |      21538010 |     3121560 |    10769005 |     18416450 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |               0 |
-- | sql/dbopt               |    10 |    1004267680 |     1164930 |   100426768 |    939894930 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |               0 |
-- +-------------------------+-------+---------------+-------------+-------------+--------------+------------+------------+------------+-------------+---------------+-------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$io_global_by_wait_by_bytes (
  event_name,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency,
  count_read,
  total_read,
  avg_read,
  count_write,
  total_written,
  avg_written,
  total_requested
) AS
SELECT SUBSTRING_INDEX(event_name, '/', -2) AS event_name,
       count_star AS total,
       sum_timer_wait AS total_latency,
       min_timer_wait AS min_latency,
       avg_timer_wait AS avg_latency,
       max_timer_wait AS max_latency,
       count_read,
       sum_number_of_bytes_read AS total_read,
       IFNULL(sum_number_of_bytes_read / NULLIF(count_read, 0), 0) AS avg_read,
       count_write,
       sum_number_of_bytes_write AS total_written,
       IFNULL(sum_number_of_bytes_write / NULLIF(count_write, 0), 0) AS avg_written,
       sum_number_of_bytes_write + sum_number_of_bytes_read AS total_requested
  FROM performance_schema.file_summary_by_event_name
 WHERE event_name LIKE 'wait/io/file/%' 
   AND count_star > 0
 ORDER BY sum_number_of_bytes_write + sum_number_of_bytes_read DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: io_global_by_wait_by_latency
--
-- Shows the top global IO consumers by latency.
--
-- mysql> SELECT * FROM io_global_by_wait_by_latency;
-- +-------------------------+-------+---------------+-------------+-------------+--------------+---------------+--------------+------------+------------+-----------+-------------+---------------+-------------+
-- | event_name              | total | total_latency | avg_latency | max_latency | read_latency | write_latency | misc_latency | count_read | total_read | avg_read  | count_write | total_written | avg_written |
-- +-------------------------+-------+---------------+-------------+-------------+--------------+---------------+--------------+------------+------------+-----------+-------------+---------------+-------------+
-- | sql/file_parser         |  5433 | 30.20 s       | 5.56 ms     | 203.65 ms   | 22.08 ms     | 24.89 ms      | 30.16 s      |         24 | 6.18 KiB   | 264 bytes |         737 | 2.15 MiB      | 2.99 KiB    |
-- | innodb/innodb_data_file |  1344 | 1.52 s        | 1.13 ms     | 350.70 ms   | 203.82 ms    | 450.96 ms     | 868.21 ms    |        147 | 2.30 MiB   | 16.00 KiB |        1001 | 53.61 MiB     | 54.84 KiB   |
-- | innodb/innodb_log_file  |   828 | 893.48 ms     | 1.08 ms     | 30.11 ms    | 16.32 ms     | 705.89 ms     | 171.27 ms    |          6 | 68.00 KiB  | 11.33 KiB |         413 | 2.19 MiB      | 5.42 KiB    |
-- | myisam/kfile            |  7642 | 242.34 ms     | 31.71 us    | 19.27 ms    | 73.60 ms     | 23.48 ms      | 145.26 ms    |        758 | 135.63 KiB | 183 bytes |        4386 | 232.52 KiB    | 54 bytes    |
-- | myisam/dfile            | 12540 | 223.47 ms     | 17.82 us    | 32.50 ms    | 87.76 ms     | 16.97 ms      | 118.74 ms    |       5390 | 4.49 MiB   | 873 bytes |        1448 | 2.65 MiB      | 1.88 KiB    |
-- | csv/metadata            |     8 | 28.98 ms      | 3.62 ms     | 20.15 ms    | 399.27 us    | 0 ps          | 28.58 ms     |          2 | 70 bytes   | 35 bytes  |           0 | 0 bytes       | 0 bytes     |
-- | mysys/charset           |     3 | 24.24 ms      | 8.08 ms     | 24.15 ms    | 24.15 ms     | 0 ps          | 93.18 us     |          1 | 17.31 KiB  | 17.31 KiB |           0 | 0 bytes       | 0 bytes     |
-- | sql/ERRMSG              |     5 | 20.43 ms      | 4.09 ms     | 19.31 ms    | 20.32 ms     | 0 ps          | 103.20 us    |          3 | 58.97 KiB  | 19.66 KiB |           0 | 0 bytes       | 0 bytes     |
-- | mysys/cnf               |     5 | 11.37 ms      | 2.27 ms     | 11.28 ms    | 11.29 ms     | 0 ps          | 78.22 us     |          3 | 56 bytes   | 19 bytes  |           0 | 0 bytes       | 0 bytes     |
-- | sql/dbopt               |    57 | 4.04 ms       | 70.92 us    | 843.70 us   | 0 ps         | 186.43 us     | 3.86 ms      |          0 | 0 bytes    | 0 bytes   |           7 | 431 bytes     | 62 bytes    |
-- | csv/data                |     4 | 411.55 us     | 102.89 us   | 234.89 us   | 0 ps         | 0 ps          | 411.55 us    |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     |
-- | sql/misc                |    22 | 340.38 us     | 15.47 us    | 33.77 us    | 0 ps         | 0 ps          | 340.38 us    |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     |
-- | archive/data            |    39 | 277.86 us     | 7.12 us     | 16.18 us    | 0 ps         | 0 ps          | 277.86 us    |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     |
-- | sql/pid                 |     3 | 218.03 us     | 72.68 us    | 154.84 us   | 0 ps         | 21.64 us      | 196.39 us    |          0 | 0 bytes    | 0 bytes   |           1 | 6 bytes       | 6 bytes     |
-- | sql/casetest            |     5 | 197.15 us     | 39.43 us    | 126.31 us   | 0 ps         | 0 ps          | 197.15 us    |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     |
-- | sql/global_ddl_log      |     2 | 14.60 us      | 7.30 us     | 12.12 us    | 0 ps         | 0 ps          | 14.60 us     |          0 | 0 bytes    | 0 bytes   |           0 | 0 bytes       | 0 bytes     |
-- +-------------------------+-------+---------------+-------------+-------------+--------------+---------------+--------------+------------+------------+-----------+-------------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW io_global_by_wait_by_latency (
  event_name,
  total,
  total_latency,
  avg_latency,
  max_latency,
  read_latency,
  write_latency,
  misc_latency,
  count_read,
  total_read,
  avg_read,
  count_write,
  total_written,
  avg_written
) AS
SELECT SUBSTRING_INDEX(event_name, '/', -2) AS event_name,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(avg_timer_wait) AS avg_latency,
       sys.format_time(max_timer_wait) AS max_latency,
       sys.format_time(sum_timer_read) AS read_latency,
       sys.format_time(sum_timer_write) AS write_latency,
       sys.format_time(sum_timer_misc) AS misc_latency,
       count_read,
       sys.format_bytes(sum_number_of_bytes_read) AS total_read,
       sys.format_bytes(IFNULL(sum_number_of_bytes_read / NULLIF(count_read, 0), 0)) AS avg_read,
       count_write,
       sys.format_bytes(sum_number_of_bytes_write) AS total_written,
       sys.format_bytes(IFNULL(sum_number_of_bytes_write / NULLIF(count_write, 0), 0)) AS avg_written
  FROM performance_schema.file_summary_by_event_name 
 WHERE event_name LIKE 'wait/io/file/%'
   AND count_star > 0
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$io_global_by_wait_by_latency
--
-- Shows the top global IO consumers by latency.
--
-- mysql> select * from x$io_global_by_wait_by_latency;
-- +-------------------------+-------+----------------+-------------+--------------+--------------+---------------+----------------+------------+------------+------------+-------------+---------------+-------------+
-- | event_name              | total | total_latency  | avg_latency | max_latency  | read_latency | write_latency | misc_latency   | count_read | total_read | avg_read   | count_write | total_written | avg_written |
-- +-------------------------+-------+----------------+-------------+--------------+--------------+---------------+----------------+------------+------------+------------+-------------+---------------+-------------+
-- | sql/file_parser         |  5945 | 33615441247050 |  5654405471 | 203652881640 |  22093704230 |   27389668280 | 33565957874540 |         26 |       7008 |   269.5385 |         808 |       2479209 |   3068.3280 |
-- | sql/FRM                 |  6332 |  1755386796800 |   277224688 | 145624702340 | 519139578620 |    1677016640 |  1234570201540 |       2040 |     865905 |   424.4632 |         439 |        103445 |    235.6378 |
-- | innodb/innodb_data_file |  1344 |  1522989889460 |  1133176798 | 350700491310 | 203817502460 |  450959403830 |   868212983170 |        147 |    2408448 | 16384.0000 |        1001 |      56213504 |  56157.3467 |
-- | innodb/innodb_log_file  |   828 |   893475794640 |  1079076921 |  30108124800 |  16315236730 |  705886928240 |   171273629670 |          6 |      69632 | 11605.3333 |         413 |       2294272 |   5555.1380 |
-- | myisam/kfile            |  7826 |   246001992860 |    31433883 |  19265276810 |  74419162870 |   23923730090 |   147659099900 |        770 |     141058 |   183.1922 |        4516 |        249602 |     55.2706 |
-- | myisam/dfile            | 13431 |   228191713620 |    16989882 |  32500163410 |  89162969350 |   17341973610 |   121686770660 |       5819 |    4873176 |   837.4594 |        1577 |       2853444 |   1809.4128 |
-- | csv/metadata            |     8 |    28975194560 |  3621899320 |  20148109020 |    399265620 |             0 |    28575928940 |          2 |         70 |    35.0000 |           0 |             0 |      0.0000 |
-- | mysys/charset           |     3 |    24244722970 |  8081574072 |  24151547420 |  24151547420 |             0 |       93175550 |          1 |      17722 | 17722.0000 |           0 |             0 |      0.0000 |
-- | sql/ERRMSG              |     5 |    20427386850 |  4085477370 |  19312386730 |  20324183100 |             0 |      103203750 |          3 |      60390 | 20130.0000 |           0 |             0 |      0.0000 |
-- | mysys/cnf               |     5 |    11366169230 |  2273233846 |  11283602460 |  11287953040 |             0 |       78216190 |          3 |         56 |    18.6667 |           0 |             0 |      0.0000 |
-- | sql/dbopt               |    57 |     4042348570 |    70918224 |    843703380 |            0 |     186430270 |     3855918300 |          0 |          0 |     0.0000 |           7 |           431 |     61.5714 |
-- | csv/data                |     4 |      411548280 |   102887070 |    234886080 |            0 |             0 |      411548280 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |
-- | sql/misc                |    24 |      369128240 |    15380092 |     33771660 |            0 |             0 |      369128240 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |
-- | archive/data            |    39 |      277856540 |     7124169 |     16180840 |            0 |             0 |      277856540 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |
-- | sql/pid                 |     3 |      218026640 |    72675421 |    154841440 |            0 |      21639800 |      196386840 |          0 |          0 |     0.0000 |           1 |             6 |      6.0000 |
-- | sql/casetest            |     5 |      197152150 |    39430430 |    126310080 |            0 |             0 |      197152150 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |
-- | sql/global_ddl_log      |     2 |       14604980 |     7302490 |     12120550 |            0 |             0 |       14604980 |          0 |          0 |     0.0000 |           0 |             0 |      0.0000 |
-- +-------------------------+-------+----------------+-------------+--------------+--------------+---------------+----------------+------------+------------+------------+-------------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$io_global_by_wait_by_latency (
  event_name,
  total,
  total_latency,
  avg_latency,
  max_latency,
  read_latency,
  write_latency,
  misc_latency,
  count_read,
  total_read,
  avg_read,
  count_write,
  total_written,
  avg_written
) AS
SELECT SUBSTRING_INDEX(event_name, '/', -2) AS event_name,
       count_star AS total,
       sum_timer_wait AS total_latency,
       avg_timer_wait AS avg_latency,
       max_timer_wait AS max_latency,
       sum_timer_read AS read_latency,
       sum_timer_write AS write_latency,
       sum_timer_misc AS misc_latency,
       count_read,
       sum_number_of_bytes_read AS total_read,
       IFNULL(sum_number_of_bytes_read / NULLIF(count_read, 0), 0) AS avg_read,
       count_write,
       sum_number_of_bytes_write AS total_written,
       IFNULL(sum_number_of_bytes_write / NULLIF(count_write, 0), 0) AS avg_written
  FROM performance_schema.file_summary_by_event_name 
 WHERE event_name LIKE 'wait/io/file/%'
   AND count_star > 0
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: memory_by_user_by_current_bytes
--
-- Summarizes memory use by user using the 5.7 Performance Schema instrumentation.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
--
-- mysql> select * from memory_by_user_by_current_bytes;
-- +------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | user | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
-- +------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | root |               1401 | 1.09 MiB          | 815 bytes         | 334.97 KiB        | 42.73 MiB       |
-- | mark |                201 | 496.08 KiB        | 2.47 KiB          | 334.97 KiB        | 5.50 MiB        |
-- +------+--------------------+-------------------+-------------------+-------------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW memory_by_user_by_current_bytes (
  user,
  current_count_used,
  current_allocated,
  current_avg_alloc,
  current_max_alloc,
  total_allocated
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUM(current_count_used) AS current_count_used,
       sys.format_bytes(SUM(current_number_of_bytes_used)) AS current_allocated,
       sys.format_bytes(IFNULL(SUM(current_number_of_bytes_used) / NULLIF(SUM(current_count_used), 0), 0)) AS current_avg_alloc,
       sys.format_bytes(MAX(current_number_of_bytes_used)) AS current_max_alloc,
       sys.format_bytes(SUM(sum_number_of_bytes_alloc)) AS total_allocated
  FROM performance_schema.memory_summary_by_user_by_event_name
 GROUP BY IF(user IS NULL, 'background', user)
 ORDER BY SUM(current_number_of_bytes_used) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$memory_by_user_by_current_bytes
--
-- Summarizes memory use by user
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
--
-- mysql> select * from x$memory_by_user_by_current_bytes;
-- +------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | user | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
-- +------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | root |               1399 |           1124553 |          803.8263 |            343008 |        45426133 |
-- | mark |                201 |            507990 |         2527.3134 |            343008 |         5769804 |
-- +------+--------------------+-------------------+-------------------+-------------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$memory_by_user_by_current_bytes (
  user,
  current_count_used,
  current_allocated,
  current_avg_alloc,
  current_max_alloc,
  total_allocated
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUM(current_count_used) AS current_count_used,
       SUM(current_number_of_bytes_used) AS current_allocated,
       IFNULL(SUM(current_number_of_bytes_used) / NULLIF(SUM(current_count_used), 0), 0) AS current_avg_alloc,
       MAX(current_number_of_bytes_used) AS current_max_alloc,
       SUM(sum_number_of_bytes_alloc) AS total_allocated
  FROM performance_schema.memory_summary_by_user_by_event_name
 GROUP BY IF(user IS NULL, 'background', user)
 ORDER BY SUM(current_number_of_bytes_used) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: memory_by_host_by_current_bytes
--
-- Summarizes memory use by host using the 5.7 Performance Schema instrumentation.
-- 
-- When the host found is NULL, it is assumed to be a local "background" thread.  
--
-- mysql> select * from memory_by_host_by_current_bytes;
-- +------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | host       | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
-- +------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | background |               2773 | 10.84 MiB         | 4.00 KiB          | 8.00 MiB          | 30.69 MiB       |
-- | localhost  |               1509 | 809.30 KiB        | 549 bytes         | 176.38 KiB        | 83.59 MiB       |
-- +------------+--------------------+-------------------+-------------------+-------------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW memory_by_host_by_current_bytes (
  host,
  current_count_used,
  current_allocated,
  current_avg_alloc,
  current_max_alloc,
  total_allocated
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUM(current_count_used) AS current_count_used,
       sys.format_bytes(SUM(current_number_of_bytes_used)) AS current_allocated,
       sys.format_bytes(IFNULL(SUM(current_number_of_bytes_used) / NULLIF(SUM(current_count_used), 0), 0)) AS current_avg_alloc,
       sys.format_bytes(MAX(current_number_of_bytes_used)) AS current_max_alloc,
       sys.format_bytes(SUM(sum_number_of_bytes_alloc)) AS total_allocated
  FROM performance_schema.memory_summary_by_host_by_event_name
 GROUP BY IF(host IS NULL, 'background', host)
 ORDER BY SUM(current_number_of_bytes_used) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$memory_by_host_by_current_bytes
--
-- Summarizes memory use by host
-- 
-- When the host found is NULL, it is assumed to be a local "background" thread.  
--
-- mysql> select * from x$memory_by_host_by_current_bytes;
-- +------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | host       | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
-- +------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | background |               2773 |          11362444 |         4097.5276 |           8390792 |        32184183 |
-- | localhost  |               1508 |            813040 |          539.1512 |            180616 |        88168182 |
-- +------------+--------------------+-------------------+-------------------+-------------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$memory_by_host_by_current_bytes (
  host,
  current_count_used,
  current_allocated,
  current_avg_alloc,
  current_max_alloc,
  total_allocated
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUM(current_count_used) AS current_count_used,
       SUM(current_number_of_bytes_used) AS current_allocated,
       IFNULL(SUM(current_number_of_bytes_used) / NULLIF(SUM(current_count_used), 0), 0) AS current_avg_alloc,
       MAX(current_number_of_bytes_used) AS current_max_alloc,
       SUM(sum_number_of_bytes_alloc) AS total_allocated
  FROM performance_schema.memory_summary_by_host_by_event_name
 GROUP BY IF(host IS NULL, 'background', host)
 ORDER BY SUM(current_number_of_bytes_used) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: memory_by_thread_by_current_bytes
--
-- Summarizes memory use by user using the 5.7 Performance Schema instrumentation.
-- 
-- User shows either the background or foreground user name appropriately.
--
-- mysql> select * from sys.memory_by_thread_by_current_bytes limit 5;
-- +-----------+----------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | thread_id | user           | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
-- +-----------+----------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- |         1 | sql/main       |              29333 | 166.02 MiB        | 5.80 KiB          | 131.13 MiB        | 196.00 MiB      |
-- |        55 | root@localhost |                175 | 1.04 MiB          | 6.09 KiB          | 350.86 KiB        | 67.37 MiB       |
-- |        58 | root@localhost |                236 | 368.13 KiB        | 1.56 KiB          | 312.05 KiB        | 130.34 MiB      |
-- |       904 | root@localhost |                 32 | 18.00 KiB         | 576 bytes         | 16.00 KiB         | 6.68 MiB        |
-- |       970 | root@localhost |                 12 | 16.80 KiB         | 1.40 KiB          | 16.00 KiB         | 1.20 MiB        |
-- +-----------+----------------+--------------------+-------------------+-------------------+-------------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW memory_by_thread_by_current_bytes (
  thread_id,
  user,
  current_count_used,
  current_allocated,
  current_avg_alloc,
  current_max_alloc,
  total_allocated
) AS
SELECT thread_id,
       IF(t.name = 'thread/sql/one_connection', 
          CONCAT(t.processlist_user, '@', t.processlist_host), 
          REPLACE(t.name, 'thread/', '')) user,
       SUM(mt.current_count_used) AS current_count_used,
       sys.format_bytes(SUM(mt.current_number_of_bytes_used)) AS current_allocated,
       sys.format_bytes(IFNULL(SUM(mt.current_number_of_bytes_used) / NULLIF(SUM(current_count_used), 0), 0)) AS current_avg_alloc,
       sys.format_bytes(MAX(mt.current_number_of_bytes_used)) AS current_max_alloc,
       sys.format_bytes(SUM(mt.sum_number_of_bytes_alloc)) AS total_allocated
  FROM performance_schema.memory_summary_by_thread_by_event_name AS mt
  JOIN performance_schema.threads AS t USING (thread_id)
 GROUP BY thread_id, IF(t.name = 'thread/sql/one_connection', 
          CONCAT(t.processlist_user, '@', t.processlist_host), 
          REPLACE(t.name, 'thread/', ''))
 ORDER BY SUM(current_number_of_bytes_used) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$memory_by_thread_by_current_bytes
--
-- Summarizes memory use by user
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
--
-- mysql> select * from sys.x$memory_by_thread_by_current_bytes limit 5;
-- +-----------+----------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- | thread_id | user           | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
-- +-----------+----------------+--------------------+-------------------+-------------------+-------------------+-----------------+
-- |         1 | sql/main       |              29333 |         174089450 |         5934.9351 |         137494528 |       205523135 |
-- |        55 | root@localhost |                173 |           1074664 |         6211.9306 |            359280 |        72248413 |
-- |        58 | root@localhost |                240 |            377099 |         1571.2458 |            319536 |       169483870 |
-- |      1152 | root@localhost |                 30 |             56949 |         1898.3000 |             16391 |         1010024 |
-- |      1154 | root@localhost |                 34 |             56369 |         1657.9118 |             16391 |         1958771 |
-- +-----------+----------------+--------------------+-------------------+-------------------+-------------------+-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$memory_by_thread_by_current_bytes (
  thread_id,
  user,
  current_count_used,
  current_allocated,
  current_avg_alloc,
  current_max_alloc,
  total_allocated
) AS
SELECT t.thread_id,
       IF(t.name = 'thread/sql/one_connection', 
          CONCAT(t.processlist_user, '@', t.processlist_host), 
          REPLACE(t.name, 'thread/', '')) user,
       SUM(mt.current_count_used) AS current_count_used,
       SUM(mt.current_number_of_bytes_used) AS current_allocated,
       IFNULL(SUM(mt.current_number_of_bytes_used) / NULLIF(SUM(current_count_used), 0), 0) AS current_avg_alloc,
       MAX(mt.current_number_of_bytes_used) AS current_max_alloc,
       SUM(mt.sum_number_of_bytes_alloc) AS total_allocated
  FROM performance_schema.memory_summary_by_thread_by_event_name AS mt
  JOIN performance_schema.threads AS t USING (thread_id)
 GROUP BY thread_id, IF(t.name = 'thread/sql/one_connection', 
          CONCAT(t.processlist_user, '@', t.processlist_host), 
          REPLACE(t.name, 'thread/', ''))
 ORDER BY SUM(mt.current_number_of_bytes_used) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: memory_global_by_current_bytes
-- 
-- Shows the current memory usage within the server globally broken down by allocation type.
--
-- mysql> select * from memory_global_by_current_bytes;
-- +-------------------------------------------------+---------------+---------------+-------------------+------------+-------------+----------------+
-- | event_name                                      | current_count | current_alloc | current_avg_alloc | high_count | high_alloc  | high_avg_alloc |
-- +-------------------------------------------------+---------------+---------------+-------------------+------------+-------------+----------------+
-- | memory/performance_schema/internal_buffers      |            62 | 293.80 MiB    | 4.74 MiB          |         62 | 293.80 MiB  | 4.74 MiB       |
-- | memory/innodb/buf_buf_pool                      |             1 | 131.06 MiB    | 131.06 MiB        |          1 | 131.06 MiB  | 131.06 MiB     |
-- | memory/innodb/log0log                           |             9 | 8.01 MiB      | 911.15 KiB        |          9 | 8.01 MiB    | 911.15 KiB     |
-- | memory/mysys/KEY_CACHE                          |             3 | 8.00 MiB      | 2.67 MiB          |          3 | 8.00 MiB    | 2.67 MiB       |
-- | memory/innodb/hash0hash                         |            27 | 4.73 MiB      | 179.51 KiB        |         27 | 6.84 MiB    | 259.47 KiB     |
-- | memory/innodb/os0event                          |         24998 | 4.01 MiB      | 168 bytes         |      24998 | 4.01 MiB    | 168 bytes      |
-- ...
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW memory_global_by_current_bytes (
  event_name,
  current_count,
  current_alloc,
  current_avg_alloc,
  high_count,
  high_alloc,
  high_avg_alloc
) AS
SELECT event_name,
       current_count_used AS current_count,
       sys.format_bytes(current_number_of_bytes_used) AS current_alloc,
       sys.format_bytes(IFNULL(current_number_of_bytes_used / NULLIF(current_count_used, 0), 0)) AS current_avg_alloc,
       high_count_used AS high_count,
       sys.format_bytes(high_number_of_bytes_used) AS high_alloc,
       sys.format_bytes(IFNULL(high_number_of_bytes_used / NULLIF(high_count_used, 0), 0)) AS high_avg_alloc
  FROM performance_schema.memory_summary_global_by_event_name
 WHERE current_number_of_bytes_used > 0
 ORDER BY current_number_of_bytes_used DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$memory_global_by_current_bytes
-- 
-- Shows the current memory usage within the server globally broken down by allocation type.
--
-- mysql> select * from x$memory_global_by_current_bytes;
-- +-------------------------------------------------+---------------+---------------+-------------------+------------+------------+----------------+
-- | event_name                                      | current_count | current_alloc | current_avg_alloc | high_count | high_alloc | high_avg_alloc |
-- +-------------------------------------------------+---------------+---------------+-------------------+------------+------------+----------------+
-- | memory/performance_schema/internal_buffers      |            62 |     308073712 |      4968930.8387 |         62 |  308073712 |   4968930.8387 |
-- | memory/innodb/buf_buf_pool                      |             1 |     137428992 |    137428992.0000 |          1 |  137428992 | 137428992.0000 |
-- | memory/innodb/log0log                           |             9 |       8397152 |       933016.8889 |          9 |    8397152 |    933016.8889 |
-- | memory/mysys/KEY_CACHE                          |             3 |       8390792 |      2796930.6667 |          3 |    8390792 |   2796930.6667 |
-- | memory/innodb/hash0hash                         |            27 |       4962992 |       183814.5185 |         27 |    7173904 |    265700.1481 |
-- | memory/innodb/os0event                          |         24998 |       4199664 |          168.0000 |      24998 |    4199664 |       168.0000 |
-- ...
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$memory_global_by_current_bytes (
  event_name,
  current_count,
  current_alloc,
  current_avg_alloc,
  high_count,
  high_alloc,
  high_avg_alloc
) AS
SELECT event_name,
       current_count_used AS current_count,
       current_number_of_bytes_used AS current_alloc,
       IFNULL(current_number_of_bytes_used / NULLIF(current_count_used, 0), 0) AS current_avg_alloc,
       high_count_used AS high_count,
       high_number_of_bytes_used AS high_alloc,
       IFNULL(high_number_of_bytes_used / NULLIF(high_count_used, 0), 0) AS high_avg_alloc
  FROM performance_schema.memory_summary_global_by_event_name
 WHERE current_number_of_bytes_used > 0
 ORDER BY current_number_of_bytes_used DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: memory_global_total
-- 
-- Shows the total memory usage within the server globally.
--
-- mysql> select * from memory_global_total;
-- +-----------------+
-- | total_allocated |
-- +-----------------+
-- | 123.35 MiB      |
-- +-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW memory_global_total (
  total_allocated
) AS
SELECT sys.format_bytes(SUM(CURRENT_NUMBER_OF_BYTES_USED)) total_allocated
  FROM performance_schema.memory_summary_global_by_event_name;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$memory_global_total
-- 
-- Shows the total memory usage within the server globally
--
-- mysql> select * from x$memory_global_total;
-- +-----------------+
-- | total_allocated |
-- +-----------------+
-- |         1420023 |
-- +-----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$memory_global_total (
  total_allocated
) AS
SELECT SUM(CURRENT_NUMBER_OF_BYTES_USED) total_allocated
  FROM performance_schema.memory_summary_global_by_event_name;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: schema_index_statistics
--
-- Statistics around indexes.
--
-- Ordered by the total wait time descending - top indexes are most contended.
--
-- mysql> select * from schema_index_statistics limit 5;
-- +------------------+-------------+------------+---------------+----------------+---------------+----------------+--------------+----------------+--------------+----------------+
-- | table_schema     | table_name  | index_name | rows_selected | select_latency | rows_inserted | insert_latency | rows_updated | update_latency | rows_deleted | delete_latency |
-- +------------------+-------------+------------+---------------+----------------+---------------+----------------+--------------+----------------+--------------+----------------+
-- | mem              | mysqlserver | PRIMARY    |          6208 | 108.27 ms      |             0 | 0 ps           |         5470 | 1.47 s         |            0 | 0 ps           |
-- | mem              | innodb      | PRIMARY    |          4666 | 76.27 ms       |             0 | 0 ps           |         4454 | 571.47 ms      |            0 | 0 ps           |
-- | mem              | connection  | PRIMARY    |          1064 | 20.98 ms       |             0 | 0 ps           |         1064 | 457.30 ms      |            0 | 0 ps           |
-- | mem              | environment | PRIMARY    |          5566 | 151.17 ms      |             0 | 0 ps           |          694 | 252.57 ms      |            0 | 0 ps           |
-- | mem              | querycache  | PRIMARY    |          1698 | 27.99 ms       |             0 | 0 ps           |         1698 | 371.72 ms      |            0 | 0 ps           |
-- +------------------+-------------+------------+---------------+----------------+---------------+----------------+--------------+----------------+--------------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_index_statistics (
  table_schema,
  table_name,
  index_name,
  rows_selected,
  select_latency,
  rows_inserted,
  insert_latency,
  rows_updated,
  update_latency,
  rows_deleted,
  delete_latency
) AS
SELECT OBJECT_SCHEMA AS table_schema,
       OBJECT_NAME AS table_name,
       INDEX_NAME as index_name,
       COUNT_FETCH AS rows_selected,
       sys.format_time(SUM_TIMER_FETCH) AS select_latency,
       COUNT_INSERT AS rows_inserted,
       sys.format_time(SUM_TIMER_INSERT) AS insert_latency,
       COUNT_UPDATE AS rows_updated,
       sys.format_time(SUM_TIMER_UPDATE) AS update_latency,
       COUNT_DELETE AS rows_deleted,
       sys.format_time(SUM_TIMER_INSERT) AS delete_latency
  FROM performance_schema.table_io_waits_summary_by_index_usage
 WHERE index_name IS NOT NULL
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$schema_index_statistics
--
-- Statistics around indexes.
--
-- Ordered by the total wait time descending - top indexes are most contended.
--
-- mysql> SELECT * FROM x$schema_index_statistics LIMIT 5;
-- +---------------+----------------------+-------------------+---------------+----------------+---------------+----------------+--------------+----------------+--------------+----------------+
-- | table_schema  | table_name           | index_name        | rows_selected | select_latency | rows_inserted | insert_latency | rows_updated | update_latency | rows_deleted | delete_latency |
-- +---------------+----------------------+-------------------+---------------+----------------+---------------+----------------+--------------+----------------+--------------+----------------+
-- | common_schema | _global_sql_tokens   | PRIMARY           |          1886 |     1129676730 |             0 |              0 |            0 |              0 |         1878 |              0 |
-- | common_schema | _script_statements   | PRIMARY           |          4606 |     4212160680 |             0 |              0 |            0 |              0 |            0 |              0 |
-- | common_schema | _global_qs_variables | declaration_depth |           256 |     1650193090 |             0 |              0 |           32 |     1372148050 |            0 |              0 |
-- | common_schema | _global_qs_variables | PRIMARY           |             0 |              0 |             0 |              0 |            0 |              0 |           16 |              0 |
-- | common_schema | metadata             | PRIMARY           |             5 |       76730810 |             0 |              0 |            4 |      114310170 |            0 |              0 |
-- +---------------+----------------------+-------------------+---------------+----------------+---------------+----------------+--------------+----------------+--------------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$schema_index_statistics (
  table_schema,
  table_name,
  index_name,
  rows_selected,
  select_latency,
  rows_inserted,
  insert_latency,
  rows_updated,
  update_latency,
  rows_deleted,
  delete_latency
) AS
SELECT OBJECT_SCHEMA AS table_schema,
       OBJECT_NAME AS table_name,
       INDEX_NAME as index_name,
       COUNT_FETCH AS rows_selected,
       SUM_TIMER_FETCH AS select_latency,
       COUNT_INSERT AS rows_inserted,
       SUM_TIMER_INSERT AS insert_latency,
       COUNT_UPDATE AS rows_updated,
       SUM_TIMER_UPDATE AS update_latency,
       COUNT_DELETE AS rows_deleted,
       SUM_TIMER_INSERT AS delete_latency
  FROM performance_schema.table_io_waits_summary_by_index_usage
 WHERE index_name IS NOT NULL
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$ps_schema_table_statistics_io
--
-- Helper view for schema_table_statistics
-- Having this view with ALGORITHM = TEMPTABLE means MySQL can use the optimizations for
-- materialized views to improve the overall performance.
--
-- mysql> SELECT * FROM x$ps_schema_table_statistics_io LIMIT 1\G
-- *************************** 1. row ***************************
--              table_schema: charsets
--                table_name: Index
--                count_read: 1
--  sum_number_of_bytes_read: 18710
--            sum_timer_read: 20229409070
--               count_write: 0
-- sum_number_of_bytes_write: 0
--           sum_timer_write: 0
--                count_misc: 2
--            sum_timer_misc: 80768480
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$ps_schema_table_statistics_io (
  table_schema,
  table_name,
  count_read,
  sum_number_of_bytes_read,
  sum_timer_read,
  count_write,
  sum_number_of_bytes_write,
  sum_timer_write,
  count_misc,
  sum_timer_misc
) AS
SELECT extract_schema_from_file_name(file_name) AS table_schema,
       extract_table_from_file_name(file_name) AS table_name,
       SUM(count_read) AS count_read,
       SUM(sum_number_of_bytes_read) AS sum_number_of_bytes_read,
       SUM(sum_timer_read) AS sum_timer_read,
       SUM(count_write) AS count_write,
       SUM(sum_number_of_bytes_write) AS sum_number_of_bytes_write,
       SUM(sum_timer_write) AS sum_timer_write,
       SUM(count_misc) AS count_misc,
       SUM(sum_timer_misc) AS sum_timer_misc
  FROM performance_schema.file_summary_by_instance
 GROUP BY table_schema, table_name;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: schema_table_statistics
--
-- Statistics around tables.
--
-- Ordered by the total wait time descending - top tables are most contended.
-- 
-- mysql> SELECT * FROM schema_table_statistics\G
-- *************************** 1. row ***************************
--      table_schema: sys
--        table_name: sys_config
--     total_latency: 0 ps
--      rows_fetched: 0
--     fetch_latency: 0 ps
--     rows_inserted: 0
--    insert_latency: 0 ps
--      rows_updated: 0
--    update_latency: 0 ps
--      rows_deleted: 0
--    delete_latency: 0 ps
--  io_read_requests: 8
--           io_read: 2.28 KiB
--   io_read_latency: 727.32 us
-- io_write_requests: 0
--          io_write: 0 bytes
--  io_write_latency: 0 ps
--  io_misc_requests: 10
--   io_misc_latency: 126.88 us
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_table_statistics (
  table_schema,
  table_name,
  total_latency,
  rows_fetched,
  fetch_latency,
  rows_inserted,
  insert_latency,
  rows_updated,
  update_latency,
  rows_deleted,
  delete_latency,
  io_read_requests,
  io_read,
  io_read_latency,
  io_write_requests,
  io_write,
  io_write_latency,
  io_misc_requests,
  io_misc_latency
) AS
SELECT pst.object_schema AS table_schema,
       pst.object_name AS table_name,
       sys.format_time(pst.sum_timer_wait) AS total_latency,
       pst.count_fetch AS rows_fetched,
       sys.format_time(pst.sum_timer_fetch) AS fetch_latency,
       pst.count_insert AS rows_inserted,
       sys.format_time(pst.sum_timer_insert) AS insert_latency,
       pst.count_update AS rows_updated,
       sys.format_time(pst.sum_timer_update) AS update_latency,
       pst.count_delete AS rows_deleted,
       sys.format_time(pst.sum_timer_delete) AS delete_latency,
       fsbi.count_read AS io_read_requests,
       sys.format_bytes(fsbi.sum_number_of_bytes_read) AS io_read,
       sys.format_time(fsbi.sum_timer_read) AS io_read_latency,
       fsbi.count_write AS io_write_requests,
       sys.format_bytes(fsbi.sum_number_of_bytes_write) AS io_write,
       sys.format_time(fsbi.sum_timer_write) AS io_write_latency,
       fsbi.count_misc AS io_misc_requests,
       sys.format_time(fsbi.sum_timer_misc) AS io_misc_latency
  FROM performance_schema.table_io_waits_summary_by_table AS pst
  LEFT JOIN x$ps_schema_table_statistics_io AS fsbi
    ON pst.object_schema = fsbi.table_schema
   AND pst.object_name = fsbi.table_name
 ORDER BY pst.sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$schema_table_statistics
--
-- Statistics around tables.
--
-- Ordered by the total wait time descending - top tables are most contended.
-- 
-- mysql> select * from x$schema_table_statistics\G
-- *************************** 1. row ***************************
--      table_schema: sys
--        table_name: sys_config
--     total_latency: 0
--      rows_fetched: 0
--     fetch_latency: 0
--     rows_inserted: 0
--    insert_latency: 0
--      rows_updated: 0
--    update_latency: 0
--      rows_deleted: 0
--    delete_latency: 0
--  io_read_requests: 8
--           io_read: 2336
--   io_read_latency: 727319710
-- io_write_requests: 0
--          io_write: 0
--  io_write_latency: 0
--  io_misc_requests: 10
--   io_misc_latency: 126879350
--
 
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$schema_table_statistics (
  table_schema,
  table_name,
  total_latency,
  rows_fetched,
  fetch_latency,
  rows_inserted,
  insert_latency,
  rows_updated,
  update_latency,
  rows_deleted,
  delete_latency,
  io_read_requests,
  io_read,
  io_read_latency,
  io_write_requests,
  io_write,
  io_write_latency,
  io_misc_requests,
  io_misc_latency
) AS
SELECT pst.object_schema AS table_schema,
       pst.object_name AS table_name,
       pst.sum_timer_wait AS total_latency,
       pst.count_fetch AS rows_fetched,
       pst.sum_timer_fetch AS fetch_latency,
       pst.count_insert AS rows_inserted,
       pst.sum_timer_insert AS insert_latency,
       pst.count_update AS rows_updated,
       pst.sum_timer_update AS update_latency,
       pst.count_delete AS rows_deleted,
       pst.sum_timer_delete AS delete_latency,
       fsbi.count_read AS io_read_requests,
       fsbi.sum_number_of_bytes_read AS io_read,
       fsbi.sum_timer_read AS io_read_latency,
       fsbi.count_write AS io_write_requests,
       fsbi.sum_number_of_bytes_write AS io_write,
       fsbi.sum_timer_write AS io_write_latency,
       fsbi.count_misc AS io_misc_requests,
       fsbi.sum_timer_misc AS io_misc_latency
  FROM performance_schema.table_io_waits_summary_by_table AS pst
  LEFT JOIN x$ps_schema_table_statistics_io AS fsbi
    ON pst.object_schema = fsbi.table_schema
   AND pst.object_name = fsbi.table_name
 ORDER BY pst.sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: schema_table_statistics_with_buffer
--
-- Statistics around tables.
--
-- Ordered by the total wait time descending - top tables are most contended.
--
-- More statistics such as caching stats for the InnoDB buffer pool with InnoDB tables
--
-- mysql> select * from schema_table_statistics_with_buffer limit 1\G
-- *************************** 1. row ***************************
--                  table_schema: mem
--                    table_name: mysqlserver
--                  rows_fetched: 27087
--                 fetch_latency: 442.72 ms
--                 rows_inserted: 2
--                insert_latency: 185.04 us 
--                  rows_updated: 5096
--                update_latency: 1.39 s
--                  rows_deleted: 0
--                delete_latency: 0 ps
--              io_read_requests: 2565
--                 io_read_bytes: 1121627
--               io_read_latency: 10.07 ms
--             io_write_requests: 1691
--                io_write_bytes: 128383
--              io_write_latency: 14.17 ms
--              io_misc_requests: 2698
--               io_misc_latency: 433.66 ms
--           innodb_buffer_pages: 19
--    innodb_buffer_pages_hashed: 19
--       innodb_buffer_pages_old: 19
-- innodb_buffer_bytes_allocated: 311296
--      innodb_buffer_bytes_data: 1924
--     innodb_buffer_rows_cached: 2
--

DELIMITER $$
BEGIN NOT ATOMIC
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_table_statistics_with_buffer (
  table_schema,
  table_name,
  rows_fetched,
  fetch_latency,
  rows_inserted,
  insert_latency,
  rows_updated,
  update_latency,
  rows_deleted,
  delete_latency,
  io_read_requests,
  io_read,
  io_read_latency,
  io_write_requests,
  io_write,
  io_write_latency,
  io_misc_requests,
  io_misc_latency,
  innodb_buffer_allocated,
  innodb_buffer_data,
  innodb_buffer_free,
  innodb_buffer_pages,
  innodb_buffer_pages_hashed,
  innodb_buffer_pages_old,
  innodb_buffer_rows_cached
) AS
SELECT pst.object_schema AS table_schema,
       pst.object_name AS table_name,
       pst.count_fetch AS rows_fetched,
       sys.format_time(pst.sum_timer_fetch) AS fetch_latency,
       pst.count_insert AS rows_inserted,
       sys.format_time(pst.sum_timer_insert) AS insert_latency,
       pst.count_update AS rows_updated,
       sys.format_time(pst.sum_timer_update) AS update_latency,
       pst.count_delete AS rows_deleted,
       sys.format_time(pst.sum_timer_delete) AS delete_latency,
       fsbi.count_read AS io_read_requests,
       sys.format_bytes(fsbi.sum_number_of_bytes_read) AS io_read,
       sys.format_time(fsbi.sum_timer_read) AS io_read_latency,
       fsbi.count_write AS io_write_requests,
       sys.format_bytes(fsbi.sum_number_of_bytes_write) AS io_write,
       sys.format_time(fsbi.sum_timer_write) AS io_write_latency,
       fsbi.count_misc AS io_misc_requests,
       sys.format_time(fsbi.sum_timer_misc) AS io_misc_latency,
       sys.format_bytes(ibp.allocated) AS innodb_buffer_allocated,
       sys.format_bytes(ibp.data) AS innodb_buffer_data,
       sys.format_bytes(ibp.allocated - ibp.data) AS innodb_buffer_free,
       ibp.pages AS innodb_buffer_pages,
       ibp.pages_hashed AS innodb_buffer_pages_hashed,
       ibp.pages_old AS innodb_buffer_pages_old,
       ibp.rows_cached AS innodb_buffer_rows_cached
  FROM performance_schema.table_io_waits_summary_by_table AS pst
  LEFT JOIN x$ps_schema_table_statistics_io AS fsbi
    ON pst.object_schema = fsbi.table_schema
   AND pst.object_name = fsbi.table_name
  LEFT JOIN sys.x$innodb_buffer_stats_by_table AS ibp
    ON pst.object_schema = ibp.object_schema
   AND pst.object_name = ibp.object_name
 ORDER BY pst.sum_timer_wait DESC;

END$$
DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$schema_table_statistics_with_buffer
--
-- Statistics around tables.
--
-- Ordered by the total wait time descending - top tables are most contended.
--
-- More statistics such as caching stats for the InnoDB buffer pool with InnoDB tables
--
-- mysql> SELECT * FROM x$schema_table_statistics_with_buffer LIMIT 1\G
-- *************************** 1. row ***************************
--               table_schema: common_schema
--                 table_name: help_content
--               rows_fetched: 0
--              fetch_latency: 0
--              rows_inserted: 169
--             insert_latency: 409815527680
--               rows_updated: 0
--             update_latency: 0
--               rows_deleted: 0
--             delete_latency: 0
--           io_read_requests: 14
--                    io_read: 1180
--            io_read_latency: 52406770
--          io_write_requests: 131
--                   io_write: 11719246
--           io_write_latency: 133726902790
--           io_misc_requests: 61
--            io_misc_latency: 209081089750
--    innodb_buffer_allocated: 688128
--         innodb_buffer_data: 423667
--        innodb_buffer_pages: 42
-- innodb_buffer_pages_hashed: 42
--    innodb_buffer_pages_old: 42
--  innodb_buffer_rows_cached: 210
--

DELIMITER $$
BEGIN NOT ATOMIC
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$schema_table_statistics_with_buffer (
  table_schema,
  table_name,
  rows_fetched,
  fetch_latency,
  rows_inserted,
  insert_latency,
  rows_updated,
  update_latency,
  rows_deleted,
  delete_latency,
  io_read_requests,
  io_read,
  io_read_latency,
  io_write_requests,
  io_write,
  io_write_latency,
  io_misc_requests,
  io_misc_latency,
  innodb_buffer_allocated,
  innodb_buffer_data,
  innodb_buffer_free,
  innodb_buffer_pages,
  innodb_buffer_pages_hashed,
  innodb_buffer_pages_old,
  innodb_buffer_rows_cached
) AS
SELECT pst.object_schema AS table_schema,
       pst.object_name AS table_name,
       pst.count_fetch AS rows_fetched,
       pst.sum_timer_fetch AS fetch_latency,
       pst.count_insert AS rows_inserted,
       pst.sum_timer_insert AS insert_latency,
       pst.count_update AS rows_updated,
       pst.sum_timer_update AS update_latency,
       pst.count_delete AS rows_deleted,
       pst.sum_timer_delete AS delete_latency,
       fsbi.count_read AS io_read_requests,
       fsbi.sum_number_of_bytes_read AS io_read,
       fsbi.sum_timer_read AS io_read_latency,
       fsbi.count_write AS io_write_requests,
       fsbi.sum_number_of_bytes_write AS io_write,
       fsbi.sum_timer_write AS io_write_latency,
       fsbi.count_misc AS io_misc_requests,
       fsbi.sum_timer_misc AS io_misc_latency,
       ibp.allocated AS innodb_buffer_allocated,
       ibp.data AS innodb_buffer_data,
       (ibp.allocated - ibp.data) AS innodb_buffer_free,
       ibp.pages AS innodb_buffer_pages,
       ibp.pages_hashed AS innodb_buffer_pages_hashed,
       ibp.pages_old AS innodb_buffer_pages_old,
       ibp.rows_cached AS innodb_buffer_rows_cached
  FROM performance_schema.table_io_waits_summary_by_table AS pst
  LEFT JOIN x$ps_schema_table_statistics_io AS fsbi
    ON pst.object_schema = fsbi.table_schema
   AND pst.object_name = fsbi.table_name
  LEFT JOIN sys.x$innodb_buffer_stats_by_table AS ibp
    ON pst.object_schema = ibp.object_schema
   AND pst.object_name = ibp.object_name
 ORDER BY pst.sum_timer_wait DESC;
END$$
DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: schema_tables_with_full_table_scans
--
-- Find tables that are being accessed by full table scans
-- ordering by the number of rows scanned descending.
--
-- mysql> select * from schema_tables_with_full_table_scans limit 5;
-- +--------------------+--------------------------------+-------------------+-----------+
-- | object_schema      | object_name                    | rows_full_scanned | latency   |
-- +--------------------+--------------------------------+-------------------+-----------+
-- | mem30__instruments | fsstatistics                   |          10207042 | 13.10 s   |
-- | mem30__instruments | preparedstatementapidata       |            436428 | 973.27 ms |
-- | mem30__instruments | mysqlprocessactivity           |            411702 | 282.07 ms |
-- | mem30__instruments | querycachequeriesincachedata   |            374011 | 767.15 ms |
-- | mem30__instruments | rowaccessesdata                |            322321 | 1.55 s    |
-- +--------------------+--------------------------------+-------------------+-----------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_tables_with_full_table_scans (
  object_schema,
  object_name,
  rows_full_scanned,
  latency
) AS
SELECT object_schema, 
       object_name,
       count_read AS rows_full_scanned,
       sys.format_time(sum_timer_wait) AS latency
  FROM performance_schema.table_io_waits_summary_by_index_usage 
 WHERE index_name IS NULL
   AND count_read > 0
 ORDER BY count_read DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$schema_tables_with_full_table_scans
--
-- Find tables that are being accessed by full table scans
-- ordering by the number of rows scanned descending.
--
-- mysql> select * from x$schema_tables_with_full_table_scans limit 5;
-- +--------------------+------------------------------+-------------------+----------------+
-- | object_schema      | object_name                  | rows_full_scanned | latency        |
-- +--------------------+------------------------------+-------------------+----------------+
-- | mem30__instruments | fsstatistics                 |          10207042 | 13098927688488 |
-- | mem30__instruments | preparedstatementapidata     |            436428 |   973274338980 |
-- | mem30__instruments | mysqlprocessactivity         |            411702 |   282072434940 |
-- | mem30__instruments | querycachequeriesincachedata |            374011 |   767152380564 |
-- | mem30__instruments | rowaccessesdata              |            322321 |  1547594778456 |
-- +--------------------+------------------------------+-------------------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$schema_tables_with_full_table_scans (
  object_schema,
  object_name,
  rows_full_scanned,
  latency
) AS
SELECT object_schema, 
       object_name,
       count_read AS rows_full_scanned,
       sum_timer_wait AS latency
  FROM performance_schema.table_io_waits_summary_by_index_usage 
 WHERE index_name IS NULL
   AND count_read > 0
 ORDER BY count_read DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: schema_unused_indexes
-- 
-- Finds indexes that have had no events against them (and hence, no usage).
--
-- To trust whether the data from this view is representative of your workload,
-- you should ensure that the server has been up for a representative amount of
-- time before using it.
--
-- PRIMARY (key) indexes are ignored.
--
-- mysql> select * from schema_unused_indexes limit 5;
-- +--------------------+---------------------+--------------------+
-- | object_schema      | object_name         | index_name         |
-- +--------------------+---------------------+--------------------+
-- | mem30__bean_config | plists              | path               |
-- | mem30__config      | group_selections    | name               |
-- | mem30__config      | notification_groups | name               |
-- | mem30__config      | user_form_defaults  | FKC1AEF1F9E7EE2CFB |
-- | mem30__enterprise  | whats_new_entries   | entryId            |
-- +--------------------+---------------------+--------------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_unused_indexes (
  object_schema,
  object_name,
  index_name
) AS
SELECT object_schema,
       object_name,
       index_name
  FROM performance_schema.table_io_waits_summary_by_index_usage 
 WHERE index_name IS NOT NULL
   AND count_star = 0
   AND object_schema != 'mysql'
   AND index_name != 'PRIMARY'
 ORDER BY object_schema, object_name;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: schema_table_lock_waits
--
-- Shows sessions that are blocked waiting on table metadata locks, and 
-- who is blocking them.
--
-- mysql> select * from sys.schema_table_lock_waits\G
-- *************************** 1. row ***************************
--                object_schema: test
--                  object_name: t
--            waiting_thread_id: 43
--                  waiting_pid: 21
--              waiting_account: msandbox@localhost
--            waiting_lock_type: SHARED_UPGRADABLE
--        waiting_lock_duration: TRANSACTION
--                waiting_query: alter table test.t add foo int
--           waiting_query_secs: 988
--  waiting_query_rows_affected: 0
--  waiting_query_rows_examined: 0
--           blocking_thread_id: 42
--                 blocking_pid: 20
--             blocking_account: msandbox@localhost
--           blocking_lock_type: SHARED_NO_READ_WRITE
--       blocking_lock_duration: TRANSACTION
--      sql_kill_blocking_query: KILL QUERY 20
-- sql_kill_blocking_connection: KILL 20
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW schema_table_lock_waits (
  object_schema,
  object_name,
  waiting_thread_id,
  waiting_pid,
  waiting_account,
  waiting_lock_type,
  waiting_lock_duration,
  waiting_query,
  waiting_query_secs,
  waiting_query_rows_affected,
  waiting_query_rows_examined,
  blocking_thread_id,
  blocking_pid,
  blocking_account,
  blocking_lock_type,
  blocking_lock_duration,
  sql_kill_blocking_query,
  sql_kill_blocking_connection
) AS
SELECT g.object_schema AS object_schema,
       g.object_name AS object_name,
       pt.thread_id AS waiting_thread_id,
       pt.processlist_id AS waiting_pid,
       sys.ps_thread_account(p.owner_thread_id) AS waiting_account,
       p.lock_type AS waiting_lock_type,
       p.lock_duration AS waiting_lock_duration,
       sys.format_statement(pt.processlist_info) AS waiting_query,
       pt.processlist_time AS waiting_query_secs,
       ps.rows_affected AS waiting_query_rows_affected,
       ps.rows_examined AS waiting_query_rows_examined,
       gt.thread_id AS blocking_thread_id,
       gt.processlist_id AS blocking_pid,
       sys.ps_thread_account(g.owner_thread_id) AS blocking_account,
       g.lock_type AS blocking_lock_type,
       g.lock_duration AS blocking_lock_duration,
       CONCAT('KILL QUERY ', gt.processlist_id) AS sql_kill_blocking_query,
       CONCAT('KILL ', gt.processlist_id) AS sql_kill_blocking_connection
  FROM performance_schema.metadata_locks g
 INNER JOIN performance_schema.metadata_locks p 
    ON g.object_type = p.object_type
   AND g.object_schema = p.object_schema
   AND g.object_name = p.object_name
   AND g.lock_status = 'GRANTED'
   AND p.lock_status = 'PENDING'
 INNER JOIN performance_schema.threads gt ON g.owner_thread_id = gt.thread_id
 INNER JOIN performance_schema.threads pt ON p.owner_thread_id = pt.thread_id
  LEFT JOIN performance_schema.events_statements_current gs ON g.owner_thread_id = gs.thread_id
  LEFT JOIN performance_schema.events_statements_current ps ON p.owner_thread_id = ps.thread_id
 WHERE g.object_type = 'TABLE';

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: schema_table_lock_waits
--
-- Shows sessions that are blocked waiting on table metadata locks, and 
-- who is blocking them.
--
-- mysql> select * from sys.x$schema_table_lock_waits\G
-- *************************** 1. row ***************************
--                object_schema: test
--                  object_name: t
--            waiting_thread_id: 43
--                  waiting_pid: 21
--              waiting_account: msandbox@localhost
--            waiting_lock_type: SHARED_UPGRADABLE
--        waiting_lock_duration: TRANSACTION
--                waiting_query: alter table test.t add foo int
--           waiting_query_secs: 990
--  waiting_query_rows_affected: 0
--  waiting_query_rows_examined: 0
--           blocking_thread_id: 42
--                 blocking_pid: 20
--             blocking_account: msandbox@localhost
--           blocking_lock_type: SHARED_NO_READ_WRITE
--       blocking_lock_duration: TRANSACTION
--      sql_kill_blocking_query: KILL QUERY 20
-- sql_kill_blocking_connection: KILL 20
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$schema_table_lock_waits (
  object_schema,
  object_name,
  waiting_thread_id,
  waiting_pid,
  waiting_account,
  waiting_lock_type,
  waiting_lock_duration,
  waiting_query,
  waiting_query_secs,
  waiting_query_rows_affected,
  waiting_query_rows_examined,
  blocking_thread_id,
  blocking_pid,
  blocking_account,
  blocking_lock_type,
  blocking_lock_duration,
  sql_kill_blocking_query,
  sql_kill_blocking_connection
) AS
SELECT g.object_schema AS object_schema,
       g.object_name AS object_name,
       pt.thread_id AS waiting_thread_id,
       pt.processlist_id AS waiting_pid,
       sys.ps_thread_account(p.owner_thread_id) AS waiting_account,
       p.lock_type AS waiting_lock_type,
       p.lock_duration AS waiting_lock_duration,
       pt.processlist_info AS waiting_query,
       pt.processlist_time AS waiting_query_secs,
       ps.rows_affected AS waiting_query_rows_affected,
       ps.rows_examined AS waiting_query_rows_examined,
       gt.thread_id AS blocking_thread_id,
       gt.processlist_id AS blocking_pid,
       sys.ps_thread_account(g.owner_thread_id) AS blocking_account,
       g.lock_type AS blocking_lock_type,
       g.lock_duration AS blocking_lock_duration,
       CONCAT('KILL QUERY ', gt.processlist_id) AS sql_kill_blocking_query,
       CONCAT('KILL ', gt.processlist_id) AS sql_kill_blocking_connection
  FROM performance_schema.metadata_locks g
 INNER JOIN performance_schema.metadata_locks p 
    ON g.object_type = p.object_type
   AND g.object_schema = p.object_schema
   AND g.object_name = p.object_name
   AND g.lock_status = 'GRANTED'
   AND p.lock_status = 'PENDING'
 INNER JOIN performance_schema.threads gt ON g.owner_thread_id = gt.thread_id
 INNER JOIN performance_schema.threads pt ON p.owner_thread_id = pt.thread_id
  LEFT JOIN performance_schema.events_statements_current gs ON g.owner_thread_id = gs.thread_id
  LEFT JOIN performance_schema.events_statements_current ps ON p.owner_thread_id = ps.thread_id
 WHERE g.object_type = 'TABLE';

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: statement_analysis
--
-- Lists a normalized statement view with aggregated statistics,
-- mimics the MySQL Enterprise Monitor Query Analysis view,
-- ordered by the total execution time per normalized statement
-- 
-- mysql> select- * from statement_analysis limit 1\G
-- *************************** 1. row--**************************
--             query: SELECT * FROM `schema_object_o ... MA` , `information_schema` ...
--                db: sys
--         full_scan: *
--        exec_count: 2
--         err_count: 0
--        warn_count: 0
--     total_latency: 16.75 s
--       max_latency: 16.57 s
--       avg_latency: 8.38 s
--      lock_latency: 16.69 s
--         rows_sent: 84
--     rows_sent_avg: 42
--     rows_examined: 20012
--     rows_affected: 0
-- rows_affected_avg: 0
-- rows_examined_avg: 10006
--        tmp_tables: 378
--   tmp_disk_tables: 66
--       rows_sorted: 168
-- sort_merge_passes: 0
--            digest: 54f9bd520f0bbf15db0c2ed93386bec9
--        first_seen: 2014-03-07 13:13:41
--         last_seen: 2014-03-07 13:13:48
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW statement_analysis (
  query,
  db,
  full_scan,
  exec_count,
  err_count,
  warn_count,
  total_latency,
  max_latency,
  avg_latency,
  lock_latency,
  rows_sent,
  rows_sent_avg,
  rows_examined,
  rows_examined_avg,
  rows_affected,
  rows_affected_avg,
  tmp_tables,
  tmp_disk_tables,
  rows_sorted,
  sort_merge_passes,
  digest,
  first_seen,
  last_seen
) AS
SELECT sys.format_statement(DIGEST_TEXT) AS query,
       SCHEMA_NAME AS db,
       IF(SUM_NO_GOOD_INDEX_USED > 0 OR SUM_NO_INDEX_USED > 0, '*', '') AS full_scan,
       COUNT_STAR AS exec_count,
       SUM_ERRORS AS err_count,
       SUM_WARNINGS AS warn_count,
       sys.format_time(SUM_TIMER_WAIT) AS total_latency,
       sys.format_time(MAX_TIMER_WAIT) AS max_latency,
       sys.format_time(AVG_TIMER_WAIT) AS avg_latency,
       sys.format_time(SUM_LOCK_TIME) AS lock_latency,
       SUM_ROWS_SENT AS rows_sent,
       ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,
       SUM_ROWS_EXAMINED AS rows_examined,
       ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0))  AS rows_examined_avg,
       SUM_ROWS_AFFECTED AS rows_affected,
       ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0))  AS rows_affected_avg,
       SUM_CREATED_TMP_TABLES AS tmp_tables,
       SUM_CREATED_TMP_DISK_TABLES AS tmp_disk_tables,
       SUM_SORT_ROWS AS rows_sorted,
       SUM_SORT_MERGE_PASSES AS sort_merge_passes,
       DIGEST AS digest,
       FIRST_SEEN AS first_seen,
       LAST_SEEN as last_seen
  FROM performance_schema.events_statements_summary_by_digest
ORDER BY SUM_TIMER_WAIT DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: x$statement_analysis
--
-- Lists a normalized statement view with aggregated statistics,
-- mimics the MySQL Enterprise Monitor Query Analysis view,
-- ordered by the total execution time per normalized statement
-- 
-- mysql> select * from x$statement_analysis limit 1\G
-- *************************** 1. row ***************************
--             query: SELECT * FROM `schema_object_overview` SELECT `information_schema` . `routines`  -- truncated
--                db: sys
--         full_scan: *
--        exec_count: 2
--         err_count: 0
--        warn_count: 0
--     total_latency: 16751388791000
--       max_latency: 16566171163000
--       avg_latency: 8375694395000
--      lock_latency: 16686483000000
--         rows_sent: 84
--     rows_sent_avg: 42
--     rows_examined: 20012
-- rows_examined_avg: 10006
--     rows_affected: 0
-- rows_affected_avg: 0
--        tmp_tables: 378
--   tmp_disk_tables: 66
--       rows_sorted: 168
-- sort_merge_passes: 0
--            digest: 54f9bd520f0bbf15db0c2ed93386bec9
--        first_seen: 2014-03-07 13:13:41
--         last_seen: 2014-03-07 13:13:48
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$statement_analysis (
  query,
  db,
  full_scan,
  exec_count,
  err_count,
  warn_count,
  total_latency,
  max_latency,
  avg_latency,
  lock_latency,
  rows_sent,
  rows_sent_avg,
  rows_examined,
  rows_examined_avg,
  rows_affected,
  rows_affected_avg,
  tmp_tables,
  tmp_disk_tables,
  rows_sorted,
  sort_merge_passes,
  digest,
  first_seen,
  last_seen
) AS
SELECT DIGEST_TEXT AS query,
       SCHEMA_NAME AS db,
       IF(SUM_NO_GOOD_INDEX_USED > 0 OR SUM_NO_INDEX_USED > 0, '*', '') AS full_scan,
       COUNT_STAR AS exec_count,
       SUM_ERRORS AS err_count,
       SUM_WARNINGS AS warn_count,
       SUM_TIMER_WAIT AS total_latency,
       MAX_TIMER_WAIT AS max_latency,
       AVG_TIMER_WAIT AS avg_latency,
       SUM_LOCK_TIME AS lock_latency,
       SUM_ROWS_SENT AS rows_sent,
       ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,
       SUM_ROWS_EXAMINED AS rows_examined,
       ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0))  AS rows_examined_avg,
       SUM_ROWS_AFFECTED AS rows_affected,
       ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0))  AS rows_affected_avg,
       SUM_CREATED_TMP_TABLES AS tmp_tables,
       SUM_CREATED_TMP_DISK_TABLES AS tmp_disk_tables,
       SUM_SORT_ROWS AS rows_sorted,
       SUM_SORT_MERGE_PASSES AS sort_merge_passes,
       DIGEST AS digest,
       FIRST_SEEN AS first_seen,
       LAST_SEEN as last_seen
  FROM performance_schema.events_statements_summary_by_digest
ORDER BY SUM_TIMER_WAIT DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

--
-- View: statements_with_errors_or_warnings
--
-- Lists all normalized statements that have raised errors or warnings.
--
-- mysql> select * from statements_with_errors_or_warnings LIMIT 1\G
-- *************************** 1. row ***************************
--       query: CREATE OR REPLACE ALGORITHM =  ... _delete` AS `rows_deleted` ...
--          db: sys
--  exec_count: 2
--      errors: 1
--   error_pct: 50.0000
--    warnings: 0
-- warning_pct: 0.0000
--  first_seen: 2014-03-07 12:56:54
--   last_seen: 2014-03-07 13:01:01
--      digest: 943a788859e623d5f7798ba0ae0fd8a9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW statements_with_errors_or_warnings (
  query,
  db,
  exec_count,
  errors,
  error_pct,
  warnings,
  warning_pct,
  first_seen,
  last_seen,
  digest
) AS
SELECT sys.format_statement(DIGEST_TEXT) AS query,
       SCHEMA_NAME as db,
       COUNT_STAR AS exec_count,
       SUM_ERRORS AS errors,
       IFNULL(SUM_ERRORS / NULLIF(COUNT_STAR, 0), 0) * 100 as error_pct,
       SUM_WARNINGS AS warnings,
       IFNULL(SUM_WARNINGS / NULLIF(COUNT_STAR, 0), 0) * 100 as warning_pct,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE SUM_ERRORS > 0
    OR SUM_WARNINGS > 0
ORDER BY SUM_ERRORS DESC, SUM_WARNINGS DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$statements_with_errors_or_warnings
--
-- Lists all normalized statements that have raised errors or warnings.
--
-- mysql> select * from x$statements_with_errors_or_warnings LIMIT 1\G
-- *************************** 1. row ***************************
--       query: CREATE OR REPLACE ALGORITHM = TEMPTABLE DEFINER = ? @ ? SQL SECURITY INVOKER VIEW ... truncated
--          db: sys
--  exec_count: 2
--      errors: 1
--   error_pct: 50.0000
--    warnings: 0
-- warning_pct: 0.0000
--  first_seen: 2014-03-07 12:56:54
--   last_seen: 2014-03-07 13:01:01
--      digest: 943a788859e623d5f7798ba0ae0fd8a9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$statements_with_errors_or_warnings (
  query,
  db,
  exec_count,
  errors,
  error_pct,
  warnings,
  warning_pct,
  first_seen,
  last_seen,
  digest
) AS
SELECT DIGEST_TEXT AS query,
       SCHEMA_NAME as db,
       COUNT_STAR AS exec_count,
       SUM_ERRORS AS errors,
       IFNULL(SUM_ERRORS / NULLIF(COUNT_STAR, 0), 0) * 100 as error_pct,
       SUM_WARNINGS AS warnings,
       IFNULL(SUM_WARNINGS / NULLIF(COUNT_STAR, 0), 0) * 100 as warning_pct,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE SUM_ERRORS > 0
    OR SUM_WARNINGS > 0
ORDER BY SUM_ERRORS DESC, SUM_WARNINGS DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: statements_with_full_table_scans
--
-- Lists all normalized statements that use have done a full table scan
-- ordered by number the percentage of times a full scan was done,
-- then by the statement latency.
--
-- This view ignores SHOW statements, as these always cause a full table scan,
-- and there is nothing that can be done about this.
--
-- mysql> select * from statements_with_full_table_scans limit 1\G
-- *************************** 1. row ***************************
--                    query: SELECT * FROM `schema_tables_w ... ex_usage` . `COUNT_READ` DESC
--                       db: sys
--               exec_count: 1
--            total_latency: 88.20 ms
--      no_index_used_count: 1
-- no_good_index_used_count: 0
--        no_index_used_pct: 100
--                rows_sent: 0
--            rows_examined: 1501
--            rows_sent_avg: 0
--        rows_examined_avg: 1501
--               first_seen: 2014-03-07 13:58:20
--                last_seen: 2014-03-07 13:58:20
--                   digest: 64baecd5c1e1e1651a6b92e55442a288
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW statements_with_full_table_scans (
  query,
  db,
  exec_count,
  total_latency,
  no_index_used_count,
  no_good_index_used_count,
  no_index_used_pct,
  rows_sent,
  rows_examined,
  rows_sent_avg,
  rows_examined_avg,
  first_seen,
  last_seen,
  digest
) AS
SELECT sys.format_statement(DIGEST_TEXT) AS query,
       SCHEMA_NAME as db,
       COUNT_STAR AS exec_count,
       sys.format_time(SUM_TIMER_WAIT) AS total_latency,
       SUM_NO_INDEX_USED AS no_index_used_count,
       SUM_NO_GOOD_INDEX_USED AS no_good_index_used_count,
       ROUND(IFNULL(SUM_NO_INDEX_USED / NULLIF(COUNT_STAR, 0), 0) * 100) AS no_index_used_pct,
       SUM_ROWS_SENT AS rows_sent,
       SUM_ROWS_EXAMINED AS rows_examined,
       ROUND(SUM_ROWS_SENT/COUNT_STAR) AS rows_sent_avg,
       ROUND(SUM_ROWS_EXAMINED/COUNT_STAR) AS rows_examined_avg,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE (SUM_NO_INDEX_USED > 0
    OR SUM_NO_GOOD_INDEX_USED > 0)
   AND DIGEST_TEXT NOT LIKE 'SHOW%'
 ORDER BY no_index_used_pct DESC, total_latency DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$statements_with_full_table_scans
--
-- Lists all normalized statements that use have done a full table scan
-- ordered by number the percentage of times a full scan was done,
-- then by the statement latency.
--
-- This view ignores SHOW statements, as these always cause a full table scan,
-- and there is nothing that can be done about this.
--
-- mysql> select * from x$statements_with_full_table_scans limit 1\G
-- *************************** 1. row ***************************
--                    query: SELECT * FROM `schema_object_overview` SELECT `information_schema` . `routines` . `ROUTINE_SCHEMA` // truncated
--                       db: sys
--               exec_count: 2
--            total_latency: 16751388791000
--      no_index_used_count: 2
-- no_good_index_used_count: 0
--        no_index_used_pct: 100
--                rows_sent: 84
--            rows_examined: 20012
--            rows_sent_avg: 42
--        rows_examined_avg: 10006
--               first_seen: 2014-03-07 13:13:41
--                last_seen: 2014-03-07 13:13:48
--                   digest: 54f9bd520f0bbf15db0c2ed93386bec9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$statements_with_full_table_scans (
  query,
  db,
  exec_count,
  total_latency,
  no_index_used_count,
  no_good_index_used_count,
  no_index_used_pct,
  rows_sent,
  rows_examined,
  rows_sent_avg,
  rows_examined_avg,
  first_seen,
  last_seen,
  digest
) AS
SELECT DIGEST_TEXT AS query,
       SCHEMA_NAME as db,
       COUNT_STAR AS exec_count,
       SUM_TIMER_WAIT AS total_latency,
       SUM_NO_INDEX_USED AS no_index_used_count,
       SUM_NO_GOOD_INDEX_USED AS no_good_index_used_count,
       ROUND(IFNULL(SUM_NO_INDEX_USED / NULLIF(COUNT_STAR, 0), 0) * 100) AS no_index_used_pct,
       SUM_ROWS_SENT AS rows_sent,
       SUM_ROWS_EXAMINED AS rows_examined,
       ROUND(SUM_ROWS_SENT/COUNT_STAR) AS rows_sent_avg,
       ROUND(SUM_ROWS_EXAMINED/COUNT_STAR) AS rows_examined_avg,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE (SUM_NO_INDEX_USED > 0
    OR SUM_NO_GOOD_INDEX_USED > 0)
   AND DIGEST_TEXT NOT LIKE 'SHOW%'
 ORDER BY no_index_used_pct DESC, total_latency DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$ps_digest_avg_latency_distribution
--
-- Helper view for x$ps_digest_95th_percentile_by_avg_us
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$ps_digest_avg_latency_distribution (
  cnt,
  avg_us
) AS
SELECT COUNT(*) cnt, 
       ROUND(avg_timer_wait/1000000) AS avg_us
  FROM performance_schema.events_statements_summary_by_digest
 GROUP BY avg_us;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$ps_digest_95th_percentile_by_avg_us
--
-- Helper view for statements_with_runtimes_in_95th_percentile.
-- Lists the 95th percentile runtime, for all statements
--
-- mysql> select * from x$ps_digest_95th_percentile_by_avg_us;
-- +--------+------------+
-- | avg_us | percentile |
-- +--------+------------+
-- |    964 |     0.9525 |
-- +--------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$ps_digest_95th_percentile_by_avg_us (
  avg_us,
  percentile
) AS
SELECT s2.avg_us avg_us,
       IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest), 0), 0) percentile
  FROM sys.x$ps_digest_avg_latency_distribution AS s1
  JOIN sys.x$ps_digest_avg_latency_distribution AS s2
    ON s1.avg_us <= s2.avg_us
 GROUP BY s2.avg_us
HAVING IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest), 0), 0) > 0.95
 ORDER BY percentile
 LIMIT 1;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: statements_with_runtimes_in_95th_percentile
--
-- List all statements whose average runtime, in microseconds, is in the top 95th percentile.
-- 
-- mysql> select * from statements_with_runtimes_in_95th_percentile limit 5;
-- +-------------------------------------------------------------------+------+-----------+------------+-----------+------------+---------------+-------------+-------------+-----------+---------------+---------------+-------------------+---------------------+---------------------+----------------------------------+
-- | query                                                             | db   | full_scan | exec_count | err_count | warn_count | total_latency | max_latency | avg_latency | rows_sent | rows_sent_avg | rows_examined | rows_examined_avg | FIRST_SEEN          | LAST_SEEN           | digest                           |
-- +-------------------------------------------------------------------+------+-----------+------------+-----------+------------+---------------+-------------+-------------+-----------+---------------+---------------+-------------------+---------------------+---------------------+----------------------------------+
-- | SELECT `e` . `round_robin_bin` ...  `timestamp` = `maxes` . `ts`  | mem  | *         |         14 |         0 |          0 | 43.96 s       | 6.69 s      | 3.14 s      |        11 |             1 |        253170 |             18084 | 2013-12-04 20:05:01 | 2013-12-04 20:06:34 | 29ba002bf039bb6439357a10134407de |
-- | SELECT `e` . `round_robin_bin` ...  `timestamp` = `maxes` . `ts`  | mem  | *         |          8 |         0 |          0 | 17.89 s       | 4.12 s      | 2.24 s      |         7 |             1 |        169534 |             21192 | 2013-12-04 20:04:54 | 2013-12-04 20:05:05 | 0b1c1f91e7e9e0ff91aa49d15f540793 |
-- | SELECT `e` . `round_robin_bin` ...  `timestamp` = `maxes` . `ts`  | mem  | *         |          1 |         0 |          0 | 2.22 s        | 2.22 s      | 2.22 s      |         1 |             1 |         40322 |             40322 | 2013-12-04 20:05:39 | 2013-12-04 20:05:39 | 07b27145c8f8a3779737df5032374833 |
-- | SELECT `e` . `round_robin_bin` ...  `timestamp` = `maxes` . `ts`  | mem  | *         |          1 |         0 |          0 | 1.97 s        | 1.97 s      | 1.97 s      |         1 |             1 |         40322 |             40322 | 2013-12-04 20:05:39 | 2013-12-04 20:05:39 | a07488137ea5c1bccf3e291c50bfd21f |
-- | SELECT `e` . `round_robin_bin` ...  `timestamp` = `maxes` . `ts`  | mem  | *         |          2 |         0 |          0 | 3.91 s        | 3.91 s      | 1.96 s      |         1 |             1 |         13126 |              6563 | 2013-12-04 20:05:04 | 2013-12-04 20:06:34 | b8bddc6566366dafc7e474f67096a93b |
-- +-------------------------------------------------------------------+------+-----------+------------+-----------+------------+---------------+-------------+-------------+-----------+---------------+---------------+-------------------+---------------------+---------------------+----------------------------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW statements_with_runtimes_in_95th_percentile (
  query,
  db,
  full_scan,
  exec_count,
  err_count,
  warn_count,
  total_latency,
  max_latency,
  avg_latency,
  rows_sent,
  rows_sent_avg,
  rows_examined,
  rows_examined_avg,
  first_seen,
  last_seen,
  digest
) AS
SELECT sys.format_statement(DIGEST_TEXT) AS query,
       SCHEMA_NAME as db,
       IF(SUM_NO_GOOD_INDEX_USED > 0 OR SUM_NO_INDEX_USED > 0, '*', '') AS full_scan,
       COUNT_STAR AS exec_count,
       SUM_ERRORS AS err_count,
       SUM_WARNINGS AS warn_count,
       sys.format_time(SUM_TIMER_WAIT) AS total_latency,
       sys.format_time(MAX_TIMER_WAIT) AS max_latency,
       sys.format_time(AVG_TIMER_WAIT) AS avg_latency,
       SUM_ROWS_SENT AS rows_sent,
       ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,
       SUM_ROWS_EXAMINED AS rows_examined,
       ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg,
       FIRST_SEEN AS first_seen,
       LAST_SEEN AS last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest stmts
  JOIN sys.x$ps_digest_95th_percentile_by_avg_us AS top_percentile
    ON ROUND(stmts.avg_timer_wait/1000000) >= top_percentile.avg_us
 ORDER BY AVG_TIMER_WAIT DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$statements_with_runtimes_in_95th_percentile
--
-- List all statements whose average runtime, in microseconds, is in the top 95th percentile.
-- 
-- mysql> SELECT * FROM x$statements_with_runtimes_in_95th_percentile LIMIT 1\G
-- *************************** 1. row ***************************
--             query: SELECT `e` . `round_robin_bin` AS `round1_1706_0_` , `e` . `id` AS `id1706_0_` , `e` . `timestamp` AS `timestamp1706_0_` , ... truncated
--                db: mem
--         full_scan: *
--        exec_count: 14
--         err_count: 0
--        warn_count: 0
--     total_latency: 43961670267000
--       max_latency: 6686877140000
--       avg_latency: 3140119304000
--         rows_sent: 11
--     rows_sent_avg: 1
--     rows_examined: 253170
-- rows_examined_avg: 18084
--        first_seen: 2013-12-04 20:05:01
--         last_seen: 2013-12-04 20:06:34
--            digest: 29ba002bf039bb6439357a10134407de
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$statements_with_runtimes_in_95th_percentile (
  query,
  db,
  full_scan,
  exec_count,
  err_count,
  warn_count,
  total_latency,
  max_latency,
  avg_latency,
  rows_sent,
  rows_sent_avg,
  rows_examined,
  rows_examined_avg,
  first_seen,
  last_seen,
  digest
) AS
SELECT DIGEST_TEXT AS query,
       SCHEMA_NAME AS db,
       IF(SUM_NO_GOOD_INDEX_USED > 0 OR SUM_NO_INDEX_USED > 0, '*', '') AS full_scan,
       COUNT_STAR AS exec_count,
       SUM_ERRORS AS err_count,
       SUM_WARNINGS AS warn_count,
       SUM_TIMER_WAIT AS total_latency,
       MAX_TIMER_WAIT AS max_latency,
       AVG_TIMER_WAIT AS avg_latency,
       SUM_ROWS_SENT AS rows_sent,
       ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,
       SUM_ROWS_EXAMINED AS rows_examined,
       ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest stmts
  JOIN sys.x$ps_digest_95th_percentile_by_avg_us AS top_percentile
    ON ROUND(stmts.avg_timer_wait/1000000) >= top_percentile.avg_us
 ORDER BY AVG_TIMER_WAIT DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: statements_with_sorting
--
-- Lists all normalized statements that have done sorts,
-- ordered by total_latency descending.
--
-- mysql> select * from statements_with_sorting limit 1\G
-- *************************** 1. row ***************************
--             query: SELECT * FROM `schema_object_o ... MA` , `information_schema` ...
--                db: sys
--        exec_count: 2
--     total_latency: 16.75 s
-- sort_merge_passes: 0
--   avg_sort_merges: 0
-- sorts_using_scans: 12
--  sort_using_range: 0
--       rows_sorted: 168
--   avg_rows_sorted: 84
--        first_seen: 2014-03-07 13:13:41
--         last_seen: 2014-03-07 13:13:48
--            digest: 54f9bd520f0bbf15db0c2ed93386bec9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW statements_with_sorting (
  query,
  db,
  exec_count,
  total_latency,
  sort_merge_passes,
  avg_sort_merges,
  sorts_using_scans,
  sort_using_range,
  rows_sorted,
  avg_rows_sorted,
  first_seen,
  last_seen,
  digest
) AS
SELECT sys.format_statement(DIGEST_TEXT) AS query,
       SCHEMA_NAME db,
       COUNT_STAR AS exec_count,
       sys.format_time(SUM_TIMER_WAIT) AS total_latency,
       SUM_SORT_MERGE_PASSES AS sort_merge_passes,
       ROUND(IFNULL(SUM_SORT_MERGE_PASSES / NULLIF(COUNT_STAR, 0), 0)) AS avg_sort_merges,
       SUM_SORT_SCAN AS sorts_using_scans,
       SUM_SORT_RANGE AS sort_using_range,
       SUM_SORT_ROWS AS rows_sorted,
       ROUND(IFNULL(SUM_SORT_ROWS / NULLIF(COUNT_STAR, 0), 0)) AS avg_rows_sorted,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE SUM_SORT_ROWS > 0
 ORDER BY SUM_TIMER_WAIT DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$statements_with_sorting
--
-- Lists all normalized statements that have done sorts,
-- ordered by total_latency descending.
--
-- mysql> select * from x$statements_with_sorting\G
-- *************************** 1. row ***************************
--             query: SELECT * FROM `schema_object_overview` SELECT `information_schema` . `routines` . `ROUTINE_SCHEMA` AS ... truncated
--                db: sys
--        exec_count: 2
--     total_latency: 16751388791000
-- sort_merge_passes: 0
--   avg_sort_merges: 0
-- sorts_using_scans: 12
--  sort_using_range: 0
--       rows_sorted: 168
--   avg_rows_sorted: 84
--        first_seen: 2014-03-07 13:13:41
--         last_seen: 2014-03-07 13:13:48
--            digest: 54f9bd520f0bbf15db0c2ed93386bec9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$statements_with_sorting (
  query,
  db,
  exec_count,
  total_latency,
  sort_merge_passes,
  avg_sort_merges,
  sorts_using_scans,
  sort_using_range,
  rows_sorted,
  avg_rows_sorted,
  first_seen,
  last_seen,
  digest
) AS
SELECT DIGEST_TEXT AS query,
       SCHEMA_NAME db,
       COUNT_STAR AS exec_count,
       SUM_TIMER_WAIT AS total_latency,
       SUM_SORT_MERGE_PASSES AS sort_merge_passes,
       ROUND(IFNULL(SUM_SORT_MERGE_PASSES / NULLIF(COUNT_STAR, 0), 0)) AS avg_sort_merges,
       SUM_SORT_SCAN AS sorts_using_scans,
       SUM_SORT_RANGE AS sort_using_range,
       SUM_SORT_ROWS AS rows_sorted,
       ROUND(IFNULL(SUM_SORT_ROWS / NULLIF(COUNT_STAR, 0), 0)) AS avg_rows_sorted,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE SUM_SORT_ROWS > 0
 ORDER BY SUM_TIMER_WAIT DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: statements_with_temp_tables
--
-- Lists all normalized statements that use temporary tables
-- ordered by number of on disk temporary tables descending first, 
-- then by the number of memory tables.
--
-- mysql> select * from statements_with_temp_tables limit 1\G
-- *************************** 1. row ***************************
--                    query: SELECT * FROM `schema_object_o ... MA` , `information_schema` ...
--                       db: sys
--               exec_count: 2
--            total_latency: 16.75 s
--        memory_tmp_tables: 378
--          disk_tmp_tables: 66
-- avg_tmp_tables_per_query: 189
--   tmp_tables_to_disk_pct: 17
--               first_seen: 2014-03-07 13:13:41
--                last_seen: 2014-03-07 13:13:48
--                   digest: 54f9bd520f0bbf15db0c2ed93386bec9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW statements_with_temp_tables (
  query,
  db,
  exec_count,
  total_latency,
  memory_tmp_tables,
  disk_tmp_tables,
  avg_tmp_tables_per_query,
  tmp_tables_to_disk_pct,
  first_seen,
  last_seen,
  digest
) AS
SELECT sys.format_statement(DIGEST_TEXT) AS query,
       SCHEMA_NAME as db,
       COUNT_STAR AS exec_count,
       sys.format_time(SUM_TIMER_WAIT) as total_latency,
       SUM_CREATED_TMP_TABLES AS memory_tmp_tables,
       SUM_CREATED_TMP_DISK_TABLES AS disk_tmp_tables,
       ROUND(IFNULL(SUM_CREATED_TMP_TABLES / NULLIF(COUNT_STAR, 0), 0)) AS avg_tmp_tables_per_query,
       ROUND(IFNULL(SUM_CREATED_TMP_DISK_TABLES / NULLIF(SUM_CREATED_TMP_TABLES, 0), 0) * 100) AS tmp_tables_to_disk_pct,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE SUM_CREATED_TMP_TABLES > 0
ORDER BY SUM_CREATED_TMP_DISK_TABLES DESC, SUM_CREATED_TMP_TABLES DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$statements_with_temp_tables
--
-- Lists all normalized statements that use temporary tables
-- ordered by number of on disk temporary tables descending first, 
-- then by the number of memory tables.
--
-- mysql> select * from x$statements_with_temp_tables limit 1\G
-- *************************** 1. row ***************************
--                    query: SELECT * FROM `schema_object_overview` SELECT `information_schema` . `routines` . `ROUTINE_SCHEMA` AS `db` , ... truncated
--                       db: sys
--               exec_count: 2
--            total_latency: 16751388791000
--        memory_tmp_tables: 378
--          disk_tmp_tables: 66
-- avg_tmp_tables_per_query: 189
--   tmp_tables_to_disk_pct: 17
--               first_seen: 2014-03-07 13:13:41
--                last_seen: 2014-03-07 13:13:48
--                   digest: 54f9bd520f0bbf15db0c2ed93386bec9
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$statements_with_temp_tables (
  query,
  db,
  exec_count,
  total_latency,
  memory_tmp_tables,
  disk_tmp_tables,
  avg_tmp_tables_per_query,
  tmp_tables_to_disk_pct,
  first_seen,
  last_seen,
  digest
) AS
SELECT DIGEST_TEXT AS query,
       SCHEMA_NAME as db,
       COUNT_STAR AS exec_count,
       SUM_TIMER_WAIT as total_latency,
       SUM_CREATED_TMP_TABLES AS memory_tmp_tables,
       SUM_CREATED_TMP_DISK_TABLES AS disk_tmp_tables,
       ROUND(IFNULL(SUM_CREATED_TMP_TABLES / NULLIF(COUNT_STAR, 0), 0)) AS avg_tmp_tables_per_query,
       ROUND(IFNULL(SUM_CREATED_TMP_DISK_TABLES / NULLIF(SUM_CREATED_TMP_TABLES, 0), 0) * 100) AS tmp_tables_to_disk_pct,
       FIRST_SEEN as first_seen,
       LAST_SEEN as last_seen,
       DIGEST AS digest
  FROM performance_schema.events_statements_summary_by_digest
 WHERE SUM_CREATED_TMP_TABLES > 0
ORDER BY SUM_CREATED_TMP_DISK_TABLES DESC, SUM_CREATED_TMP_TABLES DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: user_summary_by_file_io_type
--
-- Summarizes file IO by event type per user.
--
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from user_summary_by_file_io_type;
-- +------------+--------------------------------------+-------+-----------+-------------+
-- | user       | event_name                           | total | latency   | max_latency |
-- +------------+--------------------------------------+-------+-----------+-------------+
-- | background | wait/io/file/sql/FRM                 |   871 | 168.15 ms | 18.48 ms    |
-- | background | wait/io/file/innodb/innodb_data_file |   173 | 129.56 ms | 34.09 ms    |
-- | background | wait/io/file/innodb/innodb_log_file  |    20 | 77.53 ms  | 60.66 ms    |
-- | background | wait/io/file/myisam/dfile            |    40 | 6.54 ms   | 4.58 ms     |
-- | background | wait/io/file/mysys/charset           |     3 | 4.79 ms   | 4.71 ms     |
-- | background | wait/io/file/myisam/kfile            |    67 | 4.38 ms   | 300.04 us   |
-- | background | wait/io/file/sql/ERRMSG              |     5 | 2.72 ms   | 1.69 ms     |
-- | background | wait/io/file/sql/pid                 |     3 | 266.30 us | 185.47 us   |
-- | background | wait/io/file/sql/casetest            |     5 | 246.81 us | 150.19 us   |
-- | background | wait/io/file/sql/global_ddl_log      |     2 | 21.24 us  | 18.59 us    |
-- | root       | wait/io/file/sql/file_parser         |  1422 | 4.80 s    | 135.14 ms   |
-- | root       | wait/io/file/sql/FRM                 |   865 | 85.82 ms  | 9.81 ms     |
-- | root       | wait/io/file/myisam/kfile            |  1073 | 37.14 ms  | 15.79 ms    |
-- | root       | wait/io/file/myisam/dfile            |  2991 | 25.53 ms  | 5.25 ms     |
-- | root       | wait/io/file/sql/dbopt               |    20 | 1.07 ms   | 153.07 us   |
-- | root       | wait/io/file/sql/misc                |     4 | 59.71 us  | 33.75 us    |
-- | root       | wait/io/file/archive/data            |     1 | 13.91 us  | 13.91 us    |
-- +------------+--------------------------------------+-------+-----------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW user_summary_by_file_io_type (
  user,
  event_name,
  total,
  latency,
  max_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       event_name,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS latency,
       sys.format_time(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_by_user_by_event_name
 WHERE event_name LIKE 'wait/io/file%'
   AND count_star > 0
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$user_summary_by_file_io_type
--
-- Summarizes file IO by event type per user.
--
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$user_summary_by_file_io_type;
-- +------------+--------------------------------------+-------+---------------+--------------+
-- | user       | event_name                           | total | latency       | max_latency  |
-- +------------+--------------------------------------+-------+---------------+--------------+
-- | background | wait/io/file/sql/FRM                 |   871 |  168148450470 |  18482624810 |
-- | background | wait/io/file/innodb/innodb_data_file |   173 |  129564287450 |  34087423890 |
-- | background | wait/io/file/innodb/innodb_log_file  |    20 |   77525706960 |  60657475320 |
-- | background | wait/io/file/myisam/dfile            |    40 |    6544493800 |   4580546230 |
-- | background | wait/io/file/mysys/charset           |     3 |    4793558770 |   4713476430 |
-- | background | wait/io/file/myisam/kfile            |    67 |    4384332810 |    300035450 |
-- | background | wait/io/file/sql/ERRMSG              |     5 |    2717434850 |   1687316280 |
-- | background | wait/io/file/sql/pid                 |     3 |     266301490 |    185468920 |
-- | background | wait/io/file/sql/casetest            |     5 |     246814360 |    150193030 |
-- | background | wait/io/file/sql/global_ddl_log      |     2 |      21236410 |     18593640 |
-- | root       | wait/io/file/sql/file_parser         |  1422 | 4801104756760 | 135138518970 |
-- | root       | wait/io/file/sql/FRM                 |   865 |   85818594810 |   9812303410 |
-- | root       | wait/io/file/myisam/kfile            |  1073 |   37143664870 |  15793838190 |
-- | root       | wait/io/file/myisam/dfile            |  2991 |   25528215700 |   5252232050 |
-- | root       | wait/io/file/sql/dbopt               |    20 |    1067339780 |    153073310 |
-- | root       | wait/io/file/sql/misc                |     4 |      59713030 |     33752810 |
-- | root       | wait/io/file/archive/data            |     1 |      13907530 |     13907530 |
-- +------------+--------------------------------------+-------+---------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$user_summary_by_file_io_type (
  user,
  event_name,
  total,
  latency,
  max_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       event_name,
       count_star AS total,
       sum_timer_wait AS latency,
       max_timer_wait AS max_latency
  FROM performance_schema.events_waits_summary_by_user_by_event_name
 WHERE event_name LIKE 'wait/io/file%'
   AND count_star > 0
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: user_summary_by_file_io
--
-- Summarizes file IO totals per user.
--
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from user_summary_by_file_io;
-- +------------+-------+------------+
-- | user       | ios   | io_latency |
-- +------------+-------+------------+
-- | root       | 26457 | 21.58 s    |
-- | background |  1189 | 394.21 ms  |
-- +------------+-------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW user_summary_by_file_io (
  user,
  ios,
  io_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUM(count_star) AS ios,
       sys.format_time(SUM(sum_timer_wait)) AS io_latency 
  FROM performance_schema.events_waits_summary_by_user_by_event_name
 WHERE event_name LIKE 'wait/io/file/%'
 GROUP BY IF(user IS NULL, 'background', user)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$user_summary_by_file_io
--
-- Summarizes file IO totals per user.
--
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$user_summary_by_file_io;
-- +------------+-------+----------------+
-- | user       | ios   | io_latency     |
-- +------------+-------+----------------+
-- | root       | 26457 | 21579585586390 |
-- | background |  1189 |   394212617370 |
-- +------------+-------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$user_summary_by_file_io (
  user,
  ios,
  io_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUM(count_star) AS ios,
       SUM(sum_timer_wait) AS io_latency 
  FROM performance_schema.events_waits_summary_by_user_by_event_name
 WHERE event_name LIKE 'wait/io/file/%'
 GROUP BY IF(user IS NULL, 'background', user)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: user_summary_by_statement_type
--
-- Summarizes the types of statements executed by each user.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from user_summary_by_statement_type;
-- +------+----------------------+--------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | user | statement            | total  | total_latency | max_latency | lock_latency | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+----------------------+--------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | root | create_view          |   2063 | 00:05:04.20   | 463.58 ms   | 1.42 s       |         0 |             0 |             0 |          0 |
-- | root | select               |    174 | 40.87 s       | 28.83 s     | 858.13 ms    |      5212 |        157022 |             0 |         82 |
-- | root | stmt                 |   6645 | 15.31 s       | 491.78 ms   | 0 ps         |         0 |             0 |          7951 |          0 |
-- | root | call_procedure       |     17 | 4.78 s        | 1.02 s      | 37.94 ms     |         0 |             0 |            19 |          0 |
-- | root | create_table         |     19 | 3.04 s        | 431.71 ms   | 0 ps         |         0 |             0 |             0 |          0 |
-- ...
-- +------+----------------------+--------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW user_summary_by_statement_type (
  user,
  statement,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUBSTRING_INDEX(event_name, '/', -1) AS statement,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(max_timer_wait) AS max_latency,
       sys.format_time(sum_lock_time) AS lock_latency,
       sum_rows_sent AS rows_sent,
       sum_rows_examined AS rows_examined,
       sum_rows_affected AS rows_affected,
       sum_no_index_used + sum_no_good_index_used AS full_scans
  FROM performance_schema.events_statements_summary_by_user_by_event_name
 WHERE sum_timer_wait != 0
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$user_summary_by_statement_type
--
-- Summarizes the types of statements executed by each user.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$user_summary_by_statement_type;
-- +------+----------------------+--------+-----------------+----------------+----------------+-----------+---------------+---------------+------------+
-- | user | statement            | total  | total_latency   | max_latency    | lock_latency   | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+----------------------+--------+-----------------+----------------+----------------+-----------+---------------+---------------+------------+
-- | root | create_view          |   2110 | 312717366332000 |   463578029000 |  1432355000000 |         0 |             0 |             0 |          0 |
-- | root | select               |    177 |  41115690428000 | 28827579292000 |   858709000000 |      5254 |        157437 |             0 |         83 |
-- | root | stmt                 |   6645 |  15305389969000 |   491780297000 |              0 |         0 |             0 |          7951 |          0 |
-- | root | call_procedure       |     17 |   4783806053000 |  1016083397000 |    37936000000 |         0 |             0 |            19 |          0 |
-- | root | create_table         |     19 |   3035120946000 |   431706815000 |              0 |         0 |             0 |             0 |          0 |
-- ...
-- +------+----------------------+--------+-----------------+----------------+----------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$user_summary_by_statement_type (
  user,
  statement,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUBSTRING_INDEX(event_name, '/', -1) AS statement,
       count_star AS total,
       sum_timer_wait AS total_latency,
       max_timer_wait AS max_latency,
       sum_lock_time AS lock_latency,
       sum_rows_sent AS rows_sent,
       sum_rows_examined AS rows_examined,
       sum_rows_affected AS rows_affected,
       sum_no_index_used + sum_no_good_index_used AS full_scans
  FROM performance_schema.events_statements_summary_by_user_by_event_name
 WHERE sum_timer_wait != 0
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: user_summary_by_statement_latency
--
-- Summarizes overall statement statistics by user.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from user_summary_by_statement_latency;
-- +------+-------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | user | total | total_latency | max_latency | lock_latency | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+-------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | root |  3381 | 00:02:09.13   | 1.48 s      | 1.07 s       |      1151 |         93947 |           150 |         91 |
-- +------+-------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW user_summary_by_statement_latency (
  user,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUM(count_star) AS total,
       sys.format_time(SUM(sum_timer_wait)) AS total_latency,
       sys.format_time(SUM(max_timer_wait)) AS max_latency,
       sys.format_time(SUM(sum_lock_time)) AS lock_latency,
       SUM(sum_rows_sent) AS rows_sent,
       SUM(sum_rows_examined) AS rows_examined,
       SUM(sum_rows_affected) AS rows_affected,
       SUM(sum_no_index_used) + SUM(sum_no_good_index_used) AS full_scans
  FROM performance_schema.events_statements_summary_by_user_by_event_name
 GROUP BY IF(user IS NULL, 'background', user)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$user_summary_by_statement_latency
--
-- Summarizes overall statement statistics by user.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$user_summary_by_statement_latency;
-- +------+-------+-----------------+---------------+---------------+-----------+---------------+---------------+------------+
-- | user | total | total_latency   | max_latency   | lock_latency  | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+-------+-----------------+---------------+---------------+-----------+---------------+---------------+------------+
-- | root |  3382 | 129134039432000 | 1483246743000 | 1069831000000 |      1152 |         94286 |           150 |         92 |
-- +------+-------+-----------------+---------------+---------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$user_summary_by_statement_latency (
  user,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       SUM(count_star) AS total,
       SUM(sum_timer_wait) AS total_latency,
       SUM(max_timer_wait) AS max_latency,
       SUM(sum_lock_time) AS lock_latency,
       SUM(sum_rows_sent) AS rows_sent,
       SUM(sum_rows_examined) AS rows_examined,
       SUM(sum_rows_affected) AS rows_affected,
       SUM(sum_no_index_used) + SUM(sum_no_good_index_used) AS full_scans
  FROM performance_schema.events_statements_summary_by_user_by_event_name
 GROUP BY IF(user IS NULL, 'background', user)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: user_summary_by_stages
--
-- Summarizes stages by user, ordered by user and total latency per stage.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
-- 
-- mysql> select * from user_summary_by_stages;
-- +------+--------------------------------+-------+---------------+-------------+
-- | user | event_name                     | total | total_latency | avg_latency |
-- +------+--------------------------------+-------+---------------+-------------+
-- | root | stage/sql/Opening tables       |   889 | 1.97 ms       | 2.22 us     |
-- | root | stage/sql/Creating sort index  |     4 | 1.79 ms       | 446.30 us   |
-- | root | stage/sql/init                 |    10 | 312.27 us     | 31.23 us    |
-- | root | stage/sql/checking permissions |    10 | 300.62 us     | 30.06 us    |
-- | root | stage/sql/freeing items        |     5 | 85.89 us      | 17.18 us    |
-- | root | stage/sql/statistics           |     5 | 79.15 us      | 15.83 us    |
-- | root | stage/sql/preparing            |     5 | 69.12 us      | 13.82 us    |
-- | root | stage/sql/optimizing           |     5 | 53.11 us      | 10.62 us    |
-- | root | stage/sql/Sending data         |     5 | 44.66 us      | 8.93 us     |
-- | root | stage/sql/closing tables       |     5 | 37.54 us      | 7.51 us     |
-- | root | stage/sql/System lock          |     5 | 34.28 us      | 6.86 us     |
-- | root | stage/sql/query end            |     5 | 24.37 us      | 4.87 us     |
-- | root | stage/sql/end                  |     5 | 8.60 us       | 1.72 us     |
-- | root | stage/sql/Sorting result       |     5 | 8.33 us       | 1.67 us     |
-- | root | stage/sql/executing            |     5 | 5.37 us       | 1.07 us     |
-- | root | stage/sql/cleaning up          |     5 | 4.60 us       | 919.00 ns   |
-- +------+--------------------------------+-------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW user_summary_by_stages (
  user,
  event_name,
  total,
  total_latency,
  avg_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       event_name,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency, 
       sys.format_time(avg_timer_wait) AS avg_latency 
  FROM performance_schema.events_stages_summary_by_user_by_event_name
 WHERE sum_timer_wait != 0 
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$user_summary_by_stages
--
-- Summarizes stages by user, ordered by user and total latency per stage.
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
-- 
-- mysql> select * from x$user_summary_by_stages;
-- +------+--------------------------------+-------+---------------+-------------+
-- | user | event_name                     | total | total_latency | avg_latency |
-- +------+--------------------------------+-------+---------------+-------------+
-- | root | stage/sql/Opening tables       |  1114 |   71919037000 |    64559000 |
-- | root | stage/sql/Creating sort index  |     5 |    2245762000 |   449152000 |
-- | root | stage/sql/init                 |    13 |     428798000 |    32984000 |
-- | root | stage/sql/checking permissions |    13 |     363231000 |    27940000 |
-- | root | stage/sql/freeing items        |     7 |     137728000 |    19675000 |
-- | root | stage/sql/statistics           |     6 |      93955000 |    15659000 |
-- | root | stage/sql/preparing            |     6 |      82571000 |    13761000 |
-- | root | stage/sql/optimizing           |     6 |      63338000 |    10556000 |
-- | root | stage/sql/Sending data         |     6 |      53400000 |     8900000 |
-- | root | stage/sql/closing tables       |     7 |      46922000 |     6703000 |
-- | root | stage/sql/System lock          |     6 |      40175000 |     6695000 |
-- | root | stage/sql/query end            |     7 |      31723000 |     4531000 |
-- | root | stage/sql/Sorting result       |     6 |       9855000 |     1642000 |
-- | root | stage/sql/end                  |     6 |       9556000 |     1592000 |
-- | root | stage/sql/cleaning up          |     7 |       7312000 |     1044000 |
-- | root | stage/sql/executing            |     6 |       6487000 |     1081000 |
-- +------+--------------------------------+-------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$user_summary_by_stages (
  user,
  event_name,
  total,
  total_latency,
  avg_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       event_name,
       count_star AS total,
       sum_timer_wait AS total_latency, 
       avg_timer_wait AS avg_latency 
  FROM performance_schema.events_stages_summary_by_user_by_event_name
 WHERE sum_timer_wait != 0 
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: user_summary
--
-- Summarizes statement activity and connections by user
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
--
-- mysql> select * from user_summary;
-- +------+------------+---------------+-------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | user | statements | total_latency | avg_latency | current_connections | total_connections | unique_hosts | current_memory | total_memory_allocated |
-- +------+------------+---------------+-------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | root |       5663 | 00:01:47.14   | 18.92 ms    |                   1 |                 1 |            1 | 1.41 MiB       | 543.55 MiB             |
-- | mark |        225 | 14.49 s       | 64.40 ms    |                   1 |                 1 |            1 | 707.60 KiB     | 81.02 MiB              |
-- +------+------------+---------------+-------------+---------------------+-------------------+--------------+----------------+------------------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW user_summary (
  user,
  statements,
  statement_latency,
  statement_avg_latency,
  table_scans,
  file_ios,
  file_io_latency,
  current_connections,
  total_connections,
  unique_hosts,
  current_memory,
  total_memory_allocated
) AS
SELECT IF(accounts.user IS NULL, 'background', accounts.user) AS user,
       SUM(stmt.total) AS statements,
       sys.format_time(SUM(stmt.total_latency)) AS statement_latency,
       sys.format_time(IFNULL(SUM(stmt.total_latency) / NULLIF(SUM(stmt.total), 0), 0)) AS statement_avg_latency,
       SUM(stmt.full_scans) AS table_scans,
       SUM(io.ios) AS file_ios,
       sys.format_time(SUM(io.io_latency)) AS file_io_latency,
       SUM(accounts.current_connections) AS current_connections,
       SUM(accounts.total_connections) AS total_connections,
       COUNT(DISTINCT host) AS unique_hosts,
       sys.format_bytes(SUM(mem.current_allocated)) AS current_memory,
       sys.format_bytes(SUM(mem.total_allocated)) AS total_memory_allocated
  FROM performance_schema.accounts
  LEFT JOIN sys.x$user_summary_by_statement_latency AS stmt ON IF(accounts.user IS NULL, 'background', accounts.user) = stmt.user
  LEFT JOIN sys.x$user_summary_by_file_io AS io ON IF(accounts.user IS NULL, 'background', accounts.user) = io.user
  LEFT JOIN sys.x$memory_by_user_by_current_bytes mem ON IF(accounts.user IS NULL, 'background', accounts.user) = mem.user
 GROUP BY IF(accounts.user IS NULL, 'background', accounts.user)
 ORDER BY SUM(stmt.total_latency) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$user_summary
--
-- Summarizes statement activity and connections by user
-- 
-- When the user found is NULL, it is assumed to be a "background" thread.  
--
-- mysql> select * from x$user_summary;
-- +------+------------+-----------------+------------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | user | statements | total_latency   | avg_latency      | current_connections | total_connections | unique_hosts | current_memory | total_memory_allocated |
-- +------+------------+-----------------+------------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | root |       5685 | 107175100271000 | 18852260381.8821 |                   1 |                 1 |            1 |        1459022 |              572855680 |
-- | mark |        225 |  14489223428000 | 64396548568.8889 |                   1 |                 1 |            1 |         724578 |               84958286 |
-- +------+------------+-----------------+------------------+---------------------+-------------------+--------------+----------------+------------------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$user_summary (
  user,
  statements,
  statement_latency,
  statement_avg_latency,
  table_scans,
  file_ios,
  file_io_latency,
  current_connections,
  total_connections,
  unique_hosts,
  current_memory,
  total_memory_allocated
) AS
SELECT IF(accounts.user IS NULL, 'background', accounts.user) AS user,
       SUM(stmt.total) AS statements,
       SUM(stmt.total_latency) AS statement_latency,
       IFNULL(SUM(stmt.total_latency) / NULLIF(SUM(stmt.total), 0), 0) AS statement_avg_latency,
       SUM(stmt.full_scans) AS table_scans,
       SUM(io.ios) AS file_ios,
       SUM(io.io_latency) AS file_io_latency,
       SUM(accounts.current_connections) AS current_connections,
       SUM(accounts.total_connections) AS total_connections,
       COUNT(DISTINCT host) AS unique_hosts,
       SUM(mem.current_allocated) AS current_memory,
       SUM(mem.total_allocated) AS total_memory_allocated
  FROM performance_schema.accounts
  LEFT JOIN sys.x$user_summary_by_statement_latency AS stmt ON IF(accounts.user IS NULL, 'background', accounts.user) = stmt.user
  LEFT JOIN sys.x$user_summary_by_file_io AS io ON IF(accounts.user IS NULL, 'background', accounts.user) = io.user
  LEFT JOIN sys.x$memory_by_user_by_current_bytes mem ON IF(accounts.user IS NULL, 'background', accounts.user) = mem.user
 GROUP BY IF(accounts.user IS NULL, 'background', accounts.user)
 ORDER BY SUM(stmt.total_latency) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: host_summary_by_file_io_type
--
-- Summarizes file IO by event type per host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from host_summary_by_file_io_type;
-- +------------+--------------------------------------+-------+---------------+-------------+
-- | host       | event_name                           | total | total_latency | max_latency |
-- +------------+--------------------------------------+-------+---------------+-------------+
-- | hal1       | wait/io/file/sql/FRM                 |   871 | 168.15 ms     | 18.48 ms    |
-- | hal1       | wait/io/file/innodb/innodb_data_file |   173 | 129.56 ms     | 34.09 ms    |
-- | hal1       | wait/io/file/innodb/innodb_log_file  |    20 | 77.53 ms      | 60.66 ms    |
-- | hal1       | wait/io/file/myisam/dfile            |    40 | 6.54 ms       | 4.58 ms     |
-- | hal1       | wait/io/file/mysys/charset           |     3 | 4.79 ms       | 4.71 ms     |
-- | hal1       | wait/io/file/myisam/kfile            |    67 | 4.38 ms       | 300.04 us   |
-- | hal1       | wait/io/file/sql/ERRMSG              |     5 | 2.72 ms       | 1.69 ms     |
-- | hal1       | wait/io/file/sql/pid                 |     3 | 266.30 us     | 185.47 us   |
-- | hal1       | wait/io/file/sql/casetest            |     5 | 246.81 us     | 150.19 us   |
-- | hal1       | wait/io/file/sql/global_ddl_log      |     2 | 21.24 us      | 18.59 us    |
-- | hal2       | wait/io/file/sql/file_parser         |  1422 | 4.80 s        | 135.14 ms   |
-- | hal2       | wait/io/file/sql/FRM                 |   865 | 85.82 ms      | 9.81 ms     |
-- | hal2       | wait/io/file/myisam/kfile            |  1073 | 37.14 ms      | 15.79 ms    |
-- | hal2       | wait/io/file/myisam/dfile            |  2991 | 25.53 ms      | 5.25 ms     |
-- | hal2       | wait/io/file/sql/dbopt               |    20 | 1.07 ms       | 153.07 us   |
-- | hal2       | wait/io/file/sql/misc                |     4 | 59.71 us      | 33.75 us    |
-- | hal2       | wait/io/file/archive/data            |     1 | 13.91 us      | 13.91 us    |
-- +------------+--------------------------------------+-------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW host_summary_by_file_io_type (
  host,
  event_name,
  total,
  total_latency,
  max_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       event_name,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_by_host_by_event_name
 WHERE event_name LIKE 'wait/io/file%'
   AND count_star > 0
 ORDER BY IF(host IS NULL, 'background', host), sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$host_summary_by_file_io_type
--
-- Summarizes file IO by event type per host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$host_summary_by_file_io_type;
-- +------------+--------------------------------------+-------+---------------+--------------+
-- | host       | event_name                           | total | total_latency | max_latency  |
-- +------------+--------------------------------------+-------+---------------+--------------+
-- | hal1       | wait/io/file/sql/FRM                 |   871 |  168148450470 |  18482624810 |
-- | hal1       | wait/io/file/innodb/innodb_data_file |   173 |  129564287450 |  34087423890 |
-- | hal1       | wait/io/file/innodb/innodb_log_file  |    20 |   77525706960 |  60657475320 |
-- | hal1       | wait/io/file/myisam/dfile            |    40 |    6544493800 |   4580546230 |
-- | hal1       | wait/io/file/mysys/charset           |     3 |    4793558770 |   4713476430 |
-- | hal1       | wait/io/file/myisam/kfile            |    67 |    4384332810 |    300035450 |
-- | hal1       | wait/io/file/sql/ERRMSG              |     5 |    2717434850 |   1687316280 |
-- | hal1       | wait/io/file/sql/pid                 |     3 |     266301490 |    185468920 |
-- | hal1       | wait/io/file/sql/casetest            |     5 |     246814360 |    150193030 |
-- | hal1       | wait/io/file/sql/global_ddl_log      |     2 |      21236410 |     18593640 |
-- | hal2       | wait/io/file/sql/file_parser         |  1422 | 4801104756760 | 135138518970 |
-- | hal2       | wait/io/file/sql/FRM                 |   865 |   85818594810 |   9812303410 |
-- | hal2       | wait/io/file/myisam/kfile            |  1073 |   37143664870 |  15793838190 |
-- | hal2       | wait/io/file/myisam/dfile            |  2991 |   25528215700 |   5252232050 |
-- | hal2       | wait/io/file/sql/dbopt               |    20 |    1067339780 |    153073310 |
-- | hal2       | wait/io/file/sql/misc                |     4 |      59713030 |     33752810 |
-- | hal2       | wait/io/file/archive/data            |     1 |      13907530 |     13907530 |
-- +------------+--------------------------------------+-------+---------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$host_summary_by_file_io_type (
  host,
  event_name,
  total,
  total_latency,
  max_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       event_name,
       count_star AS total,
       sum_timer_wait AS total_latency,
       max_timer_wait AS max_latency
  FROM performance_schema.events_waits_summary_by_host_by_event_name
 WHERE event_name LIKE 'wait/io/file%'
   AND count_star > 0
 ORDER BY IF(host IS NULL, 'background', host), sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: host_summary_by_file_io
--
-- Summarizes file IO totals per host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from host_summary_by_file_io;
-- +------------+-------+------------+
-- | host       | ios   | io_latency |
-- +------------+-------+------------+
-- | hal1       | 26457 | 21.58 s    |
-- | hal2       |  1189 | 394.21 ms  |
-- +------------+-------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW host_summary_by_file_io (
  host,
  ios,
  io_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUM(count_star) AS ios,
       sys.format_time(SUM(sum_timer_wait)) AS io_latency 
  FROM performance_schema.events_waits_summary_by_host_by_event_name
 WHERE event_name LIKE 'wait/io/file/%'
 GROUP BY IF(host IS NULL, 'background', host)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$host_summary_by_file_io
--
-- Summarizes file IO totals per host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$host_summary_by_file_io;
-- +------------+-------+----------------+
-- | host       | ios   | io_latency     |
-- +------------+-------+----------------+
-- | hal1       | 26457 | 21579585586390 |
-- | hal2       |  1189 |   394212617370 |
-- +------------+-------+----------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$host_summary_by_file_io (
  host,
  ios,
  io_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUM(count_star) AS ios,
       SUM(sum_timer_wait) AS io_latency 
  FROM performance_schema.events_waits_summary_by_host_by_event_name
 WHERE event_name LIKE 'wait/io/file/%'
 GROUP BY IF(host IS NULL, 'background', host)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: host_summary_by_statement_type
--
-- Summarizes the types of statements executed by each host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from host_summary_by_statement_type;
-- +------+----------------------+--------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | host | statement            | total  | total_latency | max_latency | lock_latency | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+----------------------+--------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | hal  | create_view          |   2063 | 00:05:04.20   | 463.58 ms   | 1.42 s       |         0 |             0 |             0 |          0 |
-- | hal  | select               |    174 | 40.87 s       | 28.83 s     | 858.13 ms    |      5212 |        157022 |             0 |         82 |
-- | hal  | stmt                 |   6645 | 15.31 s       | 491.78 ms   | 0 ps         |         0 |             0 |          7951 |          0 |
-- | hal  | call_procedure       |     17 | 4.78 s        | 1.02 s      | 37.94 ms     |         0 |             0 |            19 |          0 |
-- | hal  | create_table         |     19 | 3.04 s        | 431.71 ms   | 0 ps         |         0 |             0 |             0 |          0 |
-- ...
-- +------+----------------------+--------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW host_summary_by_statement_type (
  host,
  statement,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUBSTRING_INDEX(event_name, '/', -1) AS statement,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(max_timer_wait) AS max_latency,
       sys.format_time(sum_lock_time) AS lock_latency,
       sum_rows_sent AS rows_sent,
       sum_rows_examined AS rows_examined,
       sum_rows_affected AS rows_affected,
       sum_no_index_used + sum_no_good_index_used AS full_scans
  FROM performance_schema.events_statements_summary_by_host_by_event_name
 WHERE sum_timer_wait != 0
 ORDER BY IF(host IS NULL, 'background', host), sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$host_summary_by_statement_type
--
-- Summarizes the types of statements executed by each host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$host_summary_by_statement_type;
-- +------+----------------------+--------+-----------------+----------------+----------------+-----------+---------------+---------------+------------+
-- | host | statement            | total  | total_latency   | max_latency    | lock_latency   | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+----------------------+--------+-----------------+----------------+----------------+-----------+---------------+---------------+------------+
-- | hal  | create_view          |   2110 | 312717366332000 |   463578029000 |  1432355000000 |         0 |             0 |             0 |          0 |
-- | hal  | select               |    177 |  41115690428000 | 28827579292000 |   858709000000 |      5254 |        157437 |             0 |         83 |
-- | hal  | stmt                 |   6645 |  15305389969000 |   491780297000 |              0 |         0 |             0 |          7951 |          0 |
-- | hal  | call_procedure       |     17 |   4783806053000 |  1016083397000 |    37936000000 |         0 |             0 |            19 |          0 |
-- | hal  | create_table         |     19 |   3035120946000 |   431706815000 |              0 |         0 |             0 |             0 |          0 |
-- ...
-- +------+----------------------+--------+-----------------+----------------+----------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$host_summary_by_statement_type (
  host,
  statement,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUBSTRING_INDEX(event_name, '/', -1) AS statement,
       count_star AS total,
       sum_timer_wait AS total_latency,
       max_timer_wait AS max_latency,
       sum_lock_time AS lock_latency,
       sum_rows_sent AS rows_sent,
       sum_rows_examined AS rows_examined,
       sum_rows_affected AS rows_affected,
       sum_no_index_used + sum_no_good_index_used AS full_scans
  FROM performance_schema.events_statements_summary_by_host_by_event_name
 WHERE sum_timer_wait != 0
 ORDER BY IF(host IS NULL, 'background', host), sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: host_summary_by_statement_latency
--
-- Summarizes overall statement statistics by host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select-- from host_summary_by_statement_latency;
-- +------+-------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | host | total | total_latency | max_latency | lock_latency | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+-------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
-- | hal  |  3381 | 00:02:09.13   | 1.48 s      | 1.07 s       |      1151 |         93947 |           150 |         91 |
-- +------+-------+---------------+-------------+--------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW host_summary_by_statement_latency (
  host,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUM(count_star) AS total,
       sys.format_time(SUM(sum_timer_wait)) AS total_latency,
       sys.format_time(MAX(max_timer_wait)) AS max_latency,
       sys.format_time(SUM(sum_lock_time)) AS lock_latency,
       SUM(sum_rows_sent) AS rows_sent,
       SUM(sum_rows_examined) AS rows_examined,
       SUM(sum_rows_affected) AS rows_affected,
       SUM(sum_no_index_used) + SUM(sum_no_good_index_used) AS full_scans
  FROM performance_schema.events_statements_summary_by_host_by_event_name
 GROUP BY IF(host IS NULL, 'background', host)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$host_summary_by_statement_latency
--
-- Summarizes overall statement statistics by host.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$host_summary_by_statement_latency;
-- +------+-------+-----------------+---------------+---------------+-----------+---------------+---------------+------------+
-- | host | total | total_latency   | max_latency   | lock_latency  | rows_sent | rows_examined | rows_affected | full_scans |
-- +------+-------+-----------------+---------------+---------------+-----------+---------------+---------------+------------+
-- | hal  |  3382 | 129134039432000 | 1483246743000 | 1069831000000 |      1152 |         94286 |           150 |         92 |
-- +------+-------+-----------------+---------------+---------------+-----------+---------------+---------------+------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$host_summary_by_statement_latency (
  host,
  total,
  total_latency,
  max_latency,
  lock_latency,
  rows_sent,
  rows_examined,
  rows_affected,
  full_scans
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       SUM(count_star) AS total,
       SUM(sum_timer_wait) AS total_latency,
       MAX(max_timer_wait) AS max_latency,
       SUM(sum_lock_time) AS lock_latency,
       SUM(sum_rows_sent) AS rows_sent,
       SUM(sum_rows_examined) AS rows_examined,
       SUM(sum_rows_affected) AS rows_affected,
       SUM(sum_no_index_used) + SUM(sum_no_good_index_used) AS full_scans
  FROM performance_schema.events_statements_summary_by_host_by_event_name
 GROUP BY IF(host IS NULL, 'background', host)
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: host_summary_by_stages
--
-- Summarizes stages by host, ordered by host and total latency per stage.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from host_summary_by_stages;
-- +------+--------------------------------+-------+---------------+-------------+
-- | host | event_name                     | total | total_latency | avg_latency |
-- +------+--------------------------------+-------+---------------+-------------+
-- | hal  | stage/sql/Opening tables       |   889 | 1.97 ms       | 2.22 us     |
-- | hal  | stage/sql/Creating sort index  |     4 | 1.79 ms       | 446.30 us   |
-- | hal  | stage/sql/init                 |    10 | 312.27 us     | 31.23 us    |
-- | hal  | stage/sql/checking permissions |    10 | 300.62 us     | 30.06 us    |
-- | hal  | stage/sql/freeing items        |     5 | 85.89 us      | 17.18 us    |
-- | hal  | stage/sql/statistics           |     5 | 79.15 us      | 15.83 us    |
-- | hal  | stage/sql/preparing            |     5 | 69.12 us      | 13.82 us    |
-- | hal  | stage/sql/optimizing           |     5 | 53.11 us      | 10.62 us    |
-- | hal  | stage/sql/Sending data         |     5 | 44.66 us      | 8.93 us     |
-- | hal  | stage/sql/closing tables       |     5 | 37.54 us      | 7.51 us     |
-- | hal  | stage/sql/System lock          |     5 | 34.28 us      | 6.86 us     |
-- | hal  | stage/sql/query end            |     5 | 24.37 us      | 4.87 us     |
-- | hal  | stage/sql/end                  |     5 | 8.60 us       | 1.72 us     |
-- | hal  | stage/sql/Sorting result       |     5 | 8.33 us       | 1.67 us     |
-- | hal  | stage/sql/executing            |     5 | 5.37 us       | 1.07 us     |
-- | hal  | stage/sql/cleaning up          |     5 | 4.60 us       | 919.00 ns   |
-- +------+--------------------------------+-------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW host_summary_by_stages (
  host,
  event_name,
  total,
  total_latency,
  avg_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       event_name,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency, 
       sys.format_time(avg_timer_wait) AS avg_latency 
  FROM performance_schema.events_stages_summary_by_host_by_event_name
 WHERE sum_timer_wait != 0
 ORDER BY IF(host IS NULL, 'background', host), sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$host_summary_by_stages
--
-- Summarizes stages by host, ordered by host and total latency per stage.
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$host_summary_by_stages;
-- +------+--------------------------------+-------+---------------+-------------+
-- | host | event_name                     | total | total_latency | avg_latency |
-- +------+--------------------------------+-------+---------------+-------------+
-- | hal  | stage/sql/Opening tables       |  1114 |   71919037000 |    64559000 |
-- | hal  | stage/sql/Creating sort index  |     5 |    2245762000 |   449152000 |
-- | hal  | stage/sql/init                 |    13 |     428798000 |    32984000 |
-- | hal  | stage/sql/checking permissions |    13 |     363231000 |    27940000 |
-- | hal  | stage/sql/freeing items        |     7 |     137728000 |    19675000 |
-- | hal  | stage/sql/statistics           |     6 |      93955000 |    15659000 |
-- | hal  | stage/sql/preparing            |     6 |      82571000 |    13761000 |
-- | hal  | stage/sql/optimizing           |     6 |      63338000 |    10556000 |
-- | hal  | stage/sql/Sending data         |     6 |      53400000 |     8900000 |
-- | hal  | stage/sql/closing tables       |     7 |      46922000 |     6703000 |
-- | hal  | stage/sql/System lock          |     6 |      40175000 |     6695000 |
-- | hal  | stage/sql/query end            |     7 |      31723000 |     4531000 |
-- | hal  | stage/sql/Sorting result       |     6 |       9855000 |     1642000 |
-- | hal  | stage/sql/end                  |     6 |       9556000 |     1592000 |
-- | hal  | stage/sql/cleaning up          |     7 |       7312000 |     1044000 |
-- | hal  | stage/sql/executing            |     6 |       6487000 |     1081000 |
-- +------+--------------------------------+-------+---------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$host_summary_by_stages (
  host,
  event_name,
  total,
  total_latency,
  avg_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       event_name,
       count_star AS total,
       sum_timer_wait AS total_latency, 
       avg_timer_wait AS avg_latency 
  FROM performance_schema.events_stages_summary_by_host_by_event_name
 WHERE sum_timer_wait != 0
 ORDER BY IF(host IS NULL, 'background', host), sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: host_summary
--
-- Summarizes statement activity and connections by host
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from host_summary;
-- +------+------------+---------------+-------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | host | statements | total_latency | avg_latency | current_connections | total_connections | unique_users | current_memory | total_memory_allocated |
-- +------+------------+---------------+-------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | hal1 |       5663 | 00:01:47.14   | 18.92 ms    |                   1 |                 1 |            1 | 1.41 MiB       | 543.55 MiB             |
-- | hal2 |        225 | 14.49 s       | 64.40 ms    |                   1 |                 1 |            1 | 707.60 KiB     | 81.02 MiB              |
-- +------+------------+---------------+-------------+---------------------+-------------------+--------------+----------------+------------------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW host_summary (
  host,
  statements,
  statement_latency,
  statement_avg_latency,
  table_scans,
  file_ios,
  file_io_latency,
  current_connections,
  total_connections,
  unique_users,
  current_memory,
  total_memory_allocated
) AS
SELECT IF(accounts.host IS NULL, 'background', accounts.host) AS host,
       SUM(stmt.total) AS statements,
       sys.format_time(SUM(stmt.total_latency)) AS statement_latency,
       sys.format_time(IFNULL(SUM(stmt.total_latency) / NULLIF(SUM(stmt.total), 0), 0)) AS statement_avg_latency,
       SUM(stmt.full_scans) AS table_scans,
       SUM(io.ios) AS file_ios,
       sys.format_time(SUM(io.io_latency)) AS file_io_latency,
       SUM(accounts.current_connections) AS current_connections,
       SUM(accounts.total_connections) AS total_connections,
       COUNT(DISTINCT user) AS unique_users,
       sys.format_bytes(SUM(mem.current_allocated)) AS current_memory,
       sys.format_bytes(SUM(mem.total_allocated)) AS total_memory_allocated
  FROM performance_schema.accounts
  JOIN sys.x$host_summary_by_statement_latency AS stmt ON accounts.host = stmt.host
  JOIN sys.x$host_summary_by_file_io AS io ON accounts.host = io.host
  JOIN sys.x$memory_by_host_by_current_bytes mem ON accounts.host = mem.host
 GROUP BY IF(accounts.host IS NULL, 'background', accounts.host);

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$host_summary
--
-- Summarizes statement activity and connections by host
--
-- When the host found is NULL, it is assumed to be a "background" thread.
--
-- mysql> select * from x$host_summary;
-- +------+------------+-----------------+------------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | host | statements | total_latency   | avg_latency      | current_connections | total_connections | unique_users | current_memory | total_memory_allocated |
-- +------+------------+-----------------+------------------+---------------------+-------------------+--------------+----------------+------------------------+
-- | hal1 |       5685 | 107175100271000 | 18852260381.8821 |                   1 |                 1 |            1 |        1459022 |              572855680 |
-- | hal2 |        225 |  14489223428000 | 64396548568.8889 |                   1 |                 1 |            1 |         724578 |               84958286 |
-- +------+------------+-----------------+------------------+---------------------+-------------------+--------------+----------------+------------------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$host_summary (
  host,
  statements,
  statement_latency,
  statement_avg_latency,
  table_scans,
  file_ios,
  file_io_latency,
  current_connections,
  total_connections,
  unique_users,
  current_memory,
  total_memory_allocated
) AS
SELECT IF(accounts.host IS NULL, 'background', accounts.host) AS host,
       SUM(stmt.total) AS statements,
       SUM(stmt.total_latency) AS statement_latency,
       SUM(stmt.total_latency) / SUM(stmt.total) AS statement_avg_latency,
       SUM(stmt.full_scans) AS table_scans,
       SUM(io.ios) AS file_ios,
       SUM(io.io_latency) AS file_io_latency,
       SUM(accounts.current_connections) AS current_connections,
       SUM(accounts.total_connections) AS total_connections,
       COUNT(DISTINCT accounts.user) AS unique_users,
       SUM(mem.current_allocated) AS current_memory,
       SUM(mem.total_allocated) AS total_memory_allocated
  FROM performance_schema.accounts
  JOIN sys.x$host_summary_by_statement_latency AS stmt ON accounts.host = stmt.host
  JOIN sys.x$host_summary_by_file_io AS io ON accounts.host = io.host
  JOIN sys.x$memory_by_host_by_current_bytes mem ON accounts.host = mem.host
 GROUP BY IF(accounts.host IS NULL, 'background', accounts.host);

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: wait_classes_global_by_avg_latency
-- 
-- Lists the top wait classes by average latency, ignoring idle (this may be very large).
--
-- mysql> select * from wait_classes_global_by_avg_latency where event_class != 'idle';
-- +-------------------+--------+---------------+-------------+-------------+-------------+
-- | event_class       | total  | total_latency | min_latency | avg_latency | max_latency |
-- +-------------------+--------+---------------+-------------+-------------+-------------+
-- | wait/io/file      | 543123 | 44.60 s       | 19.44 ns    | 82.11 us    | 4.21 s      |
-- | wait/io/table     |  22002 | 766.60 ms     | 148.72 ns   | 34.84 us    | 44.97 ms    |
-- | wait/io/socket    |  79613 | 967.17 ms     | 0 ps        | 12.15 us    | 27.10 ms    |
-- | wait/lock/table   |  35409 | 18.68 ms      | 65.45 ns    | 527.51 ns   | 969.88 us   |
-- | wait/synch/rwlock |  37935 | 4.61 ms       | 21.38 ns    | 121.61 ns   | 34.65 us    |
-- | wait/synch/mutex  | 390622 | 18.60 ms      | 19.44 ns    | 47.61 ns    | 10.32 us    |
-- +-------------------+--------+---------------+-------------+-------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW wait_classes_global_by_avg_latency (
  event_class,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency
) AS
SELECT SUBSTRING_INDEX(event_name,'/', 3) AS event_class,
       SUM(COUNT_STAR) AS total,
       sys.format_time(CAST(SUM(sum_timer_wait) AS UNSIGNED)) AS total_latency,
       sys.format_time(MIN(min_timer_wait)) AS min_latency,
       sys.format_time(IFNULL(SUM(sum_timer_wait) / NULLIF(SUM(COUNT_STAR), 0), 0)) AS avg_latency,
       sys.format_time(CAST(MAX(max_timer_wait) AS UNSIGNED)) AS max_latency
  FROM performance_schema.events_waits_summary_global_by_event_name
 WHERE sum_timer_wait > 0
   AND event_name != 'idle'
 GROUP BY event_class
 ORDER BY IFNULL(SUM(sum_timer_wait) / NULLIF(SUM(COUNT_STAR), 0), 0) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$wait_classes_global_by_avg_latency
-- 
-- Lists the top wait classes by average latency, ignoring idle (this may be very large).
--
-- mysql> select * from x$wait_classes_global_by_avg_latency;
-- +-------------------+---------+-------------------+-------------+--------------------+------------------+
-- | event_class       | total   | total_latency     | min_latency | avg_latency        | max_latency      |
-- +-------------------+---------+-------------------+-------------+--------------------+------------------+
-- | idle              |    4331 | 16044682716000000 |     2000000 | 3704613880397.1369 | 1593550454000000 |
-- | wait/io/file      |   23037 |    20856702551880 |           0 |     905356711.0249 |     350700491310 |
-- | wait/io/table     |  224924 |      719670285750 |      116870 |       3199615.3623 |     208579012460 |
-- | wait/lock/table   |    6972 |        3674766030 |      109330 |        527074.8752 |          8855730 |
-- | wait/synch/rwlock |   11916 |        1273279800 |       37700 |        106854.6324 |          6838780 |
-- | wait/synch/mutex  | 1031881 |       80464286240 |       56550 |         77978.2613 |       2590408470 |
-- +-------------------+---------+-------------------+-------------+--------------------+------------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$wait_classes_global_by_avg_latency (
  event_class,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency
) AS
SELECT SUBSTRING_INDEX(event_name,'/', 3) AS event_class,
       SUM(COUNT_STAR) AS total,
       SUM(sum_timer_wait) AS total_latency,
       MIN(min_timer_wait) AS min_latency,
       IFNULL(SUM(sum_timer_wait) / NULLIF(SUM(COUNT_STAR), 0), 0) AS avg_latency,
       MAX(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_global_by_event_name
 WHERE sum_timer_wait > 0
   AND event_name != 'idle'
 GROUP BY event_class
 ORDER BY IFNULL(SUM(sum_timer_wait) / NULLIF(SUM(COUNT_STAR), 0), 0) DESC;


-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: wait_classes_global_by_latency
-- 
-- Lists the top wait classes by total latency, ignoring idle (this may be very large).
--
-- mysql> select * from wait_classes_global_by_latency;
-- +-------------------+--------+---------------+-------------+-------------+-------------+
-- | event_class       | total  | total_latency | min_latency | avg_latency | max_latency |
-- +-------------------+--------+---------------+-------------+-------------+-------------+
-- | wait/io/file      | 550470 | 46.01 s       | 19.44 ns    | 83.58 us    | 4.21 s      |
-- | wait/io/socket    | 228833 | 2.71 s        | 0 ps        | 11.86 us    | 29.93 ms    |
-- | wait/io/table     |  64063 | 1.89 s        | 99.79 ns    | 29.43 us    | 68.07 ms    |
-- | wait/lock/table   |  76029 | 47.19 ms      | 65.45 ns    | 620.74 ns   | 969.88 us   |
-- | wait/synch/mutex  | 635925 | 34.93 ms      | 19.44 ns    | 54.93 ns    | 107.70 us   |
-- | wait/synch/rwlock |  61287 | 7.62 ms       | 21.38 ns    | 124.37 ns   | 34.65 us    |
-- +-------------------+--------+---------------+-------------+-------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW wait_classes_global_by_latency (
  event_class,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency
) AS
SELECT SUBSTRING_INDEX(event_name,'/', 3) AS event_class, 
       SUM(COUNT_STAR) AS total,
       sys.format_time(SUM(sum_timer_wait)) AS total_latency,
       sys.format_time(MIN(min_timer_wait)) min_latency,
       sys.format_time(IFNULL(SUM(sum_timer_wait) / NULLIF(SUM(COUNT_STAR), 0), 0)) AS avg_latency,
       sys.format_time(MAX(max_timer_wait)) AS max_latency
  FROM performance_schema.events_waits_summary_global_by_event_name
 WHERE sum_timer_wait > 0
   AND event_name != 'idle'
 GROUP BY SUBSTRING_INDEX(event_name,'/', 3) 
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$wait_classes_global_by_latency
-- 
-- Lists the top wait classes by total latency, ignoring idle (this may be very large).
--
-- mysql> SELECT * FROM x$wait_classes_global_by_latency;
-- +-------------------+---------+----------------+-------------+----------------+--------------+
-- | event_class       | total   | total_latency  | min_latency | avg_latency    | max_latency  |
-- +-------------------+---------+----------------+-------------+----------------+--------------+
-- | wait/io/file      |   29468 | 27100905420290 |           0 | 919672370.7170 | 350700491310 |
-- | wait/io/table     |  224924 |   719670285750 |      116870 |   3199615.3623 | 208579012460 |
-- | wait/synch/mutex  | 1532036 |   118515948070 |       56550 |     77358.4616 |   2590408470 |
-- | wait/io/socket    |    1193 |    10677541030 |           0 |   8950160.1257 |    287760330 |
-- | wait/lock/table   |    6972 |     3674766030 |      109330 |    527074.8752 |      8855730 |
-- | wait/synch/rwlock |   13646 |     1579833580 |       37700 |    115772.6499 |     28293850 |
-- +-------------------+---------+----------------+-------------+----------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$wait_classes_global_by_latency (
  event_class,
  total,
  total_latency,
  min_latency,
  avg_latency,
  max_latency
) AS
SELECT SUBSTRING_INDEX(event_name,'/', 3) AS event_class, 
       SUM(COUNT_STAR) AS total,
       SUM(sum_timer_wait) AS total_latency,
       MIN(min_timer_wait) AS min_latency,
       IFNULL(SUM(sum_timer_wait) / NULLIF(SUM(COUNT_STAR), 0), 0) AS avg_latency,
       MAX(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_global_by_event_name
 WHERE sum_timer_wait > 0
   AND event_name != 'idle'
 GROUP BY SUBSTRING_INDEX(event_name,'/', 3) 
 ORDER BY SUM(sum_timer_wait) DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: waits_by_user_by_latency
--
-- Lists the top wait events per user by their total latency, ignoring idle (this may be very large).
--
-- mysql> select * from waits_by_user_by_latency;
-- +------+-----------------------------------------------------+--------+---------------+-------------+-------------+
-- | user | event                                               | total  | total_latency | avg_latency | max_latency |
-- +------+-----------------------------------------------------+--------+---------------+-------------+-------------+
-- | root | wait/io/file/sql/file_parser                        |  13743 | 00:01:00.46   | 4.40 ms     | 231.88 ms   |
-- | root | wait/io/file/innodb/innodb_data_file                |   4699 | 3.02 s        | 643.38 us   | 46.93 ms    |
-- | root | wait/io/file/sql/FRM                                |  11462 | 2.60 s        | 226.83 us   | 61.72 ms    |
-- | root | wait/io/file/myisam/dfile                           |  26776 | 746.70 ms     | 27.89 us    | 308.79 ms   |
-- | root | wait/io/file/myisam/kfile                           |   7126 | 462.66 ms     | 64.93 us    | 88.76 ms    |
-- | root | wait/io/file/sql/dbopt                              |    179 | 137.58 ms     | 768.59 us   | 15.46 ms    |
-- | root | wait/io/file/csv/metadata                           |      8 | 86.60 ms      | 10.82 ms    | 50.32 ms    |
-- | root | wait/synch/mutex/mysys/IO_CACHE::append_buffer_lock | 798080 | 66.46 ms      | 82.94 ns    | 161.03 us   |
-- | root | wait/io/file/sql/binlog                             |     19 | 49.11 ms      | 2.58 ms     | 9.40 ms     |
-- | root | wait/io/file/sql/misc                               |     26 | 22.38 ms      | 860.80 us   | 15.30 ms    |
-- | root | wait/io/file/csv/data                               |      4 | 297.46 us     | 74.37 us    | 111.93 us   |
-- | root | wait/synch/rwlock/sql/MDL_lock::rwlock              |    944 | 287.86 us     | 304.62 ns   | 874.64 ns   |
-- | root | wait/io/file/archive/data                           |      4 | 82.71 us      | 20.68 us    | 40.74 us    |
-- | root | wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock   |     60 | 12.21 us      | 203.20 ns   | 512.72 ns   |
-- | root | wait/synch/mutex/innodb/trx_mutex                   |     81 | 5.93 us       | 73.14 ns    | 252.59 ns   |
-- +------+-----------------------------------------------------+--------+---------------+-------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW waits_by_user_by_latency (
  user,
  event,
  total,
  total_latency,
  avg_latency,
  max_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       event_name AS event,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(avg_timer_wait) AS avg_latency,
       sys.format_time(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_by_user_by_event_name
 WHERE event_name != 'idle'
   AND user IS NOT NULL
   AND sum_timer_wait > 0
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$waits_by_user_by_latency
--
-- Lists the top wait events per user by their total latency, ignoring idle (this may be very large).
--
-- mysql> select * from x$waits_by_user_by_latency;
-- +------+-----------------------------------------------------+--------+----------------+-------------+--------------+
-- | user | event                                               | total  | total_latency  | avg_latency | max_latency  |
-- +------+-----------------------------------------------------+--------+----------------+-------------+--------------+
-- | root | wait/io/file/sql/file_parser                        |  13745 | 60462025415480 |  4398837508 | 231881092170 |
-- | root | wait/io/file/innodb/innodb_data_file                |   4699 |  3023248450820 |   643381037 |  46928334180 |
-- | root | wait/io/file/sql/FRM                                |  11467 |  2600067790580 |   226743257 |  61718277920 |
-- | root | wait/io/file/myisam/dfile                           |  26776 |   746701506200 |    27886690 | 308785046960 |
-- | root | wait/io/file/myisam/kfile                           |   7126 |   462661061590 |    64925432 |  88756408780 |
-- | root | wait/io/file/sql/dbopt                              |    179 |   137577467690 |   768589146 |  15457199810 |
-- | root | wait/io/file/csv/metadata                           |      8 |    86599791590 | 10824973666 |  50322529270 |
-- | root | wait/synch/mutex/mysys/IO_CACHE::append_buffer_lock | 798080 |    66461175430 |       82940 |    161028010 |
-- | root | wait/io/file/sql/binlog                             |     19 |    49110632610 |  2584770058 |   9400449760 |
-- | root | wait/io/file/sql/misc                               |     26 |    22380676630 |   860795052 |  15298475270 |
-- | root | wait/io/file/csv/data                               |      4 |      297460540 |    74365135 |    111931300 |
-- | root | wait/synch/rwlock/sql/MDL_lock::rwlock              |    944 |      287862120 |      304616 |       874640 |
-- | root | wait/io/file/archive/data                           |      4 |       82713800 |    20678450 |     40738620 |
-- | root | wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock   |     60 |       12211030 |      203203 |       512720 |
-- | root | wait/synch/mutex/innodb/trx_mutex                   |     81 |        5926440 |       73138 |       252590 |
-- +------+-----------------------------------------------------+--------+----------------+-------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$waits_by_user_by_latency (
  user,
  event,
  total,
  total_latency,
  avg_latency,
  max_latency
) AS
SELECT IF(user IS NULL, 'background', user) AS user,
       event_name AS event,
       count_star AS total,
       sum_timer_wait AS total_latency,
       avg_timer_wait AS avg_latency,
       max_timer_wait AS max_latency
  FROM performance_schema.events_waits_summary_by_user_by_event_name
 WHERE event_name != 'idle'
   AND user IS NOT NULL
   AND sum_timer_wait > 0
 ORDER BY user, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: waits_by_host_by_latency
--
-- Lists the top wait events per host by their total latency, ignoring idle (this may be very large).
--
-- mysql> select * from sys.waits_by_host_by_latency where host != 'background' limit 5;
-- +-----------+------------------------------+-------+---------------+-------------+-------------+
-- | host      | event                        | total | total_latency | avg_latency | max_latency |
-- +-----------+------------------------------+-------+---------------+-------------+-------------+
-- | localhost | wait/io/file/sql/file_parser |  1386 | 14.50 s       | 10.46 ms    | 357.36 ms   |
-- | localhost | wait/io/file/sql/FRM         |   162 | 356.08 ms     | 2.20 ms     | 75.33 ms    |
-- | localhost | wait/io/file/myisam/kfile    |   410 | 322.29 ms     | 786.08 us   | 65.98 ms    |
-- | localhost | wait/io/file/myisam/dfile    |  1327 | 307.44 ms     | 231.68 us   | 37.16 ms    |
-- | localhost | wait/io/file/sql/dbopt       |    89 | 180.34 ms     | 2.03 ms     | 63.41 ms    |
-- +-----------+------------------------------+-------+---------------+-------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW waits_by_host_by_latency (
  host,
  event,
  total,
  total_latency,
  avg_latency,
  max_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       event_name AS event,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(avg_timer_wait) AS avg_latency,
       sys.format_time(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_by_host_by_event_name
 WHERE event_name != 'idle'
   AND sum_timer_wait > 0
 ORDER BY host, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: waits_by_host_by_latency
--
-- Lists the top wait events per host by their total latency, ignoring idle (this may be very large).
--
-- mysql> select * from sys.x$waits_by_host_by_latency where host != 'background' limit 5;
-- +-----------+------------------------------+-------+----------------+-------------+--------------+
-- | host      | event                        | total | total_latency  | avg_latency | max_latency  |
-- +-----------+------------------------------+-------+----------------+-------------+--------------+
-- | localhost | wait/io/file/sql/file_parser |  1388 | 14502657551590 | 10448600240 | 357364034170 |
-- | localhost | wait/io/file/sql/FRM         |   167 |   361060236420 |  2162037319 |  75331088170 |
-- | localhost | wait/io/file/myisam/kfile    |   410 |   322294755250 |   786084585 |  65978227120 |
-- | localhost | wait/io/file/myisam/dfile    |  1327 |   307435262550 |   231676679 |  37162925800 |
-- | localhost | wait/io/file/sql/dbopt       |    89 |   180341976360 |  2026314303 |  63405386850 |
-- +-----------+------------------------------+-------+----------------+-------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$waits_by_host_by_latency (
  host,
  event,
  total,
  total_latency,
  avg_latency,
  max_latency
) AS
SELECT IF(host IS NULL, 'background', host) AS host,
       event_name AS event,
       count_star AS total,
       sum_timer_wait AS total_latency,
       avg_timer_wait AS avg_latency,
       max_timer_wait AS max_latency
  FROM performance_schema.events_waits_summary_by_host_by_event_name
 WHERE event_name != 'idle'
   AND sum_timer_wait > 0
 ORDER BY host, sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: waits_global_by_latency
--
-- Lists the top wait events by their total latency, ignoring idle (this may be very large).
--
-- mysql> select * from waits_global_by_latency limit 5;
-- +--------------------------------------+------------+---------------+-------------+-------------+
-- | event                                | total      | total_latency | avg_latency | max_latency |
-- +--------------------------------------+------------+---------------+-------------+-------------+
-- | wait/io/file/myisam/dfile            | 3623719744 | 00:47:49.09   | 791.70 ns   | 312.96 ms   |
-- | wait/io/table/sql/handler            |   69114944 | 00:44:30.74   | 38.64 us    | 879.49 ms   |
-- | wait/io/file/innodb/innodb_log_file  |   28100261 | 00:37:42.12   | 80.50 us    | 476.00 ms   |
-- | wait/io/socket/sql/client_connection |  200704863 | 00:18:37.81   | 5.57 us     | 1.27 s      |
-- | wait/io/file/innodb/innodb_data_file |    2829403 | 00:08:12.89   | 174.20 us   | 455.22 ms   |
-- +--------------------------------------+------------+---------------+-------------+-------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW waits_global_by_latency (
  events,
  total,
  total_latency,
  avg_latency,
  max_latency
) AS
SELECT event_name AS event,
       count_star AS total,
       sys.format_time(sum_timer_wait) AS total_latency,
       sys.format_time(avg_timer_wait) AS avg_latency,
       sys.format_time(max_timer_wait) AS max_latency
  FROM performance_schema.events_waits_summary_global_by_event_name
 WHERE event_name != 'idle'
   AND sum_timer_wait > 0
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$waits_global_by_latency
--
-- Lists the top wait events by their total latency, ignoring idle (this may be very large).
--
-- mysql> select * from x$waits_global_by_latency limit 5;
-- +--------------------------------------+-------+---------------+-------------+--------------+
-- | event                                | total | total_latency | avg_latency | max_latency  |
-- +--------------------------------------+-------+---------------+-------------+--------------+
-- | wait/io/file/sql/file_parser         |   679 | 3536136351540 |  5207858773 | 129860439800 |
-- | wait/io/file/innodb/innodb_data_file |   195 |  848170566100 |  4349592637 | 350700491310 |
-- | wait/io/file/sql/FRM                 |  1355 |  400428476500 |   295518990 |  44823120940 |
-- | wait/io/file/innodb/innodb_log_file  |    20 |   54298899070 |  2714944765 |  30108124800 |
-- | wait/io/file/mysys/charset           |     3 |   24244722970 |  8081574072 |  24151547420 |
-- +--------------------------------------+-------+---------------+-------------+--------------+
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$waits_global_by_latency (
  events,
  total,
  total_latency,
  avg_latency,
  max_latency
) AS
SELECT event_name AS event,
       count_star AS total,
       sum_timer_wait AS total_latency,
       avg_timer_wait AS avg_latency,
       max_timer_wait AS max_latency
  FROM performance_schema.events_waits_summary_global_by_event_name
 WHERE event_name != 'idle'
   AND sum_timer_wait > 0
 ORDER BY sum_timer_wait DESC;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
--
--   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-1301 USA 

-- IMPORTANT
-- If you update this view, also update the "5.7+ and the Performance Schema disabled"
-- query in procedures/diagnostics.sql

-- View: metrics
-- 
-- Creates a union of the following information:
--
--    *  performance_schema.global_status
--    *  information_schema.INNODB_METRICS
--    *  Performance Schema global memory usage information
--    *  Current time
--
-- This is the same as the metrics_56 view with the exception that the global status is taken from performance_schema.global_status instead of
-- from the Information Schema. Use this view if the MySQL version is 5.7.6 or later and show_compatibility_56 = OFF.
-- See also https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_show_compatibility_56
-- 
-- For view has the following columns:
-- 
--    * Variable_name: The name of the variable
--    * Variable_value: The value of the variable
--    * Type: The type of the variable. This will depend on the source, e.g. Global Status, InnoDB Metrics - ..., etc.
--    * Enabled: Whether the variable is enabled or not. Possible values are 'YES', 'NO', 'PARTIAL'.
--      PARTIAL is currently only supported for the memory usage variables and means some but not all of the memory/% instruments
--      are enabled.
--
-- mysql> SELECT * FROM metrics;
-- +-----------------------------------------------+-------------------------...+--------------------------------------+---------+
-- | Variable_name                                 | Variable_value          ...| Type                                 | Enabled |
-- +-----------------------------------------------+-------------------------...+--------------------------------------+---------+
-- | aborted_clients                               | 0                       ...| Global Status                        | YES     |
-- | aborted_connects                              | 0                       ...| Global Status                        | YES     |
-- | binlog_cache_disk_use                         | 0                       ...| Global Status                        | YES     |
-- | binlog_cache_use                              | 0                       ...| Global Status                        | YES     |
-- | binlog_stmt_cache_disk_use                    | 0                       ...| Global Status                        | YES     |
-- | binlog_stmt_cache_use                         | 0                       ...| Global Status                        | YES     |
-- | bytes_received                                | 217081                  ...| Global Status                        | YES     |
-- | bytes_sent                                    | 27257                   ...| Global Status                        | YES     |
-- ...
-- | innodb_rwlock_x_os_waits                      | 0                       ...| InnoDB Metrics - server              | YES     |
-- | innodb_rwlock_x_spin_rounds                   | 2723                    ...| InnoDB Metrics - server              | YES     |
-- | innodb_rwlock_x_spin_waits                    | 1                       ...| InnoDB Metrics - server              | YES     |
-- | trx_active_transactions                       | 0                       ...| InnoDB Metrics - transaction         | NO      |
-- ...
-- | trx_rseg_current_size                         | 0                       ...| InnoDB Metrics - transaction         | NO      |
-- | trx_rseg_history_len                          | 4                       ...| InnoDB Metrics - transaction         | YES     |
-- | trx_rw_commits                                | 0                       ...| InnoDB Metrics - transaction         | NO      |
-- | trx_undo_slots_cached                         | 0                       ...| InnoDB Metrics - transaction         | NO      |
-- | trx_undo_slots_used                           | 0                       ...| InnoDB Metrics - transaction         | NO      |
-- | memory_current_allocated                      | 138244216               ...| Performance Schema                   | PARTIAL |
-- | memory_total_allocated                        | 138244216               ...| Performance Schema                   | PARTIAL |
-- | NOW()                                         | 2015-05-31 13:27:50.382 ...| System Time                          | YES     |
-- | UNIX_TIMESTAMP()                              | 1433042870.382          ...| System Time                          | YES     |
-- +-----------------------------------------------+-------------------------...+--------------------------------------+---------+
-- 412 rows in set (0.02 sec)
DELIMITER $$
BEGIN NOT ATOMIC
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW metrics (
  Variable_name,
  Variable_value,
  Type,
  Enabled
) AS
(
SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value, 'Global Status' AS Type, 'YES' AS Enabled
  FROM performance_schema.global_status
) UNION ALL (
SELECT NAME AS Variable_name, COUNT AS Variable_value,
       CONCAT('InnoDB Metrics - ', SUBSYSTEM) AS Type,
      'YES' AS Enabled
  FROM information_schema.INNODB_METRICS
  -- Deduplication - some variables exists both in GLOBAL_STATUS and INNODB_METRICS
  -- Keep the one from GLOBAL_STATUS as it is always enabled and it's more likely to be used for existing tools.
 WHERE NAME NOT IN (
     'lock_row_lock_time', 'lock_row_lock_time_avg', 'lock_row_lock_time_max', 'lock_row_lock_waits',
     'buffer_pool_reads', 'buffer_pool_read_requests', 'buffer_pool_write_requests', 'buffer_pool_wait_free',
     'buffer_pool_read_ahead', 'buffer_pool_read_ahead_evicted', 'buffer_pool_pages_total', 'buffer_pool_pages_misc',
     'buffer_pool_pages_data', 'buffer_pool_bytes_data', 'buffer_pool_pages_dirty', 'buffer_pool_bytes_dirty',
     'buffer_pool_pages_free', 'buffer_pages_created', 'buffer_pages_written', 'buffer_pages_read',
     'buffer_data_reads', 'buffer_data_written', 'file_num_open_files',
     'os_log_bytes_written', 'os_log_fsyncs', 'os_log_pending_fsyncs', 'os_log_pending_writes',
     'log_waits', 'log_write_requests', 'log_writes', 'innodb_dblwr_writes', 'innodb_dblwr_pages_written', 'innodb_page_size')
) /*!50702
  -- memory instrumentation available in 5.7.2 and later
  UNION ALL (
SELECT 'memory_current_allocated' AS Variable_name, SUM(CURRENT_NUMBER_OF_BYTES_USED) AS Variable_value, 'Performance Schema' AS Type,
        IF((SELECT COUNT(*) FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%' AND ENABLED = 'YES') = 0, 'NO',
        IF((SELECT COUNT(*) FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%' AND ENABLED = 'YES') = (SELECT COUNT(*) FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%'), 'YES',
            'PARTIAL')) AS Enabled
  FROM performance_schema.memory_summary_global_by_event_name
) UNION ALL (
SELECT 'memory_total_allocated' AS Variable_name, SUM(SUM_NUMBER_OF_BYTES_ALLOC) AS Variable_value, 'Performance Schema' AS Type,
        IF((SELECT COUNT(*) FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%' AND ENABLED = 'YES') = 0, 'NO',
        IF((SELECT COUNT(*) FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%' AND ENABLED = 'YES') = (SELECT COUNT(*) FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%'), 'YES',
            'PARTIAL')) AS Enabled
  FROM performance_schema.memory_summary_global_by_event_name
) */
  UNION ALL (
SELECT 'NOW()' AS Variable_name, NOW(3) AS Variable_value, 'System Time' AS Type, 'YES' AS Enabled
) UNION ALL (
SELECT 'UNIX_TIMESTAMP()' AS Variable_name, ROUND(UNIX_TIMESTAMP(NOW(3)), 3) AS Variable_value, 'System Time' AS Type, 'YES' AS Enabled
)
 ORDER BY Type, Variable_name;
END$$
DELIMITER ;
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: processlist
--
-- A detailed non-blocking processlist view to replace 
-- [INFORMATION_SCHEMA. | SHOW FULL] PROCESSLIST
-- 
-- Performs less locking than the legacy sources, whilst giving extra information.
--
-- mysql> select * from sys.processlist where conn_id is not null and command != 'daemon' and conn_id != connection_id()\G
-- *************************** 1. row ***************************
--                 thd_id: 44524
--                conn_id: 44502
--                   user: msandbox@localhost
--                     db: test
--                command: Query
--                  state: alter table (flush)
--                   time: 18
--      current_statement: alter table t1 add column g int
--      statement_latency: 18.45 s
--               progress: 98.84
--           lock_latency: 265.43 ms
--          rows_examined: 0
--              rows_sent: 0
--          rows_affected: 0
--             tmp_tables: 0
--        tmp_disk_tables: 0
--              full_scan: NO
--         last_statement: NULL
-- last_statement_latency: NULL
--         current_memory: 664.06 KiB
--              last_wait: wait/io/file/innodb/innodb_data_file
--      last_wait_latency: 1.07 us
--                 source: fil0fil.cc:5146
--            trx_latency: NULL
--              trx_state: NULL
--         trx_autocommit: NULL
--                    pid: 4212
--           program_name: mysql
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER
VIEW processlist (
  thd_id,
  conn_id,
  user,
  db,
  command,
  state,
  time,
  current_statement,
  statement_latency,
  progress,
  lock_latency,
  rows_examined,
  rows_sent,
  rows_affected,
  tmp_tables,
  tmp_disk_tables,
  full_scan,
  last_statement,
  last_statement_latency,
  current_memory,
  last_wait,
  last_wait_latency,
  source,
  trx_latency,
  trx_state,
  trx_autocommit,
  pid,
  program_name
) AS
SELECT pps.thread_id AS thd_id,
       pps.processlist_id AS conn_id,
       IF(pps.name = 'thread/sql/one_connection',
          CONCAT(pps.processlist_user, '@', pps.processlist_host),
          REPLACE(pps.name, 'thread/', '')) user,
       pps.processlist_db AS db,
       pps.processlist_command AS command,
       pps.processlist_state AS state,
       pps.processlist_time AS time,
       sys.format_statement(pps.processlist_info) AS current_statement,
       IF(esc.end_event_id IS NULL,
          sys.format_time(esc.timer_wait),
          NULL) AS statement_latency,
       IF(esc.end_event_id IS NULL,
          ROUND(100 * (estc.work_completed / estc.work_estimated), 2),
          NULL) AS progress,
       sys.format_time(esc.lock_time) AS lock_latency,
       esc.rows_examined AS rows_examined,
       esc.rows_sent AS rows_sent,
       esc.rows_affected AS rows_affected,
       esc.created_tmp_tables AS tmp_tables,
       esc.created_tmp_disk_tables AS tmp_disk_tables,
       IF(esc.no_good_index_used > 0 OR esc.no_index_used > 0, 'YES', 'NO') AS full_scan,
       IF(esc.end_event_id IS NOT NULL,
          sys.format_statement(esc.sql_text),
          NULL) AS last_statement,
       IF(esc.end_event_id IS NOT NULL,
          sys.format_time(esc.timer_wait),
          NULL) AS last_statement_latency,
       sys.format_bytes(mem.current_allocated) AS current_memory,
       ewc.event_name AS last_wait,
       IF(ewc.end_event_id IS NULL AND ewc.event_name IS NOT NULL,
          'Still Waiting',
          sys.format_time(ewc.timer_wait)) last_wait_latency,
       ewc.source,
       sys.format_time(etc.timer_wait) AS trx_latency,
       etc.state AS trx_state,
       etc.autocommit AS trx_autocommit,
       conattr_pid.attr_value as pid,
       conattr_progname.attr_value as program_name
  FROM performance_schema.threads AS pps
  LEFT JOIN performance_schema.events_waits_current AS ewc USING (thread_id)
  LEFT JOIN performance_schema.events_stages_current AS estc USING (thread_id)
  LEFT JOIN performance_schema.events_statements_current AS esc USING (thread_id)
  LEFT JOIN performance_schema.events_transactions_current AS etc USING (thread_id)
  LEFT JOIN sys.x$memory_by_thread_by_current_bytes AS mem USING (thread_id)
  LEFT JOIN performance_schema.session_connect_attrs AS conattr_pid
    ON conattr_pid.processlist_id=pps.processlist_id and conattr_pid.attr_name='_pid'
  LEFT JOIN performance_schema.session_connect_attrs AS conattr_progname
    ON conattr_progname.processlist_id=pps.processlist_id and conattr_progname.attr_name='program_name'
 ORDER BY pps.processlist_time DESC, last_wait_latency DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$processlist
--
-- A detailed non-blocking processlist view to replace 
-- [INFORMATION_SCHEMA. | SHOW FULL] PROCESSLIST
-- 
-- Performs less locking than the legacy sources, whilst giving extra information.
--
-- mysql> select * from sys.x$processlist where conn_id is not null and command != 'daemon' and conn_id != connection_id()\G
-- ...
-- *************************** 2. row ***************************
--                 thd_id: 720
--                conn_id: 698
--                   user: msandbox@localhost
--                     db: test
--                command: Query
--                  state: alter table (read PK and internal sort)
--                   time: 2
--      current_statement: alter table t1 add column l int
--      statement_latency: 2349834276374
--               progress: 60.00
--           lock_latency: 339707000000
--          rows_examined: 0
--              rows_sent: 0
--          rows_affected: 0
--             tmp_tables: 0
--        tmp_disk_tables: 0
--              full_scan: NO
--         last_statement: NULL
-- last_statement_latency: NULL
--         current_memory: 10186821
--              last_wait: wait/io/file/innodb/innodb_data_file
--      last_wait_latency: Still Waiting
--                 source: fil0fil.cc:5351
--            trx_latency: NULL
--              trx_state: NULL
--         trx_autocommit: NULL
--                    pid: 5559
--           program_name: mysql
--

CREATE OR REPLACE
  ALGORITHM = TEMPTABLE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER
VIEW x$processlist (
  thd_id,
  conn_id,
  user,
  db,
  command,
  state,
  time,
  current_statement,
  statement_latency,
  progress,
  lock_latency,
  rows_examined,
  rows_sent,
  rows_affected,
  tmp_tables,
  tmp_disk_tables,
  full_scan,
  last_statement,
  last_statement_latency,
  current_memory,
  last_wait,
  last_wait_latency,
  source,
  trx_latency,
  trx_state,
  trx_autocommit,
  pid,
  program_name
) AS
SELECT pps.thread_id AS thd_id,
       pps.processlist_id AS conn_id,
       IF(pps.name = 'thread/sql/one_connection',
          CONCAT(pps.processlist_user, '@', pps.processlist_host),
          REPLACE(pps.name, 'thread/', '')) user,
       pps.processlist_db AS db,
       pps.processlist_command AS command,
       pps.processlist_state AS state,
       pps.processlist_time AS time,
       pps.processlist_info AS current_statement,
       IF(esc.end_event_id IS NULL,
          esc.timer_wait,
          NULL) AS statement_latency,
       IF(esc.end_event_id IS NULL,
          ROUND(100 * (estc.work_completed / estc.work_estimated), 2),
          NULL) AS progress,
       esc.lock_time AS lock_latency,
       esc.rows_examined AS rows_examined,
       esc.rows_sent AS rows_sent,
       esc.rows_affected AS rows_affected,
       esc.created_tmp_tables AS tmp_tables,
       esc.created_tmp_disk_tables AS tmp_disk_tables,
       IF(esc.no_good_index_used > 0 OR esc.no_index_used > 0, 'YES', 'NO') AS full_scan,
       IF(esc.end_event_id IS NOT NULL,
          esc.sql_text,
          NULL) AS last_statement,
       IF(esc.end_event_id IS NOT NULL,
          esc.timer_wait,
          NULL) AS last_statement_latency,
       mem.current_allocated AS current_memory,
       ewc.event_name AS last_wait,
       IF(ewc.end_event_id IS NULL AND ewc.event_name IS NOT NULL,
          'Still Waiting', 
          ewc.timer_wait) last_wait_latency,
       ewc.source,
       etc.timer_wait AS trx_latency,
       etc.state AS trx_state,
       etc.autocommit AS trx_autocommit,
       conattr_pid.attr_value as pid,
       conattr_progname.attr_value as program_name
  FROM performance_schema.threads AS pps
  LEFT JOIN performance_schema.events_waits_current AS ewc USING (thread_id)
  LEFT JOIN performance_schema.events_stages_current AS estc USING (thread_id)
  LEFT JOIN performance_schema.events_statements_current AS esc USING (thread_id)
  LEFT JOIN performance_schema.events_transactions_current AS etc USING (thread_id)
  LEFT JOIN sys.x$memory_by_thread_by_current_bytes AS mem USING (thread_id)
  LEFT JOIN performance_schema.session_connect_attrs AS conattr_pid
    ON conattr_pid.processlist_id=pps.processlist_id and conattr_pid.attr_name='_pid'
  LEFT JOIN performance_schema.session_connect_attrs AS conattr_progname
    ON conattr_progname.processlist_id=pps.processlist_id and conattr_progname.attr_name='program_name'
 ORDER BY pps.processlist_time DESC, last_wait_latency DESC;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: session
--
-- Filter sys.processlist to only show user sessions and not background threads.
-- This is a non-blocking closer replacement to
-- [INFORMATION_SCHEMA. | SHOW FULL] PROCESSLIST
-- 
-- Performs less locking than the legacy sources, whilst giving extra information.
--
-- mysql> select * from sys.session\G
-- *************************** 1. row ***************************
--                 thd_id: 24
--                conn_id: 2
--                   user: root@localhost
--                     db: sys
--                command: Query
--                  state: Sending data
--                   time: 0
--      current_statement: select * from sys.session
--      statement_latency: 137.22 ms
--               progress: NULL
--           lock_latency: 33.75 ms
--          rows_examined: 0
--              rows_sent: 0
--          rows_affected: 0
--             tmp_tables: 4
--        tmp_disk_tables: 1
--              full_scan: YES
--         last_statement: NULL
-- last_statement_latency: NULL
--         current_memory: 3.26 MiB
--              last_wait: wait/synch/mutex/innodb/file_format_max_mutex
--      last_wait_latency: 64.09 ns
--                 source: trx0sys.cc:778
--            trx_latency: 7.88 s
--              trx_state: ACTIVE
--         trx_autocommit: NO
--                    pid: 4212
--           program_name: mysql
--

CREATE OR REPLACE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW session
 AS
SELECT * FROM sys.processlist
WHERE conn_id IS NOT NULL AND command != 'Daemon';


-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

--
-- View: x$session
--
-- Filter sys.processlist to only show user sessions and not background threads.
-- This is a non-blocking closer replacement to
-- [INFORMATION_SCHEMA. | SHOW FULL] PROCESSLIST
-- 
-- Performs less locking than the legacy sources, whilst giving extra information.
--
-- mysql> select * from sys.x$session\G
-- *************************** 1. row ***************************
--                 thd_id: 24
--                conn_id: 2
--                   user: root@localhost
--                     db: sys
--                command: Query
--                  state: Sending data
--                   time: 0
--      current_statement: select * from sys.x$session
--      statement_latency: 16285980000
--               progress: NULL
--           lock_latency: 15450000000
--          rows_examined: 0
--              rows_sent: 0
--          rows_affected: 0
--             tmp_tables: 4
--        tmp_disk_tables: 1
--              full_scan: YES
--         last_statement: NULL
-- last_statement_latency: NULL
--         current_memory: 3383772
--              last_wait: wait/synch/mutex/innodb/trx_mutex
--      last_wait_latency: 56550
--                 source: trx0trx.h:1520
--            trx_latency: 17893350207000
--              trx_state: ACTIVE
--         trx_autocommit: NO
--                    pid: 5559
--           program_name: mysql
--

CREATE OR REPLACE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER 
VIEW x$session
 AS
SELECT * FROM sys.x$processlist
WHERE conn_id IS NOT NULL AND command != 'Daemon';

--
-- View: session_ssl_status
--
-- Shows SSL version, cipher and the count of re-used SSL sessions per connection
--
-- mysql> select * from session_ssl_status;
-- +-----------+-------------+--------------------+---------------------+
-- | thread_id | ssl_version | ssl_cipher         | ssl_sessions_reused |
-- +-----------+-------------+--------------------+---------------------+
-- |        26 | TLSv1       | DHE-RSA-AES256-SHA | 0                   |
-- |        27 | TLSv1       | DHE-RSA-AES256-SHA | 0                   |
-- |        28 | TLSv1       | DHE-RSA-AES256-SHA | 0                   |
-- +-----------+-------------+--------------------+---------------------+
-- 3 rows in set (0.00 sec)
--

CREATE OR REPLACE
  ALGORITHM = MERGE
  DEFINER = 'mariadb.sys'@'localhost'
  SQL SECURITY INVOKER
VIEW session_ssl_status (
  thread_id,
  ssl_version,
  ssl_cipher,
  ssl_sessions_reused
) AS
SELECT sslver.thread_id, 
       sslver.variable_value ssl_version, 
       sslcip.variable_value ssl_cipher,
       sslreuse.variable_value ssl_sessions_reused
  FROM performance_schema.status_by_thread sslver 
  LEFT JOIN performance_schema.status_by_thread sslcip 
    ON (sslcip.thread_id=sslver.thread_id and sslcip.variable_name='Ssl_cipher')
  LEFT JOIN performance_schema.status_by_thread sslreuse 
    ON (sslreuse.thread_id=sslver.thread_id and sslreuse.variable_name='Ssl_sessions_reused') 
 WHERE sslver.variable_name='Ssl_version';

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS create_synonym_db;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE create_synonym_db (
        IN in_db_name VARCHAR(64), 
        IN in_synonym VARCHAR(64)
    )
    COMMENT '
             Description
             -----------

             Takes a source database name and synonym name, and then creates the 
             synonym database with views that point to all of the tables within
             the source database.

             Useful for creating a "ps" synonym for "performance_schema",
             or "is" instead of "information_schema", for example.

             Parameters
             -----------

             in_db_name (VARCHAR(64)):
               The database name that you would like to create a synonym for.
             in_synonym (VARCHAR(64)):
               The database synonym name.

             Example
             -----------

             mysql> SHOW DATABASES;
             +--------------------+
             | Database           |
             +--------------------+
             | information_schema |
             | mysql              |
             | performance_schema |
             | sys                |
             | test               |
             +--------------------+
             5 rows in set (0.00 sec)

             mysql> CALL sys.create_synonym_db(\'performance_schema\', \'ps\');
             +---------------------------------------+
             | summary                               |
             +---------------------------------------+
             | Created 74 views in the `ps` database |
             +---------------------------------------+
             1 row in set (8.57 sec)

             Query OK, 0 rows affected (8.57 sec)

             mysql> SHOW DATABASES;
             +--------------------+
             | Database           |
             +--------------------+
             | information_schema |
             | mysql              |
             | performance_schema |
             | ps                 |
             | sys                |
             | test               |
             +--------------------+
             6 rows in set (0.00 sec)

             mysql> SHOW FULL TABLES FROM ps;
             +------------------------------------------------------+------------+
             | Tables_in_ps                                         | Table_type |
             +------------------------------------------------------+------------+
             | accounts                                             | VIEW       |
             | cond_instances                                       | VIEW       |
             | events_stages_current                                | VIEW       |
             | events_stages_history                                | VIEW       |
             ...
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    DECLARE v_done bool DEFAULT FALSE;
    DECLARE v_db_name_check VARCHAR(64);
    DECLARE v_db_err_msg TEXT;
    DECLARE v_table VARCHAR(64);
    DECLARE v_views_created INT DEFAULT 0;
    DECLARE v_table_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY') DEFAULT '';
    DECLARE v_temp_table TEXT;

    DECLARE c_table_names CURSOR FOR 
        SELECT TABLE_NAME 
          FROM INFORMATION_SCHEMA.TABLES 
         WHERE TABLE_SCHEMA = in_db_name;

    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

    -- Check if the source database exists
    SELECT SCHEMA_NAME INTO v_db_name_check
      FROM INFORMATION_SCHEMA.SCHEMATA
     WHERE SCHEMA_NAME = in_db_name;

    IF v_db_name_check IS NULL THEN
        SET v_db_err_msg = CONCAT('Unknown database ', in_db_name);
        SIGNAL SQLSTATE 'HY000'
            SET MESSAGE_TEXT = v_db_err_msg;
    END IF;

    -- Check if a database of the synonym name already exists
    SELECT SCHEMA_NAME INTO v_db_name_check
      FROM INFORMATION_SCHEMA.SCHEMATA
     WHERE SCHEMA_NAME = in_synonym;

    IF v_db_name_check = in_synonym THEN
        SET v_db_err_msg = CONCAT('Can\'t create database ', in_synonym, '; database exists');
        SIGNAL SQLSTATE 'HY000'
            SET MESSAGE_TEXT = v_db_err_msg;
    END IF;

    -- All good, create the database and views
    SET @create_db_stmt := CONCAT('CREATE DATABASE ', sys.quote_identifier(in_synonym));
    PREPARE create_db_stmt FROM @create_db_stmt;
    EXECUTE create_db_stmt;
    DEALLOCATE PREPARE create_db_stmt;

    SET v_done = FALSE;
    OPEN c_table_names;
    c_table_names: LOOP
        FETCH c_table_names INTO v_table;
        IF v_done THEN
            LEAVE c_table_names;
        END IF;

    -- Check does temporary table shadows the base table. If it is so, terminate.
        CALL sys.table_exists(in_db_name, v_table, v_table_exists);
        IF (v_table_exists = 'TEMPORARY') THEN
            SET v_temp_table =
            CONCAT(
                'Table',
                 sys.quote_identifier(in_db_name),
                 '.',
                 sys.quote_identifier(v_table),
                 'shadows base table. View cannot be created! Terminating!');
             SIGNAL SQLSTATE 'HY000'
                 SET MESSAGE_TEXT = v_temp_table;
             LEAVE c_table_names;
        END IF;

        SET @create_view_stmt = CONCAT(
            'CREATE SQL SECURITY INVOKER VIEW ',
            sys.quote_identifier(in_synonym),
            '.',
            sys.quote_identifier(v_table),
            ' AS SELECT * FROM ',
            sys.quote_identifier(in_db_name),
            '.',
            sys.quote_identifier(v_table)
        );
        PREPARE create_view_stmt FROM @create_view_stmt;
        EXECUTE create_view_stmt;
        DEALLOCATE PREPARE create_view_stmt;

        SET v_views_created = v_views_created + 1;
    END LOOP;
    CLOSE c_table_names;

    SELECT CONCAT(
        'Created ', v_views_created, ' view',
        IF(v_views_created != 1, 's', ''), ' in the ',
        sys.quote_identifier(in_synonym), ' database'
    ) AS summary;

END$$

DELIMITER ;

--  Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-- 
--  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-1301 USA 

DROP PROCEDURE IF EXISTS execute_prepared_stmt;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE execute_prepared_stmt (
        IN in_query longtext CHARACTER SET UTF8
    )
    COMMENT '
             Description
             -----------

             Takes the query in the argument and executes it using a prepared statement. The prepared statement is deallocated,
             so the procedure is mainly useful for executing one off dynamically created queries.

             The sys_execute_prepared_stmt prepared statement name is used for the query and is required not to exist.


             Parameters
             -----------

             in_query (longtext CHARACTER SET UTF8):
               The query to execute.


             Configuration Options
             ----------------------

             sys.debug
               Whether to provide debugging output.
               Default is ''OFF''. Set to ''ON'' to include.


             Example
             --------

             mysql> CALL sys.execute_prepared_stmt(''SELECT * FROM sys.sys_config'');
             +------------------------+-------+---------------------+--------+
             | variable               | value | set_time            | set_by |
             +------------------------+-------+---------------------+--------+
             | statement_truncate_len | 64    | 2015-06-30 13:06:00 | NULL   |
             +------------------------+-------+---------------------+--------+
             1 row in set (0.00 sec)

             Query OK, 0 rows affected (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    -- Set configuration options
    IF (@sys.debug IS NULL) THEN
        SET @sys.debug = sys.sys_get_config('debug', 'OFF');
    END IF;

    -- Verify the query exists
    -- The shortest possible query is "DO 1"
    IF (in_query IS NULL OR LENGTH(in_query) < 4) THEN
       SIGNAL SQLSTATE '45000'
          SET MESSAGE_TEXT = "The @sys.execute_prepared_stmt.sql must contain a query";
    END IF;

    SET @sys.execute_prepared_stmt.sql = in_query;

    IF (@sys.debug = 'ON') THEN
        SELECT @sys.execute_prepared_stmt.sql AS 'Debug';
    END IF;
    PREPARE sys_execute_prepared_stmt FROM @sys.execute_prepared_stmt.sql;
    EXECUTE sys_execute_prepared_stmt;
    DEALLOCATE PREPARE sys_execute_prepared_stmt;

    SET @sys.execute_prepared_stmt.sql = NULL;
END$$

DELIMITER ;

--  Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-- 
--  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-1301 USA 

DROP PROCEDURE IF EXISTS diagnostics;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE diagnostics (
        IN in_max_runtime int unsigned, IN in_interval int unsigned,
        IN in_auto_config enum ('current', 'medium', 'full')
    )
    COMMENT '
             Description
             -----------

             Create a report of the current status of the server for diagnostics purposes. Data collected includes (some items depends on versions and settings):

                * The GLOBAL VARIABLES
                * Several sys schema views including metrics or equivalent (depending on version and settings)
                * Queries in the 95th percentile
                * Several ndbinfo views for MySQL Cluster
                * Replication (both master and slave) information.

             Some of the sys schema views are calculated as initial (optional), overall, delta:

                * The initial view is the content of the view at the start of this procedure.
                  This output will be the same as the the start values used for the delta view.
                  The initial view is included if @sys.diagnostics.include_raw = ''ON''.
                * The overall view is the content of the view at the end of this procedure.
                  This output is the same as the end values used for the delta view.
                  The overall view is always included.
                * The delta view is the difference from the beginning to the end. Note that for min and max values
                  they are simply the min or max value from the end view respectively, so does not necessarily reflect
                  the minimum/maximum value in the monitored period.
                  Note: except for the metrics views the delta is only calculation between the first and last outputs.
             
             Requires the SUPER privilege for "SET sql_log_bin = 0;".

             Versions supported:
                * MySQL 5.6: 5.6.10 and later
                * MySQL 5.7: 5.7.9 and later

             Parameters
             -----------

             in_max_runtime (INT UNSIGNED):
               The maximum time to keep collecting data.
               Use NULL to get the default which is 60 seconds, otherwise enter a value greater than 0.
             in_interval (INT UNSIGNED):
               How long to sleep between data collections.
               Use NULL to get the default which is 30 seconds, otherwise enter a value greater than 0.
             in_auto_config (ENUM(''current'', ''medium'', ''full''))
               Automatically enable Performance Schema instruments and consumers.
               NOTE: The more that are enabled, the more impact on the performance.
               Supported values are:
                  * current - use the current settings.
                  * medium - enable some settings.
                  * full - enables all settings. This will have a big impact on the
                           performance - be careful using this option.
               If another setting the ''current'' is chosen, the current settings
               are restored at the end of the procedure.


             Configuration Options
             ----------------------

             sys.diagnostics.allow_i_s_tables
               Specifies whether it is allowed to do table scan queries on information_schema.TABLES. This can be expensive if there
               are many tables. Set to ''ON'' to allow, ''OFF'' to not allow.
               Default is ''OFF''.

             sys.diagnostics.include_raw
               Set to ''ON'' to include the raw data (e.g. the original output of "SELECT * FROM sys.metrics").
               Use this to get the initial values of the various views.
               Default is ''OFF''.

             sys.statement_truncate_len
               How much of queries in the process list output to include.
               Default is 64.

             sys.debug
               Whether to provide debugging output.
               Default is ''OFF''. Set to ''ON'' to include.


             Example
             --------

             To create a report and append it to the file diag.out:

             mysql> TEE diag.out;
             mysql> CALL sys.diagnostics(120, 30, ''current'');
             ...
             mysql> NOTEE;
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    DECLARE v_start, v_runtime, v_iter_start, v_sleep DECIMAL(20,2) DEFAULT 0.0;
    DECLARE v_has_innodb, v_has_ndb, v_has_ps, v_has_replication, v_has_ps_replication VARCHAR(8) CHARSET utf8 DEFAULT 'NO';
    DECLARE v_this_thread_enabled, v_has_ps_vars, v_has_metrics ENUM('YES', 'NO');
    DECLARE v_table_name, v_banner VARCHAR(64) CHARSET utf8;
    DECLARE v_sql_status_summary_select, v_sql_status_summary_delta, v_sql_status_summary_from, v_no_delta_names TEXT;
    DECLARE v_output_time, v_output_time_prev DECIMAL(20,3) UNSIGNED;
    DECLARE v_output_count, v_count, v_old_group_concat_max_len INT UNSIGNED DEFAULT 0;
    -- The width of each of the status outputs in the summery
    DECLARE v_status_summary_width TINYINT UNSIGNED DEFAULT 50;
    DECLARE v_done BOOLEAN DEFAULT FALSE;
    -- Do not include the following ndbinfo views:
    --    'blocks'                    Static
    --    'config_params'             Static
    --    'dict_obj_types'            Static
    --    'disk_write_speed_base'     Can generate lots of output - only include aggregate views here
    --    'memory_per_fragment'       Can generate lots of output
    --    'memoryusage'               Handled separately
    --    'operations_per_fragment'   Can generate lots of output
    --    'threadblocks'              Only needed once
    DECLARE c_ndbinfo CURSOR FOR
        SELECT TABLE_NAME
          FROM information_schema.TABLES
         WHERE TABLE_SCHEMA = 'ndbinfo'
               AND TABLE_NAME NOT IN (
                  'blocks',
                  'config_params',
                  'dict_obj_types',
                  'disk_write_speed_base',
                  'memory_per_fragment',
                  'memoryusage',
                  'operations_per_fragment',
                  'threadblocks'
               );
    DECLARE c_sysviews_w_delta CURSOR FOR
        SELECT table_name
          FROM tmp_sys_views_delta
         ORDER BY table_name; 
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

    -- Do not track the current thread - no reason to clutter the output
    SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();
    IF (v_this_thread_enabled = 'YES') THEN
        CALL sys.ps_setup_disable_thread(CONNECTION_ID());
    END IF;

    -- Check options are sane
    IF (in_max_runtime < in_interval) THEN
        SIGNAL SQLSTATE '45000'
           SET MESSAGE_TEXT = 'in_max_runtime must be greater than or equal to in_interval';
    END IF;
    IF (in_max_runtime = 0) THEN
        SIGNAL SQLSTATE '45000'
           SET MESSAGE_TEXT = 'in_max_runtime must be greater than 0';
    END IF;
    IF (in_interval = 0) THEN
        SIGNAL SQLSTATE '45000'
           SET MESSAGE_TEXT = 'in_interval must be greater than 0';
    END IF;

    -- Set configuration options
    IF (@sys.diagnostics.allow_i_s_tables IS NULL) THEN
        SET @sys.diagnostics.allow_i_s_tables = sys.sys_get_config('diagnostics.allow_i_s_tables', 'OFF');
    END IF;
    IF (@sys.diagnostics.include_raw IS NULL) THEN
        SET @sys.diagnostics.include_raw      = sys.sys_get_config('diagnostics.include_raw'     , 'OFF');
    END IF;
    IF (@sys.debug IS NULL) THEN
        SET @sys.debug                        = sys.sys_get_config('debug'                       , 'OFF');
    END IF;
    IF (@sys.statement_truncate_len IS NULL) THEN
        SET @sys.statement_truncate_len       = sys.sys_get_config('statement_truncate_len'      , '64' );
    END IF;

    -- Temporary table are used - disable sql_log_bin if necessary to prevent them replicating
    SET @log_bin := @@sql_log_bin;
    IF (@log_bin = 1) THEN
        SET sql_log_bin = 0;
    END IF;

    -- Some metrics variables doesn't make sense in delta and rate calculations even if they are numeric
    -- as they really are more like settings or "current" status.
    SET v_no_delta_names = CONCAT('s%{COUNT}.Variable_name NOT IN (',
        '''innodb_buffer_pool_pages_total'', ',
        '''innodb_page_size'', ',
        '''last_query_cost'', ',
        '''last_query_partial_plans'', ',
        '''qcache_total_blocks'', ',
        '''slave_last_heartbeat'', ',
        '''ssl_ctx_verify_depth'', ',
        '''ssl_ctx_verify_mode'', ',
        '''ssl_session_cache_size'', ',
        '''ssl_verify_depth'', ',
        '''ssl_verify_mode'', ',
        '''ssl_version'', ',
        '''buffer_flush_lsn_avg_rate'', ',
        '''buffer_flush_pct_for_dirty'', ',
        '''buffer_flush_pct_for_lsn'', ',
        '''buffer_pool_pages_total'', ',
        '''lock_row_lock_time_avg'', ',
        '''lock_row_lock_time_max'', ',
        '''innodb_page_size''',
    ')');

    IF (in_auto_config <> 'current') THEN
        IF (@sys.debug = 'ON') THEN
            SELECT CONCAT('Updating Performance Schema configuration to ', in_auto_config) AS 'Debug';
        END IF;
        CALL sys.ps_setup_save(0);

        IF (in_auto_config = 'medium') THEN
            -- Enable all consumers except %history and %history_long
            UPDATE performance_schema.setup_consumers
                SET ENABLED = 'YES'
            WHERE NAME NOT LIKE '%\_history%';

            -- Enable all instruments except wait/synch/%
            UPDATE performance_schema.setup_instruments
                SET ENABLED = 'YES',
                    TIMED   = 'YES'
            WHERE NAME NOT LIKE 'wait/synch/%';
        ELSEIF (in_auto_config = 'full') THEN
            UPDATE performance_schema.setup_consumers
                SET ENABLED = 'YES';

            UPDATE performance_schema.setup_instruments
                SET ENABLED = 'YES',
                    TIMED   = 'YES';
        END IF;

        -- Enable all threads except this one
        UPDATE performance_schema.threads
           SET INSTRUMENTED = 'YES'
         WHERE PROCESSLIST_ID <> CONNECTION_ID();
    END IF;

    SET v_start        = UNIX_TIMESTAMP(NOW(2)),
        in_interval    = IFNULL(in_interval, 30),
        in_max_runtime = IFNULL(in_max_runtime, 60);

    -- Get a quick ref with hostname, server UUID, and the time for the report.
    SET v_banner = REPEAT(
                      '-',
                      LEAST(
                         GREATEST(
                            36,
                            CHAR_LENGTH(VERSION()),
                            CHAR_LENGTH(@@global.version_comment),
                            CHAR_LENGTH(@@global.version_compile_os),
                            CHAR_LENGTH(@@global.version_compile_machine),
                            CHAR_LENGTH(@@global.socket),
                            CHAR_LENGTH(@@global.datadir)
                         ),
                         64
                      )
                   );
    SELECT 'Hostname' AS 'Name', @@global.hostname AS 'Value'
    UNION ALL
    SELECT 'Port' AS 'Name', @@global.port AS 'Value'
    UNION ALL
    SELECT 'Socket' AS 'Name', @@global.socket AS 'Value'
    UNION ALL
    SELECT 'Datadir' AS 'Name', @@global.datadir AS 'Value'
    UNION ALL
    SELECT REPEAT('-', 23) AS 'Name', v_banner AS 'Value'
    UNION ALL
    SELECT 'MySQL Version' AS 'Name', VERSION() AS 'Value'
    UNION ALL
    SELECT 'Sys Schema Version' AS 'Name', (SELECT sys_version FROM sys.version) AS 'Value'
    UNION ALL
    SELECT 'Version Comment' AS 'Name', @@global.version_comment AS 'Value'
    UNION ALL
    SELECT 'Version Compile OS' AS 'Name', @@global.version_compile_os AS 'Value'
    UNION ALL
    SELECT 'Version Compile Machine' AS 'Name', @@global.version_compile_machine AS 'Value'
    UNION ALL
    SELECT REPEAT('-', 23) AS 'Name', v_banner AS 'Value'
    UNION ALL
    SELECT 'UTC Time' AS 'Name', UTC_TIMESTAMP() AS 'Value'
    UNION ALL
    SELECT 'Local Time' AS 'Name', NOW() AS 'Value'
    UNION ALL
    SELECT 'Time Zone' AS 'Name', @@global.time_zone AS 'Value'
    UNION ALL
    SELECT 'System Time Zone' AS 'Name', @@global.system_time_zone AS 'Value'
    UNION ALL
    SELECT 'Time Zone Offset' AS 'Name', TIMEDIFF(NOW(), UTC_TIMESTAMP()) AS 'Value';

    -- Are the InnoDB, NDBCluster, and Performance Schema storage engines present?
    SET v_has_innodb         = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'InnoDB'), 'NO'),
        v_has_ndb            = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'NDBCluster'), 'NO'),
        v_has_ps             = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'PERFORMANCE_SCHEMA'), 'NO'),
        v_has_ps_replication = IF(v_has_ps = 'YES'
                                   AND EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'replication_applier_status'),
                                   'YES',
                                   'NO'
                               ),
        v_has_replication    = 'MAYBE',
        v_has_metrics        = IF(v_has_ps = 'YES' OR (sys.version_major() = 5 AND sys.version_minor() = 6), 'YES', 'NO'),
        v_has_ps_vars        = 'NO';

    -- 5.7.7 introduced the possibility to get SHOW [GLOBAL|SESSION] VARIABLES and SHOW [GLOBAL|SESSION] STATUS
    -- from the Performance Schema. But it's optional whether it's enabled.
    -- 5.7.9 changes so the Performance Schema tables always work.
    -- Note that @@global.show_compatibility_56 = OFF will only actually work if the Performance Schema is enabled in <=5.7.8,
    -- however except overriding the global value there is nothing that can be done about it.
    -- v_has_ps_vars defaults to NO
    /*!50707 SET v_has_ps_vars = IF(@@global.show_compatibility_56, 'NO', 'YES');*/
    /*!50709 SET v_has_ps_vars = 'YES';*/

    IF (@sys.debug = 'ON') THEN
       SELECT v_has_innodb AS 'Has_InnoDB', v_has_ndb AS 'Has_NDBCluster',
              v_has_ps AS 'Has_Performance_Schema', v_has_ps_vars AS 'Has_P_S_SHOW_Variables',
              v_has_metrics AS 'Has_metrics',
              v_has_ps_replication 'AS Has_P_S_Replication', v_has_replication AS 'Has_Replication';
    END IF;

    IF (v_has_innodb IN ('DEFAULT', 'YES')) THEN
        -- Need to use prepared statement as just having the query as a plain command
        -- will generate an error if the InnoDB storage engine is not present
        SET @sys.diagnostics.sql = 'SHOW ENGINE InnoDB STATUS';
        PREPARE stmt_innodb_status FROM @sys.diagnostics.sql;
    END IF;

    IF (v_has_ps = 'YES') THEN
        -- Need to use prepared statement as just having the query as a plain command
        -- will generate an error if the InnoDB storage engine is not present
        SET @sys.diagnostics.sql = 'SHOW ENGINE PERFORMANCE_SCHEMA STATUS';
        PREPARE stmt_ps_status FROM @sys.diagnostics.sql;
    END IF;

    IF (v_has_ndb IN ('DEFAULT', 'YES')) THEN
        -- Need to use prepared statement as just having the query as a plain command
        -- will generate an error if the NDBCluster storage engine is not present
        SET @sys.diagnostics.sql = 'SHOW ENGINE NDBCLUSTER STATUS';
        PREPARE stmt_ndbcluster_status FROM @sys.diagnostics.sql;
    END IF;

    SET @sys.diagnostics.sql_gen_query_template = 'SELECT CONCAT(
           ''SELECT '',
           GROUP_CONCAT(
               CASE WHEN (SUBSTRING(TABLE_NAME, 3), COLUMN_NAME) IN (
                                (''io_global_by_file_by_bytes'', ''total''),
                                (''io_global_by_wait_by_bytes'', ''total_requested'')
                         )
                         THEN CONCAT(''sys.format_bytes('', COLUMN_NAME, '') AS '', COLUMN_NAME)
                    WHEN SUBSTRING(COLUMN_NAME, -8) = ''_latency''
                         THEN CONCAT(''sys.format_time('', COLUMN_NAME, '') AS '', COLUMN_NAME)
                    WHEN SUBSTRING(COLUMN_NAME, -7) = ''_memory'' OR SUBSTRING(COLUMN_NAME, -17) = ''_memory_allocated''
                         OR ((SUBSTRING(COLUMN_NAME, -5) = ''_read'' OR SUBSTRING(COLUMN_NAME, -8) = ''_written'' OR SUBSTRING(COLUMN_NAME, -6) = ''_write'') AND SUBSTRING(COLUMN_NAME, 1, 6) <> ''COUNT_'')
                         THEN CONCAT(''sys.format_bytes('', COLUMN_NAME, '') AS '', COLUMN_NAME)
                    ELSE COLUMN_NAME
               END
               ORDER BY ORDINAL_POSITION
               SEPARATOR '',\n       ''
           ),
           ''\n  FROM tmp_'', SUBSTRING(TABLE_NAME FROM 3), ''_%{OUTPUT}''
       ) AS Query INTO @sys.diagnostics.sql_select
  FROM information_schema.COLUMNS
 WHERE TABLE_SCHEMA = ''sys'' AND TABLE_NAME = ?
 GROUP BY TABLE_NAME';

    SET @sys.diagnostics.sql_gen_query_delta = 'SELECT CONCAT(
           ''SELECT '',
           GROUP_CONCAT(
               CASE WHEN FIND_IN_SET(COLUMN_NAME, diag.pk)
                         THEN COLUMN_NAME
                    WHEN diag.TABLE_NAME = ''io_global_by_file_by_bytes'' AND COLUMN_NAME = ''write_pct''
                         THEN CONCAT(''IFNULL(ROUND(100-(((e.total_read-IFNULL(s.total_read, 0))'',
                                     ''/NULLIF(((e.total_read-IFNULL(s.total_read, 0))+(e.total_written-IFNULL(s.total_written, 0))), 0))*100), 2), 0.00) AS '',
                                     COLUMN_NAME)
                    WHEN (diag.TABLE_NAME, COLUMN_NAME) IN (
                                (''io_global_by_file_by_bytes'', ''total''),
                                (''io_global_by_wait_by_bytes'', ''total_requested'')
                         )
                         THEN CONCAT(''sys.format_bytes(e.'', COLUMN_NAME, ''-IFNULL(s.'', COLUMN_NAME, '', 0)) AS '', COLUMN_NAME)
                    WHEN SUBSTRING(COLUMN_NAME, 1, 4) IN (''max_'', ''min_'') AND SUBSTRING(COLUMN_NAME, -8) = ''_latency''
                         THEN CONCAT(''sys.format_time(e.'', COLUMN_NAME, '') AS '', COLUMN_NAME)
                    WHEN COLUMN_NAME = ''avg_latency''
                         THEN CONCAT(''sys.format_time((e.total_latency - IFNULL(s.total_latency, 0))'',
                                     ''/NULLIF(e.total - IFNULL(s.total, 0), 0)) AS '', COLUMN_NAME)
                    WHEN SUBSTRING(COLUMN_NAME, -12) = ''_avg_latency''
                         THEN CONCAT(''sys.format_time((e.'', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), ''_latency - IFNULL(s.'', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), ''_latency, 0))'',
                                     ''/NULLIF(e.'', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), ''s - IFNULL(s.'', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), ''s, 0), 0)) AS '', COLUMN_NAME)
                    WHEN SUBSTRING(COLUMN_NAME, -8) = ''_latency''
                         THEN CONCAT(''sys.format_time(e.'', COLUMN_NAME, '' - IFNULL(s.'', COLUMN_NAME, '', 0)) AS '', COLUMN_NAME)
                    WHEN COLUMN_NAME IN (''avg_read'', ''avg_write'', ''avg_written'')
                         THEN CONCAT(''sys.format_bytes(IFNULL((e.total_'', IF(COLUMN_NAME = ''avg_read'', ''read'', ''written''), ''-IFNULL(s.total_'', IF(COLUMN_NAME = ''avg_read'', ''read'', ''written''), '', 0))'',
                                     ''/NULLIF(e.count_'', IF(COLUMN_NAME = ''avg_read'', ''read'', ''write''), ''-IFNULL(s.count_'', IF(COLUMN_NAME = ''avg_read'', ''read'', ''write''), '', 0), 0), 0)) AS '',
                                     COLUMN_NAME)
                    WHEN SUBSTRING(COLUMN_NAME, -7) = ''_memory'' OR SUBSTRING(COLUMN_NAME, -17) = ''_memory_allocated''
                         OR ((SUBSTRING(COLUMN_NAME, -5) = ''_read'' OR SUBSTRING(COLUMN_NAME, -8) = ''_written'' OR SUBSTRING(COLUMN_NAME, -6) = ''_write'') AND SUBSTRING(COLUMN_NAME, 1, 6) <> ''COUNT_'')
                         THEN CONCAT(''sys.format_bytes(e.'', COLUMN_NAME, '' - IFNULL(s.'', COLUMN_NAME, '', 0)) AS '', COLUMN_NAME)
                    ELSE CONCAT(''(e.'', COLUMN_NAME, '' - IFNULL(s.'', COLUMN_NAME, '', 0)) AS '', COLUMN_NAME)
               END
               ORDER BY ORDINAL_POSITION
               SEPARATOR '',\n       ''
           ),
           ''\n  FROM tmp_'', diag.TABLE_NAME, ''_end e
       LEFT OUTER JOIN tmp_'', diag.TABLE_NAME, ''_start s USING ('', diag.pk, '')''
       ) AS Query INTO @sys.diagnostics.sql_select
  FROM tmp_sys_views_delta diag
       INNER JOIN information_schema.COLUMNS c ON c.TABLE_NAME = CONCAT(''x$'', diag.TABLE_NAME)
 WHERE c.TABLE_SCHEMA = ''sys'' AND diag.TABLE_NAME = ?
 GROUP BY diag.TABLE_NAME';

    IF (v_has_ps = 'YES') THEN
        -- Create temporary table with the ORDER BY clauses. Will be required both for the initial (if included) and end queries
        DROP TEMPORARY TABLE IF EXISTS tmp_sys_views_delta;
        CREATE TEMPORARY TABLE tmp_sys_views_delta (
            TABLE_NAME varchar(64) NOT NULL,
            order_by text COMMENT 'ORDER BY clause for the initial and overall views',
            order_by_delta text COMMENT 'ORDER BY clause for the delta views',
            where_delta text COMMENT 'WHERE clause to use for delta views to only include rows with a "count" > 0',
            limit_rows int unsigned COMMENT 'The maximum number of rows to include for the view',
            pk varchar(128) COMMENT 'Used with the FIND_IN_SET() function so use comma separated list without whitespace',
            PRIMARY KEY (TABLE_NAME)
        );

        -- %{OUTPUT} will be replace by the suffix used for the output.
        IF (@sys.debug = 'ON') THEN
            SELECT 'Populating tmp_sys_views_delta' AS 'Debug';
        END IF;
        INSERT INTO tmp_sys_views_delta
        VALUES ('host_summary'                       , '%{TABLE}.statement_latency DESC',
                                                       '(e.statement_latency-IFNULL(s.statement_latency, 0)) DESC',
                                                       '(e.statements - IFNULL(s.statements, 0)) > 0', NULL, 'host'),
               ('host_summary_by_file_io'            , '%{TABLE}.io_latency DESC',
                                                       '(e.io_latency-IFNULL(s.io_latency, 0)) DESC',
                                                       '(e.ios - IFNULL(s.ios, 0)) > 0', NULL, 'host'),
               ('host_summary_by_file_io_type'       , '%{TABLE}.host, %{TABLE}.total_latency DESC',
                                                       'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'host,event_name'),
               ('host_summary_by_stages'             , '%{TABLE}.host, %{TABLE}.total_latency DESC',
                                                       'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'host,event_name'),
               ('host_summary_by_statement_latency'  , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'host'),
               ('host_summary_by_statement_type'     , '%{TABLE}.host, %{TABLE}.total_latency DESC',
                                                       'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'host,statement'),
               ('io_by_thread_by_latency'            , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'user,thread_id,processlist_id'),
               ('io_global_by_file_by_bytes'         , '%{TABLE}.total DESC',
                                                       '(e.total-IFNULL(s.total, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', 100, 'file'),
               ('io_global_by_file_by_latency'       , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', 100, 'file'),
               ('io_global_by_wait_by_bytes'         , '%{TABLE}.total_requested DESC',
                                                       '(e.total_requested-IFNULL(s.total_requested, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'event_name'),
               ('io_global_by_wait_by_latency'       , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'event_name'),
               ('schema_index_statistics'            , '(%{TABLE}.select_latency+%{TABLE}.insert_latency+%{TABLE}.update_latency+%{TABLE}.delete_latency) DESC',
                                                       '((e.select_latency+e.insert_latency+e.update_latency+e.delete_latency)-IFNULL(s.select_latency+s.insert_latency+s.update_latency+s.delete_latency, 0)) DESC',
                                                       '((e.rows_selected+e.insert_latency+e.rows_updated+e.rows_deleted)-IFNULL(s.rows_selected+s.rows_inserted+s.rows_updated+s.rows_deleted, 0)) > 0',
                                                       100, 'table_schema,table_name,index_name'),
               ('schema_table_statistics'            , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) > 0', 100, 'table_schema,table_name'),
               ('schema_tables_with_full_table_scans', '%{TABLE}.rows_full_scanned DESC',
                                                       '(e.rows_full_scanned-IFNULL(s.rows_full_scanned, 0)) DESC',
                                                       '(e.rows_full_scanned-IFNULL(s.rows_full_scanned, 0)) > 0', 100, 'object_schema,object_name'),
               ('user_summary'                       , '%{TABLE}.statement_latency DESC',
                                                       '(e.statement_latency-IFNULL(s.statement_latency, 0)) DESC',
                                                       '(e.statements - IFNULL(s.statements, 0)) > 0', NULL, 'user'),
               ('user_summary_by_file_io'            , '%{TABLE}.io_latency DESC',
                                                       '(e.io_latency-IFNULL(s.io_latency, 0)) DESC',
                                                       '(e.ios - IFNULL(s.ios, 0)) > 0', NULL, 'user'),
               ('user_summary_by_file_io_type'       , '%{TABLE}.user, %{TABLE}.latency DESC',
                                                       'e.user, (e.latency-IFNULL(s.latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'user,event_name'),
               ('user_summary_by_stages'             , '%{TABLE}.user, %{TABLE}.total_latency DESC',
                                                       'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'user,event_name'),
               ('user_summary_by_statement_latency'  , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'user'),
               ('user_summary_by_statement_type'     , '%{TABLE}.user, %{TABLE}.total_latency DESC',
                                                       'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'user,statement'),
               ('wait_classes_global_by_avg_latency' , 'IFNULL(%{TABLE}.total_latency / NULLIF(%{TABLE}.total, 0), 0) DESC',
                                                       'IFNULL((e.total_latency-IFNULL(s.total_latency, 0)) / NULLIF((e.total - IFNULL(s.total, 0)), 0), 0) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'event_class'),
               ('wait_classes_global_by_latency'     , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'event_class'),
               ('waits_by_host_by_latency'           , '%{TABLE}.host, %{TABLE}.total_latency DESC',
                                                       'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'host,event'),
               ('waits_by_user_by_latency'           , '%{TABLE}.user, %{TABLE}.total_latency DESC',
                                                       'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'user,event'),
               ('waits_global_by_latency'            , '%{TABLE}.total_latency DESC',
                                                       '(e.total_latency-IFNULL(s.total_latency, 0)) DESC',
                                                       '(e.total - IFNULL(s.total, 0)) > 0', NULL, 'events')
        ;
    END IF;


    SELECT '

=======================

     Configuration

=======================

' AS '';
    -- Get the configuration.
    SELECT 'GLOBAL VARIABLES' AS 'The following output is:';
    IF (v_has_ps_vars = 'YES') THEN
        SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value FROM performance_schema.global_variables ORDER BY VARIABLE_NAME;
    ELSE
        SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value FROM information_schema.GLOBAL_VARIABLES ORDER BY VARIABLE_NAME;
    END IF;

    IF (v_has_ps = 'YES') THEN
        -- Overview of the Performance Schema dynamic settings used for this report.
        SELECT 'Performance Schema Setup - Actors' AS 'The following output is:';
        SELECT * FROM performance_schema.setup_actors;

        SELECT 'Performance Schema Setup - Consumers' AS 'The following output is:';
        SELECT NAME AS Consumer, ENABLED, sys.ps_is_consumer_enabled(NAME) AS COLLECTS
          FROM performance_schema.setup_consumers;

        SELECT 'Performance Schema Setup - Instruments' AS 'The following output is:';
        SELECT SUBSTRING_INDEX(NAME, '/', 2) AS 'InstrumentClass',
               ROUND(100*SUM(IF(ENABLED = 'YES', 1, 0))/COUNT(*), 2) AS 'EnabledPct',
               ROUND(100*SUM(IF(TIMED = 'YES', 1, 0))/COUNT(*), 2) AS 'TimedPct'
          FROM performance_schema.setup_instruments
         GROUP BY SUBSTRING_INDEX(NAME, '/', 2)
         ORDER BY SUBSTRING_INDEX(NAME, '/', 2);

        SELECT 'Performance Schema Setup - Objects' AS 'The following output is:';
        SELECT * FROM performance_schema.setup_objects;

        SELECT 'Performance Schema Setup - Threads' AS 'The following output is:';
        SELECT `TYPE` AS ThreadType, COUNT(*) AS 'Total', ROUND(100*SUM(IF(INSTRUMENTED = 'YES', 1, 0))/COUNT(*), 2) AS 'InstrumentedPct'
          FROM performance_schema.threads
        GROUP BY TYPE;
    END IF;


    IF (v_has_replication = 'NO') THEN
        SELECT 'No Replication Configured' AS 'Replication Status';
    ELSE
        -- No guarantee that replication is actually configured, but we can't really know
        SELECT CONCAT('Replication Configured: ', v_has_replication, ' - Performance Schema Replication Tables: ', v_has_ps_replication) AS 'Replication Status';
        
        IF (v_has_ps_replication = 'YES') THEN
            SELECT 'Replication - Connection Configuration' AS 'The following output is:';
            SELECT * FROM performance_schema.replication_connection_configuration/*!50706 ORDER BY CHANNEL_NAME*/;
        END IF;
        
        IF (v_has_ps_replication = 'YES') THEN
            SELECT 'Replication - Applier Configuration' AS 'The following output is:';
            SELECT * FROM performance_schema.replication_applier_configuration ORDER BY CHANNEL_NAME;
        END IF;
    END IF;


    IF (v_has_ndb IN ('DEFAULT', 'YES')) THEN
       SELECT 'Cluster Thread Blocks' AS 'The following output is:';
       SELECT * FROM ndbinfo.threadblocks;
    END IF;

    -- For a number of sys views as well as events_statements_summary_by_digest,
    -- just get the start data and then at the end output the overall and delta values
    IF (v_has_ps = 'YES') THEN
        IF (@sys.diagnostics.include_raw = 'ON') THEN
            SELECT '

========================

     Initial Status

========================

' AS '';
        END IF;

        DROP TEMPORARY TABLE IF EXISTS tmp_digests_start;
        CALL sys.statement_performance_analyzer('create_tmp', 'tmp_digests_start', NULL);
        CALL sys.statement_performance_analyzer('snapshot', NULL, NULL);
        CALL sys.statement_performance_analyzer('save', 'tmp_digests_start', NULL);

        -- Loop over the sys views where deltas should be calculated.
        IF (@sys.diagnostics.include_raw = 'ON') THEN
            SET @sys.diagnostics.sql = REPLACE(@sys.diagnostics.sql_gen_query_template, '%{OUTPUT}', 'start');
            IF (@sys.debug = 'ON') THEN
                SELECT 'The following query will be used to generate the query for each sys view' AS 'Debug';
                SELECT @sys.diagnostics.sql AS 'Debug';
            END IF;
            PREPARE stmt_gen_query FROM @sys.diagnostics.sql;
        END IF;
        SET v_done = FALSE;
        OPEN c_sysviews_w_delta;
        c_sysviews_w_delta_loop: LOOP
            FETCH c_sysviews_w_delta INTO v_table_name;
            IF v_done THEN
                LEAVE c_sysviews_w_delta_loop;
            END IF;

            IF (@sys.debug = 'ON') THEN
                SELECT CONCAT('The following queries are for storing the initial content of ', v_table_name) AS 'Debug';
            END IF;

            CALL sys.execute_prepared_stmt(CONCAT('DROP TEMPORARY TABLE IF EXISTS `tmp_', v_table_name, '_start`'));
            CALL sys.execute_prepared_stmt(CONCAT('CREATE TEMPORARY TABLE `tmp_', v_table_name, '_start` SELECT * FROM `sys`.`x$', v_table_name, '`'));

            IF (@sys.diagnostics.include_raw = 'ON') THEN
                SET @sys.diagnostics.table_name = CONCAT('x$', v_table_name);
                EXECUTE stmt_gen_query USING @sys.diagnostics.table_name;
                -- If necessary add ORDER BY and LIMIT
                SELECT CONCAT(@sys.diagnostics.sql_select,
                              IF(order_by IS NOT NULL, CONCAT('\n ORDER BY ', REPLACE(order_by, '%{TABLE}', CONCAT('tmp_', v_table_name, '_start'))), ''),
                              IF(limit_rows IS NOT NULL, CONCAT('\n LIMIT ', limit_rows), '')
                       )
                  INTO @sys.diagnostics.sql_select
                  FROM tmp_sys_views_delta
                 WHERE TABLE_NAME = v_table_name;
                SELECT CONCAT('Initial ', v_table_name) AS 'The following output is:';
                CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);
            END IF;
        END LOOP;
        CLOSE c_sysviews_w_delta;

        IF (@sys.diagnostics.include_raw = 'ON') THEN
            DEALLOCATE PREPARE stmt_gen_query;
        END IF;
    END IF;

    -- If in_include_status_summary is TRUE then a temporary table is required to store the data
    SET v_sql_status_summary_select = 'SELECT Variable_name',
        v_sql_status_summary_delta  = '',
        v_sql_status_summary_from   = '';

    -- Start the loop
    REPEAT 
        SET v_output_count = v_output_count + 1;
        IF (v_output_count > 1) THEN
            -- Don't sleep on the first execution
            SET v_sleep = in_interval-(UNIX_TIMESTAMP(NOW(2))-v_iter_start);
            SELECT NOW() AS 'Time', CONCAT('Going to sleep for ', v_sleep, ' seconds. Please do not interrupt') AS 'The following output is:';
            DO SLEEP(in_interval);
        END IF;
        SET v_iter_start = UNIX_TIMESTAMP(NOW(2));

        SELECT NOW(), CONCAT('Iteration Number ', IFNULL(v_output_count, 'NULL')) AS 'The following output is:';

        -- Even in 5.7 there is no way to get all the info from SHOW MASTER|SLAVE STATUS using the Performance Schema or
        -- other tables, so include them even though they are no longer optimal solutions and if present get the additional
        -- information from the other tables available.
        IF (@@log_bin = 1) THEN
            SELECT 'SHOW MASTER STATUS' AS 'The following output is:';
            SHOW MASTER STATUS;
        END IF;

        IF (v_has_replication <> 'NO') THEN
            SELECT 'SHOW SLAVE STATUS' AS 'The following output is:';
            SHOW SLAVE STATUS;
        END IF;

        -- We need one table per output as a temporary table cannot be opened twice in the same query, and we need to
        -- join the outputs in the summary at the end.
        SET v_table_name = CONCAT('tmp_metrics_', v_output_count);
        CALL sys.execute_prepared_stmt(CONCAT('DROP TEMPORARY TABLE IF EXISTS ', v_table_name));
        
        -- Currently information_schema.GLOBAL_STATUS has VARIABLE_VALUE as varchar(1024)
        CALL sys.execute_prepared_stmt(CONCAT('CREATE TEMPORARY TABLE ', v_table_name, ' (
  Variable_name VARCHAR(193) NOT NULL,
  Variable_value VARCHAR(1024),
  Type VARCHAR(100) NOT NULL,
  Enabled ENUM(''YES'', ''NO'', ''PARTIAL'') NOT NULL,
  PRIMARY KEY (Type, Variable_name)
) ENGINE = InnoDB DEFAULT CHARSET=utf8'));

        IF (v_has_metrics) THEN
            SET @sys.diagnostics.sql = CONCAT(
                'INSERT INTO ', v_table_name,
                ' SELECT Variable_name, REPLACE(Variable_value, ''\n'', ''\\\\n'') AS Variable_value, Type, Enabled FROM sys.metrics'
            );
        ELSE
            -- 5.7+ and the Performance Schema disabled. Use information_schema.GLOBAL_STATUS instead like in 5.6.
            SET @sys.diagnostics.sql = CONCAT(
                'INSERT INTO ', v_table_name,
                '(SELECT LOWER(VARIABLE_NAME) AS Variable_name, REPLACE(VARIABLE_VALUE, ''\n'', ''\\\\n'') AS Variable_value,
                         ''Global Status'' AS Type, ''YES'' AS Enabled
  FROM performance_schema.global_status
) UNION ALL (
SELECT NAME AS Variable_name, COUNT AS Variable_value,
       CONCAT(''InnoDB Metrics - '', SUBSYSTEM) AS Type,
       IF(STATUS = ''enabled'', ''YES'', ''NO'') AS Enabled
  FROM information_schema.INNODB_METRICS
  -- Deduplication - some variables exists both in GLOBAL_STATUS and INNODB_METRICS
  -- Keep the one from GLOBAL_STATUS as it is always enabled and it''s more likely to be used for existing tools.
 WHERE NAME NOT IN (
     ''lock_row_lock_time'', ''lock_row_lock_time_avg'', ''lock_row_lock_time_max'', ''lock_row_lock_waits'',
     ''buffer_pool_reads'', ''buffer_pool_read_requests'', ''buffer_pool_write_requests'', ''buffer_pool_wait_free'',
     ''buffer_pool_read_ahead'', ''buffer_pool_read_ahead_evicted'', ''buffer_pool_pages_total'', ''buffer_pool_pages_misc'',
     ''buffer_pool_pages_data'', ''buffer_pool_bytes_data'', ''buffer_pool_pages_dirty'', ''buffer_pool_bytes_dirty'',
     ''buffer_pool_pages_free'', ''buffer_pages_created'', ''buffer_pages_written'', ''buffer_pages_read'',
     ''buffer_data_reads'', ''buffer_data_written'', ''file_num_open_files'',
     ''os_log_bytes_written'', ''os_log_fsyncs'', ''os_log_pending_fsyncs'', ''os_log_pending_writes'',
     ''log_waits'', ''log_write_requests'', ''log_writes'', ''innodb_dblwr_writes'', ''innodb_dblwr_pages_written'', ''innodb_page_size'')
) UNION ALL (
SELECT ''NOW()'' AS Variable_name, NOW(3) AS Variable_value, ''System Time'' AS Type, ''YES'' AS Enabled
) UNION ALL (
SELECT ''UNIX_TIMESTAMP()'' AS Variable_name, ROUND(UNIX_TIMESTAMP(NOW(3)), 3) AS Variable_value, ''System Time'' AS Type, ''YES'' AS Enabled
)
 ORDER BY Type, Variable_name;'
            );
        END IF;
        CALL sys.execute_prepared_stmt(@sys.diagnostics.sql);

        -- Prepare the query to retrieve the summary
        CALL sys.execute_prepared_stmt(
            CONCAT('SELECT Variable_value INTO @sys.diagnostics.output_time FROM ', v_table_name, ' WHERE Type = ''System Time'' AND Variable_name = ''UNIX_TIMESTAMP()''')
        );
        SET v_output_time = @sys.diagnostics.output_time;

        -- Limit each value to v_status_summary_width chars (when v_has_ndb = TRUE the values can be very wide - refer to the output here for the full values)
        -- v_sql_status_summary_select, v_sql_status_summary_delta, v_sql_status_summary_from
        SET v_sql_status_summary_select = CONCAT(v_sql_status_summary_select, ',
       CONCAT(
           LEFT(s', v_output_count, '.Variable_value, ', v_status_summary_width, '),
           IF(', REPLACE(v_no_delta_names, '%{COUNT}', v_output_count), ' AND s', v_output_count, '.Variable_value REGEXP ''^[0-9]+(\\\\.[0-9]+)?$'', CONCAT('' ('', ROUND(s', v_output_count, '.Variable_value/', v_output_time, ', 2), ''/sec)''), '''')
       ) AS ''Output ', v_output_count, ''''),
            v_sql_status_summary_from   = CONCAT(v_sql_status_summary_from, '
',
                                                    IF(v_output_count = 1, '  FROM ', '       INNER JOIN '),
                                                    v_table_name, ' s', v_output_count,
                                                    IF (v_output_count = 1, '', ' USING (Type, Variable_name)'));
        IF (v_output_count > 1) THEN
            SET v_sql_status_summary_delta  = CONCAT(v_sql_status_summary_delta, ',
       IF(', REPLACE(v_no_delta_names, '%{COUNT}', v_output_count), ' AND s', (v_output_count-1), '.Variable_value REGEXP ''^[0-9]+(\\\\.[0-9]+)?$'' AND s', v_output_count, '.Variable_value REGEXP ''^[0-9]+(\\\\.[0-9]+)?$'',
          CONCAT(IF(s', (v_output_count-1), '.Variable_value REGEXP ''^[0-9]+\\\\.[0-9]+$'' OR s', v_output_count, '.Variable_value REGEXP ''^[0-9]+\\\\.[0-9]+$'',
                    ROUND((s', v_output_count, '.Variable_value-s', (v_output_count-1), '.Variable_value), 2),
                    (s', v_output_count, '.Variable_value-s', (v_output_count-1), '.Variable_value)
                   ),
                 '' ('', ROUND((s', v_output_count, '.Variable_value-s', (v_output_count-1), '.Variable_value)/(', v_output_time, '-', v_output_time_prev, '), 2), ''/sec)''
          ),
          ''''
       ) AS ''Delta (', (v_output_count-1), ' -> ', v_output_count, ')''');
        END IF;

        SET v_output_time_prev = v_output_time;

        IF (@sys.diagnostics.include_raw = 'ON') THEN
            IF (v_has_metrics) THEN
                SELECT 'SELECT * FROM sys.metrics' AS 'The following output is:';
            ELSE
                SELECT 'sys.metrics equivalent' AS 'The following output is:';
            END IF;
            -- Ensures that the output here is the same as the one used in the status summary at the end
            CALL sys.execute_prepared_stmt(CONCAT('SELECT Type, Variable_name, Enabled, Variable_value FROM ', v_table_name, ' ORDER BY Type, Variable_name'));
        END IF;

        -- InnoDB
        IF (v_has_innodb IN ('DEFAULT', 'YES')) THEN
            SELECT 'SHOW ENGINE INNODB STATUS' AS 'The following output is:';
            EXECUTE stmt_innodb_status;
            SELECT 'InnoDB - Transactions' AS 'The following output is:';
            SELECT * FROM information_schema.INNODB_TRX;
        END IF;

        -- NDBCluster
        IF (v_has_ndb IN ('DEFAULT', 'YES')) THEN
            SELECT 'SHOW ENGINE NDBCLUSTER STATUS' AS 'The following output is:';
            EXECUTE stmt_ndbcluster_status;

            SELECT 'ndbinfo.memoryusage' AS 'The following output is:';
            SELECT node_id, memory_type, sys.format_bytes(used) AS used, used_pages, sys.format_bytes(total) AS total, total_pages,
                   ROUND(100*(used/total), 2) AS 'Used %'
            FROM ndbinfo.memoryusage;

            -- Loop over the ndbinfo tables (except memoryusage which was handled separately above).
            -- The exact tables available are version dependent, so get the list from the Information Schema.
            SET v_done = FALSE;
            OPEN c_ndbinfo;
            c_ndbinfo_loop: LOOP
                FETCH c_ndbinfo INTO v_table_name;
                IF v_done THEN
                LEAVE c_ndbinfo_loop;
                END IF;

                SELECT CONCAT('SELECT * FROM ndbinfo.', v_table_name) AS 'The following output is:';
                CALL sys.execute_prepared_stmt(CONCAT('SELECT * FROM `ndbinfo`.`', v_table_name, '`'));
            END LOOP;
            CLOSE c_ndbinfo;

            SELECT * FROM information_schema.FILES;
        END IF;

        SELECT 'SELECT * FROM sys.processlist' AS 'The following output is:';
        SELECT processlist.* FROM sys.processlist;

        IF (v_has_ps = 'YES') THEN
            -- latest_file_io
            IF (sys.ps_is_consumer_enabled('events_waits_history_long') = 'YES') THEN
                SELECT 'SELECT * FROM sys.latest_file_io' AS 'The following output is:';
                SELECT * FROM sys.latest_file_io;
            END IF;

            -- current memory usage
            IF (EXISTS(SELECT 1 FROM performance_schema.setup_instruments WHERE NAME LIKE 'memory/%' AND ENABLED = 'YES')) THEN
                SELECT 'SELECT * FROM sys.memory_by_host_by_current_bytes' AS 'The following output is:';
                SELECT * FROM sys.memory_by_host_by_current_bytes;

                SELECT 'SELECT * FROM sys.memory_by_thread_by_current_bytes' AS 'The following output is:';
                SELECT * FROM sys.memory_by_thread_by_current_bytes;

                SELECT 'SELECT * FROM sys.memory_by_user_by_current_bytes' AS 'The following output is:';
                SELECT * FROM sys.memory_by_user_by_current_bytes;

                SELECT 'SELECT * FROM sys.memory_global_by_current_bytes' AS 'The following output is:';
                SELECT * FROM sys.memory_global_by_current_bytes;
            END IF;
        END IF;

        SET v_runtime = (UNIX_TIMESTAMP(NOW(2)) - v_start);
    UNTIL (v_runtime + in_interval >= in_max_runtime) END REPEAT;

    -- Get Performance Schema status
    IF (v_has_ps = 'YES') THEN
        SELECT 'SHOW ENGINE PERFORMANCE_SCHEMA STATUS' AS 'The following output is:';
        EXECUTE stmt_ps_status;
    END IF;

    -- Deallocate prepared statements
    IF (v_has_innodb IN ('DEFAULT', 'YES')) THEN
        DEALLOCATE PREPARE stmt_innodb_status;
    END IF;
    IF (v_has_ps = 'YES') THEN
        DEALLOCATE PREPARE stmt_ps_status;
    END IF;
    IF (v_has_ndb IN ('DEFAULT', 'YES')) THEN
        DEALLOCATE PREPARE stmt_ndbcluster_status;
    END IF;


    SELECT '

============================

     Schema Information

============================

' AS '';

    SELECT COUNT(*) AS 'Total Number of Tables' FROM information_schema.TABLES;

    -- The cost of information_schema.TABLES.DATA_LENGTH depends mostly on the number of tables
    IF (@sys.diagnostics.allow_i_s_tables = 'ON') THEN
        SELECT 'Storage Engine Usage' AS 'The following output is:';
        SELECT ENGINE, COUNT(*) AS NUM_TABLES,
                sys.format_bytes(SUM(DATA_LENGTH)) AS DATA_LENGTH,
                sys.format_bytes(SUM(INDEX_LENGTH)) AS INDEX_LENGTH,
                sys.format_bytes(SUM(DATA_LENGTH+INDEX_LENGTH)) AS TOTAL
            FROM information_schema.TABLES
            GROUP BY ENGINE;

        SELECT 'Schema Object Overview' AS 'The following output is:';
        SELECT * FROM sys.schema_object_overview;

        SELECT 'Tables without a PRIMARY KEY' AS 'The following output is:';
        SELECT TABLES.TABLE_SCHEMA, ENGINE, COUNT(*) AS NumTables
          FROM information_schema.TABLES
               LEFT OUTER JOIN information_schema.STATISTICS ON STATISTICS.TABLE_SCHEMA = TABLES.TABLE_SCHEMA
                                                                AND STATISTICS.TABLE_NAME = TABLES.TABLE_NAME
                                                                AND STATISTICS.INDEX_NAME = 'PRIMARY'
         WHERE STATISTICS.TABLE_NAME IS NULL
               AND TABLES.TABLE_SCHEMA NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')
               AND TABLES.TABLE_TYPE = 'BASE TABLE'
         GROUP BY TABLES.TABLE_SCHEMA, ENGINE;
    END IF;

    IF (v_has_ps = 'YES') THEN
        SELECT 'Unused Indexes' AS 'The following output is:';
        SELECT object_schema, COUNT(*) AS NumUnusedIndexes
          FROM performance_schema.table_io_waits_summary_by_index_usage 
         WHERE index_name IS NOT NULL
               AND count_star = 0
               AND object_schema NOT IN ('mysql', 'sys')
               AND index_name != 'PRIMARY'
         GROUP BY object_schema;
    END IF;

    IF (v_has_ps = 'YES') THEN
        SELECT '

=========================

     Overall Status

=========================

' AS '';

        SELECT 'CALL sys.ps_statement_avg_latency_histogram()' AS 'The following output is:';
        CALL sys.ps_statement_avg_latency_histogram();

        CALL sys.statement_performance_analyzer('snapshot', NULL, NULL);
        CALL sys.statement_performance_analyzer('overall', NULL, 'with_runtimes_in_95th_percentile');

        SET @sys.diagnostics.sql = REPLACE(@sys.diagnostics.sql_gen_query_template, '%{OUTPUT}', 'end');
        IF (@sys.debug = 'ON') THEN
            SELECT 'The following query will be used to generate the query for each sys view' AS 'Debug';
            SELECT @sys.diagnostics.sql AS 'Debug';
        END IF;
        PREPARE stmt_gen_query FROM @sys.diagnostics.sql;

        SET v_done = FALSE;
        OPEN c_sysviews_w_delta;
        c_sysviews_w_delta_loop: LOOP
            FETCH c_sysviews_w_delta INTO v_table_name;
            IF v_done THEN
                LEAVE c_sysviews_w_delta_loop;
            END IF;

            IF (@sys.debug = 'ON') THEN
                SELECT CONCAT('The following queries are for storing the final content of ', v_table_name) AS 'Debug';
            END IF;

            CALL sys.execute_prepared_stmt(CONCAT('DROP TEMPORARY TABLE IF EXISTS `tmp_', v_table_name, '_end`'));
            CALL sys.execute_prepared_stmt(CONCAT('CREATE TEMPORARY TABLE `tmp_', v_table_name, '_end` SELECT * FROM `sys`.`x$', v_table_name, '`'));

            IF (@sys.diagnostics.include_raw = 'ON') THEN
                SET @sys.diagnostics.table_name = CONCAT('x$', v_table_name);
                EXECUTE stmt_gen_query USING @sys.diagnostics.table_name;
                -- If necessary add ORDER BY and LIMIT
                SELECT CONCAT(@sys.diagnostics.sql_select,
                                IF(order_by IS NOT NULL, CONCAT('\n ORDER BY ', REPLACE(order_by, '%{TABLE}', CONCAT('tmp_', v_table_name, '_end'))), ''),
                                IF(limit_rows IS NOT NULL, CONCAT('\n LIMIT ', limit_rows), '')
                        )
                    INTO @sys.diagnostics.sql_select
                    FROM tmp_sys_views_delta
                    WHERE TABLE_NAME = v_table_name;
                SELECT CONCAT('Overall ', v_table_name) AS 'The following output is:';
                CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);
            END IF;
        END LOOP;
        CLOSE c_sysviews_w_delta;

        DEALLOCATE PREPARE stmt_gen_query;


        SELECT '

======================

     Delta Status

======================

' AS '';

        CALL sys.statement_performance_analyzer('delta', 'tmp_digests_start', 'with_runtimes_in_95th_percentile');
        CALL sys.statement_performance_analyzer('cleanup', NULL, NULL);

        DROP TEMPORARY TABLE tmp_digests_start;

        -- @sys.diagnostics.sql_gen_query_delta is defined near the to together with @sys.diagnostics.sql_gen_query_template
        IF (@sys.debug = 'ON') THEN
            SELECT 'The following query will be used to generate the query for each sys view delta' AS 'Debug';
            SELECT @sys.diagnostics.sql_gen_query_delta AS 'Debug';
        END IF;
        PREPARE stmt_gen_query_delta FROM @sys.diagnostics.sql_gen_query_delta;

        SET v_old_group_concat_max_len = @@session.group_concat_max_len;
        SET @@session.group_concat_max_len = 2048;
        SET v_done = FALSE;
        OPEN c_sysviews_w_delta;
        c_sysviews_w_delta_loop: LOOP
            FETCH c_sysviews_w_delta INTO v_table_name;
            IF v_done THEN
                LEAVE c_sysviews_w_delta_loop;
            END IF;

            SET @sys.diagnostics.table_name = v_table_name;
            EXECUTE stmt_gen_query_delta USING @sys.diagnostics.table_name;
            -- If necessary add WHERE, ORDER BY, and LIMIT
            SELECT CONCAT(@sys.diagnostics.sql_select,
                            IF(where_delta IS NOT NULL, CONCAT('\n WHERE ', where_delta), ''),
                            IF(order_by_delta IS NOT NULL, CONCAT('\n ORDER BY ', order_by_delta), ''),
                            IF(limit_rows IS NOT NULL, CONCAT('\n LIMIT ', limit_rows), '')
                    )
                INTO @sys.diagnostics.sql_select
                FROM tmp_sys_views_delta
                WHERE TABLE_NAME = v_table_name;

            SELECT CONCAT('Delta ', v_table_name) AS 'The following output is:';
            CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);

            CALL sys.execute_prepared_stmt(CONCAT('DROP TEMPORARY TABLE `tmp_', v_table_name, '_end`'));
            CALL sys.execute_prepared_stmt(CONCAT('DROP TEMPORARY TABLE `tmp_', v_table_name, '_start`'));
        END LOOP;
        CLOSE c_sysviews_w_delta;
        SET @@session.group_concat_max_len = v_old_group_concat_max_len;

        DEALLOCATE PREPARE stmt_gen_query_delta;
        DROP TEMPORARY TABLE tmp_sys_views_delta;
    END IF;

    IF (v_has_metrics) THEN
        SELECT 'SELECT * FROM sys.metrics' AS 'The following output is:';
    ELSE
        SELECT 'sys.metrics equivalent' AS 'The following output is:';
    END IF;
    CALL sys.execute_prepared_stmt(
        CONCAT(v_sql_status_summary_select, v_sql_status_summary_delta, ', Type, s1.Enabled', v_sql_status_summary_from,
               '
 ORDER BY Type, Variable_name'
        )
    );

    -- Remove all the metrics temporary tables again
    SET v_count = 0;
    WHILE (v_count < v_output_count) DO
        SET v_count = v_count + 1;
        SET v_table_name = CONCAT('tmp_metrics_', v_count);
        CALL sys.execute_prepared_stmt(CONCAT('DROP TEMPORARY TABLE IF EXISTS ', v_table_name));
    END WHILE;

    IF (in_auto_config <> 'current') THEN
        CALL sys.ps_setup_reload_saved();
        SET sql_log_bin = @log_bin;
    END IF;

    -- Reset the @sys.diagnostics.% user variables internal to this procedure
    SET @sys.diagnostics.output_time            = NULL,
        @sys.diagnostics.sql                    = NULL,
        @sys.diagnostics.sql_gen_query_delta    = NULL,
        @sys.diagnostics.sql_gen_query_template = NULL,
        @sys.diagnostics.sql_select             = NULL,
        @sys.diagnostics.table_name             = NULL;

    -- Restore INSTRUMENTED for this thread
    IF (v_this_thread_enabled = 'YES') THEN
        CALL sys.ps_setup_enable_thread(CONNECTION_ID());
    END IF;

    IF (@log_bin = 1) THEN
        SET sql_log_bin = @log_bin;
    END IF;
END$$

DELIMITER ;
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_statement_avg_latency_histogram;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_statement_avg_latency_histogram ()
    COMMENT '
             Description
             -----------

             Outputs a textual histogram graph of the average latency values
             across all normalized queries tracked within the Performance Schema
             events_statements_summary_by_digest table.

             Can be used to show a very high level picture of what kind of 
             latency distribution statements running within this instance have.

             Parameters
             -----------

             None.

             Example
             -----------

             mysql> CALL sys.ps_statement_avg_latency_histogram()\\G
             *************************** 1. row ***************************
             Performance Schema Statement Digest Average Latency Histogram:

               . = 1 unit
               * = 2 units
               # = 3 units

             (0 - 38ms)     240 | ################################################################################
             (38 - 77ms)    38  | ......................................
             (77 - 115ms)   3   | ...
             (115 - 154ms)  62  | *******************************
             (154 - 192ms)  3   | ...
             (192 - 231ms)  0   |
             (231 - 269ms)  0   |
             (269 - 307ms)  0   |
             (307 - 346ms)  0   |
             (346 - 384ms)  1   | .
             (384 - 423ms)  1   | .
             (423 - 461ms)  0   |
             (461 - 499ms)  0   |
             (499 - 538ms)  0   |
             (538 - 576ms)  0   |
             (576 - 615ms)  1   | .

               Total Statements: 350; Buckets: 16; Bucket Size: 38 ms;
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
SELECT CONCAT('\n',
       '\n  . = 1 unit',
       '\n  * = 2 units',
       '\n  # = 3 units\n',
       @label := CONCAT(@label_inner := CONCAT('\n(0 - ',
                                               ROUND((@bucket_size := (SELECT ROUND((MAX(avg_us) - MIN(avg_us)) / (@buckets := 16)) AS size
                                                                         FROM sys.x$ps_digest_avg_latency_distribution)) / (@unit_div := 1000)),
                                                (@unit := 'ms'), ')'),
                        REPEAT(' ', (@max_label_size := ((1 + LENGTH(ROUND((@bucket_size * 15) / @unit_div)) + 3 + LENGTH(ROUND(@bucket_size * 16) / @unit_div)) + 1)) - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us <= @bucket_size), 0)),
       REPEAT(' ', (@max_label_len := (@max_label_size + LENGTH((@total_queries := (SELECT SUM(cnt) FROM sys.x$ps_digest_avg_latency_distribution)))) + 1) - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < (@one_unit := 40), '.', IF(@count_in_bucket < (@two_unit := 80), '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),

       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND(@bucket_size / @unit_div), ' - ', ROUND((@bucket_size * 2) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size AND b1.avg_us <= @bucket_size * 2), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 2) / @unit_div), ' - ', ROUND((@bucket_size * 3) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 2 AND b1.avg_us <= @bucket_size * 3), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 3) / @unit_div), ' - ', ROUND((@bucket_size * 4) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 3 AND b1.avg_us <= @bucket_size * 4), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 4) / @unit_div), ' - ', ROUND((@bucket_size * 5) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 4 AND b1.avg_us <= @bucket_size * 5), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 5) / @unit_div), ' - ', ROUND((@bucket_size * 6) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 5 AND b1.avg_us <= @bucket_size * 6), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 6) / @unit_div), ' - ', ROUND((@bucket_size * 7) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 6 AND b1.avg_us <= @bucket_size * 7), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 7) / @unit_div), ' - ', ROUND((@bucket_size * 8) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 7 AND b1.avg_us <= @bucket_size * 8), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 8) / @unit_div), ' - ', ROUND((@bucket_size * 9) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 8 AND b1.avg_us <= @bucket_size * 9), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 9) / @unit_div), ' - ', ROUND((@bucket_size * 10) / @unit_div), @unit, ')'),
                         REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                         @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                       FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                      WHERE b1.avg_us > @bucket_size * 9 AND b1.avg_us <= @bucket_size * 10), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 10) / @unit_div), ' - ', ROUND((@bucket_size * 11) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 10 AND b1.avg_us <= @bucket_size * 11), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 11) / @unit_div), ' - ', ROUND((@bucket_size * 12) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 11 AND b1.avg_us <= @bucket_size * 12), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 12) / @unit_div), ' - ', ROUND((@bucket_size * 13) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 12 AND b1.avg_us <= @bucket_size * 13), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 13) / @unit_div), ' - ', ROUND((@bucket_size * 14) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 13 AND b1.avg_us <= @bucket_size * 14), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 14) / @unit_div), ' - ', ROUND((@bucket_size * 15) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 14 AND b1.avg_us <= @bucket_size * 15), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),
       @label := CONCAT(@label_inner := CONCAT('\n(', ROUND((@bucket_size * 15) / @unit_div), ' - ', ROUND((@bucket_size * 16) / @unit_div), @unit, ')'),
                        REPEAT(' ', @max_label_size - LENGTH(@label_inner)),
                        @count_in_bucket := IFNULL((SELECT SUM(cnt)
                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1 
                                                     WHERE b1.avg_us > @bucket_size * 15 AND b1.avg_us <= @bucket_size * 16), 0)),
       REPEAT(' ', @max_label_len - LENGTH(@label)), '| ',
       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, '.', IF(@count_in_bucket < @two_unit, '*', '#')), 
       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,
       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), ''),

       '\n\n  Total Statements: ', @total_queries, '; Buckets: ', @buckets , '; Bucket Size: ', ROUND(@bucket_size / @unit_div) , ' ', @unit, ';\n'

      ) AS `Performance Schema Statement Digest Average Latency Histogram`;

END $$

DELIMITER ;

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_trace_statement_digest;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_trace_statement_digest (
        IN in_digest VARCHAR(32),
        IN in_runtime INT, 
        IN in_interval DECIMAL(2,2),
        IN in_start_fresh BOOLEAN,
        IN in_auto_enable BOOLEAN
    )
    COMMENT '
             Description
             -----------

             Traces all instrumentation within Performance Schema for a specific
             Statement Digest. 

             When finding a statement of interest within the 
             performance_schema.events_statements_summary_by_digest table, feed
             the DIGEST MD5 value in to this procedure, set how long to poll for, 
             and at what interval to poll, and it will generate a report of all 
             statistics tracked within Performance Schema for that digest for the
             interval.

             It will also attempt to generate an EXPLAIN for the longest running 
             example of the digest during the interval. Note this may fail, as:

                * Performance Schema truncates long SQL_TEXT values (and hence the 
                  EXPLAIN will fail due to parse errors)
                * the default schema is sys (so tables that are not fully qualified
                  in the query may not be found)
                * some queries such as SHOW are not supported in EXPLAIN.

             When the EXPLAIN fails, the error will be ignored and no EXPLAIN
             output generated.

             Requires the SUPER privilege for "SET sql_log_bin = 0;".

             Parameters
             -----------

             in_digest (VARCHAR(32)):
               The statement digest identifier you would like to analyze
             in_runtime (INT):
               The number of seconds to run analysis for
             in_interval (DECIMAL(2,2)):
               The interval (in seconds, may be fractional) at which to try
               and take snapshots
             in_start_fresh (BOOLEAN):
               Whether to TRUNCATE the events_statements_history_long and
               events_stages_history_long tables before starting
             in_auto_enable (BOOLEAN):
               Whether to automatically turn on required consumers

             Example
             -----------

             mysql> call ps_trace_statement_digest(\'891ec6860f98ba46d89dd20b0c03652c\', 10, 0.1, true, true);
             +--------------------+
             | SUMMARY STATISTICS |
             +--------------------+
             | SUMMARY STATISTICS |
             +--------------------+
             1 row in set (9.11 sec)

             +------------+-----------+-----------+-----------+---------------+------------+------------+
             | executions | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scans |
             +------------+-----------+-----------+-----------+---------------+------------+------------+
             |         21 | 4.11 ms   | 2.00 ms   |         0 |            21 |          0 |          0 |
             +------------+-----------+-----------+-----------+---------------+------------+------------+
             1 row in set (9.11 sec)

             +------------------------------------------+-------+-----------+
             | event_name                               | count | latency   |
             +------------------------------------------+-------+-----------+
             | stage/sql/checking query cache for query |    16 | 724.37 us |
             | stage/sql/statistics                     |    16 | 546.92 us |
             | stage/sql/freeing items                  |    18 | 520.11 us |
             | stage/sql/init                           |    51 | 466.80 us |
             ...
             | stage/sql/cleaning up                    |    18 | 11.92 us  |
             | stage/sql/executing                      |    16 | 6.95 us   |
             +------------------------------------------+-------+-----------+
             17 rows in set (9.12 sec)

             +---------------------------+
             | LONGEST RUNNING STATEMENT |
             +---------------------------+
             | LONGEST RUNNING STATEMENT |
             +---------------------------+
             1 row in set (9.16 sec)
             
             +-----------+-----------+-----------+-----------+---------------+------------+-----------+
             | thread_id | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scan |
             +-----------+-----------+-----------+-----------+---------------+------------+-----------+
             |    166646 | 618.43 us | 1.00 ms   |         0 |             1 |          0 |         0 |
             +-----------+-----------+-----------+-----------+---------------+------------+-----------+
             1 row in set (9.16 sec)

             // Truncated for clarity...
             +-----------------------------------------------------------------+
             | sql_text                                                        |
             +-----------------------------------------------------------------+
             | select hibeventhe0_.id as id1382_, hibeventhe0_.createdTime ... |
             +-----------------------------------------------------------------+
             1 row in set (9.17 sec)

             +------------------------------------------+-----------+
             | event_name                               | latency   |
             +------------------------------------------+-----------+
             | stage/sql/init                           | 8.61 us   |
             | stage/sql/Waiting for query cache lock   | 453.23 us |
             | stage/sql/init                           | 331.07 ns |
             | stage/sql/checking query cache for query | 43.04 us  |
             ...
             | stage/sql/freeing items                  | 30.46 us  |
             | stage/sql/cleaning up                    | 662.13 ns |
             +------------------------------------------+-----------+
             18 rows in set (9.23 sec)

             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
             | id | select_type | table        | type  | possible_keys | key       | key_len | ref         | rows | Extra |
             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
             |  1 | SIMPLE      | hibeventhe0_ | const | fixedTime     | fixedTime | 775     | const,const |    1 | NULL  |
             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
             1 row in set (9.27 sec)

             Query OK, 0 rows affected (9.28 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN

    DECLARE v_start_fresh BOOLEAN DEFAULT false;
    DECLARE v_auto_enable BOOLEAN DEFAULT false;
    DECLARE v_explain     BOOLEAN DEFAULT true;
    DECLARE v_this_thread_enabed ENUM('YES', 'NO');
    DECLARE v_runtime INT DEFAULT 0;
    DECLARE v_start INT DEFAULT 0;
    DECLARE v_found_stmts INT;

    SET @log_bin := @@sql_log_bin;
    SET sql_log_bin = 0;

    -- Do not track the current thread, it will kill the stack
    SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();
    CALL sys.ps_setup_disable_thread(CONNECTION_ID());

    DROP TEMPORARY TABLE IF EXISTS stmt_trace;
    CREATE TEMPORARY TABLE stmt_trace (
        thread_id BIGINT UNSIGNED,
        timer_start BIGINT UNSIGNED,
        event_id BIGINT UNSIGNED,
        sql_text longtext,
        timer_wait BIGINT UNSIGNED,
        lock_time BIGINT UNSIGNED,
        errors BIGINT UNSIGNED,
        mysql_errno INT,
        rows_sent BIGINT UNSIGNED,
        rows_affected BIGINT UNSIGNED,
        rows_examined BIGINT UNSIGNED,
        created_tmp_tables BIGINT UNSIGNED,
        created_tmp_disk_tables BIGINT UNSIGNED,
        no_index_used BIGINT UNSIGNED,
        PRIMARY KEY (thread_id, timer_start)
    );

    DROP TEMPORARY TABLE IF EXISTS stmt_stages;
    CREATE TEMPORARY TABLE stmt_stages (
       event_id BIGINT UNSIGNED,
       stmt_id BIGINT UNSIGNED,
       event_name VARCHAR(128),
       timer_wait BIGINT UNSIGNED,
       PRIMARY KEY (event_id)
    );

    SET v_start_fresh = in_start_fresh;
    IF v_start_fresh THEN
        TRUNCATE TABLE performance_schema.events_statements_history_long;
        TRUNCATE TABLE performance_schema.events_stages_history_long;
    END IF;

    SET v_auto_enable = in_auto_enable;
    IF v_auto_enable THEN
        CALL sys.ps_setup_save(0);

        UPDATE performance_schema.threads
           SET INSTRUMENTED = IF(PROCESSLIST_ID IS NOT NULL, 'YES', 'NO');

        -- Only the events_statements_history_long and events_stages_history_long tables and their ancestors are needed
        UPDATE performance_schema.setup_consumers
           SET ENABLED = 'YES'
         WHERE NAME NOT LIKE '%\_history'
               AND NAME NOT LIKE 'events_wait%'
               AND NAME NOT LIKE 'events_transactions%'
               AND NAME <> 'statements_digest';

        UPDATE performance_schema.setup_instruments
           SET ENABLED = 'YES',
               TIMED   = 'YES'
         WHERE NAME LIKE 'statement/%' OR NAME LIKE 'stage/%';
    END IF;

    WHILE v_runtime < in_runtime DO
        SELECT UNIX_TIMESTAMP() INTO v_start;

        INSERT IGNORE INTO stmt_trace
        SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno, 
               rows_sent, rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used
          FROM performance_schema.events_statements_history_long
        WHERE digest = in_digest;

        INSERT IGNORE INTO stmt_stages
        SELECT stages.event_id, stmt_trace.event_id,
               stages.event_name, stages.timer_wait
          FROM performance_schema.events_stages_history_long AS stages
          JOIN stmt_trace ON stages.nesting_event_id = stmt_trace.event_id;

        SELECT SLEEP(in_interval) INTO @sleep;
        SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start);
    END WHILE;

    SELECT "SUMMARY STATISTICS";

    SELECT COUNT(*) executions,
           sys.format_time(SUM(timer_wait)) AS exec_time,
           sys.format_time(SUM(lock_time)) AS lock_time,
           SUM(rows_sent) AS rows_sent,
           SUM(rows_affected) AS rows_affected,
           SUM(rows_examined) AS rows_examined,
           SUM(created_tmp_tables) AS tmp_tables,
           SUM(no_index_used) AS full_scans
      FROM stmt_trace;

    SELECT event_name,
           COUNT(*) as count,
           sys.format_time(SUM(timer_wait)) as latency
      FROM stmt_stages
     GROUP BY event_name
     ORDER BY SUM(timer_wait) DESC;

    SELECT "LONGEST RUNNING STATEMENT";

    SELECT thread_id,
           sys.format_time(timer_wait) AS exec_time,
           sys.format_time(lock_time) AS lock_time,
           rows_sent,
           rows_affected,
           rows_examined,
           created_tmp_tables AS tmp_tables,
           no_index_used AS full_scan
      FROM stmt_trace
     ORDER BY timer_wait DESC LIMIT 1;

    SELECT sql_text
      FROM stmt_trace
     ORDER BY timer_wait DESC LIMIT 1;

    SELECT sql_text, event_id INTO @sql, @sql_id
      FROM stmt_trace
    ORDER BY timer_wait DESC LIMIT 1;

    IF (@sql_id IS NOT NULL) THEN
        SELECT event_name,
               sys.format_time(timer_wait) as latency
          FROM stmt_stages
         WHERE stmt_id = @sql_id
         ORDER BY event_id;
    END IF;

    DROP TEMPORARY TABLE stmt_trace;
    DROP TEMPORARY TABLE stmt_stages;

    IF (@sql IS NOT NULL) THEN
        SET @stmt := CONCAT("EXPLAIN FORMAT=JSON ", @sql);
        BEGIN
            -- Not all queries support EXPLAIN, so catch the cases that are
            -- not supported. Currently that includes cases where the table
            -- is not fully qualified and is not in the default schema for this
            -- procedure as it's not possible to change the default schema inside
            -- a procedure.
            --
            -- Errno = 1064: You have an error in your SQL syntax
            -- Errno = 1146: Table '...' doesn't exist
            DECLARE CONTINUE HANDLER FOR 1064, 1146 SET v_explain = false;

            PREPARE explain_stmt FROM @stmt;
        END;

        IF (v_explain) THEN
            EXECUTE explain_stmt;
            DEALLOCATE PREPARE explain_stmt;
        END IF;
    END IF;

    IF v_auto_enable THEN
        CALL sys.ps_setup_reload_saved();
    END IF;
    -- Restore INSTRUMENTED for this thread
    IF (v_this_thread_enabed = 'YES') THEN
        CALL sys.ps_setup_enable_thread(CONNECTION_ID());
    END IF;

    SET sql_log_bin = @log_bin;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_trace_thread;

DELIMITER $$
CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_trace_thread (
        IN in_thread_id BIGINT UNSIGNED,
        IN in_outfile VARCHAR(255),
        IN in_max_runtime DECIMAL(20,2),
        IN in_interval DECIMAL(20,2),
        IN in_start_fresh BOOLEAN,
        IN in_auto_setup BOOLEAN,
        IN in_debug BOOLEAN
    )
    COMMENT '
             Description
             -----------

             Dumps all data within Performance Schema for an instrumented thread,
             to create a DOT formatted graph file. 

             Each resultset returned from the procedure should be used for a complete graph

             Requires the SUPER privilege for "SET sql_log_bin = 0;".

             Parameters
             -----------

             in_thread_id (BIGINT UNSIGNED):
               The thread that you would like a stack trace for
             in_outfile  (VARCHAR(255)):
               The filename the dot file will be written to
             in_max_runtime (DECIMAL(20,2)):
               The maximum time to keep collecting data.
               Use NULL to get the default which is 60 seconds.
             in_interval (DECIMAL(20,2)): 
               How long to sleep between data collections. 
               Use NULL to get the default which is 1 second.
             in_start_fresh (BOOLEAN):
               Whether to reset all Performance Schema data before tracing.
             in_auto_setup (BOOLEAN):
               Whether to disable all other threads and enable all consumers/instruments. 
               This will also reset the settings at the end of the run.
             in_debug (BOOLEAN):
               Whether you would like to include file:lineno in the graph

             Example
             -----------

             mysql> CALL sys.ps_trace_thread(25, CONCAT(\'/tmp/stack-\', REPLACE(NOW(), \' \', \'-\'), \'.dot\'), NULL, NULL, TRUE, TRUE, TRUE);
             +-------------------+
             | summary           |
             +-------------------+
             | Disabled 1 thread |
             +-------------------+
             1 row in set (0.00 sec)

             +---------------------------------------------+
             | Info                                        |
             +---------------------------------------------+
             | Data collection starting for THREAD_ID = 25 |
             +---------------------------------------------+
             1 row in set (0.03 sec)

             +-----------------------------------------------------------+
             | Info                                                      |
             +-----------------------------------------------------------+
             | Stack trace written to /tmp/stack-2014-02-16-21:18:41.dot |
             +-----------------------------------------------------------+
             1 row in set (60.07 sec)

             +-------------------------------------------------------------------+
             | Convert to PDF                                                    |
             +-------------------------------------------------------------------+
             | dot -Tpdf -o /tmp/stack_25.pdf /tmp/stack-2014-02-16-21:18:41.dot |
             +-------------------------------------------------------------------+
             1 row in set (60.07 sec)

             +-------------------------------------------------------------------+
             | Convert to PNG                                                    |
             +-------------------------------------------------------------------+
             | dot -Tpng -o /tmp/stack_25.png /tmp/stack-2014-02-16-21:18:41.dot |
             +-------------------------------------------------------------------+
             1 row in set (60.07 sec)

             +------------------+
             | summary          |
             +------------------+
             | Enabled 1 thread |
             +------------------+
             1 row in set (60.32 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    DECLARE v_done bool DEFAULT FALSE;
    DECLARE v_start, v_runtime DECIMAL(20,2) DEFAULT 0.0;
    DECLARE v_min_event_id bigint unsigned DEFAULT 0;
    DECLARE v_this_thread_enabed ENUM('YES', 'NO');
    DECLARE v_event longtext;
    DECLARE c_stack CURSOR FOR
        SELECT CONCAT(IF(nesting_event_id IS NOT NULL, CONCAT(nesting_event_id, ' -> '), ''), 
                    event_id, '; ', event_id, ' [label="',
                    -- Convert from picoseconds to microseconds
                    '(', sys.format_time(timer_wait), ') ',
                    IF (event_name NOT LIKE 'wait/io%', 
                        SUBSTRING_INDEX(event_name, '/', -2), 
                        IF (event_name NOT LIKE 'wait/io/file%' OR event_name NOT LIKE 'wait/io/socket%',
                            SUBSTRING_INDEX(event_name, '/', -4),
                            event_name)
                        ),
                    -- Always dump the extra wait information gathered for statements
                    IF (event_name LIKE 'statement/%', IFNULL(CONCAT('\\n', wait_info), ''), ''),
                    -- If debug is enabled, add the file:lineno information for waits
                    IF (in_debug AND event_name LIKE 'wait%', wait_info, ''),
                    '", ', 
                    -- Depending on the type of event, style appropriately
                    CASE WHEN event_name LIKE 'wait/io/file%' THEN 
                           'shape=box, style=filled, color=red'
                         WHEN event_name LIKE 'wait/io/table%' THEN 
                           'shape=box, style=filled, color=green'
                         WHEN event_name LIKE 'wait/io/socket%' THEN
                           'shape=box, style=filled, color=yellow'
                         WHEN event_name LIKE 'wait/synch/mutex%' THEN
                           'style=filled, color=lightskyblue'
                         WHEN event_name LIKE 'wait/synch/cond%' THEN
                           'style=filled, color=darkseagreen3'
                         WHEN event_name LIKE 'wait/synch/rwlock%' THEN
                           'style=filled, color=orchid'
                         WHEN event_name LIKE 'wait/lock%' THEN
                           'shape=box, style=filled, color=tan'
                         WHEN event_name LIKE 'statement/%' THEN
                           CONCAT('shape=box, style=bold',
                                  -- Style statements depending on COM vs SQL
                                  CASE WHEN event_name LIKE 'statement/com/%' THEN
                                         ' style=filled, color=darkseagreen'
                                       ELSE
                                         -- Use long query time from the server to
                                         -- flag long running statements in red
                                         IF((timer_wait/1000000000000) > @@long_query_time, 
                                            ' style=filled, color=red', 
                                            ' style=filled, color=lightblue')
                                  END
                           )
                         WHEN event_name LIKE 'stage/%' THEN
                           'style=filled, color=slategray3'
                         -- IDLE events are on their own, call attention to them
                         WHEN event_name LIKE '%idle%' THEN
                           'shape=box, style=filled, color=firebrick3'
                         ELSE '' END,
                     '];\n'
                   ) event, event_id
        FROM (
             -- Select all statements, with the extra tracing information available
             (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, 
                     CONCAT(sql_text, '\\n',
                            'errors: ', errors, '\\n',
                            'warnings: ', warnings, '\\n',
                            'lock time: ', sys.format_time(lock_time),'\\n',
                            'rows affected: ', rows_affected, '\\n',
                            'rows sent: ', rows_sent, '\\n',
                            'rows examined: ', rows_examined, '\\n',
                            'tmp tables: ', created_tmp_tables, '\\n',
                            'tmp disk tables: ', created_tmp_disk_tables, '\\n'
                            'select scan: ', select_scan, '\\n',
                            'select full join: ', select_full_join, '\\n',
                            'select full range join: ', select_full_range_join, '\\n',
                            'select range: ', select_range, '\\n',
                            'select range check: ', select_range_check, '\\n', 
                            'sort merge passes: ', sort_merge_passes, '\\n',
                            'sort rows: ', sort_rows, '\\n',
                            'sort range: ', sort_range, '\\n',
                            'sort scan: ', sort_scan, '\\n',
                            'no index used: ', IF(no_index_used, 'TRUE', 'FALSE'), '\\n',
                            'no good index used: ', IF(no_good_index_used, 'TRUE', 'FALSE'), '\\n'
                     ) AS wait_info
                FROM performance_schema.events_statements_history_long
               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)
             UNION
             -- Select all stages
             (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info
                FROM performance_schema.events_stages_history_long 
               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)
             UNION 
             -- Select all events, adding information appropriate to the event
             (SELECT thread_id, event_id, 
                     CONCAT(event_name, 
                            IF(event_name NOT LIKE 'wait/synch/mutex%', IFNULL(CONCAT(' - ', operation), ''), ''), 
                            IF(number_of_bytes IS NOT NULL, CONCAT(' ', number_of_bytes, ' bytes'), ''),
                            IF(event_name LIKE 'wait/io/file%', '\\n', ''),
                            IF(object_schema IS NOT NULL, CONCAT('\\nObject: ', object_schema, '.'), ''), 
                            IF(object_name IS NOT NULL, 
                               IF (event_name LIKE 'wait/io/socket%',
                                   -- Print the socket if used, else the IP:port as reported
                                   CONCAT('\\n', IF (object_name LIKE ':0%', @@socket, object_name)),
                                   object_name),
                               ''
                            ),
                            IF(index_name IS NOT NULL, CONCAT(' Index: ', index_name), ''), '\\n'
                     ) AS event_name,
                     timer_wait, timer_start, nesting_event_id, source AS wait_info
                FROM performance_schema.events_waits_history_long
               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)
           ) events 
       ORDER BY event_id;
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

    SET @log_bin := @@sql_log_bin;
    SET sql_log_bin = 0;

    -- Do not track the current thread, it will kill the stack
    SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();
    CALL sys.ps_setup_disable_thread(CONNECTION_ID());

    IF (in_auto_setup) THEN
        CALL sys.ps_setup_save(0);
        
        -- Ensure only the thread to create the stack trace for is instrumented and that we instrument everything.
        DELETE FROM performance_schema.setup_actors;

        UPDATE performance_schema.threads
           SET INSTRUMENTED = IF(THREAD_ID = in_thread_id, 'YES', 'NO');

        -- only the %_history_long tables and it ancestors are needed
        UPDATE performance_schema.setup_consumers
           SET ENABLED = 'YES'
         WHERE NAME NOT LIKE '%\_history';

        UPDATE performance_schema.setup_instruments
           SET ENABLED = 'YES',
               TIMED   = 'YES';
    END IF;

    IF (in_start_fresh) THEN
        TRUNCATE performance_schema.events_statements_history_long;
        TRUNCATE performance_schema.events_stages_history_long;
        TRUNCATE performance_schema.events_waits_history_long;
    END IF;

    DROP TEMPORARY TABLE IF EXISTS tmp_events;
    CREATE TEMPORARY TABLE tmp_events (
      event_id bigint unsigned NOT NULL,
      event longblob,
      PRIMARY KEY (event_id)
    );

    -- Print headers for a .dot file
    INSERT INTO tmp_events VALUES (0, CONCAT('digraph events { rankdir=LR; nodesep=0.10;\n',
                                             '// Stack created .....: ', NOW(), '\n',
                                             '// MySQL version .....: ', VERSION(), '\n',
                                             '// MySQL hostname ....: ', @@hostname, '\n',
                                             '// MySQL port ........: ', @@port, '\n',
                                             '// MySQL socket ......: ', @@socket, '\n',
                                             '// MySQL user ........: ', CURRENT_USER(), '\n'));

    SELECT CONCAT('Data collection starting for THREAD_ID = ', in_thread_id) AS 'Info';

    SET v_min_event_id = 0,
        v_start        = UNIX_TIMESTAMP(),
        in_interval    = IFNULL(in_interval, 1.00),
        in_max_runtime = IFNULL(in_max_runtime, 60.00);

    WHILE (v_runtime < in_max_runtime
           AND (SELECT INSTRUMENTED FROM performance_schema.threads WHERE THREAD_ID = in_thread_id) = 'YES') DO
        SET v_done = FALSE;
        OPEN c_stack;
        c_stack_loop: LOOP
            FETCH c_stack INTO v_event, v_min_event_id;
            IF v_done THEN
                LEAVE c_stack_loop;
            END IF;

            IF (LENGTH(v_event) > 0) THEN
                INSERT INTO tmp_events VALUES (v_min_event_id, v_event);
            END IF;
        END LOOP;
        CLOSE c_stack;

        SELECT SLEEP(in_interval) INTO @sleep;
        SET v_runtime = (UNIX_TIMESTAMP() - v_start);
    END WHILE;

    INSERT INTO tmp_events VALUES (v_min_event_id+1, '}');
   
    SET @query = CONCAT('SELECT event FROM tmp_events ORDER BY event_id INTO OUTFILE ''', in_outfile, ''' FIELDS ESCAPED BY '''' LINES TERMINATED BY ''''');
    PREPARE stmt_output FROM @query;
    EXECUTE stmt_output;
    DEALLOCATE PREPARE stmt_output;
   
    SELECT CONCAT('Stack trace written to ', in_outfile) AS 'Info';
    SELECT CONCAT('dot -Tpdf -o /tmp/stack_', in_thread_id, '.pdf ', in_outfile) AS 'Convert to PDF';
    SELECT CONCAT('dot -Tpng -o /tmp/stack_', in_thread_id, '.png ', in_outfile) AS 'Convert to PNG';
    DROP TEMPORARY TABLE tmp_events;

    -- Reset the settings for the performance schema
    IF (in_auto_setup) THEN
        CALL sys.ps_setup_reload_saved();
    END IF;
    -- Restore INSTRUMENTED for this thread
    IF (v_this_thread_enabed = 'YES') THEN
        CALL sys.ps_setup_enable_thread(CONNECTION_ID());
    END IF;

    SET sql_log_bin = @log_bin;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_disable_background_threads;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_disable_background_threads ()
    COMMENT '
             Description
             -----------

             Disable all background thread instrumentation within Performance Schema.

             Parameters
             -----------

             None.

             Example
             -----------

             mysql> CALL sys.ps_setup_disable_background_threads();
             +--------------------------------+
             | summary                        |
             +--------------------------------+
             | Disabled 18 background threads |
             +--------------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.threads
       SET instrumented = 'NO'
     WHERE type = 'BACKGROUND';

    SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' background thread', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_disable_consumer;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_disable_consumer (
        IN consumer VARCHAR(128)
    )
    COMMENT '
             Description
             -----------

             Disables consumers within Performance Schema 
             matching the input pattern.

             Parameters
             -----------

             consumer (VARCHAR(128)):
               A LIKE pattern match (using "%consumer%") of consumers to disable

             Example
             -----------

             To disable all consumers:

             mysql> CALL sys.ps_setup_disable_consumer(\'\');
             +--------------------------+
             | summary                  |
             +--------------------------+
             | Disabled 15 consumers    |
             +--------------------------+
             1 row in set (0.02 sec)

             To disable just the event_stage consumers:

             mysql> CALL sys.ps_setup_disable_comsumers(\'stage\');
             +------------------------+
             | summary                |
             +------------------------+
             | Disabled 3 consumers   |
             +------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.setup_consumers
       SET enabled = 'NO'
     WHERE name LIKE CONCAT('%', consumer, '%');

    SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' consumer', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_disable_instrument;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_disable_instrument (
        IN in_pattern VARCHAR(128)
    )
    COMMENT '
             Description
             -----------

             Disables instruments within Performance Schema 
             matching the input pattern.

             Parameters
             -----------

             in_pattern (VARCHAR(128)):
               A LIKE pattern match (using "%in_pattern%") of events to disable

             Example
             -----------

             To disable all mutex instruments:

             mysql> CALL sys.ps_setup_disable_instrument(\'wait/synch/mutex\');
             +--------------------------+
             | summary                  |
             +--------------------------+
             | Disabled 155 instruments |
             +--------------------------+
             1 row in set (0.02 sec)

             To disable just a specific TCP/IP based network IO instrument:

             mysql> CALL sys.ps_setup_disable_instrument(\'wait/io/socket/sql/server_tcpip_socket\');
             +------------------------+
             | summary                |
             +------------------------+
             | Disabled 1 instruments |
             +------------------------+
             1 row in set (0.00 sec)

             To disable all instruments:

             mysql> CALL sys.ps_setup_disable_instrument(\'\');
             +--------------------------+
             | summary                  |
             +--------------------------+
             | Disabled 547 instruments |
             +--------------------------+
             1 row in set (0.01 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.setup_instruments
       SET enabled = 'NO', timed = 'NO'
     WHERE name LIKE CONCAT('%', in_pattern, '%');

    SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' instrument', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_disable_thread;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_disable_thread (
        IN in_connection_id BIGINT
    )
    COMMENT '
             Description
             -----------

             Disable the given connection/thread in Performance Schema.

             Parameters
             -----------

             in_connection_id (BIGINT):
               The connection ID (PROCESSLIST_ID from performance_schema.threads
               or the ID shown within SHOW PROCESSLIST)

             Example
             -----------

             mysql> CALL sys.ps_setup_disable_thread(3);
             +-------------------+
             | summary           |
             +-------------------+
             | Disabled 1 thread |
             +-------------------+
             1 row in set (0.01 sec)

             To disable the current connection:

             mysql> CALL sys.ps_setup_disable_thread(CONNECTION_ID());
             +-------------------+
             | summary           |
             +-------------------+
             | Disabled 1 thread |
             +-------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.threads
       SET instrumented = 'NO'
     WHERE processlist_id = in_connection_id;

    SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' thread', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_enable_background_threads;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_enable_background_threads ()
    COMMENT '
             Description
             -----------

             Enable all background thread instrumentation within Performance Schema.

             Parameters
             -----------

             None.

             Example
             -----------

             mysql> CALL sys.ps_setup_enable_background_threads();
             +-------------------------------+
             | summary                       |
             +-------------------------------+
             | Enabled 18 background threads |
             +-------------------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.threads
       SET instrumented = 'YES'
     WHERE type = 'BACKGROUND';

    SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' background thread', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_enable_consumer;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_enable_consumer (
        IN consumer VARCHAR(128)
    )
    COMMENT '
             Description
             -----------

             Enables consumers within Performance Schema 
             matching the input pattern.

             Parameters
             -----------

             consumer (VARCHAR(128)):
               A LIKE pattern match (using "%consumer%") of consumers to enable

             Example
             -----------

             To enable all consumers:

             mysql> CALL sys.ps_setup_enable_consumer(\'\');
             +-------------------------+
             | summary                 |
             +-------------------------+
             | Enabled 10 consumers    |
             +-------------------------+
             1 row in set (0.02 sec)

             Query OK, 0 rows affected (0.02 sec)

             To enable just "waits" consumers:

             mysql> CALL sys.ps_setup_enable_consumer(\'waits\');
             +-----------------------+
             | summary               |
             +-----------------------+
             | Enabled 3 consumers   |
             +-----------------------+
             1 row in set (0.00 sec)

             Query OK, 0 rows affected (0.00 sec)
             '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.setup_consumers
       SET enabled = 'YES'
     WHERE name LIKE CONCAT('%', consumer, '%');

    SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' consumer', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_enable_instrument;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_enable_instrument (
        IN in_pattern VARCHAR(128)
    )
    COMMENT '
             Description
             -----------

             Enables instruments within Performance Schema 
             matching the input pattern.

             Parameters
             -----------

             in_pattern (VARCHAR(128)):
               A LIKE pattern match (using "%in_pattern%") of events to enable

             Example
             -----------

             To enable all mutex instruments:

             mysql> CALL sys.ps_setup_enable_instrument(\'wait/synch/mutex\');
             +-------------------------+
             | summary                 |
             +-------------------------+
             | Enabled 155 instruments |
             +-------------------------+
             1 row in set (0.02 sec)

             Query OK, 0 rows affected (0.02 sec)

             To enable just a specific TCP/IP based network IO instrument:

             mysql> CALL sys.ps_setup_enable_instrument(\'wait/io/socket/sql/server_tcpip_socket\');
             +-----------------------+
             | summary               |
             +-----------------------+
             | Enabled 1 instruments |
             +-----------------------+
             1 row in set (0.00 sec)

             Query OK, 0 rows affected (0.00 sec)

             To enable all instruments:

             mysql> CALL sys.ps_setup_enable_instrument(\'\');
             +-------------------------+
             | summary                 |
             +-------------------------+
             | Enabled 547 instruments |
             +-------------------------+
             1 row in set (0.01 sec)

             Query OK, 0 rows affected (0.01 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.setup_instruments
       SET enabled = 'YES', timed = 'YES'
     WHERE name LIKE CONCAT('%', in_pattern, '%');

    SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' instrument', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_enable_thread;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_enable_thread (
        IN in_connection_id BIGINT
    )
    COMMENT '
             Description
             -----------

             Enable the given connection/thread in Performance Schema.

             Parameters
             -----------

             in_connection_id (BIGINT):
               The connection ID (PROCESSLIST_ID from performance_schema.threads
               or the ID shown within SHOW PROCESSLIST)

             Example
             -----------

             mysql> CALL sys.ps_setup_enable_thread(3);
             +------------------+
             | summary          |
             +------------------+
             | Enabled 1 thread |
             +------------------+
             1 row in set (0.01 sec)

             To enable the current connection:

             mysql> CALL sys.ps_setup_enable_thread(CONNECTION_ID());
             +------------------+
             | summary          |
             +------------------+
             | Enabled 1 thread |
             +------------------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    UPDATE performance_schema.threads
       SET instrumented = 'YES'
     WHERE processlist_id = in_connection_id;

    SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' thread', IF(@rows != 1, 's', '')) AS summary;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_reload_saved;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_reload_saved ()
    COMMENT '
             Description
             -----------

             Reloads a saved Performance Schema configuration,
             so that you can alter the setup for debugging purposes, 
             but restore it to a previous state.
             
             Use the companion procedure - ps_setup_save(), to 
             save a configuration.

             Requires the SUPER privilege for "SET sql_log_bin = 0;".

             Parameters
             -----------

             None.

             Example
             -----------

             mysql> CALL sys.ps_setup_save();
             Query OK, 0 rows affected (0.08 sec)

             mysql> UPDATE performance_schema.setup_instruments SET enabled = \'YES\', timed = \'YES\';
             Query OK, 547 rows affected (0.40 sec)
             Rows matched: 784  Changed: 547  Warnings: 0

             /* Run some tests that need more detailed instrumentation here */

             mysql> CALL sys.ps_setup_reload_saved();
             Query OK, 0 rows affected (0.32 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    DECLARE v_done bool DEFAULT FALSE;
    DECLARE v_lock_result INT;
    DECLARE v_lock_used_by BIGINT;
    DECLARE v_signal_message TEXT;
    DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
        SIGNAL SQLSTATE VALUE '90001'
           SET MESSAGE_TEXT = 'An error occurred, was sys.ps_setup_save() run before this procedure?';
    END;

    SET @log_bin := @@sql_log_bin;
    SET sql_log_bin = 0;

    SELECT IS_USED_LOCK('sys.ps_setup_save') INTO v_lock_used_by;

    IF (v_lock_used_by != CONNECTION_ID()) THEN
        SET v_signal_message = CONCAT('The sys.ps_setup_save lock is currently owned by ', v_lock_used_by);
        SIGNAL SQLSTATE VALUE '90002'
           SET MESSAGE_TEXT = v_signal_message;
    END IF;

    DELETE FROM performance_schema.setup_actors;
    INSERT INTO performance_schema.setup_actors SELECT * FROM tmp_setup_actors;

    BEGIN
        -- Workaround for http://bugs.mysql.com/bug.php?id=70025
        DECLARE v_name varchar(64);
        DECLARE v_enabled enum('YES', 'NO');
        DECLARE c_consumers CURSOR FOR SELECT NAME, ENABLED FROM tmp_setup_consumers;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

        SET v_done = FALSE;
        OPEN c_consumers;
        c_consumers_loop: LOOP
            FETCH c_consumers INTO v_name, v_enabled;
            IF v_done THEN
               LEAVE c_consumers_loop;
            END IF;

            UPDATE performance_schema.setup_consumers
               SET ENABLED = v_enabled
             WHERE NAME = v_name;
         END LOOP;
         CLOSE c_consumers;
    END;

    UPDATE performance_schema.setup_instruments
     INNER JOIN tmp_setup_instruments USING (NAME)
       SET performance_schema.setup_instruments.ENABLED = tmp_setup_instruments.ENABLED,
           performance_schema.setup_instruments.TIMED   = tmp_setup_instruments.TIMED;
    BEGIN
        -- Workaround for http://bugs.mysql.com/bug.php?id=70025
        DECLARE v_thread_id bigint unsigned;
        DECLARE v_instrumented enum('YES', 'NO');
        DECLARE c_threads CURSOR FOR SELECT THREAD_ID, INSTRUMENTED FROM tmp_threads;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

        SET v_done = FALSE;
        OPEN c_threads;
        c_threads_loop: LOOP
            FETCH c_threads INTO v_thread_id, v_instrumented;
            IF v_done THEN
               LEAVE c_threads_loop;
            END IF;

            UPDATE performance_schema.threads
               SET INSTRUMENTED = v_instrumented
             WHERE THREAD_ID = v_thread_id;
        END LOOP;
        CLOSE c_threads;
    END;

    UPDATE performance_schema.threads
       SET INSTRUMENTED = IF(PROCESSLIST_USER IS NOT NULL,
                             sys.ps_is_account_enabled(PROCESSLIST_HOST, PROCESSLIST_USER),
                             'YES')
     WHERE THREAD_ID NOT IN (SELECT THREAD_ID FROM tmp_threads);

    DROP TEMPORARY TABLE tmp_setup_actors;
    DROP TEMPORARY TABLE tmp_setup_consumers;
    DROP TEMPORARY TABLE tmp_setup_instruments;
    DROP TEMPORARY TABLE tmp_threads;

    SELECT RELEASE_LOCK('sys.ps_setup_save') INTO v_lock_result;

    SET sql_log_bin = @log_bin; 
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

-- Because of bug 11750980/bug 41686, set the sql_mode to ''
SET @old_sql_mode = @@session.sql_mode, @@session.sql_mode = '';

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_reset_to_default;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_reset_to_default (
       IN in_verbose BOOLEAN
    )
    COMMENT '
             Description
             -----------

             Resets the Performance Schema setup to the default settings.

             Parameters
             -----------

             in_verbose (BOOLEAN):
               Whether to print each setup stage (including the SQL) whilst running.

             Example
             -----------

             mysql> CALL sys.ps_setup_reset_to_default(true)\\G
             *************************** 1. row ***************************
             status: Resetting: setup_actors
             DELETE
             FROM performance_schema.setup_actors
              WHERE NOT (HOST = \'%\' AND USER = \'%\' AND ROLE = \'%\')
             1 row in set (0.00 sec)

             *************************** 1. row ***************************
             status: Resetting: setup_actors
             INSERT IGNORE INTO performance_schema.setup_actors
             VALUES (\'%\', \'%\', \'%\')
             1 row in set (0.00 sec)
             ...

             mysql> CALL sys.ps_setup_reset_to_default(false)\\G
             Query OK, 0 rows affected (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    SET @query = 'DELETE
                    FROM performance_schema.setup_actors
                   WHERE NOT (HOST = ''%'' AND USER = ''%'' AND ROLE = ''%'')';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: setup_actors\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;

    SET @query = 'INSERT IGNORE INTO performance_schema.setup_actors
                  VALUES (''%'', ''%'', ''%'', ''YES'', ''YES'')';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: setup_actors\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;

    SET @query = 'UPDATE performance_schema.setup_instruments
                     SET ENABLED = sys.ps_is_instrument_default_enabled(NAME),
                         TIMED   = sys.ps_is_instrument_default_timed(NAME)';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: setup_instruments\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;
         
    SET @query = 'UPDATE performance_schema.setup_consumers
                     SET ENABLED = IF(NAME IN (''events_statements_current'', ''events_transactions_current'', ''global_instrumentation'', ''thread_instrumentation'', ''statements_digest''), ''YES'', ''NO'')';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: setup_consumers\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;

    SET @query = 'DELETE
                    FROM performance_schema.setup_objects
                   WHERE NOT (OBJECT_TYPE IN (''EVENT'', ''FUNCTION'', ''PROCEDURE'', ''TABLE'', ''TRIGGER'') AND OBJECT_NAME = ''%''
                     AND (OBJECT_SCHEMA = ''mysql''              AND ENABLED = ''NO''  AND TIMED = ''NO'' )
                      OR (OBJECT_SCHEMA = ''performance_schema'' AND ENABLED = ''NO''  AND TIMED = ''NO'' )
                      OR (OBJECT_SCHEMA = ''information_schema'' AND ENABLED = ''NO''  AND TIMED = ''NO'' )
                      OR (OBJECT_SCHEMA = ''%''                  AND ENABLED = ''YES'' AND TIMED = ''YES''))';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: setup_objects\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;

    SET @query = 'INSERT IGNORE INTO performance_schema.setup_objects
                  VALUES (''EVENT''    , ''mysql''             , ''%'', ''NO'' , ''NO'' ),
                         (''EVENT''    , ''performance_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''EVENT''    , ''information_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''EVENT''    , ''%''                 , ''%'', ''YES'', ''YES''),
                         (''FUNCTION'' , ''mysql''             , ''%'', ''NO'' , ''NO'' ),
                         (''FUNCTION'' , ''performance_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''FUNCTION'' , ''information_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''FUNCTION'' , ''%''                 , ''%'', ''YES'', ''YES''),
                         (''PROCEDURE'', ''mysql''             , ''%'', ''NO'' , ''NO'' ),
                         (''PROCEDURE'', ''performance_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''PROCEDURE'', ''information_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''PROCEDURE'', ''%''                 , ''%'', ''YES'', ''YES''),
                         (''TABLE''    , ''mysql''             , ''%'', ''NO'' , ''NO'' ),
                         (''TABLE''    , ''performance_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''TABLE''    , ''information_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''TABLE''    , ''%''                 , ''%'', ''YES'', ''YES''),
                         (''TRIGGER''  , ''mysql''             , ''%'', ''NO'' , ''NO'' ),
                         (''TRIGGER''  , ''performance_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''TRIGGER''  , ''information_schema'', ''%'', ''NO'' , ''NO'' ),
                         (''TRIGGER''  , ''%''                 , ''%'', ''YES'', ''YES'')';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: setup_objects\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;

    SET @query = 'UPDATE performance_schema.threads
                     SET INSTRUMENTED = ''YES''';

    IF (in_verbose) THEN
        SELECT CONCAT('Resetting: threads\n', REPLACE(@query, '  ', '')) AS status;
    END IF;

    PREPARE reset_stmt FROM @query;
    EXECUTE reset_stmt;
    DEALLOCATE PREPARE reset_stmt;
END$$

DELIMITER ;


-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

SET @@session.sql_mode = @old_sql_mode;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_save;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_save (
        IN in_timeout INT
    )
    COMMENT '
             Description
             -----------

             Saves the current configuration of Performance Schema, 
             so that you can alter the setup for debugging purposes, 
             but restore it to a previous state.

             Use the companion procedure - ps_setup_reload_saved(), to 
             restore the saved config.

             The named lock "sys.ps_setup_save" is taken before the
             current configuration is saved. If the attempt to get the named
             lock times out, an error occurs.

             The lock is released after the settings have been restored by
             calling ps_setup_reload_saved().

             Requires the SUPER privilege for "SET sql_log_bin = 0;".

             Parameters
             -----------

             in_timeout INT
               The timeout in seconds used when trying to obtain the lock.
               A negative timeout means infinite timeout.

             Example
             -----------

             mysql> CALL sys.ps_setup_save(-1);
             Query OK, 0 rows affected (0.08 sec)

             mysql> UPDATE performance_schema.setup_instruments 
                 ->    SET enabled = \'YES\', timed = \'YES\';
             Query OK, 547 rows affected (0.40 sec)
             Rows matched: 784  Changed: 547  Warnings: 0

             /* Run some tests that need more detailed instrumentation here */

             mysql> CALL sys.ps_setup_reload_saved();
             Query OK, 0 rows affected (0.32 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    DECLARE v_lock_result INT;

    SET @log_bin := @@sql_log_bin;
    SET sql_log_bin = 0;

    SELECT GET_LOCK('sys.ps_setup_save', in_timeout) INTO v_lock_result;

    IF v_lock_result THEN
        DROP TEMPORARY TABLE IF EXISTS tmp_setup_actors;
        DROP TEMPORARY TABLE IF EXISTS tmp_setup_consumers;
        DROP TEMPORARY TABLE IF EXISTS tmp_setup_instruments;
        DROP TEMPORARY TABLE IF EXISTS tmp_threads;

        CREATE TEMPORARY TABLE tmp_setup_actors LIKE performance_schema.setup_actors;
        CREATE TEMPORARY TABLE tmp_setup_consumers LIKE performance_schema.setup_consumers;
        CREATE TEMPORARY TABLE tmp_setup_instruments LIKE performance_schema.setup_instruments;
        CREATE TEMPORARY TABLE tmp_threads (THREAD_ID bigint unsigned NOT NULL PRIMARY KEY, INSTRUMENTED enum('YES','NO') NOT NULL);

        INSERT INTO tmp_setup_actors SELECT * FROM performance_schema.setup_actors;
        INSERT INTO tmp_setup_consumers SELECT * FROM performance_schema.setup_consumers;
        INSERT INTO tmp_setup_instruments SELECT * FROM performance_schema.setup_instruments;
        INSERT INTO tmp_threads SELECT THREAD_ID, INSTRUMENTED FROM performance_schema.threads;
    ELSE
        SIGNAL SQLSTATE VALUE '90000'
           SET MESSAGE_TEXT = 'Could not lock the sys.ps_setup_save user lock, another thread has a saved configuration';
    END IF;

    SET sql_log_bin = @log_bin;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_show_disabled;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_show_disabled (
        IN in_show_instruments BOOLEAN,
        IN in_show_threads BOOLEAN
    )
    COMMENT '
             Description
             -----------

             Shows all currently disable Performance Schema configuration.

             Disabled users is only available for MySQL 5.7.6 and later.
             In earlier versions it was only possible to enable users.

             Parameters
             -----------

             in_show_instruments (BOOLEAN):
               Whether to print disabled instruments (can print many items)

             in_show_threads (BOOLEAN):
               Whether to print disabled threads

             Example
             -----------

             mysql> CALL sys.ps_setup_show_disabled(TRUE, TRUE);
             +----------------------------+
             | performance_schema_enabled |
             +----------------------------+
             |                          1 |
             +----------------------------+
             1 row in set (0.00 sec)

             +--------------------+
             | disabled_users     |
             +--------------------+
             | \'mark\'@\'localhost\' |
             +--------------------+
             1 row in set (0.00 sec)

             +-------------+----------------------+---------+-------+
             | object_type | objects              | enabled | timed |
             +-------------+----------------------+---------+-------+
             | EVENT       | mysql.%              | NO      | NO    |
             | EVENT       | performance_schema.% | NO      | NO    |
             | EVENT       | information_schema.% | NO      | NO    |
             | FUNCTION    | mysql.%              | NO      | NO    |
             | FUNCTION    | performance_schema.% | NO      | NO    |
             | FUNCTION    | information_schema.% | NO      | NO    |
             | PROCEDURE   | mysql.%              | NO      | NO    |
             | PROCEDURE   | performance_schema.% | NO      | NO    |
             | PROCEDURE   | information_schema.% | NO      | NO    |
             | TABLE       | mysql.%              | NO      | NO    |
             | TABLE       | performance_schema.% | NO      | NO    |
             | TABLE       | information_schema.% | NO      | NO    |
             | TRIGGER     | mysql.%              | NO      | NO    |
             | TRIGGER     | performance_schema.% | NO      | NO    |
             | TRIGGER     | information_schema.% | NO      | NO    |
             +-------------+----------------------+---------+-------+
             15 rows in set (0.00 sec)

             +----------------------------------+
             | disabled_consumers               |
             +----------------------------------+
             | events_stages_current            |
             | events_stages_history            |
             | events_stages_history_long       |
             | events_statements_history        |
             | events_statements_history_long   |
             | events_transactions_history      |
             | events_transactions_history_long |
             | events_waits_current             |
             | events_waits_history             |
             | events_waits_history_long        |
             +----------------------------------+
             10 rows in set (0.00 sec)

             Empty set (0.00 sec)
             
             +---------------------------------------------------------------------------------------+-------+
             | disabled_instruments                                                                  | timed |
             +---------------------------------------------------------------------------------------+-------+
             | wait/synch/mutex/sql/TC_LOG_MMAP::LOCK_tc                                             | NO    |
             | wait/synch/mutex/sql/LOCK_des_key_file                                                | NO    |
             | wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_commit                                       | NO    |
             ...
             | memory/sql/servers_cache                                                              | NO    |
             | memory/sql/udf_mem                                                                    | NO    |
             | wait/lock/metadata/sql/mdl                                                            | NO    |
             +---------------------------------------------------------------------------------------+-------+
             547 rows in set (0.00 sec)

             Query OK, 0 rows affected (0.01 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    READS SQL DATA
BEGIN
    SELECT @@performance_schema AS performance_schema_enabled;

    -- In 5.7.6 and later the setup_actors table has an ENABLED column to
    -- specify whether the actor is enabled. Before that all actors matched
    -- in the setup_actors table were enabled.
    -- So only execute the query in 5.7.6+
    /*!50706
    SELECT CONCAT('\'', user, '\'@\'', host, '\'') AS disabled_users
      FROM performance_schema.setup_actors
     WHERE enabled = 'NO'
     ORDER BY disabled_users;
    */

    SELECT object_type,
           CONCAT(object_schema, '.', object_name) AS objects,
           enabled,
           timed
      FROM performance_schema.setup_objects
     WHERE enabled = 'NO'
     ORDER BY object_type, objects;

    SELECT name AS disabled_consumers
      FROM performance_schema.setup_consumers
     WHERE enabled = 'NO'
     ORDER BY disabled_consumers;

    IF (in_show_threads) THEN
        SELECT IF(name = 'thread/sql/one_connection', 
                  CONCAT(processlist_user, '@', processlist_host), 
                  REPLACE(name, 'thread/', '')) AS disabled_threads,
        TYPE AS thread_type
          FROM performance_schema.threads
         WHERE INSTRUMENTED = 'NO'
         ORDER BY disabled_threads;
    END IF;

    IF (in_show_instruments) THEN
        SELECT name AS disabled_instruments,
               timed
          FROM performance_schema.setup_instruments
         WHERE enabled = 'NO'
         ORDER BY disabled_instruments;
    END IF;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_show_disabled_consumers;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_show_disabled_consumers ()
    COMMENT '
             Description
             -----------

             Shows all currently disabled consumers.

             Parameters
             -----------

             None

             Example
             -----------

             mysql> CALL sys.ps_setup_show_disabled_consumers();

             +---------------------------+
             | disabled_consumers        |
             +---------------------------+
             | events_statements_current |
             | global_instrumentation    |
             | thread_instrumentation    |
             | statements_digest         |
             +---------------------------+
             4 rows in set (0.05 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    READS SQL DATA
BEGIN
    SELECT name AS disabled_consumers
      FROM performance_schema.setup_consumers
     WHERE enabled = 'NO'
     ORDER BY disabled_consumers;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_show_disabled_instruments;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_show_disabled_instruments ()
    COMMENT '
             Description
             -----------

             Shows all currently disabled instruments.

             Parameters
             -----------

             None

             Example
             -----------

             mysql> CALL sys.ps_setup_show_disabled_instruments();
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    READS SQL DATA
BEGIN
    SELECT name AS disabled_instruments, timed
      FROM performance_schema.setup_instruments
     WHERE enabled = 'NO'
     ORDER BY disabled_instruments;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_show_enabled;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_show_enabled (
        IN in_show_instruments BOOLEAN,
        IN in_show_threads BOOLEAN
    )
    COMMENT '
             Description
             -----------

             Shows all currently enabled Performance Schema configuration.

             Parameters
             -----------

             in_show_instruments (BOOLEAN):
               Whether to print enabled instruments (can print many items)

             in_show_threads (BOOLEAN):
               Whether to print enabled threads

             Example
             -----------

             mysql> CALL sys.ps_setup_show_enabled(TRUE, TRUE);
             +----------------------------+
             | performance_schema_enabled |
             +----------------------------+
             |                          1 |
             +----------------------------+
             1 row in set (0.00 sec)

             +---------------+
             | enabled_users |
             +---------------+
             | \'%\'@\'%\'       |
             +---------------+
             1 row in set (0.01 sec)

             +-------------+---------+---------+-------+
             | object_type | objects | enabled | timed |
             +-------------+---------+---------+-------+
             | EVENT       | %.%     | YES     | YES   |
             | FUNCTION    | %.%     | YES     | YES   |
             | PROCEDURE   | %.%     | YES     | YES   |
             | TABLE       | %.%     | YES     | YES   |
             | TRIGGER     | %.%     | YES     | YES   |
             +-------------+---------+---------+-------+
             5 rows in set (0.01 sec)

             +---------------------------+
             | enabled_consumers         |
             +---------------------------+
             | events_statements_current |
             | global_instrumentation    |
             | thread_instrumentation    |
             | statements_digest         |
             +---------------------------+
             4 rows in set (0.05 sec)

             +---------------------------------+-------------+
             | enabled_threads                 | thread_type |
             +---------------------------------+-------------+
             | sql/main                        | BACKGROUND  |
             | sql/thread_timer_notifier       | BACKGROUND  |
             | innodb/io_ibuf_thread           | BACKGROUND  |
             | innodb/io_log_thread            | BACKGROUND  |
             | innodb/io_read_thread           | BACKGROUND  |
             | innodb/io_read_thread           | BACKGROUND  |
             | innodb/io_write_thread          | BACKGROUND  |
             | innodb/io_write_thread          | BACKGROUND  |
             | innodb/page_cleaner_thread      | BACKGROUND  |
             | innodb/srv_lock_timeout_thread  | BACKGROUND  |
             | innodb/srv_error_monitor_thread | BACKGROUND  |
             | innodb/srv_monitor_thread       | BACKGROUND  |
             | innodb/srv_master_thread        | BACKGROUND  |
             | innodb/srv_purge_thread         | BACKGROUND  |
             | innodb/srv_worker_thread        | BACKGROUND  |
             | innodb/srv_worker_thread        | BACKGROUND  |
             | innodb/srv_worker_thread        | BACKGROUND  |
             | innodb/buf_dump_thread          | BACKGROUND  |
             | innodb/dict_stats_thread        | BACKGROUND  |
             | sql/signal_handler              | BACKGROUND  |
             | sql/compress_gtid_table         | FOREGROUND  |
             | root@localhost                  | FOREGROUND  |
             +---------------------------------+-------------+
             22 rows in set (0.01 sec)

             +-------------------------------------+-------+
             | enabled_instruments                 | timed |
             +-------------------------------------+-------+
             | wait/io/file/sql/map                | YES   |
             | wait/io/file/sql/binlog             | YES   |
             ...
             | statement/com/Error                 | YES   |
             | statement/com/                      | YES   |
             | idle                                | YES   |
             +-------------------------------------+-------+
             210 rows in set (0.08 sec)

             Query OK, 0 rows affected (0.89 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    READS SQL DATA
BEGIN
    SELECT @@performance_schema AS performance_schema_enabled;

    -- In 5.7.6 and later the setup_actors table has an ENABLED column to
    -- specify whether the actor is enabled. Before that all actors matched
    -- in the setup_actors table were enabled.
    SELECT CONCAT('\'', user, '\'@\'', host, '\'') AS enabled_users
      FROM performance_schema.setup_actors
      WHERE enabled = 'YES'
     ORDER BY enabled_users;

    SELECT object_type,
           CONCAT(object_schema, '.', object_name) AS objects,
           enabled,
           timed
      FROM performance_schema.setup_objects
     WHERE enabled = 'YES'
     ORDER BY object_type, objects;

    SELECT name AS enabled_consumers
      FROM performance_schema.setup_consumers
     WHERE enabled = 'YES'
     ORDER BY enabled_consumers;

    IF (in_show_threads) THEN
        SELECT IF(name = 'thread/sql/one_connection', 
                  CONCAT(processlist_user, '@', processlist_host), 
                  REPLACE(name, 'thread/', '')) AS enabled_threads,
        TYPE AS thread_type
          FROM performance_schema.threads
         WHERE INSTRUMENTED = 'YES' AND name <> 'thread/innodb/thread_pool_thread'
         ORDER BY enabled_threads;
    END IF;

    IF (in_show_instruments) THEN
        SELECT name AS enabled_instruments,
               timed
          FROM performance_schema.setup_instruments
         WHERE enabled = 'YES'
         ORDER BY enabled_instruments;
    END IF;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_show_enabled_consumers;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_show_enabled_consumers ()
    COMMENT '
             Description
             -----------

             Shows all currently enabled consumers.

             Parameters
             -----------

             None

             Example
             -----------

             mysql> CALL sys.ps_setup_show_enabled_consumers();

             +---------------------------+
             | enabled_consumers         |
             +---------------------------+
             | events_statements_current |
             | global_instrumentation    |
             | thread_instrumentation    |
             | statements_digest         |
             +---------------------------+
             4 rows in set (0.05 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    READS SQL DATA
BEGIN
    SELECT name AS enabled_consumers
      FROM performance_schema.setup_consumers
     WHERE enabled = 'YES'
     ORDER BY enabled_consumers;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_setup_show_enabled_instruments;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_setup_show_enabled_instruments ()
    COMMENT '
             Description
             -----------

             Shows all currently enabled instruments.

             Parameters
             -----------

             None

             Example
             -----------

             mysql> CALL sys.ps_setup_show_enabled_instruments();
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    READS SQL DATA
BEGIN
    SELECT name AS enabled_instruments, timed
      FROM performance_schema.setup_instruments
     WHERE enabled = 'YES'
     ORDER BY enabled_instruments;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301 USA

DROP PROCEDURE IF EXISTS ps_truncate_all_tables;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE ps_truncate_all_tables (
        IN in_verbose BOOLEAN
    )
    COMMENT '
             Description
             -----------

             Truncates all summary tables within Performance Schema, 
             resetting all aggregated instrumentation as a snapshot.

             Parameters
             -----------

             in_verbose (BOOLEAN):
               Whether to print each TRUNCATE statement before running

             Example
             -----------

             mysql> CALL sys.ps_truncate_all_tables(false);
             +---------------------+
             | summary             |
             +---------------------+
             | Truncated 44 tables |
             +---------------------+
             1 row in set (0.10 sec)

             Query OK, 0 rows affected (0.10 sec)
            '
    SQL SECURITY INVOKER
    DETERMINISTIC
    MODIFIES SQL DATA
BEGIN
    DECLARE v_done INT DEFAULT FALSE;
    DECLARE v_total_tables INT DEFAULT 0;
    DECLARE v_ps_table VARCHAR(64);
    DECLARE ps_tables CURSOR FOR
        SELECT table_name 
          FROM INFORMATION_SCHEMA.TABLES 
         WHERE table_schema = 'performance_schema' 
           AND (table_name LIKE '%summary%' 
            OR table_name LIKE '%history%');
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

    OPEN ps_tables;

    ps_tables_loop: LOOP
        FETCH ps_tables INTO v_ps_table;
        IF v_done THEN
          LEAVE ps_tables_loop;
        END IF;

        SET @truncate_stmt := CONCAT('TRUNCATE TABLE performance_schema.', v_ps_table);
        IF in_verbose THEN
            SELECT CONCAT('Running: ', @truncate_stmt) AS status;
        END IF;

        PREPARE truncate_stmt FROM @truncate_stmt;
        EXECUTE truncate_stmt;
        DEALLOCATE PREPARE truncate_stmt;

        SET v_total_tables = v_total_tables + 1;
    END LOOP;

    CLOSE ps_tables;

    SELECT CONCAT('Truncated ', v_total_tables, ' tables') AS summary;

END$$

DELIMITER ;

-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-- 
-- 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-1301 USA

DROP PROCEDURE IF EXISTS statement_performance_analyzer;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE statement_performance_analyzer (
        IN in_action ENUM('snapshot', 'overall', 'delta', 'create_table', 'create_tmp', 'save', 'cleanup'),
        IN in_table VARCHAR(129),
        IN in_views SET ('with_runtimes_in_95th_percentile', 'analysis', 'with_errors_or_warnings', 'with_full_table_scans', 'with_sorting', 'with_temp_tables', 'custom')
    )
    COMMENT '
             Description
             -----------

             Create a report of the statements running on the server.

             The views are calculated based on the overall and/or delta activity.
             
             Requires the SUPER privilege for "SET sql_log_bin = 0;".

             Parameters
             -----------

             in_action (ENUM(''snapshot'', ''overall'', ''delta'', ''create_tmp'', ''create_table'', ''save'', ''cleanup'')):
               The action to take. Supported actions are:
                 * snapshot      Store a snapshot. The default is to make a snapshot of the current content of
                                 performance_schema.events_statements_summary_by_digest, but by setting in_table
                                 this can be overwritten to copy the content of the specified table.
                                 The snapshot is stored in the sys.tmp_digests temporary table.
                 * overall       Generate analyzis based on the content specified by in_table. For the overall analyzis,
                                 in_table can be NOW() to use a fresh snapshot. This will overwrite an existing snapshot.
                                 Use NULL for in_table to use the existing snapshot. If in_table IS NULL and no snapshot
                                 exists, a new will be created.
                                 See also in_views and @sys.statement_performance_analyzer.limit.
                 * delta         Generate a delta analysis. The delta will be calculated between the reference table in
                                 in_table and the snapshot. An existing snapshot must exist.
                                 The action uses the sys.tmp_digests_delta temporary table.
                                 See also in_views and @sys.statement_performance_analyzer.limit.
                 * create_table  Create a regular table suitable for storing the snapshot for later use, e.g. for
                                 calculating deltas.
                 * create_tmp    Create a temporary table suitable for storing the snapshot for later use, e.g. for
                                 calculating deltas.
                 * save          Save the snapshot in the table specified by in_table. The table must exists and have
                                 the correct structure.
                                 If no snapshot exists, a new is created.
                 * cleanup       Remove the temporary tables used for the snapshot and delta.

             in_table (VARCHAR(129)):
               The table argument used for some actions. Use the format ''db1.t1'' or ''t1'' without using any backticks (`)
               for quoting. Periods (.) are not supported in the database and table names.
               
               The meaning of the table for each action supporting the argument is:

                 * snapshot      The snapshot is created based on the specified table. Set to NULL or NOW() to use
                                 the current content of performance_schema.events_statements_summary_by_digest.
                 * overall       The table with the content to create the overall analyzis for. The following values
                                 can be used:
                                   - A table name - use the content of that table.
                                   - NOW()        - create a fresh snapshot and overwrite the existing snapshot.
                                   - NULL         - use the last stored snapshot.
                 * delta         The table name is mandatory and specified the reference view to compare the currently
                                 stored snapshot against. If no snapshot exists, a new will be created.
                 * create_table  The name of the regular table to create.
                 * create_tmp    The name of the temporary table to create.
                 * save          The name of the table to save the currently stored snapshot into.

             in_views (SET (''with_runtimes_in_95th_percentile'', ''analysis'', ''with_errors_or_warnings'',
                            ''with_full_table_scans'', ''with_sorting'', ''with_temp_tables'', ''custom''))
               Which views to include:

                 * with_runtimes_in_95th_percentile  Based on the sys.statements_with_runtimes_in_95th_percentile view
                 * analysis                          Based on the sys.statement_analysis view
                 * with_errors_or_warnings           Based on the sys.statements_with_errors_or_warnings view
                 * with_full_table_scans             Based on the sys.statements_with_full_table_scans view
                 * with_sorting                      Based on the sys.statements_with_sorting view
                 * with_temp_tables                  Based on the sys.statements_with_temp_tables view
                 * custom                            Use a custom view. This view must be specified in @sys.statement_performance_analyzer.view to an existing view or a query

             Default is to include all except ''custom''.


             Configuration Options
             ----------------------

             sys.statement_performance_analyzer.limit
               The maximum number of rows to include for the views that does not have a built-in limit (e.g. the 95th percentile view).
               If not set the limit is 100.

             sys.statement_performance_analyzer.view
               Used together with the ''custom'' view. If the value contains a space, it is considered a query, otherwise it must be
               an existing view querying the performance_schema.events_statements_summary_by_digest table. There cannot be any limit
               clause including in the query or view definition if @sys.statement_performance_analyzer.limit > 0.
               If specifying a view, use the same format as for in_table.

             sys.debug
               Whether to provide debugging output.
               Default is ''OFF''. Set to ''ON'' to include.


             Example
             --------

             To create a report with the queries in the 95th percentile since last truncate of performance_schema.events_statements_summary_by_digest
             and the delta for a 1 minute period:

                1. Create a temporary table to store the initial snapshot.
                2. Create the initial snapshot.
                3. Save the initial snapshot in the temporary table.
                4. Wait one minute.
                5. Create a new snapshot.
                6. Perform analyzis based on the new snapshot.
                7. Perform analyzis based on the delta between the initial and new snapshots.

             mysql> CALL sys.statement_performance_analyzer(''create_tmp'', ''mydb.tmp_digests_ini'', NULL);
             Query OK, 0 rows affected (0.08 sec)

             mysql> CALL sys.statement_performance_analyzer(''snapshot'', NULL, NULL);
             Query OK, 0 rows affected (0.02 sec)

             mysql> CALL sys.statement_performance_analyzer(''save'', ''mydb.tmp_digests_ini'', NULL);
             Query OK, 0 rows affected (0.00 sec)

             mysql> DO SLEEP(60);
             Query OK, 0 rows affected (1 min 0.00 sec)

             mysql> CALL sys.statement_performance_analyzer(''snapshot'', NULL, NULL);
             Query OK, 0 rows affected (0.02 sec)

             mysql> CALL sys.statement_performance_analyzer(''overall'', NULL, ''with_runtimes_in_95th_percentile'');
             +-----------------------------------------+
             | Next Output                             |
             +-----------------------------------------+
             | Queries with Runtime in 95th Percentile |
             +-----------------------------------------+
             1 row in set (0.05 sec)

             ...

             mysql> CALL sys.statement_performance_analyzer(''delta'', ''mydb.tmp_digests_ini'', ''with_runtimes_in_95th_percentile'');
             +-----------------------------------------+
             | Next Output                             |
             +-----------------------------------------+
             | Queries with Runtime in 95th Percentile |
             +-----------------------------------------+
             1 row in set (0.03 sec)

             ...


             To create an overall report of the 95th percentile queries and the top 10 queries with full table scans:

             mysql> CALL sys.statement_performance_analyzer(''snapshot'', NULL, NULL);
             Query OK, 0 rows affected (0.01 sec)                                   

             mysql> SET @sys.statement_performance_analyzer.limit = 10;
             Query OK, 0 rows affected (0.00 sec)          

             mysql> CALL sys.statement_performance_analyzer(''overall'', NULL, ''with_runtimes_in_95th_percentile,with_full_table_scans'');
             +-----------------------------------------+
             | Next Output                             |
             +-----------------------------------------+
             | Queries with Runtime in 95th Percentile |
             +-----------------------------------------+
             1 row in set (0.01 sec)

             ...

             +-------------------------------------+
             | Next Output                         |
             +-------------------------------------+
             | Top 10 Queries with Full Table Scan |
             +-------------------------------------+
             1 row in set (0.09 sec)

             ...


             Use a custom view showing the top 10 query sorted by total execution time refreshing the view every minute using
             the watch command in Linux.

             mysql> CREATE OR REPLACE VIEW mydb.my_statements AS
                 -> SELECT sys.format_statement(DIGEST_TEXT) AS query,
                 ->        SCHEMA_NAME AS db,
                 ->        COUNT_STAR AS exec_count,
                 ->        sys.format_time(SUM_TIMER_WAIT) AS total_latency,
                 ->        sys.format_time(AVG_TIMER_WAIT) AS avg_latency,
                 ->        ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,
                 ->        ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg,
                 ->        ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0)) AS rows_affected_avg,
                 ->        DIGEST AS digest
                 ->   FROM performance_schema.events_statements_summary_by_digest
                 -> ORDER BY SUM_TIMER_WAIT DESC;
             Query OK, 0 rows affected (0.01 sec)

             mysql> CALL sys.statement_performance_analyzer(''create_table'', ''mydb.digests_prev'', NULL);
             Query OK, 0 rows affected (0.10 sec)

             shell$ watch -n 60 "mysql sys --table -e \"
             > SET @sys.statement_performance_analyzer.view = ''mydb.my_statements'';
             > SET @sys.statement_performance_analyzer.limit = 10;
             > CALL statement_performance_analyzer(''snapshot'', NULL, NULL);
             > CALL statement_performance_analyzer(''delta'', ''mydb.digests_prev'', ''custom'');
             > CALL statement_performance_analyzer(''save'', ''mydb.digests_prev'', NULL);
             > \""

             Every 60.0s: mysql sys --table -e "                                                                                                   ...  Mon Dec 22 10:58:51 2014

             +----------------------------------+
             | Next Output                      |
             +----------------------------------+
             | Top 10 Queries Using Custom View |
             +----------------------------------+
             +-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+
             | query             | db    | exec_count | total_latency | avg_latency | rows_sent_avg | rows_examined_avg | rows_affected_avg | digest                           |
             +-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+
             ...
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    CONTAINS SQL
BEGIN
    DECLARE v_table_exists, v_tmp_digests_table_exists, v_custom_view_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY') DEFAULT '';
    DECLARE v_this_thread_enabled ENUM('YES', 'NO');
    DECLARE v_force_new_snapshot BOOLEAN DEFAULT FALSE;
    DECLARE v_digests_table VARCHAR(133);
    DECLARE v_quoted_table, v_quoted_custom_view VARCHAR(133) DEFAULT '';
    DECLARE v_table_db, v_table_name, v_custom_db, v_custom_name VARCHAR(64);
    DECLARE v_digest_table_template, v_checksum_ref, v_checksum_table text;
    DECLARE v_sql longtext;
    -- Maximum supported length for MESSAGE_TEXT with the SIGNAL command is 128 chars.
    DECLARE v_error_msg VARCHAR(128);


    -- Don't instrument this thread
    SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();
    IF (v_this_thread_enabled = 'YES') THEN
        CALL sys.ps_setup_disable_thread(CONNECTION_ID());
    END IF;

    -- Temporary table are used - disable sql_log_bin if necessary to prevent them replicating
    SET @log_bin := @@sql_log_bin;
    IF (@log_bin = 1) THEN
        SET sql_log_bin = 0;
    END IF;


    -- Set configuration options
    IF (@sys.statement_performance_analyzer.limit IS NULL) THEN
        SET @sys.statement_performance_analyzer.limit = sys.sys_get_config('statement_performance_analyzer.limit', '100');
    END IF;
    IF (@sys.debug IS NULL) THEN
        SET @sys.debug                                = sys.sys_get_config('debug'                               , 'OFF');
    END IF;


    -- If in_table is set, break in_table into a db and table component and check whether it exists
    -- in_table = NOW() is considered like it's not set.
    IF (in_table = 'NOW()') THEN
        SET v_force_new_snapshot = TRUE,
            in_table             = NULL;
    ELSEIF (in_table IS NOT NULL) THEN
        IF (NOT INSTR(in_table, '.')) THEN
            -- No . in the table name - use current database
            -- DATABASE() will be the database of the procedure
            SET v_table_db   = DATABASE(),
                v_table_name = in_table;
        ELSE
            SET v_table_db   = SUBSTRING_INDEX(in_table, '.', 1);
            SET v_table_name = SUBSTRING(in_table, CHAR_LENGTH(v_table_db)+2);
        END IF;

        SET v_quoted_table = CONCAT('`', v_table_db, '`.`', v_table_name, '`');

        IF (@sys.debug = 'ON') THEN
            SELECT CONCAT('in_table is: db = ''', v_table_db, ''', table = ''', v_table_name, '''') AS 'Debug';
        END IF;

        IF (v_table_db = DATABASE() AND (v_table_name = 'tmp_digests' OR v_table_name = 'tmp_digests_delta')) THEN
            SET v_error_msg = CONCAT('Invalid value for in_table: ', v_quoted_table, ' is reserved table name.');
            SIGNAL SQLSTATE '45000'
               SET MESSAGE_TEXT = v_error_msg;
        END IF;

        CALL sys.table_exists(v_table_db, v_table_name, v_table_exists);
        IF (@sys.debug = 'ON') THEN
            SELECT CONCAT('v_table_exists = ', v_table_exists) AS 'Debug';
        END IF;

        IF (v_table_exists = 'BASE TABLE') THEN
            -- Verify that the table has the correct table definition
            -- This can only be done for base tables as temporary aren't in information_schema.COLUMNS.
            -- This also minimises the risk of using a production table.
            SET v_checksum_ref = (
                 SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum
                   FROM information_schema.COLUMNS
                  WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'events_statements_summary_by_digest'
                ),
                v_checksum_table = (
                 SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum
                   FROM information_schema.COLUMNS
                  WHERE TABLE_SCHEMA = v_table_db AND TABLE_NAME = v_table_name
                );

            IF (v_checksum_ref <> v_checksum_table) THEN
                -- The table does not have the correct definition, so abandon
                SET v_error_msg = CONCAT('The table ',
                                         IF(CHAR_LENGTH(v_quoted_table) > 93, CONCAT('...', SUBSTRING(v_quoted_table, -90)), v_quoted_table),
                                         ' has the wrong definition.');
                SIGNAL SQLSTATE '45000'
                   SET MESSAGE_TEXT = v_error_msg;
            END IF;
        END IF;
    END IF;


    IF (in_views IS NULL OR in_views = '') THEN
        -- Set to default
        SET in_views = 'with_runtimes_in_95th_percentile,analysis,with_errors_or_warnings,with_full_table_scans,with_sorting,with_temp_tables';
    END IF;


    -- Validate settings
    CALL sys.table_exists(DATABASE(), 'tmp_digests', v_tmp_digests_table_exists);
    IF (@sys.debug = 'ON') THEN
        SELECT CONCAT('v_tmp_digests_table_exists = ', v_tmp_digests_table_exists) AS 'Debug';
    END IF;

    CASE
        WHEN in_action IN ('snapshot', 'overall') THEN
            -- in_table must be NULL, NOW(), or an existing table
            IF (in_table IS NOT NULL) THEN
                IF (NOT v_table_exists IN ('TEMPORARY', 'BASE TABLE')) THEN
                    SET v_error_msg = CONCAT('The ', in_action, ' action requires in_table to be NULL, NOW() or specify an existing table.',
                                             ' The table ',
                                             IF(CHAR_LENGTH(v_quoted_table) > 16, CONCAT('...', SUBSTRING(v_quoted_table, -13)), v_quoted_table),
                                             ' does not exist.');
                    SIGNAL SQLSTATE '45000'
                       SET MESSAGE_TEXT = v_error_msg;
                END IF;
            END IF;

        WHEN in_action IN ('delta', 'save') THEN
            -- in_table must be an existing table
            IF (v_table_exists NOT IN ('TEMPORARY', 'BASE TABLE')) THEN
                SET v_error_msg = CONCAT('The ', in_action, ' action requires in_table to be an existing table.',
                                         IF(in_table IS NOT NULL, CONCAT(' The table ',
                                             IF(CHAR_LENGTH(v_quoted_table) > 39, CONCAT('...', SUBSTRING(v_quoted_table, -36)), v_quoted_table),
                                             ' does not exist.'), ''));
                SIGNAL SQLSTATE '45000'
                   SET MESSAGE_TEXT = v_error_msg;
            END IF;
            
            IF (in_action = 'delta' AND v_tmp_digests_table_exists <> 'TEMPORARY') THEN
                SIGNAL SQLSTATE '45000'
                   SET MESSAGE_TEXT = 'An existing snapshot generated with the statement_performance_analyzer() must exist.';
            END IF;
        WHEN in_action = 'create_tmp' THEN
            -- in_table must not exists as a temporary table
            IF (v_table_exists = 'TEMPORARY') THEN
                SET v_error_msg = CONCAT('Cannot create the table ',
                                         IF(CHAR_LENGTH(v_quoted_table) > 72, CONCAT('...', SUBSTRING(v_quoted_table, -69)), v_quoted_table),
                                         ' as it already exists.');
                SIGNAL SQLSTATE '45000'
                   SET MESSAGE_TEXT = v_error_msg;
            END IF;

        WHEN in_action = 'create_table' THEN
            -- in_table must not exists at all
            IF (v_table_exists <> '') THEN
                SET v_error_msg = CONCAT('Cannot create the table ',
                                         IF(CHAR_LENGTH(v_quoted_table) > 52, CONCAT('...', SUBSTRING(v_quoted_table, -49)), v_quoted_table),
                                         ' as it already exists',
                                         IF(v_table_exists = 'TEMPORARY', ' as a temporary table.', '.'));
                SIGNAL SQLSTATE '45000'
                   SET MESSAGE_TEXT = v_error_msg;
            END IF;

        WHEN in_action = 'cleanup' THEN
            -- doesn't use any of the arguments 
            DO (SELECT 1);
        ELSE
            SIGNAL SQLSTATE '45000'
               SET MESSAGE_TEXT = 'Unknown action. Supported actions are: cleanup, create_table, create_tmp, delta, overall, save, snapshot';
    END CASE;

    SET v_digest_table_template = 'CREATE %{TEMPORARY}TABLE %{TABLE_NAME} (
  `SCHEMA_NAME` varchar(64) DEFAULT NULL,
  `DIGEST` varchar(32) DEFAULT NULL,
  `DIGEST_TEXT` longtext,
  `COUNT_STAR` bigint(20) unsigned NOT NULL,
  `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
  `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
  `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
  `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
  `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
  `SUM_ERRORS` bigint(20) unsigned NOT NULL,
  `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
  `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
  `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
  `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
  `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
  `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
  `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
  `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
  `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
  `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
  `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
  `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
  `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
  `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
  `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
  `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
  `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
  `FIRST_SEEN` timestamp NULL DEFAULT NULL,
  `LAST_SEEN` timestamp NULL DEFAULT NULL,
  INDEX (SCHEMA_NAME, DIGEST)
) DEFAULT CHARSET=utf8';

    -- Do the action
    -- The actions snapshot, ... requires a fresh snapshot - create it now
    IF (v_force_new_snapshot
           OR in_action = 'snapshot'
           OR (in_action = 'overall' AND in_table IS NULL)
           OR (in_action = 'save' AND v_tmp_digests_table_exists <> 'TEMPORARY')
       ) THEN
        IF (v_tmp_digests_table_exists = 'TEMPORARY') THEN
            IF (@sys.debug = 'ON') THEN
                SELECT 'DROP TEMPORARY TABLE IF EXISTS tmp_digests' AS 'Debug';
            END IF;
            DROP TEMPORARY TABLE IF EXISTS tmp_digests;
        END IF;
        CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, '%{TEMPORARY}', 'TEMPORARY '), '%{TABLE_NAME}', 'tmp_digests'));

        SET v_sql = CONCAT('INSERT INTO tmp_digests SELECT * FROM ',
                           IF(in_table IS NULL OR in_action = 'save', 'performance_schema.events_statements_summary_by_digest', v_quoted_table));
        CALL sys.execute_prepared_stmt(v_sql);
    END IF;

    -- Go through the remaining actions
    IF (in_action IN ('create_table', 'create_tmp')) THEN
        IF (in_action = 'create_table') THEN
            CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, '%{TEMPORARY}', ''), '%{TABLE_NAME}', v_quoted_table));
        ELSE
            CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, '%{TEMPORARY}', 'TEMPORARY '), '%{TABLE_NAME}', v_quoted_table));
        END IF;
    ELSEIF (in_action = 'save') THEN
        CALL sys.execute_prepared_stmt(CONCAT('DELETE FROM ', v_quoted_table));
        CALL sys.execute_prepared_stmt(CONCAT('INSERT INTO ', v_quoted_table, ' SELECT * FROM tmp_digests'));
    ELSEIF (in_action = 'cleanup') THEN
        DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests;
        DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests_delta;
    ELSEIF (in_action IN ('overall', 'delta')) THEN
        -- These are almost the same - for delta calculate the delta in tmp_digests_delta and use that instead of tmp_digests.
        -- And overall allows overriding the table to use.
        IF (in_action = 'overall') THEN
            IF (in_table IS NULL) THEN
                SET v_digests_table = 'tmp_digests';
            ELSE
                SET v_digests_table = v_quoted_table;
            END IF;
        ELSE
            SET v_digests_table = 'tmp_digests_delta';
            DROP TEMPORARY TABLE IF EXISTS tmp_digests_delta;
            CREATE TEMPORARY TABLE tmp_digests_delta LIKE tmp_digests;
            SET v_sql = CONCAT('INSERT INTO tmp_digests_delta
SELECT `d_end`.`SCHEMA_NAME`,
       `d_end`.`DIGEST`,
       `d_end`.`DIGEST_TEXT`,
       `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) AS ''COUNT_STAR'',
       `d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0) AS ''SUM_TIMER_WAIT'',
       `d_end`.`MIN_TIMER_WAIT` AS ''MIN_TIMER_WAIT'',
       IFNULL((`d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0))/NULLIF(`d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0), 0), 0) AS ''AVG_TIMER_WAIT'',
       `d_end`.`MAX_TIMER_WAIT` AS ''MAX_TIMER_WAIT'',
       `d_end`.`SUM_LOCK_TIME`-IFNULL(`d_start`.`SUM_LOCK_TIME`, 0) AS ''SUM_LOCK_TIME'',
       `d_end`.`SUM_ERRORS`-IFNULL(`d_start`.`SUM_ERRORS`, 0) AS ''SUM_ERRORS'',
       `d_end`.`SUM_WARNINGS`-IFNULL(`d_start`.`SUM_WARNINGS`, 0) AS ''SUM_WARNINGS'',
       `d_end`.`SUM_ROWS_AFFECTED`-IFNULL(`d_start`.`SUM_ROWS_AFFECTED`, 0) AS ''SUM_ROWS_AFFECTED'',
       `d_end`.`SUM_ROWS_SENT`-IFNULL(`d_start`.`SUM_ROWS_SENT`, 0) AS ''SUM_ROWS_SENT'',
       `d_end`.`SUM_ROWS_EXAMINED`-IFNULL(`d_start`.`SUM_ROWS_EXAMINED`, 0) AS ''SUM_ROWS_EXAMINED'',
       `d_end`.`SUM_CREATED_TMP_DISK_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_DISK_TABLES`, 0) AS ''SUM_CREATED_TMP_DISK_TABLES'',
       `d_end`.`SUM_CREATED_TMP_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_TABLES`, 0) AS ''SUM_CREATED_TMP_TABLES'',
       `d_end`.`SUM_SELECT_FULL_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_JOIN`, 0) AS ''SUM_SELECT_FULL_JOIN'',
       `d_end`.`SUM_SELECT_FULL_RANGE_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_RANGE_JOIN`, 0) AS ''SUM_SELECT_FULL_RANGE_JOIN'',
       `d_end`.`SUM_SELECT_RANGE`-IFNULL(`d_start`.`SUM_SELECT_RANGE`, 0) AS ''SUM_SELECT_RANGE'',
       `d_end`.`SUM_SELECT_RANGE_CHECK`-IFNULL(`d_start`.`SUM_SELECT_RANGE_CHECK`, 0) AS ''SUM_SELECT_RANGE_CHECK'',
       `d_end`.`SUM_SELECT_SCAN`-IFNULL(`d_start`.`SUM_SELECT_SCAN`, 0) AS ''SUM_SELECT_SCAN'',
       `d_end`.`SUM_SORT_MERGE_PASSES`-IFNULL(`d_start`.`SUM_SORT_MERGE_PASSES`, 0) AS ''SUM_SORT_MERGE_PASSES'',
       `d_end`.`SUM_SORT_RANGE`-IFNULL(`d_start`.`SUM_SORT_RANGE`, 0) AS ''SUM_SORT_RANGE'',
       `d_end`.`SUM_SORT_ROWS`-IFNULL(`d_start`.`SUM_SORT_ROWS`, 0) AS ''SUM_SORT_ROWS'',
       `d_end`.`SUM_SORT_SCAN`-IFNULL(`d_start`.`SUM_SORT_SCAN`, 0) AS ''SUM_SORT_SCAN'',
       `d_end`.`SUM_NO_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_INDEX_USED`, 0) AS ''SUM_NO_INDEX_USED'',
       `d_end`.`SUM_NO_GOOD_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_GOOD_INDEX_USED`, 0) AS ''SUM_NO_GOOD_INDEX_USED'',
       `d_end`.`FIRST_SEEN`,
       `d_end`.`LAST_SEEN`
  FROM tmp_digests d_end
       LEFT OUTER JOIN ', v_quoted_table, ' d_start ON `d_start`.`DIGEST` = `d_end`.`DIGEST`
                                                    AND (`d_start`.`SCHEMA_NAME` = `d_end`.`SCHEMA_NAME`
                                                          OR (`d_start`.`SCHEMA_NAME` IS NULL AND `d_end`.`SCHEMA_NAME` IS NULL)
                                                        )
 WHERE `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) > 0');
            CALL sys.execute_prepared_stmt(v_sql);
        END IF;

        IF (FIND_IN_SET('with_runtimes_in_95th_percentile', in_views)) THEN
            SELECT 'Queries with Runtime in 95th Percentile' AS 'Next Output';

            DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution1;
            DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution2;
            DROP TEMPORARY TABLE IF EXISTS tmp_digest_95th_percentile_by_avg_us;

            CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution1 (
              cnt bigint unsigned NOT NULL,
              avg_us decimal(21,0) NOT NULL,
              PRIMARY KEY (avg_us)
            ) ENGINE=InnoDB;

            SET v_sql = CONCAT('INSERT INTO tmp_digest_avg_latency_distribution1
SELECT COUNT(*) cnt, 
       ROUND(avg_timer_wait/1000000) AS avg_us
  FROM ', v_digests_table, '
 GROUP BY avg_us');
            CALL sys.execute_prepared_stmt(v_sql);

            CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution2 LIKE tmp_digest_avg_latency_distribution1;
            INSERT INTO tmp_digest_avg_latency_distribution2 SELECT * FROM tmp_digest_avg_latency_distribution1;

            CREATE TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us (
              avg_us decimal(21,0) NOT NULL,
              percentile decimal(46,4) NOT NULL,
              PRIMARY KEY (avg_us)
            ) ENGINE=InnoDB;

            SET v_sql = CONCAT('INSERT INTO tmp_digest_95th_percentile_by_avg_us
SELECT s2.avg_us avg_us,
       IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM ', v_digests_table, '), 0), 0) percentile
  FROM tmp_digest_avg_latency_distribution1 AS s1
       JOIN tmp_digest_avg_latency_distribution2 AS s2 ON s1.avg_us <= s2.avg_us
 GROUP BY s2.avg_us
HAVING percentile > 0.95
 ORDER BY percentile
 LIMIT 1');
            CALL sys.execute_prepared_stmt(v_sql);

            SET v_sql =
                REPLACE(
                    REPLACE(
                        (SELECT VIEW_DEFINITION
                           FROM information_schema.VIEWS
                          WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_runtimes_in_95th_percentile'
                        ),
                        '`performance_schema`.`events_statements_summary_by_digest`',
                        v_digests_table
                    ),
                    'sys.x$ps_digest_95th_percentile_by_avg_us',
                    '`sys`.`x$ps_digest_95th_percentile_by_avg_us`'
              );
            CALL sys.execute_prepared_stmt(v_sql);

            DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution1;
            DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution2;
            DROP TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us;
        END IF;

        IF (FIND_IN_SET('analysis', in_views)) THEN
            SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries Ordered by Total Latency') AS 'Next Output';
            SET v_sql =
                REPLACE(
                    (SELECT VIEW_DEFINITION
                       FROM information_schema.VIEWS
                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statement_analysis'
                    ),
                    '`performance_schema`.`events_statements_summary_by_digest`',
                    v_digests_table
                );
            IF (@sys.statement_performance_analyzer.limit > 0) THEN
                SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit);
            END IF;
            CALL sys.execute_prepared_stmt(v_sql);
        END IF;

        IF (FIND_IN_SET('with_errors_or_warnings', in_views)) THEN
            SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Errors') AS 'Next Output';
            SET v_sql =
                REPLACE(
                    (SELECT VIEW_DEFINITION
                       FROM information_schema.VIEWS
                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_errors_or_warnings'
                    ),
                    '`performance_schema`.`events_statements_summary_by_digest`',
                    v_digests_table
                );
            IF (@sys.statement_performance_analyzer.limit > 0) THEN
                SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit);
            END IF;
            CALL sys.execute_prepared_stmt(v_sql);
        END IF;

        IF (FIND_IN_SET('with_full_table_scans', in_views)) THEN
            SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Full Table Scan') AS 'Next Output';
            SET v_sql =
                REPLACE(
                    (SELECT VIEW_DEFINITION
                       FROM information_schema.VIEWS
                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_full_table_scans'
                    ),
                    '`performance_schema`.`events_statements_summary_by_digest`',
                    v_digests_table
                );
            IF (@sys.statement_performance_analyzer.limit > 0) THEN
                SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit);
            END IF;
            CALL sys.execute_prepared_stmt(v_sql);
        END IF;

        IF (FIND_IN_SET('with_sorting', in_views)) THEN
            SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Sorting') AS 'Next Output';
            SET v_sql =
                REPLACE(
                    (SELECT VIEW_DEFINITION
                       FROM information_schema.VIEWS
                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_sorting'
                    ),
                    '`performance_schema`.`events_statements_summary_by_digest`',
                    v_digests_table
                );
            IF (@sys.statement_performance_analyzer.limit > 0) THEN
                SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit);
            END IF;
            CALL sys.execute_prepared_stmt(v_sql);
        END IF;

        IF (FIND_IN_SET('with_temp_tables', in_views)) THEN
            SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Internal Temporary Tables') AS 'Next Output';
            SET v_sql =
                REPLACE(
                    (SELECT VIEW_DEFINITION
                       FROM information_schema.VIEWS
                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_temp_tables'
                    ),
                    '`performance_schema`.`events_statements_summary_by_digest`',
                    v_digests_table
                );
            IF (@sys.statement_performance_analyzer.limit > 0) THEN
                SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit);
            END IF;
            CALL sys.execute_prepared_stmt(v_sql);
        END IF;

        IF (FIND_IN_SET('custom', in_views)) THEN
            SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries Using Custom View') AS 'Next Output';

            IF (@sys.statement_performance_analyzer.view IS NULL) THEN
                SET @sys.statement_performance_analyzer.view = sys.sys_get_config('statement_performance_analyzer.view', NULL);
            END IF;
            IF (@sys.statement_performance_analyzer.view IS NULL) THEN
                SIGNAL SQLSTATE '45000'
                   SET MESSAGE_TEXT = 'The @sys.statement_performance_analyzer.view user variable must be set with the view or query to use.';
            END IF;

            IF (NOT INSTR(@sys.statement_performance_analyzer.view, ' ')) THEN
                -- No spaces, so can't be a query
                IF (NOT INSTR(@sys.statement_performance_analyzer.view, '.')) THEN
                    -- No . in the table name - use current database
                    -- DATABASE() will be the database of the procedure
                    SET v_custom_db   = DATABASE(),
                        v_custom_name = @sys.statement_performance_analyzer.view;
                ELSE
                    SET v_custom_db   = SUBSTRING_INDEX(@sys.statement_performance_analyzer.view, '.', 1);
                    SET v_custom_name = SUBSTRING(@sys.statement_performance_analyzer.view, CHAR_LENGTH(v_custom_db)+2);
                END IF;

                CALL sys.table_exists(v_custom_db, v_custom_name, v_custom_view_exists);
                IF (v_custom_view_exists <> 'VIEW') THEN
                    SIGNAL SQLSTATE '45000'
                       SET MESSAGE_TEXT = 'The @sys.statement_performance_analyzer.view user variable is set but specified neither an existing view nor a query.';
                END IF;

                SET v_sql =
                    REPLACE(
                        (SELECT VIEW_DEFINITION
                           FROM information_schema.VIEWS
                          WHERE TABLE_SCHEMA = v_custom_db AND TABLE_NAME = v_custom_name
                        ),
                        '`performance_schema`.`events_statements_summary_by_digest`',
                        v_digests_table
                    );
            ELSE
                SET v_sql = REPLACE(@sys.statement_performance_analyzer.view, '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table);
            END IF;

            IF (@sys.statement_performance_analyzer.limit > 0) THEN
                SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit);
            END IF;

            CALL sys.execute_prepared_stmt(v_sql);
        END IF;
    END IF;

    -- Restore INSTRUMENTED for this thread
    IF (v_this_thread_enabled = 'YES') THEN
        CALL sys.ps_setup_enable_thread(CONNECTION_ID());
    END IF;

    IF (@log_bin = 1) THEN
        SET sql_log_bin = @log_bin;
    END IF;
END$$

DELIMITER ;
-- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-- 
-- 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-1301 USA

DROP PROCEDURE IF EXISTS table_exists;

DELIMITER $$

CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE table_exists (
        IN in_db VARCHAR(64), IN in_table VARCHAR(64),
        OUT out_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY', 'SEQUENCE', 'SYSTEM VIEW')
    )
    COMMENT '
             Description
             -----------

             Tests whether the table specified in in_db and in_table exists either as a regular
             table, or as a temporary table. The returned value corresponds to the table that
             will be used, so if there''s both a temporary and a permanent table with the given
             name, then ''TEMPORARY'' will be returned.

             Parameters
             -----------

             in_db (VARCHAR(64)):
               The database name to check for the existence of the table in.

             in_table (VARCHAR(64)):
               The name of the table to check the existence of.

             out_exists ENUM('''', ''BASE TABLE'', ''VIEW'', ''TEMPORARY''):
               The return value: whether the table exists. The value is one of:
                 * ''''             - the table does not exist neither as a base table, view, sequence nor temporary table.
                 * ''BASE TABLE''   - the table name exists as a permanent base table table.
                 * ''VIEW''         - the table name exists as a view.
                 * ''TEMPORARY''    - the table name exists as a temporary table.
                 * ''SEQUENCE''     - the table name exists as a sequence.
                 * ''SYSTEM VIEW''  - the table name exists as a system view.

             Example
             --------

             mysql> CREATE DATABASE db1;
             Query OK, 1 row affected (0.07 sec)

             mysql> use db1;
             Database changed
             mysql> CREATE TABLE t1 (id INT PRIMARY KEY);
             Query OK, 0 rows affected (0.08 sec)
             
             mysql> CREATE TABLE t2 (id INT PRIMARY KEY);
             Query OK, 0 rows affected (0.08 sec)
             
             mysql> CREATE view v_t1 AS SELECT * FROM t1;
             Query OK, 0 rows affected (0.00 sec)
             
             mysql> CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
             Query OK, 0 rows affected (0.00 sec)
             
             mysql> CALL sys.table_exists(''db1'', ''t1'', @exists); SELECT @exists;
             Query OK, 0 rows affected (0.00 sec)

             +------------+
             | @exists    |
             +------------+
             | TEMPORARY  |
             +------------+
             1 row in set (0.00 sec)
             
             mysql> CALL sys.table_exists(''db1'', ''t2'', @exists); SELECT @exists;
             Query OK, 0 rows affected (0.00 sec)
             
             +------------+
             | @exists    |
             +------------+
             | BASE TABLE |
             +------------+
             1 row in set (0.01 sec)

             mysql> CALL sys.table_exists(''db1'', ''v_t1'', @exists); SELECT @exists;
             Query OK, 0 rows affected (0.00 sec)

             +---------+
             | @exists |
             +---------+
             | VIEW    |
             +---------+
             1 row in set (0.00 sec)

             MariaDB [sys]> CALL sys.table_exists(''db1'', ''s'', @exists); SELECT @exists;
             Query OK, 0 rows affected (0.006 sec)

             +----------+
             | @exists  |
             +----------+
             | SEQUENCE |
             +----------+
             1 row in set (0.000 sec)

             MariaDB [sys]> CALL table_exists(''information_schema'', ''user_variables'', @exists); SELECT @exists;
             Query OK, 0 rows affected (0.003 sec)

             +-------------+
             | @exists     |
             +-------------+
             | SYSTEM VIEW |
             +-------------+
             1 row in set (0.001 sec)

             mysql> CALL sys.table_exists(''db1'', ''t3'', @exists); SELECT @exists;
             Query OK, 0 rows affected (0.01 sec)

             +---------+
             | @exists |
             +---------+
             |         |
             +---------+
             1 row in set (0.00 sec)
            '
    SQL SECURITY INVOKER
    NOT DETERMINISTIC
    CONTAINS SQL
BEGIN
    DECLARE v_error BOOLEAN DEFAULT FALSE;
    DECLARE db_quoted VARCHAR(64);
    DECLARE table_quoted VARCHAR(64);
    DECLARE v_table_type VARCHAR(16) DEFAULT '';
    DECLARE v_system_db BOOLEAN
        DEFAULT LOWER(in_db) IN ('information_schema', 'performance_schema');
    DECLARE CONTINUE HANDLER FOR 1050 SET v_error = TRUE;
    DECLARE CONTINUE HANDLER FOR 1146 SET v_error = TRUE;

    SET out_exists = '';
    SET db_quoted = sys.quote_identifier(in_db);
    SET table_quoted = sys.quote_identifier(in_table);

    -- Verify whether the table name exists as a normal table
    IF (EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table)) THEN
        -- Unfortunately the only way to determine whether there is also a temporary table is to try to create
        -- a temporary table with the same name. If it succeeds the table didn't exist as a temporary table.
        IF v_system_db = FALSE THEN
            SET @sys.tmp.table_exists.SQL = CONCAT('CREATE TEMPORARY TABLE ',
                                                    db_quoted,
                                                    '.',
                                                    table_quoted,
                                                    '(id INT PRIMARY KEY)');
            PREPARE stmt_create_table FROM @sys.tmp.table_exists.SQL;
            EXECUTE stmt_create_table;
            DEALLOCATE PREPARE stmt_create_table;

            -- The temporary table was created, i.e. it didn't exist. Remove it again so we don't leave garbage around.
            SET @sys.tmp.table_exists.SQL = CONCAT('DROP TEMPORARY TABLE ',
                                                                db_quoted,
                                                                '.',
                                                                table_quoted);
            PREPARE stmt_drop_table FROM @sys.tmp.table_exists.SQL;
            EXECUTE stmt_drop_table;
            DEALLOCATE PREPARE stmt_drop_table;
        END IF;
        IF (v_error) THEN
            SET out_exists = 'TEMPORARY';
        ELSE
            SET v_table_type = (SELECT TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table);
            -- Don't fail on table_type='SYSTEM VERSIONED'
            -- but return 'BASE TABLE' for compatibility with existing tooling
            IF v_table_type = 'SYSTEM VERSIONED' THEN
                SET out_exists = 'BASE TABLE';
            ELSE
                SET out_exists = v_table_type;
            END IF;
        END IF;
    ELSE
        -- Check whether a temporary table exists with the same name.
        -- If it does it's possible to SELECT from the table without causing an error.
        -- If it does not exist even a PREPARE using the table will fail.
        IF v_system_db = FALSE THEN
            SET @sys.tmp.table_exists.SQL = CONCAT('SELECT COUNT(*) FROM ',
                                                            db_quoted,
                                                            '.',
                                                            table_quoted);
            PREPARE stmt_select FROM @sys.tmp.table_exists.SQL;
            IF (NOT v_error) THEN
                DEALLOCATE PREPARE stmt_select;
                SET out_exists = 'TEMPORARY';
            END IF;
        END IF;
    END IF;
END$$

DELIMITER ;

-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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-1301  USA

SET @@sql_log_bin = @sql_log_bin;
use mysql;



fill_help_tables.sql000064400010161221150343472770010575 0ustar00
-- Copyright (c) 2003, 2008-2012, Oracle and/or its affiliates. All rights reserved.
--
-- 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.

-- DO NOT EDIT THIS FILE. It is generated automatically.

-- To use this file, load its contents into the mysql database. For example,
-- with the mysql client program, process the file like this, where
-- file_name is the name of this file:

--     mysql -u root -p mysql < file_name

set names 'utf8';

set sql_log_bin = 0;

use mysql;
delete from help_topic;
delete from help_category;
delete from help_keyword;
delete from help_relation;

lock tables help_topic write, help_category write, help_keyword write, help_relation write;
insert into help_category (help_category_id,name,parent_category_id,url) values (1,'Contents',0,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (2,'Polygon Properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (3,'WKT',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (4,'Numeric Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (5,'Plugins',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (6,'MBR',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (7,'Control Flow Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (8,'Transactions',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (9,'Help Metadata',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (10,'Account Management',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (11,'Point Properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (12,'Encryption Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (13,'LineString Properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (14,'Miscellaneous Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (15,'Logical Operators',47,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (16,'Functions and Modifiers for Use with GROUP BY',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (17,'Information Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (18,'Assignment Operators',47,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (19,'Comparison Operators',47,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (20,'Bit Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (21,'Table Maintenance',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (22,'User-Defined Functions',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (23,'Data Types',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (24,'Compound Statements',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (25,'Geometry Constructors',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (26,'Administration',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (27,'Data Manipulation',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (28,'Utility',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (29,'Language Structure',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (30,'Geometry Relations',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (31,'Date and Time Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (32,'WKB',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (33,'Procedures',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (34,'Geographic Features',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (35,'Geometry Properties',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (36,'String Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (37,'Functions',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (38,'Data Definition',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (39,'Sequences',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (40,'JSON Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (41,'Window Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (42,'Spider Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (43,'Dynamic Column Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (44,'Galera Functions',37,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (45,'Temporal Tables',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (46,'GeoJSON',34,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (47,'Operators',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (48,'Arithmetic Operators',47,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (49,'Replication',1,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (50,'Prepared Statements',1,'');

insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,9,'HELP_DATE','Help Contents generated from the MariaDB Knowledge Base on 23 January 2023.','','');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,9,'HELP_VERSION','Help Contents generated for MariaDB 10.6 from the MariaDB Knowledge Base on 23 January 2023.','','');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,2,'AREA','A synonym for ST_AREA.\n\nURL: https://mariadb.com/kb/en/polygon-properties-area/','','https://mariadb.com/kb/en/polygon-properties-area/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,2,'CENTROID','A synonym for ST_CENTROID.\n\nURL: https://mariadb.com/kb/en/centroid/','','https://mariadb.com/kb/en/centroid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,2,'ExteriorRing','A synonym for ST_ExteriorRing.\n\nURL: https://mariadb.com/kb/en/polygon-properties-exteriorring/','','https://mariadb.com/kb/en/polygon-properties-exteriorring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,2,'InteriorRingN','A synonym for ST_InteriorRingN.\n\nURL: https://mariadb.com/kb/en/polygon-properties-interiorringn/','','https://mariadb.com/kb/en/polygon-properties-interiorringn/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,2,'NumInteriorRings','A synonym for ST_NumInteriorRings.\n\nURL: https://mariadb.com/kb/en/polygon-properties-numinteriorrings/','','https://mariadb.com/kb/en/polygon-properties-numinteriorrings/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,2,'ST_AREA','Syntax\n------\n\nST_Area(poly)\nArea(poly)\n\nDescription\n-----------\n\nReturns as a double-precision number the area of the Polygon value poly, as\nmeasured in its spatial reference system.\n\nST_Area() and Area() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\n\nSELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n|                         4 |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/st_area/','','https://mariadb.com/kb/en/st_area/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,2,'ST_CENTROID','Syntax\n------\n\nST_Centroid(mpoly)\nCentroid(mpoly)\n\nDescription\n-----------\n\nReturns a point reflecting the mathematical centroid (geometric center) for\nthe MultiPolygon mpoly. The resulting point will not necessarily be on the\nMultiPolygon.\n\nST_Centroid() and Centroid() are synonyms.\n\nExamples\n--------\n\nSET @poly = ST_GeomFromText(\'POLYGON((0 0,20 0,20 20,0 20,0 0))\');\nSELECT ST_AsText(ST_Centroid(@poly)) AS center;\n+--------------+\n| center       |\n+--------------+\n| POINT(10 10) |\n+--------------+\n\nURL: https://mariadb.com/kb/en/st_centroid/','','https://mariadb.com/kb/en/st_centroid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,2,'ST_ExteriorRing','Syntax\n------\n\nST_ExteriorRing(poly)\nExteriorRing(poly)\n\nDescription\n-----------\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nST_ExteriorRing() and ExteriorRing() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0)           |\n+-------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_exteriorring/','','https://mariadb.com/kb/en/st_exteriorring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,2,'ST_InteriorRingN','Syntax\n------\n\nST_InteriorRingN(poly,N)\nInteriorRingN(poly,N)\n\nDescription\n-----------\n\nReturns the N-th interior ring for the Polygon value poly as a LineString.\nRings are numbered beginning with 1.\n\nST_InteriorRingN() and InteriorRingN() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1)              |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_interiorringn/','','https://mariadb.com/kb/en/st_interiorringn/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,2,'ST_NumInteriorRings','Syntax\n------\n\nST_NumInteriorRings(poly)\nNumInteriorRings(poly)\n\nDescription\n-----------\n\nReturns an integer containing the number of interior rings in the Polygon\nvalue poly.\n\nNote that according the the OpenGIS standard, a POLYGON should have exactly\none ExteriorRing and all other rings should lie within that ExteriorRing and\nthus be the InteriorRings. Practically, however, some systems, including\nMariaDB\'s, permit polygons to have several \'ExteriorRings\'. In the case of\nthere being multiple, non-overlapping exterior rings ST_NumInteriorRings()\nwill return 1.\n\nST_NumInteriorRings() and NumInteriorRings() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n|                                     1 |\n+---------------------------------------+\n\nNon-overlapping \'polygon\':\n\nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n+------------------+\n| NumInteriorRings |\n+------------------+\n|                1 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/st_numinteriorrings/','','https://mariadb.com/kb/en/st_numinteriorrings/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,3,'WKT Definition','Description\n-----------\n\nThe Well-Known Text (WKT) representation of Geometry is designed to exchange\ngeometry data in ASCII form. Examples of the basic geometry types include:\n\n+-----------------------------------------------------------------------------+\n| Geometry Types                                                              |\n+-----------------------------------------------------------------------------+\n| POINT                                                                       |\n+-----------------------------------------------------------------------------+\n| LINESTRING                                                                  |\n+-----------------------------------------------------------------------------+\n| POLYGON                                                                     |\n+-----------------------------------------------------------------------------+\n| MULTIPOINT                                                                  |\n+-----------------------------------------------------------------------------+\n| MULTILINESTRING                                                             |\n+-----------------------------------------------------------------------------+\n| MULTIPOLYGON                                                                |\n+-----------------------------------------------------------------------------+\n| GEOMETRYCOLLECTION                                                          |\n+-----------------------------------------------------------------------------+\n| GEOMETRY                                                                    |\n+-----------------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/wkt-definition/','','https://mariadb.com/kb/en/wkt-definition/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,3,'AsText','A synonym for ST_AsText().\n\nURL: https://mariadb.com/kb/en/wkt-astext/','','https://mariadb.com/kb/en/wkt-astext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,3,'AsWKT','A synonym for ST_AsText().\n\nURL: https://mariadb.com/kb/en/wkt-aswkt/','','https://mariadb.com/kb/en/wkt-aswkt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,3,'GeomCollFromText','A synonym for ST_GeomCollFromText.\n\nURL: https://mariadb.com/kb/en/wkt-geomcollfromtext/','','https://mariadb.com/kb/en/wkt-geomcollfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,3,'GeometryCollectionFromText','A synonym for ST_GeomCollFromText.\n\nURL: https://mariadb.com/kb/en/geometrycollectionfromtext/','','https://mariadb.com/kb/en/geometrycollectionfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,3,'GeometryFromText','A synonym for ST_GeomFromText.\n\nURL: https://mariadb.com/kb/en/geometryfromtext/','','https://mariadb.com/kb/en/geometryfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,3,'GeomFromText','A synonym for ST_GeomFromText.\n\nURL: https://mariadb.com/kb/en/wkt-geomfromtext/','','https://mariadb.com/kb/en/wkt-geomfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,3,'LineFromText','A synonym for ST_LineFromText.\n\nURL: https://mariadb.com/kb/en/wkt-linefromtext/','','https://mariadb.com/kb/en/wkt-linefromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,3,'LineStringFromText','A synonym for ST_LineFromText.\n\nURL: https://mariadb.com/kb/en/linestringfromtext/','','https://mariadb.com/kb/en/linestringfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,3,'MLineFromText','Syntax\n------\n\nMLineFromText(wkt[,srid])\nMultiLineStringFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTILINESTRING value using its WKT representation and SRID.\n\nMLineFromText() and MultiLineStringFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\nINSERT INTO gis_multi_line VALUES\n  (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16\n23,16 48))\')),\n  (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n  (MLineFromWKB(AsWKB(MultiLineString(\n   LineString(Point(1, 2), Point(3, 5)),\n   LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));\n\nURL: https://mariadb.com/kb/en/mlinefromtext/','','https://mariadb.com/kb/en/mlinefromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,3,'MPointFromText','Syntax\n------\n\nMPointFromText(wkt[,srid])\nMultiPointFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOINT value using its WKT representation and SRID.\n\nMPointFromText() and MultiPointFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\nINSERT INTO gis_multi_point VALUES\n  (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n  (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n  (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nURL: https://mariadb.com/kb/en/mpointfromtext/','','https://mariadb.com/kb/en/mpointfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,3,'MPolyFromText','Syntax\n------\n\nMPolyFromText(wkt[,srid])\nMultiPolygonFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOLYGON value using its WKT representation and SRID.\n\nMPolyFromText() and MultiPolygonFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_polygon  (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\nINSERT INTO gis_multi_polygon VALUES\n  (MultiPolygonFromText(\'MULTIPOLYGON(\n   ((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),\n   ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromText(\'MULTIPOLYGON(\n   ((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),\n   ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(\n   LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n\nURL: https://mariadb.com/kb/en/mpolyfromtext/','','https://mariadb.com/kb/en/mpolyfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,3,'MultiLineStringFromText','A synonym for MLineFromText.\n\nURL: https://mariadb.com/kb/en/multilinestringfromtext/','','https://mariadb.com/kb/en/multilinestringfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,3,'MultiPointFromText','A synonym for MPointFromText.\n\nURL: https://mariadb.com/kb/en/multipointfromtext/','','https://mariadb.com/kb/en/multipointfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,3,'MultiPolygonFromText','A synonym for MPolyFromText.\n\nURL: https://mariadb.com/kb/en/multipolygonfromtext/','','https://mariadb.com/kb/en/multipolygonfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,3,'PointFromText','A synonym for ST_PointFromText.\n\nURL: https://mariadb.com/kb/en/wkt-pointfromtext/','','https://mariadb.com/kb/en/wkt-pointfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,3,'PolyFromText','A synonym for ST_PolyFromText.\n\nURL: https://mariadb.com/kb/en/wkt-polyfromtext/','','https://mariadb.com/kb/en/wkt-polyfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,3,'PolygonFromText','A synonym for ST_PolyFromText.\n\nURL: https://mariadb.com/kb/en/polygonfromtext/','','https://mariadb.com/kb/en/polygonfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,3,'ST_AsText','Syntax\n------\n\nST_AsText(g)\nAsText(g)\nST_AsWKT(g)\nAsWKT(g)\n\nDescription\n-----------\n\nConverts a value in internal geometry format to its WKT representation and\nreturns the string result.\n\nST_AsText(), AsText(), ST_AsWKT() and AsWKT() are all synonyms.\n\nExamples\n--------\n\nSET @g = \'LineString(1 1,4 4,6 6)\';\n\nSELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,4 4,6 6)        |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/st_astext/','','https://mariadb.com/kb/en/st_astext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (32,3,'ST_ASWKT','A synonym for ST_ASTEXT().\n\nURL: https://mariadb.com/kb/en/st_aswkt/','','https://mariadb.com/kb/en/st_aswkt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (33,3,'ST_GeomCollFromText','Syntax\n------\n\nST_GeomCollFromText(wkt[,srid])\nST_GeometryCollectionFromText(wkt[,srid])\nGeomCollFromText(wkt[,srid])\nGeometryCollectionFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a GEOMETRYCOLLECTION value using its WKT representation and SRID.\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(), GeomCollFromText() and\nGeometryCollectionFromText() are all synonyms.\n\nExample\n-------\n\nCREATE TABLE gis_geometrycollection  (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n  (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n  (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n  (GeomFromText(\'GeometryCollection()\')),\n  (GeomFromText(\'GeometryCollection EMPTY\'));\n\nURL: https://mariadb.com/kb/en/st_geomcollfromtext/','','https://mariadb.com/kb/en/st_geomcollfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (34,3,'ST_GeometryCollectionFromText','A synonym for ST_GeomCollFromText.\n\nURL: https://mariadb.com/kb/en/st_geometrycollectionfromtext/','','https://mariadb.com/kb/en/st_geometrycollectionfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (35,3,'ST_GeometryFromText','A synonym for ST_GeomFromText.\n\nURL: https://mariadb.com/kb/en/st_geometryfromtext/','','https://mariadb.com/kb/en/st_geometryfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (36,3,'ST_GeomFromText','Syntax\n------\n\nST_GeomFromText(wkt[,srid])\nST_GeometryFromText(wkt[,srid])\nGeomFromText(wkt[,srid])\nGeometryFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a geometry value of any type using its WKT representation and SRID.\n\nGeomFromText(), GeometryFromText(), ST_GeomFromText() and\nST_GeometryFromText() are all synonyms.\n\nExample\n-------\n\nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1))\');\n\nURL: https://mariadb.com/kb/en/st_geomfromtext/','','https://mariadb.com/kb/en/st_geomfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (37,3,'ST_LineFromText','Syntax\n------\n\nST_LineFromText(wkt[,srid])\nST_LineStringFromText(wkt[,srid])\nLineFromText(wkt[,srid])\nLineStringFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a LINESTRING value using its WKT representation and SRID.\n\nST_LineFromText(), ST_LineStringFromText(), ST_LineFromText() and\nST_LineStringFromText() are all synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_line  (g LINESTRING);\nSHOW FIELDS FROM gis_line;\nINSERT INTO gis_line VALUES\n  (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n  (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n  (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nURL: https://mariadb.com/kb/en/st_linefromtext/','','https://mariadb.com/kb/en/st_linefromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (38,3,'ST_LineStringFromText','A synonym for ST_LineFromText.\n\nURL: https://mariadb.com/kb/en/st_linestringfromtext/','','https://mariadb.com/kb/en/st_linestringfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (39,3,'ST_PointFromText','Syntax\n------\n\nST_PointFromText(wkt[,srid])\nPointFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a POINT value using its WKT representation and SRID.\n\nST_PointFromText() and PointFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_point  (g POINT);\nSHOW FIELDS FROM gis_point;\nINSERT INTO gis_point VALUES\n  (PointFromText(\'POINT(10 10)\')),\n  (PointFromText(\'POINT(20 10)\')),\n  (PointFromText(\'POINT(20 20)\')),\n  (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nURL: https://mariadb.com/kb/en/st_pointfromtext/','','https://mariadb.com/kb/en/st_pointfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (40,3,'ST_PolyFromText','Syntax\n------\n\nST_PolyFromText(wkt[,srid])\nST_PolygonFromText(wkt[,srid])\nPolyFromText(wkt[,srid])\nPolygonFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a POLYGON value using its WKT representation and SRID.\n\nST_PolyFromText(), ST_PolygonFromText(), PolyFromText() and\nST_PolygonFromText() are all synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_polygon   (g POLYGON);\nINSERT INTO gis_polygon VALUES\n  (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n  (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\'));\n\nURL: https://mariadb.com/kb/en/st_polyfromtext/','','https://mariadb.com/kb/en/st_polyfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (41,3,'ST_PolygonFromText','A synonym for ST_PolyFromText.\n\nURL: https://mariadb.com/kb/en/st_polygonfromtext/','','https://mariadb.com/kb/en/st_polygonfromtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (42,4,'DIV','Syntax\n------\n\nDIV\n\nDescription\n-----------\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\nIncorrect results may occur for non-integer operands that exceed BIGINT range.\n\nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, a division by zero produces\nan error. Otherwise, it returns NULL.\n\nThe remainder of a division can be obtained using the MOD operator.\n\nExamples\n--------\n\nSELECT 300 DIV 7;\n+-----------+\n| 300 DIV 7 |\n+-----------+\n|        42 |\n+-----------+\n\nSELECT 300 DIV 0;\n+-----------+\n| 300 DIV 0 |\n+-----------+\n|      NULL |\n+-----------+\n\nURL: https://mariadb.com/kb/en/div/','','https://mariadb.com/kb/en/div/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (43,4,'ABS','Syntax\n------\n\nABS(X)\n\nDescription\n-----------\n\nReturns the absolute (non-negative) value of X. If X is not a number, it is\nconverted to a numeric type.\n\nExamples\n--------\n\nSELECT ABS(42);\n+---------+\n| ABS(42) |\n+---------+\n|      42 |\n+---------+\n\nSELECT ABS(-42);\n+----------+\n| ABS(-42) |\n+----------+\n|       42 |\n+----------+\n\nSELECT ABS(DATE \'1994-01-01\');\n+------------------------+\n| ABS(DATE \'1994-01-01\') |\n+------------------------+\n|               19940101 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/abs/','','https://mariadb.com/kb/en/abs/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (44,4,'ACOS','Syntax\n------\n\nACOS(X)\n\nDescription\n-----------\n\nReturns the arc cosine of X, that is, the value whose cosine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nExamples\n--------\n\nSELECT ACOS(1);\n+---------+\n| ACOS(1) |\n+---------+\n|       0 |\n+---------+\n\nSELECT ACOS(1.0001);\n+--------------+\n| ACOS(1.0001) |\n+--------------+\n|         NULL |\n+--------------+\n\nSELECT ACOS(0);\n+-----------------+\n| ACOS(0)         |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n\nSELECT ACOS(0.234);\n+------------------+\n| ACOS(0.234)      |\n+------------------+\n| 1.33460644244679 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/acos/','','https://mariadb.com/kb/en/acos/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (45,4,'ASIN','Syntax\n------\n\nASIN(X)\n\nDescription\n-----------\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns NULL if\nX is not in the range -1 to 1.\n\nExamples\n--------\n\nSELECT ASIN(0.2);\n+--------------------+\n| ASIN(0.2)          |\n+--------------------+\n| 0.2013579207903308 |\n+--------------------+\n\nSELECT ASIN(\'foo\');\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n|           0 |\n+-------------+\n\nSHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level   | Code | Message                                 |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n\nURL: https://mariadb.com/kb/en/asin/','','https://mariadb.com/kb/en/asin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (46,4,'ATAN','Syntax\n------\n\nATAN(X)\n\nDescription\n-----------\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nExamples\n--------\n\nSELECT ATAN(2);\n+--------------------+\n| ATAN(2)            |\n+--------------------+\n| 1.1071487177940904 |\n+--------------------+\n\nSELECT ATAN(-2);\n+---------------------+\n| ATAN(-2)            |\n+---------------------+\n| -1.1071487177940904 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/atan/','','https://mariadb.com/kb/en/atan/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (47,4,'ATAN2','Syntax\n------\n\nATAN(Y,X), ATAN2(Y,X)\n\nDescription\n-----------\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both arguments\nare used to determine the quadrant of the result.\n\nExamples\n--------\n\nSELECT ATAN(-2,2);\n+---------------------+\n| ATAN(-2,2)          |\n+---------------------+\n| -0.7853981633974483 |\n+---------------------+\n\nSELECT ATAN2(PI(),0);\n+--------------------+\n| ATAN2(PI(),0)      |\n+--------------------+\n| 1.5707963267948966 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/atan2/','','https://mariadb.com/kb/en/atan2/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (48,4,'CEIL','Syntax\n------\n\nCEIL(X)\n\nDescription\n-----------\n\nCEIL() is a synonym for CEILING().\n\nURL: https://mariadb.com/kb/en/ceil/','','https://mariadb.com/kb/en/ceil/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (49,4,'CEILING','Syntax\n------\n\nCEILING(X)\n\nDescription\n-----------\n\nReturns the smallest integer value not less than X.\n\nExamples\n--------\n\nSELECT CEILING(1.23);\n+---------------+\n| CEILING(1.23) |\n+---------------+\n|             2 |\n+---------------+\n\nSELECT CEILING(-1.23);\n+----------------+\n| CEILING(-1.23) |\n+----------------+\n|             -1 |\n+----------------+\n\nURL: https://mariadb.com/kb/en/ceiling/','','https://mariadb.com/kb/en/ceiling/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (50,4,'CONV','Syntax\n------\n\nCONV(N,from_base,to_base)\n\nDescription\n-----------\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base to_base.\n\nReturns NULL if any argument is NULL, or if the second or third argument are\nnot in the allowed range.\n\nThe argument N is interpreted as an integer, but may be specified as an\ninteger or a string. The minimum base is 2 and the maximum base is 36. If\nto_base is a negative number, N is regarded as a signed number. Otherwise, N\nis treated as unsigned. CONV() works with 64-bit precision.\n\nSome shortcuts for this function are also available: BIN(), OCT(), HEX(),\nUNHEX(). Also, MariaDB allows binary literal values and hexadecimal literal\nvalues.\n\nExamples\n--------\n\nSELECT CONV(\'a\',16,2);\n+----------------+\n| CONV(\'a\',16,2) |\n+----------------+\n| 1010           |\n+----------------+\n\nSELECT CONV(\'6E\',18,8);\n+-----------------+\n| CONV(\'6E\',18,8) |\n+-----------------+\n| 172             |\n+-----------------+\n\nSELECT CONV(-17,10,-18);\n+------------------+\n| CONV(-17,10,-18) |\n+------------------+\n| -H               |\n+------------------+\n\nSELECT CONV(12+\'10\'+\'10\'+0xa,10,10);\n+------------------------------+\n| CONV(12+\'10\'+\'10\'+0xa,10,10) |\n+------------------------------+\n| 42                           |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/conv/','','https://mariadb.com/kb/en/conv/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (51,4,'COS','Syntax\n------\n\nCOS(X)\n\nDescription\n-----------\n\nReturns the cosine of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT COS(PI());\n+-----------+\n| COS(PI()) |\n+-----------+\n|        -1 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/cos/','','https://mariadb.com/kb/en/cos/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (52,4,'COT','Syntax\n------\n\nCOT(X)\n\nDescription\n-----------\n\nReturns the cotangent of X.\n\nExamples\n--------\n\nSELECT COT(42);\n+--------------------+\n| COT(42)            |\n+--------------------+\n| 0.4364167060752729 |\n+--------------------+\n\nSELECT COT(12);\n+---------------------+\n| COT(12)             |\n+---------------------+\n| -1.5726734063976893 |\n+---------------------+\n\nSELECT COT(0);\nERROR 1690 (22003): DOUBLE value is out of range in \'cot(0)\'\n\nURL: https://mariadb.com/kb/en/cot/','','https://mariadb.com/kb/en/cot/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (53,4,'CRC32','Syntax\n------\n\n<= MariaDB 10.7\n\nCRC32(expr)\n\nFrom MariaDB 10.8\n\nCRC32([par,]expr)\n\nDescription\n-----------\n\nComputes a cyclic redundancy check (CRC) value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is expected to\nbe a string and (if possible) is treated as one if it is not.\n\nUses the ISO 3309 polynomial that used by zlib and many others. MariaDB 10.8\nintroduced the CRC32C() function, which uses the alternate Castagnoli\npolynomia.\n\nMariaDB starting with 10.8\n--------------------------\nOften, CRC is computed in pieces. To facilitate this, MariaDB 10.8.0\nintroduced an optional parameter: CRC32(\'MariaDB\')=CRC32(CRC32(\'Maria\'),\'DB\').\n\nExamples\n--------\n\nSELECT CRC32(\'MariaDB\');\n+------------------+\n| CRC32(\'MariaDB\') |\n+------------------+\n|       4227209140 |\n+------------------+\n\nSELECT CRC32(\'mariadb\');\n+------------------+\n| CRC32(\'mariadb\') |\n+------------------+\n|       2594253378 |\n+------------------+\n\nFrom MariaDB 10.8.0\n\nSELECT CRC32(CRC32(\'Maria\'),\'DB\');\n+----------------------------+\n| CRC32(CRC32(\'Maria\'),\'DB\') |\n+----------------------------+\n|                 4227209140 |\n+----------------------------+\n\nURL: https://mariadb.com/kb/en/crc32/','','https://mariadb.com/kb/en/crc32/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (54,4,'DEGREES','Syntax\n------\n\nDEGREES(X)\n\nDescription\n-----------\n\nReturns the argument X, converted from radians to degrees.\n\nThis is the converse of the RADIANS() function.\n\nExamples\n--------\n\nSELECT DEGREES(PI());\n+---------------+\n| DEGREES(PI()) |\n+---------------+\n|           180 |\n+---------------+\n\nSELECT DEGREES(PI() / 2);\n+-------------------+\n| DEGREES(PI() / 2) |\n+-------------------+\n|                90 |\n+-------------------+\n\nSELECT DEGREES(45);\n+-----------------+\n| DEGREES(45)     |\n+-----------------+\n| 2578.3100780887 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/degrees/','','https://mariadb.com/kb/en/degrees/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (55,4,'EXP','Syntax\n------\n\nEXP(X)\n\nDescription\n-----------\n\nReturns the value of e (the base of natural logarithms) raised to the power of\nX. The inverse of this function is LOG() (using a single argument only) or\nLN().\n\nIf X is NULL, this function returns NULL.\n\nExamples\n--------\n\nSELECT EXP(2);\n+------------------+\n| EXP(2)           |\n+------------------+\n| 7.38905609893065 |\n+------------------+\n\nSELECT EXP(-2);\n+--------------------+\n| EXP(-2)            |\n+--------------------+\n| 0.1353352832366127 |\n+--------------------+\n\nSELECT EXP(0);\n+--------+\n| EXP(0) |\n+--------+\n|      1 |\n+--------+\n\nSELECT EXP(NULL);\n+-----------+\n| EXP(NULL) |\n+-----------+\n|      NULL |\n+-----------+\n\nURL: https://mariadb.com/kb/en/exp/','','https://mariadb.com/kb/en/exp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,4,'FLOOR','Syntax\n------\n\nFLOOR(X)\n\nDescription\n-----------\n\nReturns the largest integer value not greater than X.\n\nExamples\n--------\n\nSELECT FLOOR(1.23);\n+-------------+\n| FLOOR(1.23) |\n+-------------+\n|           1 |\n+-------------+\n\nSELECT FLOOR(-1.23);\n+--------------+\n| FLOOR(-1.23) |\n+--------------+\n|           -2 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/floor/','','https://mariadb.com/kb/en/floor/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (57,4,'LN','Syntax\n------\n\nLN(X)\n\nDescription\n-----------\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X. If X\nis less than or equal to 0, or NULL, then NULL is returned.\n\nThe inverse of this function is EXP().\n\nExamples\n--------\n\nSELECT LN(2);\n+-------------------+\n| LN(2)             |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n\nSELECT LN(-2);\n+--------+\n| LN(-2) |\n+--------+\n|   NULL |\n+--------+\n\nURL: https://mariadb.com/kb/en/ln/','','https://mariadb.com/kb/en/ln/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (58,4,'LOG','Syntax\n------\n\nLOG(X), LOG(B,X)\n\nDescription\n-----------\n\nIf called with one parameter, this function returns the natural logarithm of\nX. If X is less than or equal to 0, then NULL is returned.\n\nIf called with two parameters, it returns the logarithm of X to the base B. If\nB is <= 1 or X <= 0, the function returns NULL.\n\nIf any argument is NULL, the function returns NULL.\n\nThe inverse of this function (when called with a single argument) is the EXP()\nfunction.\n\nExamples\n--------\n\nLOG(X):\n\nSELECT LOG(2);\n+-------------------+\n| LOG(2)            |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n\nSELECT LOG(-2);\n+---------+\n| LOG(-2) |\n+---------+\n|    NULL |\n+---------+\n\nLOG(B,X)\n\nSELECT LOG(2,16);\n+-----------+\n| LOG(2,16) |\n+-----------+\n|         4 |\n+-----------+\n\nSELECT LOG(3,27);\n+-----------+\n| LOG(3,27) |\n+-----------+\n|         3 |\n+-----------+\n\nSELECT LOG(3,1);\n+----------+\n| LOG(3,1) |\n+----------+\n|        0 |\n+----------+\n\nSELECT LOG(3,0);\n+----------+\n| LOG(3,0) |\n+----------+\n|     NULL |\n+----------+\n\nURL: https://mariadb.com/kb/en/log/','','https://mariadb.com/kb/en/log/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (59,4,'LOG10','Syntax\n------\n\nLOG10(X)\n\nDescription\n-----------\n\nReturns the base-10 logarithm of X.\n\nExamples\n--------\n\nSELECT LOG10(2);\n+-------------------+\n| LOG10(2)          |\n+-------------------+\n| 0.301029995663981 |\n+-------------------+\n\nSELECT LOG10(100);\n+------------+\n| LOG10(100) |\n+------------+\n|          2 |\n+------------+\n\nSELECT LOG10(-100);\n+-------------+\n| LOG10(-100) |\n+-------------+\n|        NULL |\n+-------------+\n\nURL: https://mariadb.com/kb/en/log10/','','https://mariadb.com/kb/en/log10/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (60,4,'LOG2','Syntax\n------\n\nLOG2(X)\n\nDescription\n-----------\n\nReturns the base-2 logarithm of X.\n\nExamples\n--------\n\nSELECT LOG2(4398046511104);\n+---------------------+\n| LOG2(4398046511104) |\n+---------------------+\n|                  42 |\n+---------------------+\n\nSELECT LOG2(65536);\n+-------------+\n| LOG2(65536) |\n+-------------+\n|          16 |\n+-------------+\n\nSELECT LOG2(-100);\n+------------+\n| LOG2(-100) |\n+------------+\n|       NULL |\n+------------+\n\nURL: https://mariadb.com/kb/en/log2/','','https://mariadb.com/kb/en/log2/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (61,4,'MOD','Syntax\n------\n\nMOD(N,M), N % M, N MOD M\n\nDescription\n-----------\n\nModulo operation. Returns the remainder of N divided by M. See also Modulo\nOperator.\n\nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, any number modulus zero\nproduces an error. Otherwise, it returns NULL.\n\nThe integer part of a division can be obtained using DIV.\n\nExamples\n--------\n\nSELECT 1042 % 50;\n+-----------+\n| 1042 % 50 |\n+-----------+\n|        42 |\n+-----------+\n\nSELECT MOD(234, 10);\n+--------------+\n| MOD(234, 10) |\n+--------------+\n|            4 |\n+--------------+\n\nSELECT 253 % 7;\n+---------+\n| 253 % 7 |\n+---------+\n|       1 |\n+---------+\n\nSELECT MOD(29,9);\n+-----------+\n| MOD(29,9) |\n+-----------+\n|         2 |\n+-----------+\n\nSELECT 29 MOD 9;\n+----------+\n| 29 MOD 9 |\n+----------+\n|        2 |\n+----------+\n\nURL: https://mariadb.com/kb/en/mod/','','https://mariadb.com/kb/en/mod/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (62,4,'OCT','Syntax\n------\n\nOCT(N)\n\nDescription\n-----------\n\nReturns a string representation of the octal value of N, where N is a longlong\n(BIGINT) number. This is equivalent to CONV(N,10,8). Returns NULL if N is NULL.\n\nExamples\n--------\n\nSELECT OCT(34);\n+---------+\n| OCT(34) |\n+---------+\n| 42      |\n+---------+\n\nSELECT OCT(12);\n+---------+\n| OCT(12) |\n+---------+\n| 14      |\n+---------+\n\nURL: https://mariadb.com/kb/en/oct/','','https://mariadb.com/kb/en/oct/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (63,4,'PI','Syntax\n------\n\nPI()\n\nDescription\n-----------\n\nReturns the value of π (pi). The default number of decimal places displayed is\nsix, but MariaDB uses the full double-precision value internally.\n\nExamples\n--------\n\nSELECT PI();\n+----------+\n| PI()     |\n+----------+\n| 3.141593 |\n+----------+\n\nSELECT PI()+0.0000000000000000000000;\n+-------------------------------+\n| PI()+0.0000000000000000000000 |\n+-------------------------------+\n|      3.1415926535897931159980 |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/pi/','','https://mariadb.com/kb/en/pi/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (64,4,'POW','Syntax\n------\n\nPOW(X,Y)\n\nDescription\n-----------\n\nReturns the value of X raised to the power of Y.\n\nPOWER() is a synonym.\n\nExamples\n--------\n\nSELECT POW(2,3);\n+----------+\n| POW(2,3) |\n+----------+\n|        8 |\n+----------+\n\nSELECT POW(2,-2);\n+-----------+\n| POW(2,-2) |\n+-----------+\n|      0.25 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/pow/','','https://mariadb.com/kb/en/pow/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,4,'POWER','Syntax\n------\n\nPOWER(X,Y)\n\nDescription\n-----------\n\nThis is a synonym for POW(), which returns the value of X raised to the power\nof Y.\n\nURL: https://mariadb.com/kb/en/power/','','https://mariadb.com/kb/en/power/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (66,4,'RADIANS','Syntax\n------\n\nRADIANS(X)\n\nDescription\n-----------\n\nReturns the argument X, converted from degrees to radians. Note that π radians\nequals 180 degrees.\n\nThis is the converse of the DEGREES() function.\n\nExamples\n--------\n\nSELECT RADIANS(45);\n+-------------------+\n| RADIANS(45)       |\n+-------------------+\n| 0.785398163397448 |\n+-------------------+\n\nSELECT RADIANS(90);\n+-----------------+\n| RADIANS(90)     |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n\nSELECT RADIANS(PI());\n+--------------------+\n| RADIANS(PI())      |\n+--------------------+\n| 0.0548311355616075 |\n+--------------------+\n\nSELECT RADIANS(180);\n+------------------+\n| RADIANS(180)     |\n+------------------+\n| 3.14159265358979 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/radians/','','https://mariadb.com/kb/en/radians/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (67,4,'RAND','Syntax\n------\n\nRAND(), RAND(N)\n\nDescription\n-----------\n\nReturns a random DOUBLE precision floating point value v in the range 0 <= v <\n1.0. If a constant integer argument N is specified, it is used as the seed\nvalue, which produces a repeatable sequence of column values. In the example\nbelow, note that the sequences of values produced by RAND(3) is the same both\nplaces where it occurs.\n\nIn a WHERE clause, RAND() is evaluated each time the WHERE is executed.\n\nStatements using the RAND() function are not safe for statement-based\nreplication.\n\nPractical uses\n--------------\n\nThe expression to get a random integer from a given range is the following:\n\nFLOOR(min_value + RAND() * (max_value - min_value +1))\n\nRAND() is often used to read random rows from a table, as follows:\n\nSELECT * FROM my_table ORDER BY RAND() LIMIT 10;\n\nNote, however, that this technique should never be used on a large table as it\nwill be extremely slow. MariaDB will read all rows in the table, generate a\nrandom value for each of them, order them, and finally will apply the LIMIT\nclause.\n\nExamples\n--------\n\nCREATE TABLE t (i INT);\n\nINSERT INTO t VALUES(1),(2),(3);\n\nSELECT i, RAND() FROM t;\n+------+-------------------+\n| i    | RAND()            |\n+------+-------------------+\n|    1 | 0.255651095188829 |\n|    2 | 0.833920199269355 |\n|    3 |  0.40264774151393 |\n+------+-------------------+\n\nSELECT i, RAND(3) FROM t;\n+------+-------------------+\n| i    | RAND(3)           |\n+------+-------------------+\n|    1 |  0.90576975597606 |\n|    2 | 0.373079058130345 |\n|    3 | 0.148086053457191 |\n+------+-------------------+\n\nSELECT i, RAND() FROM t;\n+------+-------------------+\n| i    | RAND()            |\n+------+-------------------+\n|    1 | 0.511478140495232 |\n|    2 | 0.349447508668012 |\n|    3 | 0.212803152588013 |\n+------+-------------------+\n\nUsing the same seed, the same sequence will be returned:\n\nSELECT i, RAND(3) FROM t;\n+------+-------------------+\n| i    | RAND(3)           |\n+------+-------------------+\n|    1 |  0.90576975597606 |\n|    2 | 0.373079058130345 |\n|    3 | 0.148086053457191 |\n+------+-------------------+\n\nGenerating a random number from 5 to 15:\n\nSELECT FLOOR(5 + (RAND() * 11));\n\nURL: https://mariadb.com/kb/en/rand/','','https://mariadb.com/kb/en/rand/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (68,4,'ROUND','Syntax\n------\n\nROUND(X), ROUND(X,D)\n\nDescription\n-----------\n\nRounds the argument X to D decimal places. D defaults to 0 if not specified. D\ncan be negative to cause D digits left of the decimal point of the value X to\nbecome zero.\n\nThe rounding algorithm depends on the data type of X:\n\n* for floating point types (FLOAT, DOUBLE) the C libraries rounding function\nis used, so the behavior *may* differ between operating systems\n* for fixed point types (DECIMAL, DEC/NUMBER/FIXED) the \"round half up\" rule\nis used, meaning that e.g. a value ending in exactly .5 is always rounded up.\n\nExamples\n--------\n\nSELECT ROUND(-1.23);\n+--------------+\n| ROUND(-1.23) |\n+--------------+\n|           -1 |\n+--------------+\n\nSELECT ROUND(-1.58);\n+--------------+\n| ROUND(-1.58) |\n+--------------+\n|           -2 |\n+--------------+\n\nSELECT ROUND(1.58); \n+-------------+\n| ROUND(1.58) |\n+-------------+\n|           2 |\n+-------------+\n\nSELECT ROUND(1.298, 1);\n+-----------------+\n| ROUND(1.298, 1) |\n+-----------------+\n|             1.3 |\n+-----------------+\n\nSELECT ROUND(1.298, 0);\n+-----------------+\n| ROUND(1.298, 0) |\n+-----------------+\n|               1 |\n+-----------------+\n\nSELECT ROUND(23.298, -1);\n+-------------------+\n| ROUND(23.298, -1) |\n+-------------------+\n|                20 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/round/','','https://mariadb.com/kb/en/round/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (69,4,'SIGN','Syntax\n------\n\nSIGN(X)\n\nDescription\n-----------\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X is\nnegative, zero, or positive.\n\nExamples\n--------\n\nSELECT SIGN(-32);\n+-----------+\n| SIGN(-32) |\n+-----------+\n|        -1 |\n+-----------+\n\nSELECT SIGN(0);\n+---------+\n| SIGN(0) |\n+---------+\n|       0 |\n+---------+\n\nSELECT SIGN(234);\n+-----------+\n| SIGN(234) |\n+-----------+\n|         1 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/sign/','','https://mariadb.com/kb/en/sign/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (70,4,'SIN','Syntax\n------\n\nSIN(X)\n\nDescription\n-----------\n\nReturns the sine of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT SIN(1.5707963267948966);\n+-------------------------+\n| SIN(1.5707963267948966) |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSELECT SIN(PI());\n+----------------------+\n| SIN(PI())            |\n+----------------------+\n| 1.22460635382238e-16 |\n+----------------------+\n\nSELECT ROUND(SIN(PI()));\n+------------------+\n| ROUND(SIN(PI())) |\n+------------------+\n|                0 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/sin/','','https://mariadb.com/kb/en/sin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (71,4,'SQRT','Syntax\n------\n\nSQRT(X)\n\nDescription\n-----------\n\nReturns the square root of X. If X is negative, NULL is returned.\n\nExamples\n--------\n\nSELECT SQRT(4);\n+---------+\n| SQRT(4) |\n+---------+\n|       2 |\n+---------+\n\nSELECT SQRT(20);\n+------------------+\n| SQRT(20)         |\n+------------------+\n| 4.47213595499958 |\n+------------------+\n\nSELECT SQRT(-16);\n+-----------+\n| SQRT(-16) |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT SQRT(1764);\n+------------+\n| SQRT(1764) |\n+------------+\n|         42 |\n+------------+\n\nURL: https://mariadb.com/kb/en/sqrt/','','https://mariadb.com/kb/en/sqrt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,4,'TAN','Syntax\n------\n\nTAN(X)\n\nDescription\n-----------\n\nReturns the tangent of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT TAN(0.7853981633974483);\n+-------------------------+\n| TAN(0.7853981633974483) |\n+-------------------------+\n|      0.9999999999999999 |\n+-------------------------+\n\nSELECT TAN(PI());\n+-----------------------+\n| TAN(PI())             |\n+-----------------------+\n| -1.22460635382238e-16 |\n+-----------------------+\n\nSELECT TAN(PI()+1);\n+-----------------+\n| TAN(PI()+1)     |\n+-----------------+\n| 1.5574077246549 |\n+-----------------+\n\nSELECT TAN(RADIANS(PI()));\n+--------------------+\n| TAN(RADIANS(PI())) |\n+--------------------+\n| 0.0548861508080033 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/tan/','','https://mariadb.com/kb/en/tan/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (73,4,'TRUNCATE','This page documents the TRUNCATE function. See TRUNCATE TABLE for the DDL\nstatement.\n\nSyntax\n------\n\nTRUNCATE(X,D)\n\nDescription\n-----------\n\nReturns the number X, truncated to D decimal places. If D is 0, the result has\nno decimal point or fractional part. D can be negative to cause D digits left\nof the decimal point of the value X to become zero.\n\nExamples\n--------\n\nSELECT TRUNCATE(1.223,1);\n+-------------------+\n| TRUNCATE(1.223,1) |\n+-------------------+\n|               1.2 |\n+-------------------+\n\nSELECT TRUNCATE(1.999,1);\n+-------------------+\n| TRUNCATE(1.999,1) |\n+-------------------+\n|               1.9 |\n+-------------------+\n\nSELECT TRUNCATE(1.999,0); \n+-------------------+\n| TRUNCATE(1.999,0) |\n+-------------------+\n|                 1 |\n+-------------------+\n\nSELECT TRUNCATE(-1.999,1);\n+--------------------+\n| TRUNCATE(-1.999,1) |\n+--------------------+\n|               -1.9 |\n+--------------------+\n\nSELECT TRUNCATE(122,-2);\n+------------------+\n| TRUNCATE(122,-2) |\n+------------------+\n|              100 |\n+------------------+\n\nSELECT TRUNCATE(10.28*100,0);\n+-----------------------+\n| TRUNCATE(10.28*100,0) |\n+-----------------------+\n|                  1028 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/truncate/','','https://mariadb.com/kb/en/truncate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (74,5,'INSTALL PLUGIN','Syntax\n------\n\nINSTALL PLUGIN [IF NOT EXISTS] plugin_name SONAME \'plugin_library\'\n\nDescription\n-----------\n\nThis statement installs an individual plugin from the specified library. To\ninstall the whole library (which could be required), use INSTALL SONAME. See\nalso Installing a Plugin.\n\nplugin_name is the name of the plugin as defined in the plugin declaration\nstructure contained in the library file. Plugin names are not case sensitive.\nFor maximal compatibility, plugin names should be limited to ASCII letters,\ndigits, and underscore, because they are used in C source files, shell command\nlines, M4 and Bourne shell scripts, and SQL environments.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension can be omitted (which makes the statement look\nthe same on all architectures).\n\nThe shared library must be located in the plugin directory (that is, the\ndirectory named by the plugin_dir system variable). The library must be in the\nplugin directory itself, not in a subdirectory. By default, plugin_dir is\nplugin directory under the directory named by the pkglibdir configuration\nvariable, but it can be changed by setting the value of plugin_dir at server\nstartup. For example, set its value in a my.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is taken to be relative\nto the MySQL base directory (the value of the basedir system variable).\n\nINSTALL PLUGIN adds a line to the mysql.plugin table that describes the\nplugin. This table contains the plugin name and library file name.\n\nINSTALL PLUGIN causes the server to read option (my.cnf) files just as during\nserver startup. This enables the plugin to pick up any relevant options from\nthose files. It is possible to add plugin options to an option file even\nbefore loading a plugin (if the loose prefix is used). It is also possible to\nuninstall a plugin, edit my.cnf, and install the plugin again. Restarting the\nplugin this way enables it to the new option values without a server restart.\n\nINSTALL PLUGIN also loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its initialization\nfunction, which handles any setup that the plugin must perform before it can\nbe used.\n\nTo use INSTALL PLUGIN, you must have the INSERT privilege for the mysql.plugin\ntable.\n\nAt server startup, the server loads and initializes any plugin that is listed\nin the mysql.plugin table. This means that a plugin is installed with INSTALL\nPLUGIN only once, not every time the server starts. Plugin loading at startup\ndoes not occur if the server is started with the --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization function for\neach plugin that is loaded so that the plugin has a chance to perform any\nfinal cleanup.\n\nIf you need to load plugins for a single server startup when the\n--skip-grant-tables option is given (which tells the server not to read system\ntables), use the --plugin-load mysqld option.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a note instead of\nan error if the specified plugin already exists. See SHOW WARNINGS.\n\nExamples\n--------\n\nINSTALL PLUGIN sphinx SONAME \'ha_sphinx.so\';\n\nThe extension can also be omitted:\n\nINSTALL PLUGIN innodb SONAME \'ha_xtradb\';\n\nFrom MariaDB 10.4.0:\n\nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\nQuery OK, 0 rows affected (0.104 sec)\n\nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------+\n| Level | Code | Message                            |\n+-------+------+------------------------------------+\n| Note  | 1968 | Plugin \'example\' already installed |\n+-------+------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/install-plugin/','','https://mariadb.com/kb/en/install-plugin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (75,5,'UNINSTALL PLUGIN','Syntax\n------\n\nUNINSTALL PLUGIN [IF EXISTS] plugin_name\n\nDescription\n-----------\n\nThis statement removes a single installed plugin. To uninstall the whole\nlibrary which contains the plugin, use UNINSTALL SONAME. You cannot uninstall\na plugin if any table that uses it is open.\n\nplugin_name must be the name of some plugin that is listed in the mysql.plugin\ntable. The server executes the plugin\'s deinitialization function and removes\nthe row for the plugin from the mysql.plugin table, so that subsequent server\nrestarts will not load and initialize the plugin. UNINSTALL PLUGIN does not\nremove the plugin\'s shared library file.\n\nTo use UNINSTALL PLUGIN, you must have the DELETE privilege for the\nmysql.plugin table.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the plugin does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nUNINSTALL PLUGIN example;\n\nFrom MariaDB 10.4.0:\n\nUNINSTALL PLUGIN IF EXISTS example;\nQuery OK, 0 rows affected (0.099 sec)\n\nUNINSTALL PLUGIN IF EXISTS example;\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------+\n| Level | Code | Message                       |\n+-------+------+-------------------------------+\n| Note  | 1305 | PLUGIN example does not exist |\n+-------+------+-------------------------------+\n\nURL: https://mariadb.com/kb/en/uninstall-plugin/','','https://mariadb.com/kb/en/uninstall-plugin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (76,5,'INSTALL SONAME','Syntax\n------\n\nINSTALL SONAME \'plugin_library\'\n\nDescription\n-----------\n\nThis statement is a variant of INSTALL PLUGIN. It installs all plugins from a\ngiven plugin_library. See INSTALL PLUGIN for details.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension (for example, libmyplugin.so or libmyplugin.dll)\ncan be omitted (which makes the statement look the same on all architectures).\n\nThe shared library must be located in the plugin directory (that is, the\ndirectory named by the plugin_dir system variable). The library must be in the\nplugin directory itself, not in a subdirectory. By default, plugin_dir is\nplugin directory under the directory named by the pkglibdir configuration\nvariable, but it can be changed by setting the value of plugin_dir at server\nstartup. For example, set its value in a my.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is taken to be relative\nto the MySQL base directory (the value of the basedir system variable).\n\nINSTALL SONAME adds one or more lines to the mysql.plugin table that describes\nthe plugin. This table contains the plugin name and library file name.\n\nINSTALL SONAME causes the server to read option (my.cnf) files just as during\nserver startup. This enables the plugin to pick up any relevant options from\nthose files. It is possible to add plugin options to an option file even\nbefore loading a plugin (if the loose prefix is used). It is also possible to\nuninstall a plugin, edit my.cnf, and install the plugin again. Restarting the\nplugin this way enables it to the new option values without a server restart.\n\nINSTALL SONAME also loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its initialization\nfunction, which handles any setup that the plugin must perform before it can\nbe used.\n\nTo use INSTALL SONAME, you must have the INSERT privilege for the mysql.plugin\ntable.\n\nAt server startup, the server loads and initializes any plugin that is listed\nin the mysql.plugin table. This means that a plugin is installed with INSTALL\nSONAME only once, not every time the server starts. Plugin loading at startup\ndoes not occur if the server is started with the --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization function for\neach plugin that is loaded so that the plugin has a chance to perform any\nfinal cleanup.\n\nIf you need to load plugins for a single server startup when the\n--skip-grant-tables option is given (which tells the server not to read system\ntables), use the --plugin-load mysqld option.\n\nIf you need to install only one plugin from a library, use the INSTALL PLUGIN\nstatement.\n\nExamples\n--------\n\nTo load the XtraDB storage engine and all of its information_schema tables\nwith one statement, use\n\nINSTALL SONAME \'ha_xtradb\';\n\nThis statement can be used instead of INSTALL PLUGIN even when the library\ncontains only one plugin:\n\nINSTALL SONAME \'ha_sequence\';\n\nURL: https://mariadb.com/kb/en/install-soname/','','https://mariadb.com/kb/en/install-soname/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (77,5,'UNINSTALL SONAME','Syntax\n------\n\nUNINSTALL SONAME  [IF EXISTS] \'plugin_library\'\n\nDescription\n-----------\n\nThis statement is a variant of UNINSTALL PLUGIN statement, that removes all\nplugins belonging to a specified plugin_library. See UNINSTALL PLUGIN for\ndetails.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension (for example, libmyplugin.so or libmyplugin.dll)\ncan be omitted (which makes the statement look the same on all architectures).\n\nTo use UNINSTALL SONAME, you must have the DELETE privilege for the\nmysql.plugin table.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the plugin library does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nTo uninstall the XtraDB plugin and all of its information_schema tables with\none statement, use\n\nUNINSTALL SONAME \'ha_xtradb\';\n\nFrom MariaDB 10.4.0:\n\nUNINSTALL SONAME IF EXISTS \'ha_example\';\nQuery OK, 0 rows affected (0.099 sec)\n\nUNINSTALL SONAME IF EXISTS \'ha_example\';\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------------+\n| Level | Code | Message                             |\n+-------+------+-------------------------------------+\n| Note  | 1305 | SONAME ha_example.so does not exist |\n+-------+------+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/uninstall-soname/','','https://mariadb.com/kb/en/uninstall-soname/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (78,5,'Plugin Overview','Plugins are server components that enhance MariaDB in some way. These can be\nanything from new storage engines, plugins for enhancing full-text parsing, or\neven small enhancements, such as a plugin to get a timestamp as an integer.\n\nQuerying Plugin Information\n---------------------------\n\nThere are a number of ways to see which plugins are currently active.\n\nA server almost always has a large number of active plugins, because the\nserver contains a large number of built-in plugins, which are active by\ndefault and cannot be uninstalled.\n\nQuerying Plugin Information with SHOW PLUGINS\n---------------------------------------------\n\nThe SHOW PLUGINS statement can be used to query information about all active\nplugins.\n\nFor example:\n\nSHOW PLUGINS\\G;\n********************** 1. row **********************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n********************** 2. row **********************\n Name: mysql_native_password\n Status: ACTIVE\n Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n********************** 3. row **********************\n Name: mysql_old_password\n Status: ACTIVE\n Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n...\n\nIf a plugin\'s Library column has a NULL value, then the plugin is built-in,\nand it cannot be uninstalled.\n\nQuerying Plugin Information with information_schema.PLUGINS\n-----------------------------------------------------------\n\nThe information_schema.PLUGINS table can be queried to get more detailed\ninformation about plugins.\n\nFor example:\n\nSELECT * FROM information_schema.PLUGINS\\G\n...\n*************************** 6. row ***************************\n     PLUGIN_NAME: CSV\n    PLUGIN_VERSION: 1.0\n    PLUGIN_STATUS: ACTIVE\n     PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n    PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n    PLUGIN_AUTHOR: Brian Aker, MySQL AB\n  PLUGIN_DESCRIPTION: CSV storage engine\n    PLUGIN_LICENSE: GPL\n     LOAD_OPTION: FORCE\n   PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n*************************** 7. row ***************************\n     PLUGIN_NAME: MEMORY\n    PLUGIN_VERSION: 1.0\n    PLUGIN_STATUS: ACTIVE\n     PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n    PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n    PLUGIN_AUTHOR: MySQL AB\n  PLUGIN_DESCRIPTION: Hash based, stored in memory, useful for temporary\ntables\n    PLUGIN_LICENSE: GPL\n     LOAD_OPTION: FORCE\n   PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n...\n\nIf a plugin\'s PLUGIN_LIBRARY column has the NULL value, then the plugin is\nbuilt-in, and it cannot be uninstalled.\n\nQuerying Plugin Information with mysql.plugin\n---------------------------------------------\n\nThe mysql.plugin table can be queried to get information about installed\nplugins.\n\nThis table only contains information about plugins that have been installed\nvia the following methods:\n\n* The INSTALL SONAME statement.\n* The INSTALL PLUGIN statement.\n* The mysql_plugin utility.\n\nThis table does not contain information about:\n\n* Built-in plugins.\n* Plugins loaded with the --plugin-load-add option.\n* Plugins loaded with the --plugin-load option.\n\nThis table only contains enough information to reload the plugin when the\nserver is restarted, which means it only contains the plugin name and the\nplugin library.\n\nFor example:\n\nSELECT * FROM mysql.plugin;\n\n+------+------------+\n| name | dl         |\n+------+------------+\n| PBXT | libpbxt.so |\n+------+------------+\n\nInstalling a Plugin\n-------------------\n\nThere are three primary ways to install a plugin:\n\n* A plugin can be installed dynamically with an SQL statement.\n* A plugin can be installed with a mysqld option, but it requires a server\nrestart.\n* A plugin can be installed with the mysql_plugin utility, while the server is\ncompletely offline.\n\nWhen you are installing a plugin, you also have to ensure that:\n\n* The server\'s plugin directory is properly configured, and the plugin\'s\nlibrary is in the plugin directory.\n* The server\'s minimum plugin maturity is properly configured, and the plugin\nis mature enough to be installed.\n\nInstalling a Plugin Dynamically\n-------------------------------\n\nA plugin can be installed dynamically by executing either the INSTALL SONAME\nor the INSTALL PLUGIN statement.\n\nIf a plugin is installed with one of these statements, then a record will be\nadded to the mysql.plugins table for the plugin. This means that the plugin\nwill automatically be loaded every time the server restarts, unless\nspecifically uninstalled or deactivated.\n\nInstalling a Plugin with INSTALL SONAME\n---------------------------------------\n\nYou can install a plugin dynamically by executing the INSTALL SONAME\nstatement. INSTALL SONAME installs all plugins from the given plugin library.\nThis could be required for some plugin libraries.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin), you could execute the\nfollowing:\n\nINSTALL SONAME \'server_audit\';\n\nInstalling a Plugin with INSTALL PLUGIN\n---------------------------------------\n\nYou can install a plugin dynamically by executing the INSTALL PLUGIN\nstatement. INSTALL PLUGIN installs a single plugin from the given plugin\nlibrary.\n\nFor example, to install the server_audit audit plugin from the server_audit\nplugin library, you could execute the following:\n\nINSTALL PLUGIN server_audit SONAME \'server_audit\';\n\nInstalling a Plugin with Plugin Load Options\n--------------------------------------------\n\nA plugin can be installed with a mysqld option by providing either the\n--plugin-load-add or the --plugin-load option.\n\nIf a plugin is installed with one of these options, then a record will not be\nadded to the mysql.plugins table for the plugin. This means that if the server\nis restarted without the same option set, then the plugin will not\nautomatically be loaded.\n\nInstalling a Plugin with --plugin-load-add\n------------------------------------------\n\nYou can install a plugin with the --plugin-load-add option by specifying the\noption as a command-line argument to mysqld or by specifying the option in a\nrelevant server option group in an option file.\n\nThe --plugin-load-add option uses the following format:\n\n* Plugins can be specified in the format name=library, where name is the\nplugin name and library is the plugin library. This format installs a single\nplugin from the given plugin library.\n* Plugins can also be specified in the format library, where library is the\nplugin library. This format installs all plugins from the given plugin library.\n* Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin) and also the ed25519\nauthentication plugin from the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n\n$ mysqld --user=mysql --plugin-load-add=\'server_audit\'\n--plugin-load-add=\'ed25519=auth_ed25519\'\n\nYou could also set the option to the same values in an option file:\n\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load_add = ed25519=auth_ed25519\n\nSpecial care must be taken when specifying both the --plugin-load option and\nthe --plugin-load-add option together. The --plugin-load option resets the\nplugin load list, and this can cause unexpected problems if you are not aware.\nThe --plugin-load-add option does not reset the plugin load list, so it is\nmuch safer to use. See Specifying Multiple Plugin Load Options for more\ninformation.\n\nInstalling a Plugin with --plugin-load\n--------------------------------------\n\nYou can install a plugin with the --plugin-load option by specifying the\noption as a command-line argument to mysqld or by specifying the option in a\nrelevant server option group in an option file.\n\nThe --plugin-load option uses the following format:\n\n* Plugins can be specified in the format name=library, where name is the\nplugin name and library is the plugin library. This format installs a single\nplugin from the given plugin library.\n* Plugins can also be specified in the format library, where library is the\nplugin library. This format installs all plugins from the given plugin library.\n* Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin) and also the ed25519\nauthentication plugin from the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n\n$ mysqld --user=mysql --plugin-load=\'server_audit;ed25519=auth_ed25519\'\n\nYou could also set the option to the same values in an option file:\n\n[mariadb]\n...\nplugin_load = server_audit;ed25519=auth_ed25519\n\nSpecial care must be taken when specifying the --plugin-load option multiple\ntimes, or when specifying both the --plugin-load option and the\n--plugin-load-add option together. The --plugin-load option resets the plugin\nload list, and this can cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load list, so it is much\nsafer to use. See Specifying Multiple Plugin Load Options for more information.\n\nSpecifying Multiple Plugin Load Options\n---------------------------------------\n\nSpecial care must be taken when specifying the --plugin-load option multiple\ntimes, or when specifying both the --plugin-load option and the\n--plugin-load-add option. The --plugin-load option resets the plugin load\nlist, and this can cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load list, so it is much\nsafer to use.\n\nThis can have the following consequences:\n\n* If the --plugin-load option is specified multiple times, then only the last\ninstance will have any effect. For example, in the following case, the first\ninstance of the option is reset:\n\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load = ed25519=auth_ed25519\n\n* If the --plugin-load option is specified after the --plugin-load-add option,\nthen it will also reset the changes made by that option. For example, in the\nfollowing case, the --plugin-load-add option does not do anything, because the\nsubsequent --plugin-load option resets the plugin load list:\n\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load = ed25519=auth_ed25519\n\n* In contrast, if the --plugin-load option is specified before the\n--plugin-load-add option, then it will work fine, because the\n--plugin-load-add option does not reset the plugin load list. For example, in\nthe following case, both plugins are properly loaded:\n\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load_add = ed25519=auth_ed25519\n\nInstalling a Plugin with mysql_plugin\n-------------------------------------\n\nA plugin can be installed with the mysql_plugin utility if the server is\ncompletely offline.\n\nThe syntax is:\n\nmysql_plugin [options] <plugin> ENABLE|DISABLE\n\nFor example, to install the server_audit audit plugin, you could execute the\nfollowing:\n\nmysql_plugin server_audit ENABLE\n\nIf a plugin is installed with this utility, then a record will be added to the\nmysql.plugins table for the plugin. This means that the plugin will\nautomatically be loaded every time the server restarts, unless specifically\nuninstalled or deactivated.\n\nConfiguring the Plugin Directory\n--------------------------------\n\nWhen a plugin is being installed, the server looks for the plugin\'s library in\nthe server\'s plugin directory. This directory is configured by the plugin_dir\nsystem variable. This can be specified as a command-line argument to mysqld or\nit can be specified in a relevant server option group in an option file. For\nexample:\n\n[mariadb]\n...\nplugin_dir = /usr/lib64/mysql/plugin\n\nConfiguring the Minimum Plugin Maturity\n---------------------------------------\n\nWhen a plugin is being installed, the server compares the plugin\'s maturity\nlevel against the server\'s minimum allowed plugin maturity. This can help\nprevent users from using unstable plugins on production servers. This minimum\nplugin maturity is configured by the plugin_maturity system variable. This can\nbe specified as a command-line argument to mysqld or it can be specified in a\nrelevant server option group in an option file. For example:\n\n[mariadb]\n...\nplugin_maturity = stable\n\nConfiguring Plugin Activation at Server Startup\n-----------------------------------------------\n\nA plugin will be loaded by default when the server starts if:\n\n* The plugin was installed with the INSTALL SONAME statement.\n* The plugin was installed with the INSTALL PLUGIN statement.\n* The plugin was installed with the mysql_plugin utility.\n* The server is configured to load the plugin with the --plugin-load-add\noption.\n* The server is configured to load the plugin with the --plugin-load option.\n\nThis behavior can be changed with special options that take the form\n--plugin-name. For example, for the server_audit audit plugin, the special\noption is called --server-audit.\n\nThe possible values for these special options are:\n\n+---------------------------------------+------------------------------------+\n| Option Value                          | Description                        |\n+---------------------------------------+------------------------------------+\n| OFF                                   | Disables the plugin without        |\n|                                       | removing it from the               |\n|                                       | mysql.plugins table.               |\n+---------------------------------------+------------------------------------+\n| ON                                    | Enables the plugin. If the plugin  |\n|                                       | cannot be initialized, then the    |\n|                                       | server will still continue         |\n|                                       | starting up, but the plugin will   |\n|                                       | be disabled.                       |\n+---------------------------------------+------------------------------------+\n| FORCE                                 | Enables the plugin. If the plugin  |','','https://mariadb.com/kb/en/plugin-overview/');
update help_topic set description = CONCAT(description, '\n|                                       | cannot be initialized, then the    |\n|                                       | server will fail to start with an  |\n|                                       | error.                             |\n+---------------------------------------+------------------------------------+\n| FORCE_PLUS_PERMANENT                  | Enables the plugin. If the plugin  |\n|                                       | cannot be initialized, then the    |\n|                                       | server will fail to start with an  |\n|                                       | error. In addition, the plugin     |\n|                                       | cannot be uninstalled with         |\n|                                       | UNINSTALL SONAME or UNINSTALL      |\n|                                       | PLUGIN while the server is         |\n|                                       | running.                           |\n+---------------------------------------+------------------------------------+\n\nA plugin\'s status can be found by looking at the PLUGIN_STATUS column of the\ninformation_schema.PLUGINS table.\n\nUninstalling Plugins\n--------------------\n\nPlugins that are found in the mysql.plugin table, that is those that were\ninstalled with INSTALL SONAME, INSTALL PLUGIN or mysql_plugin can be\nuninstalled in one of two ways:\n\n* The UNINSTALL SONAME or the UNINSTALL PLUGIN statement while the server is\nrunning\n* With mysql_plugin while the server is offline.\n\nPlugins that were enabled as a --plugin-load option do not need to be\nuninstalled. If --plugin-load is omitted the next time the server starts, or\nthe plugin is not listed as one of the --plugin-load entries, the plugin will\nnot be loaded.\n\nUNINSTALL PLUGIN uninstalls a single installed plugin, while UNINSTALL SONAME\nuninstalls all plugins belonging to a given library.\n\nURL: https://mariadb.com/kb/en/plugin-overview/') WHERE help_topic_id = 78;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (79,6,'MBR Definition','Description\n-----------\n\nThe MBR (Minimum Bounding Rectangle), or Envelope is the bounding geometry,\nformed by the minimum and maximum (X,Y) coordinates:\n\nExamples\n--------\n\n((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: https://mariadb.com/kb/en/mbr-definition/','','https://mariadb.com/kb/en/mbr-definition/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (80,6,'MBRContains','Syntax\n------\n\nMBRContains(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\ncontains the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\n\nSET @g2 = GeomFromText(\'Point(1 1)\');\n\nSELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n+----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n|                    1 |                    0 |\n+----------------------+----------------------+\n\nURL: https://mariadb.com/kb/en/mbrcontains/','','https://mariadb.com/kb/en/mbrcontains/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (81,6,'MBRDisjoint','Syntax\n------\n\nMBRDisjoint(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 are disjoint. Two geometries are disjoint if they do not\nintersect, that is touch or overlap.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECTmbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/mbrdisjoint/','','https://mariadb.com/kb/en/mbrdisjoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,6,'MBREqual','Syntax\n------\n\nMBREqual(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 are the same.\n\nExamples\n--------\n\nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 2)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 2, 1 0, 0 0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n|                 1 |\n+-------------------+\n\nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 3)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 4, 1 0, 0 0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n|                 0 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/mbrequal/','','https://mariadb.com/kb/en/mbrequal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,6,'MBRIntersects','Syntax\n------\n\nMBRIntersects(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 intersect.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n|                      1 |\n+------------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/mbrintersects/','','https://mariadb.com/kb/en/mbrintersects/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (84,6,'MBROverlaps','Syntax\n------\n\nMBROverlaps(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 overlap. The term spatially overlaps is used if two\ngeometries intersect and their intersection results in a geometry of the same\ndimension but not equal to either of the given geometries.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/mbroverlaps/','','https://mariadb.com/kb/en/mbroverlaps/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,6,'MBRTouches','Syntax\n------\n\nMBRTouches(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 touch. Two geometries spatially touch if the interiors of\nthe geometries do not intersect, but the boundary of one of the geometries\nintersects either the boundary or the interior of the other.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/mbrtouches/','','https://mariadb.com/kb/en/mbrtouches/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (86,6,'MBRWithin','Syntax\n------\n\nMBRWithin(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1 is\nwithin the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nSELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n|                  1 |                  0 |\n+--------------------+--------------------+\n\nURL: https://mariadb.com/kb/en/mbrwithin/','','https://mariadb.com/kb/en/mbrwithin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (87,7,'CASE OPERATOR','Syntax\n------\n\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nDescription\n-----------\n\nThe first version returns the result where value=compare_value. The second\nversion returns the result for the first condition that is true. If there was\nno matching result value, the result after ELSE is returned, or NULL if there\nis no ELSE part.\n\nThere is also a CASE statement, which differs from the CASE operator described\nhere.\n\nExamples\n--------\n\nSELECT CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE \'more\' END;\n+------------------------------------------------------------+\n| CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE \'more\' END |\n+------------------------------------------------------------+\n| one                                                        |\n+------------------------------------------------------------+\n\nSELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n+--------------------------------------------+\n| CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END |\n+--------------------------------------------+\n| true                                       |\n+--------------------------------------------+\n\nSELECT CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n+-----------------------------------------------------+\n| CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END |\n+-----------------------------------------------------+\n|                                                NULL |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/case-operator/','','https://mariadb.com/kb/en/case-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (88,7,'IF Function','Syntax\n------\n\nIF(expr1,expr2,expr3)\n\nDescription\n-----------\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2;\notherwise it returns expr3. IF() returns a numeric or string value, depending\non the context in which it is used.\n\nNote: There is also an IF statement which differs from the IF() function\ndescribed here.\n\nExamples\n--------\n\nSELECT IF(1>2,2,3);\n+-------------+\n| IF(1>2,2,3) |\n+-------------+\n|           3 |\n+-------------+\n\nSELECT IF(1<2,\'yes\',\'no\');\n+--------------------+\n| IF(1<2,\'yes\',\'no\') |\n+--------------------+\n| yes                |\n+--------------------+\n\nSELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n+---------------------------------------+\n| IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\') |\n+---------------------------------------+\n| no                                    |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/if-function/','','https://mariadb.com/kb/en/if-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (89,7,'IFNULL','Syntax\n------\n\nIFNULL(expr1,expr2)\nNVL(expr1,expr2)\n\nDescription\n-----------\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns expr2.\nIFNULL() returns a numeric or string value, depending on the context in which\nit is used.\n\nFrom MariaDB 10.3, NVL() is an alias for IFNULL().\n\nExamples\n--------\n\nSELECT IFNULL(1,0); \n+-------------+\n| IFNULL(1,0) |\n+-------------+\n|           1 |\n+-------------+\n\nSELECT IFNULL(NULL,10);\n+-----------------+\n| IFNULL(NULL,10) |\n+-----------------+\n|              10 |\n+-----------------+\n\nSELECT IFNULL(1/0,10);\n+----------------+\n| IFNULL(1/0,10) |\n+----------------+\n|        10.0000 |\n+----------------+\n\nSELECT IFNULL(1/0,\'yes\');\n+-------------------+\n| IFNULL(1/0,\'yes\') |\n+-------------------+\n| yes               |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/ifnull/','','https://mariadb.com/kb/en/ifnull/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (90,7,'NULLIF','Syntax\n------\n\nNULLIF(expr1,expr2)\n\nDescription\n-----------\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the\nsame as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nExamples\n--------\n\nSELECT NULLIF(1,1);\n+-------------+\n| NULLIF(1,1) |\n+-------------+\n|        NULL |\n+-------------+\n\nSELECT NULLIF(1,2);\n+-------------+\n| NULLIF(1,2) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/nullif/','','https://mariadb.com/kb/en/nullif/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (91,7,'NVL','MariaDB starting with 10.3\n--------------------------\nFrom MariaDB 10.3, NVL is a synonym for IFNULL.\n\nURL: https://mariadb.com/kb/en/nvl/','','https://mariadb.com/kb/en/nvl/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (92,7,'NVL2','MariaDB starting with 10.3\n--------------------------\nThe NLV2 function was introduced in MariaDB 10.3.0.\n\nSyntax\n------\n\nNVL2(expr1,expr2,expr3)\n\nDescription\n-----------\n\nThe NVL2 function returns a value based on whether a specified expression is\nNULL or not. If expr1 is not NULL, then NVL2 returns expr2. If expr1 is NULL,\nthen NVL2 returns expr3.\n\nExamples\n--------\n\nSELECT NVL2(NULL,1,2);\n+----------------+\n| NVL2(NULL,1,2) |\n+----------------+\n|              2 |\n+----------------+\n\nSELECT NVL2(\'x\',1,2);\n+---------------+\n| NVL2(\'x\',1,2) |\n+---------------+\n|             1 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/nvl2/','','https://mariadb.com/kb/en/nvl2/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (93,8,'SET TRANSACTION','Syntax\n------\n\nSET [GLOBAL | SESSION] TRANSACTION\n  transaction_property [, transaction_property] ...\n\ntransaction_property:\n  ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n\nlevel:\n  REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n\nDescription\n-----------\n\nThis statement sets the transaction isolation level or the transaction access\nmode globally, for the current session, or for the next transaction:\n\n* With the GLOBAL keyword, the statement sets the default\n transaction level globally for all subsequent sessions. Existing sessions are\n unaffected.\n* With the SESSION keyword, the statement sets the default\n transaction level for all subsequent transactions performed within the\n current session.\n* Without any SESSION or GLOBAL keyword,\n the statement sets the isolation level for the next (not started) transaction\n performed within the current session.\n\nA change to the global default isolation level requires the SUPER privilege.\nAny session is free to change its session isolation level (even in the middle\nof a transaction), or the isolation level for its next transaction.\n\nIsolation Level\n---------------\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option on the command line or in an option file.\nValues of level for this option use dashes rather than spaces, so the\nallowable values are READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, or\nSERIALIZABLE. For example, to set the default isolation level to REPEATABLE\nREAD, use these lines in the [mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\nTo determine the global and session transaction isolation levels at runtime,\ncheck the value of the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\n\nInnoDB supports each of the translation isolation levels described here using\ndifferent locking strategies. The default level is REPEATABLE READ. For\nadditional information about InnoDB record-level locks and how it uses them to\nexecute various types of statements, see InnoDB Lock Modes, and\nhttp://dev.mysql.com/doc/refman/en/innodb-locks-set.html.\n\nIsolation Levels\n----------------\n\nThe following sections describe how MariaDB supports the different transaction\nlevels.\n\nREAD UNCOMMITTED\n----------------\n\nSELECT statements are performed in a non-locking fashion, but a possible\nearlier version of a row might be used. Thus, using this isolation level, such\nreads are not consistent. This is also called a \"dirty read.\" Otherwise, this\nisolation level works like READ COMMITTED.\n\nREAD COMMITTED\n--------------\n\nA somewhat Oracle-like isolation level with respect to consistent\n(non-locking) reads: Each consistent read, even within the same transaction,\nsets and reads its own fresh snapshot. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n\nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), InnoDB locks\nonly index records, not the gaps before them, and thus allows the free\ninsertion of new records next to locked records. For UPDATE and DELETE\nstatements, locking depends on whether the statement uses a unique index with\na unique search condition (such as WHERE id = 100), or a range-type search\ncondition (such as WHERE id > 100). For a unique index with a unique search\ncondition, InnoDB locks only the index record found, not the gap before it.\nFor range-type searches, InnoDB locks the index range scanned, using gap locks\nor next-key (gap plus index-record) locks to block insertions by other\nsessions into the gaps covered by the range. This is necessary because\n\"phantom rows\" must be blocked for MySQL replication and recovery to work.\n\nNote: If the READ COMMITTED isolation level is used or the\ninnodb_locks_unsafe_for_binlog system variable is enabled, there is no InnoDB\ngap locking except for foreign-key constraint checking and duplicate-key\nchecking. Also, record locks for non-matching rows are released after MariaDB\nhas evaluated the WHERE condition.If you use READ COMMITTED or enable\ninnodb_locks_unsafe_for_binlog, you must use row-based binary logging.\n\nREPEATABLE READ\n---------------\n\nThis is the default isolation level for InnoDB. For consistent reads, there is\nan important difference from the READ COMMITTED isolation level: All\nconsistent reads within the same transaction read the snapshot established by\nthe first read. This convention means that if you issue several plain\n(non-locking) SELECT statements within the same transaction, these SELECT\nstatements are consistent also with respect to each other. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n\nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), UPDATE, and\nDELETE statements, locking depends on whether the statement uses a unique\nindex with a unique search condition, or a range-type search condition. For a\nunique index with a unique search condition, InnoDB locks only the index\nrecord found, not the gap before it. For other search conditions, InnoDB locks\nthe index range scanned, using gap locks or next-key (gap plus index-record)\nlocks to block insertions by other sessions into the gaps covered by the range.\n\nThis is the minimum isolation level for non-distributed XA transactions.\n\nSERIALIZABLE\n------------\n\nThis level is like REPEATABLE READ, but InnoDB implicitly converts all plain\nSELECT statements to SELECT ... LOCK IN SHARE MODE if autocommit is disabled.\nIf autocommit is enabled, the SELECT is its own transaction. It therefore is\nknown to be read only and can be serialized if performed as a consistent\n(non-locking) read and need not block for other transactions. (This means that\nto force a plain SELECT to block if other transactions have modified the\nselected rows, you should disable autocommit.)\n\nDistributed XA transactions should always use this isolation level.\n\nAccess Mode\n-----------\n\nThe access mode specifies whether the transaction is allowed to write data or\nnot. By default, transactions are in READ WRITE mode (see the tx_read_only\nsystem variable). READ ONLY mode allows the storage engine to apply\noptimizations that cannot be used for transactions which write data. The only\nexception to this rule is that read only transactions can perform DDL\nstatements on temporary tables.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the same\nstatement.\n\nREAD WRITE and READ ONLY can also be specified in the START TRANSACTION\nstatement, in which case the specified mode is only valid for one transaction.\n\nExamples\n--------\n\nSET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE;\n\nAttempting to set the isolation level within an existing transaction without\nspecifying GLOBAL or SESSION.\n\nSTART TRANSACTION;\n\nSET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed while a\ntransaction is in progress\n\nURL: https://mariadb.com/kb/en/set-transaction/','','https://mariadb.com/kb/en/set-transaction/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (94,8,'START TRANSACTION','Syntax\n------\n\nSTART TRANSACTION [transaction_property [, transaction_property] ...] | BEGIN\n[WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\ntransaction_property:\n  WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n\nDescription\n-----------\n\nThe START TRANSACTION or BEGIN statement begins a new transaction. COMMIT\ncommits the current transaction, making its changes permanent. ROLLBACK rolls\nback the current transaction, canceling its changes. The SET autocommit\nstatement disables or enables the default autocommit mode for the current\nsession.\n\nSTART TRANSACTION and SET autocommit = 1 implicitly commit the current\ntransaction, if any.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are the\nCHAIN and RELEASE clauses. CHAIN and RELEASE can be used for additional\ncontrol over transaction completion. The value of the completion_type system\nvariable determines the default completion behavior.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the current\none ends, and the new transaction has the same isolation level as the\njust-terminated transaction. The RELEASE clause causes the server to\ndisconnect the current client session after terminating the current\ntransaction. Including the NO keyword suppresses CHAIN or RELEASE completion,\nwhich can be useful if the completion_type system variable is set to cause\nchaining or release completion by default.\n\nAccess Mode\n-----------\n\nThe access mode specifies whether the transaction is allowed to write data or\nnot. By default, transactions are in READ WRITE mode (see the tx_read_only\nsystem variable). READ ONLY mode allows the storage engine to apply\noptimizations that cannot be used for transactions which write data. The only\nexception to this rule is that read only transactions can perform DDL\nstatements on temporary tables.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the same\nstatement.\n\nREAD WRITE and READ ONLY can also be specified in the SET TRANSACTION\nstatement, in which case the specified mode is valid for all sessions, or for\nall subsequent transaction used by the current session.\n\nautocommit\n----------\n\nBy default, MariaDB runs with autocommit mode enabled. This means that as soon\nas you execute a statement that updates (modifies) a table, MariaDB stores the\nupdate on disk to make it permanent. To disable autocommit mode, use the\nfollowing statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to zero,\nchanges to transaction-safe tables (such as those for InnoDB or NDBCLUSTER)\nare not made permanent immediately. You must use COMMIT to store your changes\nto disk or ROLLBACK to ignore the changes.\n\nTo disable autocommit mode for a single series of statements, use the START\nTRANSACTION statement.\n\nDDL Statements\n--------------\n\nDDL statements (CREATE, ALTER, DROP) and administrative statements (FLUSH,\nRESET, OPTIMIZE, ANALYZE, CHECK, REPAIR, CACHE INDEX), transaction management\nstatements (BEGIN, START TRANSACTION) and LOAD DATA INFILE, cause an implicit\nCOMMIT and start a new transaction. An exception to this rule are the DDL that\noperate on temporary tables: you can CREATE, ALTER and DROP them without\ncausing any COMMIT, but those actions cannot be rolled back. This means that\nif you call ROLLBACK, the temporary tables you created in the transaction will\nremain, while the rest of the transaction will be rolled back.\n\nTransactions cannot be used in Stored Functions or Triggers. In Stored\nProcedures and Events BEGIN is not allowed, so you should use START\nTRANSACTION instead.\n\nA transaction acquires a metadata lock on every table it accesses to prevent\nother connections from altering their structure. The lock is released at the\nend of the transaction. This happens even with non-transactional storage\nengines (like MEMORY or CONNECT), so it makes sense to use transactions with\nnon-transactional tables.\n\nin_transaction\n--------------\n\nThe in_transaction system variable is a session-only, read-only variable that\nreturns 1 inside a transaction, and 0 if not in a transaction.\n\nWITH CONSISTENT SNAPSHOT\n------------------------\n\nThe WITH CONSISTENT SNAPSHOT option starts a consistent read for storage\nengines such as InnoDB that can do so, the same as if a START TRANSACTION\nfollowed by a SELECT from any InnoDB table was issued.\n\nSee Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT.\n\nExamples\n--------\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nURL: https://mariadb.com/kb/en/start-transaction/','','https://mariadb.com/kb/en/start-transaction/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (95,8,'COMMIT','The COMMIT statement ends a transaction, saving any changes to the data so\nthat they become visible to subsequent transactions. Also, unlocks metadata\nchanged by current transaction. If autocommit is set to 1, an implicit commit\nis performed after each statement. Otherwise, all transactions which don\'t end\nwith an explicit COMMIT are implicitly rollbacked and the changes are lost.\nThe ROLLBACK statement can be used to do this explicitly.\n\nThe required syntax for the COMMIT statement is as follows:\n\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\n\nCOMMIT is the more important transaction terminator, as well as the more\ninteresting one. The basic form of the COMMIT statement is simply the keyword\nCOMMIT (the keyword WORK is simply noise and can be omitted without changing\nthe effect).\n\nThe optional AND CHAIN clause is a convenience for initiating a new\ntransaction as soon as the old transaction terminates. If AND CHAIN is\nspecified, then there is effectively nothing between the old and new\ntransactions, although they remain separate. The characteristics of the new\ntransaction will be the same as the characteristics of the old one — that is,\nthe new transaction will have the same access mode, isolation level and\ndiagnostics area size (we\'ll discuss all of these shortly) as the transaction\njust terminated.\n\nRELEASE tells the server to disconnect the client immediately after the\ncurrent transaction.\n\nThere are NO RELEASE and AND NO CHAIN options. By default, commits do not\nRELEASE or CHAIN, but it\'s possible to change this default behavior with the\ncompletion_type server system variable. In this case, the AND NO CHAIN and NO\nRELEASE options override the server default.\n\nURL: https://mariadb.com/kb/en/commit/','','https://mariadb.com/kb/en/commit/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (96,8,'ROLLBACK','The ROLLBACK statement rolls back (ends) a transaction, destroying any changes\nto SQL-data so that they never become visible to subsequent transactions. The\nrequired syntax for the ROLLBACK statement is as follows.\n\nROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] \n[ TO [ SAVEPOINT ] {<savepoint name> | <simple target specification>} ]\n\nThe ROLLBACK statement will either end a transaction, destroying all data\nchanges that happened during any of the transaction, or it will just destroy\nany data changes that happened since you established a savepoint. The basic\nform of the ROLLBACK statement is just the keyword ROLLBACK (the keyword WORK\nis simply noise and can be omitted without changing the effect).\n\nThe optional AND CHAIN clause is a convenience for initiating a new\ntransaction as soon as the old transaction terminates. If AND CHAIN is\nspecified, then there is effectively nothing between the old and new\ntransactions, although they remain separate. The characteristics of the new\ntransaction will be the same as the characteristics of the old one — that is,\nthe new transaction will have the same access mode, isolation level and\ndiagnostics area size (we\'ll discuss all of these shortly) as the transaction\njust terminated. The AND NO CHAIN option just tells your DBMS to end the\ntransaction — that is, these four SQL statements are equivalent:\n\nROLLBACK; \nROLLBACK WORK; \nROLLBACK AND NO CHAIN; \nROLLBACK WORK AND NO CHAIN;\n\nAll of them end a transaction without saving any transaction characteristics.\nThe only other options, the equivalent statements:\n\nROLLBACK AND CHAIN;\nROLLBACK WORK AND CHAIN;\n\nboth tell your DBMS to end a transaction, but to save that transaction\'s\ncharacteristics for the next transaction.\n\nROLLBACK is much simpler than COMMIT: it may involve no more than a few\ndeletions (of Cursors, locks, prepared SQL statements and log-file entries).\nIt\'s usually assumed that ROLLBACK can\'t fail, although such a thing is\nconceivable (for example, an encompassing transaction might reject an attempt\nto ROLLBACK because it\'s lining up for a COMMIT).\n\nROLLBACK cancels all effects of a transaction. It does not cancel effects on\nobjects outside the DBMS\'s control (for example the values in host program\nvariables or the settings made by some SQL/CLI function calls). But in\ngeneral, it is a convenient statement for those situations when you say \"oops,\nthis isn\'t working\" or when you simply don\'t care whether your temporary work\nbecomes permanent or not.\n\nHere is a moot question. If all you\'ve been doing is SELECTs, so that there\nhave been no data changes, should you end the transaction with ROLLBACK or\nCOMMIT? It shouldn\'t really matter because both ROLLBACK and COMMIT do the\nsame transaction-terminating job. However, the popular conception is that\nROLLBACK implies failure, so after a successful series of SELECT statements\nthe convention is to end the transaction with COMMIT rather than ROLLBACK.\n\nMariaDB (and most other DBMSs) supports rollback of SQL-data change\nstatements, but not of SQL-Schema statements. This means that if you use any\nof CREATE, ALTER, DROP, GRANT, REVOKE, you are implicitly committing at\nexecution time.\n\nINSERT INTO Table_2 VALUES(5); \nDROP TABLE Table_3 CASCADE; \nROLLBACK;\n\nThe result will be that both the INSERT and the DROP will go through as\nseparate transactions so the ROLLBACK will have no effect.\n\nURL: https://mariadb.com/kb/en/rollback/','','https://mariadb.com/kb/en/rollback/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (97,8,'LOCK TABLES','Syntax\n------\n\nLOCK TABLE[S]\n  tbl_name [[AS] alias] lock_type\n  [, tbl_name [[AS] alias] lock_type] ...\n  [WAIT n|NOWAIT]\n\nlock_type:\n  READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n | WRITE CONCURRENT\n\nUNLOCK TABLES\n\nDescription\n-----------\n\nThe lock_type can be one of:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| READ                      | Read lock, no writes allowed                   |\n+---------------------------+------------------------------------------------+\n| READ LOCAL                | Read lock, but allow concurrent inserts        |\n+---------------------------+------------------------------------------------+\n| WRITE                     | Exclusive write lock. No other connections     |\n|                           | can read or write to this table                |\n+---------------------------+------------------------------------------------+\n| LOW_PRIORITY WRITE        | Exclusive write lock, but allow new read       |\n|                           | locks on the table until we get the write      |\n|                           | lock.                                          |\n+---------------------------+------------------------------------------------+\n| WRITE CONCURRENT          | Exclusive write lock, but allow READ LOCAL     |\n|                           | locks to the table.                            |\n+---------------------------+------------------------------------------------+\n\nMariaDB enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to prevent\nother sessions from modifying tables during periods when a session requires\nexclusive access to them. A session can acquire or release locks only for\nitself. One session cannot acquire locks for another session or release locks\nheld by another session.\n\nLocks may be used to emulate transactions or to get more speed when updating\ntables.\n\nLOCK TABLES explicitly acquires table locks for the current client session.\nTable locks can be acquired for base tables or views. To use LOCK TABLES, you\nmust have the LOCK TABLES privilege, and the SELECT privilege for each object\nto be locked. See GRANT\n\nFor view locking, LOCK TABLES adds all base tables used in the view to the set\nof tables to be locked and locks them automatically. If you lock a table\nexplicitly with LOCK TABLES, any tables used in triggers are also locked\nimplicitly, as described in Triggers and Implicit Locks.\n\nUNLOCK TABLES explicitly releases any table locks held by the current session.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nLimitations\n-----------\n\n* LOCK TABLES doesn\'t work when using Galera cluster.   You may experience\ncrashes or locks when used with Galera.\n* LOCK TABLES works on XtraDB/InnoDB tables only if the innodb_table_locks\nsystem variable is set to 1 (the default) and autocommit is set to 0 (1 is\ndefault). Please note that no error message will be returned on LOCK TABLES\nwith innodb_table_locks = 0.\n* LOCK TABLES implicitly commits the active transaction, if any. Also,\nstarting a transaction always releases all table locks acquired with LOCK\nTABLES. This means that there is no way to have table locks and an active\ntransaction at the same time. The only exceptions are the transactions in\nautocommit mode. To preserve the data integrity between transactional and\nnon-transactional tables, the GET_LOCK() function can be used.\n* When using LOCK TABLES on a TEMPORARY table, it will always be locked with a\nWRITE lock.\n* While a connection holds an explicit read lock on a table, it cannot modify\nit. If you try, the following error will be produced:\n\nERROR 1099 (HY000): Table \'tab_name\' was locked with a READ lock and can\'t be\nupdated\n\n* While a connection holds an explicit lock on a table, it cannot access a\nnon-locked table. If you try, the following error will be produced:\n\nERROR 1100 (HY000): Table \'tab_name\' was not locked with LOCK TABLES\n\n* While a connection holds an explicit lock on a table, it cannot issue the\nfollowing: INSERT DELAYED, CREATE TABLE, CREATE TABLE ... LIKE, and DDL\nstatements involving stored programs and views (except for triggers). If you\ntry, the following error will be produced:\n\nERROR 1192 (HY000): Can\'t execute the given command because you have active\nlocked tables or an active transaction\n\n* LOCK TABLES can not be used in stored routines - if you try, the following\nerror will be produced on creation. This restriction was removed in MariaDB\n10.6.2:\n\nERROR 1314 (0A000): LOCK is not allowed in stored procedures\n\nURL: https://mariadb.com/kb/en/lock-tables/','','https://mariadb.com/kb/en/lock-tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (98,8,'SAVEPOINT','Syntax\n------\n\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nDescription\n-----------\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT, RELEASE\nSAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nEach savepoint must have a legal MariaDB identifier. A savepoint is a named\nsub-transaction.\n\nNormally ROLLBACK undoes the changes performed by the whole transaction. When\nused with the TO clause, it undoes the changes performed after the specified\nsavepoint, and erases all subsequent savepoints. However, all locks that have\nbeen acquired after the save point will survive. RELEASE SAVEPOINT does not\nrollback or commit any changes, but removes the specified savepoint.\n\nWhen the execution of a trigger or a stored function begins, it is not\npossible to use statements which reference a savepoint which was defined from\nout of that stored program.\n\nWhen a COMMIT (including implicit commits) or a ROLLBACK statement (with no TO\nclause) is performed, they act on the whole transaction, and all savepoints\nare removed.\n\nErrors\n------\n\nIf COMMIT or ROLLBACK is issued and no transaction was started, no error is\nreported.\n\nIf SAVEPOINT is issued and no transaction was started, no error is reported\nbut no savepoint is created. When ROLLBACK TO SAVEPOINT or RELEASE SAVEPOINT\nis called for a savepoint that does not exist, an error like this is issued:\n\nERROR 1305 (42000): SAVEPOINT svp_name does not exist\n\nURL: https://mariadb.com/kb/en/savepoint/','','https://mariadb.com/kb/en/savepoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (99,8,'Metadata Locking','MariaDB supports metadata locking. This means that when a transaction\n(including XA transactions) uses a table, it locks its metadata until the end\nof transaction. Non-transactional tables are also locked, as well as views and\nobjects which are related to locked tables/views (stored functions, triggers,\netc). When a connection tries to use a DDL statement (like an ALTER TABLE)\nwhich modifies a table that is locked, that connection is queued, and has to\nwait until it\'s unlocked. Using savepoints and performing a partial rollback\ndoes not release metadata locks.\n\nLOCK TABLES ... WRITE are also queued. Some wrong statements which produce an\nerror may not need to wait for the lock to be freed.\n\nThe metadata lock\'s timeout is determined by the value of the\nlock_wait_timeout server system variable (in seconds). However, note that its\ndefault value is 31536000 (1 year, MariaDB <= 10.2.3), or 86400 (1 day,\nMariaDB >= 10.2.4). If this timeout is exceeded, the following error is\nreturned:\n\nERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table stores information about existing metadata locks.\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5, the Performance Schema metadata_locks table contains\nmetadata lock information.\n\nExample\n-------\n\nLet\'s use the following MEMORY (non-transactional) table:\n\nCREATE TABLE t (a INT) ENGINE = MEMORY;\n\nConnection 1 starts a transaction, and INSERTs a row into t:\n\nSTART TRANSACTION;\n\nINSERT INTO t SET a=1;\n\nt\'s metadata is now locked by connection 1. Connection 2 tries to alter t, but\nhas to wait:\n\nALTER TABLE t ADD COLUMN b INT;\n\nConnection 2\'s prompt is blocked now.\n\nNow connection 1 ends the transaction:\n\nCOMMIT;\n\n...and connection 2 finally gets the output of its command:\n\nQuery OK, 1 row affected (35.23 sec)\nRecords: 1  Duplicates: 0  Warnings: 0\n\nURL: https://mariadb.com/kb/en/metadata-locking/','','https://mariadb.com/kb/en/metadata-locking/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,8,'Transaction Timeouts','MariaDB has always had the wait_timeout and interactive_timeout settings,\nwhich close connections after a certain period of inactivity.\n\nHowever, these are by default set to a long wait period. In situations where\ntransactions may be started, but not committed or rolled back, more granular\ncontrol and a shorter timeout may be desirable so as to avoid locks being held\nfor too long.\n\nMariaDB 10.3 introduced three new variables to handle this situation.\n\n* idle_transaction_timeout (all transactions)\n* idle_write_transaction_timeout (write transactions - called\nidle_readwrite_transaction_timeout until MariaDB 10.3.2)\n* idle_readonly_transaction_timeout (read transactions)\n\nThese accept a time in seconds to time out, by closing the connection,\ntransactions that are idle for longer than this period. By default all are set\nto zero, or no timeout.\n\nidle_transaction_timeout affects all transactions,\nidle_write_transaction_timeout affects write transactions only and\nidle_readonly_transaction_timeout affects read transactions only. The latter\ntwo variables work independently. However, if either is set along with\nidle_transaction_timeout, the settings for idle_write_transaction_timeout or\nidle_readonly_transaction_timeout will take precedence.\n\nExamples\n--------\n\nSET SESSION idle_transaction_timeout=2;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nSET SESSION idle_write_transaction_timeout=2;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\nEmpty set (0.000 sec)\nINSERT INTO t VALUES(1);\n## wait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nSET SESSION idle_transaction_timeout=2, SESSION\nidle_readonly_transaction_timeout=10;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n ## wait 3 seconds\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 11 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nURL: https://mariadb.com/kb/en/transaction-timeouts/','','https://mariadb.com/kb/en/transaction-timeouts/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (101,8,'UNLOCK TABLES','Syntax\n------\n\nUNLOCK TABLES\n\nDescription\n-----------\n\nUNLOCK TABLES explicitly releases any table locks held by the current session.\nSee LOCK TABLES for more information.\n\nIn addition to releasing table locks acquired by the LOCK TABLES statement,\nthe UNLOCK TABLES statement also releases the global read lock acquired by the\nFLUSH TABLES WITH READ LOCK statement. The FLUSH TABLES WITH READ LOCK\nstatement is very useful for performing backups. See FLUSH for more\ninformation about FLUSH TABLES WITH READ LOCK.\n\nURL: https://mariadb.com/kb/en/transactions-unlock-tables/','','https://mariadb.com/kb/en/transactions-unlock-tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,8,'WAIT and NOWAIT','MariaDB starting with 10.3.0\n----------------------------\nMariaDB 10.3.0 introduced extended syntax so that it is possible to set\ninnodb_lock_wait_timeout and lock_wait_timeout for the following statements:\n\nSyntax\n------\n\nALTER TABLE tbl_name [WAIT n|NOWAIT] ...\nCREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT n|NOWAIT] ...\nDROP INDEX ... [WAIT n|NOWAIT]\nDROP TABLE tbl_name [WAIT n|NOWAIT] ...\nLOCK TABLE ... [WAIT n|NOWAIT]\nOPTIMIZE TABLE tbl_name [WAIT n|NOWAIT]\nRENAME TABLE tbl_name [WAIT n|NOWAIT] ...\nSELECT ... FOR UPDATE [WAIT n|NOWAIT]\nSELECT ... LOCK IN SHARE MODE [WAIT n|NOWAIT]\nTRUNCATE TABLE tbl_name [WAIT n|NOWAIT]\n\nDescription\n-----------\n\nThe lock wait timeout can be explicitly set in the statement by using either\nWAIT n (to set the wait in seconds) or NOWAIT, in which case the statement\nwill immediately fail if the lock cannot be obtained. WAIT 0 is equivalent to\nNOWAIT.\n\nURL: https://mariadb.com/kb/en/wait-and-nowait/','','https://mariadb.com/kb/en/wait-and-nowait/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (103,8,'XA Transactions','Overview\n--------\n\nThe MariaDB XA implementation is based on the X/Open CAE document Distributed\nTransaction Processing: The XA Specification. This document is published by\nThe Open Group and available at\nhttp://www.opengroup.org/public/pubs/catalog/c193.htm.\n\nXA transactions are designed to allow distributed transactions, where a\ntransaction manager (the application) controls a transaction which involves\nmultiple resources. Such resources are usually DBMSs, but could be resources\nof any type. The whole set of required transactional operations is called a\nglobal transaction. Each subset of operations which involve a single resource\nis called a local transaction. XA used a 2-phases commit (2PC). With the first\ncommit, the transaction manager tells each resource to prepare an effective\ncommit, and waits for a confirm message. The changes are not still made\neffective at this point. If any of the resources encountered an error, the\ntransaction manager will rollback the global transaction. If all resources\ncommunicate that the first commit is successful, the transaction manager can\nrequire a second commit, which makes the changes effective.\n\nIn MariaDB, XA transactions can only be used with storage engines that support\nthem. At least InnoDB, TokuDB, SPIDER and MyRocks support them. For InnoDB,\nuntil MariaDB 10.2, XA transactions can be disabled by setting the\ninnodb_support_xa server system variable to 0. From MariaDB 10.3, XA\ntransactions are always supported.\n\nLike regular transactions, XA transactions create metadata locks on accessed\ntables.\n\nXA transactions require REPEATABLE READ as a minimum isolation level. However,\ndistributed transactions should always use SERIALIZABLE.\n\nTrying to start more than one XA transaction at the same time produces a 1400\nerror (SQLSTATE \'XAE09\'). The same error is produced when attempting to start\nan XA transaction while a regular transaction is in effect. Trying to start a\nregular transaction while an XA transaction is in effect produces a 1399 error\n(SQLSTATE \'XAE07\').\n\nThe statements that cause an implicit COMMIT for regular transactions produce\na 1400 error (SQLSTATE \'XAE09\') if a XA transaction is in effect.\n\nInternal XA vs External XA\n--------------------------\n\nXA transactions are an overloaded term in MariaDB. If a storage engine is\nXA-capable, it can mean one or both of these:\n\n* It supports MariaDB\'s internal two-phase commit API. This is transparent to\nthe user. Sometimes this is called \"internal XA\", since MariaDB\'s internal\ntransaction coordinator log can handle coordinating these transactions.\n\n* It supports XA transactions, with the XA START, XA PREPARE, XA COMMIT, etc.\nstatements. Sometimes this is called \"external XA\", since it requires the use\nof an external transaction coordinator to use this feature properly.\n\nTransaction Coordinator Log\n---------------------------\n\nIf you have two or more XA-capable storage engines enabled, then a transaction\ncoordinator log must be available.\n\nThere are currently two implementations of the transaction coordinator log:\n\n* Binary log-based transaction coordinator log\n* Memory-mapped file-based transaction coordinator log\n\nIf the binary log is enabled on a server, then the server will use the binary\nlog-based transaction coordinator log. Otherwise, it will use the\nmemory-mapped file-based transaction coordinator log.\n\nSee Transaction Coordinator Log for more information.\n\nSyntax\n------\n\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER [FORMAT=[\'RAW\'|\'SQL\']]\n\nxid: gtrid [, bqual [, formatID ]]\n\nThe interface to XA transactions is a set of SQL statements starting with XA.\nEach statement changes a transaction\'s state, determining which actions it can\nperform. A transaction which does not exist is in the NON-EXISTING state.\n\nXA START (or BEGIN) starts a transaction and defines its xid (a transaction\nidentifier). The JOIN or RESUME keywords have no effect. The new transaction\nwill be in ACTIVE state.\n\nThe xid can have 3 components, though only the first one is mandatory. gtrid\nis a quoted string representing a global transaction identifier. bqual is a\nquoted string representing a local transaction identifier. formatID is an\nunsigned integer indicating the format used for the first two components; if\nnot specified, defaults to 1. MariaDB does not interpret in any way these\ncomponents, and only uses them to identify a transaction. xids of transactions\nin effect must be unique.\n\nXA END declares that the specified ACTIVE transaction is finished and it\nchanges its state to IDLE. SUSPEND [FOR MIGRATE] has no effect.\n\nXA PREPARE prepares an IDLE transaction for commit, changing its state to\nPREPARED. This is the first commit.\n\nXA COMMIT definitely commits and terminates a transaction which has already\nbeen PREPARED. If the ONE PHASE clause is specified, this statements performs\na 1-phase commit on an IDLE transaction.\n\nXA ROLLBACK rolls back and terminates an IDLE or PREPARED transaction.\n\nXA RECOVER shows information about all PREPARED transactions.\n\nWhen trying to execute an operation which is not allowed for the transaction\'s\ncurrent state, an error is produced:\n\nXA COMMIT \'test\' ONE PHASE;\nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global\ntransaction is in the  ACTIVE state\n\nXA COMMIT \'test2\';\nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global\ntransaction is in the  NON-EXISTING state\n\nXA RECOVER\n----------\n\nThe XA RECOVER statement shows information about all transactions which are in\nthe PREPARED state. It does not matter which connection created the\ntransaction: if it has been PREPARED, it appears. But this does not mean that\na connection can commit or rollback a transaction which was started by another\nconnection. Note that transactions using a 1-phase commit are never in the\nPREPARED state, so they cannot be shown by XA RECOVER.\n\nXA RECOVER produces four columns:\n\nXA RECOVER;\n+----------+--------------+--------------+------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+------+\n|        1 |            4 |            0 | test |\n+----------+--------------+--------------+------+\n\nMariaDB starting with 10.3.3\n----------------------------\nYou can use XA RECOVER FORMAT=\'SQL\' to get the data in a human readable form\nthat can be directly copy-pasted into XA COMMIT or XA ROLLBACK. This is\nparticularly useful for binary xid generated by some transaction coordinators.\n\nformatID is the formatID part of xid.\n\ndata are the gtrid and bqual parts of xid, concatenated.\n\ngtrid_length and bqual_length are the lengths of gtrid and bqual, respectevely.\n\nExamples\n--------\n\n2-phases commit:\n\nXA START \'test\';\n\nINSERT INTO t VALUES (1,2);\n\nXA END \'test\';\n\nXA PREPARE \'test\';\n\nXA COMMIT \'test\';\n\n1-phase commit:\n\nXA START \'test\';\n\nINSERT INTO t VALUES (1,2);\n\nXA END \'test\';\n\nXA COMMIT \'test\' ONE PHASE;\n\nHuman-readable:\n\nxa start \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n\ninsert t1 values (40);\n\nxa end \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n\nxa prepare \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n\nxa recover format=\'RAW\';\n+----------+--------------+--------------+--------------------+\n| formatID | gtrid_length | bqual_length | data               |\n+----------+--------------+--------------+--------------------+\n34      67v78abc       11 |            7 | 12\ndef |\n+----------+--------------+--------------+--------------------+\n\nxa recover format=\'SQL\';\n+----------+--------------+--------------+-------------------------------------\n---------+\n| formatID | gtrid_length | bqual_length | data                               \n     |\n+----------+--------------+--------------+-------------------------------------\n---------+\n|        3 |           11 |            7 |\nX\'31320d3334093637763738\',X\'6162630a646566\',3 |\n+----------+--------------+--------------+-------------------------------------\n---------+\n\nxa rollback X\'31320d3334093637763738\',X\'6162630a646566\',3;\n\nKnown Issues\n------------\n\nMariaDB Galera Cluster\n----------------------\n\nMariaDB Galera Cluster does not support XA transactions.\n\nHowever, MariaDB Galera Cluster builds include a built-in plugin called wsrep.\nPrior to MariaDB 10.4.3, this plugin was internally considered an XA-capable\nstorage engine. Consequently, these MariaDB Galera Cluster builds have\nmultiple XA-capable storage engines by default, even if the only \"real\"\nstorage engine that supports external XA transactions enabled on these builds\nby default is InnoDB. Therefore, when using one these builds MariaDB would be\nforced to use a transaction coordinator log by default, which could have\nperformance implications.\n\nSee Transaction Coordinator Log Overview: MariaDB Galera Cluster for more\ninformation.\n\nURL: https://mariadb.com/kb/en/xa-transactions/','','https://mariadb.com/kb/en/xa-transactions/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,10,'CREATE USER','Syntax\n------\n\nCREATE [OR REPLACE] USER [IF NOT EXISTS] \n user_specification [,user_specification ...] \n [REQUIRE {NONE | tls_option [[AND] tls_option ...] }]\n [WITH resource_option [resource_option ...] ]\n [lock_option] [password_option]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule  ...]\n\nauthentication_rule:\n  authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\ntls_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n\nlock_option:\n  ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nDescription\n-----------\n\nThe CREATE USER statement creates new MariaDB accounts. To use it, you must\nhave the global CREATE USER privilege or the INSERT privilege for the mysql\ndatabase. For each account, CREATE USER creates a new row in mysql.user (until\nMariaDB 10.3 this is a table, from MariaDB 10.4 it\'s a view) or\nmysql.global_priv_table (from MariaDB 10.4) that has no privileges.\n\nIf any of the specified accounts, or any permissions for the specified\naccounts, already exist, then the server returns ERROR 1396 (HY000). If an\nerror occurs, CREATE USER will still create the accounts that do not result in\nan error. Only one error is produced for all users which have not been created:\n\nERROR 1396 (HY000): \n Operation CREATE USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n\nCREATE USER, DROP USER, CREATE ROLE, and DROP ROLE all produce the same error\ncode when they fail.\n\nSee Account Names below for details on how account names are specified.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it is basically a shortcut for:\n\nDROP USER IF EXISTS name;\nCREATE USER name ...;\n\nFor example:\n\nCREATE USER foo2@test IDENTIFIED BY \'password\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'foo2\'@\'test\'\n\nCREATE OR REPLACE USER foo2@test IDENTIFIED BY \'password\';\nQuery OK, 0 rows affected (0.00 sec)\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified user already exists.\n\nFor example:\n\nCREATE USER foo2@test IDENTIFIED BY \'password\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'foo2\'@\'test\'\n\nCREATE USER IF NOT EXISTS foo2@test IDENTIFIED BY \'password\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------------+\n| Level | Code | Message                                            |\n+-------+------+----------------------------------------------------+\n| Note  | 1973 | Can\'t create user \'foo2\'@\'test\'; it already exists |\n+-------+------+----------------------------------------------------+\n\nAuthentication Options\n----------------------\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored in the\nmysql.user/mysql.global_priv_table table.\n\nFor example, if our password is mariadb, then we can create the user with:\n\nCREATE USER foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD function. It will be stored in the\nmysql.user/mysql.global_priv_table table as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\')                       |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n\nAnd then we can create a user with the hash:\n\nCREATE USER foo2@test IDENTIFIED BY PASSWORD\n\'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nCREATE USER foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nCREATE USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nMariaDB starting with 10.4.0\n----------------------------\nThe USING or AS keyword can also be used to provide a plain-text password to a\nplugin if it\'s provided as an argument to the PASSWORD() function. This is\nonly valid for authentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication plugin supports\nthis:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nMariaDB starting with 10.4.3\n----------------------------\nOne can specify many authentication plugins, they all work as alternatives\nways of authenticating a user:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\') OR\nunix_socket;\n\nBy default, when you create a user without specifying an authentication\nplugin, MariaDB uses the mysql_native_password plugin.\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| REQUIRE NONE              | TLS is not required for this account, but can  |\n|                           | still be used.                                 |\n+---------------------------+------------------------------------------------+\n| REQUIRE SSL               | The account must use TLS, but no valid X509    |\n|                           | certificate is required. This option cannot    |\n|                           | be combined with other TLS options.            |\n+---------------------------+------------------------------------------------+\n| REQUIRE X509              | The account must use TLS and must have a       |\n|                           | valid X509 certificate. This option implies    |\n|                           | REQUIRE SSL. This option cannot be combined    |\n|                           | with other TLS options.                        |\n+---------------------------+------------------------------------------------+\n| REQUIRE ISSUER \'issuer\'   | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the Certificate  |\n|                           | Authority must be the one specified via the    |\n|                           | string issuer. This option implies REQUIRE     |\n|                           | X509. This option can be combined with the     |\n|                           | SUBJECT, and CIPHER options in any order.      |\n+---------------------------+------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the              |\n|                           | certificate\'s Subject must be the one          |\n|                           | specified via the string subject. This option  |\n|                           | implies REQUIRE X509. This option can be       |\n|                           | combined with the ISSUER, and CIPHER options   |\n|                           | in any order.                                  |\n+---------------------------+------------------------------------------------+\n| REQUIRE CIPHER \'cipher\'   | The account must use TLS, but no valid X509    |\n|                           | certificate is required. Also, the encryption  |\n|                           | used for the connection must use a specific    |\n|                           | cipher method specified in the string cipher.  |\n|                           | This option implies REQUIRE SSL. This option   |\n|                           | can be combined with the ISSUER, and SUBJECT   |\n|                           | options in any order.                          |\n+---------------------------+------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can create a user account that requires these TLS options\nwith the following:\n\nCREATE USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nResource Limit Options\n----------------------\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+--------------------------------------+--------------------------------------+\n| Limit Type                           | Decription                           |\n+--------------------------------------+--------------------------------------+\n| MAX_QUERIES_PER_HOUR                 | Number of statements that the        |\n|                                      | account can issue per hour           |\n|                                      | (including updates)                  |\n+--------------------------------------+--------------------------------------+\n| MAX_UPDATES_PER_HOUR                 | Number of updates (not queries)      |\n|                                      | that the account can issue per hour  |\n+--------------------------------------+--------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR             | Number of connections that the       |\n|                                      | account can start per hour           |\n+--------------------------------------+--------------------------------------+\n| MAX_USER_CONNECTIONS                 | Number of simultaneous connections   |\n|                                      | that can be accepted from the same   |\n|                                      | account; if it is 0,                 |\n|                                      | max_connections will be used         |\n|                                      | instead; if max_connections is 0,    |\n|                                      | there is no limit for this           |\n|                                      | account\'s simultaneous connections.  |\n+--------------------------------------+--------------------------------------+\n| MAX_STATEMENT_TIME                   | Timeout, in seconds, for statements  |','','https://mariadb.com/kb/en/create-user/');
update help_topic set description = CONCAT(description, '\n|                                      | executed by the user. See also       |\n|                                      | Aborting Statements that Exceed a    |\n|                                      | Certain Time to Execute.             |\n+--------------------------------------+--------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nHere is an example showing how to create a user with resource limits:\n\nCREATE USER \'someone\'@\'localhost\' WITH\n  MAX_USER_CONNECTIONS 10\n  MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nAccount Names\n-------------\n\nAccount names have both a user name component and a host name component, and\nare specified as \'user_name\'@\'host_name\'.\n\nThe user name and host name may be unquoted, quoted as strings using double\nquotes (\") or single quotes (\'), or quoted as identifiers using backticks (`).\nYou must use quotes when using special characters (such as a hyphen) or\nwildcard characters. If you quote, you must quote the user name and host name\nseparately (for example \'user_name\'@\'host_name\').\n\nHost Name Component\n-------------------\n\nIf the host name is not provided, it is assumed to be \'%\'.\n\nHost names may contain the wildcard characters % and _. They are matched as if\nby the LIKE clause. If you need to use a wildcard character literally (for\nexample, to match a domain name with an underscore), prefix the character with\na backslash. See LIKE for more information on escaping wildcard characters.\n\nHost name matches are case-insensitive. Host names can match either domain\nnames or IP addresses. Use \'localhost\' as the host name to allow only local\nclient connections.\n\nYou can use a netmask to match a range of IP addresses using \'base_ip/netmask\'\nas the host name. A user with an IP address ip_addr will be allowed to connect\nif the following condition is true:\n\nip_addr & netmask = base_ip\n\nFor example, given a user:\n\nCREATE USER \'maria\'@\'247.150.130.0/255.255.255.0\';\n\nthe IP addresses satisfying this condition range from 247.150.130.0 to\n247.150.130.255.\n\nUsing 255.255.255.255 is equivalent to not using a netmask at all. Netmasks\ncannot be used for IPv6 addresses.\n\nNote that the credentials added when creating a user with the \'%\' wildcard\nhost will not grant access in all cases. For example, some systems come with\nan anonymous localhost user, and when connecting from localhost this will take\nprecedence.\n\nBefore MariaDB 10.6, the host name component could be up to 60 characters in\nlength. Starting from MariaDB 10.6, it can be up to 255 characters.\n\nUser Name Component\n-------------------\n\nUser names must match exactly, including case. A user name that is empty is\nknown as an anonymous account and is allowed to match a login attempt with any\nuser name component. These are described more in the next section.\n\nFor valid identifiers to use as user names, see Identifier Names.\n\nIt is possible for more than one account to match when a user connects.\nMariaDB selects the first matching account after sorting according to the\nfollowing criteria:\n\n* Accounts with an exact host name are sorted before accounts using a wildcard\nin the\nhost name. Host names using a netmask are considered to be exact for sorting.\n* Accounts with a wildcard in the host name are sorted according to the\nposition of\nthe first wildcard character. Those with a wildcard character later in the\nhost name\nsort before those with a wildcard character earlier in the host name.\n* Accounts with a non-empty user name sort before accounts with an empty user\nname.\n* Accounts with an empty user name are sorted last. As mentioned previously,\nthese are known as anonymous accounts. These are described more in the next\nsection.\n\nThe following table shows a list of example account as sorted by these\ncriteria:\n\n+---------+-------------+\n| User    | Host        |\n+---------+-------------+\n| joffrey | 192.168.0.3 |\n|         | 192.168.0.% |\n| joffrey | 192.168.%   |\n|         | 192.168.%   |\n+---------+-------------+\n\nOnce connected, you only have the privileges granted to the account that\nmatched, not all accounts that could have matched. For example, consider the\nfollowing commands:\n\nCREATE USER \'joffrey\'@\'192.168.0.3\';\nCREATE USER \'joffrey\'@\'%\';\nGRANT SELECT ON test.t1 to \'joffrey\'@\'192.168.0.3\';\nGRANT SELECT ON test.t2 to \'joffrey\'@\'%\';\n\nIf you connect as joffrey from 192.168.0.3, you will have the SELECT privilege\non the table test.t1, but not on the table test.t2. If you connect as joffrey\nfrom any other IP address, you will have the SELECT privilege on the table\ntest.t2, but not on the table test.t1.\n\nUsernames can be up to 80 characters long before 10.6 and starting from 10.6\nit can be 128 characters long.\n\nAnonymous Accounts\n------------------\n\nAnonymous accounts are accounts where the user name portion of the account\nname is empty. These accounts act as special catch-all accounts. If a user\nattempts to log into the system from a host, and an anonymous account exists\nwith a host name portion that matches the user\'s host, then the user will log\nin as the anonymous account if there is no more specific account match for the\nuser name that the user entered.\n\nFor example, here are some anonymous accounts:\n\nCREATE USER \'\'@\'localhost\';\nCREATE USER \'\'@\'192.168.0.3\';\n\nFixing a Legacy Default Anonymous Account\n-----------------------------------------\n\nOn some systems, the mysql.db table has some entries for the \'\'@\'%\' anonymous\naccount by default. Unfortunately, there is no matching entry in the\nmysql.user/mysql.global_priv_table table, which means that this anonymous\naccount doesn\'t exactly exist, but it does have privileges--usually on the\ndefault test database created by mysql_install_db. These account-less\nprivileges are a legacy that is leftover from a time when MySQL\'s privilege\nsystem was less advanced.\n\nThis situation means that you will run into errors if you try to create a\n\'\'@\'%\' account. For example:\n\nCREATE USER \'\'@\'%\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'\'@\'%\'\n\nThe fix is to DELETE the row in the mysql.db table and then execute FLUSH\nPRIVILEGES:\n\nDELETE FROM mysql.db WHERE User=\'\' AND Host=\'%\';\nFLUSH PRIVILEGES;\n\nAnd then the account can be created:\n\nCREATE USER \'\'@\'%\';\nQuery OK, 0 rows affected (0.01 sec)\n\nSee MDEV-13486 for more information.\n\nPassword Expiry\n---------------\n\nMariaDB starting with 10.4.3\n----------------------------\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal setting, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nSee User Password Expiry for more details.\n\nAccount Locking\n---------------\n\nMariaDB starting with 10.4.2\n----------------------------\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected). For example:\n\nCREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nSee Account Locking for more details.\n\nFrom MariaDB 10.4.7 and MariaDB 10.5.8, the lock_option and password_option\nclauses can occur in either order.\n\nURL: https://mariadb.com/kb/en/create-user/') WHERE help_topic_id = 104;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (105,10,'ALTER USER','Syntax\n------\n\nALTER USER [IF EXISTS] \n user_specification [,user_specification] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [lock_option] [password_option]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule] ...\n\nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\ntls_option\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nresource_option\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n\nlock_option:\n  ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nDescription\n-----------\n\nThe ALTER USER statement modifies existing MariaDB accounts. To use it, you\nmust have the global CREATE USER privilege or the UPDATE privilege for the\nmysql database. The global SUPER privilege is also required if the read_only\nsystem variable is enabled.\n\nIf any of the specified user accounts do not yet exist, an error results. If\nan error occurs, ALTER USER will still modify the accounts that do not result\nin an error. Only one error is produced for all users which have not been\nmodified.\n\nIF EXISTS\n---------\n\nWhen the IF EXISTS clause is used, MariaDB will return a warning instead of an\nerror for each specified user that does not exist.\n\nAccount Names\n-------------\n\nFor ALTER USER statements, account names are specified as the username\nargument in the same way as they are for CREATE USER statements. See account\nnames from the CREATE USER page for details on how account names are specified.\n\nCURRENT_USER or CURRENT_USER() can also be used to alter the account logged\ninto the current session. For example, to change the current user\'s password\nto mariadb:\n\nALTER USER CURRENT_USER() IDENTIFIED BY \'mariadb\';\n\nAuthentication Options\n----------------------\n\nMariaDB starting with 10.4\n--------------------------\nFrom MariaDB 10.4, it is possible to use more than one authentication plugin\nfor each user account. For example, this can be useful to slowly migrate users\nto the more secure ed25519 authentication plugin over time, while allowing the\nold mysql_native_password authentication plugin as an alternative for the\ntransitional period. See Authentication from MariaDB 10.4 for more.\n\nWhen running ALTER USER, not specifying an authentication option in the\nIDENTIFIED VIA clause will remove that authentication method. (However this\nwas not the case before MariaDB 10.4.13, see MDEV-21928)\n\nFor example, a user is created with the ability to authenticate via both a\npassword and unix_socket:\n\nCREATE USER \'bob\'@\'localhost\' \n IDENTIFIED VIA mysql_native_password USING PASSWORD(\'pwd\')\n OR unix_socket;\n\nSHOW CREATE USER \'bob\'@\'localhost\'\\G\n*************************** 1. row ***************************\nCREATE USER for bob@localhost: CREATE USER `bob`@`localhost` \n IDENTIFIED VIA mysql_native_password\n USING \'*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD\'\n OR unix_socket\n\nIf the user\'s password is updated, but unix_socket authentication is not\nspecified in the IDENTIFIED VIA clause, unix_socket authentication will no\nlonger be permitted.\n\nALTER USER \'bob\'@\'localhost\' IDENTIFIED VIA mysql_native_password \n USING PASSWORD(\'pwd2\');\n\nSHOW CREATE USER \'bob\'@\'localhost\'\\G\n*************************** 1. row ***************************\nCREATE USER for bob@localhost: CREATE USER `bob`@`localhost` \n IDENTIFIED BY PASSWORD \'*38366FDA01695B6A5A9DD4E428D9FB8F7EB75512\'\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored to the mysql.user table.\n\nFor example, if our password is mariadb, then we can set the account\'s\npassword with:\n\nALTER USER foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD#function. It will be stored to the\nmysql.user table as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\')                       |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n\nAnd then we can set an account\'s password with the hash:\n\nALTER USER foo2@test \n IDENTIFIED BY PASSWORD \'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nALTER USER foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nALTER USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nIn MariaDB 10.4 and later, the USING or AS keyword can also be used to provide\na plain-text password to a plugin if it\'s provided as an argument to the\nPASSWORD() function. This is only valid for authentication plugins that have\nimplemented a hook for the PASSWORD() function. For example, the ed25519\nauthentication plugin supports this:\n\nALTER USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| REQUIRE NONE              | TLS is not required for this account, but can  |\n|                           | still be used.                                 |\n+---------------------------+------------------------------------------------+\n| REQUIRE SSL               | The account must use TLS, but no valid X509    |\n|                           | certificate is required. This option cannot    |\n|                           | be combined with other TLS options.            |\n+---------------------------+------------------------------------------------+\n| REQUIRE X509              | The account must use TLS and must have a       |\n|                           | valid X509 certificate. This option implies    |\n|                           | REQUIRE SSL. This option cannot be combined    |\n|                           | with other TLS options.                        |\n+---------------------------+------------------------------------------------+\n| REQUIRE ISSUER \'issuer\'   | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the Certificate  |\n|                           | Authority must be the one specified via the    |\n|                           | string issuer. This option implies REQUIRE     |\n|                           | X509. This option can be combined with the     |\n|                           | SUBJECT, and CIPHER options in any order.      |\n+---------------------------+------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the              |\n|                           | certificate\'s Subject must be the one          |\n|                           | specified via the string subject. This option  |\n|                           | implies REQUIRE X509. This option can be       |\n|                           | combined with the ISSUER, and CIPHER options   |\n|                           | in any order.                                  |\n+---------------------------+------------------------------------------------+\n| REQUIRE CIPHER \'cipher\'   | The account must use TLS, but no valid X509    |\n|                           | certificate is required. Also, the encryption  |\n|                           | used for the connection must use a specific    |\n|                           | cipher method specified in the string cipher.  |\n|                           | This option implies REQUIRE SSL. This option   |\n|                           | can be combined with the ISSUER, and SUBJECT   |\n|                           | options in any order.                          |\n+---------------------------+------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can alter a user account to require these TLS options with\nthe following:\n\nALTER USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\' AND\n ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nResource Limit Options\n----------------------\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+------------------------------------+---------------------------------------+\n| Limit Type                         | Description                           |\n+------------------------------------+---------------------------------------+\n| MAX_QUERIES_PER_HOUR               | Number of statements that the         |\n|                                    | account can issue per hour            |\n|                                    | (including updates)                   |\n+------------------------------------+---------------------------------------+\n| MAX_UPDATES_PER_HOUR               | Number of updates (not queries) that  |\n|                                    | the account can issue per hour        |\n+------------------------------------+---------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR           | Number of connections that the        |\n|                                    | account can start per hour            |\n+------------------------------------+---------------------------------------+\n| MAX_USER_CONNECTIONS               | Number of simultaneous connections    |\n|                                    | that can be accepted from the same    |\n|                                    | account; if it is 0, max_connections  |\n|                                    | will be used instead; if              |\n|                                    | max_connections is 0, there is no     |\n|                                    | limit for this account\'s              |\n|                                    | simultaneous connections.             |','','https://mariadb.com/kb/en/alter-user/');
update help_topic set description = CONCAT(description, '\n+------------------------------------+---------------------------------------+\n| MAX_STATEMENT_TIME                 | Timeout, in seconds, for statements   |\n|                                    | executed by the user. See also        |\n|                                    | Aborting Statements that Exceed a     |\n|                                    | Certain Time to Execute.              |\n+------------------------------------+---------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nHere is an example showing how to set an account\'s resource limits:\n\nALTER USER \'someone\'@\'localhost\' WITH\n  MAX_USER_CONNECTIONS 10\n  MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nPassword Expiry\n---------------\n\nMariaDB starting with 10.4.3\n----------------------------\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal setting, for example:\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSee User Password Expiry for more details.\n\nAccount Locking\n---------------\n\nMariaDB starting with 10.4.2\n----------------------------\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected). For example:\n\nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nSee Account Locking for more details.\n\nFrom MariaDB 10.4.7 and MariaDB 10.5.8, the lock_option and password_option\nclauses can occur in either order.\n\nURL: https://mariadb.com/kb/en/alter-user/') WHERE help_topic_id = 105;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,10,'DROP USER','Syntax\n------\n\nDROP USER [IF EXISTS] user_name [, user_name] ...\n\nDescription\n-----------\n\nThe DROP USER statement removes one or more MariaDB accounts. It removes\nprivilege rows for the account from all grant tables. To use this statement,\nyou must have the global CREATE USER privilege or the DELETE privilege for the\nmysql database. Each account is named using the same format as for the CREATE\nUSER statement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used. For\nadditional information about specifying account names, see CREATE USER.\n\nNote that, if you specify an account that is currently connected, it will not\nbe deleted until the connection is closed. The connection will not be\nautomatically closed.\n\nIf any of the specified user accounts do not exist, ERROR 1396 (HY000)\nresults. If an error occurs, DROP USER will still drop the accounts that do\nnot result in an error. Only one error is produced for all users which have\nnot been dropped:\n\nERROR 1396 (HY000): Operation DROP USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the user does not exist.\n\nExamples\n--------\n\nDROP USER bob;\n\nDROP USER foo2@localhost,foo2@\'127.%\';\n\nIF EXISTS:\n\nDROP USER bob;\nERROR 1396 (HY000): Operation DROP USER failed for \'bob\'@\'%\'\n\nDROP USER IF EXISTS bob;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------+\n| Level | Code | Message                                     |\n+-------+------+---------------------------------------------+\n| Note  | 1974 | Can\'t drop user \'bob\'@\'%\'; it doesn\'t exist |\n+-------+------+---------------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-user/','','https://mariadb.com/kb/en/drop-user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (107,10,'GRANT','Syntax\n------\n\nGRANT\n  priv_type [(column_list)]\n   [, priv_type [(column_list)]] ...\n  ON [object_type] priv_level\n  TO user_specification [ user_options ...]\n\nuser_specification:\n username [authentication_option]\n | PUBLIC\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule  ...]\n\nauthentication_rule:\n  authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\nGRANT PROXY ON username\n  TO user_specification [, user_specification ...]\n  [WITH GRANT OPTION]\n\nGRANT rolename TO grantee [, grantee ...]\n  [WITH ADMIN OPTION]\n\ngrantee:\n  rolename\n  username [authentication_option]\n\nuser_options:\n  [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n  [WITH with_option [with_option] ...]\n\nobject_type:\n  TABLE\n | FUNCTION\n | PROCEDURE\n | PACKAGE\n\npriv_level:\n  *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n\nwith_option:\n  GRANT OPTION\n | resource_option\n\nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\ntls_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nDescription\n-----------\n\nThe GRANT statement allows you to grant privileges or roles to accounts. To\nuse GRANT, you must have the GRANT OPTION privilege, and you must have the\nprivileges that you are granting.\n\nUse the REVOKE statement to revoke privileges granted with the GRANT statement.\n\nUse the SHOW GRANTS statement to determine what privileges an account has.\n\nAccount Names\n-------------\n\nFor GRANT statements, account names are specified as the username argument in\nthe same way as they are for CREATE USER statements. See account names from\nthe CREATE USER page for details on how account names are specified.\n\nImplicit Account Creation\n-------------------------\n\nThe GRANT statement also allows you to implicitly create accounts in some\ncases.\n\nIf the account does not yet exist, then GRANT can implicitly create it. To\nimplicitly create an account with GRANT, a user is required to have the same\nprivileges that would be required to explicitly create the account with the\nCREATE USER statement.\n\nIf the NO_AUTO_CREATE_USER SQL_MODE is set, then accounts can only be created\nif authentication information is specified, or with a CREATE USER statement.\nIf no authentication information is provided, GRANT will produce an error when\nthe specified account does not exist, for example:\n\nshow variables like \'%sql_mode%\' ;\n+---------------+--------------------------------------------+\n| Variable_name | Value                                      |\n+---------------+--------------------------------------------+\n| sql_mode      | NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n+---------------+--------------------------------------------+\n\nGRANT USAGE ON *.* TO \'user123\'@\'%\' IDENTIFIED BY \'\';\nERROR 1133 (28000): Can\'t find any matching row in the user table\n\nGRANT USAGE ON *.* TO \'user123\'@\'%\' \n IDENTIFIED VIA PAM using \'mariadb\' require ssl ;\nQuery OK, 0 rows affected (0.00 sec)\n\nselect host, user from mysql.user where user=\'user123\' ;\n\n+------+----------+\n| host | user     |\n+------+----------+\n| %    | user123 |\n+------+----------+\n\nPrivilege Levels\n----------------\n\nPrivileges can be set globally, for an entire database, for a table or\nroutine, or for individual columns in a table. Certain privileges can only be\nset at certain levels.\n\n* Global privileges priv_type are granted using *.* for\npriv_level. Global privileges include privileges to administer the database\nand manage user accounts, as well as privileges for all tables, functions, and\nprocedures. Global privileges are stored in the mysql.user table prior to\nMariaDB 10.4, and in  mysql.global_priv table afterwards.\n* Database privileges priv_type are granted using db_name.*\nfor priv_level, or using just * to use default database. Database\nprivileges include privileges to create tables and functions, as well as\nprivileges for all tables, functions, and procedures in the database. Database\nprivileges are stored in the mysql.db table.\n* Table privileges priv_type are granted using db_name.tbl_name\nfor priv_level, or using just tbl_name to specify a table in the default\ndatabase. The TABLE keyword is optional. Table privileges include the\nability to select and change data in the table. Certain table privileges can\nbe granted for individual columns.\n* Column privileges priv_type are granted by specifying a table for\npriv_level and providing a column list after the privilege type. They allow\nyou to control exactly which columns in a table users can select and change.\n* Function privileges priv_type are granted using FUNCTION db_name.routine_name\nfor priv_level, or using just  FUNCTION routine_name to specify a function\nin the default database.\n* Procedure privileges priv_type are granted using PROCEDURE\ndb_name.routine_name\nfor priv_level, or using just PROCEDURE routine_name to specify a procedure\nin the default database.\n\nThe USAGE Privilege\n-------------------\n\nThe USAGE privilege grants no real privileges. The SHOW GRANTS statement will\nshow a global USAGE privilege for a newly-created user. You can use USAGE with\nthe GRANT statement to change options like GRANT OPTION and\nMAX_USER_CONNECTIONS without changing any account privileges.\n\nThe ALL PRIVILEGES Privilege\n----------------------------\n\nThe ALL PRIVILEGES privilege grants all available privileges. Granting all\nprivileges only affects the given privilege level. For example, granting all\nprivileges on a table does not grant any privileges on the database or\nglobally.\n\nUsing ALL PRIVILEGES does not grant the special GRANT OPTION privilege.\n\nYou can use ALL instead of ALL PRIVILEGES.\n\nThe GRANT OPTION Privilege\n--------------------------\n\nUse the WITH GRANT OPTION clause to give users the ability to grant privileges\nto other users at the given privilege level. Users with the GRANT OPTION\nprivilege can only grant privileges they have. They cannot grant privileges at\na higher privilege level than they have the GRANT OPTION privilege.\n\nThe GRANT OPTION privilege cannot be set for individual columns. If you use\nWITH GRANT OPTION when specifying column privileges, the GRANT OPTION\nprivilege will be granted for the entire table.\n\nUsing the WITH GRANT OPTION clause is equivalent to listing GRANT OPTION as a\nprivilege.\n\nGlobal Privileges\n-----------------\n\nThe following table lists the privileges that can be granted globally. You can\nalso grant all database, table, and function privileges globally. When granted\nglobally, these privileges apply to all databases, tables, or functions,\nincluding those created later.\n\nTo set a global privilege, use *.* for priv_level.\n\nBINLOG ADMIN\n------------\n\nEnables administration of the binary log, including the PURGE BINARY LOGS\nstatement and setting the system variables:\n\n* binlog_annotate_row_events\n* binlog_cache_size\n* binlog_commit_wait_count\n* binlog_commit_wait_usec\n* binlog_direct_non_transactional_updates\n* binlog_expire_logs_seconds\n* binlog_file_cache_size\n* binlog_format\n* binlog_row_image\n* binlog_row_metadata\n* binlog_stmt_cache_size\n* expire_logs_days\n* log_bin_compress\n* log_bin_compress_min_len\n* log_bin_trust_function_creators\n* max_binlog_cache_size\n* max_binlog_size\n* max_binlog_stmt_cache_size\n* sql_log_bin and\n* sync_binlog.\n\nAdded in MariaDB 10.5.2.\n\nBINLOG MONITOR\n--------------\n\nNew name for REPLICATION CLIENT from MariaDB 10.5.2, (REPLICATION CLIENT still\nsupported as an alias for compatibility purposes). Permits running SHOW\ncommands related to the binary log, in particular the SHOW BINLOG STATUS and\nSHOW BINARY LOGS statements. Unlike REPLICATION CLIENT prior to MariaDB 10.5,\nSHOW REPLICA STATUS isn\'t included in this privilege, and REPLICA MONITOR is\nrequired.\n\nBINLOG REPLAY\n-------------\n\nEnables replaying the binary log with the BINLOG statement (generated by\nmariadb-binlog), executing SET timestamp when secure_timestamp is set to\nreplication, and setting the session values of system variables usually\nincluded in BINLOG output, in particular:\n\n* gtid_domain_id\n* gtid_seq_no\n* pseudo_thread_id\n* server_id.\n\nAdded in MariaDB 10.5.2\n\nCONNECTION ADMIN\n----------------\n\nEnables administering connection resource limit options. This includes\nignoring the limits specified by:\n\n* max_connections\n* max_user_connections and\n* max_password_errors.\n\nThe statements specified in init_connect are not executed, killing connections\nand queries owned by other users is permitted. The following\nconnection-related system variables can be changed:\n\n* connect_timeout\n* disconnect_on_expired_password\n* extra_max_connections\n* init_connect\n* max_connections\n* max_connect_errors\n* max_password_errors\n* proxy_protocol_networks\n* secure_auth\n* slow_launch_time\n* thread_pool_exact_stats\n* thread_pool_dedicated_listener\n* thread_pool_idle_timeout\n* thread_pool_max_threads\n* thread_pool_min_threads\n* thread_pool_oversubscribe\n* thread_pool_prio_kickup_timer\n* thread_pool_priority\n* thread_pool_size, and\n* thread_pool_stall_limit.\n\nAdded in MariaDB 10.5.2.\n\nCREATE USER\n-----------\n\nCreate a user using the CREATE USER statement, or implicitly create a user\nwith the GRANT statement.\n\nFEDERATED ADMIN\n---------------\n\nExecute CREATE SERVER, ALTER SERVER, and DROP SERVER statements. Added in\nMariaDB 10.5.2.\n\nFILE\n----\n\nRead and write files on the server, using statements like LOAD DATA INFILE or\nfunctions like LOAD_FILE(). Also needed to create CONNECT outward tables.\nMariaDB server must have the permissions to access those files.\n\nGRANT OPTION\n------------\n\nGrant global privileges. You can only grant privileges that you have.\n\nPROCESS\n-------\n\nShow information about the active processes, for example via SHOW PROCESSLIST\nor mysqladmin processlist. If you have the PROCESS privilege, you can see all\nthreads. Otherwise, you can see only your own threads (that is, threads\nassociated with the MariaDB account that you are using).\n\nREAD_ONLY ADMIN\n---------------\n\nUser can set the read_only system variable and allows the user to perform\nwrite operations, even when the read_only option is active. Added in MariaDB\n10.5.2.\n\nFrom MariaDB 10.11.0, the READ_ONLY ADMIN privilege has been removed from\nSUPER. The benefit of this is that one can remove the READ_ONLY ADMIN\nprivilege from all users and ensure that no one can make any changes on any\nnon-temporary tables. This is useful on replicas when one wants to ensure that\nthe replica is kept identical to the primary.\n\nRELOAD\n------\n\nExecute FLUSH statements or equivalent mariadb-admin/mysqladmin commands.\n\nREPLICATION CLIENT\n------------------\n\nExecute SHOW MASTER STATUS and SHOW BINARY LOGS informative statements.\nRenamed to BINLOG MONITOR in MariaDB 10.5.2 (but still supported as an alias\nfor compatibility reasons). SHOW SLAVE STATUS was part of REPLICATION CLIENT\nprior to MariaDB 10.5.\n\nREPLICATION MASTER ADMIN\n------------------------\n\nPermits administration of primary servers, including the SHOW REPLICA HOSTS\nstatement, and setting the gtid_binlog_state, gtid_domain_id,\nmaster_verify_checksum and server_id system variables. Added in MariaDB 10.5.2.\n\nREPLICA MONITOR\n---------------\n\nPermit SHOW REPLICA STATUS and SHOW RELAYLOG EVENTS. From MariaDB 10.5.9.\n\nWhen a user would upgrade from an older major release to a MariaDB 10.5 minor\nrelease prior to MariaDB 10.5.9, certain user accounts would lose\ncapabilities. For example, a user account that had the REPLICATION CLIENT\nprivilege in older major releases could run SHOW REPLICA STATUS, but after\nupgrading to a MariaDB 10.5 minor release prior to MariaDB 10.5.9, they could\nno longer run SHOW REPLICA STATUS, because that statement was changed to\nrequire the REPLICATION REPLICA ADMIN privilege.\n\nThis issue is fixed in MariaDB 10.5.9 with this new privilege, which now\ngrants the user the ability to execute SHOW [ALL] (SLAVE | REPLICA) STATUS.\n\nWhen a database is upgraded from an older major release to MariaDB Server\n10.5.9 or later, any user accounts with the REPLICATION CLIENT or REPLICATION\nSLAVE privileges will automatically be granted the new REPLICA MONITOR\nprivilege. The privilege fix occurs when the server is started up, not when\nmariadb-upgrade is performed.\n\nHowever, when a database is upgraded from an early 10.5 minor release to\n10.5.9 and later, the user will have to fix any user account privileges\nmanually.\n\nREPLICATION REPLICA\n-------------------\n\nSynonym for REPLICATION SLAVE. From MariaDB 10.5.1.\n\nREPLICATION SLAVE\n-----------------\n\nAccounts used by replica servers on the primary need this privilege. This is\nneeded to get the updates made on the master. From MariaDB 10.5.1, REPLICATION\nREPLICA is an alias for REPLICATION SLAVE.\n\nREPLICATION SLAVE ADMIN\n-----------------------\n\nPermits administering replica servers, including START REPLICA/SLAVE, STOP\nREPLICA/SLAVE, CHANGE MASTER, SHOW REPLICA/SLAVE STATUS, SHOW RELAYLOG EVENTS\nstatements, replaying the binary log with the BINLOG statement (generated by\nmariadb-binlog), and setting the system variables:\n\n* gtid_cleanup_batch_size\n* gtid_ignore_duplicates\n* gtid_pos_auto_engines\n* gtid_slave_pos\n* gtid_strict_mode\n* init_slave\n* read_binlog_speed_limit\n* relay_log_purge\n* relay_log_recovery\n* replicate_do_db\n* replicate_do_table\n* replicate_events_marked_for_skip\n* replicate_ignore_db\n* replicate_ignore_table\n* replicate_wild_do_table\n* replicate_wild_ignore_table\n* slave_compressed_protocol\n* slave_ddl_exec_mode\n* slave_domain_parallel_threads\n* slave_exec_mode\n* slave_max_allowed_packet\n* slave_net_timeout\n* slave_parallel_max_queued\n* slave_parallel_mode\n* slave_parallel_threads\n* slave_parallel_workers\n* slave_run_triggers_for_rbr\n* slave_sql_verify_checksum\n* slave_transaction_retry_interval\n* slave_type_conversions\n* sync_master_info\n* sync_relay_log, and\n* sync_relay_log_info.\n\nAdded in MariaDB 10.5.2.\n\nSET USER\n--------\n','','https://mariadb.com/kb/en/grant/');
update help_topic set description = CONCAT(description, '\nEnables setting the DEFINER when creating triggers, views, stored functions\nand stored procedures. Added in MariaDB 10.5.2.\n\nSHOW DATABASES\n--------------\n\nList all databases using the SHOW DATABASES statement. Without the SHOW\nDATABASES privilege, you can still issue the SHOW DATABASES statement, but it\nwill only list databases containing tables on which you have privileges.\n\nSHUTDOWN\n--------\n\nShut down the server using SHUTDOWN or the mysqladmin shutdown command.\n\nSUPER\n-----\n\nExecute superuser statements: CHANGE MASTER TO, KILL (users who do not have\nthis privilege can only KILL their own threads), PURGE LOGS, SET global system\nvariables, or the mysqladmin debug command. Also, this permission allows the\nuser to write data even if the read_only startup option is set, enable or\ndisable logging, enable or disable replication on replica, specify a DEFINER\nfor statements that support that clause, connect once reaching the\nMAX_CONNECTIONS. If a statement has been specified for the init-connect mysqld\noption, that command will not be executed when a user with SUPER privileges\nconnects to the server.\n\nThe SUPER privilege has been split into multiple smaller privileges from\nMariaDB 10.5.2 to allow for more fine-grained privileges, although it remains\nan alias for these smaller privileges.\n\nFrom MariaDB 10.11.0, the READ_ONLY ADMIN privilege has been removed from\nSUPER. The benefit of this is that one can remove the READ_ONLY ADMIN\nprivilege from all users and ensure that no one can make any changes on any\nnon-temporary tables. This is useful on replicas when one wants to ensure that\nthe replica is kept identical to the primary.\n\nDatabase Privileges\n-------------------\n\nThe following table lists the privileges that can be granted at the database\nlevel. You can also grant all table and function privileges at the database\nlevel. Table and function privileges on a database apply to all tables or\nfunctions in that database, including those created later.\n\nTo set a privilege for a database, specify the database using db_name.* for\npriv_level, or just use * to specify the default database.\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| CREATE                           | Create a database using the CREATE      |\n|                                  | DATABASE statement, when the privilege  |\n|                                  | is granted for a database. You can      |\n|                                  | grant the CREATE privilege on           |\n|                                  | databases that do not yet exist. This   |\n|                                  | also grants the CREATE privilege on     |\n|                                  | all tables in the database.             |\n+----------------------------------+-----------------------------------------+\n| CREATE ROUTINE                   | Create Stored Programs using the        |\n|                                  | CREATE PROCEDURE and CREATE FUNCTION    |\n|                                  | statements.                             |\n+----------------------------------+-----------------------------------------+\n| CREATE TEMPORARY TABLES          | Create temporary tables with the        |\n|                                  | CREATE TEMPORARY TABLE statement. This  |\n|                                  | privilege enable writing and dropping   |\n|                                  | those temporary tables                  |\n+----------------------------------+-----------------------------------------+\n| DROP                             | Drop a database using the DROP          |\n|                                  | DATABASE statement, when the privilege  |\n|                                  | is granted for a database. This also    |\n|                                  | grants the DROP privilege on all        |\n|                                  | tables in the database.                 |\n+----------------------------------+-----------------------------------------+\n| EVENT                            | Create, drop and alter EVENTs.          |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant database privileges. You can      |\n|                                  | only grant privileges that you have.    |\n+----------------------------------+-----------------------------------------+\n| LOCK TABLES                      | Acquire explicit locks using the LOCK   |\n|                                  | TABLES statement; you also need to      |\n|                                  | have the SELECT privilege on a table,   |\n|                                  | in order to lock it.                    |\n+----------------------------------+-----------------------------------------+\n\nTable Privileges\n----------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| ALTER                            | Change the structure of an existing     |\n|                                  | table using the ALTER TABLE statement.  |\n+----------------------------------+-----------------------------------------+\n| CREATE                           | Create a table using the CREATE TABLE   |\n|                                  | statement.  You can grant the CREATE    |\n|                                  | privilege on tables that do not yet     |\n|                                  | exist.                                  |\n+----------------------------------+-----------------------------------------+\n| CREATE VIEW                      | Create a view using the CREATE_VIEW     |\n|                                  | statement.                              |\n+----------------------------------+-----------------------------------------+\n| DELETE                           | Remove rows from a table using the      |\n|                                  | DELETE statement.                       |\n+----------------------------------+-----------------------------------------+\n| DELETE HISTORY                   | Remove historical rows from a table     |\n|                                  | using the DELETE HISTORY statement.     |\n|                                  | Displays as DELETE VERSIONING ROWS      |\n|                                  | when running SHOW GRANTS until MariaDB  |\n|                                  | 10.3.15 and until MariaDB 10.4.5        |\n|                                  | (MDEV-17655), or when running SHOW      |\n|                                  | PRIVILEGES until MariaDB 10.5.2,        |\n|                                  | MariaDB 10.4.13 and MariaDB 10.3.23     |\n|                                  | (MDEV-20382). From MariaDB 10.3.4.      |\n|                                  | From MariaDB 10.3.5, if a user has the  |\n|                                  | SUPER privilege but not this            |\n|                                  | privilege, running mysql_upgrade will   |\n|                                  | grant this privilege as well.           |\n+----------------------------------+-----------------------------------------+\n| DROP                             | Drop a table using the DROP TABLE       |\n|                                  | statement or a view using the DROP      |\n|                                  | VIEW statement. Also required to        |\n|                                  | execute the TRUNCATE TABLE statement.   |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant table privileges. You can only    |\n|                                  | grant privileges that you have.         |\n+----------------------------------+-----------------------------------------+\n| INDEX                            | Create an index on a table using the    |\n|                                  | CREATE INDEX statement. Without the     |\n|                                  | INDEX privilege, you can still create   |\n|                                  | indexes when creating a table using     |\n|                                  | the CREATE TABLE statement if the you   |\n|                                  | have the CREATE privilege, and you can  |\n|                                  | create indexes using the ALTER TABLE    |\n|                                  | statement if you have the ALTER         |\n|                                  | privilege.                              |\n+----------------------------------+-----------------------------------------+\n| INSERT                           | Add rows to a table using the INSERT    |\n|                                  | statement.  The INSERT privilege can    |\n|                                  | also be set on individual columns; see  |\n|                                  | Column Privileges below for details.    |\n+----------------------------------+-----------------------------------------+\n| REFERENCES                       | Unused.                                 |\n+----------------------------------+-----------------------------------------+\n| SELECT                           | Read data from a table using the        |\n|                                  | SELECT statement. The SELECT privilege  |\n|                                  | can also be set on individual columns;  |\n|                                  | see Column Privileges below for         |\n|                                  | details.                                |\n+----------------------------------+-----------------------------------------+\n| SHOW VIEW                        | Show the CREATE VIEW statement to       |\n|                                  | create a view using the SHOW CREATE     |\n|                                  | VIEW statement.                         |\n+----------------------------------+-----------------------------------------+\n| TRIGGER                          | Execute triggers associated to tables   |\n|                                  | you update, execute the CREATE TRIGGER  |\n|                                  | and DROP TRIGGER statements. You will   |\n|                                  | still be able to see triggers.          |\n+----------------------------------+-----------------------------------------+\n| UPDATE                           | Update existing rows in a table using   |\n|                                  | the UPDATE statement. UPDATE            |\n|                                  | statements usually include a WHERE      |\n|                                  | clause to update only certain rows.     |\n|                                  | You must have SELECT privileges on the  |\n|                                  | table or the appropriate columns for    |\n|                                  | the WHERE clause. The UPDATE privilege  |\n|                                  | can also be set on individual columns;  |\n|                                  | see Column Privileges below for         |\n|                                  | details.                                |\n+----------------------------------+-----------------------------------------+\n\nColumn Privileges\n-----------------\n\nSome table privileges can be set for individual columns of a table. To use\ncolumn privileges, specify the table explicitly and provide a list of column\nnames after the privilege type. For example, the following statement would\nallow the user to read the names and positions of employees, but not other\ninformation from the same table, such as salaries.\n\nGRANT SELECT (name, position) on Employee to \'jeffrey\'@\'localhost\';\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| INSERT (column_list)             | Add rows specifying values in columns   |\n|                                  | using the INSERT statement. If you      |\n|                                  | only have column-level INSERT           |\n|                                  | privileges, you must specify the        |\n|                                  | columns you are setting in the INSERT   |\n|                                  | statement. All other columns will be    |\n|                                  | set to their default values, or NULL.   |\n+----------------------------------+-----------------------------------------+\n| REFERENCES (column_list)         | Unused.                                 |\n+----------------------------------+-----------------------------------------+\n| SELECT (column_list)             | Read values in columns using the        |\n|                                  | SELECT statement. You cannot access or  |\n|                                  | query any columns for which you do not  |\n|                                  | have SELECT privileges, including in    |\n|                                  | WHERE, ON, GROUP BY, and ORDER BY       |\n|                                  | clauses.                                |\n+----------------------------------+-----------------------------------------+\n| UPDATE (column_list)             | Update values in columns of existing    |\n|                                  | rows using the UPDATE statement.        |\n|                                  | UPDATE statements usually include a     |\n|                                  | WHERE clause to update only certain     |\n|                                  | rows. You must have SELECT privileges   |\n|                                  | on the table or the appropriate         |\n|                                  | columns for the WHERE clause.           |\n+----------------------------------+-----------------------------------------+\n\nFunction Privileges\n-------------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |') WHERE help_topic_id = 107;
update help_topic set description = CONCAT(description, '\n+----------------------------------+-----------------------------------------+\n| ALTER ROUTINE                    | Change the characteristics of a stored  |\n|                                  | function using the ALTER FUNCTION       |\n|                                  | statement.                              |\n+----------------------------------+-----------------------------------------+\n| EXECUTE                          | Use a stored function. You need SELECT  |\n|                                  | privileges for any tables or columns    |\n|                                  | accessed by the function.               |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant function privileges. You can      |\n|                                  | only grant privileges that you have.    |\n+----------------------------------+-----------------------------------------+\n\nProcedure Privileges\n--------------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| ALTER ROUTINE                    | Change the characteristics of a stored  |\n|                                  | procedure using the ALTER PROCEDURE     |\n|                                  | statement.                              |\n+----------------------------------+-----------------------------------------+\n| EXECUTE                          | Execute a stored procedure using the    |\n|                                  | CALL statement. The privilege to call   |\n|                                  | a procedure may allow you to perform    |\n|                                  | actions you wouldn\'t otherwise be able  |\n|                                  | to do, such as insert rows into a       |\n|                                  | table.                                  |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant procedure privileges. You can     |\n|                                  | only grant privileges that you have.    |\n+----------------------------------+-----------------------------------------+\n\nGRANT EXECUTE ON PROCEDURE mysql.create_db TO maintainer;\n\nProxy Privileges\n----------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| PROXY                            | Permits one user to be a proxy for      |\n|                                  | another.                                |\n+----------------------------------+-----------------------------------------+\n\nThe PROXY privilege allows one user to proxy as another user, which means\ntheir privileges change to that of the proxy user, and the CURRENT_USER()\nfunction returns the user name of the proxy user.\n\nThe PROXY privilege only works with authentication plugins that support it.\nThe default mysql_native_password authentication plugin does not support proxy\nusers.\n\nThe pam authentication plugin is the only plugin included with MariaDB that\ncurrently supports proxy users. The PROXY privilege is commonly used with the\npam authentication plugin to enable user and group mapping with PAM.\n\nFor example, to grant the PROXY privilege to an anonymous account that\nauthenticates with the pam authentication plugin, you could execute the\nfollowing:\n\nCREATE USER \'dba\'@\'%\' IDENTIFIED BY \'strongpassword\';\nGRANT ALL PRIVILEGES ON *.* TO \'dba\'@\'%\' ;\n\nCREATE USER \'\'@\'%\' IDENTIFIED VIA pam USING \'mariadb\';\nGRANT PROXY ON \'dba\'@\'%\' TO \'\'@\'%\';\n\nA user account can only grant the PROXY privilege for a specific user account\nif the granter also has the PROXY privilege for that specific user account,\nand if that privilege is defined WITH GRANT OPTION. For example, the following\nexample fails because the granter does not have the PROXY privilege for that\nspecific user account at all:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------+\n| Grants for alice@localhost                                                  \n                    |\n+------------------------------------------------------------------------------\n----------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n+------------------------------------------------------------------------------\n----------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nERROR 1698 (28000): Access denied for user \'alice\'@\'localhost\'\n\nAnd the following example fails because the granter does have the PROXY\nprivilege for that specific user account, but it is not defined WITH GRANT\nOPTION:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------+\n| Grants for alice@localhost                                                  \n                    |\n+------------------------------------------------------------------------------\n----------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO \'alice\'@\'localhost\'                     \n                    |\n+------------------------------------------------------------------------------\n----------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nERROR 1698 (28000): Access denied for user \'alice\'@\'localhost\'\n\nBut the following example succeeds because the granter does have the PROXY\nprivilege for that specific user account, and it is defined WITH GRANT OPTION:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| Grants for alice@localhost                                                  \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT OPTION |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO \'alice\'@\'localhost\' WITH GRANT OPTION   \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\n\nA user account can grant the PROXY privilege for any other user account if the\ngranter has the PROXY privilege for the \'\'@\'%\' anonymous user account, like\nthis:\n\nGRANT PROXY ON \'\'@\'%\' TO \'dba\'@\'localhost\' WITH GRANT OPTION;\n\nFor example, the following example succeeds because the user can grant the\nPROXY privilege for any other user account:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| Grants for alice@localhost                                                  \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT OPTION |\n| GRANT PROXY ON \'\'@\'%\' TO \'alice\'@\'localhost\' WITH GRANT OPTION              \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n\nGRANT PROXY ON \'app1_dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nQuery OK, 0 rows affected (0.004 sec)\n\nGRANT PROXY ON \'app2_dba\'@\'localhost\' TO \'carol\'@\'localhost\';\nQuery OK, 0 rows affected (0.004 sec)\n\nThe default root user accounts created by mysql_install_db have this\nprivilege. For example:\n\nGRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION;\nGRANT PROXY ON \'\'@\'%\' TO \'root\'@\'localhost\' WITH GRANT OPTION;\n\nThis allows the default root user accounts to grant the PROXY privilege for\nany other user account, and it also allows the default root user accounts to\ngrant others the privilege to do the same.\n\nAuthentication Options\n----------------------\n\nThe authentication options for the GRANT statement are the same as those for\nthe CREATE USER statement.\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored.\n\nFor example, if our password is mariadb, then we can create the user with:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nIf the user account already exists and if you provide the IDENTIFIED BY\nclause, then the user\'s password will be changed. You must have the privileges\nneeded for the SET PASSWORD statement to change a user\'s password with GRANT.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD function. It will be stored as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\')                       |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n\nAnd then we can create a user with the hash:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \n PASSWORD \'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nIf the user account already exists and if you provide the IDENTIFIED BY\nclause, then the user\'s password will be changed. You must have the privileges\nneeded for the SET PASSWORD statement to change a user\'s password with GRANT.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nMariaDB starting with 10.4.0\n----------------------------\nThe USING or AS keyword can also be used to provide a plain-text password to a\nplugin if it\'s provided as an argument to the PASSWORD() function. This is\nonly valid for authentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication plugin supports\nthis:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 \n USING PASSWORD(\'secret\');\n\nMariaDB starting with 10.4.3\n----------------------------\nOne can specify many authentication plugins, they all work as alternatives\nways of authenticating a user:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 \n USING PASSWORD(\'secret\') OR unix_socket;\n\nBy default, when you create a user without specifying an authentication\nplugin, MariaDB uses the mysql_native_password plugin.\n\nResource Limit Options\n----------------------\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+--------------------------------------+--------------------------------------+') WHERE help_topic_id = 107;
update help_topic set description = CONCAT(description, '\n| Limit Type                           | Decription                           |\n+--------------------------------------+--------------------------------------+\n| MAX_QUERIES_PER_HOUR                 | Number of statements that the        |\n|                                      | account can issue per hour           |\n|                                      | (including updates)                  |\n+--------------------------------------+--------------------------------------+\n| MAX_UPDATES_PER_HOUR                 | Number of updates (not queries)      |\n|                                      | that the account can issue per hour  |\n+--------------------------------------+--------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR             | Number of connections that the       |\n|                                      | account can start per hour           |\n+--------------------------------------+--------------------------------------+\n| MAX_USER_CONNECTIONS                 | Number of simultaneous connections   |\n|                                      | that can be accepted from the same   |\n|                                      | account; if it is 0,                 |\n|                                      | max_connections will be used         |\n|                                      | instead; if max_connections is 0,    |\n|                                      | there is no limit for this           |\n|                                      | account\'s simultaneous connections.  |\n+--------------------------------------+--------------------------------------+\n| MAX_STATEMENT_TIME                   | Timeout, in seconds, for statements  |\n|                                      | executed by the user. See also       |\n|                                      | Aborting Statements that Exceed a    |\n|                                      | Certain Time to Execute.             |\n+--------------------------------------+--------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nTo set resource limits for an account, if you do not want to change that\naccount\'s privileges, you can issue a GRANT statement with the USAGE\nprivilege, which has no meaning. The statement can name some or all limit\ntypes, in any order.\n\nHere is an example showing how to set resource limits:\n\nGRANT USAGE ON *.* TO \'someone\'@\'localhost\' WITH\n  MAX_USER_CONNECTIONS 0\n  MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nUsers with the CONNECTION ADMIN privilege (in MariaDB 10.5.2 and later) or the\nSUPER privilege are not restricted by max_user_connections, max_connections,\nor max_password_errors.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| REQUIRE NONE              | TLS is not required for this account, but can  |\n|                           | still be used.                                 |\n+---------------------------+------------------------------------------------+\n| REQUIRE SSL               | The account must use TLS, but no valid X509    |\n|                           | certificate is required. This option cannot    |\n|                           | be combined with other TLS options.            |\n+---------------------------+------------------------------------------------+\n| REQUIRE X509              | The account must use TLS and must have a       |\n|                           | valid X509 certificate. This option implies    |\n|                           | REQUIRE SSL. This option cannot be combined    |\n|                           | with other TLS options.                        |\n+---------------------------+------------------------------------------------+\n| REQUIRE ISSUER \'issuer\'   | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the Certificate  |\n|                           | Authority must be the one specified via the    |\n|                           | string issuer. This option implies REQUIRE     |\n|                           | X509. This option can be combined with the     |\n|                           | SUBJECT, and CIPHER options in any order.      |\n+---------------------------+------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the              |\n|                           | certificate\'s Subject must be the one          |\n|                           | specified via the string subject. This option  |\n|                           | implies REQUIRE X509. This option can be       |\n|                           | combined with the ISSUER, and CIPHER options   |\n|                           | in any order.                                  |\n+---------------------------+------------------------------------------------+\n| REQUIRE CIPHER \'cipher\'   | The account must use TLS, but no valid X509    |\n|                           | certificate is required. Also, the encryption  |\n|                           | used for the connection must use a specific    |\n|                           | cipher method specified in the string cipher.  |\n|                           | This option implies REQUIRE SSL. This option   |\n|                           | can be combined with the ISSUER, and SUBJECT   |\n|                           | options in any order.                          |\n+---------------------------+------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can create a user account that requires these TLS options\nwith the following:\n\nGRANT USAGE ON *.* TO \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nRoles\n-----\n\nSyntax\n------\n\nGRANT role TO grantee [, grantee ... ]\n[ WITH ADMIN OPTION ]\n\ngrantee:\n  rolename\n  username [authentication_option]\n\nThe GRANT statement is also used to grant the use of a role to one or more\nusers or other roles. In order to be able to grant a role, the grantor doing\nso must have permission to do so (see WITH ADMIN in the CREATE ROLE article).\n\nSpecifying the WITH ADMIN OPTION permits the grantee to in turn grant the role\nto another.\n\nFor example, the following commands show how to grant the same role to a\ncouple different users.\n\nGRANT journalist TO hulda;\n\nGRANT journalist TO berengar WITH ADMIN OPTION;\n\nIf a user has been granted a role, they do not automatically obtain all\npermissions associated with that role. These permissions are only in use when\nthe user activates the role with the SET ROLE statement.\n\nTO PUBLIC\n---------\n\nMariaDB starting with 10.11\n---------------------------\n\nSyntax\n------\n\nGRANT <privilege> ON <database>.<object> TO PUBLIC;\nREVOKE <privilege> ON <database>.<object> FROM PUBLIC;\n\nGRANT ... TO PUBLIC grants privileges to all users with access to the server.\nThe privileges also apply to users created after the privileges are granted.\nThis can be useful when one only wants to state once that all users need to\nhave a certain set of privileges.\n\nWhen running SHOW GRANTS, a user will also see all privileges inherited from\nPUBLIC. SHOW GRANTS FOR PUBLIC will only show TO PUBLIC grants.\n\nGrant Examples\n--------------\n\nGranting Root-like Privileges\n-----------------------------\n\nYou can create a user that has privileges similar to the default root accounts\nby executing the following:\n\nCREATE USER \'alexander\'@\'localhost\';\nGRANT ALL PRIVILEGES ON  *.* to \'alexander\'@\'localhost\' WITH GRANT OPTION;\n\nURL: https://mariadb.com/kb/en/grant/') WHERE help_topic_id = 107;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (108,10,'RENAME USER','Syntax\n------\n\nRENAME USER old_user TO new_user\n  [, old_user TO new_user] ...\n\nDescription\n-----------\n\nThe RENAME USER statement renames existing MariaDB accounts. To use it, you\nmust have the global CREATE USER privilege or the UPDATE privilege for the\nmysql database. Each account is named using the same format as for the CREATE\nUSER statement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\n\nIf any of the old user accounts do not exist or any of the new user accounts\nalready exist, ERROR 1396 (HY000) results. If an error occurs, RENAME USER\nwill still rename the accounts that do not result in an error.\n\nExamples\n--------\n\nCREATE USER \'donald\', \'mickey\';\nRENAME USER \'donald\' TO \'duck\'@\'localhost\', \'mickey\' TO \'mouse\'@\'localhost\';\n\nURL: https://mariadb.com/kb/en/rename-user/','','https://mariadb.com/kb/en/rename-user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (109,10,'REVOKE','Privileges\n----------\n\nSyntax\n------\n\nREVOKE \n  priv_type [(column_list)]\n   [, priv_type [(column_list)]] ...\n  ON [object_type] priv_level\n  FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n  FROM user [, user] ...\n\nDescription\n-----------\n\nThe REVOKE statement enables system administrators to revoke privileges (or\nroles - see section below) from MariaDB accounts. Each account is named using\nthe same format as for the GRANT statement; for example,\n\'jeffrey\'@\'localhost\'. If you specify only the user name part of the account\nname, a host name part of \'%\' is used. For details on the levels at which\nprivileges exist, the allowable priv_type and priv_level values, and the\nsyntax for specifying users and passwords, see GRANT.\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION privilege, and\nyou must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all global,\ndatabase, table, column, and routine privileges for the named user or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql database. See GRANT.\n\nExamples\n--------\n\nREVOKE SUPER ON *.* FROM \'alexander\'@\'localhost\';\n\nRoles\n-----\n\nSyntax\n------\n\nREVOKE role  [, role ...]\n  FROM grantee [, grantee2 ... ]\n\nREVOKE ADMIN OPTION FOR role FROM grantee [, grantee2]\n\nDescription\n-----------\n\nREVOKE is also used to remove a role from a user or another role that it\'s\npreviously been assigned to. If a role has previously been set as a default\nrole, REVOKE does not remove the record of the default role from the\nmysql.user table. If the role is subsequently granted again, it will again be\nthe user\'s default. Use SET DEFAULT ROLE NONE to explicitly remove this.\n\nBefore MariaDB 10.1.13, the REVOKE role statement was not permitted in\nprepared statements.\n\nExample\n-------\n\nREVOKE journalist FROM hulda\n\nURL: https://mariadb.com/kb/en/revoke/','','https://mariadb.com/kb/en/revoke/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (110,10,'SET PASSWORD','Syntax\n------\n\nSET PASSWORD [FOR user] =\n  {\n    PASSWORD(\'some password\')\n   | OLD_PASSWORD(\'some password\')\n   | \'encrypted password\'\n  }\n\nDescription\n-----------\n\nThe SET PASSWORD statement assigns a password to an existing MariaDB user\naccount.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD() function,\nthe literal text of the password should be given. If the password is specified\nwithout using either function, the password should be the already-encrypted\npassword value as returned by PASSWORD().\n\nOLD_PASSWORD() should only be used if your MariaDB/MySQL clients are very old\n(< 4.0.0).\n\nWith no FOR clause, this statement sets the password for the current user. Any\nclient that has connected to the server using a non-anonymous account can\nchange the password for that account.\n\nWith a FOR clause, this statement sets the password for a specific account on\nthe current server host. Only clients that have the UPDATE privilege for the\nmysql database can do this. The user value should be given in\nuser_name@host_name format, where user_name and host_name are exactly as they\nare listed in the User and Host columns of the mysql.user table (or view in\nMariaDB-10.4 onwards) entry.\n\nThe argument to PASSWORD() and the password given to MariaDB clients can be of\narbitrary length.\n\nAuthentication Plugin Support\n-----------------------------\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, SET PASSWORD (with or without PASSWORD()) works for\naccounts authenticated via any authentication plugin that supports passwords\nstored in the mysql.global_priv table.\n\nThe ed25519, mysql_native_password, and mysql_old_password authentication\nplugins store passwords in the mysql.global_priv table.\n\nIf you run SET PASSWORD on an account that authenticates with one of these\nauthentication plugins that stores passwords in the mysql.global_priv table,\nthen the PASSWORD() function is evaluated by the specific authentication\nplugin used by the account. The authentication plugin hashes the password with\na method that is compatible with that specific authentication plugin.\n\nThe unix_socket, named_pipe, gssapi, and pam authentication plugins do not\nstore passwords in the mysql.global_priv table. These authentication plugins\nrely on other methods to authenticate the user.\n\nIf you attempt to run SET PASSWORD on an account that authenticates with one\nof these authentication plugins that doesn\'t store a password in the\nmysql.global_priv table, then MariaDB Server will raise a warning like the\nfollowing:\n\nSET PASSWORD is ignored for users authenticating via unix_socket plugin\n\nSee Authentication from MariaDB 10.4 for an overview of authentication changes\nin MariaDB 10.4.\n\nMariaDB until 10.3\n------------------\nIn MariaDB 10.3 and before, SET PASSWORD (with or without PASSWORD()) only\nworks for accounts authenticated via mysql_native_password or\nmysql_old_password authentication plugins\n\nPasswordless User Accounts\n--------------------------\n\nUser accounts do not always require passwords to login.\n\nThe unix_socket , named_pipe and gssapi authentication plugins do not require\na password to authenticate the user.\n\nThe pam authentication plugin may or may not require a password to\nauthenticate the user, depending on the specific configuration.\n\nThe mysql_native_password and mysql_old_password authentication plugins\nrequire passwords for authentication, but the password can be blank. In that\ncase, no password is required.\n\nIf you provide a password while attempting to log into the server as an\naccount that doesn\'t require a password, then MariaDB server will simply\nignore the password.\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, a user account can be defined to use multiple\nauthentication plugins in a specific order of preference. This specific\nscenario may be more noticeable in these versions, since an account could be\nassociated with some authentication plugins that require a password, and some\nthat do not.\n\nExample\n-------\n\nFor example, if you had an entry with User and Host column values of \'bob\' and\n\'%.loc.gov\', you would write the statement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\nIf you want to delete a password for a user, you would do:\n\nSET PASSWORD FOR \'bob\'@localhost = PASSWORD(\"\");\n\nURL: https://mariadb.com/kb/en/set-password/','','https://mariadb.com/kb/en/set-password/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (111,10,'CREATE ROLE','Syntax\n------\n\nCREATE [OR REPLACE] ROLE [IF NOT EXISTS] role \n [WITH ADMIN\n  {CURRENT_USER | CURRENT_ROLE | user | role}]\n\nDescription\n-----------\n\nThe CREATE ROLE statement creates one or more MariaDB roles. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for the\nmysql database. For each account, CREATE ROLE creates a new row in the\nmysql.user table that has no privileges, and with the corresponding is_role\nfield set to Y. It also creates a record in the mysql.roles_mapping table.\n\nIf any of the specified roles already exist, ERROR 1396 (HY000) results. If an\nerror occurs, CREATE ROLE will still create the roles that do not result in an\nerror. The maximum length for a role is 128 characters. Role names can be\nquoted, as explained in the Identifier names page. Only one error is produced\nfor all roles which have not been created:\n\nERROR 1396 (HY000): Operation CREATE ROLE failed for \'a\',\'b\',\'c\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nPUBLIC and NONE are reserved, and cannot be used as role names. NONE is used\nto unset a role and PUBLIC has a special use in other systems, such as Oracle,\nso is reserved for compatibility purposes.\n\nFor valid identifiers to use as role names, see Identifier Names.\n\nWITH ADMIN\n----------\n\nThe optional WITH ADMIN clause determines whether the current user, the\ncurrent role or another user or role has use of the newly created role. If the\nclause is omitted, WITH ADMIN CURRENT_USER is treated as the default, which\nmeans that the current user will be able to GRANT this role to users.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP ROLE IF EXISTS name;\nCREATE ROLE name ...;\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified role already exists. Cannot be used together with\nthe OR REPLACE clause.\n\nExamples\n--------\n\nCREATE ROLE journalist;\n\nCREATE ROLE developer WITH ADMIN lorinda@localhost;\n\nGranting the role to another user. Only user lorinda@localhost has permission\nto grant the developer role:\n\nSELECT USER();\n+-------------------+\n| USER()            |\n+-------------------+\n| henning@localhost |\n+-------------------+\n...\nGRANT developer TO ian@localhost;\nAccess denied for user \'henning\'@\'localhost\'\n\nSELECT USER();\n+-------------------+\n| USER()            |\n+-------------------+\n| lorinda@localhost |\n+-------------------+\n\nGRANT m_role TO ian@localhost;\n\nThe OR REPLACE and IF NOT EXISTS clauses. The journalist role already exists:\n\nCREATE ROLE journalist;\nERROR 1396 (HY000): Operation CREATE ROLE failed for \'journalist\'\n\nCREATE OR REPLACE ROLE journalist;\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE ROLE IF NOT EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------------+\n| Level | Code | Message                                           |\n+-------+------+---------------------------------------------------+\n| Note  | 1975 | Can\'t create role \'journalist\'; it already exists |\n+-------+------+---------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/create-role/','','https://mariadb.com/kb/en/create-role/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (112,10,'DROP ROLE','Syntax\n------\n\nDROP ROLE [IF EXISTS] role_name [,role_name ...]\n\nDescription\n-----------\n\nThe DROP ROLE statement removes one or more MariaDB roles. To use this\nstatement, you must have the global CREATE USER privilege or the DELETE\nprivilege for the mysql database.\n\nDROP ROLE does not disable roles for connections which selected them with SET\nROLE. If a role has previously been set as a default role, DROP ROLE does not\nremove the record of the default role from the mysql.user table. If the role\nis subsequently recreated and granted, it will again be the user\'s default.\nUse SET DEFAULT ROLE NONE to explicitly remove this.\n\nIf any of the specified user accounts do not exist, ERROR 1396 (HY000)\nresults. If an error occurs, DROP ROLE will still drop the roles that do not\nresult in an error. Only one error is produced for all roles which have not\nbeen dropped:\n\nERROR 1396 (HY000): Operation DROP ROLE failed for \'a\',\'b\',\'c\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a warning instead of an\nerror if the role does not exist.\n\nExamples\n--------\n\nDROP ROLE journalist;\n\nThe same thing using the optional IF EXISTS clause:\n\nDROP ROLE journalist;\nERROR 1396 (HY000): Operation DROP ROLE failed for \'journalist\'\n\nDROP ROLE IF EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nNote (Code 1975): Can\'t drop role \'journalist\'; it doesn\'t exist\n\nURL: https://mariadb.com/kb/en/drop-role/','','https://mariadb.com/kb/en/drop-role/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,10,'SET ROLE','Syntax\n------\n\nSET ROLE { role | NONE }\n\nDescription\n-----------\n\nThe SET ROLE statement enables a role, along with all of its associated\npermissions, for the current session. To unset a role, use NONE .\n\nIf a role that doesn\'t exist, or to which the user has not been assigned, is\nspecified, an ERROR 1959 (OP000): Invalid role specification error occurs.\n\nAn automatic SET ROLE is implicitly performed when a user connects if that\nuser has been assigned a default role. See SET DEFAULT ROLE.\n\nExample\n-------\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSET ROLE staff;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff        |\n+--------------+\n\nSET ROLE NONE;\n\nSELECT CURRENT_ROLE();\n+----------------+\n| CURRENT_ROLE() |\n+----------------+\n| NULL           |\n+----------------+\n\nURL: https://mariadb.com/kb/en/set-role/','','https://mariadb.com/kb/en/set-role/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (114,10,'SET DEFAULT ROLE','Syntax\n------\n\nSET DEFAULT ROLE { role | NONE } [ FOR user@host ]\n\nDescription\n-----------\n\nThe SET DEFAULT ROLE statement sets a default role for a specified (or\ncurrent) user. A default role is automatically enabled when a user connects\n(an implicit SET ROLE statement is executed immediately after a connection is\nestablished).\n\nTo be able to set a role as a default, the role must already have been granted\nto that user, and one needs the privileges to enable this role (if you cannot\ndo SET ROLE X, you won\'t be able to do SET DEFAULT ROLE X). To set a default\nrole for another user one needs to have write access to the mysql database.\n\nTo remove a user\'s default role, use SET DEFAULT ROLE NONE [ FOR user@host ].\nThe record of the default role is not removed if the role is dropped or\nrevoked, so if the role is subsequently re-created or granted, it will again\nbe the user\'s default role.\n\nThe default role is stored in the default_role column in the mysql.user\ntable/view, as well as in the Information Schema APPLICABLE_ROLES table, so\nthese can be viewed to see which role has been assigned to a user as the\ndefault.\n\nExamples\n--------\n\nSetting a default role for the current user:\n\nSET DEFAULT ROLE journalist;\n\nRemoving a default role from the current user:\n\nSET DEFAULT ROLE NONE;\n\nSetting a default role for another user. The role has to have been granted to\nthe user before it can be set as default:\n\nCREATE ROLE journalist;\nCREATE USER taniel;\n\nSET DEFAULT ROLE journalist FOR taniel;\nERROR 1959 (OP000): Invalid role specification `journalist`\n\nGRANT journalist TO taniel;\nSET DEFAULT ROLE journalist FOR taniel;\n\nViewing mysql.user:\n\nselect * from mysql.user where user=\'taniel\'\\G\n*************************** 1. row ***************************\n         Host: %\n         User: taniel\n...\n       is_role: N\n     default_role: journalist\n...\n\nRemoving a default role for another user\n\nSET DEFAULT ROLE NONE FOR taniel;\n\nURL: https://mariadb.com/kb/en/set-default-role/','','https://mariadb.com/kb/en/set-default-role/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (115,10,'Roles Overview','Description\n-----------\n\nA role bundles a number of privileges together. It assists larger\norganizations where, typically, a number of users would have the same\nprivileges, and, previously, the only way to change the privileges for a group\nof users was by changing each user\'s privileges individually.\n\nAlternatively, multiple external users could have been assigned the same user,\nand there would have been no way to see which actual user was responsible for\nwhich action.\n\nWith roles, managing this is easy. For example, there could be a number of\nusers assigned to a journalist role, with identical privileges. Changing the\nprivileges for all the journalists is a matter of simply changing the role\'s\nprivileges, while the individual user is still linked with any changes that\ntake place.\n\nRoles are created with the CREATE ROLE statement, and dropped with the DROP\nROLE statement. Roles are then assigned to a user with an extension to the\nGRANT statement, while privileges are assigned to a role in the regular way\nwith GRANT. Similarly, the REVOKE statement can be used to both revoke a role\nfrom a user, or revoke a privilege from a role.\n\nOnce a user has connected, he can obtain all privileges associated with a role\nby setting a role with the SET ROLE statement. The CURRENT_ROLE function\nreturns the currently set role for the session, if any.\n\nOnly roles granted directly to a user can be set, roles granted to other roles\ncannot. Instead the privileges granted to a role, which is, in turn, granted\nto another role (grantee), will be immediately available to any user who sets\nthis second grantee role.\n\nThe SET DEFAULT ROLE statement allows one to set a default role for a user. A\ndefault role is automatically enabled when a user connects (an implicit SET\nROLE statement is executed immediately after a connection is established).\n\nRoles were implemented as a GSoC 2013 project by Vicentiu Ciorbaru.\n\nSystem Tables\n-------------\n\nInformation about roles and who they\'ve been granted to can be found in the\nInformation Schema APPLICABLE_ROLES table as well as the mysql.ROLES_MAPPING\ntable.\n\nThe Information Schema ENABLED_ROLES table shows the enabled roles for the\ncurrent session.\n\nExamples\n--------\n\nCreating a role and granting a privilege:\n\nCREATE ROLE journalist;\n\nGRANT SHOW DATABASES ON *.* TO journalist;\n\nGRANT journalist to hulda;\n\nNote, that hulda has no SHOW DATABASES privilege, even though she was granted\nthe journalist role. She needs to set the role first:\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n+--------------------+\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSET ROLE journalist;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist   |\n+--------------+\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| ...                |\n| information_schema |\n| mysql              |\n| performance_schema |\n| test               |\n| ...                |\n+--------------------+\n\nSET ROLE NONE;\n\nRoles can be granted to roles:\n\nCREATE ROLE writer;\n\nGRANT SELECT ON data.* TO writer;\n\nGRANT writer TO journalist;\n\nBut one does not need to set a role granted to a role. For example, hulda will\nautomatically get all writer privileges when she sets the journalist role:\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSHOW TABLES FROM data;\nEmpty set (0.01 sec)\n\nSET ROLE journalist;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist   |\n+--------------+\n\nSHOW TABLES FROM data;\n+------------------------------+\n| Tables_in_data               |\n+------------------------------+\n| set1                         |\n| ...                          |\n+------------------------------+\n\nRoles and Views (and Stored Routines)\n-------------------------------------\n\nWhen a user sets a role, he, in a sense, has two identities with two\nassociated sets of privileges. But a view (or a stored routine) can have only\none definer. So, when a view (or a stored routine) is created with the SQL\nSECURITY DEFINER, one can specify whether the definer should be CURRENT_USER\n(and the view will have none of the privileges of the user\'s role) or\nCURRENT_ROLE (in this case, the view will use role\'s privileges, but none of\nthe user\'s privileges). As a result, sometimes one can create a view that is\nimpossible to use.\n\nCREATE ROLE r1;\n\nGRANT ALL ON db1.* TO r1;\n\nGRANT r1 TO foo@localhost;\n\nGRANT ALL ON db.* TO foo@localhost;\n\nSELECT CURRENT_USER\n+---------------+\n| current_user  |\n+---------------+\n| foo@localhost |\n+---------------+\n\nSET ROLE r1;\n\nCREATE TABLE db1.t1 (i int);\n\nCREATE VIEW db.v1 AS SELECT * FROM db1.t1;\n\nSHOW CREATE VIEW db.v1;\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n| View | Create View                                                          \n                                 |\ncharacter_set_client | collation_connection |\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n| v1   | CREATE ALGORITHM=UNDEFINED DEFINER=`foo`@`localhost` SQL SECURITY\nDEFINER VIEW `db`.`v1` AS SELECT `db1`.`t1`.`i` AS `i` from `db1`.`t1` | utf8 \n       | utf8_general_ci      |\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n\nCREATE DEFINER=CURRENT_ROLE VIEW db.v2 AS SELECT * FROM db1.t1;\n\nSHOW CREATE VIEW db.b2;\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n| View | Create View                                                          \n                           | character_set_client |\ncollation_connection |\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n| v2   | CREATE ALGORITHM=UNDEFINED DEFINER=`r1` SQL SECURITY DEFINER VIEW\n`db`.`v2` AS select `db1`.`t1`.`a` AS `a` from `db1`.`t1` | utf8              \n | utf8_general_ci      |\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n\nOther Resources\n---------------\n\n* Roles Review by Peter Gulutzan\n\nURL: https://mariadb.com/kb/en/roles_overview/','','https://mariadb.com/kb/en/roles_overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (116,10,'Account Locking','MariaDB starting with 10.4.2\n----------------------------\nAccount locking was introduced in MariaDB 10.4.2.\n\nDescription\n-----------\n\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected).\n\nUser accounts can be locked at creation, with the CREATE USER statement, or\nmodified after creation with the ALTER USER statement. For example:\n\nCREATE USER \'lorin\'@\'localhost\' ACCOUNT LOCK;\n\nor\n\nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nThe server will return an ER_ACCOUNT_HAS_BEEN_LOCKED error when locked users\nattempt to connect:\n\nmysql -ulorin\n ERROR 4151 (HY000): Access denied, this account is locked\n\nThe ALTER USER statement is also used to unlock a user:\n\nALTER USER \'lorin\'@\'localhost\' ACCOUNT UNLOCK;\n\nThe SHOW CREATE USER statement will show whether the account is locked:\n\nSHOW CREATE USER \'marijn\'@\'localhost\';\n+-----------------------------------------------+\n| CREATE USER for marijn@localhost              |\n+-----------------------------------------------+\n| CREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK |\n+-----------------------------------------------+\n\nas well as querying the mysql.global_priv table:\n\nSELECT CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) FROM\nmysql.global_priv \n WHERE user=\'marijn\';\n+------------------------------------------------------------------------------\n-------+\n| CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv))                        \n    |\n+------------------------------------------------------------------------------\n-------+\n| marijn@localhost => {\n  \"access\": 0,\n  \"plugin\": \"mysql_native_password\",\n  \"authentication_string\": \"\",\n  \"account_locked\": true,\n  \"password_last_changed\": 1558017158\n} |\n+------------------------------------------------------------------------------\n-------+\n\nURL: https://mariadb.com/kb/en/account-locking/','','https://mariadb.com/kb/en/account-locking/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (117,10,'Authentication from MariaDB 10.4','MariaDB starting with 10.4\n--------------------------\nMariaDB 10.4 introduced a number of changes to the authentication process,\nintended to make things easier and more intuitive.\n\nOverview\n--------\n\nThere are four new main features in 10.4 relating to authentication:\n\n* It is possible to use more than one authentication plugin for each user\naccount. For example, this can be useful to slowly migrate users to the more\nsecure ed25519 authentication plugin over time, while allowing the old\nmysql_native_password authentication plugin as an alternative for the\ntransitional period.\n* The root@localhost user account created by mysql_install_db is created with\nthe ability to use two authentication plugins.\nFirst, it is configured to try to use the unix_socket authentication plugin.\nThis allows the root@localhost user to login without a password via the local\nUnix socket file defined by the socket system variable, as long as the login\nis attempted from a process owned by the operating system root user account.\nSecond, if authentication fails with the unix_socket authentication plugin,\nthen it is configured to try to use the mysql_native_password authentication\nplugin. However, an invalid password is initially set, so in order to\nauthenticate this way, a password must be set with SET PASSWORD.\nHowever, just using the unix_socket authentication plugin may be fine for many\nusers, and it is very secure. You may want to try going without password\nauthentication to see how well it works for you. Remember, the best way to\nkeep your password safe is not to have one!\n\n* All user accounts, passwords, and global privileges are now stored in the\nmysql.global_priv table. The mysql.user table still exists and has exactly the\nsame set of columns as before, but it’s now a view that references the\nmysql.global_priv table. Tools that analyze the mysql.user table should\ncontinue to work as before. From MariaDB 10.4.13, the dedicated mariadb.sys\nuser is created as the definer of this view. Previously root was the definer,\nwhich resulted in privilege problems when this username was changed.\n* MariaDB 10.4 adds supports for User Password Expiry, which is not active by\ndefault.\n\nDescription\n-----------\n\nAs a result of the above changes, the open-for-everyone all-powerful root\naccount is finally gone. And installation scripts will no longer demand that\nyou \"PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !\", because\nthe root account is securely created automatically.\n\nTwo all-powerful accounts are created by default — root and the OS user that\nowns the data directory, typically mysql. They are created as:\n\nCREATE USER root@localhost IDENTIFIED VIA unix_socket OR mysql_native_password\nUSING \'invalid\'\nCREATE USER mysql@localhost IDENTIFIED VIA unix_socket OR\nmysql_native_password USING \'invalid\'\n\nUsing unix_socket means that if you are the system root user, you can login as\nroot@locahost without a password. This technique was pioneered by Otto\nKekäläinen in Debian MariaDB packages and has been successfully used in Debian\nsince as early as MariaDB 10.0.\n\nIt is based on a simple fact that asking the system root for a password adds\nno extra security — root has full access to all the data files and all process\nmemory anyway. But not asking for a password means, there is no root password\nto forget (no need for the numerous tutorials on \"how to reset MariaDB root\npassword\"). And if you want to script some tedious database work, there is no\nneed to store the root password in plain text for the script to use (no need\nfor debian-sys-maint user).\n\nStill, some users may wish to log in as MariaDB root without using sudo. Hence\nthe old authentication method — conventional MariaDB password — is still\navailable. By default it is disabled (\"invalid\" is not a valid password hash),\nbut one can set the password with a usual SET PASSWORD statement. And still\nretain the password-less access via sudo.\n\nIf you install MariaDB locally (say from a tarball), you would not want to use\nsudo to be able to login. This is why MariaDB creates a second all-powerful\nuser with the same name as a system user that owns the data directory. In\nlocal (not system-wide) installations, this will be the user who installed\nMariaDB — they automatically get convenient password-less root-like access,\nbecause they can access all the data files anyway.\n\nEven if MariaDB is installed system-wide, you may not want to run your\ndatabase maintenance scripts as system root — now you can run them as system\nmysql user. And you will know that they will never destroy your entire system,\neven if you make a typo in a shell script.\n\nHowever, seasoned MariaDB DBAs who are used to the old ways do need to make\nsome changes. See the examples below for common tasks.\n\nCookbook\n--------\n\nAfter installing MariaDB system-wide the first thing you’ve got used to doing\nis logging in into the unprotected root account and protecting it, that is,\nsetting the root password:\n\n$ sudo dnf install MariaDB-server\n$ mysql -uroot\n...\nMariaDB> set password = password(\"XH4VmT3_jt\");\n\nThis is not only unnecessary now, it will simply not work — there is no\nunprotected root account. To login as root use\n\n$ sudo dnf install MariaDB-server\n$ sudo mysql\n\nNote that it implies you are connecting via the unix socket, not tcp. If you\nhappen to have protocol=tcp in a system-wide /etc/my.cnf file, use sudo mysql\n--protocol=socket.\n\nAfter installing MariaDB locally you’ve also used to connect to the\nunprotected root account using mysql -uroot. This will not work either, simply\nuse mysql without specifying a username.\n\nIf you\'ve forgotten your root password, no problem — you can still connect\nusing sudo and change the password. And if you\'ve also removed unix_socket\nauthentication, to restore access do as follows:\n\n* restart MariaDB with --skip-grant-tables\n* login into the unprotected server\n* run FLUSH PRIVILEGES (note, before 10.4 this would’ve been the last step,\nnot anymore). This disables --skip-grant-tables and allows you to change the\nstored authentication method\n* run SET PASSWORD FOR root@localhost to change the root password.\n\nTo view inside privilege tables, the old mysql.user table still exists. You\ncan select from it as before, although you cannot update it anymore. It\ndoesn’t show alternative authentication plugins and this was one of the\nreasons for switching to the mysql.global_priv table — complex authentication\nrules did not fit into rigid structure of a relational table. You can select\nfrom the new table, for example:\n\nselect concat(user, \'@\', host, \' => \', json_detailed(priv)) from\nmysql.global_priv;\n\nReverting to the Previous Authentication Method for root@localhost\n------------------------------------------------------------------\n\nIf you don\'t want the root@localhost user account created by mysql_install_db\nto use unix_socket authentication by default, then there are a few ways to\nrevert to the previous mysql_native_password authentication method for this\nuser account.\n\nConfiguring mysql_install_db to Revert to the Previous Authentication Method\n----------------------------------------------------------------------------\n\nOne way to revert to the previous mysql_native_password authentication method\nfor the root@localhost user account is to execute mysql_install_db with a\nspecial option. If mysql_install_db is executed while\n--auth-root-authentication-method=normal is specified, then it will create the\ndefault user accounts using the default behavior of MariaDB 10.3 and before.\n\nThis means that the root@localhost user account will use mysql_native_password\nauthentication by default. There are some other differences as well. See\nmysql_install_db: User Accounts Created by Default for more information.\n\nFor example, the option can be set on the command-line while running\nmysql_install_db:\n\nmysql_install_db --user=mysql --datadir=/var/lib/mysql\n--auth-root-authentication-method=normal\n\nThe option can also be set in an option file in an option group supported by\nmysql_install_db. For example:\n\n[mysql_install_db]\nauth_root_authentication_method=normal\n\nIf the option is set in an option file and if mysql_install_db is executed,\nthen mysql_install_db will read this option from the option file, and it will\nautomatically set this option.\n\nAltering the User Account to Revert to the Previous Authentication Method\n-------------------------------------------------------------------------\n\nIf you have already installed MariaDB, and if the root@localhost user account\nis already using unix_socket authentication, then you can revert to the old\nmysql_native_password authentication method for the user account by executing\nthe following:\n\nALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING\nPASSWORD(\"verysecret\")\n\nURL: https://mariadb.com/kb/en/authentication-from-mariadb-104/','','https://mariadb.com/kb/en/authentication-from-mariadb-104/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,10,'User Password Expiry','MariaDB starting with 10.4.3\n----------------------------\nUser password expiry was introduced in MariaDB 10.4.3.\n\nPassword expiry permits administrators to expire user passwords, either\nmanually or automatically.\n\nSystem Variables\n----------------\n\nThere are two system variables which affect password expiry:\ndefault_password_lifetime, which determines the amount of time between\nrequiring the user to change their password. 0, the default, means automatic\npassword expiry is not active.\n\nThe second variable, disconnect_on_expired_password determines whether a\nclient is permitted to connect if their password has expired, or whether they\nare permitted to connect in sandbox mode, able to perform a limited subset of\nqueries related to resetting the password, in particular SET PASSWORD and SET.\n\nSetting a Password Expiry Limit for a User\n------------------------------------------\n\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal using the CREATE USER or ALTER USER statements, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nLimits can be disabled by use of the NEVER keyword, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n\nA manually set limit can be restored the system default by use of DEFAULT, for\nexample:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSHOW CREATE USER\n----------------\n\nThe SHOW CREATE USER statement will display information about the password\nexpiry status of the user. Unlike MySQL, it will not display if the user is\nunlocked, or if the password expiry is set to default.\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\nCREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE NEVER;\nCREATE USER \'amse\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSHOW CREATE USER \'monty\'@\'localhost\';\n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost                                  |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY |\n+------------------------------------------------------------------+\n\nSHOW CREATE USER \'konstantin\'@\'localhost\';\n+------------------------------------------------------------+\n| CREATE USER for konstantin@localhost                       |\n+------------------------------------------------------------+\n| CREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE NEVER |\n+------------------------------------------------------------+\n\nSHOW CREATE USER \'amse\'@\'localhost\';\n+--------------------------------+\n| CREATE USER for amse@localhost |\n+--------------------------------+\n| CREATE USER \'amse\'@\'localhost\' |\n+--------------------------------+\n\nChecking When Passwords Expire\n------------------------------\n\nThe following query can be used to check when the current passwords expire for\nall users:\n\nWITH password_expiration_info AS (\n SELECT User, Host,\n IF(\n IFNULL(JSON_EXTRACT(Priv, \'$.password_lifetime\'), -1) = -1,\n @@global.default_password_lifetime,\n JSON_EXTRACT(Priv, \'$.password_lifetime\')\n ) AS password_lifetime,\n JSON_EXTRACT(Priv, \'$.password_last_changed\') AS password_last_changed\n FROM mysql.global_priv\n)\nSELECT pei.User, pei.Host,\n pei.password_lifetime,\n FROM_UNIXTIME(pei.password_last_changed) AS password_last_changed_datetime,\n FROM_UNIXTIME(\n pei.password_last_changed +\n (pei.password_lifetime * 60 * 60 * 24)\n ) AS password_expiration_datetime\n FROM password_expiration_info pei\n WHERE pei.password_lifetime != 0\n AND pei.password_last_changed IS NOT NULL\nUNION\nSELECT pei.User, pei.Host,\n pei.password_lifetime,\n FROM_UNIXTIME(pei.password_last_changed) AS password_last_changed_datetime,\n 0 AS password_expiration_datetime\n FROM password_expiration_info pei\n WHERE pei.password_lifetime = 0\n OR pei.password_last_changed IS NULL;\n\n--connect-expired-password Client Option\n----------------------------------------\n\nThe mysql client --connect-expired-password option notifies the server that\nthe client is prepared to handle expired password sandbox mode (even if the\n--batch option was specified).\n\nURL: https://mariadb.com/kb/en/user-password-expiry/','','https://mariadb.com/kb/en/user-password-expiry/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (119,11,'ST_X','Syntax\n------\n\nST_X(p)\nX(p)\n\nDescription\n-----------\n\nReturns the X-coordinate value for the point p as a double-precision number.\n\nST_X() and X() are synonyms.\n\nExamples\n--------\n\nSET @pt = \'Point(56.7 53.34)\';\n\nSELECT X(GeomFromText(@pt));\n+----------------------+\n| X(GeomFromText(@pt)) |\n+----------------------+\n|                 56.7 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st_x/','','https://mariadb.com/kb/en/st_x/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (120,11,'ST_Y','Syntax\n------\n\nST_Y(p)\nY(p)\n\nDescription\n-----------\n\nReturns the Y-coordinate value for the point p as a double-precision number.\n\nST_Y() and Y() are synonyms.\n\nExamples\n--------\n\nSET @pt = \'Point(56.7 53.34)\';\n\nSELECT Y(GeomFromText(@pt));\n+----------------------+\n| Y(GeomFromText(@pt)) |\n+----------------------+\n|                53.34 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st_y/','','https://mariadb.com/kb/en/st_y/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (121,11,'X','A synonym for ST_X.\n\nURL: https://mariadb.com/kb/en/point-properties-x/','','https://mariadb.com/kb/en/point-properties-x/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (122,11,'Y','A synonym for ST_Y.\n\nURL: https://mariadb.com/kb/en/point-properties-y/','','https://mariadb.com/kb/en/point-properties-y/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (123,12,'UNCOMPRESS','Syntax\n------\n\nUNCOMPRESS(string_to_uncompress)\n\nDescription\n-----------\n\nUncompresses a string compressed by the COMPRESS() function. If the argument\nis not a compressed value, the result is NULL. This function requires MariaDB\nto have been compiled with a compression library such as zlib. Otherwise, the\nreturn value is always NULL. The have_compress server system variable\nindicates whether a compression library is present.\n\nExamples\n--------\n\nSELECT UNCOMPRESS(COMPRESS(\'a string\'));\n+----------------------------------+\n| UNCOMPRESS(COMPRESS(\'a string\')) |\n+----------------------------------+\n| a string                         |\n+----------------------------------+\n\nSELECT UNCOMPRESS(\'a string\');\n+------------------------+\n| UNCOMPRESS(\'a string\') |\n+------------------------+\n| NULL                   |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/uncompress/','','https://mariadb.com/kb/en/uncompress/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (124,12,'DECODE','Syntax\n------\n\nDECODE(crypt_str,pass_str)\n\nIn Oracle mode from MariaDB 10.3.2:\n\nDECODE(expr, search_expr, result_expr [, search_expr2, result_expr2 ...]\n[default_expr])\n\nIn all modes from MariaDB 10.3.2:\n\nDECODE_ORACLE(expr, search_expr, result_expr [, search_expr2, result_expr2\n...] [default_expr])\n\nDescription\n-----------\n\nIn the default mode, DECODE decrypts the encrypted string crypt_str using\npass_str as the password. crypt_str should be a string returned from ENCODE().\nThe resulting string will be the original string only if pass_str is the same.\n\nIn Oracle mode from MariaDB 10.3.2, DECODE compares expr to the search\nexpressions, in order. If it finds a match, the corresponding result\nexpression is returned. If no matches are found, the default expression is\nreturned, or NULL if no default is provided.\n\nNULLs are treated as equivalent.\n\nDECODE_ORACLE is a synonym for the Oracle-mode version of the function, and is\navailable in all modes.\n\nExamples\n--------\n\nFrom MariaDB 10.3.2:\n\nSELECT DECODE_ORACLE(2+1,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+1,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| found1                                                 |\n+--------------------------------------------------------+\n\nSELECT DECODE_ORACLE(2+4,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+4,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| found2                                                 |\n+--------------------------------------------------------+\n\nSELECT DECODE_ORACLE(2+2,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+2,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| default                                                |\n+--------------------------------------------------------+\n\nNulls are treated as equivalent:\n\nSELECT DECODE_ORACLE(NULL,NULL,\'Nulls are equivalent\',\'Nulls are not\nequivalent\');\n+----------------------------------------------------------------------------+\n| DECODE_ORACLE(NULL,NULL,\'Nulls are equivalent\',\'Nulls are not equivalent\') |\n+----------------------------------------------------------------------------+\n| Nulls are equivalent                                                       |\n+----------------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/decode/','','https://mariadb.com/kb/en/decode/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (125,12,'DECODE_ORACLE','MariaDB starting with 10.3.2\n----------------------------\nDECODE_ORACLE is a synonym for the Oracle mode version of the DECODE function,\nand is available in all modes.\n\nURL: https://mariadb.com/kb/en/decode_oracle/','','https://mariadb.com/kb/en/decode_oracle/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (126,12,'AES_DECRYPT','Syntax\n------\n\nAES_DECRYPT(crypt_str,key_str)\n\nDescription\n-----------\n\nThis function allows decryption of data using the official AES (Advanced\nEncryption Standard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nURL: https://mariadb.com/kb/en/aes_decrypt/','','https://mariadb.com/kb/en/aes_decrypt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (127,12,'AES_ENCRYPT','Syntax\n------\n\nAES_ENCRYPT(str,key_str)\n\nDescription\n-----------\n\nAES_ENCRYPT() and AES_DECRYPT() allow encryption and decryption of data using\nthe official AES (Advanced Encryption Standard) algorithm, previously known as\n\"Rijndael.\" Encoding with a 128-bit key length is used, but you can extend it\nup to 256 bits by modifying the source. We chose 128 bits because it is much\nfaster and it is secure enough for most purposes.\n\nAES_ENCRYPT() encrypts a string str using the key key_str, and returns a\nbinary string.\n\nAES_DECRYPT() decrypts the encrypted string and returns the original string.\n\nThe input arguments may be any length. If either argument is NULL, the result\nof this function is also NULL.\n\nBecause AES is a block-level algorithm, padding is used to encode uneven\nlength strings and so the result string length may be calculated using this\nformula:\n\n16 x (trunc(string_length / 16) + 1)\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns NULL.\nHowever, it is possible for AES_DECRYPT() to return a non-NULL value (possibly\ngarbage) if the input data or the key is invalid.\n\nExamples\n--------\n\nINSERT INTO t VALUES (AES_ENCRYPT(\'text\',SHA2(\'password\',512)));\n\nURL: https://mariadb.com/kb/en/aes_encrypt/','','https://mariadb.com/kb/en/aes_encrypt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (128,12,'COMPRESS','Syntax\n------\n\nCOMPRESS(string_to_compress)\n\nDescription\n-----------\n\nCompresses a string and returns the result as a binary string. This function\nrequires MariaDB to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL. The compressed string can be\nuncompressed with UNCOMPRESS().\n\nThe have_compress server system variable indicates whether a compression\nlibrary is present.\n\nExamples\n--------\n\nSELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n+------------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',1000))) |\n+------------------------------------+\n|                                 21 |\n+------------------------------------+\n\nSELECT LENGTH(COMPRESS(\'\'));\n+----------------------+\n| LENGTH(COMPRESS(\'\')) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nSELECT LENGTH(COMPRESS(\'a\'));\n+-----------------------+\n| LENGTH(COMPRESS(\'a\')) |\n+-----------------------+\n|                    13 |\n+-----------------------+\n\nSELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n+----------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',16))) |\n+----------------------------------+\n|                               15 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/compress/','','https://mariadb.com/kb/en/compress/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (129,12,'DES_DECRYPT','DES_DECRYPT has been deprecated from MariaDB 10.10.0, and will be removed in a\nfuture release.\n\nSyntax\n------\n\nDES_DECRYPT(crypt_str[,key_str])\n\nDescription\n-----------\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs, this\nfunction returns NULL.\n\nThis function works only if MariaDB has been configured with TLS support.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte of the\nencrypted string to determine the DES key number that was used to encrypt the\noriginal string, and then reads the key from the DES key file to decrypt the\nmessage. For this to work, the user must have the SUPER privilege. The key\nfile can be specified with the --des-key-file server option.\n\nIf you pass this function a key_str argument, that string is used as the key\nfor decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string, MariaDB\nreturns the given crypt_str.\n\nURL: https://mariadb.com/kb/en/des_decrypt/','','https://mariadb.com/kb/en/des_decrypt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (130,12,'DES_ENCRYPT','DES_ENCRYPT has been deprecated from MariaDB 10.10.0, and will be removed in a\nfuture release.\n\nSyntax\n------\n\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nDescription\n-----------\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MariaDB has been configured with TLS support.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from the DES\nkey file is used. With a key_num argument, the given key number (0-9) from the\nDES key file is used. With a key_str argument, the given key string is used to\nencrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is CHAR(128 |\nkey_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If you use a\nstring key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in the\nfile may be in any order. des_key_str is the string that is used to encrypt\nthe message. There should be at least one space between the number and the\nkey. The first key is the default key that is used if you do not specify any\nkey argument to DES_ENCRYPT().\n\nYou can tell MariaDB to read new key values from the key file with the FLUSH\nDES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives applications a\nway to check for the existence of encrypted column values, without giving the\nend user the right to decrypt those values.\n\nExamples\n--------\n\nSELECT customer_address FROM customer_table \n WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n\nURL: https://mariadb.com/kb/en/des_encrypt/','','https://mariadb.com/kb/en/des_encrypt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (131,12,'ENCODE','Syntax\n------\n\nENCODE(str,pass_str)\n\nDescription\n-----------\n\nENCODE is not considered cryptographically secure, and should not be used for\npassword encryption.\n\nEncrypt str using pass_str as the password. To decrypt the result, use\nDECODE().\n\nThe result is a binary string of the same length as str.\n\nThe strength of the encryption is based on how good the random generator is.\n\nIt is not recommended to rely on the encryption performed by the ENCODE\nfunction. Using a salt value (changed when a password is updated) will improve\nmatters somewhat, but for storing passwords, consider a more cryptographically\nsecure function, such as SHA2().\n\nExamples\n--------\n\nENCODE(\'not so secret text\', CONCAT(\'random_salt\',\'password\'))\n\nURL: https://mariadb.com/kb/en/encode/','','https://mariadb.com/kb/en/encode/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,12,'ENCRYPT','Syntax\n------\n\nENCRYPT(str[,salt])\n\nDescription\n-----------\n\nEncrypts a string using the Unix crypt() system call, returning an encrypted\nbinary string. The salt argument should be a string with at least two\ncharacters or the returned result will be NULL. If no salt argument is given,\na random value of sufficient length is used.\n\nIt is not recommended to use ENCRYPT() with utf16, utf32 or ucs2 multi-byte\ncharacter sets because the crypt() system call expects a string terminated\nwith a zero byte.\n\nNote that the underlying crypt() system call may have some limitations, such\nas ignoring all but the first eight characters.\n\nIf the have_crypt system variable is set to NO (because the crypt() system\ncall is not available), the ENCRYPT function will always return NULL.\n\nExamples\n--------\n\nSELECT ENCRYPT(\'encrypt me\');\n+-----------------------+\n| ENCRYPT(\'encrypt me\') |\n+-----------------------+\n| 4I5BsEx0lqTDk         |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/encrypt/','','https://mariadb.com/kb/en/encrypt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (133,12,'MD5','Syntax\n------\n\nMD5(str)\n\nDescription\n-----------\n\nCalculates an MD5 128-bit checksum for the string.\n\nThe return value is a 32-hex digit string, and as of MariaDB 5.5, is a\nnonbinary string in the connection character set and collation, determined by\nthe values of the character_set_connection and collation_connection system\nvariables. Before 5.5, the return value was a binary string.\n\nNULL is returned if the argument was NULL.\n\nExamples\n--------\n\nSELECT MD5(\'testing\');\n+----------------------------------+\n| MD5(\'testing\')                   |\n+----------------------------------+\n| ae2b1fca515949e5d54fb22b8ed95575 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/md5/','','https://mariadb.com/kb/en/md5/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,12,'OLD_PASSWORD','Syntax\n------\n\nOLD_PASSWORD(str)\n\nDescription\n-----------\n\nOLD_PASSWORD() was added to MySQL when the implementation of PASSWORD() was\nchanged to improve security. OLD_PASSWORD() returns the value of the old\n(pre-MySQL 4.1) implementation of PASSWORD() as a string, and is intended to\npermit you to reset passwords for any pre-4.1 clients that need to connect to\na more recent MySQL server version, or any version of MariaDB, without locking\nthem out.\n\nAs of MariaDB 5.5, the return value is a nonbinary string in the connection\ncharacter set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system variables. Before\n5.5, the return value was a binary string.\n\nThe return value is 16 bytes in length, or NULL if the argument was NULL.\n\nURL: https://mariadb.com/kb/en/old_password/','','https://mariadb.com/kb/en/old_password/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (135,12,'PASSWORD','Syntax\n------\n\nPASSWORD(str)\n\nDescription\n-----------\n\nThe PASSWORD() function is used for hashing passwords for use in\nauthentication by the MariaDB server. It is not intended for use in other\napplications.\n\nCalculates and returns a hashed password string from the plaintext password\nstr. Returns an empty string (>= MariaDB 10.0.4) if the argument was NULL.\n\nThe return value is a nonbinary string in the connection character set and\ncollation, determined by the values of the character_set_connection and\ncollation_connection system variables.\n\nThis is the function that is used for hashing MariaDB passwords for storage in\nthe Password column of the user table (see privileges), usually used with the\nSET PASSWORD statement. It is not intended for use in other applications.\n\nUntil MariaDB 10.3, the return value is 41-bytes in length, and the first\ncharacter is always \'*\'. From MariaDB 10.4, the function takes into account\nthe authentication plugin where applicable (A CREATE USER or SET PASSWORD\nstatement). For example, when used in conjunction with a user authenticated by\nthe ed25519 plugin, the statement will create a longer hash:\n\nCREATE USER edtest@localhost IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nCREATE USER edtest2@localhost IDENTIFIED BY \'secret\';\n\nSELECT CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) FROM\nmysql.global_priv\n WHERE user LIKE \'edtest%\'\\G\n*************************** 1. row ***************************\nCONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)): edtest@localhost => {\n...\n  \"plugin\": \"ed25519\",\n  \"authentication_string\": \"ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY\",\n...\n}\n*************************** 2. row ***************************\nCONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)): edtest2@localhost => {\n...\n  \"plugin\": \"mysql_native_password\",\n  \"authentication_string\": \"*14E65567ABDB5135D0CFD9A70B3032C179A49EE7\",\n...\n}\n\nThe behavior of this function is affected by the value of the old_passwords\nsystem variable. If this is set to 1 (0 is default), MariaDB reverts to using\nthe mysql_old_password authentication plugin by default for newly created\nusers and passwords.\n\nExamples\n--------\n\nSELECT PASSWORD(\'notagoodpwd\');\n+-------------------------------------------+\n| PASSWORD(\'notagoodpwd\')                   |\n+-------------------------------------------+\n| *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 |\n+-------------------------------------------+\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\nURL: https://mariadb.com/kb/en/password/','','https://mariadb.com/kb/en/password/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,12,'SHA1','Syntax\n------\n\nSHA1(str), SHA(str)\n\nDescription\n-----------\n\nCalculates an SHA-1 160-bit checksum for the string str, as described in RFC\n3174 (Secure Hash Algorithm).\n\nThe value is returned as a string of 40 hex digits, or NULL if the argument\nwas NULL. As of MariaDB 5.5, the return value is a nonbinary string in the\nconnection character set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system variables. Before\n5.5, the return value was a binary string.\n\nExamples\n--------\n\nSELECT SHA1(\'some boring text\');\n+------------------------------------------+\n| SHA1(\'some boring text\')                 |\n+------------------------------------------+\n| af969fc2085b1bb6d31e517d5c456def5cdd7093 |\n+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/sha1/','','https://mariadb.com/kb/en/sha1/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (137,12,'SHA2','Syntax\n------\n\nSHA2(str,hash_len)\n\nDescription\n-----------\n\nGiven a string str, calculates an SHA-2 checksum, which is considered more\ncryptographically secure than its SHA-1 equivalent. The SHA-2 family includes\nSHA-224, SHA-256, SHA-384, and SHA-512, and the hash_len must correspond to\none of these, i.e. 224, 256, 384 or 512. 0 is equivalent to 256.\n\nThe return value is a nonbinary string in the connection character set and\ncollation, determined by the values of the character_set_connection and\ncollation_connection system variables.\n\nNULL is returned if the hash length is not valid, or the string str is NULL.\n\nSHA2 will only work if MariaDB was has been configured with TLS support.\n\nExamples\n--------\n\nSELECT SHA2(\'Maria\',224);\n+----------------------------------------------------------+\n| SHA2(\'Maria\',224)                                        |\n+----------------------------------------------------------+\n| 6cc67add32286412efcab9d0e1675a43a5c2ef3cec8879f81516ff83 |\n+----------------------------------------------------------+\n\nSELECT SHA2(\'Maria\',256);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',256)                                                |\n+------------------------------------------------------------------+\n| 9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16 |\n+------------------------------------------------------------------+\n\nSELECT SHA2(\'Maria\',0);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',0)                                                  |\n+------------------------------------------------------------------+\n| 9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16 |\n+------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/sha2/','','https://mariadb.com/kb/en/sha2/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (138,13,'ENDPOINT','A synonym for ST_ENDPOINT.\n\nURL: https://mariadb.com/kb/en/linestring-properties-endpoint/','','https://mariadb.com/kb/en/linestring-properties-endpoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (139,13,'GLENGTH','Syntax\n------\n\nGLength(ls)\n\nDescription\n-----------\n\nReturns as a double-precision number the length of the LineString value ls in\nits associated spatial reference.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n|           2.82842712474619 |\n+----------------------------+\n\nURL: https://mariadb.com/kb/en/glength/','','https://mariadb.com/kb/en/glength/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (140,13,'NumPoints','A synonym for ST_NumPoints.\n\nURL: https://mariadb.com/kb/en/linestring-properties-numpoints/','','https://mariadb.com/kb/en/linestring-properties-numpoints/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (141,13,'PointN','A synonym for ST_PointN.\n\nURL: https://mariadb.com/kb/en/linestring-properties-pointn/','','https://mariadb.com/kb/en/linestring-properties-pointn/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (142,13,'STARTPOINT','A synonym for ST_STARTPOINT.\n\nURL: https://mariadb.com/kb/en/linestring-properties-startpoint/','','https://mariadb.com/kb/en/linestring-properties-startpoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (143,13,'ST_ENDPOINT','Syntax\n------\n\nST_EndPoint(ls)\nEndPoint(ls)\n\nDescription\n-----------\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nST_EndPoint() and EndPoint() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3)                          |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_endpoint/','','https://mariadb.com/kb/en/st_endpoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (144,13,'ST_NUMPOINTS','Syntax\n------\n\nST_NumPoints(ls)\nNumPoints(ls)\n\nDescription\n-----------\n\nReturns the number of Point objects in the LineString value ls.\n\nST_NumPoints() and NumPoints() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n|                            3 |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/st_numpoints/','','https://mariadb.com/kb/en/st_numpoints/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (145,13,'ST_POINTN','Syntax\n------\n\nST_PointN(ls,N)\nPointN(ls,N)\n\nDescription\n-----------\n\nReturns the N-th Point in the LineString value ls. Points are numbered\nbeginning with 1.\n\nST_PointN() and PointN() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2)                          |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_pointn/','','https://mariadb.com/kb/en/st_pointn/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (146,13,'ST_STARTPOINT','Syntax\n------\n\nST_StartPoint(ls)\nStartPoint(ls)\n\nDescription\n-----------\n\nReturns the Point that is the start point of the LineString value ls.\n\nST_StartPoint() and StartPoint() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(StartPoint(GeomFromText(@ls)));\n+---------------------------------------+\n| AsText(StartPoint(GeomFromText(@ls))) |\n+---------------------------------------+\n| POINT(1 1)                            |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_startpoint/','','https://mariadb.com/kb/en/st_startpoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (147,14,'GET_LOCK','Syntax\n------\n\nGET_LOCK(str,timeout)\n\nDescription\n-----------\n\nTries to obtain a lock with a name given by the string str, using a timeout of\ntimeout seconds. Returns 1 if the lock was obtained successfully, 0 if the\nattempt timed out (for example, because another client has previously locked\nthe name), or NULL if an error occurred (such as running out of memory or the\nthread was killed with mysqladmin kill).\n\nA lock is released with RELEASE_LOCK(), when the connection terminates (either\nnormally or abnormally). A connection can hold multiple locks at the same\ntime, so a lock that is no longer needed needs to be explicitly released.\n\nThe IS_FREE_LOCK function returns whether a specified lock a free or not, and\nthe IS_USED_LOCK whether the function is in use or not.\n\nLocks obtained with GET_LOCK() do not interact with transactions. That is,\ncommitting a transaction does not release any such locks obtained during the\ntransaction.\n\nIt is also possible to recursively set the same lock. If a lock with the same\nname is set n times, it needs to be released n times as well.\n\nstr is case insensitive for GET_LOCK() and related functions. If str is an\nempty string or NULL, GET_LOCK() returns NULL and does nothing. From MariaDB\n10.2.2, timeout supports microseconds. Before then, it was rounded to the\nclosest integer.\n\nIf the metadata_lock_info plugin is installed, locks acquired with this\nfunction are visible in the Information Schema METADATA_LOCK_INFO table.\n\nThis function can be used to implement application locks or to simulate record\nlocks. Names are locked on a server-wide basis. If a name has been locked by\none client, GET_LOCK() blocks any request by another client for a lock with\nthe same name. This allows clients that agree on a given lock name to use the\nname to perform cooperative advisory locking. But be aware that it also allows\na client that is not among the set of cooperating clients to lock a name,\neither inadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of this is to\nuse lock names that are database-specific or application-specific. For\nexample, use lock names of the form db_name.str or app_name.str.\n\nStatements using the GET_LOCK function are not safe for statement-based\nreplication.\n\nThe patch to permit multiple locks was contributed by Konstantin \"Kostja\"\nOsipov (MDEV-3917).\n\nExamples\n--------\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT IS_FREE_LOCK(\'lock1\'), IS_USED_LOCK(\'lock1\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_USED_LOCK(\'lock1\') |\n+-----------------------+-----------------------+\n|                     0 |                    46 |\n+-----------------------+-----------------------+\n\nSELECT IS_FREE_LOCK(\'lock2\'), IS_USED_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock2\') | IS_USED_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n|                     1 |                  NULL |\n+-----------------------+-----------------------+\n\nMultiple locks can be held:\n\nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT IS_FREE_LOCK(\'lock1\'), IS_FREE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_FREE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n|                     0 |                     0 |\n+-----------------------+-----------------------+\n\nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n|                     1 |                     1 |\n+-----------------------+-----------------------+\n\nIt is possible to hold the same lock recursively. This example is viewed using\nthe metadata_lock_info plugin:\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\nEmpty set (0.000 sec)\n\nTimeout example: Connection 1:\n\nSELECT GET_LOCK(\'lock4\',10);\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock4\',10);\n\nAfter 10 seconds...\n\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nDeadlocks are automatically detected and resolved. Connection 1:\n\nSELECT GET_LOCK(\'lock5\',10); \n+----------------------+\n| GET_LOCK(\'lock5\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock6\',10);\n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 1:\n\nSELECT GET_LOCK(\'lock6\',10); \n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock5\',10);\nERROR 1213 (40001): Deadlock found when trying to get lock; try restarting\ntransaction\n\nURL: https://mariadb.com/kb/en/get_lock/','','https://mariadb.com/kb/en/get_lock/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (148,14,'INET6_ATON','Syntax\n------\n\nINET6_ATON(expr)\n\nDescription\n-----------\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary string\nthat represents the numeric value of the address.\n\nNo trailing zone ID\'s or traling network masks are permitted. For IPv4\naddresses, or IPv6 addresses with IPv4 address parts, no classful addresses or\ntrailing port numbers are permitted and octal numbers are not supported.\n\nThe returned binary string will be VARBINARY(16) or VARBINARY(4) for IPv6 and\nIPv4 addresses respectively.\n\nReturns NULL if the argument is not understood.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, INET6_ATON can take INET6 as an argument.\n\nExamples\n--------\n\nSELECT HEX(INET6_ATON(\'10.0.1.1\'));\n+-----------------------------+\n| HEX(INET6_ATON(\'10.0.1.1\')) |\n+-----------------------------+\n| 0A000101                    |\n+-----------------------------+\n\nSELECT HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\'));\n+----------------------------------------------+\n| HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\')) |\n+----------------------------------------------+\n| 48F3000000000000D4321431BA23846F             |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/inet6_aton/','','https://mariadb.com/kb/en/inet6_aton/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (149,14,'INET6_NTOA','Syntax\n------\n\nINET6_NTOA(expr)\n\nDescription\n-----------\n\nGiven an IPv6 or IPv4 network address as a numeric binary string, returns the\naddress as a nonbinary string in the connection character set.\n\nThe return string is lowercase, and is platform independent, since it does not\nuse functions specific to the operating system. It has a maximum length of 39\ncharacters.\n\nReturns NULL if the argument is not understood.\n\nExamples\n--------\n\nSELECT INET6_NTOA(UNHEX(\'0A000101\'));\n+-------------------------------+\n| INET6_NTOA(UNHEX(\'0A000101\')) |\n+-------------------------------+\n| 10.0.1.1                      |\n+-------------------------------+\n\nSELECT INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\'));\n+-------------------------------------------------------+\n| INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\')) |\n+-------------------------------------------------------+\n| 48f3::d432:1431:ba23:846f                             |\n+-------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/inet6_ntoa/','','https://mariadb.com/kb/en/inet6_ntoa/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (150,14,'INET_ATON','Syntax\n------\n\nINET_ATON(expr)\n\nDescription\n-----------\n\nGiven the dotted-quad representation of an IPv4 network address as a string,\nreturns an integer that represents the numeric value of the address. Addresses\nmay be 4- or 8-byte addresses.\n\nReturns NULL if the argument is not understood.\n\nExamples\n--------\n\nSELECT INET_ATON(\'192.168.1.1\');\n+--------------------------+\n| INET_ATON(\'192.168.1.1\') |\n+--------------------------+\n|               3232235777 |\n+--------------------------+\n\nThis is calculated as follows: 192 x 2563 + 168 x 256 2 + 1 x 256 + 1\n\nURL: https://mariadb.com/kb/en/inet_aton/','','https://mariadb.com/kb/en/inet_aton/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (151,14,'INET_NTOA','Syntax\n------\n\nINET_NTOA(expr)\n\nDescription\n-----------\n\nGiven a numeric IPv4 network address in network byte order (4 or 8 byte),\nreturns the dotted-quad representation of the address as a string.\n\nExamples\n--------\n\nSELECT INET_NTOA(3232235777);\n+-----------------------+\n| INET_NTOA(3232235777) |\n+-----------------------+\n| 192.168.1.1           |\n+-----------------------+\n\n192.168.1.1 corresponds to 3232235777 since 192 x 2563 + 168 x 256 2 + 1 x 256\n+ 1 = 3232235777\n\nURL: https://mariadb.com/kb/en/inet_ntoa/','','https://mariadb.com/kb/en/inet_ntoa/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (152,14,'IS_FREE_LOCK','Syntax\n------\n\nIS_FREE_LOCK(str)\n\nDescription\n-----------\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock is in\nuse, and NULL if an error occurs (such as an incorrect argument, like an empty\nstring or NULL). str is case insensitive.\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table contains information about locks of this kind (as\nwell as metadata locks).\n\nStatements using the IS_FREE_LOCK function are not safe for statement-based\nreplication.\n\nURL: https://mariadb.com/kb/en/is_free_lock/','','https://mariadb.com/kb/en/is_free_lock/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,14,'IS_IPV4','Syntax\n------\n\nIS_IPV4(expr)\n\nDescription\n-----------\n\nIf the expression is a valid IPv4 address, returns 1, otherwise returns 0.\n\nIS_IPV4() is stricter than INET_ATON(), but as strict as INET6_ATON(), in\ndetermining the validity of an IPv4 address. This implies that if IS_IPV4\nreturns 1, the same expression will always return a non-NULL result when\npassed to INET_ATON(), but that the reverse may not apply.\n\nExamples\n--------\n\nSELECT IS_IPV4(\'1110.0.1.1\');\n+-----------------------+\n| IS_IPV4(\'1110.0.1.1\') |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nSELECT IS_IPV4(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV4(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n|                                    0 |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv4/','','https://mariadb.com/kb/en/is_ipv4/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (154,14,'IS_IPV4_COMPAT','Syntax\n------\n\nIS_IPV4_COMPAT(expr)\n\nDescription\n-----------\n\nReturns 1 if a given numeric binary string IPv6 address, such as returned by\nINET6_ATON(), is IPv4-compatible, otherwise returns 0.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, when the argument is not INET6, automatic implicit CAST\nto INET6 is applied. As a consequence, IS_IPV4_COMPAT now understands\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, the function understood only binary(16) representation.\n\nExamples\n--------\n\nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n|                                        1 |\n+------------------------------------------+\n\nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\'));\n+-----------------------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\')) |\n+-----------------------------------------------------------+\n|                                                         0 |\n+-----------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv4_compat/','','https://mariadb.com/kb/en/is_ipv4_compat/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,14,'IS_IPV4_MAPPED','Syntax\n------\n\nIS_IPV4_MAPPED(expr)\n\nDescription\n-----------\n\nReturns 1 if a given a numeric binary string IPv6 address, such as returned by\nINET6_ATON(), is a valid IPv4-mapped address, otherwise returns 0.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, when the argument is not INET6, automatic implicit CAST\nto INET6 is applied. As a consequence, IS_IPV4_MAPPED now understands\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, the function understood only binary(16) representation.\n\nExamples\n--------\n\nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n|                                        0 |\n+------------------------------------------+\n\nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\'));\n+-----------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\')) |\n+-----------------------------------------------+\n|                                             1 |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv4_mapped/','','https://mariadb.com/kb/en/is_ipv4_mapped/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (156,14,'IS_IPV6','Syntax\n------\n\nIS_IPV6(expr)\n\nDescription\n-----------\n\nReturns 1 if the expression is a valid IPv6 address specified as a string,\notherwise returns 0. Does not consider IPv4 addresses to be valid IPv6\naddresses.\n\nExamples\n--------\n\nSELECT IS_IPV6(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV6(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n|                                    1 |\n+--------------------------------------+\n1 row in set (0.02 sec)\n\nSELECT IS_IPV6(\'10.0.1.1\');\n+---------------------+\n| IS_IPV6(\'10.0.1.1\') |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv6/','','https://mariadb.com/kb/en/is_ipv6/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (157,14,'IS_USED_LOCK','Syntax\n------\n\nIS_USED_LOCK(str)\n\nDescription\n-----------\n\nChecks whether the lock named str is in use (that is, locked). If so, it\nreturns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL. str is case insensitive.\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table contains information about locks of this kind (as\nwell as metadata locks).\n\nStatements using the IS_USED_LOCK function are not safe for statement-based\nreplication.\n\nURL: https://mariadb.com/kb/en/is_used_lock/','','https://mariadb.com/kb/en/is_used_lock/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (158,14,'MASTER_GTID_WAIT','Syntax\n------\n\nMASTER_GTID_WAIT(gtid-list[, timeout)\n\nDescription\n-----------\n\nThis function takes a string containing a comma-separated list of global\ntransaction id\'s (similar to the value of, for example, gtid_binlog_pos). It\nwaits until the value of gtid_slave_pos has the same or higher seq_no within\nall replication domains specified in the gtid-list; in other words, it waits\nuntil the slave has reached the specified GTID position.\n\nAn optional second argument gives a timeout in seconds. If the timeout expires\nbefore the specified GTID position is reached, then the function returns -1.\nPassing NULL or a negative number for the timeout means no timeout, and the\nfunction will wait indefinitely.\n\nIf the wait completes without a timeout, 0 is returned. Passing NULL for the\ngtid-list makes the function return NULL immediately, without waiting.\n\nThe gtid-list may be the empty string, in which case MASTER_GTID_WAIT()\nreturns immediately. If the gtid-list contains fewer domains than\ngtid_slave_pos, then only those domains are waited upon. If gtid-list contains\na domain that is not present in @@gtid_slave_pos, then MASTER_GTID_WAIT() will\nwait until an event containing such domain_id arrives on the slave (or until\ntimed out or killed).\n\nMASTER_GTID_WAIT() can be useful to ensure that a slave has caught up to a\nmaster. Simply take the value of gtid_binlog_pos on the master, and use it in\na MASTER_GTID_WAIT() call on the slave; when the call completes, the slave\nwill have caught up with that master position.\n\nMASTER_GTID_WAIT() can also be used in client applications together with the\nlast_gtid session variable. This is useful in a read-scaleout replication\nsetup, where the application writes to a single master but divides the reads\nout to a number of slaves to distribute the load. In such a setup, there is a\nrisk that an application could first do an update on the master, and then a\nbit later do a read on a slave, and if the slave is not fast enough, the data\nread from the slave might not include the update just made, possibly confusing\nthe application and/or the end-user. One way to avoid this is to request the\nvalue of last_gtid on the master just after the update. Then before doing the\nread on the slave, do a MASTER_GTID_WAIT() on the value obtained from the\nmaster; this will ensure that the read is not performed until the slave has\nreplicated sufficiently far for the update to have become visible.\n\nNote that MASTER_GTID_WAIT() can be used even if the slave is configured not\nto use GTID for connections (CHANGE MASTER TO master_use_gtid=no). This is\nbecause from MariaDB 10, GTIDs are always logged on the master server, and\nalways recorded on the slave servers.\n\nDifferences to MASTER_POS_WAIT()\n--------------------------------\n\n* MASTER_GTID_WAIT() is global; it waits for any master connection to reach\n the specified GTID position. MASTER_POS_WAIT() works only against a\n specific connection. This also means that while MASTER_POS_WAIT() aborts if\n its master connection is terminated with STOP SLAVE or due to an error,\n MASTER_GTID_WAIT() continues to wait while slaves are stopped.\n\n* MASTER_GTID_WAIT() can take its timeout as a floating-point value, so a\n timeout in fractional seconds is supported, eg. MASTER_GTID_WAIT(\"0-1-100\",\n 0.5). (The minimum wait is one microsecond, 0.000001 seconds).\n\n* MASTER_GTID_WAIT() allows one to specify a timeout of zero in order to do a\n non-blocking check to see if the slaves have progressed to a specific GTID\nposition\n (MASTER_POS_WAIT() takes a zero timeout as meaning an infinite wait). To do\n an infinite MASTER_GTID_WAIT(), specify a negative timeout, or omit the\n timeout argument.\n\n* MASTER_GTID_WAIT() does not return the number of events executed since the\n wait started, nor does it return NULL if a slave thread is stopped. It\n always returns either 0 for successful wait completed, or -1 for timeout\n reached (or NULL if the specified gtid-pos is NULL).\n\nSince MASTER_GTID_WAIT() looks only at the seq_no part of the GTIDs, not the\nserver_id, care is needed if a slave becomes diverged from another server so\nthat two different GTIDs with the same seq_no (in the same domain) arrive at\nthe same server. This situation is in any case best avoided; setting\ngtid_strict_mode is recommended, as this will prevent any such out-of-order\nsequence numbers from ever being replicated on a slave.\n\nURL: https://mariadb.com/kb/en/master_gtid_wait/','','https://mariadb.com/kb/en/master_gtid_wait/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (159,14,'MASTER_POS_WAIT','Syntax\n------\n\nMASTER_POS_WAIT(log_name,log_pos[,timeout,[\"connection_name\"]])\n\nDescription\n-----------\n\nThis function is useful in replication for controlling primary/replica\nsynchronization. It blocks until the replica has read and applied all updates\nup to the specified position (log_name,log_pos) in the primary log. The return\nvalue is the number of log events the replica had to wait for to advance to\nthe specified position. The function returns NULL if the replica SQL thread is\nnot started, the replica\'s primary information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the timeout has\nbeen exceeded. If the replica SQL thread stops while MASTER_POS_WAIT() is\nwaiting, the function returns NULL. If the replica is past the specified\nposition, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when timeout\nseconds have elapsed. timeout must be greater than 0; a zero or negative\ntimeout means no timeout.\n\nThe connection_name is used when you are using multi-source-replication. If\nyou don\'t specify it, it\'s set to the value of the default_master_connection\nsystem variable.\n\nStatements using the MASTER_POS_WAIT() function are not safe for replication.\n\nURL: https://mariadb.com/kb/en/master_pos_wait/','','https://mariadb.com/kb/en/master_pos_wait/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (160,14,'NAME_CONST','Syntax\n------\n\nNAME_CONST(name,value)\n\nDescription\n-----------\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments should be\nconstants.\n\nThis function is used internally when replicating stored procedures. It makes\nlittle sense to use it explicitly in SQL statements, and it was not supposed\nto be used like that.\n\nSELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n|     14 |\n+--------+\n\nURL: https://mariadb.com/kb/en/name_const/','','https://mariadb.com/kb/en/name_const/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,14,'RELEASE_ALL_LOCKS','MariaDB until 10.5.2\n--------------------\nRELEASE_ALL_LOCKS was added in MariaDB 10.5.2.\n\nSyntax\n------\n\nRELEASE_ALL_LOCKS()\n\nDescription\n-----------\n\nReleases all named locks held by the current session. Returns the number of\nlocks released, or 0 if none were held.\n\nStatements using the RELEASE_ALL_LOCKS function are not safe for\nstatement-based replication.\n\nExamples\n--------\n\nSELECT RELEASE_ALL_LOCKS();\n+---------------------+\n| RELEASE_ALL_LOCKS() | \n+---------------------+\n|                   0 |\n+---------------------+\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT RELEASE_ALL_LOCKS();\n+---------------------+\n| RELEASE_ALL_LOCKS() | \n+---------------------+\n|                   1 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/release_all_locks/','','https://mariadb.com/kb/en/release_all_locks/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (162,14,'RELEASE_LOCK','Syntax\n------\n\nRELEASE_LOCK(str)\n\nDescription\n-----------\n\nReleases the lock named by the string str that was obtained with GET_LOCK().\nReturns 1 if the lock was released, 0 if the lock was not established by this\nthread (in which case the lock is not released), and NULL if the named lock\ndid not exist. The lock does not exist if it was never obtained by a call to\nGET_LOCK() or if it has previously been released.\n\nstr is case insensitive. If str is an empty string or NULL, RELEASE_LOCK()\nreturns NULL and does nothing.\n\nStatements using the RELEASE_LOCK() function are not safe for replication.\n\nThe DO statement is convenient to use with RELEASE_LOCK().\n\nExamples\n--------\n\nConnection1:\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 1:\n\nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\'), RELEASE_LOCK(\'lock3\');\n+-----------------------+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') | RELEASE_LOCK(\'lock3\') |\n+-----------------------+-----------------------+-----------------------+\n|                     1 |                     0 |                  NULL |\n+-----------------------+-----------------------+-----------------------+\n\nFrom MariaDB 10.0.2, it is possible to hold the same lock recursively. This\nexample is viewed using the metadata_lock_info plugin:\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\nEmpty set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/release_lock/','','https://mariadb.com/kb/en/release_lock/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (163,14,'SLEEP','Syntax\n------\n\nSLEEP(duration)\n\nDescription\n-----------\n\nSleeps (pauses) for the number of seconds given by the duration argument, then\nreturns 0. If SLEEP() is interrupted, it returns 1. The duration may have a\nfractional part given in microseconds.\n\nStatements using the SLEEP() function are not safe for replication.\n\nExample\n-------\n\nSELECT SLEEP(5.5);\n+------------+\n| SLEEP(5.5) |\n+------------+\n|          0 |\n+------------+\n1 row in set (5.50 sec)\n\nURL: https://mariadb.com/kb/en/sleep/','','https://mariadb.com/kb/en/sleep/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (164,14,'SYS_GUID','MariaDB starting with 10.6.1\n----------------------------\nThe SYS_GUID function was introduced in MariaDB 10.6.1 to enhance Oracle\ncompatibility. Similar functionality can be achieved with the UUID function.\n\nSyntax\n------\n\nSYS_GUID()\n\nDescription\n-----------\n\nReturns a 16-byte globally unique identifier (GUID), similar to the UUID\nfunction, but without the - character.\n\nExample\n-------\n\nSELECT SYS_GUID();\n+----------------------------------+\n| SYS_GUID()                       |\n+----------------------------------+\n| 2C574E45BA2811EBB265F859713E4BE4 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/sys_guid/','','https://mariadb.com/kb/en/sys_guid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,14,'UUID','Syntax\n------\n\nUUID()\n\nDescription\n-----------\n\nReturns a Universally Unique Identifier (UUID).\n\nA UUID is designed as a number that is globally unique in space and time. Two\ncalls to UUID() are expected to generate two different values, even if these\ncalls are performed on two separate computers that are not connected to each\nother.\n\nUUID() results are intended to be unique, but cannot always be relied upon to\nunpredictable and unguessable, so should not be relied upon for these purposes.\n\nA UUID is a 128-bit number represented by a utf8 string of five hexadecimal\nnumbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\n* The first three numbers are generated from a timestamp.\n* The fourth number preserves temporal uniqueness in case the timestamp value\n loses monotonicity (for example, due to daylight saving time).\n* The fifth number is an IEEE 802 node number that provides spatial uniqueness.\n A random number is substituted if the latter is not available (for example,\n because the host computer has no Ethernet card, or we do not know how to find\n the hardware address of an interface on your operating system). In this case,\n spatial uniqueness cannot be guaranteed. Nevertheless, a collision should\n have very low probability.\n\nCurrently, the MAC address of an interface is taken into account only on\nFreeBSD and Linux. On other operating systems, MariaDB uses a randomly\ngenerated 48-bit number.\n\nStatements using the UUID() function are not safe for replication.\n\nThe results are generated according to the \"DCE 1.1:Remote Procedure Call\"\n(Appendix A) CAE (Common Applications Environment) Specifications published by\nThe Open Group in October 1997 (Document Number C706).\n\nExamples\n--------\n\nSELECT UUID();\n+--------------------------------------+\n| UUID()                               |\n+--------------------------------------+\n| cd41294a-afb0-11df-bc9b-00241dd75637 |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/uuid/','','https://mariadb.com/kb/en/uuid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (166,14,'UUID_SHORT','Syntax\n------\n\nUUID_SHORT()\n\nDescription\n-----------\n\nReturns a \"short\" universally unique identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\n* The server_id of the current host is unique among your set of master and\n slave servers\n* server_id is between 0 and 255\n* You don\'t set back your system time for your server between mysqld restarts\n* You do not invoke UUID_SHORT() on average more than 16\n million times per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n(server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nStatements using the UUID_SHORT() function are not safe for statement-based\nreplication.\n\nExamples\n--------\n\nSELECT UUID_SHORT();\n+-------------------+\n| UUID_SHORT()      |\n+-------------------+\n| 21517162376069120 |\n+-------------------+\n\ncreate table t1 (a bigint unsigned default(uuid_short()) primary key);\ninsert into t1 values(),();\nselect * from t1;\n+-------------------+\n| a                 |\n+-------------------+\n| 98113699159474176 |\n| 98113699159474177 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/uuid_short/','','https://mariadb.com/kb/en/uuid_short/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (167,14,'VALUES / VALUE','Syntax\n------\n\nMariaDB starting with 10.3.3\n----------------------------\n\nVALUE(col_name)\n\nMariaDB until 10.3.2\n--------------------\n\nVALUES(col_name)\n\nDescription\n-----------\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column values from\nthe INSERT portion of the statement. In other words, VALUES(col_name) in the\nUPDATE clause refers to the value of col_name that would be inserted, had no\nduplicate-key conflict occurred. This function is especially useful in\nmultiple-row inserts.\n\nThe VALUES() function is meaningful only in INSERT ... ON DUPLICATE KEY UPDATE\nstatements and returns NULL otherwise.\n\nIn MariaDB 10.3.3 this function was renamed to VALUE(), because it\'s\nincompatible with the standard Table Value Constructors syntax, implemented in\nMariaDB 10.3.3.\n\nThe VALUES() function can still be used even from MariaDB 10.3.3, but only in\nINSERT ... ON DUPLICATE KEY UPDATE statements; it\'s a syntax error otherwise.\n\nExamples\n--------\n\nMariaDB starting with 10.3.3\n----------------------------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n  ON DUPLICATE KEY UPDATE c=VALUE(a)+VALUE(b);\n\nMariaDB until 10.3.2\n--------------------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n  ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n\nURL: https://mariadb.com/kb/en/values-value/','','https://mariadb.com/kb/en/values-value/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (168,15,'!','Syntax\n------\n\nNOT, !\n\nDescription\n-----------\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnon-zero, and NOT NULL returns NULL.\n\nBy default, the ! operator has a higher precedence. If the HIGH_NOT_PRECEDENCE\nSQL_MODE flag is set, NOT and ! have the same precedence.\n\nExamples\n--------\n\nSELECT NOT 10;\n+--------+\n| NOT 10 |\n+--------+\n|      0 |\n+--------+\n\nSELECT NOT 0;\n+-------+\n| NOT 0 |\n+-------+\n|     1 |\n+-------+\n\nSELECT NOT NULL;\n+----------+\n| NOT NULL |\n+----------+\n|     NULL |\n+----------+\n\nSELECT ! (1+1);\n+---------+\n| ! (1+1) |\n+---------+\n|       0 |\n+---------+\n\nSELECT ! 1+1;\n+-------+\n| ! 1+1 |\n+-------+\n|     1 |\n+-------+\n\nURL: https://mariadb.com/kb/en/not/','','https://mariadb.com/kb/en/not/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,15,'&&','Syntax\n------\n\nAND, &&\n\nDescription\n-----------\n\nLogical AND. Evaluates to 1 if all operands are non-zero and not NULL, to 0 if\none or more operands are 0, otherwise NULL is returned.\n\nFor this operator, short-circuit evaluation can be used.\n\nExamples\n--------\n\nSELECT 1 && 1;\n+--------+\n| 1 && 1 |\n+--------+\n|      1 |\n+--------+\n\nSELECT 1 && 0;\n+--------+\n| 1 && 0 |\n+--------+\n|      0 |\n+--------+\n\nSELECT 1 && NULL;\n+-----------+\n| 1 && NULL |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT 0 && NULL;\n+-----------+\n| 0 && NULL |\n+-----------+\n|         0 |\n+-----------+\n\nSELECT NULL && 0;\n+-----------+\n| NULL && 0 |\n+-----------+\n|         0 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/and/','','https://mariadb.com/kb/en/and/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (170,15,'XOR','Syntax\n------\n\nXOR\n\nDescription\n-----------\n\nXOR stands for eXclusive OR. Returns NULL if either operand is NULL. For\nnon-NULL operands, evaluates to 1 if an odd number of operands is non-zero,\notherwise 0 is returned.\n\nExamples\n--------\n\nSELECT 1 XOR 1;\n+---------+\n| 1 XOR 1 |\n+---------+\n|       0 |\n+---------+\n\nSELECT 1 XOR 0;\n+---------+\n| 1 XOR 0 |\n+---------+\n|       1 |\n+---------+\n\nSELECT 1 XOR NULL;\n+------------+\n| 1 XOR NULL |\n+------------+\n|       NULL |\n+------------+\n\nIn the following example, the right 1 XOR 1 is evaluated first, and returns 0.\nThen, 1 XOR 0 is evaluated, and 1 is returned.\n\nSELECT 1 XOR 1 XOR 1;\n+---------------+\n| 1 XOR 1 XOR 1 |\n+---------------+\n|             1 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/xor/','','https://mariadb.com/kb/en/xor/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (171,15,'||','Syntax\n------\n\nOR, ||\n\nDescription\n-----------\n\nLogical OR. When both operands are non-NULL, the result is 1 if any operand is\nnon-zero, and 0 otherwise. With a NULL operand, the result is 1 if the other\noperand is non-zero, and NULL otherwise. If both operands are NULL, the result\nis NULL.\n\nFor this operator, short-circuit evaluation can be used.\n\nNote that, if the PIPES_AS_CONCAT SQL_MODE is set, || is used as a string\nconcatenation operator. This means that a || b is the same as CONCAT(a,b). See\nCONCAT() for details.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, || ignores NULL.\n\nExamples\n--------\n\nSELECT 1 || 1;\n+--------+\n| 1 || 1 |\n+--------+\n|      1 |\n+--------+\n\nSELECT 1 || 0;\n+--------+\n| 1 || 0 |\n+--------+\n|      1 |\n+--------+\n\nSELECT 0 || 0;\n+--------+\n| 0 || 0 |\n+--------+\n|      0 |\n+--------+\n\nSELECT 0 || NULL;\n+-----------+\n| 0 || NULL |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT 1 || NULL;\n+-----------+\n| 1 || NULL |\n+-----------+\n|         1 |\n+-----------+\n\nIn Oracle mode, from MariaDB 10.3:\n\nSELECT 0 || NULL;\n+-----------+\n| 0 || NULL |\n+-----------+\n| 0         |\n+-----------+\n\nURL: https://mariadb.com/kb/en/or/','','https://mariadb.com/kb/en/or/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (172,16,'Stored Aggregate Functions','MariaDB starting with 10.3.3\n----------------------------\nThe ability to create stored aggregate functions was added in MariaDB 10.3.3.\n\nAggregate functions are functions that are computed over a sequence of rows\nand return one result for the sequence of rows.\n\nCreating a custom aggregate function is done using the CREATE FUNCTION\nstatement with two main differences:\n\n* The addition of the AGGREGATE keyword, so CREATE AGGREGATE FUNCTION\n* The FETCH GROUP NEXT ROW instruction inside the loop\n* Oracle PL/SQL compatibility using SQL/PL is provided\n\nStandard Syntax\n---------------\n\nCREATE AGGREGATE FUNCTION function_name (parameters) RETURNS return_type\nBEGIN\n   All types of declarations\n   DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN return_val;\n   LOOP\n     FETCH GROUP NEXT ROW; // fetches next row from table\n     other instructions\n   END LOOP;\nEND\n\nStored aggregate functions were a 2016 Google Summer of Code project by Varun\nGupta.\n\nUsing SQL/PL\n------------\n\nSET sql_mode=Oracle;\nDELIMITER //\n\nCREATE AGGREGATE FUNCTION function_name (parameters) RETURN return_type\n declarations\nBEGIN\n LOOP\n   FETCH GROUP NEXT ROW; -- fetches next row from table\n   -- other instructions\n\nEND LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n   RETURN return_val;\nEND //\n\nDELIMITER ;\n\nExamples\n--------\n\nFirst a simplified example:\n\nCREATE TABLE marks(stud_id INT, grade_count INT);\n\nINSERT INTO marks VALUES (1,6), (2,4), (3,7), (4,5), (5,8);\n\nSELECT * FROM marks;\n+---------+-------------+\n| stud_id | grade_count |\n+---------+-------------+\n|       1 |           6 |\n|       2 |           4 |\n|       3 |           7 |\n|       4 |           5 |\n|       5 |           8 |\n+---------+-------------+\n\nDELIMITER //\nCREATE AGGREGATE FUNCTION IF NOT EXISTS aggregate_count(x INT) RETURNS INT\nBEGIN\n DECLARE count_students INT DEFAULT 0;\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n RETURN count_students;\n   LOOP\n     FETCH GROUP NEXT ROW;\n     IF x  THEN\n      SET count_students = count_students+1;\n     END IF;\n   END LOOP;\nEND //\nDELIMITER ;\n\nA non-trivial example that cannot easily be rewritten using existing functions:\n\nDELIMITER //\nCREATE AGGREGATE FUNCTION medi_int(x INT) RETURNS DOUBLE\nBEGIN\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n  BEGIN\n   DECLARE res DOUBLE;\n   DECLARE cnt INT DEFAULT (SELECT COUNT(*) FROM tt);\n   DECLARE lim INT DEFAULT (cnt-1) DIV 2;\n   IF cnt % 2 = 0 THEN\n    SET res = (SELECT AVG(a) FROM (SELECT a FROM tt ORDER BY a LIMIT\nlim,2) ttt);\n   ELSE\n    SET res = (SELECT a FROM tt ORDER BY a LIMIT lim,1);\n   END IF;\n   DROP TEMPORARY TABLE tt;\n   RETURN res;\n  END;\n CREATE TEMPORARY TABLE tt (a INT);\n LOOP\n  FETCH GROUP NEXT ROW;\n  INSERT INTO tt VALUES (x);\n END LOOP;\nEND //\nDELIMITER ;\n\nSQL/PL Example\n--------------\n\nThis uses the same marks table as created above.\n\nSET sql_mode=Oracle;\nDELIMITER //\n\nCREATE AGGREGATE FUNCTION aggregate_count(x INT) RETURN INT AS count_students\nINT DEFAULT 0;\nBEGIN\n LOOP\n   FETCH GROUP NEXT ROW;\n   IF x  THEN\n    SET count_students := count_students+1;\n   END IF;\n END LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n   RETURN count_students;\nEND aggregate_count //\nDELIMITER ;\n\nSELECT aggregate_count(stud_id) FROM marks;\n\nURL: https://mariadb.com/kb/en/stored-aggregate-functions/','','https://mariadb.com/kb/en/stored-aggregate-functions/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (173,16,'AVG','Syntax\n------\n\nAVG([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the average value of expr. The DISTINCT option can be used to return\nthe average of the distinct values of expr. NULL values are ignored. It is an\naggregate function, and so can be used with the GROUP BY clause.\n\nAVG() returns NULL if there were no matching rows.\n\nAVG() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\n\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT AVG(sales_value) FROM sales;\n+------------------+\n| AVG(sales_value) |\n+------------------+\n|          22.5000 |\n+------------------+\n\nSELECT AVG(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| AVG(DISTINCT(sales_value)) |\n+----------------------------+\n|                    23.3333 |\n+----------------------------+\n\nCommonly, AVG() is used with a GROUP BY clause:\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, AVG(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | AVG(score) |\n+---------+------------+\n| Chun    |    74.0000 |\n| Esben   |    37.0000 |\n| Kaolin  |    72.0000 |\n| Tatiana |    85.0000 |\n+---------+------------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,AVG(score) FROM student;\n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL  |         31 |\n+------+------+------------+\n\nAs a window function:\n\nCREATE TABLE student_test (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY test) \n  AS average_by_test FROM student_test;\n+---------+--------+-------+-----------------+\n| name    | test   | score | average_by_test |\n+---------+--------+-------+-----------------+\n| Chun    | SQL    |    75 |         65.2500 |\n| Chun    | Tuning |    73 |         68.7500 |\n| Esben   | SQL    |    43 |         65.2500 |\n| Esben   | Tuning |    31 |         68.7500 |\n| Kaolin  | SQL    |    56 |         65.2500 |\n| Kaolin  | Tuning |    88 |         68.7500 |\n| Tatiana | SQL    |    87 |         65.2500 |\n| Tatiana | Tuning |    83 |         68.7500 |\n+---------+--------+-------+-----------------+\n\nURL: https://mariadb.com/kb/en/avg/','','https://mariadb.com/kb/en/avg/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (174,16,'BIT_AND','Syntax\n------\n\nBIT_AND(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise AND of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_AND will return a value with all bits set to 1. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nBIT_AND can be used as a window function with the addition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a        |        100 |       111 |        101 |\n| b        |          0 |        11 |         10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_AND(NULL);\n+----------------------+\n| BIT_AND(NULL)        |\n+----------------------+\n| 18446744073709551615 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/bit_and/','','https://mariadb.com/kb/en/bit_and/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (175,16,'BIT_OR','Syntax\n------\n\nBIT_OR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise OR of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_OR will return a value with all bits set to 0. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nBIT_OR can be used as a window function with the addition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a        |        100 |       111 |        101 |\n| b        |          0 |        11 |         10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_OR(NULL);\n+--------------+\n| BIT_OR(NULL) |\n+--------------+\n|            0 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/bit_or/','','https://mariadb.com/kb/en/bit_or/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (176,16,'BIT_XOR','Syntax\n------\n\nBIT_XOR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise XOR of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_XOR will return a value with all bits set to 0. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nBIT_XOR can be used as a window function with the addition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a        |        100 |       111 |        101 |\n| b        |          0 |        11 |         10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_XOR(NULL);\n+---------------+\n| BIT_XOR(NULL) |\n+---------------+\n|             0 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/bit_xor/','','https://mariadb.com/kb/en/bit_xor/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (177,16,'COUNT','Syntax\n------\n\nCOUNT(expr)\n\nDescription\n-----------\n\nReturns a count of the number of non-NULL values of expr in the rows retrieved\nby a SELECT statement. The result is a BIGINT value. It is an aggregate\nfunction, and so can be used with the GROUP BY clause.\n\nCOUNT(*) counts the total number of rows in a table.\n\nCOUNT() returns 0 if there were no matching rows.\n\nCOUNT() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT COUNT(*) FROM student;\n+----------+\n| COUNT(*) |\n+----------+\n|        8 |\n+----------+\n\nCOUNT(DISTINCT) example:\n\nSELECT COUNT(DISTINCT (name)) FROM student;\n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n|                      4 |\n+------------------------+\n\nAs a window function\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, COUNT(score) OVER (PARTITION BY name) \n  AS tests_written FROM student_test;\n+---------+--------+-------+---------------+\n| name    | test   | score | tests_written |\n+---------+--------+-------+---------------+\n| Chun    | SQL    |    75 |             2 |\n| Chun    | Tuning |    73 |             2 |\n| Esben   | SQL    |    43 |             2 |\n| Esben   | Tuning |    31 |             2 |\n| Kaolin  | SQL    |    56 |             2 |\n| Kaolin  | Tuning |    88 |             2 |\n| Tatiana | SQL    |    87 |             1 |\n+---------+--------+-------+---------------+\n\nURL: https://mariadb.com/kb/en/count/','','https://mariadb.com/kb/en/count/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,16,'COUNT DISTINCT','Syntax\n------\n\nCOUNT(DISTINCT expr,[expr...])\n\nDescription\n-----------\n\nReturns a count of the number of different non-NULL values.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nAlthough, from MariaDB 10.2.0, COUNT can be used as a window function, COUNT\nDISTINCT cannot be.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT COUNT(*) FROM student;\n+----------+\n| COUNT(*) |\n+----------+\n|        8 |\n+----------+\n\nSELECT COUNT(DISTINCT (name)) FROM student;\n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n|                      4 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/count-distinct/','','https://mariadb.com/kb/en/count-distinct/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (179,16,'GROUP_CONCAT','Syntax\n------\n\nGROUP_CONCAT(expr)\n\nDescription\n-----------\n\nThis function returns a string result with the concatenated non-NULL values\nfrom a group. It returns NULL if there are no non-NULL values.\n\nThe maximum returned length in bytes is determined by the group_concat_max_len\nserver system variable, which defaults to 1M (>= MariaDB 10.2.4) or 1K (<=\nMariaDB 10.2.3).\n\nIf group_concat_max_len <= 512, the return type is VARBINARY or VARCHAR;\notherwise, the return type is BLOB or TEXT. The choice between binary or\nnon-binary types depends from the input.\n\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n      [ORDER BY {unsigned_integer | col_name | expr}\n        [ASC | DESC] [,col_name ...]]\n      [SEPARATOR str_val]\n      [LIMIT {[offset,] row_count | row_count OFFSET offset}])\n\nDISTINCT eliminates duplicate values from the output string.\n\nORDER BY determines the order of returned values.\n\nSEPARATOR specifies a separator between the values. The default separator is a\ncomma (,). It is possible to avoid using a separator by specifying an empty\nstring.\n\nLIMIT\n-----\n\nMariaDB starting with 10.3.3\n----------------------------\nUntil MariaDB 10.3.2, it was not possible to use the LIMIT clause with\nGROUP_CONCAT. This restriction was lifted in MariaDB 10.3.3.\n\nExamples\n--------\n\nSELECT student_name,\n   GROUP_CONCAT(test_score)\n   FROM student\n   GROUP BY student_name;\n\nGet a readable list of MariaDB users from the mysql.user table:\n\nSELECT GROUP_CONCAT(DISTINCT User ORDER BY User SEPARATOR \'\\n\')\n FROM mysql.user;\n\nIn the former example, DISTINCT is used because the same user may occur more\nthan once. The new line (\\n) used as a SEPARATOR makes the results easier to\nread.\n\nGet a readable list of hosts from which each user can connect:\n\nSELECT User, GROUP_CONCAT(Host ORDER BY Host SEPARATOR \', \') \n FROM mysql.user GROUP BY User ORDER BY User;\n\nThe former example shows the difference between the GROUP_CONCAT\'s ORDER BY\n(which sorts the concatenated hosts), and the SELECT\'s ORDER BY (which sorts\nthe rows).\n\nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT, so, for example,\ngiven the following table:\n\nCREATE TABLE d (dd DATE, cc INT);\n\nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n\nthe following query:\n\nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc\nDESC),\",\",1) FROM d;\n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC),\",\",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3                                                               |\n+----------------------------------------------------------------------------+\n\ncan be more simply rewritten as:\n\nSELECT GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) FROM d;\n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3                                                |\n+-------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/group_concat/','','https://mariadb.com/kb/en/group_concat/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,16,'MAX','Syntax\n------\n\nMAX([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the largest, or maximum, value of expr. MAX() can also take a string\nargument in which case it returns the maximum string value. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value\nrather than their relative position in the set, so MAX() may produce a\ndifferent highest result than ORDER BY DESC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nMAX() can be used as a window function.\n\nMAX() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, MAX(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | MAX(score) |\n+---------+------------+\n| Chun    |         75 |\n| Esben   |         43 |\n| Kaolin  |         88 |\n| Tatiana |         87 |\n+---------+------------+\n\nMAX string:\n\nSELECT MAX(name) FROM student;\n+-----------+\n| MAX(name) |\n+-----------+\n| Tatiana   |\n+-----------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,MAX(SCORE) FROM student;\n+------+------+------------+\n| name | test | MAX(SCORE) |\n+------+------+------------+\n| Chun | SQL  |         88 |\n+------+------+------------+\n\nDifference between ORDER BY DESC and MAX():\n\nCREATE TABLE student2(name CHAR(10),grade ENUM(\'b\',\'c\',\'a\'));\n\nINSERT INTO student2 VALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n\nSELECT MAX(grade) FROM student2;\n+------------+\n| MAX(grade) |\n+------------+\n| c          |\n+------------+\n\nSELECT grade FROM student2 ORDER BY grade DESC LIMIT 1;\n+-------+\n| grade |\n+-------+\n| a     |\n+-------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, MAX(score) \n OVER (PARTITION BY name) AS highest_score FROM student_test;\n+---------+--------+-------+---------------+\n| name    | test   | score | highest_score |\n+---------+--------+-------+---------------+\n| Chun    | SQL    |    75 |            75 |\n| Chun    | Tuning |    73 |            75 |\n| Esben   | SQL    |    43 |            43 |\n| Esben   | Tuning |    31 |            43 |\n| Kaolin  | SQL    |    56 |            88 |\n| Kaolin  | Tuning |    88 |            88 |\n| Tatiana | SQL    |    87 |            87 |\n+---------+--------+-------+---------------+\n\nURL: https://mariadb.com/kb/en/max/','','https://mariadb.com/kb/en/max/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (181,16,'MIN','Syntax\n------\n\nMIN([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the minimum value of expr. MIN() may take a string argument, in which\ncase it returns the minimum string value. The DISTINCT keyword can be used to\nfind the minimum of the distinct values of expr, however, this produces the\nsame result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value\nrather than their relative position in the set, so MIN() may produce a\ndifferent lowest result than ORDER BY ASC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nMIN() can be used as a window function.\n\nMIN() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, MIN(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | MIN(score) |\n+---------+------------+\n| Chun    |         73 |\n| Esben   |         31 |\n| Kaolin  |         56 |\n| Tatiana |         83 |\n+---------+------------+\n\nMIN() with a string:\n\nSELECT MIN(name) FROM student;\n+-----------+\n| MIN(name) |\n+-----------+\n| Chun      |\n+-----------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,MIN(score) FROM student;\n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL  |         31 |\n+------+------+------------+\n\nDifference between ORDER BY ASC and MIN():\n\nCREATE TABLE student2(name CHAR(10),grade ENUM(\'b\',\'c\',\'a\'));\n\nINSERT INTO student2 VALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n\nSELECT MIN(grade) FROM student2;\n+------------+\n| MIN(grade) |\n+------------+\n| a          |\n+------------+\n\nSELECT grade FROM student2 ORDER BY grade ASC LIMIT 1;\n+-------+\n| grade |\n+-------+\n| b     |\n+-------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, MIN(score) \n OVER (PARTITION BY name) AS lowest_score FROM student_test;\n+---------+--------+-------+--------------+\n| name    | test   | score | lowest_score |\n+---------+--------+-------+--------------+\n| Chun    | SQL    |    75 |           73 |\n| Chun    | Tuning |    73 |           73 |\n| Esben   | SQL    |    43 |           31 |\n| Esben   | Tuning |    31 |           31 |\n| Kaolin  | SQL    |    56 |           56 |\n| Kaolin  | Tuning |    88 |           56 |\n| Tatiana | SQL    |    87 |           87 |\n+---------+--------+-------+--------------+\n\nURL: https://mariadb.com/kb/en/min/','','https://mariadb.com/kb/en/min/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (182,16,'STD','Syntax\n------\n\nSTD(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr. This is an extension to\nstandard SQL. The standard SQL function STDDEV_POP() can be used instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTD() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name    | test   | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun    | SQL    |    75 |        16.9466 |\n| Chun    | Tuning |    73 |        24.1247 |\n| Esben   | SQL    |    43 |        16.9466 |\n| Esben   | Tuning |    31 |        24.1247 |\n| Kaolin  | SQL    |    56 |        16.9466 |\n| Kaolin  | Tuning |    88 |        24.1247 |\n| Tatiana | SQL    |    87 |        16.9466 |\n+---------+--------+-------+----------------+\n\nURL: https://mariadb.com/kb/en/std/','','https://mariadb.com/kb/en/std/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (183,16,'STDDEV','Syntax\n------\n\nSTDDEV(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr. This function is provided\nfor compatibility with Oracle. The standard SQL function STDDEV_POP() can be\nused instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name    | test   | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun    | SQL    |    75 |        16.9466 |\n| Chun    | Tuning |    73 |        24.1247 |\n| Esben   | SQL    |    43 |        16.9466 |\n| Esben   | Tuning |    31 |        24.1247 |\n| Kaolin  | SQL    |    56 |        16.9466 |\n| Kaolin  | Tuning |    88 |        24.1247 |\n| Tatiana | SQL    |    87 |        16.9466 |\n+---------+--------+-------+----------------+\n\nURL: https://mariadb.com/kb/en/stddev/','','https://mariadb.com/kb/en/stddev/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (184,16,'STDDEV_POP','Syntax\n------\n\nSTDDEV_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent but not\nstandard SQL.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV_POP() can be used as a window function.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name    | test   | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun    | SQL    |    75 |        16.9466 |\n| Chun    | Tuning |    73 |        24.1247 |\n| Esben   | SQL    |    43 |        16.9466 |\n| Esben   | Tuning |    31 |        24.1247 |\n| Kaolin  | SQL    |    56 |        16.9466 |\n| Kaolin  | Tuning |    88 |        24.1247 |\n| Tatiana | SQL    |    87 |        16.9466 |\n+---------+--------+-------+----------------+\n\nURL: https://mariadb.com/kb/en/stddev_pop/','','https://mariadb.com/kb/en/stddev_pop/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (185,16,'STDDEV_SAMP','Syntax\n------\n\nSTDDEV_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample standard deviation of expr (the square root of VAR_SAMP()).\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV_SAMP() can be used as a window function.\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: https://mariadb.com/kb/en/stddev_samp/','','https://mariadb.com/kb/en/stddev_samp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (186,16,'SUM','Syntax\n------\n\nSUM([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the sum of expr. If the return set has no rows, SUM() returns NULL.\nThe DISTINCT keyword can be used to sum only the distinct values of expr.\n\nSUM() can be used as a window function, although not with the DISTINCT\nspecifier.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT SUM(sales_value) FROM sales;\n+------------------+\n| SUM(sales_value) |\n+------------------+\n|               90 |\n+------------------+\n\nSELECT SUM(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| SUM(DISTINCT(sales_value)) |\n+----------------------------+\n|                         70 |\n+----------------------------+\n\nCommonly, SUM is used with a GROUP BY clause:\n\nCREATE TABLE sales (name CHAR(10), month CHAR(10), units INT);\n\nINSERT INTO sales VALUES \n (\'Chun\', \'Jan\', 75), (\'Chun\', \'Feb\', 73),\n (\'Esben\', \'Jan\', 43), (\'Esben\', \'Feb\', 31),\n (\'Kaolin\', \'Jan\', 56), (\'Kaolin\', \'Feb\', 88),\n (\'Tatiana\', \'Jan\', 87), (\'Tatiana\', \'Feb\', 83);\n\nSELECT name, SUM(units) FROM sales GROUP BY name;\n+---------+------------+\n| name    | SUM(units) |\n+---------+------------+\n| Chun    |        148 |\n| Esben   |         74 |\n| Kaolin  |        144 |\n| Tatiana |        170 |\n+---------+------------+\n\nThe GROUP BY clause is required when using an aggregate function along with\nregular column data, otherwise the result will be a mismatch, as in the\nfollowing common type of mistake:\n\nSELECT name,SUM(units) FROM sales\n;+------+------------+\n| name | SUM(units) |\n+------+------------+\n| Chun |        536 |\n+------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, SUM(score) OVER (PARTITION BY name) AS total_score\nFROM student_test;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Chun    | SQL    |    75 |         148 |\n| Chun    | Tuning |    73 |         148 |\n| Esben   | SQL    |    43 |          74 |\n| Esben   | Tuning |    31 |          74 |\n| Kaolin  | SQL    |    56 |         144 |\n| Kaolin  | Tuning |    88 |         144 |\n| Tatiana | SQL    |    87 |          87 |\n+---------+--------+-------+-------------+\n\nURL: https://mariadb.com/kb/en/sum/','','https://mariadb.com/kb/en/sum/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,16,'VARIANCE','Syntax\n------\n\nVARIANCE(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. This is an extension to\nstandard SQL. The standard SQL function VAR_POP() can be used instead.\n\nVariance is calculated by\n\n* working out the mean for the set\n* for each number, subtracting the mean and squaring the result\n* calculate the average of the resulting differences\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVARIANCE() can be used as a window function.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n|      1.0000 |\n+-------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n|    200.5000 |\n+-------------+\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name    | test   | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun    | SQL    |    75 |         287.1875 |\n| Chun    | Tuning |    73 |         582.0000 |\n| Esben   | SQL    |    43 |         287.1875 |\n| Esben   | Tuning |    31 |         582.0000 |\n| Kaolin  | SQL    |    56 |         287.1875 |\n| Kaolin  | Tuning |    88 |         582.0000 |\n| Tatiana | SQL    |    87 |         287.1875 |\n+---------+--------+-------+------------------+\n\nURL: https://mariadb.com/kb/en/variance/','','https://mariadb.com/kb/en/variance/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (188,16,'VAR_POP','Syntax\n------\n\nVAR_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. It considers rows as the\nwhole population, not as a sample, so it has the number of rows as the\ndenominator. You can also use VARIANCE(), which is equivalent but is not\nstandard SQL.\n\nVariance is calculated by\n\n* working out the mean for the set\n* for each number, subtracting the mean and squaring the result\n* calculate the average of the resulting differences\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVAR_POP() can be used as a window function.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n|     1.0000 |\n+------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n|   200.5000 |\n+------------+\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name    | test   | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun    | SQL    |    75 |         287.1875 |\n| Esben   | SQL    |    43 |         287.1875 |\n| Kaolin  | SQL    |    56 |         287.1875 |\n| Tatiana | SQL    |    87 |         287.1875 |\n| Chun    | Tuning |    73 |         582.0000 |\n| Esben   | Tuning |    31 |         582.0000 |\n| Kaolin  | Tuning |    88 |         582.0000 |\n+---------+--------+-------+------------------+\n\nURL: https://mariadb.com/kb/en/var_pop/','','https://mariadb.com/kb/en/var_pop/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (189,16,'VAR_SAMP','Syntax\n------\n\nVAR_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample variance of expr. That is, the denominator is the number of\nrows minus one.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVAR_SAMP() can be used as a window function.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_SAMP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name    | test   | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun    | SQL    |    75 |         382.9167 |\n| Chun    | Tuning |    73 |         873.0000 |\n| Esben   | SQL    |    43 |         382.9167 |\n| Esben   | Tuning |    31 |         873.0000 |\n| Kaolin  | SQL    |    56 |         382.9167 |\n| Kaolin  | Tuning |    88 |         873.0000 |\n| Tatiana | SQL    |    87 |         382.9167 |\n+---------+--------+-------+------------------+\n\nURL: https://mariadb.com/kb/en/var_samp/','','https://mariadb.com/kb/en/var_samp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,17,'BENCHMARK','Syntax\n------\n\nBENCHMARK(count,expr)\n\nDescription\n-----------\n\nThe BENCHMARK() function executes the expression expr repeatedly count times.\nIt may be used to time how quickly MariaDB processes the expression. The\nresult value is always 0. The intended use is from within the mysql client,\nwhich reports query execution times.\n\nExamples\n--------\n\nSELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n|                                            0 |\n+----------------------------------------------+\n1 row in set (0.21 sec)\n\nURL: https://mariadb.com/kb/en/benchmark/','','https://mariadb.com/kb/en/benchmark/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (191,17,'BINLOG_GTID_POS','Syntax\n------\n\nBINLOG_GTID_POS(binlog_filename,binlog_offset)\n\nDescription\n-----------\n\nThe BINLOG_GTID_POS() function takes as input an old-style binary log position\nin the form of a file name and a file offset. It looks up the position in the\ncurrent binlog, and returns a string representation of the corresponding GTID\nposition. If the position is not found in the current binlog, NULL is returned.\n\nExamples\n--------\n\nSELECT BINLOG_GTID_POS(\"master-bin.000001\", 600);\n\nURL: https://mariadb.com/kb/en/binlog_gtid_pos/','','https://mariadb.com/kb/en/binlog_gtid_pos/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (192,17,'CHARSET','Syntax\n------\n\nCHARSET(str)\n\nDescription\n-----------\n\nReturns the character set of the string argument. If str is not a string, it\nis considered as a binary string (so the function returns \'binary\'). This\napplies to NULL, too. The return value is a string in the utf8 character set.\n\nExamples\n--------\n\nSELECT CHARSET(\'abc\');\n+----------------+\n| CHARSET(\'abc\') |\n+----------------+\n| latin1         |\n+----------------+\n\nSELECT CHARSET(CONVERT(\'abc\' USING utf8));\n+------------------------------------+\n| CHARSET(CONVERT(\'abc\' USING utf8)) |\n+------------------------------------+\n| utf8                               |\n+------------------------------------+\n\nSELECT CHARSET(USER());\n+-----------------+\n| CHARSET(USER()) |\n+-----------------+\n| utf8            |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/charset/','','https://mariadb.com/kb/en/charset/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,17,'COERCIBILITY','Syntax\n------\n\nCOERCIBILITY(str)\n\nDescription\n-----------\n\nReturns the collation coercibility value of the string argument. Coercibility\ndefines what will be converted to what in case of collation conflict, with an\nexpression with higher coercibility being converted to the collation of an\nexpression with lower coercibility.\n\n+-----------------------------+---------------------------+------------------+\n| Coercibility                | Description               | Example          |\n+-----------------------------+---------------------------+------------------+\n| 0                           | Explicit                  | Value using a    |\n|                             |                           | COLLATE clause   |\n+-----------------------------+---------------------------+------------------+\n| 1                           | No collation              | Concatenated     |\n|                             |                           | strings using    |\n|                             |                           | different        |\n|                             |                           | collations       |\n+-----------------------------+---------------------------+------------------+\n| 2                           | Implicit                  | Column value     |\n+-----------------------------+---------------------------+------------------+\n| 3                           | Constant                  | USER() return    |\n|                             |                           | value            |\n+-----------------------------+---------------------------+------------------+\n| 4                           | Coercible                 | Literal string   |\n+-----------------------------+---------------------------+------------------+\n| 5                           | Ignorable                 | NULL or derived  |\n|                             |                           | from NULL        |\n+-----------------------------+---------------------------+------------------+\n\nExamples\n--------\n\nSELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n+-----------------------------------------------+\n| COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci) |\n+-----------------------------------------------+\n|                                             0 |\n+-----------------------------------------------+\n\nSELECT COERCIBILITY(USER());\n+----------------------+\n| COERCIBILITY(USER()) |\n+----------------------+\n|                    3 |\n+----------------------+\n\nSELECT COERCIBILITY(\'abc\');\n+---------------------+\n| COERCIBILITY(\'abc\') |\n+---------------------+\n|                   4 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/coercibility/','','https://mariadb.com/kb/en/coercibility/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (194,17,'COLLATION','Syntax\n------\n\nCOLLATION(str)\n\nDescription\n-----------\n\nReturns the collation of the string argument. If str is not a string, it is\nconsidered as a binary string (so the function returns \'binary\'). This applies\nto NULL, too. The return value is a string in the utf8 character set.\n\nSee Character Sets and Collations.\n\nExamples\n--------\n\nSELECT COLLATION(\'abc\');\n+-------------------+\n| COLLATION(\'abc\')  |\n+-------------------+\n| latin1_swedish_ci |\n+-------------------+\n\nSELECT COLLATION(_utf8\'abc\');\n+-----------------------+\n| COLLATION(_utf8\'abc\') |\n+-----------------------+\n| utf8_general_ci       |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/collation/','','https://mariadb.com/kb/en/collation/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,17,'CONNECTION_ID','Syntax\n------\n\nCONNECTION_ID()\n\nDescription\n-----------\n\nReturns the connection ID for the connection. Every connection (including\nevents) has an ID that is unique among the set of currently connected clients.\n\nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or bigint(10), in all\ncases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG, or int(10), when the\nresult would fit within 32-bits.\n\nExamples\n--------\n\nSELECT CONNECTION_ID();\n+-----------------+\n| CONNECTION_ID() |\n+-----------------+\n|               3 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/connection_id/','','https://mariadb.com/kb/en/connection_id/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (196,17,'CURRENT_ROLE','Syntax\n------\n\nCURRENT_ROLE, CURRENT_ROLE()\n\nDescription\n-----------\n\nReturns the current role name. This determines your access privileges. The\nreturn value is a string in the utf8 character set.\n\nIf there is no current role, NULL is returned.\n\nThe output of SELECT CURRENT_ROLE is equivalent to the contents of the\nENABLED_ROLES Information Schema table.\n\nUSER() returns the combination of user and host used to login. CURRENT_USER()\nreturns the account used to determine current connection\'s privileges.\n\nExamples\n--------\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSET ROLE staff;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff        |\n+--------------+\n\nURL: https://mariadb.com/kb/en/current_role/','','https://mariadb.com/kb/en/current_role/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,17,'CURRENT_USER','Syntax\n------\n\nCURRENT_USER, CURRENT_USER()\n\nDescription\n-----------\n\nReturns the user name and host name combination for the MariaDB account that\nthe server used to authenticate the current client. This account determines\nyour access privileges. The return value is a string in the utf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\nCURRENT_ROLE() returns the current active role.\n\nExamples\n--------\n\nshell> mysql --user=\"anonymous\"\n\nselect user(),current_user();\n+---------------------+----------------+\n| user()              | current_user() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost     |\n+---------------------+----------------+\n\nWhen calling CURRENT_USER() in a stored procedure, it returns the owner of the\nstored procedure, as defined with DEFINER.\n\nURL: https://mariadb.com/kb/en/current_user/','','https://mariadb.com/kb/en/current_user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (198,17,'DATABASE','Syntax\n------\n\nDATABASE()\n\nDescription\n-----------\n\nReturns the default (current) database name as a string in the utf8 character\nset. If there is no default database, DATABASE() returns NULL. Within a stored\nroutine, the default database is the database that the routine is associated\nwith, which is not necessarily the same as the database that is the default in\nthe calling context.\n\nSCHEMA() is a synonym for DATABASE().\n\nTo select a default database, the USE statement can be run. Another way to set\nthe default database is specifying its name at mysql command line client\nstartup.\n\nExamples\n--------\n\nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| NULL       |\n+------------+\n\nUSE test;\nDatabase changed\n\nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| test       |\n+------------+\n\nURL: https://mariadb.com/kb/en/database/','','https://mariadb.com/kb/en/database/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (199,17,'DECODE_HISTOGRAM','Syntax\n------\n\nDECODE_HISTOGRAM(hist_type,histogram)\n\nDescription\n-----------\n\nReturns a string of comma separated numeric values corresponding to a\nprobability distribution represented by the histogram of type hist_type\n(SINGLE_PREC_HB or DOUBLE_PREC_HB). The hist_type and histogram would be\ncommonly used from the mysql.column_stats table.\n\nSee Histogram Based Statistics for details.\n\nExamples\n--------\n\nCREATE TABLE origin (\n i INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n v INT UNSIGNED NOT NULL\n);\n\nINSERT INTO origin(v) VALUES \n (1),(2),(3),(4),(5),(10),(20),\n (30),(40),(50),(60),(70),(80),\n (90),(100),(200),(400),(800);\n\nSET histogram_size=10,histogram_type=SINGLE_PREC_HB;\n\nANALYZE TABLE origin PERSISTENT FOR ALL;\n+-------------+---------+----------+-----------------------------------------+\n| Table       | Op      | Msg_type | Msg_text                                |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status   | Engine-independent statistics collected |\n| test.origin | analyze | status   | OK                                      |\n+-------------+---------+----------+-----------------------------------------+\n\nSELECT db_name,table_name,column_name,hist_type,\n hex(histogram),decode_histogram(hist_type,histogram)\n FROM mysql.column_stats WHERE db_name=\'test\' and table_name=\'origin\';\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n| db_name | table_name | column_name | hist_type      | hex(histogram)       |\ndecode_histogram(hist_type,histogram)                             |\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n| test    | origin     | i           | SINGLE_PREC_HB | 0F2D3C5A7887A5C3D2F0 |\n0.059,0.118,0.059,0.118,0.118,0.059,0.118,0.118,0.059,0.118,0.059 |\n| test    | origin     | v           | SINGLE_PREC_HB | 000001060C0F161C1F7F |\n0.000,0.000,0.004,0.020,0.024,0.012,0.027,0.024,0.012,0.376,0.502 |\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n\nSET histogram_size=20,histogram_type=DOUBLE_PREC_HB;\n\nANALYZE TABLE origin PERSISTENT FOR ALL;\n+-------------+---------+----------+-----------------------------------------+\n| Table       | Op      | Msg_type | Msg_text                                |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status   | Engine-independent statistics collected |\n| test.origin | analyze | status   | OK                                      |\n+-------------+---------+----------+-----------------------------------------+\n\nSELECT db_name,table_name,column_name,\n hist_type,hex(histogram),decode_histogram(hist_type,histogram)\n FROM mysql.column_stats WHERE db_name=\'test\' and table_name=\'origin\';\n+---------+------------+-------------+----------------+------------------------\n-----------------+-------------------------------------------------------------\n---------------------------+\n| db_name | table_name | column_name | hist_type      | hex(histogram)        \n         | decode_histogram(hist_type,histogram)\n              |\n+---------+------------+-------------+----------------+------------------------\n-----------------+-------------------------------------------------------------\n---------------------------+\n| test    | origin     | i           | DOUBLE_PREC_HB |\n0F0F2D2D3C3C5A5A78788787A5A5C3C3D2D2F0F0 |\n0.05882,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765\n0.05882 |\n| test    | origin     | v           | DOUBLE_PREC_HB |\n5200F600480116067E0CB30F1B16831CB81FD67F |\n0.00125,0.00250,0.00125,0.01877,0.02502,0.01253,0.02502,0.02502,0.01253,0.37546\n0.50063 |\n\nURL: https://mariadb.com/kb/en/decode_histogram/','','https://mariadb.com/kb/en/decode_histogram/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (200,17,'DEFAULT','Syntax\n------\n\nDEFAULT(col_name)\n\nDescription\n-----------\n\nReturns the default value for a table column. If the column has no default\nvalue (and is not NULLABLE - NULLABLE fields have a NULL default), an error is\nreturned.\n\nFor integer columns using AUTO_INCREMENT, 0 is returned.\n\nWhen using DEFAULT as a value to set in an INSERT or UPDATE statement, you can\nuse the bare keyword DEFAULT without the parentheses and argument to refer to\nthe column in context. You can only use DEFAULT as a bare keyword if you are\nusing it alone without a surrounding expression or function.\n\nExamples\n--------\n\nSelect only non-default values for a column:\n\nSELECT i FROM t WHERE i != DEFAULT(i);\n\nUpdate values to be one greater than the default value:\n\nUPDATE t SET i = DEFAULT(i)+1 WHERE i < 100;\n\nWhen referring to the default value exactly in UPDATE or INSERT, you can omit\nthe argument:\n\nINSERT INTO t (i) VALUES (DEFAULT);\nUPDATE t SET i = DEFAULT WHERE i < 100;\n\nCREATE OR REPLACE TABLE t (\n i INT NOT NULL AUTO_INCREMENT,\n j INT NOT NULL,\n k INT DEFAULT 3,\n l INT NOT NULL DEFAULT 4,\n m INT,\n PRIMARY KEY (i)\n);\n\nDESC t;\n+-------+---------+------+-----+---------+----------------+\n| Field | Type    | Null | Key | Default | Extra          |\n+-------+---------+------+-----+---------+----------------+\n| i     | int(11) | NO   | PRI | NULL    | auto_increment |\n| j     | int(11) | NO   |     | NULL    |                |\n| k     | int(11) | YES  |     | 3       |                |\n| l     | int(11) | NO   |     | 4       |                |\n| m     | int(11) | YES  |     | NULL    |                |\n+-------+---------+------+-----+---------+----------------+\n\nINSERT INTO t (j) VALUES (1);\nINSERT INTO t (j,m) VALUES (2,2);\nINSERT INTO t (j,l,m) VALUES (3,3,3);\n\nSELECT * FROM t;\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n| 2 | 2 |    3 | 4 |    2 |\n| 3 | 3 |    3 | 3 |    3 |\n+---+---+------+---+------+\n\nSELECT DEFAULT(i), DEFAULT(k), DEFAULT (l), DEFAULT(m) FROM t;\n+------------+------------+-------------+------------+\n| DEFAULT(i) | DEFAULT(k) | DEFAULT (l) | DEFAULT(m) |\n+------------+------------+-------------+------------+\n|          0 |          3 |           4 |       NULL |\n|          0 |          3 |           4 |       NULL |\n|          0 |          3 |           4 |       NULL |\n+------------+------------+-------------+------------+\n\nSELECT DEFAULT(i), DEFAULT(k), DEFAULT (l), DEFAULT(m), DEFAULT(j)  FROM t;\nERROR 1364 (HY000): Field \'j\' doesn\'t have a default value\n\nSELECT * FROM t WHERE i = DEFAULT(i);\nEmpty set (0.001 sec)\n\nSELECT * FROM t WHERE j = DEFAULT(j);\nERROR 1364 (HY000): Field \'j\' doesn\'t have a default value\n\nSELECT * FROM t WHERE k = DEFAULT(k);\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n| 2 | 2 |    3 | 4 |    2 |\n| 3 | 3 |    3 | 3 |    3 |\n+---+---+------+---+------+\n\nSELECT * FROM t WHERE l = DEFAULT(l);\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n| 2 | 2 |    3 | 4 |    2 |\n+---+---+------+---+------+\n\nSELECT * FROM t WHERE m = DEFAULT(m);\nEmpty set (0.001 sec)\n\nSELECT * FROM t WHERE m <=> DEFAULT(m);\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n+---+---+------+---+------+\n\nURL: https://mariadb.com/kb/en/default/','','https://mariadb.com/kb/en/default/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (201,17,'FOUND_ROWS','Syntax\n------\n\nFOUND_ROWS()\n\nDescription\n-----------\n\nA SELECT statement may include a LIMIT clause to restrict the number of rows\nthe server returns to the client. In some cases, it is desirable to know how\nmany rows the statement would have returned without the LIMIT, but without\nrunning the statement again. To obtain this row count, include a\nSQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke\nFOUND_ROWS() afterwards.\n\nYou can also use FOUND_ROWS() to obtain the number of rows returned by a\nSELECT which does not contain a LIMIT clause. In this case you don\'t need to\nuse the SQL_CALC_FOUND_ROWS option. This can be useful for example in a stored\nprocedure.\n\nAlso, this function works with some other statements which return a resultset,\nincluding SHOW, DESC and HELP. For DELETE ... RETURNING you should use\nROW_COUNT(). It also works as a prepared statement, or after executing a\nprepared statement.\n\nStatements which don\'t return any results don\'t affect FOUND_ROWS() - the\nprevious value will still be returned.\n\nWarning: When used after a CALL statement, this function returns the number of\nrows selected by the last query in the procedure, not by the whole procedure.\n\nStatements using the FOUND_ROWS() function are not safe for replication.\n\nExamples\n--------\n\nSHOW ENGINES\\G\n*************************** 1. row ***************************\n   Engine: CSV\n  Support: YES\n  Comment: Stores tables as CSV files\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 2. row ***************************\n   Engine: MRG_MyISAM\n  Support: YES\n  Comment: Collection of identical MyISAM tables\nTransactions: NO\n     XA: NO\n Savepoints: NO\n\n...\n\n*************************** 8. row ***************************\n   Engine: PERFORMANCE_SCHEMA\n  Support: YES\n  Comment: Performance Schema\nTransactions: NO\n     XA: NO\n Savepoints: NO\n8 rows in set (0.000 sec)\n\nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n|           8 |\n+--------------+\n\nSELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100 LIMIT 10;\n\nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n|           23 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/found_rows/','','https://mariadb.com/kb/en/found_rows/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (202,17,'LAST_INSERT_ID','Syntax\n------\n\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nDescription\n-----------\n\nLAST_INSERT_ID() (no arguments) returns the first automatically generated\nvalue successfully inserted for an AUTO_INCREMENT column as a result of the\nmost recently executed INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nIf one gives an argument to LAST_INSERT_ID(), then it will return the value of\nthe expression and the next call to LAST_INSERT_ID() will return the same\nvalue. The value will also be sent to the client and can be accessed by the\nmysql_insert_id function.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT value, you\ncan get the value like this:\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                9 |\n+------------------+\n\nYou can also use LAST_INSERT_ID() to delete the last inserted row:\n\nDELETE FROM product WHERE id = LAST_INSERT_ID();\n\nIf no rows were successfully inserted, LAST_INSERT_ID() returns 0.\n\nThe value of LAST_INSERT_ID() will be consistent across all versions if all\nrows in the INSERT or UPDATE statement were successful.\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value with one\nstatement, and then refer to LAST_INSERT_ID() in a multiple-row INSERT\nstatement that inserts rows into a table with its own AUTO_INCREMENT column.\nThe value of LAST_INSERT_ID() will remain stable in the second statement; its\nvalue for the second and later rows is not affected by the earlier row\ninsertions. (However, if you mix references to LAST_INSERT_ID() and\nLAST_INSERT_ID(expr), the effect is undefined.)\n\nIf the previous statement returned an error, the value of LAST_INSERT_ID() is\nundefined. For transactional tables, if the statement is rolled back due to an\nerror, the value of LAST_INSERT_ID() is left undefined. For manual ROLLBACK,\nthe value of LAST_INSERT_ID() is not restored to that before the transaction;\nit remains as it was at the point of the ROLLBACK.\n\nWithin the body of a stored routine (procedure or function) or a trigger, the\nvalue of LAST_INSERT_ID() changes the same way as for statements executed\noutside the body of these kinds of objects. The effect of a stored routine or\ntrigger upon the value of LAST_INSERT_ID() that is seen by following\nstatements depends on the kind of routine:\n\n* If a stored procedure executes statements that change the value of\nLAST_INSERT_ID(), the new value will be seen by statements that follow the\nprocedure call.\n\n* For stored functions and triggers that change the value, the value is\nrestored when the function or trigger ends, so following statements will not\nsee a changed value.\n\nExamples\n--------\n\nCREATE TABLE t (\n id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n f VARCHAR(1))\nENGINE = InnoDB;\n\nINSERT INTO t(f) VALUES(\'a\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                1 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'b\');\n\nINSERT INTO t(f) VALUES(\'c\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                3 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'d\'),(\'e\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                4 |\n+------------------+\n\nSELECT * FROM t;\n+----+------+\n| id | f    |\n+----+------+\n|  1 | a    |\n|  2 | b    |\n|  3 | c    |\n|  4 | d    |\n|  5 | e    |\n+----+------+\n\nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n|                 12 |\n+--------------------+\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|               12 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'f\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                6 |\n+------------------+\n\nSELECT * FROM t;\n+----+------+\n| id | f    |\n+----+------+\n|  1 | a    |\n|  2 | b    |\n|  3 | c    |\n|  4 | d    |\n|  5 | e    |\n|  6 | f    |\n+----+------+\n\nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n|                 12 |\n+--------------------+\n\nINSERT INTO t(f) VALUES(\'g\');\n\nSELECT * FROM t;\n+----+------+\n| id | f    |\n+----+------+\n|  1 | a    |\n|  2 | b    |\n|  3 | c    |\n|  4 | d    |\n|  5 | e    |\n|  6 | f    |\n|  7 | g    |\n+----+------+\n\nURL: https://mariadb.com/kb/en/last_insert_id/','','https://mariadb.com/kb/en/last_insert_id/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (203,17,'LAST_VALUE','Syntax\n------\n\nLAST_VALUE(expr,[expr,...])\n\nLAST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nLAST_VALUE() evaluates all expressions and returns the last.\n\nThis is useful together with setting user variables to a value with\n@var:=expr, for example when you want to get data of rows updated/deleted\nwithout having to do two queries against the table.\n\nLAST_VALUE can be used as a window function.\n\nReturns NULL if no last value exists.\n\nExamples\n--------\n\nCREATE TABLE t1 (a int, b int);\nINSERT INTO t1 VALUES(1,10),(2,20);\nDELETE FROM t1 WHERE a=1 AND last_value(@a:=a,@b:=b,1);\nSELECT @a,@b;\n+------+------+\n| @a   | @b   |\n+------+------+\n|    1 |   10 |\n+------+------+\n\nAs a window function:\n\nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n\nINSERT INTO t1 VALUES\n( 1, 0, 1,    \'one\',    0.1,  0.001),\n( 2, 0, 2,    \'two\',    0.2,  0.002),\n( 3, 0, 3,    \'three\',  0.3,  0.003),\n( 4, 1, 2,    \'three\',  0.4,  0.004),\n( 5, 1, 1,    \'two\',    0.5,  0.005),\n( 6, 1, 1,    \'one\',    0.6,  0.006),\n( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n( 9, 2, 2,    NULL,     0.7,  0.009),\n(10, 2, 0,    \'n_four\', 0.8,  0.010),\n(11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n     LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n     FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n     LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n\n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 |         1 |       11 |         11 |        11 |\n| 10 |         1 |       10 |         11 |        10 |\n|  9 |         1 |        9 |         11 |         9 |\n|  8 |         1 |        8 |         11 |         8 |\n|  7 |         1 |        7 |         11 |         7 |\n|  6 |         1 |        6 |         11 |         6 |\n|  5 |         1 |        5 |         11 |         5 |\n|  4 |         1 |        4 |         11 |         4 |\n|  3 |         1 |        3 |         11 |         3 |\n|  2 |         1 |        2 |         11 |         2 |\n|  1 |         1 |        1 |         11 |         1 |\n+----+-----------+----------+------------+-----------+\n\nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n\nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nf_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nl_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f\nFROM t1;\n\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i    | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p | f_1f2f | f_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n|    1 |    1 |    2 |      1 |      2 |   NULL |   NULL |      2 |      3 |\n|    2 |    2 |    3 |      1 |      3 |      1 |      1 |      3 |      4 |\n|    3 |    3 |    4 |      2 |      4 |      1 |      2 |      4 |      5 |\n|    4 |    4 |    5 |      3 |      5 |      2 |      3 |      5 |      6 |\n|    5 |    5 |    6 |      4 |      6 |      3 |      4 |      6 |      7 |\n|    6 |    6 |    7 |      5 |      7 |      4 |      5 |      7 |      8 |\n|    7 |    7 |    8 |      6 |      8 |      5 |      6 |      8 |      9 |\n|    8 |    8 |    9 |      7 |      9 |      6 |      7 |      9 |     10 |\n|    9 |    9 |   10 |      8 |     10 |      7 |      8 |     10 |     10 |\n|   10 |   10 |   10 |      9 |     10 |      8 |      9 |   NULL |   NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n\nURL: https://mariadb.com/kb/en/last_value/','','https://mariadb.com/kb/en/last_value/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (204,17,'PROCEDURE ANALYSE','Syntax\n------\n\nanalyse([max_elements[,max_memory]])\n\nDescription\n-----------\n\nThis procedure is defined in the sql/sql_analyse.cc file. It examines the\nresult from a query and returns an analysis of the results that suggests\noptimal data types for each column. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query, and\npropose an optimal data type for the columns. This can be helpful for checking\nyour existing tables, or after importing new data. You may need to try\ndifferent settings for the arguments so that PROCEDURE ANALYSE() does not\nsuggest the ENUM data type when it is not appropriate.\n\nThe arguments are optional and are used as follows:\n\n* max_elements (default 256) is the maximum number of distinct values that\nanalyse notices per column. This is used by analyse to check whether the\noptimal data type should be of type ENUM; if there are more than max_elements\ndistinct values, then ENUM is not a suggested type.\n* max_memory (default 8192) is the maximum amount of memory that analyse\nshould allocate per column while trying to find all distinct values.\n\nURL: https://mariadb.com/kb/en/procedure-analyse/','','https://mariadb.com/kb/en/procedure-analyse/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (205,17,'ROWNUM','MariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6.1, the ROWNUM() function is supported.\n\nSyntax\n------\n\nROWNUM()\n\nIn Oracle mode one can just use ROWNUM, without the parentheses.\n\nDescription\n-----------\n\nROWNUM() returns the current number of accepted rows in the current context.\nIt main purpose is to emulate the ROWNUM pseudo column in Oracle. For MariaDB\nnative applications, we recommend the usage of LIMIT, as it is easier to use\nand gives more predictable results than the usage of ROWNUM().\n\nThe main difference between using LIMIT and ROWNUM() to limit the rows in the\nresult is that LIMIT works on the result set while ROWNUM works on the number\nof accepted rows (before any ORDER or GROUP BY clauses).\n\nThe following queries will return the same results:\n\nSELECT * from t1 LIMIT 10;\nSELECT * from t1 WHERE ROWNUM() <= 10;\n\nWhile the following may return different results based on in which orders the\nrows are found:\n\nSELECT * from t1 ORDER BY a LIMIT 10;\nSELECT * from t1 ORDER BY a WHERE ROWNUM() <= 10;\n\nThe recommended way to use ROWNUM to limit the number of returned rows and get\npredictable results is to have the query in a subquery and test for ROWNUM()\nin the outer query:\n\nSELECT * FROM (select * from t1 ORDER BY a) WHERE ROWNUM() <= 10;\n\nROWNUM() can be used in the following contexts:\n\n* SELECT\n* INSERT\n* UPDATE\n* DELETE\n* LOAD DATA INFILE\n\nUsed in other contexts, ROWNUM() will return 0.\n\nExamples\n--------\n\nINSERT INTO t1 VALUES (1,ROWNUM()),(2,ROWNUM()),(3,ROWNUM());\n\nINSERT INTO t1 VALUES (1),(2) returning a, ROWNUM();\n\nUPDATE t1 SET row_num_column=ROWNUM();\n\nDELETE FROM t1 WHERE a < 10 AND ROWNUM() < 2;\n\nLOAD DATA INFILE \'filename\' into table t1 fields terminated by \',\' \n lines terminated by \"\\r\\n\" (a,b) set c=ROWNUM();\n\nOptimizations\n-------------\n\nIn many cases where ROWNUM() is used, MariaDB will use the same optimizations\nit uses with LIMIT.\n\nLIMIT optimization is possible when using ROWNUM in the following manner:\n\n* When one is in a top level WHERE clause comparing ROWNUM() with a numerical\nconstant using any of the following expressions:\nROWNUM() < number\nROWNUM() <= number\nROWNUM() = 1\nROWNUM() can be also be the right argument to the comparison function.\n\nIn the above cases, LIMIT optimization can be done in the following cases:\n\n* For the current sub query when the ROWNUM comparison is done on the top\nlevel:\n\nSELECT * from t1 WHERE ROWNUM() <= 2 AND t1.a > 0\n\n* For an inner sub query, when the upper level has only a ROWNUM() comparison\nin the WHERE clause:\n\nSELECT * from (select * from t1) as t WHERE ROWNUM() <= 2\n\nOther Changes Related to ROWNUM\n-------------------------------\n\nWhen ROWNUM() is used anywhere in a query, the optimization to ignore ORDER BY\nin subqueries are disabled.\n\nThis was done to get the following common Oracle query to work as expected:\n\nselect * from (select * from t1 order by a desc) as t where rownum() <= 2;\n\nBy default MariaDB ignores any ORDER BY in subqueries both because the SQL\nstandard defines results sets in subqueries to be un-ordered and because of\nperformance reasons (especially when using views in subqueries). See MDEV-3926\n\"Wrong result with GROUP BY ... WITH ROLLUP\" for a discussion of this topic.\n\nOther Considerations\n--------------------\n\nWhile MariaDB tries to emulate Oracle\'s usage of ROWNUM() as closely as\npossible, there are cases where the result is different:\n\n* When the optimizer finds rows in a different order (because of different\nstorage methods or optimization). This may also happen in Oracle if one adds\nor deletes an index, in which case the rows may be found in a different order.\n\nNote that usage of ROWNUM() in functions or stored procedures will use their\nown context, not the caller\'s context.\n\nURL: https://mariadb.com/kb/en/rownum/','','https://mariadb.com/kb/en/rownum/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,17,'ROW_COUNT','Syntax\n------\n\nROW_COUNT()\n\nDescription\n-----------\n\nROW_COUNT() returns the number of rows updated, inserted or deleted by the\npreceding statement. This is the same as the row count that the mysql client\ndisplays and the value from the mysql_affected_rows() C API function.\n\nGenerally:\n\n* For statements which return a result set (such as SELECT, SHOW, DESC or\nHELP), returns -1, even when the result set is empty. This is also true for\nadministrative statements, such as OPTIMIZE.\n* For DML statements other than SELECT and for ALTER TABLE, returns the number\nof affected rows.\n* For DDL statements (including TRUNCATE) and for other statements which don\'t\nreturn any result set (such as USE, DO, SIGNAL or DEALLOCATE PREPARE), returns\n0.\n\nFor UPDATE, affected rows is by default the number of rows that were actually\nchanged. If the CLIENT_FOUND_ROWS flag to mysql_real_connect() is specified\nwhen connecting to mysqld, affected rows is instead the number of rows matched\nby the WHERE clause.\n\nFor REPLACE, deleted rows are also counted. So, if REPLACE deletes a row and\nadds a new row, ROW_COUNT() returns 2.\n\nFor INSERT ... ON DUPLICATE KEY, updated rows are counted twice. So, if INSERT\nadds a new rows and modifies another row, ROW_COUNT() returns 3.\n\nROW_COUNT() does not take into account rows that are not directly\ndeleted/updated by the last statement. This means that rows deleted by foreign\nkeys or triggers are not counted.\n\nWarning: You can use ROW_COUNT() with prepared statements, but you need to\ncall it after EXECUTE, not after DEALLOCATE PREPARE, because the row count for\nallocate prepare is always 0.\n\nWarning: When used after a CALL statement, this function returns the number of\nrows affected by the last statement in the procedure, not by the whole\nprocedure.\n\nWarning: After INSERT DELAYED, ROW_COUNT() returns the number of the rows you\ntried to insert, not the number of the successful writes.\n\nThis information can also be found in the diagnostics area.\n\nStatements using the ROW_COUNT() function are not safe for replication.\n\nExamples\n--------\n\nCREATE TABLE t (A INT);\n\nINSERT INTO t VALUES(1),(2),(3);\n\nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           3 |\n+-------------+\n\nDELETE FROM t WHERE A IN(1,2);\n\nSELECT ROW_COUNT(); \n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           2 |\n+-------------+\n\nExample with prepared statements:\n\nSET @q = \'INSERT INTO t VALUES(1),(2),(3);\';\n\nPREPARE stmt FROM @q;\n\nEXECUTE stmt;\nQuery OK, 3 rows affected (0.39 sec)\nRecords: 3  Duplicates: 0  Warnings: 0\n\nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           3 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/row_count/','','https://mariadb.com/kb/en/row_count/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (207,17,'SCHEMA','Syntax\n------\n\nSCHEMA()\n\nDescription\n-----------\n\nThis function is a synonym for DATABASE().\n\nURL: https://mariadb.com/kb/en/schema/','','https://mariadb.com/kb/en/schema/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (208,17,'SESSION_USER','Syntax\n------\n\nSESSION_USER()\n\nDescription\n-----------\n\nSESSION_USER() is a synonym for USER().\n\nURL: https://mariadb.com/kb/en/session_user/','','https://mariadb.com/kb/en/session_user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (209,17,'SYSTEM_USER','Syntax\n------\n\nSYSTEM_USER()\n\nDescription\n-----------\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: https://mariadb.com/kb/en/system_user/','','https://mariadb.com/kb/en/system_user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,17,'USER','Syntax\n------\n\nUSER()\n\nDescription\n-----------\n\nReturns the current MariaDB user name and host name, given when authenticating\nto MariaDB, as a string in the utf8 character set.\n\nNote that the value of USER() may differ from the value of CURRENT_USER(),\nwhich is the user used to authenticate the current client. CURRENT_ROLE()\nreturns the current active role.\n\nSYSTEM_USER() and SESSION_USER are synonyms for USER().\n\nStatements using the USER() function or one of its synonyms are not safe for\nstatement level replication.\n\nExamples\n--------\n\nshell> mysql --user=\"anonymous\"\n\nSELECT USER(),CURRENT_USER();\n+---------------------+----------------+\n| USER()              | CURRENT_USER() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost     |\n+---------------------+----------------+\n\nTo select only the IP address, use SUBSTRING_INDEX(),\n\nSELECT SUBSTRING_INDEX(USER(), \'@\', -1);\n+----------------------------------+\n| SUBSTRING_INDEX(USER(), \'@\', -1) |\n+----------------------------------+\n| 192.168.0.101                    |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/user/','','https://mariadb.com/kb/en/user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (211,17,'VERSION','Syntax\n------\n\nVERSION()\n\nDescription\n-----------\n\nReturns a string that indicates the MariaDB server version. The string uses\nthe utf8 character set.\n\nExamples\n--------\n\nSELECT VERSION();\n+----------------+\n| VERSION()      |\n+----------------+\n| 10.4.7-MariaDB |\n+----------------+\n\nThe VERSION() string may have one or more of the following suffixes:\n\n+---------------------------+------------------------------------------------+\n| Suffix                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| -embedded                 | The server is an embedded server (libmysqld).  |\n+---------------------------+------------------------------------------------+\n| -log                      | General logging, slow logging or binary        |\n|                           | (replication) logging is enabled.              |\n+---------------------------+------------------------------------------------+\n| -debug                    | The server is compiled for debugging.          |\n+---------------------------+------------------------------------------------+\n| -valgrind                 | The server is compiled to be instrumented      |\n|                           | with valgrind.                                 |\n+---------------------------+------------------------------------------------+\n\nChanging the Version String\n---------------------------\n\nSome old legacy code may break because they are parsing the VERSION string and\nexpecting a MySQL string or a simple version string like Joomla til API17, see\nMDEV-7780.\n\nFrom MariaDB 10.2, one can fool these applications by setting the version\nstring from the command line or the my.cnf files with --version=....\n\nURL: https://mariadb.com/kb/en/version/','','https://mariadb.com/kb/en/version/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (212,18,'Assignment Operator (:=)','Syntax\n------\n\nvar_name := expr\n\nDescription\n-----------\n\nAssignment operator for assigning a value. The value on the right is assigned\nto the variable on left.\n\nUnlike the = operator, := can always be used to assign a value to a variable.\n\nThis operator works with both user-defined variables and local variables.\n\nWhen assigning the same value to several variables, LAST_VALUE() can be useful.\n\nExamples\n--------\n\nSELECT @x := 10;\n+----------+\n| @x := 10 |\n+----------+\n|       10 |\n+----------+\n\nSELECT @x, @y := @x;\n+------+----------+\n| @x   | @y := @x |\n+------+----------+\n|   10 |       10 |\n+------+----------+\n\nURL: https://mariadb.com/kb/en/assignment-operator/','','https://mariadb.com/kb/en/assignment-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (213,18,'Assignment Operator (=)','Syntax\n------\n\nidentifier = expr\n\nDescription\n-----------\n\nThe equal sign is used as both an assignment operator in certain contexts, and\nas a comparison operator. When used as assignment operator, the value on the\nright is assigned to the variable (or column, in some contexts) on the left.\n\nSince its use can be ambiguous, unlike the := assignment operator, the =\nassignment operator cannot be used in all contexts, and is only valid as part\nof a SET statement, or the SET clause of an UPDATE statement\n\nThis operator works with both user-defined variables and local variables.\n\nExamples\n--------\n\nUPDATE table_name SET x = 2 WHERE x > 100;\n\nSET @x = 1, @y := 2;\n\nURL: https://mariadb.com/kb/en/assignment-operators-assignment-operator/','','https://mariadb.com/kb/en/assignment-operators-assignment-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,19,'Not Equal Operator','Syntax\n------\n\n<>, !=\n\nDescription\n-----------\n\nNot equal operator. Evaluates both SQL expressions and returns 1 if they are\nnot equal and 0 if they are equal, or NULL if either expression is NULL. If\nthe expressions return different data types, (for instance, a number and a\nstring), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) != (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a != t2.x) OR (t1.b != t2.y)\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT \'.01\' <> \'0.01\';\n+-----------------+\n| \'.01\' <> \'0.01\' |\n+-----------------+\n|               1 |\n+-----------------+\n\nSELECT .01 <> \'0.01\';\n+---------------+\n| .01 <> \'0.01\' |\n+---------------+\n|             0 |\n+---------------+\n\nSELECT \'zapp\' <> \'zappp\';\n+-------------------+\n| \'zapp\' <> \'zappp\' |\n+-------------------+\n|                 1 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/not-equal/','','https://mariadb.com/kb/en/not-equal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (215,19,'<','Syntax\n------\n\n<\n\nDescription\n-----------\n\nLess than operator. Evaluates both SQL expressions and returns 1 if the left\nvalue is less than the right value and 0 if it is not, or NULL if either\nexpression is NULL. If the expressions return different data types, (for\ninstance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) < (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a < t2.x) OR ((t1.a = t2.x) AND (t1.b < t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 < 2;\n+-------+\n| 2 < 2 |\n+-------+\n|     0 |\n+-------+\n\nType conversion:\n\nSELECT 3<\'4\';\n+-------+\n| 3<\'4\' |\n+-------+\n|     1 |\n+-------+\n\nCase insensitivity - see Character Sets and Collations:\n\nSELECT \'a\'<\'A\';\n+---------+\n| \'a\'<\'A\' |\n+---------+\n|       0 |\n+---------+\n\nURL: https://mariadb.com/kb/en/less-than/','','https://mariadb.com/kb/en/less-than/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,19,'<=','Syntax\n------\n\n<=\n\nDescription\n-----------\n\nLess than or equal operator. Evaluates both SQL expressions and returns 1 if\nthe left value is less than or equal to the right value and 0 if it is not, or\nNULL if either expression is NULL. If the expressions return different data\ntypes, (for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) <= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a < t2.x) OR ((t1.a = t2.x) AND (t1.b <= t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 0.1 <= 2;\n+----------+\n| 0.1 <= 2 |\n+----------+\n|        1 |\n+----------+\n\nSELECT \'a\'<=\'A\';\n+----------+\n| \'a\'<=\'A\' |\n+----------+\n|        1 |\n+----------+\n\nURL: https://mariadb.com/kb/en/less-than-or-equal/','','https://mariadb.com/kb/en/less-than-or-equal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,19,'<=>','Syntax\n------\n\n<=>\n\nDescription\n-----------\n\nNULL-safe equal operator. It performs an equality comparison like the =\noperator, but returns 1 rather than NULL if both operands are NULL, and 0\nrather than NULL if one operand is NULL.\n\na <=> b is equivalent to a = b OR (a IS NULL AND b IS NULL).\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) <=> (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a <=> t2.x) AND (t1.b <=> t2.y)\nFROM t1 INNER JOIN t2;\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n+---------+---------------+------------+\n| 1 <=> 1 | NULL <=> NULL | 1 <=> NULL |\n+---------+---------------+------------+\n|       1 |             1 |          0 |\n+---------+---------------+------------+\n\nSELECT 1 = 1, NULL = NULL, 1 = NULL;\n+-------+-------------+----------+\n| 1 = 1 | NULL = NULL | 1 = NULL |\n+-------+-------------+----------+\n|     1 |        NULL |     NULL |\n+-------+-------------+----------+\n\nURL: https://mariadb.com/kb/en/null-safe-equal/','','https://mariadb.com/kb/en/null-safe-equal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (218,19,'=','Syntax\n------\n\nleft_expr = right_expr\n\nDescription\n-----------\n\nEqual operator. Evaluates both SQL expressions and returns 1 if they are\nequal, 0 if they are not equal, or NULL if either expression is NULL. If the\nexpressions return different data types (for example, a number and a string),\na type conversion is performed.\n\nWhen used in row comparisons these two queries are synonymous and return the\nsame results:\n\nSELECT (t1.a, t1.b) = (t2.x, t2.y) FROM t1 INNER JOIN t2;\n\nSELECT (t1.a = t2.x) AND (t1.b = t2.y) FROM t1 INNER JOIN t2;\n\nTo perform a NULL-safe comparison, use the <=> operator.\n\n= can also be used as an assignment operator.\n\nExamples\n--------\n\nSELECT 1 = 0;\n+-------+\n| 1 = 0 |\n+-------+\n|     0 |\n+-------+\n\nSELECT \'0\' = 0;\n+---------+\n| \'0\' = 0 |\n+---------+\n|       1 |\n+---------+\n\nSELECT \'0.0\' = 0;\n+-----------+\n| \'0.0\' = 0 |\n+-----------+\n|         1 |\n+-----------+\n\nSELECT \'0.01\' = 0;\n+------------+\n| \'0.01\' = 0 |\n+------------+\n|          0 |\n+------------+\n\nSELECT \'.01\' = 0.01;\n+--------------+\n| \'.01\' = 0.01 |\n+--------------+\n|            1 |\n+--------------+\n\nSELECT (5 * 2) = CONCAT(\'1\', \'0\');\n+----------------------------+\n| (5 * 2) = CONCAT(\'1\', \'0\') |\n+----------------------------+\n|                          1 |\n+----------------------------+\n\nSELECT 1 = NULL;\n+----------+\n| 1 = NULL |\n+----------+\n|     NULL |\n+----------+\n\nSELECT NULL = NULL;\n+-------------+\n| NULL = NULL |\n+-------------+\n|        NULL |\n+-------------+\n\nURL: https://mariadb.com/kb/en/equal/','','https://mariadb.com/kb/en/equal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (219,19,'>','Syntax\n------\n\n>\n\nDescription\n-----------\n\nGreater than operator. Evaluates both SQL expressions and returns 1 if the\nleft value is greater than the right value and 0 if it is not, or NULL if\neither expression is NULL. If the expressions return different data types,\n(for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) > (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b > t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 > 2;\n+-------+\n| 2 > 2 |\n+-------+\n|     0 |\n+-------+\n\nSELECT \'b\' > \'a\';\n+-----------+\n| \'b\' > \'a\' |\n+-----------+\n|         1 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/greater-than/','','https://mariadb.com/kb/en/greater-than/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (220,19,'>=','Syntax\n------\n\n>=\n\nDescription\n-----------\n\nGreater than or equal operator. Evaluates both SQL expressions and returns 1\nif the left value is greater than or equal to the right value and 0 if it is\nnot, or NULL if either expression is NULL. If the expressions return different\ndata types, (for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) >= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b >= t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 >= 2;\n+--------+\n| 2 >= 2 |\n+--------+\n|      1 |\n+--------+\n\nSELECT \'A\' >= \'a\';\n+------------+\n| \'A\' >= \'a\' |\n+------------+\n|          1 |\n+------------+\n\nURL: https://mariadb.com/kb/en/greater-than-or-equal/','','https://mariadb.com/kb/en/greater-than-or-equal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (221,19,'BETWEEN AND','Syntax\n------\n\nexpr BETWEEN min AND max\n\nDescription\n-----------\n\nIf expr is greater than or equal to min and expr is less than or equal to max,\nBETWEEN returns 1, otherwise it returns 0. This is equivalent to the\nexpression (min <= expr AND expr <= max) if all the arguments are of the same\ntype. Otherwise type conversion takes place according to the rules described\nat Type Conversion, but applied to all the three arguments.\n\nExamples\n--------\n\nSELECT 1 BETWEEN 2 AND 3;\n+-------------------+\n| 1 BETWEEN 2 AND 3 |\n+-------------------+\n|                 0 |\n+-------------------+\n\nSELECT \'b\' BETWEEN \'a\' AND \'c\';\n+-------------------------+\n| \'b\' BETWEEN \'a\' AND \'c\' |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSELECT 2 BETWEEN 2 AND \'3\';\n+---------------------+\n| 2 BETWEEN 2 AND \'3\' |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSELECT 2 BETWEEN 2 AND \'x-3\';\n+-----------------------+\n| 2 BETWEEN 2 AND \'x-3\' |\n+-----------------------+\n|                     0 |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'x-3\'\n\nNULL:\n\nSELECT 1 BETWEEN 1 AND NULL;\n+----------------------+\n| 1 BETWEEN 1 AND NULL |\n+----------------------+\n|                 NULL |\n+----------------------+\n\nDATE, DATETIME and TIMESTAMP examples. Omitting the time component compares\nagainst 00:00, so later times on the same date are not returned:\n\nCREATE TABLE `x` (\n a date ,\n b datetime,\n c timestamp\n)\n\nINSERT INTO x VALUES \n (\'2018-11-11\', \'2018-11-11 05:15\', \'2018-11-11 05:15\'), \n (\'2018-11-12\', \'2018-11-12 05:15\', \'2018-11-12 05:15\');\n\nSELECT * FROM x WHERE a BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a          | b                   | c                   |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n| 2018-11-12 | 2018-11-12 05:15:00 | 2018-11-12 05:15:00 |\n+------------+---------------------+---------------------+\n\nSELECT * FROM x WHERE b BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a          | b                   | c                   |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n+------------+---------------------+---------------------+\n\nSELECT * FROM x WHERE c BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a          | b                   | c                   |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n+------------+---------------------+---------------------+\n\nURL: https://mariadb.com/kb/en/between-and/','','https://mariadb.com/kb/en/between-and/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (222,19,'COALESCE','Syntax\n------\n\nCOALESCE(value,...)\n\nDescription\n-----------\n\nReturns the first non-NULL value in the list, or NULL if there are no non-NULL\nvalues. At least one parameter must be passed.\n\nThe function is useful when substituting a default value for null values when\ndisplaying data.\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT COALESCE(NULL,1);\n+------------------+\n| COALESCE(NULL,1) |\n+------------------+\n|                1 |\n+------------------+\n\nSELECT COALESCE(NULL,NULL,NULL);\n+--------------------------+\n| COALESCE(NULL,NULL,NULL) |\n+--------------------------+\n|                     NULL |\n+--------------------------+\n\nWhen two arguments are given, COALESCE() is the same as IFNULL():\n\nSET @a=NULL, @b=1;\n\nSELECT COALESCE(@a, @b), IFNULL(@a, @b);\n+------------------+----------------+\n| COALESCE(@a, @b) | IFNULL(@a, @b) |\n+------------------+----------------+\n|                1 |              1 |\n+------------------+----------------+\n\nHex type confusion:\n\nCREATE TABLE t1 (a INT, b VARCHAR(10));\nINSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31), COALESCE(0x61));\n\nSELECT * FROM t1;\n+------+------+\n| a    | b    |\n+------+------+\n|   49 | a    |\n|    1 | a    |\n+------+------+\n\nThe reason for the differing results above is that when 0x31 is inserted\ndirectly to the column, it\'s treated as a number (see Hexadecimal Literals),\nwhile when 0x31 is passed to COALESCE(), it\'s treated as a string, because:\n\n* HEX values have a string data type by default.\n* COALESCE() has the same data type as the argument.\n\nSubstituting zero for NULL (in this case when the aggregate function returns\nNULL after finding no rows):\n\nSELECT SUM(score) FROM student;\n+------------+\n| SUM(score) |\n+------------+\n|       NULL |\n+------------+\n\nSELECT COALESCE(SUM(score),0) FROM student;\n+------------------------+\n| COALESCE(SUM(score),0) |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/coalesce/','','https://mariadb.com/kb/en/coalesce/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (223,19,'GREATEST','Syntax\n------\n\nGREATEST(value1,value2,...)\n\nDescription\n-----------\n\nWith two or more arguments, returns the largest (maximum-valued) argument. The\narguments are compared using the same rules as for LEAST().\n\nExamples\n--------\n\nSELECT GREATEST(2,0);\n+---------------+\n| GREATEST(2,0) |\n+---------------+\n|             2 |\n+---------------+\n\nSELECT GREATEST(34.0,3.0,5.0,767.0);\n+------------------------------+\n| GREATEST(34.0,3.0,5.0,767.0) |\n+------------------------------+\n|                        767.0 |\n+------------------------------+\n\nSELECT GREATEST(\'B\',\'A\',\'C\');\n+-----------------------+\n| GREATEST(\'B\',\'A\',\'C\') |\n+-----------------------+\n| C                     |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/greatest/','','https://mariadb.com/kb/en/greatest/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (224,19,'IN','Syntax\n------\n\nexpr IN (value,...)\n\nDescription\n-----------\n\nReturns 1 if expr is equal to any of the values in the IN list, else returns\n0. If all values are constants, they are evaluated according to the type of\nexpr and sorted. The search for the item then is done using a binary search.\nThis means IN is very quick if the IN value list consists entirely of\nconstants. Otherwise, type conversion takes place according to the rules\ndescribed at Type Conversion, but applied to all the arguments.\n\nIf expr is NULL, IN always returns NULL. If at least one of the values in the\nlist is NULL, and one of the comparisons is true, the result is 1. If at least\none of the values in the list is NULL and none of the comparisons is true, the\nresult is NULL.\n\nExamples\n--------\n\nSELECT 2 IN (0,3,5,7);\n+----------------+\n| 2 IN (0,3,5,7) |\n+----------------+\n|              0 |\n+----------------+\n\nSELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n+----------------------------------+\n| \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\') |\n+----------------------------------+\n|                                1 |\n+----------------------------------+\n\nType conversion:\n\nSELECT 1 IN (\'1\', \'2\', \'3\');\n+----------------------+\n| 1 IN (\'1\', \'2\', \'3\') |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT NULL IN (1, 2, 3);\n+-------------------+\n| NULL IN (1, 2, 3) |\n+-------------------+\n|              NULL |\n+-------------------+\n\nSELECT 1 IN (1, 2, NULL);\n+-------------------+\n| 1 IN (1, 2, NULL) |\n+-------------------+\n|                 1 |\n+-------------------+\n\nSELECT 5 IN (1, 2, NULL);\n+-------------------+\n| 5 IN (1, 2, NULL) |\n+-------------------+\n|              NULL |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/in/','','https://mariadb.com/kb/en/in/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,19,'INTERVAL','Syntax\n------\n\nINTERVAL(N,N1,N2,N3,...)\n\nDescription\n-----------\n\nReturns the index of the last argument that is less than the first argument or\nis NULL.\n\nReturns 0 if N < N1, 1 if N < N2, 2 if N < N3 and so on or -1 if N is NULL.\nAll arguments are treated as integers. It is required that N1 < N2 < N3 < ...\n< Nn for this function to work correctly. This is because a fast binary search\nis used.\n\nExamples\n--------\n\nSELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n+--------------------------------------+\n| INTERVAL(23, 1, 15, 17, 30, 44, 200) |\n+--------------------------------------+\n|                                    3 |\n+--------------------------------------+\n\nSELECT INTERVAL(10, 1, 10, 100, 1000);\n+--------------------------------+\n| INTERVAL(10, 1, 10, 100, 1000) |\n+--------------------------------+\n|                              2 |\n+--------------------------------+\n\nSELECT INTERVAL(22, 23, 30, 44, 200);\n+-------------------------------+\n| INTERVAL(22, 23, 30, 44, 200) |\n+-------------------------------+\n|                             0 |\n+-------------------------------+\n\nSELECT INTERVAL(10, 2, NULL);\n+-----------------------+\n| INTERVAL(10, 2, NULL) |\n+-----------------------+\n|                     2 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/interval/','','https://mariadb.com/kb/en/interval/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (226,19,'IS','Syntax\n------\n\nIS boolean_value\n\nDescription\n-----------\n\nTests a value against a boolean value, where boolean_value can be TRUE, FALSE,\nor UNKNOWN.\n\nThere is an important difference between using IS TRUE or comparing a value\nwith TRUE using =. When using =, only 1 equals to TRUE. But when using IS\nTRUE, all values which are logically true (like a number > 1) return TRUE.\n\nExamples\n--------\n\nSELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n+-----------+------------+-----------------+\n| 1 IS TRUE | 0 IS FALSE | NULL IS UNKNOWN |\n+-----------+------------+-----------------+\n|         1 |          1 |               1 |\n+-----------+------------+-----------------+\n\nDifference between = and IS TRUE:\n\nSELECT 2 = TRUE, 2 IS TRUE;\n+----------+-----------+\n| 2 = TRUE | 2 IS TRUE |\n+----------+-----------+\n|        0 |         1 |\n+----------+-----------+\n\nURL: https://mariadb.com/kb/en/is/','','https://mariadb.com/kb/en/is/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,19,'IS NOT','Syntax\n------\n\nIS NOT boolean_value\n\nDescription\n-----------\n\nTests a value against a boolean value, where boolean_value can be TRUE, FALSE,\nor UNKNOWN.\n\nExamples\n--------\n\nSELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n+------------------+------------------+---------------------+\n| 1 IS NOT UNKNOWN | 0 IS NOT UNKNOWN | NULL IS NOT UNKNOWN |\n+------------------+------------------+---------------------+\n|                1 |                1 |                   0 |\n+------------------+------------------+---------------------+\n\nSELECT NULL IS NOT TRUE, NULL IS NOT FALSE;\n+------------------+-------------------+\n| NULL IS NOT TRUE | NULL IS NOT FALSE |\n+------------------+-------------------+\n|                1 |                 1 |\n+------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/is-not/','','https://mariadb.com/kb/en/is-not/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (228,19,'IS NOT NULL','Syntax\n------\n\nIS NOT NULL\n\nDescription\n-----------\n\nTests whether a value is not NULL. See also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n+---------------+---------------+------------------+\n| 1 IS NOT NULL | 0 IS NOT NULL | NULL IS NOT NULL |\n+---------------+---------------+------------------+\n|             1 |             1 |                0 |\n+---------------+---------------+------------------+\n\nURL: https://mariadb.com/kb/en/is-not-null/','','https://mariadb.com/kb/en/is-not-null/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,19,'IS NULL','Syntax\n------\n\nIS NULL\n\nDescription\n-----------\n\nTests whether a value is NULL. See also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n+-----------+-----------+--------------+\n| 1 IS NULL | 0 IS NULL | NULL IS NULL |\n+-----------+-----------+--------------+\n|         0 |         0 |            1 |\n+-----------+-----------+--------------+\n\nCompatibility\n-------------\n\nSome ODBC applications use the syntax auto_increment_field IS NOT NULL to find\nthe latest row that was inserted with an autogenerated key value. If your\napplications need this, you can set the sql_auto_is_null variable to 1.\n\nSET @@sql_auto_is_null=1;\nCREATE TABLE t1 (auto_increment_column INT NOT NULL AUTO_INCREMENT PRIMARY\nKEY);\nINSERT INTO t1 VALUES (NULL);\nSELECT * FROM t1 WHERE auto_increment_column IS NULL;\n\n+-----------------------+\n| auto_increment_column |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/is-null/','','https://mariadb.com/kb/en/is-null/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (230,19,'ISNULL','Syntax\n------\n\nISNULL(expr)\n\nDescription\n-----------\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT ISNULL(1+1);\n+-------------+\n| ISNULL(1+1) |\n+-------------+\n|           0 |\n+-------------+\n\nSELECT ISNULL(1/0);\n+-------------+\n| ISNULL(1/0) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/isnull/','','https://mariadb.com/kb/en/isnull/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (231,19,'LEAST','Syntax\n------\n\nLEAST(value1,value2,...)\n\nDescription\n-----------\n\nWith two or more arguments, returns the smallest (minimum-valued) argument.\nThe arguments are compared using the following rules:\n\n* If the return value is used in an INTEGER context or all arguments are\ninteger-valued, they are compared as integers.\n* If the return value is used in a REAL context or all arguments are\nreal-valued, they are compared as reals.\n* If any argument is a case-sensitive string, the arguments are compared as\ncase-sensitive strings.\n* In all other cases, the arguments are compared as case-insensitive strings.\n\nLEAST() returns NULL if any argument is NULL.\n\nExamples\n--------\n\nSELECT LEAST(2,0);\n+------------+\n| LEAST(2,0) |\n+------------+\n|          0 |\n+------------+\n\nSELECT LEAST(34.0,3.0,5.0,767.0);\n+---------------------------+\n| LEAST(34.0,3.0,5.0,767.0) |\n+---------------------------+\n|                       3.0 |\n+---------------------------+\n\nSELECT LEAST(\'B\',\'A\',\'C\');\n+--------------------+\n| LEAST(\'B\',\'A\',\'C\') |\n+--------------------+\n| A                  |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/least/','','https://mariadb.com/kb/en/least/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (232,19,'NOT BETWEEN','Syntax\n------\n\nexpr NOT BETWEEN min AND max\n\nDescription\n-----------\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nNote that the meaning of the alternative form NOT expr BETWEEN min AND max is\naffected by the HIGH_NOT_PRECEDENCE SQL_MODE flag.\n\nExamples\n--------\n\nSELECT 1 NOT BETWEEN 2 AND 3;\n+-----------------------+\n| 1 NOT BETWEEN 2 AND 3 |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT \'b\' NOT BETWEEN \'a\' AND \'c\';\n+-----------------------------+\n| \'b\' NOT BETWEEN \'a\' AND \'c\' |\n+-----------------------------+\n|                           0 |\n+-----------------------------+\n\nNULL:\n\nSELECT 1 NOT BETWEEN 1 AND NULL;\n+--------------------------+\n| 1 NOT BETWEEN 1 AND NULL |\n+--------------------------+\n|                     NULL |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/not-between/','','https://mariadb.com/kb/en/not-between/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (233,19,'NOT IN','Syntax\n------\n\nexpr NOT IN (value,...)\n\nDescription\n-----------\n\nThis is the same as NOT (expr IN (value,...)).\n\nExamples\n--------\n\nSELECT 2 NOT IN (0,3,5,7);\n+--------------------+\n| 2 NOT IN (0,3,5,7) |\n+--------------------+\n|                  1 |\n+--------------------+\n\nSELECT \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\');\n+--------------------------------------+\n| \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\') |\n+--------------------------------------+\n|                                    0 |\n+--------------------------------------+\n\nSELECT 1 NOT IN (\'1\', \'2\', \'3\');\n+--------------------------+\n| 1 NOT IN (\'1\', \'2\', \'3\') |\n+--------------------------+\n|                        0 |\n+--------------------------+\n\nNULL:\n\nSELECT NULL NOT IN (1, 2, 3);\n+-----------------------+\n| NULL NOT IN (1, 2, 3) |\n+-----------------------+\n|                  NULL |\n+-----------------------+\n\nSELECT 1 NOT IN (1, 2, NULL);\n+-----------------------+\n| 1 NOT IN (1, 2, NULL) |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nSELECT 5 NOT IN (1, 2, NULL);\n+-----------------------+\n| 5 NOT IN (1, 2, NULL) |\n+-----------------------+\n|                  NULL |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/not-in/','','https://mariadb.com/kb/en/not-in/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (234,20,'&','Syntax\n------\n\n&\n\nDescription\n-----------\n\nBitwise AND. Converts the values to binary and compares bits. Only if both the\ncorresponding bits are 1 is the resulting bit also 1.\n\nSee also bitwise OR.\n\nExamples\n--------\n\nSELECT 2&1;\n+-----+\n| 2&1 |\n+-----+\n|   0 |\n+-----+\n\nSELECT 3&1;\n+-----+\n| 3&1 |\n+-----+\n|   1 |\n+-----+\n\nSELECT 29 & 15;\n+---------+\n| 29 & 15 |\n+---------+\n|      13 |\n+---------+\n\nURL: https://mariadb.com/kb/en/bitwise_and/','','https://mariadb.com/kb/en/bitwise_and/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (235,20,'<<','Syntax\n------\n\nvalue1 << value2\n\nDescription\n-----------\n\nConverts a longlong (BIGINT) number (value1) to binary and shifts value2 units\nto the left.\n\nExamples\n--------\n\nSELECT 1 << 2;\n+--------+\n| 1 << 2 |\n+--------+\n|      4 |\n+--------+\n\nURL: https://mariadb.com/kb/en/shift-left/','','https://mariadb.com/kb/en/shift-left/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (236,20,'>>','Syntax\n------\n\nvalue1 >> value2\n\nDescription\n-----------\n\nConverts a longlong (BIGINT) number (value1) to binary and shifts value2 units\nto the right.\n\nExamples\n--------\n\nSELECT 4 >> 2;\n+--------+\n| 4 >> 2 |\n+--------+\n|      1 |\n+--------+\n\nURL: https://mariadb.com/kb/en/shift-right/','','https://mariadb.com/kb/en/shift-right/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (237,20,'BIT_COUNT','Syntax\n------\n\nBIT_COUNT(N)\n\nDescription\n-----------\n\nReturns the number of bits that are set in the argument N.\n\nExamples\n--------\n\nSELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n+---------------+----------------------+\n| BIT_COUNT(29) | BIT_COUNT(b\'101010\') |\n+---------------+----------------------+\n|             4 |                    3 |\n+---------------+----------------------+\n\nURL: https://mariadb.com/kb/en/bit_count/','','https://mariadb.com/kb/en/bit_count/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,20,'^','Syntax\n------\n\n^\n\nDescription\n-----------\n\nBitwise XOR. Converts the values to binary and compares bits. If one (and only\none) of the corresponding bits is 1 is the resulting bit also 1.\n\nExamples\n--------\n\nSELECT 1 ^ 1;\n+-------+\n| 1 ^ 1 |\n+-------+\n|     0 |\n+-------+\n\nSELECT 1 ^ 0;\n+-------+\n| 1 ^ 0 |\n+-------+\n|     1 |\n+-------+\n\nSELECT 11 ^ 3;\n+--------+\n| 11 ^ 3 |\n+--------+\n|      8 |\n+--------+\n\nURL: https://mariadb.com/kb/en/bitwise-xor/','','https://mariadb.com/kb/en/bitwise-xor/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (239,20,'|','Syntax\n------\n\n|\n\nDescription\n-----------\n\nBitwise OR. Converts the values to binary and compares bits. If either of the\ncorresponding bits has a value of 1, the resulting bit is also 1.\n\nSee also bitwise AND.\n\nExamples\n--------\n\nSELECT 2|1;\n+-----+\n| 2|1 |\n+-----+\n|   3 |\n+-----+\n\nSELECT 29 | 15;\n+---------+\n| 29 | 15 |\n+---------+\n|      31 |\n+---------+\n\nURL: https://mariadb.com/kb/en/bitwise-or/','','https://mariadb.com/kb/en/bitwise-or/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,20,'~','Syntax\n------\n\n~\n\nDescription\n-----------\n\nBitwise NOT. Converts the value to 4 bytes binary and inverts all bits.\n\nExamples\n--------\n\nSELECT 3 & ~1;\n+--------+\n| 3 & ~1 |\n+--------+\n|      2 |\n+--------+\n\nSELECT 5 & ~1;\n+--------+\n| 5 & ~1 |\n+--------+\n|      4 |\n+--------+\n\nURL: https://mariadb.com/kb/en/bitwise-not/','','https://mariadb.com/kb/en/bitwise-not/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (241,20,'Parentheses','Parentheses are sometimes called precedence operators - this means that they\ncan be used to change the other operator\'s precedence in an expression. The\nexpressions that are written between parentheses are computed before the\nexpressions that are written outside. Parentheses must always contain an\nexpression (that is, they cannot be empty), and can be nested.\n\nFor example, the following expressions could return different results:\n\n* NOT a OR b\n* NOT (a OR b)\n\nIn the first case, NOT applies to a, so if a is FALSE or b is TRUE, the\nexpression returns TRUE. In the second case, NOT applies to the result of a OR\nb, so if at least one of a or b is TRUE, the expression is TRUE.\n\nWhen the precedence of operators is not intuitive, you can use parentheses to\nmake it immediately clear for whoever reads the statement.\n\nThe precedence of the NOT operator can also be affected by the\nHIGH_NOT_PRECEDENCE SQL_MODE flag.\n\nOther uses\n----------\n\nParentheses must always be used to enclose subqueries.\n\nParentheses can also be used in a JOIN statement between multiple tables to\ndetermine which tables must be joined first.\n\nAlso, parentheses are used to enclose the list of parameters to be passed to\nbuilt-in functions, user-defined functions and stored routines. However, when\nno parameter is passed to a stored procedure, parentheses are optional. For\nbuiltin functions and user-defined functions, spaces are not allowed between\nthe function name and the open parenthesis, unless the IGNORE_SPACE SQL_MODE\nis set. For stored routines (and for functions if IGNORE_SPACE is set) spaces\nare allowed before the open parenthesis, including tab characters and new line\ncharacters.\n\nSyntax errors\n-------------\n\nIf there are more open parentheses than closed parentheses, the error usually\nlooks like this:\n\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that\ncorresponds to your MariaDB server version for the right syntax to use near \'\'\na\nt line 1\n\nNote the empty string.\n\nIf there are more closed parentheses than open parentheses, the error usually\nlooks like this:\n\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that\ncorresponds to your MariaDB server version for the right syntax to use near \')\'\nat line 1\n\nNote the quoted closed parenthesis.\n\nURL: https://mariadb.com/kb/en/parentheses/','','https://mariadb.com/kb/en/parentheses/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,20,'TRUE FALSE','Description\n-----------\n\nThe constants TRUE and FALSE evaluate to 1 and 0, respectively. The constant\nnames can be written in any lettercase.\n\nExamples\n--------\n\nSELECT TRUE, true, FALSE, false;\n+------+------+-------+-------+\n| TRUE | TRUE | FALSE | FALSE |\n+------+------+-------+-------+\n|    1 |    1 |     0 |     0 |\n+------+------+-------+-------+\n\nURL: https://mariadb.com/kb/en/true-false/','','https://mariadb.com/kb/en/true-false/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (243,21,'ANALYZE TABLE','Syntax\n------\n\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [,tbl_name ...] \n [PERSISTENT FOR [ALL|COLUMNS ([col_name [,col_name ...]])]\n  [INDEXES ([index_name [,index_name ...]])]]\n\nDescription\n-----------\n\nANALYZE TABLE analyzes and stores the key distribution for a table (index\nstatistics). This statement works with MyISAM, Aria and InnoDB tables. During\nthe analysis, InnoDB will allow reads/writes, and MyISAM/Aria reads/inserts.\nFor MyISAM tables, this statement is equivalent to using myisamchk --analyze.\n\nFor more information on how the analysis works within InnoDB, see InnoDB\nLimitations.\n\nMariaDB uses the stored key distribution to decide the order in which tables\nshould be joined when you perform a join on something other than a constant.\nIn addition, key distributions can be used when deciding which indexes to use\nfor a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, ANALYZE TABLE statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nFrom MariaDB 10.3.19, ANALYZE TABLE statements are not logged to the binary\nlog if read_only is set. See also Read-Only Replicas.\n\nANALYZE TABLE is also supported for partitioned tables. You can use ALTER\nTABLE ... ANALYZE PARTITION to analyze one or more partitions.\n\nThe Aria storage engine supports progress reporting for the ANALYZE TABLE\nstatement.\n\nEngine-Independent Statistics\n-----------------------------\n\nANALYZE TABLE supports engine-independent statistics. See Engine-Independent\nTable Statistics: Collecting Statistics with the ANALYZE TABLE Statement for\nmore information.\n\nUseful Variables\n----------------\n\nFor calculating the number of duplicates, ANALYZE TABLE uses a buffer of\nsort_buffer_size bytes per column. You can slightly increase the speed of\nANALYZE TABLE by increasing this variable.\n\nURL: https://mariadb.com/kb/en/analyze-table/','','https://mariadb.com/kb/en/analyze-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (244,21,'CHECK TABLE','Syntax\n------\n\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nDescription\n-----------\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nArchive, Aria, CSV, InnoDB and MyISAM tables. For Aria and MyISAM tables, the\nkey statistics are updated as well. For CSV, see also Checking and Repairing\nCSV Tables.\n\nAs an alternative, myisamchk is a commandline tool for checking MyISAM tables\nwhen the tables are not being accessed. For Aria tables, there is a similar\ntool: aria_chk.\n\nFor checking dynamic columns integrity, COLUMN_CHECK() can be used.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is also supported for partitioned tables. You can use ALTER TABLE\n... CHECK PARTITION to check one or more partitions.\n\nThe meaning of the different options are as follows - note that this can vary\na bit between storage engines:\n\n+-----+----------------------------------------------------------------------+\n| FOR | Do a very quick check if the storage format for the table has        |\n| UPG | changed so that one needs to do a REPAIR. This is only needed when   |\n| ADE | one upgrades between major versions of MariaDB or MySQL. This is     |\n|     | usually done by running mysql_upgrade.                               |\n+-----+----------------------------------------------------------------------+\n| FAS | Only check tables that has not been closed properly or are marked    |\n|     | as corrupt. Only supported by the MyISAM and Aria engines. For       |\n|     | other engines the table is checked normally                          |\n+-----+----------------------------------------------------------------------+\n| CHA | Check only tables that has changed since last REPAIR / CHECK. Only   |\n| GED | supported by the MyISAM and Aria engines. For other engines the      |\n|     | table is checked normally.                                           |\n+-----+----------------------------------------------------------------------+\n| QUI | Do a fast check. For MyISAM and Aria, this means skipping the check  |\n| K   | of the delete link chain, which may take some time.                  |\n+-----+----------------------------------------------------------------------+\n| MED | Scan also the data files. Checks integrity between data and index    |\n| UM  | files with checksums. In most cases this should find all possible    |\n|     | errors.                                                              |\n+-----+----------------------------------------------------------------------+\n| EXT | Does a full check to verify every possible error. For MyISAM and     |\n| NDE | Aria, verify for each row that all it keys exists and points to the  |\n|     | row. This may take a long time on large tables. Ignored by InnoDB    |\n|     | before MariaDB 10.6.11, MariaDB 10.7.7, MariaDB 10.8.6 and MariaDB   |\n|     | 10.9.4.                                                              |\n+-----+----------------------------------------------------------------------+\n\nFor most cases running CHECK TABLE without options or MEDIUM should be good\nenough.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nIf you want to know if two tables are identical, take a look at CHECKSUM TABLE.\n\nInnoDB\n------\n\nIf CHECK TABLE finds an error in an InnoDB table, MariaDB might shutdown to\nprevent the error propagation. In this case, the problem will be reported in\nthe error log. Otherwise the table or an index might be marked as corrupted,\nto prevent use. This does not happen with some minor problems, like a wrong\nnumber of entries in a secondary index. Those problems are reported in the\noutput of CHECK TABLE.\n\nEach tablespace contains a header with metadata. This header is not checked by\nthis statement.\n\nDuring the execution of CHECK TABLE, other threads may be blocked.\n\nURL: https://mariadb.com/kb/en/check-table/','','https://mariadb.com/kb/en/check-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (245,21,'CHECK VIEW','Syntax\n------\n\nCHECK VIEW view_name\n\nDescription\n-----------\n\nThe CHECK VIEW statement was introduced in MariaDB 10.0.18 to assist with\nfixing MDEV-6916, an issue introduced in MariaDB 5.2 where the view algorithms\nwere swapped. It checks whether the view algorithm is correct. It is run as\npart of mysql_upgrade, and should not normally be required in regular use.\n\nURL: https://mariadb.com/kb/en/check-view/','','https://mariadb.com/kb/en/check-view/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (246,21,'CHECKSUM TABLE','Syntax\n------\n\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nDescription\n-----------\n\nCHECKSUM TABLE reports a table checksum. This is very useful if you want to\nknow if two tables are the same (for example on a master and slave).\n\nWith QUICK, the live table checksum is reported if it is available, or NULL\notherwise. This is very fast. A live checksum is enabled by specifying the\nCHECKSUM=1 table option when you create the table; currently, this is\nsupported only for Aria and MyISAM tables.\n\nWith EXTENDED, the entire table is read row by row and the checksum is\ncalculated. This can be very slow for large tables.\n\nIf neither QUICK nor EXTENDED is specified, MariaDB returns a live checksum if\nthe table storage engine supports it and scans the table otherwise.\n\nCHECKSUM TABLE requires the SELECT privilege for the table.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a warning.\n\nThe table row format affects the checksum value. If the row format changes,\nthe checksum will change. This means that when a table created with a\nMariaDB/MySQL version is upgraded to another version, the checksum value will\nprobably change.\n\nTwo identical tables should always match to the same checksum value; however,\nalso for non-identical tables there is a very slight chance that they will\nreturn the same value as the hashing algorithm is not completely\ncollision-free.\n\nIdentical Tables\n----------------\n\nIdentical tables mean that the CREATE statement is identical and that the\nfollowing variable, which affects the storage formats, was the same when the\ntables were created:\n\n* mysql56-temporal-format\n\nDifferences Between MariaDB and MySQL\n-------------------------------------\n\nCHECKSUM TABLE may give a different result as MariaDB doesn\'t ignore NULLs in\nthe columns as MySQL 5.1 does (Later MySQL versions should calculate checksums\nthe same way as MariaDB). You can get the \'old style\' checksum in MariaDB by\nstarting mysqld with the --old option. Note however that that the MyISAM and\nAria storage engines in MariaDB are using the new checksum internally, so if\nyou are using --old, the CHECKSUM command will be slower as it needs to\ncalculate the checksum row by row. Starting from MariaDB Server 10.9, --old is\ndeprecated and will be removed in a future release. Set --old-mode or OLD_MODE\nto COMPAT_5_1_CHECKSUM to get \'old style\' checksum.\n\nURL: https://mariadb.com/kb/en/checksum-table/','','https://mariadb.com/kb/en/checksum-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (247,21,'OPTIMIZE TABLE','Syntax\n------\n\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n  tbl_name [, tbl_name] ...\n  [WAIT n | NOWAIT]\n\nDescription\n-----------\n\nOPTIMIZE TABLE has two main functions. It can either be used to defragment\ntables, or to update the InnoDB fulltext index.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nDefragmenting\n-------------\n\nOPTIMIZE TABLE works for InnoDB (before MariaDB 10.1.1, only if the\ninnodb_file_per_table server system variable is set), Aria, MyISAM and ARCHIVE\ntables, and should be used if you have deleted a large part of a table or if\nyou have made many changes to a table with variable-length rows (tables that\nhave VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted rows are maintained\nin a linked list and subsequent INSERT operations reuse old row positions.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, OPTIMIZE TABLE statements are written to the binary log and will\nbe replicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure\nthe statement is not written to the binary log.\n\nFrom MariaDB 10.3.19, OPTIMIZE TABLE statements are not logged to the binary\nlog if read_only is set. See also Read-Only Replicas.\n\nOPTIMIZE TABLE is also supported for partitioned tables. You can use ALTER\nTABLE ... OPTIMIZE PARTITION to optimize one or more partitions.\n\nYou can use OPTIMIZE TABLE to reclaim the unused space and to defragment the\ndata file. With other storage engines, OPTIMIZE TABLE does nothing by default,\nand returns this message: \" The storage engine for the table doesn\'t support\noptimize\". However, if the server has been started with the --skip-new option,\nOPTIMIZE TABLE is linked to ALTER TABLE, and recreates the table. This\noperation frees the unused space and updates index statistics.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nIf a MyISAM table is fragmented, concurrent inserts will not be performed\nuntil an OPTIMIZE TABLE statement is executed on that table, unless the\nconcurrent_insert server system variable is set to ALWAYS.\n\nUpdating an InnoDB fulltext index\n---------------------------------\n\nWhen rows are added or deleted to an InnoDB fulltext index, the index is not\nimmediately re-organized, as this can be an expensive operation. Change\nstatistics are stored in a separate location . The fulltext index is only\nfully re-organized when an OPTIMIZE TABLE statement is run.\n\nBy default, an OPTIMIZE TABLE will defragment a table. In order to use it to\nupdate fulltext index statistics, the innodb_optimize_fulltext_only system\nvariable must be set to 1. This is intended to be a temporary setting, and\nshould be reset to 0 once the fulltext index has been re-organized.\n\nSince fulltext re-organization can take a long time, the\ninnodb_ft_num_word_optimize variable limits the re-organization to a number of\nwords (2000 by default). You can run multiple OPTIMIZE statements to fully\nre-organize the index.\n\nDefragmenting InnoDB tablespaces\n--------------------------------\n\nMariaDB 10.1.1 merged the Facebook/Kakao defragmentation patch, allowing one\nto use OPTIMIZE TABLE to defragment InnoDB tablespaces. For this functionality\nto be enabled, the innodb_defragment system variable must be enabled. No new\ntables are created and there is no need to copy data from old tables to new\ntables. Instead, this feature loads n pages (determined by\ninnodb-defragment-n-pages) and tries to move records so that pages would be\nfull of records and then frees pages that are fully empty after the operation.\nNote that tablespace files (including ibdata1) will not shrink as the result\nof defragmentation, but one will get better memory utilization in the InnoDB\nbuffer pool as there are fewer data pages in use.\n\nSee Defragmenting InnoDB Tablespaces for more details.\n\nURL: https://mariadb.com/kb/en/optimize-table/','','https://mariadb.com/kb/en/optimize-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (248,21,'REPAIR TABLE','Syntax\n------\n\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n  tbl_name [, tbl_name] ...\n  [QUICK] [EXTENDED] [USE_FRM]\n\nDescription\n-----------\n\nREPAIR TABLE repairs a possibly corrupted table. By default, it has the same\neffect as\n\nmyisamchk --recover tbl_name\n\nor\n\naria_chk --recover tbl_name\n\nSee aria_chk and myisamchk for more.\n\nREPAIR TABLE works for Archive, Aria, CSV and MyISAM tables. For InnoDB, see\nrecovery modes. For CSV, see also Checking and Repairing CSV Tables. For\nArchive, this statement also improves compression. If the storage engine does\nnot support this statement, a warning is issued.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, REPAIR TABLE statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nFrom MariaDB 10.3.19, REPAIR TABLE statements are not logged to the binary log\nif read_only is set. See also Read-Only Replicas.\n\nWhen an index is recreated, the storage engine may use a configurable buffer\nin the process. Incrementing the buffer speeds up the index creation. Aria and\nMyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for ALTER TABLE.\n\nREPAIR TABLE is also supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nALTER TABLE ... REPAIR PARTITION can be used to repair one or more partitions.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nURL: https://mariadb.com/kb/en/repair-table/','','https://mariadb.com/kb/en/repair-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (249,21,'REPAIR VIEW','Syntax\n------\n\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] VIEW  view_name[, view_name] ... [FROM\nMYSQL]\n\nDescription\n-----------\n\nThe REPAIR VIEW statement was introduced to assist with fixing MDEV-6916, an\nissue introduced in MariaDB 5.2 where the view algorithms were swapped\ncompared to their MySQL on disk representation. It checks whether the view\nalgorithm is correct. It is run as part of mysql_upgrade, and should not\nnormally be required in regular use.\n\nBy default it corrects the checksum and if necessary adds the mariadb-version\nfield. If the optional FROM MYSQL clause is used, and no mariadb-version field\nis present, the MERGE and TEMPTABLE algorithms are toggled.\n\nBy default, REPAIR VIEW statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nURL: https://mariadb.com/kb/en/repair-view/','','https://mariadb.com/kb/en/repair-view/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (250,22,'mysql.func Table','The mysql.func table stores information about user-defined functions (UDFs)\ncreated with the CREATE FUNCTION UDF statement.\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, this table uses the Aria storage engine.\n\nMariaDB until 10.3\n------------------\nIn MariaDB 10.3 and before, this table uses the MyISAM storage engine.\n\nThe mysql.func table contains the following fields:\n\n+----------+---------+---------+-------+--------------+---------------------+\n| Field    | Type    | Null    | Key   | Default      | Description         |\n+----------+---------+---------+-------+--------------+---------------------+\n| name     | char(64 | NO      | PRI   |              | UDF name            |\n|          |         |         |       |              |                     |\n+----------+---------+---------+-------+--------------+---------------------+\n| ret      | tinyint | NO      |       | 0            |                     |\n|          | 1)      |         |       |              |                     |\n+----------+---------+---------+-------+--------------+---------------------+\n| dl       | char(12 | NO      |       |              | Shared library name |\n|          | )       |         |       |              |                     |\n+----------+---------+---------+-------+--------------+---------------------+\n| type     | enum(\'f | NO      |       | NULL         | Type, either        |\n|          | nction\' |         |       |              | function or         |\n|          | \'aggreg |         |       |              | aggregate.          |\n|          | te\')    |         |       |              | Aggregate           |\n|          |         |         |       |              | functions are       |\n|          |         |         |       |              | summary functions   |\n|          |         |         |       |              | such as SUM() and   |\n|          |         |         |       |              | AVG().              |\n+----------+---------+---------+-------+--------------+---------------------+\n\nExample\n-------\n\nSELECT * FROM mysql.func;\n+------------------------------+-----+--------------+-----------+\n| name                         | ret | dl           | type      |\n+------------------------------+-----+--------------+-----------+\n| spider_direct_sql            |   2 | ha_spider.so | function  |\n| spider_bg_direct_sql         |   2 | ha_spider.so | aggregate |\n| spider_ping_table            |   2 | ha_spider.so | function  |\n| spider_copy_tables           |   2 | ha_spider.so | function  |\n| spider_flush_table_mon_cache |   2 | ha_spider.so | function  |\n+------------------------------+-----+--------------+-----------+\n\nURL: https://mariadb.com/kb/en/mysqlfunc-table/','','https://mariadb.com/kb/en/mysqlfunc-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (251,22,'CREATE FUNCTION UDF','Syntax\n------\n\nCREATE [OR REPLACE] [AGGREGATE] FUNCTION [IF NOT EXISTS] function_name\n  RETURNS {STRING|INTEGER|REAL|DECIMAL}\n  SONAME shared_library_name\n\nDescription\n-----------\n\nA user-defined function (UDF) is a way to extend MariaDB with a new function\nthat works like a native (built-in) MariaDB function such as ABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to invoke the\nfunction.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary becauseCREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and shared\nlibrary name. If you do not have this table, you should run the mysql_upgrade\ncommand to create it.\n\nUDFs need to be written in C, C++ or another language that uses C calling\nconventions, MariaDB needs to have been dynamically compiled, and your\noperating system must support dynamic loading.\n\nFor an example, see sql/udf_example.cc in the source tree. For a collection of\nexisting UDFs see http://www.mysqludf.org/.\n\nStatements making use of user-defined functions are not safe for replication.\n\nFor creating a stored function as opposed to a user-defined function, see\nCREATE FUNCTION.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nRETURNS\n-------\n\nThe RETURNS clause indicates the type of the function\'s return value, and can\nbe one of STRING, INTEGER, REAL or DECIMAL. DECIMAL functions currently return\nstring values and should be written like STRING functions.\n\nshared_library_name\n-------------------\n\nshared_library_name is the basename of the shared object file that contains\nthe code that implements the function. The file must be located in the plugin\ndirectory. This directory is given by the value of the plugin_dir system\nvariable. Note that before MariaDB/MySQL 5.1, the shared object could be\nlocated in any directory that was searched by your system\'s dynamic linker.\n\nAGGREGATE\n---------\n\nAggregate functions are summary functions such as SUM() and AVG().\n\nMariaDB starting with 10.4\n--------------------------\nAggregate UDF functions can be used as window functions.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.3\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION name ...;\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified function already exists. Cannot be used together\nwith OR REPLACE.\n\nUpgrading a UDF\n---------------\n\nTo upgrade the UDF\'s shared library, first run a DROP FUNCTION statement, then\nupgrade the shared library and finally run the CREATE FUNCTION statement. If\nyou upgrade without following this process, you may crash the server.\n\nExamples\n--------\n\nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME \'ha_connect.so\';\nQuery OK, 0 rows affected (0.00 sec)\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME \'ha_connect.so\';\nERROR 1125 (HY000): Function \'jsoncontains_path\' already exists\n\nCREATE OR REPLACE FUNCTION jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE FUNCTION IF NOT EXISTS jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------+\n| Level | Code | Message                                     |\n+-------+------+---------------------------------------------+\n| Note  | 1125 | Function \'jsoncontains_path\' already exists |\n+-------+------+---------------------------------------------+\n\nURL: https://mariadb.com/kb/en/create-function-udf/','','https://mariadb.com/kb/en/create-function-udf/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (252,22,'DROP FUNCTION UDF','Syntax\n------\n\nDROP FUNCTION [IF EXISTS] function_name\n\nDescription\n-----------\n\nThis statement drops the user-defined function (UDF) named function_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql database.\nThis is because DROP FUNCTION removes the row from the mysql.func system table\nthat records the function\'s name, type and shared library name.\n\nFor dropping a stored function, see DROP FUNCTION.\n\nUpgrading a UDF\n---------------\n\nTo upgrade the UDF\'s shared library, first run a DROP FUNCTION statement, then\nupgrade the shared library and finally run the CREATE FUNCTION statement. If\nyou upgrade without following this process, you may crash the server.\n\nExamples\n--------\n\nDROP FUNCTION jsoncontains_path;\n\nIF EXISTS:\n\nDROP FUNCTION jsoncontains_path;\nERROR 1305 (42000): FUNCTION test.jsoncontains_path does not exist\n\nDROP FUNCTION IF EXISTS jsoncontains_path;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------------------+\n| Level | Code | Message                                        |\n+-------+------+------------------------------------------------+\n| Note  | 1305 | FUNCTION test.jsoncontains_path does not exist |\n+-------+------+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-function-udf/','','https://mariadb.com/kb/en/drop-function-udf/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (253,22,'Creating User-Defined Functions','User-defined functions allow MariaDB to be extended with a new function that\nworks like a native (built-in) MariaDB function such as ABS() or CONCAT().\nThere are alternative ways to add a new function: writing a native function\n(which requires modifying and compiling the server source code), or writing a\nstored function.\n\nStatements making use of user-defined functions are not safe for replication.\n\nFunctions are written in C or C++, and to make use of them, the operating\nsystem must support dynamic loading.\n\nEach new SQL function requires corresponding functions written in C/C++. In\nthe list below, at least the main function - x() - and one other, are\nrequired. x should be replaced by the name of the function you are creating.\n\nAll functions need to be thread-safe, so not global or static variables that\nchange can be allocated. Memory is allocated in x_init()/ and freed in\nx_deinit().\n\nSimple Functions\n----------------\n\nx()\n---\n\nRequired for all UDFs; this is where the results are calculated.\n\n+------------------------------------------+----------------------------------+\n| C/C++ type                               | SQL type                         |\n+------------------------------------------+----------------------------------+\n| char *                                   | STRING                           |\n+------------------------------------------+----------------------------------+\n| long long                                | INTEGER                          |\n+------------------------------------------+----------------------------------+\n| double                                   | REAL                             |\n+------------------------------------------+----------------------------------+\n\nDECIMAL functions return string values, and so should be written accordingly.\nIt is not possible to create ROW functions.\n\nx_init()\n--------\n\nInitialization function for x(). Can be used for the following:\n\n* Check the number of arguments to X() (the SQL equivalent).\n* Verify the argument types, or to force arguments to be of a particular type\nafter the function is called.\n* Specify whether the result can be NULL.\n* Specify the maximum result length.\n* For REAL functions, specify the maximum number of decimals for the result.\n* Allocate any required memory.\n\nx_deinit()\n----------\n\nDe-initialization function for x(). Used to de-allocate memory that was\nallocated in x_init().\n\nDescription\n-----------\n\nEach time the SQL function X() is called:\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* If there is no x_init() function, or it has been called and did not return\nan error, x() is then called once per row.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n* See User-defined Functions Calling Sequences for more details on the\nfunctions.\n\nAggregate Functions\n-------------------\n\nThe following functions are required for aggregate functions, such as AVG()\nand SUM(). When using CREATE FUNCTION, the AGGREGATE keyword is required.\n\nx_clear()\n---------\n\nUsed to reset the current aggregate, but without inserting the argument as the\ninitial aggregate value for the new group.\n\nx_add()\n-------\n\nUsed to add the argument to the current aggregate.\n\nx_remove()\n----------\n\nStarting from MariaDB 10.4, improves the support of window functions (so it is\nnot obligatory to add it) and should remove the argument from the current\naggregate.\n\nDescription\n-----------\n\nEach time the aggregate SQL function X() is called:\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* If there is no x_init() function, or it has been called and did not return\nan error, x() is then called once per row.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* The table is sorted according to the GROUP BY expression.\n* x_clear() is called for the first row of each new group.\n* x_add() is called once per row for each row in the same group.\n* x() is called when the group changes, or after the last row, to get the\naggregate result. \n* The latter three steps are repeated until all rows have been processed.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n\nExamples\n--------\n\nFor an example, see sql/udf_example.cc in the source tree. For a collection of\nexisting UDFs see https://github.com/mysqludf.\n\nURL: https://mariadb.com/kb/en/creating-user-defined-functions/','','https://mariadb.com/kb/en/creating-user-defined-functions/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (254,22,'User-Defined Functions Calling Sequences','The functions described in Creating User-defined Functions are expanded on\nthis page. They are declared as follows:\n\nSimple Functions\n----------------\n\nx()\n---\n\nIf x() returns an integer, it is declared as follows:\n\nlong long x(UDF_INIT *initid, UDF_ARGS *args,\n       char *is_null, char *error);\n\nIf x() returns a string (DECIMAL functions also return string values), it is\ndeclared as follows:\n\nchar *x(UDF_INIT *initid, UDF_ARGS *args,\n     char *result, unsigned long *length,\n     char *is_null, char *error);\n\nIf x() returns a real, it is declared as follows:\n\ndouble x(UDF_INIT *initid, UDF_ARGS *args,\n       char *is_null, char *error);\n\nx_init()\n--------\n\nmy_bool x_init(UDF_INIT *initid, UDF_ARGS *args, char *message);\n\nx_deinit()\n----------\n\nvoid x_deinit(UDF_INIT *initid);\n\nDescription\n-----------\n\ninitid is a parameter passed to all three functions that points to a UDF_INIT\nstructure, used for communicating information between the functions. Its\nstructure members are:\n\n* my_bool maybe_null\nmaybe_null should be set to 1 if x_init can return a NULL value, Defaults to 1\nif any arguments are declared maybe_null.\n\n* unsigned int decimals\nNumber of decimals after the decimal point. The default, if an explicit number\nof decimals is passed in the arguments to the main function, is the maximum\nnumber of decimals, so if 9.5, 9.55 and 9.555 are passed to the function, the\ndefault would be three (based on 9.555, the maximum).  If there are no\nexplicit number of decimals, the default is set to 31, or one more than the\nmaximum for the DOUBLE, FLOAT and DECIMAL types. This default can be changed\nin the function to suit the actual calculation.\n\n* unsigned int max_length\nMaximum length of the result. For integers, the default is 21. For strings,\nthe length of the longest argument. For reals, the default is 13 plus the\nnumber of decimals indicated by initid->decimals. The length includes any\nsigns or decimal points. Can also be set to 65KB or 16MB in order to return a\nBLOB. The memory remains unallocated, but this is used to decide on the data\ntype to use if the data needs to be temporarily stored.\n\n* char *ptr\nA pointer for use as required by the function. Commonly, initid->ptr is used\nto communicate allocated memory, with x_init() allocating the memory and\nassigning it to this pointer, x() using it, and x_deinit() de-allocating it.\n\n* my_bool const_item\nShould be set to 1 in x_init() if x() always returns the same value, otherwise\n0.\n\nAggregate Functions\n-------------------\n\nx_clear()\n---------\n\nx_clear() is a required function for aggregate functions, and is declared as\nfollows:\n\nvoid x_clear(UDF_INIT *initid, char *is_null, char *error);\n\nIt is called when the summary results need to be reset, that is at the\nbeginning of each new group. but also to reset the values when there were no\nmatching rows.\n\nis_null is set to point to CHAR(0) before calling x_clear().\n\nIn the case of an error, you can store the value to which the error argument\npoints (a single-byte variable, not a string string buffer) in the variable.\n\nx_reset()\n---------\n\nx_reset() is declared as follows:\n\nvoid x_reset(UDF_INIT *initid, UDF_ARGS *args,\n       char *is_null, char *error);\n\nIt is called on finding the first row in a new group. Should reset the summary\nvariables, and then use UDF_ARGS as the first value in the group\'s internal\nsummary value. The function is not required if the UDF interface uses\nx_clear().\n\nx_add()\n-------\n\nx_add() is declared as follows:\n\nvoid x_add(UDF_INIT *initid, UDF_ARGS *args,\n      char *is_null, char *error);\n\nIt is called for all rows belonging to the same group, and should be used to\nadd the value in UDF_ARGS to the internal summary variable.\n\nx_remove()\n----------\n\nx_remove() was added in MariaDB 10.4 and is declared as follows (same as\nx_add()):\n\nvoid x_remove(UDF_INIT* initid, UDF_ARGS* args,\n       char* is_null, char *error );\n\nIt adds more efficient support of aggregate UDFs as window functions.\nx_remove() should \"subtract\" the row (reverse x_add()). In MariaDB 10.4\naggregate UDFs will work as WINDOW functions without x_remove() but it will\nnot be so efficient.\n\nIf x_remove() supported (defined) detected automatically.\n\nURL: https://mariadb.com/kb/en/user-defined-functions-calling-sequences/','','https://mariadb.com/kb/en/user-defined-functions-calling-sequences/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,22,'User-Defined Functions Security','The MariaDB server imposes a number of limitations on user-defined functions\nfor security purposes.\n\n* The INSERT privilege for the mysql database is required to run CREATE\nFUNCTION, as a record will be added to the mysql.func-table.\n* The DELETE privilege for the mysql database is required to run DROP FUNCTION\nas the corresponding record will be removed from the mysql.func-table.\n* UDF object files can only be placed in the plugin directory, as specified by\nthe value of the plugin_dir system variable.\n* At least one symbol, beyond the required x() - corresponding to an SQL\nfunction X()) - is required. These can be x_init(), x_deinit(), xxx_reset(),\nx_clear() and x_add() functions (see Creating User-defined Functions). The\nallow-suspicious-udfs mysqld option (by default unset) provides a workaround,\npermitting only one symbol to be used. This is not recommended, as it opens\nthe possibility of loading shared objects that are not legitimate user-defined\nfunctions.\n\nURL: https://mariadb.com/kb/en/user-defined-functions-security/','','https://mariadb.com/kb/en/user-defined-functions-security/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (256,23,'Numeric Data Type Overview','There are a number of numeric data types:\n\n* TINYINT\n* BOOLEAN - Synonym for TINYINT(1)\n* INT1 - Synonym for TINYINT\n* SMALLINT\n* INT2 - Synonym for SMALLINT\n* MEDIUMINT\n* INT3 - Synonym for MEDIUMINT\n* INT, INTEGER\n* INT4 - Synonym for INT\n* BIGINT\n* INT8 - Synonym for BIGINT\n* DECIMAL, DEC, NUMERIC, FIXED\n* FLOAT\n* DOUBLE, DOUBLE PRECISION, REAL\n* BIT\n\nSee the specific articles for detailed information on each.\n\nSIGNED, UNSIGNED and ZEROFILL\n-----------------------------\n\nMost numeric types can be defined as SIGNED, UNSIGNED or ZEROFILL, for example:\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nIf SIGNED, or no attribute, is specified, a portion of the numeric type will\nbe reserved for the sign (plus or minus). For example, a TINYINT SIGNED can\nrange from -128 to 127.\n\nIf UNSIGNED is specified, no portion of the numeric type is reserved for the\nsign, so for integer types range can be larger. For example, a TINYINT\nUNSIGNED can range from 0 to 255. Floating point and fixed-point types also\ncan be UNSIGNED, but this only prevents negative values from being stored and\ndoesn\'t alter the range.\n\nIf ZEROFILL is specified, the column will be set to UNSIGNED and the spaces\nused by default to pad the field are replaced with zeros. ZEROFILL is ignored\nin expressions or as part of a UNION. ZEROFILL is a non-standard MySQL and\nMariaDB enhancement.\n\nNote that although the preferred syntax indicates that the attributes are\nexclusive, more than one attribute can be specified.\n\nUntil MariaDB 10.2.7 (MDEV-8659), any combination of the attributes could be\nused in any order, with duplicates. In this case:\n\n* the presence of ZEROFILL makes the column UNSIGNED ZEROFILL.\n* the presence of UNSIGNED makes the column UNSIGNED.\n\nFrom MariaDB 10.2.8, only the following combinations are supported:\n\n* SIGNED\n* UNSIGNED\n* ZEROFILL\n* UNSIGNED ZEROFILL\n* ZEROFILL UNSIGNED\n\nThe latter two should be replaced with simply ZEROFILL, but are still accepted\nby the parser.\n\nExamples\n--------\n\nCREATE TABLE zf (\n i1 TINYINT SIGNED,\n i2 TINYINT UNSIGNED,\n i3 TINYINT ZEROFILL\n);\n\nINSERT INTO zf VALUES (2,2,2);\n\nSELECT * FROM zf;\n+------+------+------+\n| i1   | i2   | i3   |\n+------+------+------+\n|    2 |    2 |  002 |\n+------+------+------+\n\nRange\n-----\n\nWhen attempting to add a value that is out of the valid range for the numeric\ntype, MariaDB will react depending on the strict SQL_MODE setting.\n\nIf strict_mode has been set (the default from MariaDB 10.2.4), MariaDB will\nreturn an error.\n\nIf strict_mode has not been set (the default until MariaDB 10.2.3), MariaDB\nwill adjust the number to fit in the field, returning a warning.\n\nExamples\n--------\n\nWith strict_mode set:\n\nSHOW VARIABLES LIKE \'sql_mode\';\n+---------------+--------------------------------------------------------------\n----------------------------+\n| Variable_name | Value                                                       \n              |\n+---------------+--------------------------------------------------------------\n----------------------------+\n| sql_mode      |\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SU\nSTITUTION |\n+---------------+--------------------------------------------------------------\n----------------------------+\n\nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED);\n\nINSERT INTO ranges VALUES (257,257,257);\nERROR 1264 (22003): Out of range value for column \'i1\' at row 1\n\nSELECT * FROM ranges;\nEmpty set (0.10 sec)\n\nWith strict_mode unset:\n\nSHOW VARIABLES LIKE \'sql_mode%\';\n+---------------+-------+\n| Variable_name | Value |\n+---------------+-------+\n| sql_mode      |       |\n+---------------+-------+\n\nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED);\n\nINSERT INTO ranges VALUES (257,257,257);\nQuery OK, 1 row affected, 2 warnings (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level   | Code | Message                                     |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'i1\' at row 1 |\n| Warning | 1264 | Out of range value for column \'i3\' at row 1 |\n+---------+------+---------------------------------------------+\n2 rows in set (0.00 sec)\n\nSELECT * FROM ranges;\n+------+------+------+\n| i1   | i2   | i3   |\n+------+------+------+\n|  127 |  257 |  255 |\n+------+------+------+\n\nAuto_increment\n--------------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new\nrows. For more details, see auto_increment.\n\nURL: https://mariadb.com/kb/en/numeric-data-type-overview/','','https://mariadb.com/kb/en/numeric-data-type-overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,23,'TINYINT','Syntax\n------\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA very small integer. The signed range is -128 to 127. The unsigned range is 0\nto 255. For details on the attributes, see Numeric Data Type Overview.\n\nINT1 is a synonym for TINYINT. BOOL and BOOLEAN are synonyms for TINYINT(1).\n\nExamples\n--------\n\nCREATE TABLE tinyints (a TINYINT,b TINYINT UNSIGNED,c TINYINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO tinyints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,10);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |   10 |  010 |\n+------+------+------+\n\nINSERT INTO tinyints VALUES (128,128,128);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO tinyints VALUES (127,128,128);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |   10 |  010 |\n|  127 |  128 |  128 |\n+------+------+------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO tinyints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.11 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,10);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |    0 |  000 |\n|  -10 |   10 |  000 |\n|  -10 |   10 |  010 |\n+------+------+------+\n\nINSERT INTO tinyints VALUES (128,128,128);\nQuery OK, 1 row affected, 1 warning (0.19 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO tinyints VALUES (127,128,128);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |    0 |  000 |\n|  -10 |   10 |  000 |\n|  -10 |   10 |  010 |\n|  127 |  128 |  128 |\n|  127 |  128 |  128 |\n+------+------+------+\n\nURL: https://mariadb.com/kb/en/tinyint/','','https://mariadb.com/kb/en/tinyint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (258,23,'BOOLEAN','Syntax\n------\n\nBOOL, BOOLEAN\n\nDescription\n-----------\n\nThese types are synonyms for TINYINT(1). A value of zero is considered false.\nNon-zero values are considered true.\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0. See Boolean\nLiterals, as well as the IS operator for testing values against a boolean.\n\nExamples\n--------\n\nCREATE TABLE boo (i BOOLEAN);\n\nDESC boo;\n+-------+------------+------+-----+---------+-------+\n| Field | Type       | Null | Key | Default | Extra |\n+-------+------------+------+-----+---------+-------+\n| i     | tinyint(1) | YES  |     | NULL    |       |\n+-------+------------+------+-----+---------+-------+\n\nSELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false                  |\n+------------------------+\n\nSELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true                   |\n+------------------------+\n\nSELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true                   |\n+------------------------+\n\nTRUE and FALSE as aliases for 1 and 0:\n\nSELECT IF(0 = FALSE, \'true\', \'false\');\n\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true                           |\n+--------------------------------+\n\nSELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true                          |\n+-------------------------------+\n\nSELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false                         |\n+-------------------------------+\n\nSELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false                          |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: https://mariadb.com/kb/en/boolean/','','https://mariadb.com/kb/en/boolean/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (259,23,'SMALLINT','Syntax\n------\n\nSMALLINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small integer. The signed range is -32768 to 32767. The unsigned range is 0\nto 65535.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so\nthat the SMALLINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nINT2 is a synonym for SMALLINT.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE smallints (a SMALLINT,b SMALLINT UNSIGNED,c SMALLINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO smallints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,10);\n\nINSERT INTO smallints VALUES (32768,32768,32768);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO smallints VALUES (32767,32768,32768);\n\nSELECT * FROM smallints;\n+-------+-------+-------+\n| a     | b     | c     |\n+-------+-------+-------+\n|   -10 |    10 | 00010 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO smallints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.09 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,10);\n\nINSERT INTO smallints VALUES (32768,32768,32768);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO smallints VALUES (32767,32768,32768);\n\nSELECT * FROM smallints;\n+-------+-------+-------+\n| a     | b     | c     |\n+-------+-------+-------+\n|   -10 |     0 | 00000 |\n|   -10 |    10 | 00000 |\n|   -10 |    10 | 00010 |\n| 32767 | 32768 | 32768 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n\nURL: https://mariadb.com/kb/en/smallint/','','https://mariadb.com/kb/en/smallint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (260,23,'MEDIUMINT','Syntax\n------\n\nMEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The unsigned\nrange is 0 to 16777215.\n\nZEROFILL pads the integer with zeroes and assumes UNSIGNED (even if UNSIGNED\nis not specified).\n\nINT3 is a synonym for MEDIUMINT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c MEDIUMINT\nZEROFILL);\n\nDESCRIBE mediumints;\n+-------+--------------------------------+------+-----+---------+-------+\n| Field | Type                           | Null | Key | Default | Extra |\n+-------+--------------------------------+------+-----+---------+-------+\n| a     | mediumint(9)                   | YES  |     | NULL    |       |\n| b     | mediumint(8) unsigned          | YES  |     | NULL    |       |\n| c     | mediumint(8) unsigned zerofill | YES  |     | NULL    |       |\n+-------+--------------------------------+------+-----+---------+-------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO mediumints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,10);\n\nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n\nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a       | b       | c        |\n+---------+---------+----------+\n|     -10 |      10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO mediumints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.05 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,10);\n\nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nQuery OK, 1 row affected, 1 warning (0.05 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n\nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a       | b       | c        |\n+---------+---------+----------+\n|     -10 |       0 | 00000000 |\n|     -10 |       0 | 00000000 |\n|     -10 |      10 | 00000000 |\n|     -10 |      10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n\nURL: https://mariadb.com/kb/en/mediumint/','','https://mariadb.com/kb/en/mediumint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (261,23,'INT','Syntax\n------\n\nINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\nINTEGER[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size integer. When marked UNSIGNED, it ranges from 0 to 4294967295,\notherwise its range is -2147483648 to 2147483647 (SIGNED is the default). If a\ncolumn has been set to ZEROFILL, all values will be prepended by zeros so that\nthe INT value contains a number of M digits. INTEGER is a synonym for INT.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nINT4 is a synonym for INT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE ints (a INT,b INT UNSIGNED,c INT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO ints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO ints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO ints VALUES (-10,10,10);\n\nINSERT INTO ints VALUES (2147483648,2147483648,2147483648);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO ints VALUES (2147483647,2147483648,2147483648);\n\nSELECT * FROM ints;\n+------------+------------+------------+\n| a          | b          | c          |\n+------------+------------+------------+\n|        -10 |         10 | 0000000010 |\n| 2147483647 | 2147483648 | 2147483648 |\n+------------+------------+------------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO ints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.10 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO ints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO ints VALUES (-10,10,10);\n\nINSERT INTO ints VALUES (2147483648,2147483648,2147483648);\nQuery OK, 1 row affected, 1 warning (0.07 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO ints VALUES (2147483647,2147483648,2147483648);\n\nSELECT * FROM ints;\n+------------+------------+------------+\n| a          | b          | c          |\n+------------+------------+------------+\n|        -10 |          0 | 0000000000 |\n|        -10 |         10 | 0000000000 |\n|        -10 |         10 | 0000000010 |\n| 2147483647 | 2147483648 | 2147483648 |\n| 2147483647 | 2147483648 | 2147483648 |\n+------------+------------+------------+\n\nURL: https://mariadb.com/kb/en/int/','','https://mariadb.com/kb/en/int/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (262,23,'BIGINT','Syntax\n------\n\nBIGINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so\nthat the BIGINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nSERIAL is an alias for:\n\nBIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE\n\nINT8 is a synonym for BIGINT.\n\nExamples\n--------\n\nCREATE TABLE bigints (a BIGINT,b BIGINT UNSIGNED,c BIGINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a                   | b                   | c                    |\n+---------------------+---------------------+----------------------+\n|                 -10 |                  10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nQuery OK, 1 row affected, 1 warning (0.07 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a                   | b                   | c                    |\n+---------------------+---------------------+----------------------+\n|                 -10 |                   0 | 00000000000000000000 |\n|                 -10 |                  10 | 00000000000000000000 |\n|                 -10 |                  10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\nURL: https://mariadb.com/kb/en/bigint/','','https://mariadb.com/kb/en/bigint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (263,23,'DECIMAL','Syntax\n------\n\nDECIMAL[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA packed \"exact\" fixed-point number. M is the total number of digits (the\nprecision) and D is the number of digits after the decimal point (the scale).\n\n* The decimal point and (for negative numbers) the \"-\" sign are not\ncounted in M. \n* If D is 0, values have no decimal point or fractional\npart and on INSERT the value will be rounded to the nearest DECIMAL. \n* The maximum number of digits (M) for DECIMAL is 65. \n* The maximum number of supported decimals (D) is 30 before MariadB 10.2.1 and\n38 afterwards. \n* If D is omitted, the default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of\ndigits specified by M.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with a\nprecision of 65 digits.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nDEC, NUMERIC and FIXED are synonyms, as well as NUMBER in Oracle mode from\nMariaDB 10.3.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DECIMAL UNSIGNED ZEROFILL);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4.0),(5.2),(5.7);\nQuery OK, 6 rows affected, 2 warnings (0.16 sec)\nRecords: 6  Duplicates: 0  Warnings: 2\n\nNote (Code 1265): Data truncated for column \'d\' at row 5\nNote (Code 1265): Data truncated for column \'d\' at row 6\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n+------------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO t1 VALUES (-7);\nERROR 1264 (22003): Out of range value for column \'d\' at row 1\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO t1 VALUES (-7);\nQuery OK, 1 row affected, 1 warning (0.02 sec)\nWarning (Code 1264): Out of range value for column \'d\' at row 1\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n| 0000000000 |\n+------------+\n\nURL: https://mariadb.com/kb/en/decimal/','','https://mariadb.com/kb/en/decimal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (264,23,'FLOAT','Syntax\n------\n\nFLOAT[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small (single-precision) floating-point number (see DOUBLE for a\nregular-size floating point number). Allowable values are:\n\n* -3.402823466E+38 to -1.175494351E-38\n* 0\n* 1.175494351E-38 to 3.402823466E+38.\n\nThese are the theoretical limits, based on the IEEE standard. The actual range\nmight be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the\ndecimal point. If M and D are omitted, values are stored to the limits allowed\nby the hardware. A single-precision floating-point number is accurate to\napproximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all calculations\nin MariaDB are done with double precision. See Floating Point Accuracy.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nURL: https://mariadb.com/kb/en/float/','','https://mariadb.com/kb/en/float/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (265,23,'DOUBLE','Syntax\n------\n\nDOUBLE[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nDOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nREAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size (double-precision) floating-point number (see FLOAT for a\nsingle-precision floating-point number).\n\nAllowable values are:\n\n* -1.7976931348623157E+308 to -2.2250738585072014E-308\n* 0\n* 2.2250738585072014E-308 to 1.7976931348623157E+308\n\nThese are the theoretical limits, based on the IEEE standard. The actual range\nmight be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the\ndecimal point. If M and D are omitted, values are stored to the limits allowed\nby the hardware. A double-precision floating-point number is accurate to\napproximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of\ndigits specified by M.\n\nREAL and DOUBLE PRECISION are synonyms, unless the REAL_AS_FLOAT SQL mode is\nenabled, in which case REAL is a synonym for FLOAT rather than DOUBLE.\n\nSee Floating Point Accuracy for issues when using floating-point numbers.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DOUBLE(5,0) zerofill);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\n\nSELECT * FROM t1;\n+-------+\n| d     |\n+-------+\n| 00001 |\n| 00002 |\n| 00003 |\n| 00004 |\n+-------+\n\nURL: https://mariadb.com/kb/en/double/','','https://mariadb.com/kb/en/double/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (266,23,'BIT','Syntax\n------\n\nBIT[(M)]\n\nDescription\n-----------\n\nA bit-field type. M indicates the number of bits per value, from 1 to 64. The\ndefault is 1 if M is omitted.\n\nBit values can be inserted with b\'value\' notation, where value is the bit\nvalue in 0\'s and 1\'s.\n\nBit fields are automatically zero-padded from the left to the full length of\nthe bit, so for example in a BIT(4) field, \'10\' is equivalent to \'0010\'.\n\nBits are returned as binary, so to display them, either add 0, or use a\nfunction such as HEX, OCT or BIN to convert them.\n\nExamples\n--------\n\nCREATE TABLE b ( b1 BIT(8) );\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO b VALUES (b\'11111111\');\n\nINSERT INTO b VALUES (b\'01010101\');\n\nINSERT INTO b VALUES (b\'1111111111111\');\nERROR 1406 (22001): Data too long for column \'b1\' at row 1\n\nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1)  |\n+------+---------+---------+----------+\n|  255 | FF      | 377     | 11111111 |\n|   85 | 55      | 125     | 1010101  |\n+------+---------+---------+----------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO b VALUES (b\'11111111\'),(b\'01010101\'),(b\'1111111111111\');\nQuery OK, 3 rows affected, 1 warning (0.10 sec)\nRecords: 3  Duplicates: 0  Warnings: 1\n\nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level   | Code | Message                                     |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'b1\' at row 3 |\n+---------+------+---------------------------------------------+\n\nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1)  |\n+------+---------+---------+----------+\n|  255 | FF      | 377     | 11111111 |\n|   85 | 55      | 125     | 1010101  |\n|  255 | FF      | 377     | 11111111 |\n+------+---------+---------+----------+\n\nURL: https://mariadb.com/kb/en/bit/','','https://mariadb.com/kb/en/bit/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,23,'Floating-point Accuracy','Due to their nature, not all floating-point numbers can be stored with exact\nprecision. Hardware architecture, the CPU or even the compiler version and\noptimization level may affect the precision.\n\nIf you are comparing DOUBLEs or FLOATs with numeric decimals, it is not safe\nto use the equality operator.\n\nSometimes, changing a floating-point number from single-precision (FLOAT) to\ndouble-precision (DOUBLE) will fix the problem.\n\nExample\n-------\n\nf1, f2 and f3 have seemingly identical values across each row, but due to\nfloating point accuracy, the results may be unexpected.\n\nCREATE TABLE fpn (id INT, f1 FLOAT, f2 DOUBLE, f3 DECIMAL (10,3));\nINSERT INTO fpn VALUES (1,2,2,2),(2,0.1,0.1,0.1);\n\nSELECT * FROM fpn WHERE f1*f1 = f2*f2;\n+------+------+------+-------+\n| id   | f1   | f2   | f3    |\n+------+------+------+-------+\n|    1 |    2 |    2 | 2.000 |\n+------+------+------+-------+\n\nThe reason why only one instead of two rows was returned becomes clear when we\nsee how the floating point squares were evaluated.\n\nSELECT f1*f1, f2*f2, f3*f3 FROM fpn;\n+----------------------+----------------------+----------+\n| f1*f1                | f2*f2                | f3*f3    |\n+----------------------+----------------------+----------+\n|                    4 |                    4 | 4.000000 |\n| 0.010000000298023226 | 0.010000000000000002 | 0.010000 |\n+----------------------+----------------------+----------+\n\nURL: https://mariadb.com/kb/en/floating-point-accuracy/','','https://mariadb.com/kb/en/floating-point-accuracy/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (268,23,'BINARY','This page describes the BINARY data type. For details about the operator, see\nBinary Operator.\n\nSyntax\n------\n\nBINARY(M)\n\nDescription\n-----------\n\nThe BINARY type is similar to the CHAR type, but stores binary byte strings\nrather than non-binary character strings. M represents the column length in\nbytes.\n\nIt contains no character set, and comparison and sorting are based on the\nnumeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the\nextra characters will be dropped with a warning. If strict mode is enabled, an\nerror will occur.\n\nBINARY values are right-padded with 0x00 (the zero byte) to the specified\nlength when inserted. The padding is not removed on select, so this needs to\nbe taken into account when sorting and comparing, where all bytes are\nsignificant. The zero byte, 0x00 is less than a space for comparison purposes.\n\nExamples\n--------\n\nInserting too many characters, first with strict mode off, then with it on:\n\nCREATE TABLE bins (a BINARY(10));\n\nINSERT INTO bins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM bins;\n+------------+\n| a          |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=\'STRICT_ALL_TABLES\';\n\nINSERT INTO bins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n\nSorting is performed with the byte value:\n\nTRUNCATE bins;\n\nINSERT INTO bins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n\nSELECT * FROM bins ORDER BY a;\n+------+\n| a    |\n+------+\n| A    |\n| B    |\n| a    |\n| b    |\n+------+\n\nUsing CAST to sort as a CHAR instead:\n\nSELECT * FROM bins ORDER BY CAST(a AS CHAR);\n+------+\n| a    |\n+------+\n| a    |\n| A    |\n| b    |\n| B    |\n+------+\n\nThe field is a BINARY(10), so padding of two \'\\0\'s are inserted, causing\ncomparisons that don\'t take this into account to fail:\n\nTRUNCATE bins;\n\nINSERT INTO bins VALUES(\'12345678\');\n\nSELECT a = \'12345678\', a = \'12345678\\0\\0\' from bins;\n+----------------+--------------------+\n| a = \'12345678\' | a = \'12345678\\0\\0\' |\n+----------------+--------------------+\n|              0 |                  1 |\n+----------------+--------------------+\n\nURL: https://mariadb.com/kb/en/binary/','','https://mariadb.com/kb/en/binary/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (269,23,'BLOB','Syntax\n------\n\nBLOB[(M)]\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each BLOB value\nis stored using a two-byte length prefix that indicates the number of bytes in\nthe value.\n\nAn optional length M can be given for this type. If this is done, MariaDB\ncreates the column as the smallest BLOB type large enough to hold values M\nbytes long.\n\nBLOBS can also be used to store dynamic columns.\n\nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be assigned a DEFAULT\nvalue. This restriction was lifted in MariaDB 10.2.1.\n\nIndexing\n--------\n\nMariaDB starting with 10.4\n--------------------------\nFrom MariaDB 10.4, it is possible to set a unique index on a column that uses\nthe BLOB data type. In previous releases this was not possible, as the index\nwould only guarantee the uniqueness of a fixed number of characters.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for LONGBLOB.\n\nURL: https://mariadb.com/kb/en/blob/','','https://mariadb.com/kb/en/blob/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,23,'BLOB and TEXT Data Types','Description\n-----------\n\nA BLOB is a binary large object that can hold a variable amount of data. The\nfour BLOB types are\n\n* TINYBLOB,\n* BLOB, \n* MEDIUMBLOB, and\n* LONGBLOB.\n\nThese differ only in the maximum length of the values they can hold.\n\nThe TEXT types are\n\n* TINYTEXT,\n* TEXT,\n* MEDIUMTEXT, and\n* LONGTEXT.\n* JSON (alias for LONGTEXT)\n\nThese correspond to the four BLOB types and have the same maximum lengths and\nstorage requirements.\n\nMariaDB starting with 10.2.1\n----------------------------\nStarting from MariaDB 10.2.1, BLOB and TEXT columns can have a DEFAULT value.\n\nMariaDB starting with 10.4.3\n----------------------------\nFrom MariaDB 10.4, it is possible to set a unique index on columns that use\nthe BLOB or TEXT data types.\n\nURL: https://mariadb.com/kb/en/blob-and-text-data-types/','','https://mariadb.com/kb/en/blob-and-text-data-types/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (271,23,'CHAR','This article covers the CHAR data type. See CHAR Function for the function.\n\nSyntax\n------\n\n[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA fixed-length string that is always right-padded with spaces to the specified\nlength when stored. M represents the column length in characters. The range of\nM is 0 to 255. If M is omitted, the length is 1.\n\nCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns\ncannot be part of an index. The CONNECT storage engine does not support\nCHAR(0).\n\nNote: Trailing spaces are removed when CHAR values are retrieved unless the\nPAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nBefore MariaDB 10.2, all collations were of type PADSPACE, meaning that CHAR\n(as well as VARCHAR and TEXT) values are compared without regard for trailing\nspaces. This does not apply to the LIKE pattern-matching operator, which takes\ninto account trailing spaces.\n\nIf a unique index consists of a column where trailing pad characters are\nstripped or ignored, inserts into that column where values differ only by the\nnumber of trailing pad characters will result in a duplicate-key error.\n\nExamples\n--------\n\nTrailing spaces:\n\nCREATE TABLE strtest (c CHAR(10));\nINSERT INTO strtest VALUES(\'Maria   \');\n\nSELECT c=\'Maria\',c=\'Maria   \' FROM strtest;\n+-----------+--------------+\n| c=\'Maria\' | c=\'Maria   \' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT c LIKE \'Maria\',c LIKE \'Maria   \' FROM strtest;\n+----------------+-------------------+\n| c LIKE \'Maria\' | c LIKE \'Maria   \' |\n+----------------+-------------------+\n|              1 |                 0 |\n+----------------+-------------------+\n\nNO PAD Collations\n-----------------\n\nNO PAD collations regard trailing spaces as normal characters. You can get a\nlist of all NO PAD collations by querying the Information Schema Collations\ntable, for example:\n\nSELECT collation_name FROM information_schema.collations \n WHERE collation_name LIKE \"%nopad%\";\n+------------------------------+\n| collation_name               |\n+------------------------------+\n| big5_chinese_nopad_ci        |\n| big5_nopad_bin               |\n...\n\nURL: https://mariadb.com/kb/en/char/','','https://mariadb.com/kb/en/char/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (272,23,'CHAR BYTE','Description\n-----------\n\nThe CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: https://mariadb.com/kb/en/char-byte/','','https://mariadb.com/kb/en/char-byte/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (273,23,'ENUM','Syntax\n------\n\nENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nDescription\n-----------\n\nAn enumeration. A string object that can have only one value, chosen from the\nlist of values \'value1\', \'value2\', ..., NULL or the special \'\' error value. In\ntheory, an ENUM column can have a maximum of 65,535 distinct values; in\npractice, the real maximum depends on many factors. ENUM values are\nrepresented internally as integers.\n\nTrailing spaces are automatically stripped from ENUM values on table creation.\n\nENUMs require relatively little storage space compared to strings, either one\nor two bytes depending on the number of enumeration values.\n\nNULL and empty values\n---------------------\n\nAn ENUM can also contain NULL and empty values. If the ENUM column is declared\nto permit NULL values, NULL becomes a valid value, as well as the default\nvalue (see below). If strict SQL Mode is not enabled, and an invalid value is\ninserted into an ENUM, a special empty string, with an index value of zero\n(see Numeric index, below), is inserted, with a warning. This may be\nconfusing, because the empty string is also a possible value, and the only\ndifference if that is this case its index is not 0. Inserting will fail with\nan error if strict mode is active.\n\nIf a DEFAULT clause is missing, the default value will be:\n\n* NULL if the column is nullable;\n* otherwise, the first value in the enumeration.\n\nNumeric index\n-------------\n\nENUM values are indexed numerically in the order they are defined, and sorting\nwill be performed in this numeric order. We suggest not using ENUM to store\nnumerals, as there is little to no storage space benefit, and it is easy to\nconfuse the enum integer with the enum numeral value by leaving out the quotes.\n\nAn ENUM defined as ENUM(\'apple\',\'orange\',\'pear\') would have the following\nindex values:\n\n+--------------------------------------+--------------------------------------+\n| Index                                | Value                                |\n+--------------------------------------+--------------------------------------+\n| NULL                                 | NULL                                 |\n+--------------------------------------+--------------------------------------+\n| 0                                    | \'\'                                   |\n+--------------------------------------+--------------------------------------+\n| 1                                    | \'apple\'                              |\n+--------------------------------------+--------------------------------------+\n| 2                                    | \'orange\'                             |\n+--------------------------------------+--------------------------------------+\n| 3                                    | \'pear\'                               |\n+--------------------------------------+--------------------------------------+\n\nExamples\n--------\n\nCREATE TABLE fruits (\n id INT NOT NULL auto_increment PRIMARY KEY,\n fruit ENUM(\'apple\',\'orange\',\'pear\'),\n bushels INT);\n\nDESCRIBE fruits;\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n| Field   | Type                          | Null | Key | Default | Extra      \n |\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n| id      | int(11)                       | NO   | PRI | NULL    |\nauto_increment |\n| fruit   | enum(\'apple\',\'orange\',\'pear\') | YES  |     | NULL    |            \n |\n| bushels | int(11)                       | YES  |     | NULL    |            \n |\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n\nINSERT INTO fruits\n  (fruit,bushels) VALUES\n  (\'pear\',20),\n  (\'apple\',100),\n  (\'orange\',25);\n\nINSERT INTO fruits\n  (fruit,bushels) VALUES\n  (\'avocado\',10);\nERROR 1265 (01000): Data truncated for column \'fruit\' at row 1\n\nSELECT * FROM fruits;\n+----+--------+---------+\n| id | fruit  | bushels |\n+----+--------+---------+\n|  1 | pear   |      20 |\n|  2 | apple  |     100 |\n|  3 | orange |      25 |\n+----+--------+---------+\n\nSelecting by numeric index:\n\nSELECT * FROM fruits WHERE fruit=2;\n+----+--------+---------+\n| id | fruit  | bushels |\n+----+--------+---------+\n|  3 | orange |      25 |\n+----+--------+---------+\n\nSorting is according to the index value:\n\nCREATE TABLE enums (a ENUM(\'2\',\'1\'));\n\nINSERT INTO enums VALUES (\'1\'),(\'2\');\n\nSELECT * FROM enums ORDER BY a ASC;\n+------+\n| a    |\n+------+\n| 2    |\n| 1    |\n+------+\n\nIt\'s easy to get confused between returning the enum integer with the stored\nvalue, so we don\'t suggest using ENUM to store numerals. The first example\nreturns the 1st indexed field (\'2\' has an index value of 1, as it\'s defined\nfirst), while the second example returns the string value \'1\'.\n\nSELECT * FROM enums WHERE a=1;\n+------+\n| a    |\n+------+\n| 2    |\n+------+\n\nSELECT * FROM enums WHERE a=\'1\';\n+------+\n| a    |\n+------+\n| 1    |\n+------+\n\nURL: https://mariadb.com/kb/en/enum/','','https://mariadb.com/kb/en/enum/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (274,23,'INET6','MariaDB starting with 10.5.0\n----------------------------\nThe INET6 data type was added in MariaDB 10.5.0\n\nSyntax\n------\n\nINET6\n\nDescription\n-----------\n\nThe INET6 data type is intended for storage of IPv6 addresses, as well as IPv4\naddresses assuming conventional mapping of IPv4 addresses into IPv6 addresses.\n\nBoth short and long IPv6 notation are permitted, according to RFC-5952.\n\n* Values are stored as a 16-byte fixed length binary string, with most\nsignificant byte first.\n* Storage engines see INET6 as BINARY(16).\n* Clients see INET6 as CHAR(39) and get text representation on retrieval.\n\nThe IPv4-compatible notation is considered as deprecated. It is supported for\ncompatibility with the INET6_ATON function, which also understands this\nformat. It\'s recommended to use the mapped format to store IPv4 addresses in\nINET6.\n\nWhen an IPv4 mapped (or compatible) value is stored in INET6, it still\noccupies 16 bytes:\n\nRetrieval\n---------\n\nOn retrieval, in the client-server text protocol, INET6 values are converted\nto the short text representation, according to RFC-5952, that is with all\nleading zeroes in each group removed and with consequent zero groups\ncompressed.\n\nBesides creating one\'s own stored function, there is no a way to retrieve an\nINET6 value using long text representation.\n\nCasting\n-------\n\n* CAST from a character string to INET6 understands addresses in short or long\ntext notation (including IPv4 mapped and compatible addresses). NULL is\nreturned if the format is not understood.\n* CAST from a binary string to INET6 requires a 16-byte string as an argument.\nNULL is returned if the argument length is not equal to 16.\n* CAST from other data types to INET6 first converts data to a character\nstring, then CAST from character string to INET6 is applied.\n* CAST from INET6 to CHAR returns short text address notation.\n* CAST from INET6 to BINARY returns its 16-byte binary string representation.\n* CAST from INET6 to data types other than CHAR (e.g. SIGNED, UNSIGNED, TIME,\netc) returns an error.\n\nComparisons\n-----------\n\nAn INET6 expression can be compared to:\n\n* another INET6 expression\n* a character string expression with a text (short or long) address\nrepresentation:\n* a 16-byte binary string expression:\n\nAttempting to compare INET6 to an expression of any other data type returns an\nerror.\n\nMixing INET6 Values for Result\n------------------------------\n\nAn INET6 expression can be mixed for result (i.e. UNION, CASE..THEN, COALESCE\netc) with:\n\n* another INET6 expression. The resulting data type is INET6.\n* a character string in text (short or long) address representation. The\nresult data type is INET6. The character string counterpart is automatically\nconverted to INET6. If the string format is not understood, it\'s converted\nwith a warning to either NULL or to \'::\', depending on the NULL-ability of the\nresult.\n* a 16-byte binary string. The resulting data type is INET6. The binary string\ncounterpart is automatically converted to INET6. If the length of the binary\nstring is not equal to 16, it\'s converted with a warning to NULL or to \'::\'\ndepending on the NULL-ability of the result.\n\nAttempts to mix INET6 for result with other data types will return an error.\n\nMixing INET6 with other data types for LEAST and GREATEST, when mixing for\ncomparison and mixing for result are involved at the same time, uses the same\nrules with mixing for result, described in the previous paragraphs.\n\nFunctions and Operators\n-----------------------\n\n* HEX() with an INET6 argument returns a hexadecimal representation of the\nunderlying 16-byte binary string\n* Arithmetic operators (+,-,*,/,MOD,DIV) are not supported for INET6. This may\nchange in the future.\n* The INET6_ATON function now understands INET6 values as an argument\n* The prototypes of the IS_IPV4_COMPAT and IS_IPV4_MAPPED functions have\nchanged from a BINARY(16) to a INET6,\n* When the argument for these two functions is not INET6, automatic implicit\nCAST to INET6 is applied. As a consequence, both functions now understand\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, these functions understood only binary(16) representation.\n\nPrepared Statement Parameters\n-----------------------------\n\nINET6 understands both text and binary(16) address representation in prepared\nstatement parameters (PREPARE..EXECUTE and EXECUTE IMMEDIATE statements).\n\nMigration between  BINARY(16) and INET6\n---------------------------------------\n\nBefore MariaDB 10.5.0, you may have used BINARY(16) as a storage for IPv6\ninternet addresses, in combination with INET6_ATON and INET6_NTOA to\nrespectively insert and retrieve data.\n\nFrom 10.5, you can ALTER BINARY(16) columns storing IPv6 addresses to INET6.\nAfter such an alter, there is no a need to use INET6_ATON() and INET6_NTOA().\nAddresses can be inserted and retrieved directly.\n\nIt is also possible to convert INET6 columns to BINARY(16) and continue using\nthe data in combination with INET6_NTOA() and INET6_ATON().\n\nExamples\n--------\n\nCREATE TABLE t1 (a INET6);\n\nInserting using short text address notation:\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nLong text address notation:\n\nINSERT INTO t1 VALUES (\'2001:0db8:0000:0000:0000:ff00:0042:8329\');\n\n16-byte binary string notation:\n\nINSERT INTO t1 VALUES (0x20010DB8000000000000FF0000428329);\nINSERT INTO t1 VALUES (UNHEX(\'20010DB8000000000000FF0000428329\'));\n\nIPv4 addresses, using IPv4-mapped and IPv4-compatible notations:\n\nINSERT INTO t1 VALUES (\'::ffff:192.0.2.128\'); -- mapped\nINSERT INTO t1 VALUES (\'::192.0.2.128\'); -- compatible\n\nSELECT * FROM t1;\n+------------------------+\n| a                      |\n+------------------------+\n| 2001:db8::ff00:42:8329 |\n| 2001:db8::ff00:42:8329 |\n| 2001:db8::ff00:42:8329 |\n| 2001:db8::ff00:42:8329 |\n| ::ffff:192.0.2.128     |\n| ::192.0.2.128          |\n+------------------------+\n\nIPv4 mapped (or compatible) values still occupy 16 bytes:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'::ffff:192.0.2.128\');\n\nSELECT * FROM t1;\n+--------------------+\n| a                  |\n+--------------------+\n| ::ffff:192.0.2.128 |\n+--------------------+\n\nSELECT HEX(a) FROM t1;\n+----------------------------------+\n| HEX(a)                           |\n+----------------------------------+\n| 00000000000000000000FFFFC0000280 |\n+----------------------------------+\n\nCasting from INET6 to anything other than CHAR returns an error:\n\nSELECT CAST(a AS DECIMAL) FROM t1;\n\nERROR 4079 (HY000): Illegal parameter data type inet6 for operation\n\'decimal_typecast\'\n\nComparison Examples\n-------------------\n\nComparison with another INET6 expression:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n  CREATE OR REPLACE TABLE t2 (a INET6);\n\nINSERT INTO t1 VALUES\n(\'2001:db8::ff00:42:8328\'),(\'2001:db8::ff00:42:8329\');\n  INSERT INTO t2 VALUES\n(\'2001:db8::ff00:42:832a\'),(\'2001:db8::ff00:42:8329\');\n\nSELECT t1.* FROM t1,t2 WHERE t1.a=t2.a;\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nWith a character string expression with a text (short or long) address\nrepresentation:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nSELECT * FROM t1 WHERE a=\'2001:db8::ff00:42:8329\';\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nWith a 16-byte binary string expression:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nSELECT * FROM t1 WHERE a=X\'20010DB8000000000000FF0000428329\';\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nWith an expression of another data type:\n\nSELECT * FROM t1 WHERE a=1;\nERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation\n\'=\'\n\nMixing for Result Examples\n--------------------------\n\nMixed with another INET6 expression, returning an INET6 data type:\n\nCREATE OR REPLACE TABLE t1 (a INET6, b INET6);\n\nINSERT INTO t1 VALUES (NULL,\'2001:db8::ff00:42:8329\');\n\nSELECT a FROM t1 UNION SELECT b FROM t1;\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | NULL                   |\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nSELECT COALESCE(a, b) FROM t1;\n  +------------------------+\n  | COALESCE(a, b)         |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nMixed with a character string in text (short or long) address representation:\n\nCREATE OR REPLACE TABLE t1 (a INET6, b VARCHAR(64));\n\nINSERT INTO t1 VALUES (NULL,\'2001:db8::ff00:42:8328\');\n\nINSERT INTO t1 VALUES (NULL,\'2001:db8::ff00:42:832a garbage\');\n\nSELECT COALESCE(a,b) FROM t1;\n  +------------------------+\n  | COALESCE(a,b)          |\n  +------------------------+\n  | 2001:db8::ff00:42:8328 |\n  | NULL                   |\n  +------------------------+\n  2 rows in set, 1 warning (0.001 sec)\n\nSHOW WARNINGS;\n\n+---------+------+---------------------------------------------------------+\n  | Level   | Code | Message\n|\n\n+---------+------+---------------------------------------------------------+\n  | Warning | 1292 | Incorrect inet6 value: \'2001:db8::ff00:42:832a garbage\'\n|\n\n+---------+------+---------------------------------------------------------+\n\nMixed with a 16-byte binary string:\n\nCREATE OR REPLACE TABLE t1 (a INET6, b VARBINARY(16));\n\nINSERT INTO t1 VALUES (NULL,CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF));\n\nINSERT INTO t1 VALUES (NULL,0x00/*garbage*/);\n\nSELECT COALESCE(a,b) FROM t1;\n  +---------------+\n  | COALESCE(a,b) |\n  +---------------+\n  | ffff::ffff    |\n  | NULL          |\n  +---------------+\n  2 rows in set, 1 warning (0.001 sec)\n\nSHOW WARNINGS;\n  +---------+------+-------------------------------+\n  | Level   | Code | Message                       |\n  +---------+------+-------------------------------+\n  | Warning | 1292 | Incorrect inet6 value: \'\\x00\' |\n  +---------+------+-------------------------------+\n\nMixing with other data types:\n\nSELECT CAST(\'ffff::ffff\' AS INET6) UNION SELECT 1;\nERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation\n\'UNION\'\n\nFunctions and Operators Examples\n--------------------------------\n\nHEX with an INET6 argument returning a hexadecimal representation:\n\nSELECT HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6));\n  +----------------------------------------------+\n  | HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6)) |\n  +----------------------------------------------+\n  | 20010DB8000000000000FF0000428329             |\n  +----------------------------------------------+\n\nINET6_ATON now understands INET6 values as an argument:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nSELECT a, HEX(INET6_ATON(a)) FROM t1;\n  +------------------------+----------------------------------+\n  | a                      | HEX(INET6_ATON(a))               |\n  +------------------------+----------------------------------+\n  | 2001:db8::ff00:42:8329 | 20010DB8000000000000FF0000428329 |\n  +------------------------+----------------------------------+\n\nIS_IPV4_COMPAT and IS_IPV4_MAPPED prototype now a BINARY(16)):\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n  INSERT INTO t1 VALUES (\'::ffff:192.168.0.1\');\n  INSERT INTO t1 VALUES (\'::192.168.0.1\');\n\nSELECT a, IS_IPV4_MAPPED(a), IS_IPV4_COMPAT(a) FROM t1;\n  +------------------------+-------------------+-------------------+\n  | a                      | IS_IPV4_MAPPED(a) | IS_IPV4_COMPAT(a) |\n  +------------------------+-------------------+-------------------+\n  | 2001:db8::ff00:42:8329 |                 0 |                 0 |\n  | ::ffff:192.168.0.1     |                 1 |                 0 |\n  | ::192.168.0.1          |                 0 |                 1 |\n  +------------------------+-------------------+-------------------+\n\nAutomatic implicit CAST to INET6:\n\nCREATE OR REPLACE TABLE t1 (\n   a INET6,\n   b VARCHAR(39) DEFAULT a\n  );\n\nINSERT INTO t1 (a) VALUES (\'ffff::ffff\'),(\'::ffff:192.168.0.1\');\n\nSELECT a, IS_IPV4_MAPPED(a), b, IS_IPV4_MAPPED(b) FROM t1;\n\n+--------------------+-------------------+--------------------+----------------\n--+\n  | a                  | IS_IPV4_MAPPED(a) | b                  |\nIS_IPV4_MAPPED(b) |\n\n+--------------------+-------------------+--------------------+----------------\n--+\n  | ffff::ffff         |                 0 | ffff::ffff         |\n  0 |\n  | ::ffff:192.168.0.1 |                 1 | ::ffff:192.168.0.1 |\n  1 |\n\n+--------------------+-------------------+--------------------+----------------\n--+\n\nCREATE OR REPLACE TABLE t1 (\n   a INET6,\n   b BINARY(16) DEFAULT UNHEX(HEX(a))\n  );\n\nINSERT INTO t1 (a) VALUES (\'ffff::ffff\'),(\'::ffff:192.168.0.1\');\n\nSELECT a, IS_IPV4_MAPPED(a), HEX(b), IS_IPV4_MAPPED(b) FROM t1;\n\n+--------------------+-------------------+----------------------------------+--\n----------------+\n  | a                  | IS_IPV4_MAPPED(a) | HEX(b)\n | IS_IPV4_MAPPED(b) |\n\n+--------------------+-------------------+----------------------------------+--\n----------------+\n  | ffff::ffff         |                 0 |\nFFFF000000000000000000000000FFFF |                 0 |\n  | ::ffff:192.168.0.1 |                 1 |\n00000000000000000000FFFFC0A80001 |                 1 |\n\n+--------------------+-------------------+----------------------------------+--\n----------------+\n\nPrepared Statement Parameters Examples\n--------------------------------------\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING \'ffff::fffe\';\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING\nX\'FFFF000000000000000000000000FFFF\';\n\nSELECT * FROM t1;\n+------------+\n| a          |\n+------------+\n| ffff::fffe |\n| ffff::ffff |\n+------------+\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING \'ffff::fffe\';\n+------------+\n| a          |\n+------------+\n| ffff::fffe |\n+------------+\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING','','https://mariadb.com/kb/en/inet6/');
update help_topic set description = CONCAT(description, '\nX\'FFFF000000000000000000000000FFFF\';\n+------------+\n| a          |\n+------------+\n| ffff::ffff |\n+------------+\n\nMigration between BINARY(16) and INET6 Examples\n-----------------------------------------------\n\nBefore MariaDB 10.5:\n\nCREATE OR REPLACE TABLE t1 (a BINARY(16));\n\nINSERT INTO t1 VALUES (INET6_ATON(\'ffff::ffff\'));\n\nSELECT INET6_NTOA(a) FROM t1;\n+---------------+\n| INET6_NTOA(a) |\n+---------------+\n| ffff::ffff    |\n+---------------+\n\nMigrating to INET6, from MariaDB 10.5:\n\nALTER TABLE t1 MODIFY a INET6;\n\nINSERT INTO t1 VALUES (\'ffff::fffe\');\n\nSELECT * FROM t1;\n+------------+\n| a          |\n+------------+\n| ffff::ffff |\n| ffff::fffe |\n+------------+\n\nMigration from INET6 to BINARY(16):\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\nINSERT INTO t1 VALUES (\'::ffff:192.168.0.1\');\nINSERT INTO t1 VALUES (\'::192.168.0.1\');\n\nALTER TABLE t1 MODIFY a BINARY(16);\n\nSELECT INET6_NTOA(a) FROM t1;\n+------------------------+\n| INET6_NTOA(a)          |\n+------------------------+\n| 2001:db8::ff00:42:8329 |\n| ::ffff:192.168.0.1     |\n| ::192.168.0.1          |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/inet6/') WHERE help_topic_id = 274;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (275,23,'JSON Data Type','MariaDB starting with 10.2.7\n----------------------------\nThe JSON alias was added in MariaDB 10.2.7. This was done to make it possible\nto use JSON columns in statement based replication from MySQL to MariaDB and\nto make it possible for MariaDB to read mysqldumps from MySQL.\n\nJSON is an alias for LONGTEXT introduced for compatibility reasons with\nMySQL\'s JSON data type. MariaDB implements this as a LONGTEXT rather, as the\nJSON data type contradicts the SQL standard, and MariaDB\'s benchmarks indicate\nthat performance is at least equivalent.\n\nIn order to ensure that a a valid json document is inserted, the JSON_VALID\nfunction can be used as a CHECK constraint. This constraint is automatically\nincluded for types using the JSON alias from MariaDB 10.4.3.\n\nExamples\n--------\n\nCREATE TABLE t (j JSON);\n\nDESC t;\n+-------+----------+------+-----+---------+-------+\n| Field | Type     | Null | Key | Default | Extra |\n+-------+----------+------+-----+---------+-------+\n| j     | longtext | YES  |     | NULL    |       |\n+-------+----------+------+-----+---------+-------+\n\nWith validation:\n\nCREATE TABLE t2 (\n j JSON\n CHECK (JSON_VALID(j))\n);\n\nINSERT INTO t2 VALUES (\'invalid\');\nERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2`\n\nINSERT INTO t2 VALUES (\'{\"id\": 1, \"name\": \"Monty\"}\');\nQuery OK, 1 row affected (0.13 sec)\n\nReplicating JSON Data Between MySQL and MariaDB\n-----------------------------------------------\n\nThe JSON type in MySQL stores the JSON object in a compact form, not as\nLONGTEXT as in MariaDB. This means that row based replication will not work\nfor JSON types from MySQL to MariaDB.\n\nThere are a a few different ways to solve this:\n\n* Use statement based replication.\n* Change the JSON column to type TEXT in MySQL\n* If you must use row-based replication and cannot change the MySQL master\nfrom JSON to TEXT, you can try to introduce an intermediate MySQL slave and\nchange the column type from JSON to TEXT on it. Then you replicate from this\nintermediate slave to MariaDB.\n\nConverting a MySQL TABLE with JSON Fields to MariaDB\n----------------------------------------------------\n\nMariaDB can\'t directly access MySQL\'s JSON format.\n\nThere are a a few different ways to move the table to MariaDB:\n\n* From MariaDB 10.5.7, see the you can use the mysql_json plugin. See Making\nMariaDB understand MySQL JSON.\n* Change the JSON column to type TEXT in MySQL.  After this, MariaDB can\ndirectly use the table without any need for a dump and restore.\n* Use mariadb-dump/mysqldump to copy the table.\n\nDifferences Between MySQL JSON Strings and MariaDB JSON Strings\n---------------------------------------------------------------\n\n* In MySQL, JSON is an object and is compared according to json values. In\nMariaDB JSON strings are normal strings and compared as strings. One exception\nis when using JSON_EXTRACT() in which case strings are unescaped before\ncomparison.\n\nURL: https://mariadb.com/kb/en/json-data-type/','','https://mariadb.com/kb/en/json-data-type/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (276,23,'MEDIUMBLOB','Syntax\n------\n\nMEDIUMBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a three-byte length prefix that indicates the\nnumber of bytes in the value.\n\nURL: https://mariadb.com/kb/en/mediumblob/','','https://mariadb.com/kb/en/mediumblob/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (277,23,'MEDIUMTEXT','Syntax\n------\n\nMEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters. The\neffective maximum length is less if the value contains multi-byte characters.\nEach MEDIUMTEXT value is stored using a three-byte length prefix that\nindicates the number of bytes in the value.\n\nURL: https://mariadb.com/kb/en/mediumtext/','','https://mariadb.com/kb/en/mediumtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (278,23,'LONGBLOB','Syntax\n------\n\nLONGBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 4,294,967,295 bytes or 4GB (232 - 1).\nThe effective maximum length of LONGBLOB columns depends on the configured\nmaximum packet size in the client/server protocol and available memory. Each\nLONGBLOB value is stored using a four-byte length prefix that indicates the\nnumber of bytes in the value.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for LONGBLOB.\n\nURL: https://mariadb.com/kb/en/longblob/','','https://mariadb.com/kb/en/longblob/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (279,23,'LONGTEXT','Syntax\n------\n\nLONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmulti-byte characters. The effective maximum length of LONGTEXT columns also\ndepends on the configured maximum packet size in the client/server protocol\nand available memory. Each LONGTEXT value is stored using a four-byte length\nprefix that indicates the number of bytes in the value.\n\nFrom MariaDB 10.2.7, JSON is an alias for LONGTEXT. See JSON Data Type for\ndetails.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, CLOB is a synonym for LONGTEXT.\n\nURL: https://mariadb.com/kb/en/longtext/','','https://mariadb.com/kb/en/longtext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (280,23,'ROW','MariaDB starting with 10.3.0\n----------------------------\nThe ROW data type was introduced in MariaDB 10.3.0.\n\nSyntax\n------\n\nROW (<field name> <data type> [{, <field name> <data type>}... ])\n\nDescription\n-----------\n\nROW is a data type for stored procedure variables.\n\nFeatures\n--------\n\nROW fields as normal variables\n------------------------------\n\nROW fields (members) act as normal variables, and are able to appear in all\nquery parts where a stored procedure variable is allowed:\n\n* Assignment is using the := operator and the SET command:\n\na.x:= 10;\na.x:= b.x;\nSET a.x= 10, a.y=20, a.z= b.z;\n\n* Passing to functions and operators:\n\nSELECT f1(rec.a), rec.a<10;\n\n* Clauses (select list, WHERE, HAVING, LIMIT, etc...,):\n\nSELECT var.a, t1.b FROM t1 WHERE t1.b=var.b LIMIT var.c;\n\n* INSERT values:\n\nINSERT INTO t1 VALUES (rec.a, rec.b, rec.c);\n\n* SELECT .. INTO targets\n\nSELECT a,b INTO rec.a, rec.b FROM t1 WHERE t1.id=10;\n\n* Dynamic SQL out parameters (EXECUTE and EXECUTE IMMEDIATE)\n\nEXECUTE IMMEDIATE \'CALL proc_with_out_param(?)\' USING rec.a;\n\nROW type variables as FETCH targets\n-----------------------------------\n\nROW type variables are allowed as FETCH targets:\n\nFETCH cur INTO rec;\n\nwhere cur is a CURSOR and rec is a ROW type stored procedure variable.\n\nNote, currently an attempt to use FETCH for a ROW type variable returns this\nerror:\n\nERROR 1328 (HY000): Incorrect number of FETCH variables\n\nFETCH from a cursor cur into a ROW variable rec works as follows:\n\n* The number of fields in cur must match the number of fields in rec.\n Otherwise, an error is reported.\n\n* Assignment is done from left to right. The first cursor field is assigned to\n the first variable field, the second cursor field is assigned to the second\n variable field, etc.\n\n* Field names in rec are not important and can differ from field names\n in cur.\n\nSee FETCH Examples (below) for examples of using this with sql_mode=ORACLE and\nsql_mode=DEFAULT.\n\nROW type variables as SELECT...INTO targets\n-------------------------------------------\n\nROW type variables are allowed as SELECT..INTO targets with some differences\ndepending on which sql_mode is in use.\n\n* When using sql_mode=ORACLE, table%ROWTYPE and cursor%ROWTYPE\n variables can be used as SELECT...INTO targets.\n\n* Using multiple ROW variables in the SELECT..INTO list will report an\n error.\n\n* Using ROW variables with a different column count than in\n the SELECT..INTO list will report an error.\n\nSee SELECT...INTO Examples (below) for examples of using this with\nsql_mode=ORACLE and sql_mode=DEFAULT.\n\nFeatures not implemented\n------------------------\n\nThe following features are planned, but not implemented yet:\n\n* Returning a ROW type expression from a stored function (see MDEV-12252).\nThis will need some grammar change to support field names after parentheses:\n\nSELECT f1().x FROM DUAL;\n\n* Returning a ROW type expression from a built-in hybrid type function, such\nas CASE, IF, etc. \n* ROW of ROWs\n\nExamples\n--------\n\nDeclaring a ROW in a stored procedure\n-------------------------------------\n\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE r ROW (c1 INT, c2 VARCHAR(10));\n SET r.c1= 10;\n SET r.c2= \'test\';\n INSERT INTO t1 VALUES (r.c1, r.c2);\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nFETCH Examples\n--------------\n\nA complete FETCH example for sql_mode=ORACLE:\n\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nINSERT INTO t1 VALUES (20,\'b20\');\nINSERT INTO t1 VALUES (30,\'b30\');\n\nSET sql_mode=oracle;\nDROP PROCEDURE IF EXISTS p1;\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec ROW(a INT, b VARCHAR(32));\n CURSOR c IS SELECT a,b FROM t1;\nBEGIN\n OPEN c;\n LOOP\n  FETCH c INTO rec;\n  EXIT WHEN c%NOTFOUND;\n  SELECT (\'rec=(\' || rec.a ||\',\'|| rec.b||\')\');\n END LOOP;\n CLOSE c;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nA complete FETCH example for sql_mode=DEFAULT:\n\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nINSERT INTO t1 VALUES (20,\'b20\');\nINSERT INTO t1 VALUES (30,\'b30\');\n\nSET sql_mode=DEFAULT;\nDROP PROCEDURE IF EXISTS p1;\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE rec ROW(a INT, b VARCHAR(32));\n DECLARE c CURSOR FOR SELECT a,b FROM t1;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n OPEN c;\nread_loop:\n LOOP\n  FETCH c INTO rec;\n  IF done THEN\n   LEAVE read_loop;\n  END IF;\n  SELECT CONCAT(\'rec=(\',rec.a,\',\',rec.b,\')\');\n END LOOP;\n CLOSE c;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nSELECT...INTO Examples\n----------------------\n\nA SELECT...INTO example for sql_mode=DEFAULT:\n\nSET sql_mode=DEFAULT;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE rec1 ROW(a INT, b VARCHAR(32));\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nA SELECT...INTO example for sql_mode=ORACLE:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec1 ROW(a INT, b VARCHAR(32));\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nAn example for sql_mode=ORACLE using table%ROWTYPE variables as SELECT..INTO\ntargets:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec1 t1%ROWTYPE;\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nAn example for sql_mode=ORACLE using cursor%ROWTYPE variables as SELECT..INTO\ntargets:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n CURSOR cur1 IS SELECT * FROM t1;\n rec1 cur1%ROWTYPE;\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nURL: https://mariadb.com/kb/en/row/','','https://mariadb.com/kb/en/row/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (281,23,'TEXT','Syntax\n------\n\nTEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multi-byte characters.\nEach TEXT value is stored using a two-byte length prefix that indicates the\nnumber of bytes in the value. If you need a bigger storage, consider using\nMEDIUMTEXT instead.\n\nAn optional length M can be given for this type. If this is done, MariaDB\ncreates the column as the smallest TEXT type large enough to hold values M\ncharacters long.\n\nBefore MariaDB 10.2, all MariaDB collations were of type PADSPACE, meaning\nthat TEXT (as well as VARCHAR and CHAR values) are compared without regard for\ntrailing spaces. This does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces.\n\nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be assigned a DEFAULT\nvalue. This restriction was lifted in MariaDB 10.2.1.\n\nExamples\n--------\n\nTrailing spaces:\n\nCREATE TABLE strtest (d TEXT(10));\nINSERT INTO strtest VALUES(\'Maria   \');\n\nSELECT d=\'Maria\',d=\'Maria   \' FROM strtest;\n+-----------+--------------+\n| d=\'Maria\' | d=\'Maria   \' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT d LIKE \'Maria\',d LIKE \'Maria   \' FROM strtest;\n+----------------+-------------------+\n| d LIKE \'Maria\' | d LIKE \'Maria   \' |\n+----------------+-------------------+\n|              0 |                 1 |\n+----------------+-------------------+\n\nIndexing\n--------\n\nTEXT columns can only be indexed over a specified length. This means that they\ncannot be used as the primary key of a table norm until MariaDB 10.4, can a\nunique index be created on them.\n\nMariaDB starting with 10.4\n--------------------------\nStarting with MariaDB 10.4, a unique index can be created on a TEXT column.\n\nInternally, this uses hash indexing to quickly check the values and if a hash\ncollision is found, the actual stored values are compared in order to retain\nthe uniqueness.\n\nDifference between VARCHAR and TEXT\n-----------------------------------\n\n* VARCHAR columns can be fully indexed. TEXT columns can only be indexed over\na specified length.\n* Using TEXT or BLOB in a SELECT query that uses temporary tables for storing\nintermediate results will force the temporary table to be disk based (using\nthe Aria storage engine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine caches the rows in\nmemory. To get the benefit of this, one should ensure that the\naria_pagecache_buffer_size variable is big enough to hold most of the row and\nindex data for temporary tables.\n\nFor Storage Engine Developers\n-----------------------------\n\n* Internally the full length of the VARCHAR column is allocated inside each\nTABLE objects record[] structure. As there are three such buffers, each open\ntable will allocate 3 times max-length-to-store-varchar bytes of memory.\n* TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes\nlength.  The TEXT data is only stored once. This means that internally TEXT\nuses less memory for each open table but instead has the additional overhead\nthat each TEXT object needs to be allocated and freed for each row access\n(with some caching in between).\n\nURL: https://mariadb.com/kb/en/text/','','https://mariadb.com/kb/en/text/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (282,23,'TINYBLOB','Syntax\n------\n\nTINYBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each TINYBLOB value\nis stored using a one-byte length prefix that indicates the number of bytes in\nthe value.\n\nURL: https://mariadb.com/kb/en/tinyblob/','','https://mariadb.com/kb/en/tinyblob/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (283,23,'TINYTEXT','Syntax\n------\n\nTINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The effective\nmaximum length is less if the value contains multi-byte characters. Each\nTINYTEXT value is stored using a one-byte length prefix that indicates the\nnumber of bytes in the value.\n\nURL: https://mariadb.com/kb/en/tinytext/','','https://mariadb.com/kb/en/tinytext/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (284,23,'VARBINARY','Syntax\n------\n\nVARBINARY(M)\n\nDescription\n-----------\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary byte\nstrings rather than non-binary character strings. M represents the maximum\ncolumn length in bytes.\n\nIt contains no character set, and comparison and sorting are based on the\nnumeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the\nextra characters will be dropped with a warning. If strict mode is enabled, an\nerror will occur.\n\nUnlike BINARY values, VARBINARYs are not right-padded when inserting.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, RAW is a synonym for VARBINARY.\n\nExamples\n--------\n\nInserting too many characters, first with strict mode off, then with it on:\n\nCREATE TABLE varbins (a VARBINARY(10));\n\nINSERT INTO varbins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM varbins;\n+------------+\n| a          |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=\'STRICT_ALL_TABLES\';\n\nINSERT INTO varbins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n\nSorting is performed with the byte value:\n\nTRUNCATE varbins;\n\nINSERT INTO varbins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n\nSELECT * FROM varbins ORDER BY a;\n+------+\n| a    |\n+------+\n| A    |\n| B    |\n| a    |\n| b    |\n+------+\n\nUsing CAST to sort as a CHAR instead:\n\nSELECT * FROM varbins ORDER BY CAST(a AS CHAR);\n+------+\n| a    |\n+------+\n| a    |\n| A    |\n| b    |\n| B    |\n+------+\n\nURL: https://mariadb.com/kb/en/varbinary/','','https://mariadb.com/kb/en/varbinary/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,23,'VARCHAR','Syntax\n------\n\n[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,532. The effective maximum length of a\nVARCHAR is subject to the maximum row size and the character set used. For\nexample, utf8 characters can require up to three bytes per character, so a\nVARCHAR column that uses the utf8 character set can be declared to be a\nmaximum of 21,844 characters.\n\nNote: For the ColumnStore engine, M represents the maximum column length in\nbytes.\n\nMariaDB stores VARCHAR values as a one-byte or two-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A VARCHAR\ncolumn uses one length byte if values require no more than 255 bytes, two\nlength bytes if values may require more than 255 bytes.\n\nMariaDB follows the standard SQL specification, and does not remove trailing\nspaces from VARCHAR values.\n\nVARCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns\ncannot be part of an index. The CONNECT storage engine does not support\nVARCHAR(0).\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the standard\nSQL way to define that a VARCHAR column should use some predefined character\nset. MariaDB uses utf8 as this predefined character set, as does MySQL 4.1 and\nup. NVARCHAR is shorthand for NATIONAL VARCHAR.\n\nBefore MariaDB 10.2, all MariaDB collations were of type PADSPACE, meaning\nthat VARCHAR (as well as CHAR and TEXT values) are compared without regard for\ntrailing spaces. This does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces. From MariaDB 10.2, a number of NO\nPAD collations are available.\n\nIf a unique index consists of a column where trailing pad characters are\nstripped or ignored, inserts into that column where values differ only by the\nnumber of trailing pad characters will result in a duplicate-key error.\n\nExamples\n--------\n\nThe following are equivalent:\n\nVARCHAR(30) CHARACTER SET utf8\nNATIONAL VARCHAR(30)\nNVARCHAR(30)\nNCHAR VARCHAR(30)\nNATIONAL CHARACTER VARYING(30)\nNATIONAL CHAR VARYING(30)\n\nTrailing spaces:\n\nCREATE TABLE strtest (v VARCHAR(10));\nINSERT INTO strtest VALUES(\'Maria   \');\n\nSELECT v=\'Maria\',v=\'Maria   \' FROM strtest;\n+-----------+--------------+\n| v=\'Maria\' | v=\'Maria   \' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT v LIKE \'Maria\',v LIKE \'Maria   \' FROM strtest;\n+----------------+-------------------+\n| v LIKE \'Maria\' | v LIKE \'Maria   \' |\n+----------------+-------------------+\n|              0 |                 1 |\n+----------------+-------------------+\n\nTruncation\n----------\n\n* Depending on whether or not strict sql mode is set, you will either get a\nwarning or an error if you try to insert a string that is too long into a\nVARCHAR column. If the extra characters are spaces, the spaces that can\'t fit\nwill be removed and you will always get a warning, regardless of the sql mode\nsetting.\n\nDifference Between VARCHAR and TEXT\n-----------------------------------\n\n* VARCHAR columns can be fully indexed. TEXT columns can only be indexed over\na specified length.\n* Using TEXT or BLOB in a SELECT query that uses temporary tables for storing\nintermediate results will force the temporary table to be disk based (using\nthe Aria storage engine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine caches the rows in\nmemory. To get the benefit of this, one should ensure that the\naria_pagecache_buffer_size variable is big enough to hold most of the row and\nindex data for temporary tables.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, VARCHAR2 is a synonym.\n\nFor Storage Engine Developers\n-----------------------------\n\n* Internally the full length of the VARCHAR column is allocated inside each\nTABLE objects record[] structure. As there are three such buffers, each open\ntable will allocate 3 times max-length-to-store-varchar bytes of memory.\n* TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes\nlength.  The TEXT data is only stored once. This means that internally TEXT\nuses less memory for each open table but instead has the additional overhead\nthat each TEXT object needs to be allocated and freed for each row access\n(with some caching in between).\n\nURL: https://mariadb.com/kb/en/varchar/','','https://mariadb.com/kb/en/varchar/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (286,23,'SET Data Type','Syntax\n------\n\nSET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nDescription\n-----------\n\nA set. A string object that can have zero or more values, each of which must\nbe chosen from the list of values \'value1\', \'value2\', ... A SET column can\nhave a maximum of 64 members. SET values are represented internally as\nintegers.\n\nSET values cannot contain commas.\n\nIf a SET contains duplicate values, an error will be returned if strict mode\nis enabled, or a warning if strict mode is not enabled.\n\nURL: https://mariadb.com/kb/en/set-data-type/','','https://mariadb.com/kb/en/set-data-type/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (287,23,'DATE','Syntax\n------\n\nDATE\n\nDescription\n-----------\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MariaDB displays\nDATE values in \'YYYY-MM-DD\' format, but can be assigned dates in looser\nformats, including strings or numbers, as long as they make sense. These\ninclude a short year, YY-MM-DD, no delimiters, YYMMDD, or any other acceptable\ndelimiter, for example YYYY/MM/DD. For details, see date and time literals.\n\n\'0000-00-00\' is a permitted special value (zero-date), unless the NO_ZERO_DATE\nSQL_MODE is used. Also, individual components of a date can be set to 0 (for\nexample: \'2015-00-12\'), unless the NO_ZERO_IN_DATE SQL_MODE is used. In many\ncases, the result of en expression involving a zero-date, or a date with\nzero-parts, is NULL. If the ALLOW_INVALID_DATES SQL_MODE is enabled, if the\nday part is in the range between 1 and 31, the date does not produce any\nerror, even for months that have less than 31 days.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, DATE with a time portion is a synonym for\nDATETIME. See also mariadb_schema.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATE);\n\nINSERT INTO t1 VALUES (\"2010-01-12\"), (\"2011-2-28\"), (\'120314\'),(\'13*04*21\');\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 2010-01-12 |\n| 2011-02-28 |\n| 2012-03-14 |\n| 2013-04-21 |\n+------------+\n\nURL: https://mariadb.com/kb/en/date/','','https://mariadb.com/kb/en/date/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (288,23,'TIME','Syntax\n------\n\nTIME [(<microsecond precision>)]\n\nDescription\n-----------\n\nA time. The range is \'-838:59:59.999999\' to \'838:59:59.999999\'. Microsecond\nprecision can be from 0-6; if not specified 0 is used. Microseconds have been\navailable since MariaDB 5.3.\n\nMariaDB displays TIME values in \'HH:MM:SS.ssssss\' format, but allows\nassignment of times in looser formats, including \'D HH:MM:SS\', \'HH:MM:SS\',\n\'HH:MM\', \'D HH:MM\', \'D HH\', \'SS\', or \'HHMMSS\', as well as permitting dropping\nof any leading zeros when a delimiter is provided, for example \'3:9:10\'. For\ndetails, see date and time literals.\n\nMariaDB starting with 10.1.2\n----------------------------\nMariaDB 10.1.2 introduced the --mysql56-temporal-format option, on by default,\nwhich allows MariaDB to store TIMEs using the same low-level format MySQL 5.6\nuses.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIME column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIME;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_time\\G\n*************************** 1. row ***************************\n   Table: mariadb5312_time\nCreate Table: CREATE TABLE `mariadb5312_time` (\n `t0` time /* mariadb-5.3 */ DEFAULT NULL,\n `t6` time(6) /* mariadb-5.3 */ DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nNote, columns with the current format are not marked with a comment.\n\nExamples\n--------\n\nINSERT INTO time VALUES (\'90:00:00\'), (\'800:00:00\'), (800), (22), (151413),\n(\'9:6:3\'), (\'12 09\');\n\nSELECT * FROM time;\n+-----------+\n| t         |\n+-----------+\n| 90:00:00  |\n| 800:00:00 |\n| 00:08:00  |\n| 00:00:22  |\n| 15:14:13  |\n| 09:06:03  |\n| 297:00:00 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/time/','','https://mariadb.com/kb/en/time/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,23,'DATETIME','Syntax\n------\n\nDATETIME [(microsecond precision)]\n\nDescription\n-----------\n\nA date and time combination.\n\nMariaDB displays DATETIME values in \'YYYY-MM-DD HH:MM:SS.ffffff\' format, but\nallows assignment of values to DATETIME columns using either strings or\nnumbers. For details, see date and time literals.\n\nDATETIME columns also accept CURRENT_TIMESTAMP as the default value.\n\nMariaDB 10.1.2 introduced the --mysql56-temporal-format option, on by default,\nwhich allows MariaDB to store DATETMEs using the same low-level format MySQL\n5.6 uses. For more information, see Internal Format, below.\n\nFor storage requirements, see Data Type Storage Requirements.\n\nSupported Values\n----------------\n\nMariaDB stores values that use the DATETIME data type in a format that\nsupports values between 1000-01-01 00:00:00.000000 and 9999-12-31\n23:59:59.999999.\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no\nmicrosecond precision is specified, then 0 is used by default.\n\nMariaDB also supports \'0000-00-00\' as a special zero-date value, unless\nNO_ZERO_DATE is specified in the SQL_MODE. Similarly, individual components of\na date can be set to 0 (for example: \'2015-00-12\'), unless NO_ZERO_IN_DATE is\nspecified in the SQL_MODE. In many cases, the result of en expression\ninvolving a zero-date, or a date with zero-parts, is NULL. If the\nALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is in the range\nbetween 1 and 31, the date does not produce any error, even for months that\nhave less than 31 days.\n\nTime Zones\n----------\n\nIf a column uses the DATETIME data type, then any inserted values are stored\nas-is, so no automatic time zone conversions are performed.\n\nMariaDB also does not currently support time zone literals that contain time\nzone identifiers. See MDEV-11829 for more information.\n\nMariaDB validates DATETIME literals against the session\'s time zone. For\nexample, if a specific time range never occurred in a specific time zone due\nto daylight savings time, then DATETIME values within that range would be\ninvalid for that time zone.\n\nFor example, daylight savings time started on March 10, 2019 in the US, so the\ntime range between 02:00:00 and 02:59:59 is invalid for that day in US time\nzones:\n\nSET time_zone = \'America/New_York\';\nQuery OK, 0 rows affected (0.000 sec)\n\nINSERT INTO timestamp_test VALUES (\'2019-03-10 02:55:05\');\nERROR 1292 (22007): Incorrect datetime value: \'2019-03-10 02:55:05\' for column\n`db1`.`timestamp_test`.`timestamp_test` at row 1\n\nBut that same time range is fine in other time zones, such as Coordinated\nUniversal Time (UTC). For example:\n\nSET time_zone = \'UTC\';\nQuery OK, 0 rows affected (0.000 sec)\n\nINSERT INTO timestamp_test VALUES (\'2019-03-10 02:55:05\');\nQuery OK, 1 row affected (0.002 sec)\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, DATE with a time portion is a synonym for\nDATETIME. See also mariadb_schema.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a DATETIME column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col DATETIME;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_datetime\\G\n*************************** 1. row ***************************\n   Table: mariadb5312_datetime\nCreate Table: CREATE TABLE `mariadb5312_datetime` (\n `dt0` datetime /* mariadb-5.3 */ DEFAULT NULL,\n `dt6` datetime(6) /* mariadb-5.3 */ DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\n\nINSERT INTO t1 VALUES (\"2011-03-11\"), (\"2012-04-19 13:08:22\"),\n (\"2013-07-18 13:44:22.123456\");\n\nSELECT * FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-03-11 00:00:00 |\n| 2012-04-19 13:08:22 |\n| 2013-07-18 13:44:22 |\n+---------------------+\n\nCREATE TABLE t2 (d DATETIME(6));\n\nINSERT INTO t2 VALUES (\"2011-03-11\"), (\"2012-04-19 13:08:22\"),\n (\"2013-07-18 13:44:22.123456\");\n\nSELECT * FROM t2;\n+----------------------------+\n| d                          |\n+----------------------------+\n| 2011-03-11 00:00:00.000000 |\n| 2012-04-19 13:08:22.000000 |\n| 2013-07-18 13:44:22.123456 |\n+----------------------------++\n\nStrings used in datetime context are automatically converted to datetime(6).\nIf you want to have a datetime without seconds, you should use\nCONVERT(..,datetime).\n\nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime);\n+-----------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime) |\n+-----------------------------------------+\n| 2007-11-30 10:30:19                     |\n+-----------------------------------------+\n\nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime(6));\n+--------------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime(6)) |\n+--------------------------------------------+\n| 2007-11-30 10:30:19.000000                 |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/datetime/','','https://mariadb.com/kb/en/datetime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (290,23,'TIMESTAMP','Syntax\n------\n\nTIMESTAMP [(<microsecond precision)]\n\nDescription\n-----------\n\nA timestamp in the format YYYY-MM-DD HH:MM:SS.ffffff.\n\nThe timestamp field is generally used to define at which moment in time a row\nwas added or updated and by default will automatically be assigned the current\ndatetime when a record is inserted or updated. The automatic properties only\napply to the first TIMESTAMP in the record; subsequent TIMESTAMP columns will\nnot be changed.\n\nMariaDB includes the --mysql56-temporal-format option, on by default, which\nallows MariaDB to store TIMESTAMPs using the same low-level format MySQL 5.6\nuses.\n\nFor more information, see Internal Format.\n\nSupported Values\n----------------\n\nMariaDB stores values that use the TIMESTAMP data type as the number of\nseconds since \'1970-01-01 00:00:00\' (UTC). This means that the TIMESTAMP data\ntype can hold values between \'1970-01-01 00:00:01\' (UTC) and \'2038-01-19\n03:14:07\' (UTC).\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no\nmicrosecond precision is specified, then 0 is used by default.\n\nAutomatic Values\n----------------\n\nMariaDB has special behavior for the first column that uses the TIMESTAMP data\ntype in a specific table. For the first column that uses the TIMESTAMP data\ntype in a specific table, MariaDB automatically assigns the following\nproperties to the column:\n\n* DEFAULT CURRENT_TIMESTAMP\n* ON UPDATE CURRENT_TIMESTAMP\n\nThis means that if the column is not explicitly assigned a value in an INSERT\nor UPDATE query, then MariaDB will automatically initialize the column\'s value\nwith the current date and time.\n\nThis automatic initialization for INSERT and UPDATE queries can also be\nexplicitly enabled for a column that uses the TIMESTAMP data type by\nspecifying the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP\nclauses for the column. In these clauses, any synonym of CURRENT_TIMESTAMP is\naccepted, including CURRENT_TIMESTAMP(), NOW(), LOCALTIME, LOCALTIME(),\nLOCALTIMESTAMP, and LOCALTIMESTAMP().\n\nThis automatic initialization for INSERT queries can also be explicitly\ndisabled for a column that uses the TIMESTAMP data type by specifying a\nconstant DEFAULT value. For example, DEFAULT 0.\n\nThis automatic initialization for UPDATE queries can also be explicitly\ndisabled for a column that uses the TIMESTAMP data type by specifying a\nDEFAULT clause for the column, but no ON UPDATE clause. If a DEFAULT clause is\nexplicitly specified for a column that uses the TIMESTAMP data type, but an ON\nUPDATE clause is not specified for the column, then the timestamp value will\nnot automatically change when an UPDATE statement is executed.\n\nMariaDB also has special behavior if NULL is assigned to column that uses the\nTIMESTAMP data type. If the column is assigned the NULL value in an INSERT or\nUPDATE query, then MariaDB will automatically initialize the column\'s value\nwith the current date and time. For details, see NULL values in MariaDB.\n\nThis automatic initialization for NULL values can also be explicitly disabled\nfor a column that uses the TIMESTAMP data type by specifying the NULL\nattribute for the column. In this case, if the column\'s value is set to NULL,\nthen the column\'s value will actually be set to NULL.\n\nTime Zones\n----------\n\nIf a column uses the TIMESTAMP data type, then any inserted values are\nconverted from the session\'s time zone to Coordinated Universal Time (UTC)\nwhen stored, and converted back to the session\'s time zone when retrieved.\n\nMariaDB does not currently store any time zone identifier with the value of\nthe TIMESTAMP data type. See MDEV-10018 for more information.\n\nMariaDB does not currently support time zone literals that contain time zone\nidentifiers. See MDEV-11829 for more information.\n\nLimitations\n-----------\n\n* Because the TIMESTAMP value is stored as Epoch Seconds, the timestamp value\n\'1970-01-01 00:00:00\' (UTC) is reserved since the second #0 is used to\nrepresent \'0000-00-00 00:00:00\'.\n* In MariaDB 5.5 and before there could only be one TIMESTAMP column per table\nthat had CURRENT_TIMESTAMP defined as its default value. This limit has no\nlonger applied since MariaDB 10.0.\n\nSQL_MODE=MAXDB\n--------------\n\nIf the SQL_MODE is set to MAXDB, TIMESTAMP fields will be silently converted\nto DATETIME.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIMESTAMP column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIMESTAMP;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_timestamp\\G\n*************************** 1. row ***************************\n   Table: mariadb5312_timestamp\nCreate Table: CREATE TABLE `mariadb5312_timestamp` (\n `ts0` timestamp /* mariadb-5.3 */ NOT NULL DEFAULT current_timestamp() ON\nUPDATE current_timestamp(),\n `ts6` timestamp(6) /* mariadb-5.3 */ NOT NULL DEFAULT \'0000-00-00\n00:00:00.000000\'\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nNote: Prior to MySQL 4.1 a different format for the TIMESTAMP datatype was\nused. This format is unsupported in MariaDB 5.1 and upwards.\n\nExamples\n--------\n\nCREATE TABLE t (id INT, ts TIMESTAMP);\n\nDESC t;\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n| Field | Type      | Null | Key | Default           | Extra                  \n  |\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n| id    | int(11)   | YES  |     | NULL              |                        \n  |\n| ts    | timestamp | NO   |     | CURRENT_TIMESTAMP | on update\nCURRENT_TIMESTAMP |\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n\nINSERT INTO t(id)  VALUES (1),(2);\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    1 | 2013-07-22 12:50:05 |\n|    2 | 2013-07-22 12:50:05 |\n+------+---------------------+\n\nINSERT INTO t  VALUES (3,NULL),(4,\'2001-07-22 12:12:12\');\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    1 | 2013-07-22 12:50:05 |\n|    2 | 2013-07-22 12:50:05 |\n|    3 | 2013-07-22 12:51:56 |\n|    4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nConverting to Unix epoch:\n\nSELECT ts, UNIX_TIMESTAMP(ts) FROM t;\n+---------------------+--------------------+\n| ts                  | UNIX_TIMESTAMP(ts) |\n+---------------------+--------------------+\n| 2013-07-22 12:50:05 |         1374490205 |\n| 2013-07-22 12:50:05 |         1374490205 |\n| 2013-07-22 12:51:56 |         1374490316 |\n| 2001-07-22 12:12:12 |          995796732 |\n+---------------------+--------------------+\n\nUpdate also changes the timestamp:\n\nUPDATE t set id=5 WHERE id=1;\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    5 | 2013-07-22 14:52:33 |\n|    2 | 2013-07-22 12:50:05 |\n|    3 | 2013-07-22 12:51:56 |\n|    4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nDefault NULL:\n\nCREATE TABLE t2 (id INT, ts TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP);\n\nINSERT INTO t(id)  VALUES (1),(2);\n\nSELECT * FROM t2;\n\nINSERT INTO t2(id)  VALUES (1),(2);\n\nSELECT * FROM t2;\n+------+------+\n| id   | ts   |\n+------+------+\n|    1 | NULL |\n|    2 | NULL |\n+------+------+\n\nUPDATE t2 SET id=3 WHERE id=1;\n\nSELECT * FROM t2;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    3 | 2013-07-22 15:32:22 |\n|    2 | NULL                |\n+------+---------------------+\n\nOnly the first timestamp is automatically inserted and updated:\n\nCREATE TABLE t3 (id INT, ts1 TIMESTAMP, ts2 TIMESTAMP);\n\nINSERT INTO t3(id)  VALUES (1),(2);\n\nSELECT * FROM t3;\n+------+---------------------+---------------------+\n| id   | ts1                 | ts2                 |\n+------+---------------------+---------------------+\n|    1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n|    2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n+------+---------------------+---------------------+\n\nDESC t3;\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n| Field | Type      | Null | Key | Default             | Extra                \n   |\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n| id    | int(11)   | YES  |     | NULL                |                      \n   |\n| ts1   | timestamp | NO   |     | CURRENT_TIMESTAMP   | on update\nCURRENT_TIMESTAMP |\n| ts2   | timestamp | NO   |     | 0000-00-00 00:00:00 |                      \n   |\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n\nExplicitly setting a timestamp with the CURRENT_TIMESTAMP function:\n\nINSERT INTO t3(id,ts2)  VALUES (3,CURRENT_TIMESTAMP());\n\nSELECT * FROM t3;\n+------+---------------------+---------------------+\n| id   | ts1                 | ts2                 |\n+------+---------------------+---------------------+\n|    1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n|    2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n|    3 | 2013-07-22 15:38:52 | 2013-07-22 15:38:52 |\n+------+---------------------+---------------------+\n\nSpecifying the timestamp as NOT NULL:\n\nCREATE TABLE t4 (id INT, ts TIMESTAMP NOT NULL);\n\nINSERT INTO t4(id)  VALUES (1);\nSELECT SLEEP(1);\nINSERT INTO t4(id,ts) VALUES (2,NULL);\n\nSELECT * FROM t4;\n\nURL: https://mariadb.com/kb/en/timestamp/','','https://mariadb.com/kb/en/timestamp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (291,23,'YEAR Data Type','Syntax\n------\n\nYEAR[(4)]\n\nDescription\n-----------\n\nA year in two-digit or four-digit format. The default is four-digit format.\nNote that the two-digit format has been deprecated since MariaDB 5.5.27.\n\nIn four-digit format, the allowable values are 1901 to 2155, and 0000. In\ntwo-digit format, the allowable values are 70 to 69, representing years from\n1970 to 2069. MariaDB displays YEAR values in YYYY format, but allows you to\nassign values to YEAR columns using either strings or numbers.\n\nInserting numeric zero has a different result for YEAR(4) and YEAR(2). For\nYEAR(2), the value 00 reflects the year 2000. For YEAR(4), the value 0000\nreflects the year zero. This only applies to numeric zero. String zero always\nreflects the year 2000.\n\nExamples\n--------\n\nAccepting a string or a number:\n\nCREATE TABLE y(y YEAR);\n\nINSERT INTO y VALUES (1990),(\'2012\');\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nOut of range:\n\nINSERT INTO y VALUES (1005),(\'3080\');\nERROR 1264 (22003): Out of range value for column \'y\' at row 1\n\nINSERT INTO y VALUES (\'2013-12-12\');\nERROR 1265 (01000): Data truncated for column \'y\' at row 1\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nOut of range:\n\nINSERT INTO y VALUES (1005),(\'3080\');\nQuery OK, 2 rows affected, 2 warnings (0.05 sec)\nRecords: 2  Duplicates: 0  Warnings: 2\n\nSHOW WARNINGS;\n+---------+------+--------------------------------------------+\n| Level   | Code | Message                                    |\n+---------+------+--------------------------------------------+\n| Warning | 1264 | Out of range value for column \'y\' at row 1 |\n| Warning | 1264 | Out of range value for column \'y\' at row 2 |\n+---------+------+--------------------------------------------+\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n+------+\n\nTruncating:\n\nINSERT INTO y VALUES (\'2013-12-12\');\nQuery OK, 1 row affected, 1 warning (0.05 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1265 | Data truncated for column \'y\' at row 1 |\n+---------+------+----------------------------------------+\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n| 2013 |\n+------+\n\nDifference between YEAR(2) and YEAR(4), and string and numeric zero:\n\nCREATE TABLE y2(y YEAR(4), y2 YEAR(2));\nQuery OK, 0 rows affected, 1 warning (0.40 sec)\n\nNote (Code 1287): \'YEAR(2)\' is deprecated and will be removed in a future\nrelease. \n Please use YEAR(4) instead\n\nINSERT INTO y2 VALUES(0,0),(\'0\',\'0\');\n\nSELECT YEAR(y),YEAR(y2) FROM y2;\n+---------+----------+\n| YEAR(y) | YEAR(y2) |\n+---------+----------+\n|       0 |     2000 |\n|    2000 |     2000 |\n+---------+----------+\n\nURL: https://mariadb.com/kb/en/year-data-type/','','https://mariadb.com/kb/en/year-data-type/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (292,23,'AUTO_INCREMENT','Description\n-----------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new\nrows. When you insert a new record to the table (or upon adding an\nAUTO_INCREMENT attribute with the ALTER TABLE statement), and the\nauto_increment field is NULL or DEFAULT (in the case of an INSERT), the value\nwill automatically be incremented. This also applies to 0, unless the\nNO_AUTO_VALUE_ON_ZERO SQL_MODE is enabled.\n\nAUTO_INCREMENT columns start from 1 by default. The automatically generated\nvalue can never be lower than 0.\n\nEach table can have only one AUTO_INCREMENT column. It must defined as a key\n(not necessarily the PRIMARY KEY or UNIQUE key). In some storage engines\n(including the default InnoDB), if the key consists of multiple columns, the\nAUTO_INCREMENT column must be the first column. Storage engines that permit\nthe column to be placed elsewhere are Aria, MyISAM, MERGE, Spider, TokuDB,\nBLACKHOLE, FederatedX and Federated.\n\nCREATE TABLE animals (\n  id MEDIUMINT NOT NULL AUTO_INCREMENT,\n  name CHAR(30) NOT NULL,\n  PRIMARY KEY (id)\n );\n\nINSERT INTO animals (name) VALUES\n  (\'dog\'),(\'cat\'),(\'penguin\'),\n  (\'fox\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n+----+---------+\n| id | name    |\n+----+---------+\n|  1 | dog     |\n|  2 | cat     |\n|  3 | penguin |\n|  4 | fox     |\n|  5 | whale   |\n|  6 | ostrich |\n+----+---------+\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nCREATE TABLE t (id SERIAL, c CHAR(1)) ENGINE=InnoDB;\n\nSHOW CREATE TABLE t \\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `c` char(1) DEFAULT NULL,\n UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSetting or Changing the Auto_Increment Value\n--------------------------------------------\n\nYou can use an ALTER TABLE statement to assign a new value to the\nauto_increment table option, or set the insert_id server system variable to\nchange the next AUTO_INCREMENT value inserted by the current session.\n\nLAST_INSERT_ID() can be used to see the last AUTO_INCREMENT value inserted by\nthe current session.\n\nALTER TABLE animals AUTO_INCREMENT=8;\n\nINSERT INTO animals (name) VALUES (\'aardvark\');\n\nSELECT * FROM animals;\n+----+-----------+\n| id | name      |\n+----+-----------+\n|  1 | dog       |\n|  2 | cat       |\n|  3 | penguin   |\n|  4 | fox       |\n|  5 | whale     |\n|  6 | ostrich   |\n|  8 | aardvark  |\n+----+-----------+\n\nSET insert_id=12;\n\nINSERT INTO animals (name) VALUES (\'gorilla\');\n\nSELECT * FROM animals;\n+----+-----------+\n| id | name      |\n+----+-----------+\n|  1 | dog       |\n|  2 | cat       |\n|  3 | penguin   |\n|  4 | fox       |\n|  5 | whale     |\n|  6 | ostrich   |\n|  8 | aardvark  |\n| 12 | gorilla   |\n+----+-----------+\n\nInnoDB\n------\n\nUntil MariaDB 10.2.3, InnoDB used an auto-increment counter that is stored in\nmemory. When the server restarts, the counter is re-initialized to the highest\nvalue used in the table, which cancels the effects of any AUTO_INCREMENT = N\noption in the table statements.\n\nFrom MariaDB 10.2.4, this restriction has been lifted and AUTO_INCREMENT is\npersistent.\n\nSee also AUTO_INCREMENT Handling in InnoDB.\n\nSetting Explicit Values\n-----------------------\n\nIt is possible to specify a value for an AUTO_INCREMENT column. If the key is\nprimary or unique, the value must not already exist in the key.\n\nIf the new value is higher than the current maximum value, the AUTO_INCREMENT\nvalue is updated, so the next value will be higher. If the new value is lower\nthan the current maximum value, the AUTO_INCREMENT value remains unchanged.\n\nThe following example demonstrates these behaviors:\n\nCREATE TABLE t (id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE =\nInnoDB;\n\nINSERT INTO t VALUES (NULL);\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n+----+\n\nINSERT INTO t VALUES (10); -- higher value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n| 10 |\n+----+\n\nINSERT INTO t VALUES (2); -- lower value\nINSERT INTO t VALUES (NULL); -- auto value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n|  2 |\n| 10 |\n| 11 |\n+----+\n\nThe ARCHIVE storage engine does not allow to insert a value that is lower than\nthe current maximum.\n\nMissing Values\n--------------\n\nAn AUTO_INCREMENT column normally has missing values. This happens because if\na row is deleted, or an AUTO_INCREMENT value is explicitly updated, old values\nare never re-used. The REPLACE statement also deletes a row, and its value is\nwasted. With InnoDB, values can be reserved by a transaction; but if the\ntransaction fails (for example, because of a ROLLBACK) the reserved value will\nbe lost.\n\nThus AUTO_INCREMENT values can be used to sort results in a chronological\norder, but not to create a numeric sequence.\n\nReplication\n-----------\n\nTo make master-master or Galera safe to use AUTO_INCREMENT one should use the\nsystem variables auto_increment_increment and auto_increment_offset to\ngenerate unique values for each server.\n\nCHECK Constraints, DEFAULT Values and Virtual Columns\n-----------------------------------------------------\n\nMariaDB starting with 10.2.6\n----------------------------\nFrom MariaDB 10.2.6 auto_increment columns are no longer permitted in CHECK\nconstraints, DEFAULT value expressions and virtual columns. They were\npermitted in earlier versions, but did not work correctly. See MDEV-11117.\n\nGenerating Auto_Increment Values When Adding the Attribute\n----------------------------------------------------------\n\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (0),(0),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 1 |\n| 2 |\n| 3 |\n+---+\n\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (5),(0),(8),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 5 |\n| 6 |\n| 8 |\n| 9 |\n+---+\n\nIf the NO_AUTO_VALUE_ON_ZERO SQL_MODE is set, zero values will not be\nautomatically incremented:\n\nSET SQL_MODE=\'no_auto_value_on_zero\';\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (3), (0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 0 |\n| 3 |\n+---+\n\nURL: https://mariadb.com/kb/en/auto_increment/','','https://mariadb.com/kb/en/auto_increment/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (293,24,'Using Compound Statements Outside of Stored Programs','Compound statements can also be used outside of stored programs.\n\ndelimiter |\nIF @have_innodb THEN\n CREATE TABLE IF NOT EXISTS innodb_index_stats (\n  database_name    VARCHAR(64) NOT NULL,\n  table_name       VARCHAR(64) NOT NULL,\n  index_name       VARCHAR(64) NOT NULL,\n  last_update      TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE\nCURRENT_TIMESTAMP,\n  stat_name        VARCHAR(64) NOT NULL,\n  stat_value       BIGINT UNSIGNED NOT NULL,\n  sample_size      BIGINT UNSIGNED,\n  stat_description VARCHAR(1024) NOT NULL,\n  PRIMARY KEY (database_name, table_name, index_name, stat_name)\n ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;\nEND IF|\nQuery OK, 0 rows affected, 2 warnings (0.00 sec)\n\nNote, that using compound statements this way is subject to following\nlimitations:\n\n* Only BEGIN, IF, CASE, LOOP, WHILE, REPEAT statements may start a compound\nstatement outside of stored programs.\n* BEGIN must use the BEGIN NOT ATOMIC syntax (otherwise it\'ll be confused with\nBEGIN that starts a transaction).\n* A compound statement might not start with a label.\n* A compound statement is parsed completely—note \"2 warnings\" in the above\nexample, even if the condition was false (InnoDB was, indeed, disabled), and\nthe CREATE TABLE statement was not executed, it was still parsed and the\nparser produced \"Unknown storage engine\" warning.\n\nInside a compound block first three limitations do not apply, one can use\nanything that can be used inside a stored program — including labels,\ncondition handlers, variables, and so on:\n\nBEGIN NOT ATOMIC\n  DECLARE foo CONDITION FOR 1146;\n  DECLARE x INT DEFAULT 0;\n  DECLARE CONTINUE HANDLER FOR SET x=1;\n  INSERT INTO test.t1 VALUES (\"hndlr1\", val, 2);\n  END|\n\nExample how to use IF:\n\nIF (1>0) THEN BEGIN NOT ATOMIC SELECT 1; END ; END IF;;\n\nExample of how to use WHILE loop:\n\nDELIMITER |\nBEGIN NOT ATOMIC\n  DECLARE x INT DEFAULT 0;\n  WHILE x <= 10 DO\n    SET x = x + 1;\n    SELECT x;\n  END WHILE;\nEND|\nDELIMITER ;\n\nURL:\nhttps://mariadb.com/kb/en/using-compound-statements-outside-of-stored-programs/','','https://mariadb.com/kb/en/using-compound-statements-outside-of-stored-programs/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,24,'BEGIN END','Syntax\n------\n\n[begin_label:] BEGIN [NOT ATOMIC]\n  [statement_list]\nEND [end_label]\n\nNOT ATOMIC is required when used outside of a stored procedure. Inside stored\nprocedures or within an anonymous block, BEGIN alone starts a new anonymous\nblock.\n\nDescription\n-----------\n\nBEGIN ... END syntax is used for writing compound statements. A compound\nstatement can contain multiple statements, enclosed by the BEGIN and END\nkeywords. statement_list represents a list of one or more statements, each\nterminated by a semicolon (i.e., ;) statement delimiter. statement_list is\noptional, which means that the empty compound statement (BEGIN END) is legal.\n\nNote that END will perform a commit. If you are running in autocommit mode,\nevery statement will be committed separately. If you are not running in\nautocommit mode, you must execute a COMMIT or ROLLBACK after END to get the\ndatabase up to date.\n\nUse of multiple statements requires that a client is able to send statement\nstrings containing the ; statement delimiter. This is handled in the mysql\ncommand-line client with the DELIMITER command. Changing the ;\nend-of-statement delimiter (for example, to //) allows ; to be used in a\nprogram body.\n\nA compound statement within a stored program can be labeled. end_label cannot\nbe given unless begin_label also is present. If both are present, they must be\nthe same.\n\nBEGIN ... END constructs can be nested. Each block can define its own\nvariables, a CONDITION, a HANDLER and a CURSOR, which don\'t exist in the outer\nblocks. The most local declarations override the outer objects which use the\nsame name (see example below).\n\nThe declarations order is the following:\n\n* DECLARE local variables;\n* DECLARE CONDITIONs;\n* DECLARE CURSORs;\n* DECLARE HANDLERs;\n\nNote that DECLARE HANDLER contains another BEGIN ... END construct.\n\nHere is an example of a very simple, anonymous block:\n\nBEGIN NOT ATOMIC\nSET @a=1;\nCREATE TABLE test.t1(a INT);\nEND|\n\nBelow is an example of nested blocks in a stored procedure:\n\nCREATE PROCEDURE t( )\nBEGIN\n DECLARE x TINYINT UNSIGNED DEFAULT 1;\n BEGIN\n   DECLARE x CHAR(2) DEFAULT \'02\';\n   DECLARE y TINYINT UNSIGNED DEFAULT 10;\n   SELECT x, y;\n END;\n SELECT x;\nEND;\n\nIn this example, a TINYINT variable, x is declared in the outter block. But in\nthe inner block x is re-declared as a CHAR and an y variable is declared. The\ninner SELECT shows the \"new\" value of x, and the value of y. But when x is\nselected in the outer block, the \"old\" value is returned. The final SELECT\ndoesn\'t try to read y, because it doesn\'t exist in that context.\n\nURL: https://mariadb.com/kb/en/begin-end/','','https://mariadb.com/kb/en/begin-end/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (295,24,'CASE Statement','Syntax\n------\n\nCASE case_value\n  WHEN when_value THEN statement_list\n  [WHEN when_value THEN statement_list] ...\n  [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n  WHEN search_condition THEN statement_list\n  [WHEN search_condition THEN statement_list] ...\n  [ELSE statement_list]\nEND CASE\n\nDescription\n-----------\n\nThe text on this page describes the CASE statement for stored programs. See\nthe CASE OPERATOR for details on the CASE operator outside of stored programs.\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct. If a search_condition evaluates to true, the corresponding SQL\nstatement list is executed. If no search condition matches, the statement list\nin the ELSE clause is executed. Each statement_list consists of one or more\nstatements.\n\nThe CASE statement cannot have an ELSE NULL clause, and it is terminated with\nEND CASE instead of END. implements a complex conditional construct. If a\nsearch_condition evaluates to true, the corresponding SQL statement list is\nexecuted. If no search condition matches, the statement list in the ELSE\nclause is executed. Each statement_list consists of one or more statements.\n\nIf no when_value or search_condition matches the value tested and the CASE\nstatement contains no ELSE clause, a Case not found for CASE statement error\nresults.\n\nEach statement_list consists of one or more statements; an empty\nstatement_list is not allowed. To handle situations where no value is matched\nby any WHEN clause, use an ELSE containing an empty BEGIN ... END block, as\nshown in this example:\n\nDELIMITER |\nCREATE PROCEDURE p()\nBEGIN\n DECLARE v INT DEFAULT 1;\n CASE v\n  WHEN 2 THEN SELECT v;\n  WHEN 3 THEN SELECT 0;\n  ELSE BEGIN END;\n END CASE;\nEND;\n|\n\nThe indentation used here in the ELSE clause is for purposes of clarity only,\nand is not otherwise significant. See Delimiters in the mysql client for more\non the use of the delimiter command.\n\nNote: The syntax of the CASE statement used inside stored programs differs\nslightly from that of the SQL CASE expression described in CASE OPERATOR. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated with END\nCASE instead of END.\n\nURL: https://mariadb.com/kb/en/case-statement/','','https://mariadb.com/kb/en/case-statement/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (296,24,'DECLARE CONDITION','Syntax\n------\n\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n  SQLSTATE [VALUE] sqlstate_value\n | mysql_error_code\n\nDescription\n-----------\n\nThe DECLARE ... CONDITION statement defines a named error condition. It\nspecifies a condition that needs specific handling and associates a name with\nthat condition. Later, the name can be used in a DECLARE ... HANDLER, SIGNAL\nor RESIGNAL statement (as long as the statement is located in the same BEGIN\n... END block).\n\nConditions must be declared after local variables, but before CURSORs and\nHANDLERs.\n\nA condition_value for DECLARE ... CONDITION can be an SQLSTATE value (a\n5-character string literal) or a MySQL error code (a number). You should not\nuse SQLSTATE value \'00000\' or MySQL error code 0, because those indicate\nsucess rather than an error condition. If you try, or if you specify an\ninvalid SQLSTATE value, an error like this is produced:\n\nERROR 1407 (42000): Bad SQLSTATE: \'00000\'\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\nURL: https://mariadb.com/kb/en/declare-condition/','','https://mariadb.com/kb/en/declare-condition/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (297,24,'DECLARE HANDLER','Syntax\n------\n\nDECLARE handler_type HANDLER\n  FOR condition_value [, condition_value] ...\n  statement\n\nhandler_type:\n  CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n  SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n | mariadb_error_code\n\nDescription\n-----------\n\nThe DECLARE ... HANDLER statement specifies handlers that each may deal with\none or more conditions. If one of these conditions occurs, the specified\nstatement is executed. statement can be a simple statement (for example, SET\nvar_name = value), or it can be a compound statement written using BEGIN and\nEND.\n\nHandlers must be declared after local variables, a CONDITION and a CURSOR.\n\nFor a CONTINUE handler, execution of the current program continues after\nexecution of the handler statement. For an EXIT handler, execution terminates\nfor the BEGIN ... END compound statement in which the handler is declared.\n(This is true even if the condition occurs in an inner block.) The UNDO\nhandler type statement is not supported.\n\nIf a condition occurs for which no handler has been declared, the default\naction is EXIT.\n\nA condition_value for DECLARE ... HANDLER can be any of the following values:\n\n* An SQLSTATE value (a 5-character string literal) or a MariaDB error\ncode (a number). You should not use SQLSTATE value \'00000\' or MariaDB\nerror code 0, because those indicate sucess rather than an error\ncondition. For a list of SQLSTATE values and MariaDB error codes, see\nMariaDB Error Codes.\n* A condition name previously specified with DECLARE ... CONDITION. It must be\nin the same stored program. See DECLARE CONDITION.\n* SQLWARNING is shorthand for the class of SQLSTATE values that begin\nwith \'01\'.\n* NOT FOUND is shorthand for the class of SQLSTATE values that begin\nwith \'02\'. This is relevant only the context of cursors and is used to\ncontrol what happens when a cursor reaches the end of a data set. If\nno more rows are available, a No Data condition occurs with SQLSTATE\nvalue 02000. To detect this condition, you can set up a handler for it\n(or for a NOT FOUND condition). An example is shown in Cursor Overview. This\ncondition also occurs for SELECT ... INTO var_list statements that retrieve no\nrows.\n* SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\nnot begin with \'00\', \'01\', or \'02\'.\n\nWhen an error raises, in some cases it could be handled by multiple HANDLERs.\nFor example, there may be an handler for 1050 error, a separate handler for\nthe 42S01 SQLSTATE, and another separate handler for the SQLEXCEPTION class:\nin theory all occurrences of HANDLER may catch the 1050 error, but MariaDB\nchooses the HANDLER with the highest precedence. Here are the precedence rules:\n\n* Handlers which refer to an error code have the highest precedence.\n* Handlers which refer to a SQLSTATE come next.\n* Handlers which refer to an error class have the lowest precedence.\n\nIn some cases, a statement could produce multiple errors. If this happens, in\nsome cases multiple handlers could have the highest precedence. In such cases,\nthe choice of the handler is indeterminate.\n\nNote that if an error occurs within a CONTINUE HANDLER block, it can be\nhandled by another HANDLER. However, a HANDLER which is already in the stack\n(that is, it has been called to handle an error and its execution didn\'t\nfinish yet) cannot handle new errors—this prevents endless loops. For example,\nsuppose that a stored procedure contains a CONTINUE HANDLER for SQLWARNING and\nanother CONTINUE HANDLER for NOT FOUND. At some point, a NOT FOUND error\noccurs, and the execution enters the NOT FOUND HANDLER. But within that\nhandler, a warning occurs, and the execution enters the SQLWARNING HANDLER. If\nanother NOT FOUND error occurs, it cannot be handled again by the NOT FOUND\nHANDLER, because its execution is not finished.\n\nWhen a DECLARE HANDLER block can handle more than one error condition, it may\nbe useful to know which errors occurred. To do so, you can use the GET\nDIAGNOSTICS statement.\n\nAn error that is handled by a DECLARE HANDLER construct can be issued again\nusing the RESIGNAL statement.\n\nBelow is an example using DECLARE HANDLER:\n\nCREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\n\nDELIMITER //\n\nCREATE PROCEDURE handlerdemo ( )\n  BEGIN\n   DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n   SET @x = 1;\n   INSERT INTO test.t VALUES (1);\n   SET @x = 2;\n   INSERT INTO test.t VALUES (1);\n   SET @x = 3;\n  END;\n  //\n\nDELIMITER ;\n\nCALL handlerdemo( );\n\nSELECT @x;\n+------+\n| @x   |\n+------+\n|    3 |\n+------+\n\nURL: https://mariadb.com/kb/en/declare-handler/','','https://mariadb.com/kb/en/declare-handler/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (298,24,'DECLARE Variable','Syntax\n------\n\nDECLARE var_name [, var_name] ... [[ROW] TYPE OF]] type [DEFAULT value]\n\nDescription\n-----------\n\nThis statement is used to declare local variables within stored programs. To\nprovide a default value for the variable, include a DEFAULT clause. The value\ncan be specified as an expression (even subqueries are permitted); it need not\nbe a constant. If the DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect to\ndata type and overflow checking. See CREATE PROCEDURE.\n\nLocal variables must be declared before CONDITIONs, CURSORs and HANDLERs.\n\nLocal variable names are not case sensitive.\n\nThe scope of a local variable is within the BEGIN ... END block where it is\ndeclared. The variable can be referred to in blocks nested within the\ndeclaring block, except those blocks that declare a variable with the same\nname.\n\nTYPE OF / ROW TYPE OF\n---------------------\n\nMariaDB starting with 10.3\n--------------------------\nTYPE OF and ROW TYPE OF anchored data types for stored routines were\nintroduced in MariaDB 10.3.\n\nAnchored data types allow a data type to be defined based on another object,\nsuch as a table row, rather than specifically set in the declaration. If the\nanchor object changes, so will the anchored data type. This can lead to\nroutines being easier to maintain, so that if the data type in the table is\nchanged, it will automatically be changed in the routine as well.\n\nVariables declared with ROW TYPE OF will have the same features as implicit\nROW variables. It is not possible to use ROW TYPE OF variables in a LIMIT\nclause.\n\nThe real data type of TYPE OF and ROW TYPE OF table_name will become known at\nthe very beginning of the stored routine call. ALTER TABLE or DROP TABLE\nstatements performed inside the current routine on the tables that appear in\nanchors won\'t affect the data type of the anchored variables, even if the\nvariable is declared after an ALTER TABLE or DROP TABLE statement.\n\nThe real data type of a ROW TYPE OF cursor_name variable will become known\nwhen execution enters into the block where the variable is declared. Data type\ninstantiation will happen only once. In a cursor ROW TYPE OF variable that is\ndeclared inside a loop, its data type will become known on the very first\niteration and won\'t change on further loop iterations.\n\nThe tables referenced in TYPE OF and ROW TYPE OF declarations will be checked\nfor existence at the beginning of the stored routine call. CREATE PROCEDURE or\nCREATE FUNCTION will not check the referenced tables for existence.\n\nExamples\n--------\n\nTYPE OF and ROW TYPE OF from MariaDB 10.3:\n\nDECLARE tmp TYPE OF t1.a; -- Get the data type from the column {{a}} in the\ntable {{t1}}\n\nDECLARE rec1 ROW TYPE OF t1; -- Get the row data type from the table {{t1}}\n\nDECLARE rec2 ROW TYPE OF cur1; -- Get the row data type from the cursor\n{{cur1}}\n\nURL: https://mariadb.com/kb/en/declare-variable/','','https://mariadb.com/kb/en/declare-variable/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (299,24,'FOR','MariaDB starting with 10.3\n--------------------------\nFOR loops were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nInteger range FOR loop:\n\n[begin_label:]\nFOR var_name IN [ REVERSE ] lower_bound .. upper_bound\nDO statement_list\nEND FOR [ end_label ]\n\nExplicit cursor FOR loop\n\n[begin_label:]\nFOR record_name IN cursor_name [ ( cursor_actual_parameter_list)]\nDO statement_list\nEND FOR [ end_label ]\n\nExplicit cursor FOR loop (Oracle mode)\n\n[begin_label:]\nFOR record_name IN cursor_name [ ( cursor_actual_parameter_list)]\nLOOP\n statement_list\nEND LOOP [ end_label ]\n\nImplicit cursor FOR loop\n\n[begin_label:]\nFOR record_name IN ( select_statement )\nDO statement_list\nEND FOR [ end_label ]\n\nDescription\n-----------\n\nFOR loops allow code to be executed a fixed number of times.\n\nIn an integer range FOR loop, MariaDB will compare the lower bound and upper\nbound values, and assign the lower bound value to a counter. If REVERSE is not\nspecified, and the upper bound value is greater than or equal to the counter,\nthe counter will be incremented and the statement will continue, after which\nthe loop is entered again. If the upper bound value is greater than the\ncounter, the loop will be exited.\n\nIf REVERSE is specified, the counter is decremented, and the upper bound value\nneeds to be less than or equal for the loop to continue.\n\nExamples\n--------\n\nIntger range FOR loop:\n\nCREATE TABLE t1 (a INT);\n\nDELIMITER //\n\nFOR i IN 1..3\nDO\n INSERT INTO t1 VALUES (i);\nEND FOR;\n//\n\nDELIMITER ;\n\nSELECT * FROM t1;\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nREVERSE integer range FOR loop:\n\nCREATE OR REPLACE TABLE t1 (a INT);\n\nDELIMITER //\nFOR i IN REVERSE 4..12\n  DO\n  INSERT INTO t1 VALUES (i);\nEND FOR;\n//\nQuery OK, 9 rows affected (0.422 sec)\n\nDELIMITER ;\n\nSELECT * FROM t1;\n+------+\n| a    |\n+------+\n|   12 |\n|   11 |\n|   10 |\n|    9 |\n|    8 |\n|    7 |\n|    6 |\n|    5 |\n|    4 |\n+------+\n\nExplicit cursor in Oracle mode:\n\nSET sql_mode=ORACLE;\n\nCREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(32));\n\nINSERT INTO t1 VALUES (10,\'b0\');\nINSERT INTO t1 VALUES (11,\'b1\');\nINSERT INTO t1 VALUES (12,\'b2\');\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE p1(pa INT) AS \n CURSOR cur(va INT) IS\n  SELECT a, b FROM t1 WHERE a=va;\nBEGIN\n FOR rec IN cur(pa)\n LOOP\n  SELECT rec.a, rec.b;\n END LOOP;\nEND;\n//\n\nDELIMITER ;\n\nCALL p1(10);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n|    10 | b0    |\n+-------+-------+\n\nCALL p1(11);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n|    11 | b1    |\n+-------+-------+\n\nCALL p1(12);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n|    12 | b2    |\n+-------+-------+\n\nCALL p1(13);\nQuery OK, 0 rows affected (0.000 sec)\n\nURL: https://mariadb.com/kb/en/for/','','https://mariadb.com/kb/en/for/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,24,'GOTO','MariaDB starting with 10.3\n--------------------------\nThe GOTO statement was introduced in MariaDB 10.3 for Oracle compatibility.\n\nSyntax\n------\n\nGOTO label\n\nDescription\n-----------\n\nThe GOTO statement causes the code to jump to the specified label, and\ncontinue operating from there. It is only accepted when in Oracle mode.\n\nExample\n-------\n\nSET sql_mode=ORACLE;\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE p1 AS\n\nBEGIN\n\nSELECT 1;\n GOTO label;\n SELECT 2;\n <<label>>\n SELECT 3;\n\nEND;\n\n//\n\nDELIMITER\n\ncall p1();\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.000 sec)\n\n+---+\n| 3 |\n+---+\n| 3 |\n+---+\n1 row in set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/goto/','','https://mariadb.com/kb/en/goto/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (301,24,'IF','Syntax\n------\n\nIF search_condition THEN statement_list\n  [ELSEIF search_condition THEN statement_list] ...\n  [ELSE statement_list]\nEND IF;\n\nDescription\n-----------\n\nIF implements a basic conditional construct. If the search_condition evaluates\nto true, the corresponding SQL statement list is executed. If no\nsearch_condition matches, the statement list in the ELSE clause is executed.\nEach statement_list consists of one or more statements.\n\nURL: https://mariadb.com/kb/en/if/','','https://mariadb.com/kb/en/if/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (302,24,'ITERATE','Syntax\n------\n\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements. ITERATE\nmeans \"do the loop again\", and uses the statement\'s label to determine which\nstatements to repeat. The label must be in the same stored program, not in a\ncaller procedure.\n\nIf you try to use ITERATE with a non-existing label, or if the label is\nassociated to a construct which is not a loop, the following error will be\nproduced:\n\nERROR 1308 (42000): ITERATE with no matching label: <label_name>\n\nBelow is an example of how ITERATE might be used:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n  SET p1 = p1 + 1;\n  IF p1 < 10 THEN ITERATE label1; END IF;\n  LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND\n\nURL: https://mariadb.com/kb/en/iterate/','','https://mariadb.com/kb/en/iterate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (303,24,'Labels','Syntax\n------\n\nlabel: <construct>\n[label]\n\nLabels are MariaDB identifiers which can be used to identify a BEGIN ... END\nconstruct or a loop. They have a maximum length of 16 characters and can be\nquoted with backticks (i.e.., `).\n\nLabels have a start part and an end part. The start part must precede the\nportion of code it refers to, must be followed by a colon (:) and can be on\nthe same or different line. The end part is optional and adds nothing, but can\nmake the code more readable. If used, the end part must precede the\nconstruct\'s delimiter (;). Constructs identified by a label can be nested.\nEach construct can be identified by only one label.\n\nLabels need not be unique in the stored program they belong to. However, a\nlabel for an inner loop cannot be identical to a label for an outer loop. In\nthis case, the following error would be produced:\n\nERROR 1309 (42000): Redefining label <label_name>\n\nLEAVE and ITERATE statements can be used to exit or repeat a portion of code\nidentified by a label. They must be in the same Stored Routine, Trigger or\nEvent which contains the target label.\n\nBelow is an example using a simple label that is used to exit a LOOP:\n\nCREATE PROCEDURE `test_sp`()\nBEGIN\n `my_label`:\n LOOP\n   SELECT \'looping\';\n   LEAVE `my_label`;\n END LOOP;\n SELECT \'out of loop\';\nEND;\n\nThe following label is used to exit a procedure, and has an end part:\n\nCREATE PROCEDURE `test_sp`()\n`my_label`:\nBEGIN\n IF @var = 1 THEN\n   LEAVE `my_label`;\n END IF;\n DO something();\nEND `my_label`;\n\nURL: https://mariadb.com/kb/en/labels/','','https://mariadb.com/kb/en/labels/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (304,24,'LEAVE','Syntax\n------\n\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the given\nlabel. The label must be in the same stored program, not in a caller\nprocedure. LEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE). In Stored Procedures, Triggers and Events, LEAVE can refer to\nthe outmost BEGIN ... END construct; in that case, the program exits the\nprocedure. In Stored Functions, RETURN can be used instead.\n\nNote that LEAVE cannot be used to exit a DECLARE HANDLER block.\n\nIf you try to LEAVE a non-existing label, or if you try to LEAVE a HANDLER\nblock, the following error will be produced:\n\nERROR 1308 (42000): LEAVE with no matching label: <label_name>\n\nThe following example uses LEAVE to exit the procedure if a condition is true:\n\nCREATE PROCEDURE proc(IN p TINYINT)\nCONTAINS SQL\n`whole_proc`:\nBEGIN\n SELECT 1;\n IF p < 1 THEN\n   LEAVE `whole_proc`;\n END IF;\n SELECT 2;\nEND;\n\nCALL proc(0);\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nURL: https://mariadb.com/kb/en/leave/','','https://mariadb.com/kb/en/leave/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (305,24,'LOOP','Syntax\n------\n\n[begin_label:] LOOP\n  statement_list\nEND LOOP [end_label]\n\nDescription\n-----------\n\nLOOP implements a simple loop construct, enabling repeated execution of the\nstatement list, which consists of one or more statements, each terminated by a\nsemicolon (i.e., ;) statement delimiter. The statements within the loop are\nrepeated until the loop is exited; usually this is accomplished with a LEAVE\nstatement.\n\nA LOOP statement can be labeled. end_label cannot be given unless begin_label\nalso is present. If both are present, they must be the same.\n\nSee Delimiters in the mysql client for more on delimiter usage in the client.\n\nURL: https://mariadb.com/kb/en/loop/','','https://mariadb.com/kb/en/loop/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,24,'REPEAT LOOP','Syntax\n------\n\n[begin_label:] REPEAT\n  statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition is true. Thus, a REPEAT always enters the loop at least once.\nstatement_list consists of one or more statements, each terminated by a\nsemicolon (i.e., ;) statement delimiter.\n\nA REPEAT statement can be labeled. end_label cannot be given unless\nbegin_label also is present. If both are present, they must be the same.\n\nSee Delimiters in the mysql client for more on client delimiter usage.\n\nDELIMITER //\n\nCREATE PROCEDURE dorepeat(p1 INT)\n BEGIN\n  SET @x = 0;\n  REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;\n END\n//\n\nCALL dorepeat(1000)//\n\nSELECT @x//\n+------+\n| @x   |\n+------+\n| 1001 |\n+------+\n\nURL: https://mariadb.com/kb/en/repeat-loop/','','https://mariadb.com/kb/en/repeat-loop/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (307,24,'RESIGNAL','Syntax\n------\n\nRESIGNAL [error_condition]\n  [SET error_property\n  [, error_property] ...]\n\nerror_condition:\n  SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n\nerror_property:\n  error_property_name = <error_property_value>\n\nerror_property_name:\n  CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\nDescription\n-----------\n\nThe syntax of RESIGNAL and its semantics are very similar to SIGNAL. This\nstatement can only be used within an error HANDLER. It produces an error, like\nSIGNAL. RESIGNAL clauses are the same as SIGNAL, except that they all are\noptional, even SQLSTATE. All the properties which are not specified in\nRESIGNAL, will be identical to the properties of the error that was received\nby the error HANDLER. For a description of the clauses, see diagnostics area.\n\nNote that RESIGNAL does not empty the diagnostics area: it just appends\nanother error condition.\n\nRESIGNAL, without any clauses, produces an error which is identical to the\nerror that was received by HANDLER.\n\nIf used out of a HANDLER construct, RESIGNAL produces the following error:\n\nERROR 1645 (0K000): RESIGNAL when handler not active\n\nIn MariaDB 5.5, if a HANDLER contained a CALL to another procedure, that\nprocedure could use RESIGNAL. Since MariaDB 10.0, trying to do this raises the\nabove error.\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\nThe following procedure tries to query two tables which don\'t exist, producing\na 1146 error in both cases. Those errors will trigger the HANDLER. The first\ntime the error will be ignored and the client will not receive it, but the\nsecond time, the error is re-signaled, so the client will receive it.\n\nCREATE PROCEDURE test_error( )\nBEGIN\n DECLARE CONTINUE HANDLER\n   FOR 1146\n BEGIN\n IF @hide_errors IS FALSE THEN\n   RESIGNAL;\n END IF;\n END;\n SET @hide_errors = TRUE;\n SELECT \'Next error will be ignored\' AS msg;\n SELECT `c` FROM `temptab_one`;\n SELECT \'Next error won\'\'t be ignored\' AS msg;\n SET @hide_errors = FALSE;\n SELECT `c` FROM `temptab_two`;\nEND;\n\nCALL test_error( );\n\n+----------------------------+\n| msg                        |\n+----------------------------+\n| Next error will be ignored |\n+----------------------------+\n\n+-----------------------------+\n| msg                         |\n+-----------------------------+\n| Next error won\'t be ignored |\n+-----------------------------+\n\nERROR 1146 (42S02): Table \'test.temptab_two\' doesn\'t exist\n\nThe following procedure re-signals an error, modifying only the error message\nto clarify the cause of the problem.\n\nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE CONTINUE HANDLER\n FOR 1146\n BEGIN\n   RESIGNAL SET\n   MESSAGE_TEXT = \'`temptab` does not exist\';\n END;\n SELECT `c` FROM `temptab`;\nEND;\n\nCALL test_error( );\nERROR 1146 (42S02): `temptab` does not exist\n\nAs explained above, this works on MariaDB 5.5, but produces a 1645 error since\n10.0.\n\nCREATE PROCEDURE handle_error()\nBEGIN\n RESIGNAL;\nEND;\nCREATE PROCEDURE p()\nBEGIN\n DECLARE EXIT HANDLER FOR SQLEXCEPTION CALL p();\n SIGNAL SQLSTATE \'45000\';\nEND;\n\nURL: https://mariadb.com/kb/en/resignal/','','https://mariadb.com/kb/en/resignal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,24,'RETURN','Syntax\n------\n\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and returns the\nvalue expr to the function caller. There must be at least one RETURN statement\nin a stored function. If the function has multiple exit points, all exit\npoints must have a RETURN.\n\nThis statement is not used in stored procedures, triggers, or events. LEAVE\ncan be used instead.\n\nThe following example shows that RETURN can return the result of a scalar\nsubquery:\n\nCREATE FUNCTION users_count() RETURNS BOOL\n READS SQL DATA\nBEGIN\n RETURN (SELECT COUNT(DISTINCT User) FROM mysql.user);\nEND;\n\nURL: https://mariadb.com/kb/en/return/','','https://mariadb.com/kb/en/return/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (309,24,'SELECT INTO','Syntax\n------\n\nSELECT col_name [, col_name] ...\n  INTO var_name [, var_name] ...\n  table_expr\n\nDescription\n-----------\n\nSELECT ... INTO enables selected columns to be stored directly into variables.\nNo resultset is produced. The query should return a single row. If the query\nreturns no rows, a warning with error code 1329 occurs (No data), and the\nvariable values remain unchanged. If the query returns multiple rows, error\n1172 occurs (Result consisted of more than one row). If it is possible that\nthe statement may retrieve multiple rows, you can use LIMIT 1 to limit the\nresult set to a single row.\n\nThe INTO clause can also be specified at the end of the statement.\n\nIn the context of such statements that occur as part of events executed by the\nEvent Scheduler, diagnostics messages (not only errors, but also warnings) are\nwritten to the error log, and, on Windows, to the application event log.\n\nThis statement can be used with both local variables and user-defined\nvariables.\n\nFor the complete syntax, see SELECT.\n\nAnother way to set a variable\'s value is the SET statement.\n\nSELECT ... INTO results are not stored in the query cache even if SQL_CACHE is\nspecified.\n\nExamples\n--------\n\nSELECT id, data INTO @x,@y \nFROM test.t1 LIMIT 1;\nSELECT * from t1 where t1.a=@x and t1.b=@y\n\nIf you want to use this construct with UNION you have to use the syntax:\n\nSELECT  * INTO @x FROM (SELECT t1.a FROM t1 UNION SELECT t2.a FROM t2);\n\nURL: https://mariadb.com/kb/en/selectinto/','','https://mariadb.com/kb/en/selectinto/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (310,24,'SIGNAL','Syntax\n------\n\nSIGNAL error_condition\n  [SET error_property\n  [, error_property] ...]\n\nerror_condition:\n  SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n\nerror_property:\n  error_property_name = <error_property_value>\n\nerror_property_name:\n  CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\nSIGNAL empties the diagnostics area and produces a custom error. This\nstatement can be used anywhere, but is generally useful when used inside a\nstored program. When the error is produced, it can be caught by a HANDLER. If\nnot, the current stored program, or the current statement, will terminate with\nthe specified error.\n\nSometimes an error HANDLER just needs to SIGNAL the same error it received,\noptionally with some changes. Usually the RESIGNAL statement is the most\nconvenient way to do this.\n\nerror_condition can be an SQLSTATE value or a named error condition defined\nvia DECLARE CONDITION. SQLSTATE must be a constant string consisting of five\ncharacters. These codes are standard to ODBC and ANSI SQL. For customized\nerrors, the recommended SQLSTATE is \'45000\'. For a list of SQLSTATE values\nused by MariaDB, see the MariaDB Error Codes page. The SQLSTATE can be read\nvia the API method mysql_sqlstate( ).\n\nTo specify error properties user-defined variables and local variables can be\nused, as well as character set conversions (but you can\'t set a collation).\n\nThe error properties, their type and their default values are explained in the\ndiagnostics area page.\n\nErrors\n------\n\nIf the SQLSTATE is not valid, the following error like this will be produced:\n\nERROR 1407 (42000): Bad SQLSTATE: \'123456\'\n\nIf a property is specified more than once, an error like this will be produced:\n\nERROR 1641 (42000): Duplicate condition information item \'MESSAGE_TEXT\'\n\nIf you specify a condition name which is not declared, an error like this will\nbe produced:\n\nERROR 1319 (42000): Undefined CONDITION: cond_name\n\nIf MYSQL_ERRNO is out of range, you will get an error like this:\n\nERROR 1231 (42000): Variable \'MYSQL_ERRNO\' can\'t be set to the value of \'0\'\n\nExamples\n--------\n\nHere\'s what happens if SIGNAL is used in the client to generate errors:\n\nSIGNAL SQLSTATE \'01000\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n\n+---------+------+------------------------------------------+\n| Level   | Code | Message                                  |\n+---------+------+------------------------------------------+\n| Warning | 1642 | Unhandled user-defined warning condition |\n+---------+------+------------------------------------------+\n1 row in set (0.06 sec)\n\nSIGNAL SQLSTATE \'02000\';\nERROR 1643 (02000): Unhandled user-defined not found condition\n\nHow to specify MYSQL_ERRNO and MESSAGE_TEXT properties:\n\nSIGNAL SQLSTATE \'45000\' SET MYSQL_ERRNO=30001, MESSAGE_TEXT=\'H\nello, world!\';\n\nERROR 30001 (45000): Hello, world!\n\nThe following code shows how to use user variables, local variables and\ncharacter set conversion with SIGNAL:\n\nCREATE PROCEDURE test_error(x INT)\nBEGIN\n DECLARE errno SMALLINT UNSIGNED DEFAULT 31001;\n SET @errmsg = \'Hello, world!\';\n IF x = 1 THEN\n   SIGNAL SQLSTATE \'45000\' SET\n   MYSQL_ERRNO = errno,\n   MESSAGE_TEXT = @errmsg;\n ELSE\n   SIGNAL SQLSTATE \'45000\' SET\n   MYSQL_ERRNO = errno,\n   MESSAGE_TEXT = _utf8\'Hello, world!\';\n END IF;\nEND;\n\nHow to use named error conditions:\n\nCREATE PROCEDURE test_error(n INT)\nBEGIN\n DECLARE `too_big` CONDITION FOR SQLSTATE \'45000\';\n IF n > 10 THEN\n   SIGNAL `too_big`;\n END IF;\nEND;\n\nIn this example, we\'ll define a HANDLER for an error code. When the error\noccurs, we SIGNAL a more informative error which makes sense for our procedure:\n\nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE EXIT HANDLER\n FOR 1146\n BEGIN\n   SIGNAL SQLSTATE \'45000\' SET\n   MESSAGE_TEXT = \'Temporary tables not found; did you call init()\nprocedure?\';\n END;\n -- this will produce a 1146 error\n SELECT `c` FROM `temptab`;\nEND;\n\nURL: https://mariadb.com/kb/en/signal/','','https://mariadb.com/kb/en/signal/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (311,24,'WHILE','Syntax\n------\n\n[begin_label:] WHILE search_condition DO\n  statement_list\nEND WHILE [end_label]\n\nDescription\n-----------\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition is true. statement_list consists of one or more statements.\nIf the loop must be executed at least once, REPEAT ... LOOP can be used\ninstead.\n\nA WHILE statement can be labeled. end_label cannot be given unless begin_label\nalso is present. If both are present, they must be the same.\n\nExamples\n--------\n\nCREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\nWHILE v1 > 0 DO\n  ...\n  SET v1 = v1 - 1;\n END WHILE;\nEND\n\nURL: https://mariadb.com/kb/en/while/','','https://mariadb.com/kb/en/while/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (312,24,'Cursor Overview','Description\n-----------\n\nA cursor is a structure that allows you to go over records sequentially, and\nperform processing based on the result.\n\nMariaDB permits cursors inside stored programs, and MariaDB cursors are\nnon-scrollable, read-only and asensitive.\n\n* Non-scrollable means that the rows can only be fetched in the order\nspecified by the SELECT statement. Rows cannot be skipped, you cannot jump to\na specific row, and you cannot fetch rows in reverse order.\n* Read-only means that data cannot be updated through the cursor.\n* Asensitive means that the cursor points to the actual underlying data. This\nkind of cursor is quicker than the alternative, an insensitive cursor, as no\ndata is copied to a temporary table. However, changes to the data being used\nby the cursor will affect the cursor data.\n\nCursors are created with a DECLARE CURSOR statement and opened with an OPEN\nstatement. Rows are read with a FETCH statement before the cursor is finally\nclosed with a CLOSE statement.\n\nWhen FETCH is issued and there are no more rows to extract, the following\nerror is produced:\n\nERROR 1329 (02000): No data - zero rows fetched, selected, or processed\n\nTo avoid problems, a DECLARE HANDLER statement is generally used. The HANDLER\nshould handler the 1329 error, or the \'02000\' SQLSTATE, or the NOT FOUND error\nclass.\n\nOnly SELECT statements are allowed for cursors, and they cannot be contained\nin a variable - so, they cannot be composed dynamically. However, it is\npossible to SELECT from a view. Since the CREATE VIEW statement can be\nexecuted as a prepared statement, it is possible to dynamically create the\nview that is queried by the cursor.\n\nFrom MariaDB 10.3.0, cursors can have parameters. Cursor parameters can appear\nin any part of the DECLARE CURSOR select_statement where a stored procedure\nvariable is allowed (select list, WHERE, HAVING, LIMIT etc). See DECLARE\nCURSOR and OPEN for syntax, and below for an example:\n\nExamples\n--------\n\nCREATE TABLE c1(i INT);\n\nCREATE TABLE c2(i INT);\n\nCREATE TABLE c3(i INT);\n\nDELIMITER //\n\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE x, y INT;\n DECLARE cur1 CURSOR FOR SELECT i FROM test.c1;\n DECLARE cur2 CURSOR FOR SELECT i FROM test.c2;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\nOPEN cur1;\n OPEN cur2;\n\nread_loop: LOOP\n  FETCH cur1 INTO x;\n  FETCH cur2 INTO y;\n  IF done THEN\n   LEAVE read_loop;\n  END IF;\n  IF x < y THEN\n   INSERT INTO test.c3 VALUES (x);\n  ELSE\n   INSERT INTO test.c3 VALUES (y);\n  END IF;\n END LOOP;\n\nCLOSE cur1;\n CLOSE cur2;\nEND; //\n\nDELIMITER ;\n\nINSERT INTO c1 VALUES(5),(50),(500);\n\nINSERT INTO c2 VALUES(10),(20),(30);\n\nCALL p1;\n\nSELECT * FROM c3;\n+------+\n| i    |\n+------+\n|    5 |\n|   20 |\n|   30 |\n+------+\n\nFrom MariaDB 10.3.0\n\nDROP PROCEDURE IF EXISTS p1;\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(10));\n\nINSERT INTO t1 VALUES (1,\'old\'),(2,\'old\'),(3,\'old\'),(4,\'old\'),(5,\'old\');\n\nDELIMITER //\n\nCREATE PROCEDURE p1(min INT,max INT)\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE va INT;\n DECLARE cur CURSOR(pmin INT, pmax INT) FOR SELECT a FROM t1 WHERE a BETWEEN\npmin AND pmax;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=TRUE;\n OPEN cur(min,max);\n read_loop: LOOP\n  FETCH cur INTO va;\n  IF done THEN\n   LEAVE read_loop;\n  END IF;\n  INSERT INTO t1 VALUES (va,\'new\');\n END LOOP;\n CLOSE cur;\nEND;\n//\n\nDELIMITER ;\n\nCALL p1(2,4);\n\nSELECT * FROM t1;\n+------+------+\n| a    | b    |\n+------+------+\n|    1 | old  |\n|    2 | old  |\n|    3 | old  |\n|    4 | old  |\n|    5 | old  |\n|    2 | new  |\n|    3 | new  |\n|    4 | new  |\n+------+------+\n\nURL: https://mariadb.com/kb/en/cursor-overview/','','https://mariadb.com/kb/en/cursor-overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (313,24,'DECLARE CURSOR','Syntax\n------\n\n<= MariaDB 10.2\n\nDECLARE cursor_name CURSOR FOR select_statement\n\nFrom MariaDB 10.3\n\nDECLARE cursor_name CURSOR [(cursor_formal_parameter[,...])] FOR\nselect_statement\n\ncursor_formal_parameter:\n  name type [collate clause]\n\nFrom MariaDB 10.8\n\nDECLARE cursor_name CURSOR [(cursor_formal_parameter[,...])] FOR\nselect_statement\n\ncursor_formal_parameter:\n  [IN] name type [collate clause]\n\nDescription\n-----------\n\nThis statement declares a cursor. Multiple cursors may be declared in a stored\nprogram, but each cursor in a given block must have a unique name.\n\nselect_statement is not executed until the OPEN statement is executed. It is\nimportant to remember this if the query produces an error, or calls functions\nwhich have side effects.\n\nA SELECT associated to a cursor can use variables, but the query itself cannot\nbe a variable, and cannot be dynamically composed. The SELECT statement cannot\nhave an INTO clause.\n\nCursors must be declared before HANDLERs, but after local variables and\nCONDITIONs.\n\nParameters\n----------\n\nMariaDB starting with 10.3.0\n----------------------------\nFrom MariaDB 10.3.0, cursors can have parameters. This is a non-standard SQL\nextension. Cursor parameters can appear in any part of the DECLARE CURSOR\nselect_statement where a stored procedure variable is allowed (select list,\nWHERE, HAVING, LIMIT etc).\n\nIN\n--\n\nMariaDB starting with 10.8.0\n----------------------------\nFrom MariaDB 10.8.0 preview release, the IN qualifier is supported in the\ncursor_format_parameter part of the syntax.\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/declare-cursor/','','https://mariadb.com/kb/en/declare-cursor/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,24,'OPEN','Syntax\n------\n\n<= MariaDB 10.2\n\nOPEN cursor_name\n\nFrom MariaDB 10.3\n\nOPEN cursor_name [expression[,...]];\n\nDescription\n-----------\n\nThis statement opens a cursor which was previously declared with DECLARE\nCURSOR.\n\nThe query associated to the DECLARE CURSOR is executed when OPEN is executed.\nIt is important to remember this if the query produces an error, or calls\nfunctions which have side effects.\n\nThis is necessary in order to FETCH rows from a cursor.\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/open/','','https://mariadb.com/kb/en/open/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,24,'FETCH','Syntax\n------\n\nFETCH cursor_name INTO var_name [, var_name] ...\n\nDescription\n-----------\n\nThis statement fetches the next row (if a row exists) using the specified open\ncursor, and advances the cursor pointer.\n\nvar_name can be a local variable, but not a user-defined variable.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE value\n02000. To detect this condition, you can set up a handler for it (or for a NOT\nFOUND condition).\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/fetch/','','https://mariadb.com/kb/en/fetch/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (316,24,'CLOSE','Syntax\n------\n\nCLOSE cursor_name\n\nDescription\n-----------\n\nThis statement closes a previously opened cursor. The cursor must have been\npreviously opened or else an error occurs.\n\nIf not closed explicitly, a cursor is closed at the end of the compound\nstatement in which it was declared.\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/close/','','https://mariadb.com/kb/en/close/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,25,'BUFFER','A synonym for ST_BUFFER.\n\nURL: https://mariadb.com/kb/en/buffer/','','https://mariadb.com/kb/en/buffer/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (318,25,'CONVEXHULL','A synonym for ST_CONVEXHULL.\n\nURL: https://mariadb.com/kb/en/convexhull/','','https://mariadb.com/kb/en/convexhull/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (319,25,'GEOMETRYCOLLECTION','Syntax\n------\n\nGeometryCollection(g1,g2,...)\n\nDescription\n-----------\n\nConstructs a WKB GeometryCollection. If any argument is not a well-formed WKB\nrepresentation of a geometry, the return value is NULL.\n\nExamples\n--------\n\nCREATE TABLE gis_geometrycollection  (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n  (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n  (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n  (GeomFromText(\'GeometryCollection()\')),\n  (GeomFromText(\'GeometryCollection EMPTY\'));\n\nURL: https://mariadb.com/kb/en/geometrycollection/','','https://mariadb.com/kb/en/geometrycollection/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,25,'LINESTRING','Syntax\n------\n\nLineString(pt1,pt2,...)\n\nDescription\n-----------\n\nConstructs a WKB LineString value from a number of WKB Point arguments. If any\nargument is not a WKB Point, the return value is NULL. If the number of Point\narguments is less than two, the return value is NULL.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3)                          |\n+-------------------------------------+\n\nCREATE TABLE gis_line  (g LINESTRING);\nINSERT INTO gis_line VALUES\n  (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n  (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n  (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nURL: https://mariadb.com/kb/en/linestring/','','https://mariadb.com/kb/en/linestring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,25,'MULTILINESTRING','Syntax\n------\n\nMultiLineString(ls1,ls2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiLineString value using WKB LineString arguments. If any\nargument is not a WKB LineString, the return value is NULL.\n\nExample\n-------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16\n48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), \n  Point(3, 5)), LineString(Point(2, 5),Point(5, 8),Point(21, 7))))));\n\nURL: https://mariadb.com/kb/en/multilinestring/','','https://mariadb.com/kb/en/multilinestring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (322,25,'MULTIPOINT','Syntax\n------\n\nMultiPoint(pt1,pt2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiPoint value using WKB Point arguments. If any argument\nis not a WKB Point, the return value is NULL.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9,\n4 9, 1 5 )\');\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nINSERT INTO gis_multi_point VALUES\n  (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n  (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n  (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nURL: https://mariadb.com/kb/en/multipoint/','','https://mariadb.com/kb/en/multipoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (323,25,'MULTIPOLYGON','Syntax\n------\n\nMultiPolygon(poly1,poly2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiPolygon value from a set of WKB Polygon arguments. If\nany argument is not a WKB Polygon, the return value is NULL.\n\nExample\n-------\n\nCREATE TABLE gis_multi_polygon  (g MULTIPOLYGON);\nINSERT INTO gis_multi_polygon VALUES\n  (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),\n  ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),\n    ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(\n   Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n\nURL: https://mariadb.com/kb/en/multipolygon/','','https://mariadb.com/kb/en/multipolygon/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (324,25,'POINT','Syntax\n------\n\nPoint(x,y)\n\nDescription\n-----------\n\nConstructs a WKB Point using the given coordinates.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'Point(1 1)\');\n\nCREATE TABLE gis_point  (g POINT);\nINSERT INTO gis_point VALUES\n  (PointFromText(\'POINT(10 10)\')),\n  (PointFromText(\'POINT(20 10)\')),\n  (PointFromText(\'POINT(20 20)\')),\n  (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nURL: https://mariadb.com/kb/en/point/','','https://mariadb.com/kb/en/point/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (325,25,'PointOnSurface','A synonym for ST_PointOnSurface.\n\nURL: https://mariadb.com/kb/en/pointonsurface/','','https://mariadb.com/kb/en/pointonsurface/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (326,25,'POLYGON','Syntax\n------\n\nPolygon(ls1,ls2,...)\n\nDescription\n-----------\n\nConstructs a WKB Polygon value from a number of WKB LineString arguments. If\nany argument does not represent the WKB of a LinearRing (that is, not a closed\nand simple LineString) the return value is NULL.\n\nNote that according to the OpenGIS standard, a POLYGON should have exactly one\nExteriorRing and all other rings should lie within that ExteriorRing and thus\nbe the InteriorRings. Practically, however, some systems, including MariaDB\'s,\npermit polygons to have several \'ExteriorRings\'. In the case of there being\nmultiple, non-overlapping exterior rings ST_NUMINTERIORRINGS() will return 1.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1))\');\n\nCREATE TABLE gis_polygon   (g POLYGON);\nINSERT INTO gis_polygon VALUES\n  (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n  (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\')),\n  (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30,\n30), Point(0, 0))))));\n\nNon-overlapping \'polygon\':\n\nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n+------------------+\n| NumInteriorRings |\n+------------------+\n|                1 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/polygon/','','https://mariadb.com/kb/en/polygon/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (327,25,'ST_BUFFER','Syntax\n------\n\nST_BUFFER(g1,r)\nBUFFER(g1,r)\n\nDescription\n-----------\n\nReturns a geometry that represents all points whose distance from geometry g1\nis less than or equal to distance, or radius, r.\n\nUses for this function could include creating for example a new geometry\nrepresenting a buffer zone around an island.\n\nBUFFER() is a synonym.\n\nExamples\n--------\n\nDetermining whether a point is within a buffer zone:\n\nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(8 8)\');\n\nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,5));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,5)) |\n+---------------------------------+\n|                               1 |\n+---------------------------------+\n\nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,1));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,1)) |\n+---------------------------------+\n|                               0 |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/st_buffer/','','https://mariadb.com/kb/en/st_buffer/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (328,25,'ST_CONVEXHULL','MariaDB starting with 10.1.2\n----------------------------\nST_ConvexHull() was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_ConvexHull(g)\nConvexHull(g)\n\nDescription\n-----------\n\nGiven a geometry, returns a geometry that is the minimum convex geometry\nenclosing all geometries within the set. Returns NULL if the geometry value is\nNULL or an empty value.\n\nST_ConvexHull() and ConvexHull() are synonyms.\n\nExamples\n--------\n\nThe ConvexHull of a single point is simply the single point:\n\nSET @g = ST_GEOMFROMTEXT(\'Point(0 0)\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POINT(0 0)                   |\n+------------------------------+\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint(0 0, 1 2, 2 3)\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POLYGON((0 0,1 2,2 3,0 0))   |\n+------------------------------+\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9,\n4 9, 1 5 )\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+----------------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g))           |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_convexhull/','','https://mariadb.com/kb/en/st_convexhull/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (329,25,'ST_INTERSECTION','Syntax\n------\n\nST_INTERSECTION(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that is the intersection, or shared portion, of geometry g1\nand geometry g2.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 1, 0 2)\');\n\nSELECT ASTEXT(ST_INTERSECTION(@g1,@g2));\n+----------------------------------+\n| ASTEXT(ST_INTERSECTION(@g1,@g2)) |\n+----------------------------------+\n| POINT(2 1)                       |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_intersection/','','https://mariadb.com/kb/en/st_intersection/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,25,'ST_POINTONSURFACE','MariaDB starting with 10.1.2\n----------------------------\nST_POINTONSURFACE() was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_PointOnSurface(g)\nPointOnSurface(g)\n\nDescription\n-----------\n\nGiven a geometry, returns a POINT guaranteed to intersect a surface. However,\nsee MDEV-7514.\n\nST_PointOnSurface() and PointOnSurface() are synonyms.\n\nURL: https://mariadb.com/kb/en/st_pointonsurface/','','https://mariadb.com/kb/en/st_pointonsurface/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (331,25,'ST_SYMDIFFERENCE','Syntax\n------\n\nST_SYMDIFFERENCE(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that represents the portions of geometry g1 and geometry g2\nthat don\'t intersect.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(10 20, 10 40)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(10 15, 10 25)\');\n\nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+----------------------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2))            |\n+----------------------------------------------+\n| MULTILINESTRING((10 15,10 20),(10 25,10 40)) |\n+----------------------------------------------+\n\nSET @g2 = ST_GeomFromText(\'LINESTRING(10 20, 10 41)\');\n\nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+-----------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) |\n+-----------------------------------+\n| LINESTRING(10 40,10 41)           |\n+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_symdifference/','','https://mariadb.com/kb/en/st_symdifference/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (332,25,'ST_UNION','Syntax\n------\n\nST_UNION(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that is the union of the geometry g1 and geometry g2.\n\nExamples\n--------\n\nSET @g1 = GEOMFROMTEXT(\'POINT (0 2)\');\n\nSET @g2 = GEOMFROMTEXT(\'POINT (2 0)\');\n\nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+---------------------------+\n| ASTEXT(ST_UNION(@g1,@g2)) |\n+---------------------------+\n| MULTIPOINT(2 0,0 2)       |\n+---------------------------+\n\nSET @g1 = GEOMFROMTEXT(\'POLYGON((0 0,0 3,3 3,3 0,0 0))\');\n\nSET @g2 = GEOMFROMTEXT(\'POLYGON((2 2,4 2,4 4,2 4,2 2))\');\n\nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+------------------------------------------------+\n| ASTEXT(ST_UNION(@g1,@g2))                      |\n+------------------------------------------------+\n| POLYGON((0 0,0 3,2 3,2 4,4 4,4 2,3 2,3 0,0 0)) |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_union/','','https://mariadb.com/kb/en/st_union/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (333,26,'SHOW GRANTS','Syntax\n------\n\nSHOW GRANTS [FOR user|role]\n\nDescription\n-----------\n\nThe SHOW GRANTS statement lists privileges granted to a particular user or\nrole.\n\nUsers\n-----\n\nThe statement lists the GRANT statement or statements that must be issued to\nduplicate the privileges that are granted to a MariaDB user account. The\naccount is named using the same format as for the GRANT statement; for\nexample, \'jeffrey\'@\'localhost\'. If you specify only the user name part of the\naccount name, a host name part of \'%\' is used. For additional information\nabout specifying account names, see GRANT.\n\nSHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost                                           |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to connect to\nthe server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is used in\nDEFINER context (such as within a stored procedure that is defined with SQL\nSECURITY DEFINER), the grants displayed are those of the definer and not the\ninvoker.\n\nNote that the DELETE HISTORY privilege, introduced in MariaDB 10.3.4, was\ndisplayed as DELETE VERSIONING ROWS when running SHOW GRANTS until MariaDB\n10.3.15 (MDEV-17655).\n\nRoles\n-----\n\nSHOW GRANTS can also be used to view the privileges granted to a role.\n\nExample\n-------\n\nSHOW GRANTS FOR journalist;\n+------------------------------------------+\n| Grants for journalist                    |\n+------------------------------------------+\n| GRANT USAGE ON *.* TO \'journalist\'       |\n| GRANT DELETE ON `test`.* TO \'journalist\' |\n+------------------------------------------+\n\nFOR PUBLIC\n----------\n\nMariaDB starting with 10.11\n---------------------------\nGRANT ... TO PUBLIC was introduced in MariaDB 10.11 to grant privileges to all\nusers. SHOW GRANTS FOR PUBLIC shows all these grants.\n\nSHOW GRANTS FOR public;\n+------------------------------------------------+\n| Grants for PUBLIC                              |\n+------------------------------------------------+\n| GRANT ALL PRIVILEGES ON `dev_db`.* TO `PUBLIC` |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-grants/','','https://mariadb.com/kb/en/show-grants/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (334,26,'SHOW CREATE USER','Syntax\n------\n\nSHOW CREATE USER user_name\n\nDescription\n-----------\n\nShows the CREATE USER statement that created the given user. The statement\nrequires the SELECT privilege for the mysql database, except for the current\nuser.\n\nExamples\n--------\n\nCREATE USER foo4@test require cipher \'text\' \n issuer \'foo_issuer\' subject \'foo_subject\';\n\nSHOW CREATE USER foo4@test\\G\n*************************** 1. row ***************************\nCREATE USER \'foo4\'@\'test\' \n REQUIRE ISSUER \'foo_issuer\'\n SUBJECT \'foo_subject\'\n CIPHER \'text\'\n\nUser Password Expiry:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nSHOW CREATE USER \'monty\'@\'localhost\';\n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost                                  |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY |\n+------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-create-user/','','https://mariadb.com/kb/en/show-create-user/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (335,26,'SHOW COLUMNS','Syntax\n------\n\nSHOW [FULL] {COLUMNS | FIELDS} FROM tbl_name [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW COLUMNS displays information about the columns in a given table. It also\nworks for views. The LIKE clause, if present on its own, indicates which\ncolumn names to match. The WHERE and LIKE clauses can be given to select rows\nusing more general conditions, as discussed in Extended SHOW.\n\nIf the data types differ from what you expect them to be based on a CREATE\nTABLE statement, note that MariaDB sometimes changes data types when you\ncreate or alter a table. The conditions under which this occurs are described\nin the Silent Column Changes article.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM db_name\nsyntax. In other words, these two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for non-binary string columns, or NULL for\nother columns. This value is displayed only if you use the FULL keyword.\n\nThe Null field contains YES if NULL values can be stored in the column, NO if\nnot.\n\nThe Key field indicates whether the column is indexed:\n\n* If Key is empty, the column either is not indexed or is indexed only as a\n secondary column in a multiple-column, non-unique index.\n* If Key is PRI, the column is a PRIMARY KEY or\n is one of the columns in a multiple-column PRIMARY KEY.\n* If Key is UNI, the column is the first column of a unique-valued\n index that cannot contain NULL values.\n* If Key is MUL, multiple occurrences of a given value are allowed\n within the column. The column is the first column of a non-unique index or a\n unique-valued index that can contain NULL values.\n\nIf more than one of the Key values applies to a given column of a table, Key\ndisplays the one with the highest priority, in the order PRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values and\nthere is no PRIMARY KEY in the table. A UNIQUE index may display as MUL if\nseveral columns form a composite UNIQUE index; although the combination of the\ncolumns is unique, each column can still hold multiple occurrences of a given\nvalue.\n\nThe Default field indicates the default value that is assigned to the column.\n\nThe Extra field contains any additional information that is available about a\ngiven column.\n\n+------------------------+---------------------------------------------------+\n| Value                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| AUTO_INCREMENT         | The column was created with the AUTO_INCREMENT    |\n|                        | keyword.                                          |\n+------------------------+---------------------------------------------------+\n| PERSISTENT             | The column was created with the PERSISTENT        |\n|                        | keyword. (New in 5.3)                             |\n+------------------------+---------------------------------------------------+\n| VIRTUAL                | The column was created with the VIRTUAL keyword.  |\n|                        | (New in 5.3)                                      |\n+------------------------+---------------------------------------------------+\n| on update              | The column is a TIMESTAMP column that is          |\n| CURRENT_TIMESTAMP      | automatically updated on INSERT and UPDATE.       |\n+------------------------+---------------------------------------------------+\n\nPrivileges indicates the privileges you have for the column. This value is\ndisplayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed only if\nyou use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. Also DESCRIBE and EXPLAIN can be\nused as shortcuts.\n\nYou can also list a table\'s columns with:\n\nmysqlshow db_name tbl_name\n\nSee the mysqlshow command for more details.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS. The\ninformation_schema.COLUMNS table provides similar, but more complete,\ninformation.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements also\nprovide information about tables.\n\nExamples\n--------\n\nSHOW COLUMNS FROM city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | NO   |     |         |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | NO   |     | 0       |                |\n+------------+----------+------+-----+---------+----------------+\n\nSHOW COLUMNS FROM employees WHERE Type LIKE \'Varchar%\';\n+---------------+-------------+------+-----+---------+-------+\n| Field         | Type        | Null | Key | Default | Extra |\n+---------------+-------------+------+-----+---------+-------+\n| first_name    | varchar(30) | NO   | MUL | NULL    |       |\n| last_name     | varchar(40) | NO   |     | NULL    |       |\n| position      | varchar(25) | NO   |     | NULL    |       |\n| home_address  | varchar(50) | NO   |     | NULL    |       |\n| home_phone    | varchar(12) | NO   |     | NULL    |       |\n| employee_code | varchar(25) | NO   | UNI | NULL    |       |\n+---------------+-------------+------+-----+---------+-------+\n\nURL: https://mariadb.com/kb/en/show-columns/','','https://mariadb.com/kb/en/show-columns/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (336,26,'SHOW CREATE TABLE','Syntax\n------\n\nSHOW CREATE TABLE tbl_name\n\nDescription\n-----------\n\nShows the CREATE TABLE statement that created the given table. The statement\nrequires the SELECT privilege for the table. This statement also works with\nviews and SEQUENCE.\n\nSHOW CREATE TABLE quotes table and column names according to the value of the\nsql_quote_show_create server system variable.\n\nCertain SQL_MODE values can result in parts of the original CREATE statement\nnot being included in the output. MariaDB-specific table options, column\noptions, and index options are not included in the output of this statement if\nthe NO_TABLE_OPTIONS, NO_FIELD_OPTIONS and NO_KEY_OPTIONS SQL_MODE flags are\nused. All MariaDB-specific table attributes are also not shown when a\nnon-MariaDB/MySQL emulation mode is used, which includes ANSI, DB2,\nPOSTGRESQL, MSSQL, MAXDB or ORACLE.\n\nInvalid table options, column options and index options are normally commented\nout (note, that it is possible to create a table with invalid options, by\naltering a table of a different engine, where these options were valid). To\nhave them uncommented, enable the IGNORE_BAD_TABLE_OPTIONS SQL_MODE. Remember\nthat replaying a CREATE TABLE statement with uncommented invalid options will\nfail with an error, unless the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is in effect.\n\nNote that SHOW CREATE TABLE is not meant to provide metadata about a table. It\nprovides information about how the table was declared, but the real table\nstructure could differ a bit. For example, if an index has been declared as\nHASH, the CREATE TABLE statement returned by SHOW CREATE TABLE will declare\nthat index as HASH; however, it is possible that the index is in fact a BTREE,\nbecause the storage engine does not support HASH.\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 permits TEXT and BLOB data types to be assigned a DEFAULT\nvalue. As a result, from MariaDB 10.2.1, SHOW CREATE TABLE will append a\nDEFAULT NULL to nullable TEXT or BLOB fields if no specific default is\nprovided.\n\nMariaDB starting with 10.2.2\n----------------------------\nFrom MariaDB 10.2.2, numbers are no longer quoted in the DEFAULT clause in\nSHOW CREATE statement. Previously, MariaDB quoted numbers.\n\nIndex Order\n-----------\n\nIndexes are sorted and displayed in the following order, which may differ from\nthe order of the CREATE TABLE statement.\n\n* PRIMARY KEY\n* UNIQUE keys where all column are NOT NULL\n* UNIQUE keys that don\'t contain partial segments\n* Other UNIQUE keys\n* LONG UNIQUE keys\n* Normal keys\n* Fulltext keys\n\nSee sql/sql_table.cc for details.\n\nExamples\n--------\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `s` char(60) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nWith sql_quote_show_create off:\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE t (\n id int(11) NOT NULL AUTO_INCREMENT,\n s char(60) DEFAULT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nUnquoted numeric DEFAULTs, from MariaDB 10.2.2:\n\nCREATE TABLE td (link TINYINT DEFAULT 1);\n\nSHOW CREATE TABLE td\\G\n*************************** 1. row ***************************\n   Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT 1\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nQuoted numeric DEFAULTs, until MariaDB 10.2.1:\n\nCREATE TABLE td (link TINYINT DEFAULT 1);\n\nSHOW CREATE TABLE td\\G\n*************************** 1. row ***************************\n   Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT \'1\'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSQL_MODE impacting the output:\n\nSELECT @@sql_mode;\n+------------------------------------------------------------------------------\n------------+\n| @@sql_mode                                                                  \n      |\n+------------------------------------------------------------------------------\n------------+\n|\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SU\nSTITUTION |\n+------------------------------------------------------------------------------\n------------+\n\nCREATE TABLE `t1` (\n   `id` int(11) NOT NULL AUTO_INCREMENT,\n   `msg` varchar(100) DEFAULT NULL,\n   PRIMARY KEY (`id`)\n  ) ENGINE=InnoDB DEFAULT CHARSET=latin1\n;\n\nSHOW CREATE TABLE t1\\G\n*************************** 1. row ***************************\n   Table: t1\nCreate Table: CREATE TABLE `t1` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `msg` varchar(100) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSET SQL_MODE=ORACLE;\n\nSHOW CREATE TABLE t1\\G\n*************************** 1. row ***************************\n   Table: t1\nCreate Table: CREATE TABLE \"t1\" (\n \"id\" int(11) NOT NULL,\n \"msg\" varchar(100) DEFAULT NULL,\n PRIMARY KEY (\"id\")\n\nURL: https://mariadb.com/kb/en/show-create-table/','','https://mariadb.com/kb/en/show-create-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (337,26,'SHOW INDEX','Syntax\n------\n\nSHOW {INDEX | INDEXES | KEYS} \n FROM tbl_name [FROM db_name]\n [WHERE expr]\n\nDescription\n-----------\n\nSHOW INDEX returns table index information. The format resembles that of the\nSQLStatistics call in ODBC.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM db_name\nsyntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nSHOW KEYS and SHOW INDEXES are synonyms for SHOW INDEX.\n\nYou can also list a table\'s indexes with the mariadb-show/mysqlshow command:\n\nmysqlshow -k db_name tbl_name\n\nThe information_schema.STATISTICS table stores similar information.\n\nThe following fields are returned by SHOW INDEX.\n\n+------------------------+---------------------------------------------------+\n| Field                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| Table                  | Table name                                        |\n+------------------------+---------------------------------------------------+\n| Non_unique             | 1 if the index permits duplicate values, 0 if     |\n|                        | values must be unique.                            |\n+------------------------+---------------------------------------------------+\n| Key_name               | Index name. The primary key is always named       |\n|                        | PRIMARY.                                          |\n+------------------------+---------------------------------------------------+\n| Seq_in_index           | The column\'s sequence in the index, beginning     |\n|                        | with 1.                                           |\n+------------------------+---------------------------------------------------+\n| Column_name            | Column name.                                      |\n+------------------------+---------------------------------------------------+\n| Collation              | Either A, if the column is sorted in ascending    |\n|                        | order in the index, or NULL if it\'s not sorted.   |\n+------------------------+---------------------------------------------------+\n| Cardinality            | Estimated number of unique values in the index.   |\n|                        | The cardinality statistics are calculated at      |\n|                        | various times, and can help the optimizer make    |\n|                        | improved decisions.                               |\n+------------------------+---------------------------------------------------+\n| Sub_part               | NULL if the entire column is included in the      |\n|                        | index, or the number of included characters if    |\n|                        | not.                                              |\n+------------------------+---------------------------------------------------+\n| Packed                 | NULL if the index is not packed, otherwise how    |\n|                        | the index is packed.                              |\n+------------------------+---------------------------------------------------+\n| Null                   | NULL if NULL values are permitted in the column,  |\n|                        | an empty string if NULLs are not permitted.       |\n+------------------------+---------------------------------------------------+\n| Index_type             | The index type, which can be BTREE, FULLTEXT,     |\n|                        | HASH or RTREE. See Storage Engine Index Types.    |\n+------------------------+---------------------------------------------------+\n| Comment                | Other information, such as whether the index is   |\n|                        | disabled.                                         |\n+------------------------+---------------------------------------------------+\n| Index_comment          | Contents of the COMMENT attribute when the index  |\n|                        | was created.                                      |\n+------------------------+---------------------------------------------------+\n| Ignored                | Whether or not an index will be ignored by the    |\n|                        | optimizer. See Ignored Indexes. From MariaDB      |\n|                        | 10.6.0.                                           |\n+------------------------+---------------------------------------------------+\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n\nINSERT INTO `employees_example` (`first_name`, `last_name`, `position`,\n`home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692 Promiscuous Plaza\',\n\'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage Circle\', \'326-555-3847\',\n\'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient Avenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy Boulevard\', \'328-555-2349\',\n\'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky Lane\', \'326-555-6329\',\n\'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma Court\', \'329-555-2478\', \'HW1\');\n\nSHOW INDEXES FROM employees_example\\G\n*************************** 1. row ***************************\n    Table: employees_example\n Non_unique: 0\n  Key_name: PRIMARY\n Seq_in_index: 1\n Column_name: id\n  Collation: A\n Cardinality: 6\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n*************************** 2. row ***************************\n    Table: employees_example\n Non_unique: 0\n  Key_name: employee_code\n Seq_in_index: 1\n Column_name: employee_code\n  Collation: A\n Cardinality: 6\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n*************************** 3. row ***************************\n    Table: employees_example\n Non_unique: 1\n  Key_name: first_name\n Seq_in_index: 1\n Column_name: first_name\n  Collation: A\n Cardinality: NULL\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n*************************** 4. row ***************************\n    Table: employees_example\n Non_unique: 1\n  Key_name: first_name\n Seq_in_index: 2\n Column_name: last_name\n  Collation: A\n Cardinality: NULL\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n\nURL: https://mariadb.com/kb/en/show-index/','','https://mariadb.com/kb/en/show-index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (338,26,'SHOW EXPLAIN','Syntax\n------\n\nSHOW EXPLAIN [FORMAT=JSON] FOR <connection_id>;\nEXPLAIN [FORMAT=JSON] FOR CONNECTION <connection_id>;\n\nDescription\n-----------\n\nThe SHOW EXPLAIN command allows one to get an EXPLAIN (that is, a description\nof a query plan) of a query running in a certain connection.\n\nSHOW EXPLAIN FOR <connection_id>;\n\nwill produce an EXPLAIN output for the query that connection number\nconnection_id is running. The connection id can be obtained with SHOW\nPROCESSLIST.\n\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| id   | select_type | table | type  | possible_keys | key  | key_len | ref  |\nrows    | Extra       |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n|    1 | SIMPLE      | tbl   | index | NULL          | a    | 5       | NULL |\n1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nThe output is always accompanied with a warning which shows the query the\ntarget connection is running (this shows what the EXPLAIN is for):\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1003 | select sum(a) from tbl |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n\nEXPLAIN FOR CONNECTION\n----------------------\n\nMariaDB starting with 10.9\n--------------------------\nThe EXPLAIN FOR CONNECTION syntax was added for MySQL compatibility.\n\nFORMAT=JSON\n-----------\n\nMariaDB starting with 10.9\n--------------------------\nSHOW EXPLAIN [FORMAT=JSON] FOR <connection_id> extends SHOW EXPLAIN to return\nmore detailed JSON output.\n\nPossible Errors\n---------------\n\nThe output can be only produced if the target connection is currently running\na query, which has a ready query plan. If this is not the case, the output\nwill be:\n\nSHOW EXPLAIN FOR 2;\nERROR 1932 (HY000): Target is not running an EXPLAINable command\n\nYou will get this error when:\n\n* the target connection is not running a command for which one can run EXPLAIN\n* the target connection is running a command for which one can run EXPLAIN, but\nthere is no query plan yet (for example, tables are open and locks are\n acquired before the query plan is produced)\n\nDifferences Between SHOW EXPLAIN and EXPLAIN Outputs\n----------------------------------------------------\n\nBackground\n----------\n\nIn MySQL, EXPLAIN execution takes a slightly different route from the way the\nreal query (typically the SELECT) is optimized. This is unfortunate, and has\ncaused a number of bugs in EXPLAIN. (For example, see MDEV-326, MDEV-410, and\nlp:1013343. lp:992942 is not directly about EXPLAIN, but it also would not\nhave existed if MySQL didn\'t try to delete parts of a query plan in the middle\nof the query)\n\nSHOW EXPLAIN examines a running SELECT, and hence its output may be slightly\ndifferent from what EXPLAIN SELECT would produce. We did our best to make sure\nthat either the difference is negligible, or SHOW EXPLAIN\'s output is closer\nto reality than EXPLAIN\'s output.\n\nList of Recorded Differences\n----------------------------\n\n* SHOW EXPLAIN may have Extra=\'no matching row in const table\', where  EXPLAIN\nwould produce Extra=\'Impossible WHERE ...\'\n* For queries with subqueries, SHOW EXPLAIN may print select_type==PRIMARY\nwhere regular EXPLAIN used to print select_type==SIMPLE, or vice versa.\n\nRequired Permissions\n--------------------\n\nRunning SHOW EXPLAIN requires the same permissions as running SHOW PROCESSLIST\nwould.\n\nURL: https://mariadb.com/kb/en/show-explain/','','https://mariadb.com/kb/en/show-explain/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (339,26,'BACKUP STAGE','MariaDB starting with 10.4.1\n----------------------------\nThe BACKUP STAGE commands were introduced in MariaDB 10.4.1.\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an\nefficient external backup tool.\n\nSyntax\n------\n\nBACKUP STAGE [START | FLUSH | BLOCK_DDL | BLOCK_COMMIT | END ]\n\nIn the following text, a transactional table means InnoDB or \"InnoDB-like\nengine with redo log that can lock redo purges and can be copied without locks\nby an outside process\".\n\nGoals with BACKUP STAGE Commands\n--------------------------------\n\n* To be able to do a majority of the backup with the minimum possible server\nlocks. Especially for transactional tables (InnoDB, MyRocks etc) there is only\nneed for a very short block of new commits while copying statistics and log\ntables.\n* DDL are only needed to be blocked for a very short duration of the backup\nwhile mariabackup is copying the tables affected by DDL during the initial\npart of the backup.\n* Most non transactional tables (those that are not in use) will be copied\nduring BACKUP STAGE START.  The exceptions are system statistic and log tables\nthat are not blocked during the backup until BLOCK_COMMIT.\n* Should work efficiently with backup tools that use disk snapshots.\n* Should work as efficiently as possible for all table types that store data\non the local disks.\n* As little copying as possible under higher level stages/locks. For example,\n.frm (dictionary) and .trn (trigger) files should be copying while copying the\ntable data.\n\nBACKUP STAGE Commands\n---------------------\n\nBACKUP STAGE START\n------------------\n\nThe START stage is designed for the following tasks:\n\n* Blocks purge of redo files for storage engines that needs this (Aria)\n* Start logging of DDL commands into \'datadir\'/ddl.log. This may take a short\ntime as the command has to wait until there are no active DDL commands.\n\nBACKUP STAGE FLUSH\n------------------\n\nThe FLUSH stage is designed for the following tasks:\n\n* FLUSH all changes for inactive non-transactional tables, except for\nstatistics and log tables.\n* Close all tables that are not in use, to ensure they are marked as closed\nfor the backup.\n* BLOCK all new write locks for all non transactional tables (except\nstatistics and log tables).  The command will not wait for tables that are in\nuse by read-only transactions.\n\nDDLs don\'t have to be blocked at this stage as they can\'t cause the table to\nbe in an inconsistent state. This is true also for non-transactional tables.\n\nBACKUP STAGE BLOCK_DDL\n----------------------\n\nThe BLOCK_DDL stage is designed for the following tasks:\n\n* Wait for all statements using write locked non-transactional tables to end.\n* Blocks CREATE TABLE, DROP TABLE, TRUNCATE TABLE, and RENAME TABLE.\n* Blocks also start off a new ALTER TABLE and the final rename phase of ALTER\nTABLE. Running ALTER TABLES are not blocked.\n\nBACKUP STAGE BLOCK_COMMIT\n-------------------------\n\nThe BLOCK_COMMIT stage is designed for the following tasks:\n\n* Lock the binary log and commit/rollback to ensure that no changes are\ncommitted to any tables. If there are active commits or data to be copied to\nthe binary log this will be allowed to finish.  Active transactions will not\naffect BLOCK_COMMIT.\n* This doesn\'t lock temporary tables that are not used by replication. However\nthese will be blocked when it\'s time to write to the binary log.\n* Lock system log tables and statistics tables, flush them and mark them\nclosed.\n\nWhen the BLOCK_COMMIT\'s stages return, this is the \'backup time\'. Everything\ncommitted will be in the backup and everything not committed will roll back.\n\nTransactional engines will continue to do changes to the redo log during the\nBLOCK COMMIT stage, but this is not important as all of these will roll back\nlater as the changes will not be committed.\n\nBACKUP STAGE END\n----------------\n\nThe END stage is designed for the following tasks:\n\n* End DDL logging\n* Free resources\n\nUsing BACKUP STAGE Commands with Backup Tools\n---------------------------------------------\n\nUsing BACKUP STAGE Commands with Mariabackup\n--------------------------------------------\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an\nefficient external backup tool. How Mariabackup uses these commands depends on\nwhether you are using the version that is bundled with MariaDB Community\nServer or the version that is bundled with MariaDB Enterprise Server. See\nMariabackup and BACKUP STAGE Commands for some examples on how Mariabackup\nuses these commands.\n\nIf you would like to use a version of Mariabackup that uses the BACKUP STAGE\ncommands in an efficient way, then one option is to use MariaDB Enterprise\nBackup that is bundled with MariaDB Enterprise Server.\n\nUsing BACKUP STAGE Commands with Storage Snapshots\n--------------------------------------------------\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an\nefficient external backup tool. These commands could even be used by tools\nthat perform backups by taking a snapshot of a file system, SAN, or some other\nkind of storage device. See Storage Snapshots and BACKUP STAGE Commands for\nsome examples on how to use each BACKUP STAGE command in an efficient way.\n\nPrivileges\n----------\n\nBACKUP STAGE requires the RELOAD privilege.\n\nNotes\n-----\n\n* Only one connection can run BACKUP STAGE START. If a second connection\ntries, it will wait until the first one has executed BACKUP STAGE END.\n* If the user skips a BACKUP STAGE, then all intermediate backup stages will\nautomatically be run. This will allow us to add new stages within the BACKUP\nSTAGE hierarchy in the future with even more precise locks without causing\nproblems for tools using an earlier version of the BACKUP STAGE implementation.\n* One can use the max_statement_time or lock_wait_timeout system variables to\nensure that a BACKUP STAGE command doesn\'t block the server too long.\n* DDL logging will only be available in MariaDB Enterprise Server 10.2 and\nlater.\n* A disconnect will automatically release backup stages.\n* There is no easy way to see which is the current stage.\n\nURL: https://mariadb.com/kb/en/backup-stage/','','https://mariadb.com/kb/en/backup-stage/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (340,26,'BACKUP LOCK','MariaDB starting with 10.4.2\n----------------------------\nThe BACKUP LOCK command was introduced in MariaDB 10.4.2.\n\nBACKUP LOCK blocks a table from DDL statements. This is mainly intended to be\nused by tools like mariabackup that need to ensure there are no DDLs on a\ntable while the table files are opened. For example, for an Aria table that\nstores data in 3 files with extensions .frm, .MAI and .MAD. Normal read/write\noperations can continue as normal.\n\nSyntax\n------\n\nTo lock a table:\n\nBACKUP LOCK table_name\n\nTo unlock a table:\n\nBACKUP UNLOCK\n\nUsage in a Backup Tool\n----------------------\n\nBACKUP LOCK [database.]table_name;\n - Open all files related to a table (for example, t.frm, t.MAI and t.MYD)\nBACKUP UNLOCK;\n- Copy data\n- Close files\n\nThis ensures that all files are from the same generation, that is created at\nthe same time by the MariaDB server. This works, because the open files will\npoint to the original table files which will not be affected if there is any\nALTER TABLE while copying the files.\n\nPrivileges\n----------\n\nBACKUP LOCK requires the RELOAD privilege.\n\nNotes\n-----\n\n* The idea is that the BACKUP LOCK should be held for as short a time as\npossible by the backup tool. The time to take an uncontested lock is very\nshort! One can easily do 50,000 locks/unlocks per second on low end hardware.\n* One should use different connections for BACKUP STAGE commands and BACKUP\nLOCK.\n\nImplementation\n--------------\n\n* Internally, BACKUP LOCK is implemented by taking an MDLSHARED_HIGH_PRIO MDL\nlock on the table object, which protects the table from any DDL operations.\n\nURL: https://mariadb.com/kb/en/backup-lock/','','https://mariadb.com/kb/en/backup-lock/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (341,26,'FLUSH','Syntax\n------\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n  flush_option [, flush_option] ...\n\nor when flushing tables:\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL] TABLES [table_list]  [table_flush_option]\n\nwhere table_list is a list of tables separated by , (comma).\n\nDescription\n-----------\n\nThe FLUSH statement clears or reloads various internal caches used by MariaDB.\nTo execute FLUSH, you must have the RELOAD privilege. See GRANT.\n\nThe RESET statement is similar to FLUSH. See RESET.\n\nYou cannot issue a FLUSH statement from within a stored function or a trigger.\nDoing so within a stored procedure is permitted, as long as it is not called\nby a stored function or trigger. See Stored Routine Limitations, Stored\nFunction Limitations and Trigger Limitations.\n\nIf a listed table is a view, an error like the following will be produced:\n\nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n\nBy default, FLUSH statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nThe different flush options are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| CHANGED_PAGE_BITMAPS      | XtraDB only. Internal command used for backup  |\n|                           | purposes. See the Information Schema           |\n|                           | CHANGED_PAGE_BITMAPS Table.                    |\n+---------------------------+------------------------------------------------+\n| CLIENT_STATISTICS         | Reset client statistics (see SHOW              |\n|                           | CLIENT_STATISTICS).                            |\n+---------------------------+------------------------------------------------+\n| DES_KEY_FILE              | Reloads the DES key file (Specified with the   |\n|                           | --des-key-file startup option).                |\n+---------------------------+------------------------------------------------+\n| HOSTS                     | Flush the hostname cache (used for converting  |\n|                           | ip to host names and for unblocking blocked    |\n|                           | hosts. See max_connect_errors and              |\n|                           | performance_schema.host_cache                  |\n+---------------------------+------------------------------------------------+\n| INDEX_STATISTICS          | Reset index statistics (see SHOW               |\n|                           | INDEX_STATISTICS).                             |\n+---------------------------+------------------------------------------------+\n| [ERROR | ENGINE |         | Close and reopen the specified log type, or    |\n| GENERAL | SLOW | BINARY   | all log types if none are specified. FLUSH     |\n| | RELAY] LOGS             | RELAY LOGS [connection-name] can be used to    |\n|                           | flush the relay logs for a specific            |\n|                           | connection. Only one connection can be         |\n|                           | specified per FLUSH command. See Multi-source  |\n|                           | replication. FLUSH ENGINE LOGS will delete     |\n|                           | all unneeded Aria redo logs. Since MariaDB     |\n|                           | 10.1.30 and MariaDB 10.2.11, FLUSH BINARY      |\n|                           | LOGS DELETE_DOMAIN_ID=(list-of-domains) can    |\n|                           | be used to discard obsolete GTID domains from  |\n|                           | the server\'s binary log state. In order for    |\n|                           | this to be successful, no event group from     |\n|                           | the listed GTID domains can be present in      |\n|                           | existing binary log files. If some still       |\n|                           | exist, then they must be purged prior to       |\n|                           | executing this command. If the command         |\n|                           | completes successfully, then it also rotates   |\n|                           | the binary log.                                |\n+---------------------------+------------------------------------------------+\n| MASTER                    | Deprecated option, use RESET MASTER instead.   |\n+---------------------------+------------------------------------------------+\n| PRIVILEGES                | Reload all privileges from the privilege       |\n|                           | tables in the mysql database. If the server    |\n|                           | is started with --skip-grant-table option,     |\n|                           | this will activate the privilege tables again. |\n+---------------------------+------------------------------------------------+\n| QUERY CACHE               | Defragment the query cache to better utilize   |\n|                           | its memory. If you want to reset the query     |\n|                           | cache, you can do it with RESET QUERY CACHE.   |\n+---------------------------+------------------------------------------------+\n| QUERY_RESPONSE_TIME       | See the QUERY_RESPONSE_TIME plugin.            |\n+---------------------------+------------------------------------------------+\n| SLAVE                     | Deprecated option, use RESET REPLICA or RESET  |\n|                           | SLAVE instead.                                 |\n+---------------------------+------------------------------------------------+\n| SSL                       | Used to dynamically reinitialize the server\'s  |\n|                           | TLS context by reloading the files defined by  |\n|                           | several TLS system variables. See FLUSH SSL    |\n|                           | for more information. This command was first   |\n|                           | added in MariaDB 10.4.1.                       |\n+---------------------------+------------------------------------------------+\n| STATUS                    | Resets all server status variables that can    |\n|                           | be reset to 0. Not all global status           |\n|                           | variables support this, so not all global      |\n|                           | values are reset. See FLUSH STATUS for more    |\n|                           | information.                                   |\n+---------------------------+------------------------------------------------+\n| TABLE                     | Close tables given as options or all open      |\n|                           | tables if no table list was used. From         |\n|                           | MariaDB 10.4.1, using without any table list   |\n|                           | will only close tables not in use, and tables  |\n|                           | not locked by the FLUSH TABLES connection. If  |\n|                           | there are no locked tables, FLUSH TABLES will  |\n|                           | be instant and will not cause any waits, as    |\n|                           | it no longer waits for tables in use. When a   |\n|                           | table list is provided, from MariaDB 10.4.1,   |\n|                           | the server will wait for the end of any        |\n|                           | transactions that are using the tables.        |\n|                           | Previously, FLUSH TABLES only waited for the   |\n|                           | statements to complete.                        |\n+---------------------------+------------------------------------------------+\n| TABLES                    | Same as FLUSH TABLE.                           |\n+---------------------------+------------------------------------------------+\n| TABLES ... FOR EXPORT     | For InnoDB tables, flushes table changes to    |\n|                           | disk to permit binary table copies while the   |\n|                           | server is running. See FLUSH TABLES ... FOR    |\n|                           | EXPORT for more.                               |\n+---------------------------+------------------------------------------------+\n| TABLES WITH READ LOCK     | Closes all open tables. New tables are only    |\n|                           | allowed to be opened with read locks until an  |\n|                           | UNLOCK TABLES is given.                        |\n+---------------------------+------------------------------------------------+\n| TABLES WITH READ LOCK     | As TABLES WITH READ LOCK but also disable all  |\n| AND DISABLE CHECKPOINT    | checkpoint writes by transactional table       |\n|                           | engines. This is useful when doing a disk      |\n|                           | snapshot of all tables.                        |\n+---------------------------+------------------------------------------------+\n| TABLE_STATISTICS          | Reset table statistics (see SHOW               |\n|                           | TABLE_STATISTICS).                             |\n+---------------------------+------------------------------------------------+\n| USER_RESOURCES            | Resets all per hour user resources. This       |\n|                           | enables clients that have exhausted their      |\n|                           | resources to connect again.                    |\n+---------------------------+------------------------------------------------+\n| USER_STATISTICS           | Reset user statistics (see SHOW                |\n|                           | USER_STATISTICS).                              |\n+---------------------------+------------------------------------------------+\n| USER_VARIABLES            | Reset user variables (see User-defined         |\n|                           | variables).                                    |\n+---------------------------+------------------------------------------------+\n\nYou can also use the mysqladmin client to flush things. Use mysqladmin --help\nto examine what flush commands it supports.\n\nFLUSH RELAY LOGS\n----------------\n\nFLUSH RELAY LOGS \'connection_name\';\n\nCompatibility with MySQL\n------------------------\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after the FLUSH command.\n\nFor example, one can now use:\n\nFLUSH RELAY LOGS FOR CHANNEL \'connection_name\';\n\nFLUSH STATUS\n------------\n\nServer status variables can be reset by executing the following:\n\nFLUSH STATUS;\n\nGlobal Status Variables that Support FLUSH STATUS\n-------------------------------------------------\n\nNot all global status variables support being reset by FLUSH STATUS.\nCurrently, the following status variables are reset by FLUSH STATUS:\n\n* Aborted_clients\n* Aborted_connects\n* Binlog_cache_disk_use\n* Binlog_cache_use\n* Binlog_stmt_cache_disk_use\n* Binlog_stmt_cache_use\n* Connection_errors_accept\n* Connection_errors_internal\n* Connection_errors_max_connections\n* Connection_errors_peer_address\n* Connection_errors_select\n* Connection_errors_tcpwrap\n* Created_tmp_files\n* Delayed_errors\n* Delayed_writes\n* Feature_check_constraint\n* Feature_delay_key_write\n* Max_used_connections\n* Opened_plugin_libraries\n* Performance_schema_accounts_lost\n* Performance_schema_cond_instances_lost\n* Performance_schema_digest_lost\n* Performance_schema_file_handles_lost\n* Performance_schema_file_instances_lost\n* Performance_schema_hosts_lost\n* Performance_schema_locker_lost\n* Performance_schema_mutex_instances_lost\n* Performance_schema_rwlock_instances_lost\n* Performance_schema_session_connect_attrs_lost\n* Performance_schema_socket_instances_lost\n* Performance_schema_stage_classes_lost\n* Performance_schema_statement_classes_lost\n* Performance_schema_table_handles_lost\n* Performance_schema_table_instances_lost\n* Performance_schema_thread_instances_lost\n* Performance_schema_users_lost\n* Qcache_hits\n* Qcache_inserts\n* Qcache_lowmem_prunes\n* Qcache_not_cached\n* Rpl_semi_sync_master_no_times\n* Rpl_semi_sync_master_no_tx\n* Rpl_semi_sync_master_timefunc_failures\n* Rpl_semi_sync_master_wait_pos_backtraverse\n* Rpl_semi_sync_master_yes_tx\n* Rpl_transactions_multi_engine\n* Server_audit_writes_failed\n* Slave_retried_transactions\n* Slow_launch_threads\n* Ssl_accept_renegotiates\n* Ssl_accepts\n* Ssl_callback_cache_hits\n* Ssl_client_connects\n* Ssl_connect_renegotiates\n* Ssl_ctx_verify_depth\n* Ssl_ctx_verify_mode\n* Ssl_finished_accepts\n* Ssl_finished_connects\n* Ssl_session_cache_hits\n* Ssl_session_cache_misses\n* Ssl_session_cache_overflows\n* Ssl_session_cache_size\n* Ssl_session_cache_timeouts\n* Ssl_sessions_reused\n* Ssl_used_session_cache_entries\n* Subquery_cache_hit\n* Subquery_cache_miss\n* Table_locks_immediate\n* Table_locks_waited\n* Tc_log_max_pages_used\n* Tc_log_page_waits\n* Transactions_gtid_foreign_engine\n* Transactions_multi_engine\n\nThe different usage of FLUSH TABLES\n-----------------------------------\n\nThe purpose of FLUSH TABLES\n---------------------------\n\nThe purpose of FLUSH TABLES is to clean up the open table cache and table\ndefinition cache from not in use tables. This frees up memory and file\ndescriptors. Normally this is not needed as the caches works on a FIFO bases,\nbut can be useful if the server seams to use up to much memory for some reason.\n\nThe purpose of FLUSH TABLES WITH READ LOCK \n-------------------------------------------\n\nFLUSH TABLES WITH READ LOCK is useful if you want to take a backup of some\ntables. When FLUSH TABLES WITH READ LOCK returns, all write access to tables\nare blocked and all tables are marked as \'properly closed\' on disk. The tables\ncan still be used for read operations.\n\nThe purpose of FLUSH TABLES table_list\n--------------------------------------\n\nFLUSH TABLES table_list is useful if you want to copy a table object/files to\nor from the server. This command puts a lock that stops new users of the table\nand will wait until everyone has stopped using the table. The table is then\nremoved from the table definition and table cache.\n\nNote that it\'s up to the user to ensure that no one is accessing the table\nbetween FLUSH TABLES and the table is copied to or from the server. This can\nbe secured by using LOCK TABLES.\n','','https://mariadb.com/kb/en/flush/');
update help_topic set description = CONCAT(description, '\nIf there are any tables locked by the connection that is using FLUSH TABLES\nall the locked tables will be closed as part of the flush and reopened and\nrelocked before FLUSH TABLES returns. This allows one to copy the table after\nFLUSH TABLES returns without having any writes on the table. For now this\nworks works with most tables, except InnoDB as InnoDB may do background purges\non the table even while it\'s write locked.\n\nThe purpose of FLUSH TABLES table_list WITH READ LOCK\n-----------------------------------------------------\n\nFLUSH TABLES table_list WITH READ LOCK should work as FLUSH TABLES WITH READ\nLOCK, but only those tables that are listed will be properly closed. However\nin practice this works exactly like FLUSH TABLES WITH READ LOCK as the FLUSH\ncommand has anyway to wait for all WRITE operations to end because we are\ndepending on a global read lock for this code. In the future we should\nconsider fixing this to instead use meta data locks.\n\nImplementation of FLUSH TABLES commands in MariaDB 10.4.8 and above\n-------------------------------------------------------------------\n\nImplementation of FLUSH TABLES\n------------------------------\n\n* Free memory and file descriptors not in use\n\nImplementation of FLUSH TABLES WITH READ LOCK\n---------------------------------------------\n\n* Lock all tables read only for simple old style backup.\n* All background writes are suspended and tables are marked as closed.\n* No statement requiring table changes are allowed for any user until UNLOCK\nTABLES.\n\nInstead of using FLUSH TABLE WITH READ LOCK one should in most cases instead\nuse BACKUP STAGE BLOCK_COMMIT.\n\nImplementation of FLUSH TABLES table_list\n-----------------------------------------\n\n* Free memory and file descriptors for tables not in use from table list.\n* Lock given tables as read only.\n* Wait until all translations has ended that uses any of the given tables.\n* Wait until all background writes are suspended and tables are marked as\nclosed.\n\nImplementation of FLUSH TABLES table_list FOR EXPORT\n----------------------------------------------------\n\n* Free memory and file descriptors for tables not in use from table list\n* Lock given tables as read.\n* Wait until all background writes are suspended and tables are marked as\nclosed.\n* Check that all tables supports FOR EXPORT\n* No changes to these tables allowed until UNLOCK TABLES\n\nThis is basically the same behavior as in old MariaDB version if one first\nlock the tables, then do FLUSH TABLES. The tables will be copyable until\nUNLOCK TABLES.\n\nFLUSH SSL\n---------\n\nMariaDB starting with 10.4\n--------------------------\nThe FLUSH SSL command was first added in MariaDB 10.4.\n\nIn MariaDB 10.4 and later, the FLUSH SSL command can be used to dynamically\nreinitialize the server\'s TLS context. This is most useful if you need to\nreplace a certificate that is about to expire without restarting the server.\n\nThis operation is performed by reloading the files defined by the following\nTLS system variables:\n\n* ssl_cert\n* ssl_key\n* ssl_ca\n* ssl_capath\n* ssl_crl\n* ssl_crlpath\n\nThese TLS system variables are not dynamic, so their values can not be changed\nwithout restarting the server.\n\nIf you want to dynamically reinitialize the server\'s TLS context, then you\nneed to change the certificate and key files at the relevant paths defined by\nthese TLS system variables, without actually changing the values of the\nvariables. See MDEV-19341 for more information.\n\nReducing Memory Usage\n---------------------\n\nTo flush some of the global caches that take up memory, you could execute the\nfollowing command:\n\nFLUSH LOCAL HOSTS,\n QUERY CACHE,\n TABLE_STATISTICS,\n INDEX_STATISTICS,\n USER_STATISTICS;\n\nURL: https://mariadb.com/kb/en/flush/') WHERE help_topic_id = 341;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (342,26,'FLUSH QUERY CACHE','Description\n-----------\n\nYou can defragment the query cache to better utilize its memory with the FLUSH\nQUERY CACHE statement. The statement does not remove any queries from the\ncache.\n\nThe RESET QUERY CACHE statement removes all query results from the query\ncache. The FLUSH TABLES statement also does this.\n\nURL: https://mariadb.com/kb/en/flush-query-cache/','','https://mariadb.com/kb/en/flush-query-cache/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (343,26,'FLUSH TABLES FOR EXPORT','Syntax\n------\n\nFLUSH TABLES table_name [, table_name] FOR EXPORT\n\nDescription\n-----------\n\nFLUSH TABLES ... FOR EXPORT flushes changes to the specified tables to disk so\nthat binary copies can be made while the server is still running. This works\nfor Archive, Aria, CSV, InnoDB, MyISAM, MERGE, and XtraDB tables.\n\nThe table is read locked until one has issued UNLOCK TABLES.\n\nIf a storage engine does not support FLUSH TABLES FOR EXPORT, a 1031 error\n(SQLSTATE \'HY000\') is produced.\n\nIf FLUSH TABLES ... FOR EXPORT is in effect in the session, the following\nstatements will produce an error if attempted:\n\n* FLUSH TABLES WITH READ LOCK\n* FLUSH TABLES ... WITH READ LOCK\n* FLUSH TABLES ... FOR EXPORT\n* Any statement trying to update any table\n\nIf any of the following statements is in effect in the session, attempting\nFLUSH TABLES ... FOR EXPORT will produce an error.\n\n* FLUSH TABLES ... WITH READ LOCK\n* FLUSH TABLES ... FOR EXPORT\n* LOCK TABLES ... READ\n* LOCK TABLES ... WRITE\n\nFLUSH FOR EXPORT is not written to the binary log.\n\nThis statement requires the RELOAD and the LOCK TABLES privileges.\n\nIf one of the specified tables cannot be locked, none of the tables will be\nlocked.\n\nIf a table does not exist, an error like the following will be produced:\n\nERROR 1146 (42S02): Table \'test.xxx\' doesn\'t exist\n\nIf a table is a view, an error like the following will be produced:\n\nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n\nExample\n-------\n\nFLUSH TABLES test.t1 FOR EXPORT;\n#  Copy files related to the table (see below)\nUNLOCK TABLES;\n\nFor a full description, please see copying MariaDB tables.\n\nURL: https://mariadb.com/kb/en/flush-tables-for-export/','','https://mariadb.com/kb/en/flush-tables-for-export/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (344,26,'SHOW RELAYLOG EVENTS','The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSHOW RELAYLOG [\'connection_name\'] EVENTS\n  [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n  [ FOR CHANNEL \'channel_name\']\n\nDescription\n-----------\n\nOn replicas, this command shows the events in the relay log. If \'log_name\' is\nnot specified, the first relay log is shown.\n\nSyntax for the LIMIT clause is the same as for SELECT ... LIMIT.\n\nUsing the LIMIT clause is highly recommended because the SHOW RELAYLOG EVENTS\ncommand returns the complete contents of the relay log, which can be quite\nlarge.\n\nThis command does not return events related to setting user and system\nvariables. If you need those, use mariadb-binlog/mysqlbinlog.\n\nOn the primary, this command does nothing.\n\nRequires the REPLICA MONITOR privilege (>= MariaDB 10.5.9), the REPLICATION\nSLAVE ADMIN privilege (>= MariaDB 10.5.2) or the REPLICATION SLAVE privilege\n(<= MariaDB 10.5.1).\n\nconnection_name\n---------------\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the SHOW RELAYLOG statement will apply to the\nspecified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after SHOW RELAYLOG.\n\nURL: https://mariadb.com/kb/en/show-relaylog-events/','','https://mariadb.com/kb/en/show-relaylog-events/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,26,'SHOW SLAVE STATUS','Syntax\n------\n\nSHOW SLAVE [\"connection_name\"] STATUS [FOR CHANNEL \"connection_name\"]\nSHOW REPLICA [\"connection_name\"] STATUS -- From MariaDB 10.5.1\n\nor\n\nSHOW ALL SLAVES STATUS\nSHOW ALL REPLICAS STATUS -- From MariaDB 10.5.1\n\nDescription\n-----------\n\nThis statement is to be run on a replica and provides status information on\nessential parameters of the replica threads.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege, or, from\nMariaDB 10.5.9, the REPLICA MONITOR privilege.\n\nMulti-Source\n------------\n\nThe ALL and \"connection_name\" options allow you to connect to many primaries\nat the same time.\n\nALL SLAVES (or ALL REPLICAS from MariaDB 10.5.1) gives you a list of all\nconnections to the primary nodes.\n\nThe rows will be sorted according to Connection_name.\n\nIf you specify a connection_name, you only get the information about that\nconnection. If connection_name is not used, then the name set by\ndefault_master_connection is used. If the connection name doesn\'t exist you\nwill get an error: There is no master connection for \'xxx\'.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after SHOW SLAVE.\n\nColumn Descriptions\n-------------------\n\n+---------------+---------------------------------------+-------------------+\n| Name          | Description                           | Added             |\n+---------------+---------------------------------------+-------------------+\n| Connection_na | Name of the primary connection.       |                   |\n| e             | Returned with SHOW ALL SLAVES STATUS  |                   |\n|               | (or SHOW ALL REPLICAS STATUS from     |                   |\n|               | MariaDB 10.5.1) only.                 |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_SQL_Sta | State of SQL thread. Returned with    |                   |\n| e             | SHOW ALL SLAVES STATUS (or SHOW ALL   |                   |\n|               | REPLICAS STATUS from MariaDB 10.5.1)  |                   |\n|               | only. See Slave SQL Thread States.    |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_IO_Stat | State of I/O thread. See Slave I/O    |                   |\n|               | Thread States.                        |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_host   | Master host that the replica is       |                   |\n|               | connected to.                         |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_user   | Account user name being used to       |                   |\n|               | connect to the primary.               |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_port   | The port being used to connect to     |                   |\n|               | the primary.                          |                   |\n+---------------+---------------------------------------+-------------------+\n| Connect_Retry | Time in seconds between retries to    |                   |\n|               | connect. The default is 60. The       |                   |\n|               | CHANGE MASTER TO statement can set    |                   |\n|               | this. The master-retry-count option   |                   |\n|               | determines the maximum number of      |                   |\n|               | reconnection attempts.                |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_Log_Fi | Name of the primary binary log file   |                   |\n| e             | that the I/O thread is currently      |                   |\n|               | reading from.                         |                   |\n+---------------+---------------------------------------+-------------------+\n| Read_Master_L | Position up to which the I/O thread   |                   |\n| g_Pos         | has read in the current primary       |                   |\n|               | binary log file.                      |                   |\n+---------------+---------------------------------------+-------------------+\n| Relay_Log_Fil | Name of the relay log file that the   |                   |\n|               | SQL thread is currently processing.   |                   |\n+---------------+---------------------------------------+-------------------+\n| Relay_Log_Pos | Position up to which the SQL thread   |                   |\n|               | has finished processing in the        |                   |\n|               | current relay log file.               |                   |\n+---------------+---------------------------------------+-------------------+\n| Relay_Master_ | Name of the primary binary log file   |                   |\n| og_File       | that contains the most recent event   |                   |\n|               | executed by the SQL thread.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_IO_Runn | Whether the replica I/O thread is     |                   |\n| ng            | running and connected (Yes), running  |                   |\n|               | but not connected to a primary        |                   |\n|               | (Connecting) or not running (No).     |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_SQL_Run | Whether or not the SQL thread is      |                   |\n| ing           | running.                              |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Do_ | Databases specified for replicating   |                   |\n| B             | with the replicate_do_db option.      |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Ign | Databases specified for ignoring      |                   |\n| re_DB         | with the replicate_ignore_db option.  |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Do_ | Tables specified for replicating      |                   |\n| able          | with the replicate_do_table option.   |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Ign | Tables specified for ignoring with    |                   |\n| re_Table      | the replicate_ignore_table option.    |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Wil | Tables specified for replicating      |                   |\n| _Do_Table     | with the replicate_wild_do_table      |                   |\n|               | option.                               |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Wil | Tables specified for ignoring with    |                   |\n| _Ignore_Table | the replicate_wild_ignore_table       |                   |\n|               | option.                               |                   |\n+---------------+---------------------------------------+-------------------+\n| Last_Errno    | Alias for Last_SQL_Errno (see below)  |                   |\n+---------------+---------------------------------------+-------------------+\n| Last Error    | Alias for Last_SQL_Error (see below)  |                   |\n+---------------+---------------------------------------+-------------------+\n| Skip_Counter  | Number of events that a replica       |                   |\n|               | skips from the master, as recorded    |                   |\n|               | in the sql_slave_skip_counter system  |                   |\n|               | variable.                             |                   |\n+---------------+---------------------------------------+-------------------+\n| Exec_Master_L | Position up to which the SQL thread   |                   |\n| g_Pos         | has processed in the current master   |                   |\n|               | binary log file. Can be used to       |                   |\n|               | start a new replica from a current    |                   |\n|               | replica with the CHANGE MASTER TO     |                   |\n|               | ... MASTER_LOG_POS option.            |                   |\n+---------------+---------------------------------------+-------------------+\n| Relay_Log_Spa | Total size of all relay log files     |                   |\n| e             | combined.                             |                   |\n+---------------+---------------------------------------+-------------------+\n| Until_Conditi |                                       |                   |\n| n             |                                       |                   |\n+---------------+---------------------------------------+-------------------+\n| Until_Log_Fil | The MASTER_LOG_FILE value of the      |                   |\n|               | START SLAVE UNTIL condition.          |                   |\n+---------------+---------------------------------------+-------------------+\n| Until_Log_Pos | The MASTER_LOG_POS value of the       |                   |\n|               | START SLAVE UNTIL condition.          |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Al | Whether an SSL connection is          |                   |\n| owed          | permitted (Yes), not permitted (No)   |                   |\n|               | or permitted but without the replica  |                   |\n|               | having SSL support enabled (Ignored)  |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_CA | The MASTER_SSL_CA option of the       |                   |\n| File          | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_CA | The MASTER_SSL_CAPATH option of the   |                   |\n| Path          | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Ce | The MASTER_SSL_CERT option of the     |                   |\n| t             | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Ci | The MASTER_SSL_CIPHER option of the   |                   |\n| her           | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Ke | The MASTER_SSL_KEY option of the      |                   |\n|               | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Seconds_Behin | Difference between the timestamp      |                   |\n| _Master       | logged on the master for the event    |                   |\n|               | that the replica is currently         |                   |\n|               | processing, and the current           |                   |\n|               | timestamp on the replica. Zero if     |                   |\n|               | the replica is not currently          |                   |\n|               | processing an event. With parallel    |                   |\n|               | replication, seconds_behind_master    |                   |\n|               | is updated only after transactions    |                   |\n|               | commit.                               |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Ve | The MASTER_SSL_VERIFY_SERVER_CERT     |                   |\n| ify_Server_Ce | option of the CHANGE MASTER TO        |                   |\n| t             | statement.                            |                   |\n+---------------+---------------------------------------+-------------------+\n| Last_IO_Errno | Error code of the most recent error   |                   |\n|               | that caused the I/O thread to stop    |                   |\n|               | (also recorded in the replica\'s       |                   |\n|               | error log). 0 means no error. RESET   |                   |\n|               | SLAVE or RESET MASTER will reset      |                   |\n|               | this value.                           |                   |\n+---------------+---------------------------------------+-------------------+\n| Last_IO_Error | Error message of the most recent      |                   |\n|               | error that caused the I/O thread to   |                   |\n|               | stop (also recorded in the replica\'s  |                   |\n|               | error log). An empty string means no  |                   |\n|               | error. RESET SLAVE or RESET MASTER    |                   |\n|               | will reset this value.                |                   |\n+---------------+---------------------------------------+-------------------+\n| Last_SQL_Errn | Error code of the most recent error   |                   |\n|               | that caused the SQL thread to stop    |                   |\n|               | (also recorded in the replica\'s       |                   |\n|               | error log). 0 means no error. RESET   |                   |\n|               | SLAVE or RESET MASTER will reset      |                   |\n|               | this value.                           |                   |\n+---------------+---------------------------------------+-------------------+\n| Last_SQL_Erro | Error message of the most recent      |                   |\n|               | error that caused the SQL thread to   |                   |\n|               | stop (also recorded in the replica\'s  |                   |','','https://mariadb.com/kb/en/show-replica-status/');
update help_topic set description = CONCAT(description, '\n|               | error log). An empty string means no  |                   |\n|               | error. RESET SLAVE or RESET MASTER    |                   |\n|               | will reset this value.                |                   |\n+---------------+---------------------------------------+-------------------+\n| Replicate_Ign | List of server_ids that are           |                   |\n| re_Server_Ids | currently being ignored for           |                   |\n|               | replication purposes, or an empty     |                   |\n|               | string for none, as specified in the  |                   |\n|               | IGNORE_SERVER_IDS option of the       |                   |\n|               | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_Server | The master\'s server_id value.         |                   |\n| Id            |                                       |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Cr | The MASTER_SSL_CRL option of the      |                   |\n|               | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Master_SSL_Cr | The MASTER_SSL_CRLPATH option of the  |                   |\n| path          | CHANGE MASTER TO statement.           |                   |\n+---------------+---------------------------------------+-------------------+\n| Using_Gtid    | Whether or not global transaction     |                   |\n|               | ID\'s are being used for replication   |                   |\n|               | (can be No, Slave_Pos, or             |                   |\n|               | Current_Pos).                         |                   |\n+---------------+---------------------------------------+-------------------+\n| Gtid_IO_Pos   | Current global transaction ID value.  |                   |\n+---------------+---------------------------------------+-------------------+\n| Retried_trans | Number of retried transactions for    |                   |\n| ctions        | this connection. Returned with SHOW   |                   |\n|               | ALL SLAVES STATUS only.               |                   |\n+---------------+---------------------------------------+-------------------+\n| Max_relay_log | Max relay log size for this           |                   |\n| size          | connection. Returned with SHOW ALL    |                   |\n|               | SLAVES STATUS only.                   |                   |\n+---------------+---------------------------------------+-------------------+\n| Executed_log_ | How many log entries the replica has  |                   |\n| ntries        | executed. Returned with SHOW ALL      |                   |\n|               | SLAVES STATUS only.                   |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_receive | How many heartbeats we have got from  |                   |\n| _heartbeats   | the master. Returned with SHOW ALL    |                   |\n|               | SLAVES STATUS only.                   |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_heartbe | How often to request a heartbeat      |                   |\n| t_period      | packet from the master (in seconds).  |                   |\n|               | Returned with SHOW ALL SLAVES STATUS  |                   |\n|               | only.                                 |                   |\n+---------------+---------------------------------------+-------------------+\n| Gtid_Slave_Po | GTID of the last event group          |                   |\n|               | replicated on a replica server, for   |                   |\n|               | each replication domain, as stored    |                   |\n|               | in the gtid_slave_pos system          |                   |\n|               | variable. Returned with SHOW ALL      |                   |\n|               | SLAVES STATUS only.                   |                   |\n+---------------+---------------------------------------+-------------------+\n| SQL_Delay     | Value specified by MASTER_DELAY in    | MariaDB 10.2.3    |\n|               | CHANGE MASTER (or 0 if none).         |                   |\n+---------------+---------------------------------------+-------------------+\n| SQL_Remaining | When the replica is delaying the      | MariaDB 10.2.3    |\n| Delay         | execution of an event due to          |                   |\n|               | MASTER_DELAY, this is the number of   |                   |\n|               | seconds of delay remaining before     |                   |\n|               | the event will be applied.            |                   |\n|               | Otherwise, the value is NULL.         |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_SQL_Run | The state of the SQL driver threads,  | MariaDB 10.2.3    |\n| ing_State     | same as in SHOW PROCESSLIST. When     |                   |\n|               | the replica is delaying the           |                   |\n|               | execution of an event due to          |                   |\n|               | MASTER_DELAY, this field displays:    |                   |\n|               | \"Waiting until MASTER_DELAY seconds   |                   |\n|               | after master executed event\".         |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_DDL_Gro | This status variable counts the       | MariaDB 10.3.7    |\n| ps            | occurrence of DDL statements.  This   |                   |\n|               | is a replica-side counter for         |                   |\n|               | optimistic parallel replication.      |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_Non_Tra | This status variable counts the       | MariaDB 10.3.7    |\n| sactional_Gro | occurrence of non-transactional       |                   |\n| ps            | event groups.  This is a              |                   |\n|               | replica-side counter for optimistic   |                   |\n|               | parallel replication.                 |                   |\n+---------------+---------------------------------------+-------------------+\n| Slave_Transac | This status variable counts the       | MariaDB 10.3.7    |\n| ional_Groups  | occurrence of transactional event     |                   |\n|               | groups.  This is a replica-side       |                   |\n|               | counter for optimistic parallel       |                   |\n|               | replication.                          |                   |\n+---------------+---------------------------------------+-------------------+\n\nSHOW REPLICA STATUS\n-------------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSHOW REPLICA STATUS is an alias for SHOW SLAVE STATUS from MariaDB 10.5.1.\n\nExamples\n--------\n\nIf you issue this statement using the mysql client, you can use a \\G statement\nterminator rather than a semicolon to obtain a more readable vertical layout.\n\nSHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n       Slave_IO_State: Waiting for master to send event\n         Master_Host: db01.example.com\n         Master_User: replicant\n         Master_Port: 3306\n        Connect_Retry: 60\n       Master_Log_File: mariadb-bin.000010\n     Read_Master_Log_Pos: 548\n       Relay_Log_File: relay-bin.000004\n        Relay_Log_Pos: 837\n    Relay_Master_Log_File: mariadb-bin.000010\n      Slave_IO_Running: Yes\n      Slave_SQL_Running: Yes\n       Replicate_Do_DB:\n     Replicate_Ignore_DB:\n     Replicate_Do_Table:\n   Replicate_Ignore_Table:\n   Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n         Last_Errno: 0\n         Last_Error:\n        Skip_Counter: 0\n     Exec_Master_Log_Pos: 548\n       Relay_Log_Space: 1497\n       Until_Condition: None\n       Until_Log_File:\n        Until_Log_Pos: 0\n     Master_SSL_Allowed: No\n     Master_SSL_CA_File:\n     Master_SSL_CA_Path:\n       Master_SSL_Cert:\n      Master_SSL_Cipher:\n       Master_SSL_Key:\n    Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n        Last_IO_Errno: 0\n        Last_IO_Error:\n       Last_SQL_Errno: 0\n       Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n      Master_Server_Id: 101\n       Master_SSL_Crl:\n     Master_SSL_Crlpath:\n         Using_Gtid: No\n         Gtid_IO_Pos:\n\nSHOW ALL SLAVES STATUS\\G\n*************************** 1. row ***************************\n       Connection_name:\n       Slave_SQL_State: Slave has read all relay log; waiting for the\nslave I/O thread to update it\n       Slave_IO_State: Waiting for master to send event\n         Master_Host: db01.example.com\n         Master_User: replicant\n         Master_Port: 3306\n        Connect_Retry: 60\n       Master_Log_File: mariadb-bin.000010\n     Read_Master_Log_Pos: 3608\n       Relay_Log_File: relay-bin.000004\n        Relay_Log_Pos: 3897\n    Relay_Master_Log_File: mariadb-bin.000010\n      Slave_IO_Running: Yes\n      Slave_SQL_Running: Yes\n       Replicate_Do_DB:\n     Replicate_Ignore_DB:\n     Replicate_Do_Table:\n   Replicate_Ignore_Table:\n   Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n         Last_Errno: 0\n         Last_Error:\n        Skip_Counter: 0\n     Exec_Master_Log_Pos: 3608\n       Relay_Log_Space: 4557\n       Until_Condition: None\n       Until_Log_File:\n        Until_Log_Pos: 0\n     Master_SSL_Allowed: No\n     Master_SSL_CA_File:\n     Master_SSL_CA_Path:\n       Master_SSL_Cert:\n      Master_SSL_Cipher:\n       Master_SSL_Key:\n    Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n        Last_IO_Errno: 0\n        Last_IO_Error:\n       Last_SQL_Errno: 0\n       Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n      Master_Server_Id: 101\n       Master_SSL_Crl:\n     Master_SSL_Crlpath:\n         Using_Gtid: No\n         Gtid_IO_Pos:\n    Retried_transactions: 0\n     Max_relay_log_size: 104857600\n    Executed_log_entries: 40\n  Slave_received_heartbeats: 11\n   Slave_heartbeat_period: 1800.000\n       Gtid_Slave_Pos: 0-101-2320\n\nYou can also access some of the variables directly from status variables:\n\nSET @@default_master_connection=\"test\" ;\nshow status like \"%slave%\"\n\nVariable_name   Value\nCom_show_slave_hosts    0\nCom_show_slave_status   0\nCom_start_all_slaves    0\nCom_start_slave 0\nCom_stop_all_slaves     0\nCom_stop_slave  0\nRpl_semi_sync_slave_status      OFF\nSlave_connections       0\nSlave_heartbeat_period  1800.000\nSlave_open_temp_tables  0\nSlave_received_heartbeats       0\nSlave_retried_transactions      0\nSlave_running   OFF\nSlaves_connected        0\nSlaves_running  1\n\nURL: https://mariadb.com/kb/en/show-replica-status/') WHERE help_topic_id = 345;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (346,26,'SHOW MASTER STATUS','Syntax\n------\n\nSHOW MASTER STATUS\nSHOW BINLOG STATUS -- From MariaDB 10.5.2\n\nDescription\n-----------\n\nProvides status information about the binary log files of the primary.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the BINLOG MONITOR privilege.\n\nTo see information about the current GTIDs in the binary log, use the\ngtid_binlog_pos variable.\n\nSHOW MASTER STATUS was renamed to SHOW BINLOG STATUS in MariaDB 10.5.2, but\nthe old name remains an alias for compatibility purposes.\n\nExample\n-------\n\nSHOW MASTER STATUS;\n+--------------------+----------+--------------+------------------+\n| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+--------------------+----------+--------------+------------------+\n| mariadb-bin.000016 |      475 |              |                  |\n+--------------------+----------+--------------+------------------+\nSELECT @@global.gtid_binlog_pos;\n+--------------------------+\n| @@global.gtid_binlog_pos |\n+--------------------------+\n| 0-1-2                    |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/show-binlog-status/','','https://mariadb.com/kb/en/show-binlog-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (347,26,'SHOW SLAVE HOSTS','Syntax\n------\n\nSHOW SLAVE HOSTS\nSHOW REPLICA HOSTS -- from MariaDB 10.5.1\n\nDescription\n-----------\n\nThis command is run on the primary and displays a list of replicas that are\ncurrently registered with it. Only replicas started with the\n--report-host=host_name option are visible in this list.\n\nThe output looks like this:\n\nSHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id  | Host      | Port | Master_id |\n+------------+-----------+------+-----------+\n|  192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena    | 3306 | 192168011 |\n+------------+-----------+------+-----------+\n\n* Server_id: The unique server ID of the replica server, as configured in the\nserver\'s option file, or on the command line with --server-id=value.\n* Host: The host name of the replica server, as configured in the server\'s\noption file, or on the command line with --report-host=host_name. Note that\nthis can differ from the machine name as configured in the operating system.\n* Port: The port the replica server is listening on.\n* Master_id: The unique server ID of the primary server that the replica\nserver is replicating from.\n\nSome MariaDB and MySQL versions report another variable, rpl_recovery_rank.\nThis variable was never used, and was eventually removed in MariaDB 10.1.2 .\n\nRequires the REPLICATION MASTER ADMIN privilege (>= MariaDB 10.5.2) or the\nREPLICATION SLAVE privilege (<= MariaDB 10.5.1).\n\nSHOW REPLICA HOSTS\n------------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSHOW REPLICA HOSTS is an alias for SHOW SLAVE HOSTS from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/show-replica-hosts/','','https://mariadb.com/kb/en/show-replica-hosts/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (348,26,'SHOW PLUGINS','Syntax\n------\n\nSHOW PLUGINS;\n\nDescription\n-----------\n\nSHOW PLUGINS displays information about installed plugins. The Library column\nindicates the plugin library - if it is NULL, the plugin is built-in and\ncannot be uninstalled.\n\nThe PLUGINS table in the information_schema database contains more detailed\ninformation.\n\nFor specific information about storage engines (a particular type of plugin),\nsee the information_schema.ENGINES table and the SHOW ENGINES statement.\n\nExamples\n--------\n\nSHOW PLUGINS;\n+----------------------------+----------+--------------------+-------------+---\n-----+\n| Name                       | Status   | Type               | Library     |\nLicense |\n+----------------------------+----------+--------------------+-------------+---\n-----+\n| binlog                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| mysql_native_password      | ACTIVE   | AUTHENTICATION     | NULL        |\nGPL     |\n| mysql_old_password         | ACTIVE   | AUTHENTICATION     | NULL        |\nGPL     |\n| MRG_MyISAM                 | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| MyISAM                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| CSV                        | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| MEMORY                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| FEDERATED                  | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| PERFORMANCE_SCHEMA         | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| Aria                       | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| InnoDB                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| INNODB_TRX                 | ACTIVE   | INFORMATION SCHEMA | NULL        |\nGPL     |\n...\n| INNODB_SYS_FOREIGN         | ACTIVE   | INFORMATION SCHEMA | NULL        |\nGPL     |\n| INNODB_SYS_FOREIGN_COLS    | ACTIVE   | INFORMATION SCHEMA | NULL        |\nGPL     |\n| SPHINX                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| ARCHIVE                    | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| BLACKHOLE                  | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| FEEDBACK                   | DISABLED | INFORMATION SCHEMA | NULL        |\nGPL     |\n| partition                  | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| pam                        | ACTIVE   | AUTHENTICATION     | auth_pam.so |\nGPL     |\n+----------------------------+----------+--------------------+-------------+---\n-----+\n\nURL: https://mariadb.com/kb/en/show-plugins/','','https://mariadb.com/kb/en/show-plugins/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (349,26,'SHOW PLUGINS SONAME','Syntax\n------\n\nSHOW PLUGINS SONAME { library | LIKE \'pattern\' | WHERE expr };\n\nDescription\n-----------\n\nSHOW PLUGINS SONAME displays information about compiled-in and all server\nplugins in the plugin_dir directory, including plugins that haven\'t been\ninstalled.\n\nExamples\n--------\n\nSHOW PLUGINS SONAME \'ha_example.so\';\n+----------+---------------+----------------+---------------+---------+\n| Name     | Status        | Type           | Library       | License |\n+----------+---------------+----------------+---------------+---------+\n| EXAMPLE  | NOT INSTALLED | STORAGE ENGINE | ha_example.so | GPL     |\n| UNUSABLE | NOT INSTALLED | DAEMON         | ha_example.so | GPL     |\n+----------+---------------+----------------+---------------+---------+\n\nThere is also a corresponding information_schema table, called ALL_PLUGINS,\nwhich contains more complete information.\n\nURL: https://mariadb.com/kb/en/show-plugins-soname/','','https://mariadb.com/kb/en/show-plugins-soname/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (350,26,'SET','Syntax\n------\n\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n   user_var_name = expr\n  | [GLOBAL | SESSION] system_var_name = expr\n  | [@@global. | @@session. | @@]system_var_name = expr\n\nOne can also set a user variable in any expression with this syntax:\n\nuser_var_name:= expr\n\nDescription\n-----------\n\nThe SET statement assigns values to different types of variables that affect\nthe operation of the server or your client. Older versions of MySQL employed\nSET OPTION, but this syntax was deprecated in favor of SET without OPTION, and\nwas removed in MariaDB 10.0.\n\nChanging a system variable by using the SET statement does not make the change\npermanently. To do so, the change must be made in a configuration file.\n\nFor setting variables on a per-query basis, see SET STATEMENT.\n\nSee SHOW VARIABLES for documentation on viewing server system variables.\n\nSee Server System Variables for a list of all the system variables.\n\nGLOBAL / SESSION\n----------------\n\nWhen setting a system variable, the scope can be specified as either GLOBAL or\nSESSION.\n\nA global variable change affects all new sessions. It does not affect any\ncurrently open sessions, including the one that made the change.\n\nA session variable change affects the current session only.\n\nIf the variable has a session value, not specifying either GLOBAL or SESSION\nwill be the same as specifying SESSION. If the variable only has a global\nvalue, not specifying GLOBAL or SESSION will apply to the change to the global\nvalue.\n\nDEFAULT\n-------\n\nSetting a global variable to DEFAULT will restore it to the server default,\nand setting a session variable to DEFAULT will restore it to the current\nglobal value.\n\nExamples\n--------\n\n* innodb_sync_spin_loops is a global variable.\n* skip_parallel_replication is a session variable.\n* max_error_count is both global and session.\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 64           |\n| SKIP_PARALLEL_REPLICATION | OFF           | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSetting the session values:\n\nSET max_error_count=128;Query OK, 0 rows affected (0.000 sec)\n\nSET skip_parallel_replication=ON;Query OK, 0 rows affected (0.000 sec)\n\nSET innodb_sync_spin_loops=60;\nERROR 1229 (HY000): Variable \'innodb_sync_spin_loops\' is a GLOBAL variable \n and should be set with SET GLOBAL\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 128           | 64           |\n| SKIP_PARALLEL_REPLICATION | ON            | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSetting the global values:\n\nSET GLOBAL max_error_count=256;\n\nSET GLOBAL skip_parallel_replication=ON;\nERROR 1228 (HY000): Variable \'skip_parallel_replication\' is a SESSION variable \n and can\'t be used with SET GLOBAL\n\nSET GLOBAL innodb_sync_spin_loops=120;\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 128           | 256          |\n| SKIP_PARALLEL_REPLICATION | ON            | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 120          |\n+---------------------------+---------------+--------------+\n\nSHOW VARIABLES will by default return the session value unless the variable is\nglobal only.\n\nSHOW VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name   | Value |\n+-----------------+-------+\n| max_error_count | 128   |\n+-----------------+-------+\n\nSHOW VARIABLES LIKE \'skip_parallel_replication\';\n+---------------------------+-------+\n| Variable_name             | Value |\n+---------------------------+-------+\n| skip_parallel_replication | ON    |\n+---------------------------+-------+\n\nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n+------------------------+-------+\n| Variable_name          | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 120   |\n+------------------------+-------+\n\nUsing the inplace syntax:\n\nSELECT (@a:=1);\n+---------+\n| (@a:=1) |\n+---------+\n|       1 |\n+---------+\n\nSELECT @a;\n+------+\n| @a   |\n+------+\n|    1 |\n+------+\n\nURL: https://mariadb.com/kb/en/set/','','https://mariadb.com/kb/en/set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (351,26,'SET CHARACTER SET','Syntax\n------\n\nSET {CHARACTER SET | CHARSET}\n  {charset_name | DEFAULT}\n\nDescription\n-----------\n\nSets the character_set_client and character_set_results session system\nvariables to the specified character set and collation_connection to the value\nof collation_database, which implicitly sets character_set_connection to the\nvalue of character_set_database.\n\nThis maps all strings sent between the current client and the server with the\ngiven mapping.\n\nExample\n-------\n\nSHOW VARIABLES LIKE \'character_set\\_%\';\n+--------------------------+--------+\n| Variable_name            | Value  |\n+--------------------------+--------+\n| character_set_client     | utf8   |\n| character_set_connection | utf8   |\n| character_set_database   | latin1 |\n| character_set_filesystem | binary |\n| character_set_results    | utf8   |\n| character_set_server     | latin1 |\n| character_set_system     | utf8   |\n+--------------------------+--------+\n\nSHOW VARIABLES LIKE \'collation%\';\n+----------------------+-------------------+\n| Variable_name        | Value             |\n+----------------------+-------------------+\n| collation_connection | utf8_general_ci   |\n| collation_database   | latin1_swedish_ci |\n| collation_server     | latin1_swedish_ci |\n+----------------------+-------------------+\n\nSET CHARACTER SET utf8mb4;\n\nSHOW VARIABLES LIKE \'character_set\\_%\';\n+--------------------------+---------+\n| Variable_name            | Value   |\n+--------------------------+---------+\n| character_set_client     | utf8mb4 |\n| character_set_connection | latin1  |\n| character_set_database   | latin1  |\n| character_set_filesystem | binary  |\n| character_set_results    | utf8mb4 |\n| character_set_server     | latin1  |\n| character_set_system     | utf8    |\n+--------------------------+---------+\n\nSHOW VARIABLES LIKE \'collation%\';\n+----------------------+-------------------+\n| Variable_name        | Value             |\n+----------------------+-------------------+\n| collation_connection | latin1_swedish_ci |\n| collation_database   | latin1_swedish_ci |\n| collation_server     | latin1_swedish_ci |\n+----------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/set-character-set/','','https://mariadb.com/kb/en/set-character-set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (352,26,'SET NAMES','Syntax\n------\n\nSET NAMES {\'charset_name\'\n  [COLLATE \'collation_name\'] | DEFAULT}\n\nDescription\n-----------\n\nSets the character_set_client, character_set_connection, character_set_results\nand, implicitly, the collation_connection session system variables to the\nspecified character set and collation.\n\nThis determines which character set the client will use to send statements to\nthe server, and the server will use for sending results back to the client.\n\nucs2, utf16, utf16le and utf32 are not valid character sets for SET NAMES, as\nthey cannot be used as client character sets.\n\nThe collation clause is optional. If not defined (or if DEFAULT is specified),\nthe default collation for the character set will be used.\n\nQuotes are optional for the character set or collation clauses.\n\nExamples\n--------\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+-----------------+\n| VARIABLE_NAME            | SESSION_VALUE   |\n+--------------------------+-----------------+\n| CHARACTER_SET_RESULTS    | utf8            |\n| CHARACTER_SET_CONNECTION | utf8            |\n| CHARACTER_SET_CLIENT     | utf8            |\n| COLLATION_CONNECTION     | utf8_general_ci |\n+--------------------------+-----------------+\n\nSET NAMES big5;\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+-----------------+\n| VARIABLE_NAME            | SESSION_VALUE   |\n+--------------------------+-----------------+\n| CHARACTER_SET_RESULTS    | big5            |\n| CHARACTER_SET_CONNECTION | big5            |\n| CHARACTER_SET_CLIENT     | big5            |\n| COLLATION_CONNECTION     | big5_chinese_ci |\n+--------------------------+-----------------+\n\nSET NAMES \'latin1\' COLLATE \'latin1_bin\';\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+---------------+\n| VARIABLE_NAME            | SESSION_VALUE |\n+--------------------------+---------------+\n| CHARACTER_SET_RESULTS    | latin1        |\n| CHARACTER_SET_CONNECTION | latin1        |\n| CHARACTER_SET_CLIENT     | latin1        |\n| COLLATION_CONNECTION     | latin1_bin    |\n+--------------------------+---------------+\n\nSET NAMES DEFAULT;\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+-------------------+\n| VARIABLE_NAME            | SESSION_VALUE     |\n+--------------------------+-------------------+\n| CHARACTER_SET_RESULTS    | latin1            |\n| CHARACTER_SET_CONNECTION | latin1            |\n| CHARACTER_SET_CLIENT     | latin1            |\n| COLLATION_CONNECTION     | latin1_swedish_ci |\n+--------------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/set-names/','','https://mariadb.com/kb/en/set-names/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (353,26,'SET SQL_LOG_BIN','Syntax\n------\n\nSET [SESSION] sql_log_bin = {0|1}\n\nDescription\n-----------\n\nSets the sql_log_bin system variable, which disables or enables binary logging\nfor the current connection, if the client has the SUPER privilege. The\nstatement is refused with an error if the client does not have that privilege.\n\nBefore MariaDB 5.5 and before MySQL 5.6 one could also set sql_log_bin as a\nglobal variable. This was disabled as this was too dangerous as it could\ndamage replication.\n\nURL: https://mariadb.com/kb/en/set-sql_log_bin/','','https://mariadb.com/kb/en/set-sql_log_bin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (354,26,'SET STATEMENT','MariaDB starting with 10.1.2\n----------------------------\nPer-query variables were introduced in MariaDB 10.1.2\n\nSET STATEMENT can be used to set the value of a system variable for the\nduration of the statement. It is also possible to set multiple variables.\n\nSyntax\n------\n\nSET STATEMENT var1=value1 [, var2=value2, ...] \n FOR <statement>\n\nwhere varN is a system variable (list of allowed variables is provided below),\nand valueN is a constant literal.\n\nDescription\n-----------\n\nSET STATEMENT var1=value1 FOR stmt\n\nis roughly equivalent to\n\nSET @save_value=@@var1;\nSET SESSION var1=value1;\nstmt;\nSET SESSION var1=@save_value;\n\nThe server parses the whole statement before executing it, so any variables\nset in this fashion that affect the parser may not have the expected effect.\nExamples include the charset variables, sql_mode=ansi_quotes, etc.\n\nExamples\n--------\n\nOne can limit statement execution time max_statement_time:\n\nSET STATEMENT max_statement_time=1000 FOR SELECT ... ;\n\nOne can switch on/off individual optimizations:\n\nSET STATEMENT optimizer_switch=\'materialization=off\' FOR SELECT ....;\n\nIt is possible to enable MRR/BKA for a query:\n\nSET STATEMENT  join_cache_level=6, optimizer_switch=\'mrr=on\'  FOR SELECT ...\n\nNote that it makes no sense to try to set a session variable inside a SET\nSTATEMENT:\n\n#USELESS STATEMENT\nSET STATEMENT sort_buffer_size = 100000 for SET SESSION sort_buffer_size =\n200000;\n\nFor the above, after setting sort_buffer_size to 200000 it will be reset to\nits original state (the state before the SET STATEMENT started) after the\nstatement execution.\n\nLimitations\n-----------\n\nThere are a number of variables that cannot be set on per-query basis. These\ninclude:\n\n* autocommit\n* character_set_client\n* character_set_connection\n* character_set_filesystem\n* collation_connection\n* default_master_connection\n* debug_sync\n* interactive_timeout\n* gtid_domain_id\n* last_insert_id\n* log_slow_filter\n* log_slow_rate_limit\n* log_slow_verbosity\n* long_query_time\n* min_examined_row_limit\n* profiling\n* profiling_history_size\n* query_cache_type\n* rand_seed1\n* rand_seed2\n* skip_replication\n* slow_query_log\n* sql_log_off\n* tx_isolation\n* wait_timeout\n\nSource\n------\n\n* The feature was originally implemented as a Google Summer of Code 2009\nproject by Joseph Lukas. \n* Percona Server 5.6 included it as Per-query variable statement\n* MariaDB ported the patch and fixed many bugs. The task in MariaDB Jira is\nMDEV-5231.\n\nURL: https://mariadb.com/kb/en/set-statement/','','https://mariadb.com/kb/en/set-statement/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (355,26,'SET Variable','Syntax\n------\n\nSET var_name = expr [, var_name = expr] ...\n\nDescription\n-----------\n\nThe SET statement in stored programs is an extended version of the general SET\nstatement. Referenced variables may be ones declared inside a stored program,\nglobal system variables, or user-defined variables.\n\nThe SET statement in stored programs is implemented as part of the\npre-existing SET syntax. This allows an extended syntax of SET a=x, b=y, ...\nwhere different variable types (locally declared variables, global and session\nserver variables, user-defined variables) can be mixed. This also allows\ncombinations of local variables and some options that make sense only for\nsystem variables; in that case, the options are recognized but ignored.\n\nSET can be used with both local variables and user-defined variables.\n\nWhen setting several variables using the columns returned by a query, SELECT\nINTO should be preferred.\n\nTo set many variables to the same value, the LAST_VALUE( ) function can be\nused.\n\nBelow is an example of how a user-defined variable may be set:\n\nSET @x = 1;\n\nURL: https://mariadb.com/kb/en/set-variable/','','https://mariadb.com/kb/en/set-variable/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (356,26,'About SHOW','SHOW has many forms that provide information about databases, tables, columns,\nor status information about the server. These include:\n\n* SHOW AUTHORS\n* SHOW CHARACTER SET [like_or_where]\n* SHOW COLLATION [like_or_where]\n* SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\n* SHOW CONTRIBUTORS\n* SHOW CREATE DATABASE db_name\n* SHOW CREATE EVENT event_name\n* SHOW CREATE PACKAGE package_name\n* SHOW CREATE PACKAGE BODY package_name\n* SHOW CREATE PROCEDURE proc_name\n* SHOW CREATE TABLE tbl_name\n* SHOW CREATE TRIGGER trigger_name\n* SHOW CREATE VIEW view_name\n* SHOW DATABASES [like_or_where]\n* SHOW ENGINE engine_name {STATUS | MUTEX}\n* SHOW [STORAGE] ENGINES\n* SHOW ERRORS [LIMIT [offset,] row_count]\n* SHOW [FULL] EVENTS\n* SHOW FUNCTION CODE func_name\n* SHOW FUNCTION STATUS [like_or_where]\n* SHOW GRANTS FOR user\n* SHOW INDEX FROM tbl_name [FROM db_name]\n* SHOW INNODB STATUS\n* SHOW OPEN TABLES [FROM db_name] [like_or_where]\n* SHOW PLUGINS\n* SHOW PROCEDURE CODE proc_name\n* SHOW PROCEDURE STATUS [like_or_where]\n* SHOW PRIVILEGES\n* SHOW [FULL] PROCESSLIST\n* SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\n* SHOW PROFILES\n* SHOW [GLOBAL | SESSION] STATUS [like_or_where]\n* SHOW TABLE STATUS [FROM db_name] [like_or_where]\n* SHOW TABLES [FROM db_name] [like_or_where]\n* SHOW TRIGGERS [FROM db_name] [like_or_where]\n* SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\n* SHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n  LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\' part,\n\'pattern\' is a string that can contain the SQL \"%\" and \"_\" wildcard\ncharacters. The pattern is useful for restricting statement output to matching\nvalues.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See Extended Show.\n\nURL: https://mariadb.com/kb/en/about-show/','','https://mariadb.com/kb/en/about-show/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,26,'Extended Show','The following SHOW statements can be extended by using a WHERE clause and a\nLIKE clause to refine the results:\n\n* SHOW CHARACTER SET\n* SHOW COLLATION\n* SHOW COLUMNS\n* SHOW DATABASES\n* SHOW FUNCTION STATUS\n* SHOW INDEX\n* SHOW OPEN TABLES\n* SHOW PACKAGE STATUS\n* SHOW PACKAGE BODY STATUS\n* SHOW INDEX\n* SHOW PROCEDURE STATUS\n* SHOW STATUS\n* SHOW TABLE STATUS\n* SHOW TABLES\n* SHOW TRIGGERS\n* SHOW VARIABLES\n\nAs with a regular SELECT, the WHERE clause can be used for the specific\ncolumns returned, and the LIKE clause with the regular wildcards.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n| t1                   |\n| view1                |\n+----------------------+\n\nShowing the tables beginning with a only.\n\nSHOW TABLES WHERE Tables_in_test LIKE \'a%\';\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n+----------------------+\n\nVariables whose name starts with aria and with a valued of greater than 8192:\n\nSHOW VARIABLES WHERE Variable_name LIKE \'aria%\' AND Value >8192;\n+------------------------------+---------------------+\n| Variable_name                | Value               |\n+------------------------------+---------------------+\n| aria_checkpoint_log_activity | 1048576             |\n| aria_log_file_size           | 1073741824          |\n| aria_max_sort_file_size      | 9223372036853727232 |\n| aria_pagecache_buffer_size   | 134217728           |\n| aria_sort_buffer_size        | 134217728           |\n+------------------------------+---------------------+\n\nShortcut, just returning variables whose name begins with aria.\n\nSHOW VARIABLES LIKE \'aria%\';\n+------------------------------------------+---------------------+\n| Variable_name                            | Value               |\n+------------------------------------------+---------------------+\n| aria_block_size                          | 8192                |\n| aria_checkpoint_interval                 | 30                  |\n| aria_checkpoint_log_activity             | 1048576             |\n| aria_force_start_after_recovery_failures | 0                   |\n| aria_group_commit                        | none                |\n| aria_group_commit_interval               | 0                   |\n| aria_log_file_size                       | 1073741824          |\n| aria_log_purge_type                      | immediate           |\n| aria_max_sort_file_size                  | 9223372036853727232 |\n| aria_page_checksum                       | ON                  |\n| aria_pagecache_age_threshold             | 300                 |\n| aria_pagecache_buffer_size               | 134217728           |\n| aria_pagecache_division_limit            | 100                 |\n| aria_recover                             | NORMAL              |\n| aria_repair_threads                      | 1                   |\n| aria_sort_buffer_size                    | 134217728           |\n| aria_stats_method                        | nulls_unequal       |\n| aria_sync_log_dir                        | NEWFILE             |\n| aria_used_for_temp_tables                | ON                  |\n+------------------------------------------+---------------------+\n\nURL: https://mariadb.com/kb/en/extended-show/','','https://mariadb.com/kb/en/extended-show/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (358,26,'SHOW AUTHORS','Syntax\n------\n\nSHOW AUTHORS\n\nDescription\n-----------\n\nThe SHOW AUTHORS statement displays information about the people who work on\nMariaDB. For each author, it displays Name, Location, and Comment values. All\ncolumns are encoded as latin1.\n\nThese include:\n\n* First the active people in MariaDB are listed.\n* Then the active people in MySQL.\n* Last the people that have contributed to MariaDB/MySQL in the past.\n\nThe order is somewhat related to importance of the contribution given to the\nMariaDB project, but this is not 100% accurate. There is still room for\nimprovement and debate...\n\nExample\n-------\n\nSHOW AUTHORS\\G\n*************************** 1. row ***************************\n  Name: Michael (Monty) Widenius\nLocation: Tusby, Finland\n Comment: Lead developer and main author\n*************************** 2. row ***************************\n  Name: Sergei Golubchik\nLocation: Kerpen, Germany\n Comment: Architect, Full-text search, precision math, plugin framework,\nmerges etc\n*************************** 3. row ***************************\n  Name: Igor Babaev\nLocation: Bellevue, USA\n Comment: Optimizer, keycache, core work\n*************************** 4. row ***************************\n  Name: Sergey Petrunia\nLocation: St. Petersburg, Russia\n Comment: Optimizer\n*************************** 5. row ***************************\n  Name: Oleksandr Byelkin\nLocation: Lugansk, Ukraine\n Comment: Query Cache (4.0), Subqueries (4.1), Views (5.0)\n*************************** 6. row ***************************\n  Name: Timour Katchaounov\nLocation: Sofia , Bulgaria\n Comment: Optimizer\n*************************** 7. row ***************************\n  Name: Kristian Nielsen\nLocation: Copenhagen, Denmark\n Comment: Replication, Async client prototocol, General buildbot stuff\n*************************** 8. row ***************************\n  Name: Alexander (Bar) Barkov\nLocation: Izhevsk, Russia\n Comment: Unicode and character sets\n*************************** 9. row ***************************\n  Name: Alexey Botchkov (Holyfoot)\nLocation: Izhevsk, Russia\n Comment: GIS extensions, embedded server, precision math\n*************************** 10. row ***************************\n  Name: Daniel Bartholomew\nLocation: Raleigh, USA\n Comment: MariaDB documentation, Buildbot, releases\n*************************** 11. row ***************************\n  Name: Colin Charles\nLocation: Selangor, Malesia\n Comment: MariaDB documentation, talks at a LOT of conferences\n*************************** 12. row ***************************\n  Name: Sergey Vojtovich\nLocation: Izhevsk, Russia\n Comment: initial implementation of plugin architecture, maintained native\nstorage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache\n*************************** 13. row ***************************\n  Name: Vladislav Vaintroub\nLocation: Mannheim, Germany\n Comment: MariaDB Java connector, new thread pool, Windows optimizations\n*************************** 14. row ***************************\n  Name: Elena Stepanova\nLocation: Sankt Petersburg, Russia\n Comment: QA, test cases\n*************************** 15. row ***************************\n  Name: Georg Richter\nLocation: Heidelberg, Germany\n Comment: New LGPL C connector, PHP connector\n*************************** 16. row ***************************\n  Name: Jan Lindström\nLocation: Ylämylly, Finland\n Comment: Working on InnoDB\n*************************** 17. row ***************************\n  Name: Lixun Peng\nLocation: Hangzhou, China\n Comment: Multi Source replication\n*************************** 18. row ***************************\n  Name: Olivier Bertrand\nLocation: Paris, France\n Comment: CONNECT storage engine\n*************************** 19. row ***************************\n  Name: Kentoku Shiba\nLocation: Tokyo, Japan\n Comment: Spider storage engine, metadata_lock_info Information schema\n*************************** 20. row ***************************\n  Name: Percona\nLocation: CA, USA\n Comment: XtraDB, microslow patches, extensions to slow log\n*************************** 21. row ***************************\n  Name: Vicentiu Ciorbaru\nLocation: Bucharest, Romania\n Comment: Roles\n*************************** 22. row ***************************\n  Name: Sudheera Palihakkara\nLocation: \n Comment: PCRE Regular Expressions\n*************************** 23. row ***************************\n  Name: Pavel Ivanov\nLocation: USA\n Comment: Some patches and bug fixes\n*************************** 24. row ***************************\n  Name: Konstantin Osipov\nLocation: Moscow, Russia\n Comment: Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0)\n*************************** 25. row ***************************\n  Name: Ian Gilfillan\nLocation: South Africa\n Comment: MariaDB documentation\n*************************** 26. row ***************************\n  Name: Federico Razolli\nLocation: Italy\n Comment: MariaDB documentation Italian translation\n*************************** 27. row ***************************\n  Name: Guilhem Bichot\nLocation: Bordeaux, France\n Comment: Replication (since 4.0)\n*************************** 28. row ***************************\n  Name: Andrei Elkin\nLocation: Espoo, Finland\n Comment: Replication\n*************************** 29. row ***************************\n  Name: Dmitri Lenev\nLocation: Moscow, Russia\n Comment: Time zones support (4.1), Triggers (5.0)\n*************************** 30. row ***************************\n  Name: Marc Alff\nLocation: Denver, CO, USA\n Comment: Signal, Resignal, Performance schema\n*************************** 31. row ***************************\n  Name: Mikael Ronström\nLocation: Stockholm, Sweden\n Comment: NDB Cluster, Partitioning, online alter table\n*************************** 32. row ***************************\n  Name: Ingo Strüwing\nLocation: Berlin, Germany\n Comment: Bug fixing in MyISAM, Merge tables etc\n*************************** 33. row ***************************\n  Name: Marko Mäkelä\nLocation: Helsinki, Finland\n Comment: InnoDB core developer\n...\n\nURL: https://mariadb.com/kb/en/show-authors/','','https://mariadb.com/kb/en/show-authors/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (359,26,'SHOW BINARY LOGS','Syntax\n------\n\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nDescription\n-----------\n\nLists the binary log files on the server. This statement is used as part of\nthe procedure described in PURGE BINARY LOGS, that shows how to determine\nwhich logs can be purged.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the BINLOG MONITOR privilege.\n\nExamples\n--------\n\nSHOW BINARY LOGS;\n+--------------------+-----------+\n| Log_name           | File_size |\n+--------------------+-----------+\n| mariadb-bin.000001 |     19039 |\n| mariadb-bin.000002 |    717389 |\n| mariadb-bin.000003 |       300 |\n| mariadb-bin.000004 |       333 |\n| mariadb-bin.000005 |       899 |\n| mariadb-bin.000006 |       125 |\n| mariadb-bin.000007 |     18907 |\n| mariadb-bin.000008 |     19530 |\n| mariadb-bin.000009 |       151 |\n| mariadb-bin.000010 |       151 |\n| mariadb-bin.000011 |       125 |\n| mariadb-bin.000012 |       151 |\n| mariadb-bin.000013 |       151 |\n| mariadb-bin.000014 |       125 |\n| mariadb-bin.000015 |       151 |\n| mariadb-bin.000016 |       314 |\n+--------------------+-----------+\n\nURL: https://mariadb.com/kb/en/show-binary-logs/','','https://mariadb.com/kb/en/show-binary-logs/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,26,'SHOW BINLOG EVENTS','Syntax\n------\n\nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nDescription\n-----------\n\nShows the events in the binary log. If you do not specify \'log_name\', the\nfirst binary log is displayed.\n\nRequires the BINLOG MONITOR privilege (>= MariaDB 10.5.2) or the REPLICATION\nSLAVE privilege (<= MariaDB 10.5.1).\n\nExample\n-------\n\nSHOW BINLOG EVENTS IN \'mysql_sandbox10019-bin.000002\';\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n| Log_name                      | Pos | Event_type        | Server_id |\nEnd_log_pos | Info                                           |\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n| mysql_sandbox10019-bin.000002 |   4 | Format_desc       |         1 |       \n 248 | Server ver: 10.0.19-MariaDB-log, Binlog ver: 4 |\n| mysql_sandbox10019-bin.000002 | 248 | Gtid_list         |         1 |       \n 273 | []                                             |\n| mysql_sandbox10019-bin.000002 | 273 | Binlog_checkpoint |         1 |       \n 325 | mysql_sandbox10019-bin.000002                  |\n| mysql_sandbox10019-bin.000002 | 325 | Gtid              |         1 |       \n 363 | GTID 0-1-1                                     |\n| mysql_sandbox10019-bin.000002 | 363 | Query             |         1 |       \n 446 | CREATE DATABASE blog                           |\n| mysql_sandbox10019-bin.000002 | 446 | Gtid              |         1 |       \n 484 | GTID 0-1-2                                     |\n| mysql_sandbox10019-bin.000002 | 484 | Query             |         1 |       \n 571 | use `blog`; CREATE TABLE bb (id INT)           |\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-binlog-events/','','https://mariadb.com/kb/en/show-binlog-events/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (361,26,'SHOW CHARACTER SET','Syntax\n------\n\nSHOW CHARACTER SET\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW CHARACTER SET statement shows all available character sets. The LIKE\nclause, if present on its own, indicates which character set names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema CHARACTER_SETS\ntable.\n\nSee Setting Character Sets and Collations for details on specifying the\ncharacter set at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description                 | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1  | cp1252 West European        | latin1_swedish_ci |      1 |\n| latin2  | ISO 8859-2 Central European | latin2_general_ci |      1 |\n| latin5  | ISO 8859-9 Turkish          | latin5_turkish_ci |      1 |\n| latin7  | ISO 8859-13 Baltic          | latin7_general_ci |      1 |\n+---------+-----------------------------+-------------------+--------+\n\nSHOW CHARACTER SET WHERE Maxlen LIKE \'2\';\n+---------+---------------------------+-------------------+--------+\n| Charset | Description               | Default collation | Maxlen |\n+---------+---------------------------+-------------------+--------+\n| big5    | Big5 Traditional Chinese  | big5_chinese_ci   |      2 |\n| sjis    | Shift-JIS Japanese        | sjis_japanese_ci  |      2 |\n| euckr   | EUC-KR Korean             | euckr_korean_ci   |      2 |\n| gb2312  | GB2312 Simplified Chinese | gb2312_chinese_ci |      2 |\n| gbk     | GBK Simplified Chinese    | gbk_chinese_ci    |      2 |\n| ucs2    | UCS-2 Unicode             | ucs2_general_ci   |      2 |\n| cp932   | SJIS for Windows Japanese | cp932_japanese_ci |      2 |\n+---------+---------------------------+-------------------+--------+\n\nURL: https://mariadb.com/kb/en/show-character-set/','','https://mariadb.com/kb/en/show-character-set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (362,26,'SHOW CLIENT_STATISTICS','Syntax\n------\n\nSHOW CLIENT_STATISTICS\n\nDescription\n-----------\n\nThe SHOW CLIENT_STATISTICS statement is part of the User Statistics feature.\nIt was removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.CLIENT_STATISTICS table holds statistics about client\nconnections.\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.CLIENT_STATISTICS articles for more\ninformation.\n\nExample\n-------\n\nSHOW CLIENT_STATISTICS\\G\n*************************** 1. row ***************************\n        Client: localhost\n  Total_connections: 35\nConcurrent_connections: 0\n    Connected_time: 708\n      Busy_time: 2.5557979999999985\n       Cpu_time: 0.04123740000000002\n    Bytes_received: 3883\n      Bytes_sent: 21595\n Binlog_bytes_written: 0\n      Rows_read: 18\n      Rows_sent: 115\n     Rows_deleted: 0\n    Rows_inserted: 0\n     Rows_updated: 0\n   Select_commands: 70\n   Update_commands: 0\n    Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n  Denied_connections: 0\n   Lost_connections: 0\n    Access_denied: 0\n    Empty_queries: 35\n\nURL: https://mariadb.com/kb/en/show-client-statistics/','','https://mariadb.com/kb/en/show-client-statistics/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (363,26,'SHOW CONTRIBUTORS','Syntax\n------\n\nSHOW CONTRIBUTORS\n\nDescription\n-----------\n\nThe SHOW CONTRIBUTORS statement displays information about the companies and\npeople who financially contribute to MariaDB. For each contributor, it\ndisplays Name, Location, and Comment values. All columns are encoded as latin1.\n\nIt displays all members and sponsors of the MariaDB Foundation as well as\nother financial contributors.\n\nExample\n-------\n\nSHOW CONTRIBUTORS;\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n| Name                | Location                      | Comment               \n                  |\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n| Alibaba Cloud       | https://www.alibabacloud.com/ | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Tencent Cloud       | https://cloud.tencent.com     | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Microsoft           | https://microsoft.com/        | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| MariaDB Corporation | https://mariadb.com           | Founding member,\nPlatinum Sponsor of the MariaDB Foundation |\n| ServiceNow          | https://servicenow.com        | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Intel               | https://www.intel.com         | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| SIT                 | https://sit.org               | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Visma               | https://visma.com             | Gold Sponsor of the\nMariaDB Foundation                      |\n| DBS                 | https://dbs.com               | Gold Sponsor of the\nMariaDB Foundation                      |\n| IBM                 | https://www.ibm.com           | Gold Sponsor of the\nMariaDB Foundation                      |\n| Automattic          | https://automattic.com        | Silver Sponsor of the\nMariaDB Foundation                    |\n| Percona             | https://www.percona.com/      | Sponsor of the MariaDB\nFoundation                           |\n| Galera Cluster      | https://galeracluster.com     | Sponsor of the MariaDB\nFoundation                           |\n| Google              | USA                           | Sponsoring encryption,\nparallel replication and GTID        |\n| Facebook            | USA                           | Sponsoring\nnon-blocking API, LIMIT ROWS EXAMINED etc        |\n| Ronald Bradford     | Brisbane, Australia           | EFF contribution for\nUC2006 Auction                         |\n| Sheeri Kritzer      | Boston, Mass. USA             | EFF contribution for\nUC2006 Auction                         |\n| Mark Shuttleworth   | London, UK.                   | EFF contribution for\nUC2006 Auction                         |\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-contributors/','','https://mariadb.com/kb/en/show-contributors/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (364,26,'SHOW CREATE DATABASE','Syntax\n------\n\nSHOW CREATE {DATABASE | SCHEMA} db_name\n\nDescription\n-----------\n\nShows the CREATE DATABASE statement that creates the given database. SHOW\nCREATE SCHEMA is a synonym for SHOW CREATE DATABASE. SHOW CREATE DATABASE\nquotes database names according to the value of the sql_quote_show_create\nserver system variable.\n\nExamples\n--------\n\nSHOW CREATE DATABASE test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database                                                 |\n+----------+-----------------------------------------------------------------+\n| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+-----------------------------------------------------------------+\n\nSHOW CREATE SCHEMA test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database                                                 |\n+----------+-----------------------------------------------------------------+\n| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+-----------------------------------------------------------------+\n\nWith sql_quote_show_create off:\n\nSHOW CREATE DATABASE test;\n+----------+---------------------------------------------------------------+\n| Database | Create Database                                               |\n+----------+---------------------------------------------------------------+\n| test     | CREATE DATABASE test /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+---------------------------------------------------------------+\n\nWith a comment, from MariaDB 10.5:\n\nSHOW CREATE DATABASE p;\n+----------+-------------------------------------------------------------------\n------------------+\n| Database | Create Database                                                  \n         |\n+----------+-------------------------------------------------------------------\n------------------+\n| p        | CREATE DATABASE `p` /*!40100 DEFAULT CHARACTER SET latin1 */\nCOMMENT \'presentations\' |\n+----------+-------------------------------------------------------------------\n------------------+\n\nURL: https://mariadb.com/kb/en/show-create-database/','','https://mariadb.com/kb/en/show-create-database/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (365,26,'SHOW CREATE EVENT','Syntax\n------\n\nSHOW CREATE EVENT event_name\n\nDescription\n-----------\n\nThis statement displays the CREATE EVENT statement needed to re-create a given\nevent, as well as the SQL_MODE that was used when the trigger has been created\nand the character set used by the connection. To find out which events are\npresent, use SHOW EVENTS.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nThe information_schema.EVENTS table provides similar, but more complete,\ninformation.\n\nExamples\n--------\n\nSHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n       Event: e_daily\n      sql_mode:\n     time_zone: SYSTEM\n    Create Event: CREATE EVENT `e_daily`\n            ON SCHEDULE EVERY 1 DAY\n            STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n            ON COMPLETION NOT PRESERVE\n            ENABLE\n            COMMENT \'Saves total number of sessions then\n                clears the table each day\'\n            DO BEGIN\n             INSERT INTO site_activity.totals (time, total)\n              SELECT CURRENT_TIMESTAMP, COUNT(*)\n              FROM site_activity.sessions;\n             DELETE FROM site_activity.sessions;\n            END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-event/','','https://mariadb.com/kb/en/show-create-event/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,26,'SHOW CREATE FUNCTION','Syntax\n------\n\nSHOW CREATE FUNCTION func_name\n\nDescription\n-----------\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored functions.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExample\n-------\n\nSHOW CREATE FUNCTION VatCents\\G\n*************************** 1. row ***************************\n      Function: VatCents\n      sql_mode:\n  Create Function: CREATE DEFINER=`root`@`localhost` FUNCTION\n`VatCents`(price DECIMAL(10,2)) RETURNS int(11)\n  DETERMINISTIC\nBEGIN\n DECLARE x INT;\n SET x = price * 114;\n RETURN x;\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-function/','','https://mariadb.com/kb/en/show-create-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,26,'SHOW CREATE PACKAGE','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW CREATE PACKAGE  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nShows the CREATE statement that creates the given package specification.\n\nExamples\n--------\n\nSHOW CREATE PACKAGE employee_tools\\G\n*************************** 1. row ***************************\n      Package: employee_tools\n      sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS\nNO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n   Create Package: CREATE DEFINER=\"root\"@\"localhost\" PACKAGE\n\"employee_tools\" AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-package/','','https://mariadb.com/kb/en/show-create-package/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (368,26,'SHOW CREATE PACKAGE BODY','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW CREATE PACKAGE BODY  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nShows the CREATE statement that creates the given package body (i.e. the\nimplementation).\n\nExamples\n--------\n\nSHOW CREATE PACKAGE BODY employee_tools\\G\n*************************** 1. row ***************************\n    Package body: employee_tools\n      sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS\nNO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package Body: CREATE DEFINER=\"root\"@\"localhost\" PACKAGE BODY\n\"employee_tools\" AS\n\nstdRaiseAmount DECIMAL(10,2):=500;\n\nPROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n  INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n\nPROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n  eid INT;\n BEGIN\n  INSERT INTO employee (name, salary) VALUES (ename, esalary);\n  eid:= last_insert_id();\n  log(eid, \'hire \' || ename);\n END;\n\nFUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n  nSalary DECIMAL(10,2);\n BEGIN\n  SELECT salary INTO nSalary FROM employee WHERE id=eid;\n  log(eid, \'getSalary id=\' || eid || \' salary=\' || nSalary);\n  RETURN nSalary;\n END;\n\nPROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n  UPDATE employee SET salary=salary+amount WHERE id=eid;\n  log(eid, \'raiseSalary id=\' || eid || \' amount=\' || amount);\n END;\n\nPROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n  raiseSalary(eid, stdRaiseAmount);\n  log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n\nBEGIN  \n log(0, \'Session \' || connection_id() || \' \' || current_user || \' started\');\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-package-body/','','https://mariadb.com/kb/en/show-create-package-body/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (369,26,'SHOW CREATE PROCEDURE','Syntax\n------\n\nSHOW CREATE PROCEDURE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns the exact string that can be\nused to re-create the named stored procedure, as well as the SQL_MODE that was\nused when the trigger has been created and the character set used by the\nconnection.. A similar statement, SHOW CREATE FUNCTION, displays information\nabout stored functions.\n\nBoth statements require that you are the owner of the routine or have the\nSELECT privilege on the mysql.proc table. When neither is true, the statements\ndisplay NULL for the Create Procedure or Create Function field.\n\nWarning Users with SELECT privileges on mysql.proc or USAGE privileges on *.*\ncan view the text of routines, even when they do not have privileges for the\nfunction or procedure itself.\n\nThe output of these statements is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExamples\n--------\n\nHere\'s a comparison of the SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION\nstatements.\n\nSHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n     Procedure: simpleproc\n      sql_mode:\n  Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n           BEGIN\n           SELECT COUNT(*) INTO param1 FROM t;\n           END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nSHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n      Function: hello\n      sql_mode:\n  Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n           RETURNS CHAR(50)\n           RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nWhen the user issuing the statement does not have privileges on the routine,\nattempting to CALL the procedure raises Error 1370.\n\nCALL test.prc1();\nError 1370 (42000): execute command denieed to user \'test_user\'@\'localhost\'\nfor routine \'test\'.\'prc1\'\n\nIf the user neither has privilege to the routine nor the SELECT privilege on\nmysql.proc table, it raises Error 1305, informing them that the procedure does\nnot exist.\n\nSHOW CREATE TABLES test.prc1\\G\nError 1305 (42000): PROCEDURE prc1 does not exist\n\nURL: https://mariadb.com/kb/en/show-create-procedure/','','https://mariadb.com/kb/en/show-create-procedure/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (370,26,'SHOW CREATE SEQUENCE','MariaDB starting with 10.3.1\n----------------------------\nSequences were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nSHOW CREATE SEQUENCE sequence_name;\n\nDescription\n-----------\n\nShows the CREATE SEQUENCE statement that created the given sequence. The\nstatement requires the SELECT privilege for the table.\n\nExample\n-------\n\nCREATE SEQUENCE s1 START WITH 50;\nSHOW CREATE SEQUENCE s1\\G;\n*************************** 1. row ***************************\n   Table: s1\nCreate Table: CREATE SEQUENCE `s1` start with 50 minvalue 1 maxvalue\n9223372036854775806 \n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nNotes\n-----\n\nIf you want to see the underlying table structure used for the SEQUENCE you\ncan use SHOW CREATE TABLE on the SEQUENCE. You can also use SELECT to read the\ncurrent recorded state of the SEQUENCE:\n\nSHOW CREATE TABLE s1\\G\n*************************** 1. row ***************************\n   Table: s1\nCreate Table: CREATE TABLE `s1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value when sequences is\ncreated \n  or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment value\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if no cycles are\nallowed, \n  1 if the sequence should begin a new cycle when maximum_value is passed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles have been done\'\n) ENGINE=InnoDB SEQUENCE=1\n\nSELECT * FROM s1\\G\n*************************** 1. row ***************************\nnext_not_cached_value: 50\n    minimum_value: 1\n    maximum_value: 9223372036854775806\n     start_value: 50\n      increment: 1\n     cache_size: 1000\n    cycle_option: 0\n     cycle_count: 0\n\nURL: https://mariadb.com/kb/en/show-create-sequence/','','https://mariadb.com/kb/en/show-create-sequence/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (371,26,'SHOW CREATE TRIGGER','Syntax\n------\n\nSHOW CREATE TRIGGER trigger_name\n\nDescription\n-----------\n\nThis statement shows a CREATE TRIGGER statement that creates the given\ntrigger, as well as the SQL_MODE that was used when the trigger has been\ncreated and the character set used by the connection.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExamples\n--------\n\nSHOW CREATE TRIGGER example\\G\n*************************** 1. row ***************************\n       Trigger: example\n       sql_mode:\nONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,STRICT_ALL_TABLES\n,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO\n\nENGINE_SUBSTITUTION\nSQL Original Statement: CREATE DEFINER=`root`@`localhost` TRIGGER example\nBEFORE\n INSERT ON t FOR EACH ROW\nBEGIN\n    SET NEW.c = NEW.c * 2;\nEND\n character_set_client: cp850\n collation_connection: cp850_general_ci\n Database Collation: utf8_general_ci\n Created: 2016-09-29 13:53:34.35\n\nMariaDB starting with 10.2.3\n----------------------------\nThe Created column was added in MySQL 5.7 and MariaDB 10.2.3 as part of\nintroducing multiple trigger events per action.\n\nURL: https://mariadb.com/kb/en/show-create-trigger/','','https://mariadb.com/kb/en/show-create-trigger/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (372,26,'SHOW CREATE VIEW','Syntax\n------\n\nSHOW CREATE VIEW view_name\n\nDescription\n-----------\n\nThis statement shows a CREATE VIEW statement that creates the given view, as\nwell as the character set used by the connection when the view was created.\nThis statement also works with views.\n\nSHOW CREATE VIEW quotes table, column and stored function names according to\nthe value of the sql_quote_show_create server system variable.\n\nExamples\n--------\n\nSHOW CREATE VIEW example\\G\n*************************** 1. row ***************************\n        View: example\n    Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL\nSECURITY DEFINER VIEW `example` AS (select `t`.`id` AS `id`,`t`.`s` AS `s` from\n`t`)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nWith sql_quote_show_create off:\n\nSHOW CREATE VIEW example\\G\n*************************** 1. row ***************************\n        View: example\n    Create View: CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL\nSECU\nRITY DEFINER VIEW example AS (select t.id AS id,t.s AS s from t)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nGrants\n------\n\nTo be able to see a view, you need to have the SHOW VIEW and the SELECT\nprivilege on the view:\n\nGRANT SHOW VIEW,SELECT ON test_database.test_view TO \'test\'@\'localhost\';\n\nURL: https://mariadb.com/kb/en/show-create-view/','','https://mariadb.com/kb/en/show-create-view/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (373,26,'SHOW DATABASES','Syntax\n------\n\nSHOW {DATABASES | SCHEMAS}\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW DATABASES lists the databases on the MariaDB server host. SHOW SCHEMAS is\na synonym for SHOW DATABASES. The LIKE clause, if present on its own,\nindicates which database names to match. The WHERE and LIKE clauses can be\ngiven to select rows using more general conditions, as discussed in Extended\nSHOW.\n\nYou see only those databases for which you have some kind of privilege, unless\nyou have the global SHOW DATABASES privilege. You can also get this list using\nthe mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you cannot use\nthis statement at all unless you have the SHOW DATABASES privilege.\n\nThe list of results returned by SHOW DATABASES is based on directories in the\ndata directory, which is how MariaDB implements databases. It\'s possible that\noutput includes directories that do not correspond to actual databases.\n\nThe Information Schema SCHEMATA table also contains database information.\n\nExamples\n--------\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| test               |\n+--------------------+\n\nSHOW DATABASES LIKE \'m%\';\n+---------------+\n| Database (m%) |\n+---------------+\n| mysql         |\n+---------------+\n\nURL: https://mariadb.com/kb/en/show-databases/','','https://mariadb.com/kb/en/show-databases/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (374,26,'SHOW ENGINE','Syntax\n------\n\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nDescription\n-----------\n\nSHOW ENGINE displays operational information about a storage engine. The\nfollowing statements currently are supported:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\nSHOW ENGINE ROCKSDB STATUS\n\nIf the Sphinx Storage Engine is installed, the following is also supported:\n\nSHOW ENGINE SPHINX STATUS\n\nSee SHOW ENGINE SPHINX STATUS.\n\nOlder (and now removed) synonyms were SHOW INNODB STATUS for SHOW ENGINE\nINNODB STATUS and SHOW MUTEX STATUS for SHOW ENGINE INNODB MUTEX.\n\nSHOW ENGINE INNODB STATUS\n-------------------------\n\nSHOW ENGINE INNODB STATUS displays extensive information from the standard\nInnoDB Monitor about the state of the InnoDB storage engine. See SHOW ENGINE\nINNODB STATUS for more.\n\nSHOW ENGINE INNODB MUTEX\n------------------------\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics.\n\nThe statement displays the following output fields:\n\n* Type: Always InnoDB.\n* Name: The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number is dependent on the\nMariaDB version.\n* Status: This field displays the following values if UNIV_DEBUG was defined\nat compilation time (for example, in include/univ.h in the InnoDB part of the\nsource tree). Only the os_waits value is displayed if UNIV_DEBUG was not\ndefined. Without UNIV_DEBUG, the information on which the output is based is\ninsufficient to distinguish regular mutexes and mutexes that protect\n rw-locks (which allow multiple readers or a single writer). Consequently, the\n output may appear to contain multiple rows for the same mutex.\ncount indicates how many times the mutex was requested.\nspin_waits indicates how many times the spinlock had to run.\nspin_rounds indicates the number of spinlock rounds. (spin_rounds divided by\n spin_waits provides the average round count.)\nos_waits indicates the number of operating system waits. This occurs when\n the spinlock did not work (the mutex was not locked during the spinlock and\n it was necessary to yield to the operating system and wait).\nos_yields indicates the number of times a the thread trying to lock a mutex\n gave up its timeslice and yielded to the operating system (on the\n presumption that allowing other threads to run will free the mutex so that\n it can be locked).\nos_wait_times indicates the amount of time (in ms) spent in operating system\n waits, if the timed_mutexes system variable is 1 (ON). If timed_mutexes is 0\n (OFF), timing is disabled, so os_wait_times is 0. timed_mutexes is off by\n default.\n\nInformation from this statement can be used to diagnose system problems. For\nexample, large values of spin_waits and spin_rounds may indicate scalability\nproblems.\n\nThe information_schema.INNODB_MUTEXES table provides similar information.\n\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n-------------------------------------\n\nThis statement shows how much memory is used for performance_schema tables and\ninternal buffers.\n\nThe output contains the following fields:\n\n* Type: Always performance_schema.\n* Name: The name of a table, the name of an internal buffer, or the\nperformance_schema word, followed by a dot and an attribute. Internal buffers\nnames are enclosed by parenthesis. performance_schema means that the attribute\nrefers to the whole database (it is a total). \n* Status: The value for the attribute.\n\nThe following attributes are shown, in this order, for all tables:\n\n* row_size: The memory used for an individual record. This value will never\nchange.\n* row_count: The number of rows in the table or buffer. For some tables, this\nvalue depends on a server system variable.\n* memory: For tables and performance_schema, this is the result of row_size *\nrow_count.\n\nFor internal buffers, the attributes are:\n\n* count\n* size\n\nSHOW ENGINE ROCKSDB STATUS\n--------------------------\n\nSee also MyRocks Performance Troubleshooting\n\nURL: https://mariadb.com/kb/en/show-engine/','','https://mariadb.com/kb/en/show-engine/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,26,'SHOW ENGINE INNODB STATUS','SHOW ENGINE INNODB STATUS is a specific form of the SHOW ENGINE statement that\ndisplays the InnoDB Monitor output, which is extensive InnoDB information\nwhich can be useful in diagnosing problems.\n\nThe following sections are displayed\n\n* Status: Shows the timestamp, monitor name and the number of seconds, or the\nelapsed time between the current time and the time the InnoDB Monitor output\nwas last displayed. The per-second averages are based upon this time.\n* BACKGROUND THREAD: srv_master_thread lines show work performed by the main\nbackground thread.\n* SEMAPHORES: Threads waiting for a semaphore and stats on how the number of\ntimes threads have needed a spin or a wait on a mutex or rw-lock semaphore. If\nthis number of threads is large, there may be I/O or contention issues.\nReducing the size of the innodb_thread_concurrency system variable may help if\ncontention is related to thread scheduling. Spin rounds per wait shows the\nnumber of spinlock rounds per OS wait for a mutex. \n* LATEST FOREIGN KEY ERROR: Only shown if there has been a foreign key\nconstraint error, it displays the failed statement and information about the\nconstraint and the related tables.\n* LATEST DETECTED DEADLOCK: Only shown if there has been a deadlock, it\ndisplays the transactions involved in the deadlock and the statements being\nexecuted, held and required locked and the transaction rolled back to.\n* TRANSACTIONS: The output of this section can help identify lock contention,\nas well as reasons for the deadlocks.\n* FILE I/O: InnoDB thread information as well as pending I/O operations and\nI/O performance statistics.\n* INSERT BUFFER AND ADAPTIVE HASH INDEX: InnoDB insert buffer (old name for\nthe change buffer) and adaptive hash index status information, including the\nnumber of each type of operation performed, and adaptive hash index\nperformance.\n* LOG: InnoDB log information, including current log sequence number, how far\nthe log has been flushed to disk, the position at which InnoDB last took a\ncheckpoint, pending writes and write performance statistics.\n* BUFFER POOL AND MEMORY: Information on buffer pool pages read and written,\nwhich allows you to see the number of data file I/O operations performed by\nyour queries. See InnoDB Buffer Pool for more. Similar information is also\navailable from the INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS table.\n* ROW OPERATIONS:Information about the main thread, including the number and\nperformance rate for each type of row operation.\n\nIf the innodb_status_output_locks system variable is set to 1, extended lock\ninformation will be displayed.\n\nExample output:\n\n=====================================\n2019-09-06 12:44:13 0x7f93cc236700 INNODB MONITOR OUTPUT\n=====================================\nPer second averages calculated from the last 4 seconds\n-----------------\nBACKGROUND THREAD\n-----------------\nsrv_master_thread loops: 2 srv_active, 0 srv_shutdown, 83698 srv_idle\nsrv_master_thread log flush and writes: 83682\n----------\nSEMAPHORES\n----------\nOS WAIT ARRAY INFO: reservation count 15\nOS WAIT ARRAY INFO: signal count 8\nRW-shared spins 0, rounds 20, OS waits 7\nRW-excl spins 0, rounds 0, OS waits 0\nRW-sx spins 0, rounds 0, OS waits 0\nSpin rounds per wait: 20.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx\n------------\nTRANSACTIONS\n------------\nTrx id counter 236\nPurge done for trx\'s n:o < 236 undo n:o < 0 state: running\nHistory list length 22\nLIST OF TRANSACTIONS FOR EACH SESSION:\n---TRANSACTION 421747401994584, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n---TRANSACTION 421747401990328, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n--------\nFILE I/O\n--------\nI/O thread 0 state: waiting for completed aio requests (insert buffer thread)\nI/O thread 1 state: waiting for completed aio requests (log thread)\nI/O thread 2 state: waiting for completed aio requests (read thread)\nI/O thread 3 state: waiting for completed aio requests (read thread)\nI/O thread 4 state: waiting for completed aio requests (read thread)\nI/O thread 5 state: waiting for completed aio requests (read thread)\nI/O thread 6 state: waiting for completed aio requests (write thread)\nI/O thread 7 state: waiting for completed aio requests (write thread)\nI/O thread 8 state: waiting for completed aio requests (write thread)\nI/O thread 9 state: waiting for completed aio requests (write thread)\nPending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,\n ibuf aio reads:, log i/o\'s:, sync i/o\'s:\nPending flushes (fsync) log: 0; buffer pool: 0\n286 OS file reads, 171 OS file writes, 22 OS fsyncs\n0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s\n-------------------------------------\nINSERT BUFFER AND ADAPTIVE HASH INDEX\n-------------------------------------\nIbuf: size 1, free list len 0, seg size 2, 0 merges\nmerged operations:\n insert 0, delete mark 0, delete 0\ndiscarded operations:\n insert 0, delete mark 0, delete 0\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\n0.00 hash searches/s, 0.00 non-hash searches/s\n---\nLOG\n---\nLog sequence number 445926\nLog flushed up to   445926\nPages flushed up to 445926\nLast checkpoint at  445917\n0 pending log flushes, 0 pending chkp writes\n18 log i/o\'s done, 0.00 log i/o\'s/second\n----------------------\nBUFFER POOL AND MEMORY\n----------------------\nTotal large memory allocated 167772160\nDictionary memory allocated 50768\nBuffer pool size   8012\nFree buffers       7611\nDatabase pages     401\nOld database pages 0\nModified db pages  0\nPercent of dirty pages(LRU & free pages): 0.000\nMax dirty pages percent: 75.000\nPending reads 0\nPending writes: LRU 0, flush list 0, single page 0\nPages made young 0, not young 0\n0.00 youngs/s, 0.00 non-youngs/s\nPages read 264, created 137, written 156\n0.00 reads/s, 0.00 creates/s, 0.00 writes/s\nNo buffer pool page gets since the last printout\nPages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead\n0.00/s\nLRU len: 401, unzip_LRU len: 0\nI/O sum[0]:cur[0], unzip sum[0]:cur[0]\n--------------\nROW OPERATIONS\n--------------\n0 queries inside InnoDB, 0 queries in queue\n0 read views open inside InnoDB\nProcess ID=4267, Main thread ID=140272021272320, state: sleeping\nNumber of rows inserted 1, updated 0, deleted 0, read 1\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\nNumber of system rows inserted 0, updated 0, deleted 0, read 0\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\n----------------------------\nEND OF INNODB MONITOR OUTPUT\n============================\n\nURL: https://mariadb.com/kb/en/show-engine-innodb-status/','','https://mariadb.com/kb/en/show-engine-innodb-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (376,26,'SHOW ENGINES','Syntax\n------\n\nSHOW [STORAGE] ENGINES\n\nDescription\n-----------\n\nSHOW ENGINES displays status information about the server\'s storage engines.\nThis is particularly useful for checking whether a storage engine is\nsupported, or to see what the default engine is. SHOW TABLE TYPES is a\ndeprecated synonym.\n\nThe information_schema.ENGINES table provides the same information.\n\nSince storage engines are plugins, different information about them is also\nshown in the information_schema.PLUGINS table and by the SHOW PLUGINS\nstatement.\n\nNote that both MySQL\'s InnoDB and Percona\'s XtraDB replacement are labeled as\nInnoDB. However, if XtraDB is in use, it will be specified in the COMMENT\nfield. See XtraDB and InnoDB. The same applies to FederatedX.\n\nThe output consists of the following columns:\n\n* Engine indicates the engine\'s name.\n* Support indicates whether the engine is installed, and whether it is the\ndefault engine for the current session.\n* Comment is a brief description.\n* Transactions, XA and Savepoints indicate whether transactions, XA\ntransactions and transaction savepoints are supported by the engine.\n\nExamples\n--------\n\nSHOW ENGINES\\G\n*************************** 1. row ***************************\n   Engine: InnoDB\n  Support: DEFAULT\n  Comment: Supports transactions, row-level locking, and foreign keys\nTransactions: YES\n     XA: YES\n Savepoints: YES\n*************************** 2. row ***************************\n   Engine: CSV\n  Support: YES\n  Comment: CSV storage engine\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 3. row ***************************\n   Engine: MyISAM\n  Support: YES\n  Comment: MyISAM storage engine\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 4. row ***************************\n   Engine: BLACKHOLE\n  Support: YES\n  Comment: /dev/null storage engine (anything you write to it disappears)\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 5. row ***************************\n   Engine: FEDERATED\n  Support: YES\n  Comment: FederatedX pluggable storage engine\nTransactions: YES\n     XA: NO\n Savepoints: YES\n*************************** 6. row ***************************\n   Engine: MRG_MyISAM\n  Support: YES\n  Comment: Collection of identical MyISAM tables\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 7. row ***************************\n   Engine: ARCHIVE\n  Support: YES\n  Comment: Archive storage engine\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 8. row ***************************\n   Engine: MEMORY\n  Support: YES\n  Comment: Hash based, stored in memory, useful for temporary tables\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 9. row ***************************\n   Engine: PERFORMANCE_SCHEMA\n  Support: YES\n  Comment: Performance Schema\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 10. row ***************************\n   Engine: Aria\n  Support: YES\n  Comment: Crash-safe tables with MyISAM heritage\nTransactions: NO\n     XA: NO\n Savepoints: NO\n10 rows in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/show-engines/','','https://mariadb.com/kb/en/show-engines/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (377,26,'SHOW ERRORS','Syntax\n------\n\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) ERRORS\n\nDescription\n-----------\n\nThis statement is similar to SHOW WARNINGS, except that instead of displaying\nerrors, warnings, and notes, it displays only errors.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You can also\nretrieve this number from the error_count variable.\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nThe value of error_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is set so\nlow that not all messages are stored.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nExamples\n--------\n\nSELECT f();\nERROR 1305 (42000): FUNCTION f does not exist\n\nSHOW COUNT(*) ERRORS;\n+-----------------------+\n| @@session.error_count |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSHOW ERRORS;\n+-------+------+---------------------------+\n| Level | Code | Message                   |\n+-------+------+---------------------------+\n| Error | 1305 | FUNCTION f does not exist |\n+-------+------+---------------------------+\n\nURL: https://mariadb.com/kb/en/show-errors/','','https://mariadb.com/kb/en/show-errors/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (378,26,'SHOW EVENTS','Syntax\n------\n\nSHOW EVENTS [{FROM | IN} schema_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nShows information about Event Manager events (created with CREATE EVENT).\nRequires the EVENT privilege. Without any arguments, SHOW EVENTS lists all of\nthe events in the current schema:\n\nSELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora    | myschema |\n+----------------+----------+\n\nSHOW EVENTS\\G\n*************************** 1. row ***************************\n         Db: myschema\n        Name: e_daily\n      Definer: jon@ghidora\n     Time zone: SYSTEM\n        Type: RECURRING\n     Execute at: NULL\n   Interval value: 10\n   Interval field: SECOND\n       Starts: 2006-02-09 10:41:23\n        Ends: NULL\n       Status: ENABLED\n     Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see the event action, use SHOW CREATE EVENT instead, or look at the\ninformation_schema.EVENTS table.\n\nTo see events for a specific schema, use the FROM clause. For example, to see\nevents for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The WHERE\nclause can be given to select rows using more general conditions, as discussed\nin Extended Show.\n\nURL: https://mariadb.com/kb/en/show-events/','','https://mariadb.com/kb/en/show-events/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (379,26,'SHOW FUNCTION STATUS','Syntax\n------\n\nSHOW FUNCTION STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored functions.\n\nThe LIKE clause, if present on its own, indicates which function names to\nmatch.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe information_schema.ROUTINES table contains more detailed information.\n\nExamples\n--------\n\nShowing all stored functions:\n\nSHOW FUNCTION STATUS\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: VatCents\n        Type: FUNCTION\n      Definer: root@localhost\n      Modified: 2013-06-01 12:40:31\n      Created: 2013-06-01 12:40:31\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nStored functions whose name starts with \'V\':\n\nSHOW FUNCTION STATUS LIKE \'V%\' \\G\n*************************** 1. row ***************************\n         Db: test\n        Name: VatCents\n        Type: FUNCTION\n      Definer: root@localhost\n      Modified: 2013-06-01 12:40:31\n      Created: 2013-06-01 12:40:31\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nStored functions with a security type of \'DEFINER\':\n\nSHOW FUNCTION STATUS WHERE Security_type LIKE \'DEFINER\' \\G\n*************************** 1. row ***************************\n         Db: test\n        Name: VatCents\n        Type: FUNCTION\n      Definer: root@localhost\n      Modified: 2013-06-01 12:40:31\n      Created: 2013-06-01 12:40:31\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-function-status/','','https://mariadb.com/kb/en/show-function-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,26,'SHOW LOCALES','SHOW LOCALES was introduced as part of the Information Schema plugin extension.\n\nSHOW LOCALES is used to return locales information as part of the Locales\nplugin. While the information_schema.LOCALES table has 8 columns, the SHOW\nLOCALES statement will only display 4 of them:\n\nExample\n-------\n\nSHOW LOCALES;\n+-----+-------+-------------------------------------+------------------------+\n| Id  | Name  | Description                         | Error_Message_Language |\n+-----+-------+-------------------------------------+------------------------+\n|   0 | en_US | English - United States             | english                |\n|   1 | en_GB | English - United Kingdom            | english                |\n|   2 | ja_JP | Japanese - Japan                    | japanese               |\n|   3 | sv_SE | Swedish - Sweden                    | swedish                |\n...\n\nURL: https://mariadb.com/kb/en/show-locales/','','https://mariadb.com/kb/en/show-locales/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (381,26,'SHOW OPEN TABLES','Syntax\n------\n\nSHOW OPEN TABLES [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open in the\ntable cache. See http://dev.mysql.com/doc/refman/5.1/en/table-cache.html.\n\nThe FROM and LIKE clauses may be used.\n\nThe FROM clause, if present, restricts the tables shown to those present in\nthe db_name database.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n+---------------------------+------------------------------------------------+\n| Column                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| Database                  | Database name.                                 |\n+---------------------------+------------------------------------------------+\n| Name                      | Table name.                                    |\n+---------------------------+------------------------------------------------+\n| In_use                    | Number of  table instances being used.         |\n+---------------------------+------------------------------------------------+\n| Name_locked               | 1 if the table is name-locked, e.g. if it is   |\n|                           | being dropped or renamed, otherwise 0.         |\n+---------------------------+------------------------------------------------+\n\nBefore MariaDB 5.5, each use of, for example, LOCK TABLE ... WRITE would\nincrement In_use for that table. With the implementation of the metadata\nlocking improvements in MariaDB 5.5, LOCK TABLE... WRITE acquires a strong MDL\nlock, and concurrent connections will wait on this MDL lock, so any subsequent\nLOCK TABLE... WRITE will not increment In_use.\n\nExample\n-------\n\nSHOW OPEN TABLES;\n+----------+---------------------------+--------+-------------+\n| Database | Table                     | In_use | Name_locked |\n+----------+---------------------------+--------+-------------+\n...\n| test     | xjson                     |      0 |           0 |\n| test     | jauthor                   |      0 |           0 |\n| test     | locks                     |      1 |           0 |\n...\n+----------+---------------------------+--------+-------------+\n\nURL: https://mariadb.com/kb/en/show-open-tables/','','https://mariadb.com/kb/en/show-open-tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (382,26,'SHOW PACKAGE BODY STATUS','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW PACKAGE BODY STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE BODY STATUS statement returns characteristics of stored\npackage bodies (implementations), such as the database, name, type, creator,\ncreation and modification dates, and character set information. A similar\nstatement, SHOW PACKAGE STATUS, displays information about stored package\nspecifications.\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE\nand LIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PACKAGE BODY STATUS LIKE \'pkg1\'\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: pkg1\n        Type: PACKAGE BODY\n      Definer: root@localhost\n      Modified: 2018-02-27 14:44:14\n      Created: 2018-02-27 14:44:14\n   Security_type: DEFINER\n      Comment: This is my first package body\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-package-body-status/','','https://mariadb.com/kb/en/show-package-body-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (383,26,'SHOW PACKAGE STATUS','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW PACKAGE STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE STATUS statement returns characteristics of stored package\nspecifications, such as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar statement, SHOW\nPACKAGE BODY STATUS, displays information about stored package bodies (i.e.\nimplementations).\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE\nand LIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PACKAGE STATUS LIKE \'pkg1\'\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: pkg1\n        Type: PACKAGE\n      Definer: root@localhost\n      Modified: 2018-02-27 14:38:15\n      Created: 2018-02-27 14:38:15\n   Security_type: DEFINER\n      Comment: This is my first package\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-package-status/','','https://mariadb.com/kb/en/show-package-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (384,26,'SHOW PRIVILEGES','Syntax\n------\n\nSHOW PRIVILEGES\n\nDescription\n-----------\n\nSHOW PRIVILEGES shows the list of system privileges that the MariaDB server\nsupports. The exact list of privileges depends on the version of your server.\n\nNote that before MariaDB 10.3.23, MariaDB 10.4.13 and MariaDB 10.5.2 , the\nDelete history privilege displays as Delete versioning rows (MDEV-20382).\n\nExample\n-------\n\nFrom MariaDB 10.5.9\n\nSHOW PRIVILEGES;\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n| Privilege                | Context                               | Comment  \n                            |\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n| Alter                    | Tables                                | To alter\nthe table                                                 |\n| Alter routine            | Functions,Procedures                  | To alter\nor drop stored functions/procedures                       |\n| Create                   | Databases,Tables,Indexes              | To create\nnew databases and tables                                 |\n| Create routine           | Databases                             | To use\nCREATE FUNCTION/PROCEDURE                                   |\n| Create temporary tables  | Databases                             | To use\nCREATE TEMPORARY TABLE                                      |\n| Create view              | Tables                                | To create\nnew views                                                |\n| Create user              | Server Admin                          | To create\nnew users                                                |\n| Delete                   | Tables                                | To delete\nexisting rows                                            |\n| Delete history           | Tables                                | To delete\nversioning table historical rows                         |\n| Drop                     | Databases,Tables                      | To drop\ndatabases, tables, and views                               |\n| Event                    | Server Admin                          | To\ncreate, alter, drop and execute events                          |\n| Execute                  | Functions,Procedures                  | To\nexecute stored routines                                         |\n| File                     | File access on server                 | To read\nand write files on the server                              |\n| Grant option             | Databases,Tables,Functions,Procedures | To give\nto other users those privileges you possess                |\n| Index                    | Tables                                | To create\nor drop indexes                                          |\n| Insert                   | Tables                                | To insert\ndata into tables                                         |\n| Lock tables              | Databases                             | To use\nLOCK TABLES (together with SELECT privilege)                |\n| Process                  | Server Admin                          | To view\nthe plain text of currently executing queries              |\n| Proxy                    | Server Admin                          | To make\nproxy user possible                                        |\n| References               | Databases,Tables                      | To have\nreferences on tables                                       |\n| Reload                   | Server Admin                          | To reload\nor refresh tables, logs and privileges                   |\n| Binlog admin             | Server                                | To purge\nbinary logs                                               |\n| Binlog monitor           | Server                                | To use\nSHOW BINLOG STATUS and SHOW BINARY LOG                      |\n| Binlog replay            | Server                                | To use\nBINLOG (generated by mariadb-binlog)                        |\n| Replication master admin | Server                                | To\nmonitor connected slaves                                        |\n| Replication slave admin  | Server                                | To\nstart/stop slave and apply binlog events                        |\n| Slave monitor            | Server                                | To use\nSHOW SLAVE STATUS and SHOW RELAYLOG EVENTS                  |\n| Replication slave        | Server Admin                          | To read\nbinary log events from the master                          |\n| Select                   | Tables                                | To\nretrieve rows from table                                        |\n| Show databases           | Server Admin                          | To see\nall databases with SHOW DATABASES                           |\n| Show view                | Tables                                | To see\nviews with SHOW CREATE VIEW                                 |\n| Shutdown                 | Server Admin                          | To shut\ndown the server                                            |\n| Super                    | Server Admin                          | To use\nKILL thread, SET GLOBAL, CHANGE MASTER, etc.                |\n| Trigger                  | Tables                                | To use\ntriggers                                                    |\n| Create tablespace        | Server Admin                          | To\ncreate/alter/drop tablespaces                                   |\n| Update                   | Tables                                | To update\nexisting rows                                            |\n| Set user                 | Server                                | To create\nviews and stored routines with a different definer       |\n| Federated admin          | Server                                | To\nexecute the CREATE SERVER, ALTER SERVER, DROP SERVER statements |\n| Connection admin         | Server                                | To bypass\nconnection limits and kill other users\' connections      |\n| Read_only admin          | Server                                | To\nperform write operations even if @@read_only=ON                 |\n| Usage                    | Server Admin                          | No\nprivileges - allow connect only                                 |\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n41 rows in set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/show-privileges/','','https://mariadb.com/kb/en/show-privileges/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (385,26,'SHOW PROCEDURE CODE','Syntax\n------\n\nSHOW PROCEDURE CODE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension that is available only for servers that\nhave been built with debugging support. It displays a representation of the\ninternal implementation of the named stored procedure. A similar statement,\nSHOW FUNCTION CODE, displays information about stored functions.\n\nBoth statements require that you be the owner of the routine or have SELECT\naccess to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result set. Each\nrow in the result set corresponds to one \"instruction\" in the routine. The\nfirst column is Pos, which is an ordinal number beginning with 0. The second\ncolumn is Instruction, which contains an SQL statement (usually changed from\nthe original source), or a directive which has meaning only to the\nstored-routine handler.\n\nExamples\n--------\n\nDELIMITER //\n\nCREATE PROCEDURE p1 ()\n BEGIN\n  DECLARE fanta INT DEFAULT 55;\n  DROP TABLE t2;\n  LOOP\n   INSERT INTO t3 VALUES (fanta);\n   END LOOP;\n END//\nQuery OK, 0 rows affected (0.00 sec)\n\nSHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction                            |\n+-----+----------------------------------------+\n|   0 | set fanta@0 55                         |\n|   1 | stmt 9 \"DROP TABLE t2\"                 |\n|   2 | stmt 5 \"INSERT INTO t3 VALUES (fanta)\" |\n|   3 | jump 2                                 |\n+-----+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-procedure-code/','','https://mariadb.com/kb/en/show-procedure-code/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (386,26,'SHOW PROCEDURE STATUS','Syntax\n------\n\nSHOW PROCEDURE STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns characteristics of a stored\nprocedure, such as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar statement, SHOW\nFUNCTION STATUS, displays information about stored functions.\n\nThe LIKE clause, if present, indicates which procedure or function names to\nmatch. The WHERE and LIKE clauses can be given to select rows using more\ngeneral conditions, as discussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PROCEDURE STATUS LIKE \'p1\'\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: p1\n        Type: PROCEDURE\n      Definer: root@localhost\n      Modified: 2010-08-23 13:23:03\n      Created: 2010-08-23 13:23:03\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-procedure-status/','','https://mariadb.com/kb/en/show-procedure-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,26,'SHOW PROCESSLIST','Syntax\n------\n\nSHOW [FULL] PROCESSLIST\n\nDescription\n-----------\n\nSHOW PROCESSLIST shows you which threads are running. You can also get this\ninformation from the information_schema.PROCESSLIST table or the mysqladmin\nprocesslist command. If you have the PROCESS privilege, you can see all\nthreads. Otherwise, you can see only your own threads (that is, threads\nassociated with the MariaDB account that you are using). If you do not use the\nFULL keyword, only the first 100 characters of each statement are shown in the\nInfo field.\n\nThe columns shown in SHOW PROCESSLIST are:\n\n+---------------------+------------------------------------------------------+\n| Name                | Description                                          |\n+---------------------+------------------------------------------------------+\n| ID                  | The client\'s process ID.                             |\n+---------------------+------------------------------------------------------+\n| USER                | The username associated with the process.            |\n+---------------------+------------------------------------------------------+\n| HOST                | The host the client is connected to.                 |\n+---------------------+------------------------------------------------------+\n| DB                  | The default database of the process (NULL if no      |\n|                     | default).                                            |\n+---------------------+------------------------------------------------------+\n| COMMAND             | The command type. See Thread Command Values.         |\n+---------------------+------------------------------------------------------+\n| TIME                | The amount of time, in seconds, the process has      |\n|                     | been in its current state. For a replica SQL thread  |\n|                     | before MariaDB 10.1, this is the time in seconds     |\n|                     | between the last replicated event\'s timestamp and    |\n|                     | the replica machine\'s real time.                     |\n+---------------------+------------------------------------------------------+\n| STATE               | See Thread States.                                   |\n+---------------------+------------------------------------------------------+\n| INFO                | The statement being executed.                        |\n+---------------------+------------------------------------------------------+\n| PROGRESS            | The total progress of the process (0-100%) (see      |\n|                     | Progress Reporting).                                 |\n+---------------------+------------------------------------------------------+\n\nSee TIME_MS column in information_schema.PROCESSLIST for differences in the\nTIME column between MariaDB and MySQL.\n\nThe information_schema.PROCESSLIST table contains the following additional\ncolumns:\n\n+---------------------+------------------------------------------------------+\n| Name                | Description                                          |\n+---------------------+------------------------------------------------------+\n| TIME_MS             | The amount of time, in milliseconds, the process     |\n|                     | has been in its current state.                       |\n+---------------------+------------------------------------------------------+\n| STAGE               | The stage the process is currently in.               |\n+---------------------+------------------------------------------------------+\n| MAX_STAGE           | The maximum number of stages.                        |\n+---------------------+------------------------------------------------------+\n| PROGRESS            | The progress of the process within the current       |\n|                     | stage (0-100%).                                      |\n+---------------------+------------------------------------------------------+\n| MEMORY_USED         | The amount of memory used by the process.            |\n+---------------------+------------------------------------------------------+\n| EXAMINED_ROWS       | The number of rows the process has examined.         |\n+---------------------+------------------------------------------------------+\n| QUERY_ID            | Query ID.                                            |\n+---------------------+------------------------------------------------------+\n\nNote that the PROGRESS field from the information schema, and the PROGRESS\nfield from SHOW PROCESSLIST display different results. SHOW PROCESSLIST shows\nthe total progress, while the information schema shows the progress for the\ncurrent stage only.\n\nThreads can be killed using their thread_id or their query_id, with the KILL\nstatement.\n\nSince queries on this table are locking, if the performance_schema is enabled,\nyou may want to query the THREADS table instead.\n\nExamples\n--------\n\nSHOW PROCESSLIST;\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n| Id | User            | Host      | db   | Command | Time | State            \n  | Info             | Progress |\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n|  2 | event_scheduler | localhost | NULL | Daemon  | 2693 | Waiting on empty\nqueue | NULL             |    0.000 |\n|  4 | root            | localhost | NULL | Query   |    0 | Table lock       \n  | SHOW PROCESSLIST |    0.000 |\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n\nURL: https://mariadb.com/kb/en/show-processlist/','','https://mariadb.com/kb/en/show-processlist/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (388,26,'SHOW PROFILE','Syntax\n------\n\nSHOW PROFILE [type [, type] ... ]\n  [FOR QUERY n]\n  [LIMIT row_count [OFFSET offset]]\n\ntype:\n  ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nDescription\n-----------\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling information\nthat indicates resource usage for statements executed during the course of the\ncurrent session.\n\nProfiling is controlled by the profiling session variable, which has a default\nvalue of 0 (OFF). Profiling is enabled by setting profiling to 1 or ON:\n\nSET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nmaster. The size of the list is controlled by the profiling_history_size\nsession variable, which has a default value of 15. The maximum value is 100.\nSetting the value to 0 has the practical effect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILES and SHOW PROFILE, so you will\nfind neither of those statements in the profile list. Malformed statements are\nprofiled. For example, SHOW PROFILING is an illegal statement, and a syntax\nerror occurs if you try to execute it, but it will show up in the profiling\nlist.\n\nSHOW PROFILE displays detailed information about a single statement. Without\nthe FOR QUERY n clause, the output pertains to the most recently executed\nstatement. If FOR QUERY n is included, SHOW PROFILE displays information for\nstatement n. The values of n correspond to the Query_ID values displayed by\nSHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to row_count rows.\nIf LIMIT is given, OFFSET offset may be added to begin the output offset rows\ninto the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The Status\nvalues are like the State values displayed by SHOW PROCESSLIST, although there\nmight be some minor differences in interpretation for the two statements for\nsome status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n\nOptional type values may be specified to display specific additional types of\ninformation:\n\n* ALL displays all information\n* BLOCK IO displays counts for block input and output operations\n* CONTEXT SWITCHES displays counts for voluntary and involuntary context\nswitches\n* CPU displays user and system CPU usage times\n* IPC displays counts for messages sent and received\n* MEMORY is not currently implemented\n* PAGE FAULTS displays counts for major and minor page faults\n* SOURCE displays the names of functions from the source code, together with\nthe name and line number of the file in which the function occurs\n* SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nThe information_schema.PROFILING table contains similar information.\n\nExamples\n--------\n\nSELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n|           0 |\n+-------------+\n\nSET profiling = 1;\n\nUSE test;\n\nDROP TABLE IF EXISTS t1;\n\nCREATE TABLE T1 (id INT);\n\nSHOW PROFILES;\n+----------+------------+--------------------------+\n| Query_ID | Duration   | Query                    |\n+----------+------------+--------------------------+\n|        1 | 0.00009200 | SELECT DATABASE()        |\n|        2 | 0.00023800 | show databases           |\n|        3 | 0.00018900 | show tables              |\n|        4 | 0.00014700 | DROP TABLE IF EXISTS t1  |\n|        5 | 0.24476900 | CREATE TABLE T1 (id INT) |\n+----------+------------+--------------------------+\n\nSHOW PROFILE;\n+----------------------+----------+\n| Status               | Duration |\n+----------------------+----------+\n| starting             | 0.000042 |\n| checking permissions | 0.000044 |\n| creating table       | 0.244645 |\n| After create         | 0.000013 |\n| query end            | 0.000003 |\n| freeing items        | 0.000016 |\n| logging slow query   | 0.000003 |\n| cleaning up          | 0.000003 |\n+----------------------+----------+\n\nSHOW PROFILE FOR QUERY 4;\n+--------------------+----------+\n| Status             | Duration |\n+--------------------+----------+\n| starting           | 0.000126 |\n| query end          | 0.000004 |\n| freeing items      | 0.000012 |\n| logging slow query | 0.000003 |\n| cleaning up        | 0.000002 |\n+--------------------+----------+\n\nSHOW PROFILE CPU FOR QUERY 5;\n+----------------------+----------+----------+------------+\n| Status               | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| starting             | 0.000042 | 0.000000 |   0.000000 |\n| checking permissions | 0.000044 | 0.000000 |   0.000000 |\n| creating table       | 0.244645 | 0.000000 |   0.000000 |\n| After create         | 0.000013 | 0.000000 |   0.000000 |\n| query end            | 0.000003 | 0.000000 |   0.000000 |\n| freeing items        | 0.000016 | 0.000000 |   0.000000 |\n| logging slow query   | 0.000003 | 0.000000 |   0.000000 |\n| cleaning up          | 0.000003 | 0.000000 |   0.000000 |\n+----------------------+----------+----------+------------+\n\nURL: https://mariadb.com/kb/en/show-profile/','','https://mariadb.com/kb/en/show-profile/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (389,26,'SHOW PROFILES','Syntax\n------\n\nSHOW PROFILES\n\nDescription\n-----------\n\nThe SHOW PROFILES statement displays profiling information that indicates\nresource usage for statements executed during the course of the current\nsession. It is used together with SHOW PROFILE.\n\nURL: https://mariadb.com/kb/en/show-profiles/','','https://mariadb.com/kb/en/show-profiles/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,26,'SHOW QUERY_RESPONSE_TIME','It is possible to use SHOW QUERY_RESPONSE_TIME as an alternative for\nretrieving information from the QUERY_RESPONSE_TIME plugin.\n\nThis was introduced as part of the Information Schema plugin extension.\n\nURL: https://mariadb.com/kb/en/show-query_response_time/','','https://mariadb.com/kb/en/show-query_response_time/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (391,26,'SHOW STATUS','Syntax\n------\n\nSHOW [GLOBAL | SESSION] STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW STATUS provides server status information. This information also can be\nobtained using the mysqladmin extended-status command, or by querying the\nInformation Schema GLOBAL_STATUS and SESSION_STATUS tables. The LIKE clause,\nif present, indicates which variable names to match. The WHERE clause can be\ngiven to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for all\nconnections to MariaDB. With SESSION, it displays the status values for the\ncurrent connection. If no modifier is present, the default is SESSION. LOCAL\nis a synonym for SESSION. If you see a lot of 0 values, the reason is probably\nthat you have used SHOW STATUS with a new connection instead of SHOW GLOBAL\nSTATUS.\n\nSome status variables have only a global value. For these, you get the same\nvalue for both GLOBAL and SESSION.\n\nSee Server Status Variables for a full list, scope and description of the\nvariables that can be viewed with SHOW STATUS.\n\nThe LIKE clause, if present on its own, indicates which variable name to match.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nFull output from MariaDB 10.1.17:\n\nSHOW GLOBAL STATUS;\n+--------------------------------------------------------------+---------------\n------------------------+\n| Variable_name                                                | Value        \n            |\n+--------------------------------------------------------------+---------------\n------------------------+\n| Aborted_clients                                              | 0            \n            |\n| Aborted_connects                                             | 0            \n            |\n| Access_denied_errors                                         | 0            \n            |\n| Acl_column_grants                                            | 0            \n            |\n| Acl_database_grants                                          | 2            \n            |\n| Acl_function_grants                                          | 0            \n            |\n| Acl_procedure_grants                                         | 0            \n            |\n| Acl_proxy_users                                              | 2            \n            |\n| Acl_role_grants                                              | 0            \n            |\n| Acl_roles                                                    | 0            \n            |\n| Acl_table_grants                                             | 0            \n            |\n| Acl_users                                                    | 6            \n            |\n| Aria_pagecache_blocks_not_flushed                            | 0            \n            |\n| Aria_pagecache_blocks_unused                                 | 15706        \n            |\n| Aria_pagecache_blocks_used                                   | 0            \n            |\n| Aria_pagecache_read_requests                                 | 0            \n            |\n| Aria_pagecache_reads                                         | 0            \n            |\n| Aria_pagecache_write_requests                                | 0            \n            |\n| Aria_pagecache_writes                                        | 0            \n            |\n| Aria_transaction_log_syncs                                   | 0            \n            |\n| Binlog_commits                                               | 0            \n            |\n| Binlog_group_commits                                         | 0            \n            |\n| Binlog_group_commit_trigger_count                            | 0            \n            |\n| Binlog_group_commit_trigger_lock_wait                        | 0            \n            |\n| Binlog_group_commit_trigger_timeout                          | 0            \n            |\n| Binlog_snapshot_file                                         |              \n            |\n| Binlog_snapshot_position                                     | 0            \n            |\n| Binlog_bytes_written                                         | 0            \n            |\n| Binlog_cache_disk_use                                        | 0            \n            |\n| Binlog_cache_use                                             | 0            \n            |\n| Binlog_stmt_cache_disk_use                                   | 0            \n            |\n| Binlog_stmt_cache_use                                        | 0            \n            |\n| Busy_time                                                    | 0.000000     \n            |\n| Bytes_received                                               | 432          \n            |\n| Bytes_sent                                                   | 15183        \n            |\n| Com_admin_commands                                           | 1            \n            |\n| Com_alter_db                                                 | 0            \n            |\n| Com_alter_db_upgrade                                         | 0            \n            |\n| Com_alter_event                                              | 0            \n            |\n| Com_alter_function                                           | 0            \n            |\n| Com_alter_procedure                                          | 0            \n            |\n| Com_alter_server                                             | 0            \n            |\n| Com_alter_table                                              | 0            \n            |\n| Com_alter_tablespace                                         | 0            \n            |\n| Com_analyze                                                  | 0            \n            |\n| Com_assign_to_keycache                                       | 0            \n            |\n| Com_begin                                                    | 0            \n            |\n| Com_binlog                                                   | 0            \n            |\n| Com_call_procedure                                           | 0            \n            |\n| Com_change_db                                                | 0            \n            |\n| Com_change_master                                            | 0            \n            |\n| Com_check                                                    | 0            \n            |\n| Com_checksum                                                 | 0            \n            |\n| Com_commit                                                   | 0            \n            |\n| Com_compound_sql                                             | 0            \n            |\n| Com_create_db                                                | 0            \n            |\n| Com_create_event                                             | 0            \n            |\n| Com_create_function                                          | 0            \n            |\n| Com_create_index                                             | 0            \n            |\n| Com_create_procedure                                         | 0            \n            |\n| Com_create_role                                              | 0            \n            |\n| Com_create_server                                            | 0            \n            |\n| Com_create_table                                             | 0            \n            |\n| Com_create_temporary_table                                   | 0            \n            |\n| Com_create_trigger                                           | 0            \n            |\n| Com_create_udf                                               | 0            \n            |\n| Com_create_user                                              | 0            \n            |\n| Com_create_view                                              | 0            \n            |\n| Com_dealloc_sql                                              | 0            \n            |\n| Com_delete                                                   | 0            \n            |\n| Com_delete_multi                                             | 0            \n            |\n| Com_do                                                       | 0            \n            |\n| Com_drop_db                                                  | 0            \n            |\n| Com_drop_event                                               | 0            \n            |\n| Com_drop_function                                            | 0            \n            |\n| Com_drop_index                                               | 0            \n            |\n| Com_drop_procedure                                           | 0            \n            |\n| Com_drop_role                                                | 0            \n            |\n| Com_drop_server                                              | 0            \n            |\n| Com_drop_table                                               | 0            \n            |\n| Com_drop_temporary_table                                     | 0            \n            |\n| Com_drop_trigger                                             | 0            \n            |\n| Com_drop_user                                                | 0            \n            |\n| Com_drop_view                                                | 0            \n            |\n| Com_empty_query                                              | 0            \n            |\n| Com_execute_sql                                              | 0            \n            |\n| Com_flush                                                    | 0            \n            |\n| Com_get_diagnostics                                          | 0            \n            |\n| Com_grant                                                    | 0            \n            |\n| Com_grant_role                                               | 0            \n            |\n| Com_ha_close                                                 | 0            \n            |\n| Com_ha_open                                                  | 0            \n            |\n| Com_ha_read                                                  | 0            \n            |\n| Com_help                                                     | 0            \n            |\n| Com_insert                                                   | 0            \n            |\n| Com_insert_select                                            | 0            \n            |\n| Com_install_plugin                                           | 0            \n            |\n| Com_kill                                                     | 0            \n            |\n| Com_load                                                     | 0            \n            |\n| Com_lock_tables                                              | 0            \n            |\n| Com_optimize                                                 | 0            \n            |\n| Com_preload_keys                                             | 0            \n            |\n| Com_prepare_sql                                              | 0            \n            |\n| Com_purge                                                    | 0            \n            |\n| Com_purge_before_date                                        | 0            \n            |\n| Com_release_savepoint                                        | 0            \n            |\n| Com_rename_table                                             | 0            \n            |\n| Com_rename_user                                              | 0            \n            |\n| Com_repair                                                   | 0            \n            |\n| Com_replace                                                  | 0            \n            |\n| Com_replace_select                                           | 0            \n            |\n| Com_reset                                                    | 0            \n            |\n| Com_resignal                                                 | 0            \n            |\n| Com_revoke                                                   | 0            \n            |\n| Com_revoke_all                                               | 0            \n            |\n| Com_revoke_role                                              | 0            \n            |\n| Com_rollback                                                 | 0            \n            |\n| Com_rollback_to_savepoint                                    | 0            \n            |\n| Com_savepoint                                                | 0            \n            |\n| Com_select                                                   | 1            \n            |\n| Com_set_option                                               | 0            \n            |\n| Com_show_authors                                             | 0            \n            |\n| Com_show_binlog_events                                       | 0            \n            |\n| Com_show_binlogs                                             | 0            \n            |\n| Com_show_charsets                                            | 0            \n            |\n| Com_show_collations                                          | 0            \n            |\n| Com_show_contributors                                        | 0            \n            |\n| Com_show_create_db                                           | 0            \n            |\n| Com_show_create_event                                        | 0            \n            |\n| Com_show_create_func                                         | 0            \n            |\n| Com_show_create_proc                                         | 0            \n            |\n| Com_show_create_table                                        | 0            \n            |\n| Com_show_create_trigger                                      | 0            \n            |\n| Com_show_databases                                           | 0            \n            |\n| Com_show_engine_logs                                         | 0            \n            |','','https://mariadb.com/kb/en/show-status/');
update help_topic set description = CONCAT(description, '\n| Com_show_engine_mutex                                        | 0            \n            |\n| Com_show_engine_status                                       | 0            \n            |\n| Com_show_errors                                              | 0            \n            |\n| Com_show_events                                              | 0            \n            |\n| Com_show_explain                                             | 0            \n            |\n| Com_show_fields                                              | 0            \n            |\n| Com_show_function_status                                     | 0            \n            |\n| Com_show_generic                                             | 0            \n            |\n| Com_show_grants                                              | 0            \n            |\n| Com_show_keys                                                | 0            \n            |\n| Com_show_master_status                                       | 0            \n            |\n| Com_show_open_tables                                         | 0            \n            |\n| Com_show_plugins                                             | 0            \n            |\n| Com_show_privileges                                          | 0            \n            |\n| Com_show_procedure_status                                    | 0            \n            |\n| Com_show_processlist                                         | 0            \n            |\n| Com_show_profile                                             | 0            \n            |\n| Com_show_profiles                                            | 0            \n            |\n| Com_show_relaylog_events                                     | 0            \n            |\n| Com_show_slave_hosts                                         | 0            \n            |\n| Com_show_slave_status                                        | 0            \n            |\n| Com_show_status                                              | 2            \n            |\n| Com_show_storage_engines                                     | 0            \n            |\n| Com_show_table_status                                        | 0            \n            |\n| Com_show_tables                                              | 0            \n            |\n| Com_show_triggers                                            | 0            \n            |\n| Com_show_variables                                           | 0            \n            |\n| Com_show_warnings                                            | 0            \n            |\n| Com_shutdown                                                 | 0            \n            |\n| Com_signal                                                   | 0            \n            |\n| Com_start_all_slaves                                         | 0            \n            |\n| Com_start_slave                                              | 0            \n            |\n| Com_stmt_close                                               | 0            \n            |\n| Com_stmt_execute                                             | 0            \n            |\n| Com_stmt_fetch                                               | 0            \n            |\n| Com_stmt_prepare                                             | 0            \n            |\n| Com_stmt_reprepare                                           | 0            \n            |\n| Com_stmt_reset                                               | 0            \n            |\n| Com_stmt_send_long_data                                      | 0            \n            |\n| Com_stop_all_slaves                                          | 0            \n            |\n| Com_stop_slave                                               | 0            \n            |\n| Com_truncate                                                 | 0            \n            |\n| Com_uninstall_plugin                                         | 0            \n            |\n| Com_unlock_tables                                            | 0            \n            |\n| Com_update                                                   | 0            \n            |\n| Com_update_multi                                             | 0            \n            |\n| Com_xa_commit                                                | 0            \n            |\n| Com_xa_end                                                   | 0            \n            |\n| Com_xa_prepare                                               | 0            \n            |\n| Com_xa_recover                                               | 0            \n            |\n| Com_xa_rollback                                              | 0            \n            |\n| Com_xa_start                                                 | 0            \n            |\n| Compression                                                  | OFF          \n            |\n| Connection_errors_accept                                     | 0            \n            |\n| Connection_errors_internal                                   | 0            \n            |\n| Connection_errors_max_connections                            | 0            \n            |\n| Connection_errors_peer_address                               | 0            \n            |\n| Connection_errors_select                                     | 0            \n            |\n| Connection_errors_tcpwrap                                    | 0            \n            |\n| Connections                                                  | 4            \n            |\n| Cpu_time                                                     | 0.000000     \n            |\n| Created_tmp_disk_tables                                      | 0            \n            |\n| Created_tmp_files                                            | 6            \n            |\n| Created_tmp_tables                                           | 2            \n            |\n| Delayed_errors                                               | 0            \n            |\n| Delayed_insert_threads                                       | 0            \n            |\n| Delayed_writes                                               | 0            \n            |\n| Delete_scan                                                  | 0            \n            |\n| Empty_queries                                                | 0            \n            |\n| Executed_events                                              | 0            \n            |\n| Executed_triggers                                            | 0            \n            |\n| Feature_delay_key_write                                      | 0            \n            |\n| Feature_dynamic_columns                                      | 0            \n            |\n| Feature_fulltext                                             | 0            \n            |\n| Feature_gis                                                  | 0            \n            |\n| Feature_locale                                               | 0            \n            |\n| Feature_subquery                                             | 0            \n            |\n| Feature_timezone                                             | 0            \n            |\n| Feature_trigger                                              | 0            \n            |\n| Feature_xml                                                  | 0            \n            |\n| Flush_commands                                               | 1            \n            |\n| Handler_commit                                               | 1            \n            |\n| Handler_delete                                               | 0            \n            |\n| Handler_discover                                             | 0            \n            |\n| Handler_external_lock                                        | 0            \n            |\n| Handler_icp_attempts                                         | 0            \n            |\n| Handler_icp_match                                            | 0            \n            |\n| Handler_mrr_init                                             | 0            \n            |\n| Handler_mrr_key_refills                                      | 0            \n            |\n| Handler_mrr_rowid_refills                                    | 0            \n            |\n| Handler_prepare                                              | 0            \n            |\n| Handler_read_first                                           | 3            \n            |\n| Handler_read_key                                             | 0            \n            |\n| Handler_read_last                                            | 0            \n            |\n| Handler_read_next                                            | 0            \n            |\n| Handler_read_prev                                            | 0            \n            |\n| Handler_read_retry                                           | 0            \n            |\n| Handler_read_rnd                                             | 0            \n            |\n| Handler_read_rnd_deleted                                     | 0            \n            |\n| Handler_read_rnd_next                                        | 537          \n            |\n| Handler_rollback                                             | 0            \n            |\n| Handler_savepoint                                            | 0            \n            |\n| Handler_savepoint_rollback                                   | 0            \n            |\n| Handler_tmp_update                                           | 0            \n            |\n| Handler_tmp_write                                            | 516          \n            |\n| Handler_update                                               | 0            \n            |\n| Handler_write                                                | 0            \n            |\n| Innodb_available_undo_logs                                   | 128          \n            |\n| Innodb_background_log_sync                                   | 222          \n            |\n| Innodb_buffer_pool_bytes_data                                | 2523136      \n            |\n| Innodb_buffer_pool_bytes_dirty                               | 0            \n            |\n| Innodb_buffer_pool_dump_status                               | Dumping\nbuffer pool(s) not yet started |\n| Innodb_buffer_pool_load_status                               | Loading\nbuffer pool(s) not yet started |\n| Innodb_buffer_pool_pages_data                                | 154          \n            |\n| Innodb_buffer_pool_pages_dirty                               | 0            \n            |\n| Innodb_buffer_pool_pages_flushed                             | 1            \n            |\n| Innodb_buffer_pool_pages_free                                | 8037         \n            |\n| Innodb_buffer_pool_pages_lru_flushed                         | 0            \n            |\n| Innodb_buffer_pool_pages_made_not_young                      | 0            \n            |\n| Innodb_buffer_pool_pages_made_young                          | 0            \n            |\n| Innodb_buffer_pool_pages_misc                                | 0            \n            |\n| Innodb_buffer_pool_pages_old                                 | 0            \n            |\n| Innodb_buffer_pool_pages_total                               | 8191         \n            |\n| Innodb_buffer_pool_read_ahead                                | 0            \n            |\n| Innodb_buffer_pool_read_ahead_evicted                        | 0            \n            |\n| Innodb_buffer_pool_read_ahead_rnd                            | 0            \n            |\n| Innodb_buffer_pool_read_requests                             | 558          \n            |\n| Innodb_buffer_pool_reads                                     | 155          \n            |\n| Innodb_buffer_pool_wait_free                                 | 0            \n            |\n| Innodb_buffer_pool_write_requests                            | 1            \n            |\n| Innodb_checkpoint_age                                        | 0            \n            |\n| Innodb_checkpoint_max_age                                    | 80826164     \n            |\n| Innodb_data_fsyncs                                           | 5            \n            |\n| Innodb_data_pending_fsyncs                                   | 0            \n            |\n| Innodb_data_pending_reads                                    | 0            \n            |\n| Innodb_data_pending_writes                                   | 0            \n            |\n| Innodb_data_read                                             | 2609664      \n            |\n| Innodb_data_reads                                            | 172          \n            |\n| Innodb_data_writes                                           | 5            \n            |\n| Innodb_data_written                                          | 34304        \n            |\n| Innodb_dblwr_pages_written                                   | 1            \n            |\n| Innodb_dblwr_writes                                          | 1            \n            |\n| Innodb_deadlocks                                             | 0            \n            |\n| Innodb_have_atomic_builtins                                  | ON           \n            |\n| Innodb_history_list_length                                   | 0            \n            |\n| Innodb_ibuf_discarded_delete_marks                           | 0            \n            |\n| Innodb_ibuf_discarded_deletes                                | 0            \n            |\n| Innodb_ibuf_discarded_inserts                                | 0            \n            |\n| Innodb_ibuf_free_list                                        | 0            \n            |\n| Innodb_ibuf_merged_delete_marks                              | 0            \n            |\n| Innodb_ibuf_merged_deletes                                   | 0            \n            |\n| Innodb_ibuf_merged_inserts                                   | 0            \n            |\n| Innodb_ibuf_merges                                           | 0            \n            |') WHERE help_topic_id = 391;
update help_topic set description = CONCAT(description, '\n| Innodb_ibuf_segment_size                                     | 2            \n            |\n| Innodb_ibuf_size                                             | 1            \n            |\n| Innodb_log_waits                                             | 0            \n            |\n| Innodb_log_write_requests                                    | 0            \n            |\n| Innodb_log_writes                                            | 1            \n            |\n| Innodb_lsn_current                                           | 1616829      \n            |\n| Innodb_lsn_flushed                                           | 1616829      \n            |\n| Innodb_lsn_last_checkpoint                                   | 1616829      \n            |\n| Innodb_master_thread_active_loops                            | 0            \n            |\n| Innodb_master_thread_idle_loops                              | 222          \n            |\n| Innodb_max_trx_id                                            | 2308         \n            |\n| Innodb_mem_adaptive_hash                                     | 2217568      \n            |\n| Innodb_mem_dictionary                                        | 630703       \n            |\n| Innodb_mem_total                                             | 140771328    \n            |\n| Innodb_mutex_os_waits                                        | 1            \n            |\n| Innodb_mutex_spin_rounds                                     | 30           \n            |\n| Innodb_mutex_spin_waits                                      | 1            \n            |\n| Innodb_oldest_view_low_limit_trx_id                          | 0            \n            |\n| Innodb_os_log_fsyncs                                         | 3            \n            |\n| Innodb_os_log_pending_fsyncs                                 | 0            \n            |\n| Innodb_os_log_pending_writes                                 | 0            \n            |\n| Innodb_os_log_written                                        | 512          \n            |\n| Innodb_page_size                                             | 16384        \n            |\n| Innodb_pages_created                                         | 0            \n            |\n| Innodb_pages_read                                            | 154          \n            |\n| Innodb_pages_written                                         | 1            \n            |\n| Innodb_purge_trx_id                                          | 0            \n            |\n| Innodb_purge_undo_no                                         | 0            \n            |\n| Innodb_read_views_memory                                     | 88           \n            |\n| Innodb_row_lock_current_waits                                | 0            \n            |\n| Innodb_row_lock_time                                         | 0            \n            |\n| Innodb_row_lock_time_avg                                     | 0            \n            |\n| Innodb_row_lock_time_max                                     | 0            \n            |\n| Innodb_row_lock_waits                                        | 0            \n            |\n| Innodb_rows_deleted                                          | 0            \n            |\n| Innodb_rows_inserted                                         | 0            \n            |\n| Innodb_rows_read                                             | 0            \n            |\n| Innodb_rows_updated                                          | 0            \n            |\n| Innodb_system_rows_deleted                                   | 0            \n            |\n| Innodb_system_rows_inserted                                  | 0            \n            |\n| Innodb_system_rows_read                                      | 0            \n            |\n| Innodb_system_rows_updated                                   | 0            \n            |\n| Innodb_s_lock_os_waits                                       | 2            \n            |\n| Innodb_s_lock_spin_rounds                                    | 60           \n            |\n| Innodb_s_lock_spin_waits                                     | 2            \n            |\n| Innodb_truncated_status_writes                               | 0            \n            |\n| Innodb_x_lock_os_waits                                       | 0            \n            |\n| Innodb_x_lock_spin_rounds                                    | 0            \n            |\n| Innodb_x_lock_spin_waits                                     | 0            \n            |\n| Innodb_page_compression_saved                                | 0            \n            |\n| Innodb_page_compression_trim_sect512                         | 0            \n            |\n| Innodb_page_compression_trim_sect1024                        | 0            \n            |\n| Innodb_page_compression_trim_sect2048                        | 0            \n            |\n| Innodb_page_compression_trim_sect4096                        | 0            \n            |\n| Innodb_page_compression_trim_sect8192                        | 0            \n            |\n| Innodb_page_compression_trim_sect16384                       | 0            \n            |\n| Innodb_page_compression_trim_sect32768                       | 0            \n            |\n| Innodb_num_index_pages_written                               | 0            \n            |\n| Innodb_num_non_index_pages_written                           | 5            \n            |\n| Innodb_num_pages_page_compressed                             | 0            \n            |\n| Innodb_num_page_compressed_trim_op                           | 0            \n            |\n| Innodb_num_page_compressed_trim_op_saved                     | 0            \n            |\n| Innodb_num_pages_page_decompressed                           | 0            \n            |\n| Innodb_num_pages_page_compression_error                      | 0            \n            |\n| Innodb_num_pages_encrypted                                   | 0            \n            |\n| Innodb_num_pages_decrypted                                   | 0            \n            |\n| Innodb_have_lz4                                              | OFF          \n            |\n| Innodb_have_lzo                                              | OFF          \n            |\n| Innodb_have_lzma                                             | OFF          \n            |\n| Innodb_have_bzip2                                            | OFF          \n            |\n| Innodb_have_snappy                                           | OFF          \n            |\n| Innodb_defragment_compression_failures                       | 0            \n            |\n| Innodb_defragment_failures                                   | 0            \n            |\n| Innodb_defragment_count                                      | 0            \n            |\n| Innodb_onlineddl_rowlog_rows                                 | 0            \n            |\n| Innodb_onlineddl_rowlog_pct_used                             | 0            \n            |\n| Innodb_onlineddl_pct_progress                                | 0            \n            |\n| Innodb_secondary_index_triggered_cluster_reads               | 0            \n            |\n| Innodb_secondary_index_triggered_cluster_reads_avoided       | 0            \n            |\n| Innodb_encryption_rotation_pages_read_from_cache             | 0            \n            |\n| Innodb_encryption_rotation_pages_read_from_disk              | 0            \n            |\n| Innodb_encryption_rotation_pages_modified                    | 0            \n            |\n| Innodb_encryption_rotation_pages_flushed                     | 0            \n            |\n| Innodb_encryption_rotation_estimated_iops                    | 0            \n            |\n| Innodb_scrub_background_page_reorganizations                 | 0            \n            |\n| Innodb_scrub_background_page_splits                          | 0            \n            |\n| Innodb_scrub_background_page_split_failures_underflow        | 0            \n            |\n| Innodb_scrub_background_page_split_failures_out_of_filespace | 0            \n            |\n| Innodb_scrub_background_page_split_failures_missing_index    | 0            \n            |\n| Innodb_scrub_background_page_split_failures_unknown          | 0            \n            |\n| Key_blocks_not_flushed                                       | 0            \n            |\n| Key_blocks_unused                                            | 107163       \n            |\n| Key_blocks_used                                              | 0            \n            |\n| Key_blocks_warm                                              | 0            \n            |\n| Key_read_requests                                            | 0            \n            |\n| Key_reads                                                    | 0            \n            |\n| Key_write_requests                                           | 0            \n            |\n| Key_writes                                                   | 0            \n            |\n| Last_query_cost                                              | 0.000000     \n            |\n| Master_gtid_wait_count                                       | 0            \n            |\n| Master_gtid_wait_time                                        | 0            \n            |\n| Master_gtid_wait_timeouts                                    | 0            \n            |\n| Max_statement_time_exceeded                                  | 0            \n            |\n| Max_used_connections                                         | 1            \n            |\n| Memory_used                                                  | 273614696    \n            |\n| Not_flushed_delayed_rows                                     | 0            \n            |\n| Open_files                                                   | 25           \n            |\n| Open_streams                                                 | 0            \n            |\n| Open_table_definitions                                       | 18           \n            |\n| Open_tables                                                  | 11           \n            |\n| Opened_files                                                 | 77           \n            |\n| Opened_plugin_libraries                                      | 0            \n            |\n| Opened_table_definitions                                     | 18           \n            |\n| Opened_tables                                                | 18           \n            |\n| Opened_views                                                 | 0            \n            |\n| Performance_schema_accounts_lost                             | 0            \n            |\n| Performance_schema_cond_classes_lost                         | 0            \n            |\n| Performance_schema_cond_instances_lost                       | 0            \n            |\n| Performance_schema_digest_lost                               | 0            \n            |\n| Performance_schema_file_classes_lost                         | 0            \n            |\n| Performance_schema_file_handles_lost                         | 0            \n            |\n| Performance_schema_file_instances_lost                       | 0            \n            |\n| Performance_schema_hosts_lost                                | 0            \n            |\n| Performance_schema_locker_lost                               | 0            \n            |\n| Performance_schema_mutex_classes_lost                        | 0            \n            |\n| Performance_schema_mutex_instances_lost                      | 0            \n            |\n| Performance_schema_rwlock_classes_lost                       | 0            \n            |\n| Performance_schema_rwlock_instances_lost                     | 0            \n            |\n| Performance_schema_session_connect_attrs_lost                | 0            \n            |\n| Performance_schema_socket_classes_lost                       | 0            \n            |\n| Performance_schema_socket_instances_lost                     | 0            \n            |\n| Performance_schema_stage_classes_lost                        | 0            \n            |\n| Performance_schema_statement_classes_lost                    | 0            \n            |\n| Performance_schema_table_handles_lost                        | 0            \n            |\n| Performance_schema_table_instances_lost                      | 0            \n            |\n| Performance_schema_thread_classes_lost                       | 0            \n            |\n| Performance_schema_thread_instances_lost                     | 0            \n            |\n| Performance_schema_users_lost                                | 0            \n            |\n| Prepared_stmt_count                                          | 0            \n            |\n| Qcache_free_blocks                                           | 1            \n            |\n| Qcache_free_memory                                           | 1031336      \n            |\n| Qcache_hits                                                  | 0            \n            |\n| Qcache_inserts                                               | 0            \n            |\n| Qcache_lowmem_prunes                                         | 0            \n            |\n| Qcache_not_cached                                            | 0            \n            |\n| Qcache_queries_in_cache                                      | 0            \n            |\n| Qcache_total_blocks                                          | 1            \n            |\n| Queries                                                      | 4            \n            |\n| Questions                                                    | 4            \n            |\n| Rows_read                                                    | 10           \n            |\n| Rows_sent                                                    | 517          \n            |\n| Rows_tmp_read                                                | 516          \n            |\n| Rpl_status                                                   | AUTH_MASTER  \n            |') WHERE help_topic_id = 391;
update help_topic set description = CONCAT(description, '\n| Select_full_join                                             | 0            \n            |\n| Select_full_range_join                                       | 0            \n            |\n| Select_range                                                 | 0            \n            |\n| Select_range_check                                           | 0            \n            |\n| Select_scan                                                  | 2            \n            |\n| Slave_connections                                            | 0            \n            |\n| Slave_heartbeat_period                                       | 0.000        \n            |\n| Slave_open_temp_tables                                       | 0            \n            |\n| Slave_received_heartbeats                                    | 0            \n            |\n| Slave_retried_transactions                                   | 0            \n            |\n| Slave_running                                                | OFF          \n            |\n| Slave_skipped_errors                                         | 0            \n            |\n| Slaves_connected                                             | 0            \n            |\n| Slaves_running                                               | 0            \n            |\n| Slow_launch_threads                                          | 0            \n            |\n| Slow_queries                                                 | 0            \n            |\n| Sort_merge_passes                                            | 0            \n            |\n| Sort_priority_queue_sorts                                    | 0            \n            |\n| Sort_range                                                   | 0            \n            |\n| Sort_rows                                                    | 0            \n            |\n| Sort_scan                                                    | 0            \n            |\n| Ssl_accept_renegotiates                                      | 0            \n            |\n| Ssl_accepts                                                  | 0            \n            |\n| Ssl_callback_cache_hits                                      | 0            \n            |\n| Ssl_cipher                                                   |              \n            |\n| Ssl_cipher_list                                              |              \n            |\n| Ssl_client_connects                                          | 0            \n            |\n| Ssl_connect_renegotiates                                     | 0            \n            |\n| Ssl_ctx_verify_depth                                         | 0            \n            |\n| Ssl_ctx_verify_mode                                          | 0            \n            |\n| Ssl_default_timeout                                          | 0            \n            |\n| Ssl_finished_accepts                                         | 0            \n            |\n| Ssl_finished_connects                                        | 0            \n            |\n| Ssl_server_not_after                                         |              \n            |\n| Ssl_server_not_before                                        |              \n            |\n| Ssl_session_cache_hits                                       | 0            \n            |\n| Ssl_session_cache_misses                                     | 0            \n            |\n| Ssl_session_cache_mode                                       | NONE         \n            |\n| Ssl_session_cache_overflows                                  | 0            \n            |\n| Ssl_session_cache_size                                       | 0            \n            |\n| Ssl_session_cache_timeouts                                   | 0            \n            |\n| Ssl_sessions_reused                                          | 0            \n            |\n| Ssl_used_session_cache_entries                               | 0            \n            |\n| Ssl_verify_depth                                             | 0            \n            |\n| Ssl_verify_mode                                              | 0            \n            |\n| Ssl_version                                                  |              \n            |\n| Subquery_cache_hit                                           | 0            \n            |\n| Subquery_cache_miss                                          | 0            \n            |\n| Syncs                                                        | 2            \n            |\n| Table_locks_immediate                                        | 21           \n            |\n| Table_locks_waited                                           | 0            \n            |\n| Tc_log_max_pages_used                                        | 0            \n            |\n| Tc_log_page_size                                             | 4096         \n            |\n| Tc_log_page_waits                                            | 0            \n            |\n| Threadpool_idle_threads                                      | 0            \n            |\n| Threadpool_threads                                           | 0            \n            |\n| Threads_cached                                               | 0            \n            |\n| Threads_connected                                            | 1            \n            |\n| Threads_created                                              | 2            \n            |\n| Threads_running                                              | 1            \n            |\n| Update_scan                                                  | 0            \n            |\n| Uptime                                                       | 223          \n            |\n| Uptime_since_flush_status                                    | 223          \n            |\n| wsrep_cluster_conf_id                                        |\n18446744073709551615                   |\n| wsrep_cluster_size                                           | 0            \n            |\n| wsrep_cluster_state_uuid                                     |              \n            |\n| wsrep_cluster_status                                         | Disconnected \n            |\n| wsrep_connected                                              | OFF          \n            |\n| wsrep_local_bf_aborts                                        | 0            \n            |\n| wsrep_local_index                                            |\n18446744073709551615                   |\n| wsrep_provider_name                                          |              \n            |\n| wsrep_provider_vendor                                        |              \n            |\n| wsrep_provider_version                                       |              \n            |\n| wsrep_ready                                                  | OFF          \n            |\n| wsrep_thread_count                                           | 0            \n            |\n+--------------------------------------------------------------+---------------\n------------------------+\n516 rows in set (0.00 sec)\n\nExample of filtered output:\n\nSHOW STATUS LIKE \'Key%\';\n+------------------------+--------+\n| Variable_name          | Value  |\n+------------------------+--------+\n| Key_blocks_not_flushed | 0      |\n| Key_blocks_unused      | 107163 |\n| Key_blocks_used        | 0      |\n| Key_blocks_warm        | 0      |\n| Key_read_requests      | 0      |\n| Key_reads              | 0      |\n| Key_write_requests     | 0      |\n| Key_writes             | 0      |\n+------------------------+--------+\n8 rows in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/show-status/') WHERE help_topic_id = 391;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (392,26,'SHOW TABLE STATUS','Syntax\n------\n\nSHOW TABLE STATUS [{FROM | IN} db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLE STATUS works like SHOW TABLES, but provides more extensive\ninformation about each non-TEMPORARY table.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n+---------------------------+------------------------------------------------+\n| Column                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| Name                      | Table name.                                    |\n+---------------------------+------------------------------------------------+\n| Engine                    | Table storage engine.                          |\n+---------------------------+------------------------------------------------+\n| Version                   | Version number from the table\'s .frm file.     |\n+---------------------------+------------------------------------------------+\n| Row_format                | Row format (see InnoDB, Aria and MyISAM row    |\n|                           | formats).                                      |\n+---------------------------+------------------------------------------------+\n| Rows                      | Number of rows in the table. Some engines,     |\n|                           | such as XtraDB and InnoDB may store an         |\n|                           | estimate.                                      |\n+---------------------------+------------------------------------------------+\n| Avg_row_length            | Average row length in the table.               |\n+---------------------------+------------------------------------------------+\n| Data_length               | For InnoDB/XtraDB, the index size, in pages,   |\n|                           | multiplied by the page size. For Aria and      |\n|                           | MyISAM, length of the data file, in bytes.     |\n|                           | For MEMORY, the approximate allocated memory.  |\n+---------------------------+------------------------------------------------+\n| Max_data_length           | Maximum length of the data file, ie the total  |\n|                           | number of bytes that could be stored in the    |\n|                           | table. Not used in XtraDB and InnoDB.          |\n+---------------------------+------------------------------------------------+\n| Index_length              | Length of the index file.                      |\n+---------------------------+------------------------------------------------+\n| Data_free                 | Bytes allocated but unused. For InnoDB tables  |\n|                           | in a shared tablespace, the free space of the  |\n|                           | shared tablespace with small safety margin.    |\n|                           | An estimate in the case of partitioned tables  |\n|                           | - see the PARTITIONS table.                    |\n+---------------------------+------------------------------------------------+\n| Auto_increment            | Next AUTO_INCREMENT value.                     |\n+---------------------------+------------------------------------------------+\n| Create_time               | Time the table was created. Some engines just  |\n|                           | return the ctime information from the file     |\n|                           | system layer here, in that case the value is   |\n|                           | not necessarily the table creation time but    |\n|                           | rather the time the file system metadata for   |\n|                           | it had last changed.                           |\n+---------------------------+------------------------------------------------+\n| Update_time               | Time the table was last updated. On Windows,   |\n|                           | the timestamp is not updated on update, so     |\n|                           | MyISAM values will be inaccurate. In InnoDB,   |\n|                           | if shared tablespaces are used, will be NULL,  |\n|                           | while buffering can also delay the update, so  |\n|                           | the value will differ from the actual time of  |\n|                           | the last UPDATE, INSERT or DELETE.             |\n+---------------------------+------------------------------------------------+\n| Check_time                | Time the table was last checked. Not kept by   |\n|                           | all storage engines, in which case will be     |\n|                           | NULL.                                          |\n+---------------------------+------------------------------------------------+\n| Collation                 | Character set and collation.                   |\n+---------------------------+------------------------------------------------+\n| Checksum                  | Live checksum value, if any.                   |\n+---------------------------+------------------------------------------------+\n| Create_options            | Extra CREATE TABLE options.                    |\n+---------------------------+------------------------------------------------+\n| Comment                   | Table comment provided when MariaDB created    |\n|                           | the table.                                     |\n+---------------------------+------------------------------------------------+\n| Max_index_length          | Maximum index length (supported by MyISAM and  |\n|                           | Aria tables). Added in MariaDB 10.3.5.         |\n+---------------------------+------------------------------------------------+\n| Temporary                 | Placeholder to signal that a table is a        |\n|                           | temporary table. Currently always \"N\", except  |\n|                           | \"Y\" for generated information_schema tables    |\n|                           | and NULL for views. Added in MariaDB 10.3.5.   |\n+---------------------------+------------------------------------------------+\n\nSimilar information can be found in the information_schema.TABLES table as\nwell as by using mysqlshow:\n\nmysqlshow --status db_name\n\nViews\n-----\n\nFor views, all columns in SHOW TABLE STATUS are NULL except \'Name\' and\n\'Comment\'\n\nExample\n-------\n\nshow table status\\G\n*************************** 1. row ***************************\n     Name: bus_routes\n    Engine: InnoDB\n    Version: 10\n  Row_format: Dynamic\n     Rows: 5\n Avg_row_length: 3276\n  Data_length: 16384\nMax_data_length: 0\n Index_length: 0\n   Data_free: 0\n Auto_increment: NULL\n  Create_time: 2017-05-24 11:17:46\n  Update_time: NULL\n  Check_time: NULL\n   Collation: latin1_swedish_ci\n   Checksum: NULL\n Create_options: \n    Comment:\n\nURL: https://mariadb.com/kb/en/show-table-status/','','https://mariadb.com/kb/en/show-table-status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (393,26,'SHOW TABLES','Syntax\n------\n\nSHOW [FULL] TABLES [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLES lists the non-TEMPORARY tables, sequences and views in a given\ndatabase.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW. For example, when searching for\ntables in the test database, the column name for use in the WHERE and LIKE\nclauses will be Tables_in_test\n\nThe FULL modifier is supported such that SHOW FULL TABLES displays a second\noutput column. Values for the second column, Table_type, are BASE TABLE for a\ntable, VIEW for a view and SEQUENCE for a sequence.\n\nYou can also get this information using:\n\nmysqlshow db_name\n\nSee mysqlshow for more details.\n\nIf you have no privileges for a base table or view, it does not show up in the\noutput from SHOW TABLES or mysqlshow db_name.\n\nThe information_schema.TABLES table, as well as the SHOW TABLE STATUS\nstatement, provide extended information about tables.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n| t1                   |\n| view1                |\n+----------------------+\n\nShowing the tables beginning with a only.\n\nSHOW TABLES WHERE Tables_in_test LIKE \'a%\';\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n+----------------------+\n\nShowing tables and table types:\n\nSHOW FULL TABLES;\n+----------------+------------+\n| Tables_in_test | Table_type |\n+----------------+------------+\n| s1             | SEQUENCE   |\n| student        | BASE TABLE |\n| v1             | VIEW       |\n+----------------+------------+\n\nURL: https://mariadb.com/kb/en/show-tables/','','https://mariadb.com/kb/en/show-tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (394,26,'SHOW TABLE_STATISTICS','Syntax\n------\n\nSHOW TABLE_STATISTICS\n\nDescription\n-----------\n\nThe SHOW TABLE_STATISTICS statementis part of the User Statistics feature. It\nwas removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.TABLE_STATISTICS table shows statistics on table usage\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.TABLE_STATISTICS articles for more\ninformation.\n\nExample\n-------\n\nSHOW TABLE_STATISTICS\\G\n*************************** 1. row ***************************\n     Table_schema: mysql\n      Table_name: proxies_priv\n       Rows_read: 2\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 2. row ***************************\n     Table_schema: test\n      Table_name: employees_example\n       Rows_read: 7\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 3. row ***************************\n     Table_schema: mysql\n      Table_name: user\n       Rows_read: 16\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 4. row ***************************\n     Table_schema: mysql\n      Table_name: db\n       Rows_read: 2\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n\nURL: https://mariadb.com/kb/en/show-table-statistics/','','https://mariadb.com/kb/en/show-table-statistics/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (395,26,'SHOW TRIGGERS','Syntax\n------\n\nSHOW TRIGGERS [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a database\n(the default database unless a FROM clause is given). This statement requires\nthe TRIGGER privilege (prior to MySQL 5.1.22, it required the SUPER privilege).\n\nThe LIKE clause, if present on its own, indicates which table names to match\nand causes the statement to display triggers for those tables. The WHERE and\nLIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nSimilar information is stored in the information_schema.TRIGGERS table.\n\nMariaDB starting with 10.2.3\n----------------------------\nIf there are multiple triggers for the same action, then the triggers are\nshown in action order.\n\nExamples\n--------\n\nFor the trigger defined at Trigger Overview:\n\nSHOW triggers Like \'animals\' \\G\n*************************** 1. row ***************************\n      Trigger: the_mooses_are_loose\n       Event: INSERT\n       Table: animals\n     Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n       Timing: AFTER\n      Created: 2016-09-29 13:53:34.35\n      sql_mode:\n      Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nListing all triggers associated with a certain table:\n\nSHOW TRIGGERS FROM test WHERE `Table` = \'user\' \\G\n*************************** 1. row ***************************\n      Trigger: user_ai\n       Event: INSERT\n       Table: user\n     Statement: BEGIN END\n       Timing: AFTER\n      Created:  2016-09-29 13:53:34.35\n      sql_mode:\n      Definer: root@%\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nSHOW triggers WHERE Event Like \'Insert\' \\G\n*************************** 1. row ***************************\n      Trigger: the_mooses_are_loose\n       Event: INSERT\n       Table: animals\n     Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n       Timing: AFTER\n      Created: 2016-09-29 13:53:34.35\n      sql_mode:\n      Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n* character_set_client is the session value of the character_set_client system\nvariable when the trigger was created. \n* collation_connection is the session value of the collation_connection system\nvariable when the trigger was\n created. \n* Database Collation is the collation of the database \n with which the trigger is associated.\n\nThese columns were added in MariaDB/MySQL 5.1.21.\n\nOld triggers created before MySQL 5.7 and MariaDB 10.2.3 has NULL in the\nCreated column.\n\nURL: https://mariadb.com/kb/en/show-triggers/','','https://mariadb.com/kb/en/show-triggers/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (396,26,'SHOW USER_STATISTICS','Syntax\n------\n\nSHOW USER_STATISTICS\n\nDescription\n-----------\n\nThe SHOW USER_STATISTICS statement is part of the User Statistics feature. It\nwas removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.USER_STATISTICS table holds statistics about user activity.\nYou can use this table to find out such things as which user is causing the\nmost load and which users are being abusive. You can also use this table to\nmeasure how close to capacity the server may be.\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.USER_STATISTICS table for more\ninformation.\n\nExample\n-------\n\nSHOW USER_STATISTICS\\G\n*************************** 1. row ***************************\n         User: root\n  Total_connections: 1\nConcurrent_connections: 0\n    Connected_time: 3297\n      Busy_time: 0.14113400000000006\n       Cpu_time: 0.017637000000000003\n    Bytes_received: 969\n      Bytes_sent: 22355\n Binlog_bytes_written: 0\n      Rows_read: 10\n      Rows_sent: 67\n     Rows_deleted: 0\n    Rows_inserted: 0\n     Rows_updated: 0\n   Select_commands: 7\n   Update_commands: 0\n    Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n  Denied_connections: 0\n   Lost_connections: 0\n    Access_denied: 0\n    Empty_queries: 7\n\nURL: https://mariadb.com/kb/en/show-user-statistics/','','https://mariadb.com/kb/en/show-user-statistics/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (397,26,'SHOW VARIABLES','Syntax\n------\n\nSHOW [GLOBAL | SESSION] VARIABLES\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW VARIABLES shows the values of MariaDB system variables. This information\nalso can be obtained using the mysqladmin variables command. The LIKE clause,\nif present, indicates which variable names to match. The WHERE clause can be\ngiven to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are used for\nnew connections to MariaDB. With SESSION, it displays the values that are in\neffect for the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION. With a LIKE clause, the statement\ndisplays only rows for those variables with names that match the pattern. To\nobtain the row for a specific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'maria_group_commit\';\nSHOW SESSION VARIABLES LIKE \'maria_group_commit\';\n\nTo get a list of variables whose name match a pattern, use the \"%\" wildcard\ncharacter in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%maria%\';\nSHOW GLOBAL VARIABLES LIKE \'%maria%\';\n\nWildcard characters can be used in any position within the pattern to be\nmatched. Strictly speaking, because \"_\" is a wildcard that matches any single\ncharacter, you should escape it as \"\\_\" to match it literally. In practice,\nthis is rarely necessary.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nSee SET for information on setting server system variables.\n\nSee Server System Variables for a list of all the variables that can be set.\n\nYou can also see the server variables by querying the Information Schema\nGLOBAL_VARIABLES and SESSION_VARIABLES tables.\n\nExamples\n--------\n\nSHOW VARIABLES LIKE \'aria%\';\n+------------------------------------------+---------------------+\n| Variable_name                            | Value               |\n+------------------------------------------+---------------------+\n| aria_block_size                          | 8192                |\n| aria_checkpoint_interval                 | 30                  |\n| aria_checkpoint_log_activity             | 1048576             |\n| aria_force_start_after_recovery_failures | 0                   |\n| aria_group_commit                        | none                |\n| aria_group_commit_interval               | 0                   |\n| aria_log_file_size                       | 1073741824          |\n| aria_log_purge_type                      | immediate           |\n| aria_max_sort_file_size                  | 9223372036853727232 |\n| aria_page_checksum                       | ON                  |\n| aria_pagecache_age_threshold             | 300                 |\n| aria_pagecache_buffer_size               | 134217728           |\n| aria_pagecache_division_limit            | 100                 |\n| aria_recover                             | NORMAL              |\n| aria_repair_threads                      | 1                   |\n| aria_sort_buffer_size                    | 134217728           |\n| aria_stats_method                        | nulls_unequal       |\n| aria_sync_log_dir                        | NEWFILE             |\n| aria_used_for_temp_tables                | ON                  |\n+------------------------------------------+---------------------+\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 64           |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSET GLOBAL max_error_count=128;\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 128          |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSET GLOBAL max_error_count=128;\n\nSHOW VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name   | Value |\n+-----------------+-------+\n| max_error_count | 64    |\n+-----------------+-------+\n\nSHOW GLOBAL VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name   | Value |\n+-----------------+-------+\n| max_error_count | 128   |\n+-----------------+-------+\n\nBecause the following variable only has a global scope, the global value is\nreturned even when specifying SESSION (in this case by default):\n\nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n+------------------------+-------+\n| Variable_name          | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 30    |\n+------------------------+-------+\n\nURL: https://mariadb.com/kb/en/show-variables/','','https://mariadb.com/kb/en/show-variables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (398,26,'SHOW WARNINGS','Syntax\n------\n\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) WARNINGS\n\nDescription\n-----------\n\nSHOW WARNINGS shows the error, warning, and note messages that resulted from\nthe last statement that generated messages in the current session. It shows\nnothing if the last statement used a table and generated no messages. (That\nis, a statement that uses a table but generates no messages clears the message\nlist.) Statements that do not use tables and do not generate messages have no\neffect on the message list.\n\nA note is different to a warning in that it only appears if the sql_notes\nvariable is set to 1 (the default), and is not converted to an error if strict\nmode is enabled.\n\nA related statement, SHOW ERRORS, shows only the errors.\n\nThe SHOW COUNT(*) WARNINGS statement displays the total number of errors,\nwarnings, and notes. You can also retrieve this number from the warning_count\nvariable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nThe value of warning_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is set so\nlow that not all messages are stored.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nSHOW WARNINGS can be used after EXPLAIN EXTENDED to see how a query is\ninternally rewritten by MariaDB.\n\nIf the sql_notes server variable is set to 1, Notes are included in the output\nof SHOW WARNINGS; if it is set to 0, this statement will not show (or count)\nNotes.\n\nThe results of SHOW WARNINGS and SHOW COUNT(*) WARNINGS are directly sent to\nthe client. If you need to access those information in a stored program, you\ncan use the GET DIAGNOSTICS statement instead.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nThe mysql client also has a number of options related to warnings. The \\W\ncommand will show warnings after every statement, while \\w will disable this.\nStarting the client with the --show-warnings option will show warnings after\nevery statement.\n\nMariaDB 10.3.1 implements a stored routine error stack trace. SHOW WARNINGS\ncan also be used to show more information. See the example below.\n\nExamples\n--------\n\nSELECT 1/0;\n+------+\n| 1/0  |\n+------+\n| NULL |\n+------+\n\nSHOW COUNT(*) WARNINGS;\n+-------------------------+\n| @@session.warning_count |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSHOW WARNINGS;\n+---------+------+---------------+\n| Level   | Code | Message       |\n+---------+------+---------------+\n| Warning | 1365 | Division by 0 |\n+---------+------+---------------+\n\nStack Trace\n-----------\n\nFrom MariaDB 10.3.1, displaying a stack trace:\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\n BEGIN\n  DECLARE c CURSOR FOR SELECT * FROM not_existing;\n  OPEN c;\n  CLOSE c;\n END;\n$$\nCREATE OR REPLACE PROCEDURE p2()\n BEGIN\n  CALL p1;\n END;\n$$\nDELIMITER ;\nCALL p2;\nERROR 1146 (42S02): Table \'test.not_existing\' doesn\'t exist\n\nSHOW WARNINGS;\n+-------+------+-----------------------------------------+\n| Level | Code | Message                                 |\n+-------+------+-----------------------------------------+\n| Error | 1146 | Table \'test.not_existing\' doesn\'t exist |\n| Note  | 4091 | At line 6 in test.p1                    |\n| Note  | 4091 | At line 4 in test.p2                    |\n+-------+------+-----------------------------------------+\n\nSHOW WARNINGS displays a stack trace, showing where the error actually\nhappened:\n\n* Line 4 in test.p1 is the OPEN command which actually raised the error\n* Line 3 in test.p2 is the CALL statement, calling p1 from p2.\n\nURL: https://mariadb.com/kb/en/show-warnings/','','https://mariadb.com/kb/en/show-warnings/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (399,26,'SHOW WSREP_MEMBERSHIP','SHOW WSREP_MEMBERSHIP is part of the WSREP_INFO plugin.\n\nSyntax\n------\n\nSHOW WSREP_MEMBERSHIP\n\nDescription\n-----------\n\nThe SHOW WSREP_MEMBERSHIP statement returns Galera node cluster membership\ninformation. It returns the same information as found in the\ninformation_schema.WSREP_MEMBERSHIP table. Only users with the SUPER privilege\ncan access this information.\n\nExamples\n--------\n\nSHOW WSREP_MEMBERSHIP;\n+-------+--------------------------------------+----------+-----------------+\n| Index | Uuid                                 | Name     | Address         |\n+-------+--------------------------------------+----------+-----------------+\n|     0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 |\n|     1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 |\n|     2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 |\n+-------+--------------------------------------+----------+-----------------+\n\nURL: https://mariadb.com/kb/en/show-wsrep_membership/','','https://mariadb.com/kb/en/show-wsrep_membership/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (400,26,'SHOW WSREP_STATUS','SHOW WSREP_STATUS is part of the WSREP_INFO plugin.\n\nSyntax\n------\n\nSHOW WSREP_STATUS\n\nDescription\n-----------\n\nThe SHOW WSREP_STATUS statement returns Galera node and cluster status\ninformation. It returns the same information as found in the\ninformation_schema.WSREP_STATUS table. Only users with the SUPER privilege can\naccess this information.\n\nExamples\n--------\n\nSHOW WSREP_STATUS;\n+------------+-------------+----------------+--------------+\n| Node_Index | Node_Status | Cluster_Status | Cluster_Size |\n+------------+-------------+----------------+--------------+\n|          0 | Synced      | Primary        |            3 |\n+------------+-------------+----------------+--------------+\n\nURL: https://mariadb.com/kb/en/show-wsrep_status/','','https://mariadb.com/kb/en/show-wsrep_status/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (401,26,'BINLOG','Syntax\n------\n\nBINLOG \'str\'\n\nDescription\n-----------\n\nBINLOG is an internal-use statement. It is generated by the\nmariadb-binlog/mysqlbinlog program as the printable representation of certain\nevents in binary log files. The \'str\' value is a base 64-encoded string the\nthat server decodes to determine the data change indicated by the\ncorresponding event. This statement requires the SUPER privilege (<= MariaDB\n10.5.1) or theBINLOG REPLAY privilege (>= MariaDB 10.5.2).\n\nURL: https://mariadb.com/kb/en/binlog/','','https://mariadb.com/kb/en/binlog/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (402,26,'PURGE BINARY LOGS','Syntax\n------\n\nPURGE { BINARY | MASTER } LOGS\n  { TO \'log_name\' | BEFORE datetime_expr }\n\nDescription\n-----------\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed in the\nlog index file prior to the specified log file name or date. BINARY and MASTER\nare synonyms. Deleted log files also are removed from the list recorded in the\nindex file, so that the given log file becomes the first in the list.\n\nThe datetime expression is in the format \'YYYY-MM-DD hh:mm:ss\'.\n\nIf a replica is active but has yet to read from a binary log file you attempt\nto delete, the statement will fail with an error. However, if the replica is\nnot connected and has yet to read from a log file you delete, the file will be\ndeleted, but the replica will be unable to continue replicating once it\nconnects again.\n\nThis statement has no effect if the server was not started with the --log-bin\noption to enable binary logging.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which\nfiles they are reading, use SHOW SLAVE STATUS (or SHOW REPLICA STATUS from\nMariaDB 10.5.1). You can only delete the files that are older than the oldest\nfile that is used by the slaves.\n\nTo delete all binary log files, use RESET MASTER. To move to a new log file\n(for example if you want to remove the current log file), use FLUSH LOGS\nbefore you execute PURGE LOGS.\n\nIf the expire_logs_days server system variable is not set to 0, the server\nautomatically deletes binary log files after the given number of days. From\nMariaDB 10.6, the binlog_expire_logs_seconds variable allows more precise\ncontrol over binlog deletion, and takes precedence if both are non-zero.\n\nRequires the SUPER privilege or, from MariaDB 10.5.2, the BINLOG ADMIN\nprivilege, to run.\n\nExamples\n--------\n\nPURGE BINARY LOGS TO \'mariadb-bin.000063\';\n\nPURGE BINARY LOGS BEFORE \'2013-04-21\';\n\nPURGE BINARY LOGS BEFORE \'2013-04-22 09:55:22\';\n\nURL: https://mariadb.com/kb/en/purge-binary-logs/','','https://mariadb.com/kb/en/purge-binary-logs/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (403,26,'CACHE INDEX','Syntax\n------\n\nCACHE INDEX                      \n tbl_index_list [, tbl_index_list] ...\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\nDescription\n-----------\n\nThe CACHE INDEX statement assigns table indexes to a specific key cache. It is\nused only for MyISAM tables.\n\nA default key cache exists and cannot be destroyed. To create more key caches,\nthe key_buffer_size server system variable.\n\nThe associations between tables indexes and key caches are lost on server\nrestart. To recreate them automatically, it is necessary to configure caches\nin a configuration file and include some CACHE INDEX (and optionally LOAD\nINDEX) statements in the init file.\n\nExamples\n--------\n\nThe following statement assigns indexes from the tables t1, t2, and t3 to the\nkey cache named hot_cache:\n\nCACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table   | Op                 | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status   | OK       |\n| test.t2 | assign_to_keycache | status   | OK       |\n| test.t3 | assign_to_keycache | status   | OK       |\n+---------+--------------------+----------+----------+\n\nImplementation (for MyISAM)\n---------------------------\n\nNormally CACHE INDEX should not take a long time to execute. Internally it\'s\nimplemented the following way:\n\n* Find the right key cache (under LOCK_global_system_variables)\n* Open the table with a TL_READ_NO_INSERT lock.\n* Flush the original key cache for the given file (under key cache lock)\n* Flush the new key cache for the given file (safety)\n* Move the file to the new key cache (under file share lock)\n\nThe only possible long operations are getting the locks for the table and\nflushing the original key cache, if there were many key blocks for the file in\nit.\n\nWe plan to also add CACHE INDEX for Aria tables if there is a need for this.\n\nURL: https://mariadb.com/kb/en/cache-index/','','https://mariadb.com/kb/en/cache-index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (404,26,'HELP Command','Syntax\n------\n\nHELP search_string\n\nDescription\n-----------\n\nThe HELP command can be used in any MariaDB client, such as the mysql\ncommand-line client, to get basic syntax help and a short description for most\ncommands and functions.\n\nIf you provide an argument to the HELP command, the mysql client uses it as a\nsearch string to access server-side help. The proper operation of this command\nrequires that the help tables in the mysql database be initialized with help\ntopic information.\n\nIf there is no match for the search string, the search fails. Use HELP\ncontents to see a list of the help categories:\n\nHELP contents\nYou asked for help about help category: \"Contents\"\nFor more information, type \'help <item>\', where <item> is one of the following\ncategories:\n Account Management\n Administration\n Compound Statements\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Help Metadata\n Language Structure\n Plugins\n Procedures\n Sequences\n Table Maintenance\n Transactions\n User-Defined Functions\n Utility\n\nIf a search string matches multiple items, MariaDB shows a list of matching\ntopics:\n\nHELP drop\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following\ntopics:\n ALTER TABLE\n DROP DATABASE\n DROP EVENT\n DROP FUNCTION\n DROP FUNCTION UDF\n DROP INDEX\n DROP PACKAGE\n DROP PACKAGE BODY\n DROP PROCEDURE\n DROP ROLE\n DROP SEQUENCE\n DROP SERVER\n DROP TABLE\n DROP TRIGGER\n DROP USER\n DROP VIEW\n\nThen you can enter a topic as the search string to see the help entry for that\ntopic.\n\nThe help is provided with the MariaDB server and makes use of four help tables\nfound in the mysql database: help_relation, help_topic, help_category and\nhelp_keyword. These tables are populated by the mysql_install_db or\nfill_help_table.sql scripts which, until MariaDB 10.4.7, contain data\ngenerated from an old version of MySQL.\n\nURL: https://mariadb.com/kb/en/help-command/','','https://mariadb.com/kb/en/help-command/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (405,26,'KILL [CONNECTION | QUERY]','Syntax\n------\n\nKILL [HARD | SOFT] { {CONNECTION|QUERY} thread_id | QUERY ID query_id | USER\nuser_name }\n\nDescription\n-----------\n\nEach connection to mysqld runs in a separate thread. You can see which threads\nare running with the SHOW PROCESSLIST statement and kill a thread with the\nKILL thread_id statement. KILL allows the optional CONNECTION or QUERY\nmodifier:\n\n* KILL CONNECTION is the same as KILL with no\n modifier: It terminates the connection associated with the given thread or\nquery id.\n* KILL QUERY terminates the statement that the connection thread_id is\n currently executing, but leaves the connection itself intact.\n* KILL QUERY ID terminates the query by query_id, leaving the connection\nintact.\n\nIf a connection is terminated that has an active transaction, the transaction\nwill be rolled back. If only a query is killed, the current transaction will\nstay active. See also idle_transaction_timeout.\n\nIf you have the PROCESS privilege, you can see all threads. If you have the\nSUPER privilege, or, from MariaDB 10.5.2, the CONNECTION ADMIN privilege, you\ncan kill all threads and statements. Otherwise, you can see and kill only your\nown threads and statements.\n\nKilling queries that repair or create indexes on MyISAM and Aria tables may\nresult in corrupted tables. Use the SOFT option to avoid this!\n\nThe HARD option (default) kills a command as soon as possible. If you use\nSOFT, then critical operations that may leave a table in an inconsistent state\nwill not be interrupted. Such operations include REPAIR and INDEX creation for\nMyISAM and Aria tables (REPAIR TABLE, OPTIMIZE TABLE).\n\nKILL ... USER username will kill all connections/queries for a given user.\nUSER can be specified one of the following ways:\n\n* username  (Kill without regard to hostname)\n* username@hostname\n* CURRENT_USER or CURRENT_USER()\n\nIf you specify a thread id and that thread does not exist, you get the\nfollowing error:\n\nERROR 1094 (HY000): Unknown thread id: <thread_id>\n\nIf you specify a query id that doesn\'t exist, you get the following error:\n\nERROR 1957 (HY000): Unknown query id: <query_id>\n\nHowever, if you specify a user name, no error is issued for non-connected (or\neven non-existing) users. To check if the connection/query has been killed,\nyou can use the ROW_COUNT() function.\n\nA client whose connection is killed receives the following error:\n\nERROR 1317 (70100): Query execution was interrupted\n\nTo obtain a list of existing sessions, use the SHOW PROCESSLIST statement or\nquery the Information Schema PROCESSLIST table.\n\nNote: You cannot use KILL with the Embedded MySQL Server library because the\nembedded server merely runs inside the threads of the host application. It\ndoes not create any connection threads of its own.\n\nNote: You can also use mysqladmin kill thread_id [,thread_id...] to kill\nconnections. To get a list of running queries, use mysqladmin processlist. See\nmysqladmin.\n\nPercona Toolkit contains a program, pt-kill that can be used to automatically\nkill connections that match certain criteria. For example, it can be used to\nterminate idle connections, or connections that have been busy for more than\n60 seconds.\n\nURL: https://mariadb.com/kb/en/kill/','','https://mariadb.com/kb/en/kill/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (406,26,'LOAD INDEX','Syntax\n------\n\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n  [[INDEX|KEY] (index_name[, index_name] ...)]\n  [IGNORE LEAVES]\n\nDescription\n-----------\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key cache\nto which it has been assigned by an explicit CACHE INDEX statement, or into\nthe default key cache otherwise. LOAD INDEX INTO CACHE is used only for MyISAM\nor Aria tables.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of the\nindex to be preloaded.\n\nURL: https://mariadb.com/kb/en/load-index/','','https://mariadb.com/kb/en/load-index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,26,'RESET','Syntax\n------\n\nRESET reset_option [, reset_option] ...\n\nDescription\n-----------\n\nThe RESET statement is used to clear the state of various server operations.\nYou must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement.\n\nThe different RESET options are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| SLAVE                     | Deletes all relay logs from the slave and      |\n| [\"connection_name\"] [ALL] | reset the replication position in the master   |\n|                           | binary log.                                    |\n+---------------------------+------------------------------------------------+\n| MASTER                    | Deletes all old binary logs, makes the binary  |\n|                           | index file (--log-bin-index) empty and         |\n|                           | creates a new binary log file.  This is        |\n|                           | useful when you want to reset the master to    |\n|                           | an initial state. If you want to just delete   |\n|                           | old, not used binary logs, you should use the  |\n|                           | PURGE BINARY LOGS command.                     |\n+---------------------------+------------------------------------------------+\n| QUERY CACHE               | Removes all queries from the query cache. See  |\n|                           | also FLUSH QUERY CACHE.                        |\n+---------------------------+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/reset/','','https://mariadb.com/kb/en/reset/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (408,26,'SHUTDOWN','Syntax\n------\n\nSHUTDOWN [WAIT FOR ALL { SLAVES | REPLICAS } ]\n\nDescription\n-----------\n\nThe SHUTDOWN command shuts the server down.\n\nWAIT FOR ALL SLAVES\n-------------------\n\nMariaDB starting with 10.4.4\n----------------------------\nThe WAIT FOR ALL SLAVES option was first added in MariaDB 10.4.4. WAIT FOR ALL\nREPLICAS has been a synonym since MariaDB 10.5.1.\n\nWhen a master server is shutdown and it goes through the normal shutdown\nprocess, the master kills client threads in random order. By default, the\nmaster also considers its binary log dump threads to be regular client\nthreads. As a consequence, the binary log dump threads can be killed while\nclient threads still exist, and this means that data can be written on the\nmaster during a normal shutdown that won\'t be replicated. This is true even if\nsemi-synchronous replication is being used.\n\nIn MariaDB 10.4 and later, this problem can be solved by shutting down the\nserver with the SHUTDOWN command and by providing the WAIT FOR ALL SLAVES\noption to the command. For example:\n\nSHUTDOWN WAIT FOR ALL SLAVES;\n\nWhen the WAIT FOR ALL SLAVES option is provided, the server only kills its\nbinary log dump threads after all client threads have been killed, and it only\ncompletes the shutdown after the last binary log has been sent to all\nconnected replicas.\n\nSee Replication Threads: Binary Log Dump Threads and the Shutdown Process for\nmore information.\n\nRequired Permissions\n--------------------\n\nOne must have a SHUTDOWN privilege (see GRANT) to use this command. It is the\nsame privilege one needs to use the mariadb-admin/mysqladmin shutdown command.\n\nShutdown for Upgrades\n---------------------\n\nIf you are doing a shutdown to migrate to another major version of MariaDB,\nplease ensure that the innodb_fast_shutdown variable is not 2 (fast crash\nshutdown). The default of this variable is 1.\n\nExample\n-------\n\nThe following example shows how to create an event which turns off the server\nat a certain time:\n\nCREATE EVENT `test`.`shutd`\n  ON SCHEDULE\n    EVERY 1 DAY\n    STARTS \'2014-01-01 20:00:00\'\n  COMMENT \'Shutdown Maria when the office is closed\'\nDO BEGIN\n  SHUTDOWN;\nEND;\n\nOther Ways to Stop mysqld\n-------------------------\n\nYou can use the mariadb-admin/mysqladmin shutdown command to take down mysqld\ncleanly.\n\nYou can also use the system kill command on Unix with signal SIGTERM (15)\n\nkill -SIGTERM pid-of-mysqld-process\n\nYou can find the process number of the server process in the file that ends\nwith .pid in your data directory.\n\nThe above is identical to mysqladmin shutdown.\n\nOn windows you should use:\n\nNET STOP MySQL\n\nURL: https://mariadb.com/kb/en/shutdown/','','https://mariadb.com/kb/en/shutdown/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (409,26,'USE','Syntax\n------\n\nUSE db_name\n\nDescription\n-----------\n\nThe \'USE db_name\' statement tells MariaDB to use the db_name database as the\ndefault (current) database for subsequent statements. The database remains the\ndefault until the end of the session or another USE statement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable;   # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable;   # selects from db2.mytable\n\nThe DATABASE() function (SCHEMA() is a synonym) returns the default database.\n\nAnother way to set the default database is specifying its name at mysql\ncommand line client startup.\n\nURL: https://mariadb.com/kb/en/use/','','https://mariadb.com/kb/en/use/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (410,26,'SHOW FUNCTION CODE','Syntax\n------\n\nSHOW FUNCTION CODE func_name\n\nDescription\n-----------\n\nSHOW FUNCTION CODE shows a representation of the internal implementation of\nthe stored function.\n\nIt is similar to SHOW PROCEDURE CODE but for stored functions.\n\nURL: https://mariadb.com/kb/en/show-function-code/','','https://mariadb.com/kb/en/show-function-code/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (411,26,'SHOW COLLATION','Syntax\n------\n\nSHOW COLLATION\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe output from SHOW COLLATION includes all available collations. The LIKE\nclause, if present on its own, indicates which collation names to match. The\nWHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema COLLATIONS\ntable.\n\nSee Setting Character Sets and Collations for details on specifying the\ncollation at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation         | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1  |  5 |         | Yes      |       1 |\n| latin1_swedish_ci | latin1  |  8 | Yes     | Yes      |       1 |\n| latin1_danish_ci  | latin1  | 15 |         | Yes      |       1 |\n| latin1_german2_ci | latin1  | 31 |         | Yes      |       2 |\n| latin1_bin        | latin1  | 47 |         | Yes      |       1 |\n| latin1_general_ci | latin1  | 48 |         | Yes      |       1 |\n| latin1_general_cs | latin1  | 49 |         | Yes      |       1 |\n| latin1_spanish_ci | latin1  | 94 |         | Yes      |       1 |\n+-------------------+---------+----+---------+----------+---------+\n\nSHOW COLLATION WHERE Sortlen LIKE \'8\' AND Charset LIKE \'utf8\';\n+--------------------+---------+-----+---------+----------+---------+\n| Collation          | Charset | Id  | Default | Compiled | Sortlen |\n+--------------------+---------+-----+---------+----------+---------+\n| utf8_unicode_ci    | utf8    | 192 |         | Yes      |       8 |\n| utf8_icelandic_ci  | utf8    | 193 |         | Yes      |       8 |\n| utf8_latvian_ci    | utf8    | 194 |         | Yes      |       8 |\n| utf8_romanian_ci   | utf8    | 195 |         | Yes      |       8 |\n| utf8_slovenian_ci  | utf8    | 196 |         | Yes      |       8 |\n| utf8_polish_ci     | utf8    | 197 |         | Yes      |       8 |\n| utf8_estonian_ci   | utf8    | 198 |         | Yes      |       8 |\n| utf8_spanish_ci    | utf8    | 199 |         | Yes      |       8 |\n| utf8_swedish_ci    | utf8    | 200 |         | Yes      |       8 |\n| utf8_turkish_ci    | utf8    | 201 |         | Yes      |       8 |\n| utf8_czech_ci      | utf8    | 202 |         | Yes      |       8 |\n| utf8_danish_ci     | utf8    | 203 |         | Yes      |       8 |\n| utf8_lithuanian_ci | utf8    | 204 |         | Yes      |       8 |\n| utf8_slovak_ci     | utf8    | 205 |         | Yes      |       8 |\n| utf8_spanish2_ci   | utf8    | 206 |         | Yes      |       8 |\n| utf8_roman_ci      | utf8    | 207 |         | Yes      |       8 |\n| utf8_persian_ci    | utf8    | 208 |         | Yes      |       8 |\n| utf8_esperanto_ci  | utf8    | 209 |         | Yes      |       8 |\n| utf8_hungarian_ci  | utf8    | 210 |         | Yes      |       8 |\n| utf8_sinhala_ci    | utf8    | 211 |         | Yes      |       8 |\n| utf8_croatian_ci   | utf8    | 213 |         | Yes      |       8 |\n+--------------------+---------+-----+---------+----------+---------+\n\nURL: https://mariadb.com/kb/en/show-collation/','','https://mariadb.com/kb/en/show-collation/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,27,'DELETE','Syntax\n------\n\nSingle-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] \n FROM tbl_name [PARTITION (partition_list)]\n [FOR PORTION OF period FROM expr1 TO expr2]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n [RETURNING select_expr\n  [, select_expr ...]]\n\nMultiple-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n  tbl_name[.*] [, tbl_name[.*]] ...\n  FROM table_references\n  [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n  FROM tbl_name[.*] [, tbl_name[.*]] ...\n  USING table_references\n  [WHERE where_condition]\n\nTrimming history:\n\nDELETE HISTORY\n FROM tbl_name [PARTITION (partition_list)]\n [BEFORE SYSTEM_TIME [TIMESTAMP|TRANSACTION] expression]\n\nDescription\n-----------\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| LOW_PRIORITY              | Wait until all SELECT\'s are done before        |\n|                           | starting the statement. Used with storage      |\n|                           | engines that uses table locking (MyISAM, Aria  |\n|                           | etc). See HIGH_PRIORITY and LOW_PRIORITY       |\n|                           | clauses for details.                           |\n+---------------------------+------------------------------------------------+\n| QUICK                     | Signal the storage engine that it should       |\n|                           | expect that a lot of rows are deleted. The     |\n|                           | storage engine engine can do things to speed   |\n|                           | up the DELETE like ignoring merging of data    |\n|                           | blocks until all rows are deleted from the     |\n|                           | block (instead of when a block is half full).  |\n|                           | This speeds up things at the expanse of lost   |\n|                           | space in data blocks. At least MyISAM and      |\n|                           | Aria support this feature.                     |\n+---------------------------+------------------------------------------------+\n| IGNORE                    | Don\'t stop the query even if a not-critical    |\n|                           | error occurs (like data overflow). See How     |\n|                           | IGNORE works for a full description.           |\n+---------------------------+------------------------------------------------+\n\nFor the single-table syntax, the DELETE statement deletes rows from tbl_name\nand returns a count of the number of deleted rows. This count can be obtained\nby calling the ROW_COUNT() function. The WHERE clause, if given, specifies the\nconditions that identify which rows to delete. With no WHERE clause, all rows\nare deleted. If the ORDER BY clause is specified, the rows are deleted in the\norder that is specified. The LIMIT clause places a limit on the number of rows\nthat can be deleted.\n\nFor the multiple-table syntax, DELETE deletes from each tbl_name the rows that\nsatisfy the conditions. In this case, ORDER BY and LIMIT> cannot be used. A\nDELETE can also reference tables which are located in different databases; see\nIdentifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be\ndeleted. It is specified as described in SELECT.\n\nCurrently, you cannot delete from a table and select from the same table in a\nsubquery.\n\nYou need the DELETE privilege on a table to delete rows from it. You need only\nthe SELECT privilege for any columns that are only read, such as those named\nin the WHERE clause. See GRANT.\n\nAs stated, a DELETE statement with no WHERE clause deletes all rows. A faster\nway to do this, when you do not need to know the number of deleted rows, is to\nuse TRUNCATE TABLE. However, within a transaction or if you have a lock on the\ntable, TRUNCATE TABLE cannot be used whereas DELETE can. See TRUNCATE TABLE,\nand LOCK.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n--------------\n\nMariaDB starting with 10.4.3\n----------------------------\nSee Application Time Periods - Deletion by Portion.\n\nRETURNING\n---------\n\nIt is possible to return a resultset of the deleted rows for a single table to\nthe client by using the syntax DELETE ... RETURNING select_expr [,\nselect_expr2 ...]]\n\nAny of SQL expression that can be calculated from a single row fields is\nallowed. Subqueries are allowed. The AS keyword is allowed, so it is possible\nto use aliases.\n\nThe use of aggregate functions is not allowed. RETURNING cannot be used in\nmulti-table DELETEs.\n\nMariaDB starting with 10.3.1\n----------------------------\n\nSame Source and Target Table\n----------------------------\n\nUntil MariaDB 10.3.1, deleting from a table with the same source and target\nwas not possible. From MariaDB 10.3.1, this is now possible. For example:\n\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n\nMariaDB starting with 10.3.4\n----------------------------\n\nDELETE HISTORY\n--------------\n\nOne can use DELETE HISTORY to delete historical information from\nSystem-versioned tables.\n\nExamples\n--------\n\nHow to use the ORDER BY and LIMIT clauses:\n\nDELETE FROM page_hit ORDER BY timestamp LIMIT 1000000;\n\nHow to use the RETURNING clause:\n\nDELETE FROM t RETURNING f1;\n+------+\n| f1   |\n+------+\n|    5 |\n|   50 |\n|  500 |\n+------+\n\nThe following statement joins two tables: one is only used to satisfy a WHERE\ncondition, but no row is deleted from it; rows from the other table are\ndeleted, instead.\n\nDELETE post FROM blog INNER JOIN post WHERE blog.id = post.blog_id;\n\nDeleting from the Same Source and Target\n----------------------------------------\n\nCREATE TABLE t1 (c1 INT, c2 INT);\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n\nUntil MariaDB 10.3.1, this returned:\n\nERROR 1093 (HY000): Table \'t1\' is specified twice, both as a target for\n\'DELETE\' \n and as a separate source for\n\nFrom MariaDB 10.3.1:\n\nQuery OK, 0 rows affected (0.00 sec)\n\nURL: https://mariadb.com/kb/en/delete/','','https://mariadb.com/kb/en/delete/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (413,27,'REPLACE','Syntax\n------\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nDescription\n-----------\n\nREPLACE works exactly like INSERT, except that if an old row in the table has\nthe same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row\nis deleted before the new row is inserted. If the table has more than one\nUNIQUE keys, it is possible that the new row conflicts with more than one row.\nIn this case, all conflicting rows will be deleted.\n\nThe table name can be specified in the form db_name.tbl_name or, if a default\ndatabase is selected, in the form tbl_name (see Identifier Qualifiers). This\nallows to use REPLACE ... SELECT to copy rows between different databases.\n\nMariaDB starting with 10.5.0\n----------------------------\nThe RETURNING clause was introduced in MariaDB 10.5.0\n\nBasically it works like this:\n\nBEGIN;\nSELECT 1 FROM t1 WHERE key=# FOR UPDATE;\nIF found-row\n DELETE FROM t1 WHERE key=# ;\nENDIF\nINSERT INTO t1 VALUES (...);\nEND;\n\nThe above can be replaced with:\n\nREPLACE INTO t1 VALUES (...)\n\nREPLACE is a MariaDB/MySQL extension to the SQL standard. It either inserts,\nor deletes and inserts. For other MariaDB/MySQL extensions to standard SQL ---\nthat also handle duplicate values --- see IGNORE and INSERT ON DUPLICATE KEY\nUPDATE.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a REPLACE\nstatement makes no sense. It becomes equivalent to INSERT, because there is no\nindex to be used to determine whether a new row duplicates another.\n\nValues for all columns are taken from the values sSee Partition Pruning and\nSelection for details.pecified in the REPLACE statement. Any missing columns\nare set to their default values, just as happens for INSERT. You cannot refer\nto values from the current row and use them in the new row. If you use an\nassignment such as \'SET col = col + 1\', the reference to the column name on\nthe right hand side is treated as DEFAULT(col), so the assignment is\nequivalent to \'SET col = DEFAULT(col) + 1\'.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for the\ntable.\n\nThere are some gotchas you should be aware of, before using REPLACE:\n\n* If there is an AUTO_INCREMENT field, a new value will be generated.\n* If there are foreign keys, ON DELETE action will be activated by REPLACE.\n* Triggers on DELETE and INSERT will be activated by REPLACE.\n\nTo avoid some of these behaviors, you can use INSERT ... ON DUPLICATE KEY\nUPDATE.\n\nThis statement activates INSERT and DELETE triggers. See Trigger Overview for\ndetails.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nREPLACE RETURNING\n-----------------\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n|   1 |     2 |       1 |        1 |\n|   2 |     4 |       2 |        1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\nPREPARE stmt FROM \"REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n|       6 | FOX            |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n|      1 |\n|      1 |\n|      1 |\n|      1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in REPLACE...SEL==\nDescription\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n|   1 |     2 |       1 |        1 |\n|   2 |     4 |       2 |        1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\nPREPARE stmt FROM \"REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n|       6 | FOX            |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n|      1 |\n|      1 |\n|      1 |\n|      1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in\nREPLACE...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the REPLACE table. ECT...RETURNING if the table in the RETURNING\nclause is not the same as the REPLACE table.\n\nURL: https://mariadb.com/kb/en/replace/','','https://mariadb.com/kb/en/replace/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (414,27,'UPDATE','Syntax\n------\n\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference \n [PARTITION (partition_list)]\n [FOR PORTION OF period FROM expr1 TO expr2]\n SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n  SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...\n  [WHERE where_condition]\n\nDescription\n-----------\n\nFor the single-table syntax, the UPDATE statement updates columns of existing\nrows in the named table with new values. The SET clause indicates which\ncolumns to modify and the values they should be given. Each value can be given\nas an expression, or the keyword DEFAULT to set a column explicitly to its\ndefault value. The WHERE clause, if given, specifies the conditions that\nidentify which rows to update. With no WHERE clause, all rows are updated. If\nthe ORDER BY clause is specified, the rows are updated in the order that is\nspecified. The LIMIT clause places a limit on the number of rows that can be\nupdated.\n\nUntil MariaDB 10.3.2, for the multiple-table syntax, UPDATE updates rows in\neach table named in table_references that satisfy the conditions. In this\ncase, ORDER BY and LIMIT cannot be used. This restriction was lifted in\nMariaDB 10.3.2 and both clauses can be used with multiple-table updates. An\nUPDATE can also reference tables which are located in different databases; see\nIdentifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be\nupdated.\n\ntable_references and where_condition are as specified as described in SELECT.\n\nFor single-table updates, assignments are evaluated in left-to-right order,\nwhile for multi-table updates, there is no guarantee of a particular order. If\nthe SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB 10.3.5) is set,\nUPDATE statements evaluate all assignments simultaneously.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE that\nare actually updated. You need only the SELECT privilege for any columns that\nare read but not modified. See GRANT.\n\nThe UPDATE statement supports the following modifiers:\n\n* If you use the LOW_PRIORITY keyword, execution of\n the UPDATE is delayed until no other clients are reading from\n the table. This affects only storage engines that use only table-level\n locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and LOW_PRIORITY clauses\nfor details.\n* If you use the IGNORE keyword, the update statement does \n not abort even if errors occur during the update. Rows for which\n duplicate-key conflicts occur are not updated. Rows for which columns are\n updated to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n--------------\n\nMariaDB starting with 10.4.3\n----------------------------\nSee Application Time Periods - Updating by Portion.\n\nUPDATE Statements With the Same Source and Target\n-------------------------------------------------\n\nMariaDB starting with 10.3.2\n----------------------------\nFrom MariaDB 10.3.2, UPDATE statements may have the same source and target.\n\nFor example, given the following table:\n\nDROP TABLE t1;\nCREATE TABLE t1 (c1 INT, c2 INT);\nINSERT INTO t1 VALUES (10,10), (20,20);\n\nUntil MariaDB 10.3.1, the following UPDATE statement would not work:\n\nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\nERROR 1093 (HY000): Table \'t1\' is specified twice, \n both as a target for \'UPDATE\' and as a separate source for data\n\nFrom MariaDB 10.3.2, the statement executes successfully:\n\nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\n\nSELECT * FROM t1;\n+------+------+\n| c1   | c2   |\n+------+------+\n|   10 |   10 |\n|   21 |   20 |\n+------+------+\n\nExample\n-------\n\nSingle-table syntax:\n\nUPDATE table_name SET column1 = value1, column2 = value2 WHERE id=100;\n\nMultiple-table syntax:\n\nUPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 = value2 WHERE\ntab1.id = tab2.id;\n\nURL: https://mariadb.com/kb/en/update/','','https://mariadb.com/kb/en/update/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (415,27,'IGNORE','The IGNORE option tells the server to ignore some common errors.\n\nIGNORE can be used with the following statements:\n\n* DELETE\n* INSERT (see also INSERT IGNORE)\n* LOAD DATA INFILE\n* UPDATE\n* ALTER TABLE\n* CREATE TABLE ... SELECT\n* INSERT ... SELECT\n\nThe logic used:\n\n* Variables out of ranges are replaced with the maximum/minimum value.\n\n* SQL_MODEs STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE,\nNO_ZERO_DATE are ignored.\n\n* Inserting NULL in a NOT NULL field will insert 0 ( in a numerical\n field), 0000-00-00 ( in a date field) or an empty string ( in a character\n field).\n\n* Rows that cause a duplicate key error or break a foreign key constraint are\n not inserted, updated, or deleted.\n\nThe following errors are ignored:\n\n+---------------------+---------------------------------+--------------------+\n| Error number        | Symbolic error name             | Description        |\n+---------------------+---------------------------------+--------------------+\n| 1022                | ER_DUP_KEY                      | Can\'t write;       |\n|                     |                                 | duplicate key in   |\n|                     |                                 | table \'%s\'         |\n+---------------------+---------------------------------+--------------------+\n| 1048                | ER_BAD_NULL_ERROR               | Column \'%s\'        |\n|                     |                                 | cannot be null     |\n+---------------------+---------------------------------+--------------------+\n| 1062                | ER_DUP_ENTRY                    | Duplicate entry    |\n|                     |                                 | \'%s\' for key %d    |\n+---------------------+---------------------------------+--------------------+\n| 1242                | ER_SUBQUERY_NO_1_ROW            | Subquery returns   |\n|                     |                                 | more than 1 row    |\n+---------------------+---------------------------------+--------------------+\n| 1264                | ER_WARN_DATA_OUT_OF_RANGE       | Out of range       |\n|                     |                                 | value for column   |\n|                     |                                 | \'%s\' at row %ld    |\n+---------------------+---------------------------------+--------------------+\n| 1265                | WARN_DATA_TRUNCATED             | Data truncated     |\n|                     |                                 | for column \'%s\'    |\n|                     |                                 | at row %ld         |\n+---------------------+---------------------------------+--------------------+\n| 1292                | ER_TRUNCATED_WRONG_VALUE        | Truncated          |\n|                     |                                 | incorrect %s       |\n|                     |                                 | value: \'%s\'        |\n+---------------------+---------------------------------+--------------------+\n| 1366                | ER_TRUNCATED_WRONG_VALUE_FOR_FI | Incorrect integer  |\n|                     | LD                              | value              |\n+---------------------+---------------------------------+--------------------+\n| 1369                | ER_VIEW_CHECK_FAILED            | CHECK OPTION       |\n|                     |                                 | failed \'%s.%s\'     |\n+---------------------+---------------------------------+--------------------+\n| 1451                | ER_ROW_IS_REFERENCED_2          | Cannot delete or   |\n|                     |                                 | update a parent    |\n|                     |                                 | row                |\n+---------------------+---------------------------------+--------------------+\n| 1452                | ER_NO_REFERENCED_ROW_2          | Cannot add or      |\n|                     |                                 | update a child     |\n|                     |                                 | row: a foreign     |\n|                     |                                 | key constraint     |\n|                     |                                 | fails (%s)         |\n+---------------------+---------------------------------+--------------------+\n| 1526                | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no       |\n|                     |                                 | partition for      |\n|                     |                                 | value %s           |\n+---------------------+---------------------------------+--------------------+\n| 1586                | ER_DUP_ENTRY_WITH_KEY_NAME      | Duplicate entry    |\n|                     |                                 | \'%s\' for key \'%s\'  |\n+---------------------+---------------------------------+--------------------+\n| 1591                | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no       |\n|                     | SILENT                          | partition for      |\n|                     |                                 | some existing      |\n|                     |                                 | values             |\n+---------------------+---------------------------------+--------------------+\n| 1748                | ER_ROW_DOES_NOT_MATCH_GIVEN_PAR | Found a row not    |\n|                     | ITION_SET                       | matching the       |\n|                     |                                 | given partition    |\n|                     |                                 | set                |\n+---------------------+---------------------------------+--------------------+\n\nIgnored errors normally generate a warning.\n\nA property of the IGNORE clause consists in causing transactional engines and\nnon-transactional engines (like XtraDB and Aria) to behave the same way. For\nexample, normally a multi-row insert which tries to violate a UNIQUE contraint\nis completely rolled back on XtraDB/InnoDB, but might be partially executed on\nAria. With the IGNORE clause, the statement will be partially executed in both\nengines.\n\nDuplicate key errors also generate warnings. The OLD_MODE server variable can\nbe used to prevent this.\n\nURL: https://mariadb.com/kb/en/ignore/','','https://mariadb.com/kb/en/ignore/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (416,27,'SELECT','Syntax\n------\n\nSELECT\n  [ALL | DISTINCT | DISTINCTROW]\n  [HIGH_PRIORITY]\n  [STRAIGHT_JOIN]\n  [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n  [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n  select_expr [, select_expr ...]\n  [ FROM table_references\n   [WHERE where_condition]\n   [GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]]\n   [HAVING where_condition]\n   [ORDER BY {col_name | expr | position} [ASC | DESC], ...]\n   [LIMIT {[offset,] row_count | row_count OFFSET offset  [ROWS EXAMINED\nrows_limit] } |\n    [OFFSET start { ROW | ROWS }]\n    [FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }]\n]\n   procedure|[PROCEDURE procedure_name(argument_list)]\n   [INTO OUTFILE \'file_name\' [CHARACTER SET charset_name] [export_options] |\n    INTO DUMPFILE \'file_name\' | INTO var_name [, var_name] ]\n   [FOR UPDATE lock_option | LOCK IN SHARE MODE lock_option]\nexport_options:\n  [{FIELDS | COLUMNS}\n    [TERMINATED BY \'string\']\n    [[OPTIONALLY] ENCLOSED BY \'char\']\n    [ESCAPED BY \'char\']\n  ]\n  [LINES\n    [STARTING BY \'string\']\n    [TERMINATED BY \'string\']\n  ]\nlock_option:\n  [WAIT n | NOWAIT | SKIP LOCKED]\n\nDescription\n-----------\n\nSELECT is used to retrieve rows selected from one or more tables, and can\ninclude UNION statements and subqueries.\n\n* Each select_expr expression indicates a column or data that you want to\nretrieve. You\nmust have at least one select expression. See Select Expressions below.\n\n* The FROM clause indicates the table or tables from which to retrieve rows.\nUse either a single table name or a JOIN expression. See JOIN\nfor details. If no table is involved, FROM DUAL can be specified.\n\n* Each table can also be specified as db_name.tabl_name. Each column can also\nbe specified as tbl_name.col_name or even db_name.tbl_name.col_name. This\nallows one to write queries which involve multiple databases. See Identifier\nQualifiers for syntax details.\n\n* The WHERE clause, if given, indicates the condition or\n conditions that rows must satisfy to be selected.\n where_condition is an expression that evaluates to true for\n each row to be selected. The statement selects all rows if there is no WHERE\n clause.\nIn the WHERE clause, you can use any of the functions and\n operators that MariaDB supports, except for aggregate (summary) functions.\nSee Functions and Operators and Functions and Modifiers for use with GROUP BY\n(aggregate).\n\n* Use the ORDER BY clause to order the results.\n\n* Use the LIMIT clause allows you to restrict the results to only\na certain number of rows, optionally with an offset.\n\n* Use the GROUP BY and HAVING clauses to group\nrows together when they have columns or computed values in common.\n\nSELECT can also be used to retrieve rows computed without reference to any\ntable.\n\nSelect Expressions\n------------------\n\nA SELECT statement must contain one or more select expressions, separated by\ncommas. Each select expression can be one of the following:\n\n* The name of a column.\n* Any expression using functions and operators.\n* * to select all columns from all tables in the FROM clause.\n* tbl_name.* to select all columns from just the table tbl_name.\n\nWhen specifying a column, you can either use just the column name or qualify\nthe column name with the name of the table using tbl_name.col_name. The\nqualified form is useful if you are joining multiple tables in the FROM\nclause. If you do not qualify the column names when selecting from multiple\ntables, MariaDB will try to find the column in each table. It is an error if\nthat column name exists in multiple tables.\n\nYou can quote column names using backticks. If you are qualifying column names\nwith table names, quote each part separately as `tbl_name`.`col_name`.\n\nIf you use any grouping functions in any of the select expressions, all rows\nin your results will be implicitly grouped, as if you had used GROUP BY NULL.\n\nDISTINCT\n--------\n\nA query may produce some identical rows. By default, all rows are retrieved,\neven when their values are the same. To explicitly specify that you want to\nretrieve identical rows, use the ALL option. If you want duplicates to be\nremoved from the resultset, use the DISTINCT option. DISTINCTROW is a synonym\nfor DISTINCT. See also COUNT DISTINCT and SELECT UNIQUE in Oracle mode.\n\nINTO\n----\n\nThe INTO clause is used to specify that the query results should be written to\na file or variable.\n\n* SELECT INTO OUTFILE - formatting and writing the result to an external file.\n* SELECT INTO DUMPFILE - binary-safe writing of the unformatted results to an\nexternal file.\n* SELECT INTO Variable - selecting and setting variables.\n\nThe reverse of SELECT INTO OUTFILE is LOAD DATA.\n\nLIMIT\n-----\n\nRestricts the number of returned rows. See LIMIT and LIMIT ROWS EXAMINED for\ndetails.\n\nLOCK IN SHARE MODE/FOR UPDATE\n-----------------------------\n\nSee LOCK IN SHARE MODE and FOR UPDATE for details on the respective locking\nclauses.\n\nOFFSET ... FETCH\n----------------\n\nMariaDB starting with 10.6\n--------------------------\nSee SELECT ... OFFSET ... FETCH.\n\nORDER BY\n--------\n\nOrder a resultset. See ORDER BY for details.\n\nPARTITION\n---------\n\nSpecifies to the optimizer which partitions are relevant for the query. Other\npartitions will not be read. See Partition Pruning and Selection for details.\n\nPROCEDURE\n---------\n\nPasses the whole result set to a C Procedure. See PROCEDURE and PROCEDURE\nANALYSE (the only built-in procedure not requiring the server to be\nrecompiled).\n\nSKIP LOCKED\n-----------\n\nMariaDB starting with 10.6\n--------------------------\nThe SKIP LOCKED clause was introduced in MariaDB 10.6.0.\n\nThis causes those rows that couldn\'t be locked (LOCK IN SHARE MODE or FOR\nUPDATE) to be excluded from the result set. An explicit NOWAIT is implied\nhere. This is only implemented on InnoDB tables and ignored otherwise.\n\nSQL_CALC_FOUND_ROWS\n-------------------\n\nWhen SQL_CALC_FOUND_ROWS is used, then MariaDB will calculate how many rows\nwould have been in the result, if there would be no LIMIT clause. The result\ncan be found by calling the function FOUND_ROWS() in your next sql statement.\n\nmax_statement_time clause\n-------------------------\n\nBy using max_statement_time in conjunction with SET STATEMENT, it is possible\nto limit the execution time of individual queries. For example:\n\nSET STATEMENT max_statement_time=100 FOR \n SELECT field1 FROM table_name ORDER BY field1;\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nExamples\n--------\n\nSELECT f1,f2 FROM t1 WHERE (f3<=10) AND (f4=\'y\');\n\nSee Getting Data from MariaDB (Beginner tutorial), or the various\nsub-articles, for more examples.\n\nURL: https://mariadb.com/kb/en/select/','','https://mariadb.com/kb/en/select/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (417,27,'JOIN Syntax','Description\n-----------\n\nMariaDB supports the following JOIN syntaxes for the table_references part of\nSELECT statements and multiple-table DELETE and UPDATE statements:\n\ntable_references:\n  table_reference [, table_reference] ...\n\ntable_reference:\n  table_factor\n | join_table\n\ntable_factor:\n  tbl_name [PARTITION (partition_list)]\n    [query_system_time_period_specification] [[AS] alias] [index_hint_list]\n | table_subquery [query_system_time_period_specification] [AS] alias\n | ( table_references )\n | { ON table_reference LEFT OUTER JOIN table_reference\n    ON conditional_expr }\n\njoin_table:\n  table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n  ON conditional_expr\n | USING (column_list)\n\nquery_system_time_period_specification:\n  FOR SYSTEM_TIME AS OF point_in_time\n | FOR SYSTEM_TIME BETWEEN point_in_time AND point_in_time\n | FOR SYSTEM_TIME FROM point_in_time TO point_in_time\n | FOR SYSTEM_TIME ALL\n\npoint_in_time:\n  [TIMESTAMP] expression\n | TRANSACTION expression\n\nindex_hint_list:\n  index_hint [, index_hint] ...\n\nindex_hint:\n  USE {INDEX|KEY}\n   [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n   [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n   [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n  index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nEach table can also be specified as db_name.tabl_name. This allows to write\nqueries which involve multiple databases. See Identifier Qualifiers for syntax\ndetails.\n\nThe syntax of table_factor is extended in comparison with the SQL Standard.\nThe latter accepts only table_reference, not a list of them inside a pair of\nparentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n        ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n        ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MariaDB, CROSS JOIN is a syntactic equivalent to INNER JOIN (they can\nreplace each other). In standard SQL, they are not equivalent. INNER JOIN is\nused with an ON clause, CROSS JOIN is used otherwise.\n\nIn general, parentheses can be ignored in join expressions containing only\ninner join operations. MariaDB also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.1/en/nested-join-optimization.html).\n\nSee System-versioned tables for more information about FOR SYSTEM_TIME syntax.\n\nIndex hints can be specified to affect how the MariaDB optimizer makes use of\nindexes. For more information, see How to force query plans.\n\nExamples\n--------\n\nSELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n\nURL: https://mariadb.com/kb/en/join-syntax/','','https://mariadb.com/kb/en/join-syntax/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (418,27,'Scalar Subqueries','A scalar subquery is a subquery that returns a single value. This is the\nsimplest form of a subquery, and can be used in most places a literal or\nsingle column value is valid.\n\nThe data type, length and character set and collation are all taken from the\nresult returned by the subquery. The result of a subquery can always be NULL,\nthat is, no result returned. Even if the original value is defined as NOT\nNULL, this is disregarded.\n\nA subquery cannot be used where only a literal is expected, for example LOAD\nDATA INFILE expects a literal string containing the file name, and LIMIT\nrequires a literal integer.\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num TINYINT);\n\nINSERT INTO sq1 VALUES (1);\n\nINSERT INTO sq2 VALUES (10* (SELECT num FROM sq1));\n\nSELECT * FROM sq2;\n+------+\n| num  |\n+------+\n|   10 |\n+------+\n\nInserting a second row means the subquery is no longer a scalar, and this\nparticular query is not valid:\n\nINSERT INTO sq1 VALUES (2);\n\nINSERT INTO sq2 VALUES (10* (SELECT num FROM sq1));\nERROR 1242 (21000): Subquery returns more than 1 row\n\nNo rows in the subquery, so the scalar is NULL:\n\nINSERT INTO sq2 VALUES (10* (SELECT num FROM sq3 WHERE num=\'3\'));\n\nSELECT * FROM sq2;\n+------+\n| num  |\n+------+\n|   10 |\n| NULL |\n+------+\n\nA more traditional scalar subquery, as part of a WHERE clause:\n\nSELECT * FROM sq1 WHERE num = (SELECT MAX(num)/10 FROM sq2); \n+------+\n| num  |\n+------+\n|    1 |\n+------+\n\nURL: https://mariadb.com/kb/en/subqueries-scalar-subqueries/','','https://mariadb.com/kb/en/subqueries-scalar-subqueries/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (419,27,'Row Subqueries','A row subquery is a subquery returning a single row, as opposed to a scalar\nsubquery, which returns a single column from a row, or a literal.\n\nExamples\n--------\n\nCREATE TABLE staff (name VARCHAR(10), age TINYINT);\n\nCREATE TABLE customer (name VARCHAR(10), age TINYINT);\n\nINSERT INTO staff VALUES (\'Bilhah\',37), (\'Valerius\',61), (\'Maia\',25);\n\nINSERT INTO customer VALUES (\'Thanasis\',48), (\'Valerius\',61), (\'Brion\',51);\n\nSELECT * FROM staff WHERE (name,age) = (SELECT name,age FROM customer WHERE\nname=\'Valerius\');\n+----------+------+\n| name     | age  |\n+----------+------+\n| Valerius |   61 |\n+----------+------+\n\nFinding all rows in one table also in another:\n\nSELECT name,age FROM staff WHERE (name,age) IN (SELECT name,age FROM customer);\n+----------+------+\n| name     | age  |\n+----------+------+\n| Valerius |   61 |\n+----------+------+\n\nURL: https://mariadb.com/kb/en/subqueries-row-subqueries/','','https://mariadb.com/kb/en/subqueries-row-subqueries/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (420,27,'Subqueries and ALL','Subqueries using the ALL keyword will return true if the comparison returns\ntrue for each row returned by the subquery, or the subquery returns no rows.\n\nSyntax\n------\n\nscalar_expression comparison_operator ALL <Table subquery>\n\n* scalar_expression may be any expression that evaluates to a single\nvalue\n* comparison_operator may be any one of: =, >, <, >=, <=, <> or !=\n\nALL returns:\n\n* NULL if the comparison operator returns NULL for at least one row returned\nby the Table subquery or scalar_expression returns NULL.\n* FALSE if the comparison operator returns FALSE for at least one row returned\nby the Table subquery.\n* TRUE if the comparison operator returns TRUE for all rows returned by the\nTable subquery, or if Table subquery returns no rows.\n\nNOT IN is an alias for <> ALL.\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num2 TINYINT);\n\nINSERT INTO sq1 VALUES(100);\n\nINSERT INTO sq2 VALUES(40),(50),(60);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nSince 100 > all of 40,50 and 60, the evaluation is true and the row is returned\n\nAdding a second row to sq1, where the evaluation for that record is false:\n\nINSERT INTO sq1 VALUES(30);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nAdding a new row to sq2, causing all evaluations to be false:\n\nINSERT INTO sq2 VALUES(120);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\nEmpty set (0.00 sec)\n\nWhen the subquery returns no results, the evaluation is still true:\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2 WHERE num2 > 300);\n+------+\n| num  |\n+------+\n|  100 |\n|   30 |\n+------+\n\nEvaluating against a NULL will cause the result to be unknown, or not true,\nand therefore return no rows:\n\nINSERT INTO sq2 VALUES (NULL);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\n\nURL: https://mariadb.com/kb/en/subqueries-and-all/','','https://mariadb.com/kb/en/subqueries-and-all/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (421,27,'Subqueries and ANY','Subqueries using the ANY keyword will return true if the comparison returns\ntrue for at least one row returned by the subquery.\n\nSyntax\n------\n\nThe required syntax for an ANY or SOME quantified comparison is:\n\nscalar_expression comparison_operator ANY <Table subquery>\n\nOr:\n\nscalar_expression comparison_operator SOME <Table subquery>\n\n* scalar_expression may be any expression that evaluates to a\nsingle value.\n* comparison_operator may be any one of =, >, <, >=, <=, <> or !=.\n\nANY returns:\n\n* TRUE if the comparison operator returns TRUE for at least one row returned\nby the Table subquery.\n* FALSE if the comparison operator returns FALSE for all rows returned by the\nTable subquery, or Table subquery has zero rows.\n* NULL if the comparison operator returns NULL for at least one row returned\nby the Table subquery and doesn\'t returns TRUE for any of them, or if\nscalar_expression returns NULL.\n\nSOME is a synmonym for ANY, and IN is a synonym for = ANY\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num2 TINYINT);\n\nINSERT INTO sq1 VALUES(100);\n\nINSERT INTO sq2 VALUES(40),(50),(120);\n\nSELECT * FROM sq1 WHERE num > ANY (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\n100 is greater than two of the three values, and so the expression evaluates\nas true.\n\nSOME is a synonym for ANY:\n\nSELECT * FROM sq1 WHERE num < SOME (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nIN is a synonym for = ANY, and here there are no matches, so no results are\nreturned:\n\nSELECT * FROM sq1 WHERE num IN (SELECT * FROM sq2);\nEmpty set (0.00 sec)\n\nINSERT INTO sq2 VALUES(100);\nQuery OK, 1 row affected (0.05 sec)\n\nSELECT * FROM sq1 WHERE num <> ANY (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nReading this query, the results may be counter-intuitive. It may seem to read\nas \"SELECT * FROM sq1 WHERE num does not match any results in sq2. Since it\ndoes match 100, it could seem that the results are incorrect. However, the\nquery returns a result if the match does not match any of sq2. Since 100\nalready does not match 40, the expression evaluates to true immediately,\nregardless of the 100\'s matching. It may be more easily readable to use SOME\nin a case such as this:\n\nSELECT * FROM sq1 WHERE num <> SOME (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nURL: https://mariadb.com/kb/en/subqueries-and-any/','','https://mariadb.com/kb/en/subqueries-and-any/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (422,27,'Subqueries and EXISTS','Syntax\n------\n\nSELECT ... WHERE EXISTS <Table subquery>\n\nDescription\n-----------\n\nSubqueries using the EXISTS keyword will return true if the subquery returns\nany rows. Conversely, subqueries using NOT EXISTS will return true only if the\nsubquery returns no rows from the table.\n\nEXISTS subqueries ignore the columns specified by the SELECT of the subquery,\nsince they\'re not relevant. For example,\n\nSELECT col1 FROM t1 WHERE EXISTS (SELECT * FROM t2);\n\nand\n\nSELECT col1 FROM t1 WHERE EXISTS (SELECT col2 FROM t2);\n\nproduce identical results.\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num2 TINYINT);\n\nINSERT INTO sq1 VALUES(100);\n\nINSERT INTO sq2 VALUES(40),(50),(60);\n\nSELECT * FROM sq1 WHERE EXISTS (SELECT * FROM sq2 WHERE num2>50);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nSELECT * FROM sq1 WHERE NOT EXISTS (SELECT * FROM sq2 GROUP BY num2 HAVING\nMIN(num2)=40);\nEmpty set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/subqueries-and-exists/','','https://mariadb.com/kb/en/subqueries-and-exists/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (423,27,'Subqueries in a FROM Clause','Although subqueries are more commonly placed in a WHERE clause, they can also\nform part of the FROM clause. Such subqueries are commonly called derived\ntables.\n\nIf a subquery is used in this way, you must also use an AS clause to name the\nresult of the subquery.\n\nORACLE mode\n-----------\n\nMariaDB starting with 10.6.0\n----------------------------\nFrom MariaDB 10.6.0, anonymous subqueries in a FROM clause (no AS clause) are\npermitted in ORACLE mode.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nAssume that, given the data above, you want to return the average total for\nall students. In other words, the average of Chun\'s 148 (75+73), Esben\'s 74\n(43+31), etc.\n\nYou cannot do the following:\n\nSELECT AVG(SUM(score)) FROM student GROUP BY name;\nERROR 1111 (HY000): Invalid use of group function\n\nA subquery in the FROM clause is however permitted:\n\nSELECT AVG(sq_sum) FROM (SELECT SUM(score) AS sq_sum FROM student GROUP BY\nname) AS t;\n+-------------+\n| AVG(sq_sum) |\n+-------------+\n|    134.0000 |\n+-------------+\n\nFrom MariaDB 10.6 in ORACLE mode, the following is permitted:\n\nSELECT * FROM (SELECT 1 FROM DUAL), (SELECT 2 FROM DUAL);\n\nURL: https://mariadb.com/kb/en/subqueries-in-a-from-clause/','','https://mariadb.com/kb/en/subqueries-in-a-from-clause/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (424,27,'Subqueries and JOINs','A subquery can quite often, but not in all cases, be rewritten as a JOIN.\n\nRewriting Subqueries as JOINS\n-----------------------------\n\nA subquery using IN can be rewritten with the DISTINCT keyword, for example:\n\nSELECT * FROM table1 WHERE col1 IN (SELECT col1 FROM table2);\n\ncan be rewritten as:\n\nSELECT DISTINCT table1.* FROM table1, table2 WHERE table1.col1=table2.col1;\n\nNOT IN or NOT EXISTS queries can also be rewritten. For example, these two\nqueries returns the same result:\n\nSELECT * FROM table1 WHERE col1 NOT IN (SELECT col1 FROM table2);\nSELECT * FROM table1 WHERE NOT EXISTS (SELECT col1 FROM table2 WHERE\ntable1.col1=table2.col1);\n\nand both can be rewritten as:\n\nSELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE\ntable2.id IS NULL;\n\nSubqueries that can be rewritten as a LEFT JOIN are sometimes more efficient.\n\nUsing Subqueries instead of JOINS\n---------------------------------\n\nThere are some scenarios, though, which call for subqueries rather than joins:\n\n* When you want duplicates, but not false duplicates. Suppose Table_1\n has three rows — {1,1,2}\n — and Table_2 has two rows\n — {1,2,2}. If you need to list the rows\n in Table_1 which are also in Table_2, only this\n subquery-based SELECT statement will give the right answer\n (1,1,2):\n\nSELECT Table_1.column_1 \nFROM   Table_1 \nWHERE  Table_1.column_1 IN \n (SELECT Table_2.column_1\n  FROM   Table_2);\n\n* This SQL statement won\'t work:\n\nSELECT Table_1.column_1 \nFROM   Table_1,Table_2 \nWHERE  Table_1.column_1 = Table_2.column_1;\n\n* because the result will be {1,1,2,2}\n — and the duplication of 2 is an error.  This SQL\n statement won\'t work either:\n\nSELECT DISTINCT Table_1.column_1 \nFROM   Table_1,Table_2 \nWHERE  Table_1.column_1 = Table_2.column_1;\n\n* because the result will be {1,2} — and\n the removal of the duplicated 1 is an error too.\n\n* When the outermost statement is not a query. The SQL statement:\n\nUPDATE Table_1 SET column_1 = (SELECT column_1 FROM Table_2);\n\n* can\'t be expressed using a join unless some rare SQL3 features are used.\n\n* When the join is over an expression. The SQL statement:\n\nSELECT * FROM Table_1 \nWHERE column_1 + 5 =\n (SELECT MAX(column_1) FROM Table_2);\n\n* is hard to express with a join. In fact, the only way we can think of is\n this SQL statement:\n\nSELECT Table_1.*\nFROM   Table_1, \n   (SELECT MAX(column_1) AS max_column_1 FROM Table_2) AS Table_2\nWHERE  Table_1.column_1 + 5 = Table_2.max_column_1;\n\n* which still involves a parenthesized query, so nothing is gained from the\n transformation.\n\n* When you want to see the exception. For example, suppose the question is:\n what books are longer than Das Kapital? These two queries are effectively\n almost the same:\n\nSELECT DISTINCT Bookcolumn_1.*                     \nFROM   Books AS Bookcolumn_1 JOIN Books AS Bookcolumn_2 USING(page_count) \nWHERE  title = \'Das Kapital\';\n\nSELECT DISTINCT Bookcolumn_1.* \nFROM   Books AS Bookcolumn_1 \nWHERE  Bookcolumn_1.page_count > \n (SELECT DISTINCT page_count\n FROM   Books AS Bookcolumn_2\n WHERE  title = \'Das Kapital\');\n\n* The difference is between these two SQL statements is, if there are two\n editions of Das Kapital (with different page counts), then the self-join\n example will return the books which are  longer than the shortest edition\n of Das Kapital. That might be the wrong answer, since the original\n question didn\'t ask for \"... longer than ANY book named Das Kapital\"\n (it seems to contain a false assumption that there\'s only one edition).\n\nURL: https://mariadb.com/kb/en/subqueries-and-joins/','','https://mariadb.com/kb/en/subqueries-and-joins/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (425,27,'Subquery Limitations','There are a number of limitations regarding subqueries, which are discussed\nbelow. The following tables and data will be used in the examples that follow:\n\nCREATE TABLE staff(name VARCHAR(10),age TINYINT);\n\nCREATE TABLE customer(name VARCHAR(10),age TINYINT);\n\nINSERT INTO staff VALUES \n(\'Bilhah\',37), (\'Valerius\',61), (\'Maia\',25);\n\nINSERT INTO customer VALUES \n(\'Thanasis\',48), (\'Valerius\',61), (\'Brion\',51);\n\nORDER BY and LIMIT\n------------------\n\nTo use ORDER BY or limit LIMIT in subqueries both must be used.. For example:\n\nSELECT * FROM staff WHERE name IN (SELECT name FROM customer ORDER BY name);\n+----------+------+\n| name     | age  |\n+----------+------+\n| Valerius |   61 |\n+----------+------+\n\nis valid, but\n\nSELECT * FROM staff WHERE name IN (SELECT NAME FROM customer ORDER BY name\nLIMIT 1);\nERROR 1235 (42000): This version of MariaDB doesn\'t \n yet support \'LIMIT & IN/ALL/ANY/SOME subquery\'\n\nis not.\n\nModifying and Selecting from the Same Table\n-------------------------------------------\n\nIt\'s not possible to both modify and select from the same table in a subquery.\nFor example:\n\nDELETE FROM staff WHERE name = (SELECT name FROM staff WHERE age=61);\nERROR 1093 (HY000): Table \'staff\' is specified twice, both \n as a target for \'DELETE\' and as a separate source for data\n\nRow Comparison Operations\n-------------------------\n\nThere is only partial support for row comparison operations. The expression in\n\nexpr op {ALL|ANY|SOME} subquery,\n\nmust be scalar and the subquery can only return a single column.\n\nHowever, because of the way IN is implemented (it is rewritten as a sequence\nof = comparisons and AND), the expression in\n\nexpression [NOT] IN subquery\n\nis permitted to be an n-tuple and the subquery can return rows of n-tuples.\n\nFor example:\n\nSELECT * FROM staff WHERE (name,age) NOT IN (\n SELECT name,age FROM customer WHERE age >=51]\n);\n+--------+------+\n| name   | age  |\n+--------+------+\n| Bilhah |   37 |\n| Maia   |   25 |\n+--------+------+\n\nis permitted, but\n\nSELECT * FROM staff WHERE (name,age) = ALL (\n SELECT name,age FROM customer WHERE age >=51\n);\nERROR 1241 (21000): Operand should contain 1 column(s)\n\nis not.\n\nCorrelated Subqueries\n---------------------\n\nSubqueries in the FROM clause cannot be correlated subqueries. They cannot be\nevaluated for each row of the outer query since they are evaluated to produce\na result set during when the query is executed.\n\nStored Functions\n----------------\n\nA subquery can refer to a stored function which modifies data. This is an\nextension to the SQL standard, but can result in indeterminate outcomes. For\nexample, take:\n\nSELECT ... WHERE x IN (SELECT f() ...);\n\nwhere f() inserts rows. The function f() could be executed a different number\nof times depending on how the optimizer chooses to handle the query.\n\nThis sort of construct is therefore not safe to use in replication that is not\nrow-based, as there could be different results on the master and the slave.\n\nURL: https://mariadb.com/kb/en/subquery-limitations/','','https://mariadb.com/kb/en/subquery-limitations/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (426,27,'UNION','UNION is used to combine the results from multiple SELECT statements into a\nsingle result set.\n\nSyntax\n------\n\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nUNION is used to combine the results from multiple SELECT statements into a\nsingle result set.\n\nThe column names from the first SELECT statement are used as the column names\nfor the results returned. Selected columns listed in corresponding positions\nof each SELECT statement should have the same data type. (For example, the\nfirst column selected by the first statement should have the same type as the\nfirst column selected by the other statements.)\n\nIf they don\'t, the type and length of the columns in the result take into\naccount the values returned by all of the SELECTs, so there is no need for\nexplicit casting. Note that currently this is not the case for recursive CTEs\n- see MDEV-12325.\n\nTable names can be specified as db_name.tbl_name. This permits writing UNIONs\nwhich involve multiple databases. See Identifier Qualifiers for syntax details.\n\nUNION queries cannot be used with aggregate functions.\n\nEXCEPT and UNION have the same operation precedence and INTERSECT has a higher\nprecedence, unless running in Oracle mode, in which case all three have the\nsame precedence.\n\nALL/DISTINCT\n------------\n\nThe ALL keyword causes duplicate rows to be preserved. The DISTINCT keyword\n(the default if the keyword is omitted) causes duplicate rows to be removed by\nthe results.\n\nUNION ALL and UNION DISTINCT can both be present in a query. In this case,\nUNION DISTINCT will override any UNION ALLs to its left.\n\nMariaDB starting with 10.1.1\n----------------------------\nUntil MariaDB 10.1.1, all UNION ALL statements required the server to create a\ntemporary table. Since MariaDB 10.1.1, the server can in most cases execute\nUNION ALL without creating a temporary table, improving performance (see\nMDEV-334).\n\nORDER BY and LIMIT\n------------------\n\nIndividual SELECTs can contain their own ORDER BY and LIMIT clauses. In this\ncase, the individual queries need to be wrapped between parentheses. However,\nthis does not affect the order of the UNION, so they only are useful to limit\nthe record read by one SELECT.\n\nThe UNION can have global ORDER BY and LIMIT clauses, which affect the whole\nresultset. If the columns retrieved by individual SELECT statements have an\nalias (AS), the ORDER BY must use that alias, not the real column names.\n\nHIGH_PRIORITY\n-------------\n\nSpecifying a query as HIGH_PRIORITY will not work inside a UNION. If applied\nto the first SELECT, it will be ignored. Applying to a later SELECT results in\na syntax error:\n\nERROR 1234 (42000): Incorrect usage/placement of \'HIGH_PRIORITY\'\n\nSELECT ... INTO ...\n-------------------\n\nIndividual SELECTs cannot be written INTO DUMPFILE or INTO OUTFILE. If the\nlast SELECT statement specifies INTO DUMPFILE or INTO OUTFILE, the entire\nresult of the UNION will be written. Placing the clause after any other SELECT\nwill result in a syntax error.\n\nIf the result is a single row, SELECT ... INTO @var_name can also be used.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nExamples\n--------\n\nUNION between tables having different column names:\n\n(SELECT e_name AS name, email FROM employees)\nUNION\n(SELECT c_name AS name, email FROM customers);\n\nSpecifying the UNION\'s global order and limiting total rows:\n\n(SELECT name, email FROM employees)\nUNION\n(SELECT name, email FROM customers)\nORDER BY name LIMIT 10;\n\nAdding a constant row:\n\n(SELECT \'John Doe\' AS name, \'john.doe@example.net\' AS email)\nUNION\n(SELECT name, email FROM customers);\n\nDiffering types:\n\nSELECT CAST(\'x\' AS CHAR(1)) UNION SELECT REPEAT(\'y\',4);\n+----------------------+\n| CAST(\'x\' AS CHAR(1)) |\n+----------------------+\n| x                    |\n| yyyy                 |\n+----------------------+\n\nReturning the results in order of each individual SELECT by use of a sort\ncolumn:\n\n(SELECT 1 AS sort_column, e_name AS name, email FROM employees)\nUNION\n(SELECT 2, c_name AS name, email FROM customers) ORDER BY sort_column;\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n|    3 |\n|    3 |\n|    3 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n|    3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3);\n+------+\n| a    |\n+------+\n|    1 |\n|    6 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3));\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    6 |\n+------+\n\nURL: https://mariadb.com/kb/en/union/','','https://mariadb.com/kb/en/union/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,27,'EXCEPT','MariaDB starting with 10.3.0\n----------------------------\nEXCEPT was introduced in MariaDB 10.3.0.\n\nThe result of EXCEPT is all records of the left SELECT result set except\nrecords which are in right SELECT result set, i.e. it is subtraction of two\nresult sets. From MariaDB 10.6.1, MINUS is a synonym.\n\nSyntax\n------\n\nSELECT ...\n(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...\n[(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...]\n[ORDER BY [{col_name | expr | position} [ASC | DESC] [, {col_name | expr |\nposition} [ASC | DESC] ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}\n| OFFSET start { ROW | ROWS }\n| FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES } ]\n\nPlease note:\n\n* Brackets for explicit operation precedence are not supported; use a subquery\nin the FROM clause as a workaround).\n\nDescription\n-----------\n\nMariaDB has supported EXCEPT and INTERSECT in addition to UNION since MariaDB\n10.3.\n\nThe queries before and after EXCEPT must be SELECT or VALUES statements.\n\nAll behavior for naming columns, ORDER BY and LIMIT is the same as for UNION.\nNote that the alternative SELECT ... OFFSET ... FETCH syntax is only\nsupported. This allows us to use the WITH TIES clause.\n\nEXCEPT implicitly supposes a DISTINCT operation.\n\nThe result of EXCEPT is all records of the left SELECT result except records\nwhich are in right SELECT result set, i.e. it is subtraction of two result\nsets.\n\nEXCEPT and UNION have the same operation precedence and INTERSECT has a higher\nprecedence, unless running in Oracle mode, in which case all three have the\nsame precedence.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nMariaDB starting with 10.5.0\n----------------------------\n\nALL/DISTINCT\n------------\n\nEXCEPT ALL and EXCEPT DISTINCT were introduced in MariaDB 10.5.0. The ALL\noperator leaves duplicates intact, while the DISTINCT operator removes\nduplicates. DISTINCT is the default behavior if neither operator is supplied,\nand the only behavior prior to MariaDB 10.5.\n\nExamples\n--------\n\nShow customers which are not employees:\n\n(SELECT e_name AS name, email FROM customers)\nEXCEPT\n(SELECT c_name AS name, email FROM employees);\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n|    3 |\n|    3 |\n|    3 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n|    3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) EXCEPT (SELECT c FROM t3);\n+------+\n| a    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) EXCEPT (SELECT c FROM t3));\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n+------+\n\nHere is an example that makes use of the SEQUENCE storage engine and the\nVALUES statement, to generate a numeric sequence and remove some arbitrary\nnumbers from it:\n\n(SELECT seq FROM seq_1_to_10) EXCEPT VALUES (2), (3), (4);\n+-----+\n| seq |\n+-----+\n|   1 |\n|   5 |\n|   6 |\n|   7 |\n|   8 |\n|   9 |\n|  10 |\n+-----+\n\nURL: https://mariadb.com/kb/en/except/','','https://mariadb.com/kb/en/except/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (428,27,'INTERSECT','MariaDB starting with 10.3.0\n----------------------------\nINTERSECT was introduced in MariaDB 10.3.0.\n\nThe result of an intersect is the intersection of right and left SELECT\nresults, i.e. only records that are present in both result sets will be\nincluded in the result of the operation.\n\nSyntax\n------\n\nSELECT ...\n(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...\n[(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nMariaDB has supported INTERSECT (as well as EXCEPT) in addition to UNION since\nMariaDB 10.3.\n\nAll behavior for naming columns, ORDER BY and LIMIT is the same as for UNION.\n\nINTERSECT implicitly supposes a DISTINCT operation.\n\nThe result of an intersect is the intersection of right and left SELECT\nresults, i.e. only records that are present in both result sets will be\nincluded in the result of the operation.\n\nINTERSECT has higher precedence than UNION and EXCEPT (unless running running\nin Oracle mode, in which case all three have the same precedence). If possible\nit will be executed linearly but if not it will be translated to a subquery in\nthe FROM clause:\n\n(select a,b from t1)\nunion\n(select c,d from t2)\nintersect\n(select e,f from t3)\nunion\n(select 4,4);\n\nwill be translated to:\n\n(select a,b from t1)\nunion\nselect c,d from\n ((select c,d from t2)\n intersect\n (select e,f from t3)) dummy_subselect\nunion\n(select 4,4)\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nMariaDB starting with 10.5.0\n----------------------------\n\nALL/DISTINCT\n------------\n\nINTERSECT ALL and INTERSECT DISTINCT were introduced in MariaDB 10.5.0. The\nALL operator leaves duplicates intact, while the DISTINCT operator removes\nduplicates. DISTINCT is the default behavior if neither operator is supplied,\nand the only behavior prior to MariaDB 10.5.\n\nExamples\n--------\n\nShow customers which are employees:\n\n(SELECT e_name AS name, email FROM employees)\nINTERSECT\n(SELECT c_name AS name, email FROM customers);\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n|    3 |\n|    3 |\n|    3 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n|    3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3);\n+------+\n| a    |\n+------+\n|    1 |\n|    6 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3));\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    6 |\n+------+\n\nURL: https://mariadb.com/kb/en/intersect/','','https://mariadb.com/kb/en/intersect/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (429,27,'Precedence Control in Table Operations','MariaDB starting with 10.4.0\n----------------------------\nBeginning in MariaDB 10.4, you can control the ordering of execution on table\noperations using parentheses.\n\nSyntax\n------\n\n(  expression )\n[ORDER BY [column[, column...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nUsing parentheses in your SQL allows you to control the order of execution for\nSELECT statements and Table Value Constructor, including UNION, EXCEPT, and\nINTERSECT operations. MariaDB executes the parenthetical expression before the\nrest of the statement. You can then use ORDER BY and LIMIT clauses the further\norganize the result-set.\n\nNote: In practice, the Optimizer may rearrange the exact order in which\nMariaDB executes different parts of the statement. When it calculates the\nresult-set, however, it returns values as though the parenthetical expression\nwere executed first.\n\nExample\n-------\n\nCREATE TABLE test.t1 (num INT);\n\nINSERT INTO test.t1 VALUES (1),(2),(3);\n\n(SELECT * FROM test.t1 \n UNION \n VALUES (10)) \nINTERSECT \nVALUES (1),(3),(10),(11);\n+------+\n| num  |\n+------+\n|    1 |\n|    3 |\n|   10 |\n+------+\n\n((SELECT * FROM test.t1 \n UNION\n VALUES (10))\n INTERSECT \n VALUES (1),(3),(10),(11)) \nORDER BY 1 DESC;\n+------+\n| num  |\n+------+\n|   10 |\n|    3 |\n|    1 |\n+------+\n\nURL: https://mariadb.com/kb/en/precedence-control-in-table-operations/','','https://mariadb.com/kb/en/precedence-control-in-table-operations/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (430,27,'LIMIT','Description\n-----------\n\nUse the LIMIT clause to restrict the number of returned rows. When you use a\nsingle integer n with LIMIT, the first n rows will be returned. Use the ORDER\nBY clause to control which rows come first. You can also select a number of\nrows after an offset using either of the following:\n\nLIMIT offset, row_count\nLIMIT row_count OFFSET offset\n\nWhen you provide an offset m with a limit n, the first m rows will be ignored,\nand the following n rows will be returned.\n\nExecuting an UPDATE with the LIMIT clause is not safe for replication. LIMIT 0\nis an exception to this rule (see MDEV-6170).\n\nThere is a LIMIT ROWS EXAMINED optimization which provides the means to\nterminate the execution of SELECT statements which examine too many rows, and\nthus use too many resources. See LIMIT ROWS EXAMINED.\n\nMulti-Table Updates\n-------------------\n\nMariaDB starting with 10.3.2\n----------------------------\nUntil MariaDB 10.3.1, it was not possible to use LIMIT (or ORDER BY) in a\nmulti-table UPDATE statement. This restriction was lifted in MariaDB 10.3.2.\n\nGROUP_CONCAT\n------------\n\nMariaDB starting with 10.3.2\n----------------------------\nStarting from MariaDB 10.3.3, it is possible to use LIMIT with GROUP_CONCAT().\n\nExamples\n--------\n\nCREATE TABLE members (name VARCHAR(20));\nINSERT INTO members VALUES(\'Jagdish\'),(\'Kenny\'),(\'Rokurou\'),(\'Immaculada\');\n\nSELECT * FROM members;\n+------------+\n| name       |\n+------------+\n| Jagdish    |\n| Kenny      |\n| Rokurou    |\n| Immaculada |\n+------------+\n\nSelect the first two names (no ordering specified):\n\nSELECT * FROM members LIMIT 2;\n+---------+\n| name    |\n+---------+\n| Jagdish |\n| Kenny   |\n+---------+\n\nAll the names in alphabetical order:\n\nSELECT * FROM members ORDER BY name;\n+------------+\n| name       |\n+------------+\n| Immaculada |\n| Jagdish    |\n| Kenny      |\n| Rokurou    |\n+------------+\n\nThe first two names, ordered alphabetically:\n\nSELECT * FROM members ORDER BY name LIMIT 2;\n+------------+\n| name       |\n+------------+\n| Immaculada |\n| Jagdish    |\n+------------+\n\nThe third name, ordered alphabetically (the first name would be offset zero,\nso the third is offset two):\n\nSELECT * FROM members ORDER BY name LIMIT 2,1;\n+-------+\n| name  |\n+-------+\n| Kenny |\n+-------+\n\nFrom MariaDB 10.3.2, LIMIT can be used in a multi-table update:\n\nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES (1,100),(2,100),(3,100),(4,100);\n\nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n\nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2, store.qty =\nstore.qty+2 \n WHERE (warehouse.product_id = store.product_id AND store.product_id  >= 1)\n  ORDER BY store.product_id DESC LIMIT 2;\n\nSELECT * FROM warehouse;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |  100 |\n|          2 |  100 |\n|          3 |   98 |\n|          4 |   98 |\n+------------+------+\n\nSELECT * FROM store;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |    5 |\n|          2 |    5 |\n|          3 |    7 |\n|          4 |    7 |\n+------------+------+\n\nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT, so, for example,\ngiven the following table:\n\nCREATE TABLE d (dd DATE, cc INT);\n\nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n\nthe following query:\n\nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc\nDESC),\",\",1) FROM d;\n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC),\",\",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3                                                               |\n+----------------------------------------------------------------------------+\n\ncan be more simply rewritten as:\n\nSELECT GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) FROM d;\n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3                                                |\n+-------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/limit/','','https://mariadb.com/kb/en/limit/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (431,27,'ORDER BY','Description\n-----------\n\nUse the ORDER BY clause to order a resultset, such as that are returned from a\nSELECT statement. You can specify just a column or use any expression with\nfunctions. If you are using the GROUP BY clause, you can use grouping\nfunctions in ORDER BY. Ordering is done after grouping.\n\nYou can use multiple ordering expressions, separated by commas. Rows will be\nsorted by the first expression, then by the second expression if they have the\nsame value for the first, and so on.\n\nYou can use the keywords ASC and DESC after each ordering expression to force\nthat ordering to be ascending or descending, respectively. Ordering is\nascending by default.\n\nYou can also use a single integer as the ordering expression. If you use an\ninteger n, the results will be ordered by the nth column in the select\nexpression.\n\nWhen string values are compared, they are compared as if by the STRCMP\nfunction. STRCMP ignores trailing whitespace and may normalize characters and\nignore case, depending on the collation in use.\n\nDuplicated entries in the ORDER BY clause are removed.\n\nORDER BY can also be used to order the activities of a DELETE or UPDATE\nstatement (usually with the LIMIT clause).\n\nMariaDB starting with 10.3.2\n----------------------------\nUntil MariaDB 10.3.1, it was not possible to use ORDER BY (or LIMIT) in a\nmulti-table UPDATE statement. This restriction was lifted in MariaDB 10.3.2.\n\nMariaDB starting with 10.5\n--------------------------\nFrom MariaDB 10.5, MariaDB allows packed sort keys and values of non-sorted\nfields in the sort buffer. This can make filesort temporary files much smaller\nwhen VARCHAR, CHAR or BLOBs are used, notably speeding up some ORDER BY sorts.\n\nExamples\n--------\n\nCREATE TABLE seq (i INT, x VARCHAR(1));\nINSERT INTO seq VALUES (1,\'a\'), (2,\'b\'), (3,\'b\'), (4,\'f\'), (5,\'e\');\n\nSELECT * FROM seq ORDER BY i;\n+------+------+\n| i    | x    |\n+------+------+\n|    1 | a    |\n|    2 | b    |\n|    3 | b    |\n|    4 | f    |\n|    5 | e    |\n+------+------+\n\nSELECT * FROM seq ORDER BY i DESC;\n+------+------+\n| i    | x    |\n+------+------+\n|    5 | e    |\n|    4 | f    |\n|    3 | b    |\n|    2 | b    |\n|    1 | a    |\n+------+------+\n\nSELECT * FROM seq ORDER BY x,i;\n+------+------+\n| i    | x    |\n+------+------+\n|    1 | a    |\n|    2 | b    |\n|    3 | b    |\n|    5 | e    |\n|    4 | f    |\n+------+------+\n\nORDER BY in an UPDATE statement, in conjunction with LIMIT:\n\nUPDATE seq SET x=\'z\' WHERE x=\'b\' ORDER BY i DESC LIMIT 1;\n\nSELECT * FROM seq;\n+------+------+\n| i    | x    |\n+------+------+\n|    1 | a    |\n|    2 | b    |\n|    3 | z    |\n|    4 | f    |\n|    5 | e    |\n+------+------+\n\nFrom MariaDB 10.3.2, ORDER BY can be used in a multi-table update:\n\nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES (1,100),(2,100),(3,100),(4,100);\n\nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n\nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2, store.qty =\nstore.qty+2 \n WHERE (warehouse.product_id = store.product_id AND store.product_id  >= 1)\n  ORDER BY store.product_id DESC LIMIT 2;\n\nSELECT * FROM warehouse;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |  100 |\n|          2 |  100 |\n|          3 |   98 |\n|          4 |   98 |\n+------------+------+\n\nSELECT * FROM store;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |    5 |\n|          2 |    5 |\n|          3 |    7 |\n|          4 |    7 |\n+------------+------+\n\nURL: https://mariadb.com/kb/en/order-by/','','https://mariadb.com/kb/en/order-by/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,27,'GROUP BY','Use the GROUP BY clause in a SELECT statement to group rows together that have\nthe same value in one or more column, or the same computed value using\nexpressions with any functions and operators except grouping functions. When\nyou use a GROUP BY clause, you will get a single result row for each group of\nrows that have the same value for the expression given in GROUP BY.\n\nWhen grouping rows, grouping values are compared as if by the = operator. For\nstring values, the = operator ignores trailing whitespace and may normalize\ncharacters and ignore case, depending on the collation in use.\n\nYou can use any of the grouping functions in your select expression. Their\nvalues will be calculated based on all the rows that have been grouped\ntogether for each result row. If you select a non-grouped column or a value\ncomputed from a non-grouped column, it is undefined which row the returned\nvalue is taken from. This is not permitted if the ONLY_FULL_GROUP_BY SQL_MODE\nis used.\n\nYou can use multiple expressions in the GROUP BY clause, separated by commas.\nRows are grouped together if they match on each of the expressions.\n\nYou can also use a single integer as the grouping expression. If you use an\ninteger n, the results will be grouped by the nth column in the select\nexpression.\n\nThe WHERE clause is applied before the GROUP BY clause. It filters\nnon-aggregated rows before the rows are grouped together. To filter grouped\nrows based on aggregate values, use the HAVING clause. The HAVING clause takes\nany expression and evaluates it as a boolean, just like the WHERE clause. You\ncan use grouping functions in the HAVING clause. As with the select\nexpression, if you reference non-grouped columns in the HAVING clause, the\nbehavior is undefined.\n\nBy default, if a GROUP BY clause is present, the rows in the output will be\nsorted by the expressions used in the GROUP BY. You can also specify ASC or\nDESC (ascending, descending) after those expressions, like in ORDER BY. The\ndefault is ASC.\n\nIf you want the rows to be sorted by another field, you can add an explicit\nORDER BY. If you don\'t want the result to be ordered, you can add ORDER BY\nNULL.\n\nWITH ROLLUP\n-----------\n\nThe WITH ROLLUP modifer adds extra rows to the resultset that represent\nsuper-aggregate summaries. For a full description with examples, see SELECT\nWITH ROLLUP.\n\nGROUP BY Examples\n-----------------\n\nConsider the following table that records how many times each user has played\nand won a game:\n\nCREATE TABLE plays (name VARCHAR(16), plays INT, wins INT);\nINSERT INTO plays VALUES \n (\"John\", 20, 5),\n (\"Robert\", 22, 8),\n (\"Wanda\", 32, 8),\n (\"Susan\", 17, 3);\n\nGet a list of win counts along with a count:\n\nSELECT wins, COUNT(*) FROM plays GROUP BY wins;\n+------+----------+\n| wins | COUNT(*) |\n+------+----------+\n|    3 |        1 |\n|    5 |        1 |\n|    8 |        2 |\n+------+----------+\n3 rows in set (0.00 sec)\n\nThe GROUP BY expression can be a computed value, and can refer back to an\nidentifer specified with AS. Get a list of win averages along with a count:\n\nSELECT (wins / plays) AS winavg, COUNT(*) FROM plays GROUP BY winavg;\n+--------+----------+\n| winavg | COUNT(*) |\n+--------+----------+\n| 0.1765 |        1 |\n| 0.2500 |        2 |\n| 0.3636 |        1 |\n+--------+----------+\n3 rows in set (0.00 sec)\n\nYou can use any grouping function in the select expression. For each win\naverage as above, get a list of the average play count taken to get that\naverage:\n\nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg;\n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.1765 |    17.0000 |\n| 0.2500 |    26.0000 |\n| 0.3636 |    22.0000 |\n+--------+------------+\n3 rows in set (0.00 sec)\n\nYou can filter on aggregate information using the HAVING clause. The HAVING\nclause is applied after GROUP BY and allows you to filter on aggregate data\nthat is not available to the WHERE clause. Restrict the above example to\nresults that involve an average number of plays over 20:\n\nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg HAVING AVG(plays) > 20;\n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.2500 |    26.0000 |\n| 0.3636 |    22.0000 |\n+--------+------------+\n2 rows in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/group-by/','','https://mariadb.com/kb/en/group-by/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (433,27,'WITH','MariaDB starting with 10.2.1\n----------------------------\nCommon Table Expressions were introduced in MariaDB 10.2.1.\n\nSyntax\n------\n\nWITH [RECURSIVE] table_reference [(columns_list)] AS  (\n SELECT ...\n)\n[CYCLE cycle_column_list RESTRICT]\nSELECT ...\n\nDescription\n-----------\n\nThe WITH keyword signifies a Common Table Expression (CTE). It allows you to\nrefer to a subquery expression many times in a query, as if having a temporary\ntable that only exists for the duration of a query.\n\nThere are two kinds of CTEs:\n\n* Non-Recursive\n* Recursive (signified by the RECURSIVE keyword, supported since MariaDB\n10.2.2)\n\nYou can use table_reference as any normal table in the external SELECT part.\nYou can also use WITH in subqueries, as well as with EXPLAIN and SELECT.\n\nPoorly-formed recursive CTEs can in theory cause infinite loops. The\nmax_recursive_iterations system variable limits the number of recursions.\n\nCYCLE ... RESTRICT\n------------------\n\nMariaDB starting with 10.5.2\n----------------------------\nThe CYCLE clause enables CTE cycle detection, avoiding excessive or infinite\nloops, MariaDB supports a relaxed, non-standard grammar.\n\nThe SQL Standard permits a CYCLE clause, as follows:\n\nWITH RECURSIVE ... (\n ...\n)\nCYCLE <cycle column list>\nSET <cycle mark column> TO <cycle mark value> DEFAULT <non-cycle mark value>\nUSING <path column>\n\nwhere all clauses are mandatory.\n\nMariaDB does not support this, but from 10.5.2 permits a non-standard relaxed\ngrammar, as follows:\n\nWITH RECURSIVE ... (\n ...\n)\nCYCLE <cycle column list> RESTRICT\n\nWith the use of CYCLE ... RESTRICT it makes no difference whether the CTE uses\nUNION ALL or UNION DISTINCT anymore. UNION ALL means \"all rows, but without\ncycles\", which is exactly what the CYCLE clause enables. And UNION DISTINCT\nmeans all rows should be different, which, again, is what will happen — as\nuniqueness is enforced over a subset of columns, complete rows will\nautomatically all be different.\n\nExamples\n--------\n\nBelow is an example with the WITH at the top level:\n\nWITH t AS (SELECT a FROM t1 WHERE b >= \'c\') \n SELECT * FROM t2, t WHERE t2.c = t.a;\n\nThe example below uses WITH in a subquery:\n\nSELECT t1.a, t1.b FROM t1, t2\n WHERE t1.a > t2.c\n  AND t2.c IN(WITH t AS (SELECT * FROM t1 WHERE t1.a < 5)\n        SELECT t2.c FROM t2, t WHERE t2.c = t.a);\n\nBelow is an example of a Recursive CTE:\n\nWITH RECURSIVE ancestors AS \n ( SELECT * FROM folks\n WHERE name=\"Alex\"\n UNION\n SELECT f.*\n FROM folks AS f, ancestors AS a\n WHERE f.id = a.father OR f.id = a.mother )\nSELECT * FROM ancestors;\n\nTake the following structure, and data,\n\nCREATE TABLE t1 (from_ int, to_ int);\nINSERT INTO t1 VALUES (1,2), (1,100), (2,3), (3,4), (4,1);\nSELECT * FROM t1;\n+-------+------+\n| from_ | to_  |\n+-------+------+\n|     1 |    2 |\n|     1 |  100 |\n|     2 |    3 |\n|     3 |    4 |\n|     4 |    1 |\n+-------+------+\n\nGiven the above, the following query would theoretically result in an infinite\nloop due to the last record in t1 (note that max_recursive_iterations is set\nto 10 for the purposes of this example, to avoid the excessive number of\ncycles):\n\nSET max_recursive_iterations=10;\n\nWITH RECURSIVE cte (depth, from_, to_) AS ( \n SELECT 0,1,1 UNION DISTINCT SELECT depth+1, t1.from_, t1.to_\n  FROM t1, cte  WHERE t1.from_ = cte.to_\n) \nSELECT * FROM cte;\n+-------+-------+------+\n| depth | from_ | to_  |\n+-------+-------+------+\n|     0 |     1 |    1 |\n|     1 |     1 |    2 |\n|     1 |     1 |  100 |\n|     2 |     2 |    3 |\n|     3 |     3 |    4 |\n|     4 |     4 |    1 |\n|     5 |     1 |    2 |\n|     5 |     1 |  100 |\n|     6 |     2 |    3 |\n|     7 |     3 |    4 |\n|     8 |     4 |    1 |\n|     9 |     1 |    2 |\n|     9 |     1 |  100 |\n|    10 |     2 |    3 |\n+-------+-------+------+\n\nHowever, the CYCLE ... RESTRICT clause (from MariaDB 10.5.2) can overcome this:\n\nWITH RECURSIVE cte (depth, from_, to_) AS ( \n SELECT 0,1,1 UNION SELECT depth+1, t1.from_, t1.to_\n  FROM t1, cte WHERE t1.from_ = cte.to_\n) \nCYCLE from_, to_ RESTRICT \nSELECT * FROM cte;\n+-------+-------+------+\n| depth | from_ | to_  |\n+-------+-------+------+\n|     0 |     1 |    1 |\n|     1 |     1 |    2 |\n|     1 |     1 |  100 |\n|     2 |     2 |    3 |\n|     3 |     3 |    4 |\n|     4 |     4 |    1 |\n+-------+-------+------+\n\nURL: https://mariadb.com/kb/en/with/','','https://mariadb.com/kb/en/with/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (434,27,'Non-Recursive Common Table Expressions Overview','Common Table Expressions (CTEs) are a standard SQL feature, and are\nessentially temporary named result sets. There are two kinds of CTEs:\nNon-Recursive, which this article covers; and Recursive.\n\nMariaDB starting with 10.2.1\n----------------------------\nCommon table expressions were introduced in MariaDB 10.2.1.\n\nNon-Recursive CTEs\n------------------\n\nThe WITH keyword signifies a CTE. It is given a name, followed by a body (the\nmain query) as follows:\n\nCTEs are similar to derived tables. For example\n\nWITH engineers AS \n ( SELECT * FROM employees\n  WHERE dept = \'Engineering\' )\n\nSELECT * FROM engineers\nWHERE ...\n\nSELECT * FROM\n ( SELECT * FROM employees\n  WHERE dept = \'Engineering\' ) AS engineers\nWHERE\n...\n\nA non-recursive CTE is basically a query-local VIEW. There are several\nadvantages and caveats to them. The syntax is more readable than nested FROM\n(SELECT ...). A CTE can refer to another and it can be referenced from\nmultiple places.\n\nA CTE referencing Another CTE\n-----------------------------\n\nUsing this format makes for a more readable SQL than a nested FROM(SELECT ...)\nclause. Below is an example of this:\n\nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') ),\neu_engineers AS ( SELECT * FROM engineers WHERE country IN(\'NL\',...) )\nSELECT\n...\nFROM eu_engineers;\n\nMultiple Uses of a CTE\n----------------------\n\nThis can be an \'anti-self join\', for example:\n\nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') )\n\nSELECT * FROM engineers E1\nWHERE NOT EXISTS\n (SELECT 1 FROM engineers E2\n  WHERE E2.country=E1.country\n  AND E2.name <> E1.name );\n\nOr, for year-over-year comparisons, for example:\n\nWITH sales_product_year AS (\nSELECT product, YEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year )\n\nSELECT *\nFROM sales_product_year CUR,\nsales_product_year PREV,\nWHERE CUR.product=PREV.product \nAND  CUR.year=PREV.year + 1 \nAND CUR.total_amt > PREV.total_amt\n\nAnother use is to compare individuals against their group. Below is an example\nof how this might be executed:\n\nWITH sales_product_year AS (\nSELECT product,\nYEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year\n)\n\nSELECT * \nFROM sales_product_year S1\nWHERE\ntotal_amt > \n  (SELECT 0.1 * SUM(total_amt)\n  FROM sales_product_year S2\n  WHERE S2.year = S1.year)\n\nURL: https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,27,'Recursive Common Table Expressions Overview','MariaDB starting with 10.2.2\n----------------------------\nRecursive Common Table Expressions have been supported since MariaDB 10.2.2.\n\nCommon Table Expressions (CTEs) are a standard SQL feature, and are\nessentially temporary named result sets. CTEs first appeared in the SQL\nstandard in 1999, and the first implementations began appearing in 2007.\n\nThere are two kinds of CTEs:\n\n* Non-recursive\n* Recursive, which this article covers.\n\nSQL is generally poor at recursive structures.\n\nCTEs permit a query to reference itself. A recursive CTE will repeatedly\nexecute subsets of the data until it obtains the complete result set. This\nmakes it particularly useful for handing hierarchical or tree-structured data.\nmax_recursive_iterations avoids infinite loops.\n\nSyntax example\n--------------\n\nWITH RECURSIVE signifies a recursive CTE. It is given a name, followed by a\nbody (the main query) as follows:\n\nComputation\n-----------\n\nGiven the following structure:\n\nFirst execute the anchor part of the query:\n\nNext, execute the recursive part of the query:\n\nSummary so far\n--------------\n\nwith recursive R as (\n select anchor_data\n union [all]\n select recursive_part\n from R, ...\n)\nselect ...\n\n* Compute anchor_data\n* Compute recursive_part to get the new data\n* if (new data is non-empty) goto 2;\n\nCAST to avoid truncating data\n-----------------------------\n\nAs currently implemented by MariaDB and by the SQL Standard, data may be\ntruncated if not correctly cast. It is necessary to CAST the column to the\ncorrect width if the CTE\'s recursive part produces wider values for a column\nthan the CTE\'s nonrecursive part. Some other DBMS give an error in this\nsituation, and MariaDB\'s behavior may change in future - see MDEV-12325. See\nthe examples below.\n\nExamples\n--------\n\nTransitive closure - determining bus destinations\n-------------------------------------------------\n\nSample data:\n\nCREATE TABLE bus_routes (origin varchar(50), dst varchar(50));\nINSERT INTO bus_routes VALUES \n (\'New York\', \'Boston\'),\n (\'Boston\', \'New York\'),\n (\'New York\', \'Washington\'),\n (\'Washington\', \'Boston\'),\n (\'Washington\', \'Raleigh\');\n\nNow, we want to return the bus destinations with New York as the origin:\n\nWITH RECURSIVE bus_dst as ( \n  SELECT origin as dst FROM bus_routes WHERE origin=\'New York\'\n UNION\n  SELECT bus_routes.dst FROM bus_routes JOIN bus_dst ON bus_dst.dst=\nbus_routes.origin \n) \nSELECT * FROM bus_dst;\n+------------+\n| dst        |\n+------------+\n| New York   |\n| Boston     |\n| Washington |\n| Raleigh    |\n+------------+\n\nThe above example is computed as follows:\n\nFirst, the anchor data is calculated:\n\n* Starting from New York\n* Boston and Washington are added\n\nNext, the recursive part:\n\n* Starting from Boston and then Washington\n* Raleigh is added\n* UNION excludes nodes that are already present.\n\nComputing paths - determining bus routes\n----------------------------------------\n\nThis time, we are trying to get bus routes such as \"New York -> Washington ->\nRaleigh\".\n\nUsing the same sample data as the previous example:\n\nWITH RECURSIVE paths (cur_path, cur_dest) AS (\n  SELECT origin, origin FROM bus_routes WHERE origin=\'New York\'\n UNION\n  SELECT CONCAT(paths.cur_path, \',\', bus_routes.dst), bus_routes.dst\n  FROM paths\n  JOIN bus_routes\n   ON paths.cur_dest = bus_routes.origin AND\n    NOT FIND_IN_SET(bus_routes.dst, paths.cur_path)\n) \nSELECT * FROM paths;\n+-----------------------------+------------+\n| cur_path                    | cur_dest   |\n+-----------------------------+------------+\n| New York                    | New York   |\n| New York,Boston             | Boston     |\n| New York,Washington         | Washington |\n| New York,Washington,Boston  | Boston     |\n| New York,Washington,Raleigh | Raleigh    |\n+-----------------------------+------------+\n\nCAST to avoid data truncation\n-----------------------------\n\nIn the following example, data is truncated because the results are not\nspecifically cast to a wide enough type:\n\nWITH RECURSIVE tbl AS (\n SELECT NULL AS col\n UNION\n SELECT \"THIS NEVER SHOWS UP\" AS col FROM tbl\n)\nSELECT col FROM tbl\n+------+\n| col  |\n+------+\n| NULL |\n|      |\n+------+\n\nExplicitly use CAST to overcome this:\n\nWITH RECURSIVE tbl AS (\n SELECT CAST(NULL AS CHAR(50)) AS col\n UNION SELECT \"THIS NEVER SHOWS UP\" AS col FROM tbl\n)  \nSELECT * FROM tbl;\n+---------------------+\n| col                 |\n+---------------------+\n| NULL                |\n| THIS NEVER SHOWS UP |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/recursive-common-table-expressions-overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (436,27,'SELECT WITH ROLLUP','Syntax\n------\n\nSee SELECT for the full syntax.\n\nDescription\n-----------\n\nThe WITH ROLLUP modifier adds extra rows to the resultset that represent\nsuper-aggregate summaries. The super-aggregated column is represented by a\nNULL value. Multiple aggregates over different columns will be added if there\nare multiple GROUP BY columns.\n\nThe LIMIT clause can be used at the same time, and is applied after the WITH\nROLLUP rows have been added.\n\nWITH ROLLUP cannot be used with ORDER BY. Some sorting is still possible by\nusing ASC or DESC clauses with the GROUP BY column, although the\nsuper-aggregate rows will always be added last.\n\nExamples\n--------\n\nThese examples use the following sample table\n\nCREATE TABLE booksales ( \n country VARCHAR(35), genre ENUM(\'fiction\',\'non-fiction\'), year YEAR, sales\nINT);\n\nINSERT INTO booksales VALUES\n (\'Senegal\',\'fiction\',2014,12234), (\'Senegal\',\'fiction\',2015,15647),\n (\'Senegal\',\'non-fiction\',2014,64980), (\'Senegal\',\'non-fiction\',2015,78901),\n (\'Paraguay\',\'fiction\',2014,87970), (\'Paraguay\',\'fiction\',2015,76940),\n (\'Paraguay\',\'non-fiction\',2014,8760), (\'Paraguay\',\'non-fiction\',2015,9030);\n\nThe addition of the WITH ROLLUP modifier in this example adds an extra row\nthat aggregates both years:\n\nSELECT year, SUM(sales) FROM booksales GROUP BY year;\n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 |     173944 |\n| 2015 |     180518 |\n+------+------------+\n2 rows in set (0.08 sec)\n\nSELECT year, SUM(sales) FROM booksales GROUP BY year WITH ROLLUP;\n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 |     173944 |\n| 2015 |     180518 |\n| NULL |     354462 |\n+------+------------+\n\nIn the following example, each time the genre, the year or the country change,\nanother super-aggregate row is added:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2015 | fiction     |      76940 |\n| Paraguay | 2015 | non-fiction |       9030 |\n| Senegal  | 2014 | fiction     |      12234 |\n| Senegal  | 2014 | non-fiction |      64980 |\n| Senegal  | 2015 | fiction     |      15647 |\n| Senegal  | 2015 | non-fiction |      78901 |\n+----------+------+-------------+------------+\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2014 | NULL        |      96730 |\n| Paraguay | 2015 | fiction     |      76940 |\n| Paraguay | 2015 | non-fiction |       9030 |\n| Paraguay | 2015 | NULL        |      85970 |\n| Paraguay | NULL | NULL        |     182700 |\n| Senegal  | 2014 | fiction     |      12234 |\n| Senegal  | 2014 | non-fiction |      64980 |\n| Senegal  | 2014 | NULL        |      77214 |\n| Senegal  | 2015 | fiction     |      15647 |\n| Senegal  | 2015 | non-fiction |      78901 |\n| Senegal  | 2015 | NULL        |      94548 |\n| Senegal  | NULL | NULL        |     171762 |\n| NULL     | NULL | NULL        |     354462 |\n+----------+------+-------------+------------+\n\nThe LIMIT clause, applied after WITH ROLLUP:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP LIMIT 4;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2014 | NULL        |      96730 |\n| Paraguay | 2015 | fiction     |      76940 |\n+----------+------+-------------+------------+\n\nSorting by year descending:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year DESC, genre WITH ROLLUP;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2015 | fiction     |      76940 |\n| Paraguay | 2015 | non-fiction |       9030 |\n| Paraguay | 2015 | NULL        |      85970 |\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2014 | NULL        |      96730 |\n| Paraguay | NULL | NULL        |     182700 |\n| Senegal  | 2015 | fiction     |      15647 |\n| Senegal  | 2015 | non-fiction |      78901 |\n| Senegal  | 2015 | NULL        |      94548 |\n| Senegal  | 2014 | fiction     |      12234 |\n| Senegal  | 2014 | non-fiction |      64980 |\n| Senegal  | 2014 | NULL        |      77214 |\n| Senegal  | NULL | NULL        |     171762 |\n| NULL     | NULL | NULL        |     354462 |\n+----------+------+-------------+------------+\n\nURL: https://mariadb.com/kb/en/select-with-rollup/','','https://mariadb.com/kb/en/select-with-rollup/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,27,'SELECT INTO OUTFILE','Syntax\n------\n\nSELECT ... INTO OUTFILE \'file_name\'\n    [CHARACTER SET charset_name]\n    [export_options]\n\nexport_options:\n  [{FIELDS | COLUMNS}\n    [TERMINATED BY \'string\']\n    [[OPTIONALLY] ENCLOSED BY \'char\']\n    [ESCAPED BY \'char\']\n  ]\n  [LINES\n    [STARTING BY \'string\']\n    [TERMINATED BY \'string\']\n  ]\n\nDescription\n-----------\n\nSELECT INTO OUTFILE writes the resulting rows to a file, and allows the use of\ncolumn and row terminators to specify a particular output format. The default\nis to terminate fields with tabs (\\t) and lines with newlines (\\n).\n\nThe file must not exist. It cannot be overwritten. A user needs the FILE\nprivilege to run this statement. Also, MariaDB needs permission to write files\nin the specified location. If the secure_file_priv system variable is set to a\nnon-empty directory name, the file can only be written to that directory.\n\nThe LOAD DATA INFILE statement complements SELECT INTO OUTFILE.\n\nCharacter-sets\n--------------\n\nThe CHARACTER SET clause specifies the character set in which the results are\nto be written. Without the clause, no conversion takes place (the binary\ncharacter set). In this case, if there are multiple character sets, the output\nwill contain these too, and may not easily be able to be reloaded.\n\nIn cases where you have two servers using different character-sets, using\nSELECT INTO OUTFILE to transfer data from one to the other can have unexpected\nresults. To ensure that MariaDB correctly interprets the escape sequences, use\nthe CHARACTER SET clause on both the SELECT INTO OUTFILE statement and the\nsubsequent LOAD DATA INFILE statement.\n\nExample\n-------\n\nThe following example produces a file in the CSV format:\n\nSELECT customer_id, firstname, surname from customer\n INTO OUTFILE \'/exportdata/customers.txt\'\n FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\"\'\n LINES TERMINATED BY \'\\n\';\n\nThe following ANSI syntax is also supported for simple SELECT without UNION\n\nSELECT customer_id, firstname, surname INTO OUTFILE \'/exportdata/customers.txt\'\n FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\"\'\n LINES TERMINATED BY \'\\n\'\n FROM customers;\n\nIf you want to use the ANSI syntax with UNION or similar construct you have to\nuse the syntax:\n\nSELECT  * INTO OUTFILE \"/tmp/skr3\" FROM (SELECT * FROM t1 UNION SELECT * FROM\nt1);\n\nURL: https://mariadb.com/kb/en/select-into-outfile/','','https://mariadb.com/kb/en/select-into-outfile/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (438,27,'SELECT INTO DUMPFILE','Syntax\n------\n\nSELECT ... INTO DUMPFILE \'file_path\'\n\nDescription\n-----------\n\nSELECT ... INTO DUMPFILE is a SELECT clause which writes the resultset into a\nsingle unformatted row, without any separators, in a file. The results will\nnot be returned to the client.\n\nfile_path can be an absolute path, or a relative path starting from the data\ndirectory. It can only be specified as a string literal, not as a variable.\nHowever, the statement can be dynamically composed and executed as a prepared\nstatement to work around this limitation.\n\nThis statement is binary-safe and so is particularly useful for writing BLOB\nvalues to file. It can be used, for example, to copy an image or an audio\ndocument from the database to a file. SELECT ... INTO FILE can be used to save\na text file.\n\nThe file must not exist. It cannot be overwritten. A user needs the FILE\nprivilege to run this statement. Also, MariaDB needs permission to write files\nin the specified location. If the secure_file_priv system variable is set to a\nnon-empty directory name, the file can only be written to that directory.\n\nSince MariaDB 5.1, the character_set_filesystem system variable has controlled\ninterpretation of file names that are given as literal strings.\n\nExample\n-------\n\nSELECT _utf8\'Hello world!\' INTO DUMPFILE \'/tmp/world\';\n\nSELECT LOAD_FILE(\'/tmp/world\') AS world;\n+--------------+\n| world        |\n+--------------+\n| Hello world! |\n+--------------+\n\nURL: https://mariadb.com/kb/en/select-into-dumpfile/','','https://mariadb.com/kb/en/select-into-dumpfile/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (439,27,'FOR UPDATE','InnoDB supports row-level locking. Selected rows can be locked using LOCK IN\nSHARE MODE or FOR UPDATE. In both cases, a lock is acquired on the rows read\nby the query, and it will be released when the current transaction is\ncommitted.\n\nThe FOR UPDATE clause of SELECT applies only when autocommit is set to 0 or\nthe SELECT is enclosed in a transaction. A lock is acquired on the rows, and\nother transactions are prevented from writing the rows, acquire locks, and\nfrom reading them (unless their isolation level is READ UNCOMMITTED).\n\nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR UPDATE clauses have\nno effect.\n\nIf the isolation level is set to SERIALIZABLE, all plain SELECT statements are\nconverted to SELECT ... LOCK IN SHARE MODE.\n\nExample\n-------\n\nSELECT * FROM trans WHERE period=2001 FOR UPDATE;\n\nURL: https://mariadb.com/kb/en/for-update/','','https://mariadb.com/kb/en/for-update/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (440,27,'LOCK IN SHARE MODE','InnoDB supports row-level locking. Selected rows can be locked using LOCK IN\nSHARE MODE or FOR UPDATE. In both cases, a lock is acquired on the rows read\nby the query, and it will be released when the current transaction is\ncommitted.\n\nWhen LOCK IN SHARE MODE is specified in a SELECT statement, MariaDB will wait\nuntil all transactions that have modified the rows are committed. Then, a\nwrite lock is acquired. All transactions can read the rows, but if they want\nto modify them, they have to wait until your transaction is committed.\n\nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR UPDATE clauses have\nno effect.\n\nURL: https://mariadb.com/kb/en/lock-in-share-mode/','','https://mariadb.com/kb/en/lock-in-share-mode/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (441,27,'Optimizer Hints','Optimizer hints\n---------------\n\nThere are some options available in SELECT to affect the execution plan. These\nare known as optimizer hints.\n\nHIGH PRIORITY\n-------------\n\nHIGH_PRIORITY gives the statement a higher priority. If the table is locked,\nhigh priority SELECTs will be executed as soon as the lock is released, even\nif other statements are queued. HIGH_PRIORITY applies only if the storage\nengine only supports table-level locking (MyISAM, MEMORY, MERGE). See\nHIGH_PRIORITY and LOW_PRIORITY clauses for details.\n\nSQL_CACHE / SQL_NO_CACHE\n------------------------\n\nIf the query_cache_type system variable is set to 2 or DEMAND, and the current\nstatement is cacheable, SQL_CACHE causes the query to be cached and\nSQL_NO_CACHE causes the query not to be cached. For UNIONs, SQL_CACHE or\nSQL_NO_CACHE should be specified for the first query. See also The Query Cache\nfor more detail and a list of the types of statements that aren\'t cacheable.\n\nSQL_BUFFER_RESULT\n-----------------\n\nSQL_BUFFER_RESULT forces the optimizer to use a temporary table to process the\nresult. This is useful to free locks as soon as possible.\n\nSQL_SMALL_RESULT / SQL_BIG_RESULT\n---------------------------------\n\nSQL_SMALL_RESULT and SQL_BIG_RESULT tell the optimizer whether the result is\nvery big or not. Usually, GROUP BY and DISTINCT operations are performed using\na temporary table. Only if the result is very big, using a temporary table is\nnot convenient. The optimizer automatically knows if the result is too big,\nbut you can force the optimizer to use a temporary table with\nSQL_SMALL_RESULT, or avoid the temporary table using SQL_BIG_RESULT.\n\nSTRAIGHT_JOIN\n-------------\n\nSTRAIGHT_JOIN applies to the JOIN queries, and tells the optimizer that the\ntables must be read in the order they appear in the SELECT. For const and\nsystem table this options is sometimes ignored.\n\nSQL_CALC_FOUND_ROWS\n-------------------\n\nSQL_CALC_FOUND_ROWS is only applied when using the LIMIT clause. If this\noption is used, MariaDB will count how many rows would match the query,\nwithout the LIMIT clause. That number can be retrieved in the next query,\nusing FOUND_ROWS().\n\nUSE/FORCE/IGNORE INDEX\n----------------------\n\nUSE INDEX, FORCE INDEX and IGNORE INDEX constrain the query planning to a\nspecific index.\n\nFor further information about some of these options, see How to force query\nplans.\n\nURL: https://mariadb.com/kb/en/optimizer-hints/','','https://mariadb.com/kb/en/optimizer-hints/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (442,27,'PROCEDURE','The PROCEDURE clause of SELECT passes the whole result set to a Procedure\nwhich will process it. These Procedures are not Stored Procedures, and can\nonly be written in the C language, so it is necessary to recompile the server.\n\nCurrently, the only available procedure is ANALYSE, which examines the\nresultset and suggests the optimal datatypes for each column. It is defined in\nthe sql/sql_analyse.cc file, and can be used as an example to create more\nProcedures.\n\nThis clause cannot be used in a view\'s definition.\n\nURL: https://mariadb.com/kb/en/procedure/','','https://mariadb.com/kb/en/procedure/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (443,27,'DUAL','Description\n-----------\n\nYou are allowed to specify DUAL as a dummy table name in situations where no\ntables are referenced, such as the following SELECT statement:\n\nSELECT 1 + 1 FROM DUAL;\n+-------+\n| 1 + 1 |\n+-------+\n|     2 |\n+-------+\n\nDUAL is purely for the convenience of people who require that all SELECT\nstatements should have FROM and possibly other clauses. MariaDB ignores the\nclauses. MariaDB does not require FROM DUAL if no tables are referenced.\n\nFROM DUAL could be used when you only SELECT computed values, but require a\nWHERE clause, perhaps to test that a script correctly handles empty resultsets:\n\nSELECT 1 FROM DUAL WHERE FALSE;\nEmpty set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/dual/','','https://mariadb.com/kb/en/dual/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (444,27,'SELECT ... OFFSET ... FETCH','MariaDB starting with 10.6.0\n----------------------------\nSELECT ... OFFSET ... FETCH was introduced in MariaDB 10.6.\n\nSyntax\n------\n\nOFFSET start { ROW | ROWS }\nFETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }\n\nDescription\n-----------\n\nThe OFFSET clause allows one to return only those elements of a resultset that\ncome after a specified offset. The FETCH clause specifies the number of rows\nto return, while ONLY or WITH TIES specifies whether or not to also return any\nfurther results that tie for last place according to the ordered resultset.\n\nEither the singular ROW or the plural ROWS can be used after the OFFSET and\nFETCH clauses; the choice has no impact on the results.\n\nIn the case of WITH TIES, an ORDER BY clause is required, otherwise an ERROR\nwill be returned.\n\nSELECT i FROM t1 FETCH FIRST 2 ROWS WITH TIES;\nERROR 4180 (HY000): FETCH ... WITH TIES requires ORDER BY clause to be present\n\nExamples\n--------\n\nGiven a table with 6 rows:\n\nCREATE OR REPLACE TABLE t1 (i INT);\nINSERT INTO t1 VALUES (1),(2),(3),(4), (4), (5);\nSELECT i FROM t1 ORDER BY i ASC;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    4 |\n|    5 |\n+------+\n\nOFFSET 2 allows one to skip the first two results.\n\nSELECT i FROM t1 ORDER BY i ASC OFFSET 2 ROWS;\n+------+\n| i    |\n+------+\n|    3 |\n|    4 |\n|    4 |\n|    5 |\n+------+\n\nFETCH FIRST 3 ROWS ONLY limits the results to three rows only\n\nSELECT i FROM t1 ORDER BY i ASC OFFSET 1 ROWS FETCH FIRST 3 ROWS ONLY;\n+------+\n| i    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n+------+\n\nThe same outcome can also be achieved with the LIMIT clause:\n\nSELECT i FROM t1 ORDER BY i ASC LIMIT 3 OFFSET 1;\n+------+\n| i    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n+------+\n\nWITH TIES ensures the tied result 4 is also returned.\n\nSELECT i FROM t1 ORDER BY i ASC OFFSET 1 ROWS FETCH FIRST 3 ROWS WITH TIES;\n+------+\n| i    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n|    4 |\n+------+\n\nURL: https://mariadb.com/kb/en/select-offset-fetch/','','https://mariadb.com/kb/en/select-offset-fetch/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (445,27,'INSERT','Syntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n  [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nThe INSERT statement is used to insert new rows into an existing table. The\nINSERT ... VALUES and INSERT ... SET forms of the statement insert rows based\non explicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed further\nin the INSERT ... SELECT article.\n\nThe table name can be specified in the form db_name.tbl_name or, if a default\ndatabase is selected, in the form tbl_name (see Identifier Qualifiers). This\nallows to use INSERT ... SELECT to copy rows between different databases.\n\nThe PARTITION clause can be used in both the INSERT and the SELECT part. See\nPartition Pruning and Selection for details.\n\nMariaDB starting with 10.5\n--------------------------\nThe RETURNING clause was introduced in MariaDB 10.5.\n\nThe columns list is optional. It specifies which values are explicitly\ninserted, and in which order. If this clause is not specified, all values must\nbe explicitly specified, in the same order they are listed in the table\ndefinition.\n\nThe list of value follow the VALUES or VALUE keyword (which are\ninterchangeable, regardless how much values you want to insert), and is\nwrapped by parenthesis. The values must be listed in the same order as the\ncolumns list. It is possible to specify more than one list to insert more than\none rows with a single statement. If many rows are inserted, this is a speed\noptimization.\n\nFor one-row statements, the SET clause may be more simple, because you don\'t\nneed to remember the columns order. All values are specified in the form col =\nexpr.\n\nValues can also be specified in the form of a SQL expression or subquery.\nHowever, the subquery cannot access the same table that is named in the INTO\nclause.\n\nIf you use the LOW_PRIORITY keyword, execution of the INSERT is delayed until\nno other clients are reading from the table. If you use the HIGH_PRIORITY\nkeyword, the statement has the same priority as SELECTs. This affects only\nstorage engines that use only table-level locking (MyISAM, MEMORY, MERGE).\nHowever, if one of these keywords is specified, concurrent inserts cannot be\nused. See HIGH_PRIORITY and LOW_PRIORITY clauses for details.\n\nINSERT DELAYED\n--------------\n\nFor more details on the DELAYED option, see INSERT DELAYED.\n\nHIGH PRIORITY and LOW PRIORITY\n------------------------------\n\nSee HIGH_PRIORITY and LOW_PRIORITY.\n\nDefaults and Duplicate Values\n-----------------------------\n\nSee INSERT - Default & Duplicate Values for details..\n\nINSERT IGNORE\n-------------\n\nSee INSERT IGNORE.\n\nINSERT ON DUPLICATE KEY UPDATE\n------------------------------\n\nSee INSERT ON DUPLICATE KEY UPDATE.\n\nExamples\n--------\n\nSpecifying the column names:\n\nINSERT INTO person (first_name, last_name) VALUES (\'John\', \'Doe\');\n\nInserting more than 1 row at a time:\n\nINSERT INTO tbl_name VALUES (1, \"row 1\"), (2, \"row 2\");\n\nUsing the SET clause:\n\nINSERT INTO person SET first_name = \'John\', last_name = \'Doe\';\n\nSELECTing from another table:\n\nINSERT INTO contractor SELECT * FROM person WHERE status = \'c\';\n\nSee INSERT ON DUPLICATE KEY UPDATE and INSERT IGNORE for further examples.\n\nINSERT ... RETURNING\n--------------------\n\nINSERT ... RETURNING returns a resultset of the inserted rows.\n\nThis returns the listed columns for all the rows that are inserted, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple INSERT statement\n\nINSERT INTO t2 VALUES (1,\'Dog\'),(2,\'Lion\'),(3,\'Tiger\'),(4,\'Leopard\') \nRETURNING id2,id2+id2,id2&id2,id2||id2;\n+-----+---------+---------+----------+\n| id2 | id2+id2 | id2&id2 | id2||id2 |\n+-----+---------+---------+----------+\n|   1 |       2 |       1 |        1 |\n|   2 |       4 |       2 |        1 |\n|   3 |       6 |       3 |        1 |\n|   4 |       8 |       4 |        1 |\n+-----+---------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\n\nPREPARE stmt FROM \"INSERT INTO t1 SET id1=1, animal1=\'Bear\' RETURNING f(id1),\nUPPER(animal1)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f(id1)  | UPPER(animal1) |\n+---------+----------------+\n|       2 | BEAR           |\n+---------+----------------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used.\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values, and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used or it can be used in\nINSERT...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the INSERT table.\n\nURL: https://mariadb.com/kb/en/insert/','','https://mariadb.com/kb/en/insert/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,27,'INSERT DELAYED','Syntax\n------\n\nINSERT DELAYED ...\n\nDescription\n-----------\n\nThe DELAYED option for the INSERT statement is a MariaDB/MySQL extension to\nstandard SQL that is very useful if you have clients that cannot or need not\nwait for the INSERT to complete. This is a common situation when you use\nMariaDB for logging and you also periodically run SELECT and UPDATE statements\nthat take a long time to complete.\n\nWhen a client uses INSERT DELAYED, it gets an okay from the server at once,\nand the row is queued to be inserted when the table is not in use by any other\nthread.\n\nAnother major benefit of using INSERT DELAYED is that inserts from many\nclients are bundled together and written in one block. This is much faster\nthan performing many separate inserts.\n\nNote that INSERT DELAYED is slower than a normal INSERT if the table is not\notherwise in use. There is also the additional overhead for the server to\nhandle a separate thread for each table for which there are delayed rows. This\nmeans that you should use INSERT DELAYED only when you are really sure that\nyou need it.\n\nThe queued rows are held only in memory until they are inserted into the\ntable. This means that if you terminate mysqld forcibly (for example, with\nkill -9) or if mysqld dies unexpectedly, any queued rows that have not been\nwritten to disk are lost.\n\nThe number of concurrent INSERT DELAYED threads is limited by the\nmax_delayed_threads server system variables. If it is set to 0, INSERT DELAYED\nis disabled. The session value can be equal to the global value, or 0 to\ndisable this statement for the current session. If this limit has been\nreached, the DELAYED clause will be silently ignore for subsequent statements\n(no error will be produced).\n\nLimitations\n-----------\n\nThere are some limitations on the use of DELAYED:\n\n* INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE,\n and BLACKHOLE tables. If you execute INSERT DELAYED with another storage\nengine, you will get an error like this: ERROR 1616 (HY000): DELAYED option\nnot supported for table \'tab_name\'\n* For MyISAM tables, if there are no free blocks in the middle of the data\n file, concurrent SELECT and INSERT statements are supported. Under these\n circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n* INSERT DELAYED should be used only for\n INSERT statements that specify value lists. The server\n ignores DELAYED for INSERT ... SELECT\n or INSERT ... ON DUPLICATE KEY UPDATE statements.\n* Because the INSERT DELAYED statement returns immediately,\n before the rows are inserted, you cannot use\n LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n* DELAYED rows are not visible to SELECT\n statements until they actually have been inserted.\n* After INSERT DELAYED, ROW_COUNT() returns the number of the rows you tried\nto insert, not the number of the successful writes.\n* DELAYED is ignored on slave replication servers, so that \n INSERT DELAYED is treated as a normal\n INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than\n the master. INSERT DELAYED statements are not safe for replication.\n* Pending INSERT DELAYED statements are lost if a table is\n write locked and ALTER TABLE is used to modify the table structure.\n* INSERT DELAYED is not supported for views. If you try, you will get an error\nlike this: ERROR 1347 (HY000): \'view_name\' is not BASE TABLE\n* INSERT DELAYED is not supported for partitioned tables.\n* INSERT DELAYED is not supported within stored programs.\n* INSERT DELAYED does not work with triggers.\n* INSERT DELAYED does not work if there is a check constraint in place.\n* INSERT DELAYED does not work if skip-new mode is active.\n\nURL: https://mariadb.com/kb/en/insert-delayed/','','https://mariadb.com/kb/en/insert-delayed/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (447,27,'INSERT SELECT','Syntax\n------\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [(col_name,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nDescription\n-----------\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table from one\nor more other tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\ntbl_name can also be specified in the form db_name.tbl_name (see Identifier\nQualifiers). This allows to copy rows between different databases.\n\nIf the new table has a primary key or UNIQUE indexes, you can use IGNORE to\nhandle duplicate key errors during the query. The newer values will not be\ninserted if an identical value already exists.\n\nREPLACE can be used instead of INSERT to prevent duplicates on UNIQUE indexes\nby deleting old values. In that case, ON DUPLICATE KEY UPDATE cannot be used.\n\nINSERT ... SELECT works for tables which already exist. To create a table for\na given resultset, you can use CREATE TABLE ... SELECT.\n\nURL: https://mariadb.com/kb/en/insert-select/','','https://mariadb.com/kb/en/insert-select/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (448,27,'LOAD DATA INFILE','Syntax\n------\n\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n  [REPLACE | IGNORE]\n  INTO TABLE tbl_name\n  [CHARACTER SET charset_name]\n  [{FIELDS | COLUMNS}\n    [TERMINATED BY \'string\']\n    [[OPTIONALLY] ENCLOSED BY \'char\']\n    [ESCAPED BY \'char\']\n  ]\n  [LINES\n    [STARTING BY \'string\']\n    [TERMINATED BY \'string\']\n  ]\n  [IGNORE number LINES]\n  [(col_name_or_user_var,...)]\n  [SET col_name = expr,...]\n\nDescription\n-----------\n\nLOAD DATA INFILE is unsafe for statement-based replication.\n\nReads rows from a text file into the designated table on the database at a\nvery high speed. The file name must be given as a literal string.\n\nFiles are written to disk using the SELECT INTO OUTFILE statement. You can\nthen read the files back into a table using the LOAD DATA INFILE statement.\nThe FIELDS and LINES clauses are the same in both statements. These clauses\nare optional, but if both are specified then the FIELDS clause must precede\nLINES.\n\nExecuting this statement activates INSERT triggers.\n\nOne must have the FILE privilege to be able to execute LOAD DATA INFILE. This\nis to ensure normal users cannot read system files. LOAD DATA LOCAL INFILE\ndoes not have this requirement.\n\nIf the secure_file_priv system variable is set (by default it is not), the\nloaded file must be present in the specified directory.\n\nNote that MariaDB\'s systemd unit file restricts access to /home, /root, and\n/run/user by default. See Configuring access to home directories.\n\nLOAD DATA LOCAL INFILE\n----------------------\n\nWhen you execute the LOAD DATA INFILE statement, MariaDB Server attempts to\nread the input file from its own file system. By contrast, when you execute\nthe LOAD DATA LOCAL INFILE statement, the client attempts to read the input\nfile from its file system, and it sends the contents of the input file to the\nMariaDB Server. This allows you to load files from the client\'s local file\nsystem into the database.\n\nIf you don\'t want to permit this operation (perhaps for security reasons), you\ncan disable the LOAD DATA LOCAL INFILE statement on either the server or the\nclient.\n\n* The LOAD DATA LOCAL INFILE statement can be disabled on the server by\nsetting the local_infile system variable to 0.\n* The LOAD DATA LOCAL INFILE statement can be disabled on the client. If you\nare using MariaDB Connector/C, this can be done by unsetting the\nCLIENT_LOCAL_FILES capability flag with the mysql_real_connect function or by\nunsetting the MYSQL_OPT_LOCAL_INFILE option with mysql_optionsv function. If\nyou are using a different client or client library, then see the documentation\nfor your specific client or client library to determine how it handles the\nLOAD DATA LOCAL INFILE statement.\n\nIf the LOAD DATA LOCAL INFILE statement is disabled by either the server or\nthe client and if the user attempts to execute it, then the server will cause\nthe statement to fail with the following error message:\n\nThe used command is not allowed with this MariaDB version\n\nNote that it is not entirely accurate to say that the MariaDB version does not\nsupport the command. It would be more accurate to say that the MariaDB\nconfiguration does not support the command. See MDEV-20500 for more\ninformation.\n\nFrom MariaDB 10.5.2, the error message is more accurate:\n\nThe used command is not allowed because the MariaDB server or client \n has disabled the local infile capability\n\nREPLACE and IGNORE\n------------------\n\nIf you load data from a file into a table that already contains data and has a\nprimary key, you may encounter issues where the statement attempts to insert a\nrow with a primary key that already exists. When this happens, the statement\nfails with Error 1064, protecting the data already on the table. If you want\nMariaDB to overwrite duplicates, use the REPLACE keyword.\n\nThe REPLACE keyword works like the REPLACE statement. Here, the statement\nattempts to load the data from the file. If the row does not exist, it adds it\nto the table. If the row contains an existing primary key, it replaces the\ntable data. That is, in the event of a conflict, it assumes the file contains\nthe desired row.\n\nThis operation can cause a degradation in load speed by a factor of 20 or more\nif the part that has already been loaded is larger than the capacity of the\nInnoDB Buffer Pool. This happens because it causes a lot of turnaround in the\nbuffer pool.\n\nUse the IGNORE keyword when you want to skip any rows that contain a\nconflicting primary key. Here, the statement attempts to load the data from\nthe file. If the row does not exist, it adds it to the table. If the row\ncontains an existing primary key, it ignores the addition request and moves on\nto the next. That is, in the event of a conflict, it assumes the table\ncontains the desired row.\n\nCharacter-sets\n--------------\n\nWhen the statement opens the file, it attempts to read the contents using the\ndefault character-set, as defined by the character_set_database system\nvariable.\n\nIn the cases where the file was written using a character-set other than the\ndefault, you can specify the character-set to use with the CHARACTER SET\nclause in the statement. It ignores character-sets specified by the SET NAMES\nstatement and by the character_set_client system variable. Setting the\nCHARACTER SET clause to a value of binary indicates \"no conversion.\"\n\nThe statement interprets all fields in the file as having the same\ncharacter-set, regardless of the column data type. To properly interpret file\ncontents, you must ensure that it was written with the correct character-set.\nIf you write a data file with mysqldump -T or with the SELECT INTO OUTFILE\nstatement with the mysql client, be sure to use the --default-character-set\noption, so that the output is written with the desired character-set.\n\nWhen using mixed character sets, use the CHARACTER SET clause in both SELECT\nINTO OUTFILE and LOAD DATA INFILE to ensure that MariaDB correctly interprets\nthe escape sequences.\n\nThe character_set_filesystem system variable controls the interpretation of\nthe filename.\n\nIt is currently not possible to load data files that use the ucs2 character\nset.\n\nPreprocessing Inputs\n--------------------\n\ncol_name_or_user_var can be a column name, or a user variable. In the case of\na variable, the SET statement can be used to preprocess the value before\nloading into the table.\n\nPriority and Concurrency\n------------------------\n\nIn storage engines that perform table-level locking (MyISAM, MEMORY and\nMERGE), using the LOW_PRIORITY keyword, MariaDB delays insertions until no\nother clients are reading from the table. Alternatively, when using the MyISAM\nstorage engine, you can use the CONCURRENT keyword to perform concurrent\ninsertion.\n\nThe LOW_PRIORITY and CONCURRENT keywords are mutually exclusive. They cannot\nbe used in the same statement.\n\nProgress Reporting\n------------------\n\nThe LOAD DATA INFILE statement supports progress reporting. You may find this\nuseful when dealing with long-running operations. Using another client you can\nissue a SHOW PROCESSLIST query to check the progress of the data load.\n\nUsing mariadb-import/mysqlimport\n--------------------------------\n\nMariaDB ships with a separate utility for loading data from files:\nmariadb-import (or mysqlimport before MariaDB 10.5). It operates by sending\nLOAD DATA INFILE statements to the server.\n\nUsing mariadb-import/mysqlimport you can compress the file using the\n--compress option, to get better performance over slow networks, providing\nboth the client and server support the compressed protocol. Use the --local\noption to load from the local file system.\n\nIndexing\n--------\n\nIn cases where the storage engine supports ALTER TABLE... DISABLE KEYS\nstatements (MyISAM and Aria), the LOAD DATA INFILE statement automatically\ndisables indexes during the execution.\n\nExamples\n--------\n\nYou have a file with this content (note the the separator is \',\', not tab,\nwhich is the default):\n\n2,2\n3,3\n4,4\n5,5\n6,8\n\nCREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY (a));\nLOAD DATA LOCAL INFILE \n \'/tmp/loaddata7.dat\' INTO TABLE t1 FIELDS TERMINATED BY \',\' (a,b) SET c=a+b;\nSELECT * FROM t1;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|    2 |    2 |    4 |\n|    3 |    3 |    6 |\n|    4 |    4 |    8 |\n|    5 |    5 |   10 |\n|    6 |    8 |   14 |\n+------+------+------+\n\nAnother example, given the following data (the separator is a tab):\n\n1       a\n2       b\n\nThe value of the first column is doubled before loading:\n\nLOAD DATA INFILE \'ld.txt\' INTO TABLE ld (@i,v) SET i=@i*2;\n\nSELECT * FROM ld;\n+------+------+\n| i    | v    |\n+------+------+\n|    2 | a    |\n|    4 | b    |\n+------+------+\n\nURL: https://mariadb.com/kb/en/load-data-infile/','','https://mariadb.com/kb/en/load-data-infile/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (449,27,'LOAD XML','Syntax\n------\n\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n  [REPLACE | IGNORE]\n  INTO TABLE [db_name.]tbl_name\n  [CHARACTER SET charset_name]\n  [ROWS IDENTIFIED BY \'<tagname>\']\n  [IGNORE number {LINES | ROWS}]\n  [(column_or_user_var,...)]\n  [SET col_name = expr,...]\n\nDescription\n-----------\n\nThe LOAD XML statement reads data from an XML file into a table. The file_name\nmust be given as a literal string. The tagname in the optional ROWS IDENTIFIED\nBY clause must also be given as a literal string, and must be surrounded by\nangle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML output mode\n(that is, starting the client with the --xml option). To write data from a\ntable to an XML file, use a command such as the following one from the system\nshell:\n\nshell> mysql --xml -e \'SELECT * FROM mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default, the <row>\nelement is considered to be the equivalent of a database table row; this can\nbe changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\n* Column names as attributes and column values as attribute values:\n\n<row column1=\"value1\" column2=\"value2\" .../>\n\n* Column names as tags and column values as the content of these tags:\n\n<row>\n <column1>value1</column1>\n <column2>value2</column2>\n</row>\n\n* Column names are the name attributes of <field> tags, and values are\n the contents of these tags:\n\n<row>\n <field name=\'column1\'>value1</field>\n <field name=\'column2\'>value2</field>\n</row>\n\nThis is the format used by other tools, such as mysqldump.\n\nAll 3 formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it correctly.\nTags are matched based on the tag or attribute name and the column name.\n\nThe following clauses work essentially the same way for LOAD XML as they do\nfor LOAD DATA:\n\n* LOW_PRIORITY or CONCURRENT\n* LOCAL\n* REPLACE or IGNORE\n* CHARACTER SET\n* (column_or_user_var,...)\n* SET\n\nSee LOAD DATA for more information about these clauses.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first number\nrows in the XML file to be skipped. It is analogous to the LOAD DATA\nstatement\'s IGNORE ... LINES clause.\n\nIf the LOW_PRIORITY keyword is used, insertions are delayed until no other\nclients are reading from the table. The CONCURRENT keyword allowes the use of\nconcurrent inserts. These clauses cannot be specified together.\n\nThis statement activates INSERT triggers.\n\nURL: https://mariadb.com/kb/en/load-xml/','','https://mariadb.com/kb/en/load-xml/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (450,27,'Concurrent Inserts','The MyISAM storage engine supports concurrent inserts. This feature allows\nSELECT statements to be executed during INSERT operations, reducing contention.\n\nWhether concurrent inserts can be used or not depends on the value of the\nconcurrent_insert server system variable:\n\n* NEVER (0) disables concurrent inserts.\n* AUTO (1) allows concurrent inserts only when the target table has no free\nblocks (no data in the middle of the table has been deleted after the last\nOPTIMIZE TABLE). This is the default.\n* ALWAYS (2) always enables concurrent inserts, in which case new rows are\nadded at the end of a table if the table is being used by another thread.\n\nIf the binary log is used, CREATE TABLE ... SELECT and INSERT ... SELECT\nstatements cannot use concurrent inserts. These statements acquire a read lock\non the table, so concurrent inserts will need to wait. This way the log can be\nsafely used to restore data.\n\nConcurrent inserts are not used by replicas with the row based replication\n(see binary log formats).\n\nIf an INSERT statement contain the HIGH_PRIORITY clause, concurrent inserts\ncannot be used. INSERT ... DELAYED is usually unneeded if concurrent inserts\nare enabled.\n\nLOAD DATA INFILE uses concurrent inserts if the CONCURRENT keyword is\nspecified and concurrent_insert is not NEVER. This makes the statement slower\n(even if no other sessions access the table) but reduces contention.\n\nLOCK TABLES allows non-conflicting concurrent inserts if a READ LOCAL lock is\nused. Concurrent inserts are not allowed if the LOCAL keyword is omitted.\n\nNotes\n-----\n\nThe decision to enable concurrent insert for a table is done when the table is\nopened. If you change the value of concurrent_insert it will only affect new\nopened tables. If you want it to work for also for tables in use or cached,\nyou should do FLUSH TABLES after setting the variable.\n\nURL: https://mariadb.com/kb/en/concurrent-inserts/','','https://mariadb.com/kb/en/concurrent-inserts/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (451,27,'HIGH_PRIORITY and LOW_PRIORITY','The InnoDB storage engine uses row-level locking to ensure data integrity.\nHowever some storage engines (such as MEMORY, MyISAM, Aria and MERGE) lock the\nwhole table to prevent conflicts. These storage engines use two separate\nqueues to remember pending statements; one is for SELECTs and the other one is\nfor write statements (INSERT, DELETE, UPDATE). By default, the latter has a\nhigher priority.\n\nTo give write operations a lower priority, the low_priority_updates server\nsystem variable can be set to ON. The option is available on both the global\nand session levels, and it can be set at startup or via the SET statement.\n\nWhen too many table locks have been set by write statements, some pending\nSELECTs are executed. The maximum number of write locks that can be acquired\nbefore this happens is determined by the max_write_lock_count server system\nvariable, which is dynamic.\n\nIf write statements have a higher priority (default), the priority of\nindividual write statements (INSERT, REPLACE, UPDATE, DELETE) can be changed\nvia the LOW_PRIORITY attribute, and the priority of a SELECT statement can be\nraised via the HIGH_PRIORITY attribute. Also, LOCK TABLES supports a\nLOW_PRIORITY attribute for WRITE locks.\n\nIf read statements have a higher priority, the priority of an INSERT can be\nchanged via the HIGH_PRIORITY attribute. However, the priority of other write\nstatements cannot be raised individually.\n\nThe use of LOW_PRIORITY or HIGH_PRIORITY for an INSERT prevents Concurrent\nInserts from being used.\n\nURL: https://mariadb.com/kb/en/high_priority-and-low_priority/','','https://mariadb.com/kb/en/high_priority-and-low_priority/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (452,27,'INSERT - Default & Duplicate Values','Default Values\n--------------\n\nIf the SQL_MODE contains STRICT_TRANS_TABLES and you are inserting into a\ntransactional table (like InnoDB), or if the SQL_MODE contains\nSTRICT_ALL_TABLES, all NOT NULL columns which do not have a DEFAULT value (and\nare not AUTO_INCREMENT) must be explicitly referenced in INSERT statements. If\nnot, an error like this is produced:\n\nERROR 1364 (HY000): Field \'col\' doesn\'t have a default value\n\nIn all other cases, if a NOT NULL column without a DEFAULT value is not\nreferenced, an empty value will be inserted (for example, 0 for INTEGER\ncolumns and \'\' for CHAR columns). See NULL Values in MariaDB:Inserting for\nexamples.\n\nIf a NOT NULL column having a DEFAULT value is not referenced, NULL will be\ninserted.\n\nIf a NULL column having a DEFAULT value is not referenced, its default value\nwill be inserted. It is also possible to explicitly assign the default value\nusing the DEFAULT keyword or the DEFAULT() function.\n\nIf the DEFAULT keyword is used but the column does not have a DEFAULT value,\nan error like this is produced:\n\nERROR 1364 (HY000): Field \'col\' doesn\'t have a default value\n\nDuplicate Values\n----------------\n\nBy default, if you try to insert a duplicate row and there is a UNIQUE index,\nINSERT stops and an error like this is produced:\n\nERROR 1062 (23000): Duplicate entry \'dup_value\' for key \'col\'\n\nTo handle duplicates you can use the IGNORE clause, INSERT ON DUPLICATE KEY\nUPDATE or the REPLACE statement. Note that the IGNORE and DELAYED options are\nignored when you use ON DUPLICATE KEY UPDATE.\n\nURL: https://mariadb.com/kb/en/insert-default-duplicate-values/','','https://mariadb.com/kb/en/insert-default-duplicate-values/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (453,27,'INSERT IGNORE','Ignoring Errors\n---------------\n\nNormally INSERT stops and rolls back when it encounters an error.\n\nBy using the IGNORE keyword all errors are converted to warnings, which will\nnot stop inserts of additional rows.\n\nThe IGNORE and DELAYED options are ignored when you use ON DUPLICATE KEY\nUPDATE.\n\nPrior to MySQL and MariaDB 5.5.28, no warnings were issued for duplicate key\nerrors when using IGNORE. You can get the old behavior if you set OLD_MODE to\nNO_DUP_KEY_WARNINGS_WITH_IGNORE.\n\nExamples\n--------\n\nCREATE TABLE t1 (x INT UNIQUE);\n\nINSERT INTO t1 VALUES(1),(2);\n\nINSERT INTO t1 VALUES(2),(3);\nERROR 1062 (23000): Duplicate entry \'2\' for key \'x\'\nSELECT * FROM t1;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n+------+\n2 rows in set (0.00 sec)\n\nINSERT IGNORE INTO t1 VALUES(2),(3);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSHOW WARNINGS;\n+---------+------+---------------------------------+\n| Level   | Code | Message                         |\n+---------+------+---------------------------------+\n| Warning | 1062 | Duplicate entry \'2\' for key \'x\' |\n+---------+------+---------------------------------+\n\nSELECT * FROM t1;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nSee INSERT ON DUPLICATE KEY UPDATE for further examples using that syntax.\n\nURL: https://mariadb.com/kb/en/insert-ignore/','','https://mariadb.com/kb/en/insert-ignore/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (454,27,'INSERT ON DUPLICATE KEY UPDATE','Syntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n  col=expr\n   [, col=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ]\n\nDescription\n-----------\n\nINSERT ... ON DUPLICATE KEY UPDATE is a MariaDB/MySQL extension to the INSERT\nstatement that, if it finds a duplicate unique or primary key, will instead\nperform an UPDATE.\n\nThe row/s affected value is reported as 1 if a row is inserted, and 2 if a row\nis updated, unless the API\'s CLIENT_FOUND_ROWS flag is set.\n\nIf more than one unique index is matched, only the first is updated. It is not\nrecommended to use this statement on tables with more than one unique index.\n\nIf the table has an AUTO_INCREMENT primary key and the statement inserts or\nupdates a row, the LAST_INSERT_ID() function returns its AUTO_INCREMENT value.\n\nThe VALUES() function can only be used in a ON DUPLICATE KEY UPDATE clause and\nhas no meaning in any other context. It returns the column values from the\nINSERT portion of the statement. This function is particularly useful for\nmulti-rows inserts.\n\nThe IGNORE and DELAYED options are ignored when you use ON DUPLICATE KEY\nUPDATE.\n\nSee Partition Pruning and Selection for details on the PARTITION clause.\n\nThis statement activates INSERT and UPDATE triggers. See Trigger Overview for\ndetails.\n\nSee also a similar statement, REPLACE.\n\nExamples\n--------\n\nCREATE TABLE ins_duplicate (id INT PRIMARY KEY, animal VARCHAR(30));\nINSERT INTO ins_duplicate VALUES (1,\'Aardvark\'), (2,\'Cheetah\'), (3,\'Zebra\');\n\nIf there is no existing key, the statement runs as a regular INSERT:\n\nINSERT INTO ins_duplicate VALUES (4,\'Gorilla\') \n ON DUPLICATE KEY UPDATE animal=\'Gorilla\';\nQuery OK, 1 row affected (0.07 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal   |\n+----+----------+\n|  1 | Aardvark |\n|  2 | Cheetah  |\n|  3 | Zebra    |\n|  4 | Gorilla  |\n+----+----------+\n\nA regular INSERT with a primary key value of 1 will fail, due to the existing\nkey:\n\nINSERT INTO ins_duplicate VALUES (1,\'Antelope\');\nERROR 1062 (23000): Duplicate entry \'1\' for key \'PRIMARY\'\n\nHowever, we can use an INSERT ON DUPLICATE KEY UPDATE instead:\n\nINSERT INTO ins_duplicate VALUES (1,\'Antelope\') \n ON DUPLICATE KEY UPDATE animal=\'Antelope\';\nQuery OK, 2 rows affected (0.09 sec)\n\nNote that there are two rows reported as affected, but this refers only to the\nUPDATE.\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal   |\n+----+----------+\n|  1 | Antelope |\n|  2 | Cheetah  |\n|  3 | Zebra    |\n|  4 | Gorilla  |\n+----+----------+\n\nAdding a second unique column:\n\nALTER TABLE ins_duplicate ADD id2 INT;\nUPDATE ins_duplicate SET id2=id+10;\nALTER TABLE ins_duplicate ADD UNIQUE KEY(id2);\n\nWhere two rows match the unique keys match, only the first is updated. This\ncan be unsafe and is not recommended unless you are certain what you are doing.\n\nINSERT INTO ins_duplicate VALUES (2,\'Lion\',13) \n ON DUPLICATE KEY UPDATE animal=\'Lion\';\nQuery OK, 2 rows affected (0.004 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+------+\n| id | animal   | id2  |\n+----+----------+------+\n|  1 | Antelope |   11 |\n|  2 | Lion     |   12 |\n|  3 | Zebra    |   13 |\n|  4 | Gorilla  |   14 |\n+----+----------+------+\n\nAlthough the third row with an id of 3 has an id2 of 13, which also matched,\nit was not updated.\n\nChanging id to an auto_increment field. If a new row is added, the\nauto_increment is moved forward. If the row is updated, it remains the same.\n\nALTER TABLE `ins_duplicate` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT;\nALTER TABLE ins_duplicate DROP id2;\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n|              5 |\n+----------------+\n\nINSERT INTO ins_duplicate VALUES (2,\'Leopard\') \n ON DUPLICATE KEY UPDATE animal=\'Leopard\';\nQuery OK, 2 rows affected (0.00 sec)\n\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n|              5 |\n+----------------+\n\nINSERT INTO ins_duplicate VALUES (5,\'Wild Dog\') \n ON DUPLICATE KEY UPDATE animal=\'Wild Dog\';\nQuery OK, 1 row affected (0.09 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal   |\n+----+----------+\n|  1 | Antelope |\n|  2 | Leopard  |\n|  3 | Zebra    |\n|  4 | Gorilla  |\n|  5 | Wild Dog |\n+----+----------+\n\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n|              6 |\n+----------------+\n\nRefering to column values from the INSERT portion of the statement:\n\nINSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n  ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n\nSee the VALUES() function for more.\n\nURL: https://mariadb.com/kb/en/insert-on-duplicate-key-update/','','https://mariadb.com/kb/en/insert-on-duplicate-key-update/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (455,27,'INSERT...RETURNING','MariaDB starting with 10.5.0\n----------------------------\nINSERT ... RETURNING was added in MariaDB 10.5.0, and returns a resultset of\nthe inserted rows.\n\nSyntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n  [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nDescription\n-----------\n\nINSERT ... RETURNING returns a resultset of the inserted rows.\n\nThis returns the listed columns for all the rows that are inserted, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple INSERT statements:\n\nCREATE OR REPLACE TABLE t2 (id INT, animal VARCHAR(20), t TIMESTAMP);\n\nINSERT INTO t2 (id) VALUES (2),(3) RETURNING id,t;\n+------+---------------------+\n| id   | t                   |\n+------+---------------------+\n|    2 | 2021-04-28 00:59:32 |\n|    3 | 2021-04-28 00:59:32 |\n+------+---------------------+\n\nINSERT INTO t2(id,animal) VALUES\n(1,\'Dog\'),(2,\'Lion\'),(3,\'Tiger\'),(4,\'Leopard\')  \n RETURNING id,id+id,id&id,id||id;\n+------+-------+-------+--------+\n| id   | id+id | id&id | id||id |\n+------+-------+-------+--------+\n|    1 |     2 |     1 |      1 |\n|    2 |     4 |     2 |      1 |\n|    3 |     6 |     3 |      1 |\n|    4 |     8 |     4 |      1 |\n+------+-------+-------+--------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\n\nPREPARE stmt FROM \"INSERT INTO t1 SET id1=1, animal1=\'Bear\' RETURNING f(id1),\nUPPER(animal1)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f(id1)  | UPPER(animal1) |\n+---------+----------------+\n|       2 | BEAR           |\n+---------+----------------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used.\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values, and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used or it can be used in\nINSERT...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the INSERT table.\n\nURL: https://mariadb.com/kb/en/insertreturning/','','https://mariadb.com/kb/en/insertreturning/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (456,27,'REPLACE...RETURNING','MariaDB starting with 10.5.0\n----------------------------\nREPLACE ... RETURNING was added in MariaDB 10.5.0, and returns a resultset of\nthe replaced rows.\n\nSyntax\n------\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nDescription\n-----------\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n|   1 |     2 |       1 |        1 |\n|   2 |     4 |       2 |        1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\nPREPARE stmt FROM \"REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n|       6 | FOX            |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n|      1 |\n|      1 |\n|      1 |\n|      1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in\nREPLACE...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the REPLACE table.\n\nURL: https://mariadb.com/kb/en/replacereturning/','','https://mariadb.com/kb/en/replacereturning/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (457,27,'CALL','Syntax\n------\n\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nDescription\n-----------\n\nThe CALL statement invokes a stored procedure that was defined previously with\nCREATE PROCEDURE.\n\nStored procedure names can be specified as database_name.procedure_name.\nProcedure names and database names can be quoted with backticks (). This is\nnecessary if they are reserved words, or contain special characters. See\nidentifier qualifiers for details.\n\nCALL p() and CALL p are equivalent.\n\nIf parentheses are used, any number of spaces, tab characters and newline\ncharacters are allowed between the procedure\'s name and the open parenthesis.\n\nCALL can pass back values to its caller using parameters that are declared as\nOUT or INOUT parameters. If no value is assigned to an OUT parameter, NULL is\nassigned (and its former value is lost). To pass such values from another\nstored program you can use user-defined variables, local variables or\nroutine\'s parameters; in other contexts, you can only use user-defined\nvariables.\n\nCALL can also be executed as a prepared statement. Placeholders can be used\nfor IN parameters in all versions of MariaDB; for OUT and INOUT parameters,\nplaceholders can be used since MariaDB 5.5.\n\nWhen the procedure returns, a client program can also obtain the number of\nrows affected for the final statement executed within the routine: At the SQL\nlevel, call the ROW_COUNT() function; from the C API, call the\nmysql_affected_rows() function.\n\nIf the CLIENT_MULTI_RESULTS API flag is set, CALL can return any number of\nresultsets and the called stored procedure can execute prepared statements. If\nit is not set, at most one resultset can be returned and prepared statements\ncannot be used within procedures.\n\nURL: https://mariadb.com/kb/en/call/','','https://mariadb.com/kb/en/call/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (458,27,'DO','Syntax\n------\n\nDO expr [, expr] ...\n\nDescription\n-----------\n\nDO executes the expressions but does not return any results. In most respects,\nDO is shorthand for SELECT expr, ..., but has the advantage that it is\nslightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nURL: https://mariadb.com/kb/en/do/','','https://mariadb.com/kb/en/do/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (459,27,'Comment Syntax','There are three supported comment styles in MariaDB:\n\n* From a \'#\' to the end of a line:SELECT * FROM users; # This is a comment\n\n* From a \'-- \' to the end of a line. The space after the two dashes is\nrequired (as in MySQL).SELECT * FROM users; -- This is a comment\n\n* C style comments from an opening \'/*\' to a closing \'*/\'. Comments of this\nform can span multiple lines:SELECT * FROM users; /* This is a\nmulti-line\ncomment */\n\nNested comments are possible in some situations, but they are not supported or\nrecommended.\n\nExecutable Comments\n-------------------\n\nAs an aid to portability between different databases, MariaDB supports\nexecutable comments. These special comments allow you to embed SQL code which\nwill not execute when run on other databases, but will execute when run on\nMariaDB.\n\nMariaDB supports both MySQL\'s executable comment format, and a slightly\nmodified version specific to MariaDB. This way, if you have SQL code that\nworks on MySQL and MariaDB, but not other databases, you can wrap it in a\nMySQL executable comment, and if you have code that specifically takes\nadvantage of features only available in MariaDB you can use the MariaDB\nspecific format to hide the code from MySQL.\n\nExecutable Comment Syntax\n-------------------------\n\nMySQL and MariaDB executable comment syntax:\n\n/*! MySQL or MariaDB-specific code */\n\nCode that should be executed only starting from a specific MySQL or MariaDB\nversion:\n\n/*!##### MySQL or MariaDB-specific code */\n\nThe numbers, represented by \'######\' in the syntax examples above specify the\nspecific the minimum versions of MySQL and MariaDB that should execute the\ncomment. The first number is the major version, the second 2 numbers are the\nminor version and the last 2 is the patch level.\n\nFor example, if you want to embed some code that should only execute on MySQL\nor MariaDB starting from 5.1.0, you would do the following:\n\n/*!50100 MySQL and MariaDB 5.1.0 (and above) code goes here. */\n\nMariaDB-only executable comment syntax (starting from MariaDB 5.3.1):\n\n/*M! MariaDB-specific code */\n/*M!###### MariaDB-specific code */\n\nMariaDB ignores MySQL-style executable comments that have a version number in\nthe range 50700..99999. This is needed to skip features introduced in\nMySQL-5.7 that are not ported to MariaDB 10.x yet.\n\n/*!50701 MariaDB-10.x ignores MySQL-5.7 specific code */\n\nNote: comments which have a version number in the range 50700..99999 that use\nMariaDB-style executable comment syntax are still executed.\n\n/*M!50701 MariaDB-10.x does not ignore this */\n\nStatement delimiters cannot be used within executable comments.\n\nExamples\n--------\n\nIn MySQL all the following will return 2: In MariaDB, the last 2 queries would\nreturn 3.\n\nSELECT 2 /* +1 */;\nSELECT 1 /*! +1 */;\nSELECT 1 /*!50101 +1 */;\nSELECT 2 /*M! +1 */;\nSELECT 2 /*M!50301 +1 */;\n\nThe following executable statement will not work due to the delimiter inside\nthe executable portion:\n\n/*M!100100 select 1 ; */\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat corresponds to your MariaDB server version for the right syntax to use\nnear \'\' at line 1\n\nInstead, the delimiter should be placed outside the executable portion:\n\n/*M!100100 select 1 */;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nURL: https://mariadb.com/kb/en/comment-syntax/','','https://mariadb.com/kb/en/comment-syntax/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (460,27,'HANDLER Commands','Syntax\n------\n\nHANDLER tbl_name OPEN [ [AS] alias]\nHANDLER tbl_name READ index_name { = | >= | <= | < } (value1,value2,...)\n  [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n  [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n  [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name CLOSE\n\nDescription\n-----------\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces for key lookups and key or table scans. It is available for at\nleast Aria, Memory, MyISAM and InnoDB tables (and should work with most\n\'normal\' storage engines, but not with system tables, MERGE or views).\n\nHANDLER ... OPEN opens a table, allowing it to be accessible to subsequent\nHANDLER ... READ statements. The table can either be opened using an alias\n(which must then be used by HANDLER ... READ, or a table name.\n\nThe table object is only closed when HANDLER ... CLOSE is called by the\nsession, and is not shared by other sessions.\n\nPrepared statements work with HANDLER READ, which gives a much higher\nperformance (50% speedup) as there is no parsing and all data is transformed\nin binary (without conversions to text, as with the normal protocol).\n\nThe HANDLER command does not work with partitioned tables.\n\nKey Lookup\n----------\n\nA key lookup is started with:\n\nHANDLER tbl_name READ index_name { = | >= | <= | < }  (value,value) [LIMIT...]\n\nThe values stands for the value of each of the key columns. For most key types\n(except for HASH keys in MEMORY storage engine) you can use a prefix subset of\nit\'s columns.\n\nIf you are using LIMIT, then in case of >= or > then there is an implicit NEXT\nimplied, while if you are using <= or < then there is an implicit PREV implied.\n\nAfter the initial read, you can use\n\nHANDLER tbl_name READ index_name NEXT [ LIMIT ... ]\nor\nHANDLER tbl_name READ index_name PREV [ LIMIT ... ]\n\nto scan the rows in key order.\n\nNote that the row order is not defined for keys with duplicated values and\nwill vary from engine to engine.\n\nKey Scans\n---------\n\nYou can scan a table in key order by doing:\n\nHANDLER tbl_name READ index_name FIRST [ LIMIT ... ]\nHANDLER tbl_name READ index_name NEXT  [ LIMIT ... ]\n\nor, if the handler supports backwards key scans (most do):\n\nHANDLER tbl_name READ index_name LAST [ LIMIT ... ]\nHANDLER tbl_name READ index_name PREV [ LIMIT ... ]\n\nTable Scans\n-----------\n\nYou can scan a table in row order by doing:\n\nHANDLER tbl_name READ FIRST [ LIMIT ... ]\nHANDLER tbl_name READ NEXT  [ LIMIT ... ]\n\nLimitations\n-----------\n\nAs this is a direct interface to the storage engine, some limitations may\napply for what you can do and what happens if the table changes. Here follows\nsome of the common limitations:\n\nFinding \'Old Rows\'\n------------------\n\nHANDLER READ is not transaction safe, consistent or atomic. It\'s ok for the\nstorage engine to returns rows that existed when you started the scan but that\nwere later deleted. This can happen as the storage engine may cache rows as\npart of the scan from a previous read.\n\nYou may also find rows committed since the scan originally started.\n\nInvisible Columns\n-----------------\n\nHANDLER ... READ also reads the data of invisible-columns.\n\nSystem-Versioned Tables\n-----------------------\n\nHANDLER ... READ reads everything from system-versioned tables, and so\nincludes row_start and row_end fields, as well as all rows that have since\nbeen deleted or changed, including when history partitions are used.\n\nOther Limitations\n-----------------\n\n* If you do an ALTER TABLE, all your HANDLERs for that table are automatically\nclosed.\n* If you do an ALTER TABLE for a table that is used by some other connection\nwith HANDLER, the ALTER TABLE will wait for the HANDLER to be closed.\n* For HASH keys, you must use all key parts when searching for a row.\n* For HASH keys, you can\'t do a key scan of all values. You can only find all\nrows with the same key value.\n* While each HANDLER READ command is atomic, if you do a scan in many steps,\nthen some engines may give you error 1020 if the table changed between the\ncommands. Please refer to the specific engine handler page if this happens.\n\nError Codes\n-----------\n\n* Error 1031 (ER_ILLEGAL_HA) Table storage engine for \'t1\' doesn\'t have this\noption\nIf you get this for HANDLER OPEN it means the storage engine doesn\'t support\nHANDLER calls.\nIf you get this for HANDLER READ it means you are trying to use an incomplete\nHASH key.\n\n* Error 1020 (ER_CHECKREAD) Record has changed since last read in table \'...\'\nThis means that the table changed between two reads and the handler can\'t\nhandle this case for the given scan.\n\nURL: https://mariadb.com/kb/en/handler-commands/','','https://mariadb.com/kb/en/handler-commands/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (461,27,'HANDLER for MEMORY Tables','This article explains how to use HANDLER commands efficiently with MEMORY/HEAP\ntables.\n\nIf you want to scan a table for over different key values, not just search for\nexact key values, you should create your keys with \'USING BTREE\':\n\nCREATE TABLE t1 (a INT, b INT, KEY(a), KEY b USING BTREE (b)) engine=memory;\n\nIn the above table, a is a HASH key that only supports exact matches (=) while\nb is a BTREE key that you can use to scan the table in key order, starting\nfrom start or from a given key value.\n\nThe limitations for HANDLER READ with Memory|HEAP tables are:\n\nLimitations for HASH keys\n-------------------------\n\n* You must use all key parts when searching for a row.\n* You can\'t do a key scan of all values. You can only find all rows with the\nsame key value.\n* READ NEXT gives error 1031 if the tables changed since last read.\n\nLimitations for BTREE keys\n--------------------------\n\n* READ NEXT gives error 1031 if the tables changed since last read. This\nlimitation can be lifted in the future.\n\nLimitations for table scans\n---------------------------\n\n* READ NEXT gives error 1031 if the table was truncated since last READ call.\n\nURL: https://mariadb.com/kb/en/handler-for-memory-tables/','','https://mariadb.com/kb/en/handler-for-memory-tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (462,27,'Useful MariaDB Queries','This page is intended to be a quick reference of commonly-used and/or useful\nqueries in MariaDB.\n\nCreating a Table\n----------------\n\nCREATE TABLE t1 ( a INT );\nCREATE TABLE t2 ( b INT );\nCREATE TABLE student_tests (\n name CHAR(10), test CHAR(10), \n score TINYINT, test_date DATE\n);\n\nSee CREATE TABLE for more.\n\nInserting Records\n-----------------\n\nINSERT INTO t1 VALUES (1), (2), (3);\nINSERT INTO t2 VALUES (2), (4);\n\nINSERT INTO student_tests \n (name, test, score, test_date) VALUES\n (\'Chun\', \'SQL\', 75, \'2012-11-05\'), \n (\'Chun\', \'Tuning\', 73, \'2013-06-14\'),\n (\'Esben\', \'SQL\', 43, \'2014-02-11\'), \n (\'Esben\', \'Tuning\', 31, \'2014-02-09\'), \n (\'Kaolin\', \'SQL\', 56, \'2014-01-01\'),\n (\'Kaolin\', \'Tuning\', 88, \'2013-12-29\'), \n (\'Tatiana\', \'SQL\', 87, \'2012-04-28\'), \n (\'Tatiana\', \'Tuning\', 83, \'2013-09-30\');\n\nSee INSERT for more.\n\nUsing AUTO_INCREMENT\n--------------------\n\nThe AUTO_INCREMENT attribute is used to automatically generate a unique\nidentity for new rows.\n\nCREATE TABLE student_details (\n id INT NOT NULL AUTO_INCREMENT, name CHAR(10), \n date_of_birth DATE, PRIMARY KEY (id)\n);\n\nWhen inserting, the id field can be omitted, and is automatically created.\n\nINSERT INTO student_details (name,date_of_birth) VALUES \n (\'Chun\', \'1993-12-31\'), \n (\'Esben\',\'1946-01-01\'),\n (\'Kaolin\',\'1996-07-16\'),\n (\'Tatiana\', \'1988-04-13\');\n\nSELECT * FROM student_details;\n+----+---------+---------------+\n| id | name    | date_of_birth |\n+----+---------+---------------+\n|  1 | Chun    | 1993-12-31    |\n|  2 | Esben   | 1946-01-01    |\n|  3 | Kaolin  | 1996-07-16    |\n|  4 | Tatiana | 1988-04-13    |\n+----+---------+---------------+\n\nSee AUTO_INCREMENT for more.\n\nQuerying from two tables on a common value\n------------------------------------------\n\nSELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.b;\n\nThis kind of query is called a join - see JOINS for more.\n\nFinding the Maximum Value\n-------------------------\n\nSELECT MAX(a) FROM t1;\n+--------+\n| MAX(a) |\n+--------+\n|      3 |\n+--------+\n\nSee the MAX() function for more, as well as Finding the maximum value and\ngrouping the results below for a more practical example.\n\nFinding the Minimum Value\n-------------------------\n\nSELECT MIN(a) FROM t1;\n+--------+\n| MIN(a) |\n+--------+\n|      1 |\n+--------+\n\nSee the MIN() function for more.\n\nFinding the Average Value\n-------------------------\n\nSELECT AVG(a) FROM t1;\n+--------+\n| AVG(a) |\n+--------+\n| 2.0000 |\n+--------+\n\nSee the AVG() function for more.\n\nFinding the Maximum Value and Grouping the Results\n--------------------------------------------------\n\nSELECT name, MAX(score) FROM student_tests GROUP BY name;\n+---------+------------+\n| name    | MAX(score) |\n+---------+------------+\n| Chun    |         75 |\n| Esben   |         43 |\n| Kaolin  |         88 |\n| Tatiana |         87 |\n+---------+------------+\n\nSee the MAX() function for more.\n\nOrdering Results\n----------------\n\nSELECT name, test, score FROM student_tests ORDER BY score DESC;\n+---------+--------+-------+\n| name    | test   | score |\n+---------+--------+-------+\n| Kaolin  | Tuning |    88 |\n| Tatiana | SQL    |    87 |\n| Tatiana | Tuning |    83 |\n| Chun    | SQL    |    75 |\n| Chun    | Tuning |    73 |\n| Kaolin  | SQL    |    56 |\n| Esben   | SQL    |    43 |\n| Esben   | Tuning |    31 |\n+---------+--------+-------+\n\nSee ORDER BY for more.\n\nFinding the Row with the Minimum of a Particular Column\n-------------------------------------------------------\n\nIn this example, we want to find the lowest test score for any student.\n\nSELECT name,test, score FROM student_tests WHERE score=(SELECT MIN(score) FROM\nstudent);\n+-------+--------+-------+\n| name  | test   | score |\n+-------+--------+-------+\n| Esben | Tuning |    31 |\n+-------+--------+-------+\n\nFinding Rows with the Maximum Value of a Column by Group\n--------------------------------------------------------\n\nThis example returns the best test results of each student:\n\nSELECT name, test, score FROM student_tests st1 WHERE score = (\n SELECT MAX(score) FROM student st2 WHERE st1.name = st2.name\n); \n+---------+--------+-------+\n| name    | test   | score |\n+---------+--------+-------+\n| Chun    | SQL    |    75 |\n| Esben   | SQL    |    43 |\n| Kaolin  | Tuning |    88 |\n| Tatiana | SQL    |    87 |\n+---------+--------+-------+\n\nCalculating Age\n---------------\n\nThe TIMESTAMPDIFF function can be used to calculate someone\'s age:\n\nSELECT CURDATE() AS today;\n+------------+\n| today      |\n+------------+\n| 2014-02-17 |\n+------------+\n\nSELECT name, date_of_birth, TIMESTAMPDIFF(YEAR,date_of_birth,\'2014-08-02\') AS\nage \n FROM student_details;\n+---------+---------------+------+\n| name    | date_of_birth | age  |\n+---------+---------------+------+\n| Chun    | 1993-12-31    |   20 |\n| Esben   | 1946-01-01    |   68 |\n| Kaolin  | 1996-07-16    |   18 |\n| Tatiana | 1988-04-13    |   26 |\n+---------+---------------+------+\n\nSee TIMESTAMPDIFF() for more.\n\nUsing User-defined Variables\n----------------------------\n\nThis example sets a user-defined variable with the average test score, and\nthen uses it in a later query to return all results above the average.\n\nSELECT @avg_score:= AVG(score) FROM student_tests;\n+-------------------------+\n| @avg_score:= AVG(score) |\n+-------------------------+\n|            67.000000000 |\n+-------------------------+\n\nSELECT * FROM student_tests WHERE score > @avg_score;\n+---------+--------+-------+------------+\n| name    | test   | score | test_date  |\n+---------+--------+-------+------------+\n| Chun    | SQL    |    75 | 2012-11-05 |\n| Chun    | Tuning |    73 | 2013-06-14 |\n| Kaolin  | Tuning |    88 | 2013-12-29 |\n| Tatiana | SQL    |    87 | 2012-04-28 |\n| Tatiana | Tuning |    83 | 2013-09-30 |\n+---------+--------+-------+------------+\n\nUser-defined variables can also be used to add an incremental counter to a\nresultset:\n\nSET @count = 0;\n\nSELECT @count := @count + 1 AS counter, name, date_of_birth FROM\nstudent_details;\n+---------+---------+---------------+\n| counter | name    | date_of_birth |\n+---------+---------+---------------+\n|       1 | Chun    | 1993-12-31    |\n|       2 | Esben   | 1946-01-01    |\n|       3 | Kaolin  | 1996-07-16    |\n|       4 | Tatiana | 1988-04-13    |\n+---------+---------+---------------+\n\nSee User-defined Variables for more.\n\nView Tables in Order of Size\n----------------------------\n\nReturns a list of all tables in the database, ordered by size:\n\nSELECT table_schema as `DB`, table_name AS `Table`, \n ROUND(((data_length + index_length) / 1024 / 1024), 2) `Size (MB)`\n FROM information_schema.TABLES\n ORDER BY (data_length + index_length) DESC;\n\n+--------------------+---------------------------------------+-----------+\n| DB                 | Table                                 | Size (MB) |\n+--------------------+---------------------------------------+-----------+\n| wordpress          | wp_simple_history_contexts            |      7.05 |\n| wordpress          | wp_posts                              |      6.59 |\n| wordpress          | wp_simple_history                     |      3.05 |\n| wordpress          | wp_comments                           |      2.73 |\n| wordpress          | wp_commentmeta                        |      2.47 |\n| wordpress          | wp_simple_login_log                   |      2.03 |\n...\n\nRemoving Duplicates\n-------------------\n\nMariaDB starting with 10.3\n--------------------------\nThe following syntax is only valid MariaDB 10.3 and beyond:\n\nThis example assumes there\'s a unique ID, but that all other fields are\nidentical. In the example below, there are 4 records, 3 of which are\nduplicates, so two of the three duplicates need to be removed. The\nintermediate SELECT is not necessary, but demonstrates what is being returned.\n\nCREATE TABLE t (id INT, f1 VARCHAR(2));\n\nINSERT INTO t VALUES (1,\'a\'), (2,\'a\'), (3,\'b\'), (4,\'a\');\n\nSELECT * FROM t t1, t t2 WHERE t1.f1=t2.f1 AND t1.id<>t2.id AND t1.id=(\n SELECT MAX(id) FROM t tab WHERE tab.f1=t1.f1\n);\n+------+------+------+------+\n| id   | f1   | id   | f1   |\n+------+------+------+------+\n|    4 | a    |    1 | a    |\n|    4 | a    |    2 | a    |\n+------+------+------+------+\n\nDELETE FROM t WHERE id IN (\n SELECT t2.id FROM t t1, t t2 WHERE t1.f1=t2.f1 AND t1.id<>t2.id AND t1.id=(\n  SELECT MAX(id) FROM t tab WHERE tab.f1=t1.f1\n )\n);\nQuery OK, 2 rows affected (0.120 sec)\n\nSELECT * FROM t;\n+------+------+\n| id   | f1   |\n+------+------+\n|    3 | b    |\n|    4 | a    |\n+------+------\n\nURL: https://mariadb.com/kb/en/useful-mariadb-queries/','','https://mariadb.com/kb/en/useful-mariadb-queries/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (463,28,'ANALYZE FORMAT=JSON','ANALYZE FORMAT=JSON is a mix of the EXPLAIN FORMAT=JSON and ANALYZE statement\nfeatures. The ANALYZE FORMAT=JSON $statement will execute $statement, and then\nprint the output of EXPLAIN FORMAT=JSON, amended with data from the query\nexecution.\n\nBasic Execution Data\n--------------------\n\nYou can get the following also from tabular ANALYZE statement form:\n\n* r_rows  is provided for any node that reads rows. It shows how many rows\nwere read, on average \n* r_filtered is provided whenever there is a condition that is checked.  It\nshows the percentage of rows left after checking the condition.\n\nAdvanced Execution Data\n-----------------------\n\nThe most important data not available in the regular tabula ANALYZE statement\nare:\n\n* r_loops field.  This shows how many times the node was executed. Most query\nplan elements have this field.\n* r_total_time_ms field. It shows how much time in total was spent executing\nthis node. If the node has subnodes, their execution time is included.\n* r_buffer_size field. Query plan nodes that make use of buffers report the\nsize of buffer that was was used.\n\nSHOW ANALYZE FORMAT=JSON\n------------------------\n\nMariaDB starting with 10.9\n--------------------------\nSHOW ANALYZE FORMAT=JSON for <connection_id> extends ANALYZE [FORMAT=JSON]\n<select> to allow one to analyze a query currently running in another\nconnection.\n\nData About Individual Query Plan Nodes\n--------------------------------------\n\n* filesort node reports whether sorting was done with LIMIT n parameter, and\nhow many rows were in the sort result. \n* block-nl-join node has r_loops field, which allows to tell whether Using\njoin buffer was efficient \n* range-checked-for-each-record reports counters that show the result of the\ncheck. \n* expression-cache is used for subqueries, and it reports how many times the\ncache was used, and what cache hit ratio was.\n* union_result node has r_rows so one can see how many rows were produced\nafter UNION operation\n* and so forth\n\nUse Cases\n---------\n\nSee Examples of ANALYZE FORMAT=JSON.\n\nURL: https://mariadb.com/kb/en/analyze-format-json/','','https://mariadb.com/kb/en/analyze-format-json/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (464,28,'ANALYZE FORMAT=JSON Examples','Example #1\n----------\n\nCustomers who have ordered more than 1M goods.\n\nANALYZE FORMAT=JSON\nSELECT COUNT(*)\nFROM customer\nWHERE\n (SELECT SUM(o_totalprice) FROM orders WHERE o_custkey=c_custkey) > 1000*1000;\n\nThe query takes 40 seconds over cold cache\n\nEXPLAIN: {\n \"query_block\": {\n  \"select_id\": 1,\n  \"r_loops\": 1,\n  \"r_total_time_ms\": 39872,\n  \"table\": {\n   \"table_name\": \"customer\",\n   \"access_type\": \"index\",\n   \"key\": \"i_c_nationkey\",\n   \"key_length\": \"5\",\n   \"used_key_parts\": [\"c_nationkey\"],\n   \"r_loops\": 1,\n   \"rows\": 150303,\n   \"r_rows\": 150000,\n   \"r_total_time_ms\": 270.3,\n   \"filtered\": 100,\n   \"r_filtered\": 60.691,\n   \"attached_condition\": \"((subquery#2) > <cache>((1000 * 1000)))\",\n   \"using_index\": true\n  },\n  \"subqueries\": [\n   {\n    \"query_block\": {\n     \"select_id\": 2,\n     \"r_loops\": 150000,\n     \"r_total_time_ms\": 39531,\n     \"table\": {\n      \"table_name\": \"orders\",\n      \"access_type\": \"ref\",\n      \"possible_keys\": [\"i_o_custkey\"],\n      \"key\": \"i_o_custkey\",\n      \"key_length\": \"5\",\n      \"used_key_parts\": [\"o_custkey\"],\n      \"ref\": [\"dbt3sf1.customer.c_custkey\"],\n      \"r_loops\": 150000,\n      \"rows\": 7,\n      \"r_rows\": 10,\n      \"r_total_time_ms\": 39208,\n      \"filtered\": 100,\n      \"r_filtered\": 100\n     }\n    }\n   }\n  ]\n }\n}\nANALYZE shows that 39.2 seconds were spent in the subquery, which was executed\n150K times (for every row of outer table).\n\nURL: https://mariadb.com/kb/en/analyze-formatjson-examples/','','https://mariadb.com/kb/en/analyze-formatjson-examples/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (465,28,'ANALYZE Statement','Description\n-----------\n\nThe ANALYZE statement is similar to the EXPLAIN statement. ANALYZE statement\nwill invoke the optimizer, execute the statement, and then produce EXPLAIN\noutput instead of the result set. The EXPLAIN output will be annotated with\nstatistics from statement execution.\n\nThis lets one check how close the optimizer\'s estimates about the query plan\nare to the reality. ANALYZE produces an overview, while the ANALYZE\nFORMAT=JSON command provides a more detailed view of the query plan and the\nquery execution.\n\nThe syntax is\n\nANALYZE explainable_statement;\n\nwhere the statement is any statement for which one can run EXPLAIN.\n\nCommand Output\n--------------\n\nConsider an example:\n\nANALYZE SELECT * FROM tbl1 \nWHERE key1 \n BETWEEN 10 AND 200 AND\n col1 LIKE \'foo%\'\\G\n\n*************************** 1. row ***************************\n     id: 1\n select_type: SIMPLE\n    table: tbl1\n    type: range\npossible_keys: key1\n     key: key1\n   key_len: 5\n     ref: NULL\n    rows: 181\n   r_rows: 181\n  filtered: 100.00\n r_filtered: 10.50\n    Extra: Using index condition; Using where\n\nCompared to EXPLAIN, ANALYZE produces two extra columns:\n\n* r_rows is an observation-based counterpart of the rows column. It shows how\nmany rows were actually read from the table. \n* r_filtered is an observation-based counterpart of the filtered column. It\nshows which fraction of rows was left after applying the WHERE condition.\n\nInterpreting the Output\n-----------------------\n\nJoins\n-----\n\nLet\'s consider a more complicated example.\n\nANALYZE SELECT *\nFROM orders, customer \nWHERE\n customer.c_custkey=orders.o_custkey AND\n customer.c_acctbal < 0 AND\n orders.o_totalprice > 200*1000\n\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n| id | select_type | table    | type | possible_keys | key         | key_len |\nref                | rows   | r_rows | filtered | r_filtered | Extra       |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n|  1 | SIMPLE      | customer | ALL  | PRIMARY,...   | NULL        | NULL    |\nNULL               | 149095 | 150000 |    18.08 |       9.13 | Using where |\n|  1 | SIMPLE      | orders   | ref  | i_o_custkey   | i_o_custkey | 5       |\ncustomer.c_custkey |      7 |     10 |   100.00 |      30.03 | Using where |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n\nHere, one can see that\n\n* For table customer, customer.rows=149095,  customer.r_rows=150000. The\nestimate for number of rows we will read was fairly precise\n* customer.filtered=18.08, customer.r_filtered=9.13.  The optimizer somewhat\noverestimated the number of records that will match selectivity of condition\nattached to `customer` table (in general, when you have a full scan and\nr_filtered is less than 15%, it\'s time to consider adding an appropriate\nindex).\n* For table orders,  orders.rows=7, orders.r_rows=10.  This means that on\naverage, there are 7 orders for a given c_custkey, but in our case there were\n10, which is close to the expectation (when this number is consistently far\nfrom the expectation, it may be time to run ANALYZE TABLE, or even edit the\ntable statistics manually to get better query plans).\n* orders.filtered=100, orders.r_filtered=30.03. The optimizer didn\'t have any\nway to estimate which fraction of records will be left after it checks the\ncondition that is attached to table orders (it\'s orders.o_totalprice >\n200*1000). So, it used 100%. In reality, it is 30%. 30% is typically not\nselective enough to warrant adding new indexes. For joins with many tables, it\nmight be worth to collect and use column statistics for columns in question,\nthis may help the optimizer to pick a better query plan.\n\nMeaning of NULL in r_rows and r_filtered\n----------------------------------------\n\nLet\'s modify the previous example slightly\n\nANALYZE SELECT * \nFROM orders, customer \nWHERE\n customer.c_custkey=orders.o_custkey AND\n customer.c_acctbal < -0 AND\n customer.c_comment LIKE \'%foo%\' AND\n orders.o_totalprice > 200*1000;\n\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n| id | select_type | table    | type | possible_keys | key         | key_len |\nref                | rows   | r_rows | filtered | r_filtered | Extra       |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n|  1 | SIMPLE      | customer | ALL  | PRIMARY,...   | NULL        | NULL    |\nNULL               | 149095 | 150000 |    18.08 |       0.00 | Using where |\n|  1 | SIMPLE      | orders   | ref  | i_o_custkey   | i_o_custkey | 5       |\ncustomer.c_custkey |      7 |   NULL |   100.00 |       NULL | Using where |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n\nHere, one can see that orders.r_rows=NULL and orders.r_filtered=NULL. This\nmeans that table orders was not scanned even once. Indeed, we can also see\ncustomer.r_filtered=0.00. This shows that a part of WHERE attached to table\n`customer` was never satisfied (or, satisfied in less than 0.01% of cases).\n\nANALYZE FORMAT=JSON\n-------------------\n\nANALYZE FORMAT=JSON produces JSON output. It produces much more information\nthan tabular ANALYZE.\n\nNotes\n-----\n\n* ANALYZE UPDATE or ANALYZE DELETE will actually make updates/deletes (ANALYZE\nSELECT will perform the select operation and then discard the resultset).\n* PostgreSQL has a similar command, EXPLAIN ANALYZE.\n* The EXPLAIN in the slow query log feature allows MariaDB to have ANALYZE\noutput of slow queries printed into the slow query log (see MDEV-6388).\n\nURL: https://mariadb.com/kb/en/analyze-statement/','','https://mariadb.com/kb/en/analyze-statement/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (466,28,'EXPLAIN','Syntax\n------\n\nEXPLAIN tbl_name [col_name | wild]\n\nOr\n\nEXPLAIN [EXTENDED | PARTITIONS | FORMAT=JSON] \n {SELECT select_options | UPDATE update_options | DELETE delete_options}\n\nDescription\n-----------\n\nThe EXPLAIN statement can be used either as a synonym for DESCRIBE or as a way\nto obtain information about how MariaDB executes a SELECT, UPDATE or DELETE\nstatement:\n\n* \'EXPLAIN tbl_name\' is synonymous with \n \'DESCRIBE tbl_name\' or\n \'SHOW COLUMNS FROM tbl_name\'.\n* When you precede a SELECT, UPDATE or a DELETE statement with the keyword \n EXPLAIN, MariaDB displays information from the optimizer\n about the query execution plan. That is, MariaDB explains how it would\n process the SELECT, UPDATE or DELETE, including information about how tables\n are joined and in which order. EXPLAIN EXTENDED can be\n used to provide additional information.\n* EXPLAIN PARTITIONS is useful only when examining queries involving\npartitioned tables. For details, see Partition pruning and selection.\n* ANALYZE statement performs the query as well as producing EXPLAIN output,\nand provides actual as well as estimated statistics.\n* EXPLAIN output can be printed in the slow query log. See EXPLAIN in the Slow\nQuery Log for details.\n\nSHOW EXPLAIN shows the output of a running statement. In some cases, its\noutput can be closer to reality than EXPLAIN.\n\nThe ANALYZE statement runs a statement and returns information about its\nexecution plan. It also shows additional columns, to check how much the\noptimizer\'s estimation about filtering and found rows are close to reality.\n\nThere is an online EXPLAIN Analyzer that you can use to share EXPLAIN and\nEXPLAIN EXTENDED output with others.\n\nEXPLAIN can acquire metadata locks in the same way that SELECT does, as it\nneeds to know table metadata and, sometimes, data as well.\n\nColumns in EXPLAIN ... SELECT\n-----------------------------\n\n+--------------------------------------+--------------------------------------+\n| Column name                          | Description                          |\n+--------------------------------------+--------------------------------------+\n| id                                   | Sequence number that shows in which  |\n|                                      | order tables are joined.             |\n+--------------------------------------+--------------------------------------+\n| select_type                          | What kind of SELECT the table comes  |\n|                                      | from.                                |\n+--------------------------------------+--------------------------------------+\n| table                                | Alias name of table. Materialized    |\n|                                      | temporary tables for sub queries     |\n|                                      | are named <subquery#>                |\n+--------------------------------------+--------------------------------------+\n| type                                 | How rows are found from the table    |\n|                                      | (join type).                         |\n+--------------------------------------+--------------------------------------+\n| possible_keys                        | keys in table that could be used to  |\n|                                      | find rows in the table               |\n+--------------------------------------+--------------------------------------+\n| key                                  | The name of the key that is used to  |\n|                                      | retrieve rows. NULL is no key was    |\n|                                      | used.                                |\n+--------------------------------------+--------------------------------------+\n| key_len                              | How many bytes of the key that was   |\n|                                      | used (shows if we are using only     |\n|                                      | parts of the multi-column key).      |\n+--------------------------------------+--------------------------------------+\n| ref                                  | The reference that is used as the    |\n|                                      | key value.                           |\n+--------------------------------------+--------------------------------------+\n| rows                                 | An estimate of how many rows we      |\n|                                      | will find in the table for each key  |\n|                                      | lookup.                              |\n+--------------------------------------+--------------------------------------+\n| Extra                                | Extra information about this join.   |\n+--------------------------------------+--------------------------------------+\n\nHere are descriptions of the values for some of the more complex columns in\nEXPLAIN ... SELECT:\n\n\"Select_type\" Column\n--------------------\n\nThe select_type column can have the following values:\n\n+-----------------+-----------------------------------+-----------------------+\n| Value           | Description                       | Comment               |\n+-----------------+-----------------------------------+-----------------------+\n| DEPENDENT       | The SUBQUERY is DEPENDENT.        |                       |\n| SUBQUERY        |                                   |                       |\n+-----------------+-----------------------------------+-----------------------+\n| DEPENDENT UNION | The UNION is DEPENDENT.           |                       |\n+-----------------+-----------------------------------+-----------------------+\n| DERIVED         | The SELECT is DERIVED from the    |                       |\n|                 | PRIMARY.                          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| MATERIALIZED    | The SUBQUERY is MATERIALIZED.     | Materialized tables   |\n|                 |                                   | will be populated at  |\n|                 |                                   | first access and      |\n|                 |                                   | will be accessed by   |\n|                 |                                   | the primary key (=    |\n|                 |                                   | one key lookup).      |\n|                 |                                   | Number of rows in     |\n|                 |                                   | EXPLAIN shows the     |\n|                 |                                   | cost of populating    |\n|                 |                                   | the table             |\n+-----------------+-----------------------------------+-----------------------+\n| PRIMARY         | The SELECT is in the outermost    |                       |\n|                 | query, but there is also a        |                       |\n|                 | SUBQUERY within it.               |                       |\n+-----------------+-----------------------------------+-----------------------+\n| SIMPLE          | It is a simple SELECT query       |                       |\n|                 | without any SUBQUERY or UNION.    |                       |\n+-----------------+-----------------------------------+-----------------------+\n| SUBQUERY        | The SELECT is a SUBQUERY of the   |                       |\n|                 | PRIMARY.                          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNCACHEABLE     | The SUBQUERY is UNCACHEABLE.      |                       |\n| SUBQUERY        |                                   |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNCACHEABLE     | The UNION is UNCACHEABLE.         |                       |\n| UNION           |                                   |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNION           | The SELECT is a UNION of the      |                       |\n|                 | PRIMARY.                          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNION RESULT    | The result of the UNION.          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| LATERAL DERIVED | The SELECT uses a Lateral         |                       |\n|                 | Derived optimization              |                       |\n+-----------------+-----------------------------------+-----------------------+\n\n\"Type\" Column\n-------------\n\nThis column contains information on how the table is accessed.\n\n+------------------------+---------------------------------------------------+\n| Value                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| ALL                    | A full table scan is done for the table (all      |\n|                        | rows are read). This is bad if the table is       |\n|                        | large and the table is joined against a previous  |\n|                        | table!  This happens when the optimizer could     |\n|                        | not find any usable index to access rows.         |\n+------------------------+---------------------------------------------------+\n| const                  | There is only one possibly matching row in the    |\n|                        | table. The row is read before the optimization    |\n|                        | phase and all columns in the table are treated    |\n|                        | as constants.                                     |\n+------------------------+---------------------------------------------------+\n| eq_ref                 | A unique index is used to find the rows. This is  |\n|                        | the best possible plan to find the row.           |\n+------------------------+---------------------------------------------------+\n| fulltext               | A fulltext index is used to access the rows.      |\n+------------------------+---------------------------------------------------+\n| index_merge            | A \'range\' access is done for for several index    |\n|                        | and the found rows are merged. The key column     |\n|                        | shows which keys are used.                        |\n+------------------------+---------------------------------------------------+\n| index_subquery         | This is similar as ref, but used for sub queries  |\n|                        | that are transformed to key lookups.              |\n+------------------------+---------------------------------------------------+\n| index                  | A full scan over the used index.  Better than     |\n|                        | ALL but still bad if index is large and the       |\n|                        | table is joined against a previous table.         |\n+------------------------+---------------------------------------------------+\n| range                  | The table will be accessed with a key over one    |\n|                        | or more value ranges.                             |\n+------------------------+---------------------------------------------------+\n| ref_or_null            | Like \'ref\' but in addition another search for     |\n|                        | the \'null\' value is done if the first value was   |\n|                        | not found. This happens usually with sub queries. |\n+------------------------+---------------------------------------------------+\n| ref                    | A non unique index or prefix of an unique index   |\n|                        | is used to find the rows. Good if the prefix      |\n|                        | doesn\'t match many rows.                          |\n+------------------------+---------------------------------------------------+\n| system                 | The table has 0 or 1 rows.                        |\n+------------------------+---------------------------------------------------+\n| unique_subquery        | This is similar as eq_ref, but used for sub       |\n|                        | queries that are transformed to key lookups       |\n+------------------------+---------------------------------------------------+\n\n\"Extra\" Column\n--------------\n\nThis column consists of one or more of the following values, separated by \';\'\n\nNote that some of these values are detected after the optimization phase.\n\nThe optimization phase can do the following changes to the WHERE clause:\n\n* Add the expressions from the ON and USING clauses to the WHERE\n clause.\n* Constant propagation:  If there is column=constant, replace all column\n instances with this constant.\n* Replace all columns from \'const\' tables with their values.\n* Remove the used key columns from the WHERE (as this will be tested as\n part of the key lookup).\n* Remove impossible constant sub expressions.\n For example WHERE \'(a=1 and a=2) OR b=1\' becomes \'b=1\'.\n* Replace columns with other columns that has identical values:\n Example:  WHERE a=b and a=c may be treated\n as \'WHERE a=b and a=c and b=c\'.\n* Add extra conditions to detect impossible row conditions earlier. This\n happens mainly with OUTER JOIN where we in some cases add detection\n of NULL values in the WHERE (Part of \'Not exists\' optimization).\n This can cause an unexpected \'Using where\' in the Extra column.\n* For each table level we remove expressions that have already been tested when\n we read the previous row. Example: When joining tables t1 with t2\n using the following WHERE \'t1.a=1 and t1.a=t2.b\', we don\'t have to\n test \'t1.a=1\' when checking rows in t2 as we already know that this\n expression is true.\n\n+------------------------+---------------------------------------------------+\n| Value                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| const row not found    | The table was a system table (a table with        |\n|                        | should exactly one row), but no row was found.    |\n+------------------------+---------------------------------------------------+\n| Distinct               | If distinct optimization (remove duplicates) was  |','','https://mariadb.com/kb/en/explain/');
update help_topic set description = CONCAT(description, '\n|                        | used. This is marked only for the last table in   |\n|                        | the SELECT.                                       |\n+------------------------+---------------------------------------------------+\n| Full scan on NULL key  | The table is a part of the sub query and if the   |\n|                        | value that is used to match the sub query will    |\n|                        | be NULL, we will do a full table scan.            |\n+------------------------+---------------------------------------------------+\n| Impossible HAVING      | The used HAVING clause is always false so the     |\n|                        | SELECT will return no rows.                       |\n+------------------------+---------------------------------------------------+\n| Impossible WHERE       | The used WHERE clause is always false so the      |\n| noticed after reading  | SELECT will return no rows. This case was         |\n| const tables.          | detected after we had read all \'const\' tables     |\n|                        | and used the column values as constant in the     |\n|                        | WHERE clause. For example: WHERE const_column=5   |\n|                        | and const_column had a value of 4.                |\n+------------------------+---------------------------------------------------+\n| Impossible WHERE       | The used WHERE clause is always false so the      |\n|                        | SELECT will return no rows. For example: WHERE    |\n|                        | 1=2                                               |\n+------------------------+---------------------------------------------------+\n| No matching min/max    | During early optimization of MIN()/MAX() values   |\n| row                    | it was detected that no row could match the       |\n|                        | WHERE clause. The MIN()/MAX() function will       |\n|                        | return NULL.                                      |\n+------------------------+---------------------------------------------------+\n| no matching row in     | The table was a const table (a table with only    |\n| const table            | one possible matching row), but no row was found. |\n+------------------------+---------------------------------------------------+\n| No tables used         | The SELECT was a sub query that did not use any   |\n|                        | tables. For example a there was no FROM clause    |\n|                        | or a FROM DUAL clause.                            |\n+------------------------+---------------------------------------------------+\n| Not exists             | Stop searching after more row if we find one      |\n|                        | single matching row. This optimization is used    |\n|                        | with LEFT JOIN where one is explicitly searching  |\n|                        | for rows that doesn\'t exists in the LEFT JOIN     |\n|                        | TABLE. Example: SELECT * FROM t1 LEFT JOIN t2 on  |\n|                        | (...) WHERE t2.not_null_column IS NULL.  As       |\n|                        | t2.not_null_column can only be NULL if there was  |\n|                        | no matching row for on condition, we can stop     |\n|                        | searching if we find a single matching row.       |\n+------------------------+---------------------------------------------------+\n| Open_frm_only          | For information_schema tables.  Only the frm      |\n|                        | (table definition file was opened) was opened     |\n|                        | for each matching row.                            |\n+------------------------+---------------------------------------------------+\n| Open_full_table        | For information_schema tables. A full table open  |\n|                        | for each matching row is done to retrieve the     |\n|                        | requested information. (Slow)                     |\n+------------------------+---------------------------------------------------+\n| Open_trigger_only      | For information_schema tables. Only the trigger   |\n|                        | file definition was opened for each matching row. |\n+------------------------+---------------------------------------------------+\n| Range checked for      | This only happens when there was no good default  |\n| each record (index     | index to use but there may some index that could  |\n| map: ...)              | be used when we can treat all columns from        |\n|                        | previous table as constants.  For each row        |\n|                        | combination the optimizer will decide which       |\n|                        | index to use (if any) to fetch a row from this    |\n|                        | table. This is not fast, but faster than a full   |\n|                        | table scan that is the only other choice. The     |\n|                        | index map is a bitmask that shows which index     |\n|                        | are considered for each row condition.            |\n+------------------------+---------------------------------------------------+\n| Scanned 0/1/all        | For information_schema tables. Shows how many     |\n| databases              | times we had to do a directory scan.              |\n+------------------------+---------------------------------------------------+\n| Select tables          | All tables in the join was optimized away. This   |\n| optimized away         | happens when we are only using COUNT(*), MIN()    |\n|                        | and MAX() functions in the SELECT and we where    |\n|                        | able to replace all of these with constants.      |\n+------------------------+---------------------------------------------------+\n| Skip_open_table        | For information_schema tables. The queried table  |\n|                        | didn\'t need to be opened.                         |\n+------------------------+---------------------------------------------------+\n| unique row not found   | The table was detected to be a const table (a     |\n|                        | table with only one possible matching row)        |\n|                        | during the early optimization phase, but no row   |\n|                        | was found.                                        |\n+------------------------+---------------------------------------------------+\n| Using filesort         | Filesort is needed to resolve the query. This     |\n|                        | means an extra phase where we first collect all   |\n|                        | columns to sort, sort them with a disk based      |\n|                        | merge sort and then use the sorted set to         |\n|                        | retrieve the rows in sorted order. If the column  |\n|                        | set is small, we store all the columns in the     |\n|                        | sort file to not have to go to the database to    |\n|                        | retrieve them again.                              |\n+------------------------+---------------------------------------------------+\n| Using index            | Only the index is used to retrieve the needed     |\n|                        | information from the table. There is no need to   |\n|                        | perform an extra seek to retrieve the actual      |\n|                        | record.                                           |\n+------------------------+---------------------------------------------------+\n| Using index condition  | Like \'Using where\' but the where condition is     |\n|                        | pushed down to the table engine for internal      |\n|                        | optimization at the index level.                  |\n+------------------------+---------------------------------------------------+\n| Using index            | Like \'Using index condition\' but in addition we   |\n| condition(BKA)         | use batch key access to retrieve rows.            |\n+------------------------+---------------------------------------------------+\n| Using index for        | The index is being used to resolve a GROUP BY or  |\n| group-by               | DISTINCT query. The rows are not read.  This is   |\n|                        | very efficient if the table has a lot of          |\n|                        | identical index entries as duplicates are         |\n|                        | quickly jumped over.                              |\n+------------------------+---------------------------------------------------+\n| Using intersect(...)   | For index_merge joins. Shows which index are      |\n|                        | part of the intersect.                            |\n+------------------------+---------------------------------------------------+\n| Using join buffer      | We store previous row combinations in a row       |\n|                        | buffer to be able to match each row against all   |\n|                        | of the rows combinations in the join buffer at    |\n|                        | one go.                                           |\n+------------------------+---------------------------------------------------+\n| Using sort_union(...)  | For index_merge joins. Shows which index are      |\n|                        | part of the union.                                |\n+------------------------+---------------------------------------------------+\n| Using temporary        | A temporary table is created to hold the result.  |\n|                        | This typically happens if you are using GROUP     |\n|                        | BY, DISTINCT or ORDER BY.                         |\n+------------------------+---------------------------------------------------+\n| Using where            | A WHERE expression (in additional to the          |\n|                        | possible key lookup) is used to check if the row  |\n|                        | should be accepted. If you don\'t have \'Using      |\n|                        | where\' together with a join type of ALL, you are  |\n|                        | probably doing something wrong!                   |\n+------------------------+---------------------------------------------------+\n| Using where with       | Like \'Using where\' but the where condition is     |\n| pushed condition       | pushed down to the table engine for internal      |\n|                        | optimization at the row level.                    |\n+------------------------+---------------------------------------------------+\n| Using buffer           | The UPDATE statement will first buffer the rows,  |\n|                        | and then run the updates, rather than do updates  |\n|                        | on the fly. See Using Buffer UPDATE Algorithm     |\n|                        | for a detailed explanation.                       |\n+------------------------+---------------------------------------------------+\n\nEXPLAIN EXTENDED\n----------------\n\nThe EXTENDED keyword adds another column, filtered, to the output. This is a\npercentage estimate of the table rows that will be filtered by the condition.\n\nAn EXPLAIN EXTENDED will always throw a warning, as it adds extra Message\ninformation to a subsequent SHOW WARNINGS statement. This includes what the\nSELECT query would look like after optimizing and rewriting rules are applied\nand how the optimizer qualifies columns and tables.\n\nExamples\n--------\n\nAs synonym for DESCRIBE or SHOW COLUMNS FROM:\n\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | YES  |     | NULL    |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | YES  |     | NULL    |                |\n+------------+----------+------+-----+---------+----------------+\n\nA simple set of examples to see how EXPLAIN can identify poor index usage:\n\nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n\nINSERT INTO `employees_example` (`first_name`, `last_name`, `position`,\n`home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692 Promiscuous Plaza\',\n\'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage Circle\', \'326-555-3847\',\n\'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient Avenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy Boulevard\', \'328-555-2349\',\n\'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky Lane\', \'326-555-6329\',\n\'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma Court\', \'329-555-2478\', \'HW1\');\n\nSHOW INDEXES FROM employees_example;\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n| Table             | Non_unique | Key_name      | Seq_in_index | Column_name \n | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |\nIndex_comment |\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n| employees_example |          0 | PRIMARY       |            1 | id          \n | A         |           7 |     NULL | NULL   |      | BTREE      |         |\n       |\n| employees_example |          0 | employee_code |            1 |\nemployee_code | A         |           7 |     NULL | NULL   |      | BTREE    \n |         |               |\n| employees_example |          1 | first_name    |            1 | first_name  \n | A         |        NULL |     NULL | NULL   |      | BTREE      |         |\n       |') WHERE help_topic_id = 466;
update help_topic set description = CONCAT(description, '\n| employees_example |          1 | first_name    |            2 | last_name   \n | A         |        NULL |     NULL | NULL   |      | BTREE      |         |\n       |\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n\nSELECT on a primary key:\n\nEXPLAIN SELECT * FROM employees_example WHERE id=1;\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n| id   | select_type | table             | type  | possible_keys | key     |\nkey_len | ref   | rows | Extra |\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n|    1 | SIMPLE      | employees_example | const | PRIMARY       | PRIMARY | 4\n   | const |    1 |       |\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n\nThe type is const, which means that only one possible result could be\nreturned. Now, returning the same record but searching by their phone number:\n\nEXPLAIN SELECT * FROM employees_example WHERE home_phone=\'326-555-3492\';\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n| id   | select_type | table             | type | possible_keys | key  |\nkey_len | ref  | rows | Extra       |\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n|    1 | SIMPLE      | employees_example | ALL  | NULL          | NULL | NULL \n | NULL |    6 | Using where |\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n\nHere, the type is All, which means no index could be used. Looking at the rows\ncount, a full table scan (all six rows) had to be performed in order to\nretrieve the record. If it\'s a requirement to search by phone number, an index\nwill have to be created.\n\nSHOW EXPLAIN example:\n\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| id   | select_type | table | type  | possible_keys | key  | key_len | ref  |\nrows    | Extra       |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n|    1 | SIMPLE      | tbl   | index | NULL          | a    | 5       | NULL |\n1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nExample of ref_or_null Optimization\n-----------------------------------\n\nSELECT * FROM table_name\n WHERE key_column=expr OR key_column IS NULL;\n\nref_or_null is something that often happens when you use subqueries with NOT\nIN as then one has to do an extra check for NULL values if the first value\ndidn\'t have a matching row.\n\nURL: https://mariadb.com/kb/en/explain/') WHERE help_topic_id = 466;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (467,28,'EXPLAIN ANALYZE','The syntax for the EXPLAIN ANALYZE feature was changed to ANALYZE statement,\navailable since MariaDB 10.1.0. See ANALYZE statement.\n\nURL: https://mariadb.com/kb/en/explain-analyze/','','https://mariadb.com/kb/en/explain-analyze/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (468,28,'EXPLAIN FORMAT=JSON','Synopsis\n--------\n\nEXPLAIN FORMAT=JSON is a variant of EXPLAIN command that produces output in\nJSON form. The output always has one row which has only one column titled\n\"JSON\". The contents are a JSON representation of the query plan, formatted\nfor readability:\n\nEXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE col1=1\\G\n\n*************************** 1. row ***************************\nEXPLAIN: {\n \"query_block\": {\n  \"select_id\": 1,\n  \"table\": {\n   \"table_name\": \"t1\",\n   \"access_type\": \"ALL\",\n   \"rows\": 1000,\n   \"filtered\": 100,\n   \"attached_condition\": \"(t1.col1 = 1)\"\n  }\n }\n}\n\nOutput is different from MySQL\n------------------------------\n\nThe output of MariaDB\'s EXPLAIN FORMAT=JSON is different from EXPLAIN\nFORMAT=JSON in MySQL.The reasons for that are:\n\n* MySQL\'s output has deficiencies. Some are listed here: EXPLAIN FORMAT=JSON\nin MySQL\n* The output of MySQL\'s EXPLAIN FORMAT=JSON is not defined. Even MySQL\nWorkbench has trouble parsing it (see this blog post).\n* MariaDB has query optimizations that MySQL does not have. Ergo, MariaDB\ngenerates query plans that MySQL does not generate.\n\nA (as yet incomplete) list of how MariaDB\'s output is different from MySQL can\nbe found here: EXPLAIN FORMAT=JSON differences from MySQL.\n\nOutput Format\n-------------\n\nTODO: MariaDB\'s output format description.\n\nURL: https://mariadb.com/kb/en/explain-format-json/','','https://mariadb.com/kb/en/explain-format-json/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,28,'DESCRIBE','Syntax\n------\n\n{DESCRIBE | DESC} tbl_name [col_name | wild]\n\nDescription\n-----------\n\nDESCRIBE provides information about the columns in a table. It is a shortcut\nfor SHOW COLUMNS FROM. These statements also display information for views.\n\ncol_name can be a column name, or a string containing the SQL \"%\" and \"_\"\nwildcard characters to obtain output only for the columns with names matching\nthe string. There is no need to enclose the string within quotes unless it\ncontains spaces or other special characters.\n\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | YES  |     | NULL    |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | YES  |     | NULL    |                |\n+------------+----------+------+-----+---------+----------------+\n\nThe description for SHOW COLUMNS provides more information about the output\ncolumns.\n\nURL: https://mariadb.com/kb/en/describe/','','https://mariadb.com/kb/en/describe/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (470,29,'Identifier Names','Databases, tables, indexes, columns, aliases, views, stored routines,\ntriggers, events, variables, partitions, tablespaces, savepoints, labels,\nusers, roles, are collectively known as identifiers, and have certain rules\nfor naming.\n\nIdentifiers may be quoted using the backtick character - `. Quoting is\noptional for identifiers that don\'t contain special characters, or for\nidentifiers that are not reserved words. If the ANSI_QUOTES SQL_MODE flag is\nset, double quotes (\") can also be used to quote identifiers. If the MSSQL\nflag is set, square brackets ([ and ]) can be used for quoting.\n\nEven when using reserved words as names, fully qualified names do not need to\nbe quoted. For example, test.select has only one possible meaning, so it is\ncorrectly parsed even without quotes.\n\nUnquoted\n--------\n\nThe following characters are valid, and allow identifiers to be unquoted:\n\n* ASCII: [0-9,a-z,A-Z$_] (numerals 0-9, basic Latin letters, both lowercase\nand uppercase, dollar sign, underscore)\n* Extended: U+0080 .. U+FFFF\n\nQuoted\n------\n\nThe following characters are valid, but identifiers using them must be quoted:\n\n* ASCII: U+0001 .. U+007F (full Unicode Basic Multilingual Plane (BMP) except\nfor U+0000)\n* Extended: U+0080 .. U+FFFF \n* Identifier quotes can themselves be used as part of an identifier, as long\nas they are quoted.\n\nFurther Rules\n-------------\n\nThere are a number of other rules for identifiers:\n\n* Identifiers are stored as Unicode (UTF-8)\n* Identifiers may or may not be case-sensitive. See Indentifier\nCase-sensitivity.\n* Database, table and column names can\'t end with space characters\n* Identifier names may begin with a numeral, but can\'t only contain numerals\nunless quoted.\n* An identifier starting with a numeral, followed by an \'e\', may be parsed as\na floating point number, and needs to be quoted.\n* Identifiers are not permitted to contain the ASCII NUL character (U+0000)\nand supplementary characters (U+10000 and higher).\n* Names such as 5e6, 9e are not prohibited, but it\'s strongly recommended not\nto use them, as they could lead to ambiguity in certain contexts, being\ntreated as a number or expression.\n* User variables cannot be used as part of an identifier, or as an identifier\nin an SQL statement.\n\nQuote Character\n---------------\n\nThe regular quote character is the backtick character - `, but if the\nANSI_QUOTES SQL_MODE option is specified, a regular double quote - \" may be\nused as well.\n\nThe backtick character can be used as part of an identifier. In that case the\nidentifier needs to be quoted. The quote character can be the backtick, but in\nthat case, the backtick in the name must be escaped with another backtick.\n\nMaximum Length\n--------------\n\n* Databases, tables, columns, indexes, constraints, stored routines, triggers,\nevents, views, tablespaces, servers and log file groups have a maximum length\nof 64 characters.\n* Compound statement labels have a maximum length of 16 characters\n* Aliases have a maximum length of 256 characters, except for column aliases\nin CREATE VIEW statements, which are checked against the maximum column length\nof 64 characters (not the maximum alias length of 256 characters).\n* Users have a maximum length of 80 characters.\n* Roles have a maximum length of 128 characters.\n* Multi-byte characters do not count extra towards towards the character limit.\n\nMultiple Identifiers\n--------------------\n\nMariaDB allows the column name to be used on its own if the reference will be\nunambiguous, or the table name to be used with the column name, or all three\nof the database, table and column names. A period is used to separate the\nidentifiers, and the period can be surrounded by spaces.\n\nExamples\n--------\n\nUsing the period to separate identifiers:\n\nCREATE TABLE t1 (i int);\n\nINSERT INTO t1(i) VALUES (10);\n\nSELECT i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nSELECT t1.i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nSELECT test.t1.i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nThe period can be separated by spaces:\n\nSELECT test . t1 . i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nResolving ambiguity:\n\nCREATE TABLE t2 (i int);\n\nSELECT i FROM t1 LEFT JOIN t2 ON t1.i=t2.i;\nERROR 1052 (23000): Column \'i\' in field list is ambiguous\n\nSELECT t1.i FROM t1 LEFT JOIN t2 ON t1.i=t2.i;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nCreating a table with characters that require quoting:\n\nCREATE TABLE 123% (i int);\nERROR 1064 (42000): You have an error in your SQL syntax; \n check the manual that corresponds to your MariaDB server version for the\nright syntax \n to use near \'123% (i int)\' at line 1\n\nCREATE TABLE `123%` (i int);\nQuery OK, 0 rows affected (0.85 sec)\n\nCREATE TABLE `TABLE` (i int);\nQuery OK, 0 rows affected (0.36 sec)\n\nUsing double quotes as a quoting character:\n\nCREATE TABLE \"SELECT\" (i int);\nERROR 1064 (42000): You have an error in your SQL syntax; \n check the manual that corresponds to your MariaDB server version for the\nright syntax \n to use near \'\"SELECT\" (i int)\' at line 1\n\nSET sql_mode=\'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE TABLE \"SELECT\" (i int);\nQuery OK, 0 rows affected (0.46 sec)\n\nUsing an identifier quote as part of an identifier name:\n\nSHOW VARIABLES LIKE \'sql_mode\';\n+---------------+-------------+\n| Variable_name | Value       |\n+---------------+-------------+\n| sql_mode      | ANSI_QUOTES |\n+---------------+-------------+\n\nCREATE TABLE \"fg`d\" (i int);\nQuery OK, 0 rows affected (0.34 sec)\n\nCreating the table named * (Unicode number: U+002A) requires quoting.\n\nCREATE TABLE `*` (a INT);\n\nFloating point ambiguity:\n\nCREATE TABLE 8984444cce5d (x INT);\nQuery OK, 0 rows affected (0.38 sec)\n\nCREATE TABLE 8981e56cce5d (x INT);\nERROR 1064 (42000): You have an error in your SQL syntax; \n check the manual that corresponds to your MariaDB server version for the\nright syntax \n to use near \'8981e56cce5d (x INT)\' at line 1\n\nCREATE TABLE `8981e56cce5d` (x INT);\nQuery OK, 0 rows affected (0.39 sec)\n\nURL: https://mariadb.com/kb/en/identifier-names/','','https://mariadb.com/kb/en/identifier-names/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (471,29,'Identifier Case-sensitivity','Whether objects are case-sensitive or not is partly determined by the\nunderlying operating system. Unix-based systems are case-sensitive, Windows is\nnot, while Mac OS X is usually case-insensitive by default, but devices can be\nconfigured as case-sensitive using Disk Utility.\n\nDatabase, table, table aliases and trigger names are affected by the systems\ncase-sensitivity, while index, column, column aliases, stored routine and\nevent names are never case sensitive.\n\nLog file group name are case sensitive.\n\nThe lower_case_table_names server system variable plays a key role. It\ndetermines whether table names, aliases and database names are compared in a\ncase-sensitive manner. If set to 0 (the default on Unix-based systems), table\nnames and aliases and database names are compared in a case-sensitive manner.\nIf set to 1 (the default on Windows), names are stored in lowercase and not\ncompared in a case-sensitive manner. If set to 2 (the default on Mac OS X),\nnames are stored as declared, but compared in lowercase.\n\nIt is thus possible to make Unix-based systems behave like Windows and ignore\ncase-sensitivity, but the reverse is not true, as the underlying Windows\nfilesystem can not support this.\n\nEven on case-insensitive systems, you are required to use the same case\nconsistently within the same statement. The following statement fails, as it\nrefers to the table name in a different case.\n\nSELECT * FROM a_table WHERE A_table.id>10;\n\nFor a full list of identifier naming rules, see Identifier Names.\n\nPlease note that lower_case_table_names is a database initialization\nparameter. This means that, along with innodb_page_size, this variable must be\nset before running mysql_install_db, and will not change the behavior of\nservers unless applied before the creation of core system databases.\n\nURL: https://mariadb.com/kb/en/identifier-case-sensitivity/','','https://mariadb.com/kb/en/identifier-case-sensitivity/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (472,29,'Binary Literals','Binary literals can be written in one of the following formats: b\'value\',\nB\'value\' or 0bvalue, where value is a string composed by 0 and 1 digits.\n\nBinary literals are interpreted as binary strings, and are convenient to\nrepresent VARBINARY, BINARY or BIT values.\n\nTo convert a binary literal into an integer, just add 0.\n\nExamples\n--------\n\nPrinting the value as a binary string:\n\nSELECT 0b1000001;\n+-----------+\n| 0b1000001 |\n+-----------+\n| A         |\n+-----------+\n\nConverting the same value into a number:\n\nSELECT 0b1000001+0;\n+-------------+\n| 0b1000001+0 |\n+-------------+\n|          65 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/binary-literals/','','https://mariadb.com/kb/en/binary-literals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (473,29,'Boolean Literals','In MariaDB, FALSE is a synonym of 0 and TRUE is a synonym of 1. These\nconstants are case insensitive, so TRUE, True, and true are equivalent.\n\nThese terms are not synonyms of 0 and 1 when used with the IS operator. So,\nfor example, 10 IS TRUE returns 1, while 10 = TRUE returns 0 (because 1 != 10).\n\nThe IS operator accepts a third constant exists: UNKNOWN. It is always a\nsynonym of NULL.\n\nTRUE and FALSE are reserved words, while UNKNOWN is not.\n\nURL: https://mariadb.com/kb/en/sql-language-structure-boolean-literals/','','https://mariadb.com/kb/en/sql-language-structure-boolean-literals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (474,29,'Date and Time Literals','Standard syntaxes\n-----------------\n\nMariaDB supports the SQL standard and ODBC syntaxes for DATE, TIME and\nTIMESTAMP literals.\n\nSQL standard syntax:\n\n* DATE \'string\'\n* TIME \'string\'\n* TIMESTAMP \'string\'\n\nODBC syntax:\n\n* {d \'string\'}\n* {t \'string\'}\n* {ts \'string\'}\n\nThe timestamp literals are treated as DATETIME literals, because in MariaDB\nthe range of DATETIME is closer to the TIMESTAMP range in the SQL standard.\n\nstring is a string in a proper format, as explained below.\n\nDATE literals\n-------------\n\nA DATE string is a string in one of the following formats: \'YYYY-MM-DD\' or\n\'YY-MM-DD\'. Note that any punctuation character can be used as delimiter. All\ndelimiters must consist of 1 character. Different delimiters can be used in\nthe same string. Delimiters are optional (but if one delimiter is used, all\ndelimiters must be used).\n\nA DATE literal can also be an integer, in one of the following formats:\nYYYYMMDD or YYMMDD.\n\nAll the following DATE literals are valid, and they all represent the same\nvalue:\n\n\'19940101\'\n\'940101\'\n\'1994-01-01\'\n\'94/01/01\'\n\'1994-01/01\'\n\'94:01!01\'\n19940101\n940101\n\nDATETIME literals\n-----------------\n\nA DATETIME string is a string in one of the following formats: \'YYYY-MM-DD\nHH:MM:SS\' or \'YY-MM-DD HH:MM:SS\'. Note that any punctuation character can be\nused as delimiter for the date part and for the time part. All delimiters must\nconsist of 1 character. Different delimiters can be used in the same string.\nThe hours, minutes and seconds parts can consist of one character. For this\nreason, delimiters are mandatory for DATETIME literals.\n\nThe delimiter between the date part and the time part can be a T or any\nsequence of space characters (including tabs, new lines and carriage returns).\n\nA DATETIME literal can also be a number, in one of the following formats:\nYYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD or YYMMDD. In this case, all the time\nsubparts must consist of 2 digits.\n\nAll the following DATE literals are valid, and they all represent the same\nvalue:\n\n\'1994-01-01T12:30:03\'\n\'1994/01/01\\n\\t 12+30+03\'\n\'1994/01\\\\01\\n\\t 12+30-03\'\n\'1994-01-01 12:30:3\'\n\nTIME literals\n-------------\n\nA TIME string is a string in one of the following formats: \'D HH:MM:SS\',\n\'HH:MM:SS, \'D HH:MM\', \'HH:MM\', \'D HH\', or \'SS\'. D is a value from 0 to 34\nwhich represents days. : is the only allowed delimiter for TIME literals.\nDelimiters are mandatory, with an exception: the \'HHMMSS\' format is allowed.\nWhen delimiters are used, each part of the literal can consist of one\ncharacter.\n\nA TIME literal can also be a number in one of the following formats: HHMMSS,\nMMSS, or SS.\n\nThe following literals are equivalent:\n\n\'09:05:00\'\n\'9:05:0\'\n\'9:5:0\'\n\'090500\'\n\n2-digit years\n-------------\n\nThe year part in DATE and DATETIME literals is determined as follows:\n\n* 70 - 99 = 1970 - 1999\n* 00 - 69 = 2000 - 2069\n\nMicroseconds\n------------\n\nDATETIME and TIME literals can have an optional microseconds part. For both\nstring and numeric forms, it is expressed as a decimal part. Up to 6 decimal\ndigits are allowed. Examples:\n\n\'12:30:00.123456\'\n123000.123456\n\nSee Microseconds in MariaDB for details.\n\nDate and time literals and the SQL_MODE\n---------------------------------------\n\nUnless the SQL_MODE NO_ZERO_DATE flag is set, some special values are allowed:\nthe \'0000-00-00\' DATE, the \'00:00:00\' TIME, and the 0000-00-00 00:00:00\nDATETIME.\n\nIf the ALLOW_INVALID_DATES flag is set, the invalid dates (for example, 30th\nFebruary) are allowed. If not, if the NO_ZERO_DATE is set, an error is\nproduced; otherwise, a zero-date is returned.\n\nUnless the NO_ZERO_IN_DATE flag is set, each subpart of a date or time value\n(years, hours...) can be set to 0.\n\nURL: https://mariadb.com/kb/en/date-and-time-literals/','','https://mariadb.com/kb/en/date-and-time-literals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (475,29,'Hexadecimal Literals','Hexadecimal literals can be written using any of the following syntaxes:\n\n* x\'value\'\n* X\'value\' (SQL standard)\n* 0xvalue (ODBC)\n\nvalue is a sequence of hexadecimal digits (from 0 to 9 and from A to F). The\ncase of the digits does not matter. With the first two syntaxes, value must\nconsist of an even number of digits. With the last syntax, digits can be even,\nand they are treated as if they had an extra 0 at the beginning.\n\nNormally, hexadecimal literals are interpreted as binary string, where each\npair of digits represents a character. When used in a numeric context, they\nare interpreted as integers. (See the example below). In no case can a\nhexadecimal literal be a decimal number.\n\nThe first two syntaxes; X\'value\' and x\'value, follow the SQL standard, and\nbehave as a string in all contexts in MariaDB since MariaDB 10.0.3 and MariaDB\n5.5.31 (fixing MDEV-4489). The latter syntax, 0xvalue, is a MySQL/MariaDB\nextension for hex hybrids and behaves as a string or as a number depending on\ncontext. MySQL treats all syntaxes the same, so there may be different results\nin MariaDB and MySQL (see below).\n\nExamples\n--------\n\nRepresenting the a character with the three syntaxes explained above:\n\nSELECT x\'61\', X\'61\', 0x61;\n+-------+-------+------+\n| x\'61\' | X\'61\' | 0x61 |\n+-------+-------+------+\n| a     | a     | a    |\n+-------+-------+------+\n\nHexadecimal literals in a numeric context:\n\nSELECT 0 + 0xF, -0xF;\n+---------+------+\n| 0 + 0xF | -0xF |\n+---------+------+\n|      15 |  -15 |\n+---------+------+\n\nFun with Types\n--------------\n\nCREATE TABLE t1 (a INT, b VARCHAR(10));\nINSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31), COALESCE(0x61));\n\nSELECT * FROM t1;\n+------+------+\n| a    | b    |\n+------+------+\n|   49 | a    |\n|    1 | a    |\n+------+------+\n\nThe reason for the differing results above is that when 0x31 is inserted\ndirectly to the column, it\'s treated as a number, while when 0x31 is passed to\nCOALESCE(), it\'s treated as a string, because:\n\n* HEX values have a string data type by default.\n* COALESCE() has the same data type as the argument.\n\nDifferences Between MariaDB and MySQL\n-------------------------------------\n\nSELECT x\'0a\'+0;\n+---------+\n| x\'0a\'+0 |\n+---------+\n|       0 |\n+---------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'\\x0A\'\n\nSELECT X\'0a\'+0;\n+---------+\n| X\'0a\'+0 |\n+---------+\n|       0 |\n+---------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'\\x0A\'\n\nSELECT 0x0a+0;\n+--------+\n| 0x0a+0 |\n+--------+\n|     10 |\n+--------+\n\nIn MySQL (up until at least MySQL 8.0.26):\n\nSELECT x\'0a\'+0;\n+---------+\n| x\'0a\'+0 |\n+---------+\n|      10 |\n+---------+\n\nSELECT X\'0a\'+0;\n+---------+\n| X\'0a\'+0 |\n+---------+\n|      10 |\n+---------+\n\nSELECT 0x0a+0;\n+--------+\n| 0x0a+0 |\n+--------+\n|     10 |\n+--------+\n\nURL: https://mariadb.com/kb/en/hexadecimal-literals/','','https://mariadb.com/kb/en/hexadecimal-literals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,29,'Identifier Qualifiers','Qualifiers are used within SQL statements to reference data structures, such\nas databases, tables, or columns. For example, typically a SELECT query\ncontains references to some columns and at least one table.\n\nQualifiers can be composed by one or more identifiers, where the initial parts\naffect the context within which the final identifier is interpreted:\n\n* For a database, only the database identifier needs to be specified.\n* For objects which are contained in a database (like tables, views,\nfunctions, etc) the database identifier can be specified. If no database is\nspecified, the current database is assumed (see USE and DATABASE() for more\ndetails). If there is no default database and no database is specified, an\nerror is issued.\n* For column names, the table and the database are generally obvious from the\ncontext of the statement. It is however possible to specify the table\nidentifier, or the database identifier plus the table identifier.\n* An identifier is fully-qualified if it contains all possible qualifiers, for\nexample, the following column is fully qualified: db_name.tbl_name.col_name.\n\nIf a qualifier is composed by more than one identifier, a dot (.) must be used\nas a separator. All identifiers can be quoted individually. Extra spacing\n(including new lines and tabs) is allowed.\n\nAll the following examples are valid:\n\n* db_name.tbl_name.col_name\n* tbl_name\n* `db_name`.`tbl_name`.`col_name`\n* `db_name` . `tbl_name`\n* db_name. tbl_name\n\nIf a table identifier is prefixed with a dot (.), the default database is\nassumed. This syntax is supported for ODBC compliance, but has no practical\neffect on MariaDB. These qualifiers are equivalent:\n\n* tbl_name\n* . tbl_name\n* .`tbl_name`\n* . `tbl_name`\n\nFor DML statements, it is possible to specify a list of the partitions using\nthe PARTITION clause. See Partition Pruning and Selection for details.\n\nURL: https://mariadb.com/kb/en/identifier-qualifiers/','','https://mariadb.com/kb/en/identifier-qualifiers/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (477,29,'Identifier to File Name Mapping','Some identifiers map to a file name on the filesystem. Databases each have\ntheir own directory, while, depending on the storage engine, table names and\nindex names may map to a file name.\n\nNot all characters that are allowed in table names can be used in file names.\nEvery filesystem has its own rules of what characters can be used in file\nnames. To let the user create tables using all characters allowed in the SQL\nStandard and to not depend on whatever particular filesystem a particular\ndatabase resides, MariaDB encodes \"potentially unsafe\" characters in the table\nname to derive the corresponding file name.\n\nThis is implemented using a special character set. MariaDB converts a table\nname to the \"filename\" character set to get the file name for this table. And\nit converts the file name from the \"filename\" character set to, for example,\nutf8 to get the table name for this file name.\n\nThe conversion rules are as follows: if the identifier is made up only of\nbasic Latin numbers, letters and/or the underscore character, the encoding\nmatches the name (see however Identifier Case Sensitivity). Otherwise they are\nencoded according to the following table:\n\n+-----------------+------------+-----------+--------+-----------+-----------+\n| Code Range      | Pattern    | Number    | Used   | Unused    | Blocks    |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 00C0..017F      | [@][0..4][ | 5*20= 100 | 97     | 3         | Latin-1   |\n|                 | ..z]       |           |        |           | Supplemen |\n|                 |            |           |        |           |  + Latin  |\n|                 |            |           |        |           | Extended- |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0370..03FF      | [@][5..9][ | 5*20= 100 | 88     | 12        | Greek     |\n|                 | ..z]       |           |        |           | and       |\n|                 |            |           |        |           | Coptic    |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0400..052F      | [@][g..z][ | 20*7= 140 | 137    | 3         | Cyrillic  |\n|                 | ..6]       |           |        |           | +         |\n|                 |            |           |        |           | Cyrillic  |\n|                 |            |           |        |           | Supplemen |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0530..058F      | [@][g..z][ | 20*2= 40  | 38     | 2         | Armenian  |\n|                 | ..8]       |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 2160..217F      | [@][g..z][ | 20*1= 20  | 16     | 4         | Number    |\n|                 | ]          |           |        |           | Forms     |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0180..02AF      | [@][g..z][ | 20*11=220 | 203    | 17        | Latin     |\n|                 | ..k]       |           |        |           | Extended- |\n|                 |            |           |        |           |  + IPA    |\n|                 |            |           |        |           | Extension |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 1E00..1EFF      | [@][g..z][ | 20*7= 140 | 136    | 4         | Latin     |\n|                 | ..r]       |           |        |           | Extended  |\n|                 |            |           |        |           | Additiona |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 1F00..1FFF      | [@][g..z][ | 20*8= 160 | 144    | 16        | Greek     |\n|                 | ..z]       |           |        |           | Extended  |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| .... ....       | [@][a..f][ | 6*20= 120 | 0      | 120       | RESERVED  |\n|                 | ..z]       |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 24B6..24E9      | [@][@][a.. | 26        | 26     | 0         | Enclosed  |\n|                 | ]          |           |        |           | Alphanume |\n|                 |            |           |        |           | ics       |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| FF21..FF5A      | [@][a..z][ | 26        | 26     | 0         | Halfwidth |\n|                 | ]          |           |        |           | and       |\n|                 |            |           |        |           | Fullwidth |\n|                 |            |           |        |           | forms     |\n+-----------------+------------+-----------+--------+-----------+-----------+\n\nCode Range values are UCS-2.\n\nAll of this encoding happens transparently at the filesystem level with one\nexception. Until MySQL 5.1.6, an old encoding was used. Identifiers created in\na version before MySQL 5.1.6, and which haven\'t been updated to the new\nencoding, the server prefixes mysql50 to their name.\n\nExamples\n--------\n\nFind the file name for a table with a non-Latin1 name:\n\nselect cast(convert(\"this_is_таблица\" USING filename) as binary);\n+------------------------------------------------------------------+\n| cast(convert(\"this_is_таблица\" USING filename) as binary)        |\n+------------------------------------------------------------------+\n| this_is_@y0@g0@h0@r0@o0@i1@g0                                    |\n+------------------------------------------------------------------+\n\nFind the table name for a file name:\n\nselect convert(_filename \"this_is_@y0@g0@h0@r0@o0@i1@g0\" USING utf8);\n+---------------------------------------------------------------+\n| convert(_filename \"this_is_@y0@g0@h0@r0@o0@i1@g0\" USING utf8) |\n+---------------------------------------------------------------+\n| this_is_таблица                                               |\n+---------------------------------------------------------------+\n\nAn old table created before MySQL 5.1.6, with the old encoding:\n\nSHOW TABLES;\n+--------------------+\n| Tables_in_test     |\n+--------------------+\n| #mysql50#table@1   |\n+--------------------+\n\nThe prefix needs to be supplied to reference this table:\n\nSHOW COLUMNS FROM `table@1`;\nERROR 1146 (42S02): Table \'test.table@1\' doesn\'t exist\n\nSHOW COLUMNS FROM `#mysql50#table@1`;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| i     | int(11) | YES  |     | NULL    |       |\n+-------+---------+------+-----+---------+-------+\n\nURL: https://mariadb.com/kb/en/identifier-to-file-name-mapping/','','https://mariadb.com/kb/en/identifier-to-file-name-mapping/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (478,29,'Numeric Literals','Numeric literals are written as a sequence of digits from 0 to 9. Initial\nzeros are ignored. A sign can always precede the digits, but it is optional\nfor positive numbers. In decimal numbers, the integer part and the decimal\npart are divided with a dot (.).\n\nIf the integer part is zero, it can be omitted, but the literal must begin\nwith a dot.\n\nThe notation with exponent can be used. The exponent is preceded by an E or e\ncharacter. The exponent can be preceded by a sign and must be an integer. A\nnumber N with an exponent part X, is calculated as N * POW(10, X).\n\nIn some cases, adding zeroes at the end of a decimal number can increment the\nprecision of the expression where the number is used. For example, PI() by\ndefault returns a number with 6 decimal digits. But the PI()+0.0000000000\nexpression (with 10 zeroes) returns a number with 10 decimal digits.\n\nHexadecimal literals are interpreted as numbers when used in numeric contexts.\n\nExamples\n--------\n\n10\n+10\n-10\n\nAll these literals are equivalent:\n\n0.1\n.1\n+0.1\n+.1\n\nWith exponents:\n\n0.2E3 -- 0.2 * POW(10, 3) = 200\n.2e3\n.2e+2\n1.1e-10 -- 0.00000000011\n-1.1e10 -- -11000000000\n\nURL: https://mariadb.com/kb/en/numeric-iterals/','','https://mariadb.com/kb/en/numeric-iterals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (479,29,'Reserved Words','The following is a list of all reserved words in MariaDB.\n\nReserved words cannot be used as Identifiers, unless they are quoted.\n\nThe definitive list of reserved words for each version can be found by\nexamining the sql/lex.h and sql/sql_yacc.yy files.\n\nReserved Words\n--------------\n\n+--------------------------------------------+--------------------------------+\n| Keyword                                    | Notes                          |\n+--------------------------------------------+--------------------------------+\n| ACCESSIBLE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| ADD                                        |                                |\n+--------------------------------------------+--------------------------------+\n| ALL                                        |                                |\n+--------------------------------------------+--------------------------------+\n| ALTER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| ANALYZE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| AND                                        |                                |\n+--------------------------------------------+--------------------------------+\n| AS                                         |                                |\n+--------------------------------------------+--------------------------------+\n| ASC                                        |                                |\n+--------------------------------------------+--------------------------------+\n| ASENSITIVE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| BEFORE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| BETWEEN                                    |                                |\n+--------------------------------------------+--------------------------------+\n| BIGINT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| BINARY                                     |                                |\n+--------------------------------------------+--------------------------------+\n| BLOB                                       |                                |\n+--------------------------------------------+--------------------------------+\n| BOTH                                       |                                |\n+--------------------------------------------+--------------------------------+\n| BY                                         |                                |\n+--------------------------------------------+--------------------------------+\n| CALL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| CASCADE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| CASE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| CHANGE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| CHAR                                       |                                |\n+--------------------------------------------+--------------------------------+\n| CHARACTER                                  |                                |\n+--------------------------------------------+--------------------------------+\n| CHECK                                      |                                |\n+--------------------------------------------+--------------------------------+\n| COLLATE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| COLUMN                                     |                                |\n+--------------------------------------------+--------------------------------+\n| CONDITION                                  |                                |\n+--------------------------------------------+--------------------------------+\n| CONSTRAINT                                 |                                |\n+--------------------------------------------+--------------------------------+\n| CONTINUE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| CONVERT                                    |                                |\n+--------------------------------------------+--------------------------------+\n| CREATE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| CROSS                                      |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_DATE                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_ROLE                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_TIME                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_TIMESTAMP                          |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_USER                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURSOR                                     |                                |\n+--------------------------------------------+--------------------------------+\n| DATABASE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DATABASES                                  |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_HOUR                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_MICROSECOND                            |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_MINUTE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_SECOND                                 |                                |\n+--------------------------------------------+--------------------------------+\n| DEC                                        |                                |\n+--------------------------------------------+--------------------------------+\n| DECIMAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DECLARE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DEFAULT                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DELAYED                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DELETE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| DELETE_DOMAIN_ID                           |                                |\n+--------------------------------------------+--------------------------------+\n| DESC                                       |                                |\n+--------------------------------------------+--------------------------------+\n| DESCRIBE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DETERMINISTIC                              |                                |\n+--------------------------------------------+--------------------------------+\n| DISTINCT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DISTINCTROW                                |                                |\n+--------------------------------------------+--------------------------------+\n| DIV                                        |                                |\n+--------------------------------------------+--------------------------------+\n| DO_DOMAIN_IDS                              |                                |\n+--------------------------------------------+--------------------------------+\n| DOUBLE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| DROP                                       |                                |\n+--------------------------------------------+--------------------------------+\n| DUAL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| EACH                                       |                                |\n+--------------------------------------------+--------------------------------+\n| ELSE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| ELSEIF                                     |                                |\n+--------------------------------------------+--------------------------------+\n| ENCLOSED                                   |                                |\n+--------------------------------------------+--------------------------------+\n| ESCAPED                                    |                                |\n+--------------------------------------------+--------------------------------+\n| EXCEPT                                     | Added in MariaDB 10.3.0        |\n+--------------------------------------------+--------------------------------+\n| EXISTS                                     |                                |\n+--------------------------------------------+--------------------------------+\n| EXIT                                       |                                |\n+--------------------------------------------+--------------------------------+\n| EXPLAIN                                    |                                |\n+--------------------------------------------+--------------------------------+\n| FALSE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FETCH                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FLOAT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FLOAT4                                     |                                |\n+--------------------------------------------+--------------------------------+\n| FLOAT8                                     |                                |\n+--------------------------------------------+--------------------------------+\n| FOR                                        |                                |\n+--------------------------------------------+--------------------------------+\n| FORCE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FOREIGN                                    |                                |\n+--------------------------------------------+--------------------------------+\n| FROM                                       |                                |\n+--------------------------------------------+--------------------------------+\n| FULLTEXT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| GENERAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| GRANT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| GROUP                                      |                                |\n+--------------------------------------------+--------------------------------+\n| HAVING                                     |                                |\n+--------------------------------------------+--------------------------------+\n| HIGH_PRIORITY                              |                                |\n+--------------------------------------------+--------------------------------+\n| HOUR_MICROSECOND                           |                                |\n+--------------------------------------------+--------------------------------+\n| HOUR_MINUTE                                |                                |\n+--------------------------------------------+--------------------------------+\n| HOUR_SECOND                                |                                |','','https://mariadb.com/kb/en/reserved-words/');
update help_topic set description = CONCAT(description, '\n+--------------------------------------------+--------------------------------+\n| IF                                         |                                |\n+--------------------------------------------+--------------------------------+\n| IGNORE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| IGNORE_DOMAIN_IDS                          |                                |\n+--------------------------------------------+--------------------------------+\n| IGNORE_SERVER_IDS                          |                                |\n+--------------------------------------------+--------------------------------+\n| IN                                         |                                |\n+--------------------------------------------+--------------------------------+\n| INDEX                                      |                                |\n+--------------------------------------------+--------------------------------+\n| INFILE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| INNER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| INOUT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| INSENSITIVE                                |                                |\n+--------------------------------------------+--------------------------------+\n| INSERT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| INT                                        |                                |\n+--------------------------------------------+--------------------------------+\n| INT1                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT2                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT3                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT4                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT8                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INTEGER                                    |                                |\n+--------------------------------------------+--------------------------------+\n| INTERSECT                                  | Added in MariaDB 10.3.0        |\n+--------------------------------------------+--------------------------------+\n| INTERVAL                                   |                                |\n+--------------------------------------------+--------------------------------+\n| INTO                                       |                                |\n+--------------------------------------------+--------------------------------+\n| IS                                         |                                |\n+--------------------------------------------+--------------------------------+\n| ITERATE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| JOIN                                       |                                |\n+--------------------------------------------+--------------------------------+\n| KEY                                        |                                |\n+--------------------------------------------+--------------------------------+\n| KEYS                                       |                                |\n+--------------------------------------------+--------------------------------+\n| KILL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LEADING                                    |                                |\n+--------------------------------------------+--------------------------------+\n| LEAVE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| LEFT                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LIKE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LIMIT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| LINEAR                                     |                                |\n+--------------------------------------------+--------------------------------+\n| LINES                                      |                                |\n+--------------------------------------------+--------------------------------+\n| LOAD                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LOCALTIME                                  |                                |\n+--------------------------------------------+--------------------------------+\n| LOCALTIMESTAMP                             |                                |\n+--------------------------------------------+--------------------------------+\n| LOCK                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LONG                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LONGBLOB                                   |                                |\n+--------------------------------------------+--------------------------------+\n| LONGTEXT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| LOOP                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LOW_PRIORITY                               |                                |\n+--------------------------------------------+--------------------------------+\n| MASTER_HEARTBEAT_PERIOD                    |                                |\n+--------------------------------------------+--------------------------------+\n| MASTER_SSL_VERIFY_SERVER_CERT              |                                |\n+--------------------------------------------+--------------------------------+\n| MATCH                                      |                                |\n+--------------------------------------------+--------------------------------+\n| MAXVALUE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| MEDIUMBLOB                                 |                                |\n+--------------------------------------------+--------------------------------+\n| MEDIUMINT                                  |                                |\n+--------------------------------------------+--------------------------------+\n| MEDIUMTEXT                                 |                                |\n+--------------------------------------------+--------------------------------+\n| MIDDLEINT                                  |                                |\n+--------------------------------------------+--------------------------------+\n| MINUTE_MICROSECOND                         |                                |\n+--------------------------------------------+--------------------------------+\n| MINUTE_SECOND                              |                                |\n+--------------------------------------------+--------------------------------+\n| MOD                                        |                                |\n+--------------------------------------------+--------------------------------+\n| MODIFIES                                   |                                |\n+--------------------------------------------+--------------------------------+\n| NATURAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| NOT                                        |                                |\n+--------------------------------------------+--------------------------------+\n| NO_WRITE_TO_BINLOG                         |                                |\n+--------------------------------------------+--------------------------------+\n| NULL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| NUMERIC                                    |                                |\n+--------------------------------------------+--------------------------------+\n| OFFSET                                     | Added in MariaDB 10.6.0        |\n+--------------------------------------------+--------------------------------+\n| ON                                         |                                |\n+--------------------------------------------+--------------------------------+\n| OPTIMIZE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| OPTION                                     |                                |\n+--------------------------------------------+--------------------------------+\n| OPTIONALLY                                 |                                |\n+--------------------------------------------+--------------------------------+\n| OR                                         |                                |\n+--------------------------------------------+--------------------------------+\n| ORDER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| OUT                                        |                                |\n+--------------------------------------------+--------------------------------+\n| OUTER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| OUTFILE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| OVER                                       |                                |\n+--------------------------------------------+--------------------------------+\n| PAGE_CHECKSUM                              |                                |\n+--------------------------------------------+--------------------------------+\n| PARSE_VCOL_EXPR                            |                                |\n+--------------------------------------------+--------------------------------+\n| PARTITION                                  |                                |\n+--------------------------------------------+--------------------------------+\n| POSITION                                   |                                |\n+--------------------------------------------+--------------------------------+\n| PRECISION                                  |                                |\n+--------------------------------------------+--------------------------------+\n| PRIMARY                                    |                                |\n+--------------------------------------------+--------------------------------+\n| PROCEDURE                                  |                                |\n+--------------------------------------------+--------------------------------+\n| PURGE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| RANGE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| READ                                       |                                |\n+--------------------------------------------+--------------------------------+\n| READS                                      |                                |\n+--------------------------------------------+--------------------------------+\n| READ_WRITE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| REAL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| RECURSIVE                                  |                                |\n+--------------------------------------------+--------------------------------+\n| REF_SYSTEM_ID                              |                                |\n+--------------------------------------------+--------------------------------+\n| REFERENCES                                 |                                |\n+--------------------------------------------+--------------------------------+\n| REGEXP                                     |                                |\n+--------------------------------------------+--------------------------------+\n| RELEASE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| RENAME                                     |                                |') WHERE help_topic_id = 479;
update help_topic set description = CONCAT(description, '\n+--------------------------------------------+--------------------------------+\n| REPEAT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| REPLACE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| REQUIRE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| RESIGNAL                                   |                                |\n+--------------------------------------------+--------------------------------+\n| RESTRICT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| RETURN                                     |                                |\n+--------------------------------------------+--------------------------------+\n| RETURNING                                  |                                |\n+--------------------------------------------+--------------------------------+\n| REVOKE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| RIGHT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| RLIKE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| ROWS                                       |                                |\n+--------------------------------------------+--------------------------------+\n| SCHEMA                                     |                                |\n+--------------------------------------------+--------------------------------+\n| SCHEMAS                                    |                                |\n+--------------------------------------------+--------------------------------+\n| SECOND_MICROSECOND                         |                                |\n+--------------------------------------------+--------------------------------+\n| SELECT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| SENSITIVE                                  |                                |\n+--------------------------------------------+--------------------------------+\n| SEPARATOR                                  |                                |\n+--------------------------------------------+--------------------------------+\n| SET                                        |                                |\n+--------------------------------------------+--------------------------------+\n| SHOW                                       |                                |\n+--------------------------------------------+--------------------------------+\n| SIGNAL                                     |                                |\n+--------------------------------------------+--------------------------------+\n| SLOW                                       |                                |\n+--------------------------------------------+--------------------------------+\n| SMALLINT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| SPATIAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| SPECIFIC                                   |                                |\n+--------------------------------------------+--------------------------------+\n| SQL                                        |                                |\n+--------------------------------------------+--------------------------------+\n| SQLEXCEPTION                               |                                |\n+--------------------------------------------+--------------------------------+\n| SQLSTATE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| SQLWARNING                                 |                                |\n+--------------------------------------------+--------------------------------+\n| SQL_BIG_RESULT                             |                                |\n+--------------------------------------------+--------------------------------+\n| SQL_CALC_FOUND_ROWS                        |                                |\n+--------------------------------------------+--------------------------------+\n| SQL_SMALL_RESULT                           |                                |\n+--------------------------------------------+--------------------------------+\n| SSL                                        |                                |\n+--------------------------------------------+--------------------------------+\n| STARTING                                   |                                |\n+--------------------------------------------+--------------------------------+\n| STATS_AUTO_RECALC                          |                                |\n+--------------------------------------------+--------------------------------+\n| STATS_PERSISTENT                           |                                |\n+--------------------------------------------+--------------------------------+\n| STATS_SAMPLE_PAGES                         |                                |\n+--------------------------------------------+--------------------------------+\n| STRAIGHT_JOIN                              |                                |\n+--------------------------------------------+--------------------------------+\n| TABLE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| TERMINATED                                 |                                |\n+--------------------------------------------+--------------------------------+\n| THEN                                       |                                |\n+--------------------------------------------+--------------------------------+\n| TINYBLOB                                   |                                |\n+--------------------------------------------+--------------------------------+\n| TINYINT                                    |                                |\n+--------------------------------------------+--------------------------------+\n| TINYTEXT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| TO                                         |                                |\n+--------------------------------------------+--------------------------------+\n| TRAILING                                   |                                |\n+--------------------------------------------+--------------------------------+\n| TRIGGER                                    |                                |\n+--------------------------------------------+--------------------------------+\n| TRUE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| UNDO                                       |                                |\n+--------------------------------------------+--------------------------------+\n| UNION                                      |                                |\n+--------------------------------------------+--------------------------------+\n| UNIQUE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| UNLOCK                                     |                                |\n+--------------------------------------------+--------------------------------+\n| UNSIGNED                                   |                                |\n+--------------------------------------------+--------------------------------+\n| UPDATE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| USAGE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| USE                                        |                                |\n+--------------------------------------------+--------------------------------+\n| USING                                      |                                |\n+--------------------------------------------+--------------------------------+\n| UTC_DATE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| UTC_TIME                                   |                                |\n+--------------------------------------------+--------------------------------+\n| UTC_TIMESTAMP                              |                                |\n+--------------------------------------------+--------------------------------+\n| VALUES                                     |                                |\n+--------------------------------------------+--------------------------------+\n| VARBINARY                                  |                                |\n+--------------------------------------------+--------------------------------+\n| VARCHAR                                    |                                |\n+--------------------------------------------+--------------------------------+\n| VARCHARACTER                               |                                |\n+--------------------------------------------+--------------------------------+\n| VARYING                                    |                                |\n+--------------------------------------------+--------------------------------+\n| WHEN                                       |                                |\n+--------------------------------------------+--------------------------------+\n| WHERE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| WHILE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| WINDOW                                     | Only disallowed for table      |\n|                                            | aliases.                       |\n+--------------------------------------------+--------------------------------+\n| WITH                                       |                                |\n+--------------------------------------------+--------------------------------+\n| WRITE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| XOR                                        |                                |\n+--------------------------------------------+--------------------------------+\n| YEAR_MONTH                                 |                                |\n+--------------------------------------------+--------------------------------+\n| ZEROFILL                                   |                                |\n+--------------------------------------------+--------------------------------+\n\nExceptions\n----------\n\nSome keywords are exceptions for historical reasons, and are permitted as\nunquoted identifiers. These include:\n\n+-----------------------------------------------------------------------------+\n| Keyword                                                                     |\n+-----------------------------------------------------------------------------+\n| ACTION                                                                      |\n+-----------------------------------------------------------------------------+\n| BIT                                                                         |\n+-----------------------------------------------------------------------------+\n| DATE                                                                        |\n+-----------------------------------------------------------------------------+\n| ENUM                                                                        |\n+-----------------------------------------------------------------------------+\n| NO                                                                          |\n+-----------------------------------------------------------------------------+\n| TEXT                                                                        |\n+-----------------------------------------------------------------------------+\n| TIME                                                                        |\n+-----------------------------------------------------------------------------+\n| TIMESTAMP                                                                   |\n+-----------------------------------------------------------------------------+\n\nOracle Mode\n-----------\n\nIn Oracle mode, from MariaDB 10.3, there are a number of extra reserved words:\n\n+--------------------------------------------+--------------------------------+\n| Keyword                                    | Notes                          |\n+--------------------------------------------+--------------------------------+\n| BODY                                       |                                |\n+--------------------------------------------+--------------------------------+\n| ELSIF                                      |                                |\n+--------------------------------------------+--------------------------------+\n| GOTO                                       |                                |\n+--------------------------------------------+--------------------------------+\n| HISTORY                                    | <= MariaDB 10.3.6 only         |') WHERE help_topic_id = 479;
update help_topic set description = CONCAT(description, '\n+--------------------------------------------+--------------------------------+\n| MINUS                                      | From MariaDB 10.6.1            |\n+--------------------------------------------+--------------------------------+\n| OTHERS                                     |                                |\n+--------------------------------------------+--------------------------------+\n| PACKAGE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| PERIOD                                     | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| RAISE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| ROWNUM                                     | From MariaDB 10.6.1            |\n+--------------------------------------------+--------------------------------+\n| ROWTYPE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| SYSDATE                                    | From MariaDB 10.6.1            |\n+--------------------------------------------+--------------------------------+\n| SYSTEM                                     | <= MariaDB 10.3.6 only. Note   |\n|                                            | however that SYSTEM sometimes  |\n|                                            | needs to be quoted to avoid    |\n|                                            | confusion with                 |\n|                                            | System-versioned tables.       |\n+--------------------------------------------+--------------------------------+\n| SYSTEM_TIME                                | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| VERSIONING                                 | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| WITHOUT                                    | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n\nFunction Names\n--------------\n\nIf the IGNORE_SPACE SQL_MODE flag is set, function names become reserved words.\n\nURL: https://mariadb.com/kb/en/reserved-words/') WHERE help_topic_id = 479;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (480,29,'String Literals','Strings are sequences of characters and are enclosed with quotes.\n\nThe syntax is:\n\n[_charset_name]\'string\' [COLLATE collation_name]\n\nFor example:\n\n\'The MariaDB Foundation\'\n_utf8 \'Foundation\' COLLATE utf8_unicode_ci;\n\nStrings can either be enclosed in single quotes or in double quotes (the same\ncharacter must be used to both open and close the string).\n\nThe ANSI SQL-standard does not permit double quotes for enclosing strings, and\nalthough MariaDB does by default, if the MariaDB server has enabled the\nANSI_QUOTES_SQL SQL_MODE, double quotes will be treated as being used for\nidentifiers instead of strings.\n\nStrings that are next to each other are automatically concatenated. For\nexample:\n\n\'The \' \'MariaDB \' \'Foundation\'\n\nand\n\n\'The MariaDB Foundation\'\n\nare equivalent.\n\nThe \\ (backslash character) is used to escape characters (unless the SQL_MODE\nhasn\'t been set to NO_BACKSLASH_ESCAPES). For example:\n\n\'MariaDB\'s new features\'\n\nis not a valid string because of the single quote in the middle of the string,\nwhich is treated as if it closes the string, but is actually meant as part of\nthe string, an apostrophe. The backslash character helps in situations like\nthis:\n\n\'MariaDB\\\'s new features\'\n\nis now a valid string, and if displayed, will appear without the backslash.\n\nSELECT \'MariaDB\\\'s new features\';\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n\nAnother way to escape the quoting character is repeating it twice:\n\nSELECT \'I\'\'m here\', \"\"\"Double\"\"\";\n+----------+----------+\n| I\'m here | \"Double\" |\n+----------+----------+\n| I\'m here | \"Double\" |\n+----------+----------+\n\nEscape Sequences\n----------------\n\nThere are other escape sequences also. Here is a full list:\n\n+-----------------------------------------------+-----------------------------+\n| Escape sequence                               | Character                   |\n+-----------------------------------------------+-----------------------------+\n| \\0                                            | ASCII NUL (0x00).           |\n+-----------------------------------------------+-----------------------------+\n| \\\'                                            | Single quote (\"\'\").         |\n+-----------------------------------------------+-----------------------------+\n| \\\"                                            | Double quote (\"\"\").         |\n+-----------------------------------------------+-----------------------------+\n| \\b                                            | Backspace.                  |\n+-----------------------------------------------+-----------------------------+\n| \\n                                            | Newline, or linefeed,.      |\n+-----------------------------------------------+-----------------------------+\n| \\r                                            | Carriage return.            |\n+-----------------------------------------------+-----------------------------+\n| \\t                                            | Tab.                        |\n+-----------------------------------------------+-----------------------------+\n| \\Z                                            | ASCII 26 (Control+Z). See   |\n|                                               | note following the table.   |\n+-----------------------------------------------+-----------------------------+\n| \\\\                                            | Backslash (\"\\\").            |\n+-----------------------------------------------+-----------------------------+\n| \\%                                            | \"%\" character. See note     |\n|                                               | following the table.        |\n+-----------------------------------------------+-----------------------------+\n| \\_                                            | A \"_\" character. See note   |\n|                                               | following the table.        |\n+-----------------------------------------------+-----------------------------+\n\nEscaping the % and _ characters can be necessary when using the LIKE operator,\nwhich treats them as special characters.\n\nThe ASCII 26 character (\\Z) needs to be escaped when included in a batch file\nwhich needs to be executed in Windows. The reason is that ASCII 26, in\nWindows, is the end of file (EOF).\n\nBackslash (\\), if not used as an escape character, must always be escaped.\nWhen followed by a character that is not in the above table, backslashes will\nsimply be ignored.\n\nURL: https://mariadb.com/kb/en/string-literals/','','https://mariadb.com/kb/en/string-literals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,29,'Table Value Constructors','MariaDB starting with 10.3.3\n----------------------------\nTable Value Constructors were introduced in MariaDB 10.3.3\n\nSyntax\n------\n\nVALUES ( row_value[, row_value...]), (...)...\n\nDescription\n-----------\n\nIn Unions, Views, and sub-queries, a Table Value Constructor (TVC) allows you\nto inject arbitrary values into the result-set. The given values must have the\nsame number of columns as the result-set, otherwise it returns Error 1222.\n\nExamples\n--------\n\nUsing TVC\'s with UNION operations:\n\nCREATE TABLE test.t1 (val1 INT, val2 INT);\nINSERT INTO test.t1 VALUES(5, 8), (3, 4), (1, 2);\n\nSELECT * FROM test.t1\nUNION\nVALUES (70, 90), (100, 110);\n\n+------+------+\n| val1 | val2 |\n+------+------+\n|    5 |    8 | \n|    3 |    4 |\n|    1 |    2 |\n|   70 |   90 |\n|  100 |  110 |\n+------+------+\n\nUsing TVC\'s with a CREATE VIEW statement:\n\nCREATE VIEW v1 AS VALUES (7, 9), (9, 10);\n\nSELECT * FROM v1;\n+---+----+\n| 7 |  9 |\n+---+----+\n| 7 |  9 |\n| 9 | 10 |\n+---+----+\n\nUsing TVC with an ORDER BY clause:\n\nSELECT * FROM test.t1\nUNION\nVALUES (10, 20), (30, 40), (50, 60), (70, 80)\nORDER BY val1 DESC;\n\nUsing TVC with LIMIT clause:\n\nSELECT * FROM test.t1\nUNION\nVALUES (10, 20), (30, 40), (50, 60), (70, 80)\nLIMIT 2 OFFSET 4;\n\n+------+------+\n| val1 | val2 |\n+------+------+\n|   30 |   40 | \n|   50 |   60 |\n+------+------+\n\nURL: https://mariadb.com/kb/en/table-value-constructors/','','https://mariadb.com/kb/en/table-value-constructors/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (482,29,'User-Defined Variables','User-defined variables are variables which can be created by the user and\nexist in the session. This means that no one can access user-defined variables\nthat have been set by another user, and when the session is closed these\nvariables expire. However, these variables can be shared between several\nqueries and stored programs.\n\nUser-defined variables names must be preceded by a single at character (@).\nWhile it is safe to use a reserved word as a user-variable name, the only\nallowed characters are ASCII letters, digits, dollar sign ($), underscore (_)\nand dot (.). If other characters are used, the name can be quoted in one of\nthe following ways:\n\n* @`var_name`\n* @\'var_name\'\n* @\"var_name\"\n\nThese characters can be escaped as usual.\n\nUser-variables names are case insensitive, though they were case sensitive in\nMySQL 4.1 and older versions.\n\nUser-defined variables cannot be declared. They can be read even if no value\nhas been set yet; in that case, they are NULL. To set a value for a\nuser-defined variable you can use:\n\n* SET statement;\n* := operator within a SQL statement;\n* SELECT ... INTO.\n\nSince user-defined variables type cannot be declared, the only way to force\ntheir type is using CAST() or CONVERT():\n\nSET @str = CAST(123 AS CHAR(5));\n\nIf a variable has not been used yet, its value is NULL:\n\nSELECT @x IS NULL;\n+------------+\n| @x IS NULL |\n+------------+\n|          1 |\n+------------+\n\nIt is unsafe to read a user-defined variable and set its value in the same\nstatement (unless the command is SET), because the order of these actions is\nundefined.\n\nUser-defined variables can be used in most MariaDB\'s statements and clauses\nwhich accept an SQL expression. However there are some exceptions, like the\nLIMIT clause.\n\nThey must be used to PREPARE a prepared statement:\n\n@sql = \'DELETE FROM my_table WHERE c>1;\';\nPREPARE stmt FROM @sql;\nEXECUTE stmt;\nDEALLOCATE PREPARE stmt;\n\nAnother common use is to include a counter in a query:\n\nSET @var = 0;\nSELECT a, b, c, (@var:=@var+1) AS counter FROM my_table;\n\nInformation Schema\n------------------\n\nUser-defined variables can be viewed in the Information Schema USER_VARIABLES\nTable (as part of the User Variables plugin) from MariaDB 10.2.\n\nFlushing User-Defined Variables\n-------------------------------\n\nUser-defined variables are reset and the Information Schema table emptied with\nthe FLUSH USER_VARIABLES statement.\n\nSET @str = CAST(123 AS CHAR(5));\n\nSELECT * FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME;\n+---------------+----------------+---------------+--------------------+\n| VARIABLE_NAME | VARIABLE_VALUE | VARIABLE_TYPE | CHARACTER_SET_NAME |\n+---------------+----------------+---------------+--------------------+\n| str           | 123            | VARCHAR       | utf8mb3            |\n+---------------+----------------+---------------+--------------------+\n\nFLUSH USER_VARIABLES;\n\nSELECT * FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME;\nEmpty set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/user-defined-variables/','','https://mariadb.com/kb/en/user-defined-variables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (483,29,'Delimiters','The default delimiter in the mysql client (from MariaDB 10.4.6, also called\nmariadb) is the semicolon.\n\nWhen creating stored programs from the command-line, it is likely you will\nneed to differentiate between the regular delimiter and a delimiter inside a\nBEGIN END block. To understand better, consider the following example:\n\nCREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC\nBEGIN\n DECLARE x TINYINT;\n SET x = 42;\n RETURN x;\nEND;\n\nIf you enter the above line by line, the mysql client will treat the first\nsemicolon, at the end of the DECLARE x TINYINT line, as the end of the\nstatement. Since that\'s only a partial definition, it will throw a syntax\nerror, as follows:\n\nCREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC\nBEGIN\nDECLARE x TINYINT;\nERROR 1064 (42000): You have an error in your SQL syntax; \ncheck the manual that corresponds to your MariaDB server version\n for the right syntax to use near \'\' at line 3\n\nThe solution is to specify a distinct delimiter for the duration of the\nprocess, using the DELIMITER command. The delimiter can be any set of\ncharacters you choose, but it needs to be a distinctive set of characters that\nwon\'t cause further confusion. // is a common choice, and used throughout the\nknowledgebase.\n\nHere\'s how the function could be successfully entered from the mysql client\nwith the new delimiter.\n\nDELIMITER //\n\nCREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC\nBEGIN\n DECLARE x TINYINT;\n SET x = 42;\n RETURN x;\nEND\n\n//\n\nDELIMITER ;\n\nAt the end, the delimiter is restored to the default semicolon. The \\g and \\G\ndelimiters can always be used, even when a custom delimiter is specified.\n\nURL: https://mariadb.com/kb/en/delimiters/','','https://mariadb.com/kb/en/delimiters/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (484,29,'SQL_MODE=ORACLE','From MariaDB 10.3, setting the sql_mode system variable to Oracle allows the\nserver to understand a subset of Oracle\'s PL/SQL language. For example:\n\nSET SQL_MODE=\'ORACLE\';\n\nAll traditional MariaDB SQL/PSM syntax should work as before, as long as it\ndoes not conflict with Oracle\'s PL/SQL syntax. All MariaDB functions should be\nsupported in both normal and Oracle modes.\n\nPrior to MariaDB 10.3, MariaDB does not support Oracle\'s PL/SQL language, and\nSET SQL_MODE=ORACLE is only an alias for the following sql_mode in those\nversions:\n\nSET SQL_MODE=\'PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS,\nNO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER\';\n\nFrom MariaDB 10.3, SET SQL_MODE=ORACLE is same as:\n\nSET SQL_MODE=\'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,\nNO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT\';\n\nSupported Syntax in Oracle Mode\n-------------------------------\n\nStored Procedures and Stored Functions\n--------------------------------------\n\nOracle mode makes the following changes to Stored Procedures and Stored\nFunctions:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 (param OUT INT)     | ANSI uses (OUT param INT)         |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 (a IN OUT INT)      | ANSI uses (INOUT param INT)       |\n+-----------------------------------------+-----------------------------------+\n| AS before function body                 | CREATE FUNCTION f1 RETURN NUMBER  |\n|                                         | AS BEGIN...                       |\n+-----------------------------------------+-----------------------------------+\n| IS before function body                 | CREATE FUNCTION f1 RETURN NUMBER  |\n|                                         | IS BEGIN...                       |\n+-----------------------------------------+-----------------------------------+\n| If function has no parameters then      | Example: CREATE PROCEDURE p1 AS   |\n| parentheses must be omitted             | BEGIN NULL; END;                  |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 AS BEGIN END p1;    | Optional routine name after END   |\n|                                         | keyword. MDEV-12089               |\n+-----------------------------------------+-----------------------------------+\n| CREATE FUNCTION f1(a VARCHAR)           | VARCHAR can be used without       |\n|                                         | length for routine parameters     |\n|                                         | and RETURN clause. The length is  |\n|                                         | inherited from the argument at    |\n|                                         | call time. MDEV-10596             |\n+-----------------------------------------+-----------------------------------+\n| CREATE AGGREGATE FUNCTION f1( )         | Creates an aggregate function,    |\n|                                         | which performs the function       |\n|                                         | against a set of rows and         |\n|                                         | returns one aggregate result.     |\n+-----------------------------------------+-----------------------------------+\n| No CALL needed in Stored Procedures     | In Oracle mode one can call       |\n|                                         | other stored procedures with      |\n|                                         | name only. MDEV-12107             |\n+-----------------------------------------+-----------------------------------+\n| RETURN. Can also be used in stored      | ANSI uses RETURNS. MariaDB mode   |\n| procedures                              | only supports RETURNS in stored   |\n|                                         | functions                         |\n+-----------------------------------------+-----------------------------------+\n\nCursors\n-------\n\nOracle mode makes the following changes to Cursors:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 AS CURSOR cur IS    | Explicit cursor with FOR loop.    |\n| (SELECT a, b FROM t1); BEGIN  FOR rec   | MDEV-10581                        |\n| IN cur ...                              |                                   |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 AS rec IN (SELECT   | Implicit cursor with FOR loop.    |\n| a, b FROM t1)                           | MDEV-12098                        |\n+-----------------------------------------+-----------------------------------+\n| CURSOR c(prm_a VARCHAR2, prm_b          | Cursor with parameters.           |\n| VARCHAR2) ... OPEN c(1,2)               | MDEV-10597                        |\n+-----------------------------------------+-----------------------------------+\n| CURSOR c(prm_a VARCHAR2, prm_b          | Cursor with parameters and FOR    |\n| VARCHAR2) ... FOR rec in c(1,2)         | loop. MDEV-12314                  |\n+-----------------------------------------+-----------------------------------+\n| s %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND | Explicit cursor attributes.       |\n|                                         | MDEV-10582                        |\n+-----------------------------------------+-----------------------------------+\n\nLOOP\n----\n\nOracle mode makes the following changes to LOOP:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| FOR i IN 1..10 LOOP ... END LOOP        | Numeric FOR loop. MDEV-10580      |\n+-----------------------------------------+-----------------------------------+\n| GOTO                                    | GOTO statement.  MDEV-10697       |\n+-----------------------------------------+-----------------------------------+\n| <<label>> used with GOTO                | ANSI uses label:. MDEV-10697      |\n+-----------------------------------------+-----------------------------------+\n| To leave loop block: EXIT [ label ] [   | ANSI syntax is IF bool_expr THEN  |\n| WHEN bool_expr ]                        | LEAVE label                       |\n+-----------------------------------------+-----------------------------------+\n| [<<label>>] WHILE boolean_expression    | Oracle style WHILE loop           |\n| LOOP statement... END LOOP [ label ] ;  |                                   |\n+-----------------------------------------+-----------------------------------+\n| CONTINUE [ label ] [ WHEN               | CONTINUE is only valid inside a   |\n| boolean_expression]                     | loop                              |\n+-----------------------------------------+-----------------------------------+\n\nVariables\n---------\n\n+------------------------------+-----------------+--------------------------+\n| Oracle syntax                | Version         | Description              |\n+------------------------------+-----------------+--------------------------+\n| var:= 10; Can also be used   | 10.3            | MariaDB uses SET var=    |\n| with MariaDB systemvariables |                 | 10;                      |\n+------------------------------+-----------------+--------------------------+\n| var INT := 10                | 10.3            | Default variable value   |\n+------------------------------+-----------------+--------------------------+\n| var1                         | 10.3            | Take data type from a    |\n| table_name.column_name%TYPE  |                 | table column. MDEV-10577 |\n+------------------------------+-----------------+--------------------------+\n| var2 var1%TYPE               | 10.3            | Take data type from      |\n|                              |                 | another variable         |\n+------------------------------+-----------------+--------------------------+\n| rec1 table_name%ROWTYPE      | 10.3            | Take ROW structure from  |\n|                              |                 | a table. MDEV-12133      |\n+------------------------------+-----------------+--------------------------+\n| rec2 rec1%ROWTYPE            | 10.3            | Take ROW structure from  |\n|                              |                 | ROW variable             |\n+------------------------------+-----------------+--------------------------+\n| CURSOR c1 IS SELECT a,b      | 10.3            | Take ROW structure from  |\n| FROM t1; rec1 c1%ROWTYPE;    |                 | a cursor. MDEV-12011     |\n+------------------------------+-----------------+--------------------------+\n| Variables can be declared    | 10.3            | In MariaDB mode,         |\n| after cursor declarations    |                 | variables must be        |\n|                              |                 | declared before          |\n|                              |                 | cursors. MDEV-10598      |\n+------------------------------+-----------------+--------------------------+\n| Triggers uses :NEW and :OLD  | 10.3            | ANSI uses NEW and OLD.   |\n|                              |                 | MDEV-10579               |\n+------------------------------+-----------------+--------------------------+\n| SQLCODE                      | 10.3            | Returns the number code  |\n|                              |                 | of the most recent       |\n|                              |                 | exception. Can only be   |\n|                              |                 | used in Stored           |\n|                              |                 | Procedures. MDEV-10578   |\n+------------------------------+-----------------+--------------------------+\n| SQLERRM                      | 10.3            | Returns the error        |\n|                              |                 | message associdated to   |\n|                              |                 | it\'s error number        |\n|                              |                 | argument or SQLCODE if   |\n|                              |                 | no argument is given.    |\n|                              |                 | Can only be used in      |\n|                              |                 | Stored Procedures.       |\n|                              |                 | MDEV-10578               |\n+------------------------------+-----------------+--------------------------+\n| SQL%ROWCOUNT                 | 10.3            | Almost same as           |\n|                              |                 | ROW_COUNT(). MDEV-10583  |\n+------------------------------+-----------------+--------------------------+\n| ROWNUM                       | 10.6.1          | Returns number of        |\n|                              |                 | accepted rows            |\n+------------------------------+-----------------+--------------------------+\n\nExceptions\n----------\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| BEGIN ... EXCEPTION WHEN OTHERS THEN    | Exception handlers are declared   |\n| BEGIN ..  END; END;                     | at the end of a block             |\n+-----------------------------------------+-----------------------------------+\n| TOO_MANY_ROWS, NO_DATA_FOUND,           | Predefined exceptions. MDEV-10839 |\n| DUP_VAL_ON_INDEX                        |                                   |\n+-----------------------------------------+-----------------------------------+\n| RAISE TOO_MANY_ROWS ; .... EXCEPTION    | Exception can be used with RAISE  |\n| WHEN TOO_MANY_ROWS THEN ...             | and EXCEPTION...WHEN. MDEV-10840  |\n+-----------------------------------------+-----------------------------------+\n| CREATE OR REPLACE FUNCTION f1 (a INT)   | User defined exceptions.          |\n| RETURN INT AS e1 EXCEPTION...           | MDEV-10587                        |\n+-----------------------------------------+-----------------------------------+\n\nBEGIN Blocks\n------------\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| BEGIN to start a block                  | MariaDB uses BEGIN NOT ATOMIC     |\n|                                         | for anyonymous blocks. MDEV-10655 |\n+-----------------------------------------+-----------------------------------+\n| DECLARE is used before BEGIN            | DECLARE a INT; b VARCHAR(10);     |\n|                                         | BEGIN v:= 10; END;                |\n+-----------------------------------------+-----------------------------------+\n| WHEN DUP_VAL_ON_INDEX THEN NULL ;       | Do not require BEGIN..END in      |\n| NULL; WHEN OTHERS THEN NULL             | multi-statement exception         |\n|                                         | handlers in THEN clause.          |\n|                                         | MDEV-12088                        |\n+-----------------------------------------+-----------------------------------+\n\nSimple Syntax Compatibility\n---------------------------\n\n+------------------------------+-----------------+--------------------------+\n| Oracle syntax                | Version         | Description              |\n+------------------------------+-----------------+--------------------------+\n| ELSIF                        | 10.3            | ANSI uses ELSEIF         |\n+------------------------------+-----------------+--------------------------+\n| SELECT UNIQUE                | 10.3            | Same as SELECT           |\n|                              |                 | DISTINCT. MDEV-12086     |','','https://mariadb.com/kb/en/sql_modeoracle/');
update help_topic set description = CONCAT(description, '\n+------------------------------+-----------------+--------------------------+\n| TRUNCATE TABLE t1 [DROP      | 10.3            | DROP STORAGE and REUSE   |\n| STORAGE] or [REUSE STORAGE]  |                 | STORAGE are allowed as   |\n|                              |                 | optional keywords for    |\n|                              |                 | TRUNCATE TABLE.          |\n|                              |                 | MDEV-10588               |\n+------------------------------+-----------------+--------------------------+\n| Subqueries in a FROM clause  | 10.6            | SELECT * FROM (SELECT 1  |\n| without an alias             |                 | FROM DUAL), (SELECT 2    |\n|                              |                 | FROM DUAL)               |\n+------------------------------+-----------------+--------------------------+\n| UNION, EXCEPT and INTERSECT  | 10.3            | INTERSECT has higher     |\n| all have the same            |                 | precedence than UNION    |\n| precedence.                  |                 | and EXCEPT in            |\n|                              |                 | non-Oracle modes.        |\n+------------------------------+-----------------+--------------------------+\n| MINUS                        | 10.6            | MINUS is a synonym for   |\n|                              |                 | EXCEPT.                  |\n+------------------------------+-----------------+--------------------------+\n\nFunctions\n---------\n\n+------------------------------+-----------------+--------------------------+\n| Oracle syntax                | Version         | Description              |\n+------------------------------+-----------------+--------------------------+\n| ADD_MONTHS()                 | 10.6.1          | Added as a wrapper for   |\n|                              |                 | DATE_ADD() to enhance    |\n|                              |                 | Oracle compatibility.    |\n|                              |                 | All modes.               |\n+------------------------------+-----------------+--------------------------+\n| CAST(expr as VARCHAR(N))     | 10.3            | Cast expression to a     |\n|                              |                 | VARCHAR(N). MDEV-11275   |\n+------------------------------+-----------------+--------------------------+\n| DECODE                       | 10.3            | In Oracle mode,          |\n|                              |                 | compares and matches     |\n|                              |                 | search expressions       |\n+------------------------------+-----------------+--------------------------+\n| LENGTH() is same as          | 10.3            | MariaDB translates       |\n| CHAR_LENGTH()                |                 | LENGTH() to              |\n|                              |                 | OCTET_LENGTH(). In all   |\n|                              |                 | modes one can use        |\n|                              |                 | LENGTHB() as a synonym   |\n|                              |                 | to OCTET_LENGTH()        |\n+------------------------------+-----------------+--------------------------+\n| CHR(num)                     | 10.3            | Returns a VARCHAR(1)     |\n|                              |                 | with character set and   |\n|                              |                 | collation according to   |\n|                              |                 | @@character_set_database |\n|                              |                 | and @@collation_database |\n+------------------------------+-----------------+--------------------------+\n| substr(\'abc\',0 ,3) same as   | 10.3            | Position 0 for substr()  |\n| substr(\'abc\', 1 ,3)          |                 | is same as position 1    |\n+------------------------------+-----------------+--------------------------+\n| SYS_GUID                     | 10.6.1          | Generates a globally     |\n|                              |                 | unique identifier.       |\n|                              |                 | Similar to UUID but      |\n|                              |                 | without the -. All       |\n|                              |                 | modes.                   |\n+------------------------------+-----------------+--------------------------+\n| TO_CHAR                      | 10.6.1          | Added to enhance Oracle  |\n|                              |                 | compatibility. All       |\n|                              |                 | modes.                   |\n+------------------------------+-----------------+--------------------------+\n| TRIM, LTRIM, RTRIM, LPAD     | 10.3            | Returns NULL instead of  |\n| and RPAD                     |                 | an empty string if       |\n|                              |                 | returning an empty       |\n|                              |                 | result. These functions  |\n|                              |                 | can also be accessed     |\n|                              |                 | outside of ORACLE mode   |\n|                              |                 | by suffixing _ORACLE     |\n|                              |                 | onto the end of the      |\n|                              |                 | function name, such as   |\n|                              |                 | TRIM_ORACLE.             |\n+------------------------------+-----------------+--------------------------+\n\nPrepared Statements\n-------------------\n\nOracle mode makes the following changes to Prepared Statements:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| PREPARE stmt FROM \'SELECT :1, :2\'       | ANSI uses ?. MDEV-10801           |\n+-----------------------------------------+-----------------------------------+\n| EXECUTE IMMEDIATE \'INSERT INTO t1       | Dynamic placeholders. MDEV-10801  |\n| SELECT (:x,:y) FROM DUAL\' USING 10,20   |                                   |\n+-----------------------------------------+-----------------------------------+\n\nSynonyms for Basic SQL Types\n----------------------------\n\n+--------------------------------+-------------------------------------------+\n| Oracle type                    | MariaDB synonym                           |\n+--------------------------------+-------------------------------------------+\n| VARCHAR2                       | VARCHAR                                   |\n+--------------------------------+-------------------------------------------+\n| NUMBER                         | DECIMAL                                   |\n+--------------------------------+-------------------------------------------+\n| DATE (with time portion)       | MariaDB DATETIME                          |\n+--------------------------------+-------------------------------------------+\n| RAW                            | VARBINARY                                 |\n+--------------------------------+-------------------------------------------+\n| CLOB                           | LONGTEXT                                  |\n+--------------------------------+-------------------------------------------+\n| BLOB                           | LONGBLOB                                  |\n+--------------------------------+-------------------------------------------+\n\nThis was implemented as part of MDEV-10343.\n\nIf one does a SHOW CREATE TABLE in ORACLE mode on a table that has a native\nMariaDB DATE column, it will be displayed as mariadb_schema.date to not\nconflict with the Oracle DATE type.\n\nPackages\n--------\n\nThe following syntax has been supported since MariaDB 10.3.5:\n\n* CREATE PACKAGE\n* CREATE PACKAGE BODY\n* DROP PACKAGE\n* DROP PACKAGE BODY\n* SHOW CREATE PACKAGE\n* SHOW CREATE PACKAGE BODY\n\nNULL Handling\n-------------\n\nOracle mode makes the following changes to NULL handling:\n\nNULL As a Statement\n-------------------\n\nNULL can be used as a statement:\n\nIF a=10 THEN NULL; ELSE NULL; END IF\n\nTranslating Empty String Literals to NULL\n-----------------------------------------\n\nIn Oracle, empty string (\'\') and NULL are the same thing,\n\nBy using sql_mode=EMPTY_STRING_IS_NULL you can get a similar experience in\nMariaDB:\n\nSET sql_mode=EMPTY_STRING_IS_NULL;\nSELECT \'\' IS NULL; -- returns TRUE\nINSERT INTO t1 VALUES (\'\'); -- inserts NULL\n\nConcat Operator Ignores NULL\n----------------------------\n\nCONCAT() and || ignore NULL in Oracle mode. Can also be accessed outside of\nORACLE mode by using CONCAT_OPERATOR_ORACLE. MDEV-11880 and MDEV-12143.\n\nReserved Words\n--------------\n\nThere are a number of extra reserved words in Oracle mode.\n\nSHOW CREATE TABLE\n-----------------\n\nThe SHOW CREATE TABLE statement will not display MariaDB-specific table\noptions, such as AUTO_INCREMENT or CHARSET, when Oracle mode is set.\n\nURL: https://mariadb.com/kb/en/sql_modeoracle/') WHERE help_topic_id = 484;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (485,30,'CONTAINS','Syntax\n------\n\nContains(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether a geometry g1 completely contains geometry\ng2. CONTAINS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_CONTAINS() uses object shapes.\n\nThis tests the opposite relationship to Within().\n\nURL: https://mariadb.com/kb/en/contains/','','https://mariadb.com/kb/en/contains/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (486,30,'CROSSES','Syntax\n------\n\nCrosses(g1,g2)\n\nDescription\n-----------\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon or a\nMultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise, returns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\n* The two geometries intersect\n* Their intersection results in a geometry that has a dimension that is one\n less than the maximum dimension of the two given geometries\n* Their intersection is not equal to either of the two given geometries\n\nCROSSES() is based on the original MySQL implementation, and uses object\nbounding rectangles, while ST_CROSSES() uses object shapes.\n\nURL: https://mariadb.com/kb/en/crosses/','','https://mariadb.com/kb/en/crosses/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (487,30,'DISJOINT','Syntax\n------\n\nDisjoint(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does not\nintersect) g2.\n\nDISJOINT() tests the opposite relationship to INTERSECTS().\n\nDISJOINT() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_DISJOINT() uses object shapes.\n\nURL: https://mariadb.com/kb/en/disjoint/','','https://mariadb.com/kb/en/disjoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (488,30,'EQUALS','Syntax\n------\n\nEquals(g1,g2)\n\nFrom MariaDB 10.2.3:\n\nMBREQUALS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nEQUALS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_EQUALS() uses object shapes.\n\nFrom MariaDB 10.2.3, MBREQUALS is a synonym for Equals.\n\nURL: https://mariadb.com/kb/en/equals/','','https://mariadb.com/kb/en/equals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (489,30,'INTERSECTS','Syntax\n------\n\nINTERSECTS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially intersects geometry\ng2.\n\nINTERSECTS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_INTERSECTS() uses object shapes.\n\nINTERSECTS() tests the opposite relationship to DISJOINT().\n\nURL: https://mariadb.com/kb/en/intersects/','','https://mariadb.com/kb/en/intersects/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (490,30,'OVERLAPS','Syntax\n------\n\nOVERLAPS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their intersection\nresults in a geometry of the same dimension but not equal to either of the\ngiven geometries.\n\nOVERLAPS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_OVERLAPS() uses object shapes.\n\nURL: https://mariadb.com/kb/en/overlaps/','','https://mariadb.com/kb/en/overlaps/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (491,30,'ST_CONTAINS','Syntax\n------\n\nST_CONTAINS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether a geometry g1 completely contains geometry\ng2.\n\nST_CONTAINS() uses object shapes, while CONTAINS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_CONTAINS tests the opposite relationship to ST_WITHIN().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n\nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(175 151)\');\n\nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st-contains/','','https://mariadb.com/kb/en/st-contains/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,30,'ST_CROSSES','Syntax\n------\n\nST_CROSSES(g1,g2)\n\nDescription\n-----------\n\nReturns 1 if geometry g1 spatially crosses geometry g2. Returns NULL if g1 is\na Polygon or a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\n* The two geometries intersect\n* Their intersection results in a geometry that has a dimension that is one\n less than the maximum dimension of the two given geometries\n* Their intersection is not equal to either of the two given geometries\n\nST_CROSSES() uses object shapes, while CROSSES(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(176 149, 176 151)\');\n\nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/st-crosses/','','https://mariadb.com/kb/en/st-crosses/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (493,30,'ST_DIFFERENCE','Syntax\n------\n\nST_DIFFERENCE(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry representing the point set difference of the given geometry\nvalues.\n\nExample\n-------\n\nSET @g1 = POINT(10,10), @g2 = POINT(20,20);\n\nSELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(10 10)                       |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_difference/','','https://mariadb.com/kb/en/st_difference/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,30,'ST_DISJOINT','Syntax\n------\n\nST_DISJOINT(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially disjoint from\n(does not intersect with) geometry g2.\n\nST_DISJOINT() uses object shapes, while DISJOINT(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_DISJOINT() tests the opposite relationship to ST_INTERSECTS().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n\nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st_disjoint/','','https://mariadb.com/kb/en/st_disjoint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (495,30,'ST_DISTANCE','Syntax\n------\n\nST_DISTANCE(g1,g2)\n\nDescription\n-----------\n\nReturns the distance between two geometries, or null if not given valid inputs.\n\nExample\n-------\n\nSELECT ST_Distance(POINT(1,2),POINT(2,2));\n+------------------------------------+\n| ST_Distance(POINT(1,2),POINT(2,2)) |\n+------------------------------------+\n|                                  1 |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_distance/','','https://mariadb.com/kb/en/st_distance/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (496,30,'ST_DISTANCE_SPHERE','MariaDB starting with 10.2.38\n-----------------------------\nST_DISTANCE_SPHERE was introduced in MariaDB 10.2.38, MariaDB 10.3.29, MariaDB\n10.4.19 and MariaDB 10.5.10.\n\nSyntax\n------\n\nST_DISTANCE_SPHERE(g1,g2,[r])\n\nDescription\n-----------\n\nReturns the spherical distance between two geometries (point or multipoint) on\na sphere with the optional radius r (default is the Earth radius if r is not\nspecified), or NULL if not given valid inputs.\n\nExample\n-------\n\nset @zenica   = ST_GeomFromText(\'POINT(17.907743 44.203438)\');\nset @sarajevo = ST_GeomFromText(\'POINT(18.413076 43.856258)\');\nSELECT ST_Distance_Sphere(@zenica, @sarajevo);\n55878.59337591705\n\nURL: https://mariadb.com/kb/en/st_distance_sphere/','','https://mariadb.com/kb/en/st_distance_sphere/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (497,30,'ST_EQUALS','Syntax\n------\n\nST_EQUALS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially equal to geometry\ng2.\n\nST_EQUALS() uses object shapes, while EQUALS(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(176 151, 174 149)\');\n\nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n|                  1 |\n+--------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 2)\');\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n\nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n|                  0 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/st-equals/','','https://mariadb.com/kb/en/st-equals/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (498,30,'ST_INTERSECTS','Syntax\n------\n\nST_INTERSECTS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially intersects geometry\ng2.\n\nST_INTERSECTS() uses object shapes, while INTERSECTS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_INTERSECTS() tests the opposite relationship to ST_DISJOINT().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n\nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n|                      1 |\n+------------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/st-intersects/','','https://mariadb.com/kb/en/st-intersects/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (499,30,'ST_LENGTH','Syntax\n------\n\nST_LENGTH(ls)\n\nDescription\n-----------\n\nReturns as a double-precision number the length of the LineString value ls in\nits associated spatial reference.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT ST_LENGTH(ST_GeomFromText(@ls));\n+---------------------------------+\n| ST_LENGTH(ST_GeomFromText(@ls)) |\n+---------------------------------+\n|                2.82842712474619 |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/st_length/','','https://mariadb.com/kb/en/st_length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (500,30,'ST_OVERLAPS','Syntax\n------\n\nST_OVERLAPS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially overlaps geometry g2.\n\nThe term spatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal to\neither of the given geometries.\n\nST_OVERLAPS() uses object shapes, while OVERLAPS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nURL: https://mariadb.com/kb/en/st-overlaps/','','https://mariadb.com/kb/en/st-overlaps/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (501,30,'ST_TOUCHES','Syntax\n------\n\nST_TOUCHES(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially touches geometry g2.\nTwo geometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either the\nboundary or the interior of the other.\n\nST_TOUCHES() uses object shapes, while TOUCHES(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n\nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/st-touches/','','https://mariadb.com/kb/en/st-touches/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (502,30,'ST_WITHIN','Syntax\n------\n\nST_WITHIN(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially within geometry g2.\n\nThis tests the opposite relationship as ST_CONTAINS().\n\nST_WITHIN() uses object shapes, while WITHIN(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n|                  1 |\n+--------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(176 151)\');\n\nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n|                  0 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/st-within/','','https://mariadb.com/kb/en/st-within/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (503,30,'TOUCHES','Syntax\n------\n\nTouches(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two geometries\nspatially touch if the interiors of the geometries do not intersect, but the\nboundary of one of the geometries intersects either the boundary or the\ninterior of the other.\n\nTOUCHES() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_TOUCHES() uses object shapes.\n\nURL: https://mariadb.com/kb/en/touches/','','https://mariadb.com/kb/en/touches/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (504,30,'WITHIN','Syntax\n------\n\nWithin(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This tests the\nopposite relationship as Contains().\n\nWITHIN() is based on the original MySQL implementation, and uses object\nbounding rectangles, while ST_WITHIN() uses object shapes.\n\nExamples\n--------\n\nSET @g1 = GEOMFROMTEXT(\'POINT(174 149)\');\nSET @g2 = GEOMFROMTEXT(\'POINT(176 151)\');\nSET @g3 = GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))\');\n\nSELECT within(@g1,@g3);\n+-----------------+\n| within(@g1,@g3) |\n+-----------------+\n|               1 |\n+-----------------+\n\nSELECT within(@g2,@g3);\n+-----------------+\n| within(@g2,@g3) |\n+-----------------+\n|               0 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/within/','','https://mariadb.com/kb/en/within/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (505,31,'Microseconds in MariaDB','The TIME, DATETIME, and TIMESTAMP types, along with the temporal functions,\nCAST and dynamic columns, support microseconds. The datetime precision of a\ncolumn can be specified when creating the table with CREATE TABLE, for example:\n\nCREATE TABLE example(\n col_microsec DATETIME(6),\n col_millisec TIME(3)\n);\n\nGenerally, the precision can be specified for any TIME, DATETIME, or TIMESTAMP\ncolumn, in parentheses, after the type name. The datetime precision specifies\nnumber of digits after the decimal dot and can be any integer number from 0 to\n6. If no precision is specified it is assumed to be 0, for backward\ncompatibility reasons.\n\nA datetime precision can be specified wherever a type name is used. For\nexample:\n\n* when declaring arguments of stored routines.\n* when specifying a return type of a stored function.\n* when declaring variables.\n* in a CAST function:create function example(x datetime(5)) returns time(4)\nbegin\n declare y timestamp(6);\n return cast(x as time(2));\nend;\n\n%f is used as the formatting option for microseconds in the STR_TO_DATE,\nDATE_FORMAT and FROM_UNIXTIME functions, for example:\n\nSELECT STR_TO_DATE(\'20200809 020917076\',\'%Y%m%d %H%i%s%f\');\n+-----------------------------------------------------+\n| STR_TO_DATE(\'20200809 020917076\',\'%Y%m%d %H%i%s%f\') |\n+-----------------------------------------------------+\n| 2020-08-09 02:09:17.076000                          |\n+-----------------------------------------------------+\n\nAdditional Information\n----------------------\n\n* when comparing anything to a temporal value (DATETIME, TIME, DATE, or\nTIMESTAMP), both values are compared as temporal values, not as strings.\n* The INFORMATION_SCHEMA.COLUMNS table has a new column DATETIME_PRECISION\n* NOW(), CURTIME(), UTC_TIMESTAMP(), UTC_TIME(), CURRENT_TIME(),\nCURRENT_TIMESTAMP(), LOCALTIME() and LOCALTIMESTAMP() now accept datetime\nprecision as an optional argument. For example:SELECT CURTIME(4);\n--> 10:11:12.3456\n\n* TIME_TO_SEC() and UNIX_TIMESTAMP() preserve microseconds of the argument.\nThese functions will return a decimal number if the result non-zero datetime\nprecision and an integer otherwise (for backward compatibility).SELECT\nTIME_TO_SEC(\'10:10:10.12345\');\n--> 36610.12345\n\n* Current versions of this patch fix a bug in the following optimization: in\n certain queries with DISTINCT MariaDB can ignore this clause if it can\n prove that all result rows are unique anyway, for example, when a primary key\n is compared with a constant. Sometimes this optimization was applied\n incorrectly, though — for example, when comparing a\n string with a date constant. This is now fixed.\n* DATE_ADD() and DATE_SUB() functions can now take a TIME\n expression as an argument (not just DATETIME as before).SELECT\nTIME(\'10:10:10\') + INTERVAL 100 MICROSECOND;\n--> 10:10:10.000100\n\n* The event_time field in the mysql.general_log table and the start_time,\nquery_time, and lock_time fields in the mysql.slow_log table now store values\nwith microsecond precision.\n* This patch fixed a bug when comparing a temporal value using the BETWEEN\noperator and one of the operands is NULL.\n* The old syntax TIMESTAMP(N), where N is the display width, is no longer\nsupported. It was deprecated in MySQL 4.1.0 (released on\n 2003-04-03).\n* when a DATETIME value is compared to a TIME value, the latter is treated as\na full datetime with a zero date part, similar to comparing DATE to a\nDATETIME, or to comparing DECIMAL numbers.\n Earlier versions of MariaDB used to compare only the time part of both\noperands in such a case.\n* In MariaDB, an extra column TIME_MS has been added to the\nINFORMATION_SCHEMA.PROCESSLIST table, as well as to the output of SHOW FULL\nPROCESSLIST.\n\nNote: When you convert a temporal value to a value with a smaller precision,\nit will be truncated, not rounded. This is done to guarantee that the date\npart is not changed. For example:\n\nSELECT CAST(\'2009-12-31 23:59:59.998877\' as DATETIME(3));\n-> 2009-12-31 23:59:59.998\n\nMySQL 5.6 Microseconds\n----------------------\n\nMySQL 5.6 introduced microseconds using a slightly different implementation to\nMariaDB 5.3. Since MariaDB 10.1, MariaDB has defaulted to the MySQL format, by\nmeans of the --mysql56-temporal-format variable. The MySQL version requires\nslightly more storage but has some advantages in permitting the eventual\nsupport of negative dates, and in replication.\n\nURL: https://mariadb.com/kb/en/microseconds-in-mariadb/','','https://mariadb.com/kb/en/microseconds-in-mariadb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (506,31,'Date and Time Units','The INTERVAL keyword can be used to add or subtract a time interval of time to\na DATETIME, DATE or TIME value.\n\nThe syntax is:\n\nINTERVAL time_quantity time_unit\n\nFor example, the SECOND unit is used below by the DATE_ADD() function:\n\nSELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00                       |\n+-------------------------------------------+\n\nThe following units are valid:\n\n+---------------------+------------------------------------------------------+\n| Unit                | Description                                          |\n+---------------------+------------------------------------------------------+\n| MICROSECOND         | Microseconds                                         |\n+---------------------+------------------------------------------------------+\n| SECOND              | Seconds                                              |\n+---------------------+------------------------------------------------------+\n| MINUTE              | Minutes                                              |\n+---------------------+------------------------------------------------------+\n| HOUR                | Hours                                                |\n+---------------------+------------------------------------------------------+\n| DAY                 | Days                                                 |\n+---------------------+------------------------------------------------------+\n| WEEK                | Weeks                                                |\n+---------------------+------------------------------------------------------+\n| MONTH               | Months                                               |\n+---------------------+------------------------------------------------------+\n| QUARTER             | Quarters                                             |\n+---------------------+------------------------------------------------------+\n| YEAR                | Years                                                |\n+---------------------+------------------------------------------------------+\n| SECOND_MICROSECOND  | Seconds.Microseconds                                 |\n+---------------------+------------------------------------------------------+\n| MINUTE_MICROSECOND  | Minutes.Seconds.Microseconds                         |\n+---------------------+------------------------------------------------------+\n| MINUTE_SECOND       | Minutes.Seconds                                      |\n+---------------------+------------------------------------------------------+\n| HOUR_MICROSECOND    | Hours.Minutes.Seconds.Microseconds                   |\n+---------------------+------------------------------------------------------+\n| HOUR_SECOND         | Hours.Minutes.Seconds                                |\n+---------------------+------------------------------------------------------+\n| HOUR_MINUTE         | Hours.Minutes                                        |\n+---------------------+------------------------------------------------------+\n| DAY_MICROSECOND     | Days Hours.Minutes.Seconds.Microseconds              |\n+---------------------+------------------------------------------------------+\n| DAY_SECOND          | Days Hours.Minutes.Seconds                           |\n+---------------------+------------------------------------------------------+\n| DAY_MINUTE          | Days Hours.Minutes                                   |\n+---------------------+------------------------------------------------------+\n| DAY_HOUR            | Days Hours                                           |\n+---------------------+------------------------------------------------------+\n| YEAR_MONTH          | Years-Months                                         |\n+---------------------+------------------------------------------------------+\n\nThe time units containing an underscore are composite; that is, they consist\nof multiple base time units. For base time units, time_quantity is an integer\nnumber. For composite units, the quantity must be expressed as a string with\nmultiple integer numbers separated by any punctuation character.\n\nExample of composite units:\n\nINTERVAL \'2:2\' YEAR_MONTH\nINTERVAL \'1:30:30\' HOUR_SECOND\nINTERVAL \'1!30!30\' HOUR_SECOND -- same as above\n\nTime units can be used in the following contexts:\n\n* after a + or a - operator;\n* with the following DATE or TIME functions: ADDDATE(), SUBDATE(), DATE_ADD(),\nDATE_SUB(), TIMESTAMPADD(), TIMESTAMPDIFF(), EXTRACT();\n* in the ON SCHEDULE clause of CREATE EVENT and ALTER EVENT.\n* when defining a partitioning BY SYSTEM_TIME\n\nURL: https://mariadb.com/kb/en/date-and-time-units/','','https://mariadb.com/kb/en/date-and-time-units/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (507,31,'ADD_MONTHS','MariaDB starting with 10.6.1\n----------------------------\nThe ADD_MONTHS function was introduced in MariaDB 10.6.1 to enhance Oracle\ncompatibility. Similar functionality can be achieved with the DATE_ADD\nfunction.\n\nSyntax\n------\n\nADD_MONTHS(date, months)\n\nDescription\n-----------\n\nADD_MONTHS adds an integer months to a given date (DATE, DATETIME or\nTIMESTAMP), returning the resulting date.\n\nmonths can be positive or negative.\n\nThe resulting day component will remain the same as that specified in date,\nunless the resulting month has fewer days than the day component of the given\ndate, in which case the day will be the last day of the resulting month.\n\nReturns NULL if given an invalid date, or a NULL argument.\n\nExamples\n--------\n\nSELECT ADD_MONTHS(\'2012-01-31\', 2);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 2) |\n+-----------------------------+\n| 2012-03-31                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', -5);\n+------------------------------+\n| ADD_MONTHS(\'2012-01-31\', -5) |\n+------------------------------+\n| 2011-08-31                   |\n+------------------------------+\n\nSELECT ADD_MONTHS(\'2011-01-31\', 1);\n+-----------------------------+\n| ADD_MONTHS(\'2011-01-31\', 1) |\n+-----------------------------+\n| 2011-02-28                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', 1);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 1) |\n+-----------------------------+\n| 2012-02-29                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', 2);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 2) |\n+-----------------------------+\n| 2012-03-31                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', 3);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 3) |\n+-----------------------------+\n| 2012-04-30                  |\n+-----------------------------+\n\nURL: https://mariadb.com/kb/en/add_months/','','https://mariadb.com/kb/en/add_months/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (508,31,'ADDDATE','Syntax\n------\n\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE() is a\nsynonym for DATE_ADD(). The related function SUBDATE() is a synonym for\nDATE_SUB(). For information on the INTERVAL unit argument, see the discussion\nfor DATE_ADD().\n\nWhen invoked with the days form of the second argument, MariaDB treats it as\nan integer number of days to be added to expr.\n\nExamples\n--------\n\nSELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2008-02-02                              |\n+-----------------------------------------+\n\nSELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| ADDDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2008-02-02                             |\n+----------------------------------------+\n\nSELECT ADDDATE(\'2008-01-02\', 31);\n+---------------------------+\n| ADDDATE(\'2008-01-02\', 31) |\n+---------------------------+\n| 2008-02-02                |\n+---------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, ADDDATE(d, 10) from t1;\n+---------------------+---------------------+\n| d                   | ADDDATE(d, 10)      |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-02-09 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-25 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-05-01 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-11-09 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-02-09 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-10-17 11:19:34 |\n+---------------------+---------------------+\n\nSELECT d, ADDDATE(d, INTERVAL 10 HOUR) from t1;\n+---------------------+------------------------------+\n| d                   | ADDDATE(d, INTERVAL 10 HOUR) |\n+---------------------+------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-31 07:31:07          |\n| 1983-10-15 06:42:51 | 1983-10-15 16:42:51          |\n| 2011-04-21 12:34:56 | 2011-04-21 22:34:56          |\n| 2011-10-30 06:31:41 | 2011-10-30 16:31:41          |\n| 2011-01-30 14:03:25 | 2011-01-31 00:03:25          |\n| 2004-10-07 11:19:34 | 2004-10-07 21:19:34          |\n+---------------------+------------------------------+\n\nURL: https://mariadb.com/kb/en/adddate/','','https://mariadb.com/kb/en/adddate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (509,31,'ADDTIME','Syntax\n------\n\nADDTIME(expr1,expr2)\n\nDescription\n-----------\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time or\ndatetime expression, and expr2 is a time expression.\n\nExamples\n--------\n\nSELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n+---------------------------------------------------------+\n| ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\') |\n+---------------------------------------------------------+\n| 2008-01-02 01:01:01.000001                              |\n+---------------------------------------------------------+\n\nSELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| 03:00:01.999997                               |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/addtime/','','https://mariadb.com/kb/en/addtime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (510,31,'CONVERT_TZ','Syntax\n------\n\nCONVERT_TZ(dt,from_tz,to_tz)\n\nDescription\n-----------\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by from_tz\nto the time zone given by to_tz and returns the resulting value.\n\nIn order to use named time zones, such as GMT, MET or Africa/Johannesburg, the\ntime_zone tables must be loaded (see mysql_tzinfo_to_sql).\n\nNo conversion will take place if the value falls outside of the supported\nTIMESTAMP range (\'1970-01-01 00:00:01\' to \'2038-01-19 05:14:07\' UTC) when\nconverted from from_tz to UTC.\n\nThis function returns NULL if the arguments are invalid (or named time zones\nhave not been loaded).\n\nSee time zones for more information.\n\nExamples\n--------\n\nSELECT CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\') |\n+-----------------------------------------------------+\n| 2016-01-01 22:00:00                                 |\n+-----------------------------------------------------+\n\nUsing named time zones (with the time zone tables loaded):\n\nSELECT CONVERT_TZ(\'2016-01-01 12:00:00\',\'GMT\',\'Africa/Johannesburg\');\n+---------------------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'GMT\',\'Africa/Johannesburg\') |\n+---------------------------------------------------------------+\n| 2016-01-01 14:00:00                                           |\n+---------------------------------------------------------------+\n\nThe value is out of the TIMESTAMP range, so no conversion takes place:\n\nSELECT CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\') |\n+-----------------------------------------------------+\n| 1969-12-31 22:00:00                                 |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/convert_tz/','','https://mariadb.com/kb/en/convert_tz/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (511,31,'CURDATE','Syntax\n------\n\nCURDATE()\nCURRENT_DATE\nCURRENT_DATE()\n\nDescription\n-----------\n\nCURDATE returns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or numeric\ncontext.\n\nCURRENT_DATE and CURRENT_DATE() are synonyms.\n\nExamples\n--------\n\nSELECT CURDATE();\n+------------+\n| CURDATE()  |\n+------------+\n| 2019-03-05 |\n+------------+\n\nIn a numeric context (note this is not performing date calculations):\n\nSELECT CURDATE() +0;\n+--------------+\n| CURDATE() +0 |\n+--------------+\n|     20190305 |\n+--------------+\n\nData calculation:\n\nSELECT CURDATE() - INTERVAL 5 DAY;\n+----------------------------+\n| CURDATE() - INTERVAL 5 DAY |\n+----------------------------+\n| 2019-02-28                 |\n+----------------------------+\n\nURL: https://mariadb.com/kb/en/curdate/','','https://mariadb.com/kb/en/curdate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (512,31,'CURRENT_DATE','Syntax\n------\n\nCURRENT_DATE, CURRENT_DATE()\n\nDescription\n-----------\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: https://mariadb.com/kb/en/current_date/','','https://mariadb.com/kb/en/current_date/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (513,31,'CURRENT_TIME','Syntax\n------\n\nCURRENT_TIME\nCURRENT_TIME([precision])\n\nDescription\n-----------\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: https://mariadb.com/kb/en/current_time/','','https://mariadb.com/kb/en/current_time/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (514,31,'CURRENT_TIMESTAMP','Syntax\n------\n\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\n\nDescription\n-----------\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: https://mariadb.com/kb/en/current_timestamp/','','https://mariadb.com/kb/en/current_timestamp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (515,31,'CURTIME','Syntax\n------\n\nCURTIME([precision])\n\nDescription\n-----------\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu format,\ndepending on whether the function is used in a string or numeric context. The\nvalue is expressed in the current time zone.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT CURTIME();\n+-----------+\n| CURTIME() |\n+-----------+\n| 12:45:39  |\n+-----------+\n\nSELECT CURTIME() + 0;\n+---------------+\n| CURTIME() + 0 |\n+---------------+\n| 124545.000000 |\n+---------------+\n\nWith precision:\n\nSELECT CURTIME(2);\n+-------------+\n| CURTIME(2)  |\n+-------------+\n| 09:49:08.09 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/curtime/','','https://mariadb.com/kb/en/curtime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (516,31,'DATE FUNCTION','Syntax\n------\n\nDATE(expr)\n\nDescription\n-----------\n\nExtracts the date part of the date or datetime expression expr.\n\nExamples\n--------\n\nSELECT DATE(\'2013-07-18 12:21:32\');\n+-----------------------------+\n| DATE(\'2013-07-18 12:21:32\') |\n+-----------------------------+\n| 2013-07-18                  |\n+-----------------------------+\n\nError Handling\n--------------\n\nUntil MariaDB 5.5.32, some versions of MariaDB returned 0000-00-00 when passed\nan invalid date. From 5.5.32, NULL is returned.\n\nURL: https://mariadb.com/kb/en/date-function/','','https://mariadb.com/kb/en/date-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (517,31,'DATEDIFF','Syntax\n------\n\nDATEDIFF(expr1,expr2)\n\nDescription\n-----------\n\nDATEDIFF() returns (expr1 – expr2) expressed as a value in days from one date\nto the other. expr1 and expr2 are date or date-and-time expressions. Only the\ndate parts of the values are used in the calculation.\n\nExamples\n--------\n\nSELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n+----------------------------------------------+\n| DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\') |\n+----------------------------------------------+\n|                                            1 |\n+----------------------------------------------+\n\nSELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n+----------------------------------------------+\n| DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\') |\n+----------------------------------------------+\n|                                          -31 |\n+----------------------------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2011-05-23 10:56:05 |\n+---------------------+\n\nSELECT d, DATEDIFF(NOW(),d) FROM t1;\n+---------------------+-------------------+\n| d                   | DATEDIFF(NOW(),d) |\n+---------------------+-------------------+\n| 2007-01-30 21:31:07 |              1574 |\n| 1983-10-15 06:42:51 |             10082 |\n| 2011-04-21 12:34:56 |                32 |\n| 2011-10-30 06:31:41 |              -160 |\n| 2011-01-30 14:03:25 |               113 |\n| 2004-10-07 11:19:34 |              2419 |\n+---------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/datediff/','','https://mariadb.com/kb/en/datediff/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (518,31,'DATE_ADD','Syntax\n------\n\nDATE_ADD(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The date argument specifies the starting date or\ndatetime value. expr is an expression specifying the interval value to be\nadded or subtracted from the starting date. expr is a string; it may start\nwith a \"-\" for negative intervals. unit is a keyword indicating the units in\nwhich the expression should be interpreted. See Date and Time Units for a\ncomplete list of permitted units.\n\nExamples\n--------\n\nSELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00                       |\n+-------------------------------------------+\n\nSELECT INTERVAL 1 DAY + \'2008-12-31\';\n+-------------------------------+\n| INTERVAL 1 DAY + \'2008-12-31\' |\n+-------------------------------+\n| 2009-01-01                    |\n+-------------------------------+\n\nSELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n+----------------------------------+\n| \'2005-01-01\' - INTERVAL 1 SECOND |\n+----------------------------------+\n| 2004-12-31 23:59:59              |\n+----------------------------------+\n\nSELECT DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND);\n+----------------------------------------------------+\n| DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND) |\n+----------------------------------------------------+\n| 2001-01-01 00:00:00                                |\n+----------------------------------------------------+\n\nSELECT DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY);\n+-------------------------------------------------+\n| DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY) |\n+-------------------------------------------------+\n| 2011-01-01 23:59:59                             |\n+-------------------------------------------------+\n\nSELECT DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\' MINUTE_SECOND);\n+---------------------------------------------------------------+\n| DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\' MINUTE_SECOND) |\n+---------------------------------------------------------------+\n| 2101-01-01 00:01:00                                           |\n+---------------------------------------------------------------+\n\nSELECT DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\' DAY_HOUR);\n+------------------------------------------------------------+\n| DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\' DAY_HOUR) |\n+------------------------------------------------------------+\n| 1899-12-30 14:00:00                                        |\n+------------------------------------------------------------+\n\nSELECT DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL \'1.999999\'\nSECOND_MICROSECOND);\n+------------------------------------------------------------------------------\n-+\n| DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL \'1.999999\'\nSECOND_MICROSECOND) |\n+------------------------------------------------------------------------------\n-+\n| 1993-01-01 00:00:01.000001                                                  \n |\n+------------------------------------------------------------------------------\n-+\n\nURL: https://mariadb.com/kb/en/date_add/','','https://mariadb.com/kb/en/date_add/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (519,31,'DATE_FORMAT','Syntax\n------\n\nDATE_FORMAT(date, format[, locale])\n\nDescription\n-----------\n\nFormats the date value according to the format string.\n\nThe language used for the names is controlled by the value of the\nlc_time_names system variable. See server locale for more on the supported\nlocales.\n\nThe options that can be used by DATE_FORMAT(), as well as its inverse\nSTR_TO_DATE() and the FROM_UNIXTIME() function, are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| %a                        | Short weekday name in current locale           |\n|                           | (Variable lc_time_names).                      |\n+---------------------------+------------------------------------------------+\n| %b                        | Short form month name in current locale. For   |\n|                           | locale en_US this is one of:                   |\n|                           | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov    |\n|                           | or Dec.                                        |\n+---------------------------+------------------------------------------------+\n| %c                        | Month with 1 or 2 digits.                      |\n+---------------------------+------------------------------------------------+\n| %D                        | Day with English suffix \'th\', \'nd\', \'st\' or    |\n|                           | \'rd\'\'. (1st, 2nd, 3rd...).                     |\n+---------------------------+------------------------------------------------+\n| %d                        | Day with 2 digits.                             |\n+---------------------------+------------------------------------------------+\n| %e                        | Day with 1 or 2 digits.                        |\n+---------------------------+------------------------------------------------+\n| %f                        | Microseconds 6 digits.                         |\n+---------------------------+------------------------------------------------+\n| %H                        | Hour with 2 digits between 00-23.              |\n+---------------------------+------------------------------------------------+\n| %h                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %I                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %i                        | Minute with 2 digits.                          |\n+---------------------------+------------------------------------------------+\n| %j                        | Day of the year (001-366)                      |\n+---------------------------+------------------------------------------------+\n| %k                        | Hour with 1 digits between 0-23.               |\n+---------------------------+------------------------------------------------+\n| %l                        | Hour with 1 digits between 1-12.               |\n+---------------------------+------------------------------------------------+\n| %M                        | Full month name in current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %m                        | Month with 2 digits.                           |\n+---------------------------+------------------------------------------------+\n| %p                        | AM/PM according to current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %r                        | Time in 12 hour format, followed by AM/PM.     |\n|                           | Short for \'%I:%i:%S %p\'.                       |\n+---------------------------+------------------------------------------------+\n| %S                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %s                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %T                        | Time in 24 hour format. Short for \'%H:%i:%S\'.  |\n+---------------------------+------------------------------------------------+\n| %U                        | Week number (00-53), when first day of the     |\n|                           | week is Sunday.                                |\n+---------------------------+------------------------------------------------+\n| %u                        | Week number (00-53), when first day of the     |\n|                           | week is Monday.                                |\n+---------------------------+------------------------------------------------+\n| %V                        | Week number (01-53), when first day of the     |\n|                           | week is Sunday. Used with %X.                  |\n+---------------------------+------------------------------------------------+\n| %v                        | Week number (01-53), when first day of the     |\n|                           | week is Monday. Used with %x.                  |\n+---------------------------+------------------------------------------------+\n| %W                        | Full weekday name in current locale (Variable  |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %w                        | Day of the week. 0 = Sunday, 6 = Saturday.     |\n+---------------------------+------------------------------------------------+\n| %X                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %V.                       |\n+---------------------------+------------------------------------------------+\n| %x                        | Year with 4 digits when first day of the week  |\n|                           | is Monday. Used with %v.                       |\n+---------------------------+------------------------------------------------+\n| %Y                        | Year with 4 digits.                            |\n+---------------------------+------------------------------------------------+\n| %y                        | Year with 2 digits.                            |\n+---------------------------+------------------------------------------------+\n| %#                        | For str_to_date(), skip all numbers.           |\n+---------------------------+------------------------------------------------+\n| %.                        | For str_to_date(), skip all punctation         |\n|                           | characters.                                    |\n+---------------------------+------------------------------------------------+\n| %@                        | For str_to_date(), skip all alpha characters.  |\n+---------------------------+------------------------------------------------+\n| %%                        | A literal % character.                         |\n+---------------------------+------------------------------------------------+\n\nTo get a date in one of the standard formats, GET_FORMAT() can be used.\n\nExamples\n--------\n\nSELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\') |\n+------------------------------------------------+\n| Sunday October 2009                            |\n+------------------------------------------------+\n\nSELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\') |\n+------------------------------------------------+\n| 22:23:00                                       |\n+------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b %j\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b %j\') |\n+------------------------------------------------------------+\n| 4th 00 Thu 04 10 Oct 277                                   |\n+------------------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S %w\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S %w\') |\n+------------------------------------------------------------+\n| 22 22 10 10:23:00 PM 22:23:00 00 6                         |\n+------------------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n+------------------------------------+\n| DATE_FORMAT(\'1999-01-01\', \'%X %V\') |\n+------------------------------------+\n| 1998 52                            |\n+------------------------------------+\n\nSELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n+---------------------------------+\n| DATE_FORMAT(\'2006-06-00\', \'%d\') |\n+---------------------------------+\n| 00                              |\n+---------------------------------+\n\nMariaDB starting with 10.3.2\n----------------------------\nOptionally, the locale can be explicitly specified as the third DATE_FORMAT()\nargument. Doing so makes the function independent from the session settings,\nand the three argument version of DATE_FORMAT() can be used in virtual indexed\nand persistent generated-columns:\n\nSELECT DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\');\n+------------------------------------------+\n| DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\') |\n+------------------------------------------+\n| Κυριακή                                  |\n+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/date_format/','','https://mariadb.com/kb/en/date_format/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (520,31,'DATE_SUB','Syntax\n------\n\nDATE_SUB(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The date argument specifies the starting date or\ndatetime value. expr is an expression specifying the interval value to be\nadded or subtracted from the starting date. expr is a string; it may start\nwith a \"-\" for negative intervals. unit is a keyword indicating the units in\nwhich the expression should be interpreted. See Date and Time Units for a\ncomplete list of permitted units.\n\nSee also DATE_ADD().\n\nExamples\n--------\n\nSELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 1997-12-02                              |\n+-----------------------------------------+\n\nSELECT DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\' DAY_SECOND);\n+----------------------------------------------------------------+\n| DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\' DAY_SECOND) |\n+----------------------------------------------------------------+\n| 2004-12-30 22:58:59                                            |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/date_sub/','','https://mariadb.com/kb/en/date_sub/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (521,31,'DAY','Syntax\n------\n\nDAY(date)\n\nDescription\n-----------\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: https://mariadb.com/kb/en/day/','','https://mariadb.com/kb/en/day/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (522,31,'DAYNAME','Syntax\n------\n\nDAYNAME(date)\n\nDescription\n-----------\n\nReturns the name of the weekday for date. The language used for the name is\ncontrolled by the value of the lc_time_names system variable. See server\nlocale for more on the supported locales.\n\nExamples\n--------\n\nSELECT DAYNAME(\'2007-02-03\');\n+-----------------------+\n| DAYNAME(\'2007-02-03\') |\n+-----------------------+\n| Saturday              |\n+-----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, DAYNAME(d) FROM t1;\n+---------------------+------------+\n| d                   | DAYNAME(d) |\n+---------------------+------------+\n| 2007-01-30 21:31:07 | Tuesday    |\n| 1983-10-15 06:42:51 | Saturday   |\n| 2011-04-21 12:34:56 | Thursday   |\n| 2011-10-30 06:31:41 | Sunday     |\n| 2011-01-30 14:03:25 | Sunday     |\n| 2004-10-07 11:19:34 | Thursday   |\n+---------------------+------------+\n\nChanging the locale:\n\nSET lc_time_names = \'fr_CA\';\n\nSELECT DAYNAME(\'2013-04-01\');\n+-----------------------+\n| DAYNAME(\'2013-04-01\') |\n+-----------------------+\n| lundi                 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/dayname/','','https://mariadb.com/kb/en/dayname/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (523,31,'DAYOFMONTH','Syntax\n------\n\nDAYOFMONTH(date)\n\nDescription\n-----------\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for dates\nsuch as \'0000-00-00\' or \'2008-00-00\' which have a zero day part.\n\nDAY() is a synonym.\n\nExamples\n--------\n\nSELECT DAYOFMONTH(\'2007-02-03\');\n+--------------------------+\n| DAYOFMONTH(\'2007-02-03\') |\n+--------------------------+\n|                        3 |\n+--------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d FROM t1 where DAYOFMONTH(d) = 30;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/dayofmonth/','','https://mariadb.com/kb/en/dayofmonth/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (524,31,'DAYOFWEEK','Syntax\n------\n\nDAYOFWEEK(date)\n\nDescription\n-----------\n\nReturns the day of the week index for the date (1 = Sunday, 2 = Monday, ..., 7\n= Saturday). These index values correspond to the ODBC standard.\n\nThis contrasts with WEEKDAY() which follows a different index numbering (0 =\nMonday, 1 = Tuesday, ... 6 = Sunday).\n\nExamples\n--------\n\nSELECT DAYOFWEEK(\'2007-02-03\');\n+-------------------------+\n| DAYOFWEEK(\'2007-02-03\') |\n+-------------------------+\n|                       7 |\n+-------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, DAYNAME(d), DAYOFWEEK(d), WEEKDAY(d) from t1;\n+---------------------+------------+--------------+------------+\n| d                   | DAYNAME(d) | DAYOFWEEK(d) | WEEKDAY(d) |\n+---------------------+------------+--------------+------------+\n| 2007-01-30 21:31:07 | Tuesday    |            3 |          1 |\n| 1983-10-15 06:42:51 | Saturday   |            7 |          5 |\n| 2011-04-21 12:34:56 | Thursday   |            5 |          3 |\n| 2011-10-30 06:31:41 | Sunday     |            1 |          6 |\n| 2011-01-30 14:03:25 | Sunday     |            1 |          6 |\n| 2004-10-07 11:19:34 | Thursday   |            5 |          3 |\n+---------------------+------------+--------------+------------+\n\nURL: https://mariadb.com/kb/en/dayofweek/','','https://mariadb.com/kb/en/dayofweek/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (525,31,'DAYOFYEAR','Syntax\n------\n\nDAYOFYEAR(date)\n\nDescription\n-----------\n\nReturns the day of the year for date, in the range 1 to 366.\n\nExamples\n--------\n\nSELECT DAYOFYEAR(\'2018-02-16\');\n+-------------------------+\n| DAYOFYEAR(\'2018-02-16\') |\n+-------------------------+\n|                      47 |\n+-------------------------+\n\nURL: https://mariadb.com/kb/en/dayofyear/','','https://mariadb.com/kb/en/dayofyear/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (526,31,'EXTRACT','Syntax\n------\n\nEXTRACT(unit FROM date)\n\nDescription\n-----------\n\nThe EXTRACT() function extracts the required unit from the date. See Date and\nTime Units for a complete list of permitted units.\n\nIn MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM ...) was changed to\nreturn a value from 0 to 23, adhering to the SQL standard. Until MariaDB\n10.0.6 and MariaDB 5.5.34, and in all versions of MySQL at least as of MySQL\n5.7, it could return a value > 23. HOUR() is not a standard function, so\ncontinues to adhere to the old behaviour inherited from MySQL.\n\nExamples\n--------\n\nSELECT EXTRACT(YEAR FROM \'2009-07-02\');\n+---------------------------------+\n| EXTRACT(YEAR FROM \'2009-07-02\') |\n+---------------------------------+\n|                            2009 |\n+---------------------------------+\n\nSELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n|                                         200907 |\n+------------------------------------------------+\n\nSELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n|                                          20102 |\n+------------------------------------------------+\n\nSELECT EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\');\n+--------------------------------------------------------+\n| EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\') |\n+--------------------------------------------------------+\n|                                                    123 |\n+--------------------------------------------------------+\n\nFrom MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM...) returns a value\nfrom 0 to 23, as per the SQL standard. HOUR is not a standard function, so\ncontinues to adhere to the old behaviour inherited from MySQL.\n\nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n|                             2 |               26 |\n+-------------------------------+------------------+\n\nURL: https://mariadb.com/kb/en/extract/','','https://mariadb.com/kb/en/extract/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (527,31,'FROM_DAYS','Syntax\n------\n\nFROM_DAYS(N)\n\nDescription\n-----------\n\nGiven a day number N, returns a DATE value. The day count is based on the\nnumber of days from the start of the standard calendar (0000-00-00).\n\nThe function is not designed for use with dates before the advent of the\nGregorian calendar in October 1582. Results will not be reliable since it\ndoesn\'t account for the lost days when the calendar changed from the Julian\ncalendar.\n\nThis is the converse of the TO_DAYS() function.\n\nExamples\n--------\n\nSELECT FROM_DAYS(730669);\n+-------------------+\n| FROM_DAYS(730669) |\n+-------------------+\n| 2000-07-03        |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/from_days/','','https://mariadb.com/kb/en/from_days/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (528,31,'FROM_UNIXTIME','Syntax\n------\n\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nDescription\n-----------\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether\nthe function is used in a string or numeric context. The value is expressed in\nthe current time zone. unix_timestamp is an internal timestamp value such as\nis produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format string,\nwhich is used the same way as listed in the entry for the DATE_FORMAT()\nfunction.\n\nTimestamps in MariaDB have a maximum value of 2147483647, equivalent to\n2038-01-19 05:14:07. This is due to the underlying 32-bit limitation. Using\nthe function on a timestamp beyond this will result in NULL being returned.\nUse DATETIME as a storage type if you require dates beyond this.\n\nThe options that can be used by FROM_UNIXTIME(), as well as DATE_FORMAT() and\nSTR_TO_DATE(), are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| %a                        | Short weekday name in current locale           |\n|                           | (Variable lc_time_names).                      |\n+---------------------------+------------------------------------------------+\n| %b                        | Short form month name in current locale. For   |\n|                           | locale en_US this is one of:                   |\n|                           | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov    |\n|                           | or Dec.                                        |\n+---------------------------+------------------------------------------------+\n| %c                        | Month with 1 or 2 digits.                      |\n+---------------------------+------------------------------------------------+\n| %D                        | Day with English suffix \'th\', \'nd\', \'st\' or    |\n|                           | \'rd\'\'. (1st, 2nd, 3rd...).                     |\n+---------------------------+------------------------------------------------+\n| %d                        | Day with 2 digits.                             |\n+---------------------------+------------------------------------------------+\n| %e                        | Day with 1 or 2 digits.                        |\n+---------------------------+------------------------------------------------+\n| %f                        | Microseconds 6 digits.                         |\n+---------------------------+------------------------------------------------+\n| %H                        | Hour with 2 digits between 00-23.              |\n+---------------------------+------------------------------------------------+\n| %h                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %I                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %i                        | Minute with 2 digits.                          |\n+---------------------------+------------------------------------------------+\n| %j                        | Day of the year (001-366)                      |\n+---------------------------+------------------------------------------------+\n| %k                        | Hour with 1 digits between 0-23.               |\n+---------------------------+------------------------------------------------+\n| %l                        | Hour with 1 digits between 1-12.               |\n+---------------------------+------------------------------------------------+\n| %M                        | Full month name in current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %m                        | Month with 2 digits.                           |\n+---------------------------+------------------------------------------------+\n| %p                        | AM/PM according to current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %r                        | Time in 12 hour format, followed by AM/PM.     |\n|                           | Short for \'%I:%i:%S %p\'.                       |\n+---------------------------+------------------------------------------------+\n| %S                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %s                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %T                        | Time in 24 hour format. Short for \'%H:%i:%S\'.  |\n+---------------------------+------------------------------------------------+\n| %U                        | Week number (00-53), when first day of the     |\n|                           | week is Sunday.                                |\n+---------------------------+------------------------------------------------+\n| %u                        | Week number (00-53), when first day of the     |\n|                           | week is Monday.                                |\n+---------------------------+------------------------------------------------+\n| %V                        | Week number (01-53), when first day of the     |\n|                           | week is Sunday. Used with %X.                  |\n+---------------------------+------------------------------------------------+\n| %v                        | Week number (01-53), when first day of the     |\n|                           | week is Monday. Used with %x.                  |\n+---------------------------+------------------------------------------------+\n| %W                        | Full weekday name in current locale (Variable  |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %w                        | Day of the week. 0 = Sunday, 6 = Saturday.     |\n+---------------------------+------------------------------------------------+\n| %X                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %V.                       |\n+---------------------------+------------------------------------------------+\n| %x                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %v.                       |\n+---------------------------+------------------------------------------------+\n| %Y                        | Year with 4 digits.                            |\n+---------------------------+------------------------------------------------+\n| %y                        | Year with 2 digits.                            |\n+---------------------------+------------------------------------------------+\n| %#                        | For str_to_date(), skip all numbers.           |\n+---------------------------+------------------------------------------------+\n| %.                        | For str_to_date(), skip all punctation         |\n|                           | characters.                                    |\n+---------------------------+------------------------------------------------+\n| %@                        | For str_to_date(), skip all alpha characters.  |\n+---------------------------+------------------------------------------------+\n| %%                        | A literal % character.                         |\n+---------------------------+------------------------------------------------+\n\nPerformance Considerations\n--------------------------\n\nIf your session time zone is set to SYSTEM (the default), FROM_UNIXTIME() will\ncall the OS function to convert the data using the system time zone. At least\non Linux, the corresponding function (localtime_r) uses a global mutex inside\nglibc that can cause contention under high concurrent load.\n\nSet your time zone to a named time zone to avoid this issue. See mysql time\nzone tables for details on how to do this.\n\nExamples\n--------\n\nSELECT FROM_UNIXTIME(1196440219);\n+---------------------------+\n| FROM_UNIXTIME(1196440219) |\n+---------------------------+\n| 2007-11-30 11:30:19       |\n+---------------------------+\n\nSELECT FROM_UNIXTIME(1196440219) + 0;\n+-------------------------------+\n| FROM_UNIXTIME(1196440219) + 0 |\n+-------------------------------+\n|         20071130113019.000000 |\n+-------------------------------+\n\nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\');\n+---------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\') |\n+---------------------------------------------------------+\n| 2010 27th March 01:03:47 2010                           |\n+---------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/from_unixtime/','','https://mariadb.com/kb/en/from_unixtime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (529,31,'GET_FORMAT','Syntax\n------\n\nGET_FORMAT({DATE|DATETIME|TIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nDescription\n-----------\n\nReturns a format string. This function is useful in combination with the\nDATE_FORMAT() and the STR_TO_DATE() functions.\n\nPossible result formats are:\n\n+--------------------------------------+--------------------------------------+\n| Function Call                        | Result Format                        |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'EUR\')               | \'%d.%m.%Y\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'USA\')               | \'%m.%d.%Y\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'JIS\')               | \'%Y-%m-%d\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'ISO\')               | \'%Y-%m-%d\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'INTERNAL\')          | \'%Y%m%d\'                             |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'EUR\')           | \'%Y-%m-%d %H.%i.%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'USA\')           | \'%Y-%m-%d %H.%i.%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'JIS\')           | \'%Y-%m-%d %H:%i:%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'ISO\')           | \'%Y-%m-%d %H:%i:%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'INTERNAL\')      | \'%Y%m%d%H%i%s\'                       |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'EUR\')               | \'%H.%i.%s\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'USA\')               | \'%h:%i:%s %p\'                        |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'JIS\')               | \'%H:%i:%s\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'ISO\')               | \'%H:%i:%s\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'INTERNAL\')          | \'%H%i%s\'                             |\n+--------------------------------------+--------------------------------------+\n\nExamples\n--------\n\nObtaining the string matching to the standard European date format:\n\nSELECT GET_FORMAT(DATE, \'EUR\');\n+-------------------------+\n| GET_FORMAT(DATE, \'EUR\') |\n+-------------------------+\n| %d.%m.%Y                |\n+-------------------------+\n\nUsing the same string to format a date:\n\nSELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n+--------------------------------------------------+\n| DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\')) |\n+--------------------------------------------------+\n| 03.10.2003                                       |\n+--------------------------------------------------+\n\nSELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n+--------------------------------------------------+\n| STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\')) |\n+--------------------------------------------------+\n| 2003-10-31                                       |\n+--------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/get_format/','','https://mariadb.com/kb/en/get_format/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (530,31,'HOUR','Syntax\n------\n\nHOUR(time)\n\nDescription\n-----------\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much larger,\nso HOUR can return values greater than 23.\n\nThe return value is always positive, even if a negative TIME value is provided.\n\nExamples\n--------\n\nSELECT HOUR(\'10:05:03\');\n+------------------+\n| HOUR(\'10:05:03\') |\n+------------------+\n|               10 |\n+------------------+\n\nSELECT HOUR(\'272:59:59\');\n+-------------------+\n| HOUR(\'272:59:59\') |\n+-------------------+\n|               272 |\n+-------------------+\n\nDifference between EXTRACT (HOUR FROM ...) (>= MariaDB 10.0.7 and MariaDB\n5.5.35) and HOUR:\n\nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n|                             2 |               26 |\n+-------------------------------+------------------+\n\nURL: https://mariadb.com/kb/en/hour/','','https://mariadb.com/kb/en/hour/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (531,31,'LAST_DAY','Syntax\n------\n\nLAST_DAY(date)\n\nDescription\n-----------\n\nTakes a date or datetime value and returns the corresponding value for the\nlast day of the month. Returns NULL if the argument is invalid.\n\nExamples\n--------\n\nSELECT LAST_DAY(\'2003-02-05\');\n+------------------------+\n| LAST_DAY(\'2003-02-05\') |\n+------------------------+\n| 2003-02-28             |\n+------------------------+\n\nSELECT LAST_DAY(\'2004-02-05\');\n+------------------------+\n| LAST_DAY(\'2004-02-05\') |\n+------------------------+\n| 2004-02-29             |\n+------------------------+\n\nSELECT LAST_DAY(\'2004-01-01 01:01:01\');\n+---------------------------------+\n| LAST_DAY(\'2004-01-01 01:01:01\') |\n+---------------------------------+\n| 2004-01-31                      |\n+---------------------------------+\n\nSELECT LAST_DAY(\'2003-03-32\');\n+------------------------+\n| LAST_DAY(\'2003-03-32\') |\n+------------------------+\n| NULL                   |\n+------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Incorrect datetime value: \'2003-03-32\'\n\nURL: https://mariadb.com/kb/en/last_day/','','https://mariadb.com/kb/en/last_day/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (532,31,'LOCALTIME','Syntax\n------\n\nLOCALTIME\nLOCALTIME([precision])\n\nDescription\n-----------\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: https://mariadb.com/kb/en/localtime/','','https://mariadb.com/kb/en/localtime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (533,31,'LOCALTIMESTAMP','Syntax\n------\n\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n\nDescription\n-----------\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: https://mariadb.com/kb/en/localtimestamp/','','https://mariadb.com/kb/en/localtimestamp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (534,31,'MAKEDATE','Syntax\n------\n\nMAKEDATE(year,dayofyear)\n\nDescription\n-----------\n\nReturns a date, given year and day-of-year values. dayofyear must be greater\nthan 0 or the result is NULL.\n\nExamples\n--------\n\nSELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n+-------------------+-------------------+\n| MAKEDATE(2011,31) | MAKEDATE(2011,32) |\n+-------------------+-------------------+\n| 2011-01-31        | 2011-02-01        |\n+-------------------+-------------------+\n\nSELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n+--------------------+--------------------+\n| MAKEDATE(2011,365) | MAKEDATE(2014,365) |\n+--------------------+--------------------+\n| 2011-12-31         | 2014-12-31         |\n+--------------------+--------------------+\n\nSELECT MAKEDATE(2011,0);\n+------------------+\n| MAKEDATE(2011,0) |\n+------------------+\n| NULL             |\n+------------------+\n\nURL: https://mariadb.com/kb/en/makedate/','','https://mariadb.com/kb/en/makedate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (535,31,'MAKETIME','Syntax\n------\n\nMAKETIME(hour,minute,second)\n\nDescription\n-----------\n\nReturns a time value calculated from the hour, minute, and second arguments.\n\nIf minute or second are out of the range 0 to 60, NULL is returned. The hour\ncan be in the range -838 to 838, outside of which the value is truncated with\na warning.\n\nExamples\n--------\n\nSELECT MAKETIME(13,57,33);\n+--------------------+\n| MAKETIME(13,57,33) |\n+--------------------+\n| 13:57:33           |\n+--------------------+\n\nSELECT MAKETIME(-13,57,33);\n+---------------------+\n| MAKETIME(-13,57,33) |\n+---------------------+\n| -13:57:33           |\n+---------------------+\n\nSELECT MAKETIME(13,67,33);\n+--------------------+\n| MAKETIME(13,67,33) |\n+--------------------+\n| NULL               |\n+--------------------+\n\nSELECT MAKETIME(-1000,57,33);\n+-----------------------+\n| MAKETIME(-1000,57,33) |\n+-----------------------+\n| -838:59:59            |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-----------------------------------------------+\n| Level   | Code | Message                                       |\n+---------+------+-----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'-1000:57:33\' |\n+---------+------+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/maketime/','','https://mariadb.com/kb/en/maketime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (536,31,'MICROSECOND','Syntax\n------\n\nMICROSECOND(expr)\n\nDescription\n-----------\n\nReturns the microseconds from the time or datetime expression expr as a number\nin the range from 0 to 999999.\n\nIf expr is a time with no microseconds, zero is returned, while if expr is a\ndate with no time, zero with a warning is returned.\n\nExamples\n--------\n\nSELECT MICROSECOND(\'12:00:00.123456\');\n+--------------------------------+\n| MICROSECOND(\'12:00:00.123456\') |\n+--------------------------------+\n|                         123456 |\n+--------------------------------+\n\nSELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n+-------------------------------------------+\n| MICROSECOND(\'2009-12-31 23:59:59.000010\') |\n+-------------------------------------------+\n|                                        10 |\n+-------------------------------------------+\n\nSELECT MICROSECOND(\'2013-08-07 12:13:14\');\n+------------------------------------+\n| MICROSECOND(\'2013-08-07 12:13:14\') |\n+------------------------------------+\n|                                  0 |\n+------------------------------------+\n\nSELECT MICROSECOND(\'2013-08-07\');\n+---------------------------+\n| MICROSECOND(\'2013-08-07\') |\n+---------------------------+\n|                         0 |\n+---------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------------+\n| Level   | Code | Message                                      |\n+---------+------+----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'2013-08-07\' |\n+---------+------+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/microsecond/','','https://mariadb.com/kb/en/microsecond/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (537,31,'MINUTE','Syntax\n------\n\nMINUTE(time)\n\nDescription\n-----------\n\nReturns the minute for time, in the range 0 to 59.\n\nExamples\n--------\n\nSELECT MINUTE(\'2013-08-03 11:04:03\');\n+-------------------------------+\n| MINUTE(\'2013-08-03 11:04:03\') |\n+-------------------------------+\n|                             4 |\n+-------------------------------+\n\nSELECT MINUTE (\'23:12:50\');\n+---------------------+\n| MINUTE (\'23:12:50\') |\n+---------------------+\n|                  12 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/minute/','','https://mariadb.com/kb/en/minute/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (538,31,'MONTH','Syntax\n------\n\nMONTH(date)\n\nDescription\n-----------\n\nReturns the month for date in the range 1 to 12 for January to December, or 0\nfor dates such as \'0000-00-00\' or \'2008-00-00\' that have a zero month part.\n\nExamples\n--------\n\nSELECT MONTH(\'2019-01-03\');\n+---------------------+\n| MONTH(\'2019-01-03\') |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSELECT MONTH(\'2019-00-03\');\n+---------------------+\n| MONTH(\'2019-00-03\') |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/month/','','https://mariadb.com/kb/en/month/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (539,31,'MONTHNAME','Syntax\n------\n\nMONTHNAME(date)\n\nDescription\n-----------\n\nReturns the full name of the month for date. The language used for the name is\ncontrolled by the value of the lc_time_names system variable. See server\nlocale for more on the supported locales.\n\nExamples\n--------\n\nSELECT MONTHNAME(\'2019-02-03\');\n+-------------------------+\n| MONTHNAME(\'2019-02-03\') |\n+-------------------------+\n| February                |\n+-------------------------+\n\nChanging the locale:\n\nSET lc_time_names = \'fr_CA\';\n\nSELECT MONTHNAME(\'2019-05-21\');\n+-------------------------+\n| MONTHNAME(\'2019-05-21\') |\n+-------------------------+\n| mai                     |\n+-------------------------+\n\nURL: https://mariadb.com/kb/en/monthname/','','https://mariadb.com/kb/en/monthname/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (540,31,'NOW','Syntax\n------\n\nNOW([precision])\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\nLOCALTIME, LOCALTIME([precision])\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n\nDescription\n-----------\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context. The value is expressed in the current time zone.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nNOW() (or its synonyms) can be used as the default value for TIMESTAMP columns\nas well as, since MariaDB 10.0.1, DATETIME columns. Before MariaDB 10.0.1, it\nwas only possible for a single TIMESTAMP column per table to contain the\nCURRENT_TIMESTAMP as its default.\n\nWhen displayed in the INFORMATION_SCHEMA.COLUMNS table, a default CURRENT\nTIMESTAMP is displayed as CURRENT_TIMESTAMP up until MariaDB 10.2.2, and as\ncurrent_timestamp() from MariaDB 10.2.3, due to to MariaDB 10.2 accepting\nexpressions in the DEFAULT clause.\n\nChanging the timestamp system variable with a SET timestamp statement affects\nthe value returned by NOW(), but not by SYSDATE().\n\nExamples\n--------\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2010-03-27 13:13:25 |\n+---------------------+\n\nSELECT NOW() + 0;\n+-----------------------+\n| NOW() + 0             |\n+-----------------------+\n| 20100327131329.000000 |\n+-----------------------+\n\nWith precision:\n\nSELECT CURRENT_TIMESTAMP(2);\n+------------------------+\n| CURRENT_TIMESTAMP(2)   |\n+------------------------+\n| 2018-07-10 09:47:26.24 |\n+------------------------+\n\nUsed as a default TIMESTAMP:\n\nCREATE TABLE t (createdTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);\n\nFrom MariaDB 10.2.2:\n\nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\\G\n*************************** 1. row ***************************\n     TABLE_CATALOG: def\n      TABLE_SCHEMA: test\n       TABLE_NAME: t\n      COLUMN_NAME: ts\n    ORDINAL_POSITION: 1\n     COLUMN_DEFAULT: current_timestamp()\n...\n\n<= MariaDB 10.2.1\n\nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\\G\n*************************** 1. row ***************************\n     TABLE_CATALOG: def\n      TABLE_SCHEMA: test\n       TABLE_NAME: t\n      COLUMN_NAME: createdTS\n    ORDINAL_POSITION: 1\n     COLUMN_DEFAULT: CURRENT_TIMESTAMP\n...\n\nURL: https://mariadb.com/kb/en/now/','','https://mariadb.com/kb/en/now/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (541,31,'PERIOD_ADD','Syntax\n------\n\nPERIOD_ADD(P,N)\n\nDescription\n-----------\n\nAdds N months to period P. P is in the format YYMM or YYYYMM, and is not a\ndate value. If P contains a two-digit year, values from 00 to 69 are converted\nto from 2000 to 2069, while values from 70 are converted to 1970 upwards.\n\nReturns a value in the format YYYYMM.\n\nExamples\n--------\n\nSELECT PERIOD_ADD(200801,2);\n+----------------------+\n| PERIOD_ADD(200801,2) |\n+----------------------+\n|               200803 |\n+----------------------+\n\nSELECT PERIOD_ADD(6910,2);\n+--------------------+\n| PERIOD_ADD(6910,2) |\n+--------------------+\n|             206912 |\n+--------------------+\n\nSELECT PERIOD_ADD(7010,2);\n+--------------------+\n| PERIOD_ADD(7010,2) |\n+--------------------+\n|             197012 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/period_add/','','https://mariadb.com/kb/en/period_add/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (542,31,'PERIOD_DIFF','Syntax\n------\n\nPERIOD_DIFF(P1,P2)\n\nDescription\n-----------\n\nReturns the number of months between periods P1 and P2. P1 and P2 can be in\nthe format YYMM or YYYYMM, and are not date values.\n\nIf P1 or P2 contains a two-digit year, values from 00 to 69 are converted to\nfrom 2000 to 2069, while values from 70 are converted to 1970 upwards.\n\nExamples\n--------\n\nSELECT PERIOD_DIFF(200802,200703);\n+----------------------------+\n| PERIOD_DIFF(200802,200703) |\n+----------------------------+\n|                         11 |\n+----------------------------+\n\nSELECT PERIOD_DIFF(6902,6803);\n+------------------------+\n| PERIOD_DIFF(6902,6803) |\n+------------------------+\n|                     11 |\n+------------------------+\n\nSELECT PERIOD_DIFF(7002,6803);\n+------------------------+\n| PERIOD_DIFF(7002,6803) |\n+------------------------+\n|                  -1177 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/period_diff/','','https://mariadb.com/kb/en/period_diff/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (543,31,'QUARTER','Syntax\n------\n\nQUARTER(date)\n\nDescription\n-----------\n\nReturns the quarter of the year for date, in the range 1 to 4. Returns 0 if\nmonth contains a zero value, or NULL if the given value is not otherwise a\nvalid date (zero values are accepted).\n\nExamples\n--------\n\nSELECT QUARTER(\'2008-04-01\');\n+-----------------------+\n| QUARTER(\'2008-04-01\') |\n+-----------------------+\n|                     2 |\n+-----------------------+\n\nSELECT QUARTER(\'2019-00-01\');\n+-----------------------+\n| QUARTER(\'2019-00-01\') |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/quarter/','','https://mariadb.com/kb/en/quarter/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (544,31,'SECOND','Syntax\n------\n\nSECOND(time)\n\nDescription\n-----------\n\nReturns the second for a given time (which can include microseconds), in the\nrange 0 to 59, or NULL if not given a valid time value.\n\nExamples\n--------\n\nSELECT SECOND(\'10:05:03\');\n+--------------------+\n| SECOND(\'10:05:03\') |\n+--------------------+\n|                  3 |\n+--------------------+\n\nSELECT SECOND(\'10:05:01.999999\');\n+---------------------------+\n| SECOND(\'10:05:01.999999\') |\n+---------------------------+\n|                         1 |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/second/','','https://mariadb.com/kb/en/second/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (545,31,'SEC_TO_TIME','Syntax\n------\n\nSEC_TO_TIME(seconds)\n\nDescription\n-----------\n\nReturns the seconds argument, converted to hours, minutes, and seconds, as a\nTIME value. The range of the result is constrained to that of the TIME data\ntype. A warning occurs if the argument corresponds to a value outside that\nrange.\n\nThe time will be returned in the format hh:mm:ss, or hhmmss if used in a\nnumeric calculation.\n\nExamples\n--------\n\nSELECT SEC_TO_TIME(12414);\n+--------------------+\n| SEC_TO_TIME(12414) |\n+--------------------+\n| 03:26:54           |\n+--------------------+\n\nSELECT SEC_TO_TIME(12414)+0;\n+----------------------+\n| SEC_TO_TIME(12414)+0 |\n+----------------------+\n|                32654 |\n+----------------------+\n\nSELECT SEC_TO_TIME(9999999);\n+----------------------+\n| SEC_TO_TIME(9999999) |\n+----------------------+\n| 838:59:59            |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-------------------------------------------+\n| Level   | Code | Message                                   |\n+---------+------+-------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'9999999\' |\n+---------+------+-------------------------------------------+\n\nURL: https://mariadb.com/kb/en/sec_to_time/','','https://mariadb.com/kb/en/sec_to_time/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (546,31,'STR_TO_DATE','Syntax\n------\n\nSTR_TO_DATE(str,format)\n\nDescription\n-----------\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string str and a\nformat string format. STR_TO_DATE() returns a DATETIME value if the format\nstring contains both date and time parts, or a DATE or TIME value if the\nstring contains only date or time parts.\n\nThe date, time, or datetime values contained in str should be given in the\nformat indicated by format. If str contains an illegal date, time, or datetime\nvalue, STR_TO_DATE() returns NULL. An illegal value also produces a warning.\n\nUnder specific SQL_MODE settings an error may also be generated if the str\nisn\'t a valid date:\n\n* ALLOW_INVALID_DATES\n* NO_ZERO_DATE\n* NO_ZERO_IN_DATE\n\nThe options that can be used by STR_TO_DATE(), as well as its inverse\nDATE_FORMAT() and the FROM_UNIXTIME() function, are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| %a                        | Short weekday name in current locale           |\n|                           | (Variable lc_time_names).                      |\n+---------------------------+------------------------------------------------+\n| %b                        | Short form month name in current locale. For   |\n|                           | locale en_US this is one of:                   |\n|                           | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov    |\n|                           | or Dec.                                        |\n+---------------------------+------------------------------------------------+\n| %c                        | Month with 1 or 2 digits.                      |\n+---------------------------+------------------------------------------------+\n| %D                        | Day with English suffix \'th\', \'nd\', \'st\' or    |\n|                           | \'rd\'\'. (1st, 2nd, 3rd...).                     |\n+---------------------------+------------------------------------------------+\n| %d                        | Day with 2 digits.                             |\n+---------------------------+------------------------------------------------+\n| %e                        | Day with 1 or 2 digits.                        |\n+---------------------------+------------------------------------------------+\n| %f                        | Microseconds 6 digits.                         |\n+---------------------------+------------------------------------------------+\n| %H                        | Hour with 2 digits between 00-23.              |\n+---------------------------+------------------------------------------------+\n| %h                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %I                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %i                        | Minute with 2 digits.                          |\n+---------------------------+------------------------------------------------+\n| %j                        | Day of the year (001-366)                      |\n+---------------------------+------------------------------------------------+\n| %k                        | Hour with 1 digits between 0-23.               |\n+---------------------------+------------------------------------------------+\n| %l                        | Hour with 1 digits between 1-12.               |\n+---------------------------+------------------------------------------------+\n| %M                        | Full month name in current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %m                        | Month with 2 digits.                           |\n+---------------------------+------------------------------------------------+\n| %p                        | AM/PM according to current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %r                        | Time in 12 hour format, followed by AM/PM.     |\n|                           | Short for \'%I:%i:%S %p\'.                       |\n+---------------------------+------------------------------------------------+\n| %S                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %s                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %T                        | Time in 24 hour format. Short for \'%H:%i:%S\'.  |\n+---------------------------+------------------------------------------------+\n| %U                        | Week number (00-53), when first day of the     |\n|                           | week is Sunday.                                |\n+---------------------------+------------------------------------------------+\n| %u                        | Week number (00-53), when first day of the     |\n|                           | week is Monday.                                |\n+---------------------------+------------------------------------------------+\n| %V                        | Week number (01-53), when first day of the     |\n|                           | week is Sunday. Used with %X.                  |\n+---------------------------+------------------------------------------------+\n| %v                        | Week number (01-53), when first day of the     |\n|                           | week is Monday. Used with %x.                  |\n+---------------------------+------------------------------------------------+\n| %W                        | Full weekday name in current locale (Variable  |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %w                        | Day of the week. 0 = Sunday, 6 = Saturday.     |\n+---------------------------+------------------------------------------------+\n| %X                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %V.                       |\n+---------------------------+------------------------------------------------+\n| %x                        | Year with 4 digits when first day of the week  |\n|                           | is Monday. Used with %v.                       |\n+---------------------------+------------------------------------------------+\n| %Y                        | Year with 4 digits.                            |\n+---------------------------+------------------------------------------------+\n| %y                        | Year with 2 digits.                            |\n+---------------------------+------------------------------------------------+\n| %#                        | For str_to_date(), skip all numbers.           |\n+---------------------------+------------------------------------------------+\n| %.                        | For str_to_date(), skip all punctation         |\n|                           | characters.                                    |\n+---------------------------+------------------------------------------------+\n| %@                        | For str_to_date(), skip all alpha characters.  |\n+---------------------------+------------------------------------------------+\n| %%                        | A literal % character.                         |\n+---------------------------+------------------------------------------------+\n\nExamples\n--------\n\nSELECT STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e, %Y\');\n+---------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e, %Y\') |\n+---------------------------------------------------------+\n| 2014-06-02                                              |\n+---------------------------------------------------------+\n\nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e, %Y\');\n+--------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e, %Y\') |\n+--------------------------------------------------------------+\n| NULL                                                         |\n+--------------------------------------------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-------------------------------------------------------------\n---------------------+\n| Level   | Code | Message                                                    \n           |\n+---------+------+-------------------------------------------------------------\n---------------------+\n| Warning | 1411 | Incorrect datetime value: \'Wednesday23423, June 2, 2014\'\nfor function str_to_date |\n+---------+------+-------------------------------------------------------------\n---------------------+\n\nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M %e, %Y\');\n+----------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M %e, %Y\') |\n+----------------------------------------------------------------+\n| 2014-06-02                                                     |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/str_to_date/','','https://mariadb.com/kb/en/str_to_date/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (547,31,'SUBDATE','Syntax\n------\n\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE() is a\nsynonym for DATE_SUB(). See Date and Time Units for a complete list of\npermitted units.\n\nThe second form allows the use of an integer value for days. In such cases, it\nis interpreted as the number of days to be subtracted from the date or\ndatetime expression expr.\n\nExamples\n--------\n\nSELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2007-12-02                              |\n+-----------------------------------------+\n\nSELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| SUBDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2007-12-02                             |\n+----------------------------------------+\n\nSELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n+------------------------------------+\n| SUBDATE(\'2008-01-02 12:00:00\', 31) |\n+------------------------------------+\n| 2007-12-02 12:00:00                |\n+------------------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, SUBDATE(d, 10) from t1;\n+---------------------+---------------------+\n| d                   | SUBDATE(d, 10)      |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-01-20 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-05 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-04-11 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-10-20 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-01-20 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-09-27 11:19:34 |\n+---------------------+---------------------+\n\nSELECT d, SUBDATE(d, INTERVAL 10 MINUTE) from t1;\n+---------------------+--------------------------------+\n| d                   | SUBDATE(d, INTERVAL 10 MINUTE) |\n+---------------------+--------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-30 21:21:07            |\n| 1983-10-15 06:42:51 | 1983-10-15 06:32:51            |\n| 2011-04-21 12:34:56 | 2011-04-21 12:24:56            |\n| 2011-10-30 06:31:41 | 2011-10-30 06:21:41            |\n| 2011-01-30 14:03:25 | 2011-01-30 13:53:25            |\n| 2004-10-07 11:19:34 | 2004-10-07 11:09:34            |\n+---------------------+--------------------------------+\n\nURL: https://mariadb.com/kb/en/subdate/','','https://mariadb.com/kb/en/subdate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (548,31,'SUBTIME','Syntax\n------\n\nSUBTIME(expr1,expr2)\n\nDescription\n-----------\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format as\nexpr1. expr1 is a time or datetime expression, and expr2 is a time expression.\n\nExamples\n--------\n\nSELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n+--------------------------------------------------------+\n| SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\') |\n+--------------------------------------------------------+\n| 2007-12-30 22:58:58.999997                             |\n+--------------------------------------------------------+\n\nSELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| -00:59:59.999999                              |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/subtime/','','https://mariadb.com/kb/en/subtime/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (549,31,'SYSDATE','Syntax\n------\n\nSYSDATE([precision])\n\nDescription\n-----------\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the time at\nwhich the statement began to execute. (Within a stored routine or trigger,\nNOW() returns the time at which the routine or triggering statement began to\nexecute.)\n\nIn addition, changing the timestamp system variable with a SET timestamp\nstatement affects the value returned by NOW() but not by SYSDATE(). This means\nthat timestamp settings in the binary log have no effect on invocations of\nSYSDATE().\n\nBecause SYSDATE() can return different values even within the same statement,\nand is not affected by SET TIMESTAMP, it is non-deterministic and therefore\nunsafe for replication if statement-based binary logging is used. If that is a\nproblem, you can use row-based logging, or start the server with the mysqld\noption --sysdate-is-now to cause SYSDATE() to be an alias for NOW(). The\nnon-deterministic nature of SYSDATE() also means that indexes cannot be used\nfor evaluating expressions that refer to it, and that statements using the\nSYSDATE() function are unsafe for statement-based replication.\n\nExamples\n--------\n\nDifference between NOW() and SYSDATE():\n\nSELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW()               | SLEEP(2) | NOW()               |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:40 |        0 | 2010-03-27 13:23:40 |\n+---------------------+----------+---------------------+\n\nSELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE()           | SLEEP(2) | SYSDATE()           |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:52 |        0 | 2010-03-27 13:23:54 |\n+---------------------+----------+---------------------+\n\nWith precision:\n\nSELECT SYSDATE(4);\n+--------------------------+\n| SYSDATE(4)               |\n+--------------------------+\n| 2018-07-10 10:17:13.1689 |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/sysdate/','','https://mariadb.com/kb/en/sysdate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (550,31,'TIME Function','Syntax\n------\n\nTIME(expr)\n\nDescription\n-----------\n\nExtracts the time part of the time or datetime expression expr and returns it\nas a string.\n\nExamples\n--------\n\nSELECT TIME(\'2003-12-31 01:02:03\');\n+-----------------------------+\n| TIME(\'2003-12-31 01:02:03\') |\n+-----------------------------+\n| 01:02:03                    |\n+-----------------------------+\n\nSELECT TIME(\'2003-12-31 01:02:03.000123\');\n+------------------------------------+\n| TIME(\'2003-12-31 01:02:03.000123\') |\n+------------------------------------+\n| 01:02:03.000123                    |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/time-function/','','https://mariadb.com/kb/en/time-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (551,31,'TIMEDIFF','Syntax\n------\n\nTIMEDIFF(expr1,expr2)\n\nDescription\n-----------\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and expr2\nare time or date-and-time expressions, but both must be of the same type.\n\nExamples\n--------\n\nSELECT TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01 00:00:00.000001\');\n+---------------------------------------------------------------+\n| TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01 00:00:00.000001\') |\n+---------------------------------------------------------------+\n| -00:00:00.000001                                              |\n+---------------------------------------------------------------+\n\nSELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30 01:01:01.000002\');\n+----------------------------------------------------------------------+\n| TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30 01:01:01.000002\') |\n+----------------------------------------------------------------------+\n| 46:58:57.999999                                                      |\n+----------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/timediff/','','https://mariadb.com/kb/en/timediff/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (552,31,'TIMESTAMP FUNCTION','Syntax\n------\n\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nDescription\n-----------\n\nWith a single argument, this function returns the date or datetime expression\nexpr as a datetime value. With two arguments, it adds the time expression\nexpr2 to the date or datetime expression expr1 and returns the result as a\ndatetime value.\n\nExamples\n--------\n\nSELECT TIMESTAMP(\'2003-12-31\');\n+-------------------------+\n| TIMESTAMP(\'2003-12-31\') |\n+-------------------------+\n| 2003-12-31 00:00:00     |\n+-------------------------+\n\nSELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\');\n+--------------------------------------------+\n| TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\') |\n+--------------------------------------------+\n| 2003-12-31 18:30:00                        |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/timestamp-function/','','https://mariadb.com/kb/en/timestamp-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (553,31,'TIMESTAMPADD','Syntax\n------\n\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nDescription\n-----------\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument, which\nshould be one of the following values: MICROSECOND, SECOND, MINUTE, HOUR, DAY,\nWEEK, MONTH, QUARTER, or YEAR.\n\nThe unit value may be specified using one of keywords as shown, or with a\nprefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nBefore MariaDB 5.5, FRAC_SECOND was permitted as a synonym for MICROSECOND.\n\nExamples\n--------\n\nSELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n+-------------------------------------+\n| TIMESTAMPADD(MINUTE,1,\'2003-01-02\') |\n+-------------------------------------+\n| 2003-01-02 00:01:00                 |\n+-------------------------------------+\n\nSELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n+-----------------------------------+\n| TIMESTAMPADD(WEEK,1,\'2003-01-02\') |\n+-----------------------------------+\n| 2003-01-09                        |\n+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/timestampadd/','','https://mariadb.com/kb/en/timestampadd/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (554,31,'TIMESTAMPDIFF','Syntax\n------\n\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nDescription\n-----------\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be a date\nand the other a datetime; a date value is treated as a datetime having the\ntime part \'00:00:00\' where necessary. The unit for the result (an integer) is\ngiven by the unit argument. The legal values for unit are the same as those\nlisted in the description of the TIMESTAMPADD() function, i.e MICROSECOND,\nSECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.\n\nTIMESTAMPDIFF can also be used to calculate age.\n\nExamples\n--------\n\nSELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n+------------------------------------------------+\n| TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\') |\n+------------------------------------------------+\n|                                              3 |\n+------------------------------------------------+\n\nSELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n+-----------------------------------------------+\n| TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\') |\n+-----------------------------------------------+\n|                                            -1 |\n+-----------------------------------------------+\n\nSELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n+----------------------------------------------------------+\n| TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\') |\n+----------------------------------------------------------+\n|                                                   128885 |\n+----------------------------------------------------------+\n\nCalculating age:\n\nSELECT CURDATE();\n+------------+\n| CURDATE()  |\n+------------+\n| 2019-05-27 |\n+------------+\n\nSELECT TIMESTAMPDIFF(YEAR, \'1971-06-06\', CURDATE()) AS age;\n+------+\n| age  |\n+------+\n|   47 |\n+------+\n\nSELECT TIMESTAMPDIFF(YEAR, \'1971-05-06\', CURDATE()) AS age;\n+------+\n| age  |\n+------+\n|   48 |\n+------+\n\nAge as of 2014-08-02:\n\nSELECT name, date_of_birth, TIMESTAMPDIFF(YEAR,date_of_birth,\'2014-08-02\') AS\nage \n FROM student_details;\n+---------+---------------+------+\n| name    | date_of_birth | age  |\n+---------+---------------+------+\n| Chun    | 1993-12-31    |   20 |\n| Esben   | 1946-01-01    |   68 |\n| Kaolin  | 1996-07-16    |   18 |\n| Tatiana | 1988-04-13    |   26 |\n+---------+---------------+------+\n\nURL: https://mariadb.com/kb/en/timestampdiff/','','https://mariadb.com/kb/en/timestampdiff/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (555,31,'TIME_FORMAT','Syntax\n------\n\nTIME_FORMAT(time,format)\n\nDescription\n-----------\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, and seconds. Other\nspecifiers produce a NULL value or 0.\n\nExamples\n--------\n\nSELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n+--------------------------------------------+\n| TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\') |\n+--------------------------------------------+\n| 100 100 04 04 4                            |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/time_format/','','https://mariadb.com/kb/en/time_format/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (556,31,'TIME_TO_SEC','Syntax\n------\n\nTIME_TO_SEC(time)\n\nDescription\n-----------\n\nReturns the time argument, converted to seconds.\n\nThe value returned by TIME_TO_SEC is of type DOUBLE. Before MariaDB 5.3 (and\nMySQL 5.6), the type was INT. The returned value preserves microseconds of the\nargument. See also Microseconds in MariaDB.\n\nExamples\n--------\n\nSELECT TIME_TO_SEC(\'22:23:00\');\n+-------------------------+\n| TIME_TO_SEC(\'22:23:00\') |\n+-------------------------+\n|                   80580 |\n+-------------------------+\n\nSELECT TIME_TO_SEC(\'00:39:38\');\n+-------------------------+\n| TIME_TO_SEC(\'00:39:38\') |\n+-------------------------+\n|                    2378 |\n+-------------------------+\n\nSELECT TIME_TO_SEC(\'09:12:55.2355\');\n+------------------------------+\n| TIME_TO_SEC(\'09:12:55.2355\') |\n+------------------------------+\n|                   33175.2355 |\n+------------------------------+\n1 row in set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/time_to_sec/','','https://mariadb.com/kb/en/time_to_sec/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (557,31,'TO_DAYS','Syntax\n------\n\nTO_DAYS(date)\n\nDescription\n-----------\n\nGiven a date date, returns the number of days since the start of the current\ncalendar (0000-00-00).\n\nThe function is not designed for use with dates before the advent of the\nGregorian calendar in October 1582. Results will not be reliable since it\ndoesn\'t account for the lost days when the calendar changed from the Julian\ncalendar.\n\nThis is the converse of the FROM_DAYS() function.\n\nExamples\n--------\n\nSELECT TO_DAYS(\'2007-10-07\');\n+-----------------------+\n| TO_DAYS(\'2007-10-07\') |\n+-----------------------+\n|                733321 |\n+-----------------------+\n\nSELECT TO_DAYS(\'0000-01-01\');\n+-----------------------+\n| TO_DAYS(\'0000-01-01\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT TO_DAYS(950501);\n+-----------------+\n| TO_DAYS(950501) |\n+-----------------+\n|          728779 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/to_days/','','https://mariadb.com/kb/en/to_days/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (558,31,'TO_SECONDS','Syntax\n------\n\nTO_SECONDS(expr)\n\nDescription\n-----------\n\nReturns the number of seconds from year 0 till expr, or NULL if expr is not a\nvalid date or datetime.\n\nExamples\n--------\n\nSELECT TO_SECONDS(\'2013-06-13\');\n+--------------------------+\n| TO_SECONDS(\'2013-06-13\') |\n+--------------------------+\n|              63538300800 |\n+--------------------------+\n\nSELECT TO_SECONDS(\'2013-06-13 21:45:13\');\n+-----------------------------------+\n| TO_SECONDS(\'2013-06-13 21:45:13\') |\n+-----------------------------------+\n|                       63538379113 |\n+-----------------------------------+\n\nSELECT TO_SECONDS(NOW());\n+-------------------+\n| TO_SECONDS(NOW()) |\n+-------------------+\n|       63543530875 |\n+-------------------+\n\nSELECT TO_SECONDS(20130513);\n+----------------------+\n| TO_SECONDS(20130513) |\n+----------------------+\n|          63535622400 |\n+----------------------+\n1 row in set (0.00 sec)\n\nSELECT TO_SECONDS(130513);\n+--------------------+\n| TO_SECONDS(130513) |\n+--------------------+\n|        63535622400 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/to_seconds/','','https://mariadb.com/kb/en/to_seconds/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (559,31,'UNIX_TIMESTAMP','Syntax\n------\n\nUNIX_TIMESTAMP()\nUNIX_TIMESTAMP(date)\n\nDescription\n-----------\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP() is\ncalled with a date argument, it returns the value of the argument as seconds\nsince \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a DATETIME string,\na TIMESTAMP, or a number in the format YYMMDD or YYYYMMDD. The server\ninterprets date as a value in the current time zone and converts it to an\ninternal value in UTC. Clients can set their time zone as described in time\nzones.\n\nThe inverse function of UNIX_TIMESTAMP() is FROM_UNIXTIME()\n\nUNIX_TIMESTAMP() supports microseconds.\n\nTimestamps in MariaDB have a maximum value of 2147483647, equivalent to\n2038-01-19 05:14:07. This is due to the underlying 32-bit limitation. Using\nthe function on a date beyond this will result in NULL being returned. Use\nDATETIME as a storage type if you require dates beyond this.\n\nError Handling\n--------------\n\nReturns NULL for wrong arguments to UNIX_TIMESTAMP(). In MySQL and MariaDB\nbefore 5.3 wrong arguments to UNIX_TIMESTAMP() returned 0.\n\nCompatibility\n-------------\n\nAs you can see in the examples above, UNIX_TIMESTAMP(constant-date-string)\nreturns a timestamp with 6 decimals while MariaDB 5.2 and before returns it\nwithout decimals. This can cause a problem if you are using UNIX_TIMESTAMP()\nas a partitioning function. You can fix this by using\nFLOOR(UNIX_TIMESTAMP(..)) or changing the date string to a date number, like\n20080101000000.\n\nExamples\n--------\n\nSELECT UNIX_TIMESTAMP();\n+------------------+\n| UNIX_TIMESTAMP() |\n+------------------+\n|       1269711082 |\n+------------------+\n\nSELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n+---------------------------------------+\n| UNIX_TIMESTAMP(\'2007-11-30 10:30:19\') |\n+---------------------------------------+\n|                     1196436619.000000 |\n+---------------------------------------+\n\nSELECT UNIX_TIMESTAMP(\"2007-11-30 10:30:19.123456\");\n+----------------------------------------------+\n| unix_timestamp(\"2007-11-30 10:30:19.123456\") |\n+----------------------------------------------+\n|                            1196411419.123456 |\n+----------------------------------------------+\n\nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\'));\n+------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')) |\n+------------------------------------------------------+\n| 2007-11-30 10:30:19.000000                           |\n+------------------------------------------------------+\n\nSELECT FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')));\n+-------------------------------------------------------------+\n| FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\'))) |\n+-------------------------------------------------------------+\n| 2007-11-30 10:30:19                                         |\n+-------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/unix_timestamp/','','https://mariadb.com/kb/en/unix_timestamp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (560,31,'UTC_DATE','Syntax\n------\n\nUTC_DATE, UTC_DATE()\n\nDescription\n-----------\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric context.\n\nExamples\n--------\n\nSELECT UTC_DATE(), UTC_DATE() + 0;\n+------------+----------------+\n| UTC_DATE() | UTC_DATE() + 0 |\n+------------+----------------+\n| 2010-03-27 |       20100327 |\n+------------+----------------+\n\nURL: https://mariadb.com/kb/en/utc_date/','','https://mariadb.com/kb/en/utc_date/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (561,31,'UTC_TIME','Syntax\n------\n\nUTC_TIME\nUTC_TIME([precision])\n\nDescription\n-----------\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu format,\ndepending on whether the function is used in a string or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT UTC_TIME(), UTC_TIME() + 0;\n+------------+----------------+\n| UTC_TIME() | UTC_TIME() + 0 |\n+------------+----------------+\n| 17:32:34   |  173234.000000 |\n+------------+----------------+\n\nWith precision:\n\nSELECT UTC_TIME(5);\n+----------------+\n| UTC_TIME(5)    |\n+----------------+\n| 07:52:50.78369 |\n+----------------+\n\nURL: https://mariadb.com/kb/en/utc_time/','','https://mariadb.com/kb/en/utc_time/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (562,31,'UTC_TIMESTAMP','Syntax\n------\n\nUTC_TIMESTAMP\nUTC_TIMESTAMP([precision])\n\nDescription\n-----------\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n+---------------------+-----------------------+\n| UTC_TIMESTAMP()     | UTC_TIMESTAMP() + 0   |\n+---------------------+-----------------------+\n| 2010-03-27 17:33:16 | 20100327173316.000000 |\n+---------------------+-----------------------+\n\nWith precision:\n\nSELECT UTC_TIMESTAMP(4);\n+--------------------------+\n| UTC_TIMESTAMP(4)         |\n+--------------------------+\n| 2018-07-10 07:51:09.1019 |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/utc_timestamp/','','https://mariadb.com/kb/en/utc_timestamp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (563,31,'WEEK','Syntax\n------\n\nWEEK(date[,mode])\n\nDescription\n-----------\n\nThis function returns the week number for date. The two-argument form of\nWEEK() allows you to specify whether the week starts on Sunday or Monday and\nwhether the return value should be in the range from 0 to 53 or from 1 to 53.\nIf the mode argument is omitted, the value of the default_week_format system\nvariable is used.\n\nModes\n-----\n\n+-------+---------------------+--------+------------------------------------+\n| Mode  | 1st day of week     | Range  | Week 1 is the 1st week with        |\n+-------+---------------------+--------+------------------------------------+\n| 0     | Sunday              | 0-53   | a Sunday in this year              |\n+-------+---------------------+--------+------------------------------------+\n| 1     | Monday              | 0-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 2     | Sunday              | 1-53   | a Sunday in this year              |\n+-------+---------------------+--------+------------------------------------+\n| 3     | Monday              | 1-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 4     | Sunday              | 0-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 5     | Monday              | 0-53   | a Monday in this year              |\n+-------+---------------------+--------+------------------------------------+\n| 6     | Sunday              | 1-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 7     | Monday              | 1-53   | a Monday in this year              |\n+-------+---------------------+--------+------------------------------------+\n\nWith the mode value of 3, which means \'more than 3 days this year\', weeks are\nnumbered according to ISO 8601:1988.\n\nExamples\n--------\n\nSELECT WEEK(\'2008-02-20\');\n+--------------------+\n| WEEK(\'2008-02-20\') |\n+--------------------+\n|                  7 |\n+--------------------+\n\nSELECT WEEK(\'2008-02-20\',0);\n+----------------------+\n| WEEK(\'2008-02-20\',0) |\n+----------------------+\n|                    7 |\n+----------------------+\n\nSELECT WEEK(\'2008-02-20\',1);\n+----------------------+\n| WEEK(\'2008-02-20\',1) |\n+----------------------+\n|                    8 |\n+----------------------+\n\nSELECT WEEK(\'2008-12-31\',0);\n+----------------------+\n| WEEK(\'2008-12-31\',0) |\n+----------------------+\n|                   52 |\n+----------------------+\n\nSELECT WEEK(\'2008-12-31\',1);\n+----------------------+\n| WEEK(\'2008-12-31\',1) |\n+----------------------+\n|                   53 |\n+----------------------+\n\nSELECT WEEK(\'2019-12-30\',3);\n+----------------------+\n| WEEK(\'2019-12-30\',3) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, WEEK(d,0), WEEK(d,1) from t1;\n+---------------------+-----------+-----------+\n| d                   | WEEK(d,0) | WEEK(d,1) |\n+---------------------+-----------+-----------+\n| 2007-01-30 21:31:07 |         4 |         5 |\n| 1983-10-15 06:42:51 |        41 |        41 |\n| 2011-04-21 12:34:56 |        16 |        16 |\n| 2011-10-30 06:31:41 |        44 |        43 |\n| 2011-01-30 14:03:25 |         5 |         4 |\n| 2004-10-07 11:19:34 |        40 |        41 |\n+---------------------+-----------+-----------+\n\nURL: https://mariadb.com/kb/en/week/','','https://mariadb.com/kb/en/week/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (564,31,'WEEKDAY','Syntax\n------\n\nWEEKDAY(date)\n\nDescription\n-----------\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 = Sunday).\n\nThis contrasts with DAYOFWEEK() which follows the ODBC standard (1 = Sunday, 2\n= Monday, ..., 7 = Saturday).\n\nExamples\n--------\n\nSELECT WEEKDAY(\'2008-02-03 22:23:00\');\n+--------------------------------+\n| WEEKDAY(\'2008-02-03 22:23:00\') |\n+--------------------------------+\n|                              6 |\n+--------------------------------+\n\nSELECT WEEKDAY(\'2007-11-06\');\n+-----------------------+\n| WEEKDAY(\'2007-11-06\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d FROM t1 where WEEKDAY(d) = 6;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/weekday/','','https://mariadb.com/kb/en/weekday/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (565,31,'WEEKOFYEAR','Syntax\n------\n\nWEEKOFYEAR(date)\n\nDescription\n-----------\n\nReturns the calendar week of the date as a number in the range from 1 to 53.\nWEEKOFYEAR() is a compatibility function that is equivalent to WEEK(date,3).\n\nExamples\n--------\n\nSELECT WEEKOFYEAR(\'2008-02-20\');\n+--------------------------+\n| WEEKOFYEAR(\'2008-02-20\') |\n+--------------------------+\n|                        8 |\n+--------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nselect * from t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n\nSELECT d, WEEKOFYEAR(d), WEEK(d,3) from t1;\n+---------------------+---------------+-----------+\n| d                   | WEEKOFYEAR(d) | WEEK(d,3) |\n+---------------------+---------------+-----------+\n| 2007-01-30 21:31:07 |             5 |         5 |\n| 1983-10-15 06:42:51 |            41 |        41 |\n| 2011-04-21 12:34:56 |            16 |        16 |\n| 2011-10-30 06:31:41 |            43 |        43 |\n| 2011-01-30 14:03:25 |             4 |         4 |\n| 2004-10-07 11:19:34 |            41 |        41 |\n+---------------------+---------------+-----------+\n\nURL: https://mariadb.com/kb/en/weekofyear/','','https://mariadb.com/kb/en/weekofyear/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (566,31,'YEAR','Syntax\n------\n\nYEAR(date)\n\nDescription\n-----------\n\nReturns the year for the given date, in the range 1000 to 9999, or 0 for the\n\"zero\" date.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT * FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n\nSELECT * FROM t1 WHERE YEAR(d) = 2011;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nSELECT YEAR(\'1987-01-01\');\n+--------------------+\n| YEAR(\'1987-01-01\') |\n+--------------------+\n|               1987 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/year/','','https://mariadb.com/kb/en/year/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (567,31,'YEARWEEK','Syntax\n------\n\nYEARWEEK(date), YEARWEEK(date,mode)\n\nDescription\n-----------\n\nReturns year and week for a date. The mode argument works exactly like the\nmode argument to WEEK(). The year in the result may be different from the year\nin the date argument for the first and the last week of the year.\n\nExamples\n--------\n\nSELECT YEARWEEK(\'1987-01-01\');\n+------------------------+\n| YEARWEEK(\'1987-01-01\') |\n+------------------------+\n|                 198652 |\n+------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT * FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n6 rows in set (0.02 sec)\n\nSELECT YEARWEEK(d) FROM t1 WHERE YEAR(d) = 2011;\n+-------------+\n| YEARWEEK(d) |\n+-------------+\n|      201116 |\n|      201144 |\n|      201105 |\n+-------------+\n3 rows in set (0.03 sec)\n\nURL: https://mariadb.com/kb/en/yearweek/','','https://mariadb.com/kb/en/yearweek/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (568,32,'Well-Known Binary (WKB) Format','WKB stands for Well-Known Binary, a format for representing geographical and\ngeometrical data.\n\nWKB uses 1-byte unsigned integers, 4-byte unsigned integers, and 8-byte\ndouble-precision numbers.\n\n* The first byte indicates the byte order. 00 for big endian, or 01 for little\nendian.\n* The next 4 bytes indicate the geometry type. Values from 1 to 7 indicate\nwhether the type is Point, LineString, Polygon, MultiPoint, MultiLineString,\nMultiPolygon, or GeometryCollection respectively. \n* The 8-byte floats represent the co-ordinates.\n\nTake the following example, a sequence of 21 bytes each represented by two hex\ndigits:\n\n000000000140000000000000004010000000000000\n\n* It\'s big endian\n000000000140000000000000004010000000000000\n\n* It\'s a POINT\n000000000140000000000000004010000000000000\n\n* The X co-ordinate is 2.0\n000000000140000000000000004010000000000000\n\n* The Y-co-ordinate is 4.0\n000000000140000000000000004010000000000000\n\nURL: https://mariadb.com/kb/en/well-known-binary-wkb-format/','','https://mariadb.com/kb/en/well-known-binary-wkb-format/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (569,32,'AsBinary','A synonym for ST_AsBinary().\n\nURL: https://mariadb.com/kb/en/wkb-asbinary/','','https://mariadb.com/kb/en/wkb-asbinary/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (570,32,'AsWKB','A synonym for ST_AsBinary().\n\nURL: https://mariadb.com/kb/en/aswkb/','','https://mariadb.com/kb/en/aswkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (571,32,'MLineFromWKB','Syntax\n------\n\nMLineFromWKB(wkb[,srid])\nMultiLineStringFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTILINESTRING value using its WKB representation and SRID.\n\nMLineFromWKB() and MultiLineStringFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16\n0,16 23,16 48))\'));\n\nSELECT ST_AsText(MLineFromWKB(@g));\n+--------------------------------------------------------+\n| ST_AsText(MLineFromWKB(@g))                            |\n+--------------------------------------------------------+\n| MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) |\n+--------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/mlinefromwkb/','','https://mariadb.com/kb/en/mlinefromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (572,32,'MPointFromWKB','Syntax\n------\n\nMPointFromWKB(wkb[,srid])\nMultiPointFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOINT value using its WKB representation and SRID.\n\nMPointFromWKB() and MultiPointFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MPointFromText(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4,\n6 6, 6 9, 4 9, 1 5 )\'));\n\nSELECT ST_AsText(MPointFromWKB(@g));\n+-----------------------------------------------------+\n| ST_AsText(MPointFromWKB(@g))                        |\n+-----------------------------------------------------+\n| MULTIPOINT(1 1,2 2,5 3,7 2,9 3,8 4,6 6,6 9,4 9,1 5) |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/mpointfromwkb/','','https://mariadb.com/kb/en/mpointfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (573,32,'MPolyFromWKB','Syntax\n------\n\nMPolyFromWKB(wkb[,srid])\nMultiPolygonFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOLYGON value using its WKB representation and SRID.\n\nMPolyFromWKB() and MultiPolygonFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MPointFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28\n26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\'));\n\nSELECT ST_AsText(MPolyFromWKB(@g))\\G\n*************************** 1. row ***************************\nST_AsText(MPolyFromWKB(@g)): MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\n\nURL: https://mariadb.com/kb/en/mpolyfromwkb/','','https://mariadb.com/kb/en/mpolyfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (574,32,'GeomCollFromWKB','A synonym for ST_GeomCollFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-geomcollfromwkb/','','https://mariadb.com/kb/en/wkb-geomcollfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (575,32,'GeometryCollectionFromWKB','A synonym for ST_GeomCollFromWKB.\n\nURL: https://mariadb.com/kb/en/geometrycollectionfromwkb/','','https://mariadb.com/kb/en/geometrycollectionfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (576,32,'GeometryFromWKB','A synonym for ST_GeomFromWKB.\n\nURL: https://mariadb.com/kb/en/geometryfromwkb/','','https://mariadb.com/kb/en/geometryfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (577,32,'GeomFromWKB','A synonym for ST_GeomFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-geomfromwkb/','','https://mariadb.com/kb/en/wkb-geomfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (578,32,'LineFromWKB','A synonym for ST_LineFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-linefromwkb/','','https://mariadb.com/kb/en/wkb-linefromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (579,32,'LineStringFromWKB','A synonym for ST_LineFromWKB.\n\nURL: https://mariadb.com/kb/en/linestringfromwkb/','','https://mariadb.com/kb/en/linestringfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (580,32,'MultiLineStringFromWKB','A synonym for MLineFromWKB().\n\nURL: https://mariadb.com/kb/en/multilinestringfromwkb/','','https://mariadb.com/kb/en/multilinestringfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (581,32,'MultiPointFromWKB','A synonym for MPointFromWKB.\n\nURL: https://mariadb.com/kb/en/multipointfromwkb/','','https://mariadb.com/kb/en/multipointfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (582,32,'MultiPolygonFromWKB','Synonym for MPolyFromWKB.\n\nURL: https://mariadb.com/kb/en/multipolygonfromwkb/','','https://mariadb.com/kb/en/multipolygonfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (583,32,'PointFromWKB','A synonym for ST_PointFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-pointfromwkb/','','https://mariadb.com/kb/en/wkb-pointfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (584,32,'PolyFromWKB','A synonym for ST_PolyFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-polyfromwkb/','','https://mariadb.com/kb/en/wkb-polyfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (585,32,'PolygonFromWKB','A synonym for ST_PolyFromWKB.\n\nURL: https://mariadb.com/kb/en/polygonfromwkb/','','https://mariadb.com/kb/en/polygonfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (586,32,'ST_AsBinary','Syntax\n------\n\nST_AsBinary(g)\nAsBinary(g)\nST_AsWKB(g)\nAsWKB(g)\n\nDescription\n-----------\n\nConverts a value in internal geometry format to its WKB representation and\nreturns the binary result.\n\nST_AsBinary(), AsBinary(), ST_AsWKB() and AsWKB() are synonyms,\n\nExamples\n--------\n\nSET @poly = ST_GeomFromText(\'POLYGON((0 0,0 1,1 1,1 0,0 0))\');\nSELECT ST_AsBinary(@poly);\n\nSELECT ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly)));\n+--------------------------------------------+\n| ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly))) |\n+--------------------------------------------+\n| POLYGON((0 0,0 1,1 1,1 0,0 0))             |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_asbinary/','','https://mariadb.com/kb/en/st_asbinary/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (587,32,'ST_AsWKB','A synonym for ST_AsBinary().\n\nURL: https://mariadb.com/kb/en/st_aswkb/','','https://mariadb.com/kb/en/st_aswkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (588,32,'ST_GeomCollFromWKB','Syntax\n------\n\nST_GeomCollFromWKB(wkb[,srid])\nST_GeometryCollectionFromWKB(wkb[,srid])\nGeomCollFromWKB(wkb[,srid])\nGeometryCollectionFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a GEOMETRYCOLLECTION value using its WKB representation and SRID.\n\nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(), GeomCollFromWKB() and\nGeometryCollectionFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_GeomFromText(\'GEOMETRYCOLLECTION(\n POLYGON((5 5,10 5,10 10,5 5)),POINT(10 10))\'));\n\nSELECT ST_AsText(ST_GeomCollFromWKB(@g));\n+----------------------------------------------------------------+\n| ST_AsText(ST_GeomCollFromWKB(@g))                              |\n+----------------------------------------------------------------+\n| GEOMETRYCOLLECTION(POLYGON((5 5,10 5,10 10,5 5)),POINT(10 10)) |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geomcollfromwkb/','','https://mariadb.com/kb/en/st_geomcollfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (589,32,'ST_GeometryCollectionFromWKB','A synonym for ST_GeomCollFromWKB.\n\nURL: https://mariadb.com/kb/en/st_geometrycollectionfromwkb/','','https://mariadb.com/kb/en/st_geometrycollectionfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (590,32,'ST_GeometryFromWKB','A synonym for ST_GeomFromWKB.\n\nURL: https://mariadb.com/kb/en/st_geometryfromwkb/','','https://mariadb.com/kb/en/st_geometryfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (591,32,'ST_GeomFromWKB','Syntax\n------\n\nST_GeomFromWKB(wkb[,srid])\nST_GeometryFromWKB(wkb[,srid])\nGeomFromWKB(wkb[,srid])\nGeometryFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a geometry value of any type using its WKB representation and SRID.\n\nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB() and GeometryFromWKB()\nare synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_LineFromText(\'LINESTRING(0 4, 4 6)\'));\n\nSELECT ST_AsText(ST_GeomFromWKB(@g));\n+-------------------------------+\n| ST_AsText(ST_GeomFromWKB(@g)) |\n+-------------------------------+\n| LINESTRING(0 4,4 6)           |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geomfromwkb/','','https://mariadb.com/kb/en/st_geomfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (592,32,'ST_LineFromWKB','Syntax\n------\n\nST_LineFromWKB(wkb[,srid])\nLineFromWKB(wkb[,srid])\nST_LineStringFromWKB(wkb[,srid])\nLineStringFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a LINESTRING value using its WKB representation and SRID.\n\nST_LineFromWKB(), LineFromWKB(), ST_LineStringFromWKB(), and\nLineStringFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_LineFromText(\'LineString(0 4,4 6)\'));\n\nSELECT ST_AsText(ST_LineFromWKB(@g)) AS l;\n+---------------------+\n| l                   |\n+---------------------+\n| LINESTRING(0 4,4 6) |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/st_linefromwkb/','','https://mariadb.com/kb/en/st_linefromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (593,32,'ST_LineStringFromWKB','A synonym for ST_LineFromWKB.\n\nURL: https://mariadb.com/kb/en/st_linestringfromwkb/','','https://mariadb.com/kb/en/st_linestringfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (594,32,'ST_PointFromWKB','Syntax\n------\n\nST_PointFromWKB(wkb[,srid])\nPointFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a POINT value using its WKB representation and SRID.\n\nST_PointFromWKB() and PointFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_PointFromText(\'POINT(0 4)\'));\n\nSELECT ST_AsText(ST_PointFromWKB(@g)) AS p;\n+------------+\n| p          |\n+------------+\n| POINT(0 4) |\n+------------+\n\nURL: https://mariadb.com/kb/en/st_pointfromwkb/','','https://mariadb.com/kb/en/st_pointfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (595,32,'ST_PolyFromWKB','Syntax\n------\n\nST_PolyFromWKB(wkb[,srid])\nST_PolygonFromWKB(wkb[,srid])\nPolyFromWKB(wkb[,srid])\nPolygonFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a POLYGON value using its WKB representation and SRID.\n\nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB() and PolygonFromWKB() are\nsynonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_PolyFromText(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1\n1))\'));\n\nSELECT ST_AsText(ST_PolyFromWKB(@g)) AS p;\n+----------------------------------------+\n| p                                      |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_polyfromwkb/','','https://mariadb.com/kb/en/st_polyfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (596,32,'ST_PolygonFromWKB','A synonym for ST_PolyFromWKB.\n\nURL: https://mariadb.com/kb/en/st_polygonfromwkb/','','https://mariadb.com/kb/en/st_polygonfromwkb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (597,34,'Geometry Types','Description\n-----------\n\nMariaDB provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently, spatial\ncolumns are supported for MyISAM, InnoDB and ARCHIVE tables. See also SPATIAL\nINDEX.\n\nThe basic geometry type is GEOMETRY. But the type can be more specific. The\nfollowing types are supported:\n\n+-----------------------------------------------------------------------------+\n| Geometry Types                                                              |\n+-----------------------------------------------------------------------------+\n| POINT                                                                       |\n+-----------------------------------------------------------------------------+\n| LINESTRING                                                                  |\n+-----------------------------------------------------------------------------+\n| POLYGON                                                                     |\n+-----------------------------------------------------------------------------+\n| MULTIPOINT                                                                  |\n+-----------------------------------------------------------------------------+\n| MULTILINESTRING                                                             |\n+-----------------------------------------------------------------------------+\n| MULTIPOLYGON                                                                |\n+-----------------------------------------------------------------------------+\n| GEOMETRYCOLLECTION                                                          |\n+-----------------------------------------------------------------------------+\n| GEOMETRY                                                                    |\n+-----------------------------------------------------------------------------+\n\nExamples\n--------\n\nNote: For clarity, only one type is listed per table in the examples below,\nbut a table row can contain multiple types. For example:\n\nCREATE TABLE object (shapeA POLYGON, shapeB LINESTRING);\n\nPOINT\n-----\n\nCREATE TABLE gis_point  (g POINT);\nSHOW FIELDS FROM gis_point;\nINSERT INTO gis_point VALUES\n  (PointFromText(\'POINT(10 10)\')),\n  (PointFromText(\'POINT(20 10)\')),\n  (PointFromText(\'POINT(20 20)\')),\n  (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nLINESTRING\n----------\n\nCREATE TABLE gis_line  (g LINESTRING);\nSHOW FIELDS FROM gis_line;\nINSERT INTO gis_line VALUES\n  (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n  (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n  (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nPOLYGON\n-------\n\nCREATE TABLE gis_polygon   (g POLYGON);\nSHOW FIELDS FROM gis_polygon;\nINSERT INTO gis_polygon VALUES\n  (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n  (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\')),\n  (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30,\n30), Point(0, 0))))));\n\nMULTIPOINT\n----------\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\nINSERT INTO gis_multi_point VALUES\n  (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n  (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n  (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nMULTILINESTRING\n---------------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\nINSERT INTO gis_multi_line VALUES\n  (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16\n23,16 48))\')),\n  (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n  (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)),\nLineString(Point(2, 5), Point(5, 8), Point(21, 7))))));\n\nMULTIPOLYGON\n------------\n\nCREATE TABLE gis_multi_polygon  (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\nINSERT INTO gis_multi_polygon VALUES\n  (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3,\n3), Point(3, 0), Point(0, 3)))))));\n\nGEOMETRYCOLLECTION\n------------------\n\nCREATE TABLE gis_geometrycollection  (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n  (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n  (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n  (GeomFromText(\'GeometryCollection()\')),\n  (GeomFromText(\'GeometryCollection EMPTY\'));\n\nGEOMETRY\n--------\n\nCREATE TABLE gis_geometry (g GEOMETRY);\nSHOW FIELDS FROM gis_geometry;\nINSERT into gis_geometry SELECT * FROM gis_point;\nINSERT into gis_geometry SELECT * FROM gis_line;\nINSERT into gis_geometry SELECT * FROM gis_polygon;\nINSERT into gis_geometry SELECT * FROM gis_multi_point;\nINSERT into gis_geometry SELECT * FROM gis_multi_line;\nINSERT into gis_geometry SELECT * FROM gis_multi_polygon;\nINSERT into gis_geometry SELECT * FROM gis_geometrycollection;\n\nURL: https://mariadb.com/kb/en/geometry-types/','','https://mariadb.com/kb/en/geometry-types/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (598,34,'Geometry Hierarchy','Description\n-----------\n\nGeometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and two-dimensional\ngeometric objects that exist in two-dimensional coordinate space. All\ninstantiable geometry classes are defined so that valid instances of a\ngeometry class are topologically closed (that is, all defined geometries\ninclude their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\n* Point represents zero-dimensional objects.\n* Curve represents one-dimensional objects, and has subclass LineString, with\nsub-subclasses Line and LinearRing.\n* Surface is designed for two-dimensional objects and has subclass Polygon.\n* GeometryCollection has specialized zero-, one-, and two-dimensional\ncollection classes named MultiPoint, MultiLineString, and MultiPolygon for\nmodeling geometries corresponding to collections of Points, LineStrings, and\nPolygons, respectively. MultiCurve and MultiSurface are introduced as abstract\nsuperclasses that generalize the collection interfaces to handle Curves and\nSurfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnon-instantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint, MultiLineString,\nand MultiPolygon are instantiable classes.\n\nURL: https://mariadb.com/kb/en/geometry-hierarchy/','','https://mariadb.com/kb/en/geometry-hierarchy/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (599,34,'SPATIAL INDEX','Description\n-----------\n\nOn MyISAM, Aria and InnoDB tables, MariaDB can create spatial indexes (an\nR-tree index) using syntax similar to that for creating regular indexes, but\nextended with the SPATIAL keyword. Currently, columns in spatial indexes must\nbe declared NOT NULL.\n\nSpatial indexes can be created when the table is created, or added after the\nfact like so:\n\n* with CREATE TABLE: CREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g));\n\n* with ALTER TABLE: ALTER TABLE geom ADD SPATIAL INDEX(g);\n\n* with CREATE INDEX: CREATE SPATIAL INDEX sp_index ON geom (g);\n\nSPATIAL INDEX creates an R-tree index. For storage engines that support\nnon-spatial indexing of spatial columns, the engine creates a B-tree index. A\nB-tree index on spatial values is useful for exact-value lookups, but not for\nrange scans.\n\nFor more information on indexing spatial columns, see CREATE INDEX.\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\n* with ALTER TABLE: ALTER TABLE geom DROP INDEX g;\n\n* with DROP INDEX: DROP INDEX sp_index ON geom;\n\nData-at-Rest Encyption\n----------------------\n\nBefore MariaDB 10.4.3, InnoDB\'s spatial indexes could not be encrypted. If an\nInnoDB table was encrypted and if it contained spatial indexes, then those\nindexes would be unencrypted.\n\nIn MariaDB 10.4.3 and later, if innodb_checksum_algorithm is set to full_crc32\nor strict_full_crc32, and if the table does not use ROW_FORMAT=COMPRESSED,\nthen InnoDB spatial indexes will be encrypted if the table is encrypted.\n\nSee MDEV-12026 for more information.\n\nURL: https://mariadb.com/kb/en/spatial-index/','','https://mariadb.com/kb/en/spatial-index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (600,35,'BOUNDARY','A synonym for ST_BOUNDARY.\n\nURL: https://mariadb.com/kb/en/geometry-properties-boundary/','','https://mariadb.com/kb/en/geometry-properties-boundary/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (601,35,'DIMENSION','A synonym for ST_DIMENSION.\n\nURL: https://mariadb.com/kb/en/dimension/','','https://mariadb.com/kb/en/dimension/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (602,35,'ENVELOPE','A synonym for ST_ENVELOPE.\n\nURL: https://mariadb.com/kb/en/geometry-properties-envelope/','','https://mariadb.com/kb/en/geometry-properties-envelope/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (603,35,'GeometryN','A synonym for ST_GeometryN.\n\nURL: https://mariadb.com/kb/en/geometry-properties-geometryn/','','https://mariadb.com/kb/en/geometry-properties-geometryn/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (604,35,'GeometryType','A synonym for ST_GeometryType.\n\nURL: https://mariadb.com/kb/en/geometry-properties-geometrytype/','','https://mariadb.com/kb/en/geometry-properties-geometrytype/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (605,35,'IsClosed','A synonym for ST_IsClosed.\n\nURL: https://mariadb.com/kb/en/isclosed/','','https://mariadb.com/kb/en/isclosed/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (606,35,'IsEmpty','A synonym for ST_IsEmpty.\n\nURL: https://mariadb.com/kb/en/geometry-properties-isempty/','','https://mariadb.com/kb/en/geometry-properties-isempty/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (607,35,'IsRing','A synonym for ST_IsRing.\n\nURL: https://mariadb.com/kb/en/isring/','','https://mariadb.com/kb/en/isring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (608,35,'IsSimple','A synonym for ST_IsSImple.\n\nURL: https://mariadb.com/kb/en/geometry-properties-issimple/','','https://mariadb.com/kb/en/geometry-properties-issimple/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (609,35,'NumGeometries','A synonym for ST_NumGeometries.\n\nURL: https://mariadb.com/kb/en/geometry-properties-numgeometries/','','https://mariadb.com/kb/en/geometry-properties-numgeometries/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (610,35,'SRID','A synonym for ST_SRID.\n\nURL: https://mariadb.com/kb/en/geometry-properties-srid/','','https://mariadb.com/kb/en/geometry-properties-srid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (611,35,'ST_BOUNDARY','MariaDB starting with 10.1.2\n----------------------------\nThe ST_BOUNDARY function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_BOUNDARY(g)\nBOUNDARY(g)\n\nDescription\n-----------\n\nReturns a geometry that is the closure of the combinatorial boundary of the\ngeometry value g.\n\nBOUNDARY() is a synonym.\n\nExamples\n--------\n\nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0 0, -3 3)\')));\n+----------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0 0, -3 3)\'))) |\n+----------------------------------------------------------------------+\n| MULTIPOINT(3 3,-3 3)                                                 |\n+----------------------------------------------------------------------+\n\nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0, -3 3, 3\n3))\')));\n+--------------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0, -3 3, 3 3))\'))) |\n+--------------------------------------------------------------------------+\n| LINESTRING(3 3,0 0,-3 3,3 3)                                             |\n+--------------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_boundary/','','https://mariadb.com/kb/en/st_boundary/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (612,35,'ST_DIMENSION','Syntax\n------\n\nST_Dimension(g)\nDimension(g)\n\nDescription\n-----------\n\nReturns the inherent dimension of the geometry value g. The result can be\n\n+------------------------------------+---------------------------------------+\n| Dimension                          | Definition                            |\n+------------------------------------+---------------------------------------+\n| -1                                 | empty geometry                        |\n+------------------------------------+---------------------------------------+\n| 0                                  | geometry with no length or area       |\n+------------------------------------+---------------------------------------+\n| 1                                  | geometry with no area but nonzero     |\n|                                    | length                                |\n+------------------------------------+---------------------------------------+\n| 2                                  | geometry with nonzero area            |\n+------------------------------------+---------------------------------------+\n\nST_Dimension() and Dimension() are synonyms.\n\nExamples\n--------\n\nSELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n|                                              1 |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_dimension/','','https://mariadb.com/kb/en/st_dimension/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (613,35,'ST_ENVELOPE','Syntax\n------\n\nST_ENVELOPE(g)\nENVELOPE(g)\n\nDescription\n-----------\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g. The\nresult is returned as a Polygon value.\n\nThe polygon is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nST_ENVELOPE() and ENVELOPE() are synonyms.\n\nExamples\n--------\n\nSELECT AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\')));\n+----------------------------------------------------------+\n| AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\'))) |\n+----------------------------------------------------------+\n| POLYGON((1 1,4 1,4 4,1 4,1 1))                           |\n+----------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_envelope/','','https://mariadb.com/kb/en/st_envelope/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (614,35,'ST_GEOMETRYN','Syntax\n------\n\nST_GeometryN(gc,N)\nGeometryN(gc,N)\n\nDescription\n-----------\n\nReturns the N-th geometry in the GeometryCollection gc. Geometries are\nnumbered beginning with 1.\n\nST_GeometryN() and GeometryN() are synonyms.\n\nExample\n-------\n\nSET @gc = \'GeometryCollection(Point(1 1),LineString(12 14, 9 11))\';\n\nSELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1)                             |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geometryn/','','https://mariadb.com/kb/en/st_geometryn/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (615,35,'ST_GEOMETRYTYPE','Syntax\n------\n\nST_GeometryType(g)\nGeometryType(g)\n\nDescription\n-----------\n\nReturns as a string the name of the geometry type of which the geometry\ninstance g is a member. The name corresponds to one of the instantiable\nGeometry subclasses.\n\nST_GeometryType() and GeometryType() are synonyms.\n\nExamples\n--------\n\nSELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT                                    |\n+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geometrytype/','','https://mariadb.com/kb/en/st_geometrytype/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (616,35,'ST_ISCLOSED','Syntax\n------\n\nST_IsClosed(g)\nIsClosed(g)\n\nDescription\n-----------\n\nReturns 1 if a given LINESTRING\'s start and end points are the same, or 0 if\nthey are not the same. Before MariaDB 10.1.5, returns NULL if not given a\nLINESTRING. After MariaDB 10.1.5, returns -1.\n\nST_IsClosed() and IsClosed() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 0)\';\nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n|                              1 |\n+--------------------------------+\n\nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 1)\';\nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n|                              0 |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/st_isclosed/','','https://mariadb.com/kb/en/st_isclosed/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (617,35,'ST_ISEMPTY','Syntax\n------\n\nST_IsEmpty(g)\nIsEmpty(g)\n\nDescription\n-----------\n\nIsEmpty is a function defined by the OpenGIS specification, but is not fully\nimplemented by MariaDB or MySQL.\n\nSince MariaDB and MySQL do not support GIS EMPTY values such as POINT EMPTY,\nas implemented it simply returns 1 if the geometry value g is invalid, 0 if it\nis valid, and NULL if the argument is NULL.\n\nST_IsEmpty() and IsEmpty() are synonyms.\n\nURL: https://mariadb.com/kb/en/st_isempty/','','https://mariadb.com/kb/en/st_isempty/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (618,35,'ST_IsRing','MariaDB starting with 10.1.2\n----------------------------\nThe ST_IsRing function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_IsRing(g)\nIsRing(g)\n\nDescription\n-----------\n\nReturns true if a given LINESTRING is a ring, that is, both ST_IsClosed and\nST_IsSimple. A simple curve does not pass through the same point more than\nonce. However, see MDEV-7510.\n\nSt_IsRing() and IsRing() are synonyms.\n\nURL: https://mariadb.com/kb/en/st_isring/','','https://mariadb.com/kb/en/st_isring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (619,35,'ST_IsSimple','Syntax\n------\n\nST_IsSimple(g)\nIsSimple(g)\n\nDescription\n-----------\n\nReturns true if the given Geometry has no anomalous geometric points, false if\nit does, or NULL if given a NULL value.\n\nST_IsSimple() and IsSimple() are synonyms.\n\nExamples\n--------\n\nA POINT is always simple.\n\nSET @g = \'Point(1 2)\';\n\nSELECT ST_ISSIMPLE(GEOMFROMTEXT(@g));\n+-------------------------------+\n| ST_ISSIMPLE(GEOMFROMTEXT(@g)) |\n+-------------------------------+\n|                             1 |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/st_issimple/','','https://mariadb.com/kb/en/st_issimple/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (620,35,'ST_NUMGEOMETRIES','Syntax\n------\n\nST_NumGeometries(gc)\nNumGeometries(gc)\n\nDescription\n-----------\n\nReturns the number of geometries in the GeometryCollection gc.\n\nST_NumGeometries() and NumGeometries() are synonyms.\n\nExample\n-------\n\nSET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\n\nSELECT NUMGEOMETRIES(GeomFromText(@gc));\n+----------------------------------+\n| NUMGEOMETRIES(GeomFromText(@gc)) |\n+----------------------------------+\n|                                2 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_numgeometries/','','https://mariadb.com/kb/en/st_numgeometries/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (621,35,'ST_RELATE','MariaDB starting with 10.1.2\n----------------------------\nThe ST_RELATE() function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_Relate(g1, g2, i)\n\nDescription\n-----------\n\nReturns true if Geometry g1 is spatially related to Geometryg2 by testing for\nintersections between the interior, boundary and exterior of the two\ngeometries as specified by the values in intersection matrix pattern i.\n\nURL: https://mariadb.com/kb/en/st_relate/','','https://mariadb.com/kb/en/st_relate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (622,35,'ST_SRID','Syntax\n------\n\nST_SRID(g)\nSRID(g)\n\nDescription\n-----------\n\nReturns an integer indicating the Spatial Reference System ID for the geometry\nvalue g.\n\nIn MariaDB, the SRID value is just an integer associated with the geometry\nvalue. All calculations are done assuming Euclidean (planar) geometry.\n\nST_SRID() and SRID() are synonyms.\n\nExamples\n--------\n\nSELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n|                                           101 |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_srid/','','https://mariadb.com/kb/en/st_srid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (623,36,'LOAD_FILE','Syntax\n------\n\nLOAD_FILE(file_name)\n\nDescription\n-----------\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify the\nfull path name to the file, and you must have the FILE privilege. The file\nmust be readable by all and it must be less than the size, in bytes, of the\nmax_allowed_packet system variable. If the secure_file_priv system variable is\nset to a non-empty directory name, the file to be loaded must be located in\nthat directory.\n\nIf the file does not exist or cannot be read because one of the preceding\nconditions is not satisfied, the function returns NULL.\n\nSince MariaDB 5.1, the character_set_filesystem system variable has controlled\ninterpretation of file names that are given as literal strings.\n\nStatements using the LOAD_FILE() function are not safe for statement based\nreplication. This is because the slave will execute the LOAD_FILE() command\nitself. If the file doesn\'t exist on the slave, the function will return NULL.\n\nExamples\n--------\n\nUPDATE t SET blob_col=LOAD_FILE(\'/tmp/picture\') WHERE id=1;\n\nURL: https://mariadb.com/kb/en/load_file/','','https://mariadb.com/kb/en/load_file/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (624,36,'NOT REGEXP','Syntax\n------\n\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nDescription\n-----------\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: https://mariadb.com/kb/en/not-regexp/','','https://mariadb.com/kb/en/not-regexp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (625,36,'REGEXP','Syntax\n------\n\nexpr REGEXP pat, expr RLIKE pat\n\nDescription\n-----------\n\nPerforms a pattern match of a string expression expr against a pattern pat.\nThe pattern can be an extended regular expression. See Regular Expressions\nOverview for details on the syntax for regular expressions (see also PCRE\nRegular Expressions).\n\nReturns 1 if expr matches pat or 0 if it doesn\'t match. If either expr or pat\nare NULL, the result is NULL.\n\nThe negative form NOT REGEXP also exists, as an alias for NOT (string REGEXP\npattern). RLIKE and NOT RLIKE are synonyms for REGEXP and NOT REGEXP,\noriginally provided for mSQL compatibility.\n\nThe pattern need not be a literal string. For example, it can be specified as\na string expression or table column.\n\nNote: Because MariaDB uses the C escape syntax in strings (for example, \"\\n\"\nto represent the newline character), you must double any \"\\\" that you use in\nyour REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nMariaDB 10.0.5 moved to the PCRE regex library - see PCRE Regular Expressions\nfor enhancements to REGEXP introduced in MariaDB 10.0.5.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT \'Monty!\' REGEXP \'m%y%%\';\n+-------------------------+\n| \'Monty!\' REGEXP \'m%y%%\' |\n+-------------------------+\n|                       0 |\n+-------------------------+\n\nSELECT \'Monty!\' REGEXP \'.*\';\n+----------------------+\n| \'Monty!\' REGEXP \'.*\' |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n+---------------------------------------+\n| \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\' |\n+---------------------------------------+\n|                                     1 |\n+---------------------------------------+\n\nSELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n+----------------+-----------------------+\n| \'a\' REGEXP \'A\' | \'a\' REGEXP BINARY \'A\' |\n+----------------+-----------------------+\n|              1 |                     0 |\n+----------------+-----------------------+\n\nSELECT \'a\' REGEXP \'^[a-d]\';\n+---------------------+\n| \'a\' REGEXP \'^[a-d]\' |\n+---------------------+\n|                   1 |\n+---------------------+\n\ndefault_regex_flags examples\n----------------------------\n\nMariaDB 10.0.11 introduced the default_regex_flags variable to address the\nremaining compatibilities between PCRE and the old regex library.\n\nThe default behaviour (multiline match is off)\n\nSELECT \'a\\nb\\nc\' RLIKE \'^b$\';\n+---------------------------+\n| \'(?m)a\\nb\\nc\' RLIKE \'^b$\' |\n+---------------------------+\n|                         0 |\n+---------------------------+\n\nEnabling the multiline option using the PCRE option syntax:\n\nSELECT \'a\\nb\\nc\' RLIKE \'(?m)^b$\';\n+---------------------------+\n| \'a\\nb\\nc\' RLIKE \'(?m)^b$\' |\n+---------------------------+\n|                         1 |\n+---------------------------+\n\nEnabling the multiline option using default_regex_flags\n\nSET default_regex_flags=\'MULTILINE\';\nSELECT \'a\\nb\\nc\' RLIKE \'^b$\';\n+-----------------------+\n| \'a\\nb\\nc\' RLIKE \'^b$\' |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/regexp/','','https://mariadb.com/kb/en/regexp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (626,36,'REGEXP_INSTR','Syntax\n------\n\nREGEXP_INSTR(subject, pattern)\n\nReturns the position of the first occurrence of the regular expression pattern\nin the string subject, or 0 if pattern was not found.\n\nThe positions start with 1 and are measured in characters (i.e. not in bytes),\nwhich is important for multi-byte character sets. You can cast a multi-byte\ncharacter set to BINARY to get offsets in bytes.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_INSTR was introduced as part of this\nenhancement.\n\nExamples\n--------\n\nSELECT REGEXP_INSTR(\'abc\',\'b\');\n-> 2\n\nSELECT REGEXP_INSTR(\'abc\',\'x\');\n-> 0\n\nSELECT REGEXP_INSTR(\'BJÖRN\',\'N\');\n-> 5\n\nCasting a multi-byte character set as BINARY to get offsets in bytes:\n\nSELECT REGEXP_INSTR(BINARY \'BJÖRN\',\'N\') AS cast_utf8_to_binary;\n-> 6\n\nCase sensitivity:\n\nSELECT REGEXP_INSTR(\'ABC\',\'b\');\n-> 2\n\nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n-> 0\n\nSELECT REGEXP_INSTR(BINARY\'ABC\',\'b\');\n-> 0\n\nSELECT REGEXP_INSTR(\'ABC\',\'(?-i)b\');\n-> 0\n\nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'(?i)b\');\n-> 2\n\nURL: https://mariadb.com/kb/en/regexp_instr/','','https://mariadb.com/kb/en/regexp_instr/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (627,36,'REGEXP_REPLACE','Syntax\n------\n\nREGEXP_REPLACE(subject, pattern, replace)\n\nDescription\n-----------\n\nREGEXP_REPLACE returns the string subject with all occurrences of the regular\nexpression pattern replaced by the string replace. If no occurrences are\nfound, then subject is returned as is.\n\nThe replace string can have backreferences to the subexpressions in the form\n\\N, where N is a number from 1 to 9.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_REPLACE was introduced as part of this\nenhancement.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT REGEXP_REPLACE(\'ab12cd\',\'[0-9]\',\'\') AS remove_digits;\n-> abcd\n\nSELECT\nREGEXP_REPLACE(\'<html><head><title>title</title><body>body</body></htm>\',\n\'<.+?>\',\' \')\nAS strip_html;\n-> title  body\n\nBackreferences to the subexpressions in the form \\N, where N is a number from\n1 to 9:\n\nSELECT REGEXP_REPLACE(\'James Bond\',\'^(.*) (.*)$\',\'\\\\2, \\\\1\') AS reorder_name;\n-> Bond, James\n\nCase insensitive and case sensitive matches:\n\nSELECT REGEXP_REPLACE(\'ABC\',\'b\',\'-\') AS case_insensitive;\n-> A-C\n\nSELECT REGEXP_REPLACE(\'ABC\' COLLATE utf8_bin,\'b\',\'-\') AS case_sensitive;\n-> ABC\n\nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'b\',\'-\') AS binary_data;\n-> ABC\n\nOverwriting the collation case sensitivity using the (?i) and (?-i) PCRE flags.\n\nSELECT REGEXP_REPLACE(\'ABC\',\'(?-i)b\',\'-\') AS force_case_sensitive;\n-> ABC\n\nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'(?i)b\',\'-\') AS force_case_insensitive;\n-> A-C\n\nURL: https://mariadb.com/kb/en/regexp_replace/','','https://mariadb.com/kb/en/regexp_replace/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (628,36,'REGEXP_SUBSTR','Syntax\n------\n\nREGEXP_SUBSTR(subject,pattern)\n\nDescription\n-----------\n\nReturns the part of the string subject that matches the regular expression\npattern, or an empty string if pattern was not found.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_SUBSTR was introduced as part of this\nenhancement.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT REGEXP_SUBSTR(\'ab12cd\',\'[0-9]+\');\n-> 12\n\nSELECT REGEXP_SUBSTR(\n \'See https://mariadb.org/en/foundation/ for details\',\n \'https?://[^/]*\');\n-> https://mariadb.org\n\nSELECT REGEXP_SUBSTR(\'ABC\',\'b\');\n-> B\n\nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n->\n\nSELECT REGEXP_SUBSTR(BINARY\'ABC\',\'b\');\n->\n\nSELECT REGEXP_SUBSTR(\'ABC\',\'(?i)b\');\n-> B\n\nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'(?+i)b\');\n-> B\n\nURL: https://mariadb.com/kb/en/regexp_substr/','','https://mariadb.com/kb/en/regexp_substr/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (629,36,'ASCII','Syntax\n------\n\nASCII(str)\n\nDescription\n-----------\n\nReturns the numeric ASCII value of the leftmost character of the string\nargument. Returns 0 if the given string is empty and NULL if it is NULL.\n\nASCII() works for 8-bit characters.\n\nExamples\n--------\n\nSELECT ASCII(9);\n+----------+\n| ASCII(9) |\n+----------+\n|       57 |\n+----------+\n\nSELECT ASCII(\'9\');\n+------------+\n| ASCII(\'9\') |\n+------------+\n|         57 |\n+------------+\n\nSELECT ASCII(\'abc\');\n+--------------+\n| ASCII(\'abc\') |\n+--------------+\n|           97 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/ascii/','','https://mariadb.com/kb/en/ascii/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (630,36,'BIN','Syntax\n------\n\nBIN(N)\n\nDescription\n-----------\n\nReturns a string representation of the binary value of the given longlong\n(that is, BIGINT) number. This is equivalent to CONV(N,10,2). The argument\nshould be positive. If it is a FLOAT, it will be truncated. Returns NULL if\nthe argument is NULL.\n\nExamples\n--------\n\nSELECT BIN(12);\n+---------+\n| BIN(12) |\n+---------+\n| 1100    |\n+---------+\n\nURL: https://mariadb.com/kb/en/bin/','','https://mariadb.com/kb/en/bin/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (631,36,'BINARY Operator','This page describes the BINARY operator. For details about the data type, see\nBinary Data Type.\n\nSyntax\n------\n\nBINARY\n\nDescription\n-----------\n\nThe BINARY operator casts the string following it to a binary string. This is\nan easy way to force a column comparison to be done byte by byte rather than\ncharacter by character. This causes the comparison to be case sensitive even\nif the column isn\'t defined as BINARY or BLOB.\n\nBINARY also causes trailing spaces to be significant.\n\nExamples\n--------\n\nSELECT \'a\' = \'A\';\n+-----------+\n| \'a\' = \'A\' |\n+-----------+\n|         1 |\n+-----------+\n\nSELECT BINARY \'a\' = \'A\';\n+------------------+\n| BINARY \'a\' = \'A\' |\n+------------------+\n|                0 |\n+------------------+\n\nSELECT \'a\' = \'a \';\n+------------+\n| \'a\' = \'a \' |\n+------------+\n|          1 |\n+------------+\n\nSELECT BINARY \'a\' = \'a \';\n+-------------------+\n| BINARY \'a\' = \'a \' |\n+-------------------+\n|                 0 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/binary-operator/','','https://mariadb.com/kb/en/binary-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (632,36,'BIT_LENGTH','Syntax\n------\n\nBIT_LENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the given string argument in bits. If the argument is\nnot a string, it will be converted to string. If the argument is NULL, it\nreturns NULL.\n\nExamples\n--------\n\nSELECT BIT_LENGTH(\'text\');\n+--------------------+\n| BIT_LENGTH(\'text\') |\n+--------------------+\n|                 32 |\n+--------------------+\n\nSELECT BIT_LENGTH(\'\');\n+----------------+\n| BIT_LENGTH(\'\') |\n+----------------+\n|              0 |\n+----------------+\n\nCompatibility\n-------------\n\nPostgreSQL and Sybase support BIT_LENGTH().\n\nURL: https://mariadb.com/kb/en/bit_length/','','https://mariadb.com/kb/en/bit_length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (633,36,'CAST','Syntax\n------\n\nCAST(expr AS type)\n\nDescription\n-----------\n\nThe CAST() function takes a value of one type and produces a value of another\ntype, similar to the CONVERT() function.\n\nThe type can be one of the following values:\n\n* BINARY\n* CHAR\n* DATE\n* DATETIME\n* DECIMAL[(M[,D])]\n* DOUBLE\n* FLOAT (from MariaDB 10.4.5)\n* INTEGER\nShort for SIGNED INTEGER\n\n* SIGNED [INTEGER]\n* UNSIGNED [INTEGER]\n* TIME\n* VARCHAR (in Oracle mode, from MariaDB 10.3)\n\nThe main difference between CAST and CONVERT() is that CONVERT(expr,type) is\nODBC syntax while CAST(expr as type) and CONVERT(... USING ...) are SQL92\nsyntax.\n\nIn MariaDB 10.4 and later, you can use the CAST() function with the INTERVAL\nkeyword.\n\nUntil MariaDB 5.5.31, X\'HHHH\', the standard SQL syntax for binary string\nliterals, erroneously worked in the same way as 0xHHHH. In 5.5.31 it was\nintentionally changed to behave as a string in all contexts (and never as a\nnumber).\n\nThis introduced an incompatibility with previous versions of MariaDB, and all\nversions of MySQL (see the example below).\n\nExamples\n--------\n\nSimple casts:\n\nSELECT CAST(\"abc\" AS BINARY);\nSELECT CAST(\"1\" AS UNSIGNED INTEGER);\nSELECT CAST(123 AS CHAR CHARACTER SET utf8)\n\nNote that when one casts to CHAR without specifying the character set, the\ncollation_connection character set collation will be used. When used with CHAR\nCHARACTER SET, the default collation for that character set will be used.\n\nSELECT COLLATION(CAST(123 AS CHAR));\n+------------------------------+\n| COLLATION(CAST(123 AS CHAR)) |\n+------------------------------+\n| latin1_swedish_ci            |\n+------------------------------+\n\nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8));\n+-------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8)) |\n+-------------------------------------------------+\n| utf8_general_ci                                 |\n+-------------------------------------------------+\n\nIf you also want to change the collation, you have to use the COLLATE operator:\n\nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) \n COLLATE utf8_unicode_ci);\n+-------------------------------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) |\n+-------------------------------------------------------------------------+\n| utf8_unicode_ci                                                         |\n+-------------------------------------------------------------------------+\n\nUsing CAST() to order an ENUM field as a CHAR rather than the internal\nnumerical value:\n\nCREATE TABLE enum_list (enum_field enum(\'c\',\'a\',\'b\'));\n\nINSERT INTO enum_list (enum_field) \nVALUES(\'c\'),(\'a\'),(\'c\'),(\'b\');\n\nSELECT * FROM enum_list \nORDER BY enum_field;\n+------------+\n| enum_field |\n+------------+\n| c          |\n| c          |\n| a          |\n| b          |\n+------------+\n\nSELECT * FROM enum_list \nORDER BY CAST(enum_field AS CHAR);\n+------------+\n| enum_field |\n+------------+\n| a          |\n| b          |\n| c          |\n| c          |\n+------------+\n\nFrom MariaDB 5.5.31, the following will trigger warnings, since x\'aa\' and\n\'X\'aa\' no longer behave as a number. Previously, and in all versions of MySQL,\nno warnings are triggered since they did erroneously behave as a number:\n\nSELECT CAST(0xAA AS UNSIGNED), CAST(x\'aa\' AS UNSIGNED), CAST(X\'aa\' AS\nUNSIGNED);\n+------------------------+-------------------------+-------------------------+\n| CAST(0xAA AS UNSIGNED) | CAST(x\'aa\' AS UNSIGNED) | CAST(X\'aa\' AS UNSIGNED) |\n+------------------------+-------------------------+-------------------------+\n|                    170 |                       0 |                       0 |\n+------------------------+-------------------------+-------------------------+\n1 row in set, 2 warnings (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect INTEGER value: \'\\xAA\'\nWarning (Code 1292): Truncated incorrect INTEGER value: \'\\xAA\'\n\nCasting to intervals:\n\nSELECT CAST(2019-01-04 INTERVAL AS DAY_SECOND(2)) AS \"Cast\";\n\n+-------------+\n| Cast        |\n+-------------+\n| 00:20:17.00 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/cast/','','https://mariadb.com/kb/en/cast/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (634,36,'CHAR Function','Syntax\n------\n\nCHAR(N,... [USING charset_name])\n\nDescription\n-----------\n\nCHAR() interprets each argument as an INT and returns a string consisting of\nthe characters given by the code values of those integers. NULL values are\nskipped. By default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nSELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary              | utf8                           |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given character\nset, a warning is issued. Also, if strict SQL mode is enabled, the result from\nCHAR() becomes NULL.\n\nExamples\n--------\n\nSELECT CHAR(77,97,114,\'105\',97,\'68\',66);\n+----------------------------------+\n| CHAR(77,97,114,\'105\',97,\'68\',66) |\n+----------------------------------+\n| MariaDB                          |\n+----------------------------------+\n\nSELECT CHAR(77,77.3,\'77.3\');\n+----------------------+\n| CHAR(77,77.3,\'77.3\') |\n+----------------------+\n| MMM                  |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect INTEGER value: \'77.3\'\n\nURL: https://mariadb.com/kb/en/char-function/','','https://mariadb.com/kb/en/char-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (635,36,'CHAR_LENGTH','Syntax\n------\n\nCHAR_LENGTH(str)\nCHARACTER_LENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the given string argument, measured in characters. A\nmulti-byte character counts as a single character. This means that for a\nstring containing five two-byte characters, LENGTH() (or OCTET_LENGTH() in\nOracle mode) returns 10, whereas CHAR_LENGTH() returns 5. If the argument is\nNULL, it returns NULL.\n\nIf the argument is not a string value, it is converted into a string.\n\nIt is synonymous with the CHARACTER_LENGTH() function.\n\nExamples\n--------\n\nSELECT CHAR_LENGTH(\'MariaDB\');\n+------------------------+\n| CHAR_LENGTH(\'MariaDB\') |\n+------------------------+\n|                      7 |\n+------------------------+\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/char_length/','','https://mariadb.com/kb/en/char_length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (636,36,'CHR','MariaDB starting with 10.3.1\n----------------------------\nThe CHR() function was introduced in MariaDB 10.3.1 to provide Oracle\ncompatibility\n\nSyntax\n------\n\nCHR(N)\n\nDescription\n-----------\n\nCHR() interprets each argument N as an integer and returns a VARCHAR(1) string\nconsisting of the character given by the code values of the integer. The\ncharacter set and collation of the string are set according to the values of\nthe character_set_database and collation_database system variables.\n\nCHR() is similar to the CHAR() function, but only accepts a single argument.\n\nCHR() is available in all sql_modes.\n\nExamples\n--------\n\nSELECT CHR(67);\n+---------+\n| CHR(67) |\n+---------+\n| C       |\n+---------+\n\nSELECT CHR(\'67\');\n+-----------+\n| CHR(\'67\') |\n+-----------+\n| C         |\n+-----------+\n\nSELECT CHR(\'C\');\n+----------+\n| CHR(\'C\') |\n+----------+\n|          |\n+----------+\n1 row in set, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect INTEGER value: \'C\' |\n+---------+------+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/chr/','','https://mariadb.com/kb/en/chr/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (637,36,'CONCAT','Syntax\n------\n\nCONCAT(str1,str2,...)\n\nDescription\n-----------\n\nReturns the string that results from concatenating the arguments. May have one\nor more arguments. If all arguments are non-binary strings, the result is a\nnon-binary string. If the arguments include any binary strings, the result is\na binary string. A numeric argument is converted to its equivalent binary\nstring form; if you want to avoid that, you can use an explicit type cast, as\nin this example:\n\nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n\nCONCAT() returns NULL if any argument is NULL.\n\nA NULL parameter hides all information contained in other parameters from the\nresult. Sometimes this is not desirable; to avoid this, you can:\n\n* Use the CONCAT_WS() function with an empty separator, because that function\nis NULL-safe.\n* Use IFNULL() to turn NULLs into empty strings.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, CONCAT ignores NULL.\n\nExamples\n--------\n\nSELECT CONCAT(\'Ma\', \'ria\', \'DB\');\n+---------------------------+\n| CONCAT(\'Ma\', \'ria\', \'DB\') |\n+---------------------------+\n| MariaDB                   |\n+---------------------------+\n\nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| NULL                            |\n+---------------------------------+\n\nSELECT CONCAT(42.0);\n+--------------+\n| CONCAT(42.0) |\n+--------------+\n| 42.0         |\n+--------------+\n\nUsing IFNULL() to handle NULLs:\n\nSELECT CONCAT(\'The value of @v is: \', IFNULL(@v, \'\'));\n+------------------------------------------------+\n| CONCAT(\'The value of @v is: \', IFNULL(@v, \'\')) |\n+------------------------------------------------+\n| The value of @v is:                            |\n+------------------------------------------------+\n\nIn Oracle mode, from MariaDB 10.3:\n\nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| MariaDB                         |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/concat/','','https://mariadb.com/kb/en/concat/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (638,36,'CONCAT_WS','Syntax\n------\n\nCONCAT_WS(separator,str1,str2,...)\n\nDescription\n-----------\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form of\nCONCAT(). The first argument is the separator for the rest of the arguments.\nThe separator is added between the strings to be concatenated. The separator\ncan be a string, as can the rest of the arguments.\n\nIf the separator is NULL, the result is NULL; all other NULL values are\nskipped. This makes CONCAT_WS() suitable when you want to concatenate some\nvalues and avoid losing all information if one of them is NULL.\n\nExamples\n--------\n\nSELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n+-------------------------------------------------------+\n| CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\') |\n+-------------------------------------------------------+\n| First name,Second name,Last Name                      |\n+-------------------------------------------------------+\n\nSELECT CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\');\n+------------------------------------+\n| CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\') |\n+------------------------------------+\n| Floor-Room                         |\n+------------------------------------+\n\nIn some cases, remember to include a space in the separator string:\n\nSET @a = \'gnu\', @b = \'penguin\', @c = \'sea lion\';\nQuery OK, 0 rows affected (0.00 sec)\n\nSELECT CONCAT_WS(\', \', @a, @b, @c);\n+-----------------------------+\n| CONCAT_WS(\', \', @a, @b, @c) |\n+-----------------------------+\n| gnu, penguin, sea lion      |\n+-----------------------------+\n\nUsing CONCAT_WS() to handle NULLs:\n\nSET @a = \'a\', @b = NULL, @c = \'c\';\n\nSELECT CONCAT_WS(\'\', @a, @b, @c);\n+---------------------------+\n| CONCAT_WS(\'\', @a, @b, @c) |\n+---------------------------+\n| ac                        |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/concat_ws/','','https://mariadb.com/kb/en/concat_ws/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (639,36,'CONVERT','Syntax\n------\n\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nDescription\n-----------\n\nThe	CONVERT() and CAST() functions take a value of one type and produce a\nvalue of another type.\n\nThe type can be one of the following values:\n\n* BINARY\n* CHAR\n* DATE\n* DATETIME\n* DECIMAL[(M[,D])]\n* DOUBLE\n* FLOAT (from MariaDB 10.4.5)\n* INTEGER\nShort for SIGNED INTEGER\n\n* SIGNED [INTEGER]\n* UNSIGNED [INTEGER]\n* TIME\n* VARCHAR (in Oracle mode, from MariaDB 10.3)\n\nNote that in MariaDB, INT and INTEGER are the same thing.\n\nBINARY produces a string with the BINARY data type. If the optional length is\ngiven, BINARY(N) causes the cast to use no more than N bytes of the argument.\nValues shorter than the given number in bytes are padded with 0x00 bytes to\nmake them equal the length value.\n\nCHAR(N) causes the cast to use no more than the number of characters given in\nthe argument.\n\nThe main difference between the CAST() and CONVERT() is that\nCONVERT(expr,type) is ODBC syntax while CAST(expr as type) and CONVERT(...\nUSING ...) are SQL92 syntax.\n\nCONVERT() with USING is used to convert data between different character sets.\nIn MariaDB, transcoding names are the same as the corresponding character set\nnames. For example, this statement converts the string \'abc\' in the default\ncharacter set to the corresponding string in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nExamples\n--------\n\nSELECT enum_col FROM tbl_name \nORDER BY CAST(enum_col AS CHAR);\n\nConverting a BINARY to string to permit the LOWER function to work:\n\nSET @x = \'AardVark\';\n\nSET @x = BINARY \'AardVark\';\n\nSELECT LOWER(@x), LOWER(CONVERT (@x USING latin1));\n+-----------+----------------------------------+\n| LOWER(@x) | LOWER(CONVERT (@x USING latin1)) |\n+-----------+----------------------------------+\n| AardVark  | aardvark                         |\n+-----------+----------------------------------+\n\nURL: https://mariadb.com/kb/en/convert/','','https://mariadb.com/kb/en/convert/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (640,36,'ELT','Syntax\n------\n\nELT(N, str1[, str2, str3,...])\n\nDescription\n-----------\n\nTakes a numeric argument and a series of string arguments. Returns the string\nthat corresponds to the given numeric position. For instance, it returns str1\nif N is 1, str2 if N is 2, and so on. If the numeric argument is a FLOAT,\nMariaDB rounds it to the nearest INTEGER. If the numeric argument is less than\n1, greater than the total number of arguments, or not a number, ELT() returns\nNULL. It must have at least two arguments.\n\nIt is complementary to the FIELD() function.\n\nExamples\n--------\n\nSELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| ej                                 |\n+------------------------------------+\n\nSELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| foo                                |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/elt/','','https://mariadb.com/kb/en/elt/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (641,36,'EXPORT_SET','Syntax\n------\n\nEXPORT_SET(bits, on, off[, separator[, number_of_bits]])\n\nDescription\n-----------\n\nTakes a minimum of three arguments. Returns a string where each bit in the\ngiven bits argument is returned, with the string values given for on and off.\n\nBits are examined from right to left, (from low-order to high-order bits).\nStrings are added to the result from left to right, separated by a separator\nstring (defaults as \',\'). You can optionally limit the number of bits the\nEXPORT_SET() function examines using the number_of_bits option.\n\nIf any of the arguments are set as NULL, the function returns NULL.\n\nExamples\n--------\n\nSELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n+-----------------------------+\n| EXPORT_SET(5,\'Y\',\'N\',\',\',4) |\n+-----------------------------+\n| Y,N,Y,N                     |\n+-----------------------------+\n\nSELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n+------------------------------+\n| EXPORT_SET(6,\'1\',\'0\',\',\',10) |\n+------------------------------+\n| 0,1,1,0,0,0,0,0,0,0          |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/export_set/','','https://mariadb.com/kb/en/export_set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (642,36,'EXTRACTVALUE','Syntax\n------\n\nEXTRACTVALUE(xml_frag, xpath_expr)\n\nDescription\n-----------\n\nThe EXTRACTVALUE() function takes two string arguments: a fragment of XML\nmarkup and an XPath expression, (also known as a locator). It returns the text\n(That is, CDDATA), of the first text node which is a child of the element or\nelements matching the XPath expression.\n\nIn cases where a valid XPath expression does not match any text nodes in a\nvalid XML fragment, (including the implicit /text() expression), the\nEXTRACTVALUE() function returns an empty string.\n\nInvalid Arguments\n-----------------\n\nWhen either the XML fragment or the XPath expression is NULL, the\nEXTRACTVALUE() function returns NULL. When the XML fragment is invalid, it\nraises a warning Code 1525:\n\nWarning (Code 1525): Incorrect XML value: \'parse error at line 1 pos 11:\nunexpected END-OF-INPUT\'\n\nWhen the XPath value is invalid, it generates an Error 1105:\n\nERROR 1105 (HY000): XPATH syntax error: \')\'\n\nExplicit text() Expressions\n---------------------------\n\nThis function is the equivalent of performing a match using the XPath\nexpression after appending /text(). In other words:\n\nSELECT\n EXTRACTVALUE(\'<cases><case>example</case></cases>\', \'/cases/case\')\n  AS \'Base Example\',\n EXTRACTVALUE(\'<cases><case>example</case></cases>\', \'/cases/case/text()\')\n  AS \'text() Example\';\n+--------------+----------------+\n| Base Example | text() Example |\n+--------------+----------------+\n| example      | example        |\n+--------------+----------------+\n\nCount Matches\n-------------\n\nWhen EXTRACTVALUE() returns multiple matches, it returns the content of the\nfirst child text node of each matching element, in the matched order, as a\nsingle, space-delimited string.\n\nBy design, the EXTRACTVALUE() function makes no distinction between a match on\nan empty element and no match at all. If you need to determine whether no\nmatching element was found in the XML fragment or if an element was found that\ncontained no child text nodes, use the XPath count() function.\n\nFor instance, when looking for a value that exists, but contains no child text\nnodes, you would get a count of the number of matching instances:\n\nSELECT\n EXTRACTVALUE(\'<cases><case/></cases>\', \'/cases/case\')\n  AS \'Empty Example\',\n EXTRACTVALUE(\'<cases><case/></cases>\', \'count(/cases/case)\')\n  AS \'count() Example\';\n+---------------+-----------------+\n| Empty Example | count() Example |\n+---------------+-----------------+\n|               |               1 |\n+---------------+-----------------+\n\nAlternatively, when looking for a value that doesn\'t exist, count() returns 0.\n\nSELECT\n EXTRACTVALUE(\'<cases><case/></cases>\', \'/cases/person\')\n  AS \'No Match Example\',\n EXTRACTVALUE(\'<cases><case/></cases>\', \'count(/cases/person)\')\n  AS \'count() Example\';\n+------------------+-----------------+\n| No Match Example | count() Example |\n+------------------+-----------------+\n|                  |                0|\n+------------------+-----------------+\n\nMatches\n-------\n\nImportant: The EXTRACTVALUE() function only returns CDDATA. It does not return\ntags that the element might contain or the text that these child elements\ncontain.\n\nSELECT\n\nEXTRACTVALUE(\'<cases><case>Person<email>x@example.com</email></case></cases>\',\n\'/cases\')\n AS Case;\n+--------+\n| Case   |\n+--------+\n| Person |\n+--------+\n\nNote, in the above example, while the XPath expression matches to the parent\n<case> instance, it does not return the contained <email> tag or its content.\n\nExamples\n--------\n\nSELECT\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a\')            AS val1,\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a/b\')          AS val2,\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'//b\')           AS val3,\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/b\')            AS val4,\n  ExtractValue(\'<a>ccc<b>ddd</b><b>eee</b></a>\', \'//b\') AS val5;\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5    |\n+------+------+------+------+---------+\n| ccc  | ddd  | ddd  |      | ddd eee |\n+------+------+------+------+---------+\n\nURL: https://mariadb.com/kb/en/extractvalue/','','https://mariadb.com/kb/en/extractvalue/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (643,36,'FIELD','Syntax\n------\n\nFIELD(pattern, str1[,str2,...])\n\nDescription\n-----------\n\nReturns the index position of the string or number matching the given pattern.\nReturns 0 in the event that none of the arguments match the pattern. Raises an\nError 1582 if not given at least two arguments.\n\nWhen all arguments given to the FIELD() function are strings, they are treated\nas case-insensitive. When all the arguments are numbers, they are treated as\nnumbers. Otherwise, they are treated as doubles.\n\nIf the given pattern occurs more than once, the	FIELD() function only returns\nthe index of the first instance. If the given pattern is NULL, the function\nreturns 0, as a NULL pattern always fails to match.\n\nThis function is complementary to the ELT() function.\n\nExamples\n--------\n\nSELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\') \n AS \'Field Results\';\n+---------------+\n| Field Results | \n+---------------+\n|             2 |\n+---------------+\n\nSELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\')\n AS \'Field Results\';\n+---------------+\n| Field Results | \n+---------------+\n|             0 |\n+---------------+\n\nSELECT FIELD(1, 2, 3, 4, 5, 1) AS \'Field Results\';\n+---------------+\n| Field Results |\n+---------------+\n|             5 |\n+---------------+\n\nSELECT FIELD(NULL, 2, 3) AS \'Field Results\';\n+---------------+\n| Field Results |\n+---------------+\n|             0 |\n+---------------+\n\nSELECT FIELD(\'fail\') AS \'Field Results\';\nError 1582 (42000): Incorrect parameter count in call\nto native function \'field\'\n\nURL: https://mariadb.com/kb/en/field/','','https://mariadb.com/kb/en/field/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (644,36,'FIND_IN_SET','Syntax\n------\n\nFIND_IN_SET(pattern, strlist)\n\nDescription\n-----------\n\nReturns the index position where the given pattern occurs in a string list.\nThe first argument is the pattern you want to search for. The second argument\nis a string containing comma-separated variables. If the second argument is of\nthe SET data-type, the function is optimized to use bit arithmetic.\n\nIf the pattern does not occur in the string list or if the string list is an\nempty string, the function returns 0. If either argument is NULL, the function\nreturns NULL. The function does not return the correct result if the pattern\ncontains a comma (\",\") character.\n\nExamples\n--------\n\nSELECT FIND_IN_SET(\'b\',\'a,b,c,d\') AS \"Found Results\";\n+---------------+\n| Found Results |\n+---------------+\n|             2 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/find_in_set/','','https://mariadb.com/kb/en/find_in_set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (645,36,'FORMAT','Syntax\n------\n\nFORMAT(num, decimal_position[, locale])\n\nDescription\n-----------\n\nFormats the given number for display as a string, adding separators to\nappropriate position and rounding the results to the given decimal position.\nFor instance, it would format 15233.345 to 15,233.35.\n\nIf the given decimal position is 0, it rounds to return no decimal point or\nfractional part. You can optionally specify a locale value to format numbers\nto the pattern appropriate for the given region.\n\nExamples\n--------\n\nSELECT FORMAT(1234567890.09876543210, 4) AS \'Format\';\n+--------------------+\n| Format             |\n+--------------------+\n| 1,234,567,890.0988 |\n+--------------------+\n\nSELECT FORMAT(1234567.89, 4) AS \'Format\';\n+----------------+\n| Format         |\n+----------------+\n| 1,234,567.8900 |\n+----------------+\n\nSELECT FORMAT(1234567.89, 0) AS \'Format\';\n+-----------+\n| Format    |\n+-----------+\n| 1,234,568 |\n+-----------+\n\nSELECT FORMAT(123456789,2,\'rm_CH\') AS \'Format\';\n+----------------+\n| Format         |\n+----------------+\n| 123\'456\'789,00 |\n+----------------+\n\nURL: https://mariadb.com/kb/en/format/','','https://mariadb.com/kb/en/format/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (646,36,'FROM_BASE64','Syntax\n------\n\nFROM_BASE64(str)\n\nDescription\n-----------\n\nDecodes the given base-64 encode string, returning the result as a binary\nstring. Returns NULL if the given string is NULL or if it\'s invalid.\n\nIt is the reverse of the TO_BASE64 function.\n\nThere are numerous methods to base-64 encode a string. MariaDB uses the\nfollowing:\n\n* It encodes alphabet value 64 as \'+\'.\n* It encodes alphabet value 63 as \'/\'.\n* It codes output in groups of four printable characters.  Each three byte of\ndata encoded uses four characters.  If the final group is incomplete, it pads\nthe difference with the \'=\' character.\n* It divides long output, adding a new line very 76 characters.\n* In decoding, it recognizes and ignores newlines, carriage returns, tabs and\nspace whitespace characters.\n\nSELECT TO_BASE64(\'Maria\') AS \'Input\';\n+-----------+\n| Input     |\n+-----------+\n| TWFyaWE=  |\n+-----------+\n\nSELECT FROM_BASE64(\'TWFyaWE=\') AS \'Output\';\n+--------+\n| Output |\n+--------+\n| Maria  |\n+--------+\n\nURL: https://mariadb.com/kb/en/from_base64/','','https://mariadb.com/kb/en/from_base64/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (647,36,'HEX','Syntax\n------\n\nHEX(N_or_S)\n\nDescription\n-----------\n\nIf N_or_S is a number, returns a string representation of the hexadecimal\nvalue of N, where N is a longlong (BIGINT) number. This is equivalent to\nCONV(N,10,16).\n\nIf N_or_S is a string, returns a hexadecimal string representation of N_or_S\nwhere each byte of each character in N_or_S is converted to two hexadecimal\ndigits. If N_or_S is NULL, returns NULL. The inverse of this operation is\nperformed by the UNHEX() function.\n\nMariaDB starting with 10.5.0\n----------------------------\nHEX() with an INET6 argument returns a hexadecimal representation of the\nunderlying 16-byte binary string.\n\nExamples\n--------\n\nSELECT HEX(255);\n+----------+\n| HEX(255) |\n+----------+\n| FF       |\n+----------+\n\nSELECT 0x4D617269614442;\n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB          |\n+------------------+\n\nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n\nFrom MariaDB 10.5.0:\n\nSELECT HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6));\n+----------------------------------------------+\n| HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6)) |\n+----------------------------------------------+\n| 20010DB8000000000000FF0000428329             |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/hex/','','https://mariadb.com/kb/en/hex/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (648,36,'INSTR','Syntax\n------\n\nINSTR(str,substr)\n\nDescription\n-----------\n\nReturns the position of the first occurrence of substring substr in string\nstr. This is the same as the two-argument form of LOCATE(), except that the\norder of the arguments is reversed.\n\nINSTR() performs a case-insensitive search.\n\nIf any argument is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT INSTR(\'foobarbar\', \'bar\');\n+---------------------------+\n| INSTR(\'foobarbar\', \'bar\') |\n+---------------------------+\n|                         4 |\n+---------------------------+\n\nSELECT INSTR(\'My\', \'Maria\');\n+----------------------+\n| INSTR(\'My\', \'Maria\') |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/instr/','','https://mariadb.com/kb/en/instr/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (649,36,'LCASE','Syntax\n------\n\nLCASE(str)\n\nDescription\n-----------\n\nLCASE() is a synonym for LOWER().\n\nURL: https://mariadb.com/kb/en/lcase/','','https://mariadb.com/kb/en/lcase/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (650,36,'LEFT','Syntax\n------\n\nLEFT(str,len)\n\nDescription\n-----------\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nExamples\n--------\n\nSELECT LEFT(\'MariaDB\', 5);\n+--------------------+\n| LEFT(\'MariaDB\', 5) |\n+--------------------+\n| Maria              |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/left/','','https://mariadb.com/kb/en/left/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (651,36,'INSERT Function','Syntax\n------\n\nINSERT(str,pos,len,newstr)\n\nDescription\n-----------\n\nReturns the string str, with the substring beginning at position pos and len\ncharacters long replaced by the string newstr. Returns the original string if\npos is not within the length of the string. Replaces the rest of the string\nfrom position pos if len is not within the length of the rest of the string.\nReturns NULL if any argument is NULL.\n\nExamples\n--------\n\nSELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n+-----------------------------------+\n| INSERT(\'Quadratic\', 3, 4, \'What\') |\n+-----------------------------------+\n| QuWhattic                         |\n+-----------------------------------+\n\nSELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n+------------------------------------+\n| INSERT(\'Quadratic\', -1, 4, \'What\') |\n+------------------------------------+\n| Quadratic                          |\n+------------------------------------+\n\nSELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n+-------------------------------------+\n| INSERT(\'Quadratic\', 3, 100, \'What\') |\n+-------------------------------------+\n| QuWhat                              |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/insert-function/','','https://mariadb.com/kb/en/insert-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (652,36,'LENGTH','Syntax\n------\n\nLENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the string str.\n\nIn the default mode, when Oracle mode from MariaDB 10.3 is not set, the length\nis measured in bytes. In this case, a multi-byte character counts as multiple\nbytes. This means that for a string containing five two-byte characters,\nLENGTH() returns 10, whereas CHAR_LENGTH() returns 5.\n\nWhen running Oracle mode from MariaDB 10.3, the length is measured in\ncharacters, and LENGTH is a synonym for CHAR_LENGTH().\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nSELECT LENGTH(\'MariaDB\');\n+-------------------+\n| LENGTH(\'MariaDB\') |\n+-------------------+\n|                 7 |\n+-------------------+\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/length/','','https://mariadb.com/kb/en/length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (653,36,'LENGTHB','MariaDB starting with 10.3.1\n----------------------------\nIntroduced in MariaDB 10.3.1 as part of the Oracle compatibility enhancements.\n\nSyntax\n------\n\nLENGTHB(str)\n\nDescription\n-----------\n\nLENGTHB() returns the length of the given string, in bytes. When Oracle mode\nis not set, this is a synonym for LENGTH.\n\nA multi-byte character counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, LENGTHB() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/lengthb/','','https://mariadb.com/kb/en/lengthb/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (654,36,'LIKE','Syntax\n------\n\nexpr LIKE pat [ESCAPE \'escape_char\']\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nDescription\n-----------\n\nTests whether expr matches the pattern pat. Returns either 1 (TRUE) or 0\n(FALSE). Both expr and pat may be any valid expression and are evaluated to\nstrings. Patterns may use the following wildcard characters:\n\n* % matches any number of characters, including zero.\n* _ matches any single character.\n\nUse NOT LIKE to test if a string does not match a pattern. This is equivalent\nto using the NOT operator on the entire LIKE expression.\n\nIf either the expression or the pattern is NULL, the result is NULL.\n\nLIKE performs case-insensitive substring matches if the collation for the\nexpression and pattern is case-insensitive. For case-sensitive matches,\ndeclare either argument to use a binary collation using COLLATE, or coerce\neither of them to a BINARY string using CAST. Use SHOW COLLATION to get a list\nof available collations. Collations ending in _bin are case-sensitive.\n\nNumeric arguments are coerced to binary strings.\n\nThe _ wildcard matches a single character, not byte. It will only match a\nmulti-byte character if it is valid in the expression\'s character set. For\nexample, _ will match _utf8\"€\", but it will not match _latin1\"€\" because the\nEuro sign is not a valid latin1 character. If necessary, use CONVERT to use\nthe expression in a different character set.\n\nIf you need to match the characters _ or %, you must escape them. By default,\nyou can prefix the wildcard characters the backslash character \\ to escape\nthem. The backslash is used both to encode special characters like newlines\nwhen a string is parsed as well as to escape wildcards in a pattern after\nparsing. Thus, to match an actual backslash, you sometimes need to\ndouble-escape it as \"\\\\\\\\\".\n\nTo avoid difficulties with the backslash character, you can change the\nwildcard escape character using ESCAPE in a LIKE expression. The argument to\nESCAPE must be a single-character string.\n\nExamples\n--------\n\nSelect the days that begin with \"T\":\n\nCREATE TABLE t1 (d VARCHAR(16));\nINSERT INTO t1 VALUES \n (\"Monday\"), (\"Tuesday\"), (\"Wednesday\"),\n (\"Thursday\"), (\"Friday\"), (\"Saturday\"), (\"Sunday\");\nSELECT * FROM t1 WHERE d LIKE \"T%\";\n\nSELECT * FROM t1 WHERE d LIKE \"T%\";\n+----------+\n| d        |\n+----------+\n| Tuesday  |\n| Thursday |\n+----------+\n\nSelect the days that contain the substring \"es\":\n\nSELECT * FROM t1 WHERE d LIKE \"%es%\";\n\nSELECT * FROM t1 WHERE d LIKE \"%es%\";\n+-----------+\n| d         |\n+-----------+\n| Tuesday   |\n| Wednesday |\n+-----------+\n\nSelect the six-character day names:\n\nSELECT * FROM t1 WHERE d like \"___day\";\n\nSELECT * FROM t1 WHERE d like \"___day\";\n+---------+\n| d       |\n+---------+\n| Monday  |\n| Friday  |\n| Sunday  |\n+---------+\n\nWith the default collations, LIKE is case-insensitive:\n\nSELECT * FROM t1 where d like \"t%\";\n\nSELECT * FROM t1 where d like \"t%\";\n+----------+\n| d        |\n+----------+\n| Tuesday  |\n| Thursday |\n+----------+\n\nUse COLLATE to specify a binary collation, forcing case-sensitive matches:\n\nSELECT * FROM t1 WHERE d like \"t%\" COLLATE latin1_bin;\n\nSELECT * FROM t1 WHERE d like \"t%\" COLLATE latin1_bin;\nEmpty set (0.00 sec)\n\nYou can include functions and operators in the expression to match. Select\ndates based on their day name:\n\nCREATE TABLE t2 (d DATETIME);\nINSERT INTO t2 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE \"T%\";\n\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE \"T%\";\n+------------------+\n| d                |\n+------------------+\n| 2007-01-30 21:31 |\n| 2011-04-21 12:34 |\n| 2004-10-07 11:19 |\n+------------------+\n3 rows in set, 7 warnings (0.00 sec)\n\nOptimizing LIKE\n---------------\n\n* MariaDB can use indexes for LIKE on string columns in the case where the\nLIKE doesn\'t start with % or _.\n* Starting from MariaDB 10.0, one can set  the\noptimizer_use_condition_selectivity variable to 5. If this is done, then the\noptimizer will read optimizer_selectivity_sampling_limit rows to calculate the\nselectivity of the LIKE expression before starting to calculate the query\nplan. This can help speed up some LIKE queries by providing the optimizer with\nmore information about your data.\n\nURL: https://mariadb.com/kb/en/like/','','https://mariadb.com/kb/en/like/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (655,36,'LOCATE','Syntax\n------\n\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nDescription\n-----------\n\nThe first syntax returns the position of the first occurrence of substring\nsubstr in string str. The second syntax returns the position of the first\noccurrence of substring substr in string str, starting at position pos.\nReturns 0 if substr is not in str.\n\nLOCATE() performs a case-insensitive search.\n\nIf any argument is NULL, returns NULL.\n\nINSTR() is the same as the two-argument form of LOCATE(), except that the\norder of the arguments is reversed.\n\nExamples\n--------\n\nSELECT LOCATE(\'bar\', \'foobarbar\');\n+----------------------------+\n| LOCATE(\'bar\', \'foobarbar\') |\n+----------------------------+\n|                          4 |\n+----------------------------+\n\nSELECT LOCATE(\'My\', \'Maria\');\n+-----------------------+\n| LOCATE(\'My\', \'Maria\') |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nSELECT LOCATE(\'bar\', \'foobarbar\', 5);\n+-------------------------------+\n| LOCATE(\'bar\', \'foobarbar\', 5) |\n+-------------------------------+\n|                             7 |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/locate/','','https://mariadb.com/kb/en/locate/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (656,36,'LOWER','Syntax\n------\n\nLOWER(str)\n\nDescription\n-----------\n\nReturns the string str with all characters changed to lowercase according to\nthe current character set mapping. The default is latin1 (cp1252 West\nEuropean).\n\nExamples\n--------\n\nSELECT LOWER(\'QUADRATICALLY\');\n+------------------------+\n| LOWER(\'QUADRATICALLY\') |\n+------------------------+\n| quadratically          |\n+------------------------+\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings (BINARY,\nVARBINARY, BLOB). To perform lettercase conversion, CONVERT the string to a\nnon-binary string:\n\nSET @str = BINARY \'North Carolina\';\n\nSELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+----------------+-----------------------------------+\n| LOWER(@str)    | LOWER(CONVERT(@str USING latin1)) |\n+----------------+-----------------------------------+\n| North Carolina | north carolina                    |\n+----------------+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/lower/','','https://mariadb.com/kb/en/lower/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (657,36,'LPAD','Syntax\n------\n\nLPAD(str, len [,padstr])\n\nDescription\n-----------\n\nReturns the string str, left-padded with the string padstr to a length of len\ncharacters. If str is longer than len, the return value is shortened to len\ncharacters. If padstr is omitted, the LPAD function pads spaces.\n\nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n\nReturns NULL if given a NULL argument. If the result is empty (zero length),\nreturns either an empty string or, from MariaDB 10.3.6 with SQL_MODE=Oracle,\nNULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using LPAD_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT LPAD(\'hello\',10,\'.\');\n+----------------------+\n| LPAD(\'hello\',10,\'.\') |\n+----------------------+\n| .....hello           |\n+----------------------+\n\nSELECT LPAD(\'hello\',2,\'.\');\n+---------------------+\n| LPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he                  |\n+---------------------+\n\nFrom MariaDB 10.3.1, with the pad string defaulting to space.\n\nSELECT LPAD(\'hello\',10);\n+------------------+\n| LPAD(\'hello\',10) |\n+------------------+\n|      hello       |\n+------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT LPAD(\'\',0),LPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| LPAD(\'\',0) | LPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n|            | NULL              |\n+------------+-------------------+\n\nURL: https://mariadb.com/kb/en/lpad/','','https://mariadb.com/kb/en/lpad/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (658,36,'LTRIM','Syntax\n------\n\nLTRIM(str)\n\nDescription\n-----------\n\nReturns the string str with leading space characters removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using LTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT QUOTE(LTRIM(\'   MariaDB   \'));\n+-------------------------------+\n| QUOTE(LTRIM(\'   MariaDB   \')) |\n+-------------------------------+\n| \'MariaDB   \'                  |\n+-------------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT LTRIM(\'\'),LTRIM_ORACLE(\'\');\n+-----------+------------------+\n| LTRIM(\'\') | LTRIM_ORACLE(\'\') |\n+-----------+------------------+\n|           | NULL             |\n+-----------+------------------+\n\nURL: https://mariadb.com/kb/en/ltrim/','','https://mariadb.com/kb/en/ltrim/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (659,36,'MAKE_SET','Syntax\n------\n\nMAKE_SET(bits,str1,str2,...)\n\nDescription\n-----------\n\nReturns a set value (a string containing substrings separated by \",\"\ncharacters) consisting of the strings that have the corresponding bit in bits\nset. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL values in str1,\nstr2, ... are not appended to the result.\n\nExamples\n--------\n\nSELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n+-------------------------+\n| MAKE_SET(1,\'a\',\'b\',\'c\') |\n+-------------------------+\n| a                       |\n+-------------------------+\n\nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n+----------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\') |\n+----------------------------------------+\n| hello,world                            |\n+----------------------------------------+\n\nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n+---------------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\') |\n+---------------------------------------------+\n| hello                                       |\n+---------------------------------------------+\n\nSELECT QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\'));\n+--------------------------------+\n| QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\')) |\n+--------------------------------+\n| \'\'                             |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/make_set/','','https://mariadb.com/kb/en/make_set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (660,36,'MATCH AGAINST','Syntax\n------\n\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nDescription\n-----------\n\nA special construct used to perform a fulltext search on a fulltext index.\n\nSee Fulltext Index Overview for a full description, and Full-text Indexes for\nmore articles on the topic.\n\nExamples\n--------\n\nCREATE TABLE ft_myisam(copy TEXT,FULLTEXT(copy)) ENGINE=MyISAM;\n\nINSERT INTO ft_myisam(copy) VALUES (\'Once upon a time\'), (\'There was a wicked\nwitch\'), \n (\'Who ate everybody up\');\n\nSELECT * FROM ft_myisam WHERE MATCH(copy) AGAINST(\'wicked\');\n+--------------------------+\n| copy                     |\n+--------------------------+\n| There was a wicked witch |\n+--------------------------+\n\nSELECT id, body, MATCH (title,body) AGAINST\n  (\'Security implications of running MySQL as root\'\n  IN NATURAL LANGUAGE MODE) AS score\n  FROM articles WHERE MATCH (title,body) AGAINST\n  (\'Security implications of running MySQL as root\'\n  IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body                                | score           |\n+----+-------------------------------------+-----------------+\n|  4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n|  6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n\nURL: https://mariadb.com/kb/en/match-against/','','https://mariadb.com/kb/en/match-against/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (661,36,'MID','Syntax\n------\n\nMID(str,pos,len)\n\nDescription\n-----------\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nExamples\n--------\n\nSELECT MID(\'abcd\',4,1);\n+-----------------+\n| MID(\'abcd\',4,1) |\n+-----------------+\n| d               |\n+-----------------+\n\nSELECT MID(\'abcd\',2,2);\n+-----------------+\n| MID(\'abcd\',2,2) |\n+-----------------+\n| bc              |\n+-----------------+\n\nA negative starting position:\n\nSELECT MID(\'abcd\',-2,4);\n+------------------+\n| MID(\'abcd\',-2,4) |\n+------------------+\n| cd               |\n+------------------+\n\nURL: https://mariadb.com/kb/en/mid/','','https://mariadb.com/kb/en/mid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (662,36,'NOT LIKE','Syntax\n------\n\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nDescription\n-----------\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: https://mariadb.com/kb/en/not-like/','','https://mariadb.com/kb/en/not-like/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (663,36,'OCTET_LENGTH','Syntax\n------\n\nOCTET_LENGTH(str)\n\nDescription\n-----------\n\nOCTET_LENGTH() returns the length of the given string, in octets (bytes). This\nis a synonym for LENGTHB(), and, when Oracle mode from MariaDB 10.3 is not\nset, a synonym for LENGTH().\n\nA multi-byte character counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, OCTET_LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/octet_length/','','https://mariadb.com/kb/en/octet_length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (664,36,'ORD','Syntax\n------\n\nORD(str)\n\nDescription\n-----------\n\nIf the leftmost character of the string str is a multi-byte character, returns\nthe code for that character, calculated from the numeric values of its\nconstituent bytes using this formula:\n\n(1st byte code)\n+ (2nd byte code x 256)\n+ (3rd byte code x 256 x 256) ...\n\nIf the leftmost character is not a multi-byte character, ORD() returns the\nsame value as the ASCII() function.\n\nExamples\n--------\n\nSELECT ORD(\'2\');\n+----------+\n| ORD(\'2\') |\n+----------+\n|       50 |\n+----------+\n\nURL: https://mariadb.com/kb/en/ord/','','https://mariadb.com/kb/en/ord/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (665,36,'POSITION','Syntax\n------\n\nPOSITION(substr IN str)\n\nDescription\n-----------\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nIt\'s part of ODBC 3.0.\n\nURL: https://mariadb.com/kb/en/position/','','https://mariadb.com/kb/en/position/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (666,36,'QUOTE','Syntax\n------\n\nQUOTE(str)\n\nDescription\n-----------\n\nQuotes a string to produce a result that can be used as a properly escaped\ndata value in an SQL statement. The string is returned enclosed by single\nquotes and with each instance of single quote (\"\'\"), backslash (\"\\\"), ASCII\nNUL, and Control-Z preceded by a backslash. If the argument is NULL, the\nreturn value is the word \"NULL\" without enclosing single quotes.\n\nExamples\n--------\n\nSELECT QUOTE(\"Don\'t!\");\n+-----------------+\n| QUOTE(\"Don\'t!\") |\n+-----------------+\n| \'Don\\\'t!\'       |\n+-----------------+\n\nSELECT QUOTE(NULL); \n+-------------+\n| QUOTE(NULL) |\n+-------------+\n| NULL        |\n+-------------+\n\nURL: https://mariadb.com/kb/en/quote/','','https://mariadb.com/kb/en/quote/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (667,36,'REPEAT Function','Syntax\n------\n\nREPEAT(str,count)\n\nDescription\n-----------\n\nReturns a string consisting of the string str repeated count times. If count\nis less than 1, returns an empty string. Returns NULL if str or count are NULL.\n\nExamples\n--------\n\nSELECT QUOTE(REPEAT(\'MariaDB \',4));\n+------------------------------------+\n| QUOTE(REPEAT(\'MariaDB \',4))        |\n+------------------------------------+\n| \'MariaDB MariaDB MariaDB MariaDB \' |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/repeat-function/','','https://mariadb.com/kb/en/repeat-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (668,36,'REPLACE Function','Syntax\n------\n\nREPLACE(str,from_str,to_str)\n\nDescription\n-----------\n\nReturns the string str with all occurrences of the string from_str replaced by\nthe string to_str. REPLACE() performs a case-sensitive match when searching\nfor from_str.\n\nExamples\n--------\n\nSELECT REPLACE(\'www.mariadb.org\', \'w\', \'Ww\');\n+---------------------------------------+\n| REPLACE(\'www.mariadb.org\', \'w\', \'Ww\') |\n+---------------------------------------+\n| WwWwWw.mariadb.org                    |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/replace-function/','','https://mariadb.com/kb/en/replace-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (669,36,'REVERSE','Syntax\n------\n\nREVERSE(str)\n\nDescription\n-----------\n\nReturns the string str with the order of the characters reversed.\n\nExamples\n--------\n\nSELECT REVERSE(\'desserts\');\n+---------------------+\n| REVERSE(\'desserts\') |\n+---------------------+\n| stressed            |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/reverse/','','https://mariadb.com/kb/en/reverse/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (670,36,'RIGHT','Syntax\n------\n\nRIGHT(str,len)\n\nDescription\n-----------\n\nReturns the rightmost len characters from the string str, or NULL if any\nargument is NULL.\n\nExamples\n--------\n\nSELECT RIGHT(\'MariaDB\', 2);\n+---------------------+\n| RIGHT(\'MariaDB\', 2) |\n+---------------------+\n| DB                  |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/right/','','https://mariadb.com/kb/en/right/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (671,36,'RPAD','Syntax\n------\n\nRPAD(str, len [, padstr])\n\nDescription\n-----------\n\nReturns the string str, right-padded with the string padstr to a length of len\ncharacters. If str is longer than len, the return value is shortened to len\ncharacters. If padstr is omitted, the RPAD function pads spaces.\n\nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n\nReturns NULL if given a NULL argument. If the result is empty (a length of\nzero), returns either an empty string, or, from MariaDB 10.3.6 with\nSQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using RPAD_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT RPAD(\'hello\',10,\'.\');\n+----------------------+\n| RPAD(\'hello\',10,\'.\') |\n+----------------------+\n| hello.....           |\n+----------------------+\n\nSELECT RPAD(\'hello\',2,\'.\');\n+---------------------+\n| RPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he                  |\n+---------------------+\n\nFrom MariaDB 10.3.1, with the pad string defaulting to space.\n\nSELECT RPAD(\'hello\',30);\n+--------------------------------+\n| RPAD(\'hello\',30)               |\n+--------------------------------+\n| hello                          |\n+--------------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT RPAD(\'\',0),RPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| RPAD(\'\',0) | RPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n|            | NULL              |\n+------------+-------------------+\n\nURL: https://mariadb.com/kb/en/rpad/','','https://mariadb.com/kb/en/rpad/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (672,36,'RTRIM','Syntax\n------\n\nRTRIM(str)\n\nDescription\n-----------\n\nReturns the string str with trailing space characters removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using RTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT QUOTE(RTRIM(\'MariaDB    \'));\n+-----------------------------+\n| QUOTE(RTRIM(\'MariaDB    \')) |\n+-----------------------------+\n| \'MariaDB\'                   |\n+-----------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT RTRIM(\'\'),RTRIM_ORACLE(\'\');\n+-----------+------------------+\n| RTRIM(\'\') | RTRIM_ORACLE(\'\') |\n+-----------+------------------+\n|           | NULL             |\n+-----------+------------------+\n\nURL: https://mariadb.com/kb/en/rtrim/','','https://mariadb.com/kb/en/rtrim/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (673,36,'SOUNDEX','Syntax\n------\n\nSOUNDEX(str)\n\nDescription\n-----------\n\nReturns a soundex string from str. Two strings that sound almost the same\nshould have identical soundex strings. A standard soundex string is four\ncharacters long, but the SOUNDEX() function returns an arbitrarily long\nstring. You can use SUBSTRING() on the result to get a standard soundex\nstring. All non-alphabetic characters in str are ignored. All international\nalphabetic characters outside the A-Z range are treated as vowels.\n\nImportant: When using SOUNDEX(), you should be aware of the following details:\n\n* This function, as currently implemented, is intended to work well with\n strings that are in the English language only. Strings in other languages may\n not produce reasonable results.\n\n* This function implements the original Soundex algorithm, not the more\npopular enhanced version (also described by D. Knuth). The difference is that\noriginal version discards vowels first and duplicates second, whereas the\nenhanced version discards duplicates first and vowels second.\n\nExamples\n--------\n\nSOUNDEX(\'Hello\');\n+------------------+\n| SOUNDEX(\'Hello\') |\n+------------------+\n| H400             |\n+------------------+\n\nSELECT SOUNDEX(\'MariaDB\');\n+--------------------+\n| SOUNDEX(\'MariaDB\') |\n+--------------------+\n| M631               |\n+--------------------+\n\nSELECT SOUNDEX(\'Knowledgebase\');\n+--------------------------+\n| SOUNDEX(\'Knowledgebase\') |\n+--------------------------+\n| K543212                  |\n+--------------------------+\n\nSELECT givenname, surname FROM users WHERE SOUNDEX(givenname) =\nSOUNDEX(\"robert\");\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto   | Castro  |\n+-----------+---------+\n\nURL: https://mariadb.com/kb/en/soundex/','','https://mariadb.com/kb/en/soundex/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (674,36,'SOUNDS LIKE','Syntax\n------\n\nexpr1 SOUNDS LIKE expr2\n\nDescription\n-----------\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nExample\n-------\n\nSELECT givenname, surname FROM users WHERE givenname SOUNDS LIKE \"robert\";\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto   | Castro  |\n+-----------+---------+\n\nURL: https://mariadb.com/kb/en/sounds-like/','','https://mariadb.com/kb/en/sounds-like/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (675,36,'SPACE','Syntax\n------\n\nSPACE(N)\n\nDescription\n-----------\n\nReturns a string consisting of N space characters. If N is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT QUOTE(SPACE(6));\n+-----------------+\n| QUOTE(SPACE(6)) |\n+-----------------+\n| \'      \'        |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/space/','','https://mariadb.com/kb/en/space/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (676,36,'STRCMP','Syntax\n------\n\nSTRCMP(expr1,expr2)\n\nDescription\n-----------\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first argument is\nsmaller than the second according to the current sort order, and 1 if the\nstrings are otherwise not the same. Returns NULL is either argument is NULL.\n\nExamples\n--------\n\nSELECT STRCMP(\'text\', \'text2\');\n+-------------------------+\n| STRCMP(\'text\', \'text2\') |\n+-------------------------+\n|                      -1 |\n+-------------------------+\n\nSELECT STRCMP(\'text2\', \'text\');\n+-------------------------+\n| STRCMP(\'text2\', \'text\') |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSELECT STRCMP(\'text\', \'text\');\n+------------------------+\n| STRCMP(\'text\', \'text\') |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/strcmp/','','https://mariadb.com/kb/en/strcmp/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (677,36,'SUBSTR','Description\n-----------\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: https://mariadb.com/kb/en/substr/','','https://mariadb.com/kb/en/substr/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (678,36,'SUBSTRING','Syntax\n------\n\nSUBSTRING(str,pos), \nSUBSTRING(str FROM pos), \nSUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nSUBSTR(str,pos), \nSUBSTR(str FROM pos), \nSUBSTR(str,pos,len),\nSUBSTR(str FROM pos FOR len)\n\nDescription\n-----------\n\nThe forms without a len argument return a substring from string str starting\nat position pos.\n\nThe forms with a len argument return a substring len characters long from\nstring str, starting at position pos.\n\nThe forms that use FROM are standard SQL syntax.\n\nIt is also possible to use a negative value for pos. In this case, the\nbeginning of the substring is pos characters from the end of the string,\nrather than the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nBy default, the position of the first character in the string from which the\nsubstring is to be extracted is reckoned as 1. For Oracle-compatibility, from\nMariaDB 10.3.3, when sql_mode is set to \'oracle\', position zero is treated as\nposition 1 (although the first character is still reckoned as 1).\n\nIf any argument is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT SUBSTRING(\'Knowledgebase\',5);\n+------------------------------+\n| SUBSTRING(\'Knowledgebase\',5) |\n+------------------------------+\n| ledgebase                    |\n+------------------------------+\n\nSELECT SUBSTRING(\'MariaDB\' FROM 6);\n+-----------------------------+\n| SUBSTRING(\'MariaDB\' FROM 6) |\n+-----------------------------+\n| DB                          |\n+-----------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\',3,7);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\',3,7) |\n+--------------------------------+\n| owledge                        |\n+--------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\', -4);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\', -4) |\n+--------------------------------+\n| base                           |\n+--------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\', -8, 4);\n+-----------------------------------+\n| SUBSTRING(\'Knowledgebase\', -8, 4) |\n+-----------------------------------+\n| edge                              |\n+-----------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4);\n+------------------------------------------+\n| SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4) |\n+------------------------------------------+\n| edge                                     |\n+------------------------------------------+\n\nOracle mode from MariaDB 10.3.3:\n\nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n|                   |\n+-------------------+\n\nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab                |\n+-------------------+\n\nSET sql_mode=\'oracle\';\n\nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n| abc               |\n+-------------------+\n\nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab                |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/substring/','','https://mariadb.com/kb/en/substring/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (679,36,'SUBSTRING_INDEX','Syntax\n------\n\nSUBSTRING_INDEX(str,delim,count)\n\nDescription\n-----------\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the final\ndelimiter (counting from the left) is returned. If count is negative,\neverything to the right of the final delimiter (counting from the right) is\nreturned. SUBSTRING_INDEX() performs a case-sensitive match when searching for\ndelim.\n\nIf any argument is NULL, returns NULL.\n\nFor example\n\nSUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2)\n\nmeans \"Return all of the characters up to the 2nd occurrence of .\"\n\nExamples\n--------\n\nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2);\n+--------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2) |\n+--------------------------------------------+\n| www.mariadb                                |\n+--------------------------------------------+\n\nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2);\n+---------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2) |\n+---------------------------------------------+\n| mariadb.org                                 |\n+---------------------------------------------+\n\nURL: https://mariadb.com/kb/en/substring_index/','','https://mariadb.com/kb/en/substring_index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (680,36,'TO_BASE64','Syntax\n------\n\nTO_BASE64(str)\n\nDescription\n-----------\n\nConverts the string argument str to its base-64 encoded form, returning the\nresult as a character string in the connection character set and collation.\n\nThe argument str will be converted to string first if it is not a string. A\nNULL argument will return a NULL result.\n\nThe reverse function, FROM_BASE64(), decodes an encoded base-64 string.\n\nThere are a numerous different methods to base-64 encode a string. The\nfollowing are used by MariaDB and MySQL:\n\n* Alphabet value 64 is encoded as \'+\'.\n* Alphabet value 63 is encoded as \'/\'.\n* Encoding output is made up of groups of four printable characters, with each\nthree bytes of data encoded using four characters. If the final group is not\ncomplete, it is padded with \'=\' characters to make up a length of four.\n* To divide long output, a newline is added after every 76 characters.\n* Decoding will recognize and ignore newlines, carriage returns, tabs, and\nspaces.\n\nExamples\n--------\n\nSELECT TO_BASE64(\'Maria\');\n+--------------------+\n| TO_BASE64(\'Maria\') |\n+--------------------+\n| TWFyaWE=           |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/to_base64/','','https://mariadb.com/kb/en/to_base64/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (681,36,'TO_CHAR','MariaDB starting with 10.6.1\n----------------------------\nThe TO_CHAR function was introduced in MariaDB 10.6.1 to enhance Oracle\ncompatibility.\n\nSyntax\n------\n\nTO_CHAR(expr[, fmt])\n\nDescription\n-----------\n\nThe TO_CHAR function converts an expr of type date, datetime, time or\ntimestamp to a string. The optional fmt argument supports\nYYYY/YYY/YY/RRRR/RR/MM/MON/MONTH/MI/DD/DY/HH/HH12/HH24/SS and special\ncharacters. The default value is \"YYYY-MM-DD HH24:MI:SS\".\n\nIn Oracle, TO_CHAR can also be used to convert numbers to strings, but this is\nnot supported in MariaDB and will give an error.\n\nExamples\n--------\n\nSELECT TO_CHAR(\'1980-01-11 04:50:39\', \'YYYY-MM-DD\');\n+----------------------------------------------+\n| TO_CHAR(\'1980-01-11 04:50:39\', \'YYYY-MM-DD\') |\n+----------------------------------------------+\n| 1980-01-11                                   |\n+----------------------------------------------+\n\nSELECT TO_CHAR(\'1980-01-11 04:50:39\', \'HH24-MI-SS\');\n+----------------------------------------------+\n| TO_CHAR(\'1980-01-11 04:50:39\', \'HH24-MI-SS\') |\n+----------------------------------------------+\n| 04-50-39                                     |\n+----------------------------------------------+\n\nSELECT TO_CHAR(\'00-01-01 00:00:00\', \'YY-MM-DD HH24:MI:SS\');\n+-----------------------------------------------------+\n| TO_CHAR(\'00-01-01 00:00:00\', \'YY-MM-DD HH24:MI:SS\') |\n+-----------------------------------------------------+\n| 00-01-01 00:00:00                                   |\n+-----------------------------------------------------+\n\nSELECT TO_CHAR(\'99-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\');\n+-----------------------------------------------------+\n| TO_CHAR(\'99-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\') |\n+-----------------------------------------------------+\n| 99-12-31 23:59:59                                   |\n+-----------------------------------------------------+\n\nSELECT TO_CHAR(\'9999-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\');\n+-------------------------------------------------------+\n| TO_CHAR(\'9999-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\') |\n+-------------------------------------------------------+\n| 99-12-31 23:59:59                                     |\n+-------------------------------------------------------+\n\nSELECT TO_CHAR(\'21-01-03 08:30:00\', \'Y-MONTH-DY HH:MI:SS\');\n+-----------------------------------------------------+\n| TO_CHAR(\'21-01-03 08:30:00\', \'Y-MONTH-DY HH:MI:SS\') |\n+-----------------------------------------------------+\n| 1-January  -Sun 08:30:00                            |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/to_char/','','https://mariadb.com/kb/en/to_char/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (682,36,'TRIM','Syntax\n------\n\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)\n\nFrom MariaDB 10.3.6\n\nTRIM_ORACLE([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nDescription\n-----------\n\nReturns the string str with all remstr prefixes or suffixes removed. If none\nof the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr\nis optional and, if not specified, spaces are removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\nSQL_MODE=Oracle is not set by default.\n\nThe Oracle mode version of the function can be accessed in any mode by using\nTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT TRIM(\'  bar   \')\\G\n*************************** 1. row ***************************\nTRIM(\'  bar   \'): bar\n\nSELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\')\\G\n*************************** 1. row ***************************\nTRIM(LEADING \'x\' FROM \'xxxbarxxx\'): barxxx\n\nSELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\')\\G\n*************************** 1. row ***************************\nTRIM(BOTH \'x\' FROM \'xxxbarxxx\'): bar\n\nSELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\')\\G\n*************************** 1. row ***************************\nTRIM(TRAILING \'xyz\' FROM \'barxxyz\'): barx\n\nFrom MariaDB 10.3.6, with SQL_MODE=Oracle not set:\n\nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n|          | NULL            |\n+----------+-----------------+\n\nFrom MariaDB 10.3.6, with SQL_MODE=Oracle set:\n\nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n| NULL     | NULL            |\n+----------+-----------------+\n\nURL: https://mariadb.com/kb/en/trim/','','https://mariadb.com/kb/en/trim/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (683,36,'UCASE','Syntax\n------\n\nUCASE(str)\n\nDescription\n-----------\n\nUCASE() is a synonym for UPPER().\n\nURL: https://mariadb.com/kb/en/ucase/','','https://mariadb.com/kb/en/ucase/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (684,36,'UNCOMPRESSED_LENGTH','Syntax\n------\n\nUNCOMPRESSED_LENGTH(compressed_string)\n\nDescription\n-----------\n\nReturns the length that the compressed string had before being compressed with\nCOMPRESS().\n\nUNCOMPRESSED_LENGTH() returns NULL or an incorrect result if the string is not\ncompressed.\n\nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or bigint(10), in all\ncases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG, or int(10), when the\nresult would fit within 32-bits.\n\nExamples\n--------\n\nSELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n+-----------------------------------------------+\n| UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30))) |\n+-----------------------------------------------+\n|                                            30 |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/uncompressed_length/','','https://mariadb.com/kb/en/uncompressed_length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (685,36,'UNHEX','Syntax\n------\n\nUNHEX(str)\n\nDescription\n-----------\n\nPerforms the inverse operation of HEX(str). That is, it interprets each pair\nof hexadecimal digits in the argument as a number and converts it to the\ncharacter represented by the number. The resulting characters are returned as\na binary string.\n\nIf str is NULL, UNHEX() returns NULL.\n\nExamples\n--------\n\nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n\nSELECT UNHEX(\'4D617269614442\');\n+-------------------------+\n| UNHEX(\'4D617269614442\') |\n+-------------------------+\n| MariaDB                 |\n+-------------------------+\n\nSELECT 0x4D617269614442;\n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB          |\n+------------------+\n\nSELECT UNHEX(HEX(\'string\'));\n+----------------------+\n| UNHEX(HEX(\'string\')) |\n+----------------------+\n| string               |\n+----------------------+\n\nSELECT HEX(UNHEX(\'1267\'));\n+--------------------+\n| HEX(UNHEX(\'1267\')) |\n+--------------------+\n| 1267               |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/unhex/','','https://mariadb.com/kb/en/unhex/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (686,36,'UPDATEXML','Syntax\n------\n\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nDescription\n-----------\n\nThis function replaces a single portion of a given fragment of XML markup\nxml_target with a new XML fragment new_xml, and then returns the changed XML.\nThe portion of xml_target that is replaced matches an XPath expression\nxpath_expr supplied by the user. If no expression matching xpath_expr is\nfound, or if multiple matches are found, the function returns the original\nxml_target XML fragment. All three arguments should be strings.\n\nExamples\n--------\n\nSELECT\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a\', \'<e>fff</e>\') AS val1,\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/b\', \'<e>fff</e>\') AS val2,\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'//b\', \'<e>fff</e>\') AS val3,\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val4,\n  UpdateXML(\'<a><d></d><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val5\n  \\G\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\nval5: <a><d></d><b>ccc</b><d></d></a>\n1 row in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/updatexml/','','https://mariadb.com/kb/en/updatexml/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (687,36,'UPPER','Syntax\n------\n\nUPPER(str)\n\nDescription\n-----------\n\nReturns the string str with all characters changed to uppercase according to\nthe current character set mapping. The default is latin1 (cp1252 West\nEuropean).\n\nSELECT UPPER(surname), givenname FROM users ORDER BY surname;\n+----------------+------------+\n| UPPER(surname) | givenname  |\n+----------------+------------+\n| ABEL           | Jacinto    |\n| CASTRO         | Robert     |\n| COSTA          | Phestos    |\n| MOSCHELLA      | Hippolytos |\n+----------------+------------+\n\nUPPER() is ineffective when applied to binary strings (BINARY, VARBINARY,\nBLOB). The description of LOWER() shows how to perform lettercase conversion\nof binary strings.\n\nURL: https://mariadb.com/kb/en/upper/','','https://mariadb.com/kb/en/upper/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (688,36,'WEIGHT_STRING','Syntax\n------\n\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n levels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nDescription\n-----------\n\nReturns a binary string representing the string\'s sorting and comparison\nvalue. A string with a lower result means that for sorting purposes the string\nappears before a string with a higher result.\n\nWEIGHT_STRING() is particularly useful when adding new collations, for testing\npurposes.\n\nIf str is a non-binary string (CHAR, VARCHAR or TEXT), WEIGHT_STRING returns\nthe string\'s collation weight. If str is a binary string (BINARY, VARBINARY or\nBLOB), the return value is simply the input value, since the weight for each\nbyte in a binary string is the byte value.\n\nWEIGHT_STRING() returns NULL if given a NULL input.\n\nThe optional AS clause permits casting the input string to a binary or\nnon-binary string, as well as to a particular length.\n\nAS BINARY(N) measures the length in bytes rather than characters, and right\npads with 0x00 bytes to the desired length.\n\nAS CHAR(N) measures the length in characters, and right pads with spaces to\nthe desired length.\n\nN has a minimum value of 1, and if it is less than the length of the input\nstring, the string is truncated without warning.\n\nThe optional LEVEL clause specifies that the return value should contain\nweights for specific collation levels. The levels specifier can either be a\nsingle integer, a comma-separated list of integers, or a range of integers\nseparated by a dash (whitespace is ignored). Integers can range from 1 to a\nmaximum of 6, dependent on the collation, and need to be listed in ascending\norder.\n\nIf the LEVEL clause is no provided, a default of 1 to the maximum for the\ncollation is assumed.\n\nIf the LEVEL is specified without using a range, an optional modifier is\npermitted.\n\nASC, the default, returns the weights without any modification.\n\nDESC returns bitwise-inverted weights.\n\nREVERSE returns the weights in reverse order.\n\nExamples\n--------\n\nThe examples below use the HEX() function to represent non-printable results\nin hexadecimal format.\n\nSELECT HEX(WEIGHT_STRING(\'x\'));\n+-------------------------+\n| HEX(WEIGHT_STRING(\'x\')) |\n+-------------------------+\n| 0058                    |\n+-------------------------+\n\nSELECT HEX(WEIGHT_STRING(\'x\' AS BINARY(4)));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS BINARY(4))) |\n+--------------------------------------+\n| 78000000                             |\n+--------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(\'x\' AS CHAR(4)));\n+------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS CHAR(4))) |\n+------------------------------------+\n| 0058002000200020                   |\n+------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1)) |\n+--------------------------------------+\n| AA22EE                               |\n+--------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC));\n+-------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC)) |\n+-------------------------------------------+\n| 55DD11                                    |\n+-------------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE));\n+----------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE)) |\n+----------------------------------------------+\n| EE22AA                                       |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/weight_string/','','https://mariadb.com/kb/en/weight_string/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (689,36,'Type Conversion','Implicit type conversion takes place when MariaDB is using operands or\ndifferent types, in order to make the operands compatible.\n\nIt is best practice not to rely upon implicit conversion; rather use CAST to\nexplicitly convert types.\n\nRules for Conversion on Comparison\n----------------------------------\n\n* If  either argument is NULL, the result of the comparison is NULL unless the\nNULL-safe <=> equality comparison operator is used.\n* If both arguments are integers, they are compared as integers.\n* If both arguments are strings, they are compared as strings.\n* If one argument is decimal and the other argument is decimal or integer,\nthey are compared as decimals.\n* If one argument is decimal and the other argument is a floating point, they\nare compared as floating point values.\n* If one argument is string and the other argument is integer, they are\ncompared as decimals. This conversion was added in MariaDB 10.3.36. Prior to\n10.3.36, this combination was compared as floating point values, which did not\nalways work well for huge 64-bit integers because of a possible precision loss\non conversion to double.\n* If a hexadecimal argument is not compared to a number, it is treated as a\nbinary string.\n* If a constant is compared to a TIMESTAMP or DATETIME, the constant is\nconverted to a timestamp, unless used as an argument to the IN function.\n* In other cases, arguments are compared as floating point, or real, numbers.\n\nNote that if a string column is being compared with a numeric value, MariaDB\nwill not use the index on the column, as there are numerous alternatives that\nmay evaluate as equal (see examples below).\n\nComparison Examples\n-------------------\n\nConverting a string to a number:\n\nSELECT 15+\'15\';\n+---------+\n| 15+\'15\' |\n+---------+\n|      30 |\n+---------+\n\nConverting a number to a string:\n\nSELECT CONCAT(15,\'15\');\n+-----------------+\n| CONCAT(15,\'15\') |\n+-----------------+\n| 1515            |\n+-----------------+\n\nFloating point number errors:\n\nSELECT \'9746718491924563214\' = 9746718491924563213;\n+---------------------------------------------+\n| \'9746718491924563214\' = 9746718491924563213 |\n+---------------------------------------------+\n|                                           1 |\n+---------------------------------------------+\n\nNumeric equivalence with strings:\n\nSELECT \'5\' = 5;\n+---------+\n| \'5\' = 5 |\n+---------+\n|       1 |\n+---------+\n\nSELECT \'   5\' = 5;\n+------------+\n| \'   5\' = 5 |\n+------------+\n|          1 |\n+------------+\n\nSELECT \'   5  \' = 5;\n+--------------+\n| \'   5  \' = 5 |\n+--------------+\n|            1 |\n+--------------+\n1 row in set, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------------------------+\n| Level | Code | Message                                    |\n+-------+------+--------------------------------------------+\n| Note  | 1292 | Truncated incorrect DOUBLE value: \'   5  \' |\n+-------+------+--------------------------------------------+\n\nAs a result of the above, MariaDB cannot use the index when comparing a string\nwith a numeric value in the example below:\n\nCREATE TABLE t (a VARCHAR(10), b VARCHAR(10), INDEX idx_a (a));\n\nINSERT INTO t VALUES \n (\'1\', \'1\'), (\'2\', \'2\'), (\'3\', \'3\'),\n (\'4\', \'4\'), (\'5\', \'5\'), (\'1\', \'5\');\n\nEXPLAIN SELECT * FROM t WHERE a = \'3\' \\G\n*************************** 1. row ***************************\n     id: 1\n select_type: SIMPLE\n    table: t\n    type: ref\npossible_keys: idx_a\n     key: idx_a\n   key_len: 13\n     ref: const\n    rows: 1\n    Extra: Using index condition\n\nEXPLAIN SELECT * FROM t WHERE a = 3 \\G\n*************************** 1. row ***************************\n     id: 1\n select_type: SIMPLE\n    table: t\n    type: ALL\npossible_keys: idx_a\n     key: NULL\n   key_len: NULL\n     ref: NULL\n    rows: 6\n    Extra: Using where\n\nRules for Conversion on Dyadic Arithmetic Operations\n----------------------------------------------------\n\nImplicit type conversion also takes place on dyadic arithmetic operations\n(+,-,*,/). MariaDB chooses the minimum data type that is guaranteed to fit the\nresult and converts both arguments to the result data type.\n\nFor addition (+), subtraction (-) and multiplication (*), the result data type\nis chosen as follows:\n\n* If either of the arguments is an approximate number (float, double), the\nresult is double.\n* If either of the arguments is a string (char, varchar, text), the result is\ndouble.\n* If either of the arguments is a decimal number, the result is decimal.\n* If either of the arguments is of a temporal type with a non-zero fractional\nsecond precision (time(N), datetime(N), timestamp(N)), the result is decimal.\n* If either of the arguments is of a temporal type with a zero fractional\nsecond precision (time(0), date, datetime(0), timestamp(0)), the result may\nvary between int, int unsigned, bigint or bigint unsigned, depending on the\nexact data type combination.\n* If both arguments are integer numbers (tinyint, smallint, mediumint,\nbigint), the result may vary between int, int unsigned, bigint or bigint\nunsigned, depending of the exact data types and their signs.\n\nFor division (/), the result data type is chosen as follows:\n\n* If either of the arguments is an approximate number (float, double), the\nresult is double.\n* If either of the arguments is a string (char, varchar, text), the result is\ndouble.\n* Otherwise, the result is decimal.\n\nArithmetic Examples\n-------------------\n\nNote, the above rules mean that when an argument of a temporal data type\nappears in addition or subtraction, it\'s treated as a number by default.\n\nSELECT TIME\'10:20:30\' + 1;\n+--------------------+\n| TIME\'10:20:30\' + 1 |\n+--------------------+\n|             102031 |\n+--------------------+\n\nIn order to do temporal addition or subtraction instead, use the DATE_ADD() or\nDATE_SUB() functions, or an INTERVAL expression as the second argument:\n\nSELECT TIME\'10:20:30\' + INTERVAL 1 SECOND;\n+------------------------------------+\n| TIME\'10:20:30\' + INTERVAL 1 SECOND |\n+------------------------------------+\n| 10:20:31                           |\n+------------------------------------+\n\nSELECT \"2.2\" + 3;\n+-----------+\n| \"2.2\" + 3 |\n+-----------+\n|       5.2 |\n+-----------+\n\nSELECT 2.2 + 3;\n+---------+\n| 2.2 + 3 |\n+---------+\n| 5.2     |\n+---------+\n\nSELECT 2.2 / 3;\n+---------+\n| 2.2 / 3 |\n+---------+\n| 0.73333 |\n+---------+\n\nSELECT \"2.2\" / 3;\n+--------------------+\n| \"2.2\" / 3          |\n+--------------------+\n| 0.7333333333333334 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/type-conversion/','','https://mariadb.com/kb/en/type-conversion/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (690,37,'_rowid','Syntax\n------\n\n_rowid\n\nDescription\n-----------\n\nThe _rowid pseudo column is mapped to the primary key in the related table.\nThis can be used as a replacement of the rowid pseudo column in other\ndatabases. Another usage is to simplify sql queries as one doesn\'t have to\nknow the name of the primary key.\n\nExamples\n--------\n\ncreate table t1 (a int primary key, b varchar(80));\ninsert into t1 values (1,\"one\"),(2,\"two\");\nselect * from t1 where _rowid=1;\n\n+---+------+\n| a | b    |\n+---+------+\n| 1 | one  |\n+---+------+\n\nupdate t1 set b=\"three\" where _rowid=2;\nselect * from t1 where _rowid>=1 and _rowid<=10;\n\n+---+-------+\n| a | b     |\n+---+-------+\n| 1 | one   |\n| 2 | three |\n+---+-------+\n\nURL: https://mariadb.com/kb/en/_rowid/','','https://mariadb.com/kb/en/_rowid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (691,38,'ALTER TABLE','Syntax\n------\n\nALTER [ONLINE] [IGNORE] TABLE [IF EXISTS] tbl_name\n  [WAIT n | NOWAIT]\n  alter_specification [, alter_specification] ...\nalter_specification:\n  table_option ...\n | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition\n    [FIRST | AFTER col_name ]\n | ADD [COLUMN] [IF NOT EXISTS] (col_name column_definition,...)\n | ADD {INDEX|KEY} [IF NOT EXISTS] [index_name]\n    [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n    [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n    UNIQUE [INDEX|KEY] [index_name]\n    [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n    (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n    (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n    FOREIGN KEY [IF NOT EXISTS] [index_name] (index_col_name,...)\n    reference_definition\n | ADD PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)\n | ALTER [COLUMN] col_name SET DEFAULT literal | (expression)\n | ALTER [COLUMN] col_name DROP DEFAULT\n | ALTER {INDEX|KEY} index_name [NOT] INVISIBLE\n | CHANGE [COLUMN] [IF EXISTS] old_col_name new_col_name column_definition\n    [FIRST|AFTER col_name]\n | MODIFY [COLUMN] [IF EXISTS] col_name column_definition\n    [FIRST | AFTER col_name]\n | DROP [COLUMN] [IF EXISTS] col_name [RESTRICT|CASCADE]\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} [IF EXISTS] index_name\n | DROP FOREIGN KEY [IF EXISTS] fk_symbol\n | DROP CONSTRAINT [IF EXISTS] constraint_name\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | RENAME COLUMN old_col_name TO new_col_name\n | RENAME {INDEX|KEY} old_index_name TO new_index_name\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | FORCE\n | partition_options\n | ADD PARTITION [IF NOT EXISTS] (partition_definition)\n | DROP PARTITION [IF EXISTS] partition_names\n | COALESCE PARTITION number\n | REORGANIZE PARTITION [partition_names INTO (partition_definitions)]\n | ANALYZE PARTITION partition_names\n | CHECK PARTITION partition_names\n | OPTIMIZE PARTITION partition_names\n | REBUILD PARTITION partition_names\n | REPAIR PARTITION partition_names\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n | REMOVE PARTITIONING\n | ADD SYSTEM VERSIONING\n | DROP SYSTEM VERSIONING\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\nindex_type:\n  USING {BTREE | HASH | RTREE}\nindex_option:\n  [ KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\ntable_options:\n  table_option [[,] table_option] ...\n\nDescription\n-----------\n\nALTER TABLE enables you to change the structure of an existing table. For\nexample, you can add or delete columns, create or destroy indexes, change the\ntype of existing columns, or rename columns or the table itself. You can also\nchange the comment for the table and the storage engine of the table.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nWhen adding a UNIQUE index on a column (or a set of columns) which have\nduplicated values, an error will be produced and the statement will be\nstopped. To suppress the error and force the creation of UNIQUE indexes,\ndiscarding duplicates, the IGNORE option can be specified. This can be useful\nif a column (or a set of columns) should be UNIQUE but it contains duplicate\nvalues; however, this technique provides no control on which rows are\npreserved and which are deleted. Also, note that IGNORE is accepted but\nignored in ALTER TABLE ... EXCHANGE PARTITION statements.\n\nThis statement can also be used to rename a table. For details see RENAME\nTABLE.\n\nWhen an index is created, the storage engine may use a configurable buffer in\nthe process. Incrementing the buffer speeds up the index creation. Aria and\nMyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for REPAIR TABLE. InnoDB allocates three\nbuffers whose size is defined by innodb_sort_buffer_size.\n\nPrivileges\n----------\n\nExecuting the ALTER TABLE statement generally requires at least the ALTER\nprivilege for the table or the database..\n\nIf you are renaming a table, then it also requires the DROP, CREATE and INSERT\nprivileges for the table or the database as well.\n\nOnline DDL\n----------\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nALTER ONLINE TABLE\n------------------\n\nALTER ONLINE TABLE also works for partitioned tables.\n\nOnline ALTER TABLE is available by executing the following:\n\nALTER ONLINE TABLE ...;\n\nThis statement has the following semantics:\n\nThis statement is equivalent to the following:\n\nALTER TABLE ... LOCK=NONE;\n\nSee the LOCK alter specification for more information.\n\nThis statement is equivalent to the following:\n\nALTER TABLE ... ALGORITHM=INPLACE;\n\nSee the ALGORITHM alter specification for more information.\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nIF EXISTS\n---------\n\nThe IF EXISTS and IF NOT EXISTS clauses are available for the following:\n\nADD COLUMN       [IF NOT EXISTS]\nADD INDEX        [IF NOT EXISTS]\nADD FOREIGN KEY  [IF NOT EXISTS]\nADD PARTITION    [IF NOT EXISTS]\nCREATE INDEX     [IF NOT EXISTS]\nDROP COLUMN      [IF EXISTS]\nDROP INDEX       [IF EXISTS]\nDROP FOREIGN KEY [IF EXISTS]\nDROP PARTITION   [IF EXISTS]\nCHANGE COLUMN    [IF EXISTS]\nMODIFY COLUMN    [IF EXISTS]\nDROP INDEX       [IF EXISTS]\nWhen IF EXISTS and IF NOT EXISTS are used in clauses, queries will not report\nerrors when the condition is triggered for that clause. A warning with the\nsame message text will be issued and the ALTER will move on to the next clause\nin the statement (or end if finished).\n\nMariaDB starting with 10.5.2\n----------------------------\nIf this is directive is used after ALTER ... TABLE, one will not get an error\nif the table doesn\'t exist.\n\nColumn Definitions\n------------------\n\nSee CREATE TABLE: Column Definitions for information about column definitions.\n\nIndex Definitions\n-----------------\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nThe CREATE INDEX and DROP INDEX statements can also be used to add or remove\nan index.\n\nCharacter Sets and Collations\n-----------------------------\n\nCONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n[DEFAULT] CHARACTER SET [=] charset_name\n[DEFAULT] COLLATE [=] collation_name\nSee Setting Character Sets and Collations for details on setting the character\nsets and collations.\n\nAlter Specifications\n--------------------\n\nTable Options\n-------------\n\nSee CREATE TABLE: Table Options for information about table options.\n\nADD COLUMN\n----------\n\n... ADD COLUMN [IF NOT EXISTS]  (col_name column_definition,...)\nAdds a column to the table. The syntax is the same as in CREATE TABLE. If you\nare using IF NOT_EXISTS the column will not be added if it was not there\nalready. This is very useful when doing scripts to modify tables.\n\nThe FIRST and AFTER clauses affect the physical order of columns in the\ndatafile. Use FIRST to add a column in the first (leftmost) position, or AFTER\nfollowed by a column name to add the new column in any other position. Note\nthat, nowadays, the physical position of a column is usually irrelevant.\n\nSee also Instant ADD COLUMN for InnoDB.\n\nDROP COLUMN\n-----------\n\n... DROP COLUMN [IF EXISTS] col_name [CASCADE|RESTRICT]\nDrops the column from the table. If you are using IF EXISTS you will not get\nan error if the column didn\'t exist. If the column is part of any index, the\ncolumn will be dropped from them, except if you add a new column with\nidentical name at the same time. The index will be dropped if all columns from\nthe index were dropped. If the column was used in a view or trigger, you will\nget an error next time the view or trigger is accessed.\n\nMariaDB starting with 10.2.8\n----------------------------\nDropping a column that is part of a multi-column UNIQUE constraint is not\npermitted. For example:\n\nCREATE TABLE a (\n a int,\n b int,\n primary key (a,b)\n);\n\nALTER TABLE x DROP COLUMN a;\n[42000][1072] Key column \'A\' doesn\'t exist in table\n\nThe reason is that dropping column a would result in the new constraint that\nall values in column b be unique. In order to drop the column, an explicit\nDROP PRIMARY KEY and ADD PRIMARY KEY would be required. Up until MariaDB\n10.2.7, the column was dropped and the additional constraint applied,\nresulting in the following structure:\n\nALTER TABLE x DROP COLUMN a;\nQuery OK, 0 rows affected (0.46 sec)\n\nDESC x;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| b     | int(11) | NO   | PRI | NULL    |       |\n+-------+---------+------+-----+---------+-------+\n\nMariaDB starting with 10.4.0\n----------------------------\nMariaDB 10.4.0 supports instant DROP COLUMN. DROP COLUMN of an indexed column\nwould imply DROP INDEX (and in the case of a non-UNIQUE multi-column index,\npossibly ADD INDEX). These will not be allowed with ALGORITHM=INSTANT, but\nunlike before, they can be allowed with ALGORITHM=NOCOPY\n\nRESTRICT and CASCADE are allowed to make porting from other database systems\neasier. In MariaDB, they do nothing.\n\nMODIFY COLUMN\n-------------\n\nAllows you to modify the type of a column. The column will be at the same\nplace as the original column and all indexes on the column will be kept. Note\nthat when modifying column, you should specify all attributes for the new\ncolumn.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY((a));\nALTER TABLE t1 MODIFY a BIGINT UNSIGNED AUTO_INCREMENT;\n\nCHANGE COLUMN\n-------------\n\nWorks like MODIFY COLUMN except that you can also change the name of the\ncolumn. The column will be at the same place as the original column and all\nindex on the column will be kept.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a));\nALTER TABLE t1 CHANGE a b BIGINT UNSIGNED AUTO_INCREMENT;\n\nALTER COLUMN\n------------\n\nThis lets you change column options.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, b varchar(50), PRIMARY KEY(a));\nALTER TABLE t1 ALTER b SET DEFAULT \'hello\';\n\nRENAME INDEX/KEY\n----------------\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5.2, it is possible to rename an index using the RENAME INDEX\n(or RENAME KEY) syntax, for example:\n\nALTER TABLE t1 RENAME INDEX i_old TO i_new;\n\nRENAME COLUMN\n-------------\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5.2, it is possible to rename a column using the RENAME COLUMN\nsyntax, for example:\n\nALTER TABLE t1 RENAME COLUMN c_old TO c_new;\n\nADD PRIMARY KEY\n---------------\n\nAdd a primary key.\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nsilently ignored, and the name of the index is always PRIMARY.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nDROP PRIMARY KEY\n----------------\n\nDrop a primary key.\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nsilently ignored, and the name of the index is always PRIMARY.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nADD FOREIGN KEY\n---------------\n\nAdd a foreign key.\n\nFor FOREIGN KEY indexes, a reference definition must be provided.\n\nFor FOREIGN KEY indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column\nor a column list which must be indexed and whose values must match to the\nforeign key\'s values. The MATCH clause is accepted to improve the\ncompatibility with other DBMS\'s, but has no meaning in MariaDB. The ON DELETE\nand ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE)\nstatements attempts to delete a referenced row from the parent table, and when\nan UPDATE statement attempts to modify the referenced foreign key columns in a\nparent table row, respectively. The following options are allowed:\n\n* RESTRICT: The delete/update operation is not performed.  The statement\nterminates with a 1451 error (SQLSTATE \'2300\').\n* NO ACTION: Synonym for RESTRICT.\n* CASCADE: The delete/update operation is performed in both tables.\n* SET NULL: The update or delete goes ahead in the parent table, and the\ncorresponding foreign key fields in the child table are set to NULL.  (They\nmust not be defined as NOT NULL for this to succeed).\n* SET DEFAULT: This option is implemented only for the legacy PBXT storage\nengine, which is disabled by default and no longer maintained. It sets the\nchild table\'s foreign key fields to their DEFAULT values when the referenced\nparent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is\nRESTRICT.\n\nSee Foreign Keys for more information.\n\nDROP FOREIGN KEY\n----------------\n\nDrop a foreign key.\n\nSee Foreign Keys for more information.\n\nADD INDEX\n---------\n\nAdd a plain index.\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the \"specialized\" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nDROP INDEX\n----------\n\nDrop a plain index.\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the \"specialized\" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nADD UNIQUE INDEX\n----------------\n\nAdd a unique index.\n\nThe UNIQUE keyword means that the index will not accept duplicated values,','','https://mariadb.com/kb/en/alter-table/');
update help_topic set description = CONCAT(description, '\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nDROP UNIQUE INDEX\n-----------------\n\nDrop a unique index.\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nADD FULLTEXT INDEX\n------------------\n\nAdd a FULLTEXT index.\n\nSee Full-Text Indexes for more information.\n\nDROP FULLTEXT INDEX\n-------------------\n\nDrop a FULLTEXT index.\n\nSee Full-Text Indexes for more information.\n\nADD SPATIAL INDEX\n-----------------\n\nAdd a SPATIAL index.\n\nSee SPATIAL INDEX for more information.\n\nDROP SPATIAL INDEX\n------------------\n\nDrop a SPATIAL index.\n\nSee SPATIAL INDEX for more information.\n\nENABLE/ DISABLE KEYS\n--------------------\n\nDISABLE KEYS will disable all non unique keys for the table for storage\nengines that support this (at least MyISAM and Aria). This can be used to\nspeed up inserts into empty tables.\n\nENABLE KEYS will enable all disabled keys.\n\nRENAME TO\n---------\n\nRenames the table. See also RENAME TABLE.\n\nADD CONSTRAINT\n--------------\n\nModifies the table adding a constraint on a particular column or columns.\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 introduced new ways to define a constraint.\n\nNote: Before MariaDB 10.2.1, constraint expressions were accepted in syntax,\nbut ignored.\n\nALTER TABLE table_name \nADD CONSTRAINT [constraint_name] CHECK(expression);\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraint fails, then the row will not be\nupdated. One can use most deterministic functions in a constraint, including\nUDF\'s.\n\nCREATE TABLE account_ledger (\n	id INT PRIMARY KEY AUTO_INCREMENT,\n	transaction_name VARCHAR(100),\n	credit_account VARCHAR(100),\n	credit_amount INT,\n	debit_account VARCHAR(100),\n	debit_amount INT);\n\nALTER TABLE account_ledger \nADD CONSTRAINT is_balanced \n  CHECK((debit_amount + credit_amount) = 0);\n\nThe constraint_name is optional. If you don\'t provide one in the ALTER TABLE\nstatement, MariaDB auto-generates a name for you. This is done so that you can\nremove it later using DROP CONSTRAINT clause.\n\nYou can disable all constraint expression checks by setting the variable\ncheck_constraint_checks to OFF. You may find this useful when loading a table\nthat violates some constraints that you want to later find and fix in SQL.\n\nTo view constraints on a table, query information_schema.TABLE_CONSTRAINTS:\n\nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'account_ledger\';\n\n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME     | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| is_balanced     | account_ledger | CHECK           |\n+-----------------+----------------+-----------------+\n\nDROP CONSTRAINT\n---------------\n\nMariaDB starting with 10.2.22\n-----------------------------\nDROP CONSTRAINT for UNIQUE and FOREIGN KEY constraints was introduced in\nMariaDB 10.2.22 and MariaDB 10.3.13.\n\nMariaDB starting with 10.2.1\n----------------------------\nDROP CONSTRAINT for CHECK constraints was introduced in MariaDB 10.2.1\n\nModifies the table, removing the given constraint.\n\nALTER TABLE table_name\nDROP CONSTRAINT constraint_name;\n\nWhen you add a constraint to a table, whether through a CREATE TABLE or ALTER\nTABLE...ADD CONSTRAINT statement, you can either set a constraint_name\nyourself, or allow MariaDB to auto-generate one for you. To view constraints\non a table, query information_schema.TABLE_CONSTRAINTS. For instance,\n\nCREATE TABLE t (\n a INT,\n b INT,\n c INT,\n CONSTRAINT CHECK(a > b),\n CONSTRAINT check_equals CHECK(a = c));\n\nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'t\';\n\n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME     | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| check_equals    | t              | CHECK           |\n| CONSTRAINT_1    | t              | CHECK           |\n+-----------------+----------------+-----------------+\n\nTo remove a constraint from the table, issue an ALTER TABLE...DROP CONSTRAINT\nstatement. For example,\n\nALTER TABLE t DROP CONSTRAINT is_unique;\n\nADD SYSTEM VERSIONING\n---------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nSystem-versioned tables was added in MariaDB 10.3.4.\n\nAdd system versioning.\n\nDROP SYSTEM VERSIONING\n----------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nSystem-versioned tables was added in MariaDB 10.3.4.\n\nDrop system versioning.\n\nADD PERIOD FOR SYSTEM_TIME\n--------------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nSystem-versioned tables was added in MariaDB 10.3.4.\n\nFORCE\n-----\n\nALTER TABLE ... FORCE can force MariaDB to re-build the table.\n\nIn MariaDB 5.5 and before, this could only be done by setting the ENGINE table\noption to its old value. For example, for an InnoDB table, one could execute\nthe following:\n\nALTER TABLE tab_name ENGINE = InnoDB;\n\nThe FORCE option can be used instead. For example, :\n\nALTER TABLE tab_name FORCE;\n\nWith InnoDB, the table rebuild will only reclaim unused space (i.e. the space\npreviously used for deleted rows) if the innodb_file_per_table system variable\nis set to ON (the default). If the system variable is OFF, then the space will\nnot be reclaimed, but it will be-re-used for new data that\'s later added.\n\nEXCHANGE PARTITION\n------------------\n\nThis is used to exchange the contents of a partition with another table.\n\nThis is performed by swapping the tablespaces of the partition with the other\ntable.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nDISCARD TABLESPACE\n------------------\n\nThis is used to discard an InnoDB table\'s tablespace.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nIMPORT TABLESPACE\n-----------------\n\nThis is used to import an InnoDB table\'s tablespace. The tablespace should\nhave been copied from its original server after executing FLUSH TABLES FOR\nEXPORT.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nALTER TABLE ... IMPORT only applies to InnoDB tables. Most other popular\nstorage engines, such as Aria and MyISAM, will recognize their data files as\nsoon as they\'ve been placed in the proper directory under the datadir, and no\nspecial DDL is required to import them.\n\nALGORITHM\n---------\n\nThe ALTER TABLE statement supports the ALGORITHM clause. This clause is one of\nthe clauses that is used to implement online DDL. ALTER TABLE supports several\ndifferent algorithms. An algorithm can be explicitly chosen for an ALTER TABLE\noperation by setting the ALGORITHM clause. The supported values are:\n\n* ALGORITHM=DEFAULT - This implies the default behavior for the specific\nstatement, such as if no ALGORITHM clause is specified.\n* ALGORITHM=COPY\n* ALGORITHM=INPLACE\n* ALGORITHM=NOCOPY - This was added in MariaDB 10.3.7.\n* ALGORITHM=INSTANT - This was added in MariaDB 10.3.7.\n\nSee InnoDB Online DDL Overview: ALGORITHM for information on how the ALGORITHM\nclause affects InnoDB.\n\nALGORITHM=DEFAULT\n-----------------\n\nThe default behavior, which occurs if ALGORITHM=DEFAULT is specified, or if\nALGORITHM is not specified at all, usually only makes a copy if the operation\ndoesn\'t support being done in-place at all. In this case, the most efficient\navailable algorithm will usually be used.\n\nHowever, in MariaDB 10.3.6 and before, if the value of the old_alter_table\nsystem variable is set to ON, then the default behavior is to perform ALTER\nTABLE operations by making a copy of the table using the old algorithm.\n\nIn MariaDB 10.3.7 and later, the old_alter_table system variable is\ndeprecated. Instead, the alter_algorithm system variable defines the default\nalgorithm for ALTER TABLE operations.\n\nALGORITHM=COPY\n--------------\n\nALGORITHM=COPY is the name for the original ALTER TABLE algorithm from early\nMariaDB versions.\n\nWhen ALGORITHM=COPY is set, MariaDB essentially does the following operations:\n\n-- Create a temporary table with the new definition\nCREATE TEMPORARY TABLE tmp_tab (\n...\n);\n\n-- Copy the data from the original table\nINSERT INTO tmp_tab\n SELECT * FROM original_tab;\n\n-- Drop the original table\nDROP TABLE original_tab;\n\n-- Rename the temporary table, so that it replaces the original one\nRENAME TABLE tmp_tab TO original_tab;\n\nThis algorithm is very inefficient, but it is generic, so it works for all\nstorage engines.\n\nIf ALGORITHM=COPY is specified, then the copy algorithm will be used even if\nit is not necessary. This can result in a lengthy table copy. If multiple\nALTER TABLE operations are required that each require the table to be rebuilt,\nthen it is best to specify all operations in a single ALTER TABLE statement,\nso that the table is only rebuilt once.\n\nALGORITHM=INPLACE\n-----------------\n\nALGORITHM=COPY can be incredibly slow, because the whole table has to be\ncopied and rebuilt. ALGORITHM=INPLACE was introduced as a way to avoid this by\nperforming operations in-place and avoiding the table copy and rebuild, when\npossible.\n\nWhen ALGORITHM=INPLACE is set, the underlying storage engine uses\noptimizations to perform the operation while avoiding the table copy and\nrebuild. However, INPLACE is a bit of a misnomer, since some operations may\nstill require the table to be rebuilt for some storage engines. Regardless,\nseveral operations can be performed without a full copy of the table for some\nstorage engines.\n\nA more accurate name would have been ALGORITHM=ENGINE, where ENGINE refers to\nan \"engine-specific\" algorithm.\n\nIf an ALTER TABLE operation supports ALGORITHM=INPLACE, then it can be\nperformed using optimizations by the underlying storage engine, but it may\nrebuilt.\n\nSee InnoDB Online DDL Operations with ALGORITHM=INPLACE for more.\n\nALGORITHM=NOCOPY\n----------------\n\nALGORITHM=NOCOPY was introduced in MariaDB 10.3.7.\n\nALGORITHM=INPLACE can sometimes be surprisingly slow in instances where it has\nto rebuild the clustered index, because when the clustered index has to be\nrebuilt, the whole table has to be rebuilt. ALGORITHM=NOCOPY was introduced as\na way to avoid this.\n\nIf an ALTER TABLE operation supports ALGORITHM=NOCOPY, then it can be\nperformed without rebuilding the clustered index.\n\nIf ALGORITHM=NOCOPY is specified for an ALTER TABLE operation that does not\nsupport ALGORITHM=NOCOPY, then an error will be raised. In this case, raising\nan error is preferable, if the alternative is for the operation to rebuild the\nclustered index, and perform unexpectedly slowly.\n\nSee InnoDB Online DDL Operations with ALGORITHM=NOCOPY for more.\n\nALGORITHM=INSTANT\n-----------------\n\nALGORITHM=INSTANT was introduced in MariaDB 10.3.7.\n\nALGORITHM=INPLACE can sometimes be surprisingly slow in instances where it has\nto modify data files. ALGORITHM=INSTANT was introduced as a way to avoid this.\n\nIf an ALTER TABLE operation supports ALGORITHM=INSTANT, then it can be\nperformed without modifying any data files.\n\nIf ALGORITHM=INSTANT is specified for an ALTER TABLE operation that does not\nsupport ALGORITHM=INSTANT, then an error will be raised. In this case, raising\nan error is preferable, if the alternative is for the operation to modify data\nfiles, and perform unexpectedly slowly.\n\nSee InnoDB Online DDL Operations with ALGORITHM=INSTANT for more.\n\nLOCK\n----\n\nThe ALTER TABLE statement supports the LOCK clause. This clause is one of the\nclauses that is used to implement online DDL. ALTER TABLE supports several\ndifferent locking strategies. A locking strategy can be explicitly chosen for\nan ALTER TABLE operation by setting the LOCK clause. The supported values are:\n\n* DEFAULT: Acquire the least restrictive lock on the table that is supported\nfor the specific operation. Permit the maximum amount of concurrency that is\nsupported for the specific operation.\n* NONE: Acquire no lock on the table. Permit all concurrent DML. If this\nlocking strategy is not permitted for an operation, then an error is raised.\n* SHARED: Acquire a read lock on the table. Permit read-only concurrent DML.\nIf this locking strategy is not permitted for an operation, then an error is\nraised.\n* EXCLUSIVE: Acquire a write lock on the table. Do not permit concurrent DML.\n\nDifferent storage engines support different locking strategies for different\noperations. If a specific locking strategy is chosen for an ALTER TABLE\noperation, and that table\'s storage engine does not support that locking\nstrategy for that specific operation, then an error will be raised.\n\nIf the LOCK clause is not explicitly set, then the operation uses LOCK=DEFAULT.\n\nALTER ONLINE TABLE is equivalent to LOCK=NONE. Therefore, the ALTER ONLINE\nTABLE statement can be used to ensure that your ALTER TABLE operation allows\nall concurrent DML.\n\nSee InnoDB Online DDL Overview: LOCK for information on how the LOCK clause\naffects InnoDB.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for ALTER TABLE statement for clients that\nsupport the new progress reporting protocol. For example, if you were using\nthe mysql client, then the progress report might look like this::\n\nALTER TABLE test ENGINE=Aria;\nStage: 1 of 2 \'copy to tmp table\'    46% of stage\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST\nstatement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nAborting ALTER TABLE Operations\n-------------------------------\n\nIf an ALTER TABLE operation is being performed and the connection is killed,') WHERE help_topic_id = 691;
update help_topic set description = CONCAT(description, '\nthe changes will be rolled back in a controlled manner. The rollback can be a\nslow operation as the time it takes is relative to how far the operation has\nprogressed.\n\nMariaDB starting with 10.2.13\n-----------------------------\nAborting ALTER TABLE ... ALGORITHM=COPY was made faster by removing excessive\nundo logging (MDEV-11415). This significantly shortens the time it takes to\nabort a running ALTER TABLE operation.\n\nAtomic ALTER TABLE\n------------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, ALTER TABLE is atomic for most engines, including InnoDB,\nMyRocks, MyISAM and Aria (MDEV-25180). This means that if there is a crash\n(server down or power outage) during an ALTER TABLE operation, after recovery,\neither the old table and associated triggers and status will be intact, or the\nnew table will be active.\n\nIn older MariaDB versions one could get leftover #sql-alter..\',\n\'#sql-backup..\' or \'table_name.frm˝\' files if the system crashed during the\nALTER TABLE operation.\n\nSee Atomic DDL for more information.\n\nReplication\n-----------\n\nMariaDB starting with 10.8.1\n----------------------------\nBefore MariaDB 10.8.1, ALTER TABLE got fully executed on the primary first,\nand only then was it replicated and started executing on replicas. From\nMariaDB 10.8.1, ALTER TABLE gains an option to replicate sooner and begin\nexecuting on replicas when it merely starts executing on the primary, not when\nit finishes. This way the replication lag caused by a heavy ALTER TABLE can be\ncompletely eliminated (MDEV-11675).\n\nExamples\n--------\n\nAdding a new column:\n\nALTER TABLE t1 ADD x INT;\n\nDropping a column:\n\nALTER TABLE t1 DROP x;\n\nModifying the type of a column:\n\nALTER TABLE t1 MODIFY x bigint unsigned;\n\nChanging the name and type of a column:\n\nALTER TABLE t1 CHANGE a b bigint unsigned auto_increment;\n\nCombining multiple clauses in a single ALTER TABLE statement, separated by\ncommas:\n\nALTER TABLE t1 DROP x, ADD x2 INT,  CHANGE y y2 INT;\n\nChanging the storage engine and adding a comment:\n\nALTER TABLE t1 \n ENGINE = InnoDB\n COMMENT = \'First of three tables containing usage info\';\n\nRebuilding the table (the previous example will also rebuild the table if it\nwas already InnoDB):\n\nALTER TABLE t1 FORCE;\n\nDropping an index:\n\nALTER TABLE rooms DROP INDEX u;\n\nAdding a unique index:\n\nALTER TABLE rooms ADD UNIQUE INDEX u(room_number);\n\nFrom MariaDB 10.5.3, adding a primary key for an application-time period table\nwith a WITHOUT OVERLAPS constraint:\n\nALTER TABLE rooms ADD PRIMARY KEY(room_number, p WITHOUT OVERLAPS);\n\nFrom MariaDB 10.8.1, ALTER query can be replicated faster with the setting of\n\nSET @@SESSION.binlog_alter_two_phase = true;\n\nprior the ALTER query. Binlog would contain two event groups\n\n| master-bin.000001 | 495 | Gtid              |         1 |         537 | GTID\n0-1-2 START ALTER                                        |\n| master-bin.000001 | 537 | Query             |         1 |         655 | use\n`test`; alter table t add column b int, algorithm=inplace |\n| master-bin.000001 | 655 | Gtid              |         1 |         700 | GTID\n0-1-3 COMMIT ALTER id=2                                  |\n| master-bin.000001 | 700 | Query             |         1 |         835 | use\n`test`; alter table t add column b int, algorithm=inplace |\n\nof which the first one gets delivered to replicas before ALTER is taken to\nactual execution on the primary.\n\nURL: https://mariadb.com/kb/en/alter-table/') WHERE help_topic_id = 691;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (692,38,'ALTER DATABASE','Modifies a database, changing its overall characteristics.\n\nSyntax\n------\n\nALTER {DATABASE | SCHEMA} [db_name]\n  alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n  UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n  [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'comment\'\n\nDescription\n-----------\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the database\ndirectory. To use ALTER DATABASE, you need the ALTER privilege on the\ndatabase. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe CHARACTER SET clause changes the default database character set. The\nCOLLATE clause changes the default database collation. See Character Sets and\nCollations for more.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements.\n\nChanging the default character set/collation of a database does not change the\ncharacter set/collation of any stored procedures or stored functions that were\npreviously created, and relied on the defaults. These need to be dropped and\nrecreated in order to apply the character set/collation changes.\n\nThe database name can be omitted from the first syntax, in which case the\nstatement applies to the default database.\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause was added in\nMySQL 5.1.23. It updates the name of the directory associated with the\ndatabase to use the encoding implemented in MySQL 5.1 for mapping database\nnames to database directory names (see Identifier to File Name Mapping). This\nclause is for use under these conditions:\n\n* It is intended when upgrading MySQL to 5.1 or later from older versions.\n* It is intended to update a database directory name to the current encoding\nformat if the name contains special characters that need encoding.\n* The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example,if a database in MySQL 5.0 has a name of a-b-c, the name contains\ninstance of the `-\' character. In 5.0, the database directory is also named\na-b-c, which is not necessarily safe for all file systems. In MySQL 5.1 and\nup, the same database name is encoded as a@002db@002dc to produce a file\nsystem-neutral directory name.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an older\nversion,the server displays a name such as a-b-c (which is in the old format)\nas #mysql50#a-b-c, and you must refer to the name using the #mysql50# prefix.\nUse UPGRADE DATA DIRECTORY NAME in this case to explicitly tell the server to\nre-encode the database directory name to the current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c without\nthe special #mysql50# prefix.\n\nCOMMENT\n-------\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024\nbytes. If the comment length exceeds this length, a error/warning code 4144 is\nthrown. The database comment is also added to the db.opt file, as well as to\nthe information_schema.schemata table.\n\nExamples\n--------\n\nALTER DATABASE test CHARACTER SET=\'utf8\'  COLLATE=\'utf8_bin\';\n\nFrom MariaDB 10.5.0:\n\nALTER DATABASE p COMMENT=\'Presentations\';\n\nURL: https://mariadb.com/kb/en/alter-database/','','https://mariadb.com/kb/en/alter-database/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (693,38,'ALTER EVENT','Modifies one or more characteristics of an existing event.\n\nSyntax\n------\n\nALTER\n  [DEFINER = { user | CURRENT_USER }]\n  EVENT event_name\n  [ON SCHEDULE schedule]\n  [ON COMPLETION [NOT] PRESERVE]\n  [RENAME TO new_event_name]\n  [ENABLE | DISABLE | DISABLE ON SLAVE]\n  [COMMENT \'comment\']\n  [DO sql_statement]\n\nDescription\n-----------\n\nThe ALTER EVENT statement is used to change one or more of the characteristics\nof an existing event without the need to drop and recreate it. The syntax for\neach of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE / DISABLE,\nand DO clauses is exactly the same as when used with CREATE EVENT.\n\nThis statement requires the EVENT privilege. When a user executes a successful\nALTER EVENT statement, that user becomes the definer for the affected event.\n\n(In MySQL 5.1.11 and earlier, an event could be altered only by its definer,\nor by a user having the SUPER privilege.)\n\nALTER EVENT works only with an existing event:\n\nALTER EVENT no_such_event ON SCHEDULE EVERY \'2:3\' DAY_HOUR;\nERROR 1539 (HY000): Unknown event \'no_such_event\'\n\nExamples\n--------\n\nALTER EVENT myevent \n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 HOUR\n DO\n  UPDATE myschema.mytable SET mycol = mycol + 1;\n\nURL: https://mariadb.com/kb/en/alter-event/','','https://mariadb.com/kb/en/alter-event/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (694,38,'ALTER FUNCTION','Syntax\n------\n\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n  { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored function.\nMore than one change may be specified in an ALTER FUNCTION statement. However,\nyou cannot change the parameters or body of a stored function using this\nstatement; to make such changes, you must drop and re-create the function\nusing DROP FUNCTION and CREATE FUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That privilege is\ngranted automatically to the function creator.) If binary logging is enabled,\nthe ALTER FUNCTION statement might also require the SUPER privilege, as\ndescribed in Binary Logging of Stored Routines.\n\nExample\n-------\n\nALTER FUNCTION hello SQL SECURITY INVOKER;\n\nURL: https://mariadb.com/kb/en/alter-function/','','https://mariadb.com/kb/en/alter-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (695,38,'ALTER LOGFILE GROUP','Syntax\n------\n\nALTER LOGFILE GROUP logfile_group\n  ADD UNDOFILE \'file_name\'\n  [INITIAL_SIZE [=] size]\n  [WAIT]\n  ENGINE [=] engine_name\n\nThe ALTER LOGFILE GROUP statement is not supported by MariaDB. It was\noriginally inherited from MySQL NDB Cluster. See MDEV-19295 for more\ninformation.\n\nURL: https://mariadb.com/kb/en/alter-logfile-group/','','https://mariadb.com/kb/en/alter-logfile-group/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (696,38,'ALTER PROCEDURE','Syntax\n------\n\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n  { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a stored\nprocedure using this statement. To make such changes, you must drop and\nre-create the procedure using either CREATE OR REPLACE PROCEDURE (since\nMariaDB 10.1.3) or DROP PROCEDURE and CREATE PROCEDURE (MariaDB 10.1.2 and\nbefore).\n\nYou must have the ALTER ROUTINE privilege for the procedure. By default, that\nprivilege is granted automatically to the procedure creator. See Stored\nRoutine Privileges.\n\nExample\n-------\n\nALTER PROCEDURE simpleproc SQL SECURITY INVOKER;\n\nURL: https://mariadb.com/kb/en/alter-procedure/','','https://mariadb.com/kb/en/alter-procedure/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (697,38,'ALTER SERVER','Syntax\n------\n\nALTER SERVER server_name\n  OPTIONS (option [, option] ...)\n\nDescription\n-----------\n\nAlters the server information for server_name, adjusting the specified options\nas per the CREATE SERVER command. The corresponding fields in the\nmysql.servers table are updated accordingly. This statement requires the SUPER\nprivilege or, from MariaDB 10.5.2, the FEDERATED ADMIN privilege.\n\nALTER SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nExamples\n--------\n\nALTER SERVER s OPTIONS (USER \'sally\');\n\nURL: https://mariadb.com/kb/en/alter-server/','','https://mariadb.com/kb/en/alter-server/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (698,38,'ALTER TABLESPACE','The ALTER TABLESPACE statement is not supported by MariaDB. It was originally\ninherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is\nalso supported for InnoDB. However, MariaDB has chosen not to include that\nspecific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/kb/en/alter-tablespace/','','https://mariadb.com/kb/en/alter-tablespace/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (699,38,'ALTER VIEW','Syntax\n------\n\nALTER\n  [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n  [DEFINER = { user | CURRENT_USER }]\n  [SQL SECURITY { DEFINER | INVOKER }]\n  VIEW view_name [(column_list)]\n  AS select_statement\n  [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nDescription\n-----------\n\nThis statement changes the definition of a view, which must exist. The syntax\nis similar to that for CREATE VIEW and the effect is the same as for CREATE OR\nREPLACE VIEW if the view exists. This statement requires the CREATE VIEW and\nDROP privileges for the view, and some privilege for each column referred to\nin the SELECT statement. ALTER VIEW is allowed only to the definer or users\nwith the SUPER privilege.\n\nExample\n-------\n\nALTER VIEW v AS SELECT a, a*3 AS a2 FROM t;\n\nURL: https://mariadb.com/kb/en/alter-view/','','https://mariadb.com/kb/en/alter-view/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (700,38,'CREATE TABLE','Syntax\n------\n\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n  (create_definition,...) [table_options    ]... [partition_options]\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n  [(create_definition,...)] [table_options   ]... [partition_options]\n  select_statement\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_table_name | (LIKE old_table_name) }\nselect_statement:\n  [IGNORE | REPLACE] [AS] SELECT ...   (Some legal select statement)\n\nDescription\n-----------\n\nUse the CREATE TABLE statement to create a table with the given name.\n\nIn its most basic form, the CREATE TABLE statement provides a table name\nfollowed by a list of columns, indexes, and constraints. By default, the table\nis created in the default database. Specify a database with db_name.tbl_name.\nIf you quote the table name, you must quote the database name and table name\nseparately as `db_name`.`tbl_name`. This is particularly useful for CREATE\nTABLE ... SELECT, because it allows to create a table into a database, which\ncontains data from other databases. See Identifier Qualifiers.\n\nIf a table with the same name exists, error 1050 results. Use IF NOT EXISTS to\nsuppress this error and issue a note instead. Use SHOW WARNINGS to see notes.\n\nThe CREATE TABLE statement automatically commits the current transaction,\nexcept when using the TEMPORARY keyword.\n\nFor valid identifiers to use as table names, see Identifier Names.\n\nNote: if the default_storage_engine is set to ColumnStore then it needs\nsetting on all UMs. Otherwise when the tables using the default engine are\nreplicated across UMs they will use the wrong engine. You should therefore not\nuse this option as a session variable with ColumnStore.\n\nMicrosecond precision can be between 0-6. If no precision is specified it is\nassumed to be 0, for backward compatibility reasons.\n\nPrivileges\n----------\n\nExecuting the CREATE TABLE statement requires the CREATE privilege for the\ntable or the database.\n\nCREATE OR REPLACE\n-----------------\n\nIf the OR REPLACE clause is used and the table already exists, then instead of\nreturning an error, the server will drop the existing table and replace it\nwith the newly defined table.\n\nThis syntax was originally added to make replication more robust if it has to\nrollback and repeat statements such as CREATE ... SELECT on replicas.\n\nCREATE OR REPLACE TABLE table_name (a int);\n\nis basically the same as:\n\nDROP TABLE IF EXISTS table_name;\nCREATE TABLE table_name (a int);\n\nwith the following exceptions:\n\n* If table_name was locked with LOCK TABLES it will continue to be locked\nafter the statement.\n* Temporary tables are only dropped if the TEMPORARY keyword was used.  (With\nDROP TABLE,  temporary tables are preferred to be dropped before normal\ntables).\n\nThings to be Aware of With CREATE OR REPLACE\n--------------------------------------------\n\n* The table is dropped first (if it existed), after that the CREATE is done.\nBecause of this, if the CREATE fails, then the table will not exist anymore\nafter the statement.  If the table was used with LOCK TABLES it will be\nunlocked.\n* One can\'t use OR REPLACE together with IF EXISTS.\n* Slaves in replication will by default use CREATE OR REPLACE when replicating\nCREATE statements that don\'\'t use IF EXISTS. This can be changed by setting\nthe variable slave-ddl-exec-mode to STRICT.\n\nCREATE TABLE IF NOT EXISTS\n--------------------------\n\nIf the IF NOT EXISTS clause is used, then the table will only be created if a\ntable with the same name does not already exist. If the table already exists,\nthen a warning will be triggered by default.\n\nCREATE TEMPORARY TABLE\n----------------------\n\nUse the TEMPORARY keyword to create a temporary table that is only available\nto the current session. Temporary tables are dropped when the session ends.\nTemporary table names are specific to the session. They will not conflict with\nother temporary tables from other sessions even if they share the same name.\nThey will shadow names of non-temporary tables or views, if they are\nidentical. A temporary table can have the same name as a non-temporary table\nwhich is located in the same database. In that case, their name will reference\nthe temporary table when used in SQL statements. You must have the CREATE\nTEMPORARY TABLES privilege on the database to create temporary tables. If no\nstorage engine is specified, the default_tmp_storage_engine setting will\ndetermine the engine.\n\nROCKSDB temporary tables cannot be created by setting the\ndefault_tmp_storage_engine system variable, or using CREATE TEMPORARY TABLE\nLIKE. Before MariaDB 10.7, they could be specified, but would silently fail,\nand a MyISAM table would be created instead. From MariaDB 10.7 an error is\nreturned. Explicitly creating a temporary table with ENGINE=ROCKSDB has never\nbeen permitted.\n\nCREATE TABLE ... LIKE\n---------------------\n\nUse the LIKE clause instead of a full table definition to create a table with\nthe same definition as another table, including columns, indexes, and table\noptions. Foreign key definitions, as well as any DATA DIRECTORY or INDEX\nDIRECTORY table options specified on the original table, will not be created.\n\nCREATE TABLE ... SELECT\n-----------------------\n\nYou can create a table containing data from other tables using the CREATE ...\nSELECT statement. Columns will be created in the table for each field returned\nby the SELECT query.\n\nYou can also define some columns normally and add other columns from a SELECT.\nYou can also create columns in the normal way and assign them some values\nusing the query, this is done to force a certain type or other field\ncharacteristics. The columns that are not named in the query will be placed\nbefore the others. For example:\n\nCREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM\n  SELECT 5 AS b, c, d FROM another_table;\n\nRemember that the query just returns data. If you want to use the same\nindexes, or the same columns attributes ([NOT] NULL, DEFAULT, AUTO_INCREMENT)\nin the new table, you need to specify them manually. Types and sizes are not\nautomatically preserved if no data returned by the SELECT requires the full\nsize, and VARCHAR could be converted into CHAR. The CAST() function can be\nused to forcee the new table to use certain types.\n\nAliases (AS) are taken into account, and they should always be used when you\nSELECT an expression (function, arithmetical operation, etc).\n\nIf an error occurs during the query, the table will not be created at all.\n\nIf the new table has a primary key or UNIQUE indexes, you can use the IGNORE\nor REPLACE keywords to handle duplicate key errors during the query. IGNORE\nmeans that the newer values must not be inserted an identical value exists in\nthe index. REPLACE means that older values must be overwritten.\n\nIf the columns in the new table are more than the rows returned by the query,\nthe columns populated by the query will be placed after other columns. Note\nthat if the strict SQL_MODE is on, and the columns that are not names in the\nquery do not have a DEFAULT value, an error will raise and no rows will be\ncopied.\n\nConcurrent inserts are not used during the execution of a CREATE ... SELECT.\n\nIf the table already exists, an error similar to the following will be\nreturned:\n\nERROR 1050 (42S01): Table \'t\' already exists\n\nIf the IF NOT EXISTS clause is used and the table exists, a note will be\nproduced instead of an error.\n\nTo insert rows from a query into an existing table, INSERT ... SELECT can be\nused.\n\nColumn Definitions\n------------------\n\ncreate_definition:\n { col_name column_definition | index_definition | period_definition | CHECK\n(expr) }\ncolumn_definition:\n data_type\n  [NOT NULL | NULL] [DEFAULT default_value | (expression)]\n  [ON UPDATE [NOW | CURRENT_TIMESTAMP] [(precision)]]\n  [AUTO_INCREMENT] [ZEROFILL] [UNIQUE [KEY] | [PRIMARY] KEY]\n  [INVISIBLE] [{WITH|WITHOUT} SYSTEM VERSIONING]\n  [COMMENT \'string\'] [REF_SYSTEM_ID = value]\n  [reference_definition]\n | data_type [GENERATED ALWAYS]\n AS { { ROW {START|END} } | { (expression) [VIRTUAL | PERSISTENT | STORED] } }\n   [UNIQUE [KEY]] [COMMENT \'string\']\nconstraint_definition:\n CONSTRAINT [constraint_name] CHECK (expression)\nNote: Until MariaDB 10.4, MariaDB accepts the shortcut format with a\nREFERENCES clause only in ALTER TABLE and CREATE TABLE statements, but that\nsyntax does nothing. For example:\n\nCREATE TABLE b(for_key INT REFERENCES a(not_key));\n\nMariaDB simply parses it without returning any error or warning, for\ncompatibility with other DBMS\'s. Before MariaDB 10.2.1 this was also true for\nCHECK constraints. However, only the syntax described below creates foreign\nkeys.\n\nFrom MariaDB 10.5, MariaDB will attempt to apply the constraint. See Foreign\nKeys examples.\n\nEach definition either creates a column in the table or specifies and index or\nconstraint on one or more columns. See Indexes below for details on creating\nindexes.\n\nCreate a column by specifying a column name and a data type, optionally\nfollowed by column options. See Data Types for a full list of data types\nallowed in MariaDB.\n\nNULL and NOT NULL\n-----------------\n\nUse the NULL or NOT NULL options to specify that values in the column may or\nmay not be NULL, respectively. By default, values may be NULL. See also NULL\nValues in MariaDB.\n\nDEFAULT Column Option\n---------------------\n\nMariaDB starting with 10.2.1\n----------------------------\nThe DEFAULT clause was enhanced in MariaDB 10.2.1. Some enhancements include\n\n* BLOB and TEXT columns now support DEFAULT.\n* The DEFAULT clause can now be used with an expression or function.\n\nSpecify a default value using the DEFAULT clause. If you don\'t specify DEFAULT\nthen the following rules apply:\n\n* If the column is not defined with NOT NULL, AUTO_INCREMENT or TIMESTAMP, an\nexplicit DEFAULT NULL will be added.\nNote that in MySQL and in MariaDB before 10.1.6, you may get an explicit\nDEFAULT for primary key parts, if not specified with NOT NULL.\n\nThe default value will be used if you INSERT a row without specifying a value\nfor that column, or if you specify DEFAULT for that column. Before MariaDB\n10.2.1 you couldn\'t usually provide an expression or function to evaluate at\ninsertion time. You had to provide a constant default value instead. The one\nexception is that you may use CURRENT_TIMESTAMP as the default value for a\nTIMESTAMP column to use the current timestamp at insertion time.\n\nCURRENT_TIMESTAMP may also be used as the default value for a DATETIME\n\nFrom MariaDB 10.2.1 you can use most functions in DEFAULT. Expressions should\nhave parentheses around them. If you use a non deterministic function in\nDEFAULT then all inserts to the table will be replicated in row mode. You can\neven refer to earlier columns in the DEFAULT expression (excluding\nAUTO_INCREMENT columns):\n\nCREATE TABLE t1 (a int DEFAULT (1+1), b int DEFAULT (a+1));\nCREATE TABLE t2 (a bigint primary key DEFAULT UUID_SHORT());\n\nThe DEFAULT clause cannot contain any stored functions or subqueries, and a\ncolumn used in the clause must already have been defined earlier in the\nstatement.\n\nSince MariaDB 10.2.1, it is possible to assign BLOB or TEXT columns a DEFAULT\nvalue. In earlier versions, assigning a default to these columns was not\npossible.\n\nMariaDB starting with 10.3.3\n----------------------------\nStarting from 10.3.3 you can also use DEFAULT (NEXT VALUE FOR sequence)\n\nAUTO_INCREMENT Column Option\n----------------------------\n\nUse AUTO_INCREMENT to create a column whose value can can be set automatically\nfrom a simple counter. You can only use AUTO_INCREMENT on a column with an\ninteger type. The column must be a key, and there can only be one\nAUTO_INCREMENT column in a table. If you insert a row without specifying a\nvalue for that column (or if you specify 0, NULL, or DEFAULT as the value),\nthe actual value will be taken from the counter, with each insertion\nincrementing the counter by one. You can still insert a value explicitly. If\nyou insert a value that is greater than the current counter value, the counter\nis set based on the new value. An AUTO_INCREMENT column is implicitly NOT\nNULL. Use LAST_INSERT_ID to get the AUTO_INCREMENT value most recently used by\nan INSERT statement.\n\nZEROFILL Column Option\n----------------------\n\nIf the ZEROFILL column option is specified for a column using a numeric data\ntype, then the column will be set to UNSIGNED and the spaces used by default\nto pad the field are replaced with zeros. ZEROFILL is ignored in expressions\nor as part of a UNION. ZEROFILL is a non-standard MySQL and MariaDB\nenhancement.\n\nPRIMARY KEY Column Option\n-------------------------\n\nUse PRIMARY KEY to make a column a primary key. A primary key is a special\ntype of a unique key. There can be at most one primary key per table, and it\nis implicitly NOT NULL.\n\nSpecifying a column as a unique key creates a unique index on that column. See\nthe Index Definitions section below for more information.\n\nUNIQUE KEY Column Option\n------------------------\n\nUse UNIQUE KEY (or just UNIQUE) to specify that all values in the column must\nbe distinct from each other. Unless the column is NOT NULL, there may be\nmultiple rows with NULL in the column.\n\nSpecifying a column as a unique key creates a unique index on that column. See\nthe Index Definitions section below for more information.\n\nCOMMENT Column Option\n---------------------\n\nYou can provide a comment for each column using the COMMENT clause. The\nmaximum length is 1024 characters. Use the SHOW FULL COLUMNS statement to see\ncolumn comments.\n\nREF_SYSTEM_ID\n-------------\n\nREF_SYSTEM_ID can be used to specify Spatial Reference System IDs for spatial\ndata type columns. For example:\n\nCREATE TABLE t1(g GEOMETRY(9,4) REF_SYSTEM_ID=101);\n\nGenerated Columns\n-----------------\n\nA generated column is a column in a table that cannot explicitly be set to a\nspecific value in a DML query. Instead, its value is automatically generated\nbased on an expression. This expression might generate the value based on the\nvalues of other columns in the table, or it might generate the value by\ncalling built-in functions or user-defined functions (UDFs).\n\nThere are two types of generated columns:\n\n* PERSISTENT or STORED: This type\'s value is actually stored in the table.','','https://mariadb.com/kb/en/create-table/');
update help_topic set description = CONCAT(description, '\n* VIRTUAL: This type\'s value is not stored at all. Instead, the value is\ngenerated dynamically when the table is queried. This type is the default.\n\nGenerated columns are also sometimes called computed columns or virtual\ncolumns.\n\nFor a complete description about generated columns and their limitations, see\nGenerated (Virtual and Persistent/Stored) Columns.\n\nCOMPRESSED\n----------\n\nMariaDB starting with 10.3.3\n----------------------------\nCertain columns may be compressed. See Storage-Engine Independent Column\nCompression.\n\nINVISIBLE\n---------\n\nMariaDB starting with 10.3.3\n----------------------------\nColumns may be made invisible, and hidden in certain contexts. See Invisible\nColumns.\n\nWITH SYSTEM VERSIONING Column Option\n------------------------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nColumns may be explicitly marked as included from system versioning. See\nSystem-versioned tables for details.\n\nWITHOUT SYSTEM VERSIONING Column Option\n---------------------------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nColumns may be explicitly marked as excluded from system versioning. See\nSystem-versioned tables for details.\n\nIndex Definitions\n-----------------\n\nindex_definition:\n  {INDEX|KEY} [index_name] [index_type] (index_col_name,...) [index_option]\n...\n {{{|}}} {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n[index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n[index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name] [index_type]\n(index_col_name,...) [index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...)\nreference_definition\n\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\n\nindex_type:\n  USING {BTREE | HASH | RTREE}\n\nindex_option:\n  [ KEY_BLOCK_SIZE [=] value\n {{{|}}} index_type\n {{{|}}} WITH PARSER parser_name\n {{{|}}} COMMENT \'string\'\n {{{|}}} CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\n\nreference_definition:\n  REFERENCES tbl_name (index_col_name,...)\n   [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n   [ON DELETE reference_option]\n   [ON UPDATE reference_option]\n\nreference_option:\n  RESTRICT | CASCADE | SET NULL | NO ACTION\n\nINDEX and KEY are synonyms.\n\nIndex names are optional, if not specified an automatic name will be assigned.\nIndex name are needed to drop indexes and appear in error messages when a\nconstraint is violated.\n\nIndex Categories\n----------------\n\nPlain Indexes\n-------------\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the \"specialized\" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nPRIMARY KEY\n-----------\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nignored, and the name of the index is always PRIMARY. From MariaDB 10.3.18 and\nMariaDB 10.4.8, a warning is explicitly issued if a name is specified. Before\nthen, the name was silently ignored.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nUNIQUE\n------\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nFOREIGN KEY\n-----------\n\nFor FOREIGN KEY indexes, a reference definition must be provided.\n\nFor FOREIGN KEY indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column\nor a column list which must be indexed and whose values must match to the\nforeign key\'s values. The MATCH clause is accepted to improve the\ncompatibility with other DBMS\'s, but has no meaning in MariaDB. The ON DELETE\nand ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE)\nstatements attempts to delete a referenced row from the parent table, and when\nan UPDATE statement attempts to modify the referenced foreign key columns in a\nparent table row, respectively. The following options are allowed:\n\n* RESTRICT: The delete/update operation is not performed.  The statement\nterminates with a 1451 error (SQLSTATE \'2300\').\n* NO ACTION: Synonym for RESTRICT.\n* CASCADE: The delete/update operation is performed in both tables.\n* SET NULL: The update or delete goes ahead in the parent table, and the\ncorresponding foreign key fields in the child table are set to NULL.  (They\nmust not be defined as NOT NULL for this to succeed).\n* SET DEFAULT: This option is currently implemented only for the PBXT storage\nengine, which is disabled by default and no longer maintained. It sets the\nchild table\'s foreign key fields to their DEFAULT values when the referenced\nparent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is\nRESTRICT.\n\nSee Foreign Keys for more information.\n\nFULLTEXT\n--------\n\nUse the FULLTEXT keyword to create full-text indexes.\n\nSee Full-Text Indexes for more information.\n\nSPATIAL\n-------\n\nUse the SPATIAL keyword to create geometric indexes.\n\nSee SPATIAL INDEX for more information.\n\nIndex Options\n-------------\n\nKEY_BLOCK_SIZE Index Option\n---------------------------\n\nThe KEY_BLOCK_SIZE index option is similar to the KEY_BLOCK_SIZE table option.\n\nWith the InnoDB storage engine, if you specify a non-zero value for the\nKEY_BLOCK_SIZE table option for the whole table, then the table will\nimplicitly be created with the ROW_FORMAT table option set to COMPRESSED.\nHowever, this does not happen if you just set the KEY_BLOCK_SIZE index option\nfor one or more indexes in the table. The InnoDB storage engine ignores the\nKEY_BLOCK_SIZE index option. However, the SHOW CREATE TABLE statement may\nstill report it for the index.\n\nFor information about the KEY_BLOCK_SIZE index option, see the KEY_BLOCK_SIZE\ntable option below.\n\nIndex Types\n-----------\n\nEach storage engine supports some or all index types. See Storage Engine Index\nTypes for details on permitted index types for each storage engine.\n\nDifferent index types are optimized for different kind of operations:\n\n* BTREE is the default type, and normally is the best choice. It is supported\nby all storage engines. It can be used to compare a column\'s value with a\nvalue using the =, >, >=, <, <=, BETWEEN, and LIKE operators. BTREE can also\nbe used to find NULL values. Searches against an index prefix are possible.\n* HASH is only supported by the MEMORY storage engine. HASH indexes can only\nbe used for =, <=, and >= comparisons. It can not be used for the ORDER BY\nclause. Searches against an index prefix are not possible.\n* RTREE is the default for SPATIAL indexes, but if the storage engine does not\nsupport it BTREE can be used.\n\nIndex columns names are listed between parenthesis. After each column, a\nprefix length can be specified. If no length is specified, the whole column\nwill be indexed. ASC and DESC can be specified for compatibility with are\nDBMS\'s, but have no meaning in MariaDB.\n\nWITH PARSER Index Option\n------------------------\n\nThe WITH PARSER index option only applies to FULLTEXT indexes and contains the\nfulltext parser name. The fulltext parser must be an installed plugin.\n\nCOMMENT Index Option\n--------------------\n\nA comment of up to 1024 characters is permitted with the COMMENT index option.\n\nThe COMMENT index option allows you to specify a comment with user-readable\ntext describing what the index is for. This information is not used by the\nserver itself.\n\nCLUSTERING Index Option\n-----------------------\n\nThe CLUSTERING index option is only valid for tables using the TokuDB storage\nengine.\n\nIGNORED / NOT IGNORED\n---------------------\n\nMariaDB starting with 10.6.0\n----------------------------\nFrom MariaDB 10.6.0, indexes can be specified to be ignored by the optimizer.\nSee Ignored Indexes.\n\nPeriods\n-------\n\nMariaDB starting with 10.3.4\n----------------------------\n\nperiod_definition:\n  PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)\nMariaDB supports a subset of the standard syntax for periods. At the moment\nit\'s only used for creating System-versioned tables. Both columns must be\ncreated, must be either of a TIMESTAMP(6) or BIGINT UNSIGNED type, and be\ngenerated as ROW START and ROW END accordingly. See System-versioned tables\nfor details.\n\nThe table must also have the WITH SYSTEM VERSIONING clause.\n\nConstraint Expressions\n----------------------\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 introduced new ways to define a constraint.\n\nNote: Before MariaDB 10.2.1, constraint expressions were accepted in the\nsyntax but ignored.\n\nMariaDB 10.2.1 introduced two ways to define a constraint:\n\n* CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraints fails, then the row will not be\nupdated. One can use most deterministic functions in a constraint, including\nUDFs.\n\ncreate table t1 (a int check(a>0) ,b int check (b> 0), constraint abc check\n(a>b));\n\nIf you use the second format and you don\'t give a name to the constraint, then\nthe constraint will get a auto generated name. This is done so that you can\nlater delete the constraint with ALTER TABLE DROP constraint_name.\n\nOne can disable all constraint expression checks by setting the variable\ncheck_constraint_checks to OFF. This is useful for example when loading a\ntable that violates some constraints that you want to later find and fix in\nSQL.\n\nSee CONSTRAINT for more information.\n\nTable Options\n-------------\n\nFor each individual table you create (or alter), you can set some table\noptions. The general syntax for setting options is:\n\n<OPTION_NAME> = <option_value>, [<OPTION_NAME> = <option_value> ...]\n\nThe equal sign is optional.\n\nSome options are supported by the server and can be used for all tables, no\nmatter what storage engine they use; other options can be specified for all\nstorage engines, but have a meaning only for some engines. Also, engines can\nextend CREATE TABLE with new options.\n\nIf the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is enabled, wrong table options\ngenerate a warning; otherwise, they generate an error.\n\ntable_option:    \n  [STORAGE] ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTED [=] {YES | NO}\n | ENCRYPTION_KEY_ID [=] value\n | IETF_QUOTES [=] {YES | NO}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PAGE_CHECKSUM [=] {0 | 1}\n | PAGE_COMPRESSED [=] {0 | 1}\n | PAGE_COMPRESSION_LEVEL [=] {0 .. 9}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT|PAGE}\n | SEQUENCE [=] {0|1}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] {DEFAULT|value}\n | TABLESPACE tablespace_name\n | TRANSACTIONAL [=]  {0 | 1}\n | UNION [=] (tbl_name[,tbl_name]...)\n | WITH SYSTEM VERSIONING\n\n[STORAGE] ENGINE\n----------------\n\n[STORAGE] ENGINE specifies a storage engine for the table. If this option is\nnot used, the default storage engine is used instead. That is, the\ndefault_storage_engine session option value if it is set, or the value\nspecified for the --default-storage-engine mysqld startup option, or the\ndefault storage engine, InnoDB. If the specified storage engine is not\ninstalled and active, the default value will be used, unless the\nNO_ENGINE_SUBSTITUTION SQL MODE is set (default). This is only true for CREATE\nTABLE, not for ALTER TABLE. For a list of storage engines that are present in\nyour server, issue a SHOW ENGINES.\n\nAUTO_INCREMENT\n--------------\n\nAUTO_INCREMENT specifies the initial value for the AUTO_INCREMENT primary key.\nThis works for MyISAM, Aria, InnoDB, MEMORY, and ARCHIVE tables. You can\nchange this option with ALTER TABLE, but in that case the new value must be\nhigher than the highest value which is present in the AUTO_INCREMENT column.\nIf the storage engine does not support this option, you can insert (and then\ndelete) a row having the wanted value - 1 in the AUTO_INCREMENT column.\n\nAVG_ROW_LENGTH\n--------------\n\nAVG_ROW_LENGTH is the average rows size. It only applies to tables using\nMyISAM and Aria storage engines that have the ROW_FORMAT table option set to\nFIXED format.\n\nMyISAM uses MAX_ROWS and AVG_ROW_LENGTH to decide the maximum size of a table\n(default: 256TB, or the maximum file size allowed by the system).\n\n[DEFAULT] CHARACTER SET/CHARSET\n-------------------------------\n\n[DEFAULT] CHARACTER SET (or [DEFAULT] CHARSET) is used to set a default\ncharacter set for the table. This is the character set used for all columns\nwhere an explicit character set is not specified. If this option is omitted or\nDEFAULT is specified, database\'s default character set will be used. See\nSetting Character Sets and Collations for details on setting the character\nsets.\n\nCHECKSUM/TABLE_CHECKSUM\n-----------------------\n\nCHECKSUM (or TABLE_CHECKSUM) can be set to 1 to maintain a live checksum for\nall table\'s rows. This makes write operations slower, but CHECKSUM TABLE will\nbe very fast. This option is only supported for MyISAM and Aria tables.\n\n[DEFAULT] COLLATE\n-----------------\n\n[DEFAULT] COLLATE is used to set a default collation for the table. This is\nthe collation used for all columns where an explicit character set is not\nspecified. If this option is omitted or DEFAULT is specified, database\'s') WHERE help_topic_id = 700;
update help_topic set description = CONCAT(description, '\ndefault option will be used. See Setting Character Sets and Collations for\ndetails on setting the collations\n\nCOMMENT\n-------\n\nCOMMENT is a comment for the table. The maximum length is 2048 characters.\nAlso used to define table parameters when creating a Spider table.\n\nCONNECTION\n----------\n\nCONNECTION is used to specify a server name or a connection string for a\nSpider, CONNECT, Federated or FederatedX table.\n\nDATA DIRECTORY/INDEX DIRECTORY\n------------------------------\n\nDATA DIRECTORY and INDEX DIRECTORY are supported for MyISAM and Aria, and DATA\nDIRECTORY is also supported by InnoDB if the innodb_file_per_table server\nsystem variable is enabled, but only in CREATE TABLE, not in ALTER TABLE. So,\ncarefully choose a path for InnoDB tables at creation time, because it cannot\nbe changed without dropping and re-creating the table. These options specify\nthe paths for data files and index files, respectively. If these options are\nomitted, the database\'s directory will be used to store data files and index\nfiles. Note that these table options do not work for partitioned tables (use\nthe partition options instead), or if the server has been invoked with the\n--skip-symbolic-links startup option. To avoid the overwriting of old files\nwith the same name that could be present in the directories, you can use the\n--keep_files_on_create option (an error will be issued if files already\nexist). These options are ignored if the NO_DIR_IN_CREATE SQL_MODE is enabled\n(useful for replication slaves). Also note that symbolic links cannot be used\nfor InnoDB tables.\n\nDATA DIRECTORY works by creating symlinks from where the table would normally\nhave been (inside the datadir) to where the option specifies. For security\nreasons, to avoid bypassing the privilege system, the server does not permit\nsymlinks inside the datadir. Therefore, DATA DIRECTORY cannot be used to\nspecify a location inside the datadir. An attempt to do so will result in an\nerror 1210 (HY000) Incorrect arguments to DATA DIRECTORY.\n\nDELAY_KEY_WRITE\n---------------\n\nDELAY_KEY_WRITE is supported by MyISAM and Aria, and can be set to 1 to speed\nup write operations. In that case, when data are modified, the indexes are not\nupdated until the table is closed. Writing the changes to the index file\naltogether can be much faster. However, note that this option is applied only\nif the delay_key_write server variable is set to \'ON\'. If it is \'OFF\' the\ndelayed index writes are always disabled, and if it is \'ALL\' the delayed index\nwrites are always used, disregarding the value of DELAY_KEY_WRITE.\n\nENCRYPTED\n---------\n\nThe ENCRYPTED table option can be used to manually set the encryption status\nof an InnoDB table. See InnoDB Encryption for more information.\n\nAria does not support the ENCRYPTED table option. See MDEV-18049.\n\nSee Data-at-Rest Encryption for more information.\n\nENCRYPTION_KEY_ID\n-----------------\n\nThe ENCRYPTION_KEY_ID table option can be used to manually set the encryption\nkey of an InnoDB table. See InnoDB Encryption for more information.\n\nAria does not support the ENCRYPTION_KEY_ID table option. See MDEV-18049.\n\nSee Data-at-Rest Encryption for more information.\n\nIETF_QUOTES\n-----------\n\nFor the CSV storage engine, the IETF_QUOTES option, when set to YES, enables\nIETF-compatible parsing of embedded quote and comma characters. Enabling this\noption for a table improves compatibility with other tools that use CSV, but\nis not compatible with MySQL CSV tables, or MariaDB CSV tables created without\nthis option. Disabled by default.\n\nINSERT_METHOD\n-------------\n\nINSERT_METHOD is only used with MERGE tables. This option determines in which\nunderlying table the new rows should be inserted. If you set it to \'NO\' (which\nis the default) no new rows can be added to the table (but you will still be\nable to perform INSERTs directly against the underlying tables). FIRST means\nthat the rows are inserted into the first table, and LAST means that thet are\ninserted into the last table.\n\nKEY_BLOCK_SIZE\n--------------\n\nKEY_BLOCK_SIZE is used to determine the size of key blocks, in bytes or\nkilobytes. However, this value is just a hint, and the storage engine could\nmodify or ignore it. If KEY_BLOCK_SIZE is set to 0, the storage engine\'s\ndefault value will be used.\n\nWith the InnoDB storage engine, if you specify a non-zero value for the\nKEY_BLOCK_SIZE table option for the whole table, then the table will\nimplicitly be created with the ROW_FORMAT table option set to COMPRESSED.\n\nMIN_ROWS/MAX_ROWS\n-----------------\n\nMIN_ROWS and MAX_ROWS let the storage engine know how many rows you are\nplanning to store as a minimum and as a maximum. These values will not be used\nas real limits, but they help the storage engine to optimize the table.\nMIN_ROWS is only used by MEMORY storage engine to decide the minimum memory\nthat is always allocated. MAX_ROWS is used to decide the minimum size for\nindexes.\n\nPACK_KEYS\n---------\n\nPACK_KEYS can be used to determine whether the indexes will be compressed. Set\nit to 1 to compress all keys. With a value of 0, compression will not be used.\nWith the DEFAULT value, only long strings will be compressed. Uncompressed\nkeys are faster.\n\nPAGE_CHECKSUM\n-------------\n\nPAGE_CHECKSUM is only applicable to Aria tables, and determines whether\nindexes and data should use page checksums for extra safety.\n\nPAGE_COMPRESSED\n---------------\n\nPAGE_COMPRESSED is used to enable InnoDB page compression for InnoDB tables.\n\nPAGE_COMPRESSION_LEVEL\n----------------------\n\nPAGE_COMPRESSION_LEVEL is used to set the compression level for InnoDB page\ncompression for InnoDB tables. The table must also have the PAGE_COMPRESSED\ntable option set to 1.\n\nValid values for PAGE_COMPRESSION_LEVEL are 1 (the best speed) through 9 (the\nbest compression), .\n\nPASSWORD\n--------\n\nPASSWORD is unused.\n\nRAID_TYPE\n---------\n\nRAID_TYPE is an obsolete option, as the raid support has been disabled since\nMySQL 5.0.\n\nROW_FORMAT\n----------\n\nThe ROW_FORMAT table option specifies the row format for the data file.\nPossible values are engine-dependent.\n\nSupported MyISAM Row Formats\n----------------------------\n\nFor MyISAM, the supported row formats are:\n\n* FIXED\n* DYNAMIC\n* COMPRESSED\n\nThe COMPRESSED row format can only be set by the myisampack command line tool.\n\nSee MyISAM Storage Formats for more information.\n\nSupported Aria Row Formats\n--------------------------\n\nFor Aria, the supported row formats are:\n\n* PAGE\n* FIXED\n* DYNAMIC.\n\nSee Aria Storage Formats for more information.\n\nSupported InnoDB Row Formats\n----------------------------\n\nFor InnoDB, the supported row formats are:\n\n* COMPACT\n* REDUNDANT\n* COMPRESSED\n* DYNAMIC.\n\nIf the ROW_FORMAT table option is set to FIXED for an InnoDB table, then the\nserver will either return an error or a warning depending on the value of the\ninnodb_strict_mode system variable. If the innodb_strict_mode system variable\nis set to OFF, then a warning is issued, and MariaDB will create the table\nusing the default row format for the specific MariaDB server version. If the\ninnodb_strict_mode system variable is set to ON, then an error will be raised.\n\nSee InnoDB Storage Formats for more information.\n\nOther Storage Engines and ROW_FORMAT\n------------------------------------\n\nOther storage engines do not support the ROW_FORMAT table option.\n\nSEQUENCE\n--------\n\nMariaDB starting with 10.3\n--------------------------\nIf the table is a sequence, then it will have the SEQUENCE set to 1.\n\nSTATS_AUTO_RECALC\n-----------------\n\nSTATS_AUTO_RECALC indicates whether to automatically recalculate persistent\nstatistics (see STATS_PERSISTENT, below) for an InnoDB table. If set to 1,\nstatistics will be recalculated when more than 10% of the data has changed.\nWhen set to 0, stats will be recalculated only when an ANALYZE TABLE is run.\nIf set to DEFAULT, or left out, the value set by the innodb_stats_auto_recalc\nsystem variable applies. See InnoDB Persistent Statistics.\n\nSTATS_PERSISTENT\n----------------\n\nSTATS_PERSISTENT indicates whether the InnoDB statistics created by ANALYZE\nTABLE will remain on disk or not. It can be set to 1 (on disk), 0 (not on\ndisk, the pre-MariaDB 10 behavior), or DEFAULT (the same as leaving out the\noption), in which case the value set by the innodb_stats_persistent system\nvariable will apply. Persistent statistics stored on disk allow the statistics\nto survive server restarts, and provide better query plan stability. See\nInnoDB Persistent Statistics.\n\nSTATS_SAMPLE_PAGES\n------------------\n\nSTATS_SAMPLE_PAGES indicates how many pages are used to sample index\nstatistics. If 0 or DEFAULT, the default value, the innodb_stats_sample_pages\nvalue is used. See InnoDB Persistent Statistics.\n\nTRANSACTIONAL\n-------------\n\nTRANSACTIONAL is only applicable for Aria tables. In future Aria tables\ncreated with this option will be fully transactional, but currently this\nprovides a form of crash protection. See Aria Storage Engine for more details.\n\nUNION\n-----\n\nUNION must be specified when you create a MERGE table. This option contains a\ncomma-separated list of MyISAM tables which are accessed by the new table. The\nlist is enclosed between parenthesis. Example: UNION = (t1,t2)\n\nWITH SYSTEM VERSIONING\n----------------------\n\nWITH SYSTEM VERSIONING is used for creating System-versioned tables.\n\nPartitions\n----------\n\npartition_options:\n  PARTITION BY\n    { [LINEAR] HASH(expr)\n    | [LINEAR] KEY(column_list)\n    | RANGE(expr)\n    | LIST(expr)\n    | SYSTEM_TIME [INTERVAL time_quantity time_unit] [LIMIT num] }\n  [PARTITIONS num]\n  [SUBPARTITION BY\n    { [LINEAR] HASH(expr)\n    | [LINEAR] KEY(column_list) }\n   [SUBPARTITIONS num]\n  ]\n  [(partition_definition [, partition_definition] ...)]\npartition_definition:\n  PARTITION partition_name\n    [VALUES {LESS THAN {(expr) | MAXVALUE} | IN (value_list)}]\n    [[STORAGE] ENGINE [=] engine_name]\n    [COMMENT [=] \'comment_text\' ]\n    [DATA DIRECTORY [=] \'data_dir\']\n    [INDEX DIRECTORY [=] \'index_dir\']\n    [MAX_ROWS [=] max_number_of_rows]\n    [MIN_ROWS [=] min_number_of_rows]\n    [TABLESPACE [=] tablespace_name]\n    [NODEGROUP [=] node_group_id]\n    [(subpartition_definition [, subpartition_definition] ...)]\nsubpartition_definition:\n  SUBPARTITION logical_name\n    [[STORAGE] ENGINE [=] engine_name]\n    [COMMENT [=] \'comment_text\' ]\n    [DATA DIRECTORY [=] \'data_dir\']\n    [INDEX DIRECTORY [=] \'index_dir\']\n    [MAX_ROWS [=] max_number_of_rows]\n    [MIN_ROWS [=] min_number_of_rows]\n    [TABLESPACE [=] tablespace_name]\n    [NODEGROUP [=] node_group_id]\nIf the PARTITION BY clause is used, the table will be partitioned. A partition\nmethod must be explicitly indicated for partitions and subpartitions.\nPartition methods are:\n\n* [LINEAR] HASH creates a hash key which will be used to read and write rows.\nThe partition function can be any valid SQL expression which returns an\nINTEGER number. Thus, it is possible to use the HASH method on an integer\ncolumn, or on functions which accept integer columns as an argument. However,\nVALUES LESS THAN and VALUES IN clauses can not be used with HASH. An example:\n\nCREATE TABLE t1 (a INT, b CHAR(5), c DATETIME)\n  PARTITION BY HASH ( YEAR(c) );\n\n[LINEAR] HASH can be used for subpartitions, too.\n\n* [LINEAR] KEY is similar to HASH, but the index has an even distribution of\ndata. Also, the expression can only be a column or a list of columns. VALUES\nLESS THAN and VALUES IN clauses can not be used with KEY.\n* RANGE partitions the rows using on a range of values, using the VALUES LESS\nTHAN operator. VALUES IN is not allowed with RANGE. The partition function can\nbe any valid SQL expression which returns a single value.\n* LIST assigns partitions based on a table\'s column with a restricted set of\npossible values. It is similar to RANGE, but VALUES IN must be used for at\nleast 1 columns, and VALUES LESS THAN is disallowed.\n* SYSTEM_TIME partitioning is used for System-versioned tables to store\nhistorical data separately from current data.\n\nOnly HASH and KEY can be used for subpartitions, and they can be [LINEAR].\n\nIt is possible to define up to 1024 partitions and subpartitions.\n\nThe number of defined partitions can be optionally specified as PARTITION\ncount. This can be done to avoid specifying all partitions individually. But\nyou can also declare each individual partition and, additionally, specify a\nPARTITIONS count clause; in the case, the number of PARTITIONs must equal\ncount.\n\nAlso see Partitioning Types Overview.\n\nSequences\n---------\n\nMariaDB starting with 10.3\n--------------------------\nCREATE TABLE can also be used to create a SEQUENCE. See CREATE SEQUENCE and\nSequence Overview.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL. CREATE TABLE is atomic, except for CREATE\nOR REPLACE, which is only crash safe.\n\nExamples\n--------\n\ncreate table if not exists test (\na bigint auto_increment primary key,\nname varchar(128) charset utf8,\nkey name (name(32))\n) engine=InnoDB default charset latin1;\n\nThis example shows a couple of things:\n\n* Usage of IF NOT EXISTS; If the table already existed, it will not be\ncreated.  There will not be any error for the client, just a warning.\n* How to create a PRIMARY KEY that is automatically generated.\n* How to specify a table-specific character set and another for a column.\n* How to create an index (name) that is only partly indexed (to save space).\n\nThe following clauses will work from MariaDB 10.2.1 only.\n\nCREATE TABLE t1(\n a int DEFAULT (1+1),\n b int DEFAULT (a+1),\n expires DATETIME DEFAULT(NOW() + INTERVAL 1 YEAR),\n x BLOB DEFAULT USER()\n);\n\nURL: https://mariadb.com/kb/en/create-table/') WHERE help_topic_id = 700;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (701,38,'DROP TABLE','Syntax\n------\n\nDROP [TEMPORARY] TABLE [IF EXISTS] [/*COMMENT TO SAVE*/]\n  tbl_name [, tbl_name] ...\n  [WAIT n|NOWAIT]\n  [RESTRICT | CASCADE]\n\nDescription\n-----------\n\nDROP TABLE removes one or more tables. You must have the DROP privilege for\neach table. All table data and the table definition are removed, as well as\ntriggers associated to the table, so be careful with this statement! If any of\nthe tables named in the argument list do not exist, MariaDB returns an error\nindicating by name which non-existing tables it was unable to drop, but it\nalso drops all of the tables in the list that do exist.\n\nImportant: When a table is dropped, user privileges on the table are not\nautomatically dropped. See GRANT.\n\nIf another thread is using the table in an explicit transaction or an\nautocommit transaction, then the thread acquires a metadata lock (MDL) on the\ntable. The DROP TABLE statement will wait in the \"Waiting for table metadata\nlock\" thread state until the MDL is released. MDLs are released in the\nfollowing cases:\n\n* If an MDL is acquired in an explicit transaction, then the MDL will be\nreleased when the transaction ends.\n* If an MDL is acquired in an autocommit transaction, then the MDL will be\nreleased when the statement ends.\n* Transactional and non-transactional tables are handled the same.\n\nNote that for a partitioned table, DROP TABLE permanently removes the table\ndefinition, all of its partitions, and all of the data which was stored in\nthose partitions. It also removes the partitioning definition (.par) file\nassociated with the dropped table.\n\nFor each referenced table, DROP TABLE drops a temporary table with that name,\nif it exists. If it does not exist, and the TEMPORARY keyword is not used, it\ndrops a non-temporary table with the same name, if it exists. The TEMPORARY\nkeyword ensures that a non-temporary table will not accidentally be dropped.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not exist.\nA NOTE is generated for each non-existent table when using IF EXISTS. See SHOW\nWARNINGS.\n\nIf a foreign key references this table, the table cannot be dropped. In this\ncase, it is necessary to drop the foreign key first.\n\nRESTRICT and CASCADE are allowed to make porting from other database systems\neasier. In MariaDB, they do nothing.\n\nThe comment before the table names (/*COMMENT TO SAVE*/) is stored in the\nbinary log. That feature can be used by replication tools to send their\ninternal messages.\n\nIt is possible to specify table names as db_name.tab_name. This is useful to\ndelete tables from multiple databases with one statement. See Identifier\nQualifiers for details.\n\nThe DROP privilege is required to use DROP TABLE on non-temporary tables. For\ntemporary tables, no privilege is required, because such tables are only\nvisible for the current session.\n\nNote: DROP TABLE automatically commits the current active transaction, unless\nyou use the TEMPORARY keyword.\n\nMariaDB starting with 10.5.4\n----------------------------\nFrom MariaDB 10.5.4, DROP TABLE reliably deletes table remnants inside a\nstorage engine even if the .frm file is missing. Before then, a missing .frm\nfile would result in the statement failing.\n\nMariaDB starting with 10.3.1\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nDROP TABLE in replication\n-------------------------\n\nDROP TABLE has the following characteristics in replication:\n\n* DROP TABLE IF EXISTS are always logged.\n* DROP TABLE without IF EXISTS for tables that don\'t exist are not written to\nthe binary log.\n* Dropping of TEMPORARY tables are prefixed in the log with TEMPORARY. These\ndrops are only logged when running statement or mixed mode replication.\n* One DROP TABLE statement can be logged with up to 3 different DROP\nstatements:\nDROP TEMPORARY TABLE list_of_non_transactional_temporary_tables\nDROP TEMPORARY TABLE list_of_transactional_temporary_tables\nDROP TABLE list_of_normal_tables\n\nDROP TABLE on the primary is treated on the replica as DROP TABLE IF EXISTS.\nYou can change that by setting slave-ddl-exec-mode to STRICT.\n\nDropping an Internal #sql-... Table\n-----------------------------------\n\nFrom MariaDB 10.6, DROP TABLE is atomic and the following does not apply.\nUntil MariaDB 10.5, if the mariadbd/mysqld process is killed during an ALTER\nTABLE you may find a table named #sql-... in your data directory. In MariaDB\n10.3, InnoDB tables with this prefix will be deleted automatically during\nstartup. From MariaDB 10.4, these temporary tables will always be deleted\nautomatically.\n\nIf you want to delete one of these tables explicitly you can do so by using\nthe following syntax:\n\nDROP TABLE `#mysql50##sql-...`;\n\nWhen running an ALTER TABLE…ALGORITHM=INPLACE that rebuilds the table, InnoDB\nwill create an internal #sql-ib table. Until MariaDB 10.3.2, for these tables,\nthe .frm file will be called something else. In order to drop such a table\nafter a server crash, you must rename the #sql*.frm file to match the\n#sql-ib*.ibd file.\n\nFrom MariaDB 10.3.3, the same name as the .frm file is used for the\nintermediate copy of the table. The #sql-ib names are used by TRUNCATE and\ndelayed DROP.\n\nFrom MariaDB 10.2.19 and MariaDB 10.3.10, the #sql-ib tables will be deleted\nautomatically.\n\nDropping All Tables in a Database\n---------------------------------\n\nThe best way to drop all tables in a database is by executing DROP DATABASE,\nwhich will drop the database itself, and all tables in it.\n\nHowever, if you want to drop all tables in the database, but you also want to\nkeep the database itself and any other non-table objects in it, then you would\nneed to execute DROP TABLE to drop each individual table. You can construct\nthese DROP TABLE commands by querying the TABLES table in the\ninformation_schema database. For example:\n\nSELECT CONCAT(\'DROP TABLE IF EXISTS `\', TABLE_SCHEMA, \'`.`\', TABLE_NAME, \'`;\')\nFROM information_schema.TABLES\nWHERE TABLE_SCHEMA = \'mydb\';\n\nAtomic DROP TABLE\n-----------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, DROP TABLE for a single table is atomic (MDEV-25180) for\nmost engines, including InnoDB, MyRocks, MyISAM and Aria.\n\nThis means that if there is a crash (server down or power outage) during DROP\nTABLE, all tables that have been processed so far will be completely dropped,\nincluding related trigger files and status entries, and the binary log will\ninclude a DROP TABLE statement for the dropped tables. Tables for which the\ndrop had not started will be left intact.\n\nIn older MariaDB versions, there was a small chance that, during a server\ncrash happening in the middle of DROP TABLE, some storage engines that were\nusing multiple storage files, like MyISAM, could have only a part of its\ninternal files dropped.\n\nIn MariaDB 10.5, DROP TABLE was extended to be able to delete a table that was\nonly partly dropped (MDEV-11412) as explained above. Atomic DROP TABLE is the\nfinal piece to make DROP TABLE fully reliable.\n\nDropping multiple tables is crash-safe.\n\nSee Atomic DDL for more information.\n\nExamples\n--------\n\nDROP TABLE Employees, Customers;\n\nNotes\n-----\n\nBeware that DROP TABLE can drop both tables and sequences. This is mainly done\nto allow old tools like mysqldump to work with sequences.\n\nURL: https://mariadb.com/kb/en/drop-table/','','https://mariadb.com/kb/en/drop-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (702,38,'RENAME TABLE','Syntax\n------\n\nRENAME TABLE[S] [IF EXISTS] tbl_name \n [WAIT n | NOWAIT]\n TO new_tbl_name\n  [, tbl_name2 TO new_tbl_name2] ...\n\nDescription\n-----------\n\nThis statement renames one or more tables or views, but not the privileges\nassociated with them.\n\nIF EXISTS\n---------\n\nMariaDB starting with 10.5.2\n----------------------------\nIf this directive is used, one will not get an error if the table to be\nrenamed doesn\'t exist.\n\nThe rename operation is done atomically, which means that no other session can\naccess any of the tables while the rename is running. For example, if you have\nan existing table old_table, you can create another table new_table that has\nthe same structure but is empty, and then replace the existing table with the\nempty one as follows (assuming that backup_table does not already exist):\n\nCREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n\ntbl_name can optionally be specified as db_name.tbl_name. See Identifier\nQualifiers. This allows to use RENAME to move a table from a database to\nanother (as long as they are on the same filesystem):\n\nRENAME TABLE db1.t TO db2.t;\n\nNote that moving a table to another database is not possible if it has some\ntriggers. Trying to do so produces the following error:\n\nERROR 1435 (HY000): Trigger in wrong schema\n\nAlso, views cannot be moved to another database:\n\nERROR 1450 (HY000): Changing schema from \'old_db\' to \'new_db\' is not allowed.\n\nMultiple tables can be renamed in a single statement. The presence or absence\nof the optional S (RENAME TABLE or RENAME TABLES) has no impact, whether a\nsingle or multiple tables are being renamed.\n\nIf a RENAME TABLE renames more than one table and one renaming fails, all\nrenames executed by the same statement are rolled back.\n\nRenames are always executed in the specified order. Knowing this, it is also\npossible to swap two tables\' names:\n\nRENAME TABLE t1 TO tmp_table,\n  t2 TO t1,\n  tmp_table TO t2;\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nPrivileges\n----------\n\nExecuting the RENAME TABLE statement requires the DROP, CREATE and INSERT\nprivileges for the table or the database.\n\nAtomic RENAME TABLE\n-------------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, RENAME TABLE is atomic for most engines, including InnoDB,\nMyRocks, MyISAM and Aria (MDEV-23842). This means that if there is a crash\n(server down or power outage) during RENAME TABLE, all tables will revert to\ntheir original names and any changes to trigger files will be reverted.\n\nIn older MariaDB version there was a small chance that, during a server crash\nhappening in the middle of RENAME TABLE, some tables could have been renamed\n(in the worst case partly) while others would not be renamed.\n\nSee Atomic DDL for more information.\n\nURL: https://mariadb.com/kb/en/rename-table/','','https://mariadb.com/kb/en/rename-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (703,38,'TRUNCATE TABLE','Syntax\n------\n\nTRUNCATE [TABLE] tbl_name\n [WAIT n | NOWAIT]\n\nDescription\n-----------\n\nTRUNCATE TABLE empties a table completely. It requires the DROP privilege. See\nGRANT.\n\ntbl_name can also be specified in the form db_name.tbl_name (see Identifier\nQualifiers).\n\nLogically, TRUNCATE TABLE is equivalent to a DELETE statement that deletes all\nrows, but there are practical differences under some circumstances.\n\nTRUNCATE TABLE will fail for an InnoDB table if any FOREIGN KEY constraints\nfrom other tables reference the table, returning the error:\n\nERROR 1701 (42000): Cannot truncate a table referenced in a foreign key\nconstraint\n\nForeign Key constraints between columns in the same table are permitted.\n\nFor an InnoDB table, if there are no FOREIGN KEY constraints, InnoDB performs\nfast truncation by dropping the original table and creating an empty one with\nthe same definition, which is much faster than deleting rows one by one. The\nAUTO_INCREMENT counter is reset by TRUNCATE TABLE, regardless of whether there\nis a FOREIGN KEY constraint.\n\nThe count of rows affected by TRUNCATE TABLE is accurate only when it is\nmapped to a DELETE statement.\n\nFor other storage engines, TRUNCATE TABLE differs from DELETE in the following\nways:\n\n* Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n* Truncate operations cause an implicit commit.\n* Truncation operations cannot be performed if the session holds an\n active table lock.\n* Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is \"0 rows affected,\" which should\n be interpreted as \"no information.\"\n* As long as the table format file tbl_name.frm is valid, the\n table can be re-created as an empty table\n with TRUNCATE TABLE, even if the data or index files have become\n corrupted.\n* The table handler does not remember the last\n used AUTO_INCREMENT value, but starts counting\n from the beginning. This is true even for MyISAM and InnoDB, which normally\n do not reuse sequence values.\n* When used with partitioned tables, TRUNCATE TABLE preserves\n the partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n* Since truncation of a table does not make any use of DELETE,\n the TRUNCATE statement does not invoke ON DELETE triggers.\n* TRUNCATE TABLE will only reset the values in the Performance Schema summary\ntables to zero or null, and will not remove the rows.\n\nFor the purposes of binary logging and replication, TRUNCATE TABLE is treated\nas DROP TABLE followed by CREATE TABLE (DDL rather than DML).\n\nTRUNCATE TABLE does not work on views. Currently, TRUNCATE TABLE drops all\nhistorical records from a system-versioned table.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nOracle-mode\n-----------\n\nOracle-mode from MariaDB 10.3 permits the optional keywords REUSE STORAGE or\nDROP STORAGE to be used.\n\nTRUNCATE [TABLE] tbl_name [{DROP | REUSE} STORAGE] [WAIT n | NOWAIT]\n\nThese have no effect on the operation.\n\nPerformance\n-----------\n\nTRUNCATE TABLE is faster than DELETE, because it drops and re-creates a table.\n\nWith InnoDB, TRUNCATE TABLE is slower if innodb_file_per_table=ON is set (the\ndefault). This is because TRUNCATE TABLE unlinks the underlying tablespace\nfile, which can be an expensive operation. See MDEV-8069 for more details.\n\nThe performance issues with innodb_file_per_table=ON can be exacerbated in\ncases where the InnoDB buffer pool is very large and\ninnodb_adaptive_hash_index=ON is set. In that case, using DROP TABLE followed\nby CREATE TABLE instead of TRUNCATE TABLE may perform better. Setting\ninnodb_adaptive_hash_index=OFF (it defaults to ON before MariaDB 10.5) can\nalso help. In MariaDB 10.2 only, from MariaDB 10.2.19, this performance can\nalso be improved by setting innodb_safe_truncate=OFF. See MDEV-9459 for more\ndetails.\n\nSetting innodb_adaptive_hash_index=OFF can also improve TRUNCATE TABLE\nperformance in general. See MDEV-16796 for more details.\n\nURL: https://mariadb.com/kb/en/truncate-table/','','https://mariadb.com/kb/en/truncate-table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (704,38,'CREATE DATABASE','Syntax\n------\n\nCREATE [OR REPLACE] {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n  [create_specification] ...\n\ncreate_specification:\n  [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'comment\'\n\nDescription\n-----------\n\nCREATE DATABASE creates a database with the given name. To use this statement,\nyou need the CREATE privilege for the database. CREATE SCHEMA is a synonym for\nCREATE DATABASE.\n\nFor valid identifiers to use as database names, see Identifier Names.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.3\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP DATABASE IF EXISTS db_name;\nCREATE DATABASE db_name ...;\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified database already exists.\n\nCOMMENT\n-------\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024\nbytes. If the comment length exceeds this length, a error/warning code 4144 is\nthrown. The database comment is also added to the db.opt file, as well as to\nthe information_schema.schemata table.\n\nExamples\n--------\n\nCREATE DATABASE db1;\nQuery OK, 1 row affected (0.18 sec)\n\nCREATE DATABASE db1;\nERROR 1007 (HY000): Can\'t create database \'db1\'; database exists\n\nCREATE OR REPLACE DATABASE db1;\nQuery OK, 2 rows affected (0.00 sec)\n\nCREATE DATABASE IF NOT EXISTS db1;\nQuery OK, 1 row affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------+\n| Level | Code | Message                                      |\n+-------+------+----------------------------------------------+\n| Note  | 1007 | Can\'t create database \'db1\'; database exists |\n+-------+------+----------------------------------------------+\n\nSetting the character sets and collation. See Setting Character Sets and\nCollations for more details.\n\nCREATE DATABASE czech_slovak_names \n CHARACTER SET = \'keybcs2\'\n COLLATE = \'keybcs2_bin\';\n\nComments, from MariaDB 10.5.0:\n\nCREATE DATABASE presentations COMMENT \'Presentations for conferences\';\n\nURL: https://mariadb.com/kb/en/create-database/','','https://mariadb.com/kb/en/create-database/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (705,38,'CREATE EVENT','Syntax\n------\n\nCREATE [OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  EVENT\n  [IF NOT EXISTS]\n  event_name\n  ON SCHEDULE schedule\n  [ON COMPLETION [NOT] PRESERVE]\n  [ENABLE | DISABLE | DISABLE ON SLAVE]\n  [COMMENT \'comment\']\n  DO sql_statement;\n\nschedule:\n  AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n  [STARTS timestamp [+ INTERVAL interval] ...]\n  [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n  quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n       WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n       DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nDescription\n-----------\n\nThis statement creates and schedules a new event. It requires the EVENT\nprivilege for the schema in which the event is to be created.\n\nThe minimum requirements for a valid CREATE EVENT statement are as follows:\n\n* The keywords CREATE EVENT plus an event name, which uniquely identifies\n the event in the current schema. (Prior to MySQL 5.1.12, the event name\n needed to be unique only among events created by the same user on a given\n database.)\n* An ON SCHEDULE clause, which determines when and how often the event\n executes.\n* A DO clause, which contains the SQL statement to be executed by an\n event.\n\nHere is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event executes\nonce — one hour following its creation — by running an SQL statement that\nincrements the value of the myschema.mytable table\'s mycol column by 1.\n\nThe event_name must be a valid MariaDB identifier with a maximum length of 64\ncharacters. It may be delimited using back ticks, and may be qualified with\nthe name of a database schema. An event is associated with both a MariaDB user\n(the definer) and a schema, and its name must be unique among names of events\nwithin that schema. In general, the rules governing event names are the same\nas those for names of stored routines. See Identifier Names.\n\nIf no schema is indicated as part of event_name, the default (current) schema\nis assumed.\n\nFor valid identifiers to use as event names, see Identifier Names.\n\nOR REPLACE\n----------\n\nThe OR REPLACE clause was included in MariaDB 10.1.4. If used and the event\nalready exists, instead of an error being returned, the existing event will be\ndropped and replaced by the newly defined event.\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the event already exists. Cannot be used together with OR REPLACE.\n\nON SCHEDULE\n-----------\n\nThe ON SCHEDULE clause can be used to specify when the event must be triggered.\n\nAT\n--\n\nIf you want to execute the event only once (one time event), you can use the\nAT keyword, followed by a timestamp. If you use CURRENT_TIMESTAMP, the event\nacts as soon as it is created. As a convenience, you can add one or more\nintervals to that timestamp. You can also specify a timestamp in the past, so\nthat the event is stored but not triggered, until you modify it via ALTER\nEVENT.\n\nThe following example shows how to create an event that will be triggered\ntomorrow at a certain time:\n\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n\nYou can also specify that an event must be triggered at a regular interval\n(recurring event). In such cases, use the EVERY clause followed by the\ninterval.\n\nIf an event is recurring, you can specify when the first execution must happen\nvia the STARTS clause and a maximum time for the last execution via the ENDS\nclause. STARTS and ENDS clauses are followed by a timestamp and, optionally,\none or more intervals. The ENDS clause can specify a timestamp in the past, so\nthat the event is stored but not executed until you modify it via ALTER EVENT.\n\nIn the following example, next month a recurring event will be triggered\nhourly for a week:\n\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n\nIntervals consist of a quantity and a time unit. The time units are the same\nused for other staments and time functions, except that you can\'t use\nmicroseconds for events. For simple time units, like HOUR or MINUTE, the\nquantity is an integer number, for example \'10 MINUTE\'. For composite time\nunits, like HOUR_MINUTE or HOUR_SECOND, the quantity must be a string with all\ninvolved simple values and their separators, for example \'2:30\' or \'2:30:30\'.\n\nON COMPLETION [NOT] PRESERVE\n----------------------------\n\nThe ON COMPLETION clause can be used to specify if the event must be deleted\nafter its last execution (that is, after its AT or ENDS timestamp is past). By\ndefault, events are dropped when they are expired. To explicitly state that\nthis is the desired behaviour, you can use ON COMPLETION NOT PRESERVE.\nInstead, if you want the event to be preserved, you can use ON COMPLETION\nPRESERVE.\n\nIn you specify ON COMPLETION NOT PRESERVE, and you specify a timestamp in the\npast for AT or ENDS clause, the event will be immediatly dropped. In such\ncases, you will get a Note 1558: \"Event execution time is in the past and ON\nCOMPLETION NOT PRESERVE is set. The event was dropped immediately after\ncreation\".\n\nENABLE/DISABLE/DISABLE ON SLAVE\n-------------------------------\n\nEvents are ENABLEd by default. If you want to stop MariaDB from executing an\nevent, you may specify DISABLE. When it is ready to be activated, you may\nenable it using ALTER EVENT. Another option is DISABLE ON SLAVE, which\nindicates that an event was created on a master and has been replicated to the\nslave, which is prevented from executing the event. If DISABLE ON SLAVE is\nspecifically set, the event will be disabled everywhere. It will not be\nexecuted on the mater or the slaves.\n\nCOMMENT\n-------\n\nThe COMMENT clause may be used to set a comment for the event. Maximum length\nfor comments is 64 characters. The comment is a string, so it must be quoted.\nTo see events comments, you can query the INFORMATION_SCHEMA.EVENTS table (the\ncolumn is named EVENT_COMMENT).\n\nExamples\n--------\n\nMinimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\n\nAn event that will be triggered tomorrow at a certain time:\n\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n\nNext month a recurring event will be triggered hourly for a week:\n\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\nERROR 1537 (HY000): Event \'myevent\' already exists\n\nCREATE OR REPLACE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;;\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE EVENT IF NOT EXISTS myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------------+\n| Level | Code | Message                        |\n+-------+------+--------------------------------+\n| Note  | 1537 | Event \'myevent\' already exists |\n+-------+------+--------------------------------+\n\nURL: https://mariadb.com/kb/en/create-event/','','https://mariadb.com/kb/en/create-event/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (706,38,'CREATE FUNCTION','Syntax\n------\n\nCREATE [OR REPLACE]\n  [DEFINER = {user | CURRENT_USER | role | CURRENT_ROLE }]\n  [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name ([func_parameter[,...]])\n  RETURNS type\n  [characteristic ...]\n  RETURN func_body\nfunc_parameter:\n  [ IN | OUT | INOUT | IN OUT ]  param_name type\ntype:\n  Any valid MariaDB data type\ncharacteristic:\n  LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\nfunc_body:\n  Valid SQL procedure statement\n\nDescription\n-----------\n\nUse the CREATE FUNCTION statement to create a new stored function. You must\nhave the CREATE ROUTINE database privilege to use CREATE FUNCTION. A function\ntakes any number of arguments and returns a value from the function body. The\nfunction body can be any valid SQL expression as you would use, for example,\nin any select expression. If you have the appropriate privileges, you can call\nthe function exactly as you would any built-in function. See Security below\nfor details on privileges.\n\nYou can also use a variant of the CREATE FUNCTION statement to install a\nuser-defined function (UDF) defined by a plugin. See CREATE FUNCTION (UDF) for\ndetails.\n\nYou can use a SELECT statement for the function body by enclosing it in\nparentheses, exactly as you would to use a subselect for any other expression.\nThe SELECT statement must return a single value. If more than one column is\nreturned when the function is called, error 1241 results. If more than one row\nis returned when the function is called, error 1242 results. Use a LIMIT\nclause to ensure only one row is returned.\n\nYou can also replace the RETURN clause with a BEGIN...END compound statement.\nThe compound statement must contain a RETURN statement. When the function is\ncalled, the RETURN statement immediately returns its result, and any\nstatements after RETURN are effectively ignored.\n\nBy default, a function is associated with the current database. To associate\nthe function explicitly with a given database, specify the fully-qualified\nname as db_name.func_name when you create it. If the function name is the same\nas the name of a built-in function, you must use the fully qualified name when\nyou call it.\n\nThe parameter list enclosed within parentheses must always be present. If\nthere are no parameters, an empty parameter list of () should be used.\nParameter names are not case sensitive.\n\nEach parameter can be declared to use any valid data type, except that the\nCOLLATE attribute cannot be used.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nIN | OUT | INOUT | IN OUT\n-------------------------\n\nMariaDB starting with 10.8.0\n----------------------------\nThe function parameter qualifiers for IN, OUT, INOUT, and IN OUT were added in\na 10.8.0 preview release. Prior to 10.8.0 quantifiers were supported only in\nprocedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and\nnot SELECT. These quantifiers are especially useful for creating functions\nwith more than one return value. This allows functions to be more complex and\nnested.\n\nDELIMITER $$\nCREATE FUNCTION add_func3(IN a INT, IN b INT, OUT c INT) RETURNS INT\nBEGIN\n SET c = 100;\n RETURN a + b;\nEND;\n$$\nDELIMITER ;\n\nSET @a = 2;\nSET @b = 3;\nSET @c = 0;\nSET @res= add_func3(@a, @b, @c);\n\nSELECT add_func3(@a, @b, @c);\nERROR 4186 (HY000): OUT or INOUT argument 3 for function add_func3 is not\nallowed here\n\nDELIMITER $$\nCREATE FUNCTION add_func4(IN a INT, IN b INT, d INT) RETURNS INT\nBEGIN\n DECLARE c, res INT;\n SET res = add_func3(a, b, c) + d;\n if (c > 99) then\n  return  3;\n else\n  return res;\n end if;\nEND;\n$$\n\nDELIMITER ;\n\nSELECT add_func4(1,2,3);\n+------------------+\n| add_func4(1,2,3) |\n+------------------+\n|                3 |\n+------------------+\n\nAGGREGATE\n---------\n\nMariaDB starting with 10.3.3\n----------------------------\nFrom MariaDB 10.3.3, it is possible to create stored aggregate functions as\nwell. See Stored Aggregate Functions for details.\n\nRETURNS\n-------\n\nThe RETURNS clause specifies the return type of the function. NULL values are\npermitted with all return types.\n\nWhat happens if the RETURN clause returns a value of a different type? It\ndepends on the SQL_MODE in effect at the moment of the function creation.\n\nIf the SQL_MODE is strict (STRICT_ALL_TABLES or STRICT_TRANS_TABLES flags are\nspecified), a 1366 error will be produced.\n\nOtherwise, the value is coerced to the proper type. For example, if a function\nspecifies an ENUM or SET value in the RETURNS clause, but the RETURN clause\nreturns an integer, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nMariaDB stores the SQL_MODE system variable setting that is in effect at the\ntime a routine is created, and always executes the routine with this setting\nin force, regardless of the server SQL mode in effect when the routine is\ninvoked.\n\nLANGUAGE SQL\n------------\n\nLANGUAGE SQL is a standard SQL clause, and it can be used in MariaDB for\nportability. However that clause has no meaning, because SQL is the only\nsupported language for stored functions.\n\nA function is deterministic if it can produce only one result for a given list\nof parameters. If the result may be affected by stored data, server variables,\nrandom numbers or any value that is not explicitly passed, then the function\nis not deterministic. Also, a function is non-deterministic if it uses\nnon-deterministic functions like NOW() or CURRENT_TIMESTAMP(). The optimizer\nmay choose a faster execution plan if it known that the function is\ndeterministic. In such cases, you should declare the routine using the\nDETERMINISTIC keyword. If you want to explicitly state that the function is\nnot deterministic (which is the default) you can use the NOT DETERMINISTIC\nkeywords.\n\nIf you declare a non-deterministic function as DETERMINISTIC, you may get\nincorrect results. If you declare a deterministic function as NOT\nDETERMINISTIC, in some cases the queries will be slower.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION function_name ...;\n\nwith the exception that any existing privileges for the function are not\ndropped.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the function already exists. Cannot be used together with OR\nREPLACE.\n\n[NOT] DETERMINISTIC\n-------------------\n\nThe [NOT] DETERMINISTIC clause also affects binary logging, because the\nSTATEMENT format can not be used to store or replicate non-deterministic\nstatements.\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative\nclauses that tell the server what the function does. MariaDB does not check in\nany way whether the specified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA\n-----------------\n\nMODIFIES SQL DATA means that the function contains statements that may modify\ndata stored in databases. This happens if the function contains statements\nlike DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA\n--------------\n\nREADS SQL DATA means that the function reads data stored in databases, but\ndoes not modify any data. This happens if SELECT statements are used, but\nthere no write operations are executed.\n\nCONTAINS SQL\n------------\n\nCONTAINS SQL means that the function contains at least one SQL statement, but\nit does not read or write any data stored in a database. Examples include SET\nor DO.\n\nNO SQL\n------\n\nNO SQL means nothing, because MariaDB does not currently support any language\nother than SQL.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nFrom MariaDB 10.3, a subset of Oracle\'s PL/SQL language has been supported in\naddition to the traditional SQL/PSM-based MariaDB syntax. See Oracle mode from\nMariaDB 10.3 for details on changes when running Oracle mode.\n\nSecurity\n--------\n\nYou must have the EXECUTE privilege on a function to call it. MariaDB\nautomatically grants the EXECUTE and ALTER ROUTINE privileges to the account\nthat called CREATE FUNCTION, even if the DEFINER clause was used.\n\nEach function has an account associated as the definer. By default, the\ndefiner is the account that created the function. Use the DEFINER clause to\nspecify a different account as the definer. You must have the SUPER privilege,\nor, from MariaDB 10.5.2, the SET USER privilege, to use the DEFINER clause.\nSee Account Names for details on specifying accounts.\n\nThe SQL SECURITY clause specifies what privileges are used when a function is\ncalled. If SQL SECURITY is INVOKER, the function body will be evaluated using\nthe privileges of the user calling the function. If SQL SECURITY is DEFINER,\nthe function body is always evaluated using the privileges of the definer\naccount. DEFINER is the default.\n\nThis allows you to create functions that grant limited access to certain data.\nFor example, say you have a table that stores some employee information, and\nthat you\'ve granted SELECT privileges only on certain columns to the user\naccount roger.\n\nCREATE TABLE employees (name TINYTEXT, dept TINYTEXT, salary INT);\nGRANT SELECT (name, dept) ON employees TO roger;\n\nTo allow the user the get the maximum salary for a department, define a\nfunction and grant the EXECUTE privilege:\n\nCREATE FUNCTION max_salary (dept TINYTEXT) RETURNS INT RETURN\n (SELECT MAX(salary) FROM employees WHERE employees.dept = dept);\nGRANT EXECUTE ON FUNCTION max_salary TO roger;\n\nSince SQL SECURITY defaults to DEFINER, whenever the user roger calls this\nfunction, the subselect will execute with your privileges. As long as you have\nprivileges to select the salary of each employee, the caller of the function\nwill be able to get the maximum salary for each department without being able\nto see individual salaries.\n\nCharacter sets and collations\n-----------------------------\n\nFunction return types can be declared to use any valid character set and\ncollation. If used, the COLLATE attribute needs to be preceded by a CHARACTER\nSET attribute.\n\nIf the character set and collation are not specifically set in the statement,\nthe database defaults at the time of creation will be used. If the database\ndefaults change at a later stage, the stored function character set/collation\nwill not be changed at the same time; the stored function needs to be dropped\nand recreated to ensure the same character set/collation as the database is\nused.\n\nExamples\n--------\n\nThe following example function takes a parameter, performs an operation using\nan SQL function, and returns the result.\n\nCREATE FUNCTION hello (s CHAR(20))\n  RETURNS CHAR(50) DETERMINISTIC\n  RETURN CONCAT(\'Hello, \',s,\'!\');\n\nSELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world!  |\n+----------------+\n\nYou can use a compound statement in a function to manipulate data with\nstatements like INSERT and UPDATE. The following example creates a counter\nfunction that uses a temporary table to store the current value. Because the\ncompound statement contains statements terminated with semicolons, you have to\nfirst change the statement delimiter with the DELIMITER statement to allow the\nsemicolon to be used in the function body. See Delimiters in the mysql client\nfor more.\n\nCREATE TEMPORARY TABLE counter (c INT);\nINSERT INTO counter VALUES (0);\nDELIMITER //\nCREATE FUNCTION counter () RETURNS INT\n BEGIN\n  UPDATE counter SET c = c + 1;\n  RETURN (SELECT c FROM counter LIMIT 1);\n END //\nDELIMITER ;\n\nCharacter set and collation:\n\nCREATE FUNCTION hello2 (s CHAR(20))\n RETURNS CHAR(50) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\' DETERMINISTIC\n RETURN CONCAT(\'Hello, \',s,\'!\');\n\nURL: https://mariadb.com/kb/en/create-function/','','https://mariadb.com/kb/en/create-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (707,38,'CREATE INDEX','Syntax\n------\n\nCREATE [OR REPLACE] [UNIQUE|FULLTEXT|SPATIAL] INDEX \n [IF NOT EXISTS] index_name\n  [index_type]\n  ON tbl_name (index_col_name,...)\n  [WAIT n | NOWAIT]\n  [index_option]\n  [algorithm_option | lock_option] ...\n\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\n\nindex_type:\n  USING {BTREE | HASH | RTREE}\n\nindex_option:\n  [ KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\n\nalgorithm_option:\n  ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n\nlock_option:\n  LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDescription\n-----------\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes. See\nALTER TABLE. CREATE INDEX cannot be used to create a PRIMARY KEY; use ALTER\nTABLE instead.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nAnother shortcut, DROP INDEX, allows the removal of an index.\n\nFor valid identifiers to use as index names, see Identifier Names.\n\nNote that KEY_BLOCK_SIZE is currently ignored in CREATE INDEX, although it is\nincluded in the output of SHOW CREATE TABLE.\n\nPrivileges\n----------\n\nExecuting the CREATE INDEX statement requires the INDEX privilege for the\ntable or the database.\n\nOnline DDL\n----------\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nCREATE OR REPLACE INDEX\n-----------------------\n\nIf the OR REPLACE clause is used and if the index already exists, then instead\nof returning an error, the server will drop the existing index and replace it\nwith the newly defined index.\n\nCREATE INDEX IF NOT EXISTS\n--------------------------\n\nIf the IF NOT EXISTS clause is used, then the index will only be created if an\nindex with the same name does not already exist. If the index already exists,\nthen a warning will be triggered by default.\n\nIndex Definitions\n-----------------\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nALGORITHM\n---------\n\nSee ALTER TABLE: ALGORITHM for more information.\n\nLOCK\n----\n\nSee ALTER TABLE: LOCK for more information.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for CREATE INDEX statement for clients\nthat support the new progress reporting protocol. For example, if you were\nusing the mysql client, then the progress report might look like this::\n\nCREATE INDEX i ON tab (num);\nStage: 1 of 2 \'copy to tmp table\'    46% of stage\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST\nstatement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nWITHOUT OVERLAPS\n----------------\n\nMariaDB starting with 10.5.3\n----------------------------\nThe WITHOUT OVERLAPS clause allows one to constrain a primary or unique index\nsuch that application-time periods cannot overlap.\n\nExamples\n--------\n\nCreating a unique index:\n\nCREATE UNIQUE INDEX HomePhone ON Employees(Home_Phone);\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE INDEX xi ON xx5 (x);\nERROR 1061 (42000): Duplicate key name \'xi\'\n\nCREATE OR REPLACE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE INDEX IF NOT EXISTS xi ON xx5 (x);\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message                 |\n+-------+------+-------------------------+\n| Note  | 1061 | Duplicate key name \'xi\' |\n+-------+------+-------------------------+\n\nFrom MariaDB 10.5.3, creating a unique index for an application-time period\ntable with a WITHOUT OVERLAPS constraint:\n\nCREATE UNIQUE INDEX u ON rooms (room_number, p WITHOUT OVERLAPS);\n\nURL: https://mariadb.com/kb/en/create-index/','','https://mariadb.com/kb/en/create-index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (708,38,'CREATE PACKAGE','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nCREATE\n  [ OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  PACKAGE [ IF NOT EXISTS ]\n  [ db_name . ] package_name\n  [ package_characteristic ... ]\n{ AS | IS }\n  [ package_specification_element ... ]\nEND [ package_name ]\n\npackage_characteristic:\n  COMMENT \'string\'\n | SQL SECURITY { DEFINER | INVOKER }\n\npackage_specification_element:\n  FUNCTION_SYM package_specification_function ;\n | PROCEDURE_SYM package_specification_procedure ;\n\npackage_specification_function:\n  func_name [ ( func_param [, func_param]... ) ]\n  RETURNS func_return_type\n  [ package_routine_characteristic... ]\n\npackage_specification_procedure:\n  proc_name [ ( proc_param [, proc_param]... ) ]\n  [ package_routine_characteristic... ]\n\nfunc_return_type:\n  type\n\nfunc_param:\n  param_name [ IN | OUT | INOUT | IN OUT ] type\n\nproc_param:\n  param_name [ IN | OUT | INOUT | IN OUT ] type\n\ntype:\n  Any valid MariaDB explicit or anchored data type\n\npackage_routine_characteristic:\n   COMMENT  \'string\'\n  | LANGUAGE SQL\n  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n\nDescription\n-----------\n\nThe CREATE PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe CREATE PACKAGE creates the specification for a stored package (a\ncollection of logically related stored objects). A stored package\nspecification declares public routines (procedures and functions) of the\npackage, but does not implement these routines.\n\nA package whose specification was created by the CREATE PACKAGE statement,\nshould later be implemented using the CREATE PACKAGE BODY statement.\n\nFunction parameter quantifiers IN | OUT | INOUT | IN OUT\n--------------------------------------------------------\n\nMariaDB starting with 10.8.0\n----------------------------\nThe function parameter quantifiers for IN, OUT, INOUT, and IN OUT where added\nin a 10.8.0 preview release. Prior to 10.8.0 quantifiers were supported only\nin procedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and\nnot SELECT. These quantifiers are especially useful for creating functions and\nprocedures with more than one return value. This allows functions and\nprocedures to be more complex and nested.\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nDELIMITER ;\n\nURL: https://mariadb.com/kb/en/create-package/','','https://mariadb.com/kb/en/create-package/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (709,38,'CREATE PACKAGE BODY','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nCREATE [ OR REPLACE ]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  PACKAGE BODY\n  [ IF NOT EXISTS ]\n  [ db_name . ] package_name\n  [ package_characteristic... ]\n{ AS | IS }\n  package_implementation_declare_section\n  package_implementation_executable_section\nEND [ package_name]\n\npackage_implementation_declare_section:\n  package_implementation_item_declaration\n   [ package_implementation_item_declaration... ]\n   [ package_implementation_routine_definition... ]\n | package_implementation_routine_definition\n   [ package_implementation_routine_definition...]\n\npackage_implementation_item_declaration:\n  variable_declaration ;\n\nvariable_declaration:\n  variable_name[,...] type [:= expr ]\n\npackage_implementation_routine_definition:\n  FUNCTION package_specification_function\n   [ package_implementation_function_body ] ;\n | PROCEDURE package_specification_procedure\n   [ package_implementation_procedure_body ] ;\n\npackage_implementation_function_body:\n  { AS | IS } package_routine_body [func_name]\n\npackage_implementation_procedure_body:\n  { AS | IS } package_routine_body [proc_name]\n\npackage_routine_body:\n  [ package_routine_declarations ]\n  BEGIN\n   statements [ EXCEPTION exception_handlers ]\n  END\n\npackage_routine_declarations:\n  package_routine_declaration \';\' [package_routine_declaration \';\']...\n\npackage_routine_declaration:\n     variable_declaration\n    | condition_name CONDITION FOR condition_value\n    | user_exception_name EXCEPTION\n    | CURSOR_SYM cursor_name\n     [ ( cursor_formal_parameters ) ]\n     IS select_statement\n    ;\n\npackage_implementation_executable_section:\n     END\n    | BEGIN\n      statement ; [statement ; ]...\n     [EXCEPTION exception_handlers]\n     END\n\nexception_handlers:\n     exception_handler [exception_handler...]\n\nexception_handler:\n     WHEN_SYM condition_value [, condition_value]...\n      THEN_SYM statement ; [statement ;]...\n\ncondition_value:\n     condition_name\n    | user_exception_name\n    | SQLWARNING\n    | SQLEXCEPTION\n    | NOT FOUND\n    | OTHERS_SYM\n    | SQLSTATE [VALUE] sqlstate_value\n    | mariadb_error_code\n\nDescription\n-----------\n\nThe CREATE PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe CREATE PACKAGE BODY statement creates the package body for a stored\npackage. The package specification must be previously created using the CREATE\nPACKAGE statement.\n\nA package body provides implementations of the package public routines and can\noptionally have:\n\n* package-wide private variables\n* package private routines\n* forward declarations for private routines\n* an executable initialization section\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nCREATE PACKAGE BODY employee_tools AS\n -- package body variables\n stdRaiseAmount DECIMAL(10,2):=500;\n\n-- private routines\n PROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n  INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n\n-- public routines\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n  eid INT;\n BEGIN\n  INSERT INTO employee (name, salary) VALUES (ename, esalary);\n  eid:= last_insert_id();\n  log(eid, \'hire \' || ename);\n END;\n\nFUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n  nSalary DECIMAL(10,2);\n BEGIN\n  SELECT salary INTO nSalary FROM employee WHERE id=eid;\n  log(eid, \'getSalary id=\' || eid || \' salary=\' || nSalary);\n  RETURN nSalary;\n END;\n\nPROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n  UPDATE employee SET salary=salary+amount WHERE id=eid;\n  log(eid, \'raiseSalary id=\' || eid || \' amount=\' || amount);\n END;\n\nPROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n  raiseSalary(eid, stdRaiseAmount);\n  log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n\nBEGIN\n -- This code is executed when the current session\n -- accesses any of the package routines for the first time\n log(0, \'Session \' || connection_id() || \' \' || current_user || \' started\');\nEND;\n$$\n\nDELIMITER ;\n\nURL: https://mariadb.com/kb/en/create-package-body/','','https://mariadb.com/kb/en/create-package-body/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (710,38,'CREATE PROCEDURE','Syntax\n------\n\nCREATE\n  [OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  PROCEDURE [IF NOT EXISTS] sp_name ([proc_parameter[,...]])\n  [characteristic ...] routine_body\n\nproc_parameter:\n  [ IN | OUT | INOUT ] param_name type\n\ntype:\n  Any valid MariaDB data type\n\ncharacteristic:\n  LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nroutine_body:\n  Valid SQL procedure statement\n\nDescription\n-----------\n\nCreates a stored procedure. By default, a routine is associated with the\ndefault database. To associate the routine explicitly with a given database,\nspecify the name as db_name.sp_name when you create it.\n\nWhen the routine is invoked, an implicit USE db_name is performed (and undone\nwhen the routine terminates). The causes the routine to have the given default\ndatabase while it executes. USE statements within stored routines are\ndisallowed.\n\nWhen a stored procedure has been created, you invoke it by using the CALL\nstatement (see CALL).\n\nTo execute the CREATE PROCEDURE statement, it is necessary to have the CREATE\nROUTINE privilege. By default, MariaDB automatically grants the ALTER ROUTINE\nand EXECUTE privileges to the routine creator. See also Stored Routine\nPrivileges.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be used\nwhen checking access privileges at routine execution time, as described here.\nRequires the SUPER privilege, or, from MariaDB 10.5.2, the SET USER privilege.\n\nIf the routine name is the same as the name of a built-in SQL function, you\nmust use a space between the name and the following parenthesis when defining\nthe routine, or a syntax error occurs. This is also true when you invoke the\nroutine later. For this reason, we suggest that it is better to avoid re-using\nthe names of existing SQL functions for your own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always allowable to have spaces after a routine name,\nregardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present. If\nthere are no parameters, an empty parameter list of () should be used.\nParameter names are not case sensitive.\n\nEach parameter can be declared to use any valid data type, except that the\nCOLLATE attribute cannot be used.\n\nFor valid identifiers to use as procedure names, see Identifier Names.\n\nThings to be Aware of With CREATE OR REPLACE\n--------------------------------------------\n\n* One can\'t use OR REPLACE together with IF EXISTS.\n\nCREATE PROCEDURE IF NOT EXISTS\n------------------------------\n\nIf the IF NOT EXISTS clause is used, then the procedure will only be created\nif a procedure with the same name does not already exist. If the procedure\nalready exists, then a warning will be triggered by default.\n\nIN/OUT/INOUT\n------------\n\nEach parameter is an IN parameter by default. To specify otherwise for a\nparameter, use the keyword OUT or INOUT before the parameter name.\n\nAn IN parameter passes a value into a procedure. The procedure might modify\nthe value, but the modification is not visible to the caller when the\nprocedure returns. An OUT parameter passes a value from the procedure back to\nthe caller. Its initial value is NULL within the procedure, and its value is\nvisible to the caller when the procedure returns. An INOUT parameter is\ninitialized by the caller, can be modified by the procedure, and any change\nmade by the procedure is visible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the CALL\nstatement that invokes the procedure so that you can obtain its value when the\nprocedure returns. If you are calling the procedure from within another stored\nprocedure or function, you can also pass a routine parameter or local routine\nvariable as an IN or INOUT parameter.\n\nDETERMINISTIC/NOT DETERMINISTIC\n-------------------------------\n\nDETERMINISTIC and NOT DETERMINISTIC apply only to functions. Specifying\nDETERMINISTC or NON-DETERMINISTIC in procedures has no effect. The default\nvalue is NOT DETERMINISTIC. Functions are DETERMINISTIC when they always\nreturn the same value for the same input. For example, a truncate or substring\nfunction. Any function involving data, therefore, is always NOT DETERMINISTIC.\n\nCONTAINS SQL/NO SQL/READS SQL DATA/MODIFIES SQL DATA\n----------------------------------------------------\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative\nclauses that tell the server what the function does. MariaDB does not check in\nany way whether the specified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA means that the function contains statements that may modify\ndata stored in databases. This happens if the function contains statements\nlike DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA means that the function reads data stored in databases, but\ndoes not modify any data. This happens if SELECT statements are used, but\nthere no write operations are executed.\n\nCONTAINS SQL means that the function contains at least one SQL statement, but\nit does not read or write any data stored in a database. Examples include SET\nor DO.\n\nNO SQL means nothing, because MariaDB does not currently support any language\nother than SQL.\n\nThe routine_body consists of a valid SQL procedure statement. This can be a\nsimple statement such as SELECT or INSERT, or it can be a compound statement\nwritten using BEGIN and END. Compound statements can contain declarations,\nloops, and other control structure statements. See Programmatic and Compound\nStatements for syntax details.\n\nMariaDB allows routines to contain DDL statements, such as CREATE and DROP.\nMariaDB also allows stored procedures (but not stored functions) to contain\nSQL transaction statements such as COMMIT.\n\nFor additional information about statements that are not allowed in stored\nroutines, see Stored Routine Limitations.\n\nInvoking stored procedure from within programs\n----------------------------------------------\n\nFor information about invoking stored procedures from within programs written\nin a language that has a MariaDB/MySQL interface, see CALL.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP PROCEDURE IF EXISTS name;\nCREATE PROCEDURE name ...;\n\nwith the exception that any existing privileges for the procedure are not\ndropped.\n\nsql_mode\n--------\n\nMariaDB stores the sql_mode system variable setting that is in effect at the\ntime a routine is created, and always executes the routine with this setting\nin force, regardless of the server SQL mode in effect when the routine is\ninvoked.\n\nCharacter Sets and Collations\n-----------------------------\n\nProcedure parameters can be declared with any character set/collation. If the\ncharacter set and collation are not specifically set, the database defaults at\nthe time of creation will be used. If the database defaults change at a later\nstage, the stored procedure character set/collation will not be changed at the\nsame time; the stored procedure needs to be dropped and recreated to ensure\nthe same character set/collation as the database is used.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nFrom MariaDB 10.3, a subset of Oracle\'s PL/SQL language has been supported in\naddition to the traditional SQL/PSM-based MariaDB syntax. See Oracle mode from\nMariaDB 10.3 for details on changes when running Oracle mode.\n\nExamples\n--------\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter. It uses the DELIMITER command to set a new delimiter for the\nduration of the process — see Delimiters in the mysql client.\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc (OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END;\n//\n\nDELIMITER ;\n\nCALL simpleproc(@a);\n\nSELECT @a;\n+------+\n| @a   |\n+------+\n|    1 |\n+------+\n\nCharacter set and collation:\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\n\nDELIMITER ;\n\nCREATE OR REPLACE:\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n\nDELIMITER ;\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n\nDELIMITER ;\nQuery OK, 0 rows affected (0.03 sec)\n\nURL: https://mariadb.com/kb/en/create-procedure/','','https://mariadb.com/kb/en/create-procedure/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (711,38,'CREATE SERVER','Syntax\n------\n\nCREATE [OR REPLACE] SERVER [IF NOT EXISTS] server_name\n  FOREIGN DATA WRAPPER wrapper_name\n  OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nDescription\n-----------\n\nThis statement creates the definition of a server for use with the Spider,\nConnect, FEDERATED or FederatedX storage engine. The CREATE SERVER statement\ncreates a new row within the servers table within the mysql database. This\nstatement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED\nADMIN privilege.\n\nThe server_name should be a unique reference to the server. Server definitions\nare global within the scope of the server, it is not possible to qualify the\nserver definition to a specific database. server_name has a maximum length of\n64 characters (names longer than 64 characters are silently truncated), and is\ncase insensitive. You may specify the name as a quoted string.\n\nThe wrapper_name may be quoted with single quotes. Supported values are:\n\n* mysql\n* mariadb (in MariaDB 10.3 and later)\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are silently\ntruncated to 64 characters. Numeric literals must be a number between 0 and\n9999, default value is 0.\n\nNote: The OWNER option is currently not applied, and has no effect on the\nownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table that\ncan later be used with the CREATE TABLE statement when creating a Spider,\nConnect, FederatedX or FEDERATED table. The options that you specify will be\nused to populate the columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nDROP SERVER removes a previously created server definition.\n\nCREATE SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nFor valid identifiers to use as server names, see Identifier Names.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP SERVER IF EXISTS name;\nCREATE SERVER server_name ...;\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the server already exists. Cannot be used together with OR REPLACE.\n\nExamples\n--------\n\nCREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nERROR 1476 (HY000): The foreign server, s, you are trying to create already\nexists\n\nCREATE OR REPLACE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE SERVER IF NOT EXISTS s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------------------------\n+\n| Level | Code | Message                                                      \n |\n+-------+------+---------------------------------------------------------------\n+\n| Note  | 1476 | The foreign server, s, you are trying to create already\nexists |\n+-------+------+---------------------------------------------------------------\n+\n\nURL: https://mariadb.com/kb/en/create-server/','','https://mariadb.com/kb/en/create-server/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (712,38,'CREATE TABLESPACE','The CREATE TABLESPACE statement is not supported by MariaDB. It was originally\ninherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is\nalso supported for InnoDB. However, MariaDB has chosen not to include that\nspecific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/kb/en/create-tablespace/','','https://mariadb.com/kb/en/create-tablespace/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (713,38,'CREATE TRIGGER','Syntax\n------\n\nCREATE [OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  TRIGGER [IF NOT EXISTS] trigger_name trigger_time trigger_event\n  ON tbl_name FOR EACH ROW\n [{ FOLLOWS | PRECEDES } other_trigger_name ]\n trigger_stmt;\n\nDescription\n-----------\n\nThis statement creates a new trigger. A trigger is a named database object\nthat is associated with a table, and that activates when a particular event\noccurs for the table. The trigger becomes associated with the table named\ntbl_name, which must refer to a permanent table. You cannot associate a\ntrigger with a TEMPORARY table or a view.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated with\nthe trigger.\n\nMariaDB starting with 10.2.3\n----------------------------\nYou can have multiple triggers for the same trigger_time and trigger_event.\n\nFor valid identifiers to use as trigger names, see Identifier Names.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.4\n----------------------------\nIf used and the trigger already exists, instead of an error being returned,\nthe existing trigger will be dropped and replaced by the newly defined trigger.\n\nDEFINER\n-------\n\nThe DEFINER clause determines the security context to be used when checking\naccess privileges at trigger activation time. Usage requires the SUPER\nprivilege, or, from MariaDB 10.5.2, the SET USER privilege.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.4\n----------------------------\nIf the IF NOT EXISTS clause is used, the trigger will only be created if a\ntrigger of the same name does not exist. If the trigger already exists, by\ndefault a warning will be returned.\n\ntrigger_time\n------------\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to indicate\nthat the trigger activates before or after each row to be modified.\n\ntrigger_event\n-------------\n\ntrigger_event indicates the kind of statement that activates the trigger. The\ntrigger_event can be one of the following:\n\n* INSERT: The trigger is activated whenever a new row is inserted into the\ntable; for example, through INSERT, LOAD DATA, and REPLACE statements.\n* UPDATE: The trigger is activated whenever a row is modified; for example,\nthrough UPDATE statements.\n* DELETE: The trigger is activated whenever a row is deleted from the table;\nfor example, through DELETE and REPLACE statements. However, DROP TABLE and\nTRUNCATE statements on the table do not activate this trigger, because they do\nnot use DELETE. Dropping a partition does not activate DELETE triggers, either.\n\nFOLLOWS/PRECEDES other_trigger_name\n-----------------------------------\n\nMariaDB starting with 10.2.3\n----------------------------\nThe FOLLOWS other_trigger_name and PRECEDES other_trigger_name options were\nadded in MariaDB 10.2.3 as part of supporting multiple triggers per action\ntime. This is the same syntax used by MySQL 5.7, although MySQL 5.7 does not\nhave multi-trigger support.\n\nFOLLOWS adds the new trigger after another trigger while PRECEDES adds the new\ntrigger before another trigger. If neither option is used, the new trigger is\nadded last for the given action and time.\n\nFOLLOWS and PRECEDES are not stored in the trigger definition. However the\ntrigger order is guaranteed to not change over time. mariadb-dump/mysqldump\nand other backup methods will not change trigger order. You can verify the\ntrigger order from the ACTION_ORDER column in INFORMATION_SCHEMA.TRIGGERS\ntable.\n\nSELECT trigger_name, action_order FROM information_schema.triggers \n WHERE event_object_table=\'t1\';\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE TRIGGER is atomic.\n\nExamples\n--------\n\nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n\nOR REPLACE and IF NOT EXISTS\n\nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nERROR 1359 (HY000): Trigger already exists\n\nCREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals  FOR EACH ROW\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nQuery OK, 0 rows affected (0.12 sec)\n\nCREATE DEFINER=`root`@`localhost` TRIGGER IF NOT EXISTS increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1359 | Trigger already exists |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/create-trigger/','','https://mariadb.com/kb/en/create-trigger/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (714,38,'CREATE VIEW','Syntax\n------\n\nCREATE\n  [OR REPLACE]\n  [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  [SQL SECURITY { DEFINER | INVOKER }]\n  VIEW [IF NOT EXISTS] view_name [(column_list)]\n  AS select_statement\n  [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nDescription\n-----------\n\nThe CREATE VIEW statement creates a new view, or replaces an existing one if\nthe OR REPLACE clause is given. If the view does not exist, CREATE OR REPLACE\nVIEW is the same as CREATE VIEW. If the view does exist, CREATE OR REPLACE\nVIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition of the\nview. (When you select from the view, you select in effect using the SELECT\nstatement.) select_statement can select from base tables or other views.\n\nThe view definition is \"frozen\" at creation time, so changes to the underlying\ntables afterwards do not affect the view definition. For example, if a view is\ndefined as SELECT * on a table, new columns added to the table later do not\nbecome part of the view. A SHOW CREATE VIEW shows that such queries are\nrewritten and column names are included in the view definition.\n\nThe view definition must be a query that does not return errors at view\ncreation times. However, the base tables used by the views might be altered\nlater and the query may not be valid anymore. In this case, querying the view\nwill result in an error. CHECK TABLE helps in finding this kind of problems.\n\nThe ALGORITHM clause affects how MariaDB processes the view. The DEFINER and\nSQL SECURITY clauses specify the security context to be used when checking\naccess privileges at view invocation time. The WITH CHECK OPTION clause can be\ngiven to constrain inserts or updates to rows in tables referenced by the\nview. These clauses are described later in this section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the view, and\nsome privilege for each column selected by the SELECT statement. For columns\nused elsewhere in the SELECT statement you must have the SELECT privilege. If\nthe OR REPLACE clause is present, you must also have the DROP privilege for\nthe view.\n\nA view belongs to a database. By default, a new view is created in the default\ndatabase. To create the view explicitly in a given database, specify the name\nas db_name.view_name when you create it.\n\nCREATE VIEW test.v AS SELECT * FROM t;\n\nBase tables and views share the same namespace within a database, so a\ndatabase cannot contain a base table and a view that have the same name.\n\nViews must have unique column names with no duplicates, just like base tables.\nBy default, the names of the columns retrieved by the SELECT statement are\nused for the view column names. To define explicit names for the view columns,\nthe optional column_list clause can be given as a list of comma-separated\nidentifiers. The number of names in column_list must be the same as the number\nof columns retrieved by the SELECT statement.\n\nMySQL until 5.1.28\n------------------\nPrior to MySQL 5.1.29, When you modify an existing view, the current view\ndefinition is backed up and saved. It is stored in that table\'s database\ndirectory, in a subdirectory named arc. The backup file for a view v is named\nv.frm-00001. If you alter the view again, the next backup is named\nv.frm-00002. The three latest view backup definitions are stored. Backed up\nview definitions are not preserved by mysqldump, or any other such programs,\nbut you can retain them using a file copy operation. However, they are not\nneeded for anything but to provide you with a backup of your previous view\ndefinition. It is safe to remove these backup definitions, but only while\nmysqld is not running. If you delete the arc subdirectory or its files while\nmysqld is running, you will receive an error the next time you try to alter\nthe view:\n\nMariaDB [test]> ALTER VIEW v AS SELECT * FROM t; \nERROR 6 (HY000): Error on delete of \'.\\test\\arc/v.frm-0004\' (Errcode: 2)\n\nColumns retrieved by the SELECT statement can be simple references to table\ncolumns. They can also be expressions that use functions, constant values,\noperators, and so forth.\n\nUnqualified table or view names in the SELECT statement are interpreted with\nrespect to the default database. A view can refer to tables or views in other\ndatabases by qualifying the table or view name with the proper database name.\n\nA view can be created from many kinds of SELECT statements. It can refer to\nbase tables or other views. It can use joins, UNION, and subqueries. The\nSELECT need not even refer to any tables. The following example defines a view\nthat selects two columns from another table, as well as an expression\ncalculated from those columns:\n\nCREATE TABLE t (qty INT, price INT);\n\nINSERT INTO t VALUES(3, 50);\n\nCREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\n\nSELECT * FROM v;\n+------+-------+-------+\n| qty  | price | value |\n+------+-------+-------+\n|    3 |    50 |   150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\n* The SELECT statement cannot contain a subquery in the FROM clause.\n* The SELECT statement cannot refer to system or user variables.\n* Within a stored program, the definition cannot refer to program parameters\nor local variables.\n* The SELECT statement cannot refer to prepared statement parameters.\n* Any table or view referred to in the definition must exist. However, after a\nview has been created, it is possible to drop a table or view that the\ndefinition refers to. In this case, use of the view results in an error. To\ncheck a view definition for problems of this kind, use the CHECK TABLE\nstatement.\n* The definition cannot refer to a TEMPORARY table, and you cannot create a\nTEMPORARY view.\n* Any tables named in the view definition must exist at definition time.\n* You cannot associate a trigger with a view.\n* For valid identifiers to use as view names, see Identifier Names.\n\nORDER BY is allowed in a view definition, but it is ignored if you select from\na view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the options\nor clauses of the statement that references the view, but the effect is\nundefined. For example, if a view definition includes a LIMIT clause, and you\nselect from the view using a statement that has its own LIMIT clause, it is\nundefined which limit applies. This same principle applies to options such as\nALL, DISTINCT, or SQL_SMALL_RESULT that follow the SELECT keyword, and to\nclauses such as INTO, FOR UPDATE, and LOCK IN SHARE MODE.\n\nThe PROCEDURE clause cannot be used in a view definition, and it cannot be\nused if a view is referenced in the FROM clause.\n\nIf you create a view and then change the query processing environment by\nchanging system variables, that may affect the results that you get from the\nview:\n\nCREATE VIEW v (mycol) AS SELECT \'abc\';\n\nSET sql_mode = \'\';\n\nSELECT \"mycol\" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol | \n+-------+\n\nSET sql_mode = \'ANSI_QUOTES\';\n\nSELECT \"mycol\" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc   | \n+-------+\n\nThe DEFINER and SQL SECURITY clauses determine which MariaDB account to use\nwhen checking access privileges for the view when a statement is executed that\nreferences the view. They were added in MySQL 5.1.2. The legal SQL SECURITY\ncharacteristic values are DEFINER and INVOKER. These indicate that the\nrequired privileges must be held by the user who defined or invoked the view,\nrespectively. The default SQL SECURITY value is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MariaDB\naccount in \'user_name\'@\'host_name\' format (the same format used in the GRANT\nstatement). The user_name and host_name values both are required. The definer\ncan also be given as CURRENT_USER or CURRENT_USER(). The default DEFINER value\nis the user who executes the CREATE VIEW statement. This is the same as\nspecifying DEFINER = CURRENT_USER explicitly.\n\nIf you specify the DEFINER clause, these rules determine the legal DEFINER\nuser values:\n\n* If you do not have the SUPER privilege, or, from MariaDB 10.5.2, the SET\nUSER privilege, the only legal user value is your own account, either\nspecified literally or by using CURRENT_USER. You cannot set the definer to\nsome other account.\n* If you have the SUPER privilege, or, from MariaDB 10.5.2, the SET USER\nprivilege, you can specify any syntactically legal account name. If the\naccount does not actually exist, a warning is generated.\n* If the SQL SECURITY value is DEFINER but the definer account does not exist\nwhen the view is referenced, an error occurs.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value by\ndefault. For views defined with the SQL SECURITY INVOKER characteristic,\nCURRENT_USER returns the account for the view\'s invoker. For information about\nuser auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.1/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This also\naffects a view defined within such a program, if the view definition contains\na DEFINER value of CURRENT_USER.\n\nView privileges are checked like this:\n\n* At view definition time, the view creator must have the privileges needed to\nuse the top-level objects accessed by the view. For example, if the view\ndefinition refers to table columns, the creator must have privileges for the\ncolumns, as described previously. If the definition refers to a stored\nfunction, only the privileges needed to invoke the function can be checked.\nThe privileges required when the function runs can be checked only as it\nexecutes: For different invocations of the function, different execution paths\nwithin the function might be taken.\n* When a view is referenced, privileges for objects accessed by the view are\nchecked against the privileges held by the view creator or invoker, depending\non whether the SQL SECURITY characteristic is DEFINER or INVOKER, respectively.\n* If reference to a view causes execution of a stored function, privilege\nchecking for statements executed within the function depend on whether the\nfunction is defined with a SQL SECURITY characteristic of DEFINER or INVOKER.\nIf the security characteristic is DEFINER, the function runs with the\nprivileges of its creator. If the characteristic is INVOKER, the function runs\nwith the privileges determined by the view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function might\ninvoke other stored routines. For example, the following view invokes a stored\nfunction f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be checked\nwhen f() executes. This might mean that privileges are needed for p1() or\np2(), depending on the execution path within f(). Those privileges must be\nchecked at runtime, and the user who must possess the privileges is determined\nby the SQL SECURITY values of the view v and the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to standard SQL.\nIn standard SQL, views are handled using the rules for SQL SECURITY INVOKER.\n\nIf you invoke a view that was created before MySQL 5.1.2, it is treated as\nthough it was created with a SQL SECURITY DEFINER clause and with a DEFINER\nvalue that is the same as your account. However, because the actual definer is\nunknown, MySQL issues a warning. To make the warning go away, it is sufficient\nto re-create the view so that the view definition includes a DEFINER clause.\n\nThe optional ALGORITHM clause is an extension to standard SQL. It affects how\nMariaDB processes the view. ALGORITHM takes three values: MERGE, TEMPTABLE, or\nUNDEFINED. The default algorithm is UNDEFINED if no ALGORITHM clause is\npresent. See View Algorithms for more information.\n\nSome views are updatable. That is, you can use them in statements such as\nUPDATE, DELETE, or INSERT to update the contents of the underlying table. For\na view to be updatable, there must be a one-to-one relationship between the\nrows in the view and the rows in the underlying table. There are also certain\nother constructs that make a view non-updatable. See Inserting and Updating\nwith Views.\n\nWITH CHECK OPTION\n-----------------\n\nThe WITH CHECK OPTION clause can be given for an updatable view to prevent\ninserts or updates to rows except those for which the WHERE clause in the\nselect_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and CASCADED\nkeywords determine the scope of check testing when the view is defined in\nterms of another view. The LOCAL keyword restricts the CHECK OPTION only to\nthe view being defined. CASCADED causes the checks for underlying views to be\nevaluated as well. When neither keyword is given, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION clause,\nsee Inserting and Updating with Views.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified view already exists. Cannot be used together with\nthe OR REPLACE clause.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE VIEW is atomic.\n\nExamples\n--------\n\nCREATE TABLE t (a INT, b INT) ENGINE = InnoDB;\n\nINSERT INTO t VALUES (1,1), (2,2), (3,3);\n\nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\n\nSELECT * FROM v;\n+------+------+\n| a    | a2   |\n+------+------+\n|    1 |    2 |\n|    2 |    4 |\n|    3 |    6 |\n+------+------+\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\nERROR 1050 (42S01): Table \'v\' already exists\n\nCREATE OR REPLACE VIEW v AS SELECT a, a*2 AS a2 FROM t;\nQuery OK, 0 rows affected (0.04 sec)\n\nCREATE VIEW IF NOT EXISTS v AS SELECT a, a*2 AS a2 FROM t;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n','','https://mariadb.com/kb/en/create-view/');
update help_topic set description = CONCAT(description, '\nSHOW WARNINGS;\n+-------+------+--------------------------+\n| Level | Code | Message                  |\n+-------+------+--------------------------+\n| Note  | 1050 | Table \'v\' already exists |\n+-------+------+--------------------------+\n\nURL: https://mariadb.com/kb/en/create-view/') WHERE help_topic_id = 714;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (715,38,'Generated (Virtual and Persistent/Stored) Columns','Syntax\n------\n\n<type>  [GENERATED ALWAYS]  AS   ( <expression> )\n[VIRTUAL | PERSISTENT | STORED]  [UNIQUE] [UNIQUE KEY] [COMMENT <text>]\n\nMariaDB\'s generated columns syntax is designed to be similar to the syntax for\nMicrosoft SQL Server\'s computed columns and Oracle Database\'s virtual columns.\nIn MariaDB 10.2 and later, the syntax is also compatible with the syntax for\nMySQL\'s generated columns.\n\nDescription\n-----------\n\nA generated column is a column in a table that cannot explicitly be set to a\nspecific value in a DML query. Instead, its value is automatically generated\nbased on an expression. This expression might generate the value based on the\nvalues of other columns in the table, or it might generate the value by\ncalling built-in functions or user-defined functions (UDFs).\n\nThere are two types of generated columns:\n\n* PERSISTENT (a.k.a. STORED): This type\'s value is actually stored in the\ntable.\n* VIRTUAL: This type\'s value is not stored at all. Instead, the value is\ngenerated dynamically when the table is queried. This type is the default.\n\nGenerated columns are also sometimes called computed columns or virtual\ncolumns.\n\nSupported Features\n------------------\n\nStorage Engine Support\n----------------------\n\n* Generated columns can only be used with storage engines which support them.\nIf you try to use a storage engine that does not support them, then you will\nsee an error similar to the following:\n\nERROR 1910 (HY000): TokuDB storage engine does not support computed columns\n\n* InnoDB, Aria, MyISAM and CONNECT support generated columns.\n\n* A column in a MERGE table can be built on a PERSISTENT generated column.\nHowever, a column in a MERGE table can not be defined as a VIRTUAL and\nPERSISTENT generated column.\n\nData Type Support\n-----------------\n\n* All data types are supported when defining generated columns.\n\n* Using the ZEROFILL column option is supported when defining generated\ncolumns.\n\n* Using the AUTO_INCREMENT column option is not supported when defining\ngenerated columns. Until MariaDB 10.2.25, it was supported, but this support\nwas removed, because it would not work correctly. See MDEV-11117.\n\nIndex Support\n-------------\n\n* Using a generated column as a table\'s primary key is not supported. See\nMDEV-5590 for more information. If you try to use one as a primary key, then\nyou will see an error similar to the following:\n\nERROR 1903 (HY000): Primary key cannot be defined upon a computed column\n\n* Using PERSISTENT generated columns as part of a foreign key is supported.\n\n* Referencing PERSISTENT generated columns as part of a foreign key is also\nsupported.\nHowever, using the ON UPDATE CASCADE, ON UPDATE SET NULL, or ON DELETE SET\nNULL clauses is not supported. If you try to use an unsupported clause, then\nyou will see an error similar to the following:\n\nERROR 1905 (HY000): Cannot define foreign key with ON UPDATE SET NULL clause\non a computed column\n\n* Defining indexes on both VIRTUAL and PERSISTENT generated columns is\nsupported.\nIf an index is defined on a generated column, then the optimizer considers\nusing it in the same way as indexes based on \"real\" columns.\n\nStatement Support\n-----------------\n\n* Generated columns are used in DML queries just as if they were \"real\"\ncolumns.\nHowever, VIRTUAL and PERSISTENT generated columns differ in how their data is\nstored.\nValues for PERSISTENT generated columns are generated whenever a DML queries\ninserts or updates the row with the special DEFAULT value. This generates the\ncolumns value, and it is stored in the table like the other \"real\" columns.\nThis value can be read by other DML queries just like the other \"real\" columns.\nValues for VIRTUAL generated columns are not stored in the table. Instead, the\nvalue is generated dynamically whenever the column is queried. If other\ncolumns in a row are queried, but the VIRTUAL generated column is not one of\nthe queried columns, then the column\'s value is not generated.\n\n* The SELECT statement supports generated columns.\n\n* Generated columns can be referenced in the INSERT, UPDATE, and DELETE\nstatements.\nHowever, VIRTUAL or PERSISTENT generated columns cannot be explicitly set to\nany other values than NULL or DEFAULT. If a generated column is explicitly set\nto any other value, then the outcome depends on whether strict mode is enabled\nin sql_mode. If it is not enabled, then a warning will be raised and the\ndefault generated value will be used instead. If it is enabled, then an error\nwill be raised instead.\n\n* The CREATE TABLE statement has limited support for generated columns.\nIt supports defining generated columns in a new table.\nIt supports using generated columns to partition tables.\nIt does not support using the versioning clauses with generated columns.\n\n* The ALTER TABLE statement has limited support for generated columns.\nIt supports the MODIFY and CHANGE clauses for PERSISTENT generated columns.\nIt does not support the MODIFY clause for VIRTUAL generated columns if\nALGORITHM is not set to COPY. See MDEV-15476 for more information.\nIt does not support the  CHANGE clause for VIRTUAL generated columns if\nALGORITHM is not set to COPY. See MDEV-17035 for more information.\nIt does not support altering a table if ALGORITHM is not set to COPY if the\ntable has a VIRTUAL generated column that is indexed. See MDEV-14046 for more\ninformation.\nIt does not support adding a VIRTUAL generated column with the ADD clause if\nthe same statement is also adding other columns if ALGORITHM is not set to\nCOPY. See MDEV-17468 for more information.\nIt also does not support altering an existing column into a VIRTUAL generated\ncolumn.\nIt supports using generated columns to partition tables.\nIt does not support using the versioning clauses with generated columns.\n\n* The SHOW CREATE TABLE statement supports generated columns.\n\n* The DESCRIBE statement can be used to check whether a table has generated\ncolumns.\nYou can tell which columns are generated by looking for the ones where the\nExtra column is set to either VIRTUAL or PERSISTENT. For example:\n\nDESCRIBE table1;\n+-------+-------------+------+-----+---------+------------+\n| Field | Type        | Null | Key | Default | Extra      |\n+-------+-------------+------+-----+---------+------------+\n| a     | int(11)     | NO   |     | NULL    |            |\n| b     | varchar(32) | YES  |     | NULL    |            |\n| c     | int(11)     | YES  |     | NULL    | VIRTUAL    |\n| d     | varchar(5)  | YES  |     | NULL    | PERSISTENT |\n+-------+-------------+------+-----+---------+------------+\n\n* Generated columns can be properly referenced in the NEW and OLD rows in\ntriggers.\n\n* Stored procedures support generated columns.\n\n* The HANDLER statement supports generated columns.\n\nExpression Support\n------------------\n\n* Most legal, deterministic expressions which can be calculated are supported\nin expressions for generated columns.\n\n* Most built-in functions are supported in expressions for generated columns.\nHowever, some built-in functions can\'t be supported for technical reasons. For\nexample,  If you try to use an unsupported function in an expression, an error\nis generated similar to the following:\n\nERROR 1901 (HY000): Function or expression \'dayname()\' cannot be used in the\nGENERATED ALWAYS AS clause of `v`\n\n* Subqueries are not supported in expressions for generated columns because\nthe underlying data can change.\n\n* Using anything that depends on data outside the row is not supported in\nexpressions for generated columns.\n\n* Stored functions are not supported in expressions for generated columns. See\nMDEV-17587 for more information.\n\n* Non-deterministic built-in functions are supported in expressions for not\nindexed VIRTUAL generated columns.\n\n* Non-deterministic built-in functions are not supported in expressions for\nPERSISTENT or indexed VIRTUAL generated columns.\n\n* User-defined functions (UDFs) are supported in expressions for generated\ncolumns.\nHowever, MariaDB can\'t check whether a UDF is deterministic, so it is up to\nthe user to be sure that they do not use non-deterministic UDFs with VIRTUAL\ngenerated columns.\n\n* Defining a generated column based on other generated columns defined before\nit in the table definition is supported. For example:\n\nCREATE TABLE t1 (a int as (1), b int as (a));\n\n* However, defining a generated column based on other generated columns\ndefined after in the table definition is not supported in expressions for\ngeneration columns because generated columns are calculated in the order they\nare defined.\n\n* Using an expression that exceeds 255 characters in length is supported in\nexpressions for generated columns. The new limit for the entire table\ndefinition, including all expressions for generated columns, is 65,535 bytes.\n\n* Using constant expressions is supported in expressions for generated\ncolumns. For example:\n\nCREATE TABLE t1 (a int as (1));\n\nMaking Stored Values Consistent\n-------------------------------\n\nWhen a generated column is PERSISTENT or indexed, the value of the expression\nneeds to be consistent regardless of the SQL Mode flags in the current\nsession. If it is not, then the table will be seen as corrupted when the value\nthat should actually be returned by the computed expression and the value that\nwas previously stored and/or indexed using a different sql_mode setting\ndisagree.\n\nThere are currently two affected classes of inconsistencies: character padding\nand unsigned subtraction:\n\n* For a VARCHAR or TEXT generated column the length of the value returned can\nvary depending on the PAD_CHAR_TO_FULL_LENGTH sql_mode flag.  To make the\nvalue consistent, create the generated column using an RTRIM() or RPAD()\nfunction.  Alternately, create the generated column as a CHAR column so that\nits data is always fully padded.\n\n* If a SIGNED generated column is based on the subtraction of an UNSIGNED\nvalue, the resulting value can vary depending on how large the value is and\nthe NO_UNSIGNED_SUBTRACTION sql_mode flag.  To make the value consistent, use\nCAST() to ensure that each UNSIGNED operand is SIGNED before the subtraction.\n\nMariaDB starting with 10.5\n--------------------------\nBeginning in MariaDB 10.5, there is a fatal error generated when trying to\ncreate a generated column whose value can change depending on the SQL Mode\nwhen its data is PERSISTENT or indexed.\n\nFor an existing generated column that has a potentially inconsistent value, a\nwarning about a bad expression is generated the first time it is used (if\nwarnings are enabled).\n\nBeginning in MariaDB 10.4.8, MariaDB 10.3.18, and MariaDB 10.2.27 a\npotentially inconsistent generated column outputs a warning when created or\nfirst used (without restricting their creation).\n\nHere is an example of two tables that would be rejected in MariaDB 10.5 and\nwarned about in the other listed versions:\n\nCREATE TABLE bad_pad (\n txt CHAR(5),\n -- CHAR -> VARCHAR or CHAR -> TEXT can\'t be persistent or indexed:\n vtxt VARCHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE bad_sub (\n num1 BIGINT UNSIGNED,\n num2 BIGINT UNSIGNED,\n -- The resulting value can vary for some large values\n vnum BIGINT AS (num1 - num2) VIRTUAL,\n KEY(vnum)\n);\n\nThe warnings for the above tables look like this:\n\nWarning (Code 1901): Function or expression \'`txt`\' cannot be used in the\nGENERATED ALWAYS AS clause of `vtxt`\nWarning (Code 1105): Expression depends on the @@sql_mode value\nPAD_CHAR_TO_FULL_LENGTH\n\nWarning (Code 1901): Function or expression \'`num1` - `num2`\' cannot be used\nin the GENERATED ALWAYS AS clause of `vnum`\nWarning (Code 1105): Expression depends on the @@sql_mode value\nNO_UNSIGNED_SUBTRACTION\n\nTo work around the issue, force the padding or type to make the generated\ncolumn\'s expression return a consistent value. For example:\n\nCREATE TABLE good_pad (\n txt CHAR(5),\n -- Using RTRIM() or RPAD() makes the value consistent:\n vtxt VARCHAR(5) AS (RTRIM(txt)) PERSISTENT,\n -- When not persistent or indexed, it is OK for the value to vary by mode:\n vtxt2 VARCHAR(5) AS (txt) VIRTUAL,\n -- CHAR -> CHAR is always OK:\n txt2 CHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE good_sub (\n num1 BIGINT UNSIGNED,\n num2 BIGINT UNSIGNED,\n -- The indexed value will always be consistent in this expression:\n vnum BIGINT AS (CAST(num1 AS SIGNED) - CAST(num2 AS SIGNED)) VIRTUAL,\n KEY(vnum)\n);\n\nMySQL Compatibility Support\n---------------------------\n\n* The STORED keyword is supported as an alias for the PERSISTENT keyword.\n\n* Tables created with MySQL 5.7 or later that contain MySQL\'s generated\ncolumns can be imported into MariaDB without a dump and restore.\n\nImplementation Differences\n--------------------------\n\nGenerated columns are subject to various constraints in other DBMSs that are\nnot present in MariaDB\'s implementation. Generated columns may also be called\ncomputed columns or virtual columns in different implementations. The various\ndetails for a specific implementation can be found in the documentation for\neach specific DBMS.\n\nImplementation Differences Compared to Microsoft SQL Server\n-----------------------------------------------------------\n\nMariaDB\'s generated columns implementation does not enforce the following\nrestrictions that are present in Microsoft SQL Server\'s computed columns\nimplementation:\n\n* MariaDB allows server variables in generated column expressions, including\nthose that change dynamically, such as warning_count.\n* MariaDB allows the CONVERT_TZ() function to be called with a named time zone\nas an argument, even though time zone names and time offsets are configurable.\n* MariaDB allows the CAST() function to be used with non-unicode character\nsets, even though character sets are configurable and differ between\nbinaries/versions.\n* MariaDB allows FLOAT expressions to be used in generated columns. Microsoft\nSQL Server considers these expressions to be \"imprecise\" due to potential\ncross-platform differences in floating-point implementations and precision.\n* Microsoft SQL Server requires the ARITHABORT mode to be set, so that\ndivision by zero returns an error, and not a NULL.\n* Microsoft SQL Server requires QUOTED_IDENTIFIER to be set in sql_mode. In\nMariaDB, if data is inserted without ANSI_QUOTES set in sql_mode, then it will','','https://mariadb.com/kb/en/generated-columns/');
update help_topic set description = CONCAT(description, '\nbe processed and stored differently in a generated column that contains quoted\nidentifiers.\n\nMicrosoft SQL Server enforces the above restrictions by doing one of the\nfollowing things:\n\n* Refusing to create computed columns.\n* Refusing to allow updates to a table containing them.\n* Refusing to use an index over such a column if it can not be guaranteed that\nthe expression is fully deterministic.\n\nIn MariaDB, as long as the sql_mode, language, and other settings that were in\neffect during the CREATE TABLE remain unchanged, the generated column\nexpression will always be evaluated the same. If any of these things change,\nthen please be aware that the generated column expression might not be\nevaluated the same way as it previously was.\n\nIf you try to update a virtual column, you will get an error if the default\nstrict mode is enabled in sql_mode, or a warning otherwise.\n\nDevelopment History\n-------------------\n\nGenerated columns was originally developed by Andrey Zhakov. It was then\nmodified by Sanja Byelkin and Igor Babaev at Monty Program for inclusion in\nMariaDB. Monty did the work on MariaDB 10.2 to lift a some of the old\nlimitations.\n\nExamples\n--------\n\nHere is an example table that uses both VIRTUAL and PERSISTENT virtual columns:\n\nUSE TEST;\n\nCREATE TABLE table1 (\n  a INT NOT NULL,\n  b VARCHAR(32),\n  c INT AS (a mod 10) VIRTUAL,\n  d VARCHAR(5) AS (left(b,5)) PERSISTENT);\n\nIf you describe the table, you can easily see which columns are virtual by\nlooking in the \"Extra\" column:\n\nDESCRIBE table1;\n+-------+-------------+------+-----+---------+------------+\n| Field | Type        | Null | Key | Default | Extra      |\n+-------+-------------+------+-----+---------+------------+\n| a     | int(11)     | NO   |     | NULL    |            |\n| b     | varchar(32) | YES  |     | NULL    |            |\n| c     | int(11)     | YES  |     | NULL    | VIRTUAL    |\n| d     | varchar(5)  | YES  |     | NULL    | PERSISTENT |\n+-------+-------------+------+-----+---------+------------+\n\nTo find out what function(s) generate the value of the virtual column you can\nuse SHOW CREATE TABLE:\n\nSHOW CREATE TABLE table1;\n\n| table1 | CREATE TABLE `table1` (\n `a` int(11) NOT NULL,\n `b` varchar(32) DEFAULT NULL,\n `c` int(11) AS (a mod 10) VIRTUAL,\n `d` varchar(5) AS (left(b,5)) PERSISTENT\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 |\n\nIf you try to insert non-default values into a virtual column, you will\nreceive a warning and what you tried to insert will be ignored and the derived\nvalue inserted instead:\n\nWARNINGS;\nShow warnings enabled.\n\nINSERT INTO table1 VALUES (1, \'some text\',default,default);\nQuery OK, 1 row affected (0.00 sec)\n\nINSERT INTO table1 VALUES (2, \'more text\',5,default);\nQuery OK, 1 row affected, 1 warning (0.00 sec)\n\nWarning (Code 1645): The value specified for computed column \'c\' in table\n\'table1\' has been ignored.\n\nINSERT INTO table1 VALUES (123, \'even more text\',default,\'something\');\nQuery OK, 1 row affected, 2 warnings (0.00 sec)\n\nWarning (Code 1645): The value specified for computed column \'d\' in table\n\'table1\' has been ignored.\nWarning (Code 1265): Data truncated for column \'d\' at row 1\n\nSELECT * FROM table1;\n+-----+----------------+------+-------+\n| a   | b              | c    | d     |\n+-----+----------------+------+-------+\n|   1 | some text      |    1 | some  |\n|   2 | more text      |    2 | more  |\n| 123 | even more text |    3 | even  |\n+-----+----------------+------+-------+\n3 rows in set (0.00 sec)\n\nIf the ZEROFILL clause is specified, it should be placed directly after the\ntype definition, before the AS (<expression>):\n\nCREATE TABLE table2 (a INT, b INT ZEROFILL AS (a*2) VIRTUAL);\nINSERT INTO table2 (a) VALUES (1);\n\nSELECT * FROM table2;\n+------+------------+\n| a    | b          |\n+------+------------+\n|    1 | 0000000002 |\n+------+------------+\n1 row in set (0.00 sec)\n\nYou can also use virtual columns to implement a \"poor man\'s partial index\".\nSee example at the end of Unique Index.\n\nURL: https://mariadb.com/kb/en/generated-columns/') WHERE help_topic_id = 715;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (716,38,'Invisible Columns','MariaDB starting with 10.3.3\n----------------------------\nInvisible columns (sometimes also called hidden columns) first appeared in\nMariaDB 10.3.3.\n\nColumns can be given an INVISIBLE attribute in a CREATE TABLE or ALTER TABLE\nstatement. These columns will then not be listed in the results of a SELECT *\nstatement, nor do they need to be assigned a value in an INSERT statement,\nunless INSERT explicitly mentions them by name.\n\nSince SELECT * does not return the invisible columns, new tables or views\ncreated in this manner will have no trace of the invisible columns. If\nspecifically referenced in the SELECT statement, the columns will be brought\ninto the view/new table, but the INVISIBLE attribute will not.\n\nInvisible columns can be declared as NOT NULL, but then require a DEFAULT\nvalue.\n\nIt is not possible for all columns in a table to be invisible.\n\nExamples\n--------\n\nCREATE TABLE t (x INT INVISIBLE);\nERROR 1113 (42000): A table must have at least 1 column\n\nCREATE TABLE t (x INT, y INT INVISIBLE, z INT INVISIBLE NOT NULL);\nERROR 4106 (HY000): Invisible column `z` must have a default value\n\nCREATE TABLE t (x INT, y INT INVISIBLE, z INT INVISIBLE NOT NULL DEFAULT 4);\n\nINSERT INTO t VALUES (1),(2);\n\nINSERT INTO t (x,y) VALUES (3,33);\n\nSELECT * FROM t;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nSELECT x,y,z FROM t;\n+------+------+---+\n| x    | y    | z |\n+------+------+---+\n|    1 | NULL | 4 |\n|    2 | NULL | 4 |\n|    3 |   33 | 4 |\n+------+------+---+\n\nDESC t;\n+-------+---------+------+-----+---------+-----------+\n| Field | Type    | Null | Key | Default | Extra     |\n+-------+---------+------+-----+---------+-----------+\n| x     | int(11) | YES  |     | NULL    |           |\n| y     | int(11) | YES  |     | NULL    | INVISIBLE |\n| z     | int(11) | NO   |     | 4       | INVISIBLE |\n+-------+---------+------+-----+---------+-----------+\n\nALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL\nDEFAULT 4;\n\nDESC t;\n+-------+---------+------+-----+---------+-----------+\n| Field | Type    | Null | Key | Default | Extra     |\n+-------+---------+------+-----+---------+-----------+\n| x     | int(11) | YES  |     | NULL    | INVISIBLE |\n| y     | int(11) | YES  |     | NULL    |           |\n| z     | int(11) | NO   |     | 4       |           |\n+-------+---------+------+-----+---------+-----------+\n\nCreating a view from a table with hidden columns:\n\nCREATE VIEW v1 AS SELECT * FROM t;\n\nDESC v1;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| y     | int(11) | YES  |     | NULL    |       |\n| z     | int(11) | NO   |     | 4       |       |\n+-------+---------+------+-----+---------+-------+\n\nCREATE VIEW v2 AS SELECT x,y,z FROM t;\n\nDESC v2;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| x     | int(11) | YES  |     | NULL    |       |\n| y     | int(11) | YES  |     | NULL    |       |\n| z     | int(11) | NO   |     | 4       |       |\n+-------+---------+------+-----+---------+-------+\n\nAdding a Surrogate Primary Key:\n\ncreate table t1 (x bigint unsigned not null, y varchar(16), z text);\n\ninsert into t1 values (123, \'qq11\', \'ipsum\');\n\ninsert into t1 values (123, \'qq22\', \'lorem\');\n\nalter table t1 add pkid serial primary key invisible first;\n\ninsert into t1 values (123, \'qq33\', \'amet\');\n\nselect * from t1;\n+-----+------+-------+\n| x   | y    | z     |\n+-----+------+-------+\n| 123 | qq11 | ipsum |\n| 123 | qq22 | lorem |\n| 123 | qq33 | amet  |\n+-----+------+-------+\n\nselect pkid, z from t1;\n+------+-------+\n| pkid | z     |\n+------+-------+\n|    1 | ipsum |\n|    2 | lorem |\n|    3 | amet  |\n+------+-------+\n\nURL: https://mariadb.com/kb/en/invisible-columns/','','https://mariadb.com/kb/en/invisible-columns/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (717,38,'DROP DATABASE','Syntax\n------\n\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDescription\n-----------\n\nDROP DATABASE drops all tables in the database and deletes the database. Be\nvery careful with this statement! To use DROP DATABASE, you need the DROP\nprivilege on the database. DROP SCHEMA is a synonym for DROP DATABASE.\n\nImportant: When a database is dropped, user privileges on the database are not\nautomatically dropped. See GRANT.\n\nIF EXISTS\n---------\n\nUse IF EXISTS to prevent an error from occurring for databases that do not\nexist. A NOTE is generated for each non-existent database when using IF\nEXISTS. See SHOW WARNINGS.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL.\n\nDROP DATABASE is implemented as\n\nloop over all tables\n DROP TABLE table\n\nEach individual DROP TABLE is atomic while DROP DATABASE as a whole is\ncrash-safe.\n\nExamples\n--------\n\nDROP DATABASE bufg;\nQuery OK, 0 rows affected (0.39 sec)\n\nDROP DATABASE bufg;\nERROR 1008 (HY000): Can\'t drop database \'bufg\'; database doesn\'t exist\n\n\\W\nShow warnings enabled.\n\nDROP DATABASE IF EXISTS bufg;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\nNote (Code 1008): Can\'t drop database \'bufg\'; database doesn\'t exist\n\nURL: https://mariadb.com/kb/en/drop-database/','','https://mariadb.com/kb/en/drop-database/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (718,38,'DROP EVENT','Syntax\n------\n\nDROP EVENT [IF EXISTS] event_name\n\nDescription\n-----------\n\nThis statement drops the event named event_name. The event immediately ceases\nbeing active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown event\n\'event_name\' results. You can override this and cause the statement to\ngenerate a NOTE for non-existent events instead by using IF EXISTS. See SHOW\nWARNINGS.\n\nThis statement requires the EVENT privilege. In MySQL 5.1.11 and earlier, an\nevent could be dropped only by its definer, or by a user having the SUPER\nprivilege.\n\nExamples\n--------\n\nDROP EVENT myevent3;\n\nUsing the IF EXISTS clause:\n\nDROP EVENT IF EXISTS myevent3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------+\n| Level | Code | Message                       |\n+-------+------+-------------------------------+\n| Note  | 1305 | Event myevent3 does not exist |\n+-------+------+-------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-event/','','https://mariadb.com/kb/en/drop-event/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (719,38,'DROP FUNCTION','Syntax\n------\n\nDROP FUNCTION [IF EXISTS] f_name\n\nDescription\n-----------\n\nThe DROP FUNCTION statement is used to drop a stored function or a\nuser-defined function (UDF). That is, the specified routine is removed from\nthe server, along with all privileges specific to the function. You must have\nthe ALTER ROUTINE privilege for the routine in order to drop it. If the\nautomatic_sp_privileges server system variable is set, both the ALTER ROUTINE\nand EXECUTE privileges are granted automatically to the routine creator - see\nStored Routine Privileges.\n\nIF EXISTS\n---------\n\nThe IF EXISTS clause is a MySQL/MariaDB extension. It prevents an error from\noccurring if the function does not exist. A NOTE is produced that can be\nviewed with SHOW WARNINGS.\n\nFor dropping a user-defined functions (UDF), see DROP FUNCTION UDF.\n\nExamples\n--------\n\nDROP FUNCTION hello;\nQuery OK, 0 rows affected (0.042 sec)\n\nDROP FUNCTION hello;\nERROR 1305 (42000): FUNCTION test.hello does not exist\n\nDROP FUNCTION IF EXISTS hello;\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------+\n| Level | Code | Message                            |\n+-------+------+------------------------------------+\n| Note  | 1305 | FUNCTION test.hello does not exist |\n+-------+------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-function/','','https://mariadb.com/kb/en/drop-function/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (720,38,'DROP INDEX','Syntax\n------\n\nDROP INDEX [IF EXISTS] index_name ON tbl_name \n  [WAIT n |NOWAIT]\n\nDescription\n-----------\n\nDROP INDEX drops the index named index_name from the table tbl_name. This\nstatement is mapped to an ALTER TABLE statement to drop the index.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nSee ALTER TABLE.\n\nAnother shortcut, CREATE INDEX, allows the creation of an index.\n\nTo remove the primary key, `PRIMARY` must be specified as index_name. Note\nthat the quotes are necessary, because PRIMARY is a keyword.\n\nPrivileges\n----------\n\nExecuting the DROP INDEX statement requires the INDEX privilege for the table\nor the database.\n\nOnline DDL\n----------\n\nOnline DDL is used by default with InnoDB, when the drop index operation\nsupports it.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nDROP INDEX IF EXISTS ...\n------------------------\n\nIf the IF EXISTS clause is used, then MariaDB will return a warning instead of\nan error if the index does not exist.\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for DROP INDEX statement for clients that\nsupport the new progress reporting protocol. For example, if you were using\nthe mysql client, then the progress report might look like this::\n\nURL: https://mariadb.com/kb/en/drop-index/','','https://mariadb.com/kb/en/drop-index/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (721,38,'DROP PACKAGE','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nDROP PACKAGE [IF EXISTS]  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE statement drops a stored package entirely:\n\n* Drops the package specification (earlier created using the CREATE PACKAGE\nstatement).\n* Drops the package implementation, if the implementation was already created\nusing the CREATE PACKAGE BODY statement.\n\nURL: https://mariadb.com/kb/en/drop-package/','','https://mariadb.com/kb/en/drop-package/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (722,38,'DROP PACKAGE BODY','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nDROP PACKAGE BODY [IF EXISTS]  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE BODY statement drops the package body (i.e the\nimplementation), previously created using the CREATE PACKAGE BODY statement.\n\nNote, DROP PACKAGE BODY drops only the package implementation, but does not\ndrop the package specification. Use DROP PACKAGE to drop the package entirely\n(i.e. both implementation and specification).\n\nURL: https://mariadb.com/kb/en/drop-package-body/','','https://mariadb.com/kb/en/drop-package-body/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (723,38,'DROP PROCEDURE','Syntax\n------\n\nDROP PROCEDURE [IF EXISTS] sp_name\n\nDescription\n-----------\n\nThis statement is used to drop a stored procedure. That is, the specified\nroutine is removed from the server along with all privileges specific to the\nprocedure. You must have the ALTER ROUTINE privilege for the routine. If the\nautomatic_sp_privileges server system variable is set, that privilege and\nEXECUTE are granted automatically to the routine creator - see Stored Routine\nPrivileges.\n\nThe IF EXISTS clause is a MySQL/MariaDB extension. It prevents an error from\noccurring if the procedure or function does not exist. A NOTE is produced that\ncan be viewed with SHOW WARNINGS.\n\nWhile this statement takes effect immediately, threads which are executing a\nprocedure can continue execution.\n\nExamples\n--------\n\nDROP PROCEDURE simpleproc;\n\nIF EXISTS:\n\nDROP PROCEDURE simpleproc;\nERROR 1305 (42000): PROCEDURE test.simpleproc does not exist\n\nDROP PROCEDURE IF EXISTS simpleproc;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------------+\n| Level | Code | Message                                  |\n+-------+------+------------------------------------------+\n| Note  | 1305 | PROCEDURE test.simpleproc does not exist |\n+-------+------+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-procedure/','','https://mariadb.com/kb/en/drop-procedure/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (724,38,'DROP SERVER','Syntax\n------\n\nDROP SERVER [ IF EXISTS ] server_name\n\nDescription\n-----------\n\nDrops the server definition for the server named server_name. The\ncorresponding row within the mysql.servers table will be deleted. This\nstatement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED\nADMIN privilege.\n\nDropping a server for a table does not affect any FederatedX, FEDERATED,\nConnect or Spider tables that used this connection information when they were\ncreated.\n\nDROP SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will not return an error if the\nserver does not exist. Unlike all other statements, DROP SERVER IF EXISTS does\nnot issue a note if the server does not exist. See MDEV-9400.\n\nExamples\n--------\n\nDROP SERVER s;\n\nIF EXISTS:\n\nDROP SERVER s;\nERROR 1477 (HY000): The foreign server name you are trying to reference \n does not exist. Data source error:  s\n\nDROP SERVER IF EXISTS s;\nQuery OK, 0 rows affected (0.00 sec)\n\nURL: https://mariadb.com/kb/en/drop-server/','','https://mariadb.com/kb/en/drop-server/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (725,38,'DROP TABLESPACE','The DROP TABLESPACE statement is not supported by MariaDB. It was originally\ninherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is\nalso supported for InnoDB. However, MariaDB has chosen not to include that\nspecific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/kb/en/drop-tablespace/','','https://mariadb.com/kb/en/drop-tablespace/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (726,38,'DROP TRIGGER','Syntax\n------\n\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nDescription\n-----------\n\nThis statement drops a trigger. The schema (database) name is optional. If the\nschema is omitted, the trigger is dropped from the default schema. Its use\nrequires the TRIGGER privilege for the table associated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that does not\nexist. A NOTE is generated for a non-existent trigger when using IF EXISTS.\nSee SHOW WARNINGS.\n\nNote: Triggers for a table are also dropped if you drop the table.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and DROP TRIGGER is atomic.\n\nExamples\n--------\n\nDROP TRIGGER test.example_trigger;\n\nUsing the IF EXISTS clause:\n\nDROP TRIGGER IF EXISTS test.example_trigger;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1360 | Trigger does not exist |\n+-------+------+------------------------+\n\nURL: https://mariadb.com/kb/en/drop-trigger/','','https://mariadb.com/kb/en/drop-trigger/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (727,38,'DROP VIEW','Syntax\n------\n\nDROP VIEW [IF EXISTS]\n  view_name [, view_name] ...\n  [RESTRICT | CASCADE]\n\nDescription\n-----------\n\nDROP VIEW removes one or more views. You must have the DROP privilege for each\nview. If any of the views named in the argument list do not exist, MariaDB\nreturns an error indicating by name which non-existing views it was unable to\ndrop, but it also drops all of the views in the list that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that don\'t\nexist. When this clause is given, a NOTE is generated for each non-existent\nview. See SHOW WARNINGS.\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nIt is possible to specify view names as db_name.view_name. This is useful to\ndelete views from multiple databases with one statement. See Identifier\nQualifiers for details.\n\nThe DROP privilege is required to use DROP TABLE on non-temporary tables. For\ntemporary tables, no privilege is required, because such tables are only\nvisible for the current session.\n\nIf a view references another view, it will be possible to drop the referenced\nview. However, the other view will reference a view which does not exist any\nmore. Thus, querying it will produce an error similar to the following:\n\nERROR 1356 (HY000): View \'db_name.view_name\' references invalid table(s) or \ncolumn(s) or function(s) or definer/invoker of view lack rights to use them\n\nThis problem is reported in the output of CHECK TABLE.\n\nNote that it is not necessary to use DROP VIEW to replace an existing view,\nbecause CREATE VIEW has an OR REPLACE clause.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and DROP VIEW for a singular view is\natomic. Dropping multiple views is crash-safe.\n\nExamples\n--------\n\nDROP VIEW v,v2;\n\nGiven views v and v2, but no view v3\n\nDROP VIEW v,v2,v3;\nERROR 1051 (42S02): Unknown table \'v3\'\n\nDROP VIEW IF EXISTS v,v2,v3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message                 |\n+-------+------+-------------------------+\n| Note  | 1051 | Unknown table \'test.v3\' |\n+-------+------+-------------------------+\n\nURL: https://mariadb.com/kb/en/drop-view/','','https://mariadb.com/kb/en/drop-view/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (728,38,'CONSTRAINT','MariaDB supports the implementation of constraints at the table-level using\neither CREATE TABLE or ALTER TABLE statements. A table constraint restricts\nthe data you can add to the table. If you attempt to insert invalid data on a\ncolumn, MariaDB throws an error.\n\nSyntax\n------\n\n[CONSTRAINT [symbol]] constraint_expression\n\nconstraint_expression:\n | PRIMARY KEY [index_type] (index_col_name, ...) [index_option] ...\n | FOREIGN KEY [index_name] (index_col_name, ...)\n   REFERENCES tbl_name (index_col_name, ...)\n   [ON DELETE reference_option]\n   [ON UPDATE reference_option]\n | UNIQUE [INDEX|KEY] [index_name]\n   [index_type] (index_col_name, ...) [index_option] ...\n | CHECK (check_constraints)\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_option:\n | KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES|NO}\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nDescription\n-----------\n\nConstraints provide restrictions on the data you can add to a table. This\nallows you to enforce data integrity from MariaDB, rather than through\napplication logic. When a statement violates a constraint, MariaDB throws an\nerror.\n\nThere are four types of table constraints:\n\n+------------------------------------+---------------------------------------+\n| Constraint                         | Description                           |\n+------------------------------------+---------------------------------------+\n| PRIMARY KEY                        | Sets the column for referencing       |\n|                                    | rows.  Values must be unique and not  |\n|                                    | null.                                 |\n+------------------------------------+---------------------------------------+\n| FOREIGN KEY                        | Sets the column to reference the      |\n|                                    | primary key on another table.         |\n+------------------------------------+---------------------------------------+\n| UNIQUE                             | Requires values in column or columns  |\n|                                    | only occur once in the table.         |\n+------------------------------------+---------------------------------------+\n| CHECK                              | Checks whether the data meets the     |\n|                                    | given condition.                      |\n+------------------------------------+---------------------------------------+\n\nThe Information Schema TABLE_CONSTRAINTS Table contains information about\ntables that have constraints.\n\nFOREIGN KEY Constraints\n-----------------------\n\nInnoDB supports foreign key constraints. The syntax for a foreign key\nconstraint definition in InnoDB looks like this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n  [index_name] (index_col_name, ...)\n  REFERENCES tbl_name (index_col_name,...)\n  [ON DELETE reference_option]\n  [ON UPDATE reference_option]\n\nreference_option:\n  RESTRICT | CASCADE | SET NULL | NO ACTION\n\nThe Information Schema REFERENTIAL_CONSTRAINTS table has more information\nabout foreign keys.\n\nCHECK Constraints\n-----------------\n\nMariaDB starting with 10.2.1\n----------------------------\nFrom MariaDB 10.2.1, constraints are enforced. Before MariaDB 10.2.1\nconstraint expressions were accepted in the syntax but ignored.\n\nIn MariaDB 10.2.1 you can define constraints in 2 different ways:\n\n* CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraint expression returns false, then the\nrow will not be inserted or updated. One can use most deterministic functions\nin a constraint, including UDFs.\n\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater\nCHECK (a>b));\n\nIf you use the second format and you don\'t give a name to the constraint, then\nthe constraint will get an automatically generated name. This is done so that\nyou can later delete the constraint with ALTER TABLE DROP constraint_name.\n\nOne can disable all constraint expression checks by setting the\ncheck_constraint_checks variable to OFF. This is useful for example when\nloading a table that violates some constraints that you want to later find and\nfix in SQL.\n\nReplication\n-----------\n\nIn row-based replication, only the master checks constraints, and failed\nstatements will not be replicated. In statement-based replication, the slaves\nwill also check constraints. Constraints should therefore be identical, as\nwell as deterministic, in a replication environment.\n\nAuto_increment\n--------------\n\nMariaDB starting with 10.2.6\n----------------------------\n* From MariaDB 10.2.6, auto_increment columns are no longer permitted in check\nconstraints. Previously they were permitted, but would not work correctly. See\nMDEV-11117.\n\nExamples\n--------\n\nCREATE TABLE product (category INT NOT NULL, id INT NOT NULL,\n           price DECIMAL,\n           PRIMARY KEY(category, id)) ENGINE=INNODB;\nCREATE TABLE customer (id INT NOT NULL,\n           PRIMARY KEY (id)) ENGINE=INNODB;\nCREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,\n              product_category INT NOT NULL,\n              product_id INT NOT NULL,\n              customer_id INT NOT NULL,\n              PRIMARY KEY(no),\n              INDEX (product_category, product_id),\n              FOREIGN KEY (product_category, product_id)\n               REFERENCES product(category, id)\n               ON UPDATE CASCADE ON DELETE RESTRICT,\n              INDEX (customer_id),\n              FOREIGN KEY (customer_id)\n               REFERENCES customer(id)) ENGINE=INNODB;\n\nMariaDB starting with 10.2.1\n----------------------------\nThe following examples will work from MariaDB 10.2.1 onwards.\n\nNumeric constraints and comparisons:\n\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater\nCHECK (a>b));\n\nINSERT INTO t1(a) VALUES (1);\nERROR 4022 (23000): CONSTRAINT `a` failed for `test`.`t1`\n\nINSERT INTO t1(a,b) VALUES (3,4);\nERROR 4022 (23000): CONSTRAINT `a_greater` failed for `test`.`t1`\n\nINSERT INTO t1(a,b) VALUES (4,3);\nQuery OK, 1 row affected (0.04 sec)\n\nDropping a constraint:\n\nALTER TABLE t1 DROP CONSTRAINT a_greater;\n\nAdding a constraint:\n\nALTER TABLE t1 ADD CONSTRAINT a_greater CHECK (a>b);\n\nDate comparisons and character length:\n\nCREATE TABLE t2 (name VARCHAR(30) CHECK (CHAR_LENGTH(name)>2), start_date\nDATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL OR\nstart_date<end_date));\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', \'2003-12-15\',\n\'2014-11-09\');\nQuery OK, 1 row affected (0.04 sec)\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Io\', \'2003-12-15\',\n\'2014-11-09\');\nERROR 4022 (23000): CONSTRAINT `name` failed for `test`.`t2`\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', NULL, \'2014-11-09\');\nQuery OK, 1 row affected (0.04 sec)\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', \'2015-12-15\',\n\'2014-11-09\');\nERROR 4022 (23000): CONSTRAINT `end_date` failed for `test`.`t2`\n\nA misplaced parenthesis:\n\nCREATE TABLE t3 (name VARCHAR(30) CHECK (CHAR_LENGTH(name>2)), start_date\nDATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL OR\nstart_date<end_date));\nQuery OK, 0 rows affected (0.32 sec)\n\nINSERT INTO t3(name, start_date, end_date) VALUES(\'Io\', \'2003-12-15\',\n\'2014-11-09\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'Io\' |\n+---------+------+----------------------------------------+\n\nCompare the definition of table t2 to table t3. CHAR_LENGTH(name)>2 is very\ndifferent to CHAR_LENGTH(name>2) as the latter mistakenly performs a numeric\ncomparison on the name field, leading to unexpected results.\n\nURL: https://mariadb.com/kb/en/constraint/','','https://mariadb.com/kb/en/constraint/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (729,38,'Dynamic Columns','Dynamic columns allow one to store different sets of columns for each row in a\ntable. It works by storing a set of columns in a blob and having a small set\nof functions to manipulate it. Dynamic columns should be used when it is not\npossible to use regular columns. A typical use case is when one needs to store\nitems that may have many different attributes (like size, color, weight, etc),\nand the set of possible attributes is very large and/or unknown in advance. In\nthat case, attributes can be put into dynamic columns.\n\nDynamic Columns Basics\n----------------------\n\nThe table should have a blob column which will be used as storage for dynamic\ncolumns:\n\ncreate table assets (\n item_name varchar(32) primary key, -- A common attribute for all items\n dynamic_cols  blob  -- Dynamic columns will be stored here\n);\n\nOnce created, one can access dynamic columns via dynamic column functions:\n\nInsert a row with two dynamic columns: color=blue, size=XL\n\nINSERT INTO assets VALUES \n (\'MariaDB T-shirt\', COLUMN_CREATE(\'color\', \'blue\', \'size\', \'XL\'));\n\nInsert another row with dynamic columns: color=black, price=500\n\nINSERT INTO assets VALUES\n (\'Thinkpad Laptop\', COLUMN_CREATE(\'color\', \'black\', \'price\', 500));\n\nSelect dynamic column \'color\' for all items:\n\nSELECT item_name, COLUMN_GET(dynamic_cols, \'color\' as char) \n AS color FROM assets;\n+-----------------+-------+\n| item_name       | color |\n+-----------------+-------+\n| MariaDB T-shirt | blue  |\n| Thinkpad Laptop | black |\n+-----------------+-------+\n\nIt is possible to add and remove dynamic columns from a row:\n\n-- Remove a column:\nUPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, \"price\") \nWHERE COLUMN_GET(dynamic_cols, \'color\' as char)=\'black\';\n\n-- Add a column:\nUPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, \'warranty\', \'3 years\')\nWHERE item_name=\'Thinkpad Laptop\';\n\nYou can also list all columns, or get them together with their values in JSON\nformat:\n\nSELECT item_name, column_list(dynamic_cols) FROM assets;\n+-----------------+---------------------------+\n| item_name       | column_list(dynamic_cols) |\n+-----------------+---------------------------+\n| MariaDB T-shirt | `size`,`color`            |\n| Thinkpad Laptop | `color`,`warranty`        |\n+-----------------+---------------------------+\n\nSELECT item_name, COLUMN_JSON(dynamic_cols) FROM assets;\n+-----------------+----------------------------------------+\n| item_name       | COLUMN_JSON(dynamic_cols)              |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"}           |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3 years\"} |\n+-----------------+----------------------------------------+\n\nDynamic Columns Reference\n-------------------------\n\nThe rest of this page is a complete reference of dynamic columns in MariaDB\n\nDynamic Columns Functions\n-------------------------\n\nCOLUMN_CREATE\n-------------\n\nCOLUMN_CREATE(column_nr, value [as type], [column_nr, value \n [as type]]...);\nCOLUMN_CREATE(column_name, value [as type], [column_name, value \n [as type]]...);\n\nReturn a dynamic columns blob that stores the specified columns with values.\n\nThe return value is suitable for\n\n* \nstoring in a table\nfurther modification with other dynamic columns functions\n\nThe as type part allows one to specify the value type. In most cases, this is\nredundant because MariaDB will be able to deduce the type of the value.\nExplicit type specification may be needed when the type of the value is not\napparent. For example, a literal \'2012-12-01\' has a CHAR type by default, one\nwill need to specify \'2012-12-01\' AS DATE to have it stored as a date. See the\nDatatypes section for further details. Note also MDEV-597.\n\nTypical usage:\n\n-- MariaDB 5.3+:\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(1 /*column id*/, \"value\");\n-- MariaDB 10.0.1+:\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(\"column_name\", \"value\");\n\nCOLUMN_ADD\n----------\n\nCOLUMN_ADD(dyncol_blob, column_nr, value [as type], \n [column_nr, value [as type]]...);\nCOLUMN_ADD(dyncol_blob, column_name, value [as type], \n [column_name, value [as type]]...);\n\nAdds or updates dynamic columns.\n\n* \ndyncol_blob must be either a valid dynamic columns blob (for example,\nCOLUMN_CREATE returns such blob), or an empty string.\ncolumn_name specifies the name of the column to be added. If dyncol_blob\nalready has a column with this name, it will be overwritten.\nvalue specifies the new value for the column.  Passing a NULL value will cause\nthe column to be deleted.\nas type is optional. See #datatypes section for a discussion about types.\n\nThe return value is a dynamic column blob after the modifications.\n\nTypical usage:\n\n-- MariaDB 5.3+:\nUPDATE tbl SET dyncol_blob=COLUMN_ADD(dyncol_blob, 1 /*column id*/, \"value\") \n WHERE id=1;\n-- MariaDB 10.0.1+:\nUPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob, \"column_name\", \"value\") \n WHERE id=1;\n\nNote: COLUMN_ADD() is a regular function (just like CONCAT()), hence, in order\nto update the value in the table you have to use the UPDATE ... SET\ndynamic_col=COLUMN_ADD(dynamic_col, ....) pattern.\n\nCOLUMN_GET\n----------\n\nCOLUMN_GET(dyncol_blob, column_nr as type);\nCOLUMN_GET(dyncol_blob, column_name as type);\n\nGet the value of a dynamic column by its name. If no column with the given\nname exists, NULL will be returned.\n\ncolumn_name as type requires that one specify the datatype of the dynamic\ncolumn they are reading.\n\nThis may seem counter-intuitive: why would one need to specify which datatype\nthey\'re retrieving? Can\'t the dynamic columns system figure the datatype from\nthe data being stored?\n\nThe answer is: SQL is a statically-typed language. The SQL interpreter needs\nto know the datatypes of all expressions before the query is run (for example,\nwhen one is using prepared statements and runs \"select COLUMN_GET(...)\", the\nprepared statement API requires the server to inform the client about the\ndatatype of the column being read before the query is executed and the server\ncan see what datatype the column actually has).\n\nSee the Datatypes section for more information about datatypes.\n\nCOLUMN_DELETE\n-------------\n\nCOLUMN_DELETE(dyncol_blob, column_nr, column_nr...);\nCOLUMN_DELETE(dyncol_blob, column_name, column_name...);\n\nDelete a dynamic column with the specified name. Multiple names can be given.\n\nThe return value is a dynamic column blob after the modification.\n\nCOLUMN_EXISTS\n-------------\n\nCOLUMN_EXISTS(dyncol_blob, column_nr);\nCOLUMN_EXISTS(dyncol_blob, column_name);\n\nCheck if a column with name column_name exists in dyncol_blob. If yes, return\n1, otherwise return 0.\n\nCOLUMN_LIST\n-----------\n\nCOLUMN_LIST(dyncol_blob);\n\nReturn a comma-separated list of column names. The names are quoted with\nbackticks.\n\nSELECT column_list(column_create(\'col1\',\'val1\',\'col2\',\'val2\'));\n+---------------------------------------------------------+\n| column_list(column_create(\'col1\',\'val1\',\'col2\',\'val2\')) |\n+---------------------------------------------------------+\n| `col1`,`col2`                                           |\n+---------------------------------------------------------+\n\nCOLUMN_CHECK\n------------\n\nCOLUMN_CHECK(dyncol_blob);\n\nCheck if dyncol_blob is a valid packed dynamic columns blob. Return value of 1\nmeans the blob is valid, return value of 0 means it is not.\n\nRationale: Normally, one works with valid dynamic column blobs. Functions like\nCOLUMN_CREATE, COLUMN_ADD, COLUMN_DELETE always return valid dynamic column\nblobs. However, if a dynamic column blob is accidentally truncated, or\ntranscoded from one character set to another, it will be corrupted. This\nfunction can be used to check if a value in a blob field is a valid dynamic\ncolumn blob.\n\nNote: It is possible that a truncation cut a Dynamic Column \"clearly\" so that\nCOLUMN_CHECK will not notice the corruption, but in any case of truncation a\nwarning is issued during value storing.\n\nCOLUMN_JSON\n-----------\n\nCOLUMN_JSON(dyncol_blob);\n\nReturn a JSON representation of data in dyncol_blob.\n\nExample:\n\nSELECT item_name, COLUMN_JSON(dynamic_cols) FROM assets;\n+-----------------+----------------------------------------+\n| item_name       | COLUMN_JSON(dynamic_cols)              |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"}           |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3 years\"} |\n+-----------------+----------------------------------------+\n\nLimitation: COLUMN_JSON will decode nested dynamic columns at a nesting level\nof not more than 10 levels deep. Dynamic columns that are nested deeper than\n10 levels will be shown as BINARY string, without encoding.\n\nNesting Dynamic Columns\n-----------------------\n\nIt is possible to use nested dynamic columns by putting one dynamic column\nblob inside another. The COLUMN_JSON function will display nested columns.\n\nSET @tmp= column_create(\'parent_column\', \n column_create(\'child_column\', 12345));\nQuery OK, 0 rows affected (0.00 sec)\n\nSELECT column_json(@tmp);\n+------------------------------------------+\n| column_json(@tmp)                        |\n+------------------------------------------+\n| {\"parent_column\":{\"child_column\":12345}} |\n+------------------------------------------+\n\nSELECT column_get(column_get(@tmp, \'parent_column\' AS char), \n \'child_column\' AS int);\n+------------------------------------------------------------------------------\n\n| column_get(column_get(@tmp, \'parent_column\' as char), \'child_column\' as int)\n|\n+------------------------------------------------------------------------------\n\n|                                                                        12345\n|\n+------------------------------------------------------------------------------\n\nIf you are trying to get a nested dynamic column as a string use \'as BINARY\'\nas the last argument of COLUMN_GET (otherwise problems with character set\nconversion and illegal symbols are possible):\n\nselect column_json( column_get(\n column_create(\'test1\',\n  column_create(\'key1\',\'value1\',\'key2\',\'value2\',\'key3\',\'value3\')),\n \'test1\' as BINARY));\n\nDatatypes\n---------\n\nIn SQL, one needs to define the type of each column in a table. Dynamic\ncolumns do not provide any way to declare a type in advance (\"whenever there\nis a column \'weight\', it should be integer\" is not possible). However, each\nparticular dynamic column value is stored together with its datatype.\n\nThe set of possible datatypes is mostly the same as that used by the SQL CAST\nand CONVERT functions. However, note that there are currently some differences\n- see MDEV-597.\n\n+--------+----------------------------------------------+-------------------+\n| type   | dynamic column internal type                 | description       |\n+--------+----------------------------------------------+-------------------+\n| BINARY | DYN_COL_STRING                               | (variable length  |\n| (N)]   |                                              | string with       |\n|        |                                              | binary charset)   |\n+--------+----------------------------------------------+-------------------+\n| CHAR[( | DYN_COL_STRING                               | (variable length  |\n| )]     |                                              | string with       |\n|        |                                              | charset)          |\n+--------+----------------------------------------------+-------------------+\n| DATE   | DYN_COL_DATE                                 | (date - 3 bytes)  |\n+--------+----------------------------------------------+-------------------+\n| DATETI | DYN_COL_DATETIME                             | (date and time    |\n| E[(D)] |                                              | (with             |\n|        |                                              | microseconds) -   |\n|        |                                              | 9 bytes)          |\n+--------+----------------------------------------------+-------------------+\n| DECIMA | DYN_COL_DECIMAL                              | (variable length  |\n| [(M[,D |                                              | binary decimal    |\n| )]     |                                              | representation    |\n|        |                                              | with MariaDB      |\n|        |                                              | limitation)       |\n+--------+----------------------------------------------+-------------------+\n| DOUBLE | DYN_COL_DOUBLE                               | (64 bit           |\n| (M,D)] |                                              | double-precision  |\n|        |                                              | floating point)   |\n+--------+----------------------------------------------+-------------------+\n| INTEGE | DYN_COL_INT                                  | (variable         |\n|        |                                              | length, up to 64  |\n|        |                                              | bit signed        |\n|        |                                              | integer)          |\n+--------+----------------------------------------------+-------------------+\n| SIGNED | DYN_COL_INT                                  | (variable         |\n| [INTEG |                                              | length, up to 64  |\n| R]     |                                              | bit signed        |\n|        |                                              | integer)          |\n+--------+----------------------------------------------+-------------------+\n| TIME[( | DYN_COL_TIME                                 | (time (with       |\n| )]     |                                              | microseconds,     |\n|        |                                              | may be negative)  |\n|        |                                              | - 6 bytes)        |\n+--------+----------------------------------------------+-------------------+\n| UNSIGN | DYN_COL_UINT                                 | (variable         |\n| D      |                                              | length, up to     |','','https://mariadb.com/kb/en/dynamic-columns/');
update help_topic set description = CONCAT(description, '\n| [INTEG |                                              | 64bit unsigned    |\n| R]     |                                              | integer)          |\n+--------+----------------------------------------------+-------------------+\n\nA Note About Lengths\n--------------------\n\nIf you\'re running queries like\n\nSELECT COLUMN_GET(blob, \'colname\' as CHAR) ...\n\nwithout specifying a maximum length (i.e. using #as CHAR#, not as CHAR(n)),\nMariaDB will report the maximum length of the resultset column to be\n53,6870,911 (bytes or characters?) for MariaDB 5.3-10.0.0 and 16,777,216 for\nMariaDB 10.0.1+. This may cause excessive memory usage in some client\nlibraries, because they try to pre-allocate a buffer of maximum resultset\nwidth. If you suspect you\'re hitting this problem, use CHAR(n) whenever you\'re\nusing COLUMN_GET in the select list.\n\nMariaDB 5.3 vs MariaDB 10.0\n---------------------------\n\nThe dynamic columns feature was introduced into MariaDB in two steps:\n\n* MariaDB 5.3 was the first version to support dynamic columns. Only numbers\n could be used as column names in this version.\n* In MariaDB 10.0.1, column names can be either numbers or strings.\n Also, the COLUMN_JSON and COLUMN_CHECK functions were added.\n\nSee also Dynamic Columns in MariaDB 10.\n\nClient-side API\n---------------\n\nIt is also possible to create or parse dynamic columns blobs on the client\nside. libmysql client library now includes an API for writing/reading dynamic\ncolumn blobs. See dynamic-columns-api for details.\n\nLimitations\n-----------\n\n+---------------------------------------------------+------------------------+\n| Description                                       | Limit                  |\n+---------------------------------------------------+------------------------+\n| Max number of columns                             | 65535                  |\n+---------------------------------------------------+------------------------+\n| Max total length of packed dynamic column         | max_allowed_packet     |\n|                                                   | (1G)                   |\n+---------------------------------------------------+------------------------+\n\nURL: https://mariadb.com/kb/en/dynamic-columns/') WHERE help_topic_id = 729;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (730,38,'Dynamic Columns from MariaDB 10','MariaDB starting with 10.0.1\n----------------------------\nMariaDB 10.0.1 introduced the following improvements to the dynamic columns\nfeature.\n\nColumn Name Support\n-------------------\n\nIt is possible to refer to column by names. Names can be used everywhere where\nin MariaDB 5.3 one could use only strings:\n\n* Create a dynamic column blob:\n\nCOLUMN_CREATE(\'int_col\', 123 as int, \'double_col\', 3.14 as double,\n\'string_col\', \'text-data\' as char);\n\n* Set a column value:\n\nCOLUMN_ADD(dyncol_blob, \'intcol\', 1234);\n\n* Get a column value:\n\nCOLUMN_GET(dynstr, \'column1\' as char(10));\n\n* Check whether a column exists\n\nCOLUMN_EXISTS(dyncol_blob, \'column_name\');\n\nChanges in Behavior\n-------------------\n\n* Column list output now includes quoting:\n\nselect column_list(column_create(1, 22, 2, 23));\n+------------------------------------------+\n| column_list(column_create(1, 22, 2, 23)) |\n+------------------------------------------+\n| `1`,`2`                                  |\n+------------------------------------------+\nselect column_list(column_create(\'column1\', 22, \'column2\', 23)); \n+----------------------------------------------------------+\n| column_list(column_create(\'column1\', 22, \'column2\', 23)) |\n+----------------------------------------------------------+\n| `column1`,`column2`                                      |\n+----------------------------------------------------------+\n\n* Column name interpretation has been changed so that the string now is not\nconverted to a number. So some \"magic\" tricks will not work any more, for\nexample, \"1test\" and \"1\" now become different column names:\n\nselect column_list(column_add(column_create(\'1a\', 22), \'1b\', 23));\n+------------------------------------------------------------+\n| column_list(column_add(column_create(\'1a\', 22), \'1b\', 23)) |\n+------------------------------------------------------------+\n| `1a`,`1b`                                                  |\n+------------------------------------------------------------+\n\n* Old behavior:\n\nselect column_list(column_add(column_create(\'1a\', 22), \'1b\', 23));\n+------------------------------------------------------------+\n| column_list(column_add(column_create(\'1a\', 22), \'1b\', 23)) |\n+------------------------------------------------------------+\n| 1                                                          |\n+------------------------------------------------------------+\n\nNew Functions\n-------------\n\nThe following new functions have been added to dynamic columns in MariaDB 10\n\nCOLUMN_CHECK\n------------\n\nCOLUMN_CHECK is used to check a column\'s integrity. When it encounters an\nerror it does not return illegal format errors but returns false instead. It\nalso checks integrity more thoroughly and finds errors in the dynamic column\ninternal structures which might not be found by other functions.\n\nselect column_check(column_create(\'column1\', 22));\n+--------------------------------------------+\n| column_check(column_create(\'column1\', 22)) |\n+--------------------------------------------+\n|                                          1 |\n+--------------------------------------------+\nselect column_check(\'abracadabra\');\n+-----------------------------+\n| column_check(\'abracadabra\') |\n+-----------------------------+\n|                           0 |\n+-----------------------------+\n\nCOLUMN_JSON\n-----------\n\nCOLUMN_JSON converts all dynamic column record content to a JSON object.\n\nselect column_json(column_create(\'column1\', 1, \'column2\', \"two\"));\n+------------------------------------------------------------+\n| column_json(column_create(\'column1\', 1, \'column2\', \"two\")) |\n+------------------------------------------------------------+\n| {\"column1\":1,\"column2\":\"two\"}                              |\n+------------------------------------------------------------+\n\nOther Changes\n-------------\n\n* All API functions has prefix mariadb_dyncol_ (old prefix dynamic_column_ is\ndepricated\n* API changed to be able to work with the new format (*_named functions).\n* Removed \'delete\' function because deleting could be done by adding NULL\nvalue.\n* \'Time\' and \'datetime\' in the new format are stored without microseconds if\nthey are 0.\n* New function added to API (except that two which are representing SQL level\nfunctions):\n\'Unpack\' the dynamic columns content to an arrays of values and names.\n3 functions to get any column value as string, integer (long long) or floating\npoint (double).\n\n* New type of \"dynamic column\" row added on the API level (in SQL level output\nit is a string but if you use dynamic column functions to construct object it\nwill be added as dynamic column value) which allow to add dynamic columns\ninside dynamic columns. JSON function represent such recursive constructions\ncorrectly but limit depth of representation as current implementation limit\n(internally depth of dynamic columns embedding is not limited).\n\nInterface with Cassandra\n------------------------\n\nCassandraSE is no longer actively being developed and has been removed in\nMariaDB 10.6. See MDEV-23024.\n\nSome internal changes were added to dynamic columns to allow them to serve as\nan interface to Apache Cassandra dynamic columns. The Cassandra engine may\npack all columns which were not mentioned in the MariaDB interface table\ndefinition and even bring changes in the dynamic column contents back to the\ncassandra columns family (the table analog in cassandra).\n\nURL: https://mariadb.com/kb/en/dynamic-columns-from-mariadb-10/','','https://mariadb.com/kb/en/dynamic-columns-from-mariadb-10/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (731,38,'MERGE','Description\n-----------\n\nThe MERGE storage engine, also known as the MRG_MyISAM engine, is a collection\nof identical MyISAM tables that can be used as one. \"Identical\" means that all\ntables have identical column and index information. You cannot merge MyISAM\ntables in which the columns are listed in a different order, do not have\nexactly the same columns, or have the indexes in different order. However, any\nor all of the MyISAM tables can be compressed with myisampack. Columns names\nand indexes names can be different, as long as data types and NULL/NOT NULL\nclauses are the same. Differences in table options such as AVG_ROW_LENGTH,\nMAX_ROWS, or PACK_KEYS do not matter.\n\nEach index in a MERGE table must match an index in underlying MyISAM tables,\nbut the opposite is not true. Also, a MERGE table cannot have a PRIMARY KEY or\nUNIQUE indexes, because it cannot enforce uniqueness over all underlying\ntables.\n\nThe following options are meaningful for MERGE tables:\n\n* UNION. This option specifies the list of the underlying MyISAM tables. The\nlist is enclosed between parentheses and separated with commas.\n* INSERT_METHOD. This options specifies whether, and how, INSERTs are allowed\nfor the table. Allowed values are: NO (INSERTs are not allowed), FIRST (new\nrows will be written into the first table specified in the UNION list), LAST\n(new rows will be written into the last table specified in the UNION list).\nThe default value is NO.\n\nIf you define a MERGE table with a definition which is different from the\nunderlying MyISAM tables, or one of the underlying tables is not MyISAM, the\nCREATE TABLE statement will not return any error. But any statement which\ninvolves the table will produce an error like the following:\n\nERROR 1168 (HY000): Unable to open underlying table which is differently\ndefined \n or of non-MyISAM type or doesn\'t exist\n\nA CHECK TABLE will show more information about the problem.\n\nThe error is also produced if the table is properly define, but an underlying\ntable\'s definition changes at some point in time.\n\nIf you try to insert a new row into a MERGE table with INSERT_METHOD=NO, you\nwill get an error like the following:\n\nERROR 1036 (HY000): Table \'tbl_name\' is read only\n\nIt is possible to build a MERGE table on MyISAM tables which have one or more\nvirtual columns. MERGE itself does not support virtual columns, thus such\ncolumns will be seen as regular columns. The data types and sizes will still\nneed to be identical, and they cannot be NOT NULL.\n\nExamples\n--------\n\nCREATE TABLE t1 (\n  a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n  message CHAR(20)) ENGINE=MyISAM;\n\nCREATE TABLE t2 (\n  a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n  message CHAR(20)) ENGINE=MyISAM;\n\nINSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\n\nINSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\n\nCREATE TABLE total (\n  a INT NOT NULL AUTO_INCREMENT,\n  message CHAR(20), INDEX(a))\n  ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n\nSELECT * FROM total;\n+---+---------+\n| a | message |\n+---+---------+\n| 1 | Testing |\n| 2 | table   |\n| 3 | t1      |\n| 1 | Testing |\n| 2 | table   |\n| 3 | t2      |\n+---+---------+\n\nIn the following example, we\'ll create three MyISAM tables, and then a MERGE\ntable on them. However, one of them uses a different data type for the column\nb, so a SELECT will produce an error:\n\nCREATE TABLE t1 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n\nCREATE TABLE t2 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n\nCREATE TABLE t3 (\n a INT,\n b TINYINT\n) ENGINE = MyISAM;\n\nCREATE TABLE t_mrg (\n a INT,\n b INT\n) ENGINE = MERGE,UNION=(t1,t2,t3);\n\nSELECT * FROM t_mrg;\nERROR 1168 (HY000): Unable to open underlying table which is differently\ndefined\n or of non-MyISAM type or doesn\'t exist\n\nTo find out what\'s wrong, we\'ll use a CHECK TABLE:\n\nCHECK TABLE t_mrg\\G\n*************************** 1. row ***************************\n Table: test.t_mrg\n   Op: check\nMsg_type: Error\nMsg_text: Table \'test.t3\' is differently defined or of non-MyISAM type or\ndoesn\'t exist\n*************************** 2. row ***************************\n Table: test.t_mrg\n   Op: check\nMsg_type: Error\nMsg_text: Unable to open underlying table which is differently defined or of\nnon-MyISAM type or doesn\'t exist\n*************************** 3. row ***************************\n Table: test.t_mrg\n   Op: check\nMsg_type: error\nMsg_text: Corrupt\n\nNow, we know that the problem is in t3\'s definition.\n\nURL: https://mariadb.com/kb/en/merge/','','https://mariadb.com/kb/en/merge/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (732,39,'Sequence Overview','MariaDB starting with 10.3\n--------------------------\nSequences were introduced in MariaDB 10.3.\n\nIntroduction\n------------\n\nA sequence is an object that generates a sequence of numeric values, as\nspecified by the CREATE SEQUENCE statement.\n\nCREATE SEQUENCE will create a sequence that generates new values when called\nwith NEXT VALUE FOR sequence_name. It\'s an alternative to AUTO INCREMENT when\none wants to have more control of how the numbers are generated. As the\nSEQUENCE caches values (up to the CACHE value in the CREATE SEQUENCE\nstatement, by default 1000) it can in some cases be much faster than AUTO\nINCREMENT. Another benefit is that one can access the last value generated by\nall used sequences, which solves one of the limitations with LAST_INSERT_ID().\n\nCreating a Sequence\n-------------------\n\nThe CREATE SEQUENCE statement is used to create a sequence. Here is an example\nof a sequence starting at 100, incrementing by 10 each time:\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nThe CREATE SEQUENCE statement, along with defaults, can be viewd with the SHOW\nCREATE SEQUENCE STATEMENT, for example:\n\nSHOW CREATE SEQUENCE s\\G\n*************************** 1. row ***************************\n   Table: s\nCreate Table: CREATE SEQUENCE `s` start with 100 minvalue 1 maxvalue\n9223372036854775806 \n increment by 10 cache 1000 nocycle ENGINE=InnoDB\n\nUsing Sequence Objects\n----------------------\n\nTo get the next value from a sequence, use\n\nNEXT VALUE FOR sequence_name\n\nor\n\nNEXTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.nextval\n\nFor retrieving the last value used by the current connection from a sequence\nuse:\n\nPREVIOUS VALUE FOR sequence_name\n\nor\n\nLASTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.currval\n\nFor example:\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        100 |\n+------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        110 |\n+------------+\n\nSELECT LASTVAL(s);\n+------------+\n| LASTVAL(s) |\n+------------+\n|        110 |\n+------------+\n\nUsing Sequences in DEFAULT\n--------------------------\n\nMariaDB starting with 10.3.3\n----------------------------\nStarting from 10.3.3 you can use Sequences in DEFAULT:\n\ncreate sequence s1;\ncreate table t1 (a int primary key default (next value for s1), b int);\ninsert into t1 (b) values (1),(2);\nselect * from t1;\n+---+------+\n| a | b    |\n+---+------+\n| 1 |    1 |\n| 2 |    2 |\n+---+------+\n\nChanging a Sequence\n-------------------\n\nThe ALTER SEQUENCE statement is used for changing sequences. For example, to\nrestart the sequence at another value:\n\nALTER SEQUENCE s RESTART 50;\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|         50 |\n+------------+\n\nThe SETVAL function can also be used to set the next value to be returned for\na SEQUENCE, for example:\n\nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n|            100 |\n+----------------+\n\nSETVAL can only be used to increase the sequence value. Attempting to set a\nlower value will fail, returning NULL:\n\nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n|          NULL |\n+---------------+\n\nDropping a Sequence\n-------------------\n\nThe DROP SEQUENCE statement is used to drop a sequence, for example:\n\nDROP SEQUENCE s;\n\nReplication\n-----------\n\nIf one wants to use Sequences in a master-master setup or with Galera one\nshould use INCREMENT=0. This will tell the Sequence to use\nauto_increment_increment and auto_increment_offset to generate unique values\nfor each server.\n\nStandards Compliance\n--------------------\n\nMariaDB 10.3 supports both ANSI SQL and Oracle syntax for sequences.\n\nHowever as SEQUENCE is implemented as a special kind of table, it uses the\nsame namespace as tables. The benefits are that sequences show up in SHOW\nTABLES, and one can also create a sequence with CREATE TABLE and drop it with\nDROP TABLE. One can SELECT from it as from any other table. This ensures that\nall old tools that work with tables should work with sequences.\n\nSince sequence objects act as regular tables in many contexts, they will be\naffected by LOCK TABLES. This is not the case in other DBMS, such as Oracle,\nwhere LOCK TABLE does not affect sequences.\n\nNotes\n-----\n\nOne of the goals with the Sequence implementation is that all old tools, such\nas mysqldump, should work unchanged, while still keeping the normal usage of\nsequence standard compatibly.\n\nTo make this possible, sequence is currently implemented as a table with a few\nexclusive properties.\n\nThe special properties for sequence tables are:\n\n* A sequence table has always one row.\n* When one creates a sequence, either with CREATE TABLE or CREATE SEQUENCE,\none row will be inserted.\n* If one tries to insert into a sequence table, the single row will be\nupdated.  This allows mysqldump to work but also gives the additional benefit\nthat one can change all properties of a sequence with a single insert. New\napplications should of course also use ALTER SEQUENCE.\n* UPDATE or DELETE can\'t be performed on Sequence objects.\n* Doing a select on the sequence shows the current state of the sequence,\nexcept the values that are reserved in the cache.  The next_value column shows\nthe next value not reserved by the cache.\n* FLUSH TABLES will close the sequence and the next sequence number generated\nwill be according to what\'s stored in the Sequence object. In effect, this\nwill discard the cached values.\n* A number of normal table operations work on Sequence tables. See next\nsection.\n\nTable Operations that Work with Sequences\n-----------------------------------------\n\n* SHOW CREATE TABLE sequence_name. This shows the table structure that is\nbehind the SEQUENCE including the field names that can be used with SELECT or\neven CREATE TABLE.\n* CREATE TABLE sequence-structure ... SEQUENCE=1\n* ALTER TABLE sequence RENAME TO sequence2\n* RENAME TABLE sequence_name TO new_sequence_name\n* DROP TABLE sequence_name. This is allowed mainly to get old tools like\nmysqldump to work with sequence tables.\n* SHOW TABLES\n\nImplementation\n--------------\n\nInternally, sequence tables are created as a normal table without rollback\n(the InnoDB, Aria and MySAM engines support this), wrapped by a sequence\nengine object. This allowed us to create sequences with almost no performance\nimpact for normal tables. (The cost is one \'if\' per insert if the binary log\nis enabled).\n\nUnderlying Table Structure\n--------------------------\n\nThe following example shows the table structure of sequences and how it can be\nused as a table. (Output of results are slightly edited to make them easier to\nread)\n\ncreate sequence t1;\nshow create sequence t1\\G\n*************************** 1. row ***************************\n CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806\n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nshow create table t1\\G\n*************************** 1. row ***************************\nCreate Table: CREATE TABLE `t1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value when sequences is\ncreated or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment value\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if no cycles are\nallowed, 1 if the sequence should begin a new cycle when maximum_value is\npassed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles have been done\'\n) ENGINE=InnoDB SEQUENCE=1\n\nselect * from t1\\G\nnext_not_cached_value: 1\n minimum_value: 1\n maximum_value: 9223372036854775806\n start_value: 1\n increment: 1\n cache_size: 1000\n cycle_option: 0\n cycle_count: 0\n\nThe cycle_count column is incremented every time the sequence wraps around.\n\nCredits\n-------\n\n* Thanks to Jianwe Zhao from Aliyun for his work on SEQUENCE in AliSQL, which\ngave ideas and inspiration for this work.\n* Thanks to Peter Gulutzan,who helped test and gave useful comments about the\nimplementation.\n\nURL: https://mariadb.com/kb/en/sequence-overview/','','https://mariadb.com/kb/en/sequence-overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (733,39,'CREATE SEQUENCE','MariaDB starting with 10.3\n--------------------------\nCREATE SEQUENCE was introduced in MariaDB 10.3.\n\nSyntax\n------\n\nCREATE [OR REPLACE] [TEMPORARY] SEQUENCE [IF NOT EXISTS] sequence_name\n[ INCREMENT [ BY | = ] increment ]\n[ MINVALUE [=] minvalue | NO MINVALUE | NOMINVALUE ]\n[ MAXVALUE [=] maxvalue | NO MAXVALUE | NOMAXVALUE ]\n[ START [ WITH | = ] start ] \n[ CACHE [=] cache | NOCACHE ] [ CYCLE | NOCYCLE] \n[table_options]\nThe options for CREATE SEQUENCE can be given in any order, optionally followed\nby table_options.\n\ntable_options can be any of the normal table options in CREATE TABLE but the\nmost usable ones are ENGINE=... and COMMENT=.\n\nNOMAXVALUE and NOMINVALUE are there to allow one to create SEQUENCEs using the\nOracle syntax.\n\nDescription\n-----------\n\nCREATE SEQUENCE will create a sequence that generates new values when called\nwith NEXT VALUE FOR sequence_name. It\'s an alternative to AUTO INCREMENT when\none wants to have more control of how the numbers are generated. As the\nSEQUENCE caches values (up to CACHE) it can in some cases be much faster than\nAUTO INCREMENT. Another benefit is that one can access the last value\ngenerated by all used sequences, which solves one of the limitations with\nLAST_INSERT_ID().\n\nCREATE SEQUENCE requires the CREATE privilege.\n\nDROP SEQUENCE can be used to drop a sequence, and ALTER SEQUENCE to change it.\n\nArguments to Create\n-------------------\n\nThe following options may be used:\n\n+---------------+------------------------------+----------------------------+\n| Option        | Default value                | Description                |\n+---------------+------------------------------+----------------------------+\n| INCREMENT     | 1                            | Increment to use for       |\n|               |                              | values. May be negative.   |\n|               |                              | Setting an increment of 0  |\n|               |                              | causes the sequence to     |\n|               |                              | use the value of the       |\n|               |                              | auto_increment_increment   |\n|               |                              | system variable at the     |\n|               |                              | time of creation, which    |\n|               |                              | is always a positive       |\n|               |                              | number. (see MDEV-16035).  |\n+---------------+------------------------------+----------------------------+\n| MINVALUE      | 1 if INCREMENT > 0 and       | Minimum value for the      |\n|               | -9223372036854775807 if      | sequence                   |\n|               | INCREMENT < 0                |                            |\n+---------------+------------------------------+----------------------------+\n| MAXVALUE      | 9223372036854775806 if       | Max value for sequence     |\n|               | INCREMENT > 0 and -1 if      |                            |\n|               | INCREMENT < 0                |                            |\n+---------------+------------------------------+----------------------------+\n| START         | MINVALUE if INCREMENT > 0    | First value that the       |\n|               | and MAX_VALUE if INCREMENT<  | sequence will generate     |\n|               | 0                            |                            |\n+---------------+------------------------------+----------------------------+\n| CACHE         | 1000                         | Number of values that      |\n|               |                              | should be cached. 0 if no  |\n|               |                              | CACHE.  The underlying     |\n|               |                              | table will be updated      |\n|               |                              | first time a new sequence  |\n|               |                              | number is generated and    |\n|               |                              | each time the cache runs   |\n|               |                              | out.                       |\n+---------------+------------------------------+----------------------------+\n\nIf CYCLE is used then the sequence should start again from MINVALUE after it\nhas run out of values. Default value is NOCYCLE.\n\nConstraints on Create Arguments\n-------------------------------\n\nTo be able to create a legal sequence, the following must hold:\n\n* MAXVALUE >= start\n* MAXVALUE > MINVALUE\n* START >= MINVALUE\n* MAXVALUE <= 9223372036854775806  (LONGLONG_MAX-1)\n* MINVALUE >= -9223372036854775807 (LONGLONG_MIN+1)\n\nNote that sequences can\'t generate the maximum/minimum 64 bit number because\nof the constraint of MINVALUE and MAXVALUE.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE SEQUENCE is atomic.\n\nExamples\n--------\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nCREATE SEQUENCE s2 START WITH -100 INCREMENT BY -10;\n\nThe following statement fails, as the increment conflicts with the defaults\n\nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10;\nERROR 4082 (HY000): Sequence \'test.s3\' values are conflicting\n\nThe sequence can be created by specifying workable minimum and maximum values:\n\nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10 MINVALUE=-100 MAXVALUE=1000;\n\nURL: https://mariadb.com/kb/en/create-sequence/','','https://mariadb.com/kb/en/create-sequence/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (734,39,'ALTER SEQUENCE','MariaDB starting with 10.3.1\n----------------------------\nALTER SEQUENCE was introduced in MariaDB 10.3.\n\nSyntax\n------\n\nALTER SEQUENCE [IF EXISTS] sequence_name\n[ INCREMENT [ BY | = ] increment ]\n[ MINVALUE [=] minvalue | NO MINVALUE | NOMINVALUE ]\n[ MAXVALUE [=] maxvalue | NO MAXVALUE | NOMAXVALUE ]\n[ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ]\n[ RESTART [[WITH | =] restart]\n\nALTER SEQUENCE allows one to change any values for a SEQUENCE created with\nCREATE SEQUENCE.\n\nThe options for ALTER SEQUENCE can be given in any order.\n\nDescription\n-----------\n\nALTER SEQUENCE changes the parameters of an existing sequence generator. Any\nparameters not specifically set in the ALTER SEQUENCE command retain their\nprior settings.\n\nALTER SEQUENCE requires the ALTER privilege.\n\nArguments to ALTER SEQUENCE\n---------------------------\n\nThe following options may be used:\n\n+---------------+-------------------------------+---------------------------+\n| Option        | Default value                 | Description               |\n+---------------+-------------------------------+---------------------------+\n| INCREMENT     | 1                             | Increment to use for      |\n|               |                               | values. May be negative.  |\n+---------------+-------------------------------+---------------------------+\n| MINVALUE      | 1 if INCREMENT > 0 and        | Minimum value for the     |\n|               | -9223372036854775807 if       | sequence.                 |\n|               | INCREMENT < 0                 |                           |\n+---------------+-------------------------------+---------------------------+\n| MAXVALUE      | 9223372036854775806 if        | Max value for sequence.   |\n|               | INCREMENT > 0 and -1 if       |                           |\n|               | INCREMENT < 0                 |                           |\n+---------------+-------------------------------+---------------------------+\n| START         | MINVALUE if INCREMENT > 0     | First value that the      |\n|               | and MAX_VALUE if INCREMENT< 0 | sequence will generate.   |\n+---------------+-------------------------------+---------------------------+\n| CACHE         | 1000                          | Number of values that     |\n|               |                               | should be cached. 0 if    |\n|               |                               | no CACHE.  The            |\n|               |                               | underlying table will be  |\n|               |                               | updated first time a new  |\n|               |                               | sequence number is        |\n|               |                               | generated and each time   |\n|               |                               | the cache runs out.       |\n+---------------+-------------------------------+---------------------------+\n| CYCLE         | 0 (= NO CYCLE)                | 1 if the sequence should  |\n|               |                               | start again from          |\n|               |                               | MINVALUE# after it has    |\n|               |                               | run out of values.        |\n+---------------+-------------------------------+---------------------------+\n| RESTART       | START if restart value not    | If  RESTART option is     |\n|               | is given                      | used, NEXT VALUE will     |\n|               |                               | return the restart value. |\n+---------------+-------------------------------+---------------------------+\n\nThe optional clause RESTART [ WITH restart ] sets the next value for the\nsequence. This is equivalent to calling the SETVAL() function with the is_used\nargument as 0. The specified value will be returned by the next call of\nnextval. Using RESTART with no restart value is equivalent to supplying the\nstart value that was recorded by CREATE SEQUENCE or last set by ALTER SEQUENCE\nSTART WITH.\n\nALTER SEQUENCE will not allow you to change the sequence so that it\'s\ninconsistent. For example:\n\nCREATE SEQUENCE s1;\nALTER SEQUENCE s1 MINVALUE 10;\nERROR 4061 (HY000): Sequence \'test.t1\' values are conflicting\n\nALTER SEQUENCE s1 MINVALUE 10 RESTART 10;\nERROR 4061 (HY000): Sequence \'test.t1\' values are conflicting\n\nALTER SEQUENCE s1 MINVALUE 10 START 10 RESTART 10;\n\nINSERT\n------\n\nTo allow SEQUENCE objects to be backed up by old tools, like mysqldump, one\ncan use SELECT to read the current state of a SEQUENCE object and use an\nINSERT to update the SEQUENCE object. INSERT is only allowed if all fields are\nspecified:\n\nCREATE SEQUENCE s1;\nINSERT INTO s1 VALUES(1000,10,2000,1005,1,1000,0,0);\nSELECT * FROM s1;\n\n+------------+-----------+-----------+-------+-----------+-------+-------+-----\n-+\n| next_value | min_value | max_value | start | increment | cache | cycle |\nround |\n+------------+-----------+-----------+-------+-----------+-------+-------+-----\n-+\n|       1000 |        10 |      2000 |  1005 |         1 |  1000 |     0 |    \n0 |\n+------------+-----------+-----------+-------+-----------+-------+-------+-----\n-+\n\nSHOW CREATE SEQUENCE s1;\n+-------+----------------------------------------------------------------------\n---------------------------------------+\n| Table | Create Table                                                        \n                    |\n+-------+----------------------------------------------------------------------\n---------------------------------------+\n| s1    | CREATE SEQUENCE `s1` start with 1005 minvalue 10 maxvalue 2000\nincrement by 1 cache 1000 nocycle ENGINE=Aria |\n+-------+----------------------------------------------------------------------\n---------------------------------------+\n\nNotes\n-----\n\nALTER SEQUENCE will instantly affect all future SEQUENCE operations. This is\nin contrast to some other databases where the changes requested by ALTER\nSEQUENCE will not be seen until the sequence cache has run out.\n\nALTER SEQUENCE will take a full table lock of the sequence object during its\n(brief) operation. This ensures that ALTER SEQUENCE is replicated correctly.\nIf you only want to set the next sequence value to a higher value than\ncurrent, then you should use SETVAL() instead, as this is not blocking.\n\nIf you want to change storage engine, sequence comment or rename the sequence,\nyou can use ALTER TABLE for this.\n\nURL: https://mariadb.com/kb/en/alter-sequence/','','https://mariadb.com/kb/en/alter-sequence/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (735,39,'DROP SEQUENCE','MariaDB starting with 10.3\n--------------------------\nDROP SEQUENCE was introduced in MariaDB 10.3.\n\nSyntax\n------\n\nDROP [TEMPORARY] SEQUENCE [IF EXISTS] [/*COMMENT TO SAVE*/]\n  sequence_name [, sequence_name] ...\n\nDescription\n-----------\n\nDROP SEQUENCE removes one or more sequences created with CREATE SEQUENCE. You\nmust have the DROP privilege for each sequence. MariaDB returns an error\nindicating by name which non-existing tables it was unable to drop, but it\nalso drops all of the tables in the list that do exist.\n\nImportant: When a table is dropped, user privileges on the table are not\nautomatically dropped. See GRANT.\n\nIf another connection is using the sequence, a metadata lock is active, and\nthis statement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nFor each referenced sequence, DROP SEQUENCE drops a temporary sequence with\nthat name, if it exists. If it does not exist, and the TEMPORARY keyword is\nnot used, it drops a non-temporary sequence with the same name, if it exists.\nThe TEMPORARY keyword ensures that a non-temporary sequence will not\naccidentally be dropped.\n\nUse IF EXISTS to prevent an error from occurring for sequences that do not\nexist. A NOTE is generated for each non-existent sequence when using IF\nEXISTS. See SHOW WARNINGS.\n\nDROP SEQUENCE requires the DROP privilege.\n\nNotes\n-----\n\nDROP SEQUENCE only removes sequences, not tables. However, DROP TABLE can\nremove both sequences and tables.\n\nURL: https://mariadb.com/kb/en/drop-sequence/','','https://mariadb.com/kb/en/drop-sequence/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (736,39,'NEXT VALUE for sequence_name','MariaDB starting with 10.3\n--------------------------\nSEQUENCEs were introduced in MariaDB 10.3\n\nSyntax\n------\n\nNEXT VALUE FOR sequence\n\nor\n\nNEXTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.nextval\n\nNEXT VALUE FOR is ANSI SQL syntax while NEXTVAL() is PostgreSQL syntax.\n\nDescription\n-----------\n\nGenerate next value for a SEQUENCE.\n\n* You can greatly speed up NEXT VALUE by creating the sequence with the CACHE\noption. If not, every NEXT VALUE usage will cause changes in the stored\nSEQUENCE table.\n* When using NEXT VALUE the value will be reserved at once and will not be\nreused, except if the SEQUENCE was created with CYCLE. This means that when\nyou are using SEQUENCEs you have to expect gaps in the generated sequence\nnumbers.\n* If one updates the SEQUENCE with SETVAL() or ALTER SEQUENCE ... RESTART,\nNEXT VALUE FOR will notice this and start from the next requested value.\n* FLUSH TABLES will close the sequence and the next sequence number generated\nwill be according to what\'s stored in the SEQUENCE object. In effect, this\nwill discard the cached values.\n* A server restart (or closing the current connection) also causes a drop of\nall cached values. The cached sequence numbers are reserved only for the\ncurrent connection.\n* NEXT VALUE requires the INSERT privilege.\n\nMariaDB starting with 10.3.3\n----------------------------\n* You can also use NEXT VALUE FOR sequence for column DEFAULT.\n\nURL: https://mariadb.com/kb/en/next-value-for-sequence_name/','','https://mariadb.com/kb/en/next-value-for-sequence_name/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (737,39,'PREVIOUS VALUE FOR sequence_name','MariaDB starting with 10.3\n--------------------------\nSEQUENCEs were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nPREVIOUS VALUE FOR sequence_name\n\nor\n\nLASTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.currval\n\nPREVIOUS VALUE FOR is IBM DB2 syntax while LASTVAL() is PostgreSQL syntax.\n\nDescription\n-----------\n\nGet last value in the current connection generated from a sequence.\n\n* If the sequence has not yet been used by the connection, PREVIOUS VALUE FOR\nreturns NULL (the same thing applies with a new connection which doesn\'t see a\nlast value for an existing sequence).\n* If a SEQUENCE has been dropped and re-created then it\'s treated as a new\nSEQUENCE and PREVIOUS VALUE FOR will return NULL.\n* FLUSH TABLES has no effect on PREVIOUS VALUE FOR.\n* Previous values for all used sequences are stored per connection until\nconnection ends.\n* PREVIOUS VALUE FOR requires the SELECT privilege.\n\nExample\n-------\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nSELECT PREVIOUS VALUE FOR s;\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                 NULL |\n+----------------------+\n\n# The function works for sequences only, if the table is used an error is\ngenerated\nSELECT PREVIOUS VALUE FOR t;\nERROR 4089 (42S02): \'test.t\' is not a SEQUENCE\n\n# Call the NEXT VALUE FOR s:\nSELECT NEXT VALUE FOR s;\n+------------------+\n| NEXT VALUE FOR s |\n+------------------+\n|              100 |\n+------------------+\n\nSELECT PREVIOUS VALUE FOR s;\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                  100 |\n+----------------------+\n\nNow try to start the new connection and check that the last value is still\nNULL, before updating the value in the new connection after the output of the\nnew connection gets current value (110 in the example below). Note that first\nconnection cannot see this change and the result of last value still remains\nthe same (100 in the example above).\n\n$ .mysql -uroot test -e\"SELECT PREVIOUS VALUE FOR s; SELECT NEXT VALUE FOR s;\nSELECT PREVIOUS VALUE FOR s;\"\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                 NULL |\n+----------------------+\n+------------------+\n| NEXT VALUE FOR s |\n+------------------+\n|              110 |\n+------------------+\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                  110 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/previous-value-for-sequence_name/','','https://mariadb.com/kb/en/previous-value-for-sequence_name/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (738,39,'SETVAL','MariaDB starting with 10.3.1\n----------------------------\nSEQUENCEs were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nSETVAL(sequence_name, next_value, [is_used, [round]])\n\nDescription\n-----------\n\nSet the next value to be returned for a SEQUENCE.\n\nThis function is compatible with PostgreSQL syntax, extended with the round\nargument.\n\nIf the is_used argument is not given or is 1 or true, then the next used value\nwill one after the given value. If is_used is 0 or false then the next\ngenerated value will be the given value.\n\nIf round is used then it will set the round value (or the internal cycle\ncount, starting at zero) for the sequence. If round is not used, it\'s assumed\nto be 0.\n\nnext_value must be an integer literal.\n\nFor SEQUENCE tables defined with CYCLE (see CREATE SEQUENCE) one should use\nboth next_value and round to define the next value. In this case the current\nsequence value is defined to be round, next_value.\n\nThe result returned by SETVAL() is next_value or NULL if the given next_value\nand round is smaller than the current value.\n\nSETVAL() will not set the SEQUENCE value to a something that is less than its\ncurrent value. This is needed to ensure that SETVAL() is replication safe. If\nyou want to set the SEQUENCE to a smaller number use ALTER SEQUENCE.\n\nIf CYCLE is used, first round and then next_value are compared to see if the\nvalue is bigger than the current value.\n\nInternally, in the MariaDB server, SETVAL() is used to inform slaves that a\nSEQUENCE has changed value. The slave may get SETVAL() statements out of\norder, but this is ok as only the biggest one will have an effect.\n\nSETVAL requires the INSERT privilege.\n\nExamples\n--------\n\nSELECT setval(foo, 42);           -- Next nextval will return 43\nSELECT setval(foo, 42, true);     -- Same as above\nSELECT setval(foo, 42, false);    -- Next nextval will return 42\n\nSETVAL setting higher and lower values on a sequence with an increment of 10:\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|         50 |\n+------------+\n\nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n|            100 |\n+----------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        110 |\n+------------+\n\nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n|          NULL |\n+---------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        120 |\n+------------+\n\nExample demonstrating round:\n\nCREATE OR REPLACE SEQUENCE s1\n START WITH 1\n MINVALUE 1\n MAXVALUE 99\n INCREMENT BY 1\n CACHE 20\n CYCLE;\n\nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n|                   99 |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n|           1 |\n+-------------+\n\nThe following statement returns NULL, as the given next_value and round is\nsmaller than the current value.\n\nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n|                 NULL |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n|           2 |\n+-------------+\n\nIncreasing the round from zero to 1 will allow next_value to be returned.\n\nSELECT SETVAL(s1, 99, 1, 1);\n+----------------------+\n| SETVAL(s1, 99, 1, 1) |\n+----------------------+\n|                   99 |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/setval/','','https://mariadb.com/kb/en/setval/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (739,40,'JSON_ARRAYAGG','MariaDB starting with 10.5.0\n----------------------------\nJSON_ARRAYAGG was added in MariaDB 10.5.0.\n\nSyntax\n------\n\nJSON_ARRAYAGG(column_or_expression)\n\nDescription\n-----------\n\nJSON_ARRAYAGG returns a JSON array containing an element for each value in a\ngiven set of JSON or SQL values. It acts on a column or an expression that\nevaluates to a single value.\n\nReturns NULL in the case of an error, or if the result contains no rows.\n\nJSON_ARRAYAGG cannot currently be used as a window function.\n\nThe full syntax is as follows:\n\nJSON_ARRAYAGG([DISTINCT] expr [,expr ...]\n      [ORDER BY {unsigned_integer | col_name | expr}\n        [ASC | DESC] [,col_name ...]]\n      [LIMIT {[offset,] row_count | row_count OFFSET offset}])\n\nExamples\n--------\n\nCREATE TABLE t1 (a INT, b INT);\n\nINSERT INTO t1 VALUES (1, 1),(2, 1), (1, 1),(2, 1), (3, 2),(2, 2),(2, 2),(2,\n2);\n\nSELECT JSON_ARRAYAGG(a), JSON_ARRAYAGG(b) FROM t1;\n+-------------------+-------------------+\n| JSON_ARRAYAGG(a)  | JSON_ARRAYAGG(b)  |\n+-------------------+-------------------+\n| [1,2,1,2,3,2,2,2] | [1,1,1,1,2,2,2,2] |\n+-------------------+-------------------+\n\nSELECT JSON_ARRAYAGG(a), JSON_ARRAYAGG(b) FROM t1 GROUP BY b;\n+------------------+------------------+\n| JSON_ARRAYAGG(a) | JSON_ARRAYAGG(b) |\n+------------------+------------------+\n| [1,2,1,2]        | [1,1,1,1]        |\n| [3,2,2,2]        | [2,2,2,2]        |\n+------------------+------------------+\n\nURL: https://mariadb.com/kb/en/json_arrayagg/','','https://mariadb.com/kb/en/json_arrayagg/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (740,40,'JSON_OBJECTAGG','MariaDB starting with 10.5.0\n----------------------------\nJSON_OBJECTAGG was added in MariaDB 10.5.0.\n\nSyntax\n------\n\nJSON_OBJECTAGG(key, value)\n\nDescription\n-----------\n\nJSON_OBJECTAGG returns a JSON object containing key-value pairs. It takes two\nexpressions that evaluate to a single value, or two column names, as\narguments, the first used as a key, and the second as a value.\n\nReturns NULL in the case of an error, or if the result contains no rows.\n\nJSON_OBJECTAGG cannot currently be used as a window function.\n\nExamples\n--------\n\nselect * from t1;\n+------+-------+\n| a    | b     |\n+------+-------+\n|    1 | Hello |\n|    1 | World |\n|    2 | This  |\n+------+-------+\n\nSELECT JSON_OBJECTAGG(a, b) FROM t1;\n+----------------------------------------+\n| JSON_OBJECTAGG(a, b)                   |\n+----------------------------------------+\n| {\"1\":\"Hello\", \"1\":\"World\", \"2\":\"This\"} |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_objectagg/','','https://mariadb.com/kb/en/json_objectagg/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (741,40,'JSONPath Expressions','A number of JSON functions accept JSON Path expressions. MariaDB defines this\npath as follows:\n\nJSON Path Syntax\n----------------\n\npath : [\'lax\'] \'$\' [step]*\n\nThe path starts with an optional path mode. At the moment, MariaDB supports\nonly the \"lax\" mode, which is also the mode that is used when it is not\nexplicitly specified.\n\nThe $ symbol represents the context item. The search always starts from the\ncontext item; because of that, the path always starts with $.\n\nThen, it is followed by zero or more steps, which select element(s) in the\nJSON document. A step may be one of the following:\n\n* Object member selector\n* Array element selector\n* Wildcard selector\n\nObject Member Selector\n----------------------\n\nTo select member(s) in a JSON object, one can use one of the following:\n\n* .memberName selects the value of the member with name memberName.\n* .\"memberName\" - the same as above but allows one to select a member with a\nname that\'s not a valid identifier (that is, has space, dot, and/or other\ncharacters)\n* .* - selects the values of all members of the object.\n\nIf the current item is an array (instead of an object), nothing will be\nselected.\n\nArray Element Selector\n----------------------\n\nTo select elements of an array, one can use one of the following:\n\n* [N] selects element number N in the array. The elements are counted from\nzero.\n* [*] selects all elements in the array.\n\nIf the current item is an object (instead of an array), nothing will be\nselected.\n\nStarting from MariaDB server 10.9, JSON path also supports negative index in\narray, \'last\' keyword and range notation (\'to\' keyword) for accessing array\nelements. Negative index starts from -1.\n\n* [-N] selects n th element from end.\n* [last-N] selects n th element from the last element.\n* [M to N] selects range of elements starting from index M to N.\n\nExample:\n\nSET @json=\'{\n      \"A\": [0,\n         [1, 2, 3],\n         [4, 5, 6],\n         \"seven\",\n         0.8,\n         true,\n         false,\n         \"eleven\",\n         [12, [13, 14], {\"key1\":\"value1\"},[15]],\n         true],\n      \"B\": {\"C\": 1},\n      \"D\": 2\n     }\';\nSELECT JSON_EXTRACT(@json, \'$.A[-8][1]\');\n+--------------------------------------------------+\n| JSON_EXTRACT(@json, \'$.A[-8][1]\')                |\n+--------------------------------------------------+\n| 5                                                |\n+--------------------------------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$.A[last-7][1]\');\n+-----------------------------------------------+\n| SELECT JSON_EXTRACT(@json, \'$.A[last-7][1]\'); |\n+-----------------------------------------------+\n| 5                                             |\n+-----------------------------------------------+\n\nSET @json= \'[\n      [1, {\"key1\": \"value1\"}, 3],\n      [false, 5, 6],\n      [7, 8, [9, {\"key2\": 2}, 11]],\n      [15, 1.34, [14], [\"string1\", [16, {\"key1\":[1,2,3,[4,5,6]]}, 18]]],\n      [19, 20],\n      21, 22\n      ]\';\n\nSELECT JSON_EXTRACT(@json, \'$[0 to 3][2]\');\n+-----------------------------------------------+\n| JSON_EXTRACT(@json, \'$[0 to 3][2]\')           |\n+-----------------------------------------------+\n| [3, 6, [9, {\"key2\": 2}, 11], [14]]            |\n+-----------------------------------------------+\n\nThis will produce output for first index of eighth from last element of a two\ndimensional array.\n\nNote: In range notation, when M > N ( when M,N are greater than or equal to 0)\nor (size of array - M or size of array - N when M, N are less than 0), then it\nis treated as an impossible range and NULL is returned.\n\nSET @json= \'[1, 2, 3, 4, 5]\';\nSELECT JSON_EXTRACT(@json, \'$[4 to 2]\');\n+-----------------------------------+\n| JSON_EXTRACT(@json, \'$[4 to 2]\')  |\n+-----------------------------------+\n| NULL                              |\n+-----------------------------------+\n\nWildcard\n--------\n\nThe wildcard step, **, recursively selects all child elements of the current\nelement. Both array elements and object members are selected.\n\nThe wildcard step must not be the last step in the JSONPath expression. It\nmust be followed by an array or object member selector step.\n\nFor example:\n\nselect json_extract(@json_doc, \'$**.price\');\n\nwill select all object members in the document that are named price, while\n\nselect json_extract(@json_doc, \'$**[2]\');\n\nwill select the second element in each of the arrays present in the document.\n\nCompatibility\n-------------\n\nMariaDB\'s JSONPath syntax supports a subset of JSON Path\'s definition in the\nSQL Standard. The most notable things not supported are the strict mode and\nfilters.\n\nMariaDB\'s JSONPath is close to MySQL\'s JSONPath. The wildcard step ( ** ) is a\nnon-standard extension that has the same meaning as in MySQL. The differences\nbetween MariaDB and MySQL\'s JSONPath are: MySQL supports [last] and [M to N]\nas array element selectors; MySQL doesn\'t allow one to specify the mode\nexplicitly (but uses lax mode implicitly).\n\nURL: https://mariadb.com/kb/en/jsonpath-expressions/','','https://mariadb.com/kb/en/jsonpath-expressions/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (742,40,'JSON_ARRAY','Syntax\n------\n\nJSON_ARRAY([value[, value2] ...])\n\nDescription\n-----------\n\nReturns a JSON array containing the listed values. The list can be empty.\n\nExample\n-------\n\nSELECT Json_Array(56, 3.1416, \'My name is \"Foo\"\', NULL);\n+--------------------------------------------------+\n| Json_Array(56, 3.1416, \'My name is \"Foo\"\', NULL) |\n+--------------------------------------------------+\n| [56, 3.1416, \"My name is \\\"Foo\\\"\", null]         |\n+--------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_array/','','https://mariadb.com/kb/en/json_array/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (743,40,'JSON_ARRAY_APPEND','Syntax\n------\n\nJSON_ARRAY_APPEND(json_doc, path, value[, path, value] ...)\n\nDescription\n-----------\n\nAppends values to the end of the specified arrays within a JSON document,\nreturning the result, or NULL if any of the arguments are NULL.\n\nEvaluation is performed from left to right, with the resulting document from\nthe previous pair becoming the new value against which the next pair is\nevaluated.\n\nIf the json_doc is not a valid JSON document, or if any of the paths are not\nvalid, or contain a * or ** wildcard, an error is returned.\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[0]\', 5)\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [[1, 5], 2, [3, 4]]                 |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, [2, 6], [3, 4]]                 |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, [2, 6], [3, 4, 7]]                         |\n+------------------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$\', 5);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$\', 5) |\n+----------------------------------+\n| [1, 2, [3, 4], 5]                |\n+----------------------------------+\n\nSET @json = \'{\"A\": 1, \"B\": [2], \"C\": [3, 4]}\';\n\nSELECT JSON_ARRAY_APPEND(@json, \'$.B\', 5);\n+------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$.B\', 5) |\n+------------------------------------+\n| {\"A\": 1, \"B\": [2, 5], \"C\": [3, 4]} |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_array_append/','','https://mariadb.com/kb/en/json_array_append/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (744,40,'JSON_ARRAY_INSERT','Syntax\n------\n\nJSON_ARRAY_INSERT(json_doc, path, value[, path, value] ...)\n\nDescription\n-----------\n\nInserts a value into a JSON document, returning the modified document, or NULL\nif any of the arguments are NULL.\n\nEvaluation is performed from left to right, with the resulting document from\nthe previous pair becoming the new value against which the next pair is\nevaluated.\n\nIf the json_doc is not a valid JSON document, or if any of the paths are not\nvalid, or contain a * or ** wildcard, an error is returned.\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[0]\', 5);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [5, 1, 2, [3, 4]]                   |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, 6, 2, [3, 4]]                   |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, 6, 7, 2, [3, 4]]                           |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_array_insert/','','https://mariadb.com/kb/en/json_array_insert/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (745,40,'JSON_COMPACT','Syntax\n------\n\nJSON_COMPACT(json_doc)\n\nDescription\n-----------\n\nRemoves all unnecessary spaces so the json document is as short as possible.\n\nExample\n-------\n\nSET @j = \'{ \"A\": 1, \"B\": [2, 3]}\';\n\nSELECT JSON_COMPACT(@j), @j;\n+-------------------+------------------------+\n| JSON_COMPACT(@j)  | @j                     |\n+-------------------+------------------------+\n| {\"A\":1,\"B\":[2,3]} | { \"A\": 1, \"B\": [2, 3]} |\n+-------------------+------------------------+\n\nURL: https://mariadb.com/kb/en/json_compact/','','https://mariadb.com/kb/en/json_compact/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (746,40,'JSON_CONTAINS','Syntax\n------\n\nJSON_CONTAINS(json_doc, val[, path])\n\nDescription\n-----------\n\nReturns whether or not the specified value is found in the given JSON document\nor, optionally, at the specified path within the document. Returns 1 if it\ndoes, 0 if not and NULL if any of the arguments are null. An error occurs if\nthe document or path is not valid, or contains the * or ** wildcards.\n\nExamples\n--------\n\nSET @json = \'{\"A\": 0, \"B\": {\"C\": 1}, \"D\": 2}\';\n\nSELECT JSON_CONTAINS(@json, \'2\', \'$.A\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.A\') |\n+----------------------------------+\n|                                0 |\n+----------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'2\', \'$.D\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.D\') |\n+----------------------------------+\n|                                1 |\n+----------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.A\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.A\') |\n+-----------------------------------------+\n|                                       0 |\n+-----------------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.B\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.B\') |\n+-----------------------------------------+\n|                                       1 |\n+-----------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_contains/','','https://mariadb.com/kb/en/json_contains/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (747,40,'JSON_CONTAINS_PATH','Syntax\n------\n\nJSON_CONTAINS_PATH(json_doc, return_arg, path[, path] ...)\n\nDescription\n-----------\n\nIndicates whether the given JSON document contains data at the specified path\nor paths. Returns 1 if it does, 0 if not and NULL if any of the arguments are\nnull.\n\nThe return_arg can be one or all:\n\n* one - Returns 1 if at least one path exists within the JSON document. \n* all - Returns 1 only if all paths exist within the JSON document.\n\nExamples\n--------\n\nSET @json = \'{\"A\": 1, \"B\": [2], \"C\": [3, 4]}\';\n\nSELECT JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n|                                              1 |\n+------------------------------------------------+\n1 row in set (0.00 sec)\n\nSELECT JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n|                                              0 |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_contains_path/','','https://mariadb.com/kb/en/json_contains_path/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (748,40,'JSON_DEPTH','Syntax\n------\n\nJSON_DEPTH(json_doc)\n\nDescription\n-----------\n\nReturns the maximum depth of the given JSON document, or NULL if the argument\nis null. An error will occur if the argument is an invalid JSON document.\n\n* Scalar values or empty arrays or objects have a depth of 1.\n* Arrays or objects that are not empty but contain only elements or member\nvalues of depth 1 will have a depth of 2.\n* In other cases, the depth will be greater than 2.\n\nExamples\n--------\n\nSELECT JSON_DEPTH(\'[]\'), JSON_DEPTH(\'true\'), JSON_DEPTH(\'{}\');\n+------------------+--------------------+------------------+\n| JSON_DEPTH(\'[]\') | JSON_DEPTH(\'true\') | JSON_DEPTH(\'{}\') |\n+------------------+--------------------+------------------+\n|                1 |                  1 |                1 |\n+------------------+--------------------+------------------+\n\nSELECT JSON_DEPTH(\'[1, 2, 3]\'), JSON_DEPTH(\'[[], {}, []]\');\n+-------------------------+----------------------------+\n| JSON_DEPTH(\'[1, 2, 3]\') | JSON_DEPTH(\'[[], {}, []]\') |\n+-------------------------+----------------------------+\n|                       2 |                          2 |\n+-------------------------+----------------------------+\n\nSELECT JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\');\n+---------------------------------------+\n| JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\') |\n+---------------------------------------+\n|                                     3 |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_depth/','','https://mariadb.com/kb/en/json_depth/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (749,40,'JSON_DETAILED','Syntax\n------\n\nJSON_DETAILED(json_doc[, tab_size])\n\nDescription\n-----------\n\nRepresents JSON in the most understandable way emphasizing nested structures.\n\nExample\n-------\n\nSET @j = \'{ \"A\":1,\"B\":[2,3]}\';\n\nSELECT @j;\n+--------------------+\n| @j                 |\n+--------------------+\n| { \"A\":1,\"B\":[2,3]} |\n+--------------------+\n\nSELECT JSON_DETAILED(@j);\n+------------------------------------------------------------+\n| JSON_DETAILED(@j)                                          |\n+------------------------------------------------------------+\n| {\n  \"A\": 1,\n  \"B\":\n  [\n    2,\n    3\n  ]\n} |\n+------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_detailed/','','https://mariadb.com/kb/en/json_detailed/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (750,40,'JSON_EXISTS','Syntax\n------\n\nDescription\n-----------\n\nDetermines whether a specified JSON value exists in the given data. Returns 1\nif found, 0 if not, or NULL if any of the inputs were NULL.\n\nExamples\n--------\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2\");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2\") |\n+------------------------------------------------------------+\n|                                                          1 |\n+------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key3\");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key3\") |\n+------------------------------------------------------------+\n|                                                          0 |\n+------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[1]\");\n+---------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[1]\") |\n+---------------------------------------------------------------+\n|                                                             1 |\n+---------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[10]\");\n+----------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[10]\") |\n+----------------------------------------------------------------+\n|                                                              0 |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_exists/','','https://mariadb.com/kb/en/json_exists/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (751,40,'JSON_EXTRACT','Syntax\n------\n\nJSON_EXTRACT(json_doc, path[, path] ...)\n\nDescription\n-----------\n\nExtracts data from a JSON document. The extracted data is selected from the\nparts matching the path arguments. Returns all matched values; either as a\nsingle matched value, or, if the arguments could return multiple values, a\nresult autowrapped as an array in the matching order.\n\nReturns NULL if no paths match or if any of the arguments are NULL.\n\nAn error will occur if any path argument is not a valid path, or if the\njson_doc argument is not a valid JSON document.\n\nThe path expression be a JSONPath expression as supported by MariaDB\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_EXTRACT(@json, \'$[1]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[1]\') |\n+-----------------------------+\n| 2                           |\n+-----------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$[2]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[2]\') |\n+-----------------------------+\n| [3, 4]                      |\n+-----------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$[2][1]\');\n+--------------------------------+\n| JSON_EXTRACT(@json, \'$[2][1]\') |\n+--------------------------------+\n| 4                              |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/json_extract/','','https://mariadb.com/kb/en/json_extract/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (752,40,'JSON_INSERT','Syntax\n------\n\nJSON_INSERT(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nInserts data into a JSON document, returning the resulting document or NULL if\nany argument is null.\n\nAn error will occur if the JSON document is not invalid, or if any of the\npaths are invalid or contain a * or ** wildcard.\n\nJSON_INSERT can only insert data while JSON_REPLACE can only update. JSON_SET\ncan update or insert data.\n\nExamples\n--------\n\nSET @json = \'{ \"A\": 0, \"B\": [1, 2]}\';\n\nSELECT JSON_INSERT(@json, \'$.C\', \'[3, 4]\');\n+--------------------------------------+\n| JSON_INSERT(@json, \'$.C\', \'[3, 4]\')  |\n+--------------------------------------+\n| { \"A\": 0, \"B\": [1, 2], \"C\":\"[3, 4]\"} |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_insert/','','https://mariadb.com/kb/en/json_insert/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (753,40,'JSON_KEYS','Syntax\n------\n\nJSON_KEYS(json_doc[, path])\n\nDescription\n-----------\n\nReturns the keys as a JSON array from the top-level value of a JSON object or,\nif the optional path argument is provided, the top-level keys from the path.\n\nExcludes keys from nested sub-objects in the top level value. The resulting\narray will be empty if the selected object is empty.\n\nReturns NULL if any of the arguments are null, a given path does not locate an\nobject, or if the json_doc argument is not an object.\n\nAn error will occur if JSON document is invalid, the path is invalid or if the\npath contains a * or ** wildcard.\n\nExamples\n--------\n\nSELECT JSON_KEYS(\'{\"A\": 1, \"B\": {\"C\": 2}}\');\n+--------------------------------------+\n| JSON_KEYS(\'{\"A\": 1, \"B\": {\"C\": 2}}\') |\n+--------------------------------------+\n| [\"A\", \"B\"]                           |\n+--------------------------------------+\n\nSELECT JSON_KEYS(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\');\n+-----------------------------------------------------+\n| JSON_KEYS(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\') |\n+-----------------------------------------------------+\n| [\"D\"]                                               |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_keys/','','https://mariadb.com/kb/en/json_keys/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (754,40,'JSON_LENGTH','Syntax\n------\n\nJSON_LENGTH(json_doc[, path])\n\nDescription\n-----------\n\nReturns the length of a JSON document, or, if the optional path argument is\ngiven, the length of the value within the document specified by the path.\n\nReturns NULL if any of the arguments argument are null or the path argument\ndoes not identify a value in the document.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or ** wildcard.\n\nLength will be determined as follow:\n\n* A scalar\'s length is always 1.\n* If an array, the number of elements in the array.\n* If an object, the number of members in the object.\n\nThe length of nested arrays or objects are not counted.\n\nExamples\n--------\n\nURL: https://mariadb.com/kb/en/json_length/','','https://mariadb.com/kb/en/json_length/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (755,40,'JSON_LOOSE','Syntax\n------\n\nJSON_LOOSE(json_doc)\n\nDescription\n-----------\n\nAdds spaces to a JSON document to make it look more readable.\n\nExample\n-------\n\nSET @j = \'{ \"A\":1,\"B\":[2,3]}\';\n\nSELECT JSON_LOOSE(@j), @j;\n+-----------------------+--------------------+\n| JSON_LOOSE(@j)        | @j                 |\n+-----------------------+--------------------+\n| {\"A\": 1, \"B\": [2, 3]} | { \"A\":1,\"B\":[2,3]} |\n+-----------------------+--------------------+\n\nURL: https://mariadb.com/kb/en/json_loose/','','https://mariadb.com/kb/en/json_loose/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (756,40,'JSON_MERGE','Syntax\n------\n\nJSON_MERGE(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents.\n\nReturns the merged result,or NULL if any argument is NULL.\n\nAn error occurs if any of the arguments are not valid JSON documents.\n\nJSON_MERGE has been deprecated since MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5. JSON_MERGE_PATCH is an RFC 7396-compliant replacement, and\nJSON_MERGE_PRESERVE is a synonym.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[3, 4]\';\n\nSELECT JSON_MERGE(@json1,@json2);\n+---------------------------+\n| JSON_MERGE(@json1,@json2) |\n+---------------------------+\n| [1, 2, 3, 4]              |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/json_merge/','','https://mariadb.com/kb/en/json_merge/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (757,40,'JSON_MERGE_PATCH','MariaDB starting with 10.2.25\n-----------------------------\nJSON_MERGE_PATCH was introduced in MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5.\n\nSyntax\n------\n\nJSON_MERGE_PATCH(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents, returning the merged result, or NULL if any\nargument is NULL.\n\nJSON_MERGE_PATCH is an RFC 7396-compliant replacement for JSON_MERGE, which\nhas been deprecated.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[2, 3]\';\nSELECT JSON_MERGE_PATCH(@json1,@json2),JSON_MERGE_PRESERVE(@json1,@json2);\n+---------------------------------+------------------------------------+\n| JSON_MERGE_PATCH(@json1,@json2) | JSON_MERGE_PRESERVE(@json1,@json2) |\n+---------------------------------+------------------------------------+\n| [2, 3]                          | [1, 2, 2, 3]                       |\n+---------------------------------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_merge_patch/','','https://mariadb.com/kb/en/json_merge_patch/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (758,40,'JSON_MERGE_PRESERVE','MariaDB starting with 10.2.25\n-----------------------------\nJSON_MERGE_PRESERVE was introduced in MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5.\n\nSyntax\n------\n\nJSON_MERGE_PRESERVE(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents, returning the merged result, or NULL if any\nargument is NULL.\n\nJSON_MERGE_PRESERVE was introduced in MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5 as a synonym for JSON_MERGE, which has been deprecated.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[2, 3]\';\nSELECT JSON_MERGE_PATCH(@json1,@json2),JSON_MERGE_PRESERVE(@json1,@json2);\n+---------------------------------+------------------------------------+\n| JSON_MERGE_PATCH(@json1,@json2) | JSON_MERGE_PRESERVE(@json1,@json2) |\n+---------------------------------+------------------------------------+\n| [2, 3]                          | [1, 2, 2, 3]                       |\n+---------------------------------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_merge_preserve/','','https://mariadb.com/kb/en/json_merge_preserve/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (759,40,'JSON_OBJECT','Syntax\n------\n\nJSON_OBJECT([key, value[, key, value] ...])\n\nDescription\n-----------\n\nReturns a JSON object containing the given key/value pairs. The key/value list\ncan be empty.\n\nAn error will occur if there are an odd number of arguments, or any key name\nis NULL.\n\nExample\n-------\n\nSELECT JSON_OBJECT(\"id\", 1, \"name\", \"Monty\");\n+---------------------------------------+\n| JSON_OBJECT(\"id\", 1, \"name\", \"Monty\") |\n+---------------------------------------+\n| {\"id\": 1, \"name\": \"Monty\"}            |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_object/','','https://mariadb.com/kb/en/json_object/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (760,40,'JSON_QUERY','Syntax\n------\n\nJSON_QUERY(json_doc, path)\n\nDescription\n-----------\n\nGiven a JSON document, returns an object or array specified by the path.\nReturns NULL if not given a valid JSON document, or if there is no match.\n\nExamples\n--------\n\nselect json_query(\'{\"key1\":{\"a\":1, \"b\":[1,2]}}\', \'$.key1\');\n+-----------------------------------------------------+\n| json_query(\'{\"key1\":{\"a\":1, \"b\":[1,2]}}\', \'$.key1\') |\n+-----------------------------------------------------+\n| {\"a\":1, \"b\":[1,2]}                                  |\n+-----------------------------------------------------+\n\nselect json_query(\'{\"key1\":123, \"key1\": [1,2,3]}\', \'$.key1\');\n+-------------------------------------------------------+\n| json_query(\'{\"key1\":123, \"key1\": [1,2,3]}\', \'$.key1\') |\n+-------------------------------------------------------+\n| [1,2,3]                                               |\n+-------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_query/','','https://mariadb.com/kb/en/json_query/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (761,40,'JSON_QUOTE','Syntax\n------\n\nJSON_QUOTE(json_value)\n\nDescription\n-----------\n\nQuotes a string as a JSON value, usually for producing valid JSON string\nliterals for inclusion in JSON documents. Wraps the string with double quote\ncharacters and escapes interior quotes and other special characters, returning\na utf8mb4 string.\n\nReturns NULL if the argument is NULL.\n\nExamples\n--------\n\nSELECT JSON_QUOTE(\'A\'), JSON_QUOTE(\"B\"), JSON_QUOTE(\'\"C\"\');\n+-----------------+-----------------+-------------------+\n| JSON_QUOTE(\'A\') | JSON_QUOTE(\"B\") | JSON_QUOTE(\'\"C\"\') |\n+-----------------+-----------------+-------------------+\n| \"A\"             | \"B\"             | \"\\\"C\\\"\"           |\n+-----------------+-----------------+-------------------+\n\nURL: https://mariadb.com/kb/en/json_quote/','','https://mariadb.com/kb/en/json_quote/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (762,40,'JSON_REMOVE','Syntax\n------\n\nJSON_REMOVE(json_doc, path[, path] ...)\n\nDescription\n-----------\n\nRemoves data from a JSON document returning the result, or NULL if any of the\narguments are null. If the element does not exist in the document, no changes\nare made.\n\nAn error will occur if JSON document is invalid, the path is invalid or if the\npath contains a * or ** wildcard.\n\nPath arguments are evaluated from left to right, with the result from the\nearlier evaluation being used as the value for the next.\n\nExamples\n--------\n\nSELECT JSON_REMOVE(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\');\n+-------------------------------------------------------+\n| JSON_REMOVE(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\') |\n+-------------------------------------------------------+\n| {\"A\": 1, \"B\": 2}                                      |\n+-------------------------------------------------------+\n\nSELECT JSON_REMOVE(\'[\"A\", \"B\", [\"C\", \"D\"], \"E\"]\', \'$[1]\');\n+----------------------------------------------------+\n| JSON_REMOVE(\'[\"A\", \"B\", [\"C\", \"D\"], \"E\"]\', \'$[1]\') |\n+----------------------------------------------------+\n| [\"A\", [\"C\", \"D\"], \"E\"]                             |\n+----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_remove/','','https://mariadb.com/kb/en/json_remove/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (763,40,'JSON_REPLACE','Syntax\n------\n\nJSON_REPLACE(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nReplaces existing values in a JSON document, returning the result, or NULL if\nany of the arguments are NULL.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or ** wildcard.\n\nPaths and values are evaluated from left to right, with the result from the\nearlier evaluation being used as the value for the next.\n\nJSON_REPLACE can only update data, while JSON_INSERT can only insert. JSON_SET\ncan update or insert data.\n\nExamples\n--------\n\nSELECT JSON_REPLACE(\'{ \"A\": 1, \"B\": [2, 3]}\', \'$.B[1]\', 4);\n+-----------------------------------------------------+\n| JSON_REPLACE(\'{ \"A\": 1, \"B\": [2, 3]}\', \'$.B[1]\', 4) |\n+-----------------------------------------------------+\n| { \"A\": 1, \"B\": [2, 4]}                              |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_replace/','','https://mariadb.com/kb/en/json_replace/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (764,40,'JSON_SEARCH','Syntax\n------\n\nJSON_SEARCH(json_doc, return_arg, search_str[, escape_char[, path] ...])\n\nDescription\n-----------\n\nReturns the path to the given string within a JSON document, or NULL if any of\njson_doc, search_str or a path argument is NULL; if the search string is not\nfound, or if no path exists within the document.\n\nA warning will occur if the JSON document is not valid, any of the path\narguments are not valid, if return_arg is neither one nor all, or if the\nescape character is not a constant. NULL will be returned.\n\nreturn_arg can be one of two values:\n\n* \'one: Terminates after finding the first match, so will return one path\nstring. If there is more than one match, it is undefined which is considered\nfirst.\n* all: Returns all matching path strings, without duplicates. Multiple strings\nare autowrapped as an array. The order is undefined.\n\nExamples\n--------\n\nSET @json = \'[\"A\", [{\"B\": \"1\"}], {\"C\":\"AB\"}, {\"D\":\"BC\"}]\';\n\nSELECT JSON_SEARCH(@json, \'one\', \'AB\');\n+---------------------------------+\n| JSON_SEARCH(@json, \'one\', \'AB\') |\n+---------------------------------+\n| \"$[2].C\"                        |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/json_search/','','https://mariadb.com/kb/en/json_search/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (765,40,'JSON_SET','Syntax\n------\n\nJSON_SET(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nUpdates or inserts data into a JSON document, returning the result, or NULL if\nany of the arguments are NULL or the optional path fails to find an object.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or wildcard.\n\nJSON_SET can update or insert data, while JSON_REPLACE can only update, and\nJSON_INSERT only insert.\n\nExamples\n--------\n\nSELECT JSON_SET(Priv, \'$.locked\', \'true\') FROM mysql.global_priv\n\nURL: https://mariadb.com/kb/en/json_set/','','https://mariadb.com/kb/en/json_set/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (766,40,'JSON_TABLE','MariaDB starting with 10.6.0\n----------------------------\nJSON_TABLE was added in MariaDB 10.6.0.\n\nJSON_TABLE is a table function that converts JSON data into a relational form.\n\nSyntax\n------\n\nJSON_TABLE(json_doc, \n     context_path COLUMNS (column_list)\n) [AS] alias\n\ncolumn_list:\n  column[, column][, ...]\n\ncolumn:\n  name FOR ORDINALITY\n  |  name type PATH path_str [on_empty] [on_error]\n  |  name type EXISTS PATH path_str\n  |  NESTED PATH path_str COLUMNS (column_list)\n\non_empty:\n  {NULL | DEFAULT string | ERROR} ON EMPTY\n\non_error:\n  {NULL | DEFAULT string | ERROR} ON ERROR\n\nDescription\n-----------\n\nJSON_TABLE can be used in contexts where a table reference can be used; in the\nFROM clause of a SELECT statement, and in multi-table UPDATE/DELETE statements.\n\njson_doc is the JSON document to extract data from. In the simplest case, it\nis a string literal containing JSON. In more complex cases it can be an\narbitrary expression returning JSON. The expression may have references to\ncolumns of other tables. However, one can only refer to tables that precede\nthis JSON_TABLE invocation. For RIGHT JOIN, it is assumed that its outer side\nprecedes the inner. All tables in outer selects are also considered preceding.\n\ncontext_path is a JSON Path expression pointing to a collection of nodes in\njson_doc that will be used as the source of rows.\n\nThe COLUMNS clause declares the names and types of the columns that JSON_TABLE\nreturns, as well as how the values of the columns are produced.\n\nColumn Definitions\n------------------\n\nThe following types of columns are supported:\n\nPath Columns\n------------\n\nname type PATH path_str [on_empty] [on_error]\n\nLocates the JSON node pointed to by path_str and returns its value. The\npath_str is evaluated using the current row source node as the context node.\n\nset @json=\'\n[\n {\"name\":\"Laptop\", \"color\":\"black\", \"price\":\"1000\"},\n {\"name\":\"Jeans\",  \"color\":\"blue\"}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n name  varchar(10) path \'$.name\',\n color varchar(10) path \'$.color\',\n price decimal(8,2) path \'$.price\' )\n) as jt;\n+--------+-------+---------+\n| name   | color | price   |\n+--------+-------+---------+\n| Laptop | black | 1000.00 |\n| Jeans  | blue  |    NULL |\n+--------+-------+---------+\n\nThe on_empty and on_error clauses specify the actions to be performed when the\nvalue was not found or there was an error condition. See the ON EMPTY and ON\nERROR clauses section for details.\n\nORDINALITY Columns\n------------------\n\nname FOR ORDINALITY\n\nCounts the rows, starting from 1.\n\nExample:\n\nset @json=\'\n[\n {\"name\":\"Laptop\", \"color\":\"black\"},\n {\"name\":\"Jeans\",  \"color\":\"blue\"}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n id for ordinality,\n name  varchar(10) path \'$.name\')\n) as jt;\n+------+--------+\n| id   | name   |\n+------+--------+\n|    1 | Laptop |\n|    2 | Jeans  |\n+------+--------+\n\nEXISTS PATH Columns\n-------------------\n\nname type EXISTS PATH path_str\n\nChecks whether the node pointed to by value_path exists. The value_path is\nevaluated using the current row source node as the context node.\n\nset @json=\'\n[\n {\"name\":\"Laptop\", \"color\":\"black\", \"price\":1000},\n {\"name\":\"Jeans\",  \"color\":\"blue\"}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n name  varchar(10) path \'$.name\',\n has_price integer exists path \'$.price\')\n) as jt;\n+--------+-----------+\n| name   | has_price |\n+--------+-----------+\n| Laptop |         1 |\n| Jeans  |         0 |\n+--------+-----------+\n\nNESTED PATHs\n------------\n\nNESTED PATH converts nested JSON structures into multiple rows.\n\nNESTED PATH path COLUMNS (column_list)\n\nIt finds the sequence of JSON nodes pointed to by path and uses it to produce\nrows. For each found node, a row is generated with column values as specified\nby the NESTED PATH\'s COLUMNS clause. If path finds no nodes, only one row is\ngenerated with all columns having NULL values.\n\nFor example, consider a JSON document that contains an array of items, and\neach item, in turn, is expected to have an array of its available sizes:\n\nset @json=\'\n[\n {\"name\":\"Jeans\",  \"sizes\": [32, 34, 36]},\n {\"name\":\"T-Shirt\", \"sizes\":[\"Medium\", \"Large\"]},\n {\"name\":\"Cellphone\"}\n]\';\n\nNESTED PATH allows one to produce a separate row for each size each item has:\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n  name  varchar(10) path \'$.name\',\n  nested path \'$.sizes[*]\' columns (\n   size varchar(32) path \'$\'\n  )\n )\n) as jt;\n+-----------+--------+\n| name      | size   |\n+-----------+--------+\n| Jeans     | 32     |\n| Jeans     | 34     |\n| Jeans     | 36     |\n| T-Shirt   | Medium |\n| T-Shirt   | Large  |\n| Cellphone | NULL   |\n+-----------+--------+\n\nNESTED PATH clauses can be nested within one another. They can also be located\nnext to each other. In that case, the nested path clauses will produce records\none at a time. The ones that are not producing records will have all columns\nset to NULL.\n\nExample:\n\nset @json=\'\n[\n {\"name\":\"Jeans\",  \"sizes\": [32, 34, 36], \"colors\":[\"black\", \"blue\"]}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n  name  varchar(10) path \'$.name\',\n  nested path \'$.sizes[*]\' columns (\n   size varchar(32) path \'$\'\n  ),\n  nested path \'$.colors[*]\' columns (\n   color varchar(32) path \'$\'\n  )\n )\n) as jt;\n\n+-------+------+-------+\n| name  | size | color |\n+-------+------+-------+\n| Jeans | 32   | NULL  |\n| Jeans | 34   | NULL  |\n| Jeans | 36   | NULL  |\n| Jeans | NULL | black |\n| Jeans | NULL | blue  |\n+-------+------+-------+\n\nON EMPTY and ON ERROR Clauses\n-----------------------------\n\nThe ON EMPTY clause specifies what will be done when the element specified by\nthe search path is missing in the JSON document.\n\non_empty:\n  {NULL | DEFAULT string | ERROR} ON EMPTY\n\nWhen ON EMPTY clause is not present, NULL ON EMPTY is implied.\n\non_error:\n  {NULL | DEFAULT string | ERROR} ON ERROR\n\nThe ON ERROR clause specifies what should be done if a JSON structure error\noccurs when trying to extract the value pointed to by the path expression. A\nJSON structure error here occurs only when one attempts to convert a JSON\nnon-scalar (array or object) into a scalar value. When the ON ERROR clause is\nnot present, NULL ON ERROR is implied.\n\nNote: A datatype conversion error (e.g. attempt to store a non-integer value\ninto an integer field, or a varchar column being truncated) is not considered\na JSON error and so will not trigger the ON ERROR behavior. It will produce\nwarnings, in the same way as CAST(value AS datatype) would.\n\nReplication\n-----------\n\nIn the current code, evaluation of JSON_TABLE is deterministic, that is, for a\ngiven input string JSON_TABLE will always produce the same set of rows in the\nsame order. However, one can think of JSON documents that one can consider\nidentical which will produce different output. In order to be future-proof and\nwithstand changes like:\n\n* sorting JSON object members by name (like MySQL does)\n* changing the way duplicate object members are handled\nthe function is marked as unsafe for statement-based replication.\n\nExtracting a Subdocument into a Column\n--------------------------------------\n\nMariaDB starting with 10.6.9\n----------------------------\nPrior to MariaDB 10.6.9, JSON_TABLE did not allow one to extract a JSON\n\"subdocument\" into a JSON column.\n\nSELECT * FROM JSON_TABLE(\'{\"foo\": [1,2,3,4]}\',\'$\' columns( jscol json path\n\'$.foo\') ) AS T;\n+-------+\n| jscol |\n+-------+\n| NULL  |\n+-------+\n\nThis is supported from MariaDB 10.6.9:\n\nSELECT * FROM JSON_TABLE(\'{\"foo\": [1,2,3,4]}\',\'$\' columns( jscol json path\n\'$.foo\') ) AS T;\n+-----------+\n| jscol     |\n+-----------+\n| [1,2,3,4] |\n+-----------+\n\nURL: https://mariadb.com/kb/en/json_table/','','https://mariadb.com/kb/en/json_table/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (767,40,'JSON_TYPE','Syntax\n------\n\nJSON_TYPE(json_val)\n\nDescription\n-----------\n\nReturns the type of a JSON value (as a string), or NULL if the argument is\nnull.\n\nAn error will occur if the argument is an invalid JSON value.\n\nThe following is a complete list of the possible return types:\n\n+-----------------------------------+-----------------+-----------------------+\n| Return type                       | Value           | Example               |\n+-----------------------------------+-----------------+-----------------------+\n| ARRAY                             | JSON array      | [1, 2, {\"key\":        |\n|                                   |                 | \"value\"}]             |\n+-----------------------------------+-----------------+-----------------------+\n| OBJECT                            | JSON object     | {\"key\":\"value\"}       |\n+-----------------------------------+-----------------+-----------------------+\n| BOOLEAN                           | JSON            | true, false           |\n|                                   | true/false      |                       |\n|                                   | literals        |                       |\n+-----------------------------------+-----------------+-----------------------+\n| DOUBLE                            | A number with   | 1.2                   |\n|                                   | at least one    |                       |\n|                                   | floating point  |                       |\n|                                   | decimal.        |                       |\n+-----------------------------------+-----------------+-----------------------+\n| INTEGER                           | A number        | 1                     |\n|                                   | without a       |                       |\n|                                   | floating point  |                       |\n|                                   | decimal.        |                       |\n+-----------------------------------+-----------------+-----------------------+\n| NULL                              | JSON null       | null                  |\n|                                   | literal (this   |                       |\n|                                   | is returned as  |                       |\n|                                   | a string, not   |                       |\n|                                   | to be confused  |                       |\n|                                   | with the SQL    |                       |\n|                                   | NULL value!)    |                       |\n+-----------------------------------+-----------------+-----------------------+\n| STRING                            | JSON String     | \"a sample string\"     |\n+-----------------------------------+-----------------+-----------------------+\n\nExamples\n--------\n\nSELECT JSON_TYPE(\'{\"A\": 1, \"B\": 2, \"C\": 3}\');\n+---------------------------------------+\n| JSON_TYPE(\'{\"A\": 1, \"B\": 2, \"C\": 3}\') |\n+---------------------------------------+\n| OBJECT                                |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_type/','','https://mariadb.com/kb/en/json_type/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (768,40,'JSON_UNQUOTE','Syntax\n------\n\nJSON_UNQUOTE(val)\n\nDescription\n-----------\n\nUnquotes a JSON value, returning a string, or NULL if the argument is null.\n\nAn error will occur if the given value begins and ends with double quotes and\nis an invalid JSON string literal.\n\nIf the given value is not a JSON string, value is passed through unmodified.\n\nCertain character sequences have special meanings within a string. Usually, a\nbackslash is ignored, but the escape sequences in the table below are\nrecognised by MariaDB, unless the SQL Mode is set to NO_BACKSLASH_ESCAPES SQL.\n\n+-----------------------------------------------+-----------------------------+\n| Escape sequence                               | Character                   |\n+-----------------------------------------------+-----------------------------+\n| \\\"                                            | Double quote (\")            |\n+-----------------------------------------------+-----------------------------+\n| \\b                                            | Backslash                   |\n+-----------------------------------------------+-----------------------------+\n| \\f                                            | Formfeed                    |\n+-----------------------------------------------+-----------------------------+\n| \\n                                            | Newline (linefeed)          |\n+-----------------------------------------------+-----------------------------+\n| \\r                                            | Carriage return             |\n+-----------------------------------------------+-----------------------------+\n| \\t                                            | Tab                         |\n+-----------------------------------------------+-----------------------------+\n| \\\\                                            | Backslash (\\)               |\n+-----------------------------------------------+-----------------------------+\n| \\uXXXX                                        | UTF-8 bytes for Unicode     |\n|                                               | value XXXX                  |\n+-----------------------------------------------+-----------------------------+\n\nExamples\n--------\n\nSELECT JSON_UNQUOTE(\'\"Monty\"\');\n+-------------------------+\n| JSON_UNQUOTE(\'\"Monty\"\') |\n+-------------------------+\n| Monty                   |\n+-------------------------+\n\nWith the default SQL Mode:\n\nSELECT JSON_UNQUOTE(\'Si\\bng\\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\\bng\\ting\') |\n+-----------------------------+\n| Sng	ing                   |\n+-----------------------------+\n\nSetting NO_BACKSLASH_ESCAPES:\n\nSET @@sql_mode = \'NO_BACKSLASH_ESCAPES\';\n\nSELECT JSON_UNQUOTE(\'Si\\bng\\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\\bng\\ting\') |\n+-----------------------------+\n| Si\\bng\\ting                 |\n+-----------------------------+\n\nURL: https://mariadb.com/kb/en/json_unquote/','','https://mariadb.com/kb/en/json_unquote/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (769,40,'JSON_VALID','Syntax\n------\n\nJSON_VALID(value)\n\nDescription\n-----------\n\nIndicates whether the given value is a valid JSON document or not. Returns 1\nif valid, 0 if not, and NULL if the argument is NULL.\n\nFrom MariaDB 10.4.3, the JSON_VALID function is automatically used as a CHECK\nconstraint for the JSON data type alias in order to ensure that a valid json\ndocument is inserted.\n\nExamples\n--------\n\nSELECT JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\"}\');\n+------------------------------------------+\n| JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\"}\') |\n+------------------------------------------+\n|                                        1 |\n+------------------------------------------+\n\nSELECT JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\", \"oddfield\"}\');\n+------------------------------------------------------+\n| JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\", \"oddfield\"}\') |\n+------------------------------------------------------+\n|                                                    0 |\n+------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_valid/','','https://mariadb.com/kb/en/json_valid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (770,40,'JSON_VALUE','Syntax\n------\n\nJSON_VALUE(json_doc, path)\n\nDescription\n-----------\n\nGiven a JSON document, returns the scalar specified by the path. Returns NULL\nif not given a valid JSON document, or if there is no match.\n\nExamples\n--------\n\nselect json_value(\'{\"key1\":123}\', \'$.key1\');\n+--------------------------------------+\n| json_value(\'{\"key1\":123}\', \'$.key1\') |\n+--------------------------------------+\n| 123                                  |\n+--------------------------------------+\n\nselect json_value(\'{\"key1\": [1,2,3], \"key1\":123}\', \'$.key1\');\n+-------------------------------------------------------+\n| json_value(\'{\"key1\": [1,2,3], \"key1\":123}\', \'$.key1\') |\n+-------------------------------------------------------+\n| 123                                                   |\n+-------------------------------------------------------+\n\nIn the SET statement below, two escape characters are needed, as a single\nescape character would be applied by the SQL parser in the SET statement, and\nthe escaped character would not form part of the saved value.\n\nSET @json = \'{\"key1\":\"60\\\\\" Table\", \"key2\":\"1\"}\';\n\nSELECT JSON_VALUE(@json,\'$.key1\') AS Name , json_value(@json,\'$.key2\') as ID;\n+-----------+------+\n| Name      | ID   |\n+-----------+------+\n| 60\" Table | 1    |\n+-----------+------+\n\nURL: https://mariadb.com/kb/en/json_value/','','https://mariadb.com/kb/en/json_value/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (771,41,'Window Functions Overview','Introduction\n------------\n\nWindow functions allow calculations to be performed across a set of rows\nrelated to the current row.\n\nSyntax\n------\n\nfunction (expression) OVER (\n [ PARTITION BY expression_list ]\n [ ORDER BY order_list [ frame_clause ] ] )\n\nfunction:\n A valid window function\n\nexpression_list:\n expression | column_name [, expr_list ]\n\norder_list:\n expression | column_name [ ASC | DESC ]\n [, ... ]\n\nframe_clause:\n {ROWS | RANGE} {frame_border | BETWEEN frame_border AND frame_border}\n\nframe_border:\n | UNBOUNDED PRECEDING\n | UNBOUNDED FOLLOWING\n | CURRENT ROW\n | expr PRECEDING\n | expr FOLLOWING\n\nDescription\n-----------\n\nIn some ways, window functions are similar to aggregate functions in that they\nperform calculations across a set of rows. However, unlike aggregate\nfunctions, the output is not grouped into a single row.\n\nNon-aggregate window functions include\n\n* CUME_DIST\n* DENSE_RANK\n* FIRST_VALUE\n* LAG\n* LAST_VALUE\n* LEAD\n* MEDIAN\n* NTH_VALUE\n* NTILE\n* PERCENT_RANK\n* PERCENTILE_CONT\n* PERCENTILE_DISC\n* RANK, ROW_NUMBER\n\nAggregate functions that can also be used as window functions include\n\n* AVG\n* BIT_AND\n* BIT_OR\n* BIT_XOR\n* COUNT\n* MAX\n* MIN\n* STD\n* STDDEV\n* STDDEV_POP\n* STDDEV_SAMP\n* SUM\n* VAR_POP\n* VAR_SAMP\n* VARIANCE\n\nWindow function queries are characterised by the OVER keyword, following which\nthe set of rows used for the calculation is specified. By default, the set of\nrows used for the calculation (the \"window) is the entire dataset, which can\nbe ordered with the ORDER BY clause. The PARTITION BY clause is used to reduce\nthe window to a particular group within the dataset.\n\nFor example, given the following data:\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nthe following two queries return the average partitioned by test and by name\nrespectively:\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY test) \n AS average_by_test FROM student;\n+---------+--------+-------+-----------------+\n| name    | test   | score | average_by_test |\n+---------+--------+-------+-----------------+\n| Chun    | SQL    |    75 |         65.2500 |\n| Chun    | Tuning |    73 |         68.7500 |\n| Esben   | SQL    |    43 |         65.2500 |\n| Esben   | Tuning |    31 |         68.7500 |\n| Kaolin  | SQL    |    56 |         65.2500 |\n| Kaolin  | Tuning |    88 |         68.7500 |\n| Tatiana | SQL    |    87 |         65.2500 |\n| Tatiana | Tuning |    83 |         68.7500 |\n+---------+--------+-------+-----------------+\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY name) \n AS average_by_name FROM student;\n+---------+--------+-------+-----------------+\n| name    | test   | score | average_by_name |\n+---------+--------+-------+-----------------+\n| Chun    | SQL    |    75 |         74.0000 |\n| Chun    | Tuning |    73 |         74.0000 |\n| Esben   | SQL    |    43 |         37.0000 |\n| Esben   | Tuning |    31 |         37.0000 |\n| Kaolin  | SQL    |    56 |         72.0000 |\n| Kaolin  | Tuning |    88 |         72.0000 |\n| Tatiana | SQL    |    87 |         85.0000 |\n| Tatiana | Tuning |    83 |         85.0000 |\n+---------+--------+-------+-----------------+\n\nIt is also possible to specify which rows to include for the window function\n(for example, the current row and all preceding rows). See Window Frames for\nmore details.\n\nScope\n-----\n\nWindow functions were introduced in SQL:2003, and their definition was\nexpanded in subsequent versions of the standard. The last expansion was in the\nlatest version of the standard, SQL:2011.\n\nMost database products support a subset of the standard, they implement some\nfunctions defined as late as in SQL:2011, and at the same time leave some\nparts of SQL:2008 unimplemented.\n\nMariaDB:\n\n* Supports ROWS and RANGE-type frames\nAll kinds of frame bounds are supported, including RANGE PRECEDING|FOLLOWING n\nframe bounds (unlike PostgreSQL or MS SQL Server)\nDoes not yet support DATE[TIME] datatype and arithmetic for RANGE-type frames\n(MDEV-9727)\n\n* Does not support GROUPS-type frames (it seems that no popular database\nsupports it, either)\n\n* Does not support frame exclusion (no other database seems to support it,\neither) (MDEV-9724)\n* Does not support explicit NULLS FIRST or NULLS LAST.\n* Does not support nested navigation in window functions (this is\nVALUE_OF(expr AT row_marker [, default_value) syntax)\n\n* The following window functions are supported:\n\"Streamable\" window functions: ROW_NUMBER, RANK, DENSE_RANK, \nWindow functions that can be streamed once the number of rows in partition is\nknown: PERCENT_RANK, CUME_DIST, NTILE\n\n* Aggregate functions that are currently supported as window functions are:\nCOUNT, SUM, AVG, BIT_OR, BIT_AND, BIT_XOR.\n* Aggregate functions with the DISTINCT specifier (e.g. COUNT( DISTINCT x))\nare not supported as window functions.\n\nLinks\n-----\n\n* MDEV-6115 is the main jira task for window functions development. Other\ntasks are are attached as sub-tasks\n* bb-10.2-mdev9543 is the feature tree for window functions. Development is\nongoing, and this tree has the newest changes.\n* Testcases are in mysql-test/t/win*.test\n\nExamples\n--------\n\nGiven the following sample data:\n\nCREATE TABLE users (\n email VARCHAR(30),\n first_name VARCHAR(30),\n last_name VARCHAR(30),\n account_type VARCHAR(30)\n);\n\nINSERT INTO users VALUES \n (\'admin@boss.org\', \'Admin\', \'Boss\', \'admin\'),\n (\'bob.carlsen@foo.bar\', \'Bob\', \'Carlsen\', \'regular\'),\n (\'eddie.stevens@data.org\', \'Eddie\', \'Stevens\', \'regular\'),\n (\'john.smith@xyz.org\', \'John\', \'Smith\', \'regular\'),\n (\'root@boss.org\', \'Root\', \'Chief\', \'admin\')\n\nFirst, let\'s order the records by email alphabetically, giving each an\nascending rnum value starting with 1. This will make use of the ROW_NUMBER\nwindow function:\n\nSELECT row_number() OVER (ORDER BY email) AS rnum,\n  email, first_name, last_name, account_type\nFROM users ORDER BY email;\n+------+------------------------+------------+-----------+--------------+\n| rnum | email                  | first_name | last_name | account_type |\n+------+------------------------+------------+-----------+--------------+\n|    1 | admin@boss.org         | Admin      | Boss      | admin        |\n|    2 | bob.carlsen@foo.bar    | Bob        | Carlsen   | regular      |\n|    3 | eddie.stevens@data.org | Eddie      | Stevens   | regular      |\n|    4 | john.smith@xyz.org     | John       | Smith     | regular      |\n|    5 | root@boss.org          | Root       | Chief     | admin        |\n+------+------------------------+------------+-----------+--------------\n\nWe can generate separate sequences based on account type, using the PARTITION\nBY clause:\n\nSELECT row_number() OVER (PARTITION BY account_type ORDER BY email) AS rnum, \n email, first_name, last_name, account_type\nFROM users ORDER BY account_type,email;\n+------+------------------------+------------+-----------+--------------+\n| rnum | email                  | first_name | last_name | account_type |\n+------+------------------------+------------+-----------+--------------+\n|    1 | admin@boss.org         | Admin      | Boss      | admin        |\n|    2 | root@boss.org          | Root       | Chief     | admin        |\n|    1 | bob.carlsen@foo.bar    | Bob        | Carlsen   | regular      |\n|    2 | eddie.stevens@data.org | Eddie      | Stevens   | regular      |\n|    3 | john.smith@xyz.org     | John       | Smith     | regular      |\n+------+------------------------+------------+-----------+--------------+\n\nGiven the following structure and data, we want to find the top 5 salaries\nfrom each department.\n\nCREATE TABLE employee_salaries (dept VARCHAR(20), name VARCHAR(20), salary\nINT(11));\n\nINSERT INTO employee_salaries VALUES\n(\'Engineering\', \'Dharma\', 3500),\n(\'Engineering\', \'Binh\', 3000),\n(\'Engineering\', \'Adalynn\', 2800),\n(\'Engineering\', \'Samuel\', 2500),\n(\'Engineering\', \'Cveta\', 2200),\n(\'Engineering\', \'Ebele\', 1800),\n(\'Sales\', \'Carbry\', 500),\n(\'Sales\', \'Clytemnestra\', 400),\n(\'Sales\', \'Juraj\', 300),\n(\'Sales\', \'Kalpana\', 300),\n(\'Sales\', \'Svantepolk\', 250),\n(\'Sales\', \'Angelo\', 200);\n\nWe could do this without using window functions, as follows:\n\nselect dept, name, salary\nfrom employee_salaries as t1\nwhere (select count(t2.salary)\n   from employee_salaries as t2\n   where t1.name != t2.name and\n      t1.dept = t2.dept and\n      t2.salary > t1.salary) < 5\norder by dept, salary desc;\n\n+-------------+--------------+--------+\n| dept        | name         | salary |\n+-------------+--------------+--------+\n| Engineering | Dharma       |   3500 |\n| Engineering | Binh         |   3000 |\n| Engineering | Adalynn      |   2800 |\n| Engineering | Samuel       |   2500 |\n| Engineering | Cveta        |   2200 |\n| Sales       | Carbry       |    500 |\n| Sales       | Clytemnestra |    400 |\n| Sales       | Juraj        |    300 |\n| Sales       | Kalpana      |    300 |\n| Sales       | Svantepolk   |    250 |\n+-------------+--------------+--------+\n\nThis has a number of disadvantages:\n\n* if there is no index, the query could take a long time if the\nemployee_salary_table is large\n* Adding and maintaining indexes adds overhead, and even with indexes on dept\nand salary, each subquery execution adds overhead by performing a lookup\nthrough the index.\n\nLet\'s try achieve the same with window functions. First, generate a rank for\nall employees, using the RANK function.\n\nselect rank() over (partition by dept order by salary desc) as ranking,\n  dept, name, salary\n  from employee_salaries\n  order by dept, ranking;\n+---------+-------------+--------------+--------+\n| ranking | dept        | name         | salary |\n+---------+-------------+--------------+--------+\n|       1 | Engineering | Dharma       |   3500 |\n|       2 | Engineering | Binh         |   3000 |\n|       3 | Engineering | Adalynn      |   2800 |\n|       4 | Engineering | Samuel       |   2500 |\n|       5 | Engineering | Cveta        |   2200 |\n|       6 | Engineering | Ebele        |   1800 |\n|       1 | Sales       | Carbry       |    500 |\n|       2 | Sales       | Clytemnestra |    400 |\n|       3 | Sales       | Juraj        |    300 |\n|       3 | Sales       | Kalpana      |    300 |\n|       5 | Sales       | Svantepolk   |    250 |\n|       6 | Sales       | Angelo       |    200 |\n+---------+-------------+--------------+--------+\n\nEach department has a separate sequence of ranks due to the PARTITION BY\nclause. This particular sequence of values for rank() is given by the ORDER BY\nclause inside the window function’s OVER clause. Finally, to get our results\nin a readable format we order the data by dept and the newly generated ranking\ncolumn.\n\nNow, we need to reduce the results to find only the top 5 per department. Here\nis a common mistake:\n\nselect\nrank() over (partition by dept order by salary desc) as ranking,\ndept, name, salary\nfrom employee_salaries\nwhere ranking <= 5\norder by dept, ranking;\n\nERROR 1054 (42S22): Unknown column \'ranking\' in \'where clause\'\n\nTrying to filter only the first 5 values per department by putting a where\nclause in the statement does not work, due to the way window functions are\ncomputed. The computation of window functions happens after all WHERE, GROUP\nBY and HAVING clauses have been completed, right before ORDER BY, so the WHERE\nclause has no idea that the ranking column exists. It is only present after we\nhave filtered and grouped all the rows.\n\nTo counteract this problem, we need to wrap our query into a derived table. We\ncan then attach a where clause to it:\n\nselect *from (select rank() over (partition by dept order by salary desc) as\nranking,\n dept, name, salary\nfrom employee_salaries) as salary_ranks\nwhere (salary_ranks.ranking <= 5)\n order by dept, ranking;\n+---------+-------------+--------------+--------+\n| ranking | dept        | name         | salary |\n+---------+-------------+--------------+--------+\n|       1 | Engineering | Dharma       |   3500 |\n|       2 | Engineering | Binh         |   3000 |\n|       3 | Engineering | Adalynn      |   2800 |\n|       4 | Engineering | Samuel       |   2500 |\n|       5 | Engineering | Cveta        |   2200 |\n|       1 | Sales       | Carbry       |    500 |\n|       2 | Sales       | Clytemnestra |    400 |\n|       3 | Sales       | Juraj        |    300 |\n|       3 | Sales       | Kalpana      |    300 |\n|       5 | Sales       | Svantepolk   |    250 |\n+---------+-------------+--------------+--------+\n\nURL: https://mariadb.com/kb/en/window-functions-overview/','','https://mariadb.com/kb/en/window-functions-overview/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (772,41,'CUME_DIST','Syntax\n------\n\nCUME_DIST() OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nCUME_DIST() is a window function that returns the cumulative distribution of a\ngiven row. The following formula is used to calculate the value:\n\n(number of rows <= current row) / (total rows)\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n\ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n\nselect pk, a, b,\n  rank() over (order by a) as rank,\n  percent_rank() over (order by a) as pct_rank,\n  cume_dist() over (order by a) as cume_dist\nfrom t1;\n+----+------+------+------+--------------+--------------+\n| pk | a    | b    | rank | pct_rank     | cume_dist    |\n+----+------+------+------+--------------+--------------+\n|  1 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  2 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  3 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  4 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  5 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  6 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  7 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  8 |    2 |   10 |    5 | 0.4444444444 | 0.8000000000 |\n|  9 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n| 10 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n\nselect pk, a, b,\n   percent_rank() over (order by pk) as pct_rank,\n   cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 0.1000000000 |\n|  2 |    0 |   10 | 0.1111111111 | 0.2000000000 |\n|  3 |    1 |   10 | 0.2222222222 | 0.3000000000 |\n|  4 |    1 |   10 | 0.3333333333 | 0.4000000000 |\n|  5 |    2 |   20 | 0.4444444444 | 0.5000000000 |\n|  6 |    2 |   20 | 0.5555555556 | 0.6000000000 |\n|  7 |    2 |   20 | 0.6666666667 | 0.7000000000 |\n|  8 |    2 |   10 | 0.7777777778 | 0.8000000000 |\n|  9 |    4 |   20 | 0.8888888889 | 0.9000000000 |\n| 10 |    4 |   20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nselect pk, a, b,\n    percent_rank() over (partition by a order by a) as pct_rank,\n    cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  2 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  3 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  4 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  5 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  6 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  7 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  8 |    2 |   10 | 0.0000000000 | 1.0000000000 |\n|  9 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n| 10 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nURL: https://mariadb.com/kb/en/cume_dist/','','https://mariadb.com/kb/en/cume_dist/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (773,41,'DENSE_RANK','Syntax\n------\n\nDENSE_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nDENSE_RANK() is a window function that displays the number of a given row,\nstarting at one and following the ORDER BY sequence of the window function,\nwith identical values receiving the same result. Unlike the RANK() function,\nthere are no skipped values if the preceding results are identical. It is also\nsimilar to the ROW_NUMBER() function except that in that function, identical\nvalues will receive a different row number for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course  | mark | name    |\n+------+------------+---------+---------+------+---------+\n|    1 |          1 |       1 | Biology |   70 | Roger   |\n|    2 |          2 |       2 | Biology |   60 | Bilal   |\n|    1 |          1 |       1 | Maths   |   70 | Voitto  |\n|    2 |          2 |       2 | Maths   |   60 | Thulile |\n|    2 |          2 |       3 | Maths   |   60 | Pritha  |\n|    4 |          3 |       4 | Maths   |   55 | Chun    |\n+------+------------+---------+---------+------+---------+\n\nURL: https://mariadb.com/kb/en/dense_rank/','','https://mariadb.com/kb/en/dense_rank/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (774,41,'FIRST_VALUE','Syntax\n------\n\nFIRST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nFIRST_VALUE returns the first result from an ordered set, or NULL if no such\nresult exists.\n\nExamples\n--------\n\nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n\nINSERT INTO t1 VALUES\n( 1, 0, 1,    \'one\',    0.1,  0.001),\n( 2, 0, 2,    \'two\',    0.2,  0.002),\n( 3, 0, 3,    \'three\',  0.3,  0.003),\n( 4, 1, 2,    \'three\',  0.4,  0.004),\n( 5, 1, 1,    \'two\',    0.5,  0.005),\n( 6, 1, 1,    \'one\',    0.6,  0.006),\n( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n( 9, 2, 2,    NULL,     0.7,  0.009),\n(10, 2, 0,    \'n_four\', 0.8,  0.010),\n(11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n     LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n     FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n     LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n\n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 |         1 |       11 |         11 |        11 |\n| 10 |         1 |       10 |         11 |        10 |\n|  9 |         1 |        9 |         11 |         9 |\n|  8 |         1 |        8 |         11 |         8 |\n|  7 |         1 |        7 |         11 |         7 |\n|  6 |         1 |        6 |         11 |         6 |\n|  5 |         1 |        5 |         11 |         5 |\n|  4 |         1 |        4 |         11 |         4 |\n|  3 |         1 |        3 |         11 |         3 |\n|  2 |         1 |        2 |         11 |         2 |\n|  1 |         1 |        1 |         11 |         1 |\n+----+-----------+----------+------------+-----------+\n\nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n\nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nf_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nl_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f\nFROM t1;\n\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i    | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p | f_1f2f | f_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n|    1 |    1 |    2 |      1 |      2 |   NULL |   NULL |      2 |      3 |\n|    2 |    2 |    3 |      1 |      3 |      1 |      1 |      3 |      4 |\n|    3 |    3 |    4 |      2 |      4 |      1 |      2 |      4 |      5 |\n|    4 |    4 |    5 |      3 |      5 |      2 |      3 |      5 |      6 |\n|    5 |    5 |    6 |      4 |      6 |      3 |      4 |      6 |      7 |\n|    6 |    6 |    7 |      5 |      7 |      4 |      5 |      7 |      8 |\n|    7 |    7 |    8 |      6 |      8 |      5 |      6 |      8 |      9 |\n|    8 |    8 |    9 |      7 |      9 |      6 |      7 |      9 |     10 |\n|    9 |    9 |   10 |      8 |     10 |      7 |      8 |     10 |     10 |\n|   10 |   10 |   10 |      9 |     10 |      8 |      9 |   NULL |   NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n\nURL: https://mariadb.com/kb/en/first_value/','','https://mariadb.com/kb/en/first_value/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (775,41,'LAG','Syntax\n------\n\nLAG (expr[, offset]) OVER ( \n [ PARTITION BY partition_expression ]\n < ORDER BY order_list >\n)\n\nDescription\n-----------\n\nThe LAG function accesses data from a previous row according to the ORDER BY\nclause without the need for a self-join. The specific row is determined by the\noffset (default 1), which specifies the number of rows behind the current row\nto use. An offset of 0 is the current row.\n\nExamples\n--------\n\nCREATE TABLE t1 (pk int primary key, a int, b int, c char(10), d decimal(10,\n3), e real);\n\nINSERT INTO t1 VALUES\n ( 1, 0, 1,    \'one\',    0.1,  0.001),\n ( 2, 0, 2,    \'two\',    0.2,  0.002),\n ( 3, 0, 3,    \'three\',  0.3,  0.003),\n ( 4, 1, 2,    \'three\',  0.4,  0.004),\n ( 5, 1, 1,    \'two\',    0.5,  0.005),\n ( 6, 1, 1,    \'one\',    0.6,  0.006),\n ( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n ( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n ( 9, 2, 2,    NULL,     0.7,  0.009),\n (10, 2, 0,    \'n_four\', 0.8,  0.010),\n (11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, LAG(pk) OVER (ORDER BY pk) AS l,\n LAG(pk,1) OVER (ORDER BY pk) AS l1,\n LAG(pk,2) OVER (ORDER BY pk) AS l2,\n LAG(pk,0) OVER (ORDER BY pk) AS l0,\n LAG(pk,-1) OVER (ORDER BY pk) AS lm1,\n LAG(pk,-2) OVER (ORDER BY pk) AS lm2\nFROM t1;\n+----+------+------+------+------+------+------+\n| pk | l    | l1   | l2   | l0   | lm1  | lm2  |\n+----+------+------+------+------+------+------+\n|  1 | NULL | NULL | NULL |    1 |    2 |    3 |\n|  2 |    1 |    1 | NULL |    2 |    3 |    4 |\n|  3 |    2 |    2 |    1 |    3 |    4 |    5 |\n|  4 |    3 |    3 |    2 |    4 |    5 |    6 |\n|  5 |    4 |    4 |    3 |    5 |    6 |    7 |\n|  6 |    5 |    5 |    4 |    6 |    7 |    8 |\n|  7 |    6 |    6 |    5 |    7 |    8 |    9 |\n|  8 |    7 |    7 |    6 |    8 |    9 |   10 |\n|  9 |    8 |    8 |    7 |    9 |   10 |   11 |\n| 10 |    9 |    9 |    8 |   10 |   11 | NULL |\n| 11 |   10 |   10 |    9 |   11 | NULL | NULL |\n+----+------+------+------+------+------+------+\n\nURL: https://mariadb.com/kb/en/lag/','','https://mariadb.com/kb/en/lag/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (776,41,'LEAD','Syntax\n------\n\nLEAD (expr[, offset]) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nThe LEAD function accesses data from a following row in the same result set\nwithout the need for a self-join. The specific row is determined by the offset\n(default 1), which specifies the number of rows ahead the current row to use.\nAn offset of 0 is the current row.\n\nExample\n-------\n\nCREATE TABLE t1 (pk int primary key, a int, b int, c char(10), d decimal(10,\n3), e real);\n\nINSERT INTO t1 VALUES\n ( 1, 0, 1,    \'one\',    0.1,  0.001),\n ( 2, 0, 2,    \'two\',    0.2,  0.002),\n ( 3, 0, 3,    \'three\',  0.3,  0.003),\n ( 4, 1, 2,    \'three\',  0.4,  0.004),\n ( 5, 1, 1,    \'two\',    0.5,  0.005),\n ( 6, 1, 1,    \'one\',    0.6,  0.006),\n ( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n ( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n ( 9, 2, 2,    NULL,     0.7,  0.009),\n (10, 2, 0,    \'n_four\', 0.8,  0.010),\n (11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, LEAD(pk) OVER (ORDER BY pk) AS l,\n LEAD(pk,1) OVER (ORDER BY pk) AS l1,\n LEAD(pk,2) OVER (ORDER BY pk) AS l2,\n LEAD(pk,0) OVER (ORDER BY pk) AS l0,\n LEAD(pk,-1) OVER (ORDER BY pk) AS lm1,\n LEAD(pk,-2) OVER (ORDER BY pk) AS lm2\nFROM t1;\n+----+------+------+------+------+------+------+\n| pk | l    | l1   | l2   | l0   | lm1  | lm2  |\n+----+------+------+------+------+------+------+\n|  1 |    2 |    2 |    3 |    1 | NULL | NULL |\n|  2 |    3 |    3 |    4 |    2 |    1 | NULL |\n|  3 |    4 |    4 |    5 |    3 |    2 |    1 |\n|  4 |    5 |    5 |    6 |    4 |    3 |    2 |\n|  5 |    6 |    6 |    7 |    5 |    4 |    3 |\n|  6 |    7 |    7 |    8 |    6 |    5 |    4 |\n|  7 |    8 |    8 |    9 |    7 |    6 |    5 |\n|  8 |    9 |    9 |   10 |    8 |    7 |    6 |\n|  9 |   10 |   10 |   11 |    9 |    8 |    7 |\n| 10 |   11 |   11 | NULL |   10 |    9 |    8 |\n| 11 | NULL | NULL | NULL |   11 |   10 |    9 |\n+----+------+------+------+------+------+------+\n\nURL: https://mariadb.com/kb/en/lead/','','https://mariadb.com/kb/en/lead/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (777,41,'Median Window Function','MariaDB starting with 10.3.3\n----------------------------\nThe MEDIAN() window function was first introduced with in MariaDB 10.3.3.\n\nSyntax\n------\n\nMEDIAN(median expression) OVER (\n [ PARTITION BY partition_expression ]\n)\n\nDescription\n-----------\n\nMEDIAN() is a window function that returns the median value of a range of\nvalues.\n\nIt is a specific case of PERCENTILE_CONT, with an argument of 0.5 and the\nORDER BY column the one in MEDIAN\'s argument.\n\nMEDIAN(<median-arg>) OVER ( [ PARTITION BY partition_expression] )\n\nIs equivalent to:\n\nPERCENTILE_CONT(0.5) WITHIN \n GROUP (ORDER BY <median-arg>) OVER ( [ PARTITION BY partition_expression ])\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, median(star_rating) OVER (PARTITION BY name) FROM book_rating;\n+-----------------------+----------------------------------------------+\n| name                  | median(star_rating) OVER (PARTITION BY name) |\n+-----------------------+----------------------------------------------+\n| Lord of the Ladybirds |                                 4.0000000000 |\n| Lord of the Ladybirds |                                 4.0000000000 |\n| Lady of the Flies     |                                 2.0000000000 |\n| Lady of the Flies     |                                 2.0000000000 |\n| Lady of the Flies     |                                 2.0000000000 |\n+-----------------------+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/median/','','https://mariadb.com/kb/en/median/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (778,41,'NTH_VALUE','Syntax\n------\n\nNTH_VALUE (expr[, num_row]) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nThe NTH_VALUE function returns the value evaluated at row number num_row of\nthe window frame, starting from 1, or NULL if the row does not exist.\n\nURL: https://mariadb.com/kb/en/nth_value/','','https://mariadb.com/kb/en/nth_value/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (779,41,'NTILE','Syntax\n------\n\nNTILE (expr) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nNTILE() is a window function that returns an integer indicating which group a\ngiven row falls into. The number of groups is specified in the argument\n(expr), starting at one. Ordered rows in the partition are divided into the\nspecified number of groups with as equal a size as possible.\n\nExamples\n--------\n\ncreate table t1 (\n  pk int primary key,\n  a int,\n  b int\n );\n\ninsert into t1 values\n  (11 , 0, 10),\n  (12 , 0, 10),\n  (13 , 1, 10),\n  (14 , 1, 10),\n  (18 , 2, 10),\n  (15 , 2, 20),\n  (16 , 2, 20),\n  (17 , 2, 20),\n  (19 , 4, 20),\n  (20 , 4, 20);\n\nselect pk, a, b,\n  ntile(1) over (order by pk)\n from t1;\n+----+------+------+-----------------------------+\n| pk | a    | b    | ntile(1) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 |    0 |   10 |                           1 |\n| 12 |    0 |   10 |                           1 |\n| 13 |    1 |   10 |                           1 |\n| 14 |    1 |   10 |                           1 |\n| 15 |    2 |   20 |                           1 |\n| 16 |    2 |   20 |                           1 |\n| 17 |    2 |   20 |                           1 |\n| 18 |    2 |   10 |                           1 |\n| 19 |    4 |   20 |                           1 |\n| 20 |    4 |   20 |                           1 |\n+----+------+------+-----------------------------+\n\nselect pk, a, b,\n  ntile(4) over (order by pk)\n from t1;\n+----+------+------+-----------------------------+\n| pk | a    | b    | ntile(4) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 |    0 |   10 |                           1 |\n| 12 |    0 |   10 |                           1 |\n| 13 |    1 |   10 |                           1 |\n| 14 |    1 |   10 |                           2 |\n| 15 |    2 |   20 |                           2 |\n| 16 |    2 |   20 |                           2 |\n| 17 |    2 |   20 |                           3 |\n| 18 |    2 |   10 |                           3 |\n| 19 |    4 |   20 |                           4 |\n| 20 |    4 |   20 |                           4 |\n+----+------+------+-----------------------------+\n\nURL: https://mariadb.com/kb/en/ntile/','','https://mariadb.com/kb/en/ntile/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (780,41,'PERCENT_RANK','Syntax\n------\n\nPERCENT_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nPERCENT_RANK() is a window function that returns the relative percent rank of\na given row. The following formula is used to calculate the percent rank:\n\n(rank - 1) / (number of rows in the window or partition - 1)\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n\ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n\nselect pk, a, b,\n  rank() over (order by a) as rank,\n  percent_rank() over (order by a) as pct_rank,\n  cume_dist() over (order by a) as cume_dist\nfrom t1;\n+----+------+------+------+--------------+--------------+\n| pk | a    | b    | rank | pct_rank     | cume_dist    |\n+----+------+------+------+--------------+--------------+\n|  1 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  2 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  3 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  4 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  5 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  6 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  7 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  8 |    2 |   10 |    5 | 0.4444444444 | 0.8000000000 |\n|  9 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n| 10 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n\nselect pk, a, b,\n   percent_rank() over (order by pk) as pct_rank,\n   cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 0.1000000000 |\n|  2 |    0 |   10 | 0.1111111111 | 0.2000000000 |\n|  3 |    1 |   10 | 0.2222222222 | 0.3000000000 |\n|  4 |    1 |   10 | 0.3333333333 | 0.4000000000 |\n|  5 |    2 |   20 | 0.4444444444 | 0.5000000000 |\n|  6 |    2 |   20 | 0.5555555556 | 0.6000000000 |\n|  7 |    2 |   20 | 0.6666666667 | 0.7000000000 |\n|  8 |    2 |   10 | 0.7777777778 | 0.8000000000 |\n|  9 |    4 |   20 | 0.8888888889 | 0.9000000000 |\n| 10 |    4 |   20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nselect pk, a, b,\n    percent_rank() over (partition by a order by a) as pct_rank,\n    cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  2 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  3 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  4 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  5 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  6 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  7 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  8 |    2 |   10 | 0.0000000000 | 1.0000000000 |\n|  9 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n| 10 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nURL: https://mariadb.com/kb/en/percent_rank/','','https://mariadb.com/kb/en/percent_rank/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (781,41,'PERCENTILE_CONT','MariaDB starting with 10.3.3\n----------------------------\nThe PERCENTILE_CONT() window function was first introduced with in MariaDB\n10.3.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nPERCENTILE_CONT() (standing for continuous percentile) is a window function\nwhich returns a value which corresponds to the given fraction in the sort\norder. If required, it will interpolate between adjacent input items.\n\nEssentially, the following process is followed to find the value to return:\n\n* Get the number of rows in the partition, denoted by N\n* RN = p*(N-1), where p denotes the argument to the PERCENTILE_CONT function\n* calculate the FRN(floor row number) and CRN(column row number for the group(\nFRN= floor(RN) and CRN = ceil(RN))\n* look up rows FRN and CRN\n* If (CRN = FRN = RN) then the result is (value of expression from row at RN)\n* Otherwise the result is\n* (CRN - RN) * (value of expression for row at FRN) +\n* (RN - FRN) * (value of expression for row at CRN)\n\nThe MEDIAN function is a specific case of PERCENTILE_CONT, equivalent to\nPERCENTILE_CONT(0.5).\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.0000000000 |\n| Lord of the Ladybirds | 4.0000000000 |\n| Lady of the Flies     | 2.0000000000 |\n| Lady of the Flies     | 2.0000000000 |\n| Lady of the Flies     | 2.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 5.0000000000 |\n| Lord of the Ladybirds | 5.0000000000 |\n| Lady of the Flies     | 5.0000000000 |\n| Lady of the Flies     | 5.0000000000 |\n| Lady of the Flies     | 5.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 3.0000000000 |\n| Lord of the Ladybirds | 3.0000000000 |\n| Lady of the Flies     | 1.0000000000 |\n| Lady of the Flies     | 1.0000000000 |\n| Lady of the Flies     | 1.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(0.6) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.2000000000 |\n| Lord of the Ladybirds | 4.2000000000 |\n| Lady of the Flies     | 2.6000000000 |\n| Lady of the Flies     | 2.6000000000 |\n| Lady of the Flies     | 2.6000000000 |\n+-----------------------+--------------+\n\nURL: https://mariadb.com/kb/en/percentile_cont/','','https://mariadb.com/kb/en/percentile_cont/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (782,41,'PERCENTILE_DISC','MariaDB starting with 10.3.3\n----------------------------\nThe PERCENTILE_DISC() window function was first introduced with in MariaDB\n10.3.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nPERCENTILE_DISC() (standing for discrete percentile) is a window function\nwhich returns the first value in the set whose ordered position is the same or\nmore than the specified fraction.\n\nEssentially, the following process is followed to find the value to return:\n\n* Get the number of rows in the partition.\n* Walk through the partition, in order, until finding the the first row with\nCUME_DIST() >= function_argument.\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY star_rating)\n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    3 |\n| Lord of the Ladybirds |    3 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(0) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    3 |\n| Lord of the Ladybirds |    3 |\n| Lady of the Flies     |    1 |\n| Lady of the Flies     |    1 |\n| Lady of the Flies     |    1 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(1) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    5 |\n| Lord of the Ladybirds |    5 |\n| Lady of the Flies     |    5 |\n| Lady of the Flies     |    5 |\n| Lady of the Flies     |    5 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(0.6) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    5 |\n| Lord of the Ladybirds |    5 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n+-----------------------+------\n\nURL: https://mariadb.com/kb/en/percentile_disc/','','https://mariadb.com/kb/en/percentile_disc/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (783,41,'RANK','Syntax\n------\n\nRANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nRANK() is a window function that displays the number of a given row, starting\nat one and following the ORDER BY sequence of the window function, with\nidentical values receiving the same result. It is similar to the ROW_NUMBER()\nfunction except that in that function, identical values will receive a\ndifferent row number for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course  | mark | name    |\n+------+------------+---------+---------+------+---------+\n|    1 |          1 |       1 | Biology |   70 | Roger   |\n|    2 |          2 |       2 | Biology |   60 | Bilal   |\n|    1 |          1 |       1 | Maths   |   70 | Voitto  |\n|    2 |          2 |       2 | Maths   |   60 | Thulile |\n|    2 |          2 |       3 | Maths   |   60 | Pritha  |\n|    4 |          3 |       4 | Maths   |   55 | Chun    |\n+------+------------+---------+---------+------+---------+\n\nURL: https://mariadb.com/kb/en/rank/','','https://mariadb.com/kb/en/rank/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (784,41,'ROW_NUMBER','Syntax\n------\n\nROW_NUMBER() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nROW_NUMBER() is a window function that displays the number of a given row,\nstarting at one and following the ORDER BY sequence of the window function,\nwith identical values receiving different row numbers. It is similar to the\nRANK() and DENSE_RANK() functions except that in that function, identical\nvalues will receive the same rank for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course  | mark | name    |\n+------+------------+---------+---------+------+---------+\n|    1 |          1 |       1 | Biology |   70 | Roger   |\n|    2 |          2 |       2 | Biology |   60 | Bilal   |\n|    1 |          1 |       1 | Maths   |   70 | Voitto  |\n|    2 |          2 |       2 | Maths   |   60 | Thulile |\n|    2 |          2 |       3 | Maths   |   60 | Pritha  |\n|    4 |          3 |       4 | Maths   |   55 | Chun    |\n+------+------------+---------+---------+------+---------+\n\nURL: https://mariadb.com/kb/en/row_number/','','https://mariadb.com/kb/en/row_number/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (785,41,'Aggregate Functions as Window Functions','It is possible to use aggregate functions as window functions. An aggregate\nfunction used as a window function must have the OVER clause. For example,\nhere\'s COUNT() used as a window function:\n\nselect COUNT(*) over  (order by column) from table;\n\nMariaDB currently allows these aggregate functions to be used as window\nfunctions:\n\n* AVG\n* BIT_AND\n* BIT_OR\n* BIT_XOR\n* COUNT\n* JSON_ARRAYAGG\n* JSON_OBJECTAGG\n* MAX\n* MIN\n* STD\n* STDDEV\n* STDDEV_POP\n* STDDEV_SAMP\n* SUM\n* VAR_POP\n* VAR_SAMP\n* VARIANCE\n\nURL: https://mariadb.com/kb/en/aggregate-functions-as-window-functions/','','https://mariadb.com/kb/en/aggregate-functions-as-window-functions/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (786,41,'ColumnStore Window Functions','Introduction\n------------\n\nMariaDB ColumnStore provides support for window functions broadly following\nthe SQL 2003 specification. A window function allows for calculations relating\nto a window of data surrounding the current row in a result set. This\ncapability provides for simplified queries in support of common business\nquestions such as cumulative totals, rolling averages, and top 10 lists.\n\nAggregate functions are utilized for window functions however differ in\nbehavior from a group by query because the rows remain ungrouped. This\nprovides support for cumulative sums and rolling averages, for example.\n\nTwo key concepts for window functions are Partition and Frame:\n\n* A Partition is a group of rows, or window, that have the same value for a\nspecific column, for example a Partition can be created over a time period\nsuch as a quarter or lookup values.\n* The Frame for each row  is a subset of the row\'s Partition. The frame\ntypically is dynamic allowing for a sliding frame of rows within the\nPartition. The Frame determines the range of rows for the windowing function.\nA Frame could be defined as the last X rows and next Y rows all the way up to\nthe entire Partition.\n\nWindow functions are applied after joins, group by, and having clauses are\ncalculated.\n\nSyntax\n------\n\nA window function is applied in the select clause using the following syntax:\n\nfunction_name ([expression [, expression ... ]]) OVER ( window_definition )\n\nwhere window_definition is defined as:\n\n[ PARTITION BY expression [, ...] ]\n[ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ]\n[ frame_clause ]\n\nPARTITION BY:\n\n* Divides the window result set into groups based on one or more expressions.\n* An expression may be a constant, column, and non window function expressions.\n* A query is not limited to a single partition by clause. Different partition\nclauses can be used across different window function applications.\n* The partition by columns do not need to be in the select list but do need to\nbe available from the query result set.\n* If there is no PARTITION BY clause, all rows of the result set define the\ngroup.\n\nORDER BY\n\n* Defines the ordering of values within the partition.\n* Can be ordered by multiple keys which may be a constant, column or non\nwindow function expression.\n* The order by columns do not need to be in the select list but need to be\navailable from the query result set.\n* Use of a select column alias from the query is not supported.\n* ASC (default) and DESC options allow for ordering ascending or descending.\n* NULLS FIRST and NULL_LAST options specify whether null values come first or\nlast in the ordering sequence. NULLS_FIRST is the default for ASC order, and\nNULLS_LAST is the default for DESC order.\n\nand the optional frame_clause is defined as:\n\n{ RANGE | ROWS } frame_start\n{ RANGE | ROWS } BETWEEN frame_start AND frame_end\n\nand the optional frame_start and frame_end are defined as (value being a\nnumeric expression):\n\nUNBOUNDED PRECEDING\nvalue PRECEDING\nCURRENT ROW\nvalue FOLLOWING\nUNBOUNDED FOLLOWING\n\nRANGE/ROWS:\n\n* Defines the windowing clause for calculating the set of rows that the\nfunction applies to for calculating a given rows window function result.\n* Requires an ORDER BY clause to define the row order for the window.\n* ROWS specify the window in physical units, i.e. result set rows and must be\na constant or expression evaluating to a positive numeric value.\n* RANGE specifies the window as a logical offset. If the the expression\nevaluates to a numeric value then the ORDER BY expression must be a numeric or\nDATE type. If the expression evaluates to an interval value then the ORDER BY\nexpression must be a DATE data type.\n* UNBOUNDED PRECEDING indicates the window starts at the first row of the\npartition.\n* UNBOUNDED FOLLOWING indicates the window ends at the last row of the\npartition.\n* CURRENT ROW specifies the window start or ends at the current row or value.\n* If omitted, the default is ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW.\n\nSupported Functions\n-------------------\n\n+--------------------------------+-------------------------------------------+\n| Function                       | Description                               |\n+--------------------------------+-------------------------------------------+\n| AVG()                          | The average of all input values.          |\n+--------------------------------+-------------------------------------------+\n| COUNT()                        | Number of input rows.                     |\n+--------------------------------+-------------------------------------------+\n| CUME_DIST()                    | Calculates the cumulative distribution,   |\n|                                | or relative rank, of the current row to   |\n|                                | other rows in the same partition. Number  |\n|                                | of peer or preceding rows / number of     |\n|                                | rows in partition.                        |\n+--------------------------------+-------------------------------------------+\n| DENSE_RANK()                   | Ranks items in a group leaving no gaps    |\n|                                | in ranking sequence when there are ties.  |\n+--------------------------------+-------------------------------------------+\n| FIRST_VALUE()                  | The value evaluated at the row that is    |\n|                                | the first row of the window frame         |\n|                                | (counting from 1); null if no such row.   |\n+--------------------------------+-------------------------------------------+\n| LAG()                          | The value evaluated at the row that is    |\n|                                | offset rows before the current row        |\n|                                | within the partition; if there is no      |\n|                                | such row, instead return default. Both    |\n|                                | offset and default are evaluated with     |\n|                                | respect to the current row. If omitted,   |\n|                                | offset defaults to 1 and default to       |\n|                                | null. LAG provides access to more than    |\n|                                | one row of a table at the same time       |\n|                                | without a self-join. Given a series of    |\n|                                | rows returned from a query and a          |\n|                                | position of the cursor, LAG provides      |\n|                                | access to a row at a given physical       |\n|                                | offset prior to that position.            |\n+--------------------------------+-------------------------------------------+\n| LAST_VALUE()                   | The value evaluated at the row that is    |\n|                                | the last row of the window frame          |\n|                                | (counting from 1); null if no such row.   |\n+--------------------------------+-------------------------------------------+\n| LEAD()                         | Provides access to a row at a given       |\n|                                | physical offset beyond that position.     |\n|                                | Returns value evaluated at the row that   |\n|                                | is offset rows after the current row      |\n|                                | within the partition; if there is no      |\n|                                | such row, instead return default. Both    |\n|                                | offset and default are evaluated with     |\n|                                | respect to the current row. If omitted,   |\n|                                | offset defaults to 1 and default to null. |\n+--------------------------------+-------------------------------------------+\n| MAX()                          | Maximum value of expression across all    |\n|                                | input values.                             |\n+--------------------------------+-------------------------------------------+\n| MEDIAN()                       | An inverse distribution function that     |\n|                                | assumes a continuous distribution model.  |\n|                                | It takes a numeric or datetime value and  |\n|                                | returns the middle value or an            |\n|                                | interpolated value that would be the      |\n|                                | middle value once the values are sorted.  |\n|                                | Nulls are ignored in the calculation.     |\n+--------------------------------+-------------------------------------------+\n| MIN()                          | Minimum value of expression across all    |\n|                                | input values.                             |\n+--------------------------------+-------------------------------------------+\n| NTH_VALUE()                    | The value evaluated at the row that is    |\n|                                | the nth row of the window frame           |\n|                                | (counting from 1); null if no such row.   |\n+--------------------------------+-------------------------------------------+\n| NTILE()                        | Divides an ordered data set into a        |\n|                                | number of buckets indicated by expr and   |\n|                                | assigns the appropriate bucket number to  |\n|                                | each row. The buckets are numbered 1      |\n|                                | through expr. The expr value must         |\n|                                | resolve to a positive constant for each   |\n|                                | partition. Integer ranging from 1 to the  |\n|                                | argument value, dividing the partition    |\n|                                | as equally as possible.                   |\n+--------------------------------+-------------------------------------------+\n| PERCENT_RANK()                 | relative rank of the current row: (rank   |\n|                                | - 1) / (total rows - 1).                  |\n+--------------------------------+-------------------------------------------+\n| PERCENTILE_CONT()              | An inverse distribution function that     |\n|                                | assumes a continuous distribution model.  |\n|                                | It takes a percentile value and a sort    |\n|                                | specification, and returns an             |\n|                                | interpolated value that would fall into   |\n|                                | that percentile value with respect to     |\n|                                | the sort specification. Nulls are         |\n|                                | ignored in the calculation.               |\n+--------------------------------+-------------------------------------------+\n| PERCENTILE_DISC()              | An inverse distribution function that     |\n|                                | assumes a discrete distribution model.    |\n|                                | It takes a percentile value and a sort    |\n|                                | specification and returns an element      |\n|                                | from the set. Nulls are ignored in the    |\n|                                | calculation.                              |\n+--------------------------------+-------------------------------------------+\n| RANK()                         | rank of the current row with gaps; same   |\n|                                | as row_number of its first peer.          |\n+--------------------------------+-------------------------------------------+\n| ROW_NUMBER()                   | number of the current row within its      |\n|                                | partition, counting from 1                |\n+--------------------------------+-------------------------------------------+\n| STDDEV() STDDEV_POP()          | Computes the population standard          |\n|                                | deviation and returns the square root of  |\n|                                | the population variance.                  |\n+--------------------------------+-------------------------------------------+\n| STDDEV_SAMP()                  | Computes the cumulative sample standard   |\n|                                | deviation and returns the square root of  |\n|                                | the sample variance.                      |\n+--------------------------------+-------------------------------------------+\n| SUM()                          | Sum of expression across all input        |\n|                                | values.                                   |\n+--------------------------------+-------------------------------------------+\n| VARIANCE() VAR_POP()           | Population variance of the input values   |\n|                                | (square of the population standard        |\n|                                | deviation).                               |\n+--------------------------------+-------------------------------------------+\n| VAR_SAMP()                     | Sample variance of the input values       |\n|                                | (square of the sample standard            |\n|                                | deviation).                               |\n+--------------------------------+-------------------------------------------+\n\nExamples\n--------\n\nExample Schema\n--------------\n\nThe examples are all based on the following simplified sales opportunity table:\n\ncreate table opportunities (\nid int,\naccountName varchar(20),\nname varchar(128),\nowner varchar(7),\namount decimal(10,2),\ncloseDate date,\nstageName varchar(11)\n) engine=columnstore;\n\nSome example values are (thanks to https://www.mockaroo.com for sample data\ngeneration):\n\n+----+---------------+------+--------+---------+-------------+-------------+\n| id | accountName   | name | owner  | amount  | closeDate   | stageName   |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 1  | Browseblab    | Mult | Bob    | 26444.8 | 2016-10-20  | Negotiating |','','https://mariadb.com/kb/en/window-functions-columnstore-window-functions/');
update help_topic set description = CONCAT(description, '\n|    |               | -lat |        |         |             |             |\n|    |               | ral  |        |         |             |             |\n|    |               | exec |        |         |             |             |\n|    |               | tive |        |         |             |             |\n|    |               | func |        |         |             |             |\n|    |               | ion  |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 2  | Mita          | Orga | Maria  | 477878. | 2016-11-28  | ClosedWon   |\n|    |               | ic   |        | 1       |             |             |\n|    |               | dema |        |         |             |             |\n|    |               | d-dr |        |         |             |             |\n|    |               | ven  |        |         |             |             |\n|    |               | benc |        |         |             |             |\n|    |               | mark |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 3  | Miboo         | De-e | Olivie | 80181.7 | 2017-01-05  | ClosedWon   |\n|    |               | gine |        |         |             |             |\n|    |               | red  |        |         |             |             |\n|    |               | hybr |        |         |             |             |\n|    |               | d    |        |         |             |             |\n|    |               | grou |        |         |             |             |\n|    |               | ware |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 4  | Youbridge     | Ente | Chris  | 946245. | 2016-07-02  | ClosedWon   |\n|    |               | pris |        | 9       |             |             |\n|    |               | -wid |        |         |             |             |\n|    |               |      |        |         |             |             |\n|    |               | bott |        |         |             |             |\n|    |               | m-li |        |         |             |             |\n|    |               | e    |        |         |             |             |\n|    |               | Grap |        |         |             |             |\n|    |               | ic   |        |         |             |             |\n|    |               | Inte |        |         |             |             |\n|    |               | face |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 5  | Skyba         | Reve | Maria  | 696241. | 2017-02-17  | Negotiating |\n|    |               | se-e |        | 2       |             |             |\n|    |               | gine |        |         |             |             |\n|    |               | red  |        |         |             |             |\n|    |               | fres |        |         |             |             |\n|    |               | -thi |        |         |             |             |\n|    |               | king |        |         |             |             |\n|    |               | stan |        |         |             |             |\n|    |               | ardi |        |         |             |             |\n|    |               | atio |        |         |             |             |\n|    |               |      |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 6  | Eayo          | Fund | Bob    | 765605. | 2016-08-27  | Prospecting |\n|    |               | ment |        | 2       |             |             |\n|    |               | l    |        |         |             |             |\n|    |               | well |        |         |             |             |\n|    |               | modu |        |         |             |             |\n|    |               | ated |        |         |             |             |\n|    |               | arti |        |         |             |             |\n|    |               | icia |        |         |             |             |\n|    |               |      |        |         |             |             |\n|    |               | inte |        |         |             |             |\n|    |               | lige |        |         |             |             |\n|    |               | ce   |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 7  | Yotz          | Exte | Chris  | 319624. | 2017-01-06  | ClosedLost  |\n|    |               | ded  |        | 0       |             |             |\n|    |               | seco |        |         |             |             |\n|    |               | dary |        |         |             |             |\n|    |               | infr |        |         |             |             |\n|    |               | stru |        |         |             |             |\n|    |               | ture |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 8  | Oloo          | Conf | Chris  | 321016. | 2017-03-08  | ClosedLost  |\n|    |               | gura |        | 6       |             |             |\n|    |               | le   |        |         |             |             |\n|    |               | web- |        |         |             |             |\n|    |               | nabl |        |         |             |             |\n|    |               | d    |        |         |             |             |\n|    |               | data |        |         |             |             |\n|    |               | ware |        |         |             |             |\n|    |               | ouse |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 9  | Kaymbo        | Mult | Bob    | 690881. | 2017-01-02  | Developing  |\n|    |               | -lat |        | 1       |             |             |\n|    |               | ral  |        |         |             |             |\n|    |               | web- |        |         |             |             |\n|    |               | nabl |        |         |             |             |\n|    |               | d    |        |         |             |             |\n|    |               | defi |        |         |             |             |\n|    |               | itio |        |         |             |             |\n|    |               |      |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 10 | Rhyloo        | Publ | Chris  | 965477. | 2016-11-07  | Prospecting |\n|    |               | c-ke |        | 4       |             |             |\n|    |               |      |        |         |             |             |\n|    |               | cohe |        |         |             |             |\n|    |               | ent  |        |         |             |             |\n|    |               | infr |        |         |             |             |\n|    |               | stru |        |         |             |             |\n|    |               | ture |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n\nThe schema, sample data, and queries are available as an attachment to this\narticle.\n\nCumulative Sum and Running Max Example\n--------------------------------------\n\nWindow functions can be used to achieve cumulative / running calculations on a\ndetail report. In this case a won opportunity report for a 7 day period adds\ncolumns to show the accumulated won amount as well as the current highest\nopportunity amount in preceding rows.\n\nselect owner, \naccountName, \nCloseDate, \namount, \nsum(amount) over (order by CloseDate rows between unbounded preceding and\ncurrent row) cumeWon, \nmax(amount) over (order by CloseDate rows between unbounded preceding and\ncurrent row) runningMax\nfrom opportunities \nwhere stageName=\'ClosedWon\' \nand closeDate >= \'2016-10-02\' and closeDate <= \'2016-10-09\' \norder by CloseDate;\n\nwith example results:\n\n+--------+---------------+-------------+---------+----------+--------------+\n| owner  | accountName   | CloseDate   | amount  | cumeWon  | runningMax   |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Babbleopia    | 2016-10-02  | 437636. | 437636.4 | 437636.47    |\n|        |               |             | 7       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Thoughtworks  | 2016-10-04  | 146086. | 583722.9 | 437636.47    |\n|        |               |             | 1       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Devpulse      | 2016-10-05  | 834235. | 1417958. | 834235.93    |\n|        |               |             | 3       | 1        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Linkbridge    | 2016-10-07  | 539977. | 2458738. | 834235.93    |\n|        |               |             | 5       | 5        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Trupe         | 2016-10-07  | 500802. | 1918761. | 834235.93    |\n|        |               |             | 9       | 0        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Latz          | 2016-10-08  | 857254. | 3315993. | 857254.87    |\n|        |               |             | 7       | 2        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Avamm         | 2016-10-09  | 699566. | 4015560. | 857254.87    |\n|        |               |             | 6       | 8        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n\nPartitioned Cumulative Sum and Running Max Example\n--------------------------------------------------\n\nThe above example can be partitioned, so that the window functions are over a\nparticular field grouping such as owner and accumulate within that grouping.\nThis is achieved by adding the syntax \"partition by <columns>\" in the window\nfunction clause.\n\nselect owner,  \naccountName,  \nCloseDate,  \namount,  \nsum(amount) over (partition by owner order by CloseDate rows between unbounded\npreceding and current row) cumeWon,  \nmax(amount) over (partition by owner order by CloseDate rows between unbounded\npreceding and current row) runningMax \nfrom opportunities  \nwhere stageName=\'ClosedWon\' \nand closeDate >= \'2016-10-02\' and closeDate <= \'2016-10-09\'  \norder by owner, CloseDate;\n\nwith example results:\n\n+--------+---------------+-------------+---------+----------+--------------+\n| owner  | accountName   | CloseDate   | amount  | cumeWon  | runningMax   |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Babbleopia    | 2016-10-02  | 437636. | 437636.4 | 437636.47    |\n|        |               |             | 7       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Thoughtworks  | 2016-10-04  | 146086. | 583722.9 | 437636.47    |\n|        |               |             | 1       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Latz          | 2016-10-08  | 857254. | 1440977. | 857254.87    |\n|        |               |             | 7       | 5        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Linkbridge    | 2016-10-07  | 539977. | 539977.4 | 539977.45    |\n|        |               |             | 5       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Avamm         | 2016-10-09  | 699566. | 1239544. | 699566.86    |\n|        |               |             | 6       | 1        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Devpulse      | 2016-10-05  | 834235. | 834235.9 | 834235.93    |\n|        |               |             | 3       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Trupe         | 2016-10-07  | 500802. | 1335038. | 834235.93    |\n|        |               |             | 9       | 2        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n\nRanking / Top Results\n---------------------\n\nThe rank window function allows for ranking or assigning a numeric order value\nbased on the window function definition. Using the Rank() function will result\nin the same value for ties / equal values and the next rank value skipped. The\nDense_Rank() function behaves similarly except the next consecutive number is\nused after a tie rather than skipped. The Row_Number() function will provide a\nunique ordering value. The example query shows the Rank() function being\napplied to rank sales reps by the number of opportunities for Q4 2016.\n\nselect owner, \nwonCount, \nrank() over (order by wonCount desc) rank \nfrom (\n select owner,\n count(*) wonCount\n from opportunities\n where stageName=\'ClosedWon\'\n and closeDate >= \'2016-10-01\' and closeDate < \'2016-12-31\'\n group by owner\n) t\norder by rank;\n\nwith example results (note the query is technically incorrect by using\ncloseDate < \'2016-12-31\' however this creates a tie scenario for illustrative\npurposes):\n\n+----------------------+----------------------------------+------------------+\n| owner                | wonCount                         | rank             |\n+----------------------+----------------------------------+------------------+\n| Bill                 | 19                               | 1                |\n+----------------------+----------------------------------+------------------+\n| Chris                | 15                               | 2                |') WHERE help_topic_id = 786;
update help_topic set description = CONCAT(description, '\n+----------------------+----------------------------------+------------------+\n| Maria                | 14                               | 3                |\n+----------------------+----------------------------------+------------------+\n| Bob                  | 14                               | 3                |\n+----------------------+----------------------------------+------------------+\n| Olivier              | 10                               | 5                |\n+----------------------+----------------------------------+------------------+\n\nIf the dense_rank function is used the rank values would be 1,2,3,3,4 and for\nthe row_number function the values would be 1,2,3,4,5.\n\nFirst and Last Values\n---------------------\n\nThe first_value and last_value functions allow determining the first and last\nvalues of a given range. Combined with a group by this allows summarizing\nopening and closing values. The example shows a more complex case where\ndetailed information is presented for first and last opportunity by quarter.\n\nselect a.year, \na.quarter, \nf.accountName firstAccountName, \nf.owner firstOwner, \nf.amount firstAmount, \nl.accountName lastAccountName, \nl.owner lastOwner, \nl.amount lastAmount \nfrom (\n select year,\n quarter,\n min(firstId) firstId,\n min(lastId) lastId\n from (\n  select year(closeDate) year,\n  quarter(closeDate) quarter,\n  first_value(id) over (partition by year(closeDate), quarter(closeDate)\norder by closeDate rows between unbounded preceding and current row) firstId, \n  last_value(id) over (partition by year(closeDate), quarter(closeDate)\norder by closeDate rows between current row and unbounded following) lastId \n  from opportunities  where stageName=\'ClosedWon\'\n ) t\n group by year, quarter order by year,quarter\n) a \njoin opportunities f on a.firstId = f.id \njoin opportunities l on a.lastId = l.id \norder by year, quarter;\n\nwith example results:\n\n+----+------+------------+--------+---------+-----------+-------+--------+\n| ye | quar | firstAccou | firstO | firstAm | lastAccou | lastO | lastAm |\n| r  | er   | tName      | ner    | unt     | tName     | ner   | unt    |\n+----+------+------------+--------+---------+-----------+-------+--------+\n| 20 | 3    | Skidoo     | Bill   | 523295. | Skipstorm | Bill  | 151420 |\n| 6  |      |            |        | 7       |           |       | 86     |\n+----+------+------------+--------+---------+-----------+-------+--------+\n| 20 | 4    | Skimia     | Chris  | 961513. | Avamm     | Maria | 112493 |\n| 6  |      |            |        | 9       |           |       | 65     |\n+----+------+------------+--------+---------+-----------+-------+--------+\n| 20 | 1    | Yombu      | Bob    | 536875. | Skaboo    | Chris | 270273 |\n| 7  |      |            |        | 1       |           |       | 08     |\n+----+------+------------+--------+---------+-----------+-------+--------+\n\nPrior and Next Example\n----------------------\n\nSometimes it useful to understand the previous and next values in the context\nof a given row. The lag and lead window functions provide this capability. By\ndefault the offset is one providing the prior or next value but can also be\nprovided to get a larger offset. The example query is a report of\nopportunities by account name showing the opportunity amount, and the prior\nand next opportunity amount for that account by close date.\n\nselect accountName, \ncloseDate,  \namount currentOppAmount, \nlag(amount) over (partition by accountName order by closeDate) priorAmount,\nlead(amount) over (partition by accountName order by closeDate) nextAmount \nfrom opportunities \norder by accountName, closeDate \nlimit 9;\n\nwith example results:\n\n+--------------+-----------+-------------------+--------------+-------------+\n| accountName  | closeDate | currentOppAmount  | priorAmount  | nextAmount  |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-09-1 | 645098.45         | NULL         | 161086.82   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-10-1 | 161086.82         | 645098.45    | 350235.75   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-12-1 | 350235.75         | 161086.82    | 878595.89   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-12-3 | 878595.89         | 350235.75    | 922322.39   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2017-01-2 | 922322.39         | 878595.89    | NULL        |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abatz        | 2016-10-1 | 795424.15         | NULL         | NULL        |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Agimba       | 2016-07-0 | 288974.84         | NULL         | 914461.49   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Agimba       | 2016-09-0 | 914461.49         | 288974.84    | 176645.52   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Agimba       | 2016-09-2 | 176645.52         | 914461.49    | NULL        |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n\nQuartiles Example\n-----------------\n\nThe NTile window function allows for breaking up a data set into portions\nassigned a numeric value to each portion of the range. NTile(4) breaks the\ndata up into quartiles (4 sets). The example query produces a report of all\nopportunities summarizing the quartile boundaries of amount values.\n\nselect t.quartile, \nmin(t.amount) min, \nmax(t.amount) max \nfrom (\n select amount,\n ntile(4) over (order by amount asc) quartile\n from opportunities\n where closeDate >= \'2016-10-01\' and closeDate <= \'2016-12-31\'\n ) t\ngroup by quartile \norder by quartile;\n\nWith example results:\n\n+-----------------------------------------+----------------+----------------+\n| quartile                                | min            | max            |\n+-----------------------------------------+----------------+----------------+\n| 1                                       | 6337.15        | 287634.01      |\n+-----------------------------------------+----------------+----------------+\n| 2                                       | 288796.14      | 539977.45      |\n+-----------------------------------------+----------------+----------------+\n| 3                                       | 540070.04      | 748727.51      |\n+-----------------------------------------+----------------+----------------+\n| 4                                       | 753670.77      | 998864.47      |\n+-----------------------------------------+----------------+----------------+\n\nPercentile Example\n------------------\n\nThe percentile functions have a slightly different syntax from other window\nfunctions as can be seen in the example below. These functions can be only\napplied against numeric values. The argument to the function is the percentile\nto evaluate. Following \'within group\' is the sort expression which indicates\nthe sort column and optionally order. Finally after \'over\' is an optional\npartition by clause, for no partition clause use \'over ()\'. The example below\nutilizes the value 0.5 to calculate the median opportunity amount in the rows.\nThe values differ sometimes because percentile_cont will return the average of\nthe 2 middle rows for an even data set while percentile_desc returns the first\nencountered in the sort.\n\nselect owner,  \naccountName,  \nCloseDate,  \namount,\npercentile_cont(0.5) within group (order by amount) over (partition by owner)\npct_cont,\npercentile_disc(0.5) within group (order by amount) over (partition by owner)\npct_disc\nfrom opportunities  \nwhere stageName=\'ClosedWon\' \nand closeDate >= \'2016-10-02\' and closeDate <= \'2016-10-09\'  \norder by owner, CloseDate;\n\nWith example results:\n\n+--------+----------------+-------------+---------+------------+------------+\n| owner  | accountName    | CloseDate   | amount  | pct_cont   | pct_disc   |\n+--------+----------------+-------------+---------+------------+------------+\n| Bill   | Babbleopia     | 2016-10-02  | 437636. | 437636.470 | 437636.47  |\n|        |                |             | 7       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Bill   | Thoughtworks   | 2016-10-04  | 146086. | 437636.470 | 437636.47  |\n|        |                |             | 1       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Bill   | Latz           | 2016-10-08  | 857254. | 437636.470 | 437636.47  |\n|        |                |             | 7       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Chris  | Linkbridge     | 2016-10-07  | 539977. | 619772.155 | 539977.45  |\n|        |                |             | 5       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Chris  | Avamm          | 2016-10-09  | 699566. | 619772.155 | 539977.45  |\n|        |                |             | 6       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Olivie | Devpulse       | 2016-10-05  | 834235. | 667519.110 | 500802.29  |\n|        |                |             | 3       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Olivie | Trupe          | 2016-10-07  | 500802. | 667519.110 | 500802.29  |\n|        |                |             | 9       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n\nURL: https://mariadb.com/kb/en/window-functions-columnstore-window-functions/') WHERE help_topic_id = 786;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (787,41,'Window Frames','Syntax\n------\n\nframe_clause:\n {ROWS | RANGE} {frame_border | BETWEEN frame_border AND frame_border}\n\nframe_border:\n | UNBOUNDED PRECEDING\n | UNBOUNDED FOLLOWING\n | CURRENT ROW\n | expr PRECEDING\n | expr FOLLOWING\n\nDescription\n-----------\n\nA basic overview of window functions is described in Window Functions\nOverview. Window frames expand this functionality by allowing the function to\ninclude a specified a number of rows around the current row.\n\nThese include:\n\n* All rows before the current row (UNBOUNDED PRECEDING), for example RANGE\nBETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\n* All rows after the current row (UNBOUNDED FOLLOWING), for example RANGE\nBETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING\n* A set number of rows before the current row (expr PRECEDING) for example\nRANGE BETWEEN 6 PRECEDING AND CURRENT ROW\n* A set number of rows after the current row (expr PRECEDING AND expr\nFOLLOWING)  for example RANGE BETWEEN CURRENT ROW AND 2 FOLLOWING\n* A specified number of rows both before and after the current row, for\nexample RANGE BETWEEN 6 PRECEDING AND 3 FOLLOWING\n\nThe following functions operate on window frames:\n\n* AVG\n* BIT_AND\n* BIT_OR\n* BIT_XOR\n* COUNT\n* LEAD\n* MAX\n* MIN\n* NTILE\n* STD\n* STDDEV\n* STDDEV_POP\n* STDDEV_SAMP\n* SUM\n* VAR_POP\n* VAR_SAMP\n* VARIANCE\n\nWindow frames are determined by the frame_clause in the window function\nrequest.\n\nTake the following example:\n\nCREATE TABLE `student_test` (\n name char(10),\n test char(10),\n score tinyint(4)\n);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, SUM(score) \n OVER () AS total_score\n FROM student_test;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Chun    | SQL    |    75 |         453 |\n| Chun    | Tuning |    73 |         453 |\n| Esben   | SQL    |    43 |         453 |\n| Esben   | Tuning |    31 |         453 |\n| Kaolin  | SQL    |    56 |         453 |\n| Kaolin  | Tuning |    88 |         453 |\n| Tatiana | SQL    |    87 |         453 |\n+---------+--------+-------+-------------+\n\nBy not specifying an OVER clause, the SUM function is run over the entire\ndataset. However, if we specify an ORDER BY condition based on score (and\norder the entire result in the same way for clarity), the following result is\nreturned:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score) AS total_score\n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          31 |\n| Esben   | SQL    |    43 |          74 |\n| Kaolin  | SQL    |    56 |         130 |\n| Chun    | Tuning |    73 |         203 |\n| Chun    | SQL    |    75 |         278 |\n| Tatiana | SQL    |    87 |         365 |\n| Kaolin  | Tuning |    88 |         453 |\n+---------+--------+-------+-------------+\n\nThe total_score column represents a running total of the current row, and all\nprevious rows. The window frame in this example expands as the function\nproceeds.\n\nThe above query makes use of the default to define the window frame. It could\nbe written explicitly as follows:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          31 |\n| Esben   | SQL    |    43 |          74 |\n| Kaolin  | SQL    |    56 |         130 |\n| Chun    | Tuning |    73 |         203 |\n| Chun    | SQL    |    75 |         278 |\n| Tatiana | SQL    |    87 |         365 |\n| Kaolin  | Tuning |    88 |         453 |\n+---------+--------+-------+-------------+\n\nLet\'s look at some alternatives:\n\nFirstly, applying the window function to the current row and all following\nrows can be done with the use of UNBOUNDED FOLLOWING:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |         453 |\n| Esben   | SQL    |    43 |         422 |\n| Kaolin  | SQL    |    56 |         379 |\n| Chun    | Tuning |    73 |         323 |\n| Chun    | SQL    |    75 |         250 |\n| Tatiana | SQL    |    87 |         175 |\n| Kaolin  | Tuning |    88 |          88 |\n+---------+--------+-------+-------------+\n\nIt\'s possible to specify a number of rows, rather than the entire unbounded\nfollowing or preceding set. The following example takes the current row, as\nwell as the previous row:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          31 |\n| Esben   | SQL    |    43 |          74 |\n| Kaolin  | SQL    |    56 |          99 |\n| Chun    | Tuning |    73 |         129 |\n| Chun    | SQL    |    75 |         148 |\n| Tatiana | SQL    |    87 |         162 |\n| Kaolin  | Tuning |    88 |         175 |\n+---------+--------+-------+-------------+\n\nThe current row and the following row:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          74 |\n| Esben   | SQL    |    43 |         130 |\n| Kaolin  | SQL    |    56 |         172 |\n| Chun    | Tuning |    73 |         204 |\n| Chun    | SQL    |    75 |         235 |\n| Tatiana | SQL    |    87 |         250 |\n| Kaolin  | Tuning |    88 |         175 |\n+---------+--------+-------+-------------+\n\nURL: https://mariadb.com/kb/en/window-frames/','','https://mariadb.com/kb/en/window-frames/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (788,42,'SPIDER_BG_DIRECT_SQL','Syntax\n------\n\nSPIDER_BG_DIRECT_SQL(\'sql\', \'tmp_table_list\', \'parameters\')\n\nDescription\n-----------\n\nExecutes the given SQL statement in the background on the remote server, as\ndefined in the parameters listing. If the query returns a result-set, it\nsttores the results in the given temporary table. When the given SQL statement\nexecutes successfully, this function returns the number of called UDF\'s. It\nreturns 0 when the given SQL statement fails.\n\nThis function is a UDF installed with the Spider storage engine.\n\nExamples\n--------\n\nSELECT SPIDER_BG_DIRECT_SQL(\'SELECT * FROM example_table\',  \'\', \n \'srv \"node1\", port \"8607\"\') AS \"Direct Query\";\n+--------------+\n| Direct Query | \n+--------------+\n|            1 |\n+--------------+\n\nParameters\n----------\n\nerror_rw_mode\n-------------\n\n* Description: Returns empty results on network error.\n0 : Return error on getting network error.\n1: Return 0 records on getting network error.\n\n* Default Table Value: 0\n* DSN Parameter Name: erwm\n\nURL: https://mariadb.com/kb/en/spider_bg_direct_sql/','','https://mariadb.com/kb/en/spider_bg_direct_sql/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (789,42,'SPIDER_COPY_TABLES','Syntax\n------\n\nSPIDER_COPY_TABLES(spider_table_name, \n source_link_id, destination_link_id_list [,parameters])\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function copies table\ndata from source_link_id to destination_link_id_list. The service does not\nneed to be stopped in order to copy.\n\nIf the Spider table is partitioned, the name must be of the format\ntable_name#P#partition_name. The partition name can be viewed in the\nmysql.spider_tables table, for example:\n\nSELECT table_name FROM mysql.spider_tables;\n+-------------+\n| table_name  |\n+-------------+\n| spt_a#P#pt1 |\n| spt_a#P#pt2 |\n| spt_a#P#pt3 |\n+-------------+\n\nReturns 1 if the data was copied successfully, or 0 if copying the data failed.\n\nURL: https://mariadb.com/kb/en/spider_copy_tables/','','https://mariadb.com/kb/en/spider_copy_tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (790,42,'SPIDER_DIRECT_SQL','Syntax\n------\n\nSPIDER_DIRECT_SQL(\'sql\', \'tmp_table_list\', \'parameters\')\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function is used to\nexecute the SQL string sql on the remote server, as defined in parameters. If\nany resultsets are returned, they are stored in the tmp_table_list.\n\nThe function returns 1 if the SQL executes successfully, or 0 if it fails.\n\nExamples\n--------\n\nSELECT SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv \"node1\", port \"8607\"\');\n+----------------------------------------------------------------------+\n| SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv \"node1\", port \"8607\"\') |\n+----------------------------------------------------------------------+\n|                                                                    1 |\n+----------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/spider_direct_sql/','','https://mariadb.com/kb/en/spider_direct_sql/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (791,42,'SPIDER_FLUSH_TABLE_MON_CACHE','Syntax\n------\n\nSPIDER_FLUSH_TABLE_MON_CACHE()\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function is used for\nrefreshing monitoring server information. It returns a value of 1.\n\nExamples\n--------\n\nSELECT SPIDER_FLUSH_TABLE_MON_CACHE();\n+--------------------------------+\n| SPIDER_FLUSH_TABLE_MON_CACHE() |\n+--------------------------------+\n|                              1 |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/spider_flush_table_mon_cache/','','https://mariadb.com/kb/en/spider_flush_table_mon_cache/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (792,43,'COLUMN_ADD','Syntax\n------\n\nCOLUMN_ADD(dyncol_blob, column_nr, value [as type], [column_nr, value [as\ntype]]...);\nCOLUMN_ADD(dyncol_blob, column_name, value [as type], [column_name, value [as\ntype]]...);\n\nDescription\n-----------\n\nAdds or updates dynamic columns.\n\n* dyncol_blob must be either a valid dynamic columns blob (for example,\nCOLUMN_CREATE returns such blob), or an empty string.\n* column_name specifies the name of the column to be added. If dyncol_blob\nalready has a column with this name, it will be overwritten.\n* value specifies the new value for the column.  Passing a NULL value will\ncause the column to be deleted.\n* as type is optional. See #datatypes section for a discussion about types.\n\nThe return value is a dynamic column blob after the modifications.\n\nExamples\n--------\n\nUPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob, \"column_name\", \"value\")\nWHERE id=1;\n\nNote: COLUMN_ADD() is a regular function (just like CONCAT()), hence, in order\nto update the value in the table you have to use the UPDATE ... SET\ndynamic_col=COLUMN_ADD(dynamic_col, ....) pattern.\n\nURL: https://mariadb.com/kb/en/column_add/','','https://mariadb.com/kb/en/column_add/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (793,43,'COLUMN_CHECK','Syntax\n------\n\nCOLUMN_CHECK(dyncol_blob);\n\nDescription\n-----------\n\nCheck if dyncol_blob is a valid packed dynamic columns blob. Return value of 1\nmeans the blob is valid, return value of 0 means it is not.\n\nRationale: Normally, one works with valid dynamic column blobs. Functions like\nCOLUMN_CREATE, COLUMN_ADD, COLUMN_DELETE always return valid dynamic column\nblobs. However, if a dynamic column blob is accidentally truncated, or\ntranscoded from one character set to another, it will be corrupted. This\nfunction can be used to check if a value in a blob field is a valid dynamic\ncolumn blob.\n\nURL: https://mariadb.com/kb/en/column_check/','','https://mariadb.com/kb/en/column_check/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (794,43,'COLUMN_CREATE','Syntax\n------\n\nCOLUMN_CREATE(column_nr, value [as type], [column_nr, value [as type]]...);\nCOLUMN_CREATE(column_name, value [as type], [column_name, value [as type]]...);\n\nDescription\n-----------\n\nReturns a dynamic columns blob that stores the specified columns with values.\n\nThe return value is suitable for\n\n* storing in a table\n* further modification with other dynamic columns functions\n\nThe as type part allows one to specify the value type. In most cases, this is\nredundant because MariaDB will be able to deduce the type of the value.\nExplicit type specification may be needed when the type of the value is not\napparent. For example, a literal \'2012-12-01\' has a CHAR type by default, one\nwill need to specify \'2012-12-01\' AS DATE to have it stored as a date. See\nDynamic Columns:Datatypes for further details.\n\nExamples\n--------\n\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(\"column_name\", \"value\");\n\nURL: https://mariadb.com/kb/en/column_create/','','https://mariadb.com/kb/en/column_create/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (795,43,'COLUMN_DELETE','Syntax\n------\n\nCOLUMN_DELETE(dyncol_blob, column_nr, column_nr...);\nCOLUMN_DELETE(dyncol_blob, column_name, column_name...);\n\nDescription\n-----------\n\nDeletes a dynamic column with the specified name. Multiple names can be given.\nThe return value is a dynamic column blob after the modification.\n\nURL: https://mariadb.com/kb/en/column_delete/','','https://mariadb.com/kb/en/column_delete/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (796,43,'COLUMN_EXISTS','Syntax\n------\n\nCOLUMN_EXISTS(dyncol_blob, column_nr);\nCOLUMN_EXISTS(dyncol_blob, column_name);\n\nDescription\n-----------\n\nChecks if a column with name column_name exists in dyncol_blob. If yes, return\n1, otherwise return 0. See dynamic columns for more information.\n\nURL: https://mariadb.com/kb/en/column_exists/','','https://mariadb.com/kb/en/column_exists/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (797,43,'COLUMN_GET','Syntax\n------\n\nCOLUMN_GET(dyncol_blob, column_nr as type);\nCOLUMN_GET(dyncol_blob, column_name as type);\n\nDescription\n-----------\n\nGets the value of a dynamic column by its name. If no column with the given\nname exists, NULL will be returned.\n\ncolumn_name as type requires that one specify the datatype of the dynamic\ncolumn they are reading.\n\nThis may seem counter-intuitive: why would one need to specify which datatype\nthey\'re retrieving? Can\'t the dynamic columns system figure the datatype from\nthe data being stored?\n\nThe answer is: SQL is a statically-typed language. The SQL interpreter needs\nto know the datatypes of all expressions before the query is run (for example,\nwhen one is using prepared statements and runs \"select COLUMN_GET(...)\", the\nprepared statement API requires the server to inform the client about the\ndatatype of the column being read before the query is executed and the server\ncan see what datatype the column actually has).\n\nLengths\n-------\n\nIf you\'re running queries like:\n\nSELECT COLUMN_GET(blob, \'colname\' as CHAR) ...\n\nwithout specifying a maximum length (i.e. using as CHAR, not as CHAR(n)),\nMariaDB will report the maximum length of the resultset column to be\n16,777,216. This may cause excessive memory usage in some client libraries,\nbecause they try to pre-allocate a buffer of maximum resultset width. To avoid\nthis problem, use CHAR(n) whenever you\'re using COLUMN_GET in the select list.\n\nSee Dynamic Columns:Datatypes for more information about datatypes.\n\nURL: https://mariadb.com/kb/en/column_get/','','https://mariadb.com/kb/en/column_get/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (798,43,'COLUMN_JSON','Syntax\n------\n\nCOLUMN_JSON(dyncol_blob)\n\nDescription\n-----------\n\nReturns a JSON representation of data in dyncol_blob. Can also be used to\ndisplay nested columns. See dynamic columns for more information.\n\nExample\n-------\n\nselect item_name, COLUMN_JSON(dynamic_cols) from assets;\n+-----------------+----------------------------------------+\n| item_name       | COLUMN_JSON(dynamic_cols)              |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"}           |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3 years\"} |\n+-----------------+----------------------------------------+\n\nLimitation: COLUMN_JSON will decode nested dynamic columns at a nesting level\nof not more than 10 levels deep. Dynamic columns that are nested deeper than\n10 levels will be shown as BINARY string, without encoding.\n\nURL: https://mariadb.com/kb/en/column_json/','','https://mariadb.com/kb/en/column_json/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (799,43,'COLUMN_LIST','Syntax\n------\n\nCOLUMN_LIST(dyncol_blob);\n\nDescription\n-----------\n\nReturns a comma-separated list of column names. The names are quoted with\nbackticks.\n\nSee dynamic columns for more information.\n\nURL: https://mariadb.com/kb/en/column_list/','','https://mariadb.com/kb/en/column_list/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (800,44,'WSREP_LAST_SEEN_GTID','MariaDB starting with 10.4.2\n----------------------------\nWSREP_LAST_SEEN_GTID was added as part of Galera 4 in MariaDB 10.4.2.\n\nSyntax\n------\n\nWSREP_LAST_SEEN_GTID()\n\nDescription\n-----------\n\nReturns the Global Transaction ID of the most recent write transaction\nobserved by the client.\n\nThe result can be useful to determine the transaction to provide to\nWSREP_SYNC_WAIT_UPTO_GTID for waiting and unblocking purposes.\n\nURL: https://mariadb.com/kb/en/wsrep_last_seen_gtid/','','https://mariadb.com/kb/en/wsrep_last_seen_gtid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (801,44,'WSREP_LAST_WRITTEN_GTID','MariaDB starting with 10.4.2\n----------------------------\nWSREP_LAST_WRITTEN_GTID was added as part of Galera 4 in MariaDB 10.4.2.\n\nSyntax\n------\n\nWSREP_LAST_WRITTEN_GTID()\n\nDescription\n-----------\n\nReturns the Global Transaction ID of the most recent write transaction\nperformed by the client.\n\nURL: https://mariadb.com/kb/en/wsrep_last_written_gtid/','','https://mariadb.com/kb/en/wsrep_last_written_gtid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (802,44,'WSREP_SYNC_WAIT_UPTO_GTID','MariaDB starting with 10.4.2\n----------------------------\nWSREP_SYNC_WAIT_UPTO_GTID was added as part of Galera 4 in MariaDB 10.4.2.\n\nSyntax\n------\n\nWSREP_SYNC_WAIT_UPTO_GTID(gtid[,timeout])\n\nDescription\n-----------\n\nBlocks the client until the transaction specified by the given Global\nTransaction ID is applied and committed by the node.\n\nThe optional timeout argument can be used to specify a block timeout in\nseconds. If not provided, the timeout will be indefinite.\n\nReturns the node that applied and committed the Global Transaction ID,\nER_LOCAL_WAIT_TIMEOUT if the function is timed out before this, or\nER_WRONG_ARGUMENTS if the function is given an invalid GTID.\n\nThe result from WSREP_LAST_SEEN_GTID can be useful to determine the\ntransaction to provide to WSREP_SYNC_WAIT_UPTO_GTID for waiting and unblocking\npurposes.\n\nURL: https://mariadb.com/kb/en/wsrep_sync_wait_upto_gtid/','','https://mariadb.com/kb/en/wsrep_sync_wait_upto_gtid/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (803,45,'System-Versioned Tables','MariaDB supports temporal data tables in the form of system-versioning tables\n(allowing you to query and operate on historic data, discussed below),\napplication-time periods (allow you to query and operate on a temporal range\nof data), and bitemporal tables (which combine both system-versioning and\napplication-time periods).\n\nSystem-Versioned Tables\n-----------------------\n\nSystem-versioned tables store the history of all changes, not only data which\nis currently valid. This allows data analysis for any point in time, auditing\nof changes and comparison of data from different points in time. Typical uses\ncases are:\n\n* Forensic analysis & legal requirements to store data for N years.\n* Data analytics (retrospective, trends etc.), e.g. to get your staff\ninformation as of one year ago.\n* Point-in-time recovery - recover a table state as of particular point in\ntime.\n\nSystem-versioned tables were first introduced in the SQL:2011 standard.\n\nCreating a System-Versioned Table\n---------------------------------\n\nThe CREATE TABLE syntax has been extended to permit creating a\nsystem-versioned table. To be system-versioned, according to SQL:2011, a table\nmust have two generated columns, a period, and a special table option clause:\n\nCREATE TABLE t(\n x INT,\n start_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW START,\n end_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW END,\n PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp)\n) WITH SYSTEM VERSIONING;\n\nIn MariaDB one can also use a simplified syntax:\n\nCREATE TABLE t (\n x INT\n) WITH SYSTEM VERSIONING;\n\nIn the latter case no extra columns will be created and they won\'t clutter the\noutput of, say, SELECT * FROM t. The versioning information will still be\nstored, and it can be accessed via the pseudo-columns ROW_START and ROW_END:\n\nSELECT x, ROW_START, ROW_END FROM t;\n\nAdding or Removing System Versioning To/From a Table\n----------------------------------------------------\n\nAn existing table can be altered to enable system versioning for it.\n\nCREATE TABLE t(\n x INT\n);\n\nALTER TABLE t ADD SYSTEM VERSIONING;\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `x` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING\n\nSimilarly, system versioning can be removed from a table:\n\nALTER TABLE t DROP SYSTEM VERSIONING;\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `x` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nOne can also add system versioning with all columns created explicitly:\n\nALTER TABLE t ADD COLUMN ts TIMESTAMP(6) GENERATED ALWAYS AS ROW START,\n       ADD COLUMN te TIMESTAMP(6) GENERATED ALWAYS AS ROW END,\n       ADD PERIOD FOR SYSTEM_TIME(ts, te),\n       ADD SYSTEM VERSIONING;\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `x` int(11) DEFAULT NULL,\n `ts` timestamp(6) GENERATED ALWAYS AS ROW START,\n `te` timestamp(6) GENERATED ALWAYS AS ROW END,\n PERIOD FOR SYSTEM_TIME (`ts`, `te`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING\n\nInserting Data\n--------------\n\nWhen data is inserted into a system-versioned table, it is given a row_start\nvalue of the current timestamp, and a row_end value of\nFROM_UNIXTIME(2147483647.999999). The current timestamp can be adjusted by\nsetting the timestamp system variable, for example:\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2022-10-24 23:09:38 |\n+---------------------+\n\nINSERT INTO t VALUES(1);\n\nSET @@timestamp = UNIX_TIMESTAMP(\'2033-10-24\');\n\nINSERT INTO t VALUES(2);\n\nSET @@timestamp = default;\n\nINSERT INTO t VALUES(3);\n\nSELECT a,row_start,row_end FROM t;\n+------+----------------------------+----------------------------+\n| a    | row_start                  | row_end                    |\n+------+----------------------------+----------------------------+\n|    1 | 2022-10-24 23:09:38.951347 | 2038-01-19 05:14:07.999999 |\n|    2 | 2033-10-24 00:00:00.000000 | 2038-01-19 05:14:07.999999 |\n|    3 | 2022-10-24 23:09:38.961857 | 2038-01-19 05:14:07.999999 |\n+------+----------------------------+----------------------------+\n\nQuerying Historical Data\n------------------------\n\nSELECT\n------\n\nTo query the historical data one uses the clause FOR SYSTEM_TIME directly\nafter the table name (before the table alias, if any). SQL:2011 provides three\nsyntactic extensions:\n\n* AS OF is used to see the table as it was at a specific point in time in the\npast:\n\nSELECT * FROM t FOR SYSTEM_TIME AS OF TIMESTAMP\'2016-10-09 08:07:06\';\n\n* BETWEEN start AND end will show all rows that were visible at any point\nbetween two specified points in time. It works inclusively, a row visible\nexactly at start or exactly at end will be shown too.\n\nSELECT * FROM t FOR SYSTEM_TIME BETWEEN (NOW() - INTERVAL 1 YEAR) AND NOW();\n\n* FROM start TO end will also show all rows that were visible at any point\nbetween two specified points in time, including start, but excluding end.\n\nSELECT * FROM t FOR SYSTEM_TIME FROM \'2016-01-01 00:00:00\' TO \'2017-01-01\n00:00:00\';\n\nAdditionally MariaDB implements a non-standard extension:\n\n* ALL will show all rows, historical and current.\n\nSELECT * FROM t FOR SYSTEM_TIME ALL;\n\nIf the FOR SYSTEM_TIME clause is not used, the table will show the current\ndata. This is usually the same as if one had specified FOR SYSTEM_TIME AS OF\nCURRENT_TIMESTAMP, unless one has adjusted the row_start value (until MariaDB\n10.11, only possible by setting the secure_timestamp variable). For example:\n\nCREATE OR REPLACE TABLE t (a int) WITH SYSTEM VERSIONING;\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2022-10-24 23:43:37 |\n+---------------------+\n\nINSERT INTO t VALUES (1);\n\nSET @@timestamp = UNIX_TIMESTAMP(\'2033-03-03\');\n\nINSERT INTO t VALUES (2);\n\nDELETE FROM t;\n\nSET @@timestamp = default;\n\nSELECT a, row_start, row_end FROM t FOR SYSTEM_TIME ALL;\n+------+----------------------------+----------------------------+\n| a    | row_start                  | row_end                    |\n+------+----------------------------+----------------------------+\n|    1 | 2022-10-24 23:43:37.192725 | 2033-03-03 00:00:00.000000 |\n|    2 | 2033-03-03 00:00:00.000000 | 2033-03-03 00:00:00.000000 |\n+------+----------------------------+----------------------------+\n2 rows in set (0.000 sec)\n\nSELECT a, row_start, row_end FROM t FOR SYSTEM_TIME AS OF CURRENT_TIMESTAMP;\n+------+----------------------------+----------------------------+\n| a    | row_start                  | row_end                    |\n+------+----------------------------+----------------------------+\n|    1 | 2022-10-24 23:43:37.192725 | 2033-03-03 00:00:00.000000 |\n+------+----------------------------+----------------------------+\n1 row in set (0.000 sec)\n\nSELECT a, row_start, row_end FROM t;\nEmpty set (0.001 sec)\n\nViews and Subqueries\n--------------------\n\nWhen a system-versioned tables is used in a view or in a subquery in the from\nclause, FOR SYSTEM_TIME can be used directly in the view or subquery body, or\n(non-standard) applied to the whole view when it\'s being used in a SELECT:\n\nCREATE VIEW v1 AS SELECT * FROM t FOR SYSTEM_TIME AS OF TIMESTAMP\'2016-10-09\n08:07:06\';\n\nOr\n\nCREATE VIEW v1 AS SELECT * FROM t;\nSELECT * FROM v1 FOR SYSTEM_TIME AS OF TIMESTAMP\'2016-10-09 08:07:06\';\n\nUse in Replication and Binary Logs\n----------------------------------\n\nTables that use system-versioning implicitly add the row_end column to the\nPrimary Key. While this is generally not an issue for most use cases, it can\nlead to problems when re-applying write statements from the binary log or in\nreplication environments, where a primary retries an SQL statement on the\nreplica.\n\nSpecifically, these writes include a value on the row_end column containing\nthe timestamp from when the write was initially made. The re-occurrence of the\nPrimary Key with the old system-versioning columns raises an error due to the\nduplication.\n\nTo mitigate this with MariaDB Replication, set the secure_timestamp system\nvariable to YES on the replica. When set, the replica uses its own system\nclock when applying to the row log, meaning that the primary can retry as many\ntimes as needed without causing a conflict. The retries generate new\nhistorical rows with new values for the row_start and row_end columns.\n\nTransaction-Precise History in InnoDB\n-------------------------------------\n\nA point in time when a row was inserted or deleted does not necessarily mean\nthat a change became visible at the same moment. With transactional tables, a\nrow might have been inserted in a long transaction, and became visible hours\nafter it was inserted.\n\nFor some applications — for example, when doing data analytics on one-year-old\ndata — this distinction does not matter much. For others — forensic analysis —\nit might be crucial.\n\nMariaDB supports transaction-precise history (only for the InnoDB storage\nengine) that allows seeing the data exactly as it would\'ve been seen by a new\nconnection doing a SELECT at the specified point in time — rows inserted\nbefore that point, but committed after will not be shown.\n\nTo use transaction-precise history, InnoDB needs to remember not timestamps,\nbut transaction identifier per row. This is done by creating generated columns\nas BIGINT UNSIGNED, not TIMESTAMP(6):\n\nCREATE TABLE t(\n x INT,\n start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START,\n end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END,\n PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)\n) WITH SYSTEM VERSIONING;\n\nThese columns must be specified explicitly, but they can be made INVISIBLE to\navoid cluttering SELECT * output.\n\nWhen one uses transaction-precise history, one can optionally use transaction\nidentifiers in the FOR SYSTEM_TIME clause:\n\nSELECT * FROM t FOR SYSTEM_TIME AS OF TRANSACTION 12345;\n\nThis will show the data, exactly as it was seen by the transaction with the\nidentifier 12345.\n\nStoring the History Separately\n------------------------------\n\nWhen the history is stored together with the current data, it increases the\nsize of the table, so current data queries — table scans and index searches —\nwill take more time, because they will need to skip over historical data. If\nmost queries on that table use only current data, it might make sense to store\nthe history separately, to reduce the overhead from versioning.\n\nThis is done by partitioning the table by SYSTEM_TIME. Because of the\npartition pruning optimization, all current data queries will only access one\npartition, the one that stores current data.\n\nThis example shows how to create such a partitioned table:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME (\n  PARTITION p_hist HISTORY,\n  PARTITION p_cur CURRENT\n );\n\nIn this example all history will be stored in the partition p_hist while all\ncurrent data will be in the partition p_cur. The table must have exactly one\ncurrent partition and at least one historical partition.\n\nPartitioning by SYSTEM_TIME also supports automatic partition rotation. One\ncan rotate historical partitions by time or by size. This example shows how to\nrotate partitions by size:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME LIMIT 100000 (\n  PARTITION p0 HISTORY,\n  PARTITION p1 HISTORY,\n  PARTITION pcur CURRENT\n );\n\nMariaDB will start writing history rows into partition p0, and when it reaches\na size of 100000 rows, MariaDB will switch to partition p1. There are only two\nhistorical partitions, so when p1 overflows, MariaDB will issue a warning, but\nwill continue writing into it.\n\nSimilarly, one can rotate partitions by time:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK (\n  PARTITION p0 HISTORY,\n  PARTITION p1 HISTORY,\n  PARTITION p2 HISTORY,\n  PARTITION pcur CURRENT\n );\n\nThis means that the history for the first week after the table was created\nwill be stored in p0. The history for the second week — in p1, and all later\nhistory will go into p2. One can see the exact rotation time for each\npartition in the INFORMATION_SCHEMA.PARTITIONS table.\n\nIt is possible to combine partitioning by SYSTEM_TIME and subpartitions:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME\n  SUBPARTITION BY KEY (x)\n  SUBPARTITIONS 4 (\n  PARTITION ph HISTORY,\n  PARTITION pc CURRENT\n );\n\nDefault Partitions\n------------------\n\nMariaDB starting with 10.5.0\n----------------------------\nSince partitioning by current and historical data is such a typical usecase,\nfrom MariaDB 10.5, it is possible to use a simplified statement to do so. For\nexample, instead of\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING \n PARTITION BY SYSTEM_TIME (\n  PARTITION p0 HISTORY,\n  PARTITION pn CURRENT\n);\n\nyou can use\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING \n PARTITION BY SYSTEM_TIME;\n\nYou can also specify the number of partitions, which is useful if you want to\nrotate history by time, for example:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING \n PARTITION BY SYSTEM_TIME\n  INTERVAL 1 MONTH\n  PARTITIONS 12;\n\nSpecifying the number of partitions without specifying a rotation condition\nwill result in a warning:\n\nCREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME PARTITIONS 12;\nQuery OK, 0 rows affected, 1 warning (0.518 sec)\n\nWarning (Code 4115): Maybe missing parameters: no rotation condition for\nmultiple HISTORY partitions.\n\nwhile specifying only 1 partition will result in an error:\n\nCREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME PARTITIONS 1;\nERROR 4128 (HY000): Wrong partitions for `t`: must have at least one HISTORY\nand exactly one last CURRENT\n\nAutomatically Creating Partitions\n---------------------------------\n\nMariaDB starting with 10.9.1\n----------------------------\nFrom MariaDB 10.9.1, the AUTO keyword can be used to automatically create\nhistory partitions.\n\nFor example\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n  PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;\n','','https://mariadb.com/kb/en/system-versioned-tables/');
update help_topic set description = CONCAT(description, '\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 MONTH\n STARTS \'2021-01-01 00:00:00\' AUTO PARTITIONS 12;\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME LIMIT 1000 AUTO;\n\nOr with explicit partitions:\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO\n (PARTITION p0 HISTORY, PARTITION pn CURRENT);\n\nTo disable or enable auto-creation one can use ALTER TABLE by adding or\nremoving AUTO from the partitioning specification:\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;\n\n# Disables auto-creation:\nALTER TABLE t1 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR;\n\n# Enables auto-creation:\nALTER TABLE t1 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;\n\nIf the rest of the partitioning specification is identical to CREATE TABLE, no\nrepartitioning will be done (for details see MDEV-27328).\n\nRemoving Old History\n--------------------\n\nBecause it stores all the history, a system-versioned table might grow very\nlarge over time. There are many options to trim down the space and remove the\nold history.\n\nOne can completely drop the versioning from the table and add it back again,\nthis will delete all the history:\n\nALTER TABLE t DROP SYSTEM VERSIONING;\nALTER TABLE t ADD SYSTEM VERSIONING;\n\nIt might be a rather time-consuming operation, though, as the table will need\nto be rebuilt, possibly twice (depending on the storage engine).\n\nAnother option would be to use partitioning and drop some of historical\npartitions:\n\nALTER TABLE t DROP PARTITION p0;\n\nNote, that one cannot drop a current partition or the only historical\npartition.\n\nAnd the third option; one can use a variant of the DELETE statement to prune\nthe history:\n\nDELETE HISTORY FROM t;\n\nor only old history up to a specific point in time:\n\nDELETE HISTORY FROM t BEFORE SYSTEM_TIME \'2016-10-09 08:07:06\';\n\nor to a specific transaction (with BEFORE SYSTEM_TIME TRANSACTION xxx).\n\nTo protect the integrity of the history, this statement requires a special\nDELETE HISTORY privilege.\n\nCurrently, using the DELETE HISTORY statement with a BEFORE SYSTEM_TIME\ngreater than the ROW_END of the active records (as a TIMESTAMP, this has a\nmaximum value of \'2038-01-19 03:14:07\' UTC) will result in the historical\nrecords being dropped, and the active records being deleted and moved to\nhistory. See MDEV-25468.\n\nPrior to MariaDB 10.4.5, the TRUNCATE TABLE statement drops all historical\nrecords from a system-versioned-table.\n\nFrom MariaDB 10.4.5, historic data is protected from TRUNCATE statements, as\nper the SQL standard, and an Error 4137 is instead raised:\n\nTRUNCATE t;\nERROR 4137 (HY000): System-versioned tables do not support TRUNCATE TABLE\n\nExcluding Columns From Versioning\n---------------------------------\n\nAnother MariaDB extension allows to version only a subset of columns in a\ntable. This is useful, for example, if you have a table with user information\nthat should be versioned, but one column is, let\'s say, a login counter that\nis incremented often and is not interesting to version. Such a column can be\nexcluded from versioning by declaring it WITHOUT VERSIONING\n\nCREATE TABLE t (\n x INT,\n y INT WITHOUT SYSTEM VERSIONING\n) WITH SYSTEM VERSIONING;\n\nA column can also be declared WITH VERSIONING, that will automatically make\nthe table versioned. The statement below is equivalent to the one above:\n\nCREATE TABLE t (\n x INT WITH SYSTEM VERSIONING,\n y INT\n);\n\nChanges in other sections: https://mariadb.com/kb/en/create-table/\nhttps://mariadb.com/kb/en/alter-table/ https://mariadb.com/kb/en/join-syntax/\nhttps://mariadb.com/kb/en/partitioning-types-overview/\nhttps://mariadb.com/kb/en/date-and-time-units/\nhttps://mariadb.com/kb/en/delete/ https://mariadb.com/kb/en/grant/\n\nthey all reference back to this page\n\nAlso, TODO:\n\n* limitations (size, speed, adding history to unique not nullable columns)\n\nSystem Variables\n----------------\n\nThere are a number of system variables related to system-versioned tables:\n\nsystem_versioning_alter_history\n-------------------------------\n\n* Description: SQL:2011 does not allow ALTER TABLE on system-versioned tables.\nWhen this variable is set to ERROR, an attempt to alter a system-versioned\ntable will result in an error. When this variable is set to KEEP, ALTER TABLE\nwill be allowed, but the history will become incorrect — querying historical\ndata will show the new table structure. This mode is still useful, for\nexample, when adding new columns to a table. Note that if historical data\ncontains or would contain nulls, attempting to ALTER these columns to be NOT\nNULL will return an error (or warning if strict_mode is not set).\n* Commandline: --system-versioning-alter-history=value\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Enum\n* Default Value: ERROR\n* Valid Values: ERROR, KEEP\n\nsystem_versioning_asof\n----------------------\n\n* Description: If set to a specific timestamp value, an implicit FOR\nSYSTEM_TIME AS OF clause will be applied to all queries. This is useful if one\nwants to do many queries for history at the specific point in time. Set it to\nDEFAULT to restore the default behavior. Has no effect on DML, so queries such\nas INSERT .. SELECT and REPLACE .. SELECT need to state AS OF explicitly.\n* Commandline: None\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Varchar\n* Default Value: DEFAULT\n\nsystem_versioning_innodb_algorithm_simple\n-----------------------------------------\n\n* Description: Never fully implemented and removed in the following release.\n* Commandline: --system-versioning-innodb-algorithm-simple[={0|1}]\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Boolean\n* Default Value: ON\n* Introduced: MariaDB 10.3.4\n* Removed: MariaDB 10.3.5\n\nsystem_versioning_insert_history\n--------------------------------\n\n* Description: Allows direct inserts into ROW_START and ROW_END columns if\nsecure_timestamp allows changing timestamp.\n* Commandline: --system-versioning-insert-history[={0|1}]\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Boolean\n* Default Value: OFF\n* Introduced: MariaDB 10.11.0\n\nLimitations\n-----------\n\n* Versioning clauses can not be applied to generated (virtual and persistent)\ncolumns.\n* Before MariaDB 10.11, mariadb-dump did not read historical rows from\nversioned tables, and so historical data would not be backed up. Also, a\nrestore of the timestamps would not be possible as they cannot be defined by\nan insert/a user. From MariaDB 10.11, use the -H or --dump-history options to\ninclude the history.\n\nURL: https://mariadb.com/kb/en/system-versioned-tables/') WHERE help_topic_id = 803;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (804,45,'Application-Time Periods','MariaDB starting with 10.4.3\n----------------------------\nSupport for application-time period-versioning was added in MariaDB 10.4.3.\n\nExtending system-versioned tables, MariaDB 10.4 supports application-time\nperiod tables. Time periods are defined by a range between two temporal\ncolumns. The columns must be of the same temporal data type, i.e. DATE,\nTIMESTAMP or DATETIME (TIME and YEAR are not supported), and of the same width.\n\nUsing time periods implicitly defines the two columns as NOT NULL. It also\nadds a constraint to check whether the first value is less than the second\nvalue. The constraint is invisible to SHOW CREATE TABLE statements. The name\nof this constraint is prefixed by the time period name, to avoid conflict with\nother constraints.\n\nCreating Tables with Time Periods\n---------------------------------\n\nTo create a table with a time period, use a CREATE TABLE statement with the\nPERIOD table option.\n\nCREATE TABLE t1(\n name VARCHAR(50),\n date_1 DATE,\n date_2 DATE,\n PERIOD FOR date_period(date_1, date_2));\n\nThis creates a table with a time_period period and populates the table with\nsome basic temporal values.\n\nExamples are available in the MariaDB Server source code, at\nmysql-test/suite/period/r/create.result.\n\nAdding and Removing Time Periods\n--------------------------------\n\nThe ALTER TABLE statement now supports syntax for adding and removing time\nperiods from a table. To add a period, use the ADD PERIOD clause.\n\nFor example:\n\nCREATE OR REPLACE TABLE rooms (\n room_number INT,\n guest_name VARCHAR(255),\n checkin DATE,\n checkout DATE\n );\n\nALTER TABLE rooms ADD PERIOD FOR p(checkin,checkout);\n\nTo remove a period, use the DROP PERIOD clause:\n\nALTER TABLE rooms DROP PERIOD FOR p;\n\nBoth ADD PERIOD and DROP PERIOD clauses include an option to handle whether\nthe period already exists:\n\nALTER TABLE rooms ADD PERIOD IF NOT EXISTS FOR p(checkin,checkout);\n\nALTER TABLE rooms DROP PERIOD IF EXISTS FOR p;\n\nDeletion by Portion\n-------------------\n\nYou can also remove rows that fall within certain time periods.\n\nWhen MariaDB executes a DELETE FOR PORTION statement, it removes the row:\n\n* When the row period falls completely within the delete period, it removes\nthe row.\n* When the row period overlaps the delete period, it shrinks the row, removing\nthe overlap from the first or second row period value.\n* When the delete period falls completely within the row period, it splits the\nrow into two rows.  The first row runs from the starting row period to the\nstarting delete period.  The second runs from the ending delete period to the\nending row period.\n\nTo test this, first populate the table with some data to operate on:\n\nCREATE TABLE t1(\n name VARCHAR(50),\n date_1 DATE,\n date_2 DATE,\n PERIOD FOR date_period(date_1, date_2));\n\nINSERT INTO t1 (name, date_1, date_2) VALUES\n  (\'a\', \'1999-01-01\', \'2000-01-01\'),\n  (\'b\', \'1999-01-01\', \'2018-12-12\'),\n  (\'c\', \'1999-01-01\', \'2017-01-01\'),\n  (\'d\', \'2017-01-01\', \'2019-01-01\');\n\nSELECT * FROM t1;\n+------+------------+------------+\n| name | date_1     | date_2     |\n+------+------------+------------+\n| a    | 1999-01-01 | 2000-01-01 |\n| b    | 1999-01-01 | 2018-12-12 |\n| c    | 1999-01-01 | 2017-01-01 |\n| d    | 2017-01-01 | 2019-01-01 |\n+------+------------+------------+\n\nThen, run the DELETE FOR PORTION statement:\n\nDELETE FROM t1\nFOR PORTION OF date_period\n  FROM \'2001-01-01\' TO \'2018-01-01\';\nQuery OK, 3 rows affected (0.028 sec)\n\nSELECT * FROM t1 ORDER BY name;\n+------+------------+------------+\n| name | date_1     | date_2     |\n+------+------------+------------+\n| a    | 1999-01-01 | 2000-01-01 |\n| b    | 1999-01-01 | 2001-01-01 |\n| b    | 2018-01-01 | 2018-12-12 |\n| c    | 1999-01-01 | 2001-01-01 |\n| d    | 2018-01-01 | 2019-01-01 |\n+------+------------+------------+\n\nHere:\n\n* a is unchanged, as the range falls entirely out of the specified portion to\nbe deleted.\n* b, with values ranging from 1999 to 2018, is split into two rows, 1999 to\n2000 and 2018-01 to 2018-12.\n* c, with values ranging from 1999 to 2017, where only the upper value falls\nwithin the portion to be deleted, has been shrunk to 1999 to 2001.\n* d, with values ranging from 2017 to 2019, where only the lower value falls\nwithin the portion to be deleted, has been shrunk to 2018 to 2019.\n\nThe DELETE FOR PORTION statement has the following restrictions\n\n* The FROM...TO clause must be constant\n* Multi-delete is not supported\n\nIf there are DELETE or INSERT triggers, it works as follows: any matched row\nis deleted, and then one or two rows are inserted. If the record is deleted\ncompletely, nothing is inserted.\n\nUpdating by Portion\n-------------------\n\nThe UPDATE syntax now supports UPDATE FOR PORTION, which modifies rows based\non their occurrence in a range:\n\nTo test it, first populate the table with some data:\n\nTRUNCATE t1;\n\nINSERT INTO t1 (name, date_1, date_2) VALUES\n  (\'a\', \'1999-01-01\', \'2000-01-01\'),\n  (\'b\', \'1999-01-01\', \'2018-12-12\'),\n  (\'c\', \'1999-01-01\', \'2017-01-01\'),\n  (\'d\', \'2017-01-01\', \'2019-01-01\');\n\nSELECT * FROM t1;\n+------+------------+------------+\n| name | date_1     | date_2     |\n+------+------------+------------+\n| a    | 1999-01-01 | 2000-01-01 |\n| b    | 1999-01-01 | 2018-12-12 |\n| c    | 1999-01-01 | 2017-01-01 |\n| d    | 2017-01-01 | 2019-01-01 |\n+------+------------+------------+\n\nThen run the update:\n\nUPDATE t1 FOR PORTION OF date_period\n FROM \'2000-01-01\' TO \'2018-01-01\'\nSET name = CONCAT(name,\'_original\');\n\nSELECT * FROM t1 ORDER BY name;\n+------------+------------+------------+\n| name       | date_1     | date_2     |\n+------------+------------+------------+\n| a          | 1999-01-01 | 2000-01-01 |\n| b          | 1999-01-01 | 2000-01-01 |\n| b          | 2018-01-01 | 2018-12-12 |\n| b_original | 2000-01-01 | 2018-01-01 |\n| c          | 1999-01-01 | 2000-01-01 |\n| c_original | 2000-01-01 | 2017-01-01 |\n| d          | 2018-01-01 | 2019-01-01 |\n| d_original | 2017-01-01 | 2018-01-01 |\n+------------+------------+------------+\n\n* a is unchanged, as the range falls entirely out of the specified portion to\nbe deleted.\n* b, with values ranging from 1999 to 2018, is split into two rows, 1999 to\n2000 and 2018-01 to 2018-12.\n* c, with values ranging from 1999 to 2017, where only the upper value falls\nwithin the portion to be deleted, has been shrunk to 1999 to 2001.\n* d, with values ranging from 2017 to 2019, where only the lower value falls\nwithin the portion to be deleted, has been shrunk to 2018 to 2019. \n* Original rows affected by the update have \"_original\" appended to the name.\n\nThe UPDATE FOR PORTION statement has the following limitations:\n\n* The operation cannot modify the two temporal columns used by the time period\n* The operation cannot reference period values in the SET expression\n* FROM...TO expressions must be constant\n\nWITHOUT OVERLAPS\n----------------\n\nMariaDB starting with 10.5.3\n----------------------------\nMariaDB 10.5 introduced a new clause, WITHOUT OVERLAPS, which allows one to\ncreate an index specifying that application time periods should not overlap.\n\nAn index constrained by WITHOUT OVERLAPS is required to be either a primary\nkey or a unique index.\n\nTake the following example, an application time period table for a booking\nsystem:\n\nCREATE OR REPLACE TABLE rooms (\n room_number INT,\n guest_name VARCHAR(255),\n checkin DATE,\n checkout DATE,\n PERIOD FOR p(checkin,checkout)\n );\n\nINSERT INTO rooms VALUES \n (1, \'Regina\', \'2020-10-01\', \'2020-10-03\'),\n (2, \'Cochise\', \'2020-10-02\', \'2020-10-05\'),\n (1, \'Nowell\', \'2020-10-03\', \'2020-10-07\'),\n (2, \'Eusebius\', \'2020-10-04\', \'2020-10-06\');\n\nOur system is not intended to permit overlapping bookings, so the fourth\nrecord above should not have been inserted. Using WITHOUT OVERLAPS in a unique\nindex (in this case based on a combination of room number and the application\ntime period) allows us to specify this constraint in the table definition.\n\nCREATE OR REPLACE TABLE rooms (\n room_number INT,\n guest_name VARCHAR(255),\n checkin DATE,\n checkout DATE,\n PERIOD FOR p(checkin,checkout),\n UNIQUE (room_number, p WITHOUT OVERLAPS)\n );\n\nINSERT INTO rooms VALUES \n (1, \'Regina\', \'2020-10-01\', \'2020-10-03\'),\n (2, \'Cochise\', \'2020-10-02\', \'2020-10-05\'),\n (1, \'Nowell\', \'2020-10-03\', \'2020-10-07\'),\n (2, \'Eusebius\', \'2020-10-04\', \'2020-10-06\');\nERROR 1062 (23000): Duplicate entry \'2-2020-10-06-2020-10-04\' for key\n\'room_number\'\n\nFurther Examples\n----------------\n\nThe implicit change from NULL to NOT NULL:\n\nCREATE TABLE `t2` (\n `id` int(11) DEFAULT NULL,\n `d1` datetime DEFAULT NULL,\n `d2` datetime DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\nALTER TABLE t2 ADD PERIOD FOR p(d1,d2);\n\nSHOW CREATE TABLE t2\\G\n*************************** 1. row ***************************\n   Table: t2\nCreate Table: CREATE TABLE `t2` (\n `id` int(11) DEFAULT NULL,\n `d1` datetime NOT NULL,\n `d2` datetime NOT NULL,\n PERIOD FOR `p` (`d1`, `d2`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nDue to this constraint, trying to add a time period where null data already\nexists will fail.\n\nCREATE OR REPLACE TABLE `t2` (\n `id` int(11) DEFAULT NULL,\n `d1` datetime DEFAULT NULL,\n `d2` datetime DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\nINSERT INTO t2(id) VALUES(1);\n\nALTER TABLE t2 ADD PERIOD FOR p(d1,d2);\nERROR 1265 (01000): Data truncated for column \'d1\' at row 1\n\nURL: https://mariadb.com/kb/en/application-time-periods/','','https://mariadb.com/kb/en/application-time-periods/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (805,45,'Bitemporal Tables','MariaDB starting with 10.4.3\n----------------------------\nBitemporal tables are tables that use versioning both at the system and\napplication-time period levels.\n\nUsing Bitemporal Tables\n-----------------------\n\nTo create a bitemporal table, use:\n\nCREATE TABLE test.t3 (\n date_1 DATE,\n date_2 DATE,\n row_start TIMESTAMP(6) AS ROW START INVISIBLE,\n row_end TIMESTAMP(6) AS ROW END INVISIBLE,\n PERIOD FOR application_time(date_1, date_2),\n PERIOD FOR system_time(row_start, row_end))\nWITH SYSTEM VERSIONING;\n\nNote that, while system_time here is also a time period, it cannot be used in\nDELETE FOR PORTION or UPDATE FOR PORTION statements.\n\nDELETE FROM test.t3 \nFOR PORTION OF system_time \n  FROM \'2000-01-01\' TO \'2018-01-01\';\nERROR 42000: You have an error in your SQL syntax; check the manual that\ncorresponds \n to your MariaDB server version for the right syntax to use near\n \'of system_time from \'2000-01-01\' to \'2018-01-01\'\' at line 1\n\nURL: https://mariadb.com/kb/en/bitemporal-tables/','','https://mariadb.com/kb/en/bitemporal-tables/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (806,46,'ST_AsGeoJSON','Syntax\n------\n\nST_AsGeoJSON(g[, max_decimals[, options]])\n\nDescription\n-----------\n\nReturns the given geometry g as a GeoJSON element. The optional max_decimals\nlimits the maximum number of decimals displayed.\n\nThe optional options flag can be set to 1 to add a bounding box to the output.\n\nExamples\n--------\n\nSELECT ST_AsGeoJSON(ST_GeomFromText(\'POINT(5.3 7.2)\'));\n+-------------------------------------------------+\n| ST_AsGeoJSON(ST_GeomFromText(\'POINT(5.3 7.2)\')) |\n+-------------------------------------------------+\n| {\"type\": \"Point\", \"coordinates\": [5.3, 7.2]}    |\n+-------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/geojson-st_asgeojson/','','https://mariadb.com/kb/en/geojson-st_asgeojson/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (807,46,'ST_GeomFromGeoJSON','MariaDB starting with 10.2.4\n----------------------------\nST_GeomFromGeoJSON was added in MariaDB 10.2.4\n\nSyntax\n------\n\nST_GeomFromGeoJSON(g[, option])\n\nDescription\n-----------\n\nGiven a GeoJSON input g, returns a geometry object. The option specifies what\nto do if g contains geometries with coordinate dimensions higher than 2.\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| 1                         | Return an error (the default)                  |\n+---------------------------+------------------------------------------------+\n| 2 - 4                     | The document is accepted, but the coordinates  |\n|                           | for higher coordinate dimensions are stripped  |\n|                           | off.                                           |\n+---------------------------+------------------------------------------------+\n\nNote that this function did not work correctly before MariaDB 10.2.8 - see\nMDEV-12180.\n\nExamples\n--------\n\nSET @j = \'{ \"type\": \"Point\", \"coordinates\": [5.3, 15.0]}\';\n\nSELECT ST_AsText(ST_GeomFromGeoJSON(@j));\n+-----------------------------------+\n| ST_AsText(ST_GeomFromGeoJSON(@j)) |\n+-----------------------------------+\n| POINT(5.3 15)                     |\n+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geomfromgeojson/','','https://mariadb.com/kb/en/st_geomfromgeojson/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (808,47,'Operator Precedence','The precedence is the order in which the SQL operators are evaluated.\n\nThe following list shows the SQL operator precedence. Operators that appear\nfirst in the list have a higher precedence. Operators which are listed\ntogether have the same precedence.\n\n* INTERVAL\n* BINARY, COLLATE\n* !\n* - (unary minus), [[bitwise-not|]] (unary bit inversion)\n* || (string concatenation)\n* ^\n* *, /, DIV, %, MOD\n* -, +\n* <<, >>\n* &\n* |\n* = (comparison), <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN\n* BETWEEN, CASE, WHEN, THEN, ELSE, END\n* NOT\n* &&, AND\n* XOR\n* || (logical or), OR\n* = (assignment), :=\n\nFunctions precedence is always higher than operators precedence.\n\nIn this page CASE refers to the CASE operator, not to the CASE statement.\n\nIf the HIGH_NOT_PRECEDENCE SQL_MODE is set, NOT has the same precedence as !.\n\nThe || operator\'s precedence, as well as its meaning, depends on the\nPIPES_AS_CONCAT SQL_MODE flag: if it is on, || can be used to concatenate\nstrings (like the CONCAT() function) and has a higher precedence.\n\nThe = operator\'s precedence depends on the context - it is higher when = is\nused as a comparison operator.\n\nParenthesis can be used to modify the operators precedence in an expression.\n\nShort-circuit evaluation\n------------------------\n\nThe AND, OR, && and || operators support short-circuit evaluation. This means\nthat, in some cases, the expression on the right of those operators is not\nevaluated, because its result cannot affect the result. In the following\ncases, short-circuit evaluation is used and x() is not evaluated:\n\n* FALSE AND x()\n* FALSE && x()\n* TRUE OR x()\n* TRUE || x()\n* NULL BETWEEN x() AND x()\n\nNote however that the short-circuit evaluation does not apply to NULL AND x().\nAlso, BETWEEN\'s right operands are not evaluated if the left operand is NULL,\nbut in all other cases all the operands are evaluated.\n\nThis is a speed optimization. Also, since functions can have side-effects,\nthis behavior can be used to choose whether execute them or not using a\nconcise syntax:\n\nSELECT some_function() OR log_error();\n\nURL: https://mariadb.com/kb/en/operator-precedence/','','https://mariadb.com/kb/en/operator-precedence/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (809,48,'Addition Operator (+)','Syntax\n------\n\n+\n\nDescription\n-----------\n\nAddition.\n\nIf both operands are integers, the result is calculated with BIGINT precision.\nIf either integer is unsigned, the result is also an unsigned integer.\n\nFor real or string operands, the operand with the highest precision determines\nthe result precision.\n\nExamples\n--------\n\nSELECT 3+5;\n+-----+\n| 3+5 |\n+-----+\n|   8 |\n+-----+\n\nURL: https://mariadb.com/kb/en/addition-operator/','','https://mariadb.com/kb/en/addition-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (810,48,'Division Operator (/)','Syntax\n------\n\n/\n\nDescription\n-----------\n\nDivision operator. Dividing by zero will return NULL. By default, returns four\ndigits after the decimal. This is determined by the server system variable\ndiv_precision_increment which by default is four. It can be set from 0 to 30.\n\nDividing by zero returns NULL. If the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is\nused (the default since MariaDB 10.2.4), a division by zero also produces a\nwarning.\n\nExamples\n--------\n\nSELECT 4/5;\n+--------+\n| 4/5    |\n+--------+\n| 0.8000 |\n+--------+\n\nSELECT 300/(2-2);\n+-----------+\n| 300/(2-2) |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT 300/7;\n+---------+\n| 300/7   |\n+---------+\n| 42.8571 |\n+---------+\n\nChanging div_precision_increment for the session from the default of four to\nsix:\n\nSET div_precision_increment = 6;\n\nSELECT 300/7;\n+-----------+\n| 300/7     |\n+-----------+\n| 42.857143 |\n+-----------+\n\nSELECT 300/7;\n+-----------+\n| 300/7     |\n+-----------+\n| 42.857143 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/division-operator/','','https://mariadb.com/kb/en/division-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (811,48,'Modulo Operator (%)','Syntax\n------\n\nN % M\n\nDescription\n-----------\n\nModulo operator. Returns the remainder of N divided by M. See also MOD.\n\nExamples\n--------\n\nSELECT 1042 % 50;\n+-----------+\n| 1042 % 50 |\n+-----------+\n|        42 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/modulo-operator/','','https://mariadb.com/kb/en/modulo-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (812,48,'Multiplication Operator (*)','Syntax\n------\n\n*\n\nDescription\n-----------\n\nMultiplication operator.\n\nExamples\n--------\n\nSELECT 7*6;\n+-----+\n| 7*6 |\n+-----+\n|  42 |\n+-----+\n\nSELECT 1234567890*9876543210;\n+-----------------------+\n| 1234567890*9876543210 |\n+-----------------------+\n|  -6253480962446024716 |\n+-----------------------+\n\nSELECT 18014398509481984*18014398509481984.0;\n+---------------------------------------+\n| 18014398509481984*18014398509481984.0 |\n+---------------------------------------+\n|   324518553658426726783156020576256.0 |\n+---------------------------------------+\n\nSELECT 18014398509481984*18014398509481984;\n+-------------------------------------+\n| 18014398509481984*18014398509481984 |\n+-------------------------------------+\n|                                   0 |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/multiplication-operator/','','https://mariadb.com/kb/en/multiplication-operator/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (813,48,'Subtraction Operator (-)','Syntax\n------\n\n-\n\nDescription\n-----------\n\nSubtraction. The operator is also used as the unary minus for changing sign.\n\nIf both operands are integers, the result is calculated with BIGINT precision.\nIf either integer is unsigned, the result is also an unsigned integer, unless\nthe NO_UNSIGNED_SUBTRACTION SQL_MODE is enabled, in which case the result is\nalways signed.\n\nFor real or string operands, the operand with the highest precision determines\nthe result precision.\n\nExamples\n--------\n\nSELECT 96-9;\n+------+\n| 96-9 |\n+------+\n|   87 |\n+------+\n\nSELECT 15-17;\n+-------+\n| 15-17 |\n+-------+\n|    -2 |\n+-------+\n\nSELECT 3.66 + 1.333;\n+--------------+\n| 3.66 + 1.333 |\n+--------------+\n|        4.993 |\n+--------------+\n\nUnary minus:\n\nSELECT - (3+5);\n+---------+\n| - (3+5) |\n+---------+\n|      -8 |\n+---------+\n\nURL: https://mariadb.com/kb/en/subtraction-operator-/','','https://mariadb.com/kb/en/subtraction-operator-/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (814,49,'CHANGE MASTER TO','The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nCHANGE MASTER [\'connection_name\'] TO master_def  [, master_def] ... \n [FOR CHANNEL \'channel_name\']\n\nmaster_def:\n  MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_DELAY = interval\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | MASTER_USE_GTID = {current_pos|slave_pos|no}\n | MASTER_DEMOTE_TO_SLAVE = bool\n | IGNORE_SERVER_IDS = (server_id_list)\n | DO_DOMAIN_IDS = ([N,..])\n | IGNORE_DOMAIN_IDS = ([N,..])\n\nDescription\n-----------\n\nThe CHANGE MASTER statement sets the options that a replica uses to connect to\nand replicate from a primary.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nto using the channel_name directly after CHANGE MASTER.\n\nMulti-Source Replication\n------------------------\n\nIf you are using multi-source replication, then you need to specify a\nconnection name when you execute CHANGE MASTER. There are two ways to do this:\n\n* Setting the default_master_connection system variable prior to executing\nCHANGE MASTER.\n* Setting the connection_name parameter when executing CHANGE MASTER.\n\ndefault_master_connection\n-------------------------\n\nSET default_master_connection = \'gandalf\';\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nconnection_name\n---------------\n\nSTOP SLAVE \'gandalf\';\nCHANGE MASTER \'gandalf\' TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE \'gandalf\';\n\nOptions\n-------\n\nConnection Options\n------------------\n\nMASTER_USER\n-----------\n\nThe MASTER_USER option for CHANGE MASTER defines the user account that the\nreplica will use to connect to the primary.\n\nThis user account will need the REPLICATION SLAVE privilege (or, from MariaDB\n10.5.1, the REPLICATION REPLICA on the primary.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThe maximum length of the MASTER_USER string is 96 characters until MariaDB\n10.5, and 128 characters from MariaDB 10.6.\n\nMASTER_PASSWORD\n---------------\n\nThe MASTER_USER option for CHANGE MASTER defines the password that the replica\nwill use to connect to the primary as the user account defined by the\nMASTER_USER option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThe maximum length of the MASTER_PASSWORD string is 32 characters. The\neffective maximum length of the string depends on how many bytes are used per\ncharacter and can be up to 96 characters.\n\nDue to MDEV-29994, the password can be silently truncated to 41 characters\nwhen MariaDB is restarted. For this reason it is recommended to use a password\nthat is shorter than this.\n\nMASTER_HOST\n-----------\n\nThe MASTER_HOST option for CHANGE MASTER defines the hostname or IP address of\nthe primary.\n\nIf you set the value of the MASTER_HOST option to the empty string, then that\nis not the same as not setting the option\'s value at all. If you set the value\nof the MASTER_HOST option to the empty string, then the CHANGE MASTER command\nwill fail with an error. In MariaDB 5.3 and before, if you set the value of\nthe MASTER_HOST option to the empty string, then the CHANGE MASTER command\nwould succeed, but the subsequent START SLAVE command would fail.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nIf you set the value of the MASTER_HOST option in a CHANGE MASTER command,\nthen the replica assumes that the primary is different from before, even if\nyou set the value of this option to the same value it had previously. In this\nscenario, the replica will consider the old values for the primary\'s binary\nlog file name and position to be invalid for the new primary. As a side\neffect, if you do not explicitly set the values of the MASTER_LOG_FILE and\nMASTER_LOG_POS options in the statement, then the statement will be implicitly\nappended with MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if you enable\nGTID mode for replication by setting the MASTER_USE_GTID option to some value\nother than no in the statement, then these values will effectively be ignored\nanyway.\n\nReplicas cannot connect to primaries using Unix socket files or Windows named\npipes. The replica must connect to the primary using TCP/IP.\n\nThe maximum length of the MASTER_HOST string is 60 characters until MariaDB\n10.5, and 255 characters from MariaDB 10.6.\n\nMASTER_PORT\n-----------\n\nThe MASTER_PORT option for CHANGE MASTER defines the TCP/IP port of the\nprimary.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_PORT=3307,\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nIf you set the value of the MASTER_PORT option in a CHANGE MASTER command,\nthen the replica assumes that the primary is different from before, even if\nyou set the value of this option to the same value it had previously. In this\nscenario, the replica will consider the old values for the primary\'s binary\nlog file name and position to be invalid for the new primary. As a side\neffect, if you do not explicitly set the values of the MASTER_LOG_FILE and\nMASTER_LOG_POS options in the statement, then the statement will be implicitly\nappended with MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if you enable\nGTID mode for replication by setting the MASTER_USE_GTID option to some value\nother than no in the statement, then these values will effectively be ignored\nanyway.\n\nReplicas cannot connect to primaries using Unix socket files or Windows named\npipes. The replica must connect to the primary using TCP/IP.\n\nMASTER_CONNECT_RETRY\n--------------------\n\nThe MASTER_CONNECT_RETRY option for CHANGE MASTER defines how many seconds\nthat the replica will wait between connection retries. The default is 60.\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_CONNECT_RETRY=20;\nSTART SLAVE;\n\nThe number of connection attempts is limited by the master_retry_count option.\nIt can be set either on the command-line or in a server option group in an\noption file prior to starting up the server. For example:\n\n[mariadb]\n...\nmaster_retry_count=4294967295\n\nMASTER_BIND\n-----------\n\nThe MASTER_BIND option for CHANGE MASTER is only supported by MySQL 5.6.2 and\nlater and by MySQL NDB Cluster 7.3.1 and later. This option is not supported\nby MariaDB. See MDEV-19248 for more information.\n\nThe MASTER_BIND option for CHANGE MASTER can be used on replicas that have\nmultiple network interfaces to choose which network interface the replica will\nuse to connect to the primary.\n\nMASTER_HEARTBEAT_PERIOD\n-----------------------\n\nThe MASTER_HEARTBEAT_PERIOD option for CHANGE MASTER can be used to set the\ninterval in seconds between replication heartbeats. Whenever the primary\'s\nbinary log is updated with an event, the waiting period for the next heartbeat\nis reset.\n\nThis option\'s interval argument has the following characteristics:\n\n* It is a decimal value with a range of 0 to 4294967 seconds.\n* It has a resolution of hundredths of a second.\n* Its smallest valid non-zero value is 0.001.\n* Its default value is the value of the slave_net_timeout system variable\ndivided by 2.\n* If it\'s set to 0, then heartbeats are disabled.\n\nHeartbeats are sent by the primary only if there are no unsent events in the\nbinary log file for a period longer than the interval.\n\nIf the RESET SLAVE statement is executed, then the heartbeat interval is reset\nto the default.\n\nIf the slave_net_timeout system variable is set to a value that is lower than\nthe current heartbeat interval, then a warning will be issued.\n\nTLS Options\n-----------\n\nThe TLS options are used for providing information about TLS. The options can\nbe set even on replicas that are compiled without TLS support. The TLS options\nare saved to either the default master.info file or the file that is\nconfigured by the master_info_file option, but these TLS options are ignored\nunless the replica supports TLS.\n\nSee Replication with Secure Connections for more information.\n\nMASTER_SSL\n----------\n\nThe MASTER_SSL option for CHANGE MASTER tells the replica whether to force TLS\nfor the connection. The valid values are 0 or 1.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL=1;\nSTART SLAVE;\n\nMASTER_SSL_CA\n-------------\n\nThe MASTER_SSL_CA option for CHANGE MASTER defines a path to a PEM file that\nshould contain one or more X509 certificates for trusted Certificate\nAuthorities (CAs) to use for TLS. This option requires that you use the\nabsolute path, not a relative path. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Authorities (CAs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CA string is 511 characters.\n\nMASTER_SSL_CAPATH\n-----------------\n\nThe MASTER_SSL_CAPATH option for CHANGE MASTER defines a path to a directory\nthat contains one or more PEM files that should each contain one X509\ncertificate for a trusted Certificate Authority (CA) to use for TLS. This\noption requires that you use the absolute path, not a relative path. The\ndirectory specified by this option needs to be run through the openssl rehash\ncommand. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CAPATH=\'/etc/my.cnf.d/certificates/ca/\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Authorities (CAs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CA_PATH string is 511 characters.\n\nMASTER_SSL_CERT\n---------------\n\nThe MASTER_SSL_CERT option for CHANGE MASTER defines a path to the X509\ncertificate file to use for TLS. This option requires that you use the\nabsolute path, not a relative path. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_CERT string is 511 characters.\n\nMASTER_SSL_CRL\n--------------\n\nThe MASTER_SSL_CRL option for CHANGE MASTER defines a path to a PEM file that\nshould contain one or more revoked X509 certificates to use for TLS. This\noption requires that you use the absolute path, not a relative path.\n\nThis option is only supported if the server was built with OpenSSL. If the\nserver was built with yaSSL, then this option is not supported. See TLS and\nCryptography Libraries Used by MariaDB for more information about which\nlibraries are used on which platforms.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRL=\'/etc/my.cnf.d/certificates/crl.pem\';\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Revocation Lists (CRLs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CRL string is 511 characters.\n\nMASTER_SSL_CRLPATH\n------------------\n\nThe MASTER_SSL_CRLPATH option for CHANGE MASTER defines a path to a directory\nthat contains one or more PEM files that should each contain one revoked X509\ncertificate to use for TLS. This option requires that you use the absolute\npath, not a relative path. The directory specified by this variable needs to\nbe run through the openssl rehash command.\n\nThis option is only supported if the server was built with OpenSSL. If the\nserver was built with yaSSL, then this option is not supported. See TLS and\nCryptography Libraries Used by MariaDB for more information about which\nlibraries are used on which platforms.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRLPATH=\'/etc/my.cnf.d/certificates/crl/\';\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Revocation Lists (CRLs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CRL_PATH string is 511 characters.\n\nMASTER_SSL_KEY\n--------------\n\nThe MASTER_SSL_KEY option for CHANGE MASTER defines a path to a private key\nfile to use for TLS. This option requires that you use the absolute path, not\na relative path. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;','','https://mariadb.com/kb/en/change-master-to/');
update help_topic set description = CONCAT(description, '\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_KEY string is 511 characters.\n\nMASTER_SSL_CIPHER\n-----------------\n\nThe MASTER_SSL_CIPHER option for CHANGE MASTER defines the list of permitted\nciphers or cipher suites to use for TLS. Besides cipher names, if MariaDB was\ncompiled with OpenSSL, this option could be set to \"SSLv3\" or \"TLSv1.2\" to\nallow all SSLv3 or all TLSv1.2 ciphers. Note that the TLSv1.3 ciphers cannot\nbe excluded when using OpenSSL, even by using this option. See Using TLSv1.3\nfor details. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CIPHER=\'TLSv1.2\';\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_CIPHER string is 511 characters.\n\nMASTER_SSL_VERIFY_SERVER_CERT\n-----------------------------\n\nThe MASTER_SSL_VERIFY_SERVER_CERT option for CHANGE MASTER enables server\ncertificate verification. This option is disabled by default.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Server Certificate Verification for more\ninformation.\n\nBinary Log Options\n------------------\n\nThese options are related to the binary log position on the primary.\n\nMASTER_LOG_FILE\n---------------\n\nThe MASTER_LOG_FILE option for CHANGE MASTER can be used along with\nMASTER_LOG_POS to specify the coordinates at which the replica\'s I/O thread\nshould begin reading from the primary\'s binary logs the next time the thread\nstarts.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the\nRELAY_LOG_FILE and RELAY_LOG_POS options were also specified.\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you\nenable GTID mode for replication by setting the MASTER_USE_GTID option to some\nvalue other than no in the statement.\n\nMASTER_LOG_POS\n--------------\n\nThe MASTER_LOG_POS option for CHANGE MASTER can be used along with\nMASTER_LOG_FILE to specify the coordinates at which the replica\'s I/O thread\nshould begin reading from the primary\'s binary logs the next time the thread\nstarts.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the\nRELAY_LOG_FILE and RELAY_LOG_POS options were also specified.\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you\nenable GTID mode for replication by setting the MASTER_USE_GTID option to some\nvalue other than no in the statement.\n\nRelay Log Options\n-----------------\n\nThese options are related to the relay log position on the replica.\n\nRELAY_LOG_FILE\n--------------\n\nThe RELAY_LOG_FILE option for CHANGE MASTER can be used along with the\nRELAY_LOG_POS option to specify the coordinates at which the replica\'s SQL\nthread should begin reading from the relay log the next time the thread starts.\n\nThe CHANGE MASTER statement usually deletes all relay log files. However, if\nthe RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing\nrelay log files are kept.\n\nWhen you want to change the relay log position, you only need to stop the\nreplica\'s SQL thread. The replica\'s I/O thread can continue running. The STOP\nSLAVE and START SLAVE statements support the SQL_THREAD option for this\nscenario. For example:\n\nSTOP SLAVE SQL_THREAD;\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\nSTART SLAVE SQL_THREAD;\n\nWhen the value of this option is changed, the metadata about the replica\'s SQL\nthread\'s position in the relay logs will also be changed in the relay-log.info\nfile or the file that is configured by the relay_log_info_file system variable.\n\nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the\nMASTER_LOG_FILE and MASTER_LOG_POS options were also specified.\n\nRELAY_LOG_POS\n-------------\n\nThe RELAY_LOG_POS option for CHANGE MASTER can be used along with the\nRELAY_LOG_FILE option to specify the coordinates at which the replica\'s SQL\nthread should begin reading from the relay log the next time the thread starts.\n\nThe CHANGE MASTER statement usually deletes all relay log files. However, if\nthe RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing\nrelay log files are kept.\n\nWhen you want to change the relay log position, you only need to stop the\nreplica\'s SQL thread. The replica\'s I/O thread can continue running. The STOP\nSLAVE and START SLAVE statements support the SQL_THREAD option for this\nscenario. For example:\n\nSTOP SLAVE SQL_THREAD;\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\nSTART SLAVE SQL_THREAD;\n\nWhen the value of this option is changed, the metadata about the replica\'s SQL\nthread\'s position in the relay logs will also be changed in the relay-log.info\nfile or the file that is configured by the relay_log_info_file system variable.\n\nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the\nMASTER_LOG_FILE and MASTER_LOG_POS options were also specified.\n\nGTID Options\n------------\n\nMASTER_USE_GTID\n---------------\n\nThe MASTER_USE_GTID option for CHANGE MASTER can be used to configure the\nreplica to use the global transaction ID (GTID) when connecting to a primary.\nThe possible values are:\n\n* current_pos - Replicate in GTID mode and use gtid_current_pos as the\nposition to start downloading transactions from the primary. Deprecated from\nMariaDB 10.10. Using to transition to primary can break the replication state\nif the replica executes local transactions due to actively updating\ngtid_current_pos with gtid_binlog_pos and gtid_slave_pos. Use the new, safe,\nMASTER_DEMOTE_TO_SLAVE=<bool> option instead.\n* slave_pos - Replicate in GTID mode and use gtid_slave_pos as the position to\nstart downloading transactions from the primary. From MariaDB 10.5.1,\nreplica_pos is an alias for slave_pos.\n* no - Don\'t replicate in GTID mode.\n\nMASTER_DEMOTE_TO_SLAVE\n----------------------\n\nMariaDB starting with 10.10\n---------------------------\nUsed to transition a primary to become a replica. Replaces the old\nMASTER_USE_GTID=current_pos with a safe alternative by forcing users to set\nUsing_Gtid=Slave_Pos and merging gtid_binlog_pos into gtid_slave_pos once at\nCHANGE MASTER TO time. If gtid_slave_pos is more recent than gtid_binlog_pos\n(as in the case of chain replication), the replication state should be\npreserved.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_USE_GTID = current_pos;\nSTART SLAVE;\n\nOr:\n\nSTOP SLAVE;\nSET GLOBAL gtid_slave_pos=\'0-1-153\';\nCHANGE MASTER TO\n MASTER_USE_GTID = slave_pos;\nSTART SLAVE;\n\nReplication Filter Options\n--------------------------\n\nAlso see Replication filters.\n\nIGNORE_SERVER_IDS\n-----------------\n\nThe IGNORE_SERVER_IDS option for CHANGE MASTER can be used to configure a\nreplica to ignore binary log events that originated from certain servers.\nFiltered binary log events will not get logged to the replica’s relay log, and\nthey will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\nserver_id values. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_SERVER_IDS = (3,5);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_SERVER_IDS = ();\nSTART SLAVE;\n\nDO_DOMAIN_IDS\n-------------\n\nThe DO_DOMAIN_IDS option for CHANGE MASTER can be used to configure a replica\nto only apply binary log events if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not get logged to the\nreplica’s relay log, and they will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\ngtid_domain_id values. Duplicate values are automatically ignored. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = ();\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option cannot both be set\nto non-empty values at the same time. If you want to set the DO_DOMAIN_IDS\noption, and the IGNORE_DOMAIN_IDS option was previously set, then you need to\nclear the value of the IGNORE_DOMAIN_IDS option. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (),\n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option can only be specified if the replica is replicating\nin GTID mode. Therefore, the MASTER_USE_GTID option must also be set to some\nvalue other than no in order to use this option.\n\nIGNORE_DOMAIN_IDS\n-----------------\n\nThe IGNORE_DOMAIN_IDS option for CHANGE MASTER can be used to configure a\nreplica to ignore binary log events if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not get logged to the\nreplica’s relay log, and they will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\ngtid_domain_id values. Duplicate values are automatically ignored. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = ();\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option cannot both be set\nto non-empty values at the same time. If you want to set the IGNORE_DOMAIN_IDS\noption, and the DO_DOMAIN_IDS option was previously set, then you need to\nclear the value of the DO_DOMAIN_IDS option. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = (),\n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nThe IGNORE_DOMAIN_IDS option can only be specified if the replica is\nreplicating in GTID mode. Therefore, the MASTER_USE_GTID option must also be\nset to some value other than no in order to use this option.\n\nDelayed Replication Options\n---------------------------\n\nMASTER_DELAY\n------------\n\nThe MASTER_DELAY option for CHANGE MASTER can be used to enable delayed\nreplication. This option specifies the time in seconds (at least) that a\nreplica should lag behind the primary up to a maximum value of 2147483647, or\nabout 68 years. Before executing an event, the replica will first wait, if\nnecessary, until the given time has passed since the event was created on the\nprimary. The result is that the replica will reflect the state of the primary\nsome time back in the past. The default is zero, no delay.\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_DELAY=3600;\nSTART SLAVE;\n\nChanging Option Values\n----------------------\n\nIf you don\'t specify a given option when executing the CHANGE MASTER\nstatement, then the option keeps its old value in most cases. Most of the\ntime, there is no need to specify the options that do not need to change. For\nexample, if the password for the user account that the replica uses to connect\nto its primary has changed, but no other options need to change, then you can\njust change the MASTER_PASSWORD option by executing the following commands:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThere are some cases where options are implicitly reset, such as when the\nMASTER_HOST and MASTER_PORT options are changed.\n\nOption Persistence\n------------------\n\nThe values of the MASTER_LOG_FILE and MASTER_LOG_POS options (i.e. the binary\nlog position on the primary) and most other options are written to either the\ndefault master.info file or the file that is configured by the\nmaster_info_file option. The replica\'s I/O thread keeps this binary log\nposition updated as it downloads events only when MASTER_USE_GTID option is\nset to NO. Otherwise the file is not updated on a per event basis.\n\nThe master_info_file option can be set either on the command-line or in a\nserver option group in an option file prior to starting up the server. For\nexample:\n\n[mariadb]\n...\nmaster_info_file=/mariadb/myserver1-master.info\n\nThe values of the RELAY_LOG_FILE and RELAY_LOG_POS options (i.e. the relay log\nposition) are written to either the default relay-log.info file or the file\nthat is configured by the relay_log_info_file system variable. The replica\'s\nSQL thread keeps this relay log position updated as it applies events.\n\nThe relay_log_info_file system variable can be set either on the command-line\nor in a server option group in an option file prior to starting up the server.\nFor example:\n\n[mariadb]\n...\nrelay_log_info_file=/mariadb/myserver1-relay-log.info\n\nGTID Persistence\n----------------\n\nIf the replica is replicating binary log events that contain GTIDs, then the\nreplica\'s SQL thread will write every GTID that it applies to the\nmysql.gtid_slave_pos table. This GTID can be inspected and modified through\nthe gtid_slave_pos system variable.\n\nIf the replica has the log_slave_updates system variable enabled and if the\nreplica has the binary log enabled, then every write by the replica\'s SQL\nthread will also go into the replica\'s binary log. This means that GTIDs of\nreplicated transactions would be reflected in the value of the gtid_binlog_pos\nsystem variable.\n\nCreating a Replica from a Backup\n--------------------------------\n\nThe CHANGE MASTER statement is useful for setting up a replica when you have a\nbackup of the primary and you also have the binary log position or GTID\nposition corresponding to the backup.\n\nAfter restoring the backup on the replica, you could execute something like\nthis to use the binary log position:\n\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n') WHERE help_topic_id = 814;
update help_topic set description = CONCAT(description, '\nOr you could execute something like this to use the GTID position:\n\nSET GLOBAL gtid_slave_pos=\'0-1-153\';\nCHANGE MASTER TO\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nSee Setting up a Replication Slave with Mariabackup for more information on\nhow to do this with Mariabackup.\n\nExample\n-------\n\nThe following example changes the primary and primary\'s binary log\ncoordinates. This is used when you want to set up the replica to replicate the\nprimary:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\nSTART SLAVE;\n\nURL: https://mariadb.com/kb/en/change-master-to/') WHERE help_topic_id = 814;
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (815,49,'START SLAVE','The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSTART SLAVE [\"connection_name\"] [thread_type [, thread_type] ... ] [FOR\nCHANNEL \"connection_name\"]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL                \n  MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos [FOR CHANNEL\n\"connection_name\"]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL\n  RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos [FOR CHANNEL\n\"connection_name\"]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL\n  MASTER_GTID_POS = <GTID position> [FOR CHANNEL \"connection_name\"]\nSTART ALL SLAVES [thread_type [, thread_type]]\n\nSTART REPLICA [\"connection_name\"] [thread_type [, thread_type] ... ] -- from\n10.5.1\nSTART REPLICA [\"connection_name\"] [SQL_THREAD] UNTIL                \n  MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos -- from 10.5.1\nSTART REPLICA [\"connection_name\"] [SQL_THREAD] UNTIL\n  RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos -- from 10.5.1\nSTART REPLICA [\"connection_name\"] [SQL_THREAD] UNTIL\n  MASTER_GTID_POS = <GTID position> -- from 10.5.1\nSTART ALL REPLICAS [thread_type [, thread_type]] -- from 10.5.1\n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nSTART SLAVE (START REPLICA from MariaDB 10.5.1) with no thread_type options\nstarts both of the replica threads (see replication). The I/O thread reads\nevents from the primary server and stores them in the relay log. The SQL\nthread reads events from the relay log and executes them. START SLAVE requires\nthe SUPER privilege, or, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN\nprivilege.\n\nIf START SLAVE succeeds in starting the replica threads, it returns without\nany error. However, even in that case, it might be that the replica threads\nstart and then later stop (for example, because they do not manage to connect\nto the primary or read its binary log, or some other problem). START SLAVE\ndoes not warn you about this. You must check the replica\'s error log for error\nmessages generated by the replica threads, or check that they are running\nsatisfactorily with SHOW SLAVE STATUS (SHOW REPLICA STATUS from MariaDB\n10.5.1).\n\nSTART SLAVE UNTIL\n-----------------\n\nSTART SLAVE UNTIL refers to the SQL_THREAD replica position at which the\nSQL_THREAD replication will halt. If SQL_THREAD isn\'t specified both threads\nare started.\n\nSTART SLAVE UNTIL master_gtid_pos=xxx is also supported. See Global\nTransaction ID/START SLAVE UNTIL master_gtid_pos=xxx for more details.\n\nconnection_name\n---------------\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the START SLAVE statement will apply to the\nspecified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after START SLAVE.\n\nSTART ALL SLAVES\n----------------\n\nSTART ALL SLAVES starts all configured replicas (replicas with master_host not\nempty) that were not started before. It will give a note for all started\nconnections. You can check the notes with SHOW WARNINGS.\n\nSTART REPLICA\n-------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSTART REPLICA is an alias for START SLAVE from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/start-replica/','','https://mariadb.com/kb/en/start-replica/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (816,49,'STOP SLAVE','The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSTOP SLAVE [\"connection_name\"] [thread_type [, thread_type] ... ] [FOR CHANNEL\n\"connection_name\"]\n\nSTOP ALL SLAVES [thread_type [, thread_type]]\n\nSTOP REPLICA [\"connection_name\"] [thread_type [, thread_type] ... ] -- from\n10.5.1\n\nSTOP ALL REPLICAS [thread_type [, thread_type]] -- from 10.5.1\n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nStops the replica threads. STOP SLAVE requires the SUPER privilege, or, from\nMariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege.\n\nLike START SLAVE, this statement may be used with the IO_THREAD and SQL_THREAD\noptions to name the thread or threads to be stopped. In almost all cases, one\nnever need to use the thread_type options.\n\nSTOP SLAVE waits until any current replication event group affecting one or\nmore non-transactional tables has finished executing (if there is any such\nreplication group), or until the user issues a KILL QUERY or KILL CONNECTION\nstatement.\n\nNote that STOP SLAVE doesn\'t delete the connection permanently. Next time you\nexecute START SLAVE or the MariaDB server restarts, the replica connection is\nrestored with it\'s original arguments. If you want to delete a connection, you\nshould execute RESET SLAVE.\n\nSTOP ALL SLAVES\n---------------\n\nSTOP ALL SLAVES stops all your running replicas. It will give you a note for\nevery stopped connection. You can check the notes with SHOW WARNINGS.\n\nconnection_name\n---------------\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless master, or the default master (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the STOP SLAVE statement will apply to the\nspecified master. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after STOP SLAVE.\n\nSTOP REPLICA\n------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSTOP REPLICA is an alias for STOP SLAVE from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/stop-replica/','','https://mariadb.com/kb/en/stop-replica/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (817,49,'RESET REPLICA/SLAVE','The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nRESET REPLICA [\"connection_name\"] [ALL]  [FOR CHANNEL \"connection_name\"] --\nfrom MariaDB 10.5.1         \nRESET SLAVE [\"connection_name\"] [ALL]  [FOR CHANNEL \"connection_name\"]\n\nDescription\n-----------\n\nRESET REPLICA/SLAVE makes the replica forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean start. It\ndeletes the master.info and relay-log.info files, all the relay log files, and\nstarts a new relay log file. To use RESET REPLICA/SLAVE, the replica threads\nmust be stopped (use STOP REPLICA/SLAVE if necessary).\n\nNote: All relay log files are deleted, even if they have not been completely\nexecuted by the slave SQL thread. (This is a condition likely to exist on a\nreplication slave if you have issued a STOP REPLICA/SLAVE statement or if the\nslave is highly loaded.)\n\nNote: RESET REPLICA does not reset the global gtid_slave_pos variable. This\nmeans that a replica server configured with CHANGE MASTER TO\nMASTER_USE_GTID=slave_pos will not receive events with GTIDs occurring before\nthe state saved in gtid_slave_pos. If the intent is to reprocess these events,\ngtid_slave_pos must be manually reset, e.g. by executing set global\ngtid_slave_pos=\"\".\n\nConnection information stored in the master.info file is immediately reset\nusing any values specified in the corresponding startup options. This\ninformation includes values such as master host, master port, master user, and\nmaster password. If the replica SQL thread was in the middle of replicating\ntemporary tables when it was stopped, and RESET REPLICA/SLAVE is issued, these\nreplicated temporary tables are deleted on the slave.\n\nThe ALL also resets the PORT, HOST, USER and PASSWORD parameters for the\nslave. If you are using a connection name, it will permanently delete it and\nit will not show up anymore in SHOW ALL REPLICAS/SLAVE STATUS.\n\nconnection_name\n---------------\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the RESET REPLICA/SLAVE statement will apply to\nthe specified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after RESET REPLICA.\n\nRESET REPLICA\n-------------\n\nMariaDB starting with 10.5.1\n----------------------------\nRESET REPLICA is an alias for RESET SLAVE from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/reset-replica/','','https://mariadb.com/kb/en/reset-replica/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (818,49,'RESET MASTER','RESET MASTER [TO #]\n\nDeletes all binary log files listed in the index file, resets the binary log\nindex file to be empty, and creates a new binary log file with a suffix of\n.000001.\n\nIf TO # is given, then the first new binary log file will start from number #.\n\nThis statement is for use only when the master is started for the first time,\nand should never be used if any slaves are actively replicating from the\nbinary log.\n\nURL: https://mariadb.com/kb/en/reset-master/','','https://mariadb.com/kb/en/reset-master/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (819,50,'EXECUTE Statement','Syntax\n------\n\nEXECUTE stmt_name\n  [USING expression[, expression] ...]\n\nMariaDB starting with 10.2.3\n----------------------------\nEXECUTE with expression as parameters was introduced in MariaDB 10.2.3. Before\nthat one could only use variables (@var_name) as parameters.\n\nDescription\n-----------\n\nAfter preparing a statement with PREPARE, you execute it with an EXECUTE\nstatement that refers to the prepared statement name. If the prepared\nstatement contains any parameter markers, you must supply a USING clause that\nlists user variables containing the values to be bound to the parameters.\nParameter values can be supplied only by user variables, and the USING clause\nmust name exactly as many variables as the number of parameter markers in the\nstatement.\n\nYou can execute a given prepared statement multiple times, passing different\nvariables to it or setting the variables to different values before each\nexecution.\n\nIf the specified statement has not been PREPAREd, an error similar to the\nfollowing is produced:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nEXECUTE\n\nExample\n-------\n\nSee example in PREPARE.\n\nURL: https://mariadb.com/kb/en/execute-statement/','','https://mariadb.com/kb/en/execute-statement/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (820,50,'PREPARE Statement','Syntax\n------\n\nPREPARE stmt_name FROM preparable_stmt\n\nDescription\n-----------\n\nThe PREPARE statement prepares a statement and assigns it a name, stmt_name,\nby which to refer to the statement later. Statement names are not case\nsensitive. preparable_stmt is either a string literal or a user variable (not\na local variable, an SQL expression or a subquery) that contains the text of\nthe statement. The text must represent a single SQL statement, not multiple\nstatements. Within the statement, \"?\" characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query later when\nyou execute it. The \"?\" characters should not be enclosed within quotes, even\nif you intend to bind them to string values. Parameter markers can be used\nonly where expressions should appear, not for SQL keywords, identifiers, and\nso forth.\n\nThe scope of a prepared statement is the session within which it is created.\nOther sessions cannot see it.\n\nIf a prepared statement with the given name already exists, it is deallocated\nimplicitly before the new statement is prepared. This means that if the new\nstatement contains an error and cannot be prepared, an error is returned and\nno statement with the given name exists.\n\nPrepared statements can be PREPAREd and EXECUTEd in a stored procedure, but\nnot in a stored function or trigger. Also, even if the statement is PREPAREd\nin a procedure, it will not be deallocated when the procedure execution ends.\n\nA prepared statement can access user-defined variables, but not local\nvariables or procedure\'s parameters.\n\nIf the prepared statement contains a syntax error, PREPARE will fail. As a\nside effect, stored procedures can use it to check if a statement is valid.\nFor example:\n\nCREATE PROCEDURE `test_stmt`(IN sql_text TEXT)\nBEGIN\n    DECLARE EXIT HANDLER FOR SQLEXCEPTION\n    BEGIN\n        SELECT CONCAT(sql_text, \' is not valid\');\n    END;\n    SET @SQL := sql_text;\n    PREPARE stmt FROM @SQL;\n    DEALLOCATE PREPARE stmt;\nEND;\n\nThe FOUND_ROWS() and ROW_COUNT() functions, if called immediatly after\nEXECUTE, return the number of rows read or affected by the prepared\nstatements; however, if they are called after DEALLOCATE PREPARE, they provide\ninformation about this statement. If the prepared statement produces errors or\nwarnings, GET DIAGNOSTICS return information about them. DEALLOCATE PREPARE\nshouldn\'t clear the diagnostics area, unless it produces an error.\n\nA prepared statement is executed with EXECUTE and released with DEALLOCATE\nPREPARE.\n\nThe max_prepared_stmt_count server system variable determines the number of\nallowed prepared statements that can be prepared on the server. If it is set\nto 0, prepared statements are not allowed. If the limit is reached, an error\nsimilar to the following will be produced:\n\nERROR 1461 (42000): Can\'t create more than max_prepared_stmt_count statements \n (current value: 0)\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, PREPARE stmt FROM \'SELECT :1, :2\' is used,\ninstead of ?.\n\nPermitted Statements\n--------------------\n\nMariaDB starting with 10.6.2\n----------------------------\nAll statements can be prepared, except PREPARE, EXECUTE, and DEALLOCATE / DROP\nPREPARE.\n\nPrior to this, not all statements can be prepared. Only the following SQL\ncommands are permitted:\n\n* ALTER TABLE\n* ANALYZE TABLE\n* BINLOG\n* CACHE INDEX\n* CALL\n* CHANGE MASTER\n* CHECKSUM {TABLE | TABLES}\n* COMMIT\n* {CREATE | DROP} DATABASE\n* {CREATE | DROP} INDEX\n* {CREATE | RENAME | DROP} TABLE\n* {CREATE | RENAME | DROP} USER\n* {CREATE | DROP} VIEW\n* DELETE\n* DESCRIBE\n* DO\n* EXPLAIN\n* FLUSH {TABLE | TABLES | TABLES WITH READ LOCK | HOSTS | PRIVILEGES | LOGS |\nSTATUS | \n MASTER | SLAVE | DES_KEY_FILE | USER_RESOURCES | QUERY CACHE |\nTABLE_STATISTICS | \n INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS}\n* GRANT\n* INSERT\n* INSTALL {PLUGIN | SONAME}\n* HANDLER READ\n* KILL\n* LOAD INDEX INTO CACHE\n* OPTIMIZE TABLE\n* REPAIR TABLE\n* REPLACE\n* RESET {MASTER | SLAVE | QUERY CACHE}\n* REVOKE\n* ROLLBACK\n* SELECT\n* SET\n* SET GLOBAL SQL_SLAVE_SKIP_COUNTER\n* SET ROLE\n* SET SQL_LOG_BIN\n* SET TRANSACTION ISOLATION LEVEL\n* SHOW EXPLAIN\n* SHOW {DATABASES | TABLES | OPEN TABLES | TABLE STATUS | COLUMNS | INDEX |\nTRIGGERS | \n EVENTS | GRANTS | CHARACTER SET | COLLATION | ENGINES | PLUGINS [SONAME] |\nPRIVILEGES | \n PROCESSLIST | PROFILE | PROFILES | VARIABLES | STATUS | WARNINGS | ERRORS |\n TABLE_STATISTICS | INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS |\nAUTHORS | \n CONTRIBUTORS}\n* SHOW CREATE {DATABASE | TABLE | VIEW | PROCEDURE | FUNCTION | TRIGGER |\nEVENT}\n* SHOW {FUNCTION | PROCEDURE} CODE\n* SHOW BINLOG EVENTS\n* SHOW SLAVE HOSTS\n* SHOW {MASTER | BINARY} LOGS\n* SHOW {MASTER | SLAVE | TABLES | INNODB | FUNCTION | PROCEDURE} STATUS\n* SLAVE {START | STOP}\n* TRUNCATE TABLE\n* SHUTDOWN\n* UNINSTALL {PLUGIN | SONAME}\n* UPDATE\n\nSynonyms are not listed here, but can be used. For example, DESC can be used\ninstead of DESCRIBE.\n\nCompound statements can be prepared too.\n\nNote that if a statement can be run in a stored routine, it will work even if\nit is called by a prepared statement. For example, SIGNAL can\'t be directly\nprepared. However, it is allowed in stored routines. If the x() procedure\ncontains SIGNAL, you can still prepare and execute the \'CALL x();\' prepared\nstatement.\n\nPREPARE supports most kinds of expressions as well, for example:\n\nPREPARE stmt FROM CONCAT(\'SELECT * FROM \', table_name);\n\nWhen PREPARE is used with a statement which is not supported, the following\nerror is produced:\n\nERROR 1295 (HY000): This command is not supported in the prepared statement\nprotocol yet\n\nExample\n-------\n\ncreate table t1 (a int,b char(10));\ninsert into t1 values (1,\"one\"),(2, \"two\"),(3,\"three\");\nprepare test from \"select * from t1 where a=?\";\nset @param=2;\nexecute test using @param;\n+------+------+\n| a    | b    |\n+------+------+\n|    2 | two  |\n+------+------+\nset @param=3;\nexecute test using @param;\n+------+-------+\n| a    | b     |\n+------+-------+\n|    3 | three |\n+------+-------+\ndeallocate prepare test;\n\nSince identifiers are not permitted as prepared statements parameters,\nsometimes it is necessary to dynamically compose an SQL statement. This\ntechnique is called dynamic SQL). The following example shows how to use\ndynamic SQL:\n\nCREATE PROCEDURE test.stmt_test(IN tab_name VARCHAR(64))\nBEGIN\n	SET @sql = CONCAT(\'SELECT COUNT(*) FROM \', tab_name);\n	PREPARE stmt FROM @sql;\n	EXECUTE stmt;\n	DEALLOCATE PREPARE stmt;\nEND;\n\nCALL test.stmt_test(\'mysql.user\');\n+----------+\n| COUNT(*) |\n+----------+\n|        4 |\n+----------+\n\nUse of variables in prepared statements:\n\nPREPARE stmt FROM \'SELECT @x;\';\n\nSET @x = 1;\n\nEXECUTE stmt;\n+------+\n| @x   |\n+------+\n|    1 |\n+------+\n\nSET @x = 0;\n\nEXECUTE stmt;\n+------+\n| @x   |\n+------+\n|    0 |\n+------+\n\nDEALLOCATE PREPARE stmt;\n\nURL: https://mariadb.com/kb/en/prepare-statement/','','https://mariadb.com/kb/en/prepare-statement/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (821,50,'DEALLOCATE / DROP PREPARE','Syntax\n------\n\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nDescription\n-----------\n\nTo deallocate a prepared statement produced with PREPARE, use a DEALLOCATE\nPREPARE statement that refers to the prepared statement name.\n\nA prepared statement is implicitly deallocated when a new PREPARE command is\nissued. In that case, there is no need to use DEALLOCATE.\n\nAttempting to execute a prepared statement after deallocating it results in an\nerror, as if it was not prepared at all:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nEXECUTE\n\nIf the specified statement has not been PREPAREd, an error similar to the\nfollowing will be produced:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nDEALLOCATE PREPARE\n\nExample\n-------\n\nSee example in PREPARE.\n\nURL: https://mariadb.com/kb/en/deallocate-drop-prepare/','','https://mariadb.com/kb/en/deallocate-drop-prepare/');
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (822,50,'EXECUTE IMMEDIATE','MariaDB starting with 10.2.3\n----------------------------\nEXECUTE IMMEDIATE was introduced in MariaDB 10.2.3.\n\nSyntax\n------\n\nEXECUTE IMMEDIATE statement\n\nDescription\n-----------\n\nEXECUTE IMMEDIATE executes a dynamic SQL statement created on the fly, which\ncan reduce performance overhead.\n\nFor example:\n\nEXECUTE IMMEDIATE \'SELECT 1\'\n\nwhich is shorthand for:\n\nprepare stmt from \"select 1\";\nexecute stmt;\ndeallocate prepare stmt;\n\nEXECUTE IMMEDIATE supports complex expressions as prepare source and\nparameters:\n\nEXECUTE IMMEDIATE CONCAT(\'SELECT COUNT(*) FROM \', \'t1\', \' WHERE a=?\') USING\n5+5;\n\nLimitations: subselects and stored function calls are not supported as a\nprepare source.\n\nThe following examples return an error:\n\nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN \'SELECT * FROM t1\';\nEXECUTE IMMEDIATE f1();\nERROR 1970 (42000): EXECUTE IMMEDIATE does not support subqueries or stored\nfunctions\n\nEXECUTE IMMEDIATE (SELECT \'SELECT * FROM t1\');\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat \n corresponds to your MariaDB server version for the right syntax to use near\n \'SELECT \'SELECT * FROM t1\')\' at line 1\n\nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING f1();\nERROR 1970 (42000): EXECUTE..USING does not support subqueries or stored\nfunctions\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING (SELECT 10);\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat \n corresponds to your MariaDB server version for the right syntax to use near\n \'SELECT 10)\' at line 1\n\nOne can use a user or an SP variable as a workaround:\n\nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN \'SELECT * FROM t1\';\nSET @stmt=f1();\nEXECUTE IMMEDIATE @stmt;\n\nSET @stmt=(SELECT \'SELECT 1\');\nEXECUTE IMMEDIATE @stmt;\n\nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nSET @param=f1();\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING @param;\n\nSET @param=(SELECT 10);\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING @param;\n\nEXECUTE IMMEDIATE supports user variables and SP variables as OUT parameters\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1(OUT a INT)\nBEGIN\n SET a:= 10;\nEND;\n$$\nDELIMITER ;\nSET @a=2;\nEXECUTE IMMEDIATE \'CALL p1(?)\' USING @a;\nSELECT @a;\n+------+\n| @a   |\n+------+\n|   10 |\n+------+\n\nSimilar to PREPARE, EXECUTE IMMEDIATE is allowed in stored procedures but is\nnot allowed in stored functions.\n\nThis example uses EXECUTE IMMEDIATE inside a stored procedure:\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\nBEGIN\n EXECUTE IMMEDIATE \'SELECT 1\';\nEND;\n$$\nDELIMITER ;\nCALL p1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nThis script returns an error:\n\nDELIMITER $$\nCREATE FUNCTION f1() RETURNS INT\nBEGIN\n EXECUTE IMMEDIATE \'DO 1\';\n RETURN 1;\nEND;\n$$\nERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger\n\nEXECUTE IMMEDIATE can use DEFAULT and IGNORE indicators as bind parameters:\n\nCREATE OR REPLACE TABLE t1 (a INT DEFAULT 10);\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING DEFAULT;\nSELECT * FROM t1;\n+------+\n| a    |\n+------+\n|   10 |\n+------+\n\nEXECUTE IMMEDIATE increments the Com_execute_immediate status variable, as\nwell as the Com_stmt_prepare, Com_stmt_execute and Com_stmt_close status\nvariables.\n\nNote, EXECUTE IMMEDIATE does not increment the Com_execute_sql status\nvariable. Com_execute_sql is used only for PREPARE..EXECUTE.\n\nThis session screenshot demonstrates how EXECUTE IMMEDIATE affects status\nvariables:\n\nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n\n+-----------------------+----------------+\n| VARIABLE_NAME         | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 0              |\n| COM_EXECUTE_SQL       | 0              |\n| COM_STMT_CLOSE        | 0              |\n| COM_STMT_EXECUTE      | 0              |\n| COM_STMT_PREPARE      | 0              |\n+-----------------------+----------------+\n\nEXECUTE IMMEDIATE \'SELECT 1\';\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n+-----------------------+----------------+\n| VARIABLE_NAME         | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 1              |\n| COM_EXECUTE_SQL       | 0              |\n| COM_STMT_CLOSE        | 1              |\n| COM_STMT_EXECUTE      | 1              |\n| COM_STMT_PREPARE      | 1              |\n+-----------------------+----------------+\n\nURL: https://mariadb.com/kb/en/execute-immediate/','','https://mariadb.com/kb/en/execute-immediate/');
insert into help_keyword values (1, 'work');
insert into help_keyword values (2, 'locks');
insert into help_keyword values (3, 'locking');
insert into help_keyword values (4, 'drop');
insert into help_keyword values (5, 'super');
insert into help_keyword values (6, 'usage');
insert into help_keyword values (7, 'binlog admin');
insert into help_keyword values (8, 'binlog monitor');
insert into help_keyword values (9, 'binlog replay');
insert into help_keyword values (10, 'connection admin');
insert into help_keyword values (11, 'federated admin');
insert into help_keyword values (12, 'grant option');
insert into help_keyword values (13, 'read_only admin');
insert into help_keyword values (14, 'replica monitor');
insert into help_keyword values (15, 'replication replica');
insert into help_keyword values (16, 'roles');
insert into help_keyword values (17, 'values');
insert into help_keyword values (18, 'value');
insert into help_keyword values (19, 'not');
insert into help_keyword values (20, 'and');
insert into help_keyword values (21, 'or');
insert into help_keyword values (22, ':=');
insert into help_keyword values (23, 'assignment operator');
insert into help_keyword values (24, '=');
insert into help_keyword values (25, '!=');
insert into help_keyword values (26, '<>');
insert into help_keyword values (27, 'not equal');
insert into help_keyword values (28, 'less than');
insert into help_keyword values (29, 'less than or equal');
insert into help_keyword values (30, 'NULL-safe equal');
insert into help_keyword values (31, 'equal');
insert into help_keyword values (32, 'greater than');
insert into help_keyword values (33, 'greater than or equal');
insert into help_keyword values (34, 'bitwise and');
insert into help_keyword values (35, 'shift left');
insert into help_keyword values (36, 'shift right');
insert into help_keyword values (37, 'bitwise xor');
insert into help_keyword values (38, 'bitwise or');
insert into help_keyword values (39, 'bitwise not');
insert into help_keyword values (40, 'returns');
insert into help_keyword values (41, 'udfs');
insert into help_keyword values (42, 'udf calling sequences');
insert into help_keyword values (43, 'udf security');
insert into help_keyword values (44, 'int1');
insert into help_keyword values (45, 'int2');
insert into help_keyword values (46, 'int3');
insert into help_keyword values (47, 'integer');
insert into help_keyword values (48, 'int4');
insert into help_keyword values (49, 'int8');
insert into help_keyword values (50, 'dec');
insert into help_keyword values (51, 'numeric');
insert into help_keyword values (52, 'fixed');
insert into help_keyword values (53, 'number');
insert into help_keyword values (54, 'real');
insert into help_keyword values (55, 'double precision');
insert into help_keyword values (56, 'nchar');
insert into help_keyword values (57, 'long');
insert into help_keyword values (58, 'long varchar');
insert into help_keyword values (59, 'repeat');
insert into help_keyword values (60, 'declare');
insert into help_keyword values (61, 'cursor');
insert into help_keyword values (62, 'show');
insert into help_keyword values (63, 'columns');
insert into help_keyword values (64, 'kill connection');
insert into help_keyword values (65, 'kill query');
insert into help_keyword values (66, 'delete returning');
insert into help_keyword values (67, 'sql_big_result');
insert into help_keyword values (68, 'minus');
insert into help_keyword values (69, 'cte');
insert into help_keyword values (70, 'insert returning');
insert into help_keyword values (71, 'queries');
insert into help_keyword values (72, 'query');
insert into help_keyword values (73, 'explain format');
insert into help_keyword values (74, 'explain format json');
insert into help_keyword values (75, 'rlike');
insert into help_keyword values (76, 'character_length');
insert into help_keyword values (77, 'escape');
insert into help_keyword values (78, 'mode');
insert into help_keyword values (79, 'trim_oracle');
insert into help_keyword values (80, 'schedule');
insert into help_keyword values (81, 'row_format');
insert into help_keyword values (82, 'starts');
insert into help_keyword values (83, 'host');
insert into help_keyword values (84, 'generated columns');
insert into help_keyword values (85, 'virtual columns');
insert into help_keyword values (86, 'computed columns');
insert into help_keyword values (87, 'hidden columns');
insert into help_keyword values (88, 'nextval');
insert into help_keyword values (89, 'lastval');
insert into help_keyword values (90, '+');
insert into help_keyword values (91, 'addition operator');
insert into help_keyword values (92, '/');
insert into help_keyword values (93, 'division operator');
insert into help_keyword values (94, '%');
insert into help_keyword values (95, 'modulo operator');
insert into help_keyword values (96, '*');
insert into help_keyword values (97, 'multiplication operator');
insert into help_keyword values (98, '-');
insert into help_keyword values (99, 'subtraction operator');
insert into help_keyword values (100, 'master_ssl_verify_cert');
insert into help_keyword values (101, 'start replica');
insert into help_keyword values (102, 'stop replica');
insert into help_keyword values (103, 'reset slave');
insert into help_keyword values (104, 'reset replica');
insert into help_keyword values (105, 'drop prepare');
insert into help_keyword values (106, 'deallocate prepare');
insert into help_relation values (94, 1);
insert into help_relation values (97, 2);
insert into help_relation values (97, 3);
insert into help_relation values (99, 2);
insert into help_relation values (99, 3);
insert into help_relation values (101, 2);
insert into help_relation values (101, 3);
insert into help_relation values (106, 4);
insert into help_relation values (107, 5);
insert into help_relation values (107, 6);
insert into help_relation values (107, 7);
insert into help_relation values (107, 8);
insert into help_relation values (107, 9);
insert into help_relation values (107, 10);
insert into help_relation values (107, 11);
insert into help_relation values (107, 12);
insert into help_relation values (107, 13);
insert into help_relation values (107, 14);
insert into help_relation values (107, 15);
insert into help_relation values (112, 4);
insert into help_relation values (115, 16);
insert into help_relation values (116, 2);
insert into help_relation values (116, 3);
insert into help_relation values (147, 2);
insert into help_relation values (147, 3);
insert into help_relation values (152, 2);
insert into help_relation values (152, 3);
insert into help_relation values (157, 2);
insert into help_relation values (157, 3);
insert into help_relation values (161, 2);
insert into help_relation values (161, 3);
insert into help_relation values (162, 2);
insert into help_relation values (162, 3);
insert into help_relation values (167, 17);
insert into help_relation values (167, 18);
insert into help_relation values (168, 19);
insert into help_relation values (169, 20);
insert into help_relation values (171, 21);
insert into help_relation values (212, 22);
insert into help_relation values (212, 23);
insert into help_relation values (213, 23);
insert into help_relation values (213, 24);
insert into help_relation values (214, 25);
insert into help_relation values (214, 26);
insert into help_relation values (214, 27);
insert into help_relation values (215, 28);
insert into help_relation values (216, 29);
insert into help_relation values (217, 30);
insert into help_relation values (218, 31);
insert into help_relation values (219, 32);
insert into help_relation values (220, 33);
insert into help_relation values (234, 34);
insert into help_relation values (235, 35);
insert into help_relation values (236, 36);
insert into help_relation values (238, 37);
insert into help_relation values (239, 38);
insert into help_relation values (240, 39);
insert into help_relation values (251, 40);
insert into help_relation values (252, 4);
insert into help_relation values (253, 41);
insert into help_relation values (254, 42);
insert into help_relation values (255, 43);
insert into help_relation values (257, 44);
insert into help_relation values (259, 45);
insert into help_relation values (260, 46);
insert into help_relation values (261, 47);
insert into help_relation values (261, 48);
insert into help_relation values (262, 49);
insert into help_relation values (263, 50);
insert into help_relation values (263, 51);
insert into help_relation values (263, 52);
insert into help_relation values (263, 53);
insert into help_relation values (265, 54);
insert into help_relation values (265, 55);
insert into help_relation values (271, 56);
insert into help_relation values (277, 57);
insert into help_relation values (277, 58);
insert into help_relation values (306, 59);
insert into help_relation values (313, 60);
insert into help_relation values (313, 61);
insert into help_relation values (333, 62);
insert into help_relation values (334, 62);
insert into help_relation values (335, 63);
insert into help_relation values (335, 62);
insert into help_relation values (336, 62);
insert into help_relation values (337, 62);
insert into help_relation values (340, 2);
insert into help_relation values (340, 3);
insert into help_relation values (344, 62);
insert into help_relation values (345, 62);
insert into help_relation values (346, 62);
insert into help_relation values (347, 62);
insert into help_relation values (348, 62);
insert into help_relation values (349, 62);
insert into help_relation values (356, 62);
insert into help_relation values (358, 62);
insert into help_relation values (359, 62);
insert into help_relation values (360, 62);
insert into help_relation values (361, 62);
insert into help_relation values (362, 62);
insert into help_relation values (363, 62);
insert into help_relation values (364, 62);
insert into help_relation values (365, 62);
insert into help_relation values (366, 62);
insert into help_relation values (367, 62);
insert into help_relation values (368, 62);
insert into help_relation values (369, 62);
insert into help_relation values (370, 62);
insert into help_relation values (371, 62);
insert into help_relation values (372, 62);
insert into help_relation values (373, 62);
insert into help_relation values (374, 62);
insert into help_relation values (375, 62);
insert into help_relation values (376, 62);
insert into help_relation values (377, 62);
insert into help_relation values (378, 62);
insert into help_relation values (379, 62);
insert into help_relation values (380, 62);
insert into help_relation values (381, 62);
insert into help_relation values (382, 62);
insert into help_relation values (383, 62);
insert into help_relation values (384, 62);
insert into help_relation values (385, 62);
insert into help_relation values (386, 62);
insert into help_relation values (387, 62);
insert into help_relation values (388, 62);
insert into help_relation values (389, 62);
insert into help_relation values (390, 62);
insert into help_relation values (391, 62);
insert into help_relation values (392, 62);
insert into help_relation values (393, 62);
insert into help_relation values (394, 62);
insert into help_relation values (395, 62);
insert into help_relation values (396, 62);
insert into help_relation values (397, 62);
insert into help_relation values (398, 62);
insert into help_relation values (399, 62);
insert into help_relation values (400, 62);
insert into help_relation values (405, 64);
insert into help_relation values (405, 65);
insert into help_relation values (410, 62);
insert into help_relation values (411, 62);
insert into help_relation values (412, 66);
insert into help_relation values (416, 67);
insert into help_relation values (427, 68);
insert into help_relation values (433, 69);
insert into help_relation values (434, 69);
insert into help_relation values (435, 69);
insert into help_relation values (440, 2);
insert into help_relation values (440, 3);
insert into help_relation values (455, 70);
insert into help_relation values (462, 71);
insert into help_relation values (462, 72);
insert into help_relation values (468, 73);
insert into help_relation values (468, 74);
insert into help_relation values (625, 75);
insert into help_relation values (635, 76);
insert into help_relation values (654, 77);
insert into help_relation values (660, 78);
insert into help_relation values (667, 59);
insert into help_relation values (682, 79);
insert into help_relation values (691, 4);
insert into help_relation values (693, 80);
insert into help_relation values (700, 81);
insert into help_relation values (701, 4);
insert into help_relation values (705, 82);
insert into help_relation values (711, 83);
insert into help_relation values (715, 84);
insert into help_relation values (715, 85);
insert into help_relation values (715, 86);
insert into help_relation values (716, 87);
insert into help_relation values (717, 4);
insert into help_relation values (718, 4);
insert into help_relation values (719, 4);
insert into help_relation values (720, 4);
insert into help_relation values (721, 4);
insert into help_relation values (722, 4);
insert into help_relation values (723, 4);
insert into help_relation values (724, 4);
insert into help_relation values (726, 4);
insert into help_relation values (727, 4);
insert into help_relation values (735, 4);
insert into help_relation values (736, 88);
insert into help_relation values (737, 89);
insert into help_relation values (809, 90);
insert into help_relation values (809, 91);
insert into help_relation values (810, 92);
insert into help_relation values (810, 93);
insert into help_relation values (811, 94);
insert into help_relation values (811, 95);
insert into help_relation values (812, 96);
insert into help_relation values (812, 97);
insert into help_relation values (813, 98);
insert into help_relation values (813, 99);
insert into help_relation values (814, 100);
insert into help_relation values (815, 101);
insert into help_relation values (816, 102);
insert into help_relation values (817, 103);
insert into help_relation values (817, 104);
insert into help_relation values (821, 105);
insert into help_relation values (821, 106);
unlock tables;
norwegian-ny/errmsg.sys000064400000230374150343472770011245 0ustar00��>'o��=�136=>LN.(5+$//26;N9-,>3%.'@##@6LeG%-J@&(6'*!A&$*-%0$$!5994CL3*"8a@VL%<qKA)` ,1D3 �)%!*L$ :�vAx,$"9'"e?gj./�2rB;P[/&U:"D @4*)+*+*849Y -:>E[&':f/-=V#73_ <I>�iLSq6L876FCE-JC7+7E$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E *)2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND0!7[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?+8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7+FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�"i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;IJ�hashchkisamchkNEIJAKan ikkje opprette fila '%-.200s' (Feilkode: %M)Kan ikkje opprette tabellen %`s.%`s (Feilkode: %M)Kan ikkje opprette databasen '%-.192s' (Feilkode: %M)Kan ikkje opprette databasen '%-.192s'; databasen eksistererKan ikkje fjerne (drop) '%-.192s'; databasen eksisterer ikkjeFeil ved fjerning (drop) av databasen (kan ikkje slette '%-.192s', feil %M)Feil ved sletting av database (kan ikkje slette katalogen '%-.192s', feil %M)Feil ved sletting av '%-.192s' (Feilkode: %M)Kan ikkje lese posten i systemkatalogenKan ikkje lese statusen til '%-.200s' (Feilkode: %M)Kan ikkje lese aktiv katalog(Feilkode: %M)Kan ikkje låse fila (Feilkode: %M)Kan ikkje åpne fila: '%-.200s' (Feilkode: %M)Kan ikkje finne fila: '%-.200s' (Feilkode: %M)Kan ikkje lese katalogen '%-.192s' (Feilkode: %M)Kan ikkje skifte katalog til '%-.192s' (Feilkode: %M)Posten har vorte endra sidan den sist vart lesen '%-.192s'Ikkje meir diskplass (%s). Ventar på å få frigjort plass... (Feilkode: %M)Kan ikkje skrive, flere like nyklar i tabellen '%-.192s'Feil ved lukking av '%-.192s' (Feilkode: %M)Feil ved lesing av '%-.200s' (Feilkode: %M)Feil ved omdøyping av '%-.210s' til '%-.210s' (Feilkode: %M)Feil ved skriving av fila '%-.200s' (Feilkode: %M)'%-.192s' er låst mot oppdateringarSortering avbroteView '%-.192s' eksisterar ikkje for '%-.192s'Mottok feil %M fra tabell handterar %sStorage engine %s of the table %`s.%`s doesn't have this optionKan ikkje finne posten i '%-.192s'Feil informasjon i fila: '%-.200s'Tabellen '%-.200s' har feil i nykkelfila; prøv å reparere denGammel nykkelfil for tabellen '%-.192s'; reparer den!'%-.192s' er skrivetryggjaIkkje meir minne. Start på nytt tenesten og prøv igjen (trengte %d bytar)Ikkje meir sorteringsminne. Vurder å auke sorteringsminnet (sorteringsbuffer storleik) for tenestenUventa slutt på fil (eof) ved lesing av fila '%-.192s' (Feilkode: %M)For mange tilkoplingar (connections)Tomt for tråd plass/minneKan ikkje få tak i vertsnavn for di adresseFeil handtrykk (handshake)Tilgang ikkje tillate for brukar: '%s'@'%s' til databasen '%-.192s' nektaTilgang ikke tillate for brukar: '%s'@'%s' (Brukar passord: %s)Ingen database valdUkjent kommandoKolonne '%-.192s' kan ikkje vere nullUkjent database '%-.192s'Tabellen '%-.192s' eksisterar allereideUkjent tabell '%-.100T'Kolonne: '%-.192s' i tabell %-.192s er ikkje eintydigTenar nedkopling er i gangUkjent felt '%-.192s' i tabell %-.192sBrukte '%-.192s' som ikkje var i group byKan ikkje gruppere på '%-.192s'Uttrykket har summer (sum) funksjoner og kolonner i same uttrykkKolonne telling stemmer verdi tellingIdentifikator '%-.100T' er for langFeltnamnet '%-.192s' eksisterte frå førNøkkelnamnet '%-.192s' eksisterte frå førLike verdiar '%-.192T' for nykkel %dFeil kolonne spesifikator for kolonne '%-.192s'%s attmed '%-.80T' på line %dFørespurnad var tomIkkje unikt tabell/alias: '%-.192s'Ugyldig standardverdi for '%-.192s'Fleire primærnyklar spesifisertFor mange nykler spesifisert. Maks %d nyklar tillattFor mange nykkeldelar spesifisert. Maks %d delar tillattSpesifisert nykkel var for lang. Maks nykkellengde er %dNykkel kolonne '%-.192s' eksiterar ikkje i tabellenBLOB column %`s can't be used in key specification in the %s tableFor stor nykkellengde for felt '%-.192s' (maks = %lu). Bruk BLOB istadenforBare eitt auto felt kan være definert som nøkkelCould not delete gtid domain. Reason: %s.%s (%s): Normal nedkopling%s: Oppdaga signal %d. Avsluttar!%s: Nedkopling komplett%s: Påtvinga avslutning av tråd %ld  brukar: '%-.48s'Kan ikkje opprette IP socketTabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Oprett tabellen på nyttFelt skiljer argumenta er ikkje som venta, sjå dokumentasjonenEin kan ikkje bruke faste feltlengder med BLOB. Vennlisgt bruk 'fields terminated by'Filen '%-.128s' må være i database-katalogen for å være lesbar for alleFilen '%-.200s' eksisterte allereidePoster: %ld  Fjerna: %ld  Hoppa over: %ld  Åtvaringar: %ldPoster: %ld  Like: %ldFeil delnykkel. Den brukte delnykkelen er ikkje ein streng eller den oppgitte lengda er lengre enn nykkellengdenEin kan ikkje slette alle felt med ALTER TABLE. Bruk DROP TABLE istadenforKan ikkje DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterarPostar: %ld  Like: %ld  Åtvaringar: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataUkjent tråd id: %luDu er ikkje eigar av tråd %lldIngen tabellar i brukFor mange tekststrengar felt %-.192s og SETKan ikkje lage unikt loggfilnavn %-.200s.(1-999)Tabellen '%-.192s' var låst med READ lås og kan ikkje oppdaterastTabellen '%-.192s' var ikkje låst med LOCK TABLESYou should never see itUgyldig database namn '%-.100T'Ugyldig tabell namn '%-.100s'SELECT ville undersøkje for mange postar og ville sannsynligvis ta veldig lang tid. Undersøk WHERE klausulen og bruk SET SQL_BIG_SELECTS=1 om SELECTen er korrektUkjend feilUkjend prosedyre %-.192sFeil parameter tal til prosedyra %-.192sFeil parameter til prosedyra %-.192sUkjend tabell '%-.192s' i %-.32sFeltet '%-.192s' er spesifisert to gangarInvalid use of group functionTable '%-.192s' uses a extension that doesn't exist in this MariaDB versionA table must have at least 1 columnThe table '%-.192s' is fullUnknown character set: '%-.64s'Too many tables; MariaDB can only use %d tables in a joinToo many columnsRow size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBsThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededCross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerCan't load function '%-.192s'Can't initialize function '%-.192s'; %-.80sNo paths allowed for shared libraryFunction '%-.192s' already existsCan't open shared library '%-.192s' (errno: %d, %-.128s)Can't find symbol '%-.128s' in libraryFunction '%-.192s' is not definedHost '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'Host '%-.64s' is not allowed to connect to this MariaDB serverYou are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settingsYou must have privileges to update tables in the mysql database to be able to change passwords for othersCan't find any matching row in the user tableRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory you can consult the manual for any possible OS dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192sInvalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionSomething is wrong in your syntaxDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sAll tables in the MERGE table are not defined identicallyCan't write, because of unique constraint, to table '%-.192s'BLOB column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetMottok feil %d '%-.200s' fra %sMottok temporary feil %d '%-.200s' fra %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for '%.256s'XAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionLike verdiar '%-.64T' for nykkel '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTTilgang ikke tillate for brukar: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionLike verdiar for nykkel '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledukrainian/errmsg.sys000064400000254704150343472770010614 0ustar00��Po��=�GKTaft}>MKLCHDIHo�\<IUGB(8S[,9ta<��D!S0pu* C1+*T5;0}a>2.=C(DOLgrmN�i�D1>$X.�Z��%a/��KL�>)+C_�I70 .P=49H|L,7�"��Z>Ls+sL1�e��j[�uA:7�mh��@1�e5sRyE^1GS[]Y[GGL�0]Gt��YNW�?.=`8:<<�^a3IEn�7r�������ov[N�r��(r��fX�E$')>AA$BAJI/9-,"1LF$3.B@6+:9>,<Ag.3oa-LN.*'A/CG-T���G�=!�2oRDRU5,y.E))2%D,5'<%'�� =!"!$40F-"PESb�sSCC/:Qn���<2;/!-S0\R>"6%!2*+!L2-+D#2&Y��~7[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�Ec�!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?C8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7K�LH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EEU6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�:i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 |`-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1)O'-4EIP�9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkНІТАКНе можу створити файл '%-.200s' (помилка: %M)Не можу створити таблицю %`s.%`s (помилка: %M)Не можу створити базу данних '%-.192s' (помилка: %M)Не можу створити базу данних '%-.192s'. База данних існуєНе можу видалити базу данних '%-.192s'. База данних не існуєНе можу видалити базу данних (Не можу видалити '%-.192s', помилка: %M)Не можу видалити базу данних (Не можу видалити теку '%-.192s', помилка: %M)Не можу видалити '%-.192s' (помилка: %M)Не можу зчитати запис з системної таблиціНе можу отримати статус '%-.200s' (помилка: %M)Не можу визначити робочу теку (помилка: %M)Не можу заблокувати файл (помилка: %M)Не можу відкрити файл: '%-.200s' (помилка: %M)Не можу знайти файл: '%-.200s' (помилка: %M)Не можу прочитати теку '%-.192s' (помилка: %M)Не можу перейти у теку '%-.192s' (помилка: %M)Запис було змінено з часу останнього читання з таблиці '%-.192s'Диск заповнений (%s). Вичикую, доки звільниться трохи місця... (помилка: %M)Не можу записати, дублюючийся ключ в таблиці '%-.192s'Не можу закрити '%-.192s' (помилка: %M)Не можу прочитати файл '%-.200s' (помилка: %M)Не можу перейменувати '%-.210s' у '%-.210s' (помилка: %M)Не можу записати файл '%-.200s' (помилка: %M)'%-.192s' заблокований на внесення змінСортування перерваноВигляд '%-.192s' не існує для '%-.192s'Отримано помилку %M від дескриптора таблиці %sДескриптор %s таблиці %`s.%`s не має цієї властивостіНе можу записати у '%-.192s'Хибна інформація у файлі: '%-.200s'Хибний файл ключей для таблиці: '%-.200s'; Спробуйте його відновитиСтарий файл ключей для таблиці '%-.192s'; Відновіть його!Таблиця '%-.192s' тільки для читанняБрак пам'яті. Рестартуйте сервер та спробуйте знову (потрібно %d байтів)Брак пам'яті для сортування. Треба збільшити розмір буфера сортування у сервераХибний кінець файлу '%-.192s' (помилка: %M)Забагато з'єднаньБрак пам'яті.Не можу визначити ім'я хосту для вашої адресиНевірна установка зв'язкуДоступ заборонено для користувача: '%s'@'%s' до бази данних '%-.192s'Доступ заборонено для користувача: '%s'@'%s' (Використано пароль: %s)Базу данних не вибраноНевідома командаСтовбець '%-.192s' не може бути нульовимНевідома база данних '%-.192s'Таблиця '%-.192s' вже існуєНевідома таблиця '%-.100T'Стовбець '%-.192s' у %-.192s визначений неоднозначноЗавершується работа сервераНевідомий стовбець '%-.192s' у '%-.192s''%-.192s' не є у GROUP BYНе можу групувати по '%-.192s'У виразі використано підсумовуючі функції поряд з іменами стовбцівКількість стовбців не співпадає з кількістю значеньІм'я ідентифікатора '%-.100T' задовгеДублююче ім'я стовбця '%-.192s'Дублююче ім'я ключа '%-.192s'Дублюючий запис '%-.192T' для ключа %dНевірний специфікатор стовбця '%-.192s'%s біля '%-.80T' в строці %dПустий запитНеунікальна таблиця/псевдонім: '%-.192s'Невірне значення по замовчуванню для '%-.192s'Первинного ключа визначено неодноразовоЗабагато ключів зазначено. Дозволено не більше %d ключівЗабагато частин ключа зазначено. Дозволено не більше %d частинЗазначений ключ задовгий. Найбільша довжина ключа %d байтівКлючовий стовбець '%-.192s' не існує у таблиціBLOB стовбець %`s не може бути використаний у визначенні ключа в %s таблиціЗадовга довжина стовбця '%-.192s' (max = %lu). Використайте тип BLOBХибне визначення таблиці; Може бути лише один автоматичний стовбець, що повинен бути визначений як ключНе можу видалити домен gtid. Причина: %s.%s (%s): Нормальне завершення%s: Отримано сигнал %d. Перериваюсь!%s: Роботу завершено%s: Прискорюю закриття гілки %ld користувача: '%-.48s'Не можу створити IP роз'ємТаблиця '%-.192s' має індекс, що не співпадає з вказанним у CREATE INDEX. Створіть таблицю зновуХибний розділювач полів. Почитайте документаціюНе можна використовувати сталу довжину строки з BLOB. Зкористайтеся 'fields terminated by'Файл '%-.128s' повинен бути у теці бази данних або мати встановлене право на читання для усіхФайл '%-.200s' вже існуєЗаписів: %ld  Видалено: %ld  Пропущено: %ld  Застережень: %ldЗаписів: %ld  Дублікатів: %ldНевірна частина ключа. Використана частина ключа не є строкою, задовга або вказівник таблиці не підтримує унікальних частин ключейНе можливо видалити всі стовбці за допомогою ALTER TABLE. Для цього скористайтеся DROP TABLEНе можу DROP %s %`-.192s. Перевірте, чи він існуєЗаписів: %ld  Дублікатів: %ld  Застережень: %ldТаблиця '%-.192s' вказується двічі, як цільова для '%s', так і як окреме джерело данихНевідомий ідентифікатор гілки: %luВи не володар гілки %lldНе використано таблицьЗабагато строк для стовбця %-.192s та SETНе можу згенерувати унікальне ім'я log-файлу %-.200s.(1-999)Таблицю '%-.192s' заблоковано тільки для читання, тому її не можна оновитиТаблицю '%-.192s' не було блоковано з LOCK TABLESYou should never see itНевірне ім'я бази данних '%-.100T'Невірне ім'я таблиці '%-.100s'Запиту SELECT потрібно обробити багато записів, що, певне, займе дуже багато часу. Перевірте ваше WHERE та використовуйте SET SQL_BIG_SELECTS=1, якщо цей запит SELECT є вірнимНевідома помилкаНевідома процедура '%-.192s'Хибна кількість параметрів процедури '%-.192s'Хибний параметер процедури '%-.192s'Невідома таблиця '%-.192s' у %-.32sСтовбець '%-.192s' зазначено двічіХибне використання функції групуванняТаблиця '%-.192s' використовує розширення, що не існує у цій версії MariaDBТаблиця повинна мати хочаб один стовбецьТаблиця '%-.192s' заповненаНевідома кодова таблиця: '%-.64s'Забагато таблиць. MariaDB може використовувати лише %d таблиць у об'єднанніЗабагато стовбцівЗадовга строка. Найбільшою довжиною строки, не рахуючи BLOB, є %ld. Вам потрібно привести деякі стовбці до типу BLOBСтек гілок переповнено:  Використано: %ld з %ld. Використовуйте 'mariadbd --thread_stack=#' аби зазначити більший стек, якщо необхідноПерехресна залежність у OUTER JOIN. Перевірте умову ONВказівник таблиці не підтримує NULL у зазначенному індексі. Будь ласка, зменіть стовпчик '%-.192s' на NOT NULL або використайте інший вказівник таблиці.Не можу завантажити функцію '%-.192s'Не можу ініціалізувати функцію '%-.192s'; %-.80sНе дозволено використовувати путі для розділюваних бібліотекФункція '%-.192s' вже існуєНе можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d, %-.128s)Не можу знайти функцію '%-.128s' у бібліотеціФункцію '%-.192s' не визначеноХост '%-.64s' заблоковано з причини великої кількості помилок з'єднання. Для розблокування використовуйте 'mariadb-admin flush-hosts'Хосту '%-.64s' не доволено зв'язуватись з цим сервером MariaDBВи використовуєте MariaDB як анонімний користувач, тому вам не дозволено змінювати пароліВи повині мати право на оновлення таблиць у базі данних mysql, аби мати можливість змінювати пароль іншимНе можу знайти відповідних записів у таблиці користувачаЗаписів відповідає: %ld  Змінено: %ld  Застережень: %ldНе можу створити нову гілку (помилка %M). Якщо ви не використали усю пам'ять, то прочитайте документацію до вашої ОС - можливо це помилка ОСКількість стовбців не співпадає з кількістю значень у строці %luНе можу перевідкрити таблицю: '%-.192s'Хибне використання значення NULLПомилка регулярного виразу: %sЗмішування GROUP стовбців (MIN(),MAX(),COUNT()...) з не GROUP стовбцями є забороненим, якщо не має GROUP BYПовноважень не визначено для користувача '%-.48s' з хосту '%-.64s'%-.100T команда заборонена користувачу: '%s'@'%s' у таблиці %`s.%`s%-.32s команда заборонена користувачу: '%s'@'%s' для стовбця '%-.192s' у таблиці '%-.192s'Хибна GRANT/REVOKE команда; прочитайте документацію стосовно того, які права можна використовуватиАргумент host або user для GRANT задовгийТаблиця '%-.192s.%-.192s' не існуєПовноважень не визначено для користувача '%-.48s' з хосту '%-.64s' для таблиці '%-.192s'Використовувана команда не дозволена у цій версії MariaDBУ вас помилка у синтаксисі SQLГілка для INSERT DELAYED не може отримати блокування для таблиці %-.192sЗабагато затриманих гілок використовуєтьсяПерервано з'єднання %ld до бази данних: '%-.192s' користувача: '%-.48s' (%-.64s)Отримано пакет більший ніж max_allowed_packetОтримано помилку читання з комунікаційного каналуОтримано помилкку від fcntl()Отримано пакети у неналежному порядкуНе можу декомпресувати комунікаційний пакетОтримано помилку читання комунікаційних пакетівОтримано затримку читання комунікаційних пакетівОтримано помилку запису комунікаційних пакетівОтримано затримку запису комунікаційних пакетівСтрока результату довша ніж max_allowed_packet%s таблиці не підтримують BLOB/TEXT стовбці%s таблиці не підтримують AUTO_INCREMENT стовбціINSERT DELAYED не може бути використано з таблицею '%-.192s', тому що її заблоковано з LOCK TABLESНевірне ім'я стовбця '%-.100s'Вказівник таблиц %s не може індексувати стовбець %`sТаблиці у MERGE TABLE мають різну структуруНе можу записати до таблиці '%-.192s', з причини вимог унікальностіСтовбець BLOB '%-.192s' використано у визначенні ключа без вказання довжини ключаУсі частини PRIMARY KEY повинні бути NOT NULL; Якщо ви потребуєте NULL у ключі, скористайтеся UNIQUEРезультат знаходиться у більше ніж одній строціЦей тип таблиці потребує первинного ключаЦя версія MariaDB не зкомпільована з підтримкою RAIDВи у режимі безпечного оновлення та намагаєтесь оновити таблицю без оператора WHERE, що використовує KEY стовбецьКлюч '%-.192s' не існує в таблиці '%-.192s'Не можу відкрити таблицюВказівник таблиці не підтримуе %sВам не дозволено виконувати цю команду в транзакціїОтримано помилку %M під час COMMITОтримано помилку %M під час ROLLBACKОтримано помилку %M під час FLUSH_LOGSОтримано помилку %M під час CHECKPOINTПерервано з'єднання %lld до бази данних: '%-.192s' користувач: '%-.48s' хост: '%-.64s'%-.64s (%-.64s)You should never see itРеплікаційний лог закрито, не можу виконати RESET MASTERНевдале відновлення індекса переданої таблиці '%-.192s'Помилка від головного: '%-.64s'Мережева помилка читання від головногоМережева помилка запису до головногоНе можу знайти FULLTEXT індекс, що відповідає переліку стовбцівНе можу виконати подану команду тому, що таблиця заблокована або виконується транзакціяНевідома системна змінна '%-.*s'Таблицю '%-.192s' марковано як зіпсовану та її потрібно відновитиТаблицю '%-.192s' марковано як зіпсовану та останнє (автоматичне?) відновлення не вдалосяЗастереження: Деякі нетранзакційні зміни таблиць не можна буде повернутиТранзакція з багатьма виразами вимагає більше ніж 'max_binlog_cache_size' байтів для зберігання. Збільште цю змінну mariadbd та спробуйте зновуОперація не може бути виконана з запущеним підлеглим '%2$*1$s', спочатку виконайте STOP SLAVE '%2$*1$s'Операція вимагає запущеного підлеглого, зконфігуруйте підлеглого та виконайте START SLAVEСервер не зконфігуровано як підлеглий, виправте це у файлі конфігурації або з CHANGE MASTER TOІнформаційна структура з'єднання головного і підлеглого (master.info) для '%.*s' не може бути ініціалізованаНе можу створити підлеглу гілку, перевірте системні ресурсиКористувач %-.64s вже має більше ніж 'max_user_connections' активних з'єднаньМожна використовувати лише вирази зі сталими у SETЗатримку очікування блокування вичерпаноЗагальна кількість блокувань перевищила розмір блокувань для таблиціОновити блокування не можливо на протязі транзакції READ UNCOMMITTEDDROP DATABASE не дозволено доки гілка перебуває під загальним блокуванням читанняCREATE DATABASE не дозволено доки гілка перебуває під загальним блокуванням читанняХибний аргумент для %sКористувачу '%s'@'%s' не дозволено створювати нових користувачівХибне визначення таблиці; всі MERGE-таблиці повинні належити до однієї бази ланних.Взаємне блокування знайдено під час спроби отримати блокування; спробуйте перезапустити транзакцію.Використаний тип таблиці (%s) не підтримує FULLTEXT індексівНе можу додати обмеження зовнішнього ключа Ha `%s`Не вдається додати або оновити дочірній рядок: невдала перевірка обмеження зовнішнього ключаCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sWrong usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied. You need the %-.128s privilege for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchОперанд має складатися з %d стовбцівПідзапит повертає більш нiж 1 записUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existЦиклічне посилання на підзапитПеретворення стовбца '%s' з %s у %sПосилання '%-.64s' не пiдтримуется (%s)Every derived table must have its own aliasSelect %u was скасовано при оптимiзацiiTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatСтовбець або посилання '%-.192s%s%-.192s%s%-.192s' із SELECTу #%d було знайдене у SELECTі #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Кеш запитів неспроможен встановити розмір %llu, новий розмір кеша запитів - %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadТаблиця %-.100s у %s не може оновлюватисьThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementЗанадто великий конфігураційний файл '%-.192s'Невірний заголовок типу у файлі '%-.192s'Несподіванний кінець файлу у коментарі '%-.200s'Помилка в роспізнаванні параметру '%-.192s' (рядок: '%-.192s')Несподіванний кінець файлу у спробі проминути невідомий параметр '%-.192s'ANALYZE/EXPLAIN/SHOW не може бути виконано; немає прав на таблиці запитуФайл '%-.192s' має невідомий тип '%-.64s' у заголовку'%-.192s.%-.192s' не є %sСтовбець '%-.192s' не може бути зминенийView SELECT має підзапит у конструкції FROMView SELECT має конструкцію '%s'View SELECT має зминну або параметерView SELECT використовує тимчасову таблицю '%-.192s'View SELECT і перелік стовбців view мають різну кількість сковбцівАлгоритм зливання view не може бути використаний зараз (алгоритм буде невизначений)View, що оновлюеться, не містить повного ключа таблиці(ь), що викорістана в ньюомуView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION для VIEW %`-.192s.%`-.192s що не може бути оновленнимПеревірка CHECK OPTION для VIEW %`-.192s.%`-.192s не пройшла%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0Перевірка контрольної суми тексту VIEW не пройшлаНеможливо оновити більш ниж одну базову таблицю выкористовуючи VIEW '%-.192s.%-.192s', що містіть декілька таблицьНеможливо уставити рядки у VIEW '%-.192s.%-.192s', що містить декілька таблиць, без списку стовбцівНеможливо видалити рядки у VIEW '%-.192s.%-.192s', що містить декілька таблицьOperation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sНевдала спроба завантажити процедуру %-.192s (внутрішний код %d). Для отримання детальної інформації використовуйте SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionДублюючий запис '%-.64T' для ключа '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTДоступ заборонено для користувача: '%s'@'%s'SET PASSWORD не можна застосувати для користувачів, що автентифікуються з допомогою плагінy %sGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadВаш пароль не відповідає поточним правилам (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionДублюючий запис для ключа '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldНезалежна від типу таблиці статистика не збирається для стовбця '%s'Агрегатна функція '%-.192s)' з SELECTу #%d належить до SELECTу #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0Перевірка CONSTRAINT %`s для %`-.192s.%`-.192s не пройшлаExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sПрипустимо мати тільки один DEFAULT розділReferenced trigger '%s' for the given action time and event type does not existЗначення за замовчуванням або ігнороване значення не підтримано для цього випадку використання параьетраOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledfrench/errmsg.sys000064400000233104150343472770010067 0ustar00���,o��=�2.-55.9,458-347<LOA159634,@01@<#R-</=@%-!)%$E'3'&-4$"+$:@/-C8>*"#C(^9dS#L$aM:9`52;E7+!�8-%%(O.%Dy�Kx+73$NB)�Mv�IC�2+) �PUn6C(g:W"M1.!,%&()>=Bg#-KGc�/<Bi6(Kd#F#,-Qd#EL~�o\r�KW<"ER^`Ae^B=QU$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%wD_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?38|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7-FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�*i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I�hashchkisamchkNONOUINe peut créer le fichier '%-.200s' (Errcode: %M)Ne peut créer la table %`s.%`s (Errcode: %M)Ne peut créer la base '%-.192s' (Erreur %M)Ne peut créer la base '%-.192s'; elle existe déjàNe peut effacer la base '%-.192s'; elle n'existe pasNe peut effacer la base '%-.192s' (erreur %M)Erreur en effaçant la base (rmdir '%-.192s', erreur %M)Erreur en effaçant '%-.192s' (Errcode: %M)Ne peut lire un enregistrement de la table 'system'Ne peut obtenir le status de '%-.200s' (Errcode: %M)Ne peut obtenir le répertoire de travail (Errcode: %M)Ne peut verrouiller le fichier (Errcode: %M)Ne peut ouvrir le fichier: '%-.200s' (Errcode: %M)Ne peut trouver le fichier: '%-.200s' (Errcode: %M)Ne peut lire le répertoire de '%-.192s' (Errcode: %M)Ne peut changer le répertoire pour '%-.192s' (Errcode: %M)Enregistrement modifié depuis sa dernière lecture dans la table '%-.192s'Disque plein (%s). J'attend que quelqu'un libère de l'espace... (Errcode: %M)Ecriture impossible, doublon dans une clé de la table '%-.192s'Erreur a la fermeture de '%-.192s' (Errcode: %M)Erreur en lecture du fichier '%-.200s' (Errcode: %M)Erreur en renommant '%-.210s' en '%-.210s' (Errcode: %M)Erreur d'écriture du fichier '%-.200s' (Errcode: %M)'%-.192s' est verrouillé contre les modificationsTri alphabétique abandonnéLa vue (View) '%-.192s' n'existe pas pour '%-.192s'Reçu l'erreur %M du handler de la table %sStorage engine %s of the table %`s.%`s doesn't have this optionNe peut trouver l'enregistrement dans '%-.192s'Information erronnée dans le fichier: '%-.200s'Index corrompu dans la table: '%-.200s'; essayez de le réparerVieux fichier d'index pour la table '%-.192s'; réparez le!'%-.192s' est en lecture seulementManque de mémoire. Redémarrez le démon et ré-essayez (%d octets nécessaires)Manque de mémoire pour le tri. Augmentez-laFin de fichier inattendue en lisant '%-.192s' (Errcode: %M)Trop de connexionsManque de 'threads'/mémoireNe peut obtenir de hostname pour votre adresseMauvais 'handshake'Accès refusé pour l'utilisateur: '%s'@'%s'. Base '%-.192s'Accès refusé pour l'utilisateur: '%s'@'%s' (mot de passe: %s)Aucune base n'a été sélectionnéeCommande inconnueLe champ '%-.192s' ne peut être vide (null)Base '%-.192s' inconnueLa table '%-.192s' existe déjàTable '%-.100T' inconnueChamp: '%-.192s' dans %-.192s est ambiguArrêt du serveur en coursChamp '%-.192s' inconnu dans %-.192s'%-.192s' n'est pas dans 'group by'Ne peut regrouper '%-.192s'Vous demandez la fonction sum() et des champs dans la même commandeColumn count doesn't match value countLe nom de l'identificateur '%-.100T' est trop longNom du champ '%-.192s' déjà utiliséNom de clef '%-.192s' déjà utiliséDuplicata du champ '%-.192T' pour la clef %dMauvais paramètre de champ pour le champ '%-.192s'%s près de '%-.80T' à la ligne %dQuery est videTable/alias: '%-.192s' non uniqueValeur par défaut invalide pour '%-.192s'Plusieurs clefs primaires définiesTrop de clefs sont définies. Maximum de %d clefs allouéTrop de parties specifiées dans la clef. Maximum de %d partiesLa clé est trop longue. Longueur maximale: %dLa clé '%-.192s' n'existe pas dans la tableBLOB column %`s can't be used in key specification in the %s tableChamp '%-.192s' trop long (max = %lu). Utilisez un BLOBUn seul champ automatique est permis et il doit être indexéCould not delete gtid domain. Reason: %s.%s (%s): Arrêt normal du serveur%s: Reçu le signal %d. Abandonne!%s: Arrêt du serveur terminé%s: Arrêt forcé de la tâche (thread) %ld  utilisateur: '%-.48s'Ne peut créer la connexion IP (socket)La table '%-.192s' n'a pas d'index comme celle utilisée dans CREATE INDEX. Recréez la tableSéparateur de champs inconnu.  Vérifiez dans le manuelVous ne pouvez utiliser des lignes de longueur fixe avec des BLOBs. Utiliser 'fields terminated by'Le fichier '%-.128s' doit être dans le répertoire de la base et lisible par tousLe fichier '%-.200s' existe déjàEnregistrements: %ld  Effacés: %ld  Non traités: %ld  Avertissements: %ldEnregistrements: %ld  Doublons: %ldMauvaise sous-clef. Ce n'est pas un 'string' ou la longueur dépasse celle définie dans la clefVous ne pouvez effacer tous les champs avec ALTER TABLE. Utilisez DROP TABLENe peut effacer (DROP %s) %`-.192s. Vérifiez s'il existeEnregistrements: %ld  Doublons: %ld  Avertissements: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataNuméro de tâche inconnu: %luVous n'êtes pas propriétaire de la tâche no: %lldAucune table utiliséeTrop de chaînes dans la colonne %-.192s avec SETNe peut générer un unique nom de journal %-.200s.(1-999)Table '%-.192s' verrouillée lecture (READ): modification impossibleTable '%-.192s' non verrouillée: utilisez LOCK TABLESYou should never see itNom de base de donnée illégal: '%-.100T'Nom de table illégal: '%-.100s'SELECT va devoir examiner beaucoup d'enregistrements ce qui va prendre du temps. Vérifiez la clause WHERE et utilisez SET SQL_BIG_SELECTS=1 si SELECT se passe bienErreur inconnueProcédure %-.192s inconnueMauvais nombre de paramètres pour la procedure %-.192sParamètre erroné pour la procedure %-.192sTable inconnue '%-.192s' dans %-.32sChamp '%-.192s' spécifié deux foisUtilisation invalide de la clause GROUPTable '%-.192s' : utilise une extension invalide pour cette version de MariaDBUne table doit comporter au moins une colonneLa table '%-.192s' est pleineJeu de caractères inconnu: '%-.64s'Trop de tables. MariaDB ne peut utiliser que %d tables dans un JOINTrop de champsLigne trop grande. Le taille maximale d'une ligne, sauf les BLOBs, est %ld. Changez le type de quelques colonnes en BLOBDébordement de la pile des tâches (Thread stack). Utilisées: %ld pour une pile de %ld.  Essayez 'mariadbd --thread_stack=#' pour indiquer une plus grande valeurDépendance croisée dans une clause OUTER JOIN. Vérifiez la condition ONTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerImposible de charger la fonction '%-.192s'Impossible d'initialiser la fonction '%-.192s'; %-.80sChemin interdit pour les bibliothèques partagéesLa fonction '%-.192s' existe déjàImpossible d'ouvrir la bibliothèque partagée '%-.192s' (errno: %d, %-.128s)Impossible de trouver la fonction '%-.128s' dans la bibliothèqueLa fonction '%-.192s' n'est pas définieL'hôte '%-.64s' est bloqué à cause d'un trop grand nombre d'erreur de connexion. Débloquer le par 'mariadb-admin flush-hosts'Le hôte '%-.64s' n'est pas authorisé à se connecter à ce serveur MariaDBVous utilisez un utilisateur anonyme et les utilisateurs anonymes ne sont pas autorisés à changer les mots de passeVous devez avoir le privilège update sur les tables de la base de donnée mysql pour pouvoir changer les mots de passe des autresImpossible de trouver un enregistrement correspondant dans la table userEnregistrements correspondants: %ld  Modifiés: %ld  Warnings: %ldImpossible de créer une nouvelle tâche (errno %M). S'il reste de la mémoire libre, consultez le manual pour trouver un éventuel bug dépendant de l'OSColumn count doesn't match value count at row %luImpossible de réouvrir la table: '%-.192sUtilisation incorrecte de la valeur NULLErreur '%s' provenant de regexpMélanger les colonnes GROUP (MIN(),MAX(),COUNT()...) avec des colonnes normales est interdit s'il n'y a pas de clause GROUP BYUn tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s'La commande '%-.100T' est interdite à l'utilisateur: '%s'@'%s' sur la table %`s.%`sLa commande '%-.32s' est interdite à l'utilisateur: '%s'@'%s' sur la colonne '%-.192s' de la table '%-.192s'Commande GRANT/REVOKE incorrecte. Consultez le manuelL'hôte ou l'utilisateur donné en argument à GRANT est trop longLa table '%-.192s.%-.192s' n'existe pasUn tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s' sur la table '%-.192s'Cette commande n'existe pas dans cette version de MariaDBErreur de syntaxeLa tâche 'delayed insert' n'a pas pu obtenir le verrou démandé sur la table %-.192sTrop de tâche 'delayed' en coursConnection %ld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' (%-.64s)Paquet plus grand que 'max_allowed_packet' reçuErreur de lecture reçue du pipe de connexionErreur reçue de fcntl() Paquets reçus dans le désordreImpossible de décompresser le paquet reçuErreur de lecture des paquets reçusTimeout en lecture des paquets reçusErreur d'écriture des paquets envoyésTimeout d'écriture des paquets envoyésLa chaîne résultat est plus grande que 'max_allowed_packet'Ce type de table (%s) ne supporte pas les colonnes BLOB/TEXTCe type de table (%s) ne supporte pas les colonnes AUTO_INCREMENTINSERT DELAYED ne peut être utilisé avec la table '%-.192s', car elle est verrouée avec LOCK TABLESNom de colonne '%-.100s' incorrectThe storage engine %s can't index column %`sToutes les tables de la table de type MERGE n'ont pas la même définitionÉcriture impossible à cause d'un index UNIQUE sur la table '%-.192s'La colonne '%-.192s' de type BLOB est utilisée dans une définition d'index sans longueur d'indexToutes les parties d'un index PRIMARY KEY doivent être NOT NULL; Si vous avez besoin d'un NULL dans l'index, utilisez un index UNIQUELe résultat contient plus d'un enregistrementCe type de table nécessite une clé primaire (PRIMARY KEY)Cette version de MariaDB n'est pas compilée avec le support RAIDVous êtes en mode 'safe update' et vous essayez de faire un UPDATE sans clause WHERE utilisant un indexL'index '%-.192s' n'existe pas sur la table '%-.192s'Impossible d'ouvrir la tableCe type de table ne supporte pas les %sVous n'êtes pas autorisé à exécute cette commande dans une transactionErreur %M lors du COMMITErreur %M lors du ROLLBACKErreur %M lors du FLUSH_LOGSErreur %M lors du CHECKPOINTConnection %lld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' hôte: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERLa reconstruction de l'index de la table copiée '%-.192s' a échouéErreur reçue du maître: '%-.64s'Erreur de lecture réseau reçue du maîtreErreur d'écriture réseau reçue du maîtreImpossible de trouver un index FULLTEXT correspondant à cette liste de colonnesImpossible d'exécuter la commande car vous avez des tables verrouillées ou une transaction activeVariable système '%-.*s' inconnueLa table '%-.192s' est marquée 'crashed' et devrait être réparéeLa table '%-.192s' est marquée 'crashed' et le dernier 'repair' a échouéAttention: certaines tables ne supportant pas les transactions ont été changées et elles ne pourront pas être restituéesCette transaction à commandes multiples nécessite plus de 'max_binlog_cache_size' octets de stockage, augmentez cette variable de mariadbd et réessayezCette opération ne peut être réalisée avec un esclave '%2$*1$s' actif, faites STOP SLAVE '%2$*1$s' d'abordCette opération nécessite un esclave actif, configurez les esclaves et faites START SLAVELe server n'est pas configuré comme un esclave, changez le fichier de configuration ou utilisez CHANGE MASTER TOImpossible d'initialiser les structures d'information de maître '%.*s', vous trouverez des messages d'erreur supplémentaires dans le journal des erreurs de MariaDBImpossible de créer une tâche esclave, vérifiez les ressources systèmeL'utilisateur %-.64s possède déjà plus de 'max_user_connections' connexions activesSeules les expressions constantes sont autorisées avec SETTimeout sur l'obtention du verrouLe nombre total de verrou dépasse la taille de la table des verrousUn verrou en update ne peut être acquit pendant une transaction READ UNCOMMITTEDDROP DATABASE n'est pas autorisée pendant qu'une tâche possède un verrou global en lectureCREATE DATABASE n'est pas autorisée pendant qu'une tâche possède un verrou global en lectureMauvais arguments à %s'%s'@'%s' n'est pas autorisé à créer de nouveaux utilisateursDéfinition de table incorrecte; toutes les tables MERGE doivent être dans la même base de donnéeDeadlock découvert en essayant d'obtenir les verrous : essayez de redémarrer la transactionLe type de table utilisé (%s) ne supporte pas les index FULLTEXTImpossible d'ajouter des contraintes d'index externe à `%s`Impossible d'ajouter un enregistrement fils : une constrainte externe l'empècheImpossible de supprimer un enregistrement père : une constrainte externe l'empècheError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYImpossible de créer le serveur étranger '%s' car il existe déjàThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDuplicata du champ '%-.64T' pour la clef '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAccès refusé pour l'utilisateur: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDuplicata du champ pour la clef '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmysql_performance_tables.sql000064400000003646150343472770012372 0ustar00--
-- PERFORMANCE SCHEMA INSTALLATION
-- Note that this script is also reused by mysql_upgrade,
-- so we have to be very careful here to not destroy any
-- existing database named 'performance_schema' if it
-- can contain user data.
-- In case of downgrade, it's ok to drop unknown tables
-- from a future version, as long as they belong to the
-- performance schema engine.
--

set @have_old_pfs= (select count(*) from information_schema.schemata where schema_name='performance_schema');

SET @cmd="SET @broken_tables = (select count(*) from information_schema.tables  where engine != 'PERFORMANCE_SCHEMA' and table_schema='performance_schema')";

-- Work around for bug#49542
SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_tables = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

SET @cmd="SET @broken_views = (select count(*) from information_schema.views where table_schema='performance_schema')";

-- Work around for bug#49542
SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_views = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

SET @broken_routines = (select count(*) from mysql.proc where db='performance_schema');

SET @broken_events = (select count(*) from mysql.event where db='performance_schema');

SET @broken_pfs= (select @broken_tables + @broken_views + @broken_routines + @broken_events);

--
-- The performance schema database.
-- Only drop and create the database if this is safe (no broken_pfs).
-- This database is created, even in --without-perfschema builds,
-- so that the database name is always reserved by the MySQL implementation.
--

SET @cmd= "DROP DATABASE IF EXISTS performance_schema";

SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

SET @cmd= "CREATE DATABASE performance_schema character set utf8mb3";

SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
binary-configure000075500000002203150343472770007746 0ustar00#!/bin/sh

SCRIPT_NAME="`basename $0`"

usage()
{
  echo "Usage: ${SCRIPT_NAME} [--help|-h]"
  echo ""
  echo "This script creates the MySQL system tables and starts the server."
}

for arg do
  case "$arg" in
    --help|-h)
      usage
      exit 0
      ;;
    *)
      echo "${SCRIPT_NAME}: unknown option $arg"
      usage
      exit 2
      ;;
  esac
done

if test ! -x  ./scripts/mysql_install_db
then
  echo "I didn't find the script './scripts/mysql_install_db'."
  echo "Please execute this script in the mysql distribution directory!"
  exit 1;
fi

echo "NOTE: This is a MySQL binary distribution. It's ready to run, you don't"
echo "need to configure it!"
echo ""
echo "To help you a bit, I am now going to create the needed MySQL databases"
echo "and start the MySQL server for you.  If you run into any trouble, please"
echo "consult the MySQL manual, that you can find in the Docs directory."
echo ""

./scripts/mysql_install_db --no-defaults
if [ $? = 0 ]
then
  echo "Starting the mariadbd server.  You can test that it is up and running"
  echo "with the command:"
  echo "./bin/mysqladmin version"
  ./bin/mysqld_safe --no-defaults &
fi
policy/apparmor/README000064400000000400150343472770010552 0ustar00Note: The included AppArmor profiles can be used for MariaDB Galera cluster.
However, since these profiles had been tested for a limited set of scenarios,
it is highly recommended to run them in "complain" mode and report any denials
on mariadb.org/jira.

policy/apparmor/usr.sbin.mysqld000064400000006754150343472770012712 0ustar00# Last Modified: Fri Mar  1 18:55:47 2013
# Based on usr.sbin.mysqld packaged in mysql-server in Ubuntu.
# This AppArmor profile has been copied under BSD License from
# Percona XtraDB Cluster, along with some additions.

#include <tunables/global>

/usr/sbin/mariadbd flags=(complain) {
  #include <abstractions/base>
  #include <abstractions/mysql>
  #include <abstractions/nameservice>
  #include <abstractions/user-tmp>
  #include <abstractions/winbind>

  capability chown,
  capability dac_override,
  capability ipc_lock,
  capability setgid,
  capability setuid,
  capability sys_rawio,
  capability sys_resource,

  network tcp,

  /bin/dash rcx,
  /dev/dm-0 r,
  /etc/gai.conf r,
  /etc/group r,
  /etc/hosts.allow r,
  /etc/hosts.deny r,
  /etc/ld.so.cache r,
  /etc/mtab r,
  /etc/my.cnf r,
  /etc/mysql/*.cnf r,
  /etc/mysql/*.pem r,
  /etc/mysql/conf.d/ r,
  /etc/mysql/conf.d/* r,
  /etc/mysql/mariadb.conf.d/ r,
  /etc/mysql/mariadb.conf.d/* r,
  /etc/nsswitch.conf r,
  /etc/passwd r,
  /etc/services r,
  /run/mysqld/mysqld.pid w,
  /run/mysqld/mysqld.sock w,
  /sys/devices/system/cpu/ r,
  owner /tmp/** lk,
  /tmp/** rw,
  /usr/lib/mysql/plugin/ r,
  /usr/lib/mysql/plugin/*.so* mr,
  /usr/sbin/mariadbd mr,
  /usr/share/mysql/** r,
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /var/log/mysql.err rw,
  /var/log/mysql.log rw,
  /var/log/mysql/ r,
  /var/log/mysql/* rw,
  /run/mysqld/mysqld.pid w,
  /run/mysqld/mysqld.sock w,


  profile /bin/dash flags=(complain) {
    #include <abstractions/base>
    #include <abstractions/bash>
    #include <abstractions/mysql>
    #include <abstractions/nameservice>
    #include <abstractions/perl>



    /bin/cat rix,
    /bin/dash rix,
    /bin/date rix,
    /bin/grep rix,
    /bin/nc.openbsd rix,
    /bin/netstat rix,
    /bin/ps rix,
    /bin/rm rix,
    /bin/sed rix,
    /bin/sleep rix,
    /bin/tar rix,
    /bin/which rix,
    /dev/tty rw,
    /etc/ld.so.cache r,
    /etc/my.cnf r,
    /proc/ r,
    /proc/*/cmdline r,
    /proc/*/fd/ r,
    /proc/*/net/dev r,
    /proc/*/net/if_inet6 r,
    /proc/*/net/tcp r,
    /proc/*/net/tcp6 r,
    /proc/*/stat r,
    /proc/*/status r,
    /proc/sys/kernel/pid_max r,
    /proc/tty/drivers r,
    /proc/uptime r,
    /proc/version r,
    /sbin/ifconfig rix,
    /sys/devices/system/cpu/ r,
    /tmp/** rw,
    /usr/bin/cut rix,
    /usr/bin/dirname rix,
    /usr/bin/gawk rix,
    /usr/bin/mysql rix,
    /usr/bin/perl rix,
    /usr/bin/seq rix,
    /usr/bin/wsrep_sst* rix,
    /usr/bin/wsrep_sst_common r,
    /usr/bin/mariabackup* rix,
    /var/lib/mysql/ r,
    /var/lib/mysql/** rw,
    /var/lib/mysql/*.log w,
    /var/lib/mysql/*.err w,

# MariaDB additions
    ptrace peer=@{profile_name},

    /bin/hostname rix,
    /bin/ip rix,
    /bin/mktemp rix,
    /bin/ss rix,
    /bin/sync rix,
    /bin/touch rix,
    /bin/uname rix,
    /etc/mysql/*.cnf r,
    /etc/mysql/conf.d/ r,
    /etc/mysql/conf.d/* r,
    /proc/*/attr/current r,
    /proc/*/fdinfo/* r,
    /proc/*/net/* r,
    /proc/locks r,
    /proc/sys/net/ipv4/ip_local_port_range r,
    /run/mysqld/mysqld.sock rw,
    /sbin/ip rix,
    /usr/bin/basename rix,
    /usr/bin/du rix,
    /usr/bin/find rix,
    /usr/bin/lsof rix,
    /usr/bin/my_print_defaults rix,
    /usr/bin/mysqldump rix,
    /usr/bin/pv rix,
    /usr/bin/rsync rix,
    /usr/bin/socat rix,
    /usr/bin/tail rix,
    /usr/bin/timeout rix,
    /usr/bin/xargs rix,
    /usr/bin/xbstream rix,
  }
  # Site-specific additions and overrides. See local/README for details.
  #include <local/usr.sbin.mariadbd>
}
policy/apparmor/usr.sbin.mysqld.local000064400000000357150343472770013774 0ustar00# Site-specific additions and overrides for usr.sbin.mysqld..
# For more details, please see /etc/apparmor.d/local/README.
# This AppArmor profile has been copied under BSD License from
# Percona XtraDB Cluster, along with some additions.
policy/selinux/mariadb-server.fc000064400000001200150343472770012754 0ustar00# This SELinux file contexts (.fc) file has been copied under New BSD License from
# Percona XtraDB Cluster.

/etc/init\.d/rc\.d/mysql -- gen_context(system_u:object_r:mysqld_initrc_exec_t,s0)
/var/lib/mysql/.*\.log --  gen_context(system_u:object_r:mysqld_log_t,s0)
/var/lib/mysql/.*\.err --  gen_context(system_u:object_r:mysqld_log_t,s0)
/var/lib/mysql/.*\.pid -- gen_context(system_u:object_r:mysqld_var_run_t,s0)
/var/lib/mysql/.*\.cnf	--  gen_context(system_u:object_r:mysqld_etc_t,s0)
/usr/bin/mariabackup.* -- gen_context(system_u:object_r:mysqld_exec_t,s0)
/usr/bin/wsrep.*  -- gen_context(system_u:object_r:mysqld_safe_exec_t,s0)
policy/selinux/mariadb.te000064400000000315150343472770011476 0ustar00module mariadb 1.0;

require {
        type mysqld_safe_t;
        class capability { setuid setgid };
}

#============= mysqld_safe_t ==============
allow mysqld_safe_t self:capability { setuid setgid };
policy/selinux/README000064400000001522150343472770010426 0ustar00Note: The included SELinux policy files can be used for MariaDB Galera cluster.
However, since these policies had been tested for a limited set of scenarios,
it is highly recommended that you run mysqld in "permissive" mode even with
these policies installed and report any denials on mariadb.org/jira.


How to generate and load the policy module of MariaDB Galera cluster ?
  * Generate the SELinux policy module.
    # cd <source>/policy/selinux/
    # make -f /usr/share/selinux/devel/Makefile mariadb-server.pp

  * Load the generated policy module.
    # semodule -i /path/to/mariadb-server.pp

  * Lastly, run the following command to allow tcp/4568 and udp/4567.
    # semanage port -a -t mysqld_port_t -p tcp 4568
    # semanage port -a -t mysqld_port_t -p udp 4567

How to run mysqld in permissve mode ?
  # semanage permissive -a mysqld_t
policy/selinux/mariadb.pp000064400000001573150343472770011514 0ustar00��|���|�SE Linux Modulemariadb1.0@
capabilitysetgidsetuidobject_r@@@@
@mysqld_safe_t@@@@@@@@@@@@@@@@@@@@@@@@@
capabilityobject_r
mysqld_safe_tpolicy/selinux/mariadb-server.te000064400000007713150343472770013013 0ustar00# This SELinux type enforcement (.te) file has been copied under New BSD License
# from Percona XtraDB Cluster, along with some additions.

module mariadb-server 1.0;

require {
	type user_tmp_t;
	#type kerberos_master_port_t;
	type mysqld_safe_t;
	type tmp_t;
	type tmpfs_t;
	type hostname_exec_t;
	type ifconfig_exec_t;
	type sysctl_net_t;
	type proc_net_t;
	type port_t;
	type mysqld_t;
	type var_lib_t;
	type rsync_exec_t;
	type bin_t;
	type shell_exec_t;
	type anon_inodefs_t;
	type fixed_disk_device_t;
	type usermodehelper_t;
	class lnk_file read;
	class process { getattr signull };
	class unix_stream_socket connectto;
	class capability { ipc_lock sys_resource sys_nice };
	class tcp_socket { name_bind name_connect };
	class file { execute setattr read create getattr execute_no_trans write ioctl open append unlink };
	class sock_file { create unlink getattr };
	class blk_file { read write open };
	class dir { write search getattr add_name read remove_name open };

# MariaDB additions
	type kerberos_port_t;
	type tram_port_t;
	type mysqld_port_t;
	class udp_socket name_bind;
	class process setpgid;
	class netlink_tcpdiag_socket { create nlmsg_read };
}


#============= mysqld_safe_t ==============
allow mysqld_safe_t mysqld_t:process signull;
allow mysqld_safe_t self:capability { sys_resource sys_nice };
allow mysqld_safe_t tmp_t:file { create read write open getattr unlink ioctl setattr };
allow mysqld_safe_t tmp_t:dir { write remove_name add_name };
allow mysqld_safe_t tmp_t:sock_file { getattr unlink };
allow mysqld_safe_t user_tmp_t:sock_file { getattr unlink };
allow mysqld_safe_t var_lib_t:dir { write add_name };
allow mysqld_safe_t var_lib_t:file { write ioctl setattr create open getattr append unlink };

#============= mysqld_t ==============
allow mysqld_t anon_inodefs_t:file write;
allow mysqld_t tmp_t:sock_file { create unlink };
allow mysqld_t tmpfs_t:dir { write search read remove_name open add_name };
allow mysqld_t tmpfs_t:file { write getattr read create unlink open };
allow mysqld_t fixed_disk_device_t:blk_file { read write open };
allow mysqld_t ifconfig_exec_t:file { read execute open execute_no_trans getattr };

#This rule allows connecting on 4444/4567/4568
#allow mysqld_t kerberos_master_port_t:tcp_socket { name_bind name_connect };

allow mysqld_t mysqld_safe_t:dir { getattr search };
allow mysqld_t mysqld_safe_t:file { read open };
allow mysqld_t self:unix_stream_socket connectto;
allow mysqld_t port_t:tcp_socket { name_bind name_connect };
allow mysqld_t proc_net_t:file { read getattr open };
allow mysqld_t sysctl_net_t:dir search;
allow mysqld_t var_lib_t:file { getattr open append };
allow mysqld_t var_lib_t:sock_file { create unlink getattr };
allow mysqld_t rsync_exec_t:file { read getattr open execute execute_no_trans };
allow mysqld_t self:process getattr;
allow mysqld_t hostname_exec_t:file { read getattr execute open execute_no_trans };
allow mysqld_t user_tmp_t:dir { write add_name };
allow mysqld_t user_tmp_t:file create;
allow mysqld_t bin_t:lnk_file read;
allow mysqld_t tmp_t:file { append create read write open getattr unlink setattr };
allow mysqld_t usermodehelper_t:file { read open };

# Allows too much leeway - the mariabackup/wsrep rules in fc should fix it, but
# keep for the moment.
allow mysqld_t shell_exec_t:file { execute_no_trans getattr read execute open };
allow mysqld_t bin_t:file { getattr read execute open execute_no_trans ioctl };

# MariaDB additions
allow mysqld_t self:process setpgid;
allow mysqld_t self:capability { ipc_lock };

# This rule allows port tcp/4444
allow mysqld_t kerberos_port_t:tcp_socket { name_bind name_connect };
# This rule allows port tcp/4567 (tram_port_t may not be available on
# older versions)
allow mysqld_t tram_port_t:tcp_socket name_bind;
# This rule allows port udp/4567 (see README)
allow mysqld_t mysqld_port_t:udp_socket name_bind;

# Rules related to mariabackup
allow mysqld_t self:netlink_tcpdiag_socket { create nlmsg_read };
allow mysqld_t sysctl_net_t:file { read getattr open };

errmsg-utf8.txt000064400002567261150343472770007527 0ustar00languages bulgarian=bgn cp1251, chinese=chi gbk, czech=cze latin2, danish=dan latin1, dutch=nla latin1, english=eng latin1, estonian=est latin7, french=fre latin1, german=ger latin1, greek=greek greek, hindi=hindi utf8mb3, hungarian=hun latin2, italian=ita latin1, japanese=jpn ujis, korean=kor euckr, norwegian-ny=norwegian-ny latin1, norwegian=nor latin1, polish=pol latin2, portuguese=por latin1, romanian=rum latin2, russian=rus koi8r, serbian=serbian cp1250, slovak=slo latin2, spanish=spa latin1, swedish=swe latin1, ukrainian=ukr koi8u;

default-language eng

start-error-number 1000

ER_HASHCHK  
        eng "hashchk"
ER_NISAMCHK  
        eng "isamchk"
ER_NO  
        chi "不"
        cze "NE"
        dan "NEJ"
        eng "NO"
        est "EI"
        fre "NON"
        ger "Nein"
        greek "ΟΧΙ"
        hindi "नहीं"
        hun "NEM"
        kor "아니오"
        nla "NEE"
        nor "NEI"
        norwegian-ny "NEI"
        pol "NIE"
        por "NÃO"
        rum "NU"
        rus "НЕТ"
        serbian "NE"
        slo "NIE"
        ukr "НІ"
ER_YES  
        chi "是的"
        cze "ANO"
        dan "JA"
        eng "YES"
        est "JAH"
        fre "OUI"
        ger "Ja"
        greek "ΝΑΙ"
        hindi "हाँ"
        hun "IGEN"
        ita "SI"
        kor "예"
        nla "JA"
        nor "JA"
        norwegian-ny "JA"
        pol "TAK"
        por "SIM"
        rum "DA"
        rus "ДА"
        serbian "DA"
        slo "Áno"
        spa "SÍ"
        ukr "ТАК"
ER_CANT_CREATE_FILE  
        chi "无法创建文件'%-.200s'(错误号码:%M)"
        cze "Nemohu vytvořit soubor '%-.200s' (chybový kód: %M)"
        dan "Kan ikke oprette filen '%-.200s' (Fejlkode: %M)"
        eng "Can't create file '%-.200s' (errno: %M)"
        est "Ei suuda luua faili '%-.200s' (veakood: %M)"
        fre "Ne peut créer le fichier '%-.200s' (Errcode: %M)"
        ger "Kann Datei '%-.200s' nicht erzeugen (Fehler: %M)"
        greek "Αδύνατη η δημιουργία του αρχείου '%-.200s' (κωδικός λάθους: %M)"
        hindi "फ़ाइल '%-.200s' नहीं बन सका (errno: %M)"
        hun "A '%-.200s' file nem hozhato letre (hibakod: %M)"
        ita "Impossibile creare il file '%-.200s' (errno: %M)"
        jpn "ファイル '%-.200s' を作成できません。(エラー番号: %M)"
        kor "화일 '%-.200s'를 만들지 못했습니다. (에러번호: %M)"
        nla "Kan file '%-.200s' niet aanmaken (Errcode: %M)"
        nor "Kan ikke opprette fila '%-.200s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje opprette fila '%-.200s' (Feilkode: %M)"
        pol "Nie można stworzyć pliku '%-.200s' (Kod błędu: %M)"
        por "Não pode criar o arquivo '%-.200s' (erro no. %M)"
        rum "Nu pot sa creez fisierul '%-.200s' (Eroare: %M)"
        rus "Невозможно создать файл '%-.200s' (ошибка: %M)"
        serbian "Ne mogu da kreiram file '%-.200s' (errno: %M)"
        slo "Nemôžem vytvoriť súbor '%-.200s' (chybový kód: %M)"
        spa "No puedo crear el fichero/archivo '%-.200s' (Error: %M)"
        swe "Kan inte skapa filen '%-.200s' (Felkod: %M)"
        ukr "Не можу створити файл '%-.200s' (помилка: %M)"
ER_CANT_CREATE_TABLE  
        chi "无法创建表%`s.%`s(错误号码:%M)"
        cze "Nemohu vytvořit tabulku %`s.%`s (chybový kód: %M)"
        dan "Kan ikke oprette tabellen %`s.%`s (Fejlkode: %M)"
        eng "Can't create table %`s.%`s (errno: %M)"
        est "Ei suuda luua tabelit %`s.%`s (veakood: %M)"
        fre "Ne peut créer la table %`s.%`s (Errcode: %M)"
        ger "Kann Tabelle %`s.%`s nicht erzeugen (Fehler: %M)"
        greek "Αδύνατη η δημιουργία του πίνακα %`s.%`s (κωδικός λάθους: %M)"
        hindi "टेबल '%`s.%`s' नहीं बन सका (errno: %M)"
        hun "A %`s.%`s tabla nem hozhato letre (hibakod: %M)"
        ita "Impossibile creare la tabella %`s.%`s (errno: %M)"
        jpn "%`s.%`s テーブルが作れません.(errno: %M)"
        kor "테이블 %`s.%`s를 만들지 못했습니다. (에러번호: %M)"
        nla "Kan tabel %`s.%`s niet aanmaken (Errcode: %M)"
        nor "Kan ikke opprette tabellen %`s.%`s (Feilkode: %M)"
        norwegian-ny "Kan ikkje opprette tabellen %`s.%`s (Feilkode: %M)"
        pol "Nie można stworzyć tabeli %`s.%`s (Kod błędu: %M)"
        por "Não pode criar a tabela %`s.%`s (erro no. %M)"
        rum "Nu pot sa creez tabla %`s.%`s (Eroare: %M)"
        rus "Невозможно создать таблицу %`s.%`s (ошибка: %M)"
        serbian "Ne mogu da kreiram tabelu %`s.%`s (errno: %M)"
        slo "Nemôžem vytvoriť tabuľku %`s.%`s (chybový kód: %M)"
        spa "No puedo crear la tabla %`s.%`s (Error: %M)"
        swe "Kan inte skapa tabellen %`s.%`s (Felkod: %M)"
        ukr "Не можу створити таблицю %`s.%`s (помилка: %M)"
ER_CANT_CREATE_DB  
        chi "无法创建数据库'%-.192s'(错误号码:%M)"
        cze "Nemohu vytvořit databázi '%-.192s' (chybový kód: %M)"
        dan "Kan ikke oprette databasen '%-.192s' (Fejlkode: %M)"
        eng "Can't create database '%-.192s' (errno: %M)"
        est "Ei suuda luua andmebaasi '%-.192s' (veakood: %M)"
        fre "Ne peut créer la base '%-.192s' (Erreur %M)"
        ger "Kann Datenbank '%-.192s' nicht erzeugen (Fehler: %M)"
        greek "Αδύνατη η δημιουργία της βάσης δεδομένων '%-.192s' (κωδικός λάθους: %M)"
        hindi "डेटाबेस '%-.192s' नहीं बन सका (errno: %M)"
        hun "Az '%-.192s' adatbazis nem hozhato letre (hibakod: %M)"
        ita "Impossibile creare il database '%-.192s' (errno: %M)"
        jpn "データベース '%-.192s' を作成できません。(エラー番号: %M)"
        kor "데이타베이스 '%-.192s'를 만들지 못했습니다.. (에러번호: %M)"
        nla "Kan database '%-.192s' niet aanmaken (Errcode: %M)"
        nor "Kan ikke opprette databasen '%-.192s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje opprette databasen '%-.192s' (Feilkode: %M)"
        pol "Nie można stworzyć bazy danych '%-.192s' (Kod błędu: %M)"
        por "Não pode criar o banco de dados '%-.192s' (erro no. %M)"
        rum "Nu pot sa creez baza de date '%-.192s' (Eroare: %M)"
        rus "Невозможно создать базу данных '%-.192s' (ошибка: %M)"
        serbian "Ne mogu da kreiram bazu '%-.192s' (errno: %M)"
        slo "Nemôžem vytvoriť databázu '%-.192s' (chybový kód: %M)"
        spa "No puedo crear la base de datos '%-.192s' (Error: %M)"
        swe "Kan inte skapa databasen '%-.192s' (Felkod: %M)"
        ukr "Не можу створити базу данних '%-.192s' (помилка: %M)"
ER_DB_CREATE_EXISTS  
        chi "无法创建数据库'%-.192s';已经存在"
        cze "Nemohu vytvořit databázi '%-.192s'; databáze již existuje"
        dan "Kan ikke oprette databasen '%-.192s'; databasen eksisterer"
        eng "Can't create database '%-.192s'; database exists"
        est "Ei suuda luua andmebaasi '%-.192s': andmebaas juba eksisteerib"
        fre "Ne peut créer la base '%-.192s'; elle existe déjà"
        ger "Kann Datenbank '%-.192s' nicht erzeugen. Datenbank existiert bereits"
        greek "Αδύνατη η δημιουργία της βάσης δεδομένων '%-.192s'; Η βάση δεδομένων υπάρχει ήδη"
        hindi "डेटाबेस '%-.192s' नहीं बन सकता है; यह डेटाबेस पहले से ही मौजूद है"
        hun "Az '%-.192s' adatbazis nem hozhato letre Az adatbazis mar letezik"
        ita "Impossibile creare il database '%-.192s'; il database esiste"
        jpn "データベース '%-.192s' を作成できません。データベースはすでに存在します。"
        kor "데이타베이스 '%-.192s'를 만들지 못했습니다.. 데이타베이스가 존재함"
        nla "Kan database '%-.192s' niet aanmaken; database bestaat reeds"
        nor "Kan ikke opprette databasen '%-.192s'; databasen eksisterer"
        norwegian-ny "Kan ikkje opprette databasen '%-.192s'; databasen eksisterer"
        pol "Nie można stworzyć bazy danych '%-.192s'; baza danych już istnieje"
        por "Não pode criar o banco de dados '%-.192s'; este banco de dados já existe"
        rum "Nu pot sa creez baza de date '%-.192s'; baza de date exista deja"
        rus "Невозможно создать базу данных '%-.192s'. База данных уже существует"
        serbian "Ne mogu da kreiram bazu '%-.192s'; baza već postoji"
        slo "Nemôžem vytvoriť databázu '%-.192s'; databáza existuje"
        spa "No puedo crear la base de datos '%-.192s'; la base de datos ya existe"
        swe "Databasen '%-.192s' existerar redan"
        ukr "Не можу створити базу данних '%-.192s'. База данних існує"
ER_DB_DROP_EXISTS  
        chi "无法删除数据库'%-.192s';数据库不存在"
        cze "Nemohu zrušit databázi '%-.192s', databáze neexistuje"
        dan "Kan ikke slette (droppe) '%-.192s'; databasen eksisterer ikke"
        eng "Can't drop database '%-.192s'; database doesn't exist"
        est "Ei suuda kustutada andmebaasi '%-.192s': andmebaasi ei eksisteeri"
        fre "Ne peut effacer la base '%-.192s'; elle n'existe pas"
        ger "Kann Datenbank '%-.192s' nicht löschen; Datenbank nicht vorhanden"
        greek "Αδύνατη η διαγραφή της βάσης δεδομένων '%-.192s'. Η βάση δεδομένων δεν υπάρχει"
        hindi "डेटाबेस '%-.192s' ड्रॉप नहीं कर सकते हैं; यह डेटाबेस मौजूद नहीं है"
        hun "A(z) '%-.192s' adatbazis nem szuntetheto meg. Az adatbazis nem letezik"
        ita "Impossibile cancellare '%-.192s'; il database non esiste"
        jpn "データベース '%-.192s' を削除できません。データベースは存在しません。"
        kor "데이타베이스 '%-.192s'를 제거하지 못했습니다. 데이타베이스가 존재하지 않음 "
        nla "Kan database '%-.192s' niet verwijderen; database bestaat niet"
        nor "Kan ikke fjerne (drop) '%-.192s'; databasen eksisterer ikke"
        norwegian-ny "Kan ikkje fjerne (drop) '%-.192s'; databasen eksisterer ikkje"
        pol "Nie można usun?ć bazy danych '%-.192s'; baza danych nie istnieje"
        por "Não pode eliminar o banco de dados '%-.192s'; este banco de dados não existe"
        rum "Nu pot sa drop baza de date '%-.192s'; baza da date este inexistenta"
        rus "Невозможно удалить базу данных '%-.192s'. Такой базы данных нет"
        serbian "Ne mogu da izbrišem bazu '%-.192s'; baza ne postoji"
        slo "Nemôžem zmazať databázu '%-.192s'; databáza neexistuje"
        spa "No puedo eliminar la base de datos '%-.192s'; la base de datos no existe"
        swe "Kan inte radera databasen '%-.192s'; databasen finns inte"
        ukr "Не можу видалити базу данних '%-.192s'. База данних не існує"
ER_DB_DROP_DELETE  
        chi "删除数据库错误(无法删除'%-.192s',错误号码:%M)"
        cze "Chyba při rušení databáze (nemohu vymazat '%-.192s', chyba %M)"
        dan "Fejl ved sletning (drop) af databasen (kan ikke slette '%-.192s', Fejlkode %M)"
        eng "Error dropping database (can't delete '%-.192s', errno: %M)"
        est "Viga andmebaasi kustutamisel (ei suuda kustutada faili '%-.192s', veakood: %M)"
        fre "Ne peut effacer la base '%-.192s' (erreur %M)"
        ger "Fehler beim Löschen der Datenbank ('%-.192s' kann nicht gelöscht werden, Fehler: %M)"
        greek "Παρουσιάστηκε πρόβλημα κατά τη διαγραφή της βάσης δεδομένων (αδύνατη η διαγραφή '%-.192s', κωδικός λάθους: %M)"
        hindi "डेटाबेस ड्रॉप में त्रुटि हुई ('%-.192s' हटा नहीं सकते, errno: %M)"
        hun "Adatbazis megszuntetesi hiba ('%-.192s' nem torolheto, hibakod: %M)"
        ita "Errore durante la cancellazione del database (impossibile cancellare '%-.192s', errno: %M)"
        jpn "データベース削除エラー ('%-.192s' を削除できません。エラー番号: %M)"
        kor "데이타베이스 제거 에러('%-.192s'를 삭제할 수 없습니다, 에러번호: %M)"
        nla "Fout bij verwijderen database (kan '%-.192s' niet verwijderen, Errcode: %M)"
        nor "Feil ved fjerning (drop) av databasen (kan ikke slette '%-.192s', feil %M)"
        norwegian-ny "Feil ved fjerning (drop) av databasen (kan ikkje slette '%-.192s', feil %M)"
        pol "Bł?d podczas usuwania bazy danych (nie można usun?ć '%-.192s', bł?d %M)"
        por "Erro ao eliminar banco de dados (não pode eliminar '%-.192s' - erro no. %M)"
        rum "Eroare dropuind baza de date (nu pot sa sterg '%-.192s', Eroare: %M)"
        rus "Ошибка при удалении базы данных (невозможно удалить '%-.192s', ошибка: %M)"
        serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem '%-.192s', errno: %M)"
        slo "Chyba pri mazaní databázy (nemôžem zmazať '%-.192s', chybový kód: %M)"
        spa "Error eliminando la base de datos (no puedo borrar '%-.192s', error %M)"
        swe "Fel vid radering av databasen (Kan inte radera '%-.192s'. Felkod: %M)"
        ukr "Не можу видалити базу данних (Не можу видалити '%-.192s', помилка: %M)"
ER_DB_DROP_RMDIR  
        chi "删除数据库错误(无法rmdir '%-.192s',错误号码:%M)"
        cze "Chyba při rušení databáze (nemohu vymazat adresář '%-.192s', chyba %M)"
        dan "Fejl ved sletting af database (kan ikke slette folderen '%-.192s', Fejlkode %M)"
        eng "Error dropping database (can't rmdir '%-.192s', errno: %M)"
        est "Viga andmebaasi kustutamisel (ei suuda kustutada kataloogi '%-.192s', veakood: %M)"
        fre "Erreur en effaçant la base (rmdir '%-.192s', erreur %M)"
        ger "Fehler beim Löschen der Datenbank (Verzeichnis '%-.192s' kann nicht gelöscht werden, Fehler: %M)"
        greek "Παρουσιάστηκε πρόβλημα κατά τη διαγραφή της βάσης δεδομένων (αδύνατη η διαγραφή του φακέλλου '%-.192s', κωδικός λάθους: %M)"
        hindi "डेटाबेस ड्रॉप में त्रुटि हुई ('%-.192s' rmdir नहीं कर सकते, errno: %M)"
        hun "Adatbazis megszuntetesi hiba ('%-.192s' nem szuntetheto meg, hibakod: %M)"
        ita "Errore durante la cancellazione del database (impossibile rmdir '%-.192s', errno: %M)"
        jpn "データベース削除エラー (ディレクトリ '%-.192s' を削除できません。エラー番号: %M)"
        kor "데이타베이스 제거 에러(rmdir '%-.192s'를 할 수 없습니다, 에러번호: %M)"
        nla "Fout bij verwijderen database (kan rmdir '%-.192s' niet uitvoeren, Errcode: %M)"
        nor "Feil ved sletting av database (kan ikke slette katalogen '%-.192s', feil %M)"
        norwegian-ny "Feil ved sletting av database (kan ikkje slette katalogen '%-.192s', feil %M)"
        pol "Bł?d podczas usuwania bazy danych (nie można wykonać rmdir '%-.192s', bł?d %M)"
        por "Erro ao eliminar banco de dados (não pode remover diretório '%-.192s' - erro no. %M)"
        rum "Eroare dropuind baza de date (nu pot sa rmdir '%-.192s', Eroare: %M)"
        rus "Невозможно удалить базу данных (невозможно удалить каталог '%-.192s', ошибка: %M)"
        serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem direktorijum '%-.192s', errno: %M)"
        slo "Chyba pri mazaní databázy (nemôžem vymazať adresár '%-.192s', chybový kód: %M)"
        spa "Error eliminando la base de datos (No puedo borrar el directorio '%-.192s', error %M)"
        swe "Fel vid radering av databasen (Kan inte radera biblioteket '%-.192s'. Felkod: %M)"
        ukr "Не можу видалити базу данних (Не можу видалити теку '%-.192s', помилка: %M)"
ER_CANT_DELETE_FILE  
        chi "删除'%-.192s'出错(错误号码:%M)"
        cze "Chyba při výmazu '%-.192s' (chybový kód: %M)"
        dan "Fejl ved sletning af '%-.192s' (Fejlkode: %M)"
        eng "Error on delete of '%-.192s' (errno: %M)"
        est "Viga '%-.192s' kustutamisel (veakood: %M)"
        fre "Erreur en effaçant '%-.192s' (Errcode: %M)"
        ger "Fehler beim Löschen von '%-.192s' (Fehler: %M)"
        greek "Παρουσιάστηκε πρόβλημα κατά τη διαγραφή '%-.192s' (κωδικός λάθους: %M)"
        hindi "'%-.192s' के हटाने पर त्रुटि हुई (errno: %M)"
        hun "Torlesi hiba: '%-.192s' (hibakod: %M)"
        ita "Errore durante la cancellazione di '%-.192s' (errno: %M)"
        jpn "ファイル '%-.192s' の削除エラー (エラー番号: %M)"
        kor "'%-.192s' 삭제 중 에러 (에러번호: %M)"
        nla "Fout bij het verwijderen van '%-.192s' (Errcode: %M)"
        nor "Feil ved sletting av '%-.192s' (Feilkode: %M)"
        norwegian-ny "Feil ved sletting av '%-.192s' (Feilkode: %M)"
        pol "Bł?d podczas usuwania '%-.192s' (Kod błędu: %M)"
        por "Erro na remoção de '%-.192s' (erro no. %M)"
        rum "Eroare incercind sa delete '%-.192s' (Eroare: %M)"
        rus "Ошибка при удалении '%-.192s' (ошибка: %M)"
        serbian "Greška pri brisanju '%-.192s' (errno: %M)"
        slo "Chyba pri mazaní '%-.192s' (chybový kód: %M)"
        spa "Error en el borrado de '%-.192s' (Error: %M)"
        swe "Kan inte radera filen '%-.192s' (Felkod: %M)"
        ukr "Не можу видалити '%-.192s' (помилка: %M)"
ER_CANT_FIND_SYSTEM_REC  
        chi "无法在系统表中读取记录"
        cze "Nemohu číst záznam v systémové tabulce"
        dan "Kan ikke læse posten i systemfolderen"
        eng "Can't read record in system table"
        est "Ei suuda lugeda kirjet süsteemsest tabelist"
        fre "Ne peut lire un enregistrement de la table 'system'"
        ger "Datensatz in der Systemtabelle nicht lesbar"
        greek "Αδύνατη η ανάγνωση εγγραφής από πίνακα του συστήματος"
        hindi "सिस्टम टेबल से रिकॉर्ड नहीं पढ़ सके"
        hun "Nem olvashato rekord a rendszertablaban"
        ita "Impossibile leggere il record dalla tabella di sistema"
        jpn "システム表のレコードを読み込めません。"
        kor "system 테이블에서 레코드를 읽을 수 없습니다."
        nla "Kan record niet lezen in de systeem tabel"
        nor "Kan ikke lese posten i systemkatalogen"
        norwegian-ny "Kan ikkje lese posten i systemkatalogen"
        pol "Nie można odczytać rekordu z tabeli systemowej"
        por "Não pode ler um registro numa tabela do sistema"
        rum "Nu pot sa citesc cimpurile in tabla de system (system table)"
        rus "Невозможно прочитать запись в системной таблице"
        serbian "Ne mogu da pročitam slog iz sistemske tabele"
        slo "Nemôžem čítať záznam v systémovej tabuľke"
        spa "No puedo leer el registro en la tabla del sistema"
        swe "Hittar inte posten i systemregistret"
        ukr "Не можу зчитати запис з системної таблиці"
ER_CANT_GET_STAT  
        chi "无法获得'%-.200s'的状态(错误号码:%M)"
        cze "Nemohu získat stav '%-.200s' (chybový kód: %M)"
        dan "Kan ikke læse status af '%-.200s' (Fejlkode: %M)"
        eng "Can't get status of '%-.200s' (errno: %M)"
        est "Ei suuda lugeda '%-.200s' olekut (veakood: %M)"
        fre "Ne peut obtenir le status de '%-.200s' (Errcode: %M)"
        ger "Kann Status von '%-.200s' nicht ermitteln (Fehler: %M)"
        greek "Αδύνατη η λήψη πληροφοριών για την κατάσταση του '%-.200s' (κωδικός λάθους: %M)"
        hindi "'%-.200s' की अवस्था प्राप्त नहीं कर सके (errno: %M)"
        hun "A(z) '%-.200s' statusza nem allapithato meg (hibakod: %M)"
        ita "Impossibile leggere lo stato di '%-.200s' (errno: %M)"
        jpn "'%-.200s' の状態を取得できません。(エラー番号: %M)"
        kor "'%-.200s'의 상태를 얻지 못했습니다. (에러번호: %M)"
        nla "Kan de status niet krijgen van '%-.200s' (Errcode: %M)"
        nor "Kan ikke lese statusen til '%-.200s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje lese statusen til '%-.200s' (Feilkode: %M)"
        pol "Nie można otrzymać statusu '%-.200s' (Kod błędu: %M)"
        por "Não pode obter o status de '%-.200s' (erro no. %M)"
        rum "Nu pot sa obtin statusul lui '%-.200s' (Eroare: %M)"
        rus "Невозможно получить статусную информацию о '%-.200s' (ошибка: %M)"
        serbian "Ne mogu da dobijem stanje file-a '%-.200s' (errno: %M)"
        slo "Nemôžem zistiť stav '%-.200s' (chybový kód: %M)"
        spa "No puedo obtener el estado de '%-.200s' (Error: %M)"
        swe "Kan inte läsa filinformationen (stat) från '%-.200s' (Felkod: %M)"
        ukr "Не можу отримати статус '%-.200s' (помилка: %M)"
ER_CANT_GET_WD  
        chi "无法获取工作目录(错误号码:%M)"
        cze "Chyba při zjišťování pracovní adresář (chybový kód: %M)"
        dan "Kan ikke læse aktive folder (Fejlkode: %M)"
        eng "Can't get working directory (errno: %M)"
        est "Ei suuda identifitseerida jooksvat kataloogi (veakood: %M)"
        fre "Ne peut obtenir le répertoire de travail (Errcode: %M)"
        ger "Kann Arbeitsverzeichnis nicht ermitteln (Fehler: %M)"
        greek "Ο φάκελλος εργασίας δεν βρέθηκε (κωδικός λάθους: %M)"
        hindi "Working डाइरेक्टरी प्राप्त नहीं कर सके (errno: %M)"
        hun "A munkakonyvtar nem allapithato meg (hibakod: %M)"
        ita "Impossibile leggere la directory di lavoro (errno: %M)"
        jpn "作業ディレクトリを取得できません。(エラー番号: %M)"
        kor "수행 디렉토리를 찾지 못했습니다. (에러번호: %M)"
        nla "Kan de werkdirectory niet krijgen (Errcode: %M)"
        nor "Kan ikke lese aktiv katalog(Feilkode: %M)"
        norwegian-ny "Kan ikkje lese aktiv katalog(Feilkode: %M)"
        pol "Nie można rozpoznać aktualnego katalogu (Kod błędu: %M)"
        por "Não pode obter o diretório corrente (erro no. %M)"
        rum "Nu pot sa obtin directorul current (working directory) (Eroare: %M)"
        rus "Невозможно определить рабочий каталог (ошибка: %M)"
        serbian "Ne mogu da dobijem trenutni direktorijum (errno: %M)"
        slo "Nemôžem zistiť pracovný adresár (chybový kód: %M)"
        spa "No puedo obtener directorio de trabajo (Error: %M)"
        swe "Kan inte inte läsa aktivt bibliotek. (Felkod: %M)"
        ukr "Не можу визначити робочу теку (помилка: %M)"
ER_CANT_LOCK  
        chi "无法锁定文件(错误号码:%M)"
        cze "Nemohu uzamknout soubor (chybový kód: %M)"
        dan "Kan ikke låse fil (Fejlkode: %M)"
        eng "Can't lock file (errno: %M)"
        est "Ei suuda lukustada faili (veakood: %M)"
        fre "Ne peut verrouiller le fichier (Errcode: %M)"
        ger "Datei kann nicht gesperrt werden (Fehler: %M)"
        greek "Το αρχείο δεν μπορεί να κλειδωθεί (κωδικός λάθους: %M)"
        hindi "फ़ाइल लॉक नहीं कर सके (errno: %M)"
        hun "A file nem zarolhato. (hibakod: %M)"
        ita "Impossibile il locking il file (errno: %M)"
        jpn "ファイルをロックできません。(エラー番号: %M)"
        kor "화일을 잠그지(lock) 못했습니다. (에러번호: %M)"
        nla "Kan de file niet blokeren (Errcode: %M)"
        nor "Kan ikke låse fila (Feilkode: %M)"
        norwegian-ny "Kan ikkje låse fila (Feilkode: %M)"
        pol "Nie można zablokować pliku (Kod błędu: %M)"
        por "Não pode travar o arquivo (erro no. %M)"
        rum "Nu pot sa lock fisierul (Eroare: %M)"
        rus "Невозможно поставить блокировку на файле (ошибка: %M)"
        serbian "Ne mogu da zaključam file (errno: %M)"
        slo "Nemôžem zamknúť súbor (chybový kód: %M)"
        spa "No puedo bloquear fichero/archivo: (Error: %M)"
        swe "Kan inte låsa filen. (Felkod: %M)"
        ukr "Не можу заблокувати файл (помилка: %M)"
ER_CANT_OPEN_FILE  
        chi "无法打开文件:'%-.200s'(错误号码:%M)"
        cze "Nemohu otevřít soubor '%-.200s' (chybový kód: %M)"
        dan "Kan ikke åbne fil: '%-.200s' (Fejlkode: %M)"
        eng "Can't open file: '%-.200s' (errno: %M)"
        est "Ei suuda avada faili '%-.200s' (veakood: %M)"
        fre "Ne peut ouvrir le fichier: '%-.200s' (Errcode: %M)"
        ger "Kann Datei '%-.200s' nicht öffnen (Fehler: %M)"
        greek "Δεν είναι δυνατό να ανοιχτεί το αρχείο: '%-.200s' (κωδικός λάθους: %M)"
        hindi "फ़ाइल '%-.200s' नहीं खोल सकते (errno: %M)"
        hun "A '%-.200s' file nem nyithato meg (hibakod: %M)"
        ita "Impossibile aprire il file: '%-.200s' (errno: %M)"
        jpn "ファイル '%-.200s' をオープンできません。(エラー番号: %M)"
        kor "화일을 열지 못했습니다.: '%-.200s' (에러번호: %M)"
        nla "Kan de file '%-.200s' niet openen (Errcode: %M)"
        nor "Kan ikke åpne fila: '%-.200s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje åpne fila: '%-.200s' (Feilkode: %M)"
        pol "Nie można otworzyć pliku: '%-.200s' (Kod błędu: %M)"
        por "Não pode abrir o arquivo '%-.200s' (erro no. %M)"
        rum "Nu pot sa deschid fisierul: '%-.200s' (Eroare: %M)"
        rus "Невозможно открыть файл: '%-.200s' (ошибка: %M)"
        serbian "Ne mogu da otvorim file: '%-.200s' (errno: %M)"
        slo "Nemôžem otvoriť súbor: '%-.200s' (chybový kód: %M)"
        spa "No puedo abrir el fichero/archivo: '%-.200s' (Error: %M)"
        swe "Kan inte använda '%-.200s' (Felkod: %M)"
        ukr "Не можу відкрити файл: '%-.200s' (помилка: %M)"
ER_FILE_NOT_FOUND  
        chi "找不到文件:'%-.200s'(错误号码:%M)"
        cze "Nemohu najít soubor '%-.200s' (chybový kód: %M)"
        dan "Kan ikke finde fila: '%-.200s' (Fejlkode: %M)"
        eng "Can't find file: '%-.200s' (errno: %M)"
        est "Ei suuda leida faili '%-.200s' (veakood: %M)"
        fre "Ne peut trouver le fichier: '%-.200s' (Errcode: %M)"
        ger "Kann Datei '%-.200s' nicht finden (Fehler: %M)"
        greek "Δεν βρέθηκε το αρχείο: '%-.200s' (κωδικός λάθους: %M)"
        hindi "फ़ाइल '%-.200s' नहीं मिला (errno: %M)"
        hun "A(z) '%-.200s' file nem talalhato (hibakod: %M)"
        ita "Impossibile trovare il file: '%-.200s' (errno: %M)"
        jpn "ファイル '%-.200s' が見つかりません。(エラー番号: %M)"
        kor "화일을 찾지 못했습니다.: '%-.200s' (에러번호: %M)"
        nla "Kan de file: '%-.200s' niet vinden (Errcode: %M)"
        nor "Kan ikke finne fila: '%-.200s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje finne fila: '%-.200s' (Feilkode: %M)"
        pol "Nie można znaleĽć pliku: '%-.200s' (Kod błędu: %M)"
        por "Não pode encontrar o arquivo '%-.200s' (erro no. %M)"
        rum "Nu pot sa gasesc fisierul: '%-.200s' (Eroare: %M)"
        rus "Невозможно найти файл: '%-.200s' (ошибка: %M)"
        serbian "Ne mogu da pronađem file: '%-.200s' (errno: %M)"
        slo "Nemôžem nájsť súbor: '%-.200s' (chybový kód: %M)"
        spa "No puedo hallar el fichero/archivo: '%-.200s' (Error: %M)"
        swe "Hittar inte filen '%-.200s' (Felkod: %M)"
        ukr "Не можу знайти файл: '%-.200s' (помилка: %M)"
ER_CANT_READ_DIR  
        chi "无法读取'%-.192s'的文件夹(错误号码:%M)"
        cze "Nemohu číst adresář '%-.192s' (chybový kód: %M)"
        dan "Kan ikke læse folder '%-.192s' (Fejlkode: %M)"
        eng "Can't read dir of '%-.192s' (errno: %M)"
        est "Ei suuda lugeda kataloogi '%-.192s' (veakood: %M)"
        fre "Ne peut lire le répertoire de '%-.192s' (Errcode: %M)"
        ger "Verzeichnis von '%-.192s' nicht lesbar (Fehler: %M)"
        greek "Δεν είναι δυνατό να διαβαστεί ο φάκελλος του '%-.192s' (κωδικός λάθους: %M)"
        hindi "'%-.192s' की डायरेक्टरी नहीं पढ़ सके (errno: %M)"
        hun "A(z) '%-.192s' konyvtar nem olvashato. (hibakod: %M)"
        ita "Impossibile leggere la directory di '%-.192s' (errno: %M)"
        jpn "ディレクトリ '%-.192s' を読み込めません。(エラー番号: %M)"
        kor "'%-.192s'디렉토리를 읽지 못했습니다. (에러번호: %M)"
        nla "Kan de directory niet lezen van '%-.192s' (Errcode: %M)"
        nor "Kan ikke lese katalogen '%-.192s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje lese katalogen '%-.192s' (Feilkode: %M)"
        pol "Nie można odczytać katalogu '%-.192s' (Kod błędu: %M)"
        por "Não pode ler o diretório de '%-.192s' (erro no. %M)"
        rum "Nu pot sa citesc directorul '%-.192s' (Eroare: %M)"
        rus "Невозможно прочитать каталог '%-.192s' (ошибка: %M)"
        serbian "Ne mogu da pročitam direktorijum '%-.192s' (errno: %M)"
        slo "Nemôžem čítať adresár '%-.192s' (chybový kód: %M)"
        spa "No puedo leer el directorio de '%-.192s' (Error: %M)"
        swe "Kan inte läsa från bibliotek '%-.192s' (Felkod: %M)"
        ukr "Не можу прочитати теку '%-.192s' (помилка: %M)"
ER_CANT_SET_WD  
        chi "无法将dir更改为'%-.192s'(错误号码:%M)"
        cze "Nemohu změnit adresář na '%-.192s' (chybový kód: %M)"
        dan "Kan ikke skifte folder til '%-.192s' (Fejlkode: %M)"
        eng "Can't change dir to '%-.192s' (errno: %M)"
        est "Ei suuda siseneda kataloogi '%-.192s' (veakood: %M)"
        fre "Ne peut changer le répertoire pour '%-.192s' (Errcode: %M)"
        ger "Kann nicht in das Verzeichnis '%-.192s' wechseln (Fehler: %M)"
        greek "Αδύνατη η αλλαγή του τρέχοντος καταλόγου σε '%-.192s' (κωδικός λάθους: %M)"
        hindi "'%-.192s' डायरेक्टरी में नहीं बदल सके (errno: %M)"
        hun "Konyvtarvaltas nem lehetseges a(z) '%-.192s'-ba. (hibakod: %M)"
        ita "Impossibile cambiare la directory in '%-.192s' (errno: %M)"
        jpn "ディレクトリ '%-.192s' に移動できません。(エラー番号: %M)"
        kor "'%-.192s'디렉토리로 이동할 수 없었습니다. (에러번호: %M)"
        nla "Kan de directory niet veranderen naar '%-.192s' (Errcode: %M)"
        nor "Kan ikke skifte katalog til '%-.192s' (Feilkode: %M)"
        norwegian-ny "Kan ikkje skifte katalog til '%-.192s' (Feilkode: %M)"
        pol "Nie można zmienić katalogu na '%-.192s' (Kod błędu: %M)"
        por "Não pode mudar para o diretório '%-.192s' (erro no. %M)"
        rum "Nu pot sa schimb directorul '%-.192s' (Eroare: %M)"
        rus "Невозможно перейти в каталог '%-.192s' (ошибка: %M)"
        serbian "Ne mogu da promenim direktorijum na '%-.192s' (errno: %M)"
        slo "Nemôžem vojsť do adresára '%-.192s' (chybový kód: %M)"
        spa "No puedo cambiar al directorio a '%-.192s' (Error: %M)"
        swe "Kan inte byta till '%-.192s' (Felkod: %M)"
        ukr "Не можу перейти у теку '%-.192s' (помилка: %M)"
ER_CHECKREAD  
        chi "这个表自上次读后数据有变化'%-.192s'"
        cze "Záznam byl změněn od posledního čtení v tabulce '%-.192s'"
        dan "Posten er ændret siden sidste læsning '%-.192s'"
        eng "Record has changed since last read in table '%-.192s'"
        est "Kirje tabelis '%-.192s' on muutunud viimasest lugemisest saadik"
        fre "Enregistrement modifié depuis sa dernière lecture dans la table '%-.192s'"
        ger "Datensatz hat sich seit dem letzten Zugriff auf Tabelle '%-.192s' geändert"
        greek "Η εγγραφή έχει αλλάξει από την τελευταία φορά που ανασύρθηκε από τον πίνακα '%-.192s'"
        hindi "रिकॉर्ड टेबल '%-.192s' पिछली बार पढ़े जाने के बाद से बदल गया है"
        hun "A(z) '%-.192s' tablaban talalhato rekord megvaltozott az utolso olvasas ota"
        ita "Il record e` cambiato dall'ultima lettura della tabella '%-.192s'"
        jpn "表 '%-.192s' の最後の読み込み時点から、レコードが変化しました。"
        kor "테이블 '%-.192s'에서 마지막으로 읽은 후 Record가 변경되었습니다."
        nla "Record is veranderd sinds de laatste lees activiteit in de tabel '%-.192s'"
        nor "Posten har blitt endret siden den ble lest '%-.192s'"
        norwegian-ny "Posten har vorte endra sidan den sist vart lesen '%-.192s'"
        pol "Rekord został zmieniony od ostaniego odczytania z tabeli '%-.192s'"
        por "Registro alterado desde a última leitura da tabela '%-.192s'"
        rum "Cimpul a fost schimbat de la ultima citire a tabelei '%-.192s'"
        rus "Запись изменилась с момента последней выборки в таблице '%-.192s'"
        serbian "Slog je promenjen od zadnjeg čitanja tabele '%-.192s'"
        slo "Záznam bol zmenený od posledného čítania v tabuľke '%-.192s'"
        spa "El registro ha cambiado desde la ultima lectura de la tabla '%-.192s'"
        swe "Posten har förändrats sedan den lästes i register '%-.192s'"
        ukr "Запис було змінено з часу останнього читання з таблиці '%-.192s'"
ER_DISK_FULL
        chi "磁盘已满(%s);等待释放一些空间...(错误号码:%M)"
        cze "Disk je plný (%s), čekám na uvolnění nějakého místa ... (chybový kód: %M)"
        dan "Ikke mere diskplads (%s). Venter på at få frigjort plads... (Fejlkode: %M)"
        eng "Disk full (%s); waiting for someone to free some space... (errno: %M)"
        est "Ketas täis (%s). Ootame kuni tekib vaba ruumi... (veakood: %M)"
        fre "Disque plein (%s). J'attend que quelqu'un libère de l'espace... (Errcode: %M)"
        ger "Festplatte voll (%s). Warte, bis jemand Platz schafft ... (Fehler: %M)"
        greek "Δεν υπάρχει χώρος στο δίσκο (%s). Παρακαλώ, περιμένετε να ελευθερωθεί χώρος... (κωδικός λάθους: %M)"
        hindi "डिस्क पूरी तरह से भरा हुआ है (%s); कुछ स्थान खाली करें (errno: %M)"
        hun "A lemez megtelt (%s). (hibakod: %M)"
        ita "Disco pieno (%s). In attesa che qualcuno liberi un po' di spazio... (errno: %M)"
        jpn "ディスク領域不足です(%s)。(エラー番号: %M)"
        kor "Disk full (%s). 다른 사람이 지울때까지 기다립니다... (에러번호: %M)"
        nla "Schijf vol (%s). Aan het wachten totdat er ruimte vrij wordt gemaakt... (Errcode: %M)"
        nor "Ikke mer diskplass (%s). Venter på å få frigjort plass... (Feilkode: %M)"
        norwegian-ny "Ikkje meir diskplass (%s). Ventar på å få frigjort plass... (Feilkode: %M)"
        pol "Dysk pełny (%s). Oczekiwanie na zwolnienie miejsca... (Kod błędu: %M)"
        por "Disco cheio (%s). Aguardando alguém liberar algum espaço... (erro no. %M)"
        rum "Hard-disk-ul este plin (%s). Astept sa se elibereze ceva spatiu... (Eroare: %M)"
        rus "Диск заполнен. (%s). Ожидаем, пока кто-то не уберет после себя мусор... (ошибка: %M)"
        serbian "Disk je pun (%s). Čekam nekoga da dođe i oslobodi nešto mesta... (errno: %M)"
        slo "Disk je plný (%s), čakám na uvoľnenie miesta... (chybový kód: %M)"
        spa "Disco lleno (%s). Esperando a que alguien libere algo de espacio... (Error: %M)"
        swe "Disken är full (%s). Väntar tills det finns ledigt utrymme... (Felkod: %M)"
        ukr "Диск заповнений (%s). Вичикую, доки звільниться трохи місця... (помилка: %M)"
ER_DUP_KEY 23000 
        chi "不能写;表'%-.192s'中有重复索引"
        cze "Nemohu zapsat, zdvojený klíč v tabulce '%-.192s'"
        dan "Kan ikke skrive, flere ens nøgler i tabellen '%-.192s'"
        eng "Can't write; duplicate key in table '%-.192s'"
        est "Ei saa kirjutada, korduv võti tabelis '%-.192s'"
        fre "Ecriture impossible, doublon dans une clé de la table '%-.192s'"
        ger "Kann nicht speichern, Grund: doppelter Schlüssel in Tabelle '%-.192s'"
        greek "Δεν είναι δυνατή η καταχώρηση, η τιμή υπάρχει ήδη στον πίνακα '%-.192s'"
        hindi "टेबल '%-.192s' में DUPLICATE KEY मौजूद होने के कारण नहीं लिख सके"
        hun "Irasi hiba, duplikalt kulcs a '%-.192s' tablaban"
        ita "Scrittura impossibile: chiave duplicata nella tabella '%-.192s'"
        jpn "書き込めません。表 '%-.192s' に重複するキーがあります。"
        kor "기록할 수 없습니다., 테이블 '%-.192s'에서 중복 키"
        nla "Kan niet schrijven, dubbele zoeksleutel in tabel '%-.192s'"
        nor "Kan ikke skrive, flere like nøkler i tabellen '%-.192s'"
        norwegian-ny "Kan ikkje skrive, flere like nyklar i tabellen '%-.192s'"
        pol "Nie można zapisać, powtórzone klucze w tabeli '%-.192s'"
        por "Não pode gravar. Chave duplicada na tabela '%-.192s'"
        rum "Nu pot sa scriu (can't write), cheie duplicata in tabela '%-.192s'"
        rus "Невозможно произвести запись, дублирующийся ключ в таблице '%-.192s'"
        serbian "Ne mogu da pišem pošto postoji duplirani ključ u tabeli '%-.192s'"
        slo "Nemôžem zapísať, duplikát kľúča v tabuľke '%-.192s'"
        spa "No puedo escribir, clave duplicada en la tabla '%-.192s'"
        swe "Kan inte skriva, dubbel söknyckel i register '%-.192s'"
        ukr "Не можу записати, дублюючийся ключ в таблиці '%-.192s'"
ER_ERROR_ON_CLOSE  
        chi "'%-.192s'关闭时出错(错误号码:%M)"
        cze "Chyba při zavírání '%-.192s' (chybový kód: %M)"
        dan "Fejl ved lukning af '%-.192s' (Fejlkode: %M)"
        eng "Error on close of '%-.192s' (errno: %M)"
        est "Viga faili '%-.192s' sulgemisel (veakood: %M)"
        fre "Erreur a la fermeture de '%-.192s' (Errcode: %M)"
        ger "Fehler beim Schließen von '%-.192s' (Fehler: %M)"
        greek "Παρουσιάστηκε πρόβλημα κλείνοντας το '%-.192s' (κωδικός λάθους: %M)"
        hindi "'%-.192s' के बंद पर त्रुटि हुई (errno: %M)"
        hun "Hiba a(z) '%-.192s' zarasakor. (hibakod: %M)"
        ita "Errore durante la chiusura di '%-.192s' (errno: %M)"
        jpn "'%-.192s' のクローズ時エラー (エラー番号: %M)"
        kor "'%-.192s'닫는 중 에러 (에러번호: %M)"
        nla "Fout bij het sluiten van '%-.192s' (Errcode: %M)"
        nor "Feil ved lukking av '%-.192s' (Feilkode: %M)"
        norwegian-ny "Feil ved lukking av '%-.192s' (Feilkode: %M)"
        pol "Bł?d podczas zamykania '%-.192s' (Kod błędu: %M)"
        por "Erro ao fechar '%-.192s' (erro no. %M)"
        rum "Eroare inchizind '%-.192s' (errno: %M)"
        rus "Ошибка при закрытии '%-.192s' (ошибка: %M)"
        serbian "Greška pri zatvaranju '%-.192s' (errno: %M)"
        slo "Chyba pri zatváraní '%-.192s' (chybový kód: %M)"
        spa "Error en el cierre de '%-.192s' (Error: %M)"
        swe "Fick fel vid stängning av '%-.192s' (Felkod: %M)"
        ukr "Не можу закрити '%-.192s' (помилка: %M)"
ER_ERROR_ON_READ  
        chi "读取文件'%-.200s'错误(错误号码:%M)"
        cze "Chyba při čtení souboru '%-.200s' (chybový kód: %M)"
        dan "Fejl ved læsning af '%-.200s' (Fejlkode: %M)"
        eng "Error reading file '%-.200s' (errno: %M)"
        est "Viga faili '%-.200s' lugemisel (veakood: %M)"
        fre "Erreur en lecture du fichier '%-.200s' (Errcode: %M)"
        ger "Fehler beim Lesen der Datei '%-.200s' (Fehler: %M)"
        greek "Πρόβλημα κατά την ανάγνωση του αρχείου '%-.200s' (κωδικός λάθους: %M)"
        hindi "फ़ाइल '%-.200s' पढ़ने में त्रुटि हुई (errno: %M)"
        hun "Hiba a '%-.200s'file olvasasakor. (hibakod: %M)"
        ita "Errore durante la lettura del file '%-.200s' (errno: %M)"
        jpn "ファイル '%-.200s' の読み込みエラー (エラー番号: %M)"
        kor "'%-.200s'화일 읽기 에러 (에러번호: %M)"
        nla "Fout bij het lezen van file '%-.200s' (Errcode: %M)"
        nor "Feil ved lesing av '%-.200s' (Feilkode: %M)"
        norwegian-ny "Feil ved lesing av '%-.200s' (Feilkode: %M)"
        pol "Bł?d podczas odczytu pliku '%-.200s' (Kod błędu: %M)"
        por "Erro ao ler arquivo '%-.200s' (erro no. %M)"
        rum "Eroare citind fisierul '%-.200s' (errno: %M)"
        rus "Ошибка чтения файла '%-.200s' (ошибка: %M)"
        serbian "Greška pri čitanju file-a '%-.200s' (errno: %M)"
        slo "Chyba pri čítaní súboru '%-.200s' (chybový kód: %M)"
        spa "Error leyendo el fichero/archivo '%-.200s' (Error: %M)"
        swe "Fick fel vid läsning av '%-.200s' (Felkod %M)"
        ukr "Не можу прочитати файл '%-.200s' (помилка: %M)"
ER_ERROR_ON_RENAME  
        chi "重命名'%-.210s'到'%-.210s'错误(错误号码:%M)"
        cze "Chyba při přejmenování '%-.210s' na '%-.210s' (chybový kód: %M)"
        dan "Fejl ved omdøbning af '%-.210s' til '%-.210s' (Fejlkode: %M)"
        eng "Error on rename of '%-.210s' to '%-.210s' (errno: %M)"
        est "Viga faili '%-.210s' ümbernimetamisel '%-.210s'-ks (veakood: %M)"
        fre "Erreur en renommant '%-.210s' en '%-.210s' (Errcode: %M)"
        ger "Fehler beim Umbenennen von '%-.210s' in '%-.210s' (Fehler: %M)"
        greek "Πρόβλημα κατά την μετονομασία του αρχείου '%-.210s' to '%-.210s' (κωδικός λάθους: %M)"
        hindi "'%-.210s' का नाम '%-.210s' बदलने पर त्रुटि हुई (errno: %M)"
        hun "Hiba a '%-.210s' file atnevezesekor '%-.210s'. (hibakod: %M)"
        ita "Errore durante la rinominazione da '%-.210s' a '%-.210s' (errno: %M)"
        jpn "'%-.210s' の名前を '%-.210s' に変更できません (エラー番号: %M)"
        kor "'%-.210s'를 '%-.210s'로 이름 변경중 에러 (에러번호: %M)"
        nla "Fout bij het hernoemen van '%-.210s' naar '%-.210s' (Errcode: %M)"
        nor "Feil ved omdøping av '%-.210s' til '%-.210s' (Feilkode: %M)"
        norwegian-ny "Feil ved omdøyping av '%-.210s' til '%-.210s' (Feilkode: %M)"
        pol "Bł?d podczas zmieniania nazwy '%-.210s' na '%-.210s' (Kod błędu: %M)"
        por "Erro ao renomear '%-.210s' para '%-.210s' (erro no. %M)"
        rum "Eroare incercind sa renumesc '%-.210s' in '%-.210s' (errno: %M)"
        rus "Ошибка при переименовании '%-.210s' в '%-.210s' (ошибка: %M)"
        serbian "Greška pri promeni imena '%-.210s' na '%-.210s' (errno: %M)"
        slo "Chyba pri premenovávaní '%-.210s' na '%-.210s' (chybový kód: %M)"
        spa "Error en el renombrado de '%-.210s' a '%-.210s' (Error: %M)"
        swe "Kan inte byta namn från '%-.210s' till '%-.210s' (Felkod: %M)"
        ukr "Не можу перейменувати '%-.210s' у '%-.210s' (помилка: %M)"
ER_ERROR_ON_WRITE  
        chi "写文件'%-.200s'错误(错误号码:%M)"
        cze "Chyba při zápisu do souboru '%-.200s' (chybový kód: %M)"
        dan "Fejl ved skriving av filen '%-.200s' (Fejlkode: %M)"
        eng "Error writing file '%-.200s' (errno: %M)"
        est "Viga faili '%-.200s' kirjutamisel (veakood: %M)"
        fre "Erreur d'écriture du fichier '%-.200s' (Errcode: %M)"
        ger "Fehler beim Speichern der Datei '%-.200s' (Fehler: %M)"
        greek "Πρόβλημα κατά την αποθήκευση του αρχείου '%-.200s' (κωδικός λάθους: %M)"
        hindi "फ़ाइल '%-.200s' लिखने में त्रुटि हुई (errno: %M)"
        hun "Hiba a '%-.200s' file irasakor. (hibakod: %M)"
        ita "Errore durante la scrittura del file '%-.200s' (errno: %M)"
        jpn "ファイル '%-.200s' の書き込みエラー (エラー番号: %M)"
        kor "'%-.200s'화일 기록 중 에러 (에러번호: %M)"
        nla "Fout bij het wegschrijven van file '%-.200s' (Errcode: %M)"
        nor "Feil ved skriving av fila '%-.200s' (Feilkode: %M)"
        norwegian-ny "Feil ved skriving av fila '%-.200s' (Feilkode: %M)"
        pol "Bł?d podczas zapisywania pliku '%-.200s' (Kod błędu: %M)"
        por "Erro ao gravar arquivo '%-.200s' (erro no. %M)"
        rum "Eroare scriind fisierul '%-.200s' (errno: %M)"
        rus "Ошибка записи в файл '%-.200s' (ошибка: %M)"
        serbian "Greška pri upisu '%-.200s' (errno: %M)"
        slo "Chyba pri zápise do súboru '%-.200s' (chybový kód: %M)"
        spa "Error escribiendo el fichero/archivo '%-.200s' (Error: %M)"
        swe "Fick fel vid skrivning till '%-.200s' (Felkod %M)"
        ukr "Не можу записати файл '%-.200s' (помилка: %M)"
ER_FILE_USED  
        chi "'%-.192s'被锁定,不能改变"
        cze "'%-.192s' je zamčen proti změnám"
        dan "'%-.192s' er låst mod opdateringer"
        eng "'%-.192s' is locked against change"
        est "'%-.192s' on lukustatud muudatuste vastu"
        fre "'%-.192s' est verrouillé contre les modifications"
        ger "'%-.192s' ist für Änderungen gesperrt"
        greek "'%-.192s' δεν επιτρέπονται αλλαγές"
        hindi "फ़ाइल '%-.192s' में कोई बदलाव नहीं कर सकते"
        hun "'%-.192s' a valtoztatas ellen zarolva"
        ita "'%-.192s' e` soggetto a lock contro i cambiamenti"
        jpn "'%-.192s' はロックされています。"
        kor "'%-.192s'가 변경할 수 없도록 잠겨있습니다."
        nla "'%-.192s' is geblokeerd tegen veranderingen"
        nor "'%-.192s' er låst mot oppdateringer"
        norwegian-ny "'%-.192s' er låst mot oppdateringar"
        pol "'%-.192s' jest zablokowany na wypadek zmian"
        por "'%-.192s' está com travamento contra alterações"
        rum "'%-.192s' este blocat pentry schimbari (loccked against change)"
        rus "'%-.192s' заблокирован для изменений"
        serbian "'%-.192s' je zaključan za upis"
        slo "'%-.192s' je zamknutý proti zmenám"
        spa "'%-.192s' esta bloqueado contra cambios"
        swe "'%-.192s' är låst mot användning"
        ukr "'%-.192s' заблокований на внесення змін"
ER_FILSORT_ABORT  
        chi "排序中止"
        cze "Třídění přerušeno"
        dan "Sortering afbrudt"
        eng "Sort aborted"
        est "Sorteerimine katkestatud"
        fre "Tri alphabétique abandonné"
        ger "Sortiervorgang abgebrochen"
        greek "Η διαδικασία ταξινόμισης ακυρώθηκε"
        hindi "SORT निरस्त"
        hun "Sikertelen rendezes"
        ita "Operazione di ordinamento abbandonata"
        jpn "ソート処理を中断しました。"
        kor "소트가 중단되었습니다."
        nla "Sorteren afgebroken"
        nor "Sortering avbrutt"
        norwegian-ny "Sortering avbrote"
        pol "Sortowanie przerwane"
        por "Ordenação abortada"
        rum "Sortare intrerupta"
        rus "Сортировка прервана"
        serbian "Sortiranje je prekinuto"
        slo "Triedenie prerušené"
        spa "Ordenación cancelada"
        swe "Sorteringen avbruten"
        ukr "Сортування перервано"
ER_FORM_NOT_FOUND  
        chi "视图'%-.192s'不存在'%-.192s'"
        cze "Pohled '%-.192s' pro '%-.192s' neexistuje"
        dan "View '%-.192s' eksisterer ikke for '%-.192s'"
        eng "View '%-.192s' doesn't exist for '%-.192s'"
        est "Vaade '%-.192s' ei eksisteeri '%-.192s' jaoks"
        fre "La vue (View) '%-.192s' n'existe pas pour '%-.192s'"
        ger "View '%-.192s' existiert für '%-.192s' nicht"
        greek "Το View '%-.192s' δεν υπάρχει για '%-.192s'"
        hindi "VIEW '%-.192s', '%-.192s' के लिए मौजूद नहीं है"
        hun "A(z) '%-.192s' nezet nem letezik a(z) '%-.192s'-hoz"
        ita "La view '%-.192s' non esiste per '%-.192s'"
        jpn "ビュー '%-.192s' は '%-.192s' に存在しません。"
        kor "뷰 '%-.192s'가 '%-.192s'에서는 존재하지 않습니다."
        nla "View '%-.192s' bestaat niet voor '%-.192s'"
        nor "View '%-.192s' eksisterer ikke for '%-.192s'"
        norwegian-ny "View '%-.192s' eksisterar ikkje for '%-.192s'"
        pol "Widok '%-.192s' nie istnieje dla '%-.192s'"
        por "Visão '%-.192s' não existe para '%-.192s'"
        rum "View '%-.192s' nu exista pentru '%-.192s'"
        rus "Представление '%-.192s' не существует для '%-.192s'"
        serbian "View '%-.192s' ne postoji za '%-.192s'"
        slo "Pohľad '%-.192s' neexistuje pre '%-.192s'"
        spa "La vista '%-.192s' no existe para '%-.192s'"
        swe "Formulär '%-.192s' finns inte i '%-.192s'"
        ukr "Вигляд '%-.192s' не існує для '%-.192s'"
ER_GET_ERRNO  
        chi "错误 %M, 来自存储引擎 %s"
        eng "Got error %M from storage engine %s"
        fre "Reçu l'erreur %M du handler de la table %s"
        ger "Fehler %M von Speicher-Engine %s"
        greek "Ελήφθη μήνυμα λάθους %M από τον χειριστή πίνακα (table handler) %s"
        hindi "%M त्रुटि %s स्टोरेज इंजन से"
        ita "Rilevato l'errore %M dal gestore delle tabelle %s"
        nla "Fout %M van tabel handler %s"
        nor "Mottok feil %M fra tabell håndterer %s"
        norwegian-ny "Mottok feil %M fra tabell handterar %s"
        pol "Otrzymano bł?d %M z obsługi tabeli %s"
        por "Obteve erro %M no manipulador de tabelas %s"
        rum "Eroarea %M obtinuta din handlerul tabelei %s"
        rus "Получена ошибка %M от обработчика таблиц %s"
        spa "Obtenido error %M desde el motor de almacenaje %s"
        swe "Fick felkod %M från databashanteraren %s"
        ukr "Отримано помилку %M від дескриптора таблиці %s"
ER_ILLEGAL_HA  
        chi "存储引擎%s %`s.%`s 表没有该选项"
        eng "Storage engine %s of the table %`s.%`s doesn't have this option"
        ger "Diese Option gibt es nicht in Speicher-Engine %s für %`s.%`s"
        hindi "स्टोरेज इंजन %s में यह विकल्प उपलब्ध नहीं है (टेबल: %`s.%`s)"
        rus "Обработчик %s таблицы %`s.%`s не поддерживает эту возможность"
        spa "El motor de almacenaje %s de la tabla %`s.%`s no contiene esta opción"
        ukr "Дескриптор %s таблиці %`s.%`s не має цієї властивості"
ER_KEY_NOT_FOUND  
        chi "无法在'%-.192s'中找到记录"
        cze "Nemohu najít záznam v '%-.192s'"
        dan "Kan ikke finde posten i '%-.192s'"
        eng "Can't find record in '%-.192s'"
        est "Ei suuda leida kirjet '%-.192s'-s"
        fre "Ne peut trouver l'enregistrement dans '%-.192s'"
        ger "Kann Datensatz in '%-.192s' nicht finden"
        greek "Αδύνατη η ανεύρεση εγγραφής στο '%-.192s'"
        hindi "'%-.192s' में रिकॉर्ड नहीं मिला"
        hun "Nem talalhato a rekord '%-.192s'-ben"
        ita "Impossibile trovare il record in '%-.192s'"
        jpn "'%-.192s' にレコードが見つかりません。"
        kor "'%-.192s'에서 레코드를 찾을 수 없습니다."
        nla "Kan record niet vinden in '%-.192s'"
        nor "Kan ikke finne posten i '%-.192s'"
        norwegian-ny "Kan ikkje finne posten i '%-.192s'"
        pol "Nie można znaleĽć rekordu w '%-.192s'"
        por "Não pode encontrar registro em '%-.192s'"
        rum "Nu pot sa gasesc recordul in '%-.192s'"
        rus "Невозможно найти запись в '%-.192s'"
        serbian "Ne mogu da pronađem slog u '%-.192s'"
        slo "Nemôžem nájsť záznam v '%-.192s'"
        spa "No puedo encontrar el registro en '%-.192s'"
        swe "Hittar inte posten '%-.192s'"
        ukr "Не можу записати у '%-.192s'"
ER_NOT_FORM_FILE  
        chi "文件中的信息不正确:'%-.200s'"
        cze "Nesprávná informace v souboru '%-.200s'"
        dan "Forkert indhold i: '%-.200s'"
        eng "Incorrect information in file: '%-.200s'"
        est "Vigane informatsioon failis '%-.200s'"
        fre "Information erronnée dans le fichier: '%-.200s'"
        ger "Falsche Information in Datei '%-.200s'"
        greek "Λάθος πληροφορίες στο αρχείο: '%-.200s'"
        hindi "फ़ाइल '%-.200s' में गलत जानकारी है"
        hun "Ervenytelen info a file-ban: '%-.200s'"
        ita "Informazione errata nel file: '%-.200s'"
        jpn "ファイル '%-.200s' 内の情報が不正です。"
        kor "화일의 부정확한 정보: '%-.200s'"
        nla "Verkeerde info in file: '%-.200s'"
        nor "Feil informasjon i filen: '%-.200s'"
        norwegian-ny "Feil informasjon i fila: '%-.200s'"
        pol "Niewła?ciwa informacja w pliku: '%-.200s'"
        por "Informação incorreta no arquivo '%-.200s'"
        rum "Informatie incorecta in fisierul: '%-.200s'"
        rus "Некорректная информация в файле '%-.200s'"
        serbian "Pogrešna informacija u file-u: '%-.200s'"
        slo "Nesprávna informácia v súbore: '%-.200s'"
        spa "Información incorrecta en el fichero/archivo: '%-.200s'"
        swe "Felaktig fil: '%-.200s'"
        ukr "Хибна інформація у файлі: '%-.200s'"
ER_NOT_KEYFILE  
        chi "表'%-.200s'的索引损坏;试着修复"
        cze "Nesprávný klíč pro tabulku '%-.200s'; pokuste se ho opravit"
        dan "Fejl i indeksfilen til tabellen '%-.200s'; prøv at reparere den"
        eng "Index for table '%-.200s' is corrupt; try to repair it"
        est "Tabeli '%-.200s' võtmefail on vigane; proovi seda parandada"
        fre "Index corrompu dans la table: '%-.200s'; essayez de le réparer"
        ger "Fehlerhafte Index-Datei für Tabelle '%-.200s'; versuche zu reparieren"
        greek "Λάθος αρχείο ταξινόμισης (key file) για τον πίνακα: '%-.200s'; Παρακαλώ, διορθώστε το!"
        hindi "टेबल '%-.200s' का इंडेक्स CORRUPT हो गया है; इसे REPAIR करने की कोशिश करें"
        hun "Ervenytelen kulcsfile a tablahoz: '%-.200s'; probalja kijavitani!"
        ita "File chiave errato per la tabella : '%-.200s'; prova a riparalo"
        jpn "表 '%-.200s' の索引ファイル(key file)の内容が不正です。修復を試行してください。"
        kor "'%-.200s' 테이블의 부정확한 키 존재. 수정하시오!"
        nla "Verkeerde zoeksleutel file voor tabel: '%-.200s'; probeer het te repareren"
        nor "Tabellen '%-.200s' har feil i nøkkelfilen; forsøk å reparer den"
        norwegian-ny "Tabellen '%-.200s' har feil i nykkelfila; prøv å reparere den"
        pol "Niewła?ciwy plik kluczy dla tabeli: '%-.200s'; spróbuj go naprawić"
        por "Arquivo de índice incorreto para tabela '%-.200s'; tente repará-lo"
        rum "Cheia fisierului incorecta pentru tabela: '%-.200s'; incearca s-o repari"
        rus "Некорректный индексный файл для таблицы: '%-.200s'. Попробуйте восстановить его"
        serbian "Pogrešan key file za tabelu: '%-.200s'; probajte da ga ispravite"
        slo "Nesprávny kľúč pre tabuľku '%-.200s'; pokúste sa ho opraviť"
        spa "El índice para la tabla: '%-.200s' está corrupto; intente repararlo"
        swe "Fatalt fel vid hantering av register '%-.200s'; kör en reparation"
        ukr "Хибний файл ключей для таблиці: '%-.200s'; Спробуйте його відновити"
ER_OLD_KEYFILE  
        chi "表'%-.192s'的老索引文件损坏; 修复!"
        cze "Starý klíčový soubor pro '%-.192s'; opravte ho"
        dan "Gammel indeksfil for tabellen '%-.192s'; reparer den"
        eng "Old key file for table '%-.192s'; repair it!"
        est "Tabeli '%-.192s' võtmefail on aegunud; paranda see!"
        fre "Vieux fichier d'index pour la table '%-.192s'; réparez le!"
        ger "Alte Index-Datei für Tabelle '%-.192s'. Bitte reparieren"
        greek "Παλαιό αρχείο ταξινόμισης (key file) για τον πίνακα '%-.192s'; Παρακαλώ, διορθώστε το!"
        hindi "टेबल '%-.192s' के लिए पुरानी KEY फ़ाइल; इसे REPAIR करने की कोशिश करें"
        hun "Regi kulcsfile a '%-.192s'tablahoz; probalja kijavitani!"
        ita "File chiave vecchio per la tabella '%-.192s'; riparalo!"
        jpn "表 '%-.192s' の索引ファイル(key file)は古い形式です。修復してください。"
        kor "'%-.192s' 테이블의 이전버젼의 키 존재. 수정하시오!"
        nla "Oude zoeksleutel file voor tabel '%-.192s'; repareer het!"
        nor "Gammel nøkkelfil for tabellen '%-.192s'; reparer den!"
        norwegian-ny "Gammel nykkelfil for tabellen '%-.192s'; reparer den!"
        pol "Plik kluczy dla tabeli '%-.192s' jest starego typu; napraw go!"
        por "Arquivo de índice desatualizado para tabela '%-.192s'; repare-o!"
        rum "Cheia fisierului e veche pentru tabela '%-.192s'; repar-o!"
        rus "Старый индексный файл для таблицы '%-.192s'; отремонтируйте его!"
        serbian "Zastareo key file za tabelu '%-.192s'; ispravite ga"
        slo "Starý kľúčový súbor pre '%-.192s'; opravte ho!"
        spa "Clave antigua de fichero/archivo para la tabla '%-.192s'; ¡repárela!"
        swe "Gammal nyckelfil '%-.192s'; reparera registret"
        ukr "Старий файл ключей для таблиці '%-.192s'; Відновіть його!"
ER_OPEN_AS_READONLY  
        chi "表'%-.192s'只可读"
        cze "'%-.192s' je jen pro čtení"
        dan "'%-.192s' er skrivebeskyttet"
        eng "Table '%-.192s' is read only"
        est "Tabel '%-.192s' on ainult lugemiseks"
        fre "'%-.192s' est en lecture seulement"
        ger "Tabelle '%-.192s' ist nur lesbar"
        greek "'%-.192s' επιτρέπεται μόνο η ανάγνωση"
        hindi "टेबल '%-.192s' READ-ONLY है"
        hun "'%-.192s' irasvedett"
        ita "'%-.192s' e` di sola lettura"
        jpn "表 '%-.192s' は読み込み専用です。"
        kor "테이블 '%-.192s'는 읽기전용 입니다."
        nla "'%-.192s' is alleen leesbaar"
        nor "'%-.192s' er skrivebeskyttet"
        norwegian-ny "'%-.192s' er skrivetryggja"
        pol "'%-.192s' jest tylko do odczytu"
        por "Tabela '%-.192s' é somente para leitura"
        rum "Tabela '%-.192s' e read-only"
        rus "Таблица '%-.192s' предназначена только для чтения"
        serbian "Tabelu '%-.192s' je dozvoljeno samo čitati"
        slo "'%-.192s' is čítať only"
        spa "La tabla '%-.192s' es de sólo lectura"
        swe "'%-.192s' är skyddad mot förändring"
        ukr "Таблиця '%-.192s' тільки для читання"
ER_OUTOFMEMORY HY001 S1001
        chi "内存不足; 重启后重试(需要 %d bytes)"
        cze "Málo paměti. Přestartujte daemona a zkuste znovu (je potřeba %d bytů)"
        dan "Ikke mere hukommelse. Genstart serveren og prøv igen (mangler %d bytes)"
        eng "Out of memory; restart server and try again (needed %d bytes)"
        est "Mälu  sai otsa. Proovi MariaDB uuesti käivitada (puudu jäi %d baiti)"
        fre "Manque de mémoire. Redémarrez le démon et ré-essayez (%d octets nécessaires)"
        ger "Kein Speicher vorhanden (%d Bytes benötigt). Bitte Server neu starten"
        greek "Δεν υπάρχει διαθέσιμη μνήμη. Προσπαθήστε πάλι, επανεκινώντας τη διαδικασία (demon) (χρειάζονται %d bytes)"
        hun "Nincs eleg memoria. Inditsa ujra a demont, es probalja ismet. (%d byte szukseges.)"
        ita "Memoria esaurita. Fai ripartire il demone e riprova (richiesti %d bytes)"
        jpn "メモリが不足しています。サーバーを再起動してみてください。(%d バイトの割り当てに失敗)"
        kor "Out of memory. 데몬을 재 실행 후 다시 시작하시오 (needed %d bytes)"
        nla "Geen geheugen meer. Herstart server en probeer opnieuw (%d bytes nodig)"
        nor "Ikke mer minne. Star på nytt tjenesten og prøv igjen (trengte %d byter)"
        norwegian-ny "Ikkje meir minne. Start på nytt tenesten og prøv igjen (trengte %d bytar)"
        pol "Zbyt mało pamięci. Uruchom ponownie demona i spróbuj ponownie (potrzeba %d bajtów)"
        por "Sem memória. Reinicie o programa e tente novamente (necessita de %d bytes)"
        rum "Out of memory. Porneste daemon-ul din nou si incearca inca o data (e nevoie de %d bytes)"
        rus "Недостаточно памяти. Перезапустите сервер и попробуйте еще раз (нужно %d байт)"
        serbian "Nema memorije. Restartujte MariaDB server i probajte ponovo (potrebno je %d byte-ova)"
        slo "Málo pamäti. Reštartujte daemona a skúste znova (je potrebných %d bytov)"
        spa "Memoria insuficiente. Reinicie el servidor e inténtelo otra vez (necesita %d bytes)"
        swe "Oväntat slut på minnet, starta om programmet och försök på nytt (Behövde %d bytes)"
        ukr "Брак пам'яті. Рестартуйте сервер та спробуйте знову (потрібно %d байтів)"
ER_OUT_OF_SORTMEMORY HY001 S1001
        chi "排序内存不足,可以考虑增加实例排序缓存量"
        cze "Málo paměti pro třídění. Zvyšte velikost třídícího bufferu"
        dan "Ikke mere sorteringshukommelse. Øg sorteringshukommelse (sort buffer size) for serveren"
        eng "Out of sort memory, consider increasing server sort buffer size"
        est "Mälu sai sorteerimisel otsa. Suurenda MariaDB-i sorteerimispuhvrit"
        fre "Manque de mémoire pour le tri. Augmentez-la"
        ger "Kein Speicher zum Sortieren vorhanden. sort_buffer_size sollte im Server erhöht werden"
        greek "Δεν υπάρχει διαθέσιμη μνήμη για ταξινόμιση. Αυξήστε το sort buffer size για τη διαδικασία (demon)"
        hun "Nincs eleg memoria a rendezeshez. Novelje a rendezo demon puffermeretet"
        ita "Memoria per gli ordinamenti esaurita. Incrementare il 'sort_buffer' al demone"
        jpn "ソートメモリが不足しています。ソートバッファサイズ(sort buffer size)の増加を検討してください。"
        kor "Out of sort memory. daemon sort buffer의 크기를 증가시키세요"
        nla "Geen geheugen om te sorteren. Verhoog de server sort buffer size"
        nor "Ikke mer sorteringsminne. Vurder å øke sorteringsminnet (sort buffer size) for tjenesten"
        norwegian-ny "Ikkje meir sorteringsminne. Vurder å auke sorteringsminnet (sorteringsbuffer storleik) for tenesten"
        pol "Zbyt mało pamięci dla sortowania. Zwiększ wielko?ć bufora demona dla sortowania"
        por "Não há memória suficiente para ordenação. Considere aumentar o tamanho do retentor (buffer) de ordenação"
        rum "Out of memory pentru sortare. Largeste marimea buffer-ului pentru sortare in daemon (sort buffer size)"
        rus "Недостаточно памяти для сортировки. Увеличьте размер буфера сортировки на сервере"
        serbian "Nema memorije za sortiranje. Povećajte veličinu sort buffer-a MariaDB server-u"
        slo "Málo pamäti pre triedenie, zvýšte veľkosť triediaceho bufferu"
        spa "Memoria de ordenación insuficiente. Considere el incrementar el tamaño del búfer de ordenación del servidor"
        swe "Sorteringsbufferten räcker inte till. Kontrollera startparametrarna"
        ukr "Брак пам'яті для сортування. Треба збільшити розмір буфера сортування у сервера"
ER_UNEXPECTED_EOF  
        chi "阅读文件'%-.192s'时出现意外的EOF(错误号码:%M)"
        cze "Neočekávaný konec souboru při čtení '%-.192s' (chybový kód: %M)"
        dan "Uventet afslutning på fil (eof) ved læsning af filen '%-.192s' (Fejlkode: %M)"
        eng "Unexpected EOF found when reading file '%-.192s' (errno: %M)"
        est "Ootamatu faililõpumärgend faili '%-.192s' lugemisel (veakood: %M)"
        fre "Fin de fichier inattendue en lisant '%-.192s' (Errcode: %M)"
        ger "Unerwartetes Ende beim Lesen der Datei '%-.192s' (Fehler: %M)"
        greek "Κατά τη διάρκεια της ανάγνωσης, βρέθηκε απροσδόκητα το τέλος του αρχείου '%-.192s' (κωδικός λάθους: %M)"
        hun "Varatlan filevege-jel a '%-.192s'olvasasakor. (hibakod: %M)"
        ita "Fine del file inaspettata durante la lettura del file '%-.192s' (errno: %M)"
        jpn "ファイル '%-.192s' を読み込み中に予期せずファイルの終端に達しました。(エラー番号: %M)"
        kor "'%-.192s' 화일을 읽는 도중 잘못된 eof을 발견 (에러번호: %M)"
        nla "Onverwachte eof gevonden tijdens het lezen van file '%-.192s' (Errcode: %M)"
        nor "Uventet slutt på fil (eof) ved lesing av filen '%-.192s' (Feilkode: %M)"
        norwegian-ny "Uventa slutt på fil (eof) ved lesing av fila '%-.192s' (Feilkode: %M)"
        pol "Nieoczekiwany 'eof' napotkany podczas czytania z pliku '%-.192s' (Kod błędu: %M)"
        por "Encontrado fim de arquivo inesperado ao ler arquivo '%-.192s' (erro no. %M)"
        rum "Sfirsit de fisier neasteptat in citirea fisierului '%-.192s' (errno: %M)"
        rus "Неожиданный конец файла '%-.192s' (ошибка: %M)"
        serbian "Neočekivani kraj pri čitanju file-a '%-.192s' (errno: %M)"
        slo "Neočakávaný koniec súboru pri čítaní '%-.192s' (chybový kód: %M)"
        spa "Inesperado fin de fichero/archivo mientras leíamos el fichero/archivo '%-.192s' (Error: %M)"
        swe "Oväntat filslut vid läsning från '%-.192s' (Felkod: %M)"
        ukr "Хибний кінець файлу '%-.192s' (помилка: %M)"
ER_CON_COUNT_ERROR 08004 
        chi "太多连接"
        cze "Příliš mnoho spojení"
        dan "For mange forbindelser (connections)"
        eng "Too many connections"
        est "Liiga palju samaaegseid ühendusi"
        fre "Trop de connexions"
        ger "Zu viele Verbindungen"
        greek "Υπάρχουν πολλές συνδέσεις..."
        hindi "अत्यधिक कनेक्शन"
        hun "Tul sok kapcsolat"
        ita "Troppe connessioni"
        jpn "接続が多すぎます。"
        kor "너무 많은 연결... max_connection을 증가 시키시오..."
        nla "Te veel verbindingen"
        nor "For mange tilkoblinger (connections)"
        norwegian-ny "For mange tilkoplingar (connections)"
        pol "Zbyt wiele poł?czeń"
        por "Excesso de conexões"
        rum "Prea multe conectiuni"
        rus "Слишком много соединений"
        serbian "Previše konekcija"
        slo "Príliš mnoho spojení"
        spa "Demasiadas conexiones"
        swe "För många anslutningar"
        ukr "Забагато з'єднань"
ER_OUT_OF_RESOURCES  
        chi "内存不足."
        cze "Málo prostoru/paměti pro thread"
        dan "Udgået for tråde/hukommelse"
        eng "Out of memory."
        est "Mälu sai otsa. Võimalik, et aitab swap-i lisamine või käsu 'ulimit' abil MariaDB-le rohkema mälu kasutamise lubamine"
        fre "Manque de 'threads'/mémoire"
        ger "Kein Speicher mehr vorhanden."
        greek "Πρόβλημα με τη διαθέσιμη μνήμη (Out of thread space/memory)"
        hun "Elfogyott a thread-memoria"
        ita "Fine dello spazio/memoria per i thread"
        jpn "メモリが不足しています。mariadbd やその他のプロセスがメモリーを使い切っていないか確認して下さい。メモリーを使い切っていない場合、'ulimit'の設定等で mariadbd のメモリー使用最大量を多くするか、スワップ領域を増やす必要があるかもしれません。"
# This message failed to convert from euc-kr, skipped
        nla "Geen thread geheugen meer; controleer of mariadbd of andere processen al het beschikbare geheugen gebruikt. Zo niet, dan moet u wellicht 'ulimit' gebruiken om mariadbd toe te laten meer geheugen te benutten, of u kunt extra swap ruimte toevoegen"
        nor "Tomt for tråd plass/minne"
        norwegian-ny "Tomt for tråd plass/minne"
        pol "Zbyt mało miejsca/pamięci dla w?tku"
        por "Sem memória."
        rum "Out of memory."
        rus "Недостаточно памяти."
        serbian "Nema memorije."
        slo "Málo miesta-pamäti pre vlákno"
        spa "Memoria agotada"
        swe "Fick slut på minnet."
        ukr "Брак пам'яті."
ER_BAD_HOST_ERROR 08S01 
        chi "不能从你的地址获取主机名称"
        cze "Nemohu zjistit jméno stroje pro Vaši adresu"
        dan "Kan ikke få værtsnavn for din adresse"
        eng "Can't get hostname for your address"
        est "Ei suuda lahendada IP aadressi masina nimeks"
        fre "Ne peut obtenir de hostname pour votre adresse"
        ger "Kann Hostnamen für diese Adresse nicht erhalten"
        greek "Δεν έγινε γνωστό το hostname για την address σας"
        hindi "आपके I.P. ऐड्रेस के लिए होस्टनेम प्राप्त करने में विफल रहे"
        hun "A gepnev nem allapithato meg a cimbol"
        ita "Impossibile risalire al nome dell'host dall'indirizzo (risoluzione inversa)"
        jpn "IPアドレスからホスト名を解決できません。"
        kor "당신의 컴퓨터의 호스트이름을 얻을 수 없습니다."
        nla "Kan de hostname niet krijgen van uw adres"
        nor "Kan ikke få tak i vertsnavn for din adresse"
        norwegian-ny "Kan ikkje få tak i vertsnavn for di adresse"
        pol "Nie można otrzymać nazwy hosta dla twojego adresu"
        por "Não pode obter nome do 'host' para seu endereço"
        rum "Nu pot sa obtin hostname-ul adresei tale"
        rus "Невозможно получить имя хоста для вашего адреса"
        serbian "Ne mogu da dobijem ime host-a za vašu IP adresu"
        slo "Nemôžem zistiť meno hostiteľa pre vašu adresu"
        spa "No puedo obtener el nombre de equipo de la dirección de vd."
        swe "Kan inte hitta 'hostname' för din adress"
        ukr "Не можу визначити ім'я хосту для вашої адреси"
ER_HANDSHAKE_ERROR 08S01 
        chi "坏握手"
        cze "Chyba při ustavování spojení"
        dan "Forkert håndtryk (handshake)"
        eng "Bad handshake"
        est "Väär handshake"
        fre "Mauvais 'handshake'"
        ger "Ungültiger Handshake"
        greek "Η αναγνώριση (handshake) δεν έγινε σωστά"
        hindi "संपर्क स्थापित करते समय त्रुटि हुई (BAD HANDSHAKE)"
        hun "A kapcsolatfelvetel nem sikerult (Bad handshake)"
        ita "Negoziazione impossibile"
        jpn "ハンドシェイクエラー"
        nla "Verkeerde handshake"
        nor "Feil håndtrykk (handshake)"
        norwegian-ny "Feil handtrykk (handshake)"
        pol "Zły uchwyt(handshake)"
        por "Negociação de acesso falhou"
        rum "Prost inceput de conectie (bad handshake)"
        rus "Некорректное приветствие"
        serbian "Loš početak komunikacije (handshake)"
        slo "Chyba pri nadväzovaní spojenia"
        spa "Mal apretón de manos (handshake)"
        swe "Fel vid initiering av kommunikationen med klienten"
        ukr "Невірна установка зв'язку"
ER_DBACCESS_DENIED_ERROR 42000 
        chi "用户'%s'@'%s'无权访问数据库'%-.192s'"
        cze "Přístup pro uživatele '%s'@'%s' k databázi '%-.192s' není povolen"
        dan "Adgang nægtet bruger: '%s'@'%s' til databasen '%-.192s'"
        eng "Access denied for user '%s'@'%s' to database '%-.192s'"
        est "Ligipääs keelatud kasutajale '%s'@'%s' andmebaasile '%-.192s'"
        fre "Accès refusé pour l'utilisateur: '%s'@'%s'. Base '%-.192s'"
        ger "Benutzer '%s'@'%s' hat keine Zugriffsberechtigung für Datenbank '%-.192s'"
        greek "Δεν επιτέρεται η πρόσβαση στο χρήστη: '%s'@'%s' στη βάση δεδομένων '%-.192s'"
        hindi "यूज़र '%s'@'%s' को डेटाबेस '%-.192s' की अनुमति नहीं है"
        hun "A(z) '%s'@'%s' felhasznalo szamara tiltott eleres az '%-.192s' adabazishoz"
        ita "Accesso non consentito per l'utente: '%s'@'%s' al database '%-.192s'"
        jpn "ユーザー '%s'@'%s' の '%-.192s' データベースへのアクセスを拒否します"
        kor "'%s'@'%s' 사용자는 '%-.192s' 데이타베이스에 접근이 거부 되었습니다."
        nla "Toegang geweigerd voor gebruiker: '%s'@'%s' naar database '%-.192s'"
        nor "Tilgang nektet for bruker: '%s'@'%s' til databasen '%-.192s' nektet"
        norwegian-ny "Tilgang ikkje tillate for brukar: '%s'@'%s' til databasen '%-.192s' nekta"
        por "Acesso negado para o usuário '%s'@'%s' ao banco de dados '%-.192s'"
        rum "Acces interzis pentru utilizatorul: '%s'@'%s' la baza de date '%-.192s'"
        rus "Для пользователя '%s'@'%s' доступ к базе данных '%-.192s' закрыт"
        serbian "Pristup je zabranjen korisniku '%s'@'%s' za bazu '%-.192s'"
        slo "Zakázaný prístup pre užívateľa: '%s'@'%s' k databázi '%-.192s'"
        spa "Acceso denegado para usuario: '%s'@'%s' a la base de datos '%-.192s'"
        swe "Användare '%s'@'%s' är ej berättigad att använda databasen %-.192s"
        ukr "Доступ заборонено для користувача: '%s'@'%s' до бази данних '%-.192s'"
ER_ACCESS_DENIED_ERROR 28000 
        chi "'%s'@'%s' 用户无权访问 (使用密码: %s)"
        cze "Přístup pro uživatele '%s'@'%s' (s heslem %s)"
        dan "Adgang nægtet bruger: '%s'@'%s' (Bruger adgangskode: %s)"
        eng "Access denied for user '%s'@'%s' (using password: %s)"
        est "Ligipääs keelatud kasutajale '%s'@'%s' (kasutab parooli: %s)"
        fre "Accès refusé pour l'utilisateur: '%s'@'%s' (mot de passe: %s)"
        ger "Benutzer '%s'@'%s' hat keine Zugriffsberechtigung (verwendetes Passwort: %s)"
        greek "Δεν επιτέρεται η πρόσβαση στο χρήστη: '%s'@'%s' (χρήση password: %s)"
        hindi "यूज़र '%s'@'%s' को अनुमति नहीं है (पासवर्ड का उपयोग: %s)"
        hun "A(z) '%s'@'%s' felhasznalo szamara tiltott eleres. (Hasznalja a jelszot: %s)"
        ita "Accesso non consentito per l'utente: '%s'@'%s' (Password: %s)"
        jpn "ユーザー '%s'@'%s' を拒否します.uUsing password: %s)"
        kor "'%s'@'%s' 사용자는 접근이 거부 되었습니다. (using password: %s)"
        nla "Toegang geweigerd voor gebruiker: '%s'@'%s' (Wachtwoord gebruikt: %s)"
        nor "Tilgang nektet for bruker: '%s'@'%s' (Bruker passord: %s)"
        norwegian-ny "Tilgang ikke tillate for brukar: '%s'@'%s' (Brukar passord: %s)"
        por "Acesso negado para o usuário '%s'@'%s' (senha usada: %s)"
        rum "Acces interzis pentru utilizatorul: '%s'@'%s' (Folosind parola: %s)"
        rus "Доступ закрыт для пользователя '%s'@'%s' (был использован пароль: %s)"
        serbian "Pristup je zabranjen korisniku '%s'@'%s' (koristi lozinku: '%s')"
        slo "Zakázaný prístup pre užívateľa: '%s'@'%s' (použitie hesla: %s)"
        spa "Acceso denegado para usuario: '%s'@'%s' (Usando contraseña: %s)"
        swe "Användare '%s'@'%s' är ej berättigad att logga in (Använder lösen: %s)"
        ukr "Доступ заборонено для користувача: '%s'@'%s' (Використано пароль: %s)"
ER_NO_DB_ERROR 3D000 
        chi "没有选择数据库"
        cze "Nebyla vybrána žádná databáze"
        dan "Ingen database valgt"
        eng "No database selected"
        est "Andmebaasi ei ole valitud"
        fre "Aucune base n'a été sélectionnée"
        ger "Keine Datenbank ausgewählt"
        greek "Δεν επιλέχθηκε βάση δεδομένων"
        hindi "किसी भी डेटाबेस का चयन नहीं किया गया है"
        hun "Nincs kivalasztott adatbazis"
        ita "Nessun database selezionato"
        jpn "データベースが選択されていません。"
        kor "선택된 데이타베이스가 없습니다."
        nla "Geen database geselecteerd"
        nor "Ingen database valgt"
        norwegian-ny "Ingen database vald"
        pol "Nie wybrano żadnej bazy danych"
        por "Nenhum banco de dados foi selecionado"
        rum "Nici o baza de data nu a fost selectata inca"
        rus "База данных не выбрана"
        serbian "Ni jedna baza nije selektovana"
        slo "Nebola vybraná databáza"
        spa "Base de datos no seleccionada"
        swe "Ingen databas i användning"
        ukr "Базу данних не вибрано"
ER_UNKNOWN_COM_ERROR 08S01 
        chi "未知的命令"
        cze "Neznámý příkaz"
        dan "Ukendt kommando"
        eng "Unknown command"
        est "Tundmatu käsk"
        fre "Commande inconnue"
        ger "Unbekannter Befehl"
        greek "Αγνωστη εντολή"
        hindi "अज्ञात आदेश"
        hun "Ervenytelen parancs"
        ita "Comando sconosciuto"
        jpn "不明なコマンドです。"
        kor "명령어가 뭔지 모르겠어요..."
        nla "Onbekend commando"
        nor "Ukjent kommando"
        norwegian-ny "Ukjent kommando"
        pol "Nieznana komenda"
        por "Comando desconhecido"
        rum "Comanda invalida"
        rus "Неизвестная команда коммуникационного протокола"
        serbian "Nepoznata komanda"
        slo "Neznámy príkaz"
        spa "Comando desconocido"
        swe "Okänt kommando"
        ukr "Невідома команда"
ER_BAD_NULL_ERROR 23000 
        chi "列'%-.192s'不能为NULL"
        cze "Sloupec '%-.192s' nemůže být null"
        dan "Kolonne '%-.192s' kan ikke være NULL"
        eng "Column '%-.192s' cannot be null"
        est "Tulp '%-.192s' ei saa omada nullväärtust"
        fre "Le champ '%-.192s' ne peut être vide (null)"
        ger "Feld '%-.192s' darf nicht NULL sein"
        greek "Το πεδίο '%-.192s' δεν μπορεί να είναι κενό (null)"
        hindi "काँलम '%-.192s' NULL नहीं हो सकता"
        hun "A(z) '%-.192s' oszlop erteke nem lehet nulla"
        ita "La colonna '%-.192s' non puo` essere nulla"
        jpn "列 '%-.192s' は null にできません。"
        kor "칼럼 '%-.192s'는 널(Null)이 되면 안됩니다. "
        nla "Kolom '%-.192s' kan niet null zijn"
        nor "Kolonne '%-.192s' kan ikke vere null"
        norwegian-ny "Kolonne '%-.192s' kan ikkje vere null"
        pol "Kolumna '%-.192s' nie może być null"
        por "Coluna '%-.192s' não pode ser vazia"
        rum "Coloana '%-.192s' nu poate sa fie null"
        rus "Столбец '%-.192s' не может принимать величину NULL"
        serbian "Kolona '%-.192s' ne može biti NULL"
        slo "Pole '%-.192s' nemôže byť null"
        spa "La columna '%-.192s' no puede ser nula"
        swe "Kolumn '%-.192s' får inte vara NULL"
        ukr "Стовбець '%-.192s' не може бути нульовим"
ER_BAD_DB_ERROR 42000 
        chi "未知数据库'%-.192s'"
        cze "Neznámá databáze '%-.192s'"
        dan "Ukendt database '%-.192s'"
        eng "Unknown database '%-.192s'"
        est "Tundmatu andmebaas '%-.192s'"
        fre "Base '%-.192s' inconnue"
        ger "Unbekannte Datenbank '%-.192s'"
        greek "Αγνωστη βάση δεδομένων '%-.192s'"
        hindi "अज्ञात डाटाबेस '%-.192s'"
        hun "Ervenytelen adatbazis: '%-.192s'"
        ita "Database '%-.192s' sconosciuto"
        jpn "'%-.192s' は不明なデータベースです。"
        kor "데이타베이스 '%-.192s'는 알수 없음"
        nla "Onbekende database '%-.192s'"
        nor "Ukjent database '%-.192s'"
        norwegian-ny "Ukjent database '%-.192s'"
        pol "Nieznana baza danych '%-.192s'"
        por "Banco de dados '%-.192s' desconhecido"
        rum "Baza de data invalida '%-.192s'"
        rus "Неизвестная база данных '%-.192s'"
        serbian "Nepoznata baza '%-.192s'"
        slo "Neznáma databáza '%-.192s'"
        spa "Base de datos '%-.192s' desconocida"
        swe "Okänd databas: '%-.192s'"
        ukr "Невідома база данних '%-.192s'"
ER_TABLE_EXISTS_ERROR 42S01 
        chi "表'%-.192s'已经存在"
        cze "Tabulka '%-.192s' již existuje"
        dan "Tabellen '%-.192s' findes allerede"
        eng "Table '%-.192s' already exists"
        est "Tabel '%-.192s' juba eksisteerib"
        fre "La table '%-.192s' existe déjà"
        ger "Tabelle '%-.192s' bereits vorhanden"
        greek "Ο πίνακας '%-.192s' υπάρχει ήδη"
        hindi "टेबल '%-.192s' पहले से ही मौजूद है"
        hun "A(z) '%-.192s' tabla mar letezik"
        ita "La tabella '%-.192s' esiste gia`"
        jpn "表 '%-.192s' はすでに存在します。"
        kor "테이블 '%-.192s'는 이미 존재함"
        nla "Tabel '%-.192s' bestaat al"
        nor "Tabellen '%-.192s' eksisterer allerede"
        norwegian-ny "Tabellen '%-.192s' eksisterar allereide"
        pol "Tabela '%-.192s' już istnieje"
        por "Tabela '%-.192s' já existe"
        rum "Tabela '%-.192s' exista deja"
        rus "Таблица '%-.192s' уже существует"
        serbian "Tabela '%-.192s' već postoji"
        slo "Tabuľka '%-.192s' už existuje"
        spa "La tabla '%-.192s' ya existe"
        swe "Tabellen '%-.192s' finns redan"
        ukr "Таблиця '%-.192s' вже існує"
ER_BAD_TABLE_ERROR 42S02 
        chi "未知表'%-.100T'"
        cze "Neznámá tabulka '%-.100T'"
        dan "Ukendt tabel '%-.100T'"
        eng "Unknown table '%-.100T'"
        est "Tundmatu tabel '%-.100T'"
        fre "Table '%-.100T' inconnue"
        ger "Unbekannte Tabelle '%-.100T'"
        greek "Αγνωστος πίνακας '%-.100T'"
        hindi "अज्ञात टेबल '%-.100T'"
        hun "Ervenytelen tabla: '%-.100T'"
        ita "Tabella '%-.100T' sconosciuta"
        jpn "'%-.100T' は不明な表です。"
        kor "테이블 '%-.100T'는 알수 없음"
        nla "Onbekende tabel '%-.100T'"
        nor "Ukjent tabell '%-.100T'"
        norwegian-ny "Ukjent tabell '%-.100T'"
        pol "Nieznana tabela '%-.100T'"
        por "Tabela '%-.100T' desconhecida"
        rum "Tabela '%-.100T' este invalida"
        rus "Неизвестная таблица '%-.100T'"
        serbian "Nepoznata tabela '%-.100T'"
        slo "Neznáma tabuľka '%-.100T'"
        spa "Tabla '%-.100T' no reconocida"
        swe "Okänd tabell '%-.100T'"
        ukr "Невідома таблиця '%-.100T'"
ER_NON_UNIQ_ERROR 23000 
        chi "列名 '%-.192s' 在 %-.192s 定义模糊"
        cze "Sloupec '%-.192s' v %-.192s není zcela jasný"
        dan "Felt: '%-.192s' i tabel %-.192s er ikke entydigt"
        eng "Column '%-.192s' in %-.192s is ambiguous"
        est "Väli '%-.192s' %-.192s-s ei ole ühene"
        fre "Champ: '%-.192s' dans %-.192s est ambigu"
        ger "Feld '%-.192s' in %-.192s ist nicht eindeutig"
        greek "Το πεδίο: '%-.192s' σε %-.192s δεν έχει καθοριστεί"
        hindi "काँलम '%-.192s' अस्पष्ट है (टेबल: %-.192s)"
        hun "A(z) '%-.192s' oszlop %-.192s-ben ketertelmu"
        ita "Colonna: '%-.192s' di %-.192s e` ambigua"
        jpn "列 '%-.192s' は %-.192s 内で曖昧です。"
        kor "칼럼: '%-.192s' in '%-.192s' 이 모호함"
        nla "Kolom: '%-.192s' in %-.192s is niet eenduidig"
        nor "Felt: '%-.192s' i tabell %-.192s er ikke entydig"
        norwegian-ny "Kolonne: '%-.192s' i tabell %-.192s er ikkje eintydig"
        pol "Kolumna: '%-.192s' w  %-.192s jest dwuznaczna"
        por "Coluna '%-.192s' em '%-.192s' é ambígua"
        rum "Coloana: '%-.192s' in %-.192s este ambigua"
        rus "Столбец '%-.192s' в %-.192s задан неоднозначно"
        serbian "Kolona '%-.192s' u %-.192s nije jedinstvena u kontekstu"
        slo "Pole: '%-.192s' v %-.192s je nejasné"
        spa "La columna: '%-.192s' en %-.192s es ambigua"
        swe "Kolumn '%-.192s' i %-.192s är inte unik"
        ukr "Стовбець '%-.192s' у %-.192s визначений неоднозначно"
ER_SERVER_SHUTDOWN 08S01 
        chi "服务器正在关闭"
        cze "Probíhá ukončování práce serveru"
        dan "Database nedlukning er i gang"
        eng "Server shutdown in progress"
        est "Serveri seiskamine käib"
        fre "Arrêt du serveur en cours"
        ger "Der Server wird heruntergefahren"
        greek "Εναρξη διαδικασίας αποσύνδεσης του εξυπηρετητή (server shutdown)"
        hindi "सर्वर बंद हो रहा है"
        hun "A szerver leallitasa folyamatban"
        ita "Shutdown del server in corso"
        jpn "サーバーをシャットダウン中です。"
        kor "Server가 셧다운 중입니다."
        nla "Bezig met het stoppen van de server"
        nor "Database nedkobling er i gang"
        norwegian-ny "Tenar nedkopling er i gang"
        pol "Trwa kończenie działania serwera"
        por "'Shutdown' do servidor em andamento"
        rum "Terminarea serverului este in desfasurare"
        rus "Сервер находится в процессе остановки"
        serbian "Gašenje servera je u toku"
        slo "Prebieha ukončovanie práce servera"
        spa "Desconexión de servidor en proceso"
        swe "Servern går nu ned"
        ukr "Завершується работа сервера"
ER_BAD_FIELD_ERROR 42S22 S0022
        chi "未知列'%-.192s'在'%-.192s'"
        cze "Neznámý sloupec '%-.192s' v %-.192s"
        dan "Ukendt kolonne '%-.192s' i tabel %-.192s"
        eng "Unknown column '%-.192s' in '%-.192s'"
        est "Tundmatu tulp '%-.192s' '%-.192s'-s"
        fre "Champ '%-.192s' inconnu dans %-.192s"
        ger "Unbekanntes Tabellenfeld '%-.192s' in %-.192s"
        greek "Αγνωστο πεδίο '%-.192s' σε '%-.192s'"
        hindi "अज्ञात काँलम '%-.192s'(टेबल: '%-.192s')"
        hun "A(z) '%-.192s' oszlop ervenytelen '%-.192s'-ben"
        ita "Colonna sconosciuta '%-.192s' in '%-.192s'"
        jpn "列 '%-.192s' は '%-.192s' にはありません。"
        kor "Unknown 칼럼 '%-.192s' in '%-.192s'"
        nla "Onbekende kolom '%-.192s' in %-.192s"
        nor "Ukjent kolonne '%-.192s' i tabell %-.192s"
        norwegian-ny "Ukjent felt '%-.192s' i tabell %-.192s"
        pol "Nieznana kolumna '%-.192s' w  %-.192s"
        por "Coluna '%-.192s' desconhecida em '%-.192s'"
        rum "Coloana invalida '%-.192s' in '%-.192s'"
        rus "Неизвестный столбец '%-.192s' в '%-.192s'"
        serbian "Nepoznata kolona '%-.192s' u '%-.192s'"
        slo "Neznáme pole '%-.192s' v '%-.192s'"
        spa "No se reconoce la columna '%-.192s' en %-.192s"
        swe "Okänd kolumn '%-.192s' i %-.192s"
        ukr "Невідомий стовбець '%-.192s' у '%-.192s'"
ER_WRONG_FIELD_WITH_GROUP 42000 S1009
        chi "'%-.192s' 不在 GROUP BY"
        cze "Použité '%-.192s' nebylo v group by"
        dan "Brugte '%-.192s' som ikke var i group by"
        eng "'%-.192s' isn't in GROUP BY"
        est "'%-.192s' puudub GROUP BY klauslis"
        fre "'%-.192s' n'est pas dans 'group by'"
        ger "'%-.192s' ist nicht in GROUP BY vorhanden"
        greek "Χρησιμοποιήθηκε '%-.192s' που δεν υπήρχε στο group by"
        hindi "'%-.192s' GROUP BY में नहीं है"
        hun "Used '%-.192s' with wasn't in group by"
        ita "Usato '%-.192s' che non e` nel GROUP BY"
        jpn "'%-.192s' はGROUP BY句で指定されていません。"
        kor "'%-.192s'은 GROUP BY속에 없음"
        nla "Opdracht gebruikt '%-.192s' dat niet in de GROUP BY voorkomt"
        nor "Brukte '%-.192s' som ikke var i group by"
        norwegian-ny "Brukte '%-.192s' som ikkje var i group by"
        pol "Użyto '%-.192s' bez umieszczenia w group by"
        por "'%-.192s' não está em 'GROUP BY'"
        rum "'%-.192s' nu exista in clauza GROUP BY"
        rus "'%-.192s' не присутствует в GROUP BY"
        serbian "Entitet '%-.192s' nije naveden u komandi 'GROUP BY'"
        slo "Použité '%-.192s' nebolo v 'group by'"
        spa "'%-.192s' no se encuentra en GROUP BY"
        swe "'%-.192s' finns inte i GROUP BY"
        ukr "'%-.192s' не є у GROUP BY"
ER_WRONG_GROUP_FIELD 42000 S1009
        chi "不能在'%-.192s'上分组"
        cze "Nemohu použít group na '%-.192s'"
        dan "Kan ikke gruppere på '%-.192s'"
        eng "Can't group on '%-.192s'"
        est "Ei saa grupeerida '%-.192s' järgi"
        fre "Ne peut regrouper '%-.192s'"
        ger "Gruppierung über '%-.192s' nicht möglich"
        greek "Αδύνατη η ομαδοποίηση (group on) '%-.192s'"
        hindi "'%-.192s' पर GROUP नहीं कर सकते"
        hun "A group nem hasznalhato: '%-.192s'"
        ita "Impossibile raggruppare per '%-.192s'"
        jpn "'%-.192s' でのグループ化はできません。"
        kor "'%-.192s'를 그룹할 수 없음"
        nla "Kan '%-.192s' niet groeperen"
        nor "Kan ikke gruppere på '%-.192s'"
        norwegian-ny "Kan ikkje gruppere på '%-.192s'"
        pol "Nie można grupować po '%-.192s'"
        por "Não pode agrupar em '%-.192s'"
        rum "Nu pot sa grupez pe (group on) '%-.192s'"
        rus "Невозможно произвести группировку по '%-.192s'"
        serbian "Ne mogu da grupišem po '%-.192s'"
        slo "Nemôžem použiť 'group' na '%-.192s'"
        spa "No puedo agrupar por '%-.192s'"
        swe "Kan inte använda GROUP BY med '%-.192s'"
        ukr "Не можу групувати по '%-.192s'"
ER_WRONG_SUM_SELECT 42000 S1009
        chi "语句在同一语句里有求和函数和列"
        cze "Příkaz obsahuje zároveň funkci sum a sloupce"
        dan "Udtrykket har summer (sum) funktioner og kolonner i samme udtryk"
        eng "Statement has sum functions and columns in same statement"
        est "Lauses on korraga nii tulbad kui summeerimisfunktsioonid"
        fre "Vous demandez la fonction sum() et des champs dans la même commande"
        ger "Die Verwendung von Summierungsfunktionen und Spalten im selben Befehl ist nicht erlaubt"
        greek "Η διατύπωση περιέχει sum functions και columns στην ίδια διατύπωση"
        ita "Il comando ha una funzione SUM e una colonna non specificata nella GROUP BY"
        jpn "集計関数と通常の列が同時に指定されています。"
        kor "Statement 가 sum기능을 동작중이고 칼럼도 동일한 statement입니다."
        nla "Opdracht heeft totaliseer functies en kolommen in dezelfde opdracht"
        nor "Uttrykket har summer (sum) funksjoner og kolonner i samme uttrykk"
        norwegian-ny "Uttrykket har summer (sum) funksjoner og kolonner i same uttrykk"
        pol "Zapytanie ma funkcje sumuj?ce i kolumny w tym samym zapytaniu"
        por "Cláusula contém funções de soma e colunas juntas"
        rum "Comanda are functii suma si coloane in aceeasi comanda"
        rus "Выражение содержит групповые функции и столбцы, но не включает GROUP BY. А как вы умудрились получить это сообщение об ошибке?"
        serbian "Izraz ima 'SUM' agregatnu funkciju i kolone u isto vreme"
        slo "Príkaz obsahuje zároveň funkciu 'sum' a poľa"
        spa "La sentencia tiene funciones de suma y columnas en la misma sentencia"
        swe "Kommandot har både sum functions och enkla funktioner"
        ukr "У виразі використано підсумовуючі функції поряд з іменами стовбців"
ER_WRONG_VALUE_COUNT 21S01 
        chi "列数与值数不匹配"
        cze "Počet sloupců neodpovídá zadané hodnotě"
        dan "Kolonne tæller stemmer ikke med antallet af værdier"
        eng "Column count doesn't match value count"
        est "Tulpade arv erineb väärtuste arvust"
        ger "Die Anzahl der Spalten entspricht nicht der Anzahl der Werte"
        greek "Το Column count δεν ταιριάζει με το value count"
        hindi "कॉलम की गिनती मूल्य की गिनती के समान नही है"
        hun "Az oszlopban levo ertek nem egyezik meg a szamitott ertekkel"
        ita "Il numero delle colonne non e` uguale al numero dei valori"
        jpn "列数が値の個数と一致しません。"
        kor "칼럼의 카운트가 값의 카운트와 일치하지 않습니다."
        nla "Het aantal kolommen komt niet overeen met het aantal opgegeven waardes"
        nor "Felt telling stemmer verdi telling"
        norwegian-ny "Kolonne telling stemmer verdi telling"
        pol "Liczba kolumn nie odpowiada liczbie warto?ci"
        por "Contagem de colunas não confere com a contagem de valores"
        rum "Numarul de coloane nu este acelasi cu numarul valoarei"
        rus "Количество столбцов не совпадает с количеством значений"
        serbian "Broj kolona ne odgovara broju vrednosti"
        slo "Počet polí nezodpovedá zadanej hodnote"
        spa "El contador de columnas no coincide con el contador de valores"
        swe "Antalet kolumner motsvarar inte antalet värden"
        ukr "Кількість стовбців не співпадає з кількістю значень"
ER_TOO_LONG_IDENT 42000 S1009
        chi "标识符'%-.100T'太长"
        cze "Jméno identifikátoru '%-.100T' je příliš dlouhé"
        dan "Navnet '%-.100T' er for langt"
        eng "Identifier name '%-.100T' is too long"
        est "Identifikaatori '%-.100T' nimi on liiga pikk"
        fre "Le nom de l'identificateur '%-.100T' est trop long"
        ger "Name des Bezeichners '%-.100T' ist zu lang"
        greek "Το identifier name '%-.100T' είναι πολύ μεγάλο"
        hindi "पहचानकर्ता का नाम '%-.100T' बहुत लंबा है"
        hun "A(z) '%-.100T' azonositonev tul hosszu"
        ita "Il nome dell'identificatore '%-.100T' e` troppo lungo"
        jpn "識別子名 '%-.100T' は長すぎます。"
        kor "Identifier '%-.100T'는 너무 길군요."
        nla "Naam voor herkenning '%-.100T' is te lang"
        nor "Identifikator '%-.100T' er for lang"
        norwegian-ny "Identifikator '%-.100T' er for lang"
        pol "Nazwa identyfikatora '%-.100T' jest zbyt długa"
        por "Nome identificador '%-.100T' é longo demais"
        rum "Numele indentificatorului '%-.100T' este prea lung"
        rus "Слишком длинный идентификатор '%-.100T'"
        serbian "Ime '%-.100T' je predugačko"
        slo "Meno identifikátora '%-.100T' je príliš dlhé"
        spa "El nombre del identificador '%-.100T' es demasiado grande"
        swe "Kolumnnamn '%-.100T' är för långt"
        ukr "Ім'я ідентифікатора '%-.100T' задовге"
ER_DUP_FIELDNAME 42S21 S1009
        chi "列名重复 '%-.192s'"
        cze "Zdvojené jméno sloupce '%-.192s'"
        dan "Feltnavnet '%-.192s' findes allerede"
        eng "Duplicate column name '%-.192s'"
        est "Kattuv tulba nimi '%-.192s'"
        fre "Nom du champ '%-.192s' déjà utilisé"
        ger "Doppelter Spaltenname: '%-.192s'"
        greek "Επανάληψη column name '%-.192s'"
        hindi "समान कॉलम '%-.192s' मौजूद है"
        hun "Duplikalt oszlopazonosito: '%-.192s'"
        ita "Nome colonna duplicato '%-.192s'"
        jpn "列名 '%-.192s' は重複してます。"
        kor "중복된 칼럼 이름: '%-.192s'"
        nla "Dubbele kolom naam '%-.192s'"
        nor "Feltnavnet '%-.192s' eksisterte fra før"
        norwegian-ny "Feltnamnet '%-.192s' eksisterte frå før"
        pol "Powtórzona nazwa kolumny '%-.192s'"
        por "Nome da coluna '%-.192s' duplicado"
        rum "Numele coloanei '%-.192s' e duplicat"
        rus "Дублирующееся имя столбца '%-.192s'"
        serbian "Duplirano ime kolone '%-.192s'"
        slo "Opakované meno poľa '%-.192s'"
        spa "Nombre duplicado de columna '%-.192s'"
        swe "Kolumnnamn '%-.192s finns flera gånger"
        ukr "Дублююче ім'я стовбця '%-.192s'"
ER_DUP_KEYNAME 42000 S1009
        chi "索引名重复 '%-.192s'"
        cze "Zdvojené jméno klíče '%-.192s'"
        dan "Indeksnavnet '%-.192s' findes allerede"
        eng "Duplicate key name '%-.192s'"
        est "Kattuv võtme nimi '%-.192s'"
        fre "Nom de clef '%-.192s' déjà utilisé"
        ger "Doppelter Name für Schlüssel vorhanden: '%-.192s'"
        greek "Επανάληψη key name '%-.192s'"
        hindi "समान KEY '%-.192s' मौजूद है"
        hun "Duplikalt kulcsazonosito: '%-.192s'"
        ita "Nome chiave duplicato '%-.192s'"
        jpn "索引名 '%-.192s' は重複しています。"
        kor "중복된 키 이름 : '%-.192s'"
        nla "Dubbele zoeksleutel naam '%-.192s'"
        nor "Nøkkelnavnet '%-.192s' eksisterte fra før"
        norwegian-ny "Nøkkelnamnet '%-.192s' eksisterte frå før"
        pol "Powtórzony nazwa klucza '%-.192s'"
        por "Nome da chave '%-.192s' duplicado"
        rum "Numele cheiei '%-.192s' e duplicat"
        rus "Дублирующееся имя ключа '%-.192s'"
        serbian "Duplirano ime ključa '%-.192s'"
        slo "Opakované meno kľúča '%-.192s'"
        spa "Nombre duplicado de clave '%-.192s'"
        swe "Nyckelnamn '%-.192s' finns flera gånger"
        ukr "Дублююче ім'я ключа '%-.192s'"
# When using this error code, please use ER(ER_DUP_ENTRY_WITH_KEY_NAME)
# for the message string.  See, for example, code in handler.cc.
ER_DUP_ENTRY 23000 S1009
        chi "重复条目'%-.192T'在索引%d"
        cze "Zdvojený klíč '%-.192T' (číslo klíče %d)"
        dan "Ens værdier '%-.192T' for indeks %d"
        eng "Duplicate entry '%-.192T' for key %d"
        est "Kattuv väärtus '%-.192T' võtmele %d"
        fre "Duplicata du champ '%-.192T' pour la clef %d"
        ger "Doppelter Eintrag '%-.192T' für Schlüssel %d"
        greek "Διπλή εγγραφή '%-.192T' για το κλειδί %d"
        hindi "सामान प्रवेश '%-.192T' KEY %d के लिए"
        hun "Duplikalt bejegyzes '%-.192T' a %d kulcs szerint"
        ita "Valore duplicato '%-.192T' per la chiave %d"
        jpn "'%-.192T' は索引 %d で重複しています。"
        kor "중복된 입력 값 '%-.192T': key %d"
        nla "Dubbele ingang '%-.192T' voor zoeksleutel %d"
        nor "Like verdier '%-.192T' for nøkkel %d"
        norwegian-ny "Like verdiar '%-.192T' for nykkel %d"
        pol "Powtórzone wystąpienie '%-.192T' dla klucza %d"
        por "Entrada '%-.192T' duplicada para a chave %d"
        rum "Cimpul '%-.192T' e duplicat pentru cheia %d"
        rus "Дублирующаяся запись '%-.192T' по ключу %d"
        serbian "Dupliran unos '%-.192T' za ključ '%d'"
        slo "Opakovaný kľúč '%-.192T' (číslo kľúča %d)"
        spa "Entrada duplicada '%-.192T' para la clave %d"
        swe "Dublett '%-.192T' för nyckel %d"
        ukr "Дублюючий запис '%-.192T' для ключа %d"
ER_WRONG_FIELD_SPEC 42000 S1009
        chi "列的说明符不对 '%-.192s'"
        cze "Chybná specifikace sloupce '%-.192s'"
        dan "Forkert kolonnespecifikaton for felt '%-.192s'"
        eng "Incorrect column specifier for column '%-.192s'"
        est "Vigane tulba kirjeldus tulbale '%-.192s'"
        fre "Mauvais paramètre de champ pour le champ '%-.192s'"
        ger "Falsche Spezifikation für Feld '%-.192s'"
        greek "Εσφαλμένο column specifier για το πεδίο '%-.192s'"
        hindi "कॉलम '%-.192s' के लिए गलत कॉलम विनिर्देशक"
        hun "Rossz oszlopazonosito: '%-.192s'"
        ita "Specifica errata per la colonna '%-.192s'"
        jpn "列 '%-.192s' の定義が不正です。"
        kor "칼럼 '%-.192s'의 부정확한 칼럼 정의자"
        nla "Verkeerde kolom specificatie voor kolom '%-.192s'"
        nor "Feil kolonne spesifikator for felt '%-.192s'"
        norwegian-ny "Feil kolonne spesifikator for kolonne '%-.192s'"
        pol "Błędna specyfikacja kolumny dla kolumny '%-.192s'"
        por "Especificador de coluna incorreto para a coluna '%-.192s'"
        rum "Specificandul coloanei '%-.192s' este incorect"
        rus "Некорректный определитель столбца для столбца '%-.192s'"
        serbian "Pogrešan naziv kolone za kolonu '%-.192s'"
        slo "Chyba v špecifikácii poľa '%-.192s'"
        spa "Especificador de columna incorrecto para la columna '%-.192s'"
        swe "Felaktigt kolumntyp för kolumn '%-.192s'"
        ukr "Невірний специфікатор стовбця '%-.192s'"
ER_PARSE_ERROR 42000 s1009
        chi "%s 附近'%-.80T'在第%d行"
        cze "%s blízko '%-.80T' na řádku %d"
        dan "%s nær '%-.80T' på linje %d"
        eng "%s near '%-.80T' at line %d"
        est "%s '%-.80T' ligidal real %d"
        fre "%s près de '%-.80T' à la ligne %d"
        ger "%s bei '%-.80T' in Zeile %d"
        greek "%s πλησίον '%-.80T' στη γραμμή %d"
        hindi "%s के पास '%-.80T' लाइन %d में"
        hun "A %s a '%-.80T'-hez kozeli a %d sorban"
        ita "%s vicino a '%-.80T' linea %d"
        jpn "%s : '%-.80T' 付近 %d 行目"
        kor "'%s' 에러 같습니다. ('%-.80T' 명령어 라인 %d)"
        nla "%s bij '%-.80T' in regel %d"
        nor "%s nær '%-.80T' på linje %d"
        norwegian-ny "%s attmed '%-.80T' på line %d"
        pol "%s obok '%-.80T' w linii %d"
        por "%s próximo a '%-.80T' na linha %d"
        rum "%s linga '%-.80T' pe linia %d"
        rus "%s около '%-.80T' на строке %d"
        serbian "'%s' u iskazu '%-.80T' na liniji %d"
        slo "%s blízko '%-.80T' na riadku %d"
        spa "%s cerca de '%-.80T' en la línea %d"
        swe "%s nära '%-.80T' på rad %d"
        ukr "%s біля '%-.80T' в строці %d"
ER_EMPTY_QUERY 42000  
        chi "查询为空"
        cze "Výsledek dotazu je prázdný"
        dan "Forespørgsel var tom"
        eng "Query was empty"
        est "Tühi päring"
        fre "Query est vide"
        ger "Leere Abfrage"
        greek "Το ερώτημα (query) που θέσατε ήταν κενό"
        hindi "क्वेरी खली थी"
        hun "Ures lekerdezes"
        ita "La query e` vuota"
        jpn "クエリが空です。"
        kor "쿼리결과가 없습니다."
        nla "Query was leeg"
        nor "Forespørsel var tom"
        norwegian-ny "Førespurnad var tom"
        pol "Zapytanie było puste"
        por "Consulta (query) estava vazia"
        rum "Query-ul a fost gol"
        rus "Запрос оказался пустым"
        serbian "Upit je bio prazan"
        slo "Výsledok požiadavky bol prázdny"
        spa "La consulta (query) estaba vacia"
        swe "Frågan var tom"
        ukr "Пустий запит"
ER_NONUNIQ_TABLE 42000 S1009
        chi "表或别名不唯一:'%-.192s'"
        cze "Nejednoznačná tabulka/alias: '%-.192s'"
        dan "Tabellen/aliaset: '%-.192s' er ikke unikt"
        eng "Not unique table/alias: '%-.192s'"
        est "Ei ole unikaalne tabel/alias '%-.192s'"
        fre "Table/alias: '%-.192s' non unique"
        ger "Tabellenname/Alias '%-.192s' nicht eindeutig"
        greek "Αδύνατη η ανεύρεση unique table/alias: '%-.192s'"
        hindi "टेबल या उसका उपनाम '%-.192s' अद्वितीय नहीं है"
        hun "Nem egyedi tabla/alias: '%-.192s'"
        ita "Tabella/alias non unico: '%-.192s'"
        jpn "表名/別名 '%-.192s' は一意ではありません。"
        kor "Unique 하지 않은 테이블/alias: '%-.192s'"
        nla "Niet unieke waarde tabel/alias: '%-.192s'"
        nor "Ikke unikt tabell/alias: '%-.192s'"
        norwegian-ny "Ikkje unikt tabell/alias: '%-.192s'"
        pol "Tabela/alias nie s? unikalne: '%-.192s'"
        por "Tabela/alias '%-.192s' não única"
        rum "Tabela/alias: '%-.192s' nu este unic"
        rus "Повторяющаяся таблица/псевдоним '%-.192s'"
        serbian "Tabela ili alias nisu bili jedinstveni: '%-.192s'"
        slo "Nie jednoznačná tabuľka/alias: '%-.192s'"
        spa "La tabla/alias: '%-.192s' no es única"
        swe "Icke unikt tabell/alias: '%-.192s'"
        ukr "Неунікальна таблиця/псевдонім: '%-.192s'"
ER_INVALID_DEFAULT 42000 S1009
        chi "'%-.192s'的默认值无效"
        cze "Chybná defaultní hodnota pro '%-.192s'"
        dan "Ugyldig standardværdi for '%-.192s'"
        eng "Invalid default value for '%-.192s'"
        est "Vigane vaikeväärtus '%-.192s' jaoks"
        fre "Valeur par défaut invalide pour '%-.192s'"
        ger "Fehlerhafter Vorgabewert (DEFAULT) für '%-.192s'"
        greek "Εσφαλμένη προκαθορισμένη τιμή (default value) για '%-.192s'"
        hindi "'%-.192s' के लिए अवैध डिफ़ॉल्ट मान"
        hun "Ervenytelen ertek: '%-.192s'"
        ita "Valore di default non valido per '%-.192s'"
        jpn "'%-.192s' へのデフォルト値が無効です。"
        kor "'%-.192s'의 유효하지 못한 디폴트 값을 사용하셨습니다."
        nla "Foutieve standaard waarde voor '%-.192s'"
        nor "Ugyldig standardverdi for '%-.192s'"
        norwegian-ny "Ugyldig standardverdi for '%-.192s'"
        pol "Niewła?ciwa warto?ć domy?lna dla '%-.192s'"
        por "Valor padrão (default) inválido para '%-.192s'"
        rum "Valoarea de default este invalida pentru '%-.192s'"
        rus "Некорректное значение по умолчанию для '%-.192s'"
        serbian "Loša default vrednost za '%-.192s'"
        slo "Chybná implicitná hodnota pre '%-.192s'"
        spa "Valor por defecto inválido para '%-.192s'"
        swe "Ogiltigt DEFAULT värde för '%-.192s'"
        ukr "Невірне значення по замовчуванню для '%-.192s'"
ER_MULTIPLE_PRI_KEY 42000 S1009
        chi "定义了多个主键"
        cze "Definováno více primárních klíčů"
        dan "Flere primærnøgler specificeret"
        eng "Multiple primary key defined"
        est "Mitut primaarset võtit ei saa olla"
        fre "Plusieurs clefs primaires définies"
        ger "Mehrere Primärschlüssel (PRIMARY KEY) definiert"
        greek "Περισσότερα από ένα primary key ορίστηκαν"
        hindi "कई PRIMARY KEY परिभाषित"
        hun "Tobbszoros elsodleges kulcs definialas"
        ita "Definite piu` chiave primarie"
        jpn "PRIMARY KEY が複数定義されています。"
        kor "Multiple primary key가 정의되어 있슴"
        nla "Meerdere primaire zoeksleutels gedefinieerd"
        nor "Fleire primærnøkle spesifisert"
        norwegian-ny "Fleire primærnyklar spesifisert"
        pol "Zdefiniowano wiele kluczy podstawowych"
        por "Definida mais de uma chave primária"
        rum "Chei primare definite de mai multe ori"
        rus "Указано несколько первичных ключей"
        serbian "Definisani višestruki primarni ključevi"
        slo "Zadefinovaných viac primárnych kľúčov"
        spa "Múltiples claves primarias definidas"
        swe "Flera PRIMARY KEY använda"
        ukr "Первинного ключа визначено неодноразово"
ER_TOO_MANY_KEYS 42000 S1009
        chi "定义的索引太多; 最多允许%d 个索引"
        cze "Zadáno příliš mnoho klíčů, je povoleno nejvíce %d klíčů"
        dan "For mange nøgler specificeret. Kun %d nøgler må bruges"
        eng "Too many keys specified; max %d keys allowed"
        est "Liiga palju võtmeid. Maksimaalselt võib olla %d võtit"
        fre "Trop de clefs sont définies. Maximum de %d clefs alloué"
        ger "Zu viele Schlüssel definiert. Maximal %d Schlüssel erlaubt"
        greek "Πάρα πολλά key ορίσθηκαν. Το πολύ %d επιτρέπονται"
        hindi "बहुत सारी KEYS निर्दिष्ट हैं; अधिकतम %d KEYS की अनुमति है"
        hun "Tul sok kulcs. Maximum %d kulcs engedelyezett"
        ita "Troppe chiavi. Sono ammesse max %d chiavi"
        jpn "索引の数が多すぎます。最大 %d 個までです。"
        kor "너무 많은 키가 정의되어 있습니다.. 최대 %d의 키가 가능함"
        nla "Teveel zoeksleutels gedefinieerd. Maximaal zijn %d zoeksleutels toegestaan"
        nor "For mange nøkler spesifisert. Maks %d nøkler tillatt"
        norwegian-ny "For mange nykler spesifisert. Maks %d nyklar tillatt"
        pol "Okre?lono zbyt wiele kluczy. Dostępnych jest maksymalnie %d kluczy"
        por "Especificadas chaves demais. O máximo permitido são %d chaves"
        rum "Prea multe chei. Numarul de chei maxim este %d"
        rus "Указано слишком много ключей. Разрешается указывать не более %d ключей"
        serbian "Navedeno je previše ključeva. Maksimum %d ključeva je dozvoljeno"
        slo "Zadaných ríliš veľa kľúčov. Najviac %d kľúčov je povolených"
        spa "Demasiadas claves primarias declaradas. Se permite un máximo de %d claves"
        swe "För många nycklar använda. Man får ha högst %d nycklar"
        ukr "Забагато ключів зазначено. Дозволено не більше %d ключів"
ER_TOO_MANY_KEY_PARTS 42000 S1009
        chi "指定的索引部分过多; 最多允许%d个部分"
        cze "Zadáno příliš mnoho část klíčů, je povoleno nejvíce %d částí"
        dan "For mange nøgledele specificeret. Kun %d dele må bruges"
        eng "Too many key parts specified; max %d parts allowed"
        est "Võti koosneb liiga paljudest osadest. Maksimaalselt võib olla %d osa"
        fre "Trop de parties specifiées dans la clef. Maximum de %d parties"
        ger "Zu viele Teilschlüssel definiert. Maximal %d Teilschlüssel erlaubt"
        greek "Πάρα πολλά key parts ορίσθηκαν. Το πολύ %d επιτρέπονται"
        hindi "बहुत सारे KEY के भाग निर्दिष्ट हैं; अधिकतम %d भागों की अनुमति है"
        hun "Tul sok kulcsdarabot definialt. Maximum %d resz engedelyezett"
        ita "Troppe parti di chiave specificate. Sono ammesse max %d parti"
        jpn "索引のキー列指定が多すぎます。最大 %d 個までです。"
        kor "너무 많은 키 부분(parts)들이 정의되어 있습니다.. 최대 %d 부분이 가능함"
        nla "Teveel zoeksleutel onderdelen gespecificeerd. Maximaal %d onderdelen toegestaan"
        nor "For mange nøkkeldeler spesifisert. Maks %d deler tillatt"
        norwegian-ny "For mange nykkeldelar spesifisert. Maks %d delar tillatt"
        pol "Okre?lono zbyt wiele czę?ci klucza. Dostępnych jest maksymalnie %d czę?ci"
        por "Especificadas partes de chave demais. O máximo permitido são %d partes"
        rum "Prea multe chei. Numarul de chei maxim este %d"
        rus "Указано слишком много частей составного ключа. Разрешается указывать не более %d частей"
        serbian "Navedeno je previše delova ključa. Maksimum %d delova je dozvoljeno"
        slo "Zadaných ríliš veľa častí kľúčov. Je povolených najviac %d častí"
        spa "Demasiadas partes de clave declaradas. Se permite un máximo de %d partes"
        swe "För många nyckeldelar använda. Man får ha högst %d nyckeldelar"
        ukr "Забагато частин ключа зазначено. Дозволено не більше %d частин"
ER_TOO_LONG_KEY 42000 S1009
        chi "指定索引太长; 最大索引长度是 %d字节"
        cze "Zadaný klíč byl příliš dlouhý, největší délka klíče je %d"
        dan "Specificeret nøgle var for lang. Maksimal nøglelængde er %d"
        eng "Specified key was too long; max key length is %d bytes"
        est "Võti on liiga pikk. Maksimaalne võtmepikkus on %d"
        fre "La clé est trop longue. Longueur maximale: %d"
        ger "Schlüssel ist zu lang. Die maximale Schlüssellänge beträgt %d"
        greek "Το κλειδί που ορίσθηκε είναι πολύ μεγάλο. Το μέγιστο μήκος είναι %d"
        hindi "निर्दिष्ट KEY बहुत लंबी थी; KEY की अधिकतम लंबाई %d बाइट है"
        hun "A megadott kulcs tul hosszu. Maximalis kulcshosszusag: %d"
        ita "La chiave specificata e` troppo lunga. La max lunghezza della chiave e` %d"
        jpn "索引のキーが長すぎます。最大 %d バイトまでです。"
        kor "정의된 키가 너무 깁니다. 최대 키의 길이는 %d입니다."
        nla "Gespecificeerde zoeksleutel was te lang. De maximale lengte is %d"
        nor "Spesifisert nøkkel var for lang. Maks nøkkellengde er is %d"
        norwegian-ny "Spesifisert nykkel var for lang. Maks nykkellengde er %d"
        pol "Zdefinowany klucz jest zbyt długi. Maksymaln? długo?ci? klucza jest %d"
        por "Chave especificada longa demais. O comprimento de chave máximo permitido é %d"
        rum "Cheia specificata este prea lunga. Marimea maxima a unei chei este de %d"
        rus "Указан слишком длинный ключ. Максимальная длина ключа составляет %d байт"
        serbian "Navedeni ključ je predug. Maksimalna dužina ključa je %d"
        slo "Zadaný kľúč je príliš dlhý, najväčšia dĺžka kľúča je %d"
        spa "Declaración de clave demasiado larga. La máxima longitud de clave es de %d"
        swe "För lång nyckel. Högsta tillåtna nyckellängd är %d"
        ukr "Зазначений ключ задовгий. Найбільша довжина ключа %d байтів"
ER_KEY_COLUMN_DOES_NOT_EXITS 42000 S1009
        chi "索引列'%-.192s'不在表里"
        cze "Klíčový sloupec '%-.192s' v tabulce neexistuje"
        dan "Nøglefeltet '%-.192s' eksisterer ikke i tabellen"
        eng "Key column '%-.192s' doesn't exist in table"
        est "Võtme tulp '%-.192s' puudub tabelis"
        fre "La clé '%-.192s' n'existe pas dans la table"
        ger "In der Tabelle gibt es kein Schlüsselfeld '%-.192s'"
        greek "Το πεδίο κλειδί '%-.192s' δεν υπάρχει στον πίνακα"
        hindi "KEY कॉलम '%-.192s' टेबल में मौजूद नहीं है"
        hun "A(z) '%-.192s'kulcsoszlop nem letezik a tablaban"
        ita "La colonna chiave '%-.192s' non esiste nella tabella"
        jpn "キー列 '%-.192s' は表にありません。"
        kor "Key 칼럼 '%-.192s'는 테이블에 존재하지 않습니다."
        nla "Zoeksleutel kolom '%-.192s' bestaat niet in tabel"
        nor "Nøkkel felt '%-.192s' eksiterer ikke i tabellen"
        norwegian-ny "Nykkel kolonne '%-.192s' eksiterar ikkje i tabellen"
        pol "Kolumna '%-.192s' zdefiniowana w kluczu nie istnieje w tabeli"
        por "Coluna chave '%-.192s' não existe na tabela"
        rum "Coloana cheie '%-.192s' nu exista in tabela"
        rus "Ключевой столбец '%-.192s' в таблице не существует"
        serbian "Ključna kolona '%-.192s' ne postoji u tabeli"
        slo "Kľúčový stĺpec '%-.192s' v tabuľke neexistuje"
        spa "La columna de clave '%-.192s' no existe en la tabla"
        swe "Nyckelkolumn '%-.192s' finns inte"
        ukr "Ключовий стовбець '%-.192s' не існує у таблиці"
ER_BLOB_USED_AS_KEY 42000 S1009
        chi "索引里不能含有BLOB列%`s表%s"
        eng "BLOB column %`s can't be used in key specification in the %s table"
        ger "BLOB-Feld %`s kann beim %s Tabellen nicht als Schlüssel verwendet werden"
        hindi "BLOB कॉलम %`s टेबल %s में KEY विनिर्देश में इस्तेमाल नहीं किया जा सकता"
        rus "Столбец типа BLOB %`s не может быть использован как значение ключа в %s таблице"
        spa "La columna BLOB %`s no se puede usar en la especificación de clave en la tabla %s"
        ukr "BLOB стовбець %`s не може бути використаний у визначенні ключа в %s таблиці"
ER_TOO_BIG_FIELDLENGTH 42000 S1009
        chi "数据太长超过列容量 '%-.192s' (最长 = %lu); 用 BLOB 或 TEXT 替代"
        cze "Příliš velká délka sloupce '%-.192s' (nejvíce %lu). Použijte BLOB"
        dan "For stor feltlængde for kolonne '%-.192s' (maks = %lu). Brug BLOB i stedet"
        eng "Column length too big for column '%-.192s' (max = %lu); use BLOB or TEXT instead"
        est "Tulba '%-.192s' pikkus on liiga pikk (maksimaalne pikkus: %lu). Kasuta BLOB väljatüüpi"
        fre "Champ '%-.192s' trop long (max = %lu). Utilisez un BLOB"
        ger "Feldlänge für Feld '%-.192s' zu groß (maximal %lu). BLOB- oder TEXT-Spaltentyp verwenden!"
        greek "Πολύ μεγάλο μήκος για το πεδίο '%-.192s' (max = %lu). Παρακαλώ χρησιμοποιείστε τον τύπο BLOB"
        hindi "कॉलम की लंबाई कॉलम '%-.192s' के लिए बड़ी है (अधिकतम = %lu); BLOB या TEXT का उपयोग करें"
        hun "A(z) '%-.192s' oszlop tul hosszu. (maximum = %lu). Hasznaljon BLOB tipust inkabb"
        ita "La colonna '%-.192s' e` troppo grande (max=%lu). Utilizza un BLOB"
        jpn "列 '%-.192s' のサイズ定義が大きすぎます (最大 %lu まで)。代わりに BLOB または TEXT を使用してください。"
        kor "칼럼 '%-.192s'의 칼럼 길이가 너무 깁니다 (최대 = %lu). 대신에 BLOB를 사용하세요."
        nla "Te grote kolomlengte voor '%-.192s' (max = %lu). Maak hiervoor gebruik van het type BLOB"
        nor "For stor nøkkellengde for kolonne '%-.192s' (maks = %lu). Bruk BLOB istedenfor"
        norwegian-ny "For stor nykkellengde for felt '%-.192s' (maks = %lu). Bruk BLOB istadenfor"
        pol "Zbyt duża długo?ć kolumny '%-.192s' (maks. = %lu). W zamian użyj typu BLOB"
        por "Comprimento da coluna '%-.192s' grande demais (max = %lu); use BLOB em seu lugar"
        rum "Lungimea coloanei '%-.192s' este prea lunga (maximum = %lu). Foloseste BLOB mai bine"
        rus "Слишком большая длина столбца '%-.192s' (максимум = %lu). Используйте тип BLOB или TEXT вместо текущего"
        serbian "Previše podataka za kolonu '%-.192s' (maksimum je %lu). Upotrebite BLOB polje"
        slo "Príliš veľká dĺžka pre pole '%-.192s' (maximum = %lu). Použite BLOB"
        spa "Longitud de columna demasiado grande para la columna '%-.192s' (máximo = %lu). Use BLOB o TEXT en su lugar"
        swe "För stor kolumnlängd angiven för '%-.192s' (max= %lu). Använd en BLOB instället"
        ukr "Задовга довжина стовбця '%-.192s' (max = %lu). Використайте тип BLOB"
ER_WRONG_AUTO_KEY 42000 S1009
        chi "表定义不正确;只能有一个自动列,并且必须将其定义为索引"
        cze "Můžete mít pouze jedno AUTO pole a to musí být definováno jako klíč"
        dan "Der kan kun specificeres eet AUTO_INCREMENT-felt, og det skal være indekseret"
        eng "Incorrect table definition; there can be only one auto column and it must be defined as a key"
        est "Vigane tabelikirjeldus; Tabelis tohib olla üks auto_increment tüüpi tulp ning see peab olema defineeritud võtmena"
        fre "Un seul champ automatique est permis et il doit être indexé"
        ger "Falsche Tabellendefinition. Es darf nur eine AUTO_INCREMENT-Spalte geben, und diese muss als Schlüssel definiert werden"
        greek "Μπορεί να υπάρχει μόνο ένα auto field και πρέπει να έχει ορισθεί σαν key"
        hindi "गलत टेबल परिभाषा; टेबल में केवल एक AUTO_INCREMENT कॉलम हो सकता है और इसे एक KEY के रूप में परिभाषित किया जाना चाहिए"
        hun "Csak egy auto mezo lehetseges, es azt kulcskent kell definialni"
        ita "Puo` esserci solo un campo AUTO e deve essere definito come chiave"
        jpn "不正な表定義です。AUTO_INCREMENT列は1個までで、索引を定義する必要があります。"
        kor "부정확한 테이블 정의; 테이블은 하나의 auto 칼럼이 존재하고 키로 정의되어져야 합니다."
        nla "Er kan slechts 1 autofield zijn en deze moet als zoeksleutel worden gedefinieerd"
        nor "Bare ett auto felt kan være definert som nøkkel"
        norwegian-ny "Bare eitt auto felt kan være definert som nøkkel"
        pol "W tabeli może być tylko jedno pole auto i musi ono być zdefiniowane jako klucz"
        por "Definição incorreta de tabela. Somente é permitido um único campo auto-incrementado e ele tem que ser definido como chave"
        rum "Definitia tabelei este incorecta; Nu pot fi mai mult de o singura coloana de tip auto si aceasta trebuie definita ca cheie"
        rus "Некорректное определение таблицы: может существовать только один автоинкрементный столбец, и он должен быть определен как ключ"
        serbian "Pogrešna definicija tabele; U tabeli može postojati samo jedna 'AUTO' kolona i ona mora biti istovremeno definisana kao kolona ključa"
        slo "Môžete mať iba jedno AUTO pole a to musí byť definované ako kľúč"
        spa "Definición incorrecta de tabla; sólo puede haber una columna automática y ésta debe de ser definida como una clave"
        swe "Det får finnas endast ett AUTO_INCREMENT-fält och detta måste vara en nyckel"
        ukr "Хибне визначення таблиці; Може бути лише один автоматичний стовбець, що повинен бути визначений як ключ"
ER_BINLOG_CANT_DELETE_GTID_DOMAIN
        chi "无法删除gtid域. 原因: %s."
        eng "Could not delete gtid domain. Reason: %s."
        spa "No pude borrar el dominio gtid. Motivo: %s."
        ukr "Не можу видалити домен gtid. Причина: %s."
ER_NORMAL_SHUTDOWN  
        chi "%s(%s):正常关闭"
        cze "%s (%s): normální ukončení"
        dan "%s (%s): Normal nedlukning"
        eng "%s (initiated by: %s): Normal shutdown"
        est "%s (%s): MariaDB lõpetas"
        fre "%s (%s): Arrêt normal du serveur"
        ger "%s (%s): Normal heruntergefahren"
        greek "%s (%s): Φυσιολογική διαδικασία shutdown"
        hindi "%s (%s): सामान्य शटडाउन"
        hun "%s (%s): Normal leallitas"
        ita "%s (%s): Shutdown normale"
        jpn "%s (%s): 通常シャットダウン"
        kor "%s (%s): 정상적인 shutdown"
        nla "%s (%s): Normaal afgesloten "
        nor "%s (%s): Normal avslutning"
        norwegian-ny "%s (%s): Normal nedkopling"
        pol "%s (%s): Standardowe zakończenie działania"
        por "%s (%s): 'Shutdown' normal"
        rum "%s (%s): Terminare normala"
        rus "%s (инициирована пользователем: %s): Корректная остановка"
        serbian "%s (%s): Normalno gašenje"
        slo "%s (%s): normálne ukončenie"
        spa "%s (iniciado por: %s): Apagado normal"
        swe "%s (%s): Normal avslutning"
        ukr "%s (%s): Нормальне завершення"
ER_GOT_SIGNAL  
        chi "%s: 收到信号 %d. 强行中止!"
        cze "%s: přijat signal %d, končím!"
        dan "%s: Fangede signal %d. Afslutter!"
        eng "%s: Got signal %d. Aborting!"
        est "%s: sain signaali %d. Lõpetan!"
        fre "%s: Reçu le signal %d. Abandonne!"
        ger "%s: Signal %d erhalten. Abbruch!"
        greek "%s: Ελήφθη το μήνυμα %d. Η διαδικασία εγκαταλείπεται!"
        hindi "%s: सिग्नल %d मिलने के कारण सिस्टम बंद किया जा रहा है!"
        hun "%s: %d jelzes. Megszakitva!"
        ita "%s: Ricevuto segnale %d. Interruzione!"
        jpn "%s: シグナル %d を受信しました。強制終了します!"
        kor "%s: %d 신호가 들어왔음. 중지!"
        nla "%s: Signaal %d. Systeem breekt af!"
        nor "%s: Oppdaget signal %d. Avslutter!"
        norwegian-ny "%s: Oppdaga signal %d. Avsluttar!"
        pol "%s: Otrzymano sygnał %d. Kończenie działania!"
        por "%s: Obteve sinal %d. Abortando!"
        rum "%s: Semnal %d obtinut. Aborting!"
        rus "%s: Получен сигнал %d. Прекращаем!"
        serbian "%s: Dobio signal %d. Prekidam!"
        slo "%s: prijatý signál %d, ukončenie (Abort)!"
        spa "%s: Obtenida señal %d. ¡Abortando!"
        swe "%s: Fick signal %d. Avslutar!"
        ukr "%s: Отримано сигнал %d. Перериваюсь!"
ER_SHUTDOWN_COMPLETE  
        chi "%s:关闭完成"
        cze "%s: ukončení práce hotovo"
        dan "%s: Server lukket"
        eng "%s: Shutdown complete"
        est "%s: Lõpp"
        fre "%s: Arrêt du serveur terminé"
        ger "%s: Herunterfahren beendet"
        greek "%s: Η διαδικασία Shutdown ολοκληρώθηκε"
        hindi "%s: शटडाउन पूर्ण"
        hun "%s: A leallitas kesz"
        ita "%s: Shutdown completato"
        jpn "%s: シャットダウン完了"
        kor "%s: Shutdown 이 완료됨!"
        nla "%s: Afsluiten afgerond"
        nor "%s: Avslutning komplett"
        norwegian-ny "%s: Nedkopling komplett"
        pol "%s: Zakończenie działania wykonane"
        por "%s: 'Shutdown' completo"
        rum "%s: Terminare completa"
        rus "%s: Остановка завершена"
        serbian "%s: Gašenje završeno"
        slo "%s: práca ukončená"
        spa "%s: Apagado completado"
        swe "%s: Avslutning klar"
        ukr "%s: Роботу завершено"
ER_FORCING_CLOSE 08S01 
        chi "%s: 强行关闭线程 %ld  用户: '%-.48s'"
        cze "%s: násilné uzavření threadu %ld uživatele '%-.48s'"
        dan "%s: Forceret nedlukning af tråd: %ld  bruger: '%-.48s'"
        eng "%s: Forcing close of thread %ld  user: '%-.48s'"
        est "%s: Sulgen jõuga lõime %ld  kasutaja: '%-.48s'"
        fre "%s: Arrêt forcé de la tâche (thread) %ld  utilisateur: '%-.48s'"
        ger "%s: Thread %ld zwangsweise beendet. Benutzer: '%-.48s'"
        greek "%s: Το thread θα κλείσει %ld  user: '%-.48s'"
        hindi "%s: %ld थ्रेड बंद किया जा रहा है (यूज़र: '%-.48s')"
        hun "%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.48s'"
        ita "%s: Forzata la chiusura del thread %ld utente: '%-.48s'"
        jpn "%s: スレッド %ld を強制終了します (ユーザー: '%-.48s')"
        kor "%s: thread %ld의 강제 종료 user: '%-.48s'"
        nla "%s: Afsluiten afgedwongen van thread %ld  gebruiker: '%-.48s'"
        nor "%s: Påtvinget avslutning av tråd %ld  bruker: '%-.48s'"
        norwegian-ny "%s: Påtvinga avslutning av tråd %ld  brukar: '%-.48s'"
        pol "%s: Wymuszenie zamknięcia w?tku %ld  użytkownik: '%-.48s'"
        por "%s: Forçando finalização da 'thread' %ld - usuário '%-.48s'"
        rum "%s: Terminare fortata a thread-ului %ld  utilizatorului: '%-.48s'"
        rus "%s: Принудительно закрываем поток %ld  пользователя: '%-.48s'"
        serbian "%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.48s'"
        slo "%s: násilné ukončenie vlákna %ld užívateľa '%-.48s'"
        spa "%s: Forzando a cerrar el hilo (thread) %ld usuario: '%-.48s'"
        swe "%s: Stänger av tråd %ld; användare: '%-.48s'"
        ukr "%s: Прискорюю закриття гілки %ld користувача: '%-.48s'"
ER_IPSOCK_ERROR 08S01 
        chi "无法创建IP插口"
        cze "Nemohu vytvořit IP socket"
        dan "Kan ikke oprette IP socket"
        eng "Can't create IP socket"
        est "Ei suuda luua IP socketit"
        fre "Ne peut créer la connexion IP (socket)"
        ger "Kann IP-Socket nicht erzeugen"
        greek "Δεν είναι δυνατή η δημιουργία IP socket"
        hindi "IP SOCKET नहीं बना सकते"
        hun "Az IP socket nem hozhato letre"
        ita "Impossibile creare il socket IP"
        jpn "IPソケットを作成できません。"
        kor "IP 소켓을 만들지 못했습니다."
        nla "Kan IP-socket niet openen"
        nor "Kan ikke opprette IP socket"
        norwegian-ny "Kan ikkje opprette IP socket"
        pol "Nie można stworzyć socket'u IP"
        por "Não pode criar o soquete IP"
        rum "Nu pot crea IP socket"
        rus "Невозможно создать IP-сокет"
        serbian "Ne mogu da kreiram IP socket"
        slo "Nemôžem vytvoriť IP socket"
        spa "No puedo crear IP socket"
        swe "Kan inte skapa IP-socket"
        ukr "Не можу створити IP роз'єм"
ER_NO_SUCH_INDEX 42S12 S1009
        chi "表 '%-.192s' 没有像 CREATE INDEX 中使用的索引;重新创建表"
        cze "Tabulka '%-.192s' nemá index odpovídající CREATE INDEX. Vytvořte tabulku znovu"
        dan "Tabellen '%-.192s' har ikke den nøgle, som blev brugt i CREATE INDEX. Genopret tabellen"
        eng "Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table"
        est "Tabelil '%-.192s' puuduvad võtmed. Loo tabel uuesti"
        fre "La table '%-.192s' n'a pas d'index comme celle utilisée dans CREATE INDEX. Recréez la table"
        ger "Tabelle '%-.192s' besitzt keinen wie den in CREATE INDEX verwendeten Index. Tabelle neu anlegen"
        greek "Ο πίνακας '%-.192s' δεν έχει ευρετήριο (index) σαν αυτό που χρησιμοποιείτε στην CREATE INDEX. Παρακαλώ, ξαναδημιουργήστε τον πίνακα"
        hindi "CREATE INDEX में इस्तेमाल की गयी सूचि टेबल '%-.192s' में उपलब्ध नहीं है; टेबल को पुनः बनायें"
        hun "A(z) '%-.192s' tablahoz nincs meg a CREATE INDEX altal hasznalt index. Alakitsa at a tablat"
        ita "La tabella '%-.192s' non ha nessun indice come quello specificatato dalla CREATE INDEX. Ricrea la tabella"
        jpn "表 '%-.192s' に以前CREATE INDEXで作成された索引がありません。表を作り直してください。"
        kor "테이블 '%-.192s'는 인덱스를 만들지 않았습니다. alter 테이블명령을 이용하여 테이블을 수정하세요..."
        nla "Tabel '%-.192s' heeft geen INDEX zoals deze gemaakt worden met CREATE INDEX. Maak de tabel opnieuw"
        nor "Tabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Gjenopprett tabellen"
        norwegian-ny "Tabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Oprett tabellen på nytt"
        pol "Tabela '%-.192s' nie ma indeksu takiego jak w CREATE INDEX. Stwórz tabelę"
        por "Tabela '%-.192s' não possui um índice como o usado em CREATE INDEX. Recrie a tabela"
        rum "Tabela '%-.192s' nu are un index ca acela folosit in CREATE INDEX. Re-creeaza tabela"
        rus "В таблице '%-.192s' нет такого индекса, как в CREATE INDEX. Создайте таблицу заново"
        serbian "Tabela '%-.192s' nema isti indeks kao onaj upotrebljen pri komandi 'CREATE INDEX'. Napravite tabelu ponovo"
        slo "Tabuľka '%-.192s' nemá index zodpovedajúci CREATE INDEX. Vytvorte tabulku znova"
        spa "La tabla '%-.192s' no tiene un índice como el usado en CREATE INDEX. Crea de nuevo la tabla"
        swe "Tabellen '%-.192s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen"
        ukr "Таблиця '%-.192s' має індекс, що не співпадає з вказанним у CREATE INDEX. Створіть таблицю знову"
ER_WRONG_FIELD_TERMINATORS 42000 S1009
        chi "字段分隔符参数不合预期;查看文档"
        cze "Argument separátoru položek nebyl očekáván. Přečtěte si manuál"
        dan "Felt adskiller er ikke som forventet, se dokumentationen"
        eng "Field separator argument is not what is expected; check the manual"
        est "Väljade eraldaja erineb oodatust. Tutvu kasutajajuhendiga"
        fre "Séparateur de champs inconnu.  Vérifiez dans le manuel"
        ger "Feldbegrenzer-Argument ist nicht in der erwarteten Form. Bitte im Handbuch nachlesen"
        greek "Ο διαχωριστής πεδίων δεν είναι αυτός που αναμενόταν. Παρακαλώ ανατρέξτε στο manual"
        hindi "फील्ड विभाजक आर्गुमेंट गलत है; मैनुअल की जाँच करें"
        hun "A mezoelvalaszto argumentumok nem egyeznek meg a varttal. Nezze meg a kezikonyvben!"
        ita "L'argomento 'Field separator' non e` quello atteso. Controlla il manuale"
        jpn "フィールド区切り文字が予期せぬ使われ方をしています。マニュアルを確認して下さい。"
        kor "필드 구분자 인수들이 완전하지 않습니다. 메뉴얼을 찾아 보세요."
        nla "De argumenten om velden te scheiden zijn anders dan verwacht. Raadpleeg de handleiding"
        nor "Felt skiller argumentene er ikke som forventet, se dokumentasjonen"
        norwegian-ny "Felt skiljer argumenta er ikkje som venta, sjå dokumentasjonen"
        pol "Nie oczekiwano separatora. SprawdĽ podręcznik"
        por "Argumento separador de campos não é o esperado. Cheque o manual"
        rum "Argumentul pentru separatorul de cimpuri este diferit de ce ma asteptam. Verifica manualul"
        rus "Аргумент разделителя полей - не тот, который ожидался. Обращайтесь к документации"
        serbian "Argument separatora polja nije ono što se očekivalo. Proverite uputstvo MariaDB server-a"
        slo "Argument oddeľovač polí nezodpovedá požiadavkám. Skontrolujte v manuáli"
        spa "Los separadores de argumentos del campo no son los especificados. Compruebe el manual"
        swe "Fältseparatorerna är vad som förväntades. Kontrollera mot manualen"
        ukr "Хибний розділювач полів. Почитайте документацію"
ER_BLOBS_AND_NO_TERMINATED 42000 S1009
        chi "您不能对 BLOB 使用固定的行长度;请使用 'fields terminated by'"
        cze "Není možné použít pevný rowlength s BLOBem. Použijte 'fields terminated by'"
        dan "Man kan ikke bruge faste feltlængder med BLOB. Brug i stedet 'fields terminated by'"
        eng "You can't use fixed rowlength with BLOBs; please use 'fields terminated by'"
        est "BLOB-tüüpi väljade olemasolul ei saa kasutada fikseeritud väljapikkust. Vajalik 'fields terminated by' määrang"
        fre "Vous ne pouvez utiliser des lignes de longueur fixe avec des BLOBs. Utiliser 'fields terminated by'"
        ger "Eine feste Zeilenlänge kann für BLOB-Felder nicht verwendet werden. Bitte 'fields terminated by' verwenden"
        greek "Δεν μπορείτε να χρησιμοποιήσετε fixed rowlength σε BLOBs. Παρακαλώ χρησιμοποιείστε 'fields terminated by'"
        hindi "BLOBs को निश्चित लंबाई की पंक्ति के साथ प्रयोग नहीं किया जा सकता है; 'FIELDS TERMINATED BY' का इस्तेमाल करें"
        hun "Fix hosszusagu BLOB-ok nem hasznalhatok. Hasznalja a 'mezoelvalaszto jelet' "
        ita "Non possono essere usate righe a lunghezza fissa con i BLOB. Usa 'FIELDS TERMINATED BY'"
        jpn "BLOBには固定長レコードが使用できません。'FIELDS TERMINATED BY'句を使用して下さい。"
        kor "BLOB로는 고정길이의 lowlength를 사용할 수 없습니다. 'fields terminated by'를 사용하세요."
        nla "Bij het gebruik van BLOBs is het niet mogelijk om vaste rijlengte te gebruiken. Maak s.v.p. gebruik van 'fields terminated by'"
        nor "En kan ikke bruke faste feltlengder med BLOB. Vennlisgt bruk 'fields terminated by'"
        norwegian-ny "Ein kan ikkje bruke faste feltlengder med BLOB. Vennlisgt bruk 'fields terminated by'"
        pol "Nie można użyć stałej długo?ci wiersza z polami typu BLOB. Użyj 'fields terminated by'"
        por "Você não pode usar comprimento de linha fixo com BLOBs. Por favor, use campos com comprimento limitado"
        rum "Nu poti folosi lungime de cimp fix pentru BLOB-uri. Foloseste 'fields terminated by'"
        rus "Фиксированный размер записи с полями типа BLOB использовать нельзя, применяйте 'fields terminated by'"
        serbian "Ne možete koristiti fiksnu veličinu sloga kada imate BLOB polja. Molim koristite 'fields terminated by' opciju"
        slo "Nie je možné použiť fixnú dĺžku s BLOBom. Použite 'fields terminated by'"
        spa "No se pueden usar longitudes fijas de filas con BLOBs. Por favor, use 'campos terminados por'"
        swe "Man kan inte använda fast radlängd med blobs. Använd 'fields terminated by'"
        ukr "Не можна використовувати сталу довжину строки з BLOB. Зкористайтеся 'fields terminated by'"
ER_TEXTFILE_NOT_READABLE  
        chi "文件'%-.128s'必须位于数据库目录中,或所有人都可以读取"
        cze "Soubor '%-.128s' musí být v adresáři databáze nebo čitelný pro všechny"
        dan "Filen '%-.128s' skal være i database-folderen, eller kunne læses af alle"
        eng "The file '%-.128s' must be in the database directory or be readable by all"
        est "Fail '%-.128s' peab asuma andmebaasi kataloogis või olema kõigile loetav"
        fre "Le fichier '%-.128s' doit être dans le répertoire de la base et lisible par tous"
        ger "Datei '%-.128s' muss im Datenbank-Verzeichnis vorhanden oder lesbar für alle sein"
        greek "Το αρχείο '%-.128s' πρέπει να υπάρχει στο database directory ή να μπορεί να διαβαστεί από όλους"
        hindi "फ़ाइल '%-.128s' डेटाबेस डायरेक्टरी में या सभी के द्वारा पठनीय होना चाहिए"
        hun "A(z) '%-.128s'-nak az adatbazis konyvtarban kell lennie, vagy mindenki szamara olvashatonak"
        ita "Il file '%-.128s' deve essere nella directory del database e deve essere leggibile da tutti"
        jpn "ファイル '%-.128s' はデータベースディレクトリにあるか、全てのユーザーから読める必要があります。"
        kor "'%-.128s' 화일는 데이타베이스 디렉토리에 존재하거나 모두에게 읽기 가능하여야 합니다."
        nla "Het bestand '%-.128s' dient in de database directory voor the komen of leesbaar voor iedereen te zijn"
        nor "Filen '%-.128s' må være i database-katalogen for å være lesbar for alle"
        norwegian-ny "Filen '%-.128s' må være i database-katalogen for å være lesbar for alle"
        pol "Plik '%-.128s' musi znajdować sie w katalogu bazy danych lub mieć prawa czytania przez wszystkich"
        por "Arquivo '%-.128s' tem que estar no diretório do banco de dados ou ter leitura possível para todos"
        rum "Fisierul '%-.128s' trebuie sa fie in directorul bazei de data sau trebuie sa poata sa fie citit de catre toata lumea (verifica permisiile)"
        rus "Файл '%-.128s' должен находиться в том же каталоге, что и база данных, или быть общедоступным для чтения"
        serbian "File '%-.128s' mora biti u direktorijumu gde su file-ovi baze i mora imati odgovarajuća prava pristupa"
        slo "Súbor '%-.128s' musí byť v adresári databázy, alebo čitateľný pre všetkých"
        spa "El fichero/archivo '%-.128s' debe de estar en el directorio de la base de datos o debe de ser legible por todos"
        swe "Textfilen '%-.128s' måste finnas i databasbiblioteket eller vara läsbar för alla"
        ukr "Файл '%-.128s' повинен бути у теці бази данних або мати встановлене право на читання для усіх"
ER_FILE_EXISTS_ERROR  
        chi "文件'%-.200s'已经存在"
        cze "Soubor '%-.200s' již existuje"
        dan "Filen '%-.200s' eksisterer allerede"
        eng "File '%-.200s' already exists"
        est "Fail '%-.200s' juba eksisteerib"
        fre "Le fichier '%-.200s' existe déjà"
        ger "Datei '%-.200s' bereits vorhanden"
        greek "Το αρχείο '%-.200s' υπάρχει ήδη"
        hindi "फ़ाइल '%-.200s' पहले से मौजूद है"
        hun "A '%-.200s' file mar letezik"
        ita "Il file '%-.200s' esiste gia`"
        jpn "ファイル '%-.200s' はすでに存在します。"
        kor "'%-.200s' 화일은 이미 존재합니다."
        nla "Het bestand '%-.200s' bestaat reeds"
        nor "Filen '%-.200s' eksisterte allerede"
        norwegian-ny "Filen '%-.200s' eksisterte allereide"
        pol "Plik '%-.200s' już istnieje"
        por "Arquivo '%-.200s' já existe"
        rum "Fisierul '%-.200s' exista deja"
        rus "Файл '%-.200s' уже существует"
        serbian "File '%-.200s' već postoji"
        slo "Súbor '%-.200s' už existuje"
        spa "El fichero/archivo '%-.200s' ya existe"
        swe "Filen '%-.200s' existerar redan"
        ukr "Файл '%-.200s' вже існує"
ER_LOAD_INFO  
        chi "记录:%ld删除:%ld跳过:%ld警告:%ld"
        cze "Záznamů: %ld  Vymazáno: %ld  Přeskočeno: %ld  Varování: %ld"
        dan "Poster: %ld  Fjernet: %ld  Sprunget over: %ld  Advarsler: %ld"
        eng "Records: %ld  Deleted: %ld  Skipped: %ld  Warnings: %ld"
        est "Kirjeid: %ld  Kustutatud: %ld  Vahele jäetud: %ld  Hoiatusi: %ld"
        fre "Enregistrements: %ld  Effacés: %ld  Non traités: %ld  Avertissements: %ld"
        ger "Datensätze: %ld  Gelöscht: %ld  Ausgelassen: %ld  Warnungen: %ld"
        greek "Εγγραφές: %ld  Διαγραφές: %ld  Παρεκάμφθησαν: %ld  Προειδοποιήσεις: %ld"
        hindi "रिकॉर्ड: %ld हटाए गए: %ld छोड़ दिए गए: %ld चेतावनी: %ld"
        hun "Rekordok: %ld  Torolve: %ld  Skipped: %ld  Warnings: %ld"
        ita "Records: %ld  Cancellati: %ld  Saltati: %ld  Avvertimenti: %ld"
        jpn "レコード数: %ld  削除: %ld  スキップ: %ld  警告: %ld"
        kor "레코드: %ld개  삭제: %ld개  스킵: %ld개  경고: %ld개"
        nla "Records: %ld  Verwijderd: %ld  Overgeslagen: %ld  Waarschuwingen: %ld"
        nor "Poster: %ld  Fjernet: %ld  Hoppet over: %ld  Advarsler: %ld"
        norwegian-ny "Poster: %ld  Fjerna: %ld  Hoppa over: %ld  Åtvaringar: %ld"
        pol "Recordów: %ld  Usuniętych: %ld  Pominiętych: %ld  Ostrzeżeń: %ld"
        por "Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld"
        rum "Recorduri: %ld  Sterse: %ld  Sarite (skipped): %ld  Atentionari (warnings): %ld"
        rus "Записей: %ld  Удалено: %ld  Пропущено: %ld  Предупреждений: %ld"
        serbian "Slogova: %ld  Izbrisano: %ld  Preskočeno: %ld  Upozorenja: %ld"
        slo "Záznamov: %ld  Zmazaných: %ld  Preskočených: %ld  Varovania: %ld"
        spa "Registros: %ld Borrados: %ld Saltados: %ld Avisos: %ld"
        swe "Rader: %ld  Bortagna: %ld  Dubletter: %ld  Varningar: %ld"
        ukr "Записів: %ld  Видалено: %ld  Пропущено: %ld  Застережень: %ld"
ER_ALTER_INFO  
        chi "记录: %ld  重复: %ld"
        cze "Záznamů: %ld  Zdvojených: %ld"
        dan "Poster: %ld  Ens: %ld"
        eng "Records: %ld  Duplicates: %ld"
        est "Kirjeid: %ld  Kattuvaid: %ld"
        fre "Enregistrements: %ld  Doublons: %ld"
        ger "Datensätze: %ld  Duplikate: %ld"
        greek "Εγγραφές: %ld  Επαναλήψεις: %ld"
        hindi "रिकॉर्ड: %ld डुप्लिकेट: %ld"
        hun "Rekordok: %ld  Duplikalva: %ld"
        ita "Records: %ld  Duplicati: %ld"
        jpn "レコード数: %ld  重複: %ld"
        kor "레코드: %ld개  중복: %ld개"
        nla "Records: %ld  Dubbel: %ld"
        nor "Poster: %ld  Like: %ld"
        norwegian-ny "Poster: %ld  Like: %ld"
        pol "Rekordów: %ld  Duplikatów: %ld"
        por "Registros: %ld - Duplicados: %ld"
        rum "Recorduri: %ld  Duplicate: %ld"
        rus "Записей: %ld  Дубликатов: %ld"
        serbian "Slogova: %ld  Duplikata: %ld"
        slo "Záznamov: %ld  Opakovaných: %ld"
        spa "Registros: %ld  Duplicados: %ld"
        swe "Rader: %ld  Dubletter: %ld"
        ukr "Записів: %ld  Дублікатів: %ld"
ER_WRONG_SUB_KEY  
        chi "前缀索引不正确;使用的索引部分不是字符串,使用的长度比索引部分长,或者存储引擎不支持独特前缀索引"
        cze "Chybná podčást klíče -- není to řetězec nebo je delší než délka části klíče"
        dan "Forkert indeksdel. Den anvendte nøgledel er ikke en streng eller længden er større end nøglelængden"
        eng "Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys"
        est "Vigane võtme osa. Kasutatud võtmeosa ei ole string tüüpi, määratud pikkus on pikem kui võtmeosa või tabelihandler ei toeta seda tüüpi võtmeid"
        fre "Mauvaise sous-clef. Ce n'est pas un 'string' ou la longueur dépasse celle définie dans la clef"
        ger "Falscher Unterteilschlüssel. Der verwendete Schlüsselteil ist entweder kein String, die verwendete Länge ist länger als der Teilschlüssel oder die Speicher-Engine unterstützt keine Unterteilschlüssel"
        greek "Εσφαλμένο sub part key. Το χρησιμοποιούμενο key part δεν είναι string ή το μήκος του είναι μεγαλύτερο"
        hun "Rossz alkulcs. A hasznalt kulcsresz nem karaktersorozat vagy hosszabb, mint a kulcsresz"
        ita "Sotto-parte della chiave errata. La parte di chiave utilizzata non e` una stringa o la lunghezza e` maggiore della parte di chiave"
        jpn "キーのプレフィックスが不正です。キーが文字列ではないか、プレフィックス長がキーよりも長いか、ストレージエンジンが一意索引のプレフィックス指定をサポートしていません。"
        kor "부정확한 서버 파트 키. 사용된 키 파트가 스트링이 아니거나 키 파트의 길이가 너무 깁니다."
        nla "Foutief sub-gedeelte van de zoeksleutel. De gebruikte zoeksleutel is geen onderdeel van een string of of de gebruikte lengte is langer dan de zoeksleutel"
        nor "Feil delnøkkel. Den brukte delnøkkelen er ikke en streng eller den oppgitte lengde er lengre enn nøkkel lengden"
        norwegian-ny "Feil delnykkel. Den brukte delnykkelen er ikkje ein streng eller den oppgitte lengda er lengre enn nykkellengden"
        pol "Błędna podczę?ć klucza. Użyta czę?ć klucza nie jest łańcuchem lub użyta długo?ć  jest większa niż czę?ć klucza"
        por "Sub parte da chave incorreta. A parte da chave usada não é uma 'string' ou o comprimento usado é maior que parte da chave ou o manipulador de tabelas não suporta sub chaves únicas"
        rum "Componentul cheii este incorrect. Componentul folosit al cheii nu este un sir sau lungimea folosita este mai lunga decit lungimea cheii"
        rus "Некорректная часть ключа. Используемая часть ключа не является строкой, указанная длина больше, чем длина части ключа, или обработчик таблицы не поддерживает уникальные части ключа"
        serbian "Pogrešan pod-ključ dela ključa. Upotrebljeni deo ključa nije string, upotrebljena dužina je veća od dela ključa ili handler tabela ne podržava jedinstvene pod-ključeve"
        slo "Incorrect prefix key; the used key part isn't a string or the used length is longer than the key part"
        spa "Prefijo incorrecto de clave; la parte utilizada de la clave no es una cadena, la longitud usada es mayor que la parte de la clave o el motor de almacenaje no soporta claves con prefijo único"
        swe "Felaktig delnyckel. Nyckeldelen är inte en sträng eller den angivna längden är längre än kolumnlängden"
        ukr "Невірна частина ключа. Використана частина ключа не є строкою, задовга або вказівник таблиці не підтримує унікальних частин ключей"
ER_CANT_REMOVE_ALL_FIELDS 42000 
        chi "您不能使用 ALTER TABLE 删除所有列;改用 DROP TABLE"
        cze "Není možné vymazat všechny položky s ALTER TABLE. Použijte DROP TABLE"
        dan "Man kan ikke slette alle felter med ALTER TABLE. Brug DROP TABLE i stedet"
        eng "You can't delete all columns with ALTER TABLE; use DROP TABLE instead"
        est "ALTER TABLE kasutades ei saa kustutada kõiki tulpasid. Kustuta tabel DROP TABLE abil"
        fre "Vous ne pouvez effacer tous les champs avec ALTER TABLE. Utilisez DROP TABLE"
        ger "Mit ALTER TABLE können nicht alle Felder auf einmal gelöscht werden. Dafür DROP TABLE verwenden"
        greek "Δεν είναι δυνατή η διαγραφή όλων των πεδίων με ALTER TABLE. Παρακαλώ χρησιμοποιείστε DROP TABLE"
        hindi "ALTER TABLE का इस्तेमाल कर सभी कॉलम्स को हटाया नहीं जा सकता; DROP TABLE का इस्तेमाल करें"
        hun "Az osszes mezo nem torolheto az ALTER TABLE-lel. Hasznalja a DROP TABLE-t helyette"
        ita "Non si possono cancellare tutti i campi con una ALTER TABLE. Utilizzare DROP TABLE"
        jpn "ALTER TABLE では全ての列の削除はできません。DROP TABLE を使用してください。"
        kor "ALTER TABLE 명령으로는 모든 칼럼을 지울 수 없습니다. DROP TABLE 명령을 이용하세요."
        nla "Het is niet mogelijk alle velden te verwijderen met ALTER TABLE. Gebruik a.u.b. DROP TABLE hiervoor!"
        nor "En kan ikke slette alle felt med ALTER TABLE. Bruk DROP TABLE isteden"
        norwegian-ny "Ein kan ikkje slette alle felt med ALTER TABLE. Bruk DROP TABLE istadenfor"
        pol "Nie można usun?ć wszystkich pól wykorzystuj?c ALTER TABLE. W zamian użyj DROP TABLE"
        por "Você não pode deletar todas as colunas com ALTER TABLE; use DROP TABLE em seu lugar"
        rum "Nu poti sterge toate coloanele cu ALTER TABLE. Foloseste DROP TABLE in schimb"
        rus "Нельзя удалить все столбцы с помощью ALTER TABLE. Используйте  DROP TABLE"
        serbian "Ne možete da izbrišete sve kolone pomoću komande 'ALTER TABLE'. Upotrebite komandu 'DROP TABLE' ako želite to da uradite"
        slo "One nemôžem zmazať all fields with ALTER TABLE; use DROP TABLE instead"
        spa "No se pueden borrar todas las columnas con ALTER TABLE. Use DROP TABLE para hacerlo"
        swe "Man kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE istället"
        ukr "Не можливо видалити всі стовбці за допомогою ALTER TABLE. Для цього скористайтеся DROP TABLE"
ER_CANT_DROP_FIELD_OR_KEY 42000 
        chi "不能 DROP %s %`-.192s; 检查它是否存在"
        cze "Nemohu zrušit (DROP %s) %`-.192s. Zkontrolujte, zda neexistují záznamy/klíče"
        dan "Kan ikke udføre DROP %s %`-.192s. Undersøg om feltet/nøglen eksisterer"
        eng "Can't DROP %s %`-.192s; check that it exists"
        est "Ei suuda kustutada (DROP %s) %`-.192s. Kontrolli kas tulp/võti eksisteerib"
        fre "Ne peut effacer (DROP %s) %`-.192s. Vérifiez s'il existe"
        ger "DROP %s: Kann %`-.192s nicht löschen. Existiert es?"
        greek "Αδύνατη η διαγραφή (DROP %s) %`-.192s. Παρακαλώ ελέγξτε αν το πεδίο/κλειδί υπάρχει"
        hindi "%s %`-.192s को ड्रॉप नहीं कर सकते हैं; कृपया जाँच करें कि यह मौजूद है"
        hun "A DROP %s %`-.192s nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e"
        ita "Impossibile cancellare (DROP %s) %`-.192s. Controllare che il campo chiave esista"
        nla "DROP %s: Kan %`-.192s niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat"
        nor "Kan ikke DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterer"
        norwegian-ny "Kan ikkje DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterar"
        pol "Nie można wykonać operacji DROP %s %`-.192s. SprawdĽ, czy to pole/klucz istnieje"
        por "Não se pode fazer DROP %s %`-.192s. Confira se esta coluna/chave existe"
        rum "Nu pot sa DROP %s %`-.192s. Verifica daca coloana/cheia exista"
        rus "Невозможно удалить (DROP %s) %`-.192s. Убедитесь что он действительно существует"
        serbian "Ne mogu da izvršim komandu drop 'DROP %s' na %`-.192s. Proverite da li ta kolona (odnosno ključ) postoji"
        slo "Nemôžem zrušiť (DROP %s) %`-.192s. Skontrolujte, či neexistujú záznamy/kľúče"
        spa "No puedo eliminar %s %`-.192s; compruebe que ya existe"
        swe "Kan inte ta bort (DROP %s) %`-.192s. Kontrollera att begränsningen/fältet/nyckel finns"
        ukr "Не можу DROP %s %`-.192s. Перевірте, чи він існує"
ER_INSERT_INFO  
        chi "记录: %ld  重复: %ld  警告: %ld"
        cze "Záznamů: %ld  Zdvojených: %ld  Varování: %ld"
        dan "Poster: %ld  Ens: %ld  Advarsler: %ld"
        eng "Records: %ld  Duplicates: %ld  Warnings: %ld"
        est "Kirjeid: %ld  Kattuvaid: %ld  Hoiatusi: %ld"
        fre "Enregistrements: %ld  Doublons: %ld  Avertissements: %ld"
        ger "Datensätze: %ld  Duplikate: %ld  Warnungen: %ld"
        greek "Εγγραφές: %ld  Επαναλήψεις: %ld  Προειδοποιήσεις: %ld"
        hindi "रिकॉर्ड: %ld डुप्लिकेट: %ld चेतावनी: %ld"
        hun "Rekordok: %ld  Duplikalva: %ld  Warnings: %ld"
        ita "Records: %ld  Duplicati: %ld  Avvertimenti: %ld"
        jpn "レコード数: %ld  重複数: %ld  警告: %ld"
        kor "레코드: %ld개  중복: %ld개  경고: %ld개"
        nla "Records: %ld  Dubbel: %ld  Waarschuwing: %ld"
        nor "Poster: %ld  Like: %ld  Advarsler: %ld"
        norwegian-ny "Postar: %ld  Like: %ld  Åtvaringar: %ld"
        pol "Rekordów: %ld  Duplikatów: %ld  Ostrzeżeń: %ld"
        por "Registros: %ld - Duplicados: %ld - Avisos: %ld"
        rum "Recorduri: %ld  Duplicate: %ld  Atentionari (warnings): %ld"
        rus "Записей: %ld  Дубликатов: %ld  Предупреждений: %ld"
        serbian "Slogova: %ld  Duplikata: %ld  Upozorenja: %ld"
        slo "Záznamov: %ld  Opakovaných: %ld  Varovania: %ld"
        spa "Registros: %ld  Duplicados: %ld  Avisos: %ld"
        swe "Rader: %ld  Dubletter: %ld  Varningar: %ld"
        ukr "Записів: %ld  Дублікатів: %ld  Застережень: %ld"
ER_UPDATE_TABLE_USED
        chi "表 '%-.192s' 被指定了两次, 即作为 '%s' 的目标,又作为数据的独立源"
        eng "Table '%-.192s' is specified twice, both as a target for '%s' and as a separate source for data"
        swe "Table '%-.192s' är använd två gånger. Både för '%s' och för att hämta data"
        ukr "Таблиця '%-.192s' вказується двічі, як цільова для '%s', так і як окреме джерело даних"
ER_NO_SUCH_THREAD  
        chi "未知线程ID:%lu"
        cze "Neznámá identifikace threadu: %lu"
        dan "Ukendt tråd id: %lu"
        eng "Unknown thread id: %lu"
        est "Tundmatu lõim: %lu"
        fre "Numéro de tâche inconnu: %lu"
        ger "Unbekannte Thread-ID: %lu"
        greek "Αγνωστο thread id: %lu"
        hindi "अज्ञात थ्रेड ID: %lu"
        hun "Ervenytelen szal (thread) id: %lu"
        ita "Thread id: %lu sconosciuto"
        jpn "不明なスレッドIDです: %lu"
        kor "알수 없는 쓰레드 id: %lu"
        nla "Onbekend thread id: %lu"
        nor "Ukjent tråd id: %lu"
        norwegian-ny "Ukjent tråd id: %lu"
        pol "Nieznany identyfikator w?tku: %lu"
        por "'Id' de 'thread' %lu desconhecido"
        rum "Id-ul: %lu thread-ului este necunoscut"
        rus "Неизвестный номер потока: %lu"
        serbian "Nepoznat thread identifikator: %lu"
        slo "Neznáma identifikácia vlákna: %lu"
        spa "Identificador del hilo (thread): %lu desconocido"
        swe "Finns ingen tråd med id %lu"
        ukr "Невідомий ідентифікатор гілки: %lu"
ER_KILL_DENIED_ERROR  
        chi "你不是线程%lld的所有者"
        cze "Nejste vlastníkem threadu %lld"
        dan "Du er ikke ejer af tråden %lld"
        eng "You are not owner of thread %lld"
        est "Ei ole lõime %lld omanik"
        fre "Vous n'êtes pas propriétaire de la tâche no: %lld"
        ger "Sie sind nicht Eigentümer von Thread %lld"
        greek "Δεν είσθε owner του thread %lld"
        hindi "आप थ्रेड %lld के OWNER नहीं हैं"
        hun "A %lld thread-nek mas a tulajdonosa"
        ita "Utente non proprietario del thread %lld"
        jpn "スレッド %lld のオーナーではありません。"
        kor "쓰레드(Thread) %lld의 소유자가 아닙니다."
        nla "U bent geen bezitter van thread %lld"
        nor "Du er ikke eier av tråden %lld"
        norwegian-ny "Du er ikkje eigar av tråd %lld"
        pol "Nie jeste? wła?cicielem w?tku %lld"
        por "Você não é proprietário da 'thread' %lld"
        rum "Nu sinteti proprietarul threadului %lld"
        rus "Вы не являетесь владельцем потока %lld"
        serbian "Vi niste vlasnik thread-a %lld"
        slo "Nie ste vlastníkom vlákna %lld"
        spa "No eres el propietario del hilo (thread) %lld"
        swe "Du är inte ägare till tråd %lld"
        ukr "Ви не володар гілки %lld"
ER_NO_TABLES_USED  
        chi "没有使用表"
        cze "Nejsou použity žádné tabulky"
        dan "Ingen tabeller i brug"
        eng "No tables used"
        est "Ühtegi tabelit pole kasutusel"
        fre "Aucune table utilisée"
        ger "Keine Tabellen verwendet"
        greek "Δεν χρησιμοποιήθηκαν πίνακες"
        hindi "कोई टेबल का इस्तेमाल नहीं हुआ"
        hun "Nincs hasznalt tabla"
        ita "Nessuna tabella usata"
        jpn "表が指定されていません。"
        kor "어떤 테이블도 사용되지 않았습니다."
        nla "Geen tabellen gebruikt"
        nor "Ingen tabeller i bruk"
        norwegian-ny "Ingen tabellar i bruk"
        pol "Nie ma żadej użytej tabeli"
        por "Nenhuma tabela usada"
        rum "Nici o tabela folosita"
        rus "Никакие таблицы не использованы"
        serbian "Nema upotrebljenih tabela"
        slo "Nie je použitá žiadna tabuľka"
        spa "No se están usando tablas"
        swe "Inga tabeller angivna"
        ukr "Не використано таблиць"
ER_TOO_BIG_SET  
        chi "列 %-.192s 和SET的字符串过多"
        cze "Příliš mnoho řetězců pro sloupec %-.192s a SET"
        dan "For mange tekststrenge til specifikationen af SET i kolonne %-.192s"
        eng "Too many strings for column %-.192s and SET"
        est "Liiga palju string tulbale %-.192s tüübile SET"
        fre "Trop de chaînes dans la colonne %-.192s avec SET"
        ger "Zu viele Strings für Feld %-.192s und SET angegeben"
        greek "Πάρα πολλά strings για το πεδίο %-.192s και SET"
        hun "Tul sok karakter: %-.192s es SET"
        ita "Troppe stringhe per la colonna %-.192s e la SET"
        jpn "SET型の列 '%-.192s' のメンバーの数が多すぎます。"
        kor "칼럼 %-.192s와 SET에서 스트링이 너무 많습니다."
        nla "Teveel strings voor kolom %-.192s en SET"
        nor "For mange tekststrenger kolonne %-.192s og SET"
        norwegian-ny "For mange tekststrengar felt %-.192s og SET"
        pol "Zbyt wiele łańcuchów dla kolumny %-.192s i polecenia SET"
        por "'Strings' demais para coluna '%-.192s' e SET"
        rum "Prea multe siruri pentru coloana %-.192s si SET"
        rus "Слишком много значений для столбца %-.192s в SET"
        serbian "Previše string-ova za kolonu '%-.192s' i komandu 'SET'"
        slo "Príliš mnoho reťazcov pre pole %-.192s a SET"
        spa "Demasiadas cadenas para la columna %-.192s y SET"
        swe "För många alternativ till kolumn %-.192s för SET"
        ukr "Забагато строк для стовбця %-.192s та SET"
ER_NO_UNIQUE_LOGFILE  
        chi "无法生成唯一的log-filename%-.200s.(1-999)"
        cze "Nemohu vytvořit jednoznačné jméno logovacího souboru %-.200s.(1-999)"
        dan "Kan ikke lave unikt log-filnavn %-.200s.(1-999)"
        eng "Can't generate a unique log-filename %-.200s.(1-999)"
        est "Ei suuda luua unikaalset logifaili nime %-.200s.(1-999)"
        fre "Ne peut générer un unique nom de journal %-.200s.(1-999)"
        ger "Kann keinen eindeutigen Dateinamen für die Logdatei %-.200s(1-999) erzeugen"
        greek "Αδύνατη η δημιουργία unique log-filename %-.200s.(1-999)"
        hindi "एक अनूठा लॉग-फ़ाइल नाम %-.200s.(1-999) उत्पन्न नहीं कर सके"
        hun "Egyedi log-filenev nem generalhato: %-.200s.(1-999)"
        ita "Impossibile generare un nome del file log unico %-.200s.(1-999)"
        jpn "一意なログファイル名 %-.200s.(1-999) を生成できません。"
        kor "Unique 로그화일 '%-.200s'를 만들수 없습니다.(1-999)"
        nla "Het is niet mogelijk een unieke naam te maken voor de logfile %-.200s.(1-999)"
        nor "Kan ikke lage unikt loggfilnavn %-.200s.(1-999)"
        norwegian-ny "Kan ikkje lage unikt loggfilnavn %-.200s.(1-999)"
        pol "Nie można stworzyć unikalnej nazwy pliku z logiem %-.200s.(1-999)"
        por "Não pode gerar um nome de arquivo de 'log' único '%-.200s'.(1-999)"
        rum "Nu pot sa generez un nume de log unic %-.200s.(1-999)"
        rus "Невозможно создать уникальное имя файла журнала %-.200s.(1-999)"
        serbian "Ne mogu da generišem jedinstveno ime log-file-a: '%-.200s.(1-999)'"
        slo "Nemôžem vytvoriť unikátne meno log-súboru %-.200s.(1-999)"
        spa "No puedo generar un único fichero/archivo de historial (log) llamado %-.200s.(1-999)"
        swe "Kan inte generera ett unikt filnamn %-.200s.(1-999)"
        ukr "Не можу згенерувати унікальне ім'я log-файлу %-.200s.(1-999)"
ER_TABLE_NOT_LOCKED_FOR_WRITE  
        chi "表 '%-.192s' 有 READ 锁,无法更新"
        cze "Tabulka '%-.192s' byla zamčena s READ a nemůže být změněna"
        dan "Tabellen '%-.192s' var låst med READ lås og kan ikke opdateres"
        eng "Table '%-.192s' was locked with a READ lock and can't be updated"
        est "Tabel '%-.192s' on lukustatud READ lukuga ning ei ole muudetav"
        fre "Table '%-.192s' verrouillée lecture (READ): modification impossible"
        ger "Tabelle '%-.192s' ist mit Lesesperre versehen und kann nicht aktualisiert werden"
        greek "Ο πίνακας '%-.192s' έχει κλειδωθεί με READ lock και δεν επιτρέπονται αλλαγές"
        hindi "टेबल '%-.192s' READ लॉक से बंद है और उसे बदल नहीं सकते"
        hun "A(z) '%-.192s' tabla zarolva lett (READ lock) es nem lehet frissiteni"
        ita "La tabella '%-.192s' e` soggetta a lock in lettura e non puo` essere aggiornata"
        jpn "表 '%-.192s' はREADロックされていて、更新できません。"
        kor "테이블 '%-.192s'는 READ 락이 잠겨있어서 갱신할 수 없습니다."
        nla "Tabel '%-.192s' was gelocked met een lock om te lezen. Derhalve kunnen geen wijzigingen worden opgeslagen"
        nor "Tabellen '%-.192s' var låst med READ lås og kan ikke oppdateres"
        norwegian-ny "Tabellen '%-.192s' var låst med READ lås og kan ikkje oppdaterast"
        pol "Tabela '%-.192s' została zablokowana przez READ i nie może zostać zaktualizowana"
        por "Tabela '%-.192s' foi travada com trava de leitura e não pode ser atualizada"
        rum "Tabela '%-.192s' a fost locked cu un READ lock si nu poate fi actualizata"
        rus "Таблица '%-.192s' заблокирована уровнем READ lock и не может быть изменена"
        serbian "Tabela '%-.192s' je zaključana READ lock-om; iz nje se može samo čitati ali u nju se ne može pisati"
        slo "Tabuľka '%-.192s' bola zamknutá s READ a nemôže byť zmenená"
        spa "La tabla '%-.192s' ha sido bloqueada con un READ lock y no puede ser actualizada"
        swe "Tabell '%-.192s' kan inte uppdateras emedan den är låst för läsning"
        ukr "Таблицю '%-.192s' заблоковано тільки для читання, тому її не можна оновити"
ER_TABLE_NOT_LOCKED  
        chi "表 '%-.192s' 未使用 LOCK TABLES 锁定"
        cze "Tabulka '%-.192s' nebyla zamčena s LOCK TABLES"
        dan "Tabellen '%-.192s' var ikke låst med LOCK TABLES"
        eng "Table '%-.192s' was not locked with LOCK TABLES"
        est "Tabel '%-.192s' ei ole lukustatud käsuga LOCK TABLES"
        fre "Table '%-.192s' non verrouillée: utilisez LOCK TABLES"
        ger "Tabelle '%-.192s' wurde nicht mit LOCK TABLES gesperrt"
        greek "Ο πίνακας '%-.192s' δεν έχει κλειδωθεί με LOCK TABLES"
        hindi "टेबल '%-.192s' LOCK TABLES से बंद नहीं है"
        hun "A(z) '%-.192s' tabla nincs zarolva a LOCK TABLES-szel"
        ita "Non e` stato impostato il lock per la tabella '%-.192s' con LOCK TABLES"
        jpn "表 '%-.192s' は LOCK TABLES でロックされていません。"
        kor "테이블 '%-.192s'는 LOCK TABLES 명령으로 잠기지 않았습니다."
        nla "Tabel '%-.192s' was niet gelocked met LOCK TABLES"
        nor "Tabellen '%-.192s' var ikke låst med LOCK TABLES"
        norwegian-ny "Tabellen '%-.192s' var ikkje låst med LOCK TABLES"
        pol "Tabela '%-.192s' nie została zablokowana poleceniem LOCK TABLES"
        por "Tabela '%-.192s' não foi travada com LOCK TABLES"
        rum "Tabela '%-.192s' nu a fost locked cu LOCK TABLES"
        rus "Таблица '%-.192s' не была заблокирована с помощью LOCK TABLES"
        serbian "Tabela '%-.192s' nije bila zaključana komandom 'LOCK TABLES'"
        slo "Tabuľka '%-.192s' nebola zamknutá s LOCK TABLES"
        spa "La tabla '%-.192s' no fue bloqueada con LOCK TABLES"
        swe "Tabell '%-.192s' är inte låst med LOCK TABLES"
        ukr "Таблицю '%-.192s' не було блоковано з LOCK TABLES"
ER_UNUSED_17
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_WRONG_DB_NAME 42000 
        chi "数据库名称不正确'%-.100T'"
        cze "Nepřípustné jméno databáze '%-.100T'"
        dan "Ugyldigt database navn '%-.100T'"
        eng "Incorrect database name '%-.100T'"
        est "Vigane andmebaasi nimi '%-.100T'"
        fre "Nom de base de donnée illégal: '%-.100T'"
        ger "Unerlaubter Datenbankname '%-.100T'"
        greek "Λάθος όνομα βάσης δεδομένων '%-.100T'"
        hindi "डेटाबेस नाम '%-.100T' गलत है"
        hun "Hibas adatbazisnev: '%-.100T'"
        ita "Nome database errato '%-.100T'"
        jpn "データベース名 '%-.100T' は不正です。"
        kor "'%-.100T' 데이타베이스의 이름이 부정확합니다."
        nla "Databasenaam '%-.100T' is niet getoegestaan"
        nor "Ugyldig database navn '%-.100T'"
        norwegian-ny "Ugyldig database namn '%-.100T'"
        pol "Niedozwolona nazwa bazy danych '%-.100T'"
        por "Nome de banco de dados '%-.100T' incorreto"
        rum "Numele bazei de date este incorect '%-.100T'"
        rus "Некорректное имя базы данных '%-.100T'"
        serbian "Pogrešno ime baze '%-.100T'"
        slo "Neprípustné meno databázy '%-.100T'"
        spa "Nombre incorrecto de base de datos '%-.100T'"
        swe "Felaktigt databasnamn '%-.100T'"
        ukr "Невірне ім'я бази данних '%-.100T'"
ER_WRONG_TABLE_NAME 42000 
        chi "表名不正确'%-.100s'"
        cze "Nepřípustné jméno tabulky '%-.100s'"
        dan "Ugyldigt tabel navn '%-.100s'"
        eng "Incorrect table name '%-.100s'"
        est "Vigane tabeli nimi '%-.100s'"
        fre "Nom de table illégal: '%-.100s'"
        ger "Unerlaubter Tabellenname '%-.100s'"
        greek "Λάθος όνομα πίνακα '%-.100s'"
        hindi "टेबल  नाम '%-.100s' गलत है"
        hun "Hibas tablanev: '%-.100s'"
        ita "Nome tabella errato '%-.100s'"
        jpn "表名 '%-.100s' は不正です。"
        kor "'%-.100s' 테이블 이름이 부정확합니다."
        nla "Niet toegestane tabelnaam '%-.100s'"
        nor "Ugyldig tabell navn '%-.100s'"
        norwegian-ny "Ugyldig tabell namn '%-.100s'"
        pol "Niedozwolona nazwa tabeli '%-.100s'..."
        por "Nome de tabela '%-.100s' incorreto"
        rum "Numele tabelei este incorect '%-.100s'"
        rus "Некорректное имя таблицы '%-.100s'"
        serbian "Pogrešno ime tabele '%-.100s'"
        slo "Neprípustné meno tabuľky '%-.100s'"
        spa "Nombre incorrecto de tabla '%-.100s'"
        swe "Felaktigt tabellnamn '%-.100s'"
        ukr "Невірне ім'я таблиці '%-.100s'"
ER_TOO_BIG_SELECT 42000 
        chi "SELECT 将检查超过 MAX_JOIN_SIZE 行;检查您的 WHERE 并使用 SET SQL_BIG_SELECTS=1 或 SET MAX_JOIN_SIZE=# 如果 SELECT 没问题"
        cze "Zadaný SELECT by procházel příliš mnoho záznamů a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v pořádku, použijte SET SQL_BIG_SELECTS=1"
        dan "SELECT ville undersøge for mange poster og ville sandsynligvis tage meget lang tid. Undersøg WHERE delen og brug SET SQL_BIG_SELECTS=1 hvis udtrykket er korrekt"
        eng "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay"
        est "SELECT lause peab läbi vaatama suure hulga kirjeid ja võtaks tõenäoliselt liiga kaua aega. Tasub kontrollida WHERE klauslit ja vajadusel kasutada käsku SET SQL_BIG_SELECTS=1"
        fre "SELECT va devoir examiner beaucoup d'enregistrements ce qui va prendre du temps. Vérifiez la clause WHERE et utilisez SET SQL_BIG_SELECTS=1 si SELECT se passe bien"
        ger "Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET MAX_JOIN_SIZE=# verwenden"
        greek "Το SELECT θα εξετάσει μεγάλο αριθμό εγγραφών και πιθανώς θα καθυστερήσει. Παρακαλώ εξετάστε τις παραμέτρους του WHERE και χρησιμοποιείστε SET SQL_BIG_SELECTS=1 αν το SELECT είναι σωστό"
        hindi "SELECT कमांड MAX_JOIN_SIZE पंक्तियों से भी ज्यादा की जांच करेगा; कृपया WHERE क्लॉज़ को जाचें अथवा SET SQL_BIG_SELECTS=1 या SET MAX_JOIN_SIZE=# का इस्तेमाल करें"
        hun "A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT okay"
        ita "La SELECT dovrebbe esaminare troppi record e usare troppo tempo. Controllare la WHERE e usa SET SQL_BIG_SELECTS=1 se e` tutto a posto"
        jpn "SELECTがMAX_JOIN_SIZEを超える行数を処理しました。WHERE句を確認し、SELECT文に問題がなければ、 SET SQL_BIG_SELECTS=1 または SET MAX_JOIN_SIZE=# を使用して下さい。"
        kor "SELECT 명령에서 너무 많은 레코드를 찾기 때문에 많은 시간이 소요됩니다. 따라서 WHERE 문을 점검하거나, 만약 SELECT가 ok되면  SET SQL_BIG_SELECTS=1 옵션을 사용하세요."
        nla "Het SELECT-statement zou te veel records analyseren en dus veel tijd in beslagnemen. Kijk het WHERE-gedeelte van de query na en kies SET SQL_BIG_SELECTS=1 als het stament in orde is"
        nor "SELECT ville undersøke for mange poster og ville sannsynligvis ta veldig lang tid. Undersøk WHERE klausulen og bruk SET SQL_BIG_SELECTS=1 om SELECTen er korrekt"
        norwegian-ny "SELECT ville undersøkje for mange postar og ville sannsynligvis ta veldig lang tid. Undersøk WHERE klausulen og bruk SET SQL_BIG_SELECTS=1 om SELECTen er korrekt"
        pol "Operacja SELECT będzie dotyczyła zbyt wielu rekordów i prawdopodobnie zajmie bardzo dużo czasu. SprawdĽ warunek WHERE i użyj SQL_OPTION BIG_SELECTS=1 je?li operacja SELECT jest poprawna"
        por "O SELECT examinaria registros demais e provavelmente levaria muito tempo. Cheque sua cláusula WHERE e use SET SQL_BIG_SELECTS=1, se o SELECT estiver correto"
        rum "SELECT-ul ar examina prea multe cimpuri si probabil ar lua prea mult timp; verifica clauza WHERE si foloseste SET SQL_BIG_SELECTS=1 daca SELECT-ul e okay"
        rus "Для такой выборки SELECT должен будет просмотреть слишком много записей и, видимо, это займет очень много времени. Проверьте ваше указание WHERE, и, если в нем все в порядке, укажите SET SQL_BIG_SELECTS=1"
        serbian "Komanda 'SELECT' će ispitati previše slogova i potrošiti previše vremena. Proverite vaš 'WHERE' filter i upotrebite 'SET OPTION SQL_BIG_SELECTS=1' ako želite baš ovakvu komandu"
        slo "Zadaná požiadavka SELECT by prechádzala príliš mnoho záznamov a trvala by príliš dlho. Skontrolujte tvar WHERE a ak je v poriadku, použite SET SQL_BIG_SELECTS=1"
        spa "El SELECT debería de examinar más de MAX_JOIN_SIZE filas; revise su WHERE y utilice SET SQL_BIG_SELECTS=1 o SET MAX_JOIN_SIZE=# si el SELECT está ok"
        swe "Den angivna frågan skulle läsa mer än MAX_JOIN_SIZE rader.  Kontrollera din WHERE och använd SET SQL_BIG_SELECTS=1 eller SET MAX_JOIN_SIZE=# ifall du vill hantera stora joins"
        ukr "Запиту SELECT потрібно обробити багато записів, що, певне, займе дуже багато часу. Перевірте ваше WHERE та використовуйте SET SQL_BIG_SELECTS=1, якщо цей запит SELECT є вірним"
ER_UNKNOWN_ERROR  
        chi "未知错误"
        cze "Neznámá chyba"
        dan "Ukendt fejl"
        eng "Unknown error"
        est "Tundmatu viga"
        fre "Erreur inconnue"
        ger "Unbekannter Fehler"
        greek "Προέκυψε άγνωστο λάθος"
        hindi "अज्ञात त्रुटि हुई"
        hun "Ismeretlen hiba"
        ita "Errore sconosciuto"
        jpn "不明なエラー"
        kor "알수 없는 에러입니다."
        nla "Onbekende Fout"
        nor "Ukjent feil"
        norwegian-ny "Ukjend feil"
        por "Erro desconhecido"
        rum "Eroare unknown"
        rus "Неизвестная ошибка"
        serbian "Nepoznata greška"
        slo "Neznámá chyba"
        spa "Error desconocido"
        swe "Okänt fel"
        ukr "Невідома помилка"
ER_UNKNOWN_PROCEDURE 42000 
        chi "未知存储过程 '%-.192s'"
        cze "Neznámá procedura %-.192s"
        dan "Ukendt procedure %-.192s"
        eng "Unknown procedure '%-.192s'"
        est "Tundmatu protseduur '%-.192s'"
        fre "Procédure %-.192s inconnue"
        ger "Unbekannte Prozedur '%-.192s'"
        greek "Αγνωστη διαδικασία '%-.192s'"
        hindi "अज्ञात प्रोसीजर '%-.192s'"
        hun "Ismeretlen eljaras: '%-.192s'"
        ita "Procedura '%-.192s' sconosciuta"
        jpn "'%-.192s' は不明なプロシージャです。"
        kor "알수 없는 수행문 : '%-.192s'"
        nla "Onbekende procedure %-.192s"
        nor "Ukjent prosedyre %-.192s"
        norwegian-ny "Ukjend prosedyre %-.192s"
        pol "Unkown procedure %-.192s"
        por "'Procedure' '%-.192s' desconhecida"
        rum "Procedura unknown '%-.192s'"
        rus "Неизвестная процедура '%-.192s'"
        serbian "Nepoznata procedura '%-.192s'"
        slo "Neznámá procedúra '%-.192s'"
        spa "Procedimiento desconocido %-.192s"
        swe "Okänd procedur: %-.192s"
        ukr "Невідома процедура '%-.192s'"
ER_WRONG_PARAMCOUNT_TO_PROCEDURE 42000 
        chi "存储过程 '%-.192s' 需要的参数和提供的参数不吻合"
        cze "Chybný počet parametrů procedury %-.192s"
        dan "Forkert antal  parametre til proceduren %-.192s"
        eng "Incorrect parameter count to procedure '%-.192s'"
        est "Vale parameetrite hulk protseduurile '%-.192s'"
        fre "Mauvais nombre de paramètres pour la procedure %-.192s"
        ger "Falsche Parameterzahl für Prozedur '%-.192s'"
        greek "Λάθος αριθμός παραμέτρων στη διαδικασία '%-.192s'"
        hindi "प्रोसीजर '%-.192s' के लिए पैरामीटर की संख्या गलत है"
        hun "Rossz parameter a(z) '%-.192s'eljaras szamitasanal"
        ita "Numero di parametri errato per la procedura '%-.192s'"
        jpn "プロシージャ '%-.192s' へのパラメータ数が不正です。"
        kor "'%-.192s' 수행문에 대한 부정확한 파라메터"
        nla "Foutief aantal parameters doorgegeven aan procedure %-.192s"
        nor "Feil parameter antall til prosedyren %-.192s"
        norwegian-ny "Feil parameter tal til prosedyra %-.192s"
        pol "Incorrect parameter count to procedure %-.192s"
        por "Número de parâmetros incorreto para a 'procedure' '%-.192s'"
        rum "Procedura '%-.192s' are un numar incorect de parametri"
        rus "Некорректное количество параметров для процедуры '%-.192s'"
        serbian "Pogrešan broj parametara za proceduru '%-.192s'"
        slo "Chybný počet parametrov procedúry '%-.192s'"
        spa "Contador de parámetros incorrecto para procedimiento %-.192s"
        swe "Felaktigt antal parametrar till procedur %-.192s"
        ukr "Хибна кількість параметрів процедури '%-.192s'"
ER_WRONG_PARAMETERS_TO_PROCEDURE  
        chi "存储过程 '%-.192s' 的参数不对"
        cze "Chybné parametry procedury %-.192s"
        dan "Forkert(e) parametre til proceduren %-.192s"
        eng "Incorrect parameters to procedure '%-.192s'"
        est "Vigased parameetrid protseduurile '%-.192s'"
        fre "Paramètre erroné pour la procedure %-.192s"
        ger "Falsche Parameter für Prozedur '%-.192s'"
        greek "Λάθος παράμετροι στην διαδικασία '%-.192s'"
        hindi "प्रोसीजर '%-.192s' के लिए पैरामीटर्स गलत हैं"
        hun "Rossz parameter a(z) '%-.192s' eljarasban"
        ita "Parametri errati per la procedura '%-.192s'"
        jpn "プロシージャ '%-.192s' へのパラメータが不正です。"
        kor "'%-.192s' 수행문에 대한 부정확한 파라메터"
        nla "Foutieve parameters voor procedure %-.192s"
        nor "Feil parametre til prosedyren %-.192s"
        norwegian-ny "Feil parameter til prosedyra %-.192s"
        pol "Incorrect parameters to procedure %-.192s"
        por "Parâmetros incorretos para a 'procedure' '%-.192s'"
        rum "Procedura '%-.192s' are parametrii incorecti"
        rus "Некорректные параметры для процедуры '%-.192s'"
        serbian "Pogrešni parametri prosleđeni proceduri '%-.192s'"
        slo "Chybné parametre procedúry '%-.192s'"
        spa "Parámetros incorrectos para procedimiento %-.192s"
        swe "Felaktiga parametrar till procedur %-.192s"
        ukr "Хибний параметер процедури '%-.192s'"
ER_UNKNOWN_TABLE 42S02 
        chi "未知表名 '%-.192s' 在 %-.32s"
        cze "Neznámá tabulka '%-.192s' v %-.32s"
        dan "Ukendt tabel '%-.192s' i %-.32s"
        eng "Unknown table '%-.192s' in %-.32s"
        est "Tundmatu tabel '%-.192s' %-.32s-s"
        fre "Table inconnue '%-.192s' dans %-.32s"
        ger "Unbekannte Tabelle '%-.192s' in '%-.32s'"
        greek "Αγνωστος πίνακας '%-.192s' σε %-.32s"
        hindi "टेबल '%-.192s', %-.32s में नहीं मिला"
        hun "Ismeretlen tabla: '%-.192s' %-.32s-ban"
        ita "Tabella '%-.192s' sconosciuta in %-.32s"
        jpn "'%-.192s' は %-.32s では不明な表です。"
        kor "알수 없는 테이블 '%-.192s' (데이타베이스 %-.32s)"
        nla "Onbekende tabel '%-.192s' in %-.32s"
        nor "Ukjent tabell '%-.192s' i %-.32s"
        norwegian-ny "Ukjend tabell '%-.192s' i %-.32s"
        pol "Unknown table '%-.192s' in %-.32s"
        por "Tabela '%-.192s' desconhecida em '%-.32s'"
        rum "Tabla '%-.192s' invalida in %-.32s"
        rus "Неизвестная таблица '%-.192s' в %-.32s"
        serbian "Nepoznata tabela '%-.192s' u '%-.32s'"
        slo "Neznáma tabuľka '%-.192s' v %-.32s"
        spa "Tabla desconocida '%-.192s' en %-.32s"
        swe "Okänd tabell '%-.192s' i '%-.32s'"
        ukr "Невідома таблиця '%-.192s' у %-.32s"
ER_FIELD_SPECIFIED_TWICE 42000 
        chi "列 '%-.192s' 被指定了两次"
        cze "Položka '%-.192s' je zadána dvakrát"
        dan "Feltet '%-.192s' er anvendt to gange"
        eng "Column '%-.192s' specified twice"
        est "Tulp '%-.192s' on määratletud topelt"
        fre "Champ '%-.192s' spécifié deux fois"
        ger "Feld '%-.192s' wurde zweimal angegeben"
        greek "Το πεδίο '%-.192s' έχει ορισθεί δύο φορές"
        hindi "कॉलम '%-.192s' दो बार निर्दिष्ट किया गया है"
        hun "A(z) '%-.192s' mezot ketszer definialta"
        ita "Campo '%-.192s' specificato 2 volte"
        jpn "列 '%-.192s' は2回指定されています。"
        kor "칼럼 '%-.192s'는 두번 정의되어 있습니다."
        nla "Veld '%-.192s' is dubbel gespecificeerd"
        nor "Feltet '%-.192s' er spesifisert to ganger"
        norwegian-ny "Feltet '%-.192s' er spesifisert to gangar"
        pol "Field '%-.192s' specified twice"
        por "Coluna '%-.192s' especificada duas vezes"
        rum "Coloana '%-.192s' specificata de doua ori"
        rus "Столбец '%-.192s' указан дважды"
        serbian "Kolona '%-.192s' je navedena dva puta"
        slo "Pole '%-.192s' je zadané dvakrát"
        spa "Columna '%-.192s' especificada dos veces"
        swe "Fält '%-.192s' är redan använt"
        ukr "Стовбець '%-.192s' зазначено двічі"
ER_INVALID_GROUP_FUNC_USE  
        chi "组函数使用无效"
        cze "Nesprávné použití funkce group"
        dan "Forkert brug af grupperings-funktion"
        eng "Invalid use of group function"
        est "Vigane grupeerimisfunktsiooni kasutus"
        fre "Utilisation invalide de la clause GROUP"
        ger "Falsche Verwendung einer Gruppierungsfunktion"
        greek "Εσφαλμένη χρήση της group function"
        hindi "ग्रुप फंक्शन का अवैध उपयोग"
        hun "A group funkcio ervenytelen hasznalata"
        ita "Uso non valido di una funzione di raggruppamento"
        jpn "集計関数の使用方法が不正です。"
        kor "잘못된 그룹 함수를 사용하였습니다."
        nla "Ongeldig gebruik van GROUP-functie"
        por "Uso inválido de função de agrupamento (GROUP)"
        rum "Folosire incorecta a functiei group"
        rus "Неправильное использование групповых функций"
        serbian "Pogrešna upotreba 'GROUP' funkcije"
        slo "Nesprávne použitie funkcie GROUP"
        spa "Inválido uso de función de grupo"
        swe "Felaktig användning av SQL grupp function"
        ukr "Хибне використання функції групування"
ER_UNSUPPORTED_EXTENSION 42000 
        chi "表'%-.192s'使用此MariaDB版本不存在的扩展"
        cze "Tabulka '%-.192s' používá rozšíření, které v této verzi MariaDB není"
        dan "Tabellen '%-.192s' bruger et filtypenavn som ikke findes i denne MariaDB version"
        eng "Table '%-.192s' uses an extension that doesn't exist in this MariaDB version"
        est "Tabel '%-.192s' kasutab laiendust, mis ei eksisteeri antud MariaDB versioonis"
        fre "Table '%-.192s' : utilise une extension invalide pour cette version de MariaDB"
        ger "Tabelle '%-.192s' verwendet eine Erweiterung, die in dieser MariaDB-Version nicht verfügbar ist"
        greek "Ο πίνακς '%-.192s' χρησιμοποιεί κάποιο extension που δεν υπάρχει στην έκδοση αυτή της MariaDB"
        hindi "टेबल '%-.192s' जिस इक्स्टेन्शन का उपयोग कर रहा है, वह इस MariaDB संस्करण में उपलब्ध नहीं है"
        hun "A(z) '%-.192s' tabla olyan bovitest hasznal, amely nem letezik ebben a MariaDB versioban"
        ita "La tabella '%-.192s' usa un'estensione che non esiste in questa versione di MariaDB"
        jpn "表 '%-.192s' は、このMariaDBバージョンには無い機能を使用しています。"
        kor "테이블 '%-.192s'는 확장명령을 이용하지만 현재의 MariaDB 버젼에서는 존재하지 않습니다."
        nla "Tabel '%-.192s' gebruikt een extensie, die niet in deze MariaDB-versie voorkomt"
        nor "Table '%-.192s' uses a extension that doesn't exist in this MariaDB version"
        norwegian-ny "Table '%-.192s' uses a extension that doesn't exist in this MariaDB version"
        pol "Table '%-.192s' uses a extension that doesn't exist in this MariaDB version"
        por "Tabela '%-.192s' usa uma extensão que não existe nesta versão do MariaDB"
        rum "Tabela '%-.192s' foloseste o extensire inexistenta in versiunea curenta de MariaDB"
        rus "В таблице '%-.192s' используются возможности, не поддерживаемые в этой версии MariaDB"
        serbian "Tabela '%-.192s' koristi ekstenziju koje ne postoji u ovoj verziji MariaDB-a"
        slo "Tabuľka '%-.192s' používa rozšírenie, ktoré v tejto verzii MariaDB nie je"
        spa "La tabla '%-.192s' usa una extensión que no existe en esta versión de MariaDB"
        swe "Tabell '%-.192s' har en extension som inte finns i denna version av MariaDB"
        ukr "Таблиця '%-.192s' використовує розширення, що не існує у цій версії MariaDB"
ER_TABLE_MUST_HAVE_COLUMNS 42000 
        chi "表必须至少有1列"
        cze "Tabulka musí mít alespoň jeden sloupec"
        dan "En tabel skal have mindst een kolonne"
        eng "A table must have at least 1 column"
        est "Tabelis peab olema vähemalt üks tulp"
        fre "Une table doit comporter au moins une colonne"
        ger "Eine Tabelle muss mindestens eine Spalte besitzen"
        greek "Ενας πίνακας πρέπει να έχει τουλάχιστον ένα πεδίο"
        hindi "एक टेबल में कम से कम एक कॉलम होना चाहिए"
        hun "A tablanak legalabb egy oszlopot tartalmazni kell"
        ita "Una tabella deve avere almeno 1 colonna"
        jpn "表には最低でも1個の列が必要です。"
        kor "하나의 테이블에서는 적어도 하나의 칼럼이 존재하여야 합니다."
        nla "Een tabel moet minstens 1 kolom bevatten"
        por "Uma tabela tem que ter pelo menos uma (1) coluna"
        rum "O tabela trebuie sa aiba cel putin o coloana"
        rus "В таблице должен быть как минимум один столбец"
        serbian "Tabela mora imati najmanje jednu kolonu"
        slo "Tabuľka musí mať aspoň 1 pole"
        spa "Una tabla debe de tener al menos 1 columna"
        swe "Tabeller måste ha minst 1 kolumn"
        ukr "Таблиця повинна мати хочаб один стовбець"
ER_RECORD_FILE_FULL  
        chi "表'%-.192s'已满"
        cze "Tabulka '%-.192s' je plná"
        dan "Tabellen '%-.192s' er fuld"
        eng "The table '%-.192s' is full"
        est "Tabel '%-.192s' on täis"
        fre "La table '%-.192s' est pleine"
        ger "Tabelle '%-.192s' ist voll"
        greek "Ο πίνακας '%-.192s' είναι γεμάτος"
        hindi "टेबल '%-.192s' पूरा भरा है"
        hun "A '%-.192s' tabla megtelt"
        ita "La tabella '%-.192s' e` piena"
        jpn "表 '%-.192s' は満杯です。"
        kor "테이블 '%-.192s'가 full났습니다. "
        nla "De tabel '%-.192s' is vol"
        por "Tabela '%-.192s' está cheia"
        rum "Tabela '%-.192s' e plina"
        rus "Таблица '%-.192s' переполнена"
        serbian "Tabela '%-.192s' je popunjena do kraja"
        slo "Tabuľka '%-.192s' je plná"
        spa "La tabla '%-.192s' está llena"
        swe "Tabellen '%-.192s' är full"
        ukr "Таблиця '%-.192s' заповнена"
ER_UNKNOWN_CHARACTER_SET 42000 
        chi "未知字符集:'%-.64s'"
        cze "Neznámá znaková sada: '%-.64s'"
        dan "Ukendt tegnsæt: '%-.64s'"
        eng "Unknown character set: '%-.64s'"
        est "Vigane kooditabel '%-.64s'"
        fre "Jeu de caractères inconnu: '%-.64s'"
        ger "Unbekannter Zeichensatz: '%-.64s'"
        greek "Αγνωστο character set: '%-.64s'"
        hindi "अज्ञात CHARACTER SET: '%-.64s'"
        hun "Ervenytelen karakterkeszlet: '%-.64s'"
        ita "Set di caratteri '%-.64s' sconosciuto"
        jpn "不明な文字コードセット: '%-.64s'"
        kor "알수없는 언어 Set: '%-.64s'"
        nla "Onbekende character set: '%-.64s'"
        por "Conjunto de caracteres '%-.64s' desconhecido"
        rum "Set de caractere invalid: '%-.64s'"
        rus "Неизвестная кодировка '%-.64s'"
        serbian "Nepoznati karakter-set: '%-.64s'"
        slo "Neznáma znaková sada: '%-.64s'"
        spa "Juego desconocido de caracteres: '%-.64s'"
        swe "Okänd teckenuppsättning: '%-.64s'"
        ukr "Невідома кодова таблиця: '%-.64s'"
ER_TOO_MANY_TABLES  
        chi "表太多; MariaDB 只能在join中使用 %d 个表"
        cze "Příliš mnoho tabulek, MariaDB jich může mít v joinu jen %d"
        dan "For mange tabeller. MariaDB kan kun bruge %d tabeller i et join"
        eng "Too many tables; MariaDB can only use %d tables in a join"
        est "Liiga palju tabeleid. MariaDB suudab JOINiga ühendada kuni %d tabelit"
        fre "Trop de tables. MariaDB ne peut utiliser que %d tables dans un JOIN"
        ger "Zu viele Tabellen. MariaDB kann in einem Join maximal %d Tabellen verwenden"
        greek "Πολύ μεγάλος αριθμός πινάκων. Η MariaDB μπορεί να χρησιμοποιήσει %d πίνακες σε διαδικασία join"
        hindi "बहुत अधिक टेबल्स, MariaDB एक JOIN में केवल %d टेबल्स का उपयोग कर सकता है"
        hun "Tul sok tabla. A MariaDB csak %d tablat tud kezelni osszefuzeskor"
        ita "Troppe tabelle. MariaDB puo` usare solo %d tabelle in una join"
        jpn "表が多すぎます。MariaDBがJOINできる表は %d 個までです。"
        kor "너무 많은 테이블이 Join되었습니다. MariaDB에서는 JOIN시 %d개의 테이블만 사용할 수 있습니다."
        nla "Teveel tabellen. MariaDB kan slechts %d tabellen in een join bevatten"
        por "Tabelas demais. O MariaDB pode usar somente %d tabelas em uma junção (JOIN)"
        rum "Prea multe tabele. MariaDB nu poate folosi mai mult de %d tabele intr-un join"
        rus "Слишком много таблиц. MariaDB может использовать только %d таблиц в соединении"
        serbian "Previše tabela. MariaDB može upotrebiti maksimum %d tabela pri 'JOIN' operaciji"
        slo "Príliš mnoho tabuliek. MariaDB môže použiť len %d v JOIN-e"
        spa "Demasiadas tablas. MariaDB solamente puede usar %d tablas en un join"
        swe "För många tabeller. MariaDB can ha högst %d tabeller i en och samma join"
        ukr "Забагато таблиць. MariaDB може використовувати лише %d таблиць у об'єднанні"
ER_TOO_MANY_FIELDS  
        chi "太多列"
        cze "Příliš mnoho položek"
        dan "For mange felter"
        eng "Too many columns"
        est "Liiga palju tulpasid"
        fre "Trop de champs"
        ger "Zu viele Felder"
        greek "Πολύ μεγάλος αριθμός πεδίων"
        hindi "बहुत अधिक कॉलम्स"
        hun "Tul sok mezo"
        ita "Troppi campi"
        jpn "列が多すぎます。"
        kor "칼럼이 너무 많습니다."
        nla "Te veel velden"
        por "Colunas demais"
        rum "Prea multe coloane"
        rus "Слишком много столбцов"
        serbian "Previše kolona"
        slo "Príliš mnoho polí"
        spa "Demasiadas columnas"
        swe "För många fält"
        ukr "Забагато стовбців"
ER_TOO_BIG_ROWSIZE 42000 
        chi "行尺寸太大. 不包括BLOB,表的最大的行大小是 %ld. 这包括存储开销,请查看文档。您必须将某些列更改为 TEXT 或 BLOB"
        cze "Řádek je příliš velký. Maximální velikost řádku, nepočítaje položky blob, je %ld. Musíte změnit některé položky na blob"
        dan "For store poster. Max post størrelse, uden BLOB's, er %ld. Du må lave nogle felter til BLOB's"
        eng "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs"
        est "Liiga pikk kirje. Kirje maksimumpikkus arvestamata BLOB-tüüpi välju on %ld. Muuda mõned väljad BLOB-tüüpi väljadeks"
        fre "Ligne trop grande. Le taille maximale d'une ligne, sauf les BLOBs, est %ld. Changez le type de quelques colonnes en BLOB"
        ger "Zeilenlänge zu groß. Die maximale Zeilenlänge für den verwendeten Tabellentyp (ohne BLOB-Felder) beträgt %ld. Einige Felder müssen in BLOB oder TEXT umgewandelt werden"
        greek "Πολύ μεγάλο μέγεθος εγγραφής. Το μέγιστο μέγεθος εγγραφής, χωρίς να υπολογίζονται τα blobs, είναι %ld. Πρέπει να ορίσετε κάποια πεδία σαν blobs"
        hun "Tul nagy sormeret. A maximalis sormeret (nem szamolva a blob objektumokat) %ld. Nehany mezot meg kell valtoztatnia"
        ita "Riga troppo grande. La massima grandezza di una riga, non contando i BLOB, e` %ld. Devi cambiare alcuni campi in BLOB"
        jpn "行サイズが大きすぎます。この表の最大行サイズは BLOB を含まずに %ld です。格納時のオーバーヘッドも含まれます(マニュアルを確認してください)。列をTEXTまたはBLOBに変更する必要があります。"
        kor "너무 큰 row 사이즈입니다. BLOB를 계산하지 않고 최대 row 사이즈는 %ld입니다. 일부열을 BLOB 또는 TEXT로 변경해야 합니다."
        nla "Rij-grootte is groter dan toegestaan. Maximale rij grootte, blobs niet meegeteld, is %ld. U dient sommige velden in blobs te veranderen"
        por "Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %ld. Você tem que mudar alguns campos para BLOBs"
        rum "Marimea liniei (row) prea mare. Marimea maxima a liniei, excluzind BLOB-urile este de %ld. Trebuie sa schimbati unele cimpuri in BLOB-uri"
        rus "Слишком большой размер записи. Максимальный размер строки, исключая поля BLOB, - %ld. Возможно, вам следует изменить тип некоторых полей на BLOB"
        serbian "Prevelik slog. Maksimalna veličina sloga, ne računajući BLOB polja, je %ld. Trebali bi da promenite tip nekih polja u BLOB"
        slo "Riadok je príliš veľký. Maximálna veľkosť riadku, okrem 'BLOB', je %ld. Musíte zmeniť niektoré položky na BLOB"
        spa "Tamaño de fila muy grande. El máximo tamaño de fila para el tipo de tabla usada, sin contar BLOBs, es de %ld. Esto incluye sobrecarga de almacenaje, revise el manual. Tiene que cambiar algunas columnas a TEXT o BLOBs"
        swe "För stor total radlängd. Den högst tillåtna radlängden, förutom BLOBs, är %ld. Ändra några av dina fält till BLOB"
        ukr "Задовга строка. Найбільшою довжиною строки, не рахуючи BLOB, є %ld. Вам потрібно привести деякі стовбці до типу BLOB"
ER_STACK_OVERRUN  
        chi "线程栈溢出:  已使用了: %ld 堆栈 %ld.  使用 'mariadbd --thread_stack=#' 指定更大的堆栈"
        cze "Přetečení zásobníku threadu: použito %ld z %ld. Použijte 'mariadbd --thread_stack=#' k zadání většího zásobníku"
        dan "Thread stack brugt:  Brugt: %ld af en %ld stak.  Brug 'mariadbd --thread_stack=#' for at allokere en større stak om nødvendigt"
        eng "Thread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if needed"
        fre "Débordement de la pile des tâches (Thread stack). Utilisées: %ld pour une pile de %ld.  Essayez 'mariadbd --thread_stack=#' pour indiquer une plus grande valeur"
        ger "Thread-Stack-Überlauf. Benutzt: %ld von %ld Stack. 'mariadbd --thread_stack=#' verwenden, um bei Bedarf einen größeren Stack anzulegen"
        greek "Stack overrun στο thread:  Used: %ld of a %ld stack.  Παρακαλώ χρησιμοποιείστε 'mariadbd --thread_stack=#' για να ορίσετε ένα μεγαλύτερο stack αν χρειάζεται"
        hun "Thread verem tullepes:  Used: %ld of a %ld stack. Hasznalja a 'mariadbd --thread_stack=#' nagyobb verem definialasahoz"
        ita "Thread stack overrun:  Usati: %ld di uno stack di %ld.  Usa 'mariadbd --thread_stack=#' per specificare uno stack piu` grande"
        jpn "スレッドスタック不足です(使用: %ld ; サイズ: %ld)。必要に応じて、より大きい値で 'mariadbd --thread_stack=#' の指定をしてください。"
        kor "쓰레드 스택이 넘쳤습니다.  사용: %ld개 스택: %ld개.  만약 필요시 더큰 스택을 원할때에는 'mariadbd --thread_stack=#' 를 정의하세요"
        nla "Thread stapel overrun:  Gebruikte: %ld van een %ld stack. Gebruik 'mariadbd --thread_stack=#' om een grotere stapel te definieren (indien noodzakelijk)"
        por "Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld. Use 'mariadbd --thread_stack=#' para especificar uma pilha maior, se necessário"
        rum "Stack-ul thread-ului a fost depasit (prea mic):  Folositi: %ld intr-un stack de %ld.  Folositi 'mariadbd --thread_stack=#' ca sa specifici un stack mai mare"
        rus "Стек потоков переполнен:  использовано: %ld из %ld стека.  Применяйте 'mariadbd --thread_stack=#' для указания большего размера стека, если необходимо"
        serbian "Prepisivanje thread stack-a:  Upotrebljeno: %ld od %ld stack memorije.  Upotrebite 'mariadbd --thread_stack=#' da navedete veći stack ako je potrebno"
        slo "Pretečenie zásobníku vlákna:  použité: %ld z %ld.  Použite 'mariadbd --thread_stack=#' k zadaniu väčšieho zásobníka"
        spa "Desbordamiento de la pila de hilos (threads): Usado: %ld de una pila de %ld. Considere el incrementar la variable de sistema thread_stack"
        swe "Trådstacken tog slut:  Har använt %ld av %ld bytes.  Använd 'mariadbd --thread_stack=#' ifall du behöver en större stack"
        ukr "Стек гілок переповнено:  Використано: %ld з %ld. Використовуйте 'mariadbd --thread_stack=#' аби зазначити більший стек, якщо необхідно"
ER_WRONG_OUTER_JOIN 42000 
        chi "在 OUTER JOIN 中发现交叉依赖;检查您的 ON 条件"
        cze "V OUTER JOIN byl nalezen křížový odkaz. Prověřte ON podmínky"
        dan "Krydsreferencer fundet i OUTER JOIN; check dine ON conditions"
        eng "Cross dependency found in OUTER JOIN; examine your ON conditions"
        est "Ristsõltuvus OUTER JOIN klauslis. Kontrolli oma ON tingimusi"
        fre "Dépendance croisée dans une clause OUTER JOIN. Vérifiez la condition ON"
        ger "OUTER JOIN enthält fehlerhafte Abhängigkeiten. In ON verwendete Bedingungen überprüfen"
        greek "Cross dependency βρέθηκε σε OUTER JOIN.  Παρακαλώ εξετάστε τις συνθήκες που θέσατε στο ON"
        hun "Keresztfuggoseg van az OUTER JOIN-ban. Ellenorizze az ON felteteleket"
        ita "Trovata una dipendenza incrociata nella OUTER JOIN. Controlla le condizioni ON"
        jpn "OUTER JOINに相互依存が見つかりました。ON句の条件を確認して下さい。"
        nla "Gekruiste afhankelijkheid gevonden in OUTER JOIN. Controleer uw ON-conditions"
        por "Dependência cruzada encontrada em junção externa (OUTER JOIN); examine as condições utilizadas nas cláusulas 'ON'"
        rum "Dependinta incrucisata (cross dependency) gasita in OUTER JOIN.  Examinati conditiile ON"
        rus "В OUTER JOIN обнаружена перекрестная зависимость. Внимательно проанализируйте свои условия ON"
        serbian "Unakrsna zavisnost pronađena u komandi 'OUTER JOIN'. Istražite vaše 'ON' uslove"
        slo "V OUTER JOIN bol nájdený krížový odkaz.  Skontrolujte podmienky ON"
        spa "Dependencia cruzada hallada en OUTER JOIN. Examina tus condiciones ON"
        swe "Felaktigt referens i OUTER JOIN.  Kontrollera ON-uttrycket"
        ukr "Перехресна залежність у OUTER JOIN. Перевірте умову ON"
ER_NULL_COLUMN_IN_INDEX 42000 
        chi "表处理程序不支持给定索引中的 NULL. 请将列 '%-.192s' 改为 NOT NULL 或使用其他处理程序"
        eng "Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler"
        spa "El manejador de tabla no soporta NULL en índice suministrado. Por favor, cambie la columna '%-.192s' para que sea NOT NULL o utilice otro manejador"
        swe "Tabell hanteraren kan inte indexera NULL kolumner för den givna index typen. Ändra '%-.192s' till NOT NULL eller använd en annan hanterare"
        ukr "Вказівник таблиці не підтримує NULL у зазначенному індексі. Будь ласка, зменіть стовпчик '%-.192s' на NOT NULL або використайте інший вказівник таблиці."
ER_CANT_FIND_UDF  
        chi "无法加载函数'%-.192s'"
        cze "Nemohu načíst funkci '%-.192s'"
        dan "Kan ikke læse funktionen '%-.192s'"
        eng "Can't load function '%-.192s'"
        est "Ei suuda avada funktsiooni '%-.192s'"
        fre "Imposible de charger la fonction '%-.192s'"
        ger "Kann Funktion '%-.192s' nicht laden"
        greek "Δεν είναι δυνατή η διαδικασία load για τη συνάρτηση '%-.192s'"
        hindi "फंक्शन '%-.192s' लोड नहीं किया जा सका"
        hun "A(z) '%-.192s' fuggveny nem toltheto be"
        ita "Impossibile caricare la funzione '%-.192s'"
        jpn "関数 '%-.192s' をロードできません。"
        kor "'%-.192s' 함수를 로드하지 못했습니다."
        nla "Kan functie '%-.192s' niet laden"
        por "Não pode carregar a função '%-.192s'"
        rum "Nu pot incarca functia '%-.192s'"
        rus "Невозможно загрузить функцию '%-.192s'"
        serbian "Ne mogu da učitam funkciju '%-.192s'"
        slo "Nemôžem načítať funkciu '%-.192s'"
        spa "No puedo cargar la función '%-.192s'"
        swe "Kan inte ladda funktionen '%-.192s'"
        ukr "Не можу завантажити функцію '%-.192s'"
ER_CANT_INITIALIZE_UDF  
        chi "无法初始化函数 '%-.192s'; %-.80s"
        cze "Nemohu inicializovat funkci '%-.192s'; %-.80s"
        dan "Kan ikke starte funktionen '%-.192s'; %-.80s"
        eng "Can't initialize function '%-.192s'; %-.80s"
        est "Ei suuda algväärtustada funktsiooni '%-.192s'; %-.80s"
        fre "Impossible d'initialiser la fonction '%-.192s'; %-.80s"
        ger "Kann Funktion '%-.192s' nicht initialisieren: %-.80s"
        greek "Δεν είναι δυνατή η έναρξη της συνάρτησης '%-.192s'; %-.80s"
        hindi "फंक्शन '%-.192s' को प्रारंभ नहीं किया जा सका; %-.80s"
        hun "A(z) '%-.192s' fuggveny nem inicializalhato; %-.80s"
        ita "Impossibile inizializzare la funzione '%-.192s'; %-.80s"
        jpn "関数 '%-.192s' を初期化できません。; %-.80s"
        kor "'%-.192s' 함수를 초기화 하지 못했습니다.; %-.80s"
        nla "Kan functie '%-.192s' niet initialiseren; %-.80s"
        por "Não pode inicializar a função '%-.192s' - '%-.80s'"
        rum "Nu pot initializa functia '%-.192s'; %-.80s"
        rus "Невозможно инициализировать функцию '%-.192s'; %-.80s"
        serbian "Ne mogu da inicijalizujem funkciju '%-.192s'; %-.80s"
        slo "Nemôžem inicializovať funkciu '%-.192s'; %-.80s"
        spa "No puedo inicializar la función '%-.192s'; %-.80s"
        swe "Kan inte initialisera funktionen '%-.192s'; '%-.80s'"
        ukr "Не можу ініціалізувати функцію '%-.192s'; %-.80s"
ER_UDF_NO_PATHS  
        chi "共享库不允许使用路径"
        cze "Pro sdílenou knihovnu nejsou povoleny cesty"
        dan "Angivelse af sti ikke tilladt for delt bibliotek"
        eng "No paths allowed for shared library"
        est "Teegi nimes ei tohi olla kataloogi"
        fre "Chemin interdit pour les bibliothèques partagées"
        ger "Keine Pfade gestattet für Shared Library"
        greek "Δεν βρέθηκαν paths για την shared library"
        hun "Nincs ut a megosztott konyvtarakhoz (shared library)"
        ita "Non sono ammessi path per le librerie condivisa"
        jpn "共有ライブラリにはパスを指定できません。"
        kor "공유 라이버러리를 위한 패스가 정의되어 있지 않습니다."
        nla "Geen pad toegestaan voor shared library"
        por "Não há caminhos (paths) permitidos para biblioteca compartilhada"
        rum "Nici un paths nu e permis pentru o librarie shared"
        rus "Недопустимо указывать пути для динамических библиотек"
        serbian "Ne postoje dozvoljene putanje do share-ovane biblioteke"
        slo "Neprípustné žiadne cesty k zdieľanej knižnici"
        spa "No existen rutas autorizadas para biblioteca compartida"
        swe "Man får inte ange sökväg för dynamiska bibliotek"
        ukr "Не дозволено використовувати путі для розділюваних бібліотек"
ER_UDF_EXISTS  
        chi "函数 '%-.192s' 已经存在"
        cze "Funkce '%-.192s' již existuje"
        dan "Funktionen '%-.192s' findes allerede"
        eng "Function '%-.192s' already exists"
        est "Funktsioon '%-.192s' juba eksisteerib"
        fre "La fonction '%-.192s' existe déjà"
        ger "Funktion '%-.192s' existiert schon"
        greek "Η συνάρτηση '%-.192s' υπάρχει ήδη"
        hindi "फंक्शन '%-.192s' पहले से मौजूद है"
        hun "A '%-.192s' fuggveny mar letezik"
        ita "La funzione '%-.192s' esiste gia`"
        jpn "関数 '%-.192s' はすでに定義されています。"
        kor "'%-.192s' 함수는 이미 존재합니다."
        nla "Functie '%-.192s' bestaat reeds"
        por "Função '%-.192s' já existe"
        rum "Functia '%-.192s' exista deja"
        rus "Функция '%-.192s' уже существует"
        serbian "Funkcija '%-.192s' već postoji"
        slo "Funkcia '%-.192s' už existuje"
        spa "La función '%-.192s' ya existe"
        swe "Funktionen '%-.192s' finns redan"
        ukr "Функція '%-.192s' вже існує"
ER_CANT_OPEN_LIBRARY  
        chi "不能打开共享库 '%-.192s' (错误号码: %d, %-.128s)"
        cze "Nemohu otevřít sdílenou knihovnu '%-.192s' (errno: %d, %-.128s)"
        dan "Kan ikke åbne delt bibliotek '%-.192s' (errno: %d, %-.128s)"
        eng "Can't open shared library '%-.192s' (errno: %d, %-.128s)"
        est "Ei suuda avada jagatud teeki '%-.192s' (veakood: %d, %-.128s)"
        fre "Impossible d'ouvrir la bibliothèque partagée '%-.192s' (errno: %d, %-.128s)"
        ger "Kann Shared Library '%-.192s' nicht öffnen (Fehler: %d, %-.128s)"
        greek "Δεν είναι δυνατή η ανάγνωση της shared library '%-.192s' (κωδικός λάθους: %d, %-.128s)"
        hun "A(z) '%-.192s' megosztott konyvtar nem hasznalhato (hibakod: %d, %-.128s)"
        ita "Impossibile aprire la libreria condivisa '%-.192s' (errno: %d, %-.128s)"
        jpn "共有ライブラリ '%-.192s' を開く事ができません。(エラー番号: %d, %-.128s)"
        kor "'%-.192s' 공유 라이버러리를 열수 없습니다.(에러번호: %d, %-.128s)"
        nla "Kan shared library '%-.192s' niet openen (Errcode: %d, %-.128s)"
        nor "Can't open shared library '%-.192s' (errno: %d, %-.128s)"
        norwegian-ny "Can't open shared library '%-.192s' (errno: %d, %-.128s)"
        pol "Can't open shared library '%-.192s' (errno: %d, %-.128s)"
        por "Não pode abrir biblioteca compartilhada '%-.192s' (erro no. %d, %-.128s)"
        rum "Nu pot deschide libraria shared '%-.192s' (Eroare: %d, %-.128s)"
        rus "Невозможно открыть динамическую библиотеку '%-.192s' (ошибка: %d, %-.128s)"
        serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.192s' (errno: %d, %-.128s)"
        slo "Nemôžem otvoriť zdieľanú knižnicu '%-.192s' (chybový kód: %d, %-.128s)"
        spa "No puedo abrir la biblioteca compartida '%-.192s' (error: %d, %-.128s)"
        swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d, %-.128s)"
        ukr "Не можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d, %-.128s)"
ER_CANT_FIND_DL_ENTRY
        chi "在库中找不到符号 '%-.128s'"
        cze "Nemohu najít funkci '%-.128s' v knihovně"
        dan "Kan ikke finde funktionen '%-.128s' i bibliotek"
        eng "Can't find symbol '%-.128s' in library"
        est "Ei leia funktsiooni '%-.128s' antud teegis"
        fre "Impossible de trouver la fonction '%-.128s' dans la bibliothèque"
        ger "Kann Funktion '%-.128s' in der Library nicht finden"
        greek "Δεν είναι δυνατή η ανεύρεση της συνάρτησης '%-.128s' στην βιβλιοθήκη"
        hun "A(z) '%-.128s' fuggveny nem talalhato a konyvtarban"
        ita "Impossibile trovare la funzione '%-.128s' nella libreria"
        jpn "関数 '%-.128s' は共有ライブラリー中にありません。"
        kor "라이버러리에서 '%-.128s' 함수를 찾을 수 없습니다."
        nla "Kan functie '%-.128s' niet in library vinden"
        por "Não pode encontrar a função '%-.128s' na biblioteca"
        rum "Nu pot gasi functia '%-.128s' in libraria"
        rus "Невозможно отыскать символ '%-.128s' в библиотеке"
        serbian "Ne mogu da pronadjem funkciju '%-.128s' u biblioteci"
        slo "Nemôžem nájsť funkciu '%-.128s' v knižnici"
        spa "No puedo encontrar el símbolo '%-.128s' en biblioteca"
        swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket"
        ukr "Не можу знайти функцію '%-.128s' у бібліотеці"
ER_FUNCTION_NOT_DEFINED  
        chi "未定义函数 '%-.192s'"
        cze "Funkce '%-.192s' není definována"
        dan "Funktionen '%-.192s' er ikke defineret"
        eng "Function '%-.192s' is not defined"
        est "Funktsioon '%-.192s' ei ole defineeritud"
        fre "La fonction '%-.192s' n'est pas définie"
        ger "Funktion '%-.192s' ist nicht definiert"
        greek "Η συνάρτηση '%-.192s' δεν έχει ορισθεί"
        hindi "फंक्शन '%-.192s' की परिभाषा नहीं मिली"
        hun "A '%-.192s' fuggveny nem definialt"
        ita "La funzione '%-.192s' non e` definita"
        jpn "関数 '%-.192s' は定義されていません。"
        kor "'%-.192s' 함수가 정의되어 있지 않습니다."
        nla "Functie '%-.192s' is niet gedefinieerd"
        por "Função '%-.192s' não está definida"
        rum "Functia '%-.192s' nu e definita"
        rus "Функция '%-.192s' не определена"
        serbian "Funkcija '%-.192s' nije definisana"
        slo "Funkcia '%-.192s' nie je definovaná"
        spa "La función '%-.192s' no está definida"
        swe "Funktionen '%-.192s' är inte definierad"
        ukr "Функцію '%-.192s' не визначено"
ER_HOST_IS_BLOCKED  
        chi "主机 '%-.64s' 由于许多连接错误而被阻止;使用 'mariadb-admin flush-hosts' 解除阻塞"
        cze "Stroj '%-.64s' je zablokován kvůli mnoha chybám při připojování. Odblokujete použitím 'mariadb-admin flush-hosts'"
        dan "Værten '%-.64s' er blokeret på grund af mange fejlforespørgsler. Lås op med 'mariadb-admin flush-hosts'"
        eng "Host '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'"
        est "Masin '%-.64s' on blokeeritud hulgaliste ühendusvigade tõttu. Blokeeringu saab tühistada 'mariadb-admin flush-hosts' käsuga"
        fre "L'hôte '%-.64s' est bloqué à cause d'un trop grand nombre d'erreur de connexion. Débloquer le par 'mariadb-admin flush-hosts'"
        ger "Host '%-.64s' blockiert wegen zu vieler Verbindungsfehler. Aufheben der Blockierung mit 'mariadb-admin flush-hosts'"
        greek "Ο υπολογιστής '%-.64s' έχει αποκλεισθεί λόγω πολλαπλών λαθών σύνδεσης. Προσπαθήστε να διορώσετε με 'mariadb-admin flush-hosts'"
        hindi "होस्ट '%-.64s' को कई कनेक्शन में त्रुटियों के कारण ब्लॉक कर दिया गया है; 'mariadb-admin flush-hosts' का इस्तेमाल कर अनब्लॉक करें"
        hun "A '%-.64s' host blokkolodott, tul sok kapcsolodasi hiba miatt. Hasznalja a 'mariadb-admin flush-hosts' parancsot"
        ita "Sistema '%-.64s' bloccato a causa di troppi errori di connessione. Per sbloccarlo: 'mariadb-admin flush-hosts'"
        jpn "接続エラーが多いため、ホスト '%-.64s' は拒否されました。'mariadb-admin flush-hosts' で解除できます。"
        kor "너무 많은 연결오류로 인하여 호스트 '%-.64s'는 블락되었습니다. 'mariadb-admin flush-hosts'를 이용하여 블락을 해제하세요"
        nla "Host '%-.64s' is geblokkeeerd vanwege te veel verbindings fouten. Deblokkeer met 'mariadb-admin flush-hosts'"
        por "'Host' '%-.64s' está bloqueado devido a muitos erros de conexão. Desbloqueie com 'mariadb-admin flush-hosts'"
        rum "Host-ul '%-.64s' e blocat din cauza multelor erori de conectie. Poti deploca folosind 'mariadb-admin flush-hosts'"
        rus "Хост '%-.64s' заблокирован из-за слишком большого количества ошибок соединения. Разблокировать его можно с помощью 'mariadb-admin flush-hosts'"
        serbian "Host '%-.64s' je blokiran zbog previše grešaka u konekciji.  Možete ga odblokirati pomoću komande 'mariadb-admin flush-hosts'"
        spa "El equipo '%-.64s' está bloqueado debido a muchos errores de conexión; desbloquea con 'mariadb-admin flush-hosts'"
        swe "Denna dator, '%-.64s', är blockerad pga många felaktig paket. Gör 'mariadb-admin flush-hosts' för att ta bort alla blockeringarna"
        ukr "Хост '%-.64s' заблоковано з причини великої кількості помилок з'єднання. Для розблокування використовуйте 'mariadb-admin flush-hosts'"
ER_HOST_NOT_PRIVILEGED  
        chi "Host'%-.64s'不允许连接到此MariaDB服务器"
        cze "Stroj '%-.64s' nemá povoleno se k tomuto MariaDB serveru připojit"
        dan "Værten '%-.64s' kan ikke tilkoble denne MariaDB-server"
        eng "Host '%-.64s' is not allowed to connect to this MariaDB server"
        est "Masinal '%-.64s' puudub ligipääs sellele MariaDB serverile"
        fre "Le hôte '%-.64s' n'est pas authorisé à se connecter à ce serveur MariaDB"
        ger "Host '%-.64s' hat keine Berechtigung, sich mit diesem MariaDB-Server zu verbinden"
        greek "Ο υπολογιστής '%-.64s' δεν έχει δικαίωμα σύνδεσης με τον MariaDB server"
        hindi "होस्ट '%-.64s' को इस MariaDB सर्वर से कनेक्ट करने के लिए अनुमति नहीं है"
        hun "A '%-.64s' host szamara nem engedelyezett a kapcsolodas ehhez a MariaDB szerverhez"
        ita "Al sistema '%-.64s' non e` consentita la connessione a questo server MariaDB"
        jpn "ホスト '%-.64s' からのこの MariaDB server への接続は許可されていません。"
        kor "'%-.64s' 호스트는 이 MariaDB서버에 접속할 허가를 받지 못했습니다."
        nla "Het is host '%-.64s' is niet toegestaan verbinding te maken met deze MariaDB server"
        por "'Host' '%-.64s' não tem permissão para se conectar com este servidor MariaDB"
        rum "Host-ul '%-.64s' nu este permis a se conecta la aceste server MariaDB"
        rus "Хосту '%-.64s' не разрешается подключаться к этому серверу MariaDB"
        serbian "Host-u '%-.64s' nije dozvoljeno da se konektuje na ovaj MariaDB server"
        spa "El equipo '%-.64s' no está autorizado a conectar con este servidor MariaDB"
        swe "Denna dator, '%-.64s', har inte privileger att använda denna MariaDB server"
        ukr "Хосту '%-.64s' не доволено зв'язуватись з цим сервером MariaDB"
ER_PASSWORD_ANONYMOUS_USER 42000 
        chi "您正在以匿名用户身份使用 MariaDB,匿名用户不能修改用户设置"
        cze "Používáte MariaDB jako anonymní uživatel a anonymní uživatelé nemají povoleno měnit hesla"
        dan "Du bruger MariaDB som anonym bruger. Anonyme brugere må ikke ændre adgangskoder"
        eng "You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings"
        est "Te kasutate MariaDB-i anonüümse kasutajana, kelledel pole parooli muutmise õigust"
        fre "Vous utilisez un utilisateur anonyme et les utilisateurs anonymes ne sont pas autorisés à changer les mots de passe"
        ger "Sie benutzen MariaDB als anonymer Benutzer und dürfen daher keine Passwörter ändern"
        greek "Χρησιμοποιείτε την MariaDB σαν anonymous user και έτσι δεν μπορείτε να αλλάξετε τα passwords άλλων χρηστών"
        hindi "आप MariaDB का उपयोग एक बेनाम यूज़र की तरह कर रहे हैं; बेनाम यूज़र्स को 'यूज़र सेटिंग्स' बदलने की अनुमति नहीं है"
        hun "Nevtelen (anonymous) felhasznalokent nem negedelyezett a jelszovaltoztatas"
        ita "Impossibile cambiare la password usando MariaDB come utente anonimo"
        jpn "MariaDB を匿名ユーザーで使用しているので、パスワードの変更はできません。"
        kor "당신은 MariaDB서버에 익명의 사용자로 접속을 하셨습니다.익명의 사용자는 암호를 변경할 수 없습니다."
        nla "U gebruikt MariaDB als anonieme gebruiker en deze mogen geen wachtwoorden wijzigen"
        por "Você está usando o MariaDB como usuário anônimo e usuários anônimos não têm permissão para mudar senhas"
        rum "Dumneavoastra folositi MariaDB ca un utilizator anonim si utilizatorii anonimi nu au voie sa schimbe setarile utilizatorilor"
        rus "Вы используете MariaDB от имени анонимного пользователя, а анонимным пользователям не разрешается менять пароли"
        serbian "Vi koristite MariaDB kao anonimni korisnik a anonimnim korisnicima nije dozvoljeno da menjaju lozinke"
        spa "Está usando MariaDB como un usuario anónimo y lo usuarios anónimos no tienen permiso para cambiar las propiedades de usuario"
        swe "Du använder MariaDB som en anonym användare och som sådan får du inte ändra ditt lösenord"
        ukr "Ви використовуєте MariaDB як анонімний користувач, тому вам не дозволено змінювати паролі"
ER_PASSWORD_NOT_ALLOWED 42000 
        chi "您必须具有更新 MariaDB 数据库中的表的权限才能更改其他人的密码"
        cze "Na změnu hesel ostatním musíte mít právo provést update tabulek v databázi mysql"
        dan "Du skal have tilladelse til at opdatere tabeller i MariaDB databasen for at ændre andres adgangskoder"
        eng "You must have privileges to update tables in the mysql database to be able to change passwords for others"
        est "Teiste paroolide muutmiseks on nõutav tabelite muutmisõigus 'mysql' andmebaasis"
        fre "Vous devez avoir le privilège update sur les tables de la base de donnée mysql pour pouvoir changer les mots de passe des autres"
        ger "Sie benötigen die Berechtigung zum Aktualisieren von Tabellen in der Datenbank 'mysql', um die Passwörter anderer Benutzer ändern zu können"
        greek "Πρέπει να έχετε δικαίωμα διόρθωσης πινάκων (update) στη βάση δεδομένων mysql για να μπορείτε να αλλάξετε τα passwords άλλων χρηστών"
        hun "Onnek tabla-update joggal kell rendelkeznie a mysql adatbazisban masok jelszavanak megvaltoztatasahoz"
        ita "E` necessario il privilegio di update sulle tabelle del database mysql per cambiare le password per gli altri utenti"
        jpn "他のユーザーのパスワードを変更するためには、mysqlデータベースの表を更新する権限が必要です。"
        kor "당신은 다른사용자들의 암호를 변경할 수 있도록 데이타베이스 변경권한을 가져야 합니다."
        nla "U moet tabel update priveleges hebben in de MariaDB database om wachtwoorden voor anderen te mogen wijzigen"
        por "Você deve ter privilégios para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros"
        rum "Trebuie sa aveti privilegii sa actualizati tabelele in bazele de date mysql ca sa puteti sa schimati parolele altora"
        rus "Для того чтобы изменять пароли других пользователей, у вас должны быть привилегии на изменение таблиц в базе данных mysql"
        serbian "Morate imati privilegije da možete da update-ujete određene tabele ako želite da menjate lozinke za druge korisnike"
        spa "Vd debe de tener privilegios para actualizar tablas en la base de datos mysql para poder cambiar las contraseñas de otros"
        swe "För att ändra lösenord för andra måste du ha rättigheter att uppdatera mysql-databasen"
        ukr "Ви повині мати право на оновлення таблиць у базі данних mysql, аби мати можливість змінювати пароль іншим"
ER_PASSWORD_NO_MATCH 28000 
        chi "在用户表中找不到任何匹配的行"
        cze "V tabulce user není žádný odpovídající řádek"
        dan "Kan ikke finde nogen tilsvarende poster i bruger tabellen"
        eng "Can't find any matching row in the user table"
        est "Ei leia vastavat kirjet kasutajate tabelis"
        fre "Impossible de trouver un enregistrement correspondant dans la table user"
        ger "Kann keinen passenden Datensatz in Tabelle 'user' finden"
        greek "Δεν είναι δυνατή η ανεύρεση της αντίστοιχης εγγραφής στον πίνακα των χρηστών"
        hindi "यूज़र टेबल में रिकॉर्ड नहीं मिला"
        hun "Nincs megegyezo sor a user tablaban"
        ita "Impossibile trovare la riga corrispondente nella tabella user"
        jpn "ユーザーテーブルに該当するレコードが見つかりません。"
        kor "사용자 테이블에서 일치하는 것을 찾을 수 없습니다."
        nla "Kan geen enkele passende rij vinden in de gebruikers tabel"
        por "Não pode encontrar nenhuma linha que combine na tabela usuário (user table)"
        rum "Nu pot gasi nici o linie corespunzatoare in tabela utilizatorului"
        rus "Невозможно отыскать подходящую запись в таблице пользователей"
        serbian "Ne mogu da pronađem odgovarajući slog u 'user' tabeli"
        spa "No puedo encontrar una fila coincidente en la tabla de usuario"
        swe "Hittade inte användaren i 'user'-tabellen"
        ukr "Не можу знайти відповідних записів у таблиці користувача"
ER_UPDATE_INFO  
        chi "匹配行:%ld已更改:%ld警告:%ld"
        cze "Nalezených řádků: %ld  Změněno: %ld  Varování: %ld"
        dan "Poster fundet: %ld  Ændret: %ld  Advarsler: %ld"
        eng "Rows matched: %ld  Changed: %ld  Warnings: %ld"
        est "Sobinud kirjeid: %ld  Muudetud: %ld  Hoiatusi: %ld"
        fre "Enregistrements correspondants: %ld  Modifiés: %ld  Warnings: %ld"
        ger "Datensätze gefunden: %ld  Geändert: %ld  Warnungen: %ld"
        hun "Megegyezo sorok szama: %ld  Valtozott: %ld  Warnings: %ld"
        ita "Rows riconosciute: %ld  Cambiate: %ld  Warnings: %ld"
        jpn "該当した行: %ld  変更: %ld  警告: %ld"
        kor "일치하는 Rows : %ld개 변경됨: %ld개  경고: %ld개"
        nla "Passende rijen: %ld  Gewijzigd: %ld  Waarschuwingen: %ld"
        por "Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ld"
        rum "Linii identificate (matched): %ld  Schimbate: %ld  Atentionari (warnings): %ld"
        rus "Совпало записей: %ld  Изменено: %ld  Предупреждений: %ld"
        serbian "Odgovarajućih slogova: %ld  Promenjeno: %ld  Upozorenja: %ld"
        spa "Líneas coincidentes: %ld Cambiadas: %ld Avisos: %ld"
        swe "Rader: %ld  Uppdaterade: %ld  Varningar: %ld"
        ukr "Записів відповідає: %ld  Змінено: %ld  Застережень: %ld"
ER_CANT_CREATE_THREAD  
        chi "无法创建新线程 (错误号码 %M); 如果您没有用完剩余内存,您可以查阅文档以了解可能与操作系统相关的错误"
        cze "Nemohu vytvořit nový thread (errno %M). Pokud je ještě nějaká volná paměť, podívejte se do manuálu na část o chybách specifických pro jednotlivé operační systémy"
        dan "Kan ikke danne en ny tråd (fejl nr. %M). Hvis computeren ikke er løbet tør for hukommelse, kan du se i brugervejledningen for en mulig operativ-system - afhængig fejl"
        eng "Can't create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug"
        est "Ei suuda luua uut lõime (veakood %M). Kui mälu ei ole otsas, on tõenäoliselt tegemist operatsioonisüsteemispetsiifilise veaga"
        fre "Impossible de créer une nouvelle tâche (errno %M). S'il reste de la mémoire libre, consultez le manual pour trouver un éventuel bug dépendant de l'OS"
        ger "Kann keinen neuen Thread erzeugen (Fehler: %M). Sollte noch Speicher verfügbar sein, bitte im Handbuch wegen möglicher Fehler im Betriebssystem nachschlagen"
        hun "Uj thread letrehozasa nem lehetseges (Hibakod: %M). Amenyiben van meg szabad memoria, olvassa el a kezikonyv operacios rendszerfuggo hibalehetosegekrol szolo reszet"
        ita "Impossibile creare un nuovo thread (errno %M). Se non ci sono problemi di memoria disponibile puoi consultare il manuale per controllare possibili problemi dipendenti dal SO"
        jpn "新規にスレッドを作成できません。(エラー番号 %M) もしも使用可能メモリーの不足でなければ、OS依存のバグである可能性があります。"
        kor "새로운 쓰레드를 만들 수 없습니다.(에러번호 %M). 만약 여유메모리가 있다면 OS-dependent버그 의 메뉴얼 부분을 찾아보시오."
        nla "Kan geen nieuwe thread aanmaken (Errcode: %M). Indien er geen tekort aan geheugen is kunt u de handleiding consulteren over een mogelijke OS afhankelijke fout"
        nor "Can't create a new thread (errno %M); if you are not out of available memory you can consult the manual for any possible OS dependent bug"
        norwegian-ny "Can't create a new thread (errno %M); if you are not out of available memory you can consult the manual for any possible OS dependent bug"
        pol "Can't create a new thread (errno %M); if you are not out of available memory you can consult the manual for any possible OS dependent bug"
        por "Não pode criar uma nova 'thread' (erro no. %M). Se você não estiver sem memória disponível, você pode consultar o manual sobre um possível 'bug' dependente do sistema operacional"
        rum "Nu pot crea un thread nou (Eroare %M). Daca mai aveti memorie disponibila in sistem, puteti consulta manualul - ar putea exista un potential bug in legatura cu sistemul de operare"
        rus "Невозможно создать новый поток (ошибка %M). Если это не ситуация, связанная с нехваткой памяти, то вам следует изучить документацию на предмет описания возможной ошибки работы в конкретной ОС"
        serbian "Ne mogu da kreiram novi thread (errno %M). Ako imate još slobodne memorije, trebali biste da pogledate u priručniku da li je ovo specifična greška vašeg operativnog sistema"
        spa "No puedo crear un nuevo hilo (thread) (error %M). Si no está falto de memoria disponible, vd puede consultar el manual para un posible error dependiente del SO"
        swe "Kan inte skapa en ny tråd (errno %M)"
        ukr "Не можу створити нову гілку (помилка %M). Якщо ви не використали усю пам'ять, то прочитайте документацію до вашої ОС - можливо це помилка ОС"
ER_WRONG_VALUE_COUNT_ON_ROW 21S01 
        chi "列计数与行%lu的值计数不匹配"
        cze "Počet sloupců neodpovídá počtu hodnot na řádku %lu"
        dan "Kolonne antallet stemmer ikke overens med antallet af værdier i post %lu"
        eng "Column count doesn't match value count at row %lu"
        est "Tulpade hulk erineb väärtuste hulgast real %lu"
        ger "Anzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %lu überein"
        hun "Az oszlopban talalhato ertek nem egyezik meg a %lu sorban szamitott ertekkel"
        ita "Il numero delle colonne non corrisponde al conteggio alla riga %lu"
        jpn "%lu 行目で、列の数が値の数と一致しません。"
        kor "Row %lu에서 칼럼 카운트와 value 카운터와 일치하지 않습니다."
        nla "Kolom aantal komt niet overeen met waarde aantal in rij %lu"
        por "Contagem de colunas não confere com a contagem de valores na linha %lu"
        rum "Numarul de coloane nu corespunde cu numarul de valori la linia %lu"
        rus "Количество столбцов не совпадает с количеством значений в записи %lu"
        serbian "Broj kolona ne odgovara broju vrednosti u slogu %lu"
        spa "El número de columnas no se corresponde con el número de valores en la línea %lu"
        swe "Antalet kolumner motsvarar inte antalet värden på rad: %lu"
        ukr "Кількість стовбців не співпадає з кількістю значень у строці %lu"
ER_CANT_REOPEN_TABLE  
        chi "无法重新打开表:'%-.192s'"
        cze "Nemohu znovuotevřít tabulku: '%-.192s"
        dan "Kan ikke genåbne tabel '%-.192s"
        eng "Can't reopen table: '%-.192s'"
        est "Ei suuda taasavada tabelit '%-.192s'"
        fre "Impossible de réouvrir la table: '%-.192s"
        ger "Kann Tabelle'%-.192s' nicht erneut öffnen"
        hindi "टेबल '%-.192s' फिर से खोल नहीं सकते"
        hun "Nem lehet ujra-megnyitni a tablat: '%-.192s"
        ita "Impossibile riaprire la tabella: '%-.192s'"
        jpn "表を再オープンできません。: '%-.192s'"
        kor "테이블을 다시 열수 없군요: '%-.192s"
        nla "Kan tabel niet opnieuw openen: '%-.192s"
        nor "Can't reopen table: '%-.192s"
        norwegian-ny "Can't reopen table: '%-.192s"
        pol "Can't reopen table: '%-.192s"
        por "Não pode reabrir a tabela '%-.192s"
        rum "Nu pot redeschide tabela: '%-.192s'"
        rus "Невозможно заново открыть таблицу '%-.192s'"
        serbian "Ne mogu da ponovo otvorim tabelu '%-.192s'"
        slo "Can't reopen table: '%-.192s"
        spa "No puedo reabrir la tabla: '%-.192s"
        swe "Kunde inte stänga och öppna tabell '%-.192s"
        ukr "Не можу перевідкрити таблицю: '%-.192s'"
ER_INVALID_USE_OF_NULL 22004 
        chi "无效使用 NULL 值"
        cze "Neplatné užití hodnoty NULL"
        dan "Forkert brug af nulværdi (NULL)"
        eng "Invalid use of NULL value"
        est "NULL väärtuse väärkasutus"
        fre "Utilisation incorrecte de la valeur NULL"
        ger "Unerlaubte Verwendung eines NULL-Werts"
        hindi "NULL मान का अवैध उपयोग"
        hun "A NULL ervenytelen hasznalata"
        ita "Uso scorretto del valore NULL"
        jpn "NULL 値の使用方法が不適切です。"
        kor "NULL 값을 잘못 사용하셨군요..."
        nla "Foutief gebruik van de NULL waarde"
        por "Uso inválido do valor NULL"
        rum "Folosirea unei value NULL e invalida"
        rus "Неправильное использование величины NULL"
        serbian "Pogrešna upotreba vrednosti NULL"
        spa "Uso inválido del valor NULL"
        swe "Felaktig använding av NULL"
        ukr "Хибне використання значення NULL"
ER_REGEXP_ERROR 42000 
        chi "正则表达错误 '%s'"
        cze "Regulární výraz vrátil chybu: %s"
        dan "Fik fejl '%s' fra regexp"
        eng "Regex error '%s'"
        est "regexp tagastas vea: %s"
        fre "Erreur '%s' provenant de regexp"
        ger "Regexp Fehler %s"
        hindi "regexp में '%s' त्रुटि हुई"
        hun "'%s' hiba a regularis kifejezes hasznalata soran (regexp)"
        ita "Errore '%s' da regexp"
        jpn "regexp がエラー '%s' を返しました。"
        kor "regexp에서 '%s'가 났습니다."
        nla "Fout '%s' ontvangen van regexp"
        por "Obteve erro '%s' em regexp"
        rum "Eroarea '%s' obtinuta din expresia regulara (regexp)"
        rus "Ошибка регулярного выражения: %s"
        serbian "Funkcija regexp je vratila grešku: %s"
        spa "Obtenido error '%s' de regexp"
        swe "Fick fel '%s' från REGEXP"
        ukr "Помилка регулярного виразу: %s"
ER_MIX_OF_GROUP_FUNC_AND_FIELDS 42000 
        chi "如果没有 GROUP BY 子句,不能混合没有 GROUP 列的 GROUP 列 (MIN(),MAX(),COUNT(),...)"
        cze "Pokud není žádná GROUP BY klauzule, není dovoleno současné použití GROUP položek (MIN(),MAX(),COUNT()...) s ne GROUP položkami"
        dan "Sammenblanding af GROUP kolonner (MIN(),MAX(),COUNT()...) uden GROUP kolonner er ikke tilladt, hvis der ikke er noget GROUP BY prædikat"
        eng "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause"
        est "GROUP tulpade (MIN(),MAX(),COUNT()...) kooskasutamine tavaliste tulpadega ilma GROUP BY klauslita ei ole lubatud"
        fre "Mélanger les colonnes GROUP (MIN(),MAX(),COUNT()...) avec des colonnes normales est interdit s'il n'y a pas de clause GROUP BY"
        ger "Das Vermischen von GROUP-Feldern (MIN(),MAX(),COUNT()...) mit Nicht-GROUP-Feldern ist nicht zulässig, wenn keine GROUP-BY-Klausel vorhanden ist"
        hun "A GROUP mezok (MIN(),MAX(),COUNT()...) kevert hasznalata nem lehetseges GROUP BY hivatkozas nelkul"
        ita "Il mescolare funzioni di aggregazione (MIN(),MAX(),COUNT()...) e non e` illegale se non c'e` una clausula GROUP BY"
        jpn "GROUP BY句が無い場合、集計関数(MIN(),MAX(),COUNT(),...)と通常の列を同時に使用できません。"
        kor "GROUP BY 절 없이 혼합된 GROUP 함수 (MIN(),MAX(),COUNT(),...) 를 사용할 수 없습니다."
        nla "Het mixen van GROUP kolommen (MIN(),MAX(),COUNT()...) met no-GROUP kolommen is foutief indien er geen GROUP BY clausule is"
        por "Mistura de colunas agrupadas (com MIN(), MAX(), COUNT(), ...) com colunas não agrupadas é ilegal, se não existir uma cláusula de agrupamento (cláusula GROUP BY)"
        rum "Amestecarea de coloane GROUP (MIN(),MAX(),COUNT()...) fara coloane GROUP este ilegala daca nu exista o clauza GROUP BY"
        rus "Одновременное использование сгруппированных (GROUP) столбцов (MIN(),MAX(),COUNT(),...) с несгруппированными столбцами является некорректным, если в выражении есть GROUP BY"
        serbian "Upotreba agregatnih funkcija (MIN(),MAX(),COUNT()...) bez 'GROUP' kolona je pogrešna ako ne postoji 'GROUP BY' iskaz"
        spa "La mezcla de columnas GROUP (MIN(),MAX(),COUNT()...) con columnas no GROUP es ilegal si no exite la cláusula GROUP BY"
        swe "Man får ha både GROUP-kolumner (MIN(),MAX(),COUNT()...) och fält i en fråga om man inte har en GROUP BY-del"
        ukr "Змішування GROUP стовбців (MIN(),MAX(),COUNT()...) з не GROUP стовбцями є забороненим, якщо не має GROUP BY"
ER_NONEXISTING_GRANT 42000 
        chi "用户 '%-.48s' 来自主机 '%-.64s'没有此类授权"
        cze "Neexistuje odpovídající grant pro uživatele '%-.48s' na stroji '%-.64s'"
        dan "Denne tilladelse findes ikke for brugeren '%-.48s' på vært '%-.64s'"
        eng "There is no such grant defined for user '%-.48s' on host '%-.64s'"
        est "Sellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s'"
        fre "Un tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s'"
        ger "Für Benutzer '%-.48s' auf Host '%-.64s' gibt es keine solche Berechtigung"
        hun "A '%-.48s' felhasznalonak nincs ilyen joga a '%-.64s' host-on"
        ita "GRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s'"
        jpn "ユーザー '%-.48s' (ホスト '%-.64s' 上) は許可されていません。"
        kor "사용자 '%-.48s' (호스트 '%-.64s')를 위하여 정의된 그런 승인은 없습니다."
        nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s'"
        por "Não existe tal permissão (grant) definida para o usuário '%-.48s' no 'host' '%-.64s'"
        rum "Nu exista un astfel de grant definit pentru utilzatorul '%-.48s' de pe host-ul '%-.64s'"
        rus "Такие права не определены для пользователя '%-.48s' на хосте '%-.64s'"
        serbian "Ne postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s'"
        spa "No existe tal concesión (grant) definida para usuario '%-.48s' en el equipo '%-.64s'"
        swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s'"
        ukr "Повноважень не визначено для користувача '%-.48s' з хосту '%-.64s'"
ER_TABLEACCESS_DENIED_ERROR 42000 
        chi "%-.100T 命令的权限拒绝用户 '%s'@'%s' 用在表 %`s.%`s"
        cze "%-.100T příkaz nepřístupný pro uživatele: '%s'@'%s' pro tabulku %`s.%`s"
        dan "%-.100T-kommandoen er ikke tilladt for brugeren '%s'@'%s' for tabellen %`s.%`s"
        nla "%-.100T commando geweigerd voor gebruiker: '%s'@'%s' voor tabel %`s.%`s"
        eng "%-.100T command denied to user '%s'@'%s' for table %`s.%`s"
        est "%-.100T käsk ei ole lubatud kasutajale '%s'@'%s' tabelis %`s.%`s"
        fre "La commande '%-.100T' est interdite à l'utilisateur: '%s'@'%s' sur la table %`s.%`s"
        ger "%-.100T Befehl nicht erlaubt für Benutzer '%s'@'%s' auf Tabelle %`s.%`s"
        hun "%-.100T parancs a '%s'@'%s' felhasznalo szamara nem engedelyezett a %`s.%`s tablaban"
        ita "Comando %-.100T negato per l'utente: '%s'@'%s' sulla tabella %`s.%`s"
        jpn "コマンド %-.100T は ユーザー '%s'@'%s' ,テーブル %`s.%`s に対して許可されていません"
        kor "'%-.100T' 명령은 다음 사용자에게 거부되었습니다. : '%s'@'%s' for 테이블 %`s.%`s"
        por "Comando '%-.100T' negado para o usuário '%s'@'%s' na tabela %`s.%`s"
        rum "Comanda %-.100T interzisa utilizatorului: '%s'@'%s' pentru tabela %`s.%`s"
        rus "Команда %-.100T запрещена пользователю '%s'@'%s' для таблицы %`s.%`s"
        serbian "%-.100T komanda zabranjena za korisnika '%s'@'%s' za tabelu %`s.%`s"
        spa "%-.100T comando denegado a usuario '%s'@'%s' para la tabla %`s.%`s"
        swe "%-.100T ej tillåtet för '%s'@'%s' för tabell %`s.%`s"
        ukr "%-.100T команда заборонена користувачу: '%s'@'%s' у таблиці %`s.%`s"
ER_COLUMNACCESS_DENIED_ERROR 42000 
        chi "%-.32s 命令的权限拒绝用户 '%s'@'%s' 用在列 '%-.192s' 在表 '%-.192s'"
        cze "%-.32s příkaz nepřístupný pro uživatele: '%s'@'%s' pro sloupec '%-.192s' v tabulce '%-.192s'"
        dan "%-.32s-kommandoen er ikke tilladt for brugeren '%s'@'%s' for kolonne '%-.192s' in tabellen '%-.192s'"
        eng "%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'"
        est "%-.32s käsk ei ole lubatud kasutajale '%s'@'%s' tulbale '%-.192s' tabelis '%-.192s'"
        fre "La commande '%-.32s' est interdite à l'utilisateur: '%s'@'%s' sur la colonne '%-.192s' de la table '%-.192s'"
        ger "%-.32s Befehl nicht erlaubt für Benutzer '%s'@'%s' und Feld '%-.192s' in Tabelle '%-.192s'"
        hun "%-.32s parancs a '%s'@'%s' felhasznalo szamara nem engedelyezett a '%-.192s' mezo eseten a '%-.192s' tablaban"
        ita "Comando %-.32s negato per l'utente: '%s'@'%s' sulla colonna '%-.192s' della tabella '%-.192s'"
        jpn "コマンド %-.32s は ユーザー '%s'@'%s'\n カラム '%-.192s' テーブル '%-.192s' に対して許可されていません"
        kor "'%-.32s' 명령은 다음 사용자에게 거부되었습니다. : '%s'@'%s' for 칼럼 '%-.192s' in 테이블 '%-.192s'"
        nla "%-.32s commando geweigerd voor gebruiker: '%s'@'%s' voor kolom '%-.192s' in tabel '%-.192s'"
        por "Comando '%-.32s' negado para o usuário '%s'@'%s' na coluna '%-.192s', na tabela '%-.192s'"
        rum "Comanda %-.32s interzisa utilizatorului: '%s'@'%s' pentru coloana '%-.192s' in tabela '%-.192s'"
        rus "Команда %-.32s запрещена пользователю '%s'@'%s' для столбца '%-.192s' в таблице '%-.192s'"
        serbian "%-.32s komanda zabranjena za korisnika '%s'@'%s' za kolonu '%-.192s' iz tabele '%-.192s'"
        spa "%-.32s comando denegado a el usuario '%s'@'%s' para la columna '%-.192s' en la tabla '%-.192s'"
        swe "%-.32s ej tillåtet för '%s'@'%s' för kolumn '%-.192s' i tabell '%-.192s'"
        ukr "%-.32s команда заборонена користувачу: '%s'@'%s' для стовбця '%-.192s' у таблиці '%-.192s'"
ER_ILLEGAL_GRANT_FOR_TABLE 42000 
        chi "非法的 GRANT/REVOKE 命令;请查阅文档查看可以使用哪些权限"
        cze "Neplatný příkaz GRANT/REVOKE. Prosím, přečtěte si v manuálu, jaká privilegia je možné použít"
        dan "Forkert GRANT/REVOKE kommando. Se i brugervejledningen hvilke privilegier der kan specificeres"
        eng "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used"
        est "Vigane GRANT/REVOKE käsk. Tutvu kasutajajuhendiga"
        fre "Commande GRANT/REVOKE incorrecte. Consultez le manuel"
        ger "Unzulässiger GRANT- oder REVOKE-Befehl. Verfügbare Berechtigungen sind im Handbuch aufgeführt"
        greek "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used"
        hun "Ervenytelen GRANT/REVOKE parancs. Kerem, nezze meg a kezikonyvben, milyen jogok lehetsegesek"
        ita "Comando GRANT/REVOKE illegale. Prego consultare il manuale per sapere quali privilegi possono essere usati"
        jpn "不正な GRANT/REVOKE コマンドです。どの権限で利用可能かはマニュアルを参照して下さい。"
        kor "잘못된 GRANT/REVOKE 명령. 어떤 권리와 승인이 사용되어 질 수 있는지 메뉴얼을 보시오."
        nla "Foutief GRANT/REVOKE commando. Raadpleeg de handleiding welke priveleges gebruikt kunnen worden"
        nor "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used"
        norwegian-ny "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used"
        pol "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used"
        por "Comando GRANT/REVOKE ilegal. Por favor consulte no manual quais privilégios podem ser usados"
        rum "Comanda GRANT/REVOKE ilegala. Consultati manualul in privinta privilegiilor ce pot fi folosite"
        rus "Неверная команда GRANT или REVOKE. Обратитесь к документации, чтобы выяснить, какие привилегии можно использовать"
        serbian "Pogrešna 'GRANT' odnosno 'REVOKE' komanda. Molim Vas pogledajte u priručniku koje vrednosti mogu biti upotrebljene"
        slo "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used"
        spa "Comando GRANT/REVOKE ilegal; por favor, consulte el manual para ver los permisos que se pueden usar"
        swe "Felaktigt GRANT-privilegium använt"
        ukr "Хибна GRANT/REVOKE команда; прочитайте документацію стосовно того, які права можна використовувати"
ER_GRANT_WRONG_HOST_OR_USER 42000 
        chi "GRANT 语句的主机或用户参数太长"
        cze "Argument příkazu GRANT uživatel nebo stroj je příliš dlouhý"
        dan "Værts- eller brugernavn for langt til GRANT"
        eng "The host or user argument to GRANT is too long"
        est "Masina või kasutaja nimi GRANT lauses on liiga pikk"
        fre "L'hôte ou l'utilisateur donné en argument à GRANT est trop long"
        ger "Das Host- oder User-Argument für GRANT ist zu lang"
        hindi "GRANT के लिए होस्ट या यूज़र आर्गुमेंट बहुत लंबा है"
        hun "A host vagy felhasznalo argumentuma tul hosszu a GRANT parancsban"
        ita "L'argomento host o utente per la GRANT e` troppo lungo"
        jpn "GRANTコマンドへの、ホスト名やユーザー名が長すぎます。"
        kor "승인(GRANT)을 위하여 사용한 사용자나 호스트의 값들이 너무 깁니다."
        nla "De host of gebruiker parameter voor GRANT is te lang"
        por "Argumento de 'host' ou de usuário para o GRANT é longo demais"
        rum "Argumentul host-ului sau utilizatorului pentru GRANT e prea lung"
        rus "Слишком длинное имя пользователя/хоста для GRANT"
        serbian "Argument 'host' ili 'korisnik' prosleđen komandi 'GRANT' je predugačak"
        spa "El argumento de GRANT para el equipo o usuario es demasiado grande"
        swe "Felaktigt maskinnamn eller användarnamn använt med GRANT"
        ukr "Аргумент host або user для GRANT задовгий"
ER_NO_SUCH_TABLE 42S02 
        chi "表 '%-.192s.%-.192s' 不存在"
        cze "Tabulka '%-.192s.%-.192s' neexistuje"
        dan "Tabellen '%-.192s.%-.192s' eksisterer ikke"
        eng "Table '%-.192s.%-.192s' doesn't exist"
        est "Tabelit '%-.192s.%-.192s' ei eksisteeri"
        fre "La table '%-.192s.%-.192s' n'existe pas"
        ger "Tabelle '%-.192s.%-.192s' existiert nicht"
        hindi "टेबल '%-.192s.%-.192s' मौजूद नहीं है"
        hun "A '%-.192s.%-.192s' tabla nem letezik"
        ita "La tabella '%-.192s.%-.192s' non esiste"
        jpn "表 '%-.192s.%-.192s' は存在しません。"
        kor "테이블 '%-.192s.%-.192s' 는 존재하지 않습니다."
        nla "Tabel '%-.192s.%-.192s' bestaat niet"
        nor "Table '%-.192s.%-.192s' doesn't exist"
        norwegian-ny "Table '%-.192s.%-.192s' doesn't exist"
        pol "Table '%-.192s.%-.192s' doesn't exist"
        por "Tabela '%-.192s.%-.192s' não existe"
        rum "Tabela '%-.192s.%-.192s' nu exista"
        rus "Таблица '%-.192s.%-.192s' не существует"
        serbian "Tabela '%-.192s.%-.192s' ne postoji"
        slo "Table '%-.192s.%-.192s' doesn't exist"
        spa "La tabla '%-.192s.%-.192s' no existe"
        swe "Det finns ingen tabell som heter '%-.192s.%-.192s'"
        ukr "Таблиця '%-.192s.%-.192s' не існує"
ER_NONEXISTING_TABLE_GRANT 42000 
        chi "没有为用户 '%-.48s' 来自主机 '%-.64s' 在表 '%-.192s' 上授权"
        cze "Neexistuje odpovídající grant pro uživatele '%-.48s' na stroji '%-.64s' pro tabulku '%-.192s'"
        dan "Denne tilladelse eksisterer ikke for brugeren '%-.48s' på vært '%-.64s' for tabellen '%-.192s'"
        eng "There is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'"
        est "Sellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s' tabelile '%-.192s'"
        fre "Un tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s' sur la table '%-.192s'"
        ger "Eine solche Berechtigung ist für User '%-.48s' auf Host '%-.64s' an Tabelle '%-.192s' nicht definiert"
        hun "A '%-.48s' felhasznalo szamara a '%-.64s' host '%-.192s' tablajaban ez a parancs nem engedelyezett"
        ita "GRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s' sulla tabella '%-.192s'"
        jpn "ユーザー '%-.48s' (ホスト '%-.64s' 上) の表 '%-.192s' への権限は定義されていません。"
        kor "사용자 '%-.48s'(호스트 '%-.64s')는 테이블 '%-.192s'를 사용하기 위하여 정의된 승인은 없습니다. "
        nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s' op tabel '%-.192s'"
        por "Não existe tal permissão (grant) definido para o usuário '%-.48s' no 'host' '%-.64s', na tabela '%-.192s'"
        rum "Nu exista un astfel de privilegiu (grant) definit pentru utilizatorul '%-.48s' de pe host-ul '%-.64s' pentru tabela '%-.192s'"
        rus "Такие права не определены для пользователя '%-.48s' на компьютере '%-.64s' для таблицы '%-.192s'"
        serbian "Ne postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s' tabeli '%-.192s'"
        spa "No existe tal concesión (grant) definida para el usuario '%-.48s' en el equipo '%-.64s' en la tabla '%-.192s'"
        swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s' för tabell '%-.192s'"
        ukr "Повноважень не визначено для користувача '%-.48s' з хосту '%-.64s' для таблиці '%-.192s'"
ER_NOT_ALLOWED_COMMAND 42000 
        chi "本 MariaDB 版本不允许使用这个命令"
        cze "Použitý příkaz není v této verzi MariaDB povolen"
        dan "Den brugte kommando er ikke tilladt med denne udgave af MariaDB"
        eng "The used command is not allowed with this MariaDB version"
        est "Antud käsk ei ole lubatud käesolevas MariaDB versioonis"
        fre "Cette commande n'existe pas dans cette version de MariaDB"
        ger "Der verwendete Befehl ist in dieser MariaDB-Version nicht zulässig"
        hindi "यह कमांड इस MariaDB संस्करण के साथ इस्तेमाल नहीं किया जा सकता है"
        hun "A hasznalt parancs nem engedelyezett ebben a MariaDB verzioban"
        ita "Il comando utilizzato non e` supportato in questa versione di MariaDB"
        jpn "このMariaDBバージョンでは利用できないコマンドです。"
        kor "사용된 명령은 현재의 MariaDB 버젼에서는 이용되지 않습니다."
        nla "Het used commando is niet toegestaan in deze MariaDB versie"
        por "Comando usado não é permitido para esta versão do MariaDB"
        rum "Comanda folosita nu este permisa pentru aceasta versiune de MariaDB"
        rus "Эта команда не допускается в данной  версии MariaDB"
        serbian "Upotrebljena komanda nije dozvoljena sa ovom verzijom MariaDB servera"
        spa "El comando usado no está permitido con esta versión de MariaDB"
        swe "Du kan inte använda detta kommando med denna MariaDB version"
        ukr "Використовувана команда не дозволена у цій версії MariaDB"
ER_SYNTAX_ERROR 42000 
        chi "您的 SQL 语法有错误;请查看相关文档"
        cze "Vaše syntaxe je nějaká divná"
        dan "Der er en fejl i SQL syntaksen"
        eng "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use"
        est "Viga SQL süntaksis"
        fre "Erreur de syntaxe"
        ger "Fehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagen"
        greek "You have an error in your SQL syntax"
        hindi "आपके SQL सिंटेक्स मैं गलती है; सही सिंटेक्स के लिए अपने MariaDB सर्वर संस्करण के मैन्युअल की सहायता लें"
        hun "Szintaktikai hiba"
        ita "Errore di sintassi nella query SQL"
        jpn "SQL構文エラーです。バージョンに対応するマニュアルを参照して正しい構文を確認してください。"
        kor "SQL 구문에 오류가 있습니다."
        nla "Er is iets fout in de gebruikte syntax"
        nor "Something is wrong in your syntax"
        norwegian-ny "Something is wrong in your syntax"
        pol "Something is wrong in your syntax"
        por "Você tem um erro de sintaxe no seu SQL"
        rum "Aveti o eroare in sintaxa RSQL"
        rus "У вас ошибка в запросе. Изучите документацию по используемой версии MariaDB на предмет корректного синтаксиса"
        serbian "Imate grešku u vašoj SQL sintaksi"
        slo "Something is wrong in your syntax"
        spa "Existe un error en su sintaxis SQL; revise el manual que se corresponde con su versión del servidor MariaDB para averiguar la sintaxis correcta a utilizar"
        swe "Du har något fel i din syntax"
        ukr "У вас помилка у синтаксисі SQL"
ER_DELAYED_CANT_CHANGE_LOCK  
        chi "延迟插入线程无法获得 %-.192s 的请求锁定"
        cze "Zpožděný insert threadu nebyl schopen získat požadovaný zámek pro tabulku %-.192s"
        dan "Forsinket indsættelse tråden (delayed insert thread) kunne ikke opnå lås på tabellen %-.192s"
        eng "Delayed insert thread couldn't get requested lock for table %-.192s"
        est "INSERT DELAYED lõim ei suutnud saada soovitud lukku tabelile %-.192s"
        fre "La tâche 'delayed insert' n'a pas pu obtenir le verrou démandé sur la table %-.192s"
        ger "Verzögerter (DELAYED) Einfüge-Thread konnte die angeforderte Sperre für Tabelle '%-.192s' nicht erhalten"
        hun "A kesleltetett beillesztes (delayed insert) thread nem kapott zatolast a %-.192s tablahoz"
        ita "Il thread di inserimento ritardato non riesce ad ottenere il lock per la tabella %-.192s"
        jpn "'Delayed insert'スレッドが表 '%-.192s' のロックを取得できませんでした。"
        kor "지연된 insert 쓰레드가 테이블 %-.192s의 요구된 락킹을 처리할 수 없었습니다."
        nla "'Delayed insert' thread kon de aangevraagde 'lock' niet krijgen voor tabel %-.192s"
        por "'Thread' de inserção retardada (atrasada) pois não conseguiu obter a trava solicitada para tabela '%-.192s'"
        rum "Thread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.192s"
        rus "Поток, обслуживающий отложенную вставку (delayed insert), не смог получить запрашиваемую блокировку на таблицу %-.192s"
        serbian "Prolongirani 'INSERT' thread nije mogao da dobije traženo zaključavanje tabele '%-.192s'"
        spa "El hilo (thread) de inserción retardada no pudo obtener bloqueo requerido para la tabla %-.192s"
        swe "DELAYED INSERT-tråden kunde inte låsa tabell '%-.192s'"
        ukr "Гілка для INSERT DELAYED не може отримати блокування для таблиці %-.192s"
ER_TOO_MANY_DELAYED_THREADS  
        chi "使用中的延迟线程太多"
        cze "Příliš mnoho zpožděných threadů"
        dan "For mange slettede tråde (threads) i brug"
        eng "Too many delayed threads in use"
        est "Liiga palju DELAYED lõimesid kasutusel"
        fre "Trop de tâche 'delayed' en cours"
        ger "Zu viele verzögerte (DELAYED) Threads in Verwendung"
        hindi "बहुत से DELAYED थ्रेड्स उपयोग में हैं"
        hun "Tul sok kesletetett thread (delayed)"
        ita "Troppi threads ritardati in uso"
        jpn "'Delayed insert'スレッドが多すぎます。"
        kor "너무 많은 지연 쓰레드를 사용하고 있습니다."
        nla "Te veel 'delayed' threads in gebruik"
        por "Excesso de 'threads' retardadas (atrasadas) em uso"
        rum "Prea multe threaduri aminate care sint in uz"
        rus "Слишком много потоков, обслуживающих отложенную вставку (delayed insert)"
        serbian "Previše prolongiranih thread-ova je u upotrebi"
        spa "Demasiados hilos (threads) retardados en uso"
        swe "Det finns redan 'max_delayed_threads' trådar i använding"
        ukr "Забагато затриманих гілок використовується"
ER_ABORTING_CONNECTION 08S01 
        chi "终止连线 %ld 数据库: '%-.192s' 用户: '%-.48s' (%-.64s)"
        cze "Zrušeno spojení %ld do databáze: '%-.192s' uživatel: '%-.48s' (%-.64s)"
        dan "Afbrudt forbindelse %ld til database: '%-.192s' bruger: '%-.48s' (%-.64s)"
        eng "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
        est "Ühendus katkestatud %ld andmebaasile: '%-.192s' kasutajale: '%-.48s' (%-.64s)"
        fre "Connection %ld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' (%-.64s)"
        ger "Abbruch der Verbindung %ld zur Datenbank '%-.192s'. Benutzer: '%-.48s' (%-.64s)"
        hun "Megszakitott kapcsolat %ld db: '%-.192s' adatbazishoz, felhasznalo: '%-.48s' (%-.64s)"
        ita "Interrotta la connessione %ld al db: '%-.192s' utente: '%-.48s' (%-.64s)"
        jpn "接続 %ld が中断されました。データベース: '%-.192s' ユーザー: '%-.48s' (%-.64s)"
        kor "데이타베이스 접속을 위한 연결 %ld가 중단됨 : '%-.192s' 사용자: '%-.48s' (%-.64s)"
        nla "Afgebroken verbinding %ld naar db: '%-.192s' gebruiker: '%-.48s' (%-.64s)"
        nor "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
        norwegian-ny "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
        pol "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
        por "Conexão %ld abortou para o banco de dados '%-.192s' - usuário '%-.48s' (%-.64s)"
        rum "Conectie terminata %ld la baza de date: '%-.192s' utilizator: '%-.48s' (%-.64s)"
        rus "Прервано соединение %ld к базе данных '%-.192s' пользователя '%-.48s' (%-.64s)"
        serbian "Prekinuta konekcija broj %ld ka bazi: '%-.192s' korisnik je bio: '%-.48s' (%-.64s)"
        slo "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
        spa "Conexión %ld abortada para la base de datos: '%-.192s' usuario: '%-.48s' (%-.64s)"
        swe "Avbröt länken för tråd %ld till db '%-.192s', användare '%-.48s' (%-.64s)"
        ukr "Перервано з'єднання %ld до бази данних: '%-.192s' користувача: '%-.48s' (%-.64s)"
ER_NET_PACKET_TOO_LARGE 08S01 
        chi "收到的数据包大于 'max_allowed_packet' 字节"
        cze "Zjištěn příchozí packet delší než 'max_allowed_packet'"
        dan "Modtog en datapakke som var større end 'max_allowed_packet'"
        eng "Got a packet bigger than 'max_allowed_packet' bytes"
        est "Saabus suurem pakett kui lubatud 'max_allowed_packet' muutujaga"
        fre "Paquet plus grand que 'max_allowed_packet' reçu"
        ger "Empfangenes Paket ist größer als 'max_allowed_packet' Bytes"
        hindi "'max_allowed_packet' से भी बड़ा एक पैकेट मिला"
        hun "A kapott csomag nagyobb, mint a maximalisan engedelyezett: 'max_allowed_packet'"
        ita "Ricevuto un pacchetto piu` grande di 'max_allowed_packet'"
        jpn "'max_allowed_packet'よりも大きなパケットを受信しました。"
        kor "'max_allowed_packet'보다 더큰 패킷을 받았습니다."
        nla "Groter pakket ontvangen dan 'max_allowed_packet'"
        por "Obteve um pacote maior do que a taxa máxima de pacotes definida (max_allowed_packet)"
        rum "Un packet mai mare decit 'max_allowed_packet' a fost primit"
        rus "Полученный пакет больше, чем 'max_allowed_packet'"
        serbian "Primio sam mrežni paket veći od definisane vrednosti 'max_allowed_packet'"
        spa "Obtenido un paquete mayor de 'max_allowed_packet' bytes"
        swe "Kommunkationspaketet är större än 'max_allowed_packet'"
        ukr "Отримано пакет більший ніж max_allowed_packet"
ER_NET_READ_ERROR_FROM_PIPE 08S01 
        chi "连接管道读取错误"
        cze "Zjištěna chyba při čtení z roury spojení"
        dan "Fik læsefejl fra forbindelse (connection pipe)"
        eng "Got a read error from the connection pipe"
        est "Viga ühendustoru lugemisel"
        fre "Erreur de lecture reçue du pipe de connexion"
        ger "Lese-Fehler bei einer Verbindungs-Pipe"
        hindi "कनेक्शन पाइप से एक READ त्रुटि हुई"
        hun "Olvasasi hiba a kapcsolat soran"
        ita "Rilevato un errore di lettura dalla pipe di connessione"
        jpn "接続パイプの読み込みエラーです。"
        kor "연결 파이프로부터 에러가 발생하였습니다."
        nla "Kreeg leesfout van de verbindings pipe"
        por "Obteve um erro de leitura no 'pipe' da conexão"
        rum "Eroare la citire din cauza lui 'connection pipe'"
        rus "Получена ошибка чтения от потока соединения (connection pipe)"
        serbian "Greška pri čitanju podataka sa pipe-a"
        spa "Obtenido un error de lectura desde la tubería de la conexión"
        swe "Fick läsfel från klienten vid läsning från 'PIPE'"
        ukr "Отримано помилку читання з комунікаційного каналу"
ER_NET_FCNTL_ERROR 08S01 
        chi "fcntl()的错误"
        cze "Zjištěna chyba fcntl()"
        dan "Fik fejlmeddelelse fra fcntl()"
        eng "Got an error from fcntl()"
        est "fcntl() tagastas vea"
        fre "Erreur reçue de fcntl() "
        ger "fcntl() lieferte einen Fehler"
        hindi "fcntl() से एक त्रुटि हुई"
        hun "Hiba a fcntl() fuggvenyben"
        ita "Rilevato un errore da fcntl()"
        jpn "fcntl()がエラーを返しました。"
        kor "fcntl() 함수로부터 에러가 발생하였습니다."
        nla "Kreeg fout van fcntl()"
        por "Obteve um erro em fcntl()"
        rum "Eroare obtinuta de la fcntl()"
        rus "Получена ошибка от fcntl()"
        serbian "Greška pri izvršavanju funkcije fcntl()"
        spa "Obtenido un error de fcntl()"
        swe "Fick fatalt fel från 'fcntl()'"
        ukr "Отримано помилкку від fcntl()"
ER_NET_PACKETS_OUT_OF_ORDER 08S01 
        chi "数据包乱序"
        cze "Příchozí packety v chybném pořadí"
        dan "Modtog ikke datapakker i korrekt rækkefølge"
        eng "Got packets out of order"
        est "Paketid saabusid vales järjekorras"
        fre "Paquets reçus dans le désordre"
        ger "Pakete nicht in der richtigen Reihenfolge empfangen"
        hindi "पैकेट्स क्रम में नहीं प्राप्त हुए"
        hun "Helytelen sorrendben erkezett adatcsomagok"
        ita "Ricevuti pacchetti non in ordine"
        jpn "不正な順序のパケットを受信しました。"
        kor "순서가 맞지않는 패킷을 받았습니다."
        nla "Pakketten in verkeerde volgorde ontvangen"
        por "Obteve pacotes fora de ordem"
        rum "Packets care nu sint ordonati au fost gasiti"
        rus "Пакеты получены в неверном порядке"
        serbian "Primio sam mrežne pakete van reda"
        spa "Obtenidos paquetes desordenados"
        swe "Kommunikationspaketen kom i fel ordning"
        ukr "Отримано пакети у неналежному порядку"
ER_NET_UNCOMPRESS_ERROR 08S01 
        chi "无法解压缩通信数据包"
        cze "Nemohu rozkomprimovat komunikační packet"
        dan "Kunne ikke dekomprimere kommunikations-pakke (communication packet)"
        eng "Couldn't uncompress communication packet"
        est "Viga andmepaketi lahtipakkimisel"
        fre "Impossible de décompresser le paquet reçu"
        ger "Kommunikationspaket lässt sich nicht entpacken"
        hindi "संचार पैकेट UNCOMPRESS नहीं कर सके"
        hun "A kommunikacios adatcsomagok nem tomorithetok ki"
        ita "Impossibile scompattare i pacchetti di comunicazione"
        jpn "圧縮パケットの展開ができませんでした。"
        kor "통신 패킷의 압축해제를 할 수 없었습니다."
        nla "Communicatiepakket kon niet worden gedecomprimeerd"
        por "Não conseguiu descomprimir pacote de comunicação"
        rum "Nu s-a putut decompresa pachetul de comunicatie (communication packet)"
        rus "Невозможно распаковать пакет, полученный через коммуникационный протокол"
        serbian "Ne mogu da dekompresujem mrežne pakete"
        spa "No pude descomprimir paquete de comunicación"
        swe "Kunde inte packa up kommunikationspaketet"
        ukr "Не можу декомпресувати комунікаційний пакет"
ER_NET_READ_ERROR 08S01 
        chi "读取通信数据包出错"
        cze "Zjištěna chyba při čtení komunikačního packetu"
        dan "Fik fejlmeddelelse ved læsning af kommunikations-pakker (communication packets)"
        eng "Got an error reading communication packets"
        est "Viga andmepaketi lugemisel"
        fre "Erreur de lecture des paquets reçus"
        ger "Fehler beim Lesen eines Kommunikationspakets"
        hindi "संचार पैकेट्स पढ़ते समय एक त्रुटि हुई"
        hun "HIba a kommunikacios adatcsomagok olvasasa soran"
        ita "Rilevato un errore ricevendo i pacchetti di comunicazione"
        jpn "パケットの受信でエラーが発生しました。"
        kor "통신 패킷을 읽는 중 오류가 발생하였습니다."
        nla "Fout bij het lezen van communicatiepakketten"
        por "Obteve um erro na leitura de pacotes de comunicação"
        rum "Eroare obtinuta citind pachetele de comunicatie (communication packets)"
        rus "Получена ошибка в процессе получения пакета через коммуникационный протокол "
        serbian "Greška pri primanju mrežnih paketa"
        spa "Obtenido un error leyendo paquetes de comunicación"
        swe "Fick ett fel vid läsning från klienten"
        ukr "Отримано помилку читання комунікаційних пакетів"
ER_NET_READ_INTERRUPTED 08S01 
        chi "读取通信包超时"
        cze "Zjištěn timeout při čtení komunikačního packetu"
        dan "Timeout-fejl ved læsning af kommunukations-pakker (communication packets)"
        eng "Got timeout reading communication packets"
        est "Kontrollaja ületamine andmepakettide lugemisel"
        fre "Timeout en lecture des paquets reçus"
        ger "Zeitüberschreitung beim Lesen eines Kommunikationspakets"
        hindi "संचार पैकेट्स पढ़ने के दौरान टाइमआउट"
        hun "Idotullepes a kommunikacios adatcsomagok olvasasa soran"
        ita "Rilevato un timeout ricevendo i pacchetti di comunicazione"
        jpn "パケットの受信でタイムアウトが発生しました。"
        kor "통신 패킷을 읽는 중 timeout이 발생하였습니다."
        nla "Timeout bij het lezen van communicatiepakketten"
        por "Obteve expiração de tempo (timeout) na leitura de pacotes de comunicação"
        rum "Timeout obtinut citind pachetele de comunicatie (communication packets)"
        rus "Получен таймаут ожидания пакета через коммуникационный протокол "
        serbian "Vremenski limit za čitanje mrežnih paketa je istekao"
        spa "Obtenido tiempo agotado (timeout) leyendo paquetes de comunicación"
        swe "Fick 'timeout' vid läsning från klienten"
        ukr "Отримано затримку читання комунікаційних пакетів"
ER_NET_ERROR_ON_WRITE 08S01 
        chi "写入通信包时出错"
        cze "Zjištěna chyba při zápisu komunikačního packetu"
        dan "Fik fejlmeddelelse ved skrivning af kommunukations-pakker (communication packets)"
        eng "Got an error writing communication packets"
        est "Viga andmepaketi kirjutamisel"
        fre "Erreur d'écriture des paquets envoyés"
        ger "Fehler beim Schreiben eines Kommunikationspakets"
        hindi "संचार पैकेट्स लिखते समय एक त्रुटि हुई"
        hun "Hiba a kommunikacios csomagok irasa soran"
        ita "Rilevato un errore inviando i pacchetti di comunicazione"
        jpn "パケットの送信でエラーが発生しました。"
        kor "통신 패킷을 기록하는 중 오류가 발생하였습니다."
        nla "Fout bij het schrijven van communicatiepakketten"
        por "Obteve um erro na escrita de pacotes de comunicação"
        rum "Eroare in scrierea pachetelor de comunicatie (communication packets)"
        rus "Получена ошибка при передаче пакета через коммуникационный протокол "
        serbian "Greška pri slanju mrežnih paketa"
        spa "Obtenido un error escribiendo paquetes de comunicación"
        swe "Fick ett fel vid skrivning till klienten"
        ukr "Отримано помилку запису комунікаційних пакетів"
ER_NET_WRITE_INTERRUPTED 08S01 
        chi "写入通信包超时"
        cze "Zjištěn timeout při zápisu komunikačního packetu"
        dan "Timeout-fejl ved skrivning af kommunukations-pakker (communication packets)"
        eng "Got timeout writing communication packets"
        est "Kontrollaja ületamine andmepakettide kirjutamisel"
        fre "Timeout d'écriture des paquets envoyés"
        ger "Zeitüberschreitung beim Schreiben eines Kommunikationspakets"
        hindi "संचार पैकेट्स लिखने के दौरान टाइमआउट"
        hun "Idotullepes a kommunikacios csomagok irasa soran"
        ita "Rilevato un timeout inviando i pacchetti di comunicazione"
        jpn "パケットの送信でタイムアウトが発生しました。"
        kor "통신 패팃을 기록하는 중 timeout이 발생하였습니다."
        nla "Timeout bij het schrijven van communicatiepakketten"
        por "Obteve expiração de tempo ('timeout') na escrita de pacotes de comunicação"
        rum "Timeout obtinut scriind pachetele de comunicatie (communication packets)"
        rus "Получен таймаут в процессе передачи пакета через коммуникационный протокол "
        serbian "Vremenski limit za slanje mrežnih paketa je istekao"
        spa "Obtenido tiempo agotado (timeout) escribiendo paquetes de comunicación"
        swe "Fick 'timeout' vid skrivning till klienten"
        ukr "Отримано затримку запису комунікаційних пакетів"
ER_TOO_LONG_STRING 42000 
        chi "结果字符串长于'max_allowed_packet'字节"
        cze "Výsledný řetězec je delší než 'max_allowed_packet'"
        dan "Strengen med resultater er større end 'max_allowed_packet'"
        eng "Result string is longer than 'max_allowed_packet' bytes"
        est "Tulemus on pikem kui lubatud 'max_allowed_packet' muutujaga"
        fre "La chaîne résultat est plus grande que 'max_allowed_packet'"
        ger "Ergebnis-String ist länger als 'max_allowed_packet' Bytes"
        hindi "रिजल्ट स्ट्रिंग 'max_allowed_packet' से लंबा है"
        hun "Ez eredmeny sztring nagyobb, mint a lehetseges maximum: 'max_allowed_packet'"
        ita "La stringa di risposta e` piu` lunga di 'max_allowed_packet'"
        jpn "結果の文字列が 'max_allowed_packet' よりも大きいです。"
        kor "결과 문자열이 설정된 max_allowed_packet 값보다 큽니다."
        nla "Resultaat string is langer dan 'max_allowed_packet'"
        por "'String' resultante é mais longa do que 'max_allowed_packet'"
        rum "Sirul rezultat este mai lung decit 'max_allowed_packet'"
        rus "Результирующая строка больше, чем 'max_allowed_packet'"
        serbian "Rezultujuči string je duži nego što to dozvoljava parametar servera 'max_allowed_packet'"
        spa "La cadena resultante es mayor de max_allowed_packet bytes"
        swe "Resultatsträngen är längre än max_allowed_packet"
        ukr "Строка результату довша ніж max_allowed_packet"
ER_TABLE_CANT_HANDLE_BLOB 42000 
        chi "存储引擎%s不支持blob / text列"
        cze "Typ použité tabulky (%s) nepodporuje BLOB/TEXT sloupce"
        dan "Denne tabeltype (%s) understøtter ikke brug af BLOB og TEXT kolonner"
        eng "Storage engine %s doesn't support BLOB/TEXT columns"
        est "Valitud tabelitüüp (%s) ei toeta BLOB/TEXT tüüpi välju"
        fre "Ce type de table (%s) ne supporte pas les colonnes BLOB/TEXT"
        ger "Der verwendete Tabellentyp (%s) unterstützt keine BLOB- und TEXT-Felder"
        hindi "स्टोरेज इंजन %s BLOB/TEXT कॉलम्स को सपोर्ट नहीं करता"
        hun "A hasznalt tabla tipus (%s) nem tamogatja a BLOB/TEXT mezoket"
        ita "Il tipo di tabella usata (%s) non supporta colonne di tipo BLOB/TEXT"
        kor "스토리지 엔진 (%s)는 BLOB/TEXT 컬럼을 지원하지 않습니다."
        nla "Het gebruikte tabel type (%s) ondersteunt geen BLOB/TEXT kolommen"
        por "Tipo de tabela usado (%s) não permite colunas BLOB/TEXT"
        rum "Tipul de tabela folosit (%s) nu suporta coloane de tip BLOB/TEXT"
        rus "%s таблицы не поддерживают типы BLOB/TEXT"
        serbian "Iskorišteni tip tabele (%s) ne podržava kolone tipa 'BLOB' odnosno 'TEXT'"
        spa "El motor de almacenaje %s no soporta columnas de tipo BLOB/TEXT"
        swe "Den använda tabelltypen (%s) kan inte hantera BLOB/TEXT-kolumner"
        ukr "%s таблиці не підтримують BLOB/TEXT стовбці"
ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 42000 
        chi "存储引擎%s不支持auto_increment列"
        cze "Typ použité tabulky (%s) nepodporuje AUTO_INCREMENT sloupce"
        dan "Denne tabeltype understøtter (%s) ikke brug af AUTO_INCREMENT kolonner"
        eng "Storage engine %s doesn't support AUTO_INCREMENT columns"
        est "Valitud tabelitüüp (%s) ei toeta AUTO_INCREMENT tüüpi välju"
        fre "Ce type de table (%s) ne supporte pas les colonnes AUTO_INCREMENT"
        ger "Der verwendete Tabellentyp (%s) unterstützt keine AUTO_INCREMENT-Felder"
        hindi "स्टोरेज इंजन %s AUTO_INCREMENT कॉलम्स को सपोर्ट नहीं करता"
        hun "A hasznalt tabla tipus (%s) nem tamogatja az AUTO_INCREMENT tipusu mezoket"
        ita "Il tipo di tabella usata (%s) non supporta colonne di tipo AUTO_INCREMENT"
        kor "스토리지 엔진 (%s)는 AUTO_INCREMENT를 지원하지 않습니다."
        nla "Het gebruikte tabel type (%s) ondersteunt geen AUTO_INCREMENT kolommen"
        por "Tipo de tabela usado (%s) não permite colunas AUTO_INCREMENT"
        rum "Tipul de tabela folosit (%s) nu suporta coloane de tip AUTO_INCREMENT"
        rus "%s таблицы не поддерживают автоинкрементные столбцы"
        serbian "Iskorišteni tip tabele (%s) ne podržava kolone tipa 'AUTO_INCREMENT'"
        spa "El motor de almacenaje %s no soporta columnas AUTO_INCREMENT"
        swe "Den använda tabelltypen (%s) kan inte hantera AUTO_INCREMENT-kolumner"
        ukr "%s таблиці не підтримують AUTO_INCREMENT стовбці"
ER_DELAYED_INSERT_TABLE_LOCKED  
        chi "INSERT DELAYED 不能用在表 '%-.192s' 因为它被LOCK TABLES 锁定"
        cze "INSERT DELAYED není možno s tabulkou '%-.192s' použít, protože je zamčená pomocí LOCK TABLES"
        dan "INSERT DELAYED kan ikke bruges med tabellen '%-.192s', fordi tabellen er låst med LOCK TABLES"
        eng "INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES"
        est "INSERT DELAYED ei saa kasutada tabeli '%-.192s' peal, kuna see on lukustatud LOCK TABLES käsuga"
        fre "INSERT DELAYED ne peut être utilisé avec la table '%-.192s', car elle est verrouée avec LOCK TABLES"
        ger "INSERT DELAYED kann für Tabelle '%-.192s' nicht verwendet werden, da sie mit LOCK TABLES gesperrt ist"
        greek "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
        hun "Az INSERT DELAYED nem hasznalhato a '%-.192s' tablahoz, mert a tabla zarolt (LOCK TABLES)"
        ita "L'inserimento ritardato (INSERT DELAYED) non puo` essere usato con la tabella '%-.192s', perche` soggetta a lock da 'LOCK TABLES'"
        jpn "表 '%-.192s' はLOCK TABLESでロックされているため、INSERT DELAYEDを使用できません。"
        kor "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
        nla "INSERT DELAYED kan niet worden gebruikt bij table '%-.192s', vanwege een 'lock met LOCK TABLES"
        nor "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
        norwegian-ny "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
        pol "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
        por "INSERT DELAYED não pode ser usado com a tabela '%-.192s', porque ela está travada com LOCK TABLES"
        rum "INSERT DELAYED nu poate fi folosit cu tabela '%-.192s', deoarece este locked folosing LOCK TABLES"
        rus "Нельзя использовать INSERT DELAYED для таблицы '%-.192s', потому что она заблокирована с помощью LOCK TABLES"
        serbian "Komanda 'INSERT DELAYED' ne može biti iskorištena u tabeli '%-.192s', zbog toga što je zaključana komandom 'LOCK TABLES'"
        slo "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
        spa "INSERT DELAYED no puede ser usado con la tabla '%-.192s' porque esta bloqueada con LOCK TABLES"
        swe "INSERT DELAYED kan inte användas med tabell '%-.192s', emedan den är låst med LOCK TABLES"
        ukr "INSERT DELAYED не може бути використано з таблицею '%-.192s', тому що її заблоковано з LOCK TABLES"
ER_WRONG_COLUMN_NAME 42000 
        chi "错误列名 '%-.100s'"
        cze "Nesprávné jméno sloupce '%-.100s'"
        dan "Forkert kolonnenavn '%-.100s'"
        eng "Incorrect column name '%-.100s'"
        est "Vigane tulba nimi '%-.100s'"
        fre "Nom de colonne '%-.100s' incorrect"
        ger "Falscher Spaltenname '%-.100s'"
        hindi "कॉलम नाम '%-.100s' गलत है"
        hun "Ervenytelen mezonev: '%-.100s'"
        ita "Nome colonna '%-.100s' non corretto"
        jpn "列名 '%-.100s' は不正です。"
        nla "Incorrecte kolom naam '%-.100s'"
        por "Nome de coluna '%-.100s' incorreto"
        rum "Nume increct de coloana '%-.100s'"
        rus "Неверное имя столбца '%-.100s'"
        serbian "Pogrešno ime kolone '%-.100s'"
        spa "Nombre Incorrecto de columna '%-.100s'"
        swe "Felaktigt kolumnnamn '%-.100s'"
        ukr "Невірне ім'я стовбця '%-.100s'"
ER_WRONG_KEY_COLUMN 42000 
        chi "存储引擎 %s 不能给 %`s 列建索引"
        eng "The storage engine %s can't index column %`s"
        ger "Die Speicher-Engine %s kann die Spalte %`s nicht indizieren"
        hindi "स्टोरेज इंजन %s, कॉलम %`s को इंडेक्स नहीं कर सकता"
        rus "Обработчик таблиц %s не может проиндексировать столбец %`s"
        spa "El motor de almacenaje %s no puede indizar la columna %`s"
        ukr "Вказівник таблиц %s не може індексувати стовбець %`s"
ER_WRONG_MRG_TABLE  
        chi "无法打开定义不同或非 MyISAM 类型或不存在的表"
        cze "Všechny tabulky v MERGE tabulce nejsou definovány stejně"
        dan "Tabellerne i MERGE er ikke defineret ens"
        eng "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist"
        est "Kõik tabelid MERGE tabeli määratluses ei ole identsed"
        fre "Toutes les tables de la table de type MERGE n'ont pas la même définition"
        ger "Nicht alle Tabellen in der MERGE-Tabelle sind gleich definiert"
        hun "A MERGE tablaban talalhato tablak definicioja nem azonos"
        ita "Non tutte le tabelle nella tabella di MERGE sono definite in maniera identica"
        jpn "MERGE表の構成表がオープンできません。列定義が異なるか、MyISAM表ではないか、存在しません。"
        kor "All tables in the MERGE table are not defined identically"
        nla "Niet alle tabellen in de MERGE tabel hebben identieke gedefinities"
        nor "All tables in the MERGE table are not defined identically"
        norwegian-ny "All tables in the MERGE table are not defined identically"
        pol "All tables in the MERGE table are not defined identically"
        por "Todas as tabelas contidas na tabela fundida (MERGE) não estão definidas identicamente"
        rum "Toate tabelele din tabela MERGE nu sint definite identic"
        rus "Не все таблицы в MERGE определены одинаково"
        serbian "Tabele iskorištene u 'MERGE' tabeli nisu definisane na isti način"
        slo "All tables in the MERGE table are not defined identically"
        spa "Incapaz de abrir la tabla subyacente por estar definida de forma diferente o por no ser del tipo no-MyISAM o por no existir"
        swe "Tabellerna i MERGE-tabellen är inte identiskt definierade"
        ukr "Таблиці у MERGE TABLE мають різну структуру"
ER_DUP_UNIQUE 23000 
        chi "因为表'%-.192s' 唯一约束,无法写入"
        cze "Kvůli unique constraintu nemozu zapsat do tabulky '%-.192s'"
        dan "Kan ikke skrive til tabellen '%-.192s' fordi det vil bryde CONSTRAINT regler"
        eng "Can't write, because of unique constraint, to table '%-.192s'"
        est "Ei suuda kirjutada tabelisse '%-.192s', kuna see rikub ühesuse kitsendust"
        fre "Écriture impossible à cause d'un index UNIQUE sur la table '%-.192s'"
        ger "Schreiben in Tabelle '%-.192s' nicht möglich wegen einer Eindeutigkeitsbeschränkung (unique constraint)"
        hun "A '%-.192s' nem irhato, az egyedi mezok miatt"
        ita "Impossibile scrivere nella tabella '%-.192s' per limitazione di unicita`"
        jpn "一意性制約違反のため、表 '%-.192s' に書き込めません。"
        nla "Kan niet opslaan naar table '%-.192s' vanwege 'unique' beperking"
        por "Não pode gravar, devido à restrição UNIQUE, na tabela '%-.192s'"
        rum "Nu pot scrie pe hard-drive, din cauza constraintului unic (unique constraint) pentru tabela '%-.192s'"
        rus "Невозможно записать в таблицу '%-.192s' из-за ограничений уникального ключа"
        serbian "Zbog provere jedinstvenosti ne mogu da upišem podatke u tabelu '%-.192s'"
        spa "No puedo grabar, debido a restricción única, en la tabla '%-.192s'"
        swe "Kan inte skriva till tabell '%-.192s'; UNIQUE-test"
        ukr "Не можу записати до таблиці '%-.192s', з причини вимог унікальності"
ER_BLOB_KEY_WITHOUT_LENGTH 42000 
        chi "BLOB/TEXT 列 '%-.192s' 在没有索引长度的索引规范中使用"
        cze "BLOB sloupec '%-.192s' je použit ve specifikaci klíče bez délky"
        dan "BLOB kolonnen '%-.192s' brugt i nøglespecifikation uden nøglelængde"
        eng "BLOB/TEXT column '%-.192s' used in key specification without a key length"
        est "BLOB-tüüpi tulp '%-.192s' on kasutusel võtmes ilma pikkust määratlemata"
        fre "La colonne '%-.192s' de type BLOB est utilisée dans une définition d'index sans longueur d'index"
        ger "BLOB- oder TEXT-Spalte '%-.192s' wird in der Schlüsseldefinition ohne Schlüssellängenangabe verwendet"
        greek "BLOB column '%-.192s' used in key specification without a key length"
        hun "BLOB mezo '%-.192s' hasznalt a mezo specifikacioban, a mezohossz megadasa nelkul"
        ita "La colonna '%-.192s' di tipo BLOB e` usata in una chiave senza specificarne la lunghezza"
        jpn "BLOB列 '%-.192s' をキーに使用するには長さ指定が必要です。"
        kor "BLOB column '%-.192s' used in key specification without a key length"
        nla "BLOB kolom '%-.192s' gebruikt in zoeksleutel specificatie zonder zoeksleutel lengte"
        nor "BLOB column '%-.192s' used in key specification without a key length"
        norwegian-ny "BLOB column '%-.192s' used in key specification without a key length"
        pol "BLOB column '%-.192s' used in key specification without a key length"
        por "Coluna BLOB '%-.192s' usada na especificação de chave sem o comprimento da chave"
        rum "Coloana BLOB '%-.192s' este folosita in specificarea unei chei fara ca o lungime de cheie sa fie folosita"
        rus "Столбец типа BLOB '%-.192s' был указан в определении ключа без указания длины ключа"
        serbian "BLOB kolona '%-.192s' je upotrebljena u specifikaciji ključa bez navođenja dužine ključa"
        slo "BLOB column '%-.192s' used in key specification without a key length"
        spa "Columna BLOB/TEXT '%-.192s', usada en especificación de clave, sin tamaño"
        swe "Du har inte angett någon nyckellängd för BLOB '%-.192s'"
        ukr "Стовбець BLOB '%-.192s' використано у визначенні ключа без вказання довжини ключа"
ER_PRIMARY_CANT_HAVE_NULL 42000 
        chi "PRIMARY KEY 的所有部分都不能为NULL;如果您需要在键中使用 NULL,请改用 UNIQUE"
        cze "Všechny části primárního klíče musejí být NOT NULL; pokud potřebujete NULL, použijte UNIQUE"
        dan "Alle dele af en PRIMARY KEY skal være NOT NULL;  Hvis du skal bruge NULL i nøglen, brug UNIQUE istedet"
        eng "All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead"
        est "Kõik PRIMARY KEY peavad olema määratletud NOT NULL piiranguga; vajadusel kasuta UNIQUE tüüpi võtit"
        fre "Toutes les parties d'un index PRIMARY KEY doivent être NOT NULL; Si vous avez besoin d'un NULL dans l'index, utilisez un index UNIQUE"
        ger "Alle Teile eines PRIMARY KEY müssen als NOT NULL definiert sein. Wenn NULL in einem Schlüssel benötigt wird, muss ein UNIQUE-Schlüssel verwendet werden"
        hindi "PRIMARY KEY के सभी भागों को NOT NULL होना चाहिए; यदि आपको एक KEY में NULL की जरूरत है, तो UNIQUE का उपयोग करें"
        hun "Az elsodleges kulcs teljes egeszeben csak NOT NULL tipusu lehet; Ha NULL mezot szeretne a kulcskent, hasznalja inkabb a UNIQUE-ot"
        ita "Tutte le parti di una chiave primaria devono essere dichiarate NOT NULL; se necessitano valori NULL nelle chiavi utilizzare UNIQUE"
        jpn "PRIMARY KEYの列は全てNOT NULLでなければいけません。UNIQUE索引であればNULLを含むことが可能です。"
        nla "Alle delen van een PRIMARY KEY moeten NOT NULL zijn; Indien u NULL in een zoeksleutel nodig heeft kunt u UNIQUE gebruiken"
        por "Todas as partes de uma chave primária devem ser não-nulas. Se você precisou usar um valor nulo (NULL) em uma chave, use a cláusula UNIQUE em seu lugar"
        rum "Toate partile unei chei primare (PRIMARY KEY) trebuie sa fie NOT NULL; Daca aveti nevoie de NULL in vreo cheie, folositi UNIQUE in schimb"
        rus "Все части первичного ключа (PRIMARY KEY) должны быть определены как NOT NULL; Если вам нужна поддержка величин NULL в ключе, воспользуйтесь индексом UNIQUE"
        serbian "Svi delovi primarnog ključa moraju biti različiti od NULL;  Ako Vam ipak treba NULL vrednost u ključu, upotrebite 'UNIQUE'"
        spa "Todas las partes de una PRIMARY KEY deben de ser NOT NULL; si necesita NULL en una clave, use UNIQUE en su lugar"
        swe "Alla delar av en PRIMARY KEY måste vara NOT NULL;  Om du vill ha en nyckel med NULL, använd UNIQUE istället"
        ukr "Усі частини PRIMARY KEY повинні бути NOT NULL; Якщо ви потребуєте NULL у ключі, скористайтеся UNIQUE"
ER_TOO_MANY_ROWS 42000 
        chi "结果多于一行"
        cze "Výsledek obsahuje více než jeden řádek"
        dan "Resultatet bestod af mere end een række"
        eng "Result consisted of more than one row"
        est "Tulemis oli rohkem kui üks kirje"
        fre "Le résultat contient plus d'un enregistrement"
        ger "Ergebnis besteht aus mehr als einer Zeile"
        hindi "परिणाम एक से अधिक पंक्ति का है"
        hun "Az eredmeny tobb, mint egy sort tartalmaz"
        ita "Il risultato consiste di piu` di una riga"
        jpn "結果が2行以上です。"
        nla "Resultaat bevatte meer dan een rij"
        por "O resultado consistiu em mais do que uma linha"
        rum "Resultatul constista din mai multe linii"
        rus "В результате возвращена более чем одна строка"
        serbian "Rezultat je sačinjen od više slogova"
        spa "Resultado compuesto de más de una fila"
        swe "Resultet bestod av mera än en rad"
        ukr "Результат знаходиться у більше ніж одній строці"
ER_REQUIRES_PRIMARY_KEY 42000 
        chi "此表类型需要主索引"
        cze "Tento typ tabulky vyžaduje primární klíč"
        dan "Denne tabeltype kræver en primærnøgle"
        eng "This table type requires a primary key"
        est "Antud tabelitüüp nõuab primaarset võtit"
        fre "Ce type de table nécessite une clé primaire (PRIMARY KEY)"
        ger "Dieser Tabellentyp benötigt einen Primärschlüssel (PRIMARY KEY)"
        hindi "इस प्रकार के टेबल को एक PRIMARY KEY की आवश्यकता है"
        hun "Az adott tablatipushoz elsodleges kulcs hasznalata kotelezo"
        ita "Questo tipo di tabella richiede una chiave primaria"
        jpn "使用のストレージエンジンでは、PRIMARY KEYが必要です。"
        nla "Dit tabel type heeft een primaire zoeksleutel nodig"
        por "Este tipo de tabela requer uma chave primária"
        rum "Aceast tip de tabela are nevoie de o cheie primara"
        rus "Этот тип таблицы требует определения первичного ключа"
        serbian "Ovaj tip tabele zahteva da imate definisan primarni ključ"
        spa "Este tipo de tabla necesita de una clave primaria"
        swe "Denna tabelltyp kräver en PRIMARY KEY"
        ukr "Цей тип таблиці потребує первинного ключа"
ER_NO_RAID_COMPILED  
        chi "这个版本的 MariaDB 编译时不支持 RAID"
        cze "Tato verze MariaDB není zkompilována s podporou RAID"
        dan "Denne udgave af MariaDB er ikke oversat med understøttelse af RAID"
        eng "This version of MariaDB is not compiled with RAID support"
        est "Antud MariaDB versioon on kompileeritud ilma RAID toeta"
        fre "Cette version de MariaDB n'est pas compilée avec le support RAID"
        ger "Diese MariaDB-Version ist nicht mit RAID-Unterstützung kompiliert"
        hindi "MariaDB का यह संस्करण RAID सपोर्ट के साथ कॉम्पाईल्ड नहीं है"
        hun "Ezen leforditott MariaDB verzio nem tartalmaz RAID support-ot"
        ita "Questa versione di MariaDB non e` compilata con il supporto RAID"
        jpn "このバージョンのMariaDBはRAIDサポートを含めてコンパイルされていません。"
        nla "Deze versie van MariaDB is niet gecompileerd met RAID ondersteuning"
        por "Esta versão do MariaDB não foi compilada com suporte a RAID"
        rum "Aceasta versiune de MariaDB, nu a fost compilata cu suport pentru RAID"
        rus "Эта версия MariaDB скомпилирована без поддержки RAID"
        serbian "Ova verzija MariaDB servera nije kompajlirana sa podrškom za RAID uređaje"
        spa "Esta versión de MariaDB no ha sido compilada con soporte para RAID"
        swe "Denna version av MariaDB är inte kompilerad med RAID"
        ukr "Ця версія MariaDB не зкомпільована з підтримкою RAID"
ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE  
        chi "您正在使用安全更新模式,同时您尝试更新时没有使用含有 KEY 列的 WHERE 语句"
        cze "Update tabulky bez WHERE s klíčem není v módu bezpečných update dovoleno"
        dan "Du bruger sikker opdaterings modus ('safe update mode') og du forsøgte at opdatere en tabel uden en WHERE klausul, der gør brug af et KEY felt"
        eng "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column"
        est "Katse muuta tabelit turvalises rezhiimis ilma WHERE klauslita"
        fre "Vous êtes en mode 'safe update' et vous essayez de faire un UPDATE sans clause WHERE utilisant un index"
        ger "MariaDB läuft im sicheren Aktualisierungsmodus (safe update mode). Sie haben versucht, eine Tabelle zu aktualisieren, ohne in der WHERE-Klausel ein KEY-Feld anzugeben"
        hun "On a biztonsagos update modot hasznalja, es        WHERE that uses a KEY column"
        ita "In modalita` 'safe update' si e` cercato di aggiornare una tabella senza clausola WHERE su una chiave"
        jpn "'safe update mode'で、索引を利用するWHERE句の無い更新処理を実行しようとしました。"
        nla "U gebruikt 'safe update mode' en u probeerde een tabel te updaten zonder een WHERE met een KEY kolom"
        por "Você está usando modo de atualização seguro e tentou atualizar uma tabela sem uma cláusula WHERE que use uma coluna chave"
        rus "Вы работаете в режиме безопасных обновлений (safe update mode) и попробовали изменить таблицу без использования ключевого столбца в части WHERE"
        serbian "Vi koristite safe update mod servera, a probali ste da promenite podatke bez 'WHERE' komande koja koristi kolonu ključa"
        spa "Está usando modo de actualización segura y ha intentado actualizar una tabla sin un WHERE que use una columna KEY"
        swe "Du använder 'säker uppdateringsmod' och försökte uppdatera en tabell utan en WHERE-sats som använder sig av en nyckel"
        ukr "Ви у режимі безпечного оновлення та намагаєтесь оновити таблицю без оператора WHERE, що використовує KEY стовбець"
ER_KEY_DOES_NOT_EXISTS 42000 S1009
        chi "索引 '%-.192s' 在表 '%-.192s' 里不存在"
        cze "Klíč '%-.192s' v tabulce '%-.192s' neexistuje"
        dan "Nøglen '%-.192s' eksisterer ikke i tabellen '%-.192s'"
        eng "Key '%-.192s' doesn't exist in table '%-.192s'"
        est "Võti '%-.192s' ei eksisteeri tabelis '%-.192s'"
        fre "L'index '%-.192s' n'existe pas sur la table '%-.192s'"
        ger "Schlüssel '%-.192s' existiert in der Tabelle '%-.192s' nicht"
        hindi "KEY '%-.192s', टेबल '%-.192s' में मौजूद नहीं है"
        hun "A '%-.192s' kulcs nem letezik a '%-.192s' tablaban"
        ita "La chiave '%-.192s' non esiste nella tabella '%-.192s'"
        jpn "索引 '%-.192s' は表 '%-.192s' には存在しません。"
        nla "Zoeksleutel '%-.192s' bestaat niet in tabel '%-.192s'"
        por "Chave '%-.192s' não existe na tabela '%-.192s'"
        rus "Ключ '%-.192s' не существует в таблице '%-.192s'"
        serbian "Ključ '%-.192s' ne postoji u tabeli '%-.192s'"
        spa "La clave '%-.192s' no existe en la tabla '%-.192s'"
        swe "Nyckel '%-.192s' finns inte in tabell '%-.192s'"
        ukr "Ключ '%-.192s' не існує в таблиці '%-.192s'"
ER_CHECK_NO_SUCH_TABLE 42000 
        chi "无法打开表"
        cze "Nemohu otevřít tabulku"
        dan "Kan ikke åbne tabellen"
        eng "Can't open table"
        est "Ei suuda avada tabelit"
        fre "Impossible d'ouvrir la table"
        ger "Kann Tabelle nicht öffnen"
        hindi "टेबल नहीं खुल सकता है"
        hun "Nem tudom megnyitni a tablat"
        ita "Impossibile aprire la tabella"
        jpn "表をオープンできません。"
        nla "Kan tabel niet openen"
        por "Não pode abrir a tabela"
        rus "Невозможно открыть таблицу"
        serbian "Ne mogu da otvorim tabelu"
        spa "No puedo abrir tabla"
        swe "Kan inte öppna tabellen"
        ukr "Не можу відкрити таблицю"
ER_CHECK_NOT_IMPLEMENTED 42000 
        chi "该表的存储引擎不支持%s"
        cze "Handler tabulky nepodporuje %s"
        dan "Denne tabeltype understøtter ikke %s"
        eng "The storage engine for the table doesn't support %s"
        est "Antud tabelitüüp ei toeta %s käske"
        fre "Ce type de table ne supporte pas les %s"
        ger "Die Speicher-Engine für diese Tabelle unterstützt kein %s"
        greek "The handler for the table doesn't support %s"
        hindi "इस टेबल का स्टोरेज इंजन '%s' को सपोर्ट नहीं करता"
        hun "A tabla kezeloje (handler) nem tamogatja az %s"
        ita "Il gestore per la tabella non supporta il %s"
        jpn "この表のストレージエンジンは '%s' を利用できません。"
        kor "The handler for the table doesn't support %s"
        nla "De 'handler' voor de tabel ondersteund geen %s"
        nor "The handler for the table doesn't support %s"
        norwegian-ny "The handler for the table doesn't support %s"
        pol "The handler for the table doesn't support %s"
        por "O manipulador de tabela não suporta %s"
        rum "The handler for the table doesn't support %s"
        rus "Обработчик таблицы не поддерживает этого: %s"
        serbian "Handler za ovu tabelu ne dozvoljava %s komande"
        slo "The handler for the table doesn't support %s"
        spa "El motor de almacenaje para la tabla no soporta %s"
        swe "Tabellhanteraren för denna tabell kan inte göra %s"
        ukr "Вказівник таблиці не підтримуе %s"
ER_CANT_DO_THIS_DURING_AN_TRANSACTION 25000 
        chi "不允许在事务中执行此命令"
        cze "Provedení tohoto příkazu není v transakci dovoleno"
        dan "Du må ikke bruge denne kommando i en transaktion"
        eng "You are not allowed to execute this command in a transaction"
        est "Seda käsku ei saa kasutada transaktsiooni sees"
        fre "Vous n'êtes pas autorisé à exécute cette commande dans une transaction"
        ger "Sie dürfen diesen Befehl nicht in einer Transaktion ausführen"
        hun "Az On szamara nem engedelyezett a parancs vegrehajtasa a tranzakcioban"
        ita "Non puoi eseguire questo comando in una transazione"
        jpn "このコマンドはトランザクション内で実行できません。"
        nla "Het is u niet toegestaan dit commando uit te voeren binnen een transactie"
        por "Não lhe é permitido executar este comando em uma transação"
        rus "Вам не разрешено выполнять эту команду в транзакции"
        serbian "Nije Vam dozvoljeno da izvršite ovu komandu u transakciji"
        spa "No tiene el permiso para ejecutar este comando en una transacción"
        swe "Du får inte utföra detta kommando i en transaktion"
        ukr "Вам не дозволено виконувати цю команду в транзакції"
ER_ERROR_DURING_COMMIT  
        chi "COMMIT时发生错误 %M "
        cze "Chyba %M při COMMIT"
        dan "Modtog fejl %M mens kommandoen COMMIT blev udført"
        eng "Got error %M during COMMIT"
        est "Viga %M käsu COMMIT täitmisel"
        fre "Erreur %M lors du COMMIT"
        ger "Fehler %M beim COMMIT"
        hindi "COMMIT के दौरान %M त्रुटि हुई"
        hun "%M hiba a COMMIT vegrehajtasa soran"
        ita "Rilevato l'errore %M durante il COMMIT"
        jpn "COMMIT中にエラー %M が発生しました。"
        nla "Kreeg fout %M tijdens COMMIT"
        por "Obteve erro %M durante COMMIT"
        rus "Получена ошибка %M в процессе COMMIT"
        serbian "Greška %M za vreme izvršavanja komande 'COMMIT'"
        spa "Obtenido error %M durante COMMIT"
        swe "Fick fel %M vid COMMIT"
        ukr "Отримано помилку %M під час COMMIT"
ER_ERROR_DURING_ROLLBACK  
        chi "回滚时出错%M"
        cze "Chyba %M při ROLLBACK"
        dan "Modtog fejl %M mens kommandoen ROLLBACK blev udført"
        eng "Got error %M during ROLLBACK"
        est "Viga %M käsu ROLLBACK täitmisel"
        fre "Erreur %M lors du ROLLBACK"
        ger "Fehler %M beim ROLLBACK"
        hindi "ROLLBACK के दौरान %M त्रुटि हुई"
        hun "%M hiba a ROLLBACK vegrehajtasa soran"
        ita "Rilevato l'errore %M durante il ROLLBACK"
        jpn "ROLLBACK中にエラー %M が発生しました。"
        nla "Kreeg fout %M tijdens ROLLBACK"
        por "Obteve erro %M durante ROLLBACK"
        rus "Получена ошибка %M в процессе ROLLBACK"
        serbian "Greška %M za vreme izvršavanja komande 'ROLLBACK'"
        spa "Obtenido error %M durante ROLLBACK"
        swe "Fick fel %M vid ROLLBACK"
        ukr "Отримано помилку %M під час ROLLBACK"
ER_ERROR_DURING_FLUSH_LOGS  
        chi "flush_logs时出错%M"
        cze "Chyba %M při FLUSH_LOGS"
        dan "Modtog fejl %M mens kommandoen FLUSH_LOGS blev udført"
        eng "Got error %M during FLUSH_LOGS"
        est "Viga %M käsu FLUSH_LOGS täitmisel"
        fre "Erreur %M lors du FLUSH_LOGS"
        ger "Fehler %M bei FLUSH_LOGS"
        hindi "FLUSH_LOGS के दौरान %M त्रुटि हुई"
        hun "%M hiba a FLUSH_LOGS vegrehajtasa soran"
        ita "Rilevato l'errore %M durante il FLUSH_LOGS"
        jpn "FLUSH_LOGS中にエラー %M が発生しました。"
        nla "Kreeg fout %M tijdens FLUSH_LOGS"
        por "Obteve erro %M durante FLUSH_LOGS"
        rus "Получена ошибка %M в процессе FLUSH_LOGS"
        serbian "Greška %M za vreme izvršavanja komande 'FLUSH_LOGS'"
        spa "Obtenido error %M durante FLUSH_LOGS"
        swe "Fick fel %M vid FLUSH_LOGS"
        ukr "Отримано помилку %M під час FLUSH_LOGS"
ER_ERROR_DURING_CHECKPOINT  
        chi "CHECKPOINT时出错%M "
        cze "Chyba %M při CHECKPOINT"
        dan "Modtog fejl %M mens kommandoen CHECKPOINT blev udført"
        eng "Got error %M during CHECKPOINT"
        est "Viga %M käsu CHECKPOINT täitmisel"
        fre "Erreur %M lors du CHECKPOINT"
        ger "Fehler %M bei CHECKPOINT"
        hindi "CHECKPOINT के दौरान %M त्रुटि हुई"
        hun "%M hiba a CHECKPOINT vegrehajtasa soran"
        ita "Rilevato l'errore %M durante il CHECKPOINT"
        jpn "CHECKPOINT中にエラー %M が発生しました。"
        nla "Kreeg fout %M tijdens CHECKPOINT"
        por "Obteve erro %M durante CHECKPOINT"
        rus "Получена ошибка %M в процессе CHECKPOINT"
        serbian "Greška %M za vreme izvršavanja komande 'CHECKPOINT'"
        spa "Obtenido error %M durante CHECKPOINT"
        swe "Fick fel %M vid CHECKPOINT"
        ukr "Отримано помилку %M під час CHECKPOINT"
ER_NEW_ABORTING_CONNECTION 08S01 
        chi "终止的连接 %lld 到数据库: '%-.192s' 用户: '%-.48s' 主机: '%-.64s'%-.64s (%-.64s)"
        cze "Spojení %lld do databáze: '%-.192s' uživatel: '%-.48s' stroj: '%-.64s'%-.64s (%-.64s) bylo přerušeno"
        dan "Afbrød forbindelsen %lld til databasen '%-.192s' bruger: '%-.48s' vært: '%-.64s'%-.64s (%-.64s)"
        eng "Aborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)"
        est "Ühendus katkestatud %lld andmebaas: '%-.192s' kasutaja: '%-.48s' masin: '%-.64s'%-.64s (%-.64s)"
        fre "Connection %lld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' hôte: '%-.64s'%-.64s (%-.64s)"
        ger "Abbruch der Verbindung %lld zur Datenbank '%-.192s'. Benutzer: '%-.48s', Host: '%-.64s'%-.64s (%-.64s)"
        ita "Interrotta la connessione %lld al db: ''%-.192s' utente: '%-.48s' host: '%-.64s'%-.64s (%-.64s)"
        jpn "接続 %lld が中断されました。データベース: '%-.192s' ユーザー: '%-.48s' ホスト: '%-.64s'%-.64s (%-.64s)"
        nla "Afgebroken verbinding %lld naar db: '%-.192s' gebruiker: '%-.48s' host: '%-.64s'%-.64s (%-.64s)"
        por "Conexão %lld abortada para banco de dados '%-.192s' - usuário '%-.48s' - 'host' '%-.64s'%-.64s ('%-.64s')"
        rus "Прервано соединение %lld к базе данных '%-.192s' пользователя '%-.48s' с хоста '%-.64s'%-.64s (%-.64s)"
        serbian "Prekinuta konekcija broj %lld ka bazi: '%-.192s' korisnik je bio: '%-.48s' a host: '%-.64s'%-.64s (%-.64s)"
        spa "Abortada conexión %lld a la base de datos: '%-.192s' usuario: '%-.48s' equipo: '%-.64s'%-.64s (%-.64s)"
        swe "Avbröt länken för tråd %lld till db '%-.192s', användare '%-.48s', host '%-.64s'%-.64s (%-.64s)"
        ukr "Перервано з'єднання %lld до бази данних: '%-.192s' користувач: '%-.48s' хост: '%-.64s'%-.64s (%-.64s)"
ER_UNUSED_10
        eng "You should never see it"
        spa "Nunca lo debería vd de ver"
ER_FLUSH_MASTER_BINLOG_CLOSED  
        chi "Binlog 已关闭, 不能 RESET MASTER"
        eng "Binlog closed, cannot RESET MASTER"
        ger "Binlog geschlossen. Kann RESET MASTER nicht ausführen"
        jpn "バイナリログがクローズされています。RESET MASTER を実行できません。"
        por "Binlog fechado. Não pode fazer RESET MASTER"
        rus "Двоичный журнал обновления закрыт, невозможно выполнить RESET MASTER"
        serbian "Binarni log file zatvoren, ne mogu da izvršim komandu 'RESET MASTER'"
        spa "Binlog cerrado, no puedo hacer RESET MASTER"
        ukr "Реплікаційний лог закрито, не можу виконати RESET MASTER"
ER_INDEX_REBUILD  
        chi "重建 dumped table '%-.192s' 的索引失败"
        cze "Přebudování indexu dumpnuté tabulky '%-.192s' nebylo úspěšné"
        dan "Kunne ikke genopbygge indekset for den dumpede tabel '%-.192s'"
        eng "Failed rebuilding the index of  dumped table '%-.192s'"
        fre "La reconstruction de l'index de la table copiée '%-.192s' a échoué"
        ger "Neuerstellung des Index der Dump-Tabelle '%-.192s' fehlgeschlagen"
        greek "Failed rebuilding the index of dumped table '%-.192s'"
        hun "Failed rebuilding the index of dumped table '%-.192s'"
        ita "Fallita la ricostruzione dell'indice della tabella copiata '%-.192s'"
        jpn "ダンプ表 '%-.192s' の索引再構築に失敗しました。"
        nla "Gefaald tijdens heropbouw index van gedumpte tabel '%-.192s'"
        por "Falhou na reconstrução do índice da tabela 'dumped' '%-.192s'"
        rus "Ошибка перестройки индекса сохраненной таблицы '%-.192s'"
        serbian "Izgradnja indeksa dump-ovane tabele '%-.192s' nije uspela"
        spa "Fallo reconstruyendo el índice del volcado de la tabla '%-.192s'"
        ukr "Невдале відновлення індекса переданої таблиці '%-.192s'"
ER_MASTER  
        chi "Master错误:'%-.64s'"
        cze "Chyba masteru: '%-.64s'"
        dan "Fejl fra master: '%-.64s'"
        eng "Error from master: '%-.64s'"
        fre "Erreur reçue du maître: '%-.64s'"
        ger "Fehler vom Master: '%-.64s'"
        ita "Errore dal master: '%-.64s"
        jpn "マスターでエラーが発生: '%-.64s'"
        nla "Fout van master: '%-.64s'"
        por "Erro no 'master' '%-.64s'"
        rus "Ошибка от головного сервера: '%-.64s'"
        serbian "Greška iz glavnog servera '%-.64s' u klasteru"
        spa "Error del maestro (master): '%-.64s'"
        swe "Fel från master: '%-.64s'"
        ukr "Помилка від головного: '%-.64s'"
ER_MASTER_NET_READ 08S01 
        chi "读master时有网络错误"
        cze "Síťová chyba při čtení z masteru"
        dan "Netværksfejl ved læsning fra master"
        eng "Net error reading from master"
        fre "Erreur de lecture réseau reçue du maître"
        ger "Netzfehler beim Lesen vom Master"
        ita "Errore di rete durante la ricezione dal master"
        jpn "マスターからのデータ受信中のネットワークエラー"
        nla "Net fout tijdens lezen van master"
        por "Erro de rede lendo do 'master'"
        rus "Возникла ошибка чтения в процессе коммуникации с головным сервером"
        serbian "Greška u primanju mrežnih paketa sa glavnog servera u klasteru"
        spa "Error de red leyendo del maestro (master)"
        swe "Fick nätverksfel vid läsning från master"
        ukr "Мережева помилка читання від головного"
ER_MASTER_NET_WRITE 08S01 
        chi "写master时有网络错误"
        cze "Síťová chyba při zápisu na master"
        dan "Netværksfejl ved skrivning til master"
        eng "Net error writing to master"
        fre "Erreur d'écriture réseau reçue du maître"
        ger "Netzfehler beim Schreiben zum Master"
        ita "Errore di rete durante l'invio al master"
        jpn "マスターへのデータ送信中のネットワークエラー"
        nla "Net fout tijdens schrijven naar master"
        por "Erro de rede gravando no 'master'"
        rus "Возникла ошибка записи в процессе коммуникации с головным сервером"
        serbian "Greška u slanju mrežnih paketa na glavni server u klasteru"
        spa "Error de red grabando en maestro (master)"
        swe "Fick nätverksfel vid skrivning till master"
        ukr "Мережева помилка запису до головного"
ER_FT_MATCHING_KEY_NOT_FOUND  
        chi "找不到与列列表匹配的全文索引"
        cze "Žádný sloupec nemá vytvořen fulltextový index"
        dan "Kan ikke finde en FULLTEXT nøgle som svarer til kolonne listen"
        eng "Can't find FULLTEXT index matching the column list"
        est "Ei suutnud leida FULLTEXT indeksit, mis kattuks kasutatud tulpadega"
        fre "Impossible de trouver un index FULLTEXT correspondant à cette liste de colonnes"
        ger "Kann keinen FULLTEXT-Index finden, der der Feldliste entspricht"
        ita "Impossibile trovare un indice FULLTEXT che corrisponda all'elenco delle colonne"
        jpn "列リストに対応する全文索引(FULLTEXT)が見つかりません。"
        nla "Kan geen FULLTEXT index vinden passend bij de kolom lijst"
        por "Não pode encontrar um índice para o texto todo que combine com a lista de colunas"
        rus "Невозможно отыскать полнотекстовый (FULLTEXT) индекс, соответствующий списку столбцов"
        serbian "Ne mogu da pronađem 'FULLTEXT' indeks koli odgovara listi kolona"
        spa "No puedo encontrar índice FULLTEXT coincidente con la lista de columnas"
        swe "Hittar inte ett FULLTEXT-index i kolumnlistan"
        ukr "Не можу знайти FULLTEXT індекс, що відповідає переліку стовбців"
ER_LOCK_OR_ACTIVE_TRANSACTION  
        chi "无法执行给定的命令,因为表上有锁或有活动事务"
        cze "Nemohu provést zadaný příkaz, protože existují aktivní zamčené tabulky nebo aktivní transakce"
        dan "Kan ikke udføre den givne kommando fordi der findes aktive, låste tabeller eller fordi der udføres en transaktion"
        eng "Can't execute the given command because you have active locked tables or an active transaction"
        est "Ei suuda täita antud käsku kuna on aktiivseid lukke või käimasolev transaktsioon"
        fre "Impossible d'exécuter la commande car vous avez des tables verrouillées ou une transaction active"
        ger "Kann den angegebenen Befehl wegen einer aktiven Tabellensperre oder einer aktiven Transaktion nicht ausführen"
        ita "Impossibile eseguire il comando richiesto: tabelle sotto lock o transazione in atto"
        jpn "すでにアクティブな表ロックやトランザクションがあるため、コマンドを実行できません。"
        nla "Kan het gegeven commando niet uitvoeren, want u heeft actieve gelockte tabellen of een actieve transactie"
        por "Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma transação ativa"
        rus "Невозможно выполнить указанную команду, поскольку у вас присутствуют активно заблокированные таблица или открытая транзакция"
        serbian "Ne mogu da izvršim datu komandu zbog toga što su tabele zaključane ili je transakcija u toku"
        spa "No puedo ejecutar el comando dado porque tiene tablas activas bloqueadas o una transacción activa"
        swe "Kan inte utföra kommandot emedan du har en låst tabell eller an aktiv transaktion"
        ukr "Не можу виконати подану команду тому, що таблиця заблокована або виконується транзакція"
ER_UNKNOWN_SYSTEM_VARIABLE  
        chi "未知系统变量 '%-.*s'"
        cze "Neznámá systémová proměnná '%-.*s'"
        dan "Ukendt systemvariabel '%-.*s'"
        eng "Unknown system variable '%-.*s'"
        est "Tundmatu süsteemne muutuja '%-.*s'"
        fre "Variable système '%-.*s' inconnue"
        ger "Unbekannte Systemvariable '%-.*s'"
        hindi "अज्ञात सिस्टम वैरिएबल '%-.*s'"
        ita "Variabile di sistema '%-.*s' sconosciuta"
        jpn "'%-.*s' は不明なシステム変数です。"
        nla "Onbekende systeem variabele '%-.*s'"
        por "Variável de sistema '%-.*s' desconhecida"
        rus "Неизвестная системная переменная '%-.*s'"
        serbian "Nepoznata sistemska promenljiva '%-.*s'"
        spa "Variable de sistema '%-.*s' desconocida"
        swe "Okänd systemvariabel: '%-.*s'"
        ukr "Невідома системна змінна '%-.*s'"
ER_CRASHED_ON_USAGE  
        chi "表'%-.192s'标记为崩溃,应该修复"
        cze "Tabulka '%-.192s' je označena jako porušená a měla by být opravena"
        dan "Tabellen '%-.192s' er markeret med fejl og bør repareres"
        eng "Table '%-.192s' is marked as crashed and should be repaired"
        est "Tabel '%-.192s' on märgitud vigaseks ja tuleb parandada"
        fre "La table '%-.192s' est marquée 'crashed' et devrait être réparée"
        ger "Tabelle '%-.192s' ist als defekt markiert und sollte repariert werden"
        ita "La tabella '%-.192s' e` segnalata come corrotta e deve essere riparata"
        jpn "表 '%-.192s' は壊れています。修復が必要です。"
        nla "Tabel '%-.192s' staat als gecrashed gemarkeerd en dient te worden gerepareerd"
        por "Tabela '%-.192s' está marcada como danificada e deve ser reparada"
        rus "Таблица '%-.192s' помечена как испорченная и должна пройти проверку и ремонт"
        serbian "Tabela '%-.192s' je markirana kao oštećena i trebala bi biti popravljena"
        spa "La tabla '%-.192s' está marcada como estropeada y debe de ser reparada"
        swe "Tabell '%-.192s' är trasig och bör repareras med REPAIR TABLE"
        ukr "Таблицю '%-.192s' марковано як зіпсовану та її потрібно відновити"
ER_CRASHED_ON_REPAIR  
        chi "表 '%-.192s' 被标记为崩溃,上一次的修复(自动?)失败"
        cze "Tabulka '%-.192s' je označena jako porušená a poslední (automatická?) oprava se nezdařila"
        dan "Tabellen '%-.192s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede"
        eng "Table '%-.192s' is marked as crashed and last (automatic?) repair failed"
        est "Tabel '%-.192s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus"
        fre "La table '%-.192s' est marquée 'crashed' et le dernier 'repair' a échoué"
        ger "Tabelle '%-.192s' ist als defekt markiert und der letzte (automatische?) Reparaturversuch schlug fehl"
        ita "La tabella '%-.192s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita"
        jpn "表 '%-.192s' は壊れています。修復(自動?)にも失敗しています。"
        nla "Tabel '%-.192s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte"
        por "Tabela '%-.192s' está marcada como danificada e a última reparação (automática?) falhou"
        rus "Таблица '%-.192s' помечена как испорченная и последний (автоматический?) ремонт не был успешным"
        serbian "Tabela '%-.192s' je markirana kao oštećena, a zadnja (automatska?) popravka je bila neuspela"
        spa "La tabla '%-.192s' está marcada como estropeada y la última reparación (¿automática?) falló"
        swe "Tabell '%-.192s' är trasig och senast (automatiska?) reparation misslyckades"
        ukr "Таблицю '%-.192s' марковано як зіпсовану та останнє (автоматичне?) відновлення не вдалося"
ER_WARNING_NOT_COMPLETE_ROLLBACK  
        chi "某些非事务性更改的表无法回滚"
        dan "Advarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestilles"
        eng "Some non-transactional changed tables couldn't be rolled back"
        est "Hoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi kerida"
        fre "Attention: certaines tables ne supportant pas les transactions ont été changées et elles ne pourront pas être restituées"
        ger "Änderungen an einigen nicht transaktionalen Tabellen konnten nicht zurückgerollt werden"
        ita "Attenzione: Alcune delle modifiche alle tabelle non transazionali non possono essere ripristinate (roll back impossibile)"
        jpn "トランザクション対応ではない表への変更はロールバックされません。"
        nla "Waarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellen"
        por "Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)"
        rus "Внимание: по некоторым измененным нетранзакционным таблицам невозможно будет произвести откат транзакции"
        serbian "Upozorenje: Neke izmenjene tabele ne podržavaju komandu 'ROLLBACK'"
        spa "Algunas tablas no transaccionales ya cambiadas no puedieron ser retrocedidas (rolled back)"
        swe "Warning:  Några icke transaktionella tabeller kunde inte återställas vid ROLLBACK"
        ukr "Застереження: Деякі нетранзакційні зміни таблиць не можна буде повернути"
ER_TRANS_CACHE_FULL  
        chi "多语句事务需要超过 'max_binlog_cache_size' 字节的存储空间;增加这个 mariadbd 变量后再试一次"
        dan "Fler-udtryks transaktion krævede mere plads en 'max_binlog_cache_size' bytes. Forhøj værdien af denne variabel og prøv igen"
        eng "Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again"
        est "Mitme lausendiga transaktsioon nõudis rohkem ruumi kui lubatud 'max_binlog_cache_size' muutujaga. Suurenda muutuja väärtust ja proovi uuesti"
        fre "Cette transaction à commandes multiples nécessite plus de 'max_binlog_cache_size' octets de stockage, augmentez cette variable de mariadbd et réessayez"
        ger "Transaktionen, die aus mehreren Befehlen bestehen, benötigten mehr als 'max_binlog_cache_size' Bytes an Speicher. Btte vergrössern Sie diese Server-Variable versuchen Sie es noch einmal"
        ita "La transazione a comandi multipli (multi-statement) ha richiesto piu` di 'max_binlog_cache_size' bytes di disco: aumentare questa variabile di mariadbd e riprovare"
        jpn "複数ステートメントから成るトランザクションが 'max_binlog_cache_size' 以上の容量を必要としました。このシステム変数を増加して、再試行してください。"
        nla "Multi-statement transactie vereist meer dan 'max_binlog_cache_size' bytes opslag. Verhoog deze mariadbd variabele en probeer opnieuw"
        por "Transações multi-declaradas (multi-statement transactions) requeriram mais do que o valor limite (max_binlog_cache_size) de bytes para armazenagem. Aumente o valor desta variável do mariadbd e tente novamente"
        rus "Транзакции, включающей большое количество команд, потребовалось более чем 'max_binlog_cache_size' байт. Увеличьте эту переменную сервера mariadbd и попробуйте еще раз"
        spa "Transacción multi-sentencia requirió de más de 'max_binlog_cache_size' bytes de almacenamiento"
        swe "Transaktionen krävde mera än 'max_binlog_cache_size' minne. Öka denna mariadbd-variabel och försök på nytt"
        ukr "Транзакція з багатьма виразами вимагає більше ніж 'max_binlog_cache_size' байтів для зберігання. Збільште цю змінну mariadbd та спробуйте знову"
ER_SLAVE_MUST_STOP  
        chi "这个操作不能执行,因为你有个正在运行的 slave '%2$*1$s'; 先运行 STOP SLAVE '%2$*1$s' 后再试"
        dan "Denne handling kunne ikke udføres med kørende slave '%2$*1$s', brug først kommandoen STOP SLAVE '%2$*1$s'"
        eng "This operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' first"
        fre "Cette opération ne peut être réalisée avec un esclave '%2$*1$s' actif, faites STOP SLAVE '%2$*1$s' d'abord"
        ger "Diese Operation kann bei einem aktiven Slave '%2$*1$s' nicht durchgeführt werden. Bitte zuerst STOP SLAVE '%2$*1$s' ausführen"
        ita "Questa operazione non puo' essere eseguita con un database 'slave' '%2$*1$s' che gira, lanciare prima STOP SLAVE '%2$*1$s'"
        nla "Deze operatie kan niet worden uitgevoerd met een actieve slave '%2$*1$s', doe eerst STOP SLAVE '%2$*1$s'"
        por "Esta operação não pode ser realizada com um 'slave' '%2$*1$s' em execução. Execute STOP SLAVE '%2$*1$s' primeiro"
        rus "Эту операцию невозможно выполнить при работающем потоке подчиненного сервера %2$*1$s. Сначала выполните STOP SLAVE '%2$*1$s'"
        serbian "Ova operacija ne može biti izvršena dok je aktivan podređeni '%2$*1$s' server. Zadajte prvo komandu 'STOP SLAVE '%2$*1$s'' da zaustavite podređeni server"
        spa "Esta operación no puede ser realizada con el esclavo '%2$*1$s' en marcha; primero ejecute STOP SLAVE '%2$*1$s'"
        swe "Denna operation kan inte göras under replikering; Du har en aktiv förbindelse till '%2$*1$s'. Gör STOP SLAVE '%2$*1$s' först"
        ukr "Операція не може бути виконана з запущеним підлеглим '%2$*1$s', спочатку виконайте STOP SLAVE '%2$*1$s'"
ER_SLAVE_NOT_RUNNING  
        chi "这个操作需要一个正在运行的slave;配置从机并执行 START SLAVE"
        dan "Denne handling kræver en kørende slave. Konfigurer en slave og brug kommandoen START SLAVE"
        eng "This operation requires a running slave; configure slave and do START SLAVE"
        fre "Cette opération nécessite un esclave actif, configurez les esclaves et faites START SLAVE"
        ger "Diese Operation benötigt einen aktiven Slave. Bitte Slave konfigurieren und mittels START SLAVE aktivieren"
        ita "Questa operaione richiede un database 'slave', configurarlo ed eseguire START SLAVE"
        jpn "この処理は、稼働中のスレーブでなければ実行できません。スレーブの設定をしてSTART SLAVEコマンドを実行してください。"
        nla "Deze operatie vereist een actieve slave, configureer slave en doe dan START SLAVE"
        por "Esta operação requer um 'slave' em execução. Configure  o 'slave' e execute START SLAVE"
        rus "Для этой операции требуется работающий подчиненный сервер. Сначала выполните START SLAVE"
        serbian "Ova operacija zahteva da je aktivan podređeni server. Konfigurišite prvo podređeni server i onda izvršite komandu 'START SLAVE'"
        spa "Esta operación requiere de un esclavo funcionando; configure el esclavo y haga el START SLAVE"
        swe "Denna operation kan endast göras under replikering; Konfigurera slaven och gör START SLAVE"
        ukr "Операція вимагає запущеного підлеглого, зконфігуруйте підлеглого та виконайте START SLAVE"
ER_BAD_SLAVE  
        chi "服务器未配置为从站;修复配置文件或使用CHANGE MASTER TO"
        dan "Denne server er ikke konfigureret som slave. Ret in config-filen eller brug kommandoen CHANGE MASTER TO"
        eng "The server is not configured as slave; fix in config file or with CHANGE MASTER TO"
        fre "Le server n'est pas configuré comme un esclave, changez le fichier de configuration ou utilisez CHANGE MASTER TO"
        ger "Der Server ist nicht als Slave konfiguriert. Bitte in der Konfigurationsdatei oder mittels CHANGE MASTER TO beheben"
        ita "Il server non e' configurato come 'slave', correggere il file di configurazione cambiando CHANGE MASTER TO"
        jpn "このサーバーはスレーブとして設定されていません。コンフィグファイルかCHANGE MASTER TOコマンドで設定して下さい。"
        nla "De server is niet geconfigureerd als slave, fix in configuratie bestand of met CHANGE MASTER TO"
        por "O servidor não está configurado como 'slave'. Acerte o arquivo de configuração ou use CHANGE MASTER TO"
        rus "Этот сервер не настроен как подчиненный. Внесите исправления в конфигурационном файле или с помощью CHANGE MASTER TO"
        serbian "Server nije konfigurisan kao podređeni server, ispravite konfiguracioni file ili na njemu izvršite komandu 'CHANGE MASTER TO'"
        spa "El servidor no está configurado como esclavo; arréglelo en el fichero/archivo de configuración o con CHANGE MASTER TO"
        swe "Servern är inte konfigurerade som en replikationsslav. Ändra konfigurationsfilen eller gör CHANGE MASTER TO"
        ukr "Сервер не зконфігуровано як підлеглий, виправте це у файлі конфігурації або з CHANGE MASTER TO"
ER_MASTER_INFO  
        chi "无法初始化'%.*s'的master info structure;MariaDB错误日志中可以找到更多错误消息"
        eng "Could not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error log"
        fre "Impossible d'initialiser les structures d'information de maître '%.*s', vous trouverez des messages d'erreur supplémentaires dans le journal des erreurs de MariaDB"
        ger "Konnte Master-Info-Struktur '%.*s' nicht initialisieren. Weitere Fehlermeldungen können im MariaDB-Error-Log eingesehen werden"
        jpn "'master info '%.*s''構造体の初期化ができませんでした。MariaDBエラーログでエラーメッセージを確認してください。"
        serbian "Nisam mogao da inicijalizujem informacionu strukturu glavnog servera, proverite da li imam privilegije potrebne za pristup file-u 'master.info' '%.*s'"
        spa "No pude inicializar estructura info de maestro (master) para '%.*s'; se pueden ver más mensajes de error en el historial (log) de errores de MariaDB"
        swe "Kunde inte initialisera replikationsstrukturerna för '%.*s'. See MariaDB fel fil för mera information"
        ukr "Інформаційна структура з'єднання головного і підлеглого (master.info) для '%.*s' не може бути ініціалізована"
ER_SLAVE_THREAD
        chi "无法创建slave线程;检查系统资源"
        dan "Kunne ikke danne en slave-tråd; check systemressourcerne"
        eng "Could not create slave thread; check system resources"
        fre "Impossible de créer une tâche esclave, vérifiez les ressources système"
        ger "Konnte Slave-Thread nicht starten. Bitte System-Ressourcen überprüfen"
        ita "Impossibile creare il thread 'slave', controllare le risorse di sistema"
        jpn "スレーブスレッドを作成できません。システムリソースを確認してください。"
        nla "Kon slave thread niet aanmaken, controleer systeem resources"
        por "Não conseguiu criar 'thread' de 'slave'. Verifique os recursos do sistema"
        rus "Невозможно создать поток подчиненного сервера. Проверьте системные ресурсы"
        serbian "Nisam mogao da startujem thread za podređeni server, proverite sistemske resurse"
        spa "No puedo crear el hilo (thread) esclavo; verifique recursos del sistema"
        swe "Kunde inte starta en tråd för replikering"
        ukr "Не можу створити підлеглу гілку, перевірте системні ресурси"
ER_TOO_MANY_USER_CONNECTIONS 42000 
        chi "用户%-.64s已经拥有超过“max_user_conections”的活连接"
        dan "Brugeren %-.64s har allerede mere end 'max_user_connections' aktive forbindelser"
        eng "User %-.64s already has more than 'max_user_connections' active connections"
        est "Kasutajal %-.64s on juba rohkem ühendusi kui lubatud 'max_user_connections' muutujaga"
        fre "L'utilisateur %-.64s possède déjà plus de 'max_user_connections' connexions actives"
        ger "Benutzer '%-.64s' hat mehr als 'max_user_connections' aktive Verbindungen"
        hindi "यूज़र %-.64s के पहले से ही 'max_user_connections' से अधिक सक्रिय कनेक्शन्स हैं"
        ita "L'utente %-.64s ha gia' piu' di 'max_user_connections' connessioni attive"
        jpn "ユーザー '%-.64s' はすでに 'max_user_connections' 以上のアクティブな接続を行っています。"
        nla "Gebruiker %-.64s heeft reeds meer dan 'max_user_connections' actieve verbindingen"
        por "Usuário '%-.64s' já possui mais que o valor máximo de conexões (max_user_connections) ativas"
        rus "У пользователя %-.64s уже больше чем 'max_user_connections' активных соединений"
        serbian "Korisnik %-.64s već ima više aktivnih konekcija nego što je to određeno 'max_user_connections' promenljivom"
        spa "El usuario %-.64s ya tiene más de 'max_user_connections' conexiones activas"
        swe "Användare '%-.64s' har redan 'max_user_connections' aktiva inloggningar"
        ukr "Користувач %-.64s вже має більше ніж 'max_user_connections' активних з'єднань"
ER_SET_CONSTANTS_ONLY  
        chi "您只能在此语句中使用常量表达式"
        dan "Du må kun bruge konstantudtryk med SET"
        eng "You may only use constant expressions in this statement"
        est "Ainult konstantsed suurused on lubatud SET klauslis"
        fre "Seules les expressions constantes sont autorisées avec SET"
        ger "Bei diesem Befehl dürfen nur konstante Ausdrücke verwendet werden"
        hindi "इस स्टेटमेंट में आप केवल CONSTANT EXPRESSIONS का उपयोग कर सकते हैं"
        ita "Si possono usare solo espressioni costanti con SET"
        jpn "SET処理が失敗しました。"
        nla "U mag alleen constante expressies gebruiken bij SET"
        por "Você pode usar apenas expressões constantes com SET"
        rus "С этой командой вы можете использовать только константные выражения"
        serbian "Možete upotrebiti samo konstantan iskaz sa komandom 'SET'"
        spa "Sólo puede usar expresiones constantes en esta sentencia"
        swe "Man kan endast använda konstantuttryck med SET"
        ukr "Можна використовувати лише вирази зі сталими у SET"
ER_LOCK_WAIT_TIMEOUT  
        chi "锁等待超时;尝试重新启动事务"
        dan "Lock wait timeout overskredet"
        eng "Lock wait timeout exceeded; try restarting transaction"
        est "Kontrollaeg ületatud luku järel ootamisel; Proovi transaktsiooni otsast alata"
        fre "Timeout sur l'obtention du verrou"
        ger "Beim Warten auf eine Sperre wurde die zulässige Wartezeit überschritten. Bitte versuchen Sie, die Transaktion neu zu starten"
        ita "E' scaduto il timeout per l'attesa del lock"
        jpn "ロック待ちがタイムアウトしました。トランザクションを再試行してください。"
        nla "Lock wacht tijd overschreden"
        por "Tempo de espera (timeout) de travamento excedido. Tente reiniciar a transação"
        rus "Таймаут ожидания блокировки истек; попробуйте перезапустить транзакцию"
        serbian "Vremenski limit za zaključavanje tabele je istekao; Probajte da ponovo startujete transakciju"
        spa "Tiempo de espera de bloqueo excedido; intente rearrancar la transacción"
        swe "Fick inte ett lås i tid ; Försök att starta om transaktionen"
        ukr "Затримку очікування блокування вичерпано"
ER_LOCK_TABLE_FULL  
        chi "锁的总数超过锁定表大小"
        dan "Det totale antal låse overstiger størrelsen på låse-tabellen"
        eng "The total number of locks exceeds the lock table size"
        est "Lukkude koguarv ületab lukutabeli suuruse"
        fre "Le nombre total de verrou dépasse la taille de la table des verrous"
        ger "Die Gesamtzahl der Sperren überschreitet die Größe der Sperrtabelle"
        hindi "लॉक्स की कुल संख्या लॉक टेबल के साइज से अधिक है"
        ita "Il numero totale di lock e' maggiore della grandezza della tabella di lock"
        jpn "ロックの数が多すぎます。"
        nla "Het totale aantal locks overschrijdt de lock tabel grootte"
        por "O número total de travamentos excede o tamanho da tabela de travamentos"
        rus "Общее количество блокировок превысило размеры таблицы блокировок"
        serbian "Broj totalnih zaključavanja tabele premašuje veličinu tabele zaključavanja"
        spa "El número total de bloqueos excede el tamaño de bloqueo de la tabla"
        swe "Antal lås överskrider antalet reserverade lås"
        ukr "Загальна кількість блокувань перевищила розмір блокувань для таблиці"
ER_READ_ONLY_TRANSACTION 25000 
        chi "在READ UNCOMMITTED事务期间无法获取更新锁定"
        dan "Update lås kan ikke opnås under en READ UNCOMMITTED transaktion"
        eng "Update locks cannot be acquired during a READ UNCOMMITTED transaction"
        est "Uuenduslukke ei saa kasutada READ UNCOMMITTED transaktsiooni käigus"
        fre "Un verrou en update ne peut être acquit pendant une transaction READ UNCOMMITTED"
        ger "Während einer READ-UNCOMMITTED-Transaktion können keine UPDATE-Sperren angefordert werden"
        ita "I lock di aggiornamento non possono essere acquisiti durante una transazione 'READ UNCOMMITTED'"
        jpn "読み込み専用トランザクションです。"
        nla "Update locks kunnen niet worden verkregen tijdens een READ UNCOMMITTED transactie"
        por "Travamentos de atualização não podem ser obtidos durante uma transação de tipo READ UNCOMMITTED"
        rus "Блокировки обновлений нельзя получить в процессе чтения не принятой (в режиме READ UNCOMMITTED) транзакции"
        serbian "Zaključavanja izmena ne mogu biti realizovana sve dok traje 'READ UNCOMMITTED' transakcija"
        spa "No se pueden adquirir bloqueos de actualización durante una transacción READ UNCOMMITTED"
        swe "Updateringslås kan inte göras när man använder READ UNCOMMITTED"
        ukr "Оновити блокування не можливо на протязі транзакції READ UNCOMMITTED"
ER_DROP_DB_WITH_READ_LOCK  
        chi "线程持有全局读锁时,不允许删除数据库"
        dan "DROP DATABASE er ikke tilladt mens en tråd holder på globalt read lock"
        eng "DROP DATABASE not allowed while thread is holding global read lock"
        est "DROP DATABASE ei ole lubatud kui lõim omab globaalset READ lukku"
        fre "DROP DATABASE n'est pas autorisée pendant qu'une tâche possède un verrou global en lecture"
        ger "DROP DATABASE ist nicht erlaubt, solange der Thread eine globale Lesesperre hält"
        ita "DROP DATABASE non e' permesso mentre il thread ha un lock globale di lettura"
        jpn "グローバルリードロックを保持している間は、DROP DATABASE を実行できません。"
        nla "DROP DATABASE niet toegestaan terwijl thread een globale 'read lock' bezit"
        por "DROP DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura"
        rus "Не допускается DROP DATABASE, пока поток держит глобальную блокировку чтения"
        serbian "Komanda 'DROP DATABASE' nije dozvoljena dok thread globalno zaključava čitanje podataka"
        spa "DROP DATABASE no permitido mientras un hilo (thread) está ejerciendo un bloqueo de lectura global"
        swe "DROP DATABASE är inte tillåtet när man har ett globalt läslås"
        ukr "DROP DATABASE не дозволено доки гілка перебуває під загальним блокуванням читання"
ER_CREATE_DB_WITH_READ_LOCK  
        chi "线程持有全局读锁时,不允许创建数据库"
        dan "CREATE DATABASE er ikke tilladt mens en tråd holder på globalt read lock"
        eng "CREATE DATABASE not allowed while thread is holding global read lock"
        est "CREATE DATABASE ei ole lubatud kui lõim omab globaalset READ lukku"
        fre "CREATE DATABASE n'est pas autorisée pendant qu'une tâche possède un verrou global en lecture"
        ger "CREATE DATABASE ist nicht erlaubt, solange der Thread eine globale Lesesperre hält"
        ita "CREATE DATABASE non e' permesso mentre il thread ha un lock globale di lettura"
        jpn "グローバルリードロックを保持している間は、CREATE DATABASE を実行できません。"
        nla "CREATE DATABASE niet toegestaan terwijl thread een globale 'read lock' bezit"
        por "CREATE DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura"
        rus "Не допускается CREATE DATABASE, пока поток держит глобальную блокировку чтения"
        serbian "Komanda 'CREATE DATABASE' nije dozvoljena dok thread globalno zaključava čitanje podataka"
        spa "CREATE DATABASE no permitido mientras un hilo (thread) está manteniendo un bloqueo de lectura global"
        swe "CREATE DATABASE är inte tillåtet när man har ett globalt läslås"
        ukr "CREATE DATABASE не дозволено доки гілка перебуває під загальним блокуванням читання"
ER_WRONG_ARGUMENTS  
        chi "%s的参数不正确"
        eng "Incorrect arguments to %s"
        est "Vigased parameetrid %s-le"
        fre "Mauvais arguments à %s"
        ger "Falsche Argumente für %s"
        hindi "%s को गलत आर्ग्यूमेंट्स"
        ita "Argomenti errati a %s"
        jpn "%s の引数が不正です"
        nla "Foutieve parameters voor %s"
        por "Argumentos errados para %s"
        rus "Неверные параметры для %s"
        serbian "Pogrešni argumenti prosleđeni na %s"
        spa "Argumentos incorrectos para %s"
        swe "Felaktiga argument till %s"
        ukr "Хибний аргумент для %s"
ER_NO_PERMISSION_TO_CREATE_USER 42000 
        chi "'%s'@'%s'不允许创建新用户"
        eng "'%s'@'%s' is not allowed to create new users"
        est "Kasutajal '%s'@'%s' ei ole lubatud luua uusi kasutajaid"
        fre "'%s'@'%s' n'est pas autorisé à créer de nouveaux utilisateurs"
        ger "'%s'@'%s' ist nicht berechtigt, neue Benutzer hinzuzufügen"
        hindi "'%s'@'%s' को नए यूज़र्स बनाने की अनुमति नहीं है"
        ita "A '%s'@'%s' non e' permesso creare nuovi utenti"
        nla "'%s'@'%s' mag geen nieuwe gebruikers creeren"
        por "Não é permitido a '%s'@'%s' criar novos usuários"
        rus "'%s'@'%s' не разрешается создавать новых пользователей"
        serbian "Korisniku '%s'@'%s' nije dozvoljeno da kreira nove korisnike"
        spa "'%s'@'%s' no está permitido para crear nuevos usuarios"
        swe "'%s'@'%s' har inte rättighet att skapa nya användare"
        ukr "Користувачу '%s'@'%s' не дозволено створювати нових користувачів"
ER_UNION_TABLES_IN_DIFFERENT_DIR  
        chi "表定义不正确;所有合并表必须在同一数据库中"
        eng "Incorrect table definition; all MERGE tables must be in the same database"
        est "Vigane tabelimääratlus; kõik MERGE tabeli liikmed peavad asuma samas andmebaasis"
        fre "Définition de table incorrecte; toutes les tables MERGE doivent être dans la même base de donnée"
        ger "Falsche Tabellendefinition. Alle MERGE-Tabellen müssen sich in derselben Datenbank befinden"
        ita "Definizione della tabella errata; tutte le tabelle di tipo MERGE devono essere nello stesso database"
        jpn "不正な表定義です。MERGE表の構成表はすべて同じデータベース内になければなりません。"
        nla "Incorrecte tabel definitie; alle MERGE tabellen moeten tot dezelfde database behoren"
        por "Definição incorreta da tabela. Todas as tabelas contidas na junção devem estar no mesmo banco de dados"
        rus "Неверное определение таблицы; Все таблицы в MERGE должны принадлежать одной и той же базе данных"
        serbian "Pogrešna definicija tabele; sve 'MERGE' tabele moraju biti u istoj bazi podataka"
        spa "Definición incorrecta de la tabla; todas las tablas MERGE deben de estar en la misma base de datos"
        swe "Felaktig tabelldefinition; alla tabeller i en MERGE-tabell måste vara i samma databas"
        ukr "Хибне визначення таблиці; всі MERGE-таблиці повинні належити до однієї бази ланних."
ER_LOCK_DEADLOCK 40001 
        chi "试图锁定时发现僵局;尝试重新启动事务"
        eng "Deadlock found when trying to get lock; try restarting transaction"
        est "Lukustamisel tekkis tupik (deadlock); alusta transaktsiooni otsast"
        fre "Deadlock découvert en essayant d'obtenir les verrous : essayez de redémarrer la transaction"
        ger "Beim Versuch, eine Sperre anzufordern, ist ein Deadlock aufgetreten. Versuchen Sie, die Transaktion neu zu starten"
        ita "Trovato deadlock durante il lock; Provare a far ripartire la transazione"
        jpn "ロック取得中にデッドロックが検出されました。トランザクションを再試行してください。"
        nla "Deadlock gevonden tijdens lock-aanvraag poging; Probeer herstart van de transactie"
        por "Encontrado um travamento fatal (deadlock) quando tentava obter uma trava. Tente reiniciar a transação"
        rus "Возникла тупиковая ситуация в процессе получения блокировки; Попробуйте перезапустить транзакцию"
        serbian "Unakrsno zaključavanje pronađeno kada sam pokušao da dobijem pravo na zaključavanje; Probajte da restartujete transakciju"
        spa "Encontrado estancamiento (deadlock) al intentar obtener el bloqueo; intente volver a comenzar la transacción"
        swe "Fick 'DEADLOCK' vid låsförsök av block/rad. Försök att starta om transaktionen"
        ukr "Взаємне блокування знайдено під час спроби отримати блокування; спробуйте перезапустити транзакцію."
ER_TABLE_CANT_HANDLE_FT  
        chi "存储引擎%s不支持fulltext索引"
        eng "The storage engine %s doesn't support FULLTEXT indexes"
        est "Antud tabelitüüp (%s) ei toeta FULLTEXT indekseid"
        fre "Le type de table utilisé (%s) ne supporte pas les index FULLTEXT"
        ger "Der verwendete Tabellentyp (%s) unterstützt keine FULLTEXT-Indizes"
        hindi "स्टोरेज इंजन '%s' FULLTEXT इन्डेक्सेस को सपोर्ट नहीं करता"
        ita "La tabella usata (%s) non supporta gli indici FULLTEXT"
        nla "Het gebruikte tabel type (%s) ondersteund geen FULLTEXT indexen"
        por "O tipo de tabela utilizado (%s) não suporta índices de texto completo (fulltext indexes)"
        rus "Используемый тип таблиц (%s) не поддерживает полнотекстовых индексов"
        serbian "Upotrebljeni tip tabele (%s) ne podržava 'FULLTEXT' indekse"
        spa "El motor de almacenaje %s no soporta índices FULLTEXT"
        swe "Tabelltypen (%s) har inte hantering av FULLTEXT-index"
        ukr "Використаний тип таблиці (%s) не підтримує FULLTEXT індексів"
ER_CANNOT_ADD_FOREIGN
        chi "不能为`%s`添加外键约束"
        eng "Cannot add foreign key constraint for `%s`"
        fre "Impossible d'ajouter des contraintes d'index externe à `%s`"
        ger "Fremdschlüssel-Beschränkung kann nicht hinzugefügt werden für `%s`"
        ita "Impossibile aggiungere il vincolo di integrita' referenziale (foreign key constraint) a `%s`"
        jpn "`%s` 外部キー制約を追加できません。"
        nla "Kan foreign key beperking niet toevoegen vor `%s`"
        por "Não pode acrescentar uma restrição de chave estrangeira para `%s`"
        rus "Невозможно добавить ограничения внешнего ключа для `%s`"
        serbian "Ne mogu da dodam proveru spoljnog ključa na `%s`"
        spa "No puedo añadir restricción de clave foránea para `%s`"
        swe "Kan inte lägga till 'FOREIGN KEY constraint' för `%s`'"
        ukr "Не можу додати обмеження зовнішнього ключа Ha `%s`"
ER_NO_REFERENCED_ROW 23000 
        chi "无法添加或更新子行:外键约束失败"
        eng "Cannot add or update a child row: a foreign key constraint fails"
        fre "Impossible d'ajouter un enregistrement fils : une constrainte externe l'empèche"
        ger "Hinzufügen oder Aktualisieren eines Kind-Datensatzes schlug aufgrund einer Fremdschlüssel-Beschränkung fehl"
        greek "Cannot add a child row: a foreign key constraint fails"
        hun "Cannot add a child row: a foreign key constraint fails"
        ita "Impossibile aggiungere la riga: un vincolo d'integrita' referenziale non e' soddisfatto"
        jpn "親キーがありません。外部キー制約違反です。"
        nla "Kan onderliggende rij niet toevoegen: foreign key beperking gefaald"
        norwegian-ny "Cannot add a child row: a foreign key constraint fails"
        por "Não pode acrescentar uma linha filha: uma restrição de chave estrangeira falhou"
        rus "Невозможно добавить или обновить дочернюю строку: проверка ограничений внешнего ключа не выполняется"
        spa "No puedo añadir o actualizar una fila hija: ha fallado una restrición de clave foránea"
        swe "FOREIGN KEY-konflikt:  Kan inte skriva barn"
        ukr "Не вдається додати або оновити дочірній рядок: невдала перевірка обмеження зовнішнього ключа"
ER_ROW_IS_REFERENCED 23000 
        chi "无法删除或更新父行:外键约束失败"
        eng "Cannot delete or update a parent row: a foreign key constraint fails"
        fre "Impossible de supprimer un enregistrement père : une constrainte externe l'empèche"
        ger "Löschen oder Aktualisieren eines Eltern-Datensatzes schlug aufgrund einer Fremdschlüssel-Beschränkung fehl"
        greek "Cannot delete a parent row: a foreign key constraint fails"
        hun "Cannot delete a parent row: a foreign key constraint fails"
        ita "Impossibile cancellare la riga: un vincolo d'integrita' referenziale non e' soddisfatto"
        jpn "子レコードがあります。外部キー制約違反です。"
        por "Não pode apagar uma linha pai: uma restrição de chave estrangeira falhou"
        rus "Невозможно удалить или обновить родительскую строку: проверка ограничений внешнего ключа не выполняется"
        serbian "Ne mogu da izbrišem roditeljski slog: provera spoljnog ključa je neuspela"
        spa "No puedo borrar o actualizar una fila padre: ha fallado una restrición de clave foránea"
        swe "FOREIGN KEY-konflikt:  Kan inte radera fader"
ER_CONNECT_TO_MASTER 08S01 
        chi "连接master时出错:%-.128s"
        eng "Error connecting to master: %-.128s"
        ger "Fehler bei der Verbindung zum Master: %-.128s"
        ita "Errore durante la connessione al master: %-.128s"
        jpn "マスターへの接続エラー: %-.128s"
        nla "Fout bij opbouwen verbinding naar master: %-.128s"
        por "Erro conectando com o master: %-.128s"
        rus "Ошибка соединения с головным сервером: %-.128s"
        spa "Error conectando al maestro (master): %-.128s"
        swe "Fick fel vid anslutning till master: %-.128s"
ER_QUERY_ON_MASTER  
        chi "在Master上运行查询时出错:%-.128s"
        eng "Error running query on master: %-.128s"
        ger "Beim Ausführen einer Abfrage auf dem Master trat ein Fehler auf: %-.128s"
        ita "Errore eseguendo una query sul master: %-.128s"
        jpn "マスターでのクエリ実行エラー: %-.128s"
        nla "Fout bij uitvoeren query op master: %-.128s"
        por "Erro rodando consulta no master: %-.128s"
        rus "Ошибка выполнения запроса на головном сервере: %-.128s"
        spa "Error ejecutando consulta (query) en maestro (master): %-.128s"
        swe "Fick fel vid utförande av command på mastern: %-.128s"
ER_ERROR_WHEN_EXECUTING_COMMAND  
        chi "执行命令%s时出错:%-.128s"
        eng "Error when executing command %s: %-.128s"
        est "Viga käsu %s täitmisel: %-.128s"
        ger "Fehler beim Ausführen des Befehls %s: %-.128s"
        ita "Errore durante l'esecuzione del comando %s: %-.128s"
        jpn "%s コマンドの実行エラー: %-.128s"
        nla "Fout tijdens uitvoeren van commando %s: %-.128s"
        por "Erro quando executando comando %s: %-.128s"
        rus "Ошибка при выполнении команды %s: %-.128s"
        serbian "Greška pri izvršavanju komande %s: %-.128s"
        spa "Error al ejecutar comando %s: %-.128s"
        swe "Fick fel vid utförande av %s: %-.128s"
ER_WRONG_USAGE  
        chi "%s和%s使用不正确"
        eng "Incorrect usage of %s and %s"
        est "Vigane %s ja %s kasutus"
        ger "Falsche Verwendung von %s und %s"
        ita "Uso errato di %s e %s"
        jpn "%s の %s に関する不正な使用法です。"
        nla "Foutief gebruik van %s en %s"
        por "Uso errado de %s e %s"
        rus "Неверное использование %s и %s"
        serbian "Pogrešna upotreba %s i %s"
        spa "Uso incorrecto de %s y %s"
        swe "Felaktig använding av %s and %s"
        ukr "Wrong usage of %s and %s"
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 21000 
        chi "使用的SELECT语句具有不同数量的列"
        eng "The used SELECT statements have a different number of columns"
        est "Tulpade arv kasutatud SELECT lausetes ei kattu"
        ger "Die verwendeten SELECT-Befehle liefern unterschiedliche Anzahlen von Feldern zurück"
        ita "La SELECT utilizzata ha un numero di colonne differente"
        jpn "使用のSELECT文が返す列数が違います。"
        nla "De gebruikte SELECT commando's hebben een verschillend aantal kolommen"
        por "Os comandos SELECT usados têm diferente número de colunas"
        rus "Использованные операторы выборки (SELECT) дают разное количество столбцов"
        serbian "Upotrebljene 'SELECT' komande adresiraju različit broj kolona"
        spa "Las sentencias SELECT usadas tienen un número diferente de columnas"
        swe "SELECT-kommandona har olika antal kolumner"
ER_CANT_UPDATE_WITH_READLOCK  
        chi "无法执行查询,因为您有冲突的读锁"
        eng "Can't execute the query because you have a conflicting read lock"
        est "Ei suuda täita päringut konfliktse luku tõttu"
        ger "Augrund eines READ-LOCK-Konflikts kann die Abfrage nicht ausgeführt werden"
        ita "Impossibile eseguire la query perche' c'e' un conflitto con in lock di lettura"
        jpn "競合するリードロックを保持しているので、クエリを実行できません。"
        nla "Kan de query niet uitvoeren vanwege een conflicterende read lock"
        por "Não posso executar a consulta porque você tem um conflito de travamento de leitura"
        rus "Невозможно исполнить запрос, поскольку у вас установлены конфликтующие блокировки чтения"
        serbian "Ne mogu da izvršim upit zbog toga što imate zaključavanja čitanja podataka u konfliktu"
        spa "No puedo ejecutar la consulta (query) porque vd tiene un conflicto de bloqueo de lectura"
        swe "Kan inte utföra kommandot emedan du har ett READ-lås"
ER_MIXING_NOT_ALLOWED  
        chi "事务和非事务表的混合被禁用"
        eng "Mixing of transactional and non-transactional tables is disabled"
        est "Transaktsioone toetavate ning mittetoetavate tabelite kooskasutamine ei ole lubatud"
        ger "Die gleichzeitige Verwendung von Tabellen mit und ohne Transaktionsunterstützung ist deaktiviert"
        ita "E' disabilitata la possibilita' di mischiare tabelle transazionali e non-transazionali"
        jpn "トランザクション対応の表と非対応の表の同時使用は無効化されています。"
        nla "Het combineren van transactionele en niet-transactionele tabellen is uitgeschakeld"
        por "Mistura de tabelas transacional e não-transacional está desabilitada"
        rus "Использование транзакционных таблиц наряду с нетранзакционными запрещено"
        serbian "Mešanje tabela koje podržavaju transakcije i onih koje ne podržavaju transakcije je isključeno"
        spa "Desactivada la mezcla de tablas transaccionales y no transaccionales"
        swe "Blandning av transaktionella och icke-transaktionella tabeller är inaktiverat"
ER_DUP_ARGUMENT  
        chi "选项'%s'在语句中使用两次"
        eng "Option '%s' used twice in statement"
        est "Määrangut '%s' on lauses kasutatud topelt"
        ger "Option '%s' wird im Befehl zweimal verwendet"
        ita "L'opzione '%s' e' stata usata due volte nel comando"
        jpn "オプション '%s' が2度使用されています。"
        nla "Optie '%s' tweemaal gebruikt in opdracht"
        por "Opção '%s' usada duas vezes no comando"
        rus "Опция '%s' дважды использована в выражении"
        spa "Opción '%s' usada dos veces en la sentencia"
        swe "Option '%s' användes två gånger"
ER_USER_LIMIT_REACHED 42000 
        chi "用户'%-.64s'已超过'%s'资源(当前值:%ld)"
        eng "User '%-.64s' has exceeded the '%s' resource (current value: %ld)"
        ger "Benutzer '%-.64s' hat die Ressourcenbeschränkung '%s' überschritten (aktueller Wert: %ld)"
        ita "L'utente '%-.64s' ha ecceduto la risorsa '%s' (valore corrente: %ld)"
        jpn "ユーザー '%-.64s' はリソースの上限 '%s' に達しました。(現在値: %ld)"
        nla "Gebruiker '%-.64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)"
        por "Usuário '%-.64s' tem excedido o '%s' recurso (atual valor: %ld)"
        rus "Пользователь '%-.64s' превысил использование ресурса '%s' (текущее значение: %ld)"
        spa "El usuario '%-.64s' ha excedido el recurso '%s' (valor actual: %ld)"
        swe "Användare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)"
ER_SPECIFIC_ACCESS_DENIED_ERROR 42000 
        chi "拒绝访问;您需要(至少一个)%-.128s特权用于此操作"
        eng "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation"
        ger "Kein Zugriff. Hierfür wird die Berechtigung %-.128s benötigt"
        ita "Accesso non consentito. Serve il privilegio %-.128s per questa operazione"
        jpn "アクセスは拒否されました。この操作には %-.128s 権限が(複数の場合はどれか1つ)必要です。"
        nla "Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie"
        por "Acesso negado. Você precisa o privilégio %-.128s para essa operação"
        rus "В доступе отказано. Вам нужны привилегии %-.128s для этой операции"
        spa "Acceso denegado. Usted necesita (al menos un(os)) privilegio(s) %-.128s para esta operación"
        swe "Du har inte privlegiet '%-.128s' som behövs för denna operation"
        ukr "Access denied. You need the %-.128s privilege for this operation"
ER_LOCAL_VARIABLE  
        chi "变量'%-.64s'是一个SESSION变量,不能与Set Global一起使用"
        eng "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL"
        ger "Variable '%-.64s' ist eine lokale Variable und kann nicht mit SET GLOBAL verändert werden"
        ita "La variabile '%-.64s' e' una variabile locale ( SESSION ) e non puo' essere cambiata usando SET GLOBAL"
        jpn "変数 '%-.64s' はセッション変数です。SET GLOBALでは使用できません。"
        nla "Variabele '%-.64s' is SESSION en kan niet worden gebruikt met SET GLOBAL"
        por "Variável '%-.64s' é uma SESSION variável e não pode ser usada com SET GLOBAL"
        rus "Переменная '%-.64s' является потоковой (SESSION) переменной и не может быть изменена с помощью SET GLOBAL"
        spa "La variable '%-.64s' es una variable de SESSION y no puede ser usada con SET GLOBAL"
        swe "Variabel '%-.64s' är en SESSION variabel och kan inte ändrad med SET GLOBAL"
ER_GLOBAL_VARIABLE  
        chi "变量'%-.64s'是全局变量,应该用SET GLOBAL设置"
        eng "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL"
        ger "Variable '%-.64s' ist eine globale Variable und muss mit SET GLOBAL verändert werden"
        ita "La variabile '%-.64s' e' una variabile globale ( GLOBAL ) e deve essere cambiata usando SET GLOBAL"
        jpn "変数 '%-.64s' はグローバル変数です。SET GLOBALを使用してください。"
        nla "Variabele '%-.64s' is GLOBAL en dient te worden gewijzigd met SET GLOBAL"
        por "Variável '%-.64s' é uma GLOBAL variável e deve ser configurada com SET GLOBAL"
        rus "Переменная '%-.64s' является глобальной (GLOBAL) переменной, и ее следует изменять с помощью SET GLOBAL"
        spa "La variable '%-.64s' es una variable GLOBAL y debería de ser configurada con SET GLOBAL"
        swe "Variabel '%-.64s' är en GLOBAL variabel och bör sättas med SET GLOBAL"
ER_NO_DEFAULT 42000 
        chi "变量'%-.64s'没有默认值"
        eng "Variable '%-.64s' doesn't have a default value"
        ger "Variable '%-.64s' hat keinen Vorgabewert"
        ita "La variabile '%-.64s' non ha un valore di default"
        jpn "変数 '%-.64s' にはデフォルト値がありません。"
        nla "Variabele '%-.64s' heeft geen standaard waarde"
        por "Variável '%-.64s' não tem um valor padrão"
        rus "Переменная '%-.64s' не имеет значения по умолчанию"
        spa "La variable '%-.64s' no tiene un valor por defecto"
        swe "Variabel '%-.64s' har inte ett DEFAULT-värde"
ER_WRONG_VALUE_FOR_VAR 42000 
        chi "变量'%-.64s'无法设置为'%-.200T'的值"
        eng "Variable '%-.64s' can't be set to the value of '%-.200T'"
        ger "Variable '%-.64s' kann nicht auf '%-.200T' gesetzt werden"
        ita "Alla variabile '%-.64s' non puo' essere assegato il valore '%-.200T'"
        jpn "変数 '%-.64s' に値 '%-.200T' を設定できません。"
        nla "Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.200T'"
        por "Variável '%-.64s' não pode ser configurada para o valor de '%-.200T'"
        rus "Переменная '%-.64s' не может быть установлена в значение '%-.200T'"
        spa "La variable '%-.64s' no puede ser configurada para el valor de '%-.200T'"
        swe "Variabel '%-.64s' kan inte sättas till '%-.200T'"
ER_WRONG_TYPE_FOR_VAR 42000 
        chi "变量'%-.64s'的参数类型不正确"
        eng "Incorrect argument type to variable '%-.64s'"
        ger "Falscher Argumenttyp für Variable '%-.64s'"
        ita "Tipo di valore errato per la variabile '%-.64s'"
        jpn "変数 '%-.64s' への値の型が不正です。"
        nla "Foutief argumenttype voor variabele '%-.64s'"
        por "Tipo errado de argumento para variável '%-.64s'"
        rus "Неверный тип аргумента для переменной '%-.64s'"
        spa "Tipo de argumento incorrecto para variable '%-.64s'"
        swe "Fel typ av argument till variabel '%-.64s'"
ER_VAR_CANT_BE_READ  
        chi "变量'%-.64s'只能设置,不能读"
        eng "Variable '%-.64s' can only be set, not read"
        ger "Variable '%-.64s' kann nur verändert, nicht gelesen werden"
        ita "Alla variabile '%-.64s' e' di sola scrittura quindi puo' essere solo assegnato un valore, non letto"
        jpn "変数 '%-.64s' は書き込み専用です。読み込みはできません。"
        nla "Variabele '%-.64s' kan alleen worden gewijzigd, niet gelezen"
        por "Variável '%-.64s' somente pode ser configurada, não lida"
        rus "Переменная '%-.64s' может быть только установлена, но не считана"
        spa "La variable '%-.64s' solamente puede ser configurada, no leída"
        swe "Variabeln '%-.64s' kan endast sättas, inte läsas"
ER_CANT_USE_OPTION_HERE 42000 
        chi "'%s'的使用/放置不正确"
        eng "Incorrect usage/placement of '%s'"
        ger "Falsche Verwendung oder Platzierung von '%s'"
        ita "Uso/posizione di '%s' sbagliato"
        jpn "'%s' の使用法または場所が不正です。"
        nla "Foutieve toepassing/plaatsing van '%s'"
        por "Errado uso/colocação de '%s'"
        rus "Неверное использование или в неверном месте указан '%s'"
        spa "Incorrecto uso/colocación de '%s'"
        swe "Fel använding/placering av '%s'"
ER_NOT_SUPPORTED_YET 42000 
        chi "此版本的MariaDB尚未支持'%s'"
        eng "This version of MariaDB doesn't yet support '%s'"
        ger "Diese MariaDB-Version unterstützt '%s' nicht"
        ita "Questa versione di MariaDB non supporta ancora '%s'"
        jpn "このバージョンのMariaDBでは、まだ '%s' を利用できません。"
        nla "Deze versie van MariaDB ondersteunt nog geen '%s'"
        por "Esta versão de MariaDB não suporta ainda '%s'"
        rus "Эта версия MariaDB пока еще не поддерживает '%s'"
        spa "Esta versión de MariaDB no soporta todavía '%s'"
        swe "Denna version av MariaDB kan ännu inte utföra '%s'"
ER_MASTER_FATAL_ERROR_READING_BINLOG  
        chi "从二进制日志读取数据时,从master遇到致命错误%d:'%-.320s'"
        eng "Got fatal error %d from master when reading data from binary log: '%-.320s'"
        ger "Schwerer Fehler %d: '%-.320s vom Master beim Lesen des binären Logs"
        ita "Errore fatale %d: '%-.320s' dal master leggendo i dati dal log binario"
        jpn "致命的なエラー %d: '%-.320s' がマスターでバイナリログ読み込み中に発生しました。"
        nla "Kreeg fatale fout %d: '%-.320s' van master tijdens lezen van data uit binaire log"
        por "Obteve fatal erro %d: '%-.320s' do master quando lendo dados do binary log"
        rus "Получена неисправимая ошибка %d: '%-.320s' от головного сервера в процессе выборки данных из двоичного журнала"
        spa "Obtenido error fatal %d del maestro (master) al leer datos del historial (log) binario: '%-.320s'"
        swe "Fick fatalt fel %d: '%-.320s' från master vid läsning av binärloggen"
ER_SLAVE_IGNORED_TABLE  
        chi "由于复制replicate-*-table规则,Slave SQL线程忽略了查询"
        eng "Slave SQL thread ignored the query because of replicate-*-table rules"
        ger "Slave-SQL-Thread hat die Abfrage aufgrund von replicate-*-table-Regeln ignoriert"
        jpn "replicate-*-table ルールに従って、スレーブSQLスレッドはクエリを無視しました。"
        nla "Slave SQL thread negeerde de query vanwege replicate-*-table opties"
        por "Slave SQL thread ignorado a consulta devido às normas de replicação-*-tabela"
        spa "El hilo (thread) SQL esclavo ha ignorado la consulta (query) debido a las reglas de replicar-*-tabla"
        swe "Slav SQL tråden ignorerade frågan pga en replicate-*-table regel"
ER_INCORRECT_GLOBAL_LOCAL_VAR  
        chi "变量'%-.192s'是一个%s变量"
        eng "Variable '%-.192s' is a %s variable"
        ger "Variable '%-.192s' ist eine %s-Variable"
        jpn "変数 '%-.192s' は %s 変数です。"
        nla "Variabele '%-.192s' is geen %s variabele"
        serbian "Promenljiva '%-.192s' je %s promenljiva"
        spa "La variable '%-.192s' es una variable %s"
        swe "Variabel '%-.192s' är av typ %s"
ER_WRONG_FK_DEF 42000 
        chi "'%-.192s'的外键定义不正确:%s"
        eng "Incorrect foreign key definition for '%-.192s': %s"
        ger "Falsche Fremdschlüssel-Definition für '%-.192s': %s"
        jpn "外部キー '%-.192s' の定義の不正: %s"
        nla "Incorrecte foreign key definitie voor '%-.192s': %s"
        por "Definição errada da chave estrangeira para '%-.192s': %s"
        spa "Definición de clave foránea incorrecta para '%-.192s': %s"
        swe "Felaktig FOREIGN KEY-definition för '%-.192s': %s"
ER_KEY_REF_DO_NOT_MATCH_TABLE_REF  
        chi "索引参考和表参考不匹配"
        eng "Key reference and table reference don't match"
        ger "Schlüssel- und Tabellenverweis passen nicht zusammen"
        jpn "外部キーの参照表と定義が一致しません。"
        nla "Sleutel- en tabelreferentie komen niet overeen"
        por "Referência da chave e referência da tabela não coincidem"
        spa "La referencia de clave y la referencia de tabla no coinciden"
        swe "Nyckelreferensen och tabellreferensen stämmer inte överens"
ER_OPERAND_COLUMNS 21000 
        chi "操作数应包含%d列"
        eng "Operand should contain %d column(s)"
        ger "Operand sollte %d Spalte(n) enthalten"
        jpn "オペランドに %d 個の列が必要です。"
        nla "Operand behoort %d kolommen te bevatten"
        rus "Операнд должен содержать %d колонок"
        spa "El operando debería de contener %d columna(s)"
        ukr "Операнд має складатися з %d стовбців"
ER_SUBQUERY_NO_1_ROW 21000 
        chi "子查询返回超过1行"
        eng "Subquery returns more than 1 row"
        ger "Unterabfrage lieferte mehr als einen Datensatz zurück"
        jpn "サブクエリが2行以上の結果を返します。"
        nla "Subquery retourneert meer dan 1 rij"
        por "Subconsulta retorna mais que 1 registro"
        rus "Подзапрос возвращает более одной записи"
        spa "La subconsulta (subquery) devuelve más de 1 fila"
        swe "Subquery returnerade mer än 1 rad"
        ukr "Підзапит повертає більш нiж 1 запис"
ER_UNKNOWN_STMT_HANDLER  
        chi "未知prepared statement处理程序(%.*s)给予%s"
        dan "Unknown prepared statement handler (%.*s) given to %s"
        eng "Unknown prepared statement handler (%.*s) given to %s"
        ger "Unbekannter Prepared-Statement-Handler (%.*s) für %s angegeben"
        jpn "'%.*s' はプリペアードステートメントの不明なハンドルです。(%s で指定されました)"
        nla "Onebekende prepared statement handler (%.*s) voor %s aangegeven"
        por "Desconhecido manipulador de declaração preparado (%.*s) determinado para %s"
        spa "Manejador desconocido de sentencia preparada (%.*s) dado para %s"
        swe "Okänd PREPARED STATEMENT id (%.*s) var given till %s"
        ukr "Unknown prepared statement handler (%.*s) given to %s"
ER_CORRUPT_HELP_DB  
        chi "帮助数据库已损坏或不存在"
        eng "Help database is corrupt or does not exist"
        ger "Die Hilfe-Datenbank ist beschädigt oder existiert nicht"
        jpn "ヘルプデータベースは壊れているか存在しません。"
        nla "Help database is beschadigd of bestaat niet"
        por "Banco de dado de ajuda corrupto ou não existente"
        spa "O la Base de datos de Ayuda está corrupta o no existe"
        swe "Hjälpdatabasen finns inte eller är skadad"
ER_CYCLIC_REFERENCE  
        chi "亚查询的死环参考"
        eng "Cyclic reference on subqueries"
        ger "Zyklischer Verweis in Unterabfragen"
        jpn "サブクエリの参照がループしています。"
        nla "Cyclische verwijzing in subqueries"
        por "Referência cíclica em subconsultas"
        rus "Циклическая ссылка на подзапрос"
        spa "Referencia cíclica en subconsultas (subqueries)"
        swe "Cyklisk referens i subqueries"
        ukr "Циклічне посилання на підзапит"
ER_AUTO_CONVERT  
        chi "将列'%s'从%s转换为%s"
        eng "Converting column '%s' from %s to %s"
        ger "Feld '%s' wird von %s nach %s umgewandelt"
        jpn "列 '%s' を %s から %s へ変換します。"
        nla "Veld '%s' wordt van %s naar %s geconverteerd"
        por "Convertendo coluna '%s' de %s para %s"
        rus "Преобразование поля '%s' из %s в %s"
        spa "Convirtiendo la columna '%s' de %s a %s"
        swe "Konvertar kolumn '%s' från %s till %s"
        ukr "Перетворення стовбца '%s' з %s у %s"
ER_ILLEGAL_REFERENCE 42S22 
        chi "参考'%-.64s'不支持(%s)"
        eng "Reference '%-.64s' not supported (%s)"
        ger "Verweis '%-.64s' wird nicht unterstützt (%s)"
        jpn "'%-.64s' の参照はできません。(%s)"
        nla "Verwijzing '%-.64s' niet ondersteund (%s)"
        por "Referência '%-.64s' não suportada (%s)"
        rus "Ссылка '%-.64s' не поддерживается (%s)"
        spa "Referencia '%-.64s' no soportada (%s)"
        swe "Referens '%-.64s' stöds inte (%s)"
        ukr "Посилання '%-.64s' не пiдтримуется (%s)"
ER_DERIVED_MUST_HAVE_ALIAS 42000 
        chi "每个派生的表必须有自己的别名"
        eng "Every derived table must have its own alias"
        ger "Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werden"
        jpn "導出表には別名が必須です。"
        nla "Voor elke afgeleide tabel moet een unieke alias worden gebruikt"
        por "Cada tabela derivada deve ter seu próprio alias"
        spa "Cada tabla derivada debe de tener su propio alias"
        swe "Varje 'derived table' måste ha sitt eget alias"
ER_SELECT_REDUCED 01000 
        chi "SELECT %u在优化期间被减"
        eng "Select %u was reduced during optimization"
        ger "Select %u wurde während der Optimierung reduziert"
        jpn "Select %u は最適化によって減らされました。"
        nla "Select %u werd geredureerd tijdens optimtalisatie"
        por "Select %u foi reduzido durante otimização"
        rus "Select %u был упразднен в процессе оптимизации"
        spa "La selección %u fué reducida durante optimización"
        swe "Select %u reducerades vid optimiering"
        ukr "Select %u was скасовано при оптимiзацii"
ER_TABLENAME_NOT_ALLOWED_HERE 42000 
        chi "表'%-.192s'从其中一个SELECT中不能用于%-.32s"
        eng "Table '%-.192s' from one of the SELECTs cannot be used in %-.32s"
        ger "Tabelle '%-.192s', die in einem der SELECT-Befehle verwendet wurde, kann nicht in %-.32s verwendet werden"
        jpn "特定のSELECTのみで使用の表 '%-.192s' は %-.32s では使用できません。"
        nla "Tabel '%-.192s' uit een van de SELECTS kan niet in %-.32s gebruikt worden"
        por "Tabela '%-.192s' de um dos SELECTs não pode ser usada em %-.32s"
        spa "La tabla '%-.192s' de uno de los SELECT no puede ser usada en %-.32s"
        swe "Tabell '%-.192s' från en SELECT kan inte användas i %-.32s"
ER_NOT_SUPPORTED_AUTH_MODE 08004 
        chi "客户端不支持服务器请求的身份验证协议;考虑升级MariaDB客户端"
        eng "Client does not support authentication protocol requested by server; consider upgrading MariaDB client"
        ger "Client unterstützt das vom Server erwartete Authentifizierungsprotokoll nicht. Bitte aktualisieren Sie Ihren MariaDB-Client"
        jpn "クライアントはサーバーが要求する認証プロトコルに対応できません。MariaDBクライアントのアップグレードを検討してください。"
        nla "Client ondersteunt het door de server verwachtte authenticatieprotocol niet. Overweeg een nieuwere MariaDB client te gebruiken"
        por "Cliente não suporta o protocolo de autenticação exigido pelo servidor; considere a atualização do cliente MariaDB"
        spa "El cliente no soporta protocolo de autenticación requerido por el servidor; considere mejorar el cliente MariaDB"
        swe "Klienten stöder inte autentiseringsprotokollet som begärts av servern; överväg uppgradering av klientprogrammet"
ER_SPATIAL_CANT_HAVE_NULL 42000 
        chi "SPATIAL索引的所有部分必须不为null"
        eng "All parts of a SPATIAL index must be NOT NULL"
        ger "Alle Teile eines SPATIAL-Index müssen als NOT NULL deklariert sein"
        jpn "空間索引のキー列は NOT NULL でなければいけません。"
        nla "Alle delete van een  SPATIAL index dienen als NOT NULL gedeclareerd te worden"
        por "Todas as partes de uma SPATIAL index devem ser NOT NULL"
        spa "Todas las partes de un índice SPATIAL deben de ser NOT NULL"
        swe "Alla delar av en SPATIAL index måste vara NOT NULL"
ER_COLLATION_CHARSET_MISMATCH 42000 
        chi "COLLATION'%s'无效地用于字符集'%s'"
        eng "COLLATION '%s' is not valid for CHARACTER SET '%s'"
        ger "COLLATION '%s' ist für CHARACTER SET '%s' ungültig"
        jpn "COLLATION '%s' は CHARACTER SET '%s' に適用できません。"
        nla "COLLATION '%s' is niet geldig voor CHARACTER SET '%s'"
        por "COLLATION '%s' não é válida para CHARACTER SET '%s'"
        spa "El COTEJO (COLLATION) '%s' no es válido para CHARACTER SET '%s'"
        swe "COLLATION '%s' är inte tillåtet för CHARACTER SET '%s'"
ER_SLAVE_WAS_RUNNING  
        chi "Slave已经在运行"
        eng "Slave is already running"
        ger "Slave läuft bereits"
        jpn "スレーブはすでに稼働中です。"
        nla "Slave is reeds actief"
        por "O slave já está rodando"
        spa "El esclavo ya está funcionando"
        swe "Slaven har redan startat"
ER_SLAVE_WAS_NOT_RUNNING  
        chi "slave已经停止了"
        eng "Slave already has been stopped"
        ger "Slave wurde bereits angehalten"
        jpn "スレーブはすでに停止しています。"
        nla "Slave is reeds gestopt"
        por "O slave já está parado"
        spa "El esclavo ya fué parado"
        swe "Slaven har redan stoppat"
ER_TOO_BIG_FOR_UNCOMPRESS  
        chi "未压缩的数据量太大;最大量为%d(可能未压缩数据的长度已损坏)"
        eng "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)"
        ger "Unkomprimierte Daten sind zu groß. Die maximale Größe beträgt %d (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)"
        jpn "展開後のデータが大きすぎます。最大サイズは %d です。(展開後データの長さ情報が壊れている可能性もあります。)"
        nla "Ongecomprimeerder data is te groot; de maximum lengte is %d (waarschijnlijk, de lengte van de gecomprimeerde data was beschadigd)"
        por "Tamanho muito grande dos dados des comprimidos. O máximo tamanho é %d. (provavelmente, o comprimento dos dados descomprimidos está corrupto)"
        spa "Tamaño demasiado grande para datos descomprimidos; el máximo tamaño es %d. (probablemente, el tamaño de datos descomprimidos fué corrompido)"
ER_ZLIB_Z_MEM_ERROR  
        chi "ZLIB:内存不足"
        eng "ZLIB: Not enough memory"
        ger "ZLIB: Nicht genug Speicher"
        jpn "ZLIB: メモリ不足です。"
        nla "ZLIB: Onvoldoende geheugen"
        por "ZLIB: Não suficiente memória disponível"
        spa "ZLIB: No hay suficiente memoria"
ER_ZLIB_Z_BUF_ERROR  
        chi "ZLIB:输出缓冲区中没有足够的空间(可能未压缩数据的长度已损坏)"
        eng "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)"
        ger "ZLIB: Im Ausgabepuffer ist nicht genug Platz vorhanden (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)"
        jpn "ZLIB: 出力バッファに十分な空きがありません。(展開後データの長さ情報が壊れている可能性もあります。)"
        nla "ZLIB: Onvoldoende ruimte in uitgaande buffer (waarschijnlijk, de lengte van de ongecomprimeerde data was beschadigd)"
        por "ZLIB: Não suficiente espaço no buffer emissor (provavelmente, o comprimento dos dados descomprimidos está corrupto)"
        spa "ZLIB: No hay suficiente espacio en el búfer de salida (probablemente, el tamaño de datos descomprimidos fué corrompido)"
ER_ZLIB_Z_DATA_ERROR  
        chi "ZLIB:输入数据已损坏"
        eng "ZLIB: Input data corrupted"
        ger "ZLIB: Eingabedaten beschädigt"
        jpn "ZLIB: 入力データが壊れています。"
        nla "ZLIB: Invoer data beschadigd"
        por "ZLIB: Dados de entrada está corrupto"
        spa "ZLIB: Dato de entrada corrupto"
ER_CUT_VALUE_GROUP_CONCAT  
        chi "group_concat()削减了行%u. %s"
        eng "Row %u was cut by %s)"
        spa "La fila %u ha sido cortada por %s)"
ER_WARN_TOO_FEW_RECORDS 01000 
        chi "行%lu不包含所有列的数据"
        eng "Row %lu doesn't contain data for all columns"
        ger "Zeile %lu enthält nicht für alle Felder Daten"
        jpn "行 %lu はすべての列へのデータを含んでいません。"
        nla "Rij %lu bevat niet de data voor alle kolommen"
        por "Conta de registro é menor que a conta de coluna na linha %lu"
        spa "La fila %lu no contiene datos para todas las columnas"
ER_WARN_TOO_MANY_RECORDS 01000 
        chi "行%lu被截断;它包含的数据比输入列更多"
        eng "Row %lu was truncated; it contained more data than there were input columns"
        ger "Zeile %lu gekürzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt"
        jpn "行 %lu はデータを切り捨てられました。列よりも多いデータを含んでいました。"
        nla "Regel %lu ingekort, bevatte meer data dan invoer kolommen"
        por "Conta de registro é maior que a conta de coluna na linha %lu"
        spa "La fila %lu fué truncada; contenía más datos que columnas de entrada"
ER_WARN_NULL_TO_NOTNULL 22004 
        chi "列设置为默认值; NULL在行'%s'中提供给了NOT NULL列%lu"
        eng "Column set to default value; NULL supplied to NOT NULL column '%s' at row %lu"
        ger "Feld auf Vorgabewert gesetzt, da NULL für NOT-NULL-Feld '%s' in Zeile %lu angegeben"
        jpn "列にデフォルト値が設定されました。NOT NULLの列 '%s' に 行 %lu で NULL が与えられました。"
        por "Dado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %lu"
        spa "Columna puesta a valor por defecto; NULL suministrado para columna NOT NULL '%s' en la fila %lu"
ER_WARN_DATA_OUT_OF_RANGE 22003 
        chi "列'%s'行%lu的值超出范围"
        eng "Out of range value for column '%s' at row %lu"
        spa "Valor fuera de rango para la columna '%s' en la fila %lu"
WARN_DATA_TRUNCATED 01000 
        chi "数据被截断,在列'%s', 行%lu"
        eng "Data truncated for column '%s' at row %lu"
        ger "Daten abgeschnitten für Feld '%s' in Zeile %lu"
        jpn "列 '%s' の 行 %lu でデータが切り捨てられました。"
        por "Dado truncado para coluna '%s' na linha %lu"
        spa "Datos truncados para la columna '%s' en la fila %lu"
ER_WARN_USING_OTHER_HANDLER  
        chi "使用存储引擎%s 表格'%s'"
        eng "Using storage engine %s for table '%s'"
        ger "Speicher-Engine %s wird für Tabelle '%s' benutzt"
        hindi "स्टोरेज इंजन %s का इस्तेमाल टेबल '%s' के लिए  किया जा रहा है"
        jpn "ストレージエンジン %s が表 '%s' に利用されています。"
        por "Usando engine de armazenamento %s para tabela '%s'"
        spa "Usando motor de almacenaje %s para la tabla '%s'"
        swe "Använder handler %s för tabell '%s'"
ER_CANT_AGGREGATE_2COLLATIONS
        chi "非法混合collations(%s,%s)和(%s,%s),用于操作'%s'"
        eng "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'"
        ger "Unerlaubte Mischung von Sortierreihenfolgen (%s, %s) und (%s, %s) für Operation '%s'"
        jpn "照合順序 (%s,%s) と (%s,%s) の混在は操作 '%s' では不正です。"
        por "Combinação ilegal de collations (%s,%s) e (%s,%s) para operação '%s'"
        spa "Mezcla ilegal de cotejos (collations) (%s,%s) y (%s,%s) para la operación '%s'"
ER_DROP_USER  
        chi "无法删除一个或多个请求的用户"
        eng "Cannot drop one or more of the requested users"
        ger "Kann einen oder mehrere der angegebenen Benutzer nicht löschen"
        spa "No puedo eliminar uno o más de los usuarios solicitados"
ER_REVOKE_GRANTS  
        chi "无法为一个或多个请求的用户撤消所有权限"
        eng "Can't revoke all privileges for one or more of the requested users"
        ger "Kann nicht alle Berechtigungen widerrufen, die für einen oder mehrere Benutzer gewährt wurden"
        jpn "指定されたユーザーから指定された全ての権限を剥奪することができませんでした。"
        por "Não pode revocar todos os privilégios, grant para um ou mais dos usuários pedidos"
        spa "No puedo revocar todos los privilegios para uno o más de los usuarios solicitados"
ER_CANT_AGGREGATE_3COLLATIONS  
        chi "非法混合collations(%s,%s),(%s,%s)和(%s,%s),用于操作'%s'"
        eng "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'"
        ger "Unerlaubte Mischung von Sortierreihenfolgen (%s, %s), (%s, %s), (%s, %s) für Operation '%s'"
        jpn "照合順序 (%s,%s), (%s,%s), (%s,%s) の混在は操作 '%s' では不正です。"
        por "Ilegal combinação de collations (%s,%s), (%s,%s), (%s,%s) para operação '%s'"
        spa "Mezcla ilegal de cotejos (collations) (%s,%s), (%s,%s), (%s,%s) para la operación '%s'"
ER_CANT_AGGREGATE_NCOLLATIONS  
        chi "非法混合collations操作'%s'"
        eng "Illegal mix of collations for operation '%s'"
        ger "Unerlaubte Mischung von Sortierreihenfolgen für Operation '%s'"
        jpn "操作 '%s' では不正な照合順序の混在です。"
        por "Ilegal combinação de collations para operação '%s'"
        spa "Mezcla ilegal de cotejos (collations) para la operación '%s'"
ER_VARIABLE_IS_NOT_STRUCT  
        chi "变量'%-.64s'不是可变组件(不能用作xxxx.variable_name)"
        eng "Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)"
        ger "Variable '%-.64s' ist keine Variablen-Komponente (kann nicht als XXXX.variablen_name verwendet werden)"
        jpn "変数 '%-.64s' は構造変数の構成要素ではありません。(XXXX.変数名 という指定はできません。)"
        por "Variável '%-.64s' não é uma variável componente (Não pode ser usada como XXXX.variável_nome)"
        spa "La variable '%-.64s' no es un componente variable (No puede ser usada como XXXX.variable_name)"
ER_UNKNOWN_COLLATION  
        chi "未知的collation:'%-.64s'"
        eng "Unknown collation: '%-.64s'"
        ger "Unbekannte Sortierreihenfolge: '%-.64s'"
        jpn "不明な照合順序: '%-.64s'"
        por "Collation desconhecida: '%-.64s'"
        spa "Cotejo (Collation) desconocido: '%-.64s'"
ER_SLAVE_IGNORED_SSL_PARAMS  
        chi "CHANGE MASTER中的SSL参数被忽略,因为此MariaDB从站未在没有SSL支持的情况下编译;如果启动了SSL的MariaDB从站,则可以使用它们"
        eng "SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is started"
        ger "SSL-Parameter in CHANGE MASTER werden ignoriert, weil dieser MariaDB-Slave ohne SSL-Unterstützung kompiliert wurde. Sie können aber später verwendet werden, wenn ein MariaDB-Slave mit SSL gestartet wird"
        jpn "このMariaDBスレーブはSSLサポートを含めてコンパイルされていないので、CHANGE MASTER のSSLパラメータは無視されました。今後SSLサポートを持つMariaDBスレーブを起動する際に利用されます。"
        por "SSL parâmetros em CHANGE MASTER são ignorados porque este escravo MariaDB foi compilado sem o SSL suporte. Os mesmos podem ser usados mais tarde quando o escravo MariaDB com SSL seja iniciado."
        spa "Los parámetros SSL en CHANGE MASTER son ignorados porque este esclavo MariaDB fue compilado sin soporte SSL; pueden ser usados después cuando el esclavo MariaDB con SSL sea arrancado"
ER_SERVER_IS_IN_SECURE_AUTH_MODE  
        chi "服务器在--secure-auth模式下运行,但'%s'@'%s'具有旧格式的密码;请将密码更改为新格式"
        eng "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format"
        ger "Server läuft im Modus --secure-auth, aber '%s'@'%s' hat ein Passwort im alten Format. Bitte Passwort ins neue Format ändern"
        jpn "サーバーは --secure-auth モードで稼働しています。しかし '%s'@'%s' は古い形式のパスワードを使用しています。新しい形式のパスワードに変更してください。"
        por "Servidor está rodando em --secure-auth modo, porêm '%s'@'%s' tem senha no formato antigo; por favor troque a senha para o novo formato"
        rus "Сервер запущен в режиме --secure-auth (безопасной авторизации), но для пользователя '%s'@'%s' пароль сохранён в старом формате; необходимо обновить формат пароля"
        spa "El servidor se está ejecutando en modo --secure-auth, pero '%s'@'%s' tiene una contraseña con formato antiguo; por favor cambie la contraseña al nuevo formato"
ER_WARN_FIELD_RESOLVED  
        chi "列或参考'%-.192s%s%-.192s%s%-.192s' 在SELECT #%d 中, 在SELECT #%d中得到解决"
        eng "Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d"
        ger "Feld oder Verweis '%-.192s%s%-.192s%s%-.192s' im SELECT-Befehl Nr. %d wurde im SELECT-Befehl Nr. %d aufgelöst"
        jpn "フィールドまたは参照 '%-.192s%s%-.192s%s%-.192s' は SELECT #%d ではなく、SELECT #%d で解決されました。"
        por "Campo ou referência '%-.192s%s%-.192s%s%-.192s' de SELECT #%d foi resolvido em SELECT #%d"
        rus "Поле или ссылка '%-.192s%s%-.192s%s%-.192s' из SELECTа #%d была найдена в SELECTе #%d"
        spa "El campo o la referencia '%-.192s%s%-.192s%s%-.192s' de SELECT #%d se resolvió en SELECT #%d"
        ukr "Стовбець або посилання '%-.192s%s%-.192s%s%-.192s' із SELECTу #%d було знайдене у SELECTі #%d"
ER_BAD_SLAVE_UNTIL_COND  
        chi "START SLAVE UNTIL的参数或参数的组合不正确"
        eng "Incorrect parameter or combination of parameters for START SLAVE UNTIL"
        ger "Falscher Parameter oder falsche Kombination von Parametern für START SLAVE UNTIL"
        jpn "START SLAVE UNTIL へのパラメータまたはその組み合わせが不正です。"
        por "Parâmetro ou combinação de parâmetros errado para START SLAVE UNTIL"
        spa "Parámetro incorrecto o combinación de parámetros para START SLAVE UNTIL"
ER_MISSING_SKIP_SLAVE  
        chi "START SLAVE UNTIL进行逐步复制时建议使用--skip-slave-start;否则,如果有意外的Slave的mariadbd重启,可能有问题"
        eng "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restart"
        ger "Es wird empfohlen, mit --skip-slave-start zu starten, wenn mit START SLAVE UNTIL eine Schritt-für-Schritt-Replikation ausgeführt wird. Ansonsten gibt es Probleme, wenn ein Slave-Server unerwartet neu startet"
        jpn "START SLAVE UNTIL で段階的にレプリケーションを行う際には、--skip-slave-start オプションを使うことを推奨します。使わない場合、スレーブのmariadbdが不慮の再起動をすると問題が発生します。"
        por "É recomendado para rodar com --skip-slave-start quando fazendo replicação passo-por-passo com START SLAVE UNTIL, de outra forma você não está seguro em caso de inesperada reinicialição do mariadbd escravo"
        spa "Se recomienda usar --skip-slave-start al hacer réplica paso a paso con START SLAVE UNTIL; en caso contrario, obtendrá problemas si tiene lugar un rearranque inesperado del esclavo mariadb"
ER_UNTIL_COND_IGNORED  
        chi "不能启动SQL线程所以UNTIL选项被忽略"
        eng "SQL thread is not to be started so UNTIL options are ignored"
        ger "SQL-Thread soll nicht gestartet werden. Daher werden UNTIL-Optionen ignoriert"
        jpn "スレーブSQLスレッドが開始されないため、UNTILオプションは無視されました。"
        por "Thread SQL não pode ser inicializado tal que opções UNTIL são ignoradas"
        spa "Un hilo (thread) SQL no ha de ser arrancado de esa manera HASTA que las opciones sean ignordas"
ER_WRONG_NAME_FOR_INDEX 42000 
        chi "索引名称'%-.100s'不正确"
        eng "Incorrect index name '%-.100s'"
        ger "Falscher Indexname '%-.100s'"
        jpn "索引名 '%-.100s' は不正です。"
        por "Incorreto nome de índice '%-.100s'"
        spa "Nombre de índice incorrecto '%-.100s'"
        swe "Felaktigt index namn '%-.100s'"
ER_WRONG_NAME_FOR_CATALOG 42000 
        chi "目录名称'%-.100s'不正确"
        eng "Incorrect catalog name '%-.100s'"
        ger "Falscher Katalogname '%-.100s'"
        jpn "カタログ名 '%-.100s' は不正です。"
        por "Incorreto nome de catálogo '%-.100s'"
        spa "Nombre de catálogo incorrecto '%-.100s'"
        swe "Felaktigt katalog namn '%-.100s'"
ER_WARN_QC_RESIZE  
        chi "设置查询缓存值%llu失败;新查询缓存值为%lu"
        eng "Query cache failed to set size %llu; new query cache size is %lu"
        ger "Änderung der Query-Cache-Größe auf %llu fehlgeschlagen; neue Query-Cache-Größe ist %lu"
        por "Falha em Query cache para configurar tamanho %llu, novo tamanho de query cache é %lu"
        rus "Кеш запросов не может установить размер %llu, новый размер кеша зпросов - %lu"
        spa "La caché de consulta (query) ha fallado al poner el tamaño %llu; el nuevo tamaño de caché de consulta (query) es %lu"
        swe "Storleken av "Query cache" kunde inte sättas till %llu, ny storlek är %lu"
        ukr "Кеш запитів неспроможен встановити розмір %llu, новий розмір кеша запитів - %lu"
ER_BAD_FT_COLUMN  
        chi "列'%-.192s'不能成为全文索引的一部分"
        eng "Column '%-.192s' cannot be part of FULLTEXT index"
        ger "Feld '%-.192s' kann nicht Teil eines FULLTEXT-Index sein"
        jpn "列 '%-.192s' は全文索引のキーにはできません。"
        por "Coluna '%-.192s' não pode ser parte de índice FULLTEXT"
        spa "La columna '%-.192s' no puede format parte de índice FULLTEXT"
        swe "Kolumn '%-.192s' kan inte vara del av ett FULLTEXT index"
ER_UNKNOWN_KEY_CACHE  
        chi "未知索引缓存'%-.100s'"
        eng "Unknown key cache '%-.100s'"
        ger "Unbekannter Schlüssel-Cache '%-.100s'"
        jpn "'%-.100s' は不明なキーキャッシュです。"
        por "Key cache desconhecida '%-.100s'"
        spa "Caché de clave desconocida '%-.100s'"
        swe "Okänd nyckel cache '%-.100s'"
ER_WARN_HOSTNAME_WONT_WORK  
        chi "MariaDB以-skip-name-resolve模式启动;想用grant,您必须重新启动,不用这个选项"
        eng "MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work"
        ger "MariaDB wurde mit --skip-name-resolve gestartet. Diese Option darf nicht verwendet werden, damit diese Rechtevergabe möglich ist"
        jpn "MariaDBは --skip-name-resolve モードで起動しています。このオプションを外して再起動しなければ、この権限操作は機能しません。"
        por "MariaDB foi inicializado em modo --skip-name-resolve. Você necesita reincializá-lo sem esta opção para este grant funcionar"
        spa "MariaDB ha sido arrancada en modo --skip-name-resolve; vd necesita reinicializarla sin esta opción para que esta concesión funcione"
ER_UNKNOWN_STORAGE_ENGINE 42000 
        chi "未知的存储引擎'%s'"
        eng "Unknown storage engine '%s'"
        ger "Unbekannte Speicher-Engine '%s'"
        hindi "अज्ञात स्टोरेज इंजन '%s'"
        jpn "'%s' は不明なストレージエンジンです。"
        por "Motor de tabela desconhecido '%s'"
        spa "Motor de almacenaje '%s' desconocido"
ER_WARN_DEPRECATED_SYNTAX  
        chi "弃用'%s',将在将来的版本中删除。请使用%s"
        eng "'%s' is deprecated and will be removed in a future release. Please use %s instead"
        ger "'%s' ist veraltet. Bitte benutzen Sie '%s'"
        jpn "'%s' は将来のリリースで廃止予定です。代わりに %s を使用してください。"
        por "'%s' é desatualizado. Use '%s' em seu lugar"
        spa "'%s' está obsoleto y será quitado en una entrega futura, use '%s' en su lugar"
ER_NON_UPDATABLE_TABLE  
        chi "目标表%-.100s多个%s不可更新"
        eng "The target table %-.100s of the %s is not updatable"
        ger "Die Zieltabelle %-.100s von %s ist nicht aktualisierbar"
        jpn "対象表 %-.100s は更新可能ではないので、%s を行えません。"
        por "A tabela destino %-.100s do %s não é atualizável"
        rus "Таблица %-.100s в %s не может изменятся"
        spa "La tabla destino %-.100s del %s no es actualizable"
        swe "Tabell %-.100s använd med '%s' är inte uppdateringsbar"
        ukr "Таблиця %-.100s у %s не може оновлюватись"
ER_FEATURE_DISABLED  
        chi "'%s'功能被禁用;您需要MariaDB以'%s'构建以使其工作"
        eng "The '%s' feature is disabled; you need MariaDB built with '%s' to have it working"
        ger "Das Feature '%s' ist ausgeschaltet, Sie müssen MariaDB mit '%s' übersetzen, damit es verfügbar ist"
        jpn "機能 '%s' は無効です。利用するためには '%s' を含めてビルドしたMariaDBが必要です。"
        por "O recurso '%s' foi desativado; você necessita MariaDB construído com '%s' para ter isto funcionando"
        spa "La característica '%s' fue deshabilitada; usted necesita construir MariaDB con '%s' para tener eso funcionando"
        swe "'%s' är inte aktiverad; För att aktivera detta måste du bygga om MariaDB med '%s' definierad"
ER_OPTION_PREVENTS_STATEMENT  
        chi "MariaDB服务器使用%s选项运行,因此无法执行此语句"
        eng "The MariaDB server is running with the %s option so it cannot execute this statement"
        ger "Der MariaDB-Server läuft mit der Option %s und kann diese Anweisung deswegen nicht ausführen"
        jpn "MariaDBサーバーが %s オプションで実行されているので、このステートメントは実行できません。"
        por "O servidor MariaDB está rodando com a opção %s razão pela qual não pode executar esse commando"
        spa "El servidor MariaDB se está ejecutando con la opción %s por lo que no se puede ejecutar esta sentencia"
        swe "MariaDB är startad med %s. Pga av detta kan du inte använda detta kommando"
ER_DUPLICATED_VALUE_IN_TYPE  
        chi "列'%-.100s'有重复的值'%-.64s'在%s"
        eng "Column '%-.100s' has duplicated value '%-.64s' in %s"
        ger "Feld '%-.100s' hat doppelten Wert '%-.64s' in %s"
        jpn "列 '%-.100s' で、重複する値 '%-.64s' が %s に指定されています。"
        por "Coluna '%-.100s' tem valor duplicado '%-.64s' em %s"
        spa "La columna '%-.100s' tiene valor duplicado '%-.64s' en %s"
ER_TRUNCATED_WRONG_VALUE 22007 
        chi "截断的不正确%-.32T值:'%-.128T'"
        eng "Truncated incorrect %-.32T value: '%-.128T'"
        ger "Falscher %-.32T-Wert gekürzt: '%-.128T'"
        jpn "不正な %-.32T の値が切り捨てられました。: '%-.128T'"
        por "Truncado errado %-.32T valor: '%-.128T'"
        spa "Truncado incorrecto %-.32T valor: '%-.128T'"
ER_TOO_MUCH_AUTO_TIMESTAMP_COLS  
        chi "表定义不正确;默认或ON UPDATE中只能有一个带有CURRENT_TIMESTAMP的TIMESTAMP列"
        eng "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause"
        ger "Fehlerhafte Tabellendefinition. Es kann nur eine einzige TIMESTAMP-Spalte mit CURRENT_TIMESTAMP als DEFAULT oder in einer ON-UPDATE-Klausel geben"
        jpn "不正な表定義です。DEFAULT句またはON UPDATE句に CURRENT_TIMESTAMP をともなうTIMESTAMP型の列は1つまでです。"
        por "Incorreta definição de tabela; Pode ter somente uma coluna TIMESTAMP com CURRENT_TIMESTAMP em DEFAULT ou ON UPDATE cláusula"
        spa "Definición incorrecta de tabla; solamente puede haber una columna TIMESTAMP con CURRENT_TIMESTAMP en DEFAULT o en cláusula ON UPDATE"
ER_INVALID_ON_UPDATE  
        chi "在'%-.192s'列的ON UPDATE子句上无效"
        eng "Invalid ON UPDATE clause for '%-.192s' column"
        ger "Ungültige ON-UPDATE-Klausel für Spalte '%-.192s'"
        jpn "列 '%-.192s' に ON UPDATE句は無効です。"
        por "Inválida cláusula ON UPDATE para campo '%-.192s'"
        spa "Cláusula ON UPDATE inválida para la columna '%-.192s'"
ER_UNSUPPORTED_PS  
        chi "尚未在prepared statement协议中支持此命令"
        eng "This command is not supported in the prepared statement protocol yet"
        ger "Dieser Befehl wird im Protokoll für vorbereitete Anweisungen noch nicht unterstützt"
        spa "Este comando no se encuentra soportado para protocolo de sentencia preparada, aún"
ER_GET_ERRMSG  
        chi "出错%d '%-.200s'来自%s"
        dan "Modtog fejl %d '%-.200s' fra %s"
        eng "Got error %d '%-.200s' from %s"
        ger "Fehler %d '%-.200s' von %s"
        jpn "エラー %d '%-.200s' が %s から返されました。"
        nor "Mottok feil %d '%-.200s' fa %s"
        norwegian-ny "Mottok feil %d '%-.200s' fra %s"
        spa "Obtenido error %d '%-.200s' desde %s"
ER_GET_TEMPORARY_ERRMSG  
        chi "出临时错误%d '%-.200s'来自%s"
        dan "Modtog temporary fejl %d '%-.200s' fra %s"
        eng "Got temporary error %d '%-.200s' from %s"
        ger "Temporärer Fehler %d '%-.200s' von %s"
        jpn "一時エラー %d '%-.200s' が %s から返されました。"
        nor "Mottok temporary feil %d '%-.200s' fra %s"
        norwegian-ny "Mottok temporary feil %d '%-.200s' fra %s"
        spa "Obtenido error temporal %d '%-.200s' desde %s"
ER_UNKNOWN_TIME_ZONE  
        chi "未知或不正确的时区:'%-.64s'"
        eng "Unknown or incorrect time zone: '%-.64s'"
        ger "Unbekannte oder falsche Zeitzone: '%-.64s'"
        spa "Zona temporal desconocida o incorrecta: '%-.64s'"
ER_WARN_INVALID_TIMESTAMP  
        chi "无效TIMESTAMP值:列'%s' 行'%lu'"
        eng "Invalid TIMESTAMP value in column '%s' at row %lu"
        ger "Ungültiger TIMESTAMP-Wert in Feld '%s', Zeile %lu"
        spa "Valor inválido de SELLO TEMPORAL (TIMESTAMP) en la columna '%s' de la fila %lu"
ER_INVALID_CHARACTER_STRING  
        chi "无效的%s字符串:'%.64T'"
        eng "Invalid %s character string: '%.64T'"
        ger "Ungültiger %s-Zeichen-String: '%.64T'"
        spa "Cadena de carácter %s inválida: '%.64T'"
ER_WARN_ALLOWED_PACKET_OVERFLOWED  
        chi "%s()的结果大于max_allowed_packet(%ld) - 截断"
        eng "Result of %s() was larger than max_allowed_packet (%ld) - truncated"
        ger "Ergebnis von %s() war größer als max_allowed_packet (%ld) Bytes und wurde deshalb gekürzt"
        spa "El resultado de %s() ha sido mayor que max_allowed_packet (%ld) - truncado"
ER_CONFLICTING_DECLARATIONS  
        chi "矛盾语句:'%s%s'和'%s%s'"
        eng "Conflicting declarations: '%s%s' and '%s%s'"
        ger "Widersprüchliche Deklarationen: '%s%s' und '%s%s'"
        spa "Declaraciones conflictivas: '%s%s' y '%s%s'"
ER_SP_NO_RECURSIVE_CREATE 2F003 
        chi "无法从另一个存储过程中创建%s"
        eng "Can't create a %s from within another stored routine"
        ger "Kann kein %s innerhalb einer anderen gespeicherten Routine erzeugen"
        spa "No puedo crear una %s desde dentro de otra rutina almacenada"
ER_SP_ALREADY_EXISTS 42000 
        chi "%s%s已经存在"
        eng "%s %s already exists"
        ger "%s %s existiert bereits"
        hindi "%s %s पहले से ही मौजूद है"
        spa "%s %s ya existe"
ER_SP_DOES_NOT_EXIST 42000 
        chi "%s%s不存在"
        eng "%s %s does not exist"
        ger "%s %s existiert nicht"
        hindi "%s %s मौजूद नहीं है"
        spa "%s %s no existe"
ER_SP_DROP_FAILED  
        chi "未能DROP%s%s"
        eng "Failed to DROP %s %s"
        ger "DROP %s %s ist fehlgeschlagen"
        hindi "%s %s को ड्रॉप करने में असफल रहे"
        spa "No pude ELIMINAR (DROP) %s %s"
ER_SP_STORE_FAILED  
        chi "无法创建%s%s"
        eng "Failed to CREATE %s %s"
        ger "CREATE %s %s ist fehlgeschlagen"
        hindi "%s %s को बनाने में असफल रहे"
        spa "No pude CREAR %s %s"
ER_SP_LILABEL_MISMATCH 42000 
        chi "%s,没有匹配标签:%s"
        eng "%s with no matching label: %s"
        ger "%s ohne passende Marke: %s"
        spa "%s sin etiqueta coincidente: %s"
ER_SP_LABEL_REDEFINE 42000 
        chi "重新定义标签%s"
        eng "Redefining label %s"
        ger "Neudefinition der Marke %s"
        spa "Redefiniendo etiqueta %s"
ER_SP_LABEL_MISMATCH 42000 
        chi "没有匹配的最终标签%s"
        eng "End-label %s without match"
        ger "Ende-Marke %s ohne zugehörigen Anfang"
        spa "Etiqueta-Final %s sin coincidencia"
ER_SP_UNINIT_VAR 01000 
        chi "参考未初始化的变量%s"
        eng "Referring to uninitialized variable %s"
        ger "Zugriff auf nichtinitialisierte Variable %s"
        spa "Refiriéndose a variable %s sin inicializar"
ER_SP_BADSELECT 0A000 
        chi "PROCEDURE%s不能返回给定上下文中的结果集"
        eng "PROCEDURE %s can't return a result set in the given context"
        ger "PROCEDURE %s kann im gegebenen Kontext keine Ergebnismenge zurückgeben"
        spa "El PROCEDIMIENTO (PROCEDURE) %s no puede devolver un conjunto de resultados en el contexto dado"
ER_SP_BADRETURN 42000 
        chi "RETURN仅允许在函数中"
        eng "RETURN is only allowed in a FUNCTION"
        ger "RETURN ist nur innerhalb einer FUNCTION erlaubt"
        hindi "RETURN को केवल FUNCTION में इस्तेमाल किया जा सकता है"
        spa "RETURN sólo se permite dentro de una FUNCIÓN"
ER_SP_BADSTATEMENT 0A000 
        chi "%s不允许在存储过程中"
        eng "%s is not allowed in stored procedures"
        ger "%s ist in gespeicherten Prozeduren nicht erlaubt"
        hindi "%s को STORED PROCEDURE में इस्तेमाल नहीं किया जा सकता है"
        spa "%s no permitido en procedimientos almacenados"
ER_UPDATE_LOG_DEPRECATED_IGNORED 42000 
        chi "更新日志被弃用并由二进制日志替换;SET SQL_LOG_UPDATE已被忽略。此选项将在MariaDB 5.6中删除"
        eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6"
        ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wird ignoriert. Diese Option wird in MariaDB 5.6 entfernt"
        spa "El historial (log) de actualización se encuentra obsoleto y reemplazado por el historial (log) binario; SET SQL_LOG_UPDATE ha sido ignorado. Esta opción será quitada en MariaDB 5.6"
ER_UPDATE_LOG_DEPRECATED_TRANSLATED 42000 
        chi "更新日志被弃用并由二进制日志替换;SET SQL_LOG_UPDATE已被转换为设置SQL_LOG_BIN。此选项将在MariaDB 5.6中删除"
        eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6"
        ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wurde in SET SQL_LOG_BIN übersetzt. Diese Option wird in MariaDB 5.6 entfernt"
        spa "El historial (log) de actualización se encuentra obsoleto y reemplazado por el historial binario; SET SQL_LOG_UPDATE ha sido traducido a SET SQL_LOG_BIN. Esta opción será quitada en MariaDB 5.6"
ER_QUERY_INTERRUPTED 70100 
        chi "查询执行中断"
        eng "Query execution was interrupted"
        ger "Ausführung der Abfrage wurde unterbrochen"
        spa "Se ha interrumpido la ejecución de la consulta (query)"
ER_SP_WRONG_NO_OF_ARGS 42000 
        chi "%s%s的参数数量不正确;预期%u,得到%u"
        eng "Incorrect number of arguments for %s %s; expected %u, got %u"
        ger "Falsche Anzahl von Argumenten für %s %s; erwarte %u, erhalte %u"
        spa "Número incorrecto de argumentos para %s %s; se esperaba %u, se obtuvo %u"
ER_SP_COND_MISMATCH 42000 
        chi "未定义的CONDITION:%s"
        eng "Undefined CONDITION: %s"
        ger "Undefinierte CONDITION: %s"
        spa "CONDICIÓN no definida: %s"
ER_SP_NORETURN 42000 
        chi "FUNCTION%s中没有RETURN"
        eng "No RETURN found in FUNCTION %s"
        ger "Kein RETURN in FUNCTION %s gefunden"
        hindi "FUNCTION %s में कोई RETURN है"
        spa "No se hallado RETURN en FUNCIÓN %s"
ER_SP_NORETURNEND 2F005 
        chi "FUNCTION%s结束但无RETURN"
        eng "FUNCTION %s ended without RETURN"
        ger "FUNCTION %s endete ohne RETURN"
        hindi "FUNCTION %s RETURN के बिना समाप्त हो गया"
        spa "La FUNCIÓN %s termina sin RETURN"
ER_SP_BAD_CURSOR_QUERY 42000 
        chi "Cursor语句必须是选择"
        eng "Cursor statement must be a SELECT"
        ger "Cursor-Anweisung muss ein SELECT sein"
        spa "La sentencia de cursor debe de ser un SELECT"
ER_SP_BAD_CURSOR_SELECT 42000 
        chi "Cursor SELECT不能有INTO"
        eng "Cursor SELECT must not have INTO"
        ger "Cursor-SELECT darf kein INTO haben"
        spa "El SELECT de cursor no debe de tener INTO"
ER_SP_CURSOR_MISMATCH 42000 
        chi "未定义的CURSOR:%s"
        eng "Undefined CURSOR: %s"
        ger "Undefinierter CURSOR: %s"
        hindi "CURSOR %s अपरिभाषित है"
        spa "CURSOR indefinido: %s"
ER_SP_CURSOR_ALREADY_OPEN 24000 
        chi "Cursor已经打开"
        eng "Cursor is already open"
        ger "Cursor ist schon geöffnet"
        hindi "CURSOR पहले से ही खुला है"
        spa "Cursor ya abierto"
ER_SP_CURSOR_NOT_OPEN 24000 
        chi "Cursor未打开"
        eng "Cursor is not open"
        ger "Cursor ist nicht geöffnet"
        spa "Cursor no abierto"
ER_SP_UNDECLARED_VAR 42000 
        chi "未定义的变量:%s"
        eng "Undeclared variable: %s"
        ger "Nicht deklarierte Variable: %s"
        spa "Variable sin declarar: %s"
ER_SP_WRONG_NO_OF_FETCH_ARGS  
        chi "FETCH变量数不正确"
        eng "Incorrect number of FETCH variables"
        ger "Falsche Anzahl von FETCH-Variablen"
        spa "Incorrecto número de variables FETCH"
ER_SP_FETCH_NO_DATA 02000 
        chi "没有数据 - 零行被选择或处理"
        eng "No data - zero rows fetched, selected, or processed"
        ger "Keine Daten - null Zeilen geholt (fetch), ausgewählt oder verarbeitet"
        spa "No hay datos - cero filas logradas, seleccionadas o procesadas"
ER_SP_DUP_PARAM 42000 
        chi "重复参数:%s"
        eng "Duplicate parameter: %s"
        ger "Doppelter Parameter: %s"
        spa "Parámetro duplicado: %s"
ER_SP_DUP_VAR 42000 
        chi "重复变量:%s"
        eng "Duplicate variable: %s"
        ger "Doppelte Variable: %s"
        spa "Variable duplicada: %s"
ER_SP_DUP_COND 42000 
        chi "重复条件:%s"
        eng "Duplicate condition: %s"
        ger "Doppelte Bedingung: %s"
        spa "Condición duplicada: %s"
ER_SP_DUP_CURS 42000 
        chi "重复Cursor:%s"
        eng "Duplicate cursor: %s"
        ger "Doppelter Cursor: %s"
        spa "Cursor duplicado: %s"
ER_SP_CANT_ALTER  
        chi "未能ALTER %s%s"
        eng "Failed to ALTER %s %s"
        ger "ALTER %s %s fehlgeschlagen"
        hindi "%s %s को ALTER करने में असफल रहे"
        spa "Fallo en ALTER %s %s"
ER_SP_SUBSELECT_NYI 0A000 
        chi "不支持子查询值"
        eng "Subquery value not supported"
        ger "Subquery-Wert wird nicht unterstützt"
        spa "Valor de Subconsulta (subquery) no soportado"
ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 0A000
        chi "在存储的函数或触发中不允许%s"
        eng "%s is not allowed in stored function or trigger"
        ger "%s ist in gespeicherten Funktionen und in Triggern nicht erlaubt"
        spa "%s no permitido en función almacenada o en disparador"
ER_SP_VARCOND_AFTER_CURSHNDLR 42000 
        chi "变量或条件声明在cursor或处理程序定义之后"
        eng "Variable or condition declaration after cursor or handler declaration"
        ger "Deklaration einer Variablen oder einer Bedingung nach der Deklaration eines Cursors oder eines Handlers"
        spa "Declaración de variable o condición tras declaración de cursor o manejador"
ER_SP_CURSOR_AFTER_HANDLER 42000 
        chi "处理程序声明后的cursor声明"
        eng "Cursor declaration after handler declaration"
        ger "Deklaration eines Cursors nach der Deklaration eines Handlers"
        spa "Declaración de cursor tras declaración de manejador"
ER_SP_CASE_NOT_FOUND 20000 
        chi "未能在CASE语句找到Case"
        eng "Case not found for CASE statement"
        ger "Fall für CASE-Anweisung nicht gefunden"
        spa "Caso no hallado para sentencia CASE"
ER_FPARSER_TOO_BIG_FILE  
        chi "配置文件'%-.192s'太大了"
        eng "Configuration file '%-.192s' is too big"
        ger "Konfigurationsdatei '%-.192s' ist zu groß"
        rus "Слишком большой конфигурационный файл '%-.192s'"
        spa "El fichero/archivo de configuración '%-.192s' es demasiado grande"
        ukr "Занадто великий конфігураційний файл '%-.192s'"
ER_FPARSER_BAD_HEADER  
        chi "文件'%-.192s'中的文件类型格式有问题"
        eng "Malformed file type header in file '%-.192s'"
        ger "Nicht wohlgeformter Dateityp-Header in Datei '%-.192s'"
        rus "Неверный заголовок типа файла '%-.192s'"
        spa "Cabecera de tipo de fichero/archivo malformada en fichero/archivo '%-.192s'"
        ukr "Невірний заголовок типу у файлі '%-.192s'"
ER_FPARSER_EOF_IN_COMMENT  
        chi "解析评论'%-.200s'时意外碰到EOF"
        eng "Unexpected end of file while parsing comment '%-.200s'"
        ger "Unerwartetes Dateiende beim Parsen des Kommentars '%-.200s'"
        rus "Неожиданный конец файла в коментарии '%-.200s'"
        spa "Inesperado fin de fichero/archivo mientras se analizaba comentario '%-.200s'"
        ukr "Несподіванний кінець файлу у коментарі '%-.200s'"
ER_FPARSER_ERROR_IN_PARAMETER  
        chi "解析参数'%-.192s'时出错(行:'%-.192s')"
        eng "Error while parsing parameter '%-.192s' (line: '%-.192s')"
        ger "Fehler beim Parsen des Parameters '%-.192s' (Zeile: '%-.192s')"
        rus "Ошибка при распознавании параметра '%-.192s' (строка: '%-.192s')"
        spa "Error mientras se analizaba parámetro '%-.192s' (línea: '%-.192s')"
        ukr "Помилка в роспізнаванні параметру '%-.192s' (рядок: '%-.192s')"
ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER  
        chi "跳过未知参数'%-.192s'时意外碰到EOF"
        eng "Unexpected end of file while skipping unknown parameter '%-.192s'"
        ger "Unerwartetes Dateiende beim Überspringen des unbekannten Parameters '%-.192s'"
        rus "Неожиданный конец файла при пропуске неизвестного параметра '%-.192s'"
        spa "Inesperado fin de fichero/archivo mientras se saltaba parámetro desconocido '%-.192s'"
        ukr "Несподіванний кінець файлу у спробі проминути невідомий параметр '%-.192s'"
ER_VIEW_NO_EXPLAIN  
        chi "ANALYZE/EXPLAIN/SHOW无法进行;缺乏底层表的特权"
        eng "ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table"
        ger "ANALYZE/EXPLAIN/SHOW kann nicht verlangt werden. Rechte für zugrunde liegende Tabelle fehlen"
        rus "ANALYZE/EXPLAIN/SHOW не может быть выполнено; недостаточно прав на таблицы запроса"
        spa "ANALYZE/EXPLAIN/SHOW no puede ser emitdo; privilegios insuficientes para tabla subyacente"
        ukr "ANALYZE/EXPLAIN/SHOW не може бути виконано; немає прав на таблиці запиту"
ER_FRM_UNKNOWN_TYPE  
        chi "文件'%-.192s'在其标题中有未知的'%-.64s'"
        eng "File '%-.192s' has unknown type '%-.64s' in its header"
        ger "Datei '%-.192s' hat unbekannten Typ '%-.64s' im Header"
        rus "Файл '%-.192s' содержит неизвестный тип '%-.64s' в заголовке"
        spa "El fichero/archivo '%-.192s' es de un tipo desconocido '%-.64s' en su cabecera"
        ukr "Файл '%-.192s' має невідомий тип '%-.64s' у заголовку"
ER_WRONG_OBJECT  
        chi "'%-.192s.%-.192s'不是'%s'类"
        eng "'%-.192s.%-.192s' is not of type '%s'"
        ger "'%-.192s.%-.192s' ist nicht %s"
        rus "'%-.192s.%-.192s' - не %s"
        spa "'%-.192s.%-.192s' no es del tipo '%s'"
        ukr "'%-.192s.%-.192s' не є %s"
ER_NONUPDATEABLE_COLUMN  
        chi "列'%-.192s'不可更新"
        eng "Column '%-.192s' is not updatable"
        ger "Feld '%-.192s' ist nicht aktualisierbar"
        rus "Столбец '%-.192s' не обновляемый"
        spa "La columna '%-.192s' no es actualiable"
        ukr "Стовбець '%-.192s' не може бути зминений"
ER_VIEW_SELECT_DERIVED  
        chi "View的Select的FROM包含子查询"
        eng "View's SELECT contains a subquery in the FROM clause"
        ger "SELECT der View enthält eine Subquery in der FROM-Klausel"
        rus "View SELECT содержит подзапрос в конструкции FROM"
        spa "El SELECT de la vista contiene una subconsulta (subquery) en la cláusula FROM"
        ukr "View SELECT має підзапит у конструкції FROM"

# Not used any more, syntax error is returned instead
ER_VIEW_SELECT_CLAUSE  
        chi "View的Select包含“%s”子句"
        eng "View's SELECT contains a '%s' clause"
        ger "SELECT der View enthält eine '%s'-Klausel"
        rus "View SELECT содержит конструкцию '%s'"
        spa "El SELECT de la vista contiene una cláusula '%s'"
        ukr "View SELECT має конструкцію '%s'"
ER_VIEW_SELECT_VARIABLE  
        chi "View的选择包含变量或参数"
        eng "View's SELECT contains a variable or parameter"
        ger "SELECT der View enthält eine Variable oder einen Parameter"
        rus "View SELECT содержит переменную или параметр"
        spa "El SELECT de la vista contiene una variable o un parámetro"
        ukr "View SELECT має зминну або параметер"
ER_VIEW_SELECT_TMPTABLE  
        chi "View的SELECT指的是临时表'%-.192s'"
        eng "View's SELECT refers to a temporary table '%-.192s'"
        ger "SELECT der View verweist auf eine temporäre Tabelle '%-.192s'"
        rus "View SELECT содержит ссылку на временную таблицу '%-.192s'"
        spa "El SELECT de la vista se refiere a una tabla temporal '%-.192s'"
        ukr "View SELECT використовує тимчасову таблицю '%-.192s'"
ER_VIEW_WRONG_LIST  
        chi "View的选择和VIEW的字段列表具有不同的列计数"
        eng "View's SELECT and view's field list have different column counts"
        ger "SELECT- und Feldliste der Views haben unterschiedliche Anzahlen von Spalten"
        rus "View SELECT и список полей view имеют разное количество столбцов"
        spa "El SELECT de la vista y la lista de campos de la vista tienen un contador diferente de columnas"
        ukr "View SELECT і перелік стовбців view мають різну кількість сковбців"
ER_WARN_VIEW_MERGE  
        chi "View合并算法目前不能使用(假设未定义的算法)"
        eng "View merge algorithm can't be used here for now (assumed undefined algorithm)"
        ger "View-Merge-Algorithmus kann hier momentan nicht verwendet werden (undefinierter Algorithmus wird angenommen)"
        rus "Алгоритм слияния view не может быть использован сейчас (алгоритм будет неопеределенным)"
        spa "El algoritmo de fusión de la vista no se puede usar aquí por ahora (se asume algoritmo indefinido)"
        ukr "Алгоритм зливання view не може бути використаний зараз (алгоритм буде невизначений)"
ER_WARN_VIEW_WITHOUT_KEY  
        chi "更新的视图没有底层表的完整键"
        eng "View being updated does not have complete key of underlying table in it"
        ger "Die aktualisierte View enthält nicht den vollständigen Schlüssel der zugrunde liegenden Tabelle"
        rus "Обновляемый view не содержит ключа использованных(ой) в нем таблиц(ы)"
        spa "La vista que se está actualizando no tiene clave completa de la tabla subyacente que contiene"
        ukr "View, що оновлюеться, не містить повного ключа таблиці(ь), що викорістана в ньюому"
ER_VIEW_INVALID  
        chi "View'%-.192s.%-.192s'引用无效的表、列、函数、或者函数或View缺乏使用权"
        eng "View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them"
        spa "La vista '%-.192s.%-.192s' hace referencia a tabla(s) o columna(s) o función(es) inválida(s) o al definidor/invocador de vista le faltan derechos para usarlos"
ER_SP_NO_DROP_SP  
        chi "无法从另一个存储的例程中删除或更改%s"
        eng "Can't drop or alter a %s from within another stored routine"
        ger "Kann eine %s nicht von innerhalb einer anderen gespeicherten Routine löschen oder ändern"
        spa "No puedo eliminar o alterar una %s desde dentro de otra rutina almacenada"
ER_SP_GOTO_IN_HNDLR  
        chi "在存储过程处理程序中不允许GOTO"
        eng "GOTO is not allowed in a stored procedure handler"
        ger "GOTO ist im Handler einer gespeicherten Prozedur nicht erlaubt"
        spa "GOTO no permitido en manejador de procedimiento almacenado"
ER_TRG_ALREADY_EXISTS  
        chi "触发'%s'已经存在"
        eng "Trigger '%s' already exists"
        ger "Trigger '%s' existiert bereits"
        hindi "TRIGGER '%s' पहले से मौजूद है"
        spa "Ya existe el disparador `%s`"
ER_TRG_DOES_NOT_EXIST  
        chi "触发不存在"
        eng "Trigger does not exist"
        ger "Trigger existiert nicht"
        hindi "TRIGGER मौजूद नहीं है"
        spa "El disparador no existe"
ER_TRG_ON_VIEW_OR_TEMP_TABLE  
        chi "触发器的'%-.192s'是视图或临时表"
        eng "Trigger's '%-.192s' is a view, temporary table or sequence"
        ger "'%-.192s' des Triggers ist ein View, temporäre Tabelle oder Sequence"
        spa "El disparador '%-.192s' es una vista, tabla temporal o secuencia"
        hindi "Trigger का '%-.192s' एक व्यू, टेम्पररी टेबल या सीक्वेंस है"
ER_TRG_CANT_CHANGE_ROW  
        chi "更新%s行在%s触发器中不允许"
        eng "Updating of %s row is not allowed in %strigger"
        ger "Aktualisieren einer %s-Zeile ist in einem %s-Trigger nicht erlaubt"
        spa "Actualizar la fila %s no está permitido en disparador %s"
ER_TRG_NO_SUCH_ROW_IN_TRG  
        chi "没有%s行,触发%s"
        eng "There is no %s row in %s trigger"
        ger "Es gibt keine %s-Zeile im %s-Trigger"
        spa "No hay fila %s en disparador %s"
ER_NO_DEFAULT_FOR_FIELD  
        chi "字段'%-.192s'没有默认值"
        eng "Field '%-.192s' doesn't have a default value"
        ger "Feld '%-.192s' hat keinen Vorgabewert"
        spa "El campo '%-.192s' no tiene un valor por defecto"
ER_DIVISION_BY_ZERO 22012 
        chi "除0错误"
        eng "Division by 0"
        ger "Division durch 0"
        hindi "0 से विभाजन"
        spa "División por 0"
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD  22007
        chi "不正确的%-.32s值:'%-.128T'用于列`%.192s`%.192s`%.192s`在%lu行"
        eng "Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %lu"
        ger "Falscher %-.32s-Wert: '%-.128T' für Feld '`%.192s`.`%.192s`.`%.192s` in Zeile %lu"
        spa "Incorrecto %-.32s valor: '%-.128T' para columna `%.192s`.`%.192s`.`%.192s` en la fila %lu"
ER_ILLEGAL_VALUE_FOR_TYPE 22007 
        chi "在解析期间发现的非法%s '%-.192T'值"
        eng "Illegal %s '%-.192T' value found during parsing"
        ger "Nicht zulässiger %s-Wert '%-.192T' beim Parsen gefunden"
        spa "Hallado valor ilegal %s '%-.192T' durante el análisi"
ER_VIEW_NONUPD_CHECK  
        chi "在不可更新的视图%`-.192s.%`-.192s上CHECK OPTION"
        eng "CHECK OPTION on non-updatable view %`-.192s.%`-.192s"
        ger "CHECK OPTION auf nicht-aktualisierbarem View %`-.192s.%`-.192s"
        rus "CHECK OPTION для необновляемого VIEW %`-.192s.%`-.192s"
        spa "CHECK OPTION en vista no actualizable %`-.192s.%`-.192s"
        ukr "CHECK OPTION для VIEW %`-.192s.%`-.192s що не може бути оновленним"
ER_VIEW_CHECK_FAILED 44000
        chi "CHECK OPTION失败%`-.192s.%`-.192s"
        eng "CHECK OPTION failed %`-.192s.%`-.192s"
        ger "CHECK OPTION fehlgeschlagen: %`-.192s.%`-.192s"
        rus "Проверка CHECK OPTION для VIEW %`-.192s.%`-.192s провалилась"
        spa "CHECK OPTION falló %`-.192s.%`-.192s"
        ukr "Перевірка CHECK OPTION для VIEW %`-.192s.%`-.192s не пройшла"
ER_PROCACCESS_DENIED_ERROR 42000 
        chi "%-.32s命令被拒绝。用户为'%s'@'%s' 例程'%-.192s'"
        eng "%-.32s command denied to user '%s'@'%s' for routine '%-.192s'"
        ger "Befehl %-.32s nicht zulässig für Benutzer '%s'@'%s' in Routine '%-.192s'"
        spa "Comando %-.32s denegado para el usuario '%s'@'%s' para rutina '%-.192s'"
ER_RELAY_LOG_FAIL  
        chi "清除旧继relay日志失败:%s"
        eng "Failed purging old relay logs: %s"
        ger "Bereinigen alter Relais-Logs fehlgeschlagen: %s"
        spa "Falló la purga de viejos historiales (logs) de reenvío: %s"
ER_PASSWD_LENGTH  
        chi "密码哈希应该是一个%d-digit十六进制数"
        eng "Password hash should be a %d-digit hexadecimal number"
        ger "Passwort-Hash sollte eine Hexdaezimalzahl mit %d Stellen sein"
        spa "El valor calculado de la contraseña debería de ser un número hexadecimal de %d-dígitos"
ER_UNKNOWN_TARGET_BINLOG  
        chi "在Binlog索引中找不到目标日志"
        eng "Target log not found in binlog index"
        ger "Ziel-Log im Binlog-Index nicht gefunden"
        spa "Historial (log) de destino no hallado en índice binlog"
ER_IO_ERR_LOG_INDEX_READ  
        chi "读取日志索引文件时I/O错误"
        eng "I/O error reading log index file"
        ger "Fehler beim Lesen der Log-Index-Datei"
        spa "Error de E/S leyendo fichero/archivo índice de historial (log)"
ER_BINLOG_PURGE_PROHIBITED  
        chi "服务器配置不允许Binlog清除"
        eng "Server configuration does not permit binlog purge"
        ger "Server-Konfiguration erlaubt keine Binlog-Bereinigung"
        spa "La configuración del servidor no permite purgar binlog"
ER_FSEEK_FAIL  
        chi "fseek()失败"
        eng "Failed on fseek()"
        ger "fseek() fehlgeschlagen"
        hindi "fseek() विफल रहा"
        spa "Fallo en fseek()"
ER_BINLOG_PURGE_FATAL_ERR  
        chi "日志清除期间的致命错误"
        eng "Fatal error during log purge"
        ger "Schwerwiegender Fehler bei der Log-Bereinigung"
        spa "Error fatal durante la purga del historial (log)"
ER_LOG_IN_USE  
        chi "日志在用,不会清除"
        eng "A purgeable log is in use, will not purge"
        ger "Ein zu bereinigendes Log wird gerade benutzt, daher keine Bereinigung"
        spa "Se encuentra en uso un historial purgable, no lo purgaré"
ER_LOG_PURGE_UNKNOWN_ERR  
        chi "日志清除期间未知错误"
        eng "Unknown error during log purge"
        ger "Unbekannter Fehler bei Log-Bereinigung"
        spa "Error desconocido durante la purga del historial (log)"
ER_RELAY_LOG_INIT  
        chi "初始化relay日志失败。位置:%s"
        eng "Failed initializing relay log position: %s"
        ger "Initialisierung der Relais-Log-Position fehlgeschlagen: %s"
        spa "Fallo inicializando la posición del historial de reenvío: %s"
ER_NO_BINARY_LOGGING  
        chi "您不使用二进制日志记录"
        eng "You are not using binary logging"
        ger "Sie verwenden keine Binärlogs"
        spa "No está usando historial (log) binario"
ER_RESERVED_SYNTAX  
        chi "'%-.64s'语法保留用于MariaDB服务器内部"
        eng "The '%-.64s' syntax is reserved for purposes internal to the MariaDB server"
        ger "Die Schreibweise '%-.64s' ist für interne Zwecke des MariaDB-Servers reserviert"
        spa "La sintaxis '%-.64s' está reservada para propósitos internos del servidor MariaDB"
ER_WSAS_FAILED  
        chi "WSAStartup失败了"
        eng "WSAStartup Failed"
        ger "WSAStartup fehlgeschlagen"
        spa "Falló WSAStartup"
ER_DIFF_GROUPS_PROC  
        chi "无法处理具有不同组的过程"
        eng "Can't handle procedures with different groups yet"
        ger "Kann Prozeduren mit unterschiedlichen Gruppen noch nicht verarbeiten"
        spa "No puedo manejar procedimientos con grupos diferentes, aún"
ER_NO_GROUP_FOR_PROC  
        chi "SELECT必须具有此过程的组"
        eng "Select must have a group with this procedure"
        ger "SELECT muss bei dieser Prozedur ein GROUP BY haben"
        spa "La selección debe de tener un grupo con este procedimiento"
ER_ORDER_WITH_PROC  
        chi "无法在次存储过程使用ORDER子句"
        eng "Can't use ORDER clause with this procedure"
        ger "Kann bei dieser Prozedur keine ORDER-BY-Klausel verwenden"
        spa "No puedo usar la cláusula ORDER con este procedimiento"
ER_LOGGING_PROHIBIT_CHANGING_OF  
        chi "二进制日志记录和复制禁止更改全局服务器%s"
        eng "Binary logging and replication forbid changing the global server %s"
        ger "Binärlogs und Replikation verhindern Wechsel des globalen Servers %s"
        spa "El historial (log) binario y la réplica prohibe cambiar el servidor global %s"
ER_NO_FILE_MAPPING  
        chi "无法映射文件:%-.200s,错误号码:%M"
        eng "Can't map file: %-.200s, errno: %M"
        ger "Kann Datei nicht abbilden: %-.200s, Fehler: %M"
        spa "No puedo mapear fichero/archivo: %-.200s, error: %M"
ER_WRONG_MAGIC  
        chi "魔法错误%-.64s"
        eng "Wrong magic in %-.64s"
        ger "Falsche magische Zahlen in %-.64s"
        spa "Magia equivocada en %-.64s"
ER_PS_MANY_PARAM  
        chi "Prepared statement包含太多占位符"
        eng "Prepared statement contains too many placeholders"
        ger "Vorbereitete Anweisung enthält zu viele Platzhalter"
        spa "Sentencia preparada contiene demasiados marcadores de posición"
ER_KEY_PART_0  
        chi "索引部分'%-.192s'长度不能为0"
        eng "Key part '%-.192s' length cannot be 0"
        ger "Länge des Schlüsselteils '%-.192s' kann nicht 0 sein"
        spa "El tamaño de trozo de clave '%-.192s' no puede ser 0"
ER_VIEW_CHECKSUM  
        chi "查看文本checksum失败"
        eng "View text checksum failed"
        ger "View-Text-Prüfsumme fehlgeschlagen"
        rus "Проверка контрольной суммы текста VIEW провалилась"
        spa "Ha fallado la suma de comprobación del texto de la vista"
        ukr "Перевірка контрольної суми тексту VIEW не пройшла"
ER_VIEW_MULTIUPDATE  
        chi "无法通过JOIN视图'%-.192s.%-.192s'修改多个基础表。"
        eng "Can not modify more than one base table through a join view '%-.192s.%-.192s'"
        ger "Kann nicht mehr als eine Basistabelle über Join-View '%-.192s.%-.192s' ändern"
        rus "Нельзя изменить больше чем одну базовую таблицу используя многотабличный VIEW '%-.192s.%-.192s'"
        spa "No puedo modificar más de una tabla base a través de una vista de unión '%-.192s.%-.192s'"
        ukr "Неможливо оновити більш ниж одну базову таблицю выкористовуючи VIEW '%-.192s.%-.192s', що містіть декілька таблиць"
ER_VIEW_NO_INSERT_FIELD_LIST  
        chi "无法写入JOIN视图'%-.192s.%-.192s'没有字段列表"
        eng "Can not insert into join view '%-.192s.%-.192s' without fields list"
        ger "Kann nicht ohne Feldliste in Join-View '%-.192s.%-.192s' einfügen"
        rus "Нельзя вставлять записи в многотабличный VIEW '%-.192s.%-.192s' без списка полей"
        spa "No puedo insertar dentro de vista de unión '%-.192s.%-.192s' sin lista de campos"
        ukr "Неможливо уставити рядки у VIEW '%-.192s.%-.192s', що містить декілька таблиць, без списку стовбців"
ER_VIEW_DELETE_MERGE_VIEW  
        chi "无法从JOIN视图'%-.192s.%-.192s'删除"
        eng "Can not delete from join view '%-.192s.%-.192s'"
        ger "Kann nicht aus Join-View '%-.192s.%-.192s' löschen"
        rus "Нельзя удалять из многотабличного VIEW '%-.192s.%-.192s'"
        spa "No puedo borrar desde vista de unión '%-.192s.%-.192s'"
        ukr "Неможливо видалити рядки у VIEW '%-.192s.%-.192s', що містить декілька таблиць"
ER_CANNOT_USER  
        chi "操作%s失败%.256s"
        eng "Operation %s failed for %.256s"
        ger "Operation %s schlug fehl für %.256s"
        norwegian-ny "Operation %s failed for '%.256s'"
        spa "Ha fallado la operación %s para %.256s"
ER_XAER_NOTA XAE04
        chi "XAER_NOTA:未知的XID"
        eng "XAER_NOTA: Unknown XID"
        ger "XAER_NOTA: Unbekannte XID"
        spa "XAER_NOTA: XID desconocido"
ER_XAER_INVAL XAE05
        chi "XAER_INVAL:无效的参数(或不支持的命令)"
        eng "XAER_INVAL: Invalid arguments (or unsupported command)"
        ger "XAER_INVAL: Ungültige Argumente (oder nicht unterstützter Befehl)"
        spa "XAER_INVAL: Argumentos inválidos (o comando no soportado)"
ER_XAER_RMFAIL XAE07
        chi "XAER_RMFAIL:当全局事务处于%.64s状态时,无法执行该命令"
        eng "XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s state"
        ger "XAER_RMFAIL: DEr Befehl kann nicht ausgeführt werden, wenn die globale Transaktion im Zustand %.64s ist"
        rus "XAER_RMFAIL: эту команду нельзя выполнять когда глобальная транзакция находится в состоянии '%.64s'"
        spa "XAER_RMFAIL: El comando no se puede ejecutar cuando la transacción global se encuentra en estado %.64s"
ER_XAER_OUTSIDE XAE09
        chi "XAER_OUTSIDE:一些工作是在全局交易之外完成的"
        eng "XAER_OUTSIDE: Some work is done outside global transaction"
        ger "XAER_OUTSIDE: Einige Arbeiten werden außerhalb der globalen Transaktion verrichtet"
        spa "XAER_OUTSIDE: Algún trabajo se ha realizado fuera de la transacción global"
ER_XAER_RMERR XAE03
        chi "XAER_RMERR:事务分支中发生致命错误 - 检查您的数据以获得一致性"
        eng "XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency"
        ger "XAER_RMERR: Schwerwiegender Fehler im Transaktionszweig - prüfen Sie Ihre Daten auf Konsistenz"
        spa "XAER_RMERR: Ha ocurrido un error fatal en la rama de la transacción - revise la consitencia de sus datos"
ER_XA_RBROLLBACK XA100
        chi "XA_RBROLBACK:交易分支回滚"
        eng "XA_RBROLLBACK: Transaction branch was rolled back"
        ger "XA_RBROLLBACK: Transaktionszweig wurde zurückgerollt"
        spa "XA_RBROLLBACK: La rama de la transacción ha sido retrocedida (rolled back)"
ER_NONEXISTING_PROC_GRANT 42000 
        chi "无授权:用户'%-.48s'主机'%-.64s'ROUTINE'%-.192s'"
        eng "There is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'"
        ger "Es gibt diese Berechtigung für Benutzer '%-.48s' auf Host '%-.64s' für Routine '%-.192s' nicht"
        spa "No existe tal concesión definida para el usuario '%-.48s' en equipo '%-.64s' en rutina '%-.192s'"
ER_PROC_AUTO_GRANT_FAIL
        chi "无法授予EXECUTE和ALTER ROUTINE权限"
        eng "Failed to grant EXECUTE and ALTER ROUTINE privileges"
        ger "Gewährung von EXECUTE- und ALTER-ROUTINE-Rechten fehlgeschlagen"
        spa "Fallo al conceder privilegios de EXECUTE y ALTER ROUTINE"
ER_PROC_AUTO_REVOKE_FAIL
        chi "无法撤消所有权限以删除例程"
        eng "Failed to revoke all privileges to dropped routine"
        ger "Rücknahme aller Rechte für die gelöschte Routine fehlgeschlagen"
        spa "Fallo al rescindir todos los privilegios de la rutina anulada"
ER_DATA_TOO_LONG 22001
        chi "列'%s'行%lu数据太长"
        eng "Data too long for column '%s' at row %lu"
        ger "Daten zu lang für Feld '%s' in Zeile %lu"
        spa "Datos demasiado largos para la columna '%s' en la fila %lu"
ER_SP_BAD_SQLSTATE 42000
        chi "坏SQLSTATE:'%s'"
        eng "Bad SQLSTATE: '%s'"
        ger "Ungültiger SQLSTATE: '%s'"
        spa "Mal SQLSTATE: '%s'"
ER_STARTUP
        chi "%s:已经准备好接受连接\nVersion:'%s'套接字:'%s'端口:%d %s"
        eng "%s: ready for connections.\nVersion: '%s'  socket: '%s'  port: %d  %s"
        ger "%s: bereit für Verbindungen.\nVersion: '%s'  Socket: '%s'  Port: %d  %s"
        spa "%s: preparada para conexiones.\nVersión: '%s' conector: '%s' puerto: %d  %s"
ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR
        chi "无法从带有固定大小行的文件中加载值到变量"
        eng "Can't load value from file with fixed size rows to variable"
        ger "Kann Wert aus Datei mit Zeilen fester Größe nicht in Variable laden"
        spa "No puedo cargar valor desde fichero/archivo con filas de tamaño fijo en variable"
ER_CANT_CREATE_USER_WITH_GRANT 42000
        chi "您不允许使用创建用户时给予GRANT"
        eng "You are not allowed to create a user with GRANT"
        ger "Sie dürfen keinen Benutzer mit GRANT anlegen"
        spa "No está autorizado a crear un usuario con GRANT"
ER_WRONG_VALUE_FOR_TYPE  
        chi "不正确的%-.32s值:'%-.128T' 函数:%-.32s"
        eng "Incorrect %-.32s value: '%-.128T' for function %-.32s"
        ger "Falscher %-.32s-Wert: '%-.128T' für Funktion %-.32s"
        spa "Incorrecto valor %-.32s: '%-.128T' para la función %-.32s"
ER_TABLE_DEF_CHANGED
        chi "表定义已更改,请重试"
        eng "Table definition has changed, please retry transaction"
        ger "Tabellendefinition wurde geändert, bitte starten Sie die Transaktion neu"
        spa "Ha cambiado la definición de la tabla, por favor reintente la transacción"
ER_SP_DUP_HANDLER 42000
        chi "在同一块中声明的处理程序重复"
        eng "Duplicate handler declared in the same block"
        ger "Doppelter Handler im selben Block deklariert"
        spa "Manejador duplicado declarado en mismo bloque"
ER_SP_NOT_VAR_ARG 42000
        chi "OUT或INOUT参数%d 例程 %s的不是BEFORE触发器里的变量或新伪变量"
        eng "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger"
        ger "OUT- oder INOUT-Argument %d für Routine %s ist keine Variable"
        spa "El argumento %d OUT o INOUT para la rutina %s no es una variable o pseudo-variable NEW en disparador BEFORE"
ER_SP_NO_RETSET 0A000
        chi "不允许从%s返回结果集"
        eng "Not allowed to return a result set from a %s"
        ger "Rückgabe einer Ergebnismenge aus einer %s ist nicht erlaubt"
        spa "No autorizado a devolver un conjunto de resultados desde un %s"
ER_CANT_CREATE_GEOMETRY_OBJECT 22003 
        chi "无法从发送到几何字段的数据中获取几何对象"
        eng "Cannot get geometry object from data you send to the GEOMETRY field"
        ger "Kann kein Geometrieobjekt aus den Daten machen, die Sie dem GEOMETRY-Feld übergeben haben"
        spa "No puedo obtener objeto de geometría desde los datos que vd envía al campo GEOMETRY"
ER_FAILED_ROUTINE_BREAK_BINLOG
        chi "ROUTINE失败,定义中既没有NO SQL也没有READ SQL DAT。启用二进制日志记录;如果更新非事务性表,则二进制日志将会错过其更改"
        eng "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes"
        ger "Eine Routine, die weder NO SQL noch READS SQL DATA in der Deklaration hat, schlug fehl und Binärlogging ist aktiv. Wenn Nicht-Transaktions-Tabellen aktualisiert wurden, enthält das Binärlog ihre Änderungen nicht"
        spa "Ha fallado una rutina y no tiene ni NO SQL ni READS SQL DATA en su declaración y el historial (log) binario se encuentra activado; si han sido actualizadas tablas no transaccionales, el fichero/archivo binario de historial (log) perderá sus cambios"
ER_BINLOG_UNSAFE_ROUTINE
        chi "此函数定义中没有DETERMINISTIC,NO SQL,或者READS SQL DATA,并且已启用二进制日志记录(您*可能*希望使用较少的安全性的log_bin_trust_function_creators变量)"
        eng "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)"
        ger "Diese Routine hat weder DETERMINISTIC, NO SQL noch READS SQL DATA in der Deklaration und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_function_creators verwenden)"
        spa "Esta función no tiene ninguno de DETERMINISTIC, NO SQL o READS SQL DATA en su declaración y está activado el historial binario (vd *podría* querer usar la variable menos segura log_bin_trust_function_creators)"
ER_BINLOG_CREATE_ROUTINE_NEED_SUPER
        chi "您没有超级特权和二进制日志记录已启用(您*可能*想要使用较少的安全log_bin_trust_function_creators变量)"
        eng "You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)"
        ger "Sie haben keine SUPER-Berechtigung und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_function_creators verwenden)"
        spa "No tiene el privilegio SUPER y está activado el historial binario (*podría* querer usar la variable menos segura log_bin_trust_function_creators)"
ER_EXEC_STMT_WITH_OPEN_CURSOR
        chi "您无法执行具有与之关联的打开Cursor的prepared statement。重置语句以重新执行它"
        eng "You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it"
        ger "Sie können keine vorbereitete Anweisung ausführen, die mit einem geöffneten Cursor verknüpft ist. Setzen Sie die Anweisung zurück, um sie neu auszuführen"
        spa "No puede ejecutar una sentencia preparada que tiene abierto un cursor asociado con ella. Renueve la sentencia para re-ejecutarla"
ER_STMT_HAS_NO_OPEN_CURSOR
        chi "语句(%lu)没有开放的Cursor"
        eng "The statement (%lu) has no open cursor"
        ger "Die Anweisung (%lu) hat keinen geöffneten Cursor"
        spa "La sentencia (%lu) no tiene cursor abierto"
ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
        chi "在存储的函数或触发器中不允许显式或隐式提交"
        eng "Explicit or implicit commit is not allowed in stored function or trigger"
        ger "Explizites oder implizites Commit ist in gespeicherten Funktionen und in Triggern nicht erlaubt"
        spa "Comisión (commit) implícita o explícita no permitida en funciones almacenadas o en disparadores"
ER_NO_DEFAULT_FOR_VIEW_FIELD
        chi "VIEW的列'%-.192s.%-.192s'底层表没有默认值"
        eng "Field of view '%-.192s.%-.192s' underlying table doesn't have a default value"
        ger "Ein Feld der dem View '%-.192s.%-.192s' zugrundeliegenden Tabelle hat keinen Vorgabewert"
        spa "El campo de tabla subyacente de vista '%-.192s.%-.192s' no tiene valor por defecto"
ER_SP_NO_RECURSION
        chi "不允许递归存储功能和触发器"
        eng "Recursive stored functions and triggers are not allowed"
        ger "Rekursive gespeicherte Routinen und Triggers sind nicht erlaubt"
        spa "No autorizadas funciones almacenadas recursivas ni disparadores"
ER_TOO_BIG_SCALE 42000 S1009
        chi "指定的大规模%llu为'%-.192s'。最大是%u"
        eng "Too big scale %llu specified for '%-.192s'. Maximum is %u"
        ger "Zu großer Skalierungsfaktor %llu für '%-.192s' angegeben. Maximum ist %u"
        spa "Escala %llu demasiado grande especificada para '%-.192s'. El máximo es de %u"
ER_TOO_BIG_PRECISION 42000 S1009
        chi "指定的精度%llu太大 '%-.192s'。最大是%u"
        eng "Too big precision %llu specified for '%-.192s'. Maximum is %u"
        ger "Zu große Genauigkeit %llu für '%-.192s' angegeben. Maximum ist %u"
        spa "Precisión %llu demasiado grande especificada para '%-.192s'. El máximo es de %u"
ER_M_BIGGER_THAN_D 42000 S1009
        chi "对于FLOAT(M,D),DOUBLE(M,D)或DECIMAL(M,D),M必须> = D(列'%-.192s')"
        eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')"
        ger "Für FLOAT(M,D), DOUBLE(M,D) oder DECIMAL(M,D) muss M >= D sein (Feld '%-.192s')"
        spa "Para flotante(M,D), doble(M,D) o decimal(M,D), M debe de ser >= D (columna '%-.192s')"
ER_WRONG_LOCK_OF_SYSTEM_TABLE
        chi "您无法将系统表的写入锁定与其他表或锁定类型相结合"
        eng "You can't combine write-locking of system tables with other tables or lock types"
        ger "Sie können Schreibsperren auf der Systemtabelle nicht mit anderen Tabellen kombinieren"
        spa "No puede combinar bloqueo de escritura de tablas de sistema con otras tablas o tipos de bloqueo"
ER_CONNECT_TO_FOREIGN_DATA_SOURCE
        chi "无法连接到外数据源:%.64s"
        eng "Unable to connect to foreign data source: %.64s"
        ger "Kann nicht mit Fremddatenquelle verbinden: %.64s"
        spa "No puedo conectar a fuente foránea de datos: %.64s"
ER_QUERY_ON_FOREIGN_DATA_SOURCE
        chi "处理对外数据源上的查询时出现问题。数据源错误:%-.64s"
        eng "There was a problem processing the query on the foreign data source. Data source error: %-.64s"
        ger "Bei der Verarbeitung der Abfrage ist in der Fremddatenquelle ein Problem aufgetreten. Datenquellenfehlermeldung: %-.64s"
        spa "Hubo un problema procesando la consulta (query) en la fuente foránea de datos. Error de fuente de datos: %-.64s"
ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
        chi "您尝试引用的外数据源不存在。数据源错误:%-.64s"
        eng "The foreign data source you are trying to reference does not exist. Data source error:  %-.64s"
        ger "Die Fremddatenquelle, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung:  %-.64s"
        spa "La fuente foránea de datos que intenta referenciar no existe. Error en fuente de datos:  %-.64s"
ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
        chi "无法创建联合表。数据源连接字符串'%-.64s'不是正确的格式"
        eng "Can't create federated table. The data source connection string '%-.64s' is not in the correct format"
        ger "Kann föderierte Tabelle nicht erzeugen. Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes Format"
        spa "No puedo crear tabla federada. La cadena de conexión de la fuente de datos '%-.64s' no tiene el formato correcto"
ER_FOREIGN_DATA_STRING_INVALID
        chi "数据源连接字符串'%-.64s'不是正确的格式"
        eng "The data source connection string '%-.64s' is not in the correct format"
        ger "Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes Format"
        spa "La cadena de conexón de la fuente de datos '%-.64s' no tiene el formato correcto"
ER_CANT_CREATE_FEDERATED_TABLE  
        chi "无法创建联合表。外数据SRC错误:%-.64s"
        eng "Can't create federated table. Foreign data src error:  %-.64s"
        ger "Kann föderierte Tabelle nicht erzeugen. Fremddatenquellenfehlermeldung:  %-.64s"
        spa "No puedo crear tabla federada. Error en fuente de datos foráneos:  %-.64s"
ER_TRG_IN_WRONG_SCHEMA  
        chi "触发在错的SCHEMA"
        eng "Trigger in wrong schema"
        ger "Trigger im falschen Schema"
        spa "Disparador en esquema equivocado"
ER_STACK_OVERRUN_NEED_MORE
        chi "线程堆栈溢出:%ld字节堆栈的%ld字节,以及所需的%ld字节。使用'mariadbd --thread_stack =#'指定更大的堆栈"
        eng "Thread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable."
        ger "Thread-Stack-Überlauf: %ld Bytes eines %ld-Byte-Stacks in Verwendung, und %ld Bytes benötigt. Verwenden Sie 'mariadbd --thread_stack=#', um einen größeren Stack anzugeben"
        jpn "スレッドスタック不足です(使用: %ld ; サイズ: %ld ; 要求: %ld)。より大きい値で 'mariadbd --thread_stack=#' の指定をしてください。"
        spa "Desbordamiento en pila de hilos (threads): %ld bytes usados de una pila de %ld y son necesarios %ld bytes. Considere el incrementar la variable de sistema --thread_stack=#."
ER_TOO_LONG_BODY 42000 S1009
        chi "'%-.100s”的ROUTINE太长了"
        eng "Routine body for '%-.100s' is too long"
        ger "Routinen-Body für '%-.100s' ist zu lang"
        spa "El cuerpo de rutina para '%-.100s' es demasiado largo"
ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
        chi "无法删除默认索引缓存"
        eng "Cannot drop default keycache"
        ger "Der vorgabemäßige Schlüssel-Cache kann nicht gelöscht werden"
        spa "No puedo eliminar keycache por defecto"
ER_TOO_BIG_DISPLAYWIDTH 42000 S1009
        chi "显示宽度超过'%-.192s'的范围(max =%lu)"
        eng "Display width out of range for '%-.192s' (max = %lu)"
        ger "Anzeigebreite außerhalb des zulässigen Bereichs für '%-.192s' (Maximum = %lu)"
        spa "Ancho a mostrar fuera de rango para '%-.192s' (máx = %lu)"
ER_XAER_DUPID XAE08
        chi "XAER_DUPID:xid已存在"
        eng "XAER_DUPID: The XID already exists"
        ger "XAER_DUPID: Die XID existiert bereits"
        spa "XAER_DUPID: El XID ya existe"
ER_DATETIME_FUNCTION_OVERFLOW 22008
        chi "DateTime函数:%-.32s字段溢出"
        eng "Datetime function: %-.32s field overflow"
        ger "Datetime-Funktion: %-.32s Feldüberlauf"
        spa "Función Datetime: %-.32s desbordamiento de campo"
ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
        chi "在存储的函数/触发器中无法更新表'%-.192s',因为它已被调用此存储的函数/触发器调用的语句"
        eng "Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger"
        ger "Kann Tabelle '%-.192s' in gespeicherter Funktion oder Trigger nicht aktualisieren, weil sie bereits von der Anweisung verwendet wird, die diese gespeicherte Funktion oder den Trigger aufrief"
        spa "No puedo actualizar tabla '%-.192s' en función almacenada/disparador porque ya está siendo usada por la sentencia que invocó esta función almacenada/disparador"
ER_VIEW_PREVENT_UPDATE
        chi "表'%-.192s'的定义可防止在表'%-.192s'上的操作'%-.192s'"
        eng "The definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'"
        ger "Die Definition der Tabelle '%-.192s' verhindert die Operation %-.192s auf Tabelle '%-.192s'"
        spa "La definición de la tabla '%-.192s' previene la operación %-.192s en la tabla '%-.192s'"
ER_PS_NO_RECURSION
        chi "prepared statement包含一个有关该语句的存储例程调用。它不允许以这种递归方式执行prepared statement"
        eng "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner"
        ger "Die vorbereitete Anweisung enthält einen Aufruf einer gespeicherten Routine, die auf eben dieselbe Anweisung verweist. Es ist nicht erlaubt, eine vorbereitete Anweisung in solch rekursiver Weise auszuführen"
        spa "La sentencia preparada contiene una llamada a rutina almacenada que se refiere a esa misma sentencia. No está permitido ejecutar una sentencia preparada de esta manera recursiva"
ER_SP_CANT_SET_AUTOCOMMIT
        chi "不允许从存储的函数或触发器设置自动判处"
        eng "Not allowed to set autocommit from a stored function or trigger"
        ger "Es ist nicht erlaubt, innerhalb einer gespeicherten Funktion oder eines Triggers AUTOCOMMIT zu setzen"
        spa "No permitido usar auto acometida (autocommit) desde una función almacenada o disparador"
ER_MALFORMED_DEFINER 0L000
        chi "无效的定义"
        eng "Invalid definer"
        spa "Definidor inválido"
ER_VIEW_FRM_NO_USER
        chi "VIEW'%-.192s'。'%-.192s'没有绝定的信息(旧表格式)。当前用户用作定义。请重新创建视图!"
        eng "View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!"
        ger "View '%-.192s'.'%-.192s' hat keine Definierer-Information (altes Tabellenformat). Der aktuelle Benutzer wird als Definierer verwendet. Bitte erstellen Sie den View neu"
        spa "La vista '%-.192s'.'%-.192s' no tiene información de definidor (formato viejo de tabla). Se usa el usuario actual como definidor. Por favor, ¡recrea la vista!"
ER_VIEW_OTHER_USER
        chi "您需要使用'%-.192s'@'%-.192s'的创建视图的超级特权"
        eng "You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definer"
        ger "Sie brauchen die SUPER-Berechtigung, um einen View mit dem Definierer '%-.192s'@'%-.192s' zu erzeugen"
        spa "Vd necesita el privilegio SUPER para la creación de la vista con definidor '%-.192s'@'%-.192s'"
ER_NO_SUCH_USER
        chi "指定为定义的用户('%-.64s'@'%-.64s')不存在"
        eng "The user specified as a definer ('%-.64s'@'%-.64s') does not exist"
        ger "Der als Definierer angegebene Benutzer ('%-.64s'@'%-.64s') existiert nicht"
        spa "El usuario especificado como definidor ('%-.64s'@'%-.64s') no existe"
ER_FORBID_SCHEMA_CHANGE
        chi "不允许从'%-.192s'到'%-.192s'的SCHEMA更改"
        eng "Changing schema from '%-.192s' to '%-.192s' is not allowed"
        ger "Wechsel des Schemas von '%-.192s' auf '%-.192s' ist nicht erlaubt"
        spa "Vd no está autorizado a cambiar el esquema de '%-.192s' a '%-.192s'"
ER_ROW_IS_REFERENCED_2 23000
        chi "无法删除或更新父行:外键约束失败(%s)"
        eng "Cannot delete or update a parent row: a foreign key constraint fails (%s)"
        ger "Kann Eltern-Zeile nicht löschen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%s)"
        spa "No puedo borrar o actualizar una fila padre: falla una restricción de clave foránea (%s)"
ER_NO_REFERENCED_ROW_2 23000
        chi "无法添加或更新子行:外键约束失败(%s)"
        eng "Cannot add or update a child row: a foreign key constraint fails (%s)"
        ger "Kann Kind-Zeile nicht hinzufügen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%s)"
        spa "No puedo añadir o actualizar una fila hija: falla una restricción de clave foránea (%s)"
ER_SP_BAD_VAR_SHADOW 42000
        chi "变量'%-.64s'必须用`...`,或重命名"
        eng "Variable '%-.64s' must be quoted with `...`, or renamed"
        ger "Variable '%-.64s' muss mit `...` geschützt oder aber umbenannt werden"
        spa "La variable '%-.64s' debe de ser entrecomillada con `...` o renombrada"
ER_TRG_NO_DEFINER
        chi "触发'%-.192s'的绝对属性。'%-.192s'。触发器将在调用者的授权下激活,该权限可能不足。请重新创建触发器"
        eng "No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger"
        ger "Kein Definierer-Attribut für Trigger '%-.192s'.'%-.192s'. Der Trigger wird mit der Autorisierung des Aufrufers aktiviert, der möglicherweise keine zureichenden Berechtigungen hat. Bitte legen Sie den Trigger neu an"
        spa "No hay atributo de definidor para disparador '%-.192s'.'%-.192s'. El disparador será activado bajo la autorización del invocador, el cual puede tener insuficientes privilegios. Por favor, vuelva a crear el disparador"
ER_OLD_FILE_FORMAT
        chi "'%-.192s'具有旧格式,您应该重新创建'%s'对象"
        eng "'%-.192s' has an old format, you should re-create the '%s' object(s)"
        ger "'%-.192s' hat altes Format, Sie sollten die '%s'-Objekt(e) neu erzeugen"
        spa "'%-.192s' tiene un formato viejo, debería vd de volver a crear el/los objeto(s) '%s'"
ER_SP_RECURSION_LIMIT
        chi "递归限制%d(如max_sp_recursion_depth变量设置)的例程%.192s"
        eng "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s"
        ger "Rekursionsgrenze %d (durch Variable max_sp_recursion_depth gegeben) wurde für Routine %.192s überschritten"
        spa "El límite recursivo %d (según se indica mediante la variable max_sp_recursion_depth) se ha excedido para la rutina %.192s"
ER_SP_PROC_TABLE_CORRUPT
        chi "无法加载常规%-.192s(内部代码%d)。有关更多详细信息,请运行SHOW WARNINGS"
        eng "Failed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGS"
        ger "Routine %-.192s (interner Code %d) konnte nicht geladen werden. Weitere Einzelheiten erhalten Sie, wenn Sie SHOW WARNINGS ausführen"
        ukr "Невдала спроба завантажити процедуру %-.192s (внутрішний код %d). Для отримання детальної інформації використовуйте SHOW WARNINGS"
        spa "No pude cargar la rutina %-.192s (código interno %d). Para más detalles, ejecute SHOW WARNINGS"
ER_SP_WRONG_NAME 42000
        chi "常规名称错误不正确'%-.192s'"
        eng "Incorrect routine name '%-.192s'"
        ger "Ungültiger Routinenname '%-.192s'"
        spa "Nombre incorrecto de rutina '%-.192s'"
ER_TABLE_NEEDS_UPGRADE
        chi "需要升级。请做\"修复%s%`s \"或转储/重新加载以修复!"
        eng "Upgrade required. Please do \"REPAIR %s %`s\" or dump/reload to fix it!"
        ger "Aktualisierung erforderlich. Bitte zum Reparieren \"REPAIR %s %`s\" eingeben!"
        spa "Es necesaria una mejora. Por favor, ¡haga \"REPAIR %s %`s\" o vuelque/recargue para arreglarlo!"
ER_SP_NO_AGGREGATE 42000
        chi "存储函数不支持聚合"
        eng "AGGREGATE is not supported for stored functions"
        ger "AGGREGATE wird bei gespeicherten Funktionen nicht unterstützt"
        spa "AGGREGATE no está soportado en funciones almacenadas"
ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
        chi "无法创建超过max_prepared_stmt_count语句(当前值:%u)"
        eng "Can't create more than max_prepared_stmt_count statements (current value: %u)"
        ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %u)"
        spa "No puedo crear más de max_prepared_stmt_count sentencias (valor en curso: %u)"
ER_VIEW_RECURSIVE
        chi "%`s.%`s包含视图递归"
        eng "%`s.%`s contains view recursion"
        ger "%`s.%`s enthält View-Rekursion"
        spa "`%-.192s`.`%-.192s` contiene recursividad de vista""
ER_NON_GROUPING_FIELD_USED 42000
        chi "非分组字段'%-.192s'用于%-.64s条款"
        eng "Non-grouping field '%-.192s' is used in %-.64s clause"
        ger "In der %-.192s-Klausel wird das die Nicht-Gruppierungsspalte '%-.64s' verwendet"
        spa "No hay campo agrupado '%-.192s' usado en cláusula %-.64s"
ER_TABLE_CANT_HANDLE_SPKEYS
        chi "存储引擎%s不支持SPATIAL索引"
        eng "The storage engine %s doesn't support SPATIAL indexes"
        ger "Der verwendete Tabellentyp (%s) unterstützt keine SPATIAL-Indizes"
        spa "El motor de almacenaje %s no soporta índices SPATIAL"
ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
        chi "无法在系统表上创建触发器"
        eng "Triggers can not be created on system tables"
        ger "Trigger können nicht auf Systemtabellen erzeugt werden"
        spa "Los disparadores no pueden ser creados en las tablas del sistema"
ER_REMOVED_SPACES
        chi "前面的空格从名称'%s'删除"
        eng "Leading spaces are removed from name '%s'"
        ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt"
        spa "Se quitan los espacios iniciales del nombre '%s'"
ER_AUTOINC_READ_FAILED
        chi "无法从存储引擎读取自动增量值"
        eng "Failed to read auto-increment value from storage engine"
        ger "Lesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagen"
        hindi "स्टोरेज इंजन से auto-increment का मान पढ़ने में असफल रहे"
        spa "No pude leer valor de auto-incremento del motor de almacenaje"
ER_USERNAME
        chi "用户名"
        eng "user name"
        ger "Benutzername"
        hindi "यूज़र का नाम"
        spa "nombre de usuario"
ER_HOSTNAME
        chi "主机名"
        eng "host name"
        ger "Hostname"
        hindi "होस्ट का नाम"
        spa "nombre de equipo"
ER_WRONG_STRING_LENGTH
        chi "字符串'%-.70T'对于%s(应不超过%d)太长"
        eng "String '%-.70T' is too long for %s (should be no longer than %d)"
        ger "String '%-.70T' ist zu lang für %s (sollte nicht länger sein als %d)"
        spa "La cadena '%-.70T' es demasiado larga para %s (no debería de ser mayor de %d)"
ER_NON_INSERTABLE_TABLE  
        chi "目标表%-.100s %s不可插入"
        eng "The target table %-.100s of the %s is not insertable-into"
        ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar"
        jpn "対象表 %-.100s は挿入可能ではないので、%s を行えません。"
        spa "La tabla destino %-.100s de la %s no es insertable-dentro"
ER_ADMIN_WRONG_MRG_TABLE
        chi "表'%-.64s'不同定义、或非myisam类型、或不存在"
        eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist"
        ger "Tabelle '%-.64s' ist unterschiedlich definiert, nicht vom Typ MyISAM oder existiert nicht"
        spa "La tabla '%-.64s' está definida de forma diferente o es del tipo no-MyISAM o no existe"
ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
        chi "太高的嵌套SELECT"
        eng "Too high level of nesting for select"
        ger "Zu tief verschachtelte SELECT-Anweisungen"
        spa "Demasiado alto el nivel de anidamiento para la selección"
ER_NAME_BECOMES_EMPTY
        chi "名'%-.64s'已成为''"
        eng "Name '%-.64s' has become ''"
        ger "Name '%-.64s' wurde zu ''"
        spa "El nombre '%-.64s' ha pasado a ser ''"
ER_AMBIGUOUS_FIELD_TERM
        chi "FIELDS TERMINATED字符串的第一个字符是模棱两可的;请使用非空字段FIELDS ENCLOSED BY"
        eng "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"
        ger "Das erste Zeichen der Zeichenkette FIELDS TERMINATED ist mehrdeutig; bitte benutzen Sie nicht optionale und nicht leere FIELDS ENCLOSED BY"
        spa "El primer carácter de la cadena de los FIELDS TERMINATED es ambiguo; por favor, use FIELDS ENCLOSED BY no opcionales y no vacíos"
ER_FOREIGN_SERVER_EXISTS
        chi "无法创建外部服务器'%s',因为它已经存在"
        eng "Cannot create foreign server '%s' as it already exists"
        fin "Vieraata palvelinta '%s' ei voida luoda, koska se on jo olemassa"
        fre "Impossible de créer le serveur étranger '%s' car il existe déjà"
        ger "Der auswärtige Server '%s' kann nicht erstellt werden, da er bereits vorhanden ist"
        greek "Δεν είναι δυνατή η δημιουργία ξένου διακομιστή '%s' επειδή υπάρχει ήδη"
        ita "Impossibile creare il server esterno '%s' poiché esiste già"
        jpn "外部サーバー '%s'は既に存在するため、作成できません"
        nla "Kan geen externe server '%s' maken omdat deze al bestaat"
        nor "Kan ikke opprette utenlandsk server '%s' fordi den allerede eksisterer"
        pol "Nie można utworzyć obcego serwera '%s', ponieważ już istnieje"
        por "Não foi possível criar o servidor externo '%s' porque ele já existe"
        rus "Невозможно создать сторонний сервер '%s', так как он уже существует"
        spa "No se puede crear el servidor externo '%s' porque ya existe"
        swe "Det gick inte att skapa främmande server '%s' eftersom den redan finns"
ER_FOREIGN_SERVER_DOESNT_EXIST
        chi "您尝试引用的外部服务器名称不存在。数据源错误:%-.64s"
        eng "The foreign server name you are trying to reference does not exist. Data source error:  %-.64s"
        ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung:  %-.64s"
        spa "El nombre del servidor foráneo que intenta referenciar no existe. Error en fuentes de datos:  %-.64s"
ER_ILLEGAL_HA_CREATE_OPTION
        chi "表存储引擎'%-.64s'不支持创建选项'%.64s'"
        eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
        ger "Speicher-Engine '%-.64s' der Tabelle unterstützt die Option '%.64s' nicht"
        spa "El motor de almacenaje de la tabla '%-.64s' no soporta la opción de creación '%.64s'"
ER_PARTITION_REQUIRES_VALUES_ERROR
        chi "语法错误:%-.64s PARTITIONING需要定义给每个分区VALUES %-.64s"
        eng "Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition"
        ger "Fehler in der SQL-Syntax: %-.64s-PARTITIONierung erfordert Definition von VALUES %-.64s für jede Partition"
        spa "Error de sintaxis: %-.64s PARTITIONING requiere de la definición de VALUES %-.64s para cada partición"
        swe "Syntaxfel: %-.64s PARTITIONering kräver definition av VALUES %-.64s för varje partition"
ER_PARTITION_WRONG_VALUES_ERROR
        chi "只有%-.64s PARTITIONING可以使用VALUES %-.64s在分区定义中"
        eng "Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition"
        ger "Nur %-.64s-PARTITIONierung kann VALUES %-.64s in der Partitionsdefinition verwenden"
        spa "Sólo %-.64s PARTITIONING puede usar VALUES %-.64s en la definición de la partición"
        swe "Endast %-.64s partitionering kan använda VALUES %-.64s i definition av partitionen" 
ER_PARTITION_MAXVALUE_ERROR
        chi "MAXVALUE只能在最后一个分区定义中使用"
        eng "MAXVALUE can only be used in last partition definition"
        ger "MAXVALUE kann nur für die Definition der letzten Partition verwendet werden"
        spa "MAXVALUE sólo se puede usar en la definición de la última partición"
        swe "MAXVALUE kan bara användas i definitionen av den sista partitionen"
ER_PARTITION_SUBPARTITION_ERROR
        chi "子分区只能是哈希分区和分区列"
        eng "Subpartitions can only be hash partitions and by key"
        ger "Unterpartitionen dürfen nur HASH- oder KEY-Partitionen sein"
        spa "Las subparticiones sólo pueden ser particiones dispersas (hash) y mediante clave"
        swe "Subpartitioner kan bara vara hash och key partitioner"
ER_PARTITION_SUBPART_MIX_ERROR
        chi "如果在一个分区上,必须在所有分区上定义子组分"
        eng "Must define subpartitions on all partitions if on one partition"
        ger "Wenn Sie Unterpartitionen auf einer Partition definieren, müssen Sie das für alle Partitionen tun"
        spa "Se deben de definir subparticiones en todas las particiones si se está en una partición"
        swe "Subpartitioner måste definieras på alla partitioner om på en"
ER_PARTITION_WRONG_NO_PART_ERROR
        chi "定义了错误的分区数,与以前的设置不匹配"
        eng "Wrong number of partitions defined, mismatch with previous setting"
        ger "Falsche Anzahl von Partitionen definiert, stimmt nicht mit vorherigen Einstellungen überein"
        spa "Definido un número equivocado de particiones, no coincide con configuración previa"
        swe "Antal partitioner definierade och antal partitioner är inte lika"
ER_PARTITION_WRONG_NO_SUBPART_ERROR
        chi "错误的子组分数定义,与以前的设置不匹配"
        eng "Wrong number of subpartitions defined, mismatch with previous setting"
        ger "Falsche Anzahl von Unterpartitionen definiert, stimmt nicht mit vorherigen Einstellungen überein"
        spa "Definido un número equivocado de subparticiones, no coincide con configuración previa"
        swe "Antal subpartitioner definierade och antal subpartitioner är inte lika"
ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
        chi "不允许(子)分区功能中的常量,随机或时区依赖表达式"
        eng "Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed"
        ger "Konstante oder Random-Ausdrücke in (Unter-)Partitionsfunktionen sind nicht erlaubt"
        spa "Las expresiones constantes, al azar o dependientes de zona en función de (sub)particionado no están permitidas"
        swe "Konstanta uttryck eller slumpmässiga uttryck är inte tillåtna (sub)partitioneringsfunktioner"
ER_NOT_CONSTANT_EXPRESSION
        chi "%s中的表达必须是恒定的"
        eng "Expression in %s must be constant"
        ger "Ausdrücke in %s müssen konstant sein"
        spa "Las expresiones incluidas en %s deben de ser constantes"
        swe "Uttryck i %s måste vara ett konstant uttryck"
ER_FIELD_NOT_FOUND_PART_ERROR
        chi "在表中找不到分区功能的字段列表中的字段"
        eng "Field in list of fields for partition function not found in table"
        ger "Felder in der Feldliste der Partitionierungsfunktion wurden in der Tabelle nicht gefunden"
        spa "Campo en la lista de campos para función de partición no hallado en tabla"
        swe "Fält i listan av fält för partitionering med key inte funnen i tabellen"
ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR
        chi "只允许在索引分区中允许字段列表"
        eng "List of fields is only allowed in KEY partitions"
        ger "Eine Feldliste ist nur in KEY-Partitionen erlaubt"
        spa "Lista de campos sólo se permite en particiones KEY"
        swe "En lista av fält är endast tillåtet för KEY partitioner"
ER_INCONSISTENT_PARTITION_INFO_ERROR
        chi "FRM文件中的分区信息不与可以写入FRM文件的内容一致"
        eng "The partition info in the frm file is not consistent with what can be written into the frm file"
        ger "Die Partitionierungsinformationen in der frm-Datei stimmen nicht mit dem überein, was in die frm-Datei geschrieben werden kann"
        spa "La información de partición en el fichero/archivo frm no es consistente con lo que se puede grabar en un fichero/archivo frm"
        swe "Partitioneringsinformationen i frm-filen är inte konsistent med vad som kan skrivas i frm-filen"
ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
        chi "%-.192s函数返回错误的类型"
        eng "The %-.192s function returns the wrong type"
        ger "Die %-.192s-Funktion gibt einen falschen Typ zurück"
        spa "La función %-.192s devueve un tipo equivocado"
        swe "%-.192s-funktionen returnerar felaktig typ"
ER_PARTITIONS_MUST_BE_DEFINED_ERROR
        chi "对于%-.64s分区必须定义每个分区"
        eng "For %-.64s partitions each partition must be defined"
        ger "Für %-.64s-Partitionen muss jede Partition definiert sein"
        spa "Para las particiones %-.64s, se debe de definir cada partición"
        swe "För %-.64s partitionering så måste varje partition definieras"
ER_RANGE_NOT_INCREASING_ERROR
        chi "每个分区的VALUES LESS THAN的值必须严格增加"
        eng "VALUES LESS THAN value must be strictly increasing for each partition"
        ger "Werte in VALUES LESS THAN müssen für jede Partition strikt aufsteigend sein"
        spa "El valor VALUES LESS THAN debe de ser estrictamente incremental para cada partición"
        swe "Värden i VALUES LESS THAN måste vara strikt växande för varje partition"
ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
        chi "VALUES值必须与分区函数相同"
        eng "VALUES value must be of same type as partition function"
        ger "VALUES-Werte müssen vom selben Typ wie die Partitionierungsfunktion sein"
        spa "El valor VALUES debe de ser del mismo tipo que la función de partición"
        swe "Värden i VALUES måste vara av samma typ som partitioneringsfunktionen"
ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
        chi "列表分区中相同常量的多个定义"
        eng "Multiple definition of same constant in list partitioning"
        ger "Mehrfachdefinition derselben Konstante bei Listen-Partitionierung"
        spa "Definición múltiple de la misma constante en el particionamiento de la lista"
        swe "Multipel definition av samma konstant i list partitionering"
ER_PARTITION_ENTRY_ERROR
        chi "分区不能在查询中独立使用"
        eng "Partitioning can not be used stand-alone in query"
        ger "Partitionierung kann in einer Abfrage nicht alleinstehend benutzt werden"
        spa "El particionado no puede ser usado de forma autónoma en consulta (query)"
        swe "Partitioneringssyntax kan inte användas på egen hand i en SQL-fråga"
ER_MIX_HANDLER_ERROR
        chi "此版本的MariaDB中不允许分区中的处理程序混合"
        eng "The mix of handlers in the partitions is not allowed in this version of MariaDB"
        ger "Das Vermischen von Handlern in Partitionen ist in dieser Version von MariaDB nicht erlaubt"
        spa "La mezcla de manejadores en las particiones no está autorizada en esta versión de MariaDB"
        swe "Denna mix av lagringsmotorer är inte tillåten i denna version av MariaDB"
ER_PARTITION_NOT_DEFINED_ERROR
        chi "对于分区引擎,需要定义所有%-.64s"
        eng "For the partitioned engine it is necessary to define all %-.64s"
        ger "Für die partitionierte Engine müssen alle %-.64s definiert sein"
        spa "Para el motor de particionado es necesario definir todas %-.64s"
        swe "För partitioneringsmotorn så är det nödvändigt att definiera alla %-.64s"
ER_TOO_MANY_PARTITIONS_ERROR
        chi "定义了太多分区(包括子组分)"
        eng "Too many partitions (including subpartitions) were defined"
        ger "Es wurden zu vielen Partitionen (einschließlich Unterpartitionen) definiert"
        spa "Definidas demasiadas particiones (incluyendo las subparticiones)"
        swe "För många partitioner (inkluderande subpartitioner) definierades"
ER_SUBPARTITION_ERROR
        chi "只有在子节分节的HASH/KEY分区中可以混合RANGE/LIST分区"
        eng "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning"
        ger "RANGE/LIST-Partitionierung kann bei Unterpartitionen nur zusammen mit HASH/KEY-Partitionierung verwendet werden"
        spa "Sólo es posible mezclar particionado RANGE/LIST con particionado HASH/KEY para el subparticionado"
        swe "Det är endast möjligt att blanda RANGE/LIST partitionering med HASH/KEY partitionering för subpartitionering"
ER_CANT_CREATE_HANDLER_FILE
        chi "无法创建特定的处理程序文件"
        eng "Failed to create specific handler file"
        ger "Erzeugen einer spezifischen Handler-Datei fehlgeschlagen"
        spa "No pude crear fichero/archivo de manejador específico"
        swe "Misslyckades med att skapa specifik fil i lagringsmotor"
ER_BLOB_FIELD_IN_PART_FUNC_ERROR
        chi "分区功能中不允许BLOB字段"
        eng "A BLOB field is not allowed in partition function"
        ger "In der Partitionierungsfunktion sind BLOB-Spalten nicht erlaubt"
        spa "No se autoriza campo BLOB en la función de partición"
        swe "Ett BLOB-fält är inte tillåtet i partitioneringsfunktioner"
ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
        chi "A%-.192s必须包含表的分区功能中的所有列"
        eng "A %-.192s must include all columns in the table's partitioning function"
        spa "Un %-.192s debe de incluir todas las columnas en la función de particionado de la tabla"
ER_NO_PARTS_ERROR
        chi "不允许%-.64s = 0"
        eng "Number of %-.64s = 0 is not an allowed value"
        ger "Eine Anzahl von %-.64s = 0 ist kein erlaubter Wert"
        spa "El número de %-.64s = 0 no es un valor autorizado"
        swe "Antal %-.64s = 0 är inte ett tillåten värde"
ER_PARTITION_MGMT_ON_NONPARTITIONED
        chi "不分区表上的分区管理是不可能的"
        eng "Partition management on a not partitioned table is not possible"
        ger "Partitionsverwaltung einer nicht partitionierten Tabelle ist nicht möglich"
        spa "La gestión de particiones en una tabla no particionada no es posible"
        swe "Partitioneringskommando på en opartitionerad tabell är inte möjligt"
ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
        eng "Partitioned tables do not support %s"
        spa "Las tablas particionadas no soportan %s"
ER_DROP_PARTITION_NON_EXISTENT
        chi "分区列表错误%-.64s"
        eng "Error in list of partitions to %-.64s"
        ger "Fehler in der Partitionsliste bei %-.64s"
        spa "Error en lista de particiones para %-.64s"
        swe "Fel i listan av partitioner att %-.64s"
ER_DROP_LAST_PARTITION
        chi "无法删除所有分区,请使用删除表"
        eng "Cannot remove all partitions, use DROP TABLE instead"
        ger "Es lassen sich nicht sämtliche Partitionen löschen, benutzen Sie statt dessen DROP TABLE"
        spa "No puedo quitar todas las particiones, use DROP TABLE en su lugar"
        swe "Det är inte tillåtet att ta bort alla partitioner, använd DROP TABLE istället"
ER_COALESCE_ONLY_ON_HASH_PARTITION
        chi "COALESCE分区只能用于哈希/索引分区"
        eng "COALESCE PARTITION can only be used on HASH/KEY partitions"
        ger "COALESCE PARTITION kann nur auf HASH- oder KEY-Partitionen benutzt werden"
        spa "COALESCE PARTITION sólo se puede usar en particiones HASH/KEY"
        swe "COALESCE PARTITION kan bara användas på HASH/KEY partitioner"
ER_REORG_HASH_ONLY_ON_SAME_NO
        chi "REORGANIZE PARTITION只能用于重新组织不改变他们的数字的分区"
        eng "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers"
        ger "REORGANIZE PARTITION kann nur zur Reorganisation von Partitionen verwendet werden, nicht, um ihre Nummern zu ändern"
        spa "REORGANIZE PARTITION sólo se puede usar para reorganizar particiones no para cambiar sus números"
        swe "REORGANIZE PARTITION kan bara användas för att omorganisera partitioner, inte för att ändra deras antal"
ER_REORG_NO_PARAM_ERROR
        chi "没有参数的REORGANIZE PARTITION只能用于HASH PARTITION的自动分区表"
        eng "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs"
        ger "REORGANIZE PARTITION ohne Parameter kann nur für auto-partitionierte Tabellen verwendet werden, die HASH-Partitionierung benutzen"
        spa "REORGANIZE PARTITION sin parámetros sólo se puede usar en tablas auto-particionadas usando HASH PARTITIONs"
        swe "REORGANIZE PARTITION utan parametrar kan bara användas på auto-partitionerade tabeller som använder HASH partitionering"
ER_ONLY_ON_RANGE_LIST_PARTITION
        chi "%-.64s分区只能用于RANGE/LIST分区"
        eng "%-.64s PARTITION can only be used on RANGE/LIST partitions"
        ger "%-.64s PARTITION kann nur für RANGE- oder LIST-Partitionen verwendet werden"
        spa "%-.64s PARTITION sólo puede ser usada en particiones RANGE/LIST"
        swe "%-.64s PARTITION kan bara användas på RANGE/LIST-partitioner"
ER_ADD_PARTITION_SUBPART_ERROR
        chi "尝试用错误数量的子分区添加分区"
        eng "Trying to Add partition(s) with wrong number of subpartitions"
        ger "Es wurde versucht, eine oder mehrere Partitionen mit der falschen Anzahl von Unterpartitionen hinzuzufügen"
        spa "Intentando añadir particion(es) usando un número equivocado de subparticiones"
        swe "ADD PARTITION med fel antal subpartitioner"
ER_ADD_PARTITION_NO_NEW_PARTITION
        chi "必须添加至少一个分区"
        eng "At least one partition must be added"
        ger "Es muss zumindest eine Partition hinzugefügt werden"
        spa "Se debe de añadir una partición, al menos"
        swe "Åtminstone en partition måste läggas till vid ADD PARTITION"
ER_COALESCE_PARTITION_NO_PARTITION
        chi "至少一个分区必须合并"
        eng "At least one partition must be coalesced"
        ger "Zumindest eine Partition muss mit COALESCE PARTITION zusammengefügt werden"
        spa "Se debe de fusionar una partición, al menos"
        swe "Åtminstone en partition måste slås ihop vid COALESCE PARTITION"
ER_REORG_PARTITION_NOT_EXIST
        chi "分区重组量超过而不是分区量"
        eng "More partitions to reorganize than there are partitions"
        ger "Es wurde versucht, mehr Partitionen als vorhanden zu reorganisieren"
        spa "Hay más particiones a reorganizar que las que existen"
        swe "Fler partitioner att reorganisera än det finns partitioner"
ER_SAME_NAME_PARTITION
        chi "重复分区名称%-.192s"
        eng "Duplicate partition name %-.192s"
        ger "Doppelter Partitionsname: %-.192s"
        spa "Nombre de partición duplicado %-.192s"
        swe "Duplicerat partitionsnamn %-.192s"
ER_NO_BINLOG_ERROR
        chi "在此命令上不允许关闭binlog"
        eng "It is not allowed to shut off binlog on this command"
        ger "Es es nicht erlaubt, bei diesem Befehl binlog abzuschalten"
        spa "No se autoriza a apagar binlog con este comando"
        swe "Det är inte tillåtet att stänga av binlog på detta kommando"
ER_CONSECUTIVE_REORG_PARTITIONS
        chi "在重新组织一组分区时,它们必须按照次序"
        eng "When reorganizing a set of partitions they must be in consecutive order"
        ger "Bei der Reorganisation eines Satzes von Partitionen müssen diese in geordneter Reihenfolge vorliegen"
        spa "Para reorganizar un conjunto de particiones, éstas deben de estar ordenadas consecutivamente"
        swe "När ett antal partitioner omorganiseras måste de vara i konsekutiv ordning"
ER_REORG_OUTSIDE_RANGE
        chi "重组范围分区无法更改除最后分区之外的总范围,无法扩展范围"
        eng "Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range"
        ger "Die Reorganisation von RANGE-Partitionen kann Gesamtbereiche nicht verändern, mit Ausnahme der letzten Partition, die den Bereich erweitern kann"
        spa "El reorganizar un rango de particiones no puede cambiar los rangos totales excepto para la última partición donde se puede extender el rango"
        swe "Reorganisering av rangepartitioner kan inte ändra den totala intervallet utom för den sista partitionen där intervallet kan utökas"
ER_PARTITION_FUNCTION_FAILURE
        chi "此版不支持此处理程序的分区功能"
        eng "Partition function not supported in this version for this handler"
        ger "Partitionsfunktion in dieser Version dieses Handlers nicht unterstützt"
        spa "Función de partición no soportada en esta versión para este manejador"
ER_PART_STATE_ERROR
        chi "无法从CREATE/ALTER表中定义分区状态"
        eng "Partition state cannot be defined from CREATE/ALTER TABLE"
        ger "Partitionszustand kann nicht von CREATE oder ALTER TABLE aus definiert werden"
        spa "El estado de una partición no se puede definir desde CREATE/ALTER TABLE"
        swe "Partition state kan inte definieras från CREATE/ALTER TABLE"
ER_LIMITED_PART_RANGE
        chi "%-.64s处理程序仅支持32-bit整数"
        eng "The %-.64s handler only supports 32 bit integers in VALUES"
        ger "Der Handler %-.64s unterstützt in VALUES nur 32-Bit-Integers"
        spa "El manejador %-.64s sólo soporta enteros de 32 bit en VALUES"
        swe "%-.64s stödjer endast 32 bitar i integers i VALUES"
ER_PLUGIN_IS_NOT_LOADED
        chi "插件'%-.192s'未加载"
        eng "Plugin '%-.192s' is not loaded"
        ger "Plugin '%-.192s' ist nicht geladen"
        spa "Enchufe (plugin) '%-.192s' no cargado"
ER_WRONG_VALUE
        chi "错误%-.32s值:'%-.128T'"
        eng "Incorrect %-.32s value: '%-.128T'"
        ger "Falscher %-.32s-Wert: '%-.128T'"
        spa "Incorrecto %-.32s valor: '%-.128T'"
ER_NO_PARTITION_FOR_GIVEN_VALUE
        chi "表没有%-.64s的分区"
        eng "Table has no partition for value %-.64s"
        ger "Tabelle hat für den Wert %-.64s keine Partition"
        spa "La tabla no tiene partición para valor %-.64s"
ER_FILEGROUP_OPTION_ONLY_ONCE
        chi "设置%s不能超过一次"
        eng "It is not allowed to specify %s more than once"
        ger "%s darf nicht mehr als einmal angegegeben werden"
        spa "No se permite especificar %s más de unva vez"
ER_CREATE_FILEGROUP_FAILED
        chi "无法创建%s"
        eng "Failed to create %s"
        ger "Anlegen von %s fehlgeschlagen"
        hindi "%s को बनाने में असफल रहे"
        spa "No pude crear %s"
ER_DROP_FILEGROUP_FAILED
        chi "未能DROP%s"
        eng "Failed to drop %s"
        ger "Löschen von %s fehlgeschlagen"
        hindi "%s को हटाने में असफल रहे"
        spa "No pude eliminar %s"
ER_TABLESPACE_AUTO_EXTEND_ERROR
        chi "处理程序不支持表空间的自动扩展名"
        eng "The handler doesn't support autoextend of tablespaces"
        ger "Der Handler unterstützt keine automatische Erweiterung (Autoextend) von Tablespaces"
        spa "El manejador no soporta autoextensión de espacios de tabla"
ER_WRONG_SIZE_NUMBER
        chi "尺寸参数被错误地指定,编号或表单10M"
        eng "A size parameter was incorrectly specified, either number or on the form 10M"
        ger "Ein Größen-Parameter wurde unkorrekt angegeben, muss entweder Zahl sein oder im Format 10M"
        spa "Se ha especificado de forma incorrecta un parámetro de medida o el número o en la forma 10M"
ER_SIZE_OVERFLOW_ERROR
        chi "尺寸编号是正确的,但我们不允许数字部分超过20亿"
        eng "The size number was correct but we don't allow the digit part to be more than 2 billion"
        ger "Die Zahl für die Größe war korrekt, aber der Zahlanteil darf nicht größer als 2 Milliarden sein"
        spa "El número de medida es correcto pero no permitimos que la parte del dígito tenga más de 2 billones"
ER_ALTER_FILEGROUP_FAILED
        chi "未能改变:%s"
        eng "Failed to alter: %s"
        ger "Änderung von %s fehlgeschlagen"
        hindi "%s को ALTER करने में असफल रहे"
        spa "No pude alterar: %s"
ER_BINLOG_ROW_LOGGING_FAILED
        chi "将一行写入基于行的二进制日志失败"
        eng "Writing one row to the row-based binary log failed"
        ger "Schreiben einer Zeilen ins zeilenbasierte Binärlog fehlgeschlagen"
        spa "Ha fallado el grabar una fila en historial (log) binario basado en fila"
ER_BINLOG_ROW_WRONG_TABLE_DEF
        chi "表定义主机和从站不匹配:%s"
        eng "Table definition on master and slave does not match: %s"
        ger "Tabellendefinition auf Master und Slave stimmt nicht überein: %s"
        spa "La definición de tabla en maestro (master) y esclavo no coincide: %s"
ER_BINLOG_ROW_RBR_TO_SBR
        chi "使用--log-slave-updates的从站必须使用基于行的二进制日志记录,以便能够复制基于行的二进制日志事件"
        eng "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events"
        ger "Slave, die mit --log-slave-updates laufen, müssen zeilenbasiertes Loggen verwenden, um zeilenbasierte Binärlog-Ereignisse loggen zu können"
        spa "La ejecución esclava con --log-slave-updates debe de usar un historial (log) binario basado en fila para que pueda replicar eventos de historial (log) binario basados en fila"
ER_EVENT_ALREADY_EXISTS
        chi "事件'%-.192s'已经存在"
        eng "Event '%-.192s' already exists"
        ger "Event '%-.192s' existiert bereits"
        spa "El evento '%-.192s' ya existe"
ER_EVENT_STORE_FAILED
        chi "无法存储事件%s。错误代码%M来自存储引擎"
        eng "Failed to store event %s. Error code %M from storage engine"
        ger "Speichern von Event %s fehlgeschlagen. Fehlercode der Speicher-Engine: %M"
        spa "No pude almacenar evento %s. Código de error %M desde motor de almacenaje"
ER_EVENT_DOES_NOT_EXIST
        chi "未知事件'%-.192s'"
        eng "Unknown event '%-.192s'"
        ger "Unbekanntes Event '%-.192s'"
        spa "Evento desconocido '%-.192s'"
ER_EVENT_CANT_ALTER
        chi "无法改变事件'%-.192s'"
        eng "Failed to alter event '%-.192s'"
        ger "Ändern des Events '%-.192s' fehlgeschlagen"
        hindi "'%-.192s' EVENT को ALTER करने में असफल रहे"
        spa "No pude alterar evento '%-.192s'"
ER_EVENT_DROP_FAILED
        chi "未能DROP%s"
        eng "Failed to drop %s"
        ger "Löschen von %s fehlgeschlagen"
        hindi "%s को हटाने में असफल रहे"
        spa "No pude eliminar %s"
ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
        chi "INTERVAL为负或太大"
        eng "INTERVAL is either not positive or too big"
        ger "INTERVAL ist entweder nicht positiv oder zu groß"
        spa "O INTERVAL no es positivo o es demasiado grande"
ER_EVENT_ENDS_BEFORE_STARTS
        chi "ENDS无效的或在STARTS之前"
        eng "ENDS is either invalid or before STARTS"
        ger "ENDS ist entweder ungültig oder liegt vor STARTS"
        spa "O ENDS es inválido o anterior a STARTS"
ER_EVENT_EXEC_TIME_IN_THE_PAST
        chi "事件执行时间在过去。事件已被禁用"
        eng "Event execution time is in the past. Event has been disabled"
        ger "Ausführungszeit des Events liegt in der Vergangenheit. Event wurde deaktiviert"
        spa "El tiempo de ejecución de evento se encuentra en el pasado. El evento ha sido desactivado"
ER_EVENT_OPEN_TABLE_FAILED
        chi "无法打开mysql.event"
        eng "Failed to open mysql.event"
        ger "Öffnen von mysql.event fehlgeschlagen"
        hindi "mysql.event को खोलने में असफल रहे"
        spa "No puede abrir mysql.event"
ER_EVENT_NEITHER_M_EXPR_NOR_M_AT
        chi "没有提供DateTime表达式"
        eng "No datetime expression provided"
        ger "Kein DATETIME-Ausdruck angegeben"
        spa "No se ha suministrado expresión datetime"
ER_UNUSED_2
        eng "You should never see it"
        spa "No lo debería vd de ver nunca"
ER_UNUSED_3
        eng "You should never see it"
        spa "No lo debería vd  de ver nunca"
ER_EVENT_CANNOT_DELETE
        chi "无法从mysql.event删除该事件"
        eng "Failed to delete the event from mysql.event"
        ger "Löschen des Events aus mysql.event fehlgeschlagen"
        hindi "EVENT को mysql.event से हटाने मैं असफल रहे"
        spa "No pude borrar el evento desde mysql.event"
ER_EVENT_COMPILE_ERROR
        chi "在汇编事件的主体时出错"
        eng "Error during compilation of event's body"
        ger "Fehler beim Kompilieren des Event-Bodys"
        spa "Error durante compilación de cuerpo de evento"
ER_EVENT_SAME_NAME
        chi "相同的旧活动名称"
        eng "Same old and new event name"
        ger "Alter und neuer Event-Name sind gleich"
        spa "Mismo nombre de evento viejo y nuevo"
ER_EVENT_DATA_TOO_LONG
        chi "列'%s'数据太长"
        eng "Data for column '%s' too long"
        ger "Daten der Spalte '%s' zu lang"
        spa "Datos demasiado largos para la columna '%s'"
ER_DROP_INDEX_FK
        chi "无法删除索引'%-.192s':外部索引约束中需要它"
        eng "Cannot drop index '%-.192s': needed in a foreign key constraint"
        ger "Kann Index '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung benötigt"
        spa "No puedo eliminar índice '%-.192s': necesario en una restricción de clave foránea"
# When using this error message, use the ER_WARN_DEPRECATED_SYNTAX error
# code.
ER_WARN_DEPRECATED_SYNTAX_WITH_VER  
        chi "语法'%s'被弃用,将在Mariadb%s中删除。请使用%s"
        eng  "The syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s instead"
        ger "Die Syntax '%s' ist veraltet und wird in MariaDB %s entfernt. Bitte benutzen Sie statt dessen %s"
        spa  "La sintaxis '%s' está obsoleta y será quitada en MariaDB %s. Por favor, use %s en su lugar"
ER_CANT_WRITE_LOCK_LOG_TABLE
        chi "您无法获得日志表的写锁。只有读访问是可能的"
        eng "You can't write-lock a log table. Only read access is possible"
        ger "Eine Log-Tabelle kann nicht schreibgesperrt werden. Es ist ohnehin nur Lesezugriff möglich"
        spa "No puede hacer bloqueo de escritura en una tabla de historial (log). Sólo es posible acceso de lectura"
ER_CANT_LOCK_LOG_TABLE
        chi "您无法使用带日志表的锁"
        eng "You can't use locks with log tables"
        ger "Log-Tabellen können nicht gesperrt werden"
        spa "No puede usar bloqueos con tablas de historial (log)"
ER_UNUSED_4
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
        chi "mysql的列计数。%s是错误的。预期%d,找到%d。使用MariaDB%d创建,现在运行%d。请使用mariadb-upgrade来修复此错误"
        eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error"
        ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MariaDB %d, jetzt unter %d. Bitte benutzen Sie mariadb-upgrade, um den Fehler zu beheben"
        spa "El contador de columnas de mysql.%s está equivocado. Se esperaba %d, hallado %d. Creado con MariaDB %d, ahora ejecuando %d. Por favor, use mariadb-upgrade para solucionar este error"
ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
        chi "当会话打开临时表时,无法切换出基于行的二进制日志格式"
        eng "Cannot switch out of the row-based binary log format when the session has open temporary tables"
        ger "Kann nicht aus dem zeilenbasierten Binärlog-Format herauswechseln, wenn die Sitzung offene temporäre Tabellen hat"
        spa "No puedo conmutar fuera del formato de historial (log) binario basado en fila cuando la sesión ha abierto tablas temporales"
ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
        chi "无法更改存储函数或触发器内的二进制记录格式"
        eng "Cannot change the binary logging format inside a stored function or trigger"
        ger "Das Binärlog-Format kann innerhalb einer gespeicherten Funktion oder eines Triggers nicht geändert werden"
        spa "No puedo cambiar el formato de historial (log) binario dentro de funciones almacenadas o disparadores"
ER_UNUSED_13
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_PARTITION_NO_TEMPORARY
        chi "无法使用分区创建临时表"
        eng "Cannot create temporary table with partitions"
        ger "Anlegen temporärer Tabellen mit Partitionen nicht möglich"
        hindi "अस्थाई टेबल को पार्टिशन्स के साथ नहीं बनाया जा सकता"
        spa "No puedo crear tabla temporal con particiones"
ER_PARTITION_CONST_DOMAIN_ERROR
        chi "分区常量超出分区功能域"
        eng "Partition constant is out of partition function domain"
        ger "Partitionskonstante liegt außerhalb der Partitionsfunktionsdomäne"
        spa "La constante de partición está fuera del dominio de función de partición"
        swe "Partitionskonstanten är utanför partitioneringsfunktionens domän"
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
        chi "不允许此分区功能"
        eng "This partition function is not allowed"
        ger "Diese Partitionierungsfunktion ist nicht erlaubt"
        spa "Esta función de partición no está permitida"
        swe "Denna partitioneringsfunktion är inte tillåten"
ER_DDL_LOG_ERROR
        chi "DDL日志中的错误"
        eng "Error in DDL log"
        ger "Fehler im DDL-Log"
        hindi "DDL लॉग में त्रुटि हुई"
        spa "Error en historial (log) DDL"
ER_NULL_IN_VALUES_LESS_THAN
        chi "VALUES LESS THAN不允许使用NULL"
        eng "Not allowed to use NULL value in VALUES LESS THAN"
        ger "In VALUES LESS THAN dürfen keine NULL-Werte verwendet werden"
        spa "No autorizado a usar valor NULL en VALUES LESS THAN"
        swe "Det är inte tillåtet att använda NULL-värden i VALUES LESS THAN"
ER_WRONG_PARTITION_NAME
        chi "分区名称不正确"
        eng "Incorrect partition name"
        ger "Falscher Partitionsname"
        hindi "पार्टीशन का नाम गलत है"
        spa "Nombre incorrecto de partición"
        swe "Felaktigt partitionsnamn"
ER_CANT_CHANGE_TX_CHARACTERISTICS 25001
        chi "交易正在进行,无法更改事务特性"
        eng "Transaction characteristics can't be changed while a transaction is in progress"
        spa "No se pueden cambiar las característias de transacción mientras que una transacción se ecuentre en proceso"
ER_DUP_ENTRY_AUTOINCREMENT_CASE
        chi "ALTER TABLE表会导致AUTO_INCREMENT重建,导致重复的条目'%-.192T'用于索引'%-.192s'"
        eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'"
        ger "ALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.192T' für Schlüssel '%-.192s' auftritt"
        spa "ALTER TABLE causa resecuenciado de auto_incremento resultando en entrada duplicada '%-.192T' para la clave '%-.192s'"
ER_EVENT_MODIFY_QUEUE_ERROR
        chi "内部调度器错误%d"
        eng "Internal scheduler error %d"
        ger "Interner Scheduler-Fehler %d"
        spa "Error en organizador interno %d"
ER_EVENT_SET_VAR_ERROR
        chi "在开始/停止调度程序期间出错。错误代码%M"
        eng "Error during starting/stopping of the scheduler. Error code %M"
        ger "Fehler während des Startens oder Anhalten des Schedulers. Fehlercode %M"
        spa "Error durante arranque/parada del organizador. Código de error %M"
ER_PARTITION_MERGE_ERROR
        chi "引擎不能用于分区表"
        eng "Engine cannot be used in partitioned tables"
        ger "Engine kann in partitionierten Tabellen nicht verwendet werden"
        spa "No se puede usar el motor en tablas particionadas"
        swe "Engine inte användas i en partitionerad tabell"
ER_CANT_ACTIVATE_LOG
        chi "无法激活'%-.64s'日志"
        eng "Cannot activate '%-.64s' log"
        ger "Kann Logdatei '%-.64s' nicht aktivieren"
        spa "No puedo activar historial (log) '%-.64s'"
ER_RBR_NOT_AVAILABLE
        chi "服务器不是基于行的复制构建的"
        eng "The server was not built with row-based replication"
        ger "Der Server wurde nicht mit zeilenbasierter Replikation gebaut"
        spa "El servidor no ha sido construido con réplica basada en fila"
ER_BASE64_DECODE_ERROR
        chi "Base64字符串的解码失败"
        eng "Decoding of base64 string failed"
        ger "Der Server hat keine zeilenbasierte Replikation"
        spa "Ha fallado la decodificación de cadena base64"
        swe "Avkodning av base64 sträng misslyckades"
ER_EVENT_RECURSION_FORBIDDEN
        chi "EVENT主体存在时EVENT DDL语句递归被禁止"
        eng "Recursion of EVENT DDL statements is forbidden when body is present"
        ger "Rekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiert"
        spa "Se prohiben sentencias de EVENT DDL cuando se encuentra presente el cuerpo"
ER_EVENTS_DB_ERROR
        chi "无法继续,因为事件调度程序已禁用"
        eng "Cannot proceed, because event scheduler is disabled"
        ger "Die Operation kann nicht fortgesetzt werden, da Event Scheduler deaktiviert ist."
        spa "No puedo proceder porque el organizado de eventos está desactivado"
ER_ONLY_INTEGERS_ALLOWED
        chi "这里只允许整数作为数字"
        eng "Only integers allowed as number here"
        ger "An dieser Stelle sind nur Ganzzahlen zulässig"
        spa "Sólo se permiten enteros como número aquí"
ER_UNSUPORTED_LOG_ENGINE
        chi "存储引擎%s不能用于日志表"
        eng "Storage engine %s cannot be used for log tables"
        ger "Speicher-Engine %s kann für Logtabellen nicht verwendet werden"
        hindi "स्टोरेज इंजन %s को लॉग टेबल्स के लिए इस्तेमाल नहीं किया जा सकता है"
        spa "No se puede usar el motor de almacenaje %s para tablas de historial (log)"
ER_BAD_LOG_STATEMENT
        chi "如果启用日志记录,则无法'%s'日志表"
        eng "You cannot '%s' a log table if logging is enabled"
        ger "Sie können eine Logtabelle nicht '%s', wenn Loggen angeschaltet ist"
        spa "No puede '%s' una tabla de historial (log) cuando se encuentra activado el llevar historial (log)"
ER_CANT_RENAME_LOG_TABLE
        chi "无法重命名'%s'。启用日志记录时,重命名日志表必须重命名两个表:日志表到存档表,另一个表返回'%s'"
        eng "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'"
        ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen zwei Tabellen umbenannt werden: die Logtabelle zu einer Archivtabelle, und eine weitere Tabelle zu '%s'"
        spa "No puedo renombrar '%s'. Si se encuentra activo el llevar historial (log), el renombrar a/desde tabla de historial (log) debe de renombrar dos tablas: la tabla de historial (log) a una tabla archivo y otra tabla de vuelta a '%s'"
ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 42000
        chi "对本机函数的呼叫中的参数计数不正确'%-.192s'"
        eng "Incorrect parameter count in the call to native function '%-.192s'"
        ger "Falsche Anzahl von Parametern beim Aufruf der nativen Funktion '%-.192s'"
        spa "Contador de parámetro incorrecto en la llamada a función nativa '%-.192s'"
ER_WRONG_PARAMETERS_TO_NATIVE_FCT 42000
        chi "对本机函数'%-.192s'呼叫中的参数不正确"
        eng "Incorrect parameters in the call to native function '%-.192s'"
        ger "Falscher Parameter beim Aufruf der nativen Funktion '%-.192s'"
        spa "Parámetros incorrectos en la llamada a función nativa '%-.192s'"
ER_WRONG_PARAMETERS_TO_STORED_FCT 42000  
        chi "呼叫中的参数不正确为存储函数'%-.192s'"
        eng "Incorrect parameters in the call to stored function '%-.192s'"
        ger "Falsche Parameter beim Aufruf der gespeicherten Funktion '%-.192s'"
        spa "Parámetros incorrectos en la llamada a función almacenada '%-.192s'"
ER_NATIVE_FCT_NAME_COLLISION
        chi "此功能'%-.192s'具有与本机函数相同的名称"
        eng "This function '%-.192s' has the same name as a native function"
        ger "Die Funktion '%-.192s' hat denselben Namen wie eine native Funktion"
        spa "Esta función '%-.192s' tiene el mismo nombre que una función nativa"
# When using this error message, use the ER_DUP_ENTRY error code.  See, for
# example, code in handler.cc.
ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009
        chi "重复条目'%-.64T'键'%-.192s'"
        cze "Zvojený klíč '%-.64T' (číslo klíče '%-.192s')"
        dan "Ens værdier '%-.64T' for indeks '%-.192s'"
        eng "Duplicate entry '%-.64T' for key '%-.192s'"
        est "Kattuv väärtus '%-.64T' võtmele '%-.192s'"
        fre "Duplicata du champ '%-.64T' pour la clef '%-.192s'"
        ger "Doppelter Eintrag '%-.64T' für Schlüssel '%-.192s'"
        greek "Διπλή εγγραφή '%-.64T' για το κλειδί '%-.192s'"
        hun "Duplikalt bejegyzes '%-.64T' a '%-.192s' kulcs szerint"
        ita "Valore duplicato '%-.64T' per la chiave '%-.192s'"
        jpn "'%-.64T' は索引 '%-.192s' で重複しています。"
        kor "중복된 입력 값 '%-.64T': key '%-.192s'"
        nla "Dubbele ingang '%-.64T' voor zoeksleutel '%-.192s'"
        nor "Like verdier '%-.64T' for nøkkel '%-.192s'"
        norwegian-ny "Like verdiar '%-.64T' for nykkel '%-.192s'"
        pol "Powtórzone wystąpienie '%-.64T' dla klucza '%-.192s'"
        por "Entrada '%-.64T' duplicada para a chave '%-.192s'"
        rum "Cimpul '%-.64T' e duplicat pentru cheia '%-.192s'"
        rus "Дублирующаяся запись '%-.64T' по ключу '%-.192s'"
        serbian "Dupliran unos '%-.64T' za ključ '%-.192s'"
        slo "Opakovaný kľúč '%-.64T' (číslo kľúča '%-.192s')"
        spa "Entrada duplicada '%-.64T' para la clave '%-.192s'"
        swe "Dublett '%-.64T' för nyckel '%-.192s'"
        ukr "Дублюючий запис '%-.64T' для ключа '%-.192s'"
ER_BINLOG_PURGE_EMFILE
        chi "打开太多文件,请再次执行命令"
        eng "Too many files opened, please execute the command again"
        ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus"
        spa "Demasiados ficheros/archivos abiertos. Por favor, ejecute el comando otra vez"
ER_EVENT_CANNOT_CREATE_IN_THE_PAST
        chi "事件执行时间在过去,并ON COMPLETION NOT PRESERVE。创建后,事件立即丢弃"
        eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation"
        ger "Ausführungszeit des Events liegt in der Vergangenheit, und es wurde ON COMPLETION NOT PRESERVE gesetzt. Das Event wurde unmittelbar nach Erzeugung gelöscht"
        spa "El tiempo de jecución del evento se encuentra en el pasado y está configurado ON COMPLETION NOT PRESERVE. El evento fue eliminado inmediatamente tras su creación"
ER_EVENT_CANNOT_ALTER_IN_THE_PAST
        chi "事件执行时间在过去,并ON COMPLETION NOT PRESERVE。事件没有改变。指定将来的时间"
        eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future"
        ger "Execution Zeitpunkt des Ereignisses in der Vergangenheit liegt, und es war NACH ABSCHLUSS Set nicht erhalten. Die Veranstaltung wurde nicht verändert. Geben Sie einen Zeitpunkt in der Zukunft"
        spa "El tiempo de jecución del evento se encuentra en el pasado y está configurado ON COMPLETION NOT PRESERVE. El evento no fue cambiado. Especifique un tiempo del futuro"
ER_SLAVE_INCIDENT
        chi "事件%s发生在master上。消息:%-.64s"
        eng "The incident %s occurred on the master. Message: %-.64s"
        ger "Der Vorfall %s passierte auf dem Master. Meldung: %-.64s"
        spa "Ha ocurrido un incidente %s en el maestro (master). Mensaje: %-.64s"
ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT
        chi "表对某些现有值没有分区"
        eng "Table has no partition for some existing values"
        ger "Tabelle hat für einige bestehende Werte keine Partition"
        spa "La tabla no tiene partición para algunos valores existentes"
ER_BINLOG_UNSAFE_STATEMENT
        chi "自从BINLOG_FORMAT =STATEMENT以来,使用语句格式写入二进制日志的不安全语句。%s."
        eng "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %s"
        ger "Unsichere Anweisung ins Binärlog geschrieben, weil Anweisungsformat BINLOG_FORMAT = STATEMENT. %s"
        spa "Se ha grabado una sentencia no segura en historial (log) binario usando el formato de sentencia desde BINLOG_FORMAT = STATEMENT. %s"
        swe "Detta är inte säkert att logga i statement-format, för BINLOG_FORMAT = STATEMENT. %s"
ER_SLAVE_FATAL_ERROR
        chi "致命错误:%s"
        eng "Fatal error: %s"
        ger "Fataler Fehler: %s"
        spa "Error fatal: %s"
ER_SLAVE_RELAY_LOG_READ_FAILURE
        chi "relay日志读取失败:%s"
        eng "Relay log read failure: %s"
        ger "Relaylog-Lesefehler: %s"
        spa "Fallo de lectura en historial (log) de reenvío: %s"
ER_SLAVE_RELAY_LOG_WRITE_FAILURE
        chi "relay日志写入失败:%s"
        eng "Relay log write failure: %s"
        ger "Relaylog-Schreibfehler: %s"
        spa "Fallo de grabación en historial (log) de reenvío: %s"
ER_SLAVE_CREATE_EVENT_FAILURE
        chi "无法创建%s"
        eng "Failed to create %s"
        ger "Erzeugen von %s fehlgeschlagen"
        hindi "%s को बनाने मैं असफल रहे"
        spa "Fallo al crear %s"
ER_SLAVE_MASTER_COM_FAILURE
        chi "Master命令%s失败:%s"
        eng "Master command %s failed: %s"
        ger "Master-Befehl %s fehlgeschlagen: %s"
        spa "El comando maestro (master) %s ha fallado: %s"
ER_BINLOG_LOGGING_IMPOSSIBLE
        chi "二进制记录不可能。消息:%s"
        eng "Binary logging not possible. Message: %s"
        ger "Binärlogging nicht möglich. Meldung: %s"
        spa "No es posible llevar historial (log) binario. Mensaje: %s"
ER_VIEW_NO_CREATION_CTX
        chi "View%`s.%`s没有创建上下文"
        eng "View %`s.%`s has no creation context"
        ger "View %`s.%`s hat keinen Erzeugungskontext"
        spa "La vista %`s.%`s no tiene contexto de creación"
ER_VIEW_INVALID_CREATION_CTX
        chi "Creation View%`s.%`s的上下文无效"
        eng "Creation context of view %`s.%`s is invalid"
        ger "Erzeugungskontext des Views%`s.%`s ist ungültig"
        spa "El contexto de creación de la vista %`s.%`s es inválido"
ER_SR_INVALID_CREATION_CTX
        chi "存储例程%`s.%`s的创建上下文无效"
        eng "Creation context of stored routine %`s.%`s is invalid"
        ger "Erzeugungskontext der gespeicherten Routine%`s.%`s ist ungültig"
        spa "El contexto de creación de la rutina almacenada %`s.%`s es inválido"
ER_TRG_CORRUPTED_FILE
        chi "表的trg文件损坏了。%`s.%`s"
        eng "Corrupted TRG file for table %`s.%`s"
        ger "Beschädigte TRG-Datei für Tabelle %`s.%`s"
        spa "Fichero/archivo TRG estropeado para la tabla %`s.%`s`"
ER_TRG_NO_CREATION_CTX
        chi "表%`s.%`s的触发器没有创建上下文"
        eng "Triggers for table %`s.%`s have no creation context"
        ger "Trigger für Tabelle %`s.%`s haben keinen Erzeugungskontext"
        spa "Los disparadores para la tabla %`s.%`s no tienen contexto de creación"
ER_TRG_INVALID_CREATION_CTX
        chi "触发表%`s.%`s的创建上下文无效"
        eng "Trigger creation context of table %`s.%`s is invalid"
        ger "Trigger-Erzeugungskontext der Tabelle %`s.%`s ist ungültig"
        spa "El contexto de creación del disparador de la tabla %`s.%`s es inválido"
ER_EVENT_INVALID_CREATION_CTX
        chi "事件%`s.%`s的创建上下文无效"
        eng "Creation context of event %`s.%`s is invalid"
        ger "Erzeugungskontext des Events %`s.%`s ist ungültig"
        spa "El contexto de creación del evento %`s.%`s es inválido"
ER_TRG_CANT_OPEN_TABLE
        chi "无法打开触发%`s.%`s的表"
        eng "Cannot open table for trigger %`s.%`s"
        ger "Kann Tabelle für den Trigger %`s.%`s nicht öffnen"
        spa "No puedo abrir tabla para disparador %`s.%`s"
ER_CANT_CREATE_SROUTINE
        chi "无法创建存储过程%`s。检查警告"
        eng "Cannot create stored routine %`s. Check warnings"
        ger "Kann gespeicherte Routine %`s nicht erzeugen. Beachten Sie die Warnungen"
        spa "No puedo crear rutina alnacenada %`s. Revise los avisos"
ER_UNUSED_11
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
        chi "类型%s的Binlog语句未在格式描述binlog语句之前"
        eng "The BINLOG statement of type %s was not preceded by a format description BINLOG statement"
        ger "Der BINLOG-Anweisung vom Typ %s ging keine BINLOG-Anweisung zur Formatbeschreibung voran"
        spa "La sentencia BINLOG del tipo `%s` no ha sido precedida por una sentencia de descripción de formato BINLOG"
ER_SLAVE_CORRUPT_EVENT
        chi "检测到损坏的复制事件"
        eng "Corrupted replication event was detected"
        ger "Beschädigtes Replikationsereignis entdeckt"
        spa "Se ha detectado un evento de réplica estropeado"
ER_LOAD_DATA_INVALID_COLUMN
        chi "LOAD DATA中的列引用(%-.64s)无效"
        eng "Invalid column reference (%-.64s) in LOAD DATA"
        ger "Ungültige Spaltenreferenz (%-.64s) bei LOAD DATA"
        spa "Referencia inválida a columna (%-.64s) en LOAD DATA"
ER_LOG_PURGE_NO_FILE
        chi "未找到清除的log%s"
        eng "Being purged log %s was not found"
        ger "Zu bereinigende Logdatei %s wurde nicht gefunden"
        spa "No ha sido hallado historial (log) %s siendo purgado"
ER_XA_RBTIMEOUT XA106
        chi "XA_RBTIMEOUT:交易分支回滚:花了太久了"
        eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long"
        ger "XA_RBTIMEOUT: Transaktionszweig wurde zurückgerollt: Zeitüberschreitung"
        spa "XA_RBTIMEOUT: Rama de transacción ha sido retrocedida (rolled back): transcurrido demasiado tiempo"
ER_XA_RBDEADLOCK XA102
        chi "XA_RBDEADLOCK:交易分支回滚:检测到死锁"
        eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected"
        ger "XA_RBDEADLOCK: Transaktionszweig wurde zurückgerollt: Deadlock entdeckt"
        spa "XA_RBDEADLOCK: Rama de transacción ha dido retrocedida (rolled back): se ha detectado estancamiento (deadlock)"
ER_NEED_REPREPARE
        chi "prepared statement需要重新准备"
        eng "Prepared statement needs to be re-prepared"
        ger "Vorbereitete Anweisungen müssen noch einmal vorbereitet werden"
        spa "Sentencia preparada necesita volver a ser preparada"
ER_DELAYED_NOT_SUPPORTED
        chi "表'%-.192s'不支持延迟选项"
        eng "DELAYED option not supported for table '%-.192s'"
        ger "Die DELAYED-Option wird für Tabelle '%-.192s' nicht unterstützt"
        spa "Opción DELAYED no soportada para la tabla '%-.192s'"
WARN_NO_MASTER_INFO
        eng "There is no master connection '%.*s'"
        ger "Die Master-Info-Struktur existiert nicht '%.*s'"
        spa "No existe conexión maestra '%.*s'"
WARN_OPTION_IGNORED
        eng "<%-.64s> option ignored"
        ger "Option <%-.64s> ignoriert"
        spa "Opción <%-.64s> ignorada"
ER_PLUGIN_DELETE_BUILTIN
        chi "内置插件无法删除"
        eng "Built-in plugins cannot be deleted"
        ger "Eingebaute Plugins können nicht gelöscht werden"
        spa "No se pueden borrar los enchufes (plugins) internos"
WARN_PLUGIN_BUSY
        chi "插件很忙,将在关机时卸载"
        eng "Plugin is busy and will be uninstalled on shutdown"
        ger "Plugin wird verwendet und wird erst beim Herunterfahren deinstalliert"
        spa "El enchufe (plugin) está ocupado y será desinstalado cuando se apague"
ER_VARIABLE_IS_READONLY
        chi "%s变量'%s'是只读的。使用set%s付值"
        eng "%s variable '%s' is read-only. Use SET %s to assign the value"
        ger "%s Variable '%s' ist nur lesbar. Benutzen Sie SET %s, um einen Wert zuzuweisen"
        spa "%s variable '%s' es de sólo lectura. Use SET %s para asignar el valor"
ER_WARN_ENGINE_TRANSACTION_ROLLBACK
        chi "存储引擎%s不支持此语句的回滚。交易回滚并必须重新启动"
        eng "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted"
        ger "Speicher-Engine %s unterstützt für diese Anweisung kein Rollback. Transaktion wurde zurückgerollt und muss neu gestartet werden"
        spa "El motor de almacenaje %s no soporta retroceso (rollback) para esta sentencia. Transacción retrocedida (rolled back) y debe de ser rearrancada"
ER_SLAVE_HEARTBEAT_FAILURE
        chi "意外的master心跳数据:%s"
        eng "Unexpected master's heartbeat data: %s"
        ger "Unerwartete Daten vom Heartbeat des Masters: %s"
        spa "Datos inesperados de latido (heartbeat) de maestro (master): %s"
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
        chi "心跳周期的请求值是负的或超过允许的最大值(%u秒)"
        eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)"
        spa "El valor requerido para el período de latido o es negativo o excede al máximo permitido (%u segundos)"
ER_UNUSED_14
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_CONFLICT_FN_PARSE_ERROR
        chi "解析冲突功能时出错。消息:%-.64s"
        eng "Error in parsing conflict function. Message: %-.64s"
        ger "Fehler beim Parsen einer Konflikt-Funktion. Meldung: %-.64s"
        spa "Error al analizar función de conflicto. Mensaje: %-.64s"
ER_EXCEPTIONS_WRITE_ERROR
        chi "写入异常表失败。消息:%-.128s"
        eng "Write to exceptions table failed. Message: %-.128s""
        ger "Schreiben in Ausnahme-Tabelle fehlgeschlagen. Meldung: %-.128s""
        spa "Ha fallado el grabar en tabla de excepciones. Mensaje: %-.128s""
ER_TOO_LONG_TABLE_COMMENT
        chi "表格备注'%-.64s'太长(max =%u)"
        eng "Comment for table '%-.64s' is too long (max = %u)"
        ger "Kommentar für Tabelle '%-.64s' ist zu lang (max = %u)"
        por "Comentário para a tabela '%-.64s' é longo demais (max = %u)"
        spa "El comentario para tabla '%-.64s' es demasiado largo (máx = %u)"
ER_TOO_LONG_FIELD_COMMENT
        chi "字段'%-.64s'太长(max =%u)"
        eng "Comment for field '%-.64s' is too long (max = %u)"
        ger "Kommentar für Feld '%-.64s' ist zu lang (max = %u)"
        por "Comentário para o campo '%-.64s' é longo demais (max = %u)"
        spa "El comentario para el campo '%-.64s' es demasiado largo (máx = %u)"
ER_FUNC_INEXISTENT_NAME_COLLISION 42000 
        chi "FUNCTION %s不存在。在参考手册中查看“函数名称解析”部分"
        eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
        ger "FUNCTION %s existiert nicht. Erläuterungen im Abschnitt 'Function Name Parsing and Resolution' im Referenzhandbuch"
        spa "La FUNCTION %s no existe. Revise la sección de 'Function Name Parsing and Resolution' en el Manual de Referencia"
# When updating these, please update EXPLAIN_FILENAME_MAX_EXTRA_LENGTH in
# sql_table.h with the new maximal additional length for explain_filename.
ER_DATABASE_NAME
        chi "数据库"
        eng "Database"
        ger "Datenbank"
        hindi "डेटाबेस"
        spa "Base de datos"
        swe "Databas"
ER_TABLE_NAME
        chi "表"
        eng "Table"
        ger "Tabelle"
        hindi "टेबल"
        spa "Tabla"
        swe "Tabell"
ER_PARTITION_NAME
        chi "分区"
        eng "Partition"
        ger "Partition"
        hindi "पार्टीशन"
        spa "Partición"
        swe "Partition"
ER_SUBPARTITION_NAME
        chi "下分区"
        eng "Subpartition"
        ger "Unterpartition"
        hindi "सब-पार्टीशन"
        spa "Subpartición"
        swe "Subpartition"
ER_TEMPORARY_NAME
        chi "暂时的"
        eng "Temporary"
        ger "Temporär"
        hindi "अस्थायी"
        spa "Temporaria"
        swe "Temporär"
ER_RENAMED_NAME
        chi "重命名"
        eng "Renamed"
        ger "Umbenannt"
        spa "Renombrado"
        swe "Namnändrad"
ER_TOO_MANY_CONCURRENT_TRXS
        chi "“太多并发交易"
        eng "Too many active concurrent transactions"
        ger "Zu viele aktive simultane Transaktionen"
        spa  "Demasiadas transacciones concurrentes activas"
WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
        chi "非ASCII分隔符参数不完全支持"
        eng "Non-ASCII separator arguments are not fully supported"
        ger "Nicht-ASCII-Trennargumente werden nicht vollständig unterstützt"
        spa "Los argumentos con separador No ASCII no están completamente soportados"
ER_DEBUG_SYNC_TIMEOUT
        chi "调试同步点等待超时"
        eng "debug sync point wait timed out"
        ger "Debug Sync Point Wartezeit überschritten"
        spa "agotado tiempo de espera de punto de sincronización de depuración"
ER_DEBUG_SYNC_HIT_LIMIT
        chi "调试同步点限制达到"
        eng "debug sync point hit limit reached"
        ger "Debug Sync Point Hit Limit erreicht"
        spa "alcanzado límite de punto de sincronización de depuración"
ER_DUP_SIGNAL_SET 42000
        chi "重复条件信息项'%s'"
        eng "Duplicate condition information item '%s'"
        ger "Informationselement '%s' für Duplikatbedingung"
        spa "Duplicado elemento de información de condición '%s'"
# Note that the SQLSTATE is not 01000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_WARN 01000
        chi "未处理用户定义的警告条件"
        eng "Unhandled user-defined warning condition"
        ger "Unbehandelte benutzerdefinierte Warnbedingung"
        spa "Condición de aviso definida por usuario sin manejar"
# Note that the SQLSTATE is not 02000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_NOT_FOUND 02000
        chi "未找到的用户定义未找到条件"
        eng "Unhandled user-defined not found condition"
        ger "Unbehandelte benutzerdefinierte Nicht-gefunden-Bedingung"
        spa "Condición de no hallado definida por usuario sin manejar"
# Note that the SQLSTATE is not HY000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_EXCEPTION HY000
        chi "未处理用户定义的异常条件"
        eng "Unhandled user-defined exception condition"
        ger "Unbehandelte benutzerdefinierte Ausnahmebedingung"
        spa "Condición de excepción definida por usuario sin manejar"
ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 0K000
        chi "RESIGNAL处理程序不活跃"
        eng "RESIGNAL when handler not active"
        ger "RESIGNAL bei nicht aktivem Handler"
        spa "RESIGNAL cuando el manejador no activo"
ER_SIGNAL_BAD_CONDITION_TYPE
        chi "SIGNAL/RESIGNAL只能使用SQLState定义的条件"
        eng "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE"
        ger "SIGNAL/RESIGNAL kann nur mit einer Bedingung (CONDITION) benutzt werden, die bei SQLSTATE definiert wurde"
        spa "SIGNAL/RESIGNAL sólo pueden usar una CONDITION definida mediante SQLSTATE"
WARN_COND_ITEM_TRUNCATED
        chi "数据被截断为条件项目'%s'"
        eng "Data truncated for condition item '%s'"
        ger "Daten gekürzt für Bedingungselement '%s'"
        spa "Datos truncados para elemento de condición '%s'"
ER_COND_ITEM_TOO_LONG
        chi "条件项目'%s'的数据太长"
        eng "Data too long for condition item '%s'"
        ger "Daten zu lang für Bedingungselement '%s'"
        spa "Datos demasiados largos para elemento de condición '%s'"
ER_UNKNOWN_LOCALE
        chi "未知区域设置:'%-.64s'"
        eng "Unknown locale: '%-.64s'"
        ger "Unbekannte Locale: '%-.64s'"
        spa "Localización (locale) desconocida: '%-.64s'"
ER_SLAVE_IGNORE_SERVER_IDS
        chi "请求的服务器ID%d与SLAVE启动选项--replicate-same-server-id冲突"
        eng "The requested server id %d clashes with the slave startup option --replicate-same-server-id"
        ger "Die angeforderte Server-ID %d steht im Konflikt mit der Startoption --replicate-same-server-id für den Slave"
        spa "La id %d del servidor requerido choca con la opción de arranque del esclavo --replicate-same-server-id"
ER_QUERY_CACHE_DISABLED
        chi "查询缓存已禁用;将query_cache_type设置为ON或DEMAND启用它"
        eng "Query cache is disabled; set query_cache_type to ON or DEMAND to enable it"
        spa "Caché de consulta (query) desactivada; configura query_cache_type a ON o DEMAND para activarla"
ER_SAME_NAME_PARTITION_FIELD
        chi "重复分区字段名称'%-.192s'"
        eng "Duplicate partition field name '%-.192s'"
        ger "Partitionsfeld '%-.192s' ist ein Duplikat"
        spa "Nombre de campo de partición duplicado '%-.192s'"
ER_PARTITION_COLUMN_LIST_ERROR
        chi "分区用的列和列表使用不一致"
        eng "Inconsistency in usage of column lists for partitioning"
        ger "Inkonsistenz bei der Benutzung von Spaltenlisten für Partitionierung"
        spa "Inconsistencia en uso de listas de columna para particionar"
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
        chi "不正确类型的分区列值"
        eng "Partition column values of incorrect type"
        ger "Partitionsspaltenwerte sind vom falschen Typ"
        spa "Valores de columna de partición de tipo incorrecto"
ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR
        chi "'%-.192s'中的太多字段"
        eng "Too many fields in '%-.192s'"
        ger "Zu viele Felder in '%-.192s'"
        spa "Demasiados campos en '%-.192s'"
ER_MAXVALUE_IN_VALUES_IN
        chi "不能在VALUES IN使用MAXVALUE"
        eng "Cannot use MAXVALUE as value in VALUES IN"
        ger "MAXVALUE kann nicht als Wert in VALUES IN verwendet werden"
        spa "No puedo usar MAXVALUE como valor en VALUES IN"
ER_TOO_MANY_VALUES_ERROR
        chi "这种类型不能有多个值%-.64s 分区"
        eng "Cannot have more than one value for this type of %-.64s partitioning"
        ger "Für den Partionierungstyp %-.64s darf es nicht mehr als einen Wert geben"
        spa "No puedo tener más de un valor para este tipo de particionamiento %-.64s"
ER_ROW_SINGLE_PARTITION_FIELD_ERROR
        chi "仅允许的多字段列分区的VALUES IN的行表达式"
        eng "Row expressions in VALUES IN only allowed for multi-field column partitioning"
        ger "Zeilenausdrücke in VALUES IN sind nur für Mehrfeld-Spaltenpartionierung erlaubt"
        spa "Expresiones de fila en VALUES IN sólo permitidas para particionamiento de columna multi-campo"
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
        chi "字段'%-.192s'类型不允许为此类型的分区类型"
        eng "Field '%-.192s' is of a not allowed type for this type of partitioning"
        ger "Feld '%-.192s' ist für diese Art von Partitionierung von einem nicht zulässigen Typ"
        spa "El campo '%-.192s' es de un tipo no permitido para este tipo de particionado"
ER_PARTITION_FIELDS_TOO_LONG
        chi "分区字段的总长度太大"
        eng "The total length of the partitioning fields is too large"
        ger "Die Gesamtlänge der Partitionsfelder ist zu groß"
        spa "El tamaño total de los campos de particionado es demasiado grande"
ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE
        chi "无法执行语句:由于引擎不能支持行和语句,因此无法写入二进制日志"
        eng "Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que ambos motores de fila-incapaz y de sentencia-incapaz están involucrados"
ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
        chi "无法执行语句:由于BINLOG_FORMAT =ROW和至少一个表使用存储引擎限制为基于语句的日志记录,因此无法写入二进制日志"
        eng "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que BINLOG_FORMAT = ROW y al menos una tabla utiliza motor de almacenaje limitado a historiales basados en sentencia"
ER_BINLOG_UNSAFE_AND_STMT_ENGINE
        chi "无法执行语句:由于语句不安全,无法写入二进制日志,存储引擎仅限于基于语句的日志记录,而BINLOG_FORMAT = MIXED。%s."
        eng "Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %s"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que la sentencia no es segura, el motor de almacenaje está limitado a historial basado en sentencia y BINLOG_FORMAT = MIXED. %s"
ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE
        chi "无法执行语句:由于语句以行格式,至少一个表使用基于语句的日志记录的存储引擎,因此无法写入二进制日志。"
        eng "Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que la sentencia está en un formato de fila y al menos una tabla utiliza un motor de almacenaje limitado a historial basado en sentencia"
ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
        chi "无法执行语句:由于BINLOG_FORMAT = STATEMENT,并且至少一个表使用存储引擎限制为基于行的日志记录,因此无法写入二进制日志。%s"
        eng "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que BINLOG_FORMAT = STATEMENT y al menos una tabla utilizan un motor de almacenaje limitado a historial basado en fila. %s"
ER_BINLOG_ROW_INJECTION_AND_STMT_MODE
        chi "无法执行语句:由于语句的正常格式和BINLOG_FORMAT = STATEMENT,因此无法写入二进制日志"
        eng "Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que la sentencia está en formato de fila y BINLOG_FORMAT = STATEMENT"
ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE
        chi "无法执行语句:由于涉及多个引擎并且至少有一个引擎是自记录的,因此无法写入二进制日志。"
        eng "Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging"
        spa "No puedo ejecutar sentencia: imposible grabar historial (log) binario ya que hay más de un motor involucrado y al menos un motor usa auto-historial"
ER_BINLOG_UNSAFE_LIMIT
        chi "该语句不安全,因为它使用限制子句。这不安全,因为所包含的一组行无法预测"
        eng "The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted"
        spa "La sentencia no es segura debido a usar una cláusula LIMIT. No es segura porque el conjunto incluido de filas no se puede predecir"
ER_BINLOG_UNSAFE_INSERT_DELAYED
        chi "该声明不安全,因为它使用插入延迟。这是不安全的,因为无法预测插入行的时间"
        eng "The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted"
        spa "La sentencia no es segura debido a usar una INSERT DELAYED. No es segura porque los momentos en que las filas han de insertarse no se pueden predecir"
ER_BINLOG_UNSAFE_SYSTEM_TABLE
        chi "该声明不安全,因为它使用常规日志,慢查询日志或performance_schema表。这是不安全的,因为系统表可能在slave上不同"
        eng "The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves"
        spa "La sentencia no es segura debido a usar el historial (log) general, un historial (log) lento o tabla(s) de performance_schema. No es segura porque las tablas de sistema pueden diferir de las esclavas"
ER_BINLOG_UNSAFE_AUTOINC_COLUMNS
        chi "语句不安全,因为它调用了插入AUTO_INCREMENT列的触发器或存储函数。插入的值无法正确记录"
        eng "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly"
        spa "La sentencia no es segura debido a invocar un disparador o una función almacenada que inserta una columna de AUTO_INCREMENT. No se puede llevar historial correcto de Los valores insertados".
ER_BINLOG_UNSAFE_UDF
        chi "语句不安全,因为它使用了一个可能在从设备上返回相同值的UDF"
        eng "Statement is unsafe because it uses a UDF which may not return the same value on the slave"
        spa "La sentencia no es segura porque usa un UDF que puede no devolver el mismo valor en el esclavo"
ER_BINLOG_UNSAFE_SYSTEM_VARIABLE
        chi "语句不安全,因为它使用的系统变量可能在从站上具有不同的值"
        eng "Statement is unsafe because it uses a system variable that may have a different value on the slave"
        spa "La sentencia no es segura porque usa una variable de sistema que puede tener un valor diferente en el esclavo"
ER_BINLOG_UNSAFE_SYSTEM_FUNCTION
        chi "语句不安全,因为它使用系统函数可能在从站上返回不同的值"
        eng "Statement is unsafe because it uses a system function that may return a different value on the slave"
        spa "La sentencia no es segura porque usa una función de sistema que puede devolver un valor diferente en el esclavo"
ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS
        chi "语句不安全,因为它在访问同一事务中访问事务表后访问非事务性表"
        eng "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction"
        spa "La sentencia no es segura porque accede a una tabla no transaccional tras acceder a una transaccional dentro de la misma transacción"
ER_MESSAGE_AND_STATEMENT
  chi "%s.语句:%s"
  eng "%s. Statement: %s"
  spa "%s. Sentencia: %s"

ER_SLAVE_CONVERSION_FAILED
        chi "列%d表'%-.192s.%-.192s'无法从'%-.50s'类型为'%-.50s'"
        eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'"
        spa "La columna %d de la tabla '%-.192s.%-.192s' no puede ser convertida desde el tipo '%-.50s' al tipo '%-.50s'"
ER_SLAVE_CANT_CREATE_CONVERSION
        chi "无法为表创建转换表'%-.192s.%-.192s'"
        eng "Can't create conversion table for table '%-.192s.%-.192s'"
        spa "No puedo crear tabla de conversión para la tabla '%-.192s.%-.192s'"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
        chi "无法在事务中修改@@session.binlog_format"
        eng "Cannot modify @@session.binlog_format inside a transaction"
        spa "No puedo modificar @@session.binlog_format dentro de una transacción"
ER_PATH_LENGTH
        chi "指定%.64T的路径太长了"
        eng "The path specified for %.64T is too long"
        hindi "%.64T के लिए निर्दिष्ट पथ बहुत लंबा है"
        spa "La ruta especificada para %.64T es demasiado larga"
ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT  
        chi "'%s'被弃用,将在将来的版本中删除"
        eng "'%s' is deprecated and will be removed in a future release"
        ger "'%s' ist veraltet und wird in einer zukünftigen Version entfernt werden"
        spa "'%s' está obsoleto y será quitada en una entrega futura"
ER_WRONG_NATIVE_TABLE_STRUCTURE
        chi "本机表'%-.64s'。'%-.64s'具有错误的结构"
        eng "Native table '%-.64s'.'%-.64s' has the wrong structure"
        spa "La tabla nativa '%-.64s'.'%-.64s' tiene una estructura equivocada"
ER_WRONG_PERFSCHEMA_USAGE
        chi "performance_schema使用无效"
        eng "Invalid performance_schema usage"
        hindi "performance_schema का अवैध उपयोग"
        spa "Uso inválido de performance_schema"
ER_WARN_I_S_SKIPPED_TABLE
        chi "表'%s'.'%s'由于并发DDL语句正在修改其定义,因此跳过"
        eng "Table '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statement"
        spa "La tabla '%s'.'%s' fue saltada ya que su definición está siendo modificada por la sentencia DDL concurrente"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
        chi "无法在交易事务中修改@@session.binlog_direct_non_transactional_updates"
        eng "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction"
        spa "No puedo modificar @@session.binlog_direct_non_transactional_updates dentro de una transacción"
ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT
        chi "无法在存储的函数或触发器内更改Binlog Direct标志"
        eng "Cannot change the binlog direct flag inside a stored function or trigger"
        spa "No puedo cambiar la bandera directa de binlog dentro de una función almacenada o de un disparador"
ER_SPATIAL_MUST_HAVE_GEOM_COL 42000
        chi "空间索引可以仅包含几何类型列"
        eng "A SPATIAL index may only contain a geometrical type column"
        ger "Ein raumbezogener Index (SPATIAL) darf nur Spalten geometrischen Typs enthalten"
        spa "Un índice SPATIAL sólo puede contener una columna de tipo geométrico"
ER_TOO_LONG_INDEX_COMMENT
        chi "索引评论'%-.64s'太长(max =%lu)"
        eng "Comment for index '%-.64s' is too long (max = %lu)"
        spa "El comentario para el índice '%-.64s' es demasiado largo (máx = %lu)"
ER_LOCK_ABORTED
        chi "由于待处理的独家锁,等待锁被中止"
        eng "Wait on a lock was aborted due to a pending exclusive lock"
        spa "Se ha abortado la espera por un bloqueo debido a bloqueo exclusivo pendiente"
ER_DATA_OUT_OF_RANGE 22003 
        chi "%s值超出'%s'范围"
        eng "%s value is out of range in '%s'"
        spa "%s valor se encuentra fuera de rango '%s'"
ER_WRONG_SPVAR_TYPE_IN_LIMIT
        chi "基于非整数类型的基于LIMIT子句的变量"
        eng "A variable of a non-integer based type in LIMIT clause"
        spa "Una variable de tipo basado en no entero en cláusula LIMIT"
ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE
        chi "混合声明中的自记录和非自动记录引擎是不安全的"
        eng "Mixing self-logging and non-self-logging engines in a statement is unsafe"
        spa "No es segura la mezcla de motores de auto-historial (log) y de no auto-historial en una sentencia"
ER_BINLOG_UNSAFE_MIXED_STATEMENT
        chi "语句访问非致突变表以及事务性或临时表,并写入其中任何一个"
        eng "Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them"
        spa "La sentencia accede a tabla no transaccional así como transaccional o tabla temporal y graba en cualquiera de ellas"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN
        chi "无法修改事务中的@@sessient.sql_log_bin"
        eng "Cannot modify @@session.sql_log_bin inside a transaction"
        spa "No puedo modificar @@session.sql_log_bin dentro de una transacción"
ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN
        chi "无法在存储的函数或触发器内更改SQL_LOG_BIN"
        eng "Cannot change the sql_log_bin inside a stored function or trigger"
        spa "No puedo cambiar sql_log_bin dentro de una función almacenada o disparador"
ER_FAILED_READ_FROM_PAR_FILE
        chi "无法从.par文件中读取"
        eng "Failed to read from the .par file"
        hindi ".par फ़ाइल से पढ़ने में असफल रहे"
        spa "No pude leer desde fichero/archivo .par"
        swe "Misslyckades läsa från .par filen"
ER_VALUES_IS_NOT_INT_TYPE_ERROR
        chi "分区的值'%-.64s'必须具有类型INT"
        eng "VALUES value for partition '%-.64s' must have type INT"
        spa "El valor VALUES para la partición '%-.64s' debe de tener el tipo INT"
        swe "Värden i VALUES för partition '%-.64s' måste ha typen INT"
ER_ACCESS_DENIED_NO_PASSWORD_ERROR 28000 
        chi "拒绝用户'%s'@'%s'"
        cze "Přístup pro uživatele '%s'@'%s'"
        dan "Adgang nægtet bruger: '%s'@'%s'"
        eng "Access denied for user '%s'@'%s'"
        est "Ligipääs keelatud kasutajale '%s'@'%s'"
        fre "Accès refusé pour l'utilisateur: '%s'@'%s'"
        ger "Benutzer '%s'@'%s' hat keine Zugriffsberechtigung"
        greek "Δεν επιτέρεται η πρόσβαση στο χρήστη: '%s'@'%s'"
        hindi "यूज़र '%s'@'%s' को अनुमति नहीं है"
        hun "A(z) '%s'@'%s' felhasznalo szamara tiltott eleres"
        ita "Accesso non consentito per l'utente: '%s'@'%s'"
        kor "'%s'@'%s' 사용자는 접근이 거부 되었습니다."
        nla "Toegang geweigerd voor gebruiker: '%s'@'%s'"
        nor "Tilgang nektet for bruker: '%s'@'%s'"
        norwegian-ny "Tilgang ikke tillate for brukar: '%s'@'%s'"
        por "Acesso negado para o usuário '%s'@'%s'"
        rum "Acces interzis pentru utilizatorul: '%s'@'%s'"
        rus "Доступ закрыт для пользователя '%s'@'%s'"
        serbian "Pristup je zabranjen korisniku '%s'@'%s'"
        slo "Zakázaný prístup pre užívateľa: '%s'@'%s'"
        spa "Acceso denegado para usuario: '%s'@'%s'"
        swe "Användare '%s'@'%s' är ej berättigad att logga in"
        ukr "Доступ заборонено для користувача: '%s'@'%s'"

ER_SET_PASSWORD_AUTH_PLUGIN
        chi "SET PASSWORD不适用于通过%s插件验证的用户"
        eng "SET PASSWORD is not applicable for users authenticating via %s plugin"
        ukr "SET PASSWORD не можна застосувати для користувачів, що автентифікуються з допомогою плагінy %s"

ER_GRANT_PLUGIN_USER_EXISTS
        chi "由于用户%-.*s已经存在,GRANT IDENTIFIED WITH授权是非法的"
        eng "GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists"
        spa "GRANT con IDENTIFIED WITH es ilegal porque el usuario %-.*s ya existe"

ER_TRUNCATE_ILLEGAL_FK 42000
        chi "无法截断外键约束中引用的表(%.192s)"
        eng "Cannot truncate a table referenced in a foreign key constraint (%.192s)"
        spa "No puedo truncar una tabla referenciada en una restricción de clave foránea (%.192s)"

ER_PLUGIN_IS_PERMANENT
        chi "插件'%s'是force_plus_permanent,无法卸载"
        eng "Plugin '%s' is force_plus_permanent and can not be unloaded"
        spa "El enchufe (plugin) '%s' está force_plus_permanent y no puede ser descargado"

ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN
        chi "心跳期的要求值小于1毫秒。该值重置为0,这意味着心跳将有效地禁用"
        eng "The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled"
        spa "El valor de requerimiento para el período de latido es menor de 1 milisegundo. El valor se vuelve a poner a 0, indicando que el latido será efectivamente desactivado"

ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX
        chi "心跳期的请求值超出了“slave_net_timeout”秒的值。该期间的明智价值应小于超时"
        eng "The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout"
        spa "El valor de requerimiento para el período de latido excede el valor de `slave_net_timeout` segundos. Un valor sensible para el período debería de ser menor que el 'tiempo agotado'"

ER_STMT_CACHE_FULL  
        chi "需要多行语句超过“max_binlog_stmt_cache_size”字节的存储;增加这个mariadbd变量,然后重试"
        eng "Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage."
        spa "Las sentencias Multi-fila requieren de más de 'max_binlog_stmt_cache_size' bytes para almacenaje."

ER_MULTI_UPDATE_KEY_CONFLICT
        chi "由于表格被更新为'%-.192s'和'%-.192s',因此不允许允许主键/分区索引更新。"
        eng "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'"
        spa "La actualización de clave primaria de o de partición no está permitida por estar la tabla actualizada como '%-.192s' y '%-.192s'"
# When translating this error message make sure to include "ALTER TABLE" in the
# message as mariadb-check parses the error message looking for ALTER TABLE.
ER_TABLE_NEEDS_REBUILD
        chi "表需重建。请做ALTER TABLE %`s FORCE”或转储/重新加载以修复它!"
        eng "Table rebuild required. Please do \"ALTER TABLE %`s FORCE\" or dump/reload to fix it!"
        spa "Se requiere reconstrucción de la tabla. Por favor, ¡haga un \"ALTER TABLE %`s FORCE\" o volcado/recarga para solucionarlo!"

WARN_OPTION_BELOW_LIMIT
        chi "'%s'的值应该不小于'%s'的值"
        eng "The value of '%s' should be no less than the value of '%s'"
        spa "El valor de '%s' debería de ser no menor que el valor de '%s'"

ER_INDEX_COLUMN_TOO_LONG
        chi "索引列太大。最大列大小为%lu字节"
        eng "Index column size too large. The maximum column size is %lu bytes"
        spa "El tamaño de índice de columna es demasiado grande. El tamaño máximo de columna es de %lu bytes"

ER_ERROR_IN_TRIGGER_BODY
        chi "触发器'%-.64s'内存在错误:'%-.256s'"
        eng "Trigger '%-.64s' has an error in its body: '%-.256s'"
        spa "El disparador '%-.64s' tiene una error en su cuerpo: '%-.256s'"

ER_ERROR_IN_UNKNOWN_TRIGGER_BODY
        chi "未知触发器内存在错误:'%-.256s'"
        eng "Unknown trigger has an error in its body: '%-.256s'"
        spa "El disparador desconocido tiene un error en su cuerpo: '%-.256s'"

ER_INDEX_CORRUPT
        chi "索引%s已损坏"
        eng "Index %s is corrupted"
        spa "El índice %s está estropeado"

ER_UNDO_RECORD_TOO_BIG
        chi "撤消日志记录太大"
        eng "Undo log record is too big"
        spa "El registro de historial (log) para deshacer es demasiado grande"

ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT
        chi "INSERT IGNORE...SELECT不安全,因为选择由select检索行的顺序确定哪个(如果有)行被忽略。无法预测此顺序,并且在master和slave方面可能有所不同" 
        eng "INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave"
        spa "INSERT IGNORE... SELECT es no seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son ignoradas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE
        chi "INSERT... SELECT... ON DUPLICATE KEY UPDATE是不安全的,因为SELECT检索行的顺序确定哪个(如果有的话)是更新的。无法预测此顺序,并且在master和slave方面可能有所不同"
        eng "INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave"
        spa "INSERT... SELECT... ON DUPLICATE KEY UPDATE no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son actualizadas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_REPLACE_SELECT
        chi "REPLACE... SELECT 不安全,因为选择由select检索行的顺序确定哪个(如果有)行被替换。无法预测此顺序,并且在master和slave方面可能有所不同"
        eng "REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave"
        spa "REPLACE... SELECT no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son sustituidas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT
        chi "CREATE... IGNORE SELECT是不安全,因为选择由SELECT检索行的顺序确定哪个(如果有)行被忽略。无法预测此顺序,并且在master和slave方面可能有所不同"
        eng "CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave"
        spa "CREATE... IGNORE SELECT no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son ignoradas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT
        chi "CREATE... REPLACE SELECT不安全,因为选择由SELECT检索行的顺序确定哪个(如果有)是替换哪个(如果有的话)。无法预测此顺序,并且在master和slave方面可能有所不同"
        eng "CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave"
        spa "CREATE... REPLACE SELECT no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son sustituidas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_UPDATE_IGNORE
        chi "UPDATE IGNORE不安全,因为更新行的顺序确定了哪个(如果有)行被忽略。无法预测此顺序,并且在master和slave方面可能有所不同"
        eng "UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave"
        spa "UPDATE IGNORE no es seguro porque el orden en el que las filas son actualizadas determina qué filas (si hay alguna) son ignoradas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_UNUSED_15
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_UNUSED_16
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT
        chi "从另一个表选择后,使用自动增量列的表格写入的语句是不安全的,因为检索行的顺序确定将写入哪些(如果有)行。无法预测此顺序,并且在主站和slave方面可能有所不同"
        eng "Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave"
        spa "Las sentencias que graban en una tabla con columna de auto-incremento tras seleccionar desde otra tabla no son seguras porque el orden en el que las filas son recuperadas determina qué filas (si hay alguna) serán grabadas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC
        chi "创建表...在具有自动增量列的表上选择...不安全,因为选择的顺序是由select检索行的顺序,确定插入哪个(如果有)行。无法预测此订单,并且在主站和slave方面可能有所不同"
        eng "CREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave"
        spa "CREATE TABLE... SELECT... en una tabla con columna de auto-incremento no es segura porque el orden en el que las filas son recuperadas por el SELECT determina qué filas (si hay alguna) serán insertadas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavo"

ER_BINLOG_UNSAFE_INSERT_TWO_KEYS
        chi "在具有多个唯一键的表上INSERT... ON DUPLICATE KEY UPDATE的重复索引更新是不安全的"
        eng "INSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafe"
        spa "INSERT... ON DUPLICATE KEY UPDATE en una tabla con más de una UNIQUE KEY no es segura"

ER_UNUSED_28
        chi "你永远不应该看到它"
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_VERS_NOT_ALLOWED
        chi "系统版本的表%`s.%`s不允许"
        eng "Not allowed for system-versioned table %`s.%`s"

ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST
        chi "插入AutoIncrement字段,该字段不是组成的主键中的第一部分是不安全的"
        eng "INSERT into autoincrement field which is not the first part in the composed primary key is unsafe"
        spa "INSERT dentro de campo con autoincremento que no es la primera parte en la clave primaria compuesta no es seguro"
#
#  End of 5.5 error messages.
#

ER_CANNOT_LOAD_FROM_TABLE_V2
        chi "不能从加载%s.%s。表可能损坏了"
        eng "Cannot load from %s.%s. The table is probably corrupted"
        ger "Kann %s.%s nicht einlesen. Tabelle ist wahrscheinlich beschädigt"
        spa "No puedo cargar desde %s.%s. La tabla está probablemente estropeada"

ER_MASTER_DELAY_VALUE_OUT_OF_RANGE
        chi "主延迟的所需值%lu超过最大%lu"
        eng "The requested value %lu for the master delay exceeds the maximum %lu"
        spa "El valor requerido %lu para retraso en maestro (master) excede el máximo de %lu"
ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT
        chi "在Binlog语句中只允许Format_Description_Log_Event和行事件(但是提供了%s)"
        eng "Only Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)"
        spa "Sólo se permiten Format_description_log_event y eventos de fila en sentencias BINLOG (pero %s fue suministrado)"

ER_PARTITION_EXCHANGE_DIFFERENT_OPTION
        chi "分区和表之间的非匹配属性'%-.64s'"
        eng "Non matching attribute '%-.64s' between partition and table"
        spa "Atributo no coincidente '%-.64s' entre la partición y la tabla"
        swe "Attributet '%-.64s' är olika mellan partition och tabell"
ER_PARTITION_EXCHANGE_PART_TABLE
        chi "用分区交换的表是分区:'%-.64s'"
        eng "Table to exchange with partition is partitioned: '%-.64s'"
        spa "La tabla para intercambiar con la partición está particionada: '%-.64s'"
        swe "Tabellen att byta ut mot partition är partitionerad: '%-.64s'"
ER_PARTITION_EXCHANGE_TEMP_TABLE
        chi "与分区交换的表是临时的:'%-.64s'"
        eng "Table to exchange with partition is temporary: '%-.64s'"
        spa "La tabla para intercambiar con la partición es temporal: '%-.64s'"
        swe "Tabellen att byta ut mot partition är temporär: '%-.64s'"
ER_PARTITION_INSTEAD_OF_SUBPARTITION
        chi "子分区表,使用子分区代替分区"
        eng "Subpartitioned table, use subpartition instead of partition"
        spa "La tabla subparticionada utiliza subpartición en lugar de partición"
        swe "Subpartitionerad tabell, använd subpartition istället för partition"
ER_UNKNOWN_PARTITION
        chi "未知分区'%-.64s'在表'%-.64s'"
        eng "Unknown partition '%-.64s' in table '%-.64s'"
        spa "Partición desconocida '%-.64s' en la tabla '%-.64s'"
        swe "Okänd partition '%-.64s' i tabell '%-.64s'"
ER_TABLES_DIFFERENT_METADATA
        chi "表有不同的定义"
        eng "Tables have different definitions"
        spa "Las tablas tienen diferentes definiciones"
        swe "Tabellerna har olika definitioner"
ER_ROW_DOES_NOT_MATCH_PARTITION
        chi "找到了与分区不匹配的行"
        eng "Found a row that does not match the partition"
        spa "Hallada una fila que no coincide con la partición"
        swe "Hittade en rad som inte passar i partitionen"
ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX
        chi "选项binlog_cache_size(%lu)大于max_binlog_cache_size(%lu);设置binlog_cache_size等于max_binlog_cache_size"
        eng "Option binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_size"
        spa "La opción binlog_cache_size (%lu) es mayor que max_binlog_cache_size (%lu); configurando binlog_cache_size igual a max_binlog_cache_size"
ER_WARN_INDEX_NOT_APPLICABLE
        chi "不能使用%-.64s在索引'%-.64s'上的访问,由于字段'%-.64s”的类型或排序规则转换"
        eng "Cannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'"
        spa "No puedo usar acceso %-.64s en índice '%-.64s' debido al tipo o conversión de cotejo en campo '%-.64s'"

ER_PARTITION_EXCHANGE_FOREIGN_KEY
        chi "与分区交换的表具有外键参考:'%-.64s'"
        eng "Table to exchange with partition has foreign key references: '%-.64s'"
        spa "La tabla para intercambiar con la partición tiene referencias a clave foránea: '%-.64s'"
        swe "Tabellen att byta ut mot partition har foreign key referenser: '%-.64s'"
ER_NO_SUCH_KEY_VALUE
        chi "键值'%-.192s'在表'%-.192s%-.192s'不存在"
        eng "Key value '%-.192s' was not found in table '%-.192s.%-.192s'"
        spa "Valor de clave '%-.192s' no hallado en la tabla '%-.192s.%-.192s'"
ER_VALUE_TOO_LONG
        chi "'%s'的价值太长了"
        eng "Too long value for '%s'"
        spa "Valor demasiado largo para '%s'"
ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
        chi "从网络读取时,复制事件校验和验证失败"
        eng "Replication event checksum verification failed while reading from network"
        spa "Ha fallado la verificación de la suma de revisión de evento de réplica mientras se leía desde la red"
ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE
        chi "从日志文件读取时复制事件校验和验证失败"
        eng "Replication event checksum verification failed while reading from a log file"
        spa "Ha fallado la verificación de la suma de revisión de evento de réplica mientras se leía desde fichero/archivo de historial (log)"

ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX
        chi "选项binlog_stmt_cache_size(%lu)大于max_binlog_stmt_cache_size(%lu);设置binlog_stmt_cache_size等于max_binlog_stmt_cache_size"
        eng "Option binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_size"
        spa "La opción binlog_stmt_cache_size (%lu) es mayor que max_binlog_stmt_cache_size (%lu); configurando binlog_stmt_cache_size igual a max_binlog_stmt_cache_size"
ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT
        chi "无法更新表'%-.192s'正在创建'%-.192s'"
        eng "Can't update table '%-.192s' while '%-.192s' is being created"
        spa "No puedo actualizar tabla '%-.192s' mientras '%-.192s' está siendo creada"

ER_PARTITION_CLAUSE_ON_NONPARTITIONED
        chi "非分区表上的PARTITION()子句"
        eng "PARTITION () clause on non partitioned table"
        spa "Cláusula PARTITION () en tabla no particionada"
        swe "PARTITION () klausul för en icke partitionerad tabell"
ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET
        chi "发现不匹配给定分区集的行"
        eng "Found a row not matching the given partition set"
        spa "Hallada una fila que no coincide con el conjunto dado de partición"
        swe "Hittade en rad som inte passar i någon given partition"

ER_UNUSED_5
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE
        chi "更改Replication存储库类型时失败:%s"
        eng "Failure while changing the type of replication repository: %s"
        spa "Fallo mientras cambiaba el tipo de repositorio de réplica: %s"

ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE
        chi "无法回滚一些临时表的创建"
        eng "The creation of some temporary tables could not be rolled back"
        spa "La creación de algunas tablas temporales no se pudo retroceder (ROLLBACK)"
ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE
        chi "一些临时表被删除,但这些操作无法回滚"
        eng "Some temporary tables were dropped, but these operations could not be rolled back"
        spa "Algunas tablas temporales fueron eliminadas, pero estas operaciones no se pudieron retroceder (ROLLBACK)"

ER_MTS_FEATURE_IS_NOT_SUPPORTED
        chi "%s不支持多线程从模式。%s."
        eng "%s is not supported in multi-threaded slave mode. %s"
        spa "%s no se soporta en modo esclavo multi-hilo (thread). %s"
ER_MTS_UPDATED_DBS_GREATER_MAX
        chi "修改的数据库的数量超过了最大%d;数据库名称不会包含在Replication事件元数据中"
        eng "The number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadata"
        spa "El núermo de bases de datos modificadas excede el máximo de %d; los nombres de base de datos no serán incluidos en los metadatos de eventos de réplica"
ER_MTS_CANT_PARALLEL
        chi "无法以并行模式执行当前事件组。遇到事件%s,中继日志名称%s,position%s,它防止并行模式执行此事件组。原因:%s"
        eng "Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s"
        spa "No puedo ejecutar el grupo de eventos actual en modo paralelo. Encontrado evento %s, nombre de historial (log) de reenvío %s, posición %s que previene la ejecución de este grupo de eventos en modo paralelo. Motivo: %s"
ER_MTS_INCONSISTENT_DATA
        eng "%s"

ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING
        chi "分区表不支持FullText索引"
        eng "FULLTEXT index is not supported for partitioned tables"
        spa "El índice FULLTEXT no está soportado para tablas particionadas"
        swe "FULLTEXT index stöds ej för partitionerade tabeller"

ER_DA_INVALID_CONDITION_NUMBER 35000
        chi "无效条件号"
        eng "Invalid condition number"
        por "Número de condição inválido"
        spa "Número inválido de condición"

ER_INSECURE_PLAIN_TEXT
        chi "在没有SSL/TLS的纯文本中发送密码非常不安全"
        eng "Sending passwords in plain text without SSL/TLS is extremely insecure"
        spa "Enviar contraseñas en texto plano sin SSL/TLS es extremadamente inseguro"

ER_INSECURE_CHANGE_MASTER
        chi "在Master.Info存储库中存储MariaDB用户名或密码信息不安全,因此不建议使用。有关此问题和可能的替代方案,请参阅MariaDB手册"
        eng "Storing MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternatives"
        spa "Almacenar nombre de usuario de MariaDB o información de contraseña en el repositorio master.info no es seguro y por ello no se recomienda. Por favor, mira el manual de MariaDB para saber más acerca de este asunto y sus posibles alternativas"

ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO 23000 S1009
        chi "表'%.192s'的外键约束,记录'%-.192s'会导致表'%.192s'中的重复条目,键'%.192s'"
        eng "Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'"
        ger "Fremdschlüssel-Beschränkung für Tabelle '%.192s', Datensatz '%-.192s' würde zu einem doppelten Eintrag in Tabelle '%.192s', Schlüssel '%.192s' führen"
        spa "La restricción de clave foránea para tabla '%.192s', registro '%-.192s' llevaría a una entrada duplicada en la tabla '%.192s', clave '%.192s'"
        swe "FOREIGN KEY constraint för tabell '%.192s', posten '%-.192s' kan inte uppdatera barntabell '%.192s' på grund av nyckel '%.192s'"

ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO 23000 S1009
        chi "表'%.192s'的外键约束,记录'%-.192s'会导致子表中的重复条目"
        eng "Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child table"
        ger "Fremdschlüssel-Beschränkung für Tabelle '%.192s', Datensatz '%-.192s' würde zu einem doppelten Eintrag in einer Kind-Tabelle führen"
        spa "La restricción de clave foránea para tabla '%.192s', registro '%-.192s' llevaría a una entrada duplicada en una tabla hija"
        swe "FOREIGN KEY constraint för tabell '%.192s', posten '%-.192s' kan inte uppdatera en barntabell på grund av UNIQUE-test"

ER_SQLTHREAD_WITH_SECURE_SLAVE
        chi "仅在启动从SQL线程时无法设置身份验证选项"
        eng "Setting authentication options is not possible when only the Slave SQL Thread is being started"
        spa "Configurar opciones de autenticación no es posible si sólo se ha arrancado el Hilo (thread) SQL Esclavo"

ER_TABLE_HAS_NO_FT
        chi "该表没有全文索引来支持此查询"
        eng "The table does not have FULLTEXT index to support this query"
        spa "La tabla no tiene índice FULLTEXT que soporte esta consulta (query)"

ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER
        chi "无法在存储的函数或触发器中设置系统变量%.200s"
        eng "The system variable %.200s cannot be set in stored functions or triggers"
        spa "La variable de sistema %.200s no se puede poner en funciones almacenadas o disparadores"

ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION
        chi "持续交易时,无法设置系统变量%.200s"
        eng "The system variable %.200s cannot be set when there is an ongoing transaction"
        spa "La variable de sistema %.200s no se puede poner si hay una transacción en curso"

ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST
        chi "系统变量@@session.gtid_next具有值%.200s,该值未在@@session.gtid_next_list中列出"
        eng "The system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LIST"
        spa "La variable de sistema @@SESSION.GTID_NEXT tiene el valor %.200s, el cual no está listado en @@SESSION.GTID_NEXT_LIST"

ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL
        chi "当@@session.gtid_next_list == null时,系统变量@@session.gtid_next无法在事务内更改"
        eng "When @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transaction"
        spa "Cuando @@SESSION.GTID_NEXT_LIST == NULL, la variable de sistema @@SESSION.GTID_NEXT no puede cambiar dentro de una transacción"

ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION
        chi "语句'SET %.200s'无法调用存储的函数"
        eng "The statement 'SET %.200s' cannot invoke a stored function"
        spa "La sentencia 'SET %.200s' no puede invocar una función almacenada"

ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL
        chi "系统变量@@sessient.gtid_next不能是'自动'@@sessient.gtid_next_list非null时"
        eng "The system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULL"
        spa "La variable de sistema @@SESSION.GTID_NEXT no puede ser 'AUTOMATIC' si la @@SESSION.GTID_NEXT_LIST es no-NULL"

ER_SKIPPING_LOGGED_TRANSACTION
        chi "跳过事务%.200s,因为它已经被执行和记录"
        eng "Skipping transaction %.200s because it has already been executed and logged"
        spa "Saltando transacción %.200s porque ya ha sido ejecutada y puesta en historial (log)"

ER_MALFORMED_GTID_SET_SPECIFICATION
        chi "畸形GTID设置规范'%.200s'"
        eng "Malformed GTID set specification '%.200s'"
        spa "GTID malformado pone especificación '%.200s'"

ER_MALFORMED_GTID_SET_ENCODING
        chi "格式错误的GTID集编码"
        eng "Malformed GTID set encoding"
        spa "GTID malformado pone codificación"

ER_MALFORMED_GTID_SPECIFICATION
        chi "畸形GTID规范'%.200s'"
        eng "Malformed GTID specification '%.200s'"
        spa "GTID malformado especificación '%.200s'"

ER_GNO_EXHAUSTED
        chi "无法生成全局事务标识符:整数组件达到了最大值。用新server_uuId重新启动服务器"
        eng "Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuid"
        spa "Imposible generar Identificador Global de Transacción: el componente entero alcanzó el máximo valor. Rearranque el servidor con un nuevo server_uuid"

ER_BAD_SLAVE_AUTO_POSITION
        chi "当MASTER_AUTO_POSITION处于活动状态时,无法设置参数MASTER_LOG_FILE,MASTER_LOG_POS,RELAY_LOG_FILE和RELAY_LOG_POS"
        eng "Parameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is active"
        spa "Los parámetros MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE y RELAY_LOG_POS no pueden ser puestos cuando MASTER_AUTO_POSITION esté activo"

ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON
        chi "CHANGE MASTER TO MASTER_AUTO_POSITION = 1只能在GTID_MODE = ON上执行"
        eng "CHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ON"
        spa "CHANGE MASTER TO MASTER_AUTO_POSITION = 1 sólo se puede ejecutar cuando GTID_MODE = ON"

ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET
        chi "当GTID_Next != AUTOMATIC 或GTID_NEXT_LIST != NULL时,无法在事务中执行语句"
        eng "Cannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULL"
        spa "No puedo ejecutar sentencias con acometidas (commit) implícitas dentro de una transacción cuando GTID_NEXT != AUTOMATIC o GTID_NEXT_LIST != NULL"

ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON
        chi "GTID_MODE = ON或GTID_MODE = UPGRADE_STEP_2需要ENFORCE_GTID_CONSISTY = 1"
        eng "GTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1"
        spa "GTID_MODE = ON o GTID_MODE = UPGRADE_STEP_2 requiere que ENFORCE_GTID_CONSISTENCY = 1"

ER_GTID_MODE_REQUIRES_BINLOG
        chi "GTID_MODE = ON或UPGRADE_STEP_1或UPGRADE_STEP_2需要--log-bin和-log-slave-updates"
        eng "GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updates"
        spa "GTID_MODE = ON o UPGRADE_STEP_1 o UPGRADE_STEP_2 requiere --log-bin y --log-slave-updates"

ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF
        chi "GTID_NEXT无法设置为UUID:NUMBER 当GTID_MODE = OFF"
        eng "GTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFF"
        spa "GTID_NEXT no se puede poner a UUID:NUMBER cuando GTID_MODE = OFF"

ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON
        chi "GTID_NEXT无法在当GTID_MODE = ON上时设置为ANONYMOUS"
        eng "GTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ON"
        spa "GTID_NEXT no se puede poner como ANONYMOUS cuando GTID_MODE = ON"

ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF
        chi "GTID_NEXT_LIST无法设置为非空值当GTID_MODE = OFF"
        eng "GTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFF"
        spa "GTID_NEXT_LIST no se puede poner como valor no-NULL cuando GTID_MODE = OFF"

ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF
        chi "找到一个Gtid_log_event或Previous_gtids_log_event,当gtid_mode = OFF时"
        eng "Found a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFF"
        spa "Hallado un Gtid_log_event o Previous_gtids_log_event cuando GTID_MODE = OFF"

ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE
        chi "当Enforce_gtid_consistenty = 1时,对非事务性表的更新只能在Autocomated语句或单一语句事务中完成,而不是在与事务表中的更新相同的语句中"
        eng "When ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables"
        spa "Cuando ENFORCE_GTID_CONSISTENCY = 1, las actualiaciones a tablas no transaccionales sólo se puede hacer o bien en sentencias autoacometidas o en transacciones de sentencias simples y nunca dentro de la misma sentencia como actualizaciones a tablas transaccionales"

ER_GTID_UNSAFE_CREATE_SELECT
        chi "CREATE TABLE...SELECT在ENFORCE_GTID_CONSISTENCY = 1时被禁止"
        eng "CREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1"
        spa "CREATE TABLE ... SELECT está prohibido si ENFORCE_GTID_CONSISTENCY = 1"

ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION
        chi "当ENFORCE_GTID_CONSISTENCY = 1时,语句CREATE TEMPORARY TABL和DROP TEMPORARY TABLE,只能在非事务性上下文中执行,并且要求autocommit = 1"
        eng "When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1"
        spa "Cuando ENFORCE_GTID_CONSISTENCY = 1, las sentencias CREATE TEMPORARY TABLE y DROP TEMPORARY TABLE pueden ser ejecutadas sólo en contextos no-transaccionales y requieren que AUTOCOMMIT = 1"

ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME
        chi "GTID_MODE的值只能一次更改一步:OFF<-> UPGRODE_STEP_1 <-> UPGRODE_STEP_2 <-> ON。另请注意,此值必须在所有服务器上同时上升或下降;有关说明,请参阅手册。“"
        eng "The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions." 
        spa "El valor de GTID_MODE sólo puede cambiar un paso a la vez: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. También ten en cuenta que este valor debe de ser aumentado y disminuido simultaneamente en todos los servidores; mira el Manual para instrucciones."

ER_MASTER_HAS_PURGED_REQUIRED_GTIDS
        chi "从机更改主站到Master_Auto_Position = 1,因此主站连接,但主设备已清除了slave需要的GTID的二进制日志"
        eng "The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires"
        spa "El esclavo se está conectando usando CHANGE MASTER TO MASTER_AUTO_POSITION = 1, pero el maestro (master) ha purgado los historiales (logs) binarios que contienen GTIDs requeridos por el esclavo"

ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID
        chi "无法由拥有GTID的客户端更改GTID_NEXT。客户拥有%s。所有权在提交或回滚上发布"
        eng "GTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACK"
        spa "GTID_NEXT no se puede cambiar por un cliente que posee un GTID. El cliente posee %s. La propiedad se libera con COMMIT o ROLLBACK"

ER_UNKNOWN_EXPLAIN_FORMAT
        chi "未知%s格式名称:'%s'"
        eng "Unknown %s format name: '%s'"
        rus "Неизвестное имя формата команды %s: '%s'"
        spa "Nombre de formato %s desconocido: '%s'"

ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION 25006
        chi "无法在只读事务中执行语句"
        eng "Cannot execute statement in a READ ONLY transaction"
        spa "No puedo ejecutar sentencia en una transacción READ ONLY"

ER_TOO_LONG_TABLE_PARTITION_COMMENT
        chi "表分区的评论'%-.64s'太长(max =%lu)"
        eng "Comment for table partition '%-.64s' is too long (max = %lu)"
        spa "El comentario para partición de tabla '%-.64s' es demasido largo (máx = %lu)"

ER_SLAVE_CONFIGURATION
        chi "从站未配置或未能正确初始化。您必须至少set --server-id以启用主站或从站。可以在MariaDB错误日志中找到其他错误消息"
        eng "Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error log"
        spa "El esclavo no está configurado o falló al inicializarse de forma adecuada. Vd debe de poner al menos --server-id para activar o bien un maestro (master) o un esclavo. Mensajes de error adicionales pueden ser hallados en historial (log) de errores de MariaDB"

ER_INNODB_FT_LIMIT
        chi "InnoDB目前一次支持一个全文索引创建"
        eng "InnoDB presently supports one FULLTEXT index creation at a time"
        spa "Actualmente InnoDB soporta la creación de un índice FULLTEXT a la vez"

ER_INNODB_NO_FT_TEMP_TABLE
        chi "无法在临时InnoDB表上创建FullText索引"
        eng "Cannot create FULLTEXT index on temporary InnoDB table"
        spa "No puedo crear índice FULLTEXT en tabla temporaria InnoDB"

ER_INNODB_FT_WRONG_DOCID_COLUMN
        chi "列'%-.192s'是innodb fulltext索引的错误类型"
        eng "Column '%-.192s' is of wrong type for an InnoDB FULLTEXT index"
        spa "La columna '%-.192s' es de tipo equivocado para un índice InnoDB FULLTEXT"

ER_INNODB_FT_WRONG_DOCID_INDEX
        chi "InnoDB全文索引的索引'%-.192s'是错误的类型错误"
        eng "Index '%-.192s' is of wrong type for an InnoDB FULLTEXT index"
        spa "El índice '%-.192s' es de tipo equivocado para un índice InnoDB FULLTEXT"

ER_INNODB_ONLINE_LOG_TOO_BIG
        chi "创建索引'%-.192s'所需的多于'innodb_online_alter_log_max_size'字节的修改日志。请再试一次"
        eng "Creating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again"
        spa "La creación de índice '%-.192s' requirió más de 'innodb_online_alter_log_max_size' bytes de historial (log) de modificaciones. Por favor, pruebe otra vez"

ER_UNKNOWN_ALTER_ALGORITHM
        chi "未知算法'%s'"
        eng "Unknown ALGORITHM '%s'"
        spa "ALGORITHM desconocido '%s'"

ER_UNKNOWN_ALTER_LOCK
        chi "未知锁定类型'%s'"
        eng "Unknown LOCK type '%s'"
        spa "Tipo de LOCK desconocido '%s'"

ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS
        chi "当从站因为错误停止或以MTS模式终止时,不呢执行CHANGE MASTER。考虑使用RESET SLAVE或START SLAVE UNTIL"
        eng "CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL"
        spa "CHANGE MASTER no se puede ejecutar cuando se ha parado el esclavo con un error o matado en modo MTS. Considere el usar RESET SLAVE o START SLAVE UNTIL"

ER_MTS_RECOVERY_FAILURE
        chi "从并行执行模式下的从站错误后无法恢复。可以在MariaDB错误日志中找到其他错误消息"
        eng "Cannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error log"
        spa "No puedo recuperar después de que SLAVE diera error en modo paralelo de ejecución. Mensajes de error adicionales se pueden hallar en el historial (log) de error de MariaDB"

ER_MTS_RESET_WORKERS
        chi "无法清理工作者信息表。可以在MariaDB错误日志中找到其他错误消息"
        eng "Cannot clean up worker info tables. Additional error messages can be found in the MariaDB error log"
        spa "No puedo limpiar tablas de información de trabajador. Mensajes de error adicionales se pueden hallar en el historial (log) de error de MariaDB"

ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2
        chi "列数为%s.%s是错误的。预期的%d,找到%d。表可能损坏了"
        eng "Column count of %s.%s is wrong. Expected %d, found %d. The table is probably corrupted"
        ger "Spaltenanzahl von %s.%s falsch. %d erwartet, aber %d gefunden. Tabelle ist wahrscheinlich beschädigt"
        spa "El contador de columnas %s.%s está equivocado. Se esperaba %d, hallado %d. La tabla está probablemente estropeada"

ER_SLAVE_SILENT_RETRY_TRANSACTION
        chi "从站必须静默地重试当前事务"
        eng "Slave must silently retry current transaction"
        spa "El esclavo debe de reintentar silenciosamente la transacción en curso"

ER_UNUSED_22
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_TABLE_SCHEMA_MISMATCH
        chi "架构不匹配(%s)"
        eng "Schema mismatch (%s)"
        spa "Esquema no coincide (%s)"

ER_TABLE_IN_SYSTEM_TABLESPACE
        chi "表%-.192s在系统表空间中"
        eng "Table %-.192s in system tablespace"
        spa "Tabla %-.192s en espacio de tablas del sitema"

ER_IO_READ_ERROR
        chi "IO读取错误:(%lu,%s)%s"
        eng "IO Read error: (%lu, %s) %s"
        spa "Error de Lectura de E/S: (%lu, %s) %s"

ER_IO_WRITE_ERROR
        chi "IO写错错误:(%lu,%s)%s"
        eng "IO Write error: (%lu, %s) %s"
        spa "Error de Escritura de E/S: (%lu, %s) %s"

ER_TABLESPACE_MISSING
        chi "表空间缺少表'%-.192s'"
        eng "Tablespace is missing for table '%-.192s'"
        spa "Espacio de tabla falta para la tabla '%-.192s'"

ER_TABLESPACE_EXISTS
        chi "表格'%-.192s'的表空间。请在导入之前丢弃表空间"
        eng "Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORT"
        spa "Existe Espacio de tabla para la tabla '%-.192s'. Por favor, haga DISCARD del espacio de tabla antes de hacer IMPORT"

ER_TABLESPACE_DISCARDED
        chi "表空间已被丢弃为表%`s"
        eng "Tablespace has been discarded for table %`s"
        spa "El espacio de tabla ha sido descartado para la tabla %`s"

ER_INTERNAL_ERROR
        chi "内部错误:%-.192s"
        eng "Internal error: %-.192s"
        spa "Error interno: %-.192s"

ER_INNODB_IMPORT_ERROR
        chi "ALTER TABLE '%-.192s' IMPORT TABLESPACE 失败,错误%lu:'%s'"
        eng "ALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'"
        spa "ALTER TABLE '%-.192s' IMPORT TABLESPACE ha fallado con error %lu : '%s'"

ER_INNODB_INDEX_CORRUPT
        chi "索引损坏:%s"
        eng "Index corrupt: %s"
        spa "Índice corrupto: %s"

ER_INVALID_YEAR_COLUMN_LENGTH
        chi "已弃用YEAR(%lu)列类型。创建YEAR(4)列代替"
        eng "YEAR(%lu) column type is deprecated. Creating YEAR(4) column instead"
        rus "Тип YEAR(%lu) более не поддерживается, вместо него будет создана колонка с типом YEAR(4)"
        spa "El tipo de columna YEAR(%lu) está obsoleto. Creando columna YEAR(4) en su lugar"

ER_NOT_VALID_PASSWORD
        eng "Your password does not satisfy the current policy requirements (%s)"
        ukr "Ваш пароль не відповідає поточним правилам (%s)"

ER_MUST_CHANGE_PASSWORD
        bgn "Трябва първо да си смените паролата със SET PASSWORD за да можете да изпълните тази команда"
        chi "您必须在执行此语句之前设置密码"
        eng "You must SET PASSWORD before executing this statement"
        rum "Trebuie sa iti schimbi parola folosind SET PASSWORD inainte de a executa aceasta comanda"
        spa "Debe vd de poner SET PASSWORD antes de ejecutar esta sentencia"

ER_FK_NO_INDEX_CHILD
        chi "无法添加外键约束。外表'%s'中的约束'%s'缺少索引"
        eng "Failed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'"
        spa "No pude añadir la restricción de clave foránea. Falta índice para restricción '%s' en la tabla foránea '%s'"

ER_FK_NO_INDEX_PARENT
        chi "无法添加外键约束。引用的表'%s'中的约束'%s'缺少索引"
        eng "Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'"
        spa "No pude añadir la restricción de clave foránea. Falta índice para restricción '%s' en la tabla referenciada '%s'"

ER_FK_FAIL_ADD_SYSTEM
        chi "无法将外键约束'%s'添加到系统表"
        eng "Failed to add the foreign key constraint '%s' to system tables"
        spa "No pude añadir la restricción de clave foránea '%s' a las tablas del sistema"

ER_FK_CANNOT_OPEN_PARENT
        chi "无法打开引用的表'%s'"
        eng "Failed to open the referenced table '%s'"
        spa "No pude abrir la tabla referenciada '%s'"

ER_FK_INCORRECT_OPTION
        chi "无法在表'%s'上添加外键约束。外键约束'%s'中的选项不正确"
        eng "Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'"
        spa "No pude añadir restricción de clave foránea en la tabla '%s'. Opciones incorrectas en restricción FOREIGN KEY '%s'"

ER_DUP_CONSTRAINT_NAME
        chi "重复%s约束名称'%s'"
        eng "Duplicate %s constraint name '%s'"
        spa "Duplicada restricción %s llamada '%s'"

ER_PASSWORD_FORMAT
        chi "密码哈希没有预期的格式。检查密码()函数是否使用正确的密码算法"
        eng "The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function"
        spa "El cálculo de contraseña no tiene el formato esperado. Revise si se está usando el algoritmo correcto de contraseña con la función PASSWORD()"

ER_FK_COLUMN_CANNOT_DROP
        chi "无法删除'%-.192s'列:在外部索引约束'%-.192s'中需要"
        eng "Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'"
        ger "Kann Spalte '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung '%-.192s' benötigt"
        spa "No puedo eliminar la columna '%-.192s': necesaria en restricción de clave foránea '%-.192s'"

ER_FK_COLUMN_CANNOT_DROP_CHILD
        chi "无法删除列'%-.192s':在外键约束'%-.192s'中需要,表%-.192s"
        eng "Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192s"
        ger "Kann Spalte '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung '%-.192s' der Tabelle %-.192s benötigt"
        spa "No puedo eliminar la columna '%-.192s': necesaria en restriccón de clave foránea '%-.192s' de la tabla %-.192s"

ER_FK_COLUMN_NOT_NULL
        chi "列'%-.192s'不能没有null:在外键约束'%-.192s'设置为null"
        eng "Column '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULL"
        ger "Spalte '%-.192s' kann nicht NOT NULL sein: wird für eine Fremdschlüsselbeschränkung '%-.192s' SET NULL benötigt"
        spa "La columna '%-.192s' no puede ser NOT NULL: necesaria en restricción de clave foránea '%-.192s' SET NULL"

ER_DUP_INDEX
        chi "重复索引%`s。这已弃用,将在未来的版本中不允许"
        eng "Duplicate index %`s. This is deprecated and will be disallowed in a future release"
        spa "Índice duplicado %`s. Éste está obsoleto y será quitado en entregas futuras"

ER_FK_COLUMN_CANNOT_CHANGE
        chi "无法更改列'%-.192s':用于外部键约束'%-.192s'"
        eng "Cannot change column '%-.192s': used in a foreign key constraint '%-.192s'"
        spa "No puedo cambiar la columna '%-.192s': usada en una restricción de clave foránea '%-.192s'"

ER_FK_COLUMN_CANNOT_CHANGE_CHILD
        chi "无法更改列'%-.192s':用于在外部键约束'%-.192s'的表'%-.192s'"
        eng "Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'"
        spa "No puedo cambiar la columna '%-.192s': usada en restricción de clave foránea '%-.192s' de la tabla '%-.192s'"

ER_FK_CANNOT_DELETE_PARENT
        chi "无法从表中删除来自表中的父级的表中的行'%-.192s”表'%-.192s'"
        eng "Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'"
        spa "No puedo borrar filas de la tabla que es padre en restricción de clave foránea '%-.192s' de la tabla '%-.192s'"

ER_MALFORMED_PACKET
        chi "畸形通信包"
        eng "Malformed communication packet"
        spa "Paquete de comunicación malformado"

ER_READ_ONLY_MODE
        chi "以只读模式运行"
        eng "Running in read-only mode"
        spa "Ejecutando em modo sólo-lectura"

ER_GTID_NEXT_TYPE_UNDEFINED_GROUP
        chi "当GTID_NEXT设置为GTID时,必须在提交或回滚后立即将其再次设置。如果在从SQL线程中看到此错误消息,则表示当前事务中的表是在主站和从站上的非交易的事务性。在客户端连接中,它意味着您在事务之前执行SET GTID_NEXT并忘记将GTID_NEXT设置为不同的标识符或在提交或回滚后“自动”。当前gtid_next是'%s'"
        eng "When GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'"
        spa "Cuando GTID_NEXT se pone a GTID, debe vd de ponerlo de nuevo de forma explícita tras un COMMIT o ROLLBACK. Si vd ve este mensaje de error en el hilo (thread) de SQL esclavo, indica que una tabla de la transacción en curso es transaccional en el maestro (master) y no transaccional en el esclavo. En una conexión cliente, indica que has ejecutado SET GTID_NEXT antes de una transacción y has olvidado poner GTID_NEXT a un identificador diferente o a 'AUTOMATIC' tras COMMIT o ROLLBACK. El GTID_NEXT actual es '%s'"

ER_VARIABLE_NOT_SETTABLE_IN_SP
        chi "无法在存储过程中设置系统变量%.200s"
        eng "The system variable %.200s cannot be set in stored procedures"
        spa "La variable de sistema %.200s no se puede poner en procedimentos almacenados"

ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF
        chi "只能在GTID_MODE = ON设置GTID_PURGED"
        eng "GTID_PURGED can only be set when GTID_MODE = ON"
        spa "GTID_PURGED sólo se puede usar cuando GTID_MODE = ON"

ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY
        chi "只有在GTID_EXECUTED为空时才可以设置GTID_PURGED"
        eng "GTID_PURGED can only be set when GTID_EXECUTED is empty"
        spa "GTID_PURGED sólo se puede poner cuando GTID_EXECUTED está vacío"

ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY
        chi "只有在没有持续的事务时才可以设置GTID_PURGED(即使在其他客户端中不)"
        eng "GTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)"
        spa "GTID_PURGED sólo se puede poner cuando no hay trasacciones en curso (ni incluso en otros clientes)"

ER_GTID_PURGED_WAS_CHANGED
        chi "GTID_PURGED从'%s'更改为'%s'"
        eng "GTID_PURGED was changed from '%s' to '%s'"
        spa "GTID_PURGED se cambió de '%s' a '%s'"

ER_GTID_EXECUTED_WAS_CHANGED
        chi "GTID_EXECUTE从'%s'更改为'%s'"
        eng "GTID_EXECUTED was changed from '%s' to '%s'"
        spa "GTID_EXECUTED se cambió de '%s' a '%s'"

ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES
        chi "无法执行语句:由于BINLOG_FORMAT = STATEMENT,因此无法写入二进制日志,并将复制和非复制表写入"
        eng "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to"
        spa "No puedo ejecutar sentencia: imposible escribir en historial (log) binario desde BINLOG_FORMAT = STATEMENT y en tablas replicadas y no replicadas"

ER_ALTER_OPERATION_NOT_SUPPORTED 0A000
        chi "此操作不支持%s。试试%s"
        eng "%s is not supported for this operation. Try %s"
        spa "%s no está soportado para esta operación. Pruebe %s"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON 0A000
        chi "不支持%s。原因:%s。试试%s"
        eng "%s is not supported. Reason: %s. Try %s"
        spa "%s no está soportado. Motivo: %s. Pruebe %s"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY
        chi "复制算法需要锁定"
        eng "COPY algorithm requires a lock"
        spa "El algoritmo de COPY requiere de un bloqueo"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION
        chi "分区特定操作尚不支持锁定/算法"
        eng "Partition specific operations do not yet support LOCK/ALGORITHM"
        spa "Las operaciones específicas de partición aún no soportan LOCK/ALGORITHM"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME
        chi "参与外键的列被更名"
        eng "Columns participating in a foreign key are renamed"
        spa "Las columnas que participan en una clave foránea son renombradas"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE
        chi "无法更改列类型"
        eng "Cannot change column type"
        spa "No puedo cambiar el tipo de la columna"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK
        chi "添加外键需要figner_key_checks = OFF"
        eng "Adding foreign keys needs foreign_key_checks=OFF"
        spa "El añadir claves foráneas necesita de foreign_key_checks=OFF"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE
        chi "使用忽略创建唯一索引需要复制算法删除重复行"
        eng "Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows"
        spa "El crear ídices únicos con IGNORE requiere del algoritmo COPY para quitar filas duplicadas"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK
        chi "不允许删除主键,而不添加新的主键"
        eng "Dropping a primary key is not allowed without also adding a new primary key"
        spa "Eliminar una clave primaria no está permitido sin añadir también una nueva clave primaria"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC
        chi "添加自动增量列需要锁定"
        eng "Adding an auto-increment column requires a lock"
        spa "Para añadir una columna auto-incrementable se requiere de un bloqueo"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS
        chi "无法使用用户可见的替换隐藏的FTS_DOC_ID"
        eng "Cannot replace hidden FTS_DOC_ID with a user-visible one"
        spa "No puedo reemplazar FTS_DOC_ID oculta con una visible-por-usuario"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS
        chi "无法删除或重命名FTS_DOC_ID"
        eng "Cannot drop or rename FTS_DOC_ID"
        spa "No puedo eliminar o renombrar FTS_DOC_ID"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS
        chi "fulltext索引创建需要锁定"
        eng "Fulltext index creation requires a lock"
        spa "La creación de un índice Fulltext requiere de un bloqueo"

ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE
        chi "使用GTID_Mode = ON运行时,无法设置SQL_SLAVE_SKIP_COUNTER。相反,对于要跳过的每个事务,使用与事务相同的GTID生成空事务"
        eng "sql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction"
        spa "sql_slave_skip_counter no se puede poner cuando el servidor se ejecuta con GTID_MODE = ON. En su lugar, para cada transacción que desees saltar, genera una transacción vacía con el mismo GTID que la transacción"

ER_DUP_UNKNOWN_IN_INDEX 23000
        chi "索引的重复条目'%-.192s'"
        cze "Zdvojený klíč (číslo klíče '%-.192s')"
        dan "Flere ens nøgler for indeks '%-.192s'"
        eng "Duplicate entry for key '%-.192s'"
        est "Kattuv väärtus võtmele '%-.192s'"
        fre "Duplicata du champ pour la clef '%-.192s'"
        ger "Doppelter Eintrag für Schlüssel '%-.192s'"
        greek "Διπλή εγγραφή για το κλειδί '%-.192s'"
        hun "Duplikalt bejegyzes a '%-.192s' kulcs szerint"
        ita "Valore duplicato per la chiave '%-.192s'"
        jpn "は索引 '%-.192s' で重複しています。"
        kor "중복된 입력 값: key '%-.192s'"
        nla "Dubbele ingang voor zoeksleutel '%-.192s'"
        nor "Like verdier for nøkkel '%-.192s'"
        norwegian-ny "Like verdiar for nykkel '%-.192s'"
        pol "Powtórzone wystąpienie dla klucza '%-.192s'"
        por "Entrada duplicada para a chave '%-.192s'"
        rum "Cimpul e duplicat pentru cheia '%-.192s'"
        rus "Дублирующаяся запись по ключу '%-.192s'"
        serbian "Dupliran unos za ključ '%-.192s'"
        slo "Opakovaný kľúč (číslo kľúča '%-.192s')"
        spa "Entrada duplicada para la clave '%-.192s'"
        swe "Dublett för nyckel '%-.192s'"
        ukr "Дублюючий запис для ключа '%-.192s'"

ER_IDENT_CAUSES_TOO_LONG_PATH
        chi "对象的长数据库名称和标识符导致路径长度超过%d字符。路径:'%s'"
        eng "Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'"
        spa "Nombre largo de base de datos e identificador para objeto resultó en que el tamaño de la ruta excedió de %d caracteres. Ruta: '%s'"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL
        chi "无法将null转换为非常量默认值"
        eng "cannot convert NULL to non-constant DEFAULT"
        spa "no puedo convertir NULL a DEFAULT no-constante"

ER_MUST_CHANGE_PASSWORD_LOGIN
        bgn "Паролата ви е изтекла. За да влезете трябва да я смените използвайки клиент който поддрържа такива пароли"
        chi "您的密码已过期。要登录您必须使用支持过期密码的客户端更改它"
        eng "Your password has expired. To log in you must change it using a client that supports expired passwords"
        rum "Parola ta a expirat. Pentru a te loga, trebuie sa o schimbi folosind un client ce suporta parole expirate"
        spa "Su contraseña ha expirado. Para ingresar, vd debe de cambiarla usando un cliente que soporte contraseñas expiradas"

ER_ROW_IN_WRONG_PARTITION
        chi "在错误分区%s中找到了一行"
        eng "Found a row in wrong partition %s"
        spa "Hallada una fila en partición equivocada %s"
        swe "Hittade en rad i fel partition %s"

ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX
        chi "无法安排事件%s,中继日志名称%s,position%s对工作线程,因为它的大小%lu超过了slave_pending_jobs_size_max (%lu)"
        eng "Cannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_max"
        spa "No puedo organizar evento %s, nombre de historial (log)-reenvío %s, posiciona %s a hilo (thread) de Trabajador porque su tamaño %lu excede %lu de slave_pending_jobs_size_max"

ER_INNODB_NO_FT_USES_PARSER
        chi "无法在InnoDB表上CREATE FULLTEXT INDEX WITH PARSER"
        eng "Cannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB table"
        spa "No puedo CREATE FULLTEXT INDEX WITH PARSER en tabla InnoDB"
ER_BINLOG_LOGICAL_CORRUPTION
        chi "二进制日志文件'%s'逻辑损坏:%s"
        eng "The binary log file '%s' is logically corrupted: %s"
        spa "El fichero/archivo de historial (log) binario '%s' está lógicamente corrupto: %s"

ER_WARN_PURGE_LOG_IN_USE
        chi "未清除文件%s,因为它被%d线程读取,只清除%d文件中的%d"
        eng "file %s was not purged because it was being read by %d thread(s), purged only %d out of %d files"
        spa "el fchero %s no se ha purgado porque estaba siendo leído por hilo(s) (thread) %d, purgado sólo %d de %d ficheros/archivos"

ER_WARN_PURGE_LOG_IS_ACTIVE
        chi "文件%s未清除,因为它是活动日志文件"
        eng "file %s was not purged because it is the active log file"
        spa "el fichero/archivo %s no fue purgado porque es el fichero/archivo activo de historial (log)"

ER_AUTO_INCREMENT_CONFLICT
        chi "更新中的自动增量值与内部生成的值冲突"
        eng "Auto-increment value in UPDATE conflicts with internally generated values"
        spa "Valor de Auto-incremento en UPDATE está en conflicto con valores generados internamente"
WARN_ON_BLOCKHOLE_IN_RBR
        chi "未记录行事件的%s语句,该语句以行格式修改BlackHole表。表:'%-.192s'"
        eng "Row events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'"
        spa "Los eventos de fila no son puestos en historial (log) para sentencias %s que modifican tablas BLACKHOLE en formato de fila. Tabla(s): '%-.192s'"

ER_SLAVE_MI_INIT_REPOSITORY
        chi "从设备无法从存储库初始化主信息结构"
        eng "Slave failed to initialize master info structure from the repository"
        spa "El esclavo falló al inicializar información de estructura del maestro (master) desde el repositorio"

ER_SLAVE_RLI_INIT_REPOSITORY
        chi "从站无法从存储库初始化中继日志信息结构"
        eng "Slave failed to initialize relay log info structure from the repository"
        spa "El esclavo falló al inicializar estructura de información de historial (log) de reenvío desde el repositorio"

ER_ACCESS_DENIED_CHANGE_USER_ERROR 28000 
        bgn "Отказан достъп при опит за смяна към потребител %-.48s'@'%-.64s' (използвана парола: %s). Затваряне на връзката"
        chi "访问拒绝尝试更改为用户'%-.48s'@'%-.64s'(使用密码:%s)。断开连接"
        eng "Access denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). Disconnecting"
        spa "Acceso denegado intentando cambiar a usuario '%-.48s'@'%-.64s' (usando contraseña: %s). Desconectando"

ER_INNODB_READ_ONLY
        chi "innodb是只读模式"
        eng "InnoDB is in read only mode"
        hindi "InnoDB केवल READ-ONLY मोड में है"
        spa "InnoDB está en modo de sólo lectura"

ER_STOP_SLAVE_SQL_THREAD_TIMEOUT
        chi "STOP SLAVE命令执行不完整:从SQL线程获得停止信号,线程正忙,一旦当前任务完成后,SQL线程将停止"
        eng "STOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is complete"
        spa "La ejecución del comando STOP SLAVE está incompleta: El hilo (thread) de SQL esclavo recibió la señal de parada, hilo (thread) ocupado, el hilo (thread) SQL se parará una vez que se complete la tarea actual"

ER_STOP_SLAVE_IO_THREAD_TIMEOUT
        chi "STOP SLAVE命令执行不完整:从机动程线程得到停止信号,线程很忙,一旦当前任务完成后,IO线程将停止。"
        eng "STOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is complete"
        spa "La ejecución del comando STOP SLAVE está incompleta: El hilo (thread) de E/S esclavo recibió la señal de parada, hilo (thread) ocupado, el hilo (thread) de E/S se parará una vez que se complete la tarea actual"

ER_TABLE_CORRUPT
        chi "无法执行操作。表'%-.64s。%-.64s'丢失,损坏或包含不良数据"
        eng "Operation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad data"
        spa "La operación no se puede realizar. Falta la tabla '%-.64s.%-.64s', está corrupta o contiene datos malos"

ER_TEMP_FILE_WRITE_FAILURE
        chi "临时文件写入失败"
        eng "Temporary file write failure"
        spa "Fallo al escribir fichero/archivo temporal"

ER_INNODB_FT_AUX_NOT_HEX_ID
        chi "升级索引名称失败,请使用创建索引(ALTER TABLE)算法复制来重建索引"
        eng "Upgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"
        spa "Falló la mejora de nombre de índice. Por favor, use una copia del algoritmo de create index(alter table) para reconstruir el índice"
#
#
# MariaDB error messages section starts here


# The following is here to allow us to detect if there was missing
# error messages in the errmsg.sys file

ER_LAST_MYSQL_ERROR_MESSAGE
        eng ""

# MariaDB error numbers starts from 1900
start-error-number 1900

ER_UNUSED_18
        eng "You should never see it"
ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
        chi "函数或表达式'%s'不能用于%s的%`s"
        eng "Function or expression '%s' cannot be used in the %s clause of %`s"
        spa "La Función o expresión '%s' no se puede usar en la cláusula %s de %`s"
ER_UNUSED_19
        eng "You should never see it"
ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN
        chi "主键无法在生成的列上定义"
        eng "Primary key cannot be defined upon a generated column"
        spa "La clave primaria no se puede definir sobre una columna generada"
ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
        chi "无法在虚拟生成的列上定义键/索引"
        eng "Key/Index cannot be defined on a virtual generated column"
        spa "Key/Index no se puede definir en una columna virtual generada"
ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN
        chi "无法在生成的列上定义%s子句的外键"
        eng "Cannot define foreign key with %s clause on a generated column"
        spa "No puedo definir clave foránea con cláusula %s en una columna generada"
ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
        chi "忽略了表'%s'中为生成的列'%s'指定的值已被忽略"
        eng "The value specified for generated column '%s' in table '%s' has been ignored"
        spa "El valor especificado para columna generada '%s' en la tabla '%s' ha sido ignorado"
ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
        chi "生成的列尚未支持这一点"
        eng "This is not yet supported for generated columns"
        spa "Esto no está aún soportado para columnas generadas"
ER_UNUSED_20
        eng "You should never see it"
ER_UNUSED_21
        eng "You should never see it"
ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
        chi "%s存储引擎不支持生成的列"
        eng "%s storage engine does not support generated columns"
        hindi "स्टोरेज इंजन %s COMPUTED कॉलम्स को सपोर्ट नहीं करता"
        spa "El motor de almacenaje %s no soporta columnas generadas"
ER_UNKNOWN_OPTION
        chi "未知选项'%-.64s'"
        eng "Unknown option '%-.64s'"
        hindi "अज्ञात विकल्प '%-.64s'"
        spa "Opción desconocida '%-.64s'"
ER_BAD_OPTION_VALUE
        chi "值不正确'%-.64T'选项'%-.64s'"
        eng "Incorrect value '%-.64T' for option '%-.64s'"
        hindi "गलत मान '%-.64T' विकल्प '%-.64s' के लिए"
        spa "Valor incorrecto '%-.64T' para opción '%-.64s'"
ER_UNUSED_6
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_UNUSED_7
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_UNUSED_8
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_DATA_OVERFLOW 22003
        chi "转换'%-.128s'到%-.32s时溢出。值截断"
        eng "Got overflow when converting '%-.128s' to %-.32s. Value truncated"
        spa "Obtenido desbordamiento al convertir '%-.128s' a %-.32s. Valor truncado"
ER_DATA_TRUNCATED 22003
        chi "转换'%-.128s'到%-.32s时值截断"
        eng "Truncated value '%-.128s' when converting to %-.32s"
        spa "Valor truncado '%-.128s' al convertir a %-.32s"
ER_BAD_DATA 22007
        chi "非法值'%-.128s',在转换%-.32s时遇到"
        eng "Encountered illegal value '%-.128s' when converting to %-.32s"
        spa "Encontrado valor ilegal '%-.128s' al convertir a %-.32s"
ER_DYN_COL_WRONG_FORMAT
        chi "遇到非法格式的动态列字符串"
        eng "Encountered illegal format of dynamic column string"
        spa "Encontrado formato ilegal de cadena en columna dinámica"
ER_DYN_COL_IMPLEMENTATION_LIMIT
        chi "达到动态列实现限制"
        eng "Dynamic column implementation limit reached"
        spa "Alcanzado límite de implementación de columna dinámica"
ER_DYN_COL_DATA 22007
        chi "非法值用作动态列函数的参数"
        eng "Illegal value used as argument of dynamic column function"
        spa "Valor ilegal usado como argumento de función de columna dinámica"
ER_DYN_COL_WRONG_CHARSET
        chi "动态列包含未知字符集"
        eng "Dynamic column contains unknown character set"
        spa "Columna dinámica contiene conjunto desconocido de caracteres"
ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES
        chi "“in_to_exists”或'materialization'optimizer_switch标志中的至少一个必须是'开启'"
        eng "At least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'"
        hindi "कम से कम 'in_to_exists' या 'materialization' optimizer_switch फ्लैग 'ON' होना चाहिए"
        spa "Al menos una de las banderas de optimizer_switch 'in_to_exists' o 'materialization' debe de estar a 'on'"
ER_QUERY_CACHE_IS_DISABLED
        chi "查询缓存已禁用(调整大小或类似命令正在进行中);稍后重复此命令"
        eng "Query cache is disabled (resize or similar command in progress); repeat this command later"
        spa "Caché de consulta (query) desactivada (el comando ajustar o similar está en proceso); repite este comando más tarde"
ER_QUERY_CACHE_IS_GLOBALY_DISABLED
        chi "查询缓存全局禁用,您无法为此会话启用它"
        eng "Query cache is globally disabled and you can't enable it only for this session"
        hindi "क्वेरी कैश ग्लोबल स्तर पर DISABLED है और आप इसे केवल सत्र के लिए ENABLE नहीं कर सकते"
        spa "La caché de consulta (query) está desactivada de forma global y no puede activarla sólo para esta sesión"
ER_VIEW_ORDERBY_IGNORED
        chi "查看'%-.192s'.'%-.192s's ORDER BY子句被忽略,因为还有其他ORDER BY子句"
        eng "View '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause already"
        spa "Cláusula de vista '%-.192s'.'%-.192s' ORDER BY ignorada porque ya hay otra clásula ORDER BY"
ER_CONNECTION_KILLED 70100 
        chi "连接被杀死"
        eng "Connection was killed"
        hindi "कनेक्शन को समाप्त कर दिया गया है"
        spa "La conexión fue matada"
ER_UNUSED_12
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
        chi "无法修改事务中的@@session.skip_replication"
        eng "Cannot modify @@session.skip_replication inside a transaction"
        spa "No puedo modificar @@session.skip_replication dentro de una transacción"
ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
        chi "无法修改存储函数或触发器内的@@session.skip_replication"
        eng "Cannot modify @@session.skip_replication inside a stored function or trigger"
        spa "No puedo modificar @@session.skip_replication dentro de una función almacenada o disparador"
ER_QUERY_RESULT_INCOMPLETE
        eng "Query execution was interrupted. The query exceeded %s %llu. The query result may be incomplete"
ER_NO_SUCH_TABLE_IN_ENGINE 42S02 
        chi "表'%-.192s.%-.192s'在引擎中不存在"
        eng "Table '%-.192s.%-.192s' doesn't exist in engine"
        hindi "टेबल '%-.192s.%-.192s' इंजन में मौजूद नहीं है"
        spa "La tabla '%-.192s.%-.192s' no existe en el motor"
        swe "Det finns ingen tabell som heter '%-.192s.%-.192s' i handlern"
ER_TARGET_NOT_EXPLAINABLE
        chi "目标未运行可解释的命令"
        eng "Target is not running an EXPLAINable command"
        spa "El objetivo no está ejecutando un comando EXPLAINable"
ER_CONNECTION_ALREADY_EXISTS
        chi "连接'%.*s'与现有连接'%.*s'冲突"
        eng "Connection '%.*s' conflicts with existing connection '%.*s'"
        spa "La conexión '%.*s' está en conflicto con la conexión existente '%.*s'"
ER_MASTER_LOG_PREFIX
        chi "Master'%.*s':"
        eng "Master '%.*s': "
        spa "Maestro (master) '%.*s': "
ER_CANT_START_STOP_SLAVE
        chi "不能%sSLAVE'%.*s'"
        eng "Can't %s SLAVE '%.*s'"
        spa "No puedo %s ESCLAVO '%.*s'"
ER_SLAVE_STARTED
        chi "SLAVE '%.*s'开始了"
        eng "SLAVE '%.*s' started"
        spa "ESCLAVO '%.*s' arrancado"
ER_SLAVE_STOPPED
        chi "slave'%.*s'停止了"
        eng "SLAVE '%.*s' stopped"
        spa "ESCLAVO '%.*s' parado"
ER_SQL_DISCOVER_ERROR
        chi "引擎%s无法发现表%`-.192s.%`-.192s,'%s'"
        eng "Engine %s failed to discover table %`-.192s.%`-.192s with '%s'"
        spa "El motor %s no pudo descubr la tabla %`-.192s.%`-.192s con '%s'"
ER_FAILED_GTID_STATE_INIT
        chi "初始化复制GTID状态失败"
        eng "Failed initializing replication GTID state"
        spa "Fallo inicializando estado de réplica GTID"
ER_INCORRECT_GTID_STATE
        chi "无法解析GTID列表"
        eng "Could not parse GTID list"
        spa "No pude analizar la lista GTID"
ER_CANNOT_UPDATE_GTID_STATE
        chi "无法更新Replication Slave GTID状态"
        eng "Could not update replication slave gtid state"
        spa "No pude actualizar estado gtid de esclavo de réplica"
ER_DUPLICATE_GTID_DOMAIN
        chi "GTID %u-%u-%llu和%u-%u-%llu冲突(重复域ID%u)"
        eng "GTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)"
        spa "Conflicto GTID %u-%u-%llu y %u-%u-%llu (duplicado id de dominio %u)"
ER_GTID_OPEN_TABLE_FAILED
        chi "未能打开%s.%s"
        eng "Failed to open %s.%s"
        ger "Öffnen von %s.%s fehlgeschlagen"
        spa "No pude abrir %s.%s"
ER_GTID_POSITION_NOT_FOUND_IN_BINLOG
        chi "连接从站请求从GTID%u-%u-%llu开始,这不在Master的Binlog中"
        eng "Connecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog"
	spa "Se ha requerido que conectar esclavo arranque desde GTID %u-%u-%llu, el cual no está en el binlog del maestro (master)"
ER_CANNOT_LOAD_SLAVE_GTID_STATE
        chi "无法从表%s中加载Replication Slave GTID位置。%s"
        eng "Failed to load replication slave GTID position from table %s.%s"
	spa "No pude cargar posición GTID de esclavo de réplica desde la tabla %s.%s"
ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG
        chi "指定的GTID%u-%u-%llu与二进制日志冲突,其中包含更新的GTID%u-%u-%llu。如果使用master_gtid_pos = current_pos,则Binlog位置将覆盖@@gtid_slave_pos的新值"
        eng "Specified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos"
	spa "El especificado GTID %u-%u-%llu está en conflicto con el historial (log) binario el cual contiene un más reciente GTID %u-%u-%llu. Si se usa MASTER_GTID_POS=CURRENT_POS, la posición de binlog sobreescribirá el nuevo valor de @@gtid_slave_pos"
ER_MASTER_GTID_POS_MISSING_DOMAIN
        chi "指定值为@@gtid_slave_pos不包含复制域%u的值。这与二进制日志冲突,其中包含gtid%u-%u-%llu。如果使用master_gtid_pos = current_pos,则Binlog位置将覆盖@@ gtid_slave_pos的新值"
        eng "Specified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos"
	spa "El valor especificado para @@gtid_slave_pos no contiene valor para dominio de réplica %u. Esto está en conflicto con el historial (log) binario el cual contiene un GTID %u-%u-%llu. Si se usa MASTER_GTID_POS=CURRENT_POS, la posición binlog sobreescribirá el nuevo valor de @@gtid_slave_pos"
ER_UNTIL_REQUIRES_USING_GTID
        chi "启动从站,直到master_gtid_pos要求从站使用gtid"
        eng "START SLAVE UNTIL master_gtid_pos requires that slave is using GTID"
	spa "START SLAVE UNTIL master_gtid_pos requiere que esclavo esté usando GTID"
ER_GTID_STRICT_OUT_OF_ORDER
        chi "尝试对Binlog GTID%u-%u-%llu进行,这将创建具有现有GTID%u-%u-%llu的订单无序序列号,并且启用了GTID严格模式"
        eng "An attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabled"
	spa "Se ha intentado hacer binlog de GTID %u-%u-%llu lo cual crearía un número de secuencia fuera de orden con el existente GTID %u-%u-%llu y está activado gtid en modo estricto"
ER_GTID_START_FROM_BINLOG_HOLE
        chi "主机上的Binlog缺少从站所需请求的GTID%u-%u-%llu(即使存在后续的序列号),并启用GTID严格模式"
        eng "The binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabled"
	spa "Al binlog del maestro (master) le falta el GTID %u-%u-%llu requerido por el esclavo (incluso aunque existe un número posterior de secuencia) y está activado GTID en modo estricto"
ER_SLAVE_UNEXPECTED_MASTER_SWITCH
        chi "重新连接后,从master收到意外的GTID。这通常表示在不重新启动从线程的情况下替换主服务器。%s."
        eng "Unexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %s"
	spa "Se ha recibido un GTID inesperado desde el maestro (master) tras reconectar. Esto indica normalmente que el servidor maestro (master) ha sido reemplazado sin rearrancar los hilos (threads) del esclavo. %s"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
        chi "无法修改@@sessient.gtid_domain_id或@@session.gtid_seq_no"
        eng "Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction"
        spa "No puedo modificar @@session.gtid_domain_id o @@session.gtid_seq_no dentro de una transacción"
ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
        chi "无法修改@@sessient.gtid_domain_id或@@session.gtid_seq_no或触发器"
        eng "Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or trigger"
        spa "No puedo modificar @@session.gtid_domain_id o @@session.gtid_seq_no dentro de una función almacenada o de un disparador"
ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2
        chi "连接从站请求从GTID%u-%u-%llu开始,这不在Master的Binlog中。由于Master的Binlog包含具有更高序列号的GTID,因此它可能意味着由于执行额外错误的交易,因此slave已经分歧"
        eng "Connecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactions"
	spa "Se ha requerido arrancar la conexión a esclavo desde GTID %u-%u-%llu, el cual no está en el binlog del maestro (master). Ya que el binlog del maestro (master) contiene GTIDs con números mayores de secuencia, es probable que indique que el esclavo diverge debido a ejecutar transacciones extra erróneas"
ER_BINLOG_MUST_BE_EMPTY
        chi "如果已将任何GTID记录到二进制日志,则不允许此操作。首先运行RESET MASTER擦除日志"
        eng "This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log"
	spa "Esta operación no está permitida si cualquier GTID ha sido puesto en historial (log) binario. Ejecuta primero RESET MASTER para borrar el historial (log)"
ER_NO_SUCH_QUERY
        chi "未知查询ID:%lld"
        eng "Unknown query id: %lld"
        ger "Unbekannte Abfrage-ID: %lld"
        hindi "अज्ञात क्वेरी ID: %lld"
        rus "Неизвестный номер запроса: %lld"
        spa "Id desconocido de consulta (query): %lld"
ER_BAD_BASE64_DATA
        chi "错误Base64数据作为位置%u"
        eng "Bad base64 data as position %u"
	spa "Datos base64 malos en posición %u"
ER_INVALID_ROLE OP000
        chi "无效的角色规范%`s"
        eng "Invalid role specification %`s"
        hindi "अमान्य रोल विनिर्देश %`s"
        rum "Rolul %`s este invalid"
        spa "Especificación inválida de rol %`s"
ER_INVALID_CURRENT_USER 0L000
        chi "当前用户无效"
        eng "The current user is invalid"
        hindi "वर्तमान यूज़र अमान्य है"
        rum "Utilizatorul curent este invalid"
	spa "El usuario en curso no es válido"
ER_CANNOT_GRANT_ROLE
        chi "无法将角色'%s'授予:%s"
        eng "Cannot grant role '%s' to: %s"
        hindi "रोल '%s', %s को प्रदान नहीं कर सकते"
        rum "Rolul '%s' nu poate fi acordat catre: %s"
	spa "No puedo conceder rol '%s' a: %s"
ER_CANNOT_REVOKE_ROLE
        chi "无法撤消来自:%s的角色'%s'"
        eng "Cannot revoke role '%s' from: %s"
        hindi "रोल '%s', %s से हटाया नहीं जा सका"
        rum "Rolul '%s' nu poate fi revocat de la: %s"
	spa "No puedo revocar rol '%s' desde: %s"
ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE
        chi "无法更改@@slave_parallel_threads,而另一个更改正在进行中"
        eng "Cannot change @@slave_parallel_threads while another change is in progress"
	spa "No puedo cambiar @@slave_parallel_threads mientras otro cambio esté en proceso"
ER_PRIOR_COMMIT_FAILED
        chi "由于早期提交的失败取决于依赖于哪个依赖性,提交失败"
        eng "Commit failed due to failure of an earlier commit on which this one depends"
	spa "Ha fallado la acometida (commit) debido a un fallo previo en acometida (commit) de la que depende ésta"
ER_IT_IS_A_VIEW 42S02
        chi "'%-.192s'是一个VIEW"
        eng "'%-.192s' is a view"
        hindi "'%-.192s' एक VIEW है"
        spa "'%-.192s' es una vista"
ER_SLAVE_SKIP_NOT_IN_GTID
        chi "使用并行复制和带有多个复制域的GTID时,无法使用@@SQL_SLAVE_SKIP_COUNTER。相反,可以使用明确设置@@gtid_slave_pos以在给定的gtid位置之后跳到"
        eng "When using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position"
	spa "Al usar réplica paralela y GTID con múltiples dominios de réplica, no se puede usar @@sql_slave_skip_counter. En su lugar, poner @@gtid_slave_pos de forma explícita se puede usar para saltar tras una posición GTID dada"
ER_TABLE_DEFINITION_TOO_BIG
        chi "表%`s的定义太大了"
        eng "The definition for table %`s is too big"
        hindi "टेबल %`s की परिभाषा बहुत बड़ी है"
        spa "La definición para la tabla %`s es demasiado larga"
ER_PLUGIN_INSTALLED
        chi "插件'%-.192s'已安装"
        eng "Plugin '%-.192s' already installed"
        hindi "प्लग-इन '%-.192s' पहले से ही इन्स्टॉल्ड है"
        rus "Плагин '%-.192s' уже установлен"
        spa "Ya instalado el enchufe (plugin) '%-.192s'"
ER_STATEMENT_TIMEOUT 70100
        chi "查询执行中断(超出MAX_STATEMENT_TIME)"
        eng "Query execution was interrupted (max_statement_time exceeded)"
        spa "Se ha interrumpido la ejecución de una consulta (query) (excedido max_statement_time)
ER_SUBQUERIES_NOT_SUPPORTED 42000
        chi "%s不支持子查询或存储的函数"
        eng "%s does not support subqueries or stored functions"
        spa "%s no soporta subconsultas (subqueries) o funciones almacenadas"
ER_SET_STATEMENT_NOT_SUPPORTED 42000
        chi "系统变量%.200s无法在set语句中设置。“"
        eng "The system variable %.200s cannot be set in SET STATEMENT." 
        spa "La variable del sistema %.200s no se puede poner en SET STATEMENT." 
ER_UNUSED_9
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"
ER_USER_CREATE_EXISTS
        chi "无法创建用户'%-.64s'@'%-.64s';它已经存在"
        eng "Can't create user '%-.64s'@'%-.64s'; it already exists"
        hindi "यूज़र '%-.64s'@'%-.64s' को नहीं बना सकते; यह पहले से ही मौजूद है"
        spa "No puedo crear usuario '%-.64s'@'%-.64s'; ya existe"
ER_USER_DROP_EXISTS
        chi "无法删除用户'%-.64s'@'%-.64s';它不存在"
        eng "Can't drop user '%-.64s'@'%-.64s'; it doesn't exist"
        hindi "यूज़र '%-.64s'@'%-.64s' को ड्रॉप नहीं कर सकते; यह मौजूद नहीं है"
        spa "No puedo eliminar usuario '%-.64s'@'%-.64s'; no existe"
ER_ROLE_CREATE_EXISTS
        chi "无法创建角色'%-.64s';它已经存在"
        eng "Can't create role '%-.64s'; it already exists"
        hindi "रोल '%-.64s' को नहीं बना सकते; यह पहले से ही मौजूद है"
        spa "No puedo crear rol '%-.64s'; ya existe"
ER_ROLE_DROP_EXISTS
        chi "无法删除'%-.64s'。它不存在"
        eng "Can't drop role '%-.64s'; it doesn't exist"
        hindi "रोल '%-.64s' को ड्रॉप नहीं कर सकते; यह मौजूद नहीं है"
        spa "No puedo eliminar rol '%-.64s'; no existe"
ER_CANNOT_CONVERT_CHARACTER
        chi "无法将'%s'字符0x转换为0x%-.64s到'%s'"
        eng "Cannot convert '%s' character 0x%-.64s to '%s'"
        spa "No puedo convertir '%s' carácter 0x%-.64s a '%s'"
ER_INVALID_DEFAULT_VALUE_FOR_FIELD  22007
        chi "列的默认值不正确'%-.128T' '%.192s'"
        eng "Incorrect default value '%-.128T' for column '%.192s'"
        hindi "गलत डिफ़ॉल्ट मान '%-.128T' कॉलम '%.192s' के लिए"
        spa "Valor por defecto incorrecto '%-.128T' para columna '%.192s'"
ER_KILL_QUERY_DENIED_ERROR
        chi "你不是查询%lld的所有者"
        eng "You are not owner of query %lld"
        ger "Sie sind nicht Eigentümer von Abfrage %lld"
        hindi "आप क्वेरी %lld के OWNER नहीं हैं"
        rus "Вы не являетесь владельцем запроса %lld"
        spa "No eres el propietario de la consulta (query) %lld"
ER_NO_EIS_FOR_FIELD
        chi "没有收集无关的统计信息列'%s'"
        eng "Engine-independent statistics are not collected for column '%s'"
        hindi "Engine-independent सांख्यिकी कॉलम '%s' के लिए एकत्रित नहीं किया जा रहा है"
        spa "No se han recolectado estadísticas independientes del motor para la columna '%s'"
        ukr "Незалежна від типу таблиці статистика не збирається для стовбця '%s'"
ER_WARN_AGGFUNC_DEPENDENCE
        chi "聚合函数'%-.192s)'SELECT#%d的属于选择#%d"
        eng "Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d"
        spa "La función de agregación '%-.192s)' del SELECT #%d pertenece a SELECT #%d"
        ukr "Агрегатна функція '%-.192s)' з SELECTу #%d належить до SELECTу #%d"
WARN_INNODB_PARTITION_OPTION_IGNORED
        chi "<%-.64s> innodb分区忽略的选项"
        eng "<%-.64s> option ignored for InnoDB partition"
        spa "<%-.64s> opción ignorada para partición InnoDB"

#
# Internal errors, not used
#
skip-to-error-number 2000

# MySQL 5.7 error numbers starts here
skip-to-error-number 3000

ER_FILE_CORRUPT
        chi "文件%s已损坏"
        eng "File %s is corrupted"
        spa "El fichero/archivo %s está corrupto"

ER_ERROR_ON_MASTER
        chi "查询在主设备上部分完成(主设备:%d)并中止。你的master在这一点上有可能不一致。如果您确定您的主站是可以的,请在从站上手动运行此查询,然后使用SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE ;查询:'%s'"
        eng "Query partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'"
        spa "Consulta (query) completada de forma parcial en el maestro (master) (error en maestro (master): %d) y se ha abortado. Existe una posibilidad de que su maestro (master) esté inconsitente en este punto. Si está seguro de que su maestro (master) está ok, ejecute esta consulta (query) de forma manual en el esclavo y luego rearranque el esclavo mediante SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Consulta (query):'%s'"

ER_INCONSISTENT_ERROR
        chi "查询在主站和从站上引起了不同的错误。主站错误:消息(格式)='%s'错误代码=%d;从站错误:实际消息='%s',错误代码=%d。默认数据库:'%s'。查询:'%s'"
        eng "Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'"
        spa "La consulta (query) ha ocasionado diferentes errores en el maestro (master) y en el esclavo. Error en maestro (master): mensaje (formato)='%s' código de error=%d; Error en esclavo: mensaje actual='%s', código de error=%d. Base de datos por defecto:'%s'. Consulta (query):'%s'"

ER_STORAGE_ENGINE_NOT_LOADED
        chi "表'%s'的存储引擎'%s'没有加载。"
        eng "Storage engine for table '%s'.'%s' is not loaded."
        spa "El motor de almacenaje para la tabla '%s'.'%s' no ha sido cargado."

ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER 0Z002
        chi "处理程序未激活时GET STACKED DIAGNOSTICS"
        eng "GET STACKED DIAGNOSTICS when handler not active"
        spa "GET STACKED DIAGNOSTICS cuando el manejador no está activo"

ER_WARN_LEGACY_SYNTAX_CONVERTED
        chi "不再支持%s。该语句被转换为%s。"
        eng "%s is no longer supported. The statement was converted to %s."
        spa "%s ya no está soportada. Se ha convertido la sentencia a %s."

ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN
        chi "语句不安全,因为它使用全文解析器插件,它可能不会在从站上返回相同的值。"
        eng "Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave."
        spa "La sentencia no es segura porque usa un enchufe (plugin) analizador de fulltext que puede que no devuelva el mismo valor en el esclavo."

ER_CANNOT_DISCARD_TEMPORARY_TABLE
        chi "无法丢弃与临时表相关联的/导入表空间"
        eng "Cannot DISCARD/IMPORT tablespace associated with temporary table"
        spa "No puedo DISCARD/IMPORT espacio de tabla asociado con tabla temporal"

ER_FK_DEPTH_EXCEEDED
        chi "外键级联删除/更新超出了%d的最大深度。"
        eng "Foreign key cascade delete/update exceeds max depth of %d."
        spa "La cascada borrar/actualizar en clave foránea excede la máxima profundidad de %d."

ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2
        chi "列数为%s.%s是错误的。预期的%d,找到%d。使用MariaDB%d创建,现在运行%d。请使用mariadb-upgrade来修复此错误。"
        eng "Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error."
        ger "Spaltenanzahl von %s.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MariaDB %d, jetzt unter %d. Bitte benutzen Sie mariadb-upgrade, um den Fehler zu beheben"
        spa "El contador de columna de %s.%s está equivocado. Se esperaba %d, hallado %d, Creado con MariaDB %d, ahora ejecutando %d. Por favor, use mariadb-upgrade para arreglar este error."

ER_WARN_TRIGGER_DOESNT_HAVE_CREATED
        chi "触发器%s.%s.%s没有CREATE属性。"
        eng "Trigger %s.%s.%s does not have CREATED attribute."
        spa "El disparador %s.%s.%s no tiene el atributo CREATED."

ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL
        chi "引用的触发器'%s'用于给定的动作时间和事件类型不存在。"
        eng "Referenced trigger '%s' for the given action time and event type does not exist."
        spa "El disparador referenciado '%s' para el momento dado de acción y el tipo de evento no existe."

ER_EXPLAIN_NOT_SUPPORTED
        chi "EXPLAIN FOR CONNECTION仅支持SELECT/UPDATE/INSERT/DELETE/REPLACE"
        eng "EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACE"
        spa "El comando EXPLAIN FOR CONNECTION sólo se soporta para SELECT/UPDATE/INSERT/DELETE/REPLACE"
ER_INVALID_FIELD_SIZE
        chi "列'%-.192s'的大小无效。"
        eng "Invalid size for column '%-.192s'."
        spa "Tamaño inválido para columna '%-.192s'."

ER_MISSING_HA_CREATE_OPTION
        chi "表存储引擎'%-.64s'所找到的必备创建选项丢失"
        eng "Table storage engine '%-.64s' found required create option missing"
        spa "El motor hallado de almacenaje de tabla '%-.64s' requería de la opción de crear que falta"

ER_ENGINE_OUT_OF_MEMORY
        chi "存储引擎'%-.64s'中的内存不足。"
        eng "Out of memory in storage engine '%-.64s'."
        spa "Memoria agotada en motor de almacenaje '%-.64s'."

ER_PASSWORD_EXPIRE_ANONYMOUS_USER
        chi "匿名用户的密码不能过期。"
        eng "The password for anonymous user cannot be expired."
        spa "La contraseña para usuario anónimo no puede expirar."

ER_SLAVE_SQL_THREAD_MUST_STOP
        chi "无法使用正在运行的从SQL线程执行此操作;首先运行STOP SLAVE SQL_THREAD"
        eng "This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD first"
        spa "Esta operación no se puede realizar con hilo (thread) sql esclavo en ejecución; ejecuta STOP SLAVE SQL_THREAD primero"

ER_NO_FT_MATERIALIZED_SUBQUERY
        chi "无法在物化的子查询上创建FullText索引"
        eng "Cannot create FULLTEXT index on materialized subquery"
        spa "No puedo crear índice FULLTEXT en subconsulta (subquery) materializada"

ER_INNODB_UNDO_LOG_FULL
        chi "撤消日志错误:%s"
        eng "Undo Log error: %s"
        spa "Error de Historial (log) de Deshacer: %s"

ER_INVALID_ARGUMENT_FOR_LOGARITHM 2201E
        chi "对数的参数无效"
        eng "Invalid argument for logarithm"
        spa "Argumento inválido para logaritmo"

ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP
        chi "无法使用正在运行的slave IO线程执行此操作;首先运行STOP SLAVE IO_THREAD FOR CHANNEL'%s'。"
        eng "This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first."
        spa "Esta operación no se puede realizar con un hilo (thread) de e/s de esclavo en ejecución; ejecuta STOP SLAVE IO_THREAD FOR CHANNEL '%s' primero."

ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO
        chi "当从站具有临时表时,此操作可能不安全。表将保持打开,直到服务器重新启动或通过任何复制的DROP语句删除表。建议等到Slave_open_temp_tables = 0。"
        eng "This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0."
        spa "Esta operación puede no ser segura cuando el esclavo tenga tablas temporales. Las tablas serán mantenidas abiertas hasta que el servidor rearranque o hasta que las tablas sean borradas por cualquier sentencia DROP replicada. Se sugiere esperar hasta slave_open_temp_tables = 0."

ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS
        chi "使用CHANGE MASTER TO master_log_file子句更改master,但没有master_log_pos子句可能不安全。旧位置值可能对新的二进制日志文件无效。"
        eng "CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file."
        spa "CHANGE MASTER TO mediante una cláusula MASTER_LOG_FILE pero sin existir cláusula MASTER_LOG_POS puede no ser seguro. El valor viejo de la posición puede no ser válido para el nuevo fichero/archivo binario de historial (log)."

ER_UNUSED_1
        eng "You should never see it"

ER_NON_RO_SELECT_DISABLE_TIMER
        chi "SELECT不是只读语句,禁用计时器"
        eng "Select is not a read only statement, disabling timer"
        spa "Select no es una sentencia de sólo lectura, desactivando cronómetro"

ER_DUP_LIST_ENTRY
        chi "重复条目'%-.192s'。"
        eng "Duplicate entry '%-.192s'."
        spa "Entrada duplicada '%-.192s'."

ER_SQL_MODE_NO_EFFECT
        chi "'%s'模式不再有任何效果。使用STRICT_ALL_TABLES或STRICT_TRANS_TABLES。"
        eng "'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead."
        spa "El modo '%s' ya no tiene efecto alguno. Use STRICT_ALL_TABLES o STRICT_TRANS_TABLES en su lugar"

ER_AGGREGATE_ORDER_FOR_UNION
        chi "表达式#%u ORDER BY包含聚合函数并适用于UNION"
        eng "Expression #%u of ORDER BY contains aggregate function and applies to a UNION"
        spa "La expresión #%u de ORDER BY contiene función de agregación y se aplica a UNION"

ER_AGGREGATE_ORDER_NON_AGG_QUERY
        chi "表达式#%u通过包含聚合函数,并适用于非聚合查询的结果"
        eng "Expression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated query"
        spa "La expresión #%u de ORDER BY contiene función de agregación y se aplica al resultado de una consulta (query) no agregada"

ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR
        chi "在启用了slave保存提交次序时至少有一个以前的工人遇到错误后,slave工作者已停止。要保留提交次序,此线程执行的最后一项事务尚未提交。在修复任何故障线程后重新启动从站时,您也应该修复此工作人。"
        eng "Slave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well."
        spa "El trabajador esclavo se ha parado tras al menos encontrar un error en trabajador previo cuando slave-preserve-commit-order fue activado. Para preserver el orden de acometida (commit), la última transacción ejecutada por este hilo (thread) no se ha acometido (commit). Al rearrancar el esclavo tras arreglar cualquier hilo (thread) fallido, vd debería de arreglar este trabajador también"

ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER
        chi "slave_preerve_commit_order不支持%s。"
        eng "slave_preserve_commit_order is not supported %s."
        spa "slave_preserve_commit_order no está soportado %s."

ER_SERVER_OFFLINE_MODE
        chi "服务器目前处于离线模式"
        eng "The server is currently in offline mode"
        spa "El servidor se encuentra actualmente en modo fuera de línea"

ER_GIS_DIFFERENT_SRIDS
        chi "二进制几何函数%s给定两个不同SRID的几何形状:%u和%u,应该是相同的。"
        eng "Binary geometry function %s given two geometries of different srids: %u and %u, which should have been identical."
        spa "La función binaria de geomertía %s ha dado dos geometrías de diferente srids: %u y %u, que deberían de haber sido idénticas"

ER_GIS_UNSUPPORTED_ARGUMENT
        chi "调用几何函数%s与不受支持类型的参数。"
        eng "Calling geometry function %s with unsupported types of arguments."
        spa "Llamando a función de geometría %s con tipos de argumento no soportados."

ER_GIS_UNKNOWN_ERROR
        chi "未知的GIS错误发生在功能%s中。"
        eng "Unknown GIS error occurred in function %s."
        spa "Ha ocurrido un error GIS desconocido en función %s."

ER_GIS_UNKNOWN_EXCEPTION
        chi "在GIS功能%s中捕获的未知异常。"
        eng "Unknown exception caught in GIS function %s."
        spa "Excepción desconocida capturada en función GIS %s."

ER_GIS_INVALID_DATA 22023
        chi "提供给功能%s的GIS数据无效。"
        eng "Invalid GIS data provided to function %s."
        spa "Suministrados datos GIS inválidos a función %s."

ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION
        chi "几何形状在功能%s中没有数据。"
        eng "The geometry has no data in function %s."
        spa "La geometría no tiene datos en función %s."

ER_BOOST_GEOMETRY_CENTROID_EXCEPTION
        chi "无法计算质心,因为在功能%s中几何为空。"
        eng "Unable to calculate centroid because geometry is empty in function %s."
        spa "Imposible calcular centroid porque la geometría está vacía en la función %s."

ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION
        chi "几何叠加计算错误:几何数据在功能%s中无效。"
        eng "Geometry overlay calculation error: geometry data is invalid in function %s."
        spa "Error de cálculo de superposición de geometría: el dato de geometría es inválido en la función %s."

ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION
        chi "几何旋转信息计算错误:几何数据在功能%s中无效。"
        eng "Geometry turn info calculation error: geometry data is invalid in function %s."
        spa "Error de cálculo de información devuelto: los datos de geometría son inválidos en la función %s."

ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION
        chi "在功能%s中出乎意料地中断交叉点的分析程序。"
        eng "Analysis procedures of intersection points interrupted unexpectedly in function %s."
        spa "Los procedimientos de análisis de puntos de intersección se interrumpieron inesperadamente en la función %s."

ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION
        chi "在功能%s中抛出的未知异常。"
        eng "Unknown exception thrown in function %s."
        spa "Excepción desconocida lanzada en la función %s."

ER_STD_BAD_ALLOC_ERROR
        chi "内存分配错误:%-.256s。函数%s。"
        eng "Memory allocation error: %-.256s in function %s."
        spa "Error en adjudicación de memoria: %-.256s en la función %s."

ER_STD_DOMAIN_ERROR
        chi "域名错误:%-.256s. 函数%s"
        eng "Domain error: %-.256s in function %s."
        spa "Error en dominio: %-.256s en función %s."

ER_STD_LENGTH_ERROR
        chi "长度误差:%-.256s函数%s。"
        eng "Length error: %-.256s in function %s."
        spa "Error de tamaño: %-.256s en función %s."

ER_STD_INVALID_ARGUMENT
        chi "无效的参数错误:%-.256s函数%s。"
        eng "Invalid argument error: %-.256s in function %s."
        spa "Error de argumento inválido: %-.256s en función %s."

ER_STD_OUT_OF_RANGE_ERROR
        chi "超出范围错误:%-.256s 函数%s。"
        eng "Out of range error: %-.256s in function %s."
        spa "Error de fuera de rango: %-.256s en función %s."

ER_STD_OVERFLOW_ERROR
        chi "溢出错误:%-.256s。功能%s。"
        eng "Overflow error: %-.256s in function %s."
        spa "Error de desbordamiento: %-.256s en función %s."

ER_STD_RANGE_ERROR
        chi "范围错误:%-.256s函数%s。"
        eng "Range error: %-.256s in function %s."
        spa "Error de rango: %-.256s en función %s."

ER_STD_UNDERFLOW_ERROR
        chi "下溢错误:%-.256s函数%s。"
        eng "Underflow error: %-.256s in function %s."
        spa "Error de refreno (underflow): %-.256s en la función %s."

ER_STD_LOGIC_ERROR
        chi "逻辑错误:%-.256s 函数%s。"
        eng "Logic error: %-.256s in function %s."
        spa "Error lógico: %-.256s en la función %s."

ER_STD_RUNTIME_ERROR
        chi "运行时错误:%-.256s函数%s。"
        eng "Runtime error: %-.256s in function %s."
        spa "Error en tiempo de ejecución: %-.256s en la función %s."

ER_STD_UNKNOWN_EXCEPTION
        chi "未知例外:%-.384s在函数%s中。"
        eng "Unknown exception: %-.384s in function %s."
        spa "Excepción desconocida: %-.384s en la función %s."

ER_GIS_DATA_WRONG_ENDIANESS
        chi "几何字节字符串必须是小endian。"
        eng "Geometry byte string must be little endian."
        spa "La cadena de byte en Geometría debe de ser 'little endian'."

ER_CHANGE_MASTER_PASSWORD_LENGTH
        chi "为Replication User提供的密码超过32个字符的最大长度"
        eng "The password provided for the replication user exceeds the maximum length of 32 characters"
        spa "La contraseña suministrada para el usuario de réplica excede el tamaño máximo de 32 caracteres"

ER_USER_LOCK_WRONG_NAME 42000
        chi "用户级锁名名称'%-.192s'不正确。"
        eng "Incorrect user-level lock name '%-.192s'."
        spa "Nombre de bloqueo incorrecto a nivel de usuario '%-.192s'."

# Should be different from ER_LOCK_DEADLOCK since it doesn't cause implicit
# rollback. Should not be mapped to SQLSTATE 40001 for the same reason.
ER_USER_LOCK_DEADLOCK
        chi "在尝试获得用户级锁时发现死锁;尝试回滚交易/释放锁定并重新启动锁定采集。"
        eng "Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition."
        spa "Hallado estancamiento (deadlock) al intentar obtener bloqueo a nivel de usuario; intente retroceder (roll back) bloqueos de transacción/entrega y rearranque la adquisición de bloqueo."

ER_REPLACE_INACCESSIBLE_ROWS
        chi "无法执行REPLACE,因为它需要删除不在视图中的行"
        eng "REPLACE cannot be executed as it requires deleting rows that are not in the view"
        spa "REPLACE no se puede ejecutar ya que requiere borrar filas que no están en la vista"

ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS
        chi "不要支持使用GIS索引的表中的在线操作"
        eng "Do not support online operation on table with GIS index"
        spa "No soporta operación en línea en tabla con índice GIS"
# MariaDB extra error numbers starts from 4000
skip-to-error-number 4000

ER_UNUSED_26 0A000
        eng "This error never happens"
        spa "Este error nunca ocurre"
ER_UNUSED_27
        eng "This error never happens"
        spa "Este error nunca ocurre"
ER_WITH_COL_WRONG_LIST
        chi "使用列列表并选择字段列表具有不同的列计数"
        eng "WITH column list and SELECT field list have different column counts"
        spa "La lista de columnas de WITH y lista de campos de SELECT tienen diferentes contadores de columna"
ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE
        chi "WITH条款中的元素太多了"
        eng "Too many WITH elements in WITH clause"
        spa "Demasiados elementos WITH en cláusua WITH"
ER_DUP_QUERY_NAME
        chi "WITH子句重复查询名称%`-.64s"
        eng "Duplicate query name %`-.64s in WITH clause"
        spa "Nombre de consulta (query) %`-.64s duplicada en cláusula WITH"
ER_RECURSIVE_WITHOUT_ANCHORS
        chi "没有元素'%s'递归的锚点"
        eng "No anchors for recursive WITH element '%s'"
        spa "No hay anclajes para elemento WITH recursivo '%s'"
ER_UNACCEPTABLE_MUTUAL_RECURSION
        chi "锚定表'%s'不可接受的相互递归"
        eng "Unacceptable mutual recursion with anchored table '%s'"
        spa "Recursión mutua inaceptable con tabla anclada '%s'"
ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED
        chi "物质化的衍生参考指向递归的WITH 表'%s'"
        eng "Reference to recursive WITH table '%s' in materialized derived"
        spa "Referencia recursiva con WITH tabla '%s' en derivada materializada"
ER_NOT_STANDARD_COMPLIANT_RECURSIVE
        chi "表'%s'R_WRONG_WINDOW_SPEC_NAME违反了递归定义的限制"
        eng "Restrictions imposed on recursive definitions are violated for table '%s'"
ER_WRONG_WINDOW_SPEC_NAME
        chi "没有定义名称'%s'的窗口规范"
        eng "Window specification with name '%s' is not defined"
        spa "Especificación de ventana con nombre '%s' no definida"
ER_DUP_WINDOW_NAME
        chi "具有相同名称'%s'的多个窗口规范"
        eng "Multiple window specifications with the same name '%s'"
        spa "Múltiples especificaciones de ventana con el mismo nombre '%s'"
ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC
        chi "窗口规范引用另一个'%s'不能包含分区列表"
        eng "Window specification referencing another one '%s' cannot contain partition list"
        spa "La especificación de ventana que referencia a otra '%s' no puede contener una lista de partición"
ER_ORDER_LIST_IN_REFERENCING_WINDOW_SPEC
        chi "引用的窗口规范'%s'已包含次序列表"
        eng "Referenced window specification '%s' already contains order list"
        spa "La especificación de ventana referenciada '%s' ya contiene lista de orden"
ER_WINDOW_FRAME_IN_REFERENCED_WINDOW_SPEC
        chi "引用的窗口规范'%s'不能包含窗口框架"
        eng "Referenced window specification '%s' cannot contain window frame"
        spa "La especificación referenciada de ventana '%s' no puede contener marco de ventana"
ER_BAD_COMBINATION_OF_WINDOW_FRAME_BOUND_SPECS
        chi "窗框绑定规格的不可接受的组合"
        eng "Unacceptable combination of window frame bound specifications"
        spa "Combinación inaceptable de especificaciones ligadas a marco de ventana"
ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION
        chi "窗口函数仅在SELECT列表和ORDER BY子句中允许"
        eng "Window function is allowed only in SELECT list and ORDER BY clause"
        spa "La función de ventana sólo se permite en lista SELECT y en cláusula ORDER BY"
ER_WINDOW_FUNCTION_IN_WINDOW_SPEC
        chi "窗口规范中不允许窗口功能"
        eng "Window function is not allowed in window specification"
        spa "La función de ventana no está permitida en especificación de ventana"
ER_NOT_ALLOWED_WINDOW_FRAME
        chi "窗框不允许使用'%s'"
        eng "Window frame is not allowed with '%s'"
        spa "El marco de ventana no está permitido con '%s'"
ER_NO_ORDER_LIST_IN_WINDOW_SPEC
        chi "在“%s”的窗口规范中没有订单列表"
        eng "No order list in window specification for '%s'"
        spa "No exite lista de orden en especificación de ventana para '%s'"
ER_RANGE_FRAME_NEEDS_SIMPLE_ORDERBY
        chi "范围型框架需要单个排序键订购逐个条款"
        eng "RANGE-type frame requires ORDER BY clause with single sort key"
        spa "El marco tipo-RANGE requiere de la cláusula ORDER BY con clave única de clasificación"
ER_WRONG_TYPE_FOR_ROWS_FRAME
        chi "行类型框架需要整数"
        eng "Integer is required for ROWS-type frame"
        spa "Se requiere de un entero para marco tipo-ROWS"
ER_WRONG_TYPE_FOR_RANGE_FRAME
        chi "范围类型框架需要数字数据类型"
        eng "Numeric datatype is required for RANGE-type frame"
        spa "Se requiere de tipo de dato numérico para marco tipo-RANGE"
ER_FRAME_EXCLUSION_NOT_SUPPORTED
        chi "帧排除尚不支持"
        eng "Frame exclusion is not supported yet"
        spa "No se seporta aún la exclusión del marco"
ER_WINDOW_FUNCTION_DONT_HAVE_FRAME
        chi "此窗口功能可能没有窗口框架"
        eng "This window function may not have a window frame"
        spa "Esta función de ventana puede no tener un marco de ventana"
ER_INVALID_NTILE_ARGUMENT
        chi "NTILE的参数必须大于0"
        eng "Argument of NTILE must be greater than 0"
        spa "El argumento de NTILE debe de ser mayor de 0"
ER_CONSTRAINT_FAILED 23000
        chi "CONSTRAINT %`s失败的%`-.192s。%`-.192s"
        eng "CONSTRAINT %`s failed for %`-.192s.%`-.192s"
        ger "CONSTRAINT %`s fehlgeschlagen: %`-.192s.%`-.192s"
        rus "проверка CONSTRAINT %`s для %`-.192s.%`-.192s провалилась"
        spa "No se cumple la RESTRICCIÓN %`s para %`-.192s.%`-.192s"
        ukr "Перевірка CONSTRAINT %`s для %`-.192s.%`-.192s не пройшла"
ER_EXPRESSION_IS_TOO_BIG
        chi "%s条款中的表达太大了"
        eng "Expression in the %s clause is too big"
        spa "La expresión en la cláusula %s es demasiado grande"
ER_ERROR_EVALUATING_EXPRESSION
        chi "获得了一个错误评估存储的表达式%s"
        eng "Got an error evaluating stored expression %s"
        spa "Obtenido error evaluando expresión almacenada %s"
ER_CALCULATING_DEFAULT_VALUE
        chi "计算默认值为%`s时出错"
        eng "Got an error when calculating default value for %`s"
        spa "Obtenido un error al calcular valor por defecto para %`s"
ER_EXPRESSION_REFERS_TO_UNINIT_FIELD 01000
        chi "字段%`-.64s的表达指的是未初始化的字段%`s"
        eng "Expression for field %`-.64s is referring to uninitialized field %`s"
        spa "La expresión para campo %`-.64s se refiere a un campo sin inicializar %`s"
ER_PARTITION_DEFAULT_ERROR
        chi "只允许一个默认分区"
        eng "Only one DEFAULT partition allowed"
        spa "Sólo se permite una partición DEFAULT"
        ukr "Припустимо мати тільки один DEFAULT розділ" 
ER_REFERENCED_TRG_DOES_NOT_EXIST
        chi "给定动作时间和事件类型的引用触发'%s'不存在"
        eng "Referenced trigger '%s' for the given action time and event type does not exist"
        spa "No existe disparador referenciado '%s' para el momento dado de acción y para el tipo de evento"
ER_INVALID_DEFAULT_PARAM
        chi "此类参数使用不支持默认/忽略值"
        eng "Default/ignore value is not supported for such parameter usage"
        spa "El valor por defecto/ignorado no está soportado para tal utilización de parámetro"
        ukr "Значення за замовчуванням або ігнороване значення не підтримано для цього випадку використання параьетра"
ER_BINLOG_NON_SUPPORTED_BULK
        chi "仅支持基于行的复制,支持批量操作"
        eng "Only row based replication supported for bulk operations"
        spa "Sólo la réplica basada en fila es soportada para operaciones enormes"
ER_BINLOG_UNCOMPRESS_ERROR
        chi "解压压缩的binlog失败"
        eng "Uncompress the compressed binlog failed"
        spa "Ha fallado la descompresión del binlog comprimido"
ER_JSON_BAD_CHR
        chi "坏JSON,参数%d 函数'%s' 位置%d"
        eng "Broken JSON string in argument %d to function '%s' at position %d"
        spa "Cadena JSON rota en argumento %d para función '%s' en posición %d"
ER_JSON_NOT_JSON_CHR
        chi "变量%d出现禁止字符,函数'%s'在%d处"
        eng "Character disallowed in JSON in argument %d to function '%s' at position %d"
        spa "Carácter no permitido en JSON en argumento %d para función '%s' en la posición %d"
ER_JSON_EOS
        chi "JSON文本中的意外结尾,参数%d 函数'%s'"
        eng "Unexpected end of JSON text in argument %d to function '%s'"
        spa "Fin inesperado de texto JSON en argumento %d a función '%s'"
ER_JSON_SYNTAX
        chi "JSON文本语法错误 参数%d 函数'%s' 位置%d"
        eng "Syntax error in JSON text in argument %d to function '%s' at position %d"
        spa "Error de sintaxis en texto JSON en argumento %d a función '%s' en la posición %d"
ER_JSON_ESCAPING
        chi "JSON文本中逸出不正确 参数%d 函数'%s' 位置%d"
        eng "Incorrect escaping in JSON text in argument %d to function '%s' at position %d"
        spa "Incorrecta escapatoria en texto JSON en argumento %d a función '%s' en la posicón %d"
ER_JSON_DEPTH
        chi "超过JSON嵌套深度的%d限制 参数%d 函数'%s' 位置%d的"
        eng "Limit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %d"
        spa "El límite de %d en profundidad de estructuras JSON anidadas se ha alcanzado en argumento %d a función '%s' en la posición %d"
ER_JSON_PATH_EOS
        chi "JSON文本路径错误 参数%d 函数'%s'"
        eng "Unexpected end of JSON path in argument %d to function '%s'"
        spa "Fin inesperado de ruta JSON en argumento %d a función '%s'"
ER_JSON_PATH_SYNTAX
        chi "JSON路径语法错误 参数%d 函数'%s' 位置%d"
        eng "Syntax error in JSON path in argument %d to function '%s' at position %d"
        spa "Error de sintaxis en ruta JSON en argumento %d a función '%s' en la posición %d"
ER_JSON_PATH_DEPTH
        chi "JSON路径深度上限达到:%d 参数%d 函数'%s' 位置%d"
        eng "Limit of %d on JSON path depth is reached in argument %d to function '%s' at position %d"
        spa "El límite de %d en profundidad de ruta JSON se ha alcanzado en argumento %d a función '%s' en la posición %d"
ER_JSON_PATH_NO_WILDCARD
        chi "JSON路径中的通配符不允许 参数%d 函数'%s'"
        eng "Wildcards in JSON path not allowed in argument %d to function '%s'"
        spa "Comodines en ruta JSON no permitidos en argumento %d a función '%s'"
ER_JSON_PATH_ARRAY
        chi "JSON路径应当以排列为终 参数%d 函数'%s'"
        eng "JSON path should end with an array identifier in argument %d to function '%s'"
        spa "La ruta JSON debería de terminar con identificador de arreglo en argumento %d a función '%s'"
ER_JSON_ONE_OR_ALL
        chi "函数'%s'的第二个参数必须是'一个'或'全部'"
        eng "Argument 2 to function '%s' must be "one" or "all"."
        spa "El argumento 2 a función '%s' debe de ser "one" o "all"."
ER_UNSUPPORTED_COMPRESSED_TABLE
        chi "CREATE TEMPORARY TABLE 不允许用ROW_FORMAT=COMPRESSED或KEY_BLOCK_SIZE"
	eng "InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE."
	spa "InnoDB rechaza grabar en tablas con ROW_FORMAT=COMPRESSED o KEY_BLOCK_SIZE."
ER_GEOJSON_INCORRECT
        chi "为st_geomfromgeojson函数指定了不正确的GeoJSON格式。"
        eng "Incorrect GeoJSON format specified for st_geomfromgeojson function."
        spa "Especficado formato GeoJSON incorrecto para función st_geomfromgeojson."
ER_GEOJSON_TOO_FEW_POINTS
        chi "Geojson格式不正确 -  Linestring指定的太少点。"
        eng "Incorrect GeoJSON format - too few points for linestring specified."
        spa "Formato GeoJSON incorrecto - demasiados pocos puntos especificados para linestring."
ER_GEOJSON_NOT_CLOSED
        chi "Geojson格式不正确 - 多边形未关闭。"
        eng "Incorrect GeoJSON format - polygon not closed."
        spa "Formato GeoJSON incorrect - polígono no cerrado."
ER_JSON_PATH_EMPTY
        chi "path表达式'$'不允许在参数%d中允许运行'%s'。"
        eng "Path expression '$' is not allowed in argument %d to function '%s'."
        spa "La expresión de ruta '$' no está permitida en argumento %d a función '%s'."
ER_SLAVE_SAME_ID
        chi "与此从站相同的server_uuId / server_id的从站已连接到主设备"
        eng "A slave with the same server_uuid/server_id as this slave has connected to the master"
        spa "Un esclavo con el mismo server_uuid/server_id que este esclavo se ha conectado al maestro (master)"
ER_FLASHBACK_NOT_SUPPORTED
        chi "闪回不支持%s%s"
        eng "Flashback does not support %s %s"
        spa "Retrospectiva no soporta %s %s"

#
# MyRocks error messages
#
ER_KEYS_OUT_OF_ORDER
        chi "钥匙在散装负载期间出现订单"
        eng "Keys are out order during bulk load"
        spa "Claves desordenadas durante carga enorme"

ER_OVERLAPPING_KEYS
        chi "批量负载行重叠现有行"
        eng "Bulk load rows overlap existing rows"
        spa "La carga enorme de filas se superpone con filas existentes"

ER_REQUIRE_ROW_BINLOG_FORMAT
        chi "binlog_format != ROW时无法在master上执行更新"
        eng "Can't execute updates on master with binlog_format != ROW."
        spa "No puedo ejecutar actualizaciones en maestro (master) con binlog_format != ROW."

ER_ISOLATION_MODE_NOT_SUPPORTED
        chi "MyRocks仅支持读取承诺和可重复读取隔离级别。请从当前隔离级别的%s改变"
        eng "MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %s"
        spa "MyRocks soporta sólo niveles de aislamiento READ COMMITTED y REPEATABLE READ. Por favor, cambie desde nivel de aislamiento actual %s"

ER_ON_DUPLICATE_DISABLED
        chi "当在MyRocks禁用唯一检查时,INSERT,UPDATE, LOAD,使用Clauses更新或替换索引的子句(即,在重复的重复键更新,替换)中,不允许使用。查询:%s"
        eng "When unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %s"
        spa "Al desactivar chequeo de único en MyRocks, las sentencias INSERT, UPDATE, LOAD con cláusulas que actualizan o reemplazan la clave (p.ej. INSERT ON DUPLICATE KEY UPDATE, REPLACE) no se permiten. Consulte (query): %s"

ER_UPDATES_WITH_CONSISTENT_SNAPSHOT
        chi "START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT时,无法执行更新。"
        eng "Can't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT."
        spa "No puedo ejecutar actualizaciones cuando has iniciado una transacción mediante START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT."

ER_ROLLBACK_ONLY
        chi "此交易回滚并无法承诺。只支持支持的操作是滚动,因此将丢弃所有待处理的更改。请重新启动其他事务。"
        eng "This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction."
        spa "Esta transacción se ha retrocedido (rolled back) y no puede ser acometida (commit). La única operación soportada es retroceder (roll back), de tal forma que se descartarán todos los cambios pendientes. Por favor, rearranque otra transacción."

ER_ROLLBACK_TO_SAVEPOINT
        chi "如果修改行,MyRocks目前不支持保存点的回滚。"
        eng "MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows."
        spa "MyRocks en este momento no soporta ROLLBACK TO SAVEPOINT si se están modificando filas."

ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT
        chi "在RockSDB存储引擎中,START TRANSACTION WITH CONSISTENT SNAPSHOT 只支持REPEATABLE READ隔离"
        eng "Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine."
        spa "Sólo el nivel de aislamiento REPEATABLE READ se soporta para START TRANSACTION WITH CONSISTENT SNAPSHOT en Motor de Almacenaje RocksDB."

ER_UNSUPPORTED_COLLATION
        chi "字符串索引列%s的不受支持的归类。%s使用二进制校构(%s)。"
        eng "Unsupported collation on string indexed column %s.%s Use binary collation (%s)."
        spa "Cotejo (collation) no soportado en columna indizada de cadena %s.%s Use cotejo binario (%s)."

ER_METADATA_INCONSISTENCY
        chi "表'%s'不存在,但MyRocks内存存在元数据信息。这是数据不一致的标志。请检查是否存在'%s.frm',并尝试恢复如果它不存在。"
        eng "Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist."
        spa "La tabla '%s' no existe, pero existe información de metadatos dentro de MyRocks. Esto es una señal de datos inconsistentes. Por favor, revise si existe '%s.frm' e intente restaurarla si no existe."

ER_CF_DIFFERENT
        chi "列族('%s')标志(%d)与现有标志(%d)不同。分配新的CF标志,或者不要更改现有的CF标志。"
        eng "Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag."
        spa "La familia de columna ('%s') bandera (%d) es diferente de una bandera existente (%d). Asigne una nueva bandera CF o no cambie la bandera CF."

ER_RDB_TTL_DURATION_FORMAT
        chi "Myrocks中的TTL持续时间(%s)必须是无符号非空64位整数。"
        eng "TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer."
        spa "La duración de TTL (%s) en MyRocks debe de ser un entero sin signo no-null de 64-bit."

ER_RDB_STATUS_GENERAL
        chi "状态误差%d从RockSDB收到:%s"
        eng "Status error %d received from RocksDB: %s"
        spa "Recibido error de estado %d desde RocksDB: %s"

ER_RDB_STATUS_MSG
        chi "%s,状态误差%d从rocksdb收到:%s"
        eng "%s, Status error %d received from RocksDB: %s"
        spa "%s, Recibido error de estado %d desde RocksDB: %s"

ER_RDB_TTL_UNSUPPORTED
        chi "当表有隐藏的PK时,目前禁用TTL支持。"
        eng "TTL support is currently disabled when table has a hidden PK."
        spa "El soporte TTL está desactivado en este momento cuando la tabla tiene una PK oculta."

ER_RDB_TTL_COL_FORMAT
        chi "Myrocks中的TTL列(%s)必须是一个无符号的非空64位整数,存在于表内,并具有伴随的TTL持续时间。"
        eng "TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration."
        spa "La columna TTL (%s) en MyRocks debe de ser un entero sin signo no-null de 64-bit, debe de existir dentro de la tabla y debe de tener una duración ttl acompañante."

ER_PER_INDEX_CF_DEPRECATED
        chi "已弃用每个索引列族选项"
        eng "The per-index column family option has been deprecated"
        spa "La opcion de familia de columna por-índice está obsoleta"

ER_KEY_CREATE_DURING_ALTER
        chi "MyRocks在Alter期间创建新的索引定义失败。"
        eng "MyRocks failed creating new key definitions during alter."
        spa "MyRocks no pudo crear nuevas definiciones de clave durante 'alter'."

ER_SK_POPULATE_DURING_ALTER
        chi "MyRocks在Alter期间失败填充次要索引。"
        eng "MyRocks failed populating secondary key during alter."
        spa "MyRocks falló al poblar clave secundaria duante el 'alter'."
# MyRocks messages end

ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG
        chi "窗口函数不能用作组函数的参数。"
        eng "Window functions can not be used as arguments to group functions."
        spa "Las funciones de ventana no se pueden usar como argumentos para agrupar funciones."

ER_NET_OK_PACKET_TOO_LARGE
        chi "好的包太大了"
        eng "OK packet too large"
        spa "Paquete OK demasiado grande"

ER_GEOJSON_EMPTY_COORDINATES
        chi "Geojson格式不正确 - 空的'coordinates'阵列。"
        eng "Incorrect GeoJSON format - empty 'coordinates' array."
        spa "Formato GeoJSON incorrecto - arreglo vacío de coordenadas."

ER_MYROCKS_CANT_NOPAD_COLLATION
        chi "MyRocks目前不支持与“No Pad \”属性的归类。"
        eng "MyRocks doesn't currently support collations with \"No pad\" attribute."
        spa "MyRocks no soporta en la actualidad cotejos con atributo \"No pad\"."

ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
        chi "非法参数数据类型%s和%s为操作'%s'"
        eng "Illegal parameter data types %s and %s for operation '%s'"
        spa "Tipos de datos de parámetro ilegales %s y %s para operación '%s'"
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
        chi "非法参数数据类型%s用于操作'%s'"
        eng "Illegal parameter data type %s for operation '%s'"
        spa "Tipo de dato %s de parámetro ilegal para operación '%s'"
ER_WRONG_PARAMCOUNT_TO_CURSOR 42000
        chi "对Cursor的参数计数不正确'%-.192s'"
        eng "Incorrect parameter count to cursor '%-.192s'"
        spa "Contador incorrecto de parámetro para cursor '%-.192s'"
        rus "Некорректное количество параметров для курсора '%-.192s'"
ER_UNKNOWN_STRUCTURED_VARIABLE
        chi "未知的结构系统变量或行程变量'%-.*s'"
        eng "Unknown structured system variable or ROW routine variable '%-.*s'"
        spa "Variable de sistema con estructura desconocida o variable de rutina ROW '%-.*s'"
ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
        chi "行变量'%-.192s'没有字段'%-.192s'"
        eng "Row variable '%-.192s' does not have a field '%-.192s'"
        spa "La variable de fila '%-.192s' no tiene un campo '%-.192s'"
ER_END_IDENTIFIER_DOES_NOT_MATCH
        chi "结束标识符'%-.192s'不匹配'%-.192s'"
        eng "END identifier '%-.192s' does not match '%-.192s'"
        spa "Identificador END '%-.192s' no coincide con '%-.192s'"
ER_SEQUENCE_RUN_OUT
        chi "序列'%-.64s。%-.64s'已经用完了"
        eng "Sequence '%-.64s.%-.64s' has run out"
        spa "La secuencia '%-.64s.%-.64s' se ha agotado"
ER_SEQUENCE_INVALID_DATA
        chi "序列'%-.64s。%-.64s的值冲突"
        eng "Sequence '%-.64s.%-.64s' has out of range value for options"
        spa "La secuencia '%-.64s.%-.64s' tiene un valor fuera de rango para las opciones"
ER_SEQUENCE_INVALID_TABLE_STRUCTURE
        chi "序列'%-.64s。%-.64s'表结构无效(%s)"
        eng "Sequence '%-.64s.%-.64s' table structure is invalid (%s)"
        spa "La estuctura de tabla de secuencia '%-.64s.%-.64s' es inválida (%s)"
ER_SEQUENCE_ACCESS_ERROR
        chi "序列'%-.64s。%-.64s的访问错误"
        eng "Sequence '%-.64s.%-.64s' access error"
        spa "Error en acceso a secuencia '%-.64s.%-.64s'"
ER_SEQUENCE_BINLOG_FORMAT
          eng "Sequences requires binlog_format mixed or row"
          spa "Las secuencias requieren binlog_format mixto o fila"
ER_NOT_SEQUENCE 42S02
        chi "'%-.64s。%-.64s'不是序列"
        eng "'%-.64s.%-.64s' is not a SEQUENCE"
        spa "'%-.64s.%-.64s' no es una SECUENCIA"
ER_NOT_SEQUENCE2 42S02
        chi "'%-.192s'不是序列"
        eng "'%-.192s' is not a SEQUENCE"
        spa "'%-.192s' no es una SECUENCIA"
ER_UNKNOWN_SEQUENCES 42S02
        chi "未知序列:'%-.300s'"
        eng "Unknown SEQUENCE: '%-.300s'"
        spa "SECUENCIA desconocida: '%-.300s'"
ER_UNKNOWN_VIEW 42S02
        chi "未知视图:'%-.300s'"
        eng "Unknown VIEW: '%-.300s'"
        spa "VISTA desconocida: '%-.300s'"
ER_WRONG_INSERT_INTO_SEQUENCE
        chi "错误插入序列。人们只能将单表插入到序列对象(与mariadb-dump)中进行。如果要更改序列,请使用更改序列。"
        eng "Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead."
        spa "INSERT equivocado dentro de SEQUENCE. Uno sólo puede hacer INSERT único en tabla dentro de un objeto de secuencia (como con volcado-mariadb). Si desea cambiar la SECUENCIA, use ALTER SEQUENCE en su lugar."
ER_SP_STACK_TRACE
        chi "在%u中以%s"
        eng "At line %u in %s"
        spa "En la línea %u en %s"
ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
        chi "在包规范中声明子程序'%-.192s',但未在包主体中定义"
        eng "Subroutine '%-.192s' is declared in the package specification but is not defined in the package body"
        spa "La subrutina '%-.192s' está declarada en la especificación del paquete pero no está definida en el cuerpo del paquete"
ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED
        chi "子程序'%-.192s'具有前向声明但未定义"
        eng "Subroutine '%-.192s' has a forward declaration but is not defined"
        spa "La subrutina '%-.192s' tiene una declaración adelantada pero no está definida"
ER_COMPRESSED_COLUMN_USED_AS_KEY
        chi "压缩列'%-.192s'不能用于索引规范"
        eng "Compressed column '%-.192s' can't be used in key specification"
        spa "Una columna comprimida '%-.192s' no se puede usar en especificación de clave"
ER_UNKNOWN_COMPRESSION_METHOD
        chi "未知压缩方法:%s"
        eng "Unknown compression method: %s"
        spa "Método de compresión desconocido: %s"
ER_WRONG_NUMBER_OF_VALUES_IN_TVC
        chi "使用的表值构造函数具有不同数量的值"
        eng "The used table value constructor has a different number of values"
        spa "El constructor del valor de tabla usado tiene un número diferente de valores"
ER_FIELD_REFERENCE_IN_TVC
        chi "字段参考'%-.192s'不能用于表值构造函数"
        eng "Field reference '%-.192s' can't be used in table value constructor"
	spa "La referencia a campo '%-.192s' no se puede usar en constructor de valor de tabla"
ER_WRONG_TYPE_FOR_PERCENTILE_FUNC
        chi "%s函数需要数字数据类型"
        eng "Numeric datatype is required for %s function"
        spa "Se requiere de tipo de dato numérico para función %s"
ER_ARGUMENT_NOT_CONSTANT
        chi "%s函数的参数不是分区的常量"
        eng "Argument to the %s function is not a constant for a partition"
        spa "El argumento de la función %s no es una constante para una partición"
ER_ARGUMENT_OUT_OF_RANGE
        chi "%s函数的参数不属于范围[0,1]"
        eng "Argument to the %s function does not belong to the range [0,1]"
        spa "El argumento de la función %s no pertenece al rango [0,1]"
ER_WRONG_TYPE_OF_ARGUMENT
        chi "%s函数仅接受可以转换为数字类型的参数"
        eng "%s function only accepts arguments that can be converted to numerical types"
        spa "La función %s sólo acepta argumentos que se puedan convertir a tipos numéricos"
ER_NOT_AGGREGATE_FUNCTION
        chi "在错误的上下文中使用的聚合特定指令(fetch组下一行)"
        eng "Aggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong context"
        spa "Instrucción específica de agregación (FETCH GROUP NEXT ROW) usada en contexto equivocado"
ER_INVALID_AGGREGATE_FUNCTION
        chi "聚合函数丢失的聚合特定指令(fetch组下一行)"
        eng "Aggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate function"
        spa "Falta instrucción específica de agregación (FETCH GROUP NEXT ROW) de la función de agregación"
ER_INVALID_VALUE_TO_LIMIT
        chi "限制仅接受整数值"
        eng "Limit only accepts integer values"
        spa "El límite sólo acepta valores enteros"
ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT
        chi "隐形列%`s必须具有默认值"
        eng "Invisible column %`s must have a default value"
        spa "Una columna invisible %`s debe de tener valor por defecto"


# MariaDB error numbers related to System Versioning


ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING
        chi "匹配的行:%ld已更改:%ld插入:%ld警告:%ld"
        eng "Rows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld"
        spa "Filas coincidentes: %ld Cambiadas: %ld Insertadas: %ld Avisos: %ld"

ER_VERS_FIELD_WRONG_TYPE
        chi "%`s必须为系统版本为表%s的类型%`s"
        eng "%`s must be of type %s for system-versioned table %`s"
        spa "%`s debe de ser del tipo %s para tabla versionada del sistema %`s"

ER_VERS_ENGINE_UNSUPPORTED
        chi "Transaction-Precise系统版本控制%`s不受支持"
        eng "Transaction-precise system versioning for %`s is not supported"
        spa "No se soporta versionado de sistema de transacción precisa para %`s"

ER_UNUSED_23
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_PARTITION_WRONG_TYPE
        chi "错误的分区类型,预期类型:%`s"
        eng "Wrong partitioning type, expected type: %`s"
        spa "Tipo de partición equivocada, tipo esperado: %`s"

WARN_VERS_PART_FULL
        chi "版本化表%`s.%`s:partition%`s已满,添加更多历史分区(out of %s)"
        eng "Versioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitions"
        spa "Tabla versionada %`s.%`s: última partición HISTORY (%`s) fuera de %s, necesita de más particiones HISTORY"

WARN_VERS_PARAMETERS
        chi "也许缺少参数:%s"
        eng "Maybe missing parameters: %s"
        spa "Parámetros que quizás faltan: %s"

ER_VERS_DROP_PARTITION_INTERVAL
        chi "只能在旋转间隔时丢弃最旧的分区"
        eng "Can only drop oldest partitions when rotating by INTERVAL"
        spa "Sólo se pueden eliminar viejas particiones al rotar mediante INTERVAL"

ER_UNUSED_25
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

WARN_VERS_PART_NON_HISTORICAL
        chi "分区%`s包含非历史数据"
        eng "Partition %`s contains non-historical data"
        spa "La partición %`s contiene datos no históricos"

ER_VERS_ALTER_NOT_ALLOWED
        chi "系统版本为%`s.%`s不允许。更改@@system_versioning_alter_history用ALTER。"
        eng "Not allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER."
        spa "No permitido para versionado del sistema %`s.%`s. Cambie @@system_versioning_alter_history para proceder con ALTER."

ER_VERS_ALTER_ENGINE_PROHIBITED
        chi "不允许系统版本为%`s.%`s。不支持更改返回/来自本机系统版本传输引擎。"
        eng "Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported."
        spa "No permitido para versionado del sistema %`s.%`s. Cambio a/desde motor de versionado nativo no soportado."

ER_VERS_RANGE_PROHIBITED
        chi "不允许使用SYSTEM_TIME范围选择器"
        eng "SYSTEM_TIME range selector is not allowed"
        spa "Selector de rango SYSTEM_TIME no permitido"

ER_CONFLICTING_FOR_SYSTEM_TIME
        chi "与递归的System_time子句相冲突"
        eng "Conflicting FOR SYSTEM_TIME clauses in WITH RECURSIVE"
        spa "Cláusulas conflictivas FOR SYSTEM_TIME en WITH RECURSIVE"

ER_VERS_TABLE_MUST_HAVE_COLUMNS
        chi "表%`s必须至少有一个版本后的列"
        eng "Table %`s must have at least one versioned column"
        spa "La tabla %`s debe de tener al menos una columna versionada"

ER_VERS_NOT_VERSIONED
        chi "表%`s不是系统版本的"
        eng "Table %`s is not system-versioned"
        spa "La tabla %`s no es versionada del sistema"

ER_MISSING
        chi "%`s的错误参数:缺少'%s'"
        eng "Wrong parameters for %`s: missing '%s'"
        spa "Parámetros equivocados para %`s: falta '%s'"

ER_VERS_PERIOD_COLUMNS
        chi "system_time的时期必须使用列%`s和%`s"
        eng "PERIOD FOR SYSTEM_TIME must use columns %`s and %`s"
        spa "PERIOD FOR SYSTEM_TIME debe de usar columnas %`s y %`s"

ER_PART_WRONG_VALUE
        chi "用于分区%`s的错误参数:'%s'的错误值"
        eng "Wrong parameters for partitioned %`s: wrong value for '%s'"
        spa "Parámetros equivocados para particionado %`s: valor equivocado para '%s'"

ER_VERS_WRONG_PARTS
        chi "%`s的错误分区:必须至少有一个HISTORY,只能有一个CURRENT"
        eng "Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENT"
        spa "Particiones equivocadas para %`s: debe de tener al menos una HISTORY y exactamente un último CURRENT"

ER_VERS_NO_TRX_ID
        chi "TRX_ID%llu在`mysql.transaction_registry`中找不到"
        eng "TRX_ID %llu not found in `mysql.transaction_registry`"
        spa "TRX_ID %llu no hallado en `mysql.transaction_registry`"

ER_VERS_ALTER_SYSTEM_FIELD
        chi "无法更改系统版本配置字段%`s"
        eng "Can not change system versioning field %`s"
        spa "No puedo cambiar campo de versionado de sistema %`s"

ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION
        chi "无法删除由SYSTEM_TIME分区的表%`s的系统版本"
        eng "Can not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIME"
        spa "No puedo DROP SYSTEM VERSIONING para la tabla %`s particionada BY SYSTEM_TIME"

ER_VERS_DB_NOT_SUPPORTED
        chi "不支持%`s数据库中的系统版本化表"
        eng "System-versioned tables in the %`s database are not supported"
        spa "No se soportan las tablas versionadas del sistema en la base de datos %`s"

ER_VERS_TRT_IS_DISABLED
        chi "事务注册表已禁用"
        eng "Transaction registry is disabled"
        spa "El registro de transaciones está desactivado"

ER_VERS_DUPLICATE_ROW_START_END
        chi "重复行%s列%`s"
        eng "Duplicate ROW %s column %`s"
	spa "Duplicada FILA %s columna %`s"

ER_VERS_ALREADY_VERSIONED
        chi "表%`s已经是系统版本的"
        eng "Table %`s is already system-versioned"
        spa "La tabla %`s ya es versionada del sistema"

ER_UNUSED_24
        eng "You should never see it"
        spa "Nunca debería vd de ver esto"

ER_VERS_NOT_SUPPORTED
        chi "系统版本的表不支持%s"
        eng "System-versioned tables do not support %s"
	spa "Las tablas versionadas del sistema no soportan %s"

ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED
        chi "事务 - 精确的系统 - 版本的表不支持按行开始或行末端分区"
        eng "Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END"
        spa "Las tablas versionadas del sistemas de transacción precisa no soportan particionado mediante ROW START o ROW END"
ER_INDEX_FILE_FULL
        chi "表'%-.192s'的索引文件已满"
        eng "The index file for table '%-.192s' is full"
        spa "El fichero/archivo índice para la tabla '%-.192s' está lleno"
ER_UPDATED_COLUMN_ONLY_ONCE
        chi "列%`s.%`s在单个更新语句中不能更换一次"
        eng "The column %`s.%`s cannot be changed more than once in a single UPDATE statement"
        spa "La columna %`s.%`s no se pude cambiar más de ua vez en una sentencia UPDATE única"
ER_EMPTY_ROW_IN_TVC
        chi "在此上下文中,表值构造函数不允许在没有元素的行"
        eng "Row with no elements is not allowed in table value constructor in this context"
        spa "Fila sin elementos no se permite en constructor de valor de tabla en este contexto"
ER_VERS_QUERY_IN_PARTITION
        chi "表%`s的SYSTEM_TIME分区不支持历史查询"
        eng "SYSTEM_TIME partitions in table %`s does not support historical query"
        spa "Las particiones SYSTEM_TIME en la tabla %`s no soportan consulta (query) histórica"
ER_KEY_DOESNT_SUPPORT
        chi "%s索引%`s不支持此操作"
        eng "%s index %`s does not support this operation"
        spa "%s índice %`s no soporta esta operación"
ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD
        chi "更改表选项需要将要重建的表格重建"
        eng "Changing table options requires the table to be rebuilt"
	spa "Cambiar las opciones de tabla requiere que la tabla sea reconstruida"
ER_BACKUP_LOCK_IS_ACTIVE
        chi "由于您在运行BACKUP STAGE,无法执行命令"
        eng "Can't execute the command as you have a BACKUP STAGE active"
        spa "No puedo ejecutar el comando cuando vd tiene activo un BACKUP STAGE"
ER_BACKUP_NOT_RUNNING
        chi "您必须启动备份“备份阶段开始”"
        eng "You must start backup with \"BACKUP STAGE START\""
        spa "Vd debe de arracar respaldo mediante \"BACKUP STAGE START\""
ER_BACKUP_WRONG_STAGE
        chi "备份阶段'%s'相同或在当前备份阶段'%s'之前"
        eng "Backup stage '%s' is same or before current backup stage '%s'"
        spa "La fase de respaldo '%s' es la misma o anterior a la fase de respaldo actual '%s'"
ER_BACKUP_STAGE_FAILED
        chi "备份阶段'%s'失败"
        eng "Backup stage '%s' failed"
        spa "La fase de respaldo '%s' ha fallado"
ER_BACKUP_UNKNOWN_STAGE
        chi "未知备份阶段:'%s'。阶段应该是START,FLUSH,BLOCK_DDL,BLOCK_COMIT或END之一"
        eng "Unknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or END"
        spa "Fase de respaldo desconocida: '%s'. La fase debería de ser una de START, FLUSH, BLOCK_DDL, BLOCK_COMMIT o END"
ER_USER_IS_BLOCKED
        chi "由于凭证错误太多,用户被阻止;用'ALTER USER / FLUSH PRIVILEGES'解锁"
        eng "User is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'"
        spa "El usuario está bloqueado a causa de demasiados errores de credenciales; desbloquee mediante 'ALTER USER / FLUSH PRIVILEGES'"
ER_ACCOUNT_HAS_BEEN_LOCKED
        chi "访问拒绝,此帐户已锁定"
        eng "Access denied, this account is locked"
        rum "Acces refuzat, acest cont este blocat"
        spa "Acceso denegado, esta cuenta está bloqueada"
ER_PERIOD_TEMPORARY_NOT_ALLOWED
        chi "应用程序时间段表不能临时"
        eng "Application-time period table cannot be temporary"
        spa "Una tabla de período de momento-de-aplicación no puede ser temporal"
ER_PERIOD_TYPES_MISMATCH
        chi "%`s的期间的字段有不同的类型"
        eng "Fields of PERIOD FOR %`s have different types"
        spa "Los campos de PERIOD FOR %`s tienen tipos diferentes"
ER_MORE_THAN_ONE_PERIOD
        chi "无法指定多个应用程序时间段"
        eng "Cannot specify more than one application-time period"
        spa "No se puede especificar más de un período de momento de aplicación"
ER_PERIOD_FIELD_WRONG_ATTRIBUTES
        chi "期间字段%`s不能是%s"
        eng "Period field %`s cannot be %s"
        spa "El campo de período %`s no puede ser %s"
ER_PERIOD_NOT_FOUND
        chi "期间%`s未在表中找到"
        eng "Period %`s is not found in table"
        spa "El período %`s no se ha hallado en la tabla"
ER_PERIOD_COLUMNS_UPDATED
        chi "列%`s在更新集列表中指定的周期%`s中使用"
        eng "Column %`s used in period %`s specified in update SET list"
        spa "La columna %`s usada en período %`s especificado en lista de actualizar SET"
ER_PERIOD_CONSTRAINT_DROP
        chi "无法DROP CONSTRAINT `%s`。使用DROP PERIOD `%s`"
        eng "Can't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for this"
        spa "No puedo DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` para esto"
ER_TOO_LONG_KEYPART 42000 S1009
        chi "指定的索引部分太长;最大索引部分长度为 %u 个字节"
        eng "Specified key part was too long; max key part length is %u bytes"
        spa "La parte de clave especificada es demasiado larga; el tamaño máximo de la parte de clave es de %u bytes"
ER_TOO_LONG_DATABASE_COMMENT
        eng "Comment for database '%-.64s' is too long (max = %u)"
        spa "El comentario para la base de datos '%-.64s' es demasiado largo (máx = %u)"
ER_UNKNOWN_DATA_TYPE
        eng "Unknown data type: '%-.64s'"
        spa "Tipo de datos desconocido: '%-.64s'"
ER_UNKNOWN_OPERATOR
        eng "Operator does not exist: '%-.128s'"
        spa "El operador no existe: '%-.128s'"
ER_WARN_HISTORY_ROW_START_TIME
        eng "Table `%s.%s` history row start '%s' is later than row end '%s'"
        spa "En la historia de la tabla `%s.%s` el inicio de fila '%s' es posterior al fin de fila '%s'"
ER_PART_STARTS_BEYOND_INTERVAL
        eng "%`s: STARTS is later than query time, first history partition may exceed INTERVAL value"
        spa "%`s: STARTS es posterior al momento de consulta (query), la primera partición de historia puede exceder el valor INTERVAL"
ER_GALERA_REPLICATION_NOT_SUPPORTED
        eng "Galera replication not supported"
        spa "La replicación en Galera no está soportada"
ER_LOAD_INFILE_CAPABILITY_DISABLED
        eng "The used command is not allowed because the MariaDB server or client has disabled the local infile capability"
        rum "Comanda folosită nu este permisă deoarece clientul sau serverul MariaDB a dezactivat această capabilitate"
        spa "El comando usado no está permitido porque el servidor MariaDB o el cliente han desactivado la capacidad 'local infile'"
ER_NO_SECURE_TRANSPORTS_CONFIGURED
        eng "No secure transports are configured, unable to set --require_secure_transport=ON"
        spa "No se han configurado transportes seguros, imposible poner --require_secure_transport=ON"
ER_SLAVE_IGNORED_SHARED_TABLE
        eng "Slave SQL thread ignored the '%s' because table is shared"
        ger "Slave-SQL-Thread hat die Abfrage '%s' ignoriert"
        nla "Slave SQL thread negeerde de query '%s'"
        por "Slave SQL thread ignorado a consulta devido '%s'"
        spa "Hilo (thread) SQL esclavo ignoró la '%s' porque la tabla está compartida"
        swe "Slav SQL tråden ignorerade '%s' pga tabellen är delad"
ER_NO_AUTOINCREMENT_WITH_UNIQUE
        eng  "AUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`s"
        spa  "La columna %'s con AUTO_INCREMENT no se puede usar en índice UNIQUE %`s"
ER_KEY_CONTAINS_PERIOD_FIELDS
        eng "Key %`s cannot explicitly include column %`s"
        spa "La clave %`s no puede incluir de forma explícita la columna %`s"
ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS
        eng "Key %`s cannot have WITHOUT OVERLAPS"
        spa "La clave %`s no puede tener WITHOUT OVERLAPS"
ER_NOT_ALLOWED_IN_THIS_CONTEXT
        eng "'%-.128s' is not allowed in this context"
        spa "'%-.128s' no está permitido en este contexto"
ER_DATA_WAS_COMMITED_UNDER_ROLLBACK
        eng "Engine %s does not support rollback. Changes were committed during rollback call"
        spa "El motor %s no soporta retroceso (rollback). Los cambios se acometieron (commit) durante la llamada a retroceso (rollback)"
ER_PK_INDEX_CANT_BE_IGNORED
        eng "A primary key cannot be marked as IGNORE"
        spa "Una clave primaria no se puede marcar como IGNORE"
ER_BINLOG_UNSAFE_SKIP_LOCKED
	eng "SKIP LOCKED makes this statement unsafe"
	spa "SKIP LOCKED hace que esta sentencia sea no segura"
ER_JSON_TABLE_ERROR_ON_FIELD
        eng "Field '%s' can't be set for JSON_TABLE '%s'."
        spa "El campo '%s' no se puede poner para JSON_TABLE '%s'."
ER_JSON_TABLE_ALIAS_REQUIRED
        eng "Every table function must have an alias."
        spa "Cada función de tabla debe de tener un alias."
ER_JSON_TABLE_SCALAR_EXPECTED
        eng "Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'."
        spa "No puedo guardar un arreglo o un objeto en la columna escalar '%s' de JSON_TABLE '%s'."
ER_JSON_TABLE_MULTIPLE_MATCHES
        eng "Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'."
        spa "No puedo guardar múltiples coincidencias de la ruta en la columna '%s' de JSON_TABLE '%s'."
ER_WITH_TIES_NEEDS_ORDER
        eng "FETCH ... WITH TIES requires ORDER BY clause to be present"
        spa "FETCH ... WITH TIES requiere que esté presente la cláusula ORDER BY"
ER_REMOVED_ORPHAN_TRIGGER
        eng "Dropped orphan trigger '%-.64s', originally created for table: '%-.192s'"
        spa "Eliminado disparador huérfano '%-.64s', creado originálmente para la tabla: '%-.192s'"
ER_STORAGE_ENGINE_DISABLED
        eng "Storage engine %s is disabled"
        spa "El motor de almacenaje %s está desactivado"
charsets/koi8u.xml000064400000014604150343472770010162 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="koi8u">

<ctype>
<map>
  00
  20  20  20  20  20  20  20  20  20  28  28  28  28  28  20  20
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  84  84  84  84  84  84  84  84  84  84  10  10  10  10  10  10
  10  81  81  81  81  81  81  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  01  01  01  01  10  10  10  10  10
  10  82  82  82  82  82  82  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  02  02  02  02  10  10  10  10  20
  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  10  10  10  02  02  10  02  02  10  10  10  10  10  02  10  10
  10  10  10  01  01  10  01  01  10  10  10  10  10  01  10  10
  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02
  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01
</map>
</ctype>


<lower>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  5B  5C  5D  5E  5F
  20  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  7F
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  20  20  20  A3  A4  20  A6  A7  20  20  20  20  20  AD  20  20
  20  20  20  A3  A4  20  A6  A7  20  20  20  20  20  AD  20  20
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
</map>
</lower>


<upper>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
  20  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  20  20  20  B3  B4  20  B6  B7  20  20  20  20  20  BD  20  20
  20  20  20  B3  B4  20  B6  B7  20  20  20  20  20  BD  20  20
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
2500 2502 250C 2510 2514 2518 251C 2524 252C 2534 253C 2580 2584 2588 258C 2590
2591 2592 2593 2320 25A0 2022 221A 2248 2264 2265 00A0 2321 00B0 00B2 00B7 00F7
2550 2551 2552 0451 0454 2554 0456 0457 2557 2558 2559 255A 255B 0491 255D 255E
255F 2560 2561 0401 0404 2563 0406 0407 2566 2567 2568 2569 256A 0490 256C 00A9
044E 0430 0431 0446 0434 0435 0444 0433 0445 0438 0439 043A 043B 043C 043D 043E
043F 044F 0440 0441 0442 0443 0436 0432 044C 044B 0437 0448 044D 0449 0447 044A
042E 0410 0411 0426 0414 0415 0424 0413 0425 0418 0419 041A 041B 041C 041D 041E
041F 042F 0420 0421 0422 0423 0416 0412 042C 042B 0417 0428 042D 0429 0427 042A
</map>
</unicode>


<collation name="koi8u_general_ci">
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
  20  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF  B0  B1  B2  B3  B4
  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF  C0  C1  C2  C3  C4
  C5  C6  C7  88  87  C8  8C  8D  C9  CA  CB  CC  CD  84  CE  CF
  D0  D1  D2  88  87  D3  8C  8D  D4  D5  D6  D7  D8  84  D9  DA
  A3  80  81  9B  85  86  99  83  9A  8B  8E  8F  90  91  92  93
  94  A4  95  96  97  98  89  82  A1  A0  8A  9D  A2  9E  9C  9F
  A3  80  81  9B  85  86  99  83  9A  8B  8E  8F  90  91  92  93
  94  A4  95  96  97  98  89  82  A1  A0  8A  9D  A2  9E  9C  9F
</map>
</collation>

<collation name="koi8u_bin"	flag="binary"/>

</charset>

</charsets>

charsets/ascii.xml000064400000012610150343472770010206 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2007 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="ascii">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
</map>
</unicode>


<collation name="ascii_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="ascii_bin"	flag="binary"/>

</charset>

</charsets>
charsets/hp8.xml000064400000012576150343472770007630 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="hp8">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 20 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 20 20 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 10 10 02 10 10 10 10 10 10 02 10 02 02
 01 10 10 01 02 10 10 02 01 10 01 01 01 10 10 10
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 20 20 20 20 10 10 10 10 10 10 10 10 10 20
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 C8 C0 C9 C1 CD D1 DD A8 A9 AA AB AC CB C3 AF
 B0 B2 B2 B3 B5 B5 B7 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D4 D1 D6 D7 D4 D5 D6 D7 CC D9 CE CF C5 DD DE C2
 C4 E2 E2 E4 E4 D5 D9 C6 CA EA EA EC EC C7 EF EF
 F1 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B1 B3 B4 B4 B6 B6 B8 B9 BA BB BC BD BE BF
 A2 A4 DF AE E0 DC E7 ED A1 A3 E8 AD D8 A5 DA DB
 D0 A6 D2 D3 D0 E5 D2 D3 D8 E6 DA DB DC A7 DE DF
 E0 E1 E1 E3 E3 E5 E6 E7 E8 E9 E9 EB EB ED EE EE
 F0 F0 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 00C0 00C2 00C8 00CA 00CB 00CE 00CF 00B4 02CB 02C6 00A8 02DC 00D9 00DB 20A4
00AF 00DD 00FD 00B0 00C7 00E7 00D1 00F1 00A1 00BF 00A4 00A3 00A5 00A7 0192 00A2
00E2 00EA 00F4 00FB 00E1 00E9 00F3 00FA 00E0 00E8 00F2 00F9 00E4 00EB 00F6 00FC
00C5 00EE 00D8 00C6 00E5 00ED 00F8 00E6 00C4 00EC 00D6 00DC 00C9 00EF 00DF 00D4
00C1 00C3 00E3 00D0 00F0 00CD 00CC 00D3 00D2 00D5 00F5 0160 0161 00DA 0178 00FF
00DE 00FE 00B7 00B5 00B6 00BE 2014 00BC 00BD 00AA 00BA 00AB 25A0 00BB 00B1 0000
 
</map>
</unicode>


<collation name="hp8_english_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="hp8_bin"	flag="binary"/>

</charset>

</charsets>
charsets/cp852.xml000064400000012630150343472770007761 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2004 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="cp852">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 01 02 02 02 02 02 02 02 02 02 01 02 02 01 01 01
 01 01 02 02 02 01 02 01 02 01 01 01 02 01 00 02
 02 02 02 02 01 02 01 02 01 02 00 02 01 01 00 00
 00 00 00 00 00 01 01 01 02 00 00 00 00 01 02 00
 00 00 00 00 00 00 01 02 00 00 00 00 00 00 00 00
 02 01 01 01 02 01 01 01 02 00 00 00 00 01 01 00
 01 02 01 01 02 02 01 02 01 01 02 01 02 01 02 00
 00 00 00 00 00 00 00 00 00 00 00 02 01 02 00 48
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 87 81 82 83 84 85 86 87 88 89 8B 8B 8C AB 84 86
 82 92 92 93 94 96 96 98 98 94 81 9C 9C 88 9E 9F
 A0 A1 A2 A3 A5 A5 A7 A7 A9 A9 AA AB 9F B8 AE AF
 B0 B1 B2 B3 B4 A0 83 D8 B8 B9 BA BB BC BE BE BF
 C0 C1 C2 C3 C4 C5 C7 C7 C8 C9 CA CB CC CD CE CF
 D0 D0 D4 89 D4 E5 A1 8C D8 D9 DA DB DC EE 85 DF
 A2 E1 93 E4 E4 E5 E7 E7 EA A3 E8 FB EC EC EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 9A 90 B6 8E DE 8F 80 9D D3 8A 8A D7 8D 8E 8F
 90 91 91 E2 99 95 95 97 97 99 9A 9B 9B 9D 9E AC
 B5 D6 E0 E9 A4 A4 A6 A6 A8 A8 AA 8D AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 AD B9 BA BB BC BE BD BF
 C0 C1 C2 C3 C4 C5 C6 C6 C8 C9 CA CB CC CD CE CF
 D1 D1 D2 D3 D2 D5 D6 D7 B7 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E3 D5 E6 E6 E8 E9 E8 EB ED ED DD EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA EB FC FC FE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 00C7 00FC 00E9 00E2 00E4 016F 0107 00E7 0142 00EB 0150 0151 00EE 0179 00C4 0106
 00C9 0139 013A 00F4 00F6 013D 013E 015A 015B 00D6 00DC 0164 0165 0141 00D7 010D
 00E1 00ED 00F3 00FA 0104 0105 017D 017E 0118 0119 00AC 017A 010C 015F 00AB 00BB
 2591 2592 2593 2502 2524 00C1 00C2 011A 015E 2563 2551 2557 255D 017B 017C 2510
 2514 2534 252C 251C 2500 253C 0102 0103 255A 2554 2569 2566 2560 2550 256C 00A4
 0111 0110 010E 00CB 010F 0147 00CD 00CE 011B 2518 250C 2588 2584 0162 016E 2580
 00D3 00DF 00D4 0143 0144 0148 0160 0161 0154 00DA 0155 0170 00FD 00DD 0163 00B4
 00AD 02DD 02DB 02C7 02D8 00A7 00F7 00B8 00B0 00A8 02D9 0171 0158 0159 25A0 00A0
</map>
</unicode>


<collation name="cp852_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 47 48 4C 4F 54 55 56 57 5A 5B 5C 5E 5F 62
 67 68 69 6C 71 74 75 76 77 78 7B 90 91 92 93 94
 95 41 47 48 4C 4F 54 55 56 57 5A 5B 5C 5E 5F 62
 67 68 69 6C 71 74 75 76 77 78 7B 96 97 98 99 9A
 48 74 4F 41 41 74 48 48 5C 4F 62 62 57 7B 41 48
 4F 5C 5C 62 62 5C 5C 6C 6C 62 74 71 71 5C 9E 48
 41 57 62 74 41 41 7B 7B 4F 4F AA 7B 48 6C AE AF
 B0 B1 B2 B3 B4 41 41 4F 6C B5 BA BB BC 7B 7B BF
 C0 C1 C2 C3 C4 C5 41 41 C8 C9 CA CB CC CD CE CF
 4C 4C 4C 4F 4C 60 57 57 4F D9 DA DB DC 71 74 DF
 62 70 62 60 60 60 6C 6C 69 74 69 74 78 78 71 EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA 74 69 69 FE FF
</map>
</collation>

<collation name="cp852_bin"	flag="binary"/>

</charset>

</charsets>
charsets/cp1256.xml000064400000012701150343472770010037 0ustar00<?xml version='1.0' encoding="utf-8"?>

<!-- Arabic, Persian, Pakistani, Urdu -->

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="cp1256">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 00 00
 00 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 03 00 02 00 00 00 00 00 00 00 00 01 03 03 00
 03 10 10 10 10 00 00 00 00 00 00 00 02 00 00 00
 00 10 00 00 00 00 00 00 00 00 00 10 10 10 00 00
 10 10 00 00 00 00 00 00 00 00 10 10 00 00 00 10
 00 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
 03 03 03 03 03 03 03 00 03 03 03 03 03 03 03 03
 02 03 02 03 03 03 03 02 02 02 02 02 03 03 02 02
 03 03 03 03 02 03 03 00 03 02 03 02 02 00 00 00
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 9C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5F 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7F 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 8C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 20AC 067E 201A 0192 201E 2026 2020 2021 02C6 2030 0000 2039 0152 0686 0698 0000
 06AF 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0153 200C 200D 0000
 00A0 060C 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 0000 00AB 00AC 00AD 00AE 00AF
 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 061B 00BB 00BC 00BD 00BE 061F
 0000 0621 0622 0623 0624 0625 0626 0627 0628 0629 062A 062B 062C 062D 062E 062F
 0630 0631 0632 0633 0634 0635 0636 00D7 0637 0638 0639 063A 0640 0641 0642 0643
 00E0 0644 00E2 0645 0646 0647 0648 00E7 00E8 00E9 00EA 00EB 0649 064A 00EE 00EF
 064B 064C 064D 064E 00F4 064F 0650 00F7 0651 00F9 0652 00FB 00FC 200E 200F 0000
</map>
</unicode>


<collation name="cp1256_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 45 47 4A 4C 52 55 57 59 5D 5F 61 63 65 67
 6C 6E 70 72 74 76 7B 7D 7F 81 83 B9 BA BB BC BD
 BE 41 45 47 4A 4C 52 55 57 59 5D 5F 61 63 65 67
 6C 6E 70 72 74 76 7B 7D 7F 81 83 BF C0 C1 C2 C3
 C4 8E C5 54 C6 C7 C8 C9 CA CB CC CD 6A 92 99 CE
 A5 CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 6A DA DB DC
 DD B6 DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB
 EC ED EE EF F0 F1 F2 F3 F4 F5 B7 F6 F7 F8 F9 B8
 FA 85 86 87 88 89 8A 8B 8C 8D 9F 90 91 93 94 95
 96 97 98 9A 9B 9C 9D FB 9E 9F A0 A1 AD A2 A3 A4
 43 A6 44 A7 A8 A9 AA 49 4E 4F 50 51 AB AC 5B 5C
 AE AF B0 B1 69 B2 B3 FC B4 78 B5 79 7A FD FE FF
</map>
</collation>

<collation name="cp1256_bin"	flag="binary"/>

</charset>

</charsets>

charsets/latin7.xml000064400000016416150343472770010324 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="latin7">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 01 20 10 20 10 10 00 00 20 10 20 10 20 10 10 10
 20 10 10 10 10 10 10 10 20 00 20 10 20 10 10 20
 48 20 10 10 10 20 10 10 10 10 01 10 10 10 10 01
 10 10 10 10 10 10 10 10 10 10 02 10 10 10 10 02
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 AA BB BC BD BE AF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 201D 00A2 00A3 00A4 201E 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
00B0 00B1 00B2 00B3 201C 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 2019
</map>
</unicode>


<collation name="latin7_estonian_cs">
<map>
 00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B
 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
 2C 33 34 35 36 37 38 27 39 3A 3B 5D 3C 28 3D 3E
 76 7A 7C 7E 80 81 82 83 84 85 3F 40 5E 5F 60 41
 42 86 90 92 98 9A A4 A6 AA AC B2 B4 B8 BE C0 C6
 CE D0 D2 D6 E5 E8 EE F0 FA FC DD 43 44 45 46 47
 48 87 91 93 99 9B A5 A7 AB AD B3 B5 B9 BF C1 C7
 CF D1 D3 D7 E6 E9 EF F1 FB FD DE 49 4A 4B 4C 1C
 01 1D 57 1E 5A 74 71 72 1F 75 20 5B 21 4E 52 51
 22 55 56 58 59 73 2A 2B 23 E7 24 5C 25 4F 54 26
 2D FE 66 67 68 FF 4D 69 CC 6A D4 62 6B 29 6C 8E
 6D 61 7D 7F 50 6E 6F 70 CD 7B D5 63 77 78 79 8F
 8C B0 88 94 F4 8A A2 A0 96 9C DF 9E A8 B6 AE BA
 DB C2 C4 C8 CA F2 F6 64 EC BC D8 EA F8 E1 E3 DA
 8D B1 89 95 F5 8B A3 A1 97 9D E0 9F A9 B7 AF BB
 DC C3 C5 C9 CB F3 F7 65 ED BD D9 EB F9 E2 E4 53
</map>
</collation>


<collation name="latin7_general_cs">
<!-- Created for case-sensitive record search              -->
<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 30 32 33 34 35 36 37 2B 38 39 3A 5C 3B 2C 3C 3D
 76 7A 7C 7E 80 81 82 83 84 85 3E 3F 5D 5E 5F 40
 41 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
 D4 D6 D8 DC E3 E6 EE F0 F2 F4 F6 42 43 44 45 46
 47 87 93 95 9B 9D A7 A9 AD AF B5 B7 BB C1 C3 C9
 D5 D7 D9 DD E4 E7 EF F1 F3 F5 F7 48 49 4A 4B 20
 75 21 56 22 59 73 70 71 23 74 24 5A 25 4D 51 50
 26 54 55 57 58 72 2E 2F 27 E5 28 5B 29 4E 53 2A
 31 FE 65 66 67 FF 4C 68 D3 69 DA 61 6A 2D 6B 90
 6C 60 7D 7F 4F 6D 6E 6F D2 7B DB 62 77 78 79 91
 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
 E1 C4 C6 CA CE D0 CC 63 EC BC DE EA E8 FA FC E0
 8F B3 8B 97 89 8D A5 A3 99 9F F9 A1 AB B9 B1 BF
 E2 C5 C7 CB CF D1 CD 64 ED BD DF EB E9 FB FD 52
</map>
</collation>


<collation name="latin7_general_ci">
<!-- Created for case-insensitive record search -->
<!-- Created by Andis & Rihards                 -->
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 30 32 33 34 35 36 37 2B 38 39 3A 5C 3B 2C 3C 3D
 76 7A 7C 7E 80 81 82 83 84 85 3E 3F 5D 5E 5F 40
 41 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
 D4 D6 D8 DC E3 E6 EE F0 F2 F4 F6 42 43 44 45 46
 47 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
 D4 D6 D8 DC E2 E6 EE F0 F2 F4 F6 48 49 4A 4B 20
 75 21 56 22 59 73 70 71 23 74 24 5A 25 4D 51 50
 26 54 55 57 58 72 2E 2F 27 E5 28 5B 29 4E 53 2A
 31 FE 65 66 67 FF 4C 68 2D 69 DA 61 6A 2D 6B 90
 6C 60 7D 7F 4F 6D 6E 6F D3 7B DB 62 77 78 79 90
 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
 E1 C4 C6 CA CE D0 CC 63 EC BC DE EA E8 FA FC E0
 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
 E1 C4 C6 CA CE D0 CC 64 EC BC DE EA E8 FA FC 52
</map>
</collation>

<collation name="latin7_bin"	flag="binary"/>

</charset>

</charsets>
charsets/geostd8.xml000064400000012614150343472770010477 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="geostd8">

<ctype>
<map>
 00 
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 00 10 00 10 10 10 10 00 10 00 10 00 00 00 00
 00 10 10 10 10 10 10 10 00 00 00 10 00 00 00 00
 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
 03 03 03 03 03 03 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 0000 0000 0000
0000 2018 2019 201C 201D 2022 2013 2014 0000 0000 0000 203A 0000 0000 0000 0000
00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
10D0 10D1 10D2 10D3 10D4 10D5 10D6 10F1 10D7 10D8 10D9 10DA 10DB 10DC 10F2 10DD
10DE 10DF 10E0 10E1 10E2 10F3 10E3 10E4 10E5 10E6 10E7 10E8 10E9 10EA 10EB 10EC
10ED 10EE 10F4 10EF 10F0 10F5 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2116 0000 0000
</map>
</unicode>


<collation name="geostd8_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF 
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF 
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF 
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="geostd8_bin"	flag="binary"/>

</charset>

</charsets>
charsets/dec8.xml000064400000014601150343472770007743 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="dec8">

<ctype>
<map>
  00
  20  20  20  20  20  20  20  20  20  28  28  28  28  28  20  20
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  84  84  84  84  84  84  84  84  84  84  10  10  10  10  10  10
  10  81  81  81  81  81  81  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  01  01  01  01  10  10  10  10  10
  10  82  82  82  82  82  82  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  02  02  02  02  10  10  10  10  20
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  10  01  01  01  01  01  01  01  02
  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  10  02  02  02  02  02  02  02  02
</map>
</ctype>


<lower>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  5B  5C  5D  5E  5F
  60  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  D7  F8  F9  FA  FB  FC  FD  FE  DF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
</map>
</lower>


<upper>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
  60  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  F7  D8  D9  DA  DB  DC  DD  DE  FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 00A1 00A2 00A3 0000 00A5 0000 00A7 00A4 00A9 00AA 00AB 0000 0000 0000 0000
00B0 00B1 00B2 00B3 0000 00B5 00B6 00B7 0000 00B9 00BA 00BB 00BC 00BD 0000 00BF
00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
0000 00D1 00D2 00D3 00D4 00D5 00D6 0152 00D8 00D9 00DA 00DB 00DC 0178 0000 00DF
00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
0000 00F1 00F2 00F3 00F4 00F5 00F6 0153 00F8 00F9 00FA 00FB 00FC 00FF 0000 0000
</map>
</unicode>


<collation name="dec8_swedish_ci">
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
  60  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
  41  41  41  41  5C  5B  5C  43  45  45  45  45  49  49  49  49
  44  4E  4F  4F  4F  4F  5D  D7  D8  55  55  55  59  59  DE  DF
  41  41  41  41  5C  5B  5C  43  45  45  45  45  49  49  49  49
  44  4E  4F  4F  4F  4F  5D  F7  D8  55  55  55  59  59  DE  FF
</map>
</collation>

<collation name="dec8_bin" flag="binary"/>

</charset>


</charsets>
charsets/latin1.xml000064400000023130150343472770010305 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2005 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="latin1">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 10 00 10 02 10 10 10 10 10 10 01 10 01 00 01 00
 00 10 10 10 10 10 10 10 10 10 02 10 02 00 02 01
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 20AC 0081 201A 0192 201E 2026 2020 2021 02C6 2030 0160 2039 0152 008D 017D 008F
 0090 2018 2019 201C 201D 2022 2013 2014 02DC 2122 0161 203A 0153 009D 017E 0178
 00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
 00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
 00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
 00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
 00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
</map>
</unicode>


<collation name="latin1_swedish_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
 44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
 44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
</map>
</collation>


<collation name="latin1_german1_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 41 41 41 41 41 41 41 43 45 45 45 45 49 49 49 49
 D0 4E 4F 4F 4F 4F 4F D7 4F 55 55 55 55 59 DE 53
 41 41 41 41 41 41 41 43 45 45 45 45 49 49 49 49
 D0 4E 4F 4F 4F 4F 4F F7 4F 55 55 55 55 59 DE FF
</map>
</collation>


<collation name="latin1_danish_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 41 41 41 41 5B 5D 5B 43 45 45 45 45 49 49 49 49
 44 4E 4F 4F 4F 4F 5C D7 5C 55 55 55 59 59 DE DF
 41 41 41 41 5B 5D 5B 43 45 45 45 45 49 49 49 49
 44 4E 4F 4F 4F 4F 5C F7 5C 55 55 55 59 59 DE FF
</map>
</collation>


<collation name="latin1_german2_ci"/>


<collation name="latin1_bin" flag="binary"/>


<collation name="latin1_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
 8F 91 93 95 98 9A A4 A6 A8 AA AF B3 B4 B5 B6 B7
 B8 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
 8F 91 93 95 98 9A A4 A6 A8 AA AF B9 BA BB BC BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
 59 7F 83 85 87 89 8B BD 8D 9C 9E A0 A2 AC B1 97
 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
 59 7F 83 85 87 89 8B BE 8D 9C 9E A0 A2 AC B1 AE
</map>
</collation>


<collation name="latin1_general_cs">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
 8F 91 93 95 98 9A A4 A6 A8 AA AF B3 B4 B5 B6 B7
 B8 42 52 54 58 5C 66 68 6A 6C 76 78 7A 7C 7E 82
 90 92 94 96 99 9B A5 A7 A9 AB B0 B9 BA BB BC BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
 59 7F 83 85 87 89 8B BD 8D 9C 9E A0 A2 AC B1 97
 44 46 48 4A 4C 4E 50 56 5E 60 62 64 6E 70 72 74
 5A 80 84 86 88 8A 8C BE 8E 9D 9F A1 A3 AD B2 AE
</map>
</collation>


<collation name="latin1_spanish_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
 8F 91 93 95 98 9A A4 A6 A8 AA AF B3 B4 B5 B6 B7
 B8 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
 8F 91 93 95 98 9A A4 A6 A8 AA AF B9 BA BB BC BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
 41 41 41 41 41 41 41 53 5B 5B 5B 5B 6B 6B 6B 6B
 57 7F 81 81 81 81 81 BD 81 9A 9A 9A 9A AA B1 97
 41 41 41 41 41 41 41 53 5B 5B 5B 5B 6B 6B 6B 6B
 57 7F 81 81 81 81 81 BE 81 9A 9A 9A 9A AA B1 AA
</map>
</collation>

</charset>

</charsets>
charsets/armscii8.xml000064400000012626150343472770010644 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2004 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="armscii8">

<ctype>
<map>
 00 
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 01 02 01 02 01 02 01 02 01 02 01 02 01 02
 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
 01 02 01 02 01 02 01 02 01 02 01 02 01 02 10 10
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 AA AB AC AD AE AF
 B0 B1 B3 B3 B5 B5 B7 B7 B9 B9 BB BB BD BD BF BF
 C1 C1 C3 C3 C5 C5 C7 C7 C9 C9 CB CB CD CD CF CF
 D1 D1 D3 D3 D5 D5 D7 D7 D9 D9 DB DB DD DD DF DF
 E1 E1 E3 E3 E5 E5 E7 E7 E9 E9 EB EB ED ED EF EF
 F1 F1 F3 F3 F5 F5 F7 F7 F9 F9 FB FB FD FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B2 B4 B4 B6 B6 B8 B8 BA BA BC BC BE BE
 C0 C0 C2 C2 C4 C4 C6 C6 C8 C8 CA CA CC CC CE CE
 D0 D0 D2 D2 D4 D4 D6 D6 D8 D8 DA DA DC DC DE DE
 E0 E0 E2 E2 E4 E4 E6 E6 E8 E8 EA EA EC EC EE EE
 F0 F0 F2 F2 F4 F4 F6 F6 F8 F8 FA FA FC FC FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 2741 00A7 0589 0029 0028 00BB 00AB 2014 002E 055D 002C 002D 055F 2026 055C
055B 055E 0531 0561 0532 0562 0533 0563 0534 0564 0535 0565 0536 0566 0537 0567
0538 0568 0539 0569 053A 056A 053B 056B 053C 056C 053D 056D 053E 056E 053F 056F
0540 0570 0541 0571 0542 0572 0543 0573 0544 0574 0545 0575 0546 0576 0547 0577
0548 0578 0549 0579 054A 057A 054B 057B 054C 057C 054D 057D 054E 057E 054F 057F
0550 0580 0551 0581 0552 0582 0553 0583 0554 0584 0555 0585 0556 0586 2019 0027
</map>
</unicode>


<collation name="armscii8_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF 
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF 
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF 
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF 
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="armscii8_bin"	flag="binary"/>

</charset>

</charsets>
charsets/latin2.xml000064400000016106150343472770010313 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2005 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="latin2">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 48 01 10 01 10 01 01 10 10 01 01 01 01 10 01 01
 10 02 10 02 10 02 02 10 10 02 02 02 02 10 02 02
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 10 01 01 01 01 01 01 10 01 01 01 01 01 01 01 10
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 B1 A2 B3 A4 B5 B6 A7 A8 B9 BA BB BC AD BE BF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 A1 B2 A3 B4 A5 A6 B7 B8 A9 AA AB AC BD AE AF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 0104 02D8 0141 00A4 013D 015A 00A7 00A8 0160 015E 0164 0179 00AD 017D 017B
00B0 0105 02DB 0142 00B4 013E 015B 02C7 00B8 0161 015F 0165 017A 02DD 017E 017C
0154 00C1 00C2 0102 00C4 0139 0106 00C7 010C 00C9 0118 00CB 011A 00CD 00CE 010E
0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
</map>
</unicode>


<collation name="latin2_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 44 45 48 49 4B 4C 4D 4E 4F 50 51 53 54 56
 58 59 5A 5B 5E 5F 60 61 62 63 64 68 69 6A 6B 6C
 6D 41 44 45 48 49 4B 4C 4D 4E 4F 50 51 53 54 56
 58 59 5A 5B 5E 5F 60 61 62 63 64 6E 6F 70 71 FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF 42 FF 52 FF 51 5C FF FF 5D 5B 5E 65 FF 67 66
 FF 42 FF 52 FF 51 5C FF FF 5D 5B 5E 65 FF 67 66
 5A 43 43 43 43 51 46 45 47 49 4A 49 49 4E 4E 48
 FF 55 54 57 56 56 56 FF 5A 5F 5F 5F 5F 63 5E FF
 5A 43 43 43 43 51 46 45 47 49 4A 49 49 4E 4E 48
 FF 55 54 57 56 56 56 FF 5A 5F 5F 5F 5F 63 5E FF
</map>
</collation>


<collation name="latin2_croatian_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 43 44 48 4B 4D 4E 4F 50 52 53 54 56 57 59
5B 5C 5D 5F 62 64 66 67 68 69 6B C6 C7 C8 C9 CA
CB 41 43 44 48 4B 4D 4E 4F 50 52 53 54 56 57 59
5B 5C 5D 5F 62 64 66 67 68 69 6B CC CD CE CF D0
D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0
E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0
F1 41 F2 54 F3 54 5F F4 F5 61 5F 62 6B F6 8E 6B
F7 41 F8 54 F9 54 5F FA FB 61 5F 62 6B FC 8E 6B
5D 41 41 41 41 54 47 44 46 4B 4B 4B 4B 50 50 48
4A 57 57 59 59 59 59 FD 5D 64 64 64 64 69 62 5F
5D 41 41 41 41 54 47 44 46 4B 4B 4B 4B 50 50 48
4A 57 57 59 59 59 59 FE 5D 64 64 64 64 69 62 FF
</map>
</collation>


<collation name="latin2_czech_ci"/>


<collation name="latin2_hungarian_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 47 48 4C 4E 53 54 55 56 5A 5B 5C 60 61 64
 69 6A 6B 6E 72 75 7A 7B 7C 7D 7F 83 84 85 86 87
 88 41 47 48 4C 4E 53 54 55 56 5A 5B 5C 60 61 64
 69 6A 6B 6E 72 75 7A 7B 7C 7D 7F 89 8A 8B 8C 00
 01 78 4E 04 05 06 07 08 09 0A 67 67 56 56 0F 41
 4E 12 13 67 67 64 78 75 78 67 78 1C 1D 1E 1F FF
 41 56 64 75 5E 6F FF 67 FF 70 71 73 80 FF 81 82
 FF 42 FF 5D FF 41 6F FF FF 70 71 73 80 FF 81 82
 6C 41 44 45 46 5F 49 4B 4A 4E 51 52 50 56 57 4D
 FF 62 63 64 66 67 67 FF 6D 77 75 78 78 7E 74 FF
 64 41 44 45 46 5F 49 4B 4A 4E 51 78 50 56 58 4D
 FF 62 63 64 66 67 67 FF 6D 77 75 78 78 7E 74 FF
</map>
</collation>

<collation name="latin2_bin" flag="binary"/>

</charset>

</charsets>
charsets/keybcs2.xml000064400000012631150343472770010463 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="keybcs2">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 01 02 82 02 02 01 01 02 82 81 01 01 02 02 01 01
 81 02 01 02 02 01 02 01 02 01 01 01 01 01 01 02
 02 02 02 02 02 01 01 01 02 02 02 01 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02 02 01 02 01 02 00 02 01 01 01 02 00 02 02 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 87 81 82 83 84 83 86 87 88 88 8D A1 8C 8D 84 A0
 82 91 91 93 94 A2 96 A3 98 94 81 9B 8C 98 A9 9F
 A0 A1 A2 A3 A4 A4 96 93 9B A9 AA AA AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 ED E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 68 59 5A 7B 7C 7D 7E 7F
 87 9A 90 85 8E 85 86 80 89 89 8A 8B 9C 8A 8E 8F
 90 92 92 A7 99 95 A6 97 9D 99 9A A8 9C 9D 9E 9F
 8F 8B 95 97 A5 A5 A6 A7 A8 9E AB AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC E8 EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 010C 00FC 00E9 010F 00E4 010E 0164 010D 011B 011A 0139 00CD 013E 013A 00C4 00C1
 00C9 017E 017D 00F4 00F6 00D3 016F 00DA 00FD 00D6 00DC 0160 013D 00DD 0158 0165
 00E1 00ED 00F3 00FA 0148 0147 016E 00D4 0161 0159 0155 0154 00BC 00A1 00AB 00BB
 2591 2592 2593 2502 2524 2561 2562 2556 2555 2563 2551 2557 255D 255C 255B 2510
 2514 2534 252C 251C 2500 253C 255E 255F 255A 2554 2569 2566 2560 2550 256C 2567
 2568 2564 2565 2559 2558 2552 2553 256B 256A 2518 250C 2588 2584 258C 2590 2580
 03B1 00DF 0393 03C0 03A3 03C3 00B5 03C4 03A6 0398 03A9 03B4 221E 03C6 03B5 2229
 2261 00B1 2265 2264 2320 2321 00F7 2248 00B0 2219 00B7 221A 207F 00B2 25A0 00A0
</map>
</unicode>


<collation name="keybcs2_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 44 45 47 49 50 51 52 53 54 55 56 57 58 5A
 5E 5F 60 63 66 68 6C 6D 6E 6F 72 90 91 92 93 94
 95 41 44 45 47 49 50 51 52 53 54 55 56 57 58 5A
 5E 5F 60 63 66 68 6C 6D 6E 6F 72 96 97 98 99 9A
 45 68 49 47 41 47 66 45 49 49 56 53 56 56 41 41
 49 72 72 5A 5A 5A 68 68 6F 5A 68 63 56 6F 60 66
 41 53 5A 68 58 58 68 5A 63 60 60 60 A0 A1 A2 A3
 A4 A5 A6 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC
 BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC
 CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC
 80 65 83 87 88 89 DD 8A 85 8B 84 81 DE 85 82 DF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="keybcs2_bin"	flag="binary"/>

</charset>

</charsets>

charsets/README000064400000003325150343472770007257 0ustar00This directory holds configuration files that enable MySQL to work with
different character sets.  It contains:

charset_name.xml
    Each charset_name.xml file contains information for a simple character
    set.  The information in the file describes character types,
    lower- and upper-case equivalencies and sorting orders for the
    character values in the set.

Index.xml
    The Index.xml file lists all of the available charset configurations,
    including collations.

    Each collation must have a unique number.  The number is stored
    IN THE DATABASE TABLE FILES and must not be changed.

    The max-id attribute of the <charsets> element must be set to
    the largest collation number.

Compiled in or configuration file?
    When should a character set be compiled in to MySQL's string library
    (libmystrings), and when should it be placed in a charset_name.xml
    configuration file?

    If the character set requires the strcoll functions or is a
    multi-byte character set, it MUST be compiled in to the string
    library.  If it does not require these functions, it should be
    placed in a charset_name.xml configuration file.

    If the character set uses any one of the strcoll functions, it
    must define all of them.  Likewise, if the set uses one of the
    multi-byte functions, it must define them all.  See the manual for
    more information on how to add a complex character set to MySQL.

Syntax of configuration files
    The syntax is very simple.  Words in <map> array elements are
    separated by arbitrary amounts of whitespace. Each word must be a
    number in hexadecimal format.  The ctype array has 257 words; the
    other arrays (lower, upper, etc.) take up 256 words each after that.
charsets/cp866.xml000064400000012755150343472770007776 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="cp866">
<!-- cp866_DOSCyrillicRussian            -->

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 01 02 01 02 01 02 01 02 00 00 00 00 00 00 00 48
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 A0 A1 A2 A3 A4 A5 86 87 88 89 AA AB AC AD AE AF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 A0 A1 A2 A3 A4 A5 86 87 88 89 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F1 F1 F3 F3 F5 F5 F7 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 F0 F0 F2 F2 F4 F4 F6 F6 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
 2591 2592 2593 2502 2524 2561 2562 2556 2555 2563 2551 2557 255D 255C 255B 2510
 2514 2534 252C 251C 2500 253C 255E 255F 255A 2554 2569 2566 2560 2550 256C 2567
 2568 2564 2565 2559 2558 2552 2553 256B 256A 2518 250C 2588 2584 258C 2590 2580
 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
 0401 0451 0404 0454 0407 0457 040E 045E 00B0 2219 00B7 221A 207F 00B2 25A0 00A0
</map>
</unicode>


<collation name="cp866_general_ci">
<!--  Case insensitive, accent sensitive -->
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
 5F 61 63 65 67 69 6B 6D 6F 71 73 BD BE BF C0 C1
 C2 41 43 45 47 49 4B 4D 4F 51 54 55 57 59 5B 5D
 5F 61 63 65 67 69 6B 6D 6F 71 73 C3 C4 C5 C6 C7
 75 77 79 7B 7D 7F 85 87 89 8D 8F 91 93 95 97 99
 9B 9D 9F A1 A5 A7 A9 AB AD AF B1 B3 B5 B7 B9 BB
 75 77 79 7B 7D 7F 85 87 89 8D 8F 91 93 95 97 99
 C8 C9 CA D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
 9B 9D 9F A1 A5 A7 A9 AB AD AF B1 B3 B5 B7 B9 BB
 81 81 83 83 8B 8B A3 A3 CB CC CD CE CF D0 D1 D2
</map>
</collation>

<collation name="cp866_bin"	flag="binary"/>

</charset>

</charsets>

charsets/hebrew.xml000064400000012615150343472770010377 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2006 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="hebrew">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 00 00 20 20 00
 </map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 0000 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00D7 00AB 00AC 00AD 00AE 203E
00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00F7 00BB 00BC 00BD 00BE 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2017
05D0 05D1 05D2 05D3 05D4 05D5 05D6 05D7 05D8 05D9 05DA 05DB 05DC 05DD 05DE 05DF
05E0 05E1 05E2 05E3 05E4 05E5 05E6 05E7 05E8 05E9 05EA 0000 0000 200E 200F 0000
</map>
</unicode>


<collation name="hebrew_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="hebrew_bin"	flag="binary"/>

</charset>

</charsets>

charsets/cp1257.xml000064400000021306150343472770010041 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="cp1257">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 01
 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 02
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 00
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 BA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE AF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
 0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
 00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
 0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
 0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
 0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
 0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
</map>
</unicode>


<collation name="cp1257_lithuanian_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 43 44 46 47 4A 4B 4C 4D 50 51 52 53 54 55
 56 57 58 59 5B 5C 5F 60 61 4E FF 62 63 64 65 66
 67 41 43 44 46 47 4A 4B 4C 4D 50 51 52 53 54 55
 56 57 58 59 5B 5C 5F 60 61 4E FF 68 69 6A 6B FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 42 4F FF FF FF FF 48 FF 45 FF FF 49 FF FF FF FF
 5A FF FF FF FF FF FF FF 5E FF FF 5D FF FF FF FF
 FF 4F FF FF FF FF 48 FF 45 FF FF 49 FF FF FF FF
 5A FF FF FF FF FF FF FF 5E FF FF 5D FF FF FF FF
</map>
</collation>


<collation name="cp1257_bin" flag="binary"/>


<collation name="cp1257_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
 BD 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
 8F 91 93 97 9E A0 A8 AA AC AE B0 BE BF C0 C1 C4
 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4
 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4
 E5 E6 E7 E8 E9 EA EB EC 83 ED 93 EE EF F0 F1 41
 F2 F3 F4 F5 F6 F7 F8 F9 83 FA 93 FB FC FD FE 41
 41 69 41 4F 41 41 57 57 4F 57 B0 57 63 71 69 75
 97 7D 7D 83 83 83 83 C2 A0 75 97 A0 A0 B0 B0 97
 41 69 41 4F 41 41 57 57 4F 57 B0 57 63 71 69 75
 97 7D 7D 83 83 83 83 C3 A0 75 97 A0 A0 B0 B0 FF
</map>
</collation>


<collation name="cp1257_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
 BD 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
 8F 91 93 97 9E A0 A8 AA AC AE B0 BE BF C0 C1 C4
 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4
 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4
 E5 E6 E7 E8 E9 EA EB EC 85 ED 95 EE EF F0 F1 4B
 F2 F3 F4 F5 F6 F7 F8 F9 85 FA 95 FB FC FD FE 4B
 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
 99 7F 81 87 89 8B 8D C2 A2 79 9B A4 A6 B4 B6 9D
 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
 99 7F 81 87 89 8B 8D C3 A2 79 9B A4 A6 B4 B6 FF
</map>
</collation>


<collation name="cp1257_cs">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
 BD 42 4E 50 56 58 62 64 68 6A 70 72 76 7C 7E 84
 90 92 94 98 9F A1 A9 AB AD AF B1 BE BF C0 C1 C4
 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4
 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4
 E5 E6 E7 E8 E9 EA EB EC 85 ED 95 EE EF F0 F1 4B
 F2 F3 F4 F5 F6 F7 F8 F9 86 FA 96 FB FC FD FE 4C
 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
 99 7F 81 87 89 8B 8D C2 A2 79 9B A4 A6 B4 B6 9D
 44 6C 46 52 48 4A 5A 5C 54 5E B3 60 66 74 6E 78
 9A 80 82 88 8A 8C 8E C3 A3 7A 9C A5 A7 B5 B7 FF
</map>
</collation>


<collation name="cp1257ltlv">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 47 49 4D 4F 57 59 5D 5F 65 67 6B 6F 71 75
 79 7B 7D 81 85 87 8D 8F 91 93 95 FF FF FF FF FF
 FF 42 48 4A 4E 50 58 5A 5E 60 66 68 6C 70 72 76
 7A 7C 7E 82 86 88 8E 90 92 94 96 FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF 7F FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF 80 FF FF FF FF FF
 45 63 43 FF FF FF 53 51 4B FF FF 55 5B 69 61 6D
 83 FF 73 FF 77 FF FF FF 8B FF FF 89 FF 99 97 FF
 46 64 44 FF FF FF 54 52 4C FF FF 56 5C 6A 62 6E
 84 FF 74 FF 78 FF FF FF 8C FF FF 8A FF 9A 98 FF
</map>
</collation>

</charset>

</charsets>
charsets/cp1251.xml000064400000020255150343472770010035 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.

  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
</copyright>

<charset name="cp1251">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 01 01 00 02 00 00 00 00 00 00 01 00 01 01 01 01
 02 00 00 00 00 00 00 00 00 00 02 00 02 02 02 02
 00 01 02 01 00 01 00 00 01 00 01 00 00 00 00 01
 00 00 01 02 02 00 00 00 02 00 02 00 02 01 02 02
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 90 83 82 83 84 85 86 87 88 89 9A 8B 9C 9D 9E 9F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A2 A2 BC A4 B4 A6 A7 B8 A9 BA AB AC AD AE BF
 B0 B1 B3 B3 B4 B5 B6 B7 B8 B9 BA BB BC BE BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 81 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 80 91 92 93 94 95 96 97 98 99 8A 9B 8C 9D 8E 8F
 A0 A1 A1 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B2 A5 B5 B6 B7 A8 B9 AA BB A3 BD BD AF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 0402 0403 201A 0453 201E 2026 2020 2021 20AC 2030 0409 2039 040A 040C 040B 040F
 0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
 00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
 00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F

</map>
</unicode>


<collation name="cp1251_bulgarian_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7C 7D 7E 7F 80
 81 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 82 83 84 85 FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF 61 FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF 61 FF FF FF FF FF FF FF
 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
</map>
</collation>


<collation name="cp1251_bin" flag="binary"/>


<collation name="cp1251_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
 5F 61 63 65 67 69 6B 6D 6F 71 73 D3 D4 D5 D6 D7
 D8 41 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
 5F 61 63 65 67 69 6B 6D 6F 71 73 D9 DA DB DC DD
 81 83 DE 83 DF E0 E1 E2 E3 E4 A1 E5 A7 9D B3 C1
 81 E6 E7 E8 E9 EA EB EC ED EE A1 EF A7 9D B3 C1
 F0 B7 B7 99 F1 7D F2 F3 87 F4 89 F5 F6 F7 F8 95
 F9 FA 93 93 7D FB FC FD 87 FE 89 FF 99 8F 8F 95
 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
 AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
 AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
</map>
</collation>


<collation name="cp1251_general_cs">
<!--
# Case insensitive, accent sensitive
# Sort order is correct for Belarusian, Bulgarian, Macedonian,
# Russian, Serbian, Mongolian languages. Almost good for Ukrainian, 
# except that "CYRILLIC LETTER SOFT SIGN" is not in the end of alphabet,
# but between YERU and E.
-->
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
 5F 61 63 65 67 69 6B 6D 6F 71 73 D3 D4 D5 D6 D7
 D8 42 44 46 48 4A 4C 4E 50 52 54 56 58 5A 5C 5E
 60 62 64 66 68 6A 6C 6E 70 72 74 D9 DA DB DC DD
 81 83 DE 84 DF E0 E1 E2 E3 E4 A1 E5 A7 9D B3 C1
 82 E6 E7 E8 E9 EA EB EC ED EE A2 EF A8 9E B4 C2
 F0 B7 B8 99 F1 7D F2 F3 87 F4 89 F5 F6 F7 F8 95
 F9 FA 93 94 7E FB FC FD 88 FE 8A FF 9A 8F 90 96
 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
 AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
 76 78 7A 7C 80 86 8C 8E 92 98 9C A0 A4 A6 AA AC
 AE B0 B2 B6 BA BC BE C0 C4 C6 C8 CA CC CE D0 D2
</map>
</collation>


<collation name="cp1251_ukrainian_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 20 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4
 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4
 C5 C6 C7 C8 C9 84 CA CB 88 CC 87 CD CE CF D0 8D
 D1 D2 8C 8C 84 D3 D4 D5 88 D6 87 D7 D8 D9 DA 8D
 80 81 82 83 85 86 89 8A 8B 8E 8F 90 91 92 93 94
 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4
 80 81 82 83 85 86 89 8A 8B 8E 8F 90 91 92 93 94
 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4
</map>
</collation>


</charset>

</charsets>
charsets/latin5.xml000064400000012613150343472770010315 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2005 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="latin5">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 FD 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC 69 FE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 DD 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC 49 DE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
011E 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 0130 015E 00DF
00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
011F 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 0131 015F 00FF
</map>
</unicode>


<collation name="latin5_turkish_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 45 46 47 48 4A 4B 4D 4E 4F 50 51 52
 54 55 56 57 59 5A 5C 5D 5E 5F 60 61 62 63 64 65
 66 41 42 43 45 46 47 48 4A 4C 4D 4E 4F 50 51 52
 54 55 56 57 59 5A 5C 5D 5E 5F 60 87 88 89 8A 8B
 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B
 9C 9D 9E 9F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB
 AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB
 BC BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB
 41 41 41 41 41 41 41 44 46 46 46 46 4C 4C 4C 4C
 49 51 52 52 52 52 53 E0 52 5A 5A 5A 5B 4C 58 57
 41 41 41 41 41 41 41 44 46 46 46 46 4C 4C 4C 4C
 49 51 52 52 52 52 53 FA 52 5A 5A 5A 5B 4B 58 5F
</map>
</collation>

<collation name="latin5_bin"	flag="binary"/>

</charset>

</charsets>
charsets/macroman.xml000064400000017572150343472770010727 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="macroman">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 10
 20 01 01 01 01 01 01 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 01
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02
 00 00 00 00 02 00 00 00 00 00 00 20 01 01 00 00
 00 00 00 00 00 00 00 00 02 01 00 00 00 00 00 00
 00 00 00 00 00 20 01 01 01 01 01 01 01 01 01 01
 00 01 01 01 01 02 00 00 00 00 00 00 00 00 00 00
</map>
</ctype>

<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 8A 8C 8D 8E 96 9A 9F 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD BE BF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA 88 8B 9B CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D8 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 89 90 87 91 8F 92 94 95 93 97 99
 F0 98 9C 9E 9D F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>

<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 E7 CB E5 80 CC 81 82 83 E9
 E6 E8 EA ED EB EC 84 EE F1 EF 85 CD F2 F4 F3 86
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD AE AF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D9 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 00C4 00C5 00C7 00C9 00D1 00D6 00DC 00E1 00E0 00E2 00E4 00E3 00E5 00E7 00E9 00E8
 00EA 00EB 00ED 00EC 00EE 00EF 00F1 00F3 00F2 00F4 00F6 00F5 00FA 00F9 00FB 00FC
 2020 00B0 00A2 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 00B4 00A8 2260 00C6 00D8
 221E 00B1 2264 2265 00A5 00B5 2202 2211 220F 03C0 222B 00AA 00BA 03A9 00E6 00F8
 00BF 00A1 00AC 221A 0192 2248 2206 00AB 00BB 2026 00A0 00C0 00C3 00D5 0152 0153
 2013 2014 201C 201D 2018 2019 00F7 25CA 00FF 0178 2044 20AC 2039 203A FB01 FB02
 2021 00B7 201A 201E 2030 00C2 00CA 00C1 00CB 00C8 00CD 00CE 00CF 00CC 00D3 00D4
 F8FF 00D2 00DA 00DB 00D9 0131 02C6 02DC 00AF 02D8 02D9 02DA 00B8 02DD 02DB 02C7
</map>
</unicode>

<collation name="macroman_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 49 50 52 53 57 59 60 61 67 68 69 70 71 72
 79 80 81 82 84 85 90 91 92 93 95 A0 A1 A2 A3 A4
 A5 41 49 50 52 53 57 59 60 61 67 68 69 70 71 72
 79 80 81 82 84 85 90 91 92 93 95 A6 A7 A8 A9 AA
 41 41 50 53 71 72 85 41 41 41 41 41 41 50 53 53
 53 53 61 61 61 61 71 72 72 72 72 72 85 85 85 85
 AB AC AD AE AF B0 B1 82 B2 B3 B4 B5 B6 B7 48 72
 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4 C5 48 72
 C6 C7 C8 C9 57 CA CB CC CD CE CF 41 41 72 D0 D1
 D2 D3 D4 D5 D6 D7 D8 D9 93 93 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 41 53 41 53 53 61 61 61 61 72 72
 F0 72 85 85 85 61 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="macroman_bin" flag="binary"/>

<collation name="macroman_ci_ai">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
 B7 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
 91 93 95 97 9A 9C A6 A8 AA AC B0 B8 B9 BA BB BC
 41 41 53 59 7D 81 9C 41 41 41 41 41 41 53 59 59
 59 59 6A 6A 6A 6A 7D 81 81 81 81 81 9C 9C 9C 9C
 BD BE BF C0 C1 C2 C3 97 C4 C5 C6 C7 C8 C9 41 81
 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 41 81
 D8 D9 DA DB 63 DC DD DE DF E0 E1 41 41 81 81 81
 E2 E3 E4 E5 E6 E7 E8 E9 AC AC EA EB EC ED EE EF
 F0 F1 F2 F3 F4 41 59 41 59 59 6A 6A 6A 6A 81 81
 F0 81 9C 9C 9C 6A F6 F7 F8 F9 FA FB FC FD FE FF

</map>
</collation>

<collation name="macroman_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
 B7 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
 91 93 95 97 9A 9C A6 A8 AA AC B0 B8 B9 BA BB BC
 4B 4D 55 5D 7F 8B A4 45 43 47 4B 49 4D 55 5D 5B
 5F 61 6E 6C 70 72 7F 85 83 87 8B 89 A0 9E A2 A4
 BD BE BF C0 C1 C2 C3 99 C4 C5 C6 C7 C8 C9 4F 8D
 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 4F 8D
 D8 D9 DA DB 65 DC DD DE DF E0 E1 43 49 89 8F 8F
 E2 E3 E4 E5 E6 E7 E8 E9 AE AE EA EB EC ED EE EF
 F0 F1 F2 F3 F4 47 5F 45 61 5B 6E 70 70 6C 85 87
 F0 83 A0 A2 9E 72 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

<collation name="macroman_cs">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
 B7 42 52 54 58 5A 64 67 69 6B 76 78 7A 7C 7E 82
 92 94 96 98 9B 9D A7 A9 AB AD B1 B8 B9 BA BB BC
 4B 4D 55 5D 7F 8B A4 46 44 48 4C 4A 4E 56 5E 5C
 60 62 6F 6D 71 73 80 86 84 88 8C 8A A1 9F A3 A5
 BD BE BF C0 C1 C2 C3 99 C4 C5 C6 C7 C8 C9 4F 8D
 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 50 8E
 D8 D9 DA DB 65 DC DD DE DF E0 E1 43 49 89 8F 90
 E2 E3 E4 E5 E6 E7 E8 E9 AF AE EA EB EC ED EE EF
 F0 F1 F2 F3 F4 47 5F 45 61 5B 6E 70 72 6C 85 87
 F0 83 A0 A2 9E 74 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</collation>

</charset>

</charsets>
charsets/cp850.xml000064400000012602150343472770007756 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="cp850">

<ctype>
<map>
 00
 20 30 30 30 30 30 30 20 20 28 28 28 28 28 30 30
 30 30 30 30 30 30 30 30 30 30 20 30 30 30 30 30
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 30
 01 02 02 02 02 02 02 02 02 02 02 02 02 02 01 01
 01 02 01 02 02 02 02 02 02 01 01 02 10 01 10 10
 02 02 02 02 02 01 10 10 10 10 10 10 10 10 10 10
 10 10 10 10 10 01 01 01 10 10 10 10 10 10 10 10
 10 10 10 10 10 10 02 01 10 10 10 10 10 10 10 10
 02 01 01 01 01 02 01 01 01 10 10 10 10 10 01 10
 01 02 01 01 02 01 10 02 01 01 01 01 02 01 10 10
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 87 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 84 86
 82 91 91 93 94 95 96 97 98 94 81 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A4 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 9A 90 41 8E 41 8F 80 45 45 45 49 49 49 8E 8F
 90 92 92 4F 99 4F 55 55 59 99 9A 9B 9C 9D 9E 9F
 41 49 4F 55 A5 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001a 001b 001c 001d 001e 001f
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002a 002b 002c 002d 002e 002f
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003a 003b 003c 003d 003e 003f
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004a 004b 004c 004d 004e 004f
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005a 005b 005c 005d 005e 005f
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006a 006b 006c 006d 006e 006f
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007a 007b 007c 007d 007e 007f
00c7 00fc 00e9 00e2 00e4 00e0 00e5 00e7 00ea 00eb 00e8 00ef 00ee 00ec 00c4 00c5
00c9 00e6 00c6 00f4 00f6 00f2 00fb 00f9 00ff 00d6 00dc 00f8 00a3 00d8 00d7 0192
00e1 00ed 00f3 00fa 00f1 00d1 00aa 00ba 00bf 00ae 00ac 00bd 00bc 00a1 00ab 00bb
2591 2592 2593 2502 2524 00c1 00c2 00c0 00a9 2563 2551 2557 255d 00a2 00a5 2510
2514 2534 252c 251c 2500 253c 00e3 00c3 255a 2554 2569 2566 2560 2550 256c 00a4
00f0 00d0 00ca 00cb 00c8 0131 00cd 00ce 00cf 2518 250c 2588 2584 00a6 00cc 2580
00d3 00df 00d4 00d2 00f5 00d5 00b5 00fe 00de 00da 00db 00d9 00fd 00dd 00af 00b4
00ad 00b1 2017 00be 00b6 00a7 00f7 00b8 00b0 00a8 00b7 00b9 00b3 00b2 25a0 00a0
</map>
</unicode>


<collation name="cp850_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 51 53 55 59 63 65 67 69 74 76 78 7A 7C 80
 8E 90 92 94 97 99 A3 A5 A7 A9 AE B1 B2 B3 B4 B5
 B6 41 51 53 55 59 63 65 67 69 74 76 78 7A 7C 80
 8E 90 92 94 97 99 A3 A5 A7 A9 AE B7 B8 B9 BA BB
 54 A1 5D 47 4B 43 4D 54 5F 61 5B 71 6F 6B 4B 4D
 5D 4F 4F 86 8A 82 9F 9B AD 8A A1 8C E3 8C BD BE
 45 6D 84 9D 7E 7E EA FA FF EE EC FD FC CE EB FB
 DC DD DE C3 C9 45 47 43 E9 D5 CF D1 D3 E2 E5 C5
 C6 CB CA C8 C2 CC 49 49 D2 D0 D7 D6 D4 CD D8 E4
 57 57 5F 61 5B 73 6D 6F 71 C7 C4 DB DA E6 6B D9
 84 96 86 82 88 88 F5 B0 B0 9D 9F 9B AB AB EF F4
 ED F1 C1 FE F6 E7 BF BC F0 E8 F7 F9 F3 F2 DF E0
</map>
</collation>

<collation name="cp850_bin"	flag="binary"/>

</charset>

</charsets>
charsets/cp1250.xml000064400000020061150343472770010027 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (c) 2003, 2005 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="cp1250">

<ctype>
<map>
  00
  20  20  20  20  20  20  20  20  20  28  28  28  28  28  20  20
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  84  84  84  84  84  84  84  84  84  84  10  10  10  10  10  10
  10  81  81  81  81  81  81  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  01  01  01  01  10  10  10  10  10
  10  82  82  82  82  82  82  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  02  02  02  02  10  10  10  10  20
  20  20  10  20  10  10  10  10  20  10  01  10  01  01  01  01
  20  10  10  10  10  10  10  10  20  10  02  10  02  02  02  02
  48  10  10  01  10  01  10  01  10  10  01  10  10  10  10  01
  10  10  10  02  10  10  10  10  10  02  02  10  01  10  02  02
  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  10  01  01  01  01  01  01  01  02
  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  10  02  02  02  02  02  02  02  10
</map>
</ctype>


<lower>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  5B  5C  5D  5E  5F
  60  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  9A  8B  9C  9D  9E  9F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  B3  A4  B9  A6  A7  A8  A9  BA  AB  AC  AD  AE  BF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BE  BD  BE  BF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  D7  F8  F9  FA  FB  FC  FD  FE  DF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
</map>
</lower>


<upper>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
  60  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  8A  9B  8C  8D  8E  8F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  A3  B4  B5  B6  B7  B8  A5  AA  BB  BC  BD  BC  AF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  F7  D8  D9  DA  DB  DC  DD  DE  FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0160 2039 015A 0164 017D 0179
0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0161 203A 015B 0165 017E 017A
00A0 02C7 02D8 0141 00A4 0104 00A6 00A7 00A8 00A9 015E 00AB 00AC 00AD 00AE 017B
00B0 00B1 02DB 0142 00B4 00B5 00B6 00B7 00B8 0105 015F 00BB 013D 02DD 013E 017C
0154 00C1 00C2 0102 00C4 0139 0106 00C7 010C 00C9 0118 00CB 011A 00CD 00CE 010E
0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
</map>
</unicode>


<collation name="cp1250_general_ci">
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  46  49  4A  4B  4C  4D  4E  4F  50  52  53  55
  56  57  58  59  5B  5C  5D  5E  5F  60  61  63  64  65  66  67
  68  41  42  43  46  49  4A  4B  4C  4D  4E  4F  50  52  53  55
  56  57  58  59  5B  5C  5D  5E  5F  60  61  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  5A  8B  5A  5B  62  62
  90  91  92  93  94  95  96  97  98  99  5A  9B  5A  5B  62  62
  20  A1  A2  50  A4  41  A6  59  A8  A9  59  AB  AC  AD  AE  62
  B0  B1  B2  50  B4  B5  B6  B7  B8  41  59  BB  50  BD  50  62
  58  41  41  41  41  50  45  43  44  49  49  49  49  4D  4D  46
  47  53  53  55  55  55  55  D7  58  5C  5C  5C  5C  60  5B  59
  58  41  41  41  41  50  45  43  44  49  49  49  49  4D  4D  46
  47  53  53  55  55  55  55  F7  58  5C  5C  5C  5C  60  5B  FF
</map>
</collation>

<collation name="cp1250_croatian_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 43 44 48 4B 4D 4E 4F 50 52 53 54 56 57 59
5B 5C 5D 5F 62 64 66 67 68 69 6B 90 91 92 93 94
95 41 43 44 48 4B 4D 4E 4F 50 52 53 54 56 57 59
5B 5C 5D 5F 62 64 66 67 68 69 6B 96 97 98 99 9A
9B 9C 9E 9F A0 A1 A2 A3 A4 A5 60 A6 5F 62 6C 6B
A7 A8 A9 AA AB AC AD AE AF B0 60 B1 5F 62 6C 6B
B2 B3 B4 54 B5 41 B6 B7 B8 B9 5F BA BB BC BD 6B
BE BF C0 54 C1 C2 C3 C4 C5 41 5F C6 54 C7 54 6B
5D 41 41 41 41 54 47 44 46 4B 4B 4B 4B 50 50 48
4A 57 57 59 59 59 59 C8 5D 64 64 64 64 69 62 5F
5D 41 41 41 41 54 47 44 46 4B 4B 4B 4B 50 50 48
4A 57 57 59 59 59 59 C9 5D 64 64 64 64 69 62 FF
</map>
</collation>

<collation name="cp1250_polish_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 43 44 48 4B 4D 4E 4F 50 52 53 54 56 57 59
5B 5C 5D 5F 62 64 66 67 68 69 6B 90 91 92 93 94
95 41 43 44 48 4B 4D 4E 4F 50 52 53 54 56 57 59
5B 5C 5D 5F 62 64 66 67 68 69 6B 96 97 98 99 9A
9B 9C 9E 9F A0 A1 A2 A3 A4 A5 5F A6 60 62 6B 6C
A7 A8 A9 AA AB AC AD AE AF B0 5F B1 60 62 6B 6C
B2 B3 B4 55 B5 42 B6 B7 B8 B9 5F BA BB BC BD 6D
BE BF C0 55 C1 C2 C3 C4 C5 42 5F C6 54 C7 54 6D
5D 41 41 41 41 54 47 44 44 4B 4C 4B 4B 50 50 48
48 58 57 5A 59 59 59 C8 5D 64 64 64 64 69 62 5F
5D 41 41 41 41 54 47 44 44 4B 4C 4B 4B 50 50 48
48 58 57 5A 59 59 59 C9 5D 64 64 64 64 69 62 FF
</map>
</collation>

<collation name="cp1250_czech_ci"/>

<collation name="cp1250_bin"	flag="binary"/>

</charset>

</charsets>
charsets/koi8r.xml000064400000012606150343472770010157 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="koi8r">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 02 10 10 10 10 10 10 10 10 10 10 10 10
 10 10 10 01 10 10 10 10 10 10 10 10 10 10 10 10
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 A3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 B3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001a 001b 001c 001d 001e 001f
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002a 002b 002c 002d 002e 002f
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003a 003b 003c 003d 003e 003f
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004a 004b 004c 004d 004e 004f
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005a 005b 005c 005d 005e 005f
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006a 006b 006c 006d 006e 006f
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007a 007b 007c 007d 007e 007f
2500 2502 250c 2510 2514 2518 251c 2524 252c 2534 253c 2580 2584 2588 258c 2590
2591 2592 2593 2320 25a0 2219 221a 2248 2264 2265 00a0 2321 00b0 00b2 00b7 00f7
2550 2551 2552 0451 2553 2554 2555 2556 2557 2558 2559 255a 255b 255c 255d 255e
255f 2560 2561 0401 2562 2563 2564 2565 2566 2567 2568 2569 256a 256b 256c 00a9 
044e 0430 0431 0446 0434 0435 0444 0433 0445 0438 0439 043a 043b 043c 043d 043e 
043f 044f 0440 0441 0442 0443 0436 0432 044c 044b 0437 0448 044d 0449 0447 044a 
042e 0410 0411 0426 0414 0415 0424 0413 0425 0418 0419 041a 041b 041c 041d 041e 
041f 042f 0420 0421 0422 0423 0416 0412 042c 042b 0417 0428 042d 0429 0427 042a
</map>
</unicode>


<collation name="koi8r_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 E5 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE
 AF B0 B1 E5 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD
 FE DF E0 F6 E3 E4 F4 E2 F5 E8 E9 EA EB EC ED EE
 EF FF F0 F1 F2 F3 E6 E1 FC FB E7 F8 FD F9 F7 FA
 FE DF E0 F6 E3 E4 F4 E2 F5 E8 E9 EA EB EC ED EE
 EF FF F0 F1 F2 F3 E6 E1 FC FB E7 F8 FD F9 F7 FA
</map>
</collation>

<collation name="koi8r_bin"	flag="binary"/>

</charset>

</charsets>
charsets/Index.xml000064400000055725150343472770010203 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets max-id="99">

<copyright>
  Copyright (c) 2003-2005 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<description>
This file lists all of the available character sets.
To make maintaining easier please:
 - keep records sorted by collation number.
 - change charsets.max-id when adding a new collation.
</description>

<charset name="big5">
  <family>Traditional Chinese</family>
  <description>Big5 Traditional Chinese</description>
  <alias>big-5</alias>
  <alias>bigfive</alias>
  <alias>big-five</alias>
  <alias>cn-big5</alias>
  <alias>csbig5</alias>
  <collation name="big5_chinese_ci"	id="1"	order="Chinese">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="big5_bin"	id="84"	order="Binary">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="latin2">
  <family>Central European</family>
  <description>ISO 8859-2 Central European</description>
  <alias>csisolatin2</alias>
  <alias>iso-8859-2</alias>
  <alias>iso-ir-101</alias>
  <alias>iso_8859-2</alias>
  <alias>iso_8859-2:1987</alias>
  <alias>l2</alias>
  <collation name="latin2_czech_cs" 	id="2"	order="Czech" flag="compiled"/>
  <collation name="latin2_general_ci"	id="9"	flag="primary">
    <order>Hungarian</order>
    <order>Polish</order>
    <order>Romanian</order>
    <order>Croatian</order>
    <order>Slovak</order>
    <order>Slovenian</order>
    <order>Sorbian</order>
  </collation>
  <collation name="latin2_hungarian_ci"		id="21"	order="Hungarian"/>
  <collation name="latin2_croatian_ci"		id="27"	order="Croatian"/>
  <collation name="latin2_bin"	id="77"	order="Binary"	flag="binary"/>
  <collation name="latin2_general_nopad_ci" id="1033" flag="nopad">
    <rules>
      <import source="latin2_general_ci"/>
    </rules>
  </collation>
  <collation name="latin2_nopad_bin" id="1101" flag="binary" flag="nopad"/>
</charset>

<charset name="dec8">
  <family>Western</family>
  <description>DEC West European</description>
  <collation name="dec8_bin"		id="69"	order="Binary"	flag="binary"/>
  <collation name="dec8_swedish_ci"	id="3"	flag="primary">
    <order>Dutch</order>
    <order>English</order>
    <order>French</order>
    <order>German Duden</order>
    <order>Italian</order>
    <order>Latin</order>
    <order>Portuguese</order>
    <order>Spanish</order>
  </collation>
  <collation name="dec8_swedish_nopad_ci" id="1027" flag="nopad">
    <rules>
      <import source="dec8_swedish_ci"/>
    </rules>
  </collation>
  <collation name="dec8_nopad_bin" id="1093" flag="binary" flag="nopad"/>
</charset>

<charset name="cp850">
  <family>Western</family>
  <description>DOS West European</description>
  <alias>850</alias>
  <alias>cspc850multilingual</alias>
  <alias>ibm850</alias>
  <collation name="cp850_general_ci"	id="4"	flag="primary">
    <order>Dutch</order>
    <order>English</order>
    <order>French</order>
    <order>German Duden</order>
    <order>Italian</order>
    <order>Latin</order>
    <order>Portuguese</order>
    <order>Spanish</order>
  </collation>
  <collation name="cp850_bin"	id="80"	order="Binary"	flag="binary"/>
  <collation name="cp850_general_nopad_ci" id="1028" flag="nopad">
    <rules>
      <import source="cp850_general_ci"/>
    </rules>
  </collation>
  <collation name="cp850_nopad_bin" id="1104" flag="binary" flag="nopad"/>
</charset>

<charset name="latin1">
  <family>Western</family>
  <description>cp1252 West European</description>
  <alias>csisolatin1</alias>
  <alias>iso-8859-1</alias>
  <alias>iso-ir-100</alias>
  <alias>iso_8859-1</alias>
  <alias>iso_8859-1:1987</alias>
  <alias>l1</alias>
  <alias>latin1</alias>
  <collation name="latin1_german1_ci"	id="5"	order="German Duden"/>
  <collation name="latin1_swedish_ci"	id="8"	order="Finnish, Swedish">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="latin1_danish_ci"	id="15"	order="Danish"/>
  <collation name="latin1_german2_ci"	id="31"	order="German Phonebook"	flag="compiled"/>
  <collation name="latin1_spanish_ci"	id="94"	order="Spanish"/>
  <collation name="latin1_bin"		id="47"	order="Binary">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="latin1_general_ci"	id="48">
    <order>Dutch</order>
    <order>English</order>
    <order>French</order>
    <order>German Duden</order>
    <order>Italian</order>
    <order>Latin</order>
    <order>Portuguese</order>
    <order>Spanish</order>
  </collation>
  <collation name="latin1_general_cs"	id="49">
    <order>Dutch</order>
    <order>English</order>
    <order>French</order>
    <order>German Duden</order>
    <order>Italian</order>
    <order>Latin</order>
    <order>Portuguese</order>
    <order>Spanish</order>
  </collation>
</charset>

<charset name="hp8">
  <family>Western</family>
  <description>HP West European</description>
  <alias>hproman8</alias>
  <collation name="hp8_bin"		id="72"	order="Binary"	flag="binary"/>
  <collation name="hp8_english_ci"	id="6"	flag="primary">
    <order>Dutch</order>
    <order>English</order>
    <order>French</order>
    <order>German Duden</order>
    <order>Italian</order>
    <order>Latin</order>
    <order>Portuguese</order>
    <order>Spanish</order>
  </collation>
  <collation name="hp8_english_nopad_ci" id="1030" flag="nopad">
    <rules>
      <import source="hp8_english_ci"/>
    </rules>
  </collation>
  <collation name="hp8_nopad_bin" id="1096" flag="binary" flag="nopad"/>
</charset>

<charset name="koi8r">
  <family>Cyrillic</family>
  <description>KOI8-R Relcom Russian</description>
  <alias>koi8-r</alias>
  <alias>cskoi8r</alias>
  <collation name="koi8r_general_ci"	id="7"	order="Russian"	flag="primary"/>
  <collation name="koi8r_bin"		id="74"	order="Binary"	flag="binary"/>
  <collation name="koi8r_general_nopad_ci" id="1031" flag="nopad">
    <rules>
      <import source="koi8r_general_ci"/>
    </rules>
  </collation>
  <collation name="koi8r_nopad_bin" id="1098" flag="binary" flag="nopad"/>
</charset>

<charset name="swe7">
  <family>Western</family>
  <description>7bit Swedish</description>
  <alias>iso-646-se</alias>
  <collation name="swe7_swedish_ci"	id="10"	order="Swedish"	flag="primary"/>
  <collation name="swe7_bin"		id="82"	order="Binary"	flag="binary"/>
  <collation name="swe7_swedish_nopad_ci" id="1034" flag="nopad">
    <rules>
      <import source="swe7_swedish_ci"/>
    </rules>
  </collation>
  <collation name="swe7_nopad_bin" id="1106" flag="binary" flag="nopad"/>
</charset>

<charset name="ascii">
  <family>Western</family>
  <description>US ASCII</description>
  <alias>us</alias>
  <alias>us-ascii</alias>
  <alias>csascii</alias>
  <alias>iso-ir-6</alias>
  <alias>iso646-us</alias>
  <collation name="ascii_general_ci"	id="11"	order="English"	flag="primary"/>
  <collation name="ascii_bin"		id="65"	order="Binary"	flag="binary"/>
  <collation name="ascii_general_nopad_ci" id="1035" flag="nopad">
    <rules>
      <import source="ascii_general_ci"/>
    </rules>
  </collation>
  <collation name="ascii_nopad_bin" id="1089" flag="binary" flag="nopad"/>
</charset>

<charset name="ujis">
  <family>Japanese</family>
  <description>EUC-JP Japanese</description>
  <alias>euc-jp</alias>
  <collation name="ujis_japanese_ci"	id="12"	order="Japanese">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="ujis_bin"	id="91"	order="Japanese">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="sjis">
  <family>Japanese</family>
  <description>Shift-JIS Japanese</description>
  <alias>s-jis</alias>
  <alias>shift-jis</alias>
  <alias>x-sjis</alias>
  <collation name="sjis_japanese_ci" 	id="13"	order="Japanese">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="sjis_bin" 	id="88"	order="Binary">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="cp1251">
  <family>Cyrillic</family>
  <description>Windows Cyrillic</description>
  <alias>windows-1251</alias>
  <alias>ms-cyr</alias>
  <alias>ms-cyrillic</alias>
  <collation name="cp1251_bulgarian_ci"	id="14">
    <order>Belarusian</order>
    <order>Bulgarian</order>
    <order>Macedonian</order>
    <order>Russian</order>
    <order>Serbian</order>
    <order>Mongolian</order>
    <order>Ukrainian</order>
  </collation>
  <collation name="cp1251_ukrainian_ci"	id="23"	order="Ukrainian"/>
  <collation name="cp1251_bin"		id="50"	order="Binary"	flag="binary"/>
  <collation name="cp1251_general_ci"	id="51" flag="primary">
    <order>Belarusian</order>
    <order>Bulgarian</order>
    <order>Macedonian</order>
    <order>Russian</order>
    <order>Serbian</order>
    <order>Mongolian</order>
    <order>Ukrainian</order>
  </collation>
  <collation name="cp1251_general_cs"	id="52">
    <order>Belarusian</order>
    <order>Bulgarian</order>
    <order>Macedonian</order>
    <order>Russian</order>
    <order>Serbian</order>
    <order>Mongolian</order>
    <order>Ukrainian</order>
  </collation>
  <collation name="cp1251_general_nopad_ci" id="1075" flag="nopad">
    <rules>
      <import source="cp1251_general_ci"/>
    </rules>
  </collation>
  <collation name="cp1251_nopad_bin" id="1074" flag="binary" flag="nopad"/>
</charset>

<charset name="hebrew">
  <family>Hebrew</family>
  <description>ISO 8859-8 Hebrew</description>
  <alias>csisolatinhebrew</alias>
  <alias>iso-8859-8</alias>
  <alias>iso-ir-138</alias>
  <collation name="hebrew_general_ci"	id="16"	order="Hebrew"	flag="primary"/>
  <collation name="hebrew_bin"		id="71"	order="Binary"	flag="binary"/>
  <collation name="hebrew_general_nopad_ci" id="1040" flag="nopad">
    <rules>
      <import source="hebrew_general_ci"/>
    </rules>
  </collation>
  <collation name="hebrew_nopad_bin" id="1095" flag="binary" flag="nopad"/>
</charset>

<charset name="tis620">
  <family>Thai</family>
  <description>TIS620 Thai</description>
  <alias>tis-620</alias>
  <collation name="tis620_thai_ci"	id="18"	order="Thai">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="tis620_bin"	id="89"	order="Binary">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="euckr">
  <family>Korean</family>
  <description>EUC-KR Korean</description>
  <alias>euc_kr</alias>
  <alias>euc-kr</alias>
  <collation name="euckr_korean_ci"	id="19"	order="Korean">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="euckr_bin"	id="85">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="latin7">
  <family>Baltic</family>
  <description>ISO 8859-13 Baltic</description>
  <alias>BalticRim</alias>
  <alias>iso-8859-13</alias>
  <alias>l7</alias>
  <collation name="latin7_estonian_cs"	id="20">
    <order>Estonian</order>
  </collation>
  <collation name="latin7_general_ci"	id="41">
    <order>Latvian</order>
    <order>Lithuanian</order>
    <flag>primary</flag>
  </collation>
  <collation name="latin7_general_cs"	id="42">
    <order>Latvian</order>
    <order>Lithuanian</order>
  </collation>
  <collation name="latin7_bin"	id="79"	order="Binary"	flag="binary"/>
  <collation name="latin7_general_nopad_ci" id="1065" flag="nopad">
    <rules>
      <import source="latin7_general_ci"/>
    </rules>
  </collation>
  <collation name="latin7_nopad_bin" id="1103" flag="binary" flag="nopad"/>
</charset>

<charset name="koi8u">
  <family>Cyrillic</family>
  <description>KOI8-U Ukrainian</description>
  <alias>koi8-u</alias>
  <collation name="koi8u_general_ci"	id="22"	order="Ukranian"	flag="primary"/>
  <collation name="koi8u_bin"		id="75"	order="Binary"	flag="binary"/>
  <collation name="koi8u_general_nopad_ci" id="1046" flag="nopad">
    <rules>
      <import source="koi8u_general_ci"/>
    </rules>
  </collation>
  <collation name="koi8u_nopad_bin" id="1099" flag="binary" flag="nopad"/>
</charset>

<charset name="gb2312">
  <family>Simplified Chinese</family>
  <description>GB2312 Simplified Chinese</description>
  <alias>chinese</alias>
  <alias>iso-ir-58</alias>
  <collation name="gb2312_chinese_ci"	id="24"	order="Chinese">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="gb2312_bin"	id="86">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="greek">
  <family>Greek</family>
  <description>ISO 8859-7 Greek</description>
  <alias>csisolatingreek</alias>
  <alias>ecma-118</alias>
  <alias>greek8</alias>
  <alias>iso-8859-7</alias>
  <alias>iso-ir-126</alias>
  <collation name="greek_general_ci" 	id="25"	order="Greek"	flag="primary"/>
  <collation name="greek_bin"		id="70"	order="Binary"	flag="binary"/>
  <collation name="greek_general_nopad_ci" id="1049" flag="nopad">
    <rules>
      <import source="greek_general_ci"/>
    </rules>
  </collation>
  <collation name="greek_nopad_bin" id="1094" flag="binary" flag="nopad"/>
</charset>

<charset name="cp1250">
  <family>Central European</family>
  <description>Windows Central European</description>
  <alias>ms-ce</alias>
  <alias>windows-1250</alias>
  <collation name="cp1250_general_ci"	id="26"	flag="primary">
    <order>Hungarian</order>
    <order>Polish</order>
    <order>Romanian</order>
    <order>Croatian</order>
    <order>Slovak</order>
    <order>Slovenian</order>
    <order>Sorbian</order>
  </collation>
  <collation name="cp1250_croatian_ci"	id="44">
    <order>Croatian</order>
  </collation>
  <collation name="cp1250_polish_ci"  id="99">
    <order>Polish</order>
  </collation>
  <collation name="cp1250_czech_cs"	id="34"	order="Czech">
    <flag>compiled</flag>
  </collation>
  <collation name="cp1250_bin"		id="66"	order="Binary"	flag="binary"/>
  <collation name="cp1250_general_nopad_ci" id="1050" flag="nopad">
    <rules>
      <import source="cp1250_general_ci"/>
    </rules>
  </collation>
  <collation name="cp1250_nopad_bin" id="1090" flag="binary" flag="nopad"/>
</charset>

<charset name="gbk">
  <family>East Asian</family>
  <description>GBK Simplified Chinese</description>
  <alias>cp936</alias>
  <collation name="gbk_chinese_ci"	id="28"	order="Chinese">
    <flag>primary</flag>	
    <flag>compiled</flag>
  </collation>
  <collation name="gbk_bin"	id="87"	order="Binary">
    <flag>binary</flag>	
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="cp1257">
  <family>Baltic</family>
  <description>Windows Baltic</description>
  <alias>WinBaltRim</alias>
  <alias>windows-1257</alias>
  <collation name="cp1257_lithuanian_ci"	id="29"	order="Lithuanian"/>
  <collation name="cp1257_bin"			id="58"	order="Binary"	flag="binary"/>
  <collation name="cp1257_general_ci"		id="59"	flag="primary">
    <order>Latvian</order>
    <order>Lithuanian</order>
  </collation>
  <collation name="cp1257_general_nopad_ci" id="1083" flag="nopad">
    <rules>
      <import source="cp1257_general_ci"/>
    </rules>
  </collation>
  <collation name="cp1257_nopad_bin" id="1082" flag="binary" flag="nopad"/>
  <!--collation name="cp1257_ci"		id="60"/-->
  <!--collation name="cp1257_cs"		id="61"/-->
</charset>

<charset name="latin5">
  <family>South Asian</family>
  <description>ISO 8859-9 Turkish</description>
  <alias>csisolatin5</alias>
  <alias>iso-8859-9</alias>
  <alias>iso-ir-148</alias>
  <alias>l5</alias>
  <alias>latin5</alias>
  <alias>turkish</alias>
  <collation name="latin5_turkish_ci"	id="30"	order="Turkish"	flag="primary"/>
  <collation name="latin5_bin"		id="78"	order="Binary"	flag="binary"/>
  <collation name="latin5_turkish_nopad_ci" id="1054" flag="nopad">
    <rules>
      <import source="latin5_turkish_ci"/>
    </rules>
  </collation>
  <collation name="latin5_nopad_bin" id="1102" flag="binary" flag="nopad"/>
</charset>

<charset name="armscii8">
  <family>South Asian</family>
  <description>ARMSCII-8 Armenian</description>
  <alias>armscii-8</alias>
  <collation name="armscii8_general_ci"	id="32"	order="Armenian"	flag="primary"/>
  <collation name="armscii8_bin"	id="64"	order="Binary"		flag="binary"/>
  <collation name="armscii8_general_nopad_ci" id="1056" flag="nopad">
    <rules>
      <import source="armscii8_general_ci"/>
    </rules>
  </collation>
  <collation name="armscii8_nopad_bin" id="1088" flag="binary" flag="nopad"/>
</charset>

<charset name="utf8mb3">
  <family>Unicode</family>
  <description>UTF-8 Unicode</description>
  <alias>utf-8</alias>
  <collation name="utf8mb3_general_ci"	id="33">
   <flag>primary</flag>
   <flag>compiled</flag>
  </collation>
  <collation name="utf8mb3_bin"		id="83">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="ucs2">
  <family>Unicode</family>
  <description>UCS-2 Unicode</description>
  <collation name="ucs2_general_ci"	id="35">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="ucs2_bin"	id="90">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="cp866">
  <family>Cyrillic</family>
  <description>DOS Russian</description>
  <alias>866</alias>
  <alias>csibm866</alias>
  <alias>ibm866</alias>
  <alias>DOSCyrillicRussian</alias>
  <collation name="cp866_general_ci"	id="36"	order="Russian"	flag="primary"/>
  <collation name="cp866_bin"		id="68"	order="Binary"	flag="binary"/>
  <collation name="cp866_general_nopad_ci" id="1060" flag="nopad">
    <rules>
      <import source="cp866_general_ci"/>
    </rules>
  </collation>
  <collation name="cp866_nopad_bin" id="1092" flag="binary" flag="nopad"/>
</charset>

<charset name="keybcs2">
  <family>Central European</family>
  <description>DOS Kamenicky Czech-Slovak</description>
  <collation name="keybcs2_general_ci"	id="37"	order="Czech"	flag="primary"/>
  <collation name="keybcs2_bin"		id="73"	order="Binary"	flag="binary"/>
  <collation name="keybcs2_general_nopad_ci" id="1061" flag="nopad">
    <rules>
      <import source="keybcs2_general_ci"/>
    </rules>
  </collation>
  <collation name="keybcs2_nopad_bin" id="1097" flag="binary" flag="nopad"/>
</charset>

<charset name="macce">
  <family>Central European</family>
  <description>Mac Central European</description>
  <alias>MacCentralEurope</alias>
  <collation name="macce_general_ci"	id="38"	flag="primary">
    <order>Hungarian</order>
    <order>Polish</order>
    <order>Romanian</order>
    <order>Croatian</order>
    <order>Slovak</order>
    <order>Slovenian</order>
    <order>Sorbian</order>
  </collation>
  <collation name="macce_bin"	id="43"	order="Binary"	flag="binary"/>
  <collation name="macce_general_nopad_ci" id="1062" flag="nopad">
    <rules>
      <import source="macce_general_ci"/>
    </rules>
  </collation>
  <collation name="macce_nopad_bin" id="1067" flag="binary" flag="nopad"/>
</charset>

<charset name="macroman">
  <family>Western</family>
  <description>Mac West European</description>
  <alias>Mac</alias>
  <alias>Macintosh</alias>
  <alias>csmacintosh</alias>
  <collation name="macroman_general_ci"	id="39"	flag="primary">
    <order>Dutch</order>
    <order>English</order>
    <order>French</order>
    <order>German Duden</order>
    <order>Italian</order>
    <order>Latin</order>
    <order>Portuguese</order>
    <order>Spanish</order>
  </collation>
  <collation name="macroman_bin"	id="53"	order="Binary"	flag="binary"/>
  <!--collation name="macroman_ci"	id="54"/-->
  <!--collation name="macroman_ci_ai"	id="55"/-->
  <!--collation name="macroman_cs"	id="56"/-->
  <collation name="macroman_general_nopad_ci" id="1063" flag="nopad">
    <rules>
      <import source="macroman_general_ci"/>
    </rules>
  </collation>
  <collation name="macroman_nopad_bin" id="1077" flag="binary" flag="nopad"/>
</charset>

<charset name="cp852">
  <family>Central European</family>
  <description>DOS Central European</description>
  <alias>852</alias>
  <alias>cp852</alias>
  <alias>ibm852</alias>
  <collation name="cp852_general_ci"	id="40"	flag="primary">
    <order>Hungarian</order>
    <order>Polish</order>
    <order>Romanian</order>
    <order>Croatian</order>
    <order>Slovak</order>
    <order>Slovenian</order>
    <order>Sorbian</order>
  </collation>
  <collation name="cp852_bin"	id="81"	order="Binary"	flag="binary"/>
  <collation name="cp852_general_nopad_ci" id="1064" flag="nopad">
    <rules>
      <import source="cp852_general_ci"/>
    </rules>
  </collation>
  <collation name="cp852_nopad_bin" id="1105" flag="binary" flag="nopad"/>
</charset>

<charset name="cp1256">
  <family>Arabic</family>
  <description>Windows Arabic</description>
  <alias>ms-arab</alias>
  <alias>windows-1256</alias>
  <collation name="cp1256_bin"		id="67"	order="Binary"	flag="binary"/>
  <collation name="cp1256_general_ci"	id="57"	order="Arabic"	flag="primary">
    <order>Arabic</order>
    <order>Persian</order>
    <order>Pakistani</order>
    <order>Urdu</order>
  </collation>
  <collation name="cp1256_general_nopad_ci" id="1081" flag="nopad">
    <rules>
      <import source="cp1256_general_ci"/>
    </rules>
  </collation>
  <collation name="cp1256_nopad_bin" id="1091" flag="binary" flag="nopad"/>
</charset>

<charset name="geostd8">
  <family>South Asian</family>
  <description>GEOSTD8 Georgian</description>
  <collation name="geostd8_general_ci"	id="92"	order="Georgian"	flag="primary"/>
  <collation name="geostd8_bin"		id="93"	order="Binary"		flag="binary"/>
  <collation name="geostd8_general_nopad_ci" id="1116" flag="nopad">
    <rules>
      <import source="geostd8_general_ci"/>
    </rules>
  </collation>
  <collation name="geostd8_nopad_bin" id="1117" flag="binary" flag="nopad"/>
</charset>

<charset name="binary">
  <description>Binary pseudo charset</description>
  <collation name="binary"	id="63"	order="Binary">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="cp932">
  <family>Japanese</family>
  <description>SJIS for Windows Japanese</description>
  <alias>ms_cp932</alias>
  <alias>sjis_cp932</alias>
  <alias>sjis_ms</alias>
  <collation name="cp932_japanese_ci"    id="95" order="Japanese">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="cp932_bin"    id="96" order="Binary">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

<charset name="eucjpms">
  <family>Japanese</family>
  <description>UJIS for Windows Japanese</description>
  <alias>eucjpms</alias>
  <alias>eucJP_ms</alias>
  <alias>ujis_ms</alias>
  <alias>ujis_cp932</alias>
  <collation name="eucjpms_japanese_ci"    id="97" order="Japanese">
    <flag>primary</flag>
    <flag>compiled</flag>
  </collation>
  <collation name="eucjpms_bin"    id="98" order="Japanese">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

</charsets>
charsets/swe7.xml000064400000014602150343472770010006 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="swe7">

<ctype>
<map>
  00
  20  20  20  20  20  20  20  20  20  28  28  28  28  28  20  20
  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
  48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
  84  84  84  84  84  84  84  84  84  84  10  10  10  10  10  10
  01  81  81  81  81  81  81  01  01  01  01  01  01  01  01  01
  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01  10
  01  82  82  82  82  82  82  02  02  02  02  02  02  02  02  02
  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02  20
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
</map>
</ctype>


<lower>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  60  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  5F
  60  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
  70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
</map>
</lower>


<upper>
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
  40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
00C9 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 00C4 00D6 00C5 00DC 005F
00E9 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 00E4 00F6 00E5 00FC 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
</map>
</unicode>


<collation name="swe7_swedish_ci">
<map>
  00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
  10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
  20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
  30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
  45  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5C  5D  5B  59  5F
  45  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
  50  51  52  53  54  55  56  57  58  59  5A  5C  5D  5B  59  7F
  80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
  90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
  A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
  B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
  C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
  D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
  E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
  F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
</map>
</collation>

<collation name="swe7_bin"	flag="binary"/>

</charset>

</charsets>


charsets/macce.xml000064400000017557150343472770010205 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="macce">

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
 01 01 02 01 01 01 01 02 02 01 02 02 01 02 02 01
 02 01 02 02 01 02 01 02 02 02 02 02 02 01 02 02
 00 00 01 00 00 00 00 02 00 00 00 02 00 00 02 01
 02 01 00 00 02 01 00 00 02 01 02 01 02 01 02 01
 02 01 00 00 02 01 00 00 00 00 00 02 01 01 02 01
 00 00 00 00 00 00 00 00 02 01 02 01 00 00 02 01
 02 01 00 00 02 01 02 01 01 02 01 01 02 01 01 01
 02 01 01 02 01 02 01 02 01 02 02 01 01 02 01 00
</map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 8A 82 82 8E 88 9A 9F 87 88 8B 8A 8B 8D 8D 8E 90
 90 93 92 93 95 95 98 97 98 99 9A 9B 9C 9E 9E 9F
 A0 A1 AB A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE B0
 B0 B4 B2 B3 B4 FA B6 B7 B8 BA BA BC BC BE BE C0
 C0 C4 C2 C3 C4 CB C6 C7 C8 C9 CA CB CE 9B CE D8
 D0 D1 D2 D3 D4 D5 D6 D7 D8 DA DA DE DC DD DE E0
 E0 E4 E2 E3 E4 E6 E6 87 E9 E9 92 EC EC F0 97 99
 F0 F3 9C F3 F5 F5 F7 F7 F9 F9 FA FD B8 FD AE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 81 83 84 85 86 E7 84 89 80 89 8C 8C 83 8F
 8F 91 EA 91 94 94 96 EE 96 EF 85 CD F2 9D 9D 86
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA A2 AC AD FE AF
 AF B1 B2 B3 B1 B5 B6 B7 FC B9 B9 BB BB BD BD BF
 BF C1 C2 C3 C1 C5 C6 C7 C8 C9 CA C5 CC CD CC CF
 D0 D1 D2 D3 D4 D5 D6 D7 CF D9 D9 DB DC DD DB DF
 DF E1 E2 E3 E1 E5 E5 E7 E8 E8 EA EB EB ED EE EF
 ED F1 F2 F1 F4 F4 F6 F6 F8 F8 B5 FB FC FB FE FF
</map>
</upper>


<unicode>
<map>
 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
 00C4 0100 0101 00C9 0104 00D6 00DC 00E1 0105 010C 00E4 010D 0106 0107 00E9 0179
 017A 010E 00ED 010F 0112 0113 0116 00F3 0117 00F4 00F6 00F5 00FA 011A 011B 00FC
 2020 00B0 0118 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 0119 00A8 2260 0123 012E
 012F 012A 2264 2265 012B 0136 2202 2211 0142 013B 013C 013D 013E 0139 013A 0145
 0146 0143 00AC 221A 0144 0147 2206 00AB 00BB 2026 00A0 0148 0150 00D5 0151 014C
 2013 2014 201C 201D 2018 2019 00F7 25CA 014D 0154 0155 0158 2039 203A 0159 0156
 0157 0160 201A 201E 0161 015A 015B 00C1 0164 0165 00CD 017D 017E 016A 00D3 00D4
 016B 016E 00DA 016F 0170 0171 0172 0173 00DD 00FD 0137 017B 0141 017C 0122 02C7
</map>
</unicode>


<collation name="macce_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 46 47 4A 4C 52 53 55 56 5A 5B 5D 62 62 67
 6F 70 71 75 79 81 88 89 8A 8B 8D 90 91 92 93 94
 95 41 46 47 4A 4C 52 53 55 56 5A 5B 5D 62 62 67
 6F 70 71 75 79 81 88 89 8A 8B 8D 96 97 98 99 9A
 41 41 41 4C 41 67 81 41 41 47 41 47 47 47 4C 8D
 8D 4A 56 4A 4C 4C 4C 67 4C 67 67 67 81 4C 4C 81
 A0 A1 4C A3 A4 A5 A6 75 A8 A9 AA 4C AC AD 53 56
 56 56 B2 B3 56 5B B6 B7 5D 5D 5D 5D 5D 5D 5D 62
 62 62 C2 C3 62 62 C6 C7 C8 C9 CA 62 67 67 67 67
 D0 D1 D2 D3 D4 D5 D6 D7 67 71 71 71 DC DD 71 71
 71 75 E2 E3 75 75 75 41 79 79 56 8D 8D 81 67 67
 81 81 81 81 81 81 81 81 8B 8B 5B 8D 5D 8D 53 FF
</map>
</collation>


<collation name="macce_bin" flag="binary"/>

<collation name="macce_ci_ai">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
 D7 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D8 D9 DA DB DC
 41 41 41 57 41 8D B2 41 41 4D 41 4D 4D 4D 57 CA
 CA 53 6B 53 57 57 57 8D 57 8D 8D 8D B2 57 57 B2
 DD DE 57 DF E0 E1 E2 A7 E3 E4 E5 57 E6 E7 65 6B
 6B 6B E8 E9 6B 75 EA EB 79 79 79 79 79 79 79 85
 85 85 EC ED 85 85 EE EF F0 F1 F2 85 8D 8D 8D 8D
 F3 F4 F5 F6 F7 F8 F9 FA 8D 9F 9F 9F FB FC 9F 9F
 9F A7 FD FE A7 A7 A7 41 BE BE 6B CA CA B2 8D 8D
 B2 B2 B2 B2 B2 B2 B2 B2 C6 C6 75 CA 79 CA 65 FF
</map>
</collation>


<collation name="macce_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
 D7 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D8 D9 DA DB DC
 45 47 47 59 49 91 B6 43 49 4F 45 4F 51 51 59 CE
 CE 55 71 55 5B 5B 5D 8F 5D 99 91 97 B8 5F 5F B6
 DD DE 61 DF E0 E1 E2 AD E3 E4 E5 61 E6 E7 67 6F
 6F 6D E8 E9 6D 77 EA EB 7B 81 82 7F 7F 7D 7D 8B
 8B 87 EC ED 87 89 EE EF F0 F1 F2 89 93 97 93 95
 F3 F4 F5 F6 F7 F8 F9 FA 95 A1 A1 A3 FB FC A3 A5
 A5 A9 FD FE A9 AB AB 43 B0 B0 71 CC CC BC 8F 99
 BC B4 B8 B4 BA BA BE BE C8 C8 77 D0 7B D0 67 FF

</map>
</collation>


<collation name="macce_cs">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
 D7 42 4C 4E 54 58 64 66 6A 6C 74 76 7A 84 86 8E
 9C 9E A0 A8 AF B3 C1 C3 C5 C7 CB D8 D9 DA DB DC
 45 47 48 59 49 91 B6 44 4A 4F 46 50 51 52 5A CE
 CF 55 72 56 5B 5C 5D 90 5E 9A 92 98 B8 5F 60 B7
 DD DE 61 DF E0 E1 E2 AD E3 E4 E5 62 E6 E7 68 6F
 70 6D E8 E9 6E 77 EA EB 7C 81 82 7F 80 7D 7E 8B
 8C 87 EC ED 88 89 EE EF F0 F1 F2 8A 93 97 94 95
 F3 F4 F5 F6 F7 F8 F9 FA 96 A1 A2 A3 FB FC A4 A5
 A6 A9 FD FE AA AB AC 43 B0 B1 71 CC CD BC 8F 99
 BD B4 B9 B5 BA BB BE BF C8 C9 78 D0 7B D1 67 FF
</map>
</collation>


</charset>

</charsets>
charsets/greek.xml000064400000013140150343472770010212 0ustar00<?xml version='1.0' encoding="utf-8"?>

<charsets>

<copyright>
 Copyright (C) 2003 MySQL AB
   Use is subject to license terms

  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 Street, Fifth Floor, Boston, MA  02110-1335  USA
</copyright>

<charset name="greek">

<!-- It's ISO Greek rahter than WIN Greek  because                   -->
<!-- 0xB6 is marked as upper letter, it's true for ISO Greek version -->
<!-- In Windows version this character is PILCROW SIGN               -->

<ctype>
<map>
 00
 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 48 10 10 10 00 00 10 10 10 10 00 10 10 10 00 10
 10 10 10 10 10 10 01 10 01 01 01 10 01 10 01 01
 02 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 01 01 00 01 01 01 01 01 01 01 01 01 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00
 </map>
</ctype>


<lower>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 DC B7 DD DE DF BB FC BD FD FE
 C0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 D2 F3 F4 F5 F6 F7 F8 F9 FA FB DC DD DE DF
 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>


<upper>
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
 DA C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB C1 C5 C7 C9
 DB C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D3 D3 D4 D5 D6 D7 D8 D9 DA DB CF D5 D9 FF
</map>
</upper>


<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
00A0 02BD 02BC 00A3 0000 0000 00A6 00A7 00A8 00A9 0000 00AB 00AC 00AD 0000 2015
00B0 00B1 00B2 00B3 0384 0385 0386 00B7 0388 0389 038A 00BB 038C 00BD 038E 038F
0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F
03A0 03A1 0000 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03AA 03AB 03AC 03AD 03AE 03AF
03B0 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF
03C0 03C1 03C2 03C3 03C4 03C5 03C6 03C7 03C8 03C9 03CA 03CB 03CC 03CD 03CE 0000
</map>
</unicode>


<collation name="greek_general_ci">
<map>
 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
 B0 B1 B2 B3 B4 B5 C1 B7 C5 C7 C9 BB CF BD D5 D9
 C9 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 C9 D5 C1 C5 C7 C9
 D5 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
 D0 D1 D3 D3 D4 D5 D6 D7 D8 D9 C9 D5 CF D5 D9 FF
</map>
</collation>

<collation name="greek_bin"	flag="binary"/>

</charset>

</charsets>

spanish/errmsg.sys000064400000265255150343472770010303 0ustar00���`o��=�8,6FIHV-243/9:57FP9,7<;(,2G,9FG'Up]="EA'$,$/&F?:&$->%!'+&KJM4Slw,&%=]V^p'7 �T7-`1.1VQ4-%�">3&)#P+*E��F�&38 G7(tL�{?5�T$wVC_dC%oA�a-S8? .4D8H:@=_':|ELq(2Dt33C!#%%h,B%**Ic(Hb[bp_y�HM:IF[cf8dn7:ZZ.?&EYE-D]TY3I4@#2be)<=/2A71(&25Er=A � {#6H`941P9SX>_)��^K�_')y?&�%P3pi:,�8S%.1P*K,= #,`/.��8J$"-*&?-7N6$CLMEWZO&'O2<@`e_�J;A: 1Z68&H=[8@81:7?(T<<8O4@6:]R8(;hMjLb9>;LR1;L.l?V����+cS@NRV`4qarRK!�6';2�Z�Y�`EE[[G�V|a&_6O4:6A1>O:X:&�<fWhVHRZUXq8L4/@UIOJ\@Ac77Y3F(*B?cmAP,-7'0^�II>&#/.<^fHF�K!0([* +/%,U]h5�}f.M/4 nu C2*>/KD-Jb�LBFF3N��D=�47.:0:F6GI9-8k155dp45#4HG�@h9@ADr.ID=65::'K19-h`2<4/J_MC�����������_nq�lDF3:B$n`cHGM*<buDL(F(FFWN��c�{?d?AA�����3W/qEQq@JCF5*3�iZB i��K0D?Ki9��A J��~jEXQw�CnU.#)��X�VZAAKL	H���':OH;KK����tG.&(/t9HQD?rvP)w'�^qkP]oq$!M6Cd&(�6-,KB'?]]FB);�*�/u-�;S|\Y�fpg&��j+�IA>IS580H/89:C>iwm^I]`17I@,6DxJ�%I���_y2�)#%"!$Ph�4+@C47'*2=3RL1%�C<>�ET�5_\*\17xH)#��F`S|�3=�K552-Qifp2>**611(9*:3=c;�T9a+?24CJ7@cKSHPH0@Y.<+<-8529K(`UG3DU=SW�<RpE_:LIT2Nc);P����Y�]��W.2V�;D=S<CC:8P:6+ME,4$!�yPN'NR7G;R\c(:CBE2m#G0tj+:;*-7Jf74NJ.*2r?TST*ED:R$o~-F5F)-M>jL$![{-xYKIA-.{226/W\FX��hashchkisamchkNOSÍNo puedo crear el fichero/archivo '%-.200s' (Error: %M)No puedo crear la tabla %`s.%`s (Error: %M)No puedo crear la base de datos '%-.192s' (Error: %M)No puedo crear la base de datos '%-.192s'; la base de datos ya existeNo puedo eliminar la base de datos '%-.192s'; la base de datos no existeError eliminando la base de datos (no puedo borrar '%-.192s', error %M)Error eliminando la base de datos (No puedo borrar el directorio '%-.192s', error %M)Error en el borrado de '%-.192s' (Error: %M)No puedo leer el registro en la tabla del sistemaNo puedo obtener el estado de '%-.200s' (Error: %M)No puedo obtener directorio de trabajo (Error: %M)No puedo bloquear fichero/archivo: (Error: %M)No puedo abrir el fichero/archivo: '%-.200s' (Error: %M)No puedo hallar el fichero/archivo: '%-.200s' (Error: %M)No puedo leer el directorio de '%-.192s' (Error: %M)No puedo cambiar al directorio a '%-.192s' (Error: %M)El registro ha cambiado desde la ultima lectura de la tabla '%-.192s'Disco lleno (%s). Esperando a que alguien libere algo de espacio... (Error: %M)No puedo escribir, clave duplicada en la tabla '%-.192s'Error en el cierre de '%-.192s' (Error: %M)Error leyendo el fichero/archivo '%-.200s' (Error: %M)Error en el renombrado de '%-.210s' a '%-.210s' (Error: %M)Error escribiendo el fichero/archivo '%-.200s' (Error: %M)'%-.192s' esta bloqueado contra cambiosOrdenación canceladaLa vista '%-.192s' no existe para '%-.192s'Obtenido error %M desde el motor de almacenaje %sEl motor de almacenaje %s de la tabla %`s.%`s no contiene esta opciónNo puedo encontrar el registro en '%-.192s'Información incorrecta en el fichero/archivo: '%-.200s'El índice para la tabla: '%-.200s' está corrupto; intente repararloClave antigua de fichero/archivo para la tabla '%-.192s'; ¡repárela!La tabla '%-.192s' es de sólo lecturaMemoria insuficiente. Reinicie el servidor e inténtelo otra vez (necesita %d bytes)Memoria de ordenación insuficiente. Considere el incrementar el tamaño del búfer de ordenación del servidorInesperado fin de fichero/archivo mientras leíamos el fichero/archivo '%-.192s' (Error: %M)Demasiadas conexionesMemoria agotadaNo puedo obtener el nombre de equipo de la dirección de vd.Mal apretón de manos (handshake)Acceso denegado para usuario: '%s'@'%s' a la base de datos '%-.192s'Acceso denegado para usuario: '%s'@'%s' (Usando contraseña: %s)Base de datos no seleccionadaComando desconocidoLa columna '%-.192s' no puede ser nulaBase de datos '%-.192s' desconocidaLa tabla '%-.192s' ya existeTabla '%-.100T' no reconocidaLa columna: '%-.192s' en %-.192s es ambiguaDesconexión de servidor en procesoNo se reconoce la columna '%-.192s' en %-.192s'%-.192s' no se encuentra en GROUP BYNo puedo agrupar por '%-.192s'La sentencia tiene funciones de suma y columnas en la misma sentenciaEl contador de columnas no coincide con el contador de valoresEl nombre del identificador '%-.100T' es demasiado grandeNombre duplicado de columna '%-.192s'Nombre duplicado de clave '%-.192s'Entrada duplicada '%-.192T' para la clave %dEspecificador de columna incorrecto para la columna '%-.192s'%s cerca de '%-.80T' en la línea %dLa consulta (query) estaba vaciaLa tabla/alias: '%-.192s' no es únicaValor por defecto inválido para '%-.192s'Múltiples claves primarias definidasDemasiadas claves primarias declaradas. Se permite un máximo de %d clavesDemasiadas partes de clave declaradas. Se permite un máximo de %d partesDeclaración de clave demasiado larga. La máxima longitud de clave es de %dLa columna de clave '%-.192s' no existe en la tablaLa columna BLOB %`s no se puede usar en la especificación de clave en la tabla %sLongitud de columna demasiado grande para la columna '%-.192s' (máximo = %lu). Use BLOB o TEXT en su lugarDefinición incorrecta de tabla; sólo puede haber una columna automática y ésta debe de ser definida como una claveNo pude borrar el dominio gtid. Motivo: %s.%s (iniciado por: %s): Apagado normal%s: Obtenida señal %d. ¡Abortando!%s: Apagado completado%s: Forzando a cerrar el hilo (thread) %ld usuario: '%-.48s'No puedo crear IP socketLa tabla '%-.192s' no tiene un índice como el usado en CREATE INDEX. Crea de nuevo la tablaLos separadores de argumentos del campo no son los especificados. Compruebe el manualNo se pueden usar longitudes fijas de filas con BLOBs. Por favor, use 'campos terminados por'El fichero/archivo '%-.128s' debe de estar en el directorio de la base de datos o debe de ser legible por todosEl fichero/archivo '%-.200s' ya existeRegistros: %ld Borrados: %ld Saltados: %ld Avisos: %ldRegistros: %ld  Duplicados: %ldPrefijo incorrecto de clave; la parte utilizada de la clave no es una cadena, la longitud usada es mayor que la parte de la clave o el motor de almacenaje no soporta claves con prefijo únicoNo se pueden borrar todas las columnas con ALTER TABLE. Use DROP TABLE para hacerloNo puedo eliminar %s %`-.192s; compruebe que ya existeRegistros: %ld  Duplicados: %ld  Avisos: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataIdentificador del hilo (thread): %lu desconocidoNo eres el propietario del hilo (thread) %lldNo se están usando tablasDemasiadas cadenas para la columna %-.192s y SETNo puedo generar un único fichero/archivo de historial (log) llamado %-.200s.(1-999)La tabla '%-.192s' ha sido bloqueada con un READ lock y no puede ser actualizadaLa tabla '%-.192s' no fue bloqueada con LOCK TABLESNunca debería vd de ver estoNombre incorrecto de base de datos '%-.100T'Nombre incorrecto de tabla '%-.100s'El SELECT debería de examinar más de MAX_JOIN_SIZE filas; revise su WHERE y utilice SET SQL_BIG_SELECTS=1 o SET MAX_JOIN_SIZE=# si el SELECT está okError desconocidoProcedimiento desconocido %-.192sContador de parámetros incorrecto para procedimiento %-.192sParámetros incorrectos para procedimiento %-.192sTabla desconocida '%-.192s' en %-.32sColumna '%-.192s' especificada dos vecesInválido uso de función de grupoLa tabla '%-.192s' usa una extensión que no existe en esta versión de MariaDBUna tabla debe de tener al menos 1 columnaLa tabla '%-.192s' está llenaJuego desconocido de caracteres: '%-.64s'Demasiadas tablas. MariaDB solamente puede usar %d tablas en un joinDemasiadas columnasTamaño de fila muy grande. El máximo tamaño de fila para el tipo de tabla usada, sin contar BLOBs, es de %ld. Esto incluye sobrecarga de almacenaje, revise el manual. Tiene que cambiar algunas columnas a TEXT o BLOBsDesbordamiento de la pila de hilos (threads): Usado: %ld de una pila de %ld. Considere el incrementar la variable de sistema thread_stackDependencia cruzada hallada en OUTER JOIN. Examina tus condiciones ONEl manejador de tabla no soporta NULL en índice suministrado. Por favor, cambie la columna '%-.192s' para que sea NOT NULL o utilice otro manejadorNo puedo cargar la función '%-.192s'No puedo inicializar la función '%-.192s'; %-.80sNo existen rutas autorizadas para biblioteca compartidaLa función '%-.192s' ya existeNo puedo abrir la biblioteca compartida '%-.192s' (error: %d, %-.128s)No puedo encontrar el símbolo '%-.128s' en bibliotecaLa función '%-.192s' no está definidaEl equipo '%-.64s' está bloqueado debido a muchos errores de conexión; desbloquea con 'mariadb-admin flush-hosts'El equipo '%-.64s' no está autorizado a conectar con este servidor MariaDBEstá usando MariaDB como un usuario anónimo y lo usuarios anónimos no tienen permiso para cambiar las propiedades de usuarioVd debe de tener privilegios para actualizar tablas en la base de datos mysql para poder cambiar las contraseñas de otrosNo puedo encontrar una fila coincidente en la tabla de usuarioLíneas coincidentes: %ld Cambiadas: %ld Avisos: %ldNo puedo crear un nuevo hilo (thread) (error %M). Si no está falto de memoria disponible, vd puede consultar el manual para un posible error dependiente del SOEl número de columnas no se corresponde con el número de valores en la línea %luNo puedo reabrir la tabla: '%-.192sUso inválido del valor NULLObtenido error '%s' de regexpLa mezcla de columnas GROUP (MIN(),MAX(),COUNT()...) con columnas no GROUP es ilegal si no exite la cláusula GROUP BYNo existe tal concesión (grant) definida para usuario '%-.48s' en el equipo '%-.64s'%-.100T comando denegado a usuario '%s'@'%s' para la tabla %`s.%`s%-.32s comando denegado a el usuario '%s'@'%s' para la columna '%-.192s' en la tabla '%-.192s'Comando GRANT/REVOKE ilegal; por favor, consulte el manual para ver los permisos que se pueden usarEl argumento de GRANT para el equipo o usuario es demasiado grandeLa tabla '%-.192s.%-.192s' no existeNo existe tal concesión (grant) definida para el usuario '%-.48s' en el equipo '%-.64s' en la tabla '%-.192s'El comando usado no está permitido con esta versión de MariaDBExiste un error en su sintaxis SQL; revise el manual que se corresponde con su versión del servidor MariaDB para averiguar la sintaxis correcta a utilizarEl hilo (thread) de inserción retardada no pudo obtener bloqueo requerido para la tabla %-.192sDemasiados hilos (threads) retardados en usoConexión %ld abortada para la base de datos: '%-.192s' usuario: '%-.48s' (%-.64s)Obtenido un paquete mayor de 'max_allowed_packet' bytesObtenido un error de lectura desde la tubería de la conexiónObtenido un error de fcntl()Obtenidos paquetes desordenadosNo pude descomprimir paquete de comunicaciónObtenido un error leyendo paquetes de comunicaciónObtenido tiempo agotado (timeout) leyendo paquetes de comunicaciónObtenido un error escribiendo paquetes de comunicaciónObtenido tiempo agotado (timeout) escribiendo paquetes de comunicaciónLa cadena resultante es mayor de max_allowed_packet bytesEl motor de almacenaje %s no soporta columnas de tipo BLOB/TEXTEl motor de almacenaje %s no soporta columnas AUTO_INCREMENTINSERT DELAYED no puede ser usado con la tabla '%-.192s' porque esta bloqueada con LOCK TABLESNombre Incorrecto de columna '%-.100s'El motor de almacenaje %s no puede indizar la columna %`sIncapaz de abrir la tabla subyacente por estar definida de forma diferente o por no ser del tipo no-MyISAM o por no existirNo puedo grabar, debido a restricción única, en la tabla '%-.192s'Columna BLOB/TEXT '%-.192s', usada en especificación de clave, sin tamañoTodas las partes de una PRIMARY KEY deben de ser NOT NULL; si necesita NULL en una clave, use UNIQUE en su lugarResultado compuesto de más de una filaEste tipo de tabla necesita de una clave primariaEsta versión de MariaDB no ha sido compilada con soporte para RAIDEstá usando modo de actualización segura y ha intentado actualizar una tabla sin un WHERE que use una columna KEYLa clave '%-.192s' no existe en la tabla '%-.192s'No puedo abrir tablaEl motor de almacenaje para la tabla no soporta %sNo tiene el permiso para ejecutar este comando en una transacciónObtenido error %M durante COMMITObtenido error %M durante ROLLBACKObtenido error %M durante FLUSH_LOGSObtenido error %M durante CHECKPOINTAbortada conexión %lld a la base de datos: '%-.192s' usuario: '%-.48s' equipo: '%-.64s'%-.64s (%-.64s)Nunca lo debería vd de verBinlog cerrado, no puedo hacer RESET MASTERFallo reconstruyendo el índice del volcado de la tabla '%-.192s'Error del maestro (master): '%-.64s'Error de red leyendo del maestro (master)Error de red grabando en maestro (master)No puedo encontrar índice FULLTEXT coincidente con la lista de columnasNo puedo ejecutar el comando dado porque tiene tablas activas bloqueadas o una transacción activaVariable de sistema '%-.*s' desconocidaLa tabla '%-.192s' está marcada como estropeada y debe de ser reparadaLa tabla '%-.192s' está marcada como estropeada y la última reparación (¿automática?) fallóAlgunas tablas no transaccionales ya cambiadas no puedieron ser retrocedidas (rolled back)Transacción multi-sentencia requirió de más de 'max_binlog_cache_size' bytes de almacenamientoEsta operación no puede ser realizada con el esclavo '%2$*1$s' en marcha; primero ejecute STOP SLAVE '%2$*1$s'Esta operación requiere de un esclavo funcionando; configure el esclavo y haga el START SLAVEEl servidor no está configurado como esclavo; arréglelo en el fichero/archivo de configuración o con CHANGE MASTER TONo pude inicializar estructura info de maestro (master) para '%.*s'; se pueden ver más mensajes de error en el historial (log) de errores de MariaDBNo puedo crear el hilo (thread) esclavo; verifique recursos del sistemaEl usuario %-.64s ya tiene más de 'max_user_connections' conexiones activasSólo puede usar expresiones constantes en esta sentenciaTiempo de espera de bloqueo excedido; intente rearrancar la transacciónEl número total de bloqueos excede el tamaño de bloqueo de la tablaNo se pueden adquirir bloqueos de actualización durante una transacción READ UNCOMMITTEDDROP DATABASE no permitido mientras un hilo (thread) está ejerciendo un bloqueo de lectura globalCREATE DATABASE no permitido mientras un hilo (thread) está manteniendo un bloqueo de lectura globalArgumentos incorrectos para %s'%s'@'%s' no está permitido para crear nuevos usuariosDefinición incorrecta de la tabla; todas las tablas MERGE deben de estar en la misma base de datosEncontrado estancamiento (deadlock) al intentar obtener el bloqueo; intente volver a comenzar la transacciónEl motor de almacenaje %s no soporta índices FULLTEXTNo puedo añadir restricción de clave foránea para `%s`No puedo añadir o actualizar una fila hija: ha fallado una restrición de clave foráneaNo puedo borrar o actualizar una fila padre: ha fallado una restrición de clave foráneaError conectando al maestro (master): %-.128sError ejecutando consulta (query) en maestro (master): %-.128sError al ejecutar comando %s: %-.128sUso incorrecto de %s y %sLas sentencias SELECT usadas tienen un número diferente de columnasNo puedo ejecutar la consulta (query) porque vd tiene un conflicto de bloqueo de lecturaDesactivada la mezcla de tablas transaccionales y no transaccionalesOpción '%s' usada dos veces en la sentenciaEl usuario '%-.64s' ha excedido el recurso '%s' (valor actual: %ld)Acceso denegado. Usted necesita (al menos un(os)) privilegio(s) %-.128s para esta operaciónLa variable '%-.64s' es una variable de SESSION y no puede ser usada con SET GLOBALLa variable '%-.64s' es una variable GLOBAL y debería de ser configurada con SET GLOBALLa variable '%-.64s' no tiene un valor por defectoLa variable '%-.64s' no puede ser configurada para el valor de '%-.200T'Tipo de argumento incorrecto para variable '%-.64s'La variable '%-.64s' solamente puede ser configurada, no leídaIncorrecto uso/colocación de '%s'Esta versión de MariaDB no soporta todavía '%s'Obtenido error fatal %d del maestro (master) al leer datos del historial (log) binario: '%-.320s'El hilo (thread) SQL esclavo ha ignorado la consulta (query) debido a las reglas de replicar-*-tablaLa variable '%-.192s' es una variable %sDefinición de clave foránea incorrecta para '%-.192s': %sLa referencia de clave y la referencia de tabla no coincidenEl operando debería de contener %d columna(s)La subconsulta (subquery) devuelve más de 1 filaManejador desconocido de sentencia preparada (%.*s) dado para %sO la Base de datos de Ayuda está corrupta o no existeReferencia cíclica en subconsultas (subqueries)Convirtiendo la columna '%s' de %s a %sReferencia '%-.64s' no soportada (%s)Cada tabla derivada debe de tener su propio aliasLa selección %u fué reducida durante optimizaciónLa tabla '%-.192s' de uno de los SELECT no puede ser usada en %-.32sEl cliente no soporta protocolo de autenticación requerido por el servidor; considere mejorar el cliente MariaDBTodas las partes de un índice SPATIAL deben de ser NOT NULLEl COTEJO (COLLATION) '%s' no es válido para CHARACTER SET '%s'El esclavo ya está funcionandoEl esclavo ya fué paradoTamaño demasiado grande para datos descomprimidos; el máximo tamaño es %d. (probablemente, el tamaño de datos descomprimidos fué corrompido)ZLIB: No hay suficiente memoriaZLIB: No hay suficiente espacio en el búfer de salida (probablemente, el tamaño de datos descomprimidos fué corrompido)ZLIB: Dato de entrada corruptoLa fila %u ha sido cortada por %s)La fila %lu no contiene datos para todas las columnasLa fila %lu fué truncada; contenía más datos que columnas de entradaColumna puesta a valor por defecto; NULL suministrado para columna NOT NULL '%s' en la fila %luValor fuera de rango para la columna '%s' en la fila %luDatos truncados para la columna '%s' en la fila %luUsando motor de almacenaje %s para la tabla '%s'Mezcla ilegal de cotejos (collations) (%s,%s) y (%s,%s) para la operación '%s'No puedo eliminar uno o más de los usuarios solicitadosNo puedo revocar todos los privilegios para uno o más de los usuarios solicitadosMezcla ilegal de cotejos (collations) (%s,%s), (%s,%s), (%s,%s) para la operación '%s'Mezcla ilegal de cotejos (collations) para la operación '%s'La variable '%-.64s' no es un componente variable (No puede ser usada como XXXX.variable_name)Cotejo (Collation) desconocido: '%-.64s'Los parámetros SSL en CHANGE MASTER son ignorados porque este esclavo MariaDB fue compilado sin soporte SSL; pueden ser usados después cuando el esclavo MariaDB con SSL sea arrancadoEl servidor se está ejecutando en modo --secure-auth, pero '%s'@'%s' tiene una contraseña con formato antiguo; por favor cambie la contraseña al nuevo formatoEl campo o la referencia '%-.192s%s%-.192s%s%-.192s' de SELECT #%d se resolvió en SELECT #%dParámetro incorrecto o combinación de parámetros para START SLAVE UNTILSe recomienda usar --skip-slave-start al hacer réplica paso a paso con START SLAVE UNTIL; en caso contrario, obtendrá problemas si tiene lugar un rearranque inesperado del esclavo mariadbUn hilo (thread) SQL no ha de ser arrancado de esa manera HASTA que las opciones sean ignordasNombre de índice incorrecto '%-.100s'Nombre de catálogo incorrecto '%-.100s'La caché de consulta (query) ha fallado al poner el tamaño %llu; el nuevo tamaño de caché de consulta (query) es %luLa columna '%-.192s' no puede format parte de índice FULLTEXTCaché de clave desconocida '%-.100s'MariaDB ha sido arrancada en modo --skip-name-resolve; vd necesita reinicializarla sin esta opción para que esta concesión funcioneMotor de almacenaje '%s' desconocido'%s' está obsoleto y será quitado en una entrega futura, use '%s' en su lugarLa tabla destino %-.100s del %s no es actualizableLa característica '%s' fue deshabilitada; usted necesita construir MariaDB con '%s' para tener eso funcionandoEl servidor MariaDB se está ejecutando con la opción %s por lo que no se puede ejecutar esta sentenciaLa columna '%-.100s' tiene valor duplicado '%-.64s' en %sTruncado incorrecto %-.32T valor: '%-.128T'Definición incorrecta de tabla; solamente puede haber una columna TIMESTAMP con CURRENT_TIMESTAMP en DEFAULT o en cláusula ON UPDATECláusula ON UPDATE inválida para la columna '%-.192s'Este comando no se encuentra soportado para protocolo de sentencia preparada, aúnObtenido error %d '%-.200s' desde %sObtenido error temporal %d '%-.200s' desde %sZona temporal desconocida o incorrecta: '%-.64s'Valor inválido de SELLO TEMPORAL (TIMESTAMP) en la columna '%s' de la fila %luCadena de carácter %s inválida: '%.64T'El resultado de %s() ha sido mayor que max_allowed_packet (%ld) - truncadoDeclaraciones conflictivas: '%s%s' y '%s%s'No puedo crear una %s desde dentro de otra rutina almacenada%s %s ya existe%s %s no existeNo pude ELIMINAR (DROP) %s %sNo pude CREAR %s %s%s sin etiqueta coincidente: %sRedefiniendo etiqueta %sEtiqueta-Final %s sin coincidenciaRefiriéndose a variable %s sin inicializarEl PROCEDIMIENTO (PROCEDURE) %s no puede devolver un conjunto de resultados en el contexto dadoRETURN sólo se permite dentro de una FUNCIÓN%s no permitido en procedimientos almacenadosEl historial (log) de actualización se encuentra obsoleto y reemplazado por el historial (log) binario; SET SQL_LOG_UPDATE ha sido ignorado. Esta opción será quitada en MariaDB 5.6El historial (log) de actualización se encuentra obsoleto y reemplazado por el historial binario; SET SQL_LOG_UPDATE ha sido traducido a SET SQL_LOG_BIN. Esta opción será quitada en MariaDB 5.6Se ha interrumpido la ejecución de la consulta (query)Número incorrecto de argumentos para %s %s; se esperaba %u, se obtuvo %uCONDICIÓN no definida: %sNo se hallado RETURN en FUNCIÓN %sLa FUNCIÓN %s termina sin RETURNLa sentencia de cursor debe de ser un SELECTEl SELECT de cursor no debe de tener INTOCURSOR indefinido: %sCursor ya abiertoCursor no abiertoVariable sin declarar: %sIncorrecto número de variables FETCHNo hay datos - cero filas logradas, seleccionadas o procesadasParámetro duplicado: %sVariable duplicada: %sCondición duplicada: %sCursor duplicado: %sFallo en ALTER %s %sValor de Subconsulta (subquery) no soportado%s no permitido en función almacenada o en disparadorDeclaración de variable o condición tras declaración de cursor o manejadorDeclaración de cursor tras declaración de manejadorCaso no hallado para sentencia CASEEl fichero/archivo de configuración '%-.192s' es demasiado grandeCabecera de tipo de fichero/archivo malformada en fichero/archivo '%-.192s'Inesperado fin de fichero/archivo mientras se analizaba comentario '%-.200s'Error mientras se analizaba parámetro '%-.192s' (línea: '%-.192s')Inesperado fin de fichero/archivo mientras se saltaba parámetro desconocido '%-.192s'ANALYZE/EXPLAIN/SHOW no puede ser emitdo; privilegios insuficientes para tabla subyacenteEl fichero/archivo '%-.192s' es de un tipo desconocido '%-.64s' en su cabecera'%-.192s.%-.192s' no es del tipo '%s'La columna '%-.192s' no es actualiableEl SELECT de la vista contiene una subconsulta (subquery) en la cláusula FROMEl SELECT de la vista contiene una cláusula '%s'El SELECT de la vista contiene una variable o un parámetroEl SELECT de la vista se refiere a una tabla temporal '%-.192s'El SELECT de la vista y la lista de campos de la vista tienen un contador diferente de columnasEl algoritmo de fusión de la vista no se puede usar aquí por ahora (se asume algoritmo indefinido)La vista que se está actualizando no tiene clave completa de la tabla subyacente que contieneLa vista '%-.192s.%-.192s' hace referencia a tabla(s) o columna(s) o función(es) inválida(s) o al definidor/invocador de vista le faltan derechos para usarlosNo puedo eliminar o alterar una %s desde dentro de otra rutina almacenadaGOTO no permitido en manejador de procedimiento almacenadoYa existe el disparador `%s`El disparador no existeEl disparador '%-.192s' es una vista, tabla temporal o secuenciaActualizar la fila %s no está permitido en disparador %sNo hay fila %s en disparador %sEl campo '%-.192s' no tiene un valor por defectoDivisión por 0Incorrecto %-.32s valor: '%-.128T' para columna `%.192s`.`%.192s`.`%.192s` en la fila %luHallado valor ilegal %s '%-.192T' durante el análisiCHECK OPTION en vista no actualizable %`-.192s.%`-.192sCHECK OPTION falló %`-.192s.%`-.192sComando %-.32s denegado para el usuario '%s'@'%s' para rutina '%-.192s'Falló la purga de viejos historiales (logs) de reenvío: %sEl valor calculado de la contraseña debería de ser un número hexadecimal de %d-dígitosHistorial (log) de destino no hallado en índice binlogError de E/S leyendo fichero/archivo índice de historial (log)La configuración del servidor no permite purgar binlogFallo en fseek()Error fatal durante la purga del historial (log)Se encuentra en uso un historial purgable, no lo purgaréError desconocido durante la purga del historial (log)Fallo inicializando la posición del historial de reenvío: %sNo está usando historial (log) binarioLa sintaxis '%-.64s' está reservada para propósitos internos del servidor MariaDBFalló WSAStartupNo puedo manejar procedimientos con grupos diferentes, aúnLa selección debe de tener un grupo con este procedimientoNo puedo usar la cláusula ORDER con este procedimientoEl historial (log) binario y la réplica prohibe cambiar el servidor global %sNo puedo mapear fichero/archivo: %-.200s, error: %MMagia equivocada en %-.64sSentencia preparada contiene demasiados marcadores de posiciónEl tamaño de trozo de clave '%-.192s' no puede ser 0Ha fallado la suma de comprobación del texto de la vistaNo puedo modificar más de una tabla base a través de una vista de unión '%-.192s.%-.192s'No puedo insertar dentro de vista de unión '%-.192s.%-.192s' sin lista de camposNo puedo borrar desde vista de unión '%-.192s.%-.192s'Ha fallado la operación %s para %.256sXAER_NOTA: XID desconocidoXAER_INVAL: Argumentos inválidos (o comando no soportado)XAER_RMFAIL: El comando no se puede ejecutar cuando la transacción global se encuentra en estado %.64sXAER_OUTSIDE: Algún trabajo se ha realizado fuera de la transacción globalXAER_RMERR: Ha ocurrido un error fatal en la rama de la transacción - revise la consitencia de sus datosXA_RBROLLBACK: La rama de la transacción ha sido retrocedida (rolled back)No existe tal concesión definida para el usuario '%-.48s' en equipo '%-.64s' en rutina '%-.192s'Fallo al conceder privilegios de EXECUTE y ALTER ROUTINEFallo al rescindir todos los privilegios de la rutina anuladaDatos demasiado largos para la columna '%s' en la fila %luMal SQLSTATE: '%s'%s: preparada para conexiones.
Versión: '%s' conector: '%s' puerto: %d  %sNo puedo cargar valor desde fichero/archivo con filas de tamaño fijo en variableNo está autorizado a crear un usuario con GRANTIncorrecto valor %-.32s: '%-.128T' para la función %-.32sHa cambiado la definición de la tabla, por favor reintente la transacciónManejador duplicado declarado en mismo bloqueEl argumento %d OUT o INOUT para la rutina %s no es una variable o pseudo-variable NEW en disparador BEFORENo autorizado a devolver un conjunto de resultados desde un %sNo puedo obtener objeto de geometría desde los datos que vd envía al campo GEOMETRYHa fallado una rutina y no tiene ni NO SQL ni READS SQL DATA en su declaración y el historial (log) binario se encuentra activado; si han sido actualizadas tablas no transaccionales, el fichero/archivo binario de historial (log) perderá sus cambiosEsta función no tiene ninguno de DETERMINISTIC, NO SQL o READS SQL DATA en su declaración y está activado el historial binario (vd *podría* querer usar la variable menos segura log_bin_trust_function_creators)No tiene el privilegio SUPER y está activado el historial binario (*podría* querer usar la variable menos segura log_bin_trust_function_creators)No puede ejecutar una sentencia preparada que tiene abierto un cursor asociado con ella. Renueve la sentencia para re-ejecutarlaLa sentencia (%lu) no tiene cursor abiertoComisión (commit) implícita o explícita no permitida en funciones almacenadas o en disparadoresEl campo de tabla subyacente de vista '%-.192s.%-.192s' no tiene valor por defectoNo autorizadas funciones almacenadas recursivas ni disparadoresEscala %llu demasiado grande especificada para '%-.192s'. El máximo es de %uPrecisión %llu demasiado grande especificada para '%-.192s'. El máximo es de %uPara flotante(M,D), doble(M,D) o decimal(M,D), M debe de ser >= D (columna '%-.192s')No puede combinar bloqueo de escritura de tablas de sistema con otras tablas o tipos de bloqueoNo puedo conectar a fuente foránea de datos: %.64sHubo un problema procesando la consulta (query) en la fuente foránea de datos. Error de fuente de datos: %-.64sLa fuente foránea de datos que intenta referenciar no existe. Error en fuente de datos:  %-.64sNo puedo crear tabla federada. La cadena de conexión de la fuente de datos '%-.64s' no tiene el formato correctoLa cadena de conexón de la fuente de datos '%-.64s' no tiene el formato correctoNo puedo crear tabla federada. Error en fuente de datos foráneos:  %-.64sDisparador en esquema equivocadoDesbordamiento en pila de hilos (threads): %ld bytes usados de una pila de %ld y son necesarios %ld bytes. Considere el incrementar la variable de sistema --thread_stack=#.El cuerpo de rutina para '%-.100s' es demasiado largoNo puedo eliminar keycache por defectoAncho a mostrar fuera de rango para '%-.192s' (máx = %lu)XAER_DUPID: El XID ya existeFunción Datetime: %-.32s desbordamiento de campoNo puedo actualizar tabla '%-.192s' en función almacenada/disparador porque ya está siendo usada por la sentencia que invocó esta función almacenada/disparadorLa definición de la tabla '%-.192s' previene la operación %-.192s en la tabla '%-.192s'La sentencia preparada contiene una llamada a rutina almacenada que se refiere a esa misma sentencia. No está permitido ejecutar una sentencia preparada de esta manera recursivaNo permitido usar auto acometida (autocommit) desde una función almacenada o disparadorDefinidor inválidoLa vista '%-.192s'.'%-.192s' no tiene información de definidor (formato viejo de tabla). Se usa el usuario actual como definidor. Por favor, ¡recrea la vista!Vd necesita el privilegio SUPER para la creación de la vista con definidor '%-.192s'@'%-.192s'El usuario especificado como definidor ('%-.64s'@'%-.64s') no existeVd no está autorizado a cambiar el esquema de '%-.192s' a '%-.192s'No puedo borrar o actualizar una fila padre: falla una restricción de clave foránea (%s)No puedo añadir o actualizar una fila hija: falla una restricción de clave foránea (%s)La variable '%-.64s' debe de ser entrecomillada con `...` o renombradaNo hay atributo de definidor para disparador '%-.192s'.'%-.192s'. El disparador será activado bajo la autorización del invocador, el cual puede tener insuficientes privilegios. Por favor, vuelva a crear el disparador'%-.192s' tiene un formato viejo, debería vd de volver a crear el/los objeto(s) '%s'El límite recursivo %d (según se indica mediante la variable max_sp_recursion_depth) se ha excedido para la rutina %.192sNo pude cargar la rutina %-.192s (código interno %d). Para más detalles, ejecute SHOW WARNINGSNombre incorrecto de rutina '%-.192s'Es necesaria una mejora. Por favor, ¡haga "REPAIR %s %`s" o vuelque/recargue para arreglarlo!AGGREGATE no está soportado en funciones almacenadasNo puedo crear más de max_prepared_stmt_count sentencias (valor en curso: %u)`%-.192s`.`%-.192s` contiene recursividad de vista"No hay campo agrupado '%-.192s' usado en cláusula %-.64sEl motor de almacenaje %s no soporta índices SPATIALLos disparadores no pueden ser creados en las tablas del sistemaSe quitan los espacios iniciales del nombre '%s'No pude leer valor de auto-incremento del motor de almacenajenombre de usuarionombre de equipoLa cadena '%-.70T' es demasiado larga para %s (no debería de ser mayor de %d)La tabla destino %-.100s de la %s no es insertable-dentroLa tabla '%-.64s' está definida de forma diferente o es del tipo no-MyISAM o no existeDemasiado alto el nivel de anidamiento para la selecciónEl nombre '%-.64s' ha pasado a ser ''El primer carácter de la cadena de los FIELDS TERMINATED es ambiguo; por favor, use FIELDS ENCLOSED BY no opcionales y no vacíosNo se puede crear el servidor externo '%s' porque ya existeEl nombre del servidor foráneo que intenta referenciar no existe. Error en fuentes de datos:  %-.64sEl motor de almacenaje de la tabla '%-.64s' no soporta la opción de creación '%.64s'Error de sintaxis: %-.64s PARTITIONING requiere de la definición de VALUES %-.64s para cada particiónSólo %-.64s PARTITIONING puede usar VALUES %-.64s en la definición de la particiónMAXVALUE sólo se puede usar en la definición de la última particiónLas subparticiones sólo pueden ser particiones dispersas (hash) y mediante claveSe deben de definir subparticiones en todas las particiones si se está en una particiónDefinido un número equivocado de particiones, no coincide con configuración previaDefinido un número equivocado de subparticiones, no coincide con configuración previaLas expresiones constantes, al azar o dependientes de zona en función de (sub)particionado no están permitidasLas expresiones incluidas en %s deben de ser constantesCampo en la lista de campos para función de partición no hallado en tablaLista de campos sólo se permite en particiones KEYLa información de partición en el fichero/archivo frm no es consistente con lo que se puede grabar en un fichero/archivo frmLa función %-.192s devueve un tipo equivocadoPara las particiones %-.64s, se debe de definir cada particiónEl valor VALUES LESS THAN debe de ser estrictamente incremental para cada particiónEl valor VALUES debe de ser del mismo tipo que la función de particiónDefinición múltiple de la misma constante en el particionamiento de la listaEl particionado no puede ser usado de forma autónoma en consulta (query)La mezcla de manejadores en las particiones no está autorizada en esta versión de MariaDBPara el motor de particionado es necesario definir todas %-.64sDefinidas demasiadas particiones (incluyendo las subparticiones)Sólo es posible mezclar particionado RANGE/LIST con particionado HASH/KEY para el subparticionadoNo pude crear fichero/archivo de manejador específicoNo se autoriza campo BLOB en la función de particiónUn %-.192s debe de incluir todas las columnas en la función de particionado de la tablaEl número de %-.64s = 0 no es un valor autorizadoLa gestión de particiones en una tabla no particionada no es posibleLas tablas particionadas no soportan %sError en lista de particiones para %-.64sNo puedo quitar todas las particiones, use DROP TABLE en su lugarCOALESCE PARTITION sólo se puede usar en particiones HASH/KEYREORGANIZE PARTITION sólo se puede usar para reorganizar particiones no para cambiar sus númerosREORGANIZE PARTITION sin parámetros sólo se puede usar en tablas auto-particionadas usando HASH PARTITIONs%-.64s PARTITION sólo puede ser usada en particiones RANGE/LISTIntentando añadir particion(es) usando un número equivocado de subparticionesSe debe de añadir una partición, al menosSe debe de fusionar una partición, al menosHay más particiones a reorganizar que las que existenNombre de partición duplicado %-.192sNo se autoriza a apagar binlog con este comandoPara reorganizar un conjunto de particiones, éstas deben de estar ordenadas consecutivamenteEl reorganizar un rango de particiones no puede cambiar los rangos totales excepto para la última partición donde se puede extender el rangoFunción de partición no soportada en esta versión para este manejadorEl estado de una partición no se puede definir desde CREATE/ALTER TABLEEl manejador %-.64s sólo soporta enteros de 32 bit en VALUESEnchufe (plugin) '%-.192s' no cargadoIncorrecto %-.32s valor: '%-.128T'La tabla no tiene partición para valor %-.64sNo se permite especificar %s más de unva vezNo pude crear %sNo pude eliminar %sEl manejador no soporta autoextensión de espacios de tablaSe ha especificado de forma incorrecta un parámetro de medida o el número o en la forma 10MEl número de medida es correcto pero no permitimos que la parte del dígito tenga más de 2 billonesNo pude alterar: %sHa fallado el grabar una fila en historial (log) binario basado en filaLa definición de tabla en maestro (master) y esclavo no coincide: %sLa ejecución esclava con --log-slave-updates debe de usar un historial (log) binario basado en fila para que pueda replicar eventos de historial (log) binario basados en filaEl evento '%-.192s' ya existeNo pude almacenar evento %s. Código de error %M desde motor de almacenajeEvento desconocido '%-.192s'No pude alterar evento '%-.192s'No pude eliminar %sO INTERVAL no es positivo o es demasiado grandeO ENDS es inválido o anterior a STARTSEl tiempo de ejecución de evento se encuentra en el pasado. El evento ha sido desactivadoNo puede abrir mysql.eventNo se ha suministrado expresión datetimeNo lo debería vd de ver nuncaNo lo debería vd  de ver nuncaNo pude borrar el evento desde mysql.eventError durante compilación de cuerpo de eventoMismo nombre de evento viejo y nuevoDatos demasiado largos para la columna '%s'No puedo eliminar índice '%-.192s': necesario en una restricción de clave foráneaLa sintaxis '%s' está obsoleta y será quitada en MariaDB %s. Por favor, use %s en su lugarNo puede hacer bloqueo de escritura en una tabla de historial (log). Sólo es posible acceso de lecturaNo puede usar bloqueos con tablas de historial (log)Nunca debería vd de ver estoEl contador de columnas de mysql.%s está equivocado. Se esperaba %d, hallado %d. Creado con MariaDB %d, ahora ejecuando %d. Por favor, use mariadb-upgrade para solucionar este errorNo puedo conmutar fuera del formato de historial (log) binario basado en fila cuando la sesión ha abierto tablas temporalesNo puedo cambiar el formato de historial (log) binario dentro de funciones almacenadas o disparadoresNunca debería vd de ver estoNo puedo crear tabla temporal con particionesLa constante de partición está fuera del dominio de función de particiónEsta función de partición no está permitidaError en historial (log) DDLNo autorizado a usar valor NULL en VALUES LESS THANNombre incorrecto de particiónNo se pueden cambiar las característias de transacción mientras que una transacción se ecuentre en procesoALTER TABLE causa resecuenciado de auto_incremento resultando en entrada duplicada '%-.192T' para la clave '%-.192s'Error en organizador interno %dError durante arranque/parada del organizador. Código de error %MNo se puede usar el motor en tablas particionadasNo puedo activar historial (log) '%-.64s'El servidor no ha sido construido con réplica basada en filaHa fallado la decodificación de cadena base64Se prohiben sentencias de EVENT DDL cuando se encuentra presente el cuerpoNo puedo proceder porque el organizado de eventos está desactivadoSólo se permiten enteros como número aquíNo se puede usar el motor de almacenaje %s para tablas de historial (log)No puede '%s' una tabla de historial (log) cuando se encuentra activado el llevar historial (log)No puedo renombrar '%s'. Si se encuentra activo el llevar historial (log), el renombrar a/desde tabla de historial (log) debe de renombrar dos tablas: la tabla de historial (log) a una tabla archivo y otra tabla de vuelta a '%s'Contador de parámetro incorrecto en la llamada a función nativa '%-.192s'Parámetros incorrectos en la llamada a función nativa '%-.192s'Parámetros incorrectos en la llamada a función almacenada '%-.192s'Esta función '%-.192s' tiene el mismo nombre que una función nativaEntrada duplicada '%-.64T' para la clave '%-.192s'Demasiados ficheros/archivos abiertos. Por favor, ejecute el comando otra vezEl tiempo de jecución del evento se encuentra en el pasado y está configurado ON COMPLETION NOT PRESERVE. El evento fue eliminado inmediatamente tras su creaciónEl tiempo de jecución del evento se encuentra en el pasado y está configurado ON COMPLETION NOT PRESERVE. El evento no fue cambiado. Especifique un tiempo del futuroHa ocurrido un incidente %s en el maestro (master). Mensaje: %-.64sLa tabla no tiene partición para algunos valores existentesSe ha grabado una sentencia no segura en historial (log) binario usando el formato de sentencia desde BINLOG_FORMAT = STATEMENT. %sError fatal: %sFallo de lectura en historial (log) de reenvío: %sFallo de grabación en historial (log) de reenvío: %sFallo al crear %sEl comando maestro (master) %s ha fallado: %sNo es posible llevar historial (log) binario. Mensaje: %sLa vista %`s.%`s no tiene contexto de creaciónEl contexto de creación de la vista %`s.%`s es inválidoEl contexto de creación de la rutina almacenada %`s.%`s es inválidoFichero/archivo TRG estropeado para la tabla %`s.%`s`Los disparadores para la tabla %`s.%`s no tienen contexto de creaciónEl contexto de creación del disparador de la tabla %`s.%`s es inválidoEl contexto de creación del evento %`s.%`s es inválidoNo puedo abrir tabla para disparador %`s.%`sNo puedo crear rutina alnacenada %`s. Revise los avisosNunca debería vd de ver estoLa sentencia BINLOG del tipo `%s` no ha sido precedida por una sentencia de descripción de formato BINLOGSe ha detectado un evento de réplica estropeadoReferencia inválida a columna (%-.64s) en LOAD DATANo ha sido hallado historial (log) %s siendo purgadoXA_RBTIMEOUT: Rama de transacción ha sido retrocedida (rolled back): transcurrido demasiado tiempoXA_RBDEADLOCK: Rama de transacción ha dido retrocedida (rolled back): se ha detectado estancamiento (deadlock)Sentencia preparada necesita volver a ser preparadaOpción DELAYED no soportada para la tabla '%-.192s'No existe conexión maestra '%.*s'Opción <%-.64s> ignoradaNo se pueden borrar los enchufes (plugins) internosEl enchufe (plugin) está ocupado y será desinstalado cuando se apague%s variable '%s' es de sólo lectura. Use SET %s para asignar el valorEl motor de almacenaje %s no soporta retroceso (rollback) para esta sentencia. Transacción retrocedida (rolled back) y debe de ser rearrancadaDatos inesperados de latido (heartbeat) de maestro (master): %sEl valor requerido para el período de latido o es negativo o excede al máximo permitido (%u segundos)Nunca debería vd de ver estoError al analizar función de conflicto. Mensaje: %-.64sHa fallado el grabar en tabla de excepciones. Mensaje: %-.128s"El comentario para tabla '%-.64s' es demasiado largo (máx = %u)El comentario para el campo '%-.64s' es demasiado largo (máx = %u)La FUNCTION %s no existe. Revise la sección de 'Function Name Parsing and Resolution' en el Manual de ReferenciaBase de datosTablaParticiónSubparticiónTemporariaRenombradoDemasiadas transacciones concurrentes activasLos argumentos con separador No ASCII no están completamente soportadosagotado tiempo de espera de punto de sincronización de depuraciónalcanzado límite de punto de sincronización de depuraciónDuplicado elemento de información de condición '%s'Condición de aviso definida por usuario sin manejarCondición de no hallado definida por usuario sin manejarCondición de excepción definida por usuario sin manejarRESIGNAL cuando el manejador no activoSIGNAL/RESIGNAL sólo pueden usar una CONDITION definida mediante SQLSTATEDatos truncados para elemento de condición '%s'Datos demasiados largos para elemento de condición '%s'Localización (locale) desconocida: '%-.64s'La id %d del servidor requerido choca con la opción de arranque del esclavo --replicate-same-server-idCaché de consulta (query) desactivada; configura query_cache_type a ON o DEMAND para activarlaNombre de campo de partición duplicado '%-.192s'Inconsistencia en uso de listas de columna para particionarValores de columna de partición de tipo incorrectoDemasiados campos en '%-.192s'No puedo usar MAXVALUE como valor en VALUES INNo puedo tener más de un valor para este tipo de particionamiento %-.64sExpresiones de fila en VALUES IN sólo permitidas para particionamiento de columna multi-campoEl campo '%-.192s' es de un tipo no permitido para este tipo de particionadoEl tamaño total de los campos de particionado es demasiado grandeNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que ambos motores de fila-incapaz y de sentencia-incapaz están involucradosNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que BINLOG_FORMAT = ROW y al menos una tabla utiliza motor de almacenaje limitado a historiales basados en sentenciaNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que la sentencia no es segura, el motor de almacenaje está limitado a historial basado en sentencia y BINLOG_FORMAT = MIXED. %sNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que la sentencia está en un formato de fila y al menos una tabla utiliza un motor de almacenaje limitado a historial basado en sentenciaNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que BINLOG_FORMAT = STATEMENT y al menos una tabla utilizan un motor de almacenaje limitado a historial basado en fila. %sNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que la sentencia está en formato de fila y BINLOG_FORMAT = STATEMENTNo puedo ejecutar sentencia: imposible grabar historial (log) binario ya que hay más de un motor involucrado y al menos un motor usa auto-historialLa sentencia no es segura debido a usar una cláusula LIMIT. No es segura porque el conjunto incluido de filas no se puede predecirLa sentencia no es segura debido a usar una INSERT DELAYED. No es segura porque los momentos en que las filas han de insertarse no se pueden predecirLa sentencia no es segura debido a usar el historial (log) general, un historial (log) lento o tabla(s) de performance_schema. No es segura porque las tablas de sistema pueden diferir de las esclavasLa sentencia no es segura debido a invocar un disparador o una función almacenada que inserta una columna de AUTO_INCREMENT. No se puede llevar historial correcto de Los valores insertadosLa sentencia no es segura porque usa un UDF que puede no devolver el mismo valor en el esclavoLa sentencia no es segura porque usa una variable de sistema que puede tener un valor diferente en el esclavoLa sentencia no es segura porque usa una función de sistema que puede devolver un valor diferente en el esclavoLa sentencia no es segura porque accede a una tabla no transaccional tras acceder a una transaccional dentro de la misma transacción%s. Sentencia: %sLa columna %d de la tabla '%-.192s.%-.192s' no puede ser convertida desde el tipo '%-.50s' al tipo '%-.50s'No puedo crear tabla de conversión para la tabla '%-.192s.%-.192s'No puedo modificar @@session.binlog_format dentro de una transacciónLa ruta especificada para %.64T es demasiado larga'%s' está obsoleto y será quitada en una entrega futuraLa tabla nativa '%-.64s'.'%-.64s' tiene una estructura equivocadaUso inválido de performance_schemaLa tabla '%s'.'%s' fue saltada ya que su definición está siendo modificada por la sentencia DDL concurrenteNo puedo modificar @@session.binlog_direct_non_transactional_updates dentro de una transacciónNo puedo cambiar la bandera directa de binlog dentro de una función almacenada o de un disparadorUn índice SPATIAL sólo puede contener una columna de tipo geométricoEl comentario para el índice '%-.64s' es demasiado largo (máx = %lu)Se ha abortado la espera por un bloqueo debido a bloqueo exclusivo pendiente%s valor se encuentra fuera de rango '%s'Una variable de tipo basado en no entero en cláusula LIMITNo es segura la mezcla de motores de auto-historial (log) y de no auto-historial en una sentenciaLa sentencia accede a tabla no transaccional así como transaccional o tabla temporal y graba en cualquiera de ellasNo puedo modificar @@session.sql_log_bin dentro de una transacciónNo puedo cambiar sql_log_bin dentro de una función almacenada o disparadorNo pude leer desde fichero/archivo .parEl valor VALUES para la partición '%-.64s' debe de tener el tipo INTAcceso denegado para usuario: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT con IDENTIFIED WITH es ilegal porque el usuario %-.*s ya existeNo puedo truncar una tabla referenciada en una restricción de clave foránea (%.192s)El enchufe (plugin) '%s' está force_plus_permanent y no puede ser descargadoEl valor de requerimiento para el período de latido es menor de 1 milisegundo. El valor se vuelve a poner a 0, indicando que el latido será efectivamente desactivadoEl valor de requerimiento para el período de latido excede el valor de `slave_net_timeout` segundos. Un valor sensible para el período debería de ser menor que el 'tiempo agotado'Las sentencias Multi-fila requieren de más de 'max_binlog_stmt_cache_size' bytes para almacenaje.La actualización de clave primaria de o de partición no está permitida por estar la tabla actualizada como '%-.192s' y '%-.192s'Se requiere reconstrucción de la tabla. Por favor, ¡haga un "ALTER TABLE %`s FORCE" o volcado/recarga para solucionarlo!El valor de '%s' debería de ser no menor que el valor de '%s'El tamaño de índice de columna es demasiado grande. El tamaño máximo de columna es de %lu bytesEl disparador '%-.64s' tiene una error en su cuerpo: '%-.256s'El disparador desconocido tiene un error en su cuerpo: '%-.256s'El índice %s está estropeadoEl registro de historial (log) para deshacer es demasiado grandeINSERT IGNORE... SELECT es no seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son ignoradas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoINSERT... SELECT... ON DUPLICATE KEY UPDATE no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son actualizadas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoREPLACE... SELECT no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son sustituidas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoCREATE... IGNORE SELECT no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son ignoradas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoCREATE... REPLACE SELECT no es seguro porque el orden en el que las filas se recuperan por el SELECT determina qué filas (si hay alguna) son sustituidas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoUPDATE IGNORE no es seguro porque el orden en el que las filas son actualizadas determina qué filas (si hay alguna) son ignoradas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoNunca debería vd de ver estoNunca debería vd de ver estoLas sentencias que graban en una tabla con columna de auto-incremento tras seleccionar desde otra tabla no son seguras porque el orden en el que las filas son recuperadas determina qué filas (si hay alguna) serán grabadas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoCREATE TABLE... SELECT... en una tabla con columna de auto-incremento no es segura porque el orden en el que las filas son recuperadas por el SELECT determina qué filas (si hay alguna) serán insertadas. Este orden no puede ser predicho y puede diferir entre maestro (master) y esclavoINSERT... ON DUPLICATE KEY UPDATE en una tabla con más de una UNIQUE KEY no es seguraNunca debería vd de ver estoNot allowed for system-versioned table %`s.%`sINSERT dentro de campo con autoincremento que no es la primera parte en la clave primaria compuesta no es seguroNo puedo cargar desde %s.%s. La tabla está probablemente estropeadaEl valor requerido %lu para retraso en maestro (master) excede el máximo de %luSólo se permiten Format_description_log_event y eventos de fila en sentencias BINLOG (pero %s fue suministrado)Atributo no coincidente '%-.64s' entre la partición y la tablaLa tabla para intercambiar con la partición está particionada: '%-.64s'La tabla para intercambiar con la partición es temporal: '%-.64s'La tabla subparticionada utiliza subpartición en lugar de particiónPartición desconocida '%-.64s' en la tabla '%-.64s'Las tablas tienen diferentes definicionesHallada una fila que no coincide con la particiónLa opción binlog_cache_size (%lu) es mayor que max_binlog_cache_size (%lu); configurando binlog_cache_size igual a max_binlog_cache_sizeNo puedo usar acceso %-.64s en índice '%-.64s' debido al tipo o conversión de cotejo en campo '%-.64s'La tabla para intercambiar con la partición tiene referencias a clave foránea: '%-.64s'Valor de clave '%-.192s' no hallado en la tabla '%-.192s.%-.192s'Valor demasiado largo para '%s'Ha fallado la verificación de la suma de revisión de evento de réplica mientras se leía desde la redHa fallado la verificación de la suma de revisión de evento de réplica mientras se leía desde fichero/archivo de historial (log)La opción binlog_stmt_cache_size (%lu) es mayor que max_binlog_stmt_cache_size (%lu); configurando binlog_stmt_cache_size igual a max_binlog_stmt_cache_sizeNo puedo actualizar tabla '%-.192s' mientras '%-.192s' está siendo creadaCláusula PARTITION () en tabla no particionadaHallada una fila que no coincide con el conjunto dado de particiónNunca debería vd de ver estoFallo mientras cambiaba el tipo de repositorio de réplica: %sLa creación de algunas tablas temporales no se pudo retroceder (ROLLBACK)Algunas tablas temporales fueron eliminadas, pero estas operaciones no se pudieron retroceder (ROLLBACK)%s no se soporta en modo esclavo multi-hilo (thread). %sEl núermo de bases de datos modificadas excede el máximo de %d; los nombres de base de datos no serán incluidos en los metadatos de eventos de réplicaNo puedo ejecutar el grupo de eventos actual en modo paralelo. Encontrado evento %s, nombre de historial (log) de reenvío %s, posición %s que previene la ejecución de este grupo de eventos en modo paralelo. Motivo: %s%sEl índice FULLTEXT no está soportado para tablas particionadasNúmero inválido de condiciónEnviar contraseñas en texto plano sin SSL/TLS es extremadamente inseguroAlmacenar nombre de usuario de MariaDB o información de contraseña en el repositorio master.info no es seguro y por ello no se recomienda. Por favor, mira el manual de MariaDB para saber más acerca de este asunto y sus posibles alternativasLa restricción de clave foránea para tabla '%.192s', registro '%-.192s' llevaría a una entrada duplicada en la tabla '%.192s', clave '%.192s'La restricción de clave foránea para tabla '%.192s', registro '%-.192s' llevaría a una entrada duplicada en una tabla hijaConfigurar opciones de autenticación no es posible si sólo se ha arrancado el Hilo (thread) SQL EsclavoLa tabla no tiene índice FULLTEXT que soporte esta consulta (query)La variable de sistema %.200s no se puede poner en funciones almacenadas o disparadoresLa variable de sistema %.200s no se puede poner si hay una transacción en cursoLa variable de sistema @@SESSION.GTID_NEXT tiene el valor %.200s, el cual no está listado en @@SESSION.GTID_NEXT_LISTCuando @@SESSION.GTID_NEXT_LIST == NULL, la variable de sistema @@SESSION.GTID_NEXT no puede cambiar dentro de una transacciónLa sentencia 'SET %.200s' no puede invocar una función almacenadaLa variable de sistema @@SESSION.GTID_NEXT no puede ser 'AUTOMATIC' si la @@SESSION.GTID_NEXT_LIST es no-NULLSaltando transacción %.200s porque ya ha sido ejecutada y puesta en historial (log)GTID malformado pone especificación '%.200s'GTID malformado pone codificaciónGTID malformado especificación '%.200s'Imposible generar Identificador Global de Transacción: el componente entero alcanzó el máximo valor. Rearranque el servidor con un nuevo server_uuidLos parámetros MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE y RELAY_LOG_POS no pueden ser puestos cuando MASTER_AUTO_POSITION esté activoCHANGE MASTER TO MASTER_AUTO_POSITION = 1 sólo se puede ejecutar cuando GTID_MODE = ONNo puedo ejecutar sentencias con acometidas (commit) implícitas dentro de una transacción cuando GTID_NEXT != AUTOMATIC o GTID_NEXT_LIST != NULLGTID_MODE = ON o GTID_MODE = UPGRADE_STEP_2 requiere que ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON o UPGRADE_STEP_1 o UPGRADE_STEP_2 requiere --log-bin y --log-slave-updatesGTID_NEXT no se puede poner a UUID:NUMBER cuando GTID_MODE = OFFGTID_NEXT no se puede poner como ANONYMOUS cuando GTID_MODE = ONGTID_NEXT_LIST no se puede poner como valor no-NULL cuando GTID_MODE = OFFHallado un Gtid_log_event o Previous_gtids_log_event cuando GTID_MODE = OFFCuando ENFORCE_GTID_CONSISTENCY = 1, las actualiaciones a tablas no transaccionales sólo se puede hacer o bien en sentencias autoacometidas o en transacciones de sentencias simples y nunca dentro de la misma sentencia como actualizaciones a tablas transaccionalesCREATE TABLE ... SELECT está prohibido si ENFORCE_GTID_CONSISTENCY = 1Cuando ENFORCE_GTID_CONSISTENCY = 1, las sentencias CREATE TEMPORARY TABLE y DROP TEMPORARY TABLE pueden ser ejecutadas sólo en contextos no-transaccionales y requieren que AUTOCOMMIT = 1El valor de GTID_MODE sólo puede cambiar un paso a la vez: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. También ten en cuenta que este valor debe de ser aumentado y disminuido simultaneamente en todos los servidores; mira el Manual para instrucciones.El esclavo se está conectando usando CHANGE MASTER TO MASTER_AUTO_POSITION = 1, pero el maestro (master) ha purgado los historiales (logs) binarios que contienen GTIDs requeridos por el esclavoGTID_NEXT no se puede cambiar por un cliente que posee un GTID. El cliente posee %s. La propiedad se libera con COMMIT o ROLLBACKNombre de formato %s desconocido: '%s'No puedo ejecutar sentencia en una transacción READ ONLYEl comentario para partición de tabla '%-.64s' es demasido largo (máx = %lu)El esclavo no está configurado o falló al inicializarse de forma adecuada. Vd debe de poner al menos --server-id para activar o bien un maestro (master) o un esclavo. Mensajes de error adicionales pueden ser hallados en historial (log) de errores de MariaDBActualmente InnoDB soporta la creación de un índice FULLTEXT a la vezNo puedo crear índice FULLTEXT en tabla temporaria InnoDBLa columna '%-.192s' es de tipo equivocado para un índice InnoDB FULLTEXTEl índice '%-.192s' es de tipo equivocado para un índice InnoDB FULLTEXTLa creación de índice '%-.192s' requirió más de 'innodb_online_alter_log_max_size' bytes de historial (log) de modificaciones. Por favor, pruebe otra vezALGORITHM desconocido '%s'Tipo de LOCK desconocido '%s'CHANGE MASTER no se puede ejecutar cuando se ha parado el esclavo con un error o matado en modo MTS. Considere el usar RESET SLAVE o START SLAVE UNTILNo puedo recuperar después de que SLAVE diera error en modo paralelo de ejecución. Mensajes de error adicionales se pueden hallar en el historial (log) de error de MariaDBNo puedo limpiar tablas de información de trabajador. Mensajes de error adicionales se pueden hallar en el historial (log) de error de MariaDBEl contador de columnas %s.%s está equivocado. Se esperaba %d, hallado %d. La tabla está probablemente estropeadaEl esclavo debe de reintentar silenciosamente la transacción en cursoNunca debería vd de ver estoEsquema no coincide (%s)Tabla %-.192s en espacio de tablas del sitemaError de Lectura de E/S: (%lu, %s) %sError de Escritura de E/S: (%lu, %s) %sEspacio de tabla falta para la tabla '%-.192s'Existe Espacio de tabla para la tabla '%-.192s'. Por favor, haga DISCARD del espacio de tabla antes de hacer IMPORTEl espacio de tabla ha sido descartado para la tabla %`sError interno: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE ha fallado con error %lu : '%s'Índice corrupto: %sEl tipo de columna YEAR(%lu) está obsoleto. Creando columna YEAR(4) en su lugarYour password does not satisfy the current policy requirements (%s)Debe vd de poner SET PASSWORD antes de ejecutar esta sentenciaNo pude añadir la restricción de clave foránea. Falta índice para restricción '%s' en la tabla foránea '%s'No pude añadir la restricción de clave foránea. Falta índice para restricción '%s' en la tabla referenciada '%s'No pude añadir la restricción de clave foránea '%s' a las tablas del sistemaNo pude abrir la tabla referenciada '%s'No pude añadir restricción de clave foránea en la tabla '%s'. Opciones incorrectas en restricción FOREIGN KEY '%s'Duplicada restricción %s llamada '%s'El cálculo de contraseña no tiene el formato esperado. Revise si se está usando el algoritmo correcto de contraseña con la función PASSWORD()No puedo eliminar la columna '%-.192s': necesaria en restricción de clave foránea '%-.192s'No puedo eliminar la columna '%-.192s': necesaria en restriccón de clave foránea '%-.192s' de la tabla %-.192sLa columna '%-.192s' no puede ser NOT NULL: necesaria en restricción de clave foránea '%-.192s' SET NULLÍndice duplicado %`s. Éste está obsoleto y será quitado en entregas futurasNo puedo cambiar la columna '%-.192s': usada en una restricción de clave foránea '%-.192s'No puedo cambiar la columna '%-.192s': usada en restricción de clave foránea '%-.192s' de la tabla '%-.192s'No puedo borrar filas de la tabla que es padre en restricción de clave foránea '%-.192s' de la tabla '%-.192s'Paquete de comunicación malformadoEjecutando em modo sólo-lecturaCuando GTID_NEXT se pone a GTID, debe vd de ponerlo de nuevo de forma explícita tras un COMMIT o ROLLBACK. Si vd ve este mensaje de error en el hilo (thread) de SQL esclavo, indica que una tabla de la transacción en curso es transaccional en el maestro (master) y no transaccional en el esclavo. En una conexión cliente, indica que has ejecutado SET GTID_NEXT antes de una transacción y has olvidado poner GTID_NEXT a un identificador diferente o a 'AUTOMATIC' tras COMMIT o ROLLBACK. El GTID_NEXT actual es '%s'La variable de sistema %.200s no se puede poner en procedimentos almacenadosGTID_PURGED sólo se puede usar cuando GTID_MODE = ONGTID_PURGED sólo se puede poner cuando GTID_EXECUTED está vacíoGTID_PURGED sólo se puede poner cuando no hay trasacciones en curso (ni incluso en otros clientes)GTID_PURGED se cambió de '%s' a '%s'GTID_EXECUTED se cambió de '%s' a '%s'No puedo ejecutar sentencia: imposible escribir en historial (log) binario desde BINLOG_FORMAT = STATEMENT y en tablas replicadas y no replicadas%s no está soportado para esta operación. Pruebe %s%s no está soportado. Motivo: %s. Pruebe %sEl algoritmo de COPY requiere de un bloqueoLas operaciones específicas de partición aún no soportan LOCK/ALGORITHMLas columnas que participan en una clave foránea son renombradasNo puedo cambiar el tipo de la columnaEl añadir claves foráneas necesita de foreign_key_checks=OFFEl crear ídices únicos con IGNORE requiere del algoritmo COPY para quitar filas duplicadasEliminar una clave primaria no está permitido sin añadir también una nueva clave primariaPara añadir una columna auto-incrementable se requiere de un bloqueoNo puedo reemplazar FTS_DOC_ID oculta con una visible-por-usuarioNo puedo eliminar o renombrar FTS_DOC_IDLa creación de un índice Fulltext requiere de un bloqueosql_slave_skip_counter no se puede poner cuando el servidor se ejecuta con GTID_MODE = ON. En su lugar, para cada transacción que desees saltar, genera una transacción vacía con el mismo GTID que la transacciónEntrada duplicada para la clave '%-.192s'Nombre largo de base de datos e identificador para objeto resultó en que el tamaño de la ruta excedió de %d caracteres. Ruta: '%s'no puedo convertir NULL a DEFAULT no-constanteSu contraseña ha expirado. Para ingresar, vd debe de cambiarla usando un cliente que soporte contraseñas expiradasHallada una fila en partición equivocada %sNo puedo organizar evento %s, nombre de historial (log)-reenvío %s, posiciona %s a hilo (thread) de Trabajador porque su tamaño %lu excede %lu de slave_pending_jobs_size_maxNo puedo CREATE FULLTEXT INDEX WITH PARSER en tabla InnoDBEl fichero/archivo de historial (log) binario '%s' está lógicamente corrupto: %sel fchero %s no se ha purgado porque estaba siendo leído por hilo(s) (thread) %d, purgado sólo %d de %d ficheros/archivosel fichero/archivo %s no fue purgado porque es el fichero/archivo activo de historial (log)Valor de Auto-incremento en UPDATE está en conflicto con valores generados internamenteLos eventos de fila no son puestos en historial (log) para sentencias %s que modifican tablas BLACKHOLE en formato de fila. Tabla(s): '%-.192s'El esclavo falló al inicializar información de estructura del maestro (master) desde el repositorioEl esclavo falló al inicializar estructura de información de historial (log) de reenvío desde el repositorioAcceso denegado intentando cambiar a usuario '%-.48s'@'%-.64s' (usando contraseña: %s). DesconectandoInnoDB está en modo de sólo lecturaLa ejecución del comando STOP SLAVE está incompleta: El hilo (thread) de SQL esclavo recibió la señal de parada, hilo (thread) ocupado, el hilo (thread) SQL se parará una vez que se complete la tarea actualLa ejecución del comando STOP SLAVE está incompleta: El hilo (thread) de E/S esclavo recibió la señal de parada, hilo (thread) ocupado, el hilo (thread) de E/S se parará una vez que se complete la tarea actualLa operación no se puede realizar. Falta la tabla '%-.64s.%-.64s', está corrupta o contiene datos malosFallo al escribir fichero/archivo temporalFalló la mejora de nombre de índice. Por favor, use una copia del algoritmo de create index(alter table) para reconstruir el índice"You should never see itLa Función o expresión '%s' no se puede usar en la cláusula %s de %`sYou should never see itLa clave primaria no se puede definir sobre una columna generadaKey/Index no se puede definir en una columna virtual generadaNo puedo definir clave foránea con cláusula %s en una columna generadaEl valor especificado para columna generada '%s' en la tabla '%s' ha sido ignoradoEsto no está aún soportado para columnas generadasYou should never see itYou should never see itEl motor de almacenaje %s no soporta columnas generadasOpción desconocida '%-.64s'Valor incorrecto '%-.64T' para opción '%-.64s'Nunca debería vd de ver estoNunca debería vd de ver estoNunca debería vd de ver estoObtenido desbordamiento al convertir '%-.128s' a %-.32s. Valor truncadoValor truncado '%-.128s' al convertir a %-.32sEncontrado valor ilegal '%-.128s' al convertir a %-.32sEncontrado formato ilegal de cadena en columna dinámicaAlcanzado límite de implementación de columna dinámicaValor ilegal usado como argumento de función de columna dinámicaColumna dinámica contiene conjunto desconocido de caracteresAl menos una de las banderas de optimizer_switch 'in_to_exists' o 'materialization' debe de estar a 'on'Caché de consulta (query) desactivada (el comando ajustar o similar está en proceso); repite este comando más tardeLa caché de consulta (query) está desactivada de forma global y no puede activarla sólo para esta sesiónCláusula de vista '%-.192s'.'%-.192s' ORDER BY ignorada porque ya hay otra clásula ORDER BYLa conexión fue matadaNunca debería vd de ver estoNo puedo modificar @@session.skip_replication dentro de una transacciónNo puedo modificar @@session.skip_replication dentro de una función almacenada o disparadorQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteLa tabla '%-.192s.%-.192s' no existe en el motorEl objetivo no está ejecutando un comando EXPLAINableLa conexión '%.*s' está en conflicto con la conexión existente '%.*s'Maestro (master) '%.*s': No puedo %s ESCLAVO '%.*s'ESCLAVO '%.*s' arrancadoESCLAVO '%.*s' paradoEl motor %s no pudo descubr la tabla %`-.192s.%`-.192s con '%s'Fallo inicializando estado de réplica GTIDNo pude analizar la lista GTIDNo pude actualizar estado gtid de esclavo de réplicaConflicto GTID %u-%u-%llu y %u-%u-%llu (duplicado id de dominio %u)No pude abrir %s.%sSe ha requerido que conectar esclavo arranque desde GTID %u-%u-%llu, el cual no está en el binlog del maestro (master)No pude cargar posición GTID de esclavo de réplica desde la tabla %s.%sEl especificado GTID %u-%u-%llu está en conflicto con el historial (log) binario el cual contiene un más reciente GTID %u-%u-%llu. Si se usa MASTER_GTID_POS=CURRENT_POS, la posición de binlog sobreescribirá el nuevo valor de @@gtid_slave_posEl valor especificado para @@gtid_slave_pos no contiene valor para dominio de réplica %u. Esto está en conflicto con el historial (log) binario el cual contiene un GTID %u-%u-%llu. Si se usa MASTER_GTID_POS=CURRENT_POS, la posición binlog sobreescribirá el nuevo valor de @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requiere que esclavo esté usando GTIDSe ha intentado hacer binlog de GTID %u-%u-%llu lo cual crearía un número de secuencia fuera de orden con el existente GTID %u-%u-%llu y está activado gtid en modo estrictoAl binlog del maestro (master) le falta el GTID %u-%u-%llu requerido por el esclavo (incluso aunque existe un número posterior de secuencia) y está activado GTID en modo estrictoSe ha recibido un GTID inesperado desde el maestro (master) tras reconectar. Esto indica normalmente que el servidor maestro (master) ha sido reemplazado sin rearrancar los hilos (threads) del esclavo. %sNo puedo modificar @@session.gtid_domain_id o @@session.gtid_seq_no dentro de una transacciónNo puedo modificar @@session.gtid_domain_id o @@session.gtid_seq_no dentro de una función almacenada o de un disparadorSe ha requerido arrancar la conexión a esclavo desde GTID %u-%u-%llu, el cual no está en el binlog del maestro (master). Ya que el binlog del maestro (master) contiene GTIDs con números mayores de secuencia, es probable que indique que el esclavo diverge debido a ejecutar transacciones extra erróneasEsta operación no está permitida si cualquier GTID ha sido puesto en historial (log) binario. Ejecuta primero RESET MASTER para borrar el historial (log)Id desconocido de consulta (query): %lldDatos base64 malos en posición %uEspecificación inválida de rol %`sEl usuario en curso no es válidoNo puedo conceder rol '%s' a: %sNo puedo revocar rol '%s' desde: %sNo puedo cambiar @@slave_parallel_threads mientras otro cambio esté en procesoHa fallado la acometida (commit) debido a un fallo previo en acometida (commit) de la que depende ésta'%-.192s' es una vistaAl usar réplica paralela y GTID con múltiples dominios de réplica, no se puede usar @@sql_slave_skip_counter. En su lugar, poner @@gtid_slave_pos de forma explícita se puede usar para saltar tras una posición GTID dadaLa definición para la tabla %`s es demasiado largaYa instalado el enchufe (plugin) '%-.192s'S%s no soporta subconsultas (subqueries) o funciones almacenadasLa variable del sistema %.200s no se puede poner en SET STATEMENT.Nunca debería vd de ver estoNo puedo crear usuario '%-.64s'@'%-.64s'; ya existeNo puedo eliminar usuario '%-.64s'@'%-.64s'; no existeNo puedo crear rol '%-.64s'; ya existeNo puedo eliminar rol '%-.64s'; no existeNo puedo convertir '%s' carácter 0x%-.64s a '%s'Valor por defecto incorrecto '%-.128T' para columna '%.192s'No eres el propietario de la consulta (query) %lldNo se han recolectado estadísticas independientes del motor para la columna '%s'La función de agregación '%-.192s)' del SELECT #%d pertenece a SELECT #%d<%-.64s> opción ignorada para partición InnoDBEl fichero/archivo %s está corruptoConsulta (query) completada de forma parcial en el maestro (master) (error en maestro (master): %d) y se ha abortado. Existe una posibilidad de que su maestro (master) esté inconsitente en este punto. Si está seguro de que su maestro (master) está ok, ejecute esta consulta (query) de forma manual en el esclavo y luego rearranque el esclavo mediante SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Consulta (query):'%s'La consulta (query) ha ocasionado diferentes errores en el maestro (master) y en el esclavo. Error en maestro (master): mensaje (formato)='%s' código de error=%d; Error en esclavo: mensaje actual='%s', código de error=%d. Base de datos por defecto:'%s'. Consulta (query):'%s'El motor de almacenaje para la tabla '%s'.'%s' no ha sido cargado.GET STACKED DIAGNOSTICS cuando el manejador no está activo%s ya no está soportada. Se ha convertido la sentencia a %s.La sentencia no es segura porque usa un enchufe (plugin) analizador de fulltext que puede que no devuelva el mismo valor en el esclavo.No puedo DISCARD/IMPORT espacio de tabla asociado con tabla temporalLa cascada borrar/actualizar en clave foránea excede la máxima profundidad de %d.El contador de columna de %s.%s está equivocado. Se esperaba %d, hallado %d, Creado con MariaDB %d, ahora ejecutando %d. Por favor, use mariadb-upgrade para arreglar este error.El disparador %s.%s.%s no tiene el atributo CREATED.El disparador referenciado '%s' para el momento dado de acción y el tipo de evento no existe.El comando EXPLAIN FOR CONNECTION sólo se soporta para SELECT/UPDATE/INSERT/DELETE/REPLACETamaño inválido para columna '%-.192s'.El motor hallado de almacenaje de tabla '%-.64s' requería de la opción de crear que faltaMemoria agotada en motor de almacenaje '%-.64s'.La contraseña para usuario anónimo no puede expirar.Esta operación no se puede realizar con hilo (thread) sql esclavo en ejecución; ejecuta STOP SLAVE SQL_THREAD primeroNo puedo crear índice FULLTEXT en subconsulta (subquery) materializadaError de Historial (log) de Deshacer: %sArgumento inválido para logaritmoEsta operación no se puede realizar con un hilo (thread) de e/s de esclavo en ejecución; ejecuta STOP SLAVE IO_THREAD FOR CHANNEL '%s' primero.Esta operación puede no ser segura cuando el esclavo tenga tablas temporales. Las tablas serán mantenidas abiertas hasta que el servidor rearranque o hasta que las tablas sean borradas por cualquier sentencia DROP replicada. Se sugiere esperar hasta slave_open_temp_tables = 0.CHANGE MASTER TO mediante una cláusula MASTER_LOG_FILE pero sin existir cláusula MASTER_LOG_POS puede no ser seguro. El valor viejo de la posición puede no ser válido para el nuevo fichero/archivo binario de historial (log).You should never see itSelect no es una sentencia de sólo lectura, desactivando cronómetroEntrada duplicada '%-.192s'.El modo '%s' ya no tiene efecto alguno. Use STRICT_ALL_TABLES o STRICT_TRANS_TABLES en su lugarLa expresión #%u de ORDER BY contiene función de agregación y se aplica a UNIONLa expresión #%u de ORDER BY contiene función de agregación y se aplica al resultado de una consulta (query) no agregadaEl trabajador esclavo se ha parado tras al menos encontrar un error en trabajador previo cuando slave-preserve-commit-order fue activado. Para preserver el orden de acometida (commit), la última transacción ejecutada por este hilo (thread) no se ha acometido (commit). Al rearrancar el esclavo tras arreglar cualquier hilo (thread) fallido, vd debería de arreglar este trabajador tambiénslave_preserve_commit_order no está soportado %s.El servidor se encuentra actualmente en modo fuera de líneaLa función binaria de geomertía %s ha dado dos geometrías de diferente srids: %u y %u, que deberían de haber sido idénticasLlamando a función de geometría %s con tipos de argumento no soportados.Ha ocurrido un error GIS desconocido en función %s.Excepción desconocida capturada en función GIS %s.Suministrados datos GIS inválidos a función %s.La geometría no tiene datos en función %s.Imposible calcular centroid porque la geometría está vacía en la función %s.Error de cálculo de superposición de geometría: el dato de geometría es inválido en la función %s.Error de cálculo de información devuelto: los datos de geometría son inválidos en la función %s.Los procedimientos de análisis de puntos de intersección se interrumpieron inesperadamente en la función %s.Excepción desconocida lanzada en la función %s.Error en adjudicación de memoria: %-.256s en la función %s.Error en dominio: %-.256s en función %s.Error de tamaño: %-.256s en función %s.Error de argumento inválido: %-.256s en función %s.Error de fuera de rango: %-.256s en función %s.Error de desbordamiento: %-.256s en función %s.Error de rango: %-.256s en función %s.Error de refreno (underflow): %-.256s en la función %s.Error lógico: %-.256s en la función %s.Error en tiempo de ejecución: %-.256s en la función %s.Excepción desconocida: %-.384s en la función %s.La cadena de byte en Geometría debe de ser 'little endian'.La contraseña suministrada para el usuario de réplica excede el tamaño máximo de 32 caracteresNombre de bloqueo incorrecto a nivel de usuario '%-.192s'.Hallado estancamiento (deadlock) al intentar obtener bloqueo a nivel de usuario; intente retroceder (roll back) bloqueos de transacción/entrega y rearranque la adquisición de bloqueo.REPLACE no se puede ejecutar ya que requiere borrar filas que no están en la vistaNo soporta operación en línea en tabla con índice GISEste error nunca ocurreEste error nunca ocurreLa lista de columnas de WITH y lista de campos de SELECT tienen diferentes contadores de columnaDemasiados elementos WITH en cláusua WITHNombre de consulta (query) %`-.64s duplicada en cláusula WITHNo hay anclajes para elemento WITH recursivo '%s'Recursión mutua inaceptable con tabla anclada '%s'Referencia recursiva con WITH tabla '%s' en derivada materializadaRestrictions imposed on recursive definitions are violated for table '%s'Especificación de ventana con nombre '%s' no definidaMúltiples especificaciones de ventana con el mismo nombre '%s'La especificación de ventana que referencia a otra '%s' no puede contener una lista de particiónLa especificación de ventana referenciada '%s' ya contiene lista de ordenLa especificación referenciada de ventana '%s' no puede contener marco de ventanaCombinación inaceptable de especificaciones ligadas a marco de ventanaLa función de ventana sólo se permite en lista SELECT y en cláusula ORDER BYLa función de ventana no está permitida en especificación de ventanaEl marco de ventana no está permitido con '%s'No exite lista de orden en especificación de ventana para '%s'El marco tipo-RANGE requiere de la cláusula ORDER BY con clave única de clasificaciónSe requiere de un entero para marco tipo-ROWSSe requiere de tipo de dato numérico para marco tipo-RANGENo se seporta aún la exclusión del marcoEsta función de ventana puede no tener un marco de ventanaEl argumento de NTILE debe de ser mayor de 0No se cumple la RESTRICCIÓN %`s para %`-.192s.%`-.192sLa expresión en la cláusula %s es demasiado grandeObtenido error evaluando expresión almacenada %sObtenido un error al calcular valor por defecto para %`sLa expresión para campo %`-.64s se refiere a un campo sin inicializar %`sSólo se permite una partición DEFAULTNo existe disparador referenciado '%s' para el momento dado de acción y para el tipo de eventoEl valor por defecto/ignorado no está soportado para tal utilización de parámetroSólo la réplica basada en fila es soportada para operaciones enormesHa fallado la descompresión del binlog comprimidoCadena JSON rota en argumento %d para función '%s' en posición %dCarácter no permitido en JSON en argumento %d para función '%s' en la posición %dFin inesperado de texto JSON en argumento %d a función '%s'Error de sintaxis en texto JSON en argumento %d a función '%s' en la posición %dIncorrecta escapatoria en texto JSON en argumento %d a función '%s' en la posicón %dEl límite de %d en profundidad de estructuras JSON anidadas se ha alcanzado en argumento %d a función '%s' en la posición %dFin inesperado de ruta JSON en argumento %d a función '%s'Error de sintaxis en ruta JSON en argumento %d a función '%s' en la posición %dEl límite de %d en profundidad de ruta JSON se ha alcanzado en argumento %d a función '%s' en la posición %dComodines en ruta JSON no permitidos en argumento %d a función '%s'La ruta JSON debería de terminar con identificador de arreglo en argumento %d a función '%s'El argumento 2 a función '%s' debe de ser "one" o "all".InnoDB rechaza grabar en tablas con ROW_FORMAT=COMPRESSED o KEY_BLOCK_SIZE.Especficado formato GeoJSON incorrecto para función st_geomfromgeojson.Formato GeoJSON incorrecto - demasiados pocos puntos especificados para linestring.Formato GeoJSON incorrect - polígono no cerrado.La expresión de ruta '$' no está permitida en argumento %d a función '%s'.Un esclavo con el mismo server_uuid/server_id que este esclavo se ha conectado al maestro (master)Retrospectiva no soporta %s %sClaves desordenadas durante carga enormeLa carga enorme de filas se superpone con filas existentesNo puedo ejecutar actualizaciones en maestro (master) con binlog_format != ROW.MyRocks soporta sólo niveles de aislamiento READ COMMITTED y REPEATABLE READ. Por favor, cambie desde nivel de aislamiento actual %sAl desactivar chequeo de único en MyRocks, las sentencias INSERT, UPDATE, LOAD con cláusulas que actualizan o reemplazan la clave (p.ej. INSERT ON DUPLICATE KEY UPDATE, REPLACE) no se permiten. Consulte (query): %sNo puedo ejecutar actualizaciones cuando has iniciado una transacción mediante START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.Esta transacción se ha retrocedido (rolled back) y no puede ser acometida (commit). La única operación soportada es retroceder (roll back), de tal forma que se descartarán todos los cambios pendientes. Por favor, rearranque otra transacción.MyRocks en este momento no soporta ROLLBACK TO SAVEPOINT si se están modificando filas.Sólo el nivel de aislamiento REPEATABLE READ se soporta para START TRANSACTION WITH CONSISTENT SNAPSHOT en Motor de Almacenaje RocksDB.Cotejo (collation) no soportado en columna indizada de cadena %s.%s Use cotejo binario (%s).La tabla '%s' no existe, pero existe información de metadatos dentro de MyRocks. Esto es una señal de datos inconsistentes. Por favor, revise si existe '%s.frm' e intente restaurarla si no existe.La familia de columna ('%s') bandera (%d) es diferente de una bandera existente (%d). Asigne una nueva bandera CF o no cambie la bandera CF.La duración de TTL (%s) en MyRocks debe de ser un entero sin signo no-null de 64-bit.Recibido error de estado %d desde RocksDB: %s%s, Recibido error de estado %d desde RocksDB: %sEl soporte TTL está desactivado en este momento cuando la tabla tiene una PK oculta.La columna TTL (%s) en MyRocks debe de ser un entero sin signo no-null de 64-bit, debe de existir dentro de la tabla y debe de tener una duración ttl acompañante.La opcion de familia de columna por-índice está obsoletaMyRocks no pudo crear nuevas definiciones de clave durante 'alter'.MyRocks falló al poblar clave secundaria duante el 'alter'.Las funciones de ventana no se pueden usar como argumentos para agrupar funciones.Paquete OK demasiado grandeFormato GeoJSON incorrecto - arreglo vacío de coordenadas.MyRocks no soporta en la actualidad cotejos con atributo "No pad".Tipos de datos de parámetro ilegales %s y %s para operación '%s'Tipo de dato %s de parámetro ilegal para operación '%s'Contador incorrecto de parámetro para cursor '%-.192s'Variable de sistema con estructura desconocida o variable de rutina ROW '%-.*s'La variable de fila '%-.192s' no tiene un campo '%-.192s'Identificador END '%-.192s' no coincide con '%-.192s'La secuencia '%-.64s.%-.64s' se ha agotadoLa secuencia '%-.64s.%-.64s' tiene un valor fuera de rango para las opcionesLa estuctura de tabla de secuencia '%-.64s.%-.64s' es inválida (%s)Error en acceso a secuencia '%-.64s.%-.64s'Las secuencias requieren binlog_format mixto o fila'%-.64s.%-.64s' no es una SECUENCIA'%-.192s' no es una SECUENCIASECUENCIA desconocida: '%-.300s'VISTA desconocida: '%-.300s'INSERT equivocado dentro de SEQUENCE. Uno sólo puede hacer INSERT único en tabla dentro de un objeto de secuencia (como con volcado-mariadb). Si desea cambiar la SECUENCIA, use ALTER SEQUENCE en su lugar.En la línea %u en %sLa subrutina '%-.192s' está declarada en la especificación del paquete pero no está definida en el cuerpo del paqueteLa subrutina '%-.192s' tiene una declaración adelantada pero no está definidaUna columna comprimida '%-.192s' no se puede usar en especificación de claveMétodo de compresión desconocido: %sEl constructor del valor de tabla usado tiene un número diferente de valoresLa referencia a campo '%-.192s' no se puede usar en constructor de valor de tablaSe requiere de tipo de dato numérico para función %sEl argumento de la función %s no es una constante para una particiónEl argumento de la función %s no pertenece al rango [0,1]La función %s sólo acepta argumentos que se puedan convertir a tipos numéricosInstrucción específica de agregación (FETCH GROUP NEXT ROW) usada en contexto equivocadoFalta instrucción específica de agregación (FETCH GROUP NEXT ROW) de la función de agregaciónEl límite sólo acepta valores enterosUna columna invisible %`s debe de tener valor por defectoFilas coincidentes: %ld Cambiadas: %ld Insertadas: %ld Avisos: %ld%`s debe de ser del tipo %s para tabla versionada del sistema %`sNo se soporta versionado de sistema de transacción precisa para %`sNunca debería vd de ver estoTipo de partición equivocada, tipo esperado: %`sTabla versionada %`s.%`s: última partición HISTORY (%`s) fuera de %s, necesita de más particiones HISTORYParámetros que quizás faltan: %sSólo se pueden eliminar viejas particiones al rotar mediante INTERVALNunca debería vd de ver estoLa partición %`s contiene datos no históricosNo permitido para versionado del sistema %`s.%`s. Cambie @@system_versioning_alter_history para proceder con ALTER.No permitido para versionado del sistema %`s.%`s. Cambio a/desde motor de versionado nativo no soportado.Selector de rango SYSTEM_TIME no permitidoCláusulas conflictivas FOR SYSTEM_TIME en WITH RECURSIVELa tabla %`s debe de tener al menos una columna versionadaLa tabla %`s no es versionada del sistemaParámetros equivocados para %`s: falta '%s'PERIOD FOR SYSTEM_TIME debe de usar columnas %`s y %`sParámetros equivocados para particionado %`s: valor equivocado para '%s'Particiones equivocadas para %`s: debe de tener al menos una HISTORY y exactamente un último CURRENTTRX_ID %llu no hallado en `mysql.transaction_registry`No puedo cambiar campo de versionado de sistema %`sNo puedo DROP SYSTEM VERSIONING para la tabla %`s particionada BY SYSTEM_TIMENo se soportan las tablas versionadas del sistema en la base de datos %`sEl registro de transaciones está desactivadoDuplicada FILA %s columna %`sLa tabla %`s ya es versionada del sistemaNunca debería vd de ver estoLas tablas versionadas del sistema no soportan %sLas tablas versionadas del sistemas de transacción precisa no soportan particionado mediante ROW START o ROW ENDEl fichero/archivo índice para la tabla '%-.192s' está llenoLa columna %`s.%`s no se pude cambiar más de ua vez en una sentencia UPDATE únicaFila sin elementos no se permite en constructor de valor de tabla en este contextoLas particiones SYSTEM_TIME en la tabla %`s no soportan consulta (query) histórica%s índice %`s no soporta esta operaciónCambiar las opciones de tabla requiere que la tabla sea reconstruidaNo puedo ejecutar el comando cuando vd tiene activo un BACKUP STAGEVd debe de arracar respaldo mediante "BACKUP STAGE START"La fase de respaldo '%s' es la misma o anterior a la fase de respaldo actual '%s'La fase de respaldo '%s' ha falladoFase de respaldo desconocida: '%s'. La fase debería de ser una de START, FLUSH, BLOCK_DDL, BLOCK_COMMIT o ENDEl usuario está bloqueado a causa de demasiados errores de credenciales; desbloquee mediante 'ALTER USER / FLUSH PRIVILEGES'Acceso denegado, esta cuenta está bloqueadaUna tabla de período de momento-de-aplicación no puede ser temporalLos campos de PERIOD FOR %`s tienen tipos diferentesNo se puede especificar más de un período de momento de aplicaciónEl campo de período %`s no puede ser %sEl período %`s no se ha hallado en la tablaLa columna %`s usada en período %`s especificado en lista de actualizar SETNo puedo DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` para estoLa parte de clave especificada es demasiado larga; el tamaño máximo de la parte de clave es de %u bytesEl comentario para la base de datos '%-.64s' es demasiado largo (máx = %u)Tipo de datos desconocido: '%-.64s'El operador no existe: '%-.128s'En la historia de la tabla `%s.%s` el inicio de fila '%s' es posterior al fin de fila '%s'%`s: STARTS es posterior al momento de consulta (query), la primera partición de historia puede exceder el valor INTERVALLa replicación en Galera no está soportadaEl comando usado no está permitido porque el servidor MariaDB o el cliente han desactivado la capacidad 'local infile'No se han configurado transportes seguros, imposible poner --require_secure_transport=ONHilo (thread) SQL esclavo ignoró la '%s' porque la tabla está compartidaLa columna %'s con AUTO_INCREMENT no se puede usar en índice UNIQUE %`sLa clave %`s no puede incluir de forma explícita la columna %`sLa clave %`s no puede tener WITHOUT OVERLAPS'%-.128s' no está permitido en este contextoEl motor %s no soporta retroceso (rollback). Los cambios se acometieron (commit) durante la llamada a retroceso (rollback)Una clave primaria no se puede marcar como IGNORESKIP LOCKED hace que esta sentencia sea no seguraEl campo '%s' no se puede poner para JSON_TABLE '%s'.Cada función de tabla debe de tener un alias.No puedo guardar un arreglo o un objeto en la columna escalar '%s' de JSON_TABLE '%s'.No puedo guardar múltiples coincidencias de la ruta en la columna '%s' de JSON_TABLE '%s'.FETCH ... WITH TIES requiere que esté presente la cláusula ORDER BYEliminado disparador huérfano '%-.64s', creado originálmente para la tabla: '%-.192s'El motor de almacenaje %s está desactivadomysql_test_db.sql000064400000003217150343472770010155 0ustar00-- Copyright (c) 2018 MariaDB Foundation
--
-- 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-1301  USA

CREATE DATABASE IF NOT EXISTS test CHARACTER SET latin1 COLLATE latin1_swedish_ci;

-- Fill "db" table with default grants for anyone to
-- access database 'test' and 'test_%' if "db" table didn't exist
CREATE TEMPORARY TABLE tmp_db LIKE db;
INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y','Y');
INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y','Y');
INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
DROP TABLE tmp_db;

-- Anonymous user with no privileges.
CREATE TEMPORARY TABLE tmp_user_anonymous LIKE global_priv;
INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost','');
INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
INSERT INTO global_priv SELECT * FROM tmp_user_anonymous WHERE @had_user_table=0;
DROP TABLE tmp_user_anonymous;
maria_add_gis_sp.sql000064400000003251150343472770010547 0ustar00-- Copyright (C) 2014 MariaDB Ab.
--
-- 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

# This part creates stored procedures required by the OpenGIS standards.
# script is prepared to be run with the --bootstrap server option

SET sql_mode='';

delimiter |

DROP PROCEDURE IF EXISTS AddGeometryColumn;
DROP PROCEDURE IF EXISTS DropGeometryColumn;

CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
   t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
begin
  set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |

CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64),
   t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
begin
  set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |

delimiter ;

danish/errmsg.sys000064400000231666150343472770010103 0ustar00���)o��=�014;>OP.'2,"-./42M8-.>4$-$@"A5IYP%(9:&#1)) A6%'%/*%"::?2CLO*"8Y9UK$>iJJ&` D0A2!�0, %%Q&@`�>x$-1%=0'l8Rg:1�J!!�FOe_-+a@b+J=0.DQKRL<FH_-)MGi))D�7&23577b#?&'@u:P_�m]hq:Q(ABIK-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E *)2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?+8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7!FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�'i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkNEJJAKan ikke oprette filen '%-.200s' (Fejlkode: %M)Kan ikke oprette tabellen %`s.%`s (Fejlkode: %M)Kan ikke oprette databasen '%-.192s' (Fejlkode: %M)Kan ikke oprette databasen '%-.192s'; databasen eksistererKan ikke slette (droppe) '%-.192s'; databasen eksisterer ikkeFejl ved sletning (drop) af databasen (kan ikke slette '%-.192s', Fejlkode %M)Fejl ved sletting af database (kan ikke slette folderen '%-.192s', Fejlkode %M)Fejl ved sletning af '%-.192s' (Fejlkode: %M)Kan ikke læse posten i systemfolderenKan ikke læse status af '%-.200s' (Fejlkode: %M)Kan ikke læse aktive folder (Fejlkode: %M)Kan ikke låse fil (Fejlkode: %M)Kan ikke åbne fil: '%-.200s' (Fejlkode: %M)Kan ikke finde fila: '%-.200s' (Fejlkode: %M)Kan ikke læse folder '%-.192s' (Fejlkode: %M)Kan ikke skifte folder til '%-.192s' (Fejlkode: %M)Posten er ændret siden sidste læsning '%-.192s'Ikke mere diskplads (%s). Venter på at få frigjort plads... (Fejlkode: %M)Kan ikke skrive, flere ens nøgler i tabellen '%-.192s'Fejl ved lukning af '%-.192s' (Fejlkode: %M)Fejl ved læsning af '%-.200s' (Fejlkode: %M)Fejl ved omdøbning af '%-.210s' til '%-.210s' (Fejlkode: %M)Fejl ved skriving av filen '%-.200s' (Fejlkode: %M)'%-.192s' er låst mod opdateringerSortering afbrudtView '%-.192s' eksisterer ikke for '%-.192s'Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionKan ikke finde posten i '%-.192s'Forkert indhold i: '%-.200s'Fejl i indeksfilen til tabellen '%-.200s'; prøv at reparere denGammel indeksfil for tabellen '%-.192s'; reparer den'%-.192s' er skrivebeskyttetIkke mere hukommelse. Genstart serveren og prøv igen (mangler %d bytes)Ikke mere sorteringshukommelse. Øg sorteringshukommelse (sort buffer size) for serverenUventet afslutning på fil (eof) ved læsning af filen '%-.192s' (Fejlkode: %M)For mange forbindelser (connections)Udgået for tråde/hukommelseKan ikke få værtsnavn for din adresseForkert håndtryk (handshake)Adgang nægtet bruger: '%s'@'%s' til databasen '%-.192s'Adgang nægtet bruger: '%s'@'%s' (Bruger adgangskode: %s)Ingen database valgtUkendt kommandoKolonne '%-.192s' kan ikke være NULLUkendt database '%-.192s'Tabellen '%-.192s' findes alleredeUkendt tabel '%-.100T'Felt: '%-.192s' i tabel %-.192s er ikke entydigtDatabase nedlukning er i gangUkendt kolonne '%-.192s' i tabel %-.192sBrugte '%-.192s' som ikke var i group byKan ikke gruppere på '%-.192s'Udtrykket har summer (sum) funktioner og kolonner i samme udtrykKolonne tæller stemmer ikke med antallet af værdierNavnet '%-.100T' er for langtFeltnavnet '%-.192s' findes alleredeIndeksnavnet '%-.192s' findes alleredeEns værdier '%-.192T' for indeks %dForkert kolonnespecifikaton for felt '%-.192s'%s nær '%-.80T' på linje %dForespørgsel var tomTabellen/aliaset: '%-.192s' er ikke uniktUgyldig standardværdi for '%-.192s'Flere primærnøgler specificeretFor mange nøgler specificeret. Kun %d nøgler må brugesFor mange nøgledele specificeret. Kun %d dele må brugesSpecificeret nøgle var for lang. Maksimal nøglelængde er %dNøglefeltet '%-.192s' eksisterer ikke i tabellenBLOB column %`s can't be used in key specification in the %s tableFor stor feltlængde for kolonne '%-.192s' (maks = %lu). Brug BLOB i stedetDer kan kun specificeres eet AUTO_INCREMENT-felt, og det skal være indekseretCould not delete gtid domain. Reason: %s.%s (%s): Normal nedlukning%s: Fangede signal %d. Afslutter!%s: Server lukket%s: Forceret nedlukning af tråd: %ld  bruger: '%-.48s'Kan ikke oprette IP socketTabellen '%-.192s' har ikke den nøgle, som blev brugt i CREATE INDEX. Genopret tabellenFelt adskiller er ikke som forventet, se dokumentationenMan kan ikke bruge faste feltlængder med BLOB. Brug i stedet 'fields terminated by'Filen '%-.128s' skal være i database-folderen, eller kunne læses af alleFilen '%-.200s' eksisterer alleredePoster: %ld  Fjernet: %ld  Sprunget over: %ld  Advarsler: %ldPoster: %ld  Ens: %ldForkert indeksdel. Den anvendte nøgledel er ikke en streng eller længden er større end nøglelængdenMan kan ikke slette alle felter med ALTER TABLE. Brug DROP TABLE i stedetKan ikke udføre DROP %s %`-.192s. Undersøg om feltet/nøglen eksistererPoster: %ld  Ens: %ld  Advarsler: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataUkendt tråd id: %luDu er ikke ejer af tråden %lldIngen tabeller i brugFor mange tekststrenge til specifikationen af SET i kolonne %-.192sKan ikke lave unikt log-filnavn %-.200s.(1-999)Tabellen '%-.192s' var låst med READ lås og kan ikke opdateresTabellen '%-.192s' var ikke låst med LOCK TABLESYou should never see itUgyldigt database navn '%-.100T'Ugyldigt tabel navn '%-.100s'SELECT ville undersøge for mange poster og ville sandsynligvis tage meget lang tid. Undersøg WHERE delen og brug SET SQL_BIG_SELECTS=1 hvis udtrykket er korrektUkendt fejlUkendt procedure %-.192sForkert antal  parametre til proceduren %-.192sForkert(e) parametre til proceduren %-.192sUkendt tabel '%-.192s' i %-.32sFeltet '%-.192s' er anvendt to gangeForkert brug af grupperings-funktionTabellen '%-.192s' bruger et filtypenavn som ikke findes i denne MariaDB versionEn tabel skal have mindst een kolonneTabellen '%-.192s' er fuldUkendt tegnsæt: '%-.64s'For mange tabeller. MariaDB kan kun bruge %d tabeller i et joinFor mange felterFor store poster. Max post størrelse, uden BLOB's, er %ld. Du må lave nogle felter til BLOB'sThread stack brugt:  Brugt: %ld af en %ld stak.  Brug 'mariadbd --thread_stack=#' for at allokere en større stak om nødvendigtKrydsreferencer fundet i OUTER JOIN; check dine ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerKan ikke læse funktionen '%-.192s'Kan ikke starte funktionen '%-.192s'; %-.80sAngivelse af sti ikke tilladt for delt bibliotekFunktionen '%-.192s' findes alleredeKan ikke åbne delt bibliotek '%-.192s' (errno: %d, %-.128s)Kan ikke finde funktionen '%-.128s' i bibliotekFunktionen '%-.192s' er ikke defineretVærten '%-.64s' er blokeret på grund af mange fejlforespørgsler. Lås op med 'mariadb-admin flush-hosts'Værten '%-.64s' kan ikke tilkoble denne MariaDB-serverDu bruger MariaDB som anonym bruger. Anonyme brugere må ikke ændre adgangskoderDu skal have tilladelse til at opdatere tabeller i MariaDB databasen for at ændre andres adgangskoderKan ikke finde nogen tilsvarende poster i bruger tabellenPoster fundet: %ld  Ændret: %ld  Advarsler: %ldKan ikke danne en ny tråd (fejl nr. %M). Hvis computeren ikke er løbet tør for hukommelse, kan du se i brugervejledningen for en mulig operativ-system - afhængig fejlKolonne antallet stemmer ikke overens med antallet af værdier i post %luKan ikke genåbne tabel '%-.192sForkert brug af nulværdi (NULL)Fik fejl '%s' fra regexpSammenblanding af GROUP kolonner (MIN(),MAX(),COUNT()...) uden GROUP kolonner er ikke tilladt, hvis der ikke er noget GROUP BY prædikatDenne tilladelse findes ikke for brugeren '%-.48s' på vært '%-.64s'%-.100T-kommandoen er ikke tilladt for brugeren '%s'@'%s' for tabellen %`s.%`s%-.32s-kommandoen er ikke tilladt for brugeren '%s'@'%s' for kolonne '%-.192s' in tabellen '%-.192s'Forkert GRANT/REVOKE kommando. Se i brugervejledningen hvilke privilegier der kan specificeresVærts- eller brugernavn for langt til GRANTTabellen '%-.192s.%-.192s' eksisterer ikkeDenne tilladelse eksisterer ikke for brugeren '%-.48s' på vært '%-.64s' for tabellen '%-.192s'Den brugte kommando er ikke tilladt med denne udgave af MariaDBDer er en fejl i SQL syntaksenForsinket indsættelse tråden (delayed insert thread) kunne ikke opnå lås på tabellen %-.192sFor mange slettede tråde (threads) i brugAfbrudt forbindelse %ld til database: '%-.192s' bruger: '%-.48s' (%-.64s)Modtog en datapakke som var større end 'max_allowed_packet'Fik læsefejl fra forbindelse (connection pipe)Fik fejlmeddelelse fra fcntl()Modtog ikke datapakker i korrekt rækkefølgeKunne ikke dekomprimere kommunikations-pakke (communication packet)Fik fejlmeddelelse ved læsning af kommunikations-pakker (communication packets)Timeout-fejl ved læsning af kommunukations-pakker (communication packets)Fik fejlmeddelelse ved skrivning af kommunukations-pakker (communication packets)Timeout-fejl ved skrivning af kommunukations-pakker (communication packets)Strengen med resultater er større end 'max_allowed_packet'Denne tabeltype (%s) understøtter ikke brug af BLOB og TEXT kolonnerDenne tabeltype understøtter (%s) ikke brug af AUTO_INCREMENT kolonnerINSERT DELAYED kan ikke bruges med tabellen '%-.192s', fordi tabellen er låst med LOCK TABLESForkert kolonnenavn '%-.100s'The storage engine %s can't index column %`sTabellerne i MERGE er ikke defineret ensKan ikke skrive til tabellen '%-.192s' fordi det vil bryde CONSTRAINT reglerBLOB kolonnen '%-.192s' brugt i nøglespecifikation uden nøglelængdeAlle dele af en PRIMARY KEY skal være NOT NULL;  Hvis du skal bruge NULL i nøglen, brug UNIQUE istedetResultatet bestod af mere end een rækkeDenne tabeltype kræver en primærnøgleDenne udgave af MariaDB er ikke oversat med understøttelse af RAIDDu bruger sikker opdaterings modus ('safe update mode') og du forsøgte at opdatere en tabel uden en WHERE klausul, der gør brug af et KEY feltNøglen '%-.192s' eksisterer ikke i tabellen '%-.192s'Kan ikke åbne tabellenDenne tabeltype understøtter ikke %sDu må ikke bruge denne kommando i en transaktionModtog fejl %M mens kommandoen COMMIT blev udførtModtog fejl %M mens kommandoen ROLLBACK blev udførtModtog fejl %M mens kommandoen FLUSH_LOGS blev udførtModtog fejl %M mens kommandoen CHECKPOINT blev udførtAfbrød forbindelsen %lld til databasen '%-.192s' bruger: '%-.48s' vært: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERKunne ikke genopbygge indekset for den dumpede tabel '%-.192s'Fejl fra master: '%-.64s'Netværksfejl ved læsning fra masterNetværksfejl ved skrivning til masterKan ikke finde en FULLTEXT nøgle som svarer til kolonne listenKan ikke udføre den givne kommando fordi der findes aktive, låste tabeller eller fordi der udføres en transaktionUkendt systemvariabel '%-.*s'Tabellen '%-.192s' er markeret med fejl og bør repareresTabellen '%-.192s' er markeret med fejl og sidste (automatiske?) REPAIR fejledeAdvarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestillesFler-udtryks transaktion krævede mere plads en 'max_binlog_cache_size' bytes. Forhøj værdien af denne variabel og prøv igenDenne handling kunne ikke udføres med kørende slave '%2$*1$s', brug først kommandoen STOP SLAVE '%2$*1$s'Denne handling kræver en kørende slave. Konfigurer en slave og brug kommandoen START SLAVEDenne server er ikke konfigureret som slave. Ret in config-filen eller brug kommandoen CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logKunne ikke danne en slave-tråd; check systemressourcerneBrugeren %-.64s har allerede mere end 'max_user_connections' aktive forbindelserDu må kun bruge konstantudtryk med SETLock wait timeout overskredetDet totale antal låse overstiger størrelsen på låse-tabellenUpdate lås kan ikke opnås under en READ UNCOMMITTED transaktionDROP DATABASE er ikke tilladt mens en tråd holder på globalt read lockCREATE DATABASE er ikke tilladt mens en tråd holder på globalt read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetModtog fejl %d '%-.200s' fra %sModtog temporary fejl %d '%-.200s' fra %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionEns værdier '%-.64T' for indeks '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAdgang nægtet bruger: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionFlere ens nøgler for indeks '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledslovak/errmsg.sys000064400000231250150343472770010121 0ustar00���(o�	�=�99<<<MW0259/98:<CH=4:E;%+$@&,C5NDJ!3!FF" &%$((1*1 #3'!#,*+GMG4CKJ*-;SOQUE"fJW2`%!"0?B2'&�/'%##P"!Az�Hx'33O0%e?gj./�2rB;P[/&U:"D @4*)+*+*849Y -:>E[&':f/-=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?98|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"70FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�0i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkNIEÁnoNemôžem vytvoriť súbor '%-.200s' (chybový kód: %M)Nemôžem vytvoriť tabuľku %`s.%`s (chybový kód: %M)Nemôžem vytvoriť databázu '%-.192s' (chybový kód: %M)Nemôžem vytvoriť databázu '%-.192s'; databáza existujeNemôžem zmazať databázu '%-.192s'; databáza neexistujeChyba pri mazaní databázy (nemôžem zmazať '%-.192s', chybový kód: %M)Chyba pri mazaní databázy (nemôžem vymazať adresár '%-.192s', chybový kód: %M)Chyba pri mazaní '%-.192s' (chybový kód: %M)Nemôžem čítať záznam v systémovej tabuľkeNemôžem zistiť stav '%-.200s' (chybový kód: %M)Nemôžem zistiť pracovný adresár (chybový kód: %M)Nemôžem zamknúť súbor (chybový kód: %M)Nemôžem otvoriť súbor: '%-.200s' (chybový kód: %M)Nemôžem nájsť súbor: '%-.200s' (chybový kód: %M)Nemôžem čítať adresár '%-.192s' (chybový kód: %M)Nemôžem vojsť do adresára '%-.192s' (chybový kód: %M)Záznam bol zmenený od posledného čítania v tabuľke '%-.192s'Disk je plný (%s), čakám na uvoľnenie miesta... (chybový kód: %M)Nemôžem zapísať, duplikát kľúča v tabuľke '%-.192s'Chyba pri zatváraní '%-.192s' (chybový kód: %M)Chyba pri čítaní súboru '%-.200s' (chybový kód: %M)Chyba pri premenovávaní '%-.210s' na '%-.210s' (chybový kód: %M)Chyba pri zápise do súboru '%-.200s' (chybový kód: %M)'%-.192s' je zamknutý proti zmenámTriedenie prerušenéPohľad '%-.192s' neexistuje pre '%-.192s'Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionNemôžem nájsť záznam v '%-.192s'Nesprávna informácia v súbore: '%-.200s'Nesprávny kľúč pre tabuľku '%-.200s'; pokúste sa ho opraviťStarý kľúčový súbor pre '%-.192s'; opravte ho!'%-.192s' is čítať onlyMálo pamäti. Reštartujte daemona a skúste znova (je potrebných %d bytov)Málo pamäti pre triedenie, zvýšte veľkosť triediaceho bufferuNeočakávaný koniec súboru pri čítaní '%-.192s' (chybový kód: %M)Príliš mnoho spojeníMálo miesta-pamäti pre vláknoNemôžem zistiť meno hostiteľa pre vašu adresuChyba pri nadväzovaní spojeniaZakázaný prístup pre užívateľa: '%s'@'%s' k databázi '%-.192s'Zakázaný prístup pre užívateľa: '%s'@'%s' (použitie hesla: %s)Nebola vybraná databázaNeznámy príkazPole '%-.192s' nemôže byť nullNeznáma databáza '%-.192s'Tabuľka '%-.192s' už existujeNeznáma tabuľka '%-.100T'Pole: '%-.192s' v %-.192s je nejasnéPrebieha ukončovanie práce serveraNeznáme pole '%-.192s' v '%-.192s'Použité '%-.192s' nebolo v 'group by'Nemôžem použiť 'group' na '%-.192s'Príkaz obsahuje zároveň funkciu 'sum' a poľaPočet polí nezodpovedá zadanej hodnoteMeno identifikátora '%-.100T' je príliš dlhéOpakované meno poľa '%-.192s'Opakované meno kľúča '%-.192s'Opakovaný kľúč '%-.192T' (číslo kľúča %d)Chyba v špecifikácii poľa '%-.192s'%s blízko '%-.80T' na riadku %dVýsledok požiadavky bol prázdnyNie jednoznačná tabuľka/alias: '%-.192s'Chybná implicitná hodnota pre '%-.192s'Zadefinovaných viac primárnych kľúčovZadaných ríliš veľa kľúčov. Najviac %d kľúčov je povolenýchZadaných ríliš veľa častí kľúčov. Je povolených najviac %d častíZadaný kľúč je príliš dlhý, najväčšia dĺžka kľúča je %dKľúčový stĺpec '%-.192s' v tabuľke neexistujeBLOB column %`s can't be used in key specification in the %s tablePríliš veľká dĺžka pre pole '%-.192s' (maximum = %lu). Použite BLOBMôžete mať iba jedno AUTO pole a to musí byť definované ako kľúčCould not delete gtid domain. Reason: %s.%s (%s): normálne ukončenie%s: prijatý signál %d, ukončenie (Abort)!%s: práca ukončená%s: násilné ukončenie vlákna %ld užívateľa '%-.48s'Nemôžem vytvoriť IP socketTabuľka '%-.192s' nemá index zodpovedajúci CREATE INDEX. Vytvorte tabulku znovaArgument oddeľovač polí nezodpovedá požiadavkám. Skontrolujte v manuáliNie je možné použiť fixnú dĺžku s BLOBom. Použite 'fields terminated by'Súbor '%-.128s' musí byť v adresári databázy, alebo čitateľný pre všetkýchSúbor '%-.200s' už existujeZáznamov: %ld  Zmazaných: %ld  Preskočených: %ld  Varovania: %ldZáznamov: %ld  Opakovaných: %ldIncorrect prefix key; the used key part isn't a string or the used length is longer than the key partOne nemôžem zmazať all fields with ALTER TABLE; use DROP TABLE insteadNemôžem zrušiť (DROP %s) %`-.192s. Skontrolujte, či neexistujú záznamy/kľúčeZáznamov: %ld  Opakovaných: %ld  Varovania: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataNeznáma identifikácia vlákna: %luNie ste vlastníkom vlákna %lldNie je použitá žiadna tabuľkaPríliš mnoho reťazcov pre pole %-.192s a SETNemôžem vytvoriť unikátne meno log-súboru %-.200s.(1-999)Tabuľka '%-.192s' bola zamknutá s READ a nemôže byť zmenenáTabuľka '%-.192s' nebola zamknutá s LOCK TABLESYou should never see itNeprípustné meno databázy '%-.100T'Neprípustné meno tabuľky '%-.100s'Zadaná požiadavka SELECT by prechádzala príliš mnoho záznamov a trvala by príliš dlho. Skontrolujte tvar WHERE a ak je v poriadku, použite SET SQL_BIG_SELECTS=1Neznámá chybaNeznámá procedúra '%-.192s'Chybný počet parametrov procedúry '%-.192s'Chybné parametre procedúry '%-.192s'Neznáma tabuľka '%-.192s' v %-.32sPole '%-.192s' je zadané dvakrátNesprávne použitie funkcie GROUPTabuľka '%-.192s' používa rozšírenie, ktoré v tejto verzii MariaDB nie jeTabuľka musí mať aspoň 1 poleTabuľka '%-.192s' je plnáNeznáma znaková sada: '%-.64s'Príliš mnoho tabuliek. MariaDB môže použiť len %d v JOIN-ePríliš mnoho políRiadok je príliš veľký. Maximálna veľkosť riadku, okrem 'BLOB', je %ld. Musíte zmeniť niektoré položky na BLOBPretečenie zásobníku vlákna:  použité: %ld z %ld.  Použite 'mariadbd --thread_stack=#' k zadaniu väčšieho zásobníkaV OUTER JOIN bol nájdený krížový odkaz.  Skontrolujte podmienky ONTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerNemôžem načítať funkciu '%-.192s'Nemôžem inicializovať funkciu '%-.192s'; %-.80sNeprípustné žiadne cesty k zdieľanej knižniciFunkcia '%-.192s' už existujeNemôžem otvoriť zdieľanú knižnicu '%-.192s' (chybový kód: %d, %-.128s)Nemôžem nájsť funkciu '%-.128s' v knižniciFunkcia '%-.192s' nie je definovanáHost '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'Host '%-.64s' is not allowed to connect to this MariaDB serverYou are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settingsYou must have privileges to update tables in the mysql database to be able to change passwords for othersCan't find any matching row in the user tableRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192sInvalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionSomething is wrong in your syntaxDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sAll tables in the MERGE table are not defined identicallyCan't write, because of unique constraint, to table '%-.192s'BLOB column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionOpakovaný kľúč '%-.64T' (číslo kľúča '%-.192s')Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTZakázaný prístup pre užívateľa: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionOpakovaný kľúč (číslo kľúča '%-.192s')Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disableddutch/errmsg.sys000064400000233607150343473000007724 0ustar00���-o��=�/.3=?LP5*70(018>KV;14B;,+@$"K:HAL�*DF#.$%=DG*#-2*),KPB2CYQ*#>cWf$F�ee-`%)Nj2,$�<+$(#P)"F��Nx!1( @-'mTSl;9�<(#{PH\`5%c<'S%J1'*3-0144BG_ -CATz#4De6/J!!`#="':j$NgT�iR`q=R4;RKM-US@2DE2,0GAS)hJII/F-='2RD)4/($@,#-*@2JN6�u.:N.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w9_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?38|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7,FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�*i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ(A-%)Q)(-)PP;I��hashchkisamchkNEEJAKan file '%-.200s' niet aanmaken (Errcode: %M)Kan tabel %`s.%`s niet aanmaken (Errcode: %M)Kan database '%-.192s' niet aanmaken (Errcode: %M)Kan database '%-.192s' niet aanmaken; database bestaat reedsKan database '%-.192s' niet verwijderen; database bestaat nietFout bij verwijderen database (kan '%-.192s' niet verwijderen, Errcode: %M)Fout bij verwijderen database (kan rmdir '%-.192s' niet uitvoeren, Errcode: %M)Fout bij het verwijderen van '%-.192s' (Errcode: %M)Kan record niet lezen in de systeem tabelKan de status niet krijgen van '%-.200s' (Errcode: %M)Kan de werkdirectory niet krijgen (Errcode: %M)Kan de file niet blokeren (Errcode: %M)Kan de file '%-.200s' niet openen (Errcode: %M)Kan de file: '%-.200s' niet vinden (Errcode: %M)Kan de directory niet lezen van '%-.192s' (Errcode: %M)Kan de directory niet veranderen naar '%-.192s' (Errcode: %M)Record is veranderd sinds de laatste lees activiteit in de tabel '%-.192s'Schijf vol (%s). Aan het wachten totdat er ruimte vrij wordt gemaakt... (Errcode: %M)Kan niet schrijven, dubbele zoeksleutel in tabel '%-.192s'Fout bij het sluiten van '%-.192s' (Errcode: %M)Fout bij het lezen van file '%-.200s' (Errcode: %M)Fout bij het hernoemen van '%-.210s' naar '%-.210s' (Errcode: %M)Fout bij het wegschrijven van file '%-.200s' (Errcode: %M)'%-.192s' is geblokeerd tegen veranderingenSorteren afgebrokenView '%-.192s' bestaat niet voor '%-.192s'Fout %M van tabel handler %sStorage engine %s of the table %`s.%`s doesn't have this optionKan record niet vinden in '%-.192s'Verkeerde info in file: '%-.200s'Verkeerde zoeksleutel file voor tabel: '%-.200s'; probeer het te reparerenOude zoeksleutel file voor tabel '%-.192s'; repareer het!'%-.192s' is alleen leesbaarGeen geheugen meer. Herstart server en probeer opnieuw (%d bytes nodig)Geen geheugen om te sorteren. Verhoog de server sort buffer sizeOnverwachte eof gevonden tijdens het lezen van file '%-.192s' (Errcode: %M)Te veel verbindingenGeen thread geheugen meer; controleer of mariadbd of andere processen al het beschikbare geheugen gebruikt. Zo niet, dan moet u wellicht 'ulimit' gebruiken om mariadbd toe te laten meer geheugen te benutten, of u kunt extra swap ruimte toevoegenKan de hostname niet krijgen van uw adresVerkeerde handshakeToegang geweigerd voor gebruiker: '%s'@'%s' naar database '%-.192s'Toegang geweigerd voor gebruiker: '%s'@'%s' (Wachtwoord gebruikt: %s)Geen database geselecteerdOnbekend commandoKolom '%-.192s' kan niet null zijnOnbekende database '%-.192s'Tabel '%-.192s' bestaat alOnbekende tabel '%-.100T'Kolom: '%-.192s' in %-.192s is niet eenduidigBezig met het stoppen van de serverOnbekende kolom '%-.192s' in %-.192sOpdracht gebruikt '%-.192s' dat niet in de GROUP BY voorkomtKan '%-.192s' niet groeperenOpdracht heeft totaliseer functies en kolommen in dezelfde opdrachtHet aantal kolommen komt niet overeen met het aantal opgegeven waardesNaam voor herkenning '%-.100T' is te langDubbele kolom naam '%-.192s'Dubbele zoeksleutel naam '%-.192s'Dubbele ingang '%-.192T' voor zoeksleutel %dVerkeerde kolom specificatie voor kolom '%-.192s'%s bij '%-.80T' in regel %dQuery was leegNiet unieke waarde tabel/alias: '%-.192s'Foutieve standaard waarde voor '%-.192s'Meerdere primaire zoeksleutels gedefinieerdTeveel zoeksleutels gedefinieerd. Maximaal zijn %d zoeksleutels toegestaanTeveel zoeksleutel onderdelen gespecificeerd. Maximaal %d onderdelen toegestaanGespecificeerde zoeksleutel was te lang. De maximale lengte is %dZoeksleutel kolom '%-.192s' bestaat niet in tabelBLOB column %`s can't be used in key specification in the %s tableTe grote kolomlengte voor '%-.192s' (max = %lu). Maak hiervoor gebruik van het type BLOBEr kan slechts 1 autofield zijn en deze moet als zoeksleutel worden gedefinieerdCould not delete gtid domain. Reason: %s.%s (%s): Normaal afgesloten %s: Signaal %d. Systeem breekt af!%s: Afsluiten afgerond%s: Afsluiten afgedwongen van thread %ld  gebruiker: '%-.48s'Kan IP-socket niet openenTabel '%-.192s' heeft geen INDEX zoals deze gemaakt worden met CREATE INDEX. Maak de tabel opnieuwDe argumenten om velden te scheiden zijn anders dan verwacht. Raadpleeg de handleidingBij het gebruik van BLOBs is het niet mogelijk om vaste rijlengte te gebruiken. Maak s.v.p. gebruik van 'fields terminated by'Het bestand '%-.128s' dient in de database directory voor the komen of leesbaar voor iedereen te zijnHet bestand '%-.200s' bestaat reedsRecords: %ld  Verwijderd: %ld  Overgeslagen: %ld  Waarschuwingen: %ldRecords: %ld  Dubbel: %ldFoutief sub-gedeelte van de zoeksleutel. De gebruikte zoeksleutel is geen onderdeel van een string of of de gebruikte lengte is langer dan de zoeksleutelHet is niet mogelijk alle velden te verwijderen met ALTER TABLE. Gebruik a.u.b. DROP TABLE hiervoor!DROP %s: Kan %`-.192s niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaatRecords: %ld  Dubbel: %ld  Waarschuwing: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataOnbekend thread id: %luU bent geen bezitter van thread %lldGeen tabellen gebruiktTeveel strings voor kolom %-.192s en SETHet is niet mogelijk een unieke naam te maken voor de logfile %-.200s.(1-999)Tabel '%-.192s' was gelocked met een lock om te lezen. Derhalve kunnen geen wijzigingen worden opgeslagenTabel '%-.192s' was niet gelocked met LOCK TABLESYou should never see itDatabasenaam '%-.100T' is niet getoegestaanNiet toegestane tabelnaam '%-.100s'Het SELECT-statement zou te veel records analyseren en dus veel tijd in beslagnemen. Kijk het WHERE-gedeelte van de query na en kies SET SQL_BIG_SELECTS=1 als het stament in orde isOnbekende FoutOnbekende procedure %-.192sFoutief aantal parameters doorgegeven aan procedure %-.192sFoutieve parameters voor procedure %-.192sOnbekende tabel '%-.192s' in %-.32sVeld '%-.192s' is dubbel gespecificeerdOngeldig gebruik van GROUP-functieTabel '%-.192s' gebruikt een extensie, die niet in deze MariaDB-versie voorkomtEen tabel moet minstens 1 kolom bevattenDe tabel '%-.192s' is volOnbekende character set: '%-.64s'Teveel tabellen. MariaDB kan slechts %d tabellen in een join bevattenTe veel veldenRij-grootte is groter dan toegestaan. Maximale rij grootte, blobs niet meegeteld, is %ld. U dient sommige velden in blobs te veranderenThread stapel overrun:  Gebruikte: %ld van een %ld stack. Gebruik 'mariadbd --thread_stack=#' om een grotere stapel te definieren (indien noodzakelijk)Gekruiste afhankelijkheid gevonden in OUTER JOIN. Controleer uw ON-conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerKan functie '%-.192s' niet ladenKan functie '%-.192s' niet initialiseren; %-.80sGeen pad toegestaan voor shared libraryFunctie '%-.192s' bestaat reedsKan shared library '%-.192s' niet openen (Errcode: %d, %-.128s)Kan functie '%-.128s' niet in library vindenFunctie '%-.192s' is niet gedefinieerdHost '%-.64s' is geblokkeeerd vanwege te veel verbindings fouten. Deblokkeer met 'mariadb-admin flush-hosts'Het is host '%-.64s' is niet toegestaan verbinding te maken met deze MariaDB serverU gebruikt MariaDB als anonieme gebruiker en deze mogen geen wachtwoorden wijzigenU moet tabel update priveleges hebben in de MariaDB database om wachtwoorden voor anderen te mogen wijzigenKan geen enkele passende rij vinden in de gebruikers tabelPassende rijen: %ld  Gewijzigd: %ld  Waarschuwingen: %ldKan geen nieuwe thread aanmaken (Errcode: %M). Indien er geen tekort aan geheugen is kunt u de handleiding consulteren over een mogelijke OS afhankelijke foutKolom aantal komt niet overeen met waarde aantal in rij %luKan tabel niet opnieuw openen: '%-.192sFoutief gebruik van de NULL waardeFout '%s' ontvangen van regexpHet mixen van GROUP kolommen (MIN(),MAX(),COUNT()...) met no-GROUP kolommen is foutief indien er geen GROUP BY clausule isDeze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s'%-.100T commando geweigerd voor gebruiker: '%s'@'%s' voor tabel %`s.%`s%-.32s commando geweigerd voor gebruiker: '%s'@'%s' voor kolom '%-.192s' in tabel '%-.192s'Foutief GRANT/REVOKE commando. Raadpleeg de handleiding welke priveleges gebruikt kunnen wordenDe host of gebruiker parameter voor GRANT is te langTabel '%-.192s.%-.192s' bestaat nietDeze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s' op tabel '%-.192s'Het used commando is niet toegestaan in deze MariaDB versieEr is iets fout in de gebruikte syntax'Delayed insert' thread kon de aangevraagde 'lock' niet krijgen voor tabel %-.192sTe veel 'delayed' threads in gebruikAfgebroken verbinding %ld naar db: '%-.192s' gebruiker: '%-.48s' (%-.64s)Groter pakket ontvangen dan 'max_allowed_packet'Kreeg leesfout van de verbindings pipeKreeg fout van fcntl()Pakketten in verkeerde volgorde ontvangenCommunicatiepakket kon niet worden gedecomprimeerdFout bij het lezen van communicatiepakkettenTimeout bij het lezen van communicatiepakkettenFout bij het schrijven van communicatiepakkettenTimeout bij het schrijven van communicatiepakkettenResultaat string is langer dan 'max_allowed_packet'Het gebruikte tabel type (%s) ondersteunt geen BLOB/TEXT kolommenHet gebruikte tabel type (%s) ondersteunt geen AUTO_INCREMENT kolommenINSERT DELAYED kan niet worden gebruikt bij table '%-.192s', vanwege een 'lock met LOCK TABLESIncorrecte kolom naam '%-.100s'The storage engine %s can't index column %`sNiet alle tabellen in de MERGE tabel hebben identieke gedefinitiesKan niet opslaan naar table '%-.192s' vanwege 'unique' beperkingBLOB kolom '%-.192s' gebruikt in zoeksleutel specificatie zonder zoeksleutel lengteAlle delen van een PRIMARY KEY moeten NOT NULL zijn; Indien u NULL in een zoeksleutel nodig heeft kunt u UNIQUE gebruikenResultaat bevatte meer dan een rijDit tabel type heeft een primaire zoeksleutel nodigDeze versie van MariaDB is niet gecompileerd met RAID ondersteuningU gebruikt 'safe update mode' en u probeerde een tabel te updaten zonder een WHERE met een KEY kolomZoeksleutel '%-.192s' bestaat niet in tabel '%-.192s'Kan tabel niet openenDe 'handler' voor de tabel ondersteund geen %sHet is u niet toegestaan dit commando uit te voeren binnen een transactieKreeg fout %M tijdens COMMITKreeg fout %M tijdens ROLLBACKKreeg fout %M tijdens FLUSH_LOGSKreeg fout %M tijdens CHECKPOINTAfgebroken verbinding %lld naar db: '%-.192s' gebruiker: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERGefaald tijdens heropbouw index van gedumpte tabel '%-.192s'Fout van master: '%-.64s'Net fout tijdens lezen van masterNet fout tijdens schrijven naar masterKan geen FULLTEXT index vinden passend bij de kolom lijstKan het gegeven commando niet uitvoeren, want u heeft actieve gelockte tabellen of een actieve transactieOnbekende systeem variabele '%-.*s'Tabel '%-.192s' staat als gecrashed gemarkeerd en dient te worden gerepareerdTabel '%-.192s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukteWaarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellenMulti-statement transactie vereist meer dan 'max_binlog_cache_size' bytes opslag. Verhoog deze mariadbd variabele en probeer opnieuwDeze operatie kan niet worden uitgevoerd met een actieve slave '%2$*1$s', doe eerst STOP SLAVE '%2$*1$s'Deze operatie vereist een actieve slave, configureer slave en doe dan START SLAVEDe server is niet geconfigureerd als slave, fix in configuratie bestand of met CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logKon slave thread niet aanmaken, controleer systeem resourcesGebruiker %-.64s heeft reeds meer dan 'max_user_connections' actieve verbindingenU mag alleen constante expressies gebruiken bij SETLock wacht tijd overschredenHet totale aantal locks overschrijdt de lock tabel grootteUpdate locks kunnen niet worden verkregen tijdens een READ UNCOMMITTED transactieDROP DATABASE niet toegestaan terwijl thread een globale 'read lock' bezitCREATE DATABASE niet toegestaan terwijl thread een globale 'read lock' bezitFoutieve parameters voor %s'%s'@'%s' mag geen nieuwe gebruikers creerenIncorrecte tabel definitie; alle MERGE tabellen moeten tot dezelfde database behorenDeadlock gevonden tijdens lock-aanvraag poging; Probeer herstart van de transactieHet gebruikte tabel type (%s) ondersteund geen FULLTEXT indexenKan foreign key beperking niet toevoegen vor `%s`Kan onderliggende rij niet toevoegen: foreign key beperking gefaaldCannot delete or update a parent row: a foreign key constraint failsFout bij opbouwen verbinding naar master: %-.128sFout bij uitvoeren query op master: %-.128sFout tijdens uitvoeren van commando %s: %-.128sFoutief gebruik van %s en %sDe gebruikte SELECT commando's hebben een verschillend aantal kolommenKan de query niet uitvoeren vanwege een conflicterende read lockHet combineren van transactionele en niet-transactionele tabellen is uitgeschakeldOptie '%s' tweemaal gebruikt in opdrachtGebruiker '%-.64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatieVariabele '%-.64s' is SESSION en kan niet worden gebruikt met SET GLOBALVariabele '%-.64s' is GLOBAL en dient te worden gewijzigd met SET GLOBALVariabele '%-.64s' heeft geen standaard waardeVariabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.200T'Foutief argumenttype voor variabele '%-.64s'Variabele '%-.64s' kan alleen worden gewijzigd, niet gelezenFoutieve toepassing/plaatsing van '%s'Deze versie van MariaDB ondersteunt nog geen '%s'Kreeg fatale fout %d: '%-.320s' van master tijdens lezen van data uit binaire logSlave SQL thread negeerde de query vanwege replicate-*-table optiesVariabele '%-.192s' is geen %s variabeleIncorrecte foreign key definitie voor '%-.192s': %sSleutel- en tabelreferentie komen niet overeenOperand behoort %d kolommen te bevattenSubquery retourneert meer dan 1 rijOnebekende prepared statement handler (%.*s) voor %s aangegevenHelp database is beschadigd of bestaat nietCyclische verwijzing in subqueriesVeld '%s' wordt van %s naar %s geconverteerdVerwijzing '%-.64s' niet ondersteund (%s)Voor elke afgeleide tabel moet een unieke alias worden gebruiktSelect %u werd geredureerd tijdens optimtalisatieTabel '%-.192s' uit een van de SELECTS kan niet in %-.32s gebruikt wordenClient ondersteunt het door de server verwachtte authenticatieprotocol niet. Overweeg een nieuwere MariaDB client te gebruikenAlle delete van een  SPATIAL index dienen als NOT NULL gedeclareerd te wordenCOLLATION '%s' is niet geldig voor CHARACTER SET '%s'Slave is reeds actiefSlave is reeds gestoptOngecomprimeerder data is te groot; de maximum lengte is %d (waarschijnlijk, de lengte van de gecomprimeerde data was beschadigd)ZLIB: Onvoldoende geheugenZLIB: Onvoldoende ruimte in uitgaande buffer (waarschijnlijk, de lengte van de ongecomprimeerde data was beschadigd)ZLIB: Invoer data beschadigdRow %u was cut by %s)Rij %lu bevat niet de data voor alle kolommenRegel %lu ingekort, bevatte meer data dan invoer kolommenColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYKan geen externe server '%s' maken omdat deze al bestaatThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDubbele ingang '%-.64T' voor zoeksleutel '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTToegang geweigerd voor gebruiker: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDubbele ingang voor zoeksleutel '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread negeerde de query '%s'AUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledpolish/errmsg.sys000064400000231530150343473000010104 0ustar00���)o�	�=�76=FCLS319</88:<DI;48H<,+(@)+F? WTS&476 &.#&-">-0$#14(-'DMI>COR*-1%<!L0]dF!XT3`"$<DTA)'�/*" L$ :�vAx,$"9'"e?gj./�2rB;P[/&U:"D @4*)+*+*849Y -:>E[&':f/-=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%wB_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?78|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7!FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�.i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkNIETAKNie można stworzyć pliku '%-.200s' (Kod błędu: %M)Nie można stworzyć tabeli %`s.%`s (Kod błędu: %M)Nie można stworzyć bazy danych '%-.192s' (Kod błędu: %M)Nie można stworzyć bazy danych '%-.192s'; baza danych już istniejeNie można usun?ć bazy danych '%-.192s'; baza danych nie istniejeBł?d podczas usuwania bazy danych (nie można usun?ć '%-.192s', bł?d %M)Bł?d podczas usuwania bazy danych (nie można wykonać rmdir '%-.192s', bł?d %M)Bł?d podczas usuwania '%-.192s' (Kod błędu: %M)Nie można odczytać rekordu z tabeli systemowejNie można otrzymać statusu '%-.200s' (Kod błędu: %M)Nie można rozpoznać aktualnego katalogu (Kod błędu: %M)Nie można zablokować pliku (Kod błędu: %M)Nie można otworzyć pliku: '%-.200s' (Kod błędu: %M)Nie można znaleĽć pliku: '%-.200s' (Kod błędu: %M)Nie można odczytać katalogu '%-.192s' (Kod błędu: %M)Nie można zmienić katalogu na '%-.192s' (Kod błędu: %M)Rekord został zmieniony od ostaniego odczytania z tabeli '%-.192s'Dysk pełny (%s). Oczekiwanie na zwolnienie miejsca... (Kod błędu: %M)Nie można zapisać, powtórzone klucze w tabeli '%-.192s'Bł?d podczas zamykania '%-.192s' (Kod błędu: %M)Bł?d podczas odczytu pliku '%-.200s' (Kod błędu: %M)Bł?d podczas zmieniania nazwy '%-.210s' na '%-.210s' (Kod błędu: %M)Bł?d podczas zapisywania pliku '%-.200s' (Kod błędu: %M)'%-.192s' jest zablokowany na wypadek zmianSortowanie przerwaneWidok '%-.192s' nie istnieje dla '%-.192s'Otrzymano bł?d %M z obsługi tabeli %sStorage engine %s of the table %`s.%`s doesn't have this optionNie można znaleĽć rekordu w '%-.192s'Niewła?ciwa informacja w pliku: '%-.200s'Niewła?ciwy plik kluczy dla tabeli: '%-.200s'; spróbuj go naprawićPlik kluczy dla tabeli '%-.192s' jest starego typu; napraw go!'%-.192s' jest tylko do odczytuZbyt mało pamięci. Uruchom ponownie demona i spróbuj ponownie (potrzeba %d bajtów)Zbyt mało pamięci dla sortowania. Zwiększ wielko?ć bufora demona dla sortowaniaNieoczekiwany 'eof' napotkany podczas czytania z pliku '%-.192s' (Kod błędu: %M)Zbyt wiele poł?czeńZbyt mało miejsca/pamięci dla w?tkuNie można otrzymać nazwy hosta dla twojego adresuZły uchwyt(handshake)Access denied for user '%s'@'%s' to database '%-.192s'Access denied for user '%s'@'%s' (using password: %s)Nie wybrano żadnej bazy danychNieznana komendaKolumna '%-.192s' nie może być nullNieznana baza danych '%-.192s'Tabela '%-.192s' już istniejeNieznana tabela '%-.100T'Kolumna: '%-.192s' w  %-.192s jest dwuznacznaTrwa kończenie działania serweraNieznana kolumna '%-.192s' w  %-.192sUżyto '%-.192s' bez umieszczenia w group byNie można grupować po '%-.192s'Zapytanie ma funkcje sumuj?ce i kolumny w tym samym zapytaniuLiczba kolumn nie odpowiada liczbie warto?ciNazwa identyfikatora '%-.100T' jest zbyt długaPowtórzona nazwa kolumny '%-.192s'Powtórzony nazwa klucza '%-.192s'Powtórzone wystąpienie '%-.192T' dla klucza %dBłędna specyfikacja kolumny dla kolumny '%-.192s'%s obok '%-.80T' w linii %dZapytanie było pusteTabela/alias nie s? unikalne: '%-.192s'Niewła?ciwa warto?ć domy?lna dla '%-.192s'Zdefiniowano wiele kluczy podstawowychOkre?lono zbyt wiele kluczy. Dostępnych jest maksymalnie %d kluczyOkre?lono zbyt wiele czę?ci klucza. Dostępnych jest maksymalnie %d czę?ciZdefinowany klucz jest zbyt długi. Maksymaln? długo?ci? klucza jest %dKolumna '%-.192s' zdefiniowana w kluczu nie istnieje w tabeliBLOB column %`s can't be used in key specification in the %s tableZbyt duża długo?ć kolumny '%-.192s' (maks. = %lu). W zamian użyj typu BLOBW tabeli może być tylko jedno pole auto i musi ono być zdefiniowane jako kluczCould not delete gtid domain. Reason: %s.%s (%s): Standardowe zakończenie działania%s: Otrzymano sygnał %d. Kończenie działania!%s: Zakończenie działania wykonane%s: Wymuszenie zamknięcia w?tku %ld  użytkownik: '%-.48s'Nie można stworzyć socket'u IPTabela '%-.192s' nie ma indeksu takiego jak w CREATE INDEX. Stwórz tabelęNie oczekiwano separatora. SprawdĽ podręcznikNie można użyć stałej długo?ci wiersza z polami typu BLOB. Użyj 'fields terminated by'Plik '%-.128s' musi znajdować sie w katalogu bazy danych lub mieć prawa czytania przez wszystkichPlik '%-.200s' już istniejeRecordów: %ld  Usuniętych: %ld  Pominiętych: %ld  Ostrzeżeń: %ldRekordów: %ld  Duplikatów: %ldBłędna podczę?ć klucza. Użyta czę?ć klucza nie jest łańcuchem lub użyta długo?ć  jest większa niż czę?ć kluczaNie można usun?ć wszystkich pól wykorzystuj?c ALTER TABLE. W zamian użyj DROP TABLENie można wykonać operacji DROP %s %`-.192s. SprawdĽ, czy to pole/klucz istniejeRekordów: %ld  Duplikatów: %ld  Ostrzeżeń: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataNieznany identyfikator w?tku: %luNie jeste? wła?cicielem w?tku %lldNie ma żadej użytej tabeliZbyt wiele łańcuchów dla kolumny %-.192s i polecenia SETNie można stworzyć unikalnej nazwy pliku z logiem %-.200s.(1-999)Tabela '%-.192s' została zablokowana przez READ i nie może zostać zaktualizowanaTabela '%-.192s' nie została zablokowana poleceniem LOCK TABLESYou should never see itNiedozwolona nazwa bazy danych '%-.100T'Niedozwolona nazwa tabeli '%-.100s'...Operacja SELECT będzie dotyczyła zbyt wielu rekordów i prawdopodobnie zajmie bardzo dużo czasu. SprawdĽ warunek WHERE i użyj SQL_OPTION BIG_SELECTS=1 je?li operacja SELECT jest poprawnaUnknown errorUnkown procedure %-.192sIncorrect parameter count to procedure %-.192sIncorrect parameters to procedure %-.192sUnknown table '%-.192s' in %-.32sField '%-.192s' specified twiceInvalid use of group functionTable '%-.192s' uses a extension that doesn't exist in this MariaDB versionA table must have at least 1 columnThe table '%-.192s' is fullUnknown character set: '%-.64s'Too many tables; MariaDB can only use %d tables in a joinToo many columnsRow size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBsThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededCross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerCan't load function '%-.192s'Can't initialize function '%-.192s'; %-.80sNo paths allowed for shared libraryFunction '%-.192s' already existsCan't open shared library '%-.192s' (errno: %d, %-.128s)Can't find symbol '%-.128s' in libraryFunction '%-.192s' is not definedHost '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'Host '%-.64s' is not allowed to connect to this MariaDB serverYou are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settingsYou must have privileges to update tables in the mysql database to be able to change passwords for othersCan't find any matching row in the user tableRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory you can consult the manual for any possible OS dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192sInvalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionSomething is wrong in your syntaxDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sAll tables in the MERGE table are not defined identicallyCan't write, because of unique constraint, to table '%-.192s'BLOB column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYNie można utworzyć obcego serwera '%s', ponieważ już istniejeThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionPowtórzone wystąpienie '%-.64T' dla klucza '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAccess denied for user '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionPowtórzone wystąpienie dla klucza '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledportuguese/errmsg.sys000064400000235540150343473000011015 0ustar00���1o��=�2/9KOMW-144)266:>L6',8/3,,@*,EB)LpL2D:&%&*$+#5;-#",:##1%@IP-CQ~* @VBid?!�VI/`"--EM2+#�#>4*)1L1-N��xx(6CJ7'oOquN:�H$�XE[^@%m=(o3RV046M6O>9>d#-XDS�//>0(? ""l-A"Td*C]c�v\kqKa6PIebd4kh[ESL&)+<UG)AHQQ-G1;0KP$;<$(N2%&)1,Aw87�+w&>>E.,3I/UQ7c!��[H�L$&V9!�"-4fd4(3E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%wG_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?28|�80f)%,6%45-&1Z)/"@I+1%#3>n'l44>=m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7(FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7 F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�)i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ1A-%)Q)(-)PP;I��hashchkisamchkNÃOSIMNão pode criar o arquivo '%-.200s' (erro no. %M)Não pode criar a tabela %`s.%`s (erro no. %M)Não pode criar o banco de dados '%-.192s' (erro no. %M)Não pode criar o banco de dados '%-.192s'; este banco de dados já existeNão pode eliminar o banco de dados '%-.192s'; este banco de dados não existeErro ao eliminar banco de dados (não pode eliminar '%-.192s' - erro no. %M)Erro ao eliminar banco de dados (não pode remover diretório '%-.192s' - erro no. %M)Erro na remoção de '%-.192s' (erro no. %M)Não pode ler um registro numa tabela do sistemaNão pode obter o status de '%-.200s' (erro no. %M)Não pode obter o diretório corrente (erro no. %M)Não pode travar o arquivo (erro no. %M)Não pode abrir o arquivo '%-.200s' (erro no. %M)Não pode encontrar o arquivo '%-.200s' (erro no. %M)Não pode ler o diretório de '%-.192s' (erro no. %M)Não pode mudar para o diretório '%-.192s' (erro no. %M)Registro alterado desde a última leitura da tabela '%-.192s'Disco cheio (%s). Aguardando alguém liberar algum espaço... (erro no. %M)Não pode gravar. Chave duplicada na tabela '%-.192s'Erro ao fechar '%-.192s' (erro no. %M)Erro ao ler arquivo '%-.200s' (erro no. %M)Erro ao renomear '%-.210s' para '%-.210s' (erro no. %M)Erro ao gravar arquivo '%-.200s' (erro no. %M)'%-.192s' está com travamento contra alteraçõesOrdenação abortadaVisão '%-.192s' não existe para '%-.192s'Obteve erro %M no manipulador de tabelas %sStorage engine %s of the table %`s.%`s doesn't have this optionNão pode encontrar registro em '%-.192s'Informação incorreta no arquivo '%-.200s'Arquivo de índice incorreto para tabela '%-.200s'; tente repará-loArquivo de índice desatualizado para tabela '%-.192s'; repare-o!Tabela '%-.192s' é somente para leituraSem memória. Reinicie o programa e tente novamente (necessita de %d bytes)Não há memória suficiente para ordenação. Considere aumentar o tamanho do retentor (buffer) de ordenaçãoEncontrado fim de arquivo inesperado ao ler arquivo '%-.192s' (erro no. %M)Excesso de conexõesSem memória.Não pode obter nome do 'host' para seu endereçoNegociação de acesso falhouAcesso negado para o usuário '%s'@'%s' ao banco de dados '%-.192s'Acesso negado para o usuário '%s'@'%s' (senha usada: %s)Nenhum banco de dados foi selecionadoComando desconhecidoColuna '%-.192s' não pode ser vaziaBanco de dados '%-.192s' desconhecidoTabela '%-.192s' já existeTabela '%-.100T' desconhecidaColuna '%-.192s' em '%-.192s' é ambígua'Shutdown' do servidor em andamentoColuna '%-.192s' desconhecida em '%-.192s''%-.192s' não está em 'GROUP BY'Não pode agrupar em '%-.192s'Cláusula contém funções de soma e colunas juntasContagem de colunas não confere com a contagem de valoresNome identificador '%-.100T' é longo demaisNome da coluna '%-.192s' duplicadoNome da chave '%-.192s' duplicadoEntrada '%-.192T' duplicada para a chave %dEspecificador de coluna incorreto para a coluna '%-.192s'%s próximo a '%-.80T' na linha %dConsulta (query) estava vaziaTabela/alias '%-.192s' não únicaValor padrão (default) inválido para '%-.192s'Definida mais de uma chave primáriaEspecificadas chaves demais. O máximo permitido são %d chavesEspecificadas partes de chave demais. O máximo permitido são %d partesChave especificada longa demais. O comprimento de chave máximo permitido é %dColuna chave '%-.192s' não existe na tabelaBLOB column %`s can't be used in key specification in the %s tableComprimento da coluna '%-.192s' grande demais (max = %lu); use BLOB em seu lugarDefinição incorreta de tabela. Somente é permitido um único campo auto-incrementado e ele tem que ser definido como chaveCould not delete gtid domain. Reason: %s.%s (%s): 'Shutdown' normal%s: Obteve sinal %d. Abortando!%s: 'Shutdown' completo%s: Forçando finalização da 'thread' %ld - usuário '%-.48s'Não pode criar o soquete IPTabela '%-.192s' não possui um índice como o usado em CREATE INDEX. Recrie a tabelaArgumento separador de campos não é o esperado. Cheque o manualVocê não pode usar comprimento de linha fixo com BLOBs. Por favor, use campos com comprimento limitadoArquivo '%-.128s' tem que estar no diretório do banco de dados ou ter leitura possível para todosArquivo '%-.200s' já existeRegistros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ldRegistros: %ld - Duplicados: %ldSub parte da chave incorreta. A parte da chave usada não é uma 'string' ou o comprimento usado é maior que parte da chave ou o manipulador de tabelas não suporta sub chaves únicasVocê não pode deletar todas as colunas com ALTER TABLE; use DROP TABLE em seu lugarNão se pode fazer DROP %s %`-.192s. Confira se esta coluna/chave existeRegistros: %ld - Duplicados: %ld - Avisos: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for data'Id' de 'thread' %lu desconhecidoVocê não é proprietário da 'thread' %lldNenhuma tabela usada'Strings' demais para coluna '%-.192s' e SETNão pode gerar um nome de arquivo de 'log' único '%-.200s'.(1-999)Tabela '%-.192s' foi travada com trava de leitura e não pode ser atualizadaTabela '%-.192s' não foi travada com LOCK TABLESYou should never see itNome de banco de dados '%-.100T' incorretoNome de tabela '%-.100s' incorretoO SELECT examinaria registros demais e provavelmente levaria muito tempo. Cheque sua cláusula WHERE e use SET SQL_BIG_SELECTS=1, se o SELECT estiver corretoErro desconhecido'Procedure' '%-.192s' desconhecidaNúmero de parâmetros incorreto para a 'procedure' '%-.192s'Parâmetros incorretos para a 'procedure' '%-.192s'Tabela '%-.192s' desconhecida em '%-.32s'Coluna '%-.192s' especificada duas vezesUso inválido de função de agrupamento (GROUP)Tabela '%-.192s' usa uma extensão que não existe nesta versão do MariaDBUma tabela tem que ter pelo menos uma (1) colunaTabela '%-.192s' está cheiaConjunto de caracteres '%-.64s' desconhecidoTabelas demais. O MariaDB pode usar somente %d tabelas em uma junção (JOIN)Colunas demaisTamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %ld. Você tem que mudar alguns campos para BLOBsEstouro da pilha do 'thread'. Usados %ld de uma pilha de %ld. Use 'mariadbd --thread_stack=#' para especificar uma pilha maior, se necessárioDependência cruzada encontrada em junção externa (OUTER JOIN); examine as condições utilizadas nas cláusulas 'ON'Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerNão pode carregar a função '%-.192s'Não pode inicializar a função '%-.192s' - '%-.80s'Não há caminhos (paths) permitidos para biblioteca compartilhadaFunção '%-.192s' já existeNão pode abrir biblioteca compartilhada '%-.192s' (erro no. %d, %-.128s)Não pode encontrar a função '%-.128s' na bibliotecaFunção '%-.192s' não está definida'Host' '%-.64s' está bloqueado devido a muitos erros de conexão. Desbloqueie com 'mariadb-admin flush-hosts''Host' '%-.64s' não tem permissão para se conectar com este servidor MariaDBVocê está usando o MariaDB como usuário anônimo e usuários anônimos não têm permissão para mudar senhasVocê deve ter privilégios para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outrosNão pode encontrar nenhuma linha que combine na tabela usuário (user table)Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ldNão pode criar uma nova 'thread' (erro no. %M). Se você não estiver sem memória disponível, você pode consultar o manual sobre um possível 'bug' dependente do sistema operacionalContagem de colunas não confere com a contagem de valores na linha %luNão pode reabrir a tabela '%-.192sUso inválido do valor NULLObteve erro '%s' em regexpMistura de colunas agrupadas (com MIN(), MAX(), COUNT(), ...) com colunas não agrupadas é ilegal, se não existir uma cláusula de agrupamento (cláusula GROUP BY)Não existe tal permissão (grant) definida para o usuário '%-.48s' no 'host' '%-.64s'Comando '%-.100T' negado para o usuário '%s'@'%s' na tabela %`s.%`sComando '%-.32s' negado para o usuário '%s'@'%s' na coluna '%-.192s', na tabela '%-.192s'Comando GRANT/REVOKE ilegal. Por favor consulte no manual quais privilégios podem ser usadosArgumento de 'host' ou de usuário para o GRANT é longo demaisTabela '%-.192s.%-.192s' não existeNão existe tal permissão (grant) definido para o usuário '%-.48s' no 'host' '%-.64s', na tabela '%-.192s'Comando usado não é permitido para esta versão do MariaDBVocê tem um erro de sintaxe no seu SQL'Thread' de inserção retardada (atrasada) pois não conseguiu obter a trava solicitada para tabela '%-.192s'Excesso de 'threads' retardadas (atrasadas) em usoConexão %ld abortou para o banco de dados '%-.192s' - usuário '%-.48s' (%-.64s)Obteve um pacote maior do que a taxa máxima de pacotes definida (max_allowed_packet)Obteve um erro de leitura no 'pipe' da conexãoObteve um erro em fcntl()Obteve pacotes fora de ordemNão conseguiu descomprimir pacote de comunicaçãoObteve um erro na leitura de pacotes de comunicaçãoObteve expiração de tempo (timeout) na leitura de pacotes de comunicaçãoObteve um erro na escrita de pacotes de comunicaçãoObteve expiração de tempo ('timeout') na escrita de pacotes de comunicação'String' resultante é mais longa do que 'max_allowed_packet'Tipo de tabela usado (%s) não permite colunas BLOB/TEXTTipo de tabela usado (%s) não permite colunas AUTO_INCREMENTINSERT DELAYED não pode ser usado com a tabela '%-.192s', porque ela está travada com LOCK TABLESNome de coluna '%-.100s' incorretoThe storage engine %s can't index column %`sTodas as tabelas contidas na tabela fundida (MERGE) não estão definidas identicamenteNão pode gravar, devido à restrição UNIQUE, na tabela '%-.192s'Coluna BLOB '%-.192s' usada na especificação de chave sem o comprimento da chaveTodas as partes de uma chave primária devem ser não-nulas. Se você precisou usar um valor nulo (NULL) em uma chave, use a cláusula UNIQUE em seu lugarO resultado consistiu em mais do que uma linhaEste tipo de tabela requer uma chave primáriaEsta versão do MariaDB não foi compilada com suporte a RAIDVocê está usando modo de atualização seguro e tentou atualizar uma tabela sem uma cláusula WHERE que use uma coluna chaveChave '%-.192s' não existe na tabela '%-.192s'Não pode abrir a tabelaO manipulador de tabela não suporta %sNão lhe é permitido executar este comando em uma transaçãoObteve erro %M durante COMMITObteve erro %M durante ROLLBACKObteve erro %M durante FLUSH_LOGSObteve erro %M durante CHECKPOINTConexão %lld abortada para banco de dados '%-.192s' - usuário '%-.48s' - 'host' '%-.64s'%-.64s ('%-.64s')You should never see itBinlog fechado. Não pode fazer RESET MASTERFalhou na reconstrução do índice da tabela 'dumped' '%-.192s'Erro no 'master' '%-.64s'Erro de rede lendo do 'master'Erro de rede gravando no 'master'Não pode encontrar um índice para o texto todo que combine com a lista de colunasNão pode executar o comando dado porque você tem tabelas ativas travadas ou uma transação ativaVariável de sistema '%-.*s' desconhecidaTabela '%-.192s' está marcada como danificada e deve ser reparadaTabela '%-.192s' está marcada como danificada e a última reparação (automática?) falhouAviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)Transações multi-declaradas (multi-statement transactions) requeriram mais do que o valor limite (max_binlog_cache_size) de bytes para armazenagem. Aumente o valor desta variável do mariadbd e tente novamenteEsta operação não pode ser realizada com um 'slave' '%2$*1$s' em execução. Execute STOP SLAVE '%2$*1$s' primeiroEsta operação requer um 'slave' em execução. Configure  o 'slave' e execute START SLAVEO servidor não está configurado como 'slave'. Acerte o arquivo de configuração ou use CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logNão conseguiu criar 'thread' de 'slave'. Verifique os recursos do sistemaUsuário '%-.64s' já possui mais que o valor máximo de conexões (max_user_connections) ativasVocê pode usar apenas expressões constantes com SETTempo de espera (timeout) de travamento excedido. Tente reiniciar a transaçãoO número total de travamentos excede o tamanho da tabela de travamentosTravamentos de atualização não podem ser obtidos durante uma transação de tipo READ UNCOMMITTEDDROP DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leituraCREATE DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leituraArgumentos errados para %sNão é permitido a '%s'@'%s' criar novos usuáriosDefinição incorreta da tabela. Todas as tabelas contidas na junção devem estar no mesmo banco de dadosEncontrado um travamento fatal (deadlock) quando tentava obter uma trava. Tente reiniciar a transaçãoO tipo de tabela utilizado (%s) não suporta índices de texto completo (fulltext indexes)Não pode acrescentar uma restrição de chave estrangeira para `%s`Não pode acrescentar uma linha filha: uma restrição de chave estrangeira falhouNão pode apagar uma linha pai: uma restrição de chave estrangeira falhouErro conectando com o master: %-.128sErro rodando consulta no master: %-.128sErro quando executando comando %s: %-.128sUso errado de %s e %sOs comandos SELECT usados têm diferente número de colunasNão posso executar a consulta porque você tem um conflito de travamento de leituraMistura de tabelas transacional e não-transacional está desabilitadaOpção '%s' usada duas vezes no comandoUsuário '%-.64s' tem excedido o '%s' recurso (atual valor: %ld)Acesso negado. Você precisa o privilégio %-.128s para essa operaçãoVariável '%-.64s' é uma SESSION variável e não pode ser usada com SET GLOBALVariável '%-.64s' é uma GLOBAL variável e deve ser configurada com SET GLOBALVariável '%-.64s' não tem um valor padrãoVariável '%-.64s' não pode ser configurada para o valor de '%-.200T'Tipo errado de argumento para variável '%-.64s'Variável '%-.64s' somente pode ser configurada, não lidaErrado uso/colocação de '%s'Esta versão de MariaDB não suporta ainda '%s'Obteve fatal erro %d: '%-.320s' do master quando lendo dados do binary logSlave SQL thread ignorado a consulta devido às normas de replicação-*-tabelaVariable '%-.192s' is a %s variableDefinição errada da chave estrangeira para '%-.192s': %sReferência da chave e referência da tabela não coincidemOperand should contain %d column(s)Subconsulta retorna mais que 1 registroDesconhecido manipulador de declaração preparado (%.*s) determinado para %sBanco de dado de ajuda corrupto ou não existenteReferência cíclica em subconsultasConvertendo coluna '%s' de %s para %sReferência '%-.64s' não suportada (%s)Cada tabela derivada deve ter seu próprio aliasSelect %u foi reduzido durante otimizaçãoTabela '%-.192s' de um dos SELECTs não pode ser usada em %-.32sCliente não suporta o protocolo de autenticação exigido pelo servidor; considere a atualização do cliente MariaDBTodas as partes de uma SPATIAL index devem ser NOT NULLCOLLATION '%s' não é válida para CHARACTER SET '%s'O slave já está rodandoO slave já está paradoTamanho muito grande dos dados des comprimidos. O máximo tamanho é %d. (provavelmente, o comprimento dos dados descomprimidos está corrupto)ZLIB: Não suficiente memória disponívelZLIB: Não suficiente espaço no buffer emissor (provavelmente, o comprimento dos dados descomprimidos está corrupto)ZLIB: Dados de entrada está corruptoRow %u was cut by %s)Conta de registro é menor que a conta de coluna na linha %luConta de registro é maior que a conta de coluna na linha %luDado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %luOut of range value for column '%s' at row %luDado truncado para coluna '%s' na linha %luUsando engine de armazenamento %s para tabela '%s'Combinação ilegal de collations (%s,%s) e (%s,%s) para operação '%s'Cannot drop one or more of the requested usersNão pode revocar todos os privilégios, grant para um ou mais dos usuários pedidosIlegal combinação de collations (%s,%s), (%s,%s), (%s,%s) para operação '%s'Ilegal combinação de collations para operação '%s'Variável '%-.64s' não é uma variável componente (Não pode ser usada como XXXX.variável_nome)Collation desconhecida: '%-.64s'SSL parâmetros em CHANGE MASTER são ignorados porque este escravo MariaDB foi compilado sem o SSL suporte. Os mesmos podem ser usados mais tarde quando o escravo MariaDB com SSL seja iniciado.Servidor está rodando em --secure-auth modo, porêm '%s'@'%s' tem senha no formato antigo; por favor troque a senha para o novo formatoCampo ou referência '%-.192s%s%-.192s%s%-.192s' de SELECT #%d foi resolvido em SELECT #%dParâmetro ou combinação de parâmetros errado para START SLAVE UNTILÉ recomendado para rodar com --skip-slave-start quando fazendo replicação passo-por-passo com START SLAVE UNTIL, de outra forma você não está seguro em caso de inesperada reinicialição do mariadbd escravoThread SQL não pode ser inicializado tal que opções UNTIL são ignoradasIncorreto nome de índice '%-.100s'Incorreto nome de catálogo '%-.100s'Falha em Query cache para configurar tamanho %llu, novo tamanho de query cache é %luColuna '%-.192s' não pode ser parte de índice FULLTEXTKey cache desconhecida '%-.100s'MariaDB foi inicializado em modo --skip-name-resolve. Você necesita reincializá-lo sem esta opção para este grant funcionarMotor de tabela desconhecido '%s''%s' é desatualizado. Use '%s' em seu lugarA tabela destino %-.100s do %s não é atualizávelO recurso '%s' foi desativado; você necessita MariaDB construído com '%s' para ter isto funcionandoO servidor MariaDB está rodando com a opção %s razão pela qual não pode executar esse commandoColuna '%-.100s' tem valor duplicado '%-.64s' em %sTruncado errado %-.32T valor: '%-.128T'Incorreta definição de tabela; Pode ter somente uma coluna TIMESTAMP com CURRENT_TIMESTAMP em DEFAULT ou ON UPDATE cláusulaInválida cláusula ON UPDATE para campo '%-.192s'This command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYNão foi possível criar o servidor externo '%s' porque ele já existeThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionEntrada '%-.64T' duplicada para a chave '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comentário para a tabela '%-.64s' é longo demais (max = %u)Comentário para o campo '%-.64s' é longo demais (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAcesso negado para o usuário '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesNúmero de condição inválidoSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionEntrada duplicada para a chave '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignorado a consulta devido '%s'AUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmaria_add_gis_sp_bootstrap.sql000064400000003223150343473000012626 0ustar00-- Copyright (C) 2014 MariaDB Ab.
--
-- 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

# This part creates stored procedures required by the OpenGIS standards.
# script is prepared to be run with the --bootstrap server option

SET sql_mode='';



DROP PROCEDURE IF EXISTS AddGeometryColumn;
DROP PROCEDURE IF EXISTS DropGeometryColumn;

CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
   t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
begin
  set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end ;

CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64),
   t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
begin
  set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end ;



english/errmsg.sys000064400000227703150343473000010246 0ustar00��&o��=�(',16<;)"*(''(*6F.()6)#
+$@)7->@=$76 )&:'& %0"$-37,CQ^*'0SCLK8�F--`!,5A0"�1,"!M$ :�vAx,$"9'"e?gj./�2rB;P\/&U:�D @4*)+*+*849X -d>J[&':f/4=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?+8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7!FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�"i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchkNOYESCan't create file '%-.200s' (errno: %M)Can't create table %`s.%`s (errno: %M)Can't create database '%-.192s' (errno: %M)Can't create database '%-.192s'; database existsCan't drop database '%-.192s'; database doesn't existError dropping database (can't delete '%-.192s', errno: %M)Error dropping database (can't rmdir '%-.192s', errno: %M)Error on delete of '%-.192s' (errno: %M)Can't read record in system tableCan't get status of '%-.200s' (errno: %M)Can't get working directory (errno: %M)Can't lock file (errno: %M)Can't open file: '%-.200s' (errno: %M)Can't find file: '%-.200s' (errno: %M)Can't read dir of '%-.192s' (errno: %M)Can't change dir to '%-.192s' (errno: %M)Record has changed since last read in table '%-.192s'Disk full (%s); waiting for someone to free some space... (errno: %M)Can't write; duplicate key in table '%-.192s'Error on close of '%-.192s' (errno: %M)Error reading file '%-.200s' (errno: %M)Error on rename of '%-.210s' to '%-.210s' (errno: %M)Error writing file '%-.200s' (errno: %M)'%-.192s' is locked against changeSort abortedView '%-.192s' doesn't exist for '%-.192s'Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionCan't find record in '%-.192s'Incorrect information in file: '%-.200s'Index for table '%-.200s' is corrupt; try to repair itOld key file for table '%-.192s'; repair it!Table '%-.192s' is read onlyOut of memory; restart server and try again (needed %d bytes)Out of sort memory, consider increasing server sort buffer sizeUnexpected EOF found when reading file '%-.192s' (errno: %M)Too many connectionsOut of memory.Can't get hostname for your addressBad handshakeAccess denied for user '%s'@'%s' to database '%-.192s'Access denied for user '%s'@'%s' (using password: %s)No database selectedUnknown commandColumn '%-.192s' cannot be nullUnknown database '%-.192s'Table '%-.192s' already existsUnknown table '%-.100T'Column '%-.192s' in %-.192s is ambiguousServer shutdown in progressUnknown column '%-.192s' in '%-.192s''%-.192s' isn't in GROUP BYCan't group on '%-.192s'Statement has sum functions and columns in same statementColumn count doesn't match value countIdentifier name '%-.100T' is too longDuplicate column name '%-.192s'Duplicate key name '%-.192s'Duplicate entry '%-.192T' for key %dIncorrect column specifier for column '%-.192s'%s near '%-.80T' at line %dQuery was emptyNot unique table/alias: '%-.192s'Invalid default value for '%-.192s'Multiple primary key definedToo many keys specified; max %d keys allowedToo many key parts specified; max %d parts allowedSpecified key was too long; max key length is %d bytesKey column '%-.192s' doesn't exist in tableBLOB column %`s can't be used in key specification in the %s tableColumn length too big for column '%-.192s' (max = %lu); use BLOB or TEXT insteadIncorrect table definition; there can be only one auto column and it must be defined as a keyCould not delete gtid domain. Reason: %s.%s (initiated by: %s): Normal shutdown%s: Got signal %d. Aborting!%s: Shutdown complete%s: Forcing close of thread %ld  user: '%-.48s'Can't create IP socketTable '%-.192s' has no index like the one used in CREATE INDEX; recreate the tableField separator argument is not what is expected; check the manualYou can't use fixed rowlength with BLOBs; please use 'fields terminated by'The file '%-.128s' must be in the database directory or be readable by allFile '%-.200s' already existsRecords: %ld  Deleted: %ld  Skipped: %ld  Warnings: %ldRecords: %ld  Duplicates: %ldIncorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keysYou can't delete all columns with ALTER TABLE; use DROP TABLE insteadCan't DROP %s %`-.192s; check that it existsRecords: %ld  Duplicates: %ld  Warnings: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataUnknown thread id: %luYou are not owner of thread %lldNo tables usedToo many strings for column %-.192s and SETCan't generate a unique log-filename %-.200s.(1-999)Table '%-.192s' was locked with a READ lock and can't be updatedTable '%-.192s' was not locked with LOCK TABLESYou should never see itIncorrect database name '%-.100T'Incorrect table name '%-.100s'The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okayUnknown errorUnknown procedure '%-.192s'Incorrect parameter count to procedure '%-.192s'Incorrect parameters to procedure '%-.192s'Unknown table '%-.192s' in %-.32sColumn '%-.192s' specified twiceInvalid use of group functionTable '%-.192s' uses an extension that doesn't exist in this MariaDB versionA table must have at least 1 columnThe table '%-.192s' is fullUnknown character set: '%-.64s'Too many tables; MariaDB can only use %d tables in a joinToo many columnsRow size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBsThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededCross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerCan't load function '%-.192s'Can't initialize function '%-.192s'; %-.80sNo paths allowed for shared libraryFunction '%-.192s' already existsCan't open shared library '%-.192s' (errno: %d, %-.128s)Can't find symbol '%-.128s' in libraryFunction '%-.192s' is not definedHost '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'Host '%-.64s' is not allowed to connect to this MariaDB serverYou are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settingsYou must have privileges to update tables in the mysql database to be able to change passwords for othersCan't find any matching row in the user tableRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192s'Invalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to useDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sUnable to open underlying table which is differently defined or of non-MyISAM type or doesn't existCan't write, because of unique constraint, to table '%-.192s'BLOB/TEXT column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe storage engine for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDuplicate entry '%-.64T' for key '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAccess denied for user '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDuplicate entry for key '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledbulgarian/errmsg.sys000064400000230343150343473000010553 0ustar00��%'o�3�=�(',16<;)"*(''(*6F.()6)#
+$@)7->@=$76 )&:'& %0"$-37,CQ^*'0SCLK8�F--`!,5A0"�1,"!M$ :�vAx,$"9'"e?gj./�2rB;P\/&U:�D @4*)+*+*849X -d>J[&':f/4=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?+8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7!FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED�fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�"i,�"�94a9JlEH���b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;Ic�hashchkisamchkNOYESCan't create file '%-.200s' (errno: %M)Can't create table %`s.%`s (errno: %M)Can't create database '%-.192s' (errno: %M)Can't create database '%-.192s'; database existsCan't drop database '%-.192s'; database doesn't existError dropping database (can't delete '%-.192s', errno: %M)Error dropping database (can't rmdir '%-.192s', errno: %M)Error on delete of '%-.192s' (errno: %M)Can't read record in system tableCan't get status of '%-.200s' (errno: %M)Can't get working directory (errno: %M)Can't lock file (errno: %M)Can't open file: '%-.200s' (errno: %M)Can't find file: '%-.200s' (errno: %M)Can't read dir of '%-.192s' (errno: %M)Can't change dir to '%-.192s' (errno: %M)Record has changed since last read in table '%-.192s'Disk full (%s); waiting for someone to free some space... (errno: %M)Can't write; duplicate key in table '%-.192s'Error on close of '%-.192s' (errno: %M)Error reading file '%-.200s' (errno: %M)Error on rename of '%-.210s' to '%-.210s' (errno: %M)Error writing file '%-.200s' (errno: %M)'%-.192s' is locked against changeSort abortedView '%-.192s' doesn't exist for '%-.192s'Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this optionCan't find record in '%-.192s'Incorrect information in file: '%-.200s'Index for table '%-.200s' is corrupt; try to repair itOld key file for table '%-.192s'; repair it!Table '%-.192s' is read onlyOut of memory; restart server and try again (needed %d bytes)Out of sort memory, consider increasing server sort buffer sizeUnexpected EOF found when reading file '%-.192s' (errno: %M)Too many connectionsOut of memory.Can't get hostname for your addressBad handshakeAccess denied for user '%s'@'%s' to database '%-.192s'Access denied for user '%s'@'%s' (using password: %s)No database selectedUnknown commandColumn '%-.192s' cannot be nullUnknown database '%-.192s'Table '%-.192s' already existsUnknown table '%-.100T'Column '%-.192s' in %-.192s is ambiguousServer shutdown in progressUnknown column '%-.192s' in '%-.192s''%-.192s' isn't in GROUP BYCan't group on '%-.192s'Statement has sum functions and columns in same statementColumn count doesn't match value countIdentifier name '%-.100T' is too longDuplicate column name '%-.192s'Duplicate key name '%-.192s'Duplicate entry '%-.192T' for key %dIncorrect column specifier for column '%-.192s'%s near '%-.80T' at line %dQuery was emptyNot unique table/alias: '%-.192s'Invalid default value for '%-.192s'Multiple primary key definedToo many keys specified; max %d keys allowedToo many key parts specified; max %d parts allowedSpecified key was too long; max key length is %d bytesKey column '%-.192s' doesn't exist in tableBLOB column %`s can't be used in key specification in the %s tableColumn length too big for column '%-.192s' (max = %lu); use BLOB or TEXT insteadIncorrect table definition; there can be only one auto column and it must be defined as a keyCould not delete gtid domain. Reason: %s.%s (initiated by: %s): Normal shutdown%s: Got signal %d. Aborting!%s: Shutdown complete%s: Forcing close of thread %ld  user: '%-.48s'Can't create IP socketTable '%-.192s' has no index like the one used in CREATE INDEX; recreate the tableField separator argument is not what is expected; check the manualYou can't use fixed rowlength with BLOBs; please use 'fields terminated by'The file '%-.128s' must be in the database directory or be readable by allFile '%-.200s' already existsRecords: %ld  Deleted: %ld  Skipped: %ld  Warnings: %ldRecords: %ld  Duplicates: %ldIncorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keysYou can't delete all columns with ALTER TABLE; use DROP TABLE insteadCan't DROP %s %`-.192s; check that it existsRecords: %ld  Duplicates: %ld  Warnings: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataUnknown thread id: %luYou are not owner of thread %lldNo tables usedToo many strings for column %-.192s and SETCan't generate a unique log-filename %-.200s.(1-999)Table '%-.192s' was locked with a READ lock and can't be updatedTable '%-.192s' was not locked with LOCK TABLESYou should never see itIncorrect database name '%-.100T'Incorrect table name '%-.100s'The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okayUnknown errorUnknown procedure '%-.192s'Incorrect parameter count to procedure '%-.192s'Incorrect parameters to procedure '%-.192s'Unknown table '%-.192s' in %-.32sColumn '%-.192s' specified twiceInvalid use of group functionTable '%-.192s' uses an extension that doesn't exist in this MariaDB versionA table must have at least 1 columnThe table '%-.192s' is fullUnknown character set: '%-.64s'Too many tables; MariaDB can only use %d tables in a joinToo many columnsRow size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBsThread stack overrun:  Used: %ld of a %ld stack.  Use 'mariadbd --thread_stack=#' to specify a bigger stack if neededCross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerCan't load function '%-.192s'Can't initialize function '%-.192s'; %-.80sNo paths allowed for shared libraryFunction '%-.192s' already existsCan't open shared library '%-.192s' (errno: %d, %-.128s)Can't find symbol '%-.128s' in libraryFunction '%-.192s' is not definedHost '%-.64s' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'Host '%-.64s' is not allowed to connect to this MariaDB serverYou are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settingsYou must have privileges to update tables in the mysql database to be able to change passwords for othersCan't find any matching row in the user tableRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192s'Invalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to useDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sUnable to open underlying table which is differently defined or of non-MyISAM type or doesn't existCan't write, because of unique constraint, to table '%-.192s'BLOB/TEXT column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe storage engine for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionDuplicate entry '%-.64T' for key '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTAccess denied for user '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)Трябва първо да си смените паролата със SET PASSWORD за да можете да изпълните тази командаFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionDuplicate entry for key '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTПаролата ви е изтекла. За да влезете трябва да я смените използвайки клиент който поддрържа такива паролиFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryОтказан достъп при опит за смяна към потребител %-.48s'@'%-.64s' (използвана парола: %s). Затваряне на връзкатаInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledgreek/errmsg.sys000064400000245136150343473000007712 0ustar00���@o��=�iex����wd�]`tU~}��zrt�x9B;i@EA��>���4VJA|i8N52*Mk3T>iB@)&@E2BAZDV\ySC�x*>]>8A����2u3���X`+7FK}P>-2+.UH6D4�\6'�4���xe];6~w?�p���/�2rB;P\/&U:%D @4*)+*+*849Y -d>E[&':f/-=V#63_ <I>�iLSq6L876FCE-JC7+7;$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?F8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7OFLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�=i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I�hashchkisamchkΟΧΙΝΑΙΑδύνατη η δημιουργία του αρχείου '%-.200s' (κωδικός λάθους: %M)Αδύνατη η δημιουργία του πίνακα %`s.%`s (κωδικός λάθους: %M)Αδύνατη η δημιουργία της βάσης δεδομένων '%-.192s' (κωδικός λάθους: %M)Αδύνατη η δημιουργία της βάσης δεδομένων '%-.192s'; Η βάση δεδομένων υπάρχει ήδηΑδύνατη η διαγραφή της βάσης δεδομένων '%-.192s'. Η βάση δεδομένων δεν υπάρχειΠαρουσιάστηκε πρόβλημα κατά τη διαγραφή της βάσης δεδομένων (αδύνατη η διαγραφή '%-.192s', κωδικός λάθους: %M)Παρουσιάστηκε πρόβλημα κατά τη διαγραφή της βάσης δεδομένων (αδύνατη η διαγραφή του φακέλλου '%-.192s', κωδικός λάθους: %M)Παρουσιάστηκε πρόβλημα κατά τη διαγραφή '%-.192s' (κωδικός λάθους: %M)Αδύνατη η ανάγνωση εγγραφής από πίνακα του συστήματοςΑδύνατη η λήψη πληροφοριών για την κατάσταση του '%-.200s' (κωδικός λάθους: %M)Ο φάκελλος εργασίας δεν βρέθηκε (κωδικός λάθους: %M)Το αρχείο δεν μπορεί να κλειδωθεί (κωδικός λάθους: %M)Δεν είναι δυνατό να ανοιχτεί το αρχείο: '%-.200s' (κωδικός λάθους: %M)Δεν βρέθηκε το αρχείο: '%-.200s' (κωδικός λάθους: %M)Δεν είναι δυνατό να διαβαστεί ο φάκελλος του '%-.192s' (κωδικός λάθους: %M)Αδύνατη η αλλαγή του τρέχοντος καταλόγου σε '%-.192s' (κωδικός λάθους: %M)Η εγγραφή έχει αλλάξει από την τελευταία φορά που ανασύρθηκε από τον πίνακα '%-.192s'Δεν υπάρχει χώρος στο δίσκο (%s). Παρακαλώ, περιμένετε να ελευθερωθεί χώρος... (κωδικός λάθους: %M)Δεν είναι δυνατή η καταχώρηση, η τιμή υπάρχει ήδη στον πίνακα '%-.192s'Παρουσιάστηκε πρόβλημα κλείνοντας το '%-.192s' (κωδικός λάθους: %M)Πρόβλημα κατά την ανάγνωση του αρχείου '%-.200s' (κωδικός λάθους: %M)Πρόβλημα κατά την μετονομασία του αρχείου '%-.210s' to '%-.210s' (κωδικός λάθους: %M)Πρόβλημα κατά την αποθήκευση του αρχείου '%-.200s' (κωδικός λάθους: %M)'%-.192s' δεν επιτρέπονται αλλαγέςΗ διαδικασία ταξινόμισης ακυρώθηκεΤο View '%-.192s' δεν υπάρχει για '%-.192s'Ελήφθη μήνυμα λάθους %M από τον χειριστή πίνακα (table handler) %sStorage engine %s of the table %`s.%`s doesn't have this optionΑδύνατη η ανεύρεση εγγραφής στο '%-.192s'Λάθος πληροφορίες στο αρχείο: '%-.200s'Λάθος αρχείο ταξινόμισης (key file) για τον πίνακα: '%-.200s'; Παρακαλώ, διορθώστε το!Παλαιό αρχείο ταξινόμισης (key file) για τον πίνακα '%-.192s'; Παρακαλώ, διορθώστε το!'%-.192s' επιτρέπεται μόνο η ανάγνωσηΔεν υπάρχει διαθέσιμη μνήμη. Προσπαθήστε πάλι, επανεκινώντας τη διαδικασία (demon) (χρειάζονται %d bytes)Δεν υπάρχει διαθέσιμη μνήμη για ταξινόμιση. Αυξήστε το sort buffer size για τη διαδικασία (demon)Κατά τη διάρκεια της ανάγνωσης, βρέθηκε απροσδόκητα το τέλος του αρχείου '%-.192s' (κωδικός λάθους: %M)Υπάρχουν πολλές συνδέσεις...Πρόβλημα με τη διαθέσιμη μνήμη (Out of thread space/memory)Δεν έγινε γνωστό το hostname για την address σαςΗ αναγνώριση (handshake) δεν έγινε σωστάΔεν επιτέρεται η πρόσβαση στο χρήστη: '%s'@'%s' στη βάση δεδομένων '%-.192s'Δεν επιτέρεται η πρόσβαση στο χρήστη: '%s'@'%s' (χρήση password: %s)Δεν επιλέχθηκε βάση δεδομένωνΑγνωστη εντολήΤο πεδίο '%-.192s' δεν μπορεί να είναι κενό (null)Αγνωστη βάση δεδομένων '%-.192s'Ο πίνακας '%-.192s' υπάρχει ήδηΑγνωστος πίνακας '%-.100T'Το πεδίο: '%-.192s' σε %-.192s δεν έχει καθοριστείΕναρξη διαδικασίας αποσύνδεσης του εξυπηρετητή (server shutdown)Αγνωστο πεδίο '%-.192s' σε '%-.192s'Χρησιμοποιήθηκε '%-.192s' που δεν υπήρχε στο group byΑδύνατη η ομαδοποίηση (group on) '%-.192s'Η διατύπωση περιέχει sum functions και columns στην ίδια διατύπωσηΤο Column count δεν ταιριάζει με το value countΤο identifier name '%-.100T' είναι πολύ μεγάλοΕπανάληψη column name '%-.192s'Επανάληψη key name '%-.192s'Διπλή εγγραφή '%-.192T' για το κλειδί %dΕσφαλμένο column specifier για το πεδίο '%-.192s'%s πλησίον '%-.80T' στη γραμμή %dΤο ερώτημα (query) που θέσατε ήταν κενόΑδύνατη η ανεύρεση unique table/alias: '%-.192s'Εσφαλμένη προκαθορισμένη τιμή (default value) για '%-.192s'Περισσότερα από ένα primary key ορίστηκανΠάρα πολλά key ορίσθηκαν. Το πολύ %d επιτρέπονταιΠάρα πολλά key parts ορίσθηκαν. Το πολύ %d επιτρέπονταιΤο κλειδί που ορίσθηκε είναι πολύ μεγάλο. Το μέγιστο μήκος είναι %dΤο πεδίο κλειδί '%-.192s' δεν υπάρχει στον πίνακαBLOB column %`s can't be used in key specification in the %s tableΠολύ μεγάλο μήκος για το πεδίο '%-.192s' (max = %lu). Παρακαλώ χρησιμοποιείστε τον τύπο BLOBΜπορεί να υπάρχει μόνο ένα auto field και πρέπει να έχει ορισθεί σαν keyCould not delete gtid domain. Reason: %s.%s (%s): Φυσιολογική διαδικασία shutdown%s: Ελήφθη το μήνυμα %d. Η διαδικασία εγκαταλείπεται!%s: Η διαδικασία Shutdown ολοκληρώθηκε%s: Το thread θα κλείσει %ld  user: '%-.48s'Δεν είναι δυνατή η δημιουργία IP socketΟ πίνακας '%-.192s' δεν έχει ευρετήριο (index) σαν αυτό που χρησιμοποιείτε στην CREATE INDEX. Παρακαλώ, ξαναδημιουργήστε τον πίνακαΟ διαχωριστής πεδίων δεν είναι αυτός που αναμενόταν. Παρακαλώ ανατρέξτε στο manualΔεν μπορείτε να χρησιμοποιήσετε fixed rowlength σε BLOBs. Παρακαλώ χρησιμοποιείστε 'fields terminated by'Το αρχείο '%-.128s' πρέπει να υπάρχει στο database directory ή να μπορεί να διαβαστεί από όλουςΤο αρχείο '%-.200s' υπάρχει ήδηΕγγραφές: %ld  Διαγραφές: %ld  Παρεκάμφθησαν: %ld  Προειδοποιήσεις: %ldΕγγραφές: %ld  Επαναλήψεις: %ldΕσφαλμένο sub part key. Το χρησιμοποιούμενο key part δεν είναι string ή το μήκος του είναι μεγαλύτεροΔεν είναι δυνατή η διαγραφή όλων των πεδίων με ALTER TABLE. Παρακαλώ χρησιμοποιείστε DROP TABLEΑδύνατη η διαγραφή (DROP %s) %`-.192s. Παρακαλώ ελέγξτε αν το πεδίο/κλειδί υπάρχειΕγγραφές: %ld  Επαναλήψεις: %ld  Προειδοποιήσεις: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataΑγνωστο thread id: %luΔεν είσθε owner του thread %lldΔεν χρησιμοποιήθηκαν πίνακεςΠάρα πολλά strings για το πεδίο %-.192s και SETΑδύνατη η δημιουργία unique log-filename %-.200s.(1-999)Ο πίνακας '%-.192s' έχει κλειδωθεί με READ lock και δεν επιτρέπονται αλλαγέςΟ πίνακας '%-.192s' δεν έχει κλειδωθεί με LOCK TABLESYou should never see itΛάθος όνομα βάσης δεδομένων '%-.100T'Λάθος όνομα πίνακα '%-.100s'Το SELECT θα εξετάσει μεγάλο αριθμό εγγραφών και πιθανώς θα καθυστερήσει. Παρακαλώ εξετάστε τις παραμέτρους του WHERE και χρησιμοποιείστε SET SQL_BIG_SELECTS=1 αν το SELECT είναι σωστόΠροέκυψε άγνωστο λάθοςΑγνωστη διαδικασία '%-.192s'Λάθος αριθμός παραμέτρων στη διαδικασία '%-.192s'Λάθος παράμετροι στην διαδικασία '%-.192s'Αγνωστος πίνακας '%-.192s' σε %-.32sΤο πεδίο '%-.192s' έχει ορισθεί δύο φορέςΕσφαλμένη χρήση της group functionΟ πίνακς '%-.192s' χρησιμοποιεί κάποιο extension που δεν υπάρχει στην έκδοση αυτή της MariaDBΕνας πίνακας πρέπει να έχει τουλάχιστον ένα πεδίοΟ πίνακας '%-.192s' είναι γεμάτοςΑγνωστο character set: '%-.64s'Πολύ μεγάλος αριθμός πινάκων. Η MariaDB μπορεί να χρησιμοποιήσει %d πίνακες σε διαδικασία joinΠολύ μεγάλος αριθμός πεδίωνΠολύ μεγάλο μέγεθος εγγραφής. Το μέγιστο μέγεθος εγγραφής, χωρίς να υπολογίζονται τα blobs, είναι %ld. Πρέπει να ορίσετε κάποια πεδία σαν blobsStack overrun στο thread:  Used: %ld of a %ld stack.  Παρακαλώ χρησιμοποιείστε 'mariadbd --thread_stack=#' για να ορίσετε ένα μεγαλύτερο stack αν χρειάζεταιCross dependency βρέθηκε σε OUTER JOIN.  Παρακαλώ εξετάστε τις συνθήκες που θέσατε στο ONTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerΔεν είναι δυνατή η διαδικασία load για τη συνάρτηση '%-.192s'Δεν είναι δυνατή η έναρξη της συνάρτησης '%-.192s'; %-.80sΔεν βρέθηκαν paths για την shared libraryΗ συνάρτηση '%-.192s' υπάρχει ήδηΔεν είναι δυνατή η ανάγνωση της shared library '%-.192s' (κωδικός λάθους: %d, %-.128s)Δεν είναι δυνατή η ανεύρεση της συνάρτησης '%-.128s' στην βιβλιοθήκηΗ συνάρτηση '%-.192s' δεν έχει ορισθείΟ υπολογιστής '%-.64s' έχει αποκλεισθεί λόγω πολλαπλών λαθών σύνδεσης. Προσπαθήστε να διορώσετε με 'mariadb-admin flush-hosts'Ο υπολογιστής '%-.64s' δεν έχει δικαίωμα σύνδεσης με τον MariaDB serverΧρησιμοποιείτε την MariaDB σαν anonymous user και έτσι δεν μπορείτε να αλλάξετε τα passwords άλλων χρηστώνΠρέπει να έχετε δικαίωμα διόρθωσης πινάκων (update) στη βάση δεδομένων mysql για να μπορείτε να αλλάξετε τα passwords άλλων χρηστώνΔεν είναι δυνατή η ανεύρεση της αντίστοιχης εγγραφής στον πίνακα των χρηστώνRows matched: %ld  Changed: %ld  Warnings: %ldCan't create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bugColumn count doesn't match value count at row %luCan't reopen table: '%-.192s'Invalid use of NULL valueRegex error '%s'Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseThere is no such grant defined for user '%-.48s' on host '%-.64s'%-.100T command denied to user '%s'@'%s' for table %`s.%`s%-.32s command denied to user '%s'@'%s' for column '%-.192s' in table '%-.192s'Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be usedThe host or user argument to GRANT is too longTable '%-.192s.%-.192s' doesn't existThere is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'The used command is not allowed with this MariaDB versionYou have an error in your SQL syntaxDelayed insert thread couldn't get requested lock for table %-.192sToo many delayed threads in useAborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)Got a packet bigger than 'max_allowed_packet' bytesGot a read error from the connection pipeGot an error from fcntl()Got packets out of orderCouldn't uncompress communication packetGot an error reading communication packetsGot timeout reading communication packetsGot an error writing communication packetsGot timeout writing communication packetsResult string is longer than 'max_allowed_packet' bytesStorage engine %s doesn't support BLOB/TEXT columnsStorage engine %s doesn't support AUTO_INCREMENT columnsINSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sUnable to open underlying table which is differently defined or of non-MyISAM type or doesn't existCan't write, because of unique constraint, to table '%-.192s'BLOB column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add a child row: a foreign key constraint failsCannot delete a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYΔεν είναι δυνατή η δημιουργία ξένου διακομιστή '%s' επειδή υπάρχει ήδηThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionΔιπλή εγγραφή '%-.64T' για το κλειδί '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTΔεν επιτέρεται η πρόσβαση στο χρήστη: '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionΔιπλή εγγραφή για το κλειδί '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledkorean/errmsg.sys000064400000235666150343473000010103 0ustar00���1o��=�
BCO\i\\/=BB>@@DKVWB.1E59!?$@6)AD/QGMACYN.'7.(%-"&#"SF*#!'290I,O`H@Ciw*'/(�Xov,B"|l-2` 52>@OK>2�$88>62tV*"{��Ax2>M,TC6�W�zG=�P/)#e^dyq[;{Q&f=e=;92:=>CDFKIY -:>E[&':f/-=V#73_ <I>�iLSq6L876FCE-JC7+AE$')>AA$BVJI/9-,"1LF$3.$!6+%&,*Ag.3oa-LN.*'A/CG-T��XG�=!A2oR4RU5,y.E))2%D,5'<%'�� =!"!$40F-"(-7:BP7&"5%/4ANH�<2;/!-S05&>"6%!2*+!L2-+D#2&ND07[;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%w7_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?-8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"79FLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���z4=�@7?>{��dW.#*S,EED6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�$i,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu!KL�(#>3;74.+/6 @B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1),'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2.C72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchk아니오예화일 '%-.200s'를 만들지 못했습니다. (에러번호: %M)테이블 %`s.%`s를 만들지 못했습니다. (에러번호: %M)데이타베이스 '%-.192s'를 만들지 못했습니다.. (에러번호: %M)데이타베이스 '%-.192s'를 만들지 못했습니다.. 데이타베이스가 존재함데이타베이스 '%-.192s'를 제거하지 못했습니다. 데이타베이스가 존재하지 않음 데이타베이스 제거 에러('%-.192s'를 삭제할 수 없습니다, 에러번호: %M)데이타베이스 제거 에러(rmdir '%-.192s'를 할 수 없습니다, 에러번호: %M)'%-.192s' 삭제 중 에러 (에러번호: %M)system 테이블에서 레코드를 읽을 수 없습니다.'%-.200s'의 상태를 얻지 못했습니다. (에러번호: %M)수행 디렉토리를 찾지 못했습니다. (에러번호: %M)화일을 잠그지(lock) 못했습니다. (에러번호: %M)화일을 열지 못했습니다.: '%-.200s' (에러번호: %M)화일을 찾지 못했습니다.: '%-.200s' (에러번호: %M)'%-.192s'디렉토리를 읽지 못했습니다. (에러번호: %M)'%-.192s'디렉토리로 이동할 수 없었습니다. (에러번호: %M)테이블 '%-.192s'에서 마지막으로 읽은 후 Record가 변경되었습니다.Disk full (%s). 다른 사람이 지울때까지 기다립니다... (에러번호: %M)기록할 수 없습니다., 테이블 '%-.192s'에서 중복 키'%-.192s'닫는 중 에러 (에러번호: %M)'%-.200s'화일 읽기 에러 (에러번호: %M)'%-.210s'를 '%-.210s'로 이름 변경중 에러 (에러번호: %M)'%-.200s'화일 기록 중 에러 (에러번호: %M)'%-.192s'가 변경할 수 없도록 잠겨있습니다.소트가 중단되었습니다.뷰 '%-.192s'가 '%-.192s'에서는 존재하지 않습니다.Got error %M from storage engine %sStorage engine %s of the table %`s.%`s doesn't have this option'%-.192s'에서 레코드를 찾을 수 없습니다.화일의 부정확한 정보: '%-.200s''%-.200s' 테이블의 부정확한 키 존재. 수정하시오!'%-.192s' 테이블의 이전버젼의 키 존재. 수정하시오!테이블 '%-.192s'는 읽기전용 입니다.Out of memory. 데몬을 재 실행 후 다시 시작하시오 (needed %d bytes)Out of sort memory. daemon sort buffer의 크기를 증가시키세요'%-.192s' 화일을 읽는 도중 잘못된 eof을 발견 (에러번호: %M)너무 많은 연결... max_connection을 증가 시키시오...Out of memory.당신의 컴퓨터의 호스트이름을 얻을 수 없습니다.Bad handshake'%s'@'%s' 사용자는 '%-.192s' 데이타베이스에 접근이 거부 되었습니다.'%s'@'%s' 사용자는 접근이 거부 되었습니다. (using password: %s)선택된 데이타베이스가 없습니다.명령어가 뭔지 모르겠어요...칼럼 '%-.192s'는 널(Null)이 되면 안됩니다. 데이타베이스 '%-.192s'는 알수 없음테이블 '%-.192s'는 이미 존재함테이블 '%-.100T'는 알수 없음칼럼: '%-.192s' in '%-.192s' 이 모호함Server가 셧다운 중입니다.Unknown 칼럼 '%-.192s' in '%-.192s''%-.192s'은 GROUP BY속에 없음'%-.192s'를 그룹할 수 없음Statement 가 sum기능을 동작중이고 칼럼도 동일한 statement입니다.칼럼의 카운트가 값의 카운트와 일치하지 않습니다.Identifier '%-.100T'는 너무 길군요.중복된 칼럼 이름: '%-.192s'중복된 키 이름 : '%-.192s'중복된 입력 값 '%-.192T': key %d칼럼 '%-.192s'의 부정확한 칼럼 정의자'%s' 에러 같습니다. ('%-.80T' 명령어 라인 %d)쿼리결과가 없습니다.Unique 하지 않은 테이블/alias: '%-.192s''%-.192s'의 유효하지 못한 디폴트 값을 사용하셨습니다.Multiple primary key가 정의되어 있슴너무 많은 키가 정의되어 있습니다.. 최대 %d의 키가 가능함너무 많은 키 부분(parts)들이 정의되어 있습니다.. 최대 %d 부분이 가능함정의된 키가 너무 깁니다. 최대 키의 길이는 %d입니다.Key 칼럼 '%-.192s'는 테이블에 존재하지 않습니다.BLOB column %`s can't be used in key specification in the %s table칼럼 '%-.192s'의 칼럼 길이가 너무 깁니다 (최대 = %lu). 대신에 BLOB를 사용하세요.부정확한 테이블 정의; 테이블은 하나의 auto 칼럼이 존재하고 키로 정의되어져야 합니다.Could not delete gtid domain. Reason: %s.%s (%s): 정상적인 shutdown%s: %d 신호가 들어왔음. 중지!%s: Shutdown 이 완료됨!%s: thread %ld의 강제 종료 user: '%-.48s'IP 소켓을 만들지 못했습니다.테이블 '%-.192s'는 인덱스를 만들지 않았습니다. alter 테이블명령을 이용하여 테이블을 수정하세요...필드 구분자 인수들이 완전하지 않습니다. 메뉴얼을 찾아 보세요.BLOB로는 고정길이의 lowlength를 사용할 수 없습니다. 'fields terminated by'를 사용하세요.'%-.128s' 화일는 데이타베이스 디렉토리에 존재하거나 모두에게 읽기 가능하여야 합니다.'%-.200s' 화일은 이미 존재합니다.레코드: %ld개  삭제: %ld개  스킵: %ld개  경고: %ld개레코드: %ld개  중복: %ld개부정확한 서버 파트 키. 사용된 키 파트가 스트링이 아니거나 키 파트의 길이가 너무 깁니다.ALTER TABLE 명령으로는 모든 칼럼을 지울 수 없습니다. DROP TABLE 명령을 이용하세요.Can't DROP %s %`-.192s; check that it exists레코드: %ld개  중복: %ld개  경고: %ld개Table '%-.192s' is specified twice, both as a target for '%s' and as a separate source for data알수 없는 쓰레드 id: %lu쓰레드(Thread) %lld의 소유자가 아닙니다.어떤 테이블도 사용되지 않았습니다.칼럼 %-.192s와 SET에서 스트링이 너무 많습니다.Unique 로그화일 '%-.200s'를 만들수 없습니다.(1-999)테이블 '%-.192s'는 READ 락이 잠겨있어서 갱신할 수 없습니다.테이블 '%-.192s'는 LOCK TABLES 명령으로 잠기지 않았습니다.You should never see it'%-.100T' 데이타베이스의 이름이 부정확합니다.'%-.100s' 테이블 이름이 부정확합니다.SELECT 명령에서 너무 많은 레코드를 찾기 때문에 많은 시간이 소요됩니다. 따라서 WHERE 문을 점검하거나, 만약 SELECT가 ok되면  SET SQL_BIG_SELECTS=1 옵션을 사용하세요.알수 없는 에러입니다.알수 없는 수행문 : '%-.192s''%-.192s' 수행문에 대한 부정확한 파라메터'%-.192s' 수행문에 대한 부정확한 파라메터알수 없는 테이블 '%-.192s' (데이타베이스 %-.32s)칼럼 '%-.192s'는 두번 정의되어 있습니다.잘못된 그룹 함수를 사용하였습니다.테이블 '%-.192s'는 확장명령을 이용하지만 현재의 MariaDB 버젼에서는 존재하지 않습니다.하나의 테이블에서는 적어도 하나의 칼럼이 존재하여야 합니다.테이블 '%-.192s'가 full났습니다. 알수없는 언어 Set: '%-.64s'너무 많은 테이블이 Join되었습니다. MariaDB에서는 JOIN시 %d개의 테이블만 사용할 수 있습니다.칼럼이 너무 많습니다.너무 큰 row 사이즈입니다. BLOB를 계산하지 않고 최대 row 사이즈는 %ld입니다. 일부열을 BLOB 또는 TEXT로 변경해야 합니다.쓰레드 스택이 넘쳤습니다.  사용: %ld개 스택: %ld개.  만약 필요시 더큰 스택을 원할때에는 'mariadbd --thread_stack=#' 를 정의하세요Cross dependency found in OUTER JOIN; examine your ON conditionsTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler'%-.192s' 함수를 로드하지 못했습니다.'%-.192s' 함수를 초기화 하지 못했습니다.; %-.80s공유 라이버러리를 위한 패스가 정의되어 있지 않습니다.'%-.192s' 함수는 이미 존재합니다.'%-.192s' 공유 라이버러리를 열수 없습니다.(에러번호: %d, %-.128s)라이버러리에서 '%-.128s' 함수를 찾을 수 없습니다.'%-.192s' 함수가 정의되어 있지 않습니다.너무 많은 연결오류로 인하여 호스트 '%-.64s'는 블락되었습니다. 'mariadb-admin flush-hosts'를 이용하여 블락을 해제하세요'%-.64s' 호스트는 이 MariaDB서버에 접속할 허가를 받지 못했습니다.당신은 MariaDB서버에 익명의 사용자로 접속을 하셨습니다.익명의 사용자는 암호를 변경할 수 없습니다.당신은 다른사용자들의 암호를 변경할 수 있도록 데이타베이스 변경권한을 가져야 합니다.사용자 테이블에서 일치하는 것을 찾을 수 없습니다.일치하는 Rows : %ld개 변경됨: %ld개  경고: %ld개새로운 쓰레드를 만들 수 없습니다.(에러번호 %M). 만약 여유메모리가 있다면 OS-dependent버그 의 메뉴얼 부분을 찾아보시오.Row %lu에서 칼럼 카운트와 value 카운터와 일치하지 않습니다.테이블을 다시 열수 없군요: '%-.192sNULL 값을 잘못 사용하셨군요...regexp에서 '%s'가 났습니다.GROUP BY 절 없이 혼합된 GROUP 함수 (MIN(),MAX(),COUNT(),...) 를 사용할 수 없습니다.사용자 '%-.48s' (호스트 '%-.64s')를 위하여 정의된 그런 승인은 없습니다.'%-.100T' 명령은 다음 사용자에게 거부되었습니다. : '%s'@'%s' for 테이블 %`s.%`s'%-.32s' 명령은 다음 사용자에게 거부되었습니다. : '%s'@'%s' for 칼럼 '%-.192s' in 테이블 '%-.192s'잘못된 GRANT/REVOKE 명령. 어떤 권리와 승인이 사용되어 질 수 있는지 메뉴얼을 보시오.승인(GRANT)을 위하여 사용한 사용자나 호스트의 값들이 너무 깁니다.테이블 '%-.192s.%-.192s' 는 존재하지 않습니다.사용자 '%-.48s'(호스트 '%-.64s')는 테이블 '%-.192s'를 사용하기 위하여 정의된 승인은 없습니다. 사용된 명령은 현재의 MariaDB 버젼에서는 이용되지 않습니다.SQL 구문에 오류가 있습니다.지연된 insert 쓰레드가 테이블 %-.192s의 요구된 락킹을 처리할 수 없었습니다.너무 많은 지연 쓰레드를 사용하고 있습니다.데이타베이스 접속을 위한 연결 %ld가 중단됨 : '%-.192s' 사용자: '%-.48s' (%-.64s)'max_allowed_packet'보다 더큰 패킷을 받았습니다.연결 파이프로부터 에러가 발생하였습니다.fcntl() 함수로부터 에러가 발생하였습니다.순서가 맞지않는 패킷을 받았습니다.통신 패킷의 압축해제를 할 수 없었습니다.통신 패킷을 읽는 중 오류가 발생하였습니다.통신 패킷을 읽는 중 timeout이 발생하였습니다.통신 패킷을 기록하는 중 오류가 발생하였습니다.통신 패팃을 기록하는 중 timeout이 발생하였습니다.결과 문자열이 설정된 max_allowed_packet 값보다 큽니다.스토리지 엔진 (%s)는 BLOB/TEXT 컬럼을 지원하지 않습니다.스토리지 엔진 (%s)는 AUTO_INCREMENT를 지원하지 않습니다.INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLESIncorrect column name '%-.100s'The storage engine %s can't index column %`sAll tables in the MERGE table are not defined identicallyCan't write, because of unique constraint, to table '%-.192s'BLOB column '%-.192s' used in key specification without a key lengthAll parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadResult consisted of more than one rowThis table type requires a primary keyThis version of MariaDB is not compiled with RAID supportYou are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnKey '%-.192s' doesn't exist in table '%-.192s'Can't open tableThe handler for the table doesn't support %sYou are not allowed to execute this command in a transactionGot error %M during COMMITGot error %M during ROLLBACKGot error %M during FLUSH_LOGSGot error %M during CHECKPOINTAborted connection %lld to db: '%-.192s' user: '%-.48s' host: '%-.64s'%-.64s (%-.64s)You should never see itBinlog closed, cannot RESET MASTERFailed rebuilding the index of  dumped table '%-.192s'Error from master: '%-.64s'Net error reading from masterNet error writing to masterCan't find FULLTEXT index matching the column listCan't execute the given command because you have active locked tables or an active transactionUnknown system variable '%-.*s'Table '%-.192s' is marked as crashed and should be repairedTable '%-.192s' is marked as crashed and last (automatic?) repair failedSome non-transactional changed tables couldn't be rolled backMulti-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try againThis operation cannot be performed as you have a running slave '%2$*1$s'; run STOP SLAVE '%2$*1$s' firstThis operation requires a running slave; configure slave and do START SLAVEThe server is not configured as slave; fix in config file or with CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logCould not create slave thread; check system resourcesUser %-.64s already has more than 'max_user_connections' active connectionsYou may only use constant expressions in this statementLock wait timeout exceeded; try restarting transactionThe total number of locks exceeds the lock table sizeUpdate locks cannot be acquired during a READ UNCOMMITTED transactionDROP DATABASE not allowed while thread is holding global read lockCREATE DATABASE not allowed while thread is holding global read lockIncorrect arguments to %s'%s'@'%s' is not allowed to create new usersIncorrect table definition; all MERGE tables must be in the same databaseDeadlock found when trying to get lock; try restarting transactionThe storage engine %s doesn't support FULLTEXT indexesCannot add foreign key constraint for `%s`Cannot add or update a child row: a foreign key constraint failsCannot delete or update a parent row: a foreign key constraint failsError connecting to master: %-.128sError running query on master: %-.128sError when executing command %s: %-.128sIncorrect usage of %s and %sThe used SELECT statements have a different number of columnsCan't execute the query because you have a conflicting read lockMixing of transactional and non-transactional tables is disabledOption '%s' used twice in statementUser '%-.64s' has exceeded the '%s' resource (current value: %ld)Access denied; you need (at least one of) the %-.128s privilege(s) for this operationVariable '%-.64s' is a SESSION variable and can't be used with SET GLOBALVariable '%-.64s' is a GLOBAL variable and should be set with SET GLOBALVariable '%-.64s' doesn't have a default valueVariable '%-.64s' can't be set to the value of '%-.200T'Incorrect argument type to variable '%-.64s'Variable '%-.64s' can only be set, not readIncorrect usage/placement of '%s'This version of MariaDB doesn't yet support '%s'Got fatal error %d from master when reading data from binary log: '%-.320s'Slave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchOperand should contain %d column(s)Subquery returns more than 1 rowUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existCyclic reference on subqueriesConverting column '%s' from %s to %sReference '%-.64s' not supported (%s)Every derived table must have its own aliasSelect %u was reduced during optimizationTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedServer is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new formatField or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Query cache failed to set size %llu; new query cache size is %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadThe target table %-.100s of the %s is not updatableThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementConfiguration file '%-.192s' is too bigMalformed file type header in file '%-.192s'Unexpected end of file while parsing comment '%-.200s'Error while parsing parameter '%-.192s' (line: '%-.192s')Unexpected end of file while skipping unknown parameter '%-.192s'ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying tableFile '%-.192s' has unknown type '%-.64s' in its header'%-.192s.%-.192s' is not of type '%s'Column '%-.192s' is not updatableView's SELECT contains a subquery in the FROM clauseView's SELECT contains a '%s' clauseView's SELECT contains a variable or parameterView's SELECT refers to a temporary table '%-.192s'View's SELECT and view's field list have different column countsView merge algorithm can't be used here for now (assumed undefined algorithm)View being updated does not have complete key of underlying table in itView '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION on non-updatable view %`-.192s.%`-.192sCHECK OPTION failed %`-.192s.%`-.192s%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0View text checksum failedCan not modify more than one base table through a join view '%-.192s.%-.192s'Can not insert into join view '%-.192s.%-.192s' without fields listCan not delete from join view '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s stateXAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYCannot create foreign server '%s' as it already existsThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native function중복된 입력 값 '%-.64T': key '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INT'%s'@'%s' 사용자는 접근이 거부 되었습니다.SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKUnknown %s format name: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sYEAR(%lu) column type is deprecated. Creating YEAR(4) column insteadYour password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction중복된 입력 값: key '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logUnknown query id: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigPlugin '%-.192s' already installedQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'You are not owner of query %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0CONSTRAINT %`s failed for %`-.192s.%`-.192sExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Incorrect parameter count to cursor '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledchinese/errmsg.sys000064400000201240150343473000010217 0ustar00���o��=�3.6,2EE-"60*63961D)03<0"
"!*"()./=B
(
.0*.! 
 053%OR!#-J1NL1�@/&Y %1*+"�
B'"!54
�j>q(<#g2TX++�("c8@RN+ J.37@50&)H+?/Fe0g/!%^&.+C+K+xtQHc+D.)"877">5& 11 ,".1(#7EG:-''$NE!'"3%+7T-*X\%"5C % G+:U!E�oX6�091b:%AC)(^+4$'&<*6v�1(*:%1(4.:3$"#)<A+\6,+&J.9$;#3(%%")"1%"*<1(&@:+8J=V"9*(N=-2+Q=���g%@4(12aI$LCN64�3${C:wA9199,�;Ib%FD+%%#+

4 <g8L4KE3+C::L!:.F#+8%+%>.+F(#6.%..NP).(%:U..(
14E1'�8
 1$"==@"�O@""$.b:+31"$2�=447!+]i-"g'!',#,)& +<+45%"%%-N!H.)("N



'%(%3# KG"(!,::^����qjm�xUUR[<-0/2FPA+)13CU/9*6H41]irbS$.-+��������g#\*([-*-+#"xg3/7:�.(%/%7$i�!;�aN:+@1_a.U7l�JXKU7<9N�A���g%/�104=n~qYI( @B9D.BH,N^CJEC:LQ�1):` !} %,*@1"5#!�X)X$�7+K37Z4:Y��N]+%/0?"$#.%.((`\:V3E`*"(0 )6H9��;�|�>J�n!%IL�1'441+$.+ )8%�*0,j57�'MC<*%Y3m��+S;N)"_6**'*9?E?'+!"+)%""#%(+C+iA4= $ )4>&,8/2+9%07+(+08>,1'034:B+4?749JA:/;K(6a�P�>fN�|G$)3}"71.69-++2(+'#+&.�F1+44!'&6K?":-5+O.U`*'+ -2K6(9.O"5F014.9_T"%((74G5#@X!nQ:A-%)Q)(-)PP;I��hashchkisamchk不是的无法创建文件'%-.200s'(错误号码:%M)无法创建表%`s.%`s(错误号码:%M)无法创建数据库'%-.192s'(错误号码:%M)无法创建数据库'%-.192s';已经存在无法删除数据库'%-.192s';数据库不存在删除数据库错误(无法删除'%-.192s',错误号码:%M)删除数据库错误(无法rmdir '%-.192s',错误号码:%M)删除'%-.192s'出错(错误号码:%M)无法在系统表中读取记录无法获得'%-.200s'的状态(错误号码:%M)无法获取工作目录(错误号码:%M)无法锁定文件(错误号码:%M)无法打开文件:'%-.200s'(错误号码:%M)找不到文件:'%-.200s'(错误号码:%M)无法读取'%-.192s'的文件夹(错误号码:%M)无法将dir更改为'%-.192s'(错误号码:%M)这个表自上次读后数据有变化'%-.192s'磁盘已满(%s);等待释放一些空间...(错误号码:%M)不能写;表'%-.192s'中有重复索引'%-.192s'关闭时出错(错误号码:%M)读取文件'%-.200s'错误(错误号码:%M)重命名'%-.210s'到'%-.210s'错误(错误号码:%M)写文件'%-.200s'错误(错误号码:%M)'%-.192s'被锁定,不能改变排序中止视图'%-.192s'不存在'%-.192s'错误 %M, 来自存储引擎 %s存储引擎%s %`s.%`s 表没有该选项无法在'%-.192s'中找到记录文件中的信息不正确:'%-.200s'表'%-.200s'的索引损坏;试着修复表'%-.192s'的老索引文件损坏; 修复!表'%-.192s'只可读内存不足; 重启后重试(需要 %d bytes)排序内存不足,可以考虑增加实例排序缓存量阅读文件'%-.192s'时出现意外的EOF(错误号码:%M)太多连接内存不足.不能从你的地址获取主机名称坏握手用户'%s'@'%s'无权访问数据库'%-.192s''%s'@'%s' 用户无权访问 (使用密码: %s)没有选择数据库未知的命令列'%-.192s'不能为NULL未知数据库'%-.192s'表'%-.192s'已经存在未知表'%-.100T'列名 '%-.192s' 在 %-.192s 定义模糊服务器正在关闭未知列'%-.192s'在'%-.192s''%-.192s' 不在 GROUP BY不能在'%-.192s'上分组语句在同一语句里有求和函数和列列数与值数不匹配标识符'%-.100T'太长列名重复 '%-.192s'索引名重复 '%-.192s'重复条目'%-.192T'在索引%d列的说明符不对 '%-.192s'%s 附近'%-.80T'在第%d行查询为空表或别名不唯一:'%-.192s''%-.192s'的默认值无效定义了多个主键定义的索引太多; 最多允许%d 个索引指定的索引部分过多; 最多允许%d个部分指定索引太长; 最大索引长度是 %d字节索引列'%-.192s'不在表里索引里不能含有BLOB列%`s表%s数据太长超过列容量 '%-.192s' (最长 = %lu); 用 BLOB 或 TEXT 替代表定义不正确;只能有一个自动列,并且必须将其定义为索引无法删除gtid域. 原因: %s.%s(%s):正常关闭%s: 收到信号 %d. 强行中止!%s:关闭完成%s: 强行关闭线程 %ld  用户: '%-.48s'无法创建IP插口表 '%-.192s' 没有像 CREATE INDEX 中使用的索引;重新创建表字段分隔符参数不合预期;查看文档您不能对 BLOB 使用固定的行长度;请使用 'fields terminated by'文件'%-.128s'必须位于数据库目录中,或所有人都可以读取文件'%-.200s'已经存在记录:%ld删除:%ld跳过:%ld警告:%ld记录: %ld  重复: %ld前缀索引不正确;使用的索引部分不是字符串,使用的长度比索引部分长,或者存储引擎不支持独特前缀索引您不能使用 ALTER TABLE 删除所有列;改用 DROP TABLE不能 DROP %s %`-.192s; 检查它是否存在记录: %ld  重复: %ld  警告: %ld表 '%-.192s' 被指定了两次, 即作为 '%s' 的目标,又作为数据的独立源未知线程ID:%lu你不是线程%lld的所有者没有使用表列 %-.192s 和SET的字符串过多无法生成唯一的log-filename%-.200s.(1-999)表 '%-.192s' 有 READ 锁,无法更新表 '%-.192s' 未使用 LOCK TABLES 锁定You should never see it数据库名称不正确'%-.100T'表名不正确'%-.100s'SELECT 将检查超过 MAX_JOIN_SIZE 行;检查您的 WHERE 并使用 SET SQL_BIG_SELECTS=1 或 SET MAX_JOIN_SIZE=# 如果 SELECT 没问题未知错误未知存储过程 '%-.192s'存储过程 '%-.192s' 需要的参数和提供的参数不吻合存储过程 '%-.192s' 的参数不对未知表名 '%-.192s' 在 %-.32s列 '%-.192s' 被指定了两次组函数使用无效表'%-.192s'使用此MariaDB版本不存在的扩展表必须至少有1列表'%-.192s'已满未知字符集:'%-.64s'表太多; MariaDB 只能在join中使用 %d 个表太多列行尺寸太大. 不包括BLOB,表的最大的行大小是 %ld. 这包括存储开销,请查看文档。您必须将某些列更改为 TEXT 或 BLOB线程栈溢出:  已使用了: %ld 堆栈 %ld.  使用 'mariadbd --thread_stack=#' 指定更大的堆栈在 OUTER JOIN 中发现交叉依赖;检查您的 ON 条件表处理程序不支持给定索引中的 NULL. 请将列 '%-.192s' 改为 NOT NULL 或使用其他处理程序无法加载函数'%-.192s'无法初始化函数 '%-.192s'; %-.80s共享库不允许使用路径函数 '%-.192s' 已经存在不能打开共享库 '%-.192s' (错误号码: %d, %-.128s)在库中找不到符号 '%-.128s'未定义函数 '%-.192s'主机 '%-.64s' 由于许多连接错误而被阻止;使用 'mariadb-admin flush-hosts' 解除阻塞Host'%-.64s'不允许连接到此MariaDB服务器您正在以匿名用户身份使用 MariaDB,匿名用户不能修改用户设置您必须具有更新 MariaDB 数据库中的表的权限才能更改其他人的密码在用户表中找不到任何匹配的行匹配行:%ld已更改:%ld警告:%ld无法创建新线程 (错误号码 %M); 如果您没有用完剩余内存,您可以查阅文档以了解可能与操作系统相关的错误列计数与行%lu的值计数不匹配无法重新打开表:'%-.192s'无效使用 NULL 值正则表达错误 '%s'如果没有 GROUP BY 子句,不能混合没有 GROUP 列的 GROUP 列 (MIN(),MAX(),COUNT(),...)用户 '%-.48s' 来自主机 '%-.64s'没有此类授权%-.100T 命令的权限拒绝用户 '%s'@'%s' 用在表 %`s.%`s%-.32s 命令的权限拒绝用户 '%s'@'%s' 用在列 '%-.192s' 在表 '%-.192s'非法的 GRANT/REVOKE 命令;请查阅文档查看可以使用哪些权限GRANT 语句的主机或用户参数太长表 '%-.192s.%-.192s' 不存在没有为用户 '%-.48s' 来自主机 '%-.64s' 在表 '%-.192s' 上授权本 MariaDB 版本不允许使用这个命令您的 SQL 语法有错误;请查看相关文档延迟插入线程无法获得 %-.192s 的请求锁定使用中的延迟线程太多终止连线 %ld 数据库: '%-.192s' 用户: '%-.48s' (%-.64s)收到的数据包大于 'max_allowed_packet' 字节连接管道读取错误fcntl()的错误数据包乱序无法解压缩通信数据包读取通信数据包出错读取通信包超时写入通信包时出错写入通信包超时结果字符串长于'max_allowed_packet'字节存储引擎%s不支持blob / text列存储引擎%s不支持auto_increment列INSERT DELAYED 不能用在表 '%-.192s' 因为它被LOCK TABLES 锁定错误列名 '%-.100s'存储引擎 %s 不能给 %`s 列建索引无法打开定义不同或非 MyISAM 类型或不存在的表因为表'%-.192s' 唯一约束,无法写入BLOB/TEXT 列 '%-.192s' 在没有索引长度的索引规范中使用PRIMARY KEY 的所有部分都不能为NULL;如果您需要在键中使用 NULL,请改用 UNIQUE结果多于一行此表类型需要主索引这个版本的 MariaDB 编译时不支持 RAID您正在使用安全更新模式,同时您尝试更新时没有使用含有 KEY 列的 WHERE 语句索引 '%-.192s' 在表 '%-.192s' 里不存在无法打开表该表的存储引擎不支持%s不允许在事务中执行此命令COMMIT时发生错误 %M 回滚时出错%Mflush_logs时出错%MCHECKPOINT时出错%M 终止的连接 %lld 到数据库: '%-.192s' 用户: '%-.48s' 主机: '%-.64s'%-.64s (%-.64s)You should never see itBinlog 已关闭, 不能 RESET MASTER重建 dumped table '%-.192s' 的索引失败Master错误:'%-.64s'读master时有网络错误写master时有网络错误找不到与列列表匹配的全文索引无法执行给定的命令,因为表上有锁或有活动事务未知系统变量 '%-.*s'表'%-.192s'标记为崩溃,应该修复表 '%-.192s' 被标记为崩溃,上一次的修复(自动?)失败某些非事务性更改的表无法回滚多语句事务需要超过 'max_binlog_cache_size' 字节的存储空间;增加这个 mariadbd 变量后再试一次这个操作不能执行,因为你有个正在运行的 slave '%2$*1$s'; 先运行 STOP SLAVE '%2$*1$s' 后再试这个操作需要一个正在运行的slave;配置从机并执行 START SLAVE服务器未配置为从站;修复配置文件或使用CHANGE MASTER TO无法初始化'%.*s'的master info structure;MariaDB错误日志中可以找到更多错误消息无法创建slave线程;检查系统资源用户%-.64s已经拥有超过“max_user_conections”的活连接您只能在此语句中使用常量表达式锁等待超时;尝试重新启动事务锁的总数超过锁定表大小在READ UNCOMMITTED事务期间无法获取更新锁定线程持有全局读锁时,不允许删除数据库线程持有全局读锁时,不允许创建数据库%s的参数不正确'%s'@'%s'不允许创建新用户表定义不正确;所有合并表必须在同一数据库中试图锁定时发现僵局;尝试重新启动事务存储引擎%s不支持fulltext索引不能为`%s`添加外键约束无法添加或更新子行:外键约束失败无法删除或更新父行:外键约束失败连接master时出错:%-.128s在Master上运行查询时出错:%-.128s执行命令%s时出错:%-.128s%s和%s使用不正确使用的SELECT语句具有不同数量的列无法执行查询,因为您有冲突的读锁事务和非事务表的混合被禁用选项'%s'在语句中使用两次用户'%-.64s'已超过'%s'资源(当前值:%ld)拒绝访问;您需要(至少一个)%-.128s特权用于此操作变量'%-.64s'是一个SESSION变量,不能与Set Global一起使用变量'%-.64s'是全局变量,应该用SET GLOBAL设置变量'%-.64s'没有默认值变量'%-.64s'无法设置为'%-.200T'的值变量'%-.64s'的参数类型不正确变量'%-.64s'只能设置,不能读'%s'的使用/放置不正确此版本的MariaDB尚未支持'%s'从二进制日志读取数据时,从master遇到致命错误%d:'%-.320s'由于复制replicate-*-table规则,Slave SQL线程忽略了查询变量'%-.192s'是一个%s变量'%-.192s'的外键定义不正确:%s索引参考和表参考不匹配操作数应包含%d列子查询返回超过1行未知prepared statement处理程序(%.*s)给予%s帮助数据库已损坏或不存在亚查询的死环参考将列'%s'从%s转换为%s参考'%-.64s'不支持(%s)每个派生的表必须有自己的别名SELECT %u在优化期间被减表'%-.192s'从其中一个SELECT中不能用于%-.32s客户端不支持服务器请求的身份验证协议;考虑升级MariaDB客户端SPATIAL索引的所有部分必须不为nullCOLLATION'%s'无效地用于字符集'%s'Slave已经在运行slave已经停止了未压缩的数据量太大;最大量为%d(可能未压缩数据的长度已损坏)ZLIB:内存不足ZLIB:输出缓冲区中没有足够的空间(可能未压缩数据的长度已损坏)ZLIB:输入数据已损坏group_concat()削减了行%u. %s行%lu不包含所有列的数据行%lu被截断;它包含的数据比输入列更多列设置为默认值; NULL在行'%s'中提供给了NOT NULL列%lu列'%s'行%lu的值超出范围数据被截断,在列'%s', 行%lu使用存储引擎%s 表格'%s'非法混合collations(%s,%s)和(%s,%s),用于操作'%s'无法删除一个或多个请求的用户无法为一个或多个请求的用户撤消所有权限非法混合collations(%s,%s),(%s,%s)和(%s,%s),用于操作'%s'非法混合collations操作'%s'变量'%-.64s'不是可变组件(不能用作xxxx.variable_name)未知的collation:'%-.64s'CHANGE MASTER中的SSL参数被忽略,因为此MariaDB从站未在没有SSL支持的情况下编译;如果启动了SSL的MariaDB从站,则可以使用它们服务器在--secure-auth模式下运行,但'%s'@'%s'具有旧格式的密码;请将密码更改为新格式列或参考'%-.192s%s%-.192s%s%-.192s' 在SELECT #%d 中, 在SELECT #%d中得到解决START SLAVE UNTIL的参数或参数的组合不正确START SLAVE UNTIL进行逐步复制时建议使用--skip-slave-start;否则,如果有意外的Slave的mariadbd重启,可能有问题不能启动SQL线程所以UNTIL选项被忽略索引名称'%-.100s'不正确目录名称'%-.100s'不正确设置查询缓存值%llu失败;新查询缓存值为%lu列'%-.192s'不能成为全文索引的一部分未知索引缓存'%-.100s'MariaDB以-skip-name-resolve模式启动;想用grant,您必须重新启动,不用这个选项未知的存储引擎'%s'弃用'%s',将在将来的版本中删除。请使用%s目标表%-.100s多个%s不可更新'%s'功能被禁用;您需要MariaDB以'%s'构建以使其工作MariaDB服务器使用%s选项运行,因此无法执行此语句列'%-.100s'有重复的值'%-.64s'在%s截断的不正确%-.32T值:'%-.128T'表定义不正确;默认或ON UPDATE中只能有一个带有CURRENT_TIMESTAMP的TIMESTAMP列在'%-.192s'列的ON UPDATE子句上无效尚未在prepared statement协议中支持此命令出错%d '%-.200s'来自%s出临时错误%d '%-.200s'来自%s未知或不正确的时区:'%-.64s'无效TIMESTAMP值:列'%s' 行'%lu'无效的%s字符串:'%.64T'%s()的结果大于max_allowed_packet(%ld) - 截断矛盾语句:'%s%s'和'%s%s'无法从另一个存储过程中创建%s%s%s已经存在%s%s不存在未能DROP%s%s无法创建%s%s%s,没有匹配标签:%s重新定义标签%s没有匹配的最终标签%s参考未初始化的变量%sPROCEDURE%s不能返回给定上下文中的结果集RETURN仅允许在函数中%s不允许在存储过程中更新日志被弃用并由二进制日志替换;SET SQL_LOG_UPDATE已被忽略。此选项将在MariaDB 5.6中删除更新日志被弃用并由二进制日志替换;SET SQL_LOG_UPDATE已被转换为设置SQL_LOG_BIN。此选项将在MariaDB 5.6中删除查询执行中断%s%s的参数数量不正确;预期%u,得到%u未定义的CONDITION:%sFUNCTION%s中没有RETURNFUNCTION%s结束但无RETURNCursor语句必须是选择Cursor SELECT不能有INTO未定义的CURSOR:%sCursor已经打开Cursor未打开未定义的变量:%sFETCH变量数不正确没有数据 - 零行被选择或处理重复参数:%s重复变量:%s重复条件:%s重复Cursor:%s未能ALTER %s%s不支持子查询值在存储的函数或触发中不允许%s变量或条件声明在cursor或处理程序定义之后处理程序声明后的cursor声明未能在CASE语句找到Case配置文件'%-.192s'太大了文件'%-.192s'中的文件类型格式有问题解析评论'%-.200s'时意外碰到EOF解析参数'%-.192s'时出错(行:'%-.192s')跳过未知参数'%-.192s'时意外碰到EOFANALYZE/EXPLAIN/SHOW无法进行;缺乏底层表的特权文件'%-.192s'在其标题中有未知的'%-.64s''%-.192s.%-.192s'不是'%s'类列'%-.192s'不可更新View的Select的FROM包含子查询View的Select包含“%s”子句View的选择包含变量或参数View的SELECT指的是临时表'%-.192s'View的选择和VIEW的字段列表具有不同的列计数View合并算法目前不能使用(假设未定义的算法)更新的视图没有底层表的完整键View'%-.192s.%-.192s'引用无效的表、列、函数、或者函数或View缺乏使用权无法从另一个存储的例程中删除或更改%s在存储过程处理程序中不允许GOTO触发'%s'已经存在触发不存在触发器的'%-.192s'是视图或临时表更新%s行在%s触发器中不允许没有%s行,触发%s字段'%-.192s'没有默认值除0错误不正确的%-.32s值:'%-.128T'用于列`%.192s`%.192s`%.192s`在%lu行在解析期间发现的非法%s '%-.192T'值在不可更新的视图%`-.192s.%`-.192s上CHECK OPTIONCHECK OPTION失败%`-.192s.%`-.192s%-.32s命令被拒绝。用户为'%s'@'%s' 例程'%-.192s'清除旧继relay日志失败:%s密码哈希应该是一个%d-digit十六进制数在Binlog索引中找不到目标日志读取日志索引文件时I/O错误服务器配置不允许Binlog清除fseek()失败日志清除期间的致命错误日志在用,不会清除日志清除期间未知错误初始化relay日志失败。位置:%s您不使用二进制日志记录'%-.64s'语法保留用于MariaDB服务器内部WSAStartup失败了无法处理具有不同组的过程SELECT必须具有此过程的组无法在次存储过程使用ORDER子句二进制日志记录和复制禁止更改全局服务器%s无法映射文件:%-.200s,错误号码:%M魔法错误%-.64sPrepared statement包含太多占位符索引部分'%-.192s'长度不能为0查看文本checksum失败无法通过JOIN视图'%-.192s.%-.192s'修改多个基础表。无法写入JOIN视图'%-.192s.%-.192s'没有字段列表无法从JOIN视图'%-.192s.%-.192s'删除操作%s失败%.256sXAER_NOTA:未知的XIDXAER_INVAL:无效的参数(或不支持的命令)XAER_RMFAIL:当全局事务处于%.64s状态时,无法执行该命令XAER_OUTSIDE:一些工作是在全局交易之外完成的XAER_RMERR:事务分支中发生致命错误 - 检查您的数据以获得一致性XA_RBROLBACK:交易分支回滚无授权:用户'%-.48s'主机'%-.64s'ROUTINE'%-.192s'无法授予EXECUTE和ALTER ROUTINE权限无法撤消所有权限以删除例程列'%s'行%lu数据太长坏SQLSTATE:'%s'%s:已经准备好接受连接
Version:'%s'套接字:'%s'端口:%d %s无法从带有固定大小行的文件中加载值到变量您不允许使用创建用户时给予GRANT不正确的%-.32s值:'%-.128T' 函数:%-.32s表定义已更改,请重试在同一块中声明的处理程序重复OUT或INOUT参数%d 例程 %s的不是BEFORE触发器里的变量或新伪变量不允许从%s返回结果集无法从发送到几何字段的数据中获取几何对象ROUTINE失败,定义中既没有NO SQL也没有READ SQL DAT。启用二进制日志记录;如果更新非事务性表,则二进制日志将会错过其更改此函数定义中没有DETERMINISTIC,NO SQL,或者READS SQL DATA,并且已启用二进制日志记录(您*可能*希望使用较少的安全性的log_bin_trust_function_creators变量)您没有超级特权和二进制日志记录已启用(您*可能*想要使用较少的安全log_bin_trust_function_creators变量)您无法执行具有与之关联的打开Cursor的prepared statement。重置语句以重新执行它语句(%lu)没有开放的Cursor在存储的函数或触发器中不允许显式或隐式提交VIEW的列'%-.192s.%-.192s'底层表没有默认值不允许递归存储功能和触发器指定的大规模%llu为'%-.192s'。最大是%u指定的精度%llu太大 '%-.192s'。最大是%u对于FLOAT(M,D),DOUBLE(M,D)或DECIMAL(M,D),M必须> = D(列'%-.192s')您无法将系统表的写入锁定与其他表或锁定类型相结合无法连接到外数据源:%.64s处理对外数据源上的查询时出现问题。数据源错误:%-.64s您尝试引用的外数据源不存在。数据源错误:%-.64s无法创建联合表。数据源连接字符串'%-.64s'不是正确的格式数据源连接字符串'%-.64s'不是正确的格式无法创建联合表。外数据SRC错误:%-.64s触发在错的SCHEMA线程堆栈溢出:%ld字节堆栈的%ld字节,以及所需的%ld字节。使用'mariadbd --thread_stack =#'指定更大的堆栈'%-.100s”的ROUTINE太长了无法删除默认索引缓存显示宽度超过'%-.192s'的范围(max =%lu)XAER_DUPID:xid已存在DateTime函数:%-.32s字段溢出在存储的函数/触发器中无法更新表'%-.192s',因为它已被调用此存储的函数/触发器调用的语句表'%-.192s'的定义可防止在表'%-.192s'上的操作'%-.192s'prepared statement包含一个有关该语句的存储例程调用。它不允许以这种递归方式执行prepared statement不允许从存储的函数或触发器设置自动判处无效的定义VIEW'%-.192s'。'%-.192s'没有绝定的信息(旧表格式)。当前用户用作定义。请重新创建视图!您需要使用'%-.192s'@'%-.192s'的创建视图的超级特权指定为定义的用户('%-.64s'@'%-.64s')不存在不允许从'%-.192s'到'%-.192s'的SCHEMA更改无法删除或更新父行:外键约束失败(%s)无法添加或更新子行:外键约束失败(%s)变量'%-.64s'必须用`...`,或重命名触发'%-.192s'的绝对属性。'%-.192s'。触发器将在调用者的授权下激活,该权限可能不足。请重新创建触发器'%-.192s'具有旧格式,您应该重新创建'%s'对象递归限制%d(如max_sp_recursion_depth变量设置)的例程%.192s无法加载常规%-.192s(内部代码%d)。有关更多详细信息,请运行SHOW WARNINGS常规名称错误不正确'%-.192s'需要升级。请做"修复%s%`s "或转储/重新加载以修复!存储函数不支持聚合无法创建超过max_prepared_stmt_count语句(当前值:%u)%`s.%`s包含视图递归非分组字段'%-.192s'用于%-.64s条款存储引擎%s不支持SPATIAL索引无法在系统表上创建触发器前面的空格从名称'%s'删除无法从存储引擎读取自动增量值用户名主机名字符串'%-.70T'对于%s(应不超过%d)太长目标表%-.100s %s不可插入表'%-.64s'不同定义、或非myisam类型、或不存在太高的嵌套SELECT名'%-.64s'已成为''FIELDS TERMINATED字符串的第一个字符是模棱两可的;请使用非空字段FIELDS ENCLOSED BY无法创建外部服务器'%s',因为它已经存在您尝试引用的外部服务器名称不存在。数据源错误:%-.64s表存储引擎'%-.64s'不支持创建选项'%.64s'语法错误:%-.64s PARTITIONING需要定义给每个分区VALUES %-.64s只有%-.64s PARTITIONING可以使用VALUES %-.64s在分区定义中MAXVALUE只能在最后一个分区定义中使用子分区只能是哈希分区和分区列如果在一个分区上,必须在所有分区上定义子组分定义了错误的分区数,与以前的设置不匹配错误的子组分数定义,与以前的设置不匹配不允许(子)分区功能中的常量,随机或时区依赖表达式%s中的表达必须是恒定的在表中找不到分区功能的字段列表中的字段只允许在索引分区中允许字段列表FRM文件中的分区信息不与可以写入FRM文件的内容一致%-.192s函数返回错误的类型对于%-.64s分区必须定义每个分区每个分区的VALUES LESS THAN的值必须严格增加VALUES值必须与分区函数相同列表分区中相同常量的多个定义分区不能在查询中独立使用此版本的MariaDB中不允许分区中的处理程序混合对于分区引擎,需要定义所有%-.64s定义了太多分区(包括子组分)只有在子节分节的HASH/KEY分区中可以混合RANGE/LIST分区无法创建特定的处理程序文件分区功能中不允许BLOB字段A%-.192s必须包含表的分区功能中的所有列不允许%-.64s = 0不分区表上的分区管理是不可能的Partitioned tables do not support %s分区列表错误%-.64s无法删除所有分区,请使用删除表COALESCE分区只能用于哈希/索引分区REORGANIZE PARTITION只能用于重新组织不改变他们的数字的分区没有参数的REORGANIZE PARTITION只能用于HASH PARTITION的自动分区表%-.64s分区只能用于RANGE/LIST分区尝试用错误数量的子分区添加分区必须添加至少一个分区至少一个分区必须合并分区重组量超过而不是分区量重复分区名称%-.192s在此命令上不允许关闭binlog在重新组织一组分区时,它们必须按照次序重组范围分区无法更改除最后分区之外的总范围,无法扩展范围此版不支持此处理程序的分区功能无法从CREATE/ALTER表中定义分区状态%-.64s处理程序仅支持32-bit整数插件'%-.192s'未加载错误%-.32s值:'%-.128T'表没有%-.64s的分区设置%s不能超过一次无法创建%s未能DROP%s处理程序不支持表空间的自动扩展名尺寸参数被错误地指定,编号或表单10M尺寸编号是正确的,但我们不允许数字部分超过20亿未能改变:%s将一行写入基于行的二进制日志失败表定义主机和从站不匹配:%s使用--log-slave-updates的从站必须使用基于行的二进制日志记录,以便能够复制基于行的二进制日志事件事件'%-.192s'已经存在无法存储事件%s。错误代码%M来自存储引擎未知事件'%-.192s'无法改变事件'%-.192s'未能DROP%sINTERVAL为负或太大ENDS无效的或在STARTS之前事件执行时间在过去。事件已被禁用无法打开mysql.event没有提供DateTime表达式You should never see itYou should never see it无法从mysql.event删除该事件在汇编事件的主体时出错相同的旧活动名称列'%s'数据太长无法删除索引'%-.192s':外部索引约束中需要它语法'%s'被弃用,将在Mariadb%s中删除。请使用%s您无法获得日志表的写锁。只有读访问是可能的您无法使用带日志表的锁You should never see itmysql的列计数。%s是错误的。预期%d,找到%d。使用MariaDB%d创建,现在运行%d。请使用mariadb-upgrade来修复此错误当会话打开临时表时,无法切换出基于行的二进制日志格式无法更改存储函数或触发器内的二进制记录格式You should never see it无法使用分区创建临时表分区常量超出分区功能域不允许此分区功能DDL日志中的错误VALUES LESS THAN不允许使用NULL分区名称不正确交易正在进行,无法更改事务特性ALTER TABLE表会导致AUTO_INCREMENT重建,导致重复的条目'%-.192T'用于索引'%-.192s'内部调度器错误%d在开始/停止调度程序期间出错。错误代码%M引擎不能用于分区表无法激活'%-.64s'日志服务器不是基于行的复制构建的Base64字符串的解码失败EVENT主体存在时EVENT DDL语句递归被禁止无法继续,因为事件调度程序已禁用这里只允许整数作为数字存储引擎%s不能用于日志表如果启用日志记录,则无法'%s'日志表无法重命名'%s'。启用日志记录时,重命名日志表必须重命名两个表:日志表到存档表,另一个表返回'%s'对本机函数的呼叫中的参数计数不正确'%-.192s'对本机函数'%-.192s'呼叫中的参数不正确呼叫中的参数不正确为存储函数'%-.192s'此功能'%-.192s'具有与本机函数相同的名称重复条目'%-.64T'键'%-.192s'打开太多文件,请再次执行命令事件执行时间在过去,并ON COMPLETION NOT PRESERVE。创建后,事件立即丢弃事件执行时间在过去,并ON COMPLETION NOT PRESERVE。事件没有改变。指定将来的时间事件%s发生在master上。消息:%-.64s表对某些现有值没有分区自从BINLOG_FORMAT =STATEMENT以来,使用语句格式写入二进制日志的不安全语句。%s.致命错误:%srelay日志读取失败:%srelay日志写入失败:%s无法创建%sMaster命令%s失败:%s二进制记录不可能。消息:%sView%`s.%`s没有创建上下文Creation View%`s.%`s的上下文无效存储例程%`s.%`s的创建上下文无效表的trg文件损坏了。%`s.%`s表%`s.%`s的触发器没有创建上下文触发表%`s.%`s的创建上下文无效事件%`s.%`s的创建上下文无效无法打开触发%`s.%`s的表无法创建存储过程%`s。检查警告You should never see it类型%s的Binlog语句未在格式描述binlog语句之前检测到损坏的复制事件LOAD DATA中的列引用(%-.64s)无效未找到清除的log%sXA_RBTIMEOUT:交易分支回滚:花了太久了XA_RBDEADLOCK:交易分支回滚:检测到死锁prepared statement需要重新准备表'%-.192s'不支持延迟选项There is no master connection '%.*s'<%-.64s> option ignored内置插件无法删除插件很忙,将在关机时卸载%s变量'%s'是只读的。使用set%s付值存储引擎%s不支持此语句的回滚。交易回滚并必须重新启动意外的master心跳数据:%s心跳周期的请求值是负的或超过允许的最大值(%u秒)You should never see it解析冲突功能时出错。消息:%-.64s写入异常表失败。消息:%-.128s表格备注'%-.64s'太长(max =%u)字段'%-.64s'太长(max =%u)FUNCTION %s不存在。在参考手册中查看“函数名称解析”部分数据库表分区下分区暂时的重命名“太多并发交易非ASCII分隔符参数不完全支持调试同步点等待超时调试同步点限制达到重复条件信息项'%s'未处理用户定义的警告条件未找到的用户定义未找到条件未处理用户定义的异常条件RESIGNAL处理程序不活跃SIGNAL/RESIGNAL只能使用SQLState定义的条件数据被截断为条件项目'%s'条件项目'%s'的数据太长未知区域设置:'%-.64s'请求的服务器ID%d与SLAVE启动选项--replicate-same-server-id冲突查询缓存已禁用;将query_cache_type设置为ON或DEMAND启用它重复分区字段名称'%-.192s'分区用的列和列表使用不一致不正确类型的分区列值'%-.192s'中的太多字段不能在VALUES IN使用MAXVALUE这种类型不能有多个值%-.64s 分区仅允许的多字段列分区的VALUES IN的行表达式字段'%-.192s'类型不允许为此类型的分区类型分区字段的总长度太大无法执行语句:由于引擎不能支持行和语句,因此无法写入二进制日志无法执行语句:由于BINLOG_FORMAT =ROW和至少一个表使用存储引擎限制为基于语句的日志记录,因此无法写入二进制日志无法执行语句:由于语句不安全,无法写入二进制日志,存储引擎仅限于基于语句的日志记录,而BINLOG_FORMAT = MIXED。%s.无法执行语句:由于语句以行格式,至少一个表使用基于语句的日志记录的存储引擎,因此无法写入二进制日志。无法执行语句:由于BINLOG_FORMAT = STATEMENT,并且至少一个表使用存储引擎限制为基于行的日志记录,因此无法写入二进制日志。%s无法执行语句:由于语句的正常格式和BINLOG_FORMAT = STATEMENT,因此无法写入二进制日志无法执行语句:由于涉及多个引擎并且至少有一个引擎是自记录的,因此无法写入二进制日志。该语句不安全,因为它使用限制子句。这不安全,因为所包含的一组行无法预测该声明不安全,因为它使用插入延迟。这是不安全的,因为无法预测插入行的时间该声明不安全,因为它使用常规日志,慢查询日志或performance_schema表。这是不安全的,因为系统表可能在slave上不同语句不安全,因为它调用了插入AUTO_INCREMENT列的触发器或存储函数。插入的值无法正确记录语句不安全,因为它使用了一个可能在从设备上返回相同值的UDF语句不安全,因为它使用的系统变量可能在从站上具有不同的值语句不安全,因为它使用系统函数可能在从站上返回不同的值语句不安全,因为它在访问同一事务中访问事务表后访问非事务性表%s.语句:%s列%d表'%-.192s.%-.192s'无法从'%-.50s'类型为'%-.50s'无法为表创建转换表'%-.192s.%-.192s'无法在事务中修改@@session.binlog_format指定%.64T的路径太长了'%s'被弃用,将在将来的版本中删除本机表'%-.64s'。'%-.64s'具有错误的结构performance_schema使用无效表'%s'.'%s'由于并发DDL语句正在修改其定义,因此跳过无法在交易事务中修改@@session.binlog_direct_non_transactional_updates无法在存储的函数或触发器内更改Binlog Direct标志空间索引可以仅包含几何类型列索引评论'%-.64s'太长(max =%lu)由于待处理的独家锁,等待锁被中止%s值超出'%s'范围基于非整数类型的基于LIMIT子句的变量混合声明中的自记录和非自动记录引擎是不安全的语句访问非致突变表以及事务性或临时表,并写入其中任何一个无法修改事务中的@@sessient.sql_log_bin无法在存储的函数或触发器内更改SQL_LOG_BIN无法从.par文件中读取分区的值'%-.64s'必须具有类型INT拒绝用户'%s'@'%s'SET PASSWORD不适用于通过%s插件验证的用户由于用户%-.*s已经存在,GRANT IDENTIFIED WITH授权是非法的无法截断外键约束中引用的表(%.192s)插件'%s'是force_plus_permanent,无法卸载心跳期的要求值小于1毫秒。该值重置为0,这意味着心跳将有效地禁用心跳期的请求值超出了“slave_net_timeout”秒的值。该期间的明智价值应小于超时需要多行语句超过“max_binlog_stmt_cache_size”字节的存储;增加这个mariadbd变量,然后重试由于表格被更新为'%-.192s'和'%-.192s',因此不允许允许主键/分区索引更新。表需重建。请做ALTER TABLE %`s FORCE”或转储/重新加载以修复它!'%s'的值应该不小于'%s'的值索引列太大。最大列大小为%lu字节触发器'%-.64s'内存在错误:'%-.256s'未知触发器内存在错误:'%-.256s'索引%s已损坏撤消日志记录太大INSERT IGNORE...SELECT不安全,因为选择由select检索行的顺序确定哪个(如果有)行被忽略。无法预测此顺序,并且在master和slave方面可能有所不同INSERT... SELECT... ON DUPLICATE KEY UPDATE是不安全的,因为SELECT检索行的顺序确定哪个(如果有的话)是更新的。无法预测此顺序,并且在master和slave方面可能有所不同REPLACE... SELECT 不安全,因为选择由select检索行的顺序确定哪个(如果有)行被替换。无法预测此顺序,并且在master和slave方面可能有所不同CREATE... IGNORE SELECT是不安全,因为选择由SELECT检索行的顺序确定哪个(如果有)行被忽略。无法预测此顺序,并且在master和slave方面可能有所不同CREATE... REPLACE SELECT不安全,因为选择由SELECT检索行的顺序确定哪个(如果有)是替换哪个(如果有的话)。无法预测此顺序,并且在master和slave方面可能有所不同UPDATE IGNORE不安全,因为更新行的顺序确定了哪个(如果有)行被忽略。无法预测此顺序,并且在master和slave方面可能有所不同You should never see itYou should never see it从另一个表选择后,使用自动增量列的表格写入的语句是不安全的,因为检索行的顺序确定将写入哪些(如果有)行。无法预测此顺序,并且在主站和slave方面可能有所不同创建表...在具有自动增量列的表上选择...不安全,因为选择的顺序是由select检索行的顺序,确定插入哪个(如果有)行。无法预测此订单,并且在主站和slave方面可能有所不同在具有多个唯一键的表上INSERT... ON DUPLICATE KEY UPDATE的重复索引更新是不安全的你永远不应该看到它系统版本的表%`s.%`s不允许插入AutoIncrement字段,该字段不是组成的主键中的第一部分是不安全的不能从加载%s.%s。表可能损坏了主延迟的所需值%lu超过最大%lu在Binlog语句中只允许Format_Description_Log_Event和行事件(但是提供了%s)分区和表之间的非匹配属性'%-.64s'用分区交换的表是分区:'%-.64s'与分区交换的表是临时的:'%-.64s'子分区表,使用子分区代替分区未知分区'%-.64s'在表'%-.64s'表有不同的定义找到了与分区不匹配的行选项binlog_cache_size(%lu)大于max_binlog_cache_size(%lu);设置binlog_cache_size等于max_binlog_cache_size不能使用%-.64s在索引'%-.64s'上的访问,由于字段'%-.64s”的类型或排序规则转换与分区交换的表具有外键参考:'%-.64s'键值'%-.192s'在表'%-.192s%-.192s'不存在'%s'的价值太长了从网络读取时,复制事件校验和验证失败从日志文件读取时复制事件校验和验证失败选项binlog_stmt_cache_size(%lu)大于max_binlog_stmt_cache_size(%lu);设置binlog_stmt_cache_size等于max_binlog_stmt_cache_size无法更新表'%-.192s'正在创建'%-.192s'非分区表上的PARTITION()子句发现不匹配给定分区集的行You should never see it更改Replication存储库类型时失败:%s无法回滚一些临时表的创建一些临时表被删除,但这些操作无法回滚%s不支持多线程从模式。%s.修改的数据库的数量超过了最大%d;数据库名称不会包含在Replication事件元数据中无法以并行模式执行当前事件组。遇到事件%s,中继日志名称%s,position%s,它防止并行模式执行此事件组。原因:%s%s分区表不支持FullText索引无效条件号在没有SSL/TLS的纯文本中发送密码非常不安全在Master.Info存储库中存储MariaDB用户名或密码信息不安全,因此不建议使用。有关此问题和可能的替代方案,请参阅MariaDB手册表'%.192s'的外键约束,记录'%-.192s'会导致表'%.192s'中的重复条目,键'%.192s'表'%.192s'的外键约束,记录'%-.192s'会导致子表中的重复条目仅在启动从SQL线程时无法设置身份验证选项该表没有全文索引来支持此查询无法在存储的函数或触发器中设置系统变量%.200s持续交易时,无法设置系统变量%.200s系统变量@@session.gtid_next具有值%.200s,该值未在@@session.gtid_next_list中列出当@@session.gtid_next_list == null时,系统变量@@session.gtid_next无法在事务内更改语句'SET %.200s'无法调用存储的函数系统变量@@sessient.gtid_next不能是'自动'@@sessient.gtid_next_list非null时跳过事务%.200s,因为它已经被执行和记录畸形GTID设置规范'%.200s'格式错误的GTID集编码畸形GTID规范'%.200s'无法生成全局事务标识符:整数组件达到了最大值。用新server_uuId重新启动服务器当MASTER_AUTO_POSITION处于活动状态时,无法设置参数MASTER_LOG_FILE,MASTER_LOG_POS,RELAY_LOG_FILE和RELAY_LOG_POSCHANGE MASTER TO MASTER_AUTO_POSITION = 1只能在GTID_MODE = ON上执行当GTID_Next != AUTOMATIC 或GTID_NEXT_LIST != NULL时,无法在事务中执行语句GTID_MODE = ON或GTID_MODE = UPGRADE_STEP_2需要ENFORCE_GTID_CONSISTY = 1GTID_MODE = ON或UPGRADE_STEP_1或UPGRADE_STEP_2需要--log-bin和-log-slave-updatesGTID_NEXT无法设置为UUID:NUMBER 当GTID_MODE = OFFGTID_NEXT无法在当GTID_MODE = ON上时设置为ANONYMOUSGTID_NEXT_LIST无法设置为非空值当GTID_MODE = OFF找到一个Gtid_log_event或Previous_gtids_log_event,当gtid_mode = OFF时当Enforce_gtid_consistenty = 1时,对非事务性表的更新只能在Autocomated语句或单一语句事务中完成,而不是在与事务表中的更新相同的语句中CREATE TABLE...SELECT在ENFORCE_GTID_CONSISTENCY = 1时被禁止当ENFORCE_GTID_CONSISTENCY = 1时,语句CREATE TEMPORARY TABL和DROP TEMPORARY TABLE,只能在非事务性上下文中执行,并且要求autocommit = 1GTID_MODE的值只能一次更改一步:OFF<-> UPGRODE_STEP_1 <-> UPGRODE_STEP_2 <-> ON。另请注意,此值必须在所有服务器上同时上升或下降;有关说明,请参阅手册。“从机更改主站到Master_Auto_Position = 1,因此主站连接,但主设备已清除了slave需要的GTID的二进制日志无法由拥有GTID的客户端更改GTID_NEXT。客户拥有%s。所有权在提交或回滚上发布未知%s格式名称:'%s'无法在只读事务中执行语句表分区的评论'%-.64s'太长(max =%lu)从站未配置或未能正确初始化。您必须至少set --server-id以启用主站或从站。可以在MariaDB错误日志中找到其他错误消息InnoDB目前一次支持一个全文索引创建无法在临时InnoDB表上创建FullText索引列'%-.192s'是innodb fulltext索引的错误类型InnoDB全文索引的索引'%-.192s'是错误的类型错误创建索引'%-.192s'所需的多于'innodb_online_alter_log_max_size'字节的修改日志。请再试一次未知算法'%s'未知锁定类型'%s'当从站因为错误停止或以MTS模式终止时,不呢执行CHANGE MASTER。考虑使用RESET SLAVE或START SLAVE UNTIL从并行执行模式下的从站错误后无法恢复。可以在MariaDB错误日志中找到其他错误消息无法清理工作者信息表。可以在MariaDB错误日志中找到其他错误消息列数为%s.%s是错误的。预期的%d,找到%d。表可能损坏了从站必须静默地重试当前事务You should never see it架构不匹配(%s)表%-.192s在系统表空间中IO读取错误:(%lu,%s)%sIO写错错误:(%lu,%s)%s表空间缺少表'%-.192s'表格'%-.192s'的表空间。请在导入之前丢弃表空间表空间已被丢弃为表%`s内部错误:%-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE 失败,错误%lu:'%s'索引损坏:%s已弃用YEAR(%lu)列类型。创建YEAR(4)列代替Your password does not satisfy the current policy requirements (%s)您必须在执行此语句之前设置密码无法添加外键约束。外表'%s'中的约束'%s'缺少索引无法添加外键约束。引用的表'%s'中的约束'%s'缺少索引无法将外键约束'%s'添加到系统表无法打开引用的表'%s'无法在表'%s'上添加外键约束。外键约束'%s'中的选项不正确重复%s约束名称'%s'密码哈希没有预期的格式。检查密码()函数是否使用正确的密码算法无法删除'%-.192s'列:在外部索引约束'%-.192s'中需要无法删除列'%-.192s':在外键约束'%-.192s'中需要,表%-.192s列'%-.192s'不能没有null:在外键约束'%-.192s'设置为null重复索引%`s。这已弃用,将在未来的版本中不允许无法更改列'%-.192s':用于外部键约束'%-.192s'无法更改列'%-.192s':用于在外部键约束'%-.192s'的表'%-.192s'无法从表中删除来自表中的父级的表中的行'%-.192s”表'%-.192s'畸形通信包以只读模式运行当GTID_NEXT设置为GTID时,必须在提交或回滚后立即将其再次设置。如果在从SQL线程中看到此错误消息,则表示当前事务中的表是在主站和从站上的非交易的事务性。在客户端连接中,它意味着您在事务之前执行SET GTID_NEXT并忘记将GTID_NEXT设置为不同的标识符或在提交或回滚后“自动”。当前gtid_next是'%s'无法在存储过程中设置系统变量%.200s只能在GTID_MODE = ON设置GTID_PURGED只有在GTID_EXECUTED为空时才可以设置GTID_PURGED只有在没有持续的事务时才可以设置GTID_PURGED(即使在其他客户端中不)GTID_PURGED从'%s'更改为'%s'GTID_EXECUTE从'%s'更改为'%s'无法执行语句:由于BINLOG_FORMAT = STATEMENT,因此无法写入二进制日志,并将复制和非复制表写入此操作不支持%s。试试%s不支持%s。原因:%s。试试%s复制算法需要锁定分区特定操作尚不支持锁定/算法参与外键的列被更名无法更改列类型添加外键需要figner_key_checks = OFF使用忽略创建唯一索引需要复制算法删除重复行不允许删除主键,而不添加新的主键添加自动增量列需要锁定无法使用用户可见的替换隐藏的FTS_DOC_ID无法删除或重命名FTS_DOC_IDfulltext索引创建需要锁定使用GTID_Mode = ON运行时,无法设置SQL_SLAVE_SKIP_COUNTER。相反,对于要跳过的每个事务,使用与事务相同的GTID生成空事务索引的重复条目'%-.192s'对象的长数据库名称和标识符导致路径长度超过%d字符。路径:'%s'无法将null转换为非常量默认值您的密码已过期。要登录您必须使用支持过期密码的客户端更改它在错误分区%s中找到了一行无法安排事件%s,中继日志名称%s,position%s对工作线程,因为它的大小%lu超过了slave_pending_jobs_size_max (%lu)无法在InnoDB表上CREATE FULLTEXT INDEX WITH PARSER二进制日志文件'%s'逻辑损坏:%s未清除文件%s,因为它被%d线程读取,只清除%d文件中的%d文件%s未清除,因为它是活动日志文件更新中的自动增量值与内部生成的值冲突未记录行事件的%s语句,该语句以行格式修改BlackHole表。表:'%-.192s'从设备无法从存储库初始化主信息结构从站无法从存储库初始化中继日志信息结构访问拒绝尝试更改为用户'%-.48s'@'%-.64s'(使用密码:%s)。断开连接innodb是只读模式STOP SLAVE命令执行不完整:从SQL线程获得停止信号,线程正忙,一旦当前任务完成后,SQL线程将停止STOP SLAVE命令执行不完整:从机动程线程得到停止信号,线程很忙,一旦当前任务完成后,IO线程将停止。无法执行操作。表'%-.64s。%-.64s'丢失,损坏或包含不良数据临时文件写入失败升级索引名称失败,请使用创建索引(ALTER TABLE)算法复制来重建索引"You should never see it函数或表达式'%s'不能用于%s的%`sYou should never see it主键无法在生成的列上定义无法在虚拟生成的列上定义键/索引无法在生成的列上定义%s子句的外键忽略了表'%s'中为生成的列'%s'指定的值已被忽略生成的列尚未支持这一点You should never see itYou should never see it%s存储引擎不支持生成的列未知选项'%-.64s'值不正确'%-.64T'选项'%-.64s'You should never see itYou should never see itYou should never see it转换'%-.128s'到%-.32s时溢出。值截断转换'%-.128s'到%-.32s时值截断非法值'%-.128s',在转换%-.32s时遇到遇到非法格式的动态列字符串达到动态列实现限制非法值用作动态列函数的参数动态列包含未知字符集“in_to_exists”或'materialization'optimizer_switch标志中的至少一个必须是'开启'查询缓存已禁用(调整大小或类似命令正在进行中);稍后重复此命令查询缓存全局禁用,您无法为此会话启用它查看'%-.192s'.'%-.192s's ORDER BY子句被忽略,因为还有其他ORDER BY子句连接被杀死You should never see it无法修改事务中的@@session.skip_replication无法修改存储函数或触发器内的@@session.skip_replicationQuery execution was interrupted. The query exceeded %s %llu. The query result may be incomplete表'%-.192s.%-.192s'在引擎中不存在目标未运行可解释的命令连接'%.*s'与现有连接'%.*s'冲突Master'%.*s':不能%sSLAVE'%.*s'SLAVE '%.*s'开始了slave'%.*s'停止了引擎%s无法发现表%`-.192s.%`-.192s,'%s'初始化复制GTID状态失败无法解析GTID列表无法更新Replication Slave GTID状态GTID %u-%u-%llu和%u-%u-%llu冲突(重复域ID%u)未能打开%s.%s连接从站请求从GTID%u-%u-%llu开始,这不在Master的Binlog中无法从表%s中加载Replication Slave GTID位置。%s指定的GTID%u-%u-%llu与二进制日志冲突,其中包含更新的GTID%u-%u-%llu。如果使用master_gtid_pos = current_pos,则Binlog位置将覆盖@@gtid_slave_pos的新值指定值为@@gtid_slave_pos不包含复制域%u的值。这与二进制日志冲突,其中包含gtid%u-%u-%llu。如果使用master_gtid_pos = current_pos,则Binlog位置将覆盖@@ gtid_slave_pos的新值启动从站,直到master_gtid_pos要求从站使用gtid尝试对Binlog GTID%u-%u-%llu进行,这将创建具有现有GTID%u-%u-%llu的订单无序序列号,并且启用了GTID严格模式主机上的Binlog缺少从站所需请求的GTID%u-%u-%llu(即使存在后续的序列号),并启用GTID严格模式重新连接后,从master收到意外的GTID。这通常表示在不重新启动从线程的情况下替换主服务器。%s.无法修改@@sessient.gtid_domain_id或@@session.gtid_seq_no无法修改@@sessient.gtid_domain_id或@@session.gtid_seq_no或触发器连接从站请求从GTID%u-%u-%llu开始,这不在Master的Binlog中。由于Master的Binlog包含具有更高序列号的GTID,因此它可能意味着由于执行额外错误的交易,因此slave已经分歧如果已将任何GTID记录到二进制日志,则不允许此操作。首先运行RESET MASTER擦除日志未知查询ID:%lld错误Base64数据作为位置%u无效的角色规范%`s当前用户无效无法将角色'%s'授予:%s无法撤消来自:%s的角色'%s'无法更改@@slave_parallel_threads,而另一个更改正在进行中由于早期提交的失败取决于依赖于哪个依赖性,提交失败'%-.192s'是一个VIEW使用并行复制和带有多个复制域的GTID时,无法使用@@SQL_SLAVE_SKIP_COUNTER。相反,可以使用明确设置@@gtid_slave_pos以在给定的gtid位置之后跳到表%`s的定义太大了插件'%-.192s'已安装查询执行中断(超出MAX_STATEMENT_TIME)%s不支持子查询或存储的函数系统变量%.200s无法在set语句中设置。“You should never see it无法创建用户'%-.64s'@'%-.64s';它已经存在无法删除用户'%-.64s'@'%-.64s';它不存在无法创建角色'%-.64s';它已经存在无法删除'%-.64s'。它不存在无法将'%s'字符0x转换为0x%-.64s到'%s'列的默认值不正确'%-.128T' '%.192s'你不是查询%lld的所有者没有收集无关的统计信息列'%s'聚合函数'%-.192s)'SELECT#%d的属于选择#%d<%-.64s> innodb分区忽略的选项文件%s已损坏查询在主设备上部分完成(主设备:%d)并中止。你的master在这一点上有可能不一致。如果您确定您的主站是可以的,请在从站上手动运行此查询,然后使用SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE ;查询:'%s'查询在主站和从站上引起了不同的错误。主站错误:消息(格式)='%s'错误代码=%d;从站错误:实际消息='%s',错误代码=%d。默认数据库:'%s'。查询:'%s'表'%s'的存储引擎'%s'没有加载。处理程序未激活时GET STACKED DIAGNOSTICS不再支持%s。该语句被转换为%s。语句不安全,因为它使用全文解析器插件,它可能不会在从站上返回相同的值。无法丢弃与临时表相关联的/导入表空间外键级联删除/更新超出了%d的最大深度。列数为%s.%s是错误的。预期的%d,找到%d。使用MariaDB%d创建,现在运行%d。请使用mariadb-upgrade来修复此错误。触发器%s.%s.%s没有CREATE属性。引用的触发器'%s'用于给定的动作时间和事件类型不存在。EXPLAIN FOR CONNECTION仅支持SELECT/UPDATE/INSERT/DELETE/REPLACE列'%-.192s'的大小无效。表存储引擎'%-.64s'所找到的必备创建选项丢失存储引擎'%-.64s'中的内存不足。匿名用户的密码不能过期。无法使用正在运行的从SQL线程执行此操作;首先运行STOP SLAVE SQL_THREAD无法在物化的子查询上创建FullText索引撤消日志错误:%s对数的参数无效无法使用正在运行的slave IO线程执行此操作;首先运行STOP SLAVE IO_THREAD FOR CHANNEL'%s'。当从站具有临时表时,此操作可能不安全。表将保持打开,直到服务器重新启动或通过任何复制的DROP语句删除表。建议等到Slave_open_temp_tables = 0。使用CHANGE MASTER TO master_log_file子句更改master,但没有master_log_pos子句可能不安全。旧位置值可能对新的二进制日志文件无效。You should never see itSELECT不是只读语句,禁用计时器重复条目'%-.192s'。'%s'模式不再有任何效果。使用STRICT_ALL_TABLES或STRICT_TRANS_TABLES。表达式#%u ORDER BY包含聚合函数并适用于UNION表达式#%u通过包含聚合函数,并适用于非聚合查询的结果在启用了slave保存提交次序时至少有一个以前的工人遇到错误后,slave工作者已停止。要保留提交次序,此线程执行的最后一项事务尚未提交。在修复任何故障线程后重新启动从站时,您也应该修复此工作人。slave_preerve_commit_order不支持%s。服务器目前处于离线模式二进制几何函数%s给定两个不同SRID的几何形状:%u和%u,应该是相同的。调用几何函数%s与不受支持类型的参数。未知的GIS错误发生在功能%s中。在GIS功能%s中捕获的未知异常。提供给功能%s的GIS数据无效。几何形状在功能%s中没有数据。无法计算质心,因为在功能%s中几何为空。几何叠加计算错误:几何数据在功能%s中无效。几何旋转信息计算错误:几何数据在功能%s中无效。在功能%s中出乎意料地中断交叉点的分析程序。在功能%s中抛出的未知异常。内存分配错误:%-.256s。函数%s。域名错误:%-.256s. 函数%s长度误差:%-.256s函数%s。无效的参数错误:%-.256s函数%s。超出范围错误:%-.256s 函数%s。溢出错误:%-.256s。功能%s。范围错误:%-.256s函数%s。下溢错误:%-.256s函数%s。逻辑错误:%-.256s 函数%s。运行时错误:%-.256s函数%s。未知例外:%-.384s在函数%s中。几何字节字符串必须是小endian。为Replication User提供的密码超过32个字符的最大长度用户级锁名名称'%-.192s'不正确。在尝试获得用户级锁时发现死锁;尝试回滚交易/释放锁定并重新启动锁定采集。无法执行REPLACE,因为它需要删除不在视图中的行不要支持使用GIS索引的表中的在线操作This error never happensThis error never happens使用列列表并选择字段列表具有不同的列计数WITH条款中的元素太多了WITH子句重复查询名称%`-.64s没有元素'%s'递归的锚点锚定表'%s'不可接受的相互递归物质化的衍生参考指向递归的WITH 表'%s'表'%s'R_WRONG_WINDOW_SPEC_NAME违反了递归定义的限制没有定义名称'%s'的窗口规范具有相同名称'%s'的多个窗口规范窗口规范引用另一个'%s'不能包含分区列表引用的窗口规范'%s'已包含次序列表引用的窗口规范'%s'不能包含窗口框架窗框绑定规格的不可接受的组合窗口函数仅在SELECT列表和ORDER BY子句中允许窗口规范中不允许窗口功能窗框不允许使用'%s'在“%s”的窗口规范中没有订单列表范围型框架需要单个排序键订购逐个条款行类型框架需要整数范围类型框架需要数字数据类型帧排除尚不支持此窗口功能可能没有窗口框架NTILE的参数必须大于0CONSTRAINT %`s失败的%`-.192s。%`-.192s%s条款中的表达太大了获得了一个错误评估存储的表达式%s计算默认值为%`s时出错字段%`-.64s的表达指的是未初始化的字段%`s只允许一个默认分区给定动作时间和事件类型的引用触发'%s'不存在此类参数使用不支持默认/忽略值仅支持基于行的复制,支持批量操作解压压缩的binlog失败坏JSON,参数%d 函数'%s' 位置%d变量%d出现禁止字符,函数'%s'在%d处JSON文本中的意外结尾,参数%d 函数'%s'JSON文本语法错误 参数%d 函数'%s' 位置%dJSON文本中逸出不正确 参数%d 函数'%s' 位置%d超过JSON嵌套深度的%d限制 参数%d 函数'%s' 位置%d的JSON文本路径错误 参数%d 函数'%s'JSON路径语法错误 参数%d 函数'%s' 位置%dJSON路径深度上限达到:%d 参数%d 函数'%s' 位置%dJSON路径中的通配符不允许 参数%d 函数'%s'JSON路径应当以排列为终 参数%d 函数'%s'函数'%s'的第二个参数必须是'一个'或'全部'CREATE TEMPORARY TABLE 不允许用ROW_FORMAT=COMPRESSED或KEY_BLOCK_SIZE为st_geomfromgeojson函数指定了不正确的GeoJSON格式。Geojson格式不正确 -  Linestring指定的太少点。Geojson格式不正确 - 多边形未关闭。path表达式'$'不允许在参数%d中允许运行'%s'。与此从站相同的server_uuId / server_id的从站已连接到主设备闪回不支持%s%s钥匙在散装负载期间出现订单批量负载行重叠现有行binlog_format != ROW时无法在master上执行更新MyRocks仅支持读取承诺和可重复读取隔离级别。请从当前隔离级别的%s改变当在MyRocks禁用唯一检查时,INSERT,UPDATE, LOAD,使用Clauses更新或替换索引的子句(即,在重复的重复键更新,替换)中,不允许使用。查询:%sSTART TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT时,无法执行更新。此交易回滚并无法承诺。只支持支持的操作是滚动,因此将丢弃所有待处理的更改。请重新启动其他事务。如果修改行,MyRocks目前不支持保存点的回滚。在RockSDB存储引擎中,START TRANSACTION WITH CONSISTENT SNAPSHOT 只支持REPEATABLE READ隔离字符串索引列%s的不受支持的归类。%s使用二进制校构(%s)。表'%s'不存在,但MyRocks内存存在元数据信息。这是数据不一致的标志。请检查是否存在'%s.frm',并尝试恢复如果它不存在。列族('%s')标志(%d)与现有标志(%d)不同。分配新的CF标志,或者不要更改现有的CF标志。Myrocks中的TTL持续时间(%s)必须是无符号非空64位整数。状态误差%d从RockSDB收到:%s%s,状态误差%d从rocksdb收到:%s当表有隐藏的PK时,目前禁用TTL支持。Myrocks中的TTL列(%s)必须是一个无符号的非空64位整数,存在于表内,并具有伴随的TTL持续时间。已弃用每个索引列族选项MyRocks在Alter期间创建新的索引定义失败。MyRocks在Alter期间失败填充次要索引。窗口函数不能用作组函数的参数。好的包太大了Geojson格式不正确 - 空的'coordinates'阵列。MyRocks目前不支持与“No Pad ”属性的归类。非法参数数据类型%s和%s为操作'%s'非法参数数据类型%s用于操作'%s'对Cursor的参数计数不正确'%-.192s'未知的结构系统变量或行程变量'%-.*s'行变量'%-.192s'没有字段'%-.192s'结束标识符'%-.192s'不匹配'%-.192s'序列'%-.64s。%-.64s'已经用完了序列'%-.64s。%-.64s的值冲突序列'%-.64s。%-.64s'表结构无效(%s)序列'%-.64s。%-.64s的访问错误Sequences requires binlog_format mixed or row'%-.64s。%-.64s'不是序列'%-.192s'不是序列未知序列:'%-.300s'未知视图:'%-.300s'错误插入序列。人们只能将单表插入到序列对象(与mariadb-dump)中进行。如果要更改序列,请使用更改序列。在%u中以%s在包规范中声明子程序'%-.192s',但未在包主体中定义子程序'%-.192s'具有前向声明但未定义压缩列'%-.192s'不能用于索引规范未知压缩方法:%s使用的表值构造函数具有不同数量的值字段参考'%-.192s'不能用于表值构造函数%s函数需要数字数据类型%s函数的参数不是分区的常量%s函数的参数不属于范围[0,1]%s函数仅接受可以转换为数字类型的参数在错误的上下文中使用的聚合特定指令(fetch组下一行)聚合函数丢失的聚合特定指令(fetch组下一行)限制仅接受整数值隐形列%`s必须具有默认值匹配的行:%ld已更改:%ld插入:%ld警告:%ld%`s必须为系统版本为表%s的类型%`sTransaction-Precise系统版本控制%`s不受支持You should never see it错误的分区类型,预期类型:%`s版本化表%`s.%`s:partition%`s已满,添加更多历史分区(out of %s)也许缺少参数:%s只能在旋转间隔时丢弃最旧的分区You should never see it分区%`s包含非历史数据系统版本为%`s.%`s不允许。更改@@system_versioning_alter_history用ALTER。不允许系统版本为%`s.%`s。不支持更改返回/来自本机系统版本传输引擎。不允许使用SYSTEM_TIME范围选择器与递归的System_time子句相冲突表%`s必须至少有一个版本后的列表%`s不是系统版本的%`s的错误参数:缺少'%s'system_time的时期必须使用列%`s和%`s用于分区%`s的错误参数:'%s'的错误值%`s的错误分区:必须至少有一个HISTORY,只能有一个CURRENTTRX_ID%llu在`mysql.transaction_registry`中找不到无法更改系统版本配置字段%`s无法删除由SYSTEM_TIME分区的表%`s的系统版本不支持%`s数据库中的系统版本化表事务注册表已禁用重复行%s列%`s表%`s已经是系统版本的You should never see it系统版本的表不支持%s事务 - 精确的系统 - 版本的表不支持按行开始或行末端分区表'%-.192s'的索引文件已满列%`s.%`s在单个更新语句中不能更换一次在此上下文中,表值构造函数不允许在没有元素的行表%`s的SYSTEM_TIME分区不支持历史查询%s索引%`s不支持此操作更改表选项需要将要重建的表格重建由于您在运行BACKUP STAGE,无法执行命令您必须启动备份“备份阶段开始”备份阶段'%s'相同或在当前备份阶段'%s'之前备份阶段'%s'失败未知备份阶段:'%s'。阶段应该是START,FLUSH,BLOCK_DDL,BLOCK_COMIT或END之一由于凭证错误太多,用户被阻止;用'ALTER USER / FLUSH PRIVILEGES'解锁访问拒绝,此帐户已锁定应用程序时间段表不能临时%`s的期间的字段有不同的类型无法指定多个应用程序时间段期间字段%`s不能是%s期间%`s未在表中找到列%`s在更新集列表中指定的周期%`s中使用无法DROP CONSTRAINT `%s`。使用DROP PERIOD `%s`指定的索引部分太长;最大索引部分长度为 %u 个字节Comment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledrussian/errmsg.sys000064400000265733150343473000010306 0ustar00��bo��=�JNWwm}�BZn[`KGTSr�xBB[C=&PMk:F�oU��J/'Y0gu*\R750HG=4P�iC;7Ea,+GSB���V���*f:*e2����/e/Nt�R`4D<Pjz`@9V$4gP:3V�V03�+���xAWf5xU3�n��u]]}JJ;rk��V;�X��zxJd+A��z��TC`�1iL��UeX�I3Q`<>@@�vc>}}��G������q�{�{���._��~e��P_D5���L�t��WlPpdO�F$3.AK6+<9=,OAg.3oa-LN.*'A/CG-T�sG�=!�2oR@RU5,y.E))2%D,5'<%'�� =!"!$40F-"RBOf{�a5O9J[j�{�<2;/!-S0HS>"6%!2*+!L2-+D#2&\��W7�;]2W53)E<067-c-D���y'IN8:>OQ0__fH>�'5#)�P�@�PC;JF8�EcW!F0N 66-*8

A:M%wy_IZG75@CFa"B1`,5F8:2P@;b'2H-@%&5;[j;>%)8!5HrB:;"(/6MX38}< +(= ,)@W?$�`L.7'2Pi?,4!D4%02�C>>?K8|�80f)%,6%45-&1Z)/"@I+1%#3>n'l4422m	


(6 #*)++!?'&\K)8**ENG9�����{�|���[ce�]:;);7!_UI;3;!7Jq9B"7DFLH<��WkT;B54������
�V/b8Eh<:8<-".�aF=JM�>-1>?R5��7F�|m_=INnr;hL*&�SzS^<9FH�G���zE4=�@7?>{��dW.#*S,E�D6fi?)i"�K\[SK^g�>08_*,�/(@31UL09!(�Bi,g"�94a9JlEH]��b`C6:?M05-B4>4,:.\[O`>M`0-<?+.A^@�D���Udu7!KL�(3>3;74.+/6F@B-<�20>oA;�2QY#C*3d6t��5ZNk=1(rB+-*)GMOT)1&&0,(%)%'+,[*�Q8D&,+7?J37PAA>C7&/?(2%1)P'-4E#P?9(BL<IOf<IYCN4MDD/DV!$%;y�p�L|P��J*.>�7:6B6F:2cC72%<9&."�eB?BC->?LNY"/>6?,a:+jk*62"'4;V6+H>!&*`+QOF-8<0>`d&2.5!;:A5#@X!nQ:A-%)Q)(-)PP;Ik�hashchkisamchkНЕТДАНевозможно создать файл '%-.200s' (ошибка: %M)Невозможно создать таблицу %`s.%`s (ошибка: %M)Невозможно создать базу данных '%-.192s' (ошибка: %M)Невозможно создать базу данных '%-.192s'. База данных уже существуетНевозможно удалить базу данных '%-.192s'. Такой базы данных нетОшибка при удалении базы данных (невозможно удалить '%-.192s', ошибка: %M)Невозможно удалить базу данных (невозможно удалить каталог '%-.192s', ошибка: %M)Ошибка при удалении '%-.192s' (ошибка: %M)Невозможно прочитать запись в системной таблицеНевозможно получить статусную информацию о '%-.200s' (ошибка: %M)Невозможно определить рабочий каталог (ошибка: %M)Невозможно поставить блокировку на файле (ошибка: %M)Невозможно открыть файл: '%-.200s' (ошибка: %M)Невозможно найти файл: '%-.200s' (ошибка: %M)Невозможно прочитать каталог '%-.192s' (ошибка: %M)Невозможно перейти в каталог '%-.192s' (ошибка: %M)Запись изменилась с момента последней выборки в таблице '%-.192s'Диск заполнен. (%s). Ожидаем, пока кто-то не уберет после себя мусор... (ошибка: %M)Невозможно произвести запись, дублирующийся ключ в таблице '%-.192s'Ошибка при закрытии '%-.192s' (ошибка: %M)Ошибка чтения файла '%-.200s' (ошибка: %M)Ошибка при переименовании '%-.210s' в '%-.210s' (ошибка: %M)Ошибка записи в файл '%-.200s' (ошибка: %M)'%-.192s' заблокирован для измененийСортировка прерванаПредставление '%-.192s' не существует для '%-.192s'Получена ошибка %M от обработчика таблиц %sОбработчик %s таблицы %`s.%`s не поддерживает эту возможностьНевозможно найти запись в '%-.192s'Некорректная информация в файле '%-.200s'Некорректный индексный файл для таблицы: '%-.200s'. Попробуйте восстановить егоСтарый индексный файл для таблицы '%-.192s'; отремонтируйте его!Таблица '%-.192s' предназначена только для чтенияНедостаточно памяти. Перезапустите сервер и попробуйте еще раз (нужно %d байт)Недостаточно памяти для сортировки. Увеличьте размер буфера сортировки на сервереНеожиданный конец файла '%-.192s' (ошибка: %M)Слишком много соединенийНедостаточно памяти.Невозможно получить имя хоста для вашего адресаНекорректное приветствиеДля пользователя '%s'@'%s' доступ к базе данных '%-.192s' закрытДоступ закрыт для пользователя '%s'@'%s' (был использован пароль: %s)База данных не выбранаНеизвестная команда коммуникационного протоколаСтолбец '%-.192s' не может принимать величину NULLНеизвестная база данных '%-.192s'Таблица '%-.192s' уже существуетНеизвестная таблица '%-.100T'Столбец '%-.192s' в %-.192s задан неоднозначноСервер находится в процессе остановкиНеизвестный столбец '%-.192s' в '%-.192s''%-.192s' не присутствует в GROUP BYНевозможно произвести группировку по '%-.192s'Выражение содержит групповые функции и столбцы, но не включает GROUP BY. А как вы умудрились получить это сообщение об ошибке?Количество столбцов не совпадает с количеством значенийСлишком длинный идентификатор '%-.100T'Дублирующееся имя столбца '%-.192s'Дублирующееся имя ключа '%-.192s'Дублирующаяся запись '%-.192T' по ключу %dНекорректный определитель столбца для столбца '%-.192s'%s около '%-.80T' на строке %dЗапрос оказался пустымПовторяющаяся таблица/псевдоним '%-.192s'Некорректное значение по умолчанию для '%-.192s'Указано несколько первичных ключейУказано слишком много ключей. Разрешается указывать не более %d ключейУказано слишком много частей составного ключа. Разрешается указывать не более %d частейУказан слишком длинный ключ. Максимальная длина ключа составляет %d байтКлючевой столбец '%-.192s' в таблице не существуетСтолбец типа BLOB %`s не может быть использован как значение ключа в %s таблицеСлишком большая длина столбца '%-.192s' (максимум = %lu). Используйте тип BLOB или TEXT вместо текущегоНекорректное определение таблицы: может существовать только один автоинкрементный столбец, и он должен быть определен как ключCould not delete gtid domain. Reason: %s.%s (инициирована пользователем: %s): Корректная остановка%s: Получен сигнал %d. Прекращаем!%s: Остановка завершена%s: Принудительно закрываем поток %ld  пользователя: '%-.48s'Невозможно создать IP-сокетВ таблице '%-.192s' нет такого индекса, как в CREATE INDEX. Создайте таблицу зановоАргумент разделителя полей - не тот, который ожидался. Обращайтесь к документацииФиксированный размер записи с полями типа BLOB использовать нельзя, применяйте 'fields terminated by'Файл '%-.128s' должен находиться в том же каталоге, что и база данных, или быть общедоступным для чтенияФайл '%-.200s' уже существуетЗаписей: %ld  Удалено: %ld  Пропущено: %ld  Предупреждений: %ldЗаписей: %ld  Дубликатов: %ldНекорректная часть ключа. Используемая часть ключа не является строкой, указанная длина больше, чем длина части ключа, или обработчик таблицы не поддерживает уникальные части ключаНельзя удалить все столбцы с помощью ALTER TABLE. Используйте  DROP TABLEНевозможно удалить (DROP %s) %`-.192s. Убедитесь что он действительно существуетЗаписей: %ld  Дубликатов: %ld  Предупреждений: %ldTable '%-.192s' is specified twice, both as a target for '%s' and as a separate source for dataНеизвестный номер потока: %luВы не являетесь владельцем потока %lldНикакие таблицы не использованыСлишком много значений для столбца %-.192s в SETНевозможно создать уникальное имя файла журнала %-.200s.(1-999)Таблица '%-.192s' заблокирована уровнем READ lock и не может быть измененаТаблица '%-.192s' не была заблокирована с помощью LOCK TABLESYou should never see itНекорректное имя базы данных '%-.100T'Некорректное имя таблицы '%-.100s'Для такой выборки SELECT должен будет просмотреть слишком много записей и, видимо, это займет очень много времени. Проверьте ваше указание WHERE, и, если в нем все в порядке, укажите SET SQL_BIG_SELECTS=1Неизвестная ошибкаНеизвестная процедура '%-.192s'Некорректное количество параметров для процедуры '%-.192s'Некорректные параметры для процедуры '%-.192s'Неизвестная таблица '%-.192s' в %-.32sСтолбец '%-.192s' указан дваждыНеправильное использование групповых функцийВ таблице '%-.192s' используются возможности, не поддерживаемые в этой версии MariaDBВ таблице должен быть как минимум один столбецТаблица '%-.192s' переполненаНеизвестная кодировка '%-.64s'Слишком много таблиц. MariaDB может использовать только %d таблиц в соединенииСлишком много столбцовСлишком большой размер записи. Максимальный размер строки, исключая поля BLOB, - %ld. Возможно, вам следует изменить тип некоторых полей на BLOBСтек потоков переполнен:  использовано: %ld из %ld стека.  Применяйте 'mariadbd --thread_stack=#' для указания большего размера стека, если необходимоВ OUTER JOIN обнаружена перекрестная зависимость. Внимательно проанализируйте свои условия ONTable handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handlerНевозможно загрузить функцию '%-.192s'Невозможно инициализировать функцию '%-.192s'; %-.80sНедопустимо указывать пути для динамических библиотекФункция '%-.192s' уже существуетНевозможно открыть динамическую библиотеку '%-.192s' (ошибка: %d, %-.128s)Невозможно отыскать символ '%-.128s' в библиотекеФункция '%-.192s' не определенаХост '%-.64s' заблокирован из-за слишком большого количества ошибок соединения. Разблокировать его можно с помощью 'mariadb-admin flush-hosts'Хосту '%-.64s' не разрешается подключаться к этому серверу MariaDBВы используете MariaDB от имени анонимного пользователя, а анонимным пользователям не разрешается менять паролиДля того чтобы изменять пароли других пользователей, у вас должны быть привилегии на изменение таблиц в базе данных mysqlНевозможно отыскать подходящую запись в таблице пользователейСовпало записей: %ld  Изменено: %ld  Предупреждений: %ldНевозможно создать новый поток (ошибка %M). Если это не ситуация, связанная с нехваткой памяти, то вам следует изучить документацию на предмет описания возможной ошибки работы в конкретной ОСКоличество столбцов не совпадает с количеством значений в записи %luНевозможно заново открыть таблицу '%-.192s'Неправильное использование величины NULLОшибка регулярного выражения: %sОдновременное использование сгруппированных (GROUP) столбцов (MIN(),MAX(),COUNT(),...) с несгруппированными столбцами является некорректным, если в выражении есть GROUP BYТакие права не определены для пользователя '%-.48s' на хосте '%-.64s'Команда %-.100T запрещена пользователю '%s'@'%s' для таблицы %`s.%`sКоманда %-.32s запрещена пользователю '%s'@'%s' для столбца '%-.192s' в таблице '%-.192s'Неверная команда GRANT или REVOKE. Обратитесь к документации, чтобы выяснить, какие привилегии можно использоватьСлишком длинное имя пользователя/хоста для GRANTТаблица '%-.192s.%-.192s' не существуетТакие права не определены для пользователя '%-.48s' на компьютере '%-.64s' для таблицы '%-.192s'Эта команда не допускается в данной  версии MariaDBУ вас ошибка в запросе. Изучите документацию по используемой версии MariaDB на предмет корректного синтаксисаПоток, обслуживающий отложенную вставку (delayed insert), не смог получить запрашиваемую блокировку на таблицу %-.192sСлишком много потоков, обслуживающих отложенную вставку (delayed insert)Прервано соединение %ld к базе данных '%-.192s' пользователя '%-.48s' (%-.64s)Полученный пакет больше, чем 'max_allowed_packet'Получена ошибка чтения от потока соединения (connection pipe)Получена ошибка от fcntl()Пакеты получены в неверном порядкеНевозможно распаковать пакет, полученный через коммуникационный протоколПолучена ошибка в процессе получения пакета через коммуникационный протокол Получен таймаут ожидания пакета через коммуникационный протокол Получена ошибка при передаче пакета через коммуникационный протокол Получен таймаут в процессе передачи пакета через коммуникационный протокол Результирующая строка больше, чем 'max_allowed_packet'%s таблицы не поддерживают типы BLOB/TEXT%s таблицы не поддерживают автоинкрементные столбцыНельзя использовать INSERT DELAYED для таблицы '%-.192s', потому что она заблокирована с помощью LOCK TABLESНеверное имя столбца '%-.100s'Обработчик таблиц %s не может проиндексировать столбец %`sНе все таблицы в MERGE определены одинаковоНевозможно записать в таблицу '%-.192s' из-за ограничений уникального ключаСтолбец типа BLOB '%-.192s' был указан в определении ключа без указания длины ключаВсе части первичного ключа (PRIMARY KEY) должны быть определены как NOT NULL; Если вам нужна поддержка величин NULL в ключе, воспользуйтесь индексом UNIQUEВ результате возвращена более чем одна строкаЭтот тип таблицы требует определения первичного ключаЭта версия MariaDB скомпилирована без поддержки RAIDВы работаете в режиме безопасных обновлений (safe update mode) и попробовали изменить таблицу без использования ключевого столбца в части WHEREКлюч '%-.192s' не существует в таблице '%-.192s'Невозможно открыть таблицуОбработчик таблицы не поддерживает этого: %sВам не разрешено выполнять эту команду в транзакцииПолучена ошибка %M в процессе COMMITПолучена ошибка %M в процессе ROLLBACKПолучена ошибка %M в процессе FLUSH_LOGSПолучена ошибка %M в процессе CHECKPOINTПрервано соединение %lld к базе данных '%-.192s' пользователя '%-.48s' с хоста '%-.64s'%-.64s (%-.64s)You should never see itДвоичный журнал обновления закрыт, невозможно выполнить RESET MASTERОшибка перестройки индекса сохраненной таблицы '%-.192s'Ошибка от головного сервера: '%-.64s'Возникла ошибка чтения в процессе коммуникации с головным серверомВозникла ошибка записи в процессе коммуникации с головным серверомНевозможно отыскать полнотекстовый (FULLTEXT) индекс, соответствующий списку столбцовНевозможно выполнить указанную команду, поскольку у вас присутствуют активно заблокированные таблица или открытая транзакцияНеизвестная системная переменная '%-.*s'Таблица '%-.192s' помечена как испорченная и должна пройти проверку и ремонтТаблица '%-.192s' помечена как испорченная и последний (автоматический?) ремонт не был успешнымВнимание: по некоторым измененным нетранзакционным таблицам невозможно будет произвести откат транзакцииТранзакции, включающей большое количество команд, потребовалось более чем 'max_binlog_cache_size' байт. Увеличьте эту переменную сервера mariadbd и попробуйте еще разЭту операцию невозможно выполнить при работающем потоке подчиненного сервера %2$*1$s. Сначала выполните STOP SLAVE '%2$*1$s'Для этой операции требуется работающий подчиненный сервер. Сначала выполните START SLAVEЭтот сервер не настроен как подчиненный. Внесите исправления в конфигурационном файле или с помощью CHANGE MASTER TOCould not initialize master info structure for '%.*s'; more error messages can be found in the MariaDB error logНевозможно создать поток подчиненного сервера. Проверьте системные ресурсыУ пользователя %-.64s уже больше чем 'max_user_connections' активных соединенийС этой командой вы можете использовать только константные выраженияТаймаут ожидания блокировки истек; попробуйте перезапустить транзакциюОбщее количество блокировок превысило размеры таблицы блокировокБлокировки обновлений нельзя получить в процессе чтения не принятой (в режиме READ UNCOMMITTED) транзакцииНе допускается DROP DATABASE, пока поток держит глобальную блокировку чтенияНе допускается CREATE DATABASE, пока поток держит глобальную блокировку чтенияНеверные параметры для %s'%s'@'%s' не разрешается создавать новых пользователейНеверное определение таблицы; Все таблицы в MERGE должны принадлежать одной и той же базе данныхВозникла тупиковая ситуация в процессе получения блокировки; Попробуйте перезапустить транзакциюИспользуемый тип таблиц (%s) не поддерживает полнотекстовых индексовНевозможно добавить ограничения внешнего ключа для `%s`Невозможно добавить или обновить дочернюю строку: проверка ограничений внешнего ключа не выполняетсяНевозможно удалить или обновить родительскую строку: проверка ограничений внешнего ключа не выполняетсяОшибка соединения с головным сервером: %-.128sОшибка выполнения запроса на головном сервере: %-.128sОшибка при выполнении команды %s: %-.128sНеверное использование %s и %sИспользованные операторы выборки (SELECT) дают разное количество столбцовНевозможно исполнить запрос, поскольку у вас установлены конфликтующие блокировки чтенияИспользование транзакционных таблиц наряду с нетранзакционными запрещеноОпция '%s' дважды использована в выраженииПользователь '%-.64s' превысил использование ресурса '%s' (текущее значение: %ld)В доступе отказано. Вам нужны привилегии %-.128s для этой операцииПеременная '%-.64s' является потоковой (SESSION) переменной и не может быть изменена с помощью SET GLOBALПеременная '%-.64s' является глобальной (GLOBAL) переменной, и ее следует изменять с помощью SET GLOBALПеременная '%-.64s' не имеет значения по умолчаниюПеременная '%-.64s' не может быть установлена в значение '%-.200T'Неверный тип аргумента для переменной '%-.64s'Переменная '%-.64s' может быть только установлена, но не считанаНеверное использование или в неверном месте указан '%s'Эта версия MariaDB пока еще не поддерживает '%s'Получена неисправимая ошибка %d: '%-.320s' от головного сервера в процессе выборки данных из двоичного журналаSlave SQL thread ignored the query because of replicate-*-table rulesVariable '%-.192s' is a %s variableIncorrect foreign key definition for '%-.192s': %sKey reference and table reference don't matchОперанд должен содержать %d колонокПодзапрос возвращает более одной записиUnknown prepared statement handler (%.*s) given to %sHelp database is corrupt or does not existЦиклическая ссылка на подзапросПреобразование поля '%s' из %s в %sСсылка '%-.64s' не поддерживается (%s)Every derived table must have its own aliasSelect %u был упразднен в процессе оптимизацииTable '%-.192s' from one of the SELECTs cannot be used in %-.32sClient does not support authentication protocol requested by server; consider upgrading MariaDB clientAll parts of a SPATIAL index must be NOT NULLCOLLATION '%s' is not valid for CHARACTER SET '%s'Slave is already runningSlave already has been stoppedUncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)ZLIB: Not enough memoryZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)ZLIB: Input data corruptedRow %u was cut by %s)Row %lu doesn't contain data for all columnsRow %lu was truncated; it contained more data than there were input columnsColumn set to default value; NULL supplied to NOT NULL column '%s' at row %luOut of range value for column '%s' at row %luData truncated for column '%s' at row %luUsing storage engine %s for table '%s'Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'Cannot drop one or more of the requested usersCan't revoke all privileges for one or more of the requested usersIllegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'Illegal mix of collations for operation '%s'Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)Unknown collation: '%-.64s'SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is startedСервер запущен в режиме --secure-auth (безопасной авторизации), но для пользователя '%s'@'%s' пароль сохранён в старом формате; необходимо обновить формат пароляПоле или ссылка '%-.192s%s%-.192s%s%-.192s' из SELECTа #%d была найдена в SELECTе #%dIncorrect parameter or combination of parameters for START SLAVE UNTILIt is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mariadbd restartSQL thread is not to be started so UNTIL options are ignoredIncorrect index name '%-.100s'Incorrect catalog name '%-.100s'Кеш запросов не может установить размер %llu, новый размер кеша зпросов - %luColumn '%-.192s' cannot be part of FULLTEXT indexUnknown key cache '%-.100s'MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to workUnknown storage engine '%s''%s' is deprecated and will be removed in a future release. Please use %s insteadТаблица %-.100s в %s не может изменятсяThe '%s' feature is disabled; you need MariaDB built with '%s' to have it workingThe MariaDB server is running with the %s option so it cannot execute this statementColumn '%-.100s' has duplicated value '%-.64s' in %sTruncated incorrect %-.32T value: '%-.128T'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseInvalid ON UPDATE clause for '%-.192s' columnThis command is not supported in the prepared statement protocol yetGot error %d '%-.200s' from %sGot temporary error %d '%-.200s' from %sUnknown or incorrect time zone: '%-.64s'Invalid TIMESTAMP value in column '%s' at row %luInvalid %s character string: '%.64T'Result of %s() was larger than max_allowed_packet (%ld) - truncatedConflicting declarations: '%s%s' and '%s%s'Can't create a %s from within another stored routine%s %s already exists%s %s does not existFailed to DROP %s %sFailed to CREATE %s %s%s with no matching label: %sRedefining label %sEnd-label %s without matchReferring to uninitialized variable %sPROCEDURE %s can't return a result set in the given contextRETURN is only allowed in a FUNCTION%s is not allowed in stored proceduresThe update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6Query execution was interruptedIncorrect number of arguments for %s %s; expected %u, got %uUndefined CONDITION: %sNo RETURN found in FUNCTION %sFUNCTION %s ended without RETURNCursor statement must be a SELECTCursor SELECT must not have INTOUndefined CURSOR: %sCursor is already openCursor is not openUndeclared variable: %sIncorrect number of FETCH variablesNo data - zero rows fetched, selected, or processedDuplicate parameter: %sDuplicate variable: %sDuplicate condition: %sDuplicate cursor: %sFailed to ALTER %s %sSubquery value not supported%s is not allowed in stored function or triggerVariable or condition declaration after cursor or handler declarationCursor declaration after handler declarationCase not found for CASE statementСлишком большой конфигурационный файл '%-.192s'Неверный заголовок типа файла '%-.192s'Неожиданный конец файла в коментарии '%-.200s'Ошибка при распознавании параметра '%-.192s' (строка: '%-.192s')Неожиданный конец файла при пропуске неизвестного параметра '%-.192s'ANALYZE/EXPLAIN/SHOW не может быть выполнено; недостаточно прав на таблицы запросаФайл '%-.192s' содержит неизвестный тип '%-.64s' в заголовке'%-.192s.%-.192s' - не %sСтолбец '%-.192s' не обновляемыйView SELECT содержит подзапрос в конструкции FROMView SELECT содержит конструкцию '%s'View SELECT содержит переменную или параметрView SELECT содержит ссылку на временную таблицу '%-.192s'View SELECT и список полей view имеют разное количество столбцовАлгоритм слияния view не может быть использован сейчас (алгоритм будет неопеределенным)Обновляемый view не содержит ключа использованных(ой) в нем таблиц(ы)View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themCan't drop or alter a %s from within another stored routineGOTO is not allowed in a stored procedure handlerTrigger '%s' already existsTrigger does not existTrigger's '%-.192s' is a view, temporary table or sequenceUpdating of %s row is not allowed in %striggerThere is no %s row in %s triggerField '%-.192s' doesn't have a default valueDivision by 0Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %luIllegal %s '%-.192T' value found during parsingCHECK OPTION для необновляемого VIEW %`-.192s.%`-.192sПроверка CHECK OPTION для VIEW %`-.192s.%`-.192s провалилась%-.32s command denied to user '%s'@'%s' for routine '%-.192s'Failed purging old relay logs: %sPassword hash should be a %d-digit hexadecimal numberTarget log not found in binlog indexI/O error reading log index fileServer configuration does not permit binlog purgeFailed on fseek()Fatal error during log purgeA purgeable log is in use, will not purgeUnknown error during log purgeFailed initializing relay log position: %sYou are not using binary loggingThe '%-.64s' syntax is reserved for purposes internal to the MariaDB serverWSAStartup FailedCan't handle procedures with different groups yetSelect must have a group with this procedureCan't use ORDER clause with this procedureBinary logging and replication forbid changing the global server %sCan't map file: %-.200s, errno: %MWrong magic in %-.64sPrepared statement contains too many placeholdersKey part '%-.192s' length cannot be 0Проверка контрольной суммы текста VIEW провалиласьНельзя изменить больше чем одну базовую таблицу используя многотабличный VIEW '%-.192s.%-.192s'Нельзя вставлять записи в многотабличный VIEW '%-.192s.%-.192s' без списка полейНельзя удалять из многотабличного VIEW '%-.192s.%-.192s'Operation %s failed for %.256sXAER_NOTA: Unknown XIDXAER_INVAL: Invalid arguments (or unsupported command)XAER_RMFAIL: эту команду нельзя выполнять когда глобальная транзакция находится в состоянии '%.64s'XAER_OUTSIDE: Some work is done outside global transactionXAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistencyXA_RBROLLBACK: Transaction branch was rolled backThere is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'Failed to grant EXECUTE and ALTER ROUTINE privilegesFailed to revoke all privileges to dropped routineData too long for column '%s' at row %luBad SQLSTATE: '%s'%s: ready for connections.
Version: '%s'  socket: '%s'  port: %d  %sCan't load value from file with fixed size rows to variableYou are not allowed to create a user with GRANTIncorrect %-.32s value: '%-.128T' for function %-.32sTable definition has changed, please retry transactionDuplicate handler declared in the same blockOUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE triggerNot allowed to return a result set from a %sCannot get geometry object from data you send to the GEOMETRY fieldA routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changesThis function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute itThe statement (%lu) has no open cursorExplicit or implicit commit is not allowed in stored function or triggerField of view '%-.192s.%-.192s' underlying table doesn't have a default valueRecursive stored functions and triggers are not allowedToo big scale %llu specified for '%-.192s'. Maximum is %uToo big precision %llu specified for '%-.192s'. Maximum is %uFor float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')You can't combine write-locking of system tables with other tables or lock typesUnable to connect to foreign data source: %.64sThere was a problem processing the query on the foreign data source. Data source error: %-.64sThe foreign data source you are trying to reference does not exist. Data source error:  %-.64sCan't create federated table. The data source connection string '%-.64s' is not in the correct formatThe data source connection string '%-.64s' is not in the correct formatCan't create federated table. Foreign data src error:  %-.64sTrigger in wrong schemaThread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable.Routine body for '%-.100s' is too longCannot drop default keycacheDisplay width out of range for '%-.192s' (max = %lu)XAER_DUPID: The XID already existsDatetime function: %-.32s field overflowCan't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/triggerThe definition of table '%-.192s' prevents operation %-.192s on table '%-.192s'The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive mannerNot allowed to set autocommit from a stored function or triggerInvalid definerView '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definerThe user specified as a definer ('%-.64s'@'%-.64s') does not existChanging schema from '%-.192s' to '%-.192s' is not allowedCannot delete or update a parent row: a foreign key constraint fails (%s)Cannot add or update a child row: a foreign key constraint fails (%s)Variable '%-.64s' must be quoted with `...`, or renamedNo definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger'%-.192s' has an old format, you should re-create the '%s' object(s)Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192sFailed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGSIncorrect routine name '%-.192s'Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!AGGREGATE is not supported for stored functionsCan't create more than max_prepared_stmt_count statements (current value: %u)%`s.%`s contains view recursionNon-grouping field '%-.192s' is used in %-.64s clauseThe storage engine %s doesn't support SPATIAL indexesTriggers can not be created on system tablesLeading spaces are removed from name '%s'Failed to read auto-increment value from storage engineuser namehost nameString '%-.70T' is too long for %s (should be no longer than %d)The target table %-.100s of the %s is not insertable-intoTable '%-.64s' is differently defined or of non-MyISAM type or doesn't existToo high level of nesting for selectName '%-.64s' has become ''First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BYНевозможно создать сторонний сервер '%s', так как он уже существуетThe foreign server name you are trying to reference does not exist. Data source error:  %-.64sTable storage engine '%-.64s' does not support the create option '%.64s'Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partitionOnly %-.64s PARTITIONING can use VALUES %-.64s in partition definitionMAXVALUE can only be used in last partition definitionSubpartitions can only be hash partitions and by keyMust define subpartitions on all partitions if on one partitionWrong number of partitions defined, mismatch with previous settingWrong number of subpartitions defined, mismatch with previous settingConstant, random or timezone-dependent expressions in (sub)partitioning function are not allowedExpression in %s must be constantField in list of fields for partition function not found in tableList of fields is only allowed in KEY partitionsThe partition info in the frm file is not consistent with what can be written into the frm fileThe %-.192s function returns the wrong typeFor %-.64s partitions each partition must be definedVALUES LESS THAN value must be strictly increasing for each partitionVALUES value must be of same type as partition functionMultiple definition of same constant in list partitioningPartitioning can not be used stand-alone in queryThe mix of handlers in the partitions is not allowed in this version of MariaDBFor the partitioned engine it is necessary to define all %-.64sToo many partitions (including subpartitions) were definedIt is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioningFailed to create specific handler fileA BLOB field is not allowed in partition functionA %-.192s must include all columns in the table's partitioning functionNumber of %-.64s = 0 is not an allowed valuePartition management on a not partitioned table is not possiblePartitioned tables do not support %sError in list of partitions to %-.64sCannot remove all partitions, use DROP TABLE insteadCOALESCE PARTITION can only be used on HASH/KEY partitionsREORGANIZE PARTITION can only be used to reorganize partitions not to change their numbersREORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs%-.64s PARTITION can only be used on RANGE/LIST partitionsTrying to Add partition(s) with wrong number of subpartitionsAt least one partition must be addedAt least one partition must be coalescedMore partitions to reorganize than there are partitionsDuplicate partition name %-.192sIt is not allowed to shut off binlog on this commandWhen reorganizing a set of partitions they must be in consecutive orderReorganize of range partitions cannot change total ranges except for last partition where it can extend the rangePartition function not supported in this version for this handlerPartition state cannot be defined from CREATE/ALTER TABLEThe %-.64s handler only supports 32 bit integers in VALUESPlugin '%-.192s' is not loadedIncorrect %-.32s value: '%-.128T'Table has no partition for value %-.64sIt is not allowed to specify %s more than onceFailed to create %sFailed to drop %sThe handler doesn't support autoextend of tablespacesA size parameter was incorrectly specified, either number or on the form 10MThe size number was correct but we don't allow the digit part to be more than 2 billionFailed to alter: %sWriting one row to the row-based binary log failedTable definition on master and slave does not match: %sSlave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log eventsEvent '%-.192s' already existsFailed to store event %s. Error code %M from storage engineUnknown event '%-.192s'Failed to alter event '%-.192s'Failed to drop %sINTERVAL is either not positive or too bigENDS is either invalid or before STARTSEvent execution time is in the past. Event has been disabledFailed to open mysql.eventNo datetime expression providedYou should never see itYou should never see itFailed to delete the event from mysql.eventError during compilation of event's bodySame old and new event nameData for column '%s' too longCannot drop index '%-.192s': needed in a foreign key constraintThe syntax '%s' is deprecated and will be removed in MariaDB %s. Please use %s insteadYou can't write-lock a log table. Only read access is possibleYou can't use locks with log tablesYou should never see itColumn count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this errorCannot switch out of the row-based binary log format when the session has open temporary tablesCannot change the binary logging format inside a stored function or triggerYou should never see itCannot create temporary table with partitionsPartition constant is out of partition function domainThis partition function is not allowedError in DDL logNot allowed to use NULL value in VALUES LESS THANIncorrect partition nameTransaction characteristics can't be changed while a transaction is in progressALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'Internal scheduler error %dError during starting/stopping of the scheduler. Error code %MEngine cannot be used in partitioned tablesCannot activate '%-.64s' logThe server was not built with row-based replicationDecoding of base64 string failedRecursion of EVENT DDL statements is forbidden when body is presentCannot proceed, because event scheduler is disabledOnly integers allowed as number hereStorage engine %s cannot be used for log tablesYou cannot '%s' a log table if logging is enabledCannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'Incorrect parameter count in the call to native function '%-.192s'Incorrect parameters in the call to native function '%-.192s'Incorrect parameters in the call to stored function '%-.192s'This function '%-.192s' has the same name as a native functionДублирующаяся запись '%-.64T' по ключу '%-.192s'Too many files opened, please execute the command againEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creationEvent execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the futureThe incident %s occurred on the master. Message: %-.64sTable has no partition for some existing valuesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %sFatal error: %sRelay log read failure: %sRelay log write failure: %sFailed to create %sMaster command %s failed: %sBinary logging not possible. Message: %sView %`s.%`s has no creation contextCreation context of view %`s.%`s is invalidCreation context of stored routine %`s.%`s is invalidCorrupted TRG file for table %`s.%`sTriggers for table %`s.%`s have no creation contextTrigger creation context of table %`s.%`s is invalidCreation context of event %`s.%`s is invalidCannot open table for trigger %`s.%`sCannot create stored routine %`s. Check warningsYou should never see itThe BINLOG statement of type %s was not preceded by a format description BINLOG statementCorrupted replication event was detectedInvalid column reference (%-.64s) in LOAD DATABeing purged log %s was not foundXA_RBTIMEOUT: Transaction branch was rolled back: took too longXA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detectedPrepared statement needs to be re-preparedDELAYED option not supported for table '%-.192s'There is no master connection '%.*s'<%-.64s> option ignoredBuilt-in plugins cannot be deletedPlugin is busy and will be uninstalled on shutdown%s variable '%s' is read-only. Use SET %s to assign the valueStorage engine %s does not support rollback for this statement. Transaction rolled back and must be restartedUnexpected master's heartbeat data: %sThe requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)You should never see itError in parsing conflict function. Message: %-.64sWrite to exceptions table failed. Message: %-.128s"Comment for table '%-.64s' is too long (max = %u)Comment for field '%-.64s' is too long (max = %u)FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference ManualDatabaseTablePartitionSubpartitionTemporaryRenamedToo many active concurrent transactionsNon-ASCII separator arguments are not fully supporteddebug sync point wait timed outdebug sync point hit limit reachedDuplicate condition information item '%s'Unhandled user-defined warning conditionUnhandled user-defined not found conditionUnhandled user-defined exception conditionRESIGNAL when handler not activeSIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATEData truncated for condition item '%s'Data too long for condition item '%s'Unknown locale: '%-.64s'The requested server id %d clashes with the slave startup option --replicate-same-server-idQuery cache is disabled; set query_cache_type to ON or DEMAND to enable itDuplicate partition field name '%-.192s'Inconsistency in usage of column lists for partitioningPartition column values of incorrect typeToo many fields in '%-.192s'Cannot use MAXVALUE as value in VALUES INCannot have more than one value for this type of %-.64s partitioningRow expressions in VALUES IN only allowed for multi-field column partitioningField '%-.192s' is of a not allowed type for this type of partitioningThe total length of the partitioning fields is too largeCannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involvedCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %sCannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based loggingCannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%sCannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENTCannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-loggingThe statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predictedThe statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predictedThe statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slavesStatement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctlyStatement is unsafe because it uses a UDF which may not return the same value on the slaveStatement is unsafe because it uses a system variable that may have a different value on the slaveStatement is unsafe because it uses a system function that may return a different value on the slaveStatement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction%s. Statement: %sColumn %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'Can't create conversion table for table '%-.192s.%-.192s'Cannot modify @@session.binlog_format inside a transactionThe path specified for %.64T is too long'%s' is deprecated and will be removed in a future releaseNative table '%-.64s'.'%-.64s' has the wrong structureInvalid performance_schema usageTable '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statementCannot modify @@session.binlog_direct_non_transactional_updates inside a transactionCannot change the binlog direct flag inside a stored function or triggerA SPATIAL index may only contain a geometrical type columnComment for index '%-.64s' is too long (max = %lu)Wait on a lock was aborted due to a pending exclusive lock%s value is out of range in '%s'A variable of a non-integer based type in LIMIT clauseMixing self-logging and non-self-logging engines in a statement is unsafeStatement accesses nontransactional table as well as transactional or temporary table, and writes to any of themCannot modify @@session.sql_log_bin inside a transactionCannot change the sql_log_bin inside a stored function or triggerFailed to read from the .par fileVALUES value for partition '%-.64s' must have type INTДоступ закрыт для пользователя '%s'@'%s'SET PASSWORD is not applicable for users authenticating via %s pluginGRANT with IDENTIFIED WITH is illegal because the user %-.*s already existsCannot truncate a table referenced in a foreign key constraint (%.192s)Plugin '%s' is force_plus_permanent and can not be unloadedThe requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabledThe requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeoutMulti-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'Table rebuild required. Please do "ALTER TABLE %`s FORCE" or dump/reload to fix it!The value of '%s' should be no less than the value of '%s'Index column size too large. The maximum column size is %lu bytesTrigger '%-.64s' has an error in its body: '%-.256s'Unknown trigger has an error in its body: '%-.256s'Index %s is corruptedUndo log record is too bigINSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveINSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slaveREPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveCREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveCREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slaveUPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slaveYou should never see itYou should never see itStatements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slaveCREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slaveINSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafeYou should never see itNot allowed for system-versioned table %`s.%`sINSERT into autoincrement field which is not the first part in the composed primary key is unsafeCannot load from %s.%s. The table is probably corruptedThe requested value %lu for the master delay exceeds the maximum %luOnly Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)Non matching attribute '%-.64s' between partition and tableTable to exchange with partition is partitioned: '%-.64s'Table to exchange with partition is temporary: '%-.64s'Subpartitioned table, use subpartition instead of partitionUnknown partition '%-.64s' in table '%-.64s'Tables have different definitionsFound a row that does not match the partitionOption binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_sizeCannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'Table to exchange with partition has foreign key references: '%-.64s'Key value '%-.192s' was not found in table '%-.192s.%-.192s'Too long value for '%s'Replication event checksum verification failed while reading from networkReplication event checksum verification failed while reading from a log fileOption binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_sizeCan't update table '%-.192s' while '%-.192s' is being createdPARTITION () clause on non partitioned tableFound a row not matching the given partition setYou should never see itFailure while changing the type of replication repository: %sThe creation of some temporary tables could not be rolled backSome temporary tables were dropped, but these operations could not be rolled back%s is not supported in multi-threaded slave mode. %sThe number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadataCannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s%sFULLTEXT index is not supported for partitioned tablesInvalid condition numberSending passwords in plain text without SSL/TLS is extremely insecureStoring MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternativesForeign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child tableSetting authentication options is not possible when only the Slave SQL Thread is being startedThe table does not have FULLTEXT index to support this queryThe system variable %.200s cannot be set in stored functions or triggersThe system variable %.200s cannot be set when there is an ongoing transactionThe system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LISTWhen @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transactionThe statement 'SET %.200s' cannot invoke a stored functionThe system variable @@SESSION.GTID_NEXT cannot be 'AUTOMATIC' when @@SESSION.GTID_NEXT_LIST is non-NULLSkipping transaction %.200s because it has already been executed and loggedMalformed GTID set specification '%.200s'Malformed GTID set encodingMalformed GTID specification '%.200s'Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuidParameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is activeCHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ONCannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULLGTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updatesGTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFFGTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ONGTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFFFound a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFFWhen ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tablesCREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requiresGTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACKНеизвестное имя формата команды %s: '%s'Cannot execute statement in a READ ONLY transactionComment for table partition '%-.64s' is too long (max = %lu)Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error logInnoDB presently supports one FULLTEXT index creation at a timeCannot create FULLTEXT index on temporary InnoDB tableColumn '%-.192s' is of wrong type for an InnoDB FULLTEXT indexIndex '%-.192s' is of wrong type for an InnoDB FULLTEXT indexCreating index '%-.192s' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try againUnknown ALGORITHM '%s'Unknown LOCK type '%s'CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTILCannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error logCannot clean up worker info tables. Additional error messages can be found in the MariaDB error logColumn count of %s.%s is wrong. Expected %d, found %d. The table is probably corruptedSlave must silently retry current transactionYou should never see itSchema mismatch (%s)Table %-.192s in system tablespaceIO Read error: (%lu, %s) %sIO Write error: (%lu, %s) %sTablespace is missing for table '%-.192s'Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORTTablespace has been discarded for table %`sInternal error: %-.192sALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'Index corrupt: %sТип YEAR(%lu) более не поддерживается, вместо него будет создана колонка с типом YEAR(4)Your password does not satisfy the current policy requirements (%s)You must SET PASSWORD before executing this statementFailed to add the foreign key constraint. Missing index for constraint '%s' in the foreign table '%s'Failed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'Failed to add the foreign key constraint '%s' to system tablesFailed to open the referenced table '%s'Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'Duplicate %s constraint name '%s'The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() functionCannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table %-.192sColumn '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULLDuplicate index %`s. This is deprecated and will be disallowed in a future releaseCannot change column '%-.192s': used in a foreign key constraint '%-.192s'Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'Malformed communication packetRunning in read-only modeWhen GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current GTID_NEXT is '%s'The system variable %.200s cannot be set in stored proceduresGTID_PURGED can only be set when GTID_MODE = ONGTID_PURGED can only be set when GTID_EXECUTED is emptyGTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)GTID_PURGED was changed from '%s' to '%s'GTID_EXECUTED was changed from '%s' to '%s'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to%s is not supported for this operation. Try %s%s is not supported. Reason: %s. Try %sCOPY algorithm requires a lockPartition specific operations do not yet support LOCK/ALGORITHMColumns participating in a foreign key are renamedCannot change column typeAdding foreign keys needs foreign_key_checks=OFFCreating unique indexes with IGNORE requires COPY algorithm to remove duplicate rowsDropping a primary key is not allowed without also adding a new primary keyAdding an auto-increment column requires a lockCannot replace hidden FTS_DOC_ID with a user-visible oneCannot drop or rename FTS_DOC_IDFulltext index creation requires a locksql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transactionДублирующаяся запись по ключу '%-.192s'Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'cannot convert NULL to non-constant DEFAULTYour password has expired. To log in you must change it using a client that supports expired passwordsFound a row in wrong partition %sCannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_maxCannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB tableThe binary log file '%s' is logically corrupted: %sfile %s was not purged because it was being read by %d thread(s), purged only %d out of %d filesfile %s was not purged because it is the active log fileAuto-increment value in UPDATE conflicts with internally generated valuesRow events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): '%-.192s'Slave failed to initialize master info structure from the repositorySlave failed to initialize relay log info structure from the repositoryAccess denied trying to change to user '%-.48s'@'%-.64s' (using password: %s). DisconnectingInnoDB is in read only modeSTOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is completeSTOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is completeOperation cannot be performed. The table '%-.64s.%-.64s' is missing, corrupt or contains bad dataTemporary file write failureUpgrade index name failed, please use create index(alter table) algorithm copy to rebuild index"You should never see itFunction or expression '%s' cannot be used in the %s clause of %`sYou should never see itPrimary key cannot be defined upon a generated columnKey/Index cannot be defined on a virtual generated columnCannot define foreign key with %s clause on a generated columnThe value specified for generated column '%s' in table '%s' has been ignoredThis is not yet supported for generated columnsYou should never see itYou should never see it%s storage engine does not support generated columnsUnknown option '%-.64s'Incorrect value '%-.64T' for option '%-.64s'You should never see itYou should never see itYou should never see itGot overflow when converting '%-.128s' to %-.32s. Value truncatedTruncated value '%-.128s' when converting to %-.32sEncountered illegal value '%-.128s' when converting to %-.32sEncountered illegal format of dynamic column stringDynamic column implementation limit reachedIllegal value used as argument of dynamic column functionDynamic column contains unknown character setAt least one of the 'in_to_exists' or 'materialization' optimizer_switch flags must be 'on'Query cache is disabled (resize or similar command in progress); repeat this command laterQuery cache is globally disabled and you can't enable it only for this sessionView '%-.192s'.'%-.192s' ORDER BY clause ignored because there is other ORDER BY clause alreadyConnection was killedYou should never see itCannot modify @@session.skip_replication inside a transactionCannot modify @@session.skip_replication inside a stored function or triggerQuery execution was interrupted. The query exceeded %s %llu. The query result may be incompleteTable '%-.192s.%-.192s' doesn't exist in engineTarget is not running an EXPLAINable commandConnection '%.*s' conflicts with existing connection '%.*s'Master '%.*s': Can't %s SLAVE '%.*s'SLAVE '%.*s' startedSLAVE '%.*s' stoppedEngine %s failed to discover table %`-.192s.%`-.192s with '%s'Failed initializing replication GTID stateCould not parse GTID listCould not update replication slave gtid stateGTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)Failed to open %s.%sConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlogFailed to load replication slave GTID position from table %s.%sSpecified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSpecified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_posSTART SLAVE UNTIL master_gtid_pos requires that slave is using GTIDAn attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabledThe binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabledUnexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %sCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transactionCannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or triggerConnecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactionsThis operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the logНеизвестный номер запроса: %lldBad base64 data as position %uInvalid role specification %`sThe current user is invalidCannot grant role '%s' to: %sCannot revoke role '%s' from: %sCannot change @@slave_parallel_threads while another change is in progressCommit failed due to failure of an earlier commit on which this one depends'%-.192s' is a viewWhen using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID positionThe definition for table %`s is too bigПлагин '%-.192s' уже установленQuery execution was interrupted (max_statement_time exceeded)%s does not support subqueries or stored functionsThe system variable %.200s cannot be set in SET STATEMENT.You should never see itCan't create user '%-.64s'@'%-.64s'; it already existsCan't drop user '%-.64s'@'%-.64s'; it doesn't existCan't create role '%-.64s'; it already existsCan't drop role '%-.64s'; it doesn't existCannot convert '%s' character 0x%-.64s to '%s'Incorrect default value '%-.128T' for column '%.192s'Вы не являетесь владельцем запроса %lldEngine-independent statistics are not collected for column '%s'Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d<%-.64s> option ignored for InnoDB partitionFile %s is corruptedQuery partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'Storage engine for table '%s'.'%s' is not loaded.GET STACKED DIAGNOSTICS when handler not active%s is no longer supported. The statement was converted to %s.Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave.Cannot DISCARD/IMPORT tablespace associated with temporary tableForeign key cascade delete/update exceeds max depth of %d.Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error.Trigger %s.%s.%s does not have CREATED attribute.Referenced trigger '%s' for the given action time and event type does not exist.EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACEInvalid size for column '%-.192s'.Table storage engine '%-.64s' found required create option missingOut of memory in storage engine '%-.64s'.The password for anonymous user cannot be expired.This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD firstCannot create FULLTEXT index on materialized subqueryUndo Log error: %sInvalid argument for logarithmThis operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first.This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file.You should never see itSelect is not a read only statement, disabling timerDuplicate entry '%-.192s'.'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.Expression #%u of ORDER BY contains aggregate function and applies to a UNIONExpression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated querySlave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well.slave_preserve_commit_order is not supported %s.The server is currently in offline modeBinary geometry function %s given two geometries of different srids: %u and %u, which should have been identical.Calling geometry function %s with unsupported types of arguments.Unknown GIS error occurred in function %s.Unknown exception caught in GIS function %s.Invalid GIS data provided to function %s.The geometry has no data in function %s.Unable to calculate centroid because geometry is empty in function %s.Geometry overlay calculation error: geometry data is invalid in function %s.Geometry turn info calculation error: geometry data is invalid in function %s.Analysis procedures of intersection points interrupted unexpectedly in function %s.Unknown exception thrown in function %s.Memory allocation error: %-.256s in function %s.Domain error: %-.256s in function %s.Length error: %-.256s in function %s.Invalid argument error: %-.256s in function %s.Out of range error: %-.256s in function %s.Overflow error: %-.256s in function %s.Range error: %-.256s in function %s.Underflow error: %-.256s in function %s.Logic error: %-.256s in function %s.Runtime error: %-.256s in function %s.Unknown exception: %-.384s in function %s.Geometry byte string must be little endian.The password provided for the replication user exceeds the maximum length of 32 charactersIncorrect user-level lock name '%-.192s'.Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition.REPLACE cannot be executed as it requires deleting rows that are not in the viewDo not support online operation on table with GIS indexThis error never happensThis error never happensWITH column list and SELECT field list have different column countsToo many WITH elements in WITH clauseDuplicate query name %`-.64s in WITH clauseNo anchors for recursive WITH element '%s'Unacceptable mutual recursion with anchored table '%s'Reference to recursive WITH table '%s' in materialized derivedRestrictions imposed on recursive definitions are violated for table '%s'Window specification with name '%s' is not definedMultiple window specifications with the same name '%s'Window specification referencing another one '%s' cannot contain partition listReferenced window specification '%s' already contains order listReferenced window specification '%s' cannot contain window frameUnacceptable combination of window frame bound specificationsWindow function is allowed only in SELECT list and ORDER BY clauseWindow function is not allowed in window specificationWindow frame is not allowed with '%s'No order list in window specification for '%s'RANGE-type frame requires ORDER BY clause with single sort keyInteger is required for ROWS-type frameNumeric datatype is required for RANGE-type frameFrame exclusion is not supported yetThis window function may not have a window frameArgument of NTILE must be greater than 0проверка CONSTRAINT %`s для %`-.192s.%`-.192s провалиласьExpression in the %s clause is too bigGot an error evaluating stored expression %sGot an error when calculating default value for %`sExpression for field %`-.64s is referring to uninitialized field %`sOnly one DEFAULT partition allowedReferenced trigger '%s' for the given action time and event type does not existDefault/ignore value is not supported for such parameter usageOnly row based replication supported for bulk operationsUncompress the compressed binlog failedBroken JSON string in argument %d to function '%s' at position %dCharacter disallowed in JSON in argument %d to function '%s' at position %dUnexpected end of JSON text in argument %d to function '%s'Syntax error in JSON text in argument %d to function '%s' at position %dIncorrect escaping in JSON text in argument %d to function '%s' at position %dLimit of %d on JSON nested structures depth is reached in argument %d to function '%s' at position %dUnexpected end of JSON path in argument %d to function '%s'Syntax error in JSON path in argument %d to function '%s' at position %dLimit of %d on JSON path depth is reached in argument %d to function '%s' at position %dWildcards in JSON path not allowed in argument %d to function '%s'JSON path should end with an array identifier in argument %d to function '%s'Argument 2 to function '%s' must be "one" or "all".InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.Incorrect GeoJSON format specified for st_geomfromgeojson function.Incorrect GeoJSON format - too few points for linestring specified.Incorrect GeoJSON format - polygon not closed.Path expression '$' is not allowed in argument %d to function '%s'.A slave with the same server_uuid/server_id as this slave has connected to the masterFlashback does not support %s %sKeys are out order during bulk loadBulk load rows overlap existing rowsCan't execute updates on master with binlog_format != ROW.MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %sWhen unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %sCan't execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT.This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction.MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows.Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine.Unsupported collation on string indexed column %s.%s Use binary collation (%s).Table '%s' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if '%s.frm' exists, and try to restore it if it does not exist.Column family ('%s') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag.TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer.Status error %d received from RocksDB: %s%s, Status error %d received from RocksDB: %sTTL support is currently disabled when table has a hidden PK.TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration.The per-index column family option has been deprecatedMyRocks failed creating new key definitions during alter.MyRocks failed populating secondary key during alter.Window functions can not be used as arguments to group functions.OK packet too largeIncorrect GeoJSON format - empty 'coordinates' array.MyRocks doesn't currently support collations with "No pad" attribute.Illegal parameter data types %s and %s for operation '%s'Illegal parameter data type %s for operation '%s'Некорректное количество параметров для курсора '%-.192s'Unknown structured system variable or ROW routine variable '%-.*s'Row variable '%-.192s' does not have a field '%-.192s'END identifier '%-.192s' does not match '%-.192s'Sequence '%-.64s.%-.64s' has run outSequence '%-.64s.%-.64s' has out of range value for optionsSequence '%-.64s.%-.64s' table structure is invalid (%s)Sequence '%-.64s.%-.64s' access errorSequences requires binlog_format mixed or row'%-.64s.%-.64s' is not a SEQUENCE'%-.192s' is not a SEQUENCEUnknown SEQUENCE: '%-.300s'Unknown VIEW: '%-.300s'Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead.At line %u in %sSubroutine '%-.192s' is declared in the package specification but is not defined in the package bodySubroutine '%-.192s' has a forward declaration but is not definedCompressed column '%-.192s' can't be used in key specificationUnknown compression method: %sThe used table value constructor has a different number of valuesField reference '%-.192s' can't be used in table value constructorNumeric datatype is required for %s functionArgument to the %s function is not a constant for a partitionArgument to the %s function does not belong to the range [0,1]%s function only accepts arguments that can be converted to numerical typesAggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong contextAggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate functionLimit only accepts integer valuesInvisible column %`s must have a default valueRows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld%`s must be of type %s for system-versioned table %`sTransaction-precise system versioning for %`s is not supportedYou should never see itWrong partitioning type, expected type: %`sVersioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitionsMaybe missing parameters: %sCan only drop oldest partitions when rotating by INTERVALYou should never see itPartition %`s contains non-historical dataNot allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER.Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported.SYSTEM_TIME range selector is not allowedConflicting FOR SYSTEM_TIME clauses in WITH RECURSIVETable %`s must have at least one versioned columnTable %`s is not system-versionedWrong parameters for %`s: missing '%s'PERIOD FOR SYSTEM_TIME must use columns %`s and %`sWrong parameters for partitioned %`s: wrong value for '%s'Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENTTRX_ID %llu not found in `mysql.transaction_registry`Can not change system versioning field %`sCan not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIMESystem-versioned tables in the %`s database are not supportedTransaction registry is disabledDuplicate ROW %s column %`sTable %`s is already system-versionedYou should never see itSystem-versioned tables do not support %sTransaction-precise system-versioned tables do not support partitioning by ROW START or ROW ENDThe index file for table '%-.192s' is fullThe column %`s.%`s cannot be changed more than once in a single UPDATE statementRow with no elements is not allowed in table value constructor in this contextSYSTEM_TIME partitions in table %`s does not support historical query%s index %`s does not support this operationChanging table options requires the table to be rebuiltCan't execute the command as you have a BACKUP STAGE activeYou must start backup with "BACKUP STAGE START"Backup stage '%s' is same or before current backup stage '%s'Backup stage '%s' failedUnknown backup stage: '%s'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or ENDUser is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'Access denied, this account is lockedApplication-time period table cannot be temporaryFields of PERIOD FOR %`s have different typesCannot specify more than one application-time periodPeriod field %`s cannot be %sPeriod %`s is not found in tableColumn %`s used in period %`s specified in update SET listCan't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for thisSpecified key part was too long; max key part length is %u bytesComment for database '%-.64s' is too long (max = %u)Unknown data type: '%-.64s'Operator does not exist: '%-.128s'Table `%s.%s` history row start '%s' is later than row end '%s'%`s: STARTS is later than query time, first history partition may exceed INTERVAL valueGalera replication not supportedThe used command is not allowed because the MariaDB server or client has disabled the local infile capabilityNo secure transports are configured, unable to set --require_secure_transport=ONSlave SQL thread ignored the '%s' because table is sharedAUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`sKey %`s cannot explicitly include column %`sKey %`s cannot have WITHOUT OVERLAPS'%-.128s' is not allowed in this contextEngine %s does not support rollback. Changes were committed during rollback callA primary key cannot be marked as IGNORESKIP LOCKED makes this statement unsafeField '%s' can't be set for JSON_TABLE '%s'.Every table function must have an alias.Can't store an array or an object in the scalar column '%s' of JSON_TABLE '%s'.Can't store multiple matches of the path in the column '%s' of JSON_TABLE '%s'.FETCH ... WITH TIES requires ORDER BY clause to be presentDropped orphan trigger '%-.64s', originally created for table: '%-.192s'Storage engine %s is disabledmysql_system_tables_data.sql000064400000006377150343473000012375 0ustar00-- Copyright (c) 2007, 2013, Oracle and/or its affiliates.
-- 
-- 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

--
-- The initial data for system tables of MySQL Server
--

-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix
-- host which will later be included in a Windows zip file), any lines
-- containing "@current_hostname" are filtered out by mysql_install_db.

-- Get the hostname, if the hostname has any wildcard character like "_" or "%" 
-- add escape character in front of wildcard character to convert "_" or "%" to
-- a plain character
SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname;
SELECT '{"access":18446744073709551615}' INTO @all_privileges;
SELECT '{"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}' into @all_with_auth;

-- Fill "global_priv" table with default users allowing root access
-- from local machine if "global_priv" table didn't exist before
CREATE TEMPORARY TABLE tmp_user_nopasswd LIKE global_priv;
CREATE TEMPORARY TABLE tmp_user_socket LIKE global_priv;
-- Classic passwordless root account.
INSERT INTO tmp_user_nopasswd VALUES ('localhost','root',@all_privileges);
REPLACE INTO tmp_user_nopasswd SELECT @current_hostname,'root',@all_privileges FROM dual WHERE @current_hostname != 'localhost';
REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root',@all_privileges);
REPLACE INTO tmp_user_nopasswd VALUES ('::1','root',@all_privileges);
-- More secure root account using unix socket auth.
INSERT INTO tmp_user_socket VALUES ('localhost', 'root',@all_with_auth);
REPLACE INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),@all_with_auth);
IF @auth_root_socket is not null THEN
  IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN
     INSTALL SONAME 'auth_socket'; END IF; END IF;

INSERT INTO global_priv SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0 AND @auth_root_socket IS NULL;
INSERT INTO global_priv SELECT * FROM tmp_user_socket WHERE @had_user_table=0 AND @auth_root_socket IS NOT NULL;

CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv;
INSERT INTO tmp_proxies_priv SELECT Host, User, '', '', TRUE, '', now() FROM tmp_user_nopasswd WHERE Host != 'localhost' AND @auth_root_socket IS NULL;
REPLACE INTO tmp_proxies_priv SELECT @current_hostname, IFNULL(@auth_root_socket, 'root'), '', '', TRUE, '', now() FROM DUAL WHERE @current_hostname != 'localhost';
INSERT INTO  proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0;
DROP TABLE tmp_user_nopasswd, tmp_user_socket, tmp_proxies_priv;
mariadb_dyncol.h000064400000020116150400263530007662 0ustar00/* Copyright (c) 2011, Monty Program Ab
   Copyright (c) 2011, Oleksandr Byelkin
   Copyright (c) 2012, 2022 MariaDB Corporation AB

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are
   met:

   1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.

   THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   SUCH DAMAGE.
*/

#ifndef ma_dyncol_h
#define ma_dyncol_h

#ifdef	__cplusplus
extern "C" {
#endif

#ifndef LIBMARIADB
#include <decimal.h>
#include <my_decimal_limits.h>
#endif
#include <mysql.h>

#ifndef longlong_defined
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
typedef unsigned long	ulonglong;	/* ulong or unsigned long long */
typedef long		longlong;
#endif
#define longlong_defined
#endif


#ifndef _my_sys_h
typedef struct st_dynamic_string
{
  char *str;
  size_t length,max_length,alloc_increment;
} DYNAMIC_STRING;
#endif

struct st_mysql_lex_string
{
  char *str;
  size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
typedef struct st_mysql_lex_string LEX_STRING;
/*
  Limits of implementation
*/
#define MAX_TOTAL_NAME_LENGTH 65535
#define MAX_NAME_LENGTH (MAX_TOTAL_NAME_LENGTH/4)

/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK

enum enum_dyncol_func_result
{
  ER_DYNCOL_OK= 0,
  ER_DYNCOL_YES= 1,                /* For functions returning 0/1 */
  ER_DYNCOL_FORMAT= -1,            /* Wrong format of the encoded string */
  ER_DYNCOL_LIMIT=  -2,            /* Some limit reached */
  ER_DYNCOL_RESOURCE= -3,          /* Out of resources */
  ER_DYNCOL_DATA= -4,              /* Incorrect input data */
  ER_DYNCOL_UNKNOWN_CHARSET= -5,   /* Unknown character set */
  ER_DYNCOL_TRUNCATED= 2           /* OK, but data was truncated */
};

typedef DYNAMIC_STRING DYNAMIC_COLUMN;

enum enum_dynamic_column_type
{
  DYN_COL_NULL= 0,
  DYN_COL_INT,
  DYN_COL_UINT,
  DYN_COL_DOUBLE,
  DYN_COL_STRING,
  DYN_COL_DECIMAL,
  DYN_COL_DATETIME,
  DYN_COL_DATE,
  DYN_COL_TIME,
  DYN_COL_DYNCOL
};

typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;

struct st_dynamic_column_value
{
  DYNAMIC_COLUMN_TYPE type;
  union
  {
    long long long_value;
    unsigned long long ulong_value;
    double double_value;
    struct {
      MYSQL_LEX_STRING value;
      MARIADB_CHARSET_INFO *charset;
    } string;
#ifndef LIBMARIADB
    struct {
      decimal_digit_t buffer[DECIMAL_BUFF_LENGTH];
      decimal_t value;
    } decimal;
#endif
    MYSQL_TIME time_value;
  } x;
};

typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;

#ifdef MADYNCOL_DEPRECATED
enum enum_dyncol_func_result
dynamic_column_create(DYNAMIC_COLUMN *str,
                      uint column_nr, DYNAMIC_COLUMN_VALUE *value);

enum enum_dyncol_func_result
dynamic_column_create_many(DYNAMIC_COLUMN *str,
                           uint column_count,
                           uint *column_numbers,
                           DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
                      DYNAMIC_COLUMN_VALUE *value);
enum enum_dyncol_func_result
dynamic_column_update_many(DYNAMIC_COLUMN *str,
                           uint add_column_count,
                           uint *column_numbers,
                           DYNAMIC_COLUMN_VALUE *values);

enum enum_dyncol_func_result
dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);

enum enum_dyncol_func_result
dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);

enum enum_dyncol_func_result
dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
                   DYNAMIC_COLUMN_VALUE *store_it_here);
#endif

/* new functions */
enum enum_dyncol_func_result
mariadb_dyncol_create_many_num(DYNAMIC_COLUMN *str,
                               uint column_count,
                               uint *column_numbers,
                               DYNAMIC_COLUMN_VALUE *values,
                               my_bool new_string);
enum enum_dyncol_func_result
mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
                                 uint column_count,
                                 MYSQL_LEX_STRING *column_keys,
                                 DYNAMIC_COLUMN_VALUE *values,
                                 my_bool new_string);


enum enum_dyncol_func_result
mariadb_dyncol_update_many_num(DYNAMIC_COLUMN *str,
                               uint add_column_count,
                               uint *column_keys,
                               DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
                                 uint add_column_count,
                                 MYSQL_LEX_STRING *column_keys,
                                 DYNAMIC_COLUMN_VALUE *values);


enum enum_dyncol_func_result
mariadb_dyncol_exists_num(DYNAMIC_COLUMN *org, uint column_nr);
enum enum_dyncol_func_result
mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name);

/* List of not NULL columns */
enum enum_dyncol_func_result
mariadb_dyncol_list_num(DYNAMIC_COLUMN *str, uint *count, uint **nums);
enum enum_dyncol_func_result
mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count,
                          MYSQL_LEX_STRING **names);

/*
   if the column do not exists it is NULL
*/
enum enum_dyncol_func_result
mariadb_dyncol_get_num(DYNAMIC_COLUMN *org, uint column_nr,
                       DYNAMIC_COLUMN_VALUE *store_it_here);
enum enum_dyncol_func_result
mariadb_dyncol_get_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name,
                         DYNAMIC_COLUMN_VALUE *store_it_here);

my_bool mariadb_dyncol_has_names(DYNAMIC_COLUMN *str);

enum enum_dyncol_func_result
mariadb_dyncol_check(DYNAMIC_COLUMN *str);

enum enum_dyncol_func_result
mariadb_dyncol_json(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json);

void mariadb_dyncol_free(DYNAMIC_COLUMN *str);

#define mariadb_dyncol_init(A) memset((A), 0, sizeof(DYNAMIC_COLUMN))
#define dynamic_column_initialize(A) mariadb_dyncol_init((A))
#define dynamic_column_column_free(A) mariadb_dyncol_free((A))

/* conversion of values to 3 base types */
enum enum_dyncol_func_result
mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val,
                       MARIADB_CHARSET_INFO *cs, char quote);
enum enum_dyncol_func_result
mariadb_dyncol_val_long(longlong *ll, DYNAMIC_COLUMN_VALUE *val);
enum enum_dyncol_func_result
mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val);

enum enum_dyncol_func_result
mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
                      uint *count,
                      MYSQL_LEX_STRING **names, DYNAMIC_COLUMN_VALUE **vals);

int mariadb_dyncol_column_cmp_named(const MYSQL_LEX_STRING *s1,
                                    const MYSQL_LEX_STRING *s2);

enum enum_dyncol_func_result
mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count);

#define mariadb_dyncol_value_init(V) \
do {\
  (V)->type= DYN_COL_NULL;\
} while(0)

/*
  Prepare value for using as decimal
*/
void mariadb_dyncol_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);


#ifdef	__cplusplus
}
#endif
#endif
mariadb_ctype.h000064400000005041150400263540007517 0ustar00/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */

/*
  A better implementation of the UNIX ctype(3) library.
  Notes:   my_global.h should be included before ctype.h
*/

#ifndef _mariadb_ctype_h
#define _mariadb_ctype_h

#include <ctype.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define CHARSET_DIR	"charsets/"
#define MY_CS_NAME_SIZE 32

#define MADB_DEFAULT_CHARSET_NAME "latin1"
#define MADB_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#define MADB_AUTODETECT_CHARSET_NAME "auto"

/* we use the mysqlnd implementation */
typedef struct ma_charset_info_st
{
  unsigned int	nr; /* so far only 1 byte for charset */
  unsigned int  state;
  const char	*csname;
  const char	*name;
  const char  *dir;
  unsigned int codepage;
  const char  *encoding;
  unsigned int	char_minlen;
  unsigned int	char_maxlen;
  unsigned int 	(*mb_charlen)(unsigned int c);
  unsigned int 	(*mb_valid)(const char *start, const char *end);
} MARIADB_CHARSET_INFO;

extern const MARIADB_CHARSET_INFO  mariadb_compiled_charsets[];
extern MARIADB_CHARSET_INFO *ma_default_charset_info;
extern MARIADB_CHARSET_INFO *ma_charset_bin;
extern MARIADB_CHARSET_INFO *ma_charset_latin1;
extern MARIADB_CHARSET_INFO *ma_charset_utf8_general_ci;
extern MARIADB_CHARSET_INFO *ma_charset_utf16le_general_ci;

MARIADB_CHARSET_INFO *find_compiled_charset(unsigned int cs_number);
MARIADB_CHARSET_INFO *find_compiled_charset_by_name(const char *name);

size_t mysql_cset_escape_quotes(const MARIADB_CHARSET_INFO *cset, char *newstr,  const char *escapestr, size_t escapestr_len);
size_t mysql_cset_escape_slashes(const MARIADB_CHARSET_INFO *cset, char *newstr, const char *escapestr, size_t escapestr_len);
const char* madb_get_os_character_set(void);
#ifdef _WIN32
int madb_get_windows_cp(const char *charset);
#endif

#ifdef	__cplusplus
}
#endif

#endif
my_config.h000064400000000224150400263550006665 0ustar00/* Do not edit this file directly, it was auto-generated by cmake */

#warning This file should not be included by clients, include only <mysql.h>

mysql_com.h000064400000000256150400263560006724 0ustar00/* Do not edit this file directly, it was auto-generated by cmake */

#warning This file should not be included by clients, include only <mysql.h>

#include <mariadb_com.h>

my_global.h000064400000000224150400263570006662 0ustar00/* Do not edit this file directly, it was auto-generated by cmake */

#warning This file should not be included by clients, include only <mysql.h>

mysql/plugin_auth.h000064400000007321150400263600010400 0ustar00#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */

/**
  @file

  This file defines constants and data structures that are the same for
  both client- and server-side authentication plugins.
*/
#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED

/** the max allowed length for a user name */
#define MYSQL_USERNAME_LENGTH 512

/**
  return values of the plugin authenticate_user() method.
*/

/**
  Authentication failed. Additionally, all other CR_xxx values
  (libmariadb error code) can be used too.

  The client plugin may set the error code and the error message directly
  in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error
  code was returned, an error message in the MYSQL structure will be
  overwritten. If CR_ERROR is returned without setting the error in MYSQL,
  CR_UNKNOWN_ERROR will be user.
*/
#define CR_ERROR 0
/**
  Authentication (client part) was successful. It does not mean that the
  authentication as a whole was successful, usually it only means
  that the client was able to send the user name and the password to the
  server. If CR_OK is returned, the libmariadb reads the next packet expecting
  it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
*/
#define CR_OK -1
/**
  Authentication was successful.
  It means that the client has done its part successfully and also that
  a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN).
  In this case, libmariadb will not read a packet from the server,
  but it will use the data at mysql->net.read_pos.

  A plugin may return this value if the number of roundtrips in the
  authentication protocol is not known in advance, and the client plugin
  needs to read one packet more to determine if the authentication is finished
  or not.
*/
#define CR_OK_HANDSHAKE_COMPLETE -2

typedef struct st_plugin_vio_info
{
  enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
         MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
  int socket;     /**< it's set, if the protocol is SOCKET or TCP */
#ifdef _WIN32
  HANDLE handle;  /**< it's set, if the protocol is PIPE or MEMORY */
#endif
} MYSQL_PLUGIN_VIO_INFO;

/**
  Provides plugin access to communication channel
*/
typedef struct st_plugin_vio
{
  /**
    Plugin provides a pointer reference and this function sets it to the
    contents of any incoming packet. Returns the packet length, or -1 if
    the plugin should terminate.
  */
  int (*read_packet)(struct st_plugin_vio *vio, 
                     unsigned char **buf);
  
  /**
    Plugin provides a buffer with data and the length and this
    function sends it as a packet. Returns 0 on success, 1 on failure.
  */
  int (*write_packet)(struct st_plugin_vio *vio, 
                      const unsigned char *packet, 
                      int packet_len);

  /**
    Fills in a st_plugin_vio_info structure, providing the information
    about the connection.
  */
  void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);

} MYSQL_PLUGIN_VIO;

#endif

mysql/client_plugin.h000064400000021746150400263600010724 0ustar00/* Copyright (C) 2010 - 2012 Sergei Golubchik and Monty Program Ab
                 2014, 2022 MariaDB Corporation AB

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not see <http://www.gnu.org/licenses>
   or write to the Free Software Foundation, Inc., 
   51 Franklin St., Fifth Floor, Boston, MA 02110, USA */

/**
  @file

  MySQL Client Plugin API

  This file defines the API for plugins that work on the client side
*/
#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
#define MYSQL_CLIENT_PLUGIN_INCLUDED

#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#include <stdlib.h>
#endif


#ifndef PLUGINDIR
#define PLUGINDIR "lib/plugin"
#endif

#define plugin_declarations_sym "_mysql_client_plugin_declaration_"

/* known plugin types */
#define MYSQL_CLIENT_PLUGIN_RESERVED         0 
#define MYSQL_CLIENT_PLUGIN_RESERVED2        1
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN   2 /* authentication   */

#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION  0x0100
#define MYSQL_CLIENT_MAX_PLUGINS             3

/* Connector/C specific plugin types */
#define MARIADB_CLIENT_REMOTEIO_PLUGIN       100 /* communication IO */
#define MARIADB_CLIENT_PVIO_PLUGIN           101
#define MARIADB_CLIENT_TRACE_PLUGIN          102
#define MARIADB_CLIENT_CONNECTION_PLUGIN     103
#define MARIADB_CLIENT_COMPRESSION_PLUGIN    104

#define MARIADB_CLIENT_REMOTEIO_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_PVIO_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_CONNECTION_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_COMPRESSION_PLUGIN_INTERFACE_VERSION 0x0100

#define MARIADB_CLIENT_MAX_PLUGINS             5

#define mysql_declare_client_plugin(X)          \
     struct st_mysql_client_plugin_ ## X        \
        _mysql_client_plugin_declaration_ = {   \
          MYSQL_CLIENT_ ## X ## _PLUGIN,        \
          MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
#define mysql_end_client_plugin             }

/* generic plugin header structure */
#ifndef MYSQL_CLIENT_PLUGIN_HEADER
#define MYSQL_CLIENT_PLUGIN_HEADER                      \
  int type;                                             \
  unsigned int interface_version;                       \
  const char *name;                                     \
  const char *author;                                   \
  const char *desc;                                     \
  unsigned int version[3];                              \
  const char *license;                                  \
  void *mysql_api;                                      \
  int (*init)(char *, size_t, int, va_list);            \
  int (*deinit)(void);                                  \
  int (*options)(const char *option, const void *);

struct st_mysql_client_plugin
{
  MYSQL_CLIENT_PLUGIN_HEADER
};
#endif

struct st_mysql;

/********* connection handler plugin specific declarations **********/

typedef struct st_ma_connection_plugin
{
  MYSQL_CLIENT_PLUGIN_HEADER
  /* functions */
  MYSQL *(*connect)(MYSQL *mysql, const char *host,
                    const char *user, const char *passwd,
		                const char *db, unsigned int port,
                    const char *unix_socket, unsigned long clientflag);
  void (*close)(MYSQL *mysql);
  int (*set_optionsv)(MYSQL *mysql, unsigned int option, ...);
  int (*set_connection)(MYSQL *mysql,enum enum_server_command command,
                        const char *arg,
                        size_t length, my_bool skipp_check, void *opt_arg);
  my_bool (*reconnect)(MYSQL *mysql);
  int (*reset)(MYSQL *mysql);
} MARIADB_CONNECTION_PLUGIN;

#define MARIADB_DB_DRIVER(a) ((a)->ext_db)

/*******************  Communication IO plugin *****************/
#include <ma_pvio.h>

typedef struct st_mariadb_client_plugin_PVIO
{
  MYSQL_CLIENT_PLUGIN_HEADER
  struct st_ma_pvio_methods *methods;
} MARIADB_PVIO_PLUGIN;

/******** authentication plugin specific declarations *********/
#include <mysql/plugin_auth.h>

struct st_mysql_client_plugin_AUTHENTICATION
{
  MYSQL_CLIENT_PLUGIN_HEADER
  int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
};

/******** trace plugin *******/
struct st_mysql_client_plugin_TRACE
{
  MYSQL_CLIENT_PLUGIN_HEADER
};

#include <ma_compress.h>

typedef struct st_mariadb_client_plugin_COMPRESS
{
  MYSQL_CLIENT_PLUGIN_HEADER
  ma_compress_ctx *(*init_ctx)(int compression_level);
  void (*free_ctx)(ma_compress_ctx *ctx);
  my_bool (*compress)(ma_compress_ctx *ctx, void *dst, size_t *dst_len, void *source, size_t source_len);
  my_bool (*decompress)(ma_compress_ctx *ctx, void *dst, size_t *dst_len, void *source, size_t *source_len);
} MARIADB_COMPRESSION_PLUGIN;

/**
  type of the mysql_authentication_dialog_ask function

  @param mysql          mysql
  @param type           type of the input
                        1 - ordinary string input
                        2 - password string
  @param prompt         prompt
  @param buf            a buffer to store the use input
  @param buf_len        the length of the buffer

  @retval               a pointer to the user input string.
                        It may be equal to 'buf' or to 'mysql->password'.
                        In all other cases it is assumed to be an allocated
                        string, and the "dialog" plugin will free() it.
*/
typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
                      int type, const char *prompt, char *buf, int buf_len);

/********************** remote IO plugin **********************/
#ifdef HAVE_REMOTEIO
#include <mariadb/ma_io.h>

/* Remote IO plugin */
typedef struct st_mysql_client_plugin_REMOTEIO
{
  MYSQL_CLIENT_PLUGIN_HEADER
  struct st_rio_methods *methods;
} MARIADB_REMOTEIO_PLUGIN;
#endif

/******** using plugins ************/

/**
  loads a plugin and initializes it

  @param mysql  MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
                and last_errno/last_error, for error reporting
  @param name   a name of the plugin to load
  @param type   type of plugin that should be loaded, -1 to disable type check
  @param argc   number of arguments to pass to the plugin initialization
                function
  @param ...    arguments for the plugin initialization function

  @retval
  a pointer to the loaded plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
                  int argc, ...);

/**
  loads a plugin and initializes it, taking va_list as an argument

  This is the same as mysql_load_plugin, but take va_list instead of
  a list of arguments.

  @param mysql  MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
                and last_errno/last_error, for error reporting
  @param name   a name of the plugin to load
  @param type   type of plugin that should be loaded, -1 to disable type check
  @param argc   number of arguments to pass to the plugin initialization
                function
  @param args   arguments for the plugin initialization function

  @retval
  a pointer to the loaded plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin * STDCALL
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
                    int argc, va_list args);

/**
  finds an already loaded plugin by name, or loads it, if necessary

  @param mysql  MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
                and last_errno/last_error, for error reporting
  @param name   a name of the plugin to load
  @param type   type of plugin that should be loaded

  @retval
  a pointer to the plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin * STDCALL
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);

/**
  adds a plugin structure to the list of loaded plugins

  This is useful if an application has the necessary functionality
  (for example, a special load data handler) statically linked into
  the application binary. It can use this function to register the plugin
  directly, avoiding the need to factor it out into a shared object.

  @param mysql  MYSQL structure. It is only used for error reporting
  @param plugin an st_mysql_client_plugin structure to register

  @retval
  a pointer to the plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin * STDCALL
mysql_client_register_plugin(struct st_mysql *mysql,
                             struct st_mysql_client_plugin *plugin);

extern struct st_mysql_client_plugin *mysql_client_builtins[];

#endif


server/my_cmp.h000064400000001622150400263600007504 0ustar00/* Copyright (c) 2024, 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 */

#pragma once

#ifdef __cplusplus
extern "C" {
#endif
typedef int (*qsort_cmp)(const void *, const void *);
typedef int (*qsort_cmp2)(void *param, const void *a, const void *b);
#ifdef __cplusplus
}
#endif
server/mysqld_ername.h000064400000371032150400263600011065 0ustar00/* Autogenerated file, please don't edit */

{ "ER_HASHCHK", 1000, "hashchk" },
{ "ER_NISAMCHK", 1001, "isamchk" },
{ "ER_NO", 1002, "NO" },
{ "ER_YES", 1003, "YES" },
{ "ER_CANT_CREATE_FILE", 1004, "Can\'t create file \'%-.200s\' (errno: %M)" },
{ "ER_CANT_CREATE_TABLE", 1005, "Can\'t create table %`s.%`s (errno: %M)" },
{ "ER_CANT_CREATE_DB", 1006, "Can\'t create database \'%-.192s\' (errno: %M)" },
{ "ER_DB_CREATE_EXISTS", 1007, "Can\'t create database \'%-.192s\'; database exists" },
{ "ER_DB_DROP_EXISTS", 1008, "Can\'t drop database \'%-.192s\'; database doesn\'t exist" },
{ "ER_DB_DROP_DELETE", 1009, "Error dropping database (can\'t delete \'%-.192s\', errno: %M)" },
{ "ER_DB_DROP_RMDIR", 1010, "Error dropping database (can\'t rmdir \'%-.192s\', errno: %M)" },
{ "ER_CANT_DELETE_FILE", 1011, "Error on delete of \'%-.192s\' (errno: %M)" },
{ "ER_CANT_FIND_SYSTEM_REC", 1012, "Can\'t read record in system table" },
{ "ER_CANT_GET_STAT", 1013, "Can\'t get status of \'%-.200s\' (errno: %M)" },
{ "ER_CANT_GET_WD", 1014, "Can\'t get working directory (errno: %M)" },
{ "ER_CANT_LOCK", 1015, "Can\'t lock file (errno: %M)" },
{ "ER_CANT_OPEN_FILE", 1016, "Can\'t open file: \'%-.200s\' (errno: %M)" },
{ "ER_FILE_NOT_FOUND", 1017, "Can\'t find file: \'%-.200s\' (errno: %M)" },
{ "ER_CANT_READ_DIR", 1018, "Can\'t read dir of \'%-.192s\' (errno: %M)" },
{ "ER_CANT_SET_WD", 1019, "Can\'t change dir to \'%-.192s\' (errno: %M)" },
{ "ER_CHECKREAD", 1020, "Record has changed since last read in table \'%-.192s\'" },
{ "ER_DISK_FULL", 1021, "Disk full (%s); waiting for someone to free some space... (errno: %M)" },
{ "ER_DUP_KEY", 1022, "Can\'t write; duplicate key in table \'%-.192s\'" },
{ "ER_ERROR_ON_CLOSE", 1023, "Error on close of \'%-.192s\' (errno: %M)" },
{ "ER_ERROR_ON_READ", 1024, "Error reading file \'%-.200s\' (errno: %M)" },
{ "ER_ERROR_ON_RENAME", 1025, "Error on rename of \'%-.210s\' to \'%-.210s\' (errno: %M)" },
{ "ER_ERROR_ON_WRITE", 1026, "Error writing file \'%-.200s\' (errno: %M)" },
{ "ER_FILE_USED", 1027, "\'%-.192s\' is locked against change" },
{ "ER_FILSORT_ABORT", 1028, "Sort aborted" },
{ "ER_FORM_NOT_FOUND", 1029, "View \'%-.192s\' doesn\'t exist for \'%-.192s\'" },
{ "ER_GET_ERRNO", 1030, "Got error %M from storage engine %s" },
{ "ER_ILLEGAL_HA", 1031, "Storage engine %s of the table %`s.%`s doesn\'t have this option" },
{ "ER_KEY_NOT_FOUND", 1032, "Can\'t find record in \'%-.192s\'" },
{ "ER_NOT_FORM_FILE", 1033, "Incorrect information in file: \'%-.200s\'" },
{ "ER_NOT_KEYFILE", 1034, "Index for table \'%-.200s\' is corrupt; try to repair it" },
{ "ER_OLD_KEYFILE", 1035, "Old key file for table \'%-.192s\'; repair it!" },
{ "ER_OPEN_AS_READONLY", 1036, "Table \'%-.192s\' is read only" },
{ "ER_OUTOFMEMORY", 1037, "Out of memory; restart server and try again (needed %d bytes)" },
{ "ER_OUT_OF_SORTMEMORY", 1038, "Out of sort memory, consider increasing server sort buffer size" },
{ "ER_UNEXPECTED_EOF", 1039, "Unexpected EOF found when reading file \'%-.192s\' (errno: %M)" },
{ "ER_CON_COUNT_ERROR", 1040, "Too many connections" },
{ "ER_OUT_OF_RESOURCES", 1041, "Out of memory." },
{ "ER_BAD_HOST_ERROR", 1042, "Can\'t get hostname for your address" },
{ "ER_HANDSHAKE_ERROR", 1043, "Bad handshake" },
{ "ER_DBACCESS_DENIED_ERROR", 1044, "Access denied for user \'%s\'@\'%s\' to database \'%-.192s\'" },
{ "ER_ACCESS_DENIED_ERROR", 1045, "Access denied for user \'%s\'@\'%s\' (using password: %s)" },
{ "ER_NO_DB_ERROR", 1046, "No database selected" },
{ "ER_UNKNOWN_COM_ERROR", 1047, "Unknown command" },
{ "ER_BAD_NULL_ERROR", 1048, "Column \'%-.192s\' cannot be null" },
{ "ER_BAD_DB_ERROR", 1049, "Unknown database \'%-.192s\'" },
{ "ER_TABLE_EXISTS_ERROR", 1050, "Table \'%-.192s\' already exists" },
{ "ER_BAD_TABLE_ERROR", 1051, "Unknown table \'%-.100T\'" },
{ "ER_NON_UNIQ_ERROR", 1052, "Column \'%-.192s\' in %-.192s is ambiguous" },
{ "ER_SERVER_SHUTDOWN", 1053, "Server shutdown in progress" },
{ "ER_BAD_FIELD_ERROR", 1054, "Unknown column \'%-.192s\' in \'%-.192s\'" },
{ "ER_WRONG_FIELD_WITH_GROUP", 1055, "\'%-.192s\' isn\'t in GROUP BY" },
{ "ER_WRONG_GROUP_FIELD", 1056, "Can\'t group on \'%-.192s\'" },
{ "ER_WRONG_SUM_SELECT", 1057, "Statement has sum functions and columns in same statement" },
{ "ER_WRONG_VALUE_COUNT", 1058, "Column count doesn\'t match value count" },
{ "ER_TOO_LONG_IDENT", 1059, "Identifier name \'%-.100T\' is too long" },
{ "ER_DUP_FIELDNAME", 1060, "Duplicate column name \'%-.192s\'" },
{ "ER_DUP_KEYNAME", 1061, "Duplicate key name \'%-.192s\'" },
{ "ER_DUP_ENTRY", 1062, "Duplicate entry \'%-.192T\' for key %d" },
{ "ER_WRONG_FIELD_SPEC", 1063, "Incorrect column specifier for column \'%-.192s\'" },
{ "ER_PARSE_ERROR", 1064, "%s near \'%-.80T\' at line %d" },
{ "ER_EMPTY_QUERY", 1065, "Query was empty" },
{ "ER_NONUNIQ_TABLE", 1066, "Not unique table/alias: \'%-.192s\'" },
{ "ER_INVALID_DEFAULT", 1067, "Invalid default value for \'%-.192s\'" },
{ "ER_MULTIPLE_PRI_KEY", 1068, "Multiple primary key defined" },
{ "ER_TOO_MANY_KEYS", 1069, "Too many keys specified; max %d keys allowed" },
{ "ER_TOO_MANY_KEY_PARTS", 1070, "Too many key parts specified; max %d parts allowed" },
{ "ER_TOO_LONG_KEY", 1071, "Specified key was too long; max key length is %d bytes" },
{ "ER_KEY_COLUMN_DOES_NOT_EXITS", 1072, "Key column \'%-.192s\' doesn\'t exist in table" },
{ "ER_BLOB_USED_AS_KEY", 1073, "BLOB column %`s can\'t be used in key specification in the %s table" },
{ "ER_TOO_BIG_FIELDLENGTH", 1074, "Column length too big for column \'%-.192s\' (max = %lu); use BLOB or TEXT instead" },
{ "ER_WRONG_AUTO_KEY", 1075, "Incorrect table definition; there can be only one auto column and it must be defined as a key" },
{ "ER_BINLOG_CANT_DELETE_GTID_DOMAIN", 1076, "Could not delete gtid domain. Reason: %s." },
{ "ER_NORMAL_SHUTDOWN", 1077, "%s (initiated by: %s): Normal shutdown" },
{ "ER_GOT_SIGNAL", 1078, "%s: Got signal %d. Aborting!" },
{ "ER_SHUTDOWN_COMPLETE", 1079, "%s: Shutdown complete" },
{ "ER_FORCING_CLOSE", 1080, "%s: Forcing close of thread %ld  user: \'%-.48s\'" },
{ "ER_IPSOCK_ERROR", 1081, "Can\'t create IP socket" },
{ "ER_NO_SUCH_INDEX", 1082, "Table \'%-.192s\' has no index like the one used in CREATE INDEX; recreate the table" },
{ "ER_WRONG_FIELD_TERMINATORS", 1083, "Field separator argument is not what is expected; check the manual" },
{ "ER_BLOBS_AND_NO_TERMINATED", 1084, "You can\'t use fixed rowlength with BLOBs; please use \'fields terminated by\'" },
{ "ER_TEXTFILE_NOT_READABLE", 1085, "The file \'%-.128s\' must be in the database directory or be readable by all" },
{ "ER_FILE_EXISTS_ERROR", 1086, "File \'%-.200s\' already exists" },
{ "ER_LOAD_INFO", 1087, "Records: %ld  Deleted: %ld  Skipped: %ld  Warnings: %ld" },
{ "ER_ALTER_INFO", 1088, "Records: %ld  Duplicates: %ld" },
{ "ER_WRONG_SUB_KEY", 1089, "Incorrect prefix key; the used key part isn\'t a string, the used length is longer than the key part, or the storage engine doesn\'t support unique prefix keys" },
{ "ER_CANT_REMOVE_ALL_FIELDS", 1090, "You can\'t delete all columns with ALTER TABLE; use DROP TABLE instead" },
{ "ER_CANT_DROP_FIELD_OR_KEY", 1091, "Can\'t DROP %s %`-.192s; check that it exists" },
{ "ER_INSERT_INFO", 1092, "Records: %ld  Duplicates: %ld  Warnings: %ld" },
{ "ER_UPDATE_TABLE_USED", 1093, "Table \'%-.192s\' is specified twice, both as a target for \'%s\' and as a separate source for data" },
{ "ER_NO_SUCH_THREAD", 1094, "Unknown thread id: %lu" },
{ "ER_KILL_DENIED_ERROR", 1095, "You are not owner of thread %lld" },
{ "ER_NO_TABLES_USED", 1096, "No tables used" },
{ "ER_TOO_BIG_SET", 1097, "Too many strings for column %-.192s and SET" },
{ "ER_NO_UNIQUE_LOGFILE", 1098, "Can\'t generate a unique log-filename %-.200s.(1-999)" },
{ "ER_TABLE_NOT_LOCKED_FOR_WRITE", 1099, "Table \'%-.192s\' was locked with a READ lock and can\'t be updated" },
{ "ER_TABLE_NOT_LOCKED", 1100, "Table \'%-.192s\' was not locked with LOCK TABLES" },
{ "ER_UNUSED_17", 1101, "You should never see it" },
{ "ER_WRONG_DB_NAME", 1102, "Incorrect database name \'%-.100T\'" },
{ "ER_WRONG_TABLE_NAME", 1103, "Incorrect table name \'%-.100s\'" },
{ "ER_TOO_BIG_SELECT", 1104, "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay" },
{ "ER_UNKNOWN_ERROR", 1105, "Unknown error" },
{ "ER_UNKNOWN_PROCEDURE", 1106, "Unknown procedure \'%-.192s\'" },
{ "ER_WRONG_PARAMCOUNT_TO_PROCEDURE", 1107, "Incorrect parameter count to procedure \'%-.192s\'" },
{ "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108, "Incorrect parameters to procedure \'%-.192s\'" },
{ "ER_UNKNOWN_TABLE", 1109, "Unknown table \'%-.192s\' in %-.32s" },
{ "ER_FIELD_SPECIFIED_TWICE", 1110, "Column \'%-.192s\' specified twice" },
{ "ER_INVALID_GROUP_FUNC_USE", 1111, "Invalid use of group function" },
{ "ER_UNSUPPORTED_EXTENSION", 1112, "Table \'%-.192s\' uses an extension that doesn\'t exist in this MariaDB version" },
{ "ER_TABLE_MUST_HAVE_COLUMNS", 1113, "A table must have at least 1 column" },
{ "ER_RECORD_FILE_FULL", 1114, "The table \'%-.192s\' is full" },
{ "ER_UNKNOWN_CHARACTER_SET", 1115, "Unknown character set: \'%-.64s\'" },
{ "ER_TOO_MANY_TABLES", 1116, "Too many tables; MariaDB can only use %d tables in a join" },
{ "ER_TOO_MANY_FIELDS", 1117, "Too many columns" },
{ "ER_TOO_BIG_ROWSIZE", 1118, "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs" },
{ "ER_STACK_OVERRUN", 1119, "Thread stack overrun:  Used: %ld of a %ld stack.  Use \'mariadbd --thread_stack=#\' to specify a bigger stack if needed" },
{ "ER_WRONG_OUTER_JOIN", 1120, "Cross dependency found in OUTER JOIN; examine your ON conditions" },
{ "ER_NULL_COLUMN_IN_INDEX", 1121, "Table handler doesn\'t support NULL in given index. Please change column \'%-.192s\' to be NOT NULL or use another handler" },
{ "ER_CANT_FIND_UDF", 1122, "Can\'t load function \'%-.192s\'" },
{ "ER_CANT_INITIALIZE_UDF", 1123, "Can\'t initialize function \'%-.192s\'; %-.80s" },
{ "ER_UDF_NO_PATHS", 1124, "No paths allowed for shared library" },
{ "ER_UDF_EXISTS", 1125, "Function \'%-.192s\' already exists" },
{ "ER_CANT_OPEN_LIBRARY", 1126, "Can\'t open shared library \'%-.192s\' (errno: %d, %-.128s)" },
{ "ER_CANT_FIND_DL_ENTRY", 1127, "Can\'t find symbol \'%-.128s\' in library" },
{ "ER_FUNCTION_NOT_DEFINED", 1128, "Function \'%-.192s\' is not defined" },
{ "ER_HOST_IS_BLOCKED", 1129, "Host \'%-.64s\' is blocked because of many connection errors; unblock with \'mariadb-admin flush-hosts\'" },
{ "ER_HOST_NOT_PRIVILEGED", 1130, "Host \'%-.64s\' is not allowed to connect to this MariaDB server" },
{ "ER_PASSWORD_ANONYMOUS_USER", 1131, "You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings" },
{ "ER_PASSWORD_NOT_ALLOWED", 1132, "You must have privileges to update tables in the mysql database to be able to change passwords for others" },
{ "ER_PASSWORD_NO_MATCH", 1133, "Can\'t find any matching row in the user table" },
{ "ER_UPDATE_INFO", 1134, "Rows matched: %ld  Changed: %ld  Warnings: %ld" },
{ "ER_CANT_CREATE_THREAD", 1135, "Can\'t create a new thread (errno %M); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug" },
{ "ER_WRONG_VALUE_COUNT_ON_ROW", 1136, "Column count doesn\'t match value count at row %lu" },
{ "ER_CANT_REOPEN_TABLE", 1137, "Can\'t reopen table: \'%-.192s\'" },
{ "ER_INVALID_USE_OF_NULL", 1138, "Invalid use of NULL value" },
{ "ER_REGEXP_ERROR", 1139, "Regex error \'%s\'" },
{ "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140, "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause" },
{ "ER_NONEXISTING_GRANT", 1141, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\'" },
{ "ER_TABLEACCESS_DENIED_ERROR", 1142, "%-.100T command denied to user \'%s\'@\'%s\' for table %`s.%`s" },
{ "ER_COLUMNACCESS_DENIED_ERROR", 1143, "%-.32s command denied to user \'%s\'@\'%s\' for column \'%-.192s\' in table \'%-.192s\'" },
{ "ER_ILLEGAL_GRANT_FOR_TABLE", 1144, "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used" },
{ "ER_GRANT_WRONG_HOST_OR_USER", 1145, "The host or user argument to GRANT is too long" },
{ "ER_NO_SUCH_TABLE", 1146, "Table \'%-.192s.%-.192s\' doesn\'t exist" },
{ "ER_NONEXISTING_TABLE_GRANT", 1147, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\' on table \'%-.192s\'" },
{ "ER_NOT_ALLOWED_COMMAND", 1148, "The used command is not allowed with this MariaDB version" },
{ "ER_SYNTAX_ERROR", 1149, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use" },
{ "ER_DELAYED_CANT_CHANGE_LOCK", 1150, "Delayed insert thread couldn\'t get requested lock for table %-.192s" },
{ "ER_TOO_MANY_DELAYED_THREADS", 1151, "Too many delayed threads in use" },
{ "ER_ABORTING_CONNECTION", 1152, "Aborted connection %ld to db: \'%-.192s\' user: \'%-.48s\' (%-.64s)" },
{ "ER_NET_PACKET_TOO_LARGE", 1153, "Got a packet bigger than \'max_allowed_packet\' bytes" },
{ "ER_NET_READ_ERROR_FROM_PIPE", 1154, "Got a read error from the connection pipe" },
{ "ER_NET_FCNTL_ERROR", 1155, "Got an error from fcntl()" },
{ "ER_NET_PACKETS_OUT_OF_ORDER", 1156, "Got packets out of order" },
{ "ER_NET_UNCOMPRESS_ERROR", 1157, "Couldn\'t uncompress communication packet" },
{ "ER_NET_READ_ERROR", 1158, "Got an error reading communication packets" },
{ "ER_NET_READ_INTERRUPTED", 1159, "Got timeout reading communication packets" },
{ "ER_NET_ERROR_ON_WRITE", 1160, "Got an error writing communication packets" },
{ "ER_NET_WRITE_INTERRUPTED", 1161, "Got timeout writing communication packets" },
{ "ER_TOO_LONG_STRING", 1162, "Result string is longer than \'max_allowed_packet\' bytes" },
{ "ER_TABLE_CANT_HANDLE_BLOB", 1163, "Storage engine %s doesn\'t support BLOB/TEXT columns" },
{ "ER_TABLE_CANT_HANDLE_AUTO_INCREMENT", 1164, "Storage engine %s doesn\'t support AUTO_INCREMENT columns" },
{ "ER_DELAYED_INSERT_TABLE_LOCKED", 1165, "INSERT DELAYED can\'t be used with table \'%-.192s\' because it is locked with LOCK TABLES" },
{ "ER_WRONG_COLUMN_NAME", 1166, "Incorrect column name \'%-.100s\'" },
{ "ER_WRONG_KEY_COLUMN", 1167, "The storage engine %s can\'t index column %`s" },
{ "ER_WRONG_MRG_TABLE", 1168, "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn\'t exist" },
{ "ER_DUP_UNIQUE", 1169, "Can\'t write, because of unique constraint, to table \'%-.192s\'" },
{ "ER_BLOB_KEY_WITHOUT_LENGTH", 1170, "BLOB/TEXT column \'%-.192s\' used in key specification without a key length" },
{ "ER_PRIMARY_CANT_HAVE_NULL", 1171, "All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead" },
{ "ER_TOO_MANY_ROWS", 1172, "Result consisted of more than one row" },
{ "ER_REQUIRES_PRIMARY_KEY", 1173, "This table type requires a primary key" },
{ "ER_NO_RAID_COMPILED", 1174, "This version of MariaDB is not compiled with RAID support" },
{ "ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE", 1175, "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column" },
{ "ER_KEY_DOES_NOT_EXISTS", 1176, "Key \'%-.192s\' doesn\'t exist in table \'%-.192s\'" },
{ "ER_CHECK_NO_SUCH_TABLE", 1177, "Can\'t open table" },
{ "ER_CHECK_NOT_IMPLEMENTED", 1178, "The storage engine for the table doesn\'t support %s" },
{ "ER_CANT_DO_THIS_DURING_AN_TRANSACTION", 1179, "You are not allowed to execute this command in a transaction" },
{ "ER_ERROR_DURING_COMMIT", 1180, "Got error %M during COMMIT" },
{ "ER_ERROR_DURING_ROLLBACK", 1181, "Got error %M during ROLLBACK" },
{ "ER_ERROR_DURING_FLUSH_LOGS", 1182, "Got error %M during FLUSH_LOGS" },
{ "ER_ERROR_DURING_CHECKPOINT", 1183, "Got error %M during CHECKPOINT" },
{ "ER_NEW_ABORTING_CONNECTION", 1184, "Aborted connection %lld to db: \'%-.192s\' user: \'%-.48s\' host: \'%-.64s\'%-.64s (%-.64s)" },
{ "ER_UNUSED_10", 1185, "You should never see it" },
{ "ER_FLUSH_MASTER_BINLOG_CLOSED", 1186, "Binlog closed, cannot RESET MASTER" },
{ "ER_INDEX_REBUILD", 1187, "Failed rebuilding the index of  dumped table \'%-.192s\'" },
{ "ER_MASTER", 1188, "Error from master: \'%-.64s\'" },
{ "ER_MASTER_NET_READ", 1189, "Net error reading from master" },
{ "ER_MASTER_NET_WRITE", 1190, "Net error writing to master" },
{ "ER_FT_MATCHING_KEY_NOT_FOUND", 1191, "Can\'t find FULLTEXT index matching the column list" },
{ "ER_LOCK_OR_ACTIVE_TRANSACTION", 1192, "Can\'t execute the given command because you have active locked tables or an active transaction" },
{ "ER_UNKNOWN_SYSTEM_VARIABLE", 1193, "Unknown system variable \'%-.*s\'" },
{ "ER_CRASHED_ON_USAGE", 1194, "Table \'%-.192s\' is marked as crashed and should be repaired" },
{ "ER_CRASHED_ON_REPAIR", 1195, "Table \'%-.192s\' is marked as crashed and last (automatic?) repair failed" },
{ "ER_WARNING_NOT_COMPLETE_ROLLBACK", 1196, "Some non-transactional changed tables couldn\'t be rolled back" },
{ "ER_TRANS_CACHE_FULL", 1197, "Multi-statement transaction required more than \'max_binlog_cache_size\' bytes of storage; increase this mariadbd variable and try again" },
{ "ER_SLAVE_MUST_STOP", 1198, "This operation cannot be performed as you have a running slave \'%2$*1$s\'; run STOP SLAVE \'%2$*1$s\' first" },
{ "ER_SLAVE_NOT_RUNNING", 1199, "This operation requires a running slave; configure slave and do START SLAVE" },
{ "ER_BAD_SLAVE", 1200, "The server is not configured as slave; fix in config file or with CHANGE MASTER TO" },
{ "ER_MASTER_INFO", 1201, "Could not initialize master info structure for \'%.*s\'; more error messages can be found in the MariaDB error log" },
{ "ER_SLAVE_THREAD", 1202, "Could not create slave thread; check system resources" },
{ "ER_TOO_MANY_USER_CONNECTIONS", 1203, "User %-.64s already has more than \'max_user_connections\' active connections" },
{ "ER_SET_CONSTANTS_ONLY", 1204, "You may only use constant expressions in this statement" },
{ "ER_LOCK_WAIT_TIMEOUT", 1205, "Lock wait timeout exceeded; try restarting transaction" },
{ "ER_LOCK_TABLE_FULL", 1206, "The total number of locks exceeds the lock table size" },
{ "ER_READ_ONLY_TRANSACTION", 1207, "Update locks cannot be acquired during a READ UNCOMMITTED transaction" },
{ "ER_DROP_DB_WITH_READ_LOCK", 1208, "DROP DATABASE not allowed while thread is holding global read lock" },
{ "ER_CREATE_DB_WITH_READ_LOCK", 1209, "CREATE DATABASE not allowed while thread is holding global read lock" },
{ "ER_WRONG_ARGUMENTS", 1210, "Incorrect arguments to %s" },
{ "ER_NO_PERMISSION_TO_CREATE_USER", 1211, "\'%s\'@\'%s\' is not allowed to create new users" },
{ "ER_UNION_TABLES_IN_DIFFERENT_DIR", 1212, "Incorrect table definition; all MERGE tables must be in the same database" },
{ "ER_LOCK_DEADLOCK", 1213, "Deadlock found when trying to get lock; try restarting transaction" },
{ "ER_TABLE_CANT_HANDLE_FT", 1214, "The storage engine %s doesn\'t support FULLTEXT indexes" },
{ "ER_CANNOT_ADD_FOREIGN", 1215, "Cannot add foreign key constraint for `%s`" },
{ "ER_NO_REFERENCED_ROW", 1216, "Cannot add or update a child row: a foreign key constraint fails" },
{ "ER_ROW_IS_REFERENCED", 1217, "Cannot delete or update a parent row: a foreign key constraint fails" },
{ "ER_CONNECT_TO_MASTER", 1218, "Error connecting to master: %-.128s" },
{ "ER_QUERY_ON_MASTER", 1219, "Error running query on master: %-.128s" },
{ "ER_ERROR_WHEN_EXECUTING_COMMAND", 1220, "Error when executing command %s: %-.128s" },
{ "ER_WRONG_USAGE", 1221, "Incorrect usage of %s and %s" },
{ "ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT", 1222, "The used SELECT statements have a different number of columns" },
{ "ER_CANT_UPDATE_WITH_READLOCK", 1223, "Can\'t execute the query because you have a conflicting read lock" },
{ "ER_MIXING_NOT_ALLOWED", 1224, "Mixing of transactional and non-transactional tables is disabled" },
{ "ER_DUP_ARGUMENT", 1225, "Option \'%s\' used twice in statement" },
{ "ER_USER_LIMIT_REACHED", 1226, "User \'%-.64s\' has exceeded the \'%s\' resource (current value: %ld)" },
{ "ER_SPECIFIC_ACCESS_DENIED_ERROR", 1227, "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation" },
{ "ER_LOCAL_VARIABLE", 1228, "Variable \'%-.64s\' is a SESSION variable and can\'t be used with SET GLOBAL" },
{ "ER_GLOBAL_VARIABLE", 1229, "Variable \'%-.64s\' is a GLOBAL variable and should be set with SET GLOBAL" },
{ "ER_NO_DEFAULT", 1230, "Variable \'%-.64s\' doesn\'t have a default value" },
{ "ER_WRONG_VALUE_FOR_VAR", 1231, "Variable \'%-.64s\' can\'t be set to the value of \'%-.200T\'" },
{ "ER_WRONG_TYPE_FOR_VAR", 1232, "Incorrect argument type to variable \'%-.64s\'" },
{ "ER_VAR_CANT_BE_READ", 1233, "Variable \'%-.64s\' can only be set, not read" },
{ "ER_CANT_USE_OPTION_HERE", 1234, "Incorrect usage/placement of \'%s\'" },
{ "ER_NOT_SUPPORTED_YET", 1235, "This version of MariaDB doesn\'t yet support \'%s\'" },
{ "ER_MASTER_FATAL_ERROR_READING_BINLOG", 1236, "Got fatal error %d from master when reading data from binary log: \'%-.320s\'" },
{ "ER_SLAVE_IGNORED_TABLE", 1237, "Slave SQL thread ignored the query because of replicate-*-table rules" },
{ "ER_INCORRECT_GLOBAL_LOCAL_VAR", 1238, "Variable \'%-.192s\' is a %s variable" },
{ "ER_WRONG_FK_DEF", 1239, "Incorrect foreign key definition for \'%-.192s\': %s" },
{ "ER_KEY_REF_DO_NOT_MATCH_TABLE_REF", 1240, "Key reference and table reference don\'t match" },
{ "ER_OPERAND_COLUMNS", 1241, "Operand should contain %d column(s)" },
{ "ER_SUBQUERY_NO_1_ROW", 1242, "Subquery returns more than 1 row" },
{ "ER_UNKNOWN_STMT_HANDLER", 1243, "Unknown prepared statement handler (%.*s) given to %s" },
{ "ER_CORRUPT_HELP_DB", 1244, "Help database is corrupt or does not exist" },
{ "ER_CYCLIC_REFERENCE", 1245, "Cyclic reference on subqueries" },
{ "ER_AUTO_CONVERT", 1246, "Converting column \'%s\' from %s to %s" },
{ "ER_ILLEGAL_REFERENCE", 1247, "Reference \'%-.64s\' not supported (%s)" },
{ "ER_DERIVED_MUST_HAVE_ALIAS", 1248, "Every derived table must have its own alias" },
{ "ER_SELECT_REDUCED", 1249, "Select %u was reduced during optimization" },
{ "ER_TABLENAME_NOT_ALLOWED_HERE", 1250, "Table \'%-.192s\' from one of the SELECTs cannot be used in %-.32s" },
{ "ER_NOT_SUPPORTED_AUTH_MODE", 1251, "Client does not support authentication protocol requested by server; consider upgrading MariaDB client" },
{ "ER_SPATIAL_CANT_HAVE_NULL", 1252, "All parts of a SPATIAL index must be NOT NULL" },
{ "ER_COLLATION_CHARSET_MISMATCH", 1253, "COLLATION \'%s\' is not valid for CHARACTER SET \'%s\'" },
{ "ER_SLAVE_WAS_RUNNING", 1254, "Slave is already running" },
{ "ER_SLAVE_WAS_NOT_RUNNING", 1255, "Slave already has been stopped" },
{ "ER_TOO_BIG_FOR_UNCOMPRESS", 1256, "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)" },
{ "ER_ZLIB_Z_MEM_ERROR", 1257, "ZLIB: Not enough memory" },
{ "ER_ZLIB_Z_BUF_ERROR", 1258, "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)" },
{ "ER_ZLIB_Z_DATA_ERROR", 1259, "ZLIB: Input data corrupted" },
{ "ER_CUT_VALUE_GROUP_CONCAT", 1260, "Row %u was cut by %s)" },
{ "ER_WARN_TOO_FEW_RECORDS", 1261, "Row %lu doesn\'t contain data for all columns" },
{ "ER_WARN_TOO_MANY_RECORDS", 1262, "Row %lu was truncated; it contained more data than there were input columns" },
{ "ER_WARN_NULL_TO_NOTNULL", 1263, "Column set to default value; NULL supplied to NOT NULL column \'%s\' at row %lu" },
{ "ER_WARN_DATA_OUT_OF_RANGE", 1264, "Out of range value for column \'%s\' at row %lu" },
{ "WARN_DATA_TRUNCATED", 1265, "Data truncated for column \'%s\' at row %lu" },
{ "ER_WARN_USING_OTHER_HANDLER", 1266, "Using storage engine %s for table \'%s\'" },
{ "ER_CANT_AGGREGATE_2COLLATIONS", 1267, "Illegal mix of collations (%s,%s) and (%s,%s) for operation \'%s\'" },
{ "ER_DROP_USER", 1268, "Cannot drop one or more of the requested users" },
{ "ER_REVOKE_GRANTS", 1269, "Can\'t revoke all privileges for one or more of the requested users" },
{ "ER_CANT_AGGREGATE_3COLLATIONS", 1270, "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation \'%s\'" },
{ "ER_CANT_AGGREGATE_NCOLLATIONS", 1271, "Illegal mix of collations for operation \'%s\'" },
{ "ER_VARIABLE_IS_NOT_STRUCT", 1272, "Variable \'%-.64s\' is not a variable component (can\'t be used as XXXX.variable_name)" },
{ "ER_UNKNOWN_COLLATION", 1273, "Unknown collation: \'%-.64s\'" },
{ "ER_SLAVE_IGNORED_SSL_PARAMS", 1274, "SSL parameters in CHANGE MASTER are ignored because this MariaDB slave was compiled without SSL support; they can be used later if MariaDB slave with SSL is started" },
{ "ER_SERVER_IS_IN_SECURE_AUTH_MODE", 1275, "Server is running in --secure-auth mode, but \'%s\'@\'%s\' has a password in the old format; please change the password to the new format" },
{ "ER_WARN_FIELD_RESOLVED", 1276, "Field or reference \'%-.192s%s%-.192s%s%-.192s\' of SELECT #%d was resolved in SELECT #%d" },
{ "ER_BAD_SLAVE_UNTIL_COND", 1277, "Incorrect parameter or combination of parameters for START SLAVE UNTIL" },
{ "ER_MISSING_SKIP_SLAVE", 1278, "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave\'s mariadbd restart" },
{ "ER_UNTIL_COND_IGNORED", 1279, "SQL thread is not to be started so UNTIL options are ignored" },
{ "ER_WRONG_NAME_FOR_INDEX", 1280, "Incorrect index name \'%-.100s\'" },
{ "ER_WRONG_NAME_FOR_CATALOG", 1281, "Incorrect catalog name \'%-.100s\'" },
{ "ER_WARN_QC_RESIZE", 1282, "Query cache failed to set size %llu; new query cache size is %lu" },
{ "ER_BAD_FT_COLUMN", 1283, "Column \'%-.192s\' cannot be part of FULLTEXT index" },
{ "ER_UNKNOWN_KEY_CACHE", 1284, "Unknown key cache \'%-.100s\'" },
{ "ER_WARN_HOSTNAME_WONT_WORK", 1285, "MariaDB is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work" },
{ "ER_UNKNOWN_STORAGE_ENGINE", 1286, "Unknown storage engine \'%s\'" },
{ "ER_WARN_DEPRECATED_SYNTAX", 1287, "\'%s\' is deprecated and will be removed in a future release. Please use %s instead" },
{ "ER_NON_UPDATABLE_TABLE", 1288, "The target table %-.100s of the %s is not updatable" },
{ "ER_FEATURE_DISABLED", 1289, "The \'%s\' feature is disabled; you need MariaDB built with \'%s\' to have it working" },
{ "ER_OPTION_PREVENTS_STATEMENT", 1290, "The MariaDB server is running with the %s option so it cannot execute this statement" },
{ "ER_DUPLICATED_VALUE_IN_TYPE", 1291, "Column \'%-.100s\' has duplicated value \'%-.64s\' in %s" },
{ "ER_TRUNCATED_WRONG_VALUE", 1292, "Truncated incorrect %-.32T value: \'%-.128T\'" },
{ "ER_TOO_MUCH_AUTO_TIMESTAMP_COLS", 1293, "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" },
{ "ER_INVALID_ON_UPDATE", 1294, "Invalid ON UPDATE clause for \'%-.192s\' column" },
{ "ER_UNSUPPORTED_PS", 1295, "This command is not supported in the prepared statement protocol yet" },
{ "ER_GET_ERRMSG", 1296, "Got error %d \'%-.200s\' from %s" },
{ "ER_GET_TEMPORARY_ERRMSG", 1297, "Got temporary error %d \'%-.200s\' from %s" },
{ "ER_UNKNOWN_TIME_ZONE", 1298, "Unknown or incorrect time zone: \'%-.64s\'" },
{ "ER_WARN_INVALID_TIMESTAMP", 1299, "Invalid TIMESTAMP value in column \'%s\' at row %lu" },
{ "ER_INVALID_CHARACTER_STRING", 1300, "Invalid %s character string: \'%.64T\'" },
{ "ER_WARN_ALLOWED_PACKET_OVERFLOWED", 1301, "Result of %s() was larger than max_allowed_packet (%ld) - truncated" },
{ "ER_CONFLICTING_DECLARATIONS", 1302, "Conflicting declarations: \'%s%s\' and \'%s%s\'" },
{ "ER_SP_NO_RECURSIVE_CREATE", 1303, "Can\'t create a %s from within another stored routine" },
{ "ER_SP_ALREADY_EXISTS", 1304, "%s %s already exists" },
{ "ER_SP_DOES_NOT_EXIST", 1305, "%s %s does not exist" },
{ "ER_SP_DROP_FAILED", 1306, "Failed to DROP %s %s" },
{ "ER_SP_STORE_FAILED", 1307, "Failed to CREATE %s %s" },
{ "ER_SP_LILABEL_MISMATCH", 1308, "%s with no matching label: %s" },
{ "ER_SP_LABEL_REDEFINE", 1309, "Redefining label %s" },
{ "ER_SP_LABEL_MISMATCH", 1310, "End-label %s without match" },
{ "ER_SP_UNINIT_VAR", 1311, "Referring to uninitialized variable %s" },
{ "ER_SP_BADSELECT", 1312, "PROCEDURE %s can\'t return a result set in the given context" },
{ "ER_SP_BADRETURN", 1313, "RETURN is only allowed in a FUNCTION" },
{ "ER_SP_BADSTATEMENT", 1314, "%s is not allowed in stored procedures" },
{ "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315, "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MariaDB 5.6" },
{ "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316, "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MariaDB 5.6" },
{ "ER_QUERY_INTERRUPTED", 1317, "Query execution was interrupted" },
{ "ER_SP_WRONG_NO_OF_ARGS", 1318, "Incorrect number of arguments for %s %s; expected %u, got %u" },
{ "ER_SP_COND_MISMATCH", 1319, "Undefined CONDITION: %s" },
{ "ER_SP_NORETURN", 1320, "No RETURN found in FUNCTION %s" },
{ "ER_SP_NORETURNEND", 1321, "FUNCTION %s ended without RETURN" },
{ "ER_SP_BAD_CURSOR_QUERY", 1322, "Cursor statement must be a SELECT" },
{ "ER_SP_BAD_CURSOR_SELECT", 1323, "Cursor SELECT must not have INTO" },
{ "ER_SP_CURSOR_MISMATCH", 1324, "Undefined CURSOR: %s" },
{ "ER_SP_CURSOR_ALREADY_OPEN", 1325, "Cursor is already open" },
{ "ER_SP_CURSOR_NOT_OPEN", 1326, "Cursor is not open" },
{ "ER_SP_UNDECLARED_VAR", 1327, "Undeclared variable: %s" },
{ "ER_SP_WRONG_NO_OF_FETCH_ARGS", 1328, "Incorrect number of FETCH variables" },
{ "ER_SP_FETCH_NO_DATA", 1329, "No data - zero rows fetched, selected, or processed" },
{ "ER_SP_DUP_PARAM", 1330, "Duplicate parameter: %s" },
{ "ER_SP_DUP_VAR", 1331, "Duplicate variable: %s" },
{ "ER_SP_DUP_COND", 1332, "Duplicate condition: %s" },
{ "ER_SP_DUP_CURS", 1333, "Duplicate cursor: %s" },
{ "ER_SP_CANT_ALTER", 1334, "Failed to ALTER %s %s" },
{ "ER_SP_SUBSELECT_NYI", 1335, "Subquery value not supported" },
{ "ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG", 1336, "%s is not allowed in stored function or trigger" },
{ "ER_SP_VARCOND_AFTER_CURSHNDLR", 1337, "Variable or condition declaration after cursor or handler declaration" },
{ "ER_SP_CURSOR_AFTER_HANDLER", 1338, "Cursor declaration after handler declaration" },
{ "ER_SP_CASE_NOT_FOUND", 1339, "Case not found for CASE statement" },
{ "ER_FPARSER_TOO_BIG_FILE", 1340, "Configuration file \'%-.192s\' is too big" },
{ "ER_FPARSER_BAD_HEADER", 1341, "Malformed file type header in file \'%-.192s\'" },
{ "ER_FPARSER_EOF_IN_COMMENT", 1342, "Unexpected end of file while parsing comment \'%-.200s\'" },
{ "ER_FPARSER_ERROR_IN_PARAMETER", 1343, "Error while parsing parameter \'%-.192s\' (line: \'%-.192s\')" },
{ "ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER", 1344, "Unexpected end of file while skipping unknown parameter \'%-.192s\'" },
{ "ER_VIEW_NO_EXPLAIN", 1345, "ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table" },
{ "ER_FRM_UNKNOWN_TYPE", 1346, "File \'%-.192s\' has unknown type \'%-.64s\' in its header" },
{ "ER_WRONG_OBJECT", 1347, "\'%-.192s.%-.192s\' is not of type \'%s\'" },
{ "ER_NONUPDATEABLE_COLUMN", 1348, "Column \'%-.192s\' is not updatable" },
{ "ER_VIEW_SELECT_DERIVED", 1349, "View\'s SELECT contains a subquery in the FROM clause" },
{ "ER_VIEW_SELECT_CLAUSE", 1350, "View\'s SELECT contains a \'%s\' clause" },
{ "ER_VIEW_SELECT_VARIABLE", 1351, "View\'s SELECT contains a variable or parameter" },
{ "ER_VIEW_SELECT_TMPTABLE", 1352, "View\'s SELECT refers to a temporary table \'%-.192s\'" },
{ "ER_VIEW_WRONG_LIST", 1353, "View\'s SELECT and view\'s field list have different column counts" },
{ "ER_WARN_VIEW_MERGE", 1354, "View merge algorithm can\'t be used here for now (assumed undefined algorithm)" },
{ "ER_WARN_VIEW_WITHOUT_KEY", 1355, "View being updated does not have complete key of underlying table in it" },
{ "ER_VIEW_INVALID", 1356, "View \'%-.192s.%-.192s\' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" },
{ "ER_SP_NO_DROP_SP", 1357, "Can\'t drop or alter a %s from within another stored routine" },
{ "ER_SP_GOTO_IN_HNDLR", 1358, "GOTO is not allowed in a stored procedure handler" },
{ "ER_TRG_ALREADY_EXISTS", 1359, "Trigger \'%s\' already exists" },
{ "ER_TRG_DOES_NOT_EXIST", 1360, "Trigger does not exist" },
{ "ER_TRG_ON_VIEW_OR_TEMP_TABLE", 1361, "Trigger\'s \'%-.192s\' is a view, temporary table or sequence" },
{ "ER_TRG_CANT_CHANGE_ROW", 1362, "Updating of %s row is not allowed in %strigger" },
{ "ER_TRG_NO_SUCH_ROW_IN_TRG", 1363, "There is no %s row in %s trigger" },
{ "ER_NO_DEFAULT_FOR_FIELD", 1364, "Field \'%-.192s\' doesn\'t have a default value" },
{ "ER_DIVISION_BY_ZERO", 1365, "Division by 0" },
{ "ER_TRUNCATED_WRONG_VALUE_FOR_FIELD", 1366, "Incorrect %-.32s value: \'%-.128T\' for column `%.192s`.`%.192s`.`%.192s` at row %lu" },
{ "ER_ILLEGAL_VALUE_FOR_TYPE", 1367, "Illegal %s \'%-.192T\' value found during parsing" },
{ "ER_VIEW_NONUPD_CHECK", 1368, "CHECK OPTION on non-updatable view %`-.192s.%`-.192s" },
{ "ER_VIEW_CHECK_FAILED", 1369, "CHECK OPTION failed %`-.192s.%`-.192s" },
{ "ER_PROCACCESS_DENIED_ERROR", 1370, "%-.32s command denied to user \'%s\'@\'%s\' for routine \'%-.192s\'" },
{ "ER_RELAY_LOG_FAIL", 1371, "Failed purging old relay logs: %s" },
{ "ER_PASSWD_LENGTH", 1372, "Password hash should be a %d-digit hexadecimal number" },
{ "ER_UNKNOWN_TARGET_BINLOG", 1373, "Target log not found in binlog index" },
{ "ER_IO_ERR_LOG_INDEX_READ", 1374, "I/O error reading log index file" },
{ "ER_BINLOG_PURGE_PROHIBITED", 1375, "Server configuration does not permit binlog purge" },
{ "ER_FSEEK_FAIL", 1376, "Failed on fseek()" },
{ "ER_BINLOG_PURGE_FATAL_ERR", 1377, "Fatal error during log purge" },
{ "ER_LOG_IN_USE", 1378, "A purgeable log is in use, will not purge" },
{ "ER_LOG_PURGE_UNKNOWN_ERR", 1379, "Unknown error during log purge" },
{ "ER_RELAY_LOG_INIT", 1380, "Failed initializing relay log position: %s" },
{ "ER_NO_BINARY_LOGGING", 1381, "You are not using binary logging" },
{ "ER_RESERVED_SYNTAX", 1382, "The \'%-.64s\' syntax is reserved for purposes internal to the MariaDB server" },
{ "ER_WSAS_FAILED", 1383, "WSAStartup Failed" },
{ "ER_DIFF_GROUPS_PROC", 1384, "Can\'t handle procedures with different groups yet" },
{ "ER_NO_GROUP_FOR_PROC", 1385, "Select must have a group with this procedure" },
{ "ER_ORDER_WITH_PROC", 1386, "Can\'t use ORDER clause with this procedure" },
{ "ER_LOGGING_PROHIBIT_CHANGING_OF", 1387, "Binary logging and replication forbid changing the global server %s" },
{ "ER_NO_FILE_MAPPING", 1388, "Can\'t map file: %-.200s, errno: %M" },
{ "ER_WRONG_MAGIC", 1389, "Wrong magic in %-.64s" },
{ "ER_PS_MANY_PARAM", 1390, "Prepared statement contains too many placeholders" },
{ "ER_KEY_PART_0", 1391, "Key part \'%-.192s\' length cannot be 0" },
{ "ER_VIEW_CHECKSUM", 1392, "View text checksum failed" },
{ "ER_VIEW_MULTIUPDATE", 1393, "Can not modify more than one base table through a join view \'%-.192s.%-.192s\'" },
{ "ER_VIEW_NO_INSERT_FIELD_LIST", 1394, "Can not insert into join view \'%-.192s.%-.192s\' without fields list" },
{ "ER_VIEW_DELETE_MERGE_VIEW", 1395, "Can not delete from join view \'%-.192s.%-.192s\'" },
{ "ER_CANNOT_USER", 1396, "Operation %s failed for %.256s" },
{ "ER_XAER_NOTA", 1397, "XAER_NOTA: Unknown XID" },
{ "ER_XAER_INVAL", 1398, "XAER_INVAL: Invalid arguments (or unsupported command)" },
{ "ER_XAER_RMFAIL", 1399, "XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s state" },
{ "ER_XAER_OUTSIDE", 1400, "XAER_OUTSIDE: Some work is done outside global transaction" },
{ "ER_XAER_RMERR", 1401, "XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency" },
{ "ER_XA_RBROLLBACK", 1402, "XA_RBROLLBACK: Transaction branch was rolled back" },
{ "ER_NONEXISTING_PROC_GRANT", 1403, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\' on routine \'%-.192s\'" },
{ "ER_PROC_AUTO_GRANT_FAIL", 1404, "Failed to grant EXECUTE and ALTER ROUTINE privileges" },
{ "ER_PROC_AUTO_REVOKE_FAIL", 1405, "Failed to revoke all privileges to dropped routine" },
{ "ER_DATA_TOO_LONG", 1406, "Data too long for column \'%s\' at row %lu" },
{ "ER_SP_BAD_SQLSTATE", 1407, "Bad SQLSTATE: \'%s\'" },
{ "ER_STARTUP", 1408, "%s: ready for connections.\nVersion: \'%s\'  socket: \'%s\'  port: %d  %s" },
{ "ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR", 1409, "Can\'t load value from file with fixed size rows to variable" },
{ "ER_CANT_CREATE_USER_WITH_GRANT", 1410, "You are not allowed to create a user with GRANT" },
{ "ER_WRONG_VALUE_FOR_TYPE", 1411, "Incorrect %-.32s value: \'%-.128T\' for function %-.32s" },
{ "ER_TABLE_DEF_CHANGED", 1412, "Table definition has changed, please retry transaction" },
{ "ER_SP_DUP_HANDLER", 1413, "Duplicate handler declared in the same block" },
{ "ER_SP_NOT_VAR_ARG", 1414, "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger" },
{ "ER_SP_NO_RETSET", 1415, "Not allowed to return a result set from a %s" },
{ "ER_CANT_CREATE_GEOMETRY_OBJECT", 1416, "Cannot get geometry object from data you send to the GEOMETRY field" },
{ "ER_FAILED_ROUTINE_BREAK_BINLOG", 1417, "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes" },
{ "ER_BINLOG_UNSAFE_ROUTINE", 1418, "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" },
{ "ER_BINLOG_CREATE_ROUTINE_NEED_SUPER", 1419, "You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" },
{ "ER_EXEC_STMT_WITH_OPEN_CURSOR", 1420, "You can\'t execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it" },
{ "ER_STMT_HAS_NO_OPEN_CURSOR", 1421, "The statement (%lu) has no open cursor" },
{ "ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG", 1422, "Explicit or implicit commit is not allowed in stored function or trigger" },
{ "ER_NO_DEFAULT_FOR_VIEW_FIELD", 1423, "Field of view \'%-.192s.%-.192s\' underlying table doesn\'t have a default value" },
{ "ER_SP_NO_RECURSION", 1424, "Recursive stored functions and triggers are not allowed" },
{ "ER_TOO_BIG_SCALE", 1425, "Too big scale %llu specified for \'%-.192s\'. Maximum is %u" },
{ "ER_TOO_BIG_PRECISION", 1426, "Too big precision %llu specified for \'%-.192s\'. Maximum is %u" },
{ "ER_M_BIGGER_THAN_D", 1427, "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column \'%-.192s\')" },
{ "ER_WRONG_LOCK_OF_SYSTEM_TABLE", 1428, "You can\'t combine write-locking of system tables with other tables or lock types" },
{ "ER_CONNECT_TO_FOREIGN_DATA_SOURCE", 1429, "Unable to connect to foreign data source: %.64s" },
{ "ER_QUERY_ON_FOREIGN_DATA_SOURCE", 1430, "There was a problem processing the query on the foreign data source. Data source error: %-.64s" },
{ "ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST", 1431, "The foreign data source you are trying to reference does not exist. Data source error:  %-.64s" },
{ "ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE", 1432, "Can\'t create federated table. The data source connection string \'%-.64s\' is not in the correct format" },
{ "ER_FOREIGN_DATA_STRING_INVALID", 1433, "The data source connection string \'%-.64s\' is not in the correct format" },
{ "ER_CANT_CREATE_FEDERATED_TABLE", 1434, "Can\'t create federated table. Foreign data src error:  %-.64s" },
{ "ER_TRG_IN_WRONG_SCHEMA", 1435, "Trigger in wrong schema" },
{ "ER_STACK_OVERRUN_NEED_MORE", 1436, "Thread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed. Consider increasing the thread_stack system variable." },
{ "ER_TOO_LONG_BODY", 1437, "Routine body for \'%-.100s\' is too long" },
{ "ER_WARN_CANT_DROP_DEFAULT_KEYCACHE", 1438, "Cannot drop default keycache" },
{ "ER_TOO_BIG_DISPLAYWIDTH", 1439, "Display width out of range for \'%-.192s\' (max = %lu)" },
{ "ER_XAER_DUPID", 1440, "XAER_DUPID: The XID already exists" },
{ "ER_DATETIME_FUNCTION_OVERFLOW", 1441, "Datetime function: %-.32s field overflow" },
{ "ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG", 1442, "Can\'t update table \'%-.192s\' in stored function/trigger because it is already used by statement which invoked this stored function/trigger" },
{ "ER_VIEW_PREVENT_UPDATE", 1443, "The definition of table \'%-.192s\' prevents operation %-.192s on table \'%-.192s\'" },
{ "ER_PS_NO_RECURSION", 1444, "The prepared statement contains a stored routine call that refers to that same statement. It\'s not allowed to execute a prepared statement in such a recursive manner" },
{ "ER_SP_CANT_SET_AUTOCOMMIT", 1445, "Not allowed to set autocommit from a stored function or trigger" },
{ "ER_MALFORMED_DEFINER", 1446, "Invalid definer" },
{ "ER_VIEW_FRM_NO_USER", 1447, "View \'%-.192s\'.\'%-.192s\' has no definer information (old table format). Current user is used as definer. Please recreate the view!" },
{ "ER_VIEW_OTHER_USER", 1448, "You need the SUPER privilege for creation view with \'%-.192s\'@\'%-.192s\' definer" },
{ "ER_NO_SUCH_USER", 1449, "The user specified as a definer (\'%-.64s\'@\'%-.64s\') does not exist" },
{ "ER_FORBID_SCHEMA_CHANGE", 1450, "Changing schema from \'%-.192s\' to \'%-.192s\' is not allowed" },
{ "ER_ROW_IS_REFERENCED_2", 1451, "Cannot delete or update a parent row: a foreign key constraint fails (%s)" },
{ "ER_NO_REFERENCED_ROW_2", 1452, "Cannot add or update a child row: a foreign key constraint fails (%s)" },
{ "ER_SP_BAD_VAR_SHADOW", 1453, "Variable \'%-.64s\' must be quoted with `...`, or renamed" },
{ "ER_TRG_NO_DEFINER", 1454, "No definer attribute for trigger \'%-.192s\'.\'%-.192s\'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger" },
{ "ER_OLD_FILE_FORMAT", 1455, "\'%-.192s\' has an old format, you should re-create the \'%s\' object(s)" },
{ "ER_SP_RECURSION_LIMIT", 1456, "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s" },
{ "ER_SP_PROC_TABLE_CORRUPT", 1457, "Failed to load routine %-.192s (internal code %d). For more details, run SHOW WARNINGS" },
{ "ER_SP_WRONG_NAME", 1458, "Incorrect routine name \'%-.192s\'" },
{ "ER_TABLE_NEEDS_UPGRADE", 1459, "Upgrade required. Please do \"REPAIR %s %`s\" or dump/reload to fix it!" },
{ "ER_SP_NO_AGGREGATE", 1460, "AGGREGATE is not supported for stored functions" },
{ "ER_MAX_PREPARED_STMT_COUNT_REACHED", 1461, "Can\'t create more than max_prepared_stmt_count statements (current value: %u)" },
{ "ER_VIEW_RECURSIVE", 1462, "%`s.%`s contains view recursion" },
{ "ER_NON_GROUPING_FIELD_USED", 1463, "Non-grouping field \'%-.192s\' is used in %-.64s clause" },
{ "ER_TABLE_CANT_HANDLE_SPKEYS", 1464, "The storage engine %s doesn\'t support SPATIAL indexes" },
{ "ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA", 1465, "Triggers can not be created on system tables" },
{ "ER_REMOVED_SPACES", 1466, "Leading spaces are removed from name \'%s\'" },
{ "ER_AUTOINC_READ_FAILED", 1467, "Failed to read auto-increment value from storage engine" },
{ "ER_USERNAME", 1468, "user name" },
{ "ER_HOSTNAME", 1469, "host name" },
{ "ER_WRONG_STRING_LENGTH", 1470, "String \'%-.70T\' is too long for %s (should be no longer than %d)" },
{ "ER_NON_INSERTABLE_TABLE", 1471, "The target table %-.100s of the %s is not insertable-into" },
{ "ER_ADMIN_WRONG_MRG_TABLE", 1472, "Table \'%-.64s\' is differently defined or of non-MyISAM type or doesn\'t exist" },
{ "ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT", 1473, "Too high level of nesting for select" },
{ "ER_NAME_BECOMES_EMPTY", 1474, "Name \'%-.64s\' has become \'\'" },
{ "ER_AMBIGUOUS_FIELD_TERM", 1475, "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY" },
{ "ER_FOREIGN_SERVER_EXISTS", 1476, "Cannot create foreign server \'%s\' as it already exists" },
{ "ER_FOREIGN_SERVER_DOESNT_EXIST", 1477, "The foreign server name you are trying to reference does not exist. Data source error:  %-.64s" },
{ "ER_ILLEGAL_HA_CREATE_OPTION", 1478, "Table storage engine \'%-.64s\' does not support the create option \'%.64s\'" },
{ "ER_PARTITION_REQUIRES_VALUES_ERROR", 1479, "Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition" },
{ "ER_PARTITION_WRONG_VALUES_ERROR", 1480, "Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition" },
{ "ER_PARTITION_MAXVALUE_ERROR", 1481, "MAXVALUE can only be used in last partition definition" },
{ "ER_PARTITION_SUBPARTITION_ERROR", 1482, "Subpartitions can only be hash partitions and by key" },
{ "ER_PARTITION_SUBPART_MIX_ERROR", 1483, "Must define subpartitions on all partitions if on one partition" },
{ "ER_PARTITION_WRONG_NO_PART_ERROR", 1484, "Wrong number of partitions defined, mismatch with previous setting" },
{ "ER_PARTITION_WRONG_NO_SUBPART_ERROR", 1485, "Wrong number of subpartitions defined, mismatch with previous setting" },
{ "ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR", 1486, "Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed" },
{ "ER_NOT_CONSTANT_EXPRESSION", 1487, "Expression in %s must be constant" },
{ "ER_FIELD_NOT_FOUND_PART_ERROR", 1488, "Field in list of fields for partition function not found in table" },
{ "ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR", 1489, "List of fields is only allowed in KEY partitions" },
{ "ER_INCONSISTENT_PARTITION_INFO_ERROR", 1490, "The partition info in the frm file is not consistent with what can be written into the frm file" },
{ "ER_PARTITION_FUNC_NOT_ALLOWED_ERROR", 1491, "The %-.192s function returns the wrong type" },
{ "ER_PARTITIONS_MUST_BE_DEFINED_ERROR", 1492, "For %-.64s partitions each partition must be defined" },
{ "ER_RANGE_NOT_INCREASING_ERROR", 1493, "VALUES LESS THAN value must be strictly increasing for each partition" },
{ "ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR", 1494, "VALUES value must be of same type as partition function" },
{ "ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR", 1495, "Multiple definition of same constant in list partitioning" },
{ "ER_PARTITION_ENTRY_ERROR", 1496, "Partitioning can not be used stand-alone in query" },
{ "ER_MIX_HANDLER_ERROR", 1497, "The mix of handlers in the partitions is not allowed in this version of MariaDB" },
{ "ER_PARTITION_NOT_DEFINED_ERROR", 1498, "For the partitioned engine it is necessary to define all %-.64s" },
{ "ER_TOO_MANY_PARTITIONS_ERROR", 1499, "Too many partitions (including subpartitions) were defined" },
{ "ER_SUBPARTITION_ERROR", 1500, "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning" },
{ "ER_CANT_CREATE_HANDLER_FILE", 1501, "Failed to create specific handler file" },
{ "ER_BLOB_FIELD_IN_PART_FUNC_ERROR", 1502, "A BLOB field is not allowed in partition function" },
{ "ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF", 1503, "A %-.192s must include all columns in the table\'s partitioning function" },
{ "ER_NO_PARTS_ERROR", 1504, "Number of %-.64s = 0 is not an allowed value" },
{ "ER_PARTITION_MGMT_ON_NONPARTITIONED", 1505, "Partition management on a not partitioned table is not possible" },
{ "ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING", 1506, "Partitioned tables do not support %s" },
{ "ER_DROP_PARTITION_NON_EXISTENT", 1507, "Error in list of partitions to %-.64s" },
{ "ER_DROP_LAST_PARTITION", 1508, "Cannot remove all partitions, use DROP TABLE instead" },
{ "ER_COALESCE_ONLY_ON_HASH_PARTITION", 1509, "COALESCE PARTITION can only be used on HASH/KEY partitions" },
{ "ER_REORG_HASH_ONLY_ON_SAME_NO", 1510, "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers" },
{ "ER_REORG_NO_PARAM_ERROR", 1511, "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs" },
{ "ER_ONLY_ON_RANGE_LIST_PARTITION", 1512, "%-.64s PARTITION can only be used on RANGE/LIST partitions" },
{ "ER_ADD_PARTITION_SUBPART_ERROR", 1513, "Trying to Add partition(s) with wrong number of subpartitions" },
{ "ER_ADD_PARTITION_NO_NEW_PARTITION", 1514, "At least one partition must be added" },
{ "ER_COALESCE_PARTITION_NO_PARTITION", 1515, "At least one partition must be coalesced" },
{ "ER_REORG_PARTITION_NOT_EXIST", 1516, "More partitions to reorganize than there are partitions" },
{ "ER_SAME_NAME_PARTITION", 1517, "Duplicate partition name %-.192s" },
{ "ER_NO_BINLOG_ERROR", 1518, "It is not allowed to shut off binlog on this command" },
{ "ER_CONSECUTIVE_REORG_PARTITIONS", 1519, "When reorganizing a set of partitions they must be in consecutive order" },
{ "ER_REORG_OUTSIDE_RANGE", 1520, "Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range" },
{ "ER_PARTITION_FUNCTION_FAILURE", 1521, "Partition function not supported in this version for this handler" },
{ "ER_PART_STATE_ERROR", 1522, "Partition state cannot be defined from CREATE/ALTER TABLE" },
{ "ER_LIMITED_PART_RANGE", 1523, "The %-.64s handler only supports 32 bit integers in VALUES" },
{ "ER_PLUGIN_IS_NOT_LOADED", 1524, "Plugin \'%-.192s\' is not loaded" },
{ "ER_WRONG_VALUE", 1525, "Incorrect %-.32s value: \'%-.128T\'" },
{ "ER_NO_PARTITION_FOR_GIVEN_VALUE", 1526, "Table has no partition for value %-.64s" },
{ "ER_FILEGROUP_OPTION_ONLY_ONCE", 1527, "It is not allowed to specify %s more than once" },
{ "ER_CREATE_FILEGROUP_FAILED", 1528, "Failed to create %s" },
{ "ER_DROP_FILEGROUP_FAILED", 1529, "Failed to drop %s" },
{ "ER_TABLESPACE_AUTO_EXTEND_ERROR", 1530, "The handler doesn\'t support autoextend of tablespaces" },
{ "ER_WRONG_SIZE_NUMBER", 1531, "A size parameter was incorrectly specified, either number or on the form 10M" },
{ "ER_SIZE_OVERFLOW_ERROR", 1532, "The size number was correct but we don\'t allow the digit part to be more than 2 billion" },
{ "ER_ALTER_FILEGROUP_FAILED", 1533, "Failed to alter: %s" },
{ "ER_BINLOG_ROW_LOGGING_FAILED", 1534, "Writing one row to the row-based binary log failed" },
{ "ER_BINLOG_ROW_WRONG_TABLE_DEF", 1535, "Table definition on master and slave does not match: %s" },
{ "ER_BINLOG_ROW_RBR_TO_SBR", 1536, "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events" },
{ "ER_EVENT_ALREADY_EXISTS", 1537, "Event \'%-.192s\' already exists" },
{ "ER_EVENT_STORE_FAILED", 1538, "Failed to store event %s. Error code %M from storage engine" },
{ "ER_EVENT_DOES_NOT_EXIST", 1539, "Unknown event \'%-.192s\'" },
{ "ER_EVENT_CANT_ALTER", 1540, "Failed to alter event \'%-.192s\'" },
{ "ER_EVENT_DROP_FAILED", 1541, "Failed to drop %s" },
{ "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", 1542, "INTERVAL is either not positive or too big" },
{ "ER_EVENT_ENDS_BEFORE_STARTS", 1543, "ENDS is either invalid or before STARTS" },
{ "ER_EVENT_EXEC_TIME_IN_THE_PAST", 1544, "Event execution time is in the past. Event has been disabled" },
{ "ER_EVENT_OPEN_TABLE_FAILED", 1545, "Failed to open mysql.event" },
{ "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", 1546, "No datetime expression provided" },
{ "ER_UNUSED_2", 1547, "You should never see it" },
{ "ER_UNUSED_3", 1548, "You should never see it" },
{ "ER_EVENT_CANNOT_DELETE", 1549, "Failed to delete the event from mysql.event" },
{ "ER_EVENT_COMPILE_ERROR", 1550, "Error during compilation of event\'s body" },
{ "ER_EVENT_SAME_NAME", 1551, "Same old and new event name" },
{ "ER_EVENT_DATA_TOO_LONG", 1552, "Data for column \'%s\' too long" },
{ "ER_DROP_INDEX_FK", 1553, "Cannot drop index \'%-.192s\': needed in a foreign key constraint" },
{ "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", 1554, "The syntax \'%s\' is deprecated and will be removed in MariaDB %s. Please use %s instead" },
{ "ER_CANT_WRITE_LOCK_LOG_TABLE", 1555, "You can\'t write-lock a log table. Only read access is possible" },
{ "ER_CANT_LOCK_LOG_TABLE", 1556, "You can\'t use locks with log tables" },
{ "ER_UNUSED_4", 1557, "You should never see it" },
{ "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", 1558, "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error" },
{ "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", 1559, "Cannot switch out of the row-based binary log format when the session has open temporary tables" },
{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1560, "Cannot change the binary logging format inside a stored function or trigger" },
{ "ER_UNUSED_13", 1561, "You should never see it" },
{ "ER_PARTITION_NO_TEMPORARY", 1562, "Cannot create temporary table with partitions" },
{ "ER_PARTITION_CONST_DOMAIN_ERROR", 1563, "Partition constant is out of partition function domain" },
{ "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", 1564, "This partition function is not allowed" },
{ "ER_DDL_LOG_ERROR", 1565, "Error in DDL log" },
{ "ER_NULL_IN_VALUES_LESS_THAN", 1566, "Not allowed to use NULL value in VALUES LESS THAN" },
{ "ER_WRONG_PARTITION_NAME", 1567, "Incorrect partition name" },
{ "ER_CANT_CHANGE_TX_CHARACTERISTICS", 1568, "Transaction characteristics can\'t be changed while a transaction is in progress" },
{ "ER_DUP_ENTRY_AUTOINCREMENT_CASE", 1569, "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry \'%-.192T\' for key \'%-.192s\'" },
{ "ER_EVENT_MODIFY_QUEUE_ERROR", 1570, "Internal scheduler error %d" },
{ "ER_EVENT_SET_VAR_ERROR", 1571, "Error during starting/stopping of the scheduler. Error code %M" },
{ "ER_PARTITION_MERGE_ERROR", 1572, "Engine cannot be used in partitioned tables" },
{ "ER_CANT_ACTIVATE_LOG", 1573, "Cannot activate \'%-.64s\' log" },
{ "ER_RBR_NOT_AVAILABLE", 1574, "The server was not built with row-based replication" },
{ "ER_BASE64_DECODE_ERROR", 1575, "Decoding of base64 string failed" },
{ "ER_EVENT_RECURSION_FORBIDDEN", 1576, "Recursion of EVENT DDL statements is forbidden when body is present" },
{ "ER_EVENTS_DB_ERROR", 1577, "Cannot proceed, because event scheduler is disabled" },
{ "ER_ONLY_INTEGERS_ALLOWED", 1578, "Only integers allowed as number here" },
{ "ER_UNSUPORTED_LOG_ENGINE", 1579, "Storage engine %s cannot be used for log tables" },
{ "ER_BAD_LOG_STATEMENT", 1580, "You cannot \'%s\' a log table if logging is enabled" },
{ "ER_CANT_RENAME_LOG_TABLE", 1581, "Cannot rename \'%s\'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to \'%s\'" },
{ "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", 1582, "Incorrect parameter count in the call to native function \'%-.192s\'" },
{ "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", 1583, "Incorrect parameters in the call to native function \'%-.192s\'" },
{ "ER_WRONG_PARAMETERS_TO_STORED_FCT", 1584, "Incorrect parameters in the call to stored function \'%-.192s\'" },
{ "ER_NATIVE_FCT_NAME_COLLISION", 1585, "This function \'%-.192s\' has the same name as a native function" },
{ "ER_DUP_ENTRY_WITH_KEY_NAME", 1586, "Duplicate entry \'%-.64T\' for key \'%-.192s\'" },
{ "ER_BINLOG_PURGE_EMFILE", 1587, "Too many files opened, please execute the command again" },
{ "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", 1588, "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation" },
{ "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", 1589, "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future" },
{ "ER_SLAVE_INCIDENT", 1590, "The incident %s occurred on the master. Message: %-.64s" },
{ "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", 1591, "Table has no partition for some existing values" },
{ "ER_BINLOG_UNSAFE_STATEMENT", 1592, "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %s" },
{ "ER_SLAVE_FATAL_ERROR", 1593, "Fatal error: %s" },
{ "ER_SLAVE_RELAY_LOG_READ_FAILURE", 1594, "Relay log read failure: %s" },
{ "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", 1595, "Relay log write failure: %s" },
{ "ER_SLAVE_CREATE_EVENT_FAILURE", 1596, "Failed to create %s" },
{ "ER_SLAVE_MASTER_COM_FAILURE", 1597, "Master command %s failed: %s" },
{ "ER_BINLOG_LOGGING_IMPOSSIBLE", 1598, "Binary logging not possible. Message: %s" },
{ "ER_VIEW_NO_CREATION_CTX", 1599, "View %`s.%`s has no creation context" },
{ "ER_VIEW_INVALID_CREATION_CTX", 1600, "Creation context of view %`s.%`s is invalid" },
{ "ER_SR_INVALID_CREATION_CTX", 1601, "Creation context of stored routine %`s.%`s is invalid" },
{ "ER_TRG_CORRUPTED_FILE", 1602, "Corrupted TRG file for table %`s.%`s" },
{ "ER_TRG_NO_CREATION_CTX", 1603, "Triggers for table %`s.%`s have no creation context" },
{ "ER_TRG_INVALID_CREATION_CTX", 1604, "Trigger creation context of table %`s.%`s is invalid" },
{ "ER_EVENT_INVALID_CREATION_CTX", 1605, "Creation context of event %`s.%`s is invalid" },
{ "ER_TRG_CANT_OPEN_TABLE", 1606, "Cannot open table for trigger %`s.%`s" },
{ "ER_CANT_CREATE_SROUTINE", 1607, "Cannot create stored routine %`s. Check warnings" },
{ "ER_UNUSED_11", 1608, "You should never see it" },
{ "ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT", 1609, "The BINLOG statement of type %s was not preceded by a format description BINLOG statement" },
{ "ER_SLAVE_CORRUPT_EVENT", 1610, "Corrupted replication event was detected" },
{ "ER_LOAD_DATA_INVALID_COLUMN", 1611, "Invalid column reference (%-.64s) in LOAD DATA" },
{ "ER_LOG_PURGE_NO_FILE", 1612, "Being purged log %s was not found" },
{ "ER_XA_RBTIMEOUT", 1613, "XA_RBTIMEOUT: Transaction branch was rolled back: took too long" },
{ "ER_XA_RBDEADLOCK", 1614, "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected" },
{ "ER_NEED_REPREPARE", 1615, "Prepared statement needs to be re-prepared" },
{ "ER_DELAYED_NOT_SUPPORTED", 1616, "DELAYED option not supported for table \'%-.192s\'" },
{ "WARN_NO_MASTER_INFO", 1617, "There is no master connection \'%.*s\'" },
{ "WARN_OPTION_IGNORED", 1618, "<%-.64s> option ignored" },
{ "ER_PLUGIN_DELETE_BUILTIN", 1619, "Built-in plugins cannot be deleted" },
{ "WARN_PLUGIN_BUSY", 1620, "Plugin is busy and will be uninstalled on shutdown" },
{ "ER_VARIABLE_IS_READONLY", 1621, "%s variable \'%s\' is read-only. Use SET %s to assign the value" },
{ "ER_WARN_ENGINE_TRANSACTION_ROLLBACK", 1622, "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted" },
{ "ER_SLAVE_HEARTBEAT_FAILURE", 1623, "Unexpected master\'s heartbeat data: %s" },
{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", 1624, "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)" },
{ "ER_UNUSED_14", 1625, "You should never see it" },
{ "ER_CONFLICT_FN_PARSE_ERROR", 1626, "Error in parsing conflict function. Message: %-.64s" },
{ "ER_EXCEPTIONS_WRITE_ERROR", 1627, "Write to exceptions table failed. Message: %-.128s\"" },
{ "ER_TOO_LONG_TABLE_COMMENT", 1628, "Comment for table \'%-.64s\' is too long (max = %u)" },
{ "ER_TOO_LONG_FIELD_COMMENT", 1629, "Comment for field \'%-.64s\' is too long (max = %u)" },
{ "ER_FUNC_INEXISTENT_NAME_COLLISION", 1630, "FUNCTION %s does not exist. Check the \'Function Name Parsing and Resolution\' section in the Reference Manual" },
{ "ER_DATABASE_NAME", 1631, "Database" },
{ "ER_TABLE_NAME", 1632, "Table" },
{ "ER_PARTITION_NAME", 1633, "Partition" },
{ "ER_SUBPARTITION_NAME", 1634, "Subpartition" },
{ "ER_TEMPORARY_NAME", 1635, "Temporary" },
{ "ER_RENAMED_NAME", 1636, "Renamed" },
{ "ER_TOO_MANY_CONCURRENT_TRXS", 1637, "Too many active concurrent transactions" },
{ "WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED", 1638, "Non-ASCII separator arguments are not fully supported" },
{ "ER_DEBUG_SYNC_TIMEOUT", 1639, "debug sync point wait timed out" },
{ "ER_DEBUG_SYNC_HIT_LIMIT", 1640, "debug sync point hit limit reached" },
{ "ER_DUP_SIGNAL_SET", 1641, "Duplicate condition information item \'%s\'" },
{ "ER_SIGNAL_WARN", 1642, "Unhandled user-defined warning condition" },
{ "ER_SIGNAL_NOT_FOUND", 1643, "Unhandled user-defined not found condition" },
{ "ER_SIGNAL_EXCEPTION", 1644, "Unhandled user-defined exception condition" },
{ "ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER", 1645, "RESIGNAL when handler not active" },
{ "ER_SIGNAL_BAD_CONDITION_TYPE", 1646, "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE" },
{ "WARN_COND_ITEM_TRUNCATED", 1647, "Data truncated for condition item \'%s\'" },
{ "ER_COND_ITEM_TOO_LONG", 1648, "Data too long for condition item \'%s\'" },
{ "ER_UNKNOWN_LOCALE", 1649, "Unknown locale: \'%-.64s\'" },
{ "ER_SLAVE_IGNORE_SERVER_IDS", 1650, "The requested server id %d clashes with the slave startup option --replicate-same-server-id" },
{ "ER_QUERY_CACHE_DISABLED", 1651, "Query cache is disabled; set query_cache_type to ON or DEMAND to enable it" },
{ "ER_SAME_NAME_PARTITION_FIELD", 1652, "Duplicate partition field name \'%-.192s\'" },
{ "ER_PARTITION_COLUMN_LIST_ERROR", 1653, "Inconsistency in usage of column lists for partitioning" },
{ "ER_WRONG_TYPE_COLUMN_VALUE_ERROR", 1654, "Partition column values of incorrect type" },
{ "ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR", 1655, "Too many fields in \'%-.192s\'" },
{ "ER_MAXVALUE_IN_VALUES_IN", 1656, "Cannot use MAXVALUE as value in VALUES IN" },
{ "ER_TOO_MANY_VALUES_ERROR", 1657, "Cannot have more than one value for this type of %-.64s partitioning" },
{ "ER_ROW_SINGLE_PARTITION_FIELD_ERROR", 1658, "Row expressions in VALUES IN only allowed for multi-field column partitioning" },
{ "ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD", 1659, "Field \'%-.192s\' is of a not allowed type for this type of partitioning" },
{ "ER_PARTITION_FIELDS_TOO_LONG", 1660, "The total length of the partitioning fields is too large" },
{ "ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE", 1661, "Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved" },
{ "ER_BINLOG_ROW_MODE_AND_STMT_ENGINE", 1662, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging" },
{ "ER_BINLOG_UNSAFE_AND_STMT_ENGINE", 1663, "Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %s" },
{ "ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE", 1664, "Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging" },
{ "ER_BINLOG_STMT_MODE_AND_ROW_ENGINE", 1665, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s" },
{ "ER_BINLOG_ROW_INJECTION_AND_STMT_MODE", 1666, "Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT" },
{ "ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1667, "Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging" },
{ "ER_BINLOG_UNSAFE_LIMIT", 1668, "The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted" },
{ "ER_BINLOG_UNSAFE_INSERT_DELAYED", 1669, "The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted" },
{ "ER_BINLOG_UNSAFE_SYSTEM_TABLE", 1670, "The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves" },
{ "ER_BINLOG_UNSAFE_AUTOINC_COLUMNS", 1671, "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly" },
{ "ER_BINLOG_UNSAFE_UDF", 1672, "Statement is unsafe because it uses a UDF which may not return the same value on the slave" },
{ "ER_BINLOG_UNSAFE_SYSTEM_VARIABLE", 1673, "Statement is unsafe because it uses a system variable that may have a different value on the slave" },
{ "ER_BINLOG_UNSAFE_SYSTEM_FUNCTION", 1674, "Statement is unsafe because it uses a system function that may return a different value on the slave" },
{ "ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS", 1675, "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction" },
{ "ER_MESSAGE_AND_STATEMENT", 1676, "%s. Statement: %s" },
{ "ER_SLAVE_CONVERSION_FAILED", 1677, "Column %d of table \'%-.192s.%-.192s\' cannot be converted from type \'%-.50s\' to type \'%-.50s\'" },
{ "ER_SLAVE_CANT_CREATE_CONVERSION", 1678, "Can\'t create conversion table for table \'%-.192s.%-.192s\'" },
{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1679, "Cannot modify @@session.binlog_format inside a transaction" },
{ "ER_PATH_LENGTH", 1680, "The path specified for %.64T is too long" },
{ "ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT", 1681, "\'%s\' is deprecated and will be removed in a future release" },
{ "ER_WRONG_NATIVE_TABLE_STRUCTURE", 1682, "Native table \'%-.64s\'.\'%-.64s\' has the wrong structure" },
{ "ER_WRONG_PERFSCHEMA_USAGE", 1683, "Invalid performance_schema usage" },
{ "ER_WARN_I_S_SKIPPED_TABLE", 1684, "Table \'%s\'.\'%s\' was skipped since its definition is being modified by concurrent DDL statement" },
{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT", 1685, "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction" },
{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT", 1686, "Cannot change the binlog direct flag inside a stored function or trigger" },
{ "ER_SPATIAL_MUST_HAVE_GEOM_COL", 1687, "A SPATIAL index may only contain a geometrical type column" },
{ "ER_TOO_LONG_INDEX_COMMENT", 1688, "Comment for index \'%-.64s\' is too long (max = %lu)" },
{ "ER_LOCK_ABORTED", 1689, "Wait on a lock was aborted due to a pending exclusive lock" },
{ "ER_DATA_OUT_OF_RANGE", 1690, "%s value is out of range in \'%s\'" },
{ "ER_WRONG_SPVAR_TYPE_IN_LIMIT", 1691, "A variable of a non-integer based type in LIMIT clause" },
{ "ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1692, "Mixing self-logging and non-self-logging engines in a statement is unsafe" },
{ "ER_BINLOG_UNSAFE_MIXED_STATEMENT", 1693, "Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them" },
{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1694, "Cannot modify @@session.sql_log_bin inside a transaction" },
{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1695, "Cannot change the sql_log_bin inside a stored function or trigger" },
{ "ER_FAILED_READ_FROM_PAR_FILE", 1696, "Failed to read from the .par file" },
{ "ER_VALUES_IS_NOT_INT_TYPE_ERROR", 1697, "VALUES value for partition \'%-.64s\' must have type INT" },
{ "ER_ACCESS_DENIED_NO_PASSWORD_ERROR", 1698, "Access denied for user \'%s\'@\'%s\'" },
{ "ER_SET_PASSWORD_AUTH_PLUGIN", 1699, "SET PASSWORD is not applicable for users authenticating via %s plugin" },
{ "ER_GRANT_PLUGIN_USER_EXISTS", 1700, "GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists" },
{ "ER_TRUNCATE_ILLEGAL_FK", 1701, "Cannot truncate a table referenced in a foreign key constraint (%.192s)" },
{ "ER_PLUGIN_IS_PERMANENT", 1702, "Plugin \'%s\' is force_plus_permanent and can not be unloaded" },
{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN", 1703, "The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled" },
{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX", 1704, "The requested value for the heartbeat period exceeds the value of `slave_net_timeout\' seconds. A sensible value for the period should be less than the timeout" },
{ "ER_STMT_CACHE_FULL", 1705, "Multi-row statements required more than \'max_binlog_stmt_cache_size\' bytes of storage." },
{ "ER_MULTI_UPDATE_KEY_CONFLICT", 1706, "Primary key/partition key update is not allowed since the table is updated both as \'%-.192s\' and \'%-.192s\'" },
{ "ER_TABLE_NEEDS_REBUILD", 1707, "Table rebuild required. Please do \"ALTER TABLE %`s FORCE\" or dump/reload to fix it!" },
{ "WARN_OPTION_BELOW_LIMIT", 1708, "The value of \'%s\' should be no less than the value of \'%s\'" },
{ "ER_INDEX_COLUMN_TOO_LONG", 1709, "Index column size too large. The maximum column size is %lu bytes" },
{ "ER_ERROR_IN_TRIGGER_BODY", 1710, "Trigger \'%-.64s\' has an error in its body: \'%-.256s\'" },
{ "ER_ERROR_IN_UNKNOWN_TRIGGER_BODY", 1711, "Unknown trigger has an error in its body: \'%-.256s\'" },
{ "ER_INDEX_CORRUPT", 1712, "Index %s is corrupted" },
{ "ER_UNDO_RECORD_TOO_BIG", 1713, "Undo log record is too big" },
{ "ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT", 1714, "INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE", 1715, "INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_REPLACE_SELECT", 1716, "REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT", 1717, "CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT", 1718, "CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_UPDATE_IGNORE", 1719, "UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave" },
{ "ER_UNUSED_15", 1720, "You should never see it" },
{ "ER_UNUSED_16", 1721, "You should never see it" },
{ "ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT", 1722, "Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC", 1723, "CREATE TABLE... SELECT...  on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave" },
{ "ER_BINLOG_UNSAFE_INSERT_TWO_KEYS", 1724, "INSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafe" },
{ "ER_UNUSED_28", 1725, "You should never see it" },
{ "ER_VERS_NOT_ALLOWED", 1726, "Not allowed for system-versioned table %`s.%`s" },
{ "ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST", 1727, "INSERT into autoincrement field which is not the first part in the composed primary key is unsafe" },
{ "ER_CANNOT_LOAD_FROM_TABLE_V2", 1728, "Cannot load from %s.%s. The table is probably corrupted" },
{ "ER_MASTER_DELAY_VALUE_OUT_OF_RANGE", 1729, "The requested value %lu for the master delay exceeds the maximum %lu" },
{ "ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT", 1730, "Only Format_description_log_event and row events are allowed in BINLOG statements (but %s was provided)" },
{ "ER_PARTITION_EXCHANGE_DIFFERENT_OPTION", 1731, "Non matching attribute \'%-.64s\' between partition and table" },
{ "ER_PARTITION_EXCHANGE_PART_TABLE", 1732, "Table to exchange with partition is partitioned: \'%-.64s\'" },
{ "ER_PARTITION_EXCHANGE_TEMP_TABLE", 1733, "Table to exchange with partition is temporary: \'%-.64s\'" },
{ "ER_PARTITION_INSTEAD_OF_SUBPARTITION", 1734, "Subpartitioned table, use subpartition instead of partition" },
{ "ER_UNKNOWN_PARTITION", 1735, "Unknown partition \'%-.64s\' in table \'%-.64s\'" },
{ "ER_TABLES_DIFFERENT_METADATA", 1736, "Tables have different definitions" },
{ "ER_ROW_DOES_NOT_MATCH_PARTITION", 1737, "Found a row that does not match the partition" },
{ "ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX", 1738, "Option binlog_cache_size (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_size equal to max_binlog_cache_size" },
{ "ER_WARN_INDEX_NOT_APPLICABLE", 1739, "Cannot use %-.64s access on index \'%-.64s\' due to type or collation conversion on field \'%-.64s\'" },
{ "ER_PARTITION_EXCHANGE_FOREIGN_KEY", 1740, "Table to exchange with partition has foreign key references: \'%-.64s\'" },
{ "ER_NO_SUCH_KEY_VALUE", 1741, "Key value \'%-.192s\' was not found in table \'%-.192s.%-.192s\'" },
{ "ER_VALUE_TOO_LONG", 1742, "Too long value for \'%s\'" },
{ "ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE", 1743, "Replication event checksum verification failed while reading from network" },
{ "ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE", 1744, "Replication event checksum verification failed while reading from a log file" },
{ "ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX", 1745, "Option binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_size" },
{ "ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT", 1746, "Can\'t update table \'%-.192s\' while \'%-.192s\' is being created" },
{ "ER_PARTITION_CLAUSE_ON_NONPARTITIONED", 1747, "PARTITION () clause on non partitioned table" },
{ "ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET", 1748, "Found a row not matching the given partition set" },
{ "ER_UNUSED_5", 1749, "You should never see it" },
{ "ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE", 1750, "Failure while changing the type of replication repository: %s" },
{ "ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE", 1751, "The creation of some temporary tables could not be rolled back" },
{ "ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE", 1752, "Some temporary tables were dropped, but these operations could not be rolled back" },
{ "ER_MTS_FEATURE_IS_NOT_SUPPORTED", 1753, "%s is not supported in multi-threaded slave mode. %s" },
{ "ER_MTS_UPDATED_DBS_GREATER_MAX", 1754, "The number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadata" },
{ "ER_MTS_CANT_PARALLEL", 1755, "Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s" },
{ "ER_MTS_INCONSISTENT_DATA", 1756, "%s" },
{ "ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING", 1757, "FULLTEXT index is not supported for partitioned tables" },
{ "ER_DA_INVALID_CONDITION_NUMBER", 1758, "Invalid condition number" },
{ "ER_INSECURE_PLAIN_TEXT", 1759, "Sending passwords in plain text without SSL/TLS is extremely insecure" },
{ "ER_INSECURE_CHANGE_MASTER", 1760, "Storing MariaDB user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MariaDB Manual for more about this issue and possible alternatives" },
{ "ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO", 1761, "Foreign key constraint for table \'%.192s\', record \'%-.192s\' would lead to a duplicate entry in table \'%.192s\', key \'%.192s\'" },
{ "ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO", 1762, "Foreign key constraint for table \'%.192s\', record \'%-.192s\' would lead to a duplicate entry in a child table" },
{ "ER_SQLTHREAD_WITH_SECURE_SLAVE", 1763, "Setting authentication options is not possible when only the Slave SQL Thread is being started" },
{ "ER_TABLE_HAS_NO_FT", 1764, "The table does not have FULLTEXT index to support this query" },
{ "ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER", 1765, "The system variable %.200s cannot be set in stored functions or triggers" },
{ "ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION", 1766, "The system variable %.200s cannot be set when there is an ongoing transaction" },
{ "ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST", 1767, "The system variable @@SESSION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_NEXT_LIST" },
{ "ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL", 1768, "When @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.GTID_NEXT cannot change inside a transaction" },
{ "ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION", 1769, "The statement \'SET %.200s\' cannot invoke a stored function" },
{ "ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL", 1770, "The system variable @@SESSION.GTID_NEXT cannot be \'AUTOMATIC\' when @@SESSION.GTID_NEXT_LIST is non-NULL" },
{ "ER_SKIPPING_LOGGED_TRANSACTION", 1771, "Skipping transaction %.200s because it has already been executed and logged" },
{ "ER_MALFORMED_GTID_SET_SPECIFICATION", 1772, "Malformed GTID set specification \'%.200s\'" },
{ "ER_MALFORMED_GTID_SET_ENCODING", 1773, "Malformed GTID set encoding" },
{ "ER_MALFORMED_GTID_SPECIFICATION", 1774, "Malformed GTID specification \'%.200s\'" },
{ "ER_GNO_EXHAUSTED", 1775, "Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuid" },
{ "ER_BAD_SLAVE_AUTO_POSITION", 1776, "Parameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is active" },
{ "ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON", 1777, "CHANGE MASTER TO MASTER_AUTO_POSITION = 1 can only be executed when GTID_MODE = ON" },
{ "ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET", 1778, "Cannot execute statements with implicit commit inside a transaction when GTID_NEXT != AUTOMATIC or GTID_NEXT_LIST != NULL" },
{ "ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON", 1779, "GTID_MODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = 1" },
{ "ER_GTID_MODE_REQUIRES_BINLOG", 1780, "GTID_MODE = ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updates" },
{ "ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF", 1781, "GTID_NEXT cannot be set to UUID:NUMBER when GTID_MODE = OFF" },
{ "ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON", 1782, "GTID_NEXT cannot be set to ANONYMOUS when GTID_MODE = ON" },
{ "ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF", 1783, "GTID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFF" },
{ "ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF", 1784, "Found a Gtid_log_event or Previous_gtids_log_event when GTID_MODE = OFF" },
{ "ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE", 1785, "When ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables" },
{ "ER_GTID_UNSAFE_CREATE_SELECT", 1786, "CREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1" },
{ "ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION", 1787, "When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1" },
{ "ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME", 1788, "The value of GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions." },
{ "ER_MASTER_HAS_PURGED_REQUIRED_GTIDS", 1789, "The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires" },
{ "ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID", 1790, "GTID_NEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACK" },
{ "ER_UNKNOWN_EXPLAIN_FORMAT", 1791, "Unknown %s format name: \'%s\'" },
{ "ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION", 1792, "Cannot execute statement in a READ ONLY transaction" },
{ "ER_TOO_LONG_TABLE_PARTITION_COMMENT", 1793, "Comment for table partition \'%-.64s\' is too long (max = %lu)" },
{ "ER_SLAVE_CONFIGURATION", 1794, "Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MariaDB error log" },
{ "ER_INNODB_FT_LIMIT", 1795, "InnoDB presently supports one FULLTEXT index creation at a time" },
{ "ER_INNODB_NO_FT_TEMP_TABLE", 1796, "Cannot create FULLTEXT index on temporary InnoDB table" },
{ "ER_INNODB_FT_WRONG_DOCID_COLUMN", 1797, "Column \'%-.192s\' is of wrong type for an InnoDB FULLTEXT index" },
{ "ER_INNODB_FT_WRONG_DOCID_INDEX", 1798, "Index \'%-.192s\' is of wrong type for an InnoDB FULLTEXT index" },
{ "ER_INNODB_ONLINE_LOG_TOO_BIG", 1799, "Creating index \'%-.192s\' required more than \'innodb_online_alter_log_max_size\' bytes of modification log. Please try again" },
{ "ER_UNKNOWN_ALTER_ALGORITHM", 1800, "Unknown ALGORITHM \'%s\'" },
{ "ER_UNKNOWN_ALTER_LOCK", 1801, "Unknown LOCK type \'%s\'" },
{ "ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS", 1802, "CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL" },
{ "ER_MTS_RECOVERY_FAILURE", 1803, "Cannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MariaDB error log" },
{ "ER_MTS_RESET_WORKERS", 1804, "Cannot clean up worker info tables. Additional error messages can be found in the MariaDB error log" },
{ "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2", 1805, "Column count of %s.%s is wrong. Expected %d, found %d. The table is probably corrupted" },
{ "ER_SLAVE_SILENT_RETRY_TRANSACTION", 1806, "Slave must silently retry current transaction" },
{ "ER_UNUSED_22", 1807, "You should never see it" },
{ "ER_TABLE_SCHEMA_MISMATCH", 1808, "Schema mismatch (%s)" },
{ "ER_TABLE_IN_SYSTEM_TABLESPACE", 1809, "Table %-.192s in system tablespace" },
{ "ER_IO_READ_ERROR", 1810, "IO Read error: (%lu, %s) %s" },
{ "ER_IO_WRITE_ERROR", 1811, "IO Write error: (%lu, %s) %s" },
{ "ER_TABLESPACE_MISSING", 1812, "Tablespace is missing for table \'%-.192s\'" },
{ "ER_TABLESPACE_EXISTS", 1813, "Tablespace for table \'%-.192s\' exists. Please DISCARD the tablespace before IMPORT" },
{ "ER_TABLESPACE_DISCARDED", 1814, "Tablespace has been discarded for table %`s" },
{ "ER_INTERNAL_ERROR", 1815, "Internal error: %-.192s" },
{ "ER_INNODB_IMPORT_ERROR", 1816, "ALTER TABLE \'%-.192s\' IMPORT TABLESPACE failed with error %lu : \'%s\'" },
{ "ER_INNODB_INDEX_CORRUPT", 1817, "Index corrupt: %s" },
{ "ER_INVALID_YEAR_COLUMN_LENGTH", 1818, "YEAR(%lu) column type is deprecated. Creating YEAR(4) column instead" },
{ "ER_NOT_VALID_PASSWORD", 1819, "Your password does not satisfy the current policy requirements (%s)" },
{ "ER_MUST_CHANGE_PASSWORD", 1820, "You must SET PASSWORD before executing this statement" },
{ "ER_FK_NO_INDEX_CHILD", 1821, "Failed to add the foreign key constraint. Missing index for constraint \'%s\' in the foreign table \'%s\'" },
{ "ER_FK_NO_INDEX_PARENT", 1822, "Failed to add the foreign key constraint. Missing index for constraint \'%s\' in the referenced table \'%s\'" },
{ "ER_FK_FAIL_ADD_SYSTEM", 1823, "Failed to add the foreign key constraint \'%s\' to system tables" },
{ "ER_FK_CANNOT_OPEN_PARENT", 1824, "Failed to open the referenced table \'%s\'" },
{ "ER_FK_INCORRECT_OPTION", 1825, "Failed to add the foreign key constraint on table \'%s\'. Incorrect options in FOREIGN KEY constraint \'%s\'" },
{ "ER_DUP_CONSTRAINT_NAME", 1826, "Duplicate %s constraint name \'%s\'" },
{ "ER_PASSWORD_FORMAT", 1827, "The password hash doesn\'t have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function" },
{ "ER_FK_COLUMN_CANNOT_DROP", 1828, "Cannot drop column \'%-.192s\': needed in a foreign key constraint \'%-.192s\'" },
{ "ER_FK_COLUMN_CANNOT_DROP_CHILD", 1829, "Cannot drop column \'%-.192s\': needed in a foreign key constraint \'%-.192s\' of table %-.192s" },
{ "ER_FK_COLUMN_NOT_NULL", 1830, "Column \'%-.192s\' cannot be NOT NULL: needed in a foreign key constraint \'%-.192s\' SET NULL" },
{ "ER_DUP_INDEX", 1831, "Duplicate index %`s. This is deprecated and will be disallowed in a future release" },
{ "ER_FK_COLUMN_CANNOT_CHANGE", 1832, "Cannot change column \'%-.192s\': used in a foreign key constraint \'%-.192s\'" },
{ "ER_FK_COLUMN_CANNOT_CHANGE_CHILD", 1833, "Cannot change column \'%-.192s\': used in a foreign key constraint \'%-.192s\' of table \'%-.192s\'" },
{ "ER_FK_CANNOT_DELETE_PARENT", 1834, "Cannot delete rows from table which is parent in a foreign key constraint \'%-.192s\' of table \'%-.192s\'" },
{ "ER_MALFORMED_PACKET", 1835, "Malformed communication packet" },
{ "ER_READ_ONLY_MODE", 1836, "Running in read-only mode" },
{ "ER_GTID_NEXT_TYPE_UNDEFINED_GROUP", 1837, "When GTID_NEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET GTID_NEXT before a transaction and forgot to set GTID_NEXT to a different identifier or to \'AUTOMATIC\' after COMMIT or ROLLBACK. Current GTID_NEXT is \'%s\'" },
{ "ER_VARIABLE_NOT_SETTABLE_IN_SP", 1838, "The system variable %.200s cannot be set in stored procedures" },
{ "ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF", 1839, "GTID_PURGED can only be set when GTID_MODE = ON" },
{ "ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY", 1840, "GTID_PURGED can only be set when GTID_EXECUTED is empty" },
{ "ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY", 1841, "GTID_PURGED can only be set when there are no ongoing transactions (not even in other clients)" },
{ "ER_GTID_PURGED_WAS_CHANGED", 1842, "GTID_PURGED was changed from \'%s\' to \'%s\'" },
{ "ER_GTID_EXECUTED_WAS_CHANGED", 1843, "GTID_EXECUTED was changed from \'%s\' to \'%s\'" },
{ "ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES", 1844, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED", 1845, "%s is not supported for this operation. Try %s" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON", 1846, "%s is not supported. Reason: %s. Try %s" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY", 1847, "COPY algorithm requires a lock" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION", 1848, "Partition specific operations do not yet support LOCK/ALGORITHM" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME", 1849, "Columns participating in a foreign key are renamed" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE", 1850, "Cannot change column type" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK", 1851, "Adding foreign keys needs foreign_key_checks=OFF" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE", 1852, "Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK", 1853, "Dropping a primary key is not allowed without also adding a new primary key" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC", 1854, "Adding an auto-increment column requires a lock" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS", 1855, "Cannot replace hidden FTS_DOC_ID with a user-visible one" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS", 1856, "Cannot drop or rename FTS_DOC_ID" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS", 1857, "Fulltext index creation requires a lock" },
{ "ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE", 1858, "sql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction" },
{ "ER_DUP_UNKNOWN_IN_INDEX", 1859, "Duplicate entry for key \'%-.192s\'" },
{ "ER_IDENT_CAUSES_TOO_LONG_PATH", 1860, "Long database name and identifier for object resulted in path length exceeding %d characters. Path: \'%s\'" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL", 1861, "cannot convert NULL to non-constant DEFAULT" },
{ "ER_MUST_CHANGE_PASSWORD_LOGIN", 1862, "Your password has expired. To log in you must change it using a client that supports expired passwords" },
{ "ER_ROW_IN_WRONG_PARTITION", 1863, "Found a row in wrong partition %s" },
{ "ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX", 1864, "Cannot schedule event %s, relay-log name %s, position %s to Worker thread because its size %lu exceeds %lu of slave_pending_jobs_size_max" },
{ "ER_INNODB_NO_FT_USES_PARSER", 1865, "Cannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB table" },
{ "ER_BINLOG_LOGICAL_CORRUPTION", 1866, "The binary log file \'%s\' is logically corrupted: %s" },
{ "ER_WARN_PURGE_LOG_IN_USE", 1867, "file %s was not purged because it was being read by %d thread(s), purged only %d out of %d files" },
{ "ER_WARN_PURGE_LOG_IS_ACTIVE", 1868, "file %s was not purged because it is the active log file" },
{ "ER_AUTO_INCREMENT_CONFLICT", 1869, "Auto-increment value in UPDATE conflicts with internally generated values" },
{ "WARN_ON_BLOCKHOLE_IN_RBR", 1870, "Row events are not logged for %s statements that modify BLACKHOLE tables in row format. Table(s): \'%-.192s\'" },
{ "ER_SLAVE_MI_INIT_REPOSITORY", 1871, "Slave failed to initialize master info structure from the repository" },
{ "ER_SLAVE_RLI_INIT_REPOSITORY", 1872, "Slave failed to initialize relay log info structure from the repository" },
{ "ER_ACCESS_DENIED_CHANGE_USER_ERROR", 1873, "Access denied trying to change to user \'%-.48s\'@\'%-.64s\' (using password: %s). Disconnecting" },
{ "ER_INNODB_READ_ONLY", 1874, "InnoDB is in read only mode" },
{ "ER_STOP_SLAVE_SQL_THREAD_TIMEOUT", 1875, "STOP SLAVE command execution is incomplete: Slave SQL thread got the stop signal, thread is busy, SQL thread will stop once the current task is complete" },
{ "ER_STOP_SLAVE_IO_THREAD_TIMEOUT", 1876, "STOP SLAVE command execution is incomplete: Slave IO thread got the stop signal, thread is busy, IO thread will stop once the current task is complete" },
{ "ER_TABLE_CORRUPT", 1877, "Operation cannot be performed. The table \'%-.64s.%-.64s\' is missing, corrupt or contains bad data" },
{ "ER_TEMP_FILE_WRITE_FAILURE", 1878, "Temporary file write failure" },
{ "ER_INNODB_FT_AUX_NOT_HEX_ID", 1879, "Upgrade index name failed, please use create index(alter table) algorithm copy to rebuild index" },
{ "ER_LAST_MYSQL_ERROR_MESSAGE", 1880, "\"" },
{ "ER_UNUSED_18", 1900, "You should never see it" },
{ "ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED", 1901, "Function or expression \'%s\' cannot be used in the %s clause of %`s" },
{ "ER_UNUSED_19", 1902, "You should never see it" },
{ "ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN", 1903, "Primary key cannot be defined upon a generated column" },
{ "ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN", 1904, "Key/Index cannot be defined on a virtual generated column" },
{ "ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN", 1905, "Cannot define foreign key with %s clause on a generated column" },
{ "ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN", 1906, "The value specified for generated column \'%s\' in table \'%s\' has been ignored" },
{ "ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN", 1907, "This is not yet supported for generated columns" },
{ "ER_UNUSED_20", 1908, "You should never see it" },
{ "ER_UNUSED_21", 1909, "You should never see it" },
{ "ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS", 1910, "%s storage engine does not support generated columns" },
{ "ER_UNKNOWN_OPTION", 1911, "Unknown option \'%-.64s\'" },
{ "ER_BAD_OPTION_VALUE", 1912, "Incorrect value \'%-.64T\' for option \'%-.64s\'" },
{ "ER_UNUSED_6", 1913, "You should never see it" },
{ "ER_UNUSED_7", 1914, "You should never see it" },
{ "ER_UNUSED_8", 1915, "You should never see it" },
{ "ER_DATA_OVERFLOW", 1916, "Got overflow when converting \'%-.128s\' to %-.32s. Value truncated" },
{ "ER_DATA_TRUNCATED", 1917, "Truncated value \'%-.128s\' when converting to %-.32s" },
{ "ER_BAD_DATA", 1918, "Encountered illegal value \'%-.128s\' when converting to %-.32s" },
{ "ER_DYN_COL_WRONG_FORMAT", 1919, "Encountered illegal format of dynamic column string" },
{ "ER_DYN_COL_IMPLEMENTATION_LIMIT", 1920, "Dynamic column implementation limit reached" },
{ "ER_DYN_COL_DATA", 1921, "Illegal value used as argument of dynamic column function" },
{ "ER_DYN_COL_WRONG_CHARSET", 1922, "Dynamic column contains unknown character set" },
{ "ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES", 1923, "At least one of the \'in_to_exists\' or \'materialization\' optimizer_switch flags must be \'on\'" },
{ "ER_QUERY_CACHE_IS_DISABLED", 1924, "Query cache is disabled (resize or similar command in progress); repeat this command later" },
{ "ER_QUERY_CACHE_IS_GLOBALY_DISABLED", 1925, "Query cache is globally disabled and you can\'t enable it only for this session" },
{ "ER_VIEW_ORDERBY_IGNORED", 1926, "View \'%-.192s\'.\'%-.192s\' ORDER BY clause ignored because there is other ORDER BY clause already" },
{ "ER_CONNECTION_KILLED", 1927, "Connection was killed" },
{ "ER_UNUSED_12", 1928, "You should never see it" },
{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION", 1929, "Cannot modify @@session.skip_replication inside a transaction" },
{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION", 1930, "Cannot modify @@session.skip_replication inside a stored function or trigger" },
{ "ER_QUERY_RESULT_INCOMPLETE", 1931, "Query execution was interrupted. The query exceeded %s %llu. The query result may be incomplete" },
{ "ER_NO_SUCH_TABLE_IN_ENGINE", 1932, "Table \'%-.192s.%-.192s\' doesn\'t exist in engine" },
{ "ER_TARGET_NOT_EXPLAINABLE", 1933, "Target is not running an EXPLAINable command" },
{ "ER_CONNECTION_ALREADY_EXISTS", 1934, "Connection \'%.*s\' conflicts with existing connection \'%.*s\'" },
{ "ER_MASTER_LOG_PREFIX", 1935, "Master \'%.*s\': " },
{ "ER_CANT_START_STOP_SLAVE", 1936, "Can\'t %s SLAVE \'%.*s\'" },
{ "ER_SLAVE_STARTED", 1937, "SLAVE \'%.*s\' started" },
{ "ER_SLAVE_STOPPED", 1938, "SLAVE \'%.*s\' stopped" },
{ "ER_SQL_DISCOVER_ERROR", 1939, "Engine %s failed to discover table %`-.192s.%`-.192s with \'%s\'" },
{ "ER_FAILED_GTID_STATE_INIT", 1940, "Failed initializing replication GTID state" },
{ "ER_INCORRECT_GTID_STATE", 1941, "Could not parse GTID list" },
{ "ER_CANNOT_UPDATE_GTID_STATE", 1942, "Could not update replication slave gtid state" },
{ "ER_DUPLICATE_GTID_DOMAIN", 1943, "GTID %u-%u-%llu and %u-%u-%llu conflict (duplicate domain id %u)" },
{ "ER_GTID_OPEN_TABLE_FAILED", 1944, "Failed to open %s.%s" },
{ "ER_GTID_POSITION_NOT_FOUND_IN_BINLOG", 1945, "Connecting slave requested to start from GTID %u-%u-%llu, which is not in the master\'s binlog" },
{ "ER_CANNOT_LOAD_SLAVE_GTID_STATE", 1946, "Failed to load replication slave GTID position from table %s.%s" },
{ "ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG", 1947, "Specified GTID %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos" },
{ "ER_MASTER_GTID_POS_MISSING_DOMAIN", 1948, "Specified value for @@gtid_slave_pos contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos" },
{ "ER_UNTIL_REQUIRES_USING_GTID", 1949, "START SLAVE UNTIL master_gtid_pos requires that slave is using GTID" },
{ "ER_GTID_STRICT_OUT_OF_ORDER", 1950, "An attempt was made to binlog GTID %u-%u-%llu which would create an out-of-order sequence number with existing GTID %u-%u-%llu, and gtid strict mode is enabled" },
{ "ER_GTID_START_FROM_BINLOG_HOLE", 1951, "The binlog on the master is missing the GTID %u-%u-%llu requested by the slave (even though a subsequent sequence number does exist), and GTID strict mode is enabled" },
{ "ER_SLAVE_UNEXPECTED_MASTER_SWITCH", 1952, "Unexpected GTID received from master after reconnect. This normally indicates that the master server was replaced without restarting the slave threads. %s" },
{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO", 1953, "Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction" },
{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO", 1954, "Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a stored function or trigger" },
{ "ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2", 1955, "Connecting slave requested to start from GTID %u-%u-%llu, which is not in the master\'s binlog. Since the master\'s binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactions" },
{ "ER_BINLOG_MUST_BE_EMPTY", 1956, "This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log" },
{ "ER_NO_SUCH_QUERY", 1957, "Unknown query id: %lld" },
{ "ER_BAD_BASE64_DATA", 1958, "Bad base64 data as position %u" },
{ "ER_INVALID_ROLE", 1959, "Invalid role specification %`s" },
{ "ER_INVALID_CURRENT_USER", 1960, "The current user is invalid" },
{ "ER_CANNOT_GRANT_ROLE", 1961, "Cannot grant role \'%s\' to: %s" },
{ "ER_CANNOT_REVOKE_ROLE", 1962, "Cannot revoke role \'%s\' from: %s" },
{ "ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE", 1963, "Cannot change @@slave_parallel_threads while another change is in progress" },
{ "ER_PRIOR_COMMIT_FAILED", 1964, "Commit failed due to failure of an earlier commit on which this one depends" },
{ "ER_IT_IS_A_VIEW", 1965, "\'%-.192s\' is a view" },
{ "ER_SLAVE_SKIP_NOT_IN_GTID", 1966, "When using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position" },
{ "ER_TABLE_DEFINITION_TOO_BIG", 1967, "The definition for table %`s is too big" },
{ "ER_PLUGIN_INSTALLED", 1968, "Plugin \'%-.192s\' already installed" },
{ "ER_STATEMENT_TIMEOUT", 1969, "Query execution was interrupted (max_statement_time exceeded)" },
{ "ER_SUBQUERIES_NOT_SUPPORTED", 1970, "%s does not support subqueries or stored functions" },
{ "ER_SET_STATEMENT_NOT_SUPPORTED", 1971, "The system variable %.200s cannot be set in SET STATEMENT." },
{ "ER_UNUSED_9", 1972, "You should never see it" },
{ "ER_USER_CREATE_EXISTS", 1973, "Can\'t create user \'%-.64s\'@\'%-.64s\'; it already exists" },
{ "ER_USER_DROP_EXISTS", 1974, "Can\'t drop user \'%-.64s\'@\'%-.64s\'; it doesn\'t exist" },
{ "ER_ROLE_CREATE_EXISTS", 1975, "Can\'t create role \'%-.64s\'; it already exists" },
{ "ER_ROLE_DROP_EXISTS", 1976, "Can\'t drop role \'%-.64s\'; it doesn\'t exist" },
{ "ER_CANNOT_CONVERT_CHARACTER", 1977, "Cannot convert \'%s\' character 0x%-.64s to \'%s\'" },
{ "ER_INVALID_DEFAULT_VALUE_FOR_FIELD", 1978, "Incorrect default value \'%-.128T\' for column \'%.192s\'" },
{ "ER_KILL_QUERY_DENIED_ERROR", 1979, "You are not owner of query %lld" },
{ "ER_NO_EIS_FOR_FIELD", 1980, "Engine-independent statistics are not collected for column \'%s\'" },
{ "ER_WARN_AGGFUNC_DEPENDENCE", 1981, "Aggregate function \'%-.192s)\' of SELECT #%d belongs to SELECT #%d" },
{ "WARN_INNODB_PARTITION_OPTION_IGNORED", 1982, "<%-.64s> option ignored for InnoDB partition" },
{ "ER_FILE_CORRUPT", 3000, "File %s is corrupted" },
{ "ER_ERROR_ON_MASTER", 3001, "Query partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:\'%s\'" },
{ "ER_INCONSISTENT_ERROR", 3002, "Query caused different errors on master and slave. Error on master: message (format)=\'%s\' error code=%d; Error on slave:actual message=\'%s\', error code=%d. Default database:\'%s\'. Query:\'%s\'" },
{ "ER_STORAGE_ENGINE_NOT_LOADED", 3003, "Storage engine for table \'%s\'.\'%s\' is not loaded." },
{ "ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER", 3004, "GET STACKED DIAGNOSTICS when handler not active" },
{ "ER_WARN_LEGACY_SYNTAX_CONVERTED", 3005, "%s is no longer supported. The statement was converted to %s." },
{ "ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN", 3006, "Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave." },
{ "ER_CANNOT_DISCARD_TEMPORARY_TABLE", 3007, "Cannot DISCARD/IMPORT tablespace associated with temporary table" },
{ "ER_FK_DEPTH_EXCEEDED", 3008, "Foreign key cascade delete/update exceeds max depth of %d." },
{ "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2", 3009, "Column count of %s.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error." },
{ "ER_WARN_TRIGGER_DOESNT_HAVE_CREATED", 3010, "Trigger %s.%s.%s does not have CREATED attribute." },
{ "ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL", 3011, "Referenced trigger \'%s\' for the given action time and event type does not exist." },
{ "ER_EXPLAIN_NOT_SUPPORTED", 3012, "EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACE" },
{ "ER_INVALID_FIELD_SIZE", 3013, "Invalid size for column \'%-.192s\'." },
{ "ER_MISSING_HA_CREATE_OPTION", 3014, "Table storage engine \'%-.64s\' found required create option missing" },
{ "ER_ENGINE_OUT_OF_MEMORY", 3015, "Out of memory in storage engine \'%-.64s\'." },
{ "ER_PASSWORD_EXPIRE_ANONYMOUS_USER", 3016, "The password for anonymous user cannot be expired." },
{ "ER_SLAVE_SQL_THREAD_MUST_STOP", 3017, "This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD first" },
{ "ER_NO_FT_MATERIALIZED_SUBQUERY", 3018, "Cannot create FULLTEXT index on materialized subquery" },
{ "ER_INNODB_UNDO_LOG_FULL", 3019, "Undo Log error: %s" },
{ "ER_INVALID_ARGUMENT_FOR_LOGARITHM", 3020, "Invalid argument for logarithm" },
{ "ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP", 3021, "This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL \'%s\' first." },
{ "ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO", 3022, "This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0." },
{ "ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS", 3023, "CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file." },
{ "ER_UNUSED_1", 3024, "You should never see it" },
{ "ER_NON_RO_SELECT_DISABLE_TIMER", 3025, "Select is not a read only statement, disabling timer" },
{ "ER_DUP_LIST_ENTRY", 3026, "Duplicate entry \'%-.192s\'." },
{ "ER_SQL_MODE_NO_EFFECT", 3027, "\'%s\' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead." },
{ "ER_AGGREGATE_ORDER_FOR_UNION", 3028, "Expression #%u of ORDER BY contains aggregate function and applies to a UNION" },
{ "ER_AGGREGATE_ORDER_NON_AGG_QUERY", 3029, "Expression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated query" },
{ "ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR", 3030, "Slave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well." },
{ "ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER", 3031, "slave_preserve_commit_order is not supported %s." },
{ "ER_SERVER_OFFLINE_MODE", 3032, "The server is currently in offline mode" },
{ "ER_GIS_DIFFERENT_SRIDS", 3033, "Binary geometry function %s given two geometries of different srids: %u and %u, which should have been identical." },
{ "ER_GIS_UNSUPPORTED_ARGUMENT", 3034, "Calling geometry function %s with unsupported types of arguments." },
{ "ER_GIS_UNKNOWN_ERROR", 3035, "Unknown GIS error occurred in function %s." },
{ "ER_GIS_UNKNOWN_EXCEPTION", 3036, "Unknown exception caught in GIS function %s." },
{ "ER_GIS_INVALID_DATA", 3037, "Invalid GIS data provided to function %s." },
{ "ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION", 3038, "The geometry has no data in function %s." },
{ "ER_BOOST_GEOMETRY_CENTROID_EXCEPTION", 3039, "Unable to calculate centroid because geometry is empty in function %s." },
{ "ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION", 3040, "Geometry overlay calculation error: geometry data is invalid in function %s." },
{ "ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION", 3041, "Geometry turn info calculation error: geometry data is invalid in function %s." },
{ "ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION", 3042, "Analysis procedures of intersection points interrupted unexpectedly in function %s." },
{ "ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION", 3043, "Unknown exception thrown in function %s." },
{ "ER_STD_BAD_ALLOC_ERROR", 3044, "Memory allocation error: %-.256s in function %s." },
{ "ER_STD_DOMAIN_ERROR", 3045, "Domain error: %-.256s in function %s." },
{ "ER_STD_LENGTH_ERROR", 3046, "Length error: %-.256s in function %s." },
{ "ER_STD_INVALID_ARGUMENT", 3047, "Invalid argument error: %-.256s in function %s." },
{ "ER_STD_OUT_OF_RANGE_ERROR", 3048, "Out of range error: %-.256s in function %s." },
{ "ER_STD_OVERFLOW_ERROR", 3049, "Overflow error: %-.256s in function %s." },
{ "ER_STD_RANGE_ERROR", 3050, "Range error: %-.256s in function %s." },
{ "ER_STD_UNDERFLOW_ERROR", 3051, "Underflow error: %-.256s in function %s." },
{ "ER_STD_LOGIC_ERROR", 3052, "Logic error: %-.256s in function %s." },
{ "ER_STD_RUNTIME_ERROR", 3053, "Runtime error: %-.256s in function %s." },
{ "ER_STD_UNKNOWN_EXCEPTION", 3054, "Unknown exception: %-.384s in function %s." },
{ "ER_GIS_DATA_WRONG_ENDIANESS", 3055, "Geometry byte string must be little endian." },
{ "ER_CHANGE_MASTER_PASSWORD_LENGTH", 3056, "The password provided for the replication user exceeds the maximum length of 32 characters" },
{ "ER_USER_LOCK_WRONG_NAME", 3057, "Incorrect user-level lock name \'%-.192s\'." },
{ "ER_USER_LOCK_DEADLOCK", 3058, "Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition." },
{ "ER_REPLACE_INACCESSIBLE_ROWS", 3059, "REPLACE cannot be executed as it requires deleting rows that are not in the view" },
{ "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS", 3060, "Do not support online operation on table with GIS index" },
{ "ER_UNUSED_26", 4000, "This error never happens" },
{ "ER_UNUSED_27", 4001, "This error never happens" },
{ "ER_WITH_COL_WRONG_LIST", 4002, "WITH column list and SELECT field list have different column counts" },
{ "ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE", 4003, "Too many WITH elements in WITH clause" },
{ "ER_DUP_QUERY_NAME", 4004, "Duplicate query name %`-.64s in WITH clause" },
{ "ER_RECURSIVE_WITHOUT_ANCHORS", 4005, "No anchors for recursive WITH element \'%s\'" },
{ "ER_UNACCEPTABLE_MUTUAL_RECURSION", 4006, "Unacceptable mutual recursion with anchored table \'%s\'" },
{ "ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED", 4007, "Reference to recursive WITH table \'%s\' in materialized derived" },
{ "ER_NOT_STANDARD_COMPLIANT_RECURSIVE", 4008, "Restrictions imposed on recursive definitions are violated for table \'%s\'" },
{ "ER_WRONG_WINDOW_SPEC_NAME", 4009, "Window specification with name \'%s\' is not defined" },
{ "ER_DUP_WINDOW_NAME", 4010, "Multiple window specifications with the same name \'%s\'" },
{ "ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC", 4011, "Window specification referencing another one \'%s\' cannot contain partition list" },
{ "ER_ORDER_LIST_IN_REFERENCING_WINDOW_SPEC", 4012, "Referenced window specification \'%s\' already contains order list" },
{ "ER_WINDOW_FRAME_IN_REFERENCED_WINDOW_SPEC", 4013, "Referenced window specification \'%s\' cannot contain window frame" },
{ "ER_BAD_COMBINATION_OF_WINDOW_FRAME_BOUND_SPECS", 4014, "Unacceptable combination of window frame bound specifications" },
{ "ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION", 4015, "Window function is allowed only in SELECT list and ORDER BY clause" },
{ "ER_WINDOW_FUNCTION_IN_WINDOW_SPEC", 4016, "Window function is not allowed in window specification" },
{ "ER_NOT_ALLOWED_WINDOW_FRAME", 4017, "Window frame is not allowed with \'%s\'" },
{ "ER_NO_ORDER_LIST_IN_WINDOW_SPEC", 4018, "No order list in window specification for \'%s\'" },
{ "ER_RANGE_FRAME_NEEDS_SIMPLE_ORDERBY", 4019, "RANGE-type frame requires ORDER BY clause with single sort key" },
{ "ER_WRONG_TYPE_FOR_ROWS_FRAME", 4020, "Integer is required for ROWS-type frame" },
{ "ER_WRONG_TYPE_FOR_RANGE_FRAME", 4021, "Numeric datatype is required for RANGE-type frame" },
{ "ER_FRAME_EXCLUSION_NOT_SUPPORTED", 4022, "Frame exclusion is not supported yet" },
{ "ER_WINDOW_FUNCTION_DONT_HAVE_FRAME", 4023, "This window function may not have a window frame" },
{ "ER_INVALID_NTILE_ARGUMENT", 4024, "Argument of NTILE must be greater than 0" },
{ "ER_CONSTRAINT_FAILED", 4025, "CONSTRAINT %`s failed for %`-.192s.%`-.192s" },
{ "ER_EXPRESSION_IS_TOO_BIG", 4026, "Expression in the %s clause is too big" },
{ "ER_ERROR_EVALUATING_EXPRESSION", 4027, "Got an error evaluating stored expression %s" },
{ "ER_CALCULATING_DEFAULT_VALUE", 4028, "Got an error when calculating default value for %`s" },
{ "ER_EXPRESSION_REFERS_TO_UNINIT_FIELD", 4029, "Expression for field %`-.64s is referring to uninitialized field %`s" },
{ "ER_PARTITION_DEFAULT_ERROR", 4030, "Only one DEFAULT partition allowed" },
{ "ER_REFERENCED_TRG_DOES_NOT_EXIST", 4031, "Referenced trigger \'%s\' for the given action time and event type does not exist" },
{ "ER_INVALID_DEFAULT_PARAM", 4032, "Default/ignore value is not supported for such parameter usage" },
{ "ER_BINLOG_NON_SUPPORTED_BULK", 4033, "Only row based replication supported for bulk operations" },
{ "ER_BINLOG_UNCOMPRESS_ERROR", 4034, "Uncompress the compressed binlog failed" },
{ "ER_JSON_BAD_CHR", 4035, "Broken JSON string in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_NOT_JSON_CHR", 4036, "Character disallowed in JSON in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_EOS", 4037, "Unexpected end of JSON text in argument %d to function \'%s\'" },
{ "ER_JSON_SYNTAX", 4038, "Syntax error in JSON text in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_ESCAPING", 4039, "Incorrect escaping in JSON text in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_DEPTH", 4040, "Limit of %d on JSON nested structures depth is reached in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_PATH_EOS", 4041, "Unexpected end of JSON path in argument %d to function \'%s\'" },
{ "ER_JSON_PATH_SYNTAX", 4042, "Syntax error in JSON path in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_PATH_DEPTH", 4043, "Limit of %d on JSON path depth is reached in argument %d to function \'%s\' at position %d" },
{ "ER_JSON_PATH_NO_WILDCARD", 4044, "Wildcards in JSON path not allowed in argument %d to function \'%s\'" },
{ "ER_JSON_PATH_ARRAY", 4045, "JSON path should end with an array identifier in argument %d to function \'%s\'" },
{ "ER_JSON_ONE_OR_ALL", 4046, "Argument 2 to function \'%s\' must be \"one\" or \"all\"." },
{ "ER_UNSUPPORTED_COMPRESSED_TABLE", 4047, "InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE." },
{ "ER_GEOJSON_INCORRECT", 4048, "Incorrect GeoJSON format specified for st_geomfromgeojson function." },
{ "ER_GEOJSON_TOO_FEW_POINTS", 4049, "Incorrect GeoJSON format - too few points for linestring specified." },
{ "ER_GEOJSON_NOT_CLOSED", 4050, "Incorrect GeoJSON format - polygon not closed." },
{ "ER_JSON_PATH_EMPTY", 4051, "Path expression \'$\' is not allowed in argument %d to function \'%s\'." },
{ "ER_SLAVE_SAME_ID", 4052, "A slave with the same server_uuid/server_id as this slave has connected to the master" },
{ "ER_FLASHBACK_NOT_SUPPORTED", 4053, "Flashback does not support %s %s" },
{ "ER_KEYS_OUT_OF_ORDER", 4054, "Keys are out order during bulk load" },
{ "ER_OVERLAPPING_KEYS", 4055, "Bulk load rows overlap existing rows" },
{ "ER_REQUIRE_ROW_BINLOG_FORMAT", 4056, "Can\'t execute updates on master with binlog_format != ROW." },
{ "ER_ISOLATION_MODE_NOT_SUPPORTED", 4057, "MyRocks supports only READ COMMITTED and REPEATABLE READ isolation levels. Please change from current isolation level %s" },
{ "ER_ON_DUPLICATE_DISABLED", 4058, "When unique checking is disabled in MyRocks, INSERT,UPDATE,LOAD statements with clauses that update or replace the key (i.e. INSERT ON DUPLICATE KEY UPDATE, REPLACE) are not allowed. Query: %s" },
{ "ER_UPDATES_WITH_CONSISTENT_SNAPSHOT", 4059, "Can\'t execute updates when you started a transaction with START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT." },
{ "ER_ROLLBACK_ONLY", 4060, "This transaction was rolled back and cannot be committed. Only supported operation is to roll it back, so all pending changes will be discarded. Please restart another transaction." },
{ "ER_ROLLBACK_TO_SAVEPOINT", 4061, "MyRocks currently does not support ROLLBACK TO SAVEPOINT if modifying rows." },
{ "ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT", 4062, "Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in RocksDB Storage Engine." },
{ "ER_UNSUPPORTED_COLLATION", 4063, "Unsupported collation on string indexed column %s.%s Use binary collation (%s)." },
{ "ER_METADATA_INCONSISTENCY", 4064, "Table \'%s\' does not exist, but metadata information exists inside MyRocks. This is a sign of data inconsistency. Please check if \'%s.frm\' exists, and try to restore it if it does not exist." },
{ "ER_CF_DIFFERENT", 4065, "Column family (\'%s\') flag (%d) is different from an existing flag (%d). Assign a new CF flag, or do not change existing CF flag." },
{ "ER_RDB_TTL_DURATION_FORMAT", 4066, "TTL duration (%s) in MyRocks must be an unsigned non-null 64-bit integer." },
{ "ER_RDB_STATUS_GENERAL", 4067, "Status error %d received from RocksDB: %s" },
{ "ER_RDB_STATUS_MSG", 4068, "%s, Status error %d received from RocksDB: %s" },
{ "ER_RDB_TTL_UNSUPPORTED", 4069, "TTL support is currently disabled when table has a hidden PK." },
{ "ER_RDB_TTL_COL_FORMAT", 4070, "TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration." },
{ "ER_PER_INDEX_CF_DEPRECATED", 4071, "The per-index column family option has been deprecated" },
{ "ER_KEY_CREATE_DURING_ALTER", 4072, "MyRocks failed creating new key definitions during alter." },
{ "ER_SK_POPULATE_DURING_ALTER", 4073, "MyRocks failed populating secondary key during alter." },
{ "ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG", 4074, "Window functions can not be used as arguments to group functions." },
{ "ER_NET_OK_PACKET_TOO_LARGE", 4075, "OK packet too large" },
{ "ER_GEOJSON_EMPTY_COORDINATES", 4076, "Incorrect GeoJSON format - empty \'coordinates\' array." },
{ "ER_MYROCKS_CANT_NOPAD_COLLATION", 4077, "MyRocks doesn\'t currently support collations with \"No pad\" attribute." },
{ "ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION", 4078, "Illegal parameter data types %s and %s for operation \'%s\'" },
{ "ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION", 4079, "Illegal parameter data type %s for operation \'%s\'" },
{ "ER_WRONG_PARAMCOUNT_TO_CURSOR", 4080, "Incorrect parameter count to cursor \'%-.192s\'" },
{ "ER_UNKNOWN_STRUCTURED_VARIABLE", 4081, "Unknown structured system variable or ROW routine variable \'%-.*s\'" },
{ "ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD", 4082, "Row variable \'%-.192s\' does not have a field \'%-.192s\'" },
{ "ER_END_IDENTIFIER_DOES_NOT_MATCH", 4083, "END identifier \'%-.192s\' does not match \'%-.192s\'" },
{ "ER_SEQUENCE_RUN_OUT", 4084, "Sequence \'%-.64s.%-.64s\' has run out" },
{ "ER_SEQUENCE_INVALID_DATA", 4085, "Sequence \'%-.64s.%-.64s\' has out of range value for options" },
{ "ER_SEQUENCE_INVALID_TABLE_STRUCTURE", 4086, "Sequence \'%-.64s.%-.64s\' table structure is invalid (%s)" },
{ "ER_SEQUENCE_ACCESS_ERROR", 4087, "Sequence \'%-.64s.%-.64s\' access error" },
{ "ER_SEQUENCE_BINLOG_FORMAT", 4088, "Sequences requires binlog_format mixed or row" },
{ "ER_NOT_SEQUENCE", 4089, "\'%-.64s.%-.64s\' is not a SEQUENCE" },
{ "ER_NOT_SEQUENCE2", 4090, "\'%-.192s\' is not a SEQUENCE" },
{ "ER_UNKNOWN_SEQUENCES", 4091, "Unknown SEQUENCE: \'%-.300s\'" },
{ "ER_UNKNOWN_VIEW", 4092, "Unknown VIEW: \'%-.300s\'" },
{ "ER_WRONG_INSERT_INTO_SEQUENCE", 4093, "Wrong INSERT into a SEQUENCE. One can only do single table INSERT into a sequence object (like with mariadb-dump).  If you want to change the SEQUENCE, use ALTER SEQUENCE instead." },
{ "ER_SP_STACK_TRACE", 4094, "At line %u in %s" },
{ "ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY", 4095, "Subroutine \'%-.192s\' is declared in the package specification but is not defined in the package body" },
{ "ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED", 4096, "Subroutine \'%-.192s\' has a forward declaration but is not defined" },
{ "ER_COMPRESSED_COLUMN_USED_AS_KEY", 4097, "Compressed column \'%-.192s\' can\'t be used in key specification" },
{ "ER_UNKNOWN_COMPRESSION_METHOD", 4098, "Unknown compression method: %s" },
{ "ER_WRONG_NUMBER_OF_VALUES_IN_TVC", 4099, "The used table value constructor has a different number of values" },
{ "ER_FIELD_REFERENCE_IN_TVC", 4100, "Field reference \'%-.192s\' can\'t be used in table value constructor" },
{ "ER_WRONG_TYPE_FOR_PERCENTILE_FUNC", 4101, "Numeric datatype is required for %s function" },
{ "ER_ARGUMENT_NOT_CONSTANT", 4102, "Argument to the %s function is not a constant for a partition" },
{ "ER_ARGUMENT_OUT_OF_RANGE", 4103, "Argument to the %s function does not belong to the range [0,1]" },
{ "ER_WRONG_TYPE_OF_ARGUMENT", 4104, "%s function only accepts arguments that can be converted to numerical types" },
{ "ER_NOT_AGGREGATE_FUNCTION", 4105, "Aggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong context" },
{ "ER_INVALID_AGGREGATE_FUNCTION", 4106, "Aggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate function" },
{ "ER_INVALID_VALUE_TO_LIMIT", 4107, "Limit only accepts integer values" },
{ "ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT", 4108, "Invisible column %`s must have a default value" },
{ "ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING", 4109, "Rows matched: %ld  Changed: %ld  Inserted: %ld  Warnings: %ld" },
{ "ER_VERS_FIELD_WRONG_TYPE", 4110, "%`s must be of type %s for system-versioned table %`s" },
{ "ER_VERS_ENGINE_UNSUPPORTED", 4111, "Transaction-precise system versioning for %`s is not supported" },
{ "ER_UNUSED_23", 4112, "You should never see it" },
{ "ER_PARTITION_WRONG_TYPE", 4113, "Wrong partitioning type, expected type: %`s" },
{ "WARN_VERS_PART_FULL", 4114, "Versioned table %`s.%`s: last HISTORY partition (%`s) is out of %s, need more HISTORY partitions" },
{ "WARN_VERS_PARAMETERS", 4115, "Maybe missing parameters: %s" },
{ "ER_VERS_DROP_PARTITION_INTERVAL", 4116, "Can only drop oldest partitions when rotating by INTERVAL" },
{ "ER_UNUSED_25", 4117, "You should never see it" },
{ "WARN_VERS_PART_NON_HISTORICAL", 4118, "Partition %`s contains non-historical data" },
{ "ER_VERS_ALTER_NOT_ALLOWED", 4119, "Not allowed for system-versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER." },
{ "ER_VERS_ALTER_ENGINE_PROHIBITED", 4120, "Not allowed for system-versioned %`s.%`s. Change to/from native system versioning engine is not supported." },
{ "ER_VERS_RANGE_PROHIBITED", 4121, "SYSTEM_TIME range selector is not allowed" },
{ "ER_CONFLICTING_FOR_SYSTEM_TIME", 4122, "Conflicting FOR SYSTEM_TIME clauses in WITH RECURSIVE" },
{ "ER_VERS_TABLE_MUST_HAVE_COLUMNS", 4123, "Table %`s must have at least one versioned column" },
{ "ER_VERS_NOT_VERSIONED", 4124, "Table %`s is not system-versioned" },
{ "ER_MISSING", 4125, "Wrong parameters for %`s: missing \'%s\'" },
{ "ER_VERS_PERIOD_COLUMNS", 4126, "PERIOD FOR SYSTEM_TIME must use columns %`s and %`s" },
{ "ER_PART_WRONG_VALUE", 4127, "Wrong parameters for partitioned %`s: wrong value for \'%s\'" },
{ "ER_VERS_WRONG_PARTS", 4128, "Wrong partitions for %`s: must have at least one HISTORY and exactly one last CURRENT" },
{ "ER_VERS_NO_TRX_ID", 4129, "TRX_ID %llu not found in `mysql.transaction_registry`" },
{ "ER_VERS_ALTER_SYSTEM_FIELD", 4130, "Can not change system versioning field %`s" },
{ "ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION", 4131, "Can not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIME" },
{ "ER_VERS_DB_NOT_SUPPORTED", 4132, "System-versioned tables in the %`s database are not supported" },
{ "ER_VERS_TRT_IS_DISABLED", 4133, "Transaction registry is disabled" },
{ "ER_VERS_DUPLICATE_ROW_START_END", 4134, "Duplicate ROW %s column %`s" },
{ "ER_VERS_ALREADY_VERSIONED", 4135, "Table %`s is already system-versioned" },
{ "ER_UNUSED_24", 4136, "You should never see it" },
{ "ER_VERS_NOT_SUPPORTED", 4137, "System-versioned tables do not support %s" },
{ "ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED", 4138, "Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END" },
{ "ER_INDEX_FILE_FULL", 4139, "The index file for table \'%-.192s\' is full" },
{ "ER_UPDATED_COLUMN_ONLY_ONCE", 4140, "The column %`s.%`s cannot be changed more than once in a single UPDATE statement" },
{ "ER_EMPTY_ROW_IN_TVC", 4141, "Row with no elements is not allowed in table value constructor in this context" },
{ "ER_VERS_QUERY_IN_PARTITION", 4142, "SYSTEM_TIME partitions in table %`s does not support historical query" },
{ "ER_KEY_DOESNT_SUPPORT", 4143, "%s index %`s does not support this operation" },
{ "ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD", 4144, "Changing table options requires the table to be rebuilt" },
{ "ER_BACKUP_LOCK_IS_ACTIVE", 4145, "Can\'t execute the command as you have a BACKUP STAGE active" },
{ "ER_BACKUP_NOT_RUNNING", 4146, "You must start backup with \"BACKUP STAGE START\"" },
{ "ER_BACKUP_WRONG_STAGE", 4147, "Backup stage \'%s\' is same or before current backup stage \'%s\'" },
{ "ER_BACKUP_STAGE_FAILED", 4148, "Backup stage \'%s\' failed" },
{ "ER_BACKUP_UNKNOWN_STAGE", 4149, "Unknown backup stage: \'%s\'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or END" },
{ "ER_USER_IS_BLOCKED", 4150, "User is blocked because of too many credential errors; unblock with \'ALTER USER / FLUSH PRIVILEGES\'" },
{ "ER_ACCOUNT_HAS_BEEN_LOCKED", 4151, "Access denied, this account is locked" },
{ "ER_PERIOD_TEMPORARY_NOT_ALLOWED", 4152, "Application-time period table cannot be temporary" },
{ "ER_PERIOD_TYPES_MISMATCH", 4153, "Fields of PERIOD FOR %`s have different types" },
{ "ER_MORE_THAN_ONE_PERIOD", 4154, "Cannot specify more than one application-time period" },
{ "ER_PERIOD_FIELD_WRONG_ATTRIBUTES", 4155, "Period field %`s cannot be %s" },
{ "ER_PERIOD_NOT_FOUND", 4156, "Period %`s is not found in table" },
{ "ER_PERIOD_COLUMNS_UPDATED", 4157, "Column %`s used in period %`s specified in update SET list" },
{ "ER_PERIOD_CONSTRAINT_DROP", 4158, "Can\'t DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for this" },
{ "ER_TOO_LONG_KEYPART", 4159, "Specified key part was too long; max key part length is %u bytes" },
{ "ER_TOO_LONG_DATABASE_COMMENT", 4160, "Comment for database \'%-.64s\' is too long (max = %u)" },
{ "ER_UNKNOWN_DATA_TYPE", 4161, "Unknown data type: \'%-.64s\'" },
{ "ER_UNKNOWN_OPERATOR", 4162, "Operator does not exist: \'%-.128s\'" },
{ "ER_WARN_HISTORY_ROW_START_TIME", 4163, "Table `%s.%s` history row start \'%s\' is later than row end \'%s\'" },
{ "ER_PART_STARTS_BEYOND_INTERVAL", 4164, "%`s: STARTS is later than query time, first history partition may exceed INTERVAL value" },
{ "ER_GALERA_REPLICATION_NOT_SUPPORTED", 4165, "Galera replication not supported" },
{ "ER_LOAD_INFILE_CAPABILITY_DISABLED", 4166, "The used command is not allowed because the MariaDB server or client has disabled the local infile capability" },
{ "ER_NO_SECURE_TRANSPORTS_CONFIGURED", 4167, "No secure transports are configured, unable to set --require_secure_transport=ON" },
{ "ER_SLAVE_IGNORED_SHARED_TABLE", 4168, "Slave SQL thread ignored the \'%s\' because table is shared" },
{ "ER_NO_AUTOINCREMENT_WITH_UNIQUE", 4169, "AUTO_INCREMENT column %`s cannot be used in the UNIQUE index %`s" },
{ "ER_KEY_CONTAINS_PERIOD_FIELDS", 4170, "Key %`s cannot explicitly include column %`s" },
{ "ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS", 4171, "Key %`s cannot have WITHOUT OVERLAPS" },
{ "ER_NOT_ALLOWED_IN_THIS_CONTEXT", 4172, "\'%-.128s\' is not allowed in this context" },
{ "ER_DATA_WAS_COMMITED_UNDER_ROLLBACK", 4173, "Engine %s does not support rollback. Changes were committed during rollback call" },
{ "ER_PK_INDEX_CANT_BE_IGNORED", 4174, "A primary key cannot be marked as IGNORE" },
{ "ER_BINLOG_UNSAFE_SKIP_LOCKED", 4175, "SKIP LOCKED makes this statement unsafe" },
{ "ER_JSON_TABLE_ERROR_ON_FIELD", 4176, "Field \'%s\' can\'t be set for JSON_TABLE \'%s\'." },
{ "ER_JSON_TABLE_ALIAS_REQUIRED", 4177, "Every table function must have an alias." },
{ "ER_JSON_TABLE_SCALAR_EXPECTED", 4178, "Can\'t store an array or an object in the scalar column \'%s\' of JSON_TABLE \'%s\'." },
{ "ER_JSON_TABLE_MULTIPLE_MATCHES", 4179, "Can\'t store multiple matches of the path in the column \'%s\' of JSON_TABLE \'%s\'." },
{ "ER_WITH_TIES_NEEDS_ORDER", 4180, "FETCH ... WITH TIES requires ORDER BY clause to be present" },
{ "ER_REMOVED_ORPHAN_TRIGGER", 4181, "Dropped orphan trigger \'%-.64s\', originally created for table: \'%-.192s\'" },
{ "ER_STORAGE_ENGINE_DISABLED", 4182, "Storage engine %s is disabled" },
server/my_byteorder.h000064400000004005150400263600010722 0ustar00#ifndef MY_BYTEORDER_INCLUDED
#define MY_BYTEORDER_INCLUDED

/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.

   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 */


/*
  Macro for reading 32-bit integer from network byte order (big-endian)
  from an unaligned memory location.
*/
#define int4net(A)        (int32) (((uint32) ((uchar) (A)[3]))        | \
                                  (((uint32) ((uchar) (A)[2])) << 8)  | \
                                  (((uint32) ((uchar) (A)[1])) << 16) | \
                                  (((uint32) ((uchar) (A)[0])) << 24))

/*
  Function-like macros for reading and storing in machine independent
  format (low byte first). There are 'korr' (assume 'corrector') variants
  for integer types, but 'get' (assume 'getter') for floating point types.
*/
#if (defined(__i386__) || defined(_M_IX86)) && !defined(WITH_UBSAN)
#define MY_BYTE_ORDER_ARCH_OPTIMIZED
#include "byte_order_generic_x86.h"
#elif (defined(__x86_64__) || defined (_M_X64)) && !defined(WITH_UBSAN)
#include "byte_order_generic_x86_64.h"
#else
#include "byte_order_generic.h"
#endif

/*
  Function-like macros for reading and storing in machine format from/to
  short/long to/from some place in memory V should be a variable (not on
  a register) and M a pointer to byte.
*/
#ifdef WORDS_BIGENDIAN
#include "big_endian.h"
#else
#include "little_endian.h"
#endif

#endif /* MY_BYTEORDER_INCLUDED */
server/mysql_time.h000064400000004564150400263600010413 0ustar00/* Copyright (c) 2004, 2006 MySQL AB
   Use is subject to license terms

 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef _mysql_time_h_
#define _mysql_time_h_

/*
  Portable time_t replacement.
  Should be signed and hold seconds for 1902 -- 2038-01-19 range
  i.e at least a 32bit variable

  Using the system built in time_t is not an option as
  we rely on the above requirements in the time functions   
*/
typedef long my_time_t;


/*
  Time declarations shared between the server and client API:
  you should not add anything to this header unless it's used
  (and hence should be visible) in mysql.h.
  If you're looking for a place to add new time-related declaration,
  it's most likely my_time.h. See also "C API Handling of Date
  and Time Values" chapter in documentation.
*/

enum enum_mysql_timestamp_type
{
  MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
  MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
};


/*
  Structure which is used to represent datetime values inside MySQL.

  We assume that values in this structure are normalized, i.e. year <= 9999,
  month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
  in server such as my_system_gmt_sec() or make_time() family of functions
  rely on this (actually now usage of make_*() family relies on a bit weaker
  restriction). Also functions that produce MYSQL_TIME as result ensure this.
  There is one exception to this rule though if this structure holds time
  value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold
  bigger values.
*/
typedef struct st_mysql_time
{
  unsigned int  year, month, day, hour, minute, second;
  unsigned long second_part;
  my_bool       neg;
  enum enum_mysql_timestamp_type time_type;
} MYSQL_TIME;

#endif /* _mysql_time_h_ */
server/pack.h000064400000002121150400263600007131 0ustar00/* Copyright (c) 2016, MariaDB

   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-1301  USA */

#ifdef __cplusplus
extern "C" {
#endif

ulong net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
my_ulonglong safe_net_field_length_ll(uchar **packet, size_t packet_len);
uchar *net_store_length(uchar *pkg, ulonglong length);
uchar *safe_net_store_length(uchar *pkg, size_t pkg_len, ulonglong length);
unsigned int net_length_size(ulonglong num);

#ifdef __cplusplus
}
#endif
server/keycache.h000064400000021173150400263600007777 0ustar00/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/* Key cache variable structures */

#ifndef _keycache_h
#define _keycache_h

#include "my_sys.h"                             /* flush_type */

C_MODE_START

/* 
  Currently the default key cache is created as non-partitioned at 
  the start of the server unless the server is started with the parameter 
  --key-cache-partitions that is greater than 0
*/

#define DEFAULT_KEY_CACHE_PARTITIONS    0

/* 
  MAX_KEY_CACHE_PARTITIONS cannot be greater than 
  sizeof(MYISAM_SHARE::dirty_part_map)
  Currently sizeof(MYISAM_SHARE::dirty_part_map)=sizeof(ulonglong)
*/

#define MAX_KEY_CACHE_PARTITIONS    64

/* The structure to get statistical data about a key cache */

typedef struct st_key_cache_statistics
{
  ulonglong mem_size;       /* memory for cache buffers/auxiliary structures */
  ulonglong block_size;     /* size of the each buffers in the key cache     */
  ulonglong blocks_used;    /* maximum number of used blocks/buffers         */ 
  ulonglong blocks_unused;  /* number of currently unused blocks             */
  ulonglong blocks_changed; /* number of currently dirty blocks              */
  ulonglong blocks_warm;    /* number of blocks in warm sub-chain            */
  ulonglong read_requests;  /* number of read requests (read hits)           */
  ulonglong reads;        /* number of actual reads from files into buffers  */
  ulonglong write_requests; /* number of write requests (write hits)         */
  ulonglong writes;       /* number of actual writes from buffers into files */
} KEY_CACHE_STATISTICS;

#define NUM_LONG_KEY_CACHE_STAT_VARIABLES 3

/* The type of a key cache object */
typedef enum key_cache_type
{
  SIMPLE_KEY_CACHE,         
  PARTITIONED_KEY_CACHE
} KEY_CACHE_TYPE;


typedef
  int    (*INIT_KEY_CACHE)  
           (void *, uint key_cache_block_size,
            size_t use_mem, uint division_limit, uint age_threshold,
            uint changed_blocks_hash_size);
typedef
  int    (*RESIZE_KEY_CACHE)
           (void *, uint key_cache_block_size,
            size_t use_mem, uint division_limit, uint age_threshold,
            uint changed_blocks_hash_size);
typedef
  void   (*CHANGE_KEY_CACHE_PARAM)
           (void *keycache_cb,
            uint division_limit, uint age_threshold);
typedef
  uchar* (*KEY_CACHE_READ)
           (void *keycache_cb,
            File file, my_off_t filepos, int level,
            uchar *buff, uint length,
            uint block_length, int return_buffer);
typedef
  int    (*KEY_CACHE_INSERT)
           (void *keycache_cb,
            File file, my_off_t filepos, int level,
            uchar *buff, uint length);
typedef
  int    (*KEY_CACHE_WRITE)
           (void *keycache_cb,
            File file, void *file_extra,
            my_off_t filepos, int level,
            uchar *buff, uint length, 
            uint block_length, int force_write);
typedef
  int    (*FLUSH_KEY_BLOCKS)
           (void *keycache_cb,
            int file, void *file_extra,
            enum flush_type type); 
typedef
  int    (*RESET_KEY_CACHE_COUNTERS)
           (const char *name, void *keycache_cb); 
typedef
  void   (*END_KEY_CACHE)
           (void *keycache_cb, my_bool cleanup);
typedef
  void   (*GET_KEY_CACHE_STATISTICS)
           (void *keycache_cb, uint partition_no, 
            KEY_CACHE_STATISTICS *key_cache_stats); 

/*
  An object of the type KEY_CACHE_FUNCS contains pointers to all functions
  from the key cache interface.
  Currently a key cache can be of two types: simple and partitioned.
  For each of them its own static structure of the type KEY_CACHE_FUNCS is
  defined . The structures contain the pointers to the implementations of
  the interface functions used by simple key caches and partitioned key
  caches respectively. Pointers to these structures are assigned to key cache
  objects at the time of their creation.
*/   

typedef struct st_key_cache_funcs 
{
  INIT_KEY_CACHE init;
  RESIZE_KEY_CACHE         resize;
  CHANGE_KEY_CACHE_PARAM   change_param;     
  KEY_CACHE_READ           read;
  KEY_CACHE_INSERT         insert;
  KEY_CACHE_WRITE          write;
  FLUSH_KEY_BLOCKS         flush;
  RESET_KEY_CACHE_COUNTERS reset_counters; 
  END_KEY_CACHE            end;
  GET_KEY_CACHE_STATISTICS get_stats; 
} KEY_CACHE_FUNCS;


typedef struct st_key_cache
{
  KEY_CACHE_TYPE key_cache_type; /* type of the key cache used for debugging */
  void *keycache_cb;             /* control block of the used key cache      */
  KEY_CACHE_FUNCS *interface_funcs; /* interface functions of the key cache  */
  ulonglong param_buff_size;     /* size the memory allocated for the cache  */
  ulonglong param_block_size;    /* size of the blocks in the key cache      */
  ulonglong param_division_limit;/* min. percentage of warm blocks           */
  ulonglong param_age_threshold; /* determines when hot block is downgraded  */
  ulonglong param_partitions;    /* number of the key cache partitions       */
  ulonglong changed_blocks_hash_size; /* number of hash buckets for changed files */
  my_bool key_cache_inited;      /* <=> key cache has been created           */
  my_bool can_be_used;           /* usage of cache for read/write is allowed */
  my_bool in_init;               /* set to 1 in MySQL during init/resize     */
  uint partitions;               /* actual number of partitions              */
  size_t key_cache_mem_size;     /* specified size of the cache memory       */
  pthread_mutex_t op_lock;       /* to serialize operations like 'resize'    */
} KEY_CACHE;


/* The default key cache */
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;

extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
			  size_t use_mem, uint division_limit,
			  uint age_threshold, uint changed_blocks_hash_size,
                          uint partitions);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
			    size_t use_mem, uint division_limit,
			    uint age_threshold, uint changed_blocks_hash_size);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
				   uint age_threshold);
extern uchar *key_cache_read(KEY_CACHE *keycache,
                            File file, my_off_t filepos, int level,
                            uchar *buff, uint length,
			    uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE *keycache,
                            File file, my_off_t filepos, int level,
                            uchar *buff, uint length);
extern int key_cache_write(KEY_CACHE *keycache,
                           File file, void *file_extra,
                           my_off_t filepos, int level,
                           uchar *buff, uint length,
			   uint block_length, int force_write);
extern int flush_key_blocks(KEY_CACHE *keycache,
                            int file, void *file_extra,
                            enum flush_type type);
extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
extern void get_key_cache_statistics(KEY_CACHE *keycache,
                                     uint partition_no, 
                                     KEY_CACHE_STATISTICS *key_cache_stats);

/* Functions to handle multiple key caches */
extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void);
extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length,
                                         KEY_CACHE *def);
extern my_bool multi_key_cache_set(const uchar *key, uint length,
				   KEY_CACHE *key_cache);
extern void multi_key_cache_change(KEY_CACHE *old_data,
				   KEY_CACHE *new_data);
extern int reset_key_cache_counters(const char *name,
                                    KEY_CACHE *key_cache, void *);
extern int repartition_key_cache(KEY_CACHE *keycache,
                                 uint key_cache_block_size,
			         size_t use_mem, 
                                 uint division_limit,
			         uint age_threshold,
                                 uint changed_blocks_hash_size,
                                 uint partitions);
C_MODE_END
#endif /* _keycache_h */
server/mariadb_capi_rename.h000064400000006532150400263600012147 0ustar00/* Copyright (c) 2022, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/* Renaming C API symbols inside server
 * client.c defines a number of functions from the C API, that are used in replication, in number of storage engine plugins, mariadb-backup.
 * That can cause a problem if a plugin loads libmariadb/libmysql or a library, that has dependency on them. The known case is ODBC driver.
 * Thus the header re-names those functions for internal use.
 */

#ifndef MARIADB_CAPI_RENAME_INCLUDED
#define MARIADB_CAPI_RENAME_INCLUDED

#if !defined(EMBEDDED_LIBRARY) && !defined(MYSQL_DYNAMIC_PLUGIN)

#define MARIADB_ADD_PREFIX(_SYMBOL) server_##_SYMBOL
#define mysql_real_connect      MARIADB_ADD_PREFIX(mysql_real_connect)
#define mysql_init              MARIADB_ADD_PREFIX(mysql_init)
#define mysql_close             MARIADB_ADD_PREFIX(mysql_close)
#define mysql_options           MARIADB_ADD_PREFIX(mysql_options)
#define mysql_load_plugin       MARIADB_ADD_PREFIX(mysql_load_plugin)
#define mysql_load_plugin_v     MARIADB_ADD_PREFIX(mysql_load_plugin_v)
#define mysql_client_find_plugin MARIADB_ADD_PREFIX(mysql_client_find_plugin)
#define mysql_real_query        MARIADB_ADD_PREFIX(mysql_real_query)
#define mysql_send_query        MARIADB_ADD_PREFIX(mysql_send_query)
#define mysql_free_result       MARIADB_ADD_PREFIX(mysql_free_result)
#define mysql_get_socket        MARIADB_ADD_PREFIX(mysql_get_socket)
#define mysql_set_character_set MARIADB_ADD_PREFIX(mysql_set_character_set)
#define mysql_real_escape_string MARIADB_ADD_PREFIX(mysql_real_escape_string)
#define mysql_get_server_version MARIADB_ADD_PREFIX(mysql_get_server_version)
#define mysql_error             MARIADB_ADD_PREFIX(mysql_error)
#define mysql_errno             MARIADB_ADD_PREFIX(mysql_errno)
#define mysql_num_fields        MARIADB_ADD_PREFIX(mysql_num_fields)
#define mysql_num_rows          MARIADB_ADD_PREFIX(mysql_num_rows)
#define mysql_options4          MARIADB_ADD_PREFIX(mysql_options4)
#define mysql_fetch_fields      MARIADB_ADD_PREFIX(mysql_fetch_fields)
#define mysql_fetch_lengths     MARIADB_ADD_PREFIX(mysql_fetch_lengths)
#define mysql_fetch_row         MARIADB_ADD_PREFIX(mysql_fetch_row)
#define mysql_affected_rows     MARIADB_ADD_PREFIX(mysql_affected_rows)
#define mysql_store_result      MARIADB_ADD_PREFIX(mysql_store_result)
#define mysql_use_result        MARIADB_ADD_PREFIX(mysql_use_result)
#define mysql_select_db         MARIADB_ADD_PREFIX(mysql_select_db)
#define mysql_get_ssl_cipher    MARIADB_ADD_PREFIX(mysql_get_ssl_cipher)
#define mysql_ssl_set           MARIADB_ADD_PREFIX(mysql_ssl_set)
#define mysql_client_register_plugin MARIADB_ADD_PREFIX(mysql_client_register_plugin)

#endif // !EMBEDDED_LIBRARY && !MYSQL_DYNAMIC_PLUGIN

#endif // !MARIADB_CAPI_RENAME_INCLUDED
server/my_dir.h000064400000007457150400263600007517 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef MY_DIR_H
#define MY_DIR_H

#include <sys/stat.h>

#ifdef	__cplusplus
extern "C" {
#endif

	/* Defines for my_dir and my_stat */

#define MY_S_IFMT	S_IFMT	/* type of file */
#define MY_S_IFDIR	S_IFDIR /* directory */
#define MY_S_IFCHR	S_IFCHR /* character special */
#define MY_S_IFBLK	S_IFBLK /* block special */
#define MY_S_IFREG	S_IFREG /* regular */
#define MY_S_IFIFO	S_IFIFO /* fifo */
#define MY_S_ISUID	S_ISUID /* set user id on execution */
#define MY_S_ISGID	S_ISGID /* set group id on execution */
#define MY_S_ISVTX	S_ISVTX /* save swapped text even after use */

#ifndef S_IREAD
#define MY_S_IREAD      S_IRUSR /* read permission, owner */
#define MY_S_IWRITE     S_IWUSR /* write permission, owner */
#define MY_S_IEXEC      S_IXUSR /* execute/search permission, owner */
#else
#define MY_S_IREAD      S_IREAD /* read permission, owner */
#define MY_S_IWRITE     S_IWRITE /* write permission, owner */
#define MY_S_IEXEC      S_IEXEC /* execute/search permission, owner */
#endif

#define MY_S_ISDIR(m)	(((m) & MY_S_IFMT) == MY_S_IFDIR)
#define MY_S_ISCHR(m)	(((m) & MY_S_IFMT) == MY_S_IFCHR)
#define MY_S_ISBLK(m)	(((m) & MY_S_IFMT) == MY_S_IFBLK)
#define MY_S_ISREG(m)	(((m) & MY_S_IFMT) == MY_S_IFREG)
#define MY_S_ISFIFO(m)	(((m) & MY_S_IFMT) == MY_S_IFIFO)

/* Ensure these doesn't clash with anything in my_sys.h */
#define MY_WANT_SORT     8192   /* my_lib; sort files */
#define MY_WANT_STAT	16384	/* my_lib; stat files */
#define MY_DONT_SORT        0

	/* typedefs for my_dir & my_stat */

#ifdef USE_MY_STAT_STRUCT

typedef struct my_stat
{
  dev_t		st_dev;		/* major & minor device numbers */
  ino_t		st_ino;		/* inode number */
  ushort	st_mode;	/* file permissions (& suid sgid .. bits) */
  short		st_nlink;	/* number of links to file */
  ushort	st_uid;		/* user id */
  ushort	st_gid;		/* group id */
  dev_t		st_rdev;	/* more major & minor device numbers (???) */
  off_t		st_size;	/* size of file */
  time_t	st_atime;	/* time for last read */
  time_t	st_mtime;	/* time for last contents modify */
  time_t	st_ctime;	/* time for last inode or contents modify */
} MY_STAT;

#else

#if defined(_MSC_VER)
#define MY_STAT struct _stati64 /* 64 bit file size */
#else
#define MY_STAT struct stat	/* Original struct has what we need */
#endif

#endif /* USE_MY_STAT_STRUCT */

/* Struct describing one file returned from my_dir */
typedef struct fileinfo
{
  char			*name;
  MY_STAT		*mystat;
} FILEINFO;

typedef struct st_my_dir	/* Struct returned from my_dir */
{
  /*
    These members are just copies of parts of DYNAMIC_ARRAY structure, 
    which is allocated right after the end of MY_DIR structure (MEM_ROOT
    for storing names is also resides there). We've left them here because
    we don't want to change code that uses my_dir.
  */
  struct fileinfo	*dir_entry;
  uint			number_of_files;
} MY_DIR;

extern MY_DIR *my_dir(const char *path,myf MyFlags);
extern void my_dirend(MY_DIR *buffer);
extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags);
extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags);

#ifdef	__cplusplus
}
#endif

#endif /* MY_DIR_H */

server/my_config.h000064400000034356150400263600010204 0ustar00/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
 
 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 */

#ifndef MY_CONFIG_H
#define MY_CONFIG_H
#define DOT_FRM_VERSION 6
/* Headers we may want to use. */
#define STDC_HEADERS 1
#define _GNU_SOURCE 1
#define HAVE_ALLOCA_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_ASM_TERMBITS_H 1
#define HAVE_CRYPT_H 1
#define HAVE_CURSES_H 1
/* #undef HAVE_BFD_H */
/* #undef HAVE_NDIR_H */
#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_EXECINFO_H 1
#define HAVE_FCNTL_H 1
#define HAVE_FCNTL_DIRECT 1
#define HAVE_FENV_H 1
#define HAVE_FLOAT_H 1
#define HAVE_FNMATCH_H 1
#define HAVE_FPU_CONTROL_H 1
#define HAVE_GETMNTENT 1
/* #undef HAVE_GETMNTENT_IN_SYS_MNTAB */
/* #undef HAVE_GETMNTINFO */
/* #undef HAVE_GETMNTINFO64 */
/* #undef HAVE_GETMNTINFO_TAKES_statvfs */
#define HAVE_GRP_H 1
/* #undef HAVE_IA64INTRIN_H */
/* #undef HAVE_IEEEFP_H */
#define HAVE_INTTYPES_H 1
/* #undef HAVE_KQUEUE */
#define HAVE_LIMITS_H 1
#define HAVE_LINK_H 1
#define HAVE_LINUX_UNISTD_H 1
#define HAVE_LINUX_MMAN_H 1
#define HAVE_LOCALE_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_PATHS_H 1
#define HAVE_POLL_H 1
#define HAVE_PWD_H 1
#define HAVE_SCHED_H 1
/* #undef HAVE_SELECT_H */
/* #undef HAVE_SOLARIS_LARGE_PAGES */
#define HAVE_STDDEF_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STDINT_H 1
/* #undef HAVE_SYNCH_H */
/* #undef HAVE_SYSENT_H */
#define HAVE_SYS_DIR_H 1
#define HAVE_SYS_FILE_H 1
/* #undef HAVE_SYS_FPU_H */
#define HAVE_SYS_IOCTL_H 1
/* #undef HAVE_SYS_MALLOC_H */
#define HAVE_SYS_MMAN_H 1
/* #undef HAVE_SYS_MNTENT_H */
/* #undef HAVE_SYS_NDIR_H */
/* #undef HAVE_SYS_PTE_H */
/* #undef HAVE_SYS_PTEM_H */
#define HAVE_SYS_PRCTL_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
/* #undef HAVE_SYS_SOCKIO_H */
#define HAVE_SYS_UTSNAME_H 1
#define HAVE_SYS_STAT_H 1
/* #undef HAVE_SYS_STREAM_H */
#define HAVE_SYS_SYSCALL_H 1
#define HAVE_SYS_TIMEB_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_UN_H 1
/* #undef HAVE_SYS_VADVISE_H */
#define HAVE_SYS_STATVFS_H 1
#define HAVE_UCONTEXT_H 1
#define HAVE_TERM_H 1
/* #undef HAVE_TERMBITS_H */
#define HAVE_TERMIOS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_TERMCAP_H 1
#define HAVE_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
/* #undef HAVE_VARARGS_H */
/* #undef HAVE_SYS_UTIME_H */
#define HAVE_SYS_WAIT_H 1
#define HAVE_SYS_PARAM_H 1

/* Libraries */
/* #undef HAVE_LIBWRAP */
#define HAVE_SYSTEMD 1
#define HAVE_SYSTEMD_SD_LISTEN_FDS_WITH_NAMES 1

/* Does "struct timespec" have a "sec" and "nsec" field? */
/* #undef HAVE_TIMESPEC_TS_SEC */

/* Readline */
/* #undef HAVE_HIST_ENTRY */
/* #undef USE_LIBEDIT_INTERFACE */
#define USE_NEW_READLINE_INTERFACE 1

#define FIONREAD_IN_SYS_IOCTL 1
#define GWINSZ_IN_SYS_IOCTL 1
/* #undef TIOCSTAT_IN_SYS_IOCTL */
/* #undef FIONREAD_IN_SYS_FILIO */

/* Functions we may want to use. */
#define HAVE_ACCEPT4 1
#define HAVE_ACCESS 1
#define HAVE_ALARM 1
#define HAVE_ALLOCA 1
/* #undef HAVE_BFILL */
#define HAVE_INDEX 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CRYPT 1
#define HAVE_CUSERID 1
#define HAVE_DLADDR 1
#define HAVE_DLERROR 1
#define HAVE_DLOPEN 1
#define HAVE_FCHMOD 1
#define HAVE_FCNTL 1
#define HAVE_FDATASYNC 1
#define HAVE_DECL_FDATASYNC 1
#define HAVE_FEDISABLEEXCEPT 1
#define HAVE_FESETROUND 1
/* #undef HAVE_FP_EXCEPT */
#define HAVE_FSEEKO 1
#define HAVE_FSYNC 1
#define HAVE_FTIME 1
#define HAVE_GETIFADDRS 1
#define HAVE_GETCWD 1
#define HAVE_GETHOSTBYADDR_R 1
/* #undef HAVE_GETHRTIME */
#define HAVE_GETPAGESIZE 1
/* #undef HAVE_GETPAGESIZES */
#define HAVE_GETPASS 1
/* #undef HAVE_GETPASSPHRASE */
#define HAVE_GETPWNAM 1
#define HAVE_GETPWUID 1
#define HAVE_GETRLIMIT 1
#define HAVE_GETRUSAGE 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETWD 1
#define HAVE_GMTIME_R 1
/* #undef gmtime_r */
#define HAVE_IN_ADDR_T 1
#define HAVE_INITGROUPS 1
#define HAVE_LDIV 1
#define HAVE_LRAND48 1
#define HAVE_LOCALTIME_R 1
#define HAVE_LSTAT 1
/* #define HAVE_MLOCK 1 see Bug#54662 */
#define HAVE_NL_LANGINFO 1
#define HAVE_MADVISE 1
#define HAVE_DECL_MADVISE 1
/* #undef HAVE_DECL_MHA_MAPSIZE_VA */
#define HAVE_MALLINFO 1
/* #undef HAVE_MALLINFO2 */
/* #undef HAVE_MALLOC_ZONE */
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MKSTEMP 1
#define HAVE_MKOSTEMP 1
#define HAVE_MLOCKALL 1
#define HAVE_MMAP 1
#define HAVE_MMAP64 1
#define HAVE_PERROR 1
#define HAVE_POLL 1
#define HAVE_POSIX_FALLOCATE 1
#define HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE 1
#define HAVE_PREAD 1
/* #undef HAVE_READ_REAL_TIME */
/* #undef HAVE_PTHREAD_ATTR_CREATE */
#define HAVE_PTHREAD_ATTR_GETGUARDSIZE 1
#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
#define HAVE_PTHREAD_ATTR_SETSCOPE 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_GETATTR_NP 1
/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
#define HAVE_PTHREAD_GETAFFINITY_NP 1
#define HAVE_PTHREAD_KEY_DELETE 1
/* #undef HAVE_PTHREAD_KILL */
#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
#define HAVE_PTHREAD_SIGMASK 1
/* #undef HAVE_PTHREAD_YIELD_NP */
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define PTHREAD_ONCE_INITIALIZER PTHREAD_ONCE_INIT
#define HAVE_PUTENV 1
/* #undef HAVE_READDIR_R */
#define HAVE_READLINK 1
#define HAVE_REALPATH 1
#define HAVE_RENAME 1
/* #undef HAVE_RWLOCK_INIT */
#define HAVE_SCHED_YIELD 1
#define HAVE_SELECT 1
#define HAVE_SETENV 1
#define HAVE_SETLOCALE 1
#define HAVE_SETMNTENT 1
#define HAVE_SETUPTERM 1
#define HAVE_SIGSET 1
#define HAVE_SIGACTION 1
/* #undef HAVE_SIGTHREADMASK */
#define HAVE_SIGWAIT 1
#define HAVE_SIGWAITINFO 1
#define HAVE_SLEEP 1
#define HAVE_STPCPY 1
#define HAVE_STRERROR 1
#define HAVE_STRCOLL 1
#define HAVE_STRNLEN 1
#define HAVE_STRPBRK 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOULL 1
/* #undef HAVE_TELL */
/* #undef HAVE_THR_YIELD */
#define HAVE_TIME 1
#define HAVE_TIMES 1
#define HAVE_VIDATTR 1
#define HAVE_VIO_READ_BUFF 1
#define HAVE_VASPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_FTRUNCATE 1
#define HAVE_TZNAME 1
/* Symbols we may use */
/* #undef HAVE_SYS_ERRLIST */
/* used by stacktrace functions */
#define HAVE_BACKTRACE 1
#define HAVE_BACKTRACE_SYMBOLS 1
#define HAVE_BACKTRACE_SYMBOLS_FD 1
/* #undef HAVE_PRINTSTACK */
#define HAVE_IPV6 1
/* #undef ss_family */
/* #undef HAVE_SOCKADDR_IN_SIN_LEN */
/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
#define STRUCT_TIMESPEC_HAS_TV_SEC 1
#define STRUCT_TIMESPEC_HAS_TV_NSEC 1

/* this means that valgrind headers and macros are available */
/* #undef HAVE_VALGRIND_MEMCHECK_H */

/* this means WITH_VALGRIND - we change some code paths for valgrind */
/* #undef HAVE_valgrind */

/* Types we may use */
#ifdef __APPLE__
  /*
    Special handling required for OSX to support universal binaries that 
    mix 32 and 64 bit architectures.
  */
  #if(__LP64__)
    #define SIZEOF_LONG 8
  #else
    #define SIZEOF_LONG 4
  #endif
  #define SIZEOF_VOIDP   SIZEOF_LONG
  #define SIZEOF_CHARP   SIZEOF_LONG
  #define SIZEOF_SIZE_T  SIZEOF_LONG
#else
/* No indentation, to fetch the lines from verification scripts */
#define SIZEOF_LONG   8
#define SIZEOF_VOIDP  8
#define SIZEOF_CHARP  8
#define SIZEOF_SIZE_T 8
#endif

#define HAVE_LONG 1
#define HAVE_CHARP 1
#define SIZEOF_INT 4
#define HAVE_INT 1
#define SIZEOF_LONG_LONG 8
#define HAVE_LONG_LONG 1
#define SIZEOF_OFF_T 8
#define HAVE_OFF_T 1
/* #undef SIZEOF_UCHAR */
/* #undef HAVE_UCHAR */
#define SIZEOF_UINT 4
#define HAVE_UINT 1
#define SIZEOF_ULONG 8
#define HAVE_ULONG 1
/* #undef SIZEOF_INT8 */
/* #undef HAVE_INT8 */
/* #undef SIZEOF_UINT8 */
/* #undef HAVE_UINT8 */
/* #undef SIZEOF_INT16 */
/* #undef HAVE_INT16 */
/* #undef SIZEOF_UINT16 */
/* #undef HAVE_UINT16 */
/* #undef SIZEOF_INT32 */
/* #undef HAVE_INT32 */
/* #undef SIZEOF_UINT32 */
/* #undef HAVE_UINT32 */
/* #undef SIZEOF_INT64 */
/* #undef HAVE_INT64 */
/* #undef SIZEOF_UINT64 */
/* #undef HAVE_UINT64 */

#define SOCKET_SIZE_TYPE socklen_t

#define HAVE_MBSTATE_T 1

#define MAX_INDEXES 64

#define QSORT_TYPE_IS_VOID 1
#define RETQSORTTYPE void

#define RETSIGTYPE void
#define VOID_SIGHANDLER 1
#define HAVE_SIGHANDLER_T 1
#define STRUCT_RLIMIT struct rlimit

#ifdef __APPLE__
  #if __BIG_ENDIAN
    #define WORDS_BIGENDIAN 1
  #endif
#else
/* #undef WORDS_BIGENDIAN */
#endif

/* Define to `__inline__' or `__inline' if that's what the C compiler calls
   it, or to nothing if 'inline' is not supported under any name.  */
#define C_HAS_inline 1
#if !(C_HAS_inline)
#ifndef __cplusplus
# define inline 
#endif
#endif


#define TARGET_OS_LINUX 1

#define HAVE_WCTYPE_H 1
#define HAVE_WCHAR_H 1
#define HAVE_LANGINFO_H 1
#define HAVE_MBRLEN 1
#define HAVE_MBSRTOWCS 1
#define HAVE_MBRTOWC 1
#define HAVE_WCWIDTH 1
#define HAVE_ISWLOWER 1
#define HAVE_ISWUPPER 1
#define HAVE_TOWLOWER 1
#define HAVE_TOWUPPER 1
#define HAVE_ISWCTYPE 1
#define HAVE_WCHAR_T 1


#define HAVE_STRCASECMP 1
#define HAVE_TCGETATTR 1

#define HAVE_WEAK_SYMBOL 1
#define HAVE_ABI_CXA_DEMANGLE 1
#define HAVE_ATTRIBUTE_CLEANUP 1

#define HAVE_POSIX_SIGNALS 1
/* #undef HAVE_BSD_SIGNALS */

/* #undef HAVE_SVR3_SIGNALS */
/* #undef HAVE_V7_SIGNALS */
#define HAVE_ERR_remove_thread_state 1
#define HAVE_X509_check_host 1

/* #undef HAVE_SOLARIS_STYLE_GETHOST */

#define HAVE_GCC_C11_ATOMICS 1
/* #undef HAVE_SOLARIS_ATOMIC */
/* #undef NO_FCNTL_NONBLOCK */
#define NO_ALARM 1

/* #undef _LARGE_FILES */
#define _LARGEFILE_SOURCE 1
/* #undef _LARGEFILE64_SOURCE */

#define TIME_WITH_SYS_TIME 1

#define STACK_DIRECTION -1

#define SYSTEM_TYPE "Linux"
#define MACHINE_TYPE "x86_64"
#define DEFAULT_MACHINE "x86_64"
#define HAVE_DTRACE 1

#define SIGNAL_WITH_VIO_CLOSE 1

/* Windows stuff, mostly functions, that have Posix analogs but named differently */
/* #undef S_IROTH */
/* #undef S_IFIFO */
/* #undef IPPROTO_IPV6 */
/* #undef IPV6_V6ONLY */
/* #undef sigset_t */
/* #undef mode_t */
/* #undef SIGQUIT */
/* #undef SIGPIPE */
/* #undef popen */
/* #undef pclose */
/* #undef ssize_t */
/* #undef strcasecmp */
/* #undef strncasecmp */
/* #undef snprintf */
/* #undef strtok_r */
/* #undef strtoll */
/* #undef strtoull */
/* #undef vsnprintf */
#if defined(_MSC_VER) && (_MSC_VER > 1800)
#define tzname _tzname
#define P_tmpdir "C:\\TEMP"
#endif
#if defined(_MSC_VER) && (_MSC_VER > 1310)
# define HAVE_SETENV
#define setenv(a,b,c) _putenv_s(a,b)
#endif
#define PSAPI_VERSION 1     /* for GetProcessMemoryInfo() */

/* We don't want the min/max macros */
#ifdef _WIN32
#define NOMINMAX 1
#endif

/*
  MySQL features
*/
#define LOCAL_INFILE_MODE_OFF  0
#define LOCAL_INFILE_MODE_ON   1
#define LOCAL_INFILE_MODE_AUTO 2
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_AUTO

#define ENABLED_PROFILING 1
/* #undef EXTRA_DEBUG */
/* #undef USE_SYMDIR */

/* Character sets and collations */
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"

#define USE_MB
#define USE_MB_IDENT

/* This should mean case insensitive file system */
/* #undef FN_NO_CASE_SENSE */

#define HAVE_CHARSET_armscii8 1
#define HAVE_CHARSET_ascii 1
#define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1
#define HAVE_CHARSET_cp1251 1
#define HAVE_CHARSET_cp1256 1
#define HAVE_CHARSET_cp1257 1
#define HAVE_CHARSET_cp850 1
#define HAVE_CHARSET_cp852 1 
#define HAVE_CHARSET_cp866 1
#define HAVE_CHARSET_cp932 1
#define HAVE_CHARSET_dec8 1
#define HAVE_CHARSET_eucjpms 1
#define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1
#define HAVE_CHARSET_geostd8 1
#define HAVE_CHARSET_greek 1
#define HAVE_CHARSET_hebrew 1
#define HAVE_CHARSET_hp8 1
#define HAVE_CHARSET_keybcs2 1
#define HAVE_CHARSET_koi8r 1
#define HAVE_CHARSET_koi8u 1
#define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1
#define HAVE_CHARSET_latin5 1
#define HAVE_CHARSET_latin7 1
#define HAVE_CHARSET_macce 1
#define HAVE_CHARSET_macroman 1
#define HAVE_CHARSET_sjis 1
#define HAVE_CHARSET_swe7 1
#define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8mb4 1
#define HAVE_CHARSET_utf8mb3 1
#define HAVE_CHARSET_utf16 1
#define HAVE_CHARSET_utf32 1
#define HAVE_UCA_COLLATIONS 1
#define HAVE_COMPRESS 1
#define HAVE_EncryptAes128Ctr 1
#define HAVE_EncryptAes128Gcm 1
#define HAVE_des 1

/*
  Stuff that always need to be defined (compile breaks without it)
*/
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_QUERY_CACHE 1
#define BIG_TABLES 1

/*
  Important storage engines (those that really need define 
  WITH_<ENGINE>_STORAGE_ENGINE for the whole server)
*/
#define WITH_INNOBASE_STORAGE_ENGINE 1
#define WITH_PARTITION_STORAGE_ENGINE 1
#define WITH_PERFSCHEMA_STORAGE_ENGINE 1
#define WITH_ARIA_STORAGE_ENGINE 1
#define USE_ARIA_FOR_TMP_TABLES 1

#define DEFAULT_MYSQL_HOME "/usr"
#define SHAREDIR "/usr/share/mysql"
#define DEFAULT_BASEDIR "/usr"
#define MYSQL_DATADIR "/var/lib/mysql"
#define DEFAULT_CHARSET_HOME "/usr"
#define PLUGINDIR "/usr/lib64/mysql/plugin"
#define DEFAULT_SYSCONFDIR "/etc"
#define DEFAULT_TMPDIR P_tmpdir

/* #undef SO_EXT */

#define MYSQL_VERSION_MAJOR 10
#define MYSQL_VERSION_MINOR 6
#define MYSQL_VERSION_PATCH 22
#define MYSQL_VERSION_EXTRA ""

#define PACKAGE "mysql"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "MySQL Server"
#define PACKAGE_STRING "MySQL Server 10.6.22"
#define PACKAGE_TARNAME "mysql"
#define PACKAGE_VERSION "10.6.22"
#define VERSION "10.6.22"
#define PROTOCOL_VERSION 10
#define PCRE2_CODE_UNIT_WIDTH 8

#define MALLOC_LIBRARY "system"

/* time_t related defines */

#define SIZEOF_TIME_T 8
/* #undef TIME_T_UNSIGNED */

#ifndef EMBEDDED_LIBRARY
/* #undef WSREP_INTERFACE_VERSION */
#define WITH_WSREP 1
#define WSREP_PROC_INFO 1
#endif

#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif  // !defined(__STDC_FORMAT_MACROS)

#endif

#define HAVE_VFORK 1
server/mysql_com.h000064400000074223150400263600010232 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
   Copyright (c) 2010, 2017, 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 */

/*
** Common definition between mysql server & client
*/

#ifndef _mysql_com_h
#define _mysql_com_h

#include "my_decimal_limits.h"

#define HOSTNAME_LENGTH 255
#define HOSTNAME_LENGTH_STR STRINGIFY_ARG(HOSTNAME_LENGTH)
#define SYSTEM_CHARSET_MBMAXLEN 3
#define NAME_CHAR_LEN	64              /* Field/table name length */
#define USERNAME_CHAR_LENGTH 128
#define USERNAME_CHAR_LENGTH_STR STRINGIFY_ARG(USERNAME_CHAR_LENGTH)

#define NAME_LEN                (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
#define USERNAME_LENGTH         (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
#define DEFINER_CHAR_LENGTH     (USERNAME_CHAR_LENGTH + HOSTNAME_LENGTH + 1)
#define DEFINER_LENGTH          (USERNAME_LENGTH + HOSTNAME_LENGTH + 1)

#define MYSQL_AUTODETECT_CHARSET_NAME "auto"

#define MYSQL50_TABLE_NAME_PREFIX         "#mysql50#"
#define MYSQL50_TABLE_NAME_PREFIX_LENGTH  (sizeof(MYSQL50_TABLE_NAME_PREFIX)-1)
#define SAFE_NAME_LEN (NAME_LEN + MYSQL50_TABLE_NAME_PREFIX_LENGTH)

/*
  MDEV-4088

  MySQL (and MariaDB 5.x before the fix) was using the first character of the
  server version string (as sent in the first handshake protocol packet) to
  decide on the replication event formats. And for 10.x the first character
  is "1", which the slave thought comes from some ancient 1.x version
  (ignoring the fact that the first ever MySQL version was 3.x).

  To support replication to these old clients, we fake the version in the
  first handshake protocol packet to start from "5.5.5-" (for example,
  it might be "5.5.5-10.0.1-MariaDB-debug-log".

  On the client side we remove this fake version prefix to restore the
  correct server version. The version "5.5.5" did not support
  pluggable authentication, so any version starting from "5.5.5-" and
  claiming to support pluggable auth, must be using this fake prefix.
*/
/* this version must be the one that *does not* support pluggable auth */
#define RPL_VERSION_HACK "5.5.5-"

#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
#define LIST_PROCESS_HOST_LEN 64

/*
  Maximum length of comments
*/
#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 5.5: 60 characters */
#define TABLE_COMMENT_MAXLEN 2048
#define COLUMN_COMMENT_MAXLEN 1024
#define INDEX_COMMENT_MAXLEN 1024
#define TABLE_PARTITION_COMMENT_MAXLEN 1024
#define DATABASE_COMMENT_MAXLEN 1024

/*
  Maximum length of protocol packet.
  OK packet length limit also restricted to this value as any length greater
  than this value will have first byte of OK packet to be 254 thus does not
  provide a means to identify if this is OK or EOF packet.
*/
#define MAX_PACKET_LENGTH (256L*256L*256L-1)

/*
  USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
  username and hostname parts of the user identifier with trailing zero in
  MySQL standard format:
  user_name_part@host_name_part\0
*/
#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2

#define LOCAL_HOST	"localhost"
#define LOCAL_HOST_NAMEDPIPE "."


#if defined(_WIN32) && !defined( _CUSTOMCONFIG_)
#define MYSQL_NAMEDPIPE "MySQL"
#define MYSQL_SERVICENAME "MySQL"
#endif

/*
  You should add new commands to the end of this list, otherwise old
  servers won't be able to handle them as 'unsupported'.
*/

enum enum_server_command
{
  COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
  COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
  COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
  COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
  COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
  COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
  COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
  COM_UNIMPLEMENTED, /* COM_BINLOG_DUMP_GTID in MySQL */
  COM_RESET_CONNECTION,
  /* don't forget to update const char *command_name[] in sql_parse.cc */
  COM_MDB_GAP_BEG,
  COM_MDB_GAP_END=249,
  COM_STMT_BULK_EXECUTE=250,
  COM_SLAVE_WORKER=251,
  COM_SLAVE_IO=252,
  COM_SLAVE_SQL=253,
  COM_RESERVED_1=254, /* Old COM_MULTI, now removed */
  /* Must be last */
  COM_END=255
};


/*
  Bulk PS protocol indicator value:
*/
enum enum_indicator_type
{
  STMT_INDICATOR_NONE= 0,
  STMT_INDICATOR_NULL,
  STMT_INDICATOR_DEFAULT,
  STMT_INDICATOR_IGNORE
};

/*
  bulk PS flags
*/
#define STMT_BULK_FLAG_CLIENT_SEND_TYPES 128
#define STMT_BULK_FLAG_INSERT_ID_REQUEST 64


/* sql type stored in .frm files for virtual fields */
#define MYSQL_TYPE_VIRTUAL 245
/*
  Length of random string sent by server on handshake; this is also length of
  obfuscated password, received from client
*/
#define SCRAMBLE_LENGTH 20
#define SCRAMBLE_LENGTH_323 8
/* length of password stored in the db: new passwords are preceded with '*' */
#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1)
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)


#define NOT_NULL_FLAG	1U		/* Field can't be NULL */
#define PRI_KEY_FLAG	2U		/* Field is part of a primary key */
#define UNIQUE_KEY_FLAG 4U		/* Field is part of a unique key */
#define MULTIPLE_KEY_FLAG 8U		/* Field is part of a key */
#define BLOB_FLAG	16U		/* Field is a blob */
#define UNSIGNED_FLAG	32U		/* Field is unsigned */
#define ZEROFILL_FLAG	64U		/* Field is zerofill */
#define BINARY_FLAG	128U		/* Field is binary   */

/* The following are only sent to new clients */
#define ENUM_FLAG	256U		/* field is an enum */
#define AUTO_INCREMENT_FLAG 512U	/* field is a autoincrement field */
#define TIMESTAMP_FLAG	1024U		/* Field is a timestamp */
#define SET_FLAG	2048U		/* field is a set */
#define NO_DEFAULT_VALUE_FLAG 4096U	/* Field doesn't have default value */
#define ON_UPDATE_NOW_FLAG 8192U	/* Field is set to NOW on UPDATE */
#define NUM_FLAG	32768U		/* Field is num (for clients) */
#define PART_KEY_FLAG	16384U		/* Intern; Part of some key */
#define GROUP_FLAG	32768U		/* Intern: Group field */
#define BINCMP_FLAG	131072U		/* Intern: Used by sql_yacc */
#define GET_FIXED_FIELDS_FLAG (1U << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1U << 19)/* Field part of partition func */
#define PART_INDIRECT_KEY_FLAG (1U << 20)

/**
  Intern: Field in TABLE object for new version of altered table,
          which participates in a newly added index.
*/
#define FIELD_IN_ADD_INDEX (1U << 20)
#define FIELD_IS_RENAMED (1U << 21)     /* Intern: Field is being renamed */
#define FIELD_FLAGS_STORAGE_MEDIA 22    /* Field storage media, bit 22-23 */
#define FIELD_FLAGS_STORAGE_MEDIA_MASK (3U << FIELD_FLAGS_STORAGE_MEDIA)
#define FIELD_FLAGS_COLUMN_FORMAT 24    /* Field column format, bit 24-25 */
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3U << FIELD_FLAGS_COLUMN_FORMAT)
#define FIELD_IS_DROPPED (1U << 26)     /* Intern: Field is being dropped */

#define VERS_ROW_START (1 << 27)   /* autogenerated column declared with
                                             `generated always as row start`
                                              (see II.a SQL Standard) */
#define VERS_ROW_END (1 << 28)     /* autogenerated column declared with
                                           `generated always as row end`
                                            (see II.a SQL Standard).*/
#define VERS_SYSTEM_FIELD (VERS_ROW_START | VERS_ROW_END)
#define VERS_UPDATE_UNVERSIONED_FLAG (1 << 29) /* column that doesn't support
                                                system versioning when table
                                                itself supports it*/
#define LONG_UNIQUE_HASH_FIELD       (1<< 30) /* This field will store hash for unique
                                                column */
#define FIELD_PART_OF_TMP_UNIQUE     (1<< 31) /* part of an unique constrain
                                                for a tmporary table*/

#define REFRESH_GRANT           (1ULL << 0)  /* Refresh grant tables */
#define REFRESH_LOG             (1ULL << 1)  /* Start on new log file */
#define REFRESH_TABLES          (1ULL << 2)  /* close all tables */
#define REFRESH_HOSTS           (1ULL << 3)  /* Flush host cache */
#define REFRESH_STATUS          (1ULL << 4)  /* Flush status variables */
#define REFRESH_THREADS         (1ULL << 5)  /* Flush thread cache */
#define REFRESH_SLAVE           (1ULL << 6)  /* Reset master info and restart slave
                                             thread */
#define REFRESH_MASTER          (1ULL << 7)  /* Remove all bin logs in the index
                                             and truncate the index */

/* The following can't be set with mysql_refresh() */
#define REFRESH_ERROR_LOG       (1ULL << 8)  /* Rotate only the error log */
#define REFRESH_ENGINE_LOG      (1ULL << 9)  /* Flush all storage engine logs */
#define REFRESH_BINARY_LOG      (1ULL << 10) /* Flush the binary log */
#define REFRESH_RELAY_LOG       (1ULL << 11) /* Flush the relay log */
#define REFRESH_GENERAL_LOG     (1ULL << 12) /* Flush the general log */
#define REFRESH_SLOW_LOG        (1ULL << 13) /* Flush the slow query log */

#define REFRESH_READ_LOCK       (1ULL << 14) /* Lock tables for read */
#define REFRESH_CHECKPOINT      (1ULL << 15) /* With REFRESH_READ_LOCK: block checkpoints too */

#define REFRESH_QUERY_CACHE     (1ULL << 16) /* clear the query cache */
#define REFRESH_QUERY_CACHE_FREE (1ULL << 17) /* pack query cache */
#define REFRESH_DES_KEY_FILE    (1ULL << 18)
#define REFRESH_USER_RESOURCES  (1ULL << 19)
#define REFRESH_FOR_EXPORT      (1ULL << 20) /* FLUSH TABLES ... FOR EXPORT */
#define REFRESH_SSL             (1ULL << 21)

#define REFRESH_GENERIC         (1ULL << 30)
#define REFRESH_FAST            (1ULL << 31) /* Intern flag */

#define CLIENT_LONG_PASSWORD	0	/* obsolete flag */
#define CLIENT_MYSQL            1ULL       /* mysql/old mariadb server/client */
#define CLIENT_FOUND_ROWS	2ULL	/* Found instead of affected rows */
#define CLIENT_LONG_FLAG	4ULL	/* Get all column flags */
#define CLIENT_CONNECT_WITH_DB	8ULL	/* One can specify db on connect */
#define CLIENT_NO_SCHEMA	16ULL	/* Don't allow database.table.column */
#define CLIENT_COMPRESS		32ULL	/* Can use compression protocol */
#define CLIENT_ODBC		64ULL	/* Odbc client */
#define CLIENT_LOCAL_FILES	128ULL	/* Can use LOAD DATA LOCAL */
#define CLIENT_IGNORE_SPACE	256ULL	/* Ignore spaces before '(' */
#define CLIENT_PROTOCOL_41	512ULL	/* New 4.1 protocol */
#define CLIENT_INTERACTIVE	1024ULL	/* This is an interactive client */
#define CLIENT_SSL              2048ULL	/* Switch to SSL after handshake */
#define CLIENT_IGNORE_SIGPIPE   4096ULL    /* IGNORE sigpipes */
#define CLIENT_TRANSACTIONS	8192ULL	/* Client knows about transactions */
#define CLIENT_RESERVED         16384ULL   /* Old flag for 4.1 protocol  */
#define CLIENT_SECURE_CONNECTION 32768ULL  /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS (1ULL << 16) /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS    (1ULL << 17) /* Enable/disable multi-results */
#define CLIENT_PS_MULTI_RESULTS (1ULL << 18) /* Multi-results in PS-protocol */

#define CLIENT_PLUGIN_AUTH  (1ULL << 19) /* Client supports plugin authentication */
#define CLIENT_CONNECT_ATTRS (1ULL << 20) /* Client supports connection attributes */
/* Enable authentication response packet to be larger than 255 bytes. */
#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1ULL << 21)
/* Don't close the connection for a connection with expired password. */
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1ULL << 22)

/**
  Capable of handling server state change information. Its a hint to the
  server to include the state change information in Ok packet.
*/
#define CLIENT_SESSION_TRACK (1ULL << 23)
/* Client no longer needs EOF packet */
#define CLIENT_DEPRECATE_EOF (1ULL << 24)

#define CLIENT_PROGRESS_OBSOLETE  (1ULL << 29)
#define CLIENT_SSL_VERIFY_SERVER_CERT_OBSOLETE (1ULL << 30)
/*
  It used to be that if mysql_real_connect() failed, it would delete any
  options set by the client, unless the CLIENT_REMEMBER_OPTIONS flag was
  given.
  That behaviour does not appear very useful, and it seems unlikely that
  any applications would actually depend on this. So from MariaDB 5.5 we
  always preserve any options set in case of failed connect, and this
  option is effectively always set.
*/
#define CLIENT_REMEMBER_OPTIONS (1ULL << 31)

/* MariaDB extended capability flags */
#define MARIADB_CLIENT_FLAGS_MASK 0xffffffff00000000ULL
/* Client support progress indicator */
#define MARIADB_CLIENT_PROGRESS (1ULL << 32)

/* Old COM_MULTI experiment (functionality removed).*/
#define MARIADB_CLIENT_RESERVED_1 (1ULL << 33)

/* support of array binding */
#define MARIADB_CLIENT_STMT_BULK_OPERATIONS (1ULL << 34)
/* support of extended metadata (e.g. type/format information) */
#define MARIADB_CLIENT_EXTENDED_METADATA (1ULL << 35)

/* Do not resend metadata for prepared statements, since 10.6*/
#define MARIADB_CLIENT_CACHE_METADATA (1ULL << 36)

#ifdef HAVE_COMPRESS
#define CAN_CLIENT_COMPRESS CLIENT_COMPRESS
#else
#define CAN_CLIENT_COMPRESS 0
#endif

/*
  Gather all possible capabilities (flags) supported by the server

  MARIADB_* flags supported only by MariaDB connector(s).
*/
#define CLIENT_ALL_FLAGS  (\
                           CLIENT_FOUND_ROWS | \
                           CLIENT_LONG_FLAG | \
                           CLIENT_CONNECT_WITH_DB | \
                           CLIENT_NO_SCHEMA | \
                           CLIENT_COMPRESS | \
                           CLIENT_ODBC | \
                           CLIENT_LOCAL_FILES | \
                           CLIENT_IGNORE_SPACE | \
                           CLIENT_PROTOCOL_41 | \
                           CLIENT_INTERACTIVE | \
                           CLIENT_SSL | \
                           CLIENT_IGNORE_SIGPIPE | \
                           CLIENT_TRANSACTIONS | \
                           CLIENT_RESERVED | \
                           CLIENT_SECURE_CONNECTION | \
                           CLIENT_MULTI_STATEMENTS | \
                           CLIENT_MULTI_RESULTS | \
                           CLIENT_PS_MULTI_RESULTS | \
                           CLIENT_REMEMBER_OPTIONS | \
                           MARIADB_CLIENT_PROGRESS | \
                           CLIENT_PLUGIN_AUTH | \
                           CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
                           CLIENT_SESSION_TRACK |\
                           CLIENT_DEPRECATE_EOF |\
                           CLIENT_CONNECT_ATTRS |\
                           MARIADB_CLIENT_STMT_BULK_OPERATIONS |\
                           MARIADB_CLIENT_EXTENDED_METADATA|\
                           MARIADB_CLIENT_CACHE_METADATA |\
                           CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS)
/*
  Switch off the flags that are optional and depending on build flags
  If any of the optional flags is supported by the build it will be switched
  on before sending to the client during the connection handshake.
*/
#define CLIENT_BASIC_FLAGS ((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \
                                               & ~CLIENT_COMPRESS)

enum mariadb_field_attr_t
{
  MARIADB_FIELD_ATTR_DATA_TYPE_NAME= 0,
  MARIADB_FIELD_ATTR_FORMAT_NAME= 1
};

#define MARIADB_FIELD_ATTR_LAST MARIADB_FIELD_ATTR_FORMAT_NAME


/**
  Is raised when a multi-statement transaction
  has been started, either explicitly, by means
  of BEGIN or COMMIT AND CHAIN, or
  implicitly, by the first transactional
  statement, when autocommit=off.
*/
#define SERVER_STATUS_IN_TRANS     1U
#define SERVER_STATUS_AUTOCOMMIT   2U	/* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8U   /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16U
#define SERVER_QUERY_NO_INDEX_USED      32U
/**
  The server was able to fulfill the clients request and opened a
  read-only non-scrollable cursor for a query. This flag comes
  in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
*/
#define SERVER_STATUS_CURSOR_EXISTS 64U
/**
  This flag is sent when a read-only cursor is exhausted, in reply to
  COM_STMT_FETCH command.
*/
#define SERVER_STATUS_LAST_ROW_SENT 128U
#define SERVER_STATUS_DB_DROPPED        256U /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512U
/**
  Sent to the client if after a prepared statement reprepare
  we discovered that the new statement returns a different 
  number of result set columns.
*/
#define SERVER_STATUS_METADATA_CHANGED 1024U
#define SERVER_QUERY_WAS_SLOW          2048U

/**
  To mark ResultSet containing output parameter values.
*/
#define SERVER_PS_OUT_PARAMS            4096U

/**
  Set at the same time as SERVER_STATUS_IN_TRANS if the started
  multi-statement transaction is a read-only transaction. Cleared
  when the transaction commits or aborts. Since this flag is sent
  to clients in OK and EOF packets, the flag indicates the
  transaction status at the end of command execution.
*/
#define SERVER_STATUS_IN_TRANS_READONLY 8192U

/**
  This status flag, when on, implies that one of the state information has
  changed on the server because of the execution of the last statement.
*/
#define SERVER_SESSION_STATE_CHANGED    16384U

#define SERVER_STATUS_ANSI_QUOTES       32768U

/**
  Server status flags that must be cleared when starting
  execution of a new SQL statement.
  Flags from this set are only added to the
  current server status by the execution engine, but 
  never removed -- the execution engine expects them 
  to disappear automagically by the next command.
*/
#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \
                                 SERVER_QUERY_NO_INDEX_USED|\
                                 SERVER_MORE_RESULTS_EXISTS|\
                                 SERVER_STATUS_METADATA_CHANGED |\
                                 SERVER_QUERY_WAS_SLOW |\
                                 SERVER_STATUS_DB_DROPPED |\
                                 SERVER_STATUS_CURSOR_EXISTS|\
                                 SERVER_STATUS_LAST_ROW_SENT|\
                                 SERVER_SESSION_STATE_CHANGED)

#define MYSQL_ERRMSG_SIZE	512
#define NET_READ_TIMEOUT	30		/* Timeout on read */
#define NET_WRITE_TIMEOUT	60		/* Timeout on write */
#define NET_WAIT_TIMEOUT	8*60*60		/* Wait for new query */

struct st_vio;					/* Only C */
typedef struct st_vio Vio;

#define MAX_TINYINT_WIDTH       3       /* Max width for a TINY w.o. sign */
#define MAX_SMALLINT_WIDTH      5       /* Max width for a SHORT w.o. sign */
#define MAX_MEDIUMINT_WIDTH     8       /* Max width for a INT24 w.o. sign */
#define MAX_INT_WIDTH           10      /* Max width for a LONG w.o. sign */
#define MAX_BIGINT_WIDTH        20      /* Max width for a LONGLONG */
#define MAX_CHAR_WIDTH		255	/* Max length for a CHAR column */
#define MAX_BLOB_WIDTH		16777216	/* Default width for blob */

typedef struct st_net {
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
  Vio *vio;
  unsigned char *buff,*buff_end,*write_pos,*read_pos;
  my_socket fd;					/* For Perl DBI/dbd */
  /*
    The following variable is set if we are doing several queries in one
    command ( as in LOAD TABLE ... FROM MASTER ),
    and do not want to confuse the client with OK at the wrong time
  */
  unsigned long remain_in_buf,length, buf_length, where_b;
  unsigned long max_packet,max_packet_size;
  unsigned int pkt_nr,compress_pkt_nr;
  unsigned int write_timeout, read_timeout, retry_count;
  int fcntl;
  unsigned int *return_status;
  unsigned char reading_or_writing;
  char save_char;
  char net_skip_rest_factor;
  my_bool thread_specific_malloc;
  unsigned char compress;
  my_bool pkt_nr_can_be_reset;
  my_bool using_proxy_protocol;
  /*
    Pointer to query object in query cache, do not equal NULL (0) for
    queries in cache that have not stored its results yet
  */
#endif
  void *thd; 	   /* Used by MariaDB server to avoid calling current_thd */
  unsigned int last_errno;
  unsigned char error; 
  my_bool unused4; /* Please remove with the next incompatible ABI change. */
  my_bool unused5; /* Please remove with the next incompatible ABI change. */
  /** Client library error message buffer. Actually belongs to struct MYSQL. */
  char last_error[MYSQL_ERRMSG_SIZE];
  /** Client library sqlstate buffer. Set along with the error message. */
  char sqlstate[SQLSTATE_LENGTH+1];
  void *extension;
} NET;


#define packet_error ~0UL

enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
			MYSQL_TYPE_SHORT,  MYSQL_TYPE_LONG,
			MYSQL_TYPE_FLOAT,  MYSQL_TYPE_DOUBLE,
			MYSQL_TYPE_NULL,   MYSQL_TYPE_TIMESTAMP,
			MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
			MYSQL_TYPE_DATE,   MYSQL_TYPE_TIME,
			MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
			MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
			MYSQL_TYPE_BIT,
                        /*
                          mysql-5.6 compatibility temporal types.
                          They're only used internally for reading RBR
                          mysql-5.6 binary log events and mysql-5.6 frm files.
                          They're never sent to the client.
                        */
                        MYSQL_TYPE_TIMESTAMP2,
                        MYSQL_TYPE_DATETIME2,
                        MYSQL_TYPE_TIME2,
                        /* Compressed types are only used internally for RBR. */
                        MYSQL_TYPE_BLOB_COMPRESSED= 140,
                        MYSQL_TYPE_VARCHAR_COMPRESSED= 141,

                        MYSQL_TYPE_NEWDECIMAL=246,
			MYSQL_TYPE_ENUM=247,
			MYSQL_TYPE_SET=248,
			MYSQL_TYPE_TINY_BLOB=249,
			MYSQL_TYPE_MEDIUM_BLOB=250,
			MYSQL_TYPE_LONG_BLOB=251,
			MYSQL_TYPE_BLOB=252,
			MYSQL_TYPE_VAR_STRING=253,
			MYSQL_TYPE_STRING=254,
			MYSQL_TYPE_GEOMETRY=255

};

/* For backward compatibility */
#define CLIENT_MULTI_QUERIES    CLIENT_MULTI_STATEMENTS    
#define FIELD_TYPE_DECIMAL     MYSQL_TYPE_DECIMAL
#define FIELD_TYPE_NEWDECIMAL  MYSQL_TYPE_NEWDECIMAL
#define FIELD_TYPE_TINY        MYSQL_TYPE_TINY
#define FIELD_TYPE_SHORT       MYSQL_TYPE_SHORT
#define FIELD_TYPE_LONG        MYSQL_TYPE_LONG
#define FIELD_TYPE_FLOAT       MYSQL_TYPE_FLOAT
#define FIELD_TYPE_DOUBLE      MYSQL_TYPE_DOUBLE
#define FIELD_TYPE_NULL        MYSQL_TYPE_NULL
#define FIELD_TYPE_TIMESTAMP   MYSQL_TYPE_TIMESTAMP
#define FIELD_TYPE_LONGLONG    MYSQL_TYPE_LONGLONG
#define FIELD_TYPE_INT24       MYSQL_TYPE_INT24
#define FIELD_TYPE_DATE        MYSQL_TYPE_DATE
#define FIELD_TYPE_TIME        MYSQL_TYPE_TIME
#define FIELD_TYPE_DATETIME    MYSQL_TYPE_DATETIME
#define FIELD_TYPE_YEAR        MYSQL_TYPE_YEAR
#define FIELD_TYPE_NEWDATE     MYSQL_TYPE_NEWDATE
#define FIELD_TYPE_ENUM        MYSQL_TYPE_ENUM
#define FIELD_TYPE_SET         MYSQL_TYPE_SET
#define FIELD_TYPE_TINY_BLOB   MYSQL_TYPE_TINY_BLOB
#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
#define FIELD_TYPE_LONG_BLOB   MYSQL_TYPE_LONG_BLOB
#define FIELD_TYPE_BLOB        MYSQL_TYPE_BLOB
#define FIELD_TYPE_VAR_STRING  MYSQL_TYPE_VAR_STRING
#define FIELD_TYPE_STRING      MYSQL_TYPE_STRING
#define FIELD_TYPE_CHAR        MYSQL_TYPE_TINY
#define FIELD_TYPE_INTERVAL    MYSQL_TYPE_ENUM
#define FIELD_TYPE_GEOMETRY    MYSQL_TYPE_GEOMETRY
#define FIELD_TYPE_BIT         MYSQL_TYPE_BIT


/* Shutdown/kill enums and constants */ 

/* Bits for THD::killable. */
#define MYSQL_SHUTDOWN_KILLABLE_CONNECT    (unsigned char)(1 << 0)
#define MYSQL_SHUTDOWN_KILLABLE_TRANS      (unsigned char)(1 << 1)
#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
#define MYSQL_SHUTDOWN_KILLABLE_UPDATE     (unsigned char)(1 << 3)

enum mysql_enum_shutdown_level {
  /*
    We want levels to be in growing order of hardness (because we use number
    comparisons). Note that DEFAULT does not respect the growing property, but
    it's ok.
  */
  SHUTDOWN_DEFAULT = 0,
  /* wait for existing connections to finish */
  SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT,
  /* wait for existing trans to finish */
  SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS,
  /* wait for existing updates to finish (=> no partial MyISAM update) */
  SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE,
  /* flush InnoDB buffers and other storage engines' buffers*/
  SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1),
  /* don't flush InnoDB buffers, flush other storage engines' buffers*/
  SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1
};

enum enum_cursor_type
{
  CURSOR_TYPE_NO_CURSOR= 0,
  CURSOR_TYPE_READ_ONLY= 1,
  CURSOR_TYPE_FOR_UPDATE= 2,
  CURSOR_TYPE_SCROLLABLE= 4
};


/* options for mysql_set_option */
enum enum_mysql_set_option
{
  MYSQL_OPTION_MULTI_STATEMENTS_ON,
  MYSQL_OPTION_MULTI_STATEMENTS_OFF
};

/*
  Type of state change information that the server can include in the Ok
  packet.
*/
enum enum_session_state_type
{
  SESSION_TRACK_SYSTEM_VARIABLES,             /* Session system variables */
  SESSION_TRACK_SCHEMA,                       /* Current schema */
  SESSION_TRACK_STATE_CHANGE,                 /* track session state changes */
  SESSION_TRACK_GTIDS,
  SESSION_TRACK_TRANSACTION_CHARACTERISTICS,  /* Transaction chistics */
  SESSION_TRACK_TRANSACTION_STATE,            /* Transaction state */
#ifdef USER_VAR_TRACKING
  SESSION_TRACK_MYSQL_RESERVED1,
  SESSION_TRACK_MYSQL_RESERVED2,
  SESSION_TRACK_MYSQL_RESERVED3,
  SESSION_TRACK_MYSQL_RESERVED4,
  SESSION_TRACK_MYSQL_RESERVED5,
  SESSION_TRACK_MYSQL_RESERVED6,
  SESSION_TRACK_USER_VARIABLES,
#endif // USER_VAR_TRACKING
  SESSION_TRACK_always_at_the_end             /* must be last */
};

#define SESSION_TRACK_BEGIN SESSION_TRACK_SYSTEM_VARIABLES

#define IS_SESSION_STATE_TYPE(T) \
  (((int)(T) >= SESSION_TRACK_BEGIN) && ((T) < SESSION_TRACK_always_at_the_end))

#define net_new_transaction(net) ((net)->pkt_nr=0)

#ifdef __cplusplus
extern "C" {
#endif

my_bool	my_net_init(NET *net, Vio* vio, void *thd, unsigned int my_flags);
void	my_net_local_init(NET *net);
void	net_end(NET *net);
void	net_clear(NET *net, my_bool clear_buffer);
my_bool net_realloc(NET *net, size_t length);
my_bool	net_flush(NET *net);
my_bool	my_net_write(NET *net,const unsigned char *packet, size_t len);
my_bool	net_write_command(NET *net,unsigned char command,
			  const unsigned char *header, size_t head_len,
			  const unsigned char *packet, size_t len);
int	net_real_write(NET *net,const unsigned char *packet, size_t len);
unsigned long my_net_read_packet(NET *net, my_bool read_from_server);
unsigned long my_net_read_packet_reallen(NET *net, my_bool read_from_server,
                                         unsigned long* reallen);
#define my_net_read(A) my_net_read_packet((A), 0)

#ifdef MY_GLOBAL_INCLUDED
void my_net_set_write_timeout(NET *net, uint timeout);
void my_net_set_read_timeout(NET *net, uint timeout);
#endif

struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
	       unsigned int timeout);
struct my_rnd_struct;

#ifdef __cplusplus
}
#endif

  /* The following is for user defined functions */

enum Item_result
{
  STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT,
  TIME_RESULT
};

typedef struct st_udf_args
{
  unsigned int arg_count;		/* Number of arguments */
  enum Item_result *arg_type;		/* Pointer to item_results */
  char **args;				/* Pointer to argument */
  unsigned long *lengths;		/* Length of string arguments */
  char *maybe_null;			/* Set to 1 for all maybe_null args */
  const char **attributes;              /* Pointer to attribute name */
  unsigned long *attribute_lengths;     /* Length of attribute arguments */
  void *extension;
} UDF_ARGS;

  /* This holds information about the result */

typedef struct st_udf_init
{
  my_bool maybe_null;          /* 1 if function can return NULL */
  unsigned int decimals;       /* for real functions */
  unsigned long max_length;    /* For string functions */
  char *ptr;                   /* free pointer for function data */
  my_bool const_item;          /* 1 if function always returns the same value */
  void *extension;
} UDF_INIT;
/* 
  TODO: add a notion for determinism of the UDF. 
  See Item_udf_func::update_used_tables ()
*/

  /* Constants when using compression */
#define NET_HEADER_SIZE 4		/* standard header size */
#define COMP_HEADER_SIZE 3		/* compression header extra size */

  /* Prototypes to password functions */

#ifdef __cplusplus
extern "C" {
#endif

/*
  These functions are used for authentication by client and server and
  implemented in sql/password.c
*/

void create_random_string(char *to, unsigned int length,
                          struct my_rnd_struct *rand_st);

void hash_password(unsigned long *to, const char *password, unsigned int password_len);
void make_scrambled_password_323(char *to, const char *password);
void scramble_323(char *to, const char *message, const char *password);
my_bool check_scramble_323(const unsigned char *reply, const char *message,
                           unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password);
void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const unsigned char *reply, const char *message,
                       const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password);
char *octet2hex(char *to, const char *str, size_t len);

/* end of password.c */

char *get_tty_password(const char *opt_message);
void get_tty_password_buff(const char *opt_message, char *to, size_t length);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);

/* Some other useful functions */

my_bool my_thread_init(void);
void my_thread_end(void);

#ifdef MY_GLOBAL_INCLUDED
#include "pack.h"
#endif

#ifdef __cplusplus
}
#endif

#define NULL_LENGTH ~0UL /* For net_store_length */
#define MYSQL_STMT_HEADER       4U
#define MYSQL_LONG_DATA_HEADER  6U

/*
  If a float or double field have more than this number of decimals,
  it's regarded as floating point field without any specific number of
  decimals
*/


#endif
server/handler_ername.h000064400000010773150400263600011173 0ustar00/* Copyright (c) 2013, 2021, 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/* Names of all handler error numbers. Used by mysqltest */

{ "HA_ERR_KEY_NOT_FOUND", HA_ERR_KEY_NOT_FOUND, "" },
{ "HA_ERR_FOUND_DUPP_KEY", HA_ERR_FOUND_DUPP_KEY, "" },
{ "HA_ERR_INTERNAL_ERROR", HA_ERR_INTERNAL_ERROR, "" },
{ "HA_ERR_RECORD_CHANGED", HA_ERR_RECORD_CHANGED, "" },
{ "HA_ERR_WRONG_INDEX", HA_ERR_WRONG_INDEX, "" },
{ "HA_ERR_CRASHED", HA_ERR_CRASHED, "" },
{ "HA_ERR_WRONG_IN_RECORD", HA_ERR_WRONG_IN_RECORD, "" },
{ "HA_ERR_OUT_OF_MEM", HA_ERR_OUT_OF_MEM, "" },
{ "HA_ERR_NOT_A_TABLE", HA_ERR_NOT_A_TABLE, "" },
{ "HA_ERR_WRONG_COMMAND", HA_ERR_WRONG_COMMAND, "" },
{ "HA_ERR_OLD_FILE", HA_ERR_OLD_FILE, "" },
{ "HA_ERR_NO_ACTIVE_RECORD", HA_ERR_NO_ACTIVE_RECORD, "" },
{ "HA_ERR_RECORD_DELETED", HA_ERR_RECORD_DELETED, "" },
{ "HA_ERR_RECORD_FILE_FULL", HA_ERR_RECORD_FILE_FULL, "" },
{ "HA_ERR_INDEX_FILE_FULL", HA_ERR_INDEX_FILE_FULL, "" },
{ "HA_ERR_END_OF_FILE", HA_ERR_END_OF_FILE, "" },
{ "HA_ERR_UNSUPPORTED", HA_ERR_UNSUPPORTED, "" },
{ "HA_ERR_TO_BIG_ROW", HA_ERR_TO_BIG_ROW, "" },
{ "HA_WRONG_CREATE_OPTION", HA_WRONG_CREATE_OPTION, "" },
{ "HA_ERR_FOUND_DUPP_UNIQUE", HA_ERR_FOUND_DUPP_UNIQUE, "" },
{ "HA_ERR_UNKNOWN_CHARSET", HA_ERR_UNKNOWN_CHARSET, "" },
{ "HA_ERR_WRONG_MRG_TABLE_DEF", HA_ERR_WRONG_MRG_TABLE_DEF, "" },
{ "HA_ERR_CRASHED_ON_REPAIR", HA_ERR_CRASHED_ON_REPAIR, "" },
{ "HA_ERR_CRASHED_ON_USAGE", HA_ERR_CRASHED_ON_USAGE, "" },
{ "HA_ERR_LOCK_WAIT_TIMEOUT", HA_ERR_LOCK_WAIT_TIMEOUT, "" },
{ "HA_ERR_LOCK_TABLE_FULL", HA_ERR_LOCK_TABLE_FULL, "" },
{ "HA_ERR_READ_ONLY_TRANSACTION", HA_ERR_READ_ONLY_TRANSACTION, "" },
{ "HA_ERR_LOCK_DEADLOCK", HA_ERR_LOCK_DEADLOCK, "" },
{ "HA_ERR_CANNOT_ADD_FOREIGN", HA_ERR_CANNOT_ADD_FOREIGN, "" },
{ "HA_ERR_NO_REFERENCED_ROW", HA_ERR_NO_REFERENCED_ROW, "" },
{ "HA_ERR_ROW_IS_REFERENCED", HA_ERR_ROW_IS_REFERENCED, "" },
{ "HA_ERR_NO_SAVEPOINT", HA_ERR_NO_SAVEPOINT, "" },
{ "HA_ERR_NON_UNIQUE_BLOCK_SIZE", HA_ERR_NON_UNIQUE_BLOCK_SIZE, "" },
{ "HA_ERR_NO_SUCH_TABLE", HA_ERR_NO_SUCH_TABLE, "" },
{ "HA_ERR_TABLE_EXIST", HA_ERR_TABLE_EXIST, "" },
{ "HA_ERR_NO_CONNECTION", HA_ERR_NO_CONNECTION, "" },
{ "HA_ERR_NULL_IN_SPATIAL", HA_ERR_NULL_IN_SPATIAL, "" },
{ "HA_ERR_TABLE_DEF_CHANGED", HA_ERR_TABLE_DEF_CHANGED, "" },
{ "HA_ERR_NO_PARTITION_FOUND", HA_ERR_NO_PARTITION_FOUND, "" },
{ "HA_ERR_RBR_LOGGING_FAILED", HA_ERR_RBR_LOGGING_FAILED, "" },
{ "HA_ERR_DROP_INDEX_FK", HA_ERR_DROP_INDEX_FK, "" },
{ "HA_ERR_FOREIGN_DUPLICATE_KEY", HA_ERR_FOREIGN_DUPLICATE_KEY, "" },
{ "HA_ERR_TABLE_NEEDS_UPGRADE", HA_ERR_TABLE_NEEDS_UPGRADE, "" },
{ "HA_ERR_TABLE_READONLY", HA_ERR_TABLE_READONLY, "" },
{ "HA_ERR_AUTOINC_READ_FAILED", HA_ERR_AUTOINC_READ_FAILED, "" },
{ "HA_ERR_AUTOINC_ERANGE", HA_ERR_AUTOINC_ERANGE, "" },
{ "HA_ERR_GENERIC", HA_ERR_GENERIC, "" },
{ "HA_ERR_RECORD_IS_THE_SAME", HA_ERR_RECORD_IS_THE_SAME, "" },
{ "HA_ERR_LOGGING_IMPOSSIBLE", HA_ERR_LOGGING_IMPOSSIBLE, "" },
{ "HA_ERR_CORRUPT_EVENT", HA_ERR_CORRUPT_EVENT, "" },
{ "HA_ERR_NEW_FILE", HA_ERR_NEW_FILE, "" },
{ "HA_ERR_ROWS_EVENT_APPLY", HA_ERR_ROWS_EVENT_APPLY, "" },
{ "HA_ERR_INITIALIZATION", HA_ERR_INITIALIZATION, "" },
{ "HA_ERR_FILE_TOO_SHORT", HA_ERR_FILE_TOO_SHORT, "" },
{ "HA_ERR_WRONG_CRC", HA_ERR_WRONG_CRC, "" },
{ "HA_ERR_TOO_MANY_CONCURRENT_TRXS", HA_ERR_TOO_MANY_CONCURRENT_TRXS, "" },
{ "HA_ERR_INDEX_COL_TOO_LONG", HA_ERR_INDEX_COL_TOO_LONG, "" },
{ "HA_ERR_INDEX_CORRUPT", HA_ERR_INDEX_CORRUPT, "" },
{ "HA_ERR_UNDO_REC_TOO_BIG", HA_ERR_UNDO_REC_TOO_BIG, "" },
{ "HA_ERR_ROW_NOT_VISIBLE", HA_ERR_ROW_NOT_VISIBLE, "" },
{ "HA_ERR_ABORTED_BY_USER", HA_ERR_ABORTED_BY_USER, "" },
{ "HA_ERR_DISK_FULL", HA_ERR_DISK_FULL, "" },
{ "HA_ERR_INCOMPATIBLE_DEFINITION", HA_ERR_INCOMPATIBLE_DEFINITION, "" },
{ "HA_ERR_COMMIT_ERROR", HA_ERR_COMMIT_ERROR, "" },
{ "HA_ERR_PARTITION_LIST", HA_ERR_PARTITION_LIST, ""},
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, ""},
{ "HA_ERR_ROLLBACK", HA_ERR_ROLLBACK, "" },
server/big_endian.h000064400000010631150400263600010277 0ustar00/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.

   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 */

/*
  Data in big-endian format.
*/
#define float4store(T,A) do { *(T)= ((uchar *) &A)[3];\
                              *((T)+1)=(char) ((uchar *) &A)[2];\
                              *((T)+2)=(char) ((uchar *) &A)[1];\
                              *((T)+3)=(char) ((uchar *) &A)[0]; } while(0)

#define float4get(V,M)   do { float def_temp;\
                              ((uchar*) &def_temp)[0]=(M)[3];\
                              ((uchar*) &def_temp)[1]=(M)[2];\
                              ((uchar*) &def_temp)[2]=(M)[1];\
                              ((uchar*) &def_temp)[3]=(M)[0];\
                              (V)=def_temp; } while(0)

#define float8store(T,V) do { *(T)= ((uchar *) &V)[7];\
                              *((T)+1)=(char) ((uchar *) &V)[6];\
                              *((T)+2)=(char) ((uchar *) &V)[5];\
                              *((T)+3)=(char) ((uchar *) &V)[4];\
                              *((T)+4)=(char) ((uchar *) &V)[3];\
                              *((T)+5)=(char) ((uchar *) &V)[2];\
                              *((T)+6)=(char) ((uchar *) &V)[1];\
                              *((T)+7)=(char) ((uchar *) &V)[0]; } while(0)

#define float8get(V,M)   do { double def_temp;\
                              ((uchar*) &def_temp)[0]=(M)[7];\
                              ((uchar*) &def_temp)[1]=(M)[6];\
                              ((uchar*) &def_temp)[2]=(M)[5];\
                              ((uchar*) &def_temp)[3]=(M)[4];\
                              ((uchar*) &def_temp)[4]=(M)[3];\
                              ((uchar*) &def_temp)[5]=(M)[2];\
                              ((uchar*) &def_temp)[6]=(M)[1];\
                              ((uchar*) &def_temp)[7]=(M)[0];\
                              (V) = def_temp; } while(0)

#define ushortget(V,M)  do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\
                                 ((uint16) ((uint16) (M)[0]) << 8)); } while(0)
#define shortget(V,M)   do { V = (short) (((short) ((uchar) (M)[1]))+\
                                 ((short) ((short) (M)[0]) << 8)); } while(0)
#define longget(V,M)    do { int32 def_temp;\
                             ((uchar*) &def_temp)[0]=(M)[0];\
                             ((uchar*) &def_temp)[1]=(M)[1];\
                             ((uchar*) &def_temp)[2]=(M)[2];\
                             ((uchar*) &def_temp)[3]=(M)[3];\
                             (V)=def_temp; } while(0)
#define ulongget(V,M)   do { uint32 def_temp;\
                            ((uchar*) &def_temp)[0]=(M)[0];\
                            ((uchar*) &def_temp)[1]=(M)[1];\
                            ((uchar*) &def_temp)[2]=(M)[2];\
                            ((uchar*) &def_temp)[3]=(M)[3];\
                            (V)=def_temp; } while(0)
#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\
                             *(((char*)T)+1)=(char)(def_temp); \
                             *(((char*)T)+0)=(char)(def_temp >> 8); } while(0)
#define longstore(T,A)  do { *(((char*)T)+3)=((A));\
                             *(((char*)T)+2)=(((A) >> 8));\
                             *(((char*)T)+1)=(((A) >> 16));\
                             *(((char*)T)+0)=(((A) >> 24)); } while(0)

#define floatget(V,M)      memcpy(&V, (M), sizeof(float))
/* Cast away type qualifiers (necessary as macro takes argument by value). */
#define floatstore(T,V)    memcpy((T), (void*) (&V), sizeof(float))
#define doubleget(V,M)     memcpy(&V, (M), sizeof(double))
/* Cast away type qualifiers (necessary as macro takes argument by value). */
#define doublestore(T,V)   memcpy((T), (void*) &V, sizeof(double))
#define longlongget(V,M)   memcpy(&V, (M), sizeof(ulonglong))
#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
server/my_global.h000064400000100031150400263610010160 0ustar00/*
   Copyright (c) 2001, 2013, Oracle and/or its affiliates.
   Copyright (c) 2009, 2022, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/* This is the include file that should be included 'first' in every C file. */

#ifndef MY_GLOBAL_INCLUDED
#define MY_GLOBAL_INCLUDED

/*
  MDEV-25602 Deprecate __WIN__ symbol.
*/
#if defined (_MSC_VER) && !defined(__clang__)
#pragma deprecated("__WIN__")
#elif defined (__GNUC__)
#pragma GCC poison __WIN__
#endif

/*
  InnoDB depends on some MySQL internals which other plugins should not
  need.  This is because of InnoDB's foreign key support, "safe" binlog
  truncation, and other similar legacy features.

  We define accessors for these internals unconditionally, but do not
  expose them in mysql/plugin.h.  They are declared in ha_innodb.h for
  InnoDB's use.
*/
#define INNODB_COMPATIBILITY_HOOKS

#ifdef __CYGWIN__
/* We use a Unix API, so pretend it's not Windows */
#undef WIN
#undef WIN32
#undef _WIN
#undef _WIN32
#undef _WIN64
#undef _WIN32
#undef __WIN32__
#define HAVE_ERRNO_AS_DEFINE
#define _POSIX_MONOTONIC_CLOCK
#define _POSIX_THREAD_CPUTIME
#endif /* __CYGWIN__ */

#if defined(__OpenBSD__) && (OpenBSD >= 200411)
#define HAVE_ERRNO_AS_DEFINE
#endif

#if defined(i386) && !defined(__i386__)
#define __i386__
#endif

/* Macros to make switching between C and C++ mode easier */
#ifdef __cplusplus
#define C_MODE_START    extern "C" {
#define C_MODE_END	}
#else
#define C_MODE_START
#define C_MODE_END
#endif

#ifdef __cplusplus
#define CPP_UNNAMED_NS_START  namespace {
#define CPP_UNNAMED_NS_END    }
#endif

#include <my_config.h>

#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#define HAVE_PSI_INTERFACE
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */

/* Make it easier to add conditional code in _expressions_ */
#ifdef _WIN32
#define IF_WIN(A,B) A
#else
#define IF_WIN(A,B) B
#endif

#ifdef EMBEDDED_LIBRARY
#define IF_EMBEDDED(A,B) A
#else
#define IF_EMBEDDED(A,B) B
#endif

#ifdef WITH_PARTITION_STORAGE_ENGINE
#define IF_PARTITIONING(A,B) A
#else
#define IF_PARTITIONING(A,B) B
#endif

#if defined (_WIN32)
/*
 off_t is 32 bit long. We do not use C runtime functions
 with off_t but native Win32 file IO APIs, that work with
 64 bit offsets.
*/
#undef SIZEOF_OFF_T
#define SIZEOF_OFF_T 8

/*
 Prevent inclusion of  Windows GDI headers - they define symbol
 ERROR that conflicts with mysql headers.
*/
#ifndef NOGDI
#define NOGDI
#endif

/* Include common headers.*/
#include <winsock2.h>
#include <ws2tcpip.h> /* SOCKET */
#include <io.h>       /* access(), chmod() */
#include <process.h>  /* getpid() */

#define sleep(a) Sleep((a)*1000)

/* Define missing access() modes. */
#define F_OK 0
#define W_OK 2
#define R_OK 4                        /* Test for read permission.  */

/* Define missing file locking constants. */
#define F_RDLCK 1
#define F_WRLCK 2
#define F_UNLCK 3
#define F_TO_EOF 0x3FFFFFFF

#endif /* _WIN32*/

/*
  The macros below are used to allow build of Universal/fat binaries of
  MySQL and MySQL applications under darwin. 
*/
#if defined(__APPLE__) && defined(__MACH__)
#  undef SIZEOF_CHARP 
#  undef SIZEOF_INT 
#  undef SIZEOF_LONG 
#  undef SIZEOF_LONG_LONG 
#  undef SIZEOF_OFF_T 
#  undef WORDS_BIGENDIAN
#  define SIZEOF_INT 4
#  define SIZEOF_LONG_LONG 8
#  define SIZEOF_OFF_T 8
#  if defined(__i386__) || defined(__ppc__)
#    define SIZEOF_CHARP 4
#    define SIZEOF_LONG 4
#  elif defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__) || defined(__arm64__)
#    define SIZEOF_CHARP 8
#    define SIZEOF_LONG 8
#  else
#    error Building FAT binary for an unknown architecture.
#  endif
#  if defined(__ppc__) || defined(__ppc64__)
#    define WORDS_BIGENDIAN
#  endif
#endif /* defined(__APPLE__) && defined(__MACH__) */


/*
  The macros below are borrowed from include/linux/compiler.h in the
  Linux kernel. Use them to indicate the likelihood of the truthfulness
  of a condition. This serves two purposes - newer versions of gcc will be
  able to optimize for branch predication, which could yield siginficant
  performance gains in frequently executed sections of the code, and the
  other reason to use them is for documentation
*/

#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
#define __builtin_expect(x, expected_value) (x)
#endif

/* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef  _GNU_SOURCE
#define _GNU_SOURCE 1
#endif

/*
  Temporary solution to solve bug#7156. Include "sys/types.h" before
  the thread headers, else the function madvise() will not be defined
*/
#if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) )
#include <sys/types.h>
#endif

#define __EXTENSIONS__ 1	/* We want some extension */
#ifndef __STDC_EXT__
#define __STDC_EXT__ 1          /* To get large file support on hpux */
#endif

/*
  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document

    System Interfaces and Headers, Issue 5

  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
  but apparently other systems (namely FreeBSD) don't agree.

  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
  Furthermore, it tests that if a program requires older standard
  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
  run on a new compiler (that defines _STDC_C99) and issues an #error.
  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.

  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
  C++ compiler does not!

  So, in a desperate attempt to get correct prototypes for both
  C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500
  depending on the compiler's announced C standard support.

  Cleaner solutions are welcome.
*/
#ifdef __sun
#if __STDC_VERSION__ - 0 >= 199901L
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#endif


#ifdef _AIX
/*
  AIX includes inttypes.h from sys/types.h
  Explicitly request format macros before the first inclusion of inttypes.h
*/
#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif  // !defined(__STDC_FORMAT_MACROS)
#endif


#if !defined(_WIN32)
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif

#if !defined(SCO)
#define _REENTRANT	1	/* Some thread libraries require this */
#endif
#if !defined(_THREAD_SAFE) && !defined(_AIX)
#define _THREAD_SAFE            /* Required for OSF1 */
#endif
#if defined(HPUX10) || defined(HPUX11)
C_MODE_START			/* HPUX needs this, signal.h bug */
#include <pthread.h>
C_MODE_END
#else
#include <pthread.h>		/* AIX must have this included first */
#endif
#if !defined(SCO) && !defined(_REENTRANT)
#define _REENTRANT	1	/* Threads requires reentrant code */
#endif
#endif /* !defined(_WIN32) */

/* gcc/egcs issues */

#if defined(__GNUC) && defined(__EXCEPTIONS)
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif

#if defined(_lint) && !defined(lint)
#define lint
#endif

#ifndef stdin
#include <stdio.h>
#endif
#include <stdarg.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif

#include <math.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifdef HAVE_FENV_H
#include <fenv.h> /* For fesetround() */
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif /* TIME_WITH_SYS_TIME */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include <errno.h>				/* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
#if defined(HAVE_CRYPT_H)
#include <crypt.h>
#endif

/* Add checking if we are using likely/unlikely wrong */
#ifdef CHECK_UNLIKELY
C_MODE_START
extern void init_my_likely(), end_my_likely(FILE *);
extern int my_likely_ok(const char *file_name, uint line);
extern int my_likely_fail(const char *file_name, uint line);
C_MODE_END

#define likely(A) ((A) ? (my_likely_ok(__FILE__, __LINE__),1) : (my_likely_fail(__FILE__, __LINE__), 0))
#define unlikely(A) ((A) ? (my_likely_fail(__FILE__, __LINE__),1) : (my_likely_ok(__FILE__, __LINE__), 0))
/*
  These macros should be used when the check fails often when running benchmarks but
  we know for sure that the check is correct in a production environment
*/
#define checked_likely(A) (A)
#define checked_unlikely(A) (A)
#else
/**
  The semantics of builtin_expect() are that
  1) its two arguments are long
  2) it's likely that they are ==
  Those of our likely(x) are that x can be bool/int/longlong/pointer.
*/

#define likely(x)	__builtin_expect(((x) != 0),1)
#define unlikely(x)	__builtin_expect(((x) != 0),0)
#define checked_likely(x) likely(x)
#define checked_unlikely(x) unlikely(x)
#endif /* CHECK_UNLIKELY */

/*
  A lot of our programs uses asserts, so better to always include it
  This also fixes a problem when people uses DBUG_ASSERT without including
  assert.h
*/
#include <assert.h>

/* an assert that works at compile-time. only for constant expression */
#ifdef _some_old_compiler_that_does_not_understand_the_construct_below_
#define compile_time_assert(X)  do { } while(0)
#else
#define compile_time_assert(X)                                  \
  do                                                            \
  {                                                             \
    typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused)); \
  } while(0)
#endif

/* Go around some bugs in different OS and compilers */
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif

#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H)
#include <sys/stream.h>		/* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG
#endif
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE)
/* Fix bug in setrlimit */
#undef setrlimit
#define setrlimit cma_setrlimit64
#endif
/* Declare madvise where it is not declared for C++, like Solaris */
#if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus)
extern "C" int madvise(void *addr, size_t len, int behav);
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
/** FreeBSD equivalent */
#if defined(MADV_CORE) && !defined(MADV_DODUMP)
#define MADV_DODUMP MADV_CORE
#define MADV_DONTDUMP MADV_NOCORE
#define DODUMP_STR "MADV_CORE"
#define DONTDUMP_STR "MADV_NOCORE"
#else
#define DODUMP_STR "MADV_DODUMP"
#define DONTDUMP_STR "MADV_DONTDUMP"
#endif


#define QUOTE_ARG(x)		#x	/* Quote argument (before cpp) */
#define STRINGIFY_ARG(x) QUOTE_ARG(x)	/* Quote argument, after cpp */

/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
#ifdef I_AM_PARANOID
#define DONT_ALLOW_USER_CHANGE 1
#define DONT_USE_MYSQL_PWD 1
#endif

/* Does the system remember a signal handler after a signal ? */
#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
#define SIGNAL_HANDLER_RESET_ON_DELIVERY
#endif

/* don't assume that STDERR_FILENO is 2, mysqld can freopen */
#undef STDERR_FILENO

#ifndef SO_EXT
#ifdef _WIN32
#define SO_EXT ".dll"
#else
#define SO_EXT ".so"
#endif
#endif

/*
   Suppress uninitialized variable warning without generating code.
*/
#if defined(__GNUC__)
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x
#elif defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define UNINIT_VAR(x) x= 0
#else
#define UNINIT_VAR(x) x
#endif

/* This is only to be used when resetting variables in a class constructor */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define LINT_INIT(x) x= 0
#else
#define LINT_INIT(x)
#endif

#if !defined(HAVE_UINT)
#undef HAVE_UINT
#define HAVE_UINT
typedef unsigned int uint;
typedef unsigned short ushort;
#endif

#define swap_variables(t, a, b) do { t dummy; dummy= a; a= b; b= dummy; } while(0)
#define MY_TEST(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b)  do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))

/* Define some general constants */
#ifndef TRUE
#define TRUE		(1)	/* Logical true */
#define FALSE		(0)	/* Logical false */
#endif

#include <my_compiler.h>
#include <my_alloca.h>

/*
  Wen using the embedded library, users might run into link problems,
  duplicate declaration of __cxa_pure_virtual, solved by declaring it a
  weak symbol.
*/
#if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL)
C_MODE_START
int __cxa_pure_virtual () __attribute__ ((weak));
C_MODE_END
#endif

/* The DBUG_ON flag always takes precedence over default DBUG_OFF */
#if defined(DBUG_ON) && defined(DBUG_OFF)
#undef DBUG_OFF
#endif

/* We might be forced to turn debug off, if not turned off already */
#if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF)
#  define DBUG_OFF
#  ifdef DBUG_ON
#    undef DBUG_ON
#  endif
#endif

#ifdef DBUG_OFF
#undef EXTRA_DEBUG
#endif

/* Some types that is different between systems */

typedef int	File;		/* File descriptor */
#ifdef _WIN32
typedef SOCKET my_socket;
#else
typedef int	my_socket;	/* File descriptor for sockets */
#define INVALID_SOCKET -1
#endif
/* Type for functions that handles signals */
#define sig_handler RETSIGTYPE
#if defined(__GNUC__) && !defined(_lint)
typedef char	pchar;		/* Mixed prototypes can take char */
typedef char	puchar;		/* Mixed prototypes can take char */
typedef char	pbool;		/* Mixed prototypes can take char */
typedef short	pshort;		/* Mixed prototypes can take short int */
typedef float	pfloat;		/* Mixed prototypes can take float */
#else
typedef int	pchar;		/* Mixed prototypes can't take char */
typedef uint	puchar;		/* Mixed prototypes can't take char */
typedef int	pbool;		/* Mixed prototypes can't take char */
typedef int	pshort;		/* Mixed prototypes can't take short int */
typedef double	pfloat;		/* Mixed prototypes can't take float */
#endif

#include <my_cmp.h>

#define qsort_t RETQSORTTYPE	/* Broken GCC can't handle typedef !!!! */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
typedef SOCKET_SIZE_TYPE size_socket;

#ifndef SOCKOPT_OPTLEN_TYPE
#define SOCKOPT_OPTLEN_TYPE size_socket
#endif

/* file create flags */

#ifndef O_SHARE			/* Probably not windows */
#define O_SHARE		0	/* Flag to my_open for shared files */
#ifndef O_BINARY
#define O_BINARY	0	/* Flag to my_open for binary files */
#endif
#ifndef FILE_BINARY
#define FILE_BINARY	O_BINARY /* Flag to my_fopen for binary streams */
#endif
#ifdef HAVE_FCNTL
#define HAVE_FCNTL_LOCK
#define F_TO_EOF	0L	/* Param to lockf() to lock rest of file */
#endif
#endif /* O_SHARE */

#ifndef O_SEQUENTIAL
#define O_SEQUENTIAL	0
#endif
#ifndef O_SHORT_LIVED
#define O_SHORT_LIVED	0
#endif
#ifndef O_NOFOLLOW
#define O_NOFOLLOW      0
#endif
#ifndef O_CLOEXEC
#define O_CLOEXEC       0
#endif
#ifdef __GLIBC__
#define STR_O_CLOEXEC "e"
#else
#define STR_O_CLOEXEC ""
#endif
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC    0
#else
#define HAVE_SOCK_CLOEXEC
#endif

/* additional file share flags for win32 */
#ifdef _WIN32
#define _SH_DENYRWD     0x110    /* deny read/write mode & delete */
#define _SH_DENYWRD     0x120    /* deny write mode & delete      */
#define _SH_DENYRDD     0x130    /* deny read mode & delete       */
#define _SH_DENYDEL     0x140    /* deny delete only              */
#endif /* _WIN32 */


/* General constants */
#define FN_LEN		256	/* Max file name len */
#define FN_HEADLEN	253	/* Max length of filepart of file name */
#define FN_EXTLEN	20	/* Max length of extension (part of FN_LEN) */
#define FN_REFLEN	512	/* Max length of full path-name */
#define FN_EXTCHAR	'.'
#define FN_HOMELIB	'~'	/* ~/ is used as abbrev for home dir */
#define FN_CURLIB	'.'	/* ./ is used as abbrev for current dir */
#define FN_PARENTDIR	".."	/* Parent directory; Must be a string */

#ifdef _WIN32
#define FN_LIBCHAR	'\\'
#define FN_LIBCHAR2	'/'
#define FN_DIRSEP       "/\\"               /* Valid directory separators */
#define FN_EXEEXT   ".exe"
#define FN_SOEXT    ".dll"
#define FN_ROOTDIR	"\\"
#define FN_DEVCHAR	':'
#define FN_NETWORK_DRIVES	/* Uses \\ to indicate network drives */
#define FN_NO_CASE_SENCE	/* Files are not case-sensitive */
#else
#define FN_LIBCHAR	'/'
#define FN_LIBCHAR2	'/'
#define FN_DIRSEP       "/"     /* Valid directory separators */
#define FN_EXEEXT   ""
#define FN_SOEXT    ".so"
#define FN_ROOTDIR	"/"
#endif

/* 
  MY_FILE_MIN is  Windows speciality and is used to quickly detect
  the mismatch of CRT and mysys file IO usage on Windows at runtime.
  CRT file descriptors can be in the range 0-2047, whereas descriptors returned
  by my_open() will start with 2048. If a file descriptor with value less then
  MY_FILE_MIN is passed to mysys IO function, chances are it stems from
  open()/fileno() and not my_open()/my_fileno.

  For Posix,  mysys functions are light wrappers around libc, and MY_FILE_MIN
  is logically 0.
*/

#ifdef _WIN32
#define MY_FILE_MIN  2048
#else
#define MY_FILE_MIN  0
#endif

/* 
  MY_NFILE is the default size of my_file_info array.

  It is larger on Windows, because it all file handles are stored in my_file_info
  Default size is 16384 and this should be enough for most cases.If it is not 
  enough, --max-open-files with larger value can be used.

  For Posix , my_file_info array is only used to store filenames for
  error reporting and its size is not a limitation for number of open files.
*/ 
#ifdef _WIN32
#define MY_NFILE (16384 + MY_FILE_MIN)
#else
#define MY_NFILE 64
#endif

#ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT	UINT_MAX
#endif

/*
  Io buffer size; Must be a power of 2 and a multiple of 512. May be
  smaller what the disk page size. This influences the speed of the
  isam btree library. eg to big to slow.
*/
#define IO_SIZE			4096U
/*
  How much overhead does malloc/my_malloc have. The code often allocates
  something like 1024-MALLOC_OVERHEAD bytes
*/
#define MALLOC_OVERHEAD (8+24)

	/* get memory in huncs */
#define ONCE_ALLOC_INIT		(uint) 4096
	/* Typical record cache */
#define RECORD_CACHE_SIZE	(uint) (128*1024)
	/* Typical key cache */
#define KEY_CACHE_SIZE		(uint) (128L*1024L*1024L)
	/* Default size of a key cache block  */
#define KEY_CACHE_BLOCK_SIZE	(uint) 1024

	/* Some things that this system doesn't have */

#ifdef _WIN32
#define NO_DIR_LIBRARY		/* Not standard dir-library */
#endif

/* Some defines of functions for portability */

#undef remove		/* Crashes MySQL on SCO 5.0.0 */
#ifndef _WIN32
#define closesocket(A)	close(A)
#endif

#if defined(_MSC_VER)
#if !defined(_WIN64)
inline double my_ulonglong2double(unsigned long long value)
{
  long long nr=(long long) value;
  if (nr >= 0)
    return (double) nr;
  return (18446744073709551616.0 + (double) nr);
}
#define ulonglong2double my_ulonglong2double
#define my_off_t2double  my_ulonglong2double
#endif /* _WIN64 */
inline unsigned long long my_double2ulonglong(double d)
{
  double t= d - (double) 0x8000000000000000ULL;

  if (t >= 0)
    return  ((unsigned long long) t) + 0x8000000000000000ULL;
  return (unsigned long long) d;
}
#define double2ulonglong my_double2ulonglong
#endif

#ifndef ulonglong2double
#define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A)  ((double) (my_off_t) (A))
#endif
#ifndef double2ulonglong
#define double2ulonglong(A) ((ulonglong) (double) (A))
#endif

#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
#define ulong_to_double(X) ((double) (ulong) (X))

#ifndef STACK_DIRECTION
#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
#endif

#if !defined(HAVE_STRTOK_R)
#define strtok_r(A,B,C) strtok((A),(B))
#endif

#if SIZEOF_LONG_LONG >= 8
#define HAVE_LONG_LONG 1
#else
#error WHAT? sizeof(long long) < 8 ???
#endif

/*
  Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define
  ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined.
*/

#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN)
#define LONGLONG_MIN	((long long) 0x8000000000000000LL)
#define LONGLONG_MAX	((long long) 0x7FFFFFFFFFFFFFFFLL)
#endif
/* Max length needed for a buffer to hold a longlong or ulonglong + end \0 */
#define LONGLONG_BUFFER_SIZE 21

#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)
/* First check for ANSI C99 definition: */
#ifdef ULLONG_MAX
#define ULONGLONG_MAX  ULLONG_MAX
#else
#define ULONGLONG_MAX ((unsigned long long)(~0ULL))
#endif
#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/

#define INT_MIN64       (~0x7FFFFFFFFFFFFFFFLL)
#define INT_MAX64       0x7FFFFFFFFFFFFFFFLL
#define INT_MIN32       (~0x7FFFFFFFL)
#define INT_MAX32       0x7FFFFFFFL
#define UINT_MAX32      0xFFFFFFFFL
#define INT_MIN24       (~0x007FFFFF)
#define INT_MAX24       0x007FFFFF
#define UINT_MAX24      0x00FFFFFF
#define INT_MIN16       (~0x7FFF)
#define INT_MAX16       0x7FFF
#define UINT_MAX16      0xFFFF
#define INT_MIN8        (~0x7F)
#define INT_MAX8        0x7F
#define UINT_MAX8       0xFF

/* From limits.h instead */
#ifndef DBL_MIN
#define DBL_MIN		4.94065645841246544e-324
#define FLT_MIN		((float)1.40129846432481707e-45)
#endif
#ifndef DBL_MAX
#define DBL_MAX		1.79769313486231470e+308
#define FLT_MAX		((float)3.40282346638528860e+38)
#endif
#ifndef SIZE_T_MAX
#define SIZE_T_MAX      (~((size_t) 0))
#endif

/* Define missing math constants. */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_E
#define M_E 2.7182818284590452354
#endif
#ifndef M_LN2
#define M_LN2 0.69314718055994530942
#endif

/*
  Max size that must be added to a so that we know Size to make
  addressable obj.
*/
#if SIZEOF_CHARP == 4
typedef long		my_ptrdiff_t;
#else
typedef long long	my_ptrdiff_t;
#endif

#define MY_ALIGN(A,L)	   (((A) + (L) - 1) & ~((L) - 1))
#define MY_ALIGN_DOWN(A,L) ((A) & ~((L) - 1))
#define ALIGN_SIZE(A)	MY_ALIGN((A),sizeof(double))
#define ALIGN_MAX_UNIT  (sizeof(double))
/* Size to make addressable obj. */
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A), sizeof(double)))
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))

/*
  Custom version of standard offsetof() macro which can be used to get
  offsets of members in class for non-POD types (according to the current
  version of C++ standard offsetof() macro can't be used in such cases and
  attempt to do so causes warnings to be emitted, OTOH in many cases it is
  still OK to assume that all instances of the class has the same offsets
  for the same members).

  This is temporary solution which should be removed once File_parser class
  and related routines are refactored.
*/

#define my_offsetof(TYPE, MEMBER) PTR_BYTE_DIFF(&((TYPE *)0x10)->MEMBER, 0x10)

#define NullS		(char *) 0

#ifdef STDCALL
#undef STDCALL
#endif

#ifdef _WIN32
#define STDCALL __stdcall
#else
#define STDCALL
#endif

/* Typdefs for easier portability */

#ifndef HAVE_UCHAR
typedef unsigned char	uchar;	/* Short for unsigned char */
#endif

#ifndef HAVE_INT8
typedef signed char int8;       /* Signed integer >= 8  bits */
#endif
#ifndef HAVE_UINT8
typedef unsigned char uint8;    /* Unsigned integer >= 8  bits */
#endif
#ifndef HAVE_INT16
typedef short int16;
#endif
#ifndef HAVE_UINT16
typedef unsigned short uint16;
#endif
#if SIZEOF_INT == 4
#ifndef HAVE_INT32
typedef int int32;
#endif
#ifndef HAVE_UINT32
typedef unsigned int uint32;
#endif
#elif SIZEOF_LONG == 4
#ifndef HAVE_INT32
typedef long int32;
#endif
#ifndef HAVE_UINT32
typedef unsigned long uint32;
#endif
#else
#error Neither int or long is of 4 bytes width
#endif

#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
typedef unsigned long	ulong;		  /* Short for unsigned long */
#endif
#ifndef longlong_defined
/* 
  Using [unsigned] long long is preferable as [u]longlong because we use 
  [unsigned] long long unconditionally in many places, 
  for example in constants with [U]LL suffix.
*/
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int	longlong;
#else
typedef unsigned long	ulonglong;	  /* ulong or unsigned long long */
typedef long		longlong;
#endif
#endif
#ifndef HAVE_INT64
typedef longlong int64;
#endif
#ifndef HAVE_UINT64
typedef ulonglong uint64;
#endif

#if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong;
#elif defined (_WIN32)
typedef unsigned __int64 my_ulonglong;
#else
typedef unsigned long long my_ulonglong;
#endif

#if SIZEOF_CHARP == SIZEOF_INT
typedef unsigned int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG
typedef unsigned long intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
typedef unsigned long long intptr;
#else
#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
#endif

#define MY_ERRPTR ((void*)(intptr)1)

#if defined(_WIN32)
typedef unsigned long long my_off_t;
typedef unsigned long long os_off_t;
#else
typedef off_t os_off_t;
#if SIZEOF_OFF_T > 4
typedef ulonglong my_off_t;
#else
typedef unsigned long my_off_t;
#endif
#endif /*_WIN32*/
#define MY_FILEPOS_ERROR	(~(my_off_t) 0)

/*
  TODO Convert these to use Bitmap class.
 */
typedef ulonglong table_map;          /* Used for table bits in join */

/* often used type names - opaque declarations */
typedef const struct charset_info_st CHARSET_INFO;
typedef struct st_mysql_lex_string LEX_STRING;

#if defined(_WIN32)
#define socket_errno	WSAGetLastError()
#define SOCKET_EINTR	WSAEINTR
#define SOCKET_ETIMEDOUT WSAETIMEDOUT
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
#define SOCKET_EADDRINUSE WSAEADDRINUSE
#define SOCKET_ECONNRESET WSAECONNRESET
#define SOCKET_ENFILE	ENFILE
#define SOCKET_EMFILE	EMFILE
#define SOCKET_CLOSED   EIO
#else /* Unix */
#define socket_errno	errno
#define closesocket(A)	close(A)
#define SOCKET_EINTR	EINTR
#define SOCKET_EAGAIN	EAGAIN
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_EADDRINUSE EADDRINUSE
#define SOCKET_ETIMEDOUT ETIMEDOUT
#define SOCKET_ECONNRESET ECONNRESET
#define SOCKET_CLOSED   EIO
#define SOCKET_ENFILE	ENFILE
#define SOCKET_EMFILE	EMFILE
#endif

#include <mysql/plugin.h>  /* my_bool */

typedef ulong		myf;	/* Type of MyFlags in my_funcs */

#define MYF(v)		(myf) (v)

/*
  Defines to make it possible to prioritize register assignments. No
  longer that important with modern compilers.
*/
#ifndef USING_X
#define reg1 register
#define reg2 register
#define reg3 register
#define reg4 register
#define reg5 register
#define reg6 register
#define reg7 register
#define reg8 register
#define reg9 register
#define reg10 register
#define reg11 register
#define reg12 register
#define reg13 register
#define reg14 register
#define reg15 register
#define reg16 register
#endif

/*
  MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
  (i.e variables) for usage in storage engine loadable plugins.
  Outside of Windows, it is dummy.
*/
#ifndef MYSQL_PLUGIN_IMPORT
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
#else
#define MYSQL_PLUGIN_IMPORT
#endif
#endif

#include <my_dbug.h>

/* Some helper macros */
#define YESNO(X) ((X) ? "yes" : "no")

#define MY_HOW_OFTEN_TO_ALARM	2	/* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE	10000	/* How often we want info on screen */

#include <my_byteorder.h>

#ifdef HAVE_CHARSET_utf8mb4
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8mb4"
#elif defined(HAVE_CHARSET_utf8mb3)
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8mb3"
#else
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
#endif

#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
#define NO_EMBEDDED_ACCESS_CHECKS
#endif

#ifdef _WIN32
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
#define RTLD_DEFAULT GetModuleHandle(NULL)
#define dlclose(lib) FreeLibrary((HMODULE)lib)
static inline char *dlerror(void)
{
  static char win_errormsg[2048];
  FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
                 FORMAT_MESSAGE_IGNORE_INSERTS |
                 FORMAT_MESSAGE_MAX_WIDTH_MASK,
                 0, GetLastError(),
                 MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
                 win_errormsg, 2048, NULL);
  return win_errormsg;
}
#define HAVE_DLOPEN 1
#define HAVE_DLERROR 1
#endif

#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#ifdef HAVE_DLOPEN
#ifndef HAVE_DLERROR
#define dlerror() ""
#endif
#ifndef HAVE_DLADDR
#define dladdr(A, B) 0
/* Dummy definition in case we're missing dladdr() */
typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
#endif
#else
#define dlerror() "No support for dynamic loading (static build?)"
#define dlopen(A,B) 0
#define dlsym(A,B) 0
#define dlclose(A) 0
#define dladdr(A, B) 0
/* Dummy definition in case we're missing dladdr() */
typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
#endif

/*
 *  Include standard definitions of operator new and delete.
 */
#ifdef __cplusplus
#include <new>
#endif

/* Length of decimal number represented by INT32. */
#define MY_INT32_NUM_DECIMAL_DIGITS 11

/* Length of decimal number represented by INT64. */
#define MY_INT64_NUM_DECIMAL_DIGITS 21

#ifdef __cplusplus
#include <limits> /* should be included before min/max macros */
#endif

/* Define some useful general macros (should be done after all headers). */
#define MY_MAX(a, b)	((a) > (b) ? (a) : (b))
#define MY_MIN(a, b)	((a) < (b) ? (a) : (b))

#define CMP_NUM(a,b)    (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)

/*
  Only Linux is known to need an explicit sync of the directory to make sure a
  file creation/deletion/renaming in(from,to) this directory durable.
*/
#ifdef TARGET_OS_LINUX
#define NEED_EXPLICIT_SYNC_DIR 1
#else
/*
  On linux default rwlock scheduling policy is good enough for
  waiting_threads.c, on other systems use our special implementation
  (which is slower).

  QQ perhaps this should be tested in configure ? how ?
*/
#define WT_RWLOCKS_USE_MUTEXES 1
#endif

#if !defined(__cplusplus) && !defined(bool)
#define bool In_C_you_should_use_my_bool_instead()
#endif

/* Provide __func__ macro definition for platforms that miss it. */
#if !defined (__func__)
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
#  if __GNUC__ >= 2
#    define __func__ __FUNCTION__
#  else
#    define __func__ "<unknown>"
#  endif
#elif defined(_MSC_VER)
#  if _MSC_VER < 1300
#    define __func__ "<unknown>"
#  else
#    define __func__ __FUNCTION__
#  endif
#elif defined(__BORLANDC__)
#  define __func__ __FUNC__
#else
#  define __func__ "<unknown>"
#endif
#endif /* !defined(__func__) */

/* Defines that are unique to the embedded version of MySQL */

#ifdef EMBEDDED_LIBRARY

/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */

#else
#define HAVE_REPLICATION
#define HAVE_EXTERNAL_CLIENT
#endif /* EMBEDDED_LIBRARY */

/*
  Provide defaults for the CPU cache line size, if it has not been detected by
  CMake using getconf
*/
#if !defined(CPU_LEVEL1_DCACHE_LINESIZE) || CPU_LEVEL1_DCACHE_LINESIZE == 0
  #if defined(CPU_LEVEL1_DCACHE_LINESIZE) && CPU_LEVEL1_DCACHE_LINESIZE == 0
    #undef CPU_LEVEL1_DCACHE_LINESIZE
  #endif

  #if defined(__s390__)
    #define CPU_LEVEL1_DCACHE_LINESIZE 256
  #elif defined(__powerpc__) || defined(__aarch64__)
    #define CPU_LEVEL1_DCACHE_LINESIZE 128
  #else
    #define CPU_LEVEL1_DCACHE_LINESIZE 64
  #endif
#endif

#define FLOATING_POINT_DECIMALS 31

/* Keep client compatible with earlier versions */
#ifdef MYSQL_SERVER
#define NOT_FIXED_DEC           DECIMAL_NOT_SPECIFIED
#else
#define NOT_FIXED_DEC           FLOATING_POINT_DECIMALS
#endif
#endif /* my_global_h */
server/mysql/service_encryption.h000064400000013031150400263610013275 0ustar00#ifndef MYSQL_SERVICE_ENCRYPTION_INCLUDED
/* Copyright (c) 2015, MariaDB

   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 */

/**
  @file
  encryption service

  Functions to support data encryption and encryption key management.
  They are normally implemented in an encryption plugin, so this service
  connects encryption *consumers* (e.g. storage engines) to the encryption
  *provider* (encryption plugin).
*/

#ifndef MYSQL_ABI_CHECK
#include <my_alloca.h>
#ifdef _WIN32
#ifndef __cplusplus
#define inline __inline
#endif
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* returned from encryption_key_get_latest_version() */
#define ENCRYPTION_KEY_VERSION_INVALID        (~(unsigned int)0)
#define ENCRYPTION_KEY_NOT_ENCRYPTED          (0)

#define ENCRYPTION_KEY_SYSTEM_DATA             1
#define ENCRYPTION_KEY_TEMPORARY_DATA          2

/* returned from encryption_key_get()  */
#define ENCRYPTION_KEY_BUFFER_TOO_SMALL    (100)

#define ENCRYPTION_FLAG_DECRYPT     0
#define ENCRYPTION_FLAG_ENCRYPT     1
#define ENCRYPTION_FLAG_NOPAD       2

struct encryption_service_st {
  unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
  unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
                                          unsigned char* buffer, unsigned int* length);
  unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
  int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
                                  const unsigned char* iv, unsigned int ivlen,
                                  int flags, unsigned int key_id,
                                  unsigned int key_version);
  int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
                                    unsigned char* dst, unsigned int* dlen);
  int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
  unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};

#ifdef MYSQL_DYNAMIC_PLUGIN

extern struct encryption_service_st *encryption_service;

#define encryption_key_get_latest_version(KI) encryption_service->encryption_key_get_latest_version_func(KI)
#define encryption_key_get(KI,KV,K,S) encryption_service->encryption_key_get_func((KI),(KV),(K),(S))
#define encryption_ctx_size(KI,KV) encryption_service->encryption_ctx_size_func((KI),(KV))
#define encryption_ctx_init(CTX,K,KL,IV,IVL,F,KI,KV) encryption_service->encryption_ctx_init_func((CTX),(K),(KL),(IV),(IVL),(F),(KI),(KV))
#define encryption_ctx_update(CTX,S,SL,D,DL) encryption_service->encryption_ctx_update_func((CTX),(S),(SL),(D),(DL))
#define encryption_ctx_finish(CTX,D,DL) encryption_service->encryption_ctx_finish_func((CTX),(D),(DL))
#define encryption_encrypted_length(SL,KI,KV) encryption_service->encryption_encrypted_length_func((SL),(KI),(KV))
#else

extern struct encryption_service_st encryption_handler;

#define encryption_key_get_latest_version(KI) encryption_handler.encryption_key_get_latest_version_func(KI)
#define encryption_key_get(KI,KV,K,S) encryption_handler.encryption_key_get_func((KI),(KV),(K),(S))
#define encryption_ctx_size(KI,KV) encryption_handler.encryption_ctx_size_func((KI),(KV))
#define encryption_ctx_init(CTX,K,KL,IV,IVL,F,KI,KV) encryption_handler.encryption_ctx_init_func((CTX),(K),(KL),(IV),(IVL),(F),(KI),(KV))
#define encryption_ctx_update(CTX,S,SL,D,DL) encryption_handler.encryption_ctx_update_func((CTX),(S),(SL),(D),(DL))
#define encryption_ctx_finish(CTX,D,DL) encryption_handler.encryption_ctx_finish_func((CTX),(D),(DL))
#define encryption_encrypted_length(SL,KI,KV) encryption_handler.encryption_encrypted_length_func((SL),(KI),(KV))
#endif

static inline unsigned int encryption_key_id_exists(unsigned int id)
{
  return encryption_key_get_latest_version(id) != ENCRYPTION_KEY_VERSION_INVALID;
}

static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
  unsigned int unused;
  return encryption_key_get(id, version, NULL, &unused) != ENCRYPTION_KEY_VERSION_INVALID;
}

static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
                                   unsigned char* dst, unsigned int* dlen,
                                   const unsigned char* key, unsigned int klen,
                                   const unsigned char* iv, unsigned int ivlen,
                                   int flags, unsigned int key_id, unsigned int key_version)
{
  void *ctx= alloca(encryption_ctx_size(key_id, key_version));
  int res1, res2;
  unsigned int d1, d2;
  if ((res1= encryption_ctx_init(ctx, key, klen, iv, ivlen, flags, key_id, key_version)))
    return res1;
  res1= encryption_ctx_update(ctx, src, slen, dst, &d1);
  res2= encryption_ctx_finish(ctx, dst + d1, &d2);
  *dlen= d1 + d2;
  return res1 ? res1 : res2;
}

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_ENCRYPTION_INCLUDED
#endif

server/mysql/service_base64.h000064400000005564150400263610012203 0ustar00#ifndef MYSQL_SERVICE_BASE64_INCLUDED
/* Copyright (c) 2017, MariaDB

   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 */

/**
  @file
  my base64 service

  Functions for base64 en- and decoding
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

/* Allow multiple chunks 'AAA= AA== AA==', binlog uses this */
#define MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS 1

extern struct base64_service_st {
  int (*base64_needed_encoded_length_ptr)(int length_of_data);
  int (*base64_encode_max_arg_length_ptr)(void);
  int (*base64_needed_decoded_length_ptr)(int length_of_encoded_data);
  int (*base64_decode_max_arg_length_ptr)();
  int (*base64_encode_ptr)(const void *src, size_t src_len, char *dst);
  int (*base64_decode_ptr)(const char *src, size_t src_len,
                           void *dst, const char **end_ptr, int flags);
} *base64_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_base64_needed_encoded_length(A) base64_service->base64_needed_encoded_length_ptr(A)
#define my_base64_encode_max_arg_length() base64_service->base64_encode_max_arg_length_ptr()
#define my_base64_needed_decoded_length(A) base64_service->base64_needed_decoded_length_ptr(A)
#define my_base64_decode_max_arg_length() base64_service->base64_decode_max_arg_length_ptr()
#define my_base64_encode(A,B,C) base64_service->base64_encode_ptr(A,B,C)
#define my_base64_decode(A,B,C,D,E) base64_service->base64_decode_ptr(A,B,C,D,E)

#else

/* Calculate how much memory needed for dst of my_base64_encode() */
int my_base64_needed_encoded_length(int length_of_data);

/* Maximum length my_base64_encode_needed_length() can accept with no overflow.  */
int my_base64_encode_max_arg_length(void);

/* Calculate how much memory needed for dst of my_base64_decode() */
int my_base64_needed_decoded_length(int length_of_encoded_data);

/* Maximum length my_base64_decode_needed_length() can accept with no overflow.  */
int my_base64_decode_max_arg_length();

/* Encode data as a my_base64 string */
int my_base64_encode(const void *src, size_t src_len, char *dst);

/* Decode a my_base64 string into data */
int my_base64_decode(const char *src, size_t src_len,
                  void *dst, const char **end_ptr, int flags);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_BASE64_INCLUDED
#endif
server/mysql/service_my_snprintf.h000064400000007212150400263610013457 0ustar00#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
/* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @file
  my_snprintf service

  Portable and limited vsnprintf() implementation.

  This is a portable, limited vsnprintf() implementation, with some
  extra features. "Portable" means that it'll produce identical result
  on all platforms (for example, on Windows and Linux system printf %e
  formats the exponent differently, on different systems %p either
  prints leading 0x or not, %s may accept null pointer or crash on
  it). "Limited" means that it does not support all the C89 features.
  But it supports few extensions, not in any standard.

  my_vsnprintf(to, n, fmt, ap)

  @param[out] to     A buffer to store the result in
  @param[in]  n      Store up to n-1 characters, followed by an end 0
  @param[in]  fmt    printf-like format string
  @param[in]  ap     Arguments

  @return a number of bytes written to a buffer *excluding* terminating '\0'

  @post
  The syntax of a format string is generally the same:
  % <flag> <width> <precision> <length modifier> <format>
  where everything but the format is optional.

  Three one-character flags are recognized:
    '0' has the standard zero-padding semantics;
    '-' is parsed, but silently ignored;
    '`' (backtick) is only supported for strings (%s) and means that the
        string will be quoted according to MySQL identifier quoting rules.

  Both <width> and <precision> can be specified as numbers or '*'.
  If an asterisk is used, an argument of type int is consumed.

  <length modifier> can be 'l', 'll', or 'z'.

  Supported formats are 's' (null pointer is accepted, printed as
  "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
  'X', 'p' (works as 0x%x), 'f', 'g', 'M' (extension, see below),
  'T' (extension, see below).

  Standard syntax for positional arguments $n is supported.

  Extensions:

  Flag '`' (backtick): see above.

  Format 'b': binary buffer, prints exactly <precision> bytes from the
  argument, without stopping at '\0'.

  Format 'M': takes one integer, prints this integer, space, double quote
  error message, double quote. In other words
    printf("%M", n) === printf("%d \"%s\"", n, strerror(n))

  Format 'T': takes string and print it like s but if the strints should be
  truncated puts "..." at the end.
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#include <stdlib.h>
#endif

extern struct my_snprintf_service_st {
  size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
  size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_vsnprintf my_snprintf_service->my_vsnprintf_type
#define my_snprintf my_snprintf_service->my_snprintf_type

#else

size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
#endif

server/mysql/service_thd_timezone.h000064400000004363150400263610013604 0ustar00#ifndef MYSQL_SERVICE_THD_TIMEZONE_INCLUDED
/* Copyright (C) 2013 MariaDB Foundation.

   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 */

/**
  @file
  This service provides functions to convert between my_time_t and
  MYSQL_TIME taking into account the current value of the time_zone
  session variable.

  The values of the my_time_t type are in Unix timestamp format,
  i.e. the number of seconds since "1970-01-01 00:00:00 UTC".

  The values of the MYSQL_TIME type are in the current time zone,
  according to thd->variables.time_zone.

  If the MYSQL_THD parameter is NULL, then global_system_variables.time_zone
  is used for conversion.
*/

#ifndef MYSQL_ABI_CHECK
/*
  This service currently does not depend on any system headers.
  If it needs system headers in the future, make sure to put
  them inside this ifndef.
*/
#endif

#include "mysql_time.h"

#ifdef __cplusplus
extern "C" {
#endif


extern struct thd_timezone_service_st {
  my_time_t (*thd_TIME_to_gmt_sec)(MYSQL_THD thd, const MYSQL_TIME *ltime, unsigned int *errcode);
  void (*thd_gmt_sec_to_TIME)(MYSQL_THD thd, MYSQL_TIME *ltime, my_time_t t);
} *thd_timezone_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define thd_TIME_to_gmt_sec(thd, ltime, errcode) \
  (thd_timezone_service->thd_TIME_to_gmt_sec((thd), (ltime), (errcode)))

#define thd_gmt_sec_to_TIME(thd, ltime, t) \
  (thd_timezone_service->thd_gmt_sec_to_TIME((thd), (ltime), (t)))

#else

my_time_t thd_TIME_to_gmt_sec(MYSQL_THD thd, const MYSQL_TIME *ltime, unsigned int *errcode);
void thd_gmt_sec_to_TIME(MYSQL_THD thd, MYSQL_TIME *ltime, my_time_t t);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_THD_TIMEZONE_INCLUDED
#endif
server/mysql/service_thd_mdl.h000064400000002402150400263610012516 0ustar00/* Copyright (c) 2019, 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 */

#pragma once

/**
  @file include/mysql/service_thd_mdl.h
  This service provides functions for plugins and storage engines to access
  metadata locks.
*/

#ifdef __cplusplus
extern "C" {
#endif


extern struct thd_mdl_service_st {
  void *(*thd_mdl_context)(MYSQL_THD);
} *thd_mdl_service;

#ifdef MYSQL_DYNAMIC_PLUGIN
# define thd_mdl_context(_THD) thd_mdl_service->thd_mdl_context(_THD)
#else
/**
  MDL_context accessor
  @param thd   the current session
  @return pointer to thd->mdl_context
*/
void *thd_mdl_context(MYSQL_THD thd);
#endif

#ifdef __cplusplus
}
#endif
server/mysql/service_log_warnings.h000064400000002541150400263610013600 0ustar00/* Copyright (c) 2013, 2018, MariaDB

   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 */

#ifndef MYSQL_SERVICE_LOG_WARNINGS
#define MYSQL_SERVICE_LOG_WARNINGS

/**
  @file
  This service provides access to the log warning level for the
  current session.

  thd_log_warnings(thd)
  @return thd->log_warnings
*/

#ifdef __cplusplus
extern "C" {
#endif

extern struct thd_log_warnings_service_st {
  void *(*thd_log_warnings)(MYSQL_THD);
} *thd_log_warnings_service;

#ifdef MYSQL_DYNAMIC_PLUGIN
# define thd_log_warnings(THD) thd_log_warnings_service->thd_log_warnings(THD)
#else
/**
  MDL_context accessor
  @param thd   the current session
  @return pointer to thd->mdl_context
*/
int thd_log_warnings(MYSQL_THD thd);
#endif

#ifdef __cplusplus
}
#endif

#endif

server/mysql/services.h000064400000003342150400263610011212 0ustar00#ifndef MYSQL_SERVICES_INCLUDED
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
   Copyright (c) 2012, 2017, MariaDB

   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 */

#ifdef __cplusplus
extern "C" {
#endif

#include <mysql/service_base64.h>
#include <mysql/service_debug_sync.h>
#include <mysql/service_encryption.h>
#include <mysql/service_encryption_scheme.h>
#include <mysql/service_kill_statement.h>
#include <mysql/service_logger.h>
#include <mysql/service_md5.h>
#include <mysql/service_my_crypt.h>
#include <mysql/service_my_print_error.h>
#include <mysql/service_my_snprintf.h>
#include <mysql/service_progress_report.h>
#include <mysql/service_sha1.h>
#include <mysql/service_sha2.h>
#include <mysql/service_thd_alloc.h>
#include <mysql/service_thd_autoinc.h>
#include <mysql/service_thd_error_context.h>
#include <mysql/service_thd_rnd.h>
#include <mysql/service_thd_specifics.h>
#include <mysql/service_thd_timezone.h>
#include <mysql/service_thd_wait.h>
#include <mysql/service_json.h>
/*#include <mysql/service_wsrep.h>*/
#include <mysql/service_sql.h>

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICES_INCLUDED
#endif

server/mysql/plugin_audit.h000064400000012641150400263610012055 0ustar00/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _my_audit_h
#define _my_audit_h

/*************************************************************************
  API for Audit plugin. (MYSQL_AUDIT_PLUGIN)
*/

#include "plugin.h"

#ifdef __cplusplus
extern "C" {
#endif

#define MYSQL_AUDIT_CLASS_MASK_SIZE 1

#define MYSQL_AUDIT_INTERFACE_VERSION 0x0302


/*************************************************************************
  AUDIT CLASS : GENERAL
  
  LOG events occurs before emitting to the general query log.
  ERROR events occur before transmitting errors to the user. 
  RESULT events occur after transmitting a resultset to the user.
  STATUS events occur after transmitting a resultset or errors
  to the user.
*/

#define MYSQL_AUDIT_GENERAL_CLASS 0
#define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS)
#define MYSQL_AUDIT_GENERAL_LOG 0
#define MYSQL_AUDIT_GENERAL_ERROR 1
#define MYSQL_AUDIT_GENERAL_RESULT 2
#define MYSQL_AUDIT_GENERAL_STATUS 3

struct mysql_event_general
{
  unsigned int event_subclass;
  int general_error_code;
  unsigned long general_thread_id;
  const char *general_user;
  unsigned int general_user_length;
  const char *general_command;
  unsigned int general_command_length;
  const char *general_query;
  unsigned int general_query_length;
  const struct charset_info_st *general_charset;
  unsigned long long general_time;
  unsigned long long general_rows;
  /* Added in version 0x302 */
  unsigned long long query_id;
  MYSQL_CONST_LEX_STRING database;
};


/*
  AUDIT CLASS : CONNECTION
  
  CONNECT occurs after authentication phase is completed.
  DISCONNECT occurs after connection is terminated.
  CHANGE_USER occurs after COM_CHANGE_USER RPC is completed.
*/

#define MYSQL_AUDIT_CONNECTION_CLASS 1
#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS)
#define MYSQL_AUDIT_CONNECTION_CONNECT 0
#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1
#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2

struct mysql_event_connection
{
  unsigned int event_subclass;
  int status;
  unsigned long thread_id;
  const char *user;
  unsigned int user_length;
  const char *priv_user;
  unsigned int priv_user_length;
  const char *external_user;
  unsigned int external_user_length;
  const char *proxy_user;
  unsigned int proxy_user_length;
  const char *host;
  unsigned int host_length;
  const char *ip;
  unsigned int ip_length;
  MYSQL_CONST_LEX_STRING database;
};

/*
  AUDIT CLASS : TABLE
  
  LOCK occurs when a connection "locks" (this does not necessarily mean a table
  lock and also happens for row-locking engines) the table at the beginning of
  a statement. This event is generated at the beginning of every statement for
  every affected table, unless there's a LOCK TABLES statement in effect (in
  which case it is generated once for LOCK TABLES and then is suppressed until
  the tables are unlocked).

  CREATE/DROP/RENAME occur when a table is created, dropped, or renamed.
*/

#define MYSQL_AUDIT_TABLE_CLASS 15
#define MYSQL_AUDIT_TABLE_CLASSMASK (1 << MYSQL_AUDIT_TABLE_CLASS)
#define MYSQL_AUDIT_TABLE_LOCK   0
#define MYSQL_AUDIT_TABLE_CREATE 1
#define MYSQL_AUDIT_TABLE_DROP   2
#define MYSQL_AUDIT_TABLE_RENAME 3
#define MYSQL_AUDIT_TABLE_ALTER  4

struct mysql_event_table
{
  unsigned int event_subclass;
  unsigned long thread_id;
  const char *user;
  const char *priv_user;
  const char *priv_host;
  const char *external_user;
  const char *proxy_user;
  const char *host;
  const char *ip;
  MYSQL_CONST_LEX_STRING database;
  MYSQL_CONST_LEX_STRING table;
  /* for MYSQL_AUDIT_TABLE_RENAME */
  MYSQL_CONST_LEX_STRING new_database;
  MYSQL_CONST_LEX_STRING new_table;
  /* for MYSQL_AUDIT_TABLE_LOCK, true if read-only, false if read/write */
  int read_only;
  /* Added in version 0x302 */
  unsigned long long query_id;
};

/*************************************************************************
  Here we define the descriptor structure, that is referred from
  st_mysql_plugin.

  release_thd() event occurs when the event class consumer is to be
  disassociated from the specified THD. This would typically occur
  before some operation which may require sleeping - such as when
  waiting for the next query from the client.
  
  event_notify() is invoked whenever an event occurs which is of any
  class for which the plugin has interest. The second argument
  indicates the specific event class and the third argument is data
  as required for that class.
  
  class_mask is an array of bits used to indicate what event classes
  that this plugin wants to receive.
*/

struct st_mysql_audit
{
  int interface_version;
  void (*release_thd)(MYSQL_THD);
  void (*event_notify)(MYSQL_THD, unsigned int, const void *);
  unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
};


#ifdef __cplusplus
}
#endif

#endif
server/mysql/service_encryption_scheme.h000064400000013016150400263610014624 0ustar00#ifndef MYSQL_SERVICE_ENCRYPTION_SCHEME_INCLUDED
/* Copyright (c) 2015, MariaDB

   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 */

/**
  @file
  encryption scheme service

  A higher-level access to encryption service.

  This is a helper service that storage engines use to encrypt tables on disk.
  It requests keys from the plugin, generates temporary or local keys
  from the global (as returned by the plugin) keys, etc.

  To use the service:

  * st_encryption_scheme object is created per space. A "space" can be
    a table space in XtraDB/InnoDB, a file in Aria, etc.  The whole
    space is encrypted with the one key id.

  * The service does not take the key and the IV as parameters for
    encryption or decryption. Instead it takes two 32-bit integers and
    one 64-bit integer (and requests the key from an encryption
    plugin, if needed).

  * The service requests the global key from the encryption plugin
    automatically as needed. Three last keys are cached in the
    st_encryption_scheme. Number of key requests (number of cache
    misses) are counted in st_encryption_scheme::keyserver_requests

  * If an st_encryption_scheme can be used concurrently by different
    threads, it needs to be able to lock itself when accessing the key
    cache.  Set the st_encryption_scheme::locker appropriately. If
    non-zero, it will be invoked by encrypt/decrypt functions to lock
    and unlock the scheme when needed.

  * Implementation details (in particular, key derivation) are defined
    by the scheme type. Currently only schema type 1 is supported.

  In the schema type 1, every "space" (table space in XtraDB/InnoDB,
  file in Aria) is encrypted with a different space-local key:

  * Every space has a 16-byte unique identifier (typically it's
    generated randomly and stored in the space). The caller should
    put it into st_encryption_scheme::iv.

  * Space-local key is generated by encrypting this identifier with
    the global encryption key (of the given id and version) using AES_ECB.

  * Encryption/decryption parameters for a page are typically the
    4-byte space id, 4-byte page position (offset, page number, etc),
    and the 8-byte LSN. This guarantees that they'll be different for
    any two pages (of the same or different tablespaces) and also that
    they'll change for the same page when it's modified. They don't need
    to be secret (they create the IV, not the encryption key).
*/

#ifdef __cplusplus
extern "C" {
#endif

#define ENCRYPTION_SCHEME_KEY_INVALID    -1
#define ENCRYPTION_SCHEME_BLOCK_LENGTH   16

struct st_encryption_scheme_key {
  unsigned int version;
  unsigned char key[ENCRYPTION_SCHEME_BLOCK_LENGTH];
};

struct st_encryption_scheme {
  unsigned char iv[ENCRYPTION_SCHEME_BLOCK_LENGTH];
  struct st_encryption_scheme_key key[3];
  unsigned int keyserver_requests;
  unsigned int key_id;
  unsigned int type;

  void (*locker)(struct st_encryption_scheme *self, int release);
};

extern struct encryption_scheme_service_st {
  int (*encryption_scheme_encrypt_func)
                               (const unsigned char* src, unsigned int slen,
                                unsigned char* dst, unsigned int* dlen,
                                struct st_encryption_scheme *scheme,
                                unsigned int key_version, unsigned int i32_1,
                                unsigned int i32_2, unsigned long long i64);
  int (*encryption_scheme_decrypt_func)
                               (const unsigned char* src, unsigned int slen,
                                unsigned char* dst, unsigned int* dlen,
                                struct st_encryption_scheme *scheme,
                                unsigned int key_version, unsigned int i32_1,
                                unsigned int i32_2, unsigned long long i64);
} *encryption_scheme_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define encryption_scheme_encrypt(S,SL,D,DL,SCH,KV,I32,J32,I64) encryption_scheme_service->encryption_scheme_encrypt_func(S,SL,D,DL,SCH,KV,I32,J32,I64)
#define encryption_scheme_decrypt(S,SL,D,DL,SCH,KV,I32,J32,I64) encryption_scheme_service->encryption_scheme_decrypt_func(S,SL,D,DL,SCH,KV,I32,J32,I64)

#else

int encryption_scheme_encrypt(const unsigned char* src, unsigned int slen,
                              unsigned char* dst, unsigned int* dlen,
                              struct st_encryption_scheme *scheme,
                              unsigned int key_version, unsigned int i32_1,
                              unsigned int i32_2, unsigned long long i64);
int encryption_scheme_decrypt(const unsigned char* src, unsigned int slen,
                              unsigned char* dst, unsigned int* dlen,
                              struct st_encryption_scheme *scheme,
                              unsigned int key_version, unsigned int i32_1,
                              unsigned int i32_2, unsigned long long i64);

#endif


#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_ENCRYPTION_SCHEME_INCLUDED
#endif
server/mysql/service_sha1.h000064400000004162150400263610011744 0ustar00#ifndef MYSQL_SERVICE_SHA1_INCLUDED
/* Copyright (c) 2013, 2014, Monty Program Ab

   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 */

/**
  @file
  my sha1 service

  Functions to calculate SHA1 hash from a memory buffer
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

#define MY_SHA1_HASH_SIZE 20 /* Hash size in bytes */

extern struct my_sha1_service_st {
  void (*my_sha1_type)(unsigned char*, const char*, size_t);
  void (*my_sha1_multi_type)(unsigned char*, ...);
  size_t (*my_sha1_context_size_type)();
  void (*my_sha1_init_type)(void *);
  void (*my_sha1_input_type)(void *, const unsigned char *, size_t);
  void (*my_sha1_result_type)(void *, unsigned char *);
} *my_sha1_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_sha1(A,B,C) my_sha1_service->my_sha1_type(A,B,C)
#define my_sha1_multi my_sha1_service->my_sha1_multi_type
#define my_sha1_context_size() my_sha1_service->my_sha1_context_size_type()
#define my_sha1_init(A) my_sha1_service->my_sha1_init_type(A)
#define my_sha1_input(A,B,C) my_sha1_service->my_sha1_input_type(A,B,C)
#define my_sha1_result(A,B) my_sha1_service->my_sha1_result_type(A,B)

#else

void my_sha1(unsigned char*, const char*, size_t);
void my_sha1_multi(unsigned char*, ...);
size_t my_sha1_context_size();
void my_sha1_init(void *context);
void my_sha1_input(void *context, const unsigned char *buf, size_t len);
void my_sha1_result(void *context, unsigned char *digest);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_SHA1_INCLUDED
#endif

server/mysql/service_kill_statement.h000064400000004026150400263610014126 0ustar00/* Copyright (c) 2013, 2018, MariaDB

   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 */

#ifndef MYSQL_SERVICE_KILL_STATEMENT_INCLUDED
#define MYSQL_SERVICE_KILL_STATEMENT_INCLUDED

/**
  @file
  This service provides functions that allow plugins to support
  the KILL statement.

  In MySQL support for the KILL statement is cooperative. The KILL
  statement only sets a "killed" flag. This function returns the value
  of that flag.  A thread should check it often, especially inside
  time-consuming loops, and gracefully abort the operation if it is
  non-zero.

  thd_killed(thd)
  @return 0 - no KILL statement was issued, continue normally
  @return 1 - there was a KILL statement, abort the execution.

  thd_kill_level(thd)
  @return thd_kill_levels_enum values
*/

#ifdef __cplusplus
extern "C" {
#endif

enum thd_kill_levels {
  THD_IS_NOT_KILLED=0,
  THD_ABORT_SOFTLY=50, /**< abort when possible, don't leave tables corrupted */
  THD_ABORT_ASAP=100,  /**< abort asap */
};

extern struct kill_statement_service_st {
  enum thd_kill_levels (*thd_kill_level_func)(const MYSQL_THD);
} *thd_kill_statement_service;

/* backward compatibility helper */
#define thd_killed(THD)   (thd_kill_level(THD) == THD_ABORT_ASAP)

#ifdef MYSQL_DYNAMIC_PLUGIN

#define thd_kill_level(THD) \
        thd_kill_statement_service->thd_kill_level_func(THD)

#else

enum thd_kill_levels thd_kill_level(const MYSQL_THD);

#endif

#ifdef __cplusplus
}
#endif

#endif

server/mysql/service_md5.h000064400000004107150400263610011574 0ustar00#ifndef MYSQL_SERVICE_MD5_INCLUDED
/* Copyright (c) 2014, Monty Program Ab

   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 */

/**
  @file
  my md5 service

  Functions to calculate MD5 hash from a memory buffer
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

#define MY_MD5_HASH_SIZE 16 /* Hash size in bytes */

extern struct my_md5_service_st {
  void (*my_md5_type)(unsigned char*, const char*, size_t);
  void (*my_md5_multi_type)(unsigned char*, ...);
  size_t (*my_md5_context_size_type)();
  void (*my_md5_init_type)(void *);
  void (*my_md5_input_type)(void *, const unsigned char *, size_t);
  void (*my_md5_result_type)(void *, unsigned char *);
} *my_md5_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_md5(A,B,C) my_md5_service->my_md5_type(A,B,C)
#define my_md5_multi my_md5_service->my_md5_multi_type
#define my_md5_context_size() my_md5_service->my_md5_context_size_type()
#define my_md5_init(A) my_md5_service->my_md5_init_type(A)
#define my_md5_input(A,B,C) my_md5_service->my_md5_input_type(A,B,C)
#define my_md5_result(A,B) my_md5_service->my_md5_result_type(A,B)

#else

void my_md5(unsigned char*, const char*, size_t);
void my_md5_multi(unsigned char*, ...);
size_t my_md5_context_size();
void my_md5_init(void *context);
void my_md5_input(void *context, const unsigned char *buf, size_t len);
void my_md5_result(void *context, unsigned char *digest);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_MD5_INCLUDED
#endif

server/mysql/psi/mysql_thread.h000064400000077610150400263620012670 0ustar00/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
  Copyright (c) 2020, 2021, MariaDB Corporation.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_THREAD_H
#define MYSQL_THREAD_H

/**
  @file mysql/psi/mysql_thread.h
  Instrumentation helpers for mysys threads, mutexes,
  read write locks and conditions.
  This header file provides the necessary declarations
  to use the mysys thread API with the performance schema instrumentation.
  In some compilers (SunStudio), 'static inline' functions, when declared
  but not used, are not optimized away (because they are unused) by default,
  so that including a static inline function from a header file does
  create unwanted dependencies, causing unresolved symbols at link time.
  Other compilers, like gcc, optimize these dependencies by default.

  Since the instrumented APIs declared here are wrapper on top
  of my_pthread / safemutex / etc APIs,
  including mysql/psi/mysql_thread.h assumes that
  the dependency on my_pthread and safemutex already exists.
*/
/*
  Note: there are several orthogonal dimensions here.

  Dimension 1: Instrumentation
  HAVE_PSI_INTERFACE is defined when the instrumentation is compiled in.
  This may happen both in debug or production builds.

  Dimension 2: Debug
  SAFE_MUTEX is defined when debug is compiled in.
  This may happen both with and without instrumentation.

  Dimension 3: Platform
  Mutexes are implemented with one of:
  - the pthread library
  - fast mutexes
  - window apis
  This is implemented by various macro definitions in my_pthread.h

  This causes complexity with '#ifdef'-ery that can't be avoided.
*/

#include "mysql/psi/psi.h"
#ifdef MYSQL_SERVER
#ifndef MYSQL_DYNAMIC_PLUGIN
#include "pfs_thread_provider.h"
#endif
#endif

#ifndef PSI_MUTEX_CALL
#define PSI_MUTEX_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

#ifndef PSI_RWLOCK_CALL
#define PSI_RWLOCK_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

#ifndef PSI_COND_CALL
#define PSI_COND_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

#ifndef PSI_THREAD_CALL
#define PSI_THREAD_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Thread_instrumentation Thread Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

#ifdef HAVE_PSI_THREAD_INTERFACE
#define PSI_CALL_delete_current_thread    PSI_THREAD_CALL(delete_current_thread)
#define PSI_CALL_get_thread               PSI_THREAD_CALL(get_thread)
#define PSI_CALL_new_thread               PSI_THREAD_CALL(new_thread)
#define PSI_CALL_register_thread          PSI_THREAD_CALL(register_thread)
#define PSI_CALL_set_thread               PSI_THREAD_CALL(set_thread)
#define PSI_CALL_set_thread_THD           PSI_THREAD_CALL(set_thread_THD)
#define PSI_CALL_set_thread_connect_attrs PSI_THREAD_CALL(set_thread_connect_attrs)
#define PSI_CALL_set_thread_db            PSI_THREAD_CALL(set_thread_db)
#define PSI_CALL_set_thread_id            PSI_THREAD_CALL(set_thread_id)
#define PSI_CALL_set_thread_os_id         PSI_THREAD_CALL(set_thread_os_id)
#define PSI_CALL_set_thread_info          PSI_THREAD_CALL(set_thread_info)
#define PSI_CALL_set_thread_start_time    PSI_THREAD_CALL(set_thread_start_time)
#define PSI_CALL_set_thread_account       PSI_THREAD_CALL(set_thread_account)
#define PSI_CALL_spawn_thread             PSI_THREAD_CALL(spawn_thread)
#define PSI_CALL_set_connection_type      PSI_THREAD_CALL(set_connection_type)
#else
#define PSI_CALL_delete_current_thread()                do { } while(0)
#define PSI_CALL_get_thread()                           NULL
#define PSI_CALL_new_thread(A1,A2,A3)                   NULL
#define PSI_CALL_register_thread(A1,A2,A3)              do { } while(0)
#define PSI_CALL_set_thread(A1)                         do { } while(0)
#define PSI_CALL_set_thread_THD(A1,A2)                  do { } while(0)
#define PSI_CALL_set_thread_connect_attrs(A1,A2,A3)     0
#define PSI_CALL_set_thread_db(A1,A2)                   do { } while(0)
#define PSI_CALL_set_thread_id(A1,A2)                   do { } while(0)
#define PSI_CALL_set_thread_os_id(A1)                   do { } while(0)
#define PSI_CALL_set_thread_info(A1, A2)                do { } while(0)
#define PSI_CALL_set_thread_start_time(A1)              do { } while(0)
#define PSI_CALL_set_thread_account(A1, A2, A3, A4)     do { } while(0)
#define PSI_CALL_spawn_thread(A1, A2, A3, A4, A5)       0
#define PSI_CALL_set_connection_type(A)                 do { } while(0)
#endif


/**
  An instrumented mutex structure.
  @sa mysql_mutex_t
*/
struct st_mysql_mutex
{
  /** The real mutex. */
#ifdef SAFE_MUTEX
  safe_mutex_t m_mutex;
#else
  pthread_mutex_t m_mutex;
#endif
  /**
    The instrumentation hook.
    Note that this hook is not conditionally defined,
    for binary compatibility of the @c mysql_mutex_t interface.
  */
  struct PSI_mutex *m_psi;
};

/**
  Type of an instrumented mutex.
  @c mysql_mutex_t is a drop-in replacement for @c pthread_mutex_t.
  @sa mysql_mutex_assert_owner
  @sa mysql_mutex_assert_not_owner
  @sa mysql_mutex_init
  @sa mysql_mutex_lock
  @sa mysql_mutex_unlock
  @sa mysql_mutex_destroy
*/
typedef struct st_mysql_mutex mysql_mutex_t;

/**
  An instrumented rwlock structure.
  @sa mysql_rwlock_t
*/
struct st_mysql_rwlock
{
  /** The real rwlock */
  rw_lock_t m_rwlock;
  /**
    The instrumentation hook.
    Note that this hook is not conditionally defined,
    for binary compatibility of the @c mysql_rwlock_t interface.
  */
  struct PSI_rwlock *m_psi;
};

/**
  An instrumented prlock structure.
  @sa mysql_prlock_t
*/
struct st_mysql_prlock
{
  /** The real prlock */
  rw_pr_lock_t m_prlock;
  /**
    The instrumentation hook.
    Note that this hook is not conditionally defined,
    for binary compatibility of the @c mysql_rwlock_t interface.
  */
  struct PSI_rwlock *m_psi;
};

/**
  Type of an instrumented rwlock.
  @c mysql_rwlock_t is a drop-in replacement for @c pthread_rwlock_t.
  @sa mysql_rwlock_init
  @sa mysql_rwlock_rdlock
  @sa mysql_rwlock_tryrdlock
  @sa mysql_rwlock_wrlock
  @sa mysql_rwlock_trywrlock
  @sa mysql_rwlock_unlock
  @sa mysql_rwlock_destroy
*/
typedef struct st_mysql_rwlock mysql_rwlock_t;

/**
  Type of an instrumented prlock.
  A prlock is a read write lock that 'prefers readers' (pr).
  @c mysql_prlock_t is a drop-in replacement for @c rw_pr_lock_t.
  @sa mysql_prlock_init
  @sa mysql_prlock_rdlock
  @sa mysql_prlock_wrlock
  @sa mysql_prlock_unlock
  @sa mysql_prlock_destroy
*/
typedef struct st_mysql_prlock mysql_prlock_t;

/**
  An instrumented cond structure.
  @sa mysql_cond_t
*/
struct st_mysql_cond
{
  /** The real condition */
  pthread_cond_t m_cond;
  /**
    The instrumentation hook.
    Note that this hook is not conditionally defined,
    for binary compatibility of the @c mysql_cond_t interface.
  */
  struct PSI_cond *m_psi;
};

/**
  Type of an instrumented condition.
  @c mysql_cond_t is a drop-in replacement for @c pthread_cond_t.
  @sa mysql_cond_init
  @sa mysql_cond_wait
  @sa mysql_cond_timedwait
  @sa mysql_cond_signal
  @sa mysql_cond_broadcast
  @sa mysql_cond_destroy
*/
typedef struct st_mysql_cond mysql_cond_t;

/*
  Consider the following code:
    static inline void foo() { bar(); }
  when foo() is never called.

  With gcc, foo() is a local static function, so the dependencies
  are optimized away at compile time, and there is no dependency on bar().
  With other compilers (HP, Sun Studio), the function foo() implementation
  is compiled, and bar() needs to be present to link.

  Due to the existing header dependencies in MySQL code, this header file
  is sometime used when it is not needed, which in turn cause link failures
  on some platforms.
  The proper fix would be to cut these extra dependencies in the calling code.
  DISABLE_MYSQL_THREAD_H is a work around to limit dependencies.
  DISABLE_MYSQL_PRLOCK_H is similar, and is used to disable specifically
  the prlock wrappers.
*/
#ifndef DISABLE_MYSQL_THREAD_H

#define mysql_mutex_is_owner(M) safe_mutex_is_owner(&(M)->m_mutex)
/**
  @def mysql_mutex_assert_owner(M)
  Wrapper, to use safe_mutex_assert_owner with instrumented mutexes.
  @c mysql_mutex_assert_owner is a drop-in replacement
  for @c safe_mutex_assert_owner.
*/
#define mysql_mutex_assert_owner(M) \
  safe_mutex_assert_owner(&(M)->m_mutex)

/**
  @def mysql_mutex_assert_not_owner(M)
  Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes.
  @c mysql_mutex_assert_not_owner is a drop-in replacement
  for @c safe_mutex_assert_not_owner.
*/
#define mysql_mutex_assert_not_owner(M) \
  safe_mutex_assert_not_owner(&(M)->m_mutex)

#define mysql_mutex_setflags(M, F) \
  safe_mutex_setflags(&(M)->m_mutex, (F))

/**
  @def mysql_prlock_assert_write_owner(M)
  Drop-in replacement
  for @c rw_pr_lock_assert_write_owner.
*/
#define mysql_prlock_assert_write_owner(M) \
  rw_pr_lock_assert_write_owner(&(M)->m_prlock)

/**
  @def mysql_prlock_assert_not_write_owner(M)
  Drop-in replacement
  for @c rw_pr_lock_assert_not_write_owner.
*/
#define mysql_prlock_assert_not_write_owner(M) \
  rw_pr_lock_assert_not_write_owner(&(M)->m_prlock)

/**
  @def mysql_mutex_register(P1, P2, P3)
  Mutex registration.
*/
#define mysql_mutex_register(P1, P2, P3) \
  inline_mysql_mutex_register(P1, P2, P3)

/**
  @def mysql_mutex_init(K, M, A)
  Instrumented mutex_init.
  @c mysql_mutex_init is a replacement for @c pthread_mutex_init.
  @param K The PSI_mutex_key for this instrumented mutex
  @param M The mutex to initialize
  @param A Mutex attributes
*/

#ifdef HAVE_PSI_MUTEX_INTERFACE
  #ifdef SAFE_MUTEX
    #define mysql_mutex_init(K, M, A) \
      inline_mysql_mutex_init(K, M, A, #M, __FILE__, __LINE__)
  #else
    #define mysql_mutex_init(K, M, A) \
      inline_mysql_mutex_init(K, M, A)
  #endif
#else
  #ifdef SAFE_MUTEX
    #define mysql_mutex_init(K, M, A) \
      inline_mysql_mutex_init(M, A, #M, __FILE__, __LINE__)
  #else
    #define mysql_mutex_init(K, M, A) \
      inline_mysql_mutex_init(M, A)
  #endif
#endif

/**
  @def mysql_mutex_destroy(M)
  Instrumented mutex_destroy.
  @c mysql_mutex_destroy is a drop-in replacement
  for @c pthread_mutex_destroy.
*/
#ifdef SAFE_MUTEX
  #define mysql_mutex_destroy(M) \
    inline_mysql_mutex_destroy(M, __FILE__, __LINE__)
#else
  #define mysql_mutex_destroy(M) \
    inline_mysql_mutex_destroy(M)
#endif

/**
  @def mysql_mutex_lock(M)
  Instrumented mutex_lock.
  @c mysql_mutex_lock is a drop-in replacement for @c pthread_mutex_lock.
  @param M The mutex to lock
*/

#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
  #define mysql_mutex_lock(M) \
    inline_mysql_mutex_lock(M, __FILE__, __LINE__)
#else
  #define mysql_mutex_lock(M) \
    inline_mysql_mutex_lock(M)
#endif

/**
  @def mysql_mutex_trylock(M)
  Instrumented mutex_lock.
  @c mysql_mutex_trylock is a drop-in replacement
  for @c pthread_mutex_trylock.
*/

#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
  #define mysql_mutex_trylock(M) \
    inline_mysql_mutex_trylock(M, __FILE__, __LINE__)
#else
  #define mysql_mutex_trylock(M) \
    inline_mysql_mutex_trylock(M)
#endif

/**
  @def mysql_mutex_unlock(M)
  Instrumented mutex_unlock.
  @c mysql_mutex_unlock is a drop-in replacement for @c pthread_mutex_unlock.
*/
#ifdef SAFE_MUTEX
  #define mysql_mutex_unlock(M) \
    inline_mysql_mutex_unlock(M, __FILE__, __LINE__)
#else
  #define mysql_mutex_unlock(M) \
    inline_mysql_mutex_unlock(M)
#endif

/**
  @def mysql_rwlock_register(P1, P2, P3)
  Rwlock registration.
*/
#define mysql_rwlock_register(P1, P2, P3) \
  inline_mysql_rwlock_register(P1, P2, P3)

/**
  @def mysql_rwlock_init(K, RW)
  Instrumented rwlock_init.
  @c mysql_rwlock_init is a replacement for @c pthread_rwlock_init.
  Note that pthread_rwlockattr_t is not supported in MySQL.
  @param K The PSI_rwlock_key for this instrumented rwlock
  @param RW The rwlock to initialize
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(K, RW)
#else
  #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(RW)
#endif

/**
  @def mysql_prlock_init(K, RW)
  Instrumented rw_pr_init.
  @c mysql_prlock_init is a replacement for @c rw_pr_init.
  @param K The PSI_rwlock_key for this instrumented prlock
  @param RW The prlock to initialize
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(K, RW)
#else
  #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(RW)
#endif

/**
  @def mysql_rwlock_destroy(RW)
  Instrumented rwlock_destroy.
  @c mysql_rwlock_destroy is a drop-in replacement
  for @c pthread_rwlock_destroy.
*/
#define mysql_rwlock_destroy(RW) inline_mysql_rwlock_destroy(RW)

/**
  @def mysql_prlock_destroy(RW)
  Instrumented rw_pr_destroy.
  @c mysql_prlock_destroy is a drop-in replacement
  for @c rw_pr_destroy.
*/
#define mysql_prlock_destroy(RW) inline_mysql_prlock_destroy(RW)

/**
  @def mysql_rwlock_rdlock(RW)
  Instrumented rwlock_rdlock.
  @c mysql_rwlock_rdlock is a drop-in replacement
  for @c pthread_rwlock_rdlock.
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_rwlock_rdlock(RW) \
    inline_mysql_rwlock_rdlock(RW, __FILE__, __LINE__)
#else
  #define mysql_rwlock_rdlock(RW) \
    inline_mysql_rwlock_rdlock(RW)
#endif

/**
  @def mysql_prlock_rdlock(RW)
  Instrumented rw_pr_rdlock.
  @c mysql_prlock_rdlock is a drop-in replacement
  for @c rw_pr_rdlock.
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_prlock_rdlock(RW) \
    inline_mysql_prlock_rdlock(RW, __FILE__, __LINE__)
#else
  #define mysql_prlock_rdlock(RW) \
    inline_mysql_prlock_rdlock(RW)
#endif

/**
  @def mysql_rwlock_wrlock(RW)
  Instrumented rwlock_wrlock.
  @c mysql_rwlock_wrlock is a drop-in replacement
  for @c pthread_rwlock_wrlock.
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_rwlock_wrlock(RW) \
    inline_mysql_rwlock_wrlock(RW, __FILE__, __LINE__)
#else
  #define mysql_rwlock_wrlock(RW) \
    inline_mysql_rwlock_wrlock(RW)
#endif

/**
  @def mysql_prlock_wrlock(RW)
  Instrumented rw_pr_wrlock.
  @c mysql_prlock_wrlock is a drop-in replacement
  for @c rw_pr_wrlock.
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_prlock_wrlock(RW) \
    inline_mysql_prlock_wrlock(RW, __FILE__, __LINE__)
#else
  #define mysql_prlock_wrlock(RW) \
    inline_mysql_prlock_wrlock(RW)
#endif

/**
  @def mysql_rwlock_tryrdlock(RW)
  Instrumented rwlock_tryrdlock.
  @c mysql_rwlock_tryrdlock is a drop-in replacement
  for @c pthread_rwlock_tryrdlock.
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_rwlock_tryrdlock(RW) \
    inline_mysql_rwlock_tryrdlock(RW, __FILE__, __LINE__)
#else
  #define mysql_rwlock_tryrdlock(RW) \
    inline_mysql_rwlock_tryrdlock(RW)
#endif

/**
  @def mysql_rwlock_trywrlock(RW)
  Instrumented rwlock_trywrlock.
  @c mysql_rwlock_trywrlock is a drop-in replacement
  for @c pthread_rwlock_trywrlock.
*/
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  #define mysql_rwlock_trywrlock(RW) \
    inline_mysql_rwlock_trywrlock(RW, __FILE__, __LINE__)
#else
  #define mysql_rwlock_trywrlock(RW) \
    inline_mysql_rwlock_trywrlock(RW)
#endif

/**
  @def mysql_rwlock_unlock(RW)
  Instrumented rwlock_unlock.
  @c mysql_rwlock_unlock is a drop-in replacement
  for @c pthread_rwlock_unlock.
*/
#define mysql_rwlock_unlock(RW) inline_mysql_rwlock_unlock(RW)

/**
  @def mysql_prlock_unlock(RW)
  Instrumented rw_pr_unlock.
  @c mysql_prlock_unlock is a drop-in replacement
  for @c rw_pr_unlock.
*/
#define mysql_prlock_unlock(RW) inline_mysql_prlock_unlock(RW)

/**
  @def mysql_cond_register(P1, P2, P3)
  Cond registration.
*/
#define mysql_cond_register(P1, P2, P3) \
  inline_mysql_cond_register(P1, P2, P3)

/**
  @def mysql_cond_init(K, C, A)
  Instrumented cond_init.
  @c mysql_cond_init is a replacement for @c pthread_cond_init.
  @param C The cond to initialize
  @param K The PSI_cond_key for this instrumented cond
  @param A Condition attributes
*/
#ifdef HAVE_PSI_COND_INTERFACE
  #define mysql_cond_init(K, C, A) inline_mysql_cond_init(K, C, A)
#else
  #define mysql_cond_init(K, C, A) inline_mysql_cond_init(C, A)
#endif

/**
  @def mysql_cond_destroy(C)
  Instrumented cond_destroy.
  @c mysql_cond_destroy is a drop-in replacement for @c pthread_cond_destroy.
*/
#define mysql_cond_destroy(C) inline_mysql_cond_destroy(C)

/**
  @def mysql_cond_wait(C)
  Instrumented cond_wait.
  @c mysql_cond_wait is a drop-in replacement for @c pthread_cond_wait.
*/
#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
  #define mysql_cond_wait(C, M) \
    inline_mysql_cond_wait(C, M, __FILE__, __LINE__)
#else
  #define mysql_cond_wait(C, M) \
    inline_mysql_cond_wait(C, M)
#endif

/**
  @def mysql_cond_timedwait(C, M, W)
  Instrumented cond_timedwait.
  @c mysql_cond_timedwait is a drop-in replacement
  for @c pthread_cond_timedwait.
*/
#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
  #define mysql_cond_timedwait(C, M, W) \
    inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__)
#else
  #define mysql_cond_timedwait(C, M, W) \
    inline_mysql_cond_timedwait(C, M, W)
#endif

/**
  @def mysql_cond_signal(C)
  Instrumented cond_signal.
  @c mysql_cond_signal is a drop-in replacement for @c pthread_cond_signal.
*/
#define mysql_cond_signal(C) inline_mysql_cond_signal(C)

/**
  @def mysql_cond_broadcast(C)
  Instrumented cond_broadcast.
  @c mysql_cond_broadcast is a drop-in replacement
  for @c pthread_cond_broadcast.
*/
#define mysql_cond_broadcast(C) inline_mysql_cond_broadcast(C)

/**
  @def mysql_thread_register(P1, P2, P3)
  Thread registration.
*/
#define mysql_thread_register(P1, P2, P3) \
  inline_mysql_thread_register(P1, P2, P3)

#include <governor-mysql/lve-patch/global.h>

GOV_LVE_PTHREAD_CREATE_DECL();

/**
  @def mysql_thread_create(K, P1, P2, P3, P4)
  Instrumented pthread_create.
  This function creates both the thread instrumentation and a thread.
  @c mysql_thread_create is a replacement for @c pthread_create.
  The parameter P4 (or, if it is NULL, P1) will be used as the
  instrumented thread "identity".
  Providing a P1 / P4 parameter with a different value for each call
  will on average improve performances, since this thread identity value
  is used internally to randomize access to data and prevent contention.
  This is optional, and the improvement is not guaranteed, only statistical.
  @param K The PSI_thread_key for this instrumented thread
  @param P1 pthread_create parameter 1
  @param P2 pthread_create parameter 2
  @param P3 pthread_create parameter 3
  @param P4 pthread_create parameter 4
*/
#ifdef HAVE_PSI_THREAD_INTERFACE
  #define mysql_thread_create(K, P1, P2, P3, P4) \
    inline_mysql_thread_create(K, P1, P2, P3, P4)
#else
  #define mysql_thread_create(K, P1, P2, P3, P4) \
    GOV_LVE_PTHREAD_CREATE(P1, P2, P3, P4)
#endif

/**
  @def mysql_thread_set_psi_id(I)
  Set the thread identifier for the instrumentation.
  @param I The thread identifier
*/
#ifdef HAVE_PSI_THREAD_INTERFACE
  #define mysql_thread_set_psi_id(I) inline_mysql_thread_set_psi_id(I)
#else
  #define mysql_thread_set_psi_id(I) do {} while (0)
#endif

/**
  @def mysql_thread_set_psi_THD(T)
  Set the thread sql session for the instrumentation.
  @param I The thread identifier
*/
#ifdef HAVE_PSI_THREAD_INTERFACE
  #define mysql_thread_set_psi_THD(T) inline_mysql_thread_set_psi_THD(T)
#else
  #define mysql_thread_set_psi_THD(T) do {} while (0)
#endif

static inline void inline_mysql_mutex_register(
#ifdef HAVE_PSI_MUTEX_INTERFACE
  const char *category,
  PSI_mutex_info *info,
  int count
#else
  const char *category __attribute__ ((unused)),
  void *info __attribute__ ((unused)),
  int count __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_MUTEX_INTERFACE
  PSI_MUTEX_CALL(register_mutex)(category, info, count);
#endif
}

static inline int inline_mysql_mutex_init(
#ifdef HAVE_PSI_MUTEX_INTERFACE
  PSI_mutex_key key,
#endif
  mysql_mutex_t *that,
  const pthread_mutexattr_t *attr
#ifdef SAFE_MUTEX
  , const char *src_name, const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_MUTEX_INTERFACE
  that->m_psi= PSI_MUTEX_CALL(init_mutex)(key, &that->m_mutex);
#else
  that->m_psi= NULL;
#endif
#ifdef SAFE_MUTEX
  return safe_mutex_init(&that->m_mutex, attr, src_name, src_file, src_line);
#else
  return pthread_mutex_init(&that->m_mutex, attr);
#endif
}

static inline int inline_mysql_mutex_destroy(
  mysql_mutex_t *that
#ifdef SAFE_MUTEX
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_MUTEX_INTERFACE
  if (that->m_psi != NULL)
  {
    PSI_MUTEX_CALL(destroy_mutex)(that->m_psi);
    that->m_psi= NULL;
  }
#endif
#ifdef SAFE_MUTEX
  return safe_mutex_destroy(&that->m_mutex, src_file, src_line);
#else
  return pthread_mutex_destroy(&that->m_mutex);
#endif
}

#ifdef HAVE_PSI_MUTEX_INTERFACE
ATTRIBUTE_COLD int psi_mutex_lock(mysql_mutex_t *that,
                                  const char *file, uint line);
ATTRIBUTE_COLD int psi_mutex_trylock(mysql_mutex_t *that,
                                     const char *file, uint line);
#endif

static inline int inline_mysql_mutex_lock(
  mysql_mutex_t *that
#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_MUTEX_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_mutex_lock(that, src_file, src_line);
#endif
  /* Non instrumented code */
#ifdef SAFE_MUTEX
  return safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line);
#else
  return pthread_mutex_lock(&that->m_mutex);
#endif
}

static inline int inline_mysql_mutex_trylock(
  mysql_mutex_t *that
#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_MUTEX_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_mutex_trylock(that, src_file, src_line);
#endif
  /* Non instrumented code */
#ifdef SAFE_MUTEX
  return safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line);
#else
  return pthread_mutex_trylock(&that->m_mutex);
#endif
}

static inline int inline_mysql_mutex_unlock(
  mysql_mutex_t *that
#ifdef SAFE_MUTEX
  , const char *src_file, uint src_line
#endif
  )
{
  int result;

#ifdef HAVE_PSI_MUTEX_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    PSI_MUTEX_CALL(unlock_mutex)(that->m_psi);
#endif

#ifdef SAFE_MUTEX
  result= safe_mutex_unlock(&that->m_mutex, src_file, src_line);
#else
  result= pthread_mutex_unlock(&that->m_mutex);
#endif

  return result;
}

static inline void inline_mysql_rwlock_register(
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  const char *category,
  PSI_rwlock_info *info,
  int count
#else
  const char *category __attribute__ ((unused)),
  void *info __attribute__ ((unused)),
  int count __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  PSI_RWLOCK_CALL(register_rwlock)(category, info, count);
#endif
}

static inline int inline_mysql_rwlock_init(
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  PSI_rwlock_key key,
#endif
  mysql_rwlock_t *that)
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  that->m_psi= PSI_RWLOCK_CALL(init_rwlock)(key, &that->m_rwlock);
#else
  that->m_psi= NULL;
#endif
  /*
    pthread_rwlockattr_t is not used in MySQL.
  */
  return my_rwlock_init(&that->m_rwlock, NULL);
}

#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_init(
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  PSI_rwlock_key key,
#endif
  mysql_prlock_t *that)
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  that->m_psi= PSI_RWLOCK_CALL(init_rwlock)(key, &that->m_prlock);
#else
  that->m_psi= NULL;
#endif
  return rw_pr_init(&that->m_prlock);
}
#endif

static inline int inline_mysql_rwlock_destroy(
  mysql_rwlock_t *that)
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
  {
    PSI_RWLOCK_CALL(destroy_rwlock)(that->m_psi);
    that->m_psi= NULL;
  }
#endif
  return rwlock_destroy(&that->m_rwlock);
}

#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_destroy(
  mysql_prlock_t *that)
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
  {
    PSI_RWLOCK_CALL(destroy_rwlock)(that->m_psi);
    that->m_psi= NULL;
  }
#endif
  return rw_pr_destroy(&that->m_prlock);
}
#endif

#ifdef HAVE_PSI_RWLOCK_INTERFACE
ATTRIBUTE_COLD
int psi_rwlock_rdlock(mysql_rwlock_t *that, const char *file, uint line);
ATTRIBUTE_COLD
int psi_rwlock_tryrdlock(mysql_rwlock_t *that, const char *file, uint line);
ATTRIBUTE_COLD
int psi_rwlock_wrlock(mysql_rwlock_t *that, const char *file, uint line);
ATTRIBUTE_COLD
int psi_rwlock_trywrlock(mysql_rwlock_t *that, const char *file, uint line);
# ifndef DISABLE_MYSQL_PRLOCK_H
ATTRIBUTE_COLD
int psi_prlock_rdlock(mysql_prlock_t *that, const char *file, uint line);
ATTRIBUTE_COLD
int psi_prlock_wrlock(mysql_prlock_t *that, const char *file, uint line);
# endif
#endif

static inline int inline_mysql_rwlock_rdlock(
  mysql_rwlock_t *that
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_rwlock_rdlock(that, src_file, src_line);
#endif
  return rw_rdlock(&that->m_rwlock);
}

#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_rdlock(
  mysql_prlock_t *that
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_prlock_rdlock(that, src_file, src_line);
#endif
  return rw_pr_rdlock(&that->m_prlock);
}
#endif

static inline int inline_mysql_rwlock_wrlock(
  mysql_rwlock_t *that
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_rwlock_wrlock(that, src_file, src_line);
#endif
  return rw_wrlock(&that->m_rwlock);
}

#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_wrlock(
  mysql_prlock_t *that
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_prlock_wrlock(that, src_file, src_line);
#endif
  return rw_pr_wrlock(&that->m_prlock);
}
#endif

static inline int inline_mysql_rwlock_tryrdlock(
  mysql_rwlock_t *that
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_rwlock_tryrdlock(that, src_file, src_line);
#endif
  return rw_tryrdlock(&that->m_rwlock);
}

static inline int inline_mysql_rwlock_trywrlock(
  mysql_rwlock_t *that
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_rwlock_trywrlock(that, src_file, src_line);
#endif
  return rw_trywrlock(&that->m_rwlock);
}

static inline int inline_mysql_rwlock_unlock(
  mysql_rwlock_t *that)
{
  int result;
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    PSI_RWLOCK_CALL(unlock_rwlock)(that->m_psi);
#endif
  result= rw_unlock(&that->m_rwlock);
  return result;
}

#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_unlock(
  mysql_prlock_t *that)
{
  int result;
#ifdef HAVE_PSI_RWLOCK_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    PSI_RWLOCK_CALL(unlock_rwlock)(that->m_psi);
#endif
  result= rw_pr_unlock(&that->m_prlock);
  return result;
}
#endif

static inline void inline_mysql_cond_register(
#ifdef HAVE_PSI_COND_INTERFACE
  const char *category,
  PSI_cond_info *info,
  int count
#else
  const char *category __attribute__ ((unused)),
  void *info __attribute__ ((unused)),
  int count __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_COND_INTERFACE
  PSI_COND_CALL(register_cond)(category, info, count);
#endif
}

static inline int inline_mysql_cond_init(
#ifdef HAVE_PSI_COND_INTERFACE
  PSI_cond_key key,
#endif
  mysql_cond_t *that,
  const pthread_condattr_t *attr)
{
#ifdef HAVE_PSI_COND_INTERFACE
  that->m_psi= PSI_COND_CALL(init_cond)(key, &that->m_cond);
#else
  that->m_psi= NULL;
#endif
  return pthread_cond_init(&that->m_cond, attr);
}

static inline int inline_mysql_cond_destroy(
  mysql_cond_t *that)
{
#ifdef HAVE_PSI_COND_INTERFACE
  if (psi_likely(that->m_psi != NULL))
  {
    PSI_COND_CALL(destroy_cond)(that->m_psi);
    that->m_psi= NULL;
  }
#endif
  return pthread_cond_destroy(&that->m_cond);
}

#ifdef HAVE_PSI_COND_INTERFACE
ATTRIBUTE_COLD int psi_cond_wait(mysql_cond_t *that, mysql_mutex_t *mutex,
                                 const char *file, uint line);
ATTRIBUTE_COLD int psi_cond_timedwait(mysql_cond_t *that, mysql_mutex_t *mutex,
                                      const struct timespec *abstime,
                                      const char *file, uint line);
#endif

static inline int inline_mysql_cond_wait(
  mysql_cond_t *that,
  mysql_mutex_t *mutex
#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_COND_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_cond_wait(that, mutex, src_file, src_line);
#endif
  return my_cond_wait(&that->m_cond, &mutex->m_mutex);
}

static inline int inline_mysql_cond_timedwait(
  mysql_cond_t *that,
  mysql_mutex_t *mutex,
  const struct timespec *abstime
#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
  , const char *src_file, uint src_line
#endif
  )
{
#ifdef HAVE_PSI_COND_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    return psi_cond_timedwait(that, mutex, abstime, src_file, src_line);
#endif
  return my_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime);
}

static inline int inline_mysql_cond_signal(
  mysql_cond_t *that)
{
  int result;
#ifdef HAVE_PSI_COND_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    PSI_COND_CALL(signal_cond)(that->m_psi);
#endif
  result= pthread_cond_signal(&that->m_cond);
  return result;
}

static inline int inline_mysql_cond_broadcast(
  mysql_cond_t *that)
{
  int result;
#ifdef HAVE_PSI_COND_INTERFACE
  if (psi_likely(that->m_psi != NULL))
    PSI_COND_CALL(broadcast_cond)(that->m_psi);
#endif
  result= pthread_cond_broadcast(&that->m_cond);
  return result;
}

static inline void inline_mysql_thread_register(
#ifdef HAVE_PSI_THREAD_INTERFACE
  const char *category,
  PSI_thread_info *info,
  int count
#else
  const char *category __attribute__ ((unused)),
  void *info __attribute__ ((unused)),
  int count __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_THREAD_INTERFACE
  PSI_THREAD_CALL(register_thread)(category, info, count);
#endif
}

#ifdef HAVE_PSI_THREAD_INTERFACE
static inline int inline_mysql_thread_create(
  PSI_thread_key key,
  pthread_t *thread, const pthread_attr_t *attr,
  void *(*start_routine)(void*), void *arg)
{
  int result;
  GOV_LVE_SLOT_RESERVE();
  result= PSI_THREAD_CALL(spawn_thread)(key, thread, attr, start_routine, arg);
  GOV_LVE_SLOT_RELEASE();
  return result;
}

static inline void inline_mysql_thread_set_psi_id(my_thread_id id)
{
  struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)();
  PSI_THREAD_CALL(set_thread_id)(psi, id);
}

#ifdef __cplusplus
class THD;
static inline void inline_mysql_thread_set_psi_THD(THD *thd)
{
  struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)();
  PSI_THREAD_CALL(set_thread_THD)(psi, thd);
}
#endif /* __cplusplus */

static inline void mysql_thread_set_peer_port(uint port __attribute__ ((unused))) {
#ifdef HAVE_PSI_THREAD_INTERFACE
  struct PSI_thread *psi = PSI_THREAD_CALL(get_thread)();
  PSI_THREAD_CALL(set_thread_peer_port)(psi, port);
#endif
}

#endif

#endif /* DISABLE_MYSQL_THREAD_H */

/** @} (end of group Thread_instrumentation) */

#endif

server/mysql/psi/psi_memory.h000064400000010771150400263620012352 0ustar00/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  Without limiting anything contained in the foregoing, this file,
  which is part of C Driver for MySQL (Connector/C), is also subject to the
  Universal FOSS Exception, version 1.0, a copy of which can be found at
  http://oss.oracle.com/licenses/universal-foss-exception.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_PSI_MEMORY_H
#define MYSQL_PSI_MEMORY_H

#include "psi_base.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
  @file mysql/psi/psi_memory.h
  Performance schema instrumentation interface.

  @defgroup Instrumentation_interface Instrumentation Interface
  @ingroup Performance_schema
  @{
*/

#ifdef HAVE_PSI_INTERFACE
#ifndef DISABLE_ALL_PSI
#ifndef DISABLE_PSI_MEMORY
#define HAVE_PSI_MEMORY_INTERFACE
#endif /* DISABLE_PSI_MEMORY */
#endif /* DISABLE_ALL_PSI */
#endif /* HAVE_PSI_INTERFACE */

struct PSI_thread;

#ifdef HAVE_PSI_1

/**
  @defgroup Group_PSI_v1 Application Binary Interface, version 1
  @ingroup Instrumentation_interface
  @{
*/

/**
  Memory instrument information.
  @since PSI_VERSION_1
  This structure is used to register instrumented memory.
*/
struct PSI_memory_info_v1
{
  /** Pointer to the key assigned to the registered memory. */
  PSI_memory_key *m_key;
  /** The name of the memory instrument to register. */
  const char *m_name;
  /**
    The flags of the socket instrument to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_memory_info_v1 PSI_memory_info_v1;

/**
  Memory registration API.
  @param category a category name (typically a plugin name)
  @param info an array of memory info to register
  @param count the size of the info array
*/
typedef void (*register_memory_v1_t)
  (const char *category, struct PSI_memory_info_v1 *info, int count);

/**
  Instrument memory allocation.
  @param key the memory instrument key
  @param size the size of memory allocated
  @param[out] owner the memory owner
  @return the effective memory instrument key
*/
typedef PSI_memory_key (*memory_alloc_v1_t)
  (PSI_memory_key key, size_t size, struct PSI_thread ** owner);

/**
  Instrument memory re allocation.
  @param key the memory instrument key
  @param old_size the size of memory previously allocated
  @param new_size the size of memory re allocated
  @param[in, out] owner the memory owner
  @return the effective memory instrument key
*/
typedef PSI_memory_key (*memory_realloc_v1_t)
  (PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread ** owner);

/**
  Instrument memory claim.
  @param key the memory instrument key
  @param size the size of memory allocated
  @param[in, out] owner the memory owner
  @return the effective memory instrument key
*/
typedef PSI_memory_key (*memory_claim_v1_t)
  (PSI_memory_key key, size_t size, struct PSI_thread ** owner);

/**
  Instrument memory free.
  @param key the memory instrument key
  @param size the size of memory allocated
  @param owner the memory owner
*/
typedef void (*memory_free_v1_t)
  (PSI_memory_key key, size_t size, struct PSI_thread * owner);

/** @} (end of group Group_PSI_v1) */

#ifdef _AIX
PSI_memory_key key_memory_log_event;
#endif

#endif /* HAVE_PSI_1 */

#ifdef HAVE_PSI_2
struct PSI_memory_info_v2
{
  int placeholder;
};

#endif /* HAVE_PSI_2 */

#ifdef USE_PSI_1
typedef struct PSI_memory_info_v1 PSI_memory_info;
#endif

#ifdef USE_PSI_2
typedef struct PSI_memory_info_v2 PSI_memory_info;
#endif

/** @} (end of group Instrumentation_interface) */

#ifdef __cplusplus
}
#endif


#endif /* MYSQL_PSI_MEMORY_H */

server/mysql/psi/mysql_stage.h000064400000012112150400263620012506 0ustar00/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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 */

#ifndef MYSQL_STAGE_H
#define MYSQL_STAGE_H

/**
  @file mysql/psi/mysql_stage.h
  Instrumentation helpers for stages.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_STAGE_CALL
#define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Stage_instrumentation Stage Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def mysql_stage_register(P1, P2, P3)
  Stage registration.
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_register(P1, P2, P3) \
  inline_mysql_stage_register(P1, P2, P3)
#else
#define mysql_stage_register(P1, P2, P3) \
  do {} while (0)
#endif

/**
  @def MYSQL_SET_STAGE
  Set the current stage.
  Use this API when the file and line
  is passed from the caller.
  @param K the stage key
  @param F the source file name
  @param L the source file line
  @return the current stage progress
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
  #define MYSQL_SET_STAGE(K, F, L) \
    inline_mysql_set_stage(K, F, L)
#else
  #define MYSQL_SET_STAGE(K, F, L) \
    NULL
#endif

/**
  @def mysql_set_stage
  Set the current stage.
  @param K the stage key
  @return the current stage progress
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
  #define mysql_set_stage(K) \
    inline_mysql_set_stage(K, __FILE__, __LINE__)
#else
  #define mysql_set_stage(K) \
    NULL
#endif

/**
  @def mysql_end_stage
  End the last stage
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
  #define mysql_end_stage() \
    inline_mysql_end_stage()
#else
  #define mysql_end_stage() \
  do {} while (0)
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void inline_mysql_stage_register(
  const char *category, PSI_stage_info **info, int count)
{
  PSI_STAGE_CALL(register_stage)(category, info, count);
}
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
static inline PSI_stage_progress*
inline_mysql_set_stage(PSI_stage_key key,
                       const char *src_file, int src_line)
{
  return PSI_STAGE_CALL(start_stage)(key, src_file, src_line);
}
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_end_stage()
{
  PSI_STAGE_CALL(end_stage)();
}
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_set_work_completed(P1, P2) \
  inline_mysql_stage_set_work_completed(P1, P2)

#define mysql_stage_get_work_completed(P1) \
  inline_mysql_stage_get_work_completed(P1)
#else
#define mysql_stage_set_work_completed(P1, P2) \
  do {} while (0)

#define mysql_stage_get_work_completed(P1) \
  do {} while (0)
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_inc_work_completed(P1, P2) \
  inline_mysql_stage_inc_work_completed(P1, P2)
#else
#define mysql_stage_inc_work_completed(P1, P2) \
  do {} while (0)
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_set_work_estimated(P1, P2) \
  inline_mysql_stage_set_work_estimated(P1, P2)

#define mysql_stage_get_work_estimated(P1) \
  inline_mysql_stage_get_work_estimated(P1)
#else
#define mysql_stage_set_work_estimated(P1, P2) \
  do {} while (0)

#define mysql_stage_get_work_estimated(P1) \
  do {} while (0)
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_stage_set_work_completed(PSI_stage_progress *progress,
                                      ulonglong val)
{
  if (progress != NULL)
    progress->m_work_completed= val;
}

static inline ulonglong
inline_mysql_stage_get_work_completed(PSI_stage_progress *progress)
{
  return progress->m_work_completed;
}
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_stage_inc_work_completed(PSI_stage_progress *progress,
                                      ulonglong val)
{
  if (progress != NULL)
    progress->m_work_completed+= val;
}
#endif

#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_stage_set_work_estimated(PSI_stage_progress *progress,
                                      ulonglong val)
{
  if (progress != NULL)
    progress->m_work_estimated= val;
}

static inline ulonglong
inline_mysql_stage_get_work_estimated(PSI_stage_progress *progress)
{
  return progress->m_work_estimated;
}
#endif

/** @} (end of group Stage_instrumentation) */

#endif

server/mysql/psi/psi.h000064400000253735150400263620010773 0ustar00/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H
#define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H

#ifndef MY_GLOBAL_INCLUDED
/*
  Make sure a .c or .cc file contains an include to my_global.h first.
  When this include is missing, all the #ifdef HAVE_XXX have no effect,
  and the resulting binary won't build, or won't link,
  or will crash at runtime
  since various structures will have different binary definitions.
*/
#error "You must include my_global.h in the code for the build to be correct."
#endif

/*
  If PSI_ON_BY_DFAULT is defined, assume PSI will be enabled by default and
  optimize jumps testing for PSI this case. If not, optimize the binary for
  that PSI is not enabled
*/

#ifdef PSI_ON_BY_DEFAULT
#define psi_likely(A) likely(A)
#define psi_unlikely(A) unlikely(A)
#else
#define psi_likely(A) unlikely(A)
#define psi_unlikely(A) likely(A)
#endif

#include "psi_base.h"
#include "psi_memory.h"

#ifdef _WIN32
typedef struct thread_attr pthread_attr_t;
typedef DWORD pthread_t;
typedef DWORD pthread_key_t;
#endif

/*
  MAINTAINER:
  The following pattern:
    typedef struct XYZ XYZ;
  is not needed in C++, but required for C.
*/

C_MODE_START

/** @sa MDL_key. */
struct MDL_key;
typedef struct MDL_key MDL_key;

/** @sa enum_mdl_type. */
typedef int opaque_mdl_type;

/** @sa enum_mdl_duration. */
typedef int opaque_mdl_duration;

/** @sa MDL_wait::enum_wait_status. */
typedef int opaque_mdl_status;

/** @sa enum_vio_type. */
typedef int opaque_vio_type;

struct TABLE_SHARE;

struct sql_digest_storage;

#ifdef __cplusplus
  class THD;
#else
  /*
    Phony declaration when compiling C code.
    This is ok, because the C code will never have a THD anyway.
  */
  struct opaque_THD
  {
    int dummy;
  };
  typedef struct opaque_THD THD;
#endif

/**
  @file mysql/psi/psi.h
  Performance schema instrumentation interface.

  @defgroup Instrumentation_interface Instrumentation Interface
  @ingroup Performance_schema
  @{
*/

/**
  Interface for an instrumented mutex.
  This is an opaque structure.
*/
struct PSI_mutex;
typedef struct PSI_mutex PSI_mutex;

/**
  Interface for an instrumented rwlock.
  This is an opaque structure.
*/
struct PSI_rwlock;
typedef struct PSI_rwlock PSI_rwlock;

/**
  Interface for an instrumented condition.
  This is an opaque structure.
*/
struct PSI_cond;
typedef struct PSI_cond PSI_cond;

/**
  Interface for an instrumented table share.
  This is an opaque structure.
*/
struct PSI_table_share;
typedef struct PSI_table_share PSI_table_share;

/**
  Interface for an instrumented table handle.
  This is an opaque structure.
*/
struct PSI_table;
typedef struct PSI_table PSI_table;

/**
  Interface for an instrumented thread.
  This is an opaque structure.
*/
struct PSI_thread;
typedef struct PSI_thread PSI_thread;

/**
  Interface for an instrumented file handle.
  This is an opaque structure.
*/
struct PSI_file;
typedef struct PSI_file PSI_file;

/**
  Interface for an instrumented socket descriptor.
  This is an opaque structure.
*/
struct PSI_socket;
typedef struct PSI_socket PSI_socket;

/**
  Interface for an instrumented prepared statement.
  This is an opaque structure.
*/
struct PSI_prepared_stmt;
typedef struct PSI_prepared_stmt PSI_prepared_stmt;

/**
  Interface for an instrumented table operation.
  This is an opaque structure.
*/
struct PSI_table_locker;
typedef struct PSI_table_locker PSI_table_locker;

/**
  Interface for an instrumented statement.
  This is an opaque structure.
*/
struct PSI_statement_locker;
typedef struct PSI_statement_locker PSI_statement_locker;

/**
  Interface for an instrumented transaction.
  This is an opaque structure.
*/
struct PSI_transaction_locker;
typedef struct PSI_transaction_locker PSI_transaction_locker;

/**
  Interface for an instrumented idle operation.
  This is an opaque structure.
*/
struct PSI_idle_locker;
typedef struct PSI_idle_locker PSI_idle_locker;

/**
  Interface for an instrumented statement digest operation.
  This is an opaque structure.
*/
struct PSI_digest_locker;
typedef struct PSI_digest_locker PSI_digest_locker;

/**
  Interface for an instrumented stored procedure share.
  This is an opaque structure.
*/
struct PSI_sp_share;
typedef struct PSI_sp_share PSI_sp_share;

/**
  Interface for an instrumented stored program.
  This is an opaque structure.
*/
struct PSI_sp_locker;
typedef struct PSI_sp_locker PSI_sp_locker;

/**
  Interface for an instrumented metadata lock.
  This is an opaque structure.
*/
struct PSI_metadata_lock;
typedef struct PSI_metadata_lock PSI_metadata_lock;

/**
  Interface for an instrumented stage progress.
  This is a public structure, for efficiency.
*/
struct PSI_stage_progress
{
  ulonglong m_work_completed;
  ulonglong m_work_estimated;
};
typedef struct PSI_stage_progress PSI_stage_progress;

/** IO operation performed on an instrumented table. */
enum PSI_table_io_operation
{
  /** Row fetch. */
  PSI_TABLE_FETCH_ROW= 0,
  /** Row write. */
  PSI_TABLE_WRITE_ROW= 1,
  /** Row update. */
  PSI_TABLE_UPDATE_ROW= 2,
  /** Row delete. */
  PSI_TABLE_DELETE_ROW= 3
};
typedef enum PSI_table_io_operation PSI_table_io_operation;

/**
  State data storage for @c start_table_io_wait_v1_t,
  @c start_table_lock_wait_v1_t.
  This structure provide temporary storage to a table locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_table_io_wait_v1_t
  @sa start_table_lock_wait_v1_t
*/
struct PSI_table_locker_state
{
  /** Internal state. */
  uint m_flags;
  /** Current io operation. */
  enum PSI_table_io_operation m_io_operation;
  /** Current table handle. */
  struct PSI_table *m_table;
  /** Current table share. */
  struct PSI_table_share *m_table_share;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
  /**
    Implementation specific.
    For table io, the table io index.
    For table lock, the lock type.
  */
  uint m_index;
};
typedef struct PSI_table_locker_state PSI_table_locker_state;

/** Entry point for the performance schema interface. */
struct PSI_bootstrap
{
  /**
    ABI interface finder.
    Calling this method with an interface version number returns either
    an instance of the ABI for this version, or NULL.
    @param version the interface version number to find
    @return a versioned interface (PSI_v1, PSI_v2 or PSI)
    @sa PSI_VERSION_1
    @sa PSI_v1
    @sa PSI_VERSION_2
    @sa PSI_v2
    @sa PSI_CURRENT_VERSION
    @sa PSI
  */
  void* (*get_interface)(int version);
};
typedef struct PSI_bootstrap PSI_bootstrap;

#ifdef HAVE_PSI_INTERFACE

#ifdef DISABLE_ALL_PSI

#ifndef DISABLE_PSI_THREAD
#define DISABLE_PSI_THREAD
#endif

#ifndef DISABLE_PSI_MUTEX
#define DISABLE_PSI_MUTEX
#endif

#ifndef DISABLE_PSI_RWLOCK
#define DISABLE_PSI_RWLOCK
#endif

#ifndef DISABLE_PSI_COND
#define DISABLE_PSI_COND
#endif

#ifndef DISABLE_PSI_FILE
#define DISABLE_PSI_FILE
#endif

#ifndef DISABLE_PSI_TABLE
#define DISABLE_PSI_TABLE
#endif

#ifndef DISABLE_PSI_SOCKET
#define DISABLE_PSI_SOCKET
#endif

#ifndef DISABLE_PSI_STAGE
#define DISABLE_PSI_STAGE
#endif

#ifndef DISABLE_PSI_STATEMENT
#define DISABLE_PSI_STATEMENT
#endif

#ifndef DISABLE_PSI_SP
#define DISABLE_PSI_SP
#endif

#ifndef DISABLE_PSI_IDLE
#define DISABLE_PSI_IDLE
#endif

#ifndef DISABLE_PSI_STATEMENT_DIGEST
#define DISABLE_PSI_STATEMENT_DIGEST
#endif

#ifndef DISABLE_PSI_METADATA
#define DISABLE_PSI_METADATA
#endif

#ifndef DISABLE_PSI_MEMORY
#define DISABLE_PSI_MEMORY
#endif

#ifndef DISABLE_PSI_TRANSACTION
#define DISABLE_PSI_TRANSACTION
#endif

#ifndef DISABLE_PSI_SP
#define DISABLE_PSI_SP
#endif

#ifndef DISABLE_PSI_PS
#define DISABLE_PSI_PS
#endif

#endif

/**
  @def DISABLE_PSI_MUTEX
  Compiling option to disable the mutex instrumentation.
  This option is mostly intended to be used during development,
  when doing special builds with only a subset of the performance schema instrumentation,
  for code analysis / profiling / performance tuning of a specific instrumentation alone.
  @sa DISABLE_PSI_RWLOCK
  @sa DISABLE_PSI_COND
  @sa DISABLE_PSI_FILE
  @sa DISABLE_PSI_THREAD
  @sa DISABLE_PSI_TABLE
  @sa DISABLE_PSI_STAGE
  @sa DISABLE_PSI_STATEMENT
  @sa DISABLE_PSI_SP
  @sa DISABLE_PSI_STATEMENT_DIGEST
  @sa DISABLE_PSI_SOCKET
  @sa DISABLE_PSI_MEMORY
  @sa DISABLE_PSI_IDLE
  @sa DISABLE_PSI_METADATA
  @sa DISABLE PSI_TRANSACTION
*/

#ifndef DISABLE_PSI_MUTEX
#define HAVE_PSI_MUTEX_INTERFACE
#endif

/**
  @def DISABLE_PSI_RWLOCK
  Compiling option to disable the rwlock instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_RWLOCK
#define HAVE_PSI_RWLOCK_INTERFACE
#endif

/**
  @def DISABLE_PSI_COND
  Compiling option to disable the cond instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_COND
#define HAVE_PSI_COND_INTERFACE
#endif

/**
  @def DISABLE_PSI_FILE
  Compiling option to disable the file instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_FILE
#define HAVE_PSI_FILE_INTERFACE
#endif

/**
  @def DISABLE_PSI_THREAD
  Compiling option to disable the thread instrumentation.
  @sa DISABLE_PSI_MUTEX
*/
#ifndef DISABLE_PSI_THREAD
#define HAVE_PSI_THREAD_INTERFACE
#endif

/**
  @def DISABLE_PSI_TABLE
  Compiling option to disable the table instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_TABLE
#define HAVE_PSI_TABLE_INTERFACE
#endif

/**
  @def DISABLE_PSI_STAGE
  Compiling option to disable the stage instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_STAGE
#define HAVE_PSI_STAGE_INTERFACE
#endif

/**
  @def DISABLE_PSI_STATEMENT
  Compiling option to disable the statement instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_STATEMENT
#define HAVE_PSI_STATEMENT_INTERFACE
#endif

/**
  @def DISABLE_PSI_SP
  Compiling option to disable the stored program instrumentation.
  @sa DISABLE_PSI_MUTEX
*/
#ifndef DISABLE_PSI_SP
#define HAVE_PSI_SP_INTERFACE
#endif

/**
  @def DISABLE_PSI_PS
  Compiling option to disable the prepared statement instrumentation.
  @sa DISABLE_PSI_MUTEX
*/
#ifndef DISABLE_PSI_STATEMENT
#ifndef DISABLE_PSI_PS
#define HAVE_PSI_PS_INTERFACE
#endif
#endif

/**
  @def DISABLE_PSI_STATEMENT_DIGEST
  Compiling option to disable the statement digest instrumentation.
*/

#ifndef DISABLE_PSI_STATEMENT
#ifndef DISABLE_PSI_STATEMENT_DIGEST
#define HAVE_PSI_STATEMENT_DIGEST_INTERFACE
#endif
#endif

/**
  @def DISABLE_PSI_TRANSACTION
  Compiling option to disable the transaction instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_TRANSACTION
#define HAVE_PSI_TRANSACTION_INTERFACE
#endif

/**
  @def DISABLE_PSI_SOCKET
  Compiling option to disable the statement instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_SOCKET
#define HAVE_PSI_SOCKET_INTERFACE
#endif

/**
  @def DISABLE_PSI_MEMORY
  Compiling option to disable the memory instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_MEMORY
#define HAVE_PSI_MEMORY_INTERFACE
#endif

/**
  @def DISABLE_PSI_IDLE
  Compiling option to disable the idle instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_IDLE
#define HAVE_PSI_IDLE_INTERFACE
#endif

/**
  @def DISABLE_PSI_METADATA
  Compiling option to disable the metadata instrumentation.
  @sa DISABLE_PSI_MUTEX
*/

#ifndef DISABLE_PSI_METADATA
#define HAVE_PSI_METADATA_INTERFACE
#endif

/**
  @def PSI_VERSION_1
  Performance Schema Interface number for version 1.
  This version is supported.
*/
#define PSI_VERSION_1 1

/**
  @def PSI_VERSION_2
  Performance Schema Interface number for version 2.
  This version is not implemented, it's a placeholder.
*/
#define PSI_VERSION_2 2

/**
  @def PSI_CURRENT_VERSION
  Performance Schema Interface number for the most recent version.
  The most current version is @c PSI_VERSION_1
*/
#define PSI_CURRENT_VERSION 1

#ifndef USE_PSI_2
#ifndef USE_PSI_1
#define USE_PSI_1
#endif
#endif

/**
  Interface for an instrumented mutex operation.
  This is an opaque structure.
*/
struct PSI_mutex_locker;
typedef struct PSI_mutex_locker PSI_mutex_locker;

/**
  Interface for an instrumented rwlock operation.
  This is an opaque structure.
*/
struct PSI_rwlock_locker;
typedef struct PSI_rwlock_locker PSI_rwlock_locker;

/**
  Interface for an instrumented condition operation.
  This is an opaque structure.
*/
struct PSI_cond_locker;
typedef struct PSI_cond_locker PSI_cond_locker;

/**
  Interface for an instrumented file operation.
  This is an opaque structure.
*/
struct PSI_file_locker;
typedef struct PSI_file_locker PSI_file_locker;

/**
  Interface for an instrumented socket operation.
  This is an opaque structure.
*/
struct PSI_socket_locker;
typedef struct PSI_socket_locker PSI_socket_locker;

/**
  Interface for an instrumented MDL operation.
  This is an opaque structure.
*/
struct PSI_metadata_locker;
typedef struct PSI_metadata_locker PSI_metadata_locker;

/** Operation performed on an instrumented mutex. */
enum PSI_mutex_operation
{
  /** Lock. */
  PSI_MUTEX_LOCK= 0,
  /** Lock attempt. */
  PSI_MUTEX_TRYLOCK= 1
};
typedef enum PSI_mutex_operation PSI_mutex_operation;

/**
  Operation performed on an instrumented rwlock.
  For basic READ / WRITE lock,
  operations are "READ" or "WRITE".
  For SX-locks, operations are "SHARED", "SHARED-EXCLUSIVE" or "EXCLUSIVE".
*/
enum PSI_rwlock_operation
{
  /** Read lock. */
  PSI_RWLOCK_READLOCK= 0,
  /** Write lock. */
  PSI_RWLOCK_WRITELOCK= 1,
  /** Read lock attempt. */
  PSI_RWLOCK_TRYREADLOCK= 2,
  /** Write lock attempt. */
  PSI_RWLOCK_TRYWRITELOCK= 3,

  /** Shared lock. */
  PSI_RWLOCK_SHAREDLOCK= 4,
  /** Shared Exclusive lock. */
  PSI_RWLOCK_SHAREDEXCLUSIVELOCK= 5,
  /** Exclusive lock. */
  PSI_RWLOCK_EXCLUSIVELOCK= 6,
  /** Shared lock attempt. */
  PSI_RWLOCK_TRYSHAREDLOCK= 7,
  /** Shared Exclusive lock attempt. */
  PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK= 8,
  /** Exclusive lock attempt. */
  PSI_RWLOCK_TRYEXCLUSIVELOCK= 9

};
typedef enum PSI_rwlock_operation PSI_rwlock_operation;

/** Operation performed on an instrumented condition. */
enum PSI_cond_operation
{
  /** Wait. */
  PSI_COND_WAIT= 0,
  /** Wait, with timeout. */
  PSI_COND_TIMEDWAIT= 1
};
typedef enum PSI_cond_operation PSI_cond_operation;

/** Operation performed on an instrumented file. */
enum PSI_file_operation
{
  /** File creation, as in @c create(). */
  PSI_FILE_CREATE= 0,
  /** Temporary file creation, as in @c create_temp_file(). */
  PSI_FILE_CREATE_TMP= 1,
  /** File open, as in @c open(). */
  PSI_FILE_OPEN= 2,
  /** File open, as in @c fopen(). */
  PSI_FILE_STREAM_OPEN= 3,
  /** File close, as in @c close(). */
  PSI_FILE_CLOSE= 4,
  /** File close, as in @c fclose(). */
  PSI_FILE_STREAM_CLOSE= 5,
  /**
    Generic file read, such as @c fgets(), @c fgetc(), @c fread(), @c read(),
    @c pread().
  */
  PSI_FILE_READ= 6,
  /**
    Generic file write, such as @c fputs(), @c fputc(), @c fprintf(),
    @c vfprintf(), @c fwrite(), @c write(), @c pwrite().
  */
  PSI_FILE_WRITE= 7,
  /** Generic file seek, such as @c fseek() or @c seek(). */
  PSI_FILE_SEEK= 8,
  /** Generic file tell, such as @c ftell() or @c tell(). */
  PSI_FILE_TELL= 9,
  /** File flush, as in @c fflush(). */
  PSI_FILE_FLUSH= 10,
  /** File stat, as in @c stat(). */
  PSI_FILE_STAT= 11,
  /** File stat, as in @c fstat(). */
  PSI_FILE_FSTAT= 12,
  /** File chsize, as in @c my_chsize(). */
  PSI_FILE_CHSIZE= 13,
  /** File delete, such as @c my_delete() or @c my_handler_delete_with_symlink(). */
  PSI_FILE_DELETE= 14,
  /** File rename, such as @c my_rename() or @c my_rename_with_symlink(). */
  PSI_FILE_RENAME= 15,
  /** File sync, as in @c fsync() or @c my_sync(). */
  PSI_FILE_SYNC= 16
};
typedef enum PSI_file_operation PSI_file_operation;

/** Lock operation performed on an instrumented table. */
enum PSI_table_lock_operation
{
  /** Table lock, in the server layer. */
  PSI_TABLE_LOCK= 0,
  /** Table lock, in the storage engine layer. */
  PSI_TABLE_EXTERNAL_LOCK= 1
};
typedef enum PSI_table_lock_operation PSI_table_lock_operation;

/** State of an instrumented socket. */
enum PSI_socket_state
{
  /** Idle, waiting for the next command. */
  PSI_SOCKET_STATE_IDLE= 1,
  /** Active, executing a command. */
  PSI_SOCKET_STATE_ACTIVE= 2
};
typedef enum PSI_socket_state PSI_socket_state;

/** Operation performed on an instrumented socket. */
enum PSI_socket_operation
{
  /** Socket creation, as in @c socket() or @c socketpair(). */
  PSI_SOCKET_CREATE= 0,
  /** Socket connection, as in @c connect(), @c listen() and @c accept(). */
  PSI_SOCKET_CONNECT= 1,
  /** Socket bind, as in @c bind(), @c getsockname() and @c getpeername(). */
  PSI_SOCKET_BIND= 2,
  /** Socket close, as in @c shutdown(). */
  PSI_SOCKET_CLOSE= 3,
  /** Socket send, @c send(). */
  PSI_SOCKET_SEND= 4,
  /** Socket receive, @c recv(). */
  PSI_SOCKET_RECV= 5,
  /** Socket send, @c sendto(). */
  PSI_SOCKET_SENDTO= 6,
  /** Socket receive, @c recvfrom). */
  PSI_SOCKET_RECVFROM= 7,
  /** Socket send, @c sendmsg(). */
  PSI_SOCKET_SENDMSG= 8,
  /** Socket receive, @c recvmsg(). */
  PSI_SOCKET_RECVMSG= 9,
  /** Socket seek, such as @c fseek() or @c seek(). */
  PSI_SOCKET_SEEK= 10,
  /** Socket options, as in @c getsockopt() and @c setsockopt(). */
  PSI_SOCKET_OPT= 11,
  /** Socket status, as in @c sockatmark() and @c isfdtype(). */
  PSI_SOCKET_STAT= 12,
  /** Socket shutdown, as in @c shutdown(). */
  PSI_SOCKET_SHUTDOWN= 13,
  /** Socket select, as in @c select() and @c poll(). */
  PSI_SOCKET_SELECT= 14
};
typedef enum PSI_socket_operation PSI_socket_operation;

#endif
/**
  Instrumented mutex key.
  To instrument a mutex, a mutex key must be obtained using @c register_mutex.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_mutex_key;

/**
  Instrumented rwlock key.
  To instrument a rwlock, a rwlock key must be obtained
  using @c register_rwlock.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_rwlock_key;

/**
  Instrumented cond key.
  To instrument a condition, a condition key must be obtained
  using @c register_cond.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_cond_key;

/**
  Instrumented thread key.
  To instrument a thread, a thread key must be obtained
  using @c register_thread.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_thread_key;

/**
  Instrumented file key.
  To instrument a file, a file key must be obtained using @c register_file.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_file_key;

/**
  Instrumented stage key.
  To instrument a stage, a stage key must be obtained using @c register_stage.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_stage_key;

/**
  Instrumented statement key.
  To instrument a statement, a statement key must be obtained using @c register_statement.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_statement_key;

/**
  Instrumented socket key.
  To instrument a socket, a socket key must be obtained using @c register_socket.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_socket_key;

#ifdef HAVE_PSI_1

/**
  @defgroup Group_PSI_v1 Application Binary Interface, version 1
  @ingroup Instrumentation_interface
  @{
*/

/**
  Mutex information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented mutex.
*/
struct PSI_mutex_info_v1
{
  /**
    Pointer to the key assigned to the registered mutex.
  */
  PSI_mutex_key *m_key;
  /**
    The name of the mutex to register.
  */
  const char *m_name;
  /**
    The flags of the mutex to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_mutex_info_v1 PSI_mutex_info_v1;

/**
  Rwlock information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented rwlock.
*/
struct PSI_rwlock_info_v1
{
  /**
    Pointer to the key assigned to the registered rwlock.
  */
  PSI_rwlock_key *m_key;
  /**
    The name of the rwlock to register.
  */
  const char *m_name;
  /**
    The flags of the rwlock to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_rwlock_info_v1 PSI_rwlock_info_v1;

/**
  Condition information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented cond.
*/
struct PSI_cond_info_v1
{
  /**
    Pointer to the key assigned to the registered cond.
  */
  PSI_cond_key *m_key;
  /**
    The name of the cond to register.
  */
  const char *m_name;
  /**
    The flags of the cond to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_cond_info_v1 PSI_cond_info_v1;

/**
  Thread instrument information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented thread.
*/
struct PSI_thread_info_v1
{
  /**
    Pointer to the key assigned to the registered thread.
  */
  PSI_thread_key *m_key;
  /**
    The name of the thread instrument to register.
  */
  const char *m_name;
  /**
    The flags of the thread to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_thread_info_v1 PSI_thread_info_v1;

/**
  File instrument information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented file.
*/
struct PSI_file_info_v1
{
  /**
    Pointer to the key assigned to the registered file.
  */
  PSI_file_key *m_key;
  /**
    The name of the file instrument to register.
  */
  const char *m_name;
  /**
    The flags of the file instrument to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_file_info_v1 PSI_file_info_v1;

/**
  Stage instrument information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented stage.
*/
struct PSI_stage_info_v1
{
  /** The registered stage key. */
  PSI_stage_key m_key;
  /** The name of the stage instrument to register. */
  const char *m_name;
  /** The flags of the stage instrument to register. */
  int m_flags;
};
typedef struct PSI_stage_info_v1 PSI_stage_info_v1;

/**
  Statement instrument information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented statement.
*/
struct PSI_statement_info_v1
{
  /** The registered statement key. */
  PSI_statement_key m_key;
  /** The name of the statement instrument to register. */
  const char *m_name;
  /** The flags of the statement instrument to register. */
  int m_flags;
};
typedef struct PSI_statement_info_v1 PSI_statement_info_v1;

/**
  Socket instrument information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented socket.
*/
struct PSI_socket_info_v1
{
  /**
    Pointer to the key assigned to the registered socket.
  */
  PSI_socket_key *m_key;
  /**
    The name of the socket instrument to register.
  */
  const char *m_name;
  /**
    The flags of the socket instrument to register.
    @sa PSI_FLAG_GLOBAL
  */
  int m_flags;
};
typedef struct PSI_socket_info_v1 PSI_socket_info_v1;

/**
  State data storage for @c start_idle_wait_v1_t.
  This structure provide temporary storage to an idle locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_idle_wait_v1_t.
*/
struct PSI_idle_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state_v1;

/**
  State data storage for @c start_mutex_wait_v1_t.
  This structure provide temporary storage to a mutex locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_mutex_wait_v1_t
*/
struct PSI_mutex_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current operation. */
  enum PSI_mutex_operation m_operation;
  /** Current mutex. */
  struct PSI_mutex *m_mutex;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state_v1;

/**
  State data storage for @c start_rwlock_rdwait_v1_t, @c start_rwlock_wrwait_v1_t.
  This structure provide temporary storage to a rwlock locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_rwlock_rdwait_v1_t
  @sa start_rwlock_wrwait_v1_t
*/
struct PSI_rwlock_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current operation. */
  enum PSI_rwlock_operation m_operation;
  /** Current rwlock. */
  struct PSI_rwlock *m_rwlock;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state_v1;

/**
  State data storage for @c start_cond_wait_v1_t.
  This structure provide temporary storage to a condition locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_cond_wait_v1_t
*/
struct PSI_cond_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current operation. */
  enum PSI_cond_operation m_operation;
  /** Current condition. */
  struct PSI_cond *m_cond;
  /** Current mutex. */
  struct PSI_mutex *m_mutex;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state_v1;

/**
  State data storage for @c get_thread_file_name_locker_v1_t.
  This structure provide temporary storage to a file locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa get_thread_file_name_locker_v1_t
  @sa get_thread_file_stream_locker_v1_t
  @sa get_thread_file_descriptor_locker_v1_t
*/
struct PSI_file_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current operation. */
  enum PSI_file_operation m_operation;
  /** Current file. */
  struct PSI_file *m_file;
  /** Current file name. */
  const char *m_name;
  /** Current file class. */
  void *m_class;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Operation number of bytes. */
  size_t m_number_of_bytes;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_file_locker_state_v1 PSI_file_locker_state_v1;

/**
  State data storage for @c start_metadata_wait_v1_t.
  This structure provide temporary storage to a metadata locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_metadata_wait_v1_t
*/
struct PSI_metadata_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current metadata lock. */
  struct PSI_metadata_lock *m_metadata_lock;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state_v1;

/* Duplicate of NAME_LEN, to avoid dependency on mysql_com.h */
#define PSI_SCHEMA_NAME_LEN (64 * 3)

/**
  State data storage for @c get_thread_statement_locker_v1_t,
  @c get_thread_statement_locker_v1_t.
  This structure provide temporary storage to a statement locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa get_thread_statement_locker_v1_t
*/
struct PSI_statement_locker_state_v1
{
  /** Discarded flag. */
  my_bool m_discarded;
  /** In prepare flag. */
  my_bool m_in_prepare;
  /** Metric, no index used flag. */
  uchar m_no_index_used;
  /** Metric, no good index used flag. */
  uchar m_no_good_index_used;
  /** Internal state. */
  uint m_flags;
  /** Instrumentation class. */
  void *m_class;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_statement;
  /** Locked time. */
  ulonglong m_lock_time;
  /** Rows sent. */
  ulonglong m_rows_sent;
  /** Rows examined. */
  ulonglong m_rows_examined;
  /** Metric, temporary tables created on disk. */
  ulong m_created_tmp_disk_tables;
  /** Metric, temporary tables created. */
  ulong m_created_tmp_tables;
  /** Metric, number of select full join. */
  ulong m_select_full_join;
  /** Metric, number of select full range join. */
  ulong m_select_full_range_join;
  /** Metric, number of select range. */
  ulong m_select_range;
  /** Metric, number of select range check. */
  ulong m_select_range_check;
  /** Metric, number of select scan. */
  ulong m_select_scan;
  /** Metric, number of sort merge passes. */
  ulong m_sort_merge_passes;
  /** Metric, number of sort merge. */
  ulong m_sort_range;
  /** Metric, number of sort rows. */
  ulong m_sort_rows;
  /** Metric, number of sort scans. */
  ulong m_sort_scan;
  /** Statement digest. */
  const struct sql_digest_storage *m_digest;
  /** Current schema name. */
  char m_schema_name[PSI_SCHEMA_NAME_LEN];
  /** Length in bytes of @c m_schema_name. */
  uint m_schema_name_length;
  /** Statement character set number. */
  uint m_cs_number;
  PSI_sp_share *m_parent_sp_share;
  PSI_prepared_stmt *m_parent_prepared_stmt;
};
typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state_v1;

/**
  State data storage for @c get_thread_transaction_locker_v1_t,
  @c get_thread_transaction_locker_v1_t.
  This structure provide temporary storage to a transaction locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa get_thread_transaction_locker_v1_t
*/
struct PSI_transaction_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Instrumentation class. */
  void *m_class;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Internal data. */
  void *m_transaction;
  /** True if read-only transaction, false if read-write. */
  my_bool m_read_only;
  /** True if transaction is autocommit. */
  my_bool m_autocommit;
  /** Number of statements. */
  ulong m_statement_count;
  /** Total number of savepoints. */
  ulong m_savepoint_count;
  /** Number of rollback_to_savepoint. */
  ulong m_rollback_to_savepoint_count;
  /** Number of release_savepoint. */
  ulong m_release_savepoint_count;
};

typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state_v1;

/**
  State data storage for @c start_socket_wait_v1_t.
  This structure provide temporary storage to a socket locker.
  The content of this structure is considered opaque,
  the fields are only hints of what an implementation
  of the psi interface can use.
  This memory is provided by the instrumented code for performance reasons.
  @sa start_socket_wait_v1_t
*/
struct PSI_socket_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current socket. */
  struct PSI_socket *m_socket;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Operation number of bytes. */
  size_t m_number_of_bytes;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Current operation. */
  enum PSI_socket_operation m_operation;
  /** Source file. */
  const char* m_src_file;
  /** Source line number. */
  int m_src_line;
  /** Internal data. */
  void *m_wait;
};
typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state_v1;

struct PSI_sp_locker_state_v1
{
  /** Internal state. */
  uint m_flags;
  /** Current thread. */
  struct PSI_thread *m_thread;
  /** Timer start. */
  ulonglong m_timer_start;
  /** Timer function. */
  ulonglong (*m_timer)(void);
  /** Stored Procedure share. */
  PSI_sp_share* m_sp_share;
};
typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state_v1;

/* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */

/**
  Mutex registration API.
  @param category a category name (typically a plugin name)
  @param info an array of mutex info to register
  @param count the size of the info array
*/
typedef void (*register_mutex_v1_t)
  (const char *category, struct PSI_mutex_info_v1 *info, int count);

/**
  Rwlock registration API.
  @param category a category name (typically a plugin name)
  @param info an array of rwlock info to register
  @param count the size of the info array
*/
typedef void (*register_rwlock_v1_t)
  (const char *category, struct PSI_rwlock_info_v1 *info, int count);

/**
  Cond registration API.
  @param category a category name (typically a plugin name)
  @param info an array of cond info to register
  @param count the size of the info array
*/
typedef void (*register_cond_v1_t)
  (const char *category, struct PSI_cond_info_v1 *info, int count);

/**
  Thread registration API.
  @param category a category name (typically a plugin name)
  @param info an array of thread info to register
  @param count the size of the info array
*/
typedef void (*register_thread_v1_t)
  (const char *category, struct PSI_thread_info_v1 *info, int count);

/**
  File registration API.
  @param category a category name (typically a plugin name)
  @param info an array of file info to register
  @param count the size of the info array
*/
typedef void (*register_file_v1_t)
  (const char *category, struct PSI_file_info_v1 *info, int count);

/**
  Stage registration API.
  @param category a category name
  @param info an array of stage info to register
  @param count the size of the info array
*/
typedef void (*register_stage_v1_t)
  (const char *category, struct PSI_stage_info_v1 **info, int count);

/**
  Statement registration API.
  @param category a category name
  @param info an array of stage info to register
  @param count the size of the info array
*/
typedef void (*register_statement_v1_t)
  (const char *category, struct PSI_statement_info_v1 *info, int count);

/**
  Socket registration API.
  @param category a category name (typically a plugin name)
  @param info an array of socket info to register
  @param count the size of the info array
*/
typedef void (*register_socket_v1_t)
  (const char *category, struct PSI_socket_info_v1 *info, int count);

/**
  Mutex instrumentation initialisation API.
  @param key the registered mutex key
  @param identity the address of the mutex itself
  @return an instrumented mutex
*/
typedef struct PSI_mutex* (*init_mutex_v1_t)
  (PSI_mutex_key key, void *identity);

/**
  Mutex instrumentation destruction API.
  @param mutex the mutex to destroy
*/
typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);

/**
  Rwlock instrumentation initialisation API.
  @param key the registered rwlock key
  @param identity the address of the rwlock itself
  @return an instrumented rwlock
*/
typedef struct PSI_rwlock* (*init_rwlock_v1_t)
  (PSI_rwlock_key key, void *identity);

/**
  Rwlock instrumentation destruction API.
  @param rwlock the rwlock to destroy
*/
typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);

/**
  Cond instrumentation initialisation API.
  @param key the registered key
  @param identity the address of the rwlock itself
  @return an instrumented cond
*/
typedef struct PSI_cond* (*init_cond_v1_t)
  (PSI_cond_key key, void *identity);

/**
  Cond instrumentation destruction API.
  @param cond the rcond to destroy
*/
typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond);

/**
  Socket instrumentation initialisation API.
  @param key the registered mutex key
  @param socket descriptor
  @param addr the socket ip address
  @param addr_len length of socket ip address
  @return an instrumented socket
*/
typedef struct PSI_socket* (*init_socket_v1_t)
  (PSI_socket_key key, const my_socket *fd,
  const struct sockaddr *addr, socklen_t addr_len);

/**
  socket instrumentation destruction API.
  @param socket the socket to destroy
*/
typedef void (*destroy_socket_v1_t)(struct PSI_socket *socket);

/**
  Acquire a table share instrumentation.
  @param temporary True for temporary tables
  @param share The SQL layer table share
  @return a table share instrumentation, or NULL
*/
typedef struct PSI_table_share* (*get_table_share_v1_t)
  (my_bool temporary, struct TABLE_SHARE *share);

/**
  Release a table share.
  @param info the table share to release
*/
typedef void (*release_table_share_v1_t)(struct PSI_table_share *share);

/**
  Drop a table share.
  @param temporary True for temporary tables
  @param schema_name the table schema name
  @param schema_name_length the table schema name length
  @param table_name the table name
  @param table_name_length the table name length
*/
typedef void (*drop_table_share_v1_t)
  (my_bool temporary, const char *schema_name, int schema_name_length,
   const char *table_name, int table_name_length);

/**
  Open an instrumentation table handle.
  @param share the table to open
  @param identity table handle identity
  @return a table handle, or NULL
*/
typedef struct PSI_table* (*open_table_v1_t)
  (struct PSI_table_share *share, const void *identity);

/**
  Unbind a table handle from the current thread.
  This operation happens when an opened table is added to the open table cache.
  @param table the table to unbind
*/
typedef void (*unbind_table_v1_t)
  (struct PSI_table *table);

/**
  Rebind a table handle to the current thread.
  This operation happens when a table from the open table cache
  is reused for a thread.
  @param table the table to unbind
*/
typedef PSI_table* (*rebind_table_v1_t)
  (PSI_table_share *share, const void *identity, PSI_table *table);

/**
  Close an instrumentation table handle.
  Note that the table handle is invalid after this call.
  @param table the table handle to close
*/
typedef void (*close_table_v1_t)(struct TABLE_SHARE *server_share,
                                 struct PSI_table *table);

/**
  Create a file instrumentation for a created file.
  This method does not create the file itself, but is used to notify the
  instrumentation interface that a file was just created.
  @param key the file instrumentation key for this file
  @param name the file name
  @param file the file handle
*/
typedef void (*create_file_v1_t)(PSI_file_key key, const char *name,
                                 File file);

/**
  Spawn a thread.
  This method creates a new thread, with instrumentation.
  @param key the instrumentation key for this thread
  @param thread the resulting thread
  @param attr the thread attributes
  @param start_routine the thread start routine
  @param arg the thread start routine argument
*/
typedef int (*spawn_thread_v1_t)(PSI_thread_key key,
                                 pthread_t *thread,
                                 const pthread_attr_t *attr,
                                 void *(*start_routine)(void*), void *arg);

/**
  Create instrumentation for a thread.
  @param key the registered key
  @param identity an address typical of the thread
  @return an instrumented thread
*/
typedef struct PSI_thread* (*new_thread_v1_t)
  (PSI_thread_key key, const void *identity, ulonglong thread_id);

/**
  Assign a THD to an instrumented thread.
  @param thread the instrumented thread
  @param THD the sql layer THD to assign
*/
typedef void (*set_thread_THD_v1_t)(struct PSI_thread *thread,
                                    THD *thd);

/**
  Assign an id to an instrumented thread.
  @param thread the instrumented thread
  @param id the id to assign
*/
typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread,
                                   ulonglong id);

/**
  Assign the current operating system thread id to an instrumented thread.
  The operating system task id is obtained from @c gettid()
  @param thread the instrumented thread
*/
typedef void (*set_thread_os_id_v1_t)(struct PSI_thread *thread);

/**
  Get the instrumentation for the running thread.
  For this function to return a result,
  the thread instrumentation must have been attached to the
  running thread using @c set_thread()
  @return the instrumentation for the running thread
*/
typedef struct PSI_thread* (*get_thread_v1_t)(void);

/**
  Assign a user name to the instrumented thread.
  @param user the user name
  @param user_len the user name length
*/
typedef void (*set_thread_user_v1_t)(const char *user, int user_len);

/**
  Assign a user name and host name to the instrumented thread.
  @param user the user name
  @param user_len the user name length
  @param host the host name
  @param host_len the host name length
*/
typedef void (*set_thread_account_v1_t)(const char *user, int user_len,
                                        const char *host, int host_len);

/**
  Assign a current database to the instrumented thread.
  @param db the database name
  @param db_len the database name length
*/
typedef void (*set_thread_db_v1_t)(const char* db, int db_len);

/**
  Assign a current command to the instrumented thread.
  @param command the current command
*/
typedef void (*set_thread_command_v1_t)(int command);

/**
  Assign a connection type to the instrumented thread.
  @param conn_type the connection type
*/
typedef void (*set_connection_type_v1_t)(opaque_vio_type conn_type);


/**
  Assign a start time to the instrumented thread.
  @param start_time the thread start time
*/
typedef void (*set_thread_start_time_v1_t)(time_t start_time);

/**
  Assign a state to the instrumented thread.
  @param state the thread state
*/
typedef void (*set_thread_state_v1_t)(const char* state);

/**
  Assign a process info to the instrumented thread.
  @param info the process into string
  @param info_len the process into string length
*/
typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);

/**
  Attach a thread instrumentation to the running thread.
  In case of thread pools, this method should be called when
  a worker thread picks a work item and runs it.
  Also, this method should be called if the instrumented code does not
  keep the pointer returned by @c new_thread() and relies on @c get_thread()
  instead.
  @param thread the thread instrumentation
*/
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);

/**
  Assign the remote (peer) port to the instrumented thread.

  @param thread    pointer to the thread instrumentation
  @param port      the remote port
*/
typedef void (*set_thread_peer_port_v1_t)(PSI_thread *thread,
                                          unsigned int port);

/** Delete the current thread instrumentation. */
typedef void (*delete_current_thread_v1_t)(void);

/** Delete a thread instrumentation. */
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);

/**
  Get a file instrumentation locker, for opening or creating a file.
  @param state data storage for the locker
  @param key the file instrumentation key
  @param op the operation to perform
  @param name the file name
  @param identity a pointer representative of this file.
  @return a file locker, or NULL
*/
typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
  (struct PSI_file_locker_state_v1 *state,
   PSI_file_key key, enum PSI_file_operation op, const char *name,
   const void *identity);

/**
  Get a file stream instrumentation locker.
  @param state data storage for the locker
  @param file the file stream to access
  @param op the operation to perform
  @return a file locker, or NULL
*/
typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t)
  (struct PSI_file_locker_state_v1 *state,
   struct PSI_file *file, enum PSI_file_operation op);

/**
  Get a file instrumentation locker.
  @param state data storage for the locker
  @param file the file descriptor to access
  @param op the operation to perform
  @return a file locker, or NULL
*/
typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t)
  (struct PSI_file_locker_state_v1 *state,
   File file, enum PSI_file_operation op);

/**
  Record a mutex instrumentation unlock event.
  @param mutex the mutex instrumentation
*/
typedef void (*unlock_mutex_v1_t)
  (struct PSI_mutex *mutex);

/**
  Record a rwlock instrumentation unlock event.
  @param rwlock the rwlock instrumentation
*/
typedef void (*unlock_rwlock_v1_t)
  (struct PSI_rwlock *rwlock);

/**
  Record a condition instrumentation signal event.
  @param cond the cond instrumentation
*/
typedef void (*signal_cond_v1_t)
  (struct PSI_cond *cond);

/**
  Record a condition instrumentation broadcast event.
  @param cond the cond instrumentation
*/
typedef void (*broadcast_cond_v1_t)
  (struct PSI_cond *cond);

/**
  Record an idle instrumentation wait start event.
  @param state data storage for the locker
  @param file the source file name
  @param line the source line number
  @return an idle locker, or NULL
*/
typedef struct PSI_idle_locker* (*start_idle_wait_v1_t)
  (struct PSI_idle_locker_state_v1 *state, const char *src_file, uint src_line);

/**
  Record an idle instrumentation wait end event.
  @param locker a thread locker for the running thread
*/
typedef void (*end_idle_wait_v1_t)
  (struct PSI_idle_locker *locker);

/**
  Record a mutex instrumentation wait start event.
  @param state data storage for the locker
  @param mutex the instrumented mutex to lock
  @param op the operation to perform
  @param file the source file name
  @param line the source line number
  @return a mutex locker, or NULL
*/
typedef struct PSI_mutex_locker* (*start_mutex_wait_v1_t)
  (struct PSI_mutex_locker_state_v1 *state,
   struct PSI_mutex *mutex,
   enum PSI_mutex_operation op,
   const char *src_file, uint src_line);

/**
  Record a mutex instrumentation wait end event.
  @param locker a thread locker for the running thread
  @param rc the wait operation return code
*/
typedef void (*end_mutex_wait_v1_t)
  (struct PSI_mutex_locker *locker, int rc);

/**
  Record a rwlock instrumentation read wait start event.
  @param locker a thread locker for the running thread
  @param must must block: 1 for lock, 0 for trylock
*/
typedef struct PSI_rwlock_locker* (*start_rwlock_rdwait_v1_t)
  (struct PSI_rwlock_locker_state_v1 *state,
   struct PSI_rwlock *rwlock,
   enum PSI_rwlock_operation op,
   const char *src_file, uint src_line);

/**
  Record a rwlock instrumentation read wait end event.
  @param locker a thread locker for the running thread
  @param rc the wait operation return code
*/
typedef void (*end_rwlock_rdwait_v1_t)
  (struct PSI_rwlock_locker *locker, int rc);

/**
  Record a rwlock instrumentation write wait start event.
  @param locker a thread locker for the running thread
  @param must must block: 1 for lock, 0 for trylock
*/
typedef struct PSI_rwlock_locker* (*start_rwlock_wrwait_v1_t)
  (struct PSI_rwlock_locker_state_v1 *state,
   struct PSI_rwlock *rwlock,
   enum PSI_rwlock_operation op,
   const char *src_file, uint src_line);

/**
  Record a rwlock instrumentation write wait end event.
  @param locker a thread locker for the running thread
  @param rc the wait operation return code
*/
typedef void (*end_rwlock_wrwait_v1_t)
  (struct PSI_rwlock_locker *locker, int rc);

/**
  Record a condition instrumentation wait start event.
  @param locker a thread locker for the running thread
  @param must must block: 1 for wait, 0 for timedwait
*/
typedef struct PSI_cond_locker* (*start_cond_wait_v1_t)
  (struct PSI_cond_locker_state_v1 *state,
   struct PSI_cond *cond,
   struct PSI_mutex *mutex,
   enum PSI_cond_operation op,
   const char *src_file, uint src_line);

/**
  Record a condition instrumentation wait end event.
  @param locker a thread locker for the running thread
  @param rc the wait operation return code
*/
typedef void (*end_cond_wait_v1_t)
  (struct PSI_cond_locker *locker, int rc);

/**
  Record a table instrumentation io wait start event.
  @param locker a table locker for the running thread
  @param file the source file name
  @param line the source line number
*/
typedef struct PSI_table_locker* (*start_table_io_wait_v1_t)
  (struct PSI_table_locker_state *state,
   struct PSI_table *table,
   enum PSI_table_io_operation op,
   uint index,
   const char *src_file, uint src_line);

/**
  Record a table instrumentation io wait end event.
  @param locker a table locker for the running thread
  @param numrows the number of rows involved in io
*/
typedef void (*end_table_io_wait_v1_t)
  (struct PSI_table_locker *locker,
   ulonglong numrows);

/**
  Record a table instrumentation lock wait start event.
  @param locker a table locker for the running thread
  @param file the source file name
  @param line the source line number
*/
typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t)
  (struct PSI_table_locker_state *state,
   struct PSI_table *table,
   enum PSI_table_lock_operation op,
   ulong flags,
   const char *src_file, uint src_line);

/**
  Record a table instrumentation lock wait end event.
  @param locker a table locker for the running thread
*/
typedef void (*end_table_lock_wait_v1_t)(struct PSI_table_locker *locker);

typedef void (*unlock_table_v1_t)(struct PSI_table *table);

/**
  Start a file instrumentation open operation.
  @param locker the file locker
  @param op the operation to perform
  @param src_file the source file name
  @param src_line the source line number
*/
typedef void (*start_file_open_wait_v1_t)
  (struct PSI_file_locker *locker, const char *src_file, uint src_line);

/**
  End a file instrumentation open operation, for file streams.
  @param locker the file locker.
  @param result the opened file (NULL indicates failure, non NULL success).
  @return an instrumented file handle
*/
typedef struct PSI_file* (*end_file_open_wait_v1_t)
  (struct PSI_file_locker *locker, void *result);

/**
  End a file instrumentation open operation, for non stream files.
  @param locker the file locker.
  @param file the file number assigned by open() or create() for this file.
*/
typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t)
  (struct PSI_file_locker *locker, File file);

/**
  End a file instrumentation open operation, for non stream temporary files.
  @param locker the file locker.
  @param file the file number assigned by open() or create() for this file.
  @param filename the file name generated during temporary file creation.
*/
typedef void (*end_temp_file_open_wait_and_bind_to_descriptor_v1_t)
  (struct PSI_file_locker *locker, File file, const char *filename);

/**
  Record a file instrumentation start event.
  @param locker a file locker for the running thread
  @param op file operation to be performed
  @param count the number of bytes requested, or 0 if not applicable
  @param src_file the source file name
  @param src_line the source line number
*/
typedef void (*start_file_wait_v1_t)
  (struct PSI_file_locker *locker, size_t count,
   const char *src_file, uint src_line);

/**
  Record a file instrumentation end event.
  Note that for file close operations, the instrumented file handle
  associated with the file (which was provided to obtain a locker)
  is invalid after this call.
  @param locker a file locker for the running thread
  @param count the number of bytes actually used in the operation,
  or 0 if not applicable, or -1 if the operation failed
  @sa get_thread_file_name_locker
  @sa get_thread_file_stream_locker
  @sa get_thread_file_descriptor_locker
*/
typedef void (*end_file_wait_v1_t)
  (struct PSI_file_locker *locker, size_t count);

/**
  Start a file instrumentation close operation.
  @param locker the file locker
  @param op the operation to perform
  @param src_file the source file name
  @param src_line the source line number
*/
typedef void (*start_file_close_wait_v1_t)
  (struct PSI_file_locker *locker, const char *src_file, uint src_line);

/**
  End a file instrumentation close operation.
  @param locker the file locker.
  @param rc the close operation return code (0 for success).
  @return an instrumented file handle
*/
typedef void (*end_file_close_wait_v1_t)
  (struct PSI_file_locker *locker, int rc);

/**
  Rename a file instrumentation close operation.
  @param locker the file locker.
  @param old_name name of the file to be renamed.
  @param new_name name of the file after rename.
  @param rc the rename operation return code (0 for success).
*/
typedef void (*end_file_rename_wait_v1_t)
  (struct PSI_file_locker *locker, const char *old_name,
   const char *new_name, int rc);

/**
  Start a new stage, and implicitly end the previous stage.
  @param key the key of the new stage
  @param src_file the source file name
  @param src_line the source line number
  @return the new stage progress
*/
typedef PSI_stage_progress* (*start_stage_v1_t)
  (PSI_stage_key key, const char *src_file, int src_line);

typedef PSI_stage_progress* (*get_current_stage_progress_v1_t)(void);

/** End the current stage. */
typedef void (*end_stage_v1_t) (void);

/**
  Get a statement instrumentation locker.
  @param state data storage for the locker
  @param key the statement instrumentation key
  @param charset client character set
  @return a statement locker, or NULL
*/
typedef struct PSI_statement_locker* (*get_thread_statement_locker_v1_t)
  (struct PSI_statement_locker_state_v1 *state,
   PSI_statement_key key, const void *charset, PSI_sp_share *sp_share);

/**
  Refine a statement locker to a more specific key.
  Note that only events declared mutable can be refined.
  @param the statement locker for the current event
  @param key the new key for the event
  @sa PSI_FLAG_MUTABLE
*/
typedef struct PSI_statement_locker* (*refine_statement_v1_t)
  (struct PSI_statement_locker *locker,
   PSI_statement_key key);

/**
  Start a new statement event.
  @param locker the statement locker for this event
  @param db the active database name for this statement
  @param db_length the active database name length for this statement
  @param src_file source file name
  @param src_line source line number
*/
typedef void (*start_statement_v1_t)
  (struct PSI_statement_locker *locker,
   const char *db, uint db_length,
   const char *src_file, uint src_line);

/**
  Set the statement text for a statement event.
  @param locker the current statement locker
  @param text the statement text
  @param text_len the statement text length
*/
typedef void (*set_statement_text_v1_t)
  (struct PSI_statement_locker *locker,
   const char *text, uint text_len);

/**
  Set a statement event lock time.
  @param locker the statement locker
  @param lock_time the locked time, in microseconds
*/
typedef void (*set_statement_lock_time_t)
  (struct PSI_statement_locker *locker, ulonglong lock_time);

/**
  Set a statement event rows sent metric.
  @param locker the statement locker
  @param count the number of rows sent
*/
typedef void (*set_statement_rows_sent_t)
  (struct PSI_statement_locker *locker, ulonglong count);

/**
  Set a statement event rows examined metric.
  @param locker the statement locker
  @param count the number of rows examined
*/
typedef void (*set_statement_rows_examined_t)
  (struct PSI_statement_locker *locker, ulonglong count);

/**
  Increment a statement event "created tmp disk tables" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_created_tmp_disk_tables_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "created tmp tables" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_created_tmp_tables_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "select full join" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_select_full_join_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "select full range join" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_select_full_range_join_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "select range join" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_select_range_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "select range check" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_select_range_check_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "select scan" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_select_scan_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "sort merge passes" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_sort_merge_passes_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "sort range" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_sort_range_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "sort rows" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_sort_rows_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Increment a statement event "sort scan" metric.
  @param locker the statement locker
  @param count the metric increment value
*/
typedef void (*inc_statement_sort_scan_t)
  (struct PSI_statement_locker *locker, ulong count);

/**
  Set a statement event "no index used" metric.
  @param locker the statement locker
  @param count the metric value
*/
typedef void (*set_statement_no_index_used_t)
  (struct PSI_statement_locker *locker);

/**
  Set a statement event "no good index used" metric.
  @param locker the statement locker
  @param count the metric value
*/
typedef void (*set_statement_no_good_index_used_t)
  (struct PSI_statement_locker *locker);

/**
  End a statement event.
  @param locker the statement locker
  @param stmt_da the statement diagnostics area.
  @sa Diagnostics_area
*/
typedef void (*end_statement_v1_t)
  (struct PSI_statement_locker *locker, void *stmt_da);

/**
  Get a transaction instrumentation locker.
  @param state data storage for the locker
  @param xid the xid for this transaction
  @param trxid the InnoDB transaction id
  @param iso_level isolation level for this transaction
  @param read_only true if transaction access mode is read-only
  @param autocommit true if transaction is autocommit
  @return a transaction locker, or NULL
*/
typedef struct PSI_transaction_locker* (*get_thread_transaction_locker_v1_t)
  (struct PSI_transaction_locker_state_v1 *state, const void *xid,
   ulonglong trxid, int isolation_level, my_bool read_only,
   my_bool autocommit);

/**
  Start a new transaction event.
  @param locker the transaction locker for this event
  @param src_file source file name
  @param src_line source line number
*/
typedef void (*start_transaction_v1_t)
  (struct PSI_transaction_locker *locker,
   const char *src_file, uint src_line);

/**
  Set the transaction xid.
  @param locker the transaction locker for this event
  @param xid the id of the XA transaction
  #param xa_state is the state of the XA transaction
*/
typedef void (*set_transaction_xid_v1_t)
  (struct PSI_transaction_locker *locker,
   const void *xid, int xa_state);

/**
  Set the state of the XA transaction.
  @param locker the transaction locker for this event
  @param xa_state the new state of the xa transaction
*/
typedef void (*set_transaction_xa_state_v1_t)
  (struct PSI_transaction_locker *locker,
   int xa_state);

/**
  Set the transaction gtid.
  @param locker the transaction locker for this event
  @param sid the source id for the transaction, mapped from sidno
  @param gtid_spec the gtid specifier for the transaction
*/
typedef void (*set_transaction_gtid_v1_t)
  (struct PSI_transaction_locker *locker,
   const void *sid, const void *gtid_spec);

/**
  Set the transaction trx_id.
  @param locker the transaction locker for this event
  @param trxid the storage engine transaction ID
*/
typedef void (*set_transaction_trxid_v1_t)
  (struct PSI_transaction_locker *locker,
   const ulonglong *trxid);

/**
  Increment a transaction event savepoint count.
  @param locker the transaction locker
  @param count the increment value
*/
typedef void (*inc_transaction_savepoints_v1_t)
  (struct PSI_transaction_locker *locker, ulong count);

/**
  Increment a transaction event rollback to savepoint count.
  @param locker the transaction locker
  @param count the increment value
*/
typedef void (*inc_transaction_rollback_to_savepoint_v1_t)
  (struct PSI_transaction_locker *locker, ulong count);

/**
  Increment a transaction event release savepoint count.
  @param locker the transaction locker
  @param count the increment value
*/
typedef void (*inc_transaction_release_savepoint_v1_t)
  (struct PSI_transaction_locker *locker, ulong count);

/**
  Commit or rollback the transaction.
  @param locker the transaction locker for this event
  @param commit true if transaction was committed, false if rolled back
*/
typedef void (*end_transaction_v1_t)
  (struct PSI_transaction_locker *locker,
   my_bool commit);

/**
  Record a socket instrumentation start event.
  @param locker a socket locker for the running thread
  @param op socket operation to be performed
  @param count the number of bytes requested, or 0 if not applicable
  @param src_file the source file name
  @param src_line the source line number
*/
typedef struct PSI_socket_locker* (*start_socket_wait_v1_t)
  (struct PSI_socket_locker_state_v1 *state,
   struct PSI_socket *socket,
   enum PSI_socket_operation op,
   size_t count,
   const char *src_file, uint src_line);

/**
  Record a socket instrumentation end event.
  Note that for socket close operations, the instrumented socket handle
  associated with the socket (which was provided to obtain a locker)
  is invalid after this call.
  @param locker a socket locker for the running thread
  @param count the number of bytes actually used in the operation,
  or 0 if not applicable, or -1 if the operation failed
  @sa get_thread_socket_locker
*/
typedef void (*end_socket_wait_v1_t)
  (struct PSI_socket_locker *locker, size_t count);

/**
  Set the socket state for an instrumented socket.
    @param socket the instrumented socket
    @param state socket state
  */
typedef void (*set_socket_state_v1_t)(struct PSI_socket *socket,
                                      enum PSI_socket_state state);

/**
  Set the socket info for an instrumented socket.
  @param socket the instrumented socket
  @param fd the socket descriptor
  @param addr the socket ip address
  @param addr_len length of socket ip address
  @param thread_id associated thread id
*/
typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket,
                                     const my_socket *fd,
                                     const struct sockaddr *addr,
                                     socklen_t addr_len);

/**
  Bind a socket to the thread that owns it.
  @param socket instrumented socket
*/
typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);

/**
  Get a prepare statement.
  @param locker a statement locker for the running thread.
*/
typedef PSI_prepared_stmt* (*create_prepared_stmt_v1_t)
  (void *identity, uint stmt_id, PSI_statement_locker *locker,
   const char *stmt_name, size_t stmt_name_length);

/**
  destroy a prepare statement.
  @param prepared_stmt prepared statement.
*/
typedef void (*destroy_prepared_stmt_v1_t)
  (PSI_prepared_stmt *prepared_stmt);

/**
  repreare a prepare statement.
  @param prepared_stmt prepared statement.
*/
typedef void (*reprepare_prepared_stmt_v1_t)
  (PSI_prepared_stmt *prepared_stmt);

/**
  Record a prepare statement instrumentation execute event.
  @param locker a statement locker for the running thread.
  @param prepared_stmt prepared statement.
*/
typedef void (*execute_prepared_stmt_v1_t)
  (PSI_statement_locker *locker, PSI_prepared_stmt* prepared_stmt);

/**
  Set the statement text for a prepared statement event.
  @param prepared_stmt prepared statement.
  @param text the prepared statement text
  @param text_len the prepared statement text length
*/
typedef void (*set_prepared_stmt_text_v1_t)(PSI_prepared_stmt *prepared_stmt,
                                            const char *text,
                                            uint text_len);
/**
  Get a digest locker for the current statement.
  @param locker a statement locker for the running thread
*/
typedef struct PSI_digest_locker * (*digest_start_v1_t)
  (struct PSI_statement_locker *locker);

/**
  Add a token to the current digest instrumentation.
  @param locker a digest locker for the current statement
  @param token the lexical token to add
  @param yylval the lexical token attributes
*/
typedef void (*digest_end_v1_t)
  (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest);

typedef PSI_sp_locker* (*start_sp_v1_t)
  (struct PSI_sp_locker_state_v1 *state, struct PSI_sp_share* sp_share);

typedef void (*end_sp_v1_t)
  (struct PSI_sp_locker *locker);

typedef void (*drop_sp_v1_t)
  (uint object_type,
   const char *schema_name, uint schema_name_length,
   const char *object_name, uint object_name_length);

/**
  Acquire a sp share instrumentation.
  @param type of stored program
  @param schema name of stored program
  @param name of stored program
  @return a stored program share instrumentation, or NULL
*/
typedef struct PSI_sp_share* (*get_sp_share_v1_t)
  (uint object_type,
   const char *schema_name, uint schema_name_length,
   const char *object_name, uint object_name_length);

/**
  Release a stored program share.
  @param info the stored program share to release
*/
typedef void (*release_sp_share_v1_t)(struct PSI_sp_share *share);

typedef PSI_metadata_lock* (*create_metadata_lock_v1_t)
  (void *identity,
   const MDL_key *key,
   opaque_mdl_type mdl_type,
   opaque_mdl_duration mdl_duration,
   opaque_mdl_status mdl_status,
   const char *src_file,
   uint src_line);

typedef void (*set_metadata_lock_status_v1_t)(PSI_metadata_lock *lock,
                                              opaque_mdl_status mdl_status);

typedef void (*destroy_metadata_lock_v1_t)(PSI_metadata_lock *lock);

typedef struct PSI_metadata_locker* (*start_metadata_wait_v1_t)
  (struct PSI_metadata_locker_state_v1 *state,
   struct PSI_metadata_lock *mdl,
   const char *src_file, uint src_line);

typedef void (*end_metadata_wait_v1_t)
  (struct PSI_metadata_locker *locker, int rc);

/**
  Stores an array of connection attributes
  @param buffer         char array of length encoded connection attributes
                        in network format
  @param length         length of the data in buffer
  @param from_cs        charset in which @c buffer is encoded
  @return state
    @retval  non_0    attributes truncated
    @retval  0        stored the attribute
*/
typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint length,
                                             const void *from_cs);

/**
  Performance Schema Interface, version 1.
  @since PSI_VERSION_1
*/
struct PSI_v1
{
  /** @sa register_mutex_v1_t. */
  register_mutex_v1_t register_mutex;
  /** @sa register_rwlock_v1_t. */
  register_rwlock_v1_t register_rwlock;
  /** @sa register_cond_v1_t. */
  register_cond_v1_t register_cond;
  /** @sa register_thread_v1_t. */
  register_thread_v1_t register_thread;
  /** @sa register_file_v1_t. */
  register_file_v1_t register_file;
  /** @sa register_stage_v1_t. */
  register_stage_v1_t register_stage;
  /** @sa register_statement_v1_t. */
  register_statement_v1_t register_statement;
  /** @sa register_socket_v1_t. */
  register_socket_v1_t register_socket;
  /** @sa init_mutex_v1_t. */
  init_mutex_v1_t init_mutex;
  /** @sa destroy_mutex_v1_t. */
  destroy_mutex_v1_t destroy_mutex;
  /** @sa init_rwlock_v1_t. */
  init_rwlock_v1_t init_rwlock;
  /** @sa destroy_rwlock_v1_t. */
  destroy_rwlock_v1_t destroy_rwlock;
  /** @sa init_cond_v1_t. */
  init_cond_v1_t init_cond;
  /** @sa destroy_cond_v1_t. */
  destroy_cond_v1_t destroy_cond;
  /** @sa init_socket_v1_t. */
  init_socket_v1_t init_socket;
  /** @sa destroy_socket_v1_t. */
  destroy_socket_v1_t destroy_socket;

  /** @sa get_table_share_v1_t. */
  get_table_share_v1_t get_table_share;
  /** @sa release_table_share_v1_t. */
  release_table_share_v1_t release_table_share;
  /** @sa drop_table_share_v1_t. */
  drop_table_share_v1_t drop_table_share;
  /** @sa open_table_v1_t. */
  open_table_v1_t open_table;
  /** @sa unbind_table_v1_t. */
  unbind_table_v1_t unbind_table;
  /** @sa rebind_table_v1_t. */
  rebind_table_v1_t rebind_table;
  /** @sa close_table_v1_t. */
  close_table_v1_t close_table;
  /** @sa create_file_v1_t. */
  create_file_v1_t create_file;
  /** @sa spawn_thread_v1_t. */
  spawn_thread_v1_t spawn_thread;
  /** @sa new_thread_v1_t. */
  new_thread_v1_t new_thread;
  /** @sa set_thread_id_v1_t. */
  set_thread_id_v1_t set_thread_id;
  /** @sa set_thread_THD_v1_t. */
  set_thread_THD_v1_t set_thread_THD;
  /** @sa set_thread_os_id_v1_t. */
  set_thread_os_id_v1_t set_thread_os_id;
  /** @sa get_thread_v1_t. */
  get_thread_v1_t get_thread;
  /** @sa set_thread_user_v1_t. */
  set_thread_user_v1_t set_thread_user;
  /** @sa set_thread_account_v1_t. */
  set_thread_account_v1_t set_thread_account;
  /** @sa set_thread_db_v1_t. */
  set_thread_db_v1_t set_thread_db;
  /** @sa set_thread_command_v1_t. */
  set_thread_command_v1_t set_thread_command;
  /** @sa set_connection_type_v1_t. */
  set_connection_type_v1_t set_connection_type;
  /** @sa set_thread_start_time_v1_t. */
  set_thread_start_time_v1_t set_thread_start_time;
  /** @sa set_thread_state_v1_t. */
  set_thread_state_v1_t set_thread_state;
  /** @sa set_thread_info_v1_t. */
  set_thread_info_v1_t set_thread_info;
  /** @sa set_thread_v1_t. */
  set_thread_v1_t set_thread;
  /** @sa delete_current_thread_v1_t. */
  delete_current_thread_v1_t delete_current_thread;
  /** @sa delete_thread_v1_t. */
  delete_thread_v1_t delete_thread;
  /** @sa get_thread_file_name_locker_v1_t. */
  get_thread_file_name_locker_v1_t get_thread_file_name_locker;
  /** @sa get_thread_file_stream_locker_v1_t. */
  get_thread_file_stream_locker_v1_t get_thread_file_stream_locker;
  /** @sa get_thread_file_descriptor_locker_v1_t. */
  get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker;
  /** @sa unlock_mutex_v1_t. */
  unlock_mutex_v1_t unlock_mutex;
  /** @sa unlock_rwlock_v1_t. */
  unlock_rwlock_v1_t unlock_rwlock;
  /** @sa signal_cond_v1_t. */
  signal_cond_v1_t signal_cond;
  /** @sa broadcast_cond_v1_t. */
  broadcast_cond_v1_t broadcast_cond;
  /** @sa start_idle_wait_v1_t. */
  start_idle_wait_v1_t start_idle_wait;
  /** @sa end_idle_wait_v1_t. */
  end_idle_wait_v1_t end_idle_wait;
  /** @sa start_mutex_wait_v1_t. */
  start_mutex_wait_v1_t start_mutex_wait;
  /** @sa end_mutex_wait_v1_t. */
  end_mutex_wait_v1_t end_mutex_wait;
  /** @sa start_rwlock_rdwait_v1_t. */
  start_rwlock_rdwait_v1_t start_rwlock_rdwait;
  /** @sa end_rwlock_rdwait_v1_t. */
  end_rwlock_rdwait_v1_t end_rwlock_rdwait;
  /** @sa start_rwlock_wrwait_v1_t. */
  start_rwlock_wrwait_v1_t start_rwlock_wrwait;
  /** @sa end_rwlock_wrwait_v1_t. */
  end_rwlock_wrwait_v1_t end_rwlock_wrwait;
  /** @sa start_cond_wait_v1_t. */
  start_cond_wait_v1_t start_cond_wait;
  /** @sa end_cond_wait_v1_t. */
  end_cond_wait_v1_t end_cond_wait;
  /** @sa start_table_io_wait_v1_t. */
  start_table_io_wait_v1_t start_table_io_wait;
  /** @sa end_table_io_wait_v1_t. */
  end_table_io_wait_v1_t end_table_io_wait;
  /** @sa start_table_lock_wait_v1_t. */
  start_table_lock_wait_v1_t start_table_lock_wait;
  /** @sa end_table_lock_wait_v1_t. */
  end_table_lock_wait_v1_t end_table_lock_wait;
  /** @sa start_file_open_wait_v1_t. */
  start_file_open_wait_v1_t start_file_open_wait;
  /** @sa end_file_open_wait_v1_t. */
  end_file_open_wait_v1_t end_file_open_wait;
  /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */
  end_file_open_wait_and_bind_to_descriptor_v1_t
    end_file_open_wait_and_bind_to_descriptor;
  /** @sa end_temp_file_open_wait_and_bind_to_descriptor_v1_t. */
  end_temp_file_open_wait_and_bind_to_descriptor_v1_t
    end_temp_file_open_wait_and_bind_to_descriptor;
  /** @sa start_file_wait_v1_t. */
  start_file_wait_v1_t start_file_wait;
  /** @sa end_file_wait_v1_t. */
  end_file_wait_v1_t end_file_wait;
  /** @sa start_file_close_wait_v1_t. */
  start_file_close_wait_v1_t start_file_close_wait;
  /** @sa end_file_close_wait_v1_t. */
  end_file_close_wait_v1_t end_file_close_wait;
  /** @sa rename_file_close_wait_v1_t. */
  end_file_rename_wait_v1_t end_file_rename_wait;
  /** @sa start_stage_v1_t. */
  start_stage_v1_t start_stage;
  /** @sa get_current_stage_progress_v1_t. */
  get_current_stage_progress_v1_t get_current_stage_progress;
  /** @sa end_stage_v1_t. */
  end_stage_v1_t end_stage;
  /** @sa get_thread_statement_locker_v1_t. */
  get_thread_statement_locker_v1_t get_thread_statement_locker;
  /** @sa refine_statement_v1_t. */
  refine_statement_v1_t refine_statement;
  /** @sa start_statement_v1_t. */
  start_statement_v1_t start_statement;
  /** @sa set_statement_text_v1_t. */
  set_statement_text_v1_t set_statement_text;
  /** @sa set_statement_lock_time_t. */
  set_statement_lock_time_t set_statement_lock_time;
  /** @sa set_statement_rows_sent_t. */
  set_statement_rows_sent_t set_statement_rows_sent;
  /** @sa set_statement_rows_examined_t. */
  set_statement_rows_examined_t set_statement_rows_examined;
  /** @sa inc_statement_created_tmp_disk_tables. */
  inc_statement_created_tmp_disk_tables_t inc_statement_created_tmp_disk_tables;
  /** @sa inc_statement_created_tmp_tables. */
  inc_statement_created_tmp_tables_t inc_statement_created_tmp_tables;
  /** @sa inc_statement_select_full_join. */
  inc_statement_select_full_join_t inc_statement_select_full_join;
  /** @sa inc_statement_select_full_range_join. */
  inc_statement_select_full_range_join_t inc_statement_select_full_range_join;
  /** @sa inc_statement_select_range. */
  inc_statement_select_range_t inc_statement_select_range;
  /** @sa inc_statement_select_range_check. */
  inc_statement_select_range_check_t inc_statement_select_range_check;
  /** @sa inc_statement_select_scan. */
  inc_statement_select_scan_t inc_statement_select_scan;
  /** @sa inc_statement_sort_merge_passes. */
  inc_statement_sort_merge_passes_t inc_statement_sort_merge_passes;
  /** @sa inc_statement_sort_range. */
  inc_statement_sort_range_t inc_statement_sort_range;
  /** @sa inc_statement_sort_rows. */
  inc_statement_sort_rows_t inc_statement_sort_rows;
  /** @sa inc_statement_sort_scan. */
  inc_statement_sort_scan_t inc_statement_sort_scan;
  /** @sa set_statement_no_index_used. */
  set_statement_no_index_used_t set_statement_no_index_used;
  /** @sa set_statement_no_good_index_used. */
  set_statement_no_good_index_used_t set_statement_no_good_index_used;
  /** @sa end_statement_v1_t. */
  end_statement_v1_t end_statement;
  /** @sa get_thread_transaction_locker_v1_t. */
  get_thread_transaction_locker_v1_t get_thread_transaction_locker;
  /** @sa start_transaction_v1_t. */
  start_transaction_v1_t start_transaction;
  /** @sa set_transaction_xid_v1_t. */
  set_transaction_xid_v1_t set_transaction_xid;
  /** @sa set_transaction_xa_state_v1_t. */
  set_transaction_xa_state_v1_t set_transaction_xa_state;
  /** @sa set_transaction_gtid_v1_t. */
  set_transaction_gtid_v1_t set_transaction_gtid;
  /** @sa set_transaction_trxid_v1_t. */
  set_transaction_trxid_v1_t set_transaction_trxid;
  /** @sa inc_transaction_savepoints_v1_t. */
  inc_transaction_savepoints_v1_t inc_transaction_savepoints;
  /** @sa inc_transaction_rollback_to_savepoint_v1_t. */
  inc_transaction_rollback_to_savepoint_v1_t inc_transaction_rollback_to_savepoint;
  /** @sa inc_transaction_release_savepoint_v1_t. */
  inc_transaction_release_savepoint_v1_t inc_transaction_release_savepoint;
  /** @sa end_transaction_v1_t. */
  end_transaction_v1_t end_transaction;
  /** @sa start_socket_wait_v1_t. */
  start_socket_wait_v1_t start_socket_wait;
  /** @sa end_socket_wait_v1_t. */
  end_socket_wait_v1_t end_socket_wait;
  /** @sa set_socket_state_v1_t. */
  set_socket_state_v1_t set_socket_state;
  /** @sa set_socket_info_v1_t. */
  set_socket_info_v1_t set_socket_info;
  /** @sa set_socket_thread_owner_v1_t. */
  set_socket_thread_owner_v1_t set_socket_thread_owner;
  /** @sa create_prepared_stmt_v1_t. */
  create_prepared_stmt_v1_t create_prepared_stmt;
  /** @sa destroy_prepared_stmt_v1_t. */
  destroy_prepared_stmt_v1_t destroy_prepared_stmt;
  /** @sa reprepare_prepared_stmt_v1_t. */
  reprepare_prepared_stmt_v1_t reprepare_prepared_stmt;
  /** @sa execute_prepared_stmt_v1_t. */
  execute_prepared_stmt_v1_t execute_prepared_stmt;
  /** @sa set_prepared_stmt_text_v1_t. */
  set_prepared_stmt_text_v1_t set_prepared_stmt_text;
  /** @sa digest_start_v1_t. */
  digest_start_v1_t digest_start;
  /** @sa digest_end_v1_t. */
  digest_end_v1_t digest_end;
  /** @sa set_thread_connect_attrs_v1_t. */
  set_thread_connect_attrs_v1_t set_thread_connect_attrs;
  /** @sa start_sp_v1_t. */
  start_sp_v1_t start_sp;
  /** @sa start_sp_v1_t. */
  end_sp_v1_t end_sp;
  /** @sa drop_sp_v1_t. */
  drop_sp_v1_t drop_sp;
  /** @sa get_sp_share_v1_t. */
  get_sp_share_v1_t get_sp_share;
  /** @sa release_sp_share_v1_t. */
  release_sp_share_v1_t release_sp_share;
  /** @sa register_memory_v1_t. */
  register_memory_v1_t register_memory;
  /** @sa memory_alloc_v1_t. */
  memory_alloc_v1_t memory_alloc;
  /** @sa memory_realloc_v1_t. */
  memory_realloc_v1_t memory_realloc;
  /** @sa memory_claim_v1_t. */
  memory_claim_v1_t memory_claim;
  /** @sa memory_free_v1_t. */
  memory_free_v1_t memory_free;

  unlock_table_v1_t unlock_table;

  create_metadata_lock_v1_t create_metadata_lock;
  set_metadata_lock_status_v1_t set_metadata_lock_status;
  destroy_metadata_lock_v1_t destroy_metadata_lock;

  start_metadata_wait_v1_t start_metadata_wait;
  end_metadata_wait_v1_t end_metadata_wait;

  set_thread_peer_port_v1_t set_thread_peer_port;
};

/** @} (end of group Group_PSI_v1) */

#endif /* HAVE_PSI_1 */

#ifdef USE_PSI_2
#define HAVE_PSI_2
#endif

#ifdef HAVE_PSI_2

/**
  @defgroup Group_PSI_v2 Application Binary Interface, version 2
  @ingroup Instrumentation_interface
  @{
*/

/**
  Performance Schema Interface, version 2.
  This is a placeholder, this interface is not defined yet.
  @since PSI_VERSION_2
*/
struct PSI_v2
{
  /** Placeholder */
  int placeholder;
  /* ... extended interface ... */
};

/** Placeholder */
struct PSI_mutex_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_rwlock_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_cond_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_thread_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_file_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_stage_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_statement_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_transaction_info_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_idle_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_mutex_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_rwlock_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_cond_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_file_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_statement_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_transaction_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

/** Placeholder */
struct PSI_socket_locker_state_v2
{
  /** Placeholder */
  int placeholder;
};

struct PSI_metadata_locker_state_v2
{
  int placeholder;
};

/** @} (end of group Group_PSI_v2) */

#endif /* HAVE_PSI_2 */

/**
  @typedef PSI
  The instrumentation interface for the current version.
  @sa PSI_CURRENT_VERSION
*/

/**
  @typedef PSI_mutex_info
  The mutex information structure for the current version.
*/

/**
  @typedef PSI_rwlock_info
  The rwlock information structure for the current version.
*/

/**
  @typedef PSI_cond_info
  The cond information structure for the current version.
*/

/**
  @typedef PSI_thread_info
  The thread information structure for the current version.
*/

/**
  @typedef PSI_file_info
  The file information structure for the current version.
*/

/* Export the required version */
#ifdef USE_PSI_1
typedef struct PSI_v1 PSI;
typedef struct PSI_mutex_info_v1 PSI_mutex_info;
typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
typedef struct PSI_cond_info_v1 PSI_cond_info;
typedef struct PSI_thread_info_v1 PSI_thread_info;
typedef struct PSI_file_info_v1 PSI_file_info;
typedef struct PSI_stage_info_v1 PSI_stage_info;
typedef struct PSI_statement_info_v1 PSI_statement_info;
typedef struct PSI_transaction_info_v1 PSI_transaction_info;
typedef struct PSI_socket_info_v1 PSI_socket_info;
typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state;
typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state;
typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state;
typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state;
typedef struct PSI_file_locker_state_v1 PSI_file_locker_state;
typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state;
typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state;
typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state;
typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state;
typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state;
#endif

#ifdef USE_PSI_2
typedef struct PSI_v2 PSI;
typedef struct PSI_mutex_info_v2 PSI_mutex_info;
typedef struct PSI_rwlock_info_v2 PSI_rwlock_info;
typedef struct PSI_cond_info_v2 PSI_cond_info;
typedef struct PSI_thread_info_v2 PSI_thread_info;
typedef struct PSI_file_info_v2 PSI_file_info;
typedef struct PSI_stage_info_v2 PSI_stage_info;
typedef struct PSI_statement_info_v2 PSI_statement_info;
typedef struct PSI_transaction_info_v2 PSI_transaction_info;
typedef struct PSI_socket_info_v2 PSI_socket_info;
typedef struct PSI_idle_locker_state_v2 PSI_idle_locker_state;
typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state;
typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state;
typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state;
typedef struct PSI_file_locker_state_v2 PSI_file_locker_state;
typedef struct PSI_statement_locker_state_v2 PSI_statement_locker_state;
typedef struct PSI_transaction_locker_state_v2 PSI_transaction_locker_state;
typedef struct PSI_socket_locker_state_v2 PSI_socket_locker_state;
typedef struct PSI_sp_locker_state_v2 PSI_sp_locker_state;
typedef struct PSI_metadata_locker_state_v2 PSI_metadata_locker_state;
#endif

#ifndef HAVE_PSI_INTERFACE

/**
  Dummy structure, used to declare PSI_server when no instrumentation
  is available.
  The content does not matter, since PSI_server will be NULL.
*/
struct PSI_none
{
  int opaque;
};
typedef struct PSI_none PSI;

/**
  Stage instrument information.
  @since PSI_VERSION_1
  This structure is used to register an instrumented stage.
*/
struct PSI_stage_info_none
{
  /** Unused stage key. */
  unsigned int m_key;
  /** The name of the stage instrument. */
  const char *m_name;
  /** Unused stage flags. */
  int m_flags;
};

/**
  The stage instrumentation has to co exist with the legacy
  THD::set_proc_info instrumentation.
  To avoid duplication of the instrumentation in the server,
  the common PSI_stage_info structure is used,
  so we export it here, even when not building
  with HAVE_PSI_INTERFACE.
*/
typedef struct PSI_stage_info_none PSI_stage_info;
typedef struct PSI_stage_info_none PSI_statement_info;
typedef struct PSI_stage_info_none PSI_sp_locker_state;
typedef struct PSI_stage_info_none PSI_metadata_locker_state;
typedef struct PSI_stage_info_none PSI_metadata_locker;

#endif /* HAVE_PSI_INTERFACE */

extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;

/*
  Allow to override PSI_XXX_CALL at compile time
  with more efficient implementations, if available.
  If nothing better is available,
  make a dynamic call using the PSI_server function pointer.
*/

#define PSI_DYNAMIC_CALL(M) PSI_server->M

/** @} */

C_MODE_END
#endif /* MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H */

server/mysql/psi/mysql_file.h000064400000117763150400263620012344 0ustar00/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_FILE_H
#define MYSQL_FILE_H

/* For strlen() */
#include <string.h>
/* For MY_STAT */
#include <my_dir.h>
/* For my_chsize */
#include <my_sys.h>

/**
  @file mysql/psi/mysql_file.h
  Instrumentation helpers for mysys file io.
  This header file provides the necessary declarations
  to use the mysys file API with the performance schema instrumentation.
  In some compilers (SunStudio), 'static inline' functions, when declared
  but not used, are not optimized away (because they are unused) by default,
  so that including a static inline function from a header file does
  create unwanted dependencies, causing unresolved symbols at link time.
  Other compilers, like gcc, optimize these dependencies by default.

  Since the instrumented APIs declared here are wrapper on top
  of mysys file io APIs, including mysql/psi/mysql_file.h assumes that
  the dependency on my_sys already exists.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_FILE_CALL
#define PSI_FILE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup File_instrumentation File Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def mysql_file_register(P1, P2, P3)
  File registration.
*/
#define mysql_file_register(P1, P2, P3) \
  inline_mysql_file_register(P1, P2, P3)

/**
  @def mysql_file_fgets(P1, P2, F)
  Instrumented fgets.
  @c mysql_file_fgets is a replacement for @c fgets.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fgets(P1, P2, F) \
    inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F)
#else
  #define mysql_file_fgets(P1, P2, F) \
    inline_mysql_file_fgets(P1, P2, F)
#endif

/**
  @def mysql_file_fgetc(F)
  Instrumented fgetc.
  @c mysql_file_fgetc is a replacement for @c fgetc.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fgetc(F) inline_mysql_file_fgetc(__FILE__, __LINE__, F)
#else
  #define mysql_file_fgetc(F) inline_mysql_file_fgetc(F)
#endif

/**
  @def mysql_file_fputs(P1, F)
  Instrumented fputs.
  @c mysql_file_fputs is a replacement for @c fputs.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fputs(P1, F) \
    inline_mysql_file_fputs(__FILE__, __LINE__, P1, F)
#else
  #define mysql_file_fputs(P1, F)\
    inline_mysql_file_fputs(P1, F)
#endif

/**
  @def mysql_file_fputc(P1, F)
  Instrumented fputc.
  @c mysql_file_fputc is a replacement for @c fputc.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fputc(P1, F) \
    inline_mysql_file_fputc(__FILE__, __LINE__, P1, F)
#else
  #define mysql_file_fputc(P1, F) \
    inline_mysql_file_fputc(P1, F)
#endif

/**
  @def mysql_file_fprintf
  Instrumented fprintf.
  @c mysql_file_fprintf is a replacement for @c fprintf.
*/
#define mysql_file_fprintf inline_mysql_file_fprintf

/**
  @def mysql_file_vfprintf(F, P1, P2)
  Instrumented vfprintf.
  @c mysql_file_vfprintf is a replacement for @c vfprintf.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_vfprintf(F, P1, P2) \
    inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2)
#else
  #define mysql_file_vfprintf(F, P1, P2) \
    inline_mysql_file_vfprintf(F, P1, P2)
#endif

/**
  @def mysql_file_fflush(F, P1, P2)
  Instrumented fflush.
  @c mysql_file_fflush is a replacement for @c fflush.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fflush(F) \
    inline_mysql_file_fflush(__FILE__, __LINE__, F)
#else
  #define mysql_file_fflush(F) \
    inline_mysql_file_fflush(F)
#endif

/**
  @def mysql_file_feof(F)
  Instrumented feof.
  @c mysql_file_feof is a replacement for @c feof.
*/
#define mysql_file_feof(F) inline_mysql_file_feof(F)

/**
  @def mysql_file_fstat(FN, S, FL)
  Instrumented fstat.
  @c mysql_file_fstat is a replacement for @c my_fstat.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fstat(FN, S, FL) \
    inline_mysql_file_fstat(__FILE__, __LINE__, FN, S, FL)
#else
  #define mysql_file_fstat(FN, S, FL) \
    inline_mysql_file_fstat(FN, S, FL)
#endif

/**
  @def mysql_file_stat(K, FN, S, FL)
  Instrumented stat.
  @c mysql_file_stat is a replacement for @c my_stat.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_stat(K, FN, S, FL) \
    inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL)
#else
  #define mysql_file_stat(K, FN, S, FL) \
    inline_mysql_file_stat(FN, S, FL)
#endif

/**
  @def mysql_file_chsize(F, P1, P2, P3)
  Instrumented chsize.
  @c mysql_file_chsize is a replacement for @c my_chsize.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_chsize(F, P1, P2, P3) \
    inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3)
#else
  #define mysql_file_chsize(F, P1, P2, P3) \
    inline_mysql_file_chsize(F, P1, P2, P3)
#endif

/**
  @def mysql_file_fopen(K, N, F1, F2)
  Instrumented fopen.
  @c mysql_file_fopen is a replacement for @c my_fopen.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fopen(K, N, F1, F2) \
    inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2)
#else
  #define mysql_file_fopen(K, N, F1, F2) \
    inline_mysql_file_fopen(N, F1, F2)
#endif

/**
  @def mysql_file_fclose(FD, FL)
  Instrumented fclose.
  @c mysql_file_fclose is a replacement for @c my_fclose.
  Without the instrumentation, this call will have the same behavior as the
  undocumented and possibly platform specific my_fclose(NULL, ...) behavior.
  With the instrumentation, mysql_fclose(NULL, ...) will safely return 0,
  which is an extension compared to my_fclose and is therefore compliant.
  mysql_fclose is on purpose *not* implementing
  @code assert(file != NULL) @endcode,
  since doing so could introduce regressions.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fclose(FD, FL) \
    inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL)
#else
  #define mysql_file_fclose(FD, FL) \
    inline_mysql_file_fclose(FD, FL)
#endif

/**
  @def mysql_file_fread(FD, P1, P2, P3)
  Instrumented fread.
  @c mysql_file_fread is a replacement for @c my_fread.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fread(FD, P1, P2, P3) \
    inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3)
#else
  #define mysql_file_fread(FD, P1, P2, P3) \
    inline_mysql_file_fread(FD, P1, P2, P3)
#endif

/**
  @def mysql_file_fwrite(FD, P1, P2, P3)
  Instrumented fwrite.
  @c mysql_file_fwrite is a replacement for @c my_fwrite.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fwrite(FD, P1, P2, P3) \
    inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3)
#else
  #define mysql_file_fwrite(FD, P1, P2, P3) \
    inline_mysql_file_fwrite(FD, P1, P2, P3)
#endif

/**
  @def mysql_file_fseek(FD, P, W, F)
  Instrumented fseek.
  @c mysql_file_fseek is a replacement for @c my_fseek.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_fseek(FD, P, W, F) \
    inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W, F)
#else
  #define mysql_file_fseek(FD, P, W, F) \
    inline_mysql_file_fseek(FD, P, W, F)
#endif

/**
  @def mysql_file_ftell(FD, F)
  Instrumented ftell.
  @c mysql_file_ftell is a replacement for @c my_ftell.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_ftell(FD, F) \
    inline_mysql_file_ftell(__FILE__, __LINE__, FD, F)
#else
  #define mysql_file_ftell(FD, F) \
    inline_mysql_file_ftell(FD, F)
#endif

/**
  @def mysql_file_create(K, N, F1, F2, F3)
  Instrumented create.
  @c mysql_file_create is a replacement for @c my_create.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_create(K, N, F1, F2, F3) \
  inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3)
#else
  #define mysql_file_create(K, N, F1, F2, F3) \
    inline_mysql_file_create(N, F1, F2, F3)
#endif

/**
  @def mysql_file_create_temp(K, T, D, P, M, F)
  Instrumented create_temp_file.
  @c mysql_file_create_temp is a replacement for @c create_temp_file.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_create_temp(K, T, D, P, M, F) \
    inline_mysql_file_create_temp(K, __FILE__, __LINE__, T, D, P, M, F)
#else
  #define mysql_file_create_temp(K, T, D, P, M, F) \
    inline_mysql_file_create_temp(T, D, P, M, F)
#endif

/**
  @def mysql_file_open(K, N, F1, F2)
  Instrumented open.
  @c mysql_file_open is a replacement for @c my_open.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_open(K, N, F1, F2) \
    inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2)
#else
  #define mysql_file_open(K, N, F1, F2) \
    inline_mysql_file_open(N, F1, F2)
#endif

/**
  @def mysql_file_close(FD, F)
  Instrumented close.
  @c mysql_file_close is a replacement for @c my_close.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_close(FD, F) \
    inline_mysql_file_close(__FILE__, __LINE__, FD, F)
#else
  #define mysql_file_close(FD, F) \
    inline_mysql_file_close(FD, F)
#endif

/**
  @def mysql_file_read(FD, B, S, F)
  Instrumented read.
  @c mysql_read is a replacement for @c my_read.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_read(FD, B, S, F) \
    inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F)
#else
  #define mysql_file_read(FD, B, S, F) \
    inline_mysql_file_read(FD, B, S, F)
#endif

/**
  @def mysql_file_write(FD, B, S, F)
  Instrumented write.
  @c mysql_file_write is a replacement for @c my_write.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_write(FD, B, S, F) \
    inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F)
#else
  #define mysql_file_write(FD, B, S, F) \
    inline_mysql_file_write(FD, B, S, F)
#endif

/**
  @def mysql_file_pread(FD, B, S, O, F)
  Instrumented pread.
  @c mysql_pread is a replacement for @c my_pread.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_pread(FD, B, S, O, F) \
    inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F)
#else
  #define mysql_file_pread(FD, B, S, O, F) \
    inline_mysql_file_pread(FD, B, S, O, F)
#endif

/**
  @def mysql_file_pwrite(FD, B, S, O, F)
  Instrumented pwrite.
  @c mysql_file_pwrite is a replacement for @c my_pwrite.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_pwrite(FD, B, S, O, F) \
    inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F)
#else
  #define mysql_file_pwrite(FD, B, S, O, F) \
    inline_mysql_file_pwrite(FD, B, S, O, F)
#endif

/**
  @def mysql_file_seek(FD, P, W, F)
  Instrumented seek.
  @c mysql_file_seek is a replacement for @c my_seek.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_seek(FD, P, W, F) \
    inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F)
#else
  #define mysql_file_seek(FD, P, W, F) \
    inline_mysql_file_seek(FD, P, W, F)
#endif

/**
  @def mysql_file_tell(FD, F)
  Instrumented tell.
  @c mysql_file_tell is a replacement for @c my_tell.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_tell(FD, F) \
    inline_mysql_file_tell(__FILE__, __LINE__, FD, F)
#else
  #define mysql_file_tell(FD, F) \
    inline_mysql_file_tell(FD, F)
#endif

/**
  @def mysql_file_delete(K, P1, P2)
  Instrumented delete.
  @c mysql_file_delete is a replacement for @c my_delete.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_delete(K, P1, P2) \
    inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2)
#else
  #define mysql_file_delete(K, P1, P2) \
    inline_mysql_file_delete(P1, P2)
#endif

/**
  @def mysql_file_rename(K, P1, P2, P3)
  Instrumented rename.
  @c mysql_file_rename is a replacement for @c my_rename.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_rename(K, P1, P2, P3) \
    inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3)
#else
  #define mysql_file_rename(K, P1, P2, P3) \
    inline_mysql_file_rename(P1, P2, P3)
#endif

/**
  @def mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5)
  Instrumented create with symbolic link.
  @c mysql_file_create_with_symlink is a replacement
  for @c my_create_with_symlink.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \
  inline_mysql_file_create_with_symlink(K, __FILE__, __LINE__, \
                                        P1, P2, P3, P4, P5)
#else
  #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \
  inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5)
#endif

/**
  @def mysql_file_delete_with_symlink(K, P1, P2, P3)
  Instrumented delete with symbolic link.
  @c mysql_file_delete_with_symlink is a replacement
  for @c my_handler_delete_with_symlink.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_delete_with_symlink(K, P1, P2, P3) \
  inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
#else
  #define mysql_file_delete_with_symlink(K, P1, P2, P3) \
  inline_mysql_file_delete_with_symlink(P1, P2, P3)
#endif

/**
  @def mysql_file_rename_with_symlink(K, P1, P2, P3)
  Instrumented rename with symbolic link.
  @c mysql_file_rename_with_symlink is a replacement
  for @c my_rename_with_symlink.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_rename_with_symlink(K, P1, P2, P3) \
  inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
#else
  #define mysql_file_rename_with_symlink(K, P1, P2, P3) \
  inline_mysql_file_rename_with_symlink(P1, P2, P3)
#endif

/**
  @def mysql_file_sync(P1, P2)
  Instrumented file sync.
  @c mysql_file_sync is a replacement for @c my_sync.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
  #define mysql_file_sync(P1, P2) \
    inline_mysql_file_sync(__FILE__, __LINE__, P1, P2)
#else
  #define mysql_file_sync(P1, P2) \
    inline_mysql_file_sync(P1, P2)
#endif

/**
  An instrumented FILE structure.
  @sa MYSQL_FILE
*/
struct st_mysql_file
{
  /** The real file. */
  FILE *m_file;
  /**
    The instrumentation hook.
    Note that this hook is not conditionally defined,
    for binary compatibility of the @c MYSQL_FILE interface.
  */
  struct PSI_file *m_psi;
};

/**
  Type of an instrumented file.
  @c MYSQL_FILE is a drop-in replacement for @c FILE.
  @sa mysql_file_open
*/
typedef struct st_mysql_file MYSQL_FILE;

static inline void inline_mysql_file_register(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *category,
  PSI_file_info *info,
  int count
#else
  const char *category __attribute__ ((unused)),
  void *info __attribute__ ((unused)),
  int count __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_FILE_CALL(register_file)(category, info, count);
#endif
}

static inline char *
inline_mysql_file_fgets(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  char *str, int size, MYSQL_FILE *file)
{
  char *result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker) (&state, file->m_psi, PSI_FILE_READ);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) size, src_file, src_line);
      result= fgets(str, size, file->m_file);
      PSI_FILE_CALL(end_file_wait)(locker, result ? strlen(result) : 0);
      return result;
    }
  }
#endif

  result= fgets(str, size, file->m_file);
  return result;
}

static inline int
inline_mysql_file_fgetc(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_READ);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line);
      result= fgetc(file->m_file);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) 1);
      return result;
    }
  }
#endif

  result= fgetc(file->m_file);
  return result;
}

static inline int
inline_mysql_file_fputs(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  const char *str, MYSQL_FILE *file)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    size_t bytes;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker) (&state, file->m_psi, PSI_FILE_WRITE);
    if (likely(locker != NULL))
    {
      bytes= str ? strlen(str) : 0;
      PSI_FILE_CALL(start_file_wait)(locker, bytes, src_file, src_line);
      result= fputs(str, file->m_file);
      PSI_FILE_CALL(end_file_wait)(locker, bytes);
      return result;
    }
  }
#endif

  result= fputs(str, file->m_file);
  return result;
}

static inline int
inline_mysql_file_fputc(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  char c, MYSQL_FILE *file)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker) (&state, file->m_psi, PSI_FILE_WRITE);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line);
      result= fputc(c, file->m_file);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) 1);
      return result;
    }
  }
#endif

  result= fputc(c, file->m_file);
  return result;
}

static inline int
inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...)
{
  /*
    TODO: figure out how to pass src_file and src_line from the caller.
  */
  int result;
  va_list args;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker) (&state, file->m_psi, PSI_FILE_WRITE);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, __FILE__, __LINE__);
      va_start(args, format);
      result= vfprintf(file->m_file, format, args);
      va_end(args);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) result);
      return result;
    }
  }
#endif

  va_start(args, format);
  result= vfprintf(file->m_file, format, args);
  va_end(args);
  return result;
}

static inline int
inline_mysql_file_vfprintf(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file, const char *format, va_list args)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker) (&state, file->m_psi, PSI_FILE_WRITE);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
      result= vfprintf(file->m_file, format, args);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) result);
      return result;
    }
  }
#endif

  result= vfprintf(file->m_file, format, args);
  return result;
}

static inline int
inline_mysql_file_fflush(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_FLUSH);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
      result= fflush(file->m_file);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
      return result;
    }
  }
#endif

  result= fflush(file->m_file);
  return result;
}

static inline int inline_mysql_file_feof(MYSQL_FILE *file)
{
  /* Not instrumented, there is no wait involved */
  return feof(file->m_file);
}

static inline int
inline_mysql_file_fstat(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  int filenr, MY_STAT *stat_area, myf flags)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, filenr, PSI_FILE_FSTAT);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
    result= my_fstat(filenr, stat_area, flags);
    PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
    return result;
  }
#endif

  result= my_fstat(filenr, stat_area, flags);
  return result;
}

static inline MY_STAT *
inline_mysql_file_stat(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *path, MY_STAT *stat_area, myf flags)
{
  MY_STAT *result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_STAT, path, &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
    result= my_stat(path, stat_area, flags);
    PSI_FILE_CALL(end_file_open_wait)(locker, result);
    return result;
  }
#endif

  result= my_stat(path, stat_area, flags);
  return result;
}

static inline int
inline_mysql_file_chsize(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, my_off_t newlength, int filler, myf flags)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_CHSIZE);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) newlength, src_file,
                                   src_line);
    result= my_chsize(file, newlength, filler, flags);
    PSI_FILE_CALL(end_file_wait)(locker, (size_t) newlength);
    return result;
  }
#endif

  result= my_chsize(file, newlength, filler, flags);
  return result;
}

static inline MYSQL_FILE*
inline_mysql_file_fopen(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *filename, int flags, myf myFlags)
{
  MYSQL_FILE *that;
  that= (MYSQL_FILE*) my_malloc(PSI_NOT_INSTRUMENTED,
                                sizeof(MYSQL_FILE), MYF(MY_WME));
  if (likely(that != NULL))
  {
#ifdef HAVE_PSI_FILE_INTERFACE
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_STREAM_OPEN,
                                                       filename, that);
    if (psi_likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
      that->m_file= my_fopen(filename, flags, myFlags);
      that->m_psi= PSI_FILE_CALL(end_file_open_wait)(locker, that->m_file);
      if (unlikely(that->m_file == NULL))
      {
        my_free(that);
        return NULL;
      }
      return that;
    }
#endif

    that->m_psi= NULL;
    that->m_file= my_fopen(filename, flags, myFlags);
    if (unlikely(that->m_file == NULL))
    {
      my_free(that);
      return NULL;
    }
  }
  return that;
}

static inline int
inline_mysql_file_fclose(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file, myf flags)
{
  int result= 0;
  if (likely(file != NULL))
  {
#ifdef HAVE_PSI_FILE_INTERFACE
    if (psi_likely(file->m_psi))
    {
      struct PSI_file_locker *locker;
      PSI_file_locker_state state;
      locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
                                                           PSI_FILE_STREAM_CLOSE);
      if (likely(locker != NULL))
      {
        PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
        result= my_fclose(file->m_file, flags);
        PSI_FILE_CALL(end_file_close_wait)(locker, result);
        my_free(file);
        return result;
      }
    }
#endif

    result= my_fclose(file->m_file, flags);
    my_free(file);
  }
  return result;
}

static inline size_t
inline_mysql_file_fread(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file, uchar *buffer, size_t count, myf flags)
{
  size_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    size_t bytes_read;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_READ);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
      result= my_fread(file->m_file, buffer, count, flags);
      if (flags & (MY_NABP | MY_FNABP))
        bytes_read= (result == 0) ? count : 0;
      else
        bytes_read= (result != MY_FILE_ERROR) ? result : 0;
      PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
      return result;
    }
  }
#endif

  result= my_fread(file->m_file, buffer, count, flags);
  return result;
}

static inline size_t
inline_mysql_file_fwrite(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags)
{
  size_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    size_t bytes_written;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_WRITE);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
      result= my_fwrite(file->m_file, buffer, count, flags);
      if (flags & (MY_NABP | MY_FNABP))
        bytes_written= (result == 0) ? count : 0;
      else
        bytes_written= (result != MY_FILE_ERROR) ? result : 0;
      PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
      return result;
    }
  }
#endif

  result= my_fwrite(file->m_file, buffer, count, flags);
  return result;
}

static inline my_off_t
inline_mysql_file_fseek(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file, my_off_t pos, int whence, myf flags)
{
  my_off_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_SEEK);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
      result= my_fseek(file->m_file, pos, whence, flags);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
      return result;
    }
  }
#endif

  result= my_fseek(file->m_file, pos, whence, flags);
  return result;
}

static inline my_off_t
inline_mysql_file_ftell(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_FILE *file, myf flags)
{
  my_off_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  if (psi_likely(file->m_psi))
  {
    struct PSI_file_locker *locker;
    PSI_file_locker_state state;
    locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_TELL);
    if (likely(locker != NULL))
    {
      PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
      result= my_ftell(file->m_file, flags);
      PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
      return result;
    }
  }
#endif

  result= my_ftell(file->m_file, flags);
  return result;
}

static inline File
inline_mysql_file_create(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *filename, mode_t create_flags, int access_flags, myf myFlags)
{
  File file;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_CREATE, filename,
                                                     &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
    file= my_create(filename, create_flags, access_flags, myFlags);
    PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
    return file;
  }
#endif

  file= my_create(filename, create_flags, access_flags, myFlags);
  return file;
}

static inline File
inline_mysql_file_create_temp(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  char *to, const char *dir, const char *pfx, int mode, myf myFlags)
{
  File file;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)
    (&state, key, PSI_FILE_CREATE, NULL, &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
    /* The file name is generated by create_temp_file(). */
    file= create_temp_file(to, dir, pfx, mode, myFlags);
    PSI_FILE_CALL(end_temp_file_open_wait_and_bind_to_descriptor)(locker, file, (const char*)to);
    return file;
  }
#endif

  file= create_temp_file(to, dir, pfx, mode, myFlags);
  return file;
}

static inline File
inline_mysql_file_open(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *filename, int flags, myf myFlags)
{
  File file;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_OPEN, filename,
                                                     &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
    file= my_open(filename, flags, myFlags);
    PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
    return file;
  }
#endif

  file= my_open(filename, flags, myFlags);
  return file;
}

static inline int
inline_mysql_file_close(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, myf flags)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_CLOSE);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
    result= my_close(file, flags);
    PSI_FILE_CALL(end_file_close_wait)(locker, result);
    return result;
  }
#endif

  result= my_close(file, flags);
  return result;
}

static inline size_t
inline_mysql_file_read(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, uchar *buffer, size_t count, myf flags)
{
  size_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  size_t bytes_read;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_READ);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
    result= my_read(file, buffer, count, flags);
    if (flags & (MY_NABP | MY_FNABP))
      bytes_read= (result == 0) ? count : 0;
    else
      bytes_read= (result != MY_FILE_ERROR) ? result : 0;
    PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
    return result;
  }
#endif

  result= my_read(file, buffer, count, flags);
  return result;
}

static inline size_t
inline_mysql_file_write(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, const uchar *buffer, size_t count, myf flags)
{
  size_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  size_t bytes_written;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_WRITE);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
    result= my_write(file, buffer, count, flags);
    if (flags & (MY_NABP | MY_FNABP))
      bytes_written= (result == 0) ? count : 0;
    else
      bytes_written= (result != MY_FILE_ERROR) ? result : 0;
    PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
    return result;
  }
#endif

  result= my_write(file, buffer, count, flags);
  return result;
}

static inline size_t
inline_mysql_file_pread(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, uchar *buffer, size_t count, my_off_t offset, myf flags)
{
  size_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  size_t bytes_read;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_READ);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
    result= my_pread(file, buffer, count, offset, flags);
    if (flags & (MY_NABP | MY_FNABP))
      bytes_read= (result == 0) ? count : 0;
    else
      bytes_read= (result != MY_FILE_ERROR) ? result : 0;
    PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
    return result;
  }
#endif

  result= my_pread(file, buffer, count, offset, flags);
  return result;
}

static inline size_t
inline_mysql_file_pwrite(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, const uchar *buffer, size_t count, my_off_t offset, myf flags)
{
  size_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  size_t bytes_written;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_WRITE);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
    result= my_pwrite(file, buffer, count, offset, flags);
    if (flags & (MY_NABP | MY_FNABP))
      bytes_written= (result == 0) ? count : 0;
    else
      bytes_written= (result != MY_FILE_ERROR) ? result : 0;
    PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
    return result;
  }
#endif

  result= my_pwrite(file, buffer, count, offset, flags);
  return result;
}

static inline my_off_t
inline_mysql_file_seek(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, my_off_t pos, int whence, myf flags)
{
  my_off_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_SEEK);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
    result= my_seek(file, pos, whence, flags);
    PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
    return result;
  }
#endif

  result= my_seek(file, pos, whence, flags);
  return result;
}

static inline my_off_t
inline_mysql_file_tell(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File file, myf flags)
{
  my_off_t result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_TELL);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
    result= my_tell(file, flags);
    PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
    return result;
  }
#endif

  result= my_tell(file, flags);
  return result;
}

static inline int
inline_mysql_file_delete(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *name, myf flags)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE, name, &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
    result= my_delete(name, flags);
    PSI_FILE_CALL(end_file_close_wait)(locker, result);
    return result;
  }
#endif

  result= my_delete(name, flags);
  return result;
}

static inline int
inline_mysql_file_rename(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *from, const char *to, myf flags)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)
    (&state, key, PSI_FILE_RENAME, from, &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
    result= my_rename(from, to, flags);
    PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result);
    return result;
  }
#endif

  result= my_rename(from, to, flags);
  return result;
}


static inline File
inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *linkname, const char *filename, mode_t create_flags,
  int access_flags, myf flags)
{
  File file;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_CREATE, filename,
                                                     &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
    file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
                                 flags);
    PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
    return file;
  }
#endif

  file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
                               flags);
  return file;
}


static inline int
inline_mysql_file_delete_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *name, const char *ext, myf flags)
{
  int result;
  char buf[FN_REFLEN];
  char *fullname= fn_format(buf, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT);
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE, fullname,
                                                     &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
    result= my_handler_delete_with_symlink(fullname, flags);
    PSI_FILE_CALL(end_file_close_wait)(locker, result);
    return result;
  }
#endif

  result= my_handler_delete_with_symlink(fullname, flags);
  return result;
}


static inline int
inline_mysql_file_rename_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
  PSI_file_key key, const char *src_file, uint src_line,
#endif
  const char *from, const char *to, myf flags)
{
  int result;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_name_locker)
    (&state, key, PSI_FILE_RENAME, from, &locker);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
    result= my_rename_with_symlink(from, to, flags);
    PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result);
    return result;
  }
#endif

  result= my_rename_with_symlink(from, to, flags);
  return result;
}

static inline int
inline_mysql_file_sync(
#ifdef HAVE_PSI_FILE_INTERFACE
  const char *src_file, uint src_line,
#endif
  File fd, myf flags)
{
  int result= 0;
#ifdef HAVE_PSI_FILE_INTERFACE
  struct PSI_file_locker *locker;
  PSI_file_locker_state state;
  locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)(&state, fd, PSI_FILE_SYNC);
  if (psi_likely(locker != NULL))
  {
    PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
    result= my_sync(fd, flags);
    PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
    return result;
  }
#endif

  result= my_sync(fd, flags);
  return result;
}

/** @} (end of group File_instrumentation) */

#endif
server/mysql/psi/mysql_sp.h000064400000006250150400263620012033 0ustar00/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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-1301  USA */

#ifndef MYSQL_SP_H
#define MYSQL_SP_H

/**
  @file mysql/psi/mysql_sp.h
  Instrumentation helpers for stored programs.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_SP_CALL
#define PSI_SP_CALL(M) PSI_DYNAMIC_CALL(M)                               
#endif    

#ifdef HAVE_PSI_SP_INTERFACE
  #define MYSQL_START_SP(STATE, SP_SHARE) \
    inline_mysql_start_sp(STATE, SP_SHARE)
#else
  #define MYSQL_START_SP(STATE, SP_SHARE) \
    NULL
#endif


#ifdef HAVE_PSI_SP_INTERFACE
  #define MYSQL_END_SP(LOCKER) \
    inline_mysql_end_sp(LOCKER)
#else
  #define MYSQL_END_SP(LOCKER) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_SP_INTERFACE
  #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \
    inline_mysql_drop_sp(OT, SN, SNL, ON, ONL)
#else
  #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_SP_INTERFACE
  #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \
    inline_mysql_get_sp_share(OT, SN, SNL, ON, ONL)
#else
  #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \
    NULL
#endif

#ifdef HAVE_PSI_SP_INTERFACE
static inline struct PSI_sp_locker*
inline_mysql_start_sp(PSI_sp_locker_state *state, PSI_sp_share *sp_share)
{
  return PSI_SP_CALL(start_sp)(state, sp_share);
}

static inline void inline_mysql_end_sp(PSI_sp_locker *locker)
{
  if (likely(locker != NULL))
    PSI_SP_CALL(end_sp)(locker);
}

static inline void 
inline_mysql_drop_sp(uint sp_type,
                     const char* schema_name, uint shcema_name_length,
                     const char* object_name, uint object_name_length)
{
  PSI_SP_CALL(drop_sp)(sp_type,
                       schema_name, shcema_name_length,
                       object_name, object_name_length);
}

static inline PSI_sp_share*
inline_mysql_get_sp_share(uint sp_type,
                          const char* schema_name, uint shcema_name_length,
                          const char* object_name, uint object_name_length)
{
  return PSI_SP_CALL(get_sp_share)(sp_type,
                                   schema_name, shcema_name_length,
                                   object_name, object_name_length);
}
#endif

#endif
server/mysql/psi/psi_base.h000064400000011027150400263620011747 0ustar00/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  Without limiting anything contained in the foregoing, this file,
  which is part of C Driver for MySQL (Connector/C), is also subject to the
  Universal FOSS Exception, version 1.0, a copy of which can be found at
  http://oss.oracle.com/licenses/universal-foss-exception.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_PSI_BASE_H
#define MYSQL_PSI_BASE_H

#ifdef EMBEDDED_LIBRARY
#define DISABLE_ALL_PSI
#endif /* EMBEDDED_LIBRARY */

#ifdef __cplusplus
extern "C" {
#endif

/**
  @file mysql/psi/psi_base.h
  Performance schema instrumentation interface.

  @defgroup Instrumentation_interface Instrumentation Interface
  @ingroup Performance_schema
  @{
*/

#define PSI_INSTRUMENT_ME 0
#define PSI_INSTRUMENT_MEM ((PSI_memory_key)0)

#define PSI_NOT_INSTRUMENTED 0

/**
  Global flag.
  This flag indicate that an instrumentation point is a global variable,
  or a singleton.
*/
#define PSI_FLAG_GLOBAL (1 << 0)

/**
  Mutable flag.
  This flag indicate that an instrumentation point is a general placeholder,
  that can mutate into a more specific instrumentation point.
*/
#define PSI_FLAG_MUTABLE (1 << 1)

#define PSI_FLAG_THREAD (1 << 2)

/**
  Stage progress flag.
  This flag apply to the stage instruments only.
  It indicates the instrumentation provides progress data.
*/
#define PSI_FLAG_STAGE_PROGRESS (1 << 3)

/**
  Shared Exclusive flag.
  Indicates that rwlock support the shared exclusive state.
*/
#define PSI_RWLOCK_FLAG_SX (1 << 4)

/**
  Transferable flag.
  This flag indicate that an instrumented object can
  be created by a thread and destroyed by another thread.
*/
#define PSI_FLAG_TRANSFER (1 << 5)

/**
  Volatility flag.
  This flag indicate that an instrumented object
  has a volatility (life cycle) comparable
  to the volatility of a session.
*/
#define PSI_FLAG_VOLATILITY_SESSION (1 << 6)

/**
  System thread flag.
  Indicates that the instrumented object exists on a system thread.
*/
#define PSI_FLAG_THREAD_SYSTEM (1 << 9)

#ifdef HAVE_PSI_INTERFACE

/**
  @def PSI_VERSION_1
  Performance Schema Interface number for version 1.
  This version is supported.
*/
#define PSI_VERSION_1 1

/**
  @def PSI_VERSION_2
  Performance Schema Interface number for version 2.
  This version is not implemented, it's a placeholder.
*/
#define PSI_VERSION_2 2

/**
  @def PSI_CURRENT_VERSION
  Performance Schema Interface number for the most recent version.
  The most current version is @c PSI_VERSION_1
*/
#define PSI_CURRENT_VERSION 1

/**
  @def USE_PSI_1
  Define USE_PSI_1 to use the interface version 1.
*/

/**
  @def USE_PSI_2
  Define USE_PSI_2 to use the interface version 2.
*/

/**
  @def HAVE_PSI_1
  Define HAVE_PSI_1 if the interface version 1 needs to be compiled in.
*/

/**
  @def HAVE_PSI_2
  Define HAVE_PSI_2 if the interface version 2 needs to be compiled in.
*/

#ifndef USE_PSI_2
#ifndef USE_PSI_1
#define USE_PSI_1
#endif
#endif

#ifdef USE_PSI_1
#define HAVE_PSI_1
#endif

#ifdef USE_PSI_2
#define HAVE_PSI_2
#endif

/*
  Allow to override PSI_XXX_CALL at compile time
  with more efficient implementations, if available.
  If nothing better is available,
  make a dynamic call using the PSI_server function pointer.
*/

#define PSI_DYNAMIC_CALL(M) PSI_server->M

#endif /* HAVE_PSI_INTERFACE */

/** @} */

/**
  Instrumented memory key.
  To instrument memory, a memory key must be obtained using @c register_memory.
  Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_memory_key;

#ifdef __cplusplus
}
#endif

#endif /* MYSQL_PSI_BASE_H */

server/mysql/psi/mysql_table.h000064400000013061150400263620012476 0ustar00/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 2019, MariaDB Corporation.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_TABLE_H
#define MYSQL_TABLE_H

/**
  @file mysql/psi/mysql_table.h
  Instrumentation helpers for table io.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_TABLE_CALL
#define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Table_instrumentation Table Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

#ifdef HAVE_PSI_TABLE_INTERFACE
#define MYSQL_UNBIND_TABLE(handler) (handler)->unbind_psi()

#define PSI_CALL_unbind_table           PSI_TABLE_CALL(unbind_table)
#define PSI_CALL_rebind_table           PSI_TABLE_CALL(rebind_table)
#define PSI_CALL_open_table             PSI_TABLE_CALL(open_table)
#define PSI_CALL_close_table            PSI_TABLE_CALL(close_table)
#define PSI_CALL_get_table_share        PSI_TABLE_CALL(get_table_share)
#define PSI_CALL_release_table_share    PSI_TABLE_CALL(release_table_share)
#define PSI_CALL_drop_table_share       PSI_TABLE_CALL(drop_table_share)
#else
#define MYSQL_UNBIND_TABLE(handler)                     do { } while(0)

#define PSI_CALL_unbind_table(A1)                       do { } while(0)
#define PSI_CALL_rebind_table(A1,A2,A3)                 NULL
#define PSI_CALL_close_table(A1,A2)                     do { } while(0)
#define PSI_CALL_open_table(A1,A2)                      NULL
#define PSI_CALL_get_table_share(A1,A2)                 NULL
#define PSI_CALL_release_table_share(A1)                do { } while(0)
#define PSI_CALL_drop_table_share(A1,A2,A3,A4,A5)       do { } while(0)
#endif

/**
  @def MYSQL_TABLE_WAIT_VARIABLES
  Instrumentation helper for table waits.
  This instrumentation declares local variables.
  Do not use a ';' after this macro
  @param LOCKER the locker
  @param STATE the locker state
  @sa MYSQL_START_TABLE_IO_WAIT.
  @sa MYSQL_END_TABLE_IO_WAIT.
  @sa MYSQL_START_TABLE_LOCK_WAIT.
  @sa MYSQL_END_TABLE_LOCK_WAIT.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
  #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) \
    struct PSI_table_locker* LOCKER; \
    PSI_table_locker_state STATE;
#else
  #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE)
#endif

/**
  @def MYSQL_START_TABLE_LOCK_WAIT
  Instrumentation helper for table lock waits.
  This instrumentation marks the start of a wait event.
  @param LOCKER the locker
  @param STATE the locker state
  @param PSI the instrumented table
  @param OP the table operation to be performed
  @param FLAGS per table operation flags.
  @sa MYSQL_END_TABLE_LOCK_WAIT.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
  #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \
    LOCKER= inline_mysql_start_table_lock_wait(STATE, PSI, \
                                               OP, FLAGS, __FILE__, __LINE__)
#else
  #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \
    do {} while (0)
#endif

/**
  @def MYSQL_END_TABLE_LOCK_WAIT
  Instrumentation helper for table lock waits.
  This instrumentation marks the end of a wait event.
  @param LOCKER the locker
  @sa MYSQL_START_TABLE_LOCK_WAIT.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
  #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \
    inline_mysql_end_table_lock_wait(LOCKER)
#else
  #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TABLE_INTERFACE
  #define MYSQL_UNLOCK_TABLE(T) \
    inline_mysql_unlock_table(T)
#else
  #define MYSQL_UNLOCK_TABLE(T) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TABLE_INTERFACE
/**
  Instrumentation calls for MYSQL_START_TABLE_LOCK_WAIT.
  @sa MYSQL_END_TABLE_LOCK_WAIT.
*/
static inline struct PSI_table_locker *
inline_mysql_start_table_lock_wait(PSI_table_locker_state *state,
                                   struct PSI_table *psi,
                                   enum PSI_table_lock_operation op,
                                   ulong flags, const char *src_file, uint src_line)
{
  if (psi_likely(psi != NULL))
  {
    struct PSI_table_locker *locker;
    locker= PSI_TABLE_CALL(start_table_lock_wait)
      (state, psi, op, flags, src_file, src_line);
    return locker;
  }
  return NULL;
}

/**
  Instrumentation calls for MYSQL_END_TABLE_LOCK_WAIT.
  @sa MYSQL_START_TABLE_LOCK_WAIT.
*/
static inline void
inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker)
{
  if (psi_likely(locker != NULL))
    PSI_TABLE_CALL(end_table_lock_wait)(locker);
}

static inline void
inline_mysql_unlock_table(struct PSI_table *table)
{
  if (table != NULL)
    PSI_TABLE_CALL(unlock_table)(table);
}
#endif

/** @} (end of group Table_instrumentation) */

#endif

server/mysql/psi/mysql_statement.h000064400000015706150400263620013423 0ustar00/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
   Copyright (c) 2017, 2019, MariaDB Corporation.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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 */

#ifndef MYSQL_STATEMENT_H
#define MYSQL_STATEMENT_H

/**
  @file mysql/psi/mysql_statement.h
  Instrumentation helpers for statements.
*/

#include "mysql/psi/psi.h"

class Diagnostics_area;
typedef const struct charset_info_st CHARSET_INFO;

#ifndef PSI_STATEMENT_CALL
#define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

#ifndef PSI_DIGEST_CALL
#define PSI_DIGEST_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Statement_instrumentation Statement Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def mysql_statement_register(P1, P2, P3)
  Statement registration.
*/
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define mysql_statement_register(P1, P2, P3) \
  inline_mysql_statement_register(P1, P2, P3)
#else
#define mysql_statement_register(P1, P2, P3) \
  do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
  #define MYSQL_DIGEST_START(LOCKER) \
    inline_mysql_digest_start(LOCKER)
#else
  #define MYSQL_DIGEST_START(LOCKER) \
    NULL
#endif

#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
  #define MYSQL_DIGEST_END(LOCKER, DIGEST) \
    inline_mysql_digest_end(LOCKER, DIGEST)
#else
  #define MYSQL_DIGEST_END(LOCKER, DIGEST) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \
    inline_mysql_start_statement(STATE, K, DB, DB_LEN, CS, SPS, __FILE__, __LINE__)
#else
  #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \
    NULL
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_REFINE_STATEMENT(LOCKER, K) \
    inline_mysql_refine_statement(LOCKER, K)
#else
  #define MYSQL_REFINE_STATEMENT(LOCKER, K) \
    NULL
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2) \
    inline_mysql_set_statement_text(LOCKER, P1, P2)
#else
  #define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_SET_STATEMENT_LOCK_TIME(LOCKER, P1) \
    inline_mysql_set_statement_lock_time(LOCKER, P1)
#else
  #define MYSQL_SET_STATEMENT_LOCK_TIME(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_SET_STATEMENT_ROWS_SENT(LOCKER, P1) \
    inline_mysql_set_statement_rows_sent(LOCKER, P1)
#else
  #define MYSQL_SET_STATEMENT_ROWS_SENT(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_SET_STATEMENT_ROWS_EXAMINED(LOCKER, P1) \
    inline_mysql_set_statement_rows_examined(LOCKER, P1)
#else
  #define MYSQL_SET_STATEMENT_ROWS_EXAMINED(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
  #define MYSQL_END_STATEMENT(LOCKER, DA) \
    inline_mysql_end_statement(LOCKER, DA)
#else
  #define MYSQL_END_STATEMENT(LOCKER, DA) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_STATEMENT_INTERFACE
static inline void inline_mysql_statement_register(
  const char *category, PSI_statement_info *info, int count)
{
  PSI_STATEMENT_CALL(register_statement)(category, info, count);
}

#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
static inline struct PSI_digest_locker *
inline_mysql_digest_start(PSI_statement_locker *locker)
{
  PSI_digest_locker* digest_locker= NULL;

  if (psi_likely(locker != NULL))
    digest_locker= PSI_DIGEST_CALL(digest_start)(locker);
  return digest_locker;
}
#endif

#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
static inline void
inline_mysql_digest_end(PSI_digest_locker *locker, const sql_digest_storage *digest)
{
  if (psi_likely(locker != NULL))
    PSI_DIGEST_CALL(digest_end)(locker, digest);
}
#endif

static inline struct PSI_statement_locker *
inline_mysql_start_statement(PSI_statement_locker_state *state,
                             PSI_statement_key key,
                             const char *db, size_t db_len,
                             CHARSET_INFO *charset,
                             PSI_sp_share *sp_share,
                             const char *src_file, uint src_line)
{
  PSI_statement_locker *locker;
  locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset,
                                                          sp_share);
  if (psi_likely(locker != NULL))
    PSI_STATEMENT_CALL(start_statement)(locker, db, (uint)db_len, src_file, src_line);
  return locker;
}

static inline struct PSI_statement_locker *
inline_mysql_refine_statement(PSI_statement_locker *locker,
                              PSI_statement_key key)
{
  if (psi_likely(locker != NULL))
  {
    locker= PSI_STATEMENT_CALL(refine_statement)(locker, key);
  }
  return locker;
}

static inline void
inline_mysql_set_statement_text(PSI_statement_locker *locker,
                                const char *text, uint text_len)
{
  if (psi_likely(locker != NULL))
  {
    PSI_STATEMENT_CALL(set_statement_text)(locker, text, text_len);
  }
}

static inline void
inline_mysql_set_statement_lock_time(PSI_statement_locker *locker,
                                     ulonglong count)
{
  if (psi_likely(locker != NULL))
  {
    PSI_STATEMENT_CALL(set_statement_lock_time)(locker, count);
  }
}

static inline void
inline_mysql_set_statement_rows_sent(PSI_statement_locker *locker,
                                     ulonglong count)
{
  if (psi_likely(locker != NULL))
  {
    PSI_STATEMENT_CALL(set_statement_rows_sent)(locker, count);
  }
}

static inline void
inline_mysql_set_statement_rows_examined(PSI_statement_locker *locker,
                                         ulonglong count)
{
  if (psi_likely(locker != NULL))
  {
    PSI_STATEMENT_CALL(set_statement_rows_examined)(locker, count);
  }
}

static inline void
inline_mysql_end_statement(struct PSI_statement_locker *locker,
                           Diagnostics_area *stmt_da)
{
  PSI_STAGE_CALL(end_stage)();
  if (psi_likely(locker != NULL))
    PSI_STATEMENT_CALL(end_statement)(locker, stmt_da);
}
#endif

/** @} (end of group Statement_instrumentation) */

#endif

server/mysql/psi/mysql_mdl.h000064400000010624150400263620012165 0ustar00/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef MYSQL_MDL_H
#define MYSQL_MDL_H

/**
  @file mysql/psi/mysql_mdl.h
  Instrumentation helpers for metadata locks.
*/

#include "mysql/psi/psi.h"

#ifdef HAVE_PSI_METADATA_INTERFACE

#ifndef PSI_METADATA_CALL
#define PSI_METADATA_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

#define PSI_CALL_start_metadata_wait(A,B,C,D) PSI_METADATA_CALL(start_metadata_wait)(A,B,C,D)
#define PSI_CALL_end_metadata_wait(A,B) PSI_METADATA_CALL(end_metadata_wait)(A,B)
#define PSI_CALL_create_metadata_lock(A,B,C,D,E,F,G) PSI_METADATA_CALL(create_metadata_lock)(A,B,C,D,E,F,G)
#define PSI_CALL_set_metadata_lock_status(A,B) PSI_METADATA_CALL(set_metadata_lock_status)(A,B)
#define PSI_CALL_destroy_metadata_lock(A) PSI_METADATA_CALL(destroy_metadata_lock)(A)
#else
#define PSI_CALL_start_metadata_wait(A,B,C,D) 0
#define PSI_CALL_end_metadata_wait(A,B) do { } while(0)
#define PSI_CALL_create_metadata_lock(A,B,C,D,E,F,G) 0
#define PSI_CALL_set_metadata_lock_status(A,B) do {} while(0)
#define PSI_CALL_destroy_metadata_lock(A) do {} while(0)
#endif

/**
  @defgroup Thread_instrumentation Metadata Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def mysql_mdl_create(K, M, A)
  Instrumented metadata lock creation.
  @param I Metadata lock identity
  @param K Metadata key
  @param T Metadata lock type
  @param D Metadata lock duration
  @param S Metadata lock status
  @param F request source file
  @param L request source line
*/

#ifdef HAVE_PSI_METADATA_INTERFACE
  #define mysql_mdl_create(I, K, T, D, S, F, L) \
    inline_mysql_mdl_create(I, K, T, D, S, F, L)
#else
  #define mysql_mdl_create(I, K, T, D, S, F, L) NULL
#endif

#ifdef HAVE_PSI_METADATA_INTERFACE
  #define mysql_mdl_set_status(L, S) \
    inline_mysql_mdl_set_status(L, S)
#else
  #define mysql_mdl_set_status(L, S) \
    do {} while (0)
#endif


/**
  @def mysql_mdl_destroy(M)
  Instrumented metadata lock destruction.
  @param M Metadata lock
*/
#ifdef HAVE_PSI_METADATA_INTERFACE
  #define mysql_mdl_destroy(M) \
    inline_mysql_mdl_destroy(M, __FILE__, __LINE__)
#else
  #define mysql_mdl_destroy(M) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_METADATA_INTERFACE

static inline PSI_metadata_lock *
inline_mysql_mdl_create(void *identity,
                        const MDL_key *mdl_key,
                        enum_mdl_type mdl_type,
                        enum_mdl_duration mdl_duration,
                        MDL_ticket::enum_psi_status mdl_status,
                        const char *src_file, uint src_line)
{
  PSI_metadata_lock *result;

  /* static_cast: Fit a round C++ enum peg into a square C int hole ... */
  result= PSI_METADATA_CALL(create_metadata_lock)
    (identity,
     mdl_key,
     static_cast<opaque_mdl_type> (mdl_type),
     static_cast<opaque_mdl_duration> (mdl_duration),
     static_cast<opaque_mdl_status> (mdl_status),
     src_file, src_line);

  return result;
}

static inline void inline_mysql_mdl_set_status(
  PSI_metadata_lock *psi,
  MDL_ticket::enum_psi_status mdl_status)
{
  if (psi != NULL)
    PSI_METADATA_CALL(set_metadata_lock_status)(psi, mdl_status);
}

static inline void inline_mysql_mdl_destroy(
  PSI_metadata_lock *psi,
  const char *src_file, uint src_line)
{
  if (psi != NULL)
    PSI_METADATA_CALL(destroy_metadata_lock)(psi);
}
#endif /* HAVE_PSI_METADATA_INTERFACE */

/** @} (end of group Metadata_instrumentation) */

#endif

server/mysql/psi/psi_abi_v0.h000064400000002630150400263620012175 0ustar00/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @file mysql/psi/psi_abi_v0.h
  ABI check for mysql/psi/psi.h, when compiling without instrumentation.
  This file is only used to automate detection of changes between versions.
  Do not include this file, include mysql/psi/psi.h instead.
*/
#define MY_GLOBAL_INCLUDED
#include "mysql/psi/psi.h"

server/mysql/psi/mysql_memory.h000064400000005067150400263620012726 0ustar00/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef MYSQL_MEMORY_H
#define MYSQL_MEMORY_H

/**
  @file mysql/psi/mysql_memory.h
  Instrumentation helpers for memory allocation.
*/

#include "mysql/psi/psi.h"

#ifdef HAVE_PSI_MEMORY_INTERFACE
#define PSI_CALL_memory_alloc(A1,A2,A3) PSI_MEMORY_CALL(memory_alloc)(A1,A2,A3)
#define PSI_CALL_memory_free(A1,A2,A3) PSI_MEMORY_CALL(memory_free)(A1,A2,A3)
#define PSI_CALL_memory_realloc(A1,A2,A3,A4) PSI_MEMORY_CALL(memory_realloc)(A1,A2,A3,A4)
#define PSI_CALL_register_memory(A1,A2,A3) PSI_MEMORY_CALL(register_memory)(A1,A2,A3)
#else
#define PSI_CALL_memory_alloc(A1,A2,A3) 0
#define PSI_CALL_memory_free(A1,A2,A3) do { } while(0)
#define PSI_CALL_memory_realloc(A1,A2,A3,A4) 0
#define PSI_CALL_register_memory(A1,A2,A3) do { } while(0)
#endif

#ifndef PSI_MEMORY_CALL
#define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Memory_instrumentation Memory Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def mysql_memory_register(P1, P2, P3)
  Memory registration.
*/
#define mysql_memory_register(P1, P2, P3) \
  inline_mysql_memory_register(P1, P2, P3)

static inline void inline_mysql_memory_register(
#ifdef HAVE_PSI_MEMORY_INTERFACE
  const char *category,
  PSI_memory_info *info,
  int count)
#else
  const char *category __attribute__((unused)),
  void *info __attribute__((unused)),
  int count __attribute__((unused)))
#endif
{
  PSI_CALL_register_memory(category, info, count);
}

/** @} (end of group Memory_instrumentation) */

#endif

server/mysql/psi/mysql_socket.h000064400000106615150400263620012707 0ustar00/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
   Copyright (c) 2017, MariaDB Corporation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.

This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation.  The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.

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, version 2.0, 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
*/

#ifndef MYSQL_SOCKET_H
#define MYSQL_SOCKET_H

/* For MY_STAT */
#include <my_dir.h>
/* For my_chsize */
#include <my_sys.h>
/* For socket api */
#ifdef _WIN32
  #include <ws2def.h>
  #include <winsock2.h>
  #include <MSWSock.h>
  #define SOCKBUF_T char
#else
  #include <netinet/in.h>
  #define SOCKBUF_T void
#endif
/**
  @file mysql/psi/mysql_socket.h
[...]
*/

#include "mysql/psi/psi.h"

#ifndef PSI_SOCKET_CALL
#define PSI_SOCKET_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Socket_instrumentation Socket Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def mysql_socket_register(P1, P2, P3)
  Socket registration.
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_register(P1, P2, P3) \
    inline_mysql_socket_register(P1, P2, P3)
#else
  #define mysql_socket_register(P1, P2, P3) \
    do {} while (0)
#endif

/** An instrumented socket. */
struct st_mysql_socket
{
  /** The real socket descriptor. */
  my_socket fd;

  /** Is this a Unix-domain socket? */
  char is_unix_domain_socket;

  /** Is this a socket opened for the extra port? */
  char is_extra_port;

  /** Address family of the socket. (See sa_family from struct sockaddr). */
  unsigned short address_family;

  /**
    The instrumentation hook.
    Note that this hook is not conditionally defined,
    for binary compatibility of the @c MYSQL_SOCKET interface.
  */
  struct PSI_socket *m_psi;
};

/**
  An instrumented socket.
  @c MYSQL_SOCKET is a replacement for @c my_socket.
*/
typedef struct st_mysql_socket MYSQL_SOCKET;


/**
  @def MYSQL_INVALID_SOCKET
  MYSQL_SOCKET initial value.
*/
//MYSQL_SOCKET MYSQL_INVALID_SOCKET= {INVALID_SOCKET, NULL};
#define MYSQL_INVALID_SOCKET mysql_socket_invalid()

/**
  MYSQL_SOCKET helper. Initialize instrumented socket.
  @sa mysql_socket_getfd
  @sa mysql_socket_setfd
*/
static inline MYSQL_SOCKET
mysql_socket_invalid()
{
  MYSQL_SOCKET mysql_socket= {INVALID_SOCKET, 0, 0, 0, NULL};
  return mysql_socket;
}

/**
  Set socket descriptor and address.
  @param socket nstrumented socket
  @param addr unformatted socket address
  @param addr_len length of socket address
*/

static inline void
mysql_socket_set_address(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  MYSQL_SOCKET socket,
  const struct sockaddr *addr,
  socklen_t addr_len
#else
  MYSQL_SOCKET socket __attribute__ ((unused)),
  const struct sockaddr *addr __attribute__ ((unused)),
  socklen_t addr_len __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (socket.m_psi != NULL)
    PSI_SOCKET_CALL(set_socket_info)(socket.m_psi, NULL, addr, addr_len);
#endif
}

/**
  Set socket descriptor and address.
  @param socket instrumented socket
*/
static inline void
mysql_socket_set_thread_owner(
#ifdef HAVE_PSI_SOCKET_INTERFACE
MYSQL_SOCKET socket
#else
MYSQL_SOCKET socket __attribute__ ((unused))
#endif
)
{
#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (socket.m_psi != NULL)
    PSI_SOCKET_CALL(set_socket_thread_owner)(socket.m_psi);
#endif
}

/**
  MYSQL_SOCKET helper. Get socket descriptor.
  @param mysql_socket Instrumented socket
  @sa mysql_socket_getfd
*/
static inline my_socket
mysql_socket_getfd(MYSQL_SOCKET mysql_socket)
{
  return mysql_socket.fd;
}

/**
  MYSQL_SOCKET helper. Set socket descriptor.
  @param mysql_socket Instrumented socket
  @param fd Socket descriptor
  @sa mysql_socket_setfd
*/
static inline void
mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd)
{
  if (likely(mysql_socket != NULL))
    mysql_socket->fd= fd;
}

/**
  @def MYSQL_SOCKET_WAIT_VARIABLES
  Instrumentation helper for socket waits.
  This instrumentation declares local variables.
  Do not use a ';' after this macro
  @param LOCKER locker
  @param STATE locker state
  @sa MYSQL_START_SOCKET_WAIT.
  @sa MYSQL_END_SOCKET_WAIT.
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define MYSQL_SOCKET_WAIT_VARIABLES(LOCKER, STATE) \
    struct PSI_socket_locker* LOCKER; \
    PSI_socket_locker_state STATE;
#else
  #define MYSQL_SOCKET_WAIT_VARIABLES(LOCKER, STATE)
#endif

/**
  @def MYSQL_START_SOCKET_WAIT
  Instrumentation helper for socket waits.
  This instrumentation marks the start of a wait event.
  @param LOCKER locker
  @param STATE locker state
  @param SOCKET instrumented socket
  @param OP The socket operation to be performed
  @param COUNT bytes to be written/read
  @sa MYSQL_END_SOCKET_WAIT.
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define MYSQL_START_SOCKET_WAIT(LOCKER, STATE, SOCKET, OP, COUNT) \
    LOCKER= inline_mysql_start_socket_wait(STATE, SOCKET, OP, COUNT,\
                                           __FILE__, __LINE__)
#else
  #define MYSQL_START_SOCKET_WAIT(LOCKER, STATE, SOCKET, OP, COUNT) \
    do {} while (0)
#endif

/**
  @def MYSQL_END_SOCKET_WAIT
  Instrumentation helper for socket waits.
  This instrumentation marks the end of a wait event.
  @param LOCKER locker
  @param COUNT actual bytes written/read, or -1
  @sa MYSQL_START_SOCKET_WAIT.
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define MYSQL_END_SOCKET_WAIT(LOCKER, COUNT) \
    inline_mysql_end_socket_wait(LOCKER, COUNT)
#else
  #define MYSQL_END_SOCKET_WAIT(LOCKER, COUNT) \
    do {} while (0)
#endif

/**
  @def MYSQL_SOCKET_SET_STATE
  Set the state (IDLE, ACTIVE) of an instrumented socket.
  @param SOCKET the instrumented socket
  @param STATE the new state
  @sa PSI_socket_state
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
    inline_mysql_socket_set_state(SOCKET, STATE)
#else
  #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_SOCKET_INTERFACE
/**
  Instrumentation calls for MYSQL_START_SOCKET_WAIT.
  @sa MYSQL_START_SOCKET_WAIT.
*/
static inline struct PSI_socket_locker*
inline_mysql_start_socket_wait(PSI_socket_locker_state *state,
                               MYSQL_SOCKET mysql_socket,
                               enum PSI_socket_operation op,
                               size_t byte_count,
                               const char *src_file, uint src_line)
{
  struct PSI_socket_locker *locker;
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (state, mysql_socket.m_psi, op, byte_count, src_file, src_line);
  }
  else
    locker= NULL;
  return locker;
}

/**
  Instrumentation calls for MYSQL_END_SOCKET_WAIT.
  @sa MYSQL_END_SOCKET_WAIT.
*/
static inline void
inline_mysql_end_socket_wait(struct PSI_socket_locker *locker, size_t byte_count)
{
  if (psi_likely(locker != NULL))
    PSI_SOCKET_CALL(end_socket_wait)(locker, byte_count);
}

/**
  Set the state (IDLE, ACTIVE) of an instrumented socket.
  @param socket the instrumented socket
  @param state the new state
  @sa PSI_socket_state
*/
static inline void
inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state)
{
  if (socket.m_psi != NULL)
    PSI_SOCKET_CALL(set_socket_state)(socket.m_psi, state);
}
#endif /* HAVE_PSI_SOCKET_INTERFACE */

/**
  @def mysql_socket_fd(K, F)
  Create a socket.
  @c mysql_socket_fd is a replacement for @c socket.
  @param K PSI_socket_key for this instrumented socket
  @param F File descriptor
*/

#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_fd(K, F) \
    inline_mysql_socket_fd(K, F)
#else
  #define mysql_socket_fd(K, F) \
    inline_mysql_socket_fd(F)
#endif

/**
  @def mysql_socket_socket(K, D, T, P)
  Create a socket.
  @c mysql_socket_socket is a replacement for @c socket.
  @param K PSI_socket_key for this instrumented socket
  @param D Socket domain
  @param T Protocol type
  @param P Transport protocol
*/

#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_socket(K, D, T, P) \
    inline_mysql_socket_socket(K, D, T, P)
#else
  #define mysql_socket_socket(K, D, T, P) \
    inline_mysql_socket_socket(D, T, P)
#endif

/**
  @def mysql_socket_bind(FD, AP, L)
  Bind a socket to a local port number and IP address
  @c mysql_socket_bind is a replacement for @c bind.
  @param FD Instrumented socket descriptor returned by socket()
  @param AP Pointer to local port number and IP address in sockaddr structure
  @param L  Length of sockaddr structure
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_bind(FD, AP, L) \
    inline_mysql_socket_bind(__FILE__, __LINE__, FD, AP, L)
#else
  #define mysql_socket_bind(FD, AP, L) \
    inline_mysql_socket_bind(FD, AP, L)
#endif

/**
  @def mysql_socket_getsockname(FD, AP, LP)
  Return port number and IP address of the local host
  @c mysql_socket_getsockname is a replacement for @c getsockname.
  @param FD Instrumented socket descriptor returned by socket()
  @param AP  Pointer to returned address of local host in @c sockaddr structure
  @param LP  Pointer to length of @c sockaddr structure
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_getsockname(FD, AP, LP) \
    inline_mysql_socket_getsockname(__FILE__, __LINE__, FD, AP, LP)
#else
  #define mysql_socket_getsockname(FD, AP, LP) \
    inline_mysql_socket_getsockname(FD, AP, LP)
#endif

/**
  @def mysql_socket_connect(FD, AP, L)
  Establish a connection to a remote host.
  @c mysql_socket_connect is a replacement for @c connect.
  @param FD Instrumented socket descriptor returned by socket()
  @param AP Pointer to target address in sockaddr structure
  @param L  Length of sockaddr structure
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_connect(FD, AP, L) \
    inline_mysql_socket_connect(__FILE__, __LINE__, FD, AP, L)
#else
  #define mysql_socket_connect(FD, AP, L) \
    inline_mysql_socket_connect(FD, AP, L)
#endif

/**
  @def mysql_socket_getpeername(FD, AP, LP)
  Get port number and IP address of remote host that a socket is connected to.
  @c mysql_socket_getpeername is a replacement for @c getpeername.
  @param FD Instrumented socket descriptor returned by socket() or accept()
  @param AP Pointer to returned address of remote host in sockaddr structure
  @param LP Pointer to length of sockaddr structure
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_getpeername(FD, AP, LP) \
    inline_mysql_socket_getpeername(__FILE__, __LINE__, FD, AP, LP)
#else
  #define mysql_socket_getpeername(FD, AP, LP) \
    inline_mysql_socket_getpeername(FD, AP, LP)
#endif

/**
  @def mysql_socket_send(FD, B, N, FL)
  Send data from the buffer, B, to a connected socket.
  @c mysql_socket_send is a replacement for @c send.
  @param FD Instrumented socket descriptor returned by socket() or accept()
  @param B  Buffer to send
  @param N  Number of bytes to send
  @param FL Control flags
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_send(FD, B, N, FL) \
    inline_mysql_socket_send(__FILE__, __LINE__, FD, B, N, FL)
#else
  #define mysql_socket_send(FD, B, N, FL) \
    inline_mysql_socket_send(FD, B, N, FL)
#endif

/**
  @def mysql_socket_recv(FD, B, N, FL)
  Receive data from a connected socket.
  @c mysql_socket_recv is a replacement for @c recv.
  @param FD Instrumented socket descriptor returned by socket() or accept()
  @param B  Buffer to receive to
  @param N  Maximum bytes to receive
  @param FL Control flags
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_recv(FD, B, N, FL) \
    inline_mysql_socket_recv(__FILE__, __LINE__, FD, B, N, FL)
#else
  #define mysql_socket_recv(FD, B, N, FL) \
    inline_mysql_socket_recv(FD, B, N, FL)
#endif

/**
  @def mysql_socket_sendto(FD, B, N, FL, AP, L)
  Send data to a socket at the specified address.
  @c mysql_socket_sendto is a replacement for @c sendto.
  @param FD Instrumented socket descriptor returned by socket()
  @param B  Buffer to send
  @param N  Number of bytes to send
  @param FL Control flags
  @param AP Pointer to destination sockaddr structure
  @param L  Size of sockaddr structure
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_sendto(FD, B, N, FL, AP, L) \
    inline_mysql_socket_sendto(__FILE__, __LINE__, FD, B, N, FL, AP, L)
#else
  #define mysql_socket_sendto(FD, B, N, FL, AP, L) \
    inline_mysql_socket_sendto(FD, B, N, FL, AP, L)
#endif

/**
  @def mysql_socket_recvfrom(FD, B, N, FL, AP, L)
  Receive data from a socket and return source address information
  @c mysql_socket_recvfrom is a replacement for @c recvfrom.
  @param FD Instrumented socket descriptor returned by socket()
  @param B  Buffer to receive to
  @param N  Maximum bytes to receive
  @param FL Control flags
  @param AP Pointer to source address in sockaddr_storage structure
  @param LP Size of sockaddr_storage structure
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \
    inline_mysql_socket_recvfrom(__FILE__, __LINE__, FD, B, N, FL, AP, LP)
#else
  #define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \
    inline_mysql_socket_recvfrom(FD, B, N, FL, AP, LP)
#endif

/**
  @def mysql_socket_getsockopt(FD, LV, ON, OP, OL)
  Get a socket option for the specified socket.
  @c mysql_socket_getsockopt is a replacement for @c getsockopt.
  @param FD Instrumented socket descriptor returned by socket()
  @param LV Protocol level
  @param ON Option to query
  @param OP Buffer which will contain the value for the requested option
  @param OL Pointer to length of OP
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_getsockopt(FD, LV, ON, OP, OL) \
    inline_mysql_socket_getsockopt(__FILE__, __LINE__, FD, LV, ON, OP, OL)
#else
  #define mysql_socket_getsockopt(FD, LV, ON, OP, OL) \
    inline_mysql_socket_getsockopt(FD, LV, ON, OP, OL)
#endif

/**
  @def mysql_socket_setsockopt(FD, LV, ON, OP, OL)
  Set a socket option for the specified socket.
  @c mysql_socket_setsockopt is a replacement for @c setsockopt.
  @param FD Instrumented socket descriptor returned by socket()
  @param LV Protocol level
  @param ON Option to modify
  @param OP Buffer containing the value for the specified option
  @param OL Pointer to length of OP
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_setsockopt(FD, LV, ON, OP, OL) \
    inline_mysql_socket_setsockopt(__FILE__, __LINE__, FD, LV, ON, OP, OL)
#else
  #define mysql_socket_setsockopt(FD, LV, ON, OP, OL) \
    inline_mysql_socket_setsockopt(FD, LV, ON, OP, OL)
#endif

/**
  @def mysql_sock_set_nonblocking
  Set socket to non-blocking.
  @param FD instrumented socket descriptor
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_sock_set_nonblocking(FD) \
    inline_mysql_sock_set_nonblocking(__FILE__, __LINE__, FD)
#else
  #define mysql_sock_set_nonblocking(FD) \
    inline_mysql_sock_set_nonblocking(FD)
#endif

/**
  @def mysql_socket_listen(FD, N)
  Set socket state to listen for an incoming connection.
  @c mysql_socket_listen is a replacement for @c listen.
  @param FD Instrumented socket descriptor, bound and connected
  @param N  Maximum number of pending connections allowed.
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_listen(FD, N) \
    inline_mysql_socket_listen(__FILE__, __LINE__, FD, N)
#else
  #define mysql_socket_listen(FD, N) \
    inline_mysql_socket_listen(FD, N)
#endif

/**
  @def mysql_socket_accept(K, FD, AP, LP)
  Accept a connection from any remote host; TCP only.
  @c mysql_socket_accept is a replacement for @c accept.
  @param K PSI_socket_key for this instrumented socket
  @param FD Instrumented socket descriptor, bound and placed in a listen state
  @param AP Pointer to sockaddr structure with returned IP address and port of connected host
  @param LP Pointer to length of valid information in AP
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_accept(K, FD, AP, LP) \
    inline_mysql_socket_accept(__FILE__, __LINE__, K, FD, AP, LP)
#else
  #define mysql_socket_accept(K, FD, AP, LP) \
    inline_mysql_socket_accept(FD, AP, LP)
#endif

/**
  @def mysql_socket_close(FD)
  Close a socket and sever any connections.
  @c mysql_socket_close is a replacement for @c close.
  @param FD Instrumented socket descriptor returned by socket() or accept()
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_close(FD) \
    inline_mysql_socket_close(__FILE__, __LINE__, FD)
#else
  #define mysql_socket_close(FD) \
    inline_mysql_socket_close(FD)
#endif

/**
  @def mysql_socket_shutdown(FD, H)
  Disable receives and/or sends on a socket.
  @c mysql_socket_shutdown is a replacement for @c shutdown.
  @param FD Instrumented socket descriptor returned by socket() or accept()
  @param H  Specifies which operations to shutdown
*/
#ifdef HAVE_PSI_SOCKET_INTERFACE
  #define mysql_socket_shutdown(FD, H) \
    inline_mysql_socket_shutdown(__FILE__, __LINE__, FD, H)
#else
  #define mysql_socket_shutdown(FD, H) \
    inline_mysql_socket_shutdown(FD, H)
#endif

#ifdef HAVE_PSI_SOCKET_INTERFACE
static inline void inline_mysql_socket_register(
  const char *category,
  PSI_socket_info *info,
  int count)
{
  PSI_SOCKET_CALL(register_socket)(category, info, count);
}
#endif

/** mysql_socket_fd */

static inline MYSQL_SOCKET
inline_mysql_socket_fd
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  PSI_socket_key key,
#endif
  int fd)
{
  MYSQL_SOCKET mysql_socket= MYSQL_INVALID_SOCKET;
  mysql_socket.fd= fd;

  DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET);
#ifdef HAVE_PSI_SOCKET_INTERFACE
  mysql_socket.m_psi= PSI_SOCKET_CALL(init_socket)
    (key, (const my_socket*)&mysql_socket.fd, NULL, 0);
#endif
  /**
    Currently systemd socket activation is the user of this
    function. Its API (man sd_listen_fds) says FD_CLOSE_EXEC
    is already called. If there becomes another user, we
    can call it again without detriment.

    If needed later:
    #if defined(HAVE_FCNTL) && defined(FD_CLOEXEC)
        (void) fcntl(mysql_socket.fd, F_SETFD, FD_CLOEXEC);
    #endif
  */

  return mysql_socket;
}

/** mysql_socket_socket */

static inline MYSQL_SOCKET
inline_mysql_socket_socket
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  PSI_socket_key key,
#endif
  int domain, int type, int protocol)
{
  MYSQL_SOCKET mysql_socket= MYSQL_INVALID_SOCKET;
  mysql_socket.fd= socket(domain, type | SOCK_CLOEXEC, protocol);

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (likely(mysql_socket.fd != INVALID_SOCKET))
  {
    mysql_socket.m_psi= PSI_SOCKET_CALL(init_socket)
      (key, (const my_socket*)&mysql_socket.fd, NULL, 0);
  }
#endif

  /* SOCK_CLOEXEC isn't always a number - can't preprocessor compare */
#if defined(HAVE_FCNTL) && defined(FD_CLOEXEC) && !defined(HAVE_SOCK_CLOEXEC)
  (void) fcntl(mysql_socket.fd, F_SETFD, FD_CLOEXEC);
#endif

  return mysql_socket;
}

/** mysql_socket_bind */

static inline int
inline_mysql_socket_bind
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, size_t len)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker_state state;
    PSI_socket_locker *locker;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= bind(mysql_socket.fd, addr, (int)len);

    /* Instrumentation end */
    if (result == 0)
      PSI_SOCKET_CALL(set_socket_info)(mysql_socket.m_psi, NULL, addr, (socklen_t)len);

    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= bind(mysql_socket.fd, addr, (int)len);
  return result;
}

/** mysql_socket_getsockname */

static inline int
inline_mysql_socket_getsockname
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, struct sockaddr *addr, socklen_t *len)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= getsockname(mysql_socket.fd, addr, len);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= getsockname(mysql_socket.fd, addr, len);

  return result;
}

/** mysql_socket_connect */

static inline int
inline_mysql_socket_connect
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, socklen_t len)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= connect(mysql_socket.fd, addr, len);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= connect(mysql_socket.fd, addr, len);

  return result;
}

/** mysql_socket_getpeername */

static inline int
inline_mysql_socket_getpeername
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, struct sockaddr *addr, socklen_t *len)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= getpeername(mysql_socket.fd, addr, len);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= getpeername(mysql_socket.fd, addr, len);

  return result;
}

/** mysql_socket_send */

static inline ssize_t
inline_mysql_socket_send
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags)
{
  ssize_t result;
  DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET);
#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_SEND, n, src_file, src_line);

    /* Instrumented code */
    result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags);

    /* Instrumentation end */
    if (locker != NULL)
    {
      size_t bytes_written= (result > 0) ? (size_t) result : 0;
      PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
    }

    return result;
  }
#endif

  /* Non instrumented code */
  result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags);

  return result;
}

/** mysql_socket_recv */

static inline ssize_t
inline_mysql_socket_recv
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket,  SOCKBUF_T *buf, size_t n, int flags)
{
  ssize_t result;
  DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET);
#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_RECV, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= recv(mysql_socket.fd, buf, IF_WIN((int),) n, flags);

    /* Instrumentation end */
    if (locker != NULL)
    {
      size_t bytes_read= (result > 0) ? (size_t) result : 0;
      PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
    }

    return result;
  }
#endif

  /* Non instrumented code */
  result= recv(mysql_socket.fd, buf, IF_WIN((int),) n, flags);

  return result;
}

/** mysql_socket_sendto */

static inline ssize_t
inline_mysql_socket_sendto
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags, const struct sockaddr *addr, socklen_t addr_len)
{
  ssize_t result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_SEND, n, src_file, src_line);

    /* Instrumented code */
    result= sendto(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);

    /* Instrumentation end */
    if (locker != NULL)
    {
      size_t bytes_written = (result > 0) ? (size_t) result : 0;
      PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
    }

    return result;
  }
#endif

  /* Non instrumented code */
  result= sendto(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);

  return result;
}

/** mysql_socket_recvfrom */

static inline ssize_t
inline_mysql_socket_recvfrom
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags,
 struct sockaddr *addr, socklen_t *addr_len)
{
  ssize_t result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_RECV, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= recvfrom(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);

    /* Instrumentation end */
    if (locker != NULL)
    {
      size_t bytes_read= (result > 0) ? (size_t) result : 0;
      PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
    }

    return result;
  }
#endif

  /* Non instrumented code */
  result= recvfrom(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);

  return result;
}

/** mysql_socket_getsockopt */

static inline int
inline_mysql_socket_getsockopt
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, int level, int optname, SOCKBUF_T *optval, socklen_t *optlen)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_OPT, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= getsockopt(mysql_socket.fd, level, optname, optval, optlen);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= getsockopt(mysql_socket.fd, level, optname, optval, optlen);

  return result;
}

/** mysql_socket_setsockopt */

static inline int
inline_mysql_socket_setsockopt
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, int level, int optname, const SOCKBUF_T *optval,
 socklen_t optlen)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_OPT, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= setsockopt(mysql_socket.fd, level, optname, optval, optlen);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= setsockopt(mysql_socket.fd, level, optname, optval, optlen);

  return result;
}

/** set_socket_nonblock */
static inline int
set_socket_nonblock(my_socket fd)
{
  int ret= 0;
#ifdef _WIN32
  {
    u_long nonblocking= 1;
    ret= ioctlsocket(fd, FIONBIO, &nonblocking);
  }
#else
  {
    int fd_flags;
    fd_flags= fcntl(fd, F_GETFL, 0);
    if (fd_flags < 0)
      return errno;
#if defined(O_NONBLOCK)
    fd_flags |= O_NONBLOCK;
#elif defined(O_NDELAY)
    fd_flags |= O_NDELAY;
#elif defined(O_FNDELAY)
    fd_flags |= O_FNDELAY;
#else
#error "No definition of non-blocking flag found."
#endif /* O_NONBLOCK */
    if (fcntl(fd, F_SETFL, fd_flags) == -1)
      ret= errno;
  }
#endif /* _WIN32 */
  return ret;
}

/** mysql_socket_set_nonblocking */

static inline int
inline_mysql_sock_set_nonblocking
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_SOCKET mysql_socket
)
{
  int result= 0;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (mysql_socket.m_psi)
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
        (&state, mysql_socket.m_psi, PSI_SOCKET_OPT,
         (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= set_socket_nonblock(mysql_socket.fd);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= set_socket_nonblock(mysql_socket.fd);

  return result;
}

/** mysql_socket_listen */

static inline int
inline_mysql_socket_listen
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
 MYSQL_SOCKET mysql_socket, int backlog)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= listen(mysql_socket.fd, backlog);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
  result= listen(mysql_socket.fd, backlog);

  return result;
}

/** mysql_socket_accept */

static inline MYSQL_SOCKET
inline_mysql_socket_accept
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line, PSI_socket_key key,
#endif
  MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
{
#ifdef FD_CLOEXEC
  int flags __attribute__ ((unused));
#endif

  MYSQL_SOCKET socket_accept;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (socket_listen.m_psi != NULL)
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, socket_listen.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);

    /* Instrumented code */
#ifdef HAVE_ACCEPT4
    socket_accept.fd= accept4(socket_listen.fd, addr, addr_len, SOCK_CLOEXEC);
#else
    socket_accept.fd= accept(socket_listen.fd, addr, addr_len);
#ifdef FD_CLOEXEC
    if (socket_accept.fd != INVALID_SOCKET)
    {
      flags= fcntl(socket_accept.fd, F_GETFD);
      if (flags != -1)
      {
        flags |= FD_CLOEXEC;
        fcntl(socket_accept.fd, F_SETFD, flags);
      }
    }
#endif
#endif

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
  }
  else
#endif
  {
    /* Non instrumented code */
#ifdef HAVE_ACCEPT4
    socket_accept.fd= accept4(socket_listen.fd, addr, addr_len, SOCK_CLOEXEC);
#else
    socket_accept.fd= accept(socket_listen.fd, addr, addr_len);
#ifdef FD_CLOEXEC
    if (socket_accept.fd != INVALID_SOCKET)
    {
      flags= fcntl(socket_accept.fd, F_GETFD);
      if (flags != -1)
      {
        flags |= FD_CLOEXEC;
        fcntl(socket_accept.fd, F_SETFD, flags);
      }
    }
#endif
#endif
  }

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (likely(socket_accept.fd != INVALID_SOCKET))
  {
    /* Initialize the instrument with the new socket descriptor and address */
    socket_accept.m_psi= PSI_SOCKET_CALL(init_socket)
      (key, (const my_socket*)&socket_accept.fd, addr, *addr_len);
  }
#endif

  return socket_accept;
}

/** mysql_socket_close */

static inline int
inline_mysql_socket_close
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_SOCKET mysql_socket)
{
  int result;

#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    /* Instrumentation start */
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_CLOSE, (size_t)0, src_file, src_line);

    /* Instrumented code */
    result= closesocket(mysql_socket.fd);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
    /* Remove the instrumentation for this socket. */
    if (mysql_socket.m_psi != NULL)
      PSI_SOCKET_CALL(destroy_socket)(mysql_socket.m_psi);

    return result;
  }
#endif

  /* Non instrumented code */
  result= closesocket(mysql_socket.fd);

  return result;
}

/** mysql_socket_shutdown */

static inline int
inline_mysql_socket_shutdown
(
#ifdef HAVE_PSI_SOCKET_INTERFACE
  const char *src_file, uint src_line,
#endif
  MYSQL_SOCKET mysql_socket, int how)
{
  int result;

#ifdef _WIN32
  static LPFN_DISCONNECTEX DisconnectEx = NULL;
  if (DisconnectEx == NULL)
  {
    DWORD dwBytesReturned;
    GUID guidDisconnectEx = WSAID_DISCONNECTEX;
    WSAIoctl(mysql_socket.fd, SIO_GET_EXTENSION_FUNCTION_POINTER,
             &guidDisconnectEx, sizeof(GUID),
             &DisconnectEx, sizeof(DisconnectEx), 
             &dwBytesReturned, NULL, NULL);
  }
#endif

/* Instrumentation start */
#ifdef HAVE_PSI_SOCKET_INTERFACE
  if (psi_likely(mysql_socket.m_psi != NULL))
  {
    PSI_socket_locker *locker;
    PSI_socket_locker_state state;
    locker= PSI_SOCKET_CALL(start_socket_wait)
      (&state, mysql_socket.m_psi, PSI_SOCKET_SHUTDOWN, (size_t)0, src_file, src_line);

    /* Instrumented code */
#ifdef _WIN32
    if (DisconnectEx)
      result= (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED) NULL,
                            (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1;
    else
#endif
      result= shutdown(mysql_socket.fd, how);

    /* Instrumentation end */
    if (locker != NULL)
      PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);

    return result;
  }
#endif

  /* Non instrumented code */
#ifdef _WIN32
  if (DisconnectEx)
    result= (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED) NULL,
                          (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1;
  else
#endif
    result= shutdown(mysql_socket.fd, how);

  return result;
}

/** @} (end of group Socket_instrumentation) */

#endif

server/mysql/psi/mysql_idle.h000064400000005743150400263620012334 0ustar00/* Copyright (c) 2011, 2023, Oracle and/or its affiliates
   Copyright (c) 2017, 2019, MariaDB Corporation.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_IDLE_H
#define MYSQL_IDLE_H

/**
  @file mysql/psi/mysql_idle.h
  Instrumentation helpers for idle waits.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_IDLE_CALL
#define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Idle_instrumentation Idle Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

/**
  @def MYSQL_START_IDLE_WAIT
  Instrumentation helper for table io_waits.
  This instrumentation marks the start of a wait event.
  @param LOCKER the locker
  @param STATE the locker state
  @sa MYSQL_END_IDLE_WAIT.
*/
#ifdef HAVE_PSI_IDLE_INTERFACE
  #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \
    LOCKER= inline_mysql_start_idle_wait(STATE, __FILE__, __LINE__)
#else
  #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \
    do {} while (0)
#endif

/**
  @def MYSQL_END_IDLE_WAIT
  Instrumentation helper for idle waits.
  This instrumentation marks the end of a wait event.
  @param LOCKER the locker
  @sa MYSQL_START_IDLE_WAIT.
*/
#ifdef HAVE_PSI_IDLE_INTERFACE
  #define MYSQL_END_IDLE_WAIT(LOCKER) \
    inline_mysql_end_idle_wait(LOCKER)
#else
  #define MYSQL_END_IDLE_WAIT(LOCKER) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_IDLE_INTERFACE
/**
  Instrumentation calls for MYSQL_START_IDLE_WAIT.
  @sa MYSQL_END_IDLE_WAIT.
*/
static inline struct PSI_idle_locker *
inline_mysql_start_idle_wait(PSI_idle_locker_state *state,
                             const char *src_file, uint src_line)
{
  struct PSI_idle_locker *locker;
  locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line);
  return locker;
}

/**
  Instrumentation calls for MYSQL_END_IDLE_WAIT.
  @sa MYSQL_START_IDLE_WAIT.
*/
static inline void
inline_mysql_end_idle_wait(struct PSI_idle_locker *locker)
{
  if (psi_likely(locker != NULL))
    PSI_IDLE_CALL(end_idle_wait)(locker);
}
#endif

/** @} (end of group Idle_instrumentation) */

#endif

server/mysql/psi/psi_abi_v1.h000064400000002667150400263620012210 0ustar00/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @file mysql/psi/psi_abi_v1.h
  ABI check for mysql/psi/psi.h, when using PSI_VERSION_1.
  This file is only used to automate detection of changes between versions.
  Do not include this file, include mysql/psi/psi.h instead.
*/
#define USE_PSI_1
#define HAVE_PSI_INTERFACE
#define MY_GLOBAL_INCLUDED
#include "mysql/psi/psi.h"

server/mysql/psi/mysql_ps.h000064400000007447150400263630012045 0ustar00/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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-1301  USA */

#ifndef MYSQL_PS_H
#define MYSQL_PS_H

/**
  @file mysql/psi/mysql_ps.h
  Instrumentation helpers for prepared statements.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_PS_CALL
#define PSI_PS_CALL(M) PSI_DYNAMIC_CALL(M)                               
#endif    

#ifdef HAVE_PSI_PS_INTERFACE
  #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH) \
    inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH)
  #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
    inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT)
  #define MYSQL_DESTROY_PS(PREPARED_STMT) \
    inline_mysql_destroy_prepared_stmt(PREPARED_STMT)
  #define MYSQL_REPREPARE_PS(PREPARED_STMT) \
    inline_mysql_reprepare_prepared_stmt(PREPARED_STMT)
  #define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \
    inline_mysql_set_prepared_stmt_text(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH)
#else
  #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH) \
    NULL
  #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
    do {} while (0)
  #define MYSQL_DESTROY_PS(PREPARED_STMT) \
    do {} while (0)
  #define MYSQL_REPREPARE_PS(PREPARED_STMT) \
    do {} while (0)
  #define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_PS_INTERFACE
static inline struct PSI_prepared_stmt*
inline_mysql_create_prepared_stmt(void *identity, uint stmt_id,
                                  PSI_statement_locker *locker,
                                  const char *stmt_name, size_t stmt_name_length)
{
  if (locker == NULL)
    return NULL;
  return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id, 
                                           locker,
                                           stmt_name, stmt_name_length);
}

static inline void 
inline_mysql_execute_prepared_stmt(PSI_statement_locker *locker,
                                   PSI_prepared_stmt* prepared_stmt)
{
  if (prepared_stmt != NULL && locker != NULL)
    PSI_PS_CALL(execute_prepared_stmt)(locker, prepared_stmt);
}

static inline void 
inline_mysql_destroy_prepared_stmt(PSI_prepared_stmt *prepared_stmt)
{
  if (prepared_stmt != NULL)
    PSI_PS_CALL(destroy_prepared_stmt)(prepared_stmt);
}

static inline void 
inline_mysql_reprepare_prepared_stmt(PSI_prepared_stmt *prepared_stmt)
{
  if (prepared_stmt != NULL)
    PSI_PS_CALL(reprepare_prepared_stmt)(prepared_stmt);
}

static inline void
inline_mysql_set_prepared_stmt_text(PSI_prepared_stmt *prepared_stmt,
                                    const char *text,
                                    uint text_len)
{
  if (prepared_stmt != NULL)
  {
    PSI_PS_CALL(set_prepared_stmt_text)(prepared_stmt, text, text_len);
  }
}
#endif

#endif
server/mysql/psi/mysql_transaction.h000064400000016100150400263630013732 0ustar00/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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-1301  USA */

#ifndef MYSQL_TRANSACTION_H
#define MYSQL_TRANSACTION_H

/**
  @file mysql/psi/mysql_transaction.h
  Instrumentation helpers for transactions.
*/

#include "mysql/psi/psi.h"

#ifndef PSI_TRANSACTION_CALL
#define PSI_TRANSACTION_CALL(M) PSI_DYNAMIC_CALL(M)
#endif

/**
  @defgroup Transaction_instrumentation Transaction Instrumentation
  @ingroup Instrumentation_interface
  @{
*/

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
    inline_mysql_start_transaction(STATE, XID, TRXID, ISO, RO, AC, __FILE__, __LINE__)
#else
  #define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
    0
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
    inline_mysql_set_transaction_gtid(LOCKER, P1, P2)
#else
  #define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
    inline_mysql_set_transaction_xid(LOCKER, P1, P2)
#else
  #define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
    inline_mysql_set_transaction_xa_state(LOCKER, P1)
#else
  #define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
    inline_mysql_set_transaction_trxid(LOCKER, P1)
#else
  #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
    inline_mysql_inc_transaction_savepoints(LOCKER, P1)
#else
  #define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
    inline_mysql_inc_transaction_rollback_to_savepoint(LOCKER, P1)
#else
  #define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
    inline_mysql_inc_transaction_release_savepoint(LOCKER, P1)
#else
  #define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
    do {} while (0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
    inline_mysql_rollback_transaction(LOCKER)
#else
  #define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
    do { } while(0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  #define MYSQL_COMMIT_TRANSACTION(LOCKER) \
    inline_mysql_commit_transaction(LOCKER)
#else
  #define MYSQL_COMMIT_TRANSACTION(LOCKER) \
    do { } while(0)
#endif

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
static inline struct PSI_transaction_locker *
inline_mysql_start_transaction(PSI_transaction_locker_state *state,
                               const void *xid,
                               ulonglong trxid,
                               int isolation_level,
                               my_bool read_only,
                               my_bool autocommit,
                               const char *src_file, int src_line)
{
  PSI_transaction_locker *locker;
  locker= PSI_TRANSACTION_CALL(get_thread_transaction_locker)(state,
                                                              xid, trxid,
                                                              isolation_level,
                                                              read_only,
                                                              autocommit);
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(start_transaction)(locker, src_file, src_line);
  return locker;
}

static inline void
inline_mysql_set_transaction_gtid(PSI_transaction_locker *locker,
                                  const void *sid,
                                  const void *gtid_spec)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(set_transaction_gtid)(locker, sid, gtid_spec);
}

static inline void
inline_mysql_set_transaction_xid(PSI_transaction_locker *locker,
                                 const void *xid,
                                 int xa_state)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(set_transaction_xid)(locker, xid, xa_state);
}

static inline void
inline_mysql_set_transaction_xa_state(PSI_transaction_locker *locker,
                                      int xa_state)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(set_transaction_xa_state)(locker, xa_state);
}

static inline void
inline_mysql_set_transaction_trxid(PSI_transaction_locker *locker,
                                   const ulonglong *trxid)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(set_transaction_trxid)(locker, trxid);
}

static inline void
inline_mysql_inc_transaction_savepoints(PSI_transaction_locker *locker,
                                        ulong count)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(inc_transaction_savepoints)(locker, count);
}

static inline void
inline_mysql_inc_transaction_rollback_to_savepoint(PSI_transaction_locker *locker,
                                                   ulong count)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(inc_transaction_rollback_to_savepoint)(locker, count);
}

static inline void
inline_mysql_inc_transaction_release_savepoint(PSI_transaction_locker *locker,
                                               ulong count)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(inc_transaction_release_savepoint)(locker, count);
}

static inline void
inline_mysql_rollback_transaction(struct PSI_transaction_locker *locker)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(end_transaction)(locker, false);
}

static inline void
inline_mysql_commit_transaction(struct PSI_transaction_locker *locker)
{
  if (likely(locker != NULL))
    PSI_TRANSACTION_CALL(end_transaction)(locker, true);
}
#endif

/** @} (end of group Transaction_instrumentation) */

#endif

server/mysql/psi/psi_abi_v2.h000064400000002667150400263630012212 0ustar00/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  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, version 2.0, 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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @file mysql/psi/psi_abi_v1.h
  ABI check for mysql/psi/psi.h, when using PSI_VERSION_2.
  This file is only used to automate detection of changes between versions.
  Do not include this file, include mysql/psi/psi.h instead.
*/
#define USE_PSI_2
#define HAVE_PSI_INTERFACE
#define MY_GLOBAL_INCLUDED
#include "mysql/psi/psi.h"

server/mysql/service_json.h000064400000010707150400263630012065 0ustar00/* Copyright (C) 2018 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 Street, Fifth Floor, Boston, MA 02111-1301 USA */

#ifndef MYSQL_SERVICE_JSON
#define MYSQL_SERVICE_JSON

/**
  @file
  json service

  Exports JSON parsing methods for plugins to use.

  Functions of the service:
    json_type - returns the type of the JSON argument,
       and the parsed value if it's scalar (not object or array)

    json_get_array_item - expects JSON array as an argument,
       and returns the type of the element at index `n_item`.
       Returns JSV_NOTHING type if the array is shorter
       than n_item and the actual length of the array in value_len.
       If successful, then `value` up till `value[value_len]` contains the array
       element at the desired index (n_item).

    json_get_object_key - expects JSON object as an argument,
       searches for a key in the object, return it's type and stores its value in `value`.
       JSV_NOTHING if no such key found, the number of keys
       in v_len.

    json_get_object_nkey - expects JSON object as an argument.
      finds n_key's key in the object, returns it's name, type and value.
      JSV_NOTHING if object has less keys than n_key.
*/


#ifdef __cplusplus
extern "C" {
#endif

enum json_types
{
  JSV_BAD_JSON=-1,
  JSV_NOTHING=0,
  JSV_OBJECT=1,
  JSV_ARRAY=2,
  JSV_STRING=3,
  JSV_NUMBER=4,
  JSV_TRUE=5,
  JSV_FALSE=6,
  JSV_NULL=7
};

extern struct json_service_st {
  enum json_types (*json_type)(const char *js, const char *js_end,
                               const char **value, int *value_len);
  enum json_types (*json_get_array_item)(const char *js, const char *js_end,
                                         int n_item,
                                         const char **value, int *value_len);
  enum json_types (*json_get_object_key)(const char *js, const char *js_end,
                                         const char *key,
                                         const char **value, int *value_len);
  enum json_types (*json_get_object_nkey)(const char *js,const char *js_end,
                             int nkey,
                             const char **keyname, const char **keyname_end,
                             const char **value, int *value_len);
  int (*json_escape_string)(const char *str,const char *str_end,
                          char *json, char *json_end);
  int (*json_unescape_json)(const char *json_str, const char *json_end,
                          char *res, char *res_end);
} *json_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define json_type json_service->json_type
#define json_get_array_item json_service->json_get_array_item
#define json_get_object_key json_service->json_get_object_key
#define json_get_object_nkey json_service->json_get_object_nkey
#define json_escape_string json_service->json_escape_string
#define json_unescape_json json_service->json_unescape_json

#else

enum json_types json_type(const char *js, const char *js_end,
                          const char **value, int *value_len);
enum json_types json_get_array_item(const char *js, const char *js_end,
                                    int n_item,
                                    const char **value, int *value_len);
enum json_types json_get_object_key(const char *js, const char *js_end,
                                    const char *key,
                                    const char **value, int *value_len);
enum json_types json_get_object_nkey(const char *js,const char *js_end, int nkey,
                       const char **keyname, const char **keyname_end,
                       const char **value, int *value_len);
int json_escape_string(const char *str,const char *str_end,
                       char *json, char *json_end);
int json_unescape_json(const char *json_str, const char *json_end,
                       char *res, char *res_end);

#endif /*MYSQL_DYNAMIC_PLUGIN*/


#ifdef __cplusplus
}
#endif

#endif /*MYSQL_SERVICE_JSON */


server/mysql/service_progress_report.h000064400000006434150400263630014355 0ustar00#ifndef MYSQL_SERVICE_PROGRESS_REPORT_INCLUDED
/* Copyright (C) 2011 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @file
  This service allows plugins to report progress of long running operations
  to the server. The progress report is visible in SHOW PROCESSLIST,
  INFORMATION_SCHEMA.PROCESSLIST, and is sent to the client
  if requested.

  The functions are documented at
  https://mariadb.com/kb/en/progress-reporting/#how-to-add-support-for-progress-reporting-to-a-storage-engine
*/

#ifdef __cplusplus
extern "C" {
#endif

#define thd_proc_info(thd, msg)  set_thd_proc_info(thd, msg, \
                                                   __func__, __FILE__, __LINE__)

extern struct progress_report_service_st {
  void (*thd_progress_init_func)(MYSQL_THD thd, unsigned int max_stage);
  void (*thd_progress_report_func)(MYSQL_THD thd,
                                   unsigned long long progress,
                                   unsigned long long max_progress);
  void (*thd_progress_next_stage_func)(MYSQL_THD thd);
  void (*thd_progress_end_func)(MYSQL_THD thd);
  const char *(*set_thd_proc_info_func)(MYSQL_THD, const char *info,
                                        const char *func,
                                        const char *file,
                                        unsigned int line);
} *progress_report_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define thd_progress_init(thd,max_stage) (progress_report_service->thd_progress_init_func((thd),(max_stage)))
#define thd_progress_report(thd, progress, max_progress) (progress_report_service->thd_progress_report_func((thd), (progress), (max_progress)))
#define thd_progress_next_stage(thd) (progress_report_service->thd_progress_next_stage_func(thd))
#define thd_progress_end(thd) (progress_report_service->thd_progress_end_func(thd))
#define set_thd_proc_info(thd,info,func,file,line) (progress_report_service->set_thd_proc_info_func((thd),(info),(func),(file),(line)))

#else

/**
   Report progress for long running operations 

   @param thd            User thread connection handle
   @param progress       Where we are now
   @param max_progress   Progress will continue up to this
*/
void thd_progress_init(MYSQL_THD thd, unsigned int max_stage);
void thd_progress_report(MYSQL_THD thd,
                         unsigned long long progress,
                         unsigned long long max_progress);
void thd_progress_next_stage(MYSQL_THD thd);
void thd_progress_end(MYSQL_THD thd);
const char *set_thd_proc_info(MYSQL_THD, const char * info, const char *func,
                              const char *file, unsigned int line);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_PROGRESS_REPORT_INCLUDED
#endif

server/mysql/service_debug_sync.h000064400000032414150400263630013235 0ustar00#ifndef MYSQL_SERVICE_DEBUG_SYNC_INCLUDED
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
   Copyright (c) 2012, Monty Program Ab

   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 */

/**
  @file
  == Debug Sync Facility ==

  The Debug Sync Facility allows placement of synchronization points in
  the server code by using the DEBUG_SYNC macro:

      open_tables(...)

      DEBUG_SYNC(thd, "after_open_tables");

      lock_tables(...)

  When activated, a sync point can

    - Emit a signal and/or
    - Wait for a signal

  Nomenclature:

    - signal:             A value of a global variable that persists
                          until overwritten by a new signal. The global
                          variable can also be seen as a "signal post"
                          or "flag mast". Then the signal is what is
                          attached to the "signal post" or "flag mast".

    - emit a signal:      Assign the value (the signal) to the global
                          variable ("set a flag") and broadcast a
                          global condition to wake those waiting for
                          a signal.

    - wait for a signal:  Loop over waiting for the global condition until
                          the global value matches the wait-for signal.

  By default, all sync points are inactive. They do nothing (except to
  burn a couple of CPU cycles for checking if they are active).

  A sync point becomes active when an action is requested for it.
  To do so, put a line like this in the test case file:

      SET DEBUG_SYNC= 'after_open_tables SIGNAL opened WAIT_FOR flushed';

  This activates the sync point 'after_open_tables'. It requests it to
  emit the signal 'opened' and wait for another thread to emit the signal
  'flushed' when the thread's execution runs through the sync point.

  For every sync point there can be one action per thread only. Every
  thread can request multiple actions, but only one per sync point. In
  other words, a thread can activate multiple sync points.

  Here is an example how to activate and use the sync points:

      --connection conn1
      SET DEBUG_SYNC= 'after_open_tables SIGNAL opened WAIT_FOR flushed';
      send INSERT INTO t1 VALUES(1);
          --connection conn2
          SET DEBUG_SYNC= 'now WAIT_FOR opened';
          SET DEBUG_SYNC= 'after_abort_locks SIGNAL flushed';
          FLUSH TABLE t1;

  When conn1 runs through the INSERT statement, it hits the sync point
  'after_open_tables'. It notices that it is active and executes its
  action. It emits the signal 'opened' and waits for another thread to
  emit the signal 'flushed'.

  conn2 waits immediately at the special sync point 'now' for another
  thread to emit the 'opened' signal.

  A signal remains in effect until it is overwritten. If conn1 signals
  'opened' before conn2 reaches 'now', conn2 will still find the 'opened'
  signal. It does not wait in this case.

  When conn2 reaches 'after_abort_locks', it signals 'flushed', which lets
  conn1 awake.

  Normally the activation of a sync point is cleared when it has been
  executed. Sometimes it is necessary to keep the sync point active for
  another execution. You can add an execute count to the action:

      SET DEBUG_SYNC= 'name SIGNAL sig EXECUTE 3';

  This sets the signal point's activation counter to 3. Each execution
  decrements the counter. After the third execution the sync point
  becomes inactive.

  One of the primary goals of this facility is to eliminate sleeps from
  the test suite. In most cases it should be possible to rewrite test
  cases so that they do not need to sleep. (But this facility cannot
  synchronize multiple processes.) However, to support test development,
  and as a last resort, sync point waiting times out. There is a default
  timeout, but it can be overridden:

      SET DEBUG_SYNC= 'name WAIT_FOR sig TIMEOUT 10 EXECUTE 2';

  TIMEOUT 0 is special: If the signal is not present, the wait times out
  immediately.

  When a wait timed out (even on TIMEOUT 0), a warning is generated so
  that it shows up in the test result.

  You can throw an error message and kill the query when a synchronization
  point is hit a certain number of times:

      SET DEBUG_SYNC= 'name HIT_LIMIT 3';

  Or combine it with signal and/or wait:

      SET DEBUG_SYNC= 'name SIGNAL sig EXECUTE 2 HIT_LIMIT 3';

  Here the first two hits emit the signal, the third hit returns the error
  message and kills the query.

  For cases where you are not sure that an action is taken and thus
  cleared in any case, you can force to clear (deactivate) a sync point:

      SET DEBUG_SYNC= 'name CLEAR';

  If you want to clear all actions and clear the global signal, use:

      SET DEBUG_SYNC= 'RESET';

  This is the only way to reset the global signal to an empty string.

  For testing of the facility itself you can execute a sync point just
  as if it had been hit:

      SET DEBUG_SYNC= 'name TEST';


  === Formal Syntax ===

  The string to "assign" to the DEBUG_SYNC variable can contain:

      {RESET |
       <sync point name> TEST |
       <sync point name> CLEAR |
       <sync point name> {{SIGNAL <signal name> |
                           WAIT_FOR <signal name> [TIMEOUT <seconds>]}
                          [EXECUTE <count>] &| HIT_LIMIT <count>}

  Here '&|' means 'and/or'. This means that one of the sections
  separated by '&|' must be present or both of them.


  === Activation/Deactivation ===

  The facility is an optional part of the MySQL server.
  It is enabled in a debug server by default.

      ./configure --enable-debug-sync

  The Debug Sync Facility, when compiled in, is disabled by default. It
  can be enabled by a mysqld command line option:

      --debug-sync-timeout[=default_wait_timeout_value_in_seconds]

  'default_wait_timeout_value_in_seconds' is the default timeout for the
  WAIT_FOR action. If set to zero, the facility stays disabled.

  The facility is enabled by default in the test suite, but can be
  disabled with:

      mysql-test-run.pl ... --debug-sync-timeout=0 ...

  Likewise the default wait timeout can be set:

      mysql-test-run.pl ... --debug-sync-timeout=10 ...

  The command line option influences the readable value of the system
  variable 'debug_sync'.

  * If the facility is not compiled in, the system variable does not exist.

  * If --debug-sync-timeout=0 the value of the variable reads as "OFF".

  * Otherwise the value reads as "ON - current signal: " followed by the
    current signal string, which can be empty.

  The readable variable value is the same, regardless if read as global
  or session value.

  Setting the 'debug-sync' system variable requires 'SUPER' privilege.
  You can never read back the string that you assigned to the variable,
  unless you assign the value that the variable does already have. But
  that would give a parse error. A syntactically correct string is
  parsed into a debug sync action and stored apart from the variable value.


  === Implementation ===

  Pseudo code for a sync point:

      #define DEBUG_SYNC(thd, sync_point_name)
                if (unlikely(opt_debug_sync_timeout))
                  debug_sync(thd, STRING_WITH_LEN(sync_point_name))

  The sync point performs a binary search in a sorted array of actions
  for this thread.

  The SET DEBUG_SYNC statement adds a requested action to the array or
  overwrites an existing action for the same sync point. When it adds a
  new action, the array is sorted again.


  === A typical synchronization pattern ===

  There are quite a few places in MySQL, where we use a synchronization
  pattern like this:

  mysql_mutex_lock(&mutex);
  thd->enter_cond(&condition_variable, &mutex, new_message);
  #if defined(ENABLE_DEBUG_SYNC)
  if (!thd->killed && !end_of_wait_condition)
     DEBUG_SYNC(thd, "sync_point_name");
  #endif
  while (!thd->killed && !end_of_wait_condition)
    mysql_cond_wait(&condition_variable, &mutex);
  thd->exit_cond(old_message);

  Here some explanations:

  thd->enter_cond() is used to register the condition variable and the
  mutex in thd->mysys_var. This is done to allow the thread to be
  interrupted (killed) from its sleep. Another thread can find the
  condition variable to signal and mutex to use for synchronization in
  this thread's THD::mysys_var.

  thd->enter_cond() requires the mutex to be acquired in advance.

  thd->exit_cond() unregisters the condition variable and mutex and
  releases the mutex.

  If you want to have a Debug Sync point with the wait, please place it
  behind enter_cond(). Only then you can safely decide, if the wait will
  be taken. Also you will have THD::proc_info correct when the sync
  point emits a signal. DEBUG_SYNC sets its own proc_info, but restores
  the previous one before releasing its internal mutex. As soon as
  another thread sees the signal, it does also see the proc_info from
  before entering the sync point. In this case it will be "new_message",
  which is associated with the wait that is to be synchronized.

  In the example above, the wait condition is repeated before the sync
  point. This is done to skip the sync point, if no wait takes place.
  The sync point is before the loop (not inside the loop) to have it hit
  once only. It is possible that the condition variable is signaled
  multiple times without the wait condition to be true.

  A bit off-topic: At some places, the loop is taken around the whole
  synchronization pattern:

  while (!thd->killed && !end_of_wait_condition)
  {
    mysql_mutex_lock(&mutex);
    thd->enter_cond(&condition_variable, &mutex, new_message);
    if (!thd->killed [&& !end_of_wait_condition])
    {
      [DEBUG_SYNC(thd, "sync_point_name");]
      mysql_cond_wait(&condition_variable, &mutex);
    }
    thd->exit_cond(old_message);
  }

  Note that it is important to repeat the test for thd->killed after
  enter_cond(). Otherwise the killing thread may kill this thread after
  it tested thd->killed in the loop condition and before it registered
  the condition variable and mutex in enter_cond(). In this case, the
  killing thread does not know that this thread is going to wait on a
  condition variable. It would just set THD::killed. But if we would not
  test it again, we would go asleep though we are killed. If the killing
  thread would kill us when we are after the second test, but still
  before sleeping, we hold the mutex, which is registered in mysys_var.
  The killing thread would try to acquire the mutex before signaling
  the condition variable. Since the mutex is only released implicitly in
  mysql_cond_wait(), the signaling happens at the right place. We
  have a safe synchronization.

  === Co-work with the DBUG facility ===

  When running the MySQL test suite with the --debug-dbug command line
  option, the Debug Sync Facility writes trace messages to the DBUG
  trace. The following shell commands proved very useful in extracting
  relevant information:

  egrep 'query:|debug_sync_exec:' mysql-test/var/log/mysqld.1.trace

  It shows all executed SQL statements and all actions executed by
  synchronization points.

  Sometimes it is also useful to see, which synchronization points have
  been run through (hit) with or without executing actions. Then add
  "|debug_sync_point:" to the egrep pattern.

  === Further reading ===

  For a discussion of other methods to synchronize threads see
  http://forge.mysql.com/wiki/MySQL_Internals_Test_Synchronization

  For complete syntax tests, functional tests, and examples see the test
  case debug_sync.test.

  See also http://forge.mysql.com/worklog/task.php?id=4259
*/

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef MYSQL_DYNAMIC_PLUGIN
extern void (*debug_sync_service)(MYSQL_THD, const char *, size_t);
#else
#define debug_sync_service debug_sync_C_callback_ptr
extern void (*debug_sync_C_callback_ptr)(MYSQL_THD, const char *, size_t);
#endif

#ifdef ENABLED_DEBUG_SYNC
#define DEBUG_SYNC(thd, name)                           \
  do {                                                  \
    if (debug_sync_service)                             \
      debug_sync_service(thd, STRING_WITH_LEN(name));   \
  } while(0)

#define DEBUG_SYNC_C_IF_THD(thd, name)                   \
  do {                                                   \
    if (debug_sync_service && thd)                       \
      debug_sync_service((MYSQL_THD) thd, STRING_WITH_LEN(name));   \
  } while(0)
#else
#define DEBUG_SYNC(thd,name)                        do { } while(0)
#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_) do { } while(0)
#endif /* defined(ENABLED_DEBUG_SYNC) */

/* compatibility macro */
#ifdef __cplusplus
#define DEBUG_SYNC_C(name) DEBUG_SYNC(nullptr, name)
#else
#define DEBUG_SYNC_C(name) DEBUG_SYNC(NULL, name)
#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_DEBUG_SYNC_INCLUDED
#endif
server/mysql/service_thd_autoinc.h000064400000003234150400263630013412 0ustar00#ifndef MYSQL_SERVICE_THD_AUTOINC_INCLUDED
/* Copyright (C) 2013 MariaDB Foundation.

   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 */

/**
  @file
  This service provides access to the auto_increment related system variables:

  @@auto_increment_offset
  @@auto_increment_increment
*/

#ifdef __cplusplus
extern "C" {
#endif

extern struct thd_autoinc_service_st {
  void (*thd_get_autoinc_func)(const MYSQL_THD thd,
                               unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;

#ifdef MYSQL_DYNAMIC_PLUGIN
#define thd_get_autoinc(thd, off, inc) \
  (thd_autoinc_service->thd_get_autoinc_func((thd), (off), (inc)))
#else
/**
  Return autoincrement system variables
  @param  IN  thd   user thread connection handle
  @param  OUT off   the value of @@SESSION.auto_increment_offset
  @param  OUT inc   the value of @@SESSION.auto_increment_increment
*/
void thd_get_autoinc(const MYSQL_THD thd,
                     unsigned long* off, unsigned long* inc);
#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_THD_AUTOINC_INCLUDED
#endif
server/mysql/plugin_ftparser.h000064400000017230150400263630012576 0ustar00/* Copyright (c) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

#ifndef _my_plugin_ftparser_h
#define _my_plugin_ftparser_h
#include "plugin.h"

#ifdef __cplusplus
extern "C" {
#endif

/*************************************************************************
  API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
*/

#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100

/* Parsing modes. Set in  MYSQL_FTPARSER_PARAM::mode */
enum enum_ftparser_mode
{
/*
  Fast and simple mode.  This mode is used for indexing, and natural
  language queries.

  The parser is expected to return only those words that go into the
  index. Stopwords or too short/long words should not be returned. The
  'boolean_info' argument of mysql_add_word() does not have to be set.
*/
  MYSQL_FTPARSER_SIMPLE_MODE= 0,

/*
  Parse with stopwords mode.  This mode is used in boolean searches for
  "phrase matching."

  The parser is not allowed to ignore words in this mode.  Every word
  should be returned, including stopwords and words that are too short
  or long.  The 'boolean_info' argument of mysql_add_word() does not
  have to be set.
*/
  MYSQL_FTPARSER_WITH_STOPWORDS= 1,

/*
  Parse in boolean mode.  This mode is used to parse a boolean query string.

  The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO
  structure in the 'boolean_info' argument to mysql_add_word().
  Usually that means that the parser should recognize boolean operators
  in the parsing stream and set appropriate fields in
  MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly.  As for
  MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored.
  Instead, use FT_TOKEN_STOPWORD for the token type of such a word.
*/
  MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
};

/*
  Token types for boolean mode searching (used for the type member of
  MYSQL_FTPARSER_BOOLEAN_INFO struct)

  FT_TOKEN_EOF: End of data.
  FT_TOKEN_WORD: Regular word.
  FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression).
  FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression).
  FT_TOKEN_STOPWORD: Stopword.
*/

enum enum_ft_token_type
{
  FT_TOKEN_EOF= 0,
  FT_TOKEN_WORD= 1,
  FT_TOKEN_LEFT_PAREN= 2,
  FT_TOKEN_RIGHT_PAREN= 3,
  FT_TOKEN_STOPWORD= 4
};

/*
  This structure is used in boolean search mode only. It conveys
  boolean-mode metadata to the MySQL search engine for every word in
  the search query. A valid instance of this structure must be filled
  in by the plugin parser and passed as an argument in the call to
  mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM
  structure) when a query is parsed in boolean mode.

  type: The token type.  Should be one of the enum_ft_token_type values.

  yesno: Whether the word must be present for a match to occur:
    >0 Must be present
    <0 Must not be present
    0  Neither; the word is optional but its presence increases the relevance
  With the default settings of the ft_boolean_syntax system variable,
  >0 corresponds to the '+' operator, <0 corresponds to the '-' operator,
  and 0 means neither operator was used.

  weight_adjust: A weighting factor that determines how much a match
  for the word counts.  Positive values increase, negative - decrease the
  relative word's importance in the query.

  wasign: The sign of the word's weight in the query. If it's non-negative
  the match for the word will increase document relevance, if it's
  negative - decrease (the word becomes a "noise word", the less of it the
  better).

  trunc: Corresponds to the '*' operator in the default setting of the
  ft_boolean_syntax system variable.
*/

typedef struct st_mysql_ftparser_boolean_info
{
  enum enum_ft_token_type type;
  int yesno;
  int weight_adjust;
  char wasign;
  char trunc;
  /* These are parser state and must be removed. */
  char prev;
  char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO;

/*
  The following flag means that buffer with a string (document, word)
  may be overwritten by the caller before the end of the parsing (that is
  before st_mysql_ftparser::deinit() call). If one needs the string
  to survive between two successive calls of the parsing function, she
  needs to save a copy of it. The flag may be set by MySQL before calling
  st_mysql_ftparser::parse(), or it may be set by a plugin before calling
  st_mysql_ftparser_param::mysql_parse() or
  st_mysql_ftparser_param::mysql_add_word().
*/
#define MYSQL_FTFLAGS_NEED_COPY 1

/*
  An argument of the full-text parser plugin. This structure is
  filled in by MySQL server and passed to the parsing function of the
  plugin as an in/out parameter.

  mysql_parse: A pointer to the built-in parser implementation of the
  server. It's set by the server and can be used by the parser plugin
  to invoke the MySQL default parser.  If plugin's role is to extract
  textual data from .doc, .pdf or .xml content, it might extract
  plaintext from the content, and then pass the text to the default
  MySQL parser to be parsed.

  mysql_add_word: A server callback to add a new word.  When parsing
  a document, the server sets this to point at a function that adds
  the word to MySQL full-text index.  When parsing a search query,
  this function will add the new word to the list of words to search
  for.  The boolean_info argument can be NULL for all cases except
  when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. A plugin can replace this
  callback to post-process every parsed word before passing it to the original
  mysql_add_word function.

  ftparser_state: A generic pointer. The plugin can set it to point
  to information to be used internally for its own purposes.

  mysql_ftparam: This is set by the server.  It is used by MySQL functions
  called via mysql_parse() and mysql_add_word() callback.  The plugin
  should not modify it.

  cs: Information about the character set of the document or query string.

  doc: A pointer to the document or query string to be parsed.

  length: Length of the document or query string, in bytes.

  flags: See MYSQL_FTFLAGS_* constants above.

  mode: The parsing mode.  With boolean operators, with stopwords, or
  nothing.  See  enum_ftparser_mode above.
*/

typedef struct st_mysql_ftparser_param
{
  int (*mysql_parse)(struct st_mysql_ftparser_param *,
                     const char *doc, int doc_len);
  int (*mysql_add_word)(struct st_mysql_ftparser_param *,
                        const char *word, int word_len,
                        MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
  void *ftparser_state;
  void *mysql_ftparam;
  const struct charset_info_st *cs;
  const char *doc;
  int length;
  unsigned int flags;
  enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;

/*
  Full-text parser descriptor.

  interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION.
  The parsing, initialization, and deinitialization functions are
  invoked per SQL statement for which the parser is used.
*/

struct st_mysql_ftparser
{
  int interface_version;
  int (*parse)(MYSQL_FTPARSER_PARAM *param);
  int (*init)(MYSQL_FTPARSER_PARAM *param);
  int (*deinit)(MYSQL_FTPARSER_PARAM *param);
};


#ifdef __cplusplus
}
#endif

#endif

server/mysql/plugin_auth.h000064400000012430150400263630011706 0ustar00#ifndef MYSQL_PLUGIN_AUTH_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
   Copyright (c) 2010, Oracle and/or its affiliates.

   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 */

/**
  @file

  Authentication Plugin API.

  This file defines the API for server authentication plugins.
*/

#define MYSQL_PLUGIN_AUTH_INCLUDED

#include <mysql/plugin.h>

#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0202

#include <mysql/plugin_auth_common.h>

#ifdef __cplusplus
extern "C" {
#endif

/* defines for MYSQL_SERVER_AUTH_INFO.password_used */

#define PASSWORD_USED_NO         0
#define PASSWORD_USED_YES        1
#define PASSWORD_USED_NO_MENTION 2


/**
  Provides server plugin access to authentication information
*/
typedef struct st_mysql_server_auth_info
{
  /**
    User name as sent by the client and shown in USER().
    NULL if the client packet with the user name was not received yet.
  */
  const char *user_name;

  /**
    Length of user_name
  */
  unsigned int user_name_length;

  /**
    A corresponding column value from the mysql.user table for the
    matching account name or the preprocessed value, if preprocess_hash
    method is not NULL
  */
  const char *auth_string;

  /**
    Length of auth_string
  */
  unsigned long auth_string_length;

  /**
    Matching account name as found in the mysql.user table.
    A plugin can override it with another name that will be
    used by MySQL for authorization, and shown in CURRENT_USER()
  */
  char authenticated_as[MYSQL_USERNAME_LENGTH+1]; 


  /**
    The unique user name that was used by the plugin to authenticate.
    Not used by the server.
    Available through the @@EXTERNAL_USER variable.
  */  
  char external_user[MYSQL_USERNAME_LENGTH+1];

  /**
    This only affects the "Authentication failed. Password used: %s"
    error message. has the following values : 
    0 : %s will be NO.
    1 : %s will be YES.
    2 : there will be no %s.
    Set it as appropriate or ignore at will.
  */
  int  password_used;

  /**
    Set to the name of the connected client host, if it can be resolved, 
    or to its IP address otherwise.
  */
  const char *host_or_ip;

  /**
    Length of host_or_ip
  */
  unsigned int host_or_ip_length;

  /**
    Current THD pointer (to use with various services)
  */
  MYSQL_THD thd;

} MYSQL_SERVER_AUTH_INFO;

/**
  Server authentication plugin descriptor
*/
struct st_mysql_auth
{
  int interface_version;                        /**< version plugin uses */
  /**
    A plugin that a client must use for authentication with this server
    plugin. Can be NULL to mean "any plugin".
  */
  const char *client_auth_plugin;
  /**
    Function provided by the plugin which should perform authentication (using
    the vio functions if necessary) and return 0 if successful. The plugin can
    also fill the info.authenticated_as field if a different username should be
    used for authorization.
  */
  int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
  /**
    Create a password hash (or digest) out of a plain-text password

    Used in SET PASSWORD, GRANT, and CREATE USER to convert user specified
    plain-text password into a value that will be stored in mysql.user table.

    @see preprocess_hash

    @param password        plain-text password
    @param password_length plain-text password length
    @param hash            the digest will be stored there
    @param hash_length     in: hash buffer size
                           out: the actual length of the hash

    @return 0 for ok, 1 for error

    Can be NULL, in this case one will not be able to use SET PASSWORD or
    PASSWORD('...') in GRANT, CREATE USER, ALTER USER.
  */
  int (*hash_password)(const char *password, size_t password_length,
                       char *hash, size_t *hash_length);

  /**
    Prepare the password hash for authentication.

    Password hash is stored in the authentication_string column of the
    mysql.user table in a text form. If a plugin needs to preprocess the
    value somehow before the authentication (e.g. convert from hex or base64
    to binary), it can do it in this method. This way the conversion
    will happen only once, not for every authentication attempt.

    The value written to the out buffer will be cached and later made
    available to the authenticate_user() method in the
    MYSQL_SERVER_AUTH_INFO::auth_string[] buffer.

    @return 0 for ok, 1 for error

    Can be NULL, in this case the mysql.user.authentication_string value will
    be given to the authenticate_user() method as is, unconverted.
  */
  int (*preprocess_hash)(const char *hash, size_t hash_length,
                         unsigned char *out, size_t *out_length);
};

#ifdef __cplusplus
}
#endif

#endif

server/mysql/plugin_data_type.h000064400000002424150400263640012722 0ustar00#ifndef MARIADB_PLUGIN_DATA_TYPE_INCLUDED
#define MARIADB_PLUGIN_DATA_TYPE_INCLUDED
/* Copyright (C) 2019, Alexander Barkov and MariaDB

   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 */

/**
  @file

  Data Type Plugin API.

  This file defines the API for server plugins that manage data types.
*/

#ifdef __cplusplus

#include <mysql/plugin.h>

/*
  API for data type plugins. (MariaDB_DATA_TYPE_PLUGIN)
*/
#define MariaDB_DATA_TYPE_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)


struct st_mariadb_data_type
{
  int interface_version;
  class Type_handler *type_handler;
};


/**
  Data type plugin descriptor
*/

#endif /* __cplusplus */

#endif /* MARIADB_PLUGIN_DATA_TYPE_INCLUDED */
server/mysql/service_logger.h000064400000006737150400263640012404 0ustar00/* Copyright (C) 2012 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MYSQL_SERVICE_LOGGER_INCLUDED
#define MYSQL_SERVICE_LOGGER_INCLUDED

#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#endif

/**
  @file
  logger service

  Log file with rotation implementation.

  This service implements logging with possible rotation
  of the log files. Interface intentionally tries to be similar to FILE*
  related functions.

  So that one can open the log with logger_open(), specifying
  the limit on the logfile size and the rotations number.

  Then it's possible to write messages to the log with
  logger_printf or logger_vprintf functions.

  As the size of the logfile grows over the specified limit,
  it is renamed to 'logfile.1'. The former 'logfile.1' becomes
  'logfile.2', etc. The file 'logfile.rotations' is removed.
  That's how the rotation works.

  The rotation can be forced with the logger_rotate() call.

  Finally the log should be closed with logger_close().

@notes:
  Implementation checks the size of the log file before it starts new
  printf into it. So the size of the file gets over the limit when it rotates.

  The access is secured with the mutex, so the log is threadsafe.
*/


#ifdef __cplusplus
extern "C" {
#endif

typedef struct logger_handle_st LOGGER_HANDLE;

extern struct logger_service_st {
  void (*logger_init_mutexes)();
  LOGGER_HANDLE* (*open)(const char *path,
                         unsigned long long size_limit,
                         unsigned int rotations);
  int (*close)(LOGGER_HANDLE *log);
  int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
  int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
  int (*write)(LOGGER_HANDLE *log, const char *buffer, size_t size);
  int (*rotate)(LOGGER_HANDLE *log);
} *logger_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define logger_init_mutexes logger_service->logger_init_mutexes
#define logger_open(path, size_limit, rotations) \
  (logger_service->open(path, size_limit, rotations))
#define logger_close(log) (logger_service->close(log))
#define logger_rotate(log) (logger_service->rotate(log))
#define logger_vprintf(log, fmt, argptr) (logger_service->\
    vprintf(log, fmt, argptr))
#define logger_printf (*logger_service->printf)
#define logger_write(log, buffer, size) \
  (logger_service->write(log, buffer, size))
#else

  void logger_init_mutexes();
  LOGGER_HANDLE *logger_open(const char *path,
                             unsigned long long size_limit,
                             unsigned int rotations);
  int logger_close(LOGGER_HANDLE *log);
  int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
  int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
  int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
  int logger_rotate(LOGGER_HANDLE *log); 
#endif


#ifdef __cplusplus
}
#endif

#endif /*MYSQL_SERVICE_LOGGER_INCLUDED*/

server/mysql/service_thd_alloc.h000064400000010612150400263640013041 0ustar00#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @file
  This service provides functions to allocate memory in a connection local
  memory pool. The memory allocated there will be automatically freed at the
  end of the statement, don't use it for allocations that should live longer
  than that. For short living allocations this is more efficient than
  using my_malloc and friends, and automatic "garbage collection" allows not
  to think about memory leaks.

  The pool is best for small to medium objects, don't use it for large
  allocations - they are better served with my_malloc.
*/

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

struct st_mysql_lex_string
{
  char *str;
  size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;

struct st_mysql_const_lex_string
{
  const char *str;
  size_t length;
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;

extern struct thd_alloc_service_st {
  void *(*thd_alloc_func)(MYSQL_THD, size_t);
  void *(*thd_calloc_func)(MYSQL_THD, size_t);
  char *(*thd_strdup_func)(MYSQL_THD, const char *);
  char *(*thd_strmake_func)(MYSQL_THD, const char *, size_t);
  void *(*thd_memdup_func)(MYSQL_THD, const void*, size_t);
  MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD,
                                        MYSQL_CONST_LEX_STRING *,
                                        const char *, size_t, int);
} *thd_alloc_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size)))

#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size)))

#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str)))

#define thd_strmake(thd,str,size) \
  (thd_alloc_service->thd_strmake_func((thd), (str), (size)))

#define thd_memdup(thd,str,size) \
  (thd_alloc_service->thd_memdup_func((thd), (str), (size)))

#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \
  (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \
                                               (size), (allocate_lex_string)))

#else

/**
  Allocate memory in the connection's local memory pool

  @details
  When properly used in place of @c my_malloc(), this can significantly
  improve concurrency. Don't use this or related functions to allocate
  large chunks of memory. Use for temporary storage only. The memory
  will be freed automatically at the end of the statement; no explicit
  code is required to prevent memory leaks.

  @see alloc_root()
*/
void *thd_alloc(MYSQL_THD thd, size_t size);
/**
  @see thd_alloc()
*/
void *thd_calloc(MYSQL_THD thd, size_t size);
/**
  @see thd_alloc()
*/
char *thd_strdup(MYSQL_THD thd, const char *str);
/**
  @see thd_alloc()
*/
char *thd_strmake(MYSQL_THD thd, const char *str, size_t size);
/**
  @see thd_alloc()
*/
void *thd_memdup(MYSQL_THD thd, const void* str, size_t size);

/**
  Create a LEX_STRING in this connection's local memory pool

  @param thd      user thread connection handle
  @param lex_str  pointer to LEX_STRING object to be initialized
  @param str      initializer to be copied into lex_str
  @param size     length of str, in bytes
  @param allocate_lex_string  flag: if TRUE, allocate new LEX_STRING object,
                              instead of using lex_str value
  @return  NULL on failure, or pointer to the LEX_STRING object

  @see thd_alloc()
*/
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str,
                     const char *str, size_t size,
                     int allocate_lex_string);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_THD_ALLOC_INCLUDED
#endif

server/mysql/service_my_print_error.h000064400000004430150400263640014163 0ustar00/* Copyright (c) 2016, MariaDB

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 */

#ifndef MYSQL_SERVICE_MY_PRINT_ERROR_INCLUDED
#define MYSQL_SERVICE_MY_PRINT_ERROR_INCLUDED

/**
  @file include/mysql/service_my_print_error.h

  This service provides functions for plugins to report
  errors to client (without client, the errors are written to the error log).

*/
#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#include <stdlib.h>
#endif

#define ME_ERROR_LOG        64 /* Write the message to the error log */
#define ME_ERROR_LOG_ONLY  128 /* Write the error message to error log only */
#define ME_NOTE           1024 /* Not an error, just a note */
#define ME_WARNING        2048 /* Not an error, just a warning */
#define ME_FATAL          4096 /* Fatal statement error */

extern struct my_print_error_service_st {
  void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
  void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
  void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
} *my_print_error_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_error my_print_error_service->my_error_func
#define my_printf_error my_print_error_service->my_printf_error_func
#define my_printv_error(A,B,C,D) my_print_error_service->my_printv_error_func(A,B,C,D)

#else
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap);
#endif /* MYSQL_DYNAMIC_PLUGIN */

#ifdef __cplusplus
}
#endif

#endif

server/mysql/plugin_encryption.h000064400000010521150400263640013137 0ustar00#ifndef MYSQL_PLUGIN_ENCRYPTION_INCLUDED
/* Copyright (C) 2014, 2015 Sergei Golubchik and MariaDB

   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 */

/**
  @file

  Encryption Plugin API.

  This file defines the API for server plugins that manage encryption
  keys for MariaDB on-disk data encryption.
*/

#define MYSQL_PLUGIN_ENCRYPTION_INCLUDED

#include <mysql/plugin.h>

#ifdef __cplusplus
extern "C" {
#endif

#define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0300

/**
  Encryption plugin descriptor
*/
struct st_mariadb_encryption
{
  int interface_version;                        /**< version plugin uses */

  /*********** KEY MANAGEMENT ********************************************/

  /**
    function returning latest key version for a given key id

    @return a version or ENCRYPTION_KEY_VERSION_INVALID to indicate an error.
  */
  unsigned int (*get_latest_key_version)(unsigned int key_id);

  /**
    function returning a key for a key version

    @param version      the requested key version
    @param key          the key will be stored there. Can be NULL -
                        in which case no key will be returned
    @param key_length   in: key buffer size
                        out: the actual length of the key

    This method can be used to query the key length - the required
    buffer size - by passing key==NULL.

    If the buffer size is less than the key length the content of the
    key buffer is undefined (the plugin is free to partially fill it with
    the key data or leave it untouched).

    @return 0 on success, or
            ENCRYPTION_KEY_VERSION_INVALID, ENCRYPTION_KEY_BUFFER_TOO_SMALL
            or any other non-zero number for errors
  */
  unsigned int (*get_key)(unsigned int key_id, unsigned int version,
                          unsigned char *key, unsigned int *key_length);

  /*********** ENCRYPTION ************************************************/
  /*
    the caller uses encryption as follows:
      1. create the encryption context object of the crypt_ctx_size() bytes.
      2. initialize it with crypt_ctx_init().
      3. repeat crypt_ctx_update() until there are no more data to encrypt.
      4. write the remaining output bytes and destroy the context object
         with crypt_ctx_finish().
  */

  /**
    returns the size of the encryption context object in bytes
  */
  unsigned int (*crypt_ctx_size)(unsigned int key_id, unsigned int key_version);
  /**
    initializes the encryption context object.
  */
  int (*crypt_ctx_init)(void *ctx, const unsigned char* key, unsigned int klen,
                        const unsigned char* iv, unsigned int ivlen,
                        int flags, unsigned int key_id,
                        unsigned int key_version);
  /**
    processes (encrypts or decrypts) a chunk of data

    writes the output to th dst buffer. note that it might write
    more bytes that were in the input. or less. or none at all.
  */
  int (*crypt_ctx_update)(void *ctx, const unsigned char* src, unsigned int slen,
                          unsigned char* dst, unsigned int* dlen);
  /**
    writes the remaining output bytes and destroys the encryption context

    crypt_ctx_update might've cached part of the output in the context,
    this method will flush these data out.
  */
  int (*crypt_ctx_finish)(void *ctx, unsigned char* dst, unsigned int* dlen);
  /**
    returns the length of the encrypted data

    it returns the exact length, given only the source length.
    which means, this API only supports encryption algorithms where
    the length of the encrypted data only depends on the length of the
    input (a.k.a. compression is not supported).
  */
  unsigned int (*encrypted_length)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};

#ifdef __cplusplus
}
#endif
#endif

server/mysql/service_my_crypt.h000064400000010107150400263640012755 0ustar00#ifndef MYSQL_SERVICE_MY_CRYPT_INCLUDED
#define MYSQL_SERVICE_MY_CRYPT_INCLUDED

/*
 Copyright (c) 2014 Google Inc.
 Copyright (c) 2014, 2015 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 */

/**
 @file
 my crypt service

 AES encryption functions, and a function to generate random bytes.

 Include my_config.h before this file to use CTR and GCM modes
 (they only work if server was compiled with  openssl).
*/


#ifdef __cplusplus
extern "C" {
#endif

/* return values from my_aes_encrypt/my_aes_decrypt functions */
#define MY_AES_OK               0
#define MY_AES_BAD_DATA         -100
#define MY_AES_OPENSSL_ERROR    -101
#define MY_AES_BAD_KEYSIZE      -102

/* The block size for all supported algorithms */
#define MY_AES_BLOCK_SIZE 16

/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32

#define MY_AES_CTX_SIZE 1040

enum my_aes_mode {
    MY_AES_ECB, MY_AES_CBC
#ifdef HAVE_EncryptAes128Ctr
  , MY_AES_CTR
#endif
#ifdef HAVE_EncryptAes128Gcm
  , MY_AES_GCM
#endif
};

extern struct my_crypt_service_st {
  int (*my_aes_crypt_init)(void *ctx, enum my_aes_mode mode, int flags,
                      const unsigned char* key, unsigned int klen,
                      const unsigned char* iv, unsigned int ivlen);
  int (*my_aes_crypt_update)(void *ctx, const unsigned char *src, unsigned int slen,
                        unsigned char *dst, unsigned int *dlen);
  int (*my_aes_crypt_finish)(void *ctx, unsigned char *dst, unsigned int *dlen);
  int (*my_aes_crypt)(enum my_aes_mode mode, int flags,
                 const unsigned char *src, unsigned int slen, unsigned char *dst, unsigned int *dlen,
                 const unsigned char *key, unsigned int klen, const unsigned char *iv, unsigned int ivlen);
  unsigned int (*my_aes_get_size)(enum my_aes_mode mode, unsigned int source_length);
  unsigned int (*my_aes_ctx_size)(enum my_aes_mode mode);
  int (*my_random_bytes)(unsigned char* buf, int num);
} *my_crypt_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_aes_crypt_init(A,B,C,D,E,F,G) \
   my_crypt_service->my_aes_crypt_init(A,B,C,D,E,F,G)

#define my_aes_crypt_update(A,B,C,D,E) \
   my_crypt_service->my_aes_crypt_update(A,B,C,D,E)

#define my_aes_crypt_finish(A,B,C) \
  my_crypt_service->my_aes_crypt_finish(A,B,C)

#define my_aes_crypt(A,B,C,D,E,F,G,H,I,J) \
  my_crypt_service->my_aes_crypt(A,B,C,D,E,F,G,H,I,J)

#define my_aes_get_size(A,B)\
  my_crypt_service->my_aes_get_size(A,B)

#define my_aes_ctx_size(A)\
  my_crypt_service->my_aes_ctx_size(A)

#define my_random_bytes(A,B)\
  my_crypt_service->my_random_bytes(A,B)

#else

int my_aes_crypt_init(void *ctx, enum my_aes_mode mode, int flags,
                      const unsigned char* key, unsigned int klen,
                      const unsigned char* iv, unsigned int ivlen);
int my_aes_crypt_update(void *ctx, const unsigned char *src, unsigned int slen,
                        unsigned char *dst, unsigned int *dlen);
int my_aes_crypt_finish(void *ctx, unsigned char *dst, unsigned int *dlen);
int my_aes_crypt(enum my_aes_mode mode, int flags,
                 const unsigned char *src, unsigned int slen, unsigned char *dst, unsigned int *dlen,
                 const unsigned char *key, unsigned int klen, const unsigned char *iv, unsigned int ivlen);

int my_random_bytes(unsigned char* buf, int num);
unsigned int my_aes_get_size(enum my_aes_mode mode, unsigned int source_length);
unsigned int my_aes_ctx_size(enum my_aes_mode mode);
#endif


#ifdef __cplusplus
}
#endif

#endif /* MYSQL_SERVICE_MY_CRYPT_INCLUDED */
server/mysql/service_thd_wait.h000064400000007157150400263640012725 0ustar00/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef MYSQL_SERVICE_THD_WAIT_INCLUDED
#define MYSQL_SERVICE_THD_WAIT_INCLUDED

/**
  @file include/mysql/service_thd_wait.h
  This service provides functions for plugins and storage engines to report
  when they are going to sleep/stall.
  
  SYNOPSIS
  thd_wait_begin() - call just before a wait begins
  thd                     Thread object
                          Use NULL if the thd is NOT known.
  wait_type               Type of wait
                          1 -- short wait (e.g. for mutex)
                          2 -- medium wait (e.g. for disk io)
                          3 -- large wait (e.g. for locked row/table)
  NOTES
    This is used by the threadpool to have better knowledge of which
    threads that currently are actively running on CPUs. When a thread
    reports that it's going to sleep/stall, the threadpool scheduler is
    free to start another thread in the pool most likely. The expected wait
    time is simply an indication of how long the wait is expected to
    become, the real wait time could be very different.

  thd_wait_end() called immediately after the wait is complete

  thd_wait_end() MUST be called if thd_wait_begin() was called.

  Using thd_wait_...() service is optional but recommended.  Using it will
  improve performance as the thread pool will be more active at managing the
  thread workload.
*/

#ifdef __cplusplus
extern "C" {
#endif

/*
  One should only report wait events that could potentially block for a
  long time. A mutex wait is too short of an event to report. The reason
  is that an event which is reported leads to a new thread starts
  executing a query and this has a negative impact of usage of CPU caches
  and thus the expected gain of starting a new thread must be higher than
  the expected cost of lost performance due to starting a new thread.

  Good examples of events that should be reported are waiting for row locks
  that could easily be for many milliseconds or even seconds and the same
  holds true for global read locks, table locks and other meta data locks.
  Another event of interest is going to sleep for an extended time.
*/
typedef enum _thd_wait_type_e {
  THD_WAIT_SLEEP= 1,
  THD_WAIT_DISKIO= 2,
  THD_WAIT_ROW_LOCK= 3,
  THD_WAIT_GLOBAL_LOCK= 4,
  THD_WAIT_META_DATA_LOCK= 5,
  THD_WAIT_TABLE_LOCK= 6,
  THD_WAIT_USER_LOCK= 7,
  THD_WAIT_BINLOG= 8,
  THD_WAIT_GROUP_COMMIT= 9,
  THD_WAIT_SYNC= 10,
  THD_WAIT_NET= 11,
  THD_WAIT_LAST= 12
} thd_wait_type;

extern struct thd_wait_service_st {
  void (*thd_wait_begin_func)(MYSQL_THD, int);
  void (*thd_wait_end_func)(MYSQL_THD);
} *thd_wait_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define thd_wait_begin(_THD, _WAIT_TYPE) \
  thd_wait_service->thd_wait_begin_func(_THD, _WAIT_TYPE)
#define thd_wait_end(_THD) thd_wait_service->thd_wait_end_func(_THD)

#else

void thd_wait_begin(MYSQL_THD thd, int wait_type);
void thd_wait_end(MYSQL_THD thd);

#endif

#ifdef __cplusplus
}
#endif

#endif

server/mysql/service_sql.h000064400000012016150400263650011710 0ustar00/* Copyright (C) 2021 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 Street, Fifth Floor, Boston, MA 02111-1301 USA */

#ifndef MYSQL_SERVICE_SQL
#define MYSQL_SERVICE_SQL

#ifndef MYSQL_ABI_CHECK
#include <mysql.h>
#endif

/**
  @file
  SQL service

  Interface for plugins to execute SQL queries on the local server.

  Functions of the service are the 'server-limited'  client library:
     mysql_init
     mysql_real_connect_local
     mysql_real_connect
     mysql_errno
     mysql_error
     mysql_real_query
     mysql_affected_rows
     mysql_num_rows
     mysql_store_result
     mysql_free_result
     mysql_fetch_row
     mysql_close
*/


#ifdef __cplusplus
extern "C" {
#endif

extern struct sql_service_st {
  MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
  MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
  MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
      const char *user, const char *passwd, const char *db, unsigned int port,
      const char *unix_socket, unsigned long clientflag);
  unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
  const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
  int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
                                  unsigned long length);
  my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
  my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
  MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
  void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
  MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
  void (STDCALL *mysql_close_func)(MYSQL *mysql);
  int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
                            const void *arg);
  unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
  int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
  unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
  int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
  MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
  MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
  unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
                                        const char *from, unsigned long length);
  my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
      const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define mysql_init(M) sql_service->mysql_init_func(M)
#define mysql_real_connect_local(M) sql_service->mysql_real_connect_local_func(M)
#define mysql_real_connect(M,H,U,PW,D,P,S,F) sql_service->mysql_real_connect_func(M,H,U,PW,D,P,S,F)
#define mysql_errno(M) sql_service->mysql_errno_func(M)
#define mysql_error(M) sql_service->mysql_error_func(M)
#define mysql_real_query sql_service->mysql_real_query_func
#define mysql_affected_rows(M) sql_service->mysql_affected_rows_func(M)
#define mysql_num_rows(R) sql_service->mysql_num_rows_func(R)
#define mysql_store_result(M) sql_service->mysql_store_result_func(M)
#define mysql_free_result(R) sql_service->mysql_free_result_func(R)
#define mysql_fetch_row(R) sql_service->mysql_fetch_row_func(R)
#define mysql_close(M) sql_service->mysql_close_func(M)
#define mysql_options(M,O,V) sql_service->mysql_options_func(M,O,V)
#define mysql_fetch_lengths(R) sql_service->mysql_fetch_lengths_func(R)
#define mysql_set_character_set(M,C) sql_service->mysql_set_character_set_func(M,C)
#define mysql_num_fields(R) sql_service->mysql_num_fields_func(R)
#define mysql_select_db(M,D) sql_service->mysql_select_db_func(M,D)
#define mysql_use_result(M) sql_service->mysql_use_result_func(M)
#define mysql_fetch_fields(R) sql_service->mysql_fetch_fields_func(R)
#define mysql_real_escape_string(M,T,F,L) sql_service->mysql_real_escape_string_func(M,T,F,L)
#define mysql_ssl_set(M,K,C1,C2,C3,C4) sql_service->mysql_ssl_set_func(M,K,C1,C2,C3,C4)

#else

/*
  Establishes the connection to the 'local' server that started the plugin.
  Like the mysql_real_connect() does for the remote server.
  The established connection has no user/host associated to it,
  neither it has the current db, so the queries should have
  database/table name specified.
*/
MYSQL *mysql_real_connect_local(MYSQL *mysql);

/* The rest of the function declarations must be taken from the mysql.h */

#endif /*MYSQL_DYNAMIC_PLUGIN*/


#ifdef __cplusplus
}
#endif

#endif /*MYSQL_SERVICE_SQL */
server/mysql/plugin.h000064400000072306150400263650010677 0ustar00/* Copyright (c) 2005, 2013, Oracle and/or its affiliates
   Copyright (C) 2009, 2017, MariaDB

   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 */

#ifndef MYSQL_PLUGIN_INCLUDED
#define MYSQL_PLUGIN_INCLUDED

/*
  On Windows, exports from DLL need to be declared
  Also, plugin needs to be declared as extern "C" because MSVC 
  unlike other compilers, uses C++ mangling for variables not only
  for functions.
*/
#ifdef MYSQL_DYNAMIC_PLUGIN
  #ifdef _MSC_VER
    #define MYSQL_DLLEXPORT _declspec(dllexport)
  #else
    #define MYSQL_DLLEXPORT
  #endif
#else
  #define MYSQL_DLLEXPORT
#endif

#ifdef __cplusplus
  #define MYSQL_PLUGIN_EXPORT extern "C" MYSQL_DLLEXPORT
#else
  #define MYSQL_PLUGIN_EXPORT MYSQL_DLLEXPORT
#endif

#ifdef __cplusplus
class THD;
class Item;
#define MYSQL_THD THD*
#else
struct THD;
typedef struct THD* MYSQL_THD;
#endif

typedef char my_bool;
typedef void * MYSQL_PLUGIN;

#include <mysql/services.h>

#define MYSQL_XIDDATASIZE 128
/**
  struct st_mysql_xid is binary compatible with the XID structure as
  in the X/Open CAE Specification, Distributed Transaction Processing:
  The XA Specification, X/Open Company Ltd., 1991.
  http://www.opengroup.org/bookstore/catalog/c193.htm

  @see XID in sql/handler.h
*/
struct st_mysql_xid {
  long formatID;
  long gtrid_length;
  long bqual_length;
  char data[MYSQL_XIDDATASIZE];  /* Not \0-terminated */
};
typedef struct st_mysql_xid MYSQL_XID;

/*************************************************************************
  Plugin API. Common for all plugin types.
*/

/* MySQL plugin interface version */
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104

/* MariaDB plugin interface version */
#define MARIA_PLUGIN_INTERFACE_VERSION 0x010e

/*
  The allowable types of plugins
*/
#define MYSQL_UDF_PLUGIN             0  /* not implemented              */
#define MYSQL_STORAGE_ENGINE_PLUGIN  1
#define MYSQL_FTPARSER_PLUGIN        2  /* Full-text parser plugin      */
#define MYSQL_DAEMON_PLUGIN          3
#define MYSQL_INFORMATION_SCHEMA_PLUGIN  4
#define MYSQL_AUDIT_PLUGIN           5
#define MYSQL_REPLICATION_PLUGIN     6
#define MYSQL_AUTHENTICATION_PLUGIN  7
#define MYSQL_MAX_PLUGIN_TYPE_NUM    12  /* The number of plugin types   */

/* MariaDB plugin types */
#define MariaDB_PASSWORD_VALIDATION_PLUGIN  8
#define MariaDB_ENCRYPTION_PLUGIN 9
#define MariaDB_DATA_TYPE_PLUGIN  10
#define MariaDB_FUNCTION_PLUGIN 11

/* We use the following strings to define licenses for plugins */
#define PLUGIN_LICENSE_PROPRIETARY 0
#define PLUGIN_LICENSE_GPL 1
#define PLUGIN_LICENSE_BSD 2

#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
#define PLUGIN_LICENSE_GPL_STRING "GPL"
#define PLUGIN_LICENSE_BSD_STRING "BSD"

/* definitions of code maturity for plugins */
#define MariaDB_PLUGIN_MATURITY_UNKNOWN 0
#define MariaDB_PLUGIN_MATURITY_EXPERIMENTAL 1
#define MariaDB_PLUGIN_MATURITY_ALPHA 2
#define MariaDB_PLUGIN_MATURITY_BETA 3
#define MariaDB_PLUGIN_MATURITY_GAMMA 4
#define MariaDB_PLUGIN_MATURITY_STABLE 5

/*
  Macros for beginning and ending plugin declarations.  Between
  mysql_declare_plugin and mysql_declare_plugin_end there should
  be a st_mysql_plugin struct for each plugin to be declared.
*/


#ifndef MYSQL_DYNAMIC_PLUGIN
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS)                   \
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION;                                  \
int PSIZE= sizeof(struct st_mysql_plugin);                                    \
struct st_mysql_plugin DECLS[]= {

#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS)                   \
MYSQL_PLUGIN_EXPORT int VERSION;                                              \
int VERSION= MARIA_PLUGIN_INTERFACE_VERSION;                                  \
MYSQL_PLUGIN_EXPORT int PSIZE;                                                \
int PSIZE= sizeof(struct st_maria_plugin);                                    \
MYSQL_PLUGIN_EXPORT struct st_maria_plugin DECLS[];                           \
struct st_maria_plugin DECLS[]= {
#else

#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS)                   \
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_;                     \
int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION;         \
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_;                      \
int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin);          \
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[];     \
struct st_mysql_plugin _mysql_plugin_declarations_[]= {

#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS)                    \
MYSQL_PLUGIN_EXPORT int _maria_plugin_interface_version_;                      \
int _maria_plugin_interface_version_= MARIA_PLUGIN_INTERFACE_VERSION;          \
MYSQL_PLUGIN_EXPORT int _maria_sizeof_struct_st_plugin_;                       \
int _maria_sizeof_struct_st_plugin_= sizeof(struct st_maria_plugin);           \
MYSQL_PLUGIN_EXPORT struct st_maria_plugin _maria_plugin_declarations_[];      \
struct st_maria_plugin _maria_plugin_declarations_[]= {

#endif

#define mysql_declare_plugin(NAME) \
__MYSQL_DECLARE_PLUGIN(NAME, \
                 builtin_ ## NAME ## _plugin_interface_version, \
                 builtin_ ## NAME ## _sizeof_struct_st_plugin, \
                 builtin_ ## NAME ## _plugin)

#define maria_declare_plugin(NAME) \
MARIA_DECLARE_PLUGIN__(NAME, \
                 builtin_maria_ ## NAME ## _plugin_interface_version, \
                 builtin_maria_ ## NAME ## _sizeof_struct_st_plugin, \
                 builtin_maria_ ## NAME ## _plugin)

#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
#define maria_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}

/*
  declarations for SHOW STATUS support in plugins
*/
enum enum_mysql_show_type
{
  SHOW_UNDEF, SHOW_BOOL, SHOW_UINT, SHOW_ULONG,
  SHOW_ULONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
  SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, SHOW_SIMPLE_FUNC,
  SHOW_SIZE_T, SHOW_always_last
};

/* backward compatibility mapping. */
#define SHOW_INT      SHOW_UINT
#define SHOW_LONG     SHOW_ULONG
#define SHOW_LONGLONG SHOW_ULONGLONG

enum enum_var_type
{
  SHOW_OPT_DEFAULT= 0, SHOW_OPT_SESSION, SHOW_OPT_GLOBAL
};

struct st_mysql_show_var {
  const char *name;
  void *value;
  enum enum_mysql_show_type type;
};

struct system_status_var;

#define SHOW_VAR_FUNC_BUFF_SIZE (256 * sizeof(void*))
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);


static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
                                         mysql_show_var_func func_arg)
{
  struct st_mysql_show_var tmp;
  tmp.name= name;
  tmp.value= (void*) func_arg;
  tmp.type= SHOW_FUNC;
  return tmp;
};


/*
  Constants for plugin flags.
 */

#define PLUGIN_OPT_NO_INSTALL   1UL   /* Not dynamically loadable */
#define PLUGIN_OPT_NO_UNINSTALL 2UL   /* Not dynamically unloadable */


/*
  declarations for server variables and command line options
*/


#define PLUGIN_VAR_BOOL         0x0001
#define PLUGIN_VAR_INT          0x0002
#define PLUGIN_VAR_LONG         0x0003
#define PLUGIN_VAR_LONGLONG     0x0004
#define PLUGIN_VAR_STR          0x0005
#define PLUGIN_VAR_ENUM         0x0006
#define PLUGIN_VAR_SET          0x0007
#define PLUGIN_VAR_DOUBLE       0x0008
#define PLUGIN_VAR_UNSIGNED     0x0080
#define PLUGIN_VAR_THDLOCAL     0x0100 /* Variable is per-connection */
#define PLUGIN_VAR_READONLY     0x0200 /* Server variable is read only */
#define PLUGIN_VAR_NOSYSVAR     0x0400 /* Not a server variable */
#define PLUGIN_VAR_NOCMDOPT     0x0800 /* Not a command line option */
#define PLUGIN_VAR_NOCMDARG     0x1000 /* No argument for cmd line */
#define PLUGIN_VAR_RQCMDARG     0x0000 /* Argument required for cmd line */
#define PLUGIN_VAR_OPCMDARG     0x2000 /* Argument optional for cmd line */
#define PLUGIN_VAR_DEPRECATED   0x4000 /* Server variable is deprecated */
#define PLUGIN_VAR_MEMALLOC     0x8000 /* String needs memory allocated */

struct st_mysql_sys_var;
struct st_mysql_value;

/*
  SYNOPSIS
    (*mysql_var_check_func)()
      thd               thread handle
      var               dynamic variable being altered
      save              pointer to temporary storage
      value             user provided value
  RETURN
    0   user provided value is OK and the update func may be called.
    any other value indicates error.
  
  This function should parse the user provided value and store in the
  provided temporary storage any data as required by the update func.
  There is sufficient space in the temporary storage to store a double.
  Note that the update func may not be called if any other error occurs
  so any memory allocated should be thread-local so that it may be freed
  automatically at the end of the statement.
*/

typedef int (*mysql_var_check_func)(MYSQL_THD thd,
                                    struct st_mysql_sys_var *var,
                                    void *save, struct st_mysql_value *value);

/*
  SYNOPSIS
    (*mysql_var_update_func)()
      thd               thread handle
      var               dynamic variable being altered
      var_ptr           pointer to dynamic variable
      save              pointer to temporary storage
   RETURN
     NONE
   
   This function should use the validated value stored in the temporary store
   and persist it in the provided pointer to the dynamic variable.
   For example, strings may require memory to be allocated.
*/
typedef void (*mysql_var_update_func)(MYSQL_THD thd,
                                      struct st_mysql_sys_var *var,
                                      void *var_ptr, const void *save);


/* the following declarations are for internal use only */


#define PLUGIN_VAR_MASK \
        (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \
         PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \
         PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
         PLUGIN_VAR_DEPRECATED | PLUGIN_VAR_MEMALLOC)

#define MYSQL_PLUGIN_VAR_HEADER \
  int flags;                    \
  const char *name;             \
  const char *comment;          \
  mysql_var_check_func check;   \
  mysql_var_update_func update

#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name
#define MYSQL_SYSVAR(name) \
  ((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name)))

/*
  for global variables, the value pointer is the first
  element after the header, the default value is the second.
  for thread variables, the value offset is the first
  element after the header, the default value is the second.
*/
   

#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  type *value;                  \
  const type def_val;                 \
} MYSQL_SYSVAR_NAME(name)

#define DECLARE_MYSQL_SYSVAR_CONST_BASIC(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  const type *value;                  \
  const type def_val;                 \
} MYSQL_SYSVAR_NAME(name)

#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  type *value; type def_val;    \
  type min_val; type max_val;   \
  type blk_sz;                  \
} MYSQL_SYSVAR_NAME(name)

#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  type *value; type def_val;    \
  TYPELIB *typelib;             \
} MYSQL_SYSVAR_NAME(name)

#define DECLARE_THDVAR_FUNC(type) \
  type *(*resolve)(MYSQL_THD thd, int offset)

#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  int offset;                   \
  const type def_val;           \
  DECLARE_THDVAR_FUNC(type);    \
} MYSQL_SYSVAR_NAME(name)

#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  int offset;                   \
  type def_val; type min_val;   \
  type max_val; type blk_sz;    \
  DECLARE_THDVAR_FUNC(type);    \
} MYSQL_SYSVAR_NAME(name)

#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \
  MYSQL_PLUGIN_VAR_HEADER;      \
  int offset;                   \
  const type def_val;           \
  DECLARE_THDVAR_FUNC(type);    \
  TYPELIB *typelib;             \
} MYSQL_SYSVAR_NAME(name)


/*
  the following declarations are for use by plugin implementors
*/

#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \
  PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def}

#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
  PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def}

#define MYSQL_SYSVAR_CONST_STR(name, varname, opt, comment, check, update, def) \
DECLARE_MYSQL_SYSVAR_CONST_BASIC(name, char *) = { \
  PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def}

#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
  PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
  PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
  PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
  PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
  PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_SYSVAR_UINT64_T(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, uint64_t) = { \
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#ifdef _WIN64
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }
#else
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
  PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }
#endif

#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
  PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, typelib }

#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
  PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, typelib }

#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
  PLUGIN_VAR_DOUBLE | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, &varname, def, min, max, blk }

#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \
  PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, NULL}

#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
  PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, NULL}

#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
  PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
  PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
  PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
  PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
  PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, NULL, typelib }

#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
  PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, NULL, typelib }

#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
  PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
  #name, comment, check, update, -1, def, min, max, blk, NULL }

/* accessor macros */

#define SYSVAR(name) \
  (*(MYSQL_SYSVAR_NAME(name).value))

/* when thd == null, result points to global value */
#define THDVAR(thd, name) \
  (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))


/*
  Plugin description structure.
*/

struct st_mysql_plugin
{
  int type;             /* the plugin type (a MYSQL_XXX_PLUGIN value)   */
  void *info;           /* pointer to type-specific plugin descriptor   */
  const char *name;     /* plugin name                                  */
  const char *author;   /* plugin author (for I_S.PLUGINS)              */
  const char *descr;    /* general descriptive text (for I_S.PLUGINS)   */
  int license;          /* the plugin license (PLUGIN_LICENSE_XXX)      */
  /*
    The function to invoke when plugin is loaded. Plugin
    initialisation done here should defer any ALTER TABLE queries to
    after the ddl recovery is done, in the signal_ddl_recovery_done()
    callback called by ha_signal_ddl_recovery_done().
  */
  int (*init)(void *);
  int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
  unsigned int version; /* plugin version (for I_S.PLUGINS)             */
  struct st_mysql_show_var *status_vars;
  struct st_mysql_sys_var **system_vars;
  void * __reserved1;   /* reserved for dependency checking             */
  unsigned long flags;  /* flags for plugin */
};

/*
  MariaDB extension for plugins declaration structure.

  It also copy current MySQL plugin fields to have more independency
  in plugins extension
*/

struct st_maria_plugin
{
  int type;             /* the plugin type (a MYSQL_XXX_PLUGIN value)   */
  void *info;           /* pointer to type-specific plugin descriptor   */
  const char *name;     /* plugin name                                  */
  const char *author;   /* plugin author (for SHOW PLUGINS)             */
  const char *descr;    /* general descriptive text (for SHOW PLUGINS ) */
  int license;          /* the plugin license (PLUGIN_LICENSE_XXX)      */
  /*
    The function to invoke when plugin is loaded. Plugin
    initialisation done here should defer any ALTER TABLE queries to
    after the ddl recovery is done, in the signal_ddl_recovery_done()
    callback called by ha_signal_ddl_recovery_done().
  */
  int (*init)(void *);
  int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
  unsigned int version; /* plugin version (for SHOW PLUGINS)            */
  struct st_mysql_show_var *status_vars;
  struct st_mysql_sys_var **system_vars;
  const char *version_info;  /* plugin version string */
  unsigned int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
};

/*************************************************************************
  API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
*/
#include "plugin_ftparser.h"

/*************************************************************************
  API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN)
*/

/* handlertons of different MySQL releases are incompatible */
#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)

/*
  Here we define only the descriptor structure, that is referred from
  st_mysql_plugin.
*/

struct st_mysql_daemon
{
  int interface_version;
};


/*************************************************************************
  API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN)
*/

/* handlertons of different MySQL releases are incompatible */
#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)

/*
  Here we define only the descriptor structure, that is referred from
  st_mysql_plugin.
*/

struct st_mysql_information_schema
{
  int interface_version;
};


/*************************************************************************
  API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN)
*/

/* handlertons of different MySQL releases are incompatible */
#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)

/*
  The real API is in the sql/handler.h
  Here we define only the descriptor structure, that is referred from
  st_mysql_plugin.
*/

struct st_mysql_storage_engine
{
  int interface_version;
};

struct handlerton;


/*
  API for Replication plugin. (MYSQL_REPLICATION_PLUGIN)
*/
 #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0200
 
 /**
    Replication plugin descriptor
 */
 struct Mysql_replication {
   int interface_version;
 };

/*************************************************************************
  st_mysql_value struct for reading values from mysqld.
  Used by server variables framework to parse user-provided values.
  Will be used for arguments when implementing UDFs.

  Note that val_str() returns a string in temporary memory
  that will be freed at the end of statement. Copy the string
  if you need it to persist.
*/

#define MYSQL_VALUE_TYPE_STRING 0
#define MYSQL_VALUE_TYPE_REAL   1
#define MYSQL_VALUE_TYPE_INT    2

struct st_mysql_value
{
  int (*value_type)(struct st_mysql_value *);
  const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
  int (*val_real)(struct st_mysql_value *, double *realbuf);
  int (*val_int)(struct st_mysql_value *, long long *intbuf);
  int (*is_unsigned)(struct st_mysql_value *);
};


/*************************************************************************
  Miscellaneous functions for plugin implementors
*/

#ifdef __cplusplus
extern "C" {
#endif

int thd_in_lock_tables(const MYSQL_THD thd);
int thd_tablespace_op(const MYSQL_THD thd);
long long thd_test_options(const MYSQL_THD thd, long long test_options);
int thd_sql_command(const MYSQL_THD thd);
struct DDL_options_st;
struct DDL_options_st *thd_ddl_options(const MYSQL_THD thd);
void thd_storage_lock_wait(MYSQL_THD thd, long long value);
int thd_tx_isolation(const MYSQL_THD thd);
int thd_tx_is_read_only(const MYSQL_THD thd);
/**
  Create a temporary file.

  @details
  The temporary file is created in a location specified by the mysql
  server configuration (--tmpdir option).  The caller does not need to
  delete the file, it will be deleted automatically.

  @param prefix  prefix for temporary file name
  @retval -1    error
  @retval >= 0  a file handle that can be passed to dup or my_close
*/
int mysql_tmpfile(const char *prefix);

/**
  Return the thread id of a user thread

  @param thd  user thread connection handle
  @return  thread id
*/
unsigned long thd_get_thread_id(const MYSQL_THD thd);

/**
  Get the XID for this connection's transaction

  @param thd  user thread connection handle
  @param xid  location where identifier is stored
*/
void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid);

/**
  Invalidate the query cache for a given table.

  @param thd         user thread connection handle
  @param key         databasename\\0tablename\\0
  @param key_length  length of key in bytes, including the NUL bytes
  @param using_trx   flag: TRUE if using transactions, FALSE otherwise
*/
void mysql_query_cache_invalidate4(MYSQL_THD thd,
                                   const char *key, unsigned int key_length,
                                   int using_trx);


/**
  Provide a handler data getter to simplify coding
*/
void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);


/**
  Provide a handler data setter to simplify coding

  @details
  Set ha_data pointer (storage engine per-connection information).

  To avoid unclean deactivation (uninstall) of storage engine plugin
  in the middle of transaction, additional storage engine plugin
  lock is acquired.

  If ha_data is not null and storage engine plugin was not locked
  by thd_set_ha_data() in this connection before, storage engine
  plugin gets locked.

  If ha_data is null and storage engine plugin was locked by
  thd_set_ha_data() in this connection before, storage engine
  plugin lock gets released.

  If handlerton::close_connection() didn't reset ha_data, server does
  it immediately after calling handlerton::close_connection().
*/
void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
                     const void *ha_data);


/**
  Signal that the first part of handler commit is finished, and that the
  committed transaction is now visible and has fixed commit ordering with
  respect to other transactions. The commit need _not_ be durable yet, and
  typically will not be when this call makes sense.

  This call is optional, if the storage engine does not call it the upper
  layer will after the handler commit() method is done. However, the storage
  engine may choose to call it itself to increase the possibility for group
  commit.

  In-order parallel replication uses this to apply different transaction in
  parallel, but delay the commits of later transactions until earlier
  transactions have committed first, thus achieving increased performance on
  multi-core systems while still preserving full transaction consistency.

  The storage engine can call this from within the commit() method, typically
  after the commit record has been written to the transaction log, but before
  the log has been fsync()'ed. This will allow the next replicated transaction
  to proceed to commit before the first one has done fsync() or similar. Thus,
  it becomes possible for multiple sequential replicated transactions to share
  a single fsync() inside the engine in group commit.

  Note that this method should _not_ be called from within the commit_ordered()
  method, or any other place in the storage engine. When commit_ordered() is
  used (typically when binlog is enabled), the transaction coordinator takes
  care of this and makes group commit in the storage engine possible without
  any other action needed on the part of the storage engine. This function
  thd_wakeup_subsequent_commits() is only needed when no transaction
  coordinator is used, meaning a single storage engine and no binary log.
*/
void thd_wakeup_subsequent_commits(MYSQL_THD thd, int wakeup_error);

#ifdef __cplusplus
}
#endif

#endif

server/mysql/service_sha2.h000064400000012263150400263650011752 0ustar00#ifndef MYSQL_SERVICE_SHA2_INCLUDED
/* Copyright (c) 2017, MariaDB

   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 */

/**
  @file
  my sha2 service

  Functions to calculate SHA2 hash from a memory buffer
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

extern struct my_sha2_service_st {
  void (*my_sha224_type)(unsigned char*, const char*, size_t);
  void (*my_sha224_multi_type)(unsigned char*, ...);
  size_t (*my_sha224_context_size_type)();
  void (*my_sha224_init_type)(void *);
  void (*my_sha224_input_type)(void *, const unsigned char *, size_t);
  void (*my_sha224_result_type)(void *, unsigned char *);

  void (*my_sha256_type)(unsigned char*, const char*, size_t);
  void (*my_sha256_multi_type)(unsigned char*, ...);
  size_t (*my_sha256_context_size_type)();
  void (*my_sha256_init_type)(void *);
  void (*my_sha256_input_type)(void *, const unsigned char *, size_t);
  void (*my_sha256_result_type)(void *, unsigned char *);

  void (*my_sha384_type)(unsigned char*, const char*, size_t);
  void (*my_sha384_multi_type)(unsigned char*, ...);
  size_t (*my_sha384_context_size_type)();
  void (*my_sha384_init_type)(void *);
  void (*my_sha384_input_type)(void *, const unsigned char *, size_t);
  void (*my_sha384_result_type)(void *, unsigned char *);

  void (*my_sha512_type)(unsigned char*, const char*, size_t);
  void (*my_sha512_multi_type)(unsigned char*, ...);
  size_t (*my_sha512_context_size_type)();
  void (*my_sha512_init_type)(void *);
  void (*my_sha512_input_type)(void *, const unsigned char *, size_t);
  void (*my_sha512_result_type)(void *, unsigned char *);
} *my_sha2_service;

#ifdef MYSQL_DYNAMIC_PLUGIN

#define my_sha224(A,B,C) my_sha2_service->my_sha224_type(A,B,C)
#define my_sha224_multi my_sha2_service->my_sha224_multi_type
#define my_sha224_context_size() my_sha2_service->my_sha224_context_size_type()
#define my_sha224_init(A) my_sha2_service->my_sha224_init_type(A)
#define my_sha224_input(A,B,C) my_sha2_service->my_sha224_input_type(A,B,C)
#define my_sha224_result(A,B) my_sha2_service->my_sha224_result_type(A,B)

#define my_sha256(A,B,C) my_sha2_service->my_sha256_type(A,B,C)
#define my_sha256_multi my_sha2_service->my_sha256_multi_type
#define my_sha256_context_size() my_sha2_service->my_sha256_context_size_type()
#define my_sha256_init(A) my_sha2_service->my_sha256_init_type(A)
#define my_sha256_input(A,B,C) my_sha2_service->my_sha256_input_type(A,B,C)
#define my_sha256_result(A,B) my_sha2_service->my_sha256_result_type(A,B)

#define my_sha384(A,B,C) my_sha2_service->my_sha384_type(A,B,C)
#define my_sha384_multi my_sha2_service->my_sha384_multi_type
#define my_sha384_context_size() my_sha2_service->my_sha384_context_size_type()
#define my_sha384_init(A) my_sha2_service->my_sha384_init_type(A)
#define my_sha384_input(A,B,C) my_sha2_service->my_sha384_input_type(A,B,C)
#define my_sha384_result(A,B) my_sha2_service->my_sha384_result_type(A,B)

#define my_sha512(A,B,C) my_sha2_service->my_sha512_type(A,B,C)
#define my_sha512_multi my_sha2_service->my_sha512_multi_type
#define my_sha512_context_size() my_sha2_service->my_sha512_context_size_type()
#define my_sha512_init(A) my_sha2_service->my_sha512_init_type(A)
#define my_sha512_input(A,B,C) my_sha2_service->my_sha512_input_type(A,B,C)
#define my_sha512_result(A,B) my_sha2_service->my_sha512_result_type(A,B)

#else

void my_sha224(unsigned char*, const char*, size_t);
void my_sha224_multi(unsigned char*, ...);
size_t my_sha224_context_size();
void my_sha224_init(void *context);
void my_sha224_input(void *context, const unsigned char *buf, size_t len);
void my_sha224_result(void *context, unsigned char *digest);

void my_sha256(unsigned char*, const char*, size_t);
void my_sha256_multi(unsigned char*, ...);
size_t my_sha256_context_size();
void my_sha256_init(void *context);
void my_sha256_input(void *context, const unsigned char *buf, size_t len);
void my_sha256_result(void *context, unsigned char *digest);

void my_sha384(unsigned char*, const char*, size_t);
void my_sha384_multi(unsigned char*, ...);
size_t my_sha384_context_size();
void my_sha384_init(void *context);
void my_sha384_input(void *context, const unsigned char *buf, size_t len);
void my_sha384_result(void *context, unsigned char *digest);

void my_sha512(unsigned char*, const char*, size_t);
void my_sha512_multi(unsigned char*, ...);
size_t my_sha512_context_size();
void my_sha512_init(void *context);
void my_sha512_input(void *context, const unsigned char *buf, size_t len);
void my_sha512_result(void *context, unsigned char *digest);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_SHA2_INCLUDED
#endif

server/mysql/service_thd_rnd.h000064400000003556150400263650012544 0ustar00#ifndef MYSQL_SERVICE_THD_RND_INCLUDED
/* Copyright (C) 2017 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 */

/**
  @file
  This service provides access to the thd-local random number generator.

  It's preferable over the global one, because concurrent threads
  can generate random numbers without fighting each other over the access
  to the shared rnd state.
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif

extern struct thd_rnd_service_st {
  double (*thd_rnd_ptr)(MYSQL_THD thd);
  void   (*thd_c_r_p_ptr)(MYSQL_THD thd, char *to, size_t length);
} *thd_rnd_service;

#ifdef MYSQL_DYNAMIC_PLUGIN
#define thd_rnd(A) thd_rnd_service->thd_rnd_ptr(A)
#define thd_create_random_password(A,B,C) thd_rnd_service->thd_c_r_p_ptr(A,B,C)
#else

double thd_rnd(MYSQL_THD thd);

/**
  Generate string of printable random characters of requested length.

  @param to[out]      Buffer for generation; must be at least length+1 bytes
                      long; result string is always null-terminated
  @param length[in]   How many random characters to put in buffer
*/
void thd_create_random_password(MYSQL_THD thd, char *to, size_t length);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_THD_RND_INCLUDED
#endif
server/mysql/auth_dialog_client.h000064400000004015150400263650013207 0ustar00#ifndef MYSQL_AUTH_DIALOG_CLIENT_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @file

  Definitions needed to use Dialog client authentication plugin
*/

struct st_mysql;

#define MYSQL_AUTH_DIALOG_CLIENT_INCLUDED

/**
  type of the mysql_authentication_dialog_ask function

  @param mysql          mysql
  @param type           type of the input
                        1 - ordinary string input
                        2 - password string
  @param prompt         prompt
  @param buf            a buffer to store the use input
  @param buf_len        the length of the buffer

  @retval               a pointer to the user input string.
                        It may be equal to 'buf' or to 'mysql->password'.
                        In all other cases it is assumed to be an allocated
                        string, and the "dialog" plugin will free() it.
*/
typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
                      int type, const char *prompt, char *buf, int buf_len);

/**
  first byte of the question string is the question "type".
  It can be an "ordinary" or a "password" question.
  The last bit set marks a last question in the authentication exchange.
*/
#define ORDINARY_QUESTION       "\2"
#define LAST_QUESTION           "\3"
#define PASSWORD_QUESTION       "\4"
#define LAST_PASSWORD           "\5"

#endif
server/mysql/client_plugin.h000064400000014267150400263650012237 0ustar00#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
   Copyright (c) 2010, 2011, Oracle and/or its affiliates.

   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 */

/**
  @file

  MySQL Client Plugin API

  This file defines the API for plugins that work on the client side
*/
#define MYSQL_CLIENT_PLUGIN_INCLUDED

/*
  On Windows, exports from DLL need to be declared
  Also, plugin needs to be declared as extern "C" because MSVC 
  unlike other compilers, uses C++ mangling for variables not only
  for functions.
*/
#undef MYSQL_PLUGIN_EXPORT
#if defined(_MSC_VER)
  #define MYSQL_PLUGIN_EXPORT_C __declspec(dllexport)
#else /*_MSC_VER */
  #define MYSQL_PLUGIN_EXPORT_C
#endif
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C" MYSQL_PLUGIN_EXPORT_C
#define C_MODE_START    extern "C" {
#define C_MODE_END }
#else
#define MYSQL_PLUGIN_EXPORT MYSQL_PLUGIN_EXPORT_C
#define C_MODE_START
#define C_MODE_END
#endif

#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#include <stdlib.h>
#endif

/* known plugin types */
#define MYSQL_CLIENT_reserved1               0
#define MYSQL_CLIENT_reserved2               1
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN   2

#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION  0x0100

#define MYSQL_CLIENT_MAX_PLUGINS             3

#define mysql_declare_client_plugin(X)          \
     C_MODE_START MYSQL_PLUGIN_EXPORT_C         \
        struct st_mysql_client_plugin_ ## X        \
        _mysql_client_plugin_declaration_ = {   \
          MYSQL_CLIENT_ ## X ## _PLUGIN,        \
          MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
#define mysql_end_client_plugin             }; C_MODE_END

/* generic plugin header structure */
#define MYSQL_CLIENT_PLUGIN_HEADER                      \
  int type;                                             \
  unsigned int interface_version;                       \
  const char *name;                                     \
  const char *author;                                   \
  const char *desc;                                     \
  unsigned int version[3];                              \
  const char *license;                                  \
  void *mysql_api;                                      \
  int (*init)(char *, size_t, int, va_list);            \
  int (*deinit)();                                      \
  int (*options)(const char *option, const void *);

struct st_mysql_client_plugin
{
  MYSQL_CLIENT_PLUGIN_HEADER
};

struct st_mysql;

/******** authentication plugin specific declarations *********/
#include <mysql/plugin_auth_common.h>

struct st_mysql_client_plugin_AUTHENTICATION
{
  MYSQL_CLIENT_PLUGIN_HEADER
  int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
};

#include <mysql/auth_dialog_client.h>

/******** using plugins ************/

/**
  loads a plugin and initializes it

  @param mysql  MYSQL structure.
  @param name   a name of the plugin to load
  @param type   type of plugin that should be loaded, -1 to disable type check
  @param argc   number of arguments to pass to the plugin initialization
                function
  @param ...    arguments for the plugin initialization function

  @retval
  a pointer to the loaded plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
                  int argc, ...);

/**
  loads a plugin and initializes it, taking va_list as an argument

  This is the same as mysql_load_plugin, but take va_list instead of
  a list of arguments.

  @param mysql  MYSQL structure.
  @param name   a name of the plugin to load
  @param type   type of plugin that should be loaded, -1 to disable type check
  @param argc   number of arguments to pass to the plugin initialization
                function
  @param args   arguments for the plugin initialization function

  @retval
  a pointer to the loaded plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
                    int argc, va_list args);

/**
  finds an already loaded plugin by name, or loads it, if necessary

  @param mysql  MYSQL structure.
  @param name   a name of the plugin to load
  @param type   type of plugin that should be loaded

  @retval
  a pointer to the plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);

/**
  adds a plugin structure to the list of loaded plugins

  This is useful if an application has the necessary functionality
  (for example, a special load data handler) statically linked into
  the application binary. It can use this function to register the plugin
  directly, avoiding the need to factor it out into a shared object.

  @param mysql  MYSQL structure. It is only used for error reporting
  @param plugin an st_mysql_client_plugin structure to register

  @retval
  a pointer to the plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_client_register_plugin(struct st_mysql *mysql,
                             struct st_mysql_client_plugin *plugin);

/**
  set plugin options

  Can be used to set extra options and affect behavior for a plugin.
  This function may be called multiple times to set several options

  @param plugin an st_mysql_client_plugin structure
  @param option a string which specifies the option to set
  @param value  value for the option.

  @retval 0 on success, 1 in case of failure
**/
int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
                         const char *option, const void *value);
#endif

server/mysql/plugin_password_validation.h000064400000003021150400263650015017 0ustar00#ifndef MYSQL_PLUGIN_PASSWORD_VALIDATION_INCLUDED
/* Copyright (C) 2014 Sergei Golubchik and MariaDB

   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 */

/**
  @file

  Password Validation Plugin API.

  This file defines the API for server password validation plugins.
*/

#define MYSQL_PLUGIN_PASSWORD_VALIDATION_INCLUDED

#include <mysql/plugin.h>

#ifdef __cplusplus
extern "C" {
#endif

#define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0100

/**
  Password validation plugin descriptor
*/
struct st_mariadb_password_validation
{
  int interface_version;                        /**< version plugin uses */
  /**
    Function provided by the plugin which should perform password validation
    and return 0 if the password has passed the validation.
  */
  int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
                           const MYSQL_CONST_LEX_STRING *password);
};

#ifdef __cplusplus
}
#endif

#endif

server/mysql/service_thd_error_context.h000064400000006540150400263650014652 0ustar00#ifndef MYSQL_SERVICE_THD_STMT_DA_INCLUDED
/* Copyright (C) 2013 MariaDB Foundation.

   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 */

/**
  @file
  This service provides access to the statement diagnostics area:
  - error message
  - error number
  - row for warning (e.g. for multi-row INSERT statements)
*/

#ifdef __cplusplus
extern "C" {
#endif


extern struct thd_error_context_service_st {
  const char *(*thd_get_error_message_func)(const MYSQL_THD thd);
  unsigned int (*thd_get_error_number_func)(const MYSQL_THD thd);
  unsigned long (*thd_get_error_row_func)(const MYSQL_THD thd);
  void (*thd_inc_error_row_func)(MYSQL_THD thd);
  char *(*thd_get_error_context_description_func)(MYSQL_THD thd,
                                                  char *buffer,
                                                  unsigned int length,
                                                  unsigned int max_query_length);
} *thd_error_context_service;

#ifdef MYSQL_DYNAMIC_PLUGIN
#define thd_get_error_message(thd) \
  (thd_error_context_service->thd_get_error_message_func((thd)))
#define thd_get_error_number(thd) \
  (thd_error_context_service->thd_get_error_number_func((thd)))
#define thd_get_error_row(thd) \
  (thd_error_context_service->thd_get_error_row_func((thd)))
#define thd_inc_error_row(thd) \
  (thd_error_context_service->thd_inc_error_row_func((thd)))
#define thd_get_error_context_description(thd, buffer, length, max_query_len) \
  (thd_error_context_service->thd_get_error_context_description_func((thd), \
                                                                (buffer), \
                                                                (length), \
                                                                (max_query_len)))
#else
/**
  Return error message
  @param thd   user thread connection handle
  @return      error text
*/
const char *thd_get_error_message(const MYSQL_THD thd);
/**
  Return error number
  @param thd   user thread connection handle
  @return      error number
*/
unsigned int thd_get_error_number(const MYSQL_THD thd);
/**
  Return the current row number (i.e. in a multiple INSERT statement)
  @param thd   user thread connection handle
  @return      row number
*/
unsigned long thd_get_error_row(const MYSQL_THD thd);
/**
  Increment the current row number
  @param thd   user thread connection handle
*/
void thd_inc_error_row(MYSQL_THD thd);
/**
  Return a text description of a thread, its security context (user,host)
  and the current query.
*/
char *thd_get_error_context_description(MYSQL_THD thd,
                                        char *buffer, unsigned int length,
                                        unsigned int max_query_length);
#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_THD_STMT_DA_INCLUDED
#endif
server/mysql/service_thd_specifics.h000064400000007146150400263650013730 0ustar00#ifndef MYSQL_SERVICE_THD_SPECIFICS_INCLUDED
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @file

  THD specific for plugin(s)

  This API provides pthread_getspecific like functionality to plugin authors.
  This is a functional alternative to the declarative MYSQL_THDVAR

  A plugin should at init call thd_key_create that create a key that
  will have storage in each THD. The key should be used by all threads
  and can be used concurrently from all threads.

  A plugin should at deinit call thd_key_delete.

  Alternatively, a plugin can use thd_key_create_from_var(K,V) to create
  a key that corresponds to a named MYSQL_THDVAR variable.

  This API is also safe when using pool-of-threads in which case
  pthread_getspecific is not, because the actual OS thread may change.

  @note

  Normally one should prefer MYSQL_THDVAR declarative API.

  The benefits are:

  - It supports typed variables (int, char*, enum, etc), not only void*.
  - The memory allocated for MYSQL_THDVAR is free'd automatically
    (if PLUGIN_VAR_MEMALLOC is specified).
  - Continuous loading and unloading of the same plugin does not allocate
    memory for same variables over and over again.

  An example of using MYSQL_THDVAR for a thd local storage:

    MYSQL_THDVAR_STR(my_tls,
            PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT,
            "thd local storage example", 0, 0, 0);
*/

#ifdef __cplusplus
extern "C" {
#endif

typedef int MYSQL_THD_KEY_T;

extern struct thd_specifics_service_st {
  int (*thd_key_create_func)(MYSQL_THD_KEY_T *key);
  void (*thd_key_delete_func)(MYSQL_THD_KEY_T *key);
  void *(*thd_getspecific_func)(MYSQL_THD thd, MYSQL_THD_KEY_T key);
  int  (*thd_setspecific_func)(MYSQL_THD thd, MYSQL_THD_KEY_T key, void *value);
} *thd_specifics_service;

#define thd_key_create_from_var(K, V) do { *(K)= MYSQL_SYSVAR_NAME(V).offset; } while(0)

#ifdef MYSQL_DYNAMIC_PLUGIN

#define thd_key_create(K) (thd_specifics_service->thd_key_create_func(K))
#define thd_key_delete(K) (thd_specifics_service->thd_key_delete_func(K))
#define thd_getspecific(T, K) (thd_specifics_service->thd_getspecific_func(T, K))
#define thd_setspecific(T, K, V) (thd_specifics_service->thd_setspecific_func(T, K, V))

#else

/**
 * create THD specific storage
 * @return 0 on success
 *    else errno is returned
 */
int thd_key_create(MYSQL_THD_KEY_T *key);

/**
 * delete THD specific storage
 */
void thd_key_delete(MYSQL_THD_KEY_T *key);

/**
 * get/set thd specific storage
 *  - first time this is called from a thread it will return 0
 *  - this call is thread-safe in that different threads may call this
 *    simultaneously if operating on different THDs.
 *  - this call acquires no mutexes and is implemented as an array lookup
 */
void* thd_getspecific(MYSQL_THD thd, MYSQL_THD_KEY_T key);
int thd_setspecific(MYSQL_THD thd, MYSQL_THD_KEY_T key, void *value);

#endif

#ifdef __cplusplus
}
#endif

#define MYSQL_SERVICE_THD_SPECIFICS_INCLUDED
#endif

server/mysql/plugin_auth_common.h000064400000010635150400263650013265 0ustar00#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
   Copyright (c) 2010, Oracle and/or its affiliates.

   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 */

#ifdef _WIN32
#include <windows.h>
#endif

/**
  @file

  This file defines constants and data structures that are the same for
  both client- and server-side authentication plugins.
*/
#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED

/** the max allowed length for a user name */
#define MYSQL_USERNAME_LENGTH 512

/**
  return values of the plugin authenticate_user() method.
*/

 /**
  Authentication failed, plugin internal error.
  An error occurred in the authentication plugin itself.
  These errors are reported in table performance_schema.host_cache,
  column COUNT_AUTH_PLUGIN_ERRORS.
*/
#define CR_AUTH_PLUGIN_ERROR 3
/**
  Authentication failed, client server handshake.
  An error occurred during the client server handshake.
  These errors are reported in table performance_schema.host_cache,
  column COUNT_HANDSHAKE_ERRORS.
*/
#define CR_AUTH_HANDSHAKE 2
/**
  Authentication failed, user credentials.
  For example, wrong passwords.
  These errors are reported in table performance_schema.host_cache,
  column COUNT_AUTHENTICATION_ERRORS.
*/
#define CR_AUTH_USER_CREDENTIALS 1
/**
  Authentication failed. Additionally, all other CR_xxx values
  (libmysql error code) can be used too.

  The client plugin may set the error code and the error message directly
  in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error
  code was returned, an error message in the MYSQL structure will be
  overwritten. If CR_ERROR is returned without setting the error in MYSQL,
  CR_UNKNOWN_ERROR will be user.
*/
#define CR_ERROR 0
/**
  Authentication (client part) was successful. It does not mean that the
  authentication as a whole was successful, usually it only means
  that the client was able to send the user name and the password to the
  server. If CR_OK is returned, the libmysql reads the next packet expecting
  it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
*/
#define CR_OK -1
/**
  Authentication was successful.
  It means that the client has done its part successfully and also that
  a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN).
  In this case, libmysql will not read a packet from the server,
  but it will use the data at mysql->net.read_pos.

  A plugin may return this value if the number of roundtrips in the
  authentication protocol is not known in advance, and the client plugin
  needs to read one packet more to determine if the authentication is finished
  or not.
*/
#define CR_OK_HANDSHAKE_COMPLETE -2

typedef struct st_plugin_vio_info
{
  enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
         MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
  int socket;     /**< it's set, if the protocol is SOCKET or TCP */
#ifdef _WIN32
  HANDLE handle;  /**< it's set, if the protocol is PIPE or MEMORY */
#endif
} MYSQL_PLUGIN_VIO_INFO;

/**
  Provides plugin access to communication channel
*/
typedef struct st_plugin_vio
{
  /**
    Plugin provides a pointer reference and this function sets it to the
    contents of any incoming packet. Returns the packet length, or -1 if
    the plugin should terminate.
  */
  int (*read_packet)(struct st_plugin_vio *vio, 
                     unsigned char **buf);
  
  /**
    Plugin provides a buffer with data and the length and this
    function sends it as a packet. Returns 0 on success, 1 on failure.
  */
  int (*write_packet)(struct st_plugin_vio *vio, 
                      const unsigned char *packet, 
                      int packet_len);

  /**
    Fills in a st_plugin_vio_info structure, providing the information
    about the connection.
  */
  void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);

} MYSQL_PLUGIN_VIO;

#endif

server/mysql/service_wsrep.h000064400000033516150400263650012261 0ustar00#ifndef MYSQL_SERVICE_WSREP_INCLUDED
#define MYSQL_SERVICE_WSREP_INCLUDED

enum Wsrep_service_key_type
{
    WSREP_SERVICE_KEY_SHARED,
    WSREP_SERVICE_KEY_REFERENCE,
    WSREP_SERVICE_KEY_UPDATE,
    WSREP_SERVICE_KEY_EXCLUSIVE
};

#if (defined (MYSQL_DYNAMIC_PLUGIN) && defined(MYSQL_SERVICE_WSREP_DYNAMIC_INCLUDED)) || (!defined(MYSQL_DYNAMIC_PLUGIN) && defined(MYSQL_SERVICE_WSREP_STATIC_INCLUDED))

#else

/* Copyright (c) 2015, 2020, MariaDB Corporation Ab
                 2018 Codership Oy <info@codership.com>

   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 */

/**
  @file
  wsrep service

  Interface to WSREP functionality in the server.
  For engines that want to support galera.
*/
#include <my_pthread.h>
#ifdef __cplusplus
#endif

struct xid_t;
struct wsrep_ws_handle;
struct wsrep_buf;

/* Must match to definition in sql/mysqld.h */
typedef int64 query_id_t;


extern struct wsrep_service_st {
  my_bool                     (*get_wsrep_recovery_func)();
  bool                        (*wsrep_consistency_check_func)(MYSQL_THD thd);
  int                         (*wsrep_is_wsrep_xid_func)(const void *xid);
  long long                   (*wsrep_xid_seqno_func)(const struct xid_t *xid);
  const unsigned char*        (*wsrep_xid_uuid_func)(const struct xid_t *xid);
  my_bool                     (*wsrep_on_func)(const MYSQL_THD thd);
  bool                        (*wsrep_prepare_key_for_innodb_func)(MYSQL_THD thd, const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*);
  void                        (*wsrep_thd_LOCK_func)(const MYSQL_THD thd);
  int                         (*wsrep_thd_TRYLOCK_func)(const MYSQL_THD thd);
  void                        (*wsrep_thd_UNLOCK_func)(const MYSQL_THD thd);
  const char *                (*wsrep_thd_query_func)(const MYSQL_THD thd);
  int                         (*wsrep_thd_retry_counter_func)(const MYSQL_THD thd);
  bool                        (*wsrep_thd_ignore_table_func)(MYSQL_THD thd);
  long long                   (*wsrep_thd_trx_seqno_func)(const MYSQL_THD thd);
  my_bool                     (*wsrep_thd_is_aborting_func)(const MYSQL_THD thd);
  void                        (*wsrep_set_data_home_dir_func)(const char *data_dir);
  my_bool                     (*wsrep_thd_is_BF_func)(const MYSQL_THD thd, my_bool sync);
  my_bool                     (*wsrep_thd_is_local_func)(const MYSQL_THD thd);
  void                        (*wsrep_thd_self_abort_func)(MYSQL_THD thd);
  int                         (*wsrep_thd_append_key_func)(MYSQL_THD thd, const struct wsrep_key* key,
                                                           int n_keys, enum Wsrep_service_key_type);
  int                         (*wsrep_thd_append_table_key_func)(MYSQL_THD thd, const char* db,
                                                           const char* table, enum Wsrep_service_key_type);
  my_bool                     (*wsrep_thd_is_local_transaction)(const MYSQL_THD thd);
  const char*                 (*wsrep_thd_client_state_str_func)(const MYSQL_THD thd);
  const char*                 (*wsrep_thd_client_mode_str_func)(const MYSQL_THD thd);
  const char*                 (*wsrep_thd_transaction_state_str_func)(const MYSQL_THD thd);
  query_id_t                  (*wsrep_thd_transaction_id_func)(const MYSQL_THD thd);
  my_bool                     (*wsrep_thd_bf_abort_func)(MYSQL_THD bf_thd,
                                                         MYSQL_THD victim_thd,
                                                         my_bool signal);
  my_bool                     (*wsrep_thd_order_before_func)(const MYSQL_THD left, const MYSQL_THD right);
  void                        (*wsrep_handle_SR_rollback_func)(MYSQL_THD BF_thd, MYSQL_THD victim_thd);
  my_bool                     (*wsrep_thd_skip_locking_func)(const MYSQL_THD thd);
  const char*                 (*wsrep_get_sr_table_name_func)();
  my_bool                     (*wsrep_get_debug_func)();
  void                        (*wsrep_commit_ordered_func)(MYSQL_THD thd);
  my_bool                     (*wsrep_thd_is_applying_func)(const MYSQL_THD thd);
  ulong                       (*wsrep_OSU_method_get_func)(const MYSQL_THD thd);
  my_bool                     (*wsrep_thd_has_ignored_error_func)(const MYSQL_THD thd);
  void                        (*wsrep_thd_set_ignored_error_func)(MYSQL_THD thd, my_bool val);
  void                        (*wsrep_report_bf_lock_wait_func)(const MYSQL_THD thd,
                                                                unsigned long long trx_id);
  void                        (*wsrep_thd_kill_LOCK_func)(const MYSQL_THD thd);
  void                        (*wsrep_thd_kill_UNLOCK_func)(const MYSQL_THD thd);
  void                        (*wsrep_thd_set_wsrep_PA_unsafe_func)(MYSQL_THD thd);
  uint32                      (*wsrep_get_domain_id_func)();
} *wsrep_service;

#define MYSQL_SERVICE_WSREP_INCLUDED
#endif

#ifdef MYSQL_DYNAMIC_PLUGIN

#define MYSQL_SERVICE_WSREP_DYNAMIC_INCLUDED
#define get_wsrep_recovery() wsrep_service->get_wsrep_recovery_func()
#define wsrep_consistency_check(T) wsrep_service->wsrep_consistency_check_func(T)
#define wsrep_is_wsrep_xid(X) wsrep_service->wsrep_is_wsrep_xid_func(X)
#define wsrep_xid_seqno(X) wsrep_service->wsrep_xid_seqno_func(X)
#define wsrep_xid_uuid(X) wsrep_service->wsrep_xid_uuid_func(X)
#define wsrep_on(thd) (thd) && WSREP_ON && wsrep_service->wsrep_on_func(thd)
#define wsrep_prepare_key_for_innodb(A,B,C,D,E,F,G) wsrep_service->wsrep_prepare_key_for_innodb_func(A,B,C,D,E,F,G)
#define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T)
#define wsrep_thd_TRYLOCK(T) wsrep_service->wsrep_thd_TRYLOCK_func(T)
#define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T)
#define wsrep_thd_kill_LOCK(T) wsrep_service->wsrep_thd_kill_LOCK_func(T)
#define wsrep_thd_kill_UNLOCK(T) wsrep_service->wsrep_thd_kill_UNLOCK_func(T)
#define wsrep_thd_query(T) wsrep_service->wsrep_thd_query_func(T)
#define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T)
#define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T)
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
#define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A)
#define wsrep_thd_is_BF(T,S) wsrep_service->wsrep_thd_is_BF_func(T,S)
#define wsrep_thd_is_aborting(T) wsrep_service->wsrep_thd_is_aborting_func(T)
#define wsrep_thd_is_local(T) wsrep_service->wsrep_thd_is_local_func(T)
#define wsrep_thd_self_abort(T) wsrep_service->wsrep_thd_self_abort_func(T)
#define wsrep_thd_append_key(T,W,N,K) wsrep_service->wsrep_thd_append_key_func(T,W,N,K)
#define wsrep_thd_append_table_key(T,D,B,K) wsrep_service->wsrep_thd_append_table_key_func(T,D,B,K)
#define wsrep_thd_is_local_transaction(T) wsrep_service->wsrep_thd_is_local_transaction_func(T)
#define wsrep_thd_client_state_str(T) wsrep_service->wsrep_thd_client_state_str_func(T)
#define wsrep_thd_client_mode_str(T) wsrep_service->wsrep_thd_client_mode_str_func(T)
#define wsrep_thd_transaction_state_str(T) wsrep_service->wsrep_thd_transaction_state_str_func(T)
#define wsrep_thd_transaction_id(T) wsrep_service->wsrep_thd_transaction_id_func(T)
#define wsrep_thd_bf_abort(T,T2,S) wsrep_service->wsrep_thd_bf_abort_func(T,T2,S)
#define wsrep_thd_order_before(L,R) wsrep_service->wsrep_thd_order_before_func(L,R)
#define wsrep_handle_SR_rollback(B,V) wsrep_service->wsrep_handle_SR_rollback_func(B,V)
#define wsrep_thd_skip_locking(T) wsrep_service->wsrep_thd_skip_locking_func(T)
#define wsrep_get_sr_table_name() wsrep_service->wsrep_get_sr_table_name_func()
#define wsrep_get_debug() wsrep_service->wsrep_get_debug_func()
#define wsrep_commit_ordered(T) wsrep_service->wsrep_commit_ordered_func(T)
#define wsrep_thd_is_applying(T) wsrep_service->wsrep_thd_is_applying_func(T)
#define wsrep_OSU_method_get(T) wsrep_service->wsrep_OSU_method_get_func(T)
#define wsrep_thd_has_ignored_error(T) wsrep_service->wsrep_thd_has_ignored_error_func(T)
#define wsrep_thd_set_ignored_error(T,V) wsrep_service->wsrep_thd_set_ignored_error_func(T,V)
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
#define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T)
#define wsrep_get_domain_id(T) wsrep_service->wsrep_get_domain_id_func(T)
#else

#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
extern ulong   wsrep_debug;
extern my_bool wsrep_log_conflicts;
extern my_bool wsrep_certify_nonPK;
extern my_bool wsrep_load_data_splitting;
extern my_bool wsrep_drupal_282555_workaround;
extern my_bool wsrep_recovery;
extern long wsrep_protocol_version;

extern "C" bool wsrep_consistency_check(MYSQL_THD thd);
bool wsrep_prepare_key_for_innodb(MYSQL_THD thd, const unsigned char* cache_key, size_t cache_key_len, const unsigned char* row_id, size_t row_id_len, struct wsrep_buf* key, size_t* key_len);
extern "C" const char *wsrep_thd_query(const MYSQL_THD thd);
extern "C" int wsrep_is_wsrep_xid(const void* xid);
extern "C" long long wsrep_xid_seqno(const struct xid_t* xid);
const unsigned char* wsrep_xid_uuid(const struct xid_t* xid);
extern "C" long long wsrep_thd_trx_seqno(const MYSQL_THD thd);
my_bool get_wsrep_recovery();
bool wsrep_thd_ignore_table(MYSQL_THD thd);
void wsrep_set_data_home_dir(const char *data_dir);

/* from mysql wsrep-lib */
#include "my_global.h"
#include "my_pthread.h"

/* Return true if wsrep is enabled for a thd. This means that
   wsrep is enabled globally and the thd has wsrep on */
extern "C" my_bool wsrep_on(const MYSQL_THD thd);
/* Lock thd wsrep lock */
extern "C" void wsrep_thd_LOCK(const MYSQL_THD thd);
/* Try thd wsrep lock. Return non-zero if lock could not be taken. */
extern "C" int wsrep_thd_TRYLOCK(const MYSQL_THD thd);
/* Unlock thd wsrep lock */
extern "C" void wsrep_thd_UNLOCK(const MYSQL_THD thd);

extern "C" void wsrep_thd_kill_LOCK(const MYSQL_THD thd);
extern "C" void wsrep_thd_kill_UNLOCK(const MYSQL_THD thd);

/* Return thd client state string */
extern "C" const char* wsrep_thd_client_state_str(const MYSQL_THD thd);
/* Return thd client mode string */
extern "C" const char* wsrep_thd_client_mode_str(const MYSQL_THD thd);
/* Return thd transaction state string */
extern "C" const char* wsrep_thd_transaction_state_str(const MYSQL_THD thd);

/* Return current transaction id */
extern "C" query_id_t wsrep_thd_transaction_id(const MYSQL_THD thd);
/* Mark thd own transaction as aborted */
extern "C" void wsrep_thd_self_abort(MYSQL_THD thd);
/* Return true if thd is in replicating mode */
extern "C" my_bool wsrep_thd_is_local(const MYSQL_THD thd);
/* Return true if thd is in high priority mode */
/* todo: rename to is_high_priority() */
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
/* Return true if thd is in TOI mode */
extern "C" my_bool wsrep_thd_is_toi(const MYSQL_THD thd);
/* Return true if thd is in replicating TOI mode */
extern "C" my_bool wsrep_thd_is_local_toi(const MYSQL_THD thd);
/* Return true if thd is in RSU mode */
extern "C" my_bool wsrep_thd_is_in_rsu(const MYSQL_THD thd);
/* Return true if thd is in BF mode, either high_priority or TOI */
extern "C" my_bool wsrep_thd_is_BF(const MYSQL_THD thd, my_bool sync);
/* Return true if thd is streaming in progress */
extern "C" my_bool wsrep_thd_is_SR(const MYSQL_THD thd);
extern "C" void wsrep_handle_SR_rollback(MYSQL_THD BF_thd, MYSQL_THD victim_thd);
/* Return thd retry counter */
extern "C" int wsrep_thd_retry_counter(const MYSQL_THD thd);
/* BF abort victim_thd */
extern "C" my_bool wsrep_thd_bf_abort(MYSQL_THD bf_thd,
                                      MYSQL_THD victim_thd,
                                      my_bool signal);
/* Return true if left thd is ordered before right thd */
extern "C" my_bool wsrep_thd_order_before(const MYSQL_THD left, const MYSQL_THD right);
/* Return true if thd should skip locking. This means that the thd
   is operating on shared resource inside commit order critical section. */
extern "C" my_bool wsrep_thd_skip_locking(const MYSQL_THD thd);
/* Return true if thd is aborting */
extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd);

struct wsrep_key;
struct wsrep_key_array;
extern "C" int wsrep_thd_append_key(MYSQL_THD thd,
                                    const struct wsrep_key* key,
                                    int n_keys,
                                    enum Wsrep_service_key_type);

extern "C" int wsrep_thd_append_table_key(MYSQL_THD thd,
                                    const char* db,
                                    const char* table,
                                    enum Wsrep_service_key_type);

extern "C" my_bool wsrep_thd_is_local_transaction(const MYSQL_THD thd);

extern const char* wsrep_sr_table_name_full;

extern "C" const char* wsrep_get_sr_table_name();

extern "C" my_bool wsrep_get_debug();

extern "C" void wsrep_commit_ordered(MYSQL_THD thd);
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
extern "C" ulong wsrep_OSU_method_get(const MYSQL_THD thd);
extern "C" my_bool wsrep_thd_has_ignored_error(const MYSQL_THD thd);
extern "C" void wsrep_thd_set_ignored_error(MYSQL_THD thd, my_bool val);
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
                                          unsigned long long trx_id);
/* declare parallel applying unsafety for the THD */
extern "C" void wsrep_thd_set_PA_unsafe(MYSQL_THD thd);
extern "C" uint32 wsrep_get_domain_id();
#endif
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */
server/mysql/plugin_function.h000064400000002635150400263650012602 0ustar00#ifndef MARIADB_PLUGIN_FUNCTION_INCLUDED
#define MARIADB_PLUGIN_FUNCTION_INCLUDED
/* Copyright (C) 2019, Alexander Barkov and MariaDB

   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 */

/**
  @file

  Function Plugin API.

  This file defines the API for server plugins that manage functions.
*/

#ifdef __cplusplus

#include <mysql/plugin.h>

/*
  API for function plugins. (MariaDB_FUNCTION_PLUGIN)
*/
#define MariaDB_FUNCTION_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)


class Plugin_function
{
  int m_interface_version;
  Create_func *m_builder;
public:
  Plugin_function(Create_func *builder)
   :m_interface_version(MariaDB_FUNCTION_INTERFACE_VERSION),
    m_builder(builder)
  { }
  Create_func *create_func()
  {
    return m_builder;
  }
};


#endif /* __cplusplus */

#endif /* MARIADB_PLUGIN_FUNCTION_INCLUDED */
server/my_compiler.h000064400000012222150400263660010543 0ustar00#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED

/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 2022, 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 */

/**
  Header for compiler-dependent features.

  Intended to contain a set of reusable wrappers for preprocessor
  macros, attributes, pragmas, and any other features that are
  specific to a target compiler.
*/

/**
  Compiler-dependent internal convenience macros.
*/

/* C vs C++ */
#ifdef __cplusplus
#define CONSTEXPR constexpr
#else
#define CONSTEXPR
#endif /* __cplusplus */


/* GNU C/C++ */
#if defined __GNUC__
# define MY_ALIGN_EXT

/*
  __builtin_unreachable() removes the "statement may fall through" warning-as-
  error when MY_ASSERT_UNREACHABLE() is used in "case xxx:" in switch (...)
  statements.
  abort() is there to prevent the execution from reaching the
  __builtin_unreachable() as this may cause misleading stack traces.
*/
# define MY_ASSERT_UNREACHABLE()  { abort(); __builtin_unreachable(); }

/* Microsoft Visual C++ */
#elif defined _MSC_VER
# define MY_ALIGNOF(type)   __alignof(type)
# define MY_ALIGNED(n)      __declspec(align(n))

/* Oracle Solaris Studio */
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if __SUNPRO_C >= 0x590
#   define MY_ALIGN_EXT
# endif

/* IBM XL C/C++ */
#elif defined __xlC__
# if __xlC__ >= 0x0600
#   define MY_ALIGN_EXT
# endif

/* HP aCC */
#elif defined(__HP_aCC) || defined(__HP_cc)
# if (__HP_aCC >= 60000) || (__HP_cc >= 60000)
#   define MY_ALIGN_EXT
# endif
#endif

#ifdef MY_ALIGN_EXT
/** Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type)   __alignof__(type)
/** Determine the alignment requirement of a type. */
# define MY_ALIGNED(n)      __attribute__((__aligned__((n))))
#endif

/**
  Generic (compiler-independent) features.
*/

#ifndef MY_ALIGNOF
# ifdef __cplusplus
    template<typename type> struct my_alignof_helper { char m1; type m2; };
    /* Invalid for non-POD types, but most compilers give the right answer. */
#   define MY_ALIGNOF(type)   offsetof(my_alignof_helper<type>, m2)
# else
#   define MY_ALIGNOF(type)   offsetof(struct { char m1; type m2; }, m2)
# endif
#endif

#ifndef MY_ASSERT_UNREACHABLE
# define MY_ASSERT_UNREACHABLE()  do { abort(); } while (0)
#endif

/**
  C++ Type Traits
*/

#ifdef __cplusplus

/**
  Opaque storage with a particular alignment.
*/
# if defined(MY_ALIGNED)
/* Partial specialization used due to MSVC++. */
template<size_t alignment> struct my_alignment_imp;
template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
/* ... expand as necessary. */
# else
template<size_t alignment>
struct my_alignment_imp { double m1; };
# endif

/**
  A POD type with a given size and alignment.

  @remark If the compiler does not support a alignment attribute
          (MY_ALIGN macro), the default alignment of a double is
          used instead.

  @tparam size        The minimum size.
  @tparam alignment   The desired alignment: 1, 2, 4, 8 or 16.
*/
template <size_t size, size_t alignment>
struct my_aligned_storage
{
  union
  {
    char data[size];
    my_alignment_imp<alignment> align;
  };
};

#endif /* __cplusplus */

# ifndef MY_ALIGNED
/*
  Make sure MY_ALIGNED can be used also on platforms where we don't
  have a way of aligning data structures.
*/
#define MY_ALIGNED(size)
#endif

#ifdef __GNUC__
# define ATTRIBUTE_NORETURN __attribute__((noreturn))
# define ATTRIBUTE_NOINLINE __attribute__((noinline))
/** Starting with GCC 4.3, the "cold" attribute is used to inform the
compiler that a function is unlikely executed.  The function is
optimized for size rather than speed and on many targets it is placed
into special subsection of the text section so all cold functions
appears close together improving code locality of non-cold parts of
program.  The paths leading to call of cold functions within code are
marked as unlikely by the branch prediction mechanism.  optimize a
rarely invoked function for size instead for speed. */
# define ATTRIBUTE_COLD __attribute__((cold))
#elif defined _MSC_VER
# define ATTRIBUTE_NORETURN __declspec(noreturn)
# define ATTRIBUTE_NOINLINE __declspec(noinline)
#else
# define ATTRIBUTE_NORETURN /* empty */
# define ATTRIBUTE_NOINLINE /* empty */
#endif

#ifndef ATTRIBUTE_COLD
# define ATTRIBUTE_COLD /* empty */
#endif

#include <my_attribute.h>

#endif /* MY_COMPILER_INCLUDED */
server/m_string.h000064400000024112150400263660010047 0ustar00/*
   Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2019, 2021, 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 */

/* There may be problems included in all of these. Try to test in
   configure which ones are needed? */

/*  This is needed for the definitions of strchr... on solaris */

#ifndef _m_string_h
#define _m_string_h

#include "my_decimal_limits.h"

#ifndef __USE_GNU
#define __USE_GNU				/* We want to use stpcpy */
#endif
#if defined(HAVE_STRINGS_H)
#include <strings.h>
#endif
#if defined(HAVE_STRING_H)
#include <string.h>
#endif

/*  This is needed for the definitions of memcpy... on solaris */
#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
#include <memory.h>
#endif

#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
# define memcpy(d, s, n)	bcopy ((s), (d), (n))
# define memset(A,C,B)		bfill((A),(B),(C))
# define memmove(d, s, n)	bmove ((d), (s), (n))
#elif defined(HAVE_MEMMOVE)
# define bmove(d, s, n)		memmove((d), (s), (n))
#endif

/* Unixware 7 */
#if !defined(HAVE_BFILL)
# define bfill(A,B,C)           memset((A),(C),(B))
#endif

# define bmove_align(A,B,C)     memcpy((A),(B),(C))

# define bcmp(A,B,C)		memcmp((A),(B),(C))

#if !defined(bzero)
# define bzero(A,B)             memset((A),0,(B))
#endif

#if defined(__cplusplus)
extern "C" {
#endif

#ifdef DBUG_OFF
#if defined(HAVE_STPCPY) && defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define strmov(A,B) __builtin_stpcpy((A),(B))
#elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B))
#endif
#endif

/* Declared in int2str() */
extern const char _dig_vec_upper[];
extern const char _dig_vec_lower[];

extern char *strmov_overlapp(char *dest, const char *src);

#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define LINT_INIT_STRUCT(var) bzero(&var, sizeof(var)) /* No uninitialize-warning */
#else
#define LINT_INIT_STRUCT(var)
#endif

/* Prototypes for string functions */

extern	void bmove_upp(uchar *dst,const uchar *src,size_t len);
extern	void bchange(uchar *dst,size_t old_len,const uchar *src,
		     size_t new_len,size_t tot_len);
extern	void strappend(char *s,size_t len,pchar fill);
extern	char *strend(const char *s);
extern  char *strcend(const char *, pchar);
extern	char *strfill(char * s,size_t len,pchar fill);
extern	char *strmake(char *dst,const char *src,size_t length);

#if !defined(__GNUC__) || (__GNUC__ < 4)
#define strmake_buf(D,S)        strmake(D, S, sizeof(D) - 1)
#else
#define strmake_buf(D,S) ({                             \
  __typeof__ (D) __x __attribute__((unused)) = { 2 };   \
  strmake(D, S, sizeof(D) - 1);                         \
  })
#endif

#ifndef strmov
extern	char *strmov(char *dst,const char *src);
#endif
extern	char *strnmov(char *dst, const char *src, size_t n);
extern	char *strcont(const char *src, const char *set);
extern	char *strxmov(char *dst, const char *src, ...);
extern	char *strxnmov(char *dst, size_t len, const char *src, ...);

/* Prototypes of normal stringfunctions (with may ours) */
#ifndef HAVE_STRNLEN
extern size_t strnlen(const char *s, size_t n);
#endif

extern int is_prefix(const char *, const char *);

/* Conversion routines */
typedef enum {
  MY_GCVT_ARG_FLOAT,
  MY_GCVT_ARG_DOUBLE
} my_gcvt_arg_type;

double my_strtod(const char *str, char **end, int *error);
double my_atof(const char *nptr);
size_t my_fcvt(double x, int precision, char *to, my_bool *error);
size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
               my_bool *error);

/*
  The longest string my_fcvt can return is 311 + "precision" bytes.
  Here we assume that we never cal my_fcvt() with
  precision >= DECIMAL_NOT_SPECIFIED
  (+ 1 byte for the terminating '\0').
*/
#define FLOATING_POINT_BUFFER (311 + DECIMAL_NOT_SPECIFIED)

/*
  We want to use the 'e' format in some cases even if we have enough space
  for the 'f' one just to mimic sprintf("%.15g") behavior for large integers,
  and to improve it for numbers < 10^(-4).
  That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require
  it to be integer and be <= 10^DBL_DIG for the 'f' format to be used.
  We don't lose precision, but make cases like "1e200" or "0.00001" look nicer.
*/
#define MAX_DECPT_FOR_F_FORMAT DBL_DIG

/*
  The maximum possible field width for my_gcvt() conversion.
  (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or
  MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used).
*/
#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + MY_MAX(5, MAX_DECPT_FOR_F_FORMAT)) \

extern char *llstr(longlong value,char *buff);
extern char *ullstr(longlong value,char *buff);
#ifndef HAVE_STRTOUL
extern long strtol(const char *str, char **ptr, int base);
extern ulong strtoul(const char *str, char **ptr, int base);
#endif

extern char *int2str(long val, char *dst, int radix, int upcase);
extern char *int10_to_str(long val,char *dst,int radix);
extern char *str2int(const char *src,int radix,long lower,long upper,
			 long *val);
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
#if SIZEOF_LONG == SIZEOF_LONG_LONG
#define ll2str(A,B,C,D) int2str((A),(B),(C),(D))
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
#undef strtoll
#define strtoll(A,B,C) strtol((A),(B),(C))
#define strtoull(A,B,C) strtoul((A),(B),(C))
#ifndef HAVE_STRTOULL
#define HAVE_STRTOULL
#endif
#ifndef HAVE_STRTOLL
#define HAVE_STRTOLL
#endif
#else
#ifdef HAVE_LONG_LONG
extern char *ll2str(longlong val,char *dst,int radix, int upcase);
extern char *longlong10_to_str(longlong val,char *dst,int radix);
#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO))
extern longlong strtoll(const char *str, char **ptr, int base);
extern ulonglong strtoull(const char *str, char **ptr, int base);
#endif
#endif
#endif
#define longlong2str(A,B,C) ll2str((A),(B),(C),1)

#if defined(__cplusplus)
}
#endif

#include <mysql/plugin.h>

#ifdef __cplusplus
#include <type_traits>
template<typename T> inline const char *_swl_check(T s)
{
  static_assert(std::is_same<T, const char (&)[sizeof(T)]>::value
             || std::is_same<T, const char [sizeof(T)]>::value,
             "Wrong argument for STRING_WITH_LEN()");
  return s;
}
#define STRING_WITH_LEN(X) _swl_check<decltype(X)>(X), ((size_t) (sizeof(X) - 1))
#else
#define STRING_WITH_LEN(X) (X ""), ((size_t) (sizeof(X) - 1))
#endif

#define USTRING_WITH_LEN(X) (uchar*) STRING_WITH_LEN(X)
#define C_STRING_WITH_LEN(X) (char *) STRING_WITH_LEN(X)
#define LEX_STRING_WITH_LEN(X) (X).str, (X).length

typedef struct st_mysql_const_lex_string LEX_CSTRING;

/* A variant with const and unsigned */
struct st_mysql_const_unsigned_lex_string
{
  const uchar *str;
  size_t length;
};
typedef struct st_mysql_const_unsigned_lex_string LEX_CUSTRING;

static inline void lex_string_set(LEX_CSTRING *lex_str, const char *c_str)
{
  lex_str->str= c_str;
  lex_str->length= strlen(c_str);
}
static inline void lex_string_set3(LEX_CSTRING *lex_str, const char *c_str,
                                   size_t len)
{
  lex_str->str= c_str;
  lex_str->length= len;
}

/**
  Copies a string.

  @param dst        destination buffer, will be NUL padded.
  @param dst_size   size of dst buffer, must be > 0
  @param src        NUL terminated source string
*/
static inline void safe_strcpy(char *dst, size_t dst_size, const char *src)
{
  DBUG_ASSERT(dst_size > 0);

  /* 1) IF there is a 0 byte in the first dst_size bytes of src, strncpy will
   *    0-terminate dst, and pad dst with additional 0 bytes out to dst_size.
   *
   * 2) IF there is no 0 byte in the first dst_size bytes of src, strncpy will
   *    copy dst_size bytes, and the final byte won't be 0.
   *
   * In GCC 8+, the `-Wstringop-truncation` warning may object to strncpy()
   * being used in this way, so we need to disable this warning for this
   * single statement.
   */

#if defined __GNUC__ && __GNUC__ >= 8
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
  strncpy(dst, src, dst_size);
#if defined __GNUC__ && __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
  dst[dst_size - 1]= 0;
}

/**
  Copies a string, checking for truncation.

  @param dst        destination buffer, will be NUL padded.
  @param dst_size   size of dst buffer, must be > 0
  @param src        NUL terminated source string

  @retval 1 if the src string was truncated due to too small size of dst.
  @retval 0 if src completely fit within dst,
*/
static inline int safe_strcpy_truncated(char *dst, size_t dst_size,
                                        const char *src)
{

  DBUG_ASSERT(dst_size > 0);
  if (dst_size == 0)
    return 1;
  /*
    We do not want to use strncpy() as we do not want to rely on
    strncpy() filling the unused dst with 0.
    We cannot use strmake() here as it in debug mode fills the buffers
    with 'Z'.
  */
  if (strnmov(dst, src, dst_size) == dst+dst_size)
  {
    dst[dst_size-1]= 0;
    return 1;
  }
  return 0;
}

/**
  Appends src to dst and ensures dst is a NUL terminated C string.

  @retval 1 if the src string was truncated due to too small size of dst.
  @retval 0 if src completely fit within the remaining dst space,
  including NUL termination.
*/
static inline int safe_strcat(char *dst, size_t dst_size, const char *src)
{
  size_t init_len= strlen(dst);
  if (init_len >= dst_size)
    return 1;
  return safe_strcpy_truncated(dst + init_len, dst_size - init_len, src);
}

#ifdef __cplusplus
static inline char *safe_str(char *str)
{ return str ? str : const_cast<char*>(""); }
#endif

static inline const char *safe_str(const char *str)
{ return str ? str : ""; }

static inline size_t safe_strlen(const char *str)
{ return str ? strlen(str) : 0; }

#endif
server/mysql.h000064400000115460150400263660007401 0ustar00/*
   Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2012, Monty Program Ab.

   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 */

/*
  This file defines the client API to MySQL and also the ABI of the
  dynamically linked libmysqlclient.

  The ABI should never be changed in a released product of MySQL,
  thus you need to take great care when changing the file. In case
  the file is changed so the ABI is broken, you must also update
  the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake
*/

#ifndef _mysql_h
#define _mysql_h

#ifdef _AIX           /* large-file support will break without this */
#include <standards.h>
#endif


#ifdef	__cplusplus
extern "C" {
#endif

#ifndef MY_GLOBAL_INCLUDED				/* If not standard header */
#ifndef MYSQL_ABI_CHECK
#include <sys/types.h>
#endif

#ifndef MYSQL_PLUGIN_INCLUDED
typedef char my_bool;
#endif

#if !defined(_WIN32)
#define STDCALL
#else
#define STDCALL __stdcall
#endif

#ifndef my_socket_defined
#if defined (_WIN64)
#define my_socket unsigned long long
#elif defined (_WIN32)
#define my_socket unsigned int
#else
typedef int my_socket;
#endif /* _WIN64 */
#endif /* my_socket_defined */
#endif /* MY_GLOBAL_INCLUDED */

#include "mariadb_capi_rename.h"
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"

#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */

extern unsigned int mariadb_deinitialize_ssl;
extern unsigned int mysql_port;
extern char *mysql_unix_port;

#define CLIENT_NET_READ_TIMEOUT		(365*24*3600)	/* Timeout on read */
#define CLIENT_NET_WRITE_TIMEOUT	(365*24*3600)	/* Timeout on write */

#define IS_PRI_KEY(n)	((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n)	((n) & NOT_NULL_FLAG)
#define IS_BLOB(n)	((n) & BLOB_FLAG)
/**
   Returns true if the value is a number which does not need quotes for
   the sql_lex.cc parser to parse correctly.
*/
#define IS_NUM(t)	(((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)


typedef struct st_mysql_const_lex_string MARIADB_CONST_STRING;


typedef struct st_mysql_field {
  char *name;                 /* Name of column */
  char *org_name;             /* Original column name, if an alias */
  char *table;                /* Table of column if column was a field */
  char *org_table;            /* Org table name, if table was an alias */
  char *db;                   /* Database for table */
  char *catalog;	      /* Catalog for table */
  char *def;                  /* Default value (set by mysql_list_fields) */
  unsigned long length;       /* Width of column (create length) */
  unsigned long max_length;   /* Max width for selected set */
  unsigned int name_length;
  unsigned int org_name_length;
  unsigned int table_length;
  unsigned int org_table_length;
  unsigned int db_length;
  unsigned int catalog_length;
  unsigned int def_length;
  unsigned int flags;         /* Div flags */
  unsigned int decimals;      /* Number of decimals in field */
  unsigned int charsetnr;     /* Character set */
  enum enum_field_types type; /* Type of field. See mysql_com.h for types */
  void *extension;
} MYSQL_FIELD;

typedef char **MYSQL_ROW;		/* return data as array of strings */
typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */

#ifndef MY_GLOBAL_INCLUDED
#if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong;
#elif defined (_WIN32)
typedef unsigned __int64 my_ulonglong;
#else
typedef unsigned long long my_ulonglong;
#endif
#endif

#include "typelib.h"

#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)

/* backward compatibility define - to be removed eventually */
#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
#define WARN_PLUGIN_DELETE_BUILTIN ER_PLUGIN_DELETE_BUILTIN
#define ER_FK_DUP_NAME ER_DUP_CONSTRAINT_NAME
#define ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
#define ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN
#define ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN
#define ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
#define ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT ER_QUERY_RESULT_INCOMPLETE

typedef struct st_mysql_rows {
  struct st_mysql_rows *next;		/* list of rows */
  MYSQL_ROW data;
  unsigned long length;
} MYSQL_ROWS;

typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;	/* offset to current row */

#include "my_alloc.h"

typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data {
  MYSQL_ROWS *data;
  struct embedded_query_result *embedded_info;
  MEM_ROOT alloc;
  my_ulonglong rows;
  unsigned int fields;
  /* extra info for embedded library */
  void *extension;
} MYSQL_DATA;

enum mysql_option 
{
  MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
  MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
  MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
  MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
  MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
  MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
  MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
  MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
  MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
  MYSQL_OPT_BIND,
  MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT, 
  MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
  MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
  MYSQL_OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_ADD,
  MYSQL_OPT_CONNECT_ATTR_DELETE,
  MYSQL_SERVER_PUBLIC_KEY,
  MYSQL_ENABLE_CLEARTEXT_PLUGIN,
  MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,

  /* MariaDB options */
  MYSQL_PROGRESS_CALLBACK=5999,
  MYSQL_OPT_NONBLOCK,
  MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY
};

/**
  @todo remove the "extension", move st_mysql_options completely
  out of mysql.h
*/
struct st_mysql_options_extention; 

struct st_mysql_options {
  unsigned int connect_timeout, read_timeout, write_timeout;
  unsigned int port, protocol;
  unsigned long client_flag;
  char *host,*user,*password,*unix_socket,*db;
  struct st_dynamic_array *init_commands;
  char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
  char *ssl_key;				/* PEM key file */
  char *ssl_cert;				/* PEM cert file */
  char *ssl_ca;					/* PEM CA file */
  char *ssl_capath;				/* PEM directory of CA-s? */
  char *ssl_cipher;				/* cipher to use */
  char *shared_memory_base_name;
  unsigned long max_allowed_packet;
  my_bool use_ssl;				/* if to use SSL or not */
  my_bool compress,named_pipe;
  my_bool use_thread_specific_memory;
  my_bool unused2;
  my_bool unused3;
  my_bool unused4;
  enum mysql_option methods_to_use;
  char *client_ip;
  /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
  my_bool secure_auth;
  /* 0 - never report, 1 - always report (default) */
  my_bool report_data_truncation;

  /* function pointers for local infile support */
  int (*local_infile_init)(void **, const char *, void *);
  int (*local_infile_read)(void *, char *, unsigned int);
  void (*local_infile_end)(void *);
  int (*local_infile_error)(void *, char *, unsigned int);
  void *local_infile_userdata;
  struct st_mysql_options_extention *extension;
};

enum mysql_status 
{
  MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT,
  MYSQL_STATUS_STATEMENT_GET_RESULT
};

enum mysql_protocol_type 
{
  MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
  MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};

typedef struct character_set
{
  unsigned int      number;     /* character set number              */
  unsigned int      state;      /* character set state               */
  const char        *csname;    /* collation name                    */
  const char        *name;      /* character set name                */
  const char        *comment;   /* comment                           */
  const char        *dir;       /* character set directory           */
  unsigned int      mbminlen;   /* min. length for multibyte strings */
  unsigned int      mbmaxlen;   /* max. length for multibyte strings */
} MY_CHARSET_INFO;

struct st_mysql_methods;
struct st_mysql_stmt;

typedef struct st_mysql
{
  NET		net;			/* Communication parameters */
  unsigned char	*connector_fd;		/* ConnectorFd for SSL */
  char		*host,*user,*passwd,*unix_socket,*server_version,*host_info;
  char          *info, *db;
  const struct charset_info_st *charset;
  MEM_ROOT	field_alloc;
  my_ulonglong affected_rows;
  my_ulonglong insert_id;		/* id if insert on table with NEXTNR */
  my_ulonglong extra_info;		/* Not used */
  unsigned long thread_id;		/* Id for connection in server */
  unsigned long packet_length;
  unsigned int	port;
  unsigned long client_flag,server_capabilities;
  unsigned int	protocol_version;
  unsigned int	field_count;
  unsigned int 	server_status;
  unsigned int  server_language;
  unsigned int	warning_count;
  struct st_mysql_options options;
  enum mysql_status status;
  my_bool	free_me;		/* If free in mysql_close */
  my_bool	reconnect;		/* set to 1 if automatic reconnect */

  /* session-wide random string */
  char	        scramble[SCRAMBLE_LENGTH+1];
  my_bool       auto_local_infile;
  void *unused2, *unused3, *unused4;
  MYSQL_FIELD	*fields;

  LIST  *stmts;                     /* list of all statements */
  const struct st_mysql_methods *methods;
  void *thd;
  /*
    Points to boolean flag in MYSQL_RES  or MYSQL_STMT. We set this flag 
    from mysql_stmt_close if close had to cancel result set of this object.
  */
  my_bool *unbuffered_fetch_owner;
  /* needed for embedded server - no net buffer to store the 'info' */
  char *info_buffer;
  void *extension;
} MYSQL;


typedef struct st_mysql_res {
  my_ulonglong  row_count;
  MYSQL_FIELD	*fields;
  MYSQL_DATA	*data;
  MYSQL_ROWS	*data_cursor;
  unsigned long *lengths;		/* column lengths of current row */
  MYSQL		*handle;		/* for unbuffered reads */
  const struct st_mysql_methods *methods;
  MYSQL_ROW	row;			/* If unbuffered read */
  MYSQL_ROW	current_row;		/* buffer to current row */
  MEM_ROOT	field_alloc;
  unsigned int	field_count, current_field;
  my_bool	eof;			/* Used by mysql_fetch_row */
  /* mysql_stmt_close() had to cancel this result */
  my_bool       unbuffered_fetch_cancelled;  
  void *extension;
} MYSQL_RES;


#if !defined(MYSQL_SERVICE_SQL) && !defined(MYSQL_CLIENT)
#define MYSQL_CLIENT
#endif


typedef struct st_mysql_parameters
{
  unsigned long *p_max_allowed_packet;
  unsigned long *p_net_buffer_length;
  void *extension;
} MYSQL_PARAMETERS;

/*
  Flag bits, the asynchronous methods return a combination of these ORed
  together to let the application know when to resume the suspended operation.
*/

/*
  Wait for data to be available on socket to read.
  mysql_get_socket_fd() will return socket descriptor.
*/
#define MYSQL_WAIT_READ 1
/* Wait for socket to be ready to write data. */
#define MYSQL_WAIT_WRITE  2
/* Wait for select() to mark exception on socket. */
#define MYSQL_WAIT_EXCEPT 4
/*
  Wait until timeout occurs. Value of timeout can be obtained from
  mysql_get_timeout_value().
*/
#define MYSQL_WAIT_TIMEOUT 8

#if !defined(MYSQL_SERVICE_SQL)
#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)
#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)
#endif

/*
  Set up and bring down the server; to ensure that applications will
  work when linked against either the standard client library or the
  embedded server library, these functions should be called.
*/
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);

/*
  mysql_server_init/end need to be called when using libmysqld or
  libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
  you don't need to call it explicitly; but you need to call
  mysql_server_end() to free memory). The names are a bit misleading
  (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
  names which suit well whether you're using libmysqld or libmysqlclient. We
  intend to promote these aliases over the mysql_server* ones.
*/
#define mysql_library_init mysql_server_init
#define mysql_library_end mysql_server_end

MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);

/*
  Set up and bring down a thread; these function should be called
  for each thread in an application which opens at least one MySQL
  connection.  All uses of the connection(s) should be between these
  function calls.
*/
my_bool STDCALL mysql_thread_init(void);
void STDCALL mysql_thread_end(void);

/*
  Functions to get information from the MYSQL and MYSQL_RES structures
  Should definitely be used if one uses shared libraries.
*/

my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);
unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
my_bool STDCALL mysql_eof(MYSQL_RES *res);
MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res,
					      unsigned int fieldnr);
MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);
MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res);
MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res);




int STDCALL mariadb_field_attr(MARIADB_CONST_STRING *attr,
                               const MYSQL_FIELD *field,
                               enum mariadb_field_attr_t type);


unsigned int STDCALL mysql_field_count(MYSQL *mysql);
my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
unsigned int STDCALL mysql_errno(MYSQL *mysql);
const char * STDCALL mysql_error(MYSQL *mysql);
const char *STDCALL mysql_sqlstate(MYSQL *mysql);
unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
const char * STDCALL mysql_character_set_name(MYSQL *mysql);
int          STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
int          STDCALL mysql_set_character_set_start(int *ret, MYSQL *mysql,
                                                   const char *csname);
int          STDCALL mysql_set_character_set_cont(int *ret, MYSQL *mysql,
                                                  int status);

MYSQL *		STDCALL mysql_init(MYSQL *mysql);
my_bool		STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
				      const char *cert, const char *ca,
				      const char *capath, const char *cipher);
const char *    STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
my_bool		STDCALL mysql_change_user(MYSQL *mysql, const char *user, 
					  const char *passwd, const char *db);
int             STDCALL mysql_change_user_start(my_bool *ret, MYSQL *mysql,
                                                const char *user,
                                                const char *passwd,
                                                const char *db);
int             STDCALL mysql_change_user_cont(my_bool *ret, MYSQL *mysql,
                                               int status);
MYSQL *		STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
					   const char *user,
					   const char *passwd,
					   const char *db,
					   unsigned int port,
					   const char *unix_socket,
					   unsigned long clientflag);
int             STDCALL mysql_real_connect_start(MYSQL **ret, MYSQL *mysql,
                                                 const char *host,
                                                 const char *user,
                                                 const char *passwd,
                                                 const char *db,
                                                 unsigned int port,
                                                 const char *unix_socket,
                                                 unsigned long clientflag);
int             STDCALL mysql_real_connect_cont(MYSQL **ret, MYSQL *mysql,
                                                int status);
int		STDCALL mysql_select_db(MYSQL *mysql, const char *db);
int             STDCALL mysql_select_db_start(int *ret, MYSQL *mysql,
                                              const char *db);
int             STDCALL mysql_select_db_cont(int *ret, MYSQL *mysql,
                                             int status);
int		STDCALL mysql_query(MYSQL *mysql, const char *q);
int             STDCALL mysql_query_start(int *ret, MYSQL *mysql,
                                          const char *q);
int             STDCALL mysql_query_cont(int *ret, MYSQL *mysql,
                                         int status);
int		STDCALL mysql_send_query(MYSQL *mysql, const char *q,
					 unsigned long length);
int             STDCALL mysql_send_query_start(int *ret, MYSQL *mysql,
                                               const char *q,
                                               unsigned long length);
int             STDCALL mysql_send_query_cont(int *ret, MYSQL *mysql,
                                              int status);
int		STDCALL mysql_real_query(MYSQL *mysql, const char *q,
					unsigned long length);
int             STDCALL mysql_real_query_start(int *ret, MYSQL *mysql,
                                               const char *q,
                                               unsigned long length);
int             STDCALL mysql_real_query_cont(int *ret, MYSQL *mysql,
                                              int status);
MYSQL_RES *     STDCALL mysql_store_result(MYSQL *mysql);
int             STDCALL mysql_store_result_start(MYSQL_RES **ret, MYSQL *mysql);
int             STDCALL mysql_store_result_cont(MYSQL_RES **ret, MYSQL *mysql,
                                                int status);
MYSQL_RES *     STDCALL mysql_use_result(MYSQL *mysql);

void        STDCALL mysql_get_character_set_info(MYSQL *mysql,
                           MY_CHARSET_INFO *charset);

/* local infile support */

#define LOCAL_INFILE_ERROR_LEN 512

void
mysql_set_local_infile_handler(MYSQL *mysql,
                               int (*local_infile_init)(void **, const char *,
                            void *),
                               int (*local_infile_read)(void *, char *,
							unsigned int),
                               void (*local_infile_end)(void *),
                               int (*local_infile_error)(void *, char*,
							 unsigned int),
                               void *);

void
mysql_set_local_infile_default(MYSQL *mysql);

int		STDCALL mysql_shutdown(MYSQL *mysql,
                                       enum mysql_enum_shutdown_level
                                       shutdown_level);
int             STDCALL mysql_shutdown_start(int *ret, MYSQL *mysql,
                                             enum mysql_enum_shutdown_level
                                             shutdown_level);
int             STDCALL mysql_shutdown_cont(int *ret, MYSQL *mysql,
                                            int status);
int		STDCALL mysql_dump_debug_info(MYSQL *mysql);
int             STDCALL mysql_dump_debug_info_start(int *ret, MYSQL *mysql);
int             STDCALL mysql_dump_debug_info_cont(int *ret, MYSQL *mysql,
                                                   int status);
int		STDCALL mysql_refresh(MYSQL *mysql,
				     unsigned int refresh_options);
int             STDCALL mysql_refresh_start(int *ret, MYSQL *mysql,
                                            unsigned int refresh_options);
int             STDCALL mysql_refresh_cont(int *ret, MYSQL *mysql, int status);
int		STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
int             STDCALL mysql_kill_start(int *ret, MYSQL *mysql,
                                         unsigned long pid);
int             STDCALL mysql_kill_cont(int *ret, MYSQL *mysql, int status);
int		STDCALL mysql_set_server_option(MYSQL *mysql,
						enum enum_mysql_set_option
						option);
int             STDCALL mysql_set_server_option_start(int *ret, MYSQL *mysql,
                                                      enum enum_mysql_set_option
                                                      option);
int             STDCALL mysql_set_server_option_cont(int *ret, MYSQL *mysql,
                                                     int status);
int		STDCALL mysql_ping(MYSQL *mysql);
int             STDCALL mysql_ping_start(int *ret, MYSQL *mysql);
int             STDCALL mysql_ping_cont(int *ret, MYSQL *mysql, int status);
const char *	STDCALL mysql_stat(MYSQL *mysql);
int             STDCALL mysql_stat_start(const char **ret, MYSQL *mysql);
int             STDCALL mysql_stat_cont(const char **ret, MYSQL *mysql,
                                        int status);
const char *	STDCALL mysql_get_server_info(MYSQL *mysql);
const char *	STDCALL mysql_get_server_name(MYSQL *mysql);
const char *	STDCALL mysql_get_client_info(void);
unsigned long	STDCALL mysql_get_client_version(void);
const char *	STDCALL mysql_get_host_info(MYSQL *mysql);
unsigned long	STDCALL mysql_get_server_version(MYSQL *mysql);
unsigned int	STDCALL mysql_get_proto_info(MYSQL *mysql);
MYSQL_RES *	STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
int             STDCALL mysql_list_dbs_start(MYSQL_RES **ret, MYSQL *mysql,
                                             const char *wild);
int             STDCALL mysql_list_dbs_cont(MYSQL_RES **ret, MYSQL *mysql,
                                            int status);
MYSQL_RES *	STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
int             STDCALL mysql_list_tables_start(MYSQL_RES **ret, MYSQL *mysql,
                                                const char *wild);
int             STDCALL mysql_list_tables_cont(MYSQL_RES **ret, MYSQL *mysql,
                                               int status);
MYSQL_RES *	STDCALL mysql_list_processes(MYSQL *mysql);
int             STDCALL mysql_list_processes_start(MYSQL_RES **ret,
                                                   MYSQL *mysql);
int             STDCALL mysql_list_processes_cont(MYSQL_RES **ret, MYSQL *mysql,
                                                  int status);
int		STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
				      const void *arg);
int             STDCALL mysql_options4(MYSQL *mysql,enum mysql_option option,
                                       const void *arg1, const void *arg2);
void		STDCALL mysql_free_result(MYSQL_RES *result);
int             STDCALL mysql_free_result_start(MYSQL_RES *result);
int             STDCALL mysql_free_result_cont(MYSQL_RES *result, int status);
void		STDCALL mysql_data_seek(MYSQL_RES *result,
					my_ulonglong offset);
MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result,
						MYSQL_ROW_OFFSET offset);
MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
					   MYSQL_FIELD_OFFSET offset);
MYSQL_ROW	STDCALL mysql_fetch_row(MYSQL_RES *result);
int             STDCALL mysql_fetch_row_start(MYSQL_ROW *ret,
                                              MYSQL_RES *result);
int             STDCALL mysql_fetch_row_cont(MYSQL_ROW *ret, MYSQL_RES *result,
                                             int status);
unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
MYSQL_FIELD *	STDCALL mysql_fetch_field(MYSQL_RES *result);
MYSQL_RES *     STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
					  const char *wild);
int             STDCALL mysql_list_fields_start(MYSQL_RES **ret, MYSQL *mysql,
                                                const char *table,
                                                const char *wild);
int             STDCALL mysql_list_fields_cont(MYSQL_RES **ret, MYSQL *mysql,
                                               int status);
unsigned long	STDCALL mysql_escape_string(char *to,const char *from,
					    unsigned long from_length);
unsigned long	STDCALL mysql_hex_string(char *to,const char *from,
                                         unsigned long from_length);
unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
					       char *to,const char *from,
					       unsigned long length);
void		STDCALL mysql_debug(const char *debug);
void 		STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int	STDCALL mysql_thread_safe(void);
my_bool		STDCALL mysql_embedded(void);
my_bool		STDCALL mariadb_connection(MYSQL *mysql);
my_bool         STDCALL mysql_read_query_result(MYSQL *mysql);
int             STDCALL mysql_read_query_result_start(my_bool *ret,
                                                      MYSQL *mysql);
int             STDCALL mysql_read_query_result_cont(my_bool *ret,
                                                     MYSQL *mysql, int status);


/*
  The following definitions are added for the enhanced 
  client-server protocol
*/

/* statement state */
enum enum_mysql_stmt_state
{
  MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE,
  MYSQL_STMT_FETCH_DONE
};


/*
  This structure is used to define bind information, and
  internally by the client library.
  Public members with their descriptions are listed below
  (conventionally `On input' refers to the binds given to
  mysql_stmt_bind_param, `On output' refers to the binds given
  to mysql_stmt_bind_result):

  buffer_type    - One of the MYSQL_* types, used to describe
                   the host language type of buffer.
                   On output: if column type is different from
                   buffer_type, column value is automatically converted
                   to buffer_type before it is stored in the buffer.
  buffer         - On input: points to the buffer with input data.
                   On output: points to the buffer capable to store
                   output data.
                   The type of memory pointed by buffer must correspond
                   to buffer_type. See the correspondence table in
                   the comment to mysql_stmt_bind_param.

  The two above members are mandatory for any kind of bind.

  buffer_length  - the length of the buffer. You don't have to set
                   it for any fixed length buffer: float, double,
                   int, etc. It must be set however for variable-length
                   types, such as BLOBs or STRINGs.

  length         - On input: in case when lengths of input values
                   are different for each execute, you can set this to
                   point at a variable containing value length. This
                   way the value length can be different in each execute.
                   If length is not NULL, buffer_length is not used.
                   Note, length can even point at buffer_length if
                   you keep bind structures around while fetching:
                   this way you can change buffer_length before
                   each execution, everything will work ok.
                   On output: if length is set, mysql_stmt_fetch will
                   write column length into it.

  is_null        - On input: points to a boolean variable that should
                   be set to TRUE for NULL values.
                   This member is useful only if your data may be
                   NULL in some but not all cases.
                   If your data is never NULL, is_null should be set to 0.
                   If your data is always NULL, set buffer_type
                   to MYSQL_TYPE_NULL, and is_null will not be used.

  is_unsigned    - On input: used to signify that values provided for one
                   of numeric types are unsigned.
                   On output describes signedness of the output buffer.
                   If, taking into account is_unsigned flag, column data
                   is out of range of the output buffer, data for this column
                   is regarded truncated. Note that this has no correspondence
                   to the sign of result set column, if you need to find it out
                   use mysql_stmt_result_metadata.
  error          - where to write a truncation error if it is present.
                   possible error value is:
                   0  no truncation
                   1  value is out of range or buffer is too small

  Please note that MYSQL_BIND also has internals members.
*/

typedef struct st_mysql_bind
{
  unsigned long	*length;          /* output length pointer */
  my_bool       *is_null;	  /* Pointer to null indicator */
  void		*buffer;	  /* buffer to get/put data */
  /* set this if you want to track data truncations happened during fetch */
  my_bool       *error;
  unsigned char *row_ptr;         /* for the current data position */
  void (*store_param_func)(NET *net, struct st_mysql_bind *param);
  void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
                       unsigned char **row);
  void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
		      unsigned char **row);
  /* output buffer length, must be set when fetching str/binary */
  unsigned long buffer_length;
  unsigned long offset;           /* offset position for char/binary fetch */
  unsigned long	length_value;     /* Used if length is 0 */
  unsigned int	param_number;	  /* For null count and error messages */
  unsigned int  pack_length;	  /* Internal length for packed data */
  enum enum_field_types buffer_type;	/* buffer type */
  my_bool       error_value;      /* used if error is 0 */
  my_bool       is_unsigned;      /* set if integer type is unsigned */
  my_bool	long_data_used;	  /* If used with mysql_send_long_data */
  my_bool	is_null_value;    /* Used if is_null is 0 */
  void *extension;
} MYSQL_BIND;


struct st_mysql_stmt_extension;

/* statement handler */
typedef struct st_mysql_stmt
{
  MEM_ROOT       mem_root;             /* root allocations */
  LIST           list;                 /* list to keep track of all stmts */
  MYSQL          *mysql;               /* connection handle */
  MYSQL_BIND     *params;              /* input parameters */
  MYSQL_BIND     *bind;                /* output parameters */
  MYSQL_FIELD    *fields;              /* result set metadata */
  MYSQL_DATA     result;               /* cached result set */
  MYSQL_ROWS     *data_cursor;         /* current row in cached result */
  /*
    mysql_stmt_fetch() calls this function to fetch one row (it's different
    for buffered, unbuffered and cursor fetch).
  */
  int            (*read_row_func)(struct st_mysql_stmt *stmt, 
                                  unsigned char **row);
  /* copy of mysql->affected_rows after statement execution */
  my_ulonglong   affected_rows;
  my_ulonglong   insert_id;            /* copy of mysql->insert_id */
  unsigned long	 stmt_id;	       /* Id for prepared statement */
  unsigned long  flags;                /* i.e. type of cursor to open */
  unsigned long  prefetch_rows;        /* number of rows per one COM_FETCH */
  /*
    Copied from mysql->server_status after execute/fetch to know
    server-side cursor status for this statement.
  */
  unsigned int   server_status;
  unsigned int	 last_errno;	       /* error code */
  unsigned int   param_count;          /* input parameter count */
  unsigned int   field_count;          /* number of columns in result set */
  enum enum_mysql_stmt_state state;    /* statement state */
  char		 last_error[MYSQL_ERRMSG_SIZE]; /* error message */
  char		 sqlstate[SQLSTATE_LENGTH+1];
  /* Types of input parameters should be sent to server */
  my_bool        send_types_to_server;
  my_bool        bind_param_done;      /* input buffers were supplied */
  unsigned char  bind_result_done;     /* output buffers were supplied */
  /* mysql_stmt_close() had to cancel this result */
  my_bool       unbuffered_fetch_cancelled;  
  /*
    Is set to true if we need to calculate field->max_length for 
    metadata fields when doing mysql_stmt_store_result.
  */
  my_bool       update_max_length;     
  struct st_mysql_stmt_extension *extension;
} MYSQL_STMT;

enum enum_stmt_attr_type
{
  /*
    When doing mysql_stmt_store_result calculate max_length attribute
    of statement metadata. This is to be consistent with the old API, 
    where this was done automatically.
    In the new API we do that only by request because it slows down
    mysql_stmt_store_result sufficiently.
  */
  STMT_ATTR_UPDATE_MAX_LENGTH,
  /*
    unsigned long with combination of cursor flags (read only, for update,
    etc)
  */
  STMT_ATTR_CURSOR_TYPE,
  /*
    Amount of rows to retrieve from server per one fetch if using cursors.
    Accepts unsigned long attribute in the range 1 - ulong_max
  */
  STMT_ATTR_PREFETCH_ROWS
};

MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
                               unsigned long length);
int STDCALL mysql_stmt_prepare_start(int *ret, MYSQL_STMT *stmt,
                                     const char *query, unsigned long length);
int STDCALL mysql_stmt_prepare_cont(int *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_execute_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_execute_cont(int *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_cont(int *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, 
                                    unsigned int column,
                                    unsigned long offset);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_store_result_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_store_result_cont(int *ret, MYSQL_STMT *stmt,
                                         int status);
unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
                                    enum enum_stmt_attr_type attr_type,
                                    const void *attr);
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
                                    enum enum_stmt_attr_type attr_type,
                                    void *attr);
my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
int STDCALL mysql_stmt_close_start(my_bool *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_close_cont(my_bool *ret, MYSQL_STMT * stmt, int status);
my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt);
int STDCALL mysql_stmt_reset_start(my_bool *ret, MYSQL_STMT * stmt);
int STDCALL mysql_stmt_reset_cont(my_bool *ret, MYSQL_STMT *stmt, int status);
my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_free_result_start(my_bool *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_free_result_cont(my_bool *ret, MYSQL_STMT *stmt,
                                        int status);
my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, 
                                          unsigned int param_number,
                                          const char *data, 
                                          unsigned long length);
int STDCALL mysql_stmt_send_long_data_start(my_bool *ret, MYSQL_STMT *stmt,
                                            unsigned int param_number,
                                            const char *data,
                                            unsigned long len);
int STDCALL mysql_stmt_send_long_data_cont(my_bool *ret, MYSQL_STMT *stmt,
                                           int status);
MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt);
MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, 
                                             MYSQL_ROW_OFFSET offset);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt);
void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset);
my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt);
my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt);

my_bool STDCALL mysql_commit(MYSQL * mysql);
int STDCALL mysql_commit_start(my_bool *ret, MYSQL * mysql);
int STDCALL mysql_commit_cont(my_bool *ret, MYSQL * mysql, int status);
my_bool STDCALL mysql_rollback(MYSQL * mysql);
int STDCALL mysql_rollback_start(my_bool *ret, MYSQL * mysql);
int STDCALL mysql_rollback_cont(my_bool *ret, MYSQL * mysql, int status);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
int STDCALL mysql_autocommit_start(my_bool *ret, MYSQL * mysql,
                                   my_bool auto_mode);
int STDCALL mysql_autocommit_cont(my_bool *ret, MYSQL * mysql, int status);
my_bool STDCALL mysql_more_results(MYSQL *mysql);
int STDCALL mysql_next_result(MYSQL *mysql);
int STDCALL mysql_next_result_start(int *ret, MYSQL *mysql);
int STDCALL mysql_next_result_cont(int *ret, MYSQL *mysql, int status);
int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_next_result_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_next_result_cont(int *ret, MYSQL_STMT *stmt, int status);
void STDCALL mysql_close_slow_part(MYSQL *mysql);
void STDCALL mysql_close(MYSQL *sock);
int STDCALL mysql_close_start(MYSQL *sock);
int STDCALL mysql_close_cont(MYSQL *sock, int status);
my_socket STDCALL mysql_get_socket(const MYSQL *mysql);
unsigned int STDCALL mysql_get_timeout_value(const MYSQL *mysql);
unsigned int STDCALL mysql_get_timeout_value_ms(const MYSQL *mysql);

/********************************************************************
  mysql_net_ functions - low-level API to MySQL protocol
*********************************************************************/
unsigned long STDCALL mysql_net_read_packet(MYSQL *mysql);
unsigned long STDCALL mysql_net_field_length(unsigned char **packet);

/* status return codes */
#define MYSQL_NO_DATA        100
#define MYSQL_DATA_TRUNCATED 101

#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)

#ifdef USE_OLD_FUNCTIONS
MYSQL *		STDCALL mysql_connect(MYSQL *mysql, const char *host,
				      const char *user, const char *passwd);
int		STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
int		STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
#endif
#define HAVE_MYSQL_REAL_CONNECT

#ifdef	__cplusplus
}
#endif

#endif /* _mysql_h */
server/ma_dyncol.h000064400000017555150400263660010207 0ustar00/* Copyright (c) 2011, Monty Program Ab
   Copyright (c) 2011, Oleksandr Byelkin

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are
   met:

   1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.

   THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   SUCH DAMAGE.
*/

#ifndef ma_dyncol_h
#define ma_dyncol_h
#ifdef __cplusplus
extern "C" {
#endif

#include <decimal.h>
#include <my_decimal_limits.h>
#include <mysql_time.h>

#ifndef _my_sys_h
typedef struct st_dynamic_string
{
    char *str;
    size_t length,max_length,alloc_increment;
} DYNAMIC_STRING;
#endif

#ifndef MY_GLOBAL_INCLUDED
struct st_mysql_lex_string
{
  char *str;
  size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
typedef struct st_mysql_lex_string LEX_STRING;
#endif

/*
  Limits of implementation
*/
#define MAX_TOTAL_NAME_LENGTH 65535
#define MAX_NAME_LENGTH (MAX_TOTAL_NAME_LENGTH/4)

/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK

#ifdef HAVE_CHARSET_utf8mb4
#define DYNCOL_UTF (&my_charset_utf8mb4_general_ci)
#else
#define DYNCOL_UTF (&my_charset_utf8mb3_general_ci)
#endif

/* escape json strings */
#define DYNCOL_JSON_ESC ((char)1)

enum enum_dyncol_func_result
{
  ER_DYNCOL_OK= 0,
  ER_DYNCOL_YES= 1,                /* For functions returning 0/1 */
  ER_DYNCOL_FORMAT= -1,            /* Wrong format of the encoded string */
  ER_DYNCOL_LIMIT=  -2,            /* Some limit reached */
  ER_DYNCOL_RESOURCE= -3,          /* Out of resources */
  ER_DYNCOL_DATA= -4,              /* Incorrect input data */
  ER_DYNCOL_UNKNOWN_CHARSET= -5,   /* Unknown character set */
  ER_DYNCOL_TRUNCATED= 2           /* OK, but data was truncated */
};

typedef DYNAMIC_STRING DYNAMIC_COLUMN;

enum enum_dynamic_column_type
{
  DYN_COL_NULL= 0,
  DYN_COL_INT,
  DYN_COL_UINT,
  DYN_COL_DOUBLE,
  DYN_COL_STRING,
  DYN_COL_DECIMAL,
  DYN_COL_DATETIME,
  DYN_COL_DATE,
  DYN_COL_TIME,
  DYN_COL_DYNCOL
};

typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;

struct st_dynamic_column_value
{
  DYNAMIC_COLUMN_TYPE type;
  union
  {
    long long long_value;
    unsigned long long ulong_value;
    double double_value;
    struct {
      MYSQL_LEX_STRING value;
      CHARSET_INFO *charset;
    } string;
    struct {
      decimal_digit_t buffer[DECIMAL_BUFF_LENGTH];
      decimal_t value;
    } decimal;
    MYSQL_TIME time_value;
  } x;
};

typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;

#ifdef MADYNCOL_DEPRECATED
enum enum_dyncol_func_result
dynamic_column_create(DYNAMIC_COLUMN *str,
                      uint column_nr, DYNAMIC_COLUMN_VALUE *value);

enum enum_dyncol_func_result
dynamic_column_create_many(DYNAMIC_COLUMN *str,
                           uint column_count,
                           uint *column_numbers,
                           DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
                      DYNAMIC_COLUMN_VALUE *value);
enum enum_dyncol_func_result
dynamic_column_update_many(DYNAMIC_COLUMN *str,
                           uint add_column_count,
                           uint *column_numbers,
                           DYNAMIC_COLUMN_VALUE *values);

enum enum_dyncol_func_result
dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);

enum enum_dyncol_func_result
dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);

enum enum_dyncol_func_result
dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
                   DYNAMIC_COLUMN_VALUE *store_it_here);
#endif

/* new functions */
enum enum_dyncol_func_result
mariadb_dyncol_create_many_num(DYNAMIC_COLUMN *str,
                               uint column_count,
                               uint *column_numbers,
                               DYNAMIC_COLUMN_VALUE *values,
                               my_bool new_string);
enum enum_dyncol_func_result
mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
                                 uint column_count,
                                 MYSQL_LEX_STRING *column_keys,
                                 DYNAMIC_COLUMN_VALUE *values,
                                 my_bool new_string);


enum enum_dyncol_func_result
mariadb_dyncol_update_many_num(DYNAMIC_COLUMN *str,
                               uint add_column_count,
                               uint *column_keys,
                               DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
                                 uint add_column_count,
                                 MYSQL_LEX_STRING *column_keys,
                                 DYNAMIC_COLUMN_VALUE *values);


enum enum_dyncol_func_result
mariadb_dyncol_exists_num(DYNAMIC_COLUMN *org, uint column_nr);
enum enum_dyncol_func_result
mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name);

/* List of not NULL columns */
enum enum_dyncol_func_result
mariadb_dyncol_list_num(DYNAMIC_COLUMN *str, uint *count, uint **nums);
enum enum_dyncol_func_result
mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count,
                          MYSQL_LEX_STRING **names);

/*
   if the column do not exists it is NULL
*/
enum enum_dyncol_func_result
mariadb_dyncol_get_num(DYNAMIC_COLUMN *org, uint column_nr,
                       DYNAMIC_COLUMN_VALUE *store_it_here);
enum enum_dyncol_func_result
mariadb_dyncol_get_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name,
                         DYNAMIC_COLUMN_VALUE *store_it_here);

my_bool mariadb_dyncol_has_names(DYNAMIC_COLUMN *str);

enum enum_dyncol_func_result
mariadb_dyncol_check(DYNAMIC_COLUMN *str);

enum enum_dyncol_func_result
mariadb_dyncol_json(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json);

#define mariadb_dyncol_init(A) memset((A), 0, sizeof(*(A)))
void mariadb_dyncol_free(DYNAMIC_COLUMN *str);

/* conversion of values to 3 base types */
enum enum_dyncol_func_result
mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val,
                       CHARSET_INFO *cs, my_bool quote);
enum enum_dyncol_func_result
mariadb_dyncol_val_long(longlong *ll, DYNAMIC_COLUMN_VALUE *val);
enum enum_dyncol_func_result
mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val);


enum enum_dyncol_func_result
mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
                      uint *count,
                      MYSQL_LEX_STRING **names, DYNAMIC_COLUMN_VALUE **vals);

void mariadb_dyncol_unpack_free(MYSQL_LEX_STRING *names,
                                DYNAMIC_COLUMN_VALUE *vals);

int mariadb_dyncol_column_cmp_named(const MYSQL_LEX_STRING *s1,
                                    const MYSQL_LEX_STRING *s2);

enum enum_dyncol_func_result
mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count);

#define mariadb_dyncol_value_init(V) (V)->type= DYN_COL_NULL

/*
  Prepare value for using as decimal
*/
void mariadb_dyncol_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);

#ifdef __cplusplus
}
#endif
#endif
server/little_endian.h000064400000006764150400263660011055 0ustar00/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.

   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 */

/*
  Data in little-endian format.
*/

#ifndef MY_BYTE_ORDER_ARCH_OPTIMIZED
#define float4get(V,M)   memcpy(&V, (M), sizeof(float))
#define float4store(V,M) memcpy(V, (&M), sizeof(float))
#define float8get(V,M)   doubleget((V),(M))
#define float8store(V,M) doublestore((V),(M))

/* Bi-endian hardware.... */
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
                              *(((char*)T)+1)=(char) ((uchar *) &V)[5];\
                              *(((char*)T)+2)=(char) ((uchar *) &V)[6];\
                              *(((char*)T)+3)=(char) ((uchar *) &V)[7];\
                              *(((char*)T)+4)=(char) ((uchar *) &V)[0];\
                              *(((char*)T)+5)=(char) ((uchar *) &V)[1];\
                              *(((char*)T)+6)=(char) ((uchar *) &V)[2];\
                              *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\
                         while(0)
#define doubleget(V,M)   do { double def_temp;\
                              ((uchar*) &def_temp)[0]=(M)[4];\
                              ((uchar*) &def_temp)[1]=(M)[5];\
                              ((uchar*) &def_temp)[2]=(M)[6];\
                              ((uchar*) &def_temp)[3]=(M)[7];\
                              ((uchar*) &def_temp)[4]=(M)[0];\
                              ((uchar*) &def_temp)[5]=(M)[1];\
                              ((uchar*) &def_temp)[6]=(M)[2];\
                              ((uchar*) &def_temp)[7]=(M)[3];\
                              (V) = def_temp; } while(0)
#else /* Bi-endian hardware.... */

/* Cast away type qualifiers (necessary as macro takes argument by value). */
#define doublestore(T,V) memcpy((T), (void*) &V, sizeof(double))
#define doubleget(V,M)	 memcpy(&V, (M), sizeof(double))

#endif /* Bi-endian hardware.... */

#endif /* !MY_BYTE_ORDER_ARCH_OPTIMIZED */

#define ushortget(V,M)	do { uchar *pM= (uchar*)(M);V = uint2korr(pM);} while(0)
#define shortget(V,M)	do { uchar *pM= (uchar*)(M);V = sint2korr(pM);} while(0)
#define longget(V,M)	do { uchar *pM= (uchar*)(M);V = sint4korr(pM);} while(0)
#define ulongget(V,M)   do { uchar *pM= (uchar*)(M);V = uint4korr(pM);} while(0)
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V)	int4store(T,V)

#ifndef floatstore
/* Cast away type qualifiers (necessary as macro takes argument by value). */
#define floatstore(T,V)  memcpy((T), (void*) (&V), sizeof(float))
#define floatget(V,M)    memcpy(&V, (M), sizeof(float))
#endif
#ifndef doubleget
#define doubleget(V,M)	 memcpy(&V, (M), sizeof(double))
#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double))
#endif /* doubleget */

#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
server/my_alloca.h000064400000002627150400263660010174 0ustar00/* Copyright (c) 2023, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef MY_ALLOCA_INCLUDED
#define MY_ALLOCA_INCLUDED

#ifdef _WIN32
#include <malloc.h> /*for alloca*/
/*
  MSVC may define "alloca" when compiling in /Ze mode
  (with extensions from Microsoft), but otherwise only
  the _alloca function is defined:
*/
#ifndef alloca
#define alloca _alloca
#endif
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif

#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
#endif /* _AIX */

/*
  If the GCC/LLVM compiler from the MinGW is used,
  alloca may not be defined when using the MSVC CRT:
*/
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca)
#define alloca __builtin_alloca
#endif /* GNUC */

#endif /* MY_ALLOCA_INCLUDED */
server/my_attribute.h000064400000006047150400263660010744 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/*
  Helper macros used for setting different __attributes__
  on functions in a portable fashion
*/

#ifndef _my_attribute_h
#define _my_attribute_h

#if defined(__GNUC__)
# ifndef GCC_VERSION
#  define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
# endif
#endif

/*
  Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
  Some forms of __attribute__ are actually supported in earlier versions of
  g++, but we just disable them all because we only use them to generate
  compilation warnings.
*/
#ifndef __attribute__
# if !defined(__GNUC__) && !defined(__clang__)
#  define __attribute__(A)
# elif defined(__GNUC__)
#  ifndef GCC_VERSION
#   define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#  endif
#  if GCC_VERSION < 2008
#   define __attribute__(A)
#  elif defined(__cplusplus) && GCC_VERSION < 3004
#   define __attribute__(A)
#  endif
# endif
#endif

/*
  __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
  But that's already covered by the __attribute__ tests above, so this is
  just a convenience macro.
*/
#ifndef ATTRIBUTE_FORMAT
# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
#endif

/*

   __attribute__((format(...))) on a function pointer is not supported
   until  gcc 3.1
*/
#ifndef ATTRIBUTE_FORMAT_FPTR
# if (GCC_VERSION >= 3001)
#  define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
# else
#  define ATTRIBUTE_FORMAT_FPTR(style, m, n)
# endif /* GNUC >= 3.1 */
#endif

/* gcc 7.5.0 does not support __attribute__((no_sanitize("undefined")) */
#ifndef ATTRIBUTE_NO_UBSAN
# if (GCC_VERSION >= 8000) || defined(__clang__)
#  define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
# elif (GCC_VERSION >= 6001)
#  define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize_undefined))
# else
#  define ATTRIBUTE_NO_UBSAN
# endif
#endif

/* Define pragmas to disable warnings for stack frame checking */

#if defined(__clang__)
#define PRAGMA_DISABLE_CHECK_STACK_FRAME                     \
_Pragma("clang diagnostic push")                             \
_Pragma("clang diagnostic ignored \"-Wframe-larger-than=\"")

#define PRAGMA_REENABLE_CHECK_STACK_FRAME                    \
_Pragma("clang diagnostic pop")

#else
#define PRAGMA_DISABLE_CHECK_STACK_FRAME
#define PRAGMA_REENABLE_CHECK_STACK_FRAME
#endif

#endif /* _my_attribute_h */
server/handler_state.h000064400000001366150400263660011050 0ustar00/*
  Map handler error message to sql states. Note that this list MUST be in
  increasing order!
  See sql_state.c for usage
*/

{ HA_ERR_KEY_NOT_FOUND, 	"02000", "" },
{ HA_ERR_FOUND_DUPP_KEY,	"23000", "" },
{ HA_ERR_WRONG_COMMAND, 	"0A000", "" },
{ HA_ERR_UNSUPPORTED,		"0A000", "" },
{ HA_WRONG_CREATE_OPTION,	"0A000", "" },
{ HA_ERR_FOUND_DUPP_UNIQUE,	"23000", "" },
{ HA_ERR_UNKNOWN_CHARSET,	"0A000", "" },
{ HA_ERR_READ_ONLY_TRANSACTION,	"25000", "" },
{ HA_ERR_LOCK_DEADLOCK,		"40001", "" },
{ HA_ERR_NO_REFERENCED_ROW,	"23000", "" },
{ HA_ERR_ROW_IS_REFERENCED,	"23000", "" },
{ HA_ERR_TABLE_EXIST,		"42S01", "" },
{ HA_ERR_FOREIGN_DUPLICATE_KEY,	"23000", "" },
{ HA_ERR_TABLE_READONLY,        "25000", "" }, 
{ HA_ERR_AUTOINC_ERANGE,	"22003", "" },
server/json_lib.h000064400000032713150400263660010032 0ustar00#ifndef JSON_LIB_INCLUDED
#define JSON_LIB_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

#define JSON_DEPTH_LIMIT 32

/*
  When error happens, the c_next of the JSON engine contains the
  character that caused the error, and the c_str is the position
  in string where the error occurs.
*/
enum json_errors {
  JE_BAD_CHR= -1,      /* Invalid character, charset handler cannot read it. */

  JE_NOT_JSON_CHR= -2, /* Character met not used in JSON. */
                       /* ASCII 00-08 for instance.       */

  JE_EOS= -3,          /* Unexpected end of string. */

  JE_SYN= -4,          /* The next character breaks the JSON syntax. */

  JE_STRING_CONST= -5, /* Character disallowed in string constant. */

  JE_ESCAPING= -6,     /* Error in the escaping. */

  JE_DEPTH= -7,        /* The limit on the JSON depth was overrun. */
};


typedef struct st_json_string_t
{
  const uchar *c_str;    /* Current position in JSON string */
  const uchar *str_end;  /* The end on the string. */
  my_wc_t c_next;        /* UNICODE of the last read character */
  int c_next_len;        /* character lenght of the last read character. */
  int error;             /* error code. */

  CHARSET_INFO *cs;      /* Character set of the JSON string. */

  my_charset_conv_mb_wc wc; /* UNICODE conversion function. */
                            /* It's taken out of the cs just to speed calls. */
} json_string_t;


void json_string_set_cs(json_string_t *s, CHARSET_INFO *i_cs);
void json_string_set_str(json_string_t *s,
                         const uchar *str, const uchar *end);
#define json_next_char(j) \
  ((j)->c_next_len= (j)->wc((j)->cs, &(j)->c_next, (j)->c_str, (j)->str_end))
#define json_eos(j) ((j)->c_str >= (j)->str_end)
/*
  read_string_const_chr() reads the next character of the string constant
  and saves it to the js->c_next.
  It takes into account possible escapings, so if for instance
  the string is '\b', the read_string_const_chr() sets 8.
*/
int json_read_string_const_chr(json_string_t *js);


/*
  Various JSON-related operations expect JSON path as a parameter.
  The path is a string like this "$.keyA[2].*"
  The path itself is a number of steps specifying either a key or a position
  in an array. Some of them can be wildcards.
  So the representation of the JSON path is the json_path_t class
  containing an array of json_path_step_t objects.
*/


/* Path step types - actually bitmasks to let '&' or '|' operations. */
enum json_path_step_types
{
  JSON_PATH_KEY_NULL=0,
  JSON_PATH_KEY=1,   /* Must be equal to JSON_VALUE_OBJECT. */
  JSON_PATH_ARRAY=2, /* Must be equal to JSON_VALUE_ARRAY. */
  JSON_PATH_KEY_OR_ARRAY=3,
  JSON_PATH_WILD=4, /* Step like .* or [*] */
  JSON_PATH_DOUBLE_WILD=8, /* Step like **.k or **[1] */
  JSON_PATH_KEY_WILD= 1+4,
  JSON_PATH_KEY_DOUBLEWILD= 1+8,
  JSON_PATH_ARRAY_WILD= 2+4,
  JSON_PATH_ARRAY_DOUBLEWILD= 2+8
};


typedef struct st_json_path_step_t
{
  enum json_path_step_types type;  /* The type of the step -   */
                                   /* see json_path_step_types */
  const uchar *key; /* Pointer to the beginning of the key. */
  const uchar *key_end;  /* Pointer to the end of the key. */
  uint n_item;      /* Item number in an array. No meaning for the key step. */
} json_path_step_t;


typedef struct st_json_path_t
{
  json_string_t s;  /* The string to be parsed. */
  json_path_step_t steps[JSON_DEPTH_LIMIT]; /* Steps of the path. */
  json_path_step_t *last_step; /* Points to the last step. */

  int mode_strict; /* TRUE if the path specified as 'strict' */
  enum json_path_step_types types_used; /* The '|' of all step's 'type'-s */
} json_path_t;


int json_path_setup(json_path_t *p,
                    CHARSET_INFO *i_cs, const uchar *str, const uchar *end);


/*
  The set of functions and structures below provides interface
  to the JSON text parser.
  Running the parser normally goes like this:

    json_engine_t j_eng;   // structure keeps parser's data
    json_scan_start(j_eng) // begin the parsing

    do
    {
      // The parser has read next piece of JSON
      // and set fields of j_eng structure accordingly.
      // So let's see what we have:
      switch (j_eng.state)
      {
        case JST_KEY:
           // Handle key name. See the json_read_keyname_chr()
           // Probably compare it with the keyname we're looking for
        case JST_VALUE:
           // Handle value. It is either value of the key or an array item.
           // see the json_read_value()
        case JST_OBJ_START:
          // parser found an object (the '{' in JSON)
        case JST_OBJ_END:
          // parser found the end of the object (the '}' in JSON)
        case JST_ARRAY_START:
          // parser found an array (the '[' in JSON)
        case JST_ARRAY_END:
          // parser found the end of the array (the ']' in JSON)

      };
    } while (json_scan_next() == 0);  // parse next structure

    
    if (j_eng.s.error)  // we need to check why the loop ended.
                        // Did we get to the end of JSON, or came upon error.
    {
       signal_error_in_JSON()
    }


  Parts of JSON can be quickly skipped. If we are not interested
  in a particular key, we can just skip it with json_skip_key() call.
  Similarly json_skip_level() goes right to the end of an object
  or an array.
*/


/* These are JSON parser states that user can expect and handle.  */
enum json_states {
  JST_VALUE,       /* value found      */
  JST_KEY,         /* key found        */
  JST_OBJ_START,   /* object           */
  JST_OBJ_END,     /* object ended     */
  JST_ARRAY_START, /* array            */
  JST_ARRAY_END,   /* array ended      */
  NR_JSON_USER_STATES
};


enum json_value_types
{
  JSON_VALUE_UNINITALIZED=0,
  JSON_VALUE_OBJECT=1,
  JSON_VALUE_ARRAY=2,
  JSON_VALUE_STRING=3,
  JSON_VALUE_NUMBER=4,
  JSON_VALUE_TRUE=5,
  JSON_VALUE_FALSE=6,
  JSON_VALUE_NULL=7
};


enum json_num_flags
{
  JSON_NUM_NEG=1,        /* Number is negative. */
  JSON_NUM_FRAC_PART=2,  /* The fractional part is not empty. */
  JSON_NUM_EXP=4,        /* The number has the 'e' part. */
};


typedef struct st_json_engine_t
{
  json_string_t s;  /* String to parse. */
  int sav_c_len;    /* Length of the current character.
                       Can be more than 1 for multibyte charsets */

  int state; /* The state of the parser. One of 'enum json_states'.
                It tells us what construction of JSON we've just read. */

  /* These values are only set after the json_read_value() call. */
  enum json_value_types value_type; /* type of the value.*/
  const uchar *value;      /* Points to the value. */
  const uchar *value_begin;/* Points to where the value starts in the JSON. */
  int value_escaped;       /* Flag telling if the string value has escaping.*/
  uint num_flags;  /* the details of the JSON_VALUE_NUMBER, is it negative,
                      or if it has the fractional part.
                      See the enum json_num_flags. */

  /*
    In most cases the 'value' and 'value_begin' are equal.
    They only differ if the value is a string constants. Then 'value_begin'
    points to the starting quotation mark, while the 'value' - to
    the first character of the string.
  */

  const uchar *value_end; /* Points to the next character after the value. */
  int value_len; /* The length of the value. Does not count quotations for */
                 /* string constants. */

  int stack[JSON_DEPTH_LIMIT]; /* Keeps the stack of nested JSON structures. */
  int stack_p;                 /* The 'stack' pointer. */
  volatile uchar *killed_ptr;
} json_engine_t;


int json_scan_start(json_engine_t *je,
                        CHARSET_INFO *i_cs, const uchar *str, const uchar *end);
int json_scan_next(json_engine_t *j);


/*
  json_read_keyname_chr() function assists parsing the name of an JSON key.
  It only can be called when the json_engine is in JST_KEY.
  The json_read_keyname_chr() reads one character of the name of the key,
  and puts it in j_eng.s.next_c.
  Typical usage is like this:

  if (j_eng.state == JST_KEY)
  {
    while (json_read_keyname_chr(&j) == 0)
    {
      //handle next character i.e. match it against the pattern
    }
  }
*/

int json_read_keyname_chr(json_engine_t *j);


/*
  Check if the name of the current JSON key matches
  the step of the path.
*/
int json_key_matches(json_engine_t *je, json_string_t *k);


/*
  json_read_value() function parses the JSON value syntax,
  so that we can handle the value of a key or an array item.
  It only returns meaningful result when the engine is in
  the JST_VALUE state.

  Typical usage is like this:

  if (j_eng.state ==  JST_VALUE)
  {
    json_read_value(&j_eng);
    switch(j_eng.value_type)
    {
      case JSON_VALUE_STRING:
        // get the string
        str= j_eng.value;
        str_length= j_eng.value_len;
      case JSON_VALUE_NUMBER:
        // get the number
      ... etc
    }
*/
int json_read_value(json_engine_t *j);


/*
  json_skip_key() makes parser skip the content of the current
  JSON key quickly.
  It can be called only when the json_engine state is JST_KEY.
  Typical usage is:

  if (j_eng.state == JST_KEY)
  {
    if (key_does_not_match(j_eng))
      json_skip_key(j_eng);
  }
*/

int json_skip_key(json_engine_t *j);


typedef const int *json_level_t;

/*
  json_skip_to_level() makes parser quickly get out of nested
  loops and arrays. It is used when we're not interested in what is
  there in the rest of these structures.
  The 'level' should be remembered in advance.
        json_level_t level= json_get_level(j);
        .... // getting into the nested JSON structures
        json_skip_to_level(j, level);
*/
#define json_get_level(j) (j->stack_p)

int json_skip_to_level(json_engine_t *j, int level);

/*
  json_skip_level() works as above with just current structure.
  So it gets to the end of the current JSON array or object.
*/
#define json_skip_level(json_engine) \
  json_skip_to_level((json_engine), (json_engine)->stack_p)


/*
  works as json_skip_level() but also counts items on the current
  level skipped.
*/
int json_skip_level_and_count(json_engine_t *j, int *n_items_skipped);

#define json_skip_array_item json_skip_key

/*
  Checks if the current value is of scalar type -
  not an OBJECT nor ARRAY.
*/
#define json_value_scalar(je)  ((je)->value_type > JSON_VALUE_ARRAY)


/*
  Look for the JSON PATH in the json string.
  Function can be called several times with same JSON/PATH to
  find multiple matches.
  On the first call, the json_engine_t parameter should be
  initialized with the JSON string, and the json_path_t with the JSON path
  appropriately. The 'p_cur_step' should point at the first
  step of the path.
  The 'array_counters' is the array of JSON_DEPTH_LIMIT size.
  It stores the array counters of the parsed JSON.
  If function returns 0, it means it found the match. The position of
  the match is je->s.c_str. Then we can call the json_find_path()
  with same engine/path/p_cur_step to get the next match.
  Non-zero return means no matches found.
  Check je->s.error to see if there was an error in JSON.
*/
int json_find_path(json_engine_t *je,
                   json_path_t *p, json_path_step_t **p_cur_step,
                   uint *array_counters);


typedef struct st_json_find_paths_t
{
  uint n_paths;
  json_path_t *paths;
  uint cur_depth;
  uint *path_depths;
  uint array_counters[JSON_DEPTH_LIMIT];
} json_find_paths_t;


int json_find_paths_first(json_engine_t *je, json_find_paths_t *state,
                          uint n_paths, json_path_t *paths, uint *path_depths);
int json_find_paths_next(json_engine_t *je, json_find_paths_t *state);


/*
  Convert JSON string constant into ordinary string constant
  which can involve unpacking json escapes and changing character set.
  Returns negative integer in the case of an error,
  the length of the result otherwise.
*/
int json_unescape(CHARSET_INFO *json_cs,
                  const uchar *json_str, const uchar *json_end,
                  CHARSET_INFO *res_cs,
                  uchar *res, uchar *res_end);

/*
  Convert ordinary string constant into JSON string constant.
  which can involve appropriate escaping and changing character set.
  Returns negative integer in the case of an error,
  the length of the result otherwise.
*/
int json_escape(CHARSET_INFO *str_cs, const uchar *str, const uchar *str_end,
                CHARSET_INFO *json_cs, uchar *json, uchar *json_end);


/*
  Appends the ASCII string to the json with the charset conversion.
*/
int json_append_ascii(CHARSET_INFO *json_cs,
                      uchar *json, uchar *json_end,
                      const uchar *ascii, const uchar *ascii_end);


/*
  Scan the JSON and return paths met one-by-one.
     json_get_path_start(&p)
     while (json_get_path_next(&p))
     {
       handle_the_next_path();
     }
*/

int json_get_path_start(json_engine_t *je, CHARSET_INFO *i_cs,
                        const uchar *str, const uchar *end,
                        json_path_t *p);


int json_get_path_next(json_engine_t *je, json_path_t *p);


int json_path_parts_compare(
        const json_path_step_t *a, const json_path_step_t *a_end,
        const json_path_step_t *b, const json_path_step_t *b_end,
        enum json_value_types vt);
int json_path_compare(const json_path_t *a, const json_path_t *b,
                      enum json_value_types vt);

int json_valid(const char *js, size_t js_len, CHARSET_INFO *cs);

int json_locate_key(const char *js, const char *js_end,
                    const char *kname,
                    const char **key_start, const char **key_end,
                    int *comma_pos);

#ifdef  __cplusplus
}
#endif

#endif /* JSON_LIB_INCLUDED */
server/sql_state.h000064400000035061150400263660010231 0ustar00/* Autogenerated file, please don't edit */

{ ER_DUP_KEY                              ,"23000", "" },
{ ER_OUTOFMEMORY                          ,"HY001", "S1001" },
{ ER_OUT_OF_SORTMEMORY                    ,"HY001", "S1001" },
{ ER_CON_COUNT_ERROR                      ,"08004", "" },
{ ER_BAD_HOST_ERROR                       ,"08S01", "" },
{ ER_HANDSHAKE_ERROR                      ,"08S01", "" },
{ ER_DBACCESS_DENIED_ERROR                ,"42000", "" },
{ ER_ACCESS_DENIED_ERROR                  ,"28000", "" },
{ ER_NO_DB_ERROR                          ,"3D000", "" },
{ ER_UNKNOWN_COM_ERROR                    ,"08S01", "" },
{ ER_BAD_NULL_ERROR                       ,"23000", "" },
{ ER_BAD_DB_ERROR                         ,"42000", "" },
{ ER_TABLE_EXISTS_ERROR                   ,"42S01", "" },
{ ER_BAD_TABLE_ERROR                      ,"42S02", "" },
{ ER_NON_UNIQ_ERROR                       ,"23000", "" },
{ ER_SERVER_SHUTDOWN                      ,"08S01", "" },
{ ER_BAD_FIELD_ERROR                      ,"42S22", "S0022" },
{ ER_WRONG_FIELD_WITH_GROUP               ,"42000", "S1009" },
{ ER_WRONG_GROUP_FIELD                    ,"42000", "S1009" },
{ ER_WRONG_SUM_SELECT                     ,"42000", "S1009" },
{ ER_WRONG_VALUE_COUNT                    ,"21S01", "" },
{ ER_TOO_LONG_IDENT                       ,"42000", "S1009" },
{ ER_DUP_FIELDNAME                        ,"42S21", "S1009" },
{ ER_DUP_KEYNAME                          ,"42000", "S1009" },
{ ER_DUP_ENTRY                            ,"23000", "S1009" },
{ ER_WRONG_FIELD_SPEC                     ,"42000", "S1009" },
{ ER_PARSE_ERROR                          ,"42000", "s1009" },
{ ER_EMPTY_QUERY                          ,"42000", "" },
{ ER_NONUNIQ_TABLE                        ,"42000", "S1009" },
{ ER_INVALID_DEFAULT                      ,"42000", "S1009" },
{ ER_MULTIPLE_PRI_KEY                     ,"42000", "S1009" },
{ ER_TOO_MANY_KEYS                        ,"42000", "S1009" },
{ ER_TOO_MANY_KEY_PARTS                   ,"42000", "S1009" },
{ ER_TOO_LONG_KEY                         ,"42000", "S1009" },
{ ER_KEY_COLUMN_DOES_NOT_EXITS            ,"42000", "S1009" },
{ ER_BLOB_USED_AS_KEY                     ,"42000", "S1009" },
{ ER_TOO_BIG_FIELDLENGTH                  ,"42000", "S1009" },
{ ER_WRONG_AUTO_KEY                       ,"42000", "S1009" },
{ ER_FORCING_CLOSE                        ,"08S01", "" },
{ ER_IPSOCK_ERROR                         ,"08S01", "" },
{ ER_NO_SUCH_INDEX                        ,"42S12", "S1009" },
{ ER_WRONG_FIELD_TERMINATORS              ,"42000", "S1009" },
{ ER_BLOBS_AND_NO_TERMINATED              ,"42000", "S1009" },
{ ER_CANT_REMOVE_ALL_FIELDS               ,"42000", "" },
{ ER_CANT_DROP_FIELD_OR_KEY               ,"42000", "" },
{ ER_WRONG_DB_NAME                        ,"42000", "" },
{ ER_WRONG_TABLE_NAME                     ,"42000", "" },
{ ER_TOO_BIG_SELECT                       ,"42000", "" },
{ ER_UNKNOWN_PROCEDURE                    ,"42000", "" },
{ ER_WRONG_PARAMCOUNT_TO_PROCEDURE        ,"42000", "" },
{ ER_UNKNOWN_TABLE                        ,"42S02", "" },
{ ER_FIELD_SPECIFIED_TWICE                ,"42000", "" },
{ ER_UNSUPPORTED_EXTENSION                ,"42000", "" },
{ ER_TABLE_MUST_HAVE_COLUMNS              ,"42000", "" },
{ ER_UNKNOWN_CHARACTER_SET                ,"42000", "" },
{ ER_TOO_BIG_ROWSIZE                      ,"42000", "" },
{ ER_WRONG_OUTER_JOIN                     ,"42000", "" },
{ ER_NULL_COLUMN_IN_INDEX                 ,"42000", "" },
{ ER_PASSWORD_ANONYMOUS_USER              ,"42000", "" },
{ ER_PASSWORD_NOT_ALLOWED                 ,"42000", "" },
{ ER_PASSWORD_NO_MATCH                    ,"28000", "" },
{ ER_WRONG_VALUE_COUNT_ON_ROW             ,"21S01", "" },
{ ER_INVALID_USE_OF_NULL                  ,"22004", "" },
{ ER_REGEXP_ERROR                         ,"42000", "" },
{ ER_MIX_OF_GROUP_FUNC_AND_FIELDS         ,"42000", "" },
{ ER_NONEXISTING_GRANT                    ,"42000", "" },
{ ER_TABLEACCESS_DENIED_ERROR             ,"42000", "" },
{ ER_COLUMNACCESS_DENIED_ERROR            ,"42000", "" },
{ ER_ILLEGAL_GRANT_FOR_TABLE              ,"42000", "" },
{ ER_GRANT_WRONG_HOST_OR_USER             ,"42000", "" },
{ ER_NO_SUCH_TABLE                        ,"42S02", "" },
{ ER_NONEXISTING_TABLE_GRANT              ,"42000", "" },
{ ER_NOT_ALLOWED_COMMAND                  ,"42000", "" },
{ ER_SYNTAX_ERROR                         ,"42000", "" },
{ ER_ABORTING_CONNECTION                  ,"08S01", "" },
{ ER_NET_PACKET_TOO_LARGE                 ,"08S01", "" },
{ ER_NET_READ_ERROR_FROM_PIPE             ,"08S01", "" },
{ ER_NET_FCNTL_ERROR                      ,"08S01", "" },
{ ER_NET_PACKETS_OUT_OF_ORDER             ,"08S01", "" },
{ ER_NET_UNCOMPRESS_ERROR                 ,"08S01", "" },
{ ER_NET_READ_ERROR                       ,"08S01", "" },
{ ER_NET_READ_INTERRUPTED                 ,"08S01", "" },
{ ER_NET_ERROR_ON_WRITE                   ,"08S01", "" },
{ ER_NET_WRITE_INTERRUPTED                ,"08S01", "" },
{ ER_TOO_LONG_STRING                      ,"42000", "" },
{ ER_TABLE_CANT_HANDLE_BLOB               ,"42000", "" },
{ ER_TABLE_CANT_HANDLE_AUTO_INCREMENT     ,"42000", "" },
{ ER_WRONG_COLUMN_NAME                    ,"42000", "" },
{ ER_WRONG_KEY_COLUMN                     ,"42000", "" },
{ ER_DUP_UNIQUE                           ,"23000", "" },
{ ER_BLOB_KEY_WITHOUT_LENGTH              ,"42000", "" },
{ ER_PRIMARY_CANT_HAVE_NULL               ,"42000", "" },
{ ER_TOO_MANY_ROWS                        ,"42000", "" },
{ ER_REQUIRES_PRIMARY_KEY                 ,"42000", "" },
{ ER_KEY_DOES_NOT_EXISTS                  ,"42000", "S1009" },
{ ER_CHECK_NO_SUCH_TABLE                  ,"42000", "" },
{ ER_CHECK_NOT_IMPLEMENTED                ,"42000", "" },
{ ER_CANT_DO_THIS_DURING_AN_TRANSACTION   ,"25000", "" },
{ ER_NEW_ABORTING_CONNECTION              ,"08S01", "" },
{ ER_MASTER_NET_READ                      ,"08S01", "" },
{ ER_MASTER_NET_WRITE                     ,"08S01", "" },
{ ER_TOO_MANY_USER_CONNECTIONS            ,"42000", "" },
{ ER_READ_ONLY_TRANSACTION                ,"25000", "" },
{ ER_NO_PERMISSION_TO_CREATE_USER         ,"42000", "" },
{ ER_LOCK_DEADLOCK                        ,"40001", "" },
{ ER_NO_REFERENCED_ROW                    ,"23000", "" },
{ ER_ROW_IS_REFERENCED                    ,"23000", "" },
{ ER_CONNECT_TO_MASTER                    ,"08S01", "" },
{ ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT    ,"21000", "" },
{ ER_USER_LIMIT_REACHED                   ,"42000", "" },
{ ER_SPECIFIC_ACCESS_DENIED_ERROR         ,"42000", "" },
{ ER_NO_DEFAULT                           ,"42000", "" },
{ ER_WRONG_VALUE_FOR_VAR                  ,"42000", "" },
{ ER_WRONG_TYPE_FOR_VAR                   ,"42000", "" },
{ ER_CANT_USE_OPTION_HERE                 ,"42000", "" },
{ ER_NOT_SUPPORTED_YET                    ,"42000", "" },
{ ER_WRONG_FK_DEF                         ,"42000", "" },
{ ER_OPERAND_COLUMNS                      ,"21000", "" },
{ ER_SUBQUERY_NO_1_ROW                    ,"21000", "" },
{ ER_ILLEGAL_REFERENCE                    ,"42S22", "" },
{ ER_DERIVED_MUST_HAVE_ALIAS              ,"42000", "" },
{ ER_SELECT_REDUCED                       ,"01000", "" },
{ ER_TABLENAME_NOT_ALLOWED_HERE           ,"42000", "" },
{ ER_NOT_SUPPORTED_AUTH_MODE              ,"08004", "" },
{ ER_SPATIAL_CANT_HAVE_NULL               ,"42000", "" },
{ ER_COLLATION_CHARSET_MISMATCH           ,"42000", "" },
{ ER_WARN_TOO_FEW_RECORDS                 ,"01000", "" },
{ ER_WARN_TOO_MANY_RECORDS                ,"01000", "" },
{ ER_WARN_NULL_TO_NOTNULL                 ,"22004", "" },
{ ER_WARN_DATA_OUT_OF_RANGE               ,"22003", "" },
{ WARN_DATA_TRUNCATED                     ,"01000", "" },
{ ER_WRONG_NAME_FOR_INDEX                 ,"42000", "" },
{ ER_WRONG_NAME_FOR_CATALOG               ,"42000", "" },
{ ER_UNKNOWN_STORAGE_ENGINE               ,"42000", "" },
{ ER_TRUNCATED_WRONG_VALUE                ,"22007", "" },
{ ER_SP_NO_RECURSIVE_CREATE               ,"2F003", "" },
{ ER_SP_ALREADY_EXISTS                    ,"42000", "" },
{ ER_SP_DOES_NOT_EXIST                    ,"42000", "" },
{ ER_SP_LILABEL_MISMATCH                  ,"42000", "" },
{ ER_SP_LABEL_REDEFINE                    ,"42000", "" },
{ ER_SP_LABEL_MISMATCH                    ,"42000", "" },
{ ER_SP_UNINIT_VAR                        ,"01000", "" },
{ ER_SP_BADSELECT                         ,"0A000", "" },
{ ER_SP_BADRETURN                         ,"42000", "" },
{ ER_SP_BADSTATEMENT                      ,"0A000", "" },
{ ER_UPDATE_LOG_DEPRECATED_IGNORED        ,"42000", "" },
{ ER_UPDATE_LOG_DEPRECATED_TRANSLATED     ,"42000", "" },
{ ER_QUERY_INTERRUPTED                    ,"70100", "" },
{ ER_SP_WRONG_NO_OF_ARGS                  ,"42000", "" },
{ ER_SP_COND_MISMATCH                     ,"42000", "" },
{ ER_SP_NORETURN                          ,"42000", "" },
{ ER_SP_NORETURNEND                       ,"2F005", "" },
{ ER_SP_BAD_CURSOR_QUERY                  ,"42000", "" },
{ ER_SP_BAD_CURSOR_SELECT                 ,"42000", "" },
{ ER_SP_CURSOR_MISMATCH                   ,"42000", "" },
{ ER_SP_CURSOR_ALREADY_OPEN               ,"24000", "" },
{ ER_SP_CURSOR_NOT_OPEN                   ,"24000", "" },
{ ER_SP_UNDECLARED_VAR                    ,"42000", "" },
{ ER_SP_FETCH_NO_DATA                     ,"02000", "" },
{ ER_SP_DUP_PARAM                         ,"42000", "" },
{ ER_SP_DUP_VAR                           ,"42000", "" },
{ ER_SP_DUP_COND                          ,"42000", "" },
{ ER_SP_DUP_CURS                          ,"42000", "" },
{ ER_SP_SUBSELECT_NYI                     ,"0A000", "" },
{ ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG        ,"0A000", "" },
{ ER_SP_VARCOND_AFTER_CURSHNDLR           ,"42000", "" },
{ ER_SP_CURSOR_AFTER_HANDLER              ,"42000", "" },
{ ER_SP_CASE_NOT_FOUND                    ,"20000", "" },
{ ER_DIVISION_BY_ZERO                     ,"22012", "" },
{ ER_TRUNCATED_WRONG_VALUE_FOR_FIELD      ,"22007", "" },
{ ER_ILLEGAL_VALUE_FOR_TYPE               ,"22007", "" },
{ ER_VIEW_CHECK_FAILED                    ,"44000", "" },
{ ER_PROCACCESS_DENIED_ERROR              ,"42000", "" },
{ ER_XAER_NOTA                            ,"XAE04", "" },
{ ER_XAER_INVAL                           ,"XAE05", "" },
{ ER_XAER_RMFAIL                          ,"XAE07", "" },
{ ER_XAER_OUTSIDE                         ,"XAE09", "" },
{ ER_XAER_RMERR                           ,"XAE03", "" },
{ ER_XA_RBROLLBACK                        ,"XA100", "" },
{ ER_NONEXISTING_PROC_GRANT               ,"42000", "" },
{ ER_DATA_TOO_LONG                        ,"22001", "" },
{ ER_SP_BAD_SQLSTATE                      ,"42000", "" },
{ ER_CANT_CREATE_USER_WITH_GRANT          ,"42000", "" },
{ ER_SP_DUP_HANDLER                       ,"42000", "" },
{ ER_SP_NOT_VAR_ARG                       ,"42000", "" },
{ ER_SP_NO_RETSET                         ,"0A000", "" },
{ ER_CANT_CREATE_GEOMETRY_OBJECT          ,"22003", "" },
{ ER_TOO_BIG_SCALE                        ,"42000", "S1009" },
{ ER_TOO_BIG_PRECISION                    ,"42000", "S1009" },
{ ER_M_BIGGER_THAN_D                      ,"42000", "S1009" },
{ ER_TOO_LONG_BODY                        ,"42000", "S1009" },
{ ER_TOO_BIG_DISPLAYWIDTH                 ,"42000", "S1009" },
{ ER_XAER_DUPID                           ,"XAE08", "" },
{ ER_DATETIME_FUNCTION_OVERFLOW           ,"22008", "" },
{ ER_MALFORMED_DEFINER                    ,"0L000", "" },
{ ER_ROW_IS_REFERENCED_2                  ,"23000", "" },
{ ER_NO_REFERENCED_ROW_2                  ,"23000", "" },
{ ER_SP_BAD_VAR_SHADOW                    ,"42000", "" },
{ ER_SP_WRONG_NAME                        ,"42000", "" },
{ ER_SP_NO_AGGREGATE                      ,"42000", "" },
{ ER_MAX_PREPARED_STMT_COUNT_REACHED      ,"42000", "" },
{ ER_NON_GROUPING_FIELD_USED              ,"42000", "" },
{ ER_CANT_CHANGE_TX_CHARACTERISTICS       ,"25001", "" },
{ ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT       ,"42000", "" },
{ ER_WRONG_PARAMETERS_TO_NATIVE_FCT       ,"42000", "" },
{ ER_WRONG_PARAMETERS_TO_STORED_FCT       ,"42000", "" },
{ ER_DUP_ENTRY_WITH_KEY_NAME              ,"23000", "S1009" },
{ ER_XA_RBTIMEOUT                         ,"XA106", "" },
{ ER_XA_RBDEADLOCK                        ,"XA102", "" },
{ ER_FUNC_INEXISTENT_NAME_COLLISION       ,"42000", "" },
{ ER_DUP_SIGNAL_SET                       ,"42000", "" },
{ ER_SIGNAL_WARN                          ,"01000", "" },
{ ER_SIGNAL_NOT_FOUND                     ,"02000", "" },
{ ER_SIGNAL_EXCEPTION                     ,"HY000", "" },
{ ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER      ,"0K000", "" },
{ ER_SPATIAL_MUST_HAVE_GEOM_COL           ,"42000", "" },
{ ER_DATA_OUT_OF_RANGE                    ,"22003", "" },
{ ER_ACCESS_DENIED_NO_PASSWORD_ERROR      ,"28000", "" },
{ ER_TRUNCATE_ILLEGAL_FK                  ,"42000", "" },
{ ER_DA_INVALID_CONDITION_NUMBER          ,"35000", "" },
{ ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO,"23000", "S1009" },
{ ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO,"23000", "S1009" },
{ ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION,"25006", "" },
{ ER_ALTER_OPERATION_NOT_SUPPORTED        ,"0A000", "" },
{ ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ,"0A000", "" },
{ ER_DUP_UNKNOWN_IN_INDEX                 ,"23000", "" },
{ ER_ACCESS_DENIED_CHANGE_USER_ERROR      ,"28000", "" },
{ ER_DATA_OVERFLOW                        ,"22003", "" },
{ ER_DATA_TRUNCATED                       ,"22003", "" },
{ ER_BAD_DATA                             ,"22007", "" },
{ ER_DYN_COL_DATA                         ,"22007", "" },
{ ER_CONNECTION_KILLED                    ,"70100", "" },
{ ER_NO_SUCH_TABLE_IN_ENGINE              ,"42S02", "" },
{ ER_INVALID_ROLE                         ,"OP000", "" },
{ ER_INVALID_CURRENT_USER                 ,"0L000", "" },
{ ER_IT_IS_A_VIEW                         ,"42S02", "" },
{ ER_STATEMENT_TIMEOUT                    ,"70100", "" },
{ ER_SUBQUERIES_NOT_SUPPORTED             ,"42000", "" },
{ ER_SET_STATEMENT_NOT_SUPPORTED          ,"42000", "" },
{ ER_INVALID_DEFAULT_VALUE_FOR_FIELD      ,"22007", "" },
{ ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER,"0Z002", "" },
{ ER_INVALID_ARGUMENT_FOR_LOGARITHM       ,"2201E", "" },
{ ER_GIS_INVALID_DATA                     ,"22023", "" },
{ ER_USER_LOCK_WRONG_NAME                 ,"42000", "" },
{ ER_UNUSED_26                            ,"0A000", "" },
{ ER_CONSTRAINT_FAILED                    ,"23000", "" },
{ ER_EXPRESSION_REFERS_TO_UNINIT_FIELD    ,"01000", "" },
{ ER_WRONG_PARAMCOUNT_TO_CURSOR           ,"42000", "" },
{ ER_NOT_SEQUENCE                         ,"42S02", "" },
{ ER_NOT_SEQUENCE2                        ,"42S02", "" },
{ ER_UNKNOWN_SEQUENCES                    ,"42S02", "" },
{ ER_UNKNOWN_VIEW                         ,"42S02", "" },
{ ER_TOO_LONG_KEYPART                     ,"42000", "S1009" },
server/mysqld_error.h000064400000135573150400263660010765 0ustar00/* Autogenerated file, please don't edit */

#ifndef ER_ERROR_FIRST
#define ER_ERROR_FIRST 1000
#define ER_HASHCHK 1000
#define ER_NISAMCHK 1001
#define ER_NO 1002
#define ER_YES 1003
#define ER_CANT_CREATE_FILE 1004
#define ER_CANT_CREATE_TABLE 1005
#define ER_CANT_CREATE_DB 1006
#define ER_DB_CREATE_EXISTS 1007
#define ER_DB_DROP_EXISTS 1008
#define ER_DB_DROP_DELETE 1009
#define ER_DB_DROP_RMDIR 1010
#define ER_CANT_DELETE_FILE 1011
#define ER_CANT_FIND_SYSTEM_REC 1012
#define ER_CANT_GET_STAT 1013
#define ER_CANT_GET_WD 1014
#define ER_CANT_LOCK 1015
#define ER_CANT_OPEN_FILE 1016
#define ER_FILE_NOT_FOUND 1017
#define ER_CANT_READ_DIR 1018
#define ER_CANT_SET_WD 1019
#define ER_CHECKREAD 1020
#define ER_DISK_FULL 1021
#define ER_DUP_KEY 1022
#define ER_ERROR_ON_CLOSE 1023
#define ER_ERROR_ON_READ 1024
#define ER_ERROR_ON_RENAME 1025
#define ER_ERROR_ON_WRITE 1026
#define ER_FILE_USED 1027
#define ER_FILSORT_ABORT 1028
#define ER_FORM_NOT_FOUND 1029
#define ER_GET_ERRNO 1030
#define ER_ILLEGAL_HA 1031
#define ER_KEY_NOT_FOUND 1032
#define ER_NOT_FORM_FILE 1033
#define ER_NOT_KEYFILE 1034
#define ER_OLD_KEYFILE 1035
#define ER_OPEN_AS_READONLY 1036
#define ER_OUTOFMEMORY 1037
#define ER_OUT_OF_SORTMEMORY 1038
#define ER_UNEXPECTED_EOF 1039
#define ER_CON_COUNT_ERROR 1040
#define ER_OUT_OF_RESOURCES 1041
#define ER_BAD_HOST_ERROR 1042
#define ER_HANDSHAKE_ERROR 1043
#define ER_DBACCESS_DENIED_ERROR 1044
#define ER_ACCESS_DENIED_ERROR 1045
#define ER_NO_DB_ERROR 1046
#define ER_UNKNOWN_COM_ERROR 1047
#define ER_BAD_NULL_ERROR 1048
#define ER_BAD_DB_ERROR 1049
#define ER_TABLE_EXISTS_ERROR 1050
#define ER_BAD_TABLE_ERROR 1051
#define ER_NON_UNIQ_ERROR 1052
#define ER_SERVER_SHUTDOWN 1053
#define ER_BAD_FIELD_ERROR 1054
#define ER_WRONG_FIELD_WITH_GROUP 1055
#define ER_WRONG_GROUP_FIELD 1056
#define ER_WRONG_SUM_SELECT 1057
#define ER_WRONG_VALUE_COUNT 1058
#define ER_TOO_LONG_IDENT 1059
#define ER_DUP_FIELDNAME 1060
#define ER_DUP_KEYNAME 1061
#define ER_DUP_ENTRY 1062
#define ER_WRONG_FIELD_SPEC 1063
#define ER_PARSE_ERROR 1064
#define ER_EMPTY_QUERY 1065
#define ER_NONUNIQ_TABLE 1066
#define ER_INVALID_DEFAULT 1067
#define ER_MULTIPLE_PRI_KEY 1068
#define ER_TOO_MANY_KEYS 1069
#define ER_TOO_MANY_KEY_PARTS 1070
#define ER_TOO_LONG_KEY 1071
#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072
#define ER_BLOB_USED_AS_KEY 1073
#define ER_TOO_BIG_FIELDLENGTH 1074
#define ER_WRONG_AUTO_KEY 1075
#define ER_BINLOG_CANT_DELETE_GTID_DOMAIN 1076
#define ER_NORMAL_SHUTDOWN 1077
#define ER_GOT_SIGNAL 1078
#define ER_SHUTDOWN_COMPLETE 1079
#define ER_FORCING_CLOSE 1080
#define ER_IPSOCK_ERROR 1081
#define ER_NO_SUCH_INDEX 1082
#define ER_WRONG_FIELD_TERMINATORS 1083
#define ER_BLOBS_AND_NO_TERMINATED 1084
#define ER_TEXTFILE_NOT_READABLE 1085
#define ER_FILE_EXISTS_ERROR 1086
#define ER_LOAD_INFO 1087
#define ER_ALTER_INFO 1088
#define ER_WRONG_SUB_KEY 1089
#define ER_CANT_REMOVE_ALL_FIELDS 1090
#define ER_CANT_DROP_FIELD_OR_KEY 1091
#define ER_INSERT_INFO 1092
#define ER_UPDATE_TABLE_USED 1093
#define ER_NO_SUCH_THREAD 1094
#define ER_KILL_DENIED_ERROR 1095
#define ER_NO_TABLES_USED 1096
#define ER_TOO_BIG_SET 1097
#define ER_NO_UNIQUE_LOGFILE 1098
#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099
#define ER_TABLE_NOT_LOCKED 1100
#define ER_UNUSED_17 1101
#define ER_WRONG_DB_NAME 1102
#define ER_WRONG_TABLE_NAME 1103
#define ER_TOO_BIG_SELECT 1104
#define ER_UNKNOWN_ERROR 1105
#define ER_UNKNOWN_PROCEDURE 1106
#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107
#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108
#define ER_UNKNOWN_TABLE 1109
#define ER_FIELD_SPECIFIED_TWICE 1110
#define ER_INVALID_GROUP_FUNC_USE 1111
#define ER_UNSUPPORTED_EXTENSION 1112
#define ER_TABLE_MUST_HAVE_COLUMNS 1113
#define ER_RECORD_FILE_FULL 1114
#define ER_UNKNOWN_CHARACTER_SET 1115
#define ER_TOO_MANY_TABLES 1116
#define ER_TOO_MANY_FIELDS 1117
#define ER_TOO_BIG_ROWSIZE 1118
#define ER_STACK_OVERRUN 1119
#define ER_WRONG_OUTER_JOIN 1120
#define ER_NULL_COLUMN_IN_INDEX 1121
#define ER_CANT_FIND_UDF 1122
#define ER_CANT_INITIALIZE_UDF 1123
#define ER_UDF_NO_PATHS 1124
#define ER_UDF_EXISTS 1125
#define ER_CANT_OPEN_LIBRARY 1126
#define ER_CANT_FIND_DL_ENTRY 1127
#define ER_FUNCTION_NOT_DEFINED 1128
#define ER_HOST_IS_BLOCKED 1129
#define ER_HOST_NOT_PRIVILEGED 1130
#define ER_PASSWORD_ANONYMOUS_USER 1131
#define ER_PASSWORD_NOT_ALLOWED 1132
#define ER_PASSWORD_NO_MATCH 1133
#define ER_UPDATE_INFO 1134
#define ER_CANT_CREATE_THREAD 1135
#define ER_WRONG_VALUE_COUNT_ON_ROW 1136
#define ER_CANT_REOPEN_TABLE 1137
#define ER_INVALID_USE_OF_NULL 1138
#define ER_REGEXP_ERROR 1139
#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140
#define ER_NONEXISTING_GRANT 1141
#define ER_TABLEACCESS_DENIED_ERROR 1142
#define ER_COLUMNACCESS_DENIED_ERROR 1143
#define ER_ILLEGAL_GRANT_FOR_TABLE 1144
#define ER_GRANT_WRONG_HOST_OR_USER 1145
#define ER_NO_SUCH_TABLE 1146
#define ER_NONEXISTING_TABLE_GRANT 1147
#define ER_NOT_ALLOWED_COMMAND 1148
#define ER_SYNTAX_ERROR 1149
#define ER_DELAYED_CANT_CHANGE_LOCK 1150
#define ER_TOO_MANY_DELAYED_THREADS 1151
#define ER_ABORTING_CONNECTION 1152
#define ER_NET_PACKET_TOO_LARGE 1153
#define ER_NET_READ_ERROR_FROM_PIPE 1154
#define ER_NET_FCNTL_ERROR 1155
#define ER_NET_PACKETS_OUT_OF_ORDER 1156
#define ER_NET_UNCOMPRESS_ERROR 1157
#define ER_NET_READ_ERROR 1158
#define ER_NET_READ_INTERRUPTED 1159
#define ER_NET_ERROR_ON_WRITE 1160
#define ER_NET_WRITE_INTERRUPTED 1161
#define ER_TOO_LONG_STRING 1162
#define ER_TABLE_CANT_HANDLE_BLOB 1163
#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164
#define ER_DELAYED_INSERT_TABLE_LOCKED 1165
#define ER_WRONG_COLUMN_NAME 1166
#define ER_WRONG_KEY_COLUMN 1167
#define ER_WRONG_MRG_TABLE 1168
#define ER_DUP_UNIQUE 1169
#define ER_BLOB_KEY_WITHOUT_LENGTH 1170
#define ER_PRIMARY_CANT_HAVE_NULL 1171
#define ER_TOO_MANY_ROWS 1172
#define ER_REQUIRES_PRIMARY_KEY 1173
#define ER_NO_RAID_COMPILED 1174
#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175
#define ER_KEY_DOES_NOT_EXISTS 1176
#define ER_CHECK_NO_SUCH_TABLE 1177
#define ER_CHECK_NOT_IMPLEMENTED 1178
#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179
#define ER_ERROR_DURING_COMMIT 1180
#define ER_ERROR_DURING_ROLLBACK 1181
#define ER_ERROR_DURING_FLUSH_LOGS 1182
#define ER_ERROR_DURING_CHECKPOINT 1183
#define ER_NEW_ABORTING_CONNECTION 1184
#define ER_UNUSED_10 1185
#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186
#define ER_INDEX_REBUILD 1187
#define ER_MASTER 1188
#define ER_MASTER_NET_READ 1189
#define ER_MASTER_NET_WRITE 1190
#define ER_FT_MATCHING_KEY_NOT_FOUND 1191
#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192
#define ER_UNKNOWN_SYSTEM_VARIABLE 1193
#define ER_CRASHED_ON_USAGE 1194
#define ER_CRASHED_ON_REPAIR 1195
#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196
#define ER_TRANS_CACHE_FULL 1197
#define ER_SLAVE_MUST_STOP 1198
#define ER_SLAVE_NOT_RUNNING 1199
#define ER_BAD_SLAVE 1200
#define ER_MASTER_INFO 1201
#define ER_SLAVE_THREAD 1202
#define ER_TOO_MANY_USER_CONNECTIONS 1203
#define ER_SET_CONSTANTS_ONLY 1204
#define ER_LOCK_WAIT_TIMEOUT 1205
#define ER_LOCK_TABLE_FULL 1206
#define ER_READ_ONLY_TRANSACTION 1207
#define ER_DROP_DB_WITH_READ_LOCK 1208
#define ER_CREATE_DB_WITH_READ_LOCK 1209
#define ER_WRONG_ARGUMENTS 1210
#define ER_NO_PERMISSION_TO_CREATE_USER 1211
#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212
#define ER_LOCK_DEADLOCK 1213
#define ER_TABLE_CANT_HANDLE_FT 1214
#define ER_CANNOT_ADD_FOREIGN 1215
#define ER_NO_REFERENCED_ROW 1216
#define ER_ROW_IS_REFERENCED 1217
#define ER_CONNECT_TO_MASTER 1218
#define ER_QUERY_ON_MASTER 1219
#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220
#define ER_WRONG_USAGE 1221
#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222
#define ER_CANT_UPDATE_WITH_READLOCK 1223
#define ER_MIXING_NOT_ALLOWED 1224
#define ER_DUP_ARGUMENT 1225
#define ER_USER_LIMIT_REACHED 1226
#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227
#define ER_LOCAL_VARIABLE 1228
#define ER_GLOBAL_VARIABLE 1229
#define ER_NO_DEFAULT 1230
#define ER_WRONG_VALUE_FOR_VAR 1231
#define ER_WRONG_TYPE_FOR_VAR 1232
#define ER_VAR_CANT_BE_READ 1233
#define ER_CANT_USE_OPTION_HERE 1234
#define ER_NOT_SUPPORTED_YET 1235
#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
#define ER_SLAVE_IGNORED_TABLE 1237
#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
#define ER_WRONG_FK_DEF 1239
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
#define ER_OPERAND_COLUMNS 1241
#define ER_SUBQUERY_NO_1_ROW 1242
#define ER_UNKNOWN_STMT_HANDLER 1243
#define ER_CORRUPT_HELP_DB 1244
#define ER_CYCLIC_REFERENCE 1245
#define ER_AUTO_CONVERT 1246
#define ER_ILLEGAL_REFERENCE 1247
#define ER_DERIVED_MUST_HAVE_ALIAS 1248
#define ER_SELECT_REDUCED 1249
#define ER_TABLENAME_NOT_ALLOWED_HERE 1250
#define ER_NOT_SUPPORTED_AUTH_MODE 1251
#define ER_SPATIAL_CANT_HAVE_NULL 1252
#define ER_COLLATION_CHARSET_MISMATCH 1253
#define ER_SLAVE_WAS_RUNNING 1254
#define ER_SLAVE_WAS_NOT_RUNNING 1255
#define ER_TOO_BIG_FOR_UNCOMPRESS 1256
#define ER_ZLIB_Z_MEM_ERROR 1257
#define ER_ZLIB_Z_BUF_ERROR 1258
#define ER_ZLIB_Z_DATA_ERROR 1259
#define ER_CUT_VALUE_GROUP_CONCAT 1260
#define ER_WARN_TOO_FEW_RECORDS 1261
#define ER_WARN_TOO_MANY_RECORDS 1262
#define ER_WARN_NULL_TO_NOTNULL 1263
#define ER_WARN_DATA_OUT_OF_RANGE 1264
#define WARN_DATA_TRUNCATED 1265
#define ER_WARN_USING_OTHER_HANDLER 1266
#define ER_CANT_AGGREGATE_2COLLATIONS 1267
#define ER_DROP_USER 1268
#define ER_REVOKE_GRANTS 1269
#define ER_CANT_AGGREGATE_3COLLATIONS 1270
#define ER_CANT_AGGREGATE_NCOLLATIONS 1271
#define ER_VARIABLE_IS_NOT_STRUCT 1272
#define ER_UNKNOWN_COLLATION 1273
#define ER_SLAVE_IGNORED_SSL_PARAMS 1274
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
#define ER_WARN_FIELD_RESOLVED 1276
#define ER_BAD_SLAVE_UNTIL_COND 1277
#define ER_MISSING_SKIP_SLAVE 1278
#define ER_UNTIL_COND_IGNORED 1279
#define ER_WRONG_NAME_FOR_INDEX 1280
#define ER_WRONG_NAME_FOR_CATALOG 1281
#define ER_WARN_QC_RESIZE 1282
#define ER_BAD_FT_COLUMN 1283
#define ER_UNKNOWN_KEY_CACHE 1284
#define ER_WARN_HOSTNAME_WONT_WORK 1285
#define ER_UNKNOWN_STORAGE_ENGINE 1286
#define ER_WARN_DEPRECATED_SYNTAX 1287
#define ER_NON_UPDATABLE_TABLE 1288
#define ER_FEATURE_DISABLED 1289
#define ER_OPTION_PREVENTS_STATEMENT 1290
#define ER_DUPLICATED_VALUE_IN_TYPE 1291
#define ER_TRUNCATED_WRONG_VALUE 1292
#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
#define ER_INVALID_ON_UPDATE 1294
#define ER_UNSUPPORTED_PS 1295
#define ER_GET_ERRMSG 1296
#define ER_GET_TEMPORARY_ERRMSG 1297
#define ER_UNKNOWN_TIME_ZONE 1298
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_CONFLICTING_DECLARATIONS 1302
#define ER_SP_NO_RECURSIVE_CREATE 1303
#define ER_SP_ALREADY_EXISTS 1304
#define ER_SP_DOES_NOT_EXIST 1305
#define ER_SP_DROP_FAILED 1306
#define ER_SP_STORE_FAILED 1307
#define ER_SP_LILABEL_MISMATCH 1308
#define ER_SP_LABEL_REDEFINE 1309
#define ER_SP_LABEL_MISMATCH 1310
#define ER_SP_UNINIT_VAR 1311
#define ER_SP_BADSELECT 1312
#define ER_SP_BADRETURN 1313
#define ER_SP_BADSTATEMENT 1314
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316
#define ER_QUERY_INTERRUPTED 1317
#define ER_SP_WRONG_NO_OF_ARGS 1318
#define ER_SP_COND_MISMATCH 1319
#define ER_SP_NORETURN 1320
#define ER_SP_NORETURNEND 1321
#define ER_SP_BAD_CURSOR_QUERY 1322
#define ER_SP_BAD_CURSOR_SELECT 1323
#define ER_SP_CURSOR_MISMATCH 1324
#define ER_SP_CURSOR_ALREADY_OPEN 1325
#define ER_SP_CURSOR_NOT_OPEN 1326
#define ER_SP_UNDECLARED_VAR 1327
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328
#define ER_SP_FETCH_NO_DATA 1329
#define ER_SP_DUP_PARAM 1330
#define ER_SP_DUP_VAR 1331
#define ER_SP_DUP_COND 1332
#define ER_SP_DUP_CURS 1333
#define ER_SP_CANT_ALTER 1334
#define ER_SP_SUBSELECT_NYI 1335
#define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1337
#define ER_SP_CURSOR_AFTER_HANDLER 1338
#define ER_SP_CASE_NOT_FOUND 1339
#define ER_FPARSER_TOO_BIG_FILE 1340
#define ER_FPARSER_BAD_HEADER 1341
#define ER_FPARSER_EOF_IN_COMMENT 1342
#define ER_FPARSER_ERROR_IN_PARAMETER 1343
#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344
#define ER_VIEW_NO_EXPLAIN 1345
#define ER_FRM_UNKNOWN_TYPE 1346
#define ER_WRONG_OBJECT 1347
#define ER_NONUPDATEABLE_COLUMN 1348
#define ER_VIEW_SELECT_DERIVED 1349
#define ER_VIEW_SELECT_CLAUSE 1350
#define ER_VIEW_SELECT_VARIABLE 1351
#define ER_VIEW_SELECT_TMPTABLE 1352
#define ER_VIEW_WRONG_LIST 1353
#define ER_WARN_VIEW_MERGE 1354
#define ER_WARN_VIEW_WITHOUT_KEY 1355
#define ER_VIEW_INVALID 1356
#define ER_SP_NO_DROP_SP 1357
#define ER_SP_GOTO_IN_HNDLR 1358
#define ER_TRG_ALREADY_EXISTS 1359
#define ER_TRG_DOES_NOT_EXIST 1360
#define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361
#define ER_TRG_CANT_CHANGE_ROW 1362
#define ER_TRG_NO_SUCH_ROW_IN_TRG 1363
#define ER_NO_DEFAULT_FOR_FIELD 1364
#define ER_DIVISION_BY_ZERO 1365
#define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366
#define ER_ILLEGAL_VALUE_FOR_TYPE 1367
#define ER_VIEW_NONUPD_CHECK 1368
#define ER_VIEW_CHECK_FAILED 1369
#define ER_PROCACCESS_DENIED_ERROR 1370
#define ER_RELAY_LOG_FAIL 1371
#define ER_PASSWD_LENGTH 1372
#define ER_UNKNOWN_TARGET_BINLOG 1373
#define ER_IO_ERR_LOG_INDEX_READ 1374
#define ER_BINLOG_PURGE_PROHIBITED 1375
#define ER_FSEEK_FAIL 1376
#define ER_BINLOG_PURGE_FATAL_ERR 1377
#define ER_LOG_IN_USE 1378
#define ER_LOG_PURGE_UNKNOWN_ERR 1379
#define ER_RELAY_LOG_INIT 1380
#define ER_NO_BINARY_LOGGING 1381
#define ER_RESERVED_SYNTAX 1382
#define ER_WSAS_FAILED 1383
#define ER_DIFF_GROUPS_PROC 1384
#define ER_NO_GROUP_FOR_PROC 1385
#define ER_ORDER_WITH_PROC 1386
#define ER_LOGGING_PROHIBIT_CHANGING_OF 1387
#define ER_NO_FILE_MAPPING 1388
#define ER_WRONG_MAGIC 1389
#define ER_PS_MANY_PARAM 1390
#define ER_KEY_PART_0 1391
#define ER_VIEW_CHECKSUM 1392
#define ER_VIEW_MULTIUPDATE 1393
#define ER_VIEW_NO_INSERT_FIELD_LIST 1394
#define ER_VIEW_DELETE_MERGE_VIEW 1395
#define ER_CANNOT_USER 1396
#define ER_XAER_NOTA 1397
#define ER_XAER_INVAL 1398
#define ER_XAER_RMFAIL 1399
#define ER_XAER_OUTSIDE 1400
#define ER_XAER_RMERR 1401
#define ER_XA_RBROLLBACK 1402
#define ER_NONEXISTING_PROC_GRANT 1403
#define ER_PROC_AUTO_GRANT_FAIL 1404
#define ER_PROC_AUTO_REVOKE_FAIL 1405
#define ER_DATA_TOO_LONG 1406
#define ER_SP_BAD_SQLSTATE 1407
#define ER_STARTUP 1408
#define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409
#define ER_CANT_CREATE_USER_WITH_GRANT 1410
#define ER_WRONG_VALUE_FOR_TYPE 1411
#define ER_TABLE_DEF_CHANGED 1412
#define ER_SP_DUP_HANDLER 1413
#define ER_SP_NOT_VAR_ARG 1414
#define ER_SP_NO_RETSET 1415
#define ER_CANT_CREATE_GEOMETRY_OBJECT 1416
#define ER_FAILED_ROUTINE_BREAK_BINLOG 1417
#define ER_BINLOG_UNSAFE_ROUTINE 1418
#define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419
#define ER_EXEC_STMT_WITH_OPEN_CURSOR 1420
#define ER_STMT_HAS_NO_OPEN_CURSOR 1421
#define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422
#define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423
#define ER_SP_NO_RECURSION 1424
#define ER_TOO_BIG_SCALE 1425
#define ER_TOO_BIG_PRECISION 1426
#define ER_M_BIGGER_THAN_D 1427
#define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428
#define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429
#define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430
#define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431
#define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432
#define ER_FOREIGN_DATA_STRING_INVALID 1433
#define ER_CANT_CREATE_FEDERATED_TABLE 1434
#define ER_TRG_IN_WRONG_SCHEMA 1435
#define ER_STACK_OVERRUN_NEED_MORE 1436
#define ER_TOO_LONG_BODY 1437
#define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438
#define ER_TOO_BIG_DISPLAYWIDTH 1439
#define ER_XAER_DUPID 1440
#define ER_DATETIME_FUNCTION_OVERFLOW 1441
#define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442
#define ER_VIEW_PREVENT_UPDATE 1443
#define ER_PS_NO_RECURSION 1444
#define ER_SP_CANT_SET_AUTOCOMMIT 1445
#define ER_MALFORMED_DEFINER 1446
#define ER_VIEW_FRM_NO_USER 1447
#define ER_VIEW_OTHER_USER 1448
#define ER_NO_SUCH_USER 1449
#define ER_FORBID_SCHEMA_CHANGE 1450
#define ER_ROW_IS_REFERENCED_2 1451
#define ER_NO_REFERENCED_ROW_2 1452
#define ER_SP_BAD_VAR_SHADOW 1453
#define ER_TRG_NO_DEFINER 1454
#define ER_OLD_FILE_FORMAT 1455
#define ER_SP_RECURSION_LIMIT 1456
#define ER_SP_PROC_TABLE_CORRUPT 1457
#define ER_SP_WRONG_NAME 1458
#define ER_TABLE_NEEDS_UPGRADE 1459
#define ER_SP_NO_AGGREGATE 1460
#define ER_MAX_PREPARED_STMT_COUNT_REACHED 1461
#define ER_VIEW_RECURSIVE 1462
#define ER_NON_GROUPING_FIELD_USED 1463
#define ER_TABLE_CANT_HANDLE_SPKEYS 1464
#define ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA 1465
#define ER_REMOVED_SPACES 1466
#define ER_AUTOINC_READ_FAILED 1467
#define ER_USERNAME 1468
#define ER_HOSTNAME 1469
#define ER_WRONG_STRING_LENGTH 1470
#define ER_NON_INSERTABLE_TABLE 1471
#define ER_ADMIN_WRONG_MRG_TABLE 1472
#define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473
#define ER_NAME_BECOMES_EMPTY 1474
#define ER_AMBIGUOUS_FIELD_TERM 1475
#define ER_FOREIGN_SERVER_EXISTS 1476
#define ER_FOREIGN_SERVER_DOESNT_EXIST 1477
#define ER_ILLEGAL_HA_CREATE_OPTION 1478
#define ER_PARTITION_REQUIRES_VALUES_ERROR 1479
#define ER_PARTITION_WRONG_VALUES_ERROR 1480
#define ER_PARTITION_MAXVALUE_ERROR 1481
#define ER_PARTITION_SUBPARTITION_ERROR 1482
#define ER_PARTITION_SUBPART_MIX_ERROR 1483
#define ER_PARTITION_WRONG_NO_PART_ERROR 1484
#define ER_PARTITION_WRONG_NO_SUBPART_ERROR 1485
#define ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR 1486
#define ER_NOT_CONSTANT_EXPRESSION 1487
#define ER_FIELD_NOT_FOUND_PART_ERROR 1488
#define ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR 1489
#define ER_INCONSISTENT_PARTITION_INFO_ERROR 1490
#define ER_PARTITION_FUNC_NOT_ALLOWED_ERROR 1491
#define ER_PARTITIONS_MUST_BE_DEFINED_ERROR 1492
#define ER_RANGE_NOT_INCREASING_ERROR 1493
#define ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR 1494
#define ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR 1495
#define ER_PARTITION_ENTRY_ERROR 1496
#define ER_MIX_HANDLER_ERROR 1497
#define ER_PARTITION_NOT_DEFINED_ERROR 1498
#define ER_TOO_MANY_PARTITIONS_ERROR 1499
#define ER_SUBPARTITION_ERROR 1500
#define ER_CANT_CREATE_HANDLER_FILE 1501
#define ER_BLOB_FIELD_IN_PART_FUNC_ERROR 1502
#define ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF 1503
#define ER_NO_PARTS_ERROR 1504
#define ER_PARTITION_MGMT_ON_NONPARTITIONED 1505
#define ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING 1506
#define ER_DROP_PARTITION_NON_EXISTENT 1507
#define ER_DROP_LAST_PARTITION 1508
#define ER_COALESCE_ONLY_ON_HASH_PARTITION 1509
#define ER_REORG_HASH_ONLY_ON_SAME_NO 1510
#define ER_REORG_NO_PARAM_ERROR 1511
#define ER_ONLY_ON_RANGE_LIST_PARTITION 1512
#define ER_ADD_PARTITION_SUBPART_ERROR 1513
#define ER_ADD_PARTITION_NO_NEW_PARTITION 1514
#define ER_COALESCE_PARTITION_NO_PARTITION 1515
#define ER_REORG_PARTITION_NOT_EXIST 1516
#define ER_SAME_NAME_PARTITION 1517
#define ER_NO_BINLOG_ERROR 1518
#define ER_CONSECUTIVE_REORG_PARTITIONS 1519
#define ER_REORG_OUTSIDE_RANGE 1520
#define ER_PARTITION_FUNCTION_FAILURE 1521
#define ER_PART_STATE_ERROR 1522
#define ER_LIMITED_PART_RANGE 1523
#define ER_PLUGIN_IS_NOT_LOADED 1524
#define ER_WRONG_VALUE 1525
#define ER_NO_PARTITION_FOR_GIVEN_VALUE 1526
#define ER_FILEGROUP_OPTION_ONLY_ONCE 1527
#define ER_CREATE_FILEGROUP_FAILED 1528
#define ER_DROP_FILEGROUP_FAILED 1529
#define ER_TABLESPACE_AUTO_EXTEND_ERROR 1530
#define ER_WRONG_SIZE_NUMBER 1531
#define ER_SIZE_OVERFLOW_ERROR 1532
#define ER_ALTER_FILEGROUP_FAILED 1533
#define ER_BINLOG_ROW_LOGGING_FAILED 1534
#define ER_BINLOG_ROW_WRONG_TABLE_DEF 1535
#define ER_BINLOG_ROW_RBR_TO_SBR 1536
#define ER_EVENT_ALREADY_EXISTS 1537
#define ER_EVENT_STORE_FAILED 1538
#define ER_EVENT_DOES_NOT_EXIST 1539
#define ER_EVENT_CANT_ALTER 1540
#define ER_EVENT_DROP_FAILED 1541
#define ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG 1542
#define ER_EVENT_ENDS_BEFORE_STARTS 1543
#define ER_EVENT_EXEC_TIME_IN_THE_PAST 1544
#define ER_EVENT_OPEN_TABLE_FAILED 1545
#define ER_EVENT_NEITHER_M_EXPR_NOR_M_AT 1546
#define ER_UNUSED_2 1547
#define ER_UNUSED_3 1548
#define ER_EVENT_CANNOT_DELETE 1549
#define ER_EVENT_COMPILE_ERROR 1550
#define ER_EVENT_SAME_NAME 1551
#define ER_EVENT_DATA_TOO_LONG 1552
#define ER_DROP_INDEX_FK 1553
#define ER_WARN_DEPRECATED_SYNTAX_WITH_VER 1554
#define ER_CANT_WRITE_LOCK_LOG_TABLE 1555
#define ER_CANT_LOCK_LOG_TABLE 1556
#define ER_UNUSED_4 1557
#define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE 1558
#define ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR 1559
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT 1560
#define ER_UNUSED_13 1561
#define ER_PARTITION_NO_TEMPORARY 1562
#define ER_PARTITION_CONST_DOMAIN_ERROR 1563
#define ER_PARTITION_FUNCTION_IS_NOT_ALLOWED 1564
#define ER_DDL_LOG_ERROR 1565
#define ER_NULL_IN_VALUES_LESS_THAN 1566
#define ER_WRONG_PARTITION_NAME 1567
#define ER_CANT_CHANGE_TX_CHARACTERISTICS 1568
#define ER_DUP_ENTRY_AUTOINCREMENT_CASE 1569
#define ER_EVENT_MODIFY_QUEUE_ERROR 1570
#define ER_EVENT_SET_VAR_ERROR 1571
#define ER_PARTITION_MERGE_ERROR 1572
#define ER_CANT_ACTIVATE_LOG 1573
#define ER_RBR_NOT_AVAILABLE 1574
#define ER_BASE64_DECODE_ERROR 1575
#define ER_EVENT_RECURSION_FORBIDDEN 1576
#define ER_EVENTS_DB_ERROR 1577
#define ER_ONLY_INTEGERS_ALLOWED 1578
#define ER_UNSUPORTED_LOG_ENGINE 1579
#define ER_BAD_LOG_STATEMENT 1580
#define ER_CANT_RENAME_LOG_TABLE 1581
#define ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 1582
#define ER_WRONG_PARAMETERS_TO_NATIVE_FCT 1583
#define ER_WRONG_PARAMETERS_TO_STORED_FCT 1584
#define ER_NATIVE_FCT_NAME_COLLISION 1585
#define ER_DUP_ENTRY_WITH_KEY_NAME 1586
#define ER_BINLOG_PURGE_EMFILE 1587
#define ER_EVENT_CANNOT_CREATE_IN_THE_PAST 1588
#define ER_EVENT_CANNOT_ALTER_IN_THE_PAST 1589
#define ER_SLAVE_INCIDENT 1590
#define ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT 1591
#define ER_BINLOG_UNSAFE_STATEMENT 1592
#define ER_SLAVE_FATAL_ERROR 1593
#define ER_SLAVE_RELAY_LOG_READ_FAILURE 1594
#define ER_SLAVE_RELAY_LOG_WRITE_FAILURE 1595
#define ER_SLAVE_CREATE_EVENT_FAILURE 1596
#define ER_SLAVE_MASTER_COM_FAILURE 1597
#define ER_BINLOG_LOGGING_IMPOSSIBLE 1598
#define ER_VIEW_NO_CREATION_CTX 1599
#define ER_VIEW_INVALID_CREATION_CTX 1600
#define ER_SR_INVALID_CREATION_CTX 1601
#define ER_TRG_CORRUPTED_FILE 1602
#define ER_TRG_NO_CREATION_CTX 1603
#define ER_TRG_INVALID_CREATION_CTX 1604
#define ER_EVENT_INVALID_CREATION_CTX 1605
#define ER_TRG_CANT_OPEN_TABLE 1606
#define ER_CANT_CREATE_SROUTINE 1607
#define ER_UNUSED_11 1608
#define ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT 1609
#define ER_SLAVE_CORRUPT_EVENT 1610
#define ER_LOAD_DATA_INVALID_COLUMN 1611
#define ER_LOG_PURGE_NO_FILE 1612
#define ER_XA_RBTIMEOUT 1613
#define ER_XA_RBDEADLOCK 1614
#define ER_NEED_REPREPARE 1615
#define ER_DELAYED_NOT_SUPPORTED 1616
#define WARN_NO_MASTER_INFO 1617
#define WARN_OPTION_IGNORED 1618
#define ER_PLUGIN_DELETE_BUILTIN 1619
#define WARN_PLUGIN_BUSY 1620
#define ER_VARIABLE_IS_READONLY 1621
#define ER_WARN_ENGINE_TRANSACTION_ROLLBACK 1622
#define ER_SLAVE_HEARTBEAT_FAILURE 1623
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE 1624
#define ER_UNUSED_14 1625
#define ER_CONFLICT_FN_PARSE_ERROR 1626
#define ER_EXCEPTIONS_WRITE_ERROR 1627
#define ER_TOO_LONG_TABLE_COMMENT 1628
#define ER_TOO_LONG_FIELD_COMMENT 1629
#define ER_FUNC_INEXISTENT_NAME_COLLISION 1630
#define ER_DATABASE_NAME 1631
#define ER_TABLE_NAME 1632
#define ER_PARTITION_NAME 1633
#define ER_SUBPARTITION_NAME 1634
#define ER_TEMPORARY_NAME 1635
#define ER_RENAMED_NAME 1636
#define ER_TOO_MANY_CONCURRENT_TRXS 1637
#define WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED 1638
#define ER_DEBUG_SYNC_TIMEOUT 1639
#define ER_DEBUG_SYNC_HIT_LIMIT 1640
#define ER_DUP_SIGNAL_SET 1641
#define ER_SIGNAL_WARN 1642
#define ER_SIGNAL_NOT_FOUND 1643
#define ER_SIGNAL_EXCEPTION 1644
#define ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 1645
#define ER_SIGNAL_BAD_CONDITION_TYPE 1646
#define WARN_COND_ITEM_TRUNCATED 1647
#define ER_COND_ITEM_TOO_LONG 1648
#define ER_UNKNOWN_LOCALE 1649
#define ER_SLAVE_IGNORE_SERVER_IDS 1650
#define ER_QUERY_CACHE_DISABLED 1651
#define ER_SAME_NAME_PARTITION_FIELD 1652
#define ER_PARTITION_COLUMN_LIST_ERROR 1653
#define ER_WRONG_TYPE_COLUMN_VALUE_ERROR 1654
#define ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR 1655
#define ER_MAXVALUE_IN_VALUES_IN 1656
#define ER_TOO_MANY_VALUES_ERROR 1657
#define ER_ROW_SINGLE_PARTITION_FIELD_ERROR 1658
#define ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD 1659
#define ER_PARTITION_FIELDS_TOO_LONG 1660
#define ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE 1661
#define ER_BINLOG_ROW_MODE_AND_STMT_ENGINE 1662
#define ER_BINLOG_UNSAFE_AND_STMT_ENGINE 1663
#define ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE 1664
#define ER_BINLOG_STMT_MODE_AND_ROW_ENGINE 1665
#define ER_BINLOG_ROW_INJECTION_AND_STMT_MODE 1666
#define ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1667
#define ER_BINLOG_UNSAFE_LIMIT 1668
#define ER_BINLOG_UNSAFE_INSERT_DELAYED 1669
#define ER_BINLOG_UNSAFE_SYSTEM_TABLE 1670
#define ER_BINLOG_UNSAFE_AUTOINC_COLUMNS 1671
#define ER_BINLOG_UNSAFE_UDF 1672
#define ER_BINLOG_UNSAFE_SYSTEM_VARIABLE 1673
#define ER_BINLOG_UNSAFE_SYSTEM_FUNCTION 1674
#define ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS 1675
#define ER_MESSAGE_AND_STATEMENT 1676
#define ER_SLAVE_CONVERSION_FAILED 1677
#define ER_SLAVE_CANT_CREATE_CONVERSION 1678
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT 1679
#define ER_PATH_LENGTH 1680
#define ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT 1681
#define ER_WRONG_NATIVE_TABLE_STRUCTURE 1682
#define ER_WRONG_PERFSCHEMA_USAGE 1683
#define ER_WARN_I_S_SKIPPED_TABLE 1684
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT 1685
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT 1686
#define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687
#define ER_TOO_LONG_INDEX_COMMENT 1688
#define ER_LOCK_ABORTED 1689
#define ER_DATA_OUT_OF_RANGE 1690
#define ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691
#define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692
#define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695
#define ER_FAILED_READ_FROM_PAR_FILE 1696
#define ER_VALUES_IS_NOT_INT_TYPE_ERROR 1697
#define ER_ACCESS_DENIED_NO_PASSWORD_ERROR 1698
#define ER_SET_PASSWORD_AUTH_PLUGIN 1699
#define ER_GRANT_PLUGIN_USER_EXISTS 1700
#define ER_TRUNCATE_ILLEGAL_FK 1701
#define ER_PLUGIN_IS_PERMANENT 1702
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN 1703
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX 1704
#define ER_STMT_CACHE_FULL 1705
#define ER_MULTI_UPDATE_KEY_CONFLICT 1706
#define ER_TABLE_NEEDS_REBUILD 1707
#define WARN_OPTION_BELOW_LIMIT 1708
#define ER_INDEX_COLUMN_TOO_LONG 1709
#define ER_ERROR_IN_TRIGGER_BODY 1710
#define ER_ERROR_IN_UNKNOWN_TRIGGER_BODY 1711
#define ER_INDEX_CORRUPT 1712
#define ER_UNDO_RECORD_TOO_BIG 1713
#define ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT 1714
#define ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE 1715
#define ER_BINLOG_UNSAFE_REPLACE_SELECT 1716
#define ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT 1717
#define ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT 1718
#define ER_BINLOG_UNSAFE_UPDATE_IGNORE 1719
#define ER_UNUSED_15 1720
#define ER_UNUSED_16 1721
#define ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT 1722
#define ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC 1723
#define ER_BINLOG_UNSAFE_INSERT_TWO_KEYS 1724
#define ER_UNUSED_28 1725
#define ER_VERS_NOT_ALLOWED 1726
#define ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST 1727
#define ER_CANNOT_LOAD_FROM_TABLE_V2 1728
#define ER_MASTER_DELAY_VALUE_OUT_OF_RANGE 1729
#define ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT 1730
#define ER_PARTITION_EXCHANGE_DIFFERENT_OPTION 1731
#define ER_PARTITION_EXCHANGE_PART_TABLE 1732
#define ER_PARTITION_EXCHANGE_TEMP_TABLE 1733
#define ER_PARTITION_INSTEAD_OF_SUBPARTITION 1734
#define ER_UNKNOWN_PARTITION 1735
#define ER_TABLES_DIFFERENT_METADATA 1736
#define ER_ROW_DOES_NOT_MATCH_PARTITION 1737
#define ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX 1738
#define ER_WARN_INDEX_NOT_APPLICABLE 1739
#define ER_PARTITION_EXCHANGE_FOREIGN_KEY 1740
#define ER_NO_SUCH_KEY_VALUE 1741
#define ER_VALUE_TOO_LONG 1742
#define ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE 1743
#define ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE 1744
#define ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX 1745
#define ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT 1746
#define ER_PARTITION_CLAUSE_ON_NONPARTITIONED 1747
#define ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET 1748
#define ER_UNUSED_5 1749
#define ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE 1750
#define ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE 1751
#define ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE 1752
#define ER_MTS_FEATURE_IS_NOT_SUPPORTED 1753
#define ER_MTS_UPDATED_DBS_GREATER_MAX 1754
#define ER_MTS_CANT_PARALLEL 1755
#define ER_MTS_INCONSISTENT_DATA 1756
#define ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING 1757
#define ER_DA_INVALID_CONDITION_NUMBER 1758
#define ER_INSECURE_PLAIN_TEXT 1759
#define ER_INSECURE_CHANGE_MASTER 1760
#define ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO 1761
#define ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO 1762
#define ER_SQLTHREAD_WITH_SECURE_SLAVE 1763
#define ER_TABLE_HAS_NO_FT 1764
#define ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER 1765
#define ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION 1766
#define ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST 1767
#define ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL 1768
#define ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION 1769
#define ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL 1770
#define ER_SKIPPING_LOGGED_TRANSACTION 1771
#define ER_MALFORMED_GTID_SET_SPECIFICATION 1772
#define ER_MALFORMED_GTID_SET_ENCODING 1773
#define ER_MALFORMED_GTID_SPECIFICATION 1774
#define ER_GNO_EXHAUSTED 1775
#define ER_BAD_SLAVE_AUTO_POSITION 1776
#define ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON 1777
#define ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET 1778
#define ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON 1779
#define ER_GTID_MODE_REQUIRES_BINLOG 1780
#define ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF 1781
#define ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON 1782
#define ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF 1783
#define ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF 1784
#define ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE 1785
#define ER_GTID_UNSAFE_CREATE_SELECT 1786
#define ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION 1787
#define ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME 1788
#define ER_MASTER_HAS_PURGED_REQUIRED_GTIDS 1789
#define ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID 1790
#define ER_UNKNOWN_EXPLAIN_FORMAT 1791
#define ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION 1792
#define ER_TOO_LONG_TABLE_PARTITION_COMMENT 1793
#define ER_SLAVE_CONFIGURATION 1794
#define ER_INNODB_FT_LIMIT 1795
#define ER_INNODB_NO_FT_TEMP_TABLE 1796
#define ER_INNODB_FT_WRONG_DOCID_COLUMN 1797
#define ER_INNODB_FT_WRONG_DOCID_INDEX 1798
#define ER_INNODB_ONLINE_LOG_TOO_BIG 1799
#define ER_UNKNOWN_ALTER_ALGORITHM 1800
#define ER_UNKNOWN_ALTER_LOCK 1801
#define ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS 1802
#define ER_MTS_RECOVERY_FAILURE 1803
#define ER_MTS_RESET_WORKERS 1804
#define ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 1805
#define ER_SLAVE_SILENT_RETRY_TRANSACTION 1806
#define ER_UNUSED_22 1807
#define ER_TABLE_SCHEMA_MISMATCH 1808
#define ER_TABLE_IN_SYSTEM_TABLESPACE 1809
#define ER_IO_READ_ERROR 1810
#define ER_IO_WRITE_ERROR 1811
#define ER_TABLESPACE_MISSING 1812
#define ER_TABLESPACE_EXISTS 1813
#define ER_TABLESPACE_DISCARDED 1814
#define ER_INTERNAL_ERROR 1815
#define ER_INNODB_IMPORT_ERROR 1816
#define ER_INNODB_INDEX_CORRUPT 1817
#define ER_INVALID_YEAR_COLUMN_LENGTH 1818
#define ER_NOT_VALID_PASSWORD 1819
#define ER_MUST_CHANGE_PASSWORD 1820
#define ER_FK_NO_INDEX_CHILD 1821
#define ER_FK_NO_INDEX_PARENT 1822
#define ER_FK_FAIL_ADD_SYSTEM 1823
#define ER_FK_CANNOT_OPEN_PARENT 1824
#define ER_FK_INCORRECT_OPTION 1825
#define ER_DUP_CONSTRAINT_NAME 1826
#define ER_PASSWORD_FORMAT 1827
#define ER_FK_COLUMN_CANNOT_DROP 1828
#define ER_FK_COLUMN_CANNOT_DROP_CHILD 1829
#define ER_FK_COLUMN_NOT_NULL 1830
#define ER_DUP_INDEX 1831
#define ER_FK_COLUMN_CANNOT_CHANGE 1832
#define ER_FK_COLUMN_CANNOT_CHANGE_CHILD 1833
#define ER_FK_CANNOT_DELETE_PARENT 1834
#define ER_MALFORMED_PACKET 1835
#define ER_READ_ONLY_MODE 1836
#define ER_GTID_NEXT_TYPE_UNDEFINED_GROUP 1837
#define ER_VARIABLE_NOT_SETTABLE_IN_SP 1838
#define ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF 1839
#define ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY 1840
#define ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY 1841
#define ER_GTID_PURGED_WAS_CHANGED 1842
#define ER_GTID_EXECUTED_WAS_CHANGED 1843
#define ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES 1844
#define ER_ALTER_OPERATION_NOT_SUPPORTED 1845
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON 1846
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY 1847
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION 1848
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME 1849
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE 1850
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK 1851
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE 1852
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK 1853
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC 1854
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS 1855
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS 1856
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS 1857
#define ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE 1858
#define ER_DUP_UNKNOWN_IN_INDEX 1859
#define ER_IDENT_CAUSES_TOO_LONG_PATH 1860
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL 1861
#define ER_MUST_CHANGE_PASSWORD_LOGIN 1862
#define ER_ROW_IN_WRONG_PARTITION 1863
#define ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX 1864
#define ER_INNODB_NO_FT_USES_PARSER 1865
#define ER_BINLOG_LOGICAL_CORRUPTION 1866
#define ER_WARN_PURGE_LOG_IN_USE 1867
#define ER_WARN_PURGE_LOG_IS_ACTIVE 1868
#define ER_AUTO_INCREMENT_CONFLICT 1869
#define WARN_ON_BLOCKHOLE_IN_RBR 1870
#define ER_SLAVE_MI_INIT_REPOSITORY 1871
#define ER_SLAVE_RLI_INIT_REPOSITORY 1872
#define ER_ACCESS_DENIED_CHANGE_USER_ERROR 1873
#define ER_INNODB_READ_ONLY 1874
#define ER_STOP_SLAVE_SQL_THREAD_TIMEOUT 1875
#define ER_STOP_SLAVE_IO_THREAD_TIMEOUT 1876
#define ER_TABLE_CORRUPT 1877
#define ER_TEMP_FILE_WRITE_FAILURE 1878
#define ER_INNODB_FT_AUX_NOT_HEX_ID 1879
#define ER_LAST_MYSQL_ERROR_MESSAGE 1880
#define ER_ERROR_LAST_SECTION_1 1880

/* New section */

#define ER_ERROR_FIRST_SECTION_2 1900
#define ER_UNUSED_18 1900
#define ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED 1901
#define ER_UNUSED_19 1902
#define ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN 1903
#define ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN 1904
#define ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN 1905
#define ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN 1906
#define ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN 1907
#define ER_UNUSED_20 1908
#define ER_UNUSED_21 1909
#define ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS 1910
#define ER_UNKNOWN_OPTION 1911
#define ER_BAD_OPTION_VALUE 1912
#define ER_UNUSED_6 1913
#define ER_UNUSED_7 1914
#define ER_UNUSED_8 1915
#define ER_DATA_OVERFLOW 1916
#define ER_DATA_TRUNCATED 1917
#define ER_BAD_DATA 1918
#define ER_DYN_COL_WRONG_FORMAT 1919
#define ER_DYN_COL_IMPLEMENTATION_LIMIT 1920
#define ER_DYN_COL_DATA 1921
#define ER_DYN_COL_WRONG_CHARSET 1922
#define ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES 1923
#define ER_QUERY_CACHE_IS_DISABLED 1924
#define ER_QUERY_CACHE_IS_GLOBALY_DISABLED 1925
#define ER_VIEW_ORDERBY_IGNORED 1926
#define ER_CONNECTION_KILLED 1927
#define ER_UNUSED_12 1928
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION 1929
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION 1930
#define ER_QUERY_RESULT_INCOMPLETE 1931
#define ER_NO_SUCH_TABLE_IN_ENGINE 1932
#define ER_TARGET_NOT_EXPLAINABLE 1933
#define ER_CONNECTION_ALREADY_EXISTS 1934
#define ER_MASTER_LOG_PREFIX 1935
#define ER_CANT_START_STOP_SLAVE 1936
#define ER_SLAVE_STARTED 1937
#define ER_SLAVE_STOPPED 1938
#define ER_SQL_DISCOVER_ERROR 1939
#define ER_FAILED_GTID_STATE_INIT 1940
#define ER_INCORRECT_GTID_STATE 1941
#define ER_CANNOT_UPDATE_GTID_STATE 1942
#define ER_DUPLICATE_GTID_DOMAIN 1943
#define ER_GTID_OPEN_TABLE_FAILED 1944
#define ER_GTID_POSITION_NOT_FOUND_IN_BINLOG 1945
#define ER_CANNOT_LOAD_SLAVE_GTID_STATE 1946
#define ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG 1947
#define ER_MASTER_GTID_POS_MISSING_DOMAIN 1948
#define ER_UNTIL_REQUIRES_USING_GTID 1949
#define ER_GTID_STRICT_OUT_OF_ORDER 1950
#define ER_GTID_START_FROM_BINLOG_HOLE 1951
#define ER_SLAVE_UNEXPECTED_MASTER_SWITCH 1952
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO 1953
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO 1954
#define ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2 1955
#define ER_BINLOG_MUST_BE_EMPTY 1956
#define ER_NO_SUCH_QUERY 1957
#define ER_BAD_BASE64_DATA 1958
#define ER_INVALID_ROLE 1959
#define ER_INVALID_CURRENT_USER 1960
#define ER_CANNOT_GRANT_ROLE 1961
#define ER_CANNOT_REVOKE_ROLE 1962
#define ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE 1963
#define ER_PRIOR_COMMIT_FAILED 1964
#define ER_IT_IS_A_VIEW 1965
#define ER_SLAVE_SKIP_NOT_IN_GTID 1966
#define ER_TABLE_DEFINITION_TOO_BIG 1967
#define ER_PLUGIN_INSTALLED 1968
#define ER_STATEMENT_TIMEOUT 1969
#define ER_SUBQUERIES_NOT_SUPPORTED 1970
#define ER_SET_STATEMENT_NOT_SUPPORTED 1971
#define ER_UNUSED_9 1972
#define ER_USER_CREATE_EXISTS 1973
#define ER_USER_DROP_EXISTS 1974
#define ER_ROLE_CREATE_EXISTS 1975
#define ER_ROLE_DROP_EXISTS 1976
#define ER_CANNOT_CONVERT_CHARACTER 1977
#define ER_INVALID_DEFAULT_VALUE_FOR_FIELD 1978
#define ER_KILL_QUERY_DENIED_ERROR 1979
#define ER_NO_EIS_FOR_FIELD 1980
#define ER_WARN_AGGFUNC_DEPENDENCE 1981
#define WARN_INNODB_PARTITION_OPTION_IGNORED 1982
#define ER_ERROR_LAST_SECTION_2 1982

/* New section */

#define ER_ERROR_FIRST_SECTION_3 2000
#define ER_ERROR_LAST_SECTION_3 2000

/* New section */

#define ER_ERROR_FIRST_SECTION_4 3000
#define ER_FILE_CORRUPT 3000
#define ER_ERROR_ON_MASTER 3001
#define ER_INCONSISTENT_ERROR 3002
#define ER_STORAGE_ENGINE_NOT_LOADED 3003
#define ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER 3004
#define ER_WARN_LEGACY_SYNTAX_CONVERTED 3005
#define ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN 3006
#define ER_CANNOT_DISCARD_TEMPORARY_TABLE 3007
#define ER_FK_DEPTH_EXCEEDED 3008
#define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 3009
#define ER_WARN_TRIGGER_DOESNT_HAVE_CREATED 3010
#define ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL 3011
#define ER_EXPLAIN_NOT_SUPPORTED 3012
#define ER_INVALID_FIELD_SIZE 3013
#define ER_MISSING_HA_CREATE_OPTION 3014
#define ER_ENGINE_OUT_OF_MEMORY 3015
#define ER_PASSWORD_EXPIRE_ANONYMOUS_USER 3016
#define ER_SLAVE_SQL_THREAD_MUST_STOP 3017
#define ER_NO_FT_MATERIALIZED_SUBQUERY 3018
#define ER_INNODB_UNDO_LOG_FULL 3019
#define ER_INVALID_ARGUMENT_FOR_LOGARITHM 3020
#define ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP 3021
#define ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO 3022
#define ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS 3023
#define ER_UNUSED_1 3024
#define ER_NON_RO_SELECT_DISABLE_TIMER 3025
#define ER_DUP_LIST_ENTRY 3026
#define ER_SQL_MODE_NO_EFFECT 3027
#define ER_AGGREGATE_ORDER_FOR_UNION 3028
#define ER_AGGREGATE_ORDER_NON_AGG_QUERY 3029
#define ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR 3030
#define ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER 3031
#define ER_SERVER_OFFLINE_MODE 3032
#define ER_GIS_DIFFERENT_SRIDS 3033
#define ER_GIS_UNSUPPORTED_ARGUMENT 3034
#define ER_GIS_UNKNOWN_ERROR 3035
#define ER_GIS_UNKNOWN_EXCEPTION 3036
#define ER_GIS_INVALID_DATA 3037
#define ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION 3038
#define ER_BOOST_GEOMETRY_CENTROID_EXCEPTION 3039
#define ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION 3040
#define ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION 3041
#define ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION 3042
#define ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION 3043
#define ER_STD_BAD_ALLOC_ERROR 3044
#define ER_STD_DOMAIN_ERROR 3045
#define ER_STD_LENGTH_ERROR 3046
#define ER_STD_INVALID_ARGUMENT 3047
#define ER_STD_OUT_OF_RANGE_ERROR 3048
#define ER_STD_OVERFLOW_ERROR 3049
#define ER_STD_RANGE_ERROR 3050
#define ER_STD_UNDERFLOW_ERROR 3051
#define ER_STD_LOGIC_ERROR 3052
#define ER_STD_RUNTIME_ERROR 3053
#define ER_STD_UNKNOWN_EXCEPTION 3054
#define ER_GIS_DATA_WRONG_ENDIANESS 3055
#define ER_CHANGE_MASTER_PASSWORD_LENGTH 3056
#define ER_USER_LOCK_WRONG_NAME 3057
#define ER_USER_LOCK_DEADLOCK 3058
#define ER_REPLACE_INACCESSIBLE_ROWS 3059
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS 3060
#define ER_ERROR_LAST_SECTION_4 3060

/* New section */

#define ER_ERROR_FIRST_SECTION_5 4000
#define ER_UNUSED_26 4000
#define ER_UNUSED_27 4001
#define ER_WITH_COL_WRONG_LIST 4002
#define ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE 4003
#define ER_DUP_QUERY_NAME 4004
#define ER_RECURSIVE_WITHOUT_ANCHORS 4005
#define ER_UNACCEPTABLE_MUTUAL_RECURSION 4006
#define ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED 4007
#define ER_NOT_STANDARD_COMPLIANT_RECURSIVE 4008
#define ER_WRONG_WINDOW_SPEC_NAME 4009
#define ER_DUP_WINDOW_NAME 4010
#define ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC 4011
#define ER_ORDER_LIST_IN_REFERENCING_WINDOW_SPEC 4012
#define ER_WINDOW_FRAME_IN_REFERENCED_WINDOW_SPEC 4013
#define ER_BAD_COMBINATION_OF_WINDOW_FRAME_BOUND_SPECS 4014
#define ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION 4015
#define ER_WINDOW_FUNCTION_IN_WINDOW_SPEC 4016
#define ER_NOT_ALLOWED_WINDOW_FRAME 4017
#define ER_NO_ORDER_LIST_IN_WINDOW_SPEC 4018
#define ER_RANGE_FRAME_NEEDS_SIMPLE_ORDERBY 4019
#define ER_WRONG_TYPE_FOR_ROWS_FRAME 4020
#define ER_WRONG_TYPE_FOR_RANGE_FRAME 4021
#define ER_FRAME_EXCLUSION_NOT_SUPPORTED 4022
#define ER_WINDOW_FUNCTION_DONT_HAVE_FRAME 4023
#define ER_INVALID_NTILE_ARGUMENT 4024
#define ER_CONSTRAINT_FAILED 4025
#define ER_EXPRESSION_IS_TOO_BIG 4026
#define ER_ERROR_EVALUATING_EXPRESSION 4027
#define ER_CALCULATING_DEFAULT_VALUE 4028
#define ER_EXPRESSION_REFERS_TO_UNINIT_FIELD 4029
#define ER_PARTITION_DEFAULT_ERROR 4030
#define ER_REFERENCED_TRG_DOES_NOT_EXIST 4031
#define ER_INVALID_DEFAULT_PARAM 4032
#define ER_BINLOG_NON_SUPPORTED_BULK 4033
#define ER_BINLOG_UNCOMPRESS_ERROR 4034
#define ER_JSON_BAD_CHR 4035
#define ER_JSON_NOT_JSON_CHR 4036
#define ER_JSON_EOS 4037
#define ER_JSON_SYNTAX 4038
#define ER_JSON_ESCAPING 4039
#define ER_JSON_DEPTH 4040
#define ER_JSON_PATH_EOS 4041
#define ER_JSON_PATH_SYNTAX 4042
#define ER_JSON_PATH_DEPTH 4043
#define ER_JSON_PATH_NO_WILDCARD 4044
#define ER_JSON_PATH_ARRAY 4045
#define ER_JSON_ONE_OR_ALL 4046
#define ER_UNSUPPORTED_COMPRESSED_TABLE 4047
#define ER_GEOJSON_INCORRECT 4048
#define ER_GEOJSON_TOO_FEW_POINTS 4049
#define ER_GEOJSON_NOT_CLOSED 4050
#define ER_JSON_PATH_EMPTY 4051
#define ER_SLAVE_SAME_ID 4052
#define ER_FLASHBACK_NOT_SUPPORTED 4053
#define ER_KEYS_OUT_OF_ORDER 4054
#define ER_OVERLAPPING_KEYS 4055
#define ER_REQUIRE_ROW_BINLOG_FORMAT 4056
#define ER_ISOLATION_MODE_NOT_SUPPORTED 4057
#define ER_ON_DUPLICATE_DISABLED 4058
#define ER_UPDATES_WITH_CONSISTENT_SNAPSHOT 4059
#define ER_ROLLBACK_ONLY 4060
#define ER_ROLLBACK_TO_SAVEPOINT 4061
#define ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT 4062
#define ER_UNSUPPORTED_COLLATION 4063
#define ER_METADATA_INCONSISTENCY 4064
#define ER_CF_DIFFERENT 4065
#define ER_RDB_TTL_DURATION_FORMAT 4066
#define ER_RDB_STATUS_GENERAL 4067
#define ER_RDB_STATUS_MSG 4068
#define ER_RDB_TTL_UNSUPPORTED 4069
#define ER_RDB_TTL_COL_FORMAT 4070
#define ER_PER_INDEX_CF_DEPRECATED 4071
#define ER_KEY_CREATE_DURING_ALTER 4072
#define ER_SK_POPULATE_DURING_ALTER 4073
#define ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG 4074
#define ER_NET_OK_PACKET_TOO_LARGE 4075
#define ER_GEOJSON_EMPTY_COORDINATES 4076
#define ER_MYROCKS_CANT_NOPAD_COLLATION 4077
#define ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION 4078
#define ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION 4079
#define ER_WRONG_PARAMCOUNT_TO_CURSOR 4080
#define ER_UNKNOWN_STRUCTURED_VARIABLE 4081
#define ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD 4082
#define ER_END_IDENTIFIER_DOES_NOT_MATCH 4083
#define ER_SEQUENCE_RUN_OUT 4084
#define ER_SEQUENCE_INVALID_DATA 4085
#define ER_SEQUENCE_INVALID_TABLE_STRUCTURE 4086
#define ER_SEQUENCE_ACCESS_ERROR 4087
#define ER_SEQUENCE_BINLOG_FORMAT 4088
#define ER_NOT_SEQUENCE 4089
#define ER_NOT_SEQUENCE2 4090
#define ER_UNKNOWN_SEQUENCES 4091
#define ER_UNKNOWN_VIEW 4092
#define ER_WRONG_INSERT_INTO_SEQUENCE 4093
#define ER_SP_STACK_TRACE 4094
#define ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY 4095
#define ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED 4096
#define ER_COMPRESSED_COLUMN_USED_AS_KEY 4097
#define ER_UNKNOWN_COMPRESSION_METHOD 4098
#define ER_WRONG_NUMBER_OF_VALUES_IN_TVC 4099
#define ER_FIELD_REFERENCE_IN_TVC 4100
#define ER_WRONG_TYPE_FOR_PERCENTILE_FUNC 4101
#define ER_ARGUMENT_NOT_CONSTANT 4102
#define ER_ARGUMENT_OUT_OF_RANGE 4103
#define ER_WRONG_TYPE_OF_ARGUMENT 4104
#define ER_NOT_AGGREGATE_FUNCTION 4105
#define ER_INVALID_AGGREGATE_FUNCTION 4106
#define ER_INVALID_VALUE_TO_LIMIT 4107
#define ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT 4108
#define ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING 4109
#define ER_VERS_FIELD_WRONG_TYPE 4110
#define ER_VERS_ENGINE_UNSUPPORTED 4111
#define ER_UNUSED_23 4112
#define ER_PARTITION_WRONG_TYPE 4113
#define WARN_VERS_PART_FULL 4114
#define WARN_VERS_PARAMETERS 4115
#define ER_VERS_DROP_PARTITION_INTERVAL 4116
#define ER_UNUSED_25 4117
#define WARN_VERS_PART_NON_HISTORICAL 4118
#define ER_VERS_ALTER_NOT_ALLOWED 4119
#define ER_VERS_ALTER_ENGINE_PROHIBITED 4120
#define ER_VERS_RANGE_PROHIBITED 4121
#define ER_CONFLICTING_FOR_SYSTEM_TIME 4122
#define ER_VERS_TABLE_MUST_HAVE_COLUMNS 4123
#define ER_VERS_NOT_VERSIONED 4124
#define ER_MISSING 4125
#define ER_VERS_PERIOD_COLUMNS 4126
#define ER_PART_WRONG_VALUE 4127
#define ER_VERS_WRONG_PARTS 4128
#define ER_VERS_NO_TRX_ID 4129
#define ER_VERS_ALTER_SYSTEM_FIELD 4130
#define ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION 4131
#define ER_VERS_DB_NOT_SUPPORTED 4132
#define ER_VERS_TRT_IS_DISABLED 4133
#define ER_VERS_DUPLICATE_ROW_START_END 4134
#define ER_VERS_ALREADY_VERSIONED 4135
#define ER_UNUSED_24 4136
#define ER_VERS_NOT_SUPPORTED 4137
#define ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED 4138
#define ER_INDEX_FILE_FULL 4139
#define ER_UPDATED_COLUMN_ONLY_ONCE 4140
#define ER_EMPTY_ROW_IN_TVC 4141
#define ER_VERS_QUERY_IN_PARTITION 4142
#define ER_KEY_DOESNT_SUPPORT 4143
#define ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD 4144
#define ER_BACKUP_LOCK_IS_ACTIVE 4145
#define ER_BACKUP_NOT_RUNNING 4146
#define ER_BACKUP_WRONG_STAGE 4147
#define ER_BACKUP_STAGE_FAILED 4148
#define ER_BACKUP_UNKNOWN_STAGE 4149
#define ER_USER_IS_BLOCKED 4150
#define ER_ACCOUNT_HAS_BEEN_LOCKED 4151
#define ER_PERIOD_TEMPORARY_NOT_ALLOWED 4152
#define ER_PERIOD_TYPES_MISMATCH 4153
#define ER_MORE_THAN_ONE_PERIOD 4154
#define ER_PERIOD_FIELD_WRONG_ATTRIBUTES 4155
#define ER_PERIOD_NOT_FOUND 4156
#define ER_PERIOD_COLUMNS_UPDATED 4157
#define ER_PERIOD_CONSTRAINT_DROP 4158
#define ER_TOO_LONG_KEYPART 4159
#define ER_TOO_LONG_DATABASE_COMMENT 4160
#define ER_UNKNOWN_DATA_TYPE 4161
#define ER_UNKNOWN_OPERATOR 4162
#define ER_WARN_HISTORY_ROW_START_TIME 4163
#define ER_PART_STARTS_BEYOND_INTERVAL 4164
#define ER_GALERA_REPLICATION_NOT_SUPPORTED 4165
#define ER_LOAD_INFILE_CAPABILITY_DISABLED 4166
#define ER_NO_SECURE_TRANSPORTS_CONFIGURED 4167
#define ER_SLAVE_IGNORED_SHARED_TABLE 4168
#define ER_NO_AUTOINCREMENT_WITH_UNIQUE 4169
#define ER_KEY_CONTAINS_PERIOD_FIELDS 4170
#define ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS 4171
#define ER_NOT_ALLOWED_IN_THIS_CONTEXT 4172
#define ER_DATA_WAS_COMMITED_UNDER_ROLLBACK 4173
#define ER_PK_INDEX_CANT_BE_IGNORED 4174
#define ER_BINLOG_UNSAFE_SKIP_LOCKED 4175
#define ER_JSON_TABLE_ERROR_ON_FIELD 4176
#define ER_JSON_TABLE_ALIAS_REQUIRED 4177
#define ER_JSON_TABLE_SCALAR_EXPECTED 4178
#define ER_JSON_TABLE_MULTIPLE_MATCHES 4179
#define ER_WITH_TIES_NEEDS_ORDER 4180
#define ER_REMOVED_ORPHAN_TRIGGER 4181
#define ER_STORAGE_ENGINE_DISABLED 4182
#define ER_ERROR_LAST 4182
#endif /* ER_ERROR_FIRST */
server/mysql_version.h000064400000002405150400263660011140 0ustar00/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB
   & Detron HB, 1996, 1999-2004, 2007 MySQL AB.
   This file is public domain and comes with NO WARRANTY of any kind
*/

/* Version numbers for protocol & mysqld */

#ifndef _mysql_version_h
#define _mysql_version_h
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
#define PROTOCOL_VERSION		10
#define MYSQL_SERVER_VERSION		"10.6.22-MariaDB"
#define MYSQL_BASE_VERSION		"mysqld-10.6"
#define MARIADB_BASE_VERSION		"mariadb-10.6"
#define MARIADBD_BASE_VERSION		"mariadbd-10.6"
#define MYSQL_SERVER_SUFFIX_DEF		""
#define FRM_VER				6
#define MYSQL_VERSION_ID		100622
#define MARIADB_PORT                    3306
#define MYSQL_PORT_DEFAULT		0
#define MARIADB_UNIX_ADDR               "/var/lib/mysql/mysql.sock"
#define MYSQL_CONFIG_NAME		"my"
#define MYSQL_COMPILATION_COMMENT	"MariaDB Server"
#define SERVER_MATURITY_LEVEL           MariaDB_PLUGIN_MATURITY_STABLE

#define MYSQL_PORT                      MARIADB_PORT
#define MYSQL_UNIX_ADDR                 MARIADB_UNIX_ADDR

#ifdef WITH_WSREP
#define WSREP_PATCH_VERSION             "wsrep_26.22"
#endif

/* mysqld compile time options */
#endif /* _CUSTOMCONFIG_ */

#ifndef LICENSE
#define LICENSE				GPL
#endif /* LICENSE */

#endif /* _mysql_version_h */
server/mysql_embed.h000064400000002144150400263670010530 0ustar00#ifndef MYSQL_EMBED_INCLUDED
#define MYSQL_EMBED_INCLUDED

/*
   Copyright (c) 2000, 2011, Oracle and/or its affiliates.

   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 */

/* Defines that are unique to the embedded version of MySQL */

#ifdef EMBEDDED_LIBRARY

/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */

#undef HAVE_DLOPEN				/* No udf functions */

#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */
server/my_sys.h000064400000126311150400263670007555 0ustar00/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
   Copyright (c) 2010, 2022, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef _my_sys_h
#define _my_sys_h

#include <m_string.h>
#include <mysql/psi/mysql_memory.h>

C_MODE_START


#include <my_valgrind.h>
#include <my_pthread.h>
#include <m_ctype.h>                    /* for CHARSET_INFO */
#include <stdarg.h>
#include <typelib.h>
#include <my_alloca.h>
#include <my_cmp.h>
#include <mysql/plugin.h>
#include <mysql/service_my_print_error.h>

#define MY_INIT(name)   { my_progname= name; my_init(); }

/**
  Max length of an error message generated by mysys utilities.
  Some mysys functions produce error messages. These mostly go
  to stderr.
  This constant defines the size of the buffer used to format
  the message. It should be kept in sync with MYSQL_ERRMSG_SIZE,
  since sometimes mysys errors are stored in the server diagnostics
  area, and we would like to avoid unexpected truncation.
*/
#define MYSYS_ERRMSG_SIZE   (512)
#define MYSYS_STRERROR_SIZE (128)

#define MY_FILE_ERROR	((size_t) -1)

	/* General bitmaps for my_func's */
#define MY_FFNF		1U	/* Fatal if file not found */
#define MY_FNABP	2U	/* Fatal if not all bytes read/written */
#define MY_NABP		4U	/* Error if not all bytes read/written */
#define MY_FAE		8U	/* Fatal if any error */
#define MY_WME		16U	/* Write message on error */
#define MY_WAIT_IF_FULL 32U	/* Wait and try again if disk full error */
#define MY_IGNORE_BADFD 32U     /* my_sync(): ignore 'bad descriptor' errors */
#define MY_IGNORE_ENOENT 32U    /* my_delete() ignores ENOENT (no such file) */
#define MY_ENCRYPT      64U     /* Encrypt IO_CACHE temporary files */
#define MY_TEMPORARY    64U     /* create_temp_file(): delete file at once */
#define MY_NOSYMLINKS  512U     /* my_open(): don't follow symlinks */
#define MY_FULL_IO     512U     /* my_read(): loop until I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128U /* Option to init_io_cache() */
#define MY_LINK_WARNING 32U	/* my_redel() gives warning if links */
#define MY_COPYTIME	64U	/* my_redel() copies time */
#define MY_DELETE_OLD	256U	/* my_create_with_symlink() */
#define MY_RESOLVE_LINK 128U	/* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128U  /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256U
#define MY_SEEK_NOT_DONE 32U	/* my_lock may have to do a seek */
#define MY_SHORT_WAIT	64U	/* my_lock() don't wait if can't lock */
#define MY_FORCE_LOCK   128U    /* use my_lock() even if disable_locking */
#define MY_NO_WAIT      256U	/* my_lock() don't wait at all */
#define MY_NO_REGISTER  8196U   /* my_open(), no malloc for file name */
/*
  If old_mode is UTF8_IS_UTF8MB3, then pass this flag. It mean utf8 is
  alias for utf8mb3. Otherwise utf8 is alias for utf8mb4.
*/
#define MY_UTF8_IS_UTF8MB3 1024U
/*
  init_dynamic_array() has init buffer; Internal flag, not to be used by
  caller.
*/
#define MY_INIT_BUFFER_USED 256U
#define MY_ZEROFILL	32U	/* my_malloc(), fill array with zero */
#define MY_ALLOW_ZERO_PTR 64U	/* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128U	/* my_realloc() ; Free old ptr on error */
#define MY_DONT_OVERWRITE_FILE 2048U /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048U     /* my_seek(): lock fd mutex */
#define MY_SYNC       4096U     /* my_copy(): sync dst file */
#define MY_SYNC_DIR   32768U    /* my_create/delete/rename: sync directory */
#define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */
/* Tree that should delete things automatically */
#define MY_TREE_WITH_DELETE 0x40000U

#define MY_CHECK_ERROR	1U	/* Params to my_end; Check open-close */
#define MY_GIVE_INFO	2U	/* Give time info about process*/
#define MY_DONT_FREE_DBUG 4U    /* Do not call DBUG_END() in my_end() */

#define ME_BELL           4U    /* Ring bell then printing message */
#define ME_ERROR_LOG      64    /**< write the error message to error log */
#define ME_ERROR_LOG_ONLY 128   /**< write the error message to error log only */
#define ME_NOTE           1024  /**< not error but just info */
#define ME_WARNING        2048  /**< not error but just warning */
#define ME_FATAL          4096  /**< fatal statement error */

	/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR		1U	/* replace dir in name with 'dir' */
#define MY_REPLACE_EXT		2U	/* replace extension with 'ext' */
#define MY_UNPACK_FILENAME	4U	/* Unpack name (~ -> home) */
#define MY_PACK_FILENAME	8U	/* Pack name (home -> ~) */
#define MY_RESOLVE_SYMLINKS	16U	/* Resolve all symbolic links */
#define MY_RETURN_REAL_PATH	32U	/* return full path for file */
#define MY_SAFE_PATH		64U	/* Return NULL if too long path */
#define MY_RELATIVE_PATH	128U	/* name is relative to 'dir' */
#define MY_APPEND_EXT           256U    /* add 'ext' as additional extension*/


	/* My seek flags */
#define MY_SEEK_SET	0
#define MY_SEEK_CUR	1
#define MY_SEEK_END	2

	/* Some constants */
#define MY_WAIT_FOR_USER_TO_FIX_PANIC	60	/* in seconds */
#define MY_WAIT_GIVE_USER_A_MESSAGE	10	/* Every 10 times of prev */
#define MIN_COMPRESS_LENGTH		50	/* Don't compress small bl. */
#define DFLT_INIT_HITS  3

	/* root_alloc flags */
#define MY_KEEP_PREALLOC	1U
#define MY_MARK_BLOCKS_FREE     2U /* move used to free list and reuse them */

	/* Internal error numbers (for assembler functions) */
#define MY_ERRNO_EDOM		33
#define MY_ERRNO_ERANGE		34

	/* Bits for get_date timeflag */
#define GETDATE_DATE_TIME	1U
#define GETDATE_SHORT_DATE	2U
#define GETDATE_HHMMSSTIME	4U
#define GETDATE_GMT		8U
#define GETDATE_FIXEDLENGTH	16U

/* Extra length needed for filename if one calls my_create_backup_name */
#define MY_BACKUP_NAME_EXTRA_LENGTH 17

char *guess_malloc_library();

/* If we have our own safemalloc (for debugging) */
#if defined(SAFEMALLOC)
void sf_report_leaked_memory(my_thread_id id);
int sf_sanity();
extern my_thread_id (*sf_malloc_dbug_id)(void);
#define SAFEMALLOC_REPORT_MEMORY(X) if (!sf_leaking_memory) sf_report_leaked_memory(X)
#else
#define SAFEMALLOC_REPORT_MEMORY(X) do {} while(0)
#endif

typedef void (*MALLOC_SIZE_CB) (long long size, my_bool is_thread_specific); 
extern void set_malloc_size_cb(MALLOC_SIZE_CB func);
extern MALLOC_SIZE_CB update_malloc_size;

	/* defines when allocating data */
extern void *my_malloc(PSI_memory_key key, size_t size, myf MyFlags);
extern void *my_multi_malloc(PSI_memory_key key, myf MyFlags, ...);
extern void *my_multi_malloc_large(PSI_memory_key key, myf MyFlags, ...);
extern void *my_realloc(PSI_memory_key key, void *ptr, size_t size, myf MyFlags);
extern void my_free(void *ptr);
extern void *my_memdup(PSI_memory_key key, const void *from,size_t length,myf MyFlags);
extern char *my_strdup(PSI_memory_key key, const char *from,myf MyFlags);
extern char *my_strndup(PSI_memory_key key, const char *from, size_t length, myf MyFlags);

int my_init_large_pages(my_bool super_large_pages);
uchar *my_large_malloc(size_t *size, myf my_flags);
void my_large_free(void *ptr, size_t size);

#ifdef _WIN32
extern BOOL my_obtain_privilege(LPCSTR lpPrivilege);
#endif

void my_init_atomic_write(void);
#ifdef __linux__
my_bool my_test_if_atomic_write(File handle, int pagesize);
my_bool my_test_if_thinly_provisioned(File handle);
#else
# define my_test_if_atomic_write(A, B)      0
# define my_test_if_thinly_provisioned(A)   0
#endif /* __linux__ */
extern my_bool my_may_have_atomic_write;

#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) ((void)0)
#define MAX_ALLOCA_SZ 4096
#define my_safe_alloca(size) (((size) <= MAX_ALLOCA_SZ) ? \
                               my_alloca(size) : \
                               my_malloc(PSI_NOT_INSTRUMENTED, (size), MYF(MY_THREAD_SPECIFIC|MY_WME)))
#define my_safe_afree(ptr, size) \
                  do { if ((size) > MAX_ALLOCA_SZ) my_free(ptr); } while(0)
#else
#define my_alloca(SZ) my_malloc(PSI_NOT_INSTRUMENTED, SZ,MYF(MY_FAE))
#define my_afree(PTR) my_free(PTR)
#define my_safe_alloca(size) my_alloca(size)
#define my_safe_afree(ptr, size) my_afree(ptr)
#endif /* HAVE_ALLOCA */

#ifndef errno				/* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE
#include <errno.h>			/* errno is a define */
#else
extern int errno;			/* declare errno */
#endif
#endif					/* #ifndef errno */
extern char *home_dir;			/* Home directory for user */
extern MYSQL_PLUGIN_IMPORT char  *mysql_data_home;
extern const char *my_progname;		/* program-name (printed in errors) */
extern const char *my_progname_short;	/* like above but without directory */
extern char curr_dir[];		/* Current directory for user */
extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
				       myf MyFlags);
extern uint my_file_limit;
extern ulonglong my_thread_stack_size;
extern int sf_leaking_memory; /* set to 1 to disable memleak detection */

extern void (*proc_info_hook)(void *, const PSI_stage_info *, PSI_stage_info *,
                              const char *, const char *, const unsigned int);

/* charsets */
#define MY_ALL_CHARSETS_SIZE 2048
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
extern struct charset_info_st compiled_charsets[];

/* Collation properties and use statistics */
extern my_bool my_collation_is_known_id(uint id);
extern ulonglong my_collation_statistics_get_use_count(uint id);
extern const char *my_collation_get_tailoring(uint id);

/* statistics */
extern ulong    my_stream_opened, my_tmp_file_created;
extern ulong    my_file_total_opened;
extern ulong    my_sync_count;
extern uint	mysys_usage_id;
extern int32    my_file_opened;
extern my_bool	my_init_done, my_thr_key_mysys_exists;
extern my_bool my_assert;
extern my_bool  my_assert_on_error;
extern myf      my_global_flags;        /* Set to MY_WME for more error messages */
					/* Point to current my_message() */
extern void (*my_sigtstp_cleanup)(void),
					/* Executed before jump to shell */
	    (*my_sigtstp_restart)(void);
					/* Executed when coming from shell */
extern MYSQL_PLUGIN_IMPORT mode_t my_umask;	/* Default creation mask  */
extern mode_t my_umask_dir;
extern int my_recived_signals,	/* Signals we have got */
	   my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
	   my_dont_interrupt;	/* call remember_intr when set */
#ifdef _WIN32
extern SECURITY_ATTRIBUTES my_dir_security_attributes;
LPSECURITY_ATTRIBUTES my_win_file_secattr();
#endif
extern MYSQL_PLUGIN_IMPORT my_bool my_use_symdir;

extern ulong	my_default_record_cache_size;
extern MYSQL_PLUGIN_IMPORT my_bool my_disable_locking;
extern my_bool  my_disable_async_io,
                my_disable_flush_key_blocks, my_disable_symlinks;
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char	wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;

enum cache_type
{
  TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
  SEQ_READ_APPEND		/* sequential read or append */,
  READ_FIFO, READ_NET};

enum flush_type
{
  FLUSH_KEEP,           /* flush block and keep it in the cache */
  FLUSH_RELEASE,        /* flush block and remove it from the cache */
  FLUSH_IGNORE_CHANGED, /* remove block from the cache */
  /*
    As my_disable_flush_pagecache_blocks is always 0, the following option
    is strictly equivalent to FLUSH_KEEP
  */
  FLUSH_FORCE_WRITE,
  /**
     @brief like FLUSH_KEEP but return immediately if file is already being
     flushed (even partially) by another thread; only for page cache,
     forbidden for key cache.
  */
  FLUSH_KEEP_LAZY
};

typedef struct st_record_cache	/* Used when caching records */
{
  File file;
  int	rc_seek,error,inited;
  uint	rc_length,read_length,reclength;
  my_off_t rc_record_pos,end_of_file;
  uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos;
  enum cache_type type;
} RECORD_CACHE;

enum file_type
{
  UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN,
  FILE_BY_O_TMPFILE, FILE_BY_MKSTEMP, FILE_BY_DUP
};

struct st_my_file_info
{
  char  *name;
#ifdef _WIN32
  HANDLE fhandle;   /* win32 file handle */
  int    oflag;     /* open flags, e.g O_APPEND */
#endif
  enum   file_type	type;
};

extern struct st_my_file_info *my_file_info;

/* Free function pointer */
typedef void (*FREE_FUNC)(void *);

typedef struct st_dynamic_array
{
  uchar *buffer;
  uint elements,max_element;
  uint alloc_increment;
  uint size_of_element;
  PSI_memory_key m_psi_key;
  myf malloc_flags;
} DYNAMIC_ARRAY;

typedef struct st_my_tmpdir
{
  DYNAMIC_ARRAY full_list;
  char **list;
  uint cur, max;
  mysql_mutex_t mutex;
} MY_TMPDIR;

typedef struct st_dynamic_string
{
  char *str;
  size_t length,max_length,alloc_increment;
} DYNAMIC_STRING;

struct st_io_cache;

typedef struct st_io_cache_share
{
  mysql_mutex_t       mutex;           /* To sync on reads into buffer. */
  mysql_cond_t        cond;            /* To wait for signals. */
  mysql_cond_t        cond_writer;     /* For a synchronized writer. */
  /* Offset in file corresponding to the first byte of buffer. */
  my_off_t              pos_in_file;
  /* If a synchronized write cache is the source of the data. */
  struct st_io_cache    *source_cache;
  uchar                 *buffer;         /* The read buffer. */
  uchar                 *read_end;       /* Behind last valid byte of buffer. */
  int                   running_threads; /* threads not in lock. */
  int                   total_threads;   /* threads sharing the cache. */
  int                   error;           /* Last error. */
#ifdef NOT_YET_IMPLEMENTED
  /* whether the structure should be free'd */
  my_bool alloced;
#endif
} IO_CACHE_SHARE;

typedef struct st_io_cache		/* Used when caching files */
{
  /* Offset in file corresponding to the first byte of uchar* buffer. */
  my_off_t pos_in_file;
  /*
    The offset of end of file for READ_CACHE and WRITE_CACHE.
    For SEQ_READ_APPEND it the maximum of the actual end of file and
    the position represented by read_end.
  */
  my_off_t end_of_file;
  /* Points to current read position in the buffer */
  uchar	*read_pos;
  /* the non-inclusive boundary in the buffer for the currently valid read */
  uchar  *read_end;
  uchar  *buffer;				/* The read buffer */
  /* Used in ASYNC_IO */
  uchar  *request_pos;

  /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
  uchar  *write_buffer;
  /*
    Only used in SEQ_READ_APPEND, and points to the current read position
    in the write buffer. Note that reads in SEQ_READ_APPEND caches can
    happen from both read buffer (uchar* buffer) and write buffer
    (uchar* write_buffer).
  */
  uchar *append_read_pos;
  /* Points to current write position in the write buffer */
  uchar *write_pos;
  /* The non-inclusive boundary of the valid write area */
  uchar *write_end;

  /*
    The lock is for append buffer used in SEQ_READ_APPEND cache
    need mutex copying from append buffer to read buffer.
  */
  mysql_mutex_t append_buffer_lock;
  /*
    The following is used when several threads are reading the
    same file in parallel. They are synchronized on disk
    accesses reading the cached part of the file asynchronously.
    It should be set to NULL to disable the feature.  Only
    READ_CACHE mode is supported.
  */
  IO_CACHE_SHARE *share;

  /*
    A caller will use my_b_read() macro to read from the cache
    if the data is already in cache, it will be simply copied with
    memcpy() and internal variables will be accordingly updated with
    no functions invoked. However, if the data is not fully in the cache,
    my_b_read() will call read_function to fetch the data. read_function
    must never be invoked directly.
  */
  int (*read_function)(struct st_io_cache *,uchar *,size_t);
  /*
    Same idea as in the case of read_function, except my_b_write() needs to
    be replaced with my_b_append() for a SEQ_READ_APPEND cache
  */
  int (*write_function)(struct st_io_cache *,const uchar *,size_t);
  /*
    Specifies the type of the cache. Depending on the type of the cache
    certain operations might not be available and yield unpredicatable
    results. Details to be documented later
  */
  enum cache_type type;
  /*
    Counts the number of times, when we were forced to use disk. We use it to
    increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status
    variables.
  */
  ulong disk_writes;
  char *file_name;			/* if used with 'open_cached_file' */
  const char *dir;
  char prefix[3];
  File file; /* file descriptor */

  struct st_io_cache *next_file_user;
  /*
    seek_not_done is set by my_b_seek() to inform the upcoming read/write
    operation that a seek needs to be preformed prior to the actual I/O
    error is 0 if the cache operation was successful, -1 if there was a
    "hard" error, and the actual number of I/O-ed bytes if the read/write was
    partial.
  */
  int	seek_not_done,error;
  /* length of the buffer used for storing un-encrypted data */
  size_t	buffer_length;
  /* read_length is the same as buffer_length except when we use async io */
  size_t  read_length;
  myf	myflags;			/* Flags used to my_read/my_write */
  /*
    alloced_buffer is set to the size of the buffer allocated for the IO_CACHE.
    Includes the overhead(storing key to encrypt and decrypt) for encryption.
    Set to 0 if nothing is allocated.
    Currently READ_NET is the only one that will use a buffer allocated
    somewhere else
  */
  size_t alloced_buffer;
} IO_CACHE;

typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
  ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);

extern my_error_reporter my_charset_error_reporter;

extern PSI_file_key key_file_io_cache;

/* inline functions for mf_iocache */

extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
extern int _my_b_get(IO_CACHE *info);
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count);

/* Test if buffer is inited */
static inline void my_b_clear(IO_CACHE *info) { info->buffer= 0; }
static inline int my_b_inited(IO_CACHE *info) { return MY_TEST(info->buffer); }
#define my_b_EOF INT_MIN

static inline int my_b_read(IO_CACHE *info, uchar *Buffer, size_t Count)
{
  if (info->read_pos + Count <= info->read_end)
  {
    memcpy(Buffer, info->read_pos, Count);
    info->read_pos+= Count;
    return 0;
  }
  return _my_b_read(info, Buffer, Count);
}

static inline int my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
{
  MEM_CHECK_DEFINED(Buffer, Count);
  if (info->write_pos + Count <= info->write_end)
  {
    if (Count)
    {
      memcpy(info->write_pos, Buffer, Count);
      info->write_pos+= Count;
    }
    return 0;
  }
  return _my_b_write(info, Buffer, Count);
}

static inline int my_b_get(IO_CACHE *info)
{
  if (info->read_pos != info->read_end)
  {
    info->read_pos++;
    return info->read_pos[-1];
  }
  return _my_b_get(info);
}

static inline my_bool my_b_write_byte(IO_CACHE *info, uchar chr)
{
  MEM_CHECK_DEFINED(&chr, 1);
  if (info->write_pos >= info->write_end)
    if (my_b_flush_io_cache(info, 1))
      return 1;
  *info->write_pos++= chr;
  return 0;
}

/**
  Fill buffer of the cache.

  @note It assumes that you have already used all characters in the CACHE,
        independent of the read_pos value!

  @returns
        0     On error or EOF (info->error = -1 on error)
        #     Number of characters
*/
static inline size_t my_b_fill(IO_CACHE *info)
{
  info->read_pos= info->read_end;
  return _my_b_read(info,0,0) ? 0 : (size_t) (info->read_end - info->read_pos);
}

static inline my_off_t my_b_tell(const IO_CACHE *info)
{
  if (info->type == WRITE_CACHE) {
    return info->pos_in_file + (my_off_t)(info->write_pos - info->request_pos);

  }
  return info->pos_in_file + (my_off_t) (info->read_pos - info->request_pos);
}

static inline my_off_t my_b_write_tell(const IO_CACHE *info)
{
  return info->pos_in_file + (my_off_t) (info->write_pos - info->write_buffer);
}

static inline uchar* my_b_get_buffer_start(const IO_CACHE *info)
{
  return info->request_pos;
}

static inline size_t my_b_get_bytes_in_buffer(const IO_CACHE *info)
{
  return (size_t) (info->read_end - info->request_pos);
}

static inline my_off_t my_b_get_pos_in_file(const IO_CACHE *info)
{
  return info->pos_in_file;
}

static inline size_t my_b_bytes_in_cache(const IO_CACHE *info)
{
  if (info->type == WRITE_CACHE) {
    return (size_t) (info->write_end - info->write_pos);
  }
  return (size_t) (info->read_end - info->read_pos);
}

int my_b_copy_to_file    (IO_CACHE *cache, FILE *file, size_t count);
int my_b_copy_all_to_file(IO_CACHE *cache, FILE *file);

my_off_t my_b_append_tell(IO_CACHE* info);
my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
int my_b_pread(IO_CACHE *info, uchar *Buffer, size_t Count, my_off_t pos);

typedef uint32 ha_checksum;

extern int (*mysys_test_invalid_symlink)(const char *filename);
#include <my_alloc.h>

	/* Prototypes for mysys and my_func functions */

extern int my_copy(const char *from,const char *to,myf MyFlags);
extern int my_delete(const char *name,myf MyFlags);
extern int my_rmtree(const char *name, myf Myflags);
extern int my_getwd(char * buf,size_t size,myf MyFlags);
extern int my_setwd(const char *dir,myf MyFlags);
extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
extern void *my_once_alloc(size_t Size,myf MyFlags);
extern void my_once_free(void);
extern char *my_once_strdup(const char *src,myf myflags);
extern void *my_once_memdup(const void *src, size_t len, myf myflags);
extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
				 enum file_type type_of_file,
				 uint error_message_number, myf MyFlags);
extern File my_create(const char *FileName, mode_t CreateFlags,
		      int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filename,
				   mode_t createflags, int access_flags,
				   myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
extern int my_handler_delete_with_symlink(const char *filename, myf sync_dir);

extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags);
extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset,
		     myf MyFlags);
extern int my_rename(const char *from,const char *to,myf MyFlags);
extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_tell(File fd,myf MyFlags);
extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count,
		     myf MyFlags);
extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count,
		      my_off_t offset,myf MyFlags);
extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags);
extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
		      myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags);
extern void (*my_sleep_for_space)(unsigned int seconds);

extern int my_get_exepath(char *buf, size_t size, const char *argv0);

/* implemented in my_memmem.c */
extern void *my_memmem(const void *haystack, size_t haystacklen,
                       const void *needle, size_t needlelen);


#ifdef _WIN32
extern int      my_access(const char *path, int amode);
#define my_check_user(A,B) (NULL)
#define my_set_user(A,B,C) (0)
#else
#define my_access access
struct passwd *my_check_user(const char *user, myf MyFlags);
int my_set_user(const char *user, struct passwd *user_info, myf MyFlags);
#endif

extern int check_if_legal_filename(const char *path);
extern int check_if_legal_tablename(const char *path);

#ifdef _WIN32
extern my_bool is_filename_allowed(const char *name, size_t length,
                   my_bool allow_current_dir);
#else /* _WIN32 */
# define is_filename_allowed(name, length, allow_cwd) (TRUE)
#endif /* _WIN32 */ 

#ifdef _WIN32
/* Windows-only functions (CRT equivalents)*/
extern HANDLE   my_get_osfhandle(File fd);
extern File     my_win_handle2File(HANDLE hFile);
extern void     my_osmaperr(unsigned long last_error);
#endif

extern void init_glob_errs(void);
extern const char** get_global_errmsgs(int nr);
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_vfprintf(FILE *stream, const char* format, va_list args);
extern const char* my_strerror(char *buf, size_t len, int nr);
extern int my_fprintf(FILE *stream, const char* format, ...);
extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_chmod(const char *name, mode_t mode, myf my_flags);
extern const char *my_basename(const char *filename);
extern void thr_set_sync_wait_callback(void (*before_sync)(void),
                                       void (*after_sync)(void));
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
extern const char *my_get_err_msg(uint nr);
extern int my_error_register(const char** (*get_errmsgs) (int nr),
                             uint first, uint last);
extern my_bool my_error_unregister(uint first, uint last);
extern void my_message(uint my_err, const char *str,myf MyFlags);
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, time_t backup_time_stamp,
                    myf MyFlags);
void my_create_backup_name(char *to, const char *from,
                           time_t backup_time_stamp);
extern int my_copystat(const char *from, const char *to, int MyFlags);
extern char * my_filename(File fd);

extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
extern char *my_tmpdir(MY_TMPDIR *tmpdir);
extern void free_tmpdir(MY_TMPDIR *tmpdir);

extern void my_remember_signal(int signal_number,sig_handler (*func)(int));
extern size_t dirname_part(char * to,const char *name, size_t *to_res_length);
extern size_t dirname_length(const char *name);
#define base_name(A) (A+dirname_length(A))
extern int test_if_hard_path(const char *dir_name);
extern my_bool has_path(const char *name);
extern char *convert_dirname(char *to, const char *from, const char *from_end);
extern void to_unix_path(char * name);
extern char * fn_ext(const char *name);
extern char * fn_ext2(const char *name);
extern char * fn_same(char * toname,const char *name,int flag);
extern char * fn_format(char * to,const char *name,const char *dir,
			   const char *form, uint flag);
extern size_t strlength(const char *str);
extern void pack_dirname(char * to,const char *from);
extern size_t normalize_dirname(char * to, const char *from);
extern size_t unpack_dirname(char * to,const char *from);
extern size_t cleanup_dirname(char * to,const char *from);
extern size_t system_filename(char * to,const char *from);
extern size_t unpack_filename(char * to,const char *from);
extern char * intern_filename(char * to,const char *from);
extern int pack_filename(char * to, const char *name, size_t max_length);
extern char * my_path(char * to,const char *progname,
			 const char *own_pathname_part);
extern char * my_load_path(char * to, const char *path,
			      const char *own_path_prefix);
extern int wild_compare(const char *str,const char *wildstr,
                        pbool str_is_pattern);
extern my_bool array_append_string_unique(const char *str,
                                          const char **array, size_t size);
extern void get_date(char * to,int timeflag,time_t use_time);
extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr,
                    pbool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file,
			     size_t reclength,enum cache_type type,
			     pbool use_async_io);
extern int read_cache_record(RECORD_CACHE *info,uchar *to);
extern int end_record_cache(RECORD_CACHE *info);
extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
			      const uchar *record,size_t length);
extern int flush_write_cache(RECORD_CACHE *info);
extern void handle_recived_signals(void);

extern sig_handler my_set_alarm_variable(int signo);
extern my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element);
extern void my_string_ptr_sort(uchar *base,uint items,size_t size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
				  size_t size_of_element,uchar *buffer[]);
extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size,
                        qsort_cmp cmp);
extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size,
                         qsort_cmp2 cmp, void *cmp_argument);
extern qsort_cmp2 get_ptr_compare(size_t);
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize,
			 enum cache_type type,my_off_t seek_offset,
			 my_bool use_async_io, myf cache_myflags);
extern int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize,
                              enum cache_type type, my_off_t seek_offset,
                              pbool use_async_io, myf cache_myflags,
                              PSI_file_key file_key);
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
			       my_off_t seek_offset, my_bool use_async_io,
			       my_bool clear_cache);
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
                                IO_CACHE *write_cache, uint num_threads);

extern int init_slave_io_cache(IO_CACHE *master, IO_CACHE *slave);
void end_slave_io_cache(IO_CACHE *cache);
void seek_io_cache(IO_CACHE *cache, my_off_t needed_offset);

extern void remove_io_thread(IO_CACHE *info);
extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count);
extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count);

extern int my_block_write(IO_CACHE *info, const uchar *Buffer,
			  size_t Count, my_off_t pos);

#define flush_io_cache(info) my_b_flush_io_cache((info),1)

extern int end_io_cache(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
extern my_bool my_b_write_backtick_quote(IO_CACHE *info, const char *str,
                                         size_t len);
extern my_bool my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
				 const char *prefix, size_t cache_size,
				 myf cache_myflags);
extern my_bool real_open_cached_file(IO_CACHE *cache);
extern void close_cached_file(IO_CACHE *cache);
File create_temp_file(char *to, const char *dir, const char *pfx,
		      int mode, myf MyFlags);
#define my_init_dynamic_array(A,B,C,D,E,F) init_dynamic_array2(A,B,C,NULL,D,E,F)
#define my_init_dynamic_array2(A,B,C,D,E,F,G) init_dynamic_array2(A,B,C,D,E,F,G)
extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
                                   uint element_size, void *init_buffer,
                                   uint init_alloc, uint alloc_increment,
                                   myf my_flags);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void* element);
extern void *alloc_dynamic(DYNAMIC_ARRAY *array);
extern void *pop_dynamic(DYNAMIC_ARRAY*);
extern my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element,
                           uint array_index);
extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements);
extern void get_dynamic(DYNAMIC_ARRAY *array, void *element, uint array_index);
extern void delete_dynamic(DYNAMIC_ARRAY *array);
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
extern void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f);
extern void freeze_size(DYNAMIC_ARRAY *array);
extern int  get_index_dynamic(DYNAMIC_ARRAY *array, void *element);
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
#define push_dynamic(A,B) insert_dynamic((A),(B))
#define reset_dynamic(array) ((array)->elements= 0)
#define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp))

extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
				   size_t init_alloc,size_t alloc_increment);
extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
			  size_t length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
                                       ...);
extern my_bool dynstr_append_quoted(DYNAMIC_STRING *str,
                                    const char *append, size_t len,
                                    char quote);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
extern void dynstr_free(DYNAMIC_STRING *str);
extern uint32 copy_and_convert_extended(char *to, uint32 to_length,
                                        CHARSET_INFO *to_cs,
                                        const char *from, uint32 from_length,
                                        CHARSET_INFO *from_cs, uint *errors);
extern void dynstr_reassociate(DYNAMIC_STRING *str, char **res, size_t *length,
                               size_t *alloc_length);
extern uint32 copy_and_convert_extended(char *to, uint32 to_length,
                                        CHARSET_INFO *to_cs,
                                        const char *from, uint32 from_length,
                                        CHARSET_INFO *from_cs, uint *errors);
#ifdef HAVE_MLOCK
extern void *my_malloc_lock(size_t length,myf flags);
extern void my_free_lock(void *ptr);
#else
#define my_malloc_lock(A,B) my_malloc(PSI_INSTRUMENT_ME, (A),(B))
#define my_free_lock(A) my_free((A))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define DEFAULT_ROOT_BLOCK_SIZE 1024
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root,
                            size_t block_size, size_t pre_alloc_size,
                            myf my_flags);
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void move_root(MEM_ROOT *to, MEM_ROOT *from);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
                                size_t prealloc_size);
extern char *strdup_root(MEM_ROOT *root,const char *str);
static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
{
  return str ? strdup_root(root, str) : 0;
}
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
extern LEX_CSTRING safe_lexcstrdup_root(MEM_ROOT *root, const LEX_CSTRING str);
extern my_bool my_compress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t , size_t *);
extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
                                size_t *complen);
extern void *my_az_allocator(void *dummy, unsigned int items, unsigned int size);
extern void my_az_free(void *dummy, void *address);
extern int my_compress_buffer(uchar *dest, size_t *destLen,
                              const uchar *source, size_t sourceLen);
extern int packfrm(const uchar *, size_t, uchar **, size_t *);
extern int unpackfrm(uchar **, size_t *, const uchar *);

extern uint32 my_checksum(uint32, const void *, size_t);
extern uint32 my_crc32c(uint32, const void *, size_t);

extern const char *my_crc32c_implementation();

#ifdef DBUG_ASSERT_EXISTS
extern void my_debug_put_break_here(void);
#else
#define my_debug_put_break_here() do {} while(0)
#endif

extern void my_sleep(ulong m_seconds);
extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void);

extern my_bool my_gethwaddr(uchar *to);
extern int my_getncpus(void);

#define HRTIME_RESOLUTION               1000000ULL  /* microseconds */
typedef struct {ulonglong val;} my_hrtime_t;
void my_time_init(void);
extern my_hrtime_t my_hrtime(void);

#ifdef _WIN32
extern my_hrtime_t my_hrtime_coarse();
#else
#define my_hrtime_coarse() my_hrtime()
#endif

extern ulonglong my_interval_timer(void);
extern ulonglong my_getcputime(void);

#define microsecond_interval_timer()    (my_interval_timer()/1000)
#define hrtime_to_time(X)               ((time_t)((X).val/HRTIME_RESOLUTION))
#define hrtime_from_time(X)             ((ulonglong)((X)*HRTIME_RESOLUTION))
#define hrtime_to_double(X)             ((X).val/(double)HRTIME_RESOLUTION)
#define hrtime_sec_part(X)              ((ulong)((X).val % HRTIME_RESOLUTION))
#define my_time(X)                      hrtime_to_time(my_hrtime_coarse())

/**
  Make high resolution time from two parts.
*/

static inline my_hrtime_t make_hr_time(my_time_t time, ulong time_sec_part)
{
  my_hrtime_t res= {((ulonglong) time)*1000000 + time_sec_part};
  return res;
}


#if STACK_DIRECTION < 0
#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END))
#else
#define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR))
#endif

#ifndef MAP_SYNC
#define MAP_SYNC 0x80000
#endif
#ifndef MAP_SHARED_VALIDATE
#define MAP_SHARED_VALIDATE 0x03
#endif

#ifdef HAVE_SYS_MMAN_H
#ifndef MAP_NOSYNC
#define MAP_NOSYNC      0
#endif
#ifndef MAP_NORESERVE
#define MAP_NORESERVE 0         /* For irix and AIX */
#endif

#ifdef HAVE_MMAP64
#define my_mmap(a,b,c,d,e,f)    mmap64(a,b,c,d,e,f)
#else
#define my_mmap(a,b,c,d,e,f)    mmap(a,b,c,d,e,f)
#endif
#define my_munmap(a,b)          munmap((a),(b))

#else
/* not a complete set of mmap() flags, but only those that necessary */
#define PROT_READ        1
#define PROT_WRITE       2
#define MAP_NORESERVE    0
#define MAP_SHARED       0x0001
#define MAP_PRIVATE      0x0002
#define MAP_NOSYNC       0x0800
#define MAP_FAILED       ((void *)-1)
#define MS_SYNC          0x0000

#define HAVE_MMAP
void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t);
#endif

#ifdef _WIN32
extern FILE* my_win_popen(const char*, const char*);
extern int my_win_pclose(FILE*);
#define my_popen(A,B) my_win_popen(A,B)
#define my_pclose(A) my_win_pclose(A)
#else
#define my_popen(A,B) popen(A,B)
#define my_pclose(A) pclose(A)
#endif

/* my_getpagesize */
#ifdef HAVE_GETPAGESIZE
#define my_getpagesize()        getpagesize()
#else
int my_getpagesize(void);
#endif

int my_msync(int, void *, size_t, int);

#define MY_UUID_SIZE 16
#define MY_UUID_STRING_LENGTH (8+1+4+1+4+1+4+1+12)
#define MY_UUID_ORACLE_STRING_LENGTH (8+4+4+4+12)

void my_uuid_init(ulong seed1, ulong seed2);
void my_uuid(uchar *guid);
void my_uuid2str(const uchar *guid, char *s);
void my_uuid2str_oracle(const uchar *guid, char *s);
void my_uuid_end(void);

const char *my_dlerror(const char *dlpath);

/* character sets */
extern void my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader);
extern uint get_charset_number(const char *cs_name, uint cs_flags, myf flags);
extern uint get_collation_number(const char *name,myf flags);
extern const char *get_charset_name(uint cs_number);

extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *my_collation_get_by_name(MY_CHARSET_LOADER *loader,
                                              const char *name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
					   uint cs_flags, myf my_flags);
extern CHARSET_INFO *my_charset_get_by_name(MY_CHARSET_LOADER *loader,
                                            const char *name,
                                            uint cs_flags, myf my_flags);
extern my_bool resolve_charset(const char *cs_name,
                               CHARSET_INFO *default_cs,
                               CHARSET_INFO **cs,
                               myf flags);
extern my_bool resolve_collation(const char *cl_name,
                                 CHARSET_INFO *default_cl,
                                 CHARSET_INFO **cl,
                                 myf my_flags);
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
static inline my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
{
  return (cs1->cs_name.str == cs2->cs_name.str);
}
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(struct charset_info_st *cs);
extern void add_compiled_extra_collation(struct charset_info_st *cs);
extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
                                      char *to, size_t to_length,
                                      const char *from, size_t length,
                                      my_bool *overflow);
extern char *my_get_tty_password(const char *opt_message);
#ifdef _WIN32
#define BACKSLASH_MBTAIL
/* File system character set */
extern CHARSET_INFO *fs_character_set(void);
#endif
extern const char *my_default_csname(void);
extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
                                      char *to, size_t to_length,
                                      const char *from, size_t length,
                                      my_bool *overflow);

extern void thd_increment_bytes_sent(void *thd, size_t length);
extern void thd_increment_bytes_received(void *thd, size_t length);
extern void thd_increment_net_big_packet_count(void *thd, size_t length);

#ifdef _WIN32

/* implemented in my_conio.c */
char* my_cgets(char *string, size_t clen, size_t* plen);

#endif

#include <mysql/psi/psi.h>

#ifdef HAVE_PSI_INTERFACE
extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook;
extern void set_psi_server(PSI *psi);
void my_init_mysys_psi_keys(void);
#endif

struct st_mysql_file;
extern struct st_mysql_file *mysql_stdin;
C_MODE_END
#endif /* _my_sys_h */
server/sslopt-longopts.h000064400000005137150400263670011423 0ustar00#ifndef SSLOPT_LONGOPTS_INCLUDED
#define SSLOPT_LONGOPTS_INCLUDED

/*
   Copyright (c) 2000, 2010, Oracle and/or its affiliates.

   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 */

#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)

  {"ssl", 0,
   "Enable SSL for connection (automatically enabled with other flags).",
   &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
  {"ssl-ca", OPT_SSL_CA,
   "CA file in PEM format (check OpenSSL docs, implies --ssl).",
   &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
  {"ssl-capath", OPT_SSL_CAPATH,
   "CA directory (check OpenSSL docs, implies --ssl).",
   &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},
  {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
   &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},
  {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
   &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},
  {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
   &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},
  {"ssl-crl", OPT_SSL_CRL, "Certificate revocation list (implies --ssl).",
   &opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},
  {"ssl-crlpath", OPT_SSL_CRLPATH,
    "Certificate revocation list path (implies --ssl).",
   &opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},
  {"tls-version", 0, "TLS protocol version for secure connection.",
   &opt_tls_version, &opt_tls_version, 0, GET_STR, REQUIRED_ARG,
   0, 0, 0, 0, 0, 0},

#ifdef MYSQL_CLIENT
  {"ssl-verify-server-cert", 0,
   "Verify server's \"Common Name\" in its cert against hostname used "
   "when connecting. This option is disabled by default.",
   &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
   0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */
#endif /* SSLOPT_LONGOPTS_INCLUDED */
server/sslopt-case.h000064400000002776150400263670010477 0ustar00#ifndef SSLOPT_CASE_INCLUDED
#define SSLOPT_CASE_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
    case OPT_SSL_KEY:
    case OPT_SSL_CERT:
    case OPT_SSL_CA:
    case OPT_SSL_CAPATH:
    case OPT_SSL_CIPHER:
    case OPT_SSL_CRL:
    case OPT_SSL_CRLPATH:
    /*
      Enable use of SSL if we are using any ssl option
      One can disable SSL later by using --skip-ssl or --ssl=0
    */
      opt_use_ssl= 1;
#if defined (HAVE_WOLFSSL)
#if defined(MYSQL_SERVER)
      /* CRL does not work with WolfSSL (server) */
      opt_ssl_crl= NULL;
#endif
#if !defined(_WIN32) || !defined(LIBMARIADB)
      /* CRL_PATH does not work with WolfSSL (server) and GnuTLS (client) */
      opt_ssl_crlpath= NULL;
#endif
#endif
      break;
#endif
#endif /* SSLOPT_CASE_INCLUDED */
server/m_ctype.h000064400000177412150400263670007702 0ustar00/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, 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 */

/*
  A better implementation of the UNIX ctype(3) library.
*/

#ifndef _m_ctype_h
#define _m_ctype_h

#include <my_attribute.h>
#include <m_string.h>

enum loglevel {
   ERROR_LEVEL=       0,
   WARNING_LEVEL=     1,
   INFORMATION_LEVEL= 2
};

#ifdef	__cplusplus
extern "C" {
#endif

#define MY_CS_NAME_SIZE			32
#define MY_CS_CTYPE_TABLE_SIZE		257
#define MY_CS_TO_LOWER_TABLE_SIZE	256
#define MY_CS_TO_UPPER_TABLE_SIZE	256
#define MY_CS_SORT_ORDER_TABLE_SIZE	256
#define MY_CS_TO_UNI_TABLE_SIZE		256

#define CHARSET_DIR	"charsets/"

#define my_wc_t ulong

#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD

/**
  Maximum character length of a string produced by wc_to_printable().
  Note, wc_to_printable() is currently limited to BMP.
  One non-printable or non-convertable character can produce a string
  with at most 5 characters: \hhhh.
  If we ever modify wc_to_printable() to support supplementary characters,
  e.g. \+hhhhhh, this constant should be changed to 8.
  Note, maximum octet length of a wc_to_printable() result can be calculated
  as: (MY_CS_PRINTABLE_CHAR_LENGTH*cs->mbminlen).
*/
#define MY_CS_PRINTABLE_CHAR_LENGTH  5


/*
  On i386 we store Unicode->CS conversion tables for
  some character sets using Big-endian order,
  to copy two bytes at once.
  This gives some performance improvement.
*/
#ifdef __i386__
#define MB2(x)                (((x) >> 8) + (((x) & 0xFF) << 8))
#define MY_PUT_MB2(s, code)   { *((uint16*)(s))= (code); }
#else
#define MB2(x)                (x)
#define MY_PUT_MB2(s, code)   { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
#endif

typedef const struct my_charset_handler_st MY_CHARSET_HANDLER;
typedef const struct my_collation_handler_st MY_COLLATION_HANDLER;

typedef const struct unicase_info_st MY_UNICASE_INFO;
typedef const struct uni_ctype_st MY_UNI_CTYPE;
typedef const struct my_uni_idx_st MY_UNI_IDX;
typedef uint16 decimal_digits_t;

typedef struct unicase_info_char_st
{
  uint32 toupper;
  uint32 tolower;
  uint32 sort;
} MY_UNICASE_CHARACTER;


struct unicase_info_st
{
  my_wc_t maxchar;
  MY_UNICASE_CHARACTER **page;
};


extern MY_UNICASE_INFO my_unicase_default;
extern MY_UNICASE_INFO my_unicase_turkish;
extern MY_UNICASE_INFO my_unicase_mysql500;
extern MY_UNICASE_INFO my_unicase_unicode520;

#define MY_UCA_MAX_CONTRACTION 6
/*
  The DUCET tables in ctype-uca.c are dumped with a limit of 8 weights
  per character. cs->strxfrm_multiply is set to 8 for all UCA based collations.

  In language-specific UCA collations (with tailorings) we also do not allow
  a single character to have more than 8 weights to stay with the same
  strxfrm_multiply limit. Note, contractions are allowed to have twice longer
  weight strings (up to 16 weights). As a contraction consists of at
  least 2 characters, this makes sure that strxfrm_multiply ratio of 8
  is respected.
*/
#define MY_UCA_MAX_WEIGHT_SIZE (8+1)               /* Including 0 terminator */
#define MY_UCA_CONTRACTION_MAX_WEIGHT_SIZE (2*8+1) /* Including 0 terminator */
#define MY_UCA_WEIGHT_LEVELS   2

typedef struct my_contraction_t
{
  my_wc_t ch[MY_UCA_MAX_CONTRACTION];   /* Character sequence              */
  uint16 weight[MY_UCA_CONTRACTION_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */
  my_bool with_context;
} MY_CONTRACTION;


typedef struct my_contraction_list_t
{
  size_t nitems;         /* Number of items in the list                  */
  MY_CONTRACTION *item;  /* List of contractions                         */
  char *flags;           /* Character flags, e.g. "is contraction head") */
} MY_CONTRACTIONS;

my_bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc);
my_bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc);
uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c,
                                   my_wc_t wc1, my_wc_t wc2);


/* Collation weights on a single level (e.g. primary, secondary, tertiary) */
typedef struct my_uca_level_info_st
{
  my_wc_t maxchar;
  uchar   *lengths;
  uint16  **weights;
  MY_CONTRACTIONS contractions;
  uint    levelno;
} MY_UCA_WEIGHT_LEVEL;


typedef struct uca_info_st
{
  MY_UCA_WEIGHT_LEVEL level[MY_UCA_WEIGHT_LEVELS];

  /* Logical positions */
  my_wc_t first_non_ignorable;
  my_wc_t last_non_ignorable;
  my_wc_t first_primary_ignorable;
  my_wc_t last_primary_ignorable;
  my_wc_t first_secondary_ignorable;
  my_wc_t last_secondary_ignorable;
  my_wc_t first_tertiary_ignorable;
  my_wc_t last_tertiary_ignorable;
  my_wc_t first_trailing;
  my_wc_t last_trailing;
  my_wc_t first_variable;
  my_wc_t last_variable;

} MY_UCA_INFO;



extern MY_UCA_INFO my_uca_v400;


struct uni_ctype_st
{
  uchar  pctype;
  const uchar  *ctype;
};

extern MY_UNI_CTYPE my_uni_ctype[256];

/* wm_wc and wc_mb return codes */
#define MY_CS_ILSEQ	0     /* Wrong by sequence: wb_wc                   */
#define MY_CS_ILUNI	0     /* Cannot encode Unicode to charset: wc_mb    */
#define MY_CS_TOOSMALL  -101  /* Need at least one byte:    wc_mb and mb_wc */
#define MY_CS_TOOSMALL2 -102  /* Need at least two bytes:   wc_mb and mb_wc */
#define MY_CS_TOOSMALL3 -103  /* Need at least three bytes: wc_mb and mb_wc */
/* These following three are currently not really used */
#define MY_CS_TOOSMALL4 -104  /* Need at least 4 bytes: wc_mb and mb_wc */
#define MY_CS_TOOSMALL5 -105  /* Need at least 5 bytes: wc_mb and mb_wc */
#define MY_CS_TOOSMALL6 -106  /* Need at least 6 bytes: wc_mb and mb_wc */
/* A helper macros for "need at least n bytes" */
#define MY_CS_TOOSMALLN(n)    (-100-(n))

#define MY_CS_MBMAXLEN  6     /* Maximum supported mbmaxlen */
#define MY_CS_IS_TOOSMALL(rc) ((rc) >= MY_CS_TOOSMALL6 && (rc) <= MY_CS_TOOSMALL)

#define MY_SEQ_INTTAIL	1
#define MY_SEQ_SPACES	2
#define MY_SEQ_NONSPACES 3 /* Skip non-space characters, including bad bytes */

        /* My charsets_list flags */
#define MY_CS_COMPILED  1      /* compiled-in sets               */
#define MY_CS_CONFIG    2      /* sets that have a *.conf file   */
#define MY_CS_INDEX     4      /* sets listed in the Index file  */
#define MY_CS_LOADED    8      /* sets that are currently loaded */
#define MY_CS_BINSORT	16     /* if binary sort order           */
#define MY_CS_PRIMARY	32     /* if primary collation           */
#define MY_CS_STRNXFRM	64     /* if strnxfrm is used for sort   */
#define MY_CS_UNICODE	128    /* is a charset is BMP Unicode    */
#define MY_CS_READY	256    /* if a charset is initialized    */
#define MY_CS_AVAILABLE	512    /* If either compiled-in or loaded*/
#define MY_CS_CSSORT	1024   /* if case sensitive sort order   */	
#define MY_CS_HIDDEN	2048   /* don't display in SHOW          */	
#define MY_CS_PUREASCII 4096   /* if a charset is pure ascii     */
#define MY_CS_NONASCII  8192   /* if not ASCII-compatible        */
#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
#define MY_CS_LOWER_SORT 32768 /* If use lower case as weight   */
#define MY_CS_STRNXFRM_BAD_NWEIGHTS 0x10000 /* strnxfrm ignores "nweights" */
#define MY_CS_NOPAD   0x20000  /* if does not ignore trailing spaces */
#define MY_CS_NON1TO1 0x40000  /* Has a complex mapping from characters
                                  to weights, e.g. contractions, expansions,
                                  ignorable characters */
#define MY_CHARSET_UNDEFINED 0

/* Character repertoire flags */
typedef enum enum_repertoire_t
{
  MY_REPERTOIRE_NONE=        0,
  MY_REPERTOIRE_ASCII=       1, /* Pure ASCII            U+0000..U+007F */
  MY_REPERTOIRE_EXTENDED=    2, /* Extended characters:  U+0080..U+FFFF */
  MY_REPERTOIRE_UNICODE30=   3  /* ASCII | EXTENDED:     U+0000..U+FFFF */
} my_repertoire_t;


/* Flags for strxfrm */
#define MY_STRXFRM_LEVEL1          0x00000001 /* for primary weights   */
#define MY_STRXFRM_LEVEL2          0x00000002 /* for secondary weights */
#define MY_STRXFRM_LEVEL3          0x00000004 /* for tertiary weights  */
#define MY_STRXFRM_LEVEL4          0x00000008 /* fourth level weights  */
#define MY_STRXFRM_LEVEL5          0x00000010 /* fifth level weights   */
#define MY_STRXFRM_LEVEL6          0x00000020 /* sixth level weights   */
#define MY_STRXFRM_LEVEL_ALL       0x0000003F /* Bit OR for the above six */
#define MY_STRXFRM_NLEVELS         6          /* Number of possible levels*/

#define MY_STRXFRM_PAD_WITH_SPACE  0x00000040 /* if pad result with spaces */
#define MY_STRXFRM_PAD_TO_MAXLEN   0x00000080 /* if pad tail(for filesort) */

#define MY_STRXFRM_DESC_LEVEL1     0x00000100 /* if desc order for level1 */
#define MY_STRXFRM_DESC_LEVEL2     0x00000200 /* if desc order for level2 */
#define MY_STRXFRM_DESC_LEVEL3     0x00000300 /* if desc order for level3 */
#define MY_STRXFRM_DESC_LEVEL4     0x00000800 /* if desc order for level4 */
#define MY_STRXFRM_DESC_LEVEL5     0x00001000 /* if desc order for level5 */
#define MY_STRXFRM_DESC_LEVEL6     0x00002000 /* if desc order for level6 */
#define MY_STRXFRM_DESC_SHIFT      8

#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions     */
#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions     */

#define MY_STRXFRM_REVERSE_LEVEL1  0x00010000 /* if reverse order for level1 */
#define MY_STRXFRM_REVERSE_LEVEL2  0x00020000 /* if reverse order for level2 */
#define MY_STRXFRM_REVERSE_LEVEL3  0x00040000 /* if reverse order for level3 */
#define MY_STRXFRM_REVERSE_LEVEL4  0x00080000 /* if reverse order for level4 */
#define MY_STRXFRM_REVERSE_LEVEL5  0x00100000 /* if reverse order for level5 */
#define MY_STRXFRM_REVERSE_LEVEL6  0x00200000 /* if reverse order for level6 */
#define MY_STRXFRM_REVERSE_SHIFT   16

/* Flags to strnncollsp_nchars */
/*
  MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES -
    defines if inside strnncollsp_nchars()
    short strings should be virtually extended to "nchars"
    characters by emulating trimmed trailing spaces.

    This flag is needed when comparing packed strings of the CHAR
    data type, when trailing spaces are trimmed on storage (like in InnoDB),
    however the actual values (after unpacking) will have those trailing
    spaces.

    If this flag is passed, strnncollsp_nchars() performs both
    truncating longer strings and extending shorter strings
    to exactly "nchars".

    If this flag is not passed, strnncollsp_nchars() only truncates longer
    strings to "nchars", but does not extend shorter strings to "nchars".
*/
#define MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES 1


/*
   Collation IDs for MariaDB that should not conflict with MySQL.
   We reserve 256..511, because MySQL will most likely use this range
   when the range 0..255 is full.

   We use the next 256 IDs starting from 512 and divide
   them into 8 chunks, 32 collations each, as follows:

   512 + (0..31)    for single byte collations (e.g. latin9)
   512 + (32..63)   reserved (e.g. for utf32le, or more single byte collations)
   512 + (64..95)   for utf8
   512 + (96..127)  for utf8mb4
   512 + (128..159) for ucs2
   512 + (160..192) for utf16
   512 + (192..223) for utf16le
   512 + (224..255) for utf32
*/
#define MY_PAGE2_COLLATION_ID_8BIT     0x200
#define MY_PAGE2_COLLATION_ID_RESERVED 0x220
#define MY_PAGE2_COLLATION_ID_UTF8     0x240
#define MY_PAGE2_COLLATION_ID_UTF8MB4  0x260
#define MY_PAGE2_COLLATION_ID_UCS2     0x280
#define MY_PAGE2_COLLATION_ID_UTF16    0x2A0
#define MY_PAGE2_COLLATION_ID_UTF16LE  0x2C0
#define MY_PAGE2_COLLATION_ID_UTF32    0x2E0

struct my_uni_idx_st
{
  uint16 from;
  uint16 to;
  const uchar *tab;
};

typedef struct
{
  uint beg;
  uint end;
  uint mb_len;
} my_match_t;

enum my_lex_states
{
  MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, 
  MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
  MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
  MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
  MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
  MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, 
  MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, 
  MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, 
  MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
  MY_LEX_IDENT_OR_KEYWORD,
  MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
  MY_LEX_STRING_OR_DELIMITER, MY_LEX_MINUS_OR_COMMENT, MY_LEX_PLACEHOLDER,
  MY_LEX_COMMA,
  MY_LEX_IDENT_OR_QUALIFIED_SPECIAL_FUNC
};

struct charset_info_st;

typedef struct my_charset_loader_st
{
  char error[128];
  void *(*once_alloc)(size_t);
  void *(*malloc)(size_t);
  void *(*realloc)(void *, size_t);
  void (*free)(void *);
  void (*reporter)(enum loglevel, const char *format, ...);
  int  (*add_collation)(struct charset_info_st *cs);
} MY_CHARSET_LOADER;


extern int (*my_string_stack_guard)(int);

/* See strings/CHARSET_INFO.txt for information about this structure  */
struct my_collation_handler_st
{
  my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *);
  /* Collation routines */
  int     (*strnncoll)(CHARSET_INFO *,
		       const uchar *, size_t, const uchar *, size_t, my_bool);
  int     (*strnncollsp)(CHARSET_INFO *,
                         const uchar *, size_t, const uchar *, size_t);
  /*
    strnncollsp_nchars() - similar to strnncollsp() but assumes that both
                           strings were originally CHAR(N) values with the
                           same N, then were optionally space-padded,
                           or optionally space-trimmed.

                           In other words, this function compares in the way
                           if we insert both values into a CHAR(N) column
                           and then compare the two column values.

    It compares the same amount of characters from the two strings.
    This is especially important for NOPAD collations.

    If CHAR_LENGTH of the two strings are different,
    the shorter string is virtually padded with trailing spaces
    up to CHAR_LENGTH of the longer string, to guarantee that the
    same amount of characters are compared.
    This is important if the two CHAR(N) strings are space-trimmed 
    (e.g. like in InnoDB compact format for CHAR).

    The function compares not more than "nchars" characters only.
    This can be useful to compare CHAR(N) space-padded strings
    (when the exact N is known) without having to truncate them before
    the comparison.

    For example, Field_string stores a "CHAR(3) CHARACTER SET utf8mb4" value
    of "aaa" as 12 bytes in a record buffer:
    - 3 bytes of the actual data, followed by
    - 9 bytes of spaces (just fillers, not real data)
    The caller can pass nchars=3 to compare CHAR(3) record values.
    In such case, the comparator won't go inside the 9 bytes of the fillers.

    If N is not known, the caller can pass max(len1,len2) as the "nchars" value
    (i.e. the maximum of the OCTET_LENGTH of the two strings).

    Notes on complex collations.

    This function counts contraction parts as individual characters.
    For example, the Czech letter 'ch' (in Czech collations)
    is ordinarily counted by the "nchars" limit as TWO characters
    (although it is only one letter).
    This corresponds to what CHAR(N) does in INSERT.

    If the "nchars" limit tears apart a contraction, only the part fitting
    into "nchars" characters is used. For example, in case of a Czech collation,
    the string "ach" with nchars=2 is compared as 'ac': the contraction
    'ch' is torn apart and the letter 'c' acts as an individual character.
    This emulates the same comparison result with the scenario when we insert
    'ach' into a CHAR(2) column and then compare it.
  */
  int     (*strnncollsp_nchars)(CHARSET_INFO *,
                                const uchar *str1, size_t len1,
                                const uchar *str2, size_t len2,
                                size_t nchars,
                                uint flags);
  size_t     (*strnxfrm)(CHARSET_INFO *,
                         uchar *dst, size_t dstlen, uint nweights,
                         const uchar *src, size_t srclen, uint flags);
  size_t    (*strnxfrmlen)(CHARSET_INFO *, size_t); 
  my_bool (*like_range)(CHARSET_INFO *,
			const char *s, size_t s_length,
			pchar w_prefix, pchar w_one, pchar w_many, 
			size_t res_length,
			char *min_str, char *max_str,
			size_t *min_len, size_t *max_len);
  int     (*wildcmp)(CHARSET_INFO *,
  		     const char *str,const char *str_end,
                     const char *wildstr,const char *wildend,
                     int escape,int w_one, int w_many);

  int  (*strcasecmp)(CHARSET_INFO *, const char *, const char *);
  
  uint (*instr)(CHARSET_INFO *,
                const char *b, size_t b_length,
                const char *s, size_t s_length,
                my_match_t *match, uint nmatch);
  
  /* Hash calculation */
  void (*hash_sort)(CHARSET_INFO *cs, const uchar *key, size_t len,
		    ulong *nr1, ulong *nr2); 
  my_bool (*propagate)(CHARSET_INFO *cs, const uchar *str, size_t len);
  /*
    Make minimum and maximum strings for the collation.
    Put not more than "nchars" characters.
  */
  size_t (*min_str)(CHARSET_INFO *cs, uchar *dst, size_t dstlen, size_t nchars);
  size_t (*max_str)(CHARSET_INFO *cs, uchar *dst, size_t dstlen, size_t nchars);
};

extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_nopad_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_nopad_ci_handler;

/* Some typedef to make it easy for C++ to make function pointers */
typedef int (*my_charset_conv_mb_wc)(CHARSET_INFO *, my_wc_t *,
                                     const uchar *, const uchar *);
typedef int (*my_charset_conv_wc_mb)(CHARSET_INFO *, my_wc_t,
                                     uchar *, uchar *);
typedef size_t (*my_charset_conv_case)(CHARSET_INFO *,
                                       const char *, size_t, char *, size_t);

/*
  A structure to return the statistics of a native string copying,
  when no Unicode conversion is involved.

  The structure is OK to be uninitialized before calling a copying routine.
  A copying routine must populate the structure as follows:
    - m_source_end_pos must be set by to a non-NULL value
      in the range of the input string.
    - m_well_formed_error_pos must be set to NULL if the string was
      well formed, or to the position of the leftmost bad byte sequence.
*/
typedef struct
{
  const char *m_source_end_pos;        /* Position where reading stopped */
  const char *m_well_formed_error_pos; /* Position where a bad byte was found*/
} MY_STRCOPY_STATUS;


/*
  A structure to return the statistics of a Unicode string conversion.
*/
typedef struct
{
  const char *m_cannot_convert_error_pos;
} MY_STRCONV_STATUS;


/* See strings/CHARSET_INFO.txt about information on this structure  */
struct my_charset_handler_st
{
  my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader);
  /* Multibyte routines */
  size_t  (*numchars)(CHARSET_INFO *, const char *b, const char *e);
  size_t  (*charpos)(CHARSET_INFO *, const char *b, const char *e,
                     size_t pos);
  size_t  (*lengthsp)(CHARSET_INFO *, const char *ptr, size_t length);
  size_t  (*numcells)(CHARSET_INFO *, const char *b, const char *e);
  
  /* Unicode conversion */
  my_charset_conv_mb_wc mb_wc;
  my_charset_conv_wc_mb wc_mb;

  /* CTYPE scanner */
  int (*ctype)(CHARSET_INFO *cs, int *ctype,
               const uchar *s, const uchar *e);
  
  /* Functions for case and sort conversion */
  size_t  (*caseup_str)(CHARSET_INFO *, char *);
  size_t  (*casedn_str)(CHARSET_INFO *, char *);

  my_charset_conv_case caseup;
  my_charset_conv_case casedn;

  /* Charset dependent snprintf() */
  size_t (*snprintf)(CHARSET_INFO *, char *to, size_t n,
                     const char *fmt,
                     ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5);
  size_t (*long10_to_str)(CHARSET_INFO *, char *to, size_t n,
                          int radix, long int val);
  size_t (*longlong10_to_str)(CHARSET_INFO *, char *to, size_t n,
                              int radix, longlong val);
  
  void (*fill)(CHARSET_INFO *, char *to, size_t len, int fill);
  
  /* String-to-number conversion routines */
  long        (*strntol)(CHARSET_INFO *, const char *s, size_t l,
			 int base, char **e, int *err);
  ulong      (*strntoul)(CHARSET_INFO *, const char *s, size_t l,
			 int base, char **e, int *err);
  longlong   (*strntoll)(CHARSET_INFO *, const char *s, size_t l,
			 int base, char **e, int *err);
  ulonglong (*strntoull)(CHARSET_INFO *, const char *s, size_t l,
			 int base, char **e, int *err);
  double      (*strntod)(CHARSET_INFO *, char *s, size_t l, char **e,
			 int *err);
  longlong    (*strtoll10)(CHARSET_INFO *cs,
                           const char *nptr, char **endptr, int *error);
  ulonglong   (*strntoull10rnd)(CHARSET_INFO *cs,
                                const char *str, size_t length,
                                int unsigned_fl,
                                char **endptr, int *error);
  size_t        (*scan)(CHARSET_INFO *, const char *b, const char *e,
                        int sq);

  /* String copying routines and helpers for them */
  /*
    charlen() - calculate length of the left-most character in bytes.
    @param  cs    Character set
    @param  str   The beginning of the string
    @param  end   The end of the string
    
    @return       MY_CS_ILSEQ if a bad byte sequence was found.
    @return       MY_CS_TOOSMALLN(x) if the string ended unexpectedly.
    @return       a positive number in the range 1..mbmaxlen,
                  if a valid character was found.
  */
  int (*charlen)(CHARSET_INFO *cs, const uchar *str, const uchar *end);
  /*
    well_formed_char_length() - returns character length of a string.
    
    @param cs          Character set
    @param str         The beginning of the string
    @param end         The end of the string
    @param nchars      Not more than "nchars" left-most characters are checked.
    @param status[OUT] Additional statistics is returned here.
                       "status" can be uninitialized before the call,
                       and it is fully initialized after the call.
    
    status->m_source_end_pos is set to the position where reading stopped.
    
    If a bad byte sequence is found, the function returns immediately and
    status->m_well_formed_error_pos is set to the position where a bad byte
    sequence was found.
    
    status->m_well_formed_error_pos is set to NULL if no bad bytes were found.
    If status->m_well_formed_error_pos is NULL after the call, that means:
    - either the function reached the end of the string,
    - or all "nchars" characters were read.
    The caller can check status->m_source_end_pos to detect which of these two
    happened.
  */
  size_t (*well_formed_char_length)(CHARSET_INFO *cs,
                                    const char *str, const char *end,
                                    size_t nchars,
                                    MY_STRCOPY_STATUS *status);

  /*
    copy_fix() - copy a string, replace bad bytes to '?'.
    Not more than "nchars" characters are copied.

    status->m_source_end_pos is set to a position in the range
    between "src" and "src + src_length", where reading stopped.

    status->m_well_formed_error_pos is set to NULL if the string
    in the range "src" and "status->m_source_end_pos" was well formed,
    or is set to a position between "src" and "src + src_length" where
    the leftmost bad byte sequence was found.
  */
  size_t  (*copy_fix)(CHARSET_INFO *,
                      char *dst, size_t dst_length,
                      const char *src, size_t src_length,
                      size_t nchars, MY_STRCOPY_STATUS *status);
  /**
    Write a character to the target string, using its native code.
    For Unicode character sets (utf8, ucs2, utf16, utf16le, utf32, filename)
    native codes are equivalent to Unicode code points.
    For 8bit character sets the native code is just the byte value.
    For Asian characters sets:
    - MB1 native code is just the byte value (e.g. on the ASCII range)
    - MB2 native code is ((b0 << 8) + b1).
    - MB3 native code is ((b0 <<16) + (b1 << 8) + b2)
    Note, CHARSET_INFO::min_sort_char and CHARSET_INFO::max_sort_char
    are defined in native notation and should be written using
    my_ci_native_to_mb() rather than my_ci_wc_mb().
  */
  my_charset_conv_wc_mb native_to_mb;
  my_charset_conv_wc_mb wc_to_printable;
};

extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
extern MY_CHARSET_HANDLER my_charset_utf8mb3_handler;


/*
  We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
  typedef in hash.c, which will cause a compiler error.
*/
#define CHARSET_INFO_DEFINED


/* See strings/CHARSET_INFO.txt about information on this structure  */
struct charset_info_st
{
  uint      number;
  uint      primary_number;
  uint      binary_number;
  uint      state;
  LEX_CSTRING cs_name;
  LEX_CSTRING coll_name;
  const char *comment;
  const char *tailoring;
  const uchar *m_ctype;
  const uchar *to_lower;
  const uchar *to_upper;
  const uchar *sort_order;
  MY_UCA_INFO *uca;
  const uint16 *tab_to_uni;
  MY_UNI_IDX  *tab_from_uni;
  MY_UNICASE_INFO *caseinfo;
  const uchar  *state_map;
  const uchar  *ident_map;
  uint      strxfrm_multiply;
  uchar     caseup_multiply;
  uchar     casedn_multiply;
  uint      mbminlen;
  uint      mbmaxlen;
  /*
    min_sort_char and max_sort_char represent the minimum
    and the maximum character in the collation respectively.

    For Unicode collations, these numbers are Unicode code points.
    For non-Unicode collations these numbers are native character codes.
    For example, in all 8bit collations these numbers are
    in the range 0x00..0xFF.

    min_sort_char and max_sort_char normally should not be used directly.
    They are used internally in the following virtual functions:
    - MY_COLLATION_HANDLER::like_range()
    - MY_COLLATION_HANDLER::min_str()
    - MY_COLLATION_HANDLER::max_str()
  */
  my_wc_t   min_sort_char;
  my_wc_t   max_sort_char;
  uchar     pad_char;
  my_bool   escape_with_backslash_is_dangerous;
  uchar     levels_for_order;
  
  MY_CHARSET_HANDLER *cset;
  MY_COLLATION_HANDLER *coll;

#ifdef __cplusplus
  /* Character set routines */
  bool use_mb() const
  {
    return mbmaxlen > 1;
  }

  size_t numchars(const char *b, const char *e) const
  {
    return (cset->numchars)(this, b, e);
  }

  size_t charpos(const char *b, const char *e, size_t pos) const
  {
    return (cset->charpos)(this, b, e, pos);
  }
  size_t charpos(const uchar *b, const uchar *e, size_t pos) const
  {
    return (cset->charpos)(this, (const char *) b, (const char*) e, pos);
  }

  size_t lengthsp(const char *str, size_t length) const
  {
    return (cset->lengthsp)(this, str, length);
  }

  size_t numcells(const char *b, const char *e) const
  {
    return (cset->numcells)(this, b, e);
  }

  size_t caseup(const char *src, size_t srclen,
                char *dst, size_t dstlen) const
  {
    return (cset->caseup)(this, src, srclen, dst, dstlen);
  }

  size_t casedn(const char *src, size_t srclen,
                char *dst, size_t dstlen) const
  {
    return (cset->casedn)(this, src, srclen, dst, dstlen);
  }

  size_t long10_to_str(char *dst, size_t dstlen,
                       int radix, long int val) const
  {
    return (cset->long10_to_str)(this, dst, dstlen, radix, val);
  }

  size_t (longlong10_to_str)(char *dst, size_t dstlen,
                             int radix, longlong val) const
  {
    return (cset->longlong10_to_str)(this, dst, dstlen, radix, val);
  }

  int mb_wc(my_wc_t *wc, const uchar *b, const uchar *e) const
  {
    return (cset->mb_wc)(this, wc, b, e);
  }

  int wc_mb(my_wc_t wc, uchar *s, uchar *e) const
  {
    return (cset->wc_mb)(this, wc, s, e);
  }

  int native_to_mb(my_wc_t wc, uchar *s, uchar *e) const
  {
    return (cset->native_to_mb)(this, wc, s, e);
  }

  int wc_to_printable(my_wc_t wc, uchar *s, uchar *e) const
  {
    return (cset->wc_to_printable)(this, wc, s, e);
  }

  int ctype(int *to, const uchar *s, const uchar *e) const
  {
    return (cset->ctype)(this, to, s, e);
  }

  void fill(char *to, size_t len, int ch) const
  {
    (cset->fill)(this, to, len, ch);
  }

  long strntol(const char *str, size_t length,
               int base, char **endptr, int *error) const
  {
    return (cset->strntol)(this, str, length, base, endptr, error);
  }

  ulong strntoul(const char *str, size_t length,
                 int base, char **endptr, int *error) const
  {
    return (cset->strntoul)(this, str, length, base, endptr, error);
  }

  longlong strntoll(const char *str, size_t length,
                    int base, char **endptr, int *error) const
  {
    return (cset->strntoll)(this, str, length, base, endptr, error);
  }

  ulonglong strntoull(const char *str, size_t length,
                      int base, char **endptr, int *error) const
  {
    return (cset->strntoull)(this, str, length, base, endptr, error);
  }

  double strntod(char *str, size_t length,
                 char **endptr, int *error) const
  {
    return (cset->strntod)(this, str, length, endptr, error);
  }

  longlong strtoll10(const char *str, char **endptr, int *error) const
  {
    return (cset->strtoll10)(this, str, endptr, error);
  }

  ulonglong strntoull10rnd(const char *str, size_t length, int unsigned_fl,
                           char **endptr, int *error) const
  {
    return (cset->strntoull10rnd)(this, str, length, unsigned_fl, endptr, error);
  }

  size_t scan(const char *b, const char *e, int seq) const
  {
    return (cset->scan)(this, b, e, seq);
  }

  int charlen(const uchar *str, const uchar *end) const
  {
    return (cset->charlen)(this, str, end);
  }
  int charlen(const char *str, const char *end) const
  {
    return (cset->charlen)(this, (const uchar *) str, (const uchar *) end);
  }

  uint charlen_fix(const uchar *str, const uchar *end) const
  {
    int char_length= (cset->charlen)(this, str, end);
    DBUG_ASSERT(str < end);
    return char_length > 0 ? (uint) char_length : (uint) 1U;
  }
  uint charlen_fix(const char *str, const char *end) const
  {
    return charlen_fix((const uchar *) str, (const uchar *) end);
  }

  size_t well_formed_char_length(const char *str, const char *end,
                                 size_t nchars,
                                 MY_STRCOPY_STATUS *status) const
  {
    return (cset->well_formed_char_length)(this, str, end, nchars, status);
  }

  size_t copy_fix(char *dst, size_t dst_length,
                  const char *src, size_t src_length,
                  size_t nchars, MY_STRCOPY_STATUS *status) const
  {
    return (cset->copy_fix)(this, dst, dst_length, src, src_length, nchars,
                          status);
  }

  /* Collation routines */
  int strnncoll(const uchar *a, size_t alen,
                const uchar *b, size_t blen, my_bool b_is_prefix= FALSE) const
  {
    return (coll->strnncoll)(this, a, alen, b, blen, b_is_prefix);
  }
  int strnncoll(const char *a, size_t alen,
                const char *b, size_t blen, my_bool b_is_prefix= FALSE) const
  {
    return (coll->strnncoll)(this,
                             (const uchar *) a, alen,
                             (const uchar *) b, blen, b_is_prefix);
  }

  int strnncollsp(const uchar *a, size_t alen,
                  const uchar *b, size_t blen) const
  {
    return (coll->strnncollsp)(this, a, alen, b, blen);
  }
  int strnncollsp(const char *a, size_t alen,
                  const char *b, size_t blen) const
  {
    return (coll->strnncollsp)(this, (uchar *) a, alen, (uchar *) b, blen);
  }

  int strnncollsp(const LEX_CSTRING &a, const LEX_CSTRING &b) const
  {
    return (coll->strnncollsp)(this, (uchar *) a.str, a.length,
                                     (uchar *) b.str, b.length);
  }

  size_t strnxfrm(char *dst, size_t dstlen, uint nweights,
                  const char *src, size_t srclen, uint flags) const
  {
    return (coll->strnxfrm)(this,
                            (uchar *) dst, dstlen, nweights,
                            (const uchar *) src, srclen, flags);
  }
  size_t strnxfrm(uchar *dst, size_t dstlen, uint nweights,
                  const uchar *src, size_t srclen, uint flags) const
  {
    return (coll->strnxfrm)(this,
                            dst, dstlen, nweights,
                            src, srclen, flags);
  }
  size_t strnxfrm(uchar *dst, size_t dstlen,
                  const uchar *src, size_t srclen) const
  {
    return (coll->strnxfrm)(this,
                            dst, dstlen, (uint) dstlen,
                            src, srclen, MY_STRXFRM_PAD_WITH_SPACE);
  }

  size_t strnxfrmlen(size_t length) const
  {
    return (coll->strnxfrmlen)(this, length);
  }

  my_bool like_range(const char *s, size_t s_length,
                     pchar w_prefix, pchar w_one, pchar w_many,
                     size_t res_length,
                     char *min_str, char *max_str,
                     size_t *min_len, size_t *max_len) const
  {
    return (coll->like_range)(this, s, s_length,
                              w_prefix, w_one, w_many,
                              res_length, min_str, max_str,
                              min_len, max_len);
  }

  int wildcmp(const char *str,const char *str_end,
              const char *wildstr,const char *wildend,
              int escape,int w_one, int w_many) const
  {
    return (coll->wildcmp)(this, str, str_end, wildstr, wildend, escape, w_one, w_many);
  }

  uint instr(const char *b, size_t b_length,
             const char *s, size_t s_length,
             my_match_t *match, uint nmatch) const
  {
    return (coll->instr)(this, b, b_length, s, s_length, match, nmatch);
  }

  void hash_sort(const uchar *key, size_t len, ulong *nr1, ulong *nr2) const
  {
    (coll->hash_sort)(this, key, len, nr1, nr2);
  }

  my_bool propagate(const uchar *str, size_t len) const
  {
    return (coll->propagate)(this, str, len);
  }

  size_t min_str(uchar *dst, size_t dstlen, size_t nchars) const
  {
    return (coll->min_str)(this, dst, dstlen, nchars);
  }

  size_t max_str(uchar *dst, size_t dstlen, size_t nchars) const
  {
    return (coll->max_str)(this, dst, dstlen, nchars);
  }

#endif /* __cplusplus */
};


/* Character set routines */

static inline my_bool
my_ci_init_charset(struct charset_info_st *ci, MY_CHARSET_LOADER *loader)
{
  if (!ci->cset->init)
    return FALSE;
  return (ci->cset->init)(ci, loader);
}


static inline my_bool
my_ci_use_mb(CHARSET_INFO *ci)
{
  return ci->mbmaxlen > 1 ? TRUE : FALSE;
}

static inline size_t
my_ci_numchars(CHARSET_INFO *cs, const char *b, const char *e)
{
  return (cs->cset->numchars)(cs, b, e);
}

static inline size_t
my_ci_charpos(CHARSET_INFO *cs, const char *b, const char *e, size_t pos)
{
  return (cs->cset->charpos)(cs, b, e, pos);
}

static inline size_t
my_ci_lengthsp(CHARSET_INFO *cs, const char *str, size_t length)
{
  return (cs->cset->lengthsp)(cs, str, length);
}

static inline size_t
my_ci_numcells(CHARSET_INFO *cs, const char *b, const char *e)
{
  return (cs->cset->numcells)(cs, b, e);
}

static inline size_t
my_ci_caseup(CHARSET_INFO *ci,
             const char *src, size_t srclen,
             char *dst, size_t dstlen)
{
  return (ci->cset->caseup)(ci, src, srclen, dst, dstlen);
}

static inline size_t
my_ci_casedn(CHARSET_INFO *ci,
             const char *src, size_t srclen,
             char *dst, size_t dstlen)
{
  return (ci->cset->casedn)(ci, src, srclen, dst, dstlen);
}

static inline size_t
my_ci_long10_to_str(CHARSET_INFO *cs, char *dst, size_t dstlen,
                    int radix, long int val)
{
  return (cs->cset->long10_to_str)(cs, dst, dstlen, radix, val);
}

static inline size_t
my_ci_longlong10_to_str(CHARSET_INFO *cs, char *dst, size_t dstlen,
                        int radix, longlong val)
{
  return (cs->cset->longlong10_to_str)(cs, dst, dstlen, radix, val);
}

#define my_ci_mb_wc(s, pwc, b, e)        ((s)->cset->mb_wc)(s, pwc, b, e)
#define my_ci_wc_mb(s, wc, b, e)         ((s)->cset->wc_mb)(s, wc, b, e)
#define my_ci_native_to_mb(s, wc, b, e)  ((s)->cset->native_to_mb)(s, wc, b, e)
#define my_ci_ctype(s, pctype, b, e)     ((s)->cset->ctype)(s, pctype, b, e)

static inline void
my_ci_fill(CHARSET_INFO *cs, char *to, size_t len, int ch)
{
  (cs->cset->fill)(cs, to, len, ch);
}

static inline long
my_ci_strntol(CHARSET_INFO *cs, const char *str, size_t length,
              int base, char **endptr, int *error)
{
  return (cs->cset->strntol)(cs, str, length, base, endptr, error);
}

static inline ulong
my_ci_strntoul(CHARSET_INFO *cs, const char *str, size_t length,
               int base, char **endptr, int *error)
{
  return (cs->cset->strntoul)(cs, str, length, base, endptr, error);
}

static inline longlong
my_ci_strntoll(CHARSET_INFO *cs, const char *str, size_t length,
               int base, char **endptr, int *error)
{
  return (cs->cset->strntoll)(cs, str, length, base, endptr, error);
}

static inline ulonglong
my_ci_strntoull(CHARSET_INFO *cs, const char *str, size_t length,
                int base, char **endptr, int *error)
{
  return (cs->cset->strntoull)(cs, str, length, base, endptr, error);
}

static inline double
my_ci_strntod(CHARSET_INFO *cs, char *str, size_t length,
              char **endptr, int *error)
{
  return (cs->cset->strntod)(cs, str, length, endptr, error);
}

static inline longlong
my_ci_strtoll10(CHARSET_INFO *cs, const char *str, char **endptr, int *error)
{
  return (cs->cset->strtoll10)(cs, str, endptr, error);
}

static inline ulonglong
my_ci_strntoull10rnd(CHARSET_INFO *cs,
                     const char *str, size_t length, int unsigned_fl,
                     char **endptr, int *error)
{
  return (cs->cset->strntoull10rnd)(cs, str, length, unsigned_fl, endptr, error);
}


static inline size_t
my_ci_scan(CHARSET_INFO *cs, const char *b, const char *e, int seq)
{
  return (cs->cset->scan)(cs, b, e, seq);
}


/**
  Return length of the leftmost character in a string.
  @param cs  - character set
  @param str - the beginning of the string
  @param end - the string end (the next byte after the string)
  @return  <=0 on errors (EOL, wrong byte sequence)
  @return    1 on a single byte character
  @return   >1 on a multi-byte character

  Note, inlike my_ismbchar(), 1 is returned for a single byte character.
*/

static inline int
my_ci_charlen(CHARSET_INFO *cs, const uchar *str, const uchar *end)
{
  return (cs->cset->charlen)(cs, str, end);
}


static inline size_t
my_ci_well_formed_char_length(CHARSET_INFO *cs,
                              const char *str, const char *end,
                              size_t nchars,
                              MY_STRCOPY_STATUS *status)
{
  return (cs->cset->well_formed_char_length)(cs, str, end, nchars, status);
}


static inline size_t
my_ci_copy_fix(CHARSET_INFO *cs,
               char *dst, size_t dst_length,
               const char *src, size_t src_length,
               size_t nchars, MY_STRCOPY_STATUS *status)
{
  return (cs->cset->copy_fix)(cs, dst, dst_length, src, src_length, nchars,
                              status);
}


/* Collation routines */

static inline my_bool
my_ci_init_collation(struct charset_info_st *ci, MY_CHARSET_LOADER *loader)
{
  if (!ci->coll->init)
    return FALSE;
  return (ci->coll->init)(ci, loader);
}


static inline int
my_ci_strnncoll(CHARSET_INFO *ci,
                const uchar *a, size_t alen,
                const uchar *b, size_t blen,
                my_bool b_is_prefix)
{
  return (ci->coll->strnncoll)(ci, a, alen, b, blen, b_is_prefix);
}

static inline int
my_ci_strnncollsp(CHARSET_INFO *ci,
                  const uchar *a, size_t alen,
                  const uchar *b, size_t blen)
{
  return (ci->coll->strnncollsp)(ci, a, alen, b, blen);
}


static inline my_bool
my_ci_like_range(CHARSET_INFO *ci,
                 const char *s, size_t s_length,
                 pchar w_prefix, pchar w_one, pchar w_many,
                 size_t res_length,
                 char *min_str, char *max_str,
                 size_t *min_len, size_t *max_len)
{
  return (ci->coll->like_range)(ci, s, s_length,
                                w_prefix, w_one, w_many,
                                res_length, min_str, max_str,
                                min_len, max_len);
}


static inline uint
my_ci_instr(CHARSET_INFO *ci,
            const char *b, size_t b_length,
            const char *s, size_t s_length,
            my_match_t *match, uint nmatch)
{
  return (ci->coll->instr)(ci, b, b_length, s, s_length, match, nmatch);
}


static inline void
my_ci_hash_sort(CHARSET_INFO *ci,
                const uchar *key, size_t len,
                ulong *nr1, ulong *nr2)
{
  (ci->coll->hash_sort)(ci, key, len, nr1, nr2);
}


#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)

extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1_nopad;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_utf8mb3_general_ci;

extern struct charset_info_st my_charset_big5_bin;
extern struct charset_info_st my_charset_big5_chinese_ci;
extern struct charset_info_st my_charset_big5_nopad_bin;
extern struct charset_info_st my_charset_big5_chinese_nopad_ci;
extern struct charset_info_st my_charset_cp1250_czech_cs;
extern struct charset_info_st my_charset_cp932_bin;
extern struct charset_info_st my_charset_cp932_japanese_ci;
extern struct charset_info_st my_charset_cp932_nopad_bin;
extern struct charset_info_st my_charset_cp932_japanese_nopad_ci;
extern struct charset_info_st my_charset_eucjpms_bin;
extern struct charset_info_st my_charset_eucjpms_japanese_ci;
extern struct charset_info_st my_charset_eucjpms_nopad_bin;
extern struct charset_info_st my_charset_eucjpms_japanese_nopad_ci;
extern struct charset_info_st my_charset_euckr_bin;
extern struct charset_info_st my_charset_euckr_korean_ci;
extern struct charset_info_st my_charset_euckr_nopad_bin;
extern struct charset_info_st my_charset_euckr_korean_nopad_ci;
extern struct charset_info_st my_charset_gb2312_bin;
extern struct charset_info_st my_charset_gb2312_chinese_ci;
extern struct charset_info_st my_charset_gb2312_nopad_bin;
extern struct charset_info_st my_charset_gb2312_chinese_nopad_ci;
extern struct charset_info_st my_charset_gbk_bin;
extern struct charset_info_st my_charset_gbk_chinese_ci;
extern struct charset_info_st my_charset_gbk_nopad_bin;
extern struct charset_info_st my_charset_gbk_chinese_nopad_ci;
extern struct charset_info_st my_charset_latin1_bin;
extern struct charset_info_st my_charset_latin1_nopad_bin;
extern struct charset_info_st my_charset_latin1_german2_ci;
extern struct charset_info_st my_charset_latin2_czech_cs;
extern struct charset_info_st my_charset_sjis_bin;
extern struct charset_info_st my_charset_sjis_japanese_ci;
extern struct charset_info_st my_charset_sjis_nopad_bin;
extern struct charset_info_st my_charset_sjis_japanese_nopad_ci;
extern struct charset_info_st my_charset_tis620_bin;
extern struct charset_info_st my_charset_tis620_thai_ci;
extern struct charset_info_st my_charset_tis620_nopad_bin;
extern struct charset_info_st my_charset_tis620_thai_nopad_ci;
extern struct charset_info_st my_charset_ucs2_bin;
extern struct charset_info_st my_charset_ucs2_general_ci;
extern struct charset_info_st my_charset_ucs2_nopad_bin;
extern struct charset_info_st my_charset_ucs2_general_nopad_ci;
extern struct charset_info_st my_charset_ucs2_general_mysql500_ci;
extern struct charset_info_st my_charset_ucs2_unicode_ci;
extern struct charset_info_st my_charset_ucs2_unicode_nopad_ci;
extern struct charset_info_st my_charset_ucs2_general_mysql500_ci;
extern struct charset_info_st my_charset_ujis_bin;
extern struct charset_info_st my_charset_ujis_japanese_ci;
extern struct charset_info_st my_charset_ujis_nopad_bin;
extern struct charset_info_st my_charset_ujis_japanese_nopad_ci;
extern struct charset_info_st my_charset_utf16_bin;
extern struct charset_info_st my_charset_utf16_general_ci;
extern struct charset_info_st my_charset_utf16_unicode_ci;
extern struct charset_info_st my_charset_utf16_unicode_nopad_ci;
extern struct charset_info_st my_charset_utf16le_bin;
extern struct charset_info_st my_charset_utf16le_general_ci;
extern struct charset_info_st my_charset_utf16_general_nopad_ci;
extern struct charset_info_st my_charset_utf16_nopad_bin;
extern struct charset_info_st my_charset_utf16le_nopad_bin;
extern struct charset_info_st my_charset_utf16le_general_nopad_ci;
extern struct charset_info_st my_charset_utf32_bin;
extern struct charset_info_st my_charset_utf32_general_ci;
extern struct charset_info_st my_charset_utf32_unicode_ci;
extern struct charset_info_st my_charset_utf32_unicode_nopad_ci;
extern struct charset_info_st my_charset_utf32_nopad_bin;
extern struct charset_info_st my_charset_utf32_general_nopad_ci;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_utf8mb3_bin;
extern struct charset_info_st my_charset_utf8mb3_nopad_bin;
extern struct charset_info_st my_charset_utf8mb3_general_nopad_ci;
extern struct charset_info_st my_charset_utf8mb3_general_mysql500_ci;
extern struct charset_info_st my_charset_utf8mb3_unicode_ci;
extern struct charset_info_st my_charset_utf8mb3_unicode_nopad_ci;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_utf8mb4_bin;
extern struct charset_info_st my_charset_utf8mb4_general_ci;
extern struct charset_info_st my_charset_utf8mb4_nopad_bin;
extern struct charset_info_st my_charset_utf8mb4_general_nopad_ci;
extern struct charset_info_st my_charset_utf8mb4_unicode_ci;
extern struct charset_info_st my_charset_utf8mb4_unicode_nopad_ci;

#define MY_UTF8MB3                 "utf8mb3"
#define MY_UTF8MB4                 "utf8mb4"

my_bool my_cs_have_contractions(CHARSET_INFO *cs);
my_bool my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc);
my_bool my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc);
const uint16 *my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1,
                                         my_wc_t wc2);

/* declarations for simple charsets */
extern size_t my_strnxfrm_simple(CHARSET_INFO *,
                                 uchar *dst, size_t dstlen, uint nweights,
                                 const uchar *src, size_t srclen, uint flags); 
size_t  my_strnxfrmlen_simple(CHARSET_INFO *, size_t); 
extern int  my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t,
				const uchar *, size_t, my_bool);

extern int  my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
                                  const uchar *, size_t);

extern void my_hash_sort_simple(CHARSET_INFO *cs,
				const uchar *key, size_t len,
				ulong *nr1, ulong *nr2); 

extern void my_hash_sort_simple_nopad(CHARSET_INFO *cs,
				      const uchar *key, size_t len,
				      ulong *nr1, ulong *nr2);

extern void my_hash_sort_bin(CHARSET_INFO *cs,
                             const uchar *key, size_t len, ulong *nr1,
                             ulong *nr2);

/**
  Compare a string to an array of spaces, for PAD SPACE comparison.
  The function iterates through the string and compares every byte to 0x20.
  @param       - the string
  @param       - its length
  @return <0   - if a byte less than 0x20 was found in the string.
  @return  0   - if all bytes in the string were 0x20, or if length was 0.
  @return >0   - if a byte greater than 0x20 was found in the string.
*/
extern int my_strnncollsp_padspace_bin(const uchar *str, size_t length);

extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);

extern uint my_instr_simple(CHARSET_INFO *,
                            const char *b, size_t b_length,
                            const char *s, size_t s_length,
                            my_match_t *match, uint nmatch);

size_t my_copy_8bit(CHARSET_INFO *,
                    char *dst, size_t dst_length,
                    const char *src, size_t src_length,
                    size_t nchars, MY_STRCOPY_STATUS *);
size_t my_copy_fix_mb(CHARSET_INFO *cs,
                      char *dst, size_t dst_length,
                      const char *src, size_t src_length,
                      size_t nchars, MY_STRCOPY_STATUS *);

/* Functions for 8bit */
extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
extern size_t my_caseup_8bit(CHARSET_INFO *,
                             const char *src, size_t srclen,
                             char *dst, size_t dstlen);
extern size_t my_casedn_8bit(CHARSET_INFO *,
                             const char *src, size_t srclen,
                             char *dst, size_t dstlen);

extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);

int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_wc_mb_bin(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);

int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);

size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);

size_t my_snprintf_8bit(CHARSET_INFO *, char *to, size_t n,
                        const char *fmt, ...)
  ATTRIBUTE_FORMAT(printf, 4, 5);

long       my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
                           char **e, int *err);
ulong      my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
			    char **e, int *err);
longlong   my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
			    char **e, int *err);
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
			    char **e, int *err);
double      my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e,
			    int *err);
size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
                             long int val);
size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
                                 longlong val);

longlong my_strtoll10_8bit(CHARSET_INFO *cs,
                           const char *nptr, char **endptr, int *error);
longlong my_strtoll10_ucs2(CHARSET_INFO *cs, 
                           const char *nptr, char **endptr, int *error);

ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs,
                                 const char *str, size_t length, int
                                 unsigned_fl, char **endptr, int *error);
ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, 
                                 const char *str, size_t length,
                                 int unsigned_fl, char **endptr, int *error);

void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill);

/* For 8-bit character set */
my_bool  my_like_range_simple(CHARSET_INFO *cs,
			      const char *ptr, size_t ptr_length,
			      pbool escape, pbool w_one, pbool w_many,
			      size_t res_length,
			      char *min_str, char *max_str,
			      size_t *min_length, size_t *max_length);

/* For ASCII-based multi-byte character sets with mbminlen=1 */
my_bool  my_like_range_mb(CHARSET_INFO *cs,
			  const char *ptr, size_t ptr_length,
			  pbool escape, pbool w_one, pbool w_many,
			  size_t res_length,
			  char *min_str, char *max_str,
			  size_t *min_length, size_t *max_length);

/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
my_bool  my_like_range_generic(CHARSET_INFO *cs,
                               const char *ptr, size_t ptr_length,
                               pbool escape, pbool w_one, pbool w_many,
                               size_t res_length,
                               char *min_str, char *max_str,
                               size_t *min_length, size_t *max_length);

int my_wildcmp_8bit(CHARSET_INFO *,
		    const char *str,const char *str_end,
		    const char *wildstr,const char *wildend,
		    int escape, int w_one, int w_many);

int my_wildcmp_bin(CHARSET_INFO *,
		   const char *str,const char *str_end,
		   const char *wildstr,const char *wildend,
		   int escape, int w_one, int w_many);

size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos);
size_t my_well_formed_char_length_8bit(CHARSET_INFO *cs,
                                       const char *b, const char *e,
                                       size_t nchars,
                                       MY_STRCOPY_STATUS *status);
int my_charlen_8bit(CHARSET_INFO *, const uchar *str, const uchar *end);


/* Functions for multibyte charsets */
extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
extern size_t my_caseup_mb(CHARSET_INFO *,
                           const char *src, size_t srclen,
                           char *dst, size_t dstlen);
extern size_t my_casedn_mb(CHARSET_INFO *,
                           const char *src, size_t srclen,
                           char *dst, size_t dstlen);
extern size_t my_caseup_ujis(CHARSET_INFO *,
                             const char *src, size_t srclen,
                             char *dst, size_t dstlen);
extern size_t my_casedn_ujis(CHARSET_INFO *,
                             const char *src, size_t srclen,
                             char *dst, size_t dstlen);
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);

int my_wildcmp_mb(CHARSET_INFO *,
		  const char *str,const char *str_end,
		  const char *wildstr,const char *wildend,
		  int escape, int w_one, int w_many);
size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos);
uint my_instr_mb(CHARSET_INFO *,
                 const char *b, size_t b_length,
                 const char *s, size_t s_length,
                 my_match_t *match, uint nmatch);

int my_wildcmp_mb_bin(CHARSET_INFO *cs,
                      const char *str,const char *str_end,
                      const char *wildstr,const char *wildend,
                      int escape, int w_one, int w_many);

int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
                         const char *s, const char *t);

void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
                         const uchar *key, size_t len,ulong *nr1, ulong *nr2);

void my_hash_sort_mb_nopad_bin(CHARSET_INFO *cs __attribute__((unused)),
                               const uchar *key, size_t len,
                               ulong *nr1, ulong *nr2);

size_t my_strnxfrm_mb(CHARSET_INFO *,
                      uchar *dst, size_t dstlen, uint nweights,
                      const uchar *src, size_t srclen, uint flags);

size_t my_strnxfrm_mb_nopad(CHARSET_INFO *,
			    uchar *dst, size_t dstlen, uint nweights,
			    const uchar *src, size_t srclen, uint flags);

size_t  my_strnxfrmlen_unicode(CHARSET_INFO *, size_t); 

size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *,
                                    uchar *dst, size_t dstlen,
                                    uint nweights, const uchar *src,
                                    size_t srclen, uint flags);

size_t my_strnxfrm_unicode_full_nopad_bin(CHARSET_INFO *,
					  uchar *dst, size_t dstlen,
					  uint nweights, const uchar *src,
					  size_t srclen, uint flags);

size_t  my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t); 

int my_wildcmp_unicode(CHARSET_INFO *cs,
                       const char *str, const char *str_end,
                       const char *wildstr, const char *wildend,
                       int escape, int w_one, int w_many,
                       MY_UNICASE_INFO *weights);

extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader,
                                    const char *buf, size_t buflen);
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
                       pchar c);
extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end,
                         const char *accept);

my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);


typedef struct 
{
  size_t char_length;
  my_repertoire_t repertoire;
} MY_STRING_METADATA;

void my_string_metadata_get(MY_STRING_METADATA *metadata,
                            CHARSET_INFO *cs, const char *str, size_t len);
my_repertoire_t my_string_repertoire(CHARSET_INFO *cs,
                                     const char *str, size_t len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_repertoire_t my_charset_repertoire(CHARSET_INFO *cs);

uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
                                 uint flags, uint level);
size_t my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs,
                                       uchar *str, uchar *frmend, uchar *strend,
                                       uint nweights, uint flags, uint level);
size_t my_strxfrm_pad_desc_and_reverse_nopad(CHARSET_INFO *cs,
					     uchar *str, uchar *frmend,
					     uchar *strend, uint nweights,
					     uint flags, uint level);

const MY_CONTRACTIONS *my_charset_get_contractions(CHARSET_INFO *cs,
                                                   int level);

extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
                              const char* fmt, va_list ap);

/*
  Convert a string between two character sets.
  Bad byte sequences as well as characters that cannot be
  encoded in the destination character set are replaced to '?'.
*/
uint32 my_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
                  const char *from, uint32 from_length,
                  CHARSET_INFO *from_cs, uint *errors);

/**
  An extended version of my_convert(), to pass non-default mb_wc() and wc_mb().
  For example, String::copy_printable() which is used in
  Protocol::store_warning() uses this to escape control
  and non-convertible characters.
*/
uint32 my_convert_using_func(char *to, size_t to_length, CHARSET_INFO *to_cs,
                             my_charset_conv_wc_mb mb_wc,
                             const char *from, size_t from_length,
                             CHARSET_INFO *from_cs,
                             my_charset_conv_mb_wc wc_mb,
                             uint *errors);
/*
  Convert a string between two character sets.
  Bad byte sequences as well as characters that cannot be
  encoded in the destination character set are replaced to '?'.
  Not more than "nchars" characters are copied.
  Conversion statistics is returned in "status" and is set as follows:
  - status->m_native_copy_status.m_source_end_pos - to the position
    between (src) and (src+src_length), where the function stopped reading
    the source string.
  - status->m_native_copy_status.m_well_formed_error_pos - to the position
    between (src) and (src+src_length), where the first badly formed byte
    sequence was found, or to NULL if the string was well formed in the
    given range.
  - status->m_cannot_convert_error_pos - to the position 
    between (src) and (src+src_length), where the first character that
    cannot be represented in the destination character set was found,
    or to NULL if all characters in the given range were successfully
    converted.

  "src" is allowed to be a NULL pointer. In this case "src_length" must
  be equal to 0. All "status" members are initialized to NULL, and 0 is
  returned.
*/
size_t my_convert_fix(CHARSET_INFO *dstcs, char *dst, size_t dst_length,
                      CHARSET_INFO *srccs, const char *src, size_t src_length,
                      size_t nchars,
                      MY_STRCOPY_STATUS *copy_status,
                      MY_STRCONV_STATUS *conv_status);

#define	_MY_U	01	/* Upper case */
#define	_MY_L	02	/* Lower case */
#define	_MY_NMR	04	/* Numeral (digit) */
#define	_MY_SPC	010	/* Spacing character */
#define	_MY_PNT	020	/* Punctuation */
#define	_MY_CTR	040	/* Control character */
#define	_MY_B	0100	/* Blank */
#define	_MY_X	0200	/* heXadecimal digit */


#define	my_isascii(c)	(!((c) & ~0177))
#define	my_toascii(c)	((c) & 0177)
#define my_tocntrl(c)	((c) & 31)
#define my_toprint(c)	((c) | 64)
#define my_toupper(s,c)	(char) ((s)->to_upper[(uchar) (c)])
#define my_tolower(s,c)	(char) ((s)->to_lower[(uchar) (c)])
#define	my_isalpha(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
#define	my_isupper(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & _MY_U)
#define	my_islower(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & _MY_L)
#define	my_isdigit(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & _MY_NMR)
#define	my_isxdigit(s, c) (((s)->m_ctype+1)[(uchar) (c)] & _MY_X)
#define	my_isalnum(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
#define	my_isspace(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & _MY_SPC)
#define	my_ispunct(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & _MY_PNT)
#define	my_isprint(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
#define	my_isgraph(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
#define	my_iscntrl(s, c)  (((s)->m_ctype+1)[(uchar) (c)] & _MY_CTR)

/* Some macros that should be cleaned up a little */
#define my_isvar(s,c)                 (my_isalnum(s,c) || (c) == '_')
#define my_isvar_start(s,c)           (my_isalpha(s,c) || (c) == '_')

#define my_binary_compare(s)	      ((s)->state  & MY_CS_BINSORT)
#define use_strnxfrm(s)               ((s)->state  & MY_CS_STRNXFRM)
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
#define my_strcasecmp(s, a, b)        ((s)->coll->strcasecmp((s), (a), (b)))

/**
  Detect if the leftmost character in a string is a valid multi-byte character
  and return its length, or return 0 otherwise.
  @param cs  - character set
  @param str - the beginning of the string
  @param end - the string end (the next byte after the string)
  @return    >0, for a multi-byte character
  @return    0,  for a single byte character, broken sequence, empty string.
*/
static inline
uint my_ismbchar(CHARSET_INFO *cs, const char *str, const char *end)
{
  int char_length= (cs->cset->charlen)(cs, (const uchar *) str,
                                           (const uchar *) end);
  return char_length > 1 ? (uint) char_length : 0U;
}


/**
  Convert broken and incomplete byte sequences to 1 byte.
*/
static inline
uint my_ci_charlen_fix(CHARSET_INFO *cs, const uchar *str, const uchar *end)
{
  int char_length= my_ci_charlen(cs, str, end);
  DBUG_ASSERT(str < end);
  return char_length > 0 ? (uint) char_length : (uint) 1U;
}


/*
  A compatibility replacement pure C function for the former
    cs->cset->well_formed_len().
  In C++ code please use Well_formed_prefix::length() instead.
*/
static inline size_t
my_well_formed_length(CHARSET_INFO *cs, const char *b, const char *e,
                      size_t nchars, int *error)
{
  MY_STRCOPY_STATUS status;
  (void) my_ci_well_formed_char_length(cs, b, e, nchars, &status);
  *error= status.m_well_formed_error_pos == NULL ? 0 : 1;
  return (size_t) (status.m_source_end_pos - b);
}


#define my_caseup_str(s, a)           ((s)->cset->caseup_str((s), (a)))
#define my_casedn_str(s, a)           ((s)->cset->casedn_str((s), (a)))

/* XXX: still need to take care of this one */
#ifdef MY_CHARSET_TIS620
#error The TIS620 charset is broken at the moment.  Tell tim to fix it.
#define USE_TIS620
#include "t_ctype.h"
#endif

int my_wc_mb_utf8mb4_bmp_only(CHARSET_INFO *cs, my_wc_t wc, uchar *r,
                              uchar *e);

#ifdef	__cplusplus
}
#endif

#endif /* _m_ctype_h */
server/my_valgrind.h000064400000010700150400263670010537 0ustar00/* Copyright (C) 2010, 2022, 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MY_VALGRIND_INCLUDED
#define MY_VALGRIND_INCLUDED

/* clang -> gcc */
#ifndef __has_feature
# define __has_feature(x) 0
#endif
#if __has_feature(address_sanitizer)
# define __SANITIZE_ADDRESS__ 1
#endif

#if __has_feature(memory_sanitizer)
# include <sanitizer/msan_interface.h>
# define HAVE_valgrind
# define HAVE_MEM_CHECK
# define MEM_UNDEFINED(a,len) __msan_allocated_memory(a,len)
# define MEM_MAKE_ADDRESSABLE(a,len) MEM_UNDEFINED(a,len)
# define MEM_MAKE_DEFINED(a,len) __msan_unpoison(a,len)
# define MEM_NOACCESS(a,len) ((void) 0)
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
# define MEM_CHECK_DEFINED(a,len) __msan_check_mem_is_initialized(a,len)
# define MEM_GET_VBITS(a,b,len) __msan_copy_shadow(b,a,len)
# define MEM_SET_VBITS(a,b,len) __msan_copy_shadow(a,b,len)
# define REDZONE_SIZE 8
# ifdef __linux__
#  define MSAN_STAT_WORKAROUND(st) MEM_MAKE_DEFINED(st, sizeof(*st))
# else
#  define MSAN_STAT_WORKAROUND(st) ((void) 0)
# endif
#elif defined(HAVE_VALGRIND_MEMCHECK_H) && defined(HAVE_valgrind)
# include <valgrind/memcheck.h>
# define HAVE_MEM_CHECK
# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
# define MEM_MAKE_ADDRESSABLE(a,len) MEM_UNDEFINED(a,len)
# define MEM_MAKE_DEFINED(a,len) VALGRIND_MAKE_MEM_DEFINED(a,len)
# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
# define MEM_GET_VBITS(a,b,len) VALGRIND_GET_VBITS(a,b,len)
# define MEM_SET_VBITS(a,b,len) VALGRIND_SET_VBITS(a,b,len)
# define REDZONE_SIZE 8
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
#elif defined(__SANITIZE_ADDRESS__) && (!defined(_MSC_VER) || defined (__clang__))
# include <sanitizer/asan_interface.h>
/* How to do manual poisoning:
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
# define MEM_UNDEFINED(a,len) ((void) 0)
# define MEM_MAKE_ADDRESSABLE(a,len) ASAN_UNPOISON_MEMORY_REGION(a,len)
# define MEM_MAKE_DEFINED(a,len) ((void) 0)
# define MEM_NOACCESS(a,len) ASAN_POISON_MEMORY_REGION(a,len)
# define MEM_CHECK_ADDRESSABLE(a,len) \
  assert(!__asan_region_is_poisoned((void*) a,len))
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
# define MEM_GET_VBITS(a,b,len) ((void) 0)
# define MEM_SET_VBITS(a,b,len) ((void) 0)
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
# define REDZONE_SIZE 8
#else
# define MEM_UNDEFINED(a,len) ((void) 0)
# define MEM_MAKE_ADDRESSABLE(a,len) ((void) 0)
# define MEM_MAKE_DEFINED(a,len) ((void) 0)
# define MEM_NOACCESS(a,len) ((void) 0)
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
# define MEM_GET_VBITS(a,b,len) ((void) 0)
# define MEM_SET_VBITS(a,b,len) ((void) 0)
# define REDZONE_SIZE 0
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
#endif /* __has_feature(memory_sanitizer) */

#ifdef TRASH_FREED_MEMORY
/*
  _TRASH_FILL() has to call MEM_MAKE_ADDRESSABLE() to cancel any effect of
  TRASH_FREE().
  This can happen in the case one does
  TRASH_ALLOC(A,B) ; TRASH_FREE(A,B) ; TRASH_ALLOC(A,B)
  to reuse the same memory in an internal memory allocator like MEM_ROOT.
  _TRASH_FILL() is an internal function and should not be used externally.
*/
#define _TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_MAKE_ADDRESSABLE(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
#else
#define _TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
#endif
/** Note that some memory became allocated and/or uninitialized. */
#define TRASH_ALLOC(A,B) do { _TRASH_FILL(A,B,0xA5); MEM_MAKE_ADDRESSABLE(A,B); } while(0)
/** Note that some memory became freed. (Prohibit further access to it.) */
#define TRASH_FREE(A,B) do { _TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)

#endif /* MY_VALGRIND_INCLUDED */
server/my_list.h000064400000002742150400263670007713 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _list_h_
#define _list_h_

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct st_list {
  struct st_list *prev,*next;
  void *data;
} LIST;

typedef int (*list_walk_action)(void *,void *);

extern LIST *list_add(LIST *root,LIST *element);
extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);

#define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); }

#ifdef	__cplusplus
}
#endif
#endif
server/my_pthread.h000064400000065171150400263670010374 0ustar00/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/* Defines to make different thread packages compatible */

#ifndef _my_pthread_h
#define _my_pthread_h

#ifndef ETIME
#define ETIME ETIMEDOUT				/* For FreeBSD */
#endif

#ifdef  __cplusplus
#define EXTERNC extern "C"
extern "C" {
#else
#define EXTERNC
#endif /* __cplusplus */ 

#if defined(_WIN32)
typedef CRITICAL_SECTION pthread_mutex_t;
typedef DWORD		 pthread_t;
typedef struct thread_attr {
    DWORD dwStackSize ;
    DWORD dwCreatingFlag ;
} pthread_attr_t ;

typedef struct { int dummy; } pthread_condattr_t;

/* Implementation of posix conditions */

typedef struct st_pthread_link {
  DWORD thread_id;
  struct st_pthread_link *next;
} pthread_link;

/**
  Implementation of Windows condition variables.
  We use native conditions on Vista and later, and fallback to own 
  implementation on earlier OS version.
*/
typedef  CONDITION_VARIABLE pthread_cond_t;


typedef int pthread_mutexattr_t;
#define pthread_self() GetCurrentThreadId()
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);

typedef INIT_ONCE my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT;

#if !STRUCT_TIMESPEC_HAS_TV_SEC  || !STRUCT_TIMESPEC_HAS_TV_NSEC
struct timespec {
  time_t tv_sec;
  long tv_nsec;
};
#endif

int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
			   const struct timespec *abstime);
int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);
int pthread_cond_destroy(pthread_cond_t *cond);
int pthread_attr_init(pthread_attr_t *connect_att);
int pthread_attr_setstacksize(pthread_attr_t *connect_att,size_t stack);
int pthread_attr_destroy(pthread_attr_t *connect_att);
int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void));

static inline struct tm *localtime_r(const time_t *timep, struct tm *tmp)
{
  localtime_s(tmp, timep);
  return tmp;
}

static inline struct tm *gmtime_r(const time_t *clock, struct tm *res)
{
  gmtime_s(res, clock);
  return res;
}

void pthread_exit(void *a);
int pthread_join(pthread_t thread, void **value_ptr);
int pthread_cancel(pthread_t thread);

#ifndef ETIMEDOUT
#define ETIMEDOUT 145		    /* Win32 doesn't have this */
#endif

#define HAVE_LOCALTIME_R		1
#define _REENTRANT			1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE	1

#undef SAFE_MUTEX				/* This will cause conflicts */
#define pthread_key(T,V)  DWORD V
#define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF)
#define pthread_key_delete(A) TlsFree(A)
#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V)))
#define pthread_setspecific(A,B) (!TlsSetValue((A),(LPVOID)(B)))
#define pthread_getspecific(A) (TlsGetValue(A))
#define my_pthread_getspecific(T,A) ((T) TlsGetValue(A))
#define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V))

#define pthread_equal(A,B) ((A) == (B))
#define pthread_mutex_init(A,B)  (InitializeCriticalSection(A),0)
#define pthread_mutex_lock(A)	 (EnterCriticalSection(A),0)
#define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A))
#define pthread_mutex_unlock(A)  (LeaveCriticalSection(A), 0)
#define pthread_mutex_destroy(A) (DeleteCriticalSection(A), 0)
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)


/* Dummy defines for easier code */
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_attr_setscope(A,B)
#define pthread_detach_this_thread()
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
#define pthread_yield() SwitchToThread()
#define my_sigset(A,B) signal(A,B)

#else /* Normal threads */

#ifdef HAVE_rts_threads
#define sigwait org_sigwait
#include <signal.h>
#undef sigwait
#endif
#include <pthread.h>
#ifndef _REENTRANT
#define _REENTRANT
#endif
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
#ifdef HAVE_SYNCH_H
#include <synch.h>
#endif

#define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread()
#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);

#define my_pthread_once_t pthread_once_t
#if defined(PTHREAD_ONCE_INITIALIZER)
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER
#else
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
#endif
#define my_pthread_once(C,F) pthread_once(C,F)

/* Test first for RTS or FSU threads */

#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
#define HAVE_rts_threads
extern int my_pthread_create_detached;
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define PTHREAD_CREATE_DETACHED &my_pthread_create_detached
#define PTHREAD_SCOPE_SYSTEM  PTHREAD_SCOPE_GLOBAL
#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL
#define USE_ALARM_THREAD
#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */

#if defined(_BSDI_VERSION) && _BSDI_VERSION < 199910
int sigwait(sigset_t *set, int *sig);
#endif

static inline int my_sigwait(sigset_t *set, int *sig, int *code)
{
#ifdef HAVE_SIGWAITINFO
  siginfo_t siginfo;
  *sig= sigwaitinfo(set, &siginfo);
  *code= siginfo.si_code;
  return *sig < 0 ?  errno : 0;
#else
  *code= 0;
  return sigwait(set, sig);
#endif
}

#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK)
#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C))
#endif

#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp);		/* Use our implementation */
#endif


/*
  We define my_sigset() and use that instead of the system sigset() so that
  we can favor an implementation based on sigaction(). On some systems, such
  as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
  we want to make sure that no such flags are set.
*/
#if defined(HAVE_SIGACTION) && !defined(my_sigset)
#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set;           \
                            DBUG_ASSERT((A) != 0);                          \
                            sigemptyset(&l_set);                            \
                            l_s.sa_handler = (B);                           \
                            l_s.sa_mask   = l_set;                          \
                            l_s.sa_flags   = 0;                             \
                            sigaction((A), &l_s, NULL);                     \
                          } while (0)
#elif defined(HAVE_SIGSET) && !defined(my_sigset)
#define my_sigset(A,B) sigset((A),(B))
#elif !defined(my_sigset)
#define my_sigset(A,B) signal((A),(B))
#endif

#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE)
#define pthread_attr_setscope(A,B)
#undef	HAVE_GETHOSTBYADDR_R			/* No definition */
#endif

#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))

#ifndef HAVE_LOCALTIME_R
struct tm *localtime_r(const time_t *clock, struct tm *res);
#endif

#ifndef HAVE_GMTIME_R
struct tm *gmtime_r(const time_t *clock, struct tm *res);
#endif

#ifdef HAVE_PTHREAD_CONDATTR_CREATE
/* DCE threads on HPUX 10.20 */
#define pthread_condattr_init pthread_condattr_create
#define pthread_condattr_destroy pthread_condattr_delete
#endif

/* FSU THREADS */
#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete)
#define pthread_key_delete(A) pthread_dummy(0)
#endif

#if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)
/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
#define pthread_key_create(A,B) \
		pthread_keycreate(A,(B) ?\
				  (pthread_destructor_t) (B) :\
				  (pthread_destructor_t) pthread_dummy)
#define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef	pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL 1
#endif

#endif /* defined(_WIN32) */

#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_cond_timedwait
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
			      struct timespec *abstime);
#endif

#if defined(HPUX10)
#define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B)
void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
#endif

#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_mutex_trylock
#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a))
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif

#ifdef HAVE_SCHED_YIELD
#define pthread_yield() sched_yield()
#else
#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
/* no pthread_yield() available */
#if defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */
#define pthread_yield() pthread_yield_np()
#elif defined(HAVE_THR_YIELD)
#define pthread_yield() thr_yield()
#endif //defined(HAVE_PTHREAD_YIELD_NP)
#endif //!defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
#endif //HAVE_SCHED_YIELD

size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize);

/*
  The defines set_timespec and set_timespec_nsec should be used
  for calculating an absolute time at which
  pthread_cond_timedwait should timeout
*/
#define set_timespec(ABSTIME,SEC) set_timespec_nsec((ABSTIME),(SEC)*1000000000ULL)

#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC)                                 \
  set_timespec_time_nsec((ABSTIME), my_hrtime_coarse().val*1000 + (NSEC))
#endif /* !set_timespec_nsec */

/* adapt for two different flavors of struct timespec */
#ifdef HAVE_TIMESPEC_TS_SEC
#define MY_tv_sec  ts_sec
#define MY_tv_nsec ts_nsec
#else
#define MY_tv_sec  tv_sec
#define MY_tv_nsec tv_nsec
#endif /* HAVE_TIMESPEC_TS_SEC */

/**
   Compare two timespec structs.

   @retval  1 If TS1 ends after TS2.

   @retval  0 If TS1 is equal to TS2.

   @retval -1 If TS1 ends before TS2.
*/
#ifndef cmp_timespec
#define cmp_timespec(TS1, TS2) \
  ((TS1.MY_tv_sec > TS2.MY_tv_sec || \
    (TS1.MY_tv_sec == TS2.MY_tv_sec && TS1.MY_tv_nsec > TS2.MY_tv_nsec)) ? 1 : \
   ((TS1.MY_tv_sec < TS2.MY_tv_sec || \
     (TS1.MY_tv_sec == TS2.MY_tv_sec && TS1.MY_tv_nsec < TS2.MY_tv_nsec)) ? -1 : 0))
#endif /* !cmp_timespec */

#ifndef set_timespec_time_nsec
#define set_timespec_time_nsec(ABSTIME,NSEC) do {		\
  ulonglong _now_= (NSEC);					\
  (ABSTIME).MY_tv_sec=  (time_t) (_now_ / 1000000000ULL);	\
  (ABSTIME).MY_tv_nsec= (ulong) (_now_ % 1000000000UL);		\
} while(0)
#endif /* !set_timespec_time_nsec */

#ifdef MYSQL_CLIENT
#define _current_thd() NULL
#else
MYSQL_THD _current_thd();
#endif

/* safe_mutex adds checking to mutex for easier debugging */
struct st_hash;
typedef struct st_safe_mutex_t
{
  pthread_mutex_t global,mutex;
  const char *file, *name;
  uint line,count;
  myf create_flags, active_flags;
  ulong id;
  pthread_t thread;
  struct st_hash *locked_mutex, *used_mutex;
  struct st_safe_mutex_t *prev, *next;
#ifdef SAFE_MUTEX_DETECT_DESTROY
  struct st_safe_mutex_info_t *info;	/* to track destroying of mutexes */
#endif
} safe_mutex_t;

typedef struct st_safe_mutex_deadlock_t
{
  const char *file, *name;
  safe_mutex_t *mutex;
  uint line;
  ulong count;
  ulong id;
  my_bool warning_only;
} safe_mutex_deadlock_t;

#ifdef SAFE_MUTEX_DETECT_DESTROY
/*
  Used to track the destroying of mutexes. This needs to be a separate
  structure because the safe_mutex_t structure could be freed before
  the mutexes are destroyed.
*/

typedef struct st_safe_mutex_info_t
{
  struct st_safe_mutex_info_t *next;
  struct st_safe_mutex_info_t *prev;
  const char *init_file;
  uint32 init_line;
} safe_mutex_info_t;
#endif /* SAFE_MUTEX_DETECT_DESTROY */

int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
                    const char *name, const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
                    uint line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
		   uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
                        const struct timespec *abstime,
                        const char *file, uint line);
void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file);
void safe_mutex_free_deadlock_data(safe_mutex_t *mp);

	/* Wrappers if safe mutex is actually used */
#define MYF_TRY_LOCK              1
#define MYF_NO_DEADLOCK_DETECTION 2

#ifdef SAFE_MUTEX
#define safe_mutex_is_owner(mp) ((mp)->count > 0 && \
                                 pthread_equal(pthread_self(), (mp)->thread))
#define safe_mutex_assert_owner(mp) DBUG_ASSERT(safe_mutex_is_owner(mp))
#define safe_mutex_assert_not_owner(mp) DBUG_ASSERT(!safe_mutex_is_owner(mp))
#define safe_mutex_setflags(mp, F)      do { (mp)->create_flags|= (F); } while (0)
#define my_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
#define my_cond_wait(A,B) safe_cond_wait((A), (B), __FILE__, __LINE__)
#else

#define safe_mutex_is_owner(mp) (1)
#define safe_mutex_assert_owner(mp) do {} while (0)
#define safe_mutex_assert_not_owner(mp) do {} while (0)
#define safe_mutex_setflags(mp, F) do {} while (0)

#define my_cond_timedwait(A,B,C) pthread_cond_timedwait((A),(B),(C))
#define my_cond_wait(A,B) pthread_cond_wait((A), (B))
#endif /* !SAFE_MUTEX */

	/* READ-WRITE thread locking */

#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
/* use these defs for simple mutex locking */
#define rw_lock_t pthread_mutex_t
#define my_rwlock_init(A,B) pthread_mutex_init((A),(B))
#define rw_rdlock(A) pthread_mutex_lock((A))
#define rw_wrlock(A) pthread_mutex_lock((A))
#define rw_tryrdlock(A) pthread_mutex_trylock((A))
#define rw_trywrlock(A) pthread_mutex_trylock((A))
#define rw_unlock(A) pthread_mutex_unlock((A))
#define rwlock_destroy(A) pthread_mutex_destroy((A))
#elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK)
#define rw_lock_t pthread_rwlock_t
#define my_rwlock_init(A,B) pthread_rwlock_init((A),(B))
#define rw_rdlock(A) pthread_rwlock_rdlock(A)
#define rw_wrlock(A) pthread_rwlock_wrlock(A)
#define rw_tryrdlock(A) pthread_rwlock_tryrdlock((A))
#define rw_trywrlock(A) pthread_rwlock_trywrlock((A))
#define rw_unlock(A) pthread_rwlock_unlock(A)
#define rwlock_destroy(A) pthread_rwlock_destroy(A)
#elif defined(HAVE_RWLOCK_INIT)
#ifdef HAVE_RWLOCK_T				/* For example Solaris 2.6-> */
#define rw_lock_t rwlock_t
#endif
#define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0)
#else
/* Use our own version of read/write locks */
#define NEED_MY_RW_LOCK 1
#define rw_lock_t my_rw_lock_t
#define my_rwlock_init(A,B) my_rw_init((A))
#define rw_rdlock(A) my_rw_rdlock((A))
#define rw_wrlock(A) my_rw_wrlock((A))
#define rw_tryrdlock(A) my_rw_tryrdlock((A))
#define rw_trywrlock(A) my_rw_trywrlock((A))
#define rw_unlock(A) my_rw_unlock((A))
#define rwlock_destroy(A) my_rw_destroy((A))
#define rw_lock_assert_write_owner(A) my_rw_lock_assert_write_owner((A))
#define rw_lock_assert_not_write_owner(A) my_rw_lock_assert_not_write_owner((A))
#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */


/**
  Portable implementation of special type of read-write locks.

  These locks have two properties which are unusual for rwlocks:
  1) They "prefer readers" in the sense that they do not allow
     situations in which rwlock is rd-locked and there is a
     pending rd-lock which is blocked (e.g. due to pending
     request for wr-lock).
     This is a stronger guarantee than one which is provided for
     PTHREAD_RWLOCK_PREFER_READER_NP rwlocks in Linux.
     MDL subsystem deadlock detector relies on this property for
     its correctness.
  2) They are optimized for uncontended wr-lock/unlock case.
     This is a scenario in which they are most often used
     within MDL subsystem. Optimizing for it gives significant
     performance improvements in some of the tests involving many
     connections.

  Another important requirement imposed on this type of rwlock
  by the MDL subsystem is that it should be OK to destroy rwlock
  object which is in unlocked state even though some threads might
  have not yet fully left unlock operation for it (of course there
  is an external guarantee that no thread will try to lock rwlock
  which is destroyed).
  Putting it another way the unlock operation should not access
  rwlock data after changing its state to unlocked.

  TODO/FIXME: We should consider alleviating this requirement as
  it blocks us from doing certain performance optimizations.
*/

typedef struct st_rw_pr_lock_t {
  /**
    Lock which protects the structure.
    Also held for the duration of wr-lock.
  */
  pthread_mutex_t lock;
  /**
    Condition variable which is used to wake-up
    writers waiting for readers to go away.
  */
  pthread_cond_t no_active_readers;
  /** Number of active readers. */
  uint active_readers;
  /** Number of writers waiting for readers to go away. */
  uint writers_waiting_readers;
  /** Indicates whether there is an active writer. */
  my_bool active_writer;
#ifdef SAFE_MUTEX
  /** Thread holding wr-lock (for debug purposes only). */
  pthread_t writer_thread;
#endif
} rw_pr_lock_t;

extern int rw_pr_init(rw_pr_lock_t *);
extern int rw_pr_rdlock(rw_pr_lock_t *);
extern int rw_pr_wrlock(rw_pr_lock_t *);
extern int rw_pr_unlock(rw_pr_lock_t *);
extern int rw_pr_destroy(rw_pr_lock_t *);
#ifdef SAFE_MUTEX
#define rw_pr_lock_assert_write_owner(A) \
  DBUG_ASSERT((A)->active_writer && pthread_equal(pthread_self(), \
                                                  (A)->writer_thread))
#define rw_pr_lock_assert_not_write_owner(A) \
  DBUG_ASSERT(! (A)->active_writer || ! pthread_equal(pthread_self(), \
                                                      (A)->writer_thread))
#else
#define rw_pr_lock_assert_write_owner(A)
#define rw_pr_lock_assert_not_write_owner(A)
#endif /* SAFE_MUTEX */


#ifdef NEED_MY_RW_LOCK

#ifdef _WIN32

/**
  Implementation of Windows rwlock.

  We use native (slim) rwlocks on Windows, which requires Win7
  or later.
*/
typedef struct _my_rwlock_t
{
  SRWLOCK srwlock;             /* native reader writer lock */
  BOOL have_exclusive_srwlock; /* used for unlock */
} my_rw_lock_t;


#else /* _WIN32 */

/*
  On systems which don't support native read/write locks we have
  to use own implementation.
*/
typedef struct st_my_rw_lock_t {
	pthread_mutex_t lock;		/* lock for structure		*/
	pthread_cond_t	readers;	/* waiting readers		*/
	pthread_cond_t	writers;	/* waiting writers		*/
	int		state;		/* -1:writer,0:free,>0:readers	*/
	int             waiters;        /* number of waiting writers	*/
#ifdef SAFE_MUTEX
        pthread_t       write_thread;
#endif
} my_rw_lock_t;

#endif /*! _WIN32 */

extern int my_rw_init(my_rw_lock_t *);
extern int my_rw_destroy(my_rw_lock_t *);
extern int my_rw_rdlock(my_rw_lock_t *);
extern int my_rw_wrlock(my_rw_lock_t *);
extern int my_rw_unlock(my_rw_lock_t *);
extern int my_rw_tryrdlock(my_rw_lock_t *);
extern int my_rw_trywrlock(my_rw_lock_t *);
#ifdef SAFE_MUTEX
#define my_rw_lock_assert_write_owner(A) \
  DBUG_ASSERT((A)->state == -1 && pthread_equal(pthread_self(), \
                                                (A)->write_thread))
#define my_rw_lock_assert_not_write_owner(A) \
  DBUG_ASSERT((A)->state >= 0 || ! pthread_equal(pthread_self(), \
                                                 (A)->write_thread))
#else
#define my_rw_lock_assert_write_owner(A)
#define my_rw_lock_assert_not_write_owner(A)
#endif
#endif /* NEED_MY_RW_LOCK */


#define GETHOSTBYADDR_BUFF_SIZE 2048

#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#endif

/* Define mutex types, see my_thr_init.c */
#define MY_MUTEX_INIT_SLOW   NULL
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
extern pthread_mutexattr_t my_fast_mutexattr;
#define MY_MUTEX_INIT_FAST &my_fast_mutexattr
#else
#define MY_MUTEX_INIT_FAST   NULL
#endif
#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
extern pthread_mutexattr_t my_errorcheck_mutexattr;
#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr
#else
#define MY_MUTEX_INIT_ERRCHK   NULL
#endif

#ifndef ESRCH
/* Define it to something */
#define ESRCH 1
#endif

typedef uint64 my_thread_id;
/**
  Long-standing formats (such as the client-server protocol and the binary log)
  hard-coded `my_thread_id` to 32 bits in practice. (Though not all
  `thread_id`s are typed as such, @ref my_thread_id itself among those.)
  @see MDEV-35706
*/
#define MY_THREAD_ID_MAX UINT32_MAX

extern void my_threadattr_global_init(void);
extern my_bool my_thread_global_init(void);
extern void my_thread_global_reinit(void);
extern void my_thread_global_end(void);
extern my_bool my_thread_init(void);
extern void my_thread_end(void);
extern const char *my_thread_name(void);
extern my_thread_id my_thread_dbug_id(void);
extern int pthread_dummy(int);
extern void my_mutex_init(void);
extern void my_mutex_end(void);

/* All thread specific variables are in the following struct */

#define THREAD_NAME_SIZE 10
#ifndef DEFAULT_THREAD_STACK
/*
  We need to have at least 256K stack to handle calls to myisamchk_init()
  with the current number of keys and key parts.
*/
# if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
/*
  Optimized WITH_ASAN=ON executables produced
  by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6
  would fail ./mtr main.1st when the stack size is 5 MiB.
  The minimum is more than 6 MiB for CMAKE_BUILD_TYPE=RelWithDebInfo and
  more than 10 MiB for CMAKE_BUILD_TYPE=Debug.
  Let us add some safety margin.
*/
#  define DEFAULT_THREAD_STACK	(11L<<20)
# else
#  define DEFAULT_THREAD_STACK	(292*1024L) /* 299008 */
# endif
#endif

#define MY_PTHREAD_LOCK_READ 0
#define MY_PTHREAD_LOCK_WRITE 1

#include <mysql/psi/mysql_thread.h>

#define INSTRUMENT_ME 0

/*
  Thread specific variables

  Aria key cache is using the following variables for keeping track of
  state:
  suspend, next, prev, keycache_link, keycache_file, suspend, lock_type

  MariaDB uses the following to
  mutex, current_mutex, current_cond, abort
*/

struct st_my_thread_var
{
  int thr_errno;
  mysql_cond_t suspend;
  mysql_mutex_t mutex;
  struct st_my_thread_var *next,**prev;
  mysql_mutex_t * volatile current_mutex;
  mysql_cond_t * volatile current_cond;
  void *keycache_link;
  void *keycache_file;
  void *stack_ends_here;
  safe_mutex_t *mutex_in_use;
  pthread_t pthread_self;
  my_thread_id id, dbug_id;
  int volatile abort;
  uint lock_type; /* used by conditional release the queue */
  my_bool init;
#ifndef DBUG_OFF
  void *dbug;
  char name[THREAD_NAME_SIZE+1];
#endif
};

struct st_my_thread_var *_my_thread_var(void);
extern void **my_thread_var_dbug(void);
extern safe_mutex_t **my_thread_var_mutex_in_use(void);
extern uint my_thread_end_wait_time;
extern my_bool safe_mutex_deadlock_detector;
#define my_thread_var (_my_thread_var())
#define my_errno my_thread_var->thr_errno
int set_mysys_var(struct st_my_thread_var *mysys_var);


/*
  thread_safe_xxx functions are for critical statistic or counters.
  The implementation is guaranteed to be thread safe, on all platforms.
  Note that the calling code should *not* assume the counter is protected
  by the mutex given, as the implementation of these helpers may change
  to use my_atomic operations instead.
*/

#ifndef thread_safe_increment
#ifdef _WIN32
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
#else
#define thread_safe_increment(V,L) \
        (mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L)))
#define thread_safe_decrement(V,L) \
        (mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L)))
#endif
#endif

#ifndef thread_safe_add
#ifdef _WIN32
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
#else
#define thread_safe_add(V,C,L) \
        (mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \
        (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
#endif
#endif


/*
  statistics_xxx functions are for non critical statistic,
  maintained in global variables.
  When compiling with SAFE_STATISTICS:
  - race conditions can not occur.
  - some locking occurs, which may cause performance degradation.

  When compiling without SAFE_STATISTICS:
  - race conditions can occur, making the result slightly inaccurate.
  - the lock given is not honored.
*/
#ifdef SAFE_STATISTICS
#define statistic_increment(V,L) thread_safe_increment((V),(L))
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
#define statistic_add(V,C,L)     thread_safe_add((V),(C),(L))
#define statistic_sub(V,C,L)     thread_safe_sub((V),(C),(L))
#else
#define statistic_decrement(V,L) (V)--
#define statistic_increment(V,L) (V)++
#define statistic_add(V,C,L)     (V)+=(C)
#define statistic_sub(V,C,L)     (V)-=(C)
#endif /* SAFE_STATISTICS */

/*
  No locking needed, the counter is owned by the thread
*/
#define status_var_increment(V) (V)++
#define status_var_decrement(V) (V)--
#define status_var_add(V,C)     (V)+=(C)
#define status_var_sub(V,C)     (V)-=(C)

#ifdef SAFE_MUTEX
#define mysql_mutex_record_order(A,B)                   \
  do {                                                  \
    mysql_mutex_lock(A); mysql_mutex_lock(B);           \
    mysql_mutex_unlock(B); mysql_mutex_unlock(A);       \
  }  while(0)
#else
#define mysql_mutex_record_order(A,B) do { } while(0) 
#endif

/* At least Windows and NetBSD do not have this definition */
#ifndef PTHREAD_STACK_MIN
#define PTHREAD_STACK_MIN 65536
#endif

#ifdef  __cplusplus
}
#endif
#endif /* _my_ptread_h */
server/byte_order_generic.h000064400000012172150400263670012063 0ustar00/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2020, 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 */

/*
  Endianness-independent definitions for architectures other
  than the x86 architecture.
*/
#define sint2korr(A)	(int16) (((int16) ((uchar) (A)[0])) |\
				 ((int16) ((int16) (A)[1]) << 8))
#define sint3korr(A)	((int32) ((((uchar) (A)[2]) & 128) ? \
				  (((uint32) 255L << 24) | \
				   (((uint32) (uchar) (A)[2]) << 16) |\
				   (((uint32) (uchar) (A)[1]) << 8) | \
				   ((uint32) (uchar) (A)[0])) : \
				  (((uint32) (uchar) (A)[2]) << 16) |\
				  (((uint32) (uchar) (A)[1]) << 8) | \
				  ((uint32) (uchar) (A)[0])))
#define sint4korr(A)	(int32) (((uint32) ((uchar) (A)[0])) |\
				(((uint32) ((uchar) (A)[1]) << 8)) |\
				(((uint32) ((uchar) (A)[2]) << 16)) |\
				(((uint32) ((uchar) (A)[3]) << 24)))
#define sint8korr(A)	(longlong) uint8korr(A)
#define uint2korr(A)	(uint16) (((uint16) ((uchar) (A)[0])) |\
				  ((uint16) ((uchar) (A)[1]) << 8))
#define uint3korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) |\
				  (((uint32) ((uchar) (A)[1])) << 8) |\
				  (((uint32) ((uchar) (A)[2])) << 16))
#define uint4korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) |\
				  (((uint32) ((uchar) (A)[1])) << 8) |\
				  (((uint32) ((uchar) (A)[2])) << 16) |\
				  (((uint32) ((uchar) (A)[3])) << 24))
#define uint5korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) |\
				    (((uint32) ((uchar) (A)[1])) << 8) |\
				    (((uint32) ((uchar) (A)[2])) << 16) |\
				    (((uint32) ((uchar) (A)[3])) << 24)) |\
				    (((ulonglong) ((uchar) (A)[4])) << 32))
#define uint6korr(A)	((ulonglong)(((uint32)    ((uchar) (A)[0]))          | \
                                     (((uint32)    ((uchar) (A)[1])) << 8)   | \
                                     (((uint32)    ((uchar) (A)[2])) << 16)  | \
                                     (((uint32)    ((uchar) (A)[3])) << 24)) | \
                         (((ulonglong) ((uchar) (A)[4])) << 32) |       \
                         (((ulonglong) ((uchar) (A)[5])) << 40))
#define uint8korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) |\
				    (((uint32) ((uchar) (A)[1])) << 8) |\
				    (((uint32) ((uchar) (A)[2])) << 16) |\
				    (((uint32) ((uchar) (A)[3])) << 24)) |\
			(((ulonglong) (((uint32) ((uchar) (A)[4])) |\
				    (((uint32) ((uchar) (A)[5])) << 8) |\
				    (((uint32) ((uchar) (A)[6])) << 16) |\
				    (((uint32) ((uchar) (A)[7])) << 24))) <<\
				    32))
#define int2store(T,A)       do { uint def_temp= (uint) (A) ;\
                                  *((uchar*) (T))=  (uchar)(def_temp); \
                                   *((uchar*) (T)+1)=(uchar)((def_temp >> 8)); \
                             } while(0)
#define int3store(T,A)       do { /*lint -save -e734 */\
                                  *((uchar*)(T))=(uchar) ((A));\
                                  *((uchar*) (T)+1)=(uchar) (((A) >> 8));\
                                  *((uchar*)(T)+2)=(uchar) (((A) >> 16)); \
                                  /*lint -restore */} while(0)
#define int4store(T,A)       do { *((char *)(T))=(char) ((A));\
                                  *(((char *)(T))+1)=(char) (((A) >> 8));\
                                  *(((char *)(T))+2)=(char) (((A) >> 16));\
                                  *(((char *)(T))+3)=(char) (((A) >> 24));\
                             } while(0)
#define int5store(T,A)       do { *((char *)(T))=     (char)((A));  \
                                  *(((char *)(T))+1)= (char)(((A) >> 8)); \
                                  *(((char *)(T))+2)= (char)(((A) >> 16)); \
                                  *(((char *)(T))+3)= (char)(((A) >> 24)); \
                                  *(((char *)(T))+4)= (char)(((A) >> 32)); \
		             } while(0)
#define int6store(T,A)       do { *((char *)(T))=     (char)((A)); \
                                  *(((char *)(T))+1)= (char)(((A) >> 8)); \
                                  *(((char *)(T))+2)= (char)(((A) >> 16)); \
                                  *(((char *)(T))+3)= (char)(((A) >> 24)); \
                                  *(((char *)(T))+4)= (char)(((A) >> 32)); \
                                  *(((char *)(T))+5)= (char)(((A) >> 40)); \
                             } while(0)
#define int8store(T,A)       do { uint def_temp= (uint) (A), \
                                       def_temp2= (uint) ((A) >> 32); \
                                  int4store((T),def_temp); \
                                  int4store((T+4),def_temp2);\
                             } while(0)
server/my_xml.h000064400000005420150400263670007534 0ustar00/* Copyright (c) 2000, 2002, 2003, 2005, 2007 MySQL AB
   Use is subject to license terms

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA  */


#ifndef _my_xml_h
#define _my_xml_h

#ifdef	__cplusplus
extern "C" {
#endif


#define MY_XML_OK	0
#define MY_XML_ERROR	1

/* 
  A flag whether to use absolute tag names in call-back functions,
  like "a", "a.b" and "a.b.c" (used in character set file parser),
  or relative names like "a", "b" and "c".
*/
#define MY_XML_FLAG_RELATIVE_NAMES 1

/*
  A flag whether to skip normilization of text values before calling
  call-back functions: i.e. skip leading/trailing spaces,
  \r, \n, \t characters.
*/
#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2

enum my_xml_node_type
{
  MY_XML_NODE_TAG,   /* can have TAG, ATTR and TEXT children */
  MY_XML_NODE_ATTR,  /* can have TEXT children               */
  MY_XML_NODE_TEXT   /* cannot have children                 */
};

typedef struct xml_stack_st
{
  int flags;
  enum my_xml_node_type current_node_type;
  char errstr[128];

  struct {
    char static_buffer[128];
    char *buffer;
    size_t buffer_size;
    char *start;
    char *end;
  } attr;

  const char *beg;
  const char *cur;
  const char *end;
  void *user_data;
  int  (*enter)(struct xml_stack_st *st,const char *val, size_t len);
  int  (*value)(struct xml_stack_st *st,const char *val, size_t len);
  int  (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len);
} MY_XML_PARSER;

void my_xml_parser_create(MY_XML_PARSER *st);
void my_xml_parser_free(MY_XML_PARSER *st);
int  my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len);

void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
							 const char *,
							 size_t len));
void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
							 const char *,
							 size_t len));
void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
							 const char *,
							 size_t len));
void my_xml_set_user_data(MY_XML_PARSER *st, void *);

size_t my_xml_error_pos(MY_XML_PARSER *st);
uint my_xml_error_lineno(MY_XML_PARSER *st);

const char *my_xml_error_string(MY_XML_PARSER *st);

#ifdef	__cplusplus
}
#endif

#endif /* _my_xml_h */
server/decimal.h000064400000011471150400263700007622 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _decimal_h
#define _decimal_h

#ifdef __cplusplus
extern "C" {
#endif

typedef enum
{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
  decimal_round_mode;
typedef int32 decimal_digit_t;

/**
    intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
         before the point
    frac is the number of decimal digits after the point
    len  is the length of buf (length of allocated space) in decimal_digit_t's,
         not in bytes
    sign false means positive, true means negative
    buf  is an array of decimal_digit_t's
 */
typedef struct st_decimal_t {
  int    intg, frac, len;
  my_bool sign;
  decimal_digit_t *buf;
} decimal_t;

int internal_str2dec(const char *from, decimal_t *to, char **end,
                     my_bool fixed);
int decimal2string(const decimal_t *from, char *to, int *to_len,
                   decimal_digits_t fixed_precision,
                   decimal_digits_t fixed_decimals,
                   char filler);
int decimal2ulonglong(const decimal_t *from, ulonglong *to);
int ulonglong2decimal(ulonglong from, decimal_t *to);
int decimal2longlong(const decimal_t *from, longlong *to);
int longlong2decimal(longlong from, decimal_t *to);
int decimal2double(const decimal_t *from, double *to);
int double2decimal(double from, decimal_t *to);
decimal_digits_t decimal_actual_fraction(const decimal_t *from);
int decimal2bin(const decimal_t *from, uchar *to, decimal_digits_t precision,
                decimal_digits_t scale);
int bin2decimal(const uchar *from, decimal_t *to, decimal_digits_t precision,
                decimal_digits_t scale);

uint decimal_size(decimal_digits_t precision, decimal_digits_t scale);
uint decimal_bin_size(decimal_digits_t precision, decimal_digits_t scale);
uint decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
                         int param);

decimal_digits_t decimal_intg(const decimal_t *from);
int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_cmp(const decimal_t *from1, const decimal_t *from2);
int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
                int scale_incr);
int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
                  decimal_round_mode mode);
int decimal_is_zero(const decimal_t *from);
void max_decimal(decimal_digits_t precision, decimal_digits_t frac,
                 decimal_t *to);

#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)

/* set a decimal_t to zero */

#define decimal_make_zero(dec)        do {                \
                                        (dec)->buf[0]=0;    \
                                        (dec)->intg=1;      \
                                        (dec)->frac=0;      \
                                        (dec)->sign=0;      \
                                      } while(0)

/*
  returns the length of the buffer to hold string representation
  of the decimal (including decimal dot, possible sign and \0)
*/

#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
				  (dec)->frac + ((dec)->frac > 0) + 2)

/* negate a decimal */
#define decimal_neg(dec) do { (dec)->sign^=1; } while(0)

/*
  conventions:

    decimal_smth() == 0     -- everything's ok
    decimal_smth() <= 1     -- result is usable, but precision loss is possible
    decimal_smth() <= 2     -- result can be unusable, most significant digits
                               could've been lost
    decimal_smth() >  2     -- no result was generated
*/

#define E_DEC_OK                0
#define E_DEC_TRUNCATED         1
#define E_DEC_OVERFLOW          2
#define E_DEC_DIV_ZERO          4
#define E_DEC_BAD_NUM           8
#define E_DEC_OOM              16

#define E_DEC_ERROR            31
#define E_DEC_FATAL_ERROR      30

#ifdef __cplusplus
}
#endif

#endif

server/my_decimal_limits.h000064400000004032150400263700011703 0ustar00#ifndef MY_DECIMAL_LIMITS_INCLUDED
#define MY_DECIMAL_LIMITS_INCLUDED
/* Copyright (c) 2011 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#define DECIMAL_LONGLONG_DIGITS 22
#define DECIMAL_LONG_DIGITS 10
#define DECIMAL_LONG3_DIGITS 8

/** maximum length of buffer in our big digits (uint32). */
#define DECIMAL_BUFF_LENGTH 9

/* the number of digits that my_decimal can possibly contain */
#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)


/**
  maximum guaranteed precision of number in decimal digits (number of our
  digits * number of decimal digits in one our big digit - number of decimal
  digits in one our big digit decreased by 1 (because we always put decimal
  point on the border of our big digits))

  With normal precision we can handle 65 digits. MariaDB can store in
  the .frm up to 63 digits.  By default we use DECIMAL_NOT_SPECIFIED digits
  when converting strings to decimal, so we don't want to set this too high.
  To not use up all digits for the scale we limit the number of decimals to
  38.
*/
#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
#define DECIMAL_MAX_SCALE 38
#define DECIMAL_NOT_SPECIFIED 39

/**
  maximum length of string representation (number of maximum decimal
  digits + 1 position for sign + 1 position for decimal point, no terminator)
*/
#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)

#endif /* MY_DECIMAL_LIMITS_INCLUDED */
server/sql_common.h000064400000012224150400263700010370 0ustar00#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
/* Copyright (c) 2003, 2018, Oracle and/or its affiliates.
   Copyright (c) 2010, 2018, MariaDB

   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 */

#ifdef	__cplusplus
extern "C" {
#endif

#include <mysql.h>
#include <hash.h>

extern const char	*unknown_sqlstate;
extern const char	*cant_connect_sqlstate;
extern const char	*not_error_sqlstate;


struct st_mysql_options_extention {
  char *plugin_dir;
  char *default_auth;
  char *ssl_crl;				/* PEM CRL file */
  char *ssl_crlpath;				/* PEM directory of CRL-s? */
  void (*report_progress)(const MYSQL *mysql,
                          unsigned int stage,
                          unsigned int max_stage,
                          double progress,
                          const char *proc_info,
                          uint proc_info_length);
  HASH connection_attributes;
  size_t connection_attributes_length;
  my_bool tls_verify_server_cert;
};

typedef struct st_mysql_methods
{
  my_bool (*read_query_result)(MYSQL *mysql);
  my_bool (*advanced_command)(MYSQL *mysql,
			      enum enum_server_command command,
			      const unsigned char *header,
			      unsigned long header_length,
			      const unsigned char *arg,
			      unsigned long arg_length,
			      my_bool skip_check,
                              MYSQL_STMT *stmt);
  MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
			   unsigned int fields);
  MYSQL_RES * (*use_result)(MYSQL *mysql);
  void (*fetch_lengths)(unsigned long *to,
			MYSQL_ROW column, unsigned int field_count);
  void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
  int (*read_change_user_result)(MYSQL *mysql);
  void (*on_close_free)(MYSQL *mysql);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
  MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
  my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
  int (*stmt_execute)(MYSQL_STMT *stmt);
  int (*read_binary_rows)(MYSQL_STMT *stmt);
  int (*unbuffered_fetch)(MYSQL *mysql, char **row);
  const char *(*read_statistics)(MYSQL *mysql);
  my_bool (*next_result)(MYSQL *mysql);
  int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
#endif
} MYSQL_METHODS;

#ifdef LIBMARIADB
#define simple_command(mysql, command, arg, length, skip_check) ma_simple_command(mysql, command, (char *)arg, length, skip_check, NULL)
#else
#define simple_command(mysql, command, arg, length, skip_check) \
  (*(mysql)->methods->advanced_command)(mysql, command, 0,  \
                                        0, arg, length, skip_check, NULL)
#endif
#define stmt_command(mysql, command, arg, length, stmt) \
  (*(mysql)->methods->advanced_command)(mysql, command, 0,  \
                                        0, arg, length, 1, stmt)

extern CHARSET_INFO *default_client_charset_info;
MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,
                           uint fields, my_bool default_value, 
                           uint server_capabilities);
void free_rows(MYSQL_DATA *cur);
void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql);
void mysql_read_default_options(struct st_mysql_options *options,
				const char *filename,const char *group);
my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
		     const unsigned char *header, ulong header_length,
		     const unsigned char *arg, ulong arg_length,
                     my_bool skip_check, MYSQL_STMT *stmt);
unsigned long cli_safe_read(MYSQL *mysql);
unsigned long cli_safe_read_reallen(MYSQL *mysql, ulong* reallen);
void net_clear_error(NET *net);
void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net);
void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate,
                    const char *err);
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate,
                              const char *format, ...);

/* client side of the pluggable authentication */
struct st_vio;
struct st_plugin_vio_info;
void mpvio_info(struct st_vio *vio, struct st_plugin_vio_info *info);
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
                    const char *data_plugin, const char *db);
int mysql_client_plugin_init();
void mysql_client_plugin_deinit();
struct st_mysql_client_plugin;
extern struct st_mysql_client_plugin *mysql_client_builtins[];
uchar * send_client_connect_attrs(MYSQL *mysql, uchar *buf);

#ifdef	__cplusplus
}
#endif

#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)

#endif /* SQL_COMMON_INCLUDED */
server/typelib.h000064400000004534150400263700007676 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


#ifndef _typelib_h
#define _typelib_h

#include "my_alloc.h"

typedef struct st_typelib {	/* Different types saved here */
  unsigned int count;		/* How many types */
  const char *name;		/* Name of typelib */
  const char **type_names;
  unsigned int *type_lengths;
} TYPELIB;

extern my_ulonglong find_typeset(const char *x, TYPELIB *typelib,
                                 int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
                                  const char *option);
#define FIND_TYPE_BASIC           0
/** makes @c find_type() require the whole name, no prefix */
#define FIND_TYPE_NO_PREFIX      (1U << 0)
/** always implicitly on, so unused, but old code may pass it */
#define FIND_TYPE_NO_OVERWRITE   0
/** makes @c find_type() accept a number. Not used either */
#define FIND_TYPE_ALLOW_NUMBER   0
/** makes @c find_type() treat ',' and '=' as terminators */
#define FIND_TYPE_COMMA_TERM     (1U << 3)

extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, const TYPELIB *from);

extern TYPELIB sql_protocol_typelib;

my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name,
                              my_ulonglong cur_set, my_ulonglong default_set,
                              const char *str, unsigned int length,
                              char **err_pos, unsigned int *err_len);

#endif /* _typelib_h */
server/my_net.h000064400000003755150400263700007525 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/*
  This file is also used to make handling of sockets and ioctl()
  portable across systems.

*/

#ifndef _my_net_h
#define _my_net_h

C_MODE_START

#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#if defined(HAVE_POLL_H)
#include <poll.h>
#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
#endif /* defined(HAVE_POLL_H) */
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif

#if !defined(_WIN32)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif

#if defined(_WIN32)
#define O_NONBLOCK 1    /* For emulation of fcntl() */

/*
  SHUT_RDWR is called SD_BOTH in windows and
  is defined to 2 in winsock2.h
  #define SD_BOTH 0x02
*/
#define SHUT_RDWR 0x02
#else
#include <netdb.h>     /* getaddrinfo() & co */
#endif

/*
  On OSes which don't have the in_addr_t, we guess that using uint32
  is the best possible choice. We guess this from the fact that on
  HP-UX64bit & FreeBSD64bit & Solaris64bit, in_addr_t is equivalent to
  uint32. And on Linux32bit too.
*/
#ifndef HAVE_IN_ADDR_T
#define in_addr_t uint32
#endif


C_MODE_END
#endif
server/byte_order_generic_x86.h000064400000010272150400263700012561 0ustar00/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2020, 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 */

/*
  Optimized function-like macros for the x86 architecture (_WIN32 included).
*/

#define sint2korr(A)	(*((const int16 *) (A)))
#define sint3korr(A)	((int32) ((((uchar) (A)[2]) & 128) ? \
				  (((uint32) 255L << 24) | \
				   (((uint32) (uchar) (A)[2]) << 16) |\
				   (((uint32) (uchar) (A)[1]) << 8) | \
				   ((uint32) (uchar) (A)[0])) : \
				  (((uint32) (uchar) (A)[2]) << 16) |\
				  (((uint32) (uchar) (A)[1]) << 8) | \
				  ((uint32) (uchar) (A)[0])))
#define sint4korr(A)	(*((const long *) (A)))
#define uint2korr(A)	(*((const uint16 *) (A)))
#define uint3korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) |\
				  (((uint32) ((uchar) (A)[1])) << 8) |\
				  (((uint32) ((uchar) (A)[2])) << 16))
#define uint4korr(A)	(*((const uint32 *) (A)))
#define uint5korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) |\
				    (((uint32) ((uchar) (A)[1])) << 8) |\
				    (((uint32) ((uchar) (A)[2])) << 16) |\
				    (((uint32) ((uchar) (A)[3])) << 24)) |\
				    (((ulonglong) ((uchar) (A)[4])) << 32))
#define uint6korr(A)	((ulonglong)(((uint32)    ((uchar) (A)[0]))          | \
                                     (((uint32)    ((uchar) (A)[1])) << 8)   | \
                                     (((uint32)    ((uchar) (A)[2])) << 16)  | \
                                     (((uint32)    ((uchar) (A)[3])) << 24)) | \
                         (((ulonglong) ((uchar) (A)[4])) << 32) |       \
                         (((ulonglong) ((uchar) (A)[5])) << 40))
#define uint8korr(A)	(*((const ulonglong *) (A)))
#define sint8korr(A)	(*((const longlong *) (A)))

#define int2store(T,A)	*((uint16*) (T))= (uint16) (A)
#define int3store(T,A)  do { *(T)=  (uchar) ((A));\
                            *(T+1)=(uchar) (((uint) (A) >> 8));\
                            *(T+2)=(uchar) (((A) >> 16));\
                        } while (0)
#define int4store(T,A)	*((long *) (T))= (long) (A)
#define int5store(T,A)  do { *(T)= (uchar)((A));\
                             *((T)+1)=(uchar) (((A) >> 8));\
                             *((T)+2)=(uchar) (((A) >> 16));\
                             *((T)+3)=(uchar) (((A) >> 24));\
                             *((T)+4)=(uchar) (((A) >> 32));\
                        } while(0)
#define int6store(T,A)  do { *(T)=    (uchar)((A));          \
                             *((T)+1)=(uchar) (((A) >> 8));  \
                             *((T)+2)=(uchar) (((A) >> 16)); \
                             *((T)+3)=(uchar) (((A) >> 24)); \
                             *((T)+4)=(uchar) (((A) >> 32)); \
                             *((T)+5)=(uchar) (((A) >> 40)); \
                        } while(0)
#define int8store(T,A)	*((ulonglong *) (T))= (ulonglong) (A)
typedef union {
  double v;
  long m[2];
} doubleget_union;
#define doubleget(V,M) \
do { doubleget_union _tmp; \
     _tmp.m[0] = *((const long*)(M));      \
     _tmp.m[1] = *(((const long*) (M))+1); \
     (V) = _tmp.v; } while(0)
#define doublestore(T,V) \
do { *((long *) T) = ((const doubleget_union *)&V)->m[0];     \
     *(((long *) T)+1) = ((const doubleget_union *)&V)->m[1]; \
   } while (0)
#define float4get(V,M) \
do { *((float *) &(V)) = *((const float*) (M)); } while(0)
#define float8get(V,M)   doubleget((V),(M))
#define float4store(V,M) memcpy((uchar*)(V), (uchar*)(&M), sizeof(float))
#define floatstore(T,V)  memcpy((uchar*)(T), (uchar*)(&V), sizeof(float))
#define floatget(V,M)    memcpy((uchar*)(&V),(uchar*) (M), sizeof(float))
#define float8store(V,M) doublestore((V),(M))
server/mysql_com_server.h000064400000002441150400263700011612 0ustar00/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

/*
  Definitions private to the server,
  used in the networking layer to notify specific events.
*/

#ifndef _mysql_com_server_h
#define _mysql_com_server_h

struct st_net_server;

typedef void (*before_header_callback_fn)
  (struct st_net *net, void *user_data, size_t count);

typedef void (*after_header_callback_fn)
  (struct st_net *net, void *user_data, size_t count, my_bool rc);

struct st_net_server
{
  before_header_callback_fn m_before_header;
  after_header_callback_fn m_after_header;
  void *m_user_data;
};

typedef struct st_net_server NET_SERVER;

#endif
server/errmsg.h000064400000010471150400263700007522 0ustar00#ifndef ERRMSG_INCLUDED
#define ERRMSG_INCLUDED

/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

   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 */

/*
  Error messages numbers for MySQL clients.
  The error messages itself are in libmysql/errmsg.c

  Error messages for the mysqld daemon are in sql/share/errmsg.txt
*/

#ifdef	__cplusplus
extern "C" {
#endif
void	init_client_errs(void);
void	finish_client_errs(void);
extern const char *client_errors[];	/* Error messages */
#ifdef	__cplusplus
}
#endif

#define CR_MIN_ERROR		2000	/* For easier client code */
#define CR_MAX_ERROR		2999
#if !defined(ER)
#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST) \
               ? client_errors[(X)-CR_ERROR_FIRST]             \
               : client_errors[CR_UNKNOWN_ERROR-CR_ERROR_FIRST])

#endif
#define CLIENT_ERRMAP		2	/* Errormap used by my_error() */

/* Do not add error numbers before CR_ERROR_FIRST. */
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
#define CR_ERROR_FIRST  	2000 /*Copy first error nr.*/
#define CR_UNKNOWN_ERROR	2000
#define CR_SOCKET_CREATE_ERROR	2001
#define CR_CONNECTION_ERROR	2002
#define CR_CONN_HOST_ERROR	2003
#define CR_IPSOCK_ERROR		2004
#define CR_UNKNOWN_HOST		2005
#define CR_SERVER_GONE_ERROR	2006
#define CR_VERSION_ERROR	2007
#define CR_OUT_OF_MEMORY	2008
#define CR_WRONG_HOST_INFO	2009
#define CR_LOCALHOST_CONNECTION 2010
#define CR_TCP_CONNECTION	2011
#define CR_SERVER_HANDSHAKE_ERR 2012
#define CR_SERVER_LOST		2013
#define CR_COMMANDS_OUT_OF_SYNC 2014
#define CR_NAMEDPIPE_CONNECTION 2015
#define CR_NAMEDPIPEWAIT_ERROR  2016
#define CR_NAMEDPIPEOPEN_ERROR  2017
#define CR_NAMEDPIPESETSTATE_ERROR 2018
#define CR_CANT_READ_CHARSET	2019
#define CR_NET_PACKET_TOO_LARGE 2020
#define CR_EMBEDDED_CONNECTION	2021
#define CR_PROBE_SLAVE_STATUS   2022
#define CR_PROBE_SLAVE_HOSTS    2023
#define CR_PROBE_SLAVE_CONNECT  2024
#define CR_PROBE_MASTER_CONNECT 2025
#define CR_SSL_CONNECTION_ERROR 2026
#define CR_MALFORMED_PACKET     2027
#define CR_WRONG_LICENSE	2028

/* new 4.1 error codes */
#define CR_NULL_POINTER		2029
#define CR_NO_PREPARE_STMT	2030
#define CR_PARAMS_NOT_BOUND	2031
#define CR_DATA_TRUNCATED	2032
#define CR_NO_PARAMETERS_EXISTS 2033
#define CR_INVALID_PARAMETER_NO 2034
#define CR_INVALID_BUFFER_USE	2035
#define CR_UNSUPPORTED_PARAM_TYPE 2036

#define CR_SHARED_MEMORY_CONNECTION             2037
#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR  2038
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR   2039
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR      2041
#define CR_SHARED_MEMORY_FILE_MAP_ERROR         2042
#define CR_SHARED_MEMORY_MAP_ERROR              2043
#define CR_SHARED_MEMORY_EVENT_ERROR     	2044
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR      2046
#define CR_CONN_UNKNOW_PROTOCOL 		2047
#define CR_INVALID_CONN_HANDLE			2048
#define CR_SECURE_AUTH                          2049
#define CR_FETCH_CANCELED                       2050
#define CR_NO_DATA                              2051
#define CR_NO_STMT_METADATA                     2052
#define CR_NO_RESULT_SET                        2053
#define CR_NOT_IMPLEMENTED                      2054
#define CR_SERVER_LOST_EXTENDED			2055
#define CR_STMT_CLOSED				2056
#define CR_NEW_STMT_METADATA                    2057
#define CR_ALREADY_CONNECTED                    2058
#define CR_AUTH_PLUGIN_CANNOT_LOAD              2059
#define CR_DUPLICATE_CONNECTION_ATTR            2060
#define CR_AUTH_PLUGIN_ERR                      2061
#define CR_ERROR_LAST  /*Copy last error nr:*/  2061
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */

#endif /* ERRMSG_INCLUDED */
server/sslopt-vars.h000064400000002575150400263710010527 0ustar00#ifndef SSLOPT_VARS_INCLUDED
#define SSLOPT_VARS_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifdef SSL_VARS_NOT_STATIC
#define SSL_STATIC
#else
#define SSL_STATIC static
#endif
SSL_STATIC my_bool opt_use_ssl   = 0;
SSL_STATIC char *opt_ssl_ca      = 0;
SSL_STATIC char *opt_ssl_capath  = 0;
SSL_STATIC char *opt_ssl_cert    = 0;
SSL_STATIC char *opt_ssl_cipher  = 0;
SSL_STATIC char *opt_ssl_key     = 0;
SSL_STATIC char *opt_ssl_crl     = 0;
SSL_STATIC char *opt_ssl_crlpath = 0;
SSL_STATIC char *opt_tls_version = 0;
#ifdef MYSQL_CLIENT
SSL_STATIC my_bool opt_ssl_verify_server_cert= 0;
#endif
#endif
#endif /* SSLOPT_VARS_INCLUDED */
server/my_dbug.h000064400000023577150400263710007665 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. 
   Copyright (C) 2000, 2019, 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 */

#ifndef _my_dbug_h
#define _my_dbug_h

#ifndef _WIN32
#include <signal.h>
#endif

#ifdef  __cplusplus
extern "C" {
#endif
#if !defined(DBUG_OFF) && !defined(_lint)

struct _db_stack_frame_ {
  const char *func;      /* function name of the previous stack frame       */
  const char *file;      /* filename of the function of previous frame      */
  uint level;            /* this nesting level, highest bit enables tracing */
  int line;              /* line of DBUG_RETURN                             */
  struct _db_stack_frame_ *prev; /* pointer to the previous frame */
};

struct  _db_code_state_;
extern  my_bool _dbug_on_;
extern  my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
extern  int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern  int _db_explain_init_(char *buf, size_t len);
extern	int _db_is_pushed_(void);
extern  void _db_setjmp_(void);
extern  void _db_longjmp_(void);
extern  void _db_process_(const char *name);
extern  void _db_push_(const char *control);
extern  void _db_pop_(void);
extern  void _db_set_(const char *control);
extern  void _db_set_init_(const char *control);
extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
                       struct _db_stack_frame_ *_stack_frame_);
extern  void _db_return_(struct _db_stack_frame_ *_stack_frame_);
extern  int _db_pargs_(uint _line_,const char *keyword);
extern  void _db_doprnt_(const char *format,...)
#ifdef WAITING_FOR_BUGFIX_TO_VSPRINTF
  ATTRIBUTE_FORMAT(printf, 1, 2)
#endif
  ;
extern  void _db_dump_(uint _line_,const char *keyword,
                       const unsigned char *memory, size_t length);
extern  void _db_end_(void);
extern  void _db_lock_file_(void);
extern  void _db_unlock_file_(void);
ATTRIBUTE_COLD
extern  my_bool _db_my_assert(const char *file, int line, const char *msg);
extern  FILE *_db_fp_(void);
extern void _db_flush_(void);
extern void dbug_swap_code_state(void **code_state_store);
extern void dbug_free_code_state(void **code_state_store);
extern  const char* _db_get_func_(void);
extern int (*dbug_sanity)(void);

#ifdef DBUG_TRACE
#define DBUG_LEAVE do { \
    _db_stack_frame_.line= __LINE__; \
    _db_return_ (&_db_stack_frame_); \
    _db_stack_frame_.line= 0; \
  } while(0)

#define DBUG_PRINT(keyword,arglist) \
        do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)

#ifdef HAVE_ATTRIBUTE_CLEANUP
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_  __attribute__((cleanup(_db_return_))); \
        _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
#define DBUG_RETURN(a1) do { _db_stack_frame_.line=__LINE__; return(a1);} while(0)
#define DBUG_VOID_RETURN do { _db_stack_frame_.line=__LINE__; return;} while(0)
#else
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
        _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
#endif

#else
#define DBUG_LEAVE
#define DBUG_ENTER(a)
#define DBUG_RETURN(a1) return(a1)
#define DBUG_VOID_RETURN return
#define DBUG_PRINT(keyword,arglist) do{} while(0)
#endif

#define DBUG_EXECUTE(keyword,a1) \
        do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
#define DBUG_EXECUTE_IF(keyword,a1) \
        do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
#define DBUG_EVALUATE(keyword,a1,a2) \
        (_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
        (_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
#define DBUG_PUSH_EMPTY if (_dbug_on_) { DBUG_PUSH(""); }
#define DBUG_POP_EMPTY  if (_dbug_on_) { DBUG_POP(); }
#define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ ()
#define DBUG_SET(a1) _db_set_ (a1)
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
#define DBUG_PROCESS(a1) _db_process_(a1)
#define DBUG_FILE _db_fp_()
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
#define DBUG_END()  _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
#define DBUG_ASSERT(A) do { \
  if (unlikely(!(A)) && _db_my_assert(__FILE__, __LINE__, #A)) assert(A); \
} while (0)
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
#define DBUG_ASSERT_EXISTS
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define DEBUGGER_OFF                    do { _dbug_on_= 0; } while(0)
#define DEBUGGER_ON                     do { _dbug_on_= 1; } while(0)
#define IF_DBUG(A,B)                    A
#define IF_DBUG_ASSERT(A,B)             A
#define DBUG_SWAP_CODE_STATE(arg) dbug_swap_code_state(arg)
#define DBUG_FREE_CODE_STATE(arg) dbug_free_code_state(arg)
#undef DBUG_ASSERT_AS_PRINTF

#ifndef _WIN32
#define DBUG_ABORT()                    (_db_flush_(), abort())
#else
/*
  Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
  call abort() instead of _exit(3) (now it would cause a "test signal" popup).
*/
#include <crtdbg.h>
#define DBUG_ABORT() (_db_flush_(),\
                     (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
                     (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
                     TerminateProcess(GetCurrentProcess(),3))
#endif

/*
  Make the program fail, without creating a core file.
  abort() will send SIGABRT which (most likely) generates core.
  Use SIGKILL instead, which cannot be caught.
  We also pause the current thread, until the signal is actually delivered.
  An alternative would be to use _exit(EXIT_FAILURE),
  but then valgrind would report lots of memory leaks.
 */
#ifdef _WIN32
#define DBUG_SUICIDE() DBUG_ABORT()
#else
extern void _db_suicide_(void);
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
#endif /* _WIN32 */

#else                                           /* No debugger */

#define DBUG_ENTER(a1)
#define DBUG_VIOLATION_HELPER_LEAVE do { } while(0)
#define DBUG_LEAVE
#define DBUG_RETURN(a1)                 do { return(a1); } while(0)
#define DBUG_VOID_RETURN                do { return; } while(0)
#define DBUG_PRINT(keyword, arglist)    do { } while(0)
#define DBUG_EXECUTE(keyword,a1)        do { } while(0)
#define DBUG_EXECUTE_IF(keyword,a1)     do { } while(0)
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
#define DBUG_PRINT(keyword,arglist)     do { } while(0)
#define DBUG_PUSH_EMPTY                 do { } while(0)
#define DBUG_POP_EMPTY                  do { } while(0)
#define DBUG_PUSH(a1)                   do { } while(0)
#define DBUG_SET(a1)                    do { } while(0)
#define DBUG_SET_INITIAL(a1)            do { } while(0)
#define DBUG_POP()                      do { } while(0)
#define DBUG_PROCESS(a1)                do { } while(0)
#define DBUG_DUMP(keyword,a1,a2)        do { } while(0)
#define DBUG_END()                      do { } while(0)
#define DBUG_SLOW_ASSERT(A)             do { } while(0)
#define DBUG_LOCK_FILE                  do { } while(0)
#define DBUG_FILE (stderr)
#define DBUG_UNLOCK_FILE                do { } while(0)
#define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len)
#define DEBUGGER_OFF                    do { } while(0)
#define DEBUGGER_ON                     do { } while(0)
#define IF_DBUG(A,B)                    B
#define DBUG_SWAP_CODE_STATE(arg)       do { } while(0)
#define DBUG_FREE_CODE_STATE(arg)       do { } while(0)
#define DBUG_ABORT()                    do { } while(0)
#define DBUG_CRASH_ENTER(func)
#define DBUG_CRASH_RETURN(val)          do { return(val); } while(0)
#define DBUG_CRASH_VOID_RETURN          do { return; } while(0)
#define DBUG_SUICIDE()                  do { } while(0)

#ifdef DBUG_ASSERT_AS_PRINTF
extern void (*my_dbug_assert_failed)(const char *assert_expr, const char* file, unsigned long line);
#define DBUG_ASSERT(assert_expr) do { if (!(assert_expr)) { my_dbug_assert_failed(#assert_expr, __FILE__, __LINE__); }} while (0)
#define DBUG_ASSERT_EXISTS
#define IF_DBUG_ASSERT(A,B)             A
#else
#define DBUG_ASSERT(A)                  do { } while(0)
#define IF_DBUG_ASSERT(A,B)             B
#endif /* DBUG_ASSERT_AS_PRINTF */
#endif /* !defined(DBUG_OFF) && !defined(_lint) */

#ifdef EXTRA_DEBUG
/**
  Sync points allow us to force the server to reach a certain line of code
  and block there until the client tells the server it is ok to go on.
  The client tells the server to block with SELECT GET_LOCK()
  and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
  concurrency problems
*/
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
 debug_sync_point(lock_name,lock_timeout)
void debug_sync_point(const char* lock_name, uint lock_timeout);
#else
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
#endif /* EXTRA_DEBUG */

#ifdef __cplusplus
}
/*
  DBUG_LOG() was initially intended for InnoDB. To be able to use it elsewhere
  one should #include <sstream>. We intentionally avoid including it here to save
  compilation time.
*/
# ifdef DBUG_OFF
#  define DBUG_LOG(keyword, v) do {} while (0)
# else
#  define DBUG_LOG(keyword, v) do { \
  if (_db_pargs_(__LINE__, keyword)) { \
    std::ostringstream _db_s; _db_s << v; \
    _db_doprnt_("%s", _db_s.str().c_str()); \
  }} while (0)
# endif
#endif

#endif /* _my_dbug_h */
server/my_alloc.h000064400000004025150400263710010021 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/* 
   Data structures for mysys/my_alloc.c (root memory allocator)
*/

#ifndef _my_alloc_h
#define _my_alloc_h

#include "mysql/psi/psi_base.h"

#define ALLOC_MAX_BLOCK_TO_DROP			4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP	10

#define ROOT_FLAG_READ_ONLY       4

#ifdef __cplusplus
extern "C" {
#endif

typedef struct st_used_mem
{				   /* struct for once_alloc (block) */
  struct st_used_mem *next;	   /* Next block in use */
  size_t left;                     /* memory left in block  */
  size_t size;                     /* size of block */
} USED_MEM;


typedef struct st_mem_root
{
  USED_MEM *free;                  /* blocks with free memory in it */
  USED_MEM *used;                  /* blocks almost without free memory */
  USED_MEM *pre_alloc;             /* preallocated block */
  /* if block have less memory it will be put in 'used' list */
  size_t min_malloc;
  size_t block_size;               /* initial block size */
  unsigned int block_num;          /* allocated blocks counter */
  /* 
     first free block in queue test counter (if it exceed 
     MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
  */
  unsigned short first_block_usage;
  unsigned short flags;

  void (*error_handler)(void);

  PSI_memory_key m_psi_key;
} MEM_ROOT;

#ifdef  __cplusplus
}
#endif

#endif
server/byte_order_generic_x86_64.h000064400000010041150400263710013065 0ustar00/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2020, 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 */

/*
  Optimized function-like macros for the x86 architecture (_WIN32 included).
*/

#define sint2korr(A)	(int16) (*((int16 *) (A)))
#define sint3korr(A)	((int32) ((((uchar) (A)[2]) & 128) ? \
				  (((uint32) 255L << 24) | \
				   (((uint32) (uchar) (A)[2]) << 16) |\
				   (((uint32) (uchar) (A)[1]) << 8) | \
				   ((uint32) (uchar) (A)[0])) : \
				  (((uint32) (uchar) (A)[2]) << 16) |\
				  (((uint32) (uchar) (A)[1]) << 8) | \
				  ((uint32) (uchar) (A)[0])))
#define sint4korr(A)	(int32)  (*((int32 *) (A)))
#define uint2korr(A)	(uint16) (*((uint16 *) (A)))
#define uint3korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) |\
				  (((uint32) ((uchar) (A)[1])) << 8) |\
				  (((uint32) ((uchar) (A)[2])) << 16))
#define uint4korr(A)	(uint32) (*((uint32 *) (A)))


static inline ulonglong uint5korr(const void *p)
{
  ulonglong a= *(uint32 *) p;
  ulonglong b= *(4 + (uchar *) p);
  return a | (b << 32);
}
static inline ulonglong uint6korr(const void *p)
{
  ulonglong a= *(uint32 *) p;
  ulonglong b= *(uint16 *) (4 + (char *) p);
  return a | (b << 32);
}

#define uint8korr(A)	(ulonglong) (*((ulonglong *) (A)))
#define sint8korr(A)	(longlong) (*((longlong *) (A)))

#define int2store(T,A)	do { uchar *pT= (uchar*)(T);\
                             *((uint16*)(pT))= (uint16) (A);\
                        } while (0)

#define int3store(T,A)  do { *(T)=  (uchar) ((A));\
                            *(T+1)=(uchar) (((uint) (A) >> 8));\
                            *(T+2)=(uchar) (((A) >> 16));\
                        } while (0)

#define int4store(T,A)	do { uchar *pT= (uchar*)(T);\
                             *((uint32 *) (pT))= (uint32) (A); \
                        } while (0)

#define int5store(T,A)  do { uchar *pT= (uchar*)(T);\
                             *((uint32 *) (pT))= (uint32) (A); \
                             *((pT)+4)=(uchar) (((A) >> 32));\
                        } while (0)

#define int6store(T,A)  do { uchar *pT= (uchar*)(T);\
                             *((uint32 *) (pT))= (uint32) (A); \
                             *((uint16*)(pT+4))= (uint16) (A >> 32);\
                        } while (0)

#define int8store(T,A)	do { uchar *pT= (uchar*)(T);\
                             *((ulonglong *) (pT))= (ulonglong) (A);\
                        } while(0)

#if defined(__GNUC__)

#define HAVE_mi_uint5korr
#define HAVE_mi_uint6korr
#define HAVE_mi_uint7korr
#define HAVE_mi_uint8korr

/* Read numbers stored in high-bytes-first order */

static inline ulonglong mi_uint5korr(const void *p)
{
  ulonglong a= *(uint32 *) p;
  ulonglong b= *(4 + (uchar *) p);
  ulonglong v= (a | (b << 32)) << 24;
  asm ("bswapq %0" : "=r" (v) : "0" (v));
  return v;
}

static inline ulonglong mi_uint6korr(const void *p)
{
  ulonglong a= *(uint32 *) p;
  ulonglong b= *(uint16 *) (4 + (char *) p);
  ulonglong v= (a | (b << 32)) << 16;
  asm ("bswapq %0" : "=r" (v) : "0" (v));
  return v;
}

static inline ulonglong mi_uint7korr(const void *p)
{
  ulonglong a= *(uint32 *) p;
  ulonglong b= *(uint16 *) (4 + (char *) p);
  ulonglong c= *(6 + (uchar *) p);
  ulonglong v= (a | (b << 32) | (c << 48)) << 8;
  asm ("bswapq %0" : "=r" (v) : "0" (v));
  return v;
}

static inline ulonglong mi_uint8korr(const void *p)
{
  ulonglong v= *(ulonglong *) p;
  asm ("bswapq %0" : "=r" (v) : "0" (v));
  return v;
}

#endif
server/my_getopt.h000064400000012744150400263710010240 0ustar00/*
   Copyright (c) 2002, 2013, Oracle and/or its affiliates.

   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 */

#ifndef _my_getopt_h
#define _my_getopt_h

#include "my_sys.h"             /* loglevel */
/* my_getopt and my_default are almost always used together */
#include <my_default.h>

C_MODE_START

#define GET_NO_ARG     1
#define GET_BOOL       2
#define GET_INT        3
#define GET_UINT       4
#define GET_LONG       5
#define GET_ULONG      6
#define GET_LL         7
#define GET_ULL        8
#define GET_STR        9
#define GET_STR_ALLOC 10
#define GET_DISABLED  11
#define GET_ENUM      12
#define GET_SET       13
#define GET_DOUBLE    14
#define GET_FLAGSET   15
#define GET_BIT       16

#define GET_ASK_ADDR     128
#define GET_AUTO          64
#define GET_TYPE_MASK     63

/**
  Enumeration of the my_option::arg_type attributes.
  It should be noted that for historical reasons variables with the combination
  arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
  arguments. This is someone counter intuitive and care should be taken
  if the code is refactored.
*/
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };

struct st_typelib;

struct my_option
{
  const char *name;                     /**< Name of the option. name=NULL
                                           marks the end of the my_option[]
                                           array.
                                         */
  int        id;                        /**< For 0<id<255 it's means one
                                           character for a short option
                                           (like -A), if >255 no short option
                                           is created, but a long option still
                                           can be identified uniquely in the
                                           my_get_one_option() callback.
                                           If an opton needs neither special
                                           treatment in the my_get_one_option()
                                           nor one-letter short equivalent
                                           use id=0
                                         */
  const char *comment;                  /**< option comment, for autom. --help.
                                           if it's NULL the option is not
                                           visible in --help.
                                         */
  void       *value;                    /**< A pointer to the variable value */
  void       *u_max_value;              /**< The user def. max variable value */
  struct st_typelib *typelib;           /**< Pointer to possible values */
  ulong     var_type;                   /**< GET_BOOL, GET_ULL, etc */
  enum get_opt_arg_type arg_type;       /**< e.g. REQUIRED_ARG or OPT_ARG */
  longlong   def_value;                 /**< Default value */
  longlong   min_value;                 /**< Min allowed value (for numbers) */
  ulonglong  max_value;                 /**< Max allowed value (for numbers) */
  longlong   sub_size;                  /**< Unused                          */
  long       block_size;                /**< Value should be a mult. of this (for numbers) */
  void       *app_type;                 /**< To be used by an application */
};

typedef my_bool (*my_get_one_option)(const struct my_option *, const char *, const char *);

/**
  Used to retrieve a reference to the object (variable) that holds the value
  for the given option. For example, if var_type is GET_UINT, the function
  must return a pointer to a variable of type uint. A argument is stored in
  the location pointed to by the returned pointer.
*/
typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
                                 int *);


extern char *disabled_my_option;
extern char *autoset_my_option;
extern my_bool my_getopt_print_errors;
extern my_bool my_getopt_skip_unknown;
extern my_bool my_getopt_prefix_matching;
extern my_bool my_handle_options_init_variables;
extern my_error_reporter my_getopt_error_reporter;
extern my_getopt_value my_getopt_get_addr;

extern int handle_options (int *argc, char ***argv, 
			   const struct my_option *longopts, my_get_one_option)
  __attribute__((nonnull));
extern void my_cleanup_options(const struct my_option *options);
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);

ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
                                 my_bool *fix);
longlong getopt_ll_limit_value(longlong, const struct my_option *,
                               my_bool *fix);
double getopt_double_limit_value(double num, const struct my_option *optp,
                                 my_bool *fix);

ulonglong getopt_double2ulonglong(double);
double getopt_ulonglong2double(ulonglong);

C_MODE_END

#endif /* _my_getopt_h */

server/private/sql_trigger.h000064400000030054150400263710012217 0ustar00#ifndef SQL_TRIGGER_INCLUDED
#define SQL_TRIGGER_INCLUDED

/*
   Copyright (c) 2004, 2011, Oracle and/or its affiliates.
   Copyright (c) 2017, 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 <mysqld_error.h>

/* Forward declarations */

class Item_trigger_field;
class sp_head;
class sp_name;
class Query_tables_list;
struct TABLE_LIST;
class Query_tables_list;
typedef struct st_ddl_log_state DDL_LOG_STATE;

/** Event on which trigger is invoked. */
enum trg_event_type
{
  TRG_EVENT_INSERT= 0,
  TRG_EVENT_UPDATE= 1,
  TRG_EVENT_DELETE= 2,
  TRG_EVENT_MAX
};

static inline uint8 trg2bit(enum trg_event_type trg)
{ return static_cast<uint8>(1 << static_cast<int>(trg)); }

#include "table.h"                              /* GRANT_INFO */

/*
  We need this two enums here instead of sql_lex.h because
  at least one of them is used by Item_trigger_field interface.

  Time when trigger is invoked (i.e. before or after row actually
  inserted/updated/deleted).
*/
enum trg_action_time_type
{
  TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX
};

enum trigger_order_type
{
  TRG_ORDER_NONE= 0,
  TRG_ORDER_FOLLOWS= 1,
  TRG_ORDER_PRECEDES= 2
};


struct st_trg_execution_order
{
  /**
    FOLLOWS or PRECEDES as specified in the CREATE TRIGGER statement.
  */
  enum trigger_order_type ordering_clause;

  /**
    Trigger name referenced in the FOLLOWS/PRECEDES clause of the
    CREATE TRIGGER statement.
  */
  LEX_CSTRING anchor_trigger_name;
};


/*
  Parameter to change_table_name_in_triggers()
*/

class TRIGGER_RENAME_PARAM
{
public:
  TABLE table;
  bool upgrading50to51;
  bool got_error;

  TRIGGER_RENAME_PARAM()
  {
    upgrading50to51= got_error= 0;
    table.reset();
  }
  ~TRIGGER_RENAME_PARAM()
  {
    reset();
  }
  void reset();
};


class Table_triggers_list;

/**
   The trigger object
*/

class Trigger :public Sql_alloc
{
public:
    Trigger(Table_triggers_list *base_arg, sp_head *code):
    base(base_arg), body(code), next(0), trigger_fields(0), action_order(0)
  {
    bzero((char *)&subject_table_grants, sizeof(subject_table_grants));
  }
  ~Trigger();
  Table_triggers_list *base;
  sp_head *body;
  Trigger *next;                                /* Next trigger of same type */

  /**
    Heads of the lists linking items for all fields used in triggers
    grouped by event and action_time.
  */
  Item_trigger_field *trigger_fields;
  LEX_CSTRING name;
  LEX_CSTRING on_table_name;                     /* Raw table name */
  LEX_CSTRING definition;
  LEX_CSTRING definer;

  /* Character sets used */
  LEX_CSTRING client_cs_name;
  LEX_CSTRING connection_cl_name;
  LEX_CSTRING db_cl_name;

  GRANT_INFO subject_table_grants;
  sql_mode_t sql_mode;
  /* Store create time. Can't be mysql_time_t as this holds also sub seconds */
  my_hrtime_t hr_create_time; // Create time timestamp in microseconds
  trg_event_type event;
  trg_action_time_type action_time;
  uint action_order;

  bool is_fields_updated_in_trigger(MY_BITMAP *used_fields);
  void get_trigger_info(LEX_CSTRING *stmt, LEX_CSTRING *body,
                        LEX_STRING *definer);
  /* Functions executed over each active trigger */
  bool change_on_table_name(void* param_arg);
  bool change_table_name(void* param_arg);
  bool add_to_file_list(void* param_arg);
};

typedef bool (Trigger::*Triggers_processor)(void *arg);

/**
  This class holds all information about triggers of table.
*/

class Table_triggers_list: public Sql_alloc
{
  friend class Trigger;

  /* Points to first trigger for a certain type */
  Trigger *triggers[TRG_EVENT_MAX][TRG_ACTION_MAX];
  /**
    Copy of TABLE::Field array which all fields made nullable
    (using extra_null_bitmap, if needed). Used for NEW values in
    BEFORE INSERT/UPDATE triggers.
  */
  Field             **record0_field;
  uchar              *extra_null_bitmap, *extra_null_bitmap_init;
  /**
    Copy of TABLE::Field array with field pointers set to TABLE::record[1]
    buffer instead of TABLE::record[0] (used for OLD values in on UPDATE
    trigger and DELETE trigger when it is called for REPLACE).
  */
  Field             **record1_field;
  /**
    During execution of trigger new_field and old_field should point to the
    array of fields representing new or old version of row correspondingly
    (so it can point to TABLE::field or to Tale_triggers_list::record1_field)
  */
  Field             **new_field;
  Field             **old_field;

  /* TABLE instance for which this triggers list object was created */
  TABLE *trigger_table;

  /**
     This flag indicates that one of the triggers was not parsed successfully,
     and as a precaution the object has entered a state where all trigger
     access results in errors until all such triggers are dropped. It is not
     safe to add triggers since we don't know if the broken trigger has the
     same name or event type. Nor is it safe to invoke any trigger for the
     aforementioned reasons. The only safe operations are drop_trigger and
     drop_all_triggers.

     @see Table_triggers_list::set_parse_error
   */
  bool m_has_unparseable_trigger;

  /**
    This error will be displayed when the user tries to manipulate or invoke
    triggers on a table that has broken triggers. It will get set only once
    per statement and thus will contain the first parse error encountered in
    the trigger file.
   */
  char m_parse_error_message[MYSQL_ERRMSG_SIZE];
  uint count;                                   /* Number of triggers */

public:
  /**
    Field responsible for storing triggers definitions in file.
    It have to be public because we are using it directly from parser.
  */
  List<LEX_CSTRING>  definitions_list;
  /**
    List of sql modes for triggers
  */
  List<ulonglong> definition_modes_list;
  /** Create times for triggers */
  List<ulonglong> hr_create_times;

  List<LEX_CSTRING>  definers_list;

  /* Character set context, used for parsing and executing triggers. */

  List<LEX_CSTRING> client_cs_names;
  List<LEX_CSTRING> connection_cl_names;
  List<LEX_CSTRING> db_cl_names;

  /* End of character ser context. */

  Table_triggers_list(TABLE *table_arg)
    :record0_field(0), extra_null_bitmap(0), extra_null_bitmap_init(0),
    record1_field(0), trigger_table(table_arg),
    m_has_unparseable_trigger(false), count(0)
  {
    bzero((char *) triggers, sizeof(triggers));
  }
  ~Table_triggers_list();

  bool create_trigger(THD *thd, TABLE_LIST *table, String *stmt_query,
                      DDL_LOG_STATE *ddl_log_state,
                      DDL_LOG_STATE *ddl_log_state_tmp_file);
  bool drop_trigger(THD *thd, TABLE_LIST *table,
                    LEX_CSTRING *sp_name,
                    String *stmt_query, DDL_LOG_STATE *ddl_log_state);
  bool process_triggers(THD *thd, trg_event_type event,
                        trg_action_time_type time_type,
                        bool old_row_is_record1);
  void empty_lists();
  bool create_lists_needed_for_files(MEM_ROOT *root);
  bool save_trigger_file(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name);

  static bool check_n_load(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name,
                           TABLE *table, bool names_only);
  static bool drop_all_triggers(THD *thd, const LEX_CSTRING *db,
                                const LEX_CSTRING *table_name, myf MyFlags);
  static bool prepare_for_rename(THD *thd, TRIGGER_RENAME_PARAM *param,
                                 const LEX_CSTRING *db,
                                 const LEX_CSTRING *old_alias,
                                 const LEX_CSTRING *old_table,
                                 const LEX_CSTRING *new_db,
                                 const LEX_CSTRING *new_table);
  static bool change_table_name(THD *thd, TRIGGER_RENAME_PARAM *param,
                                const LEX_CSTRING *db,
                                const LEX_CSTRING *old_alias,
                                const LEX_CSTRING *old_table,
                                const LEX_CSTRING *new_db,
                                const LEX_CSTRING *new_table);
  void add_trigger(trg_event_type event_type, 
                   trg_action_time_type action_time,
                   trigger_order_type ordering_clause,
                   LEX_CSTRING *anchor_trigger_name,
                   Trigger *trigger);
  Trigger *get_trigger(trg_event_type event_type, 
                       trg_action_time_type action_time)
  {
    return triggers[event_type][action_time];
  }
  /* Simpler version of the above, to avoid casts in the code */
  Trigger *get_trigger(uint event_type, uint action_time)
  {
    return get_trigger((trg_event_type) event_type,
                       (trg_action_time_type) action_time);
  }

  bool has_triggers(trg_event_type event_type, 
                    trg_action_time_type action_time)
  {
    return get_trigger(event_type,action_time) != 0;
  }
  bool has_delete_triggers()
  {
    return (has_triggers(TRG_EVENT_DELETE,TRG_ACTION_BEFORE) ||
            has_triggers(TRG_EVENT_DELETE,TRG_ACTION_AFTER));
  }

  void mark_fields_used(trg_event_type event);

  void set_parse_error_message(char *error_message);

  friend class Item_trigger_field;

  bool add_tables_and_routines_for_triggers(THD *thd,
                                            Query_tables_list *prelocking_ctx,
                                            TABLE_LIST *table_list);

  Field **nullable_fields() { return record0_field; }
  void clear_extra_null_bitmap()
  {
    if (size_t null_bytes= extra_null_bitmap_init - extra_null_bitmap)
      bzero(extra_null_bitmap, null_bytes);
  }
  void default_extra_null_bitmap()
  {
    if (size_t null_bytes= extra_null_bitmap_init - extra_null_bitmap)
      memcpy(extra_null_bitmap, extra_null_bitmap_init, null_bytes);
  }

  Trigger *find_trigger(const LEX_CSTRING *name, bool remove_from_list);

  Trigger* for_all_triggers(Triggers_processor func, void *arg);

private:
  bool prepare_record_accessors(TABLE *table);
  Trigger *change_table_name_in_trignames(const LEX_CSTRING *old_db_name,
                                          const LEX_CSTRING *new_db_name,
                                          const LEX_CSTRING *new_table_name,
                                          Trigger *trigger);
  bool change_table_name_in_triggers(THD *thd,
                                     const LEX_CSTRING *old_db_name,
                                     const LEX_CSTRING *new_db_name,
                                     const LEX_CSTRING *old_table_name,
                                     const LEX_CSTRING *new_table_name);

  bool check_for_broken_triggers() 
  {
    if (m_has_unparseable_trigger)
    {
      my_message(ER_PARSE_ERROR, m_parse_error_message, MYF(0));
      return true;
    }
    return false;
  }
};


bool add_table_for_trigger(THD *thd,
                           const sp_name *trg_name,
                           bool continue_if_not_exist,
                           TABLE_LIST **table);

void build_trn_path(THD *thd, const sp_name *trg_name, LEX_STRING *trn_path);

bool check_trn_exists(const LEX_CSTRING *trn_path);

bool load_table_name_for_trigger(THD *thd,
                                 const sp_name *trg_name,
                                 const LEX_CSTRING *trn_path,
                                 LEX_CSTRING *tbl_name);
bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create);
bool rm_trigname_file(char *path, const LEX_CSTRING *db,
                      const LEX_CSTRING *trigger_name, myf MyFlags);

extern const char * const TRG_EXT;
extern const char * const TRN_EXT;

#endif /* SQL_TRIGGER_INCLUDED */
server/private/sql_crypt.h000064400000002635150400263710011721 0ustar00#ifndef SQL_CRYPT_INCLUDED
#define SQL_CRYPT_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */


#ifdef USE_PRAGMA_INTERFACE 
#pragma interface			/* gcc class implementation */
#endif

#include "sql_alloc.h"                       /* Sql_alloc */
#include "my_rnd.h"                          /* rand_struct */

class SQL_CRYPT :public Sql_alloc
{
  struct my_rnd_struct rand,org_rand;
  char decode_buff[256],encode_buff[256];
  uint shift;
 public:
  SQL_CRYPT() = default;
  SQL_CRYPT(ulong *seed)
  {
    init(seed);
  }
  ~SQL_CRYPT() = default;
  void init(ulong *seed);
  void reinit() { shift=0; rand=org_rand; }
  void encode(char *str, uint length);
  void decode(char *str, uint length);
};

#endif /* SQL_CRYPT_INCLUDED */
server/private/sql_profile.h000064400000017210150400263710012213 0ustar00/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _SQL_PROFILE_H
#define _SQL_PROFILE_H

class Item;
struct TABLE_LIST;
class THD;
class ST_FIELD_INFO;
typedef struct st_schema_table ST_SCHEMA_TABLE;

namespace Show {
extern ST_FIELD_INFO query_profile_statistics_info[];
} // namespace Show

int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);


#define PROFILE_NONE         (uint)0
#define PROFILE_CPU          (uint)(1<<0)
#define PROFILE_MEMORY       (uint)(1<<1)
#define PROFILE_BLOCK_IO     (uint)(1<<2)
#define PROFILE_CONTEXT      (uint)(1<<3)
#define PROFILE_PAGE_FAULTS  (uint)(1<<4)
#define PROFILE_IPC          (uint)(1<<5)
#define PROFILE_SWAPS        (uint)(1<<6)
#define PROFILE_SOURCE       (uint)(1<<16)
#define PROFILE_ALL          (uint)(~0)


#if defined(ENABLED_PROFILING)
#include "sql_priv.h"
#include "unireg.h"

#ifdef _WIN32
#include <psapi.h>
#endif

#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif

extern PSI_memory_key key_memory_queue_item;

class PROF_MEASUREMENT;
class QUERY_PROFILE;
class PROFILING;


/**
  Implements a persistent FIFO using server List method names.  Not
  thread-safe.  Intended to be used on thread-local data only.  
*/
template <class T> class Queue
{
private:

  struct queue_item
  {
    T *payload;
    struct queue_item *next, *previous;
  };

  struct queue_item *first, *last;

public:
  Queue()
  {
    elements= 0;
    first= last= NULL;
  }

  void empty()
  {
    struct queue_item *i, *after_i;
    for (i= first; i != NULL; i= after_i)
    {
      after_i= i->next;
      my_free(i);
    }
    elements= 0;
  }

  ulong elements;                       /* The count of items in the Queue */

  void push_back(T *payload)
  {
    struct queue_item *new_item;

    new_item= (struct queue_item *) my_malloc(key_memory_queue_item,
                                              sizeof(struct queue_item), MYF(0));
    if (!new_item)
      return;

    new_item->payload= payload;

    if (first == NULL)
      first= new_item;
    if (last != NULL)
    {
      DBUG_ASSERT(last->next == NULL);
      last->next= new_item;
    }
    new_item->previous= last;
    new_item->next= NULL;
    last= new_item;

    elements++;
  }

  T *pop()
  {
    struct queue_item *old_item= first;
    T *ret= NULL;

    if (first == NULL)
    {
      DBUG_PRINT("warning", ("tried to pop nonexistent item from Queue"));
      return NULL;
    }

    ret= old_item->payload;
    if (first->next != NULL)
      first->next->previous= NULL;
    else
      last= NULL;
    first= first->next;

    my_free(old_item);
    elements--;

    return ret;
  }

  bool is_empty()
  {
    DBUG_ASSERT(((elements > 0) && (first != NULL)) || ((elements == 0) || (first == NULL)));
    return (elements == 0);
  }

  void *new_iterator()
  {
    return first;
  }

  void *iterator_next(void *current)
  {
    return ((struct queue_item *) current)->next;
  }

  T *iterator_value(void *current)
  {
    return ((struct queue_item *) current)->payload;
  }

};


/**
  A single entry in a single profile.
*/
class PROF_MEASUREMENT
{
private:
  friend class QUERY_PROFILE;
  friend class PROFILING;

  QUERY_PROFILE *profile;
  char *status;
#ifdef HAVE_GETRUSAGE
  struct rusage rusage;
#elif defined(_WIN32)
  FILETIME ftKernel, ftUser;
  IO_COUNTERS io_count;
  PROCESS_MEMORY_COUNTERS mem_count;
#endif

  char *function;
  char *file;
  unsigned int line;

  ulong m_seq;
  double time_usecs;
  char *allocated_status_memory;

  void set_label(const char *status_arg, const char *function_arg, 
                  const char *file_arg, unsigned int line_arg);
  void clean_up();
  
  PROF_MEASUREMENT();
  PROF_MEASUREMENT(QUERY_PROFILE *profile_arg, const char *status_arg);
  PROF_MEASUREMENT(QUERY_PROFILE *profile_arg, const char *status_arg,
                const char *function_arg,
                const char *file_arg, unsigned int line_arg);
  ~PROF_MEASUREMENT();
  void collect();
};


/**
  The full profile for a single query, and includes multiple PROF_MEASUREMENT
  objects.
*/
class QUERY_PROFILE
{
private:
  friend class PROFILING;

  PROFILING *profiling;

  query_id_t profiling_query_id;        /* Session-specific id. */
  char *query_source;

  double m_start_time_usecs;
  double m_end_time_usecs;
  ulong m_seq_counter;
  Queue<PROF_MEASUREMENT> entries;


  QUERY_PROFILE(PROFILING *profiling_arg, const char *status_arg);
  ~QUERY_PROFILE();

  void set_query_source(char *query_source_arg, size_t query_length_arg);

  /* Add a profile status change to the current profile. */
  void new_status(const char *status_arg,
              const char *function_arg,
              const char *file_arg, unsigned int line_arg);

  /* Reset the contents of this profile entry. */
  void reset();

  /* Show this profile.  This is called by PROFILING. */
  bool show(uint options);
};


/**
  Profiling state for a single THD; contains multiple QUERY_PROFILE objects.
*/
class PROFILING
{
private:
  friend class PROF_MEASUREMENT;
  friend class QUERY_PROFILE;

  /* 
    Not the system query_id, but a counter unique to profiling. 
  */
  query_id_t profile_id_counter;     
  THD *thd;
  bool keeping;
  bool enabled;

  QUERY_PROFILE *current;
  QUERY_PROFILE *last;
  Queue<QUERY_PROFILE> history;
 
  query_id_t next_profile_id() { return(profile_id_counter++); }

public:
  PROFILING();
  ~PROFILING();

  /**
    At a point in execution where we know the query source, save the text
    of it in the query profile.

    This must be called exactly once per descrete statement.
  */
  void set_query_source(char *query_source_arg, size_t query_length_arg)
  {
    if (unlikely(current))
      current->set_query_source(query_source_arg, query_length_arg);
  }

  /**
    Prepare to start processing a new query.  It is an error to do this
    if there's a query already in process; nesting is not supported.

    @param  initial_state  (optional) name of period before first state change
  */
  void start_new_query(const char *initial_state= "Starting")
  {
    DBUG_ASSERT(!current);
    if (unlikely(enabled))
    {
      QUERY_PROFILE *new_profile= new QUERY_PROFILE(this, initial_state);
      if (new_profile)
        current= new_profile;
    }
  }

  void discard_current_query();

  void finish_current_query()
  {
    if (unlikely(current))
      finish_current_query_impl();
  }

  void finish_current_query_impl();

  void status_change(const char *status_arg,
                     const char *function_arg,
                     const char *file_arg, unsigned int line_arg)
  {
    if (unlikely(current))
      current->new_status(status_arg, function_arg, file_arg, line_arg);
  }

  inline void set_thd(THD *thd_arg)
  {
    thd= thd_arg;
    reset();
  }

  /* SHOW PROFILES */
  bool show_profiles();

  /* ... from INFORMATION_SCHEMA.PROFILING ... */
  int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
  void reset();
  void restart();
};

#  endif /* ENABLED_PROFILING */
#endif /* _SQL_PROFILE_H */
server/private/sql_servers.h000064400000003361150400263710012246 0ustar00#ifndef SQL_SERVERS_INCLUDED
#define SQL_SERVERS_INCLUDED

/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 "slave.h" // for tables_ok(), rpl_filter

class THD;
typedef struct st_lex_server_options LEX_SERVER_OPTIONS;
typedef struct st_mem_root MEM_ROOT;

/* structs */
typedef struct st_federated_server
{
  const char *server_name;
  long port;
  size_t server_name_length;
  const char *db, *scheme, *username, *password, *socket, *owner, *host, *sport;
} FOREIGN_SERVER;

/* cache handlers */
bool servers_init(bool dont_read_server_table);
bool servers_reload(THD *thd);
void servers_free(bool end=0);

/* insert functions */
int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options);

/* drop functions */ 
int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options);

/* update functions */
int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options);

/* lookup functions */
FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
                                   FOREIGN_SERVER *server_buffer);

#endif /* SQL_SERVERS_INCLUDED */
server/private/threadpool_winsockets.h000064400000004362150400263710014312 0ustar00/* Copyright (C) 2020 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA
 */
#pragma once

#include <WinSock2.h>
#include <windows.h>

struct st_vio;

struct win_aiosocket
{
  /** OVERLAPPED is needed by all Windows AIO*/
  OVERLAPPED m_overlapped{};
  /** Handle to pipe, or socket */
  HANDLE m_handle{};
  /** Whether the m_handle refers to pipe*/
  bool m_is_pipe{};
 
  /* Read buffer handling */

  /** Pointer to buffer of size READ_BUFSIZ. Can be NULL.*/
  char *m_buf_ptr{};
  /** Offset to current buffer position*/
  size_t m_buf_off{};
  /** Size of valid data in the buffer*/
  size_t m_buf_datalen{};

  /*  Vio handling */
  /** Pointer to original vio->vio_read/vio->has_data function */
  size_t (*m_orig_vio_read)(st_vio *, unsigned char *, size_t){};
  char (*m_orig_vio_has_data)(st_vio *){};



  /**
   Begins asynchronnous reading from socket/pipe. 
   On IO completion, pre-read some bytes into internal buffer
  */
  DWORD begin_read();

  /**
   Update number of bytes returned, and IO error status

   Should be called right after IO is completed
   GetQueuedCompletionStatus() , or threadpool IO completion
   callback would return nbytes and the error.

   Sets the valid data length in the read buffer.
  */
  void end_read(ULONG nbytes, DWORD err);

  /**
    Override VIO routines with ours, accounting for
    one-shot buffering.
  */
  void init(st_vio *vio);

  /** Return number of unread bytes.*/
  size_t buffer_remaining();

  /* Frees the read buffer.*/
  ~win_aiosocket();
};

/* Functions related to IO buffers caches.*/
extern void init_win_aio_buffers(unsigned int n_buffers);
extern void destroy_win_aio_buffers();
server/private/sql_type_int.h000064400000023421150400263710012407 0ustar00/* Copyright (c) 2018, 2021, MariaDB

   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 */

#ifndef SQL_TYPE_INT_INCLUDED
#define SQL_TYPE_INT_INCLUDED

#include "my_bit.h" // my_count_bits()


class Null_flag
{
protected:
  bool m_is_null;
public:
  bool is_null() const { return m_is_null; }
  Null_flag(bool is_null) :m_is_null(is_null) { }
};


class Longlong
{
protected:
  longlong m_value;
public:
  longlong value() const { return m_value; }
  Longlong(longlong nr) :m_value(nr) { }
  ulonglong abs()
  {
    if (m_value == LONGLONG_MIN) // avoid undefined behavior
      return ((ulonglong) LONGLONG_MAX) + 1;
    return m_value < 0 ? -m_value : m_value;
  }
};


class Longlong_null: public Longlong, public Null_flag
{
public:
  Longlong_null(longlong nr, bool is_null)
   :Longlong(nr), Null_flag(is_null)
  { }
  explicit Longlong_null()
   :Longlong(0), Null_flag(true)
  { }
  explicit Longlong_null(longlong nr)
   :Longlong(nr), Null_flag(false)
  { }
  Longlong_null operator|(const Longlong_null &other) const
  {
    if (is_null() || other.is_null())
      return Longlong_null();
    return Longlong_null(value() | other.value());
  }
  Longlong_null operator&(const Longlong_null &other) const
  {
    if (is_null() || other.is_null())
      return Longlong_null();
    return Longlong_null(value() & other.value());
  }
  Longlong_null operator^(const Longlong_null &other) const
  {
    if (is_null() || other.is_null())
      return Longlong_null();
    return Longlong_null((longlong) (value() ^ other.value()));
  }
  Longlong_null operator~() const
  {
    if (is_null())
      return *this;
    return Longlong_null((longlong) ~ (ulonglong) value());
  }
  Longlong_null operator<<(const Longlong_null &llshift) const
  {
    ulonglong res;
    uint shift;
    if (is_null() || llshift.is_null())
      return Longlong_null();
    shift= (uint) llshift.value();
    res= 0;
    if (shift < sizeof(longlong) * 8)
      res= ((ulonglong) value()) << shift;
    return Longlong_null((longlong) res);
  }
  Longlong_null operator>>(const Longlong_null &llshift) const
  {
    ulonglong res;
    uint shift;
    if (is_null() || llshift.is_null())
      return Longlong_null();
    shift= (uint) llshift.value();
    res= 0;
    if (shift < sizeof(longlong) * 8)
      res= ((ulonglong) value()) >> shift;
    return Longlong_null(res);
  }
  Longlong_null bit_count() const
  {
    if (is_null())
      return *this;
    return Longlong_null((longlong) my_count_bits((ulonglong) value()));
  }
};


class ULonglong
{
protected:
  ulonglong m_value;
public:
  ulonglong value() const { return m_value; }
  explicit ULonglong(ulonglong nr) :m_value(nr) { }

  static bool test_if_sum_overflows_ull(ulonglong arg1, ulonglong arg2)
  {
    return ULONGLONG_MAX - arg1 < arg2;
  }

  Longlong_null operator-() const
  {
    if (m_value > (ulonglong) LONGLONG_MAX) // Avoid undefined behaviour
    {
      return m_value == (ulonglong) LONGLONG_MAX + 1 ?
             Longlong_null(LONGLONG_MIN, false) :
             Longlong_null(0, true);
    }
    return Longlong_null(-(longlong) m_value, false);
  }

  // Convert to Longlong_null with the range check
  Longlong_null to_longlong_null() const
  {
    if (m_value > (ulonglong) LONGLONG_MAX)
      return Longlong_null(0, true);
    return Longlong_null((longlong) m_value, false);
  }

};


class ULonglong_null: public ULonglong, public Null_flag
{
public:
  ULonglong_null(ulonglong nr, bool is_null)
   :ULonglong(nr), Null_flag(is_null)
  { }

  /*
    Multiply two ulonglong values.

    Let a = a1 * 2^32 + a0 and b = b1 * 2^32 + b0. Then
    a * b = (a1 * 2^32 + a0) * (b1 * 2^32 + b0) = a1 * b1 * 2^64 +
            + (a1 * b0 + a0 * b1) * 2^32 + a0 * b0;
    We can determine if the above sum overflows the ulonglong range by
    sequentially checking the following conditions:
    1. If both a1 and b1 are non-zero.
    2. Otherwise, if (a1 * b0 + a0 * b1) is greater than ULONG_MAX.
    3. Otherwise, if (a1 * b0 + a0 * b1) * 2^32 + a0 * b0 is greater than
    ULONGLONG_MAX.
  */
  static ULonglong_null ullmul(ulonglong a, ulonglong b)
  {
    ulong a1= (ulong)(a >> 32);
    ulong b1= (ulong)(b >> 32);

    if (a1 && b1)
      return ULonglong_null(0, true);

    ulong a0= (ulong)(0xFFFFFFFFUL & a);
    ulong b0= (ulong)(0xFFFFFFFFUL & b);

    ulonglong res1= (ulonglong) a1 * b0 + (ulonglong) a0 * b1;
    if (res1 > 0xFFFFFFFFUL)
      return ULonglong_null(0, true);

    res1= res1 << 32;
    ulonglong res0= (ulonglong) a0 * b0;

    if (test_if_sum_overflows_ull(res1, res0))
      return ULonglong_null(0, true);
    return ULonglong_null(res1 + res0, false);
  }
};


// A longlong/ulonglong hybrid. Good to store results of val_int().
class Longlong_hybrid: public Longlong
{
protected:
  bool m_unsigned;
  int cmp_signed(const Longlong_hybrid& other) const
  {
    return m_value < other.m_value ? -1 : m_value == other.m_value ? 0 : 1;
  }
  int cmp_unsigned(const Longlong_hybrid& other) const
  {
    return (ulonglong) m_value < (ulonglong) other.m_value ? -1 :
            m_value == other.m_value ? 0 : 1;
  }
public:
  Longlong_hybrid(longlong nr, bool unsigned_flag)
   :Longlong(nr), m_unsigned(unsigned_flag)
  { }
  bool is_unsigned() const { return m_unsigned; }
  bool is_unsigned_outside_of_signed_range() const
  {
    return m_unsigned && ((ulonglong) m_value) > (ulonglong) LONGLONG_MAX;
  }
  bool neg() const { return m_value < 0 && !m_unsigned; }
  ulonglong abs() const
  {
    if (m_unsigned)
      return (ulonglong) m_value;
    return Longlong(m_value).abs();
  }
  /*
    Convert to an unsigned number:
    - Negative numbers are converted to 0.
    - Positive numbers bigger than upper_bound are converted to upper_bound.
    - Other numbers are returned as is.
  */
  ulonglong to_ulonglong(ulonglong upper_bound) const
  {
    return neg() ? 0 :
           (ulonglong) m_value > upper_bound ? upper_bound :
           (ulonglong) m_value;
  }
  uint to_uint(uint upper_bound) const
  {
    return (uint) to_ulonglong(upper_bound);
  }


  Longlong_null val_int_signed() const
  {
    if (m_unsigned)
      return ULonglong((ulonglong) m_value).to_longlong_null();
    return Longlong_null(m_value, false);
  }

  Longlong_null val_int_unsigned() const
  {
    if (!m_unsigned && m_value < 0)
      return Longlong_null(0, true);
    return Longlong_null(m_value, false);
  }

  /*
    Return in Item compatible val_int() format:
    - signed numbers as a straight longlong value
    - unsigned numbers as a ulonglong value reinterpreted to longlong
  */
  Longlong_null val_int(bool want_unsigned_value) const
  {
    return want_unsigned_value ? val_int_unsigned() :
                                 val_int_signed();
  }

  int cmp(const Longlong_hybrid& other) const
  {
    if (m_unsigned == other.m_unsigned)
      return m_unsigned ? cmp_unsigned(other) : cmp_signed(other);
    if (is_unsigned_outside_of_signed_range())
      return 1;
    if (other.is_unsigned_outside_of_signed_range())
      return -1;
    /*
      The unsigned argument is in the range 0..LONGLONG_MAX.
      The signed argument is in the range LONGLONG_MIN..LONGLONG_MAX.
      Safe to compare as signed.
    */
    return cmp_signed(other);
  }
  bool operator==(const Longlong_hybrid &nr) const
  {
    return cmp(nr) == 0;
  }
  bool operator==(ulonglong nr) const
  {
    return cmp(Longlong_hybrid((longlong) nr, true)) == 0;
  }
  bool operator==(uint nr) const
  {
    return cmp(Longlong_hybrid((longlong) nr, true)) == 0;
  }
  bool operator==(longlong nr) const
  {
    return cmp(Longlong_hybrid(nr, false)) == 0;
  }
  bool operator==(int nr) const
  {
    return cmp(Longlong_hybrid(nr, false)) == 0;
  }
};


class Longlong_hybrid_null: public Longlong_hybrid,
                            public Null_flag
{
public:
  Longlong_hybrid_null(const Longlong_null &nr, bool unsigned_flag)
   :Longlong_hybrid(nr.value(), unsigned_flag),
    Null_flag(nr.is_null())
  { }
};


/*
  Stores the absolute value of a number, and the sign.
  Value range: -ULONGLONG_MAX .. +ULONGLONG_MAX.

  Provides a wider range for negative numbers than Longlong_hybrid does.
  Usefull to store intermediate results of an expression whose value
  is further needed to be negated. For example, these methods:
    - Item_func_mul::int_op()
    - Item_func_int_div::val_int()
    - Item_func_mod::int_op()
  calculate the result of absolute values of the arguments,
  then optionally negate the result.
*/
class ULonglong_hybrid: public ULonglong
{
  bool m_neg;
public:
  ULonglong_hybrid(ulonglong value, bool neg)
   :ULonglong(value), m_neg(neg)
  {
    if (m_neg && !m_value)
      m_neg= false;        // convert -0 to +0
  }
  Longlong_null val_int_unsigned() const
  {
    return m_neg ? Longlong_null(0, true) :
                   Longlong_null((longlong) m_value, false);
  }
  Longlong_null val_int_signed() const
  {
    return m_neg ? -ULonglong(m_value) : ULonglong::to_longlong_null();
  }

  /*
    Return in Item compatible val_int() format:
    - signed numbers as a straight longlong value
    - unsigned numbers as a ulonglong value reinterpreted to longlong
  */
  Longlong_null val_int(bool want_unsigned_value) const
  {
    return want_unsigned_value ? val_int_unsigned() :
                                 val_int_signed();
  }
};


#endif // SQL_TYPE_INT_INCLUDED
server/private/keycaches.h000064400000003713150400263710011636 0ustar00#ifndef KEYCACHES_INCLUDED
#define KEYCACHES_INCLUDED

/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.

   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 "sql_list.h"
#include <keycache.h>
#include <rpl_filter.h>

extern "C"
{
  typedef int (*process_key_cache_t) (const char *, KEY_CACHE *, void *);
}

class NAMED_ILINK;

class NAMED_ILIST: public I_List<NAMED_ILINK>
{
  public:
  void delete_elements(void (*free_element)(const char*, void*));
  bool delete_element(const char *name, size_t length, void (*free_element)(const char*, void*));
};

/* For key cache */
extern LEX_CSTRING default_key_cache_base;
extern KEY_CACHE zero_key_cache;
extern NAMED_ILIST key_caches;

KEY_CACHE *create_key_cache(const char *name, size_t length);
KEY_CACHE *get_key_cache(const LEX_CSTRING *cache_name);
KEY_CACHE *get_or_create_key_cache(const char *name, size_t length);
void free_key_cache(const char *name, void *key_cache);
bool process_key_caches(process_key_cache_t func, void *param);

/* For Rpl_filter */
extern LEX_CSTRING default_rpl_filter_base;
extern NAMED_ILIST rpl_filters;

Rpl_filter *create_rpl_filter(const char *name, size_t length);
Rpl_filter *get_rpl_filter(LEX_CSTRING *filter_name);
Rpl_filter *get_or_create_rpl_filter(const char *name, size_t length);
void free_all_rpl_filters(void);

#endif /* KEYCACHES_INCLUDED */
server/private/sql_update.h000064400000003603150400263710012036 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_UPDATE_INCLUDED
#define SQL_UPDATE_INCLUDED

#include "sql_class.h"                          /* enum_duplicates */

class Item;
struct TABLE_LIST;
class THD;

typedef class st_select_lex SELECT_LEX;
typedef class st_select_lex_unit SELECT_LEX_UNIT;

bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
                          Item **conds, uint order_num, ORDER *order);
bool check_unique_table(THD *thd, TABLE_LIST *table_list);
int mysql_update(THD *thd,TABLE_LIST *tables,List<Item> &fields,
		 List<Item> &values,COND *conds,
		 uint order_num, ORDER *order, ha_rows limit,
                 bool ignore, ha_rows *found_return, ha_rows *updated_return);
bool mysql_multi_update(THD *thd, TABLE_LIST *table_list,
                        List<Item> *fields, List<Item> *values,
                        COND *conds, ulonglong options,
                        enum enum_duplicates handle_duplicates, bool ignore,
                        SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex,
                        multi_update **result);
bool records_are_comparable(const TABLE *table);
bool compare_record(const TABLE *table);

#endif /* SQL_UPDATE_INCLUDED */
server/private/wsrep_priv.h000064400000003142150400263710012073 0ustar00/* Copyright 2010-2023 Codership Oy <http://www.codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA
 */

//! @file declares symbols private to wsrep integration layer

#ifndef WSREP_PRIV_H
#define WSREP_PRIV_H

#include "wsrep_api.h"
#include "wsrep/server_state.hpp"

ssize_t wsrep_sst_prepare   (void** msg);
wsrep_cb_status wsrep_sst_donate_cb (void* app_ctx,
                                     void* recv_ctx,
                                     const wsrep_buf_t* msg,
                                     const wsrep_gtid_t* state_id,
                                     const wsrep_buf_t* state,
                                     bool bypass);

extern wsrep_uuid_t  local_uuid;
extern wsrep_seqno_t local_seqno;

// a helper function
bool wsrep_sst_received(THD*, const wsrep_uuid_t&, wsrep_seqno_t,
                        const void*, size_t);

void wsrep_notify_status(enum wsrep::server_state::state status,
                         const wsrep::view* view= 0);

#endif /* WSREP_PRIV_H */
server/private/pfs_metadata_provider.h000064400000003552150400263710014242 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_METADATA_PROVIDER_H
#define PFS_METADATA_PROVIDER_H

/**
  @file include/pfs_metadata_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_METADATA_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_METADATA_CALL(M) pfs_ ## M ## _v1

C_MODE_START

PSI_metadata_lock* pfs_create_metadata_lock_v1
  (void *identity,
   const MDL_key *key,
   opaque_mdl_type mdl_type,
   opaque_mdl_duration mdl_duration,
   opaque_mdl_status mdl_status,
   const char *src_file,
   uint src_line);

void pfs_set_metadata_lock_status_v1
  (PSI_metadata_lock *lock,
   opaque_mdl_status mdl_status);

void pfs_destroy_metadata_lock_v1(PSI_metadata_lock *lock);

struct PSI_metadata_locker*
pfs_start_metadata_wait_v1
  (struct PSI_metadata_locker_state_v1 *state,
   struct PSI_metadata_lock *mdl,
   const char *src_file, uint src_line);

void pfs_end_metadata_wait_v1
  (struct PSI_metadata_locker *locker, int rc);

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_METADATA_INTERFACE */

#endif

server/private/maria.h000064400000013360150400263710010767 0ustar00/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
   Copyright (c) 2009, 2019, 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; either version 2 of the License, or
   (at your option) any later version.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/* This file should be included when using maria functions */

#ifndef _maria_h
#define _maria_h
#include <my_base.h>
#include <m_ctype.h>
#include "my_compare.h"
#include "ft_global.h"
#include <myisamchk.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define MARIA_UNIQUE_HASH_LENGTH	4
extern my_bool maria_delay_key_write;
uint maria_max_key_length(void);
#define maria_max_key_segments() HA_MAX_KEY_SEG

struct st_maria_bit_buff;
struct st_maria_page;
struct st_maria_s_param;
struct st_maria_share;
typedef struct st_maria_decode_tree  MARIA_DECODE_TREE;
typedef struct st_maria_handler MARIA_HA;
typedef struct st_maria_key MARIA_KEY;
typedef ulonglong MARIA_RECORD_POS;

typedef struct st_maria_keydef          /* Key definition with open & info */
{
  struct st_maria_share *share;         /* Pointer to base (set in open) */
  mysql_rwlock_t root_lock;                  /* locking of tree */
  uint16 keysegs;                       /* Number of key-segment */
  uint16 flag;                          /* NOSAME, PACK_USED */

  uint8 key_alg;                        /* BTREE, RTREE */
  uint8 key_nr;				/* key number (auto) */
  uint16 block_length;                  /* Length of keyblock (auto) */
  uint16 underflow_block_length;        /* When to execute underflow */
  uint16 keylength;                     /* Tot length of keyparts (auto) */
  uint16 minlength;                     /* min length of (packed) key (auto) */
  uint16 maxlength;                     /* max length of (packed) key (auto) */
  uint16 max_store_length;              /* Size to store key + overhead */
  uint32 write_comp_flag;		/* compare flag for write key (auto) */
  uint32 version;                       /* For concurrent read/write */
  uint32 ftkey_nr;                      /* full-text index number */

  HA_KEYSEG *seg, *end;
  struct st_mysql_ftparser *parser;     /* Fulltext [pre]parser */
  int (*bin_search)(const MARIA_KEY *key, const struct st_maria_page *page,
                    uint32 comp_flag, uchar **ret_pos, uchar *buff,
                    my_bool *was_last_key);
  uint (*get_key)(MARIA_KEY *key, uint page_flag, uint nod_flag,
                  uchar **page);
  uchar *(*skip_key)(MARIA_KEY *key, uint page_flag, uint nod_flag,
                     uchar *page);
  int (*pack_key)(const MARIA_KEY *key, uint nod_flag,
		  uchar *next_key, uchar *org_key, uchar *prev_key,
		  struct st_maria_s_param *s_temp);
  void (*store_key)(struct st_maria_keydef *keyinfo, uchar *key_pos,
		    struct st_maria_s_param *s_temp);
  my_bool (*ck_insert)(MARIA_HA *inf, MARIA_KEY *key);
  my_bool (*ck_delete)(MARIA_HA *inf, MARIA_KEY *klen);
  MARIA_KEY *(*make_key)(MARIA_HA *info, MARIA_KEY *int_key, uint keynr,
                         uchar *key, const uchar *record,
                         MARIA_RECORD_POS filepos, ulonglong trid);
} MARIA_KEYDEF;


typedef struct st_maria_unique_def	/* Segment definition of unique */
{
  uint16 keysegs;                       /* Number of key-segment */
  uint8 key;                            /* Mapped to which key */
  uint8 null_are_equal;
  HA_KEYSEG *seg, *end;
} MARIA_UNIQUEDEF;

/*
  Note that null markers should always be first in a row !
  When creating a column, one should only specify:
  type, length, null_bit and null_pos
*/

typedef struct st_maria_columndef		/* column information */
{
  enum en_fieldtype type;
  uint32 offset;				/* Offset to position in row */
  uint16 length;				/* length of field */
  uint16 column_nr;
  /* Intern variable (size of total storage area for the row) */
  uint16 fill_length;
  uint16 null_pos;				/* Position for null marker */
  uint16 empty_pos;                             /* Position for empty marker */
  uint8 null_bit;				/* If column may be NULL */
  /* Intern. Set if column should be zero packed (part of empty_bits) */
  uint8 empty_bit;

#ifndef NOT_PACKED_DATABASES
  void(*unpack)(struct st_maria_columndef *rec,
                struct st_maria_bit_buff *buff,
                uchar *start, uchar *end);
  enum en_fieldtype base_type;
  uint space_length_bits, pack_type;
  MARIA_DECODE_TREE *huff_tree;
#endif
} MARIA_COLUMNDEF;


typedef struct st_maria_create_info
{
  const char *index_file_name, *data_file_name; /* If using symlinks */
  ha_rows max_rows;
  ha_rows reloc_rows;
  ulonglong auto_increment;
  ulonglong data_file_length;
  ulonglong key_file_length;
  ulong s3_block_size;
  /* Size of null bitmap at start of row */
  uint null_bytes;
  uint old_options;
  uint compression_algorithm;
  enum data_file_type org_data_file_type;
  uint16 language;
  my_bool with_auto_increment, transactional, encrypted;
} MARIA_CREATE_INFO;

extern int maria_create(const char *name, enum data_file_type record_type,
                        uint keys, MARIA_KEYDEF *keydef,
                        uint columns, MARIA_COLUMNDEF *columndef,
                        uint uniques, MARIA_UNIQUEDEF *uniquedef,
                        MARIA_CREATE_INFO *create_info, uint flags);

#ifdef	__cplusplus
}
#endif
#endif

server/private/sql_union.h000064400000002050150400263710011677 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_UNION_INCLUDED
#define SQL_UNION_INCLUDED

class THD;
class select_result;
struct LEX;

typedef class st_select_lex_unit SELECT_LEX_UNIT;

bool mysql_union(THD *thd, LEX *lex, select_result *result,
                 SELECT_LEX_UNIT *unit, ulong setup_tables_done_option);


#endif /* SQL_UNION_INCLUDED */
server/private/spatial.h000064400000053441150400263710011337 0ustar00/*
   Copyright (c) 2002, 2013, Oracle and/or its affiliates.
   Copyright (c) 2009, 2013, Monty Program Ab.

   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 */

#ifndef _spatial_h
#define _spatial_h

#include "sql_string.h"                         /* String, LEX_STRING */
#include <my_compiler.h>
#include <json_lib.h>

#ifdef HAVE_SPATIAL

class Gis_read_stream;

#include "gcalc_tools.h"

const uint SRID_SIZE= 4;
const uint SIZEOF_STORED_DOUBLE= 8;
const uint POINT_DATA_SIZE= (SIZEOF_STORED_DOUBLE * 2); 
const uint WKB_HEADER_SIZE= 1+4;
const uint32 GET_SIZE_ERROR= ((uint32) -1);

struct st_point_2d
{
  double x;
  double y;
};

struct st_linear_ring
{
  uint32 n_points;
  st_point_2d points;
};

/***************************** MBR *******************************/


/*
  It's ok that a lot of the functions are inline as these are only used once
  in MySQL
*/

struct MBR
{
  double xmin, ymin, xmax, ymax;

  MBR()
  {
    xmin= ymin= DBL_MAX;
    xmax= ymax= -DBL_MAX;
  }

  MBR(const double xmin_arg, const double ymin_arg,
      const double xmax_arg, const double ymax_arg)
    :xmin(xmin_arg), ymin(ymin_arg), xmax(xmax_arg), ymax(ymax_arg)
  {}

  MBR(const st_point_2d &min, const st_point_2d &max)
    :xmin(min.x), ymin(min.y), xmax(max.x), ymax(max.y)
  {}

  MBR(const MBR &mbr1, const MBR &mbr2)
    :xmin(mbr1.xmin), ymin(mbr1.ymin), xmax(mbr1.xmax), ymax(mbr1.ymax)
  { add_mbr(&mbr2); }

  inline void add_xy(double x, double y)
  {
    /* Not using "else" for proper one point MBR calculation */
    if (x < xmin)
      xmin= x;
    if (x > xmax)
      xmax= x;
    if (y < ymin)
      ymin= y;
    if (y > ymax)
      ymax= y;
  }
  void add_xy(const char *px, const char *py)
  {
    double x, y;
    float8get(x, px);
    float8get(y, py);
    add_xy(x,y);
  }
  void add_mbr(const MBR *mbr)
  {
    if (mbr->xmin < xmin)
      xmin= mbr->xmin;
    if (mbr->xmax > xmax)
      xmax= mbr->xmax;
    if (mbr->ymin < ymin)
      ymin= mbr->ymin;
    if (mbr->ymax > ymax)
      ymax= mbr->ymax;
  }
  void buffer(double d)
  {
    xmin-= d;
    ymin-= d;
    xmax+= d;
    ymax+= d;
  }

  int equals(const MBR *mbr)
  {
    /* The following should be safe, even if we compare doubles */
    return ((mbr->xmin == xmin) && (mbr->ymin == ymin) &&
	    (mbr->xmax == xmax) && (mbr->ymax == ymax));
  }

  int disjoint(const MBR *mbr)
  {
    /* The following should be safe, even if we compare doubles */
    return ((mbr->xmin > xmax) || (mbr->ymin > ymax) ||
	    (mbr->xmax < xmin) || (mbr->ymax < ymin));
  }

  int intersects(const MBR *mbr)
  {
    return !disjoint(mbr);
  }

  int touches(const MBR *mbr)
  {
    /* The following should be safe, even if we compare doubles */
    return ((mbr->xmin == xmax || mbr->xmax == xmin) &&
            ((mbr->ymin >= ymin && mbr->ymin <= ymax) ||
             (mbr->ymax >= ymin && mbr->ymax <= ymax))) ||
           ((mbr->ymin == ymax || mbr->ymax == ymin) &&
            ((mbr->xmin >= xmin && mbr->xmin <= xmax) ||
             (mbr->xmax >= xmin && mbr->xmax <= xmax)));
  }

  int within(const MBR *mbr);

  int contains(const MBR *mbr)
  {
    /* The following should be safe, even if we compare doubles */
    return ((mbr->xmin >= xmin) && (mbr->ymin >= ymin) &&
	    (mbr->xmax <= xmax) && (mbr->ymax <= ymax));
  }

  bool inner_point(double x, double y) const
  {
    /* The following should be safe, even if we compare doubles */
    return (xmin<x) && (xmax>x) && (ymin<y) && (ymax>y);
  }

  /**
    The dimension maps to an integer as:
    - Polygon -> 2
    - Horizontal or vertical line -> 1
    - Point -> 0
    - Invalid MBR -> -1
  */
  int dimension() const
  {
    int d= 0;

    if (xmin > xmax)
      return -1;
    else if (xmin < xmax)
      d++;

    if (ymin > ymax)
      return -1;
    else if (ymin < ymax)
      d++;

    return d;
  }

  int overlaps(const MBR *mbr)
  {
    /*
      overlaps() requires that some point inside *this is also inside
      *mbr, and that both geometries and their intersection are of the
      same dimension.
    */
    int d = dimension();

    if (d != mbr->dimension() || d <= 0 || contains(mbr) || within(mbr))
      return 0;

    MBR intersection(MY_MAX(xmin, mbr->xmin), MY_MAX(ymin, mbr->ymin),
                     MY_MIN(xmax, mbr->xmax), MY_MIN(ymax, mbr->ymax));

    return (d == intersection.dimension());
  }

  int valid() const
  { return xmin <= xmax && ymin <= ymax; }
};


/***************************** Geometry *******************************/

struct Geometry_buffer;

class Geometry
{
public:
  Geometry() = default;                              /* Remove gcc warning */
  virtual ~Geometry() = default;                     /* Remove gcc warning */
  static void *operator new(size_t size, void *buffer)
  {
    return buffer;
  }

  static void operator delete(void *ptr, void *buffer)
  {}

  static void operator delete(void *buffer)
  {}

  enum wkbType
  {
    wkb_point= 1,
    wkb_linestring= 2,
    wkb_polygon= 3,
    wkb_multipoint= 4,
    wkb_multilinestring= 5,
    wkb_multipolygon= 6,
    wkb_geometrycollection= 7,
    wkb_last=7
  };
  enum wkbByteOrder
  {
    wkb_xdr= 0,    /* Big Endian */
    wkb_ndr= 1     /* Little Endian */
  };
  enum geojson_errors
  {
    GEOJ_INCORRECT_GEOJSON= 1,
    GEOJ_TOO_FEW_POINTS= 2,
    GEOJ_POLYGON_NOT_CLOSED= 3,
    GEOJ_DIMENSION_NOT_SUPPORTED= 4,
    GEOJ_EMPTY_COORDINATES= 5,
  };


  /** Callback which creates Geometry objects on top of a given placement. */
  typedef Geometry *(*create_geom_t)(char *);

  class Class_info
  {
  public:
    LEX_STRING m_name;
    LEX_STRING m_geojson_name;
    int m_type_id;
    create_geom_t m_create_func;
    Class_info(const char *name, const char *gejson_name,
               int type_id, create_geom_t create_func);
  };

  virtual const Class_info *get_class_info() const=0;
  virtual uint32 get_data_size() const=0;
  virtual bool init_from_wkt(Gis_read_stream *trs, String *wkb)=0;
  /* returns the length of the wkb that was read */
  virtual uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
                             String *res)=0;
  virtual uint init_from_opresult(String *bin,
                                  const char *opres, uint res_len)
  { return init_from_wkb(opres + 4, UINT_MAX32, wkb_ndr, bin) + 4; }
  virtual bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb)
  { return true; }

  virtual bool get_data_as_wkt(String *txt, const char **end) const=0;
  virtual bool get_data_as_json(String *txt, uint max_dec_digits,
                                const char **end) const=0;
  virtual bool get_mbr(MBR *mbr, const char **end) const=0;
  virtual bool dimension(uint32 *dim, const char **end) const=0;
  virtual int get_x(double *x) const { return -1; }
  virtual int get_y(double *y) const { return -1; }
  virtual int geom_length(double *len, const char **end) const  { return -1; }
  virtual int area(double *ar, const char **end) const { return -1;}
  virtual int is_closed(int *closed) const { return -1; }
  virtual int num_interior_ring(uint32 *n_int_rings) const { return -1; }
  virtual int num_points(uint32 *n_points) const { return -1; }
  virtual int num_geometries(uint32 *num) const { return -1; }
  virtual int start_point(String *point) const { return -1; }
  virtual int end_point(String *point) const { return -1; }
  virtual int exterior_ring(String *ring) const { return -1; }
  virtual int centroid(String *point) const { return -1; }
  virtual int point_n(uint32 num, String *result) const { return -1; }
  virtual int interior_ring_n(uint32 num, String *result) const { return -1; }
  virtual int geometry_n(uint32 num, String *result) const { return -1; }
  virtual int store_shapes(Gcalc_shape_transporter *trn) const=0;

public:
  static Geometry *create_by_typeid(Geometry_buffer *buffer, int type_id);

  static Geometry *construct(Geometry_buffer *buffer,
                             const char *data, uint32 data_len);
  static Geometry *create_from_wkt(Geometry_buffer *buffer,
				   Gis_read_stream *trs, String *wkt,
				   bool init_stream=1);
  static Geometry *create_from_wkb(Geometry_buffer *buffer,
                                   const char *wkb, uint32 len, String *res);
  static Geometry *create_from_json(Geometry_buffer *buffer, json_engine_t *je,
                                    bool er_on_3D, String *res);
  static Geometry *create_from_opresult(Geometry_buffer *g_buf,
                                  String *res, Gcalc_result_receiver &rr);
  static uint get_key_image_itMBR(LEX_CSTRING &src, uchar *buff, uint length);
  int as_wkt(String *wkt, const char **end);
  int as_json(String *wkt, uint max_dec_digits, const char **end);
  int bbox_as_json(String *wkt);

  inline void set_data_ptr(const char *data, uint32 data_len)
  {
    m_data= data;
    m_data_end= data + data_len;
  }

  inline void shift_wkb_header()
  {
    m_data+= WKB_HEADER_SIZE;
  }

  const char *get_data_ptr() const
  {
    return m_data;
  }

  bool envelope(String *result) const;
  static Class_info *ci_collection[wkb_last+1];

  static bool create_point(String *result, double x, double y);
protected:
  static Class_info *find_class(int type_id)
  {
    return ((type_id < wkb_point) || (type_id > wkb_last)) ?
      NULL : ci_collection[type_id];
  }  
  static Class_info *find_class(const char *name, size_t len);
  const char *append_points(String *txt, uint32 n_points,
			    const char *data, uint32 offset) const;
  bool create_point(String *result, const char *data) const;
  const char *get_mbr_for_points(MBR *mbr, const char *data, uint offset)
    const;

public:
  /**
     Check if there're enough data remaining as requested

     @arg cur_data     pointer to the position in the binary form
     @arg data_amount  number of points expected
     @return           true if not enough data
  */
  inline bool no_data(const char *cur_data, size_t data_amount) const
  {
    return (cur_data + data_amount > m_data_end);
  }

  /**
     Check if there're enough points remaining as requested

     Need to perform the calculation in logical units, since multiplication
     can overflow the size data type.

     @arg data              pointer to the beginning of the points array
     @arg expected_points   number of points expected
     @arg extra_point_space extra space for each point element in the array
     @return               true if there are not enough points
  */
  inline bool not_enough_points(const char *data, uint32 expected_points,
                                uint32 extra_point_space = 0) const
  {
    return (m_data_end < data ||
            (expected_points > ((m_data_end - data) /
                                (POINT_DATA_SIZE + extra_point_space))));
  }
protected:
  const char *m_data;
  const char *m_data_end;
};


/***************************** Point *******************************/
 
class Gis_point: public Geometry
{
public:
  Gis_point() = default;                              /* Remove gcc warning */
  virtual ~Gis_point() = default;                     /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  
  int get_xy(double *x, double *y) const
  {
    const char *data= m_data;
    if (no_data(data, SIZEOF_STORED_DOUBLE * 2))
      return 1;
    float8get(*x, data);
    float8get(*y, data + SIZEOF_STORED_DOUBLE);
    return 0;
  }

  int get_xy_radian(double *x, double *y) const
  {
    if (!get_xy(x, y))
    {
      *x= (*x)*M_PI/180;
      *y= (*y)*M_PI/180;
      return 0;
    }
    return 1;
  }

  int get_x(double *x) const override
  {
    if (no_data(m_data, SIZEOF_STORED_DOUBLE))
      return 1;
    float8get(*x, m_data);
    return 0;
  }

  int get_y(double *y) const override
  {
    const char *data= m_data;
    if (no_data(data, SIZEOF_STORED_DOUBLE * 2)) return 1;
    float8get(*y, data + SIZEOF_STORED_DOUBLE);
    return 0;
  }

  int geom_length(double *len, const char **end) const override;
  int area(double *ar, const char **end) const override;
  bool dimension(uint32 *dim, const char **end) const override
  {
    *dim= 0;
    *end= 0;					/* No default end */
    return 0;
  }
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
  double calculate_haversine(const Geometry *g, const double sphere_radius,
                             int *error);
  int spherical_distance_multipoints(Geometry *g, const double r, double *result,
                                     int *error);
};


/***************************** LineString *******************************/

class Gis_line_string: public Geometry
{
public:
  Gis_line_string() = default;                        /* Remove gcc warning */
  virtual ~Gis_line_string() = default;               /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  int geom_length(double *len, const char **end) const override;
  int area(double *ar, const char **end) const override;
  int is_closed(int *closed) const override;
  int num_points(uint32 *n_points) const override;
  int start_point(String *point) const override;
  int end_point(String *point) const override;
  int point_n(uint32 n, String *result) const override;
  bool dimension(uint32 *dim, const char **end) const override
  {
    *dim= 1;
    *end= 0;					/* No default end */
    return 0;
  }
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
};


/***************************** Polygon *******************************/

class Gis_polygon: public Geometry
{
public:
  Gis_polygon() = default;                            /* Remove gcc warning */
  virtual ~Gis_polygon() = default;                   /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  uint init_from_opresult(String *bin, const char *opres, uint res_len) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  int area(double *ar, const char **end) const override;
  int exterior_ring(String *result) const override;
  int num_interior_ring(uint32 *n_int_rings) const override;
  int interior_ring_n(uint32 num, String *result) const override;
  int centroid_xy(double *x, double *y) const;
  int centroid(String *result) const override;
  bool dimension(uint32 *dim, const char **end) const override
  {
    *dim= 2;
    *end= 0;					/* No default end */
    return 0;
  }
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
};


/***************************** MultiPoint *******************************/

class Gis_multi_point: public Geometry
{
  // Maximum number of points in MultiPoint that can fit into String
  static const uint32 max_n_points=
    (uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
    (WKB_HEADER_SIZE + POINT_DATA_SIZE);
public:
  Gis_multi_point() = default;                        /* Remove gcc warning */
  virtual ~Gis_multi_point() = default;               /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  uint init_from_opresult(String *bin, const char *opres, uint res_len) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  int num_geometries(uint32 *num) const override;
  int geometry_n(uint32 num, String *result) const override;
  bool dimension(uint32 *dim, const char **end) const override
  {
    *dim= 0;
    *end= 0;					/* No default end */
    return 0;
  }
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
  int spherical_distance_multipoints(Geometry *g, const double r, double *res,
                                     int *error);
};


/***************************** MultiLineString *******************************/

class Gis_multi_line_string: public Geometry
{
public:
  Gis_multi_line_string() = default;                  /* Remove gcc warning */
  virtual ~Gis_multi_line_string() = default;         /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  uint init_from_opresult(String *bin, const char *opres, uint res_len) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  int num_geometries(uint32 *num) const override;
  int geometry_n(uint32 num, String *result) const override;
  int geom_length(double *len, const char **end) const override;
  int is_closed(int *closed) const override;
  bool dimension(uint32 *dim, const char **end) const override
  {
    *dim= 1;
    *end= 0;					/* No default end */
    return 0;
  }
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
};


/***************************** MultiPolygon *******************************/

class Gis_multi_polygon: public Geometry
{
public:
  Gis_multi_polygon() = default;                      /* Remove gcc warning */
  virtual ~Gis_multi_polygon() = default;             /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  int num_geometries(uint32 *num) const override;
  int geometry_n(uint32 num, String *result) const override;
  int area(double *ar, const char **end) const override;
  int centroid(String *result) const override;
  bool dimension(uint32 *dim, const char **end) const override
  {
    *dim= 2;
    *end= 0;					/* No default end */
    return 0;
  }
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
  uint init_from_opresult(String *bin, const char *opres, uint res_len) override;
};


/*********************** GeometryCollection *******************************/

class Gis_geometry_collection: public Geometry
{
public:
  Gis_geometry_collection() = default;                /* Remove gcc warning */
  virtual ~Gis_geometry_collection() = default;       /* Remove gcc warning */
  uint32 get_data_size() const override;
  bool init_from_wkt(Gis_read_stream *trs, String *wkb) override;
  uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override;
  uint init_from_opresult(String *bin, const char *opres, uint res_len) override;
  bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override;
  bool get_data_as_wkt(String *txt, const char **end) const override;
  bool get_data_as_json(String *txt, uint max_dec_digits,
                        const char **end) const override;
  bool get_mbr(MBR *mbr, const char **end) const override;
  int area(double *ar, const char **end) const override;
  int geom_length(double *len, const char **end) const override;
  int num_geometries(uint32 *num) const override;
  int geometry_n(uint32 num, String *result) const override;
  bool dimension(uint32 *dim, const char **end) const override;
  int store_shapes(Gcalc_shape_transporter *trn) const override;
  const Class_info *get_class_info() const override;
};

struct Geometry_buffer : public
  my_aligned_storage<sizeof(Gis_point), MY_ALIGNOF(Gis_point)> {};

#endif /*HAVE_SPATIAL*/
#endif
server/private/field.h000064400000656377150400263710011006 0ustar00#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
   Copyright (c) 2008, 2021, 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 */

/*
  Because of the function make_new_field() all field classes that have static
  variables must declare the size_of() member function.
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "mysqld.h"                             /* system_charset_info */
#include "table.h"                              /* TABLE */
#include "sql_string.h"                         /* String */
#include "my_decimal.h"                         /* my_decimal */
#include "sql_error.h"                          /* Sql_condition */
#include "compat56.h"
#include "sql_type.h"                           /* Type_std_attributes */
#include "field_comp.h"

class Send_field;
class Copy_field;
class Protocol;
class Protocol_text;
class Create_field;
class Relay_log_info;
class Field;
class Column_statistics;
class Column_statistics_collected;
class Item_func;
class Item_bool_func;
class Item_equal;
class Virtual_tmp_table;
class Qualified_column_ident;
class Table_ident;
class SEL_ARG;
class RANGE_OPT_PARAM;
struct KEY_PART;
struct SORT_FIELD;
struct SORT_FIELD_ATTR;

enum enum_check_fields
{
  CHECK_FIELD_IGNORE,
  CHECK_FIELD_EXPRESSION,
  CHECK_FIELD_WARN,
  CHECK_FIELD_ERROR_FOR_NULL,
};

enum ignore_value_reaction
{
  IGNORE_MEANS_ERROR,
  IGNORE_MEANS_DEFAULT,
  IGNORE_MEANS_FIELD_VALUE
};

ignore_value_reaction find_ignore_reaction(THD *thd);


enum enum_conv_type
{
  CONV_TYPE_PRECISE,
  CONV_TYPE_VARIANT,
  CONV_TYPE_SUBSET_TO_SUPERSET,
  CONV_TYPE_SUPERSET_TO_SUBSET,
  CONV_TYPE_IMPOSSIBLE
};


class Conv_param
{
  uint16 m_table_def_flags;
public:
  Conv_param(uint16 table_def_flags)
   :m_table_def_flags(table_def_flags)
  { }
  uint16 table_def_flags() const { return m_table_def_flags; }
};


class Conv_source: public Type_handler_hybrid_field_type
{
  uint16 m_metadata;
  CHARSET_INFO *m_cs;
public:
  Conv_source(const Type_handler *h, uint16 metadata, CHARSET_INFO *cs)
   :Type_handler_hybrid_field_type(h),
    m_metadata(metadata),
    m_cs(cs)
  {
    DBUG_ASSERT(cs);
  }
  uint16 metadata() const { return m_metadata; }
  uint mbmaxlen() const { return m_cs->mbmaxlen; }
};


/*
  Common declarations for Field and Item
*/
class Value_source
{
protected:

  // Parameters for warning and note generation
  class Warn_filter
  {
    bool m_want_warning_edom;
    bool m_want_note_truncated_spaces;
  public:
    Warn_filter(bool want_warning_edom, bool want_note_truncated_spaces) :
     m_want_warning_edom(want_warning_edom),
     m_want_note_truncated_spaces(want_note_truncated_spaces)
    { }
    Warn_filter(const THD *thd);
    bool want_warning_edom() const
    { return m_want_warning_edom; }
    bool want_note_truncated_spaces() const
    { return m_want_note_truncated_spaces; }
  };
  class Warn_filter_all: public Warn_filter
  {
  public:
    Warn_filter_all() :Warn_filter(true, true) { }
  };

  class Converter_double_to_longlong
  {
  protected:
    bool m_error;
    longlong m_result;
  public:
    Converter_double_to_longlong(double nr, bool unsigned_flag);
    longlong result() const { return m_result; }
    bool error() const { return m_error; }
    void push_warning(THD *thd, double nr, bool unsigned_flag);
  };
  class Converter_double_to_longlong_with_warn:
    public Converter_double_to_longlong
  {
  public:
    Converter_double_to_longlong_with_warn(THD *thd, double nr,
                                           bool unsigned_flag)
      :Converter_double_to_longlong(nr, unsigned_flag)
    {
      if (m_error)
        push_warning(thd, nr, unsigned_flag);
    }
    Converter_double_to_longlong_with_warn(double nr, bool unsigned_flag)
      :Converter_double_to_longlong(nr, unsigned_flag)
    {
      if (m_error)
        push_warning(current_thd, nr, unsigned_flag);
    }
  };

  // String-to-number converters
  class Converter_string_to_number
  {
  protected:
    char *m_end_of_num; // Where the low-level conversion routine stopped
    int m_error;        // The error code returned by the low-level routine
    bool m_edom;        // If EDOM-alike error happened during conversion
    /**
      Check string-to-number conversion and produce a warning if
      - could not convert any digits (EDOM-alike error)
      - found garbage at the end of the string
      - found extra spaces at the end (a note)
      See also Field_num::check_edom_and_truncation() for a similar function.

      @param thd         - the thread that will be used to generate warnings.
                           Can be NULL (which means current_thd will be used
                           if a warning is really necessary).
      @param type        - name of the data type
                           (e.g. "INTEGER", "DECIMAL", "DOUBLE")
      @param cs          - character set of the original string
      @param str         - the original string
      @param end         - the end of the string
      @param allow_notes - tells if trailing space notes should be displayed
                           or suppressed.

      Unlike Field_num::check_edom_and_truncation(), this function does not
      distinguish between EDOM and truncation and reports the same warning for
      both cases. Perhaps we should eventually print different warnings,
      to make the explicit CAST work closer to the implicit cast in
      Field_xxx::store().
    */
    void check_edom_and_truncation(THD *thd, Warn_filter filter,
                                   const char *type,
                                   CHARSET_INFO *cs,
                                   const char *str,
                                   size_t length) const;
  public:
    int error() const { return m_error; }
  };

  class Converter_strntod: public Converter_string_to_number
  {
    double m_result;
  public:
    Converter_strntod(CHARSET_INFO *cs, const char *str, size_t length)
    {
      m_result= cs->strntod((char *) str, length, &m_end_of_num, &m_error);
      // strntod() does not set an error if the input string was empty
      m_edom= m_error !=0 || str == m_end_of_num;
    }
    double result() const { return m_result; }
  };

  class Converter_string_to_longlong: public Converter_string_to_number
  {
  protected:
    longlong m_result;
  public:
    longlong result() const { return m_result; }
  };

  class Converter_strntoll: public Converter_string_to_longlong
  {
  public:
    Converter_strntoll(CHARSET_INFO *cs, const char *str, size_t length)
    {
      m_result= cs->strntoll(str, length, 10, &m_end_of_num, &m_error);
      /*
         All non-zero errors means EDOM error.
         strntoll() does not set an error if the input string was empty.
         Check it here.
         Notice the different with the same condition in Converter_strntoll10.
      */
      m_edom= m_error != 0 || str == m_end_of_num;
    }
  };

  class Converter_strtoll10: public Converter_string_to_longlong
  {
  public:
    Converter_strtoll10(CHARSET_INFO *cs, const char *str, size_t length)
    {
      m_end_of_num= (char *) str + length;
      m_result= cs->strtoll10(str, &m_end_of_num, &m_error);
      /*
        Negative error means "good negative number".
        Only a positive m_error value means a real error.
        strtoll10() sets error to MY_ERRNO_EDOM in case of an empty string,
        so we don't have to additionally catch empty strings here.
      */
      m_edom= m_error > 0;
    }
  };

  class Converter_str2my_decimal: public Converter_string_to_number
  {
  public:
    Converter_str2my_decimal(uint mask,
                             CHARSET_INFO *cs, const char *str, size_t length,
                             my_decimal *buf)
    {
      DBUG_ASSERT(length < UINT_MAX32);
      m_error= str2my_decimal(mask, str, length, cs,
                              buf, (const char **) &m_end_of_num);
      // E_DEC_TRUNCATED means a very minor truncation: '1e-100' -> 0
      m_edom= m_error && m_error != E_DEC_TRUNCATED;
    }
  };


  // String-to-number converters with automatic warning generation
  class Converter_strntod_with_warn: public Converter_strntod
  {
  public:
    Converter_strntod_with_warn(THD *thd, Warn_filter filter,
                                CHARSET_INFO *cs,
                                const char *str, size_t length)
      :Converter_strntod(cs, str, length)
    {
      check_edom_and_truncation(thd, filter, "DOUBLE", cs, str, length);
    }
  };

  class Converter_strntoll_with_warn: public Converter_strntoll
  {
  public:
    Converter_strntoll_with_warn(THD *thd, Warn_filter filter,
                                 CHARSET_INFO *cs,
                                 const char *str, size_t length)
      :Converter_strntoll(cs, str, length)
    {
      check_edom_and_truncation(thd, filter, "INTEGER", cs, str, length);
    }
  };

  class Converter_strtoll10_with_warn: public Converter_strtoll10
  {
  public:
    Converter_strtoll10_with_warn(THD *thd, Warn_filter filter,
                                 CHARSET_INFO *cs,
                                 const char *str, size_t length)
      :Converter_strtoll10(cs, str, length)
    {
      check_edom_and_truncation(thd, filter, "INTEGER", cs, str, length);
    }
  };

  class Converter_str2my_decimal_with_warn: public Converter_str2my_decimal
  {
  public:
    Converter_str2my_decimal_with_warn(THD *thd, Warn_filter filter,
                                       uint mask, CHARSET_INFO *cs,
                                       const char *str, size_t length,
                                       my_decimal *buf)
     :Converter_str2my_decimal(mask, cs, str, length, buf)
    {
      check_edom_and_truncation(thd, filter, "DECIMAL", cs, str, length);
    }
  };


  // String-to-number conversion methods for the old code compatibility
  longlong longlong_from_string_with_check(CHARSET_INFO *cs, const char *cptr,
                                           const char *end) const
  {
    /*
      TODO: Give error if we wanted a signed integer and we got an unsigned
      one

      Notice, longlong_from_string_with_check() honors thd->no_error, because
      it's used to handle queries like this:
        SELECT COUNT(@@basedir);
      and is called when Item_func_get_system_var::update_null_value()
      suppresses warnings and then calls val_int().
      The other methods {double|decimal}_from_string_with_check() ignore
      thd->no_errors, because they are not used for update_null_value()
      and they always allow all kind of warnings.
    */
    THD *thd= current_thd;
    return Converter_strtoll10_with_warn(thd, Warn_filter(thd),
                                         cs, cptr, end - cptr).result();
  }

  double double_from_string_with_check(CHARSET_INFO *cs, const char *cptr,
                                       const char *end) const
  {
    return Converter_strntod_with_warn(NULL, Warn_filter_all(),
                                       cs, cptr, end - cptr).result();
  }
  my_decimal *decimal_from_string_with_check(my_decimal *decimal_value,
                                             CHARSET_INFO *cs,
                                             const char *cptr,
                                             const char *end)
  {
    Converter_str2my_decimal_with_warn(NULL, Warn_filter_all(),
                                       E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
                                       cs, cptr, end - cptr, decimal_value);
    return decimal_value;
  }

  longlong longlong_from_hex_hybrid(const char *str, size_t length)
  {
    const char *end= str + length;
    const char *ptr= end - MY_MIN(length, sizeof(longlong));
    ulonglong value= 0;
    for ( ; ptr != end ; ptr++)
      value= (value << 8) + (ulonglong) (uchar) *ptr;
    return (longlong) value;
  }

  longlong longlong_from_string_with_check(const String *str) const
  {
    return longlong_from_string_with_check(str->charset(),
                                           str->ptr(), str->end());
  }
  double double_from_string_with_check(const String *str) const
  {
    return double_from_string_with_check(str->charset(),
                                         str->ptr(), str->end());
  }
  my_decimal *decimal_from_string_with_check(my_decimal *decimal_value,
                                             const String *str)
  {
    return decimal_from_string_with_check(decimal_value, str->charset(),
                                          str->ptr(), str->end());
  }
  // End of String-to-number conversion methods

public:
  /*
    The enumeration Subst_constraint is currently used only in implementations
    of the virtual function subst_argument_checker.
  */
  enum Subst_constraint
  {
    ANY_SUBST,           /* Any substitution for a field is allowed  */
    IDENTITY_SUBST       /* Substitution for a field is allowed if any two
                            different values of the field type are not equal */
  };
  /*
    Item context attributes.
    Comparison functions pass their attributes to propagate_equal_fields().
    For example, for string comparison, the collation of the comparison
    operation is important inside propagate_equal_fields().
  */
  class Context
  {
    /*
      Which type of propagation is allowed:
      - ANY_SUBST (loose equality, according to the collation), or
      - IDENTITY_SUBST (strict binary equality).
    */
    Subst_constraint m_subst_constraint;
    /*
      Comparison type.
      Important only when ANY_SUBSTS.
    */
    const Type_handler *m_compare_handler;
    /*
      Collation of the comparison operation.
      Important only when ANY_SUBST.
    */
    CHARSET_INFO *m_compare_collation;
  public:
    Context(Subst_constraint subst, const Type_handler *h, CHARSET_INFO *cs)
      :m_subst_constraint(subst),
       m_compare_handler(h),
       m_compare_collation(cs)
    { DBUG_ASSERT(h == h->type_handler_for_comparison()); }
    Subst_constraint subst_constraint() const { return m_subst_constraint; }
    const Type_handler *compare_type_handler() const
    {
      DBUG_ASSERT(m_subst_constraint == ANY_SUBST);
      return m_compare_handler;
    }
    CHARSET_INFO *compare_collation() const
    {
      DBUG_ASSERT(m_subst_constraint == ANY_SUBST);
      return m_compare_collation;
    }
  };
  class Context_identity: public Context
  { // Use this to request only exact value, no invariants.
  public:
     Context_identity()
      :Context(IDENTITY_SUBST, &type_handler_long_blob, &my_charset_bin) { }
  };
  class Context_boolean: public Context
  { // Use this when an item is [a part of] a boolean expression
  public:
    Context_boolean()
      :Context(ANY_SUBST, &type_handler_slonglong, &my_charset_bin) { }
  };
};


#define STORAGE_TYPE_MASK 7
#define COLUMN_FORMAT_MASK 7
#define COLUMN_FORMAT_SHIFT 3

/* The length of the header part for each virtual column in the .frm file */
#define FRM_VCOL_OLD_HEADER_SIZE(b) (3 + MY_TEST(b))
#define FRM_VCOL_NEW_BASE_SIZE 16
#define FRM_VCOL_NEW_HEADER_SIZE 6

class Count_distinct_field;

struct ha_field_option_struct;

struct st_cache_field;
int field_conv(Field *to,Field *from);
int truncate_double(double *nr, uint field_length, decimal_digits_t dec,
                    bool unsigned_flag, double max_value);

inline uint get_enum_pack_length(int elements)
{
  return elements < 256 ? 1 : 2;
}

inline uint get_set_pack_length(int elements)
{
  uint len= (elements + 7) / 8;
  return len > 4 ? 8 : len;
}


/**
  Tests if field type is temporal and has date part,
  i.e. represents DATE, DATETIME or TIMESTAMP types in SQL.

  @param type    Field type, as returned by field->type().
  @retval true   If field type is temporal type with date part.
  @retval false  If field type is not temporal type with date part.
*/
inline bool is_temporal_type_with_date(enum_field_types type)
{
  switch (type)
  {
  case MYSQL_TYPE_DATE:
  case MYSQL_TYPE_DATETIME:
  case MYSQL_TYPE_TIMESTAMP:
    return true;
  case MYSQL_TYPE_DATETIME2:
  case MYSQL_TYPE_TIMESTAMP2:
    DBUG_ASSERT(0); // field->real_type() should not get to here.
    return false;
  default:
    return false;
  }
}


enum enum_vcol_info_type
{
  VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED,
  VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE,
  VCOL_USING_HASH,
  /* Additional types should be added here */

  VCOL_GENERATED_VIRTUAL_INDEXED, // this is never written in .frm
  /* Following is the highest value last   */
  VCOL_TYPE_NONE = 127 // Since the 0 value is already in use
};

static inline const char *vcol_type_name(enum_vcol_info_type type)
{
  switch (type)
  {
  case VCOL_GENERATED_VIRTUAL:
  case VCOL_GENERATED_VIRTUAL_INDEXED:
  case VCOL_GENERATED_STORED:
    return "GENERATED ALWAYS AS";
  case VCOL_DEFAULT:
    return "DEFAULT";
  case VCOL_CHECK_FIELD:
  case VCOL_CHECK_TABLE:
    return "CHECK";
  case VCOL_USING_HASH:
    return "USING HASH";
  case VCOL_TYPE_NONE:
    return "UNTYPED";
  }
  return 0;
}

/*
  Flags for Virtual_column_info. If none is set, the expression must be
  a constant with no side-effects, so it's calculated at CREATE TABLE time,
  stored in table->record[2], and not recalculated for every statement.
*/
#define VCOL_FIELD_REF         1
#define VCOL_NON_DETERMINISTIC 2
#define VCOL_SESSION_FUNC      4  /* uses session data, e.g. USER or DAYNAME */
#define VCOL_TIME_FUNC         8  /* safe for SBR */
#define VCOL_AUTO_INC         16
#define VCOL_IMPOSSIBLE       32
#define VCOL_NEXTVAL          64  /* NEXTVAL is not implemented for vcols */

#define VCOL_NOT_STRICTLY_DETERMINISTIC                       \
  (VCOL_NON_DETERMINISTIC | VCOL_TIME_FUNC | VCOL_SESSION_FUNC)

/*
  Virtual_column_info is the class to contain additional
  characteristics that is specific for a virtual/computed
  field such as:
   - the defining expression that is evaluated to compute the value
  of the field 
  - whether the field is to be stored in the database
  - whether the field is used in a partitioning expression
*/

class Virtual_column_info: public Sql_alloc,
                           private Type_handler_hybrid_field_type
{
private:
  enum_vcol_info_type vcol_type; /* Virtual column expression type */
  /*
    The following data is only updated by the parser and read
    when a Create_field object is created/initialized.
  */
  /* Flag indicating that the field used in a partitioning expression */
  bool in_partitioning_expr;

public:
  /* Flag indicating  that the field is physically stored in the database */
  bool stored_in_db;
  bool utf8;                                    /* Already in utf8 */
  bool automatic_name;
  bool if_not_exists;
  Item *expr;
  Lex_ident name;                               /* Name of constraint */
  /* see VCOL_* (VCOL_FIELD_REF, ...) */
  uint flags;

  Virtual_column_info()
   :Type_handler_hybrid_field_type(&type_handler_null),
    vcol_type((enum_vcol_info_type)VCOL_TYPE_NONE),
    in_partitioning_expr(FALSE), stored_in_db(FALSE),
    utf8(TRUE), automatic_name(FALSE), expr(NULL), flags(0)
  {
    name.str= NULL;
    name.length= 0;
  };
  Virtual_column_info* clone(THD *thd);
  ~Virtual_column_info() = default;
  enum_vcol_info_type get_vcol_type() const
  {
    return vcol_type;
  }
  void set_vcol_type(enum_vcol_info_type v_type)
  {
    vcol_type= v_type;
  }
  const char *get_vcol_type_name() const
  {
    DBUG_ASSERT(vcol_type != VCOL_TYPE_NONE);
    return vcol_type_name(vcol_type);
  }
  void set_handler(const Type_handler *handler)
  {
    /* Calling this function can only be done once. */
    DBUG_ASSERT(type_handler() == &type_handler_null);
    Type_handler_hybrid_field_type::set_handler(handler);
  }
  bool is_stored() const
  {
    return stored_in_db;
  }
  void set_stored_in_db_flag(bool stored)
  {
    stored_in_db= stored;
  }
  bool is_in_partitioning_expr() const
  {
    return in_partitioning_expr;
  }
  void mark_as_in_partitioning_expr()
  {
    in_partitioning_expr= TRUE;
  }
  bool need_refix() const
  {
    return flags & VCOL_SESSION_FUNC;
  }
  bool fix_expr(THD *thd);
  bool fix_session_expr(THD *thd);
  bool cleanup_session_expr();
  bool fix_and_check_expr(THD *thd, TABLE *table);
  inline bool is_equal(const Virtual_column_info* vcol) const;
  /* Same as is_equal() but for comparing with different table */
  bool is_equivalent(THD *thd, TABLE_SHARE *share, TABLE_SHARE *vcol_share,
                            const Virtual_column_info* vcol, bool &error) const;
  inline void print(String*);
};

class Binlog_type_info
{
public:
   enum binlog_sign_t
   {
     SIGN_SIGNED,
     SIGN_UNSIGNED,
     SIGN_NOT_APPLICABLE // for non-numeric types
   };
  /**
     Retrieve the field metadata for fields.
  */
   CHARSET_INFO *m_cs; // NULL if not relevant
   TYPELIB *m_enum_typelib; // NULL if not relevant
   TYPELIB *m_set_typelib; // NULL if not relevant
   binlog_sign_t m_signedness;
   uint16 m_metadata;
   uint8 m_metadata_size;
   uchar m_type_code;     // according to Field::binlog_type()
   uchar m_geom_type; // Non-geometry fields can return 0

   Binlog_type_info(uchar type_code,
                    uint16 metadata,
                    uint8 metadata_size)
    :m_cs(NULL),
     m_enum_typelib(NULL),
     m_set_typelib(NULL),
     m_signedness(SIGN_NOT_APPLICABLE),
     m_metadata(metadata),
     m_metadata_size(metadata_size),
     m_type_code(type_code),
     m_geom_type(0)
    {};
   Binlog_type_info(uchar type_code, uint16 metadata,
                   uint8 metadata_size,
                   binlog_sign_t signedness)
    : m_cs(NULL),
     m_enum_typelib(NULL),
     m_set_typelib(NULL),
     m_signedness(signedness),
     m_metadata(metadata),
     m_metadata_size(metadata_size),
     m_type_code(type_code),
     m_geom_type(0)
    {};
   Binlog_type_info(uchar type_code, uint16 metadata,
                   uint8 metadata_size, CHARSET_INFO *cs)
    :m_cs(cs),
     m_enum_typelib(NULL),
     m_set_typelib(NULL),
     m_signedness(SIGN_NOT_APPLICABLE),
     m_metadata(metadata),
     m_metadata_size(metadata_size),
     m_type_code(type_code),
     m_geom_type(0)
    {};
   Binlog_type_info(uchar type_code, uint16 metadata,
                   uint8 metadata_size,
                   CHARSET_INFO *cs,
                   TYPELIB *t_enum, TYPELIB *t_set)
    :m_cs(cs),
     m_enum_typelib(t_enum),
     m_set_typelib(t_set),
     m_signedness(SIGN_NOT_APPLICABLE),
     m_metadata(metadata),
     m_metadata_size(metadata_size),
     m_type_code(type_code),
     m_geom_type(0)
    {};
   Binlog_type_info(uchar type_code, uint16 metadata,
                   uint8 metadata_size, CHARSET_INFO *cs,
                   uchar geom_type)
    :m_cs(cs),
     m_enum_typelib(NULL),
     m_set_typelib(NULL),
     m_signedness(SIGN_NOT_APPLICABLE),
     m_metadata(metadata),
     m_metadata_size(metadata_size),
     m_type_code(type_code),
     m_geom_type(geom_type)
    {};
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
};


class Binlog_type_info_fixed_string: public Binlog_type_info
{
public:
  Binlog_type_info_fixed_string(uchar type_code,
                                uint32 octet_length,
                                CHARSET_INFO *cs);
};


class Field: public Value_source
{
  Field(const Item &);				/* Prevent use of these */
  void operator=(Field &);
protected:
  int save_in_field_str(Field *to)
  {
    StringBuffer<MAX_FIELD_WIDTH> result(charset());
    val_str(&result);
    return to->store(result.ptr(), result.length(), charset());
  }
  void error_generated_column_function_is_not_allowed(THD *thd, bool error)
                                                      const;
  static void do_field_eq(Copy_field *copy);
  static void do_field_int(Copy_field *copy);
  static void do_field_real(Copy_field *copy);
  static void do_field_string(Copy_field *copy);
  static void do_field_date(Copy_field *copy);
  static void do_field_temporal(Copy_field *copy, date_mode_t fuzzydate);
  static void do_field_datetime(Copy_field *copy);
  static void do_field_timestamp(Copy_field *copy);
  static void do_field_decimal(Copy_field *copy);
public:
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void *operator new(size_t size) throw ()
  {
    DBUG_ASSERT(size < UINT_MAX32);
    return thd_alloc(current_thd, (uint) size);
  }
  static void operator delete(void *ptr_arg, size_t size) { TRASH_FREE(ptr_arg, size); }
  static void operator delete(void *ptr, MEM_ROOT *mem_root)
  { DBUG_ASSERT(0); }

  bool marked_for_read() const;
  bool marked_for_write_or_computed() const;

  /**
     Used by System Versioning.
   */
  virtual void set_max()
  { DBUG_ASSERT(0); }
  virtual bool is_max()
  { DBUG_ASSERT(0); return false; }

  uchar		*ptr;			// Position to field in record

  /**
     Byte where the @c NULL bit is stored inside a record. If this Field is a
     @c NOT @c NULL field, this member is @c NULL.
  */
  uchar		*null_ptr;
  /*
    Note that you can use table->in_use as replacement for current_thd member
    only inside of val_*() and store() members (e.g. you can't use it in cons)
  */
  TABLE *table;                                 // Pointer for table
  TABLE *orig_table;                            // Pointer to original table
  const char * const *table_name;               // Pointer to alias in TABLE
  LEX_CSTRING field_name;
  LEX_CSTRING comment;
  /** reference to the list of options or NULL */
  engine_option_value *option_list;
  ha_field_option_struct *option_struct;   /* structure with parsed options */
  /* Field is part of the following keys */
  key_map	key_start, part_of_key, part_of_key_not_clustered;

  /*
    Bitmap of indexes that have records ordered by col1, ... this_field, ...

    For example, INDEX (col(prefix_n)) is not present in col.part_of_sortkey.
  */
  key_map       part_of_sortkey;
  /*
    We use three additional unireg types for TIMESTAMP to overcome limitation
    of current binary format of .frm file. We'd like to be able to support
    NOW() as default and on update value for such fields but unable to hold
    this info anywhere except unireg_check field. This issue will be resolved
    in more clean way with transition to new text based .frm format.
    See also comment for Field_timestamp::Field_timestamp().
  */
  enum __attribute__((packed)) utype  {
    NONE=0,
    NEXT_NUMBER=15,             // AUTO_INCREMENT
    TIMESTAMP_OLD_FIELD=18,     // TIMESTAMP created before 4.1.3
    TIMESTAMP_DN_FIELD=21,      // TIMESTAMP DEFAULT NOW()
    TIMESTAMP_UN_FIELD=22,      // TIMESTAMP ON UPDATE NOW()
    TIMESTAMP_DNUN_FIELD=23,    // TIMESTAMP DEFAULT NOW() ON UPDATE NOW()
    TMYSQL_COMPRESSED= 24,      // Compatibility with TMySQL
    };
  enum imagetype { itRAW, itMBR};

  utype	unireg_check;
  field_visibility_t invisible;
  uint32        field_length;          // Length of field
  uint32        flags;
  field_index_t field_index;           // field number in fields array
  uchar null_bit;                      // Bit used to test null bit

  /**
     If true, this field was created in create_tmp_field_from_item from a NULL
     value. This means that the type of the field is just a guess, and the type
     may be freely coerced to another type.

     @see create_tmp_field_from_item
     @see Item_type_holder::get_real_type

   */
  bool is_created_from_null_item;

  /* 
    Selectivity of the range condition over this field.
    When calculating this selectivity a range predicate
    is taken into account only if:
    - it is extracted from the WHERE clause
    - it depends only on the table the field belongs to 
  */
  double cond_selectivity;

  /* 
    The next field in the class of equal fields at the top AND level
    of the WHERE clause
  */ 
  Field *next_equal_field;

  /*
    This structure is used for statistical data on the column
    that has been read from the statistical table column_stat
  */ 
  Column_statistics *read_stats;
  /*
    This structure is used for statistical data on the column that
    is collected by the function collect_statistics_for_table
  */
  Column_statistics_collected *collected_stats;

  /* 
    This is additional data provided for any computed(virtual) field,
    default function or check constraint.
    In particular it includes a pointer to the item by which this field
    can be computed from other fields.
  */
  Virtual_column_info *vcol_info, *check_constraint, *default_value;

  Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
        uchar null_bit_arg, utype unireg_check_arg,
        const LEX_CSTRING *field_name_arg);
  virtual ~Field() = default;

  virtual Type_numeric_attributes type_numeric_attributes() const
  {
    return Type_numeric_attributes(field_length, decimals(), is_unsigned());
  }
  Type_std_attributes type_std_attributes() const
  {
    return Type_std_attributes(type_numeric_attributes(), dtcollation());
  }

  bool is_unsigned() const { return flags & UNSIGNED_FLAG; }

  /**
    Convenience definition of a copy function returned by
    Field::get_copy_func()
  */
  typedef void Copy_func(Copy_field*);
  virtual Copy_func *get_copy_func(const Field *from) const= 0;
  virtual Copy_func *get_copy_func_to(const Field *to) const
  {
    return to->get_copy_func(this);
  }
  /* Store functions returns 1 on overflow and -1 on fatal error */
  virtual int  store_field(Field *from) { return from->save_in_field(this); }
  virtual int  save_in_field(Field *to)= 0;
  /**
    Check if it is possible just copy the value
    of the field 'from' to the field 'this', e.g. for
      INSERT INTO t1 (field1) SELECT field2 FROM t2;
    @param from   - The field to copy from
    @retval true  - it is possible to just copy value of 'from' to 'this'
    @retval false - conversion is needed
  */
  virtual bool memcpy_field_possible(const Field *from) const= 0;
  virtual bool make_empty_rec_store_default_value(THD *thd, Item *item);
  virtual void make_empty_rec_reset(THD *thd)
  {
    reset();
  }
  virtual int  store(const char *to, size_t length,CHARSET_INFO *cs)=0;
  /*
    This is used by engines like CSV and Federated to signal the field
    that the data is going to be in text (rather than binary) representation,
    even if cs points to &my_charset_bin.

    If a Field distinguishes between text and binary formats (e.g. INET6),
    we cannot call store(str,length,&my_charset_bin),
    to avoid "field" mis-interpreting the data format as binary.
  */
  virtual int  store_text(const char *to, size_t length, CHARSET_INFO *cs)
  {
    return store(to, length, cs);
  }
  virtual int  store_binary(const char *to, size_t length)
  {
    return store(to, length, &my_charset_bin);
  }
  virtual int  store_hex_hybrid(const char *str, size_t length);
  virtual int  store(double nr)=0;
  virtual int  store(longlong nr, bool unsigned_val)=0;
  virtual int  store_decimal(const my_decimal *d)=0;
  virtual int  store_time_dec(const MYSQL_TIME *ltime, uint dec);
  virtual int  store_timestamp_dec(const timeval &ts, uint dec);
  int store_timestamp(my_time_t timestamp, ulong sec_part)
  {
    return store_timestamp_dec(Timeval(timestamp, sec_part),
                               TIME_SECOND_PART_DIGITS);
  }
  /**
    Store a value represented in native format
  */
  virtual int store_native(const Native &value)
  {
    DBUG_ASSERT(0);
    reset();
    return 0;
  }
  int store_time(const MYSQL_TIME *ltime)
  { return store_time_dec(ltime, TIME_SECOND_PART_DIGITS); }
  int store(const char *to, size_t length, CHARSET_INFO *cs,
            enum_check_fields check_level);
  int store_text(const char *to, size_t length, CHARSET_INFO *cs,
                 enum_check_fields check_level);
  int store(const LEX_STRING *ls, CHARSET_INFO *cs)
  {
    DBUG_ASSERT(ls->length < UINT_MAX32);
    return store(ls->str, (uint) ls->length, cs);
  }
  int store(const LEX_CSTRING *ls, CHARSET_INFO *cs)
  {
    DBUG_ASSERT(ls->length < UINT_MAX32);
    return store(ls->str, (uint) ls->length, cs);
  }
  int store(const LEX_CSTRING &ls, CHARSET_INFO *cs)
  {
    DBUG_ASSERT(ls.length < UINT_MAX32);
    return store(ls.str, (uint) ls.length, cs);
  }

  /*
    @brief
      Store minimum/maximum value of a column in the statistics table.
    @param
      field                  statistical table field
      str                    value buffer
  */
  virtual int store_to_statistical_minmax_field(Field *field, String *str);

  /*
    @brief
      Store minimum/maximum value of a column from the statistical table.
    @param
      field                  statistical table field
      str                    value buffer
  */
  virtual int store_from_statistical_minmax_field(Field *field, String *str,
                                                  MEM_ROOT *mem);

#ifdef HAVE_MEM_CHECK
  /**
    Mark unused memory in the field as defined. Mainly used to ensure
    that if we write full field to disk (for example in
    Count_distinct_field::add(), we don't write unitalized data to
    disk which would confuse valgrind or MSAN.
  */
  virtual void mark_unused_memory_as_defined() {}
#else
  void mark_unused_memory_as_defined() {}
#endif

  virtual double val_real()=0;
  virtual longlong val_int()=0;
  /*
    Get ulonglong representation.
    Negative values are truncated to 0.
  */
  virtual ulonglong val_uint(void)
  {
    longlong nr= val_int();
    return nr < 0 ? 0 : (ulonglong) nr;
  }
  virtual bool val_bool()= 0;
  virtual my_decimal *val_decimal(my_decimal *)=0;
  inline String *val_str(String *str) { return val_str(str, str); }
  /*
     val_str(buf1, buf2) gets two buffers and should use them as follows:
     if it needs a temp buffer to convert result to string - use buf1
       example Field_tiny::val_str()
     if the value exists as a string already - use buf2
       example Field_string::val_str()
     consequently, buf2 may be created as 'String buf;' - no memory
     will be allocated for it. buf1 will be allocated to hold a
     value if it's too small. Using allocated buffer for buf2 may result in
     an unnecessary free (and later, may be an alloc).
     This trickery is used to decrease a number of malloc calls.
  */
  virtual String *val_str(String*,String *)=0;
  virtual bool val_native(Native *to)
  {
    DBUG_ASSERT(!is_null());
    return to->copy((const char *) ptr, pack_length());
  }
  String *val_int_as_str(String *val_buffer, bool unsigned_flag);
  /*
    Return the field value as a LEX_CSTRING, without padding to full length
    (MODE_PAD_CHAR_TO_FULL_LENGTH is temporarily suppressed during the call).

    In case of an empty value, to[0] is assigned to empty_clex_string,
    memory is not allocated.
    In case of a non-empty value, the memory is allocated on mem_root.
    In case of a memory allocation failure, to[0] is assigned to {NULL,0}.

    @param  [IN] mem_root  store non-empty values here
    @param  [OUT to        return the string here
    @retval                false (success)
    @retval                true  (EOM)
  */
  bool val_str_nopad(MEM_ROOT *mem_root, LEX_CSTRING *to);
  fast_field_copier get_fast_field_copier(const Field *from);
  /*
   str_needs_quotes() returns TRUE if the value returned by val_str() needs
   to be quoted when used in constructing an SQL query.
  */
  virtual bool str_needs_quotes() const { return false; }
  const Type_handler *type_handler_for_comparison() const
  {
    return type_handler()->type_handler_for_comparison();
  }
  Item_result result_type () const
  {
    return type_handler()->result_type();
  }
  Item_result cmp_type () const
  {
    return type_handler()->cmp_type();
  }
  virtual bool eq(Field *field)
  {
    return (ptr == field->ptr && null_ptr == field->null_ptr &&
            null_bit == field->null_bit && field->type() == type());
  }
  virtual bool eq_def(const Field *field) const;
  
  /*
    pack_length() returns size (in bytes) used to store field data in memory
    (i.e. it returns the maximum size of the field in a row of the table,
    which is located in RAM).
  */
  virtual uint32 pack_length() const { return (uint32) field_length; }

  /*
    pack_length_in_rec() returns size (in bytes) used to store field data on
    storage (i.e. it returns the maximal size of the field in a row of the
    table, which is located on disk).
  */
  virtual uint32 pack_length_in_rec() const { return pack_length(); }
  virtual bool compatible_field_size(uint metadata, const Relay_log_info *rli,
                                     uint16 mflags, int *order) const;
  virtual uint pack_length_from_metadata(uint field_metadata) const
  {
    DBUG_ENTER("Field::pack_length_from_metadata");
    DBUG_RETURN(field_metadata);
  }
  virtual uint row_pack_length() const { return 0; }

  /*
    data_length() return the "real size" of the data in memory.
  */
  virtual uint32 data_length() { return pack_length(); }
  virtual uint32 sort_length() const { return pack_length(); }

  /*
    sort_suffix_length() return the length bytes needed to store the length
    for binary charset
  */
  virtual uint32 sort_suffix_length() const { return 0; }

  /* 
    Get the number bytes occupied by the value in the field.
    CHAR values are stripped of trailing spaces.
    Flexible values are stripped of their length.
  */
  virtual uint32 value_length()
  {
    uint len;
    if (!zero_pack() &&
	(type() == MYSQL_TYPE_STRING &&
        (len= pack_length()) >= 4 && len < 256))
    {
      uchar *str, *end;
      for (str= ptr, end= str+len; end > str && end[-1] == ' '; end--) {}
      len=(uint) (end-str); 
      return len;
    } 
    return data_length();
  }

  /**
     Get the maximum size of the data in packed format.

     @return Maximum data length of the field when packed using the
     Field::pack() function.
   */
  virtual uint32 max_data_length() const {
    return pack_length();
  };

  virtual int reset() { bzero(ptr,pack_length()); return 0; }
  virtual void reset_fields() {}
  const uchar *ptr_in_record(const uchar *record) const
  {
    my_ptrdiff_t l_offset= (my_ptrdiff_t) (ptr -  table->record[0]);
    DBUG_ASSERT(l_offset >= 0 && table->s->rec_buff_length - l_offset > 0);
    return record + l_offset;
  }
  virtual int set_default();

  bool has_update_default_function() const
  {
    return flags & ON_UPDATE_NOW_FLAG;
  }
  bool has_default_now_unireg_check() const
  {
    return unireg_check == TIMESTAMP_DN_FIELD
        || unireg_check == TIMESTAMP_DNUN_FIELD;
  }

  /*
    Mark the field as having a value supplied by the client, thus it should
    not be auto-updated.
  */
  void set_has_explicit_value()
  {
    bitmap_set_bit(&table->has_value_set, field_index);
  }
  bool has_explicit_value()
  {
    return bitmap_is_set(&table->has_value_set, field_index);
  }
  void clear_has_explicit_value()
  {
    bitmap_clear_bit(&table->has_value_set, field_index);
  }

  virtual my_time_t get_timestamp(const uchar *pos, ulong *sec_part) const
  { DBUG_ASSERT(0); return 0; }
  my_time_t get_timestamp(ulong *sec_part) const
  {
    return get_timestamp(ptr, sec_part);
  }

  virtual bool binary() const { return 1; }
  virtual bool zero_pack() const { return 1; }
  virtual enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
  virtual uint16 key_part_flag() const { return 0; }
  virtual uint16 key_part_length_bytes() const { return 0; }
  virtual uint32 key_length() const { return pack_length(); }
  virtual const Type_handler *type_handler() const = 0;
  virtual enum_field_types type() const
  {
    return type_handler()->field_type();
  }
  virtual enum_field_types real_type() const
  {
    return type_handler()->real_field_type();
  }
  virtual enum_field_types binlog_type() const
  {
    /*
      Binlog stores field->type() as type code by default. For example,
      it puts MYSQL_TYPE_STRING in case of CHAR, VARCHAR, SET and ENUM,
      with extra data type details put into metadata.

      Binlog behaviour slightly differs between various MySQL and MariaDB
      versions for the temporal data types TIME, DATETIME and TIMESTAMP.

      MySQL prior to 5.6 uses MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME 
      and MYSQL_TYPE_TIMESTAMP type codes in binlog and stores no 
      additional metadata.

      MariaDB-5.3 implements new versions for TIME, DATATIME, TIMESTAMP
      with fractional second precision, but uses the old format for the
      types TIME(0), DATETIME(0), TIMESTAMP(0), and it still stores
      MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME and MYSQL_TYPE_TIMESTAMP in binlog,
      with no additional metadata.
      So row-based replication between temporal data types of
      different precision is not possible in MariaDB.

      MySQL-5.6 also implements a new version of TIME, DATETIME, TIMESTAMP
      which support fractional second precision 0..6, and use the new
      format even for the types TIME(0), DATETIME(0), TIMESTAMP(0).
      For these new data types, MySQL-5.6 stores new type codes 
      MYSQL_TYPE_TIME2, MYSQL_TYPE_DATETIME2, MYSQL_TYPE_TIMESTAMP2 in binlog,
      with fractional precision 0..6 put into metadata.
      This makes it in theory possible to do row-based replication between
      columns of different fractional precision (e.g. from TIME(1) on master
      to TIME(6) on slave). However, it's not currently fully implemented yet.
      MySQL-5.6 can only do row-based replication from the old types
      TIME, DATETIME, TIMESTAMP (represented by MYSQL_TYPE_TIME,
      MYSQL_TYPE_DATETIME and MYSQL_TYPE_TIMESTAMP type codes in binlog)
      to the new corresponding types TIME(0), DATETIME(0), TIMESTAMP(0).

      Note: MariaDB starting from the version 10.0 understands the new
      MySQL-5.6 type codes MYSQL_TYPE_TIME2, MYSQL_TYPE_DATETIME2,
      MYSQL_TYPE_TIMESTAMP2. When started over MySQL-5.6 tables both on
      master and on slave, MariaDB-10.0 can also do row-based replication
      from the old types TIME, DATETIME, TIMESTAMP to the new MySQL-5.6
      types TIME(0), DATETIME(0), TIMESTAMP(0).

      Note: perhaps binlog should eventually be modified to store
      real_type() instead of type() for all column types.
    */
    return type();
  }
  virtual Binlog_type_info binlog_type_info() const
  {
    DBUG_ASSERT(Field::type() == binlog_type());
    return Binlog_type_info(Field::type(), 0, 0);
  }
  virtual en_fieldtype tmp_engine_column_type(bool use_packed_rows) const
  {
    return FIELD_NORMAL;
  }
  /*
    Conversion type for from the source to the current field.
  */
  virtual enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                            const Relay_log_info *rli,
                                            const Conv_param &param)
                                            const= 0;
  enum_conv_type rpl_conv_type_from_same_data_type(uint16 metadata,
                                                   const Relay_log_info *rli,
                                                   const Conv_param &param)
                                                   const;
  inline  int cmp(const uchar *str) const { return cmp(ptr,str); }
  /*
    The following method is used for comparing prefix keys.
    Currently it's only used in partitioning.
  */
  virtual int cmp_prefix(const uchar *a, const uchar *b,
                         size_t prefix_char_len) const
  { return cmp(a, b); }
  virtual int cmp(const uchar *,const uchar *) const=0;
  virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) const
  { return memcmp(a,b,pack_length()); }
  virtual int cmp_offset(my_ptrdiff_t row_offset)
  { return cmp(ptr,ptr+row_offset); }
  virtual int cmp_binary_offset(uint row_offset)
  { return cmp_binary(ptr, ptr+row_offset); };
  virtual int key_cmp(const uchar *a,const uchar *b) const
  { return cmp(a, b); }
  virtual int key_cmp(const uchar *str, uint length) const
  { return cmp(ptr,str); }
  /*
    Update the value m of the 'min_val' field with the current value v
    of this field if force_update is set to TRUE or if v < m.
    Return TRUE if the value has been updated.
  */  
  virtual bool update_min(Field *min_val, bool force_update)
  { 
    bool update_fl= force_update || cmp(ptr, min_val->ptr) < 0;
    if (update_fl)
    {
      min_val->set_notnull();
      memcpy(min_val->ptr, ptr, pack_length());
    }
    return update_fl;
  }
  /*
    Update the value m of the 'max_val' field with the current value v
    of this field if force_update is set to TRUE or if v > m.
    Return TRUE if the value has been updated.
  */  
  virtual bool update_max(Field *max_val, bool force_update)
  { 
    bool update_fl= force_update || cmp(ptr, max_val->ptr) > 0;
    if (update_fl)
    {
      max_val->set_notnull();
      memcpy(max_val->ptr, ptr, pack_length());
    }
    return update_fl;
  }
  virtual void store_field_value(uchar *val, uint len)
  {
     memcpy(ptr, val, len);
  }
  virtual decimal_digits_t decimals() const { return 0; }
  virtual Information_schema_numeric_attributes
            information_schema_numeric_attributes() const
  {
    return Information_schema_numeric_attributes();
  }
  virtual Information_schema_character_attributes
            information_schema_character_attributes() const
  {
    return Information_schema_character_attributes();
  }
  virtual void update_data_type_statistics(Data_type_statistics *st) const
  { }
  /*
    Caller beware: sql_type can change str.Ptr, so check
    ptr() to see if it changed if you are using your own buffer
    in str and restore it with set() if needed
  */
  virtual void sql_type(String &str) const =0;
  virtual void sql_rpl_type(String *str) const { sql_type(*str); }
  virtual uint size_of() const =0;		// For new field
  inline bool is_null(my_ptrdiff_t row_offset= 0) const
  {
    /*
      The table may have been marked as containing only NULL values
      for all fields if it is a NULL-complemented row of an OUTER JOIN
      or if the query is an implicitly grouped query (has aggregate
      functions but no GROUP BY clause) with no qualifying rows. If
      this is the case (in which TABLE::null_row is true), the field
      is considered to be NULL.

      Note that if a table->null_row is set then also all null_bits are
      set for the row.

      In the case of the 'result_field' for GROUP BY, table->null_row might
      refer to the *next* row in the table (when the algorithm is: read the
      next row, see if any of group column values have changed, send the
      result - grouped - row to the client if yes). So, table->null_row might
      be wrong, but such a result_field is always nullable (that's defined by
      original_field->maybe_null()) and we trust its null bit.
    */
    return null_ptr ? null_ptr[row_offset] & null_bit : table->null_row;
  }
  inline bool is_real_null(my_ptrdiff_t row_offset= 0) const
    { return null_ptr && (null_ptr[row_offset] & null_bit); }
  inline bool is_null_in_record(const uchar *record) const
  {
    if (maybe_null_in_table())
      return record[(uint) (null_ptr - table->record[0])] & null_bit;
    return 0;
  }
  inline void set_null(my_ptrdiff_t row_offset= 0)
    { if (null_ptr) null_ptr[row_offset]|= null_bit; }
  inline void set_notnull(my_ptrdiff_t row_offset= 0)
    { if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; }
  inline bool maybe_null(void) const
  { return null_ptr != 0 || table->maybe_null; }
  // Set to NULL on LOAD DATA or LOAD XML
  virtual bool load_data_set_null(THD *thd);
  // Reset when a LOAD DATA file ended unexpectedly
  virtual bool load_data_set_no_data(THD *thd, bool fixed_format);
  void load_data_set_value(const char *pos, uint length, CHARSET_INFO *cs);

  /* @return true if this field is NULL-able (even if temporarily) */
  inline bool real_maybe_null() const { return null_ptr != 0; }
  uint null_offset(const uchar *record) const
  { return (uint) (null_ptr - record); }
  /*
    For a NULL-able field (that can actually store a NULL value in a table)
    null_ptr points to the "null bitmap" in the table->record[0] header. For
    NOT NULL fields it is either 0 or points outside table->record[0] into the
    table->triggers->extra_null_bitmap (so that the field can store a NULL
    value temporarily, only in memory)
  */
  bool maybe_null_in_table() const
  { return null_ptr >= table->record[0] && null_ptr <= ptr; }

  uint null_offset() const
  { return null_offset(table->record[0]); }
  void set_null_ptr(uchar *p_null_ptr, uint p_null_bit)
  {
    null_ptr= p_null_ptr;
    null_bit= static_cast<uchar>(p_null_bit);
  }

  bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; }
  bool check_vcol_sql_mode_dependency(THD *, vcol_init_mode mode) const;

  virtual sql_mode_t value_depends_on_sql_mode() const
  {
    return 0;
  }
  virtual sql_mode_t conversion_depends_on_sql_mode(THD *thd,
                                                    Item *expr) const
  {
    return (sql_mode_t) 0;
  }
  virtual sql_mode_t can_handle_sql_mode_dependency_on_store() const
  {
    return 0;
  }

  inline THD *get_thd() const
  { return likely(table) ? table->in_use : current_thd; }

  enum {
    LAST_NULL_BYTE_UNDEF= 0
  };

  /*
    Find the position of the last null byte for the field.

    SYNOPSIS
      last_null_byte()

    DESCRIPTION
      Return a pointer to the last byte of the null bytes where the
      field conceptually is placed.

    RETURN VALUE
      The position of the last null byte relative to the beginning of
      the record. If the field does not use any bits of the null
      bytes, the value 0 (LAST_NULL_BYTE_UNDEF) is returned.
   */
  size_t last_null_byte() const {
    size_t bytes= do_last_null_byte();
    DBUG_PRINT("debug", ("last_null_byte() ==> %ld", (long) bytes));
    DBUG_ASSERT(bytes <= table->s->null_bytes);
    return bytes;
  }

  /*
    Create mem-comparable sort key part for a sort key
  */
  void make_sort_key_part(uchar *buff, uint length);

  /*
    create a compact sort key which can be compared with a comparison
    function. They are called packed sort keys
  */
  virtual uint make_packed_sort_key_part(uchar *buff,
                                         const SORT_FIELD_ATTR *sort_field);

  virtual void make_send_field(Send_field *);

  /*
    Some implementations actually may write up to 8 bytes regardless of what
    size was requested. This is due to the minimum value of the system variable
    max_sort_length.
  */

  virtual void sort_string(uchar *buff,uint length)=0;
  virtual bool optimize_range(uint idx, uint part) const;
  virtual void free() {}
  virtual Field *make_new_field(MEM_ROOT *root, TABLE *new_table,
                                bool keep_type);
  virtual Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                               uchar *new_ptr, uint32 length,
                               uchar *new_null_ptr, uint new_null_bit);
  Field *create_tmp_field(MEM_ROOT *root, TABLE *new_table,
                          bool maybe_null_arg);
  Field *create_tmp_field(MEM_ROOT *root, TABLE *new_table)
  {
    return create_tmp_field(root, new_table, maybe_null());
  }
  Field *clone(MEM_ROOT *mem_root, TABLE *new_table);
  Field *clone(MEM_ROOT *mem_root, TABLE *new_table, my_ptrdiff_t diff);
  inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
  {
    ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
  }
  inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; }
  inline uchar *record_ptr() // record[0] or wherever the field was moved to
  {
    my_ptrdiff_t offset= table->s->field[field_index]->ptr - table->s->default_values;
    return ptr - offset;
  }
  virtual void move_field_offset(my_ptrdiff_t ptr_diff)
  {
    ptr=ADD_TO_PTR(ptr,ptr_diff, uchar*);
    if (null_ptr)
      null_ptr=ADD_TO_PTR(null_ptr,ptr_diff,uchar*);
  }
  void get_image(uchar *buff, uint length, CHARSET_INFO *cs) const
  { get_image(buff, length, ptr, cs); }
  virtual void get_image(uchar *buff, uint length,
                         const uchar *ptr_arg, CHARSET_INFO *cs) const
    { memcpy(buff,ptr_arg,length); }
  virtual void set_image(const uchar *buff,uint length, CHARSET_INFO *cs)
    { memcpy(ptr,buff,length); }


  /*
    Copy a field part into an output buffer.

    SYNOPSIS
      Field::get_key_image()
      buff   [out] output buffer
      length       output buffer size
      type         itMBR for geometry blobs, otherwise itRAW

    DESCRIPTION
      This function makes a copy of field part of size equal to or
      less than "length" parameter value.
      For fields of string types (CHAR, VARCHAR, TEXT) the rest of buffer
      is padded by zero byte.

    NOTES
      For variable length character fields (i.e. UTF-8) the "length"
      parameter means a number of output buffer bytes as if all field
      characters have maximal possible size (mbmaxlen). In the other words,
      "length" parameter is a number of characters multiplied by
      field_charset->mbmaxlen.

    RETURN
      Number of copied bytes (excluding padded zero bytes -- see above).
  */

  uint get_key_image(uchar *buff, uint length, imagetype type_arg) const
  { return get_key_image(buff, length, ptr, type_arg); }
  virtual uint get_key_image(uchar *buff, uint length, const uchar *ptr_arg, imagetype type_arg) const
  {
    get_image(buff, length, ptr_arg, &my_charset_bin);
    return length;
  }
  virtual void set_key_image(const uchar *buff,uint length)
    { set_image(buff,length, &my_charset_bin); }
  inline longlong val_int_offset(uint row_offset)
    {
      ptr+=row_offset;
      longlong tmp=val_int();
      ptr-=row_offset;
      return tmp;
    }
  inline longlong val_int(const uchar *new_ptr)
  {
    uchar *old_ptr= ptr;
    longlong return_value;
    ptr= (uchar*) new_ptr;
    return_value= val_int();
    ptr= old_ptr;
    return return_value;
  }
  inline String *val_str(String *str, const uchar *new_ptr)
  {
    uchar *old_ptr= ptr;
    ptr= (uchar*) new_ptr;
    val_str(str);
    ptr= old_ptr;
    return str;
  }
  virtual bool send(Protocol *protocol);

  virtual uchar *pack(uchar *to, const uchar *from, uint max_length);
  /**
     @overload Field::pack(uchar*, const uchar*, uint, bool)
  */
  uchar *pack(uchar *to, const uchar *from)
  {
    DBUG_ENTER("Field::pack");
    uchar *result= this->pack(to, from, UINT_MAX);
    DBUG_RETURN(result);
  }

  virtual const uchar *unpack(uchar* to, const uchar *from,
                              const uchar *from_end, uint param_data=0);

  virtual uint packed_col_length(const uchar *to, uint length)
  { return length;}
  virtual uint max_packed_col_length(uint max_length)
  { return max_length;}
  virtual bool is_packable() const { return false; }

  uint offset(const uchar *record) const
  {
    return (uint) (ptr - record);
  }
  void copy_from_tmp(int offset);
  uint fill_cache_field(struct st_cache_field *copy);
  virtual bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate);
  virtual longlong val_datetime_packed(THD *thd);
  virtual longlong val_time_packed(THD *thd);
  virtual const TYPELIB *get_typelib() const { return NULL; }
  virtual CHARSET_INFO *charset() const= 0;
  /* returns TRUE if the new charset differs. */
  virtual void change_charset(const DTCollation &new_cs) {}
  virtual const DTCollation &dtcollation() const= 0;
  virtual CHARSET_INFO *charset_for_protocol(void) const
  { return binary() ? &my_charset_bin : charset(); }
  virtual CHARSET_INFO *sort_charset(void) const { return charset(); }
  virtual bool has_charset(void) const { return FALSE; }
  virtual int set_time() { return 1; }
  bool set_warning(Sql_condition::enum_warning_level, unsigned int code,
                   int cuted_increment, ulong current_row=0) const;
  virtual void print_key_value(String *out, uint32 length);
  void print_key_part_value(String *out, const uchar *key, uint32 length);
  void print_key_value_binary(String *out, const uchar* key, uint32 length);
  void raise_note_cannot_use_key_part(THD *thd, uint keynr, uint part,
                                      const LEX_CSTRING &op,
                                      CHARSET_INFO *op_collation,
                                      Item *value,
                                      const Data_type_compatibility reason)
                                      const;
  void raise_note_key_become_unused(THD *thd, const String &expr) const;
protected:
  bool set_warning(unsigned int code, int cuted_increment) const
  {
    return set_warning(Sql_condition::WARN_LEVEL_WARN, code, cuted_increment);
  }
  bool set_note(unsigned int code, int cuted_increment) const
  {
    return set_warning(Sql_condition::WARN_LEVEL_NOTE, code, cuted_increment);
  }
  void set_datetime_warning(Sql_condition::enum_warning_level, uint code,
                            const ErrConv *str, const char *typestr,
                            int cuted_increment) const;
  void set_datetime_warning(uint code,
                            const ErrConv *str, const char *typestr,
                            int cuted_increment) const
  {
    set_datetime_warning(Sql_condition::WARN_LEVEL_WARN, code, str, typestr,
                         cuted_increment);
  }
  void set_warning_truncated_wrong_value(const char *type, const char *value);
  inline bool check_overflow(int op_result)
  {
    return (op_result == E_DEC_OVERFLOW);
  }
  int warn_if_overflow(int op_result);
  Copy_func *get_identical_copy_func() const;
  bool cmp_is_done_using_type_handler_of_this(const Item_bool_func *cond,
                                              const Item *item) const;
  Data_type_compatibility can_optimize_scalar_range(
                                 const RANGE_OPT_PARAM *param,
                                 const KEY_PART *key_part,
                                 const Item_bool_func *cond,
                                 scalar_comparison_op op,
                                 Item *value) const;
  uchar *make_key_image(MEM_ROOT *mem_root, const KEY_PART *key_part);
  SEL_ARG *get_mm_leaf_int(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                           const Item_bool_func *cond,
                           scalar_comparison_op op, Item *value,
                           bool unsigned_field);
  /*
    Make a leaf tree for the cases when the value was stored
    to the field exactly, without any truncation, rounding or adjustments.
    For example, if we stored an INT value into an INT column,
    and value->save_in_field_no_warnings() returned 0,
    we know that the value was stored exactly.
  */
  SEL_ARG *stored_field_make_mm_leaf_exact(RANGE_OPT_PARAM *param,
                                           KEY_PART *key_part,
                                           scalar_comparison_op op,
                                           Item *value);
  /*
    Make a leaf tree for the cases when we don't know if
    the value was stored to the field without any data loss,
    or was modified to a smaller or a greater value.
    Used for the data types whose methods Field::store*()
    silently adjust the value. This is the most typical case.
  */
  SEL_ARG *stored_field_make_mm_leaf(RANGE_OPT_PARAM *param,
                                     KEY_PART *key_part,
                                     scalar_comparison_op op, Item *value);
  /*
    Make a leaf tree when an INT value was stored into a field of INT type,
    and some truncation happened. Tries to adjust the range search condition
    when possible, e.g. "tinytint < 300" -> "tinyint <= 127".
    Can also return SEL_ARG_IMPOSSIBLE(), and NULL (not sargable).
  */
  SEL_ARG *stored_field_make_mm_leaf_bounded_int(RANGE_OPT_PARAM *param,
                                                 KEY_PART *key_part,
                                                 scalar_comparison_op op,
                                                 Item *value,
                                                 bool unsigned_field);
  /*
    Make a leaf tree when some truncation happened during
    value->save_in_field_no_warning(this), and we cannot yet adjust the range
    search condition for the current combination of the field and the value
    data types.
    Returns SEL_ARG_IMPOSSIBLE() for "=" and "<=>".
    Returns NULL (not sargable) for other comparison operations.
  */
  SEL_ARG *stored_field_make_mm_leaf_truncated(RANGE_OPT_PARAM *prm,
                                               scalar_comparison_op,
                                               Item *value);
public:
  void set_table_name(String *alias)
  {
    table_name= &alias->Ptr;
  }
  void init(TABLE *table_arg)
  {
    orig_table= table= table_arg;
    set_table_name(&table_arg->alias);
  }
  virtual void init_for_tmp_table(Field *org_field, TABLE *new_table)
  {
    init(new_table);
    orig_table= org_field->orig_table;
    vcol_info= 0;
    cond_selectivity= 1.0;
    next_equal_field= NULL;
    option_list= NULL;
    option_struct= NULL;
    if (org_field->type() == MYSQL_TYPE_VAR_STRING ||
        org_field->type() == MYSQL_TYPE_VARCHAR)
      new_table->s->db_create_options|= HA_OPTION_PACK_RECORD;
  }
  void init_for_make_new_field(TABLE *new_table_arg, TABLE *orig_table_arg)
  {
    init(new_table_arg);
    /*
      Normally orig_table is different from table only if field was
      created via ::make_new_field.  Here we alter the type of field,
      so ::make_new_field is not applicable. But we still need to
      preserve the original field metadata for the client-server
      protocol.
    */
    orig_table= orig_table_arg;
  }

  /* maximum possible display length */
  virtual uint32 max_display_length() const= 0;
  /**
    Whether a field being created has the samle type.
    Used by the ALTER TABLE
  */
  virtual bool is_equal(const Column_definition &new_field) const= 0;
  /* convert decimal to longlong with overflow check */
  longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag,
                                    int *err);
  /*
    Maximum number of bytes in character representation.
    - For string types it is equal to the field capacity, in bytes.
    - For non-string types it represents the longest possible string length
      after conversion to string.
  */
  virtual uint32 character_octet_length() const
  {
    return field_length;
  }
  /* The max. number of characters */
  virtual uint32 char_length() const
  {
    return field_length / charset()->mbmaxlen;
  }

  ha_storage_media field_storage_type() const
  {
    return (ha_storage_media)
      ((flags >> FIELD_FLAGS_STORAGE_MEDIA) & 3);
  }

  void set_storage_type(ha_storage_media storage_type_arg)
  {
    DBUG_ASSERT(field_storage_type() == HA_SM_DEFAULT);
    flags |= static_cast<uint32>(storage_type_arg) <<
      FIELD_FLAGS_STORAGE_MEDIA;
  }

  column_format_type column_format() const
  {
    return (column_format_type)
      ((flags >> FIELD_FLAGS_COLUMN_FORMAT) & 3);
  }

  void set_column_format(column_format_type column_format_arg)
  {
    DBUG_ASSERT(column_format() == COLUMN_FORMAT_TYPE_DEFAULT);
    flags |= static_cast<uint32>(column_format_arg) <<
      FIELD_FLAGS_COLUMN_FORMAT;
  }

  bool vers_sys_field() const
  {
    return flags & (VERS_ROW_START | VERS_ROW_END);
  }

  bool vers_sys_start() const
  {
    return flags & VERS_ROW_START;
  }

  bool vers_sys_end() const
  {
    return flags & VERS_ROW_END;
  }

  bool vers_update_unversioned() const
  {
    return flags & VERS_UPDATE_UNVERSIONED_FLAG;
  }

  /*
    Validate a non-null field value stored in the given record
    according to the current thread settings, e.g. sql_mode.
    @param thd     - the thread
    @param record  - the record to check in
  */
  virtual bool validate_value_in_record(THD *thd, const uchar *record) const
  { return false; }
  bool validate_value_in_record_with_warn(THD *thd, const uchar *record);
  key_map get_possible_keys();

  /* Hash value */
  void hash(Hasher *hasher)
  {
    if (is_null())
      hasher->add_null();
    else
      hash_not_null(hasher);
  }
  virtual void hash_not_null(Hasher *hasher);

  /**
    Get the upper limit of the MySQL integral and floating-point type.

    @return maximum allowed value for the field
  */
  virtual ulonglong get_max_int_value() const
  {
    DBUG_ASSERT(false);
    return 0ULL;
  }

/**
  Checks whether a string field is part of write_set.

  @return
    FALSE  - If field is not char/varchar/....
           - If field is char/varchar/.. and is not part of write set.
    TRUE   - If field is char/varchar/.. and is part of write set.
*/
  virtual bool is_varchar_and_in_write_set() const { return FALSE; }

  /* Check whether the field can be used as a join attribute in hash join */
  virtual bool hash_join_is_possible() { return TRUE; }
  virtual bool eq_cmp_as_binary() { return TRUE; }

  /* Position of the field value within the interval of [min, max] */
  virtual double pos_in_interval(Field *min, Field *max)
  {
    return (double) 0.5; 
  }

  /*
    Check if comparison between the field and an item unambiguously
    identifies a distinct field value.

    Example1: SELECT * FROM t1 WHERE int_column=10;
              This example returns distinct integer value of 10.

    Example2: SELECT * FROM t1 WHERE varchar_column=DATE'2001-01-01'
              This example returns non-distinct values.
              Comparison as DATE will return '2001-01-01' and '2001-01-01x',
              but these two values are not equal to each other as VARCHARs.
    See also the function with the same name in sql_select.cc.
  */
  virtual bool test_if_equality_guarantees_uniqueness(const Item *const_item)
                                                      const;
  virtual bool can_be_substituted_to_equal_item(const Context &ctx,
                                        const Item_equal *item);
  virtual Item *get_equal_const_item(THD *thd, const Context &ctx,
                                     Item *const_item)
  {
    return const_item;
  }
  virtual Data_type_compatibility can_optimize_keypart_ref(
                                        const Item_bool_func *cond,
                                        const Item *item) const;
  virtual Data_type_compatibility can_optimize_hash_join(
                                      const Item_bool_func *cond,
                                      const Item *item) const
  {
    return can_optimize_keypart_ref(cond, item);
  }
  virtual Data_type_compatibility can_optimize_group_min_max(
                                          const Item_bool_func *cond,
                                          const Item *const_item) const;
  /**
    Test if Field can use range optimizer for a standard comparison operation:
      <=, <, =, <=>, >, >=
    Note, this method does not cover spatial operations.
  */
  virtual Data_type_compatibility can_optimize_range(const Item_bool_func *cond,
                                                     const Item *item,
                                                     bool is_eq_func) const;

  virtual SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                               const Item_bool_func *cond,
                               scalar_comparison_op op, Item *value)= 0;

  Data_type_compatibility can_optimize_outer_join_table_elimination(
                                                 const Item_bool_func *cond,
                                                 const Item *item) const
  {
    // Exactly the same rules with REF access
    return can_optimize_keypart_ref(cond, item);
  }

  bool save_in_field_default_value(bool view_eror_processing);
  bool save_in_field_ignore_value(bool view_error_processing);

  /* Mark field in read map. Updates also virtual fields */
  void register_field_in_read_map();

  virtual Compression_method *compression_method() const { return 0; }

  virtual Virtual_tmp_table **virtual_tmp_table_addr()
  {
    return NULL;
  }
  virtual bool sp_prepare_and_store_item(THD *thd, Item **value);

  friend int cre_myisam(char * name, TABLE *form, uint options,
			ulonglong auto_increment_value);
  friend class Copy_field;
  friend class Item_avg_field;
  friend class Item_std_field;
  friend class Item_sum_num;
  friend class Item_sum_sum;
  friend class Item_sum_count;
  friend class Item_sum_avg;
  friend class Item_sum_std;
  friend class Item_sum_min;
  friend class Item_sum_max;
  friend class Item_func_group_concat;

private:
  /*
    Primitive for implementing last_null_byte().

    SYNOPSIS
      do_last_null_byte()

    DESCRIPTION
      Primitive for the implementation of the last_null_byte()
      function. This represents the inheritance interface and can be
      overridden by subclasses.
   */
  virtual size_t do_last_null_byte() const;

protected:
  uchar *pack_int(uchar *to, const uchar *from, size_t size)
  {
    memcpy(to, from, size);
    return to + size;
  }

  const uchar *unpack_int(uchar* to, const uchar *from,
                          const uchar *from_end, size_t size)
  {
    if (from + size > from_end)
      return 0;
    memcpy(to, from, size);
    return from + size;
  }

  uchar *pack_int16(uchar *to, const uchar *from)
  { return pack_int(to, from, 2); }
  const uchar *unpack_int16(uchar* to, const uchar *from, const uchar *from_end)
  { return unpack_int(to, from, from_end, 2); }
  uchar *pack_int24(uchar *to, const uchar *from)
  { return pack_int(to, from, 3); }
  const uchar *unpack_int24(uchar* to, const uchar *from, const uchar *from_end)
  { return unpack_int(to, from, from_end, 3); }
  uchar *pack_int32(uchar *to, const uchar *from)
  { return pack_int(to, from, 4); }
  const uchar *unpack_int32(uchar* to, const uchar *from, const uchar *from_end)
  { return unpack_int(to, from, from_end, 4); }
  uchar *pack_int64(uchar* to, const uchar *from)
  { return pack_int(to, from, 8); }
  const uchar *unpack_int64(uchar* to, const uchar *from,  const uchar *from_end)
  { return unpack_int(to, from, from_end, 8); }

  double pos_in_interval_val_real(Field *min, Field *max);
  double pos_in_interval_val_str(Field *min, Field *max, uint data_offset);
};


class Field_num :public Field {
protected:
  int check_edom_and_important_data_truncation(const char *type, bool edom,
                                               CHARSET_INFO *cs,
                                               const char *str, size_t length,
                                               const char *end_of_num);
  int check_edom_and_truncation(const char *type, bool edom,
                                CHARSET_INFO *cs,
                                const char *str, size_t length,
                                const char *end_of_num);
  int check_int(CHARSET_INFO *cs, const char *str, size_t length,
                const char *int_end, int error)
  {
    return check_edom_and_truncation("integer",
                                     error == MY_ERRNO_EDOM || str == int_end,
                                     cs, str, length, int_end);
  }
  bool get_int(CHARSET_INFO *cs, const char *from, size_t len,
               longlong *rnd, ulonglong unsigned_max,
               longlong signed_min, longlong signed_max);
  void prepend_zeros(String *value) const;
  Item *get_equal_zerofill_const_item(THD *thd, const Context &ctx,
                                      Item *const_item);
  Binlog_type_info::binlog_sign_t binlog_signedness() const
  {
    return (flags & UNSIGNED_FLAG) ? Binlog_type_info::SIGN_UNSIGNED :
                                     Binlog_type_info::SIGN_SIGNED;
  }
  bool send_numeric_zerofill_str(Protocol_text *protocol,
                                 protocol_send_type_t send_type);

public:
  const decimal_digits_t dec;
  bool zerofill,unsigned_flag;	// Purify cannot handle bit fields
  Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
	    uchar null_bit_arg, utype unireg_check_arg,
	    const LEX_CSTRING *field_name_arg,
            decimal_digits_t dec_arg, bool zero_arg, bool unsigned_arg);
  CHARSET_INFO *charset() const override
  {
    return DTCollation_numeric::singleton().collation;
  }
  const DTCollation &dtcollation() const override
  {
    return DTCollation_numeric::singleton();
  }
  sql_mode_t can_handle_sql_mode_dependency_on_store() const override;
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override
  {
    return (flags & ZEROFILL_FLAG) ?
           get_equal_zerofill_const_item(thd, ctx, const_item) :
           const_item;
  }
  void add_zerofill_and_unsigned(String &res) const;
  friend class Create_field;
  void make_send_field(Send_field *) override;
  decimal_digits_t decimals() const override { return dec; }
  uint size_of() const override { return sizeof(*this); }
  bool eq_def(const Field *field) const override;
  Copy_func *get_copy_func(const Field *from) const override
  {
    if (unsigned_flag && from->cmp_type() == DECIMAL_RESULT)
      return do_field_decimal;
    return do_field_int;
  }
  int save_in_field(Field *to) override
  {
    return to->store(val_int(), MY_TEST(flags & UNSIGNED_FLAG));
  }
  bool is_equal(const Column_definition &new_field) const override;
  uint row_pack_length() const override { return pack_length(); }
  uint32 pack_length_from_metadata(uint field_metadata) const override
  {
    uint32 length= pack_length();
    DBUG_PRINT("result", ("pack_length_from_metadata(%d): %u",
                          field_metadata, length));
    return length;
  }
  double pos_in_interval(Field *min, Field *max) override
  {
    return pos_in_interval_val_real(min, max);
  }
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                       const Item_bool_func *cond,
                       scalar_comparison_op op, Item *value) override;
  Binlog_type_info binlog_type_info() const override
  {
    DBUG_ASSERT(Field_num::type() == binlog_type());
    return Binlog_type_info(Field_num::type(), 0, 0, binlog_signedness());
  }
};


class Field_str :public Field {
protected:
  DTCollation m_collation;
  // A short alias for m_collation.collation with non-virtual linkage
  const CHARSET_INFO *field_charset() const { return m_collation.collation; }
  uint mbmaxlen() const { return m_collation.collation->mbmaxlen; }
public:
  bool can_be_substituted_to_equal_item(const Context &ctx,
                                        const Item_equal *item_equal) override;
  Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
	    uchar null_bit_arg, utype unireg_check_arg,
	    const LEX_CSTRING *field_name_arg,
	    const DTCollation &collation);
  decimal_digits_t decimals() const override
  { return is_created_from_null_item ? 0 : DECIMAL_NOT_SPECIFIED; }
  int  save_in_field(Field *to) override { return save_in_field_str(to); }
  bool memcpy_field_possible(const Field *from) const override
  {
    return real_type() == from->real_type() &&
           pack_length() == from->pack_length() &&
           charset() == from->charset();
  }
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_decimal(const my_decimal *) override;
  int  store(const char *to,size_t length,CHARSET_INFO *cs) override=0;
  int  store_hex_hybrid(const char *str, size_t length) override
  {
    return store(str, length, &my_charset_bin);
  }
  CHARSET_INFO *charset() const override { return m_collation.collation; }
  const DTCollation &dtcollation() const override
  {
    return m_collation;
  }
  void change_charset(const DTCollation &new_cs) override;
  bool binary() const override { return field_charset() == &my_charset_bin; }
  uint32 max_display_length() const override { return field_length; }
  uint32 character_octet_length() const override { return field_length; }
  uint32 char_length() const override
  {
    return field_length / mbmaxlen();
  }
  Information_schema_character_attributes
    information_schema_character_attributes() const override
  {
    return Information_schema_character_attributes(max_display_length(),
                                                   char_length());
  }
  friend class Create_field;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override { return val_real() != 0e0; }
  bool str_needs_quotes() const override { return true; }
  bool eq_cmp_as_binary() override { return MY_TEST(flags & BINARY_FLAG); }
  virtual uint length_size() const { return 0; }
  double pos_in_interval(Field *min, Field *max) override
  {
    return pos_in_interval_val_str(min, max, length_size());
  }
  bool test_if_equality_guarantees_uniqueness(const Item *const_item) const
    override;
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                       const Item_bool_func *cond,
                       scalar_comparison_op op, Item *value) override;
  Binlog_type_info binlog_type_info() const override
  {
    DBUG_ASSERT(Field_str::type() == binlog_type());
    return Binlog_type_info(Field_str::type(), 0, 0, charset());
  }
};

/* base class for Field_string, Field_varstring and Field_blob */

class Field_longstr :public Field_str
{
protected:
  int report_if_important_data(const char *ptr, const char *end,
                               bool count_spaces);
  bool check_string_copy_error(const String_copier *copier,
                               const char *end, CHARSET_INFO *cs);
  int check_conversion_status(const String_copier *copier,
                              const char *end, CHARSET_INFO *cs,
                              bool count_spaces)
  {
    if (check_string_copy_error(copier, end, cs))
      return 2;
    return report_if_important_data(copier->source_end_pos(),
                                    end, count_spaces);
  }
  int well_formed_copy_with_check(char *to, size_t to_length,
                                  CHARSET_INFO *from_cs,
                                  const char *from, size_t from_length,
                                  size_t nchars, bool count_spaces,
                                  uint *copy_length)
  {
    String_copier copier;

    *copy_length= copier.well_formed_copy(field_charset(), to, to_length,
                                          from_cs, from, from_length,
                                          nchars);

    return check_conversion_status(&copier, from + from_length, from_cs, count_spaces);
  }
  Data_type_compatibility cmp_to_string_with_same_collation(
                                         const Item_bool_func *cond,
                                         const Item *item) const;
  Data_type_compatibility cmp_to_string_with_stricter_collation(
                                             const Item_bool_func *cond,
                                             const Item *item) const;
  int compress(char *to, uint to_length,
               const char *from, uint length,
               uint max_length,
               uint *out_length,
               CHARSET_INFO *cs, size_t nchars);
  String *uncompress(String *val_buffer, String *val_ptr,
                     const uchar *from, uint from_length) const;
public:
  Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                uchar null_bit_arg, utype unireg_check_arg,
                const LEX_CSTRING *field_name_arg,
                const DTCollation &collation)
    :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
               field_name_arg, collation)
    {}
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  int store_decimal(const my_decimal *d) override;
  uint32 max_data_length() const override;
  void make_send_field(Send_field *) override;
  bool send(Protocol *protocol) override;

  bool is_varchar_and_in_write_set() const override
  {
    DBUG_ASSERT(table && table->write_set);
    return bitmap_is_set(table->write_set, field_index);
  }
  bool match_collation_to_optimize_range() const { return true; }

  Data_type_compatibility can_optimize_keypart_ref(const Item_bool_func *cond,
                                                   const Item *item)
                                                   const override;
  Data_type_compatibility can_optimize_hash_join(const Item_bool_func *cond,
                                                 const Item *item)
                                                 const override;
  Data_type_compatibility can_optimize_group_min_max(const Item_bool_func *cond,
                                                     const Item *const_item)
                                                     const override;
  Data_type_compatibility can_optimize_range(const Item_bool_func *cond,
                                             const Item *item,
                                             bool is_eq_func) const override;
  bool is_packable() const override { return true; }
  uint make_packed_sort_key_part(uchar *buff,
                                 const SORT_FIELD_ATTR *sort_field)override;
  uchar* pack_sort_string(uchar *to, const SORT_FIELD_ATTR *sort_field);
};

/* base class for float and double and decimal (old one) */
class Field_real :public Field_num {
protected:
  double get_double(const char *str, size_t length, CHARSET_INFO *cs, int *err);
public:
  bool not_fixed;

  Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
             uchar null_bit_arg, utype unireg_check_arg,
             const LEX_CSTRING *field_name_arg,
             decimal_digits_t dec_arg, bool zero_arg, bool unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
               field_name_arg, dec_arg, zero_arg, unsigned_arg),
    not_fixed(dec_arg >= FLOATING_POINT_DECIMALS)
    {}
  Copy_func *get_copy_func(const Field *from) const override
  {
    return do_field_real;
  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  Information_schema_numeric_attributes
    information_schema_numeric_attributes() const override
  {
    return dec == DECIMAL_NOT_SPECIFIED ?
                  Information_schema_numeric_attributes(field_length) :
                  Information_schema_numeric_attributes(field_length, dec);
  }
  void sql_type(String &str) const override;
  int save_in_field(Field *to) override { return to->store(val_real()); }
  bool memcpy_field_possible(const Field *from) const override
  {
    /*
      Cannot do memcpy from a longer field to a shorter field,
      e.g. a DOUBLE(53,10) into a DOUBLE(10,10).
      But it should be OK the other way around.
    */
    return real_type() == from->real_type() &&
           pack_length() == from->pack_length() &&
           is_unsigned() <= from->is_unsigned() &&
           decimals() == from->decimals() &&
           field_length >= from->field_length;
  }
  int store_decimal(const my_decimal *dec) override
  { return store(dec->to_double()); }
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override { return val_real() != 0e0; }
  uint32 max_display_length() const override { return field_length; }
  uint size_of() const override { return sizeof *this; }
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override;
};


class Field_decimal final  :public Field_real {
public:
  Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
		uchar null_bit_arg,
		enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
		decimal_digits_t dec_arg, bool zero_arg,bool unsigned_arg)
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg,
                dec_arg, zero_arg, unsigned_arg)
    {}
  Field *make_new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type)
    override;
  const Type_handler *type_handler() const override
  { return &type_handler_olddecimal; }
  enum ha_base_keytype key_type() const override
  { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }
  Information_schema_numeric_attributes
    information_schema_numeric_attributes() const override
  {
    uint tmp= dec ? 2 : 1; // The sign and the decimal point
    return Information_schema_numeric_attributes(field_length - tmp, dec);
  }
  Copy_func *get_copy_func(const Field *from) const override
  {
    return eq_def(from) ? get_identical_copy_func() : do_field_string;
  }
  int reset() override;
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  void overflow(bool negative);
  bool zero_pack() const override { return false; }
  void sql_type(String &str) const override;
  uchar *pack(uchar* to, const uchar *from, uint max_length) override
  {
    return Field::pack(to, from, max_length);
  }
};


/* New decimal/numeric field which use fixed point arithmetic */
class Field_new_decimal final :public Field_num {
public:
  /* The maximum number of decimal digits can be stored */
  decimal_digits_t precision;
  uint32 bin_size;
  /*
    Constructors take max_length of the field as a parameter - not the
    precision as the number of decimal digits allowed.
    So for example we need to count length from precision handling
    CREATE TABLE ( DECIMAL(x,y)) 
  */
  Field_new_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                    uchar null_bit_arg,
                    enum utype unireg_check_arg,
                    const LEX_CSTRING *field_name_arg,
                    decimal_digits_t dec_arg, bool zero_arg, bool unsigned_arg);
  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
  Copy_func *get_copy_func(const Field *from) const override
  {
    //  if (from->real_type() == MYSQL_TYPE_BIT) // QQ: why?
    //    return do_field_int;
    return do_field_decimal;
  }
  int save_in_field(Field *to) override
  {
    my_decimal tmp(ptr, precision, dec);
    return to->store_decimal(&tmp);
  }
  bool memcpy_field_possible(const Field *from) const override
  {
    return real_type() == from->real_type() &&
           pack_length() == from->pack_length() &&
           is_unsigned() <= from->is_unsigned() &&
           decimals() == from->decimals() &&
           field_length == from->field_length;
  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  int  reset() override;
  bool store_value(const my_decimal *decimal_value);
  bool store_value(const my_decimal *decimal_value, int *native_error);
  void set_value_on_overflow(my_decimal *decimal_value, bool sign);
  int  store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  int  store_decimal(const my_decimal *) override;
  double val_real() override
  {
    return my_decimal(ptr, precision, dec).to_double();
  }
  longlong val_int() override
  {
    return my_decimal(ptr, precision, dec).to_longlong(unsigned_flag);
  }
  ulonglong val_uint() override
  {
    return (ulonglong) my_decimal(ptr, precision, dec).to_longlong(true);
  }
  my_decimal *val_decimal(my_decimal *) override;
  String *val_str(String *val_buffer, String *) override
  {
    uint fixed_precision= zerofill ? precision : 0;
    return my_decimal(ptr, precision, dec).
             to_string(val_buffer, fixed_precision, dec, '0');
  }
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    my_decimal nr(ptr, precision, dec);
    return decimal_to_datetime_with_warn(get_thd(), &nr, ltime,
                                         fuzzydate, table->s, field_name.str);
  }
  bool val_bool() override
  {
    return my_decimal(ptr, precision, dec).to_bool();
  }
  int cmp(const uchar *, const uchar *) const override;
  void sort_string(uchar *buff, uint length) override;
  bool zero_pack() const override { return false; }
  void sql_type(String &str) const override;
  uint32 max_display_length() const override { return field_length; }
  Information_schema_numeric_attributes
    information_schema_numeric_attributes() const override
  {
    return Information_schema_numeric_attributes(precision, dec);
  }
  uint size_of() const override { return sizeof *this; }
  uint32 pack_length() const override { return bin_size; }
  uint pack_length_from_metadata(uint field_metadata) const override;
  uint row_pack_length() const override { return pack_length(); }
  bool compatible_field_size(uint field_metadata, const Relay_log_info *rli,
                             uint16 mflags, int *order_var) const override;
  bool is_equal(const Column_definition &new_field) const override;
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint param_data) override;
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override;
  Binlog_type_info binlog_type_info() const override;
};


class Field_int :public Field_num
{
protected:
  String *val_str_from_long(String *val_buffer, uint max_char_length,
                            int radix, long nr);
public:
  Field_int(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
            uchar null_bit_arg, enum utype unireg_check_arg,
            const LEX_CSTRING *field_name_arg, bool zero_arg, bool unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
               unireg_check_arg, field_name_arg, 0, zero_arg, unsigned_arg)
    {}
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  bool memcpy_field_possible(const Field *from) const override
  {
    return real_type() == from->real_type() &&
           pack_length() == from->pack_length() &&
           is_unsigned() == from->is_unsigned();
  }
  int store_decimal(const my_decimal *) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override { return val_int() != 0; }
  ulonglong val_uint() override
  {
    longlong nr= val_int();
    return nr < 0 && !unsigned_flag ? 0 : (ulonglong) nr;
  }
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  virtual const Type_limits_int *type_limits_int() const= 0;
  uint32 max_display_length() const override
  {
    return type_limits_int()->char_length();
  }
  Type_numeric_attributes type_numeric_attributes() const override
  {
    /*
      For integer data types, the user-specified length does not constrain the
      supported range, so e.g. a column of the INT(1) data type supports the
      full integer range anyway.
      Choose the maximum from the user-specified length and the maximum
      possible length determined by the data type capacity:
        INT(1)  -> 11
        INT(10) -> 11
        INT(40) -> 40
    */
    uint32 length1= max_display_length();
    uint32 length2= field_length;
    return Type_numeric_attributes(MY_MAX(length1, length2),
                                   decimals(), is_unsigned());
  }
  Information_schema_numeric_attributes
    information_schema_numeric_attributes() const override
  {
    uint32 prec= type_limits_int()->precision();
    return Information_schema_numeric_attributes(prec, 0);
  }
  void sql_type(String &str) const override;
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                       const Item_bool_func *cond,
                       scalar_comparison_op op, Item *value) override
  {
    return get_mm_leaf_int(param, key_part, cond, op, value, unsigned_flag);
  }
};


class Field_tiny :public Field_int
{
  const Type_handler_general_purpose_int *type_handler_priv() const
  {
    if (is_unsigned())
      return &type_handler_utiny;
    return &type_handler_stiny;
  }
public:
  Field_tiny(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	     uchar null_bit_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	     bool zero_arg, bool unsigned_arg)
    :Field_int(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
               unireg_check_arg, field_name_arg, zero_arg, unsigned_arg)
    {}
  const Type_handler *type_handler() const override
    { return type_handler_priv(); }
  enum ha_base_keytype key_type() const override
    { return unsigned_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_INT8; }
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int reset() override { ptr[0]=0; return 0; }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 1; }
  const Type_limits_int *type_limits_int() const override
  {
    return type_handler_priv()->type_limits_int();
  }

  uchar *pack(uchar* to, const uchar *from, uint max_length) override
  {
    *to= *from;
    return to + 1;
  }

  const uchar *unpack(uchar* to, const uchar *from,
		      const uchar *from_end, uint param_data) override
  {
    if (from == from_end)
      return 0;
    *to= *from;
    return from + 1;
  }
  ulonglong get_max_int_value() const override
  {
    return unsigned_flag ? 0xFFULL : 0x7FULL;
  }
};


class Field_short final :public Field_int
{
  const Type_handler_general_purpose_int *type_handler_priv() const
  {
    if (is_unsigned())
      return &type_handler_ushort;
    return &type_handler_sshort;
  }
public:
  Field_short(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	      uchar null_bit_arg,
	      enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	      bool zero_arg, bool unsigned_arg)
    :Field_int(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
               unireg_check_arg, field_name_arg, zero_arg, unsigned_arg)
    {}
  Field_short(uint32 len_arg,bool maybe_null_arg,
              const LEX_CSTRING *field_name_arg,
	      bool unsigned_arg)
    :Field_int((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
               NONE, field_name_arg, 0, unsigned_arg)
    {}
  const Type_handler *type_handler() const override
  { return type_handler_priv(); }
  enum ha_base_keytype key_type() const override
    { return unsigned_flag ? HA_KEYTYPE_USHORT_INT : HA_KEYTYPE_SHORT_INT;}
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int reset() override { ptr[0]=ptr[1]=0; return 0; }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 2; }
  const Type_limits_int *type_limits_int() const override
  {
    return type_handler_priv()->type_limits_int();
  }
  uchar *pack(uchar* to, const uchar *from, uint) override
  { return pack_int16(to, from); }

  const uchar *unpack(uchar* to, const uchar *from,
                      const uchar *from_end, uint) override
  { return unpack_int16(to, from, from_end); }
  ulonglong get_max_int_value() const override
  {
    return unsigned_flag ? 0xFFFFULL : 0x7FFFULL;
  }
};

class Field_medium final :public Field_int
{
  const Type_handler_general_purpose_int *type_handler_priv() const
  {
    if (is_unsigned())
      return &type_handler_uint24;
    return &type_handler_sint24;
  }
public:
  Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	      uchar null_bit_arg,
	      enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	      bool zero_arg, bool unsigned_arg)
    :Field_int(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
               unireg_check_arg, field_name_arg, zero_arg, unsigned_arg)
    {}
  const Type_handler *type_handler() const override
  { return type_handler_priv(); }
  enum ha_base_keytype key_type() const override
    { return unsigned_flag ? HA_KEYTYPE_UINT24 : HA_KEYTYPE_INT24; }
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int reset() override { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 3; }
  const Type_limits_int *type_limits_int() const override
  {
    return type_handler_priv()->type_limits_int();
  }
  uchar *pack(uchar* to, const uchar *from, uint max_length) override
  {
    return Field::pack(to, from, max_length);
  }
  ulonglong get_max_int_value() const override
  {
    return unsigned_flag ? 0xFFFFFFULL : 0x7FFFFFULL;
  }
};


class Field_long final :public Field_int
{
  const Type_handler_general_purpose_int *type_handler_priv() const
  {
    if (is_unsigned())
      return &type_handler_ulong;
    return &type_handler_slong;
  }
public:
  Field_long(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	     uchar null_bit_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	     bool zero_arg, bool unsigned_arg)
    :Field_int(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
               unireg_check_arg, field_name_arg, zero_arg, unsigned_arg)
    {}
  Field_long(uint32 len_arg,bool maybe_null_arg,
             const LEX_CSTRING *field_name_arg,
	     bool unsigned_arg)
    :Field_int((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
               NONE, field_name_arg, 0, unsigned_arg)
    {}
  const Type_handler *type_handler() const override
  { return type_handler_priv(); }
  enum ha_base_keytype key_type() const override
    { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int reset() override { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
  double val_real() override;
  longlong val_int() override;
  bool send(Protocol *protocol) override;
  String *val_str(String *, String *) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 4; }
  const Type_limits_int *type_limits_int() const override
  {
    return type_handler_priv()->type_limits_int();
  }
  uchar *pack(uchar* to, const uchar *from, uint) override
  {
    return pack_int32(to, from);
  }
  const uchar *unpack(uchar* to, const uchar *from,
                      const uchar *from_end, uint) override
  {
    return unpack_int32(to, from, from_end);
  }
  ulonglong get_max_int_value() const override
  {
    return unsigned_flag ? 0xFFFFFFFFULL : 0x7FFFFFFFULL;
  }
};


class Field_longlong :public Field_int
{
  const Type_handler_general_purpose_int *type_handler_priv() const
  {
    if (is_unsigned())
      return &type_handler_ulonglong;
    return &type_handler_slonglong;
  }
public:
  Field_longlong(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	      uchar null_bit_arg,
	      enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	      bool zero_arg, bool unsigned_arg)
    :Field_int(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
               unireg_check_arg, field_name_arg, zero_arg, unsigned_arg)
    {}
  Field_longlong(uint32 len_arg,bool maybe_null_arg,
		 const LEX_CSTRING *field_name_arg,
                 bool unsigned_arg)
    :Field_int((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
                NONE, field_name_arg, 0, unsigned_arg)
    {}
  const Type_handler *type_handler() const override
  { return type_handler_priv(); }
  enum ha_base_keytype key_type() const override
  { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; }
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int reset() override
  {
    ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
    return 0;
  }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 8; }
  const Type_limits_int *type_limits_int() const override
  {
    return type_handler_priv()->type_limits_int();
  }
  uchar *pack(uchar* to, const uchar *from, uint) override
  {
    return pack_int64(to, from);
  }
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
		      uint) override
  {
    return unpack_int64(to, from, from_end);
  }
  void set_max() override;
  bool is_max() override;
  ulonglong get_max_int_value() const override
  {
    return unsigned_flag ? 0xFFFFFFFFFFFFFFFFULL : 0x7FFFFFFFFFFFFFFFULL;
  }
};


class Field_vers_trx_id :public Field_longlong {
  MYSQL_TIME cache;
  ulonglong cached;
public:
  Field_vers_trx_id(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                    uchar null_bit_arg, enum utype unireg_check_arg,
                    const LEX_CSTRING *field_name_arg, bool zero_arg,
                    bool unsigned_arg)
      : Field_longlong(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                       unireg_check_arg, field_name_arg, zero_arg,
                       unsigned_arg),
        cached(0)
  {}
  const Type_handler *type_handler() const override
  { return &type_handler_vers_trx_id; }
  uint size_of() const override { return sizeof *this; }
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate, ulonglong trx_id);
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return get_date(ltime, fuzzydate, (ulonglong) val_int());
  }
  bool test_if_equality_guarantees_uniqueness(const Item *item) const override;
  Data_type_compatibility can_optimize_keypart_ref(const Item_bool_func *,
                                                   const Item *)
    const override
  {
    return Data_type_compatibility::OK;
  }

  Data_type_compatibility can_optimize_group_min_max(const Item_bool_func *,
                                                     const Item *)
    const override
  {
    return Data_type_compatibility::OK;
  }
  Data_type_compatibility can_optimize_range(const Item_bool_func *,
                                             const Item *, bool is_eq_func)
    const override
  {
    return Data_type_compatibility::OK;
  }
  /* cmp_type() cannot be TIME_RESULT, because we want to compare this field against
     integers. But in all other cases we treat it as TIME_RESULT! */
};

static inline decimal_digits_t fix_dec_arg(decimal_digits_t dec_arg)
{ return dec_arg >= FLOATING_POINT_DECIMALS ? DECIMAL_NOT_SPECIFIED : dec_arg; }

class Field_float final :public Field_real {
public:
  Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	      uchar null_bit_arg,
	      enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
              decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg)
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg,
                fix_dec_arg(dec_arg), zero_arg, unsigned_arg)
    { }
  Field_float(uint32 len_arg, bool maybe_null_arg,
              const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg)
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
                NONE, field_name_arg, fix_dec_arg(dec_arg), 0, 0)
    { }
  const Type_handler *type_handler() const override
  { return &type_handler_float; }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_FLOAT; }
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int reset() override { bzero(ptr,sizeof(float)); return 0; }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff, uint length) override;
  uint32 pack_length() const override { return sizeof(float); }
  uint row_pack_length() const override { return pack_length(); }
  ulonglong get_max_int_value() const override
  {
    /*
      We use the maximum as per IEEE754-2008 standard, 2^24
    */
    return 0x1000000ULL;
  }
  Binlog_type_info binlog_type_info() const override;
};


class Field_double :public Field_real {
  longlong val_int_from_real(bool want_unsigned_result);
public:
  Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	       uchar null_bit_arg,
	       enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	       decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg)
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg,
                fix_dec_arg(dec_arg), zero_arg, unsigned_arg)
    { }
  Field_double(uint32 len_arg, bool maybe_null_arg,
               const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg)
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
                NONE, field_name_arg, fix_dec_arg(dec_arg), 0, 0)
    { }
  Field_double(uint32 len_arg, bool maybe_null_arg,
               const LEX_CSTRING *field_name_arg,
	       decimal_digits_t dec_arg, bool not_fixed_arg)
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
                NONE, field_name_arg, fix_dec_arg(dec_arg), 0, 0)
    {
      not_fixed= not_fixed_arg;
    }
  void init_for_tmp_table(Field *org_field, TABLE *new_table) override
  {
    Field::init_for_tmp_table(org_field, new_table);
    not_fixed= true;
  }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  enum ha_base_keytype key_type() const override final { return HA_KEYTYPE_DOUBLE; }
  int  store(const char *to,size_t length,CHARSET_INFO *charset) override final;
  int  store(double nr) override final;
  int  store(longlong nr, bool unsigned_val) override final;
  int reset() override final { bzero(ptr,sizeof(double)); return 0; }
  double val_real() override final;
  longlong val_int() override final { return val_int_from_real(false); }
  ulonglong val_uint() override final { return (ulonglong) val_int_from_real(true); }
  String *val_str(String *, String *) override final;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override final;
  void sort_string(uchar *buff, uint length) override final;
  uint32 pack_length() const override final { return sizeof(double); }
  uint row_pack_length() const override final { return pack_length(); }
  ulonglong get_max_int_value() const override final
  {
    /*
      We use the maximum as per IEEE754-2008 standard, 2^53
    */
    return 0x20000000000000ULL;
  }
  Binlog_type_info binlog_type_info() const override final;
};


/* Everything saved in this will disappear. It will always return NULL */

class Field_null :public Field_str {
  static uchar null[1];
public:
  Field_null(uchar *ptr_arg, uint32 len_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	     const DTCollation &collation)
    :Field_str(ptr_arg, len_arg, null, 1,
	       unireg_check_arg, field_name_arg, collation)
    {}
  const Type_handler *type_handler() const override
  { return &type_handler_null; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  Information_schema_character_attributes
    information_schema_character_attributes() const override
  {
    return Information_schema_character_attributes();
  }
  Copy_func *get_copy_func(const Field *from) const override
  {
    return do_field_string;
  }
  int  store(const char *to, size_t length, CHARSET_INFO *cs) override final
  { null[0]=1; return 0; }
  int store(double nr) override final { null[0]=1; return 0; }
  int store(longlong nr, bool unsigned_val) override final { null[0]=1; return 0; }
  int store_decimal(const my_decimal *d) override final { null[0]=1; return 0; }
  int reset() override final { return 0; }
  double val_real() override final { return 0.0;}
  longlong val_int() override final { return 0;}
  bool val_bool() override final { return false; }
  my_decimal *val_decimal(my_decimal *) override final { return 0; }
  String *val_str(String *value,String *value2) override final
  { value2->length(0); return value2;}
  bool is_equal(const Column_definition &new_field) const override final;
  int cmp(const uchar *a, const uchar *b) const override final { return 0;}
  void sort_string(uchar *buff, uint length) override final {}
  uint32 pack_length() const override final { return 0; }
  void sql_type(String &str) const override final;
  uint size_of() const override final { return sizeof *this; }
  uint32 max_display_length() const override final { return 4; }
  void move_field_offset(my_ptrdiff_t ptr_diff) override final {}
  Data_type_compatibility can_optimize_keypart_ref(const Item_bool_func *cond,
                                                   const Item *item)
                                                   const override final
  {
    return Data_type_compatibility::INCOMPATIBLE_DATA_TYPE;
  }
  Data_type_compatibility can_optimize_group_min_max(const Item_bool_func *cond,
                                                     const Item *const_item)
                                                     const override final
  {
    return Data_type_compatibility::INCOMPATIBLE_DATA_TYPE;
  }
};


class Field_temporal :public Field {
protected:
  Item *get_equal_const_item_datetime(THD *thd, const Context &ctx,
                                      Item *const_item);
  void set_warnings(Sql_condition::enum_warning_level trunc_level,
                    const ErrConv *str, int was_cut, const char *typestr);
  int store_TIME_return_code_with_warnings(int warn, const ErrConv *str,
                                           const char *typestr)
  {
    if (!MYSQL_TIME_WARN_HAVE_WARNINGS(warn) &&
        MYSQL_TIME_WARN_HAVE_NOTES(warn))
    {
      set_warnings(Sql_condition::WARN_LEVEL_NOTE, str,
                   warn | MYSQL_TIME_WARN_TRUNCATED, typestr);
      return 3;
    }
    set_warnings(Sql_condition::WARN_LEVEL_WARN, str, warn, typestr);
    return warn ? 2 : 0;
  }
  int store_invalid_with_warning(const ErrConv *str, int was_cut,
                                 const char *typestr)
  {
    DBUG_ASSERT(was_cut);
    reset();
    Sql_condition::enum_warning_level level= Sql_condition::WARN_LEVEL_WARN;
    if (was_cut & MYSQL_TIME_WARN_ZERO_DATE)
    {
      set_warnings(level, str, MYSQL_TIME_WARN_OUT_OF_RANGE, typestr);
      return 2;
    }
    set_warnings(level, str, MYSQL_TIME_WARN_TRUNCATED, typestr);
    return 1;
  }
  void sql_type_comment(String &str,
                        const Name &name,
                        const Name &comment) const;
  void sql_type_dec_comment(String &str,
                            const Name &name, uint dec,
                            const Name &comment) const;
  void sql_type_opt_dec_comment(String &str,
                                const Name &name, uint dec,
                                const Name &comment) const
  {
    if (dec)
      sql_type_dec_comment(str, name, dec, comment);
    else
      sql_type_comment(str, name, comment);
  }
  static const Name &type_version_mysql56();
public:
  Field_temporal(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
                 uchar null_bit_arg, utype unireg_check_arg,
                 const LEX_CSTRING *field_name_arg)
    :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
               field_name_arg)
    { flags|= BINARY_FLAG; }
  int  store_hex_hybrid(const char *str, size_t length) override
  {
    return store(str, length, &my_charset_bin);
  }
  sql_mode_t can_handle_sql_mode_dependency_on_store() const override;
  Copy_func *get_copy_func(const Field *from) const override;
  int save_in_field(Field *to) override
  {
    MYSQL_TIME ltime;
    // For temporal types no truncation needed. Rounding mode is not important.
    if (get_date(&ltime, TIME_CONV_NONE | TIME_FRAC_NONE))
      return to->reset();
    return to->store_time_dec(&ltime, decimals());
  }
  bool memcpy_field_possible(const Field *from) const override;
  uint32 max_display_length() const override { return field_length; }
  bool str_needs_quotes() const override { return true; }
  CHARSET_INFO *charset() const override
  {
    return DTCollation_numeric::singleton().collation;
  }
  const DTCollation &dtcollation() const override
  {
    return DTCollation_numeric::singleton();
  }
  CHARSET_INFO *sort_charset() const override { return &my_charset_bin; }
  bool binary() const override { return true; }
  bool val_bool() override { return val_real() != 0e0; }
  bool is_equal(const Column_definition &new_field) const override;
  bool eq_def(const Field *field) const override
  {
    return (Field::eq_def(field) && decimals() == field->decimals());
  }
  my_decimal *val_decimal(my_decimal*) override;
  double pos_in_interval(Field *min, Field *max) override
  {
    return pos_in_interval_val_real(min, max);
  }
  Data_type_compatibility can_optimize_keypart_ref(const Item_bool_func *cond,
                                                   const Item *item)
                                                   const override;
  Data_type_compatibility can_optimize_group_min_max(const Item_bool_func *cond,
                                                     const Item *const_item)
                                                     const override;
  Data_type_compatibility can_optimize_range(const Item_bool_func *cond,
                                             const Item *item,
                                             bool is_eq_func) const override
  {
    return Data_type_compatibility::OK;
  }
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                       const Item_bool_func *cond,
                       scalar_comparison_op op, Item *value) override;
};


/**
  Abstract class for:
  - DATE
  - DATETIME
  - DATETIME(1..6)
  - DATETIME(0..6) - MySQL56 version
*/
class Field_temporal_with_date :public Field_temporal {
protected:
  virtual void store_TIME(const MYSQL_TIME *ltime) = 0;
  void store_datetime(const Datetime &dt)
  {
    return store_TIME(dt.get_mysql_time());
  }
  virtual bool get_TIME(MYSQL_TIME *ltime, const uchar *pos,
                        date_mode_t fuzzydate) const = 0;
  bool validate_MMDD(bool not_zero_date, uint month, uint day,
                     date_mode_t fuzzydate) const
  {
    if (!not_zero_date)
      return bool(fuzzydate & TIME_NO_ZERO_DATE);
    if (!month || !day)
      return bool(fuzzydate & TIME_NO_ZERO_IN_DATE);
    return false;
  }
public:
  Field_temporal_with_date(uchar *ptr_arg, uint32 len_arg,
                           uchar *null_ptr_arg, uchar null_bit_arg,
                           utype unireg_check_arg,
                           const LEX_CSTRING *field_name_arg)
    :Field_temporal(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                    unireg_check_arg, field_name_arg)
    {}
  bool validate_value_in_record(THD *thd, const uchar *record) const override;
};


class Field_timestamp :public Field_temporal {
protected:
  int store_TIME_with_warning(THD *, const Datetime *,
                              const ErrConv *, int warn);
  virtual void store_TIMEVAL(const timeval &tv)= 0;
  void store_TIMESTAMP(const Timestamp &ts)
  {
    store_TIMEVAL(ts.tv());
  }
  int zero_time_stored_return_code_with_warning();
public:
  Field_timestamp(uchar *ptr_arg, uint32 len_arg,
                  uchar *null_ptr_arg, uchar null_bit_arg,
		  enum utype unireg_check_arg,
                  const LEX_CSTRING *field_name_arg,
		  TABLE_SHARE *share);
  const Type_handler *type_handler() const override
  { return &type_handler_timestamp; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  Copy_func *get_copy_func(const Field *from) const override;
  sql_mode_t conversion_depends_on_sql_mode(THD *, Item *) const override;
  int  store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  int  store_decimal(const my_decimal *) override;
  int  store_timestamp_dec(const timeval &ts, uint dec) override;
  int  save_in_field(Field *to) override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool zero_pack() const override { return false; }
  /*
    This method is used by storage/perfschema and
    Item_func_now_local::save_in_field().
  */
  void store_TIME(my_time_t ts, ulong sec_part)
  {
    int warn;
    time_round_mode_t mode= Datetime::default_round_mode(get_thd());
    store_TIMESTAMP(Timestamp(ts, sec_part).round(decimals(), mode, &warn));
  }
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  int store_native(const Native &value) override;
  bool validate_value_in_record(THD *thd, const uchar *record) const override;
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override
  {
    return get_equal_const_item_datetime(thd, ctx, const_item);
  }
  bool load_data_set_null(THD *thd) override;
  bool load_data_set_no_data(THD *thd, bool fixed_format) override;
};


class Field_timestamp0 :public Field_timestamp
{
  void store_TIMEVAL(const timeval &tv) override
  {
    int4store(ptr, tv.tv_sec);
  }
public:
  Field_timestamp0(uchar *ptr_arg, uint32 len_arg,
                   uchar *null_ptr_arg, uchar null_bit_arg,
		   enum utype unireg_check_arg,
                   const LEX_CSTRING *field_name_arg,
		   TABLE_SHARE *share)
   :Field_timestamp(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                    unireg_check_arg, field_name_arg, share)
  { }
  enum ha_base_keytype key_type() const override
  { return HA_KEYTYPE_ULONG_INT; }
  void sql_type(String &str) const override
  {
    sql_type_comment(str, Field_timestamp0::type_handler()->name(),
                     Type_handler::version_mariadb53());
  }
  double val_real() override
  {
    return (double) Field_timestamp0::val_int();
  }
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 4; }
  int set_time() override;
  /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
  my_time_t get_timestamp(const uchar *pos, ulong *sec_part) const override;
  bool val_native(Native *to) override;
  uchar *pack(uchar *to, const uchar *from, uint) override
  {
    return pack_int32(to, from);
  }
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint) override
  {
    return unpack_int32(to, from, from_end);
  }
  uint size_of() const override { return sizeof *this; }
};


/**
  Abstract class for:
  - TIMESTAMP(1..6)
  - TIMESTAMP(0..6) - MySQL56 version
*/
class Field_timestamp_with_dec :public Field_timestamp {
protected:
  decimal_digits_t dec;
public:
  Field_timestamp_with_dec(uchar *ptr_arg,
                           uchar *null_ptr_arg, uchar null_bit_arg,
                           enum utype unireg_check_arg,
                           const LEX_CSTRING *field_name_arg,
                           TABLE_SHARE *share, decimal_digits_t dec_arg) :
  Field_timestamp(ptr_arg,
                  MAX_DATETIME_WIDTH + dec_arg + MY_TEST(dec_arg),
                  null_ptr_arg,
                  null_bit_arg, unireg_check_arg, field_name_arg, share),
  dec(dec_arg)
  {
    DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
  }
  decimal_digits_t decimals() const override { return dec; }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
  uchar *pack(uchar *to, const uchar *from, uint max_length) override
  { return Field::pack(to, from, max_length); }
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint param_data) override
  { return Field::unpack(to, from, from_end, param_data); }
  void make_send_field(Send_field *field) override;
  void sort_string(uchar *to, uint length) override
  {
    DBUG_ASSERT(length == pack_length());
    memcpy(to, ptr, length);
  }
  bool send(Protocol *protocol) override;
  double val_real() override;
  my_decimal* val_decimal(my_decimal*) override;
  int set_time() override;
};


class Field_timestamp_hires :public Field_timestamp_with_dec {
  uint sec_part_bytes(uint dec) const
  {
    return Type_handler_timestamp::sec_part_bytes(dec);
  }
  void store_TIMEVAL(const timeval &tv) override;
public:
  Field_timestamp_hires(uchar *ptr_arg,
                        uchar *null_ptr_arg, uchar null_bit_arg,
                        enum utype unireg_check_arg,
                        const LEX_CSTRING *field_name_arg,
                        TABLE_SHARE *share, decimal_digits_t dec_arg) :
  Field_timestamp_with_dec(ptr_arg, null_ptr_arg, null_bit_arg,
                           unireg_check_arg, field_name_arg, share, dec_arg)
  {
    DBUG_ASSERT(dec);
  }
  void sql_type(String &str) const override
  {
    sql_type_dec_comment(str, Field_timestamp_hires::type_handler()->name(),
                         dec, Type_handler::version_mariadb53());
  }
  bool val_native(Native *to) override;
  my_time_t get_timestamp(const uchar *pos, ulong *sec_part) const override;
  int cmp(const uchar *,const uchar *) const override;
  uint32 pack_length() const override { return 4 + sec_part_bytes(dec); }
  uint size_of() const override { return sizeof *this; }
};


/**
  TIMESTAMP(0..6) - MySQL56 version
*/
class Field_timestampf :public Field_timestamp_with_dec {
  void store_TIMEVAL(const timeval &tv) override;
public:
  Field_timestampf(uchar *ptr_arg,
                   uchar *null_ptr_arg, uchar null_bit_arg,
                   enum utype unireg_check_arg,
                   const LEX_CSTRING *field_name_arg,
                   TABLE_SHARE *share, decimal_digits_t dec_arg) :
    Field_timestamp_with_dec(ptr_arg, null_ptr_arg, null_bit_arg,
                             unireg_check_arg, field_name_arg, share, dec_arg)
    {}
  const Type_handler *type_handler() const override
  { return &type_handler_timestamp2; }
  enum_field_types binlog_type() const override
  { return MYSQL_TYPE_TIMESTAMP2; }
  void sql_type(String &str) const override
  {
    sql_type_opt_dec_comment(str, Field_timestampf::type_handler()->name(),
                             dec, type_version_mysql56());

  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  uint32 pack_length() const override
  {
    return my_timestamp_binary_length(dec);
  }
  uint row_pack_length() const override { return pack_length(); }
  uint pack_length_from_metadata(uint field_metadata) const override
  {
    DBUG_ENTER("Field_timestampf::pack_length_from_metadata");
    uint tmp= my_timestamp_binary_length(field_metadata);
    DBUG_RETURN(tmp);
  }
  int cmp(const uchar *a_ptr,const uchar *b_ptr) const override
  {
    return memcmp(a_ptr, b_ptr, pack_length());
  }
  void set_max() override;
  bool is_max() override;
  my_time_t get_timestamp(const uchar *pos, ulong *sec_part) const override;
  bool val_native(Native *to) override;
  uint size_of() const override { return sizeof *this; }
  Binlog_type_info binlog_type_info() const override;
};


class Field_year final :public Field_tiny {
public:
  Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	     uchar null_bit_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg)
    :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
		unireg_check_arg, field_name_arg, 1, 1)
    {}
  const Type_handler *type_handler() const override
  {
    return field_length == 2 ? &type_handler_year2 : &type_handler_year;
  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  Copy_func *get_copy_func(const Field *from) const override
  {
    if (eq_def(from))
      return get_identical_copy_func();
    switch (from->cmp_type()) {
    case STRING_RESULT:
    {
      const Type_handler *handler= from->type_handler();
      if (handler == &type_handler_enum || handler == &type_handler_set)
        return do_field_int;
      return do_field_string;
    }
    case TIME_RESULT:
      return do_field_date;
    case DECIMAL_RESULT:
      return do_field_decimal;
    case REAL_RESULT:
      return do_field_real;
    case INT_RESULT:
      break;
    case ROW_RESULT:
    default:
      DBUG_ASSERT(0);
      break;
    }
    return do_field_int;
  }
  int  store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool send(Protocol *protocol) override;
  Information_schema_numeric_attributes
    information_schema_numeric_attributes() const override
  {
    return Information_schema_numeric_attributes();
  }
  uint32 max_display_length() const override { return field_length; }
  void sql_type(String &str) const override;
};


class Field_date_common :public Field_temporal_with_date
{
protected:
  int store_TIME_with_warning(const Datetime *ltime, const ErrConv *str,
                              int was_cut);
public:
  Field_date_common(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
                    enum utype unireg_check_arg,
                    const LEX_CSTRING *field_name_arg)
    :Field_temporal_with_date(ptr_arg, MAX_DATE_WIDTH,
                              null_ptr_arg, null_bit_arg,
                              unireg_check_arg, field_name_arg)
  {}
  Copy_func *get_copy_func(const Field *from) const override;
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                       const Item_bool_func *cond,
                       scalar_comparison_op op, Item *value) override;
  int  store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  int  store_decimal(const my_decimal *) override;
};


class Field_date final :public Field_date_common
{
  void store_TIME(const MYSQL_TIME *ltime) override;
  bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
    const override;
public:
  Field_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg)
    :Field_date_common(ptr_arg, null_ptr_arg, null_bit_arg,
                       unireg_check_arg, field_name_arg) {}
  const Type_handler *type_handler() const override
  { return &type_handler_date; }
  enum ha_base_keytype key_type() const override
  { return HA_KEYTYPE_ULONG_INT; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  int reset() override { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return Field_date::get_TIME(ltime, ptr, fuzzydate); }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 4; }
  void sql_type(String &str) const override;
  uchar *pack(uchar* to, const uchar *from, uint) override
  {
    return pack_int32(to, from);
  }
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint) override
  {
    return unpack_int32(to, from, from_end);
  }
  uint size_of() const override { return sizeof *this; }
};


class Field_newdate final :public Field_date_common
{
  void store_TIME(const MYSQL_TIME *ltime) override;
  bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
    const override;
public:
  Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
		enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg)
    :Field_date_common(ptr_arg, null_ptr_arg, null_bit_arg,
                       unireg_check_arg, field_name_arg)
    {}
  const Type_handler *type_handler() const override
  { return &type_handler_newdate; }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_UINT24; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  int reset() override { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 3; }
  void sql_type(String &str) const override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return Field_newdate::get_TIME(ltime, ptr, fuzzydate); }
  longlong val_datetime_packed(THD *thd) override;
  uint size_of() const override { return sizeof *this; }
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override;
};


class Field_time :public Field_temporal {
  /*
    when this Field_time instance is used for storing values for index lookups
    (see class store_key, Field::new_key_field(), etc), the following
    might be set to TO_DAYS(CURDATE()). See also Field_time::store_time_dec()
  */
  long curdays;
protected:
  virtual void store_TIME(const MYSQL_TIME *ltime)= 0;
  void store_TIME(const Time &t) { return store_TIME(t.get_mysql_time()); }
  int store_TIME_with_warning(const Time *ltime, const ErrConv *str, int warn);
  bool check_zero_in_date_with_warn(date_mode_t fuzzydate);
  static void do_field_time(Copy_field *copy);
public:
  Field_time(uchar *ptr_arg, uint length_arg, uchar *null_ptr_arg,
             uchar null_bit_arg, enum utype unireg_check_arg,
             const LEX_CSTRING *field_name_arg)
    :Field_temporal(ptr_arg, length_arg, null_ptr_arg, null_bit_arg,
                    unireg_check_arg, field_name_arg), curdays(0)
    {}
  bool can_be_substituted_to_equal_item(const Context &ctx,
                                        const Item_equal *item_equal) override;
  const Type_handler *type_handler() const override
  { return &type_handler_time; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  Copy_func *get_copy_func(const Field *from) const override
  {
    return from->cmp_type() == REAL_RESULT ? do_field_string : // MDEV-9344
           from->type() == MYSQL_TYPE_YEAR ? do_field_int :
           from->type() == MYSQL_TYPE_BIT  ? do_field_int :
           eq_def(from)                    ? get_identical_copy_func() :
                                             do_field_time;
  }
  bool memcpy_field_possible(const Field *from) const override
  {
    return real_type() == from->real_type() &&
           decimals() == from->decimals();
  }
  sql_mode_t conversion_depends_on_sql_mode(THD *, Item *) const override;
  int store_native(const Native &value) override;
  bool val_native(Native *to) override;
  int store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int  store_decimal(const my_decimal *) override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  void set_curdays(THD *thd);
  Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                       uchar *new_ptr, uint32 length,
                       uchar *new_null_ptr, uint new_null_bit) override;
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override;
};


class Field_time0 final :public Field_time
{
protected:
  void store_TIME(const MYSQL_TIME *ltime) override;
public:
  Field_time0(uchar *ptr_arg, uint length_arg, uchar *null_ptr_arg,
             uchar null_bit_arg, enum utype unireg_check_arg,
             const LEX_CSTRING *field_name_arg)
    :Field_time(ptr_arg, length_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg)
  { }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_INT24; }
  void sql_type(String &str) const override
  {
    sql_type_comment(str, Field_time0::type_handler()->name(),
                     Type_handler::version_mariadb53());
  }
  double val_real() override;
  longlong val_int() override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 3; }
  uint size_of() const override { return sizeof *this; }
};


/**
  Abstract class for:
  - TIME(1..6)
  - TIME(0..6) - MySQL56 version
*/
class Field_time_with_dec :public Field_time {
protected:
  decimal_digits_t dec;
public:
  Field_time_with_dec(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
                      enum utype unireg_check_arg,
                      const LEX_CSTRING *field_name_arg,
                      decimal_digits_t dec_arg)
    :Field_time(ptr_arg, MIN_TIME_WIDTH + dec_arg + MY_TEST(dec_arg),
                null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg),
     dec(dec_arg)
  {
    DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
  }
  decimal_digits_t decimals() const override { return dec; }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
  longlong val_int() override;
  double val_real() override;
  void make_send_field(Send_field *) override;
};


/**
  TIME(1..6)
*/
class Field_time_hires final :public Field_time_with_dec {
  longlong zero_point;
  void store_TIME(const MYSQL_TIME *) override;
public:
  Field_time_hires(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
                   enum utype unireg_check_arg,
                   const LEX_CSTRING *field_name_arg,
                   decimal_digits_t dec_arg)
    :Field_time_with_dec(ptr_arg, null_ptr_arg,
                         null_bit_arg, unireg_check_arg, field_name_arg,
                         dec_arg)
  {
    DBUG_ASSERT(dec);
    zero_point= sec_part_shift(
                   ((TIME_MAX_VALUE_SECONDS+1LL)*TIME_SECOND_PART_FACTOR), dec);
  }
  void sql_type(String &str) const override
  {
    sql_type_dec_comment(str, Field_time_hires::type_handler()->name(),
                         dec, Type_handler::version_mariadb53());
  }
  int reset() override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override
  { return Type_handler_time::hires_bytes(dec); }
  uint size_of() const override { return sizeof *this; }
};


/**
  TIME(0..6) - MySQL56 version
*/
class Field_timef final :public Field_time_with_dec {
  void store_TIME(const MYSQL_TIME *ltime) override;
public:
  Field_timef(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
              enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
              decimal_digits_t dec_arg)
    :Field_time_with_dec(ptr_arg, null_ptr_arg,
                         null_bit_arg, unireg_check_arg, field_name_arg,
                         dec_arg)
  {
    DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_time2; }
  enum_field_types binlog_type() const override { return MYSQL_TYPE_TIME2; }
  void sql_type(String &str) const override
  {
    sql_type_opt_dec_comment(str, Field_timef::type_handler()->name(),
                             dec, type_version_mysql56());
  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  uint32 pack_length() const override
  {
    return my_time_binary_length(dec);
  }
  uint row_pack_length() const override { return pack_length(); }
  uint pack_length_from_metadata(uint field_metadata) const override
  {
    DBUG_ENTER("Field_timef::pack_length_from_metadata");
    uint tmp= my_time_binary_length(field_metadata);
    DBUG_RETURN(tmp);
  }
  void sort_string(uchar *to, uint length) override
  {
    DBUG_ASSERT(length == Field_timef::pack_length());
    memcpy(to, ptr, length);
  }
  int cmp(const uchar *a_ptr, const uchar *b_ptr) const override
  {
    return memcmp(a_ptr, b_ptr, pack_length());
  }
  int reset() override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  longlong val_time_packed(THD *thd) override;
  int store_native(const Native &value) override;
  bool val_native(Native *to) override;
  uint size_of() const override { return sizeof *this; }
  Binlog_type_info binlog_type_info() const override;
};


class Field_datetime :public Field_temporal_with_date {
protected:
  int store_TIME_with_warning(const Datetime *ltime, const ErrConv *str,
                              int was_cut);
public:
  Field_datetime(uchar *ptr_arg, uint length_arg, uchar *null_ptr_arg,
                 uchar null_bit_arg, enum utype unireg_check_arg,
                 const LEX_CSTRING *field_name_arg)
    :Field_temporal_with_date(ptr_arg, length_arg, null_ptr_arg, null_bit_arg,
                              unireg_check_arg, field_name_arg)
    {
      if (unireg_check == TIMESTAMP_UN_FIELD ||
          unireg_check == TIMESTAMP_DNUN_FIELD)
        flags|= ON_UPDATE_NOW_FLAG;
    }
  const Type_handler *type_handler() const override
  { return &type_handler_datetime; }
  sql_mode_t conversion_depends_on_sql_mode(THD *, Item *) const override;
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  int  store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_time_dec(const MYSQL_TIME *ltime, uint dec) override;
  int  store_decimal(const my_decimal *) override;
  int set_time() override;
  Item *get_equal_const_item(THD *thd, const Context &ctx, Item *const_item)
    override
  {
    return get_equal_const_item_datetime(thd, ctx, const_item);
  }
};


/*
  Stored as a 8 byte unsigned int. Should sometimes be change to a 6 byte
*/

class Field_datetime0 final :public Field_datetime
{
  void store_TIME(const MYSQL_TIME *ltime) override;
  bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
    const override;
public:
  Field_datetime0(uchar *ptr_arg, uint length_arg, uchar *null_ptr_arg,
                 uchar null_bit_arg, enum utype unireg_check_arg,
                 const LEX_CSTRING *field_name_arg)
    :Field_datetime(ptr_arg, length_arg, null_ptr_arg, null_bit_arg,
                    unireg_check_arg, field_name_arg)
  {}
  enum ha_base_keytype key_type() const override
  { return HA_KEYTYPE_ULONGLONG; }
  void sql_type(String &str) const override
  {
    sql_type_comment(str, Field_datetime0::type_handler()->name(),
                     Type_handler::version_mariadb53());
  }
  double val_real() override
  {
    return (double) Field_datetime0::val_int();
  }
  longlong val_int() override;
  String *val_str(String *, String *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return 8; }
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return Field_datetime0::get_TIME(ltime, ptr, fuzzydate); }
  uchar *pack(uchar* to, const uchar *from, uint) override
  {
    return pack_int64(to, from);
  }
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
		      uint) override
  {
    return unpack_int64(to, from, from_end);
  }
  uint size_of() const override { return sizeof *this; }
};


/**
  Abstract class for:
  - DATETIME(1..6)
  - DATETIME(0..6) - MySQL56 version
*/
class Field_datetime_with_dec :public Field_datetime {
protected:
  decimal_digits_t dec;
public:
  Field_datetime_with_dec(uchar *ptr_arg, uchar *null_ptr_arg,
                          uchar null_bit_arg, enum utype unireg_check_arg,
                          const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg)
    :Field_datetime(ptr_arg, MAX_DATETIME_WIDTH + dec_arg + MY_TEST(dec_arg),
                    null_ptr_arg, null_bit_arg, unireg_check_arg,
                    field_name_arg), dec(dec_arg)
  {
    DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
  }
  decimal_digits_t decimals() const override final { return dec; }
  enum ha_base_keytype key_type() const override final { return HA_KEYTYPE_BINARY; }
  void make_send_field(Send_field *field) override final;
  bool send(Protocol *protocol) override final;
  uchar *pack(uchar *to, const uchar *from, uint max_length) override final
  { return Field::pack(to, from, max_length); }
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint param_data) override final
  { return Field::unpack(to, from, from_end, param_data); }
  void sort_string(uchar *to, uint length) override final
  {
    DBUG_ASSERT(length == pack_length());
    memcpy(to, ptr, length);
  }
  double val_real() override final;
  longlong val_int() override final;
  String *val_str(String *, String *) override final;
};


/**
  DATETIME(1..6)
*/
class Field_datetime_hires final :public Field_datetime_with_dec {
  void store_TIME(const MYSQL_TIME *ltime) override;
  bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
    const override;
public:
  Field_datetime_hires(uchar *ptr_arg, uchar *null_ptr_arg,
                       uchar null_bit_arg, enum utype unireg_check_arg,
                       const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg)
    :Field_datetime_with_dec(ptr_arg, null_ptr_arg, null_bit_arg,
                             unireg_check_arg, field_name_arg, dec_arg)
  {
    DBUG_ASSERT(dec);
  }
  void sql_type(String &str) const override
  {
    sql_type_dec_comment(str, Field_datetime_hires::type_handler()->name(),
                         dec, Type_handler::version_mariadb53());
  }
  int cmp(const uchar *,const uchar *) const override;
  uint32 pack_length() const override
  { return Type_handler_datetime::hires_bytes(dec); }
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return Field_datetime_hires::get_TIME(ltime, ptr, fuzzydate); }
  uint size_of() const override { return sizeof *this; }
};


/**
  DATETIME(0..6) - MySQL56 version
*/

class Field_datetimef final :public Field_datetime_with_dec {
  void store_TIME(const MYSQL_TIME *ltime) override;
  bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
    const override;
public:
  Field_datetimef(uchar *ptr_arg, uchar *null_ptr_arg,
                  uchar null_bit_arg, enum utype unireg_check_arg,
                  const LEX_CSTRING *field_name_arg,  decimal_digits_t dec_arg)
    :Field_datetime_with_dec(ptr_arg, null_ptr_arg, null_bit_arg,
                             unireg_check_arg, field_name_arg, dec_arg)
  {}
  const Type_handler *type_handler() const override
  { return &type_handler_datetime2; }
  enum_field_types binlog_type() const override
  { return MYSQL_TYPE_DATETIME2; }
  void sql_type(String &str) const override
  {
    sql_type_opt_dec_comment(str, Field_datetimef::type_handler()->name(),
                             dec, type_version_mysql56());
  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  uint32 pack_length() const override
  {
    return my_datetime_binary_length(dec);
  }
  uint row_pack_length() const override { return pack_length(); }
  uint pack_length_from_metadata(uint field_metadata) const override
  {
    DBUG_ENTER("Field_datetimef::pack_length_from_metadata");
    uint tmp= my_datetime_binary_length(field_metadata);
    DBUG_RETURN(tmp);
  }
  int cmp(const uchar *a_ptr, const uchar *b_ptr) const override
  {
    return memcmp(a_ptr, b_ptr, pack_length());
  }
  int reset() override;
  bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return Field_datetimef::get_TIME(ltime, ptr, fuzzydate); }
  longlong val_datetime_packed(THD *thd) override;
  uint size_of() const override { return sizeof *this; }
  Binlog_type_info binlog_type_info() const override;
};


static inline Field_timestamp *
new_Field_timestamp(MEM_ROOT *root,uchar *ptr, uchar *null_ptr, uchar null_bit,
                    enum Field::utype unireg_check,
                    const LEX_CSTRING *field_name,
                    TABLE_SHARE *share, decimal_digits_t dec)
{
  if (dec==0)
    return new (root)
      Field_timestamp0(ptr, MAX_DATETIME_WIDTH, null_ptr,
                       null_bit, unireg_check, field_name, share);
  if (dec >= FLOATING_POINT_DECIMALS)
    dec= MAX_DATETIME_PRECISION;
  return new (root)
    Field_timestamp_hires(ptr, null_ptr, null_bit, unireg_check,
                          field_name, share, dec);
}

static inline Field_time *
new_Field_time(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit,
               enum Field::utype unireg_check, const LEX_CSTRING *field_name,
               decimal_digits_t dec)
{
  if (dec == 0)
    return new (root)
      Field_time0(ptr, MIN_TIME_WIDTH, null_ptr, null_bit, unireg_check,
                  field_name);
  if (dec >= FLOATING_POINT_DECIMALS)
    dec= MAX_DATETIME_PRECISION;
  return new (root)
    Field_time_hires(ptr, null_ptr, null_bit, unireg_check, field_name, dec);
}

static inline Field_datetime *
new_Field_datetime(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit,
                   enum Field::utype unireg_check,
                   const LEX_CSTRING *field_name, decimal_digits_t dec)
{
  if (dec == 0)
    return new (root)
      Field_datetime0(ptr, MAX_DATETIME_WIDTH, null_ptr, null_bit,
                      unireg_check, field_name);
  if (dec >= FLOATING_POINT_DECIMALS)
    dec= MAX_DATETIME_PRECISION;
  return new (root)
    Field_datetime_hires(ptr, null_ptr, null_bit,
                         unireg_check, field_name, dec);
}

class Field_string final :public Field_longstr {
  class Warn_filter_string: public Warn_filter
  {
  public:
    Warn_filter_string(const THD *thd, const Field_string *field);
  };
  bool is_var_string() const
  {
    return can_alter_field_type &&
           orig_table &&
           (orig_table->s->db_create_options & HA_OPTION_PACK_RECORD) &&
           field_length >= 4 &&
           orig_table->s->frm_version < FRM_VER_TRUE_VARCHAR;
  }
  LEX_CSTRING to_lex_cstring() const;
public:
  bool can_alter_field_type;
  Field_string(uchar *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
	       uchar null_bit_arg,
	       enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	       const DTCollation &collation)
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                   unireg_check_arg, field_name_arg, collation),
     can_alter_field_type(1) {};
  Field_string(uint32 len_arg,bool maybe_null_arg,
               const LEX_CSTRING *field_name_arg,
               const DTCollation &collation)
    :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, collation),
     can_alter_field_type(1) {};

  const Type_handler *type_handler() const override;
  enum ha_base_keytype key_type() const override
    { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
  en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override;
  bool zero_pack() const override { return false; }
  Copy_func *get_copy_func(const Field *from) const override;
  int reset() override
  {
    charset()->fill((char*) ptr, field_length, (has_charset() ? ' ' : 0));
    return 0;
  }
  int store(const char *to,size_t length,CHARSET_INFO *charset) override;
  using Field_str::store;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  my_decimal *val_decimal(my_decimal *) override;
  int cmp(const uchar *,const uchar *) const override;
  int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
    override;
  void sort_string(uchar *buff,uint length) override;
  void update_data_type_statistics(Data_type_statistics *st) const override
  {
    st->m_fixed_string_count++;
    st->m_fixed_string_total_length+= pack_length();
  }
  void sql_type(String &str) const override;
  void sql_rpl_type(String*) const override;
  bool is_equal(const Column_definition &new_field) const override;
  uchar *pack(uchar *to, const uchar *from, uint max_length) override;
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint param_data) override;
  uint pack_length_from_metadata(uint field_metadata) const override
  {
    DBUG_PRINT("debug", ("field_metadata: 0x%04x", field_metadata));
    if (field_metadata == 0)
      return row_pack_length();
    return (((field_metadata >> 4) & 0x300) ^ 0x300) + (field_metadata & 0x00ff);
  }
  bool compatible_field_size(uint field_metadata, const Relay_log_info *rli,
                             uint16 mflags, int *order_var) const override;
  uint row_pack_length() const override { return field_length; }
  uint packed_col_length(const uchar *to, uint length) override;
  uint max_packed_col_length(uint max_length) override;
  uint size_of() const override { return sizeof *this; }
  bool has_charset() const override { return charset() != &my_charset_bin; }
  Field *make_new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type)
    override;
  uint get_key_image(uchar *buff, uint length,
                     const uchar *ptr_arg, imagetype type) const override;
  sql_mode_t value_depends_on_sql_mode() const override;
  sql_mode_t can_handle_sql_mode_dependency_on_store() const override;
  void print_key_value(String *out, uint32 length) override;
  Binlog_type_info binlog_type_info() const override;
};


class Field_varstring :public Field_longstr {
public:
  const uchar *get_data() const
  {
    return get_data(ptr);
  }
  const uchar *get_data(const uchar *ptr_arg) const
  {
    return ptr_arg + length_bytes;
  }
  uint get_length() const
  {
    return get_length(ptr);
  }
  uint get_length(const uchar *ptr_arg) const
  {
    return length_bytes == 1 ? (uint) *ptr_arg : uint2korr(ptr_arg);
  }
protected:
  void store_length(uint32 number)
  {
    if (length_bytes == 1)
      *ptr= (uchar) number;
    else
      int2store(ptr, number);
  }
  virtual void val_str_from_ptr(String *val, const uchar *ptr) const;
public:
  /*
    The maximum space available in a Field_varstring, in bytes. See
    length_bytes.
  */
  static const uint MAX_SIZE;
  /* Store number of bytes used to store length (1 or 2) */
  uint32 length_bytes;
  Field_varstring(uchar *ptr_arg,
                  uint32 len_arg, uint length_bytes_arg,
                  uchar *null_ptr_arg, uchar null_bit_arg,
		  enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
		  TABLE_SHARE *share, const DTCollation &collation)
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                   unireg_check_arg, field_name_arg, collation),
     length_bytes(length_bytes_arg)
  {
    share->varchar_fields++;
  }
  Field_varstring(uint32 len_arg,bool maybe_null_arg,
                  const LEX_CSTRING *field_name_arg,
                  TABLE_SHARE *share, const DTCollation &collation)
    :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, collation),
     length_bytes(len_arg < 256 ? 1 :2)
  {
    share->varchar_fields++;
  }

  const Type_handler *type_handler() const override;
  en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override
  {
    return FIELD_VARCHAR;
  }
  enum ha_base_keytype key_type() const override;
  uint16 key_part_flag() const override { return HA_VAR_LENGTH_PART; }
  uint16 key_part_length_bytes() const override { return HA_KEY_BLOB_LENGTH; }
  uint row_pack_length() const override { return field_length; }
  bool zero_pack() const override { return false; }
  int  reset() override { bzero(ptr,field_length+length_bytes); return 0; }
  uint32 pack_length() const override
  { return (uint32) field_length+length_bytes; }
  uint32 key_length() const override { return (uint32) field_length; }
  uint32 sort_length() const override
  {
    return (uint32) field_length + sort_suffix_length();
  }
  uint32 sort_suffix_length() const override
  {
    return (field_charset() == &my_charset_bin ? length_bytes : 0);
  }
  Copy_func *get_copy_func(const Field *from) const override;
  bool memcpy_field_possible(const Field *from) const override;
  void update_data_type_statistics(Data_type_statistics *st) const override
  {
    st->m_variable_string_count++;
    st->m_variable_string_total_length+= pack_length();
  }
  int  store(const char *to,size_t length,CHARSET_INFO *charset) override;
  using Field_str::store;
#ifdef HAVE_MEM_CHECK
  void mark_unused_memory_as_defined() override;
#endif
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool send(Protocol *protocol) override;
  int cmp(const uchar *a,const uchar *b) const override;
  int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
    override;
  void sort_string(uchar *buff,uint length) override;
  uint get_key_image(uchar *buff, uint length,
                     const uchar *ptr_arg, imagetype type) const override;
  void set_key_image(const uchar *buff,uint length) override;
  void sql_type(String &str) const override;
  void sql_rpl_type(String*) const override;
  uchar *pack(uchar *to, const uchar *from, uint max_length) override;
  const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
                      uint param_data) override;
  int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) const
    override;
  int key_cmp(const uchar *,const uchar*) const override;
  int key_cmp(const uchar *str, uint length) const override;
  uint packed_col_length(const uchar *to, uint length) override;
  uint max_packed_col_length(uint max_length) override;
  uint32 data_length() override;
  uint size_of() const override { return sizeof *this; }
  bool has_charset() const override
  { return charset() == &my_charset_bin ? FALSE : TRUE; }
  Field *make_new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type)
    override;
  Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                       uchar *new_ptr, uint32 length,
                       uchar *new_null_ptr, uint new_null_bit) override;
  bool is_equal(const Column_definition &new_field) const override;
  void hash_not_null(Hasher *hasher) override;
  uint length_size() const override { return length_bytes; }
  void print_key_value(String *out, uint32 length) override;
  Binlog_type_info binlog_type_info() const override;
};


class Field_varstring_compressed final :public Field_varstring {
public:
  Field_varstring_compressed(uchar *ptr_arg,
                             uint32 len_arg, uint length_bytes_arg,
                             uchar *null_ptr_arg, uchar null_bit_arg,
                             enum utype unireg_check_arg,
                             const LEX_CSTRING *field_name_arg,
                             TABLE_SHARE *share, const DTCollation &collation,
                             Compression_method *compression_method_arg):
    Field_varstring(ptr_arg, len_arg, length_bytes_arg, null_ptr_arg,
                    null_bit_arg, unireg_check_arg, field_name_arg,
                    share, collation),
    compression_method_ptr(compression_method_arg) { DBUG_ASSERT(len_arg > 0); }
  Compression_method *compression_method() const override
  { return compression_method_ptr; }
private:
  Compression_method *compression_method_ptr;
  void val_str_from_ptr(String *val, const uchar *ptr) const override;
  int store(const char *to, size_t length, CHARSET_INFO *charset) override;
  using Field_str::store;
  String *val_str(String *, String *) override;
  double val_real() override;
  longlong val_int() override;
  uint size_of() const override { return sizeof *this; }
  /*
    We use the default Field::send() implementation,
    because the derived optimized version (from Field_longstr)
    is not suitable for compressed fields.
  */
  bool send(Protocol *protocol) override
  {
    return Field::send(protocol);
  }
  enum_field_types binlog_type() const override
  { return MYSQL_TYPE_VARCHAR_COMPRESSED; }
  void sql_type(String &str) const override
  {
    Field_varstring::sql_type(str);
    str.append(STRING_WITH_LEN(" /*M!100301 COMPRESSED*/"));
  }
  uint32 max_display_length() const override { return field_length - 1; }
  uint32 character_octet_length() const override { return field_length - 1; }
  uint32 char_length() const override
  {
    return (field_length - 1) / mbmaxlen();
  }
  int cmp(const uchar *a_ptr, const uchar *b_ptr) const override;

  /*
    Compressed fields can't have keys as two rows may have different
    compression methods or compression levels.
  */

  int key_cmp(const uchar *str, uint length) const override
  { DBUG_ASSERT(0); return 0; }
  using Field_varstring::key_cmp;
  Binlog_type_info binlog_type_info() const override;
};


static inline uint8 number_storage_requirement(uint32 n)
{
  return n < 256 ? 1 : n < 65536 ? 2 : n < 16777216 ? 3 : 4;
}


static inline void store_bigendian(ulonglong num, uchar *to, uint bytes)
{
  switch(bytes) {
  case 1: mi_int1store(to, num); break;
  case 2: mi_int2store(to, num); break;
  case 3: mi_int3store(to, num); break;
  case 4: mi_int4store(to, num); break;
  case 5: mi_int5store(to, num); break;
  case 6: mi_int6store(to, num); break;
  case 7: mi_int7store(to, num); break;
  case 8: mi_int8store(to, num); break;
  default: DBUG_ASSERT(0);
  }
}


static inline longlong read_bigendian(const uchar *from, uint bytes)
{
  switch(bytes) {
  case 1: return mi_uint1korr(from);
  case 2: return mi_uint2korr(from);
  case 3: return mi_uint3korr(from);
  case 4: return mi_uint4korr(from);
  case 5: return mi_uint5korr(from);
  case 6: return mi_uint6korr(from);
  case 7: return mi_uint7korr(from);
  case 8: return mi_sint8korr(from);
  default: DBUG_ASSERT(0); return 0;
  }
}

static inline void store_lowendian(ulonglong num, uchar *to, uint bytes)
{
  switch(bytes) {
  case 1: *to= (uchar)num;    break;
  case 2: int2store(to, num); break;
  case 3: int3store(to, num); break;
  case 4: int4store(to, num); break;
  case 8: int8store(to, num); break;
  default: DBUG_ASSERT(0);
  }
}

static inline longlong read_lowendian(const uchar *from, uint bytes)
{
  switch(bytes) {
  case 1: return from[0];
  case 2: return uint2korr(from);
  case 3: return uint3korr(from);
  case 4: return uint4korr(from);
  case 8: return sint8korr(from);
  default: DBUG_ASSERT(0); return 0;
  }
}


extern LEX_CSTRING temp_lex_str;

class Field_blob :public Field_longstr {
protected:
  /**
    The number of bytes used to represent the length of the blob.
  */
  uint packlength;
  
  /**
    The 'value'-object is a cache fronting the storage engine.
  */
  String value;
  /**
     Cache for blob values when reading a row with a virtual blob
     field. This is needed to not destroy the old cached value when
     updating the blob with a new value when creating the new row.
  */
  String read_value;

  static void do_copy_blob(Copy_field *copy);
  static void do_conv_blob(Copy_field *copy);
  uint get_key_image_itRAW(const uchar *ptr_arg, uchar *buff, uint length) const;
public:
  Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	     TABLE_SHARE *share, uint blob_pack_length,
	     const DTCollation &collation);
  Field_blob(uint32 len_arg,bool maybe_null_arg, const LEX_CSTRING *field_name_arg,
             const DTCollation &collation)
    :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, collation),
    packlength(4)
  {
    flags|= BLOB_FLAG;
  }
  Field_blob(uint32 len_arg,bool maybe_null_arg,
             const LEX_CSTRING *field_name_arg,
             const DTCollation &collation, bool set_packlength)
    :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, collation)
  {
    flags|= BLOB_FLAG;
    packlength= set_packlength ? number_storage_requirement(len_arg) : 4;
  }
  Field_blob(uint32 packlength_arg)
    :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, &temp_lex_str,
                   system_charset_info),
    packlength(packlength_arg) {}
  const Type_handler *type_handler() const override;
  /* Note that the default copy constructor is used, in clone() */
  enum_field_types type() const override
  {
    /*
      We cannot return type_handler()->field_type() here.
      Some pieces of the code (e.g. in engines) rely on the fact
      that Field::type(), Field::real_type() and Item_field::field_type()
      return MYSQL_TYPE_BLOB for all blob variants.
      We should eventually fix all such code pieces to expect
      all BLOB type codes.
    */
    return MYSQL_TYPE_BLOB;
  }
  enum_field_types real_type() const override
  {
    return MYSQL_TYPE_BLOB;
  }
  enum ha_base_keytype key_type() const override
    { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
  uint16 key_part_flag() const override { return HA_BLOB_PART; }
  uint16 key_part_length_bytes() const override { return HA_KEY_BLOB_LENGTH; }
  en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override
  {
    return FIELD_BLOB;
  }
  Type_numeric_attributes type_numeric_attributes() const override
  {
    return Type_numeric_attributes(Field_blob::max_display_length(),
                                   decimals(), is_unsigned());
  }
  Information_schema_character_attributes
    information_schema_character_attributes() const override
  {
    uint32 octets= Field_blob::character_octet_length();
    uint32 chars= octets / field_charset()->mbminlen;
    return Information_schema_character_attributes(octets, chars);
  }
  void update_data_type_statistics(Data_type_statistics *st) const override
  {
    st->m_blob_count++;
  }
  void make_send_field(Send_field *) override;
  Copy_func *get_copy_func(const Field *from) const override
  {
    /*
    TODO: MDEV-9331
    if (from->type() == MYSQL_TYPE_BIT)
      return do_field_int;
    */
    if (!(from->flags & BLOB_FLAG) || from->charset() != charset() ||
        !from->compression_method() != !compression_method())
      return do_conv_blob;
    if (from->pack_length() != Field_blob::pack_length())
      return do_copy_blob;
    return get_identical_copy_func();
  }
  int  store_field(Field *from) override
  {                                             // Be sure the value is stored
    if (field_charset() == &my_charset_bin &&
        from->type_handler()->convert_to_binary_using_val_native())
    {
      NativeBuffer<64> tmp;
      from->val_native(&tmp);
      value.copy(tmp.ptr(), tmp.length(), &my_charset_bin);
      return store(value.ptr(), value.length(), &my_charset_bin);
    }
    from->val_str(&value);
    if (table->copy_blobs ||
        (!value.is_alloced() && from->is_varchar_and_in_write_set()))
      value.copy();
    return store(value.ptr(), value.length(), from->charset());
  }
  bool memcpy_field_possible(const Field *from) const override
  {
    return Field_str::memcpy_field_possible(from) &&
           !compression_method() == !from->compression_method() &&
           !table->copy_blobs;
  }
  bool make_empty_rec_store_default_value(THD *thd, Item *item) override;
  int store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int store_from_statistical_minmax_field(Field *stat_field, String *str,
                                          MEM_ROOT *mem) override;
  using Field_str::store;
  void hash_not_null(Hasher *hasher) override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  my_decimal *val_decimal(my_decimal *) override;
  int cmp(const uchar *a, const uchar *b) const override;
  int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
    override;
  int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length)
    const;
  int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) const
     override;
  int key_cmp(const uchar *,const uchar*) const override;
  int key_cmp(const uchar *str, uint length) const override;
  /* Never update the value of min_val for a blob field */
  bool update_min(Field *min_val, bool force_update) override { return false; }
  /* Never update the value of max_val for a blob field */
  bool update_max(Field *max_val, bool force_update) override { return false; }
  uint32 key_length() const override { return 0; }
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override
  { return (uint32) (packlength + portable_sizeof_char_ptr); }

  /**
     Return the packed length without the pointer size added. 

     This is used to determine the size of the actual data in the row
     buffer.

     @returns The length of the raw data itself without the pointer.
  */
  uint32 pack_length_no_ptr() const
  { return (uint32) (packlength); }
  uint row_pack_length() const override { return pack_length_no_ptr(); }
  uint32 sort_length() const override;
  uint32 sort_suffix_length() const override;
  uint32 value_length() override { return get_length(); }
  uint32 max_data_length() const override
  {
    return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
  }
  int reset() override { bzero(ptr, packlength+sizeof(uchar*)); return 0; }
  void reset_fields() override
  {
    bzero((uchar*) &value, sizeof value);
    bzero((uchar*) &read_value, sizeof read_value);
  }
  uint32 get_field_buffer_size() { return value.alloced_length(); }
  void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number);
  void store_length(size_t number)
  {
    DBUG_ASSERT(number < UINT_MAX32);
    store_length(ptr, packlength, (uint32)number);
  }
  inline uint32 get_length(my_ptrdiff_t row_offset= 0) const
  { return get_length(ptr+row_offset, this->packlength); }
  uint32 get_length(const uchar *ptr, uint packlength) const;
  uint32 get_length(const uchar *ptr_arg) const
  { return get_length(ptr_arg, this->packlength); }
  inline uchar *get_ptr() const { return get_ptr(ptr); }
  inline uchar *get_ptr(const uchar *ptr_arg) const
  {
    uchar *s;
    memcpy(&s, ptr_arg + packlength, sizeof(uchar*));
    return s;
  }
  inline void set_ptr(uchar *length, uchar *data)
  {
    memcpy(ptr,length,packlength);
    memcpy(ptr+packlength, &data,sizeof(char*));
  }
  void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, const uchar *data)
  {
    uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*);
    store_length(ptr_ofs, packlength, length);
    memcpy(ptr_ofs+packlength, &data, sizeof(char*));
  }
  inline void set_ptr(uint32 length, uchar *data)
  {
    set_ptr_offset(0, length, data);
  }
  int copy_value(Field_blob *from);
  uint get_key_image(uchar *buff, uint length,
                     const uchar *ptr_arg, imagetype type) const override
  {
    DBUG_ASSERT(type == itRAW);
    return get_key_image_itRAW(ptr_arg, buff, length);
  }
  void set_key_image(const uchar *buff,uint length) override;
  Field *make_new_field(MEM_ROOT *, TABLE *new_table, bool keep_type) override;
  Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                       uchar *new_ptr, uint32 length,
                       uchar *new_null_ptr, uint new_null_bit) override;
  void sql_type(String &str) const override;
  /**
     Copy blob buffer into internal storage "value" and update record pointer.

     @retval true     Memory allocation error
     @retval false    Success
  */
  bool copy()
  {
    uchar *tmp= get_ptr();
    if (value.copy((char*) tmp, get_length(), charset()))
    {
      Field_blob::reset();
      return 1;
    }
    tmp=(uchar*) value.ptr();
    memcpy(ptr+packlength, &tmp, sizeof(char*));
    return 0;
  }
  void swap(String &inout, bool set_read_value)
  {
    if (set_read_value)
      read_value.swap(inout);
    else
      value.swap(inout);
  }
  /**
     Return pointer to blob cache or NULL if not cached.
  */
  String * cached(bool *set_read_value)
  {
    char *tmp= (char *) get_ptr();
    if (!value.is_empty() && tmp == value.ptr())
    {
      *set_read_value= false;
      return &value;
    }

    if (!read_value.is_empty() && tmp == read_value.ptr())
    {
      *set_read_value= true;
      return &read_value;
    }

    return NULL;
  }
  /* store value for the duration of the current read record */
  inline void swap_value_and_read_value()
  {
    read_value.swap(value);
  }
  inline void set_value(uchar *data)
  {
    /* Set value pointer. Lengths are not important */
    value.reset((char*) data, 1, 1, &my_charset_bin);
  }
  uchar *pack(uchar *to, const uchar *from, uint max_length) override;
  const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
                      uint param_data) override;
  uint packed_col_length(const uchar *col_ptr, uint length) override;
  uint max_packed_col_length(uint max_length) override;
  void free() override
  {
    value.free();
    read_value.free();
  }
  inline void clear_temporary()
  {
    uchar *tmp= get_ptr();
    if (likely(value.ptr() == (char*) tmp))
      bzero((uchar*) &value, sizeof(value));
    else
    {
      /*
        Currently read_value should never point to tmp, the following code
        is mainly here to make things future proof.
      */
      if (unlikely(read_value.ptr() == (char*) tmp))
        bzero((uchar*) &read_value, sizeof(read_value));
    }
  }
  uint size_of() const override { return sizeof *this; }
  bool has_charset() const override { return charset() != &my_charset_bin; }
  uint32 max_display_length() const override;
  uint32 char_length() const override;
  uint32 character_octet_length() const override;
  bool is_equal(const Column_definition &new_field) const override;
  void print_key_value(String *out, uint32 length) override;
  Binlog_type_info binlog_type_info() const override;

  friend void TABLE::remember_blob_values(String *blob_storage);
  friend void TABLE::restore_blob_values(String *blob_storage);
};


class Field_blob_compressed final :public Field_blob {
public:
  Field_blob_compressed(uchar *ptr_arg, uchar *null_ptr_arg,
                        uchar null_bit_arg, enum utype unireg_check_arg,
                        const LEX_CSTRING *field_name_arg, TABLE_SHARE *share,
                        uint blob_pack_length, const DTCollation &collation,
                        Compression_method *compression_method_arg):
    Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
               field_name_arg, share, blob_pack_length, collation),
    compression_method_ptr(compression_method_arg) {}
  Compression_method *compression_method() const override
  { return compression_method_ptr; }
private:
  Compression_method *compression_method_ptr;
  int store(const char *to, size_t length, CHARSET_INFO *charset) override;
  using Field_str::store;
  String *val_str(String *, String *) override;
  double val_real() override;
  longlong val_int() override;
  /*
    We use the default Field::send() implementation,
    because the derived optimized version (from Field_longstr)
    is not suitable for compressed fields.
  */
  bool send(Protocol *protocol) override
  {
    return Field::send(protocol);
  }
  uint size_of() const override { return sizeof *this; }
  enum_field_types binlog_type() const override
  { return MYSQL_TYPE_BLOB_COMPRESSED; }
  void sql_type(String &str) const override
  {
    Field_blob::sql_type(str);
    str.append(STRING_WITH_LEN(" /*M!100301 COMPRESSED*/"));
  }

  /*
    Compressed fields can't have keys as two rows may have different
    compression methods or compression levels.
  */

  uint get_key_image(uchar *buff, uint length,
                     const uchar *ptr_arg, imagetype type_arg) const override
  { DBUG_ASSERT(0); return 0; }
  void set_key_image(const uchar *, uint) override
  { DBUG_ASSERT(0); }
  int key_cmp(const uchar *, const uchar *) const override
  { DBUG_ASSERT(0); return 0; }
  int key_cmp(const uchar *, uint) const override
  { DBUG_ASSERT(0); return 0; }
  Field *new_key_field(MEM_ROOT *, TABLE *, uchar *, uint32, uchar *, uint)
    override
  { DBUG_ASSERT(0); return 0; }
  Binlog_type_info binlog_type_info() const override;
};


class Field_enum :public Field_str {
  static void do_field_enum(Copy_field *copy_field);
  longlong val_int(const uchar *) const;
  Data_type_compatibility can_optimize_range_or_keypart_ref(
                                         const Item_bool_func *cond,
                                         const Item *item) const;
protected:
  uint packlength;
public:
  const TYPELIB *typelib;
  Field_enum(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
             uchar null_bit_arg,
             enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
             uint packlength_arg,
             const TYPELIB *typelib_arg,
             const DTCollation &collation)
    :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
	       unireg_check_arg, field_name_arg, collation),
    packlength(packlength_arg),typelib(typelib_arg)
  {
      flags|=ENUM_FLAG;
  }
  Field *make_new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type)
    override;
  const Type_handler *type_handler() const override
  { return &type_handler_enum; }
  enum ha_base_keytype key_type() const override;
  sql_mode_t can_handle_sql_mode_dependency_on_store() const override;
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  Copy_func *get_copy_func(const Field *from) const override
  {
    if (eq_def(from))
      return get_identical_copy_func();
    if (real_type() == MYSQL_TYPE_ENUM &&
        from->real_type() == MYSQL_TYPE_ENUM)
      return do_field_enum;
    if (from->result_type() == STRING_RESULT)
      return do_field_string;
    return do_field_int;
  }
  int store_field(Field *from) override
  {
    if (from->real_type() == MYSQL_TYPE_ENUM && from->val_int() == 0)
    {
      store_type(0);
      return 0;
    }
    return from->save_in_field(this);
  }
  int save_in_field(Field *to) override
  {
    if (to->result_type() != STRING_RESULT)
      return to->store(val_int(), 0);
    return save_in_field_str(to);
  }
  bool memcpy_field_possible(const Field *from) const override
  { return false; }
  void make_empty_rec_reset(THD *) override
  {
    if (flags & NOT_NULL_FLAG)
    {
      set_notnull();
      store((longlong) 1, true);
    }
    else
      reset();
  }
  int  store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *, String *) override;
  int cmp(const uchar *,const uchar *) const override;
  void sort_string(uchar *buff,uint length) override;
  uint32 pack_length() const override { return (uint32) packlength; }
  void store_type(ulonglong value);
  void sql_type(String &str) const override;
  uint size_of() const override { return sizeof *this; }
  uint pack_length_from_metadata(uint field_metadata) const override
  { return (field_metadata & 0x00ff); }
  uint row_pack_length() const override { return pack_length(); }
  bool zero_pack() const override { return false; }
  bool optimize_range(uint, uint) const override { return false; }
  bool eq_def(const Field *field) const override;
  bool has_charset() const override { return true; }
  /* enum and set are sorted as integers */
  CHARSET_INFO *sort_charset() const override { return &my_charset_bin; }
  decimal_digits_t decimals() const override { return 0; }
  const TYPELIB *get_typelib() const override { return typelib; }

  uchar *pack(uchar *to, const uchar *from, uint max_length) override;
  const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
                      uint param_data) override;

  Data_type_compatibility can_optimize_keypart_ref(const Item_bool_func *cond,
                                                   const Item *item)
                                                   const override
  {
    return can_optimize_range_or_keypart_ref(cond, item);
  }
  Data_type_compatibility can_optimize_group_min_max(const Item_bool_func *cond,
                                                     const Item *const_item)
                                                     const override
  {
    /*
      Can't use GROUP_MIN_MAX optimization for ENUM and SET,
      because the values are stored as numbers in index,
      while MIN() and MAX() work as strings.
      It would return the records with min and max enum numeric indexes.
     "Bug#45300 MAX() and ENUM type" should be fixed first.
    */
    return Data_type_compatibility::INCOMPATIBLE_DATA_TYPE;
  }
  Data_type_compatibility can_optimize_range(const Item_bool_func *cond,
                                             const Item *item,
                                             bool is_eq_func) const override
  {
    return can_optimize_range_or_keypart_ref(cond, item);
  }
  Binlog_type_info binlog_type_info() const override;
private:
  bool is_equal(const Column_definition &new_field) const override;
};


class Field_set final :public Field_enum {
public:
  Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
	    uchar null_bit_arg, enum utype unireg_check_arg,
            const LEX_CSTRING *field_name_arg, uint32 packlength_arg,
	    const TYPELIB *typelib_arg, const DTCollation &collation)
    :Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
                field_name_arg, packlength_arg, typelib_arg, collation)
    {
      flags=(flags & ~ENUM_FLAG) | SET_FLAG;
    }
  void make_empty_rec_reset(THD *thd) override
  {
    Field::make_empty_rec_reset(thd);
  }

  int  store_field(Field *from) override { return from->save_in_field(this); }
  int  store(const char *to,size_t length,CHARSET_INFO *charset) override;
  int  store(double nr) override
  { return Field_set::store((longlong) nr, FALSE); }
  int  store(longlong nr, bool unsigned_val) override;

  bool zero_pack() const override { return true; }
  String *val_str(String *, String *) override;
  void sql_type(String &str) const override;
  uint size_of() const override { return sizeof *this; }
  const Type_handler *type_handler() const override
  { return &type_handler_set; }
  bool has_charset() const override { return true; }
  Binlog_type_info binlog_type_info() const override;
};


/*
  Note:
    To use Field_bit::cmp_binary() you need to copy the bits stored in
    the beginning of the record (the NULL bytes) to each memory you
    want to compare (where the arguments point).

    This is the reason:
    - Field_bit::cmp_binary() is only implemented in the base class
      (Field::cmp_binary()).
    - Field::cmp_binary() currently uses pack_length() to calculate how
      long the data is.
    - pack_length() includes size of the bits stored in the NULL bytes
      of the record.
*/
class Field_bit :public Field {
public:
  uchar *bit_ptr;     // position in record where 'uneven' bits store
  uchar bit_ofs;      // offset to 'uneven' high bits
  uint bit_len;       // number of 'uneven' high bits
  uint bytes_in_rec;
  Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
            uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg,
            enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg);
  const Type_handler *type_handler() const override
  { return &type_handler_bit; }
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BIT; }
  uint16 key_part_flag() const override { return HA_BIT_PART; }
  uint32 key_length() const override
  { return (uint32) (field_length + 7) / 8; }
  uint32 max_data_length() const override { return key_length(); }
  uint32 max_display_length() const override { return field_length; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  CHARSET_INFO *charset() const override { return &my_charset_bin; }
  const DTCollation & dtcollation() const override;
  Information_schema_numeric_attributes
    information_schema_numeric_attributes() const override
  {
    return Information_schema_numeric_attributes(field_length);
  }
  void update_data_type_statistics(Data_type_statistics *st) const override
  {
    st->m_uneven_bit_length+= field_length & 7;
  }
  uint size_of() const override { return sizeof *this; }
  int reset() override
  {
    bzero(ptr, bytes_in_rec); 
    if (bit_ptr && (bit_len > 0))  // reset odd bits among null bits
      clr_rec_bits(bit_ptr, bit_ofs, bit_len);
    return 0; 
  }
  Copy_func *get_copy_func(const Field *from) const override
  {
    if (from->cmp_type() == DECIMAL_RESULT)
      return do_field_decimal;
    return do_field_int;
  }
  int save_in_field(Field *to) override { return to->store(val_int(), true); }
  bool memcpy_field_possible(const Field *from) const override{ return false; }
  int store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int store(double nr) override;
  int store(longlong nr, bool unsigned_val) override;
  int store_decimal(const my_decimal *) override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String*, String *) override;
  bool str_needs_quotes() const override { return true; }
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override { return val_int() != 0; }
  int cmp(const uchar *a, const uchar *b) const override
  {
    DBUG_ASSERT(ptr == a || ptr == b);
    if (ptr == a)
      return Field_bit::key_cmp(b, bytes_in_rec + MY_TEST(bit_len));
    else
      return Field_bit::key_cmp(a, bytes_in_rec + MY_TEST(bit_len)) * -1;
  }
  int cmp_binary_offset(uint row_offset) override
  { return cmp_offset(row_offset); }
  int cmp_prefix(const uchar *a, const uchar *b,
                 size_t  prefix_char_length) const override;
  int key_cmp(const uchar *a, const uchar *b) const override
  { return cmp_binary((uchar *) a, (uchar *) b); }
  int key_cmp(const uchar *str, uint length) const override;
  int cmp_offset(my_ptrdiff_t row_offset) override;
  bool update_min(Field *min_val, bool force_update) override
  {
    longlong val= val_int();
    bool update_fl= force_update || val < min_val->val_int();
    if (update_fl)
    {
      min_val->set_notnull();
      min_val->store(val, FALSE);
    }
    return update_fl;
  }
  bool update_max(Field *max_val, bool force_update) override
  {
    longlong val= val_int();
    bool update_fl= force_update || val > max_val->val_int();
    if (update_fl)
    {
      max_val->set_notnull();
      max_val->store(val, FALSE);
    }
    return update_fl;
  }
  void store_field_value(uchar *val, uint) override
  {
    store(*((longlong *)val), TRUE);
  }
  double pos_in_interval(Field *min, Field *max) override
  {
    return pos_in_interval_val_real(min, max);
  }
  void get_image(uchar *buff, uint length,
                 const uchar *ptr_arg, CHARSET_INFO *cs) const override
  { get_key_image(buff, length, ptr_arg, itRAW); }
  void set_image(const uchar *buff,uint length, CHARSET_INFO *cs) override
  { Field_bit::store((char *) buff, length, cs); }
  uint get_key_image(uchar *buff, uint length,
                     const uchar *ptr_arg, imagetype type) const override;
  void set_key_image(const uchar *buff, uint length) override
  { Field_bit::store((char*) buff, length, &my_charset_bin); }
  void sort_string(uchar *buff, uint length) override
  { get_key_image(buff, length, ptr, itRAW); }
  uint32 pack_length() const override
  { return (uint32) (field_length + 7) / 8; }
  uint32 pack_length_in_rec() const override { return bytes_in_rec; }
  uint pack_length_from_metadata(uint field_metadata) const override;
  uint row_pack_length() const override
  { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); }
  bool compatible_field_size(uint metadata, const Relay_log_info *rli,
                             uint16 mflags, int *order_var) const override;
  void sql_type(String &str) const override;
  uchar *pack(uchar *to, const uchar *from, uint max_length) override;
  const uchar *unpack(uchar *to, const uchar *from,
                      const uchar *from_end, uint param_data) override;
  int set_default() override;

  Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                       uchar *new_ptr, uint32 length,
                       uchar *new_null_ptr, uint new_null_bit) override;
  void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)
  {
    bit_ptr= bit_ptr_arg;
    bit_ofs= bit_ofs_arg;
  }
  bool eq(Field *field) override
  {
    return (Field::eq(field) &&
            bit_ptr == ((Field_bit *)field)->bit_ptr &&
            bit_ofs == ((Field_bit *)field)->bit_ofs);
  }
  bool is_equal(const Column_definition &new_field) const override;
  void move_field_offset(my_ptrdiff_t ptr_diff) override
  {
    Field::move_field_offset(ptr_diff);

    /*
      clang does not like when things are added to a null pointer, even if
      it is never referenced.
    */
    if (bit_ptr)
      bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*);
  }
  void hash_not_null(Hasher *hasher) override;

  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, KEY_PART *key_part,
                       const Item_bool_func *cond,
                       scalar_comparison_op op, Item *value) override
  {
    return get_mm_leaf_int(param, key_part, cond, op, value, true);
  }
  void print_key_value(String *out, uint32 length) override
  {
    val_int_as_str(out, 1);
  }
  /**
     Save the field metadata for bit fields.
     Saves the bit length in the first byte and bytes in record in the
     second byte of the field metadata array at index of *metadata_ptr and
     *(metadata_ptr + 1).

     @param   metadata_ptr   First byte of field metadata

     @returns number of bytes written to metadata_ptr
  */
  Binlog_type_info binlog_type_info() const override
  {
    DBUG_PRINT("debug", ("bit_len: %d, bytes_in_rec: %d",
                       bit_len, bytes_in_rec));
    /*
      Since this class and Field_bit_as_char have different ideas of
      what should be stored here, we compute the values of the metadata
      explicitly using the field_length.
    */
    return Binlog_type_info(type(),
                            static_cast<uint16>((field_length & 7) |
                                                ((field_length / 8) << 8)), 2);
  }

private:
  size_t do_last_null_byte() const override;
};


/**
  BIT field represented as chars for non-MyISAM tables.

  @todo The inheritance relationship is backwards since Field_bit is
  an extended version of Field_bit_as_char and not the other way
  around. Hence, we should refactor it to fix the hierarchy order.
 */
class Field_bit_as_char final :public Field_bit {
public:
  Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                    uchar null_bit_arg,
                    enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg);
  enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
  uint size_of() const override { return sizeof *this; }
  int store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int store(double nr) override { return Field_bit::store(nr); }
  int store(longlong nr, bool unsigned_val) override
  { return Field_bit::store(nr, unsigned_val); }
  void sql_type(String &str) const override;
};


class Field_row final :public Field_null
{
  class Virtual_tmp_table *m_table;
public:
  Field_row(uchar *ptr_arg, const LEX_CSTRING *field_name_arg)
    :Field_null(ptr_arg, 0, Field::NONE, field_name_arg, &my_charset_bin),
     m_table(NULL)
    {}
  ~Field_row();
  en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override
  {
    DBUG_ASSERT(0);
    return Field::tmp_engine_column_type(use_packed_rows);
  }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override
  {
    DBUG_ASSERT(0);
    return CONV_TYPE_IMPOSSIBLE;
  }
  Virtual_tmp_table **virtual_tmp_table_addr() override { return &m_table; }
  bool sp_prepare_and_store_item(THD *thd, Item **value) override;
};


extern const LEX_CSTRING null_clex_str;

class Column_definition_attributes
{
public:
  /*
    At various stages in execution this can be length of field in bytes or
    max number of characters.
  */
  ulonglong length;
  const TYPELIB *interval;
  CHARSET_INFO *charset;
  uint32 srid;
  uint32 pack_flag;
  decimal_digits_t decimals;
  Field::utype unireg_check;
  Column_definition_attributes()
   :length(0),
    interval(NULL),
    charset(&my_charset_bin),
    srid(0),
    pack_flag(0),
    decimals(0),
    unireg_check(Field::NONE)
  { }
  Column_definition_attributes(const Field *field);
  Column_definition_attributes(const Type_all_attributes &attr);
  Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root,
                    const Record_addr *rec,
                    const Type_handler *handler,
                    const LEX_CSTRING *field_name,
                    uint32 flags) const;
  uint temporal_dec(uint intlen) const
  {
    return (uint) (length > intlen ? length - intlen - 1 : 0);
  }
  uint pack_flag_to_pack_length() const;
  void frm_pack_basic(uchar *buff) const;
  void frm_pack_charset(uchar *buff) const;
  void frm_pack_numeric_with_dec(uchar *buff) const;
  void frm_unpack_basic(const uchar *buff);
  bool frm_unpack_charset(TABLE_SHARE *share, const uchar *buff);
  bool frm_unpack_numeric_with_dec(TABLE_SHARE *share, const uchar *buff);
  bool frm_unpack_temporal_with_dec(TABLE_SHARE *share, uint intlen,
                                    const uchar *buff);
  void set_length_and_dec(const Lex_length_and_dec_st &attr);
  CHARSET_INFO *explicit_or_derived_charset(const Column_derived_attributes
                                                  *derived_attr) const
  {
    return charset ? charset : derived_attr->charset();
  }
};


/*
  Create field class for CREATE TABLE
*/
class Column_definition: public Sql_alloc,
                         public Type_handler_hybrid_field_type,
                         public Column_definition_attributes
{
  /**
    Create "interval" from "interval_list".
    @param mem_root                   - memory root to create the TYPELIB
                                        instance and its values on
    @param reuse_interval_list_values - determines if TYPELIB can reuse strings
                                        from interval_list, or should always
                                        allocate a copy on mem_root, even if
                                        character set conversion is not needed
    @retval false on success
    @retval true  on error (bad values, or EOM)
  */
  bool create_interval_from_interval_list(MEM_ROOT *mem_root,
                                          bool reuse_interval_list_values);

  /*
    Calculate TYPELIB (set or enum) max and total lengths

    @param  cs            charset+collation pair of the interval
    @param  max_length    length of the longest item
    @param  tot_length    sum of the item lengths

    After this method call:
    - ENUM uses max_length
    - SET uses tot_length.
  */
  void calculate_interval_lengths(uint32 *max_length, uint32 *tot_length)
  {
    const char **pos;
    uint *len;
    *max_length= *tot_length= 0;
    for (pos= interval->type_names, len= interval->type_lengths;
         *pos ; pos++, len++)
    {
      size_t length= charset->numchars(*pos, *pos + *len);
      DBUG_ASSERT(length < UINT_MAX32);
      *tot_length+= (uint) length;
      set_if_bigger(*max_length, (uint32)length);
    }
  }
  bool prepare_stage1_check_typelib_default();
  bool prepare_stage1_convert_default(THD *, MEM_ROOT *, CHARSET_INFO *to);
  const Type_handler *field_type() const; // Prevent using this
  Compression_method *compression_method_ptr;
public:
  Lex_ident   field_name;
  LEX_CSTRING comment;			// Comment for field
  enum enum_column_versioning
  {
    VERSIONING_NOT_SET,
    WITH_VERSIONING,
    WITHOUT_VERSIONING
  };
  Item *on_update;		        // ON UPDATE NOW()
  field_visibility_t invisible;
  /*
    The value of `length' as set by parser: is the number of characters
    for most of the types, or of bytes for BLOBs or numeric types.
  */
  uint32 char_length;
  uint  flags, pack_length;
  List<String> interval_list;
  engine_option_value *option_list;
  bool explicitly_nullable;

  /*
    This is additinal data provided for any computed(virtual) field.
    In particular it includes a pointer to the item by  which this field
    can be computed from other fields.
  */
  Virtual_column_info
    *vcol_info,                      // Virtual field
    *default_value,                  // Default value
    *check_constraint;               // Check constraint

  enum_column_versioning versioning;

  Table_period_info *period;

  Column_definition()
   :Type_handler_hybrid_field_type(&type_handler_null),
    compression_method_ptr(0),
    comment(null_clex_str),
    on_update(NULL), invisible(VISIBLE), char_length(0),
    flags(0), pack_length(0),
    option_list(NULL), explicitly_nullable(false),
    vcol_info(0), default_value(0), check_constraint(0),
    versioning(VERSIONING_NOT_SET), period(NULL)
  {
    interval_list.empty();
  }

  Column_definition(THD *thd, Field *field, Field *orig_field);
  bool set_attributes(THD *thd,
                      const Lex_field_type_st &attr,
                      CHARSET_INFO *cs,
                      column_definition_type_t type);
  void create_length_to_internal_length_null()
  {
    DBUG_ASSERT(length == 0);
    pack_length= 0;
  }
  void create_length_to_internal_length_simple()
  {
    pack_length= type_handler()->calc_pack_length((uint32) length);
  }
  void create_length_to_internal_length_string()
  {
    length*= charset->mbmaxlen;
    if (real_field_type() == MYSQL_TYPE_VARCHAR && compression_method())
      length++;
    set_if_smaller(length, UINT_MAX32);
    pack_length= type_handler()->calc_pack_length((uint32) length);
  }
  void create_length_to_internal_length_typelib()
  {
    /* Pack_length already calculated in sql_parse.cc */
    length*= charset->mbmaxlen;
  }
  bool vers_sys_field() const
  {
    return flags & (VERS_ROW_START | VERS_ROW_END);
  }
  void create_length_to_internal_length_bit();
  void create_length_to_internal_length_newdecimal();

  /*
    Prepare the "charset" member for string data types,
    such as CHAR, VARCHAR, TEXT, ENUM, SET:
    - derive the charset if not specified explicitly
    - find a _bin collation if the BINARY comparison style was specified, e.g.:
       CREATE TABLE t1 (a VARCHAR(10) BINARY) CHARSET utf8;
  */
  bool prepare_charset_for_string(const Column_derived_attributes *dattr);

  /**
    Prepare a SET/ENUM field.
    Create "interval" from "interval_list" if needed, and adjust "length".
    @param mem_root                   - Memory root to allocate TYPELIB and
                                        its values on
    @param reuse_interval_list_values - determines if TYPELIB can reuse value
                                        buffers from interval_list, or should
                                        always allocate a copy on mem_root,
                                        even if character set conversion
                                        is not needed
  */
  bool prepare_interval_field(MEM_ROOT *mem_root,
                              bool reuse_interval_list_values);

  void prepare_interval_field_calc_length()
  {
    uint32 field_length, dummy;
    if (real_field_type() == MYSQL_TYPE_SET)
    {
      calculate_interval_lengths(&dummy, &field_length);
      length= field_length + (interval->count - 1);
    }
    else /* MYSQL_TYPE_ENUM */
    {
      calculate_interval_lengths(&field_length, &dummy);
      length= field_length;
    }
    set_if_smaller(length, MAX_FIELD_WIDTH - 1);
  }

  bool prepare_blob_field(THD *thd);

  bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root);

  bool prepare_stage1(THD *thd, MEM_ROOT *mem_root,
                      handler *file, ulonglong table_flags,
                      const Column_derived_attributes *derived_attr);
  void prepare_stage1_simple(CHARSET_INFO *cs)
  {
    charset= cs;
    create_length_to_internal_length_simple();
  }
  bool prepare_stage1_typelib(THD *thd, MEM_ROOT *mem_root,
                              handler *file, ulonglong table_flags);
  bool prepare_stage1_string(THD *thd, MEM_ROOT *mem_root,
                             handler *file, ulonglong table_flags);
  bool prepare_stage1_bit(THD *thd, MEM_ROOT *mem_root,
                          handler *file, ulonglong table_flags);

  bool bulk_alter(const Column_derived_attributes *derived_attr,
                  const Column_bulk_alter_attributes *bulk_attr)
  {
    return type_handler()->Column_definition_bulk_alter(this,
                                                        derived_attr,
                                                        bulk_attr);
  }
  void redefine_stage1_common(const Column_definition *dup_field,
                              const handler *file);
  bool redefine_stage1(const Column_definition *dup_field, const handler *file)
  {
    const Type_handler *handler= dup_field->type_handler();
    return handler->Column_definition_redefine_stage1(this, dup_field, file);
  }
  bool prepare_stage2(handler *handler, ulonglong table_flags);
  bool prepare_stage2_blob(handler *handler,
                           ulonglong table_flags, uint field_flags);
  bool prepare_stage2_varchar(ulonglong table_flags);
  bool prepare_stage2_typelib(const char *type_name, uint field_flags,
                              uint *dup_val_count);
  uint pack_flag_numeric() const;
  uint sign_length() const { return flags & UNSIGNED_FLAG ? 0 : 1; }
  bool check_length(uint mysql_errno, uint max_allowed_length) const;
  bool fix_attributes_real(uint default_length);
  bool fix_attributes_int(uint default_length);
  bool fix_attributes_decimal();
  bool fix_attributes_temporal_with_time(uint int_part_length);
  bool fix_attributes_bit();

  bool check(THD *thd);
  bool validate_check_constraint(THD *thd);

  bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; }

  ha_storage_media field_storage_type() const
  {
    return (ha_storage_media)
      ((flags >> FIELD_FLAGS_STORAGE_MEDIA) & 3);
  }

  column_format_type column_format() const
  {
    return (column_format_type)
      ((flags >> FIELD_FLAGS_COLUMN_FORMAT) & 3);
  }

  bool has_default_function() const
  {
    return unireg_check != Field::NONE;
  }

  Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root,
                    const Record_addr *addr,
                    const LEX_CSTRING *field_name_arg) const
  {
    return Column_definition_attributes::make_field(share, mem_root, addr,
                                                    type_handler(),
                                                    field_name_arg, flags);
  }
  Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root,
                    const LEX_CSTRING *field_name_arg) const
  {
    Record_addr addr(true);
    return make_field(share, mem_root, &addr, field_name_arg);
  }
  /* Return true if default is an expression that must be saved explicitly */
  bool has_default_expression();

  bool has_default_now_unireg_check() const
  {
    return unireg_check == Field::TIMESTAMP_DN_FIELD
        || unireg_check == Field::TIMESTAMP_DNUN_FIELD;
  }

  void set_type(const Column_definition &other)
  {
    set_handler(other.type_handler());
    length= other.length;
    char_length= other.char_length;
    decimals= other.decimals;
    flags= other.flags;
    pack_length= other.pack_length;
    unireg_check= other.unireg_check;
    interval= other.interval;
    charset= other.charset;
    srid= other.srid;
    pack_flag= other.pack_flag;
  }

  // Replace the entire value by another definition
  void set_column_definition(const Column_definition *def)
  {
    *this= *def;
  }
  bool set_compressed(const char *method);
  bool set_compressed_deprecated(THD *thd, const char *method);
  bool set_compressed_deprecated_column_attribute(THD *thd,
                                                  const char *pos,
                                                  const char *method);
  void set_compression_method(Compression_method *compression_method_arg)
  { compression_method_ptr= compression_method_arg; }
  Compression_method *compression_method() const
  { return compression_method_ptr; }

  bool check_vcol_for_key(THD *thd) const;
};


/**
  List of ROW element definitions, e.g.:
    DECLARE a ROW(a INT,b VARCHAR(10))
*/
class Row_definition_list: public List<class Spvar_definition>
{
public:
  inline bool eq_name(const Spvar_definition *def, const LEX_CSTRING *name) const;
  /**
    Find a ROW field by name.
    @param [IN]  name   - the name
    @param [OUT] offset - if the ROW field found, its offset it returned here
    @retval NULL        - the ROW field was not found
    @retval !NULL       - the pointer to the found ROW field
  */
  Spvar_definition *find_row_field_by_name(const LEX_CSTRING *name, uint *offset) const
  {
    // Cast-off the "const" qualifier
    List_iterator<Spvar_definition> it(*((List<Spvar_definition>*)this));
    Spvar_definition *def;
    for (*offset= 0; (def= it++); (*offset)++)
    {
      if (eq_name(def, name))
        return def;
    }
    return 0;
  }
  static Row_definition_list *make(MEM_ROOT *mem_root, Spvar_definition *var)
  {
    Row_definition_list *list;
    if (!(list= new (mem_root) Row_definition_list()))
      return NULL;
    return list->push_back(var, mem_root) ? NULL : list;
  }
  bool append_uniq(MEM_ROOT *thd, Spvar_definition *var);
  bool adjust_formal_params_to_actual_params(THD *thd, List<Item> *args);
  bool adjust_formal_params_to_actual_params(THD *thd,
                                             Item **args, uint arg_count);
  bool resolve_type_refs(THD *);
};

/**
  This class is used during a stored routine or a trigger execution,
  at sp_rcontext::create() time.
  Currently it can represent:
  - variables with explicit data types:   DECLARE a INT;
  - variables with data type references:  DECLARE a t1.a%TYPE;
  - ROW type variables

  Notes:
  - Scalar variables have m_field_definitions==NULL.
  - ROW variables are defined as having MYSQL_TYPE_NULL,
    with a non-empty m_field_definitions.

  Data type references to other object types will be added soon, e.g.:
  - DECLARE a table_name%ROWTYPE;
  - DECLARE a cursor_name%ROWTYPE;
  - DECLARE a record_name%TYPE;
  - DECLARE a variable_name%TYPE;
*/
class Spvar_definition: public Column_definition
{
  Qualified_column_ident *m_column_type_ref; // for %TYPE
  Table_ident *m_table_rowtype_ref;          // for table%ROWTYPE
  bool m_cursor_rowtype_ref;                       // for cursor%ROWTYPE
  uint m_cursor_rowtype_offset;                    // for cursor%ROWTYPE
  Row_definition_list *m_row_field_definitions;    // for ROW
public:
  Spvar_definition()
   :m_column_type_ref(NULL),
    m_table_rowtype_ref(NULL),
    m_cursor_rowtype_ref(false),
    m_cursor_rowtype_offset(0),
    m_row_field_definitions(NULL)
  { }
  Spvar_definition(THD *thd, Field *field)
   :Column_definition(thd, field, NULL),
    m_column_type_ref(NULL),
    m_table_rowtype_ref(NULL),
    m_cursor_rowtype_ref(false),
    m_cursor_rowtype_offset(0),
    m_row_field_definitions(NULL)
  { }
  const Type_handler *type_handler() const
  {
    return Type_handler_hybrid_field_type::type_handler();
  }
  bool is_column_type_ref() const { return m_column_type_ref != 0; }
  bool is_table_rowtype_ref() const { return m_table_rowtype_ref != 0; }
  bool is_cursor_rowtype_ref() const { return m_cursor_rowtype_ref; }
  bool is_explicit_data_type() const
  {
    return !is_column_type_ref() &&
           !is_table_rowtype_ref() &&
           !is_cursor_rowtype_ref();
  }
  Qualified_column_ident *column_type_ref() const
  {
    return m_column_type_ref;
  }
  void set_column_type_ref(Qualified_column_ident *ref)
  {
    m_column_type_ref= ref;
  }

  Table_ident *table_rowtype_ref() const
  {
    return m_table_rowtype_ref;
  }
  void set_table_rowtype_ref(Table_ident *ref)
  {
    DBUG_ASSERT(ref);
    set_handler(&type_handler_row);
    m_table_rowtype_ref= ref;
  }

  uint cursor_rowtype_offset() const
  {
    return m_cursor_rowtype_offset;
  }
  void set_cursor_rowtype_ref(uint offset)
  {
    set_handler(&type_handler_row);
    m_cursor_rowtype_ref= true;
    m_cursor_rowtype_offset= offset;
  }

  /*
    Find a ROW field by name.
    See Row_field_list::find_row_field_by_name() for details.
  */
  Spvar_definition *find_row_field_by_name(const LEX_CSTRING *name, uint *offset) const
  {
    DBUG_ASSERT(m_row_field_definitions);
    return m_row_field_definitions->find_row_field_by_name(name, offset);
  }
  uint is_row() const
  {
    return m_row_field_definitions != NULL;
  }
  // Check if "this" defines a ROW variable with n elements
  uint is_row(uint n) const
  {
    return m_row_field_definitions != NULL &&
           m_row_field_definitions->elements == n;
  }
  Row_definition_list *row_field_definitions() const
  {
    return m_row_field_definitions;
  }
  void set_row_field_definitions(Row_definition_list *list)
  {
    DBUG_ASSERT(list);
    set_handler(&type_handler_row);
    m_row_field_definitions= list;
  }

};


inline bool Row_definition_list::eq_name(const Spvar_definition *def,
                                         const LEX_CSTRING *name) const
{
  return def->field_name.length == name->length && my_strcasecmp(system_charset_info, def->field_name.str, name->str) == 0;
}


class Create_field :public Column_definition
{
public:
  LEX_CSTRING change;			// Old column name if column is renamed by ALTER
  LEX_CSTRING after;			// Put column after this one
  Field *field;				// For alter table
  const TYPELIB *save_interval;         // Temporary copy for the above
                                        // Used only for UCS2 intervals

  /** structure with parsed options (for comparing fields in ALTER TABLE) */
  ha_field_option_struct *option_struct;
  uint	offset;
  uint8 interval_id;
  bool create_if_not_exists;            // Used in ALTER TABLE IF NOT EXISTS

  Create_field():
    Column_definition(),
    field(0), option_struct(NULL),
    create_if_not_exists(false)
  {
    change= after= null_clex_str;
  }
  Create_field(THD *thd, Field *old_field, Field *orig_field):
    Column_definition(thd, old_field, orig_field),
    change(old_field->field_name),
    field(old_field), option_struct(old_field->option_struct),
    create_if_not_exists(false)
  {
    after= null_clex_str;
  }
  /* Used to make a clone of this object for ALTER/CREATE TABLE */
  Create_field *clone(MEM_ROOT *mem_root) const;
  static void upgrade_data_types(List<Create_field> &list)
  {
    List_iterator<Create_field> it(list);
    while (Create_field *f= it++)
      f->type_handler()->Column_definition_implicit_upgrade(f);
  }
};


/*
  A class for sending info to the client
*/

class Send_field :public Sql_alloc,
                  public Type_handler_hybrid_field_type,
                  public Send_field_extended_metadata
{
public:
  LEX_CSTRING db_name;
  LEX_CSTRING table_name, org_table_name;
  LEX_CSTRING col_name, org_col_name;
  ulong length;
  uint flags;
  decimal_digits_t decimals;
  Send_field(Field *field)
  {
    field->make_send_field(this);
    DBUG_ASSERT(table_name.str != 0);
    normalize();
  }
  Send_field(THD *thd, Item *item);
  Send_field(Field *field,
             const LEX_CSTRING &db_name_arg,
             const LEX_CSTRING &table_name_arg)
   :Type_handler_hybrid_field_type(field->type_handler()),
    db_name(db_name_arg),
    table_name(table_name_arg),
    org_table_name(table_name_arg),
    col_name(field->field_name),
    org_col_name(field->field_name),
    length(field->field_length),
    flags(field->table->maybe_null ?
          (field->flags & ~NOT_NULL_FLAG) : field->flags),
    decimals(field->decimals())
  {
    normalize();
  }

private:
  void normalize()
  {
    /* limit number of decimals for float and double */
    if (type_handler()->field_type() == MYSQL_TYPE_FLOAT ||
        type_handler()->field_type() == MYSQL_TYPE_DOUBLE)
      set_if_smaller(decimals, FLOATING_POINT_DECIMALS);
  }
public:
  // This should move to Type_handler eventually
  uint32 max_char_length(CHARSET_INFO *cs) const
  {
    return type_handler()->field_type() >= MYSQL_TYPE_TINY_BLOB &&
           type_handler()->field_type() <= MYSQL_TYPE_BLOB
      ? static_cast<uint32>(length / cs->mbminlen)
      : static_cast<uint32>(length / cs->mbmaxlen);
  }
  uint32 max_octet_length(CHARSET_INFO *from, CHARSET_INFO *to) const
  {
    /*
      For TEXT/BLOB columns, field_length describes the maximum data
      length in bytes. There is no limit to the number of characters
      that a TEXT column can store, as long as the data fits into
      the designated space.
      For the rest of textual columns, field_length is evaluated as
      char_count * mbmaxlen, where character count is taken from the
      definition of the column. In other words, the maximum number
      of characters here is limited by the column definition.

      When one has a LONG TEXT column with a single-byte
      character set, and the connection character set is multi-byte, the
      client may get fields longer than UINT_MAX32, due to
      <character set column> -> <character set connection> conversion.
      In that case column max length would not fit into the 4 bytes
      reserved for it in the protocol. So we cut it here to UINT_MAX32.
    */
    return char_to_byte_length_safe(max_char_length(from), to->mbmaxlen);
  }

  // This should move to Type_handler eventually
  bool is_sane_float() const
  {
    return (decimals <= FLOATING_POINT_DECIMALS ||
            (type_handler()->field_type() != MYSQL_TYPE_FLOAT &&
             type_handler()->field_type() != MYSQL_TYPE_DOUBLE));
  }
  bool is_sane_signess() const
  {
    if (type_handler() == type_handler()->type_handler_signed() &&
        type_handler() == type_handler()->type_handler_unsigned())
      return true; // Any signess is allowed, e.g. DOUBLE, DECIMAL
    /*
      We are here e.g. in case of INT data type.
      The UNSIGNED_FLAG bit must match in flags and in the type handler.
    */
    return ((bool) (flags & UNSIGNED_FLAG)) == type_handler()->is_unsigned();
  }
  bool is_sane() const
  {
    return is_sane_float() && is_sane_signess();
  }
};


/*
  A class for quick copying data to fields
*/

class Copy_field :public Sql_alloc {
public:
  uchar *from_ptr,*to_ptr;
  uchar *from_null_ptr,*to_null_ptr;
  bool *null_row;
  uint	from_bit,to_bit;
  /**
    Number of bytes in the fields pointed to by 'from_ptr' and
    'to_ptr'. Usually this is the number of bytes that are copied from
    'from_ptr' to 'to_ptr'.

    For variable-length fields (VARCHAR), the first byte(s) describe
    the actual length of the text. For VARCHARs with length 
       < 256 there is 1 length byte 
       >= 256 there is 2 length bytes
    Thus, if from_field is VARCHAR(10), from_length (and in most cases
    to_length) is 11. For VARCHAR(1024), the length is 1026. @see
    Field_varstring::length_bytes

    Note that for VARCHARs, do_copy() will be do_varstring*() which
    only copies the length-bytes (1 or 2) + the actual length of the
    text instead of from/to_length bytes.
  */
  uint from_length,to_length;
  Field *from_field,*to_field;
  String tmp;					// For items

  Copy_field() = default;
  ~Copy_field() = default;
  void set(Field *to,Field *from,bool save);	// Field to field 
  void set(uchar *to,Field *from);		// Field to string
  void (*do_copy)(Copy_field *);
  void (*do_copy2)(Copy_field *);		// Used to handle null values
};


uint pack_length_to_packflag(uint type);
enum_field_types get_blob_type_from_length(ulong length);
int set_field_to_null(Field *field);
int set_field_to_null_with_conversions(Field *field, bool no_conversions);
int convert_null_to_field_value_or_error(Field *field, uint err);
bool check_expression(Virtual_column_info *vcol, const LEX_CSTRING *name,
                      enum_vcol_info_type type, Alter_info *alter_info= NULL);

/*
  The following are for the interface with the .frm file
*/

#define FIELDFLAG_DECIMAL		1U
#define FIELDFLAG_BINARY		1U	// Shares same flag
#define FIELDFLAG_NUMBER		2U
#define FIELDFLAG_ZEROFILL		4U
#define FIELDFLAG_PACK			120U	// Bits used for packing
#define FIELDFLAG_INTERVAL		256U    // mangled with decimals!
#define FIELDFLAG_BITFIELD		512U	// mangled with decimals!
#define FIELDFLAG_BLOB			1024U	// mangled with decimals!
#define FIELDFLAG_GEOM			2048U   // mangled with decimals!

#define FIELDFLAG_TREAT_BIT_AS_CHAR     4096U   /* use Field_bit_as_char */
#define FIELDFLAG_LONG_DECIMAL          8192U
#define FIELDFLAG_NO_DEFAULT		16384U  /* sql */
#define FIELDFLAG_MAYBE_NULL		32768U	// sql
#define FIELDFLAG_HEX_ESCAPE		0x10000U
#define FIELDFLAG_PACK_SHIFT		3
#define FIELDFLAG_DEC_SHIFT		8
#define FIELDFLAG_MAX_DEC               63U

#define FIELDFLAG_DEC_MASK              0x3F00U

#define MTYP_TYPENR(type) ((type) & 127U) // Remove bits from type

#define f_is_dec(x)		((x) & FIELDFLAG_DECIMAL)
#define f_is_num(x)		((x) & FIELDFLAG_NUMBER)
#define f_is_zerofill(x)	((x) & FIELDFLAG_ZEROFILL)
#define f_is_packed(x)		((x) & FIELDFLAG_PACK)
#define f_packtype(x)		(((x) >> FIELDFLAG_PACK_SHIFT) & 15)
#define f_decimals(x)		((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC))
#define f_is_alpha(x)		(!f_is_num(x))
#define f_is_binary(x)          ((x) & FIELDFLAG_BINARY) // 4.0- compatibility
#define f_is_enum(x)            (((x) & (FIELDFLAG_INTERVAL | FIELDFLAG_NUMBER)) == FIELDFLAG_INTERVAL)
#define f_is_bitfield(x)        (((x) & (FIELDFLAG_BITFIELD | FIELDFLAG_NUMBER)) == FIELDFLAG_BITFIELD)
#define f_is_blob(x)		(((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB)
#define f_is_geom(x)		(((x) & (FIELDFLAG_GEOM | FIELDFLAG_NUMBER)) == FIELDFLAG_GEOM)
#define f_settype(x)		(((uint) (x)) << FIELDFLAG_PACK_SHIFT)
#define f_maybe_null(x)		((x) & FIELDFLAG_MAYBE_NULL)
#define f_no_default(x)		((x) & FIELDFLAG_NO_DEFAULT)
#define f_bit_as_char(x)        ((x) & FIELDFLAG_TREAT_BIT_AS_CHAR)
#define f_is_hex_escape(x)      ((x) & FIELDFLAG_HEX_ESCAPE)
#define f_visibility(x)         (static_cast<field_visibility_t> ((x) & INVISIBLE_MAX_BITS))

inline
ulonglong TABLE::vers_end_id() const
{
  DBUG_ASSERT(versioned(VERS_TRX_ID));
  return static_cast<ulonglong>(vers_end_field()->val_int());
}

inline
ulonglong TABLE::vers_start_id() const
{
  DBUG_ASSERT(versioned(VERS_TRX_ID));
  return static_cast<ulonglong>(vers_start_field()->val_int());
}

#endif /* FIELD_INCLUDED */
server/private/sql_cte.h000064400000040225150400263710011330 0ustar00/*
   Copyright (c) 2016, 2017 MariaDB

   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-1301  USA */

#ifndef SQL_CTE_INCLUDED
#define SQL_CTE_INCLUDED
#include "sql_list.h"
#include "sql_lex.h"
#include "sql_select.h"

class select_unit;
struct st_unit_ctxt_elem;


/**
  @class With_element_head
  @brief Head of the definition of a CTE table

  It contains the name of the CTE and it contains the position of the subchain
  of table references used in the definition in the global chain of table
  references used in the query where this definition is encountered.
*/

class With_element_head : public Sql_alloc
{
  /* The name of the defined CTE */
  LEX_CSTRING *query_name;

public:
  /*
    The structure describing the subchain of the table references used in
    the specification of the defined CTE in the global chain of table
    references used in the query. The structure is fully defined only
    after the CTE definition has been parsed.
  */
  TABLE_CHAIN tables_pos;

  With_element_head(LEX_CSTRING *name)
    : query_name(name)
  {
    tables_pos.set_start_pos(0);
    tables_pos.set_end_pos(0);
  }
  friend class With_element;
};


/**
  @class With_element
  @brief Definition of a CTE table
	
  It contains a reference to the name of the table introduced by this with element,
  and a reference to the unit that specificies this table. Also it contains
  a reference to the with clause to which this element belongs to.	
*/

class With_element : public Sql_alloc
{
private:
  With_clause *owner;      // with clause this object belongs to
  With_element *next;      // next element in the with clause
  uint number;  // number of the element in the with clause (starting from 0)
  table_map elem_map;  // The map where with only one 1 set in this->number   
  /* 
    The map base_dep_map has 1 in the i-th position if the query that
    specifies this with element contains a reference to the with element number i
    in the query FROM list.
    (In this case this with element depends directly on the i-th with element.)  
  */
  table_map base_dep_map; 
  /* 
    The map derived_dep_map has 1 in i-th position if this with element depends
    directly or indirectly from the i-th with element. 
  */
  table_map derived_dep_map;
  /* 
    The map sq_dep_map has 1 in i-th position if there is a reference to this
    with element somewhere in subqueries of the specifications of the tables
    defined in the with clause containing this element;
  */   
  table_map sq_dep_map;
  table_map work_dep_map;  // dependency map used for work
  /* Dependency map of with elements mutually recursive with this with element */
  table_map mutually_recursive;
  /* 
    Dependency map built only for the top level references i.e. for those that
    are encountered in from lists of the selects of the specification unit
  */ 
  table_map top_level_dep_map;
  /*
    Points to a recursive reference in subqueries.
    Used only for specifications without recursive references on the top level.
  */
  TABLE_LIST *sq_rec_ref;
  /* 
    The next with element from the circular chain of the with elements
    mutually recursive with this with element. 
    (If This element is simply recursive than next_mutually_recursive contains
    the pointer to itself. If it's not recursive than next_mutually_recursive
    is set to NULL.) 
  */  
  With_element *next_mutually_recursive;
  /* 
    Total number of references to this element in the FROM lists of
    the queries that are in the scope of the element (including
    subqueries and specifications of other with elements).
  */ 
  uint references;

  /*
    true <=> this With_element is referred in the query in which the
    element is defined
  */
  bool referenced;

  /*
    true <=> this With_element is needed for the execution of the query
    in which the element is defined
  */
  bool is_used_in_query;

  /* 
    Unparsed specification of the query that specifies this element.
    It's used to build clones of the specification if they are needed.
  */
  LEX_CSTRING unparsed_spec;
  /* Offset of the specification in the input string */
  my_ptrdiff_t unparsed_spec_offset;

  /* True if the with element is used a prepared statement */
  bool stmt_prepare_mode;

  /* Return the map where 1 is set only in the position for this element */
  table_map get_elem_map() { return (table_map) 1 << number; }
 
public:
  /*
    Contains the name of the defined With element and the position of
    the subchain of the tables references used by its definition in the
    global chain of TABLE_LIST objects created for the whole query.
  */
  With_element_head *head;

  /*
    Optional list of column names to name the columns of the table introduced
    by this with element. It is used in the case when the names are not
    inherited from the query that specified the table. Otherwise the list is
    always empty.
  */
  List <Lex_ident_sys> column_list;
  List <Lex_ident_sys> *cycle_list;
  /* The query that specifies the table introduced by this with element */
  st_select_lex_unit *spec;
  /* 
    Set to true is recursion is used (directly or indirectly)
    for the definition of this element
  */
  bool is_recursive;
  /*
    For a simple recursive CTE: the number of references to the CTE from
    outside of the CTE specification.
    For a CTE mutually recursive with other CTEs : the total number of
    references to all these CTEs outside of their specification.
    Each of these mutually recursive CTEs has the same value in this field.
  */
  uint rec_outer_references;
  /*
    Any non-recursive select in the specification of a recursive
    with element is a called anchor. In the case mutually recursive
    elements the specification of some them may be without any anchor.
    Yet at least one of them must contain an anchor.
    All anchors of any recursivespecification are moved ahead before
    the prepare stage.
  */  
  /* Set to true if this is a recursive element with an anchor */ 
  bool with_anchor;
  /* 
    Set to the first recursive select of the unit specifying the element
    after all anchor have been moved to the head of the unit.
  */
  st_select_lex *first_recursive;
  
  /* 
    The number of the last performed iteration for recursive table
    (the number of the initial non-recursive step is 0, the number
     of the first iteration is 1).
  */
  uint level;

  /* 
    The pointer to the object used to materialize this with element
    if it's recursive. This object is built at the end of prepare 
    stage and is used at the execution stage.
  */
  select_union_recursive *rec_result;

  /* List of Item_subselects containing recursive references to this CTE */
  SQL_I_List<Item_subselect> sq_with_rec_ref;
  /* List of derived tables containing recursive references to this CTE */
  SQL_I_List<TABLE_LIST> derived_with_rec_ref;

  With_element(With_element_head *h,
               List <Lex_ident_sys> list,
               st_select_lex_unit *unit)
    : next(NULL), base_dep_map(0), derived_dep_map(0),
      sq_dep_map(0), work_dep_map(0), mutually_recursive(0),
      top_level_dep_map(0), sq_rec_ref(NULL),
      next_mutually_recursive(NULL), references(0), 
      referenced(false), is_used_in_query(false),
      head(h), column_list(list), cycle_list(0), spec(unit),
      is_recursive(false), rec_outer_references(0), with_anchor(false),
      level(0), rec_result(NULL)
  { unit->with_element= this; }

  LEX_CSTRING *get_name() { return head->query_name; }
  const char *get_name_str() { return get_name()->str; }

  void set_tables_start_pos(TABLE_LIST **pos)
  { head->tables_pos.set_start_pos(pos); }
  void set_tables_end_pos(TABLE_LIST **pos)
  { head->tables_pos.set_end_pos(pos); }

  bool check_dependencies_in_spec();
  
  void check_dependencies_in_select(st_select_lex *sl, st_unit_ctxt_elem *ctxt,
                                    bool in_subq, table_map *dep_map);
      
  void check_dependencies_in_unit(st_select_lex_unit *unit,
                                  st_unit_ctxt_elem *ctxt,
                                  bool in_subq,
                                  table_map *dep_map);

  void check_dependencies_in_with_clause(With_clause *with_clause, 
                                         st_unit_ctxt_elem *ctxt,
                                         bool in_subq,
                                         table_map *dep_map);

  void  set_dependency_on(With_element *with_elem)
  { base_dep_map|= with_elem->get_elem_map(); }

  bool check_dependency_on(With_element *with_elem)
  { return base_dep_map & with_elem->get_elem_map(); }

  TABLE_LIST *find_first_sq_rec_ref_in_select(st_select_lex *sel);

  bool set_unparsed_spec(THD *thd, const char *spec_start, const char *spec_end,
                         my_ptrdiff_t spec_offset);

  st_select_lex_unit *clone_parsed_spec(LEX *old_lex, TABLE_LIST *with_table);

  bool is_referenced() { return referenced; }

  bool is_hanging_recursive() { return is_recursive && !rec_outer_references; }

  void inc_references() { references++; }

  bool process_columns_of_derived_unit(THD *thd, st_select_lex_unit *unit);

  bool prepare_unreferenced(THD *thd);

  bool check_unrestricted_recursive(st_select_lex *sel,
                                    table_map &unrestricted,
                                    table_map &encountered);

  void print(THD *thd, String *str, enum_query_type query_type);

  With_clause *get_owner() { return owner; }

  bool contains_sq_with_recursive_reference()
  { return sq_dep_map & mutually_recursive; }

  bool no_rec_ref_on_top_level()
  { return !(top_level_dep_map & mutually_recursive); }

  table_map get_mutually_recursive() { return mutually_recursive; }

  With_element *get_next_mutually_recursive()
  { return next_mutually_recursive; }

  TABLE_LIST *get_sq_rec_ref() { return sq_rec_ref; }

  bool is_anchor(st_select_lex *sel);

  void move_anchors_ahead(); 

  bool is_unrestricted();

  bool is_with_prepared_anchor();

  void mark_as_with_prepared_anchor();

  bool is_cleaned();

  void mark_as_cleaned();

  void reset_recursive_for_exec();

  void cleanup_stabilized();

  void set_as_stabilized();

  bool is_stabilized();

  bool all_are_stabilized();

  bool instantiate_tmp_tables();

  void prepare_for_next_iteration();

  void set_cycle_list(List<Lex_ident_sys> *cycle_list_arg);

  friend class With_clause;

  friend
  bool LEX::resolve_references_to_cte(TABLE_LIST *tables,
                                      TABLE_LIST **tables_last,
                                      st_select_lex_unit *excl_spec);
};

const uint max_number_of_elements_in_with_clause= sizeof(table_map)*8;

/**
  @class With_clause
  @brief Set of with_elements

  It has a reference to the first with element from this with clause.
  This reference allows to navigate through all the elements of the with clause.
  It contains a reference to the unit to which this with clause is attached.
  It also contains a flag saying whether this with clause was specified as recursive.
*/ 

class With_clause : public Sql_alloc
{
private:
  st_select_lex_unit *owner; // the unit this with clause attached to

  /* The list of all with elements from this with clause */
  SQL_I_List<With_element> with_list; 
  /*
    The with clause immediately containing this with clause if there is any,
    otherwise NULL. Now used  only at parsing.
  */
  With_clause *embedding_with_clause;
  /*
    The next with the clause of the chain of with clauses encountered
    in the current statement
  */
  With_clause *next_with_clause;
  /* Set to true if dependencies between with elements have been checked */
  bool dependencies_are_checked;
  /* 
    The bitmap of all recursive with elements whose specifications
    are not complied with restrictions imposed by the SQL standards
    on recursive specifications.
  */ 
  table_map unrestricted;
  /* 
    The bitmap of all recursive with elements whose anchors
    has been already prepared.
  */
  table_map with_prepared_anchor;
  table_map cleaned;
  /* 
    The bitmap of all recursive with elements that
    has been already materialized
  */
  table_map stabilized;

public:
 /* If true the specifier RECURSIVE is present in the with clause */
  bool with_recursive;

  With_clause(bool recursive_fl, With_clause *emb_with_clause)
    : owner(NULL), embedding_with_clause(emb_with_clause),
      next_with_clause(NULL), dependencies_are_checked(false), unrestricted(0),
      with_prepared_anchor(0), cleaned(0), stabilized(0),
      with_recursive(recursive_fl)
  { }

  bool add_with_element(With_element *elem);

  /* Add this with clause to the list of with clauses used in the statement */
  void add_to_list(With_clause **ptr, With_clause ** &last_next)
  {
    if (embedding_with_clause)
    {
      /* 
        An embedded with clause is always placed before the embedding one
        in the list of with clauses used in the query.
      */
      while (*ptr != embedding_with_clause)
        ptr= &(*ptr)->next_with_clause;
      *ptr= this;
      next_with_clause= embedding_with_clause;
    }
    else
    {
      *last_next= this;
      last_next= &this->next_with_clause;
    }
  }

  st_select_lex_unit *get_owner() { return owner; }

  void set_owner(st_select_lex_unit *unit) { owner= unit; }

  void attach_to(st_select_lex *select_lex);

  With_clause *pop() { return embedding_with_clause; }
      
  bool check_dependencies();

  bool check_anchors();

  void move_anchors_ahead();

  With_element *find_table_def(TABLE_LIST *table, With_element *barrier,
                               st_select_lex_unit *excl_spec);

  With_element *find_table_def_in_with_clauses(TABLE_LIST *table);

  bool prepare_unreferenced_elements(THD *thd);

  void add_unrestricted(table_map map) { unrestricted|= map; }

  void print(THD *thd, String *str, enum_query_type query_type);

  friend class With_element;

  friend
  bool LEX::check_dependencies_in_with_clauses();
};

inline
bool With_element::is_unrestricted() 
{
  return owner->unrestricted & get_elem_map();
}

inline
bool With_element::is_with_prepared_anchor() 
{
  return owner->with_prepared_anchor & get_elem_map();
}

inline
void With_element::mark_as_with_prepared_anchor() 
{
  owner->with_prepared_anchor|= mutually_recursive;
}


inline
bool With_element::is_cleaned() 
{
  return owner->cleaned & get_elem_map();
}


inline
void With_element::mark_as_cleaned() 
{
  owner->cleaned|= get_elem_map();
}


inline
void With_element::reset_recursive_for_exec()
{
  DBUG_ASSERT(is_recursive);
  level= 0;
  owner->with_prepared_anchor&= ~mutually_recursive;
  owner->cleaned&= ~get_elem_map();
  cleanup_stabilized();
  spec->columns_are_renamed= false;
}



inline
void With_element::cleanup_stabilized()
{
  owner->stabilized&= ~mutually_recursive;
}


inline
void With_element::set_as_stabilized()
{
  owner->stabilized|= get_elem_map();
}


inline
bool With_element::is_stabilized()
{
  return owner->stabilized & get_elem_map();
}


inline
bool With_element::all_are_stabilized()
{
  return (owner->stabilized & mutually_recursive) == mutually_recursive;
}


inline
void With_element::prepare_for_next_iteration()
{
  With_element *with_elem= this;
  while ((with_elem= with_elem->get_next_mutually_recursive()) != this)
  {
    TABLE *rec_table= with_elem->rec_result->first_rec_table_to_update;
    if (rec_table)
      rec_table->reginfo.join_tab->preread_init_done= false;        
  }
}


inline
void With_clause::attach_to(st_select_lex *select_lex)
{
  for (With_element *with_elem= with_list.first;
       with_elem;
       with_elem= with_elem->next)
  {
    select_lex->register_unit(with_elem->spec, NULL);
  }
}


inline
void st_select_lex::set_with_clause(With_clause *with_clause)
{
  master_unit()->with_clause= with_clause;
  if (with_clause)
    with_clause->set_owner(master_unit());
}

#endif /* SQL_CTE_INCLUDED */
server/private/hash_filo.h000064400000013070150400263710011630 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */


/*
** A class for static sized hash tables where old entries are deleted in
** first-in-last-out to usage.
*/

#ifndef  HASH_FILO_H
#define  HASH_FILO_H

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class interface */
#endif

#include "hash.h"        /* my_hash_get_key, my_hash_free_key, HASH */
#include "m_string.h"    /* bzero */
#include "mysqld.h"      /* key_hash_filo_lock */

class hash_filo_element
{
private:
  hash_filo_element *next_used,*prev_used;
 public:
  hash_filo_element() = default;
  hash_filo_element *next()
  { return next_used; }
  hash_filo_element *prev()
  { return prev_used; }

  friend class hash_filo;
};


class hash_filo
{
private:
  PSI_memory_key m_psi_key;
  const uint key_offset, key_length;
  const my_hash_get_key get_key;
  /** Size of this hash table. */
  uint m_size;
  my_hash_free_key free_element;
  bool init;
  CHARSET_INFO *hash_charset;

  hash_filo_element *first_link,*last_link;
public:
  mysql_mutex_t lock;
  HASH cache;

  hash_filo(PSI_memory_key psi_key, uint size_arg, uint key_offset_arg,
            uint key_length_arg, my_hash_get_key get_key_arg,
            my_hash_free_key free_element_arg, CHARSET_INFO *hash_charset_arg)
    : m_psi_key(psi_key), key_offset(key_offset_arg),
    key_length(key_length_arg), get_key(get_key_arg), m_size(size_arg),
    free_element(free_element_arg),init(0), hash_charset(hash_charset_arg),
    first_link(NULL), last_link(NULL)
  {
    bzero((char*) &cache,sizeof(cache));
  }

  ~hash_filo()
  {
    if (init)
    {
      if (cache.array.buffer)	/* Avoid problems with thread library */
	(void) my_hash_free(&cache);
      mysql_mutex_destroy(&lock);
    }
  }
  void clear(bool locked=0)
  {
    if (!init)
    {
      init=1;
      mysql_mutex_init(key_hash_filo_lock, &lock, MY_MUTEX_INIT_FAST);
    }
    if (!locked)
      mysql_mutex_lock(&lock);
    first_link= NULL;
    last_link= NULL;
    (void) my_hash_free(&cache);
    (void) my_hash_init(m_psi_key, &cache,hash_charset,m_size,key_offset,
                        key_length, get_key, free_element, 0);
    if (!locked)
      mysql_mutex_unlock(&lock);
  }

  hash_filo_element *first()
  {
    mysql_mutex_assert_owner(&lock);
    return first_link;
  }

  hash_filo_element *last()
  {
    mysql_mutex_assert_owner(&lock);
    return last_link;
  }

  hash_filo_element *search(uchar* key, size_t length)
  {
    mysql_mutex_assert_owner(&lock);

    hash_filo_element *entry=(hash_filo_element*)
      my_hash_search(&cache,(uchar*) key,length);
    if (entry)
    {						// Found; link it first
      DBUG_ASSERT(first_link != NULL);
      DBUG_ASSERT(last_link != NULL);
      if (entry != first_link)
      {						// Relink used-chain
	if (entry == last_link)
        {
	  last_link= last_link->prev_used;
          /*
            The list must have at least 2 elements,
            otherwise entry would be equal to first_link.
          */
          DBUG_ASSERT(last_link != NULL);
          last_link->next_used= NULL;
        }
	else
	{
          DBUG_ASSERT(entry->next_used != NULL);
          DBUG_ASSERT(entry->prev_used != NULL);
	  entry->next_used->prev_used = entry->prev_used;
	  entry->prev_used->next_used = entry->next_used;
	}
        entry->prev_used= NULL;
        entry->next_used= first_link;

        first_link->prev_used= entry;
        first_link=entry;
      }
    }
    return entry;
  }

  bool add(hash_filo_element *entry)
  {
    if (!m_size) return 1;
    if (cache.records == m_size)
    {
      hash_filo_element *tmp=last_link;
      last_link= last_link->prev_used;
      if (last_link != NULL)
      {
        last_link->next_used= NULL;
      }
      else
      {
        /* Pathological case, m_size == 1 */
        first_link= NULL;
      }
      my_hash_delete(&cache,(uchar*) tmp);
    }
    if (my_hash_insert(&cache,(uchar*) entry))
    {
      if (free_element)
	(*free_element)(entry);		// This should never happen
      return 1;
    }
    entry->prev_used= NULL;
    entry->next_used= first_link;
    if (first_link != NULL)
      first_link->prev_used= entry;
    else
      last_link= entry;
    first_link= entry;

    return 0;
  }

  uint size()
  { return m_size; }

  void resize(uint new_size)
  {
    mysql_mutex_lock(&lock);
    m_size= new_size;
    clear(true);
    mysql_mutex_unlock(&lock);
  }
};

template <class T> class Hash_filo: public hash_filo
{
public:
  Hash_filo(PSI_memory_key psi_key, uint size_arg, uint key_offset_arg, uint
            key_length_arg, my_hash_get_key get_key_arg, my_hash_free_key
            free_element_arg, CHARSET_INFO *hash_charset_arg) :
    hash_filo(psi_key, size_arg, key_offset_arg, key_length_arg,
              get_key_arg, free_element_arg, hash_charset_arg) {}
  T* first() { return (T*)hash_filo::first(); }
  T* last()  { return (T*)hash_filo::last(); }
  T* search(uchar* key, size_t len) { return (T*)hash_filo::search(key, len); }
};

#endif
server/private/rpl_mi.h000064400000035217150400263710011165 0ustar00/* Copyright (c) 2006, 2012, Oracle and/or its affiliates.

   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 */

#ifndef RPL_MI_H
#define RPL_MI_H

#ifdef HAVE_REPLICATION

#include "rpl_rli.h"
#include "rpl_reporting.h"
#include <my_sys.h>
#include "rpl_filter.h"
#include "keycaches.h"

typedef struct st_mysql MYSQL;

/**
  Domain id based filter to handle DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS used to
  set filtering on replication slave based on event's GTID domain_id.
*/
class Domain_id_filter
{
private:
  /*
    Flag to tell whether the events in the current GTID group get written to
    the relay log. It is set according to the domain_id based filtering rule
    on every GTID_EVENT and reset at the end of current GTID event group.
   */
  bool m_filter;

public:
  /* domain id list types */
  enum enum_list_type {
    DO_DOMAIN_IDS= 0,
    IGNORE_DOMAIN_IDS
  };

  /*
    DO_DOMAIN_IDS (0):
      Ignore all the events which do not belong to any of the domain ids in the
      list.

    IGNORE_DOMAIN_IDS (1):
      Ignore the events which belong to one of the domain ids in the list.
  */
  DYNAMIC_ARRAY m_domain_ids[2];

  Domain_id_filter();

  ~Domain_id_filter();

  /*
    Returns whether the current group needs to be filtered.
  */
  bool is_group_filtered() { return m_filter; }

  /*
    Checks whether the group with the specified domain_id needs to be
    filtered and updates m_filter flag accordingly.
  */
  void do_filter(ulong domain_id);

  /*
    Reset m_filter. It should be called when IO thread receives COMMIT_EVENT or
    XID_EVENT.
  */
  void reset_filter();

  /*
    Clear do_ids and ignore_ids to disable domain id filtering
  */
  void clear_ids();

  /*
    Update the do/ignore domain id filter lists.

    @param do_ids     [IN]            domain ids to be kept
    @param ignore_ids [IN]            domain ids to be filtered out
    @param using_gtid [IN]            use GTID?

    @retval false                     Success
            true                      Error
  */
  bool update_ids(DYNAMIC_ARRAY *do_ids, DYNAMIC_ARRAY *ignore_ids,
                  bool using_gtid);

  /*
    Serialize and store the ids from domain id lists into the thd's protocol
    buffer.

    @param thd [IN]                   thread handler

    @retval void
  */
  void store_ids(THD *thd);

  /*
    Initialize the given domain id list (DYNAMIC_ARRAY) with the
    space-separated list of numbers from the specified IO_CACHE where
    the first number is the total number of entries to follows.

    @param f    [IN]                  IO_CACHE file
    @param type [IN]                  domain id list type

    @retval false                     Success
            true                      Error
  */
  bool init_ids(IO_CACHE *f, enum_list_type type);

  /*
    Return the elements of the give domain id list type as string.

    @param type [IN]                  domain id list type

    @retval                           a string buffer storing the total number
                                      of elements followed by the individual
                                      elements (space-separated) in the
                                      specified list.

    Note: Its caller's responsibility to free the returned string buffer.
  */
  char *as_string(enum_list_type type);

};


extern TYPELIB slave_parallel_mode_typelib;

typedef struct st_rows_event_tracker
{
  char binlog_file_name[FN_REFLEN];
  my_off_t first_seen;
  my_off_t last_seen;
  bool stmt_end_seen;
  void update(const char *file_name, my_off_t pos,
              const uchar *buf,
              const Format_description_log_event *fdle);
  void reset();
  bool check_and_report(const char* file_name, my_off_t pos);
} Rows_event_tracker;

/*****************************************************************************
  Replication IO Thread

  Master_info contains:
    - information about how to connect to a master
    - current master log name
    - current master log offset
    - misc control variables

  Master_info is initialized once from the master.info file if such
  exists. Otherwise, data members corresponding to master.info fields
  are initialized with defaults specified by master-* options. The
  initialization is done through init_master_info() call.

  The format of master.info file:

  log_name
  log_pos
  master_host
  master_user
  master_pass
  master_port
  master_connect_retry

  To write out the contents of master.info file to disk ( needed every
  time we read and queue data from the master ), a call to
  flush_master_info() is required.

  To clean up, call end_master_info()

*****************************************************************************/

class Master_info : public Slave_reporting_capability
{
 public:
  enum enum_using_gtid {
    USE_GTID_NO= 0, USE_GTID_CURRENT_POS= 1, USE_GTID_SLAVE_POS= 2
  };

  Master_info(LEX_CSTRING *connection_name, bool is_slave_recovery);
  ~Master_info();
  bool shall_ignore_server_id(ulong s_id);
  void clear_in_memory_info(bool all);
  bool error()
  {
    /* If malloc() in initialization failed */
    return connection_name.str == 0;
  }
  static const char *using_gtid_astext(enum enum_using_gtid arg);
  bool using_parallel()
  {
    return opt_slave_parallel_threads > 0 &&
      parallel_mode > SLAVE_PARALLEL_NONE;
  }
  void release();
  void wait_until_free();
  void lock_slave_threads();
  void unlock_slave_threads();

  ulonglong get_slave_skip_counter()
  {
    return rli.slave_skip_counter;
  }

  ulonglong get_max_relay_log_size()
  {
    return rli.max_relay_log_size;
  }

  /* the variables below are needed because we can change masters on the fly */
  char master_log_name[FN_REFLEN+6]; /* Room for multi-*/
  char host[HOSTNAME_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
  char user[USERNAME_LENGTH+1];
  char password[MAX_PASSWORD_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
  LEX_CSTRING connection_name; 		/* User supplied connection name */
  LEX_CSTRING cmp_connection_name;	/* Connection name in lower case */
  bool ssl; // enables use of SSL connection if true
  char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN];
  char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN];
  char ssl_crl[FN_REFLEN], ssl_crlpath[FN_REFLEN];
  bool ssl_verify_server_cert;

  my_off_t master_log_pos;
  File fd; // we keep the file open, so we need to remember the file pointer
  IO_CACHE file;

  mysql_mutex_t data_lock, run_lock, sleep_lock, start_stop_lock;
  mysql_cond_t data_cond, start_cond, stop_cond, sleep_cond;
  THD *io_thd;
  MYSQL* mysql;
  uint32 file_id;				/* for 3.23 load data infile */
  Relay_log_info rli;
  uint port;
  Rpl_filter* rpl_filter;      /* Each replication can set its filter rule*/
  /*
    to hold checksum alg in use until IO thread has received FD.
    Initialized to novalue, then set to the queried from master
    @@global.binlog_checksum and deactivated once FD has been received.
  */
  enum enum_binlog_checksum_alg checksum_alg_before_fd;
  uint connect_retry;
#ifndef DBUG_OFF
  int events_till_disconnect;

  /*
    The following are auxiliary DBUG variables used to kill IO thread in the
    middle of a group/transaction (see "kill_slave_io_after_2_events").
  */
  bool dbug_do_disconnect;
  int dbug_event_counter;
#endif
  bool inited;
  volatile bool abort_slave;
  volatile uint slave_running;
  volatile ulong slave_run_id;
  /*
     The difference in seconds between the clock of the master and the clock of
     the slave (second - first). It must be signed as it may be <0 or >0.
     clock_diff_with_master is computed when the I/O thread starts; for this the
     I/O thread does a SELECT UNIX_TIMESTAMP() on the master.
     "how late the slave is compared to the master" is computed like this:
     clock_of_slave - last_timestamp_executed_by_SQL_thread - clock_diff_with_master

  */
  long clock_diff_with_master;
  /*
    Keeps track of the number of events before fsyncing.
    The option --sync-master-info determines how many
    events should happen before fsyncing.
  */
  uint sync_counter;
  float heartbeat_period;         // interface with CHANGE MASTER or master.info
  ulonglong received_heartbeats;  // counter of received heartbeat events
  DYNAMIC_ARRAY ignore_server_ids;
  ulong master_id;
  /*
    At reconnect and until the first rotate event is seen, prev_master_id is
    the value of master_id during the previous connection, used to detect
    silent change of master server during reconnects.
  */
  ulong prev_master_id;
  /*
    Which kind of GTID position (if any) is used when connecting to master.

    Note that you can not change the numeric values of these, they are used
    in master.info.
  */
  enum enum_using_gtid using_gtid;

  /*
    This GTID position records how far we have fetched into the relay logs.
    This is used to continue fetching when the IO thread reconnects to the
    master.

    (Full slave stop/start does not use it, as it resets the relay logs).
  */
  slave_connection_state gtid_current_pos;
  /*
    If events_queued_since_last_gtid is non-zero, it is the number of events
    queued so far in the relaylog of a GTID-prefixed event group.
    It is zero when no partial event group has been queued at the moment.
  */
  uint64 events_queued_since_last_gtid;
  /*
    The GTID of the partially-queued event group, when
    events_queued_since_last_gtid is non-zero.
  */
  rpl_gtid last_queued_gtid;
  /* Whether last_queued_gtid had the FL_STANDALONE flag set. */
  bool last_queued_gtid_standalone;
  /*
    When slave IO thread needs to reconnect, gtid_reconnect_event_skip_count
    counts number of events to skip from the first GTID-prefixed event group,
    to avoid duplicating events in the relay log.
  */
  uint64 gtid_reconnect_event_skip_count;
  /* gtid_event_seen is false until we receive first GTID event from master. */
  bool gtid_event_seen;
  /**
    The struct holds some history of Rows- log-event reading/queuing
    by the receiver thread. Its fields are updated per each such event
    at time of queue_event(), and they are checked to detect
    the Rows- event group integrity violation at time of first non-Rows-
    event gets handled.
  */
  Rows_event_tracker rows_event_tracker;
  bool in_start_all_slaves, in_stop_all_slaves;
  bool in_flush_all_relay_logs;
  uint users;                                   /* Active user for object */
  uint killed;


  /* No of DDL event group */
  Atomic_counter<uint64> total_ddl_groups;

  /* No of non-transactional event group*/
  Atomic_counter<uint64> total_non_trans_groups;

  /* No of transactional event group*/
  Atomic_counter<uint64> total_trans_groups;

  /* domain-id based filter */
  Domain_id_filter domain_id_filter;

  /* The parallel replication mode. */
  enum_slave_parallel_mode parallel_mode;
  /*
    semi_ack is used to identify if the current binlog event needs an
    ACK from slave, or if delay_master is enabled.
  */
  int semi_ack;
  /*
    The flag has replicate_same_server_id semantics and is raised to accept
    a same-server-id event group by the gtid strict mode semisync slave.
    Own server-id events can normally appear as result of EITHER
    A. this server semisync (failover to) slave crash-recovery:
       the transaction was created on this server then being master,
       got replicated elsewhere right before the crash before commit,
       and finally at recovery the transaction gets evicted from the
       server's binlog and its gtid (slave) state; OR
    B. in a general circular configuration and then when a recieved (returned
       to slave) gtid exists in the server's binlog. Then, in gtid strict mode,
       it must be ignored similarly to the replicate-same-server-id rule.
 */
  bool do_accept_own_server_id;
  /*
    Set to 1 when semi_sync is enabled. Set to 0 if there is any transmit
    problems to the slave, in which case any furter semi-sync reply is
    ignored
  */
  bool semi_sync_reply_enabled;
};

int init_master_info(Master_info* mi, const char* master_info_fname,
		     const char* slave_info_fname,
		     bool abort_if_no_master_info_file,
		     int thread_mask);
void end_master_info(Master_info* mi);
int flush_master_info(Master_info* mi, 
                      bool flush_relay_log_cache, 
                      bool need_lock_relay_log);
void copy_filter_setting(Rpl_filter* dst_filter, Rpl_filter* src_filter);
void update_change_master_ids(DYNAMIC_ARRAY *new_ids, DYNAMIC_ARRAY *old_ids);
void prot_store_ids(THD *thd, DYNAMIC_ARRAY *ids);

/*
  Multi master are handled trough this struct.
  Changes to this needs to be protected by LOCK_active_mi;
*/

class Master_info_index
{
private:
  IO_CACHE index_file;
  char index_file_name[FN_REFLEN];

public:
  Master_info_index();
  ~Master_info_index();

  HASH master_info_hash;

  bool init_all_master_info();
  bool write_master_name_to_index_file(LEX_CSTRING *connection_name,
                                       bool do_sync);

  bool check_duplicate_master_info(LEX_CSTRING *connection_name,
                                   const char *host, uint port);
  bool add_master_info(Master_info *mi, bool write_to_file);
  bool remove_master_info(Master_info *mi);
  Master_info *get_master_info(const LEX_CSTRING *connection_name,
                               Sql_condition::enum_warning_level warning);
  bool start_all_slaves(THD *thd);
  bool stop_all_slaves(THD *thd);
  void free_connections();
  bool flush_all_relay_logs();
};


/*
  The class rpl_io_thread_info is the THD::system_thread_info for the IO thread.
*/
class rpl_io_thread_info
{
public:
};


Master_info *get_master_info(const LEX_CSTRING *connection_name,
                             Sql_condition::enum_warning_level warning);
bool check_master_connection_name(LEX_CSTRING *name);
void create_logfile_name_with_suffix(char *res_file_name, size_t length,
                             const char *info_file, 
                             bool append,
                             LEX_CSTRING *suffix);

uchar *get_key_master_info(Master_info *mi, size_t *length,
                           my_bool not_used __attribute__((unused)));
void free_key_master_info(Master_info *mi);
uint any_slave_sql_running(bool already_locked);
bool give_error_if_slave_running(bool already_lock);

#endif /* HAVE_REPLICATION */
#endif /* RPL_MI_H */
server/private/ha_handler_stats.h000064400000004437150400263710013206 0ustar00#ifndef HA_HANDLER_STATS_INCLUDED
#define HA_HANDLER_STATS_INCLUDED
/*
   Copyright (c) 2023, MariaDB Foundation

   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
*/

/* Definitions for parameters to do with handler-routines */

class ha_handler_stats
{
public:
  ulonglong pages_accessed;              /* Pages accessed from page cache */
  ulonglong pages_updated;               /* Pages changed in page cache */
  ulonglong pages_read_count;            /* Pages read from disk */

  /* Time spent reading pages, in timer_tracker_frequency() units */
  ulonglong pages_read_time;

  /* 
    Number of pages that we've requested to prefetch while running the query.
    Note that we don't know:
    - how much time was spent reading these pages (and how to count the time
      if reading was done in parallel)
    - whether the pages were read by "us" or somebody else...
  */
  ulonglong pages_prefetched;

  ulonglong undo_records_read;

  /* Time spent in engine, in timer_tracker_frequency() units */
  ulonglong engine_time;
  uint      active;                      /* <> 0 if status has to be updated */

  ha_handler_stats()
  {
    active= 0;
  }

#define first_stat pages_accessed
#define last_stat  engine_time
  inline void reset()
  {
    bzero((void*) this, sizeof(*this));
  }
  inline void add(ha_handler_stats *stats)
  {
    ulonglong *to= &first_stat;
    ulonglong *from= &stats->first_stat;
    do
    {
      (*to)+= *from++;
    } while (to++ != &last_stat);
  }
  inline bool has_stats()
  {
    if (!active)
      return 0;
    ulonglong *to= &first_stat;
    do
    {
      if (*to)
        return 1;
    } while (to++ != &last_stat);
    return 0;
  }
};
#endif /* HA_HANDLER_STATS_INCLUDED */
server/private/wsrep_mysqld_c.h000064400000002313150400263710012725 0ustar00/* Copyright 2018-2018 Codership Oy <http://www.codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef WSREP_MYSQLD_C_H
#define WSREP_MYSQLD_C_H

enum enum_wsrep_certification_rules {
    WSREP_CERTIFICATION_RULES_STRICT,
    WSREP_CERTIFICATION_RULES_OPTIMIZED
};

/* This is intentionally declared as a weak global symbol, so that
the same ha_innodb.so can be used with the embedded server
(which does not link to the definition of this variable)
and with the regular server built WITH_WSREP. */
extern ulong wsrep_certification_rules __attribute__((weak));

#endif /* WSREP_MYSQLD_C_H */
server/private/des_key_file.h000064400000002324150400263710012316 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef DES_KEY_FILE_INCLUDED
#define DES_KEY_FILE_INCLUDED

#ifdef HAVE_des
#include <openssl/des.h>

#include "violite.h"                /* DES_cblock, DES_key_schedule */

struct st_des_keyblock
{
  DES_cblock key1, key2, key3;
};

struct st_des_keyschedule
{
  DES_key_schedule ks1, ks2, ks3;
};

extern struct st_des_keyschedule des_keyschedule[10];
extern uint des_default_key;

bool load_des_key_file(const char *file_name);
#endif /* HAVE_des */

#endif /* DES_KEY_FILE_INCLUDED */
server/private/key.h000064400000004124150400263710010464 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef KEY_INCLUDED
#define KEY_INCLUDED

class Field;
class String;
struct TABLE;
typedef struct st_bitmap MY_BITMAP;
typedef struct st_key KEY;
typedef struct st_key_part_info KEY_PART_INFO;

int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
                 uint *key_length, uint *keypart);
void key_copy(uchar *to_key, const uchar *from_record, const KEY *key_info,
              uint key_length, bool with_zerofill= FALSE);
void key_restore(uchar *to_record, const uchar *from_key, KEY *key_info,
                 uint key_length);
bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
void key_unpack(String *to, TABLE *table, KEY *key);
void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
                  bool prefix_key);
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key);
bool key_buf_cmp(KEY *key_info, uint used_key_parts,
                 const uchar *key1, const uchar *key2);
extern "C" int key_rec_cmp(const KEY *const *key_info, const uchar *a,
                           const uchar *b);
int key_tuple_cmp(KEY_PART_INFO *part, const uchar *key1, const uchar *key2,
                  uint tuple_length);

#endif /* KEY_INCLUDED */
server/private/debug_sync.h000064400000003776150400263710012032 0ustar00#ifndef DEBUG_SYNC_INCLUDED
#define DEBUG_SYNC_INCLUDED

/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.

   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 */

/**
  @file

  Declarations for the Debug Sync Facility. See debug_sync.cc for details.
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface                      /* gcc class implementation */
#endif

class THD;

#if defined(ENABLED_DEBUG_SYNC)

/* Command line option --debug-sync-timeout. See mysqld.cc. */
extern MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout;

/* Default WAIT_FOR timeout if command line option is given without argument. */
#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300

/* Debug Sync prototypes. See debug_sync.cc. */
extern int  debug_sync_init(void);
extern void debug_sync_end(void);
extern void debug_sync_init_thread(THD *thd);
extern void debug_sync_end_thread(THD *thd);
void debug_sync_reset_thread(THD *thd);
extern bool debug_sync_set_action(THD *thd, const char *action_str, size_t len);
extern bool debug_sync_update(THD *thd, char *val_str, size_t len);
extern uchar *debug_sync_value_ptr(THD *thd);
#else
static inline void debug_sync_init_thread(THD *thd) {}
static inline void debug_sync_end_thread(THD *thd) {}
static inline void debug_sync_reset_thread(THD *thd) {}
static inline bool debug_sync_set_action(THD *, const char *, size_t)
{ return false; }
#endif /* defined(ENABLED_DEBUG_SYNC) */
#endif /* DEBUG_SYNC_INCLUDED */
server/private/sp_pcontext.h000064400000060501150400263710012243 0ustar00/* -*- C++ -*- */
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2009, 2020, 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 */

#ifndef _SP_PCONTEXT_H_
#define _SP_PCONTEXT_H_

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_string.h"                         // LEX_STRING
#include "field.h"                              // Create_field
#include "sql_array.h"                          // Dynamic_array


/// This class represents a stored program variable or a parameter
/// (also referenced as 'SP-variable').

class sp_variable : public Sql_alloc
{
public:
  enum enum_mode
  {
    MODE_IN,
    MODE_OUT,
    MODE_INOUT
  };

  /// Name of the SP-variable.
  LEX_CSTRING name;

  /// Mode of the SP-variable.
  enum_mode mode;

  /// The index to the variable's value in the runtime frame.
  ///
  /// It is calculated during parsing and used when creating sp_instr_set
  /// instructions and Item_splocal items. I.e. values are set/referred by
  /// array indexing in runtime.
  uint offset;

  /// Default value of the SP-variable (if any).
  Item *default_value;

  /// Full type information (field meta-data) of the SP-variable.
  Spvar_definition field_def;

  /// Field-type of the SP-variable.
  const Type_handler *type_handler() const
    { return field_def.type_handler(); }

public:
  sp_variable(const LEX_CSTRING *name_arg, uint offset_arg)
   :Sql_alloc(),
    name(*name_arg),
    mode(MODE_IN),
    offset(offset_arg),
    default_value(NULL)
  { }
  /*
    Find a ROW field by its qualified name.
    @param      var_name - the name of the variable
    @param      field_name - the name of the variable field
    @param[OUT] row_field_offset - the index of the field

    @retval  NULL if the variable with the given name was not found,
             or it is not a row variable, or it does not have a field
             with the given name, or a non-null pointer otherwise.
             row_field_offset[0] is set only when the method returns !NULL.
  */
  const Spvar_definition *find_row_field(const LEX_CSTRING *var_name,
                                         const LEX_CSTRING *field_name,
                                         uint *row_field_offset);
};

///////////////////////////////////////////////////////////////////////////

/// This class represents an SQL/PSM label. Can refer to the identifier
/// used with the "label_name:" construct which may precede some SQL/PSM
/// statements, or to an implicit implementation-dependent identifier which
/// the parser inserts before a high-level flow control statement such as
/// IF/WHILE/REPEAT/LOOP, when such statement is rewritten into a
/// combination of low-level jump/jump_if instructions and labels.


class sp_label : public Sql_alloc
{
public:
  enum enum_type
  {
    /// Implicit label generated by parser.
    IMPLICIT,

    /// Label at BEGIN.
    BEGIN,

    /// Label at iteration control
    ITERATION,

    /// Label for jump
    GOTO
  };

  /// Name of the label.
  LEX_CSTRING name;

  /// Instruction pointer of the label.
  uint ip;

  /// Type of the label.
  enum_type type;

  /// Scope of the label.
  class sp_pcontext *ctx;

public:
  sp_label(const LEX_CSTRING *_name,
           uint _ip, enum_type _type, sp_pcontext *_ctx)
   :Sql_alloc(),
    name(*_name),
    ip(_ip),
    type(_type),
    ctx(_ctx)
  { }
};


///////////////////////////////////////////////////////////////////////////

/// This class represents condition-value term in DECLARE CONDITION or
/// DECLARE HANDLER statements. sp_condition_value has little to do with
/// SQL-conditions.
///
/// In some sense, this class is a union -- a set of filled attributes
/// depends on the sp_condition_value::type value.

class sp_condition_value : public Sql_alloc, public Sql_state_errno
{
  bool m_is_user_defined;
public:
  enum enum_type
  {
    ERROR_CODE,
    SQLSTATE,
    WARNING,
    NOT_FOUND,
    EXCEPTION
  };

  /// Type of the condition value.
  enum_type type;

public:
  sp_condition_value(uint _mysqlerr)
   :Sql_alloc(),
    Sql_state_errno(_mysqlerr),
    m_is_user_defined(false),
    type(ERROR_CODE)
  { }

  sp_condition_value(uint _mysqlerr, const char *_sql_state)
   :Sql_alloc(),
    Sql_state_errno(_mysqlerr, _sql_state),
    m_is_user_defined(false),
    type(ERROR_CODE)
  { }

  sp_condition_value(const char *_sql_state, bool is_user_defined= false)
   :Sql_alloc(),
    Sql_state_errno(0, _sql_state),
    m_is_user_defined(is_user_defined),
    type(SQLSTATE)
  { }

  sp_condition_value(enum_type _type)
   :Sql_alloc(),
    m_is_user_defined(false),
    type(_type)
  {
    DBUG_ASSERT(type != ERROR_CODE && type != SQLSTATE);
  }

  /// Check if two instances of sp_condition_value are equal or not.
  ///
  /// @param cv another instance of sp_condition_value to check.
  ///
  /// @return true if the instances are equal, false otherwise.
  bool equals(const sp_condition_value *cv) const;


  /**
    Checks if this condition is OK for search.
    See also sp_context::find_handler().

    @param identity - The condition identity
    @param found_cv - A previously found matching condition or NULL.
    @return true    - If the current value matches identity and
                      makes a stronger match than the previously
                      found condition found_cv.
    @return false   - If the current value does not match identity,
                      of the current value makes a weaker match than found_cv.
  */
  bool matches(const Sql_condition_identity &identity,
               const sp_condition_value *found_cv) const;

  Sql_user_condition_identity get_user_condition_identity() const
  {
    return Sql_user_condition_identity(m_is_user_defined ? this : NULL);
  }
};


class sp_condition_value_user_defined: public sp_condition_value
{
public:
  sp_condition_value_user_defined()
   :sp_condition_value("45000", true)
  { }
};


///////////////////////////////////////////////////////////////////////////

/// This class represents 'DECLARE CONDITION' statement.
/// sp_condition has little to do with SQL-conditions.

class sp_condition : public Sql_alloc
{
public:
  /// Name of the condition.
  LEX_CSTRING name;

  /// Value of the condition.
  sp_condition_value *value;

public:
  sp_condition(const LEX_CSTRING *name_arg, sp_condition_value *value_arg)
   :Sql_alloc(),
    name(*name_arg),
    value(value_arg)
  { }
  sp_condition(const char *name_arg, size_t name_length_arg,
               sp_condition_value *value_arg)
   :value(value_arg)
  {
    name.str=    name_arg;
    name.length= name_length_arg;
  }
  bool eq_name(const LEX_CSTRING *str) const
  {
    return system_charset_info->strnncoll(name.str, name.length,
                                          str->str, str->length) == 0;
  }
};


///////////////////////////////////////////////////////////////////////////

/**
  class sp_pcursor.
  Stores information about a cursor:
  - Cursor's name in LEX_STRING.
  - Cursor's formal parameter descriptions.

    Formal parameter descriptions reside in a separate context block,
    pointed by the "m_param_context" member.

    m_param_context can be NULL. This means a cursor with no parameters.
    Otherwise, the number of variables in m_param_context means
    the number of cursor's formal parameters.

    Note, m_param_context can be not NULL, but have no variables.
    This is also means a cursor with no parameters (similar to NULL).
*/
class sp_pcursor: public LEX_CSTRING
{
  class sp_pcontext *m_param_context; // Formal parameters
  class sp_lex_cursor *m_lex;         // The cursor statement LEX
public:
  sp_pcursor(const LEX_CSTRING *name, class sp_pcontext *param_ctx,
             class sp_lex_cursor *lex)
   :LEX_CSTRING(*name), m_param_context(param_ctx), m_lex(lex)
  { }
  class sp_pcontext *param_context() const { return m_param_context; }
  class sp_lex_cursor *lex() const { return m_lex; }
  bool check_param_count_with_error(uint param_count) const;
};


///////////////////////////////////////////////////////////////////////////

/// This class represents 'DECLARE HANDLER' statement.

class sp_handler : public Sql_alloc
{
public:
  /// Enumeration of possible handler types.
  /// Note: UNDO handlers are not (and have never been) supported.
  enum enum_type
  {
    EXIT,
    CONTINUE
  };

  /// Handler type.
  enum_type type;

  /// Conditions caught by this handler.
  List<sp_condition_value> condition_values;

public:
  /// The constructor.
  ///
  /// @param _type SQL-handler type.
  sp_handler(enum_type _type)
   :Sql_alloc(),
    type(_type)
  { }
};

///////////////////////////////////////////////////////////////////////////

/// The class represents parse-time context, which keeps track of declared
/// variables/parameters, conditions, handlers, cursors and labels.
///
/// sp_pcontext objects are organized in a tree according to the following
/// rules:
///   - one sp_pcontext object corresponds for for each BEGIN..END block;
///   - one sp_pcontext object corresponds for each exception handler;
///   - one additional sp_pcontext object is created to contain
///     Stored Program parameters.
///
/// sp_pcontext objects are used both at parse-time and at runtime.
///
/// During the parsing stage sp_pcontext objects are used:
///   - to look up defined names (e.g. declared variables and visible
///     labels);
///   - to check for duplicates;
///   - for error checking;
///   - to calculate offsets to be used at runtime.
///
/// During the runtime phase, a tree of sp_pcontext objects is used:
///   - for error checking (e.g. to check correct number of parameters);
///   - to resolve SQL-handlers.

class sp_pcontext : public Sql_alloc
{
public:
  enum enum_scope
  {
    /// REGULAR_SCOPE designates regular BEGIN ... END blocks.
    REGULAR_SCOPE,

    /// HANDLER_SCOPE designates SQL-handler blocks.
    HANDLER_SCOPE
  };

  class Lex_for_loop: public Lex_for_loop_st
  {
  public:
    /*
      The label poiting to the body start,
      either explicit or automatically generated.
      Used during generation of "ITERATE loop_label"
      to check if "loop_label" is a FOR loop label.
      - In case of a FOR loop, some additional code
        (cursor fetch or iteger increment) is generated before
        the backward jump to the beginning of the loop body.
      - In case of other loop types (WHILE, REPEAT)
        only the jump is generated.
    */
    const sp_label *m_start_label;

    Lex_for_loop()
     :m_start_label(NULL)
    { Lex_for_loop_st::init(); }

    Lex_for_loop(const Lex_for_loop_st &for_loop, const sp_label *start)
     :m_start_label(start)
    {
      Lex_for_loop_st::operator=(for_loop);
    }
  };

public:
  sp_pcontext();
  ~sp_pcontext();


  /// Create and push a new context in the tree.

  /// @param thd   thread context.
  /// @param scope scope of the new parsing context.
  /// @return the node created.
  sp_pcontext *push_context(THD *thd, enum_scope scope);

  /// Pop a node from the parsing context tree.
  /// @return the parent node.
  sp_pcontext *pop_context();

  sp_pcontext *parent_context() const
  { return m_parent; }

  sp_pcontext *child_context(uint i) const
  { return i < m_children.elements() ? m_children.at(i) : NULL; }

  /// Calculate and return the number of handlers to pop between the given
  /// context and this one.
  ///
  /// @param ctx       the other parsing context.
  /// @param exclusive specifies if the last scope should be excluded.
  ///
  /// @return the number of handlers to pop between the given context and
  /// this one.  If 'exclusive' is true, don't count the last scope we are
  /// leaving; this is used for LEAVE where we will jump to the hpop
  /// instructions.
  uint diff_handlers(const sp_pcontext *ctx, bool exclusive) const;

  /// Calculate and return the number of cursors to pop between the given
  /// context and this one.
  ///
  /// @param ctx       the other parsing context.
  /// @param exclusive specifies if the last scope should be excluded.
  ///
  /// @return the number of cursors to pop between the given context and
  /// this one.  If 'exclusive' is true, don't count the last scope we are
  /// leaving; this is used for LEAVE where we will jump to the cpop
  /// instructions.
  uint diff_cursors(const sp_pcontext *ctx, bool exclusive) const;

  /////////////////////////////////////////////////////////////////////////
  // SP-variables (parameters and variables).
  /////////////////////////////////////////////////////////////////////////

  /// @return the maximum number of variables used in this and all child
  /// contexts. For the root parsing context, this gives us the number of
  /// slots needed for variables during the runtime phase.
  uint max_var_index() const
  { return m_max_var_index; }

  /// @return the current number of variables used in the parent contexts
  /// (from the root), including this context.
  uint current_var_count() const
  { return m_var_offset + (uint)m_vars.elements(); }

  /// @return the number of variables in this context alone.
  uint context_var_count() const
  { return (uint)m_vars.elements(); }

  /// return the i-th variable on the current context
  sp_variable *get_context_variable(uint i) const
  {
    DBUG_ASSERT(i < m_vars.elements());
    return m_vars.at(i);
  }

  /*
    Return the i-th last context variable.
    If i is 0, then return the very last variable in m_vars.
  */
  sp_variable *get_last_context_variable(uint i= 0) const
  {
    DBUG_ASSERT(i < m_vars.elements());
    return m_vars.at(m_vars.elements() - i - 1);
  }

  /// Add SP-variable to the parsing context.
  ///
  /// @param thd  Thread context.
  /// @param name Name of the SP-variable.
  ///
  /// @return instance of newly added SP-variable.
  sp_variable *add_variable(THD *thd, const LEX_CSTRING *name);

  /// Retrieve full type information about SP-variables in this parsing
  /// context and its children.
  ///
  /// @param field_def_lst[out] Container to store type information.
  void retrieve_field_definitions(List<Spvar_definition> *field_def_lst) const;

  /// Find SP-variable by name.
  ///
  /// The function does a linear search (from newer to older variables,
  /// in case we have shadowed names).
  ///
  /// The function is called only at parsing time.
  ///
  /// @param name               Variable name.
  /// @param current_scope_only A flag if we search only in current scope.
  ///
  /// @return instance of found SP-variable, or NULL if not found.
  sp_variable *find_variable(const LEX_CSTRING *name, bool current_scope_only) const;

  /// Find SP-variable by the offset in the root parsing context.
  ///
  /// The function is used for two things:
  /// - When evaluating parameters at the beginning, and setting out parameters
  ///   at the end, of invocation. (Top frame only, so no recursion then.)
  /// - For printing of sp_instr_set. (Debug mode only.)
  ///
  /// @param offset Variable offset in the root parsing context.
  ///
  /// @return instance of found SP-variable, or NULL if not found.
  sp_variable *find_variable(uint offset) const;

  /// Set the current scope boundary (for default values).
  ///
  /// @param n The number of variables to skip.
  void declare_var_boundary(uint n)
  { m_pboundary= n; }

  /////////////////////////////////////////////////////////////////////////
  // CASE expressions.
  /////////////////////////////////////////////////////////////////////////

  int register_case_expr()
  { return m_num_case_exprs++; }

  int get_num_case_exprs() const
  { return m_num_case_exprs; }

  bool push_case_expr_id(int case_expr_id)
  { return m_case_expr_ids.append(case_expr_id); }

  void pop_case_expr_id()
  { m_case_expr_ids.pop(); }

  int get_current_case_expr_id() const
  { return *m_case_expr_ids.back(); }

  /////////////////////////////////////////////////////////////////////////
  // Labels.
  /////////////////////////////////////////////////////////////////////////

  sp_label *push_label(THD *thd, const LEX_CSTRING *name, uint ip,
                       sp_label::enum_type type, List<sp_label> * list);

  sp_label *push_label(THD *thd, const LEX_CSTRING *name, uint ip,
                       sp_label::enum_type type)
  { return push_label(thd, name, ip, type, &m_labels); }

  sp_label *push_goto_label(THD *thd, const LEX_CSTRING *name, uint ip,
                            sp_label::enum_type type)
  { return push_label(thd, name, ip, type, &m_goto_labels); }

  sp_label *push_label(THD *thd, const LEX_CSTRING *name, uint ip)
  { return push_label(thd, name, ip, sp_label::IMPLICIT); }

  sp_label *push_goto_label(THD *thd, const LEX_CSTRING *name, uint ip)
  { return push_goto_label(thd, name, ip, sp_label::GOTO); }

  sp_label *find_label(const LEX_CSTRING *name);

  sp_label *find_goto_label(const LEX_CSTRING *name, bool recusive);

  sp_label *find_goto_label(const LEX_CSTRING *name)
  { return find_goto_label(name, true); }

  sp_label *find_label_current_loop_start();

  sp_label *last_label()
  {
    sp_label *label= m_labels.head();

    if (!label && m_parent)
      label= m_parent->last_label();

    return label;
  }

  sp_label *last_goto_label()
  {
    return m_goto_labels.head();
  }

  sp_label *pop_label()
  { return m_labels.pop(); }

  bool block_label_declare(LEX_CSTRING *label)
  {
    sp_label *lab= find_label(label);
    if (lab)
    {
      my_error(ER_SP_LABEL_REDEFINE, MYF(0), label->str);
      return true;
    }
    return false;
  }

  /////////////////////////////////////////////////////////////////////////
  // Conditions.
  /////////////////////////////////////////////////////////////////////////

  bool add_condition(THD *thd, const LEX_CSTRING *name,
                               sp_condition_value *value);

  /// See comment for find_variable() above.
  sp_condition_value *find_condition(const LEX_CSTRING *name,
                                     bool current_scope_only) const;

  sp_condition_value *
  find_declared_or_predefined_condition(THD *thd, const LEX_CSTRING *name) const;

  bool declare_condition(THD *thd, const LEX_CSTRING *name,
                                   sp_condition_value *val)
  {
    if (find_condition(name, true))
    {
      my_error(ER_SP_DUP_COND, MYF(0), name->str);
      return true;
    }
    return add_condition(thd, name, val);
  }

  /////////////////////////////////////////////////////////////////////////
  // Handlers.
  /////////////////////////////////////////////////////////////////////////

  sp_handler *add_handler(THD* thd, sp_handler::enum_type type);

  /// This is an auxilary parsing-time function to check if an SQL-handler
  /// exists in the current parsing context (current scope) for the given
  /// SQL-condition. This function is used to check for duplicates during
  /// the parsing phase.
  ///
  /// This function can not be used during the runtime phase to check
  /// SQL-handler existence because it searches for the SQL-handler in the
  /// current scope only (during runtime, current and parent scopes
  /// should be checked according to the SQL-handler resolution rules).
  ///
  /// @param condition_value the handler condition value
  ///                        (not SQL-condition!).
  ///
  /// @retval true if such SQL-handler exists.
  /// @retval false otherwise.
  bool check_duplicate_handler(const sp_condition_value *cond_value) const;

  /// Find an SQL handler for the given SQL condition according to the
  /// SQL-handler resolution rules. This function is used at runtime.
  ///
  /// @param value            The error code and the SQL state
  /// @param level            The SQL condition level
  ///
  /// @return a pointer to the found SQL-handler or NULL.
  sp_handler *find_handler(const Sql_condition_identity &identity) const;

  /////////////////////////////////////////////////////////////////////////
  // Cursors.
  /////////////////////////////////////////////////////////////////////////

  bool add_cursor(const LEX_CSTRING *name, sp_pcontext *param_ctx,
                  class sp_lex_cursor *lex);

  /// See comment for find_variable() above.
  const sp_pcursor *find_cursor(const LEX_CSTRING *name,
                                uint *poff, bool current_scope_only) const;

  const sp_pcursor *find_cursor_with_error(const LEX_CSTRING *name,
                                           uint *poff,
                                           bool current_scope_only) const
  {
    const sp_pcursor *pcursor= find_cursor(name, poff, current_scope_only);
    if (!pcursor)
    {
      my_error(ER_SP_CURSOR_MISMATCH, MYF(0), name->str);
      return NULL;
    }
    return pcursor;
  }
  /// Find cursor by offset (for SHOW {PROCEDURE|FUNCTION} CODE only).
  const sp_pcursor *find_cursor(uint offset) const;

  const sp_pcursor *get_cursor_by_local_frame_offset(uint offset) const
  { return &m_cursors.at(offset); }

  uint cursor_offset() const
  { return m_cursor_offset; }

  uint frame_cursor_count() const
  { return (uint)m_cursors.elements(); }

  uint max_cursor_index() const
  { return m_max_cursor_index + (uint)m_cursors.elements(); }

  uint current_cursor_count() const
  { return m_cursor_offset + (uint)m_cursors.elements(); }

  void set_for_loop(const Lex_for_loop_st &for_loop)
  {
    m_for_loop= Lex_for_loop(for_loop, last_label());
  }
  const Lex_for_loop &for_loop()
  {
    return m_for_loop;
  }

private:
  /// Constructor for a tree node.
  /// @param prev the parent parsing context
  /// @param scope scope of this parsing context
  sp_pcontext(sp_pcontext *prev, enum_scope scope);

  void init(uint var_offset, uint cursor_offset, int num_case_expressions);

  /* Prevent use of these */
  sp_pcontext(const sp_pcontext &);
  void operator=(sp_pcontext &);

  sp_condition_value *find_predefined_condition(const LEX_CSTRING *name) const;

private:
  /// m_max_var_index -- number of variables (including all types of arguments)
  /// in this context including all children contexts.
  ///
  /// m_max_var_index >= m_vars.elements().
  ///
  /// m_max_var_index of the root parsing context contains number of all
  /// variables (including arguments) in all enclosed contexts.
  uint m_max_var_index;

  /// The maximum sub context's framesizes.
  uint m_max_cursor_index;

  /// Parent context.
  sp_pcontext *m_parent;

  /// An index of the first SP-variable in this parsing context. The index
  /// belongs to a runtime table of SP-variables.
  ///
  /// Note:
  ///   - m_var_offset is 0 for root parsing context;
  ///   - m_var_offset is different for all nested parsing contexts.
  uint m_var_offset;

  /// Cursor offset for this context.
  uint m_cursor_offset;

  /// Boundary for finding variables in this context. This is the number of
  /// variables currently "invisible" to default clauses. This is normally 0,
  /// but will be larger during parsing of DECLARE ... DEFAULT, to get the
  /// scope right for DEFAULT values.
  uint m_pboundary;

  int m_num_case_exprs;

  /// SP parameters/variables.
  Dynamic_array<sp_variable *> m_vars;

  /// Stack of CASE expression ids.
  Dynamic_array<int> m_case_expr_ids;

  /// Stack of SQL-conditions.
  Dynamic_array<sp_condition *> m_conditions;

  /// Stack of cursors.
  Dynamic_array<sp_pcursor> m_cursors;

  /// Stack of SQL-handlers.
  Dynamic_array<sp_handler *> m_handlers;

  /*
   In the below example the label <<lab>> has two meanings:
   - GOTO lab : must go before the beginning of the loop
   - CONTINUE lab : must go to the beginning of the loop
   We solve this by storing block labels and goto labels into separate lists.

   BEGIN
     <<lab>>
     FOR i IN a..10 LOOP
       ...
       GOTO lab;
       ...
       CONTINUE lab;
       ...
     END LOOP;
   END;
  */
  /// List of block labels
  List<sp_label> m_labels;
  /// List of goto labels
  List<sp_label> m_goto_labels;

  /// Children contexts, used for destruction.
  Dynamic_array<sp_pcontext *> m_children;

  /// Scope of this parsing context.
  enum_scope m_scope;

  /// FOR LOOP characteristics
  Lex_for_loop m_for_loop;
}; // class sp_pcontext : public Sql_alloc


#endif /* _SP_PCONTEXT_H_ */
server/private/thr_malloc.h000064400000002262150400263720012022 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef THR_MALLOC_INCLUDED
#define THR_MALLOC_INCLUDED

typedef struct st_mem_root MEM_ROOT;

void init_sql_alloc(PSI_memory_key key, MEM_ROOT *root, uint block_size, uint
                    pre_alloc_size, myf my_flags);
char *sql_strmake_with_convert(THD *thd, const char *str, size_t arg_length,
			       CHARSET_INFO *from_cs,
			       size_t max_res_length,
			       CHARSET_INFO *to_cs, size_t *result_length);

#endif /* THR_MALLOC_INCLUDED */
server/private/innodb_priv.h000064400000002447150400263720012214 0ustar00/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef INNODB_PRIV_INCLUDED
#define INNODB_PRIV_INCLUDED

/** @file Declaring server-internal functions that are used by InnoDB. */

#include <sql_priv.h>
#include <strfunc.h>                            /* strconvert */

class THD;

int get_quote_char_for_identifier(THD *thd, const char *name, size_t length);
bool schema_table_store_record(THD *thd, TABLE *table);
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);

void sql_print_error(const char *format, ...);

#define thd_binlog_pos(X, Y, Z) mysql_bin_log_commit_pos(X, Z, Y)

#endif /* INNODB_PRIV_INCLUDED */
server/private/derived_handler.h000064400000004513150400263720013016 0ustar00/*
   Copyright (c) 2016, 2017 MariaDB

   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-1301  USA */

#ifndef DERIVED_HANDLER_INCLUDED
#define DERIVED_HANDLER_INCLUDED

#include "mariadb.h"
#include "sql_priv.h"

class TMP_TABLE_PARAM;

typedef class st_select_lex_unit SELECT_LEX_UNIT;

/**
  @class derived_handler

  This interface class is to be used for execution of queries that specify
  derived table by foreign engines
*/

class derived_handler
{
public:
  THD *thd;
  handlerton *ht;

  TABLE_LIST *derived;

  /*
    Temporary table where all results should be stored in record[0]
    The table has a field for every item from the select list of
    the specification of derived.
  */
  TABLE *table;

  /* The parameters if the temporary table used at its creation */
  TMP_TABLE_PARAM *tmp_table_param;

  SELECT_LEX_UNIT *unit;   // Specifies the derived table

  SELECT_LEX *select;      // The first select of the specification

  derived_handler(THD *thd_arg, handlerton *ht_arg)
    : thd(thd_arg), ht(ht_arg), derived(0),table(0), tmp_table_param(0),
    unit(0), select(0) {}
  virtual ~derived_handler() = default;

  /*
    Functions to scan data. All these returns 0 if ok, error code in case
    of error
  */

  /* Initialize the process of producing rows of the derived table */
  virtual int init_scan()= 0;

  /*
    Put the next produced row of the derived in table->record[0] and return 0.
    Return HA_ERR_END_OF_FILE if there are no more rows, return other error
    number in case of fatal error.
   */
  virtual int next_row()= 0;

  /* End prodicing rows */
  virtual int end_scan()=0;

  /* Report errors */
  virtual void print_error(int error, myf errflag);

  void set_derived(TABLE_LIST *tbl);
};

#endif /* DERIVED_HANDLER_INCLUDED */
server/private/authors.h000064400000023635150400263720011372 0ustar00#ifndef AUTHORS_INCLUDED
#define AUTHORS_INCLUDED

/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.

   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 */

/* Structure of the name list */

struct show_table_authors_st {
  const char *name;
  const char *location;
  const char *comment;
};

/*
  Output from "SHOW AUTHORS"

  If you can update it, you get to be in it :)

  Don't be offended if your name is not in here, just add it!

  Active people in the MariaDB are listed first, active people in MySQL
  then, not active last.

  Names should be encoded using UTF-8.

  See also https://mariadb.com/kb/en/log-of-mariadb-contributions/
*/

struct show_table_authors_st show_table_authors[]= {
  /* Active people on MariaDB */
  { "Michael (Monty) Widenius", "Tusby, Finland",
    "Lead developer and main author" },
  { "Sergei Golubchik", "Kerpen, Germany",
    "Architect, Full-text search, precision math, plugin framework, merges etc" },
  { "Igor Babaev", "Bellevue, USA", "Optimizer, keycache, core work"},
  { "Sergey Petrunia", "St. Petersburg, Russia", "Optimizer"},
  { "Oleksandr Byelkin", "Lugansk, Ukraine",
    "Query Cache (4.0), Subqueries (4.1), Views (5.0)" },
  { "Timour Katchaounov", "Sofia , Bulgaria", "Optimizer"},
  { "Kristian Nielsen", "Copenhagen, Denmark",
    "Replication, Async client prototocol, General buildbot stuff" },
  { "Alexander (Bar) Barkov", "Izhevsk, Russia",
    "Unicode and character sets" },
  { "Alexey Botchkov (Holyfoot)", "Izhevsk, Russia",
    "GIS extensions, embedded server, precision math"},
  { "Daniel Bartholomew", "Raleigh, USA", "MariaDB documentation, Buildbot, releases"},
  { "Colin Charles", "Selangor, Malesia", "MariaDB documentation, talks at a LOT of conferences"},
  { "Sergey Vojtovich", "Izhevsk, Russia",
    "initial implementation of plugin architecture, maintained native storage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache"},
  { "Vladislav Vaintroub", "Mannheim, Germany", "MariaDB Java connector, new thread pool, Windows optimizations"},
  { "Elena Stepanova", "Sankt Petersburg, Russia", "QA, test cases"},
  { "Georg Richter", "Heidelberg, Germany", "New LGPL C connector, PHP connector"},
  { "Jan Lindström", "Ylämylly, Finland", "Working on InnoDB"},
  { "Lixun Peng", "Hangzhou, China", "Multi Source replication" },
  { "Olivier Bertrand", "Paris, France", "CONNECT storage engine"},
  { "Kentoku Shiba", "Tokyo, Japan", "Spider storage engine, metadata_lock_info Information schema"},
  { "Percona", "CA, USA", "XtraDB, microslow patches, extensions to slow log"},
  { "Vicentiu Ciorbaru", "Bucharest, Romania", "Roles"},
  { "Sudheera Palihakkara", "", "PCRE Regular Expressions" },
  { "Pavel Ivanov", "USA", "Some patches and bug fixes"},
  { "Konstantin Osipov", "Moscow, Russia",
    "Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0)" },
  { "Ian Gilfillan", "South Africa", "MariaDB documentation"},
  { "Federico Razolli", "Italy", "MariaDB documentation Italian translation"},
  { "Vinchen", "Shenzhen, China", "Instant ADD Column for InnoDB, Spider engine optimization, from Tencent Game DBA Team" },
  { "Willhan", "Shenzhen, China", "Big Column Compression, Spider engine optimization, from Tencent Game DBA Team" },
  { "Anders Karlsson", "Ystad, Sweden", "Replication patch for enforcing triggers on slave"},
  { "Otto Kekäläinen", "Tampere, Finland", "Debian packaging, install/upgrade engineering, QA pipelines, documentation"},
  { "Daniel Black", "Canberra, Australia", "Modernising large page support, systemd, and bug fixes"},

  /* People working on MySQL code base (not NDB) */
  { "Guilhem Bichot", "Bordeaux, France", "Replication (since 4.0)" },
  { "Andrei Elkin", "Espoo, Finland", "Replication" },
  { "Dmitri Lenev", "Moscow, Russia",
    "Time zones support (4.1), Triggers (5.0)" },
  { "Marc Alff", "Denver, CO, USA", "Signal, Resignal, Performance schema" },
  { "Mikael Ronström", "Stockholm, Sweden",
    "NDB Cluster, Partitioning, online alter table" },
  { "Ingo Strüwing", "Berlin, Germany",
    "Bug fixing in MyISAM, Merge tables etc" },
  {"Marko Mäkelä", "Helsinki, Finland", "InnoDB core developer"},

  /* People not active anymore */
  { "David Axmark", "London, England",
    "MySQL founder; Small stuff long time ago, Monty ripped it out!" },
  { "Brian (Krow) Aker", "Seattle, WA, USA",
    "Architecture, archive, blackhole, federated, bunch of little stuff :)" },
  { "Venu Anuganti", "", "Client/server protocol (4.1)" },
  { "Omer BarNir", "Sunnyvale, CA, USA",
    "Testing (sometimes) and general QA stuff" },
  { "John Birrell", "", "Emulation of pthread_mutex() for OS/2" },
  { "Andreas F. Bobak", "", "AGGREGATE extension to user-defined functions" },
  { "Reggie Burnett", "Nashville, TN, USA", "Windows development, Connectors" },
  { "Kent Boortz", "Orebro, Sweden", "Test platform, and general build stuff" },
  { "Tim Bunce", "", "mysqlhotcopy" },
  { "Yves Carlier", "", "mysqlaccess" },
  { "Joshua Chamas", "Cupertino, CA, USA",
    "Concurrent insert, extended date syntax" },
  { "Petr Chardin", "Moscow, Russia",
    "Instance Manager (5.0), Server log tables (5.1)" },
  { "Wei-Jou Chen", "", "Chinese (Big5) character set" },
  { "Albert Chin-A-Young", "",
    "Tru64 port, large file support, better TCP wrappers support" },
  { "Jorge del Conde", "Mexico City, Mexico", "Windows development" },
  { "Antony T. Curtis", "Norwalk, CA, USA",
    "Parser, port to OS/2, storage engines and some random stuff" },
  { "Yuri Dario", "", "OS/2 port" },
  { "Patrick Galbraith", "Sharon, NH", "Federated Engine, mysqlslap" },
  { "Lenz Grimmer", "Hamburg, Germany",
    "Production (build and release) engineering" },
  { "Nikolay Grishakin", "Austin, TX, USA", "Testing - Server" },
  { "Wei He", "", "Chinese (GBK) character set" },
  { "Eric Herman", "Amsterdam, Netherlands", "Bug fixing - federated" },
  { "Andrey Hristov", "Walldorf, Germany", "Event scheduler (5.1)" },
  { "Alexander (Alexi) Ivanov", "St. Petersburg, Russia", "Replication" },
  { "Mattias Jonsson", "Uppsala, Sweden", "Partitioning" },
  { "Alexander (Salle) Keremidarski", "Sofia, Bulgaria",
    "Bug fixing" },
  { "Mats Kindahl", "Storvreta, Sweden", "Replication" },
  { "Serge Kozlov", "Velikie Luki, Russia", "Testing - Cluster" },
  { "Hakan Küçükyılmaz", "Walldorf, Germany", "Testing - Server" },
  { "Matthias Leich", "Berlin, Germany", "Testing - Server" },
  { "Arjen Lentz", "Brisbane, Australia",
    "Documentation (2001-2004), Dutch error messages, LOG2()" },
  { "Marc Liyanage", "", "Created Mac OS X packages" },
  { "Kelly Long", "Denver, CO, USA", "Pool Of Threads" },
  { "Zarko Mocnik", "", "Sorting for Slovenian language" },
  { "Per-Erik Martin", "Uppsala, Sweden", "Stored Procedures (5.0)" },
  { "Alexis Mikhailov", "", "User-defined functions" },
  { "Sinisa Milivojevic", "Larnaca, Cyprus",
    "UNION (4.0), Subqueries in FROM clause (4.1), many other features" },
  { "Jonathan (Jeb) Miller", "Kyle, TX, USA",
    "Testing - Cluster, Replication" },
  { "Elliot Murphy", "Cocoa, FL, USA", "Replication and backup" },
  { "Pekka Nouisiainen", "Stockholm, Sweden",
    "NDB Cluster: BLOB support, character set support, ordered indexes" },
  { "Alexander Nozdrin", "Moscow, Russia",
    "Bug fixing (Stored Procedures, 5.0)" },
  { "Per Eric Olsson", "", "Testing of dynamic record format" },
  { "Jonas Oreland", "Stockholm, Sweden",
    "NDB Cluster, Online Backup, lots of other things" },
  { "Alexander (Sasha) Pachev", "Provo, UT, USA",
    "Statement-based replication, SHOW CREATE TABLE, mysql-bench" },
  { "Irena Pancirov", "", "Port to Windows with Borland compiler" },
  { "Jan Pazdziora", "", "Czech sorting order" },
  { "Benjamin Pflugmann", "",
    "Extended MERGE storage engine to handle INSERT" },
  { "Igor Romanenko", "",
    "mysqldump" },
  { "Tõnu Samuel", "Estonia",
    "VIO interface, other miscellaneous features" },
  { "Carsten Segieth (Pino)", "Fredersdorf, Germany", "Testing - Server"},
  { "Martin Sköld", "Stockholm, Sweden",
    "NDB Cluster: Unique indexes, integration into MySQL" },
  { "Timothy Smith", "Auckland, New Zealand",
    "Dynamic character sets, parts of the build system, libmysqld"},
  { "Miguel Solorzano", "Florianopolis, Santa Catarina, Brazil",
    "Windows development, Windows NT service"},
  { "Punita Srivastava", "Austin, TX, USA", "Testing - Merlin"},
  { "Alexey Stroganov (Ranger)", "Lugansk, Ukraine", "Testing - Benchmarks"},
  { "Magnus Svensson", "Öregrund, Sweden",
    "NDB Cluster: Integration into MySQL, test framework" },
  { "Zeev Suraski", "", "FROM_UNIXTIME(), ENCRYPT()" },
  { "TAMITO", "",
    "The _MB character set macros and UJIS and SJIS character sets" },
  { "Jani Tolonen", "Helsinki, Finland",
    "mysqlimport, extensions to command-line clients, PROCEDURE ANALYSE()" },
  { "Lars Thalmann", "Stockholm, Sweden",
    "Replication and cluster development" },
  { "Tomas Ulin", "Stockholm, Sweden",
    "NDB Cluster: Configuration, installation" },
  { "Gianmassimo Vigazzola", "", "Initial Windows port" },
  { "Sergey Vojtovich", "Izhevsk, Russia", "Plugins infrastructure (5.1)" },
  { "Matt Wagner", "Northfield, MN, USA", "Bug fixing" },
  { "Jim Winstead Jr.", "Los Angeles, CA, USA", "Bug fixing" },
  { "Peter Zaitsev", "Tacoma, WA, USA",
    "SHA1(), AES_ENCRYPT(), AES_DECRYPT(), bug fixing" },
  {"Mark Mark Callaghan", "Texas, USA", "Statistics patches"},
  {NULL, NULL, NULL}
};

#endif /* AUTHORS_INCLUDED */
server/private/privilege.h000064400000067742150400263720011702 0ustar00#ifndef PRIVILEGE_H_INCLUDED
#define PRIVILEGE_H_INCLUDED

/* Copyright (c) 2020, 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 "my_global.h" // ulonglong


/*
  A strict enum to store privilege bits.

  We should eventually make if even stricter using "enum class privilege_t" and:
  - Replace all code pieces like `if (priv)` to `if (priv != NO_ACL)`
  - Remove "delete" comparison operators below
*/
enum privilege_t: unsigned long long
{
  NO_ACL                = (0),
  SELECT_ACL            = (1UL << 0),
  INSERT_ACL            = (1UL << 1),
  UPDATE_ACL            = (1UL << 2),
  DELETE_ACL            = (1UL << 3),
  CREATE_ACL            = (1UL << 4),
  DROP_ACL              = (1UL << 5),
  RELOAD_ACL            = (1UL << 6),
  SHUTDOWN_ACL          = (1UL << 7),
  PROCESS_ACL           = (1UL << 8),
  FILE_ACL              = (1UL << 9),
  GRANT_ACL             = (1UL << 10),
  REFERENCES_ACL        = (1UL << 11),
  INDEX_ACL             = (1UL << 12),
  ALTER_ACL             = (1UL << 13),
  SHOW_DB_ACL           = (1UL << 14),
  SUPER_ACL             = (1UL << 15),
  CREATE_TMP_ACL        = (1UL << 16),
  LOCK_TABLES_ACL       = (1UL << 17),
  EXECUTE_ACL           = (1UL << 18),
  REPL_SLAVE_ACL        = (1UL << 19),
  BINLOG_MONITOR_ACL    = (1UL << 20), // Was REPL_CLIENT_ACL prior to 10.5.2
  CREATE_VIEW_ACL       = (1UL << 21),
  SHOW_VIEW_ACL         = (1UL << 22),
  CREATE_PROC_ACL       = (1UL << 23),
  ALTER_PROC_ACL        = (1UL << 24),
  CREATE_USER_ACL       = (1UL << 25),
  EVENT_ACL             = (1UL << 26),
  TRIGGER_ACL           = (1UL << 27),
  CREATE_TABLESPACE_ACL = (1UL << 28),
  DELETE_HISTORY_ACL    = (1UL << 29),  // Added in 10.3.4
  SET_USER_ACL          = (1UL << 30),  // Added in 10.5.2
  FEDERATED_ADMIN_ACL   = (1UL << 31),  // Added in 10.5.2
  CONNECTION_ADMIN_ACL  = (1ULL << 32), // Added in 10.5.2
  READ_ONLY_ADMIN_ACL   = (1ULL << 33), // Added in 10.5.2
  REPL_SLAVE_ADMIN_ACL  = (1ULL << 34), // Added in 10.5.2
  REPL_MASTER_ADMIN_ACL = (1ULL << 35), // Added in 10.5.2
  BINLOG_ADMIN_ACL      = (1ULL << 36), // Added in 10.5.2
  BINLOG_REPLAY_ACL     = (1ULL << 37), // Added in 10.5.2
  SLAVE_MONITOR_ACL     = (1ULL << 38)  // Added in 10.5.8
  /*
    When adding new privilege bits, don't forget to update:
    In this file:
    - Add a new LAST_version_ACL
    - Add a new ALL_KNOWN_ACL_version
    - Change ALL_KNOWN_ACL to ALL_KNOWN_ACL_version
    - Change GLOBAL_ACLS if needed
    - Change SUPER_ADDED_SINCE_USER_TABLE_ACL if needed

    In other files:
    - static struct show_privileges_st sys_privileges[]
    - static const char *command_array[] and static uint command_lengths[]
    - mysql_system_tables.sql and mysql_system_tables_fix.sql
    - acl_init() or whatever - to define behaviour for old privilege tables
    - Update User_table_json::get_access()
    - sql_yacc.yy - for GRANT/REVOKE to work

    Important: the enum should contain only single-bit values.
    In this case, debuggers print bit combinations in the readable form:
     (gdb) p (privilege_t) (15)
     $8 = (SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL)

    Bit-OR combinations of the above values should be declared outside!
  */
};

constexpr static inline privilege_t ALL_KNOWN_BITS(privilege_t x)
{
  return (privilege_t)(x | (x-1));
}

// Version markers
constexpr privilege_t LAST_100304_ACL= DELETE_HISTORY_ACL;
constexpr privilege_t LAST_100502_ACL= BINLOG_REPLAY_ACL;
constexpr privilege_t LAST_100508_ACL= SLAVE_MONITOR_ACL;

// Current version markers
constexpr privilege_t LAST_CURRENT_ACL= LAST_100508_ACL;
constexpr uint PRIVILEGE_T_MAX_BIT=
              my_bit_log2_uint64((ulonglong) LAST_CURRENT_ACL);

static_assert((privilege_t)(1ULL << PRIVILEGE_T_MAX_BIT) == LAST_CURRENT_ACL,
              "Something went fatally badly: "
              "LAST_CURRENT_ACL and PRIVILEGE_T_MAX_BIT do not match");

// A combination of all bits defined in 10.3.4 (and earlier)
constexpr privilege_t ALL_KNOWN_ACL_100304 = ALL_KNOWN_BITS(LAST_100304_ACL);

// A combination of all bits defined in 10.5.2
constexpr privilege_t ALL_KNOWN_ACL_100502= ALL_KNOWN_BITS(LAST_100502_ACL);

// A combination of all bits defined in 10.5.8
constexpr privilege_t ALL_KNOWN_ACL_100508= ALL_KNOWN_BITS(LAST_100508_ACL);
// unfortunately, SLAVE_MONITOR_ACL was added in 10.5.9, but also in 10.5.8-5
// let's stay compatible with that branch too.
constexpr privilege_t ALL_KNOWN_ACL_100509= ALL_KNOWN_ACL_100508;

// A combination of all bits defined as of the current version
constexpr privilege_t ALL_KNOWN_ACL= ALL_KNOWN_BITS(LAST_CURRENT_ACL);


// Unary operators
static inline constexpr ulonglong operator~(privilege_t access)
{
  return ~static_cast<ulonglong>(access);
}

/*
  Comparison operators.
  Delete automatic conversion between to/from integer types as much as possible.
  This forces to use `(priv == NO_ACL)` instead of `(priv == 0)`.

  Note: these operators will be gone when we change privilege_t to
  "enum class privilege_t". See comments above.
*/
static inline bool operator==(privilege_t, ulonglong)= delete;
static inline bool operator==(privilege_t,     ulong)= delete;
static inline bool operator==(privilege_t,      uint)= delete;
static inline bool operator==(privilege_t,     uchar)= delete;
static inline bool operator==(privilege_t,  longlong)= delete;
static inline bool operator==(privilege_t,      long)= delete;
static inline bool operator==(privilege_t,       int)= delete;
static inline bool operator==(privilege_t,      char)= delete;
static inline bool operator==(privilege_t,      bool)= delete;

static inline bool operator==(ulonglong, privilege_t)= delete;
static inline bool operator==(ulong,     privilege_t)= delete;
static inline bool operator==(uint,      privilege_t)= delete;
static inline bool operator==(uchar,     privilege_t)= delete;
static inline bool operator==(longlong,  privilege_t)= delete;
static inline bool operator==(long,      privilege_t)= delete;
static inline bool operator==(int,       privilege_t)= delete;
static inline bool operator==(char,      privilege_t)= delete;
static inline bool operator==(bool,      privilege_t)= delete;

static inline bool operator!=(privilege_t, ulonglong)= delete;
static inline bool operator!=(privilege_t,     ulong)= delete;
static inline bool operator!=(privilege_t,      uint)= delete;
static inline bool operator!=(privilege_t,     uchar)= delete;
static inline bool operator!=(privilege_t,  longlong)= delete;
static inline bool operator!=(privilege_t,      long)= delete;
static inline bool operator!=(privilege_t,       int)= delete;
static inline bool operator!=(privilege_t,      char)= delete;
static inline bool operator!=(privilege_t,      bool)= delete;

static inline bool operator!=(ulonglong, privilege_t)= delete;
static inline bool operator!=(ulong,     privilege_t)= delete;
static inline bool operator!=(uint,      privilege_t)= delete;
static inline bool operator!=(uchar,     privilege_t)= delete;
static inline bool operator!=(longlong,  privilege_t)= delete;
static inline bool operator!=(long,      privilege_t)= delete;
static inline bool operator!=(int,       privilege_t)= delete;
static inline bool operator!=(char,      privilege_t)= delete;
static inline bool operator!=(bool,      privilege_t)= delete;


// Dyadic bitwise operators
static inline constexpr privilege_t operator&(privilege_t a, privilege_t b)
{
  return static_cast<privilege_t>(static_cast<ulonglong>(a) &
                                  static_cast<ulonglong>(b));
}

static inline constexpr privilege_t operator&(ulonglong a, privilege_t b)
{
  return static_cast<privilege_t>(a & static_cast<ulonglong>(b));
}

static inline constexpr privilege_t operator&(privilege_t a, ulonglong b)
{
  return static_cast<privilege_t>(static_cast<ulonglong>(a) & b);
}

static inline constexpr privilege_t operator|(privilege_t a, privilege_t b)
{
  return static_cast<privilege_t>(static_cast<ulonglong>(a) |
                                  static_cast<ulonglong>(b));
}


// Dyadyc bitwise assignment operators
static inline privilege_t& operator&=(privilege_t &a, privilege_t b)
{
  return a= a & b;
}

static inline privilege_t& operator&=(privilege_t &a, ulonglong b)
{
  return a= a & b;
}

static inline privilege_t& operator|=(privilege_t &a, privilege_t b)
{
  return a= a | b;
}


/*
  A combination of all SUPER privileges added since the old user table format.
  These privileges are automatically added when upgrading from the
  old format mysql.user table if a user has the SUPER privilege.
*/
constexpr privilege_t  GLOBAL_SUPER_ADDED_SINCE_USER_TABLE_ACLS=
  SET_USER_ACL |
  FEDERATED_ADMIN_ACL |
  CONNECTION_ADMIN_ACL |
  READ_ONLY_ADMIN_ACL |
  REPL_SLAVE_ADMIN_ACL |
  BINLOG_ADMIN_ACL |
  BINLOG_REPLAY_ACL;


constexpr privilege_t COL_DML_ACLS=
  SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL;

constexpr privilege_t VIEW_ACLS=
  CREATE_VIEW_ACL | SHOW_VIEW_ACL;

constexpr privilege_t STD_TABLE_DDL_ACLS=
  CREATE_ACL | DROP_ACL | ALTER_ACL;

constexpr privilege_t ALL_TABLE_DDL_ACLS=
  STD_TABLE_DDL_ACLS | INDEX_ACL;

constexpr privilege_t COL_ACLS=
  SELECT_ACL | INSERT_ACL | UPDATE_ACL | REFERENCES_ACL;

constexpr privilege_t PROC_DDL_ACLS=
  CREATE_PROC_ACL | ALTER_PROC_ACL;

constexpr privilege_t SHOW_PROC_ACLS=
  PROC_DDL_ACLS | EXECUTE_ACL;

constexpr privilege_t TABLE_ACLS=
  COL_DML_ACLS | ALL_TABLE_DDL_ACLS | VIEW_ACLS |
  GRANT_ACL | REFERENCES_ACL | 
  TRIGGER_ACL | DELETE_HISTORY_ACL;

constexpr privilege_t DB_ACLS=
   TABLE_ACLS | PROC_DDL_ACLS | EXECUTE_ACL |
   CREATE_TMP_ACL | LOCK_TABLES_ACL | EVENT_ACL;

constexpr privilege_t PROC_ACLS=
  ALTER_PROC_ACL | EXECUTE_ACL | GRANT_ACL;

constexpr privilege_t GLOBAL_ACLS=
  DB_ACLS | SHOW_DB_ACL |
  CREATE_USER_ACL | CREATE_TABLESPACE_ACL |
  SUPER_ACL | RELOAD_ACL | SHUTDOWN_ACL | PROCESS_ACL | FILE_ACL |
  REPL_SLAVE_ACL | BINLOG_MONITOR_ACL |
  GLOBAL_SUPER_ADDED_SINCE_USER_TABLE_ACLS |
  REPL_MASTER_ADMIN_ACL | SLAVE_MONITOR_ACL;

constexpr privilege_t DEFAULT_CREATE_PROC_ACLS=
  ALTER_PROC_ACL | EXECUTE_ACL;

constexpr privilege_t SHOW_CREATE_TABLE_ACLS=
  COL_DML_ACLS | ALL_TABLE_DDL_ACLS |
  TRIGGER_ACL | REFERENCES_ACL | GRANT_ACL | VIEW_ACLS;

/**
  Table-level privileges which are automatically "granted" to everyone on
  existing temporary tables (CREATE_ACL is necessary for ALTER ... RENAME).
*/
constexpr privilege_t TMP_TABLE_ACLS=
  COL_DML_ACLS | ALL_TABLE_DDL_ACLS | REFERENCES_ACL;


constexpr privilege_t PRIV_LOCK_TABLES= SELECT_ACL | LOCK_TABLES_ACL;

/*
  Allow to set an object definer:
    CREATE DEFINER=xxx {TRIGGER|VIEW|FUNCTION|PROCEDURE}
  Was SUPER prior to 10.5.2
*/
constexpr privilege_t PRIV_DEFINER_CLAUSE= SET_USER_ACL | SUPER_ACL;
/*
  If a VIEW has a `definer=invoker@host` clause and
  the specified definer does not exists, then
  - The invoker with REVEAL_MISSING_DEFINER_ACL gets:
    ERROR: The user specified as a definer ('definer1'@'localhost') doesn't exist
  - The invoker without MISSING_DEFINER_ACL gets a generic access error,
    without revealing details that the definer does not exists.

  TODO: we should eventually test the same privilege when processing
  other objects that have the DEFINER clause (e.g. routines, triggers).
  Currently the missing definer is revealed for non-privileged invokers
  in case of routines, triggers, etc.

  Was SUPER prior to 10.5.2
*/
constexpr privilege_t PRIV_REVEAL_MISSING_DEFINER= SET_USER_ACL | SUPER_ACL;

/* Actions that require only the SUPER privilege */
constexpr privilege_t PRIV_DES_DECRYPT_ONE_ARG= SUPER_ACL;
constexpr privilege_t PRIV_LOG_BIN_TRUSTED_SP_CREATOR= SUPER_ACL;
constexpr privilege_t PRIV_DEBUG= SUPER_ACL;
constexpr privilege_t PRIV_SET_GLOBAL_SYSTEM_VARIABLE= SUPER_ACL;
constexpr privilege_t PRIV_SET_RESTRICTED_SESSION_SYSTEM_VARIABLE= SUPER_ACL;

/* The following variables respected only SUPER_ACL prior to 10.5.2 */
constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_FORMAT=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_ANNOTATE_ROW_EVENTS=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_ROW_IMAGE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_VAR_SQL_LOG_BIN=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_BINLOG_CACHE_SIZE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_BINLOG_FILE_CACHE_SIZE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_BINLOG_STMT_CACHE_SIZE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_BINLOG_COMMIT_WAIT_COUNT=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_BINLOG_COMMIT_WAIT_USEC=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_BINLOG_ROW_METADATA=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_EXPIRE_LOGS_DAYS=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_LOG_BIN_COMPRESS=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_LOG_BIN_COMPRESS_MIN_LEN=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_LOG_BIN_TRUST_FUNCTION_CREATORS=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MAX_BINLOG_CACHE_SIZE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MAX_BINLOG_STMT_CACHE_SIZE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MAX_BINLOG_SIZE=
  SUPER_ACL | BINLOG_ADMIN_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SYNC_BINLOG=
  SUPER_ACL | BINLOG_ADMIN_ACL;



/* Privileges related to --read-only */
// Was super prior to 10.5.2
constexpr privilege_t PRIV_IGNORE_READ_ONLY= READ_ONLY_ADMIN_ACL | SUPER_ACL;
// Was super prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_READ_ONLY=
  READ_ONLY_ADMIN_ACL | SUPER_ACL;

/*
  Privileges related to connection handling.
*/
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_IGNORE_INIT_CONNECT= CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_IGNORE_MAX_USER_CONNECTIONS= CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_IGNORE_MAX_CONNECTIONS= CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_IGNORE_MAX_PASSWORD_ERRORS= CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_KILL_OTHER_USER_PROCESS= CONNECTION_ADMIN_ACL | SUPER_ACL;

// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_CONNECT_TIMEOUT=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_DISCONNECT_ON_EXPIRED_PASSWORD=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_EXTRA_MAX_CONNECTIONS=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_INIT_CONNECT=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MAX_CONNECTIONS=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MAX_CONNECT_ERRORS=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MAX_PASSWORD_ERRORS=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_PROXY_PROTOCOL_NETWORKS=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SECURE_AUTH=
  CONNECTION_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLOW_LAUNCH_TIME=
  CONNECTION_ADMIN_ACL | SUPER_ACL;

// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_THREAD_POOL=
  CONNECTION_ADMIN_ACL | SUPER_ACL;


/*
  Binary log related privileges that are checked regardless
  of active replication running.
*/

/*
  This command was renamed from "SHOW MASTER STATUS"
  to "SHOW BINLOG STATUS" in 10.5.2.
  Was SUPER_ACL | REPL_CLIENT_ACL prior to 10.5.2
  REPL_CLIENT_ACL was renamed to BINLOG_MONITOR_ACL.
*/
constexpr privilege_t PRIV_STMT_SHOW_BINLOG_STATUS= BINLOG_MONITOR_ACL | SUPER_ACL;

/*
  Was SUPER_ACL | REPL_CLIENT_ACL prior to 10.5.2
  REPL_CLIENT_ACL was renamed to BINLOG_MONITOR_ACL.
*/
constexpr privilege_t PRIV_STMT_SHOW_BINARY_LOGS= BINLOG_MONITOR_ACL | SUPER_ACL;

// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_PURGE_BINLOG= BINLOG_ADMIN_ACL | SUPER_ACL;

// Was REPL_SLAVE_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_SHOW_BINLOG_EVENTS= BINLOG_MONITOR_ACL;


/*
  Privileges for replication related statements and commands
  that are executed on the master.
*/
constexpr privilege_t PRIV_COM_REGISTER_SLAVE= REPL_SLAVE_ACL;
constexpr privilege_t PRIV_COM_BINLOG_DUMP= REPL_SLAVE_ACL;
// Was REPL_SLAVE_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_SHOW_SLAVE_HOSTS= REPL_MASTER_ADMIN_ACL;

/*
  Replication master related variable privileges.
  Where SUPER prior to 10.5.2
*/
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_ENABLED=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_TIMEOUT=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_TRACE_LEVEL=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_WAIT_POINT=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_MASTER_VERIFY_CHECKSUM=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_BINLOG_STATE=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SERVER_ID=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_DOMAIN_ID=
  REPL_MASTER_ADMIN_ACL | SUPER_ACL;


/* Privileges for statements that are executed on the slave */
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_START_SLAVE= REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_STOP_SLAVE= REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_CHANGE_MASTER= REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
// Was (SUPER_ACL | REPL_CLIENT_ACL) prior to 10.5.2
// Was (SUPER_ACL | REPL_SLAVE_ADMIN_ACL) from 10.5.2 to 10.5.7
constexpr privilege_t PRIV_STMT_SHOW_SLAVE_STATUS= SLAVE_MONITOR_ACL | SUPER_ACL;
// Was REPL_SLAVE_ACL prior to 10.5.2
// Was REPL_SLAVE_ADMIN_ACL from 10.5.2 to 10.5.7
constexpr privilege_t PRIV_STMT_SHOW_RELAYLOG_EVENTS= SLAVE_MONITOR_ACL;

/*
  Privileges related to binlog replying.
  Were SUPER_ACL prior to 10.5.2
*/
constexpr privilege_t PRIV_STMT_BINLOG= BINLOG_REPLAY_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_SESSION_VAR_GTID_SEQ_NO=
  BINLOG_REPLAY_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_SESSION_VAR_PSEUDO_THREAD_ID=
  BINLOG_REPLAY_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_SESSION_VAR_SERVER_ID=
  BINLOG_REPLAY_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_SESSION_VAR_GTID_DOMAIN_ID=
  BINLOG_REPLAY_ACL | SUPER_ACL;

/*
  Privileges for slave related global variables.
  Were SUPER prior to 10.5.2.
*/
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_EVENTS_MARKED_FOR_SKIP=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_DO_DB=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_DO_TABLE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_IGNORE_DB=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_IGNORE_TABLE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_WILD_DO_TABLE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_REPLICATE_WILD_IGNORE_TABLE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_READ_BINLOG_SPEED_LIMIT=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_COMPRESSED_PROTOCOL=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_DDL_EXEC_MODE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_DOMAIN_PARALLEL_THREADS=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_EXEC_MODE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_MAX_ALLOWED_PACKET=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_NET_TIMEOUT=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_PARALLEL_MAX_QUEUED=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_PARALLEL_MODE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_PARALLEL_THREADS=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_PARALLEL_WORKERS=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_RUN_TRIGGERS_FOR_RBR=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_SQL_VERIFY_CHECKSUM=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_TRANSACTION_RETRY_INTERVAL=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_TYPE_CONVERSIONS=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_INIT_SLAVE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_ENABLED=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_DELAY_MASTER=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_KILL_CONN_TIMEOUT=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RELAY_LOG_PURGE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_RELAY_LOG_RECOVERY=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SYNC_MASTER_INFO=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SYNC_RELAY_LOG=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SYNC_RELAY_LOG_INFO=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;

constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_CLEANUP_BATCH_SIZE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_IGNORE_DUPLICATES=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_POS_AUTO_ENGINES=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_SLAVE_POS=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;
constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_STRICT_MODE=
  REPL_SLAVE_ADMIN_ACL | SUPER_ACL;


/* Privileges for federated database related statements */
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_CREATE_SERVER= FEDERATED_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_ALTER_SERVER= FEDERATED_ADMIN_ACL | SUPER_ACL;
// Was SUPER_ACL prior to 10.5.2
constexpr privilege_t PRIV_STMT_DROP_SERVER= FEDERATED_ADMIN_ACL | SUPER_ACL;


/* Privileges related to processes */
constexpr privilege_t PRIV_COM_PROCESS_INFO= PROCESS_ACL;
constexpr privilege_t PRIV_STMT_SHOW_EXPLAIN= PROCESS_ACL;
constexpr privilege_t PRIV_STMT_SHOW_ENGINE_STATUS= PROCESS_ACL;
constexpr privilege_t PRIV_STMT_SHOW_ENGINE_MUTEX= PROCESS_ACL;
constexpr privilege_t PRIV_STMT_SHOW_PROCESSLIST= PROCESS_ACL;


/*
  Defines to change the above bits to how things are stored in tables
  This is needed as the 'host' and 'db' table is missing a few privileges
*/

/* Privileges that need to be reallocated (in continous chunks) */
constexpr privilege_t DB_CHUNK0 (COL_DML_ACLS | CREATE_ACL | DROP_ACL);
constexpr privilege_t DB_CHUNK1 (GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL);
constexpr privilege_t DB_CHUNK2 (CREATE_TMP_ACL | LOCK_TABLES_ACL);
constexpr privilege_t DB_CHUNK3 (VIEW_ACLS | PROC_DDL_ACLS);
constexpr privilege_t DB_CHUNK4 (EXECUTE_ACL);
constexpr privilege_t DB_CHUNK5 (EVENT_ACL | TRIGGER_ACL);
constexpr privilege_t DB_CHUNK6 (DELETE_HISTORY_ACL);


static inline privilege_t fix_rights_for_db(privilege_t access)
{
  ulonglong A(access);
  return static_cast<privilege_t>
           (((A)      & DB_CHUNK0) |
            ((A << 4) & DB_CHUNK1) |
            ((A << 6) & DB_CHUNK2) |
            ((A << 9) & DB_CHUNK3) |
            ((A << 2) & DB_CHUNK4) |
            ((A << 9) & DB_CHUNK5) |
            ((A << 10) & DB_CHUNK6));
}

static inline privilege_t get_rights_for_db(privilege_t access)
{
  ulonglong A(access);
  return static_cast<privilege_t>
           ((A & DB_CHUNK0)       |
           ((A & DB_CHUNK1) >> 4) |
           ((A & DB_CHUNK2) >> 6) |
           ((A & DB_CHUNK3) >> 9) |
           ((A & DB_CHUNK4) >> 2) |
           ((A & DB_CHUNK5) >> 9) |
           ((A & DB_CHUNK6) >> 10));
}


#define TBL_CHUNK0 DB_CHUNK0
#define TBL_CHUNK1 DB_CHUNK1
#define TBL_CHUNK2 (CREATE_VIEW_ACL | SHOW_VIEW_ACL)
#define TBL_CHUNK3 TRIGGER_ACL
#define TBL_CHUNK4 (DELETE_HISTORY_ACL)


static inline privilege_t fix_rights_for_table(privilege_t access)
{
  ulonglong A(access);
  return static_cast<privilege_t>
           ((A        & TBL_CHUNK0) |
           ((A <<  4) & TBL_CHUNK1) |
           ((A << 11) & TBL_CHUNK2) |
           ((A << 15) & TBL_CHUNK3) |
           ((A << 16) & TBL_CHUNK4));
}


static inline privilege_t get_rights_for_table(privilege_t access)
{
  ulonglong A(access);
  return static_cast<privilege_t>
           ((A & TBL_CHUNK0)        |
           ((A & TBL_CHUNK1) >>  4) |
           ((A & TBL_CHUNK2) >> 11) |
           ((A & TBL_CHUNK3) >> 15) |
           ((A & TBL_CHUNK4) >> 16));
}


static inline privilege_t fix_rights_for_column(privilege_t A)
{
  const ulonglong mask(SELECT_ACL | INSERT_ACL | UPDATE_ACL);
  return (A & mask) | static_cast<privilege_t>((A & ~mask) << 8);
}


static inline privilege_t get_rights_for_column(privilege_t A)
{
  const ulonglong mask(SELECT_ACL | INSERT_ACL | UPDATE_ACL);
  return static_cast<privilege_t>((static_cast<ulonglong>(A) & mask) |
                                  (static_cast<ulonglong>(A) >> 8));
}


static inline privilege_t fix_rights_for_procedure(privilege_t access)
{
  ulonglong A(access);
  return static_cast<privilege_t>
           (((A << 18) & EXECUTE_ACL)    |
            ((A << 23) & ALTER_PROC_ACL) |
            ((A << 8) & GRANT_ACL));
}


static inline privilege_t get_rights_for_procedure(privilege_t access)
{
  ulonglong A(access);
  return static_cast<privilege_t>
           (((A & EXECUTE_ACL)    >> 18) |
            ((A & ALTER_PROC_ACL) >> 23) |
            ((A & GRANT_ACL) >> 8));
}


#endif /* PRIVILEGE_H_INCLUDED */
server/private/my_base.h000064400000065112150400263720011320 0ustar00/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 1995, 2021, 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */


/* This file includes constants used with all databases */

#ifndef _my_base_h
#define _my_base_h

#include <my_dir.h>			/* This includes types */
#include <my_sys.h>
#include <m_string.h>
#include <errno.h>

#ifndef EOVERFLOW
#define EOVERFLOW 84
#endif

#include <my_list.h>

/* The following is bits in the flag parameter to ha_open() */

#define HA_OPEN_ABORT_IF_LOCKED		0U	/* default */
#define HA_OPEN_WAIT_IF_LOCKED		1U
#define HA_OPEN_IGNORE_IF_LOCKED	2U
#define HA_OPEN_TMP_TABLE		4U	/* Table is a temp table */
#define HA_OPEN_DELAY_KEY_WRITE		8U	/* Don't update index  */
#define HA_OPEN_ABORT_IF_CRASHED	16U
#define HA_OPEN_FOR_REPAIR		32U	/* open even if crashed */
#define HA_OPEN_FROM_SQL_LAYER          64U
#define HA_OPEN_MMAP                    128U    /* open memory mapped */
#define HA_OPEN_COPY			256U    /* Open copy (for repair) */
/* Internal temp table, used for temporary results */
#define HA_OPEN_INTERNAL_TABLE          512U
#define HA_OPEN_NO_PSI_CALL             1024U   /* Don't call/connect PSI */
#define HA_OPEN_MERGE_TABLE		2048U
#define HA_OPEN_FOR_CREATE              4096U
#define HA_OPEN_FOR_DROP                (1U << 13) /* Open part of drop */
#define HA_OPEN_GLOBAL_TMP_TABLE	(1U << 14) /* TMP table used by repliction */

/*
  Allow opening even if table is incompatible as this is for ALTER TABLE which
  will fix the table structure.
*/
#define HA_OPEN_FOR_ALTER		8192U

/* Open table for FLUSH */
#define HA_OPEN_FOR_FLUSH               8192U


/* The following is parameter to ha_rkey() how to use key */

/*
  We define a complete-field prefix of a key value as a prefix where
  the last included field in the prefix contains the full field, not
  just some bytes from the start of the field. A partial-field prefix
  is allowed to contain only a few first bytes from the last included
  field.

  Below HA_READ_KEY_EXACT, ..., HA_READ_BEFORE_KEY can take a
  complete-field prefix of a key value as the search
  key. HA_READ_PREFIX and HA_READ_PREFIX_LAST could also take a
  partial-field prefix, but currently (4.0.10) they are only used with
  complete-field prefixes. MySQL uses a padding trick to implement
  LIKE 'abc%' queries.

  NOTE that in InnoDB HA_READ_PREFIX_LAST will NOT work with a
  partial-field prefix because InnoDB currently strips spaces from the
  end of varchar fields!
*/

enum ha_rkey_function {
  HA_READ_KEY_EXACT,              /* Find first record else error */
  HA_READ_KEY_OR_NEXT,            /* Record or next record */
  HA_READ_KEY_OR_PREV,            /* Record or previous */
  HA_READ_AFTER_KEY,              /* Find next rec. after key-record */
  HA_READ_BEFORE_KEY,             /* Find next rec. before key-record */
  HA_READ_PREFIX,                 /* Key which as same prefix */
  HA_READ_PREFIX_LAST,            /* Last key with the same prefix */
  HA_READ_PREFIX_LAST_OR_PREV,    /* Last or prev key with the same prefix */
  HA_READ_MBR_CONTAIN,
  HA_READ_MBR_INTERSECT,
  HA_READ_MBR_WITHIN,
  HA_READ_MBR_DISJOINT,
  HA_READ_MBR_EQUAL
};

	/* Key algorithm types */

enum ha_key_alg {
  HA_KEY_ALG_UNDEF=	0,		/* Not specified (old file) */
  HA_KEY_ALG_BTREE=	1,		/* B-tree, default one          */
  HA_KEY_ALG_RTREE=	2,		/* R-tree, for spatial searches */
  HA_KEY_ALG_HASH=	3,		/* HASH keys (HEAP tables) */
  HA_KEY_ALG_FULLTEXT=	4,		/* FULLTEXT (MyISAM tables) */
  HA_KEY_ALG_LONG_HASH= 5		/* long BLOB keys */
};

        /* Storage media types */ 

enum ha_storage_media {
  HA_SM_DEFAULT=        0,		/* Not specified (engine default) */
  HA_SM_DISK=           1,		/* DISK storage */
  HA_SM_MEMORY=         2		/* MAIN MEMORY storage */
};

	/* The following is parameter to ha_extra() */

enum ha_extra_function {
  HA_EXTRA_NORMAL=0,			/* Optimize for space (def) */
  HA_EXTRA_QUICK=1,			/* Optimize for speed */
  HA_EXTRA_NOT_USED=2,			/* Should be ignored by handler */
  HA_EXTRA_CACHE=3,			/* Cache record in HA_rrnd() */
  HA_EXTRA_NO_CACHE=4,			/* End caching of records (def) */
  HA_EXTRA_NO_READCHECK=5,		/* No readcheck on update */
  HA_EXTRA_READCHECK=6,			/* Use readcheck (def) */
  HA_EXTRA_KEYREAD=7,			/* Read only key to database */
  HA_EXTRA_NO_KEYREAD=8,		/* Normal read of records (def) */
  HA_EXTRA_NO_USER_CHANGE=9,		/* No user is allowed to write */
  HA_EXTRA_KEY_CACHE=10,
  HA_EXTRA_NO_KEY_CACHE=11,
  HA_EXTRA_WAIT_LOCK=12,		/* Wait until file is available (def) */
  HA_EXTRA_NO_WAIT_LOCK=13,		/* If file is locked, return quickly */
  HA_EXTRA_WRITE_CACHE=14,		/* Use write cache in ha_write() */
  HA_EXTRA_FLUSH_CACHE=15,		/* flush write_record_cache */
  HA_EXTRA_NO_KEYS=16,			/* Remove all update of keys */
  HA_EXTRA_KEYREAD_CHANGE_POS=17,	/* Keyread, but change pos */
					/* xxxxchk -r must be used */
  HA_EXTRA_REMEMBER_POS=18,		/* Remember pos for next/prev */
  HA_EXTRA_RESTORE_POS=19,
  HA_EXTRA_REINIT_CACHE=20,		/* init cache from current record */
  HA_EXTRA_FORCE_REOPEN=21,		/* Datafile have changed on disk */
  HA_EXTRA_FLUSH,			/* Flush tables to disk */
  HA_EXTRA_NO_ROWS,			/* Don't write rows */
  HA_EXTRA_RESET_STATE,			/* Reset positions */
  HA_EXTRA_IGNORE_DUP_KEY,		/* Dup keys don't rollback everything*/
  HA_EXTRA_NO_IGNORE_DUP_KEY,
  HA_EXTRA_PREPARE_FOR_DROP,
  HA_EXTRA_PREPARE_FOR_UPDATE,		/* Remove read cache if problems */
  HA_EXTRA_PRELOAD_BUFFER_SIZE,         /* Set buffer size for preloading */
  /*
    On-the-fly switching between unique and non-unique key inserting.
  */
  HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
  HA_EXTRA_CHANGE_KEY_TO_DUP,
  /*
    When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep 
    other fields intact. When this is off (by default) InnoDB will use memcpy
    to overwrite entire row.
  */
  HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
  HA_EXTRA_MMAP,
  /*
    Ignore if the a tuple is not found, continue processing the
    transaction and ignore that 'row'.  Needed for idempotency
    handling on the slave
  */
  HA_EXTRA_IGNORE_NO_KEY,
  HA_EXTRA_NO_IGNORE_NO_KEY,
  /*
    Mark the table as a log table. For some handlers (e.g. CSV) this results
    in a special locking for the table.
  */
  HA_EXTRA_MARK_AS_LOG_TABLE,
  /*
    Informs handler that write_row() which tries to insert new row into the
    table and encounters some already existing row with same primary/unique
    key can replace old row with new row instead of reporting error (basically
    it informs handler that we do REPLACE instead of simple INSERT).
    Off by default.
  */
  HA_EXTRA_WRITE_CAN_REPLACE,
  HA_EXTRA_WRITE_CANNOT_REPLACE,
  /*
    Inform handler that delete_row()/update_row() cannot batch deletes/updates
    and should perform them immediately. This may be needed when table has 
    AFTER DELETE/UPDATE triggers which access to subject table.
    These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
  */
  HA_EXTRA_DELETE_CANNOT_BATCH,
  HA_EXTRA_UPDATE_CANNOT_BATCH,
  /*
    Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
    executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
  */
  HA_EXTRA_INSERT_WITH_UPDATE,
  /* Inform handler that we will do a rename */
  HA_EXTRA_PREPARE_FOR_RENAME,
  /*
    Special actions for MERGE tables.
  */
  HA_EXTRA_ADD_CHILDREN_LIST,
  HA_EXTRA_ATTACH_CHILDREN,
  HA_EXTRA_IS_ATTACHED_CHILDREN,
  HA_EXTRA_DETACH_CHILDREN,
  HA_EXTRA_DETACH_CHILD,
  /* Inform handler we will force a close as part of flush */
  HA_EXTRA_PREPARE_FOR_FORCED_CLOSE,
  /* Inform handler that we will do an alter table */
  HA_EXTRA_PREPARE_FOR_ALTER_TABLE,
  /*
    Used in ha_partition::handle_ordered_index_scan() to inform engine
    that we are starting an ordered index scan. Needed by Spider
  */
  HA_EXTRA_STARTING_ORDERED_INDEX_SCAN,
  /** Start writing rows during ALTER TABLE...ALGORITHM=COPY. */
  HA_EXTRA_BEGIN_ALTER_COPY,
  /** Finish writing rows during ALTER TABLE...ALGORITHM=COPY. */
  HA_EXTRA_END_ALTER_COPY
};

/* Compatible option, to be deleted in 6.0 */
#define HA_EXTRA_PREPARE_FOR_DELETE HA_EXTRA_PREPARE_FOR_DROP

	/* The following is parameter to ha_panic() */

enum ha_panic_function {
  HA_PANIC_CLOSE,			/* Close all databases */
  HA_PANIC_WRITE,			/* Unlock and write status */
  HA_PANIC_READ				/* Lock and read keyinfo */
};

	/* The following is parameter to ha_create(); keytypes */

enum ha_base_keytype {
  HA_KEYTYPE_END=0,
  HA_KEYTYPE_TEXT=1,			/* Key is sorted as letters */
  HA_KEYTYPE_BINARY=2,			/* Key is sorted as unsigned chars */
  HA_KEYTYPE_SHORT_INT=3,
  HA_KEYTYPE_LONG_INT=4,
  HA_KEYTYPE_FLOAT=5,
  HA_KEYTYPE_DOUBLE=6,
  HA_KEYTYPE_NUM=7,			/* Not packed num with pre-space */
  HA_KEYTYPE_USHORT_INT=8,
  HA_KEYTYPE_ULONG_INT=9,
  HA_KEYTYPE_LONGLONG=10,
  HA_KEYTYPE_ULONGLONG=11,
  HA_KEYTYPE_INT24=12,
  HA_KEYTYPE_UINT24=13,
  HA_KEYTYPE_INT8=14,
  /* Varchar (0-255 bytes) with length packed with 1 byte */
  HA_KEYTYPE_VARTEXT1=15,               /* Key is sorted as letters */
  HA_KEYTYPE_VARBINARY1=16,             /* Key is sorted as unsigned chars */
  /* Varchar (0-65535 bytes) with length packed with 2 bytes */
  HA_KEYTYPE_VARTEXT2=17,		/* Key is sorted as letters */
  HA_KEYTYPE_VARBINARY2=18,		/* Key is sorted as unsigned chars */
  HA_KEYTYPE_BIT=19
};

#define HA_MAX_KEYTYPE	31		/* Must be log2-1 */

/*
  These flags kan be OR:ed to key-flag
  Note that these can only be up to 16 bits!
*/

#define HA_NOSAME		 1U	/* Set if not dupplicated records */
#define HA_PACK_KEY		 2U	/* Pack string key to previous key */
#define HA_AUTO_KEY		 16U    /* MEMORY/MyISAM/Aria internal */
#define HA_BINARY_PACK_KEY	 32U	/* Packing of all keys to prev key */
#define HA_FULLTEXT		128U    /* For full-text search */
#define HA_SPATIAL		1024U   /* For spatial search */
#define HA_NULL_ARE_EQUAL	2048U	/* NULL in key are cmp as equal */
#define HA_GENERATED_KEY	8192U	/* Automatically generated key */

        /* The combination of the above can be used for key type comparison. */
#define HA_KEYFLAG_MASK (HA_NOSAME | HA_AUTO_KEY | HA_FULLTEXT | \
                         HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY)

/*
  Key contains partial segments.

  This flag is internal to the MySQL server by design. It is not supposed
  neither to be saved in FRM-files, nor to be passed to storage engines.
  It is intended to pass information into internal static sort_keys(KEY *,
  KEY *) function.

  This flag can be calculated -- it's based on key lengths comparison.
*/
#define HA_KEY_HAS_PART_KEY_SEG 65536
/* Internal Flag Can be calculated */
#define HA_INVISIBLE_KEY 2<<18
	/* Automatic bits in key-flag */

#define HA_SPACE_PACK_USED	 4	/* Test for if SPACE_PACK used */
#define HA_VAR_LENGTH_KEY	 8
#define HA_NULL_PART_KEY	 64
#define HA_USES_COMMENT          4096
#define HA_USES_PARSER           16384  /* Fulltext index uses [pre]parser */
#define HA_USES_BLOCK_SIZE	 ((uint) 32768)
#define HA_SORT_ALLOWS_SAME      512    /* Intern bit when sorting records */

/* This flag can be used only in KEY::ext_key_flags */
#define HA_EXT_NOSAME            131072

	/* These flags can be added to key-seg-flag */

#define HA_SPACE_PACK		 1	/* Pack space in key-seg */
#define HA_PART_KEY_SEG		 4	/* Used by MySQL for part-key-cols */
#define HA_VAR_LENGTH_PART	 8
#define HA_NULL_PART		 16
#define HA_BLOB_PART		 32
#define HA_SWAP_KEY		 64
#define HA_REVERSE_SORT		 128	/* Sort key in reverse order */
#define HA_NO_SORT               256 /* do not bother sorting on this keyseg */

#define HA_BIT_PART		1024
#define HA_CAN_MEMCMP           2048 /* internal, never stored in frm */

	/* optionbits for database */
#define HA_OPTION_PACK_RECORD		1U
#define HA_OPTION_PACK_KEYS		2U
#define HA_OPTION_COMPRESS_RECORD	4U
#define HA_OPTION_LONG_BLOB_PTR		8U /* new ISAM format */
#define HA_OPTION_TMP_TABLE		16U
#define HA_OPTION_CHECKSUM		32U
#define HA_OPTION_DELAY_KEY_WRITE	64U
#define HA_OPTION_NO_PACK_KEYS		128U  /* Reserved for MySQL */
/* unused                               256 */
#define HA_OPTION_RELIES_ON_SQL_LAYER   512U
#define HA_OPTION_NULL_FIELDS		1024U
#define HA_OPTION_PAGE_CHECKSUM		2048U
/*
   STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE
   or ALTER TABLE). Table and index statistics that are collected by the
   storage engine and used by the optimizer for query optimization will be
   stored on disk and will not change after a server restart.
*/
#define HA_OPTION_STATS_PERSISTENT	4096U
/*
  STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE. Statistics
  for the table will be wiped away on server shutdown and new ones recalculated
  after the server is started again. If none of HA_OPTION_STATS_PERSISTENT or
  HA_OPTION_NO_STATS_PERSISTENT is set, this means that the setting is not
  explicitly set at table level and the corresponding table will use whatever
  is the global server default.
*/
#define HA_OPTION_NO_STATS_PERSISTENT	8192U

/* .frm has extra create options in linked-list format */
#define HA_OPTION_TEXT_CREATE_OPTIONS_legacy (1U << 14) /* 5.2 to 5.5, unused since 10.0 */
#define HA_OPTION_TEMP_COMPRESS_RECORD  (1U << 15)      /* set by isamchk */
#define HA_OPTION_READ_ONLY_DATA        (1U << 16)      /* Set by isamchk */
#define HA_OPTION_NO_CHECKSUM           (1U << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE    (1U << 18)

	/* Bits in flag to create() */

#define HA_DONT_TOUCH_DATA	1U	/* Don't empty datafile (isamchk) */
#define HA_PACK_RECORD		2U	/* Request packed record format */
#define HA_CREATE_TMP_TABLE	4U
#define HA_CREATE_CHECKSUM	8U
#define HA_CREATE_KEEP_FILES	16U     /* don't overwrite .MYD and MYI */
#define HA_CREATE_PAGE_CHECKSUM	32U
#define HA_CREATE_DELAY_KEY_WRITE 64U
#define HA_CREATE_RELIES_ON_SQL_LAYER 128U
#define HA_CREATE_INTERNAL_TABLE 256U
#define HA_PRESERVE_INSERT_ORDER 512U
#define HA_CREATE_NO_ROLLBACK    1024U
/*
  A temporary table that can be used by different threads, eg. replication
  threads. This flag ensure that memory is not allocated with THREAD_SPECIFIC,
  as we do for other temporary tables.
*/
#define HA_CREATE_GLOBAL_TMP_TABLE 2048U

/* Flags used by start_bulk_insert */

#define HA_CREATE_UNIQUE_INDEX_BY_SORT   1U


/*
  The following flags (OR-ed) are passed to handler::info() method.
  The method copies misc handler information out of the storage engine
  to data structures accessible from MySQL

  Same flags are also passed down to mi_status, myrg_status, etc.
*/

/* this one is not used */
#define HA_STATUS_POS            1U
/*
  assuming the table keeps shared actual copy of the 'info' and
  local, possibly outdated copy, the following flag means that
  it should not try to get the actual data (locking the shared structure)
  slightly outdated version will suffice
*/
#define HA_STATUS_NO_LOCK        2U
/* update the time of the last modification (in handler::update_time) */
#define HA_STATUS_TIME           4U
/*
  update the 'constant' part of the info:
  handler::max_data_file_length, max_index_file_length, create_time
  sortkey, ref_length, block_size, data_file_name, index_file_name.
  handler::table->s->keys_in_use, keys_for_keyread, rec_per_key
*/
#define HA_STATUS_CONST          8U
/*
  update the 'variable' part of the info:
  handler::records, deleted, data_file_length, index_file_length,
  check_time, mean_rec_length
*/
#define HA_STATUS_VARIABLE      16U
/*
  get the information about the key that caused last duplicate value error
  update handler::errkey and handler::dupp_ref
  see handler::get_dup_key()
*/
#define HA_STATUS_ERRKEY        32U
/*
  update handler::auto_increment_value
*/
#define HA_STATUS_AUTO          64U
/*
  Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also
  when only HA_STATUS_VARIABLE but it won't be used.
*/
#define HA_STATUS_VARIABLE_EXTRA 128U
/*
  Treat empty table as empty (ignore HA_STATUS_TIME hack).
*/
#define HA_STATUS_OPEN           256U

/*
  Errorcodes given by handler functions

  opt_sum_query() assumes these codes are > 1
  Do not add error numbers before HA_ERR_FIRST.
  If necessary to add lower numbers, change HA_ERR_FIRST accordingly.
*/
#define HA_ERR_FIRST            120     /* Copy of first error nr.*/

#define HA_ERR_KEY_NOT_FOUND	120	/* Didn't find key on read or update */
#define HA_ERR_FOUND_DUPP_KEY	121	/* Duplicate key on write */
#define HA_ERR_INTERNAL_ERROR   122     /* Internal error */
#define HA_ERR_RECORD_CHANGED	123	/* Update with is recoverable */
#define HA_ERR_WRONG_INDEX	124	/* Wrong index given to function */
#define HA_ERR_CRASHED		126	/* Indexfile is crashed */
#define HA_ERR_WRONG_IN_RECORD	127	/* Record-file is crashed */
#define HA_ERR_OUT_OF_MEM	128	/* Out of memory */
#define HA_ERR_RETRY_INIT 129 /* Initialization failed and should be retried */
#define HA_ERR_NOT_A_TABLE      130     /* not a MYI file - no signature */
#define HA_ERR_WRONG_COMMAND	131	/* Command not supported */
#define HA_ERR_OLD_FILE		132	/* old databasfile */
#define HA_ERR_NO_ACTIVE_RECORD 133	/* No record read in update() */
#define HA_ERR_RECORD_DELETED	134	/* A record is not there */
#define HA_ERR_RECORD_FILE_FULL 135	/* No more room in file */
#define HA_ERR_INDEX_FILE_FULL	136	/* No more room in file */
#define HA_ERR_END_OF_FILE	137	/* end in next/prev/first/last */
#define HA_ERR_UNSUPPORTED	138	/* unsupported extension used */
#define HA_ERR_TO_BIG_ROW	139	/* Too big row */
#define HA_WRONG_CREATE_OPTION	140	/* Wrong create option */
#define HA_ERR_FOUND_DUPP_UNIQUE 141	/* Duplicate unique on write */
#define HA_ERR_UNKNOWN_CHARSET	 142	/* Can't open charset */
#define HA_ERR_WRONG_MRG_TABLE_DEF 143  /* conflicting tables in MERGE */
#define HA_ERR_CRASHED_ON_REPAIR 144	/* Last (automatic?) repair failed */
#define HA_ERR_CRASHED_ON_USAGE  145	/* Table must be repaired */
#define HA_ERR_LOCK_WAIT_TIMEOUT 146
#define HA_ERR_LOCK_TABLE_FULL   147
#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */
#define HA_ERR_LOCK_DEADLOCK	 149
#define HA_ERR_CANNOT_ADD_FOREIGN 150    /* Cannot add a foreign key constr. */
#define HA_ERR_NO_REFERENCED_ROW 151     /* Cannot add a child row */
#define HA_ERR_ROW_IS_REFERENCED 152     /* Cannot delete a parent row */
#define HA_ERR_NO_SAVEPOINT	 153     /* No savepoint with that name */
#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */
#define HA_ERR_NO_SUCH_TABLE     155  /* The table does not exist in engine */
#define HA_ERR_TABLE_EXIST       156  /* The table existed in storage engine */
#define HA_ERR_NO_CONNECTION     157  /* Could not connect to storage engine */
/* NULLs are not supported in spatial index */
#define HA_ERR_NULL_IN_SPATIAL   158
#define HA_ERR_TABLE_DEF_CHANGED 159  /* The table changed in storage engine */
/* There's no partition in table for given value */
#define HA_ERR_NO_PARTITION_FOUND 160
#define HA_ERR_RBR_LOGGING_FAILED 161  /* Row-based binlogging of row failed */
#define HA_ERR_DROP_INDEX_FK      162  /* Index needed in foreign key constr */
/*
  Upholding foreign key constraints would lead to a duplicate key error
  in some other table.
*/
#define HA_ERR_FOREIGN_DUPLICATE_KEY 163
/* The table changed in storage engine */
#define HA_ERR_TABLE_NEEDS_UPGRADE 164
#define HA_ERR_TABLE_READONLY      165   /* The table is not writable */

#define HA_ERR_AUTOINC_READ_FAILED 166   /* Failed to get next autoinc value */
#define HA_ERR_AUTOINC_ERANGE    167     /* Failed to set row autoinc value */
#define HA_ERR_GENERIC           168     /* Generic error */
/* row not actually updated: new values same as the old values */
#define HA_ERR_RECORD_IS_THE_SAME 169
#define HA_ERR_LOGGING_IMPOSSIBLE 170    /* It is not possible to log this
                                            statement */
#define HA_ERR_CORRUPT_EVENT      171	 /* The event was corrupt, leading to
                                            illegal data being read */
#define HA_ERR_NEW_FILE	          172	 /* New file format */
#define HA_ERR_ROWS_EVENT_APPLY   173    /* The event could not be processed
                                            no other handler error happened */
#define HA_ERR_INITIALIZATION     174    /* Error during initialization */
#define HA_ERR_FILE_TOO_SHORT	  175	 /* File too short */
#define HA_ERR_WRONG_CRC	  176	 /* Wrong CRC on page */
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
/* There's no explicitly listed partition in table for the given value */
#define HA_ERR_NOT_IN_LOCK_PARTITIONS 178
#define HA_ERR_INDEX_COL_TOO_LONG 179    /* Index column length exceeds limit */
#define HA_ERR_INDEX_CORRUPT      180    /* Index corrupted */
#define HA_ERR_UNDO_REC_TOO_BIG   181    /* Undo log record too big */
#define HA_FTS_INVALID_DOCID      182	 /* Invalid InnoDB Doc ID */
/* #define HA_ERR_TABLE_IN_FK_CHECK  183 */ /* Table being used in foreign key check */
#define HA_ERR_TABLESPACE_EXISTS  184    /* The tablespace existed in storage engine */
#define HA_ERR_TOO_MANY_FIELDS    185    /* Table has too many columns */
#define HA_ERR_ROW_IN_WRONG_PARTITION 186 /* Row in wrong partition */
#define HA_ERR_ROW_NOT_VISIBLE    187
#define HA_ERR_ABORTED_BY_USER    188
#define HA_ERR_DISK_FULL          189
#define HA_ERR_INCOMPATIBLE_DEFINITION 190
#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191 /* Too many words in a phrase */
#define HA_ERR_DECRYPTION_FAILED  192 /* Table encrypted but decrypt failed */
#define HA_ERR_FK_DEPTH_EXCEEDED  193 /* FK cascade depth exceeded */
#define HA_ERR_TABLESPACE_MISSING 194  /* Missing Tablespace */
#define HA_ERR_SEQUENCE_INVALID_DATA 195
#define HA_ERR_SEQUENCE_RUN_OUT   196
#define HA_ERR_COMMIT_ERROR       197
#define HA_ERR_PARTITION_LIST     198
#define HA_ERR_NO_ENCRYPTION      199
#define HA_ERR_ROLLBACK           200  /* Automatic rollback done */
#define HA_ERR_LAST               200  /* Copy of last error nr * */

/* Number of different errors */
#define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)

/* aliases */
#define HA_ERR_TABLE_CORRUPT HA_ERR_WRONG_IN_RECORD
#define HA_ERR_QUERY_INTERRUPTED HA_ERR_ABORTED_BY_USER
#define HA_ERR_NOT_ALLOWED_COMMAND HA_ERR_WRONG_COMMAND

	/* Other constants */

#define HA_NAMELEN 64			/* Max length of saved filename */
#define NO_SUCH_KEY (~(uint)0)          /* used as a key no. */

typedef ulong key_part_map;
#define HA_WHOLE_KEY  (~(key_part_map)0)

	/* Intern constants in databases */

	/* bits in _search */
#define SEARCH_FIND	1U
#define SEARCH_NO_FIND	2U
#define SEARCH_SAME	4U
#define SEARCH_BIGGER	8U
#define SEARCH_SMALLER	16U
#define SEARCH_SAVE_BUFF	32U
#define SEARCH_UPDATE	64U
#define SEARCH_PREFIX	128U
#define SEARCH_LAST	256U
#define MBR_CONTAIN     512U
#define MBR_INTERSECT   1024U
#define MBR_WITHIN      2048U
#define MBR_DISJOINT    4096U
#define MBR_EQUAL       8192U
#define MBR_DATA        16384U
#define SEARCH_NULL_ARE_EQUAL 32768U	/* NULL in keys are equal */
#define SEARCH_NULL_ARE_NOT_EQUAL 65536U/* NULL in keys are not equal */
/* Use this when inserting a key in position order */
#define SEARCH_INSERT   (SEARCH_NULL_ARE_NOT_EQUAL*2)
/* Only part of the key is specified while reading */
#define SEARCH_PART_KEY (SEARCH_INSERT*2)
/* Used when user key (key 2) contains transaction id's */
#define SEARCH_USER_KEY_HAS_TRANSID (SEARCH_PART_KEY*2)
/* Used when page key (key 1) contains transaction id's */
#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2)

	/* bits in opt_flag */
#define QUICK_USED	1U
#define READ_CACHE_USED	2U
#define READ_CHECK_USED 4U
#define KEY_READ_USED	8U
#define WRITE_CACHE_USED 16U
#define OPT_NO_ROWS	32U

	/* bits in update */
#define HA_STATE_CHANGED	1U	/* Database has changed */
#define HA_STATE_AKTIV		2U	/* Has a current record */
#define HA_STATE_WRITTEN	4U	/* Record is written */
#define HA_STATE_DELETED	8U
#define HA_STATE_NEXT_FOUND	16U	/* Next found record (record before) */
#define HA_STATE_PREV_FOUND	32U	/* Prev found record (record after) */
#define HA_STATE_NO_KEY		64U	/* Last read didn't find record */
#define HA_STATE_KEY_CHANGED	128U
#define HA_STATE_WRITE_AT_END	256U	/* set in _ps_find_writepos */
#define HA_STATE_BUFF_SAVED	512U	/* If current keybuff is info->buff */
#define HA_STATE_ROW_CHANGED	1024U	/* To invalidate ROW cache */
#define HA_STATE_EXTEND_BLOCK	2048U
#define HA_STATE_RNEXT_SAME	4096U	/* rnext_same occupied lastkey2 */

/* myisampack expects no more than 32 field types. */
enum en_fieldtype {
  FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
  FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO,
  FIELD_VARCHAR,FIELD_CHECK,
  FIELD_enum_val_count
};

enum data_file_type {
  STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD, NO_RECORD
};

/* For key ranges */

#define NO_MIN_RANGE	1U
#define NO_MAX_RANGE	2U
#define NEAR_MIN	4U
#define NEAR_MAX	8U
#define UNIQUE_RANGE	16U
#define EQ_RANGE	32U
#define NULL_RANGE	64U
#define GEOM_FLAG      128U

typedef struct st_key_range
{
  const uchar *key;
  uint length;
  key_part_map keypart_map;
  enum ha_rkey_function flag;
} key_range;

typedef void *range_id_t;

typedef struct st_key_multi_range
{
  key_range start_key;
  key_range end_key;
  range_id_t ptr;                 /* Free to use by caller (ptr to row etc) */
  /*
    A set of range flags that describe both endpoints: UNIQUE_RANGE,
    NULL_RANGE, EQ_RANGE, GEOM_FLAG.
    (Flags that describe one endpoint, NO_{MIN|MAX}_RANGE, NEAR_{MIN|MAX} will
     not be set here)
  */
  uint  range_flag;
} KEY_MULTI_RANGE;


/* Store first and last leaf page accessed by records_in_range */

typedef struct st_page_range
{
  ulonglong first_page;
  ulonglong last_page;
} page_range;

#define UNUSED_PAGE_NO ULONGLONG_MAX
#define unused_page_range { UNUSED_PAGE_NO, UNUSED_PAGE_NO }

/* For number of records */
#ifdef BIG_TABLES
#define rows2double(A)	ulonglong2double(A)
typedef my_off_t	ha_rows;
#else
#define rows2double(A)	(double) (A)
typedef ulong		ha_rows;
#endif

#define HA_POS_ERROR	(~ (ha_rows) 0)
#define HA_OFFSET_ERROR	(~ (my_off_t) 0)
#define HA_ROWS_MAX        HA_POS_ERROR

#if SIZEOF_OFF_T == 4
#define MAX_FILE_SIZE	INT_MAX32
#else
#define MAX_FILE_SIZE	LONGLONG_MAX
#endif

#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)

/* invalidator function reference for Query Cache */
C_MODE_START
typedef void (* invalidator_by_filename)(const char * filename);
C_MODE_END

#endif /* _my_base_h */
server/private/tzfile.h000064400000011626150400263720011177 0ustar00#ifndef TZFILE_INCLUDED
#define TZFILE_INCLUDED

/* Copyright (c) 2004, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

/* 
   This file is based on public domain code from ftp://elsie.ncih.nist.gov/
   Initial source code is in the public domain, so clarified as of
   1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). 
*/

/*
  Information about time zone files.
*/

#ifndef TZDIR
#define TZDIR	"/usr/share/zoneinfo" /* Time zone object file directory */
#endif /* !defined TZDIR */

/*
  Each file begins with. . .
*/

#define	TZ_MAGIC	"TZif"

struct tzhead {
 	uchar	tzh_magic[4];		/* TZ_MAGIC */
	uchar	tzh_reserved[16];	/* reserved for future use */
	uchar	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags */
	uchar	tzh_ttisstdcnt[4];	/* coded number of trans. time flags */
	uchar	tzh_leapcnt[4];		/* coded number of leap seconds */
	uchar	tzh_timecnt[4];		/* coded number of transition times */
	uchar	tzh_typecnt[4];		/* coded number of local time types */
	uchar	tzh_charcnt[4];		/* coded number of abbr. chars */
};

/*
  . . .followed by. . .
  
  tzh_timecnt (char [4])s               coded transition times a la time(2)
  tzh_timecnt (unsigned char)s          types of local time starting at above
  tzh_typecnt repetitions of
    one (char [4])                      coded UTC offset in seconds
    one (unsigned char)                 used to set tm_isdst
    one (unsigned char)                 that's an abbreviation list index
  tzh_charcnt (char)s                   '\0'-terminated zone abbreviations
  tzh_leapcnt repetitions of
    one (char [4])                      coded leap second transition times
    one (char [4])                      total correction after above
  tzh_ttisstdcnt (char)s                indexed by type; if TRUE, transition
                                        time is standard time, if FALSE,
                                        transition time is wall clock time
                                        if absent, transition times are
                                        assumed to be wall clock time
  tzh_ttisgmtcnt (char)s                indexed by type; if TRUE, transition
                                        time is UTC, if FALSE,
                                        transition time is local time
                                        if absent, transition times are
                                        assumed to be local time
*/

/*
  In the current implementation, we refuse to deal with files that
  exceed any of the limits below.
*/

#ifndef TZ_MAX_TIMES
/*
  The TZ_MAX_TIMES value below is enough to handle a bit more than a
  year's worth of solar time (corrected daily to the nearest second) or
  138 years of Pacific Presidential Election time
  (where there are three time zone transitions every fourth year).
*/
#define TZ_MAX_TIMES	370
#endif /* !defined TZ_MAX_TIMES */

#ifndef TZ_MAX_TYPES
#ifdef SOLAR
#define TZ_MAX_TYPES	256 /* Limited by what (unsigned char)'s can hold */
#else
/*
  Must be at least 14 for Europe/Riga as of Jan 12 1995,
  as noted by Earl Chew <earl@hpato.aus.hp.com>.
*/
#define TZ_MAX_TYPES	20	/* Maximum number of local time types */
#endif /* defined SOLAR */
#endif /* !defined TZ_MAX_TYPES */

#ifndef TZ_MAX_CHARS
#define TZ_MAX_CHARS	50	/* Maximum number of abbreviation characters */
				/* (limited by what unsigned chars can hold) */
#endif /* !defined TZ_MAX_CHARS */

#ifndef TZ_MAX_LEAPS
#define TZ_MAX_LEAPS	50	/* Maximum number of leap second corrections */
#endif /* !defined TZ_MAX_LEAPS */

#ifndef TZ_MAX_REV_RANGES
#ifdef SOLAR
/* Solar (Asia/RiyadhXX) zones need significantly bigger TZ_MAX_REV_RANGES */
#define TZ_MAX_REV_RANGES (TZ_MAX_TIMES*2+TZ_MAX_LEAPS*2+2)
#else
#define TZ_MAX_REV_RANGES (TZ_MAX_TIMES+TZ_MAX_LEAPS+2)
#endif
#endif

#define SECS_PER_MIN	60
#define MINS_PER_HOUR	60
#define HOURS_PER_DAY	24
#define DAYS_PER_WEEK	7
#define DAYS_PER_NYEAR	365
#define DAYS_PER_LYEAR	366
#define SECS_PER_HOUR	(SECS_PER_MIN * MINS_PER_HOUR)
#define SECS_PER_DAY	((long) SECS_PER_HOUR * HOURS_PER_DAY)
#define MONS_PER_YEAR	12

#define TM_YEAR_BASE	1900

#define EPOCH_YEAR	1970

/*
  Accurate only for the past couple of centuries,
  that will probably do.
*/

#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))

#endif
server/private/mdl.h000064400000113104150400263720010450 0ustar00#ifndef MDL_H
#define MDL_H
/* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2020, 2021, MariaDB

   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,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#include "sql_plist.h"
#include "ilist.h"
#include <my_sys.h>
#include <m_string.h>
#include <mysql_com.h>
#include <lf.h>

class THD;

class MDL_context;
class MDL_lock;
class MDL_ticket;
bool  ok_for_lower_case_names(const char *name);

typedef unsigned short mdl_bitmap_t;
#define MDL_BIT(A) static_cast<mdl_bitmap_t>(1U << A)


/**
  @def ENTER_COND(C, M, S, O)
  Start a wait on a condition.
  @param C the condition to wait on
  @param M the associated mutex
  @param S the new stage to enter
  @param O the previous stage
  @sa EXIT_COND().
*/
#define ENTER_COND(C, M, S, O) enter_cond(C, M, S, O, __func__, __FILE__, __LINE__)

/**
  @def EXIT_COND(S)
  End a wait on a condition
  @param S the new stage to enter
*/
#define EXIT_COND(S) exit_cond(S, __func__, __FILE__, __LINE__)

/**
   An interface to separate the MDL module from the THD, and the rest of the
   server code.
 */

class MDL_context_owner
{
public:
  virtual ~MDL_context_owner() = default;

  /**
    Enter a condition wait.
    For @c enter_cond() / @c exit_cond() to work the mutex must be held before
    @c enter_cond(); this mutex is then released by @c exit_cond().
    Usage must be: lock mutex; enter_cond(); your code; exit_cond().
    @param cond the condition to wait on
    @param mutex the associated mutex
    @param [in] stage the stage to enter, or NULL
    @param [out] old_stage the previous stage, or NULL
    @param src_function function name of the caller
    @param src_file file name of the caller
    @param src_line line number of the caller
    @sa ENTER_COND(), THD::enter_cond()
    @sa EXIT_COND(), THD::exit_cond()
  */
  virtual void enter_cond(mysql_cond_t *cond, mysql_mutex_t *mutex,
                          const PSI_stage_info *stage, PSI_stage_info *old_stage,
                          const char *src_function, const char *src_file,
                          int src_line) = 0;

  /**
    @def EXIT_COND(S)
    End a wait on a condition
    @param [in] stage the new stage to enter
    @param src_function function name of the caller
    @param src_file file name of the caller
    @param src_line line number of the caller
    @sa ENTER_COND(), THD::enter_cond()
    @sa EXIT_COND(), THD::exit_cond()
  */
  virtual void exit_cond(const PSI_stage_info *stage,
                         const char *src_function, const char *src_file,
                         int src_line) = 0;
  /**
     Has the owner thread been killed?
   */
  virtual int  is_killed() = 0;

  /**
     This one is only used for DEBUG_SYNC.
     (Do not use it to peek/poke into other parts of THD.)
   */
  virtual THD* get_thd() = 0;

  /**
     @see THD::notify_shared_lock()
   */
  virtual bool notify_shared_lock(MDL_context_owner *in_use,
                                  bool needs_thr_lock_abort) = 0;
};

/**
  Type of metadata lock request.

  @sa Comments for MDL_object_lock::can_grant_lock() and
      MDL_scoped_lock::can_grant_lock() for details.

  Scoped locks are database (or schema) locks.
  The object locks are for tables, triggers etc.
*/

enum enum_mdl_type {
  /* This means that the MDL_request is not initialized */
  MDL_NOT_INITIALIZED= -1,
  /*
    An intention exclusive metadata lock (IX). Used only for scoped locks.
    Owner of this type of lock can acquire upgradable exclusive locks on
    individual objects.
    Compatible with other IX locks, but is incompatible with scoped S and
    X locks.
    IX lock is taken in SCHEMA namespace when we intend to modify
    object metadata. Object may refer table, stored procedure, trigger,
    view/etc.
  */
  MDL_INTENTION_EXCLUSIVE= 0,
  /*
    A shared metadata lock (S).
    To be used in cases when we are interested in object metadata only
    and there is no intention to access object data (e.g. for stored
    routines or during preparing prepared statements).
    We also mis-use this type of lock for open HANDLERs, since lock
    acquired by this statement has to be compatible with lock acquired
    by LOCK TABLES ... WRITE statement, i.e. SNRW (We can't get by by
    acquiring S lock at HANDLER ... OPEN time and upgrading it to SR
    lock for HANDLER ... READ as it doesn't solve problem with need
    to abort DML statements which wait on table level lock while having
    open HANDLER in the same connection).
    To avoid deadlock which may occur when SNRW lock is being upgraded to
    X lock for table on which there is an active S lock which is owned by
    thread which waits in its turn for table-level lock owned by thread
    performing upgrade we have to use thr_abort_locks_for_thread()
    facility in such situation.
    This problem does not arise for locks on stored routines as we don't
    use SNRW locks for them. It also does not arise when S locks are used
    during PREPARE calls as table-level locks are not acquired in this
    case.
    This lock is taken for global read lock, when caching a stored
    procedure in memory for the duration of the transaction and for
    tables used by prepared statements.
  */
  MDL_SHARED,
  /*
    A high priority shared metadata lock.
    Used for cases when there is no intention to access object data (i.e.
    data in the table).
    "High priority" means that, unlike other shared locks, it is granted
    ignoring pending requests for exclusive locks. Intended for use in
    cases when we only need to access metadata and not data, e.g. when
    filling an INFORMATION_SCHEMA table.
    Since SH lock is compatible with SNRW lock, the connection that
    holds SH lock lock should not try to acquire any kind of table-level
    or row-level lock, as this can lead to a deadlock. Moreover, after
    acquiring SH lock, the connection should not wait for any other
    resource, as it might cause starvation for X locks and a potential
    deadlock during upgrade of SNW or SNRW to X lock (e.g. if the
    upgrading connection holds the resource that is being waited for).
  */
  MDL_SHARED_HIGH_PRIO,
  /*
    A shared metadata lock (SR) for cases when there is an intention to read
    data from table.
    A connection holding this kind of lock can read table metadata and read
    table data (after acquiring appropriate table and row-level locks).
    This means that one can only acquire TL_READ, TL_READ_NO_INSERT, and
    similar table-level locks on table if one holds SR MDL lock on it.
    To be used for tables in SELECTs, subqueries, and LOCK TABLE ...  READ
    statements.
  */
  MDL_SHARED_READ,
  /*
    A shared metadata lock (SW) for cases when there is an intention to modify
    (and not just read) data in the table.
    A connection holding SW lock can read table metadata and modify or read
    table data (after acquiring appropriate table and row-level locks).
    To be used for tables to be modified by INSERT, UPDATE, DELETE
    statements, but not LOCK TABLE ... WRITE or DDL). Also taken by
    SELECT ... FOR UPDATE.
  */
  MDL_SHARED_WRITE,
  /*
    An upgradable shared metadata lock for cases when there is an
    intention to modify (and not just read) data in the table.
    Can be upgraded to MDL_SHARED_NO_WRITE and MDL_EXCLUSIVE.
    A connection holding SU lock can read table metadata and modify or read
    table data (after acquiring appropriate table and row-level locks).
    To be used for the first phase of ALTER TABLE.
  */
  MDL_SHARED_UPGRADABLE,
  /*
    A shared metadata lock for cases when we need to read data from table
    and block all concurrent modifications to it (for both data and metadata).
    Used by LOCK TABLES READ statement.
  */
  MDL_SHARED_READ_ONLY,
  /*
    An upgradable shared metadata lock which blocks all attempts to update
    table data, allowing reads.
    A connection holding this kind of lock can read table metadata and read
    table data.
    Can be upgraded to X metadata lock.
    Note, that since this type of lock is not compatible with SNRW or SW
    lock types, acquiring appropriate engine-level locks for reading
    (TL_READ* for MyISAM, shared row locks in InnoDB) should be
    contention-free.
    To be used for the first phase of ALTER TABLE, when copying data between
    tables, to allow concurrent SELECTs from the table, but not UPDATEs.
  */
  MDL_SHARED_NO_WRITE,
  /*
    An upgradable shared metadata lock which allows other connections
    to access table metadata, but not data.
    It blocks all attempts to read or update table data, while allowing
    INFORMATION_SCHEMA and SHOW queries.
    A connection holding this kind of lock can read table metadata modify and
    read table data.
    Can be upgraded to X metadata lock.
    To be used for LOCK TABLES WRITE statement.
    Not compatible with any other lock type except S and SH.
  */
  MDL_SHARED_NO_READ_WRITE,
  /*
    An exclusive metadata lock (X).
    A connection holding this lock can modify both table's metadata and data.
    No other type of metadata lock can be granted while this lock is held.
    To be used for CREATE/DROP/RENAME TABLE statements and for execution of
    certain phases of other DDL statements.
  */
  MDL_EXCLUSIVE,
  /* This should be the last !!! */
  MDL_TYPE_END
};


/** Backup locks */

/**
  Block concurrent backup
*/
#define MDL_BACKUP_START enum_mdl_type(0)
/**
   Block new write requests to non transactional tables
*/
#define MDL_BACKUP_FLUSH enum_mdl_type(1)
/**
   In addition to previous locks, blocks running requests to non trans tables
   Used to wait until all DML usage of on trans tables are finished
*/
#define MDL_BACKUP_WAIT_FLUSH enum_mdl_type(2)
/**
   In addition to previous locks, blocks new DDL's from starting
*/
#define MDL_BACKUP_WAIT_DDL enum_mdl_type(3)
/**
   In addition to previous locks, blocks commits
*/
#define MDL_BACKUP_WAIT_COMMIT enum_mdl_type(4)

/**
  Blocks (or is blocked by) statements that intend to modify data. Acquired
  before commit lock by FLUSH TABLES WITH READ LOCK.
*/
#define MDL_BACKUP_FTWRL1 enum_mdl_type(5)

/**
  Blocks (or is blocked by) commits. Acquired after global read lock by
  FLUSH TABLES WITH READ LOCK.
*/
#define MDL_BACKUP_FTWRL2 enum_mdl_type(6)

#define MDL_BACKUP_DML enum_mdl_type(7)
#define MDL_BACKUP_TRANS_DML enum_mdl_type(8)
#define MDL_BACKUP_SYS_DML enum_mdl_type(9)

/**
  Must be acquired by DDL statements that intend to modify data.
  Currently it's also used for LOCK TABLES.
*/
#define MDL_BACKUP_DDL enum_mdl_type(10)

/**
   Blocks new DDL's. Used by backup code to enable DDL logging
*/
#define MDL_BACKUP_BLOCK_DDL enum_mdl_type(11)

/*
  Statement is modifying data, but will not block MDL_BACKUP_DDL or earlier
  BACKUP stages.
  ALTER TABLE is started with MDL_BACKUP_DDL, but changed to
  MDL_BACKUP_ALTER_COPY while alter table is copying or modifing data.
*/

#define MDL_BACKUP_ALTER_COPY enum_mdl_type(12)

/**
  Must be acquired during commit.
*/
#define MDL_BACKUP_COMMIT enum_mdl_type(13)
#define MDL_BACKUP_END enum_mdl_type(14)


/** Duration of metadata lock. */

enum enum_mdl_duration {
  /**
    Locks with statement duration are automatically released at the end
    of statement or transaction.
  */
  MDL_STATEMENT= 0,
  /**
    Locks with transaction duration are automatically released at the end
    of transaction.
  */
  MDL_TRANSACTION,
  /**
    Locks with explicit duration survive the end of statement and transaction.
    They have to be released explicitly by calling MDL_context::release_lock().
  */
  MDL_EXPLICIT,
  /* This should be the last ! */
  MDL_DURATION_END };


/** Maximal length of key for metadata locking subsystem. */
#define MAX_MDLKEY_LENGTH (1 + NAME_LEN + 1 + NAME_LEN + 1)


/**
  Metadata lock object key.

  A lock is requested or granted based on a fully qualified name and type.
  E.g. They key for a table consists of <0 (=table)>+<database>+<table name>.
  Elsewhere in the comments this triple will be referred to simply as "key"
  or "name".
*/

struct MDL_key
{
public:
#ifdef HAVE_PSI_INTERFACE
  static void init_psi_keys();
#endif

  /**
    Object namespaces.
    Sic: when adding a new member to this enum make sure to
    update m_namespace_to_wait_state_name array in mdl.cc and
    metadata_lock_info_lock_name in metadata_lock_info.cc!

    Different types of objects exist in different namespaces
     - SCHEMA is for databases (to protect against DROP DATABASE)
     - TABLE is for tables and views.
     - BACKUP is for locking DML, DDL and COMMIT's during BACKUP STAGES
     - FUNCTION is for stored functions.
     - PROCEDURE is for stored procedures.
     - TRIGGER is for triggers.
     - EVENT is for event scheduler events
    Note that although there isn't metadata locking on triggers,
    it's necessary to have a separate namespace for them since
    MDL_key is also used outside of the MDL subsystem.
  */
  enum enum_mdl_namespace { BACKUP=0,
                            SCHEMA,
                            TABLE,
                            FUNCTION,
                            PROCEDURE,
                            PACKAGE_BODY,
                            TRIGGER,
                            EVENT,
                            USER_LOCK,           /* user level locks. */
                            /* This should be the last ! */
                            NAMESPACE_END };

  const uchar *ptr() const { return (uchar*) m_ptr; }
  uint length() const { return m_length; }

  const char *db_name() const { return m_ptr + 1; }
  uint db_name_length() const { return m_db_name_length; }

  const char *name() const { return m_ptr + m_db_name_length + 2; }
  uint name_length() const { return m_length - m_db_name_length - 3; }

  enum_mdl_namespace mdl_namespace() const
  { return (enum_mdl_namespace)(m_ptr[0]); }

  /**
    Construct a metadata lock key from a triplet (mdl_namespace,
    database and name).

    @remark The key for a table is <mdl_namespace>+<database name>+<table name>

    @param  mdl_namespace Id of namespace of object to be locked
    @param  db            Name of database to which the object belongs
    @param  name          Name of of the object
    @param  key           Where to store the the MDL key.
  */
  void mdl_key_init(enum_mdl_namespace mdl_namespace_arg,
                    const char *db, const char *name_arg)
  {
    m_ptr[0]= (char) mdl_namespace_arg;
    /*
      It is responsibility of caller to ensure that db and object names
      are not longer than NAME_LEN. Still we play safe and try to avoid
      buffer overruns.
    */
    DBUG_ASSERT(strlen(db) <= NAME_LEN);
    DBUG_ASSERT(strlen(name_arg) <= NAME_LEN);
    m_db_name_length= static_cast<uint16>(strmake(m_ptr + 1, db, NAME_LEN) -
                                          m_ptr - 1);
    m_length= static_cast<uint16>(strmake(m_ptr + m_db_name_length + 2,
                                          name_arg,
                                          NAME_LEN) - m_ptr + 1);
    m_hash_value= my_hash_sort(&my_charset_bin, (uchar*) m_ptr + 1,
                               m_length - 1);
    DBUG_SLOW_ASSERT(mdl_namespace_arg == USER_LOCK || ok_for_lower_case_names(db));
  }
  void mdl_key_init(const MDL_key *rhs)
  {
    memcpy(m_ptr, rhs->m_ptr, rhs->m_length);
    m_length= rhs->m_length;
    m_db_name_length= rhs->m_db_name_length;
    m_hash_value= rhs->m_hash_value;
  }
  bool is_equal(const MDL_key *rhs) const
  {
    return (m_length == rhs->m_length &&
            memcmp(m_ptr, rhs->m_ptr, m_length) == 0);
  }
  /**
    Compare two MDL keys lexicographically.
  */
  int cmp(const MDL_key *rhs) const
  {
    /*
      The key buffer is always '\0'-terminated. Since key
      character set is utf-8, we can safely assume that no
      character starts with a zero byte.
    */
    return memcmp(m_ptr, rhs->m_ptr, MY_MIN(m_length, rhs->m_length));
  }

  MDL_key(const MDL_key *rhs)
  {
    mdl_key_init(rhs);
  }
  MDL_key(enum_mdl_namespace namespace_arg,
          const char *db_arg, const char *name_arg)
  {
    mdl_key_init(namespace_arg, db_arg, name_arg);
  }
  MDL_key() = default; /* To use when part of MDL_request. */

  /**
    Get thread state name to be used in case when we have to
    wait on resource identified by key.
  */
  const PSI_stage_info * get_wait_state_name() const
  {
    return & m_namespace_to_wait_state_name[(int)mdl_namespace()];
  }
  my_hash_value_type hash_value() const
  {
    return m_hash_value + mdl_namespace();
  }
  my_hash_value_type tc_hash_value() const
  {
    return m_hash_value;
  }

private:
  uint16 m_length;
  uint16 m_db_name_length;
  my_hash_value_type m_hash_value;
  char m_ptr[MAX_MDLKEY_LENGTH];
  static PSI_stage_info m_namespace_to_wait_state_name[NAMESPACE_END];
private:
  MDL_key(const MDL_key &);                     /* not implemented */
  MDL_key &operator=(const MDL_key &);          /* not implemented */
  friend my_hash_value_type mdl_hash_function(CHARSET_INFO *,
                                              const uchar *, size_t);
};


/**
  A pending metadata lock request.

  A lock request and a granted metadata lock are represented by
  different classes because they have different allocation
  sites and hence different lifetimes. The allocation of lock requests is
  controlled from outside of the MDL subsystem, while allocation of granted
  locks (tickets) is controlled within the MDL subsystem.

  MDL_request is a C structure, you don't need to call a constructor
  or destructor for it.
*/

class MDL_request
{
public:
  /** Type of metadata lock. */
  enum          enum_mdl_type type;
  /** Duration for requested lock. */
  enum enum_mdl_duration duration;

  /**
    Pointers for participating in the list of lock requests for this context.
  */
  MDL_request *next_in_list;
  MDL_request **prev_in_list;
  /**
    Pointer to the lock ticket object for this lock request.
    Valid only if this lock request is satisfied.
  */
  MDL_ticket *ticket;

  /** A lock is requested based on a fully qualified name and type. */
  MDL_key key;

  const char *m_src_file;
  uint m_src_line;

public:

  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void operator delete(void *, MEM_ROOT *) {}

  void init_with_source(MDL_key::enum_mdl_namespace namespace_arg,
            const char *db_arg, const char *name_arg,
            enum_mdl_type mdl_type_arg,
            enum_mdl_duration mdl_duration_arg,
            const char *src_file, uint src_line);
  void init_by_key_with_source(const MDL_key *key_arg, enum_mdl_type mdl_type_arg,
            enum_mdl_duration mdl_duration_arg,
            const char *src_file, uint src_line);
  /** Set type of lock request. Can be only applied to pending locks. */
  inline void set_type(enum_mdl_type type_arg)
  {
    DBUG_ASSERT(ticket == NULL);
    type= type_arg;
  }
  void move_from(MDL_request &from)
  {
    type= from.type;
    duration= from.duration;
    ticket= from.ticket;
    next_in_list= from.next_in_list;
    prev_in_list= from.prev_in_list;
    key.mdl_key_init(&from.key);
    from.ticket=  NULL; // that's what "move" means
  }

  /**
    Is this a request for a lock which allow data to be updated?

    @note This method returns true for MDL_SHARED_UPGRADABLE type of
          lock. Even though this type of lock doesn't allow updates
          it will always be upgraded to one that does.
  */
  bool is_write_lock_request() const
  {
    return (type >= MDL_SHARED_WRITE &&
            type != MDL_SHARED_READ_ONLY);
  }

  /*
    This is to work around the ugliness of TABLE_LIST
    compiler-generated assignment operator. It is currently used
    in several places to quickly copy "most" of the members of the
    table list. These places currently never assume that the mdl
    request is carried over to the new TABLE_LIST, or shared
    between lists.

    This method does not initialize the instance being assigned!
    Use of init() for initialization after this assignment operator
    is mandatory. Can only be used before the request has been
    granted.
  */
  MDL_request& operator=(const MDL_request &)
  {
    type= MDL_NOT_INITIALIZED;
    ticket= NULL;
    /* Do nothing, in particular, don't try to copy the key. */
    return *this;
  }
  /* Another piece of ugliness for TABLE_LIST constructor */
  MDL_request(): type(MDL_NOT_INITIALIZED), ticket(NULL) {}

  MDL_request(const MDL_request *rhs)
    :type(rhs->type),
    duration(rhs->duration),
    ticket(NULL),
    key(&rhs->key)
  {}
};


typedef void (*mdl_cached_object_release_hook)(void *);

#define MDL_REQUEST_INIT(R, P1, P2, P3, P4, P5) \
  (*R).init_with_source(P1, P2, P3, P4, P5, __FILE__, __LINE__)

#define MDL_REQUEST_INIT_BY_KEY(R, P1, P2, P3) \
  (*R).init_by_key_with_source(P1, P2, P3, __FILE__, __LINE__)


/**
  An abstract class for inspection of a connected
  subgraph of the wait-for graph.
*/

class MDL_wait_for_graph_visitor
{
public:
  virtual bool enter_node(MDL_context *node) = 0;
  virtual void leave_node(MDL_context *node) = 0;

  virtual bool inspect_edge(MDL_context *dest) = 0;
  virtual ~MDL_wait_for_graph_visitor();
  MDL_wait_for_graph_visitor() = default;
};

/**
  Abstract class representing an edge in the waiters graph
  to be traversed by deadlock detection algorithm.
*/

class MDL_wait_for_subgraph
{
public:
  virtual ~MDL_wait_for_subgraph();

  /**
    Accept a wait-for graph visitor to inspect the node
    this edge is leading to.
  */
  virtual bool accept_visitor(MDL_wait_for_graph_visitor *gvisitor) = 0;

  enum enum_deadlock_weight
  {
    DEADLOCK_WEIGHT_FTWRL1= 0,
    DEADLOCK_WEIGHT_DML= 1,
    DEADLOCK_WEIGHT_DDL= 100
  };
  /* A helper used to determine which lock request should be aborted. */
  virtual uint get_deadlock_weight() const = 0;
};


/**
  A granted metadata lock.

  @warning MDL_ticket members are private to the MDL subsystem.

  @note Multiple shared locks on a same object are represented by a
        single ticket. The same does not apply for other lock types.

  @note There are two groups of MDL_ticket members:
        - "Externally accessible". These members can be accessed from
          threads/contexts different than ticket owner in cases when
          ticket participates in some list of granted or waiting tickets
          for a lock. Therefore one should change these members before
          including then to waiting/granted lists or while holding lock
          protecting those lists.
        - "Context private". Such members are private to thread/context
          owning this ticket. I.e. they should not be accessed from other
          threads/contexts.
*/

class MDL_ticket : public MDL_wait_for_subgraph, public ilist_node<>
{
public:
  /**
    Pointers for participating in the list of lock requests for this context.
    Context private.
  */
  MDL_ticket *next_in_context;
  MDL_ticket **prev_in_context;
public:
#ifdef WITH_WSREP
  void wsrep_report(bool debug) const;
#endif /* WITH_WSREP */
  bool has_pending_conflicting_lock() const;

  MDL_context *get_ctx() const { return m_ctx; }
  bool is_upgradable_or_exclusive() const
  {
    return m_type == MDL_SHARED_UPGRADABLE ||
           m_type == MDL_SHARED_NO_WRITE ||
           m_type == MDL_SHARED_NO_READ_WRITE ||
           m_type == MDL_EXCLUSIVE;
  }
  enum_mdl_type get_type() const { return m_type; }
  const LEX_STRING *get_type_name() const;
  const LEX_STRING *get_type_name(enum_mdl_type type) const;
  MDL_lock *get_lock() const { return m_lock; }
  MDL_key *get_key() const;
  void downgrade_lock(enum_mdl_type type);

  bool has_stronger_or_equal_type(enum_mdl_type type) const;

  bool is_incompatible_when_granted(enum_mdl_type type) const;
  bool is_incompatible_when_waiting(enum_mdl_type type) const;

  /** Implement MDL_wait_for_subgraph interface. */
  bool accept_visitor(MDL_wait_for_graph_visitor *dvisitor) override;
  uint get_deadlock_weight() const override;
  /**
    Status of lock request represented by the ticket as reflected in P_S.
  */
  enum enum_psi_status { PENDING = 0, GRANTED,
                         PRE_ACQUIRE_NOTIFY, POST_RELEASE_NOTIFY };
private:
  friend class MDL_context;

  MDL_ticket(MDL_context *ctx_arg, enum_mdl_type type_arg
#ifndef DBUG_OFF
             , enum_mdl_duration duration_arg
#endif
            )
   : m_type(type_arg),
#ifndef DBUG_OFF
     m_duration(duration_arg),
#endif
     m_ctx(ctx_arg),
     m_lock(NULL),
     m_psi(NULL)
  {}

  virtual ~MDL_ticket()
  {
    DBUG_ASSERT(m_psi == NULL);
  }

  static MDL_ticket *create(MDL_context *ctx_arg, enum_mdl_type type_arg
#ifndef DBUG_OFF
                            , enum_mdl_duration duration_arg
#endif
                            );
  static void destroy(MDL_ticket *ticket);
private:
  /** Type of metadata lock. Externally accessible. */
  enum enum_mdl_type m_type;
#ifndef DBUG_OFF
  /**
    Duration of lock represented by this ticket.
    Context private. Debug-only.
  */
  enum_mdl_duration m_duration;
#endif
  /**
    Context of the owner of the metadata lock ticket. Externally accessible.
  */
  MDL_context *m_ctx;

  /**
    Pointer to the lock object for this lock ticket. Externally accessible.
  */
  MDL_lock *m_lock;

  PSI_metadata_lock *m_psi;

private:
  MDL_ticket(const MDL_ticket &);               /* not implemented */
  MDL_ticket &operator=(const MDL_ticket &);    /* not implemented */
};


/**
  Savepoint for MDL context.

  Doesn't include metadata locks with explicit duration as
  they are not released during rollback to savepoint.
*/

class MDL_savepoint
{
public:
  MDL_savepoint() = default;;

private:
  MDL_savepoint(MDL_ticket *stmt_ticket, MDL_ticket *trans_ticket)
    : m_stmt_ticket(stmt_ticket), m_trans_ticket(trans_ticket)
  {}

  friend class MDL_context;

private:
  /**
    Pointer to last lock with statement duration which was taken
    before creation of savepoint.
  */
  MDL_ticket *m_stmt_ticket;
  /**
    Pointer to last lock with transaction duration which was taken
    before creation of savepoint.
  */
  MDL_ticket *m_trans_ticket;
};


/**
  A reliable way to wait on an MDL lock.
*/

class MDL_wait
{
public:
  MDL_wait();
  ~MDL_wait();

  enum enum_wait_status { EMPTY = 0, GRANTED, VICTIM, TIMEOUT, KILLED };

  bool set_status(enum_wait_status result_arg);
  enum_wait_status get_status();
  void reset_status();
  enum_wait_status timed_wait(MDL_context_owner *owner,
                              struct timespec *abs_timeout,
                              bool signal_timeout,
                              const PSI_stage_info *wait_state_name);
private:
  /**
    Condvar which is used for waiting until this context's pending
    request can be satisfied or this thread has to perform actions
    to resolve a potential deadlock (we subscribe to such
    notification by adding a ticket corresponding to the request
    to an appropriate queue of waiters).
  */
  mysql_mutex_t m_LOCK_wait_status;
  mysql_cond_t m_COND_wait_status;
  enum_wait_status m_wait_status;
};


typedef I_P_List<MDL_request, I_P_List_adapter<MDL_request,
                 &MDL_request::next_in_list,
                 &MDL_request::prev_in_list>,
                 I_P_List_counter>
        MDL_request_list;

/**
  Context of the owner of metadata locks. I.e. each server
  connection has such a context.
*/

class MDL_context
{
public:
  typedef I_P_List<MDL_ticket,
                   I_P_List_adapter<MDL_ticket,
                                    &MDL_ticket::next_in_context,
                                    &MDL_ticket::prev_in_context> >
          Ticket_list;

  typedef Ticket_list::Iterator Ticket_iterator;

  MDL_context();
  void destroy();

  bool try_acquire_lock(MDL_request *mdl_request);
  bool acquire_lock(MDL_request *mdl_request, double lock_wait_timeout);
  bool acquire_locks(MDL_request_list *requests, double lock_wait_timeout);
  bool upgrade_shared_lock(MDL_ticket *mdl_ticket,
                           enum_mdl_type new_type,
                           double lock_wait_timeout);

  bool clone_ticket(MDL_request *mdl_request);

  void release_all_locks_for_name(MDL_ticket *ticket);
  void release_lock(MDL_ticket *ticket);

  bool is_lock_owner(MDL_key::enum_mdl_namespace mdl_namespace,
                     const char *db, const char *name,
                     enum_mdl_type mdl_type);
  unsigned long get_lock_owner(MDL_key *mdl_key);

  bool has_lock(const MDL_savepoint &mdl_savepoint, MDL_ticket *mdl_ticket);

  inline bool has_locks() const
  {
    return !(m_tickets[MDL_STATEMENT].is_empty() &&
             m_tickets[MDL_TRANSACTION].is_empty() &&
             m_tickets[MDL_EXPLICIT].is_empty());
  }
  bool has_explicit_locks() const
  {
    return !m_tickets[MDL_EXPLICIT].is_empty();
  }
  inline bool has_transactional_locks() const
  {
    return !m_tickets[MDL_TRANSACTION].is_empty();
  }

  MDL_savepoint mdl_savepoint()
  {
    return MDL_savepoint(m_tickets[MDL_STATEMENT].front(),
                         m_tickets[MDL_TRANSACTION].front());
  }

  void set_explicit_duration_for_all_locks();
  void set_transaction_duration_for_all_locks();
  void set_lock_duration(MDL_ticket *mdl_ticket, enum_mdl_duration duration);

  void release_statement_locks();
  void release_transactional_locks(THD *thd);
  void release_explicit_locks();
  void rollback_to_savepoint(const MDL_savepoint &mdl_savepoint);

  MDL_context_owner *get_owner() { return m_owner; }

  /** @pre Only valid if we started waiting for lock. */
  inline uint get_deadlock_weight() const
  { return m_waiting_for->get_deadlock_weight() + m_deadlock_overweight; }
  void inc_deadlock_overweight() { m_deadlock_overweight++; }
  /**
    Post signal to the context (and wake it up if necessary).

    @retval FALSE - Success, signal was posted.
    @retval TRUE  - Failure, signal was not posted since context
                    already has received some signal or closed
                    signal slot.
  */
  void init(MDL_context_owner *arg) { m_owner= arg; reset(); }
  void reset() { m_deadlock_overweight= 0; }

  void set_needs_thr_lock_abort(bool needs_thr_lock_abort)
  {
    /*
      @note In theory, this member should be modified under protection
            of some lock since it can be accessed from different threads.
            In practice, this is not necessary as code which reads this
            value and so might miss the fact that value was changed will
            always re-try reading it after small timeout and therefore
            will see the new value eventually.
    */
    m_needs_thr_lock_abort= needs_thr_lock_abort;
  }
  bool get_needs_thr_lock_abort() const
  {
    return m_needs_thr_lock_abort;
  }
public:
  /**
    If our request for a lock is scheduled, or aborted by the deadlock
    detector, the result is recorded in this class.
  */
  MDL_wait m_wait;
private:
  /**
    Lists of all MDL tickets acquired by this connection.

    Lists of MDL tickets:
    ---------------------
    The entire set of locks acquired by a connection can be separated
    in three subsets according to their duration: locks released at
    the end of statement, at the end of transaction and locks are
    released explicitly.

    Statement and transactional locks are locks with automatic scope.
    They are accumulated in the course of a transaction, and released
    either at the end of uppermost statement (for statement locks) or
    on COMMIT, ROLLBACK or ROLLBACK TO SAVEPOINT (for transactional
    locks). They must not be (and never are) released manually,
    i.e. with release_lock() call.

    Tickets with explicit duration are taken for locks that span
    multiple transactions or savepoints.
    These are: HANDLER SQL locks (HANDLER SQL is
    transaction-agnostic), LOCK TABLES locks (you can COMMIT/etc
    under LOCK TABLES, and the locked tables stay locked), user level
    locks (GET_LOCK()/RELEASE_LOCK() functions) and
    locks implementing "global read lock".

    Statement/transactional locks are always prepended to the
    beginning of the appropriate list. In other words, they are
    stored in reverse temporal order. Thus, when we rollback to
    a savepoint, we start popping and releasing tickets from the
    front until we reach the last ticket acquired after the savepoint.

    Locks with explicit duration are not stored in any
    particular order, and among each other can be split into
    four sets:

    [LOCK TABLES locks] [USER locks] [HANDLER locks] [GLOBAL READ LOCK locks]

    The following is known about these sets:

    * GLOBAL READ LOCK locks are always stored last.
      This is because one can't say SET GLOBAL read_only=1 or
      FLUSH TABLES WITH READ LOCK if one has locked tables. One can,
      however, LOCK TABLES after having entered the read only mode.
      Note, that subsequent LOCK TABLES statement will unlock the previous
      set of tables, but not the GRL!
      There are no HANDLER locks after GRL locks because
      SET GLOBAL read_only performs a FLUSH TABLES WITH
      READ LOCK internally, and FLUSH TABLES, in turn, implicitly
      closes all open HANDLERs.
      However, one can open a few HANDLERs after entering the
      read only mode.
    * LOCK TABLES locks include intention exclusive locks on
      involved schemas and global intention exclusive lock.
  */
  Ticket_list m_tickets[MDL_DURATION_END];
  MDL_context_owner *m_owner;
  /**
    TRUE -  if for this context we will break protocol and try to
            acquire table-level locks while having only S lock on
            some table.
            To avoid deadlocks which might occur during concurrent
            upgrade of SNRW lock on such object to X lock we have to
            abort waits for table-level locks for such connections.
    FALSE - Otherwise.
  */
  bool m_needs_thr_lock_abort;

  /**
    Read-write lock protecting m_waiting_for member.

    @note The fact that this read-write lock prefers readers is
          important as deadlock detector won't work correctly
          otherwise. @sa Comment for MDL_lock::m_rwlock.
  */
  mysql_prlock_t m_LOCK_waiting_for;
  /**
    Tell the deadlock detector what metadata lock or table
    definition cache entry this session is waiting for.
    In principle, this is redundant, as information can be found
    by inspecting waiting queues, but we'd very much like it to be
    readily available to the wait-for graph iterator.
   */
  MDL_wait_for_subgraph *m_waiting_for;
  LF_PINS *m_pins;
  uint m_deadlock_overweight;
private:
  MDL_ticket *find_ticket(MDL_request *mdl_req,
                          enum_mdl_duration *duration);
  void release_locks_stored_before(enum_mdl_duration duration, MDL_ticket *sentinel);
  void release_lock(enum_mdl_duration duration, MDL_ticket *ticket);
  bool try_acquire_lock_impl(MDL_request *mdl_request,
                             MDL_ticket **out_ticket);
  bool fix_pins();

public:
  THD *get_thd() const { return m_owner->get_thd(); }
  bool has_explicit_locks();
  void find_deadlock();

  ulong get_thread_id() const { return thd_get_thread_id(get_thd()); }

  bool visit_subgraph(MDL_wait_for_graph_visitor *dvisitor);

  /** Inform the deadlock detector there is an edge in the wait-for graph. */
  void will_wait_for(MDL_wait_for_subgraph *waiting_for_arg)
  {
    mysql_prlock_wrlock(&m_LOCK_waiting_for);
    m_waiting_for=  waiting_for_arg;
    mysql_prlock_unlock(&m_LOCK_waiting_for);
  }

  /** Remove the wait-for edge from the graph after we're done waiting. */
  void done_waiting_for()
  {
    mysql_prlock_wrlock(&m_LOCK_waiting_for);
    m_waiting_for= NULL;
    mysql_prlock_unlock(&m_LOCK_waiting_for);
  }
  void lock_deadlock_victim()
  {
    mysql_prlock_rdlock(&m_LOCK_waiting_for);
  }
  void unlock_deadlock_victim()
  {
    mysql_prlock_unlock(&m_LOCK_waiting_for);
  }
private:
  MDL_context(const MDL_context &rhs);          /* not implemented */
  MDL_context &operator=(MDL_context &rhs);     /* not implemented */

  /* metadata_lock_info plugin */
  friend int i_s_metadata_lock_info_fill_row(MDL_ticket*, void*);
#ifndef DBUG_OFF
public:
  /**
    This is for the case when the thread opening the table does not acquire
    the lock itself, but utilizes a lock guarantee from another MDL context.

    For example, in InnoDB, MDL is acquired by the purge_coordinator_task,
    but the table may be opened and used in a purge_worker_task.
    The coordinator thread holds the lock for the duration of worker's purge
    job, or longer, possibly reusing shared MDL for different workers and jobs.
  */
  MDL_context *lock_warrant= NULL;

  inline bool is_lock_warrantee(MDL_key::enum_mdl_namespace ns,
                                const char *db, const char *name,
                                enum_mdl_type mdl_type) const
  {
    return lock_warrant && lock_warrant->is_lock_owner(ns, db, name, mdl_type);
  }
#endif
};


void mdl_init();
void mdl_destroy();

extern "C" unsigned long thd_get_thread_id(const MYSQL_THD thd);

/**
  Check if a connection in question is no longer connected.

  @details
  Replication apply thread is always connected. Otherwise,
  does a poll on the associated socket to check if the client
  is gone.
*/
extern "C" int thd_is_connected(MYSQL_THD thd);


/*
  Metadata locking subsystem tries not to grant more than
  max_write_lock_count high-prio, strong locks successively,
  to avoid starving out weak, low-prio locks.
*/
extern "C" ulong max_write_lock_count;

typedef int (*mdl_iterator_callback)(MDL_ticket *ticket, void *arg,
                                     bool granted);
extern MYSQL_PLUGIN_IMPORT
int mdl_iterate(mdl_iterator_callback callback, void *arg);
#endif /* MDL_H */
server/private/my_json_writer.h000064400000043716150400263720012761 0ustar00/* Copyright (C) 2014 SkySQL Ab, MariaDB Corporation Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef JSON_WRITER_INCLUDED
#define JSON_WRITER_INCLUDED

#include "my_base.h"

#if !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST) || defined ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
#include <set>
#include <stack>
#include <string>
#include <vector>
#endif

#ifdef JSON_WRITER_UNIT_TEST
#include "sql_string.h"
constexpr uint FAKE_SELECT_LEX_ID= UINT_MAX;
// Also, mock objects are defined in my_json_writer-t.cc
#define VALIDITY_ASSERT(x) if (!(x)) this->invalid_json= true;
#else
#include "sql_select.h"
#define VALIDITY_ASSERT(x) DBUG_ASSERT(x)
#endif

#include <type_traits>

class Opt_trace_stmt;
class Opt_trace_context;
class Json_writer;
struct TABLE_LIST;


/*
  Single_line_formatting_helper is used by Json_writer to do better formatting
  of JSON documents. 

  The idea is to catch arrays that can be printed on one line:

    arrayName : [ "boo", 123, 456 ] 

  and actually print them on one line. Arrrays that occupy too much space on
  the line, or have nested members cannot be printed on one line.
  
  We hook into JSON printing functions and try to detect the pattern. While
  detecting the pattern, we will accumulate "boo", 123, 456 as strings.

  Then, 
   - either the pattern is broken, and we print the elements out, 
   - or the pattern lasts till the end of the array, and we print the 
     array on one line.
*/

class Single_line_formatting_helper
{
  enum enum_state
  {
    INACTIVE,
    ADD_MEMBER,
    IN_ARRAY,
    DISABLED
  };

  /*
    This works like a finite automaton. 

    state=DISABLED means the helper is disabled - all on_XXX functions will
    return false (which means "not handled") and do nothing.

                                      +->-+
                                      |   v
       INACTIVE ---> ADD_MEMBER ---> IN_ARRAY--->-+
          ^                                       |
          +------------------<--------------------+
                              
    For other states: 
    INACTIVE    - initial state, we have nothing.
    ADD_MEMBER  - add_member() was called, the buffer has "member_name\0".
    IN_ARRAY    - start_array() was called.


  */
  enum enum_state state;
  enum { MAX_LINE_LEN= 80 };
  char buffer[80];

  /* The data in the buffer is located between buffer[0] and buf_ptr */
  char *buf_ptr;
  uint line_len;

  Json_writer *owner;
public:
  Single_line_formatting_helper() : state(INACTIVE), buf_ptr(buffer) {}

  void init(Json_writer *owner_arg) { owner= owner_arg; }

  bool on_add_member(const char *name, size_t len);

  bool on_start_array();
  bool on_end_array();
  void on_start_object();
  // on_end_object() is not needed.

  bool on_add_str(const char *str, size_t num_bytes);

  /*
    Returns true if the helper is flushing its buffer and is probably
    making calls back to its Json_writer. (The Json_writer uses this
    function to avoid re-doing the processing that it has already done
    before making a call to fmt_helper)
  */
  bool is_making_writer_calls() const { return state == DISABLED; }

private:
  void flush_on_one_line();
  void disable_and_flush();
};


/*
  Something that looks like class String, but has an internal limit of
  how many bytes one can append to it.

  Bytes that were truncated due to the size limitation are counted.
*/

class String_with_limit
{
public:

  String_with_limit() : size_limit(SIZE_T_MAX), truncated_len(0)
  {
    str.length(0);
  }

  size_t get_truncated_bytes() const { return truncated_len; }
  size_t get_size_limit() { return size_limit; }

  void set_size_limit(size_t limit_arg)
  {
    // Setting size limit to be shorter than length will not have the desired
    // effect
    DBUG_ASSERT(str.length() < size_limit);
    size_limit= limit_arg;
  }

  void append(const char *s, size_t size)
  {
    if (str.length() + size <= size_limit)
    {
      // Whole string can be added, just do it
      str.append(s, size);
    }
    else
    {
      // We cannot add the whole string
      if (str.length() < size_limit)
      {
        // But we can still add something
        size_t bytes_to_add = size_limit - str.length();
        str.append(s, bytes_to_add);
        truncated_len += size - bytes_to_add;
      }
      else
        truncated_len += size;
    }
  }

  void append(const char *s)
  {
    append(s, strlen(s));
  }

  void append(char c)
  {
    if (str.length() + 1 > size_limit)
      truncated_len++;
    else
      str.append(c);
  }

  const String *get_string() { return &str; }
  size_t length() { return str.length(); }
private:
  String str;

  // str must not get longer than this many bytes.
  size_t size_limit;

  // How many bytes were truncated from the string
  size_t truncated_len;
};

/*
  A class to write well-formed JSON documents. The documents are also formatted
  for human readability.
*/

class Json_writer
{
#if !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST)
  /*
    In debug mode, Json_writer will fail and assertion if one attempts to
    produce an invalid JSON document (e.g. JSON array having named elements).
  */
  std::vector<bool> named_items_expectation;

  bool named_item_expected() const;

  bool got_name;

#ifdef JSON_WRITER_UNIT_TEST
public:
  // When compiled for unit test, creating invalid JSON will set this to true
  // instead of an assertion.
  bool invalid_json= false;
#endif
#endif

public:
  /* Add a member. We must be in an object. */
  Json_writer& add_member(const char *name);
  Json_writer& add_member(const char *name, size_t len);
  
  /* Add atomic values */
  void add_str(const char* val);
  void add_str(const char* val, size_t num_bytes);
  void add_str(const String &str);
  void add_str(Item *item);
  void add_table_name(const JOIN_TAB *tab);
  void add_table_name(const TABLE* table);

  void add_ll(longlong val);
  void add_ull(ulonglong val);
  void add_size(longlong val);
  void add_double(double val);
  void add_bool(bool val);
  void add_null();

private:
  void add_unquoted_str(const char* val);
  void add_unquoted_str(const char* val, size_t len);

  bool on_add_str(const char *str, size_t num_bytes);
  void on_start_object();

public:
  /* Start a child object */
  void start_object();
  void start_array();

  void end_object();
  void end_array();
  
  /*
    One can set a limit of how large a JSON document should be.
    Writes beyond that size will be counted, but will not be collected.
  */
  void set_size_limit(size_t mem_size) { output.set_size_limit(mem_size); }

  size_t get_truncated_bytes() { return output.get_truncated_bytes(); }

  Json_writer() : 
#if !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST)
    got_name(false),
#endif
    indent_level(0), document_start(true), element_started(false), 
    first_child(true)
  {
    fmt_helper.init(this);
  }
private:
  // TODO: a stack of (name, bool is_object_or_array) elements.
  int indent_level;
  enum { INDENT_SIZE = 2 };

  friend class Single_line_formatting_helper;
  friend class Json_writer_nesting_guard;
  bool document_start;
  bool element_started;
  bool first_child;

  Single_line_formatting_helper fmt_helper;

  void append_indent();
  void start_element();
  void start_sub_element();

public:
  String_with_limit output;
};

/* A class to add values to Json_writer_object and Json_writer_array */
class Json_value_helper
{
  Json_writer* writer;

public:
  void init(Json_writer *my_writer) { writer= my_writer; }
  void add_str(const char* val)
  {
      writer->add_str(val);
  }
  void add_str(const char* val, size_t length)
  {
      writer->add_str(val, length);
  }
  void add_str(const String &str)
  {
      writer->add_str(str.ptr(), str.length());
  }
  void add_str(const LEX_CSTRING &str)
  {
      writer->add_str(str.str, str.length);
  }
  void add_str(Item *item)
  {
      writer->add_str(item);
  }

  void add_ll(longlong val)
  {
      writer->add_ll(val);
  }
  void add_size(longlong val)
  {
      writer->add_size(val);
  }
  void add_double(double val)
  {
      writer->add_double(val);
  }
  void add_bool(bool val)
  {
      writer->add_bool(val);
  }
  void add_null()
  {
      writer->add_null();
  }
  void add_table_name(const JOIN_TAB *tab)
  {
      writer->add_table_name(tab);
  }
  void add_table_name(const TABLE* table)
  {
      writer->add_table_name(table);
  }
};

/* A common base for Json_writer_object and Json_writer_array */
class Json_writer_struct
{
  Json_writer_struct(const Json_writer_struct&)= delete;
  Json_writer_struct& operator=(const Json_writer_struct&)= delete;

#ifdef ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
  static thread_local std::vector<bool> named_items_expectation;
#endif
protected:
  Json_writer* my_writer;
  Json_value_helper context;
  /*
    Tells when a json_writer_struct has been closed or not
  */
  bool closed;

  explicit Json_writer_struct(Json_writer *writer)
  : my_writer(writer)
  {
    context.init(my_writer);
    closed= false;
#ifdef ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
    named_items_expectation.push_back(expect_named_children);
#endif
  }
  explicit Json_writer_struct(THD *thd)
  : Json_writer_struct(thd->opt_trace.get_current_json())
  {
  }

public:

#ifdef ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
  virtual ~Json_writer_struct()
  {
    named_items_expectation.pop_back();
  }
#else
  virtual ~Json_writer_struct() = default;
#endif

  bool trace_started() const
  {
    return my_writer != 0;
  }

#ifdef ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
  bool named_item_expected() const
  {
    return named_items_expectation.size() > 1
        && *(named_items_expectation.rbegin() + 1);
  }
#endif
};


/*
  RAII-based class to start/end writing a JSON object into the JSON document

  There is "ignore mode": one can initialize Json_writer_object with a NULL
  Json_writer argument, and then all its calls will do nothing. This is used
  by optimizer trace which can be enabled or disabled.
*/

class Json_writer_object : public Json_writer_struct
{
private:
  void add_member(const char *name)
  {
    my_writer->add_member(name);
  }
public:
  explicit Json_writer_object(Json_writer* writer, const char *str= nullptr)
  : Json_writer_struct(writer)
  {
#ifdef ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
    DBUG_ASSERT(named_item_expected());
#endif
    if (unlikely(my_writer))
    {
      if (str)
        my_writer->add_member(str);
      my_writer->start_object();
    }
  }

  explicit Json_writer_object(THD* thd, const char *str= nullptr)
  : Json_writer_object(thd->opt_trace.get_current_json(), str)
  {
  }

  ~Json_writer_object()
  {
    if (my_writer && !closed)
      my_writer->end_object();
    closed= TRUE;
  }

  Json_writer_object& add(const char *name, bool value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_bool(value);
    }
    return *this;
  }

  Json_writer_object& add(const char *name, ulonglong value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      my_writer->add_ull(value);
    }
    return *this;
  }

  template<class IntT,
    typename= typename ::std::enable_if<std::is_integral<IntT>::value>::type
  >
  Json_writer_object& add(const char *name, IntT value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_ll(value);
    }
    return *this;
  }

  Json_writer_object& add(const char *name, double value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_double(value);
    }
    return *this;
  }

  Json_writer_object& add(const char *name, const char *value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_str(value);
    }
    return *this;
  }
  Json_writer_object& add(const char *name, const char *value, size_t num_bytes)
  {
    add_member(name);
    context.add_str(value, num_bytes);
    return *this;
  }
  Json_writer_object& add(const char *name, const LEX_CSTRING &value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_str(value.str, value.length);
    }
    return *this;
  }
  Json_writer_object& add(const char *name, Item *value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_str(value);
    }
    return *this;
  }
  Json_writer_object& add_null(const char*name)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member(name);
      context.add_null();
    }
    return *this;
  }
  Json_writer_object& add_table_name(const JOIN_TAB *tab)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member("table");
      context.add_table_name(tab);
    }
    return *this;
  }
  Json_writer_object& add_table_name(const TABLE *table)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member("table");
      context.add_table_name(table);
    }
    return *this;
  }
  Json_writer_object& add_select_number(uint select_number)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
    {
      add_member("select_id");
      if (unlikely(select_number == FAKE_SELECT_LEX_ID))
        context.add_str("fake");
      else
        context.add_ll(static_cast<longlong>(select_number));
    }
    return *this;
  }
  void end()
  {
    DBUG_ASSERT(!closed);
    if (unlikely(my_writer))
      my_writer->end_object();
    closed= TRUE;
  }
};


/*
  RAII-based class to start/end writing a JSON array into the JSON document

  There is "ignore mode": one can initialize Json_writer_array with a NULL
  Json_writer argument, and then all its calls will do nothing. This is used
  by optimizer trace which can be enabled or disabled.
*/

class Json_writer_array : public Json_writer_struct
{
public:
  explicit Json_writer_array(Json_writer *writer, const char *str= nullptr)
    : Json_writer_struct(writer)
  {
#ifdef ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
    DBUG_ASSERT(!named_item_expected());
#endif
    if (unlikely(my_writer))
    {
      if (str)
        my_writer->add_member(str);
      my_writer->start_array();
    }
  }

  explicit Json_writer_array(THD *thd, const char *str= nullptr)
    : Json_writer_array(thd->opt_trace.get_current_json(), str)
  {
  }

  ~Json_writer_array()
  {
    if (unlikely(my_writer && !closed))
    {
      my_writer->end_array();
      closed= TRUE;
    }
  }

  void end()
  {
    DBUG_ASSERT(!closed);
    if (unlikely(my_writer))
      my_writer->end_array();
    closed= TRUE;
  }

  Json_writer_array& add(bool value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_bool(value);
    return *this;
  }
  Json_writer_array& add(ulonglong value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_ll(static_cast<longlong>(value));
    return *this;
  }
  Json_writer_array& add(longlong value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_ll(value);
    return *this;
  }
  Json_writer_array& add(double value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_double(value);
    return *this;
  }
  #ifndef _WIN64
  Json_writer_array& add(size_t value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_ll(static_cast<longlong>(value));
    return *this;
  }
  #endif
  Json_writer_array& add(const char *value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_str(value);
    return *this;
  }
  Json_writer_array& add(const char *value, size_t num_bytes)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_str(value, num_bytes);
    return *this;
  }
  Json_writer_array& add(const LEX_CSTRING &value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_str(value.str, value.length);
    return *this;
  }
  Json_writer_array& add(Item *value)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_str(value);
    return *this;
  }
  Json_writer_array& add_null()
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_null();
    return *this;
  }
  Json_writer_array& add_table_name(const JOIN_TAB *tab)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_table_name(tab);
    return *this;
  }
  Json_writer_array& add_table_name(const TABLE *table)
  {
    DBUG_ASSERT(!closed);
    if (my_writer)
      context.add_table_name(table);
    return *this;
  }
};

/*
  RAII-based class to disable writing into the JSON document
  The tracing is disabled as soon as the object is created.
  The destuctor is called as soon as we exit the scope of the object
  and the tracing is enabled back.
*/

class Json_writer_temp_disable
{
public:
  Json_writer_temp_disable(THD *thd_arg);
  ~Json_writer_temp_disable();
  THD *thd;
};

/*
  RAII-based helper class to detect incorrect use of Json_writer.

  The idea is that a function typically must leave Json_writer at the same
  identation level as it was when it was invoked. Leaving it at a different 
  level typically means we forgot to close an object or an array

  So, here is a way to guard
  void foo(Json_writer *writer)
  {
    Json_writer_nesting_guard(writer);
    .. do something with writer

    // at the end of the function, ~Json_writer_nesting_guard() is called
    // and it makes sure that the nesting is the same as when the function was
    // entered.
  }
*/

class Json_writer_nesting_guard
{
#ifdef DBUG_OFF
public:
  Json_writer_nesting_guard(Json_writer *) {}
#else
  Json_writer* writer;
  int indent_level;
public:
  Json_writer_nesting_guard(Json_writer *writer_arg) : 
    writer(writer_arg),
    indent_level(writer->indent_level)
  {}

  ~Json_writer_nesting_guard()
  {
    DBUG_ASSERT(indent_level == writer->indent_level);
  }
#endif
};

#endif
server/private/log_event_old.h000064400000046566150400263720012535 0ustar00/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef LOG_EVENT_OLD_H
#define LOG_EVENT_OLD_H

/*
  Need to include this file at the proper position of log_event.h
 */


/**
  @file

  @brief This file contains classes handling old formats of row-based
  binlog events.
*/
/*
  Around 2007-10-31, I made these classes completely separated from
  the new classes (before, there was a complex class hierarchy
  involving multiple inheritance; see BUG#31581), by simply copying
  and pasting the entire contents of Rows_log_event into
  Old_rows_log_event and the entire contents of
  {Write|Update|Delete}_rows_log_event into
  {Write|Update|Delete}_rows_log_event_old.  For clarity, I will keep
  the comments marking which code was cut-and-pasted for some time.
  With the classes collapsed into one, there is probably some
  redundancy (maybe some methods can be simplified and/or removed),
  but we keep them this way for now.  /Sven
*/

/* These classes are based on the v1 RowsHeaderLen */
#undef ROWS_HEADER_LEN
#define ROWS_HEADER_LEN ROWS_HEADER_LEN_V1

/**
  @class Old_rows_log_event
  
  Base class for the three types of row-based events
  {Write|Update|Delete}_row_log_event_old, with event type codes
  PRE_GA_{WRITE|UPDATE|DELETE}_ROWS_EVENT.  These events are never
  created any more, except when reading a relay log created by an old
  server.
*/
class Old_rows_log_event : public Log_event
{
  /********** BEGIN CUT & PASTE FROM Rows_log_event **********/
public:
  /**
     Enumeration of the errors that can be returned.
   */
  enum enum_error
  {
    ERR_OPEN_FAILURE = -1,               /**< Failure to open table */
    ERR_OK = 0,                                 /**< No error */
    ERR_TABLE_LIMIT_EXCEEDED = 1,      /**< No more room for tables */
    ERR_OUT_OF_MEM = 2,                         /**< Out of memory */
    ERR_BAD_TABLE_DEF = 3,     /**< Table definition does not match */
    ERR_RBR_TO_SBR = 4  /**< daisy-chanining RBR to SBR not allowed */
  };

  /*
    These definitions allow you to combine the flags into an
    appropriate flag set using the normal bitwise operators.  The
    implicit conversion from an enum-constant to an integer is
    accepted by the compiler, which is then used to set the real set
    of flags.
  */
  enum enum_flag
  {
    /* Last event of a statement */
    STMT_END_F = (1U << 0),

    /* Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options */
    NO_FOREIGN_KEY_CHECKS_F = (1U << 1),

    /* Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */
    RELAXED_UNIQUE_CHECKS_F = (1U << 2),

    /** 
      Indicates that rows in this event are complete, that is contain
      values for all columns of the table.
     */
    COMPLETE_ROWS_F = (1U << 3)
  };

  typedef uint16 flag_set;

  /* Special constants representing sets of flags */
  enum 
  {
      RLE_NO_FLAGS = 0U
  };

  virtual ~Old_rows_log_event();

  void set_flags(flag_set flags_arg) { m_flags |= flags_arg; }
  void clear_flags(flag_set flags_arg) { m_flags &= ~flags_arg; }
  flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  void pack_info(Protocol *protocol) override;
#endif

#ifdef MYSQL_CLIENT
  /* not for direct call, each derived has its own ::print() */
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override= 0;
#endif

#ifndef MYSQL_CLIENT
  int add_row_data(uchar *data, size_t length)
  {
    return do_add_row_data(data,length); 
  }
#endif

  /* Member functions to implement superclass interface */
  int get_data_size() override;

  MY_BITMAP const *get_cols() const { return &m_cols; }
  size_t get_width() const          { return m_width; }
  ulonglong get_table_id() const    { return m_table_id; }

#ifndef MYSQL_CLIENT
  bool write_data_header() override;
  bool write_data_body() override;
  const char *get_db() override { return m_table->s->db.str; }
#ifdef HAVE_REPLICATION
  bool is_part_of_group() override { return 1; }
#endif
#endif
  /*
    Check that malloc() succeeded in allocating memory for the rows
    buffer and the COLS vector. Checking that an Update_rows_log_event_old
    is valid is done in the Update_rows_log_event_old::is_valid()
    function.
  */
  bool is_valid() const override
  {
    return m_rows_buf && m_cols.bitmap;
  }

  uint     m_row_count;         /* The number of rows added to the event */

protected:
  /* 
     The constructors are protected since you're supposed to inherit
     this class, not create instances of this class.
  */
#ifndef MYSQL_CLIENT
  Old_rows_log_event(THD*, TABLE*, ulonglong table_id,
                     MY_BITMAP const *cols, bool is_transactional);
#endif
  Old_rows_log_event(const uchar *row_data, uint event_len,
                     Log_event_type event_type,
                     const Format_description_log_event *description_event);

#ifdef MYSQL_CLIENT
  bool print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
#endif

#ifndef MYSQL_CLIENT
  virtual int do_add_row_data(uchar *data, size_t length);
#endif

#ifndef MYSQL_CLIENT
  TABLE *m_table;		/* The table the rows belong to */
#endif
  ulonglong   m_table_id;	/* Table ID */
  MY_BITMAP   m_cols;		/* Bitmap denoting columns available */
  ulong       m_width;          /* The width of the columns bitmap */

  ulong       m_master_reclength; /* Length of record on master side */

  /* Bit buffers in the same memory as the class */
  my_bitmap_map  m_bitbuf[128/(sizeof(my_bitmap_map)*8)];
  my_bitmap_map  m_bitbuf_ai[128/(sizeof(my_bitmap_map)*8)];

  uchar    *m_rows_buf;		/* The rows in packed format */
  uchar    *m_rows_cur;		/* One-after the end of the data */
  uchar    *m_rows_end;		/* One-after the end of the allocated space */

  flag_set m_flags;		/* Flags for row-level events */

  /* helper functions */

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  const uchar *m_curr_row;     /* Start of the row being processed */
  const uchar *m_curr_row_end; /* One-after the end of the current row */
  uchar    *m_key;      /* Buffer to keep key value during searches */

  int find_row(rpl_group_info *);
  int write_row(rpl_group_info *, const bool);

  // Unpack the current row into m_table->record[0]
  int unpack_current_row(rpl_group_info *rgi)
  { 
    DBUG_ASSERT(m_table);
    ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
    return ::unpack_row(rgi, m_table, m_width, m_curr_row, &m_cols,
                                   &m_curr_row_end, &m_master_reclength, m_rows_end);
  }
#endif

private:

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;

  /*
    Primitive to prepare for a sequence of row executions.

    DESCRIPTION

      Before doing a sequence of do_prepare_row() and do_exec_row()
      calls, this member function should be called to prepare for the
      entire sequence. Typically, this member function will allocate
      space for any buffers that are needed for the two member
      functions mentioned above.

    RETURN VALUE

      The member function will return 0 if all went OK, or a non-zero
      error code otherwise.
  */
  virtual 
  int do_before_row_operations(const Slave_reporting_capability *const log) = 0;

  /*
    Primitive to clean up after a sequence of row executions.

    DESCRIPTION
    
      After doing a sequence of do_prepare_row() and do_exec_row(),
      this member function should be called to clean up and release
      any allocated buffers.
      
      The error argument, if non-zero, indicates an error which happened during
      row processing before this function was called. In this case, even if 
      function is successful, it should return the error code given in the argument.
  */
  virtual 
  int do_after_row_operations(const Slave_reporting_capability *const log,
                              int error) = 0;

  /*
    Primitive to do the actual execution necessary for a row.

    DESCRIPTION
      The member function will do the actual execution needed to handle a row.
      The row is located at m_curr_row. When the function returns, 
      m_curr_row_end should point at the next row (one byte after the end
      of the current row).    

    RETURN VALUE
      0 if execution succeeded, 1 if execution failed.
      
  */
  virtual int do_exec_row(rpl_group_info *rgi) = 0;
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */

  /********** END OF CUT & PASTE FROM Rows_log_event **********/
 protected:
  
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)

  int do_apply_event(Old_rows_log_event*, rpl_group_info *rgi);

  /*
    Primitive to prepare for a sequence of row executions.

    DESCRIPTION

      Before doing a sequence of do_prepare_row() and do_exec_row()
      calls, this member function should be called to prepare for the
      entire sequence. Typically, this member function will allocate
      space for any buffers that are needed for the two member
      functions mentioned above.

    RETURN VALUE

      The member function will return 0 if all went OK, or a non-zero
      error code otherwise.
  */
  virtual int do_before_row_operations(TABLE *table) = 0;

  /*
    Primitive to clean up after a sequence of row executions.

    DESCRIPTION
    
      After doing a sequence of do_prepare_row() and do_exec_row(),
      this member function should be called to clean up and release
      any allocated buffers.
  */
  virtual int do_after_row_operations(TABLE *table, int error) = 0;

  /*
    Primitive to prepare for handling one row in a row-level event.
    
    DESCRIPTION 

      The member function prepares for execution of operations needed for one
      row in a row-level event by reading up data from the buffer containing
      the row. No specific interpretation of the data is normally done here,
      since SQL thread specific data is not available: that data is made
      available for the do_exec function.

      A pointer to the start of the next row, or NULL if the preparation
      failed. Currently, preparation cannot fail, but don't rely on this
      behavior. 

    RETURN VALUE
      Error code, if something went wrong, 0 otherwise.
   */
  virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*,
                             uchar const *row_start,
                             uchar const **row_end) = 0;

  /*
    Primitive to do the actual execution necessary for a row.

    DESCRIPTION
      The member function will do the actual execution needed to handle a row.

    RETURN VALUE
      0 if execution succeeded, 1 if execution failed.
      
  */
  virtual int do_exec_row(TABLE *table) = 0;

#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
};


/**
  @class Write_rows_log_event_old

  Old class for binlog events that write new rows to a table (event
  type code PRE_GA_WRITE_ROWS_EVENT).  Such events are never produced
  by this version of the server, but they may be read from a relay log
  created by an old server.  New servers create events of class
  Write_rows_log_event (event type code WRITE_ROWS_EVENT) instead.
*/
class Write_rows_log_event_old : public Old_rows_log_event
{
  /********** BEGIN CUT & PASTE FROM Write_rows_log_event **********/
public:
#if !defined(MYSQL_CLIENT)
  Write_rows_log_event_old(THD*, TABLE*, ulonglong table_id,
                           MY_BITMAP const *cols, bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
  Write_rows_log_event_old(const uchar *buf, uint event_len,
                           const Format_description_log_event *description_event);
#endif
#if !defined(MYSQL_CLIENT) 
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
                                          bool is_transactional,
                                          const uchar *before_record
                                          __attribute__((unused)),
                                          const uchar *after_record)
  {
    return thd->binlog_write_row(table, is_transactional, after_record);
  }
#endif

private:
#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  int do_before_row_operations(const Slave_reporting_capability *const) override;
  int do_after_row_operations(const Slave_reporting_capability *const,int) override;
  int do_exec_row(rpl_group_info *) override;
#endif
  /********** END OF CUT & PASTE FROM Write_rows_log_event **********/

public:
  enum
  {
    /* Support interface to THD::binlog_prepare_pending_rows_event */
    TYPE_CODE = PRE_GA_WRITE_ROWS_EVENT
  };

private:
  Log_event_type get_type_code() override { return (Log_event_type)TYPE_CODE; }

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  // use old definition of do_apply_event()
  int do_apply_event(rpl_group_info *rgi) override
  { return Old_rows_log_event::do_apply_event(this, rgi); }

  // primitives for old version of do_apply_event()
  int do_before_row_operations(TABLE *table) override;
  int do_after_row_operations(TABLE *table, int error) override;
  virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*,
                             uchar const *row_start, uchar const **row_end) override;
  int do_exec_row(TABLE *table) override;

#endif
};


/**
  @class Update_rows_log_event_old

  Old class for binlog events that modify existing rows to a table
  (event type code PRE_GA_UPDATE_ROWS_EVENT).  Such events are never
  produced by this version of the server, but they may be read from a
  relay log created by an old server.  New servers create events of
  class Update_rows_log_event (event type code UPDATE_ROWS_EVENT)
  instead.
*/
class Update_rows_log_event_old : public Old_rows_log_event
{
  /********** BEGIN CUT & PASTE FROM Update_rows_log_event **********/
public:
#ifndef MYSQL_CLIENT
  Update_rows_log_event_old(THD*, TABLE*, ulonglong table_id,
                            MY_BITMAP const *cols,
                            bool is_transactional);
#endif

#ifdef HAVE_REPLICATION
  Update_rows_log_event_old(const uchar *buf, uint event_len,
                            const Format_description_log_event *description_event);
#endif

#if !defined(MYSQL_CLIENT) 
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
                                          bool is_transactional,
                                          MY_BITMAP *cols,
                                          uint fields,
                                          const uchar *before_record,
                                          const uchar *after_record)
  {
    return thd->binlog_update_row(table, is_transactional,
                                  before_record, after_record);
  }
#endif

protected:
#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  int do_before_row_operations(const Slave_reporting_capability *const) override;
  int do_after_row_operations(const Slave_reporting_capability *const,int) override;
  int do_exec_row(rpl_group_info *) override;
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
  /********** END OF CUT & PASTE FROM Update_rows_log_event **********/

  uchar *m_after_image, *m_memory;
  
public:
  enum 
  {
    /* Support interface to THD::binlog_prepare_pending_rows_event */
    TYPE_CODE = PRE_GA_UPDATE_ROWS_EVENT
  };

private:
  Log_event_type get_type_code() override { return (Log_event_type)TYPE_CODE; }

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  // use old definition of do_apply_event()
  int do_apply_event(rpl_group_info *rgi) override
  { return Old_rows_log_event::do_apply_event(this, rgi); }

  // primitives for old version of do_apply_event()
  int do_before_row_operations(TABLE *table) override;
  int do_after_row_operations(TABLE *table, int error) override;
  virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*,
                             uchar const *row_start, uchar const **row_end) override;
  int do_exec_row(TABLE *table) override;
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
};


/**
  @class Delete_rows_log_event_old

  Old class for binlog events that delete existing rows from a table
  (event type code PRE_GA_DELETE_ROWS_EVENT).  Such events are never
  produced by this version of the server, but they may be read from a
  relay log created by an old server.  New servers create events of
  class Delete_rows_log_event (event type code DELETE_ROWS_EVENT)
  instead.
*/
class Delete_rows_log_event_old : public Old_rows_log_event
{
  /********** BEGIN CUT & PASTE FROM Update_rows_log_event **********/
public:
#ifndef MYSQL_CLIENT
  Delete_rows_log_event_old(THD*, TABLE*, ulonglong,
                            MY_BITMAP const *cols, bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
  Delete_rows_log_event_old(const uchar *buf, uint event_len,
                            const Format_description_log_event *description_event);
#endif
#if !defined(MYSQL_CLIENT) 
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
                                          bool is_transactional,
                                          MY_BITMAP *cols,
                                          uint fields,
                                          const uchar *before_record,
                                          const uchar *after_record
                                          __attribute__((unused)))
  {
    return thd->binlog_delete_row(table, is_transactional, before_record);
  }
#endif
  
protected:
#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  int do_before_row_operations(const Slave_reporting_capability *const) override;
  int do_after_row_operations(const Slave_reporting_capability *const,int) override;
  int do_exec_row(rpl_group_info *) override;
#endif
  /********** END CUT & PASTE FROM Delete_rows_log_event **********/

  uchar *m_after_image, *m_memory;
 
public:
  enum 
  {
    /* Support interface to THD::binlog_prepare_pending_rows_event */
    TYPE_CODE = PRE_GA_DELETE_ROWS_EVENT
  };

private:
  Log_event_type get_type_code() override { return (Log_event_type)TYPE_CODE; }

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  // use old definition of do_apply_event()
  int do_apply_event(rpl_group_info *rgi) override
  { return Old_rows_log_event::do_apply_event(this, rgi); }

  // primitives for old version of do_apply_event()
  int do_before_row_operations(TABLE *table) override;
  int do_after_row_operations(TABLE *table, int error) override;
  virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*,
                             uchar const *row_start, uchar const **row_end) override;
  int do_exec_row(TABLE *table) override;
#endif
};


#endif
server/private/sql_type_string.h000064400000003135150400263720013124 0ustar00/* Copyright (c) 2019 MariaDB

   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-1301  USA */

#ifndef SQL_TYPE_STRING_INCLUDED
#define SQL_TYPE_STRING_INCLUDED

class StringPack
{
  CHARSET_INFO *m_cs;
  uint32 m_octet_length;
  CHARSET_INFO *charset() const { return m_cs; }
  uint mbmaxlen() const { return m_cs->mbmaxlen; };
  uint32 char_length() const { return m_octet_length / mbmaxlen(); }
public:
  StringPack(CHARSET_INFO *cs, uint32 octet_length)
   :m_cs(cs),
    m_octet_length(octet_length)
  { }
  uchar *pack(uchar *to, const uchar *from, uint max_length) const;
  const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
                      uint param_data) const;
public:
  static uint max_packed_col_length(uint max_length)
  {
    return (max_length > 255 ? 2 : 1) + max_length;
  }
  static uint packed_col_length(const uchar *data_ptr, uint length)
  {
    if (length > 255)
      return uint2korr(data_ptr)+2;
    return (uint) *data_ptr + 1;
  }
};


#endif // SQL_TYPE_STRING_INCLUDED
server/private/myisammrg.h000064400000011441150400263720011702 0ustar00/* Copyright (c) 2000-2002, 2004, 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

/* This file should be included when using merge_isam_functions */

#ifndef _myisammrg_h
#define _myisammrg_h
#ifdef	__cplusplus
extern "C" {
#endif

#ifndef _my_base_h
#include <my_base.h>
#endif
#ifndef _myisam_h
#include <myisam.h>
#endif

#include <queues.h>

#define MYRG_NAME_EXT    ".MRG"
#define MYRG_NAME_TMPEXT ".MRG_TMP"

/* In which table to INSERT rows */
#define MERGE_INSERT_DISABLED	0
#define MERGE_INSERT_TO_FIRST	1
#define MERGE_INSERT_TO_LAST	2

extern TYPELIB merge_insert_method;

	/* Param to/from myrg_info */

typedef struct st_mymerge_info		/* Struct from h_info */
{
  ulonglong records;			/* Records in database */
  ulonglong deleted;			/* Deleted records in database */
  ulonglong recpos;			/* Pos for last used record */
  ulonglong data_file_length;
  ulonglong dupp_key_pos;               /* Offset of the Duplicate key in the merge table */
  uint	reclength;			/* Recordlength */
  int	errkey;				/* With key was duplicated on err */
  uint	options;			/* HA_OPTION_... used */
  ulong *rec_per_key;			/* for sql optimizing */
} MYMERGE_INFO;

typedef struct st_myrg_table_info
{
  struct st_myisam_info *table;
  ulonglong file_offset;
} MYRG_TABLE;

typedef struct st_myrg_info
{
  MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
  ulonglong records;			/* records in tables */
  ulonglong del;			/* Removed records */
  ulonglong data_file_length;
  ulong  cache_size;
  uint	 merge_insert_method;
  uint	 tables,options,reclength,keys;
  uint   key_parts;
  my_bool cache_in_use;
  /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */
  my_bool children_attached;
  LIST	 open_list;
  QUEUE  by_key;
  ulong *rec_per_key_part;			/* for sql optimizing */
  mysql_mutex_t mutex;
} MYRG_INFO;


	/* Prototypes for merge-functions */

extern int myrg_close(MYRG_INFO *file);
extern int myrg_delete(MYRG_INFO *file,const uchar *buff);
extern MYRG_INFO *myrg_open(const char *name,int mode,int wait_if_locked);
extern MYRG_INFO *myrg_parent_open(const char *parent_name,
                                   int (*callback)(void*, const char*),
                                   void *callback_param);
extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
                                MI_INFO *(*callback)(void*),
                                void *callback_param,
                                my_bool *need_compat_check);
extern int myrg_detach_children(MYRG_INFO *m_info);
extern int myrg_panic(enum ha_panic_function function);
extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx);
extern int myrg_rlast(MYRG_INFO *file,uchar *buf,int inx);
extern int myrg_rnext(MYRG_INFO *file,uchar *buf,int inx);
extern int myrg_rprev(MYRG_INFO *file,uchar *buf,int inx);
extern int myrg_rnext_same(MYRG_INFO *file,uchar *buf);
extern int myrg_rkey(MYRG_INFO *info,uchar *buf,int inx, const uchar *key,
                     key_part_map keypart_map, enum ha_rkey_function search_flag);
extern int myrg_rrnd(MYRG_INFO *file,uchar *buf,ulonglong pos);
extern int myrg_rsame(MYRG_INFO *file,uchar *record,int inx);
extern int myrg_update(MYRG_INFO *file,const uchar *old,
                       const uchar *new_rec);
extern int myrg_write(MYRG_INFO *info,const uchar *rec);
extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
extern int myrg_create(const char *name, const char **table_names,
                       uint insert_method, my_bool fix_names);
extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
		      void *extra_arg);
extern int myrg_reset(MYRG_INFO *info);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
                                     const key_range *min_key,
                                     const key_range *max_key,
                                     page_range *pages);
extern ha_rows myrg_records(MYRG_INFO *info);

extern ulonglong myrg_position(MYRG_INFO *info);
#ifdef	__cplusplus
}
#endif
#endif
server/private/wsrep_server_state.h000064400000004355150400263720013631 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_SERVER_STATE_H
#define WSREP_SERVER_STATE_H

/* wsrep-lib */
#include "wsrep/server_state.hpp"
#include "wsrep/provider.hpp"

/* implementation */
#include "wsrep_server_service.h"
#include "wsrep_mutex.h"
#include "wsrep_condition_variable.h"

class Wsrep_server_state : public wsrep::server_state
{
public:
  static void init_once(const std::string& name,
                        const std::string& incoming_address,
                        const std::string& address,
                        const std::string& working_dir,
                        const wsrep::gtid& initial_position,
                        int max_protocol_version);
  static void destroy();

  static Wsrep_server_state& instance()
  {
    return *m_instance;
  }

  static bool is_inited()
  {
    return (m_instance != NULL);
  }

  static wsrep::provider& get_provider()
  {
    return instance().provider();
  }

  static bool has_capability(int capability)
  {
    return (get_provider().capabilities() & capability);
  }

  static void handle_fatal_signal();

private:
  Wsrep_server_state(const std::string& name,
                     const std::string& incoming_address,
                     const std::string& address,
                     const std::string& working_dir,
                     const wsrep::gtid& initial_position,
                     int max_protocol_version);
  ~Wsrep_server_state();
  Wsrep_mutex m_mutex;
  Wsrep_condition_variable m_cond;
  Wsrep_server_service m_service;
  static Wsrep_server_state* m_instance;

};

#endif // WSREP_SERVER_STATE_H
server/private/sql_signal.h000064400000006442150400263720012036 0ustar00/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

#ifndef SQL_SIGNAL_H
#define SQL_SIGNAL_H

/**
  Sql_cmd_common_signal represents the common properties of the
  SIGNAL and RESIGNAL statements.
*/
class Sql_cmd_common_signal : public Sql_cmd
{
protected:
  /**
    Constructor.
    @param cond the condition signaled if any, or NULL.
    @param set collection of signal condition item assignments.
  */
  Sql_cmd_common_signal(const sp_condition_value *cond,
                        const Set_signal_information& set)
    : Sql_cmd(),
      m_cond(cond),
      m_set_signal_information(set)
  {}

  virtual ~Sql_cmd_common_signal() = default;

  /**
    Evaluate each signal condition items for this statement.
    @param thd the current thread.
    @param cond the condition to update.
    @return 0 on success.
  */
  int eval_signal_informations(THD *thd, Sql_condition *cond);

  /**
    Raise a SQL condition.
    @param thd the current thread.
    @param cond the condition to raise.
    @return false on success.
  */
  bool raise_condition(THD *thd, Sql_condition *cond);

  /**
    The condition to signal or resignal.
    This member is optional and can be NULL (RESIGNAL).
  */
  const sp_condition_value *m_cond;

  /**
    Collection of 'SET item = value' assignments in the
    SIGNAL/RESIGNAL statement.
  */
  Set_signal_information m_set_signal_information;
};

/**
  Sql_cmd_signal represents a SIGNAL statement.
*/
class Sql_cmd_signal : public Sql_cmd_common_signal
{
public:
  /**
    Constructor, used to represent a SIGNAL statement.
    @param cond the SQL condition to signal (required).
    @param set the collection of signal information to signal.
  */
  Sql_cmd_signal(const sp_condition_value *cond,
                 const Set_signal_information& set)
    : Sql_cmd_common_signal(cond, set)
  {}

  virtual ~Sql_cmd_signal() = default;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_SIGNAL;
  }

  bool execute(THD *thd) override;
};

/**
  Sql_cmd_resignal represents a RESIGNAL statement.
*/
class Sql_cmd_resignal : public Sql_cmd_common_signal
{
public:
  /**
    Constructor, used to represent a RESIGNAL statement.
    @param cond the SQL condition to resignal (optional, may be NULL).
    @param set the collection of signal information to resignal.
  */
  Sql_cmd_resignal(const sp_condition_value *cond,
                   const Set_signal_information& set)
    : Sql_cmd_common_signal(cond, set)
  {}

  virtual ~Sql_cmd_resignal() = default;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_RESIGNAL;
  }

  bool execute(THD *thd) override;
};

#endif

server/private/probes_mysql.h000064400000001715150400263720012417 0ustar00/* Copyright (c) 2008 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

#ifndef PROBES_MYSQL_H

#define PROBES_MYSQL_H

#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)
#include "probes_mysql_dtrace.h"
#else  /* no dtrace */
#include "probes_mysql_nodtrace.h"
#endif
#endif /* PROBES_MYSQL_H */
server/private/ilist.h000064400000015610150400263720011023 0ustar00/*
   Copyright (c) 2019, 2020, MariaDB

   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
*/

#ifndef ILIST_H
#define ILIST_H

#include "my_dbug.h"

#include <cstddef>
#include <iterator>

// Derive your class from this struct to insert to a linked list.
template <class Tag= void> struct ilist_node
{
#ifndef DBUG_OFF
  ilist_node() noexcept : next(NULL), prev(NULL) {}
#else
  ilist_node() = default;
#endif

  ilist_node(ilist_node *next, ilist_node *prev) noexcept
      : next(next), prev(prev)
  {
  }

  ilist_node *next;
  ilist_node *prev;
};

// Modelled after std::list<T>
template <class T, class Tag= void> class ilist
{
public:
  typedef ilist_node<Tag> ListNode;
  class Iterator;

  // All containers in C++ should define these types to implement generic
  // container interface.
  typedef T value_type;
  typedef std::size_t size_type;
  typedef std::ptrdiff_t difference_type;
  typedef value_type &reference;
  typedef const value_type &const_reference;
  typedef T *pointer;
  typedef const T *const_pointer;
  typedef Iterator iterator;
  typedef Iterator const_iterator; /* FIXME */
  typedef std::reverse_iterator<iterator> reverse_iterator;
  typedef std::reverse_iterator<const iterator> const_reverse_iterator;

  class Iterator
  {
  public:
    // All iterators in C++ should define these types to implement generic
    // iterator interface.
    typedef std::bidirectional_iterator_tag iterator_category;
    typedef T value_type;
    typedef std::ptrdiff_t difference_type;
    typedef T *pointer;
    typedef T &reference;

    explicit Iterator(ListNode *node) noexcept : node_(node)
    {
      DBUG_ASSERT(node_ != nullptr);
    }

    Iterator &operator++() noexcept
    {
      node_= node_->next;
      DBUG_ASSERT(node_ != nullptr);
      return *this;
    }
    Iterator operator++(int) noexcept
    {
      Iterator tmp(*this);
      operator++();
      return tmp;
    }

    Iterator &operator--() noexcept
    {
      node_= node_->prev;
      DBUG_ASSERT(node_ != nullptr);
      return *this;
    }
    Iterator operator--(int) noexcept
    {
      Iterator tmp(*this);
      operator--();
      return tmp;
    }

    reference operator*() noexcept { return *static_cast<pointer>(node_); }
    pointer operator->() noexcept { return static_cast<pointer>(node_); }

    friend bool operator==(const Iterator &lhs, const Iterator &rhs) noexcept
    {
      return lhs.node_ == rhs.node_;
    }
    friend bool operator!=(const Iterator &lhs, const Iterator &rhs) noexcept
    {
      return !(lhs == rhs);
    }

  private:
    ListNode *node_;

    friend class ilist;
  };

  ilist() noexcept : sentinel_(&sentinel_, &sentinel_) {}

  reference front() noexcept { return *begin(); }
  reference back() noexcept { return *--end(); }
  const_reference front() const noexcept { return *begin(); }
  const_reference back() const noexcept { return *--end(); }

  iterator begin() noexcept { return iterator(sentinel_.next); }
  const_iterator begin() const noexcept
  {
    return iterator(const_cast<ListNode *>(sentinel_.next));
  }
  iterator end() noexcept { return iterator(&sentinel_); }
  const_iterator end() const noexcept
  {
    return iterator(const_cast<ListNode *>(&sentinel_));
  }

  reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }
  const_reverse_iterator rbegin() const noexcept
  {
    return reverse_iterator(end());
  }
  reverse_iterator rend() noexcept { return reverse_iterator(begin()); }
  const_reverse_iterator rend() const noexcept
  {
    return reverse_iterator(begin());
  }

  bool empty() const noexcept { return sentinel_.next == &sentinel_; }

  // Not implemented because it's O(N)
  // size_type size() const
  // {
  //   return static_cast<size_type>(std::distance(begin(), end()));
  // }

  void clear() noexcept
  {
    sentinel_.next= &sentinel_;
    sentinel_.prev= &sentinel_;
  }

  iterator insert(iterator pos, reference value) noexcept
  {
    ListNode *curr= pos.node_;
    ListNode *prev= pos.node_->prev;

    prev->next= &value;
    curr->prev= &value;

    static_cast<ListNode &>(value).prev= prev;
    static_cast<ListNode &>(value).next= curr;

    return iterator(&value);
  }

  iterator erase(iterator pos) noexcept
  {
    ListNode *prev= pos.node_->prev;
    ListNode *next= pos.node_->next;

    prev->next= next;
    next->prev= prev;

#ifndef DBUG_OFF
    ListNode *curr= pos.node_;
    curr->prev= nullptr;
    curr->next= nullptr;
#endif

    return Iterator(next);
  }

  void push_back(reference value) noexcept { insert(end(), value); }
  void pop_back() noexcept { erase(end()); }

  void push_front(reference value) noexcept { insert(begin(), value); }
  void pop_front() noexcept { erase(begin()); }

  // STL version is O(n) but this is O(1) because an element can't be inserted
  // several times in the same ilist.
  void remove(reference value) noexcept { erase(iterator(&value)); }

private:
  ListNode sentinel_;
};

// Similar to ilist but also has O(1) size() method.
template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
{
  typedef ilist<T, Tag> BASE;

public:
  // All containers in C++ should define these types to implement generic
  // container interface.
  typedef T value_type;
  typedef std::size_t size_type;
  typedef std::ptrdiff_t difference_type;
  typedef value_type &reference;
  typedef const value_type &const_reference;
  typedef T *pointer;
  typedef const T *const_pointer;
  typedef typename BASE::Iterator iterator;
  typedef const typename BASE::Iterator const_iterator;
  typedef std::reverse_iterator<iterator> reverse_iterator;
  typedef std::reverse_iterator<const iterator> const_reverse_iterator;

  sized_ilist() noexcept : size_(0) {}

  size_type size() const noexcept { return size_; }

  void clear() noexcept
  {
    BASE::clear();
    size_= 0;
  }

  iterator insert(iterator pos, reference value) noexcept
  {
    ++size_;
    return BASE::insert(pos, value);
  }

  iterator erase(iterator pos) noexcept
  {
    --size_;
    return BASE::erase(pos);
  }

  void push_back(reference value) noexcept { insert(BASE::end(), value); }
  void pop_back() noexcept { erase(BASE::end()); }

  void push_front(reference value) noexcept { insert(BASE::begin(), value); }
  void pop_front() noexcept { erase(BASE::begin()); }

  void remove(reference value) noexcept { erase(iterator(&value)); }

private:
  size_type size_;
};

#endif
server/private/wsrep_applier.h000064400000005217150400263720012555 0ustar00/* Copyright 2013-2019 Codership Oy <http://www.codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef WSREP_APPLIER_H
#define WSREP_APPLIER_H

#include "sql_class.h" // THD class
#include "rpl_rli.h"   // Relay_log_info
#include "log_event.h" // Format_description_log_event

int wsrep_apply_events(THD*        thd,
                       Relay_log_info* rli,
                       const void* events_buf,
                       size_t      buf_len);

/* Applier error codes, when nothing better is available. */
#define WSREP_RET_SUCCESS      0 // Success
#define WSREP_ERR_GENERIC      1 // When in doubt (MySQL default error code)
#define WSREP_ERR_BAD_EVENT    2 // Can't parse event
#define WSREP_ERR_NOT_FOUND    3 // Key. table, schema not found
#define WSREP_ERR_EXISTS       4 // Key, table, schema already exists
#define WSREP_ERR_WRONG_TYPE   5 // Incompatible data type
#define WSREP_ERR_FAILED       6 // Operation failed for some internal reason
#define WSREP_ERR_ABORTED      7 // Operation was aborted externally

/* Loops over THD diagnostic area and concatenates all error messages
 * and error codes to a single continuous buffer to create a unique
 * but consistent failure signature which provider can use for voting
 * between the nodes in the cluster.
 *
 * @param thd         THD context
 * @param dst         buffer to store the signature
 * @param include_msg whether to use MySQL error message in addition to
 *                    MySQL error code. Note that in the case of a TOI
 *                    operation the message may be not consistent between
 *                    the nodes e.g. due to a different client locale setting
 *                    and should be omitted */
void wsrep_store_error(const THD*             thd,
                       wsrep::mutable_buffer& buf,
                       bool                   include_msg);

class Format_description_log_event;
void wsrep_set_apply_format(THD*, Format_description_log_event*);
Format_description_log_event* wsrep_get_apply_format(THD* thd);

#endif /* WSREP_APPLIER_H */
server/private/sql_debug.h000064400000013016150400263720011642 0ustar00#ifndef SQL_DEBUG_INCLUDED
#define SQL_DEBUG_INCLUDED
/*
   Copyright (c) 2022, MariaDB

   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
*/


class Debug_key: public String
{
public:
  Debug_key() = default;
  void print(THD *thd) const
  {
    push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
                        ER_UNKNOWN_ERROR, "DBUG: %.*s", length(), ptr());
  }

  bool append_key_type(ha_base_keytype type)
  {
    static LEX_CSTRING names[20]=
    {
      {STRING_WITH_LEN("END")},
      {STRING_WITH_LEN("TEXT")},
      {STRING_WITH_LEN("BINARY")},
      {STRING_WITH_LEN("SHORT_INT")},
      {STRING_WITH_LEN("LONG_INT")},
      {STRING_WITH_LEN("FLOAT")},
      {STRING_WITH_LEN("DOUBLE")},
      {STRING_WITH_LEN("NUM")},
      {STRING_WITH_LEN("USHORT_INT")},
      {STRING_WITH_LEN("ULONG_INT")},
      {STRING_WITH_LEN("LONGLONG")},
      {STRING_WITH_LEN("ULONGLONG")},
      {STRING_WITH_LEN("INT24")},
      {STRING_WITH_LEN("UINT24")},
      {STRING_WITH_LEN("INT8")},
      {STRING_WITH_LEN("VARTEXT1")},
      {STRING_WITH_LEN("VARBINARY1")},
      {STRING_WITH_LEN("VARTEXT2")},
      {STRING_WITH_LEN("VARBINARY2")},
      {STRING_WITH_LEN("BIT")}
    };
    if ((uint) type >= array_elements(names))
      return append(STRING_WITH_LEN("???"));
    return append(names[(uint) type]);
  }

  bool append_KEY_flag_names(ulong flags)
  {
    static LEX_CSTRING names[17]=
    {
      {STRING_WITH_LEN("HA_NOSAME")},             // 1
      {STRING_WITH_LEN("HA_PACK_KEY")},           // 2; also in HA_KEYSEG
      {STRING_WITH_LEN("HA_SPACE_PACK_USED")},    // 4
      {STRING_WITH_LEN("HA_VAR_LENGTH_KEY")},     // 8
      {STRING_WITH_LEN("HA_AUTO_KEY")},           // 16
      {STRING_WITH_LEN("HA_BINARY_PACK_KEY")},    // 32
      {STRING_WITH_LEN("HA_NULL_PART_KEY")},      // 64
      {STRING_WITH_LEN("HA_FULLTEXT")},           // 128
      {STRING_WITH_LEN("HA_UNIQUE_CHECK")},       // 256
      {STRING_WITH_LEN("HA_SORT_ALLOWS_SAME")},   // 512
      {STRING_WITH_LEN("HA_SPATIAL")},            // 1024
      {STRING_WITH_LEN("HA_NULL_ARE_EQUAL")},     // 2048
      {STRING_WITH_LEN("HA_USES_COMMENT")},       // 4096
      {STRING_WITH_LEN("HA_GENERATED_KEY")},      // 8192
      {STRING_WITH_LEN("HA_USES_PARSER")},        // 16384
      {STRING_WITH_LEN("HA_USES_BLOCK_SIZE")},    // 32768
      {STRING_WITH_LEN("HA_KEY_HAS_PART_KEY_SEG")}// 65536
    };
    return append_flag32_names((uint) flags, names, array_elements(names));
  }

  bool append_HA_KEYSEG_flag_names(uint32 flags)
  {
    static LEX_CSTRING names[]=
    {
      {STRING_WITH_LEN("HA_SPACE_PACK")},      // 1
      {STRING_WITH_LEN("HA_PACK_KEY")},        // 2; also in KEY/MI/KEY_DEF
      {STRING_WITH_LEN("HA_PART_KEY_SEG")},    // 4
      {STRING_WITH_LEN("HA_VAR_LENGTH_PART")}, // 8
      {STRING_WITH_LEN("HA_NULL_PART")},       // 16
      {STRING_WITH_LEN("HA_BLOB_PART")},       // 32
      {STRING_WITH_LEN("HA_SWAP_KEY")},        // 64
      {STRING_WITH_LEN("HA_REVERSE_SORT")},    // 128
      {STRING_WITH_LEN("HA_NO_SORT")},         // 256
      {STRING_WITH_LEN("??? 512 ???")},        // 512
      {STRING_WITH_LEN("HA_BIT_PART")},        // 1024
      {STRING_WITH_LEN("HA_CAN_MEMCMP")}       // 2048
    };
    return append_flag32_names(flags, names, array_elements(names));
  }

  bool append_HA_KEYSEG_type(ha_base_keytype type)
  {
    return append_ulonglong(type) ||
           append(' ') ||
           append_key_type(type);
  }

  bool append_HA_KEYSEG_flags(uint32 flags)
  {
    return append_hex_uint32(flags) ||
           append(' ') ||
           append_HA_KEYSEG_flag_names(flags);
  }

  bool append_key(const LEX_CSTRING &name, uint32 flags)
  {
    return
      append_name_value(Lex_cstring(STRING_WITH_LEN("name")), name, '`') ||
      append(Lex_cstring(STRING_WITH_LEN(" flags="))) ||
      append_hex_uint32(flags) ||
      append(' ') ||
      append_KEY_flag_names(flags);
  }

  bool append_KEY(const KEY &key)
  {
    return append_key(key.name, key.flags);
  }

  static void print_keysegs(THD *thd, const HA_KEYSEG *seg, uint count)
  {
    for (uint i= 0; i < count; i++)
    {
      Debug_key tmp;
      if (!tmp.append(Lex_cstring(STRING_WITH_LEN("  seg["))) &&
          !tmp.append_ulonglong(i) &&
          !tmp.append(Lex_cstring(STRING_WITH_LEN("].type="))) &&
          !tmp.append_HA_KEYSEG_type((ha_base_keytype) seg[i].type))
        tmp.print(thd);
      tmp.length(0);
      if (!tmp.append(Lex_cstring(STRING_WITH_LEN("  seg["))) &&
          !tmp.append_ulonglong(i) &&
          !tmp.append(Lex_cstring(STRING_WITH_LEN("].flag="))) &&
          !tmp.append_HA_KEYSEG_flags(seg[i].flag))
       tmp.print(thd);
    }
  }

  static void print_keys(THD *thd, const char *where,
                         const KEY *keys, uint key_count)
  {
    for (uint i= 0; i < key_count; i++)
    {
      Debug_key tmp;
      if (!tmp.append(where, strlen(where)) && !tmp.append_KEY(keys[i]))
        tmp.print(thd);
    }
  }
};


#endif // SQL_DEBUG_INCLUDED
server/private/filesort_utils.h000064400000020003150400263720012736 0ustar00/* Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef FILESORT_UTILS_INCLUDED
#define FILESORT_UTILS_INCLUDED

#include "my_base.h"
#include "sql_array.h"

class Sort_param;
/*
  Calculate cost of merge sort

    @param num_rows            Total number of rows.
    @param num_keys_per_buffer Number of keys per buffer.
    @param elem_size           Size of each element.

    Calculates cost of merge sort by simulating call to merge_many_buff().

  @retval
    Computed cost of merge sort in disk seeks.

  @note
    Declared here in order to be able to unit test it,
    since library dependencies have not been sorted out yet.

    See also comments get_merge_many_buffs_cost().
*/

double get_merge_many_buffs_cost_fast(ha_rows num_rows,
                                      ha_rows num_keys_per_buffer,
                                      uint    elem_size);


/**
  A wrapper class around the buffer used by filesort().
  The sort buffer is a contiguous chunk of memory,
  containing both records to be sorted, and pointers to said records:

  <start of buffer       | still unused   |                     end of buffer>
  |rec 0|record 1 |rec 2|  ............  |ptr to rec2|ptr to rec1|ptr to rec0|

  Records will be inserted "left-to-right". Records are not necessarily
  fixed-size, they can be packed and stored without any "gaps".

  Record pointers will be inserted "right-to-left", as a side-effect
  of inserting the actual records.

  We wrap the buffer in order to be able to do lazy initialization of the
  pointers: the buffer is often much larger than what we actually need.

  With this allocation scheme, and lazy initialization of the pointers,
  we are able to pack variable-sized records in the buffer,
  and thus possibly have space for more records than we initially estimated.

  The buffer must be kept available for multiple executions of the
  same sort operation, so we have explicit allocate and free functions,
  rather than doing alloc/free in CTOR/DTOR.
*/

class Filesort_buffer
{
public:
  Filesort_buffer() :
    m_next_rec_ptr(NULL), m_rawmem(NULL), m_record_pointers(NULL),
    m_sort_keys(NULL),
    m_num_records(0), m_record_length(0),
    m_sort_length(0),
    m_size_in_bytes(0), m_idx(0)
  {}

  /** Sort me... */
  void sort_buffer(const Sort_param *param, uint count);

  /**
    Reverses the record pointer array, to avoid recording new results for
    non-deterministic mtr tests.
  */
  void reverse_record_pointers()
  {
    if (m_idx < 2) // There is nothing to swap.
      return;
    uchar **keys= get_sort_keys();
    const longlong count= m_idx - 1;
    for (longlong ix= 0; ix <= count/2; ++ix)
    {
      uchar *tmp= keys[count - ix];
      keys[count - ix] = keys[ix];
      keys[ix]= tmp;
    }
  }

  /**
    Initializes all the record pointers.
  */
  void init_record_pointers()
  {
    init_next_record_pointer();
    while (m_idx < m_num_records)
      (void) get_next_record_pointer();
    reverse_record_pointers();
  }

  /**
    Prepares the buffer for the next batch of records to process.
   */
  void init_next_record_pointer()
  {
    m_idx= 0;
    m_next_rec_ptr= m_rawmem;
    m_sort_keys= NULL;
  }

  /**
    @returns the number of bytes currently in use for data.
   */
  size_t space_used_for_data() const
  {
    return m_next_rec_ptr ? m_next_rec_ptr - m_rawmem : 0;
  }

  /**
    @returns the number of bytes left in the buffer.
  */
  size_t spaceleft() const
  {
    DBUG_ASSERT(m_next_rec_ptr >= m_rawmem);
    const size_t spaceused=
      (m_next_rec_ptr - m_rawmem) +
      (static_cast<size_t>(m_idx) * sizeof(uchar*));
    return m_size_in_bytes - spaceused;
  }

  /**
    Is the buffer full?
  */
  bool isfull() const
  {
    if (m_idx < m_num_records)
      return false;
    return spaceleft() < (m_record_length + sizeof(uchar*));
  }

  /**
    Where should the next record be stored?
   */
  uchar *get_next_record_pointer()
  {
    uchar *retval= m_next_rec_ptr;
    // Save the return value in the record pointer array.
    m_record_pointers[-m_idx]= m_next_rec_ptr;
    // Prepare for the subsequent request.
    m_idx++;
    m_next_rec_ptr+= m_record_length;
    return retval;
  }

  /**
    Adjusts for actual record length. get_next_record_pointer() above was
    pessimistic, and assumed that the record could not be packed.
   */
  void adjust_next_record_pointer(uint val)
  {
    m_next_rec_ptr-= (m_record_length - val);
  }

  /// Returns total size: pointer array + record buffers.
  size_t sort_buffer_size() const
  {
    return m_size_in_bytes;
  }

  bool is_allocated() const
  {
    return m_rawmem;
  }

  /**
    Allocates the buffer, but does *not* initialize pointers.
    Total size = (num_records * record_length) + (num_records * sizeof(pointer))
                  space for records               space for pointer to records
    Caller is responsible for raising an error if allocation fails.

    @param num_records   Number of records.
    @param record_length (maximum) size of each record.
    @returns Pointer to allocated area, or NULL in case of out-of-memory.
  */
  uchar *alloc_sort_buffer(uint num_records, uint record_length);

  /// Frees the buffer.
  void free_sort_buffer();

  void reset()
  {
    m_rawmem= NULL;
  }
  /**
    Used to access the "right-to-left" array of record pointers as an ordinary
    "left-to-right" array, so that we can pass it directly on to std::sort().
  */
  uchar **get_sort_keys()
  {
    if (m_idx == 0)
      return NULL;
    return &m_record_pointers[1 - m_idx];
  }

  /**
    Gets sorted record number ix. @see get_sort_keys()
    Only valid after buffer has been sorted!
  */
  uchar *get_sorted_record(uint ix)
  {
    return m_sort_keys[ix];
  }

  /**
    @returns The entire buffer, as a character array.
    This is for reusing the memory for merge buffers.
   */
  Bounds_checked_array<uchar> get_raw_buf()
  {
    return Bounds_checked_array<uchar>(m_rawmem, m_size_in_bytes);
  }

  /**
    We need an assignment operator, see filesort().
    This happens to have the same semantics as the one that would be
    generated by the compiler.
    Note that this is a shallow copy. We have two objects sharing the same
    array.
  */
  Filesort_buffer &operator=(const Filesort_buffer &rhs) = default;

  uint get_sort_length() const { return m_sort_length; }
  void set_sort_length(uint val) { m_sort_length= val; }

private:
  uchar  *m_next_rec_ptr;    /// The next record will be inserted here.
  uchar  *m_rawmem;          /// The raw memory buffer.
  uchar **m_record_pointers; /// The "right-to-left" array of record pointers.
  uchar **m_sort_keys;       /// Caches the value of get_sort_keys()
  uint    m_num_records;     /// Saved value from alloc_sort_buffer()
  uint    m_record_length;   /// Saved value from alloc_sort_buffer()
  uint    m_sort_length;     /// The length of the sort key.
  size_t  m_size_in_bytes;   /// Size of raw buffer, in bytes.

  /**
    This is the index in the "right-to-left" array of the next record to
    be inserted into the buffer. It is signed, because we use it in signed
    expressions like:
        m_record_pointers[-m_idx];
    It is longlong rather than int, to ensure that it covers UINT_MAX32
    without any casting/warning.
  */
  longlong m_idx;
};

int compare_packed_sort_keys(void *sort_param, const void *a_ptr,
                             const void *b_ptr);
qsort_cmp2 get_packed_keys_compare_ptr();

#endif  // FILESORT_UTILS_INCLUDED
server/private/event_scheduler.h000064400000006332150400263720013057 0ustar00#ifndef _EVENT_SCHEDULER_H_
#define _EVENT_SCHEDULER_H_
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

   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,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @addtogroup Event_Scheduler
  @{
*/
/**
  @file

  Declarations of the scheduler thread class
  and related functionality.

  This file is internal to Event_Scheduler module. Please do not
  include it directly.  All public declarations of Event_Scheduler
  module are in events.h and event_data_objects.h.
*/


class Event_queue;
class Event_job_data;
class Event_db_repository;
class Event_queue_element_for_exec;
class Events;
class THD;

void
pre_init_event_thread(THD* thd);

bool
post_init_event_thread(THD* thd);

void
deinit_event_thread(THD *thd);


class Event_worker_thread
{
public:
  static void
  init(Event_db_repository *db_repository_arg)
  {
    db_repository= db_repository_arg;
  }

  void
  run(THD *thd, Event_queue_element_for_exec *event);

private:
  void
  print_warnings(THD *thd, Event_job_data *et);

  static Event_db_repository *db_repository;
};


class Event_scheduler
{
public:
  Event_scheduler(Event_queue *event_queue_arg);
  ~Event_scheduler();


  /* State changing methods follow */

  bool
  start(int *err_no);

  bool
  stop();

  /*
    Need to be public because has to be called from the function
    passed to pthread_create.
  */
  bool
  run(THD *thd);


  /* Information retrieving methods follow */
  bool
  is_running();

  void
  dump_internal_status();

private:
  uint
  workers_count();

  /* helper functions */
  bool
  execute_top(Event_queue_element_for_exec *event_name);

  /* helper functions for working with mutexes & conditionals */
  void
  lock_data(const char *func, uint line);

  void
  unlock_data(const char *func, uint line);

  void
  cond_wait(THD *thd, struct timespec *abstime, const PSI_stage_info *stage,
            const char *src_func, const char *src_file, uint src_line);

  mysql_mutex_t LOCK_scheduler_state;

  enum enum_state
  {
    INITIALIZED = 0,
    RUNNING,
    STOPPING
  };

  /* This is the current status of the life-cycle of the scheduler. */
  enum enum_state state;

  THD *scheduler_thd;

  mysql_cond_t COND_state;

  Event_queue *queue;

  uint mutex_last_locked_at_line;
  uint mutex_last_unlocked_at_line;
  const char* mutex_last_locked_in_func;
  const char* mutex_last_unlocked_in_func;
  bool mutex_scheduler_data_locked;
  bool waiting_on_cond;

  ulonglong started_events;

private:
  /* Prevent use of these */
  Event_scheduler(const Event_scheduler &);
  void operator=(Event_scheduler &);
};

/**
  @} (End of group Event_Scheduler)
*/

#endif /* _EVENT_SCHEDULER_H_ */
server/private/sql_udf.h000064400000011362150400263720011334 0ustar00#ifndef SQL_UDF_INCLUDED
#define SQL_UDF_INCLUDED

/* Copyright (c) 2000, 2003-2007 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */


/* This file defines structures needed by udf functions */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface
#endif

enum Item_udftype {UDFTYPE_FUNCTION=1,UDFTYPE_AGGREGATE};

typedef void (*Udf_func_clear)(UDF_INIT *, uchar *, uchar *);
typedef void (*Udf_func_add)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *);
typedef void (*Udf_func_deinit)(UDF_INIT*);
typedef my_bool (*Udf_func_init)(UDF_INIT *, UDF_ARGS *,  char *);
typedef void *Udf_func_any;
typedef double (*Udf_func_double)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *);
typedef longlong (*Udf_func_longlong)(UDF_INIT *, UDF_ARGS *, uchar *,
                                      uchar *);

typedef struct st_udf_func
{
  LEX_CSTRING name;
  Item_result returns;
  Item_udftype type;
  const char *dl;
  void *dlhandle;
  Udf_func_any func;
  Udf_func_init func_init;
  Udf_func_deinit func_deinit;
  Udf_func_clear func_clear;
  Udf_func_add func_add;
  Udf_func_add func_remove;
  ulong usage_count;
} udf_func;

class Item_result_field;

class udf_handler :public Sql_alloc
{
 protected:
  udf_func *u_d;
  String *buffers;
  UDF_ARGS f_args;
  UDF_INIT initid;
  char *num_buffer;
  uchar error, is_null;
  bool initialized;
  Item **args;

 public:
  bool not_original;
  udf_handler(udf_func *udf_arg) :u_d(udf_arg), buffers(0), error(0),
    is_null(0), initialized(0), not_original(0)
  {}
  ~udf_handler();
  const char *name() const { return u_d ? u_d->name.str : "?"; }
  Item_result result_type () const
  { return u_d	? u_d->returns : STRING_RESULT;}
  bool get_arguments();
  bool fix_fields(THD *thd, Item_func_or_sum *item,
		  uint arg_count, Item **args);
  void cleanup();
  double val(my_bool *null_value)
  {
    is_null= 0;
    if (get_arguments())
    {
      *null_value=1;
      return 0.0;
    }
    Udf_func_double func= (Udf_func_double) u_d->func;
    double tmp=func(&initid, &f_args, &is_null, &error);
    if (is_null || error)
    {
      *null_value=1;
      return 0.0;
    }
    *null_value=0;
    return tmp;
  }
  longlong val_int(my_bool *null_value)
  {
    is_null= 0;
    if (get_arguments())
    {
      *null_value=1;
      return 0;
    }
    Udf_func_longlong func= (Udf_func_longlong) u_d->func;
    longlong tmp=func(&initid, &f_args, &is_null, &error);
    if (is_null || error)
    {
      *null_value=1;
      return 0;
    }
    *null_value=0;
    return tmp;
  }
  my_decimal *val_decimal(my_bool *null_value, my_decimal *dec_buf);
  void clear()
  {
    is_null= 0;
    Udf_func_clear func= u_d->func_clear;
    func(&initid, &is_null, &error);
  }
  void add(my_bool *null_value)
  {
    if (get_arguments())
    {
      *null_value=1;
      return;
    }
    Udf_func_add func= u_d->func_add;
    func(&initid, &f_args, &is_null, &error);
    *null_value= (my_bool) (is_null || error);
  }
  bool supports_removal() const
  { return MY_TEST(u_d->func_remove); }
  void remove(my_bool *null_value)
  {
    DBUG_ASSERT(u_d->func_remove);
    if (get_arguments())
    {
      *null_value=1;
      return;
    }
    Udf_func_add func= u_d->func_remove;
    func(&initid, &f_args, &is_null, &error);
    *null_value= (my_bool) (is_null || error);
  }
  String *val_str(String *str,String *save_str);

  udf_handler(const udf_handler &orig)
  {
    u_d = orig.u_d;
    buffers = orig.buffers;
    f_args = orig.f_args;
    initid = orig.initid;
    num_buffer = orig.num_buffer;
    error = orig.error;
    is_null = orig.is_null;
    initialized = orig.initialized;
    args = orig.args;
    not_original = true;
  }
};


#ifdef HAVE_DLOPEN
void udf_init(void),udf_free(void);
udf_func *find_udf(const char *name, size_t size, bool mark_used=0);
void free_udf(udf_func *udf);
int mysql_create_function(THD *thd,udf_func *udf);
enum drop_udf_result
{
  UDF_DEL_RESULT_ABSENT,
  UDF_DEL_RESULT_DELETED,
  UDF_DEL_RESULT_ERROR
};
enum drop_udf_result mysql_drop_function(THD *thd, const LEX_CSTRING *name);
#else
static inline void udf_init(void) { }
static inline void udf_free(void) { }
#endif
#endif /* SQL_UDF_INCLUDED */
server/private/my_rdtsc.h000064400000020351150400263720011521 0ustar00/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
   Copyright (c) 2019, 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 */

/*
  rdtsc3 -- multi-platform timer code
  pgulutzan@mysql.com, 2005-08-29
  modified 2008-11-02
*/

#ifndef MY_RDTSC_H
#define MY_RDTSC_H

# ifndef __has_builtin
#  define __has_builtin(x) 0 /* Compatibility with non-clang compilers */
# endif
# if __has_builtin(__builtin_readcyclecounter)
# elif defined _WIN32
#  include <intrin.h>
# elif defined __i386__ || defined __x86_64__
#  include <x86intrin.h>
# elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
#  include <ia64intrin.h>
# elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
#  include <sys/times.h>
# endif

/**
  Characteristics of a timer.
*/
struct my_timer_unit_info
{
  /** Routine used for the timer. */
  ulonglong routine;
  /** Overhead of the timer. */
  ulonglong overhead;
  /** Frequency of the  timer. */
  ulonglong frequency;
  /** Resolution of the timer. */
  ulonglong resolution;
};

/**
  Characteristics of all the supported timers.
  @sa my_timer_init().
*/
struct my_timer_info
{
  /** Characteristics of the cycle timer. */
  struct my_timer_unit_info cycles;
  /** Characteristics of the nanosecond timer. */
  struct my_timer_unit_info nanoseconds;
  /** Characteristics of the microsecond timer. */
  struct my_timer_unit_info microseconds;
  /** Characteristics of the millisecond timer. */
  struct my_timer_unit_info milliseconds;
  /** Characteristics of the tick timer. */
  struct my_timer_unit_info ticks;
};

typedef struct my_timer_info MY_TIMER_INFO;

C_MODE_START

/**
  A cycle timer.

  On clang we use __builtin_readcyclecounter(), except for AARCH64.
  On other compilers:

  On IA-32 and AMD64, we use the RDTSC instruction.
  On IA-64, we read the ar.itc register.
  On SPARC, we read the tick register.
  On POWER, we read the Time Base Register (which is not really a cycle count
  but a separate counter with less than nanosecond resolution).
  On IBM S/390 System z we use the STCK instruction.
  On ARM, we probably should use the Generic Timer, but should figure out
  how to ensure that it can be accessed.
  On AARCH64, we use the generic timer base register. We override clang
  implementation for aarch64 as it access a PMU register which is not
  guaranteed to be active.

  Sadly, we have nothing for the Digital Alpha, MIPS, Motorola m68k,
  HP PA-RISC or other non-mainstream (or obsolete) processors.

  TODO: consider C++11 std::chrono::high_resolution_clock.

  We fall back to gethrtime() where available.

  On the platforms that do not have a CYCLE timer,
  "wait" events are initialized to use NANOSECOND instead of CYCLE
  during performance_schema initialization (at the server startup).

  Linux performance monitor (see "man perf_event_open") can
  provide cycle counter on the platforms that do not have
  other kinds of cycle counters. But we don't use it so far.

  ARM notes
  ---------
  During tests on ARMv7 Debian, perf_even_open() based cycle counter provided
  too low frequency with too high overhead:
  MariaDB [performance_schema]> SELECT * FROM performance_timers;
  +-------------+-----------------+------------------+----------------+
  | TIMER_NAME  | TIMER_FREQUENCY | TIMER_RESOLUTION | TIMER_OVERHEAD |
  +-------------+-----------------+------------------+----------------+
  | CYCLE       | 689368159       | 1                | 970            |
  | NANOSECOND  | 1000000000      | 1                | 308            |
  | MICROSECOND | 1000000         | 1                | 417            |
  | MILLISECOND | 1000            | 1000             | 407            |
  | TICK        | 127             | 1                | 612            |
  +-------------+-----------------+------------------+----------------+
  Therefore, it was decided not to use perf_even_open() on ARM
  (i.e. go without CYCLE and have "wait" events use NANOSECOND by default).

  @return the current timer value, in cycles.
*/
static inline ulonglong my_timer_cycles(void)
{
# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
  return __builtin_readcyclecounter();
# elif defined _M_IX86  || defined _M_X64  || defined __i386__ || defined __x86_64__
  return __rdtsc();
#elif defined _M_ARM64
  return _ReadStatusReg(ARM64_CNTVCT);
# elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
  return (ulonglong) __getReg(_IA64_REG_AR_ITC); /* (3116) */
#elif defined(__GNUC__) && defined(__ia64__)
  {
    ulonglong result;
    __asm __volatile__ ("mov %0=ar.itc" : "=r" (result));
    return result;
  }
#elif defined __GNUC__ && defined __powerpc__
  return __builtin_ppc_get_timebase();
#elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64)
  {
    ulonglong result;
    __asm __volatile__ ("rd %%tick,%0" : "=r" (result));
    return result;
  }
#elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64)
  {
      union {
              ulonglong wholeresult;
              struct {
                      ulong high;
                      ulong low;
              }       splitresult;
      } result;
    __asm __volatile__ ("rd %%tick,%1; srlx %1,32,%0" : "=r" (result.splitresult.high), "=r" (result.splitresult.low));
    return result.wholeresult;
  }
#elif defined(__GNUC__) && defined(__s390__)
  /* covers both s390 and s390x */
  {
    ulonglong result;
    __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
    return result;
  }
#elif defined(__GNUC__) && defined (__aarch64__)
  {
    ulonglong result;
    __asm __volatile("mrs	%0, CNTVCT_EL0" : "=&r" (result));
    return result;
  }
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
  /* gethrtime may appear as either cycle or nanosecond counter */
  return (ulonglong) gethrtime();
#else
# define MY_TIMER_CYCLES_IS_ZERO
  return 0;
#endif
}

#ifdef MY_TIMER_CYCLES_IS_ZERO
static inline size_t my_pseudo_random(void)
{
  /* In some platforms, pthread_self() might return a structure
  that cannot be converted to a number like this. Possible alternatives
  could include gettid() or sched_getcpu(). */
  return ((size_t) pthread_self()) / 16;
}
#else
# define my_pseudo_random my_timer_cycles
#endif

/**
  A nanosecond timer.
  @return the current timer value, in nanoseconds.
*/
ulonglong my_timer_nanoseconds(void);

/**
  A microseconds timer.
  @return the current timer value, in microseconds.
*/
ulonglong my_timer_microseconds(void);

/**
  A millisecond timer.
  @return the current timer value, in milliseconds.
*/
ulonglong my_timer_milliseconds(void);

/**
  A ticks timer.
  @return the current timer value, in ticks.
*/
ulonglong my_timer_ticks(void);

/**
  Timer initialization function.
  @param [out] mti the timer characteristics.
*/
void my_timer_init(MY_TIMER_INFO *mti);

C_MODE_END

#define MY_TIMER_ROUTINE_RDTSC                    5
#define MY_TIMER_ROUTINE_ASM_IA64                 6
#define MY_TIMER_ROUTINE_PPC_GET_TIMEBASE         7
#define MY_TIMER_ROUTINE_GETHRTIME                9
#define MY_TIMER_ROUTINE_READ_REAL_TIME          10
#define MY_TIMER_ROUTINE_CLOCK_GETTIME           11
#define MY_TIMER_ROUTINE_GETTIMEOFDAY            13
#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14
#define MY_TIMER_ROUTINE_GETTICKCOUNT            15
#define MY_TIMER_ROUTINE_TIME                    16
#define MY_TIMER_ROUTINE_TIMES                   17
#define MY_TIMER_ROUTINE_FTIME                   18
#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64         23
#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32         24
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME      25
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_S390                28
#define MY_TIMER_ROUTINE_AARCH64                 29

#endif

server/private/sql_statistics.h000064400000030246150400263720012752 0ustar00/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.

   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 */

#ifndef SQL_STATISTICS_H
#define SQL_STATISTICS_H

/*
  For COMPLEMENTARY_FOR_QUERIES and PREFERABLY_FOR_QUERIES they are
  similar to the COMPLEMENTARY and PREFERABLY respectively except that
  with these values we would not be collecting EITS for queries like
    ANALYZE TABLE t1;
  To collect EITS with these values, we have to use PERSISITENT FOR
  analyze table t1 persistent for
     columns (col1,col2...) index (idx1, idx2...)
     or
  analyze table t1 persistent for all
*/

typedef
enum enum_use_stat_tables_mode
{
  NEVER,
  COMPLEMENTARY,
  PREFERABLY,
  COMPLEMENTARY_FOR_QUERIES,
  PREFERABLY_FOR_QUERIES
} Use_stat_tables_mode;

typedef
enum enum_histogram_type
{
  SINGLE_PREC_HB,
  DOUBLE_PREC_HB
} Histogram_type;

enum enum_stat_tables
{
  TABLE_STAT,
  COLUMN_STAT,
  INDEX_STAT,
};


/* 
  These enumeration types comprise the dictionary of three
  statistical tables table_stat, column_stat and index_stat
  as they defined in ../scripts/mysql_system_tables.sql.

  It would be nice if the declarations of these types were
  generated automatically by the table definitions.   
*/

enum enum_table_stat_col
{
  TABLE_STAT_DB_NAME,
  TABLE_STAT_TABLE_NAME,
  TABLE_STAT_CARDINALITY,
  TABLE_STAT_N_FIELDS
};

enum enum_column_stat_col
{
  COLUMN_STAT_DB_NAME,
  COLUMN_STAT_TABLE_NAME,
  COLUMN_STAT_COLUMN_NAME,
  COLUMN_STAT_MIN_VALUE,
  COLUMN_STAT_MAX_VALUE,
  COLUMN_STAT_NULLS_RATIO,
  COLUMN_STAT_AVG_LENGTH,
  COLUMN_STAT_AVG_FREQUENCY,
  COLUMN_STAT_HIST_SIZE,
  COLUMN_STAT_HIST_TYPE,
  COLUMN_STAT_HISTOGRAM,
  COLUMN_STAT_N_FIELDS
};

enum enum_index_stat_col
{
  INDEX_STAT_DB_NAME,
  INDEX_STAT_TABLE_NAME,
  INDEX_STAT_INDEX_NAME,
  INDEX_STAT_PREFIX_ARITY,
  INDEX_STAT_AVG_FREQUENCY,
  INDEX_STAT_N_FIELDS
};

inline
Use_stat_tables_mode get_use_stat_tables_mode(THD *thd)
{ 
  return (Use_stat_tables_mode) (thd->variables.use_stat_tables);
}
inline
bool check_eits_collection_allowed(THD *thd)
{
  return (get_use_stat_tables_mode(thd) == COMPLEMENTARY ||
          get_use_stat_tables_mode(thd) == PREFERABLY);
}

inline
bool check_eits_preferred(THD *thd)
{
  return (get_use_stat_tables_mode(thd) == PREFERABLY ||
          get_use_stat_tables_mode(thd) == PREFERABLY_FOR_QUERIES);
}

int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables);
int read_statistics_for_tables(THD *thd, TABLE_LIST *tables,
                               bool force_reload);
int collect_statistics_for_table(THD *thd, TABLE *table);
int alloc_statistics_for_table(THD *thd, TABLE *table, MY_BITMAP *stat_fields);
int update_statistics_for_table(THD *thd, TABLE *table);
int delete_statistics_for_table(THD *thd, const LEX_CSTRING *db,
                                const LEX_CSTRING *tab);
int delete_statistics_for_column(THD *thd, TABLE *tab, Field *col);
int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info,
                                bool ext_prefixes_only);
int rename_table_in_stat_tables(THD *thd, const LEX_CSTRING *db,
                                const LEX_CSTRING *tab,
                                const LEX_CSTRING *new_db,
                                const LEX_CSTRING *new_tab);
int rename_columns_in_stat_table(THD *thd, TABLE *tab,
                                 List<Alter_info::RENAME_COLUMN_STAT_PARAMS> *fields);
int rename_indexes_in_stat_table(THD *thd, TABLE *tab,
                                 List<Alter_info::RENAME_INDEX_STAT_PARAMS> *indexes);
void set_statistics_for_table(THD *thd, TABLE *table);

double get_column_avg_frequency(Field * field);

double get_column_range_cardinality(Field *field,
                                    key_range *min_endp,
                                    key_range *max_endp,
                                    uint range_flag);
bool is_stat_table(const LEX_CSTRING *db, LEX_CSTRING *table);
bool is_eits_usable(Field* field);

class Histogram
{

private:
  Histogram_type type;
  uint8 size; /* Size of values array, in bytes */
  uchar *values;

  uint prec_factor()
  {
    switch (type) {
    case SINGLE_PREC_HB:
      return ((uint) (1 << 8) - 1);
    case DOUBLE_PREC_HB:
      return ((uint) (1 << 16) - 1);
    }
    return 1;
  }

public:
  uint get_width()
  {
    switch (type) {
    case SINGLE_PREC_HB:
      return size;
    case DOUBLE_PREC_HB:
      return size / 2;
    }
    return 0;
  }

private:
  uint get_value(uint i)
  {
    DBUG_ASSERT(i < get_width());
    switch (type) {
    case SINGLE_PREC_HB:
      return (uint) (((uint8 *) values)[i]);
    case DOUBLE_PREC_HB:
      return (uint) uint2korr(values + i * 2);
    }
    return 0;
  }

  /* Find the bucket which value 'pos' falls into. */
  uint find_bucket(double pos, bool first)
  {
    uint val= (uint) (pos * prec_factor());
    int lp= 0;
    int rp= get_width() - 1;
    int d= get_width() / 2;
    uint i= lp + d;
    for ( ; d;  d= (rp - lp) / 2, i= lp + d)
    {
      if (val == get_value(i))
	break; 
      if (val < get_value(i))
        rp= i;
      else if (val > get_value(i + 1))
        lp= i + 1;
      else
        break;
    }

    if (val > get_value(i) && i < (get_width() - 1))
      i++;

    if (val == get_value(i))
    {
      if (first)
      {
        while(i && val == get_value(i - 1))
          i--;
      }
      else
      {
        while(i + 1 < get_width() && val == get_value(i + 1))
          i++;
      }
    }
    return i;
  }

public:

  uint get_size() { return (uint) size; }

  Histogram_type get_type() { return type; }

  uchar *get_values() { return (uchar *) values; }

  void set_size (ulonglong sz) { size= (uint8) sz; }

  void set_type (Histogram_type t) { type= t; }

  void set_values (uchar *vals) { values= (uchar *) vals; }

  bool is_available() { return get_size() > 0 && get_values(); }

  /*
    This function checks that histograms should be usable only when
      1) the level of optimizer_use_condition_selectivity > 3
      2) histograms have been collected
  */
  bool is_usable(THD *thd)
  {
    return thd->variables.optimizer_use_condition_selectivity > 3 &&
           is_available();
  }

  void set_value(uint i, double val)
  {
    switch (type) {
    case SINGLE_PREC_HB:   
      ((uint8 *) values)[i]= (uint8) (val * prec_factor());
      return;
    case DOUBLE_PREC_HB:
      int2store(values + i * 2, val * prec_factor());
      return;
    }
  }

  void set_prev_value(uint i)
  {
    switch (type) {
    case SINGLE_PREC_HB:   
      ((uint8 *) values)[i]= ((uint8 *) values)[i-1];
      return;
    case DOUBLE_PREC_HB:
      int2store(values + i * 2, uint2korr(values + i * 2 - 2));
      return;
    }
  }

  double range_selectivity(double min_pos, double max_pos)
  {
    double sel;
    double bucket_sel= 1.0/(get_width() + 1);  
    uint min= find_bucket(min_pos, TRUE);
    uint max= find_bucket(max_pos, FALSE);
    sel= bucket_sel * (max - min + 1);
    return sel;
  } 
  
  /*
    Estimate selectivity of "col=const" using a histogram
  */
  double point_selectivity(double pos, double avg_sel);
};


class Columns_statistics;
class Index_statistics;

/* Statistical data on a table */

class Table_statistics
{

public:
  my_bool cardinality_is_null;      /* TRUE if the cardinality is unknown */
  ha_rows cardinality;              /* Number of rows in the table        */
  uchar *min_max_record_buffers;    /* Record buffers for min/max values  */
  Column_statistics *column_stats;  /* Array of statistical data for columns */
  Index_statistics *index_stats;    /* Array of statistical data for indexes */

  /* Array of records per key for index prefixes */
  ulonglong *idx_avg_frequency;
  uchar *histograms;                /* Sequence of histograms */
};


/* 
  Statistical data on a column 

  Note: objects of this class may be "empty", where they have almost all fields
  as zeros, for example, get_avg_frequency() will return 0.

  objects are allocated in alloc_statistics_for_table[_share].
*/

class Column_statistics
{

private:
  static const uint Scale_factor_nulls_ratio= 100000;
  static const uint Scale_factor_avg_length= 100000;
  static const uint Scale_factor_avg_frequency= 100000;

public:
  /* 
    Bitmap indicating  what statistical characteristics
    are available for the column
  */
  uint32 column_stat_nulls;
  
  /* For the below two, see comments in get_column_range_cardinality() */
  /* Minimum value for the column */
  Field *min_value; 
  /* Maximum value for the column */   
  Field *max_value;

private:

  /* 
    The ratio Z/N multiplied by the scale factor Scale_factor_nulls_ratio,
    where 
      N is the total number of rows,
      Z is the number of nulls in the column
  */
  ulong nulls_ratio;
 
  /*
    Average number of bytes occupied by the representation of a
    value of the column in memory buffers such as join buffer
    multiplied by the scale factor Scale_factor_avg_length.
    CHAR values are stripped of trailing spaces.
    Flexible values are stripped of their length prefixes.
  */
  ulonglong avg_length;

  /*
    The ratio N/D multiplied by the scale factor Scale_factor_avg_frequency,
    where
       N is the number of rows with not null value in the column,
       D the number of distinct values among them
  */
  ulonglong avg_frequency;

public:

  Histogram histogram;

  uint32 no_values_provided_bitmap()
  {
    return
     ((1 << (COLUMN_STAT_HISTOGRAM-COLUMN_STAT_COLUMN_NAME))-1) <<
      (COLUMN_STAT_COLUMN_NAME+1);
  }
 
  void set_all_nulls()
  {
    column_stat_nulls= no_values_provided_bitmap();
  }

  void set_not_null(uint stat_field_no)
  {
    column_stat_nulls&= ~(1 << stat_field_no);
  }

  bool is_null(uint stat_field_no)
  {
    return MY_TEST(column_stat_nulls & (1 << stat_field_no));
  }

  double get_nulls_ratio()
  {
    return (double) nulls_ratio /  Scale_factor_nulls_ratio;
  }

  double get_avg_length()
  {
    return (double) avg_length / Scale_factor_avg_length;
  }

  double get_avg_frequency()
  {
    return (double) avg_frequency / Scale_factor_avg_frequency;
  }

  void set_nulls_ratio (double val)
  {
    nulls_ratio= (ulong) (val * Scale_factor_nulls_ratio);
  }

  void set_avg_length (double val)
  {
    avg_length= (ulonglong) (val * Scale_factor_avg_length);
  }

  void set_avg_frequency (double val)
  {
    avg_frequency= (ulonglong) (val * Scale_factor_avg_frequency);
  }

  bool min_max_values_are_provided()
  {
    return !is_null(COLUMN_STAT_MIN_VALUE) && 
      !is_null(COLUMN_STAT_MAX_VALUE);
  }
  /*
    This function checks whether the values for the fields of the statistical
    tables that were NULL by DEFAULT for a column have changed or not.

    @retval
    TRUE: Statistics are not present for a column
    FALSE: Statisitics are present for a column
  */
  bool no_stat_values_provided()
  {
    return (column_stat_nulls == no_values_provided_bitmap());
  }
};


/* Statistical data on an index prefixes */

class Index_statistics
{

private:
  static const uint Scale_factor_avg_frequency= 100000;
  /*
    The k-th element of this array contains the ratio N/D
    multiplied by the scale factor Scale_factor_avg_frequency, 
    where N is the number of index entries without nulls 
    in the first k components, and D is the number of distinct
    k-component prefixes among them 
  */
  ulonglong *avg_frequency;

public:

  void init_avg_frequency(ulonglong *ptr) { avg_frequency= ptr; }

  bool avg_frequency_is_inited() { return avg_frequency != NULL; }

  double get_avg_frequency(uint i) const
  {
    return (double) avg_frequency[i] / Scale_factor_avg_frequency;
  }

  void set_avg_frequency(uint i, double val)
  {
    avg_frequency[i]= (ulonglong) (val * Scale_factor_avg_frequency);
  }

};

#endif /* SQL_STATISTICS_H */
server/private/pfs_thread_provider.h000064400000012670150400263720013733 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_THREAD_PROVIDER_H
#define PFS_THREAD_PROVIDER_H

/**
  @file include/pfs_thread_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_THREAD_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_MUTEX_CALL(M) pfs_ ## M ## _v1
#define PSI_RWLOCK_CALL(M) pfs_ ## M ## _v1
#define PSI_COND_CALL(M) pfs_ ## M ## _v1
#define PSI_THREAD_CALL(M) pfs_ ## M ## _v1

C_MODE_START

void pfs_register_mutex_v1(const char *category,
                           PSI_mutex_info_v1 *info,
                           int count);

void pfs_register_rwlock_v1(const char *category,
                            PSI_rwlock_info_v1 *info,
                            int count);

void pfs_register_cond_v1(const char *category,
                          PSI_cond_info_v1 *info,
                          int count);

void pfs_register_thread_v1(const char *category,
                            PSI_thread_info_v1 *info,
                            int count);

PSI_mutex*
pfs_init_mutex_v1(PSI_mutex_key key, void *identity);

void pfs_destroy_mutex_v1(PSI_mutex* mutex);

PSI_rwlock*
pfs_init_rwlock_v1(PSI_rwlock_key key, void *identity);

void pfs_destroy_rwlock_v1(PSI_rwlock* rwlock);

PSI_cond*
pfs_init_cond_v1(PSI_cond_key key, void *identity);

void pfs_destroy_cond_v1(PSI_cond* cond);

int pfs_spawn_thread_v1(PSI_thread_key key,
                        pthread_t *thread, const pthread_attr_t *attr,
                        void *(*start_routine)(void*), void *arg);

PSI_thread*
pfs_new_thread_v1(PSI_thread_key key, const void *identity, ulonglong processlist_id);

void pfs_set_thread_id_v1(PSI_thread *thread, ulonglong processlist_id);
void pfs_set_thread_THD_v1(PSI_thread *thread, THD *thd);
void pfs_set_thread_os_id_v1(PSI_thread *thread);

PSI_thread*
pfs_get_thread_v1(void);

void pfs_set_thread_user_v1(const char *user, int user_len);

void pfs_set_thread_account_v1(const char *user, int user_len,
                               const char *host, int host_len);

void pfs_set_thread_db_v1(const char* db, int db_len);

void pfs_set_thread_command_v1(int command);

void pfs_set_thread_start_time_v1(time_t start_time);

void pfs_set_thread_state_v1(const char* state);

void pfs_set_connection_type_v1(opaque_vio_type conn_type);

void pfs_set_thread_info_v1(const char* info, uint info_len);

void pfs_set_thread_v1(PSI_thread* thread);

void pfs_set_thread_peer_port_v1(PSI_thread *thread, uint port);

void pfs_delete_current_thread_v1(void);

void pfs_delete_thread_v1(PSI_thread *thread);

PSI_mutex_locker*
pfs_start_mutex_wait_v1(PSI_mutex_locker_state *state,
                        PSI_mutex *mutex, PSI_mutex_operation op,
                        const char *src_file, uint src_line);

PSI_rwlock_locker*
pfs_start_rwlock_rdwait_v1(PSI_rwlock_locker_state *state,
                           PSI_rwlock *rwlock,
                           PSI_rwlock_operation op,
                           const char *src_file, uint src_line);

PSI_rwlock_locker*
pfs_start_rwlock_wrwait_v1(PSI_rwlock_locker_state *state,
                           PSI_rwlock *rwlock,
                           PSI_rwlock_operation op,
                           const char *src_file, uint src_line);

PSI_cond_locker*
pfs_start_cond_wait_v1(PSI_cond_locker_state *state,
                       PSI_cond *cond, PSI_mutex *mutex,
                       PSI_cond_operation op,
                       const char *src_file, uint src_line);

PSI_table_locker*
pfs_start_table_io_wait_v1(PSI_table_locker_state *state,
                           PSI_table *table,
                           PSI_table_io_operation op,
                           uint index,
                           const char *src_file, uint src_line);

PSI_table_locker*
pfs_start_table_lock_wait_v1(PSI_table_locker_state *state,
                             PSI_table *table,
                             PSI_table_lock_operation op,
                             ulong op_flags,
                             const char *src_file, uint src_line);

void pfs_unlock_mutex_v1(PSI_mutex *mutex);

void pfs_unlock_rwlock_v1(PSI_rwlock *rwlock);

void pfs_signal_cond_v1(PSI_cond* cond);

void pfs_broadcast_cond_v1(PSI_cond* cond);

void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc);

void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc);

void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc);

void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc);

int pfs_set_thread_connect_attrs_v1(const char *buffer, uint length,
                                      const void *from_cs);

C_MODE_END

#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_THREAD_INTERFACE */

#endif

server/private/sql_type.h000064400001101015150400263720011533 0ustar00#ifndef SQL_TYPE_H_INCLUDED
#define SQL_TYPE_H_INCLUDED
/*
   Copyright (c) 2015  MariaDB Foundation.
   Copyright (c) 2015, 2022, 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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif


#include "mysqld.h"
#include "lex_string.h"
#include "sql_array.h"
#include "sql_const.h"
#include "sql_time.h"
#include "sql_type_string.h"
#include "sql_type_real.h"
#include "compat56.h"
#include "log_event_data_type.h"

C_MODE_START
#include <ma_dyncol.h>
C_MODE_END

class Field;
class Column_definition;
class Column_definition_attributes;
class Key_part_spec;
class Item;
class Item_const;
class Item_literal;
class Item_param;
class Item_cache;
class Item_copy;
class Item_func_or_sum;
class Item_sum;
class Item_sum_hybrid;
class Item_sum_sum;
class Item_sum_avg;
class Item_sum_variance;
class Item_func_hex;
class Item_hybrid_func;
class Item_func_min_max;
class Item_func_hybrid_field_type;
class Item_bool_func2;
class Item_bool_rowready_func2;
class Item_func_between;
class Item_func_in;
class Item_func_round;
class Item_func_int_val;
class Item_func_abs;
class Item_func_neg;
class Item_func_signed;
class Item_func_unsigned;
class Item_double_typecast;
class Item_float_typecast;
class Item_decimal_typecast;
class Item_char_typecast;
class Item_time_typecast;
class Item_date_typecast;
class Item_datetime_typecast;
class Item_func_plus;
class Item_func_minus;
class Item_func_mul;
class Item_func_div;
class Item_func_mod;
class Item_type_holder;
class cmp_item;
class in_vector;
class Type_handler_data;
class Type_handler_hybrid_field_type;
class Sort_param;
class Arg_comparator;
class Spvar_definition;
class st_value;
class Protocol;
class handler;
struct TABLE;
struct SORT_FIELD_ATTR;
struct SORT_FIELD;
class Vers_history_point;
class Virtual_column_info;
class Conv_source;
class ST_FIELD_INFO;
class Type_collection;
class Create_func;

#define my_charset_numeric      my_charset_latin1

enum protocol_send_type_t
{
  PROTOCOL_SEND_STRING,
  PROTOCOL_SEND_FLOAT,
  PROTOCOL_SEND_DOUBLE,
  PROTOCOL_SEND_TINY,
  PROTOCOL_SEND_SHORT,
  PROTOCOL_SEND_LONG,
  PROTOCOL_SEND_LONGLONG,
  PROTOCOL_SEND_DATETIME,
  PROTOCOL_SEND_DATE,
  PROTOCOL_SEND_TIME
};


enum scalar_comparison_op
{
  SCALAR_CMP_EQ,
  SCALAR_CMP_EQUAL,
  SCALAR_CMP_LT,
  SCALAR_CMP_LE,
  SCALAR_CMP_GE,
  SCALAR_CMP_GT
};


/*
  This enum is intentionally defined as "class" to disallow its implicit
  cast as "bool". This is needed to avoid pre-MDEV-32203 constructs like:
    if (field->can_optimize_range(...))
      do_optimization();
  to merge automatically as such - that would change the meaning
  to the opposite. The pre-MDEV-32203 code must to be changed to:
    if (field->can_optimize_range(...) == Data_type_compatibility::OK)
      do_optimization();
*/
enum class Data_type_compatibility
{
  OK,
  INCOMPATIBLE_DATA_TYPE,
  INCOMPATIBLE_COLLATION
};


static inline const LEX_CSTRING
scalar_comparison_op_to_lex_cstring(scalar_comparison_op op)
{
  switch (op) {
  case SCALAR_CMP_EQ:    return LEX_CSTRING{STRING_WITH_LEN("=")};
  case SCALAR_CMP_EQUAL: return LEX_CSTRING{STRING_WITH_LEN("<=>")};
  case SCALAR_CMP_LT:    return LEX_CSTRING{STRING_WITH_LEN("<")};
  case SCALAR_CMP_LE:    return LEX_CSTRING{STRING_WITH_LEN("<=")};
  case SCALAR_CMP_GE:    return LEX_CSTRING{STRING_WITH_LEN(">=")};
  case SCALAR_CMP_GT:    return LEX_CSTRING{STRING_WITH_LEN(">")};
  }
  DBUG_ASSERT(0);
  return LEX_CSTRING{STRING_WITH_LEN("<?>")};
}


class Hasher
{
  ulong m_nr1;
  ulong m_nr2;
public:
  Hasher(): m_nr1(1), m_nr2(4)
  { }
  void add_null()
  {
    m_nr1^= (m_nr1 << 1) | 1;
  }
  void add(CHARSET_INFO *cs, const uchar *str, size_t length)
  {
    cs->coll->hash_sort(cs, str, length, &m_nr1, &m_nr2);
  }
  void add(CHARSET_INFO *cs, const char *str, size_t length)
  {
    add(cs, (const uchar *) str, length);
  }
  uint32 finalize() const
  {
    return (uint32) m_nr1;
  }
};


enum partition_value_print_mode_t
{
  PARTITION_VALUE_PRINT_MODE_SHOW= 0,
  PARTITION_VALUE_PRINT_MODE_FRM= 1
};


enum column_definition_type_t
{
  COLUMN_DEFINITION_TABLE_FIELD,
  COLUMN_DEFINITION_ROUTINE_PARAM,
  COLUMN_DEFINITION_ROUTINE_LOCAL,
  COLUMN_DEFINITION_FUNCTION_RETURN
};


class Send_field_extended_metadata
{
  LEX_CSTRING m_attr[MARIADB_FIELD_ATTR_LAST+1];
public:
  Send_field_extended_metadata()
  {
    bzero(this, sizeof(*this));
  }
  bool set_data_type_name(const LEX_CSTRING &str)
  {
    m_attr[MARIADB_FIELD_ATTR_DATA_TYPE_NAME]= str;
    return false;
  }
  bool set_format_name(const LEX_CSTRING &str)
  {
    m_attr[MARIADB_FIELD_ATTR_FORMAT_NAME]= str;
    return false;
  }
  bool has_extended_metadata() const
  {
    for (uint i= 0; i <= MARIADB_FIELD_ATTR_LAST; i++)
    {
      if (m_attr[i].str)
        return true;
    }
    return false;
  }
  const LEX_CSTRING &attr(uint i) const
  {
    DBUG_ASSERT(i <= MARIADB_FIELD_ATTR_LAST);
    return m_attr[i];
  }
};


class Data_type_statistics
{
public:
  uint m_uneven_bit_length;
  uint m_fixed_string_total_length;
  uint m_fixed_string_count;
  uint m_variable_string_total_length;
  uint m_variable_string_count;
  uint m_blob_count;
  Data_type_statistics()
   :m_uneven_bit_length(0),
    m_fixed_string_total_length(0),
    m_fixed_string_count(0),
    m_variable_string_total_length(0),
    m_variable_string_count(0),
    m_blob_count(0)
  { }
  uint string_count() const
  {
    return m_fixed_string_count + m_variable_string_count;
  }
  uint string_total_length() const
  {
    return m_fixed_string_total_length + m_variable_string_total_length;
  }
};


class Typelib: public TYPELIB
{
public:
  Typelib(uint count, const char **type_names, unsigned int *type_lengths)
  {
    TYPELIB::count= count;
    TYPELIB::name= "";
    TYPELIB::type_names= type_names;
    TYPELIB::type_lengths= type_lengths;
  }
  uint max_octet_length() const
  {
    uint max_length= 0;
    for (uint i= 0; i < TYPELIB::count; i++)
    {
      const uint length= TYPELIB::type_lengths[i];
      set_if_bigger(max_length, length);
    }
    return max_length;
  }
};


template<uint sz>
class TypelibBuffer: public Typelib
{
  const char *m_type_names[sz + 1];
  uint m_type_lengths[sz + 1];
public:
  TypelibBuffer(uint count, const LEX_CSTRING *values)
   :Typelib(count, m_type_names, m_type_lengths)
  {
    DBUG_ASSERT(sz >= count);
    for (uint i= 0; i <  count; i++)
    {
      DBUG_ASSERT(values[i].str != NULL);
      m_type_names[i]= values[i].str;
      m_type_lengths[i]= (uint) values[i].length;
    }
    m_type_names[sz]= NullS; // End marker
    m_type_lengths[sz]= 0;   // End marker
  }
  TypelibBuffer(const LEX_CSTRING *values)
   :TypelibBuffer(sz, values)
  { }
};


/*
  A helper class to store column attributes that are inherited
  by columns (from the table level) when not specified explicitly.
*/
class Column_derived_attributes
{
  /*
    Table level CHARACTER SET and COLLATE value:

      CREATE TABLE t1 (a VARCHAR(1), b CHAR(2)) CHARACTER SET latin1;

    All character string columns (CHAR, VARCHAR, TEXT)
    inherit CHARACTER SET from the table level.
  */
  CHARSET_INFO *m_charset;
public:
  explicit Column_derived_attributes(CHARSET_INFO *cs)
   :m_charset(cs)
  { }
  CHARSET_INFO *charset() const { return m_charset; }
};


/*
  A helper class to store requests for changes
  in multiple column data types during ALTER.
*/
class Column_bulk_alter_attributes
{
  /*
    Target CHARACTER SET specification in ALTER .. CONVERT, e.g.

      ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;

    All character string columns (CHAR, VARCHAR, TEXT)
    get converted to the "CONVERT TO CHARACTER SET".
  */
  CHARSET_INFO *m_alter_table_convert_to_charset;
public:
  explicit Column_bulk_alter_attributes(CHARSET_INFO *convert)
   :m_alter_table_convert_to_charset(convert)
  { }
  CHARSET_INFO *alter_table_convert_to_charset() const
  { return m_alter_table_convert_to_charset; }
};


class Native: public Binary_string
{
public:
  Native(char *str, size_t len)
   :Binary_string(str, len)
  { }
};


template<size_t buff_sz>
class NativeBuffer: public Native
{
  char buff[buff_sz];
public:
  NativeBuffer() : Native(buff, buff_sz) { length(0); }
};


class String_ptr
{
protected:
  String *m_string_ptr;
public:
  String_ptr(String *str)
   :m_string_ptr(str)
  { }
  String_ptr(Item *item, String *buffer);
  const String *string() const
  {
    DBUG_ASSERT(m_string_ptr);
    return m_string_ptr;
  }
  bool is_null() const { return m_string_ptr == NULL; }
};


class Ascii_ptr: public String_ptr
{
public:
  Ascii_ptr(Item *item, String *buffer);
};


template<size_t buff_sz>
class String_ptr_and_buffer: public StringBuffer<buff_sz>,
                             public String_ptr
{
public:
  String_ptr_and_buffer(Item *item)
   :String_ptr(item, this)
  { }
};


template<size_t buff_sz>
class Ascii_ptr_and_buffer: public StringBuffer<buff_sz>,
                            public Ascii_ptr
{
public:
  Ascii_ptr_and_buffer(Item *item)
   :Ascii_ptr(item, this)
  { }
};


class Dec_ptr
{
protected:
  my_decimal *m_ptr;
  Dec_ptr() = default;
public:
  Dec_ptr(my_decimal *ptr) :m_ptr(ptr) { }
  bool is_null() const { return m_ptr == NULL; }
  const my_decimal *ptr() const { return m_ptr; }
  const my_decimal *ptr_or(const my_decimal *def) const
  {
    return m_ptr ? m_ptr : def;
  }
  my_decimal *to_decimal(my_decimal *to) const
  {
    if (!m_ptr)
      return NULL;
    *to= *m_ptr;
    return to;
  }
  double to_double() const { return m_ptr ? m_ptr->to_double() : 0.0; }
  longlong to_longlong(bool unsigned_flag)
  { return m_ptr ? m_ptr->to_longlong(unsigned_flag) : 0; }
  Longlong_null to_xlonglong_null()
  {
    return m_ptr ? Longlong_null(m_ptr->to_xlonglong()) : Longlong_null();
  }
  bool to_bool() const { return m_ptr ? m_ptr->to_bool() : false; }
  String *to_string(String *to) const
  {
    return m_ptr ? m_ptr->to_string(to) : NULL;
  }
  String *to_string(String *to, uint prec, uint dec, char filler)
  {
    return m_ptr ? m_ptr->to_string(to, prec, dec, filler) : NULL;
  }
  int to_binary(uchar *bin, int prec, decimal_digits_t scale) const
  {
    return (m_ptr ? m_ptr : &decimal_zero)->to_binary(bin, prec, scale);
  }
  int cmp(const my_decimal *dec) const
  {
    DBUG_ASSERT(m_ptr);
    DBUG_ASSERT(dec);
    return m_ptr->cmp(dec);
  }
  int cmp(const Dec_ptr &other) const
  {
    return cmp(other.m_ptr);
  }
};


// A helper class to handle results of val_decimal(), date_op(), etc.
class Dec_ptr_and_buffer: public Dec_ptr
{
protected:
  my_decimal m_buffer;
public:
  /* scale is int as it can be negative here */
  int round_to(my_decimal *to, int scale, decimal_round_mode mode)
  {
    DBUG_ASSERT(m_ptr);
    return m_ptr->round_to(to, scale, mode);
  }
  int round_self(decimal_digits_t scale, decimal_round_mode mode)
  {
    return round_to(&m_buffer, scale, mode);
  }
  int round_self_if_needed(int scale, decimal_round_mode mode)
  {
    if (scale >= m_ptr->frac)
      return E_DEC_OK;
    int res= m_ptr->round_to(&m_buffer, scale, mode);
    m_ptr= &m_buffer;
    return res;
  }
  String *to_string_round(String *to, decimal_digits_t dec)
  {
    /*
      decimal_round() allows from==to
      So it's save even if m_ptr points to m_buffer before this call:
    */
    return m_ptr ? m_ptr->to_string_round(to, dec, &m_buffer) : NULL;
  }
};


// A helper class to handle val_decimal() results.
class VDec: public Dec_ptr_and_buffer
{
public:
  VDec(): Dec_ptr_and_buffer() { }
  VDec(Item *item);
  void set(Item *a);
};


// A helper class to handler decimal_op() results.
class VDec_op: public Dec_ptr_and_buffer
{
public:
  VDec_op(Item_func_hybrid_field_type *item);
};


/*
  Get and cache val_decimal() values for two items.
  If the first value appears to be NULL, the second value is not evaluated.
*/
class VDec2_lazy
{
public:
  VDec m_a;
  VDec m_b;
  VDec2_lazy(Item *a, Item *b) :m_a(a)
  {
    if (!m_a.is_null())
      m_b.set(b);
  }
  bool has_null() const
  {
    return m_a.is_null() || m_b.is_null();
  }
};


/**
  Class Sec6 represents a fixed point value with 6 fractional digits.
  Used e.g. to convert double and my_decimal values to TIME/DATETIME.
*/

class Sec6
{
protected:
  ulonglong m_sec;       // The integer part, between 0 and LONGLONG_MAX
  ulong     m_usec;      // The fractional part, between 0 and 999999
  bool      m_neg;       // false if positive, true of negative
  bool      m_truncated; // Indicates if the constructor truncated the value
  void make_from_decimal(const my_decimal *d, ulong *nanoseconds);
  void make_from_double(double d, ulong *nanoseconds);
  void make_from_int(const Longlong_hybrid &nr)
  {
    m_neg= nr.neg();
    m_sec= nr.abs();
    m_usec= 0;
    m_truncated= false;
  }
  void reset()
  {
    m_sec= m_usec= m_neg= m_truncated= 0;
  }
  Sec6() = default;
  bool add_nanoseconds(uint nanoseconds)
  {
    DBUG_ASSERT(nanoseconds <= 1000000000);
    if (nanoseconds < 500)
      return false;
    m_usec+= (nanoseconds + 500) / 1000;
    if (m_usec < 1000000)
      return false;
    m_usec%= 1000000;
    return true;
  }
public:
  explicit Sec6(double nr)
  {
    ulong nanoseconds;
    make_from_double(nr, &nanoseconds);
  }
  explicit Sec6(const my_decimal *d)
  {
    ulong nanoseconds;
    make_from_decimal(d, &nanoseconds);
  }
  explicit Sec6(const Longlong_hybrid &nr)
  {
    make_from_int(nr);
  }
  explicit Sec6(longlong nr, bool unsigned_val)
  {
    make_from_int(Longlong_hybrid(nr, unsigned_val));
  }
  bool neg() const { return m_neg; }
  bool truncated() const { return m_truncated; }
  ulonglong sec() const { return m_sec; }
  long usec() const { return m_usec; }
  /**
    Converts Sec6 to MYSQL_TIME
    @param thd           current thd
    @param [out] warn    conversion warnings will be written here
    @param [out] ltime   converted value will be written here
    @param fuzzydate     conversion flags (TIME_INVALID_DATE, etc)
    @returns false for success, true for a failure
  */
  bool convert_to_mysql_time(THD *thd,
                             int *warn,
                             MYSQL_TIME *ltime,
                             date_mode_t fuzzydate) const;

protected:

  bool to_interval_hhmmssff_only(MYSQL_TIME *to, int *warn) const
  {
    return number_to_time_only(m_neg, m_sec, m_usec,
                               TIME_MAX_INTERVAL_HOUR, to, warn);
  }
  bool to_datetime_or_to_interval_hhmmssff(MYSQL_TIME *to, int *warn) const
  {
    /*
      Convert a number to a time interval.
      The following formats are understood:
      -            0 <= x <=   999999995959 - parse as hhhhmmss
      - 999999995959 <  x <= 99991231235959 - parse as YYYYMMDDhhmmss
       (YYMMDDhhmmss)       (YYYYMMDDhhmmss)

      Note, these formats are NOT understood:
      - YYMMDD       - overlaps with INTERVAL range
      - YYYYMMDD     - overlaps with INTERVAL range
      - YYMMDDhhmmss - overlaps with INTERVAL range, partially
                       (see TIME_MAX_INTERVAL_HOUR)

      If we ever need wider intervals, this code switching between
      full datetime and interval-only should be rewised.
    */
    DBUG_ASSERT(TIME_MAX_INTERVAL_HOUR <= 999999995959);
    /*            (YYMMDDhhmmss) */
    if (m_sec >    999999995959ULL &&
        m_sec <= 99991231235959ULL && m_neg == 0)
      return to_datetime_or_date(to, warn, TIME_INVALID_DATES);
    if (m_sec / 10000 > TIME_MAX_INTERVAL_HOUR)
    {
      *warn= MYSQL_TIME_WARN_OUT_OF_RANGE;
      return true;
    }
    return to_interval_hhmmssff_only(to, warn);
  }
public:
  // [-][DD]hhhmmss.ff,  YYMMDDhhmmss.ff, YYYYMMDDhhmmss.ff
  bool to_datetime_or_time(MYSQL_TIME *to, int *warn,
                           date_conv_mode_t mode) const
  {
    bool rc= m_sec > 9999999 && m_sec <= 99991231235959ULL && !m_neg ?
             ::number_to_datetime_or_date(m_sec, m_usec, to,
                        ulonglong(mode & TIME_MODE_FOR_XXX_TO_DATE), warn) < 0 :
             ::number_to_time_only(m_neg, m_sec, m_usec, TIME_MAX_HOUR, to, warn);
    DBUG_ASSERT(*warn || !rc);
    return rc;
  }
  /*
    Convert a number in formats YYYYMMDDhhmmss.ff or YYMMDDhhmmss.ff to
    TIMESTAMP'YYYY-MM-DD hh:mm:ss.ff'
  */
  bool to_datetime_or_date(MYSQL_TIME *to, int *warn,
                           date_conv_mode_t flags) const
  {
    if (m_neg)
    {
      *warn= MYSQL_TIME_WARN_OUT_OF_RANGE;
      return true;
    }
    bool rc= number_to_datetime_or_date(m_sec, m_usec, to,
                                ulonglong(flags & TIME_MODE_FOR_XXX_TO_DATE),
                                warn) == -1;
    DBUG_ASSERT(*warn || !rc);
    return rc;
  }
  // Convert elapsed seconds to TIME
  bool sec_to_time(MYSQL_TIME *ltime, uint dec) const
  {
    set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
    ltime->neg= m_neg;
    if (m_sec > TIME_MAX_VALUE_SECONDS)
    {
      // use check_time_range() to set ltime to the max value depending on dec
      int unused;
      ltime->hour= TIME_MAX_HOUR + 1;
      check_time_range(ltime, dec, &unused);
      return true;
    }
    DBUG_ASSERT(usec() <= TIME_MAX_SECOND_PART);
    ltime->hour=   (uint) (m_sec / 3600);
    ltime->minute= (uint) (m_sec % 3600) / 60;
    ltime->second= (uint) m_sec % 60;
    ltime->second_part= m_usec;
    return false;
  }
  Sec6 &trunc(uint dec)
  {
    m_usec-= my_time_fraction_remainder(m_usec, dec);
    return *this;
  }
  size_t to_string(char *to, size_t nbytes) const
  {
    return m_usec ?
      my_snprintf(to, nbytes, "%s%llu.%06lu",
                  m_neg ? "-" : "", m_sec, m_usec) :
      my_snprintf(to, nbytes, "%s%llu", m_neg ? "-" : "", m_sec);
  }
  void make_truncated_warning(THD *thd, const char *type_str) const;
};


class Sec9: public Sec6
{
protected:
  ulong m_nsec; // Nanoseconds 0..999
  void make_from_int(const Longlong_hybrid &nr)
  {
    Sec6::make_from_int(nr);
    m_nsec= 0;
  }
  Sec9() = default;
public:
  Sec9(const my_decimal *d)
  {
    Sec6::make_from_decimal(d, &m_nsec);
  }
  Sec9(double d)
  {
    Sec6::make_from_double(d, &m_nsec);
  }
  ulong nsec() const { return m_nsec; }
  Sec9 &trunc(uint dec)
  {
    m_nsec= 0;
    Sec6::trunc(dec);
    return *this;
  }
  Sec9 &round(uint dec);
  Sec9 &round(uint dec, time_round_mode_t mode)
  {
    return mode == TIME_FRAC_TRUNCATE  ? trunc(dec) : round(dec);
  }
};


class VSec9: protected Sec9
{
  bool m_is_null;
  Sec9& to_sec9()
  {
    DBUG_ASSERT(!is_null());
    return *this;
  }
public:
  VSec9(THD *thd, Item *item, const char *type_str, ulonglong limit);
  bool is_null() const { return m_is_null; }
  const Sec9& to_const_sec9() const
  {
    DBUG_ASSERT(!is_null());
    return *this;
  }
  bool neg() const { return to_const_sec9().neg(); }
  bool truncated() const { return to_const_sec9().truncated(); }
  ulonglong sec() const { return to_const_sec9().sec(); }
  long usec() const { return to_const_sec9().usec(); }
  bool sec_to_time(MYSQL_TIME *ltime, uint dec) const
  {
    return to_const_sec9().sec_to_time(ltime, dec);
  }
  void make_truncated_warning(THD *thd, const char *type_str) const
  {
    return to_const_sec9().make_truncated_warning(thd, type_str);
  }
  Sec9 &round(uint dec)
  {
    return to_sec9().round(dec);
  }
  Sec9 &round(uint dec, time_round_mode_t mode)
  {
    return to_sec9().round(dec, mode);
  }
};


/*
  A heler class to perform additive operations between
  two MYSQL_TIME structures and return the result as a
  combination of seconds, microseconds and sign.
*/
class Sec6_add
{
  ulonglong m_sec; // number of seconds
  ulong m_usec;    // number of microseconds
  bool m_neg;      // false if positive, true if negative
  bool m_error;    // false if the value is OK, true otherwise
  void to_hh24mmssff(MYSQL_TIME *ltime, timestamp_type tstype) const
  {
    bzero(ltime, sizeof(*ltime));
    ltime->neg= m_neg;
    calc_time_from_sec(ltime, (ulong) (m_sec % SECONDS_IN_24H), m_usec);
    ltime->time_type= tstype;
  }
public:
  /*
    @param ltime1 - the first value to add (must be a valid DATE,TIME,DATETIME)
    @param ltime2 - the second value to add (must be a valid TIME)
    @param sign   - the sign of the operation
                    (+1 for addition, -1 for subtraction)
  */
  Sec6_add(const MYSQL_TIME *ltime1, const MYSQL_TIME *ltime2, int sign)
  {
    DBUG_ASSERT(sign == -1 || sign == 1);
    DBUG_ASSERT(!ltime1->neg || ltime1->time_type == MYSQL_TIMESTAMP_TIME);
    if (!(m_error= (ltime2->time_type != MYSQL_TIMESTAMP_TIME)))
    {
      if (ltime1->neg != ltime2->neg)
        sign= -sign;
      m_neg= calc_time_diff(ltime1, ltime2, -sign, &m_sec, &m_usec);
      if (ltime1->neg && (m_sec || m_usec))
        m_neg= !m_neg; // Swap sign
    }
  }
  bool to_time(THD *thd, MYSQL_TIME *ltime, uint decimals) const
  {
    if (m_error)
      return true;
    to_hh24mmssff(ltime, MYSQL_TIMESTAMP_TIME);
    ltime->hour+= static_cast<unsigned>(to_days_abs() * 24);
    return adjust_time_range_with_warn(thd, ltime, decimals);
  }
  bool to_datetime(MYSQL_TIME *ltime) const
  {
    if (m_error || m_neg)
      return true;
    to_hh24mmssff(ltime, MYSQL_TIMESTAMP_DATETIME);
    return get_date_from_daynr(to_days_abs(),
                               &ltime->year, &ltime->month, &ltime->day) ||
           !ltime->day;
  }
  long to_days_abs() const { return (long) (m_sec / SECONDS_IN_24H); }
};


class Year
{
protected:
  uint m_year;
  bool m_truncated;
  uint year_precision(const Item *item) const;
public:
  Year(): m_year(0), m_truncated(false) { }
  Year(longlong value, bool unsigned_flag, uint length);
  uint year() const { return m_year; }
  uint to_YYYYMMDD() const { return m_year * 10000; }
  bool truncated() const { return m_truncated; }
};


class Year_null: public Year, public Null_flag
{
public:
  Year_null(const Longlong_null &nr, bool unsigned_flag, uint length)
   :Year(nr.is_null() ? 0 : nr.value(), unsigned_flag, length),
    Null_flag(nr.is_null())
  { }
};


class VYear: public Year_null
{
public:
  VYear(Item *item);
};


class VYear_op: public Year_null
{
public:
  VYear_op(Item_func_hybrid_field_type *item);
};


class Double_null: public Null_flag
{
protected:
  double m_value;
public:
  Double_null(double value, bool is_null)
   :Null_flag(is_null), m_value(value)
  { }
  double value() const { return m_value; }
};


class Temporal: protected MYSQL_TIME
{
public:
  class Status: public MYSQL_TIME_STATUS
  {
  public:
    Status() { my_time_status_init(this); }
  };

  class Warn: public ErrBuff,
              public Status
  {
  public:
    void push_conversion_warnings(THD *thd, bool totally_useless_value,
                                  date_mode_t mode, timestamp_type tstype,
                                  const char *db_name, const char *table_name,
                                  const char *name)
    {
      const char *typestr= tstype >= 0 ? type_name_by_timestamp_type(tstype) :
                           mode & (TIME_INTERVAL_hhmmssff | TIME_INTERVAL_DAY) ?
                           "interval" :
                           mode & TIME_TIME_ONLY ? "time" : "datetime";
      Temporal::push_conversion_warnings(thd, totally_useless_value, warnings,
                                         typestr, db_name, table_name, name,
                                         ptr());
    }
  };

  class Warn_push: public Warn
  {
    THD * const m_thd;
    const char * const m_db_name;
    const char * const m_table_name;
    const char * const m_name;
    const MYSQL_TIME * const m_ltime;
    const date_mode_t m_mode;
  public:
    Warn_push(THD *thd, const char *db_name, const char *table_name,
              const char *name, const MYSQL_TIME *ltime, date_mode_t mode)
      : m_thd(thd), m_db_name(db_name), m_table_name(table_name), m_name(name),
        m_ltime(ltime), m_mode(mode)
    { }
    ~Warn_push()
    {
      if (warnings)
        push_conversion_warnings(m_thd, m_ltime->time_type < 0,
                                 m_mode, m_ltime->time_type,
                                 m_db_name, m_table_name, m_name);
    }
  };

public:
  static date_conv_mode_t sql_mode_for_dates(THD *thd);
  static time_round_mode_t default_round_mode(THD *thd);
  class Options: public date_mode_t
  {
  public:
    explicit Options(date_mode_t flags)
     :date_mode_t(flags)
    { }
    Options(date_conv_mode_t flags, time_round_mode_t round_mode)
     :date_mode_t(flags | round_mode)
    {
      DBUG_ASSERT(ulonglong(flags) <= UINT_MAX32);
    }
    Options(date_conv_mode_t flags, THD *thd)
     :Options(flags, default_round_mode(thd))
    { }
  };

  bool is_valid_temporal() const
  {
    DBUG_ASSERT(time_type != MYSQL_TIMESTAMP_ERROR);
    return time_type != MYSQL_TIMESTAMP_NONE;
  }
  static const char *type_name_by_timestamp_type(timestamp_type time_type)
  {
    switch (time_type) {
      case MYSQL_TIMESTAMP_DATE: return "date";
      case MYSQL_TIMESTAMP_TIME: return "time";
      case MYSQL_TIMESTAMP_DATETIME:  // FALLTHROUGH
      default:
        break;
    }
    return "datetime";
  }
  static void push_conversion_warnings(THD *thd, bool totally_useless_value, int warn,
                                       const char *type_name,
                                       const char *db_name,
                                       const char *table_name,
                                       const char *field_name,
                                       const char *value);
  /*
    This method is used if the item was not null but convertion to
    TIME/DATE/DATETIME failed. We return a zero date if allowed,
    otherwise - null.
  */
  void make_fuzzy_date(int *warn, date_conv_mode_t fuzzydate)
  {
    /*
      In the following scenario:
      - The caller expected to get a TIME value
      - Item returned a not NULL string or numeric value
      - But then conversion from string or number to TIME failed
      we need to change the default time_type from MYSQL_TIMESTAMP_DATE
      (which was set in bzero) to MYSQL_TIMESTAMP_TIME and therefore
      return TIME'00:00:00' rather than DATE'0000-00-00'.
      If we don't do this, methods like Item::get_time_with_conversion()
      will erroneously subtract CURRENT_DATE from '0000-00-00 00:00:00'
      and return TIME'-838:59:59' instead of TIME'00:00:00' as a result.
    */
    timestamp_type tstype= !(fuzzydate & TIME_FUZZY_DATES) ?
                           MYSQL_TIMESTAMP_NONE :
                           fuzzydate & TIME_TIME_ONLY ?
                           MYSQL_TIMESTAMP_TIME :
                           MYSQL_TIMESTAMP_DATETIME;
    set_zero_time(this, tstype);
  }

protected:
  my_decimal *bad_to_decimal(my_decimal *to) const;
  my_decimal *to_decimal(my_decimal *to) const;
  static double to_double(bool negate, ulonglong num, ulong frac)
  {
    double d= static_cast<double>(num) + static_cast<double>(frac) /
      TIME_SECOND_PART_FACTOR;
    return negate ? -d : d;
  }
  longlong to_packed() const { return ::pack_time(this); }
  void make_from_out_of_range(int *warn)
  {
    *warn= MYSQL_TIME_WARN_OUT_OF_RANGE;
    time_type= MYSQL_TIMESTAMP_NONE;
  }
  void make_from_sec6(THD *thd, MYSQL_TIME_STATUS *st,
                      const Sec6 &nr, date_mode_t mode)
  {
    if (nr.convert_to_mysql_time(thd, &st->warnings, this, mode))
      make_fuzzy_date(&st->warnings, date_conv_mode_t(mode));
  }
  void make_from_sec9(THD *thd, MYSQL_TIME_STATUS *st,
                      const Sec9 &nr, date_mode_t mode)
  {
    if (nr.convert_to_mysql_time(thd, &st->warnings, this, mode) ||
        add_nanoseconds(thd, &st->warnings, mode, nr.nsec()))
      make_fuzzy_date(&st->warnings, date_conv_mode_t(mode));
  }
  void make_from_str(THD *thd, Warn *warn,
                     const char *str, size_t length, CHARSET_INFO *cs,
                     date_mode_t fuzzydate);
  void make_from_double(THD *thd, Warn *warn, double nr, date_mode_t mode)
  {
    make_from_sec9(thd, warn, Sec9(nr), mode);
    if (warn->warnings)
      warn->set_double(nr);
  }
  void make_from_longlong_hybrid(THD *thd, Warn *warn,
                                 const Longlong_hybrid &nr, date_mode_t mode)
  {
    /*
      Note: conversion from an integer to TIME can overflow to
      '838:59:59.999999', so the conversion result can have fractional digits.
    */
    make_from_sec6(thd, warn, Sec6(nr), mode);
    if (warn->warnings)
      warn->set_longlong(nr);
  }
  void make_from_decimal(THD *thd, Warn *warn,
                         const my_decimal *nr, date_mode_t mode)
  {
    make_from_sec9(thd, warn, Sec9(nr), mode);
    if (warn->warnings)
      warn->set_decimal(nr);
  }
  bool ascii_to_temporal(MYSQL_TIME_STATUS *st,
                         const char *str, size_t length,
                         date_mode_t mode)
  {
    if (mode & (TIME_INTERVAL_hhmmssff | TIME_INTERVAL_DAY))
      return ascii_to_datetime_or_date_or_interval_DDhhmmssff(st, str, length,
                                                              mode);
    if (mode & TIME_TIME_ONLY)
      return ascii_to_datetime_or_date_or_time(st, str, length, mode);
    return ascii_to_datetime_or_date(st, str, length, mode);
  }
  bool ascii_to_datetime_or_date_or_interval_DDhhmmssff(MYSQL_TIME_STATUS *st,
                                                        const char *str,
                                                        size_t length,
                                                        date_mode_t mode)
  {
    longlong cflags= ulonglong(mode & TIME_MODE_FOR_XXX_TO_DATE);
    bool rc= mode & TIME_INTERVAL_DAY ?
      ::str_to_datetime_or_date_or_interval_day(str, length, this, cflags, st,
                                                TIME_MAX_INTERVAL_HOUR,
                                                TIME_MAX_INTERVAL_HOUR) :
      ::str_to_datetime_or_date_or_interval_hhmmssff(str, length, this,
                                                     cflags, st,
                                                     TIME_MAX_INTERVAL_HOUR,
                                                     TIME_MAX_INTERVAL_HOUR);
    DBUG_ASSERT(!rc || st->warnings);
    return rc;
  }
  bool ascii_to_datetime_or_date_or_time(MYSQL_TIME_STATUS *status,
                                         const char *str, size_t length,
                                         date_mode_t fuzzydate)
  {
    ulonglong cflags= ulonglong(fuzzydate & TIME_MODE_FOR_XXX_TO_DATE);
    bool rc= ::str_to_datetime_or_date_or_time(str, length, this,
                                               cflags, status,
                                               TIME_MAX_HOUR, UINT_MAX32);
    DBUG_ASSERT(!rc || status->warnings);
    return rc;
  }
  bool ascii_to_datetime_or_date(MYSQL_TIME_STATUS *status,
                                 const char *str, size_t length,
                                 date_mode_t fuzzydate)
  {
    DBUG_ASSERT(bool(fuzzydate & TIME_TIME_ONLY) == false);
    bool rc= ::str_to_datetime_or_date(str, length, this,
                             ulonglong(fuzzydate & TIME_MODE_FOR_XXX_TO_DATE),
                             status);
    DBUG_ASSERT(!rc || status->warnings);
    return rc;
  }
  // Character set aware versions for string conversion routines
  bool str_to_temporal(THD *thd, MYSQL_TIME_STATUS *st,
                       const char *str, size_t length,
                       CHARSET_INFO *cs, date_mode_t fuzzydate);
  bool str_to_datetime_or_date_or_time(THD *thd, MYSQL_TIME_STATUS *st,
                                       const char *str, size_t length,
                                       CHARSET_INFO *cs, date_mode_t mode);
  bool str_to_datetime_or_date(THD *thd, MYSQL_TIME_STATUS *st,
                               const char *str, size_t length,
                               CHARSET_INFO *cs, date_mode_t mode);

  bool has_valid_mmssff() const
  {
    return minute <= TIME_MAX_MINUTE &&
           second <= TIME_MAX_SECOND &&
           second_part <= TIME_MAX_SECOND_PART;
  }
  bool has_zero_YYYYMM() const
  {
    return year == 0 && month == 0;
  }
  bool has_zero_YYYYMMDD() const
  {
    return year == 0 && month == 0 && day == 0;
  }
  bool check_date(date_conv_mode_t flags, int *warn) const
  {
    return ::check_date(this, flags, warn);
  }
  void time_hhmmssff_set_max(uint max_hour)
  {
    hour= max_hour;
    minute= TIME_MAX_MINUTE;
    second= TIME_MAX_SECOND;
    second_part= TIME_MAX_SECOND_PART;
  }
  /*
    Add nanoseconds to ssff
    retval   true if seconds overflowed (the caller should increment minutes)
             false if no overflow happened
  */
  bool add_nanoseconds_ssff(uint nanoseconds)
  {
    DBUG_ASSERT(nanoseconds <= 1000000000);
    if (nanoseconds < 500)
      return false;
    second_part+= (nanoseconds + 500) / 1000;
    if (second_part < 1000000)
      return false;
    second_part%= 1000000;
    if (second < 59)
    {
      second++;
      return false;
    }
    second= 0;
    return true;
  }
  /*
    Add nanoseconds to mmssff
    retval   true if hours overflowed (the caller should increment hours)
             false if no overflow happened
  */
  bool add_nanoseconds_mmssff(uint nanoseconds)
  {
    if (!add_nanoseconds_ssff(nanoseconds))
      return false;
    if (minute < 59)
    {
      minute++;
      return false;
    }
    minute= 0;
    return true;
  }
  void time_round_or_set_max(uint dec, int *warn, ulong max_hour, ulong nsec);
  bool datetime_add_nanoseconds_or_invalidate(THD *thd, int *warn, ulong nsec);
  bool datetime_round_or_invalidate(THD *thd, uint dec, int *warn, ulong nsec);
  bool add_nanoseconds_with_round(THD *thd, int *warn,
                                  date_conv_mode_t mode, ulong nsec);
  bool add_nanoseconds(THD *thd, int *warn, date_mode_t mode, ulong nsec)
  {
    date_conv_mode_t cmode= date_conv_mode_t(mode);
    return time_round_mode_t(mode) == TIME_FRAC_ROUND ?
           add_nanoseconds_with_round(thd, warn, cmode, nsec) : false;
  }
public:
  static void *operator new(size_t size, MYSQL_TIME *ltime) throw()
  {
    DBUG_ASSERT(size == sizeof(MYSQL_TIME));
    return ltime;
  }
  static void operator delete(void *ptr, MYSQL_TIME *ltime) { }

  long fraction_remainder(uint dec) const
  {
    return my_time_fraction_remainder(second_part, dec);
  }
};


/*
  Use this class when you need to get a MYSQL_TIME from an Item
  using Item's native timestamp type, without automatic timestamp
  type conversion.
*/
class Temporal_hybrid: public Temporal
{
public:
  class Options: public Temporal::Options
  {
  public:
    Options(THD *thd)
     :Temporal::Options(sql_mode_for_dates(thd), default_round_mode(thd))
    { }
    Options(date_conv_mode_t flags, time_round_mode_t round_mode)
     :Temporal::Options(flags, round_mode)
    { }
    explicit Options(const Temporal::Options &opt)
     :Temporal::Options(opt)
    { }
    explicit Options(date_mode_t fuzzydate)
     :Temporal::Options(fuzzydate)
    { }
  };

public:
  // Contructors for Item
  Temporal_hybrid(THD *thd, Item *item, date_mode_t fuzzydate);
  Temporal_hybrid(THD *thd, Item *item)
   :Temporal_hybrid(thd, item, Options(thd))
  { }
  Temporal_hybrid(Item *item)
   :Temporal_hybrid(current_thd, item)
  { }

  // Constructors for non-NULL values
  Temporal_hybrid(THD *thd, Warn *warn,
                  const char *str, size_t length, CHARSET_INFO *cs,
                  date_mode_t fuzzydate)
  {
    make_from_str(thd, warn, str, length, cs, fuzzydate);
  }
  Temporal_hybrid(THD *thd, Warn *warn,
                  const Longlong_hybrid &nr, date_mode_t fuzzydate)
  {
    make_from_longlong_hybrid(thd, warn, nr, fuzzydate);
  }
  Temporal_hybrid(THD *thd, Warn *warn, double nr, date_mode_t fuzzydate)
  {
    make_from_double(thd, warn, nr, fuzzydate);
  }

  // Constructors for nullable values
  Temporal_hybrid(THD *thd, Warn *warn, const String *str, date_mode_t mode)
  {
    if (!str)
      time_type= MYSQL_TIMESTAMP_NONE;
    else
      make_from_str(thd, warn, str->ptr(), str->length(), str->charset(), mode);
  }
  Temporal_hybrid(THD *thd, Warn *warn,
                  const Longlong_hybrid_null &nr, date_mode_t fuzzydate)
  {
    if (nr.is_null())
      time_type= MYSQL_TIMESTAMP_NONE;
    else
      make_from_longlong_hybrid(thd, warn, nr, fuzzydate);
  }
  Temporal_hybrid(THD *thd, Warn *warn, const Double_null &nr, date_mode_t mode)
  {
    if (nr.is_null())
      time_type= MYSQL_TIMESTAMP_NONE;
    else
      make_from_double(thd, warn, nr.value(), mode);
  }
  Temporal_hybrid(THD *thd, Warn *warn, const my_decimal *nr, date_mode_t mode)
  {
    if (!nr)
      time_type= MYSQL_TIMESTAMP_NONE;
    else
      make_from_decimal(thd, warn, nr, mode);
  }
  // End of constuctors

  bool copy_valid_value_to_mysql_time(MYSQL_TIME *ltime) const
  {
    DBUG_ASSERT(is_valid_temporal());
    *ltime= *this;
    return false;
  }

  longlong to_longlong() const
  {
    if (!is_valid_temporal())
      return 0;
    ulonglong v= TIME_to_ulonglong(this);
    return neg ? -(longlong) v : (longlong) v;
  }
  double to_double() const
  {
    return is_valid_temporal() ? TIME_to_double(this) : 0;
  }
  my_decimal *to_decimal(my_decimal *to)
  {
    return is_valid_temporal() ? Temporal::to_decimal(to) : bad_to_decimal(to);
  }
  String *to_string(String *str, uint dec) const
  {
    if (!is_valid_temporal())
      return NULL;
    str->set_charset(&my_charset_numeric);
    if (!str->alloc(MAX_DATE_STRING_REP_LENGTH))
      str->length(my_TIME_to_str(this, const_cast<char*>(str->ptr()), dec));
    return str;
  }
  const MYSQL_TIME *get_mysql_time() const
  {
    DBUG_ASSERT(is_valid_temporal());
    return this;
  }
};


/*
  This class resembles the SQL standard <extract source>,
  used in extract expressions, e.g: EXTRACT(DAY FROM dt)
  <extract expression> ::=
    EXTRACT <left paren> <extract field> FROM <extract source> <right paren>
  <extract source> ::= <datetime value expression> | <interval value expression>
*/
class Extract_source: public Temporal_hybrid
{
  /*
    Convert a TIME value to DAY-TIME interval, e.g. for extraction:
      EXTRACT(DAY FROM x), EXTRACT(HOUR FROM x), etc.
    Moves full days from ltime->hour to ltime->day.
  */
  void time_to_daytime_interval()
  {
    DBUG_ASSERT(time_type == MYSQL_TIMESTAMP_TIME);
    DBUG_ASSERT(has_zero_YYYYMMDD());
    MYSQL_TIME::day= MYSQL_TIME::hour / 24;
    MYSQL_TIME::hour%= 24;
  }
  bool is_valid_extract_source_slow() const
  {
    return is_valid_temporal() && MYSQL_TIME::hour < 24 &&
           (has_zero_YYYYMM() || time_type != MYSQL_TIMESTAMP_TIME);
  }
  bool is_valid_value_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_NONE || is_valid_extract_source_slow();
  }
public:
  Extract_source(THD *thd, Item *item, date_mode_t mode)
   :Temporal_hybrid(thd, item, mode)
  {
    if (MYSQL_TIME::time_type == MYSQL_TIMESTAMP_TIME)
      time_to_daytime_interval();
    DBUG_ASSERT(is_valid_value_slow());
  }
  inline const MYSQL_TIME *get_mysql_time() const
  {
    DBUG_ASSERT(is_valid_extract_source_slow());
    return this;
  }
  bool is_valid_extract_source() const { return is_valid_temporal(); }
  int sign() const { return get_mysql_time()->neg ? -1 : 1; }
  uint year() const { return get_mysql_time()->year; }
  uint month() const { return get_mysql_time()->month; }
  int day() const { return (int) get_mysql_time()->day * sign(); }
  int hour() const { return (int) get_mysql_time()->hour * sign(); }
  int minute() const { return (int) get_mysql_time()->minute * sign(); }
  int second() const { return (int) get_mysql_time()->second * sign(); }
  int microsecond() const { return (int) get_mysql_time()->second_part * sign(); }

  uint year_month() const { return year() * 100 + month(); }
  uint quarter() const { return (month() + 2)/3; }
  uint week(THD *thd) const;

  longlong second_microsecond() const
  {
    return (second() * 1000000LL + microsecond());
  }

  // DAY TO XXX
  longlong day_hour() const
  {
    return (longlong) day() * 100LL + hour();
  }
  longlong day_minute() const
  {
    return day_hour() * 100LL + minute();
  }
  longlong day_second() const
  {
    return day_minute() * 100LL + second();
  }
  longlong day_microsecond() const
  {
    return day_second() * 1000000LL + microsecond();
  }

  // HOUR TO XXX
  int hour_minute() const
  {
    return hour() * 100 + minute();
  }
  int hour_second() const
  {
    return hour_minute() * 100 + second();
  }
  longlong hour_microsecond() const
  {
    return hour_second() * 1000000LL + microsecond();
  }

  // MINUTE TO XXX
  int minute_second() const
  {
    return minute() * 100 + second();
  }
  longlong minute_microsecond() const
  {
    return minute_second() * 1000000LL + microsecond();
  }
};


/*
  This class is used for the "time_interval" argument of these SQL functions:
    TIMESTAMP(tm,time_interval)
    ADDTIME(tm,time_interval)
  Features:
  - DATE and DATETIME formats are treated as errors
  - Preserves hours for TIME format as is, without limiting to TIME_MAX_HOUR
*/
class Interval_DDhhmmssff: public Temporal
{
  static const LEX_CSTRING m_type_name;
  bool str_to_DDhhmmssff(MYSQL_TIME_STATUS *status,
                         const char *str, size_t length, CHARSET_INFO *cs,
                         ulong max_hour);
  void push_warning_wrong_or_truncated_value(THD *thd,
                                             const ErrConv &str,
                                             int warnings);
  bool is_valid_interval_DDhhmmssff_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_TIME &&
           has_zero_YYYYMMDD() && has_valid_mmssff();
  }
  bool is_valid_value_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_NONE ||
           is_valid_interval_DDhhmmssff_slow();
  }
public:
  // Get fractional second precision from an Item
  static uint fsp(THD *thd, Item *item);
  /*
    Maximum useful HOUR value:
    TIMESTAMP'0001-01-01 00:00:00' + '87649415:59:59' = '9999-12-31 23:59:59'
    This gives maximum possible interval values:
    - '87649415:59:59.999999'   (in 'hh:mm:ss.ff' format)
    - '3652058 23:59:59.999999' (in 'DD hh:mm:ss.ff' format)
  */
  static uint max_useful_hour()
  {
    return TIME_MAX_INTERVAL_HOUR;
  }
  static uint max_int_part_char_length()
  {
    // e.g. '+3652058 23:59:59'
    return 1/*sign*/ + TIME_MAX_INTERVAL_DAY_CHAR_LENGTH + 1 + 8/*hh:mm:ss*/;
  }
  static uint max_char_length(uint fsp)
  {
    DBUG_ASSERT(fsp <= TIME_SECOND_PART_DIGITS);
    return max_int_part_char_length() + (fsp ? 1 : 0) + fsp;
  }

public:
  Interval_DDhhmmssff(THD *thd, Status *st, bool push_warnings,
                      Item *item, ulong max_hour,
                      time_round_mode_t mode, uint dec);
  Interval_DDhhmmssff(THD *thd, Item *item, uint dec)
  {
    Status st;
    new(this) Interval_DDhhmmssff(thd, &st, true, item, max_useful_hour(),
                                  default_round_mode(thd), dec);
  }
  Interval_DDhhmmssff(THD *thd, Item *item)
   :Interval_DDhhmmssff(thd, item, TIME_SECOND_PART_DIGITS)
  { }
  const MYSQL_TIME *get_mysql_time() const
  {
    DBUG_ASSERT(is_valid_interval_DDhhmmssff_slow());
    return this;
  }
  bool is_valid_interval_DDhhmmssff() const
  {
    return time_type == MYSQL_TIMESTAMP_TIME;
  }
  bool is_valid_value() const
  {
    return time_type == MYSQL_TIMESTAMP_NONE || is_valid_interval_DDhhmmssff();
  }
  String *to_string(String *str, uint dec) const
  {
    if (!is_valid_interval_DDhhmmssff())
      return NULL;
    str->set_charset(&my_charset_numeric);
    if (!str->alloc(MAX_DATE_STRING_REP_LENGTH))
      str->length(my_interval_DDhhmmssff_to_str(this,
                                                const_cast<char*>(str->ptr()),
                                                dec));
    return str;
  }
};

class Schema;


/**
  Class Time is designed to store valid TIME values.

  1. Valid value:
    a. MYSQL_TIMESTAMP_TIME - a valid TIME within the supported TIME range
    b. MYSQL_TIMESTAMP_NONE - an undefined value

  2. Invalid value (internally only):
    a. MYSQL_TIMESTAMP_TIME outside of the supported TIME range
    a. MYSQL_TIMESTAMP_{DATE|DATETIME|ERROR}

  Temporarily Time is allowed to have an invalid value, but only internally,
  during initialization time. All constructors and modification methods must
  leave the Time value as described above (see "Valid values").

  Time derives from MYSQL_TIME privately to make sure it is accessed
  externally only in the valid state.
*/
class Time: public Temporal
{
  static uint binary_length_to_precision(uint length);
public:
  enum datetime_to_time_mode_t
  {
    DATETIME_TO_TIME_DISALLOW,
    DATETIME_TO_TIME_YYYYMMDD_000000DD_MIX_TO_HOURS,
    DATETIME_TO_TIME_YYYYMMDD_TRUNCATE,
    DATETIME_TO_TIME_YYYYMMDD_00000000_ONLY,
    DATETIME_TO_TIME_MINUS_CURRENT_DATE
  };
  class Options: public Temporal::Options
  {
    datetime_to_time_mode_t m_datetime_to_time_mode;
  public:
    Options(THD *thd)
     :Temporal::Options(default_flags_for_get_date(), default_round_mode(thd)),
      m_datetime_to_time_mode(default_datetime_to_time_mode())
    { }
    Options(date_conv_mode_t flags, THD *thd)
     :Temporal::Options(flags, default_round_mode(thd)),
      m_datetime_to_time_mode(default_datetime_to_time_mode())
    { }
    Options(date_conv_mode_t flags, THD *thd, datetime_to_time_mode_t dtmode)
     :Temporal::Options(flags, default_round_mode(thd)),
      m_datetime_to_time_mode(dtmode)
    { }
    Options(date_conv_mode_t fuzzydate, time_round_mode_t round_mode,
            datetime_to_time_mode_t datetime_to_time_mode)
     :Temporal::Options(fuzzydate, round_mode),
       m_datetime_to_time_mode(datetime_to_time_mode)
    { }

    datetime_to_time_mode_t datetime_to_time_mode() const
    { return m_datetime_to_time_mode; }

    static datetime_to_time_mode_t default_datetime_to_time_mode()
    {
      return DATETIME_TO_TIME_YYYYMMDD_000000DD_MIX_TO_HOURS;
    }
  };
  /*
    CAST(AS TIME) historically does not mix days to hours.
    This is different comparing to how implicit conversion
    in Field::store_time_dec() works (e.g. on INSERT).
  */
  class Options_for_cast: public Options
  {
  public:
    Options_for_cast(THD *thd)
     :Options(default_flags_for_get_date(), default_round_mode(thd),
              DATETIME_TO_TIME_YYYYMMDD_TRUNCATE)
    { }
    Options_for_cast(date_mode_t mode, THD *thd)
     :Options(default_flags_for_get_date() | (mode & TIME_FUZZY_DATES),
              default_round_mode(thd),
              DATETIME_TO_TIME_YYYYMMDD_TRUNCATE)
    { }
  };

  class Options_for_round: public Options
  {
  public:
    Options_for_round(time_round_mode_t round_mode= TIME_FRAC_TRUNCATE)
     :Options(Time::default_flags_for_get_date(), round_mode,
              Time::DATETIME_TO_TIME_DISALLOW)
    { }
  };
  class Options_cmp: public Options
  {
  public:
    Options_cmp(THD *thd)
     :Options(comparison_flags_for_get_date(), thd)
    { }
    Options_cmp(THD *thd, datetime_to_time_mode_t dtmode)
     :Options(comparison_flags_for_get_date(),
              default_round_mode(thd), dtmode)
    { }
  };
private:
  bool is_valid_value_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_NONE || is_valid_time_slow();
  }
  bool is_valid_time_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_TIME &&
           has_zero_YYYYMMDD() && has_valid_mmssff();
  }
  void hhmmssff_copy(const MYSQL_TIME *from)
  {
    hour= from->hour;
    minute= from->minute;
    second= from->second;
    second_part= from->second_part;
  }
  void datetime_to_time_YYYYMMDD_000000DD_mix_to_hours(int *warn,
                                                       uint from_year,
                                                       uint from_month,
                                                       uint from_day)
  {
    if (from_year != 0 || from_month != 0)
      *warn|= MYSQL_TIME_NOTE_TRUNCATED;
    else
      hour+= from_day * 24;
  }
  /*
    The result is calculated effectively similar to:
    TIMEDIFF(dt, CAST(CURRENT_DATE AS DATETIME))
    If the difference does not fit to the supported TIME range, it's truncated.
  */
  void datetime_to_time_minus_current_date(THD *thd)
  {
    MYSQL_TIME current_date, tmp;
    set_current_date(thd, &current_date);
    calc_time_diff(this, &current_date, 1, &tmp, date_mode_t(0));
    static_cast<MYSQL_TIME*>(this)[0]= tmp;
    int warnings= 0;
    (void) check_time_range(this, TIME_SECOND_PART_DIGITS, &warnings);
    DBUG_ASSERT(is_valid_time());
  }
  /*
    Convert a valid DATE or DATETIME to TIME.
    Before this call, "this" must be a valid DATE or DATETIME value,
    e.g. returned from Item::get_date(), str_to_xxx(), number_to_xxx().
    After this call, "this" is a valid TIME value.
  */
  void valid_datetime_to_valid_time(THD *thd, int *warn, const Options opt)
  {
    DBUG_ASSERT(time_type == MYSQL_TIMESTAMP_DATE ||
                time_type == MYSQL_TIMESTAMP_DATETIME);
    /*
      We're dealing with a DATE or DATETIME returned from
      str_to_xxx(), number_to_xxx() or unpack_time().
      Do some asserts to make sure the result hour value
      after mixing days to hours does not go out of the valid TIME range.
      The maximum hour value after mixing days will be 31*24+23=767,
      which is within the supported TIME range.
      Thus no adjust_time_range_or_invalidate() is needed here.
    */
    DBUG_ASSERT(day < 32);
    DBUG_ASSERT(hour < 24);
    if (opt.datetime_to_time_mode() == DATETIME_TO_TIME_MINUS_CURRENT_DATE)
    {
      datetime_to_time_minus_current_date(thd);
    }
    else
    {
      if (opt.datetime_to_time_mode() ==
          DATETIME_TO_TIME_YYYYMMDD_000000DD_MIX_TO_HOURS)
        datetime_to_time_YYYYMMDD_000000DD_mix_to_hours(warn, year, month, day);
      year= month= day= 0;
      time_type= MYSQL_TIMESTAMP_TIME;
    }
    DBUG_ASSERT(is_valid_time_slow());
  }
  /**
    Convert valid DATE/DATETIME to valid TIME if needed.
    This method is called after Item::get_date(),
    str_to_xxx(), number_to_xxx().
    which can return only valid TIME/DATE/DATETIME values.
    Before this call, "this" is:
    - either a valid TIME/DATE/DATETIME value
      (within the supported range for the corresponding type),
    - or MYSQL_TIMESTAMP_NONE
    After this call, "this" is:
    - either a valid TIME (within the supported TIME range),
    - or MYSQL_TIMESTAMP_NONE
  */
  void valid_MYSQL_TIME_to_valid_value(THD *thd, int *warn, const Options opt)
  {
    switch (time_type) {
    case MYSQL_TIMESTAMP_DATE:
    case MYSQL_TIMESTAMP_DATETIME:
      if (opt.datetime_to_time_mode() ==
          DATETIME_TO_TIME_YYYYMMDD_00000000_ONLY &&
          (year || month || day))
        make_from_out_of_range(warn);
      else if (opt.datetime_to_time_mode() == DATETIME_TO_TIME_DISALLOW)
        make_from_out_of_range(warn);
      else
        valid_datetime_to_valid_time(thd, warn, opt);
      break;
    case MYSQL_TIMESTAMP_NONE:
      break;
    case MYSQL_TIMESTAMP_ERROR:
      set_zero_time(this, MYSQL_TIMESTAMP_TIME);
      break;
    case MYSQL_TIMESTAMP_TIME:
      DBUG_ASSERT(is_valid_time_slow());
      break;
    }
  }

  /*
    This method is called after number_to_xxx() and str_to_xxx(),
    which can return DATE or DATETIME values. Convert to TIME if needed.
    We trust that xxx_to_time() returns a valid TIME/DATE/DATETIME value,
    so here we need to do only simple validation.
  */
  void xxx_to_time_result_to_valid_value(THD *thd, int *warn, const Options opt)
  {
    // str_to_xxx(), number_to_xxx() never return MYSQL_TIMESTAMP_ERROR
    DBUG_ASSERT(time_type != MYSQL_TIMESTAMP_ERROR);
    valid_MYSQL_TIME_to_valid_value(thd, warn, opt);
  }
  void adjust_time_range_or_invalidate(int *warn)
  {
    if (check_time_range(this, TIME_SECOND_PART_DIGITS, warn))
      time_type= MYSQL_TIMESTAMP_NONE;
    DBUG_ASSERT(is_valid_value_slow());
  }
public:
  void round_or_set_max(uint dec, int *warn, ulong nsec);
private:
  void round_or_set_max(uint dec, int *warn);

  /*
    All make_from_xxx() methods initialize *warn.
    The old value gets lost.
  */
  void make_from_datetime_move_day_to_hour(int *warn, const MYSQL_TIME *from);
  void make_from_datetime_with_days_diff(int *warn, const MYSQL_TIME *from,
                                         long curdays);
  void make_from_time(int *warn, const MYSQL_TIME *from);
  void make_from_datetime(int *warn, const MYSQL_TIME *from, long curdays);
  void make_from_item(THD *thd, int *warn, Item *item, const Options opt);
public:
  /*
    All constructors that accept an "int *warn" parameter initialize *warn.
    The old value gets lost.
  */
  Time(int *warn, bool neg, ulonglong hour, uint minute, const Sec6 &second);
  Time() { time_type= MYSQL_TIMESTAMP_NONE; }
  Time(const Native &native);
  Time(THD *thd, const MYSQL_TIME *ltime, const Options opt)
  {
    *(static_cast<MYSQL_TIME*>(this))= *ltime;
    DBUG_ASSERT(is_valid_temporal());
    int warn= 0;
    valid_MYSQL_TIME_to_valid_value(thd, &warn, opt);
  }
  Time(Item *item)
   :Time(current_thd, item)
  { }
  Time(THD *thd, Item *item, const Options opt)
  {
    int warn;
    make_from_item(thd, &warn, item, opt);
  }
  Time(THD *thd, Item *item)
   :Time(thd, item, Options(thd))
  { }
  Time(int *warn, const MYSQL_TIME *from, long curdays);
  Time(THD *thd, MYSQL_TIME_STATUS *status,
       const char *str, size_t len, CHARSET_INFO *cs,
       const Options opt)
  {
    if (str_to_datetime_or_date_or_time(thd, status, str, len, cs, opt))
      time_type= MYSQL_TIMESTAMP_NONE;
    // The below call will optionally add notes to already collected warnings:
    else
      xxx_to_time_result_to_valid_value(thd, &status->warnings, opt);
  }

protected:
  Time(THD *thd, int *warn, const Sec6 &nr, const Options opt)
  {
    if (nr.to_datetime_or_time(this, warn, TIME_INVALID_DATES))
      time_type= MYSQL_TIMESTAMP_NONE;
    xxx_to_time_result_to_valid_value(thd, warn, opt);
  }
  Time(THD *thd, int *warn, const Sec9 &nr, const Options &opt)
   :Time(thd, warn, static_cast<Sec6>(nr), opt)
  {
    if (is_valid_time() && time_round_mode_t(opt) == TIME_FRAC_ROUND)
      round_or_set_max(6, warn, nr.nsec());
  }

public:
  Time(THD *thd, int *warn, const Longlong_hybrid &nr, const Options &opt)
   :Time(thd, warn, Sec6(nr), opt)
  { }
  Time(THD *thd, int *warn, double nr, const Options &opt)
   :Time(thd, warn, Sec9(nr), opt)
  { }
  Time(THD *thd, int *warn, const my_decimal *d, const Options &opt)
   :Time(thd, warn, Sec9(d), opt)
  { }

  Time(THD *thd, Item *item, const Options opt, uint dec)
   :Time(thd, item, opt)
  {
    round(dec, time_round_mode_t(opt));
  }
  Time(int *warn, const MYSQL_TIME *from, long curdays,
       const Time::Options &opt, uint dec)
   :Time(warn, from, curdays)
  {
    round(dec, time_round_mode_t(opt), warn);
  }
  Time(int *warn, bool neg, ulonglong hour, uint minute, const Sec9 &second,
       time_round_mode_t mode, uint dec)
   :Time(warn, neg, hour, minute, second)
  {
    DBUG_ASSERT(is_valid_time());
    if ((ulonglong) mode == (ulonglong) TIME_FRAC_ROUND)
      round_or_set_max(6, warn, second.nsec());
    round(dec, mode, warn);
  }
  Time(THD *thd, MYSQL_TIME_STATUS *status,
       const char *str, size_t len, CHARSET_INFO *cs,
       const Options &opt, uint dec)
   :Time(thd, status, str, len, cs, opt)
  {
    round(dec, time_round_mode_t(opt), &status->warnings);
  }
  Time(THD *thd, int *warn, const Longlong_hybrid &nr,
       const Options &opt, uint dec)
   :Time(thd, warn, nr, opt)
  {
    /*
      Decimal digit truncation is needed here in case if nr was out
      of the supported TIME range, so "this" was set to '838:59:59.999999'.
      We always do truncation (not rounding) here, independently from "opt".
    */
    trunc(dec);
  }
  Time(THD *thd, int *warn, double nr, const Options &opt, uint dec)
   :Time(thd, warn, nr, opt)
  {
    round(dec, time_round_mode_t(opt), warn);
  }
  Time(THD *thd, int *warn, const my_decimal *d, const Options &opt, uint dec)
   :Time(thd, warn, d, opt)
  {
    round(dec, time_round_mode_t(opt), warn);
  }

  static date_conv_mode_t default_flags_for_get_date()
  { return TIME_TIME_ONLY | TIME_INVALID_DATES; }
  static date_conv_mode_t comparison_flags_for_get_date()
  { return TIME_TIME_ONLY | TIME_INVALID_DATES | TIME_FUZZY_DATES; }
  bool is_valid_time() const
  {
    DBUG_ASSERT(is_valid_value_slow());
    return time_type == MYSQL_TIMESTAMP_TIME;
  }
  const MYSQL_TIME *get_mysql_time() const
  {
    DBUG_ASSERT(is_valid_time_slow());
    return this;
  }
  bool copy_to_mysql_time(MYSQL_TIME *ltime) const
  {
    if (time_type == MYSQL_TIMESTAMP_NONE)
    {
      ltime->time_type= MYSQL_TIMESTAMP_NONE;
      return true;
    }
    DBUG_ASSERT(is_valid_time_slow());
    *ltime= *this;
    return false;
  }
  int cmp(const Time *other) const
  {
    DBUG_ASSERT(is_valid_time_slow());
    DBUG_ASSERT(other->is_valid_time_slow());
    longlong p0= to_packed();
    longlong p1= other->to_packed();
    if (p0 < p1)
      return -1;
    if (p0 > p1)
      return 1;
    return 0;
  }
  longlong to_seconds_abs() const
  {
    DBUG_ASSERT(is_valid_time_slow());
    return hour * 3600L + minute * 60 + second;
  }
  longlong to_seconds() const
  {
    return neg ? -to_seconds_abs() : to_seconds_abs();
  }
  bool to_bool() const
  {
    return is_valid_time() &&
           (TIME_to_ulonglong_time(this) != 0 || second_part != 0);
  }
  longlong to_longlong() const
  {
    if (!is_valid_time())
      return 0;
    ulonglong v= TIME_to_ulonglong_time(this);
    return neg ? -(longlong) v : (longlong) v;
  }
  double to_double() const
  {
    return !is_valid_time() ? 0 :
           Temporal::to_double(neg, TIME_to_ulonglong_time(this), second_part);
  }
  bool to_native(Native *to, uint decimals) const;
  String *to_string(String *str, uint dec) const
  {
    if (!is_valid_time())
      return NULL;
    str->set_charset(&my_charset_numeric);
    if (!str->alloc(MAX_DATE_STRING_REP_LENGTH))
      str->length(my_time_to_str(this, const_cast<char*>(str->ptr()), dec));
    return str;
  }
  my_decimal *to_decimal(my_decimal *to)
  {
    return is_valid_time() ? Temporal::to_decimal(to) : bad_to_decimal(to);
  }
  longlong to_packed() const
  {
    return is_valid_time() ? Temporal::to_packed() : 0;
  }
  longlong valid_time_to_packed() const
  {
    DBUG_ASSERT(is_valid_time_slow());
    return Temporal::to_packed();
  }
  long fraction_remainder(uint dec) const
  {
    DBUG_ASSERT(is_valid_time());
    return Temporal::fraction_remainder(dec);
  }

  Time &trunc(uint dec)
  {
    if (is_valid_time())
      my_time_trunc(this, dec);
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Time &ceiling(int *warn)
  {
    if (is_valid_time())
    {
      if (neg)
        my_time_trunc(this, 0);
      else if (second_part)
        round_or_set_max(0, warn, 999999999);
    }
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Time &ceiling()
  {
    int warn= 0;
    return ceiling(&warn);
  }
  Time &floor(int *warn)
  {
    if (is_valid_time())
    {
      if (!neg)
        my_time_trunc(this, 0);
      else if (second_part)
        round_or_set_max(0, warn, 999999999);
    }
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Time &floor()
  {
    int warn= 0;
    return floor(&warn);
  }
  Time &round(uint dec, int *warn)
  {
    if (is_valid_time())
      round_or_set_max(dec, warn);
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Time &round(uint dec, time_round_mode_t mode, int *warn)
  {
    switch (mode.mode()) {
    case time_round_mode_t::FRAC_NONE:
      DBUG_ASSERT(fraction_remainder(dec) == 0);
      return trunc(dec);
    case time_round_mode_t::FRAC_TRUNCATE:
      return trunc(dec);
    case time_round_mode_t::FRAC_ROUND:
      return round(dec, warn);
    }
    return *this;
  }
  Time &round(uint dec, time_round_mode_t mode)
  {
    int warn= 0;
    return round(dec, mode, &warn);
  }

};


/**
  Class Temporal_with_date is designed to store valid DATE or DATETIME values.
  See also class Time.

  1. Valid value:
    a. MYSQL_TIMESTAMP_{DATE|DATETIME} - a valid DATE or DATETIME value
    b. MYSQL_TIMESTAMP_NONE            - an undefined value

  2. Invalid value (internally only):
    a. MYSQL_TIMESTAMP_{DATE|DATETIME} - a DATE or DATETIME value, but with
                                         MYSQL_TIME members outside of the
                                         valid/supported range
    b. MYSQL_TIMESTAMP_TIME            - a TIME value
    c. MYSQL_TIMESTAMP_ERROR           - error

  Temporarily is allowed to have an invalid value, but only internally,
  during initialization time. All constructors and modification methods must
  leave the value as described above (see "Valid value").

  Derives from MYSQL_TIME using "protected" inheritance to make sure
  it is accessed externally only in the valid state.
*/

class Temporal_with_date: public Temporal
{
public:
  class Options: public Temporal::Options
  {
  public:
    Options(date_conv_mode_t fuzzydate, time_round_mode_t mode):
     Temporal::Options(fuzzydate, mode)
    {}
    explicit Options(const Temporal::Options &opt)
     :Temporal::Options(opt)
    { }
    explicit Options(date_mode_t mode)
     :Temporal::Options(mode)
    { }
  };
protected:
  void check_date_or_invalidate(int *warn, date_conv_mode_t flags);
  void make_from_item(THD *thd, Item *item, date_mode_t flags);

  ulong daynr() const
  {
    return (ulong) ::calc_daynr((uint) year, (uint) month, (uint) day);
  }
  int weekday(bool sunday_first_day_of_week) const
  {
    return ::calc_weekday(daynr(), sunday_first_day_of_week);
  }
  ulong dayofyear() const
  {
    return (ulong) (daynr() - ::calc_daynr(year, 1, 1) + 1);
  }
  uint quarter() const
  {
    return (month + 2) / 3;
  }
  uint week(uint week_behaviour) const
  {
    uint year;
    return calc_week(this, week_behaviour, &year);
  }
  uint yearweek(uint week_behaviour) const
  {
    uint year;
    uint week= calc_week(this, week_behaviour, &year);
    return week + year * 100;
  }
public:
  Temporal_with_date()
  {
    time_type= MYSQL_TIMESTAMP_NONE;
  }
  Temporal_with_date(THD *thd, Item *item, date_mode_t fuzzydate)
  {
    make_from_item(thd, item, fuzzydate);
  }
  Temporal_with_date(int *warn, const Sec6 &nr, date_mode_t flags)
  {
    DBUG_ASSERT(bool(flags & TIME_TIME_ONLY) == false);
    if (nr.to_datetime_or_date(this, warn, date_conv_mode_t(flags)))
      time_type= MYSQL_TIMESTAMP_NONE;
  }
  Temporal_with_date(THD *thd, MYSQL_TIME_STATUS *status,
                     const char *str, size_t len, CHARSET_INFO *cs,
                     date_mode_t flags)
  {
    DBUG_ASSERT(bool(flags & TIME_TIME_ONLY) == false);
    if (str_to_datetime_or_date(thd, status, str, len, cs, flags))
      time_type= MYSQL_TIMESTAMP_NONE;
  }
public:
  bool check_date_with_warn(THD *thd, date_conv_mode_t flags)
  {
    return ::check_date_with_warn(thd, this, flags, MYSQL_TIMESTAMP_ERROR);
  }
  bool check_date_with_warn(THD *thd)
  {
    return ::check_date_with_warn(thd, this, Temporal::sql_mode_for_dates(thd),
                                  MYSQL_TIMESTAMP_ERROR);
  }
  static date_conv_mode_t comparison_flags_for_get_date()
  { return TIME_INVALID_DATES | TIME_FUZZY_DATES; }
};


/**
  Class Date is designed to store valid DATE values.
  All constructors and modification methods leave instances
  of this class in one of the following valid states:
    a. MYSQL_TIMESTAMP_DATE - a DATE with all MYSQL_TIME members properly set
    b. MYSQL_TIMESTAMP_NONE - an undefined value.
  Other MYSQL_TIMESTAMP_XXX are not possible.
  MYSQL_TIMESTAMP_DATE with MYSQL_TIME members improperly set is not possible.
*/
class Date: public Temporal_with_date
{
  bool is_valid_value_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_NONE || is_valid_date_slow();
  }
  bool is_valid_date_slow() const
  {
    DBUG_ASSERT(time_type == MYSQL_TIMESTAMP_DATE);
    return !check_datetime_range(this);
  }
public:
  class Options: public Temporal_with_date::Options
  {
  public:
    explicit Options(date_conv_mode_t fuzzydate)
     :Temporal_with_date::Options(fuzzydate, TIME_FRAC_TRUNCATE)
    { }
    Options(THD *thd, time_round_mode_t mode)
     :Temporal_with_date::Options(sql_mode_for_dates(thd), mode)
    { }
    explicit Options(THD *thd)
     :Temporal_with_date::Options(sql_mode_for_dates(thd), TIME_FRAC_TRUNCATE)
    { }
    explicit Options(date_mode_t fuzzydate)
     :Temporal_with_date::Options(fuzzydate)
    { }
  };
public:
  Date(Item *item, date_mode_t fuzzydate)
   :Date(current_thd, item, fuzzydate)
  { }
  Date(THD *thd, Item *item, date_mode_t fuzzydate)
   :Temporal_with_date(thd, item, fuzzydate)
  {
    if (time_type == MYSQL_TIMESTAMP_DATETIME)
      datetime_to_date(this);
    DBUG_ASSERT(is_valid_value_slow());
  }
  Date(THD *thd, Item *item, date_conv_mode_t fuzzydate)
   :Date(thd, item, Options(fuzzydate))
  { }
  Date(THD *thd, Item *item)
   :Temporal_with_date(Date(thd, item, Options(thd, TIME_FRAC_TRUNCATE)))
  { }
  Date(Item *item)
   :Temporal_with_date(Date(current_thd, item))
  { }
  Date(const Temporal_with_date *d)
   :Temporal_with_date(*d)
  {
    datetime_to_date(this);
    DBUG_ASSERT(is_valid_date_slow());
  }
  explicit Date(const Temporal_hybrid *from)
  {
    from->copy_valid_value_to_mysql_time(this);
    DBUG_ASSERT(is_valid_date_slow());
  }
  bool is_valid_date() const
  {
    DBUG_ASSERT(is_valid_value_slow());
    return time_type == MYSQL_TIMESTAMP_DATE;
  }
  bool check_date(date_conv_mode_t flags, int *warnings) const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return ::check_date(this, (year || month || day),
                        ulonglong(flags & TIME_MODE_FOR_XXX_TO_DATE),
                        warnings);
  }
  bool check_date(THD *thd, int *warnings) const
  {
    return check_date(Temporal::sql_mode_for_dates(thd), warnings);
  }
  bool check_date(date_conv_mode_t flags) const
  {
    int dummy; /* unused */
    return check_date(flags, &dummy);
  }
  bool check_date(THD *thd) const
  {
    int dummy;
    return check_date(Temporal::sql_mode_for_dates(thd), &dummy);
  }
  const MYSQL_TIME *get_mysql_time() const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return this;
  }
  bool copy_to_mysql_time(MYSQL_TIME *ltime) const
  {
    if (time_type == MYSQL_TIMESTAMP_NONE)
    {
      ltime->time_type= MYSQL_TIMESTAMP_NONE;
      return true;
    }
    DBUG_ASSERT(is_valid_date_slow());
    *ltime= *this;
    return false;
  }
  ulong daynr() const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return Temporal_with_date::daynr();
  }
  ulong dayofyear() const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return Temporal_with_date::dayofyear();
  }
  uint quarter() const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return Temporal_with_date::quarter();
  }
  uint week(uint week_behaviour) const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return Temporal_with_date::week(week_behaviour);
  }
  uint yearweek(uint week_behaviour) const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return Temporal_with_date::yearweek(week_behaviour);
  }

  longlong valid_date_to_packed() const
  {
    DBUG_ASSERT(is_valid_date_slow());
    return Temporal::to_packed();
  }
  bool to_bool() const
  {
    return to_longlong() != 0;
  }
  longlong to_longlong() const
  {
    return is_valid_date() ? (longlong) TIME_to_ulonglong_date(this) : 0LL;
  }
  double to_double() const
  {
    return (double) to_longlong();
  }
  String *to_string(String *str) const
  {
    if (!is_valid_date())
      return NULL;
    str->set_charset(&my_charset_numeric);
    if (!str->alloc(MAX_DATE_STRING_REP_LENGTH))
      str->length(my_date_to_str(this, const_cast<char*>(str->ptr())));
    return str;
  }
  my_decimal *to_decimal(my_decimal *to)
  {
    return is_valid_date() ? Temporal::to_decimal(to) : bad_to_decimal(to);
  }
};


/**
  Class Datetime is designed to store valid DATETIME values.
  All constructors and modification methods leave instances
  of this class in one of the following valid states:
    a. MYSQL_TIMESTAMP_DATETIME - a DATETIME with all members properly set
    b. MYSQL_TIMESTAMP_NONE     - an undefined value.
  Other MYSQL_TIMESTAMP_XXX are not possible.
  MYSQL_TIMESTAMP_DATETIME with MYSQL_TIME members
  improperly set is not possible.
*/
class Datetime: public Temporal_with_date
{
  bool is_valid_value_slow() const
  {
    return time_type == MYSQL_TIMESTAMP_NONE || is_valid_datetime_slow();
  }
  bool is_valid_datetime_slow() const
  {
    DBUG_ASSERT(time_type == MYSQL_TIMESTAMP_DATETIME);
    return !check_datetime_range(this);
  }
  bool add_nanoseconds_or_invalidate(THD *thd, int *warn, ulong nsec)
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    bool rc= Temporal::datetime_add_nanoseconds_or_invalidate(thd, warn, nsec);
    DBUG_ASSERT(is_valid_value_slow());
    return rc;
  }
  void date_to_datetime_if_needed()
  {
    if (time_type == MYSQL_TIMESTAMP_DATE)
      date_to_datetime(this);
  }
  void make_from_time(THD *thd, int *warn, const MYSQL_TIME *from,
                      date_conv_mode_t flags);
  void make_from_datetime(THD *thd, int *warn, const MYSQL_TIME *from,
                          date_conv_mode_t flags);
  bool round_or_invalidate(THD *thd, uint dec, int *warn);
  bool round_or_invalidate(THD *thd, uint dec, int *warn, ulong nsec)
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    bool rc= Temporal::datetime_round_or_invalidate(thd, dec, warn, nsec);
    DBUG_ASSERT(is_valid_value_slow());
    return rc;
  }
public:

  class Options: public Temporal_with_date::Options
  {
  public:
    Options(date_conv_mode_t fuzzydate, time_round_mode_t nanosecond_rounding)
     :Temporal_with_date::Options(fuzzydate, nanosecond_rounding)
    { }
    Options(THD *thd)
     :Temporal_with_date::Options(sql_mode_for_dates(thd), default_round_mode(thd))
    { }
    Options(THD *thd, time_round_mode_t rounding_mode)
     :Temporal_with_date::Options(sql_mode_for_dates(thd), rounding_mode)
    { }
    Options(date_conv_mode_t fuzzydate, THD *thd)
     :Temporal_with_date::Options(fuzzydate, default_round_mode(thd))
    { }
  };

  class Options_cmp: public Options
  {
  public:
    Options_cmp(THD *thd)
     :Options(comparison_flags_for_get_date(), thd)
    { }
  };

  static Datetime zero()
  {
    int warn;
    static Longlong_hybrid nr(0, false);
    return Datetime(&warn, nr, date_mode_t(0));
  }
public:
  Datetime() // NULL value
   :Temporal_with_date()
  { }
  Datetime(THD *thd, Item *item, date_mode_t fuzzydate)
   :Temporal_with_date(thd, item, fuzzydate)
  {
    date_to_datetime_if_needed();
    DBUG_ASSERT(is_valid_value_slow());
  }
  Datetime(THD *thd, Item *item)
   :Temporal_with_date(Datetime(thd, item, Options(thd)))
  { }
  Datetime(Item *item)
   :Datetime(current_thd, item)
  { }

  Datetime(THD *thd, int *warn, const MYSQL_TIME *from, date_conv_mode_t flags);
  Datetime(THD *thd, MYSQL_TIME_STATUS *status,
           const char *str, size_t len, CHARSET_INFO *cs,
           const date_mode_t fuzzydate)
   :Temporal_with_date(thd, status, str, len, cs, fuzzydate)
  {
    date_to_datetime_if_needed();
    DBUG_ASSERT(is_valid_value_slow());
  }

protected:
  Datetime(int *warn, const Sec6 &nr, date_mode_t flags)
   :Temporal_with_date(warn, nr, flags)
  {
    date_to_datetime_if_needed();
    DBUG_ASSERT(is_valid_value_slow());
  }
  Datetime(THD *thd, int *warn, const Sec9 &nr, date_mode_t fuzzydate)
   :Datetime(warn, static_cast<const Sec6>(nr), fuzzydate)
  {
    if (is_valid_datetime() &&
        time_round_mode_t(fuzzydate) == TIME_FRAC_ROUND)
      round_or_invalidate(thd, 6, warn, nr.nsec());
    DBUG_ASSERT(is_valid_value_slow());
  }

public:
  Datetime(int *warn, const Longlong_hybrid &nr, date_mode_t mode)
   :Datetime(warn, Sec6(nr), mode)
  { }
  Datetime(THD *thd, int *warn, double nr, date_mode_t fuzzydate)
   :Datetime(thd, warn, Sec9(nr), fuzzydate)
  { }
  Datetime(THD *thd, int *warn, const my_decimal *d, date_mode_t fuzzydate)
   :Datetime(thd, warn, Sec9(d), fuzzydate)
  { }
  Datetime(THD *thd, const timeval &tv);

  Datetime(THD *thd, Item *item, date_mode_t fuzzydate, uint dec)
   :Datetime(thd, item, fuzzydate)
  {
    int warn= 0;
    round(thd, dec, time_round_mode_t(fuzzydate), &warn);
  }
  Datetime(THD *thd, MYSQL_TIME_STATUS *status,
           const char *str, size_t len, CHARSET_INFO *cs,
           date_mode_t fuzzydate, uint dec)
   :Datetime(thd, status, str, len, cs, fuzzydate)
  {
    round(thd, dec, time_round_mode_t(fuzzydate), &status->warnings);
  }
  Datetime(THD *thd, int *warn, double nr, date_mode_t fuzzydate, uint dec)
   :Datetime(thd, warn, nr, fuzzydate)
  {
    round(thd, dec, time_round_mode_t(fuzzydate), warn);
  }
  Datetime(THD *thd, int *warn, const my_decimal *d, date_mode_t fuzzydate, uint dec)
   :Datetime(thd, warn, d, fuzzydate)
  {
    round(thd, dec, time_round_mode_t(fuzzydate), warn);
  }
  Datetime(THD *thd, int *warn, const MYSQL_TIME *from,
           date_mode_t fuzzydate, uint dec)
   :Datetime(thd, warn, from, date_conv_mode_t(fuzzydate) & ~TIME_TIME_ONLY)
  {
    round(thd, dec, time_round_mode_t(fuzzydate), warn);
  }
  explicit Datetime(const Temporal_hybrid *from)
  {
    from->copy_valid_value_to_mysql_time(this);
    DBUG_ASSERT(is_valid_datetime_slow());
  }
  explicit Datetime(const MYSQL_TIME *from)
  {
    *(static_cast<MYSQL_TIME*>(this))= *from;
    DBUG_ASSERT(is_valid_datetime_slow());
  }
  Datetime(my_time_t unix_time, ulong second_part,
           const Time_zone* time_zone);

  bool is_valid_datetime() const
  {
    /*
      Here we quickly check for the type only.
      If the type is valid, the rest of value must also be valid.
    */
    DBUG_ASSERT(is_valid_value_slow());
    return time_type == MYSQL_TIMESTAMP_DATETIME;
  }
  bool check_date(date_conv_mode_t flags, int *warnings) const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return ::check_date(this, (year || month || day),
                        ulonglong(flags & TIME_MODE_FOR_XXX_TO_DATE),
                        warnings);
  }
  bool check_date(date_conv_mode_t flags) const
  {
    int dummy; /* unused */
    return check_date(flags, &dummy);
  }
  bool check_date(THD *thd) const
  {
    return check_date(Temporal::sql_mode_for_dates(thd));
  }
  bool hhmmssff_is_zero() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return hour == 0 && minute == 0 && second == 0 && second_part == 0;
  }
  ulong daynr() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal_with_date::daynr();
  }
  int weekday(bool sunday_first_day_of_week) const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal_with_date::weekday(sunday_first_day_of_week);
  }
  ulong dayofyear() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal_with_date::dayofyear();
  }
  uint quarter() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal_with_date::quarter();
  }
  uint week(uint week_behaviour) const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal_with_date::week(week_behaviour);
  }
  uint yearweek(uint week_behaviour) const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal_with_date::yearweek(week_behaviour);
  }

  longlong hhmmss_to_seconds_abs() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return hour * 3600L + minute * 60 + second;
  }
  longlong hhmmss_to_seconds() const
  {
    return neg ? -hhmmss_to_seconds_abs() : hhmmss_to_seconds_abs();
  }
  longlong to_seconds() const
  {
    return hhmmss_to_seconds() + (longlong) daynr() * 24L * 3600L;
  }

  const MYSQL_TIME *get_mysql_time() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return this;
  }
  bool copy_to_mysql_time(MYSQL_TIME *ltime) const
  {
    if (time_type == MYSQL_TIMESTAMP_NONE)
    {
      ltime->time_type= MYSQL_TIMESTAMP_NONE;
      return true;
    }
    DBUG_ASSERT(is_valid_datetime_slow());
    *ltime= *this;
    return false;
  }
  /**
    Copy without data loss, with an optional DATETIME to DATE conversion.
    If the value of the "type" argument is MYSQL_TIMESTAMP_DATE,
    then "this" must be a datetime with a zero hhmmssff part.
  */
  bool copy_to_mysql_time(MYSQL_TIME *ltime, timestamp_type type)
  {
    DBUG_ASSERT(type == MYSQL_TIMESTAMP_DATE ||
                type == MYSQL_TIMESTAMP_DATETIME);
    if (copy_to_mysql_time(ltime))
      return true;
    DBUG_ASSERT(type != MYSQL_TIMESTAMP_DATE || hhmmssff_is_zero());
    ltime->time_type= type;
    return false;
  }
  bool to_bool() const
  {
    return is_valid_datetime() &&
           (TIME_to_ulonglong_datetime(this) != 0 || second_part != 0);
  }
  longlong to_longlong() const
  {
    return is_valid_datetime() ?
           (longlong) TIME_to_ulonglong_datetime(this) : 0LL;
  }
  double to_double() const
  {
    return !is_valid_datetime() ? 0 :
      Temporal::to_double(neg, TIME_to_ulonglong_datetime(this), second_part);
  }
  String *to_string(String *str, uint dec) const
  {
    if (!is_valid_datetime())
      return NULL;
    str->set_charset(&my_charset_numeric);
    if (!str->alloc(MAX_DATE_STRING_REP_LENGTH))
      str->length(my_datetime_to_str(this, const_cast<char*>(str->ptr()), dec));
    return str;
  }
  my_decimal *to_decimal(my_decimal *to)
  {
    return is_valid_datetime() ? Temporal::to_decimal(to) : bad_to_decimal(to);
  }
  longlong to_packed() const
  {
    return is_valid_datetime() ? Temporal::to_packed() : 0;
  }
  longlong valid_datetime_to_packed() const
  {
    DBUG_ASSERT(is_valid_datetime_slow());
    return Temporal::to_packed();
  }
  long fraction_remainder(uint dec) const
  {
    DBUG_ASSERT(is_valid_datetime());
    return Temporal::fraction_remainder(dec);
  }

  Datetime &trunc(uint dec)
  {
    if (is_valid_datetime())
      my_datetime_trunc(this, dec);
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Datetime &ceiling(THD *thd, int *warn)
  {
    if (is_valid_datetime() && second_part)
      round_or_invalidate(thd, 0, warn, 999999999);
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Datetime &ceiling(THD *thd)
  {
    int warn= 0;
    return ceiling(thd, &warn);
  }
  Datetime &round(THD *thd, uint dec, int *warn)
  {
    if (is_valid_datetime())
      round_or_invalidate(thd, dec, warn);
    DBUG_ASSERT(is_valid_value_slow());
    return *this;
  }
  Datetime &round(THD *thd, uint dec, time_round_mode_t mode, int *warn)
  {
    switch (mode.mode()) {
    case time_round_mode_t::FRAC_NONE:
      DBUG_ASSERT(fraction_remainder(dec) == 0);
      return trunc(dec);
    case time_round_mode_t::FRAC_TRUNCATE:
      return trunc(dec);
    case time_round_mode_t::FRAC_ROUND:
      return round(thd, dec, warn);
    }
    return *this;
  }
  Datetime &round(THD *thd, uint dec, time_round_mode_t mode)
  {
    int warn= 0;
    return round(thd, dec, mode, &warn);
  }

};


/*
  Datetime to be created from an Item who is known to be of a temporal
  data type. For temporal data types we don't need nanosecond rounding
  or truncation, as their precision is limited.
*/
class Datetime_from_temporal: public Datetime
{
public:
  // The constructor DBUG_ASSERTs on a proper Item data type.
  Datetime_from_temporal(THD *thd, Item *temporal, date_conv_mode_t flags);
};


/*
  Datetime to be created from an Item who is known not to have digits outside
  of the specified scale. So it's not important which rounding method to use.
  TRUNCATE should work.
  Typically, Item is of a temporal data type, but this is not strictly required.
*/
class Datetime_truncation_not_needed: public Datetime
{
public:
  Datetime_truncation_not_needed(THD *thd, Item *item, date_conv_mode_t mode);
  Datetime_truncation_not_needed(THD *thd, Item *item, date_mode_t mode)
   :Datetime_truncation_not_needed(thd, item, date_conv_mode_t(mode))
  { }
};


class Timestamp: protected Timeval
{
  static uint binary_length_to_precision(uint length);
protected:
  void round_or_set_max(uint dec, int *warn);
  bool add_nanoseconds_usec(uint nanoseconds)
  {
    DBUG_ASSERT(nanoseconds <= 1000000000);
    if (nanoseconds < 500)
      return false;
    tv_usec+= (nanoseconds + 500) / 1000;
    if (tv_usec < 1000000)
      return false;
    tv_usec%= 1000000;
    return true;
  }
public:
  static date_conv_mode_t sql_mode_for_timestamp(THD *thd);
  static time_round_mode_t default_round_mode(THD *thd);
  class DatetimeOptions: public date_mode_t
  {
  public:
    DatetimeOptions(date_conv_mode_t fuzzydate, time_round_mode_t round_mode)
     :date_mode_t(fuzzydate | round_mode)
    { }
    DatetimeOptions(THD *thd)
     :DatetimeOptions(sql_mode_for_timestamp(thd), default_round_mode(thd))
    { }
  };
public:
  Timestamp(my_time_t timestamp, ulong sec_part)
   :Timeval(timestamp, sec_part)
  { }
  explicit Timestamp(const timeval &tv)
   :Timeval(tv)
  { }
  explicit Timestamp(const Native &native);
  Timestamp(THD *thd, const MYSQL_TIME *ltime, uint *error_code);
  const struct timeval &tv() const { return *this; }
  int cmp(const Timestamp &other) const
  {
    return tv_sec < other.tv_sec   ? -1 :
           tv_sec > other.tv_sec   ? +1 :
           tv_usec < other.tv_usec ? -1 :
           tv_usec > other.tv_usec ? +1 : 0;
  }
  bool to_TIME(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) const;
  bool to_native(Native *to, uint decimals) const;
  Datetime to_datetime(THD *thd) const
  {
    return Datetime(thd, *this);
  }
  long fraction_remainder(uint dec) const
  {
    return my_time_fraction_remainder(tv_usec, dec);
  }
  Timestamp &trunc(uint dec)
  {
    my_timeval_trunc(this, dec);
    return *this;
  }
  Timestamp &round(uint dec, int *warn)
  {
    round_or_set_max(dec, warn);
    return *this;
  }
  Timestamp &round(uint dec, time_round_mode_t mode, int *warn)
  {
    switch (mode.mode()) {
    case time_round_mode_t::FRAC_NONE:
      DBUG_ASSERT(fraction_remainder(dec) == 0);
      return trunc(dec);
    case time_round_mode_t::FRAC_TRUNCATE:
      return trunc(dec);
    case time_round_mode_t::FRAC_ROUND:
      return round(dec, warn);
    }
    return *this;
  }
  Timestamp &round(uint dec, time_round_mode_t mode)
  {
    int warn= 0;
    return round(dec, mode, &warn);
  }
};


/**
  A helper class to store MariaDB TIMESTAMP values, which can be:
  - real TIMESTAMP (seconds and microseconds since epoch), or
  - zero datetime '0000-00-00 00:00:00.000000'
*/
class Timestamp_or_zero_datetime: protected Timestamp
{
  bool m_is_zero_datetime;
public:
  Timestamp_or_zero_datetime()
   :Timestamp(0,0), m_is_zero_datetime(true)
  { }
  Timestamp_or_zero_datetime(const Native &native)
   :Timestamp(native.length() ? Timestamp(native) : Timestamp(0,0)),
    m_is_zero_datetime(native.length() == 0)
  { }
  Timestamp_or_zero_datetime(const Timestamp &tm, bool is_zero_datetime)
   :Timestamp(tm), m_is_zero_datetime(is_zero_datetime)
  { }
  Timestamp_or_zero_datetime(THD *thd, const MYSQL_TIME *ltime, uint *err_code);
  Datetime to_datetime(THD *thd) const
  {
    if (is_zero_datetime())
      return Datetime::zero();
    return Timestamp::to_datetime(thd);
  }
  bool to_bool() const
  {
    return !m_is_zero_datetime;
  }
  bool is_zero_datetime() const { return m_is_zero_datetime; }
  void trunc(uint decimals)
  {
    if (!is_zero_datetime())
     Timestamp::trunc(decimals);
  }
  int cmp(const Timestamp_or_zero_datetime &other) const
  {
    if (is_zero_datetime())
      return other.is_zero_datetime() ? 0 : -1;
    if (other.is_zero_datetime())
      return 1;
    return Timestamp::cmp(other);
  }
  bool to_TIME(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate) const;
  /*
    Convert to native format:
    - Real timestamps are encoded in the same way how Field_timestamp2 stores
      values (big endian seconds followed by big endian microseconds)
    - Zero datetime '0000-00-00 00:00:00.000000' is encoded as empty string.
    Two native values are binary comparable.
  */
  bool to_native(Native *to, uint decimals) const;
};


/**
  A helper class to store non-null MariaDB TIMESTAMP values in
  the native binary encoded representation.
*/
class Timestamp_or_zero_datetime_native:
          public NativeBuffer<STRING_BUFFER_TIMESTAMP_BINARY_SIZE>
{
public:
  Timestamp_or_zero_datetime_native() = default;
  Timestamp_or_zero_datetime_native(const Timestamp_or_zero_datetime &ts,
                                    uint decimals)
  {
    if (ts.to_native(this, decimals))
      length(0); // safety
  }
  int save_in_field(Field *field, uint decimals) const;
  Datetime to_datetime(THD *thd) const
  {
    return is_zero_datetime() ?
           Datetime::zero() :
           Datetime(thd, Timestamp(*this).tv());
  }
  bool is_zero_datetime() const
  {
    return length() == 0;
  }
};


/**
  A helper class to store nullable MariaDB TIMESTAMP values in
  the native binary encoded representation.
*/
class Timestamp_or_zero_datetime_native_null: public Timestamp_or_zero_datetime_native,
                                              public Null_flag
{
public:
  // With optional data type conversion
  Timestamp_or_zero_datetime_native_null(THD *thd, Item *item, bool conv);
  // Without data type conversion: item is known to be of the TIMESTAMP type
  Timestamp_or_zero_datetime_native_null(THD *thd, Item *item)
   :Timestamp_or_zero_datetime_native_null(thd, item, false)
  { }
  Datetime to_datetime(THD *thd) const
  {
    return is_null() ? Datetime() :
                       Timestamp_or_zero_datetime_native::to_datetime(thd);
  }
  void to_TIME(THD *thd, MYSQL_TIME *to)
  {
    DBUG_ASSERT(!is_null());
    Datetime::Options opt(TIME_CONV_NONE, TIME_FRAC_NONE);
    Timestamp_or_zero_datetime(*this).to_TIME(thd, to, opt);
  }
  bool is_zero_datetime() const
  {
    DBUG_ASSERT(!is_null());
    return Timestamp_or_zero_datetime_native::is_zero_datetime();
  }
};


/*
  Flags for collation aggregation modes, used in TDCollation::agg():

  MY_COLL_ALLOW_SUPERSET_CONV  - allow conversion to a superset
  MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value
                                 (i.e. constant).
  MY_COLL_ALLOW_CONV           - allow any kind of conversion
                                 (combination of the above two)
  MY_COLL_ALLOW_NUMERIC_CONV   - if all items were numbers, convert to
                                 @@character_set_connection
  MY_COLL_DISALLOW_NONE        - don't allow return DERIVATION_NONE
                                 (e.g. when aggregating for comparison)
  MY_COLL_CMP_CONV             - combination of MY_COLL_ALLOW_CONV
                                 and MY_COLL_DISALLOW_NONE
*/

#define MY_COLL_ALLOW_SUPERSET_CONV   1
#define MY_COLL_ALLOW_COERCIBLE_CONV  2
#define MY_COLL_DISALLOW_NONE         4
#define MY_COLL_ALLOW_NUMERIC_CONV    8

#define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV)
#define MY_COLL_CMP_CONV   (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE)


#define MY_REPERTOIRE_NUMERIC   MY_REPERTOIRE_ASCII


static inline my_repertoire_t operator|(const my_repertoire_t a,
                                        const my_repertoire_t b)
{
  return (my_repertoire_t) ((uint) a | (uint) b);
}

static inline my_repertoire_t &operator|=(my_repertoire_t &a,
                                          const my_repertoire_t b)
{
  return a= (my_repertoire_t) ((uint) a | (uint) b);
}


enum Derivation
{
  DERIVATION_IGNORABLE= 6,
  DERIVATION_NUMERIC= 5,
  DERIVATION_COERCIBLE= 4,
  DERIVATION_SYSCONST= 3,
  DERIVATION_IMPLICIT= 2,
  DERIVATION_NONE= 1,
  DERIVATION_EXPLICIT= 0
};


/**
   "Declared Type Collation"
   A combination of collation and its derivation.
*/

class DTCollation {
public:
  CHARSET_INFO     *collation;
  enum Derivation derivation;
  my_repertoire_t repertoire;

  void set_repertoire_from_charset(CHARSET_INFO *cs)
  {
    repertoire= cs->state & MY_CS_PUREASCII ?
                MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
  }
  DTCollation()
  {
    collation= &my_charset_bin;
    derivation= DERIVATION_NONE;
    repertoire= MY_REPERTOIRE_UNICODE30;
  }
  DTCollation(CHARSET_INFO *collation_arg)
  {
    /*
      This constructor version is used in combination with Field constructors,
      to pass "CHARSET_INFO" instead of the full DTCollation.
      Therefore, derivation is set to DERIVATION_IMPLICIT, which is the
      proper derivation for table fields.
      We should eventually remove all code pieces that pass "CHARSET_INFO"
      (e.g. in storage engine sources) and fix to pass the full DTCollation
      instead. Then, this constructor can be removed.
    */
    collation= collation_arg;
    derivation= DERIVATION_IMPLICIT;
    repertoire= my_charset_repertoire(collation_arg);
  }
  DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg)
  {
    collation= collation_arg;
    derivation= derivation_arg;
    set_repertoire_from_charset(collation_arg);
  }
  DTCollation(CHARSET_INFO *collation_arg,
              Derivation derivation_arg,
              my_repertoire_t repertoire_arg)
   :collation(collation_arg),
    derivation(derivation_arg),
    repertoire(repertoire_arg)
  { }
  void set(const DTCollation &dt)
  {
    *this= dt;
  }
  void set(CHARSET_INFO *collation_arg, Derivation derivation_arg)
  {
    collation= collation_arg;
    derivation= derivation_arg;
    set_repertoire_from_charset(collation_arg);
  }
  void set(CHARSET_INFO *collation_arg,
           Derivation derivation_arg,
           my_repertoire_t repertoire_arg)
  {
    collation= collation_arg;
    derivation= derivation_arg;
    repertoire= repertoire_arg;
  }
  void set(CHARSET_INFO *collation_arg)
  {
    collation= collation_arg;
    set_repertoire_from_charset(collation_arg);
  }
  void set(Derivation derivation_arg)
  { derivation= derivation_arg; }
  bool aggregate(const DTCollation &dt, uint flags= 0);
  bool set(DTCollation &dt1, DTCollation &dt2, uint flags= 0)
  { set(dt1); return aggregate(dt2, flags); }
  const char *derivation_name() const
  {
    switch(derivation)
    {
      case DERIVATION_NUMERIC:   return "NUMERIC";
      case DERIVATION_IGNORABLE: return "IGNORABLE";
      case DERIVATION_COERCIBLE: return "COERCIBLE";
      case DERIVATION_IMPLICIT:  return "IMPLICIT";
      case DERIVATION_SYSCONST:  return "SYSCONST";
      case DERIVATION_EXPLICIT:  return "EXPLICIT";
      case DERIVATION_NONE:      return "NONE";
      default: return "UNKNOWN";
    }
  }
  int sortcmp(const Binary_string *s, const Binary_string *t) const
  {
    return collation->strnncollsp(s->ptr(), s->length(),
                                  t->ptr(), t->length());
  }
};


class DTCollation_numeric: public DTCollation
{
public:
  DTCollation_numeric()
   :DTCollation(charset_info(), DERIVATION_NUMERIC, MY_REPERTOIRE_NUMERIC)
  { }
  static const CHARSET_INFO *charset_info() { return &my_charset_numeric; }
  static const DTCollation & singleton();
};


static inline uint32
char_to_byte_length_safe(size_t char_length_arg, uint32 mbmaxlen_arg)
{
  ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg;
  return tmp > UINT_MAX32 ? (uint32) UINT_MAX32 : static_cast<uint32>(tmp);
}

class Type_numeric_attributes
{
public:
  static uint count_unsigned(Item **item, uint nitems);
  static uint32 find_max_char_length(Item **item, uint nitems);
  static uint32 find_max_octet_length(Item **item, uint nitems);
  static decimal_digits_t find_max_decimal_int_part(Item **item, uint nitems);
  static decimal_digits_t find_max_decimals(Item **item, uint nitems);
public:
  /*
    The maximum value length in characters multiplied by collation->mbmaxlen.
    Almost always it's the maximum value length in bytes.
  */
  uint32 max_length;
  decimal_digits_t decimals;
  bool unsigned_flag;
public:
  Type_numeric_attributes()
   :max_length(0), decimals(0), unsigned_flag(false)
  { }
  Type_numeric_attributes(uint32 max_length_arg, decimal_digits_t decimals_arg,
                          bool unsigned_flag_arg)
   :max_length(max_length_arg),
    decimals(decimals_arg),
    unsigned_flag(unsigned_flag_arg)
  { }
protected:
  void aggregate_numeric_attributes_real(Item **item, uint nitems);
  void aggregate_numeric_attributes_decimal(Item **item, uint nitems,
                                            bool unsigned_arg);
};



class Type_temporal_attributes: public Type_numeric_attributes
{
public:
  Type_temporal_attributes(uint32 int_part_length, decimal_digits_t dec, bool unsigned_arg)
   :Type_numeric_attributes(int_part_length + (dec ? 1 : 0),
                            MY_MIN(dec,
                                   (decimal_digits_t) TIME_SECOND_PART_DIGITS),
                            unsigned_arg)
  {
    max_length+= decimals;
  }
};


class Type_temporal_attributes_not_fixed_dec: public Type_numeric_attributes
{
public:
  Type_temporal_attributes_not_fixed_dec(uint32 int_part_length, decimal_digits_t dec,
                                         bool unsigned_flag)
   :Type_numeric_attributes(int_part_length, dec, unsigned_flag)
  {
    if (decimals == NOT_FIXED_DEC)
      max_length+= TIME_SECOND_PART_DIGITS + 1;
    else if (decimals)
    {
      set_if_smaller(decimals, TIME_SECOND_PART_DIGITS);
      max_length+= decimals + 1;
    }
  }
};


/**
  A class to store type attributes for the standard data types.
  Does not include attributes for the extended data types
  such as ENUM, SET, GEOMETRY.
*/
class Type_std_attributes: public Type_numeric_attributes
{
public:
  DTCollation collation;
  Type_std_attributes()
   :collation(&my_charset_bin, DERIVATION_COERCIBLE)
  { }
  Type_std_attributes(const Type_numeric_attributes &nattr,
                      const DTCollation &dtc)
   :Type_numeric_attributes(nattr), collation(dtc)
  { }
  void set(const Type_std_attributes *other)
  {
    *this= *other;
  }
  void set(const Type_std_attributes &other)
  {
    *this= other;
  }
  void set(const Type_numeric_attributes &nattr, const DTCollation &dtc)
  {
    *this= Type_std_attributes(nattr, dtc);
  }
  uint32 max_char_length() const
  { return max_length / collation.collation->mbmaxlen; }
  void fix_length_and_charset(uint32 max_char_length_arg, CHARSET_INFO *cs)
  {
    max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
    collation.collation= cs;
  }
  void fix_char_length(uint32 max_char_length_arg)
  {
    max_length= char_to_byte_length_safe(max_char_length_arg,
                                         collation.collation->mbmaxlen);
  }
  void fix_attributes_temporal(uint32 int_part_length, decimal_digits_t dec)
  {
    *this= Type_std_attributes(
             Type_temporal_attributes(int_part_length, dec, false),
             DTCollation_numeric());
  }
  void fix_attributes_date()
  {
    fix_attributes_temporal(MAX_DATE_WIDTH, 0);
  }
  void fix_attributes_time(decimal_digits_t dec)
  {
    fix_attributes_temporal(MIN_TIME_WIDTH, dec);
  }
  void fix_attributes_datetime(decimal_digits_t dec)
  {
    fix_attributes_temporal(MAX_DATETIME_WIDTH, dec);
  }

  void aggregate_attributes_int(Item **items, uint nitems)
  {
    collation= DTCollation_numeric();
    fix_char_length(find_max_char_length(items, nitems));
    unsigned_flag= count_unsigned(items, nitems) > 0;
    decimals= 0;
  }
  void aggregate_attributes_real(Item **items, uint nitems)
  {
    collation= DTCollation_numeric();
    aggregate_numeric_attributes_real(items, nitems);
  }
  void aggregate_attributes_decimal(Item **items, uint nitems,
                                    bool unsigned_arg)
  {
    collation= DTCollation_numeric();
    aggregate_numeric_attributes_decimal(items, nitems,
                                         (unsigned_flag= unsigned_arg));
  }
  bool aggregate_attributes_string(const LEX_CSTRING &func_name,
                                   Item **item, uint nitems);
  void aggregate_attributes_temporal(uint int_part_length,
                                     Item **item, uint nitems)
  {
    fix_attributes_temporal(int_part_length, find_max_decimals(item, nitems));
  }

  bool agg_item_collations(DTCollation &c, const LEX_CSTRING &name,
                           Item **items, uint nitems,
                           uint flags, int item_sep);
  struct Single_coll_err
  {
    const DTCollation& coll;
    bool first;
  };
  bool agg_item_set_converter(const DTCollation &coll,
                              const LEX_CSTRING &name,
                              Item **args, uint nargs,
                              uint flags, int item_sep,
                              const Single_coll_err *single_item_err= NULL);

  /*
    Collect arguments' character sets together.
    We allow to apply automatic character set conversion in some cases.
    The conditions when conversion is possible are:
    - arguments A and B have different charsets
    - A wins according to coercibility rules
      (i.e. a column is stronger than a string constant,
       an explicit COLLATE clause is stronger than a column)
    - character set of A is either superset for character set of B,
      or B is a string constant which can be converted into the
      character set of A without data loss.

    If all of the above is true, then it's possible to convert
    B into the character set of A, and then compare according
    to the collation of A.

    For functions with more than two arguments:

      collect(A,B,C) ::= collect(collect(A,B),C)

    Since this function calls THD::change_item_tree() on the passed Item **
    pointers, it is necessary to pass the original Item **'s, not copies.
    Otherwise their values will not be properly restored (see BUG#20769).
    If the items are not consecutive (eg. args[2] and args[5]), use the
    item_sep argument, ie.

      agg_item_charsets(coll, fname, &args[2], 2, flags, 3)
  */
  bool agg_arg_charsets(DTCollation &c, const LEX_CSTRING &func_name,
                        Item **items, uint nitems,
                        uint flags, int item_sep)
  {
    if (agg_item_collations(c, func_name, items, nitems, flags, item_sep))
      return true;
    return agg_item_set_converter(c, func_name, items, nitems, flags, item_sep);
  }
  /*
    Aggregate arguments for string result, e.g: CONCAT(a,b)
    - convert to @@character_set_connection if all arguments are numbers
    - allow DERIVATION_NONE
  */
  bool agg_arg_charsets_for_string_result(DTCollation &c,
                                          const LEX_CSTRING &func_name,
                                          Item **items, uint nitems,
                                          int item_sep)
  {
    uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
                MY_COLL_ALLOW_COERCIBLE_CONV |
                MY_COLL_ALLOW_NUMERIC_CONV;
    return agg_arg_charsets(c, func_name, items, nitems, flags, item_sep);
  }
  /*
    Aggregate arguments for string result, when some comparison
    is involved internally, e.g: REPLACE(a,b,c)
    - convert to @@character_set_connection if all arguments are numbers
    - disallow DERIVATION_NONE
  */
  bool agg_arg_charsets_for_string_result_with_comparison(DTCollation &c,
                                                          const LEX_CSTRING &func_name,
                                                          Item **items,
                                                          uint nitems,
                                                          int item_sep)
  {
    uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
                MY_COLL_ALLOW_COERCIBLE_CONV |
                MY_COLL_ALLOW_NUMERIC_CONV |
                MY_COLL_DISALLOW_NONE;
    return agg_arg_charsets(c, func_name, items, nitems, flags, item_sep);
  }

  /*
    Aggregate arguments for comparison, e.g: a=b, a LIKE b, a RLIKE b
    - don't convert to @@character_set_connection if all arguments are numbers
    - don't allow DERIVATION_NONE
  */
  bool agg_arg_charsets_for_comparison(DTCollation &c,
                                       const LEX_CSTRING &func_name,
                                       Item **items, uint nitems,
                                       int item_sep)
  {
    uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
                MY_COLL_ALLOW_COERCIBLE_CONV |
                MY_COLL_DISALLOW_NONE;
    return agg_arg_charsets(c, func_name, items, nitems, flags, item_sep);
  }

};


class Type_all_attributes: public Type_std_attributes
{
public:
  Type_all_attributes() = default;
  Type_all_attributes(const Type_all_attributes &) = default;
  virtual ~Type_all_attributes() = default;
  virtual void set_type_maybe_null(bool maybe_null_arg)= 0;
  virtual uint32 character_octet_length() const { return max_length; }
  // Returns total number of decimal digits
  virtual decimal_digits_t decimal_precision() const= 0;
  virtual const TYPELIB *get_typelib() const= 0;
  virtual void set_typelib(const TYPELIB *typelib)= 0;
};


class Type_cmp_attributes
{
public:
  virtual ~Type_cmp_attributes() = default;
  virtual CHARSET_INFO *compare_collation() const= 0;
};


class Type_cast_attributes
{
  CHARSET_INFO *m_charset;
  ulonglong m_length;
  ulonglong m_decimals;
  bool m_length_specified;
  bool m_decimals_specified;
public:
  Type_cast_attributes(const char *c_len, const char *c_dec, CHARSET_INFO *cs)
    :m_charset(cs), m_length(0), m_decimals(0),
     m_length_specified(false), m_decimals_specified(false)
  {
    set_length_and_dec(c_len, c_dec);
  }
  Type_cast_attributes(CHARSET_INFO *cs)
    :m_charset(cs), m_length(0), m_decimals(0),
     m_length_specified(false), m_decimals_specified(false)
  { }
  void set_length_and_dec(const char *c_len, const char *c_dec)
  {
    int error;
    /*
      We don't have to check for error here as sql_yacc.yy has guaranteed
      that the values are in range of ulonglong
    */
    if ((m_length_specified= (c_len != NULL)))
      m_length= (ulonglong) my_strtoll10(c_len, NULL, &error);
    if ((m_decimals_specified= (c_dec != NULL)))
      m_decimals= (ulonglong) my_strtoll10(c_dec, NULL, &error);
  }
  CHARSET_INFO *charset() const { return m_charset; }
  bool length_specified() const { return m_length_specified; }
  bool decimals_specified() const { return m_decimals_specified; }
  ulonglong length() const { return m_length; }
  ulonglong decimals() const { return m_decimals; }
};


class Name: private LEX_CSTRING
{
public:
  Name(const char *str_arg, uint length_arg)
  {
    DBUG_ASSERT(length_arg < UINT_MAX32);
    LEX_CSTRING::str= str_arg;
    LEX_CSTRING::length= length_arg;
  }
  Name(const LEX_CSTRING &lcs)
  {
    LEX_CSTRING::str= lcs.str;
    LEX_CSTRING::length= lcs.length;
  }
  const char *ptr() const { return LEX_CSTRING::str; }
  uint length() const { return (uint) LEX_CSTRING::length; }
  const LEX_CSTRING &lex_cstring() const { return *this; }
  bool eq(const LEX_CSTRING &other) const
  {
    return !system_charset_info->strnncoll(LEX_CSTRING::str, LEX_CSTRING::length,
                                           other.str, other.length);
  }
};


class Bit_addr
{
  /**
    Byte where the bit is stored inside a record.
    If the corresponding Field is a NOT NULL field, this member is NULL.
  */
  uchar *m_ptr;
  /**
    Offset of the bit inside m_ptr[0], in the range 0..7.
  */
  uchar m_offs;
public:
  Bit_addr()
   :m_ptr(NULL),
    m_offs(0)
  { }
  Bit_addr(uchar *ptr, uchar offs)
   :m_ptr(ptr), m_offs(offs)
  {
    DBUG_ASSERT(ptr || offs == 0);
    DBUG_ASSERT(offs < 8);
  }
  Bit_addr(bool maybe_null)
   :m_ptr(maybe_null ? (uchar *) "" : NULL),
    m_offs(0)
  { }
  uchar *ptr() const { return m_ptr; }
  uchar offs() const { return m_offs; }
  uchar bit() const { return static_cast<uchar>(m_ptr ? 1U << m_offs : 0); }
  void inc()
  {
    DBUG_ASSERT(m_ptr);
    m_ptr+= (m_offs == 7);
    m_offs= (m_offs + 1) & 7;
  }
};


class Record_addr
{
  uchar *m_ptr;      // Position of the field in the record
  Bit_addr m_null;   // Position and offset of the null bit
public:
  Record_addr(uchar *ptr_arg,
              uchar *null_ptr_arg,
              uchar null_bit_arg)
   :m_ptr(ptr_arg),
    m_null(null_ptr_arg, null_bit_arg)
  { }
  Record_addr(uchar *ptr, const Bit_addr &null)
   :m_ptr(ptr),
    m_null(null)
  { }
  Record_addr(bool maybe_null)
   :m_ptr(NULL),
    m_null(maybe_null)
  { }
  uchar *ptr() const { return m_ptr; }
  const Bit_addr &null() const { return m_null; }
  uchar *null_ptr() const { return m_null.ptr(); }
  uchar null_bit() const { return m_null.bit(); }
};


class Information_schema_numeric_attributes
{
  enum enum_attr
  {
    ATTR_NONE= 0,
    ATTR_PRECISION= 1,
    ATTR_SCALE= 2,
    ATTR_PRECISION_AND_SCALE= (ATTR_PRECISION|ATTR_SCALE)
  };
  uint m_precision;
  decimal_digits_t m_scale;
  enum_attr m_available_attributes;
public:
  Information_schema_numeric_attributes()
   :m_precision(0), m_scale(0),
    m_available_attributes(ATTR_NONE)
  { }
  Information_schema_numeric_attributes(uint precision)
   :m_precision(precision), m_scale(0),
    m_available_attributes(ATTR_PRECISION)
  { }
  Information_schema_numeric_attributes(uint precision, decimal_digits_t scale)
   :m_precision(precision), m_scale(scale),
    m_available_attributes(ATTR_PRECISION_AND_SCALE)
  { }
  bool has_precision() const { return m_available_attributes & ATTR_PRECISION; }
  bool has_scale() const { return m_available_attributes & ATTR_SCALE; }
  uint precision() const
  {
    DBUG_ASSERT(has_precision());
    return (uint) m_precision;
  }
  decimal_digits_t scale() const
  {
    DBUG_ASSERT(has_scale());
    return m_scale;
  }
};


class Information_schema_character_attributes
{
  uint32 m_octet_length;
  uint32 m_char_length;
  bool m_is_set;
public:
  Information_schema_character_attributes()
   :m_octet_length(0), m_char_length(0), m_is_set(false)
  { }
  Information_schema_character_attributes(uint32 octet_length,
                                          uint32 char_length)
   :m_octet_length(octet_length), m_char_length(char_length), m_is_set(true)
  { }
  bool has_octet_length() const { return m_is_set; }
  bool has_char_length() const { return m_is_set; }
  uint32 octet_length() const
  {
    DBUG_ASSERT(has_octet_length());
    return m_octet_length;
  }
  uint char_length() const
  {
    DBUG_ASSERT(has_char_length());
    return m_char_length;
  }
};


enum vers_kind_t
{
  VERS_UNDEFINED= 0,
  VERS_TIMESTAMP,
  VERS_TRX_ID
};


class Vers_type_handler
{
protected:
  Vers_type_handler() = default;
public:
  virtual ~Vers_type_handler() = default;
  virtual vers_kind_t kind() const
  {
    DBUG_ASSERT(0);
    return VERS_UNDEFINED;
  }
  virtual bool check_sys_fields(const LEX_CSTRING &table_name,
                                const Column_definition *row_start,
                                const Column_definition *row_end) const= 0;
};


class Vers_type_timestamp: public Vers_type_handler
{
public:
  vers_kind_t kind() const override
  {
    return VERS_TIMESTAMP;
  }
  bool check_sys_fields(const LEX_CSTRING &table_name,
                        const Column_definition *row_start,
                        const Column_definition *row_end) const override;
};
extern Vers_type_timestamp vers_type_timestamp;


class Vers_type_trx: public Vers_type_handler
{
public:
  vers_kind_t kind() const override
  {
    return VERS_TRX_ID;
  }
  bool check_sys_fields(const LEX_CSTRING &table_name,
                        const Column_definition *row_start,
                        const Column_definition *row_end) const override;
};
extern MYSQL_PLUGIN_IMPORT Vers_type_trx vers_type_trx;


class Type_handler
{
  Name m_name;
protected:
  String *print_item_value_csstr(THD *thd, Item *item, String *str) const;
  String *print_item_value_temporal(THD *thd, Item *item, String *str,
                                     const Name &type_name, String *buf) const;
  void make_sort_key_longlong(uchar *to,
                              bool maybe_null, bool null_value,
                              bool unsigned_flag,
                              longlong value) const;
  void store_sort_key_longlong(uchar *to, bool unsigned_flag,
                               longlong value) const;

  uint make_packed_sort_key_longlong(uchar *to, bool maybe_null,
                                     bool null_value, bool unsigned_flag,
                                     longlong value,
                                     const SORT_FIELD_ATTR *sort_field) const;

  bool Item_func_or_sum_illegal_param(const LEX_CSTRING &name) const;
  bool Item_func_or_sum_illegal_param(const Item_func_or_sum *) const;
  bool check_null(const Item *item, st_value *value) const;
  bool Item_send_str(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_tiny(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_short(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_long(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_longlong(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_float(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_double(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_time(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_date(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_timestamp(Item *item, Protocol *protocol, st_value *buf) const;
  bool Item_send_datetime(Item *item, Protocol *protocol, st_value *buf) const;
  bool Column_definition_prepare_stage2_legacy(Column_definition *c,
                                               enum_field_types type)
                                               const;
  bool Column_definition_prepare_stage2_legacy_num(Column_definition *c,
                                                   enum_field_types type)
                                                   const;
  bool Column_definition_prepare_stage2_legacy_real(Column_definition *c,
                                                    enum_field_types type)
                                                    const;
public:
  static const Type_handler *handler_by_name(THD *thd, const LEX_CSTRING &name);
  static const Type_handler *handler_by_name_or_error(THD *thd,
                                                      const LEX_CSTRING &name);
  static const Type_handler *handler_by_log_event_data_type(
                                             THD *thd,
                                             const Log_event_data_type &type);
  static const Type_handler *odbc_literal_type_handler(const LEX_CSTRING *str);
  static const Type_handler *blob_type_handler(uint max_octet_length);
  static const Type_handler *string_type_handler(uint max_octet_length);
  static const Type_handler *bit_and_int_mixture_handler(uint max_char_len);
  static const Type_handler *type_handler_long_or_longlong(uint max_char_len,
                                                           bool unsigned_flag);
  /**
    Return a string type handler for Item
    If too_big_for_varchar() returns a BLOB variant, according to length.
    If max_length > 0 create a VARCHAR(n)
    If max_length == 0 create a CHAR(0)
    @param item - the Item to get the handler to.
  */
  static const Type_handler *varstring_type_handler(const Item *item);
  static const Type_handler *blob_type_handler(const Item *item);
  static const Type_handler *get_handler_by_field_type(enum_field_types type);
  static const Type_handler *get_handler_by_real_type(enum_field_types type);
  static const Type_collection *
    type_collection_for_aggregation(const Type_handler *h1,
                                    const Type_handler *h2);
  virtual const Type_collection *type_collection() const;
  static const
  Type_handler *aggregate_for_result_traditional(const Type_handler *h1,
                                                 const Type_handler *h2);
  virtual Schema *schema() const;
  static void partition_field_type_not_allowed(const LEX_CSTRING &field_name);
  static bool partition_field_check_result_type(Item *item,
                                                Item_result expected_type);
  static const Name & version_mysql56();
  static const Name & version_mariadb53();

  void set_name(Name n) { DBUG_ASSERT(!m_name.ptr()); m_name= n; }
  const Name name() const { return m_name; }
  virtual const Name version() const;
  virtual const Name &default_value() const= 0;
  virtual uint32 flags() const { return 0; }
  virtual ulong KEY_pack_flags(uint column_nr) const { return 0; }
  bool is_unsigned() const { return flags() & UNSIGNED_FLAG; }
  virtual enum_field_types field_type() const= 0;
  virtual enum_field_types real_field_type() const { return field_type(); }
  /**
    Type code which is used for merging of traditional data types for result
    (for UNION and for hybrid functions such as COALESCE).
    Mapping can be done both ways: old->new, new->old, depending
    on the particular data type implementation:
    - type_handler_var_string (MySQL-4.1 old VARCHAR) is converted to
      new VARCHAR before merging.
      field_type_merge_rules[][] returns new VARCHAR.
    - type_handler_newdate is converted to old DATE before merging.
      field_type_merge_rules[][] returns NEWDATE.
    - Temporal type_handler_xxx2 (new MySQL-5.6 types) are converted to
      corresponding old type codes before merging (e.g. TIME2->TIME).
      field_type_merge_rules[][] returns old type codes (e.g. TIME).
      Then old types codes are supposed to convert to new type codes somehow,
      but they do not. So UNION and COALESCE create old columns.
      This is a bug and should be fixed eventually.
  */
  virtual enum_field_types traditional_merge_field_type() const
  {
    DBUG_ASSERT(is_traditional_scalar_type());
    return field_type();
  }
  virtual enum_field_types type_code_for_protocol() const
  {
    return field_type();
  }
  virtual protocol_send_type_t protocol_send_type() const= 0;
  virtual bool Item_append_extended_type_info(Send_field_extended_metadata *to,
                                              const Item *item) const
  {
    return false;
  }
  virtual Item_result result_type() const= 0;
  virtual Item_result cmp_type() const= 0;
  virtual enum_dynamic_column_type
    dyncol_type(const Type_all_attributes *attr) const= 0;
  virtual enum_mysql_timestamp_type mysql_timestamp_type() const
  {
    return MYSQL_TIMESTAMP_ERROR;
  }
  /*
    Return true if the native format is fully implemented for a data type:
    - Field_xxx::val_native()
    - Item_xxx::val_native() for all classes supporting this data type
    - Type_handler_xxx::cmp_native()
  */
  virtual bool is_val_native_ready() const
  {
    return false;
  }
  /*
    If operations such as:
      UPDATE t1 SET binary_string_field=this_type_field;
    should store this_type_field->val_native() rather than
    this_type_field->val_str().
  */
  virtual bool convert_to_binary_using_val_native() const
  {
    return false;
  }
  virtual bool is_timestamp_type() const
  {
    return false;
  }
  virtual bool is_order_clause_position_type() const
  {
    return false;
  }
  virtual bool is_limit_clause_valid_type() const
  {
    return false;
  }
  /*
    Returns true if this data type supports a hack that
      WHERE notnull_column IS NULL
    finds zero values, e.g.:
      WHERE date_notnull_column IS NULL        ->
      WHERE date_notnull_column = '0000-00-00'
  */
  virtual bool cond_notnull_field_isnull_to_field_eq_zero() const
  {
    return false;
  }
  /**
    Check whether a field type can be partially indexed by a key.
    @param  type   field type
    @retval true   Type can have a prefixed key
    @retval false  Type can not have a prefixed key
  */
  virtual bool type_can_have_key_part() const
  {
    return false;
  }
  virtual bool type_can_have_auto_increment_attribute() const
  {
    return false;
  }
  virtual uint max_octet_length() const { return 0; }
  /**
    Prepared statement long data:
    Check whether this parameter data type is compatible with long data.
    Used to detect whether a long data stream has been supplied to a
    incompatible data type.
  */
  virtual bool is_param_long_data_type() const { return false; }
  /*
    The base type handler "this" is derived from.
    "This" inherits aggregation rules from the base type handler.
  */
  virtual const Type_handler *type_handler_base() const
  {
    return NULL;
  }
  const Type_handler *type_handler_base_or_self() const
  {
    const Type_handler *res= type_handler_base();
    return res ? res : this;
  }
  virtual const Type_handler *type_handler_for_comparison() const= 0;
  virtual const Type_handler *type_handler_for_native_format() const
  {
    return this;
  }
  virtual const Type_handler *type_handler_for_item_field() const
  {
    return this;
  }
  virtual const Type_handler *type_handler_for_tmp_table(const Item *) const
  {
    return this;
  }
  virtual const Type_handler *type_handler_for_union(const Item *) const
  {
    return this;
  }
  virtual const Type_handler *cast_to_int_type_handler() const
  {
    return this;
  }
  virtual const Type_handler *type_handler_unsigned() const
  {
    return this;
  }
  virtual const Type_handler *type_handler_signed() const
  {
    return this;
  }
  virtual bool partition_field_check(const LEX_CSTRING &field_name, Item *)
    const
  {
    partition_field_type_not_allowed(field_name);
    return true;
  }
  virtual bool partition_field_append_value(String *str,
                                            Item *item_expr,
                                            CHARSET_INFO *field_cs,
                                            partition_value_print_mode_t mode)
                                            const;
  virtual int
  stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const= 0;
  virtual CHARSET_INFO *charset_for_protocol(const Item *item) const;
  virtual const Type_handler*
  type_handler_adjusted_to_max_octet_length(uint max_octet_length,
                                            CHARSET_INFO *cs) const
  { return this; }
  virtual bool adjust_spparam_type(Spvar_definition *def, Item *from) const
  {
    return false;
  }
  Type_handler() : m_name(0,0) {}
  virtual ~Type_handler() = default;
  /**
    Determines MariaDB traditional scalar data types that always present
    in the server.
  */
  bool is_traditional_scalar_type() const;
  virtual bool is_scalar_type() const { return true; }
  virtual bool can_return_int() const { return true; }
  virtual bool can_return_decimal() const { return true; }
  virtual bool can_return_real() const { return true; }
  virtual bool can_return_str() const { return true; }
  virtual bool can_return_text() const { return true; }
  virtual bool can_return_date() const { return true; }
  virtual bool can_return_time() const { return true; }
  virtual bool can_return_extract_source(interval_type type) const;
  virtual bool is_bool_type() const { return false; }
  virtual bool is_general_purpose_string_type() const { return false; }
  virtual decimal_digits_t Item_time_precision(THD *thd, Item *item) const;
  virtual decimal_digits_t Item_datetime_precision(THD *thd, Item *item) const;
  virtual decimal_digits_t Item_decimal_scale(const Item *item) const;
  virtual decimal_digits_t Item_decimal_precision(const Item *item) const= 0;
  /*
    Returns how many digits a divisor adds into a division result.
    See Item::divisor_precision_increment() in item.h for more comments.
  */
  virtual decimal_digits_t Item_divisor_precision_increment(const Item *) const;
  /**
    Makes a temporary table Field to handle numeric aggregate functions,
    e.g. SUM(DISTINCT expr), AVG(DISTINCT expr), etc.
  */
  virtual Field *make_num_distinct_aggregator_field(MEM_ROOT *,
                                                    const Item *) const;
  /**
    Makes a temporary table Field to handle RBR replication type conversion.
    @param TABLE    - The conversion table the field is going to be added to.
                      It's used to access to table->in_use->mem_root,
                      to create the new field on the table memory root,
                      as well as to increment statistics in table->share
                      (e.g. table->s->blob_count).
    @param metadata - Metadata from the binary log.
    @param target   - The field in the target table on the slave.

    Note, the data types of "target" and of "this" are not necessarily
    always the same, in general case it's possible that:
            this->field_type() != target->field_type()
    and/or
            this->real_type( ) != target->real_type()

    This method decodes metadata according to this->real_type()
    and creates a new field also according to this->real_type().

    In some cases it lurks into "target", to get some extra information, e.g.:
    - unsigned_flag for numeric fields
    - charset() for string fields
    - typelib and field_length for SET and ENUM
    - geom_type and srid for GEOMETRY
    This information is not available in the binary log, so
    we assume that these fields are the same on the master and on the slave.
  */
  virtual Field *make_conversion_table_field(MEM_ROOT *root,
                                             TABLE *table,
                                             uint metadata,
                                             const Field *target) const= 0;
  virtual void show_binlog_type(const Conv_source &src, const Field &dst,
                                String *str) const;
  virtual uint32 max_display_length_for_field(const Conv_source &src) const= 0;
  /*
    Performs the final data type validation for a UNION element,
    after the regular "aggregation for result" was done.
  */
  virtual bool union_element_finalize(Item_type_holder* item) const
  {
    return false;
  }

  virtual Log_event_data_type user_var_log_event_data_type(uint charset_nr) const
  {
    return Log_event_data_type({NULL,0}/*data type name*/, result_type(),
                               charset_nr, is_unsigned());
  }
  virtual uint Column_definition_gis_options_image(uchar *buff,
                                                   const Column_definition &def)
                                                   const
  {
    return 0;
  }
  virtual bool Column_definition_data_type_info_image(Binary_string *to,
                                                   const Column_definition &def)
                                                   const;
  // Check if the implicit default value is Ok in the current sql_mode
  virtual bool validate_implicit_default_value(THD *thd,
                                               const Column_definition &def)
                                               const;
  // Automatic upgrade, e.g. for ALTER TABLE t1 FORCE
  virtual void Column_definition_implicit_upgrade(Column_definition *c) const
  { }
  // Validate CHECK constraint after the parser
  virtual bool Column_definition_validate_check_constraint(THD *thd,
                                                           Column_definition *c)
                                                           const;
  // Set attributes in the parser
  virtual bool Column_definition_set_attributes(THD *thd,
                                                Column_definition *def,
                                                const Lex_field_type_st &attr,
                                                CHARSET_INFO *cs,
                                                column_definition_type_t type)
                                                const;
  // Fix attributes after the parser
  virtual bool Column_definition_fix_attributes(Column_definition *c) const= 0;
  /*
    Fix attributes from an existing field. Used for:
    - ALTER TABLE (for columns that do not change)
    - DECLARE var TYPE OF t1.col1; (anchored SP variables)
  */
  virtual void Column_definition_reuse_fix_attributes(THD *thd,
                                                      Column_definition *c,
                                                      const Field *field) const
  { }
  virtual bool Column_definition_prepare_stage1(THD *thd,
                                                MEM_ROOT *mem_root,
                                                Column_definition *c,
                                                handler *file,
                                                ulonglong table_flags,
                                                const Column_derived_attributes
                                                      *derived_attr)
                                                const;
  virtual bool Column_definition_bulk_alter(Column_definition *c,
                                            const Column_derived_attributes
                                                  *derived_attr,
                                            const Column_bulk_alter_attributes
                                                  *bulk_alter_attr)
                                            const
  { return false; }
  /*
    This method is called on queries like:
      CREATE TABLE t2 (a INT) AS SELECT a FROM t1;
    I.e. column "a" is queried from another table,
    but its data type is redefined.
    @param OUT def   - The column definition to be redefined
    @param IN  dup   - The column definition to take the data type from
                       (i.e. "a INT" in the above example).
    @param IN file   - Table owner handler. If it does not support certain
                       data types, some conversion can be applied.
                       I.g. true BIT to BIT-AS-CHAR.
    @param IN schema - the owner schema definition, e.g. for the default
                       character set and collation.
    @retval true     - on error
    @retval false    - on success
  */
  virtual bool Column_definition_redefine_stage1(Column_definition *def,
                                                 const Column_definition *dup,
                                                 const handler *file)
                                                 const;
  virtual bool Column_definition_prepare_stage2(Column_definition *c,
                                                handler *file,
                                                ulonglong table_flags) const= 0;
  virtual bool Key_part_spec_init_primary(Key_part_spec *part,
                                          const Column_definition &def,
                                          const handler *file) const;
  virtual bool Key_part_spec_init_unique(Key_part_spec *part,
                                         const Column_definition &def,
                                         const handler *file,
                                         bool *has_key_needed) const;
  virtual bool Key_part_spec_init_multiple(Key_part_spec *part,
                                           const Column_definition &def,
                                           const handler *file) const;
  virtual bool Key_part_spec_init_foreign(Key_part_spec *part,
                                          const Column_definition &def,
                                          const handler *file) const;
  virtual bool Key_part_spec_init_spatial(Key_part_spec *part,
                                          const Column_definition &def) const;
  virtual bool Key_part_spec_init_ft(Key_part_spec *part,
                                     const Column_definition &def) const
  {
    return true; // Error
  }
  virtual Field *make_table_field(MEM_ROOT *root,
                                  const LEX_CSTRING *name,
                                  const Record_addr &addr,
                                  const Type_all_attributes &attr,
                                  TABLE_SHARE *share) const= 0;
  Field *make_and_init_table_field(MEM_ROOT *root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Type_all_attributes &attr,
                                   TABLE *table) const;
  virtual Field *make_schema_field(MEM_ROOT *root,
                                   TABLE *table,
                                   const Record_addr &addr,
                                   const ST_FIELD_INFO &def) const
  {
    DBUG_ASSERT(0);
    return NULL;
  }
  virtual Field *
  make_table_field_from_def(TABLE_SHARE *share,
                            MEM_ROOT *mem_root,
                            const LEX_CSTRING *name,
                            const Record_addr &addr,
                            const Bit_addr &bit,
                            const Column_definition_attributes *attr,
                            uint32 flags) const= 0;
  virtual void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const;
  virtual const Type_handler *type_handler_frm_unpack(const uchar *buffer) const
  {
    return this;
  }
  virtual bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options) const;

  /*
    Create a fixed size key part for a sort key
  */
  virtual void make_sort_key_part(uchar *to, Item *item,
                                  const SORT_FIELD_ATTR *sort_field,
                                  String *tmp) const= 0;

  /*
    create a compact size key part for a sort key
  */
  virtual uint make_packed_sort_key_part(uchar *to, Item *item,
                                         const SORT_FIELD_ATTR *sort_field,
                                         String *tmp) const=0;

  virtual void sort_length(THD *thd,
                          const Type_std_attributes *item,
                          SORT_FIELD_ATTR *attr) const= 0;
  virtual bool is_packable() const { return false; }

  virtual uint32 max_display_length(const Item *item) const= 0;
  virtual uint32 Item_decimal_notation_int_digits(const Item *item) const { return 0; }
  virtual uint32 calc_pack_length(uint32 length) const= 0;
  virtual uint calc_key_length(const Column_definition &def) const;
  virtual void Item_update_null_value(Item *item) const= 0;
  virtual bool Item_save_in_value(THD *thd, Item *item, st_value *value) const= 0;
  virtual void Item_param_setup_conversion(THD *thd, Item_param *) const {}
  virtual void Item_param_set_param_func(Item_param *param,
                                         uchar **pos, ulong len) const;
  virtual bool Item_param_set_from_value(THD *thd,
                                         Item_param *param,
                                         const Type_all_attributes *attr,
                                         const st_value *value) const= 0;
  virtual bool Item_param_val_native(THD *thd,
                                         Item_param *item,
                                         Native *to) const;
  virtual bool Item_send(Item *item, Protocol *p, st_value *buf) const= 0;
  virtual int Item_save_in_field(Item *item, Field *field,
                                 bool no_conversions) const= 0;

  /**
    Return a string representation of the Item value.

    @param thd     thread handle
    @param str     string buffer for representation of the value

    @note
      If the item has a string result type, the string is escaped
      according to its character set.

    @retval
      NULL      on error
    @retval
      non-NULL  a pointer to a a valid string on success
  */
  virtual String *print_item_value(THD *thd, Item *item, String *str) const= 0;

  /**
    Check if
      WHERE expr=value AND expr=const
    can be rewritten as:
      WHERE const=value AND expr=const

    "this" is the comparison handler that is used by "target".

    @param target       - the predicate expr=value,
                          whose "expr" argument will be replaced to "const".
    @param target_expr  - the target's "expr" which will be replaced to "const".
    @param target_value - the target's second argument, it will remain unchanged.
    @param source       - the equality predicate expr=const (or expr<=>const)
                          that can be used to rewrite the "target" part
                          (under certain conditions, see the code).
    @param source_expr  - the source's "expr". It should be exactly equal to
                          the target's "expr" to make condition rewrite possible.
    @param source_const - the source's "const" argument, it will be inserted
                          into "target" instead of "expr".
  */
  virtual bool
  can_change_cond_ref_to_const(Item_bool_func2 *target,
                               Item *target_expr, Item *target_value,
                               Item_bool_func2 *source,
                               Item *source_expr, Item *source_const) const= 0;

  /*
    @brief
      Check if an IN subquery allows materialization or not
    @param
      inner              expression on the inner side of the IN subquery
      outer              expression on the outer side of the IN subquery
      is_in_predicate    SET to true if IN subquery was converted from an
                         IN predicate or we are checking if materialization
                         strategy can be used for an IN predicate
  */
  virtual bool
  subquery_type_allows_materialization(const Item *inner,
                                       const Item *outer,
                                       bool is_in_predicate) const= 0;
  /**
    Make a simple constant replacement item for a constant "src",
    so the new item can futher be used for comparison with "cmp", e.g.:
      src = cmp   ->  replacement = cmp

    "this" is the type handler that is used to compare "src" and "cmp".

    @param thd - current thread, for mem_root
    @param src - The item that we want to replace. It's a const item,
                 but it can be complex enough to calculate on every row.
    @param cmp - The src's comparand.
    @retval    - a pointer to the created replacement Item
    @retval    - NULL, if could not create a replacement (e.g. on EOM).
                 NULL is also returned for ROWs, because instead of replacing
                 a Item_row to a new Item_row, Type_handler_row just replaces
                 its elements.
  */
  virtual Item *make_const_item_for_comparison(THD *thd,
                                               Item *src,
                                               const Item *cmp) const= 0;
  virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const= 0;
  virtual Item *make_constructor_item(THD *thd, List<Item> *args) const
  {
    return NULL;
  }
  /**
    A builder for literals with data type name prefix, e.g.:
      TIME'00:00:00', DATE'2001-01-01', TIMESTAMP'2001-01-01 00:00:00'.
    @param thd          The current thread
    @param str          Character literal
    @param length       Length of str
    @param cs           Character set of the string
    @param send_error   Whether to generate an error on failure

    @retval             A pointer to a new Item on success
                        NULL on error (wrong literal value, EOM)
  */
  virtual Item_literal *create_literal_item(THD *thd,
                                            const char *str, size_t length,
                                            CHARSET_INFO *cs,
                                            bool send_error) const
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  Item_literal *create_literal_item(THD *thd, const String *str,
                                    bool send_error) const
  {
    return create_literal_item(thd, str->ptr(), str->length(), str->charset(),
                               send_error);
  }
  virtual Item *create_typecast_item(THD *thd, Item *item,
                                     const Type_cast_attributes &attr) const
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  virtual Item_copy *create_item_copy(THD *thd, Item *item) const;
  virtual int cmp_native(const Native &a, const Native &b) const
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  virtual bool set_comparator_func(THD *thd, Arg_comparator *cmp) const= 0;
  virtual bool Item_const_eq(const Item_const *a, const Item_const *b,
                             bool binary_cmp) const
  {
    return false;
  }
  virtual bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                             Item *a, Item *b) const= 0;
  virtual bool Item_bool_rowready_func2_fix_length_and_dec(THD *thd,
                                          Item_bool_rowready_func2 *func) const;
  virtual bool Item_hybrid_func_fix_attributes(THD *thd,
                                               const LEX_CSTRING &name,
                                               Type_handler_hybrid_field_type *,
                                               Type_all_attributes *atrr,
                                               Item **items,
                                               uint nitems) const= 0;
  virtual bool Item_func_min_max_fix_attributes(THD *thd,
                                                Item_func_min_max *func,
                                                Item **items,
                                                uint nitems) const;
  virtual bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const= 0;
  virtual bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const= 0;
  virtual bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const= 0;
  virtual
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const= 0;

  virtual bool Item_val_native_with_conversion(THD *thd, Item *item,
                                               Native *to) const
  {
    return true;
  }
  virtual bool Item_val_native_with_conversion_result(THD *thd, Item *item,
                                                      Native *to) const
  {
    return true;
  }

  virtual bool Item_val_bool(Item *item) const= 0;
  virtual void Item_get_date(THD *thd, Item *item,
                             Temporal::Warn *buff, MYSQL_TIME *ltime,
                             date_mode_t fuzzydate) const= 0;
  bool Item_get_date_with_warn(THD *thd, Item *item, MYSQL_TIME *ltime,
                               date_mode_t fuzzydate) const;
  virtual longlong Item_val_int_signed_typecast(Item *item) const= 0;
  virtual longlong Item_val_int_unsigned_typecast(Item *item) const= 0;

  virtual String *Item_func_hex_val_str_ascii(Item_func_hex *item,
                                              String *str) const= 0;

  virtual
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const= 0;
  virtual
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const= 0;
  virtual
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const= 0;
  virtual
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const= 0;
  virtual
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t fuzzydate) const= 0;
  bool Item_func_hybrid_field_type_get_date_with_warn(THD *thd,
                                                Item_func_hybrid_field_type *,
                                                MYSQL_TIME *,
                                                date_mode_t) const;
  virtual
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const= 0;
  virtual
  double Item_func_min_max_val_real(Item_func_min_max *) const= 0;
  virtual
  longlong Item_func_min_max_val_int(Item_func_min_max *) const= 0;
  virtual
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const= 0;
  virtual
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
                                  MYSQL_TIME *, date_mode_t fuzzydate) const= 0;
  virtual bool
  Item_func_between_fix_length_and_dec(Item_func_between *func) const= 0;
  virtual longlong
  Item_func_between_val_int(Item_func_between *func) const= 0;

  virtual cmp_item *
  make_cmp_item(THD *thd, CHARSET_INFO *cs) const= 0;

  virtual in_vector *
  make_in_vector(THD *thd, const Item_func_in *func, uint nargs) const= 0;

  virtual bool
  Item_func_in_fix_comparator_compatible_types(THD *thd, Item_func_in *)
                                                               const= 0;

  virtual bool
  Item_func_round_fix_length_and_dec(Item_func_round *round) const= 0;

  virtual bool
  Item_func_int_val_fix_length_and_dec(Item_func_int_val *func) const= 0;

  virtual bool
  Item_func_abs_fix_length_and_dec(Item_func_abs *func) const= 0;

  virtual bool
  Item_func_neg_fix_length_and_dec(Item_func_neg *func) const= 0;

  virtual bool
  Item_func_signed_fix_length_and_dec(Item_func_signed *item) const;
  virtual bool
  Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item) const;
  virtual bool
  Item_double_typecast_fix_length_and_dec(Item_double_typecast *item) const;
  virtual bool
  Item_float_typecast_fix_length_and_dec(Item_float_typecast *item) const;
  virtual bool
  Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *item) const;
  virtual bool
  Item_char_typecast_fix_length_and_dec(Item_char_typecast *item) const;
  virtual bool
  Item_time_typecast_fix_length_and_dec(Item_time_typecast *item) const;
  virtual bool
  Item_date_typecast_fix_length_and_dec(Item_date_typecast *item) const;
  virtual bool
  Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *item) const;

  virtual bool
  Item_func_plus_fix_length_and_dec(Item_func_plus *func) const= 0;
  virtual bool
  Item_func_minus_fix_length_and_dec(Item_func_minus *func) const= 0;
  virtual bool
  Item_func_mul_fix_length_and_dec(Item_func_mul *func) const= 0;
  virtual bool
  Item_func_div_fix_length_and_dec(Item_func_div *func) const= 0;
  virtual bool
  Item_func_mod_fix_length_and_dec(Item_func_mod *func) const= 0;

  virtual const Vers_type_handler *vers() const { return NULL; }
};


/*
  Special handler for ROW
*/
class Type_handler_row: public Type_handler
{
public:
  virtual ~Type_handler_row() = default;
  const Name &default_value() const override;
  bool validate_implicit_default_value(THD *, const Column_definition &)
    const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  const Type_collection *type_collection() const override;
  bool is_scalar_type() const override { return false; }
  bool can_return_int() const override { return false; }
  bool can_return_decimal() const override { return false; }
  bool can_return_real() const override { return false; }
  bool can_return_str() const override { return false; }
  bool can_return_text() const override { return false; }
  bool can_return_date() const override { return false; }
  bool can_return_time() const override { return false; }
  enum_field_types field_type() const override
  {
    MY_ASSERT_UNREACHABLE();
    return MYSQL_TYPE_NULL;
  };
  protocol_send_type_t protocol_send_type() const override
  {
    MY_ASSERT_UNREACHABLE();
    return PROTOCOL_SEND_STRING;
  }
  Item_result result_type() const override
  {
    return ROW_RESULT;
  }
  Item_result cmp_type() const override
  {
    return ROW_RESULT;
  }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *)
                                       const override
  {
    MY_ASSERT_UNREACHABLE();
    return DYN_COL_NULL;
  }
  const Type_handler *type_handler_for_comparison() const override;
  int stored_field_cmp_to_item(THD *, Field *, Item *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  bool subquery_type_allows_materialization(const Item *, const Item *, bool)
    const override
  {
    MY_ASSERT_UNREACHABLE();
    return false;
  }
  Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  Field *make_conversion_table_field(MEM_ROOT *, TABLE *, uint, const Field *)
    const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  bool Column_definition_fix_attributes(Column_definition *) const override
  {
    return false;
  }
  void Column_definition_reuse_fix_attributes(THD *, Column_definition *,
                                              const Field *) const override
  {
    MY_ASSERT_UNREACHABLE();
  }
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_redefine_stage1(Column_definition *,
                                         const Column_definition *,
                                         const handler *)
                                         const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Column_definition_prepare_stage2(Column_definition *, handler *,
                                        ulonglong) const override
  {
    return false;
  }
  Field *make_table_field(MEM_ROOT *, const LEX_CSTRING *, const Record_addr &,
                          const Type_all_attributes &, TABLE_SHARE *)
    const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override
  {
    MY_ASSERT_UNREACHABLE();
  }
  uint make_packed_sort_key_part(uchar *, Item *, const SORT_FIELD_ATTR *,
                                 String *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  void sort_length(THD *, const Type_std_attributes *, SORT_FIELD_ATTR *)
    const override
  {
    MY_ASSERT_UNREACHABLE();
  }
  uint32 max_display_length(const Item *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  uint32 max_display_length_for_field(const Conv_source &) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  uint32 calc_pack_length(uint32) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  decimal_digits_t Item_decimal_precision(const Item *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return DECIMAL_MAX_PRECISION;
  }
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const
    override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  bool Item_send(Item *, Protocol *, st_value *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  void Item_update_null_value(Item *item) const override;
  int Item_save_in_field(Item *, Field *, bool) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 1;
  }
  String *print_item_value(THD *thd, Item *item, String *str) const override;
  bool can_change_cond_ref_to_const(Item_bool_func2 *, Item *, Item *,
                                   Item_bool_func2 *, Item *, Item *)
    const override
  {
    MY_ASSERT_UNREACHABLE();
    return false;
  }
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp) const
    override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  Item_copy *create_item_copy(THD *, Item *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
                                       const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_val_bool(Item *item) const override
  {
    MY_ASSERT_UNREACHABLE();
    return false;
  }
  void Item_get_date(THD *, Item *, Temporal::Warn *, MYSQL_TIME *ltime,
                     date_mode_t) const override
  {
    MY_ASSERT_UNREACHABLE();
    set_zero_time(ltime, MYSQL_TIMESTAMP_NONE);
  }
  longlong Item_val_int_signed_typecast(Item *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  longlong Item_val_int_unsigned_typecast(Item *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  String *Item_func_hex_val_str_ascii(Item_func_hex *, String *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0.0;
  }
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *ltime,
                                            date_mode_t) const override
  {
    MY_ASSERT_UNREACHABLE();
    set_zero_time(ltime, MYSQL_TIMESTAMP_NONE);
  }

  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  double Item_func_min_max_val_real(Item_func_min_max *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return nullptr;
  }
  bool Item_func_min_max_get_date(THD *, Item_func_min_max*, MYSQL_TIME *,
                                  date_mode_t) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_func_between_fix_length_and_dec(Item_func_between *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs) const
    override;
  bool Item_func_in_fix_comparator_compatible_types(THD *thd,
                                                    Item_func_in *) const
    override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const
    override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;

  bool Item_func_signed_fix_length_and_dec(Item_func_signed *) const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_double_typecast_fix_length_and_dec(Item_double_typecast *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_float_typecast_fix_length_and_dec(Item_float_typecast *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_time_typecast_fix_length_and_dec(Item_time_typecast *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_date_typecast_fix_length_and_dec(Item_date_typecast *) const
    override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }
  bool Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *)
    const override
  {
    MY_ASSERT_UNREACHABLE();
    return true;
  }

  bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const override;
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override;
  bool Item_func_div_fix_length_and_dec(Item_func_div *) const override;
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override;
};


/*
  A common parent class for numeric data type handlers
*/
class Type_handler_numeric: public Type_handler
{
public:
  const Name &default_value() const override;
  String *print_item_value(THD *thd, Item *item, String *str) const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  double Item_func_min_max_val_real(Item_func_min_max *) const override;
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const override;
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
                                  MYSQL_TIME *, date_mode_t fuzzydate) const
    override;
  virtual ~Type_handler_numeric() = default;
  bool can_change_cond_ref_to_const(Item_bool_func2 *target,
                                   Item *target_expr, Item *target_value,
                                   Item_bool_func2 *source,
                                   Item *source_expr, Item *source_const) const
    override;
  bool Item_func_between_fix_length_and_dec(Item_func_between *func) const
    override;
  bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const
    override;
};


/*** Abstract classes for every XXX_RESULT */

class Type_handler_real_result: public Type_handler_numeric
{
public:
  Item_result result_type() const override{ return REAL_RESULT; }
  Item_result cmp_type() const override { return REAL_RESULT; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_DOUBLE;
  }
  virtual ~Type_handler_real_result() = default;
  const Type_handler *type_handler_for_comparison() const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  void Column_definition_reuse_fix_attributes(THD *thd,
                                              Column_definition *c,
                                              const Field *field)
                                              const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options)
                                          const override;
  int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
                               const override;
  bool subquery_type_allows_materialization(const Item *inner,
                                            const Item *outer,
                                            bool is_in_predicate)
                                            const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override;
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *tmp) const override;
  void sort_length(THD *thd,
                   const Type_std_attributes *item,
                   SORT_FIELD_ATTR *attr) const override;
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                     bool binary_cmp) const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  void Item_update_null_value(Item *item) const override;
  int Item_save_in_field(Item *item, Field *field, bool no_conversions)
                         const override;
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp)
                                       const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
                                       const override;
  bool Item_func_min_max_fix_attributes(THD *thd, Item_func_min_max *func,
                                        Item **items, uint nitems)
                                        const override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override;
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override;
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override;
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override;
  bool Item_func_signed_fix_length_and_dec(Item_func_signed *item)
                                           const override;
  bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item)
                                             const override;
  bool Item_val_bool(Item *item) const override;
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
                     MYSQL_TIME *ltime,  date_mode_t fuzzydate) const override;
  longlong Item_val_int_signed_typecast(Item *item) const override;
  longlong Item_val_int_unsigned_typecast(Item *item) const override;
  String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str)
                                      const override;
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const override;
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const override;
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t fuzzydate)
                                            const override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs)
                            const override;
  bool Item_func_in_fix_comparator_compatible_types(THD *thd, Item_func_in *)
                                                    const override;

  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
  bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const override;
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override;
  bool Item_func_div_fix_length_and_dec(Item_func_div *) const override;
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override;
};


class Type_handler_decimal_result: public Type_handler_numeric
{
public:
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_STRING;
  }
  Item_result result_type() const override { return DECIMAL_RESULT; }
  Item_result cmp_type() const override { return DECIMAL_RESULT; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *) const
    override
  {
    return DYN_COL_DECIMAL;
  }
  virtual ~Type_handler_decimal_result() = default;
  const Type_handler *type_handler_for_comparison() const override;
  int stored_field_cmp_to_item(THD *, Field *field, Item *item) const override
  {
    VDec item_val(item);
    return item_val.is_null() ? 0 : my_decimal(field).cmp(item_val.ptr());
  }
  bool subquery_type_allows_materialization(const Item *inner,
                                            const Item *outer,
                                            bool is_in_predicate)
    const override;
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *)
    const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override;
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *tmp) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options)
                                          const override;
  void sort_length(THD *thd,
                   const Type_std_attributes *item,
                   SORT_FIELD_ATTR *attr) const override;
  uint32 max_display_length(const Item *item) const override;
  uint32 Item_decimal_notation_int_digits(const Item *item) const override;
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                     bool binary_cmp) const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override
  {
    VDec va(a), vb(b);
    return va.ptr() && vb.ptr() && !va.cmp(vb);
  }
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_str(item, protocol, buf);
  }
  void Item_update_null_value(Item *item) const override;
  int Item_save_in_field(Item *item, Field *field, bool no_conversions) const
    override;
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp) const
    override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
    const override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const override;
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override;
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override;
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance*) const override;
  bool Item_val_bool(Item *item) const override
  {
    return VDec(item).to_bool();
  }
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
                     MYSQL_TIME *ltime,  date_mode_t fuzzydate) const override;
  longlong Item_val_int_signed_typecast(Item *item) const override;
  longlong Item_val_int_unsigned_typecast(Item *item) const override
  {
    return VDec(item).to_longlong(true);
  }
  String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str)
    const override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
    const override;
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
    const override;
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t fuzzydate)
    const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *)
    const override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs)
    const override;
  bool Item_func_in_fix_comparator_compatible_types(THD *thd, Item_func_in *)
    const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
  bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const override;
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override;
  bool Item_func_div_fix_length_and_dec(Item_func_div *) const override;
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override;
};


class Type_limits_int
{
private:
  uint32 m_precision;
  uint32 m_char_length;
public:
  Type_limits_int(uint32 prec, uint32 nchars)
   :m_precision(prec), m_char_length(nchars)
  { }
  uint32 precision() const { return m_precision; }
  uint32 char_length() const { return m_char_length; }
};


/*
  UNDIGNED TINYINT:    0..255   digits=3 nchars=3
  SIGNED TINYINT  : -128..127   digits=3 nchars=4
*/
class Type_limits_uint8: public Type_limits_int
{
public:
  Type_limits_uint8()
   :Type_limits_int(MAX_TINYINT_WIDTH, MAX_TINYINT_WIDTH)
  { }
};


class Type_limits_sint8: public Type_limits_int
{
public:
  Type_limits_sint8()
   :Type_limits_int(MAX_TINYINT_WIDTH, MAX_TINYINT_WIDTH + 1)
  { }
};


/*
  UNDIGNED SMALLINT:       0..65535  digits=5 nchars=5
  SIGNED SMALLINT:    -32768..32767  digits=5 nchars=6
*/
class Type_limits_uint16: public Type_limits_int
{
public:
  Type_limits_uint16()
   :Type_limits_int(MAX_SMALLINT_WIDTH, MAX_SMALLINT_WIDTH)
  { }
};


class Type_limits_sint16: public Type_limits_int
{
public:
  Type_limits_sint16()
   :Type_limits_int(MAX_SMALLINT_WIDTH, MAX_SMALLINT_WIDTH + 1)
  { }
};


/*
  MEDIUMINT UNSIGNED         0 .. 16777215  digits=8 char_length=8
  MEDIUMINT SIGNED:   -8388608 ..  8388607  digits=7 char_length=8
*/
class Type_limits_uint24: public Type_limits_int
{
public:
  Type_limits_uint24()
   :Type_limits_int(MAX_MEDIUMINT_WIDTH, MAX_MEDIUMINT_WIDTH)
  { }
};


class Type_limits_sint24: public Type_limits_int
{
public:
  Type_limits_sint24()
   :Type_limits_int(MAX_MEDIUMINT_WIDTH - 1, MAX_MEDIUMINT_WIDTH)
  { }
};


/*
  UNSIGNED INT:           0..4294967295  digits=10 nchars=10
  SIGNED INT:   -2147483648..2147483647  digits=10 nchars=11
*/
class Type_limits_uint32: public Type_limits_int
{
public:
  Type_limits_uint32()
   :Type_limits_int(MAX_INT_WIDTH, MAX_INT_WIDTH)
  { }
};



class Type_limits_sint32: public Type_limits_int
{
public:
  Type_limits_sint32()
   :Type_limits_int(MAX_INT_WIDTH, MAX_INT_WIDTH + 1)
  { }
};


/*
  UNSIGNED BIGINT:                  0..18446744073709551615 digits=20 nchars=20
  SIGNED BIGINT:  -9223372036854775808..9223372036854775807 digits=19 nchars=20
*/
class Type_limits_uint64: public Type_limits_int
{
public:
  Type_limits_uint64(): Type_limits_int(MAX_BIGINT_WIDTH, MAX_BIGINT_WIDTH)
  { }
};


class Type_limits_sint64: public Type_limits_int
{
public:
  Type_limits_sint64()
   :Type_limits_int(MAX_BIGINT_WIDTH - 1, MAX_BIGINT_WIDTH)
  { }
};



class Type_handler_int_result: public Type_handler_numeric
{
public:
  Item_result result_type() const override { return INT_RESULT; }
  Item_result cmp_type() const override { return INT_RESULT; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr) const override
  {
    return attr->unsigned_flag ? DYN_COL_UINT : DYN_COL_INT;
  }
  bool is_order_clause_position_type() const override { return true; }
  bool is_limit_clause_valid_type() const override { return true; }
  virtual ~Type_handler_int_result() = default;
  const Type_handler *type_handler_for_comparison() const override;
  int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const override;
  bool subquery_type_allows_materialization(const Item *inner,
                                            const Item *outer,
                                            bool is_in_predicate)
    const override;
  Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override;
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *tmp) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  void sort_length(THD *thd,
                   const Type_std_attributes *item,
                   SORT_FIELD_ATTR *attr) const override;
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                     bool binary_cmp) const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  void Item_update_null_value(Item *item) const override;
  int Item_save_in_field(Item *item, Field *field, bool no_conversions) const override;
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems) const override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override;
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override;
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override;
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override;
  bool Item_val_bool(Item *item) const override;
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
                     MYSQL_TIME *ltime,  date_mode_t fuzzydate) const override;
  longlong Item_val_int_signed_typecast(Item *item) const override;
  longlong Item_val_int_unsigned_typecast(Item *item) const override;
  String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const override;
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const override;
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t fuzzydate) const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const override;
  bool Item_func_in_fix_comparator_compatible_types(THD *thd,
                                                    Item_func_in *) const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
  bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const override;
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override;
  bool Item_func_div_fix_length_and_dec(Item_func_div *) const override;
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override;
  const Vers_type_handler *vers() const override { return &vers_type_trx; }
};


class Type_handler_general_purpose_int: public Type_handler_int_result
{
public:
  bool type_can_have_auto_increment_attribute() const override { return true; }
  virtual const Type_limits_int *type_limits_int() const= 0;
  uint32 max_display_length(const Item *item) const override
  {
    return type_limits_int()->char_length();
  }
  uint32 Item_decimal_notation_int_digits(const Item *item) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items,
                                       uint nitems) const override;
  bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
    const override
  {
    return partition_field_check_result_type(item_expr, INT_RESULT);
  }
  bool partition_field_append_value(String *str,
                                    Item *item_expr,
                                    CHARSET_INFO *field_cs,
                                    partition_value_print_mode_t)
                                    const override;
  const Vers_type_handler *vers() const override { return &vers_type_trx; }
};


class Type_handler_temporal_result: public Type_handler
{
protected:
  decimal_digits_t Item_decimal_scale_with_seconds(const Item *item) const;
  decimal_digits_t Item_divisor_precision_increment_with_seconds(const Item *) const;
public:
  Item_result result_type() const override { return STRING_RESULT; }
  Item_result cmp_type() const override { return TIME_RESULT; }
  virtual ~Type_handler_temporal_result() = default;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override;
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *tmp) const override;
  void sort_length(THD *thd,
                   const Type_std_attributes *item,
                   SORT_FIELD_ATTR *attr) const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                     bool binary_cmp) const override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  uint32 max_display_length(const Item *item) const override;
  uint32 Item_decimal_notation_int_digits(const Item *item) const override;
  bool can_change_cond_ref_to_const(Item_bool_func2 *target,
                                   Item *target_expr, Item *target_value,
                                   Item_bool_func2 *source,
                                   Item *source_expr, Item *source_const)
    const override;
  bool subquery_type_allows_materialization(const Item *inner,
                                            const Item *outer,
                                            bool is_in_predicate)
    const override;
  bool Item_func_min_max_fix_attributes(THD *thd, Item_func_min_max *func,
                                        Item **items, uint nitems)
    const override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const override;
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override;
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override;
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *)const override;
  bool Item_val_bool(Item *item) const override;
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
                     MYSQL_TIME *ltime,  date_mode_t fuzzydate) const override;
  longlong Item_val_int_signed_typecast(Item *item) const override;
  longlong Item_val_int_unsigned_typecast(Item *item) const override;
  String *Item_func_hex_val_str_ascii(Item_func_hex *, String *)const override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const override;
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const override;
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t) const override;
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
                                  MYSQL_TIME *, date_mode_t) const override;
  bool Item_func_between_fix_length_and_dec(Item_func_between *)const override;
  bool Item_func_in_fix_comparator_compatible_types(THD *, Item_func_in *)
    const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
  bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const override;
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override;
  bool Item_func_div_fix_length_and_dec(Item_func_div *) const override;
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override;
  const Vers_type_handler *vers() const override;
};


class Type_handler_string_result: public Type_handler
{
  decimal_digits_t Item_temporal_precision(THD *thd, Item *item, bool is_time) const;
public:
  const Name &default_value() const override;
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_STRING;
  }
  Item_result result_type() const override { return STRING_RESULT; }
  Item_result cmp_type() const override { return STRING_RESULT; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *) const
    override
  {
    return DYN_COL_STRING;
  }
  CHARSET_INFO *charset_for_protocol(const Item *item) const override;
  virtual ~Type_handler_string_result() = default;
  const Type_handler *type_handler_for_comparison() const override;
  int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const
    override;
  const Type_handler *
  type_handler_adjusted_to_max_octet_length(uint max_octet_length,
                                            CHARSET_INFO *cs) const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override;
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *tmp) const override;
  void sort_length(THD *thd,
                   const Type_std_attributes *item,
                   SORT_FIELD_ATTR *attr) const override;
  bool is_packable() const override { return true; }
  bool union_element_finalize(Item_type_holder* item) const override;
  uint calc_key_length(const Column_definition &def) const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_redefine_stage1(Column_definition *def,
                                         const Column_definition *dup,
                                         const handler *file)
                                         const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  uint32 max_display_length(const Item *item) const override;
  /*
    The next method returns 309 for long stringified doubles in scientific
    notation, e.g. FORMAT('1e308', 2).
  */
  uint32 Item_decimal_notation_int_digits(const Item *item) const override
  { return 309; }
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                     bool binary_cmp) const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  decimal_digits_t Item_time_precision(THD *thd, Item *item) const override
  {
    return Item_temporal_precision(thd, item, true);
  }
  decimal_digits_t Item_datetime_precision(THD *thd, Item *item) const override
  {
    return Item_temporal_precision(thd, item, false);
  }
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  void Item_update_null_value(Item *item) const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
  void Item_param_setup_conversion(THD *thd, Item_param *) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_str(item, protocol, buf);
  }
  int Item_save_in_field(Item *item, Field *field, bool no_conversions) const
    override;
  String *print_item_value(THD *thd, Item *item, String *str) const override
  {
    return print_item_value_csstr(thd, item, str);
  }
  bool can_change_cond_ref_to_const(Item_bool_func2 *target,
                                   Item *target_expr, Item *target_value,
                                   Item_bool_func2 *source,
                                   Item *source_expr, Item *source_const) const
    override;
  bool subquery_type_allows_materialization(const Item *inner,
                                            const Item *outer,
                                            bool is_in_predicate)
    const override;
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp) const
    override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems) const
    override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override;
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override;
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override;
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override;
  bool Item_func_signed_fix_length_and_dec(Item_func_signed *item) const
    override;
  bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item) const
    override;
  bool Item_val_bool(Item *item) const override;
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
                     MYSQL_TIME *ltime,  date_mode_t fuzzydate) const override;
  longlong Item_val_int_signed_typecast(Item *item) const override;
  longlong Item_val_int_unsigned_typecast(Item *item) const override;
  String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const
    override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
    const override;
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
    const override;
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t fuzzydate)
    const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const
    override;
  double Item_func_min_max_val_real(Item_func_min_max *) const override;
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const override;
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
                                  MYSQL_TIME *, date_mode_t fuzzydate) const
    override;
  bool Item_func_between_fix_length_and_dec(Item_func_between *func) const
    override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const
    override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const
    override;
  bool Item_func_in_fix_comparator_compatible_types(THD *thd, Item_func_in *)
    const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
  bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const override;
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override;
  bool Item_func_div_fix_length_and_dec(Item_func_div *) const override;
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override;
  const Vers_type_handler *vers() const override;
};


class Type_handler_general_purpose_string: public Type_handler_string_result
{
public:
  bool is_general_purpose_string_type() const override { return true; }
  bool Column_definition_bulk_alter(Column_definition *c,
                                    const Column_derived_attributes
                                          *derived_attr,
                                    const Column_bulk_alter_attributes
                                          *bulk_alter_attr)
                                    const override;
};


/***
  Instantiable classes for every MYSQL_TYPE_XXX

  There are no Type_handler_xxx for the following types:
  - MYSQL_TYPE_VAR_STRING (old VARCHAR) - mapped to MYSQL_TYPE_VARSTRING
  - MYSQL_TYPE_ENUM                     - mapped to MYSQL_TYPE_VARSTRING
  - MYSQL_TYPE_SET:                     - mapped to MYSQL_TYPE_VARSTRING

  because the functionality that currently uses Type_handler
  (e.g. hybrid type functions) does not need to distinguish between
  these types and VARCHAR.
  For example:
    CREATE TABLE t2 AS SELECT COALESCE(enum_column) FROM t1;
  creates a VARCHAR column.

  There most likely be Type_handler_enum and Type_handler_set later,
  when the Type_handler infrastructure gets used in more pieces of the code.
*/


class Type_handler_tiny: public Type_handler_general_purpose_int
{
public:
  virtual ~Type_handler_tiny() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_TINY; }
  const Type_handler *type_handler_unsigned() const override;
  const Type_handler *type_handler_signed() const override;
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_TINY;
  }
  const Type_limits_int *type_limits_int() const override;
  uint32 calc_pack_length(uint32 length) const override { return 1; }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 4; }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_tiny(item, protocol, buf);
  }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_TINY); }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
};


class Type_handler_utiny: public Type_handler_tiny
{
public:
  uint flags() const override { return UNSIGNED_FLAG; }
  const Type_limits_int *type_limits_int() const override;
};


class Type_handler_short: public Type_handler_general_purpose_int
{
public:
  virtual ~Type_handler_short() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_SHORT; }
  const Type_handler *type_handler_unsigned() const override;
  const Type_handler *type_handler_signed() const override;
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_SHORT;
  }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_short(item, protocol, buf);
  }
  const Type_limits_int *type_limits_int() const override;
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 6; }
  uint32 calc_pack_length(uint32 length) const  override{ return 2; }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_SHORT); }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
};


class Type_handler_ushort: public Type_handler_short
{
public:
  uint flags() const override { return UNSIGNED_FLAG; }
  const Type_limits_int *type_limits_int() const override;
};


class Type_handler_long: public Type_handler_general_purpose_int
{
public:
  virtual ~Type_handler_long() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_LONG; }
  const Type_handler *type_handler_unsigned() const override;
  const Type_handler *type_handler_signed() const override;
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_LONG;
  }
  const Type_limits_int *type_limits_int() const override;
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 11; }
  uint32 calc_pack_length(uint32 length) const override { return 4; }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_long(item, protocol, buf);
  }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_LONG); }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
};


/*
  The expression of this type reports itself as signed,
  however it's known not to return negative values.
  Items of this data type count only digits in Item::max_length,
  without adding +1 for the sign. This allows expressions
  of this type convert nicely to VARCHAR and DECIMAL.
  For example, YEAR(now()) is:
  - VARCHAR(4) in a string context
  - DECIMAL(4,0) in a decimal context
  - but INT(5) in an integer context
*/
class Type_handler_long_ge0: public Type_handler_long
{
public:
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  bool Item_func_signed_fix_length_and_dec(Item_func_signed *item)
                                           const override;
  bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item)
                                             const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_ulong: public Type_handler_long
{
public:
  uint flags() const override { return UNSIGNED_FLAG; }
  const Type_limits_int *type_limits_int() const override;
};


class Type_handler_bool: public Type_handler_long
{
public:
  bool is_bool_type() const override { return true; }
  const Type_handler *type_handler_unsigned() const override;
  const Type_handler *type_handler_signed() const override;
  void Item_update_null_value(Item *item) const override;
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  int Item_save_in_field(Item *item, Field *field, bool no_conversions)
                         const override;
};


class Type_handler_longlong: public Type_handler_general_purpose_int
{
public:
  virtual ~Type_handler_longlong() = default;
  enum_field_types field_type() const  override{ return MYSQL_TYPE_LONGLONG; }
  const Type_handler *type_handler_unsigned() const override;
  const Type_handler *type_handler_signed() const override;
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_LONGLONG;
  }
  const Type_limits_int *type_limits_int() const override;
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 20; }
  uint32 calc_pack_length(uint32 length) const override { return 8; }
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_longlong(item, protocol, buf);
  }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  {
    return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_LONGLONG);
  }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
};


class Type_handler_ulonglong: public Type_handler_longlong
{
public:
  uint flags() const override { return UNSIGNED_FLAG; }
  const Type_limits_int *type_limits_int() const override;
};


class Type_handler_vers_trx_id: public Type_handler_ulonglong
{
public:
  virtual ~Type_handler_vers_trx_id() = default;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
};


class Type_handler_int24: public Type_handler_general_purpose_int
{
public:
  virtual ~Type_handler_int24() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_INT24; }
  const Type_handler *type_handler_unsigned() const override;
  const Type_handler *type_handler_signed() const override;
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_LONG;
  }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_long(item, protocol, buf);
  }
  const Type_limits_int *type_limits_int() const override;
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 9; }
  uint32 calc_pack_length(uint32 length) const override { return 3; }
  Field *make_conversion_table_field(MEM_ROOT *mem_root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_INT24); }
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_uint24: public Type_handler_int24
{
public:
  uint flags() const override { return UNSIGNED_FLAG; }
  const Type_limits_int *type_limits_int() const override;
};


class Type_handler_year: public Type_handler_int_result
{
public:
  virtual ~Type_handler_year() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_YEAR; }
  uint flags() const override { return UNSIGNED_FLAG; }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_SHORT;
  }
  uint32 max_display_length(const Item *item) const override;
  uint32 Item_decimal_notation_int_digits(const Item *item) const override
  { return 4; };
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 4; }
  uint32 calc_pack_length(uint32 length) const override { return 1; }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_short(item, protocol, buf);
  }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  void Column_definition_reuse_fix_attributes(THD *thd,
                                              Column_definition *c,
                                              const Field *field)
                                              const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_YEAR); }
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *)const override;
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
                     MYSQL_TIME *ltime,  date_mode_t fuzzydate) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *item,
                                            Temporal::Warn *,
                                            MYSQL_TIME *to,
                                            date_mode_t fuzzydate)
                                            const override;
  const Vers_type_handler *vers() const override { return NULL; }
};


class Type_handler_bit: public Type_handler_int_result
{
public:
  virtual ~Type_handler_bit() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_BIT; }
  uint flags() const override { return UNSIGNED_FLAG; }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_STRING;
  }
  uint32 max_display_length(const Item *item) const override;
  uint32 Item_decimal_notation_int_digits(const Item *item) const override;
  static uint32 Bit_decimal_notation_int_digits_by_nbits(uint nbits);
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override { return length / 8; }
  uint calc_key_length(const Column_definition &def) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_str(item, protocol, buf);
  }
  String *print_item_value(THD *thd, Item *item, String *str) const override
  {
    return print_item_value_csstr(thd, item, str);
  }
  void show_binlog_type(const Conv_source &src, const Field &, String *str)
    const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_redefine_stage1(Column_definition *def,
                                         const Column_definition *dup,
                                         const handler *file)
                                         const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_float: public Type_handler_real_result
{
public:
  virtual ~Type_handler_float() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_FLOAT; }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_FLOAT;
  }
  bool type_can_have_auto_increment_attribute() const override { return true; }
  uint32 max_display_length(const Item *item) const override { return 25; }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 12; }
  uint32 Item_decimal_notation_int_digits(const Item *item) const override
  { return 39; }
  uint32 calc_pack_length(uint32 length) const override { return sizeof(float); }
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_float(item, protocol, buf);
  }
  Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *)
                                            const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_real(c, MYSQL_TYPE_FLOAT); }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;

  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *)
                                    const override;
};


class Type_handler_double: public Type_handler_real_result
{
public:
  virtual ~Type_handler_double() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_DOUBLE; }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_DOUBLE;
  }
  bool type_can_have_auto_increment_attribute() const override { return true; }
  uint32 max_display_length(const Item *item) const override { return 53; }
  uint32 Item_decimal_notation_int_digits(const Item *item) const override
  { return 309; }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 22; }
  uint32 calc_pack_length(uint32 length) const override
  {
    return sizeof(double);
  }
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_double(item, protocol, buf);
  }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_real(c, MYSQL_TYPE_DOUBLE); }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;

  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *)
                                    const override;
};


class Type_handler_time_common: public Type_handler_temporal_result
{
public:
  virtual ~Type_handler_time_common() = default;
  const Name &default_value() const override;
  enum_field_types field_type() const override { return MYSQL_TYPE_TIME; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_TIME;
  }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_TIME;
  }
  enum_mysql_timestamp_type mysql_timestamp_type() const override
  {
    return MYSQL_TIMESTAMP_TIME;
  }
  bool is_val_native_ready() const override { return true; }
  const Type_handler *type_handler_for_native_format() const override;
  int cmp_native(const Native &a, const Native &b) const override;
  bool Item_val_native_with_conversion(THD *thd, Item *, Native *to)
                                       const override;
  bool Item_val_native_with_conversion_result(THD *thd, Item *, Native *to)
                                              const override;
  bool Item_param_val_native(THD *thd, Item_param *item, Native *to)
                             const override;
  bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
    const override
  {
    return partition_field_check_result_type(item_expr, STRING_RESULT);
  }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Item_literal *create_literal_item(THD *thd, const char *str, size_t length,
                                    CHARSET_INFO *cs, bool send_error)
                                    const override;
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr)
                             const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  decimal_digits_t Item_decimal_scale(const Item *item) const override
  {
    return Item_decimal_scale_with_seconds(item);
  }
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  decimal_digits_t Item_divisor_precision_increment(const Item *item) const override
  {
    return Item_divisor_precision_increment_with_seconds(item);
  }
  const Type_handler *type_handler_for_comparison() const override;
  int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
                               const override;
  void Column_definition_implicit_upgrade(Column_definition *c) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options)
                                          const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_time(item, protocol, buf);
  }
  void Item_update_null_value(Item *item) const override;
  int Item_save_in_field(Item *item, Field *field, bool no_conversions)
                         const override;
  String *print_item_value(THD *thd, Item *item, String *str) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  longlong Item_val_int_unsigned_typecast(Item *item) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
                                       const override;
  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
                                              String *) const override;
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const override;
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const override;
  my_decimal *Item_func_hybrid_field_type_val_decimal(
                                              Item_func_hybrid_field_type *,
                                              my_decimal *) const override;
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *,
                                            date_mode_t fuzzydate)
                                            const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
  double Item_func_min_max_val_real(Item_func_min_max *) const override;
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const override;
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
                                  MYSQL_TIME *, date_mode_t fuzzydate)
                                  const override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp)
                                       const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs)
                            const override;
  void Item_param_set_param_func(Item_param *param, uchar **pos, ulong len)
                                 const override;
};


class Type_handler_time: public Type_handler_time_common
{
  /* number of bytes to store TIME(N) */
  static uint m_hires_bytes[MAX_DATETIME_PRECISION+1];
public:
  static uint hires_bytes(uint dec) { return m_hires_bytes[dec]; }
  virtual ~Type_handler_time() = default;
  const Name version() const override { return version_mariadb53(); }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return MIN_TIME_WIDTH; }
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_TIME); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_time2: public Type_handler_time_common
{
public:
  virtual ~Type_handler_time2() = default;
  const Name version() const override { return version_mysql56(); }
  enum_field_types real_field_type() const override { return MYSQL_TYPE_TIME2; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_TIME2); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_temporal_with_date: public Type_handler_temporal_result
{
public:
  virtual ~Type_handler_temporal_with_date() = default;
  Item_literal *create_literal_item(THD *thd, const char *str, size_t length,
                                    CHARSET_INFO *cs, bool send_error)
                                    const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
                               const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value)
                          const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_date(item, protocol, buf);
  }
  void Item_update_null_value(Item *item) const override;
  int Item_save_in_field(Item *item, Field *field, bool no_conversions)
                         const override;
  Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp)
                                       const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs)
                            const override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
};


class Type_handler_date_common: public Type_handler_temporal_with_date
{
public:
  virtual ~Type_handler_date_common() = default;
  const Name &default_value() const override;
  const Type_handler *type_handler_for_comparison() const override;
  enum_field_types field_type() const override { return MYSQL_TYPE_DATE; }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return 3; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_DATE;
  }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_DATE;
  }
  enum_mysql_timestamp_type mysql_timestamp_type() const override
  {
    return MYSQL_TIMESTAMP_DATE;
  }
  bool cond_notnull_field_isnull_to_field_eq_zero() const override
  {
    return true;
  }
  bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
    const override
  {
    return partition_field_check_result_type(item_expr, STRING_RESULT);
  }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Item_literal *create_literal_item(THD *thd, const char *str, size_t length,
                                    CHARSET_INFO *cs, bool send_error)
                                    const override;
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr)
                             const override;
  bool validate_implicit_default_value(THD *thd,
                                       const Column_definition &def)
                                       const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  String *print_item_value(THD *thd, Item *item, String *str) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
  double Item_func_min_max_val_real(Item_func_min_max *) const override;
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems) const
    override;
  bool Item_func_min_max_fix_attributes(THD *thd, Item_func_min_max *func,
                                        Item **items, uint nitems) const
    override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
};

class Type_handler_date: public Type_handler_date_common
{
public:
  virtual ~Type_handler_date() = default;
  uint32 calc_pack_length(uint32 length) const override { return 4; }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_DATE); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_newdate: public Type_handler_date_common
{
public:
  virtual ~Type_handler_newdate() = default;
  enum_field_types real_field_type() const override
  {
    return MYSQL_TYPE_NEWDATE;
  }
  uint32 calc_pack_length(uint32 length) const override { return 3; }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_NEWDATE); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_datetime_common: public Type_handler_temporal_with_date
{
public:
  virtual ~Type_handler_datetime_common() = default;
  const Name &default_value() const override;
  const Type_handler *type_handler_for_comparison() const override;
  enum_field_types field_type() const override
  {
    return MYSQL_TYPE_DATETIME;
  }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_DATETIME;
  }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_DATETIME;
  }
  enum_mysql_timestamp_type mysql_timestamp_type() const override
  {
    return MYSQL_TIMESTAMP_DATETIME;
  }
  bool cond_notnull_field_isnull_to_field_eq_zero() const override
  {
    return true;
  }
  bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
    const override
  {
    return partition_field_check_result_type(item_expr, STRING_RESULT);
  }
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
  bool validate_implicit_default_value(THD *thd, const Column_definition &def)
                                       const override;
  void Column_definition_implicit_upgrade(Column_definition *c) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options)
                                          const override;
  decimal_digits_t Item_decimal_scale(const Item *item) const override
  {
    return Item_decimal_scale_with_seconds(item);
  }
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  decimal_digits_t Item_divisor_precision_increment(const Item *item) const override
  {
    return Item_divisor_precision_increment_with_seconds(item);
  }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_datetime(item, protocol, buf);
  }
  String *print_item_value(THD *thd, Item *item, String *str) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
  double Item_func_min_max_val_real(Item_func_min_max *) const override;
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *, my_decimal *)
                                            const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
                                       const override;
  void Item_param_set_param_func(Item_param *param, uchar **pos, ulong len)
                                 const override;
};


class Type_handler_datetime: public Type_handler_datetime_common
{
  /* number of bytes to store DATETIME(N) */
  static uint m_hires_bytes[MAX_DATETIME_PRECISION + 1];
public:
  static uint hires_bytes(uint dec) { return m_hires_bytes[dec]; }
  virtual ~Type_handler_datetime() = default;
  const Name version() const override { return version_mariadb53(); }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return MAX_DATETIME_WIDTH; }
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_DATETIME); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_datetime2: public Type_handler_datetime_common
{
public:
  virtual ~Type_handler_datetime2() = default;
  const Name version() const override { return version_mysql56(); }
  enum_field_types real_field_type() const override
  {
    return MYSQL_TYPE_DATETIME2;
  }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_DATETIME2); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_timestamp_common: public Type_handler_temporal_with_date
{
protected:
  bool TIME_to_native(THD *, const MYSQL_TIME *from, Native *to, uint dec) const;
public:
  virtual ~Type_handler_timestamp_common() = default;
  const Name &default_value() const override;
  const Type_handler *type_handler_for_comparison() const override;
  const Type_handler *type_handler_for_native_format() const override;
  enum_field_types field_type() const override { return MYSQL_TYPE_TIMESTAMP; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_DATETIME;
  }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_DATETIME;
  }
  enum_mysql_timestamp_type mysql_timestamp_type() const override
  {
    return MYSQL_TIMESTAMP_DATETIME;
  }
  bool is_val_native_ready() const override
  {
    return true;
  }
  bool is_timestamp_type() const override
  {
    return true;
  }
  void Column_definition_implicit_upgrade(Column_definition *c) const override;
  bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options)
                                          const override;
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override;
  bool Item_val_native_with_conversion(THD *thd, Item *, Native *to)
                                       const override;
  bool Item_val_native_with_conversion_result(THD *thd, Item *, Native *to)
                                              const override;
  bool Item_param_val_native(THD *thd, Item_param *item, Native *to)
                             const override;
  int cmp_native(const Native &a, const Native &b) const override;
  longlong Item_func_between_val_int(Item_func_between *func) const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
  in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs)
                            const override;
  void make_sort_key_part(uchar *to, Item *item,
                          const SORT_FIELD_ATTR *sort_field,
                          String *tmp) const override;
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *tmp) const override;
  void sort_length(THD *thd,
                   const Type_std_attributes *item,
                   SORT_FIELD_ATTR *attr) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  decimal_digits_t Item_decimal_scale(const Item *item) const override
  {
    return Item_decimal_scale_with_seconds(item);
  }
  decimal_digits_t Item_decimal_precision(const Item *item) const override;
  decimal_digits_t Item_divisor_precision_increment(const Item *item) const override
  {
    return Item_divisor_precision_increment_with_seconds(item);
  }
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override
  {
    return Item_send_timestamp(item, protocol, buf);
  }
  int Item_save_in_field(Item *item, Field *field, bool no_conversions)
                         const override;
  String *print_item_value(THD *thd, Item *item, String *str) const override;
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
  Item_copy *create_item_copy(THD *thd, Item *item) const override;
  String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
  double Item_func_min_max_val_real(Item_func_min_max *) const override;
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *) const override;
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
                                       const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
                                  MYSQL_TIME *, date_mode_t fuzzydate)
                                  const override;
};


class Type_handler_timestamp: public Type_handler_timestamp_common
{
  /* number of bytes to store second_part part of the TIMESTAMP(N) */
  static uint m_sec_part_bytes[MAX_DATETIME_PRECISION + 1];
public:
  static uint sec_part_bytes(uint dec) { return m_sec_part_bytes[dec]; }
  virtual ~Type_handler_timestamp() = default;
  const Name version() const override { return version_mariadb53(); }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  { return MAX_DATETIME_WIDTH; }
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_TIMESTAMP); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_timestamp2: public Type_handler_timestamp_common
{
public:
  virtual ~Type_handler_timestamp2() = default;
  const Name version() const override { return version_mysql56(); }
  enum_field_types real_field_type() const override
  {
    return MYSQL_TYPE_TIMESTAMP2;
  }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  {
    return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_TIMESTAMP2);
  }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_olddecimal: public Type_handler_decimal_result
{
public:
  virtual ~Type_handler_olddecimal() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_DECIMAL; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override { return length; }
  const Type_handler *type_handler_for_tmp_table(const Item *item) const override;
  const Type_handler *type_handler_for_union(const Item *item) const override;
  void show_binlog_type(const Conv_source &src, const Field &, String *str)
    const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_DECIMAL); }
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_newdecimal: public Type_handler_decimal_result
{
public:
  virtual ~Type_handler_newdecimal() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_NEWDECIMAL; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  uint calc_key_length(const Column_definition &def) const override;
  void show_binlog_type(const Conv_source &src, const Field &, String *str)
    const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_redefine_stage1(Column_definition *def,
                                         const Column_definition *dup,
                                         const handler *file)
                                         const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_null: public Type_handler_general_purpose_string
{
public:
  virtual ~Type_handler_null() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_NULL; }
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_NULL;
  }
  const Type_handler *type_handler_for_comparison() const override;
  const Type_handler *type_handler_for_tmp_table(const Item *item) const override;
  const Type_handler *type_handler_for_union(const Item *) const override;
  uint32 max_display_length(const Item *item) const override { return 0; }
  uint32 max_display_length_for_field(const Conv_source &src) const override
  {
    return 0;
  }
  uint32 calc_pack_length(uint32 length) const override { return 0; }
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                     bool binary_cmp) const override;
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
  bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool union_element_finalize(Item_type_holder* item) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_redefine_stage1(Column_definition *def,
                                         const Column_definition *dup,
                                         const handler *file)
                                         const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_NULL); }
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


class Type_handler_longstr: public Type_handler_general_purpose_string
{
public:
  bool type_can_have_key_part() const override
  {
    return true;
  }
};


class Type_handler_string: public Type_handler_longstr
{
public:
  virtual ~Type_handler_string() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_STRING; }
  ulong KEY_pack_flags(uint column_nr) const override
  {
    return HA_PACK_KEY;
  }
  bool is_param_long_data_type() const override { return true; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override { return length; }
  const Type_handler *type_handler_for_tmp_table(const Item *item) const
    override
  {
    return varstring_type_handler(item);
  }
  bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
    const override
  {
    return partition_field_check_result_type(item_expr, STRING_RESULT);
  }
  void show_binlog_type(const Conv_source &src, const Field &dst, String *str)
    const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_set_attributes(THD *thd,
                                        Column_definition *def,
                                        const Lex_field_type_st &attr,
                                        CHARSET_INFO *cs,
                                        column_definition_type_t type)
                                        const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  bool Key_part_spec_init_ft(Key_part_spec *part,
                             const Column_definition &def) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


/* Old varchar */
class Type_handler_var_string: public Type_handler_string
{
public:
  virtual ~Type_handler_var_string() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_VAR_STRING; }
  enum_field_types real_field_type() const override { return MYSQL_TYPE_STRING; }
  enum_field_types traditional_merge_field_type() const override
  {
    return MYSQL_TYPE_VARCHAR;
  }
  const Type_handler *type_handler_for_tmp_table(const Item *item) const override
  {
    return varstring_type_handler(item);
  }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  void show_binlog_type(const Conv_source &src, const Field &dst, String *str)
    const override;
  void Column_definition_implicit_upgrade(Column_definition *c) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override
  { return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_STRING); }
  const Type_handler *type_handler_for_union(const Item *item) const override
  {
    return varstring_type_handler(item);
  }
};


class Type_handler_varchar: public Type_handler_longstr
{
public:
  virtual ~Type_handler_varchar() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_VARCHAR; }
  ulong KEY_pack_flags(uint column_nr) const override
  {
    if (column_nr == 0)
      return HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY;
    return HA_PACK_KEY;
  }
  enum_field_types type_code_for_protocol() const override
  {
    return MYSQL_TYPE_VAR_STRING; // Keep things compatible for old clients
  }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override
  {
    return (length + (length < 256 ? 1: 2));
  }
  const Type_handler *type_handler_for_tmp_table(const Item *item) const
    override
  {
    return varstring_type_handler(item);
  }
  const Type_handler *type_handler_for_union(const Item *item) const override
  {
    return varstring_type_handler(item);
  }
  bool is_param_long_data_type() const override { return true; }
  bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
    const override
  {
    return partition_field_check_result_type(item_expr, STRING_RESULT);
  }
  void show_binlog_type(const Conv_source &src, const Field &dst, String *str)
    const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  bool Column_definition_set_attributes(THD *thd,
                                        Column_definition *def,
                                        const Lex_field_type_st &attr,
                                        CHARSET_INFO *cs,
                                        column_definition_type_t type)
                                        const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  bool Key_part_spec_init_ft(Key_part_spec *part,
                             const Column_definition &def) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  bool adjust_spparam_type(Spvar_definition *def, Item *from) const override;
};


class Type_handler_hex_hybrid: public Type_handler_varchar
{
public:
  virtual ~Type_handler_hex_hybrid() = default;
  const Type_handler *cast_to_int_type_handler() const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
};


class Type_handler_varchar_compressed: public Type_handler_varchar
{
public:
  enum_field_types real_field_type() const override
  {
    return MYSQL_TYPE_VARCHAR_COMPRESSED;
  }
  ulong KEY_pack_flags(uint column_nr) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  bool partition_field_check(const LEX_CSTRING &field_name, Item *)
    const override
  {
    partition_field_type_not_allowed(field_name);
    return true;
  }
  void show_binlog_type(const Conv_source &src, const Field &dst, String *str)
    const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    DBUG_ASSERT(0);
    return DYN_COL_STRING;
  }
};


class Type_handler_blob_common: public Type_handler_longstr
{
public:
  virtual ~Type_handler_blob_common() = default;
  virtual uint length_bytes() const= 0;
  ulong KEY_pack_flags(uint column_nr) const override
  {
    if (column_nr == 0)
      return HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY;
    return HA_PACK_KEY;
  }
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  const Type_handler *type_handler_for_tmp_table(const Item *item) const
    override
  {
    return blob_type_handler(item);
  }
  const Type_handler *type_handler_for_union(const Item *item) const override
  {
    return blob_type_handler(item);
  }
  bool subquery_type_allows_materialization(const Item *, const Item *, bool)
    const override
  {
    return false; // Materialization does not work with BLOB columns
  }
  bool is_param_long_data_type() const override { return true; }
  uint calc_key_length(const Column_definition &def) const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  bool Key_part_spec_init_ft(Key_part_spec *part,
                             const Column_definition &def) const override;
  bool Key_part_spec_init_primary(Key_part_spec *part,
                                  const Column_definition &def,
                                  const handler *file) const override;
  bool Key_part_spec_init_unique(Key_part_spec *part,
                                 const Column_definition &def,
                                 const handler *file,
                                 bool *has_key_needed) const override;
  bool Key_part_spec_init_multiple(Key_part_spec *part,
                                   const Column_definition &def,
                                   const handler *file) const override;
  bool Key_part_spec_init_foreign(Key_part_spec *part,
                                  const Column_definition &def,
                                  const handler *file) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems) const
    override;
  void Item_param_setup_conversion(THD *thd, Item_param *) const override;

  bool partition_field_check(const LEX_CSTRING &field_name,
                             Item *item_expr) const override;
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  const Vers_type_handler *vers() const override;
};


class Type_handler_tiny_blob: public Type_handler_blob_common
{
public:
  virtual ~Type_handler_tiny_blob() = default;
  uint length_bytes() const override { return 1; }
  enum_field_types field_type() const override { return MYSQL_TYPE_TINY_BLOB; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  uint max_octet_length() const override { return UINT_MAX8; }
};


class Type_handler_medium_blob: public Type_handler_blob_common
{
public:
  virtual ~Type_handler_medium_blob() = default;
  uint length_bytes() const override { return 3; }
  enum_field_types field_type() const override
  { return MYSQL_TYPE_MEDIUM_BLOB; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  uint max_octet_length() const override { return UINT_MAX24; }
};


class Type_handler_long_blob: public Type_handler_blob_common
{
public:
  virtual ~Type_handler_long_blob() = default;
  uint length_bytes() const override { return 4; }
  enum_field_types field_type() const override { return MYSQL_TYPE_LONG_BLOB; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  uint max_octet_length() const override { return UINT_MAX32; }
};


class Type_handler_blob: public Type_handler_blob_common
{
public:
  virtual ~Type_handler_blob() = default;
  uint length_bytes() const override { return 2; }
  enum_field_types field_type() const override { return MYSQL_TYPE_BLOB; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  uint max_octet_length() const override { return UINT_MAX16; }
};


class Type_handler_blob_compressed: public Type_handler_blob
{
public:
  enum_field_types real_field_type() const override
  {
    return MYSQL_TYPE_BLOB_COMPRESSED;
  }
  ulong KEY_pack_flags(uint) const override
  {
    MY_ASSERT_UNREACHABLE();
    return 0;
  }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  void show_binlog_type(const Conv_source &src, const Field &, String *str)
    const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  enum_dynamic_column_type dyncol_type(const Type_all_attributes *)
                                       const override
  {
    DBUG_ASSERT(0);
    return DYN_COL_STRING;
  }
};


class Type_handler_typelib: public Type_handler_general_purpose_string
{
public:
  virtual ~Type_handler_typelib() = default;
  enum_field_types field_type() const override { return MYSQL_TYPE_STRING; }
  const Type_handler *type_handler_for_item_field() const override;
  const Type_handler *cast_to_int_type_handler() const override;
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *,
                                       Type_all_attributes *atrr,
                                       Item **items, uint nitems)
                                       const override;
  void Column_definition_reuse_fix_attributes(THD *thd,
                                              Column_definition *c,
                                              const Field *field)
                                              const override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_redefine_stage1(Column_definition *def,
                                         const Column_definition *dup,
                                         const handler *file)
                                         const override;
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
  const Vers_type_handler *vers() const override { return NULL; }
};


class Type_handler_enum: public Type_handler_typelib
{
public:
  virtual ~Type_handler_enum() = default;
  enum_field_types real_field_type() const override { return MYSQL_TYPE_ENUM; }
  enum_field_types traditional_merge_field_type() const override
  {
    return MYSQL_TYPE_ENUM;
  }
  uint32 calc_pack_length(uint32 length) const override;
  uint calc_key_length(const Column_definition &def) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target)
                                     const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
  Field *make_schema_field(MEM_ROOT *root,
                           TABLE *table,
                           const Record_addr &addr,
                           const ST_FIELD_INFO &def) const override;
};


class Type_handler_set: public Type_handler_typelib
{
public:
  virtual ~Type_handler_set() = default;
  enum_field_types real_field_type() const override { return MYSQL_TYPE_SET; }
  enum_field_types traditional_merge_field_type() const override
  {
    return MYSQL_TYPE_SET;
  }
  uint32 calc_pack_length(uint32 length) const override;
  uint calc_key_length(const Column_definition &def) const override;
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target)
                                     const override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;
  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;
};


// A pseudo type handler, mostly for test purposes for now
class Type_handler_interval_DDhhmmssff: public Type_handler_long_blob
{
public:
  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override;
};


class Function_collection
{
public:
  virtual ~Function_collection() = default;
  virtual bool init()= 0;
  virtual void cleanup()= 0;
  virtual Create_func *find_native_function_builder(THD *thd,
                                                    const LEX_CSTRING &name)
                                                    const= 0;
};


class Type_collection
{
public:
  virtual ~Type_collection() = default;
  virtual bool init(Type_handler_data *) { return false; }
  virtual const Type_handler *aggregate_for_result(const Type_handler *h1,
                                                   const Type_handler *h2)
                                                   const= 0;
  virtual const Type_handler *aggregate_for_comparison(const Type_handler *h1,
                                                       const Type_handler *h2)
                                                       const= 0;
  virtual const Type_handler *aggregate_for_min_max(const Type_handler *h1,
                                                    const Type_handler *h2)
                                                    const= 0;
  virtual const Type_handler *aggregate_for_num_op(const Type_handler *h1,
                                                   const Type_handler *h2)
                                                   const= 0;
};


/**
  A handler for hybrid type functions, e.g.
  COALESCE(), IF(), IFNULL(), NULLIF(), CASE,
  numeric operators,
  UNIX_TIMESTAMP(), TIME_TO_SEC().

  Makes sure that field_type(), cmp_type() and result_type()
  are always in sync to each other for hybrid functions.
*/
class Type_handler_hybrid_field_type
{
  const Type_handler *m_type_handler;
  bool aggregate_for_min_max(const Type_handler *other);

public:
  Type_handler_hybrid_field_type();
  Type_handler_hybrid_field_type(const Type_handler *handler)
   :m_type_handler(handler)
  { }
  Type_handler_hybrid_field_type(const Type_handler_hybrid_field_type *other)
    :m_type_handler(other->m_type_handler)
  { }
  void swap(Type_handler_hybrid_field_type &other)
  {
    swap_variables(const Type_handler *, m_type_handler, other.m_type_handler);
  }
  const Type_handler *type_handler() const { return m_type_handler; }
  enum_field_types real_field_type() const
  {
    return m_type_handler->real_field_type();
  }
  Item_result cmp_type() const { return m_type_handler->cmp_type(); }
  enum_mysql_timestamp_type mysql_timestamp_type() const
  {
    return m_type_handler->mysql_timestamp_type();
  }
  bool is_timestamp_type() const
  {
    return m_type_handler->is_timestamp_type();
  }
  void set_handler(const Type_handler *other)
  {
    m_type_handler= other;
  }
  const Type_handler *set_handler_by_field_type(enum_field_types type)
  {
    return (m_type_handler= Type_handler::get_handler_by_field_type(type));
  }
  const Type_handler *set_handler_by_real_type(enum_field_types type)
  {
    return (m_type_handler= Type_handler::get_handler_by_real_type(type));
  }
  bool aggregate_for_comparison(const Type_handler *other);
  bool aggregate_for_comparison(const LEX_CSTRING &funcname,
                                Item **items, uint nitems,
                                bool treat_int_to_uint_as_decimal);
  bool aggregate_for_result(const Type_handler *other);
  bool aggregate_for_result(const LEX_CSTRING &funcname,
                            Item **item, uint nitems, bool treat_bit_as_number);
  bool aggregate_for_min_max(const LEX_CSTRING &funcname, Item **item,
                             uint nitems);

  bool aggregate_for_num_op(const class Type_aggregator *aggregator,
                            const Type_handler *h0, const Type_handler *h1);
};


class Type_handler_pair
{
  const Type_handler *m_a;
  const Type_handler *m_b;
public:
  Type_handler_pair(const Type_handler *a,
                    const Type_handler *b)
   :m_a(a), m_b(b)
  { }
  const Type_handler *a() const { return m_a; }
  const Type_handler *b() const { return m_b; }
  /*
    Change both handlers to their parent data type handlers, if available.
    For example, VARCHAR/JSON -> VARCHAR.
    @returns The number of handlers changed (0,1 or 2).
  */
  bool to_base()
  {
    bool rc= false;
    const Type_handler *na= m_a->type_handler_base();
    const Type_handler *nb= m_b->type_handler_base();
    if (na)
    {
      m_a= na; rc= true;
    }
    if (nb)
    {
      m_b= nb; rc= true;
    }
    return rc;
  }
};


/*
  Helper template to simplify creating builtin types with names.
  Plugin types inherit from Type_handler_xxx types that do not set the name in
  the constructor, as sql_plugin.cc sets the type name from the plugin name.
*/
template <typename TypeHandler>
class Named_type_handler : public TypeHandler
{
  public:
  Named_type_handler(const char *n) : TypeHandler()
  { Type_handler::set_name(Name(n, static_cast<uint>(strlen(n)))); }
};

extern Named_type_handler<Type_handler_row>         type_handler_row;
extern Named_type_handler<Type_handler_null>        type_handler_null;

extern Named_type_handler<Type_handler_float>       type_handler_float;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_double>      type_handler_double;

extern Named_type_handler<Type_handler_bit>         type_handler_bit;

extern Named_type_handler<Type_handler_enum>        type_handler_enum;
extern Named_type_handler<Type_handler_set>         type_handler_set;

extern Named_type_handler<Type_handler_string>      type_handler_string;
extern Named_type_handler<Type_handler_var_string>  type_handler_var_string;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_varchar>     type_handler_varchar;
extern Named_type_handler<Type_handler_varchar_compressed> type_handler_varchar_compressed;
extern Named_type_handler<Type_handler_hex_hybrid>  type_handler_hex_hybrid;

extern Named_type_handler<Type_handler_tiny_blob>   type_handler_tiny_blob;
extern Named_type_handler<Type_handler_medium_blob> type_handler_medium_blob;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_long_blob>   type_handler_long_blob;
extern Named_type_handler<Type_handler_blob>        type_handler_blob;
extern Named_type_handler<Type_handler_blob_compressed> type_handler_blob_compressed;

extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_bool>        type_handler_bool;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_tiny>        type_handler_stiny;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_short>       type_handler_sshort;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_int24>       type_handler_sint24;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_long>        type_handler_slong;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_long_ge0>    type_handler_slong_ge0;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_longlong>    type_handler_slonglong;

extern Named_type_handler<Type_handler_utiny>       type_handler_utiny;
extern Named_type_handler<Type_handler_ushort>      type_handler_ushort;
extern Named_type_handler<Type_handler_uint24>      type_handler_uint24;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_ulong>       type_handler_ulong;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_ulonglong>   type_handler_ulonglong;
extern Named_type_handler<Type_handler_vers_trx_id> type_handler_vers_trx_id;

extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_newdecimal>  type_handler_newdecimal;
extern Named_type_handler<Type_handler_olddecimal>  type_handler_olddecimal;

extern Named_type_handler<Type_handler_year>        type_handler_year;
extern Named_type_handler<Type_handler_year>        type_handler_year2;
extern Named_type_handler<Type_handler_newdate>     type_handler_newdate;
extern Named_type_handler<Type_handler_date>        type_handler_date;
extern Named_type_handler<Type_handler_time>        type_handler_time;
extern Named_type_handler<Type_handler_time2>       type_handler_time2;
extern Named_type_handler<Type_handler_datetime>    type_handler_datetime;
extern Named_type_handler<Type_handler_datetime2>   type_handler_datetime2;

extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_timestamp>   type_handler_timestamp;
extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_timestamp2>  type_handler_timestamp2;

extern Type_handler_interval_DDhhmmssff type_handler_interval_DDhhmmssff;

class Type_aggregator
{
  bool m_is_commutative;
public:
  class Pair
  {
  public:
    const Type_handler *m_handler1;
    const Type_handler *m_handler2;
    const Type_handler *m_result;
    Pair() = default;
    Pair(const Type_handler *handler1,
         const Type_handler *handler2,
         const Type_handler *result)
     :m_handler1(handler1), m_handler2(handler2), m_result(result)
    { }
    bool eq(const Type_handler *handler1, const Type_handler *handler2) const
    {
      return m_handler1 == handler1 && m_handler2 == handler2;
    }
  };
  static const Type_handler *
    find_handler_in_array(const Type_aggregator::Pair *pairs,
                          const Type_handler *h1,
                          const Type_handler *h2,
                          bool commutative)
  {
    for (const Type_aggregator::Pair *p= pairs; p->m_result; p++)
    {
      if (p->eq(h1, h2))
        return p->m_result;
      if (commutative && p->eq(h2, h1))
       return p->m_result;
    }
    return NULL;
  }

private:
  Dynamic_array<Pair> m_array;
  const Pair* find_pair(const Type_handler *handler1,
                        const Type_handler *handler2) const;
public:
  Type_aggregator(bool is_commutative= false)
   :m_is_commutative(is_commutative), m_array(PSI_INSTRUMENT_MEM)
  { }
  bool add(const Type_handler *handler1,
           const Type_handler *handler2,
           const Type_handler *result)
  {
    return m_array.append(Pair(handler1, handler2, result));
  }
  const Type_handler *find_handler(const Type_handler *handler1,
                                   const Type_handler *handler2) const
  {
    const Pair* el= find_pair(handler1, handler2);
    return el ? el->m_result : NULL;
  }
  bool is_commutative() const { return m_is_commutative; }
};


class Type_aggregator_commutative: public Type_aggregator
{
public:
  Type_aggregator_commutative()
   :Type_aggregator(true)
  { }
};


class Type_handler_data
{
public:
  Type_aggregator_commutative m_type_aggregator_for_result;
  Type_aggregator_commutative m_type_aggregator_for_comparison;

  Type_aggregator_commutative m_type_aggregator_for_plus;
  Type_aggregator_commutative m_type_aggregator_for_mul;

  Type_aggregator m_type_aggregator_for_minus;
  Type_aggregator m_type_aggregator_for_div;
  Type_aggregator m_type_aggregator_for_mod;
#ifndef DBUG_OFF
  // This is used for mtr purposes in debug builds
  Type_aggregator m_type_aggregator_non_commutative_test;
#endif
  bool init();
};

extern Type_handler_data *type_handler_data;

#endif /* SQL_TYPE_H_INCLUDED */
server/private/rpl_injector.h000064400000022625150400263720012375 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef INJECTOR_H
#define INJECTOR_H

/* Pull in 'byte', 'my_off_t', and 'uint32' */
#include <my_bitmap.h>

#include "rpl_constants.h"
#include "table.h"                              /* TABLE */

/* Forward declarations */
class handler;
class MYSQL_BIN_LOG;
struct TABLE;


/*
  Injector to inject rows into the MySQL server.
  
  The injector class is used to notify the MySQL server of new rows that have
  appeared outside of MySQL control.
 
  The original purpose of this is to allow clusters---which handle replication
  inside the cluster through other means---to insert new rows into binary log.
  Note, however, that the injector should be used whenever rows are altered in
  any manner that is outside of MySQL server visibility and which therefore
  are not seen by the MySQL server.
 */
class injector 
{
public:

  /*
    Get an instance of the injector.

    DESCRIPTION
      The injector is a Singleton, so this static function return the
      available instance of the injector.

    RETURN VALUE
      A pointer to the available injector object.
  */
  static injector *instance();

  /*
    Delete the singleton instance (if allocated). Used during server shutdown.
  */
  static void free_instance();

    /*
      A transaction where rows can be added.

      DESCRIPTION
        The transaction class satisfy the **CopyConstructible** and
        **Assignable** requirements.  Note that the transaction is *not*
        default constructible.
     */
    class transaction {
      friend class injector;
    public:
      /* Convenience definitions */
      typedef uchar* record_type;
      typedef uint32 server_id_type;

      /*
        Table reference.

        RESPONSIBILITY

          The class contains constructors to handle several forms of
          references to tables.  The constructors can implicitly be used to
          construct references from, e.g., strings containing table names.

        EXAMPLE

          The class is intended to be used *by value*.  Please, do not try to
          construct objects of this type using 'new'; instead construct an
          object, possibly a temporary object.  For example:

            injector::transaction::table tbl(share->table, true);
            MY_BITMAP cols;
            my_bitmap_init(&cols, NULL, (i + 7) / 8, false);
            inj->write_row(::server_id, tbl, &cols, row_data);

          or

            MY_BITMAP cols;
            my_bitmap_init(&cols, NULL, (i + 7) / 8, false);
            inj->write_row(::server_id, 
                           injector::transaction::table(share->table, true), 
                           &cols, row_data);

          This will work, be more efficient, and have greater chance of
          inlining, not run the risk of losing pointers.

        COLLABORATION

          injector::transaction
            Provide a flexible interface to the representation of tables.

      */
      class table 
      {
      public:
        table(TABLE *table, bool is_transactional_arg)
            : m_table(table), m_is_transactional(is_transactional_arg)
        { 
        }

        char const *db_name() const { return m_table->s->db.str; }
        char const *table_name() const { return m_table->s->table_name.str; }
        TABLE *get_table() const { return m_table; }
        bool is_transactional() const { return m_is_transactional; }

      private:
        TABLE *m_table;
        bool m_is_transactional;
      };

      /*
        Binlog position as a structure.
      */
      class binlog_pos {
        friend class transaction;
      public:
        char const *file_name() const { return m_file_name; }
        my_off_t file_pos() const { return m_file_pos; }

      private:
        char const *m_file_name;
        my_off_t m_file_pos;
      };

      transaction() : m_thd(NULL) { }
      ~transaction();

      /* Clear transaction, i.e., make calls to 'good()' return false. */
      void clear() { m_thd= NULL; }

      /* Is the transaction in a good state? */
      bool good() const { return m_thd != NULL; }

      /* Default assignment operator: standard implementation */
      transaction& operator=(transaction t) {
        swap(t);
        return *this;
      }
      
      /*

        DESCRIPTION

          Register table for use within the transaction.  All tables
          that are going to be used need to be registered before being
          used below.  The member function will fail with an error if
          use_table() is called after any *_row() function has been
          called for the transaction.

        RETURN VALUE

          0         All OK
          >0        Failure

       */
#ifdef TO_BE_DELETED
      int use_table(server_id_type sid, table tbl);
#endif
      /*
        Commit a transaction.

        This member function will clean up after a sequence of *_row calls by,
        for example, releasing resource and unlocking files.
      */
      int commit();

      /*
        Get the position for the start of the transaction.

        Returns the position in the binary log of the first event in this
        transaction. If no event is yet written, the position where the event
        *will* be written is returned. This position is known, since a
        new_transaction() will lock the binary log and prevent any other
        writes to the binary log.
      */
      binlog_pos start_pos() const;

    private:
      /* Only the injector may construct these object */
      transaction(MYSQL_BIN_LOG *, THD *);

      void swap(transaction& o) {
        /* std::swap(m_start_pos, o.m_start_pos); */
        {
          binlog_pos const tmp= m_start_pos;
          m_start_pos= o.m_start_pos;
          o.m_start_pos= tmp;
        }

        /* std::swap(m_thd, o.m_thd); */
        {
          THD* const tmp= m_thd;
          m_thd= o.m_thd;
          o.m_thd= tmp;
        }
        {
          enum_state const tmp= m_state;
          m_state= o.m_state;
          o.m_state= tmp;
        }
      }

      enum enum_state
      {
        START_STATE,                            /* Start state */
        TABLE_STATE,      /* At least one table has been registered */
        ROW_STATE,          /* At least one row has been registered */
        STATE_COUNT               /* State count and sink state */
      } m_state;

      /*
        Check and update the state.

        PARAMETER(S)

          target_state
              The state we are moving to: TABLE_STATE if we are
              writing a table and ROW_STATE if we are writing a row.

        DESCRIPTION

          The internal state will be updated to the target state if
          and only if it is a legal move.  The only legal moves are:

              START_STATE -> START_STATE
              START_STATE -> TABLE_STATE
              TABLE_STATE -> TABLE_STATE
              TABLE_STATE -> ROW_STATE

          That is:
          - It is not possible to write any row before having written at
            least one table
          - It is not possible to write a table after at least one row
            has been written

        RETURN VALUE

           0    All OK
          -1    Incorrect call sequence
       */
      int check_state(enum_state const target_state)
      {
#ifdef DBUG_TRACE
        static char const *state_name[] = {
          "START_STATE", "TABLE_STATE", "ROW_STATE", "STATE_COUNT"
        };

        DBUG_PRINT("info", ("In state %s", state_name[m_state]));
#endif
        DBUG_ASSERT(target_state <= STATE_COUNT);

        if (m_state <= target_state && target_state <= m_state + 1 &&
            m_state < STATE_COUNT)
          m_state= target_state;
        else
          m_state= STATE_COUNT;
        return m_state == STATE_COUNT ? 1 : 0;
      }


      binlog_pos m_start_pos;
      THD *m_thd;
    };

    /* 
       Create a new transaction.  This member function will prepare for a
       sequence of *_row calls by, for example, reserving resources and
       locking files. There are two overloaded alternatives: one returning a
       transaction by value and one using placement semantics. The following
       two calls are equivalent, with the exception that the latter will
       overwrite the transaction.

         injector::transaction trans1= inj->new_trans(thd);

         injector::transaction trans2;
         inj->new_trans(thd, &trans);
     */
    transaction new_trans(THD *);
    void        new_trans(THD *, transaction *);

    int record_incident(THD*, Incident incident);
    int record_incident(THD*, Incident incident, const LEX_CSTRING *message);

private:
    explicit injector();
    ~injector() = default;             /* Nothing needs to be done */
    injector(injector const&);  /* You're not allowed to copy injector
                                   instances.
                                */ 
};

#endif /* INJECTOR_H */
server/private/sql_time.h000064400000020266150400263720011517 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates.
   Copyright (c) 2011, 2020, MariaDB

   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 */

#ifndef SQL_TIME_INCLUDED
#define SQL_TIME_INCLUDED

#include "sql_basic_types.h"
#include "my_time.h"
#include "mysql_time.h"                         /* timestamp_type */
#include "sql_error.h"                          /* Sql_condition */
#include "structs.h"                            /* INTERVAL */

typedef enum enum_mysql_timestamp_type timestamp_type;
typedef struct st_date_time_format DATE_TIME_FORMAT;
typedef struct st_known_date_time_format KNOWN_DATE_TIME_FORMAT;

/* Flags for calc_week() function.  */
#define WEEK_MONDAY_FIRST    1
#define WEEK_YEAR            2
#define WEEK_FIRST_WEEKDAY   4

ulong convert_period_to_month(ulong period);
ulong convert_month_to_period(ulong month);
void set_current_date(THD *thd, MYSQL_TIME *to);
bool time_to_datetime(MYSQL_TIME *ltime);
bool get_date_from_daynr(long daynr,uint *year, uint *month, uint *day);
my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, uint *error_code);
bool str_to_datetime_with_warn(THD *thd,
                               CHARSET_INFO *cs, const char *str, size_t length,
                               MYSQL_TIME *l_time,
                               date_mode_t flags);
bool double_to_datetime_with_warn(THD *thd, double value, MYSQL_TIME *ltime,
                                  date_mode_t fuzzydate,
                                  const TABLE_SHARE *s, const char *name);
bool decimal_to_datetime_with_warn(THD *thd,
                                   const my_decimal *value, MYSQL_TIME *ltime,
                                   date_mode_t fuzzydate,
                                   const TABLE_SHARE *s, const char *name);
bool int_to_datetime_with_warn(THD *thd, const Longlong_hybrid &nr,
                               MYSQL_TIME *ltime,
                               date_mode_t fuzzydate,
                               const TABLE_SHARE *s, const char *name);

bool time_to_datetime(THD *thd, const MYSQL_TIME *tm, MYSQL_TIME *dt);
bool time_to_datetime_with_warn(THD *thd,
                                const MYSQL_TIME *tm, MYSQL_TIME *dt,
                                date_conv_mode_t fuzzydate);

inline void datetime_to_date(MYSQL_TIME *ltime)
{
  DBUG_ASSERT(ltime->time_type == MYSQL_TIMESTAMP_DATE ||
              ltime->time_type == MYSQL_TIMESTAMP_DATETIME);
  DBUG_ASSERT(ltime->neg == 0);
  ltime->second_part= ltime->hour= ltime->minute= ltime->second= 0;
  ltime->time_type= MYSQL_TIMESTAMP_DATE;
}
inline void date_to_datetime(MYSQL_TIME *ltime)
{
  DBUG_ASSERT(ltime->time_type == MYSQL_TIMESTAMP_DATE ||
              ltime->time_type == MYSQL_TIMESTAMP_DATETIME);
  DBUG_ASSERT(ltime->neg == 0);
  ltime->time_type= MYSQL_TIMESTAMP_DATETIME;
}
void make_truncated_value_warning(THD *thd,
                                  Sql_condition::enum_warning_level level,
                                  const ErrConv *str_val,
                                  timestamp_type time_type,
                                  const char *db_name, const char *table_name,
                                  const char *field_name);

extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
					       const char *format_str,
					       uint format_length);
extern DATE_TIME_FORMAT *date_time_format_copy(THD *thd,
					       DATE_TIME_FORMAT *format);
const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
				     timestamp_type type);
bool my_TIME_to_str(const MYSQL_TIME *ltime, String *str, uint dec);

/* MYSQL_TIME operations */
bool date_add_interval(THD *thd, MYSQL_TIME *ltime, interval_type int_type,
                       const INTERVAL &interval, bool push_warn= true);
bool calc_time_diff(const MYSQL_TIME *l_time1, const MYSQL_TIME *l_time2,
                    int l_sign, ulonglong *seconds_out, ulong *microseconds_out);
int append_interval(String *str, interval_type int_type,
                    const INTERVAL &interval);
/**
  Calculate time difference between two MYSQL_TIME values and
  store the result as an out MYSQL_TIME value in MYSQL_TIMESTAMP_TIME format.

  The result can be outside of the supported TIME range.
  For example, calc_time_diff('2002-01-01 00:00:00', '2001-01-01 00:00:00')
  returns '8760:00:00'. So the caller might want to do check_time_range() or
  adjust_time_range_with_warn() on the result of a calc_time_diff() call.

  @param l_time1       - the minuend (TIME/DATE/DATETIME value)
  @param l_time2       - the subtrahend TIME/DATE/DATETIME value
  @param l_sign        -  +1 if absolute values are to be subtracted,
                          or -1 if absolute values are to be added.
  @param[out] l_time3  - the result
  @param fuzzydate     - flags

  @return true         - if TIME_NO_ZERO_DATE was passed in flags and
                         the result appeared to be '00:00:00.000000'.
                         This is important when calc_time_diff() is called
                         when calculating DATE_ADD(TIMEDIFF(...),...)
  @return false        - otherwise
*/
bool calc_time_diff(const MYSQL_TIME *l_time1, const MYSQL_TIME *l_time2,
                    int lsign, MYSQL_TIME *l_time3, date_mode_t fuzzydate);
int my_time_compare(const MYSQL_TIME *a, const MYSQL_TIME *b);
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);

void calc_time_from_sec(MYSQL_TIME *to, ulong seconds, ulong microseconds);
uint calc_week(const MYSQL_TIME *l_time, uint week_behaviour, uint *year);

int calc_weekday(long daynr,bool sunday_first_day_of_week);
bool parse_date_time_format(timestamp_type format_type, 
                            const char *format, uint format_length,
                            DATE_TIME_FORMAT *date_time_format);

/* convenience wrapper */
inline bool parse_date_time_format(timestamp_type format_type, 
                                   DATE_TIME_FORMAT *date_time_format)
{
  return parse_date_time_format(format_type,
                                date_time_format->format.str,
                                (uint) date_time_format->format.length,
                                date_time_format);
}


extern DATE_TIME_FORMAT global_date_format;
extern DATE_TIME_FORMAT global_datetime_format;
extern DATE_TIME_FORMAT global_time_format;
extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
extern LEX_CSTRING interval_type_to_name[];

static inline bool
non_zero_hhmmssuu(const MYSQL_TIME *ltime)
{
  return ltime->hour || ltime->minute || ltime->second || ltime->second_part;
}
static inline bool
non_zero_YYMMDD(const MYSQL_TIME *ltime)
{
  return ltime->year || ltime->month || ltime->day;
}
static inline bool
non_zero_date(const MYSQL_TIME *ltime)
{
  return non_zero_YYMMDD(ltime) ||
         (ltime->time_type == MYSQL_TIMESTAMP_DATETIME &&
          non_zero_hhmmssuu(ltime));
}
static inline bool
check_date(const MYSQL_TIME *ltime, date_conv_mode_t flags, int *was_cut)
{
 return check_date(ltime, non_zero_date(ltime),
                   ulonglong(flags & TIME_MODE_FOR_XXX_TO_DATE), was_cut);
}
bool check_date_with_warn(THD *thd, const MYSQL_TIME *ltime,
                          date_conv_mode_t fuzzy_date, timestamp_type ts_type);
static inline bool
check_date_with_warn(THD *thd, const MYSQL_TIME *ltime,
                          date_mode_t fuzzydate, timestamp_type ts_type)
{
  return check_date_with_warn(thd, ltime, date_conv_mode_t(fuzzydate), ts_type);
}

bool adjust_time_range_with_warn(THD *thd, MYSQL_TIME *ltime, uint dec);

longlong pack_time(const MYSQL_TIME *my_time);
void unpack_time(longlong packed, MYSQL_TIME *my_time,
                 enum_mysql_timestamp_type ts_type);

#endif /* SQL_TIME_INCLUDED */
server/private/myisamchk.h000064400000011154150400263720011663 0ustar00/* Copyright (C) 2006 MySQL AB
   Copyright (c) 2017, 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; either version 2 of the License, or
   (at your option) any later version.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/* Definitions needed for myisamchk/mariachk.c */

#ifndef _myisamchk_h
#define _myisamchk_h

#include <my_stack_alloc.h>

/*
  Flags used by xxxxchk.c or/and ha_xxxx.cc that are NOT passed
  to xxxcheck.c follows:
*/

#define TT_USEFRM               1U
#define TT_FOR_UPGRADE          2U
#define TT_FROM_MYSQL           4U

/* Bits set in out_flag */
#define O_NEW_DATA	2U
#define O_DATA_LOST	4U

/* 
  MARIA/MYISAM supports several statistics collection
  methods. Currently statistics collection method is not stored in
  MARIA file and has to be specified for each table analyze/repair
  operation in MI_CHECK::stats_method.
*/

typedef enum
{
  /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
  MI_STATS_METHOD_NULLS_NOT_EQUAL,
  /* Treat NULLs as equal when collecting statistics (like 4.0 did) */
  MI_STATS_METHOD_NULLS_EQUAL,
  /* Ignore NULLs - count only tuples without NULLs in the index components */
  MI_STATS_METHOD_IGNORE_NULLS
} enum_handler_stats_method;

struct st_myisam_info;

typedef struct st_handler_check_param
{
  char *isam_file_name;
  MY_TMPDIR *tmpdir;
  void *thd;
  const char *db_name, *table_name, *op_name;
  ulonglong auto_increment_value;
  ulonglong max_data_file_length;
  ulonglong keys_in_use;
  ulonglong max_record_length;
  /* 
     The next two are used to collect statistics, see update_key_parts for
     description.
  */
  ulonglong unique_count[HA_MAX_KEY_SEG + 1];
  ulonglong notnull_count[HA_MAX_KEY_SEG + 1];
  ulonglong max_allowed_lsn;
  my_off_t search_after_block;
  my_off_t new_file_pos, key_file_blocks;
  my_off_t keydata, totaldata, key_blocks, start_check_pos;
  my_off_t used, empty, splits, del_length, link_used, lost;
  ha_rows total_records, total_deleted, records,del_blocks;
  ha_rows full_page_count, tail_count;
  ha_checksum record_checksum, glob_crc;
  ha_checksum key_crc[HA_MAX_POSSIBLE_KEY];
  ha_checksum tmp_key_crc[HA_MAX_POSSIBLE_KEY];
  ha_checksum tmp_record_checksum;
  ulonglong   org_key_map;
  ulonglong   testflag;

  /* Following is used to check if rows are visible */
  ulonglong max_trid, max_found_trid;
  ulonglong not_visible_rows_found;
  ulonglong sort_buffer_length, orig_sort_buffer_length;
  ulonglong use_buffers;                        /* Used as param to getopt() */
  size_t read_buffer_length, write_buffer_length, sort_key_blocks;
  time_t backup_time;                           /* To sign backup files */
  ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
  double new_rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
  uint out_flag, error_printed, verbose;
  uint opt_sort_key, total_files, max_level;
  uint key_cache_block_size, pagecache_block_size;
  uint skip_lsn_error_count;
  int tmpfile_createflag, err_count;
  myf myf_rw;
  uint16 language;
  my_bool warning_printed, note_printed, wrong_trd_printed;
  my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
  my_bool retry_repair, force_sort, calc_checksum, static_row_size;
  char temp_filename[FN_REFLEN];
  IO_CACHE read_cache;
  void **stack_end_ptr;
  enum_handler_stats_method stats_method;
  /* For reporting progress */
  uint stage, max_stage;
  uint progress_counter;             /* How often to call _report_progress() */
  ulonglong progress, max_progress;

  void (*init_fix_record)(void *);
  int (*fix_record)(struct st_myisam_info *info, uchar *record, int keynum);

  mysql_mutex_t print_msg_mutex;
  my_bool need_print_msg_lock;
  myf malloc_flags;
} HA_CHECK;


typedef struct st_buffpek {
  my_off_t file_pos;                    /* Where we are in the sort file */
  uchar *base, *key;                    /* Key pointers */
  ha_rows count;                        /* Number of rows in table */
  ha_rows mem_count;                    /* Numbers of keys in memory */
  ha_rows max_keys;                     /* Max keys in buffert */
} BUFFPEK;

#endif /* _myisamchk_h */
server/private/sql_list.h000064400000053672150400263720011543 0ustar00#ifndef INCLUDES_MYSQL_SQL_LIST_H
#define INCLUDES_MYSQL_SQL_LIST_H
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2019, 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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_alloc.h"
#include <iterator>

/**
  Simple intrusive linked list.

  @remark Similar in nature to base_list, but intrusive. It keeps a
          a pointer to the first element in the list and a indirect
          reference to the last element.
*/

template <typename T>
class SQL_I_List :public Sql_alloc
{
public:
  uint elements;
  /** The first element in the list. */
  T *first;
  /** A reference to the next element in the list. */
  T **next;

  SQL_I_List() { empty(); }

  SQL_I_List(const SQL_I_List &tmp) : Sql_alloc()
  {
    elements= tmp.elements;
    first= tmp.first;
    next= elements ? tmp.next : &first;
  }

  SQL_I_List& operator=(const SQL_I_List &tmp)
  {
    elements= tmp.elements;
    first= tmp.first;
    next= elements ? tmp.next : &first;;
    return *this;
  }

  inline void empty()
  {
    elements= 0;
    first= NULL;
    next= &first;
  }

  inline void link_in_list(T *element, T **next_ptr)
  {
    elements++;
    (*next)= element;
    next= next_ptr;
    *next= NULL;
  }

  inline void save_and_clear(SQL_I_List<T> *save)
  {
    *save= *this;
    empty();
  }

  inline void push_front(SQL_I_List<T> *save)
  {
    /* link current list last */
    *save->next= first;
    first= save->first;
    elements+= save->elements;
  }

  inline void push_back(SQL_I_List<T> *save)
  {
    if (save->first)
    {
      *next= save->first;
      next= save->next;
      elements+= save->elements;
    }
  }
};


/*
  Basic single linked list
  Used for item and item_buffs.
  All list ends with a pointer to the 'end_of_list' element, which
  data pointer is a null pointer and the next pointer points to itself.
  This makes it very fast to traverse lists as we don't have to
  test for a specialend condition for list that can't contain a null
  pointer.
*/


/**
  list_node - a node of a single-linked list.
  @note We never call a destructor for instances of this class.
*/

struct list_node :public Sql_alloc
{
  list_node *next;
  void *info;
  list_node(const void *info_par, list_node *next_par)
    :next(next_par), info(const_cast<void *>(info_par))
  {}
  list_node()					/* For end_of_list */
  {
    info= 0;
    next= this;
  }
};

extern MYSQL_PLUGIN_IMPORT list_node end_of_list;

class base_list :public Sql_alloc
{
protected:
  list_node *first,**last;

public:
  uint elements;

  bool operator==(const base_list &rhs) const
  {
    return
      elements == rhs.elements &&
      first == rhs.first &&
      last == rhs.last;
  }
  base_list& operator=(const base_list &rhs)
  {
    elements= rhs.elements;
    first= rhs.first;
    last= elements ? rhs.last : &first;
    return *this;
  }

  inline void empty() { elements=0; first= &end_of_list; last=&first;}
  inline base_list() { empty(); }
  /**
    This is a shallow copy constructor that implicitly passes the ownership
    from the source list to the new instance. The old instance is not
    updated, so both objects end up sharing the same nodes. If one of
    the instances then adds or removes a node, the other becomes out of
    sync ('last' pointer), while still operational. Some old code uses and
    relies on this behaviour. This logic is quite tricky: please do not use
    it in any new code.
  */
  inline base_list(const base_list &tmp) :Sql_alloc()
  {
    *this= tmp;
  }
  /**
    Construct a deep copy of the argument in memory root mem_root.
    The elements themselves are copied by pointer. If you also
    need to copy elements by value, you should employ
    list_copy_and_replace_each_value after creating a copy.
  */
  bool copy(const base_list *rhs, MEM_ROOT *mem_root);
  base_list(const base_list &rhs, MEM_ROOT *mem_root) { copy(&rhs, mem_root); }
  inline base_list(bool) {}
  inline bool push_back(void *info)
  {
    if (((*last)=new list_node(info, &end_of_list)))
    {
      last= &(*last)->next;
      elements++;
      return 0;
    }
    return 1;
  }
  inline bool push_back(void *info, MEM_ROOT *mem_root)
  {
    if (((*last)=new (mem_root) list_node(info, &end_of_list)))
    {
      last= &(*last)->next;
      elements++;
      return 0;
    }
    return 1;
  }
  bool push_front_impl(list_node *node)
  {
    if (node)
    {
      if (last == &first)
        last= &node->next;
      first=node;
      elements++;
      return 0;
    }
    return 1;
  }
  inline bool push_front(void *info)
  { return push_front_impl(new list_node(info, first)); }
  inline bool push_front(void *info, MEM_ROOT *mem_root)
  { return push_front_impl(new (mem_root) list_node(info,first)); }
  void remove(list_node **prev)
  {
    list_node *node=(*prev)->next;
    if (!--elements)
      last= &first;
    else if (last == &(*prev)->next)
      last= prev;
    delete *prev;
    *prev=node;
  }
  inline void append(base_list *list)
  {
    if (!list->is_empty())
    {
      if (is_empty())
      {
        *this= *list;
        return;
      }
      *last= list->first;
      last= list->last;
      elements+= list->elements;
    }
  }
  inline void *pop(void)
  {
    if (first == &end_of_list) return 0;
    list_node *tmp=first;
    first=first->next;
    if (!--elements)
      last= &first;
    return tmp->info;
  }

  /*
    Remove from this list elements that are contained in the passed list. 
    We assume that the passed list is a tail of this list (that is, the whole 
    list_node* elements are shared).
  */
  inline void disjoin(const base_list *list)
  {
    list_node **prev= &first;
    list_node *node= first;
    list_node *list_first= list->first;
    elements=0;
    while (node != &end_of_list && node != list_first)
    {
      prev= &node->next;
      node= node->next;
      elements++;
      if (node == &end_of_list)
        return;
    }
    *prev= &end_of_list;
    last= prev;
  }
  inline void prepend(base_list *list)
  {
    if (!list->is_empty())
    {
      if (is_empty())
        last= list->last;
      *list->last= first;
      first= list->first;
      elements+= list->elements;
    }
  }
  /**
    Swap two lists.
  */
  inline void swap(base_list &rhs)
  {
    list_node **rhs_last=rhs.last;
    swap_variables(list_node *, first, rhs.first);
    swap_variables(uint, elements, rhs.elements);
    rhs.last= last == &first ? &rhs.first : last;
    last = rhs_last == &rhs.first ? &first : rhs_last;
  }

  inline list_node* last_node() { return *last; }
  inline list_node* first_node() { return first;}
  inline void *head() { return first->info; }
  inline void **head_ref() { return first != &end_of_list ? &first->info : 0; }
  inline bool is_empty() { return first == &end_of_list ; }
  inline list_node *last_ref() { return &end_of_list; }
  template <typename T= void>
  inline bool add_unique(T *info, bool (*eq)(T *a, T *b))
  {
    list_node *node= first;
    for (;
         node != &end_of_list && (!(*eq)(static_cast<T *>(node->info), info));
         node= node->next) ;
    if (node == &end_of_list)
      return push_back(info);
    return 1;
  }
  friend class base_list_iterator;
  friend class error_list;
  friend class error_list_iterator;

  /*
    Return N-th element in the list, or NULL if the list has
    less than N elements.
  */
  void *elem(uint n)
  {
    list_node *node= first;
    void *data= NULL;
    for (uint i= 0; i <= n; i++)
    {
      if (node == &end_of_list)
      {
        data= NULL;
        break;
      }
      data= node->info;
      node= node->next;
    }
    return data;
  }

#ifdef LIST_EXTRA_DEBUG
  /*
    Check list invariants and print results into trace. Invariants are:
      - (*last) points to end_of_list
      - There are no NULLs in the list.
      - base_list::elements is the number of elements in the list.

    SYNOPSIS
      check_list()
        name  Name to print to trace file

    RETURN 
      1  The list is Ok.
      0  List invariants are not met.
  */

  bool check_list(const char *name)
  {
    base_list *list= this;
    list_node *node= first;
    uint cnt= 0;

    while (node->next != &end_of_list)
    {
      if (!node->info)
      {
        DBUG_PRINT("list_invariants",("%s: error: NULL element in the list", 
                                      name));
        return FALSE;
      }
      node= node->next;
      cnt++;
    }
    if (last != &(node->next))
    {
      DBUG_PRINT("list_invariants", ("%s: error: wrong last pointer", name));
      return FALSE;
    }
    if (cnt+1 != elements)
    {
      DBUG_PRINT("list_invariants", ("%s: error: wrong element count", name));
      return FALSE;
    }
    DBUG_PRINT("list_invariants", ("%s: list is ok", name));
    return TRUE;
  }
#endif // LIST_EXTRA_DEBUG

protected:
  void after(const void *info, list_node *node)
  {
    list_node *new_node=new list_node(info,node->next);
    node->next=new_node;
    elements++;
    if (last == &(node->next))
      last= &new_node->next;
  }
};


class base_list_iterator
{
protected:
  base_list *list;
  list_node **el,**prev,*current;
  void sublist(base_list &ls, uint elm)
  {
    ls.first= *el;
    ls.last= list->last;
    ls.elements= elm;
  }
public:
  base_list_iterator() 
    :list(0), el(0), prev(0), current(0)
  {}

  base_list_iterator(base_list &list_par) 
  { init(list_par); }

  inline void init(base_list &list_par)
  {
    list= &list_par;
    el= &list_par.first;
    prev= 0;
    current= 0;
  }

  inline void *next(void)
  {
    prev=el;
    current= *el;
    el= &current->next;
    return current->info;
  }
  /* Get what calling next() would return, without moving the iterator */
  inline void *peek()
  {
    return (*el)->info;
  }
  inline void *next_fast(void)
  {
    list_node *tmp;
    tmp= *el;
    el= &tmp->next;
    return tmp->info;
  }
  inline void rewind(void)
  {
    el= &list->first;
  }
  inline void *replace(const void *element)
  {						// Return old element
    void *tmp=current->info;
    DBUG_ASSERT(current->info != 0);
    current->info= const_cast<void *>(element);
    return tmp;
  }
  void *replace(base_list &new_list)
  {
    void *ret_value=current->info;
    if (!new_list.is_empty())
    {
      *new_list.last=current->next;
      current->info=new_list.first->info;
      current->next=new_list.first->next;
      if ((list->last == &current->next) && (new_list.elements > 1))
	list->last= new_list.last;
      list->elements+=new_list.elements-1;
    }
    return ret_value;				// return old element
  }
  inline void remove(void)			// Remove current
  {
    list->remove(prev);
    el=prev;
    current=0;					// Safeguard
  }
  void after(const void *element)		// Insert element after current
  {
    list->after(element,current);
    current=current->next;
    el= &current->next;
  }
  inline void **ref(void)			// Get reference pointer
  {
    return &current->info;
  }
  inline bool is_last(void)
  {
    return el == &list->last_ref()->next;
  }
  inline bool at_end()
  {
    return current == &end_of_list;
  }
  friend class error_list_iterator;
};

template <class T> class List :public base_list
{
public:
  inline List() :base_list() {}
  inline List(const List<T> &tmp, MEM_ROOT *mem_root) :
    base_list(tmp, mem_root) {}
  inline bool push_back(T *a) { return base_list::push_back(a); }
  inline bool push_back(T *a, MEM_ROOT *mem_root)
  { return base_list::push_back((void*) a, mem_root); }
  inline bool push_front(T *a) { return base_list::push_front(a); }
  inline bool push_front(T *a, MEM_ROOT *mem_root)
  { return base_list::push_front((void*) a, mem_root); }
  inline T* head() {return (T*) base_list::head(); }
  inline T** head_ref() {return (T**) base_list::head_ref(); }
  inline T* pop()  {return (T*) base_list::pop(); }
  inline void append(List<T> *list) { base_list::append(list); }
  inline void prepend(List<T> *list) { base_list::prepend(list); }
  inline void disjoin(List<T> *list) { base_list::disjoin(list); }
  inline bool add_unique(T *a, bool (*eq)(T *a, T *b))
  { return base_list::add_unique<T>(a, eq); }
  inline bool copy(const List<T> *list, MEM_ROOT *root)
  { return base_list::copy(list, root); }
  void delete_elements(void)
  {
    list_node *element,*next;
    for (element=first; element != &end_of_list; element=next)
    {
      next=element->next;
      delete (T*) element->info;
    }
    empty();
  }
  T *elem(uint n) { return (T*) base_list::elem(n); }
  // Create a new list with one element
  static List<T> *make(MEM_ROOT *mem_root, T *first)
  {
    List<T> *res= new (mem_root) List<T>;
    return res == NULL || res->push_back(first, mem_root) ? NULL : res;
  }

  class Iterator;
  using value_type= T;
  using iterator= Iterator;

  iterator begin() const { return iterator(first); }
  iterator end() const { return iterator(); }

  class Iterator
  {
  public:
    using iterator_category= std::forward_iterator_tag;
    using value_type= T;
    using difference_type= std::ptrdiff_t;
    using pointer= T *;
    using reference= T &;

    Iterator(list_node *p= &end_of_list) : node{p} {}

    Iterator &operator++()
    {
      DBUG_ASSERT(node != &end_of_list);

      node= node->next;
      return *this;
    }

    Iterator operator++(int)
    {
      Iterator tmp(*this);
      operator++();
      return tmp;
    }

    T &operator*() { return *static_cast<T *>(node->info); }
    T *operator->() { return static_cast<T *>(node->info); }

    bool operator==(const typename List<T>::iterator &rhs)
    {
      return node == rhs.node;
    }

    bool operator!=(const typename List<T>::iterator &rhs)
    {
      return node != rhs.node;
    }

  private:
    list_node *node{&end_of_list};
  };
};


template <class T> class List_iterator :public base_list_iterator
{
public:
  List_iterator(List<T> &a) : base_list_iterator(a) {}
  List_iterator() : base_list_iterator() {}
  inline void init(List<T> &a) { base_list_iterator::init(a); }
  inline T* operator++(int) { return (T*) base_list_iterator::next(); }
  inline T* peek() { return (T*) base_list_iterator::peek(); }
  inline T *replace(T *a)   { return (T*) base_list_iterator::replace(a); }
  inline T *replace(List<T> &a) { return (T*) base_list_iterator::replace(a); }
  inline void rewind(void)  { base_list_iterator::rewind(); }
  inline void remove()      { base_list_iterator::remove(); }
  inline void after(T *a)   { base_list_iterator::after(a); }
  inline T** ref(void)	    { return (T**) base_list_iterator::ref(); }
};


template <class T> class List_iterator_fast :public base_list_iterator
{
protected:
  inline T *replace(T *)   { return (T*) 0; }
  inline T *replace(List<T> &) { return (T*) 0; }
  inline void remove(void)  {}
  inline void after(T *)    {}
  inline T** ref(void)	    { return (T**) 0; }

public:
  inline List_iterator_fast(List<T> &a) : base_list_iterator(a) {}
  inline List_iterator_fast() : base_list_iterator() {}
  inline void init(List<T> &a) { base_list_iterator::init(a); }
  inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); }
  inline void rewind(void)  { base_list_iterator::rewind(); }
  void sublist(List<T> &list_arg, uint el_arg)
  {
    base_list_iterator::sublist(list_arg, el_arg);
  }
};


/*
  Bubble sort algorithm for List<T>.
  This sort function is supposed to be used only for very short list.
  Currently it is used for the lists of Item_equal objects and
  for some lists in the table elimination algorithms. In both
  cases the sorted lists are very short.
*/

template <class T> 
inline void bubble_sort(List<T> *list_to_sort,
                        int (*sort_func)(T *a, T *b, void *arg), void *arg)
{
  bool swap;
  T **ref1= 0;
  T **ref2= 0;
  List_iterator<T> it(*list_to_sort);
  do
  {
    T **last_ref= ref1;
    T *item1= it++;
    ref1= it.ref();
    T *item2;

    swap= FALSE;
    while ((item2= it++) && (ref2= it.ref()) != last_ref)
    {
      if (sort_func(item1, item2, arg) > 0)
      {
        *ref1= item2;
        *ref2= item1;
        swap= TRUE;
      }
      else
        item1= item2;
      ref1= ref2;
    }
    it.rewind();
  } while (swap);
}


/*
  A simple intrusive list which automaticly removes element from list
  on delete (for THD element)
*/

struct ilink
{
  struct ilink **prev,*next;
  static void *operator new(size_t size) throw ()
  {
    return (void*)my_malloc(PSI_INSTRUMENT_ME,
                            (uint)size, MYF(MY_WME | MY_FAE | ME_FATAL));
  }
  static void operator delete(void* ptr_arg, size_t)
  {
     my_free(ptr_arg);
  }

  inline ilink()
  {
    prev=0; next=0;
  }
  inline void unlink()
  {
    /* Extra tests because element doesn't have to be linked */
    if (prev) *prev= next;
    if (next) next->prev=prev;
    prev=0 ; next=0;
  }
  inline void assert_linked()
  {
    DBUG_ASSERT(prev != 0 && next != 0);
  }
  inline void assert_not_linked()
  {
    DBUG_ASSERT(prev == 0 && next == 0);
  }
  virtual ~ilink() { unlink(); }		/*lint -e1740 */
};


/* Needed to be able to have an I_List of char* strings in mysqld.cc. */

class i_string: public ilink
{
public:
  const char* ptr;
  i_string():ptr(0) { }
  i_string(const char* s) : ptr(s) {}
};

/* needed for linked list of two strings for replicate-rewrite-db */
class i_string_pair: public ilink
{
public:
  const char* key;
  const char* val;
  i_string_pair():key(0),val(0) { }
  i_string_pair(const char* key_arg, const char* val_arg) : 
    key(key_arg),val(val_arg) {}
};


template <class T> class I_List_iterator;


class base_ilist
{
  struct ilink *first;
  struct ilink last;
public:
  inline void empty() { first= &last; last.prev= &first; }
  base_ilist() { empty(); }
  inline bool is_empty() {  return first == &last; }
  // Returns true if p is the last "real" object in the list,
  // i.e. p->next points to the sentinel.
  inline bool is_last(ilink *p) { return p->next == NULL || p->next == &last; }
  inline void append(ilink *a)
  {
    first->prev= &a->next;
    a->next=first; a->prev= &first; first=a;
  }
  inline void push_back(ilink *a)
  {
    *last.prev= a;
    a->next= &last;
    a->prev= last.prev;
    last.prev= &a->next;
  }
  inline struct ilink *get()
  {
    struct ilink *first_link=first;
    if (first_link == &last)
      return 0;
    first_link->unlink();			// Unlink from list
    return first_link;
  }
  inline struct ilink *head()
  {
    return (first != &last) ? first : 0;
  }

  /**
    Moves list elements to new owner, and empties current owner (i.e. this).

    @param[in,out]  new_owner  The new owner of the list elements.
                               Should be empty in input.
  */

  void move_elements_to(base_ilist *new_owner)
  {
    DBUG_ASSERT(new_owner->is_empty());
    new_owner->first= first;
    new_owner->last= last;
    empty();
  }

  friend class base_ilist_iterator;
 private:
  /*
    We don't want to allow copying of this class, as that would give us
    two list heads containing the same elements.
    So we declare, but don't define copy CTOR and assignment operator.
  */
  base_ilist(const base_ilist&);
  void operator=(const base_ilist&);
};


class base_ilist_iterator
{
  base_ilist *list;
  struct ilink **el;
protected:
  struct ilink *current;
public:
  base_ilist_iterator(base_ilist &list_par) :list(&list_par),
    el(&list_par.first),current(0) {}
  void *next(void)
  {
    /* This is coded to allow push_back() while iterating */
    current= *el;
    if (current == &list->last) return 0;
    el= &current->next;
    return current;
  }
  /* Unlink element returned by last next() call */
  inline void unlink(void)
  {
    struct ilink **tmp= current->prev;
    current->unlink();
    el= tmp;
  }
};


template <class T>
class I_List :private base_ilist
{
public:
  I_List() :base_ilist()	{}
  inline bool is_last(T *p)     { return base_ilist::is_last(p); }
  inline void empty()		{ base_ilist::empty(); }
  inline bool is_empty()        { return base_ilist::is_empty(); } 
  inline void append(T* a)	{ base_ilist::append(a); }
  inline void push_back(T* a)	{ base_ilist::push_back(a); }
  inline T* get()		{ return (T*) base_ilist::get(); }
  inline T* head()		{ return (T*) base_ilist::head(); }
  inline void move_elements_to(I_List<T>* new_owner) {
    base_ilist::move_elements_to(new_owner);
  }
#ifndef _lint
  friend class I_List_iterator<T>;
#endif
};


template <class T> class I_List_iterator :public base_ilist_iterator
{
public:
  I_List_iterator(I_List<T> &a) : base_ilist_iterator(a) {}
  inline T* operator++(int) { return (T*) base_ilist_iterator::next(); }
  /* Remove element returned by last next() call */
  inline void remove(void)
  {
    unlink();
    delete (T*) current;
    current= 0;                                 // Safety
  }
};

/**
  Make a deep copy of each list element.

  @note A template function and not a template method of class List
  is employed because of explicit template instantiation:
  in server code there are explicit instantiations of List<T> and
  an explicit instantiation of a template requires that any method
  of the instantiated class used in the template can be resolved.
  Evidently not all template arguments have clone() method with
  the right signature.

  @return You must query the error state in THD for out-of-memory
  situation after calling this function.
*/

template <typename T>
inline
void
list_copy_and_replace_each_value(List<T> &list, MEM_ROOT *mem_root)
{
  /* Make a deep copy of each element */
  List_iterator<T> it(list);
  T *el;
  while ((el= it++))
    it.replace(el->clone(mem_root));
}

void free_list(I_List <i_string_pair> *list);
void free_list(I_List <i_string> *list);

#endif // INCLUDES_MYSQL_SQL_LIST_H
server/private/sql_priv.h000064400000044241150400263720011540 0ustar00/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
   Copyright (c) 2010, 2019, MariaDB

   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 */

/**
  @file

  @details
  Mostly this file is used in the server. But a little part of it is used in
  mysqlbinlog too (definition of SELECT_DISTINCT and others).
  The consequence is that 90% of the file is wrapped in \#ifndef MYSQL_CLIENT,
  except the part which must be in the server and in the client.
*/

#ifndef SQL_PRIV_INCLUDED
#define SQL_PRIV_INCLUDED

#ifndef MYSQL_CLIENT

/*
  Generates a warning that a feature is deprecated. After a specified
  version asserts that the feature is removed.

  Using it as

  WARN_DEPRECATED(thd, 6,2, "BAD", "'GOOD'");

  Will result in a warning
 
  "The syntax 'BAD' is deprecated and will be removed in MySQL 6.2. Please
   use 'GOOD' instead"

   Note that in macro arguments BAD is not quoted, while 'GOOD' is.
   Note that the version is TWO numbers, separated with a comma
   (two macro arguments, that is)
*/
#define WARN_DEPRECATED(Thd,VerHi,VerLo,Old,New)                            \
  do {                                                                      \
    compile_time_assert(MYSQL_VERSION_ID < VerHi * 10000 + VerLo * 100);    \
    if (((THD *) Thd) != NULL)                                              \
      push_warning_printf(((THD *) Thd), Sql_condition::WARN_LEVEL_WARN,    \
                         ER_WARN_DEPRECATED_SYNTAX,                          \
                         ER_THD(((THD *) Thd), ER_WARN_DEPRECATED_SYNTAX), \
                         (Old), (New));                                      \
    else                                                                    \
      sql_print_warning("The syntax '%s' is deprecated and will be removed " \
                        "in a future release. Please use %s instead.",      \
                        (Old), (New));                                      \
  } while(0)


/*
  Generates a warning that a feature is deprecated and there is no replacement.

  Using it as

  WARN_DEPRECATED_NO_REPLACEMENT(thd, "BAD");

  Will result in a warning
 
  "'BAD' is deprecated and will be removed in a future release."

   Note that in macro arguments BAD is not quoted.
*/

#define WARN_DEPRECATED_NO_REPLACEMENT(Thd,Old)                             \
  do {                                                                      \
    THD *thd_= ((THD*) Thd);                                                \
    if (thd_ != NULL)                                                       \
      push_warning_printf(thd_, Sql_condition::WARN_LEVEL_WARN,             \
                         ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,          \
                         ER_THD(thd_, ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT), \
                         (Old));                                            \
    else                                                                    \
      sql_print_warning("'%s' is deprecated and will be removed "           \
                        "in a future release.", (Old));                     \
  } while(0)

/*************************************************************************/

#endif

/*
   This is included in the server and in the client.
   Options for select set by the yacc parser (stored in lex->options).

   NOTE
   log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD
   options list are written into binlog. These options can NOT change their
   values, or it will break replication between version.

   context is encoded as following:
   SELECT - SELECT_LEX_NODE::options
   THD    - THD::options
   intern - neither. used only as
            func(..., select_node->options | thd->options | OPTION_XXX, ...)

   TODO: separate three contexts above, move them to separate bitfields.
*/

#define SELECT_DISTINCT         (1ULL << 0)     // SELECT, user
#define SELECT_STRAIGHT_JOIN    (1ULL << 1)     // SELECT, user
#define SELECT_DESCRIBE         (1ULL << 2)     // SELECT, user
#define SELECT_SMALL_RESULT     (1ULL << 3)     // SELECT, user
#define SELECT_BIG_RESULT       (1ULL << 4)     // SELECT, user
#define OPTION_FOUND_ROWS       (1ULL << 5)     // SELECT, user
#define OPTION_TO_QUERY_CACHE   (1ULL << 6)     // SELECT, user
#define SELECT_NO_JOIN_CACHE    (1ULL << 7)     // intern
/** always the opposite of OPTION_NOT_AUTOCOMMIT except when in fix_autocommit() */
#define OPTION_AUTOCOMMIT       (1ULL << 8)    // THD, user
#define OPTION_BIG_SELECTS      (1ULL << 9)     // THD, user
#define OPTION_LOG_OFF          (1ULL << 10)    // THD, user
#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11)   // THD, user
#define TMP_TABLE_ALL_COLUMNS   (1ULL << 12)    // SELECT, intern
#define OPTION_WARNINGS         (1ULL << 13)    // THD, user
#define OPTION_AUTO_IS_NULL     (1ULL << 14)    // THD, user, binlog
#define OPTION_NO_CHECK_CONSTRAINT_CHECKS  (1ULL << 15)
#define OPTION_SAFE_UPDATES     (1ULL << 16)    // THD, user
#define OPTION_BUFFER_RESULT    (1ULL << 17)    // SELECT, user
#define OPTION_BIN_LOG          (1ULL << 18)    // THD, user
#define OPTION_NOT_AUTOCOMMIT   (1ULL << 19)    // THD, user
#define OPTION_BEGIN            (1ULL << 20)    // THD, intern
#define OPTION_TABLE_LOCK       (1ULL << 21)    // THD, intern
#define OPTION_QUICK            (1ULL << 22)    // SELECT (for DELETE)
#define OPTION_KEEP_LOG         (1ULL << 23)    // THD, user

#define OPTION_EXPLICIT_DEF_TIMESTAMP   (1ULL << 24) // THD, user
#define OPTION_GTID_BEGIN       (1ULL << 25)    // GTID BEGIN found in log

/** The following can be set when importing tables in a 'wrong order'
   to suppress foreign key checks */
#define OPTION_NO_FOREIGN_KEY_CHECKS    (1ULL << 26) // THD, user, binlog
/** The following speeds up inserts to InnoDB tables by suppressing unique
   key checks in some cases */
#define OPTION_RELAXED_UNIQUE_CHECKS    (1ULL << 27) // THD, user, binlog
#define OPTION_IF_EXISTS                (1ULL << 28) // binlog
#define OPTION_SCHEMA_TABLE             (1ULL << 29) // SELECT, intern
/** Flag set if setup_tables already done */
#define OPTION_SETUP_TABLES_DONE        (1ULL << 30) // intern
/** If not set then the thread will ignore all warnings with level notes. */
#define OPTION_SQL_NOTES                (1ULL << 31) // THD, user
/**
  Force the used temporary table to be a MyISAM table (because we will use
  fulltext functions when reading from it.
*/
#define TMP_TABLE_FORCE_MYISAM          (1ULL << 32)
#define OPTION_PROFILING                (1ULL << 33)
/**
  Indicates that this is a HIGH_PRIORITY SELECT.
  Currently used only for printing of such selects.
  Type of locks to be acquired is specified directly.
*/
#define SELECT_HIGH_PRIORITY            (1ULL << 34)     // SELECT, user
/**
  Is set in slave SQL thread when there was an
  error on master, which, when is not reproducible
  on slave (i.e. the query succeeds on slave),
  is not terminal to the state of repliation,
  and should be ignored. The slave SQL thread,
  however, needs to rollback the effects of the
  succeeded statement to keep replication consistent.
*/
#define OPTION_MASTER_SQL_ERROR         (1ULL << 35)

#define OPTION_SKIP_REPLICATION         (1ULL << 37) // THD, user
#define OPTION_RPL_SKIP_PARALLEL        (1ULL << 38)
#define OPTION_NO_QUERY_CACHE           (1ULL << 39) // SELECT, user
#define OPTION_PROCEDURE_CLAUSE         (1ULL << 40) // Internal usage
#define SELECT_NO_UNLOCK                (1ULL << 41) // SELECT, intern
#define OPTION_BIN_TMP_LOG_OFF          (1ULL << 42) // disable binlog, intern
/* Disable commit of binlog. Used to combine many DDL's and DML's as one */
#define OPTION_BIN_COMMIT_OFF           (1ULL << 43)
/* The following is used to detect a conflict with DISTINCT */
#define SELECT_ALL              (1ULL << 44)    // SELECT, user, parser

#define OPTION_LEX_FOUND_COMMENT        (1ULL << 0) //  intern, parser

/* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT

/* @@optimizer_switch flags. These must be in sync with optimizer_switch_names */
#define OPTIMIZER_SWITCH_INDEX_MERGE               (1ULL << 0)
#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION         (1ULL << 1)
#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION    (1ULL << 2)
#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT     (1ULL << 3)
#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_INTERSECT (1ULL << 4)
#define deprecated_ENGINE_CONDITION_PUSHDOWN       (1ULL << 5)
#define OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN       (1ULL << 6)
#define OPTIMIZER_SWITCH_DERIVED_MERGE             (1ULL << 7)
#define OPTIMIZER_SWITCH_DERIVED_WITH_KEYS         (1ULL << 8)
#define OPTIMIZER_SWITCH_FIRSTMATCH                (1ULL << 9)
#define OPTIMIZER_SWITCH_LOOSE_SCAN                (1ULL << 10)
#define OPTIMIZER_SWITCH_MATERIALIZATION           (1ULL << 11)
#define OPTIMIZER_SWITCH_IN_TO_EXISTS              (1ULL << 12)
#define OPTIMIZER_SWITCH_SEMIJOIN                  (1ULL << 13)
#define OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE (1ULL << 14)
#define OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN  (1ULL << 15)
#define OPTIMIZER_SWITCH_SUBQUERY_CACHE            (1ULL << 16)
/** If this is off, MRR is never used. */
#define OPTIMIZER_SWITCH_MRR                       (1ULL << 17)
/**
   If OPTIMIZER_SWITCH_MRR is on and this is on, MRR is used depending on a
   cost-based choice ("automatic"). If OPTIMIZER_SWITCH_MRR is on and this is
   off, MRR is "forced" (i.e. used as long as the storage engine is capable of
   doing it).
*/
#define OPTIMIZER_SWITCH_MRR_COST_BASED            (1ULL << 18)
#define OPTIMIZER_SWITCH_MRR_SORT_KEYS             (1ULL << 19)
#define OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE     (1ULL << 20)
#define OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE       (1ULL << 21)
#define OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL    (1ULL << 22)
#define OPTIMIZER_SWITCH_JOIN_CACHE_HASHED         (1ULL << 23)
#define OPTIMIZER_SWITCH_JOIN_CACHE_BKA            (1ULL << 24)
#define OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE (1ULL << 25)
#define OPTIMIZER_SWITCH_TABLE_ELIMINATION         (1ULL << 26)
#define OPTIMIZER_SWITCH_EXTENDED_KEYS             (1ULL << 27)
#define OPTIMIZER_SWITCH_EXISTS_TO_IN              (1ULL << 28)
#define OPTIMIZER_SWITCH_ORDERBY_EQ_PROP           (1ULL << 29)
#define OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED (1ULL << 30)
#define OPTIMIZER_SWITCH_SPLIT_MATERIALIZED        (1ULL << 31)
#define OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY (1ULL << 32)
#define OPTIMIZER_SWITCH_USE_ROWID_FILTER          (1ULL << 33)
#define OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING (1ULL << 34)
#define OPTIMIZER_SWITCH_NOT_NULL_RANGE_SCAN       (1ULL << 35)
#define OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY     (1ULL << 36)
#define OPTIMIZER_SWITCH_CSET_NARROWING            (1ULL << 37)

#define OPTIMIZER_SWITCH_DEFAULT   (OPTIMIZER_SWITCH_INDEX_MERGE | \
                                    OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
                                    OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
                                    OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \
                                    OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN | \
                                    OPTIMIZER_SWITCH_DERIVED_MERGE | \
                                    OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \
                                    OPTIMIZER_SWITCH_TABLE_ELIMINATION | \
                                    OPTIMIZER_SWITCH_EXTENDED_KEYS | \
                                    OPTIMIZER_SWITCH_IN_TO_EXISTS | \
                                    OPTIMIZER_SWITCH_MATERIALIZATION | \
                                    OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
                                    OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\
                                    OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE | \
                                    OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE | \
                                    OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \
                                    OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
                                    OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \
                                    OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
                                    OPTIMIZER_SWITCH_SEMIJOIN | \
                                    OPTIMIZER_SWITCH_FIRSTMATCH | \
                                    OPTIMIZER_SWITCH_LOOSE_SCAN | \
                                    OPTIMIZER_SWITCH_EXISTS_TO_IN | \
                                    OPTIMIZER_SWITCH_ORDERBY_EQ_PROP | \
                                    OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \
                                    OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \
                                    OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY | \
                                    OPTIMIZER_SWITCH_USE_ROWID_FILTER | \
                                    OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING | \
                                    OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE)

/*
  See adjust_secondary_key_cost in sys_vars.cc for symbolic names.
*/
#define OPTIMIZER_ADJ_SEC_KEY_COST (1)
#define OPTIMIZER_ADJ_DISABLE_MAX_SEEKS (2)
#define OPTIMIZER_ADJ_DISABLE_FORCE_INDEX_GROUP_BY (4)
#define OPTIMIZER_FIX_INNODB_CARDINALITY (8)
#define OPTIMIZER_ADJ_FIX_REUSE_RANGE_FOR_REF (16)
#define OPTIMIZER_ADJ_FIX_CARD_MULT (32)

#define OPTIMIZER_ADJ_DEFAULT (OPTIMIZER_ADJ_FIX_REUSE_RANGE_FOR_REF | \
                               OPTIMIZER_ADJ_FIX_CARD_MULT)
/*
  Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
  use strictly more than 64 bits by adding one more define above, you should
  contact the replication team because the replication code should then be
  updated (to store more bytes on disk).

  NOTE: When adding new SQL_MODE types, make sure to also add them to
  the scripts used for creating the MySQL system tables
  in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql

*/

/*
  Flags below are set when we perform
  context analysis of the statement and make
  subqueries non-const. It prevents subquery
  evaluation at context analysis stage.
*/

/*
  Don't evaluate this subquery during statement prepare even if
  it's a constant one. The flag is switched off in the end of
  mysqld_stmt_prepare.
*/ 
#define CONTEXT_ANALYSIS_ONLY_PREPARE 1
/*
  Special JOIN::prepare mode: changing of query is prohibited.
  When creating a view, we need to just check its syntax omitting
  any optimizations: afterwards definition of the view will be
  reconstructed by means of ::print() methods and written to
  to an .frm file. We need this definition to stay untouched.
*/ 
#define CONTEXT_ANALYSIS_ONLY_VIEW    2
/*
  Don't evaluate this subquery during derived table prepare even if
  it's a constant one.
*/
#define CONTEXT_ANALYSIS_ONLY_DERIVED 4
/*
  Don't evaluate constant sub-expressions of virtual column
  expressions when opening tables
*/ 
#define CONTEXT_ANALYSIS_ONLY_VCOL_EXPR 8


/*
  Uncachable causes:
*/
/* This subquery has fields from outer query (put by user) */
#define UNCACHEABLE_DEPENDENT_GENERATED   1
/*
  This subquery contains functions with random result.
  Something that is uncacheable is by default unmergeable.
*/
#define UNCACHEABLE_RAND        2
/* This subquery contains functions with side effect */
#define UNCACHEABLE_SIDEEFFECT	4
/* Forcing to save JOIN tables for explain */
#define UNCACHEABLE_EXPLAIN     8
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
#define UNCACHEABLE_UNITED     16
#define UNCACHEABLE_CHECKOPTION 32
/*
  This subquery has fields from outer query injected during
  transformation process
*/
#define UNCACHEABLE_DEPENDENT_INJECTED  64
/* This subquery has fields from outer query (any nature) */
#define UNCACHEABLE_DEPENDENT (UNCACHEABLE_DEPENDENT_GENERATED | \
                               UNCACHEABLE_DEPENDENT_INJECTED)

/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
#define UNDEF_POS (-1)

#define IN_SUBQUERY_CONVERSION_THRESHOLD 1000

#endif /* !MYSQL_CLIENT */

/* BINLOG_DUMP options */

#define BINLOG_DUMP_NON_BLOCK   1
#define BINLOG_SEND_ANNOTATE_ROWS_EVENT   2

#ifndef MYSQL_CLIENT

/*
  Field::is_equal() return codes.
*/
#define IS_EQUAL_NO 0
#define IS_EQUAL_YES 1
/**
  new_field has compatible packed representation with old type,
  so it is theoretically possible to perform change by only updating
  data dictionary without changing table rows
*/
#define IS_EQUAL_PACK_LENGTH 2

enum enum_parsing_place
{
  NO_MATTER,
  IN_HAVING,
  SELECT_LIST,
  IN_WHERE,
  IN_ON,
  IN_GROUP_BY,
  IN_ORDER_BY,
  IN_UPDATE_ON_DUP_KEY,
  IN_PART_FUNC,
  BEFORE_OPT_LIST,
  AFTER_LIST,
  FOR_LOOP_BOUND,
  IN_RETURNING,
  PARSING_PLACE_SIZE /* always should be the last */
};


class sys_var;

enum enum_yes_no_unknown
{
  TVL_YES, TVL_NO, TVL_UNKNOWN
};

#ifdef MYSQL_SERVER

/*
  External variables
*/


/* yy_*.cc */
#ifndef DBUG_OFF
extern void turn_parser_debug_on_MYSQLparse();
extern void turn_parser_debug_on_ORAparse();

#endif

/**
  convert a hex digit into number.
*/

inline int hexchar_to_int(char c)
{
  if (c <= '9' && c >= '0')
    return c-'0';
  c|=32;
  if (c <= 'f' && c >= 'a')
    return c-'a'+10;
  return -1;
}

/* This must match the path length limit in the ER_NOT_RW_DIR error msg. */
#define ER_NOT_RW_DIR_PATHSIZE 200

#define IS_TABLESPACES_TABLESPACE_NAME    0
#define IS_TABLESPACES_ENGINE             1
#define IS_TABLESPACES_TABLESPACE_TYPE    2
#define IS_TABLESPACES_LOGFILE_GROUP_NAME 3
#define IS_TABLESPACES_EXTENT_SIZE        4
#define IS_TABLESPACES_AUTOEXTEND_SIZE    5
#define IS_TABLESPACES_MAXIMUM_SIZE       6
#define IS_TABLESPACES_NODEGROUP_ID       7
#define IS_TABLESPACES_TABLESPACE_COMMENT 8

bool db_name_is_in_ignore_db_dirs_list(const char *dbase);

#endif /* MYSQL_SERVER */

#endif /* MYSQL_CLIENT */

#endif /* SQL_PRIV_INCLUDED */
server/private/sql_base.h000064400000062430150400263720011472 0ustar00/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2011, 2018, MariaDB


   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 */

#ifndef SQL_BASE_INCLUDED
#define SQL_BASE_INCLUDED

#include "sql_class.h"                          /* enum_column_usage */
#include "sql_trigger.h"                        /* trg_event_type */
#include "mysqld.h"                             /* key_map */
#include "table_cache.h"

class Item_ident;
struct Name_resolution_context;
class Open_table_context;
class Open_tables_state;
class Prelocking_strategy;
struct TABLE_LIST;
class THD;
struct handlerton;
struct TABLE;

typedef class st_select_lex SELECT_LEX;

typedef struct st_lock_param_type ALTER_PARTITION_PARAM_TYPE;

/*
  This enumeration type is used only by the function find_item_in_list
  to return the info on how an item has been resolved against a list
  of possibly aliased items.
  The item can be resolved:
   - against an alias name of the list's element (RESOLVED_AGAINST_ALIAS)
   - against non-aliased field name of the list  (RESOLVED_WITH_NO_ALIAS)
   - against an aliased field name of the list   (RESOLVED_BEHIND_ALIAS)
   - ignoring the alias name in cases when SQL requires to ignore aliases
     (e.g. when the resolved field reference contains a table name or
     when the resolved item is an expression)   (RESOLVED_IGNORING_ALIAS)
*/
enum enum_resolution_type {
  NOT_RESOLVED=0,
  RESOLVED_IGNORING_ALIAS,
  RESOLVED_BEHIND_ALIAS,
  RESOLVED_WITH_NO_ALIAS,
  RESOLVED_AGAINST_ALIAS
};

/* Argument to flush_tables() of what to flush */
enum flush_tables_type {
  FLUSH_ALL,
  FLUSH_NON_TRANS_TABLES,
  FLUSH_SYS_TABLES
};

enum find_item_error_report_type {REPORT_ALL_ERRORS, REPORT_EXCEPT_NOT_FOUND,
				  IGNORE_ERRORS, REPORT_EXCEPT_NON_UNIQUE,
                                  IGNORE_EXCEPT_NON_UNIQUE};

/* Flag bits for unique_table() */
#define CHECK_DUP_ALLOW_DIFFERENT_ALIAS 1
#define CHECK_DUP_FOR_CREATE 2
#define CHECK_DUP_SKIP_TEMP_TABLE 4

uint get_table_def_key(const TABLE_LIST *table_list, const char **key);
TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update,
                   uint lock_flags);

/* mysql_lock_tables() and open_table() flags bits */
#define MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK      0x0001
#define MYSQL_OPEN_IGNORE_FLUSH                 0x0002
/* MYSQL_OPEN_TEMPORARY_ONLY (0x0004) is not used anymore. */
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY      0x0008
#define MYSQL_LOCK_LOG_TABLE                    0x0010
/**
  Do not try to acquire a metadata lock on the table: we
  already have one.
*/
#define MYSQL_OPEN_HAS_MDL_LOCK                 0x0020
/**
  If in locked tables mode, ignore the locked tables and get
  a new instance of the table.
*/
#define MYSQL_OPEN_GET_NEW_TABLE                0x0040
/* 0x0080 used to be MYSQL_OPEN_SKIP_TEMPORARY */
/** Fail instead of waiting when conficting metadata lock is discovered. */
#define MYSQL_OPEN_FAIL_ON_MDL_CONFLICT         0x0100
/** Open tables using MDL_SHARED lock instead of one specified in parser. */
#define MYSQL_OPEN_FORCE_SHARED_MDL             0x0200
/**
  Open tables using MDL_SHARED_HIGH_PRIO lock instead of one specified
  in parser.
*/
#define MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL   0x0400
/**
  When opening or locking the table, use the maximum timeout
  (LONG_TIMEOUT = 1 year) rather than the user-supplied timeout value.
*/
#define MYSQL_LOCK_IGNORE_TIMEOUT               0x0800
/**
  When acquiring "strong" (SNW, SNRW, X) metadata locks on tables to
  be open do not acquire global and schema-scope IX locks.
*/
#define MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK         0x1000
#define MYSQL_LOCK_NOT_TEMPORARY		0x2000
#define MYSQL_LOCK_USE_MALLOC                   0x4000
/**
  Only check THD::killed if waits happen (e.g. wait on MDL, wait on
  table flush, wait on thr_lock.c locks) while opening and locking table.
*/
#define MYSQL_OPEN_IGNORE_KILLED                0x8000
/**
   Don't try to  auto-repair table
*/
#define MYSQL_OPEN_IGNORE_REPAIR                0x10000

/**
   Don't call decide_logging_format. Used for statistic tables etc
*/
#define MYSQL_OPEN_IGNORE_LOGGING_FORMAT        0x20000

/* Don't use statistics tables */
#define MYSQL_OPEN_IGNORE_ENGINE_STATS          0x40000

/** Please refer to the internals manual. */
#define MYSQL_OPEN_REOPEN  (MYSQL_OPEN_IGNORE_FLUSH |\
                            MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |\
                            MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |\
                            MYSQL_LOCK_IGNORE_TIMEOUT |\
                            MYSQL_OPEN_GET_NEW_TABLE |\
                            MYSQL_OPEN_HAS_MDL_LOCK)

bool is_locked_view(THD *thd, TABLE_LIST *t);
bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx);

bool get_key_map_from_key_list(key_map *map, TABLE *table,
                               List<String> *index_list);
TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name);
TABLE *find_write_locked_table(TABLE *list, const char *db,
                               const char *table_name);
thr_lock_type read_lock_type_for_table(THD *thd,
                                       Query_tables_list *prelocking_ctx,
                                       TABLE_LIST *table_list,
                                       bool routine_modifies_data);

my_bool mysql_rm_tmp_tables(void);
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables,
                             const MDL_savepoint &start_of_statement_svp);
bool table_already_fk_prelocked(TABLE_LIST *tl, LEX_CSTRING *db,
                                LEX_CSTRING *table, thr_lock_type lock_type);
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
                               TABLE_LIST *TABLE_LIST::*link,
                               const LEX_CSTRING *db_name,
                               const LEX_CSTRING *table_name);
int close_thread_tables(THD *thd);
void switch_to_nullable_trigger_fields(List<Item> &items, TABLE *);
void switch_defaults_to_nullable_trigger_fields(TABLE *table);
bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table,
                                          List<Item> &fields,
                                          List<Item> &values,
                                          bool ignore_errors,
                                          enum trg_event_type event);
bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table,
                                          Field **field,
                                          List<Item> &values,
                                          bool ignore_errors,
                                          enum trg_event_type event);
bool insert_fields(THD *thd, Name_resolution_context *context,
		   const char *db_name, const char *table_name,
                   List_iterator<Item> *it, bool any_privileges,
                   uint *hidden_bit_fields, bool returning_field);
void make_leaves_list(THD *thd, List<TABLE_LIST> &list, TABLE_LIST *tables,
                      bool full_table_list, TABLE_LIST *boundary);
int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
	       List<Item> *sum_func_list, SELECT_LEX *sl, bool returning_field);
int setup_returning_fields(THD* thd, TABLE_LIST* table_list);
bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array,
                  List<Item> &item, enum_column_usage column_usage,
                  List<Item> *sum_func_list, List<Item> *pre_fix,
                  bool allow_sum_func, THD_WHERE where= THD_WHERE::DEFAULT_WHERE);
void unfix_fields(List<Item> &items);
bool fill_record(THD * thd, TABLE *table_arg, List<Item> &fields,
                 List<Item> &values, bool ignore_errors, bool update);
bool fill_record(THD *thd, TABLE *table, Field **field, List<Item> &values,
                 bool ignore_errors, bool use_value,
                 bool check_for_evaluability);

Field *
find_field_in_tables(THD *thd, Item_ident *item,
                     TABLE_LIST *first_table, TABLE_LIST *last_table,
                     ignored_tables_list_t ignored_tables,
                     Item **ref, find_item_error_report_type report_error,
                     bool check_privileges, bool register_tree_change);
Field *
find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
                        const char *name, size_t length,
                        const char *item_name, const char *db_name,
                        const char *table_name,
                        ignored_tables_list_t ignored_tables,
                        Item **ref, bool check_privileges, bool allow_rowid,
                        field_index_t *cached_field_index_ptr,
                        bool register_tree_change, TABLE_LIST **actual_table);
Field *
find_field_in_table(THD *thd, TABLE *table, const char *name, size_t length,
                    bool allow_rowid, field_index_t *cached_field_index_ptr);
Field *
find_field_in_table_sef(TABLE *table, const char *name);
Item ** find_item_in_list(Item *item, List<Item> &items, uint *counter,
                          find_item_error_report_type report_error,
                          enum_resolution_type *resolution, uint limit= 0);
bool setup_tables(THD *thd, Name_resolution_context *context,
                  List<TABLE_LIST> *from_clause, TABLE_LIST *tables,
                  List<TABLE_LIST> &leaves, bool select_insert,
                  bool full_table_list);
bool setup_tables_and_check_access(THD *thd,
                                   Name_resolution_context *context,
                                   List<TABLE_LIST> *from_clause,
                                   TABLE_LIST *tables,
                                   List<TABLE_LIST> &leaves, 
                                   bool select_insert,
                                   privilege_t want_access_first,
                                   privilege_t want_access,
                                   bool full_table_list);
bool wait_while_table_is_used(THD *thd, TABLE *table,
                              enum ha_extra_function function);

void drop_open_table(THD *thd, TABLE *table, const LEX_CSTRING *db_name,
                     const LEX_CSTRING *table_name);
void update_non_unique_table_error(TABLE_LIST *update,
                                   const char *operation,
                                   TABLE_LIST *duplicate);
int setup_conds(THD *thd, TABLE_LIST *tables, List<TABLE_LIST> &leaves,
		COND **conds);
void wrap_ident(THD *thd, Item **conds);
int setup_ftfuncs(SELECT_LEX* select);
void cleanup_ftfuncs(SELECT_LEX *select_lex);
int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order);
bool lock_table_names(THD *thd, const DDL_options_st &options,
                      TABLE_LIST *table_list,
                      TABLE_LIST *table_list_end, ulong lock_wait_timeout,
                      uint flags);
static inline bool
lock_table_names(THD *thd, TABLE_LIST *table_list,
                 TABLE_LIST *table_list_end, ulong lock_wait_timeout,
                 uint flags)
{
  return lock_table_names(thd, thd->lex->create_info, table_list,
                          table_list_end, lock_wait_timeout, flags);
}
bool open_tables(THD *thd, const DDL_options_st &options,
                 TABLE_LIST **tables, uint *counter,
                 uint flags, Prelocking_strategy *prelocking_strategy);

static inline bool
open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags,
            Prelocking_strategy *prelocking_strategy)
{
  return open_tables(thd, thd->lex->create_info, tables, counter, flags,
                     prelocking_strategy);
}
/* open_and_lock_tables with optional derived handling */
bool open_and_lock_tables(THD *thd, const DDL_options_st &options,
                          TABLE_LIST *tables,
                          bool derived, uint flags,
                          Prelocking_strategy *prelocking_strategy);
static inline bool
open_and_lock_tables(THD *thd, TABLE_LIST *tables,
                     bool derived, uint flags,
                     Prelocking_strategy *prelocking_strategy)
{
  return open_and_lock_tables(thd, thd->lex->create_info,
                              tables, derived, flags, prelocking_strategy);
}
/* simple open_and_lock_tables without derived handling for single table */
TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
                                thr_lock_type lock_type, uint flags,
                                Prelocking_strategy *prelocking_strategy);
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
                                    uint dt_phases);
bool open_tables_only_view_structure(THD *thd, TABLE_LIST *tables,
                                     bool can_deadlock);
bool open_and_lock_internal_tables(TABLE *table, bool lock);
bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags);
int decide_logging_format(THD *thd, TABLE_LIST *tables);
void close_thread_table(THD *thd, TABLE **table_ptr);
TABLE_LIST*
unique_table_in_insert_returning_subselect(THD *thd, TABLE_LIST *table, SELECT_LEX *sel);
TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
                         uint check_flag);
bool is_equal(const LEX_CSTRING *a, const LEX_CSTRING *b);

class Open_tables_backup;
/* Functions to work with system tables. */
bool open_system_tables_for_read(THD *thd, TABLE_LIST *table_list);
void close_system_tables(THD *thd);
void close_mysql_tables(THD *thd);
TABLE *open_system_table_for_update(THD *thd, TABLE_LIST *one_table);
TABLE *open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_backup *backup);
void close_log_table(THD *thd, Open_tables_backup *backup);

bool close_cached_tables(THD *thd, TABLE_LIST *tables,
                         bool wait_for_refresh, ulong timeout);
void purge_tables();
bool flush_tables(THD *thd, flush_tables_type flag);
void close_all_tables_for_name(THD *thd, TABLE_SHARE *share,
                               ha_extra_function extra,
                               TABLE *skip_table);
OPEN_TABLE_LIST *list_open_tables(THD *thd, const LEX_CSTRING &db,
                                  const char *wild);
bool tdc_open_view(THD *thd, TABLE_LIST *table_list, uint flags);

TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db,
                                  const char *table_name,
                                  int *p_error);
void mark_tmp_table_for_reuse(TABLE *table);

int dynamic_column_error_message(enum_dyncol_func_result rc);

/* open_and_lock_tables with optional derived handling */
int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);

extern "C" qsort_cmp2 simple_raw_key_cmp;
extern "C" int count_distinct_walk(void *elem, element_count count, void *arg);
int simple_str_key_cmp(void *arg, const void *key1, const void *key2);

extern Item **not_found_item;
extern Field *not_found_field;
extern Field *view_ref_found;

/**
  clean/setup table fields and map.

  @param table        TABLE structure pointer (which should be setup)
  @param table_list   TABLE_LIST structure pointer (owner of TABLE)
  @param tablenr     table number
*/


inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
{
  table->used_fields= 0;
  table_list->reset_const_table();
  table->null_row= 0;
  table->status= STATUS_NO_RECORD;
  table->maybe_null= table_list->outer_join;
  TABLE_LIST *embedding= table_list->embedding;
  while (!table->maybe_null && embedding)
  {
    table->maybe_null= embedding->outer_join;
    embedding= embedding->embedding;
  }
  DBUG_ASSERT(tablenr <= MAX_TABLES);
  table->tablenr= tablenr;
  table->map= (table_map) 1 << tablenr;
  table->force_index= table_list->force_index;
  table->force_index_order= table->force_index_group= 0;
  table->covering_keys= table->s->keys_for_keyread;
}

inline TABLE_LIST *find_table_in_global_list(TABLE_LIST *table,
                                             LEX_CSTRING *db_name,
                                             LEX_CSTRING *table_name)
{
  return find_table_in_list(table, &TABLE_LIST::next_global,
                            db_name, table_name);
}

inline bool setup_fields_with_no_wrap(THD *thd, Ref_ptr_array ref_pointer_array,
                                      List<Item> &item,
                                      enum_column_usage column_usage,
                                      List<Item> *sum_func_list,
                                      bool allow_sum_func,
                                      THD_WHERE where= THD_WHERE::DEFAULT_WHERE)
{
  bool res;
  SELECT_LEX *first= thd->lex->first_select_lex();
  DBUG_ASSERT(thd->lex->current_select == first);
  first->no_wrap_view_item= TRUE;
  res= setup_fields(thd, ref_pointer_array, item, column_usage,
                    sum_func_list, NULL,  allow_sum_func, where);
  first->no_wrap_view_item= FALSE;
  return res;
}

/**
  An abstract class for a strategy specifying how the prelocking
  algorithm should extend the prelocking set while processing
  already existing elements in the set.
*/

class Prelocking_strategy
{
public:
  virtual ~Prelocking_strategy() = default;

  virtual void reset(THD *thd) { };
  virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,
                              Sroutine_hash_entry *rt, sp_head *sp,
                              bool *need_prelocking) = 0;
  virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,
                            TABLE_LIST *table_list, bool *need_prelocking) = 0;
  virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,
                           TABLE_LIST *table_list, bool *need_prelocking)= 0;
  virtual bool handle_end(THD *thd) { return 0; };
};


/**
  A Strategy for prelocking algorithm suitable for DML statements.

  Ensures that all tables used by all statement's SF/SP/triggers and
  required for foreign key checks are prelocked and SF/SPs used are
  cached.
*/

class DML_prelocking_strategy : public Prelocking_strategy
{
public:
  bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,
                      Sroutine_hash_entry *rt, sp_head *sp,
                      bool *need_prelocking) override;
  bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,
                    TABLE_LIST *table_list, bool *need_prelocking) override;
  bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,
                   TABLE_LIST *table_list, bool *need_prelocking) override;
};


/**
  A strategy for prelocking algorithm to be used for LOCK TABLES
  statement.
*/

class Lock_tables_prelocking_strategy : public DML_prelocking_strategy
{
  bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,
                    TABLE_LIST *table_list, bool *need_prelocking) override;
};


/**
  Strategy for prelocking algorithm to be used for ALTER TABLE statements.

  Unlike DML or LOCK TABLES strategy, it doesn't
  prelock triggers, views or stored routines, since they are not
  used during ALTER.
*/

class Alter_table_prelocking_strategy : public Prelocking_strategy
{
public:
  bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,
                      Sroutine_hash_entry *rt, sp_head *sp,
                      bool *need_prelocking) override;
  bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,
                    TABLE_LIST *table_list, bool *need_prelocking) override;
  bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,
                   TABLE_LIST *table_list, bool *need_prelocking) override;
};


inline bool
open_tables(THD *thd, const DDL_options_st &options,
            TABLE_LIST **tables, uint *counter, uint flags)
{
  DML_prelocking_strategy prelocking_strategy;

  return open_tables(thd, options, tables, counter, flags,
                     &prelocking_strategy);
}
inline bool
open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags)
{
  DML_prelocking_strategy prelocking_strategy;

  return open_tables(thd, thd->lex->create_info, tables, counter, flags,
                     &prelocking_strategy);
}

inline TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
                                       thr_lock_type lock_type, uint flags)
{
  DML_prelocking_strategy prelocking_strategy;

  return open_n_lock_single_table(thd, table_l, lock_type, flags,
                                  &prelocking_strategy);
}


/* open_and_lock_tables with derived handling */
inline bool open_and_lock_tables(THD *thd,
                                 const DDL_options_st &options,
                                 TABLE_LIST *tables,
                                 bool derived, uint flags)
{
  DML_prelocking_strategy prelocking_strategy;

  return open_and_lock_tables(thd, options, tables, derived, flags,
                              &prelocking_strategy);
}
inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
                                  bool derived, uint flags)
{
  DML_prelocking_strategy prelocking_strategy;

  return open_and_lock_tables(thd, thd->lex->create_info,
                              tables, derived, flags,
                              &prelocking_strategy);
}


bool restart_trans_for_tables(THD *thd, TABLE_LIST *table);

bool extend_table_list(THD *thd, TABLE_LIST *tables,
                       Prelocking_strategy *prelocking_strategy,
                       bool has_prelocking_list);

/**
  A context of open_tables() function, used to recover
  from a failed open_table() or open_routine() attempt.
*/

class Open_table_context
{
public:
  enum enum_open_table_action
  {
    OT_NO_ACTION= 0,
    OT_BACKOFF_AND_RETRY,
    OT_REOPEN_TABLES,
    OT_DISCOVER,
    OT_REPAIR
  };
  Open_table_context(THD *thd, uint flags);

  bool recover_from_failed_open();
  bool request_backoff_action(enum_open_table_action action_arg,
                              TABLE_LIST *table);

  bool can_recover_from_failed_open() const
  { return m_action != OT_NO_ACTION; }

  /**
    When doing a back-off, we close all tables acquired by this
    statement.  Return an MDL savepoint taken at the beginning of
    the statement, so that we can rollback to it before waiting on
    locks.
  */
  const MDL_savepoint &start_of_statement_svp() const
  {
    return m_start_of_statement_svp;
  }

  inline ulong get_timeout() const
  {
    return m_timeout;
  }

  uint get_flags() const { return m_flags; }

  /**
    Set flag indicating that we have already acquired metadata lock
    protecting this statement against GRL while opening tables.
  */
  void set_has_protection_against_grl(enum_mdl_type mdl_type)
  {
    m_has_protection_against_grl|= MDL_BIT(mdl_type);
  }

  bool has_protection_against_grl(enum_mdl_type mdl_type) const
  {
    return (bool) (m_has_protection_against_grl & MDL_BIT(mdl_type));
  }

private:
  /* THD for which tables are opened. */
  THD *m_thd;
  /**
    For OT_DISCOVER and OT_REPAIR actions, the table list element for
    the table which definition should be re-discovered or which
    should be repaired.
  */
  TABLE_LIST *m_failed_table;
  MDL_savepoint m_start_of_statement_svp;
  /**
    Lock timeout in seconds. Initialized to LONG_TIMEOUT when opening system
    tables or to the "lock_wait_timeout" system variable for regular tables.
  */
  ulong m_timeout;
  /* open_table() flags. */
  uint m_flags;
  /** Back off action. */
  enum enum_open_table_action m_action;
  /**
    Whether we had any locks when this context was created.
    If we did, they are from the previous statement of a transaction,
    and we can't safely do back-off (and release them).
  */
  bool m_has_locks;
  /**
    Indicates that in the process of opening tables we have acquired
    protection against global read lock.
  */
  mdl_bitmap_t m_has_protection_against_grl;
};


/**
  Check if a TABLE_LIST instance represents a pre-opened temporary table.
*/

inline bool is_temporary_table(TABLE_LIST *tl)
{
  if (tl->view || tl->schema_table)
    return FALSE;

  if (!tl->table)
    return FALSE;

  /*
    NOTE: 'table->s' might be NULL for specially constructed TABLE
    instances. See SHOW TRIGGERS for example.
  */

  if (!tl->table->s)
    return FALSE;

  return tl->table->s->tmp_table != NO_TMP_TABLE;
}


/**
  This internal handler is used to trap ER_NO_SUCH_TABLE.
*/

class No_such_table_error_handler : public Internal_error_handler
{
public:
  No_such_table_error_handler()
    : m_handled_errors(0), m_unhandled_errors(0), first_error(0)
  {}

  bool handle_condition(THD *thd,
                        uint sql_errno,
                        const char* sqlstate,
                        Sql_condition::enum_warning_level *level,
                        const char* msg,
                        Sql_condition ** cond_hdl) override;

  /**
    Returns TRUE if one or more ER_NO_SUCH_TABLE errors have been
    trapped and no other errors have been seen. FALSE otherwise.
  */
  bool safely_trapped_errors();
  uint got_error() { return first_error; }

private:
  int m_handled_errors;
  int m_unhandled_errors;
  uint first_error;
};
#endif /* SQL_BASE_INCLUDED */
server/private/sql_digest.h000064400000007353150400263720012042 0ustar00/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef SQL_DIGEST_H
#define SQL_DIGEST_H

#include <string.h>
class String;
#include "my_md5.h"

#define MAX_DIGEST_STORAGE_SIZE (1024*1024)

/**
  Structure to store token count/array for a statement
  on which digest is to be calculated.
*/
struct sql_digest_storage
{
  bool m_full;
  uint m_byte_count;
  unsigned char m_md5[MD5_HASH_SIZE];
  /** Character set number. */
  uint m_charset_number;
  /**
    Token array.
    Token array is an array of bytes to store tokens received during parsing.
    Following is the way token array is formed.
    ... &lt;non-id-token&gt; &lt;non-id-token&gt; &lt;id-token&gt; &lt;id_len&gt; &lt;id_text&gt; ...
    For Example:
    SELECT * FROM T1;
    &lt;SELECT_TOKEN&gt; &lt;*&gt; &lt;FROM_TOKEN&gt; &lt;ID_TOKEN&gt; &lt;2&gt; &lt;T1&gt;

    @note Only the first @c m_byte_count bytes are initialized,
      out of @c m_token_array_length.
  */
  unsigned char *m_token_array;
  /* Length of the token array to be considered for DIGEST_TEXT calculation. */
  uint m_token_array_length;

  sql_digest_storage()
  {
    reset(NULL, 0);
  }

  inline void reset(unsigned char *token_array, size_t length)
  {
    m_token_array= token_array;
    m_token_array_length= (uint)length;
    reset();
  }

  inline void reset()
  {
    m_full= false;
    m_byte_count= 0;
    m_charset_number= 0;
    memset(m_md5, 0, MD5_HASH_SIZE);
  }

  inline bool is_empty()
  {
    return (m_byte_count == 0);
  }

  inline void copy(const sql_digest_storage *from)
  {
    /*
      Keep in mind this is a dirty copy of something that may change,
      as the thread producing the digest is executing concurrently,
      without any lock enforced.
    */
    uint byte_count_copy= m_token_array_length < from->m_byte_count ?
                          m_token_array_length : from->m_byte_count;

    if (byte_count_copy > 0)
    {
      m_full= from->m_full;
      m_byte_count= byte_count_copy;
      m_charset_number= from->m_charset_number;
      memcpy(m_token_array, from->m_token_array, m_byte_count);
      memcpy(m_md5, from->m_md5, MD5_HASH_SIZE);
    }
    else
    {
      m_full= false;
      m_byte_count= 0;
      m_charset_number= 0;
    }
  }
};
typedef struct sql_digest_storage sql_digest_storage;

/**
  Compute a digest hash.
  @param digest_storage The digest
  @param [out] md5 The computed digest hash. This parameter is a buffer of size @c MD5_HASH_SIZE.
*/
void compute_digest_md5(const sql_digest_storage *digest_storage, unsigned char *md5);

/**
  Compute a digest text.
  A 'digest text' is a textual representation of a query,
  where:
  - comments are removed,
  - non significant spaces are removed,
  - literal values are replaced with a special '?' marker,
  - lists of values are collapsed using a shorter notation
  @param digest_storage The digest
  @param [out] digest_text
  @param digest_text_length Size of @c digest_text.
  @param [out] truncated true if the text representation was truncated
*/
void compute_digest_text(const sql_digest_storage *digest_storage,
                         String *digest_text);

#endif

server/private/wsrep_trans_observer.h000064400000043307150400263720014161 0ustar00/* Copyright 2016-2025 Codership Oy <http://www.codership.com>

   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#ifndef WSREP_TRANS_OBSERVER_H
#define WSREP_TRANS_OBSERVER_H

#include "my_global.h"
#include "mysql/service_wsrep.h"
#include "wsrep_applier.h" /* wsrep_apply_error */
#include "wsrep_xid.h"
#include "wsrep_thd.h"
#include "wsrep_binlog.h" /* register/deregister group commit */
#include "my_dbug.h"

class THD;

void wsrep_commit_empty(THD* thd, bool all);

/*
   Return true if THD has active wsrep transaction.
 */
static inline bool wsrep_is_active(THD* thd)
{
  return (thd->wsrep_cs().state() != wsrep::client_state::s_none  &&
          thd->wsrep_cs().transaction().active() &&
          !thd->internal_transaction());
}

/*
  Return true if transaction is ordered.
 */
static inline bool wsrep_is_ordered(THD* thd)
{
  return thd->wsrep_trx().ordered();
}

/*
  Return true if transaction has been BF aborted but has not been
  rolled back yet.

  It is required that the caller holds thd->LOCK_thd_data.
*/
static inline bool wsrep_must_abort(THD* thd)
{
  mysql_mutex_assert_owner(&thd->LOCK_thd_data);
  return (thd->wsrep_trx().state() == wsrep::transaction::s_must_abort);
}

/*
  Return true if the transaction must be replayed.
 */
static inline bool wsrep_must_replay(THD* thd)
{
  return (thd->wsrep_trx().state() == wsrep::transaction::s_must_replay);
}
/*
  Return true if transaction has not been committed.

  Note that we don't require thd->LOCK_thd_data here. Calling this method
  makes sense only from codepaths which are past ordered_commit state
  and the wsrep transaction is immune to BF aborts at that point.
*/
static inline bool wsrep_not_committed(THD* thd)
{
  return (thd->wsrep_trx().state() != wsrep::transaction::s_committed);
}

/*
  Return true if THD is either committing a transaction or statement
  is autocommit.
 */
static inline bool wsrep_is_real(THD* thd, bool all)
{
  return (all || thd->transaction->all.ha_list == 0);
}

/*
  Check if a transaction has generated changes.
 */
static inline bool wsrep_has_changes(THD* thd)
{
  // Transaction has changes to replicate if it
  // has appended one or more certification keys,
  // and has actual changes to replicate in binlog
  // cache. Except for streaming replication,
  // where commit message may have no payload.
  return !thd->wsrep_trx().is_empty() &&
    (!wsrep_is_binlog_cache_empty(thd) || thd->wsrep_trx().is_streaming());
}

/*
  Check if an active transaction has been BF aborted.
 */
static inline bool wsrep_is_bf_aborted(THD* thd)
{
  return (thd->wsrep_trx().active() && thd->wsrep_trx().bf_aborted());
}

static inline int wsrep_check_pk(THD* thd)
{
  if (!wsrep_certify_nonPK)
  {
    for (TABLE* table= thd->open_tables; table != NULL; table= table->next)
    {
      if (table->key_info == NULL || table->s->primary_key == MAX_KEY)
      {
        WSREP_DEBUG("No primary key found for table %s.%s",
                    table->s->db.str, table->s->table_name.str);
        wsrep_override_error(thd, ER_LOCK_DEADLOCK);
        return 1;
      }
    }
  }
  return 0;
}

static inline bool wsrep_streaming_enabled(THD* thd)
{
  return (thd->wsrep_sr().fragment_size() > 0);
}

/*
  Return number of fragments successfully certified for the
  current statement.
 */
static inline size_t wsrep_fragments_certified_for_stmt(THD* thd)
{
    return thd->wsrep_trx().fragments_certified_for_statement();
}

static inline int wsrep_start_transaction(THD* thd, wsrep_trx_id_t trx_id)
{
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none) {
    if (wsrep_is_active(thd) == false)
      return thd->wsrep_cs().start_transaction(wsrep::transaction_id(trx_id));
  }
  return 0;
}

/**/
static inline int wsrep_start_trx_if_not_started(THD* thd)
{
  int ret= 0;
  DBUG_ASSERT(thd->wsrep_next_trx_id() != WSREP_UNDEFINED_TRX_ID);
  DBUG_ASSERT(thd->wsrep_cs().mode() == Wsrep_client_state::m_local);
  if (thd->wsrep_trx().active() == false)
  {
    ret= wsrep_start_transaction(thd, thd->wsrep_next_trx_id());
  }
  return ret;
}

/*
  Called after each row operation.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_after_row_internal(THD* thd)
{
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none  &&
      wsrep_thd_is_local(thd))
  {
    if (wsrep_check_pk(thd))
    {
      return 1;
    }
    else if (wsrep_streaming_enabled(thd))
    {
      return thd->wsrep_cs().after_row();
    }
  }
  return 0;
}

/*
  Helper method to determine whether commit time hooks
  should be run for the transaction.

  Commit hooks must be run in the following cases:
  - The transaction is local and has generated write set and is committing.
  - The transaction has been BF aborted
  - Is running in high priority mode and is ordered. This can be replayer,
    applier or storage access.
 */
static inline bool wsrep_run_commit_hook(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_run_commit_hook");
  DBUG_PRINT("wsrep", ("Is_active: %d is_real %d has_changes %d is_applying %d "
                       "is_ordered: %d",
                       wsrep_is_active(thd), wsrep_is_real(thd, all),
                       wsrep_has_changes(thd), wsrep_thd_is_applying(thd),
                       wsrep_is_ordered(thd)));

  /* skipping non-wsrep threads */
  if (!WSREP(thd))
    DBUG_RETURN(false);

  /* Is MST commit or autocommit? */
  bool ret= wsrep_is_active(thd) && wsrep_is_real(thd, all);
  /* Do not commit if we are aborting */
  ret= ret && (thd->wsrep_trx().state() != wsrep::transaction::s_aborting);
  if (ret && !(wsrep_has_changes(thd) ||  /* Has generated write set */
               /* Is high priority (replay, applier, storage) and the
                  transaction is scheduled for commit ordering */
               (wsrep_thd_is_applying(thd) && wsrep_is_ordered(thd))))
  {
    mysql_mutex_lock(&thd->LOCK_thd_data);
    DBUG_PRINT("wsrep", ("state: %s",
                         wsrep::to_c_string(thd->wsrep_trx().state())));
    /* Transaction is local but has no changes, the commit hooks will
       be skipped and the wsrep transaction is terminated in
       wsrep_commit_empty() */
    if (thd->wsrep_trx().state() == wsrep::transaction::s_executing)
    {
      ret= false;
    }
    mysql_mutex_unlock(&thd->LOCK_thd_data);
  }

  mysql_mutex_lock(&thd->LOCK_thd_data);
  /* Transaction creating sequence is TOI or RSU,
  CREATE SEQUENCE = CREATE + INSERT (initial value)
  and replicated using statement based replication, thus
  the commit hooks will be skipped.

  For TEMPORARY SEQUENCES commit hooks will be done as
  CREATE + INSERT is not replicated and needs to be
  committed locally. */
  if (ret &&
      (thd->wsrep_cs().mode() == wsrep::client_state::m_toi ||
       thd->wsrep_cs().mode() == wsrep::client_state::m_rsu) &&
      thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE &&
      !thd->lex->tmp_table())
    ret= false;
  mysql_mutex_unlock(&thd->LOCK_thd_data);

  DBUG_PRINT("wsrep", ("return: %d", ret));
  DBUG_RETURN(ret);
}

/*
  Called before the transaction is prepared.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_before_prepare(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_before_prepare");
  WSREP_DEBUG("wsrep_before_prepare: %d", wsrep_is_real(thd, all));
  int ret= 0;
  DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
  if ((ret= thd->wsrep_parallel_slave_wait_for_prior_commit()))
  {
    DBUG_RETURN(ret);
  }

  if ((ret= thd->wsrep_cs().before_prepare()) == 0)
  {
    DBUG_ASSERT(!thd->wsrep_trx().ws_meta().gtid().is_undefined());
    /* Here we init xid with UUID and wsrep seqno. GTID is
       set to undefined because commit order is decided later
       in wsrep_before_commit(). wsrep_before_prepare() is
       executed out of order. */
    wsrep_xid_init(&thd->wsrep_xid,
                   thd->wsrep_trx().ws_meta().gtid(),
                   wsrep_gtid_server.undefined());
  }

  mysql_mutex_lock(&thd->LOCK_thd_kill);
  if (thd->killed) wsrep_backup_kill_for_commit(thd);
  mysql_mutex_unlock(&thd->LOCK_thd_kill);

  DBUG_RETURN(ret);
}

/*
  Called after the transaction has been prepared.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_after_prepare(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_after_prepare");
  WSREP_DEBUG("wsrep_after_prepare: %d", wsrep_is_real(thd, all));
  DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
  int ret= thd->wsrep_cs().after_prepare();
  DBUG_ASSERT(ret == 0 || thd->wsrep_cs().current_error() ||
              thd->wsrep_cs().transaction().state() == wsrep::transaction::s_must_replay);
  DBUG_RETURN(ret);
}

/*
  Called before the transaction is committed.

  This function must be called from both client and
  applier contexts before commit.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_before_commit(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_before_commit");
  WSREP_DEBUG("wsrep_before_commit: %d, %lld",
              wsrep_is_real(thd, all),
              (long long)wsrep_thd_trx_seqno(thd));
  int ret= 0;
  DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
  if ((ret= thd->wsrep_cs().before_commit()) == 0)
  {
    DBUG_ASSERT(!thd->wsrep_trx().ws_meta().gtid().is_undefined());
    if (!thd->variables.gtid_seq_no && 
        (thd->wsrep_trx().ws_meta().flags() & wsrep::provider::flag::commit))
    {
        uint64 seqno= 0;
        if (thd->variables.wsrep_gtid_seq_no &&
            thd->variables.wsrep_gtid_seq_no > wsrep_gtid_server.seqno())
        {
          seqno= thd->variables.wsrep_gtid_seq_no;
          wsrep_gtid_server.seqno(thd->variables.wsrep_gtid_seq_no);
        }
        else
        {
          seqno= wsrep_gtid_server.seqno_inc();
        }
        thd->variables.wsrep_gtid_seq_no= 0;
        thd->wsrep_current_gtid_seqno= seqno;
        if (mysql_bin_log.is_open() && wsrep_gtid_mode)
        {
          thd->variables.gtid_seq_no= seqno;
          thd->variables.gtid_domain_id= wsrep_gtid_server.domain_id;
          thd->variables.server_id= wsrep_gtid_server.server_id;
        }
    }

    wsrep_xid_init(&thd->wsrep_xid,
                   thd->wsrep_trx().ws_meta().gtid(),
                   wsrep_gtid_server.gtid());
    wsrep_register_for_group_commit(thd);
  }

  mysql_mutex_lock(&thd->LOCK_thd_kill);
  if (thd->killed) wsrep_backup_kill_for_commit(thd);
  mysql_mutex_unlock(&thd->LOCK_thd_kill);

  DBUG_RETURN(ret);
}

/*
  Called after the transaction has been ordered for commit.

  This function must be called from both client and
  applier contexts after the commit has been ordered.

  @param thd Pointer to THD
  @param all 
  @param err Error buffer in case of applying error

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_ordered_commit(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_ordered_commit");
  WSREP_DEBUG("wsrep_ordered_commit: %d %lld", wsrep_is_real(thd, all),
              (long long) wsrep_thd_trx_seqno(thd));
  DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
  DBUG_RETURN(thd->wsrep_cs().ordered_commit());
}

/*
  Called after the transaction has been committed.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_after_commit(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_after_commit");
  WSREP_DEBUG("wsrep_after_commit: %d, %d, %lld, %d",
              wsrep_is_real(thd, all),
              wsrep_is_active(thd),
              (long long)wsrep_thd_trx_seqno(thd),
              wsrep_has_changes(thd));
  DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
  if (thd->internal_transaction())
    DBUG_RETURN(0);
  int ret= 0;
  if (thd->wsrep_trx().state() == wsrep::transaction::s_committing)
  {
    ret= thd->wsrep_cs().ordered_commit();
  }
  wsrep_unregister_from_group_commit(thd);
  thd->wsrep_xid.null();
  DBUG_RETURN(ret || thd->wsrep_cs().after_commit());
}

/*
  Called before the transaction is rolled back.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_before_rollback(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_before_rollback");
  int ret= 0;
  if (wsrep_is_active(thd))
  {
    if (!all && thd->in_active_multi_stmt_transaction())
    {
      if (wsrep_emulate_bin_log)
      {
        wsrep_thd_binlog_stmt_rollback(thd);
      }

      if (thd->wsrep_trx().is_streaming() &&
          (wsrep_fragments_certified_for_stmt(thd) > 0))
      {
        /* Non-safe statement rollback during SR multi statement
           transaction. A statement rollback is considered unsafe, if
           the same statement has already replicated one or more fragments.
           Self abort the transaction, the actual rollback and error
           handling will be done in after statement phase. */
        WSREP_DEBUG("statement rollback is not safe for streaming replication");
        wsrep_thd_self_abort(thd);
        ret= 0;
      }
    }
    else if (wsrep_is_real(thd, all) &&
             thd->wsrep_trx().state() != wsrep::transaction::s_aborted)
    {
      /* Real transaction rolling back and wsrep abort not completed
         yet */
      /* Reset XID so that it does not trigger writing serialization
         history in InnoDB. This needs to be avoided because rollback
         may happen out of order and replay may follow. */
      thd->wsrep_xid.null();
      ret= thd->wsrep_cs().before_rollback();
    }
  }
  DBUG_RETURN(ret);
}

/*
  Called after the transaction has been rolled back.

  Return zero on succes, non-zero on failure.
 */
static inline int wsrep_after_rollback(THD* thd, bool all)
{
  DBUG_ENTER("wsrep_after_rollback");
  DBUG_RETURN((wsrep_is_real(thd, all) && wsrep_is_active(thd) &&
               thd->wsrep_cs().transaction().state() !=
               wsrep::transaction::s_aborted) ?
              thd->wsrep_cs().after_rollback() : 0);
}

static inline int wsrep_before_statement(THD* thd)
{
  return (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
          !thd->internal_transaction() ?
	  thd->wsrep_cs().before_statement() : 0);
}

static inline
int wsrep_after_statement(THD* thd)
{
  DBUG_ENTER("wsrep_after_statement");
  int ret= ((thd->wsrep_cs().state() != wsrep::client_state::s_none &&
               thd->wsrep_cs().mode() == Wsrep_client_state::m_local) &&
              !thd->internal_transaction() ?
              thd->wsrep_cs().after_statement() : 0);

  if (wsrep_is_active(thd))
  {
    mysql_mutex_lock(&thd->LOCK_thd_kill);
    wsrep_restore_kill_after_commit(thd);
    mysql_mutex_unlock(&thd->LOCK_thd_kill);
  }
  DBUG_RETURN(ret);
}

static inline void wsrep_after_apply(THD* thd)
{
  DBUG_ASSERT(wsrep_thd_is_applying(thd));
  WSREP_DEBUG("wsrep_after_apply %lld", thd->thread_id);
  if (!thd->internal_transaction())
    thd->wsrep_cs().after_applying();
}

static inline void wsrep_open(THD* thd)
{
  DBUG_ENTER("wsrep_open");
  if (WSREP_ON_)
  {
    /* WSREP_PROVIDER_EXISTS_ cannot be set if WSREP_ON_ is not set */
    DBUG_ASSERT(WSREP_PROVIDER_EXISTS_);
    thd->wsrep_cs().open(wsrep::client_id(thd->thread_id));
    thd->wsrep_cs().debug_log_level(wsrep_debug);
    if (!thd->wsrep_applier && thd->variables.wsrep_trx_fragment_size)
    {
      thd->wsrep_cs().enable_streaming(
        wsrep_fragment_unit(thd->variables.wsrep_trx_fragment_unit),
        size_t(thd->variables.wsrep_trx_fragment_size));
    }
  }
  DBUG_VOID_RETURN;
}

static inline void wsrep_close(THD* thd)
{
  DBUG_ENTER("wsrep_close");
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
      !thd->internal_transaction())
  {
    thd->wsrep_cs().close();
  }
  DBUG_VOID_RETURN;
}

static inline void wsrep_cleanup(THD* thd)
{
  DBUG_ENTER("wsrep_cleanup");
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none)
  {
    thd->wsrep_cs().cleanup();
  }
  DBUG_VOID_RETURN;
}

static inline void
wsrep_wait_rollback_complete_and_acquire_ownership(THD *thd)
{
  DBUG_ENTER("wsrep_wait_rollback_complete_and_acquire_ownership");
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
      !thd->internal_transaction())
  {
    thd->wsrep_cs().wait_rollback_complete_and_acquire_ownership();
  }
  DBUG_VOID_RETURN;
}

static inline int wsrep_before_command(THD* thd, bool keep_command_error)
{
  return (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
          !thd->internal_transaction() ?
          thd->wsrep_cs().before_command(keep_command_error) : 0);
}

static inline int wsrep_before_command(THD* thd)
{
  return wsrep_before_command(thd, false);
}

/*
  Called after each command.

  Return zero on success, non-zero on failure.
*/
static inline void wsrep_after_command_before_result(THD* thd)
{
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
      !thd->internal_transaction())
  {
    thd->wsrep_cs().after_command_before_result();
  }
}

static inline void wsrep_after_command_after_result(THD* thd)
{
  if (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
      !thd->internal_transaction())
  {
    thd->wsrep_cs().after_command_after_result();
  }
}

static inline void wsrep_after_command_ignore_result(THD* thd)
{
  wsrep_after_command_before_result(thd);
  DBUG_ASSERT(!thd->wsrep_cs().current_error());
  wsrep_after_command_after_result(thd);
}

static inline enum wsrep::client_error wsrep_current_error(THD* thd)
{
  return thd->wsrep_cs().current_error();
}

static inline enum wsrep::provider::status
wsrep_current_error_status(THD* thd)
{
  return thd->wsrep_cs().current_error_status();
}

#endif /* WSREP_TRANS_OBSERVER */
server/private/protocol.h000064400000030312150400263720011534 0ustar00#ifndef PROTOCOL_INCLUDED
#define PROTOCOL_INCLUDED

/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2020, 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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_error.h"
#include "my_decimal.h"                         /* my_decimal */
#include "sql_type.h"

class i_string;
class Field;
class Send_field;
class THD;
class Item_param;
struct TABLE_LIST;
typedef struct st_mysql_field MYSQL_FIELD;
typedef struct st_mysql_rows MYSQL_ROWS;

class Protocol
{
protected:
  String *packet;
  /* Used by net_store_data() for charset conversions */
  String *convert;
  uint field_pos;
#ifndef DBUG_OFF
  const Type_handler **field_handlers;
  bool valid_handler(uint pos, protocol_send_type_t type) const
  {
    return field_handlers == 0 ||
           field_handlers[field_pos]->protocol_send_type() == type;
  }
#endif
  uint field_count;
  virtual bool net_store_data(const uchar *from, size_t length);
  virtual bool net_store_data_cs(const uchar *from, size_t length,
                      CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
  virtual bool net_send_ok(THD *, uint, uint, ulonglong, ulonglong, const char *,
                           bool);
  virtual bool net_send_error_packet(THD *, uint, const char *, const char *);
#ifdef EMBEDDED_LIBRARY
  char **next_field;
  MYSQL_FIELD *next_mysql_field;
  MEM_ROOT *alloc;
#endif
  bool needs_conversion(CHARSET_INFO *fromcs,
                        CHARSET_INFO *tocs) const
  {
    // 'tocs' is set 0 when client issues SET character_set_results=NULL
    return tocs && !my_charset_same(fromcs, tocs) &&
           fromcs != &my_charset_bin &&
           tocs != &my_charset_bin;
  }
  /* 
    The following two are low-level functions that are invoked from
    higher-level store_xxx() funcs.  The data is stored into this->packet.
  */
  bool store_string_aux(const char *from, size_t length,
                        CHARSET_INFO *fromcs, CHARSET_INFO *tocs);

  virtual bool send_ok(uint server_status, uint statement_warn_count,
                       ulonglong affected_rows, ulonglong last_insert_id,
                       const char *message);

  virtual bool send_eof(uint server_status, uint statement_warn_count);

  virtual bool send_error(uint sql_errno, const char *err_msg,
                          const char *sql_state);

  CHARSET_INFO *character_set_results() const;

public:
  THD	 *thd;
  Protocol(THD *thd_arg) { init(thd_arg); }
  virtual ~Protocol() = default;
  void init(THD* thd_arg);

  enum { SEND_NUM_ROWS= 1, SEND_EOF= 2, SEND_FORCE_COLUMN_INFO= 4 };
  virtual bool send_result_set_metadata(List<Item> *list, uint flags);
  bool send_list_fields(List<Field> *list, const TABLE_LIST *table_list);
  bool send_result_set_row(List<Item> *row_items);

  bool store(I_List<i_string> *str_list);
  bool store_string_or_null(const char *from, CHARSET_INFO *cs);
  bool store_warning(const char *from, size_t length);
  String *storage_packet() { return packet; }
  inline void free() { packet->free(); }
  virtual bool write();
  inline  bool store(int from)
  { return store_long((longlong) from); }
  inline  bool store(uint32 from)
  { return store_long((longlong) from); }
  inline  bool store(longlong from)
  { return store_longlong((longlong) from, 0); }
  inline  bool store(ulonglong from)
  { return store_longlong((longlong) from, 1); }
  inline bool store(String *str)
  { return store((char*) str->ptr(), str->length(), str->charset()); }
  inline bool store(const LEX_CSTRING *from, CHARSET_INFO *cs)
  {
    return store(from->str, from->length, cs);
  }

  virtual bool prepare_for_send(uint num_columns)
  {
    field_count= num_columns;
    return 0;
  }
  virtual bool flush();
  virtual void end_partial_result_set(THD *thd);
  virtual void prepare_for_resend()=0;

  virtual bool store_null()=0;
  virtual bool store_tiny(longlong from)=0;
  virtual bool store_short(longlong from)=0;
  virtual bool store_long(longlong from)=0;
  virtual bool store_longlong(longlong from, bool unsigned_flag)=0;
  virtual bool store_decimal(const my_decimal *)=0;
  virtual bool store_str(const char *from, size_t length,
                         CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
  virtual bool store_float(float from, uint32 decimals)=0;
  virtual bool store_double(double from, uint32 decimals)=0;
  virtual bool store_datetime(MYSQL_TIME *time, int decimals)=0;
  virtual bool store_date(MYSQL_TIME *time)=0;
  virtual bool store_time(MYSQL_TIME *time, int decimals)=0;
  virtual bool store(Field *field)=0;

  // Various useful wrappers for the virtual store*() methods.
  // Backward wrapper for store_str()
  bool store(const char *from, size_t length, CHARSET_INFO *cs)
  {
    return store_str(from, length, cs, character_set_results());
  }
  bool store_lex_cstring(const LEX_CSTRING &s,
                         CHARSET_INFO *fromcs,
                         CHARSET_INFO *tocs)
  {
    return store_str(s.str, (uint) s.length, fromcs, tocs);
  }
  bool store_binary_string(const char *str, size_t length)
  {
    return store_str(str, (uint) length, &my_charset_bin, &my_charset_bin);
  }
  bool store_ident(const LEX_CSTRING &s)
  {
    return store_lex_cstring(s, system_charset_info, character_set_results());
  }
  // End of wrappers

  virtual bool send_out_parameters(List<Item_param> *sp_params)=0;
#ifdef EMBEDDED_LIBRARY
  bool begin_dataset();
  bool begin_dataset(THD *thd, uint numfields);
  virtual void remove_last_row() {}
#else
  void remove_last_row() {}
#endif
  enum enum_protocol_type
  {
    /*
      Before adding a new type, please make sure
      there is enough storage for it in Query_cache_query_flags.
    */
    PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1, PROTOCOL_LOCAL= 2,
    PROTOCOL_DISCARD= 3 /* Should be last, not used by Query_cache */
  };
  virtual enum enum_protocol_type type()= 0;

  virtual bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count);
  bool net_send_error(THD *thd, uint sql_errno, const char *err,
                      const char* sqlstate);
  void end_statement();
};


/** Class used for the old (MySQL 4.0 protocol). */

class Protocol_text :public Protocol
{
  StringBuffer<FLOATING_POINT_BUFFER> buffer;
  bool store_numeric_string_aux(const char *from, size_t length);
public:
  Protocol_text(THD *thd_arg, ulong prealloc= 0)
   :Protocol(thd_arg)
  {
    if (prealloc)
      packet->alloc(prealloc);
  }
  void prepare_for_resend() override;
  bool store_null() override;
  bool store_tiny(longlong from) override;
  bool store_short(longlong from) override;
  bool store_long(longlong from) override;
  bool store_longlong(longlong from, bool unsigned_flag) override;
  bool store_decimal(const my_decimal *) override;
  bool store_str(const char *from, size_t length,
                 CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override;
  bool store_datetime(MYSQL_TIME *time, int decimals) override;
  bool store_date(MYSQL_TIME *time) override;
  bool store_time(MYSQL_TIME *time, int decimals) override;
  bool store_float(float nr, uint32 decimals) override;
  bool store_double(double from, uint32 decimals) override;
  bool store(Field *field) override;

  bool send_out_parameters(List<Item_param> *sp_params) override;

  bool store_numeric_zerofill_str(const char *from, size_t length,
                                  protocol_send_type_t send_type);

#ifdef EMBEDDED_LIBRARY
  void remove_last_row() override;
#endif
  bool store_field_metadata(const THD *thd, const Send_field &field,
                            CHARSET_INFO *charset_for_protocol,
                            uint pos);
  bool store_item_metadata(THD *thd, Item *item, uint pos);
  bool store_field_metadata_for_list_fields(const THD *thd, Field *field,
                                            const TABLE_LIST *table_list,
                                            uint pos);
  enum enum_protocol_type type() override { return PROTOCOL_TEXT; };
};


class Protocol_binary final :public Protocol
{
private:
  uint bit_fields;
public:
  Protocol_binary(THD *thd_arg) :Protocol(thd_arg) {}
  bool prepare_for_send(uint num_columns) override;
  void prepare_for_resend() override;
#ifdef EMBEDDED_LIBRARY
  bool write() override;
  bool net_store_data(const uchar *from, size_t length) override;
  bool net_store_data_cs(const uchar *from, size_t length,
                         CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override;
#endif
  bool store_null() override;
  bool store_tiny(longlong from) override;
  bool store_short(longlong from) override;
  bool store_long(longlong from) override;
  bool store_longlong(longlong from, bool unsigned_flag) override;
  bool store_decimal(const my_decimal *) override;
  bool store_str(const char *from, size_t length,
                 CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override;
  bool store_datetime(MYSQL_TIME *time, int decimals) override;
  bool store_date(MYSQL_TIME *time) override;
  bool store_time(MYSQL_TIME *time, int decimals) override;
  bool store_float(float nr, uint32 decimals) override;
  bool store_double(double from, uint32 decimals) override;
  bool store(Field *field) override;

  bool send_out_parameters(List<Item_param> *sp_params) override;

  enum enum_protocol_type type() override { return PROTOCOL_BINARY; };
};


/*
  A helper for "ANALYZE $stmt" which looks a real network procotol but doesn't
  write results to the network.

  At first glance, class select_send looks like a more appropriate place to
  implement the "write nothing" hook. This is not true, because
    - we need to evaluate the value of every item, and do it the way
      select_send does it (i.e. call item->val_int() or val_real() or...)
    - select_send::send_data() has some other code, like telling the storage
      engine that the row can be unlocked. We want to keep that also.
  as a result, "ANALYZE $stmt" uses a select_send_analyze which still uses 
  select_send::send_data() & co., and also uses  Protocol_discard object.
*/

class Protocol_discard final : public Protocol
{
public:
  Protocol_discard(THD *thd_arg) : Protocol(thd_arg) {}
  bool write() override { return 0; }
  bool send_result_set_metadata(List<Item> *, uint) override { return 0; }
  bool send_eof(uint, uint) override { return 0; }
  void prepare_for_resend() override { IF_DBUG(field_pos= 0,); }
  bool send_out_parameters(List<Item_param> *sp_params) override { return false; }
  
  /* 
    Provide dummy overrides for any storage methods so that we
    avoid allocating and copying of data
  */
  bool store_null() override { return false; }
  bool store_tiny(longlong) override { return false; }
  bool store_short(longlong) override { return false; }
  bool store_long(longlong) override { return false; }
  bool store_longlong(longlong, bool) override { return false; }
  bool store_decimal(const my_decimal *) override { return false; }
  bool store_str(const char *, size_t, CHARSET_INFO *, CHARSET_INFO *) override
  {
    return false;
  }
  bool store_datetime(MYSQL_TIME *, int) override { return false; }
  bool store_date(MYSQL_TIME *) override { return false; }
  bool store_time(MYSQL_TIME *, int) override { return false; }
  bool store_float(float, uint32) override { return false; }
  bool store_double(double, uint32) override { return false; }
  bool store(Field *) override { return false; }
  enum enum_protocol_type type() override { return PROTOCOL_DISCARD; };
};


void send_warning(THD *thd, uint sql_errno, const char *err=0);
void net_send_progress_packet(THD *thd);
uchar *net_store_data(uchar *to,const uchar *from, size_t length);
uchar *net_store_data(uchar *to,int32 from);
uchar *net_store_data(uchar *to,longlong from);

#endif /* PROTOCOL_INCLUDED */
server/private/mem_root_array.h000064400000015702150400263720012720 0ustar00/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


#ifndef MEM_ROOT_ARRAY_INCLUDED
#define MEM_ROOT_ARRAY_INCLUDED

#include <my_alloc.h>

/**
   A typesafe replacement for DYNAMIC_ARRAY.
   We use MEM_ROOT for allocating storage, rather than the C++ heap.
   The interface is chosen to be similar to std::vector.

   @remark
   Unlike DYNAMIC_ARRAY, elements are properly copied
   (rather than memcpy()d) if the underlying array needs to be expanded.

   @remark
   Depending on has_trivial_destructor, we destroy objects which are
   removed from the array (including when the array object itself is destroyed).

   @remark
   Note that MEM_ROOT has no facility for reusing free space,
   so don't use this if multiple re-expansions are likely to happen.

   @param Element_type The type of the elements of the container.
          Elements must be copyable.
   @param has_trivial_destructor If true, we don't destroy elements.
          We could have used type traits to determine this.
          __has_trivial_destructor is supported by some (but not all)
          compilers we use.
*/
template<typename Element_type, bool has_trivial_destructor>
class Mem_root_array
{
public:
  /// Convenience typedef, same typedef name as std::vector
  typedef Element_type value_type;

  Mem_root_array(MEM_ROOT *root)
    : m_root(root), m_array(NULL), m_size(0), m_capacity(0)
  {
    DBUG_ASSERT(m_root != NULL);
  }

  Mem_root_array(MEM_ROOT *root, size_t n, const value_type &val= value_type())
    : m_root(root), m_array(NULL), m_size(0), m_capacity(0)
  {
    resize(n, val);
  }

  ~Mem_root_array()
  {
    clear();
  }

  Element_type &at(size_t n)
  {
    DBUG_ASSERT(n < size());
    return m_array[n];
  }

  const Element_type &at(size_t n) const
  {
    DBUG_ASSERT(n < size());
    return m_array[n];
  }

  Element_type &operator[](size_t n) { return at(n); }
  const Element_type &operator[](size_t n) const { return at(n); }

  Element_type &back() { return at(size() - 1); }
  const Element_type &back() const { return at(size() - 1); }

  // Returns a pointer to the first element in the array.
  Element_type *begin() { return &m_array[0]; }
  const Element_type *begin() const { return &m_array[0]; }

  // Returns a pointer to the past-the-end element in the array.
  Element_type *end() { return &m_array[size()]; }
  const Element_type *end() const { return &m_array[size()]; }

  // Erases all of the elements. 
  void clear()
  {
    if (!empty())
      chop(0);
  }

  /*
    Chops the tail off the array, erasing all tail elements.
    @param pos Index of first element to erase.
  */
  void chop(const size_t pos)
  {
    DBUG_ASSERT(pos < m_size);
    if (!has_trivial_destructor)
    {
      for (size_t ix= pos; ix < m_size; ++ix)
      {
        Element_type *p= &m_array[ix];
        p->~Element_type();              // Destroy discarded element.
      }
    }
    m_size= pos;
  }

  /*
    Reserves space for array elements.
    Copies over existing elements, in case we are re-expanding the array.

    @param  n number of elements.
    @retval true if out-of-memory, false otherwise.
  */
  bool reserve(size_t n)
  {
    if (n <= m_capacity)
      return false;

    void *mem= alloc_root(m_root, n * element_size());
    if (!mem)
      return true;
    Element_type *array= static_cast<Element_type*>(mem);

    // Copy all the existing elements into the new array.
    for (size_t ix= 0; ix < m_size; ++ix)
    {
      Element_type *new_p= &array[ix];
      Element_type *old_p= &m_array[ix];
      new (new_p) Element_type(*old_p);         // Copy into new location.
      if (!has_trivial_destructor)
        old_p->~Element_type();                 // Destroy the old element.
    }

    // Forget the old array.
    m_array= array;
    m_capacity= n;
    return false;
  }

  /*
    Adds a new element at the end of the array, after its current last
    element. The content of this new element is initialized to a copy of
    the input argument.

    @param  element Object to copy.
    @retval true if out-of-memory, false otherwise.
  */
  bool push_back(const Element_type &element)
  {
    const size_t min_capacity= 20;
    const size_t expansion_factor= 2;
    if (0 == m_capacity && reserve(min_capacity))
      return true;
    if (m_size == m_capacity && reserve(m_capacity * expansion_factor))
      return true;
    Element_type *p= &m_array[m_size++];
    new (p) Element_type(element);
    return false;
  }

  /**
    Removes the last element in the array, effectively reducing the
    container size by one. This destroys the removed element.
   */
  void pop_back()
  {
    DBUG_ASSERT(!empty());
    if (!has_trivial_destructor)
      back().~Element_type();
    m_size-= 1;
  }

  /**
    Resizes the container so that it contains n elements.

    If n is smaller than the current container size, the content is
    reduced to its first n elements, removing those beyond (and
    destroying them).

    If n is greater than the current container size, the content is
    expanded by inserting at the end as many elements as needed to
    reach a size of n. If val is specified, the new elements are
    initialized as copies of val, otherwise, they are
    value-initialized.

    If n is also greater than the current container capacity, an automatic
    reallocation of the allocated storage space takes place.

    Notice that this function changes the actual content of the
    container by inserting or erasing elements from it.
   */
  void resize(size_t n, const value_type &val= value_type())
  {
    if (n == m_size)
      return;
    if (n > m_size)
    {
      if (!reserve(n))
      {
        while (n != m_size)
          push_back(val);
      }
      return;
    }
    if (!has_trivial_destructor)
    {
      while (n != m_size)
        pop_back();
    }
    m_size= n;
  }

  size_t capacity()     const { return m_capacity; }
  size_t element_size() const { return sizeof(Element_type); }
  bool   empty()        const { return size() == 0; }
  size_t size()         const { return m_size; }
  const MEM_ROOT *mem_root() const { return m_root; }

private:
  MEM_ROOT *const m_root;
  Element_type   *m_array;
  size_t          m_size;
  size_t          m_capacity;

  // Not (yet) implemented.
  Mem_root_array(const Mem_root_array&);
  Mem_root_array &operator=(const Mem_root_array&);
};


#endif  // MEM_ROOT_ARRAY_INCLUDED
server/private/wsrep_client_service.h000064400000005000150400263720014105 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

/** @file wsrep_client_service.h

  This file provides declaratios for client service implementation.
  See wsrep/client_service.hpp for interface documentation.
*/

#ifndef WSREP_CLIENT_SERVICE_H
#define WSREP_CLIENT_SERVICE_H

/* wsrep-lib */
#include "wsrep/client_service.hpp"
#include "wsrep/client_state.hpp"
#include "wsrep/exception.hpp" /* not_implemented_error, remove when finished */

class THD;
class Wsrep_client_state;
class Wsrep_high_priority_context;

class Wsrep_client_service : public wsrep::client_service
{
public:
  Wsrep_client_service(THD*, Wsrep_client_state&);

  bool interrupted(wsrep::unique_lock<wsrep::mutex>&) const override;
  void reset_globals() override;
  void store_globals() override;
  int prepare_data_for_replication() override;
  void cleanup_transaction() override;
  bool statement_allowed_for_streaming() const override;
  size_t bytes_generated() const override;
  int prepare_fragment_for_replication(wsrep::mutable_buffer&, size_t&) override;
  int remove_fragments() override;
  void emergency_shutdown() override
  { throw wsrep::not_implemented_error(); }
  void will_replay() override;
  void signal_replayed() override;
  enum wsrep::provider::status replay() override;
  enum wsrep::provider::status replay_unordered() override;
  void wait_for_replayers(wsrep::unique_lock<wsrep::mutex>&) override;
  enum wsrep::provider::status commit_by_xid() override;
  bool is_explicit_xa() override
  {
    return false;
  }
  bool is_prepared_xa() override
  {
    return false;
  }
  bool is_xa_rollback() override
  {
    return false;
  }
  void debug_sync(const char*) override;
  void debug_crash(const char*) override;
  int bf_rollback() override;
private:
  friend class Wsrep_server_service;
  THD* m_thd;
  Wsrep_client_state& m_client_state;
};


#endif /* WSREP_CLIENT_SERVICE_H */
server/private/sql_tablespace.h000064400000001674150400263730012667 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_TABLESPACE_INCLUDED
#define SQL_TABLESPACE_INCLUDED

class THD;
class st_alter_tablespace;

int mysql_alter_tablespace(THD* thd, st_alter_tablespace *ts_info);

#endif /* SQL_TABLESPACE_INCLUDED */
server/private/gcalc_slicescan.h000064400000041570150400263730013001 0ustar00/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
   Copyright (C) 2011 Monty Program Ab.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */


#ifndef GCALC_SLICESCAN_INCLUDED
#define GCALC_SLICESCAN_INCLUDED

#ifndef DBUG_OFF
// #define GCALC_CHECK_WITH_FLOAT
#else
#define GCALC_DBUG_OFF
#endif /*DBUG_OFF*/

#ifndef GCALC_DBUG_OFF
#define GCALC_DBUG_PRINT(b) DBUG_PRINT("Gcalc", b)
#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc " a)
#define GCALC_DBUG_RETURN(r) DBUG_RETURN(r)
#define GCALC_DBUG_VOID_RETURN DBUG_VOID_RETURN
#define GCALC_DBUG_ASSERT(r) DBUG_ASSERT(r)
#else
#define GCALC_DBUG_PRINT(b)     do {} while(0)
#define GCALC_DBUG_ENTER(a)     do {} while(0)
#define GCALC_DBUG_RETURN(r)    return (r)
#define GCALC_DBUG_VOID_RETURN  do {} while(0)
#define GCALC_DBUG_ASSERT(r)    do {} while(0)
#endif /*GCALC_DBUG_OFF*/

#define GCALC_TERMINATED(state_var) (state_var && (*state_var))
#define GCALC_SET_TERMINATED(state_var, val) state_var= val
#define GCALC_DECL_TERMINATED_STATE(varname) \
  volatile int *varname;

/*
  Gcalc_dyn_list class designed to manage long lists of same-size objects
  with the possible efficiency.
  It allocates fixed-size blocks of memory (blk_size specified at the time
  of creation). When new object is added to the list, it occupies part of
  this block until it's full. Then the new block is allocated.
  Freed objects are chained to the m_free list, and if it's not empty, the
  newly added object is taken from this list instead the block.
*/

class Gcalc_dyn_list
{
public:
  class Item
  {
  public:
    Item *next;
  };

  Gcalc_dyn_list(size_t blk_size, size_t sizeof_item);
  Gcalc_dyn_list(const Gcalc_dyn_list &dl);
  ~Gcalc_dyn_list();
  Item *new_item()
  {
    Item *result;
    if (m_free)
    {
      result= m_free;
      m_free= m_free->next;
    }
    else
      result= alloc_new_blk();

    return result;
  }
  inline void free_item(Item *item)
  {
    item->next= m_free;
    m_free= item;
  }
  inline void free_list(Item **list, Item **hook)
  {
    *hook= m_free;
    m_free= *list;
  }

  void free_list(Item *list)
  {
    Item **hook= &list;
    while (*hook)
      hook= &(*hook)->next;
    free_list(&list, hook);
  }

  void reset();
  void cleanup();

protected:
  size_t m_blk_size;
  size_t m_sizeof_item;
  unsigned int m_points_per_blk;
  void *m_first_blk;
  void **m_blk_hook;
  Item *m_free;
  Item *m_keep;

  Item *alloc_new_blk();
  void format_blk(void* block);
  inline Item *ptr_add(Item *ptr, int n_items)
  {
    return (Item *)(((char*)ptr) + n_items * m_sizeof_item);
  }
};

/* Internal Gcalc coordinates to provide the precise calculations */

#define GCALC_DIG_BASE     1000000000
typedef uint32 gcalc_digit_t;
typedef unsigned long long gcalc_coord2;
typedef gcalc_digit_t Gcalc_internal_coord;
#define GCALC_COORD_BASE 2
#define GCALC_COORD_BASE2 4
#define GCALC_COORD_BASE3 6
#define GCALC_COORD_BASE4 8
#define GCALC_COORD_BASE5 10

typedef gcalc_digit_t Gcalc_coord1[GCALC_COORD_BASE];
typedef gcalc_digit_t Gcalc_coord2[GCALC_COORD_BASE*2];
typedef gcalc_digit_t Gcalc_coord3[GCALC_COORD_BASE*3];


void gcalc_mul_coord(Gcalc_internal_coord *result, int result_len,
                     const Gcalc_internal_coord *a, int a_len,
                     const Gcalc_internal_coord *b, int b_len);

void gcalc_add_coord(Gcalc_internal_coord *result, int result_len,
                     const Gcalc_internal_coord *a,
                     const Gcalc_internal_coord *b);

void gcalc_sub_coord(Gcalc_internal_coord *result, int result_len,
                     const Gcalc_internal_coord *a,
                     const Gcalc_internal_coord *b);

int gcalc_cmp_coord(const Gcalc_internal_coord *a,
                    const Gcalc_internal_coord *b, int len);

/* Internal coordinates declarations end. */


typedef uint gcalc_shape_info;

/*
  Gcalc_heap represents the 'dynamic list' of Info objects, that
  contain information about vertexes of all the shapes that take
  part in some spatial calculation. Can become quite long.
  After filled, the list is usually sorted and then walked through
  in the slicescan algorithm.
  The Gcalc_heap and the algorithm can only operate with two
  kinds of shapes - polygon and polyline. So all the spatial
  objects should be represented as sets of these two.
*/

class Gcalc_heap : public Gcalc_dyn_list
{
public:
  enum node_type
  {
    nt_shape_node,
    nt_intersection,
    nt_eq_node
  };
  class Info : public Gcalc_dyn_list::Item
  {
  public:
    node_type type;
    union
    {
      struct
      {
        /* nt_shape_node */
        gcalc_shape_info shape;
        Info *left;
        Info *right;
        double x,y;
        Gcalc_coord1 ix, iy;
        int top_node;
      } shape;
      struct
      {
        /* nt_intersection */
        /* Line p1-p2 supposed to intersect line p3-p4 */
        const Info *p1;
        const Info *p2;
        const Info *p3;
        const Info *p4;
        void *data;
        int equal;
      } intersection;
      struct
      {
        /* nt_eq_node */
        const Info *node;
        void *data;
      } eq;
    } node;

    bool is_bottom() const
      { GCALC_DBUG_ASSERT(type == nt_shape_node); return !node.shape.left; }
    bool is_top() const
      { GCALC_DBUG_ASSERT(type == nt_shape_node); return node.shape.top_node; }
    bool is_single_node() const
      { return is_bottom() && is_top(); }

    void calc_xy(double *x, double *y) const;
    int equal_pi(const Info *pi) const;
#ifdef GCALC_CHECK_WITH_FLOAT
    void calc_xy_ld(long double *x, long double *y) const;
#endif /*GCALC_CHECK_WITH_FLOAT*/

    Info *get_next() { return (Info *)next; }
    const Info *get_next() const { return (const Info *)next; }
  };

  Gcalc_heap(size_t blk_size=8192) :
    Gcalc_dyn_list(blk_size, sizeof(Info)),
    m_hook(&m_first), m_n_points(0)
  {}

  Gcalc_heap(const Gcalc_heap &gh) :
    Gcalc_dyn_list(gh),
    m_hook(&m_first), m_n_points(0)
  {}

  void set_extent(double xmin, double xmax, double ymin, double ymax);
  Info *new_point_info(double x, double y, gcalc_shape_info shape);
  void free_point_info(Info *i, Gcalc_dyn_list::Item **i_hook);
  Info *new_intersection(const Info *p1, const Info *p2,
                         const Info *p3, const Info *p4);
  void prepare_operation();
  inline bool ready() const { return m_hook == NULL; }
  Info *get_first() { return (Info *)m_first; }
  const Info *get_first() const { return (const Info *)m_first; }
  Gcalc_dyn_list::Item **get_last_hook() { return m_hook; }
  void reset();
#ifdef GCALC_CHECK_WITH_FLOAT
  long double get_double(const Gcalc_internal_coord *c) const;
#endif /*GCALC_CHECK_WITH_FLOAT*/
  double coord_extent;
  Gcalc_dyn_list::Item **get_cur_hook() { return m_hook; }

private:
  Gcalc_dyn_list::Item *m_first;
  Gcalc_dyn_list::Item **m_hook;
  int m_n_points;
};


/*
  the spatial object has to be represented as a set of
  simple polygones and polylines to be sent to the slicescan.

  Gcalc_shape_transporter class and his descendants are used to
  simplify storing the information about the shape into necessary structures.
  This base class only fills the Gcalc_heap with the information about
  shapes and vertices.

  Normally the Gcalc_shape_transporter family object is sent as a parameter
  to the 'get_shapes' method of an 'spatial' object so it can pass
  the spatial information about itself. The virtual methods are
  treating this data in a way the caller needs.
*/

class Gcalc_shape_transporter
{
private:
  Gcalc_heap::Info *m_first;
  Gcalc_heap::Info *m_prev;
  Gcalc_dyn_list::Item **m_prev_hook;
  int m_shape_started;
  void int_complete();
protected:
  Gcalc_heap *m_heap;
  int int_single_point(gcalc_shape_info Info, double x, double y);
  int int_add_point(gcalc_shape_info Info, double x, double y);
  void int_start_line()
  {
    DBUG_ASSERT(!m_shape_started);
    m_shape_started= 1;
    m_first= m_prev= NULL;
  }
  void int_complete_line()
  {
    DBUG_ASSERT(m_shape_started== 1);
    int_complete();
    m_shape_started= 0;
  }
  void int_start_ring()
  {
    DBUG_ASSERT(m_shape_started== 2);
    m_shape_started= 3;
    m_first= m_prev= NULL;
  }
  void int_complete_ring()
  {
    DBUG_ASSERT(m_shape_started== 3);
    int_complete();
    m_shape_started= 2;
  }
  void int_start_poly()
  {
    DBUG_ASSERT(!m_shape_started);
    m_shape_started= 2;
  }
  void int_complete_poly()
  {
    DBUG_ASSERT(m_shape_started== 2);
    m_shape_started= 0;
  }
  bool line_started() { return m_shape_started == 1; };
public:
  Gcalc_shape_transporter(Gcalc_heap *heap) :
    m_shape_started(0), m_heap(heap) {}

  virtual int single_point(double x, double y)=0;
  virtual int start_line()=0;
  virtual int complete_line()=0;
  virtual int start_poly()=0;
  virtual int complete_poly()=0;
  virtual int start_ring()=0;
  virtual int complete_ring()=0;
  virtual int add_point(double x, double y)=0;
  virtual int start_collection(int n_objects) { return 0; }
  virtual int empty_shape() { return 0; }
  int start_simple_poly()
  {
    return start_poly() || start_ring();
  }
  int complete_simple_poly()
  {
    return complete_ring() || complete_poly();
  }
  virtual ~Gcalc_shape_transporter() = default;
};


enum Gcalc_scan_events
{
  scev_none= 0,
  scev_point= 1,         /* Just a new point in thread */
  scev_thread= 2,        /* Start of the new thread */
  scev_two_threads= 4,   /* A couple of new threads started */
  scev_intersection= 8,  /* Intersection happened */
  scev_end= 16,          /* Single thread finished */
  scev_two_ends= 32,     /* A couple of threads finished */
  scev_single_point= 64  /* Got single point */
};


/* 
   Gcalc_scan_iterator incapsulates the slicescan algorithm.
   It takes filled Gcalc_heap as a datasource. Then can be
   iterated through the vertexes and intersection points with
   the step() method. After the 'step()' one usually observes
   the current 'slice' to do the necessary calculations, like
   looking for intersections, calculating the area, whatever.
*/

class Gcalc_scan_iterator : public Gcalc_dyn_list
{
public:
  class point : public Gcalc_dyn_list::Item
  {
  public:
    Gcalc_coord1 dx;
    Gcalc_coord1 dy;
    Gcalc_heap::Info *pi;
    Gcalc_heap::Info *next_pi;
    Gcalc_heap::Info *ev_pi;
    const Gcalc_coord1 *l_border;
    const Gcalc_coord1 *r_border;
    point *ev_next;

    Gcalc_scan_events event;

    inline const point *c_get_next() const
      { return (const point *)next; }
    inline bool is_bottom() const { return !next_pi; }
    gcalc_shape_info get_shape() const { return pi->node.shape.shape; }
    inline point *get_next() { return (point *)next; }
    inline const point *get_next() const { return (const point *)next; }
    /* Compare the dx_dy parameters regarding the horiz_dir */
    /* returns -1 if less, 0 if equal, 1 if bigger          */
    static int cmp_dx_dy(const Gcalc_coord1 dx_a,
                         const Gcalc_coord1 dy_a,
                         const Gcalc_coord1 dx_b,
                         const Gcalc_coord1 dy_b);
    static int cmp_dx_dy(const Gcalc_heap::Info *p1,
                         const Gcalc_heap::Info *p2,
                         const Gcalc_heap::Info *p3,
                         const Gcalc_heap::Info *p4);
    int cmp_dx_dy(const point *p) const;
    point **next_ptr() { return (point **) &next; }
#ifndef GCALC_DBUG_OFF
    unsigned int thread;
#endif /*GCALC_DBUG_OFF*/
#ifdef GCALC_CHECK_WITH_FLOAT
    void calc_x(long double *x, long double y, long double ix) const;
#endif /*GCALC_CHECK_WITH_FLOAT*/
  };

  /* That class introduced mostly for the 'typecontrol' reason.      */
  /* only difference from the point classis the get_next() function. */
  class event_point : public point
  {
  public:
    inline const event_point *get_next() const
    { return (const event_point*) ev_next; }
    int simple_event() const
    {
      return !ev_next ? (event & (scev_point | scev_end)) : 
        (!ev_next->ev_next && event == scev_two_ends);
    }
  };

  class intersection_info : public Gcalc_dyn_list::Item
  {
  public:
    point *edge_a;
    point *edge_b;

    Gcalc_coord2 t_a;
    Gcalc_coord2 t_b;
    int t_calculated;
    Gcalc_coord3 x_exp;
    int x_calculated;
    Gcalc_coord3 y_exp;
    int y_calculated;
    void calc_t()
    {if (!t_calculated) do_calc_t(); }
    void calc_y_exp()
    { if (!y_calculated) do_calc_y(); }
    void calc_x_exp()
    { if (!x_calculated) do_calc_x(); }

    void do_calc_t();
    void do_calc_x();
    void do_calc_y();
  };


  class slice_state
  {
  public:
    point *slice;
    point **event_position_hook;
    point *event_end;
    const Gcalc_heap::Info *pi;
  };

public:
  Gcalc_scan_iterator(size_t blk_size= 8192);

  GCALC_DECL_TERMINATED_STATE(killed)

  void init(Gcalc_heap *points); /* Iterator can be reused */
  void reset();
  int step();

  Gcalc_heap::Info *more_points() { return m_cur_pi; }
  bool more_trapezoids()
    { return m_cur_pi && m_cur_pi->next; }

  const point *get_bottom_points() const
    { return m_bottom_points; }
  const point *get_event_position() const
    { return *state.event_position_hook; }
  const point *get_event_end() const
    { return state.event_end; }
  const event_point *get_events() const
    { return (const event_point *)
        (*state.event_position_hook == state.event_end ?
            m_bottom_points : *state.event_position_hook); }
  const point *get_b_slice() const { return state.slice; }
  double get_h() const;
  double get_y() const;
  double get_event_x() const;
  double get_sp_x(const point *sp) const;
  int intersection_step() const
    { return state.pi->type == Gcalc_heap::nt_intersection; }
  const Gcalc_heap::Info *get_cur_pi() const
  {
    return state.pi;
  }

private:
  Gcalc_heap *m_heap;
  Gcalc_heap::Info *m_cur_pi;
  slice_state state;

#ifndef GCALC_DBUG_OFF
  unsigned int m_cur_thread;
#endif /*GCALC_DBUG_OFF*/

  point *m_bottom_points;
  point **m_bottom_hook;

  int node_scan();
  void eq_scan();
  void intersection_scan();
  void remove_bottom_node();
  int insert_top_node();
  int add_intersection(point *sp_a, point *sp_b,
                       Gcalc_heap::Info *pi_from);
  int add_eq_node(Gcalc_heap::Info *node, point *sp);
  int add_events_for_node(point *sp_node);

  point *new_slice_point()
  {
    point *new_point= (point *)new_item();
    return new_point;
  }
  intersection_info *new_intersection_info(point *a, point *b)
  {
    intersection_info *ii= (intersection_info *)new_item();
    ii->edge_a= a;
    ii->edge_b= b;
    ii->t_calculated= ii->x_calculated= ii->y_calculated= 0;
    return ii;
  }
  int arrange_event(int do_sorting, int n_intersections);
  static double get_pure_double(const Gcalc_internal_coord *d, int d_len);
};


/* 
   Gcalc_trapezoid_iterator simplifies the calculations on
   the current slice of the Gcalc_scan_iterator.
   One can walk through the trapezoids formed between
   previous and current slices.
*/

#ifdef TMP_BLOCK
class Gcalc_trapezoid_iterator
{
protected:
  const Gcalc_scan_iterator::point *sp0;
  const Gcalc_scan_iterator::point *sp1;
public:
  Gcalc_trapezoid_iterator(const Gcalc_scan_iterator *scan_i) :
    sp0(scan_i->get_b_slice()),
    sp1(scan_i->get_t_slice())
    {}

  inline bool more() const { return sp1 && sp1->next; }

  const Gcalc_scan_iterator::point *lt() const { return sp1; }
  const Gcalc_scan_iterator::point *lb() const { return sp0; }
  const Gcalc_scan_iterator::point *rb() const
  {
    const Gcalc_scan_iterator::point *result= sp0;
    while ((result= result->c_get_next())->is_bottom())
    {}
    return result;
  }
  const Gcalc_scan_iterator::point *rt() const
    { return sp1->c_get_next(); }

  void operator++()
  {
    sp0= rb();
    sp1= rt();
  }
};
#endif /*TMP_BLOCK*/


/* 
   Gcalc_point_iterator simplifies the calculations on
   the current slice of the Gcalc_scan_iterator.
   One can walk through the points on the current slice.
*/

class Gcalc_point_iterator
{
protected:
  const Gcalc_scan_iterator::point *sp;
public:
  Gcalc_point_iterator(const Gcalc_scan_iterator *scan_i):
    sp(scan_i->get_b_slice())
    {}

  inline bool more() const { return sp != NULL; }
  inline void operator++() { sp= sp->c_get_next(); }
  inline const Gcalc_scan_iterator::point *point() const { return sp; }
  inline const Gcalc_heap::Info *get_pi() const { return sp->pi; }
  inline gcalc_shape_info get_shape() const { return sp->get_shape(); }
  inline void restart(const Gcalc_scan_iterator *scan_i)
  { sp= scan_i->get_b_slice(); }
};

#endif /*GCALC_SLICESCAN_INCLUDED*/

server/private/myisampack.h000064400000035121150400263730012035 0ustar00#ifndef MYISAMPACK_INCLUDED
#define MYISAMPACK_INCLUDED

/* Copyright (c) 2000-2002, 2004 MySQL AB, 2009 Sun Microsystems, Inc.
   Copyright (c) 2020, MariaDB Corporation.
   Use is subject to license terms.

   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 */

/*
  Storing of values in high byte first order.

  integer keys and file pointers are stored with high byte first to get
  better compression
*/

/* these two are for uniformity */
#define mi_sint1korr(A) ((int8)(*A))
#define mi_uint1korr(A) ((uint8)(*A))

#define mi_sint2korr(A) ((int16) (((int16) (((const uchar*) (A))[1])) |\
                                  ((int16) ((uint16) ((const uchar*) (A))[0]) << 8)))
#define mi_sint3korr(A) ((int32) (((((const uchar*) (A))[0]) & 128) ? \
                                  (((uint32) 255L << 24) | \
                                   (((uint32) ((const uchar*) (A))[0]) << 16) |\
                                   (((uint32) ((const uchar*) (A))[1]) << 8) | \
                                   ((uint32) ((const uchar*) (A))[2])) : \
                                  (((uint32) ((const uchar*) (A))[0]) << 16) |\
                                  (((uint32) ((const uchar*) (A))[1]) << 8) | \
                                  ((uint32) ((const uchar*) (A))[2])))
#define mi_sint4korr(A) ((int32) (((uint32) (((const uchar*) (A))[3])) |\
                                  ((uint32) (((const uchar*) (A))[2]) << 8) |\
                                  ((uint32) (((const uchar*) (A))[1]) << 16) |\
                                  ((uint32) (((const uchar*) (A))[0]) << 24)))
#define mi_sint8korr(A) ((longlong) mi_uint8korr(A))
#define mi_uint2korr(A) ((uint16) (((uint16) (((const uchar*) (A))[1])) |\
                                   ((uint16) (((const uchar*) (A))[0]) << 8)))
#define mi_uint3korr(A) ((uint32) (((uint32) (((const uchar*) (A))[2])) |\
                                   (((uint32) (((const uchar*) (A))[1])) << 8) |\
                                   (((uint32) (((const uchar*) (A))[0])) << 16)))
#define mi_uint4korr(A) ((uint32) (((uint32) (((const uchar*) (A))[3])) |\
                                   (((uint32) (((const uchar*) (A))[2])) << 8) |\
                                   (((uint32) (((const uchar*) (A))[1])) << 16) |\
                                   (((uint32) (((const uchar*) (A))[0])) << 24)))

#ifndef HAVE_mi_uint5korr
#define mi_uint5korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[4])) |\
                                    (((uint32) (((const uchar*) (A))[3])) << 8) |\
                                    (((uint32) (((const uchar*) (A))[2])) << 16) |\
                                    (((uint32) (((const uchar*) (A))[1])) << 24)) |\
                                    (((ulonglong) (((const uchar*) (A))[0])) << 32))
#endif /* HAVE_mi_uint5korr */

#ifndef HAVE_mi_uint6korr
#define mi_uint6korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[5])) |\
                                    (((uint32) (((const uchar*) (A))[4])) << 8) |\
                                    (((uint32) (((const uchar*) (A))[3])) << 16) |\
                                    (((uint32) (((const uchar*) (A))[2])) << 24)) |\
                        (((ulonglong) (((uint32) (((const uchar*) (A))[1])) |\
                                    (((uint32) (((const uchar*) (A))[0]) << 8)))) <<\
                                     32))
#endif /* HAVE_mi_uint6korr */

#ifndef HAVE_mi_uint7korr
#define mi_uint7korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[6])) |\
                                    (((uint32) (((const uchar*) (A))[5])) << 8) |\
                                    (((uint32) (((const uchar*) (A))[4])) << 16) |\
                                    (((uint32) (((const uchar*) (A))[3])) << 24)) |\
                        (((ulonglong) (((uint32) (((const uchar*) (A))[2])) |\
                                    (((uint32) (((const uchar*) (A))[1])) << 8) |\
                                    (((uint32) (((const uchar*) (A))[0])) << 16))) <<\
                                     32))
#endif /* HAVE_mi_uint7korr */

#ifndef HAVE_mi_uint8korr
#define mi_uint8korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[7])) |\
                                    (((uint32) (((const uchar*) (A))[6])) << 8) |\
                                    (((uint32) (((const uchar*) (A))[5])) << 16) |\
                                    (((uint32) (((const uchar*) (A))[4])) << 24)) |\
                        (((ulonglong) (((uint32) (((const uchar*) (A))[3])) |\
                                    (((uint32) (((const uchar*) (A))[2])) << 8) |\
                                    (((uint32) (((const uchar*) (A))[1])) << 16) |\
                                    (((uint32) (((const uchar*) (A))[0])) << 24))) <<\
                                    32))
#endif /* HAVE_mi_uint8korr */

/* This one is for uniformity */
#define mi_int1store(T,A) *((uchar*)(T))= (uchar) (A)

#define mi_int2store(T,A)   { uint def_temp= (uint) (A) ;\
                              ((uchar*) (T))[1]= (uchar) (def_temp);\
                              ((uchar*) (T))[0]= (uchar) (def_temp >> 8); }
#define mi_int3store(T,A)   { /*lint -save -e734 */\
                              ulong def_temp= (ulong) (A);\
                              ((uchar*) (T))[2]= (uchar) (def_temp);\
                              ((uchar*) (T))[1]= (uchar) (def_temp >> 8);\
                              ((uchar*) (T))[0]= (uchar) (def_temp >> 16);\
                              /*lint -restore */}
#define mi_int4store(T,A)   { ulong def_temp= (ulong) (A);\
                              ((uchar*) (T))[3]= (uchar) (def_temp);\
                              ((uchar*) (T))[2]= (uchar) (def_temp >> 8);\
                              ((uchar*) (T))[1]= (uchar) (def_temp >> 16);\
                              ((uchar*) (T))[0]= (uchar) (def_temp >> 24); }
#define mi_int5store(T,A)   { ulong def_temp= (ulong) (A),\
                              def_temp2= (ulong) ((A) >> 32);\
                              ((uchar*) (T))[4]= (uchar) (def_temp);\
                              ((uchar*) (T))[3]= (uchar) (def_temp >> 8);\
                              ((uchar*) (T))[2]= (uchar) (def_temp >> 16);\
                              ((uchar*) (T))[1]= (uchar) (def_temp >> 24);\
                              ((uchar*) (T))[0]= (uchar) (def_temp2); }
#define mi_int6store(T,A)   { ulong def_temp= (ulong) (A),\
                              def_temp2= (ulong) ((A) >> 32);\
                              ((uchar*) (T))[5]= (uchar) (def_temp);\
                              ((uchar*) (T))[4]= (uchar) (def_temp >> 8);\
                              ((uchar*) (T))[3]= (uchar) (def_temp >> 16);\
                              ((uchar*) (T))[2]= (uchar) (def_temp >> 24);\
                              ((uchar*) (T))[1]= (uchar) (def_temp2);\
                              ((uchar*) (T))[0]= (uchar) (def_temp2 >> 8); }
#define mi_int7store(T,A)   { ulong def_temp= (ulong) (A),\
                              def_temp2= (ulong) ((A) >> 32);\
                              ((uchar*) (T))[6]= (uchar) (def_temp);\
                              ((uchar*) (T))[5]= (uchar) (def_temp >> 8);\
                              ((uchar*) (T))[4]= (uchar) (def_temp >> 16);\
                              ((uchar*) (T))[3]= (uchar) (def_temp >> 24);\
                              ((uchar*) (T))[2]= (uchar) (def_temp2);\
                              ((uchar*) (T))[1]= (uchar) (def_temp2 >> 8);\
                              ((uchar*) (T))[0]= (uchar) (def_temp2 >> 16); }
#define mi_int8store(T,A)   { ulong def_temp3= (ulong) (A),\
                              def_temp4= (ulong) ((A) >> 32);\
                              mi_int4store((uchar*) (T) + 0, def_temp4);\
                              mi_int4store((uchar*) (T) + 4, def_temp3); }

#ifdef WORDS_BIGENDIAN

#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[0];\
                              ((uchar*) (T))[1]= ((uchar*) &A)[1];\
                              ((uchar*) (T))[2]= ((uchar*) &A)[2];\
                              ((uchar*) (T))[3]= ((uchar*) &A)[3]; }

#define mi_float4get(V,M)   { float def_temp;\
                              ((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\
                              ((uchar*) &def_temp)[1]= ((const uchar*) (M))[1]; \
                              ((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\
                              ((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\
                              (V)= def_temp; }

#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[0];\
                              ((uchar*) (T))[1]= ((const uchar*) &V)[1];\
                              ((uchar*) (T))[2]= ((const uchar*) &V)[2];\
                              ((uchar*) (T))[3]= ((const uchar*) &V)[3];\
                              ((uchar*) (T))[4]= ((const uchar*) &V)[4];\
                              ((uchar*) (T))[5]= ((const uchar*) &V)[5];\
                              ((uchar*) (T))[6]= ((const uchar*) &V)[6];\
                              ((uchar*) (T))[7]= ((const uchar*) &V)[7]; }

#define mi_float8get(V,M)   { double def_temp;\
                              ((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\
                              ((uchar*) &def_temp)[1]= ((const uchar*) (M))[1];\
                              ((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\
                              ((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\
                              ((uchar*) &def_temp)[4]= ((const uchar*) (M))[4];\
                              ((uchar*) &def_temp)[5]= ((const uchar*) (M))[5];\
                              ((uchar*) &def_temp)[6]= ((const uchar*) (M))[6];\
                              ((uchar*) &def_temp)[7]= ((const uchar*) (M))[7]; \
                              (V)= def_temp; }
#else

#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((const uchar*) &A)[3];\
                              ((uchar*) (T))[1]= ((const uchar*) &A)[2];\
                              ((uchar*) (T))[2]= ((const uchar*) &A)[1];\
                              ((uchar*) (T))[3]= ((const uchar*) &A)[0]; }

#define mi_float4get(V,M)   { float def_temp;\
                              ((uchar*) &def_temp)[0]= ((const uchar*) (M))[3];\
                              ((uchar*) &def_temp)[1]= ((const uchar*) (M))[2];\
                              ((uchar*) &def_temp)[2]= ((const uchar*) (M))[1];\
                              ((uchar*) &def_temp)[3]= ((const uchar*) (M))[0];\
                              (V)= def_temp; }

#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[3];\
                              ((uchar*) (T))[1]= ((const uchar*) &V)[2];\
                              ((uchar*) (T))[2]= ((const uchar*) &V)[1];\
                              ((uchar*) (T))[3]= ((const uchar*) &V)[0];\
                              ((uchar*) (T))[4]= ((const uchar*) &V)[7];\
                              ((uchar*) (T))[5]= ((const uchar*) &V)[6];\
                              ((uchar*) (T))[6]= ((const uchar*) &V)[5];\
                              ((uchar*) (T))[7]= ((const uchar*) &V)[4];}

#define mi_float8get(V,M)   { double def_temp;\
                              ((uchar*) &def_temp)[0]= ((const uchar*) (M))[3];\
                              ((uchar*) &def_temp)[1]= ((const uchar*) (M))[2];\
                              ((uchar*) &def_temp)[2]= ((const uchar*) (M))[1];\
                              ((uchar*) &def_temp)[3]= ((const uchar*) (M))[0];\
                              ((uchar*) &def_temp)[4]= ((const uchar*) (M))[7];\
                              ((uchar*) &def_temp)[5]= ((const uchar*) (M))[6];\
                              ((uchar*) &def_temp)[6]= ((const uchar*) (M))[5];\
                              ((uchar*) &def_temp)[7]= ((const uchar*) (M))[4];\
                              (V)= def_temp; }

#else
#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[7];\
                              ((uchar*) (T))[1]= ((const uchar*) &V)[6];\
                              ((uchar*) (T))[2]= ((const uchar*) &V)[5];\
                              ((uchar*) (T))[3]= ((const uchar*) &V)[4];\
                              ((uchar*) (T))[4]= ((const uchar*) &V)[3];\
                              ((uchar*) (T))[5]= ((const uchar*) &V)[2];\
                              ((uchar*) (T))[6]= ((const uchar*) &V)[1];\
                              ((uchar*) (T))[7]= ((const uchar*) &V)[0];}

#define mi_float8get(V,M)   { double def_temp;\
                              ((uchar*) &def_temp)[0]= ((const uchar*) (M))[7];\
                              ((uchar*) &def_temp)[1]= ((const uchar*) (M))[6];\
                              ((uchar*) &def_temp)[2]= ((const uchar*) (M))[5];\
                              ((uchar*) &def_temp)[3]= ((const uchar*) (M))[4];\
                              ((uchar*) &def_temp)[4]= ((const uchar*) (M))[3];\
                              ((uchar*) &def_temp)[5]= ((const uchar*) (M))[2];\
                              ((uchar*) &def_temp)[6]= ((const uchar*) (M))[1];\
                              ((uchar*) &def_temp)[7]= ((const uchar*) (M))[0];\
                              (V)= def_temp; }
#endif /* __FLOAT_WORD_ORDER */
#endif /* WORDS_BIGENDIAN */

/* Fix to avoid warnings when sizeof(ha_rows) == sizeof(long) */

#ifdef BIG_TABLES
#define mi_rowstore(T,A)    mi_int8store(T, A)
#define mi_rowkorr(T)       mi_uint8korr(T)
#else
#define mi_rowstore(T,A)    { mi_int4store(T, 0);\
                              mi_int4store(((uchar*) (T) + 4), A); }
#define mi_rowkorr(T)       mi_uint4korr((const uchar*) (T) + 4)
#endif

#if SIZEOF_OFF_T > 4
#define mi_sizestore(T,A)   mi_int8store(T, A)
#define mi_sizekorr(T)      mi_uint8korr(T)
#else
#define mi_sizestore(T,A)   { if ((A) == HA_OFFSET_ERROR)\
                                bfill((char*) (T), 8, 255);\
                              else { mi_int4store((T), 0);\
                                     mi_int4store(((T) + 4), A); }}
#define mi_sizekorr(T)      mi_uint4korr((const uchar*) (T) + 4)
#endif
#endif /* MYISAMPACK_INCLUDED */
server/private/compat56.h000064400000004350150400263730011335 0ustar00#ifndef COMPAT56_H_INCLUDED
#define COMPAT56_H_INCLUDED
/*
   Copyright (c) 2004, 2012, Oracle and/or its affiliates.
   Copyright (c) 2013  MariaDB Foundation.

 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 */


/** MySQL56 routines and macros **/

/*
  Buffer size for a native TIMESTAMP representation, for use with NativBuffer.
  4 bytes for seconds
  3 bytes for microseconds
  1 byte for the trailing '\0' (class Native reserves extra 1 byte for '\0')
*/
#define STRING_BUFFER_TIMESTAMP_BINARY_SIZE    8 /* 4 + 3 + 1 */

#define MY_PACKED_TIME_GET_INT_PART(x)     ((x) >> 24)
#define MY_PACKED_TIME_GET_FRAC_PART(x)    ((x) % (1LL << 24))
#define MY_PACKED_TIME_MAKE(i, f)          ((((ulonglong) (i)) << 24) + (f))
#define MY_PACKED_TIME_MAKE_INT(i)         ((((ulonglong) (i)) << 24))

longlong TIME_to_longlong_datetime_packed(const MYSQL_TIME *);
longlong TIME_to_longlong_time_packed(const MYSQL_TIME *);

void TIME_from_longlong_datetime_packed(MYSQL_TIME *ltime, longlong nr);
void TIME_from_longlong_time_packed(MYSQL_TIME *ltime, longlong nr);

void my_datetime_packed_to_binary(longlong nr, uchar *ptr, uint dec);
longlong my_datetime_packed_from_binary(const uchar *ptr, uint dec);
uint my_datetime_binary_length(uint dec);

void my_time_packed_to_binary(longlong nr, uchar *ptr, uint dec);
longlong my_time_packed_from_binary(const uchar *ptr, uint dec);
uint my_time_binary_length(uint dec);

void my_timestamp_to_binary(const struct timeval *tm, uchar *ptr, uint dec);
void my_timestamp_from_binary(struct timeval *tm, const uchar *ptr, uint dec);
uint my_timestamp_binary_length(uint dec);
/** End of MySQL routines and macros **/

#endif /* COMPAT56_H_INCLUDED */
server/private/sql_digest_stream.h000064400000003037150400263730013411 0ustar00/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef SQL_DIGEST_STREAM_H
#define SQL_DIGEST_STREAM_H

#include "sql_digest.h"

/**
  State data storage for @c digest_start, @c digest_add_token.
  This structure extends the @c sql_digest_storage structure
  with temporary state used only during parsing.
*/
struct sql_digest_state
{
  /**
    Index, in the digest token array, of the last identifier seen.
    Reduce rules used in the digest computation can not
    apply to tokens seen before an identifier.
    @sa digest_add_token
  */
  int m_last_id_index;
  sql_digest_storage m_digest_storage;

  inline void reset(unsigned char *token_array, uint length)
  {
    m_last_id_index= 0;
    m_digest_storage.reset(token_array, length);
  }

  inline bool is_empty()
  {
    return m_digest_storage.is_empty();
  }
};
typedef struct sql_digest_state sql_digest_state;

#endif

server/private/my_compare.h000064400000025672150400263730012044 0ustar00/* Copyright (c) 2011, Oracle and/or its affiliates.
   Copyright (c) 1991, 2021, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef _my_compare_h
#define _my_compare_h

#include "myisampack.h"
#ifdef	__cplusplus
extern "C" {
#endif

#include "m_ctype.h"                            /* CHARSET_INFO */

/*
  There is a hard limit for the maximum number of keys as there are only
  8 bits in the index file header for the number of keys in a table.
  This means that 0..255 keys can exist for a table. The idea of
  HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on
  a MyISAM table for which one has more keys than MyISAM is normally
  compiled for. If you don't have this, you will get a core dump when
  running myisamchk compiled for 128 keys on a table with 255 keys.
*/

#define HA_MAX_POSSIBLE_KEY         255         /* For myisamchk */
/*
  The following defines can be increased if necessary.
  But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
*/

#define HA_MAX_KEY_LENGTH           1000        /* Max length in bytes */
#define HA_MAX_KEY_SEG              32          /* Max segments for key */

#define HA_MAX_POSSIBLE_KEY_BUFF    (HA_MAX_KEY_LENGTH + 24+ 6+6)
#define HA_MAX_KEY_BUFF  (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8)

typedef struct st_HA_KEYSEG		/* Key-portion */
{
  CHARSET_INFO *charset;
  uint32 start;				/* Start of key in record */
  uint32 null_pos;			/* position to NULL indicator */
  uint16 bit_pos;                       /* Position to bit part */
  uint16 flag;
  uint16 length;			/* Keylength */
  uint16 language;
  uint8  type;				/* Type of key (for sort) */
  uint8  null_bit;			/* bitmask to test for NULL */
  uint8  bit_start;
  uint8  bit_length;                    /* Length of bit part */
} HA_KEYSEG;

#define get_key_length(length,key) \
{ if (*(const uchar*) (key) != 255) \
    length= (uint) *(const uchar*) ((key)++); \
  else \
  { length= mi_uint2korr((key)+1); (key)+=3; } \
}

#define get_key_length_rdonly(length,key) \
{ if (*(const uchar*) (key) != 255) \
    length= ((uint) *(const uchar*) ((key))); \
  else \
  { length= mi_uint2korr((key)+1); } \
}

#define get_key_pack_length(length,length_pack,key) \
{ if (*(const uchar*) (key) != 255) \
  { length= (uint) *(const uchar*) ((key)++); length_pack= 1; }\
  else \
  { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
}

#define store_key_length_inc(key,length) \
{ if ((length) < 255) \
  { *(key)++= (uchar)(length); } \
  else \
  { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
}

#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3)

static inline uchar get_rec_bits(const uchar *ptr, uchar ofs, uint len)
{
  uint16 val= ptr[0];
  if (ofs + len > 8)
    val|= (uint16)(((uint) ptr[1]) << 8);
  return (uchar) ((val >> ofs) & ((1 << len) - 1));
}

static inline void set_rec_bits(uint16 bits, uchar *ptr, uchar ofs, uint len)
{
  ptr[0]= (uchar) ((ptr[0] & ~(((1 << len) - 1) << ofs)) | (bits << ofs));
  if (ofs + len > 8)
    ptr[1]= (uchar) ((ptr[1] & ~((1 << (len - 8 + ofs)) - 1)) |
                     bits >> (8 - ofs));
}

#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
  set_rec_bits(0, bit_ptr, bit_ofs, bit_len)


/*
  Compare two VARCHAR values.
  @param charset_info  - The character set and collation
  @param a             - The pointer to the first string
  @param a_length      - The length of the first string
  @param b             - The pointer to the second string
  @param b_length      - The length of the second string
  @param b_is_prefix   - Whether "b" is a prefix of "a",
                         e.g. in a prefix key (partial length key).
  @returns             - The result of comparison

  - If "b_is_prefix" is FALSE, then the two strings are compared
    taking into account the PAD SPACE/NO PAD attribute of the collation.

  - If "b_is_prefix" is TRUE, then trailing spaces are compared in NO PAD style.
    This is done e.g. when we compare a column value to its prefix key value
    (the value of "a" to the value of "key_a"):
      CREATE TABLE t1 (a VARCHAR(10), KEY(key_a(5));
*/
static inline int ha_compare_char_varying(CHARSET_INFO *charset_info,
                                          const uchar *a, size_t a_length,
                                          const uchar *b, size_t b_length,
                                          my_bool b_is_prefix)
{
  if (!b_is_prefix)
    return charset_info->coll->strnncollsp(charset_info, a, a_length,
                                                         b, b_length);
  return charset_info->coll->strnncoll(charset_info,
                                       a, a_length,
                                       b, b_length, TRUE/*prefix*/);
}


/*
  Compare two CHAR values of the same declared character length,
  e.g. CHAR(5) to CHAR(5).

  @param charset_info  - The character set and collation
  @param a             - The pointer to the first string
  @param a_length      - The length of the first string
  @param b             - The pointer to the second string
  @param b_length      - The length of the second string
  @param nchars        - The declared length (in characters)
  @param b_is_prefix   - Whether "b" is a prefix of "a",
                         e.g. in a prefix key (partial length key).
  @returns             - The result of comparison

  - If "b_is_prefix" is FALSE, then the two strings are compared
    taking into account the PAD SPACE/NO PAD attribute of the collation.
    Additionally, this function assumes that the underlying storage could
    optionally apply trailing space compression, so values can come into this
    comparison function in different states:
    - all trailing spaces removed
    - some trailing spaced removed
    - no trailing spaces removed (exactly "nchars" characters on the two sides)
    This function virtually reconstructs trailing spaces up to the defined
    length specified in "nchars".
    If either of the sides have more than "nchar" characters,
    then only leftmost "nchar" characters are compared.

  - If "b_is_prefix" is TRUE, then trailing spaces are compared in NO PAD style.
    This is done e.g. when we compare a column value to its prefix key value
    (the value of "a" to the value of "key_a"):
      CREATE TABLE t1 (a CHAR(10), KEY(key_a(5));
*/
static inline int ha_compare_char_fixed(CHARSET_INFO *charset_info,
                                        const uchar *a, size_t a_length,
                                        const uchar *b, size_t b_length,
                                        size_t nchars,
                                        my_bool b_is_prefix)
{
  if (!b_is_prefix)
    return charset_info->coll->strnncollsp_nchars(charset_info,
                                                  a, a_length,
                                                  b, b_length,
                                                  nchars,
         MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
  return charset_info->coll->strnncoll(charset_info,
                                       a, a_length,
                                       b, b_length, TRUE/*prefix*/);
}


/*
  A function to compare words of a text.
  This is a common operation in full-text search:
    SELECT MATCH (title) AGAINST ('word') FROM t1;
*/
static inline int ha_compare_word(CHARSET_INFO *charset_info,
                                  const uchar *a, size_t a_length,
                                  const uchar *b, size_t b_length)
{
  return charset_info->coll->strnncollsp(charset_info,
                                         a, a_length,
                                         b, b_length);
}


/*
  A function to compare a word of a text to a word prefix.
  This is a common operation in full-text search:
    SELECT MATCH (title) AGAINST ('wor*' IN BOOLEAN MODE) FROM t1;
*/
static inline int ha_compare_word_prefix(CHARSET_INFO *charset_info,
                                        const uchar *a, size_t a_length,
                                        const uchar *b, size_t b_length)
{
  return charset_info->coll->strnncoll(charset_info,
                                       a, a_length,
                                       b, b_length,
                                       TRUE/*b_is_prefix*/);
}


/*
  Compare words (full match or prefix match), e.g. for full-text search.
*/
static inline int ha_compare_word_or_prefix(CHARSET_INFO *charset_info,
                                            const uchar *a, size_t a_length,
                                            const uchar *b, size_t b_length,
                                            my_bool b_is_prefix)
{
  if (!b_is_prefix)
    return ha_compare_word(charset_info, a, a_length, b, b_length);
  return ha_compare_word_prefix(charset_info, a, a_length, b, b_length);
}


extern int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
		      const uchar *b, uint key_length, uint nextflag,
		      uint *diff_pos);
extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a);

/*
  Inside an in-memory data record, memory pointers to pieces of the
  record (like BLOBs) are stored in their native byte order and in
  this amount of bytes.
*/
#define portable_sizeof_char_ptr 8
#ifdef	__cplusplus
}
#endif

/**
  Return values for pushed index condition or rowid filter check functions.

  0=CHECK_NEG  - The filter is not satisfied. The engine should discard this
                 index tuple and continue the scan.
  1=CHECK_POS  - The filter is satisfied. Current index tuple should be
                 returned to the SQL layer.
  2=CHECK_OUT_OF_RANGE - the index tuple is outside of the range that we're
                 scanning. (Example: if we're scanning "t.key BETWEEN 10 AND
                 20" and got a "t.key=21" tuple) Tthe engine should stop
                 scanning and return HA_ERR_END_OF_FILE right away).
  3=CHECK_ABORTED_BY_USER - the engine must stop scanning and should return
                            HA_ERR_ABORTED_BY_USER right away
 -1=CHECK_ERROR - Reserved for internal errors in engines. Should not be
                  returned by ICP or rowid filter check functions.
*/

typedef enum check_result {
  CHECK_ERROR=-1,
  CHECK_NEG=0,
  CHECK_POS=1,
  CHECK_OUT_OF_RANGE=2,
  CHECK_ABORTED_BY_USER=3
} check_result_t;

typedef check_result_t (*index_cond_func_t)(void *param);
typedef check_result_t (*rowid_filter_func_t)(void *param);
typedef int (*rowid_filter_is_active_func_t)(void *param);

#endif /* _my_compare_h */
server/private/sql_truncate.h000064400000004037150400263730012405 0ustar00#ifndef SQL_TRUNCATE_INCLUDED
#define SQL_TRUNCATE_INCLUDED
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.

   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 */

class THD;
struct TABLE_LIST;

/**
  Sql_cmd_truncate_table represents the TRUNCATE statement.
*/
class Sql_cmd_truncate_table : public Sql_cmd
{
private:
  /* Set if a lock must be downgraded after truncate is done. */
  MDL_ticket *m_ticket_downgrade;

public:
  /**
    Constructor, used to represent a TRUNCATE statement.
  */
  Sql_cmd_truncate_table() = default;

  virtual ~Sql_cmd_truncate_table() = default;

  /**
    Execute a TRUNCATE statement at runtime.
    @param thd the current thread.
    @return false on success.
  */
  bool execute(THD *thd) override;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_TRUNCATE;
  }

protected:
  enum truncate_result{
    TRUNCATE_OK=0,
    TRUNCATE_FAILED_BUT_BINLOG,
    TRUNCATE_FAILED_SKIP_BINLOG
  };

  /** Handle locking a base table for truncate. */
  bool lock_table(THD *, TABLE_LIST *, bool *);

  /** Truncate table via the handler method. */
  enum truncate_result handler_truncate(THD *, TABLE_LIST *, bool);

  /**
    Optimized delete of all rows by doing a full regenerate of the table.
    Depending on the storage engine, it can be accomplished through a
    drop and recreate or via the handler truncate method.
  */
  bool truncate_table(THD *, TABLE_LIST *);
};

#endif
server/private/semisync_master.h000064400000061732150400263730013113 0ustar00/* Copyright (C) 2007 Google Inc.
   Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */


#ifndef SEMISYNC_MASTER_H
#define SEMISYNC_MASTER_H

#include "semisync.h"
#include "semisync_master_ack_receiver.h"

#ifdef HAVE_PSI_INTERFACE
extern PSI_mutex_key key_LOCK_rpl_semi_sync_master_enabled;
extern PSI_mutex_key key_LOCK_binlog;
extern PSI_cond_key key_COND_binlog_send;
#endif

struct Tranx_node {
  char              log_name[FN_REFLEN];
  my_off_t          log_pos;
  THD               *thd;                   /* The thread awaiting an ACK */
  struct Tranx_node *next;            /* the next node in the sorted list */
  struct Tranx_node *hash_next;    /* the next node during hash collision */
};

/**
  @class Tranx_node_allocator

  This class provides memory allocating and freeing methods for
  Tranx_node. The main target is performance.

  @section ALLOCATE How to allocate a node
    The pointer of the first node after 'last_node' in current_block is
    returned. current_block will move to the next free Block when all nodes of
    it are in use. A new Block is allocated and is put into the rear of the
    Block link table if no Block is free.

    The list starts up empty (ie, there is no allocated Block).

    After some nodes are freed, there probably are some free nodes before
    the sequence of the allocated nodes, but we do not reuse it. It is better
    to keep the allocated nodes are in the sequence, for it is more efficient
    for allocating and freeing Tranx_node.

  @section FREENODE How to free nodes
    There are two methods for freeing nodes. They are free_all_nodes and
    free_nodes_before.

    'A Block is free' means all of its nodes are free.
    @subsection free_nodes_before
    As all allocated nodes are in the sequence, 'Before one node' means all
    nodes before given node in the same Block and all Blocks before the Block
    which containing the given node. As such, all Blocks before the given one
    ('node') are free Block and moved into the rear of the Block link table.
    The Block containing the given 'node', however, is not. For at least the
    given 'node' is still in use. This will waste at most one Block, but it is
    more efficient.
 */
#define BLOCK_TRANX_NODES 16
class Tranx_node_allocator
{
public:
  /**
    @param reserved_nodes
      The number of reserved Tranx_nodes. It is used to set 'reserved_blocks'
      which can contain at least 'reserved_nodes' number of Tranx_nodes.  When
      freeing memory, we will reserve at least reserved_blocks of Blocks not
      freed.
   */
  Tranx_node_allocator(uint reserved_nodes) :
    reserved_blocks(reserved_nodes/BLOCK_TRANX_NODES +
                  (reserved_nodes%BLOCK_TRANX_NODES > 1 ? 2 : 1)),
    first_block(NULL), last_block(NULL),
    current_block(NULL), last_node(-1), block_num(0) {}

  ~Tranx_node_allocator()
  {
    Block *block= first_block;
    while (block != NULL)
    {
      Block *next= block->next;
      free_block(block);
      block= next;
    }
  }

  /**
    The pointer of the first node after 'last_node' in current_block is
    returned. current_block will move to the next free Block when all nodes of
    it are in use. A new Block is allocated and is put into the rear of the
    Block link table if no Block is free.

    @return Return a Tranx_node *, or NULL if an error occurred.
   */
  Tranx_node *allocate_node()
  {
    Tranx_node *trx_node;
    Block *block= current_block;

    if (last_node == BLOCK_TRANX_NODES-1)
    {
      current_block= current_block->next;
      last_node= -1;
    }

    if (current_block == NULL && allocate_block())
    {
      current_block= block;
      if (current_block)
        last_node= BLOCK_TRANX_NODES-1;
      return NULL;
    }

    trx_node= &(current_block->nodes[++last_node]);
    trx_node->log_name[0] = '\0';
    trx_node->log_pos= 0;
    trx_node->next= 0;
    trx_node->hash_next= 0;
    return trx_node;
  }

  /**
    All nodes are freed.

    @return Return 0, or 1 if an error occurred.
   */
  int free_all_nodes()
  {
    current_block= first_block;
    last_node= -1;
    free_blocks();
    return 0;
  }

  /**
    All Blocks before the given 'node' are free Block and moved into the rear
    of the Block link table.

    @param node All nodes before 'node' will be freed

    @return Return 0, or 1 if an error occurred.
   */
  int free_nodes_before(Tranx_node* node)
  {
    Block *block;
    Block *prev_block= NULL;

    block= first_block;
    while (block != current_block->next)
    {
      /* Find the Block containing the given node */
      if (&(block->nodes[0]) <= node && &(block->nodes[BLOCK_TRANX_NODES]) >= node)
      {
        /* All Blocks before the given node are put into the rear */
        if (first_block != block)
        {
          last_block->next= first_block;
          first_block= block;
          last_block= prev_block;
          last_block->next= NULL;
          free_blocks();
        }
        return 0;
      }
      prev_block= block;
      block= block->next;
    }

    /* Node does not find should never happen */
    DBUG_ASSERT(0);
    return 1;
  }

private:
  uint reserved_blocks;

 /**
   A sequence memory which contains BLOCK_TRANX_NODES Tranx_nodes.

   BLOCK_TRANX_NODES The number of Tranx_nodes which are in a Block.

   next Every Block has a 'next' pointer which points to the next Block.
        These linking Blocks constitute a Block link table.
  */
  struct Block {
    Block *next;
    Tranx_node nodes[BLOCK_TRANX_NODES];
  };

  /**
    The 'first_block' is the head of the Block link table;
   */
  Block *first_block;
  /**
    The 'last_block' is the rear of the Block link table;
   */
  Block *last_block;

  /**
    current_block always points the Block in the Block link table in
    which the last allocated node is. The Blocks before it are all in use
    and the Blocks after it are all free.
   */
  Block *current_block;

  /**
    It always points to the last node which has been allocated in the
    current_block.
   */
  int last_node;

  /**
    How many Blocks are in the Block link table.
   */
  uint block_num;

  /**
    Allocate a block and then assign it to current_block.
  */
  int allocate_block()
  {
    Block *block= (Block *)my_malloc(PSI_INSTRUMENT_ME, sizeof(Block), MYF(0));
    if (block)
    {
      block->next= NULL;

      if (first_block == NULL)
        first_block= block;
      else
        last_block->next= block;

      /* New Block is always put into the rear */
      last_block= block;
      /* New Block is always the current_block */
      current_block= block;
      ++block_num;
      return 0;
    }
    return 1;
  }

  /**
    Free a given Block.
    @param block The Block will be freed.
   */
  void free_block(Block *block)
  {
    my_free(block);
    --block_num;
  }


  /**
    If there are some free Blocks and the total number of the Blocks in the
    Block link table is larger than the 'reserved_blocks', Some free Blocks
    will be freed until the total number of the Blocks is equal to the
    'reserved_blocks' or there is only one free Block behind the
    'current_block'.
   */
  void free_blocks()
  {
    if (current_block == NULL || current_block->next == NULL)
      return;

    /* One free Block is always kept behind the current block */
    Block *block= current_block->next->next;
    while (block_num > reserved_blocks && block != NULL)
    {
      Block *next= block->next;
      free_block(block);
      block= next;
    }
    current_block->next->next= block;
    if (block == NULL)
      last_block= current_block->next;
  }
};

/**
  Function pointer type to run on the contents of an Active_tranx node.

  Return 0 for success, 1 for error.

  Note Repl_semi_sync_master::LOCK_binlog is not guaranteed to be held for
  its invocation. See the context in which it is called to know.
*/

typedef int (*active_tranx_action)(THD *trx_thd, const char *log_file_name,
                                   my_off_t trx_log_file_pos);

/**
   This class manages memory for active transaction list.

   We record each active transaction with a Tranx_node, each session
   can have only one open transaction. Because of EVENT, the total
   active transaction nodes can exceed the maximum allowed
   connections.
*/
class Active_tranx
  :public Trace {
private:

  Tranx_node_allocator m_allocator;
  /* These two record the active transaction list in sort order. */
  Tranx_node       *m_trx_front, *m_trx_rear;

  Tranx_node      **m_trx_htb;        /* A hash table on active transactions. */

  int              m_num_entries;              /* maximum hash table entries */
  mysql_mutex_t *m_lock;                                     /* mutex lock */
  mysql_cond_t  *m_cond_empty;    /* signalled when cleared all Tranx_node */

  inline void assert_lock_owner();

  inline unsigned int calc_hash(const unsigned char *key, size_t length);
  unsigned int get_hash_value(const char *log_file_name, my_off_t log_file_pos);

  int compare(const char *log_file_name1, my_off_t log_file_pos1,
              const Tranx_node *node2) {
    return compare(log_file_name1, log_file_pos1,
                   node2->log_name, node2->log_pos);
  }
  int compare(const Tranx_node *node1,
              const char *log_file_name2, my_off_t log_file_pos2) {
    return compare(node1->log_name, node1->log_pos,
                   log_file_name2, log_file_pos2);
  }
  int compare(const Tranx_node *node1, const Tranx_node *node2) {
    return compare(node1->log_name, node1->log_pos,
                   node2->log_name, node2->log_pos);
  }

public:
  Active_tranx(mysql_mutex_t *lock, mysql_cond_t *cond,
               unsigned long trace_level);
  ~Active_tranx();

  /* Insert an active transaction node with the specified position.
   *
   * Return:
   *  0: success;  non-zero: error
   */
  int insert_tranx_node(THD *thd_to_wait, const char *log_file_name,
                        my_off_t log_file_pos);

  /* Clear the active transaction nodes until(inclusive) the specified
   * position.
   * If log_file_name is NULL, everything will be cleared: the sorted
   * list and the hash table will be reset to empty.
   *
   * The pre_delete_hook parameter is a function pointer that will be invoked
   * for each Active_tranx node, in order, from m_trx_front to m_trx_rear,
   * e.g. to signal their wakeup condition. Repl_semi_sync_binlog::LOCK_binlog
   * is held while this is invoked.
   */
  void clear_active_tranx_nodes(const char *log_file_name,
                                my_off_t log_file_pos,
                                active_tranx_action pre_delete_hook);

  /* Unlinks a thread from a Tranx_node, so it will not be referenced/signalled
   * if it is separately killed. Note that this keeps the Tranx_node itself in
   * the cache so it can still be awaited by await_all_slave_replies(), e.g.
   * as is done by SHUTDOWN WAIT FOR ALL SLAVES.
   */
  void unlink_thd_as_waiter(const char *log_file_name, my_off_t log_file_pos);

  /* Uses DBUG_ASSERT statements to ensure that the argument thd_to_check
   * matches the thread of the respective Tranx_node::thd of the passed in
   * log_file_name and log_file_pos.
   */
  bool is_thd_waiter(THD *thd_to_check, const char *log_file_name,
                     my_off_t log_file_pos);

  /* Given a position, check to see whether the position is an active
   * transaction's ending position by probing the hash table.
   */
  bool is_tranx_end_pos(const char *log_file_name, my_off_t log_file_pos);

  /* Given two binlog positions, compare which one is bigger based on
   * (file_name, file_position).
   */
  static int compare(const char *log_file_name1, my_off_t log_file_pos1,
                     const char *log_file_name2, my_off_t log_file_pos2);


  /* Check if there are no transactions actively awaiting ACKs. Returns true
   * if the internal linked list has no entries, false otherwise.
   */
  bool is_empty() { return m_trx_front == NULL; }

};

/**
   The extension class for the master of semi-synchronous replication
*/
class Repl_semi_sync_master
  :public Repl_semi_sync_base {
  Active_tranx    *m_active_tranxs;  /* active transaction list: the list will
                                      be cleared when semi-sync switches off. */

  /* True when init_object has been called */
  bool m_init_done;

  /* This cond variable is signaled when enough binlog has been sent to slave,
   * so that a waiting trx can return the 'ok' to the client for a commit.
   */
  mysql_cond_t  COND_binlog_send;

  /* Mutex that protects the following state variables and the active
   * transaction list.
   * Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are
   * already holding m_LOCK_binlog because it can cause deadlocks.
   */
  mysql_mutex_t LOCK_binlog;

  /* This is set to true when m_reply_file_name contains meaningful data. */
  bool            m_reply_file_name_inited;

  /* The binlog name up to which we have received replies from any slaves. */
  char            m_reply_file_name[FN_REFLEN];

  /* The position in that file up to which we have the reply from any slaves. */
  my_off_t        m_reply_file_pos;

  /* This is set to true when we know the 'smallest' wait position. */
  bool            m_wait_file_name_inited;

  /* NULL, or the 'smallest' filename that a transaction is waiting for
   * slave replies.
   */
  char            m_wait_file_name[FN_REFLEN];

  /* The smallest position in that file that a trx is waiting for: the trx
   * can proceed and send an 'ok' to the client when the master has got the
   * reply from the slave indicating that it already got the binlog events.
   */
  my_off_t        m_wait_file_pos;

  /* This is set to true when we know the 'largest' transaction commit
   * position in the binlog file.
   * We always maintain the position no matter whether semi-sync is switched
   * on switched off.  When a transaction wait timeout occurs, semi-sync will
   * switch off.  Binlog-dump thread can use the three fields to detect when
   * slaves catch up on replication so that semi-sync can switch on again.
   */
  bool            m_commit_file_name_inited;

  /* The 'largest' binlog filename that a commit transaction is seeing.       */
  char            m_commit_file_name[FN_REFLEN];

  /* The 'largest' position in that file that a commit transaction is seeing. */
  my_off_t        m_commit_file_pos;

  /* All global variables which can be set by parameters. */
  volatile bool            m_master_enabled;      /* semi-sync is enabled on the master */
  unsigned long           m_wait_timeout;      /* timeout period(ms) during tranx wait */

  bool            m_state;                    /* whether semi-sync is switched */

  /*Waiting for ACK before/after innodb commit*/
  ulong m_wait_point;

  void lock();
  void unlock();

  /* Is semi-sync replication on? */
  bool is_on() {
    return (m_state);
  }

  void set_master_enabled(bool enabled) {
    m_master_enabled = enabled;
  }

  /* Switch semi-sync off because of timeout in transaction waiting. */
  void switch_off();

  /* Switch semi-sync on when slaves catch up. */
  int try_switch_on(int server_id,
                    const char *log_file_name, my_off_t log_file_pos);

 public:
  Repl_semi_sync_master();
  ~Repl_semi_sync_master() = default;

  void cleanup();

  bool get_master_enabled() {
    return m_master_enabled;
  }
  void set_trace_level(unsigned long trace_level) {
    m_trace_level = trace_level;
    if (m_active_tranxs)
      m_active_tranxs->m_trace_level = trace_level;
  }

  /* Set the transaction wait timeout period, in milliseconds. */
  void set_wait_timeout(unsigned long wait_timeout) {
    m_wait_timeout = wait_timeout;
  }

  /*
    Calculates a timeout that is m_wait_timeout after start_arg and saves it
    in out. If start_arg is NULL, the timeout is m_wait_timeout after the
    current system time.
  */
  void create_timeout(struct timespec *out, struct timespec *start_arg);

  /*
    Blocks the calling thread until the ack_receiver either receives ACKs for
    all transactions awaiting ACKs, or times out (from
    rpl_semi_sync_master_timeout).

    If info_msg is provided, it will be output via sql_print_information when
    there are transactions awaiting ACKs; info_msg is not output if there are
    no transasctions to await.
  */
  void await_all_slave_replies(const char *msg);

  /*set the ACK point, after binlog sync or after transaction commit*/
  void set_wait_point(unsigned long ack_point)
  {
    m_wait_point = ack_point;
  }

  ulong wait_point() //no cover line
  {
    return m_wait_point; //no cover line
  }

  /* Initialize this class after MySQL parameters are initialized. this
   * function should be called once at bootstrap time.
   */
  int init_object();

  /* Enable the object to enable semi-sync replication inside the master. */
  int enable_master();

  /* Disable the object to disable semi-sync replication inside the master. */
  void disable_master();

  /* Add a semi-sync replication slave */
  void add_slave();
    
  /* Remove a semi-sync replication slave */
  void remove_slave();

  /* It parses a reply packet and call report_reply_binlog to handle it. */
  int report_reply_packet(uint32 server_id, const uchar *packet,
                        ulong packet_len);

  /* In semi-sync replication, reports up to which binlog position we have
   * received replies from the slave indicating that it already get the events.
   *
   * Input:
   *  server_id     - (IN)  master server id number
   *  log_file_name - (IN)  binlog file name
   *  end_offset    - (IN)  the offset in the binlog file up to which we have
   *                        the replies from the slave
   *
   * Return:
   *  0: success;  non-zero: error
   */
  int report_reply_binlog(uint32 server_id,
                          const char* log_file_name,
                          my_off_t end_offset);

  /* Commit a transaction in the final step.  This function is called from
   * InnoDB before returning from the low commit.  If semi-sync is switch on,
   * the function will wait to see whether binlog-dump thread get the reply for
   * the events of the transaction.  Remember that this is not a direct wait,
   * instead, it waits to see whether the binlog-dump thread has reached the
   * point.  If the wait times out, semi-sync status will be switched off and
   * all other transaction would not wait either.
   *
   * Input:  (the transaction events' ending binlog position)
   *  trx_wait_binlog_name - (IN)  ending position's file name
   *  trx_wait_binlog_pos  - (IN)  ending position's file offset
   *
   * Return:
   *  0: success;  non-zero: error
   */
  int commit_trx(const char* trx_wait_binlog_name,
                 my_off_t trx_wait_binlog_pos);

  /*Wait for ACK after writing/sync binlog to file*/
  int wait_after_sync(const char* log_file, my_off_t log_pos);

  /*Wait for ACK after commting the transaction*/
  int wait_after_commit(THD* thd, bool all);

  /*Wait after the transaction is rollback*/
  int wait_after_rollback(THD *thd, bool all);
  /* Store the current binlog position in m_active_tranxs. This position should
   * be acked by slave.
   *
   * Inputs:
   *   trans_thd  Thread of the transaction which is executing the
   *              transaction.
   *   waiter_thd Thread that will wait for the ACK from the replica,
   *              which depends on the semi-sync wait point. If AFTER_SYNC,
   *              and also using binlog group commit, this will be the leader
   *              thread of the binlog commit. Otherwise, it is the thread that
   *              is executing the transaction, i.e. the same as trans_thd.
   *   log_file   Name of the binlog file that the transaction is written into
   *   log_pos    Offset within the binlog file that the transaction is written
   *              at
   */
  int report_binlog_update(THD *trans_thd, THD *waiter_thd,
                           const char *log_file, my_off_t log_pos);

  int dump_start(THD* thd,
                  const char *log_file,
                  my_off_t log_pos);

  void dump_end(THD* thd);

  /* Reserve space in the replication event packet header:
   *  . slave semi-sync off: 1 byte - (0)
   *  . slave semi-sync on:  3 byte - (0, 0xef, 0/1}
   *
   * Input:
   *  packet   - (IN)  the header buffer
   *
   * Return:
   *  size of the bytes reserved for header
   */
  int reserve_sync_header(String* packet);

  /* Update the sync bit in the packet header to indicate to the slave whether
   * the master will wait for the reply of the event.  If semi-sync is switched
   * off and we detect that the slave is catching up, we switch semi-sync on.
   * 
   * Input:
   *  THD           - (IN)  current dump thread
   *  packet        - (IN)  the packet containing the replication event
   *  log_file_name - (IN)  the event ending position's file name
   *  log_file_pos  - (IN)  the event ending position's file offset
   *  need_sync     - (IN)  identify if flush_net is needed to call.
   *  server_id     - (IN)  master server id number
   *
   * Return:
   *  0: success;  non-zero: error
   */
  int update_sync_header(THD* thd, unsigned char *packet,
                         const char *log_file_name,
                         my_off_t log_file_pos,
                         bool* need_sync);

  /* Called when a transaction finished writing binlog events.
   *  . update the 'largest' transactions' binlog event position
   *  . insert the ending position in the active transaction list if
   *    semi-sync is on
   *
   * Input:  (the transaction events' ending binlog position)
   *  THD           - (IN)  thread that will wait for an ACK. This can be the
   *                        binlog leader thread when using wait_point
   *                        AFTER_SYNC with binlog group commit. In all other
   *                        cases, this is the user thread executing the
   *                        transaction.
   *  log_file_name - (IN)  transaction ending position's file name
   *  log_file_pos  - (IN)  transaction ending position's file offset
   *
   * Return:
   *  0: success;  non-zero: error
   */
  int write_tranx_in_binlog(THD *thd, const char *log_file_name,
                            my_off_t log_file_pos);

  /* Read the slave's reply so that we know how much progress the slave makes
   * on receive replication events.
   */
  int flush_net(THD* thd, const char *event_buf);

  /* Export internal statistics for semi-sync replication. */
  void set_export_stats();

  /* 'reset master' command is issued from the user and semi-sync need to
   * go off for that.
   */
  int after_reset_master();

  /*called before reset master*/
  int before_reset_master();

  mysql_mutex_t LOCK_rpl_semi_sync_master_enabled;
};

enum rpl_semi_sync_master_wait_point_t {
  SEMI_SYNC_MASTER_WAIT_POINT_AFTER_BINLOG_SYNC,
  SEMI_SYNC_MASTER_WAIT_POINT_AFTER_STORAGE_COMMIT,
};

extern Repl_semi_sync_master repl_semisync_master;
extern Ack_receiver ack_receiver;

/* System and status variables for the master component */
extern my_bool rpl_semi_sync_master_enabled;
extern my_bool rpl_semi_sync_master_status;
extern ulong rpl_semi_sync_master_wait_point;
extern ulong rpl_semi_sync_master_clients;
extern ulong rpl_semi_sync_master_timeout;
extern ulong rpl_semi_sync_master_trace_level;
extern ulong rpl_semi_sync_master_yes_transactions;
extern ulong rpl_semi_sync_master_no_transactions;
extern ulong rpl_semi_sync_master_off_times;
extern ulong rpl_semi_sync_master_wait_timeouts;
extern ulong rpl_semi_sync_master_timefunc_fails;
extern ulong rpl_semi_sync_master_num_timeouts;
extern ulong rpl_semi_sync_master_wait_sessions;
extern ulong rpl_semi_sync_master_wait_pos_backtraverse;
extern ulong rpl_semi_sync_master_avg_trx_wait_time;
extern ulong rpl_semi_sync_master_avg_net_wait_time;
extern ulonglong rpl_semi_sync_master_net_wait_num;
extern ulonglong rpl_semi_sync_master_trx_wait_num;
extern ulonglong rpl_semi_sync_master_net_wait_time;
extern ulonglong rpl_semi_sync_master_trx_wait_time;
extern unsigned long long rpl_semi_sync_master_request_ack;
extern unsigned long long rpl_semi_sync_master_get_ack;

/*
  This indicates whether we should keep waiting if no semi-sync slave
  is available.
     0           : stop waiting if detected no avaialable semi-sync slave.
     1 (default) : keep waiting until timeout even no available semi-sync slave.
*/
extern char rpl_semi_sync_master_wait_no_slave;
extern Repl_semi_sync_master repl_semisync_master;

extern PSI_stage_info stage_waiting_for_semi_sync_ack_from_slave;
extern PSI_stage_info stage_reading_semi_sync_ack;
extern PSI_stage_info stage_waiting_for_semi_sync_slave;

void semi_sync_master_deinit();

#endif /* SEMISYNC_MASTER_H */
server/private/field_comp.h000064400000002226150400263730012000 0ustar00#ifndef FIELD_COMP_H_INCLUDED
#define FIELD_COMP_H_INCLUDED
/* Copyright (C) 2017 MariaDB Foundation

   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-1301  USA */


#define MAX_COMPRESSION_METHODS 16

struct Compression_method
{
  const char *name;
  uint (*compress)(THD *thd, char *to, const char *from, uint length);
  int (*uncompress)(String *to, const uchar *from, uint from_length,
                    uint field_length);
};


extern Compression_method compression_methods[MAX_COMPRESSION_METHODS];
#define zlib_compression_method (&compression_methods[8])

#endif
server/private/sys_vars_shared.h000064400000005251150400263730013077 0ustar00#ifndef SYS_VARS_SHARED_INCLUDED
#define SYS_VARS_SHARED_INCLUDED

/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @file
  "protected" interface to sys_var - server configuration variables.

  This header is included by files implementing support and utility
  functions of sys_var's (set_var.cc) and files implementing
  classes in the sys_var hierarchy (sql_plugin.cc)
*/

#include <sql_priv.h>
#include "set_var.h"

extern bool throw_bounds_warning(THD *thd, const char *name,const char *v);
extern bool throw_bounds_warning(THD *thd, const char *name,
                                 bool fixed, bool is_unsigned, longlong v);
extern bool throw_bounds_warning(THD *thd, const char *name, bool fixed,
                                 double v);
extern sys_var *intern_find_sys_var(const char *str, size_t length);

extern sys_var_chain all_sys_vars;

/** wrapper to hide a mutex and an rwlock under a common interface */
class PolyLock
{
public:
  virtual void rdlock()= 0;
  virtual void wrlock()= 0;
  virtual void unlock()= 0;
  virtual ~PolyLock() = default;
};

class PolyLock_mutex: public PolyLock
{
  mysql_mutex_t *mutex;
public:
  PolyLock_mutex(mysql_mutex_t *arg): mutex(arg) {}
  void rdlock() override { mysql_mutex_lock(mutex); }
  void wrlock() override { mysql_mutex_lock(mutex); }
  void unlock() override { mysql_mutex_unlock(mutex); }
};

class PolyLock_rwlock: public PolyLock
{
  mysql_rwlock_t *rwlock;
public:
  PolyLock_rwlock(mysql_rwlock_t *arg): rwlock(arg) {}
  void rdlock() override { mysql_rwlock_rdlock(rwlock); }
  void wrlock() override { mysql_rwlock_wrlock(rwlock); }
  void unlock() override { mysql_rwlock_unlock(rwlock); }
};

class AutoWLock
{
  PolyLock *lock;
public:
  AutoWLock(PolyLock *l) : lock(l) { if (lock) lock->wrlock(); }
  ~AutoWLock() { if (lock) lock->unlock(); }
};

class AutoRLock
{
  PolyLock *lock;
public:
  AutoRLock(PolyLock *l) : lock(l) { if (lock) lock->rdlock(); }
  ~AutoRLock() { if (lock) lock->unlock(); }
};


#endif /* SYS_VARS_SHARED_INCLUDED */
server/private/rpl_record.h000064400000003061150400263730012030 0ustar00/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.
   Copyright (c) 2008, 2013, SkySQL Ab.

   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 */

#ifndef RPL_RECORD_H
#define RPL_RECORD_H

#include <rpl_reporting.h>

struct rpl_group_info;
struct TABLE;
typedef struct st_bitmap MY_BITMAP;

#if !defined(MYSQL_CLIENT)
size_t pack_row(TABLE* table, MY_BITMAP const* cols,
                uchar *row_data, const uchar *data);
#endif

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int unpack_row(rpl_group_info *rgi,
               TABLE *table, uint const colcnt,
               uchar const *const row_data, MY_BITMAP const *cols,
               uchar const **const curr_row_end, ulong *const master_reclength,
               uchar const *const row_end);

// Fill table's record[0] with default values.
int prepare_record(TABLE *const table, const uint skip, const bool check);
int fill_extra_persistent_columns(TABLE *table, int master_cols);
#endif

#endif
server/private/sql_partition.h000064400000027450150400263730012575 0ustar00#ifndef SQL_PARTITION_INCLUDED
#define SQL_PARTITION_INCLUDED

/* Copyright (c) 2006, 2017, Oracle and/or its affiliates.
   Copyright (c) 2011, 2017, MariaDB

  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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface				/* gcc class implementation */
#endif

#include "sql_list.h"                           /* List */
#include "table.h"                              /* TABLE_LIST */

class Alter_info;
class Alter_table_ctx;
class Field;
class String;
class handler;
class partition_info;
struct TABLE;
struct TABLE_LIST;
typedef struct st_bitmap MY_BITMAP;
typedef struct st_key KEY;
typedef struct st_key_range key_range;

/* Flags for partition handlers */
#define HA_CAN_PARTITION       (1 << 0) /* Partition support */
#define HA_CAN_UPDATE_PARTITION_KEY (1 << 1)
#define HA_CAN_PARTITION_UNIQUE (1 << 2)
#define HA_USE_AUTO_PARTITION (1 << 3)
#define HA_ONLY_VERS_PARTITION (1 << 4)

#define NORMAL_PART_NAME 0
#define TEMP_PART_NAME 1
#define RENAMED_PART_NAME 2

typedef struct st_lock_param_type
{
  TABLE_LIST *table_list;
  ulonglong copied;
  ulonglong deleted;
  THD *thd;
  HA_CREATE_INFO *create_info;
  Alter_info *alter_info;
  TABLE *table;
  KEY *key_info_buffer;
  LEX_CUSTRING org_tabledef_version;
  uchar *pack_frm_data;
  uint key_count;
  uint db_options;
  size_t pack_frm_len;
  partition_info *part_info;
} ALTER_PARTITION_PARAM_TYPE;

typedef struct {
  longlong list_value;
  uint32 partition_id;
} LIST_PART_ENTRY;

typedef struct {
  uint32 start_part;
  uint32 end_part;
} part_id_range;

class String_list;
struct st_partition_iter;
#define NOT_A_PARTITION_ID UINT_MAX32

bool is_partition_in_list(char *part_name, List<char> list_part_names);
char *are_partitions_in_table(partition_info *new_part_info,
                              partition_info *old_part_info);
bool check_reorganise_list(partition_info *new_part_info,
                           partition_info *old_part_info,
                           List<char> list_part_names);
handler *get_ha_partition(partition_info *part_info);
int get_part_for_buf(const uchar *buf, const uchar *rec0,
                     partition_info *part_info, uint32 *part_id);
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
bool check_partition_info(partition_info *part_info,handlerton **eng_type,
                          TABLE *table, handler *file, HA_CREATE_INFO *info);
void set_linear_hash_mask(partition_info *part_info, uint num_parts);
bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind);
void get_partition_set(const TABLE *table, uchar *buf, const uint index,
                       const key_range *key_spec,
                       part_id_range *part_spec);
uint get_partition_field_store_length(Field *field);
void get_full_part_id_from_key(const TABLE *table, uchar *buf,
                               KEY *key_info,
                               const key_range *key_spec,
                               part_id_range *part_spec);
bool mysql_unpack_partition(THD *thd, char *part_buf,
                            uint part_info_len,
                            TABLE *table, bool is_create_table_ind,
                            handlerton *default_db_type,
                            bool *work_part_info_used);
void make_used_partitions_str(MEM_ROOT *mem_root,
                              partition_info *part_info, String *parts_str,
                              String_list &used_partitions_list);
uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
                                       bool left_endpoint,
                                       bool include_endpoint);
uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
                                           bool left_endpoint,
                                           bool include_endpoint);
bool check_part_func_fields(Field **ptr, bool ok_with_charsets);
bool field_is_partition_charset(Field *field);
Item* convert_charset_partition_constant(Item *item, CHARSET_INFO *cs);
/**
  Append all fields in read_set to string

  @param[in,out] str   String to append to.
  @param[in]     row   Row to append.
  @param[in]     table Table containing read_set and fields for the row.
*/
void append_row_to_str(String &str, const uchar *row, TABLE *table);
void truncate_partition_filename(char *path);

/*
  A "Get next" function for partition iterator.

  SYNOPSIS
    partition_iter_func()
      part_iter  Partition iterator, you call only "iter.get_next(&iter)"

  DESCRIPTION
    Depending on whether partitions or sub-partitions are iterated, the
    function returns next subpartition id/partition number. The sequence of
    returned numbers is not ordered and may contain duplicates.

    When the end of sequence is reached, NOT_A_PARTITION_ID is returned, and 
    the iterator resets itself (so next get_next() call will start to 
    enumerate the set all over again).

  RETURN 
    NOT_A_PARTITION_ID if there are no more partitions.
    [sub]partition_id  of the next partition
*/

typedef uint32 (*partition_iter_func)(st_partition_iter* part_iter);


/*
  Partition set iterator. Used to enumerate a set of [sub]partitions
  obtained in partition interval analysis (see get_partitions_in_range_iter).

  For the user, the only meaningful field is get_next, which may be used as
  follows:
             part_iterator.get_next(&part_iterator);
  
  Initialization is done by any of the following calls:
    - get_partitions_in_range_iter-type function call
    - init_single_partition_iterator()
    - init_all_partitions_iterator()
  Cleanup is not needed.
*/

typedef struct st_partition_iter
{
  partition_iter_func get_next;
  /* 
    Valid for "Interval mapping" in LIST partitioning: if true, let the
    iterator also produce id of the partition that contains NULL value.
  */
  bool ret_null_part, ret_null_part_orig;
  /*
    We should return DEFAULT partition.
  */
  bool ret_default_part, ret_default_part_orig;
  struct st_part_num_range
  {
    uint32 start;
    uint32 cur;
    uint32 end;
  };

  struct st_field_value_range
  {
    longlong start;
    longlong cur;
    longlong end;
  };

  union
  {
    struct st_part_num_range     part_nums;
    struct st_field_value_range  field_vals;
  };
  partition_info *part_info;
} PARTITION_ITERATOR;


/*
  Get an iterator for set of partitions that match given field-space interval

  SYNOPSIS
    get_partitions_in_range_iter()
      part_info            Partitioning info
      is_subpart
      store_length_array   Length of fields packed in opt_range_key format
      min_val              Left edge,  field value in opt_range_key format
      max_val              Right edge, field value in opt_range_key format
      min_len              Length of minimum value
      max_len              Length of maximum value
      flags                Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE,
                           NO_MAX_RANGE
      part_iter            Iterator structure to be initialized

  DESCRIPTION
    Functions with this signature are used to perform "Partitioning Interval
    Analysis". This analysis is applicable for any type of [sub]partitioning 
    by some function of a single fieldX. The idea is as follows:
    Given an interval "const1 <=? fieldX <=? const2", find a set of partitions
    that may contain records with value of fieldX within the given interval.

    The min_val, max_val and flags parameters specify the interval.
    The set of partitions is returned by initializing an iterator in *part_iter

  NOTES
    There are currently three functions of this type:
     - get_part_iter_for_interval_via_walking
     - get_part_iter_for_interval_cols_via_map
     - get_part_iter_for_interval_via_mapping

  RETURN 
    0 - No matching partitions, iterator not initialized
    1 - Some partitions would match, iterator intialized for traversing them
   -1 - All partitions would match, iterator not initialized
*/

typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
                                            bool is_subpart,
                                            uint32 *store_length_array,
                                            uchar *min_val, uchar *max_val,
                                            uint min_len, uint max_len,
                                            uint flags,
                                            PARTITION_ITERATOR *part_iter);

#include "partition_info.h"

#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition_table(THD *thd, TABLE *table,
                                Alter_info *alter_info,
                                HA_CREATE_INFO *create_info,
                                TABLE_LIST *table_list);
bool set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
                    enum partition_state part_state);
uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
                           HA_CREATE_INFO *create_info,
                           bool *partition_changed,
                           bool *fast_alter_table);
char *generate_partition_syntax(THD *thd, partition_info *part_info,
                                uint *buf_length,
                                bool show_partition_options,
                                HA_CREATE_INFO *create_info,
                                Alter_info *alter_info);
char *generate_partition_syntax_for_frm(THD *thd, partition_info *part_info,
                                        uint *buf_length,
                                        HA_CREATE_INFO *create_info,
                                        Alter_info *alter_info);
bool verify_data_with_partition(TABLE *table, TABLE *part_table,
                                uint32 part_id);
bool compare_partition_options(HA_CREATE_INFO *table_create_info,
                               partition_element *part_elem);
bool partition_key_modified(TABLE *table, const MY_BITMAP *fields);
#else
#define partition_key_modified(X,Y) 0
#endif

int __attribute__((warn_unused_result))
  create_partition_name(char *out, size_t outlen, const char *in1, const char
                        *in2, uint name_variant, bool translate);
int __attribute__((warn_unused_result))
  create_subpartition_name(char *out, size_t outlen, const char *in1, const
                           char *in2, const char *in3, uint name_variant);

void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
                       const uchar *old_buf);

/** Set up table for creating a partition.
Copy info from partition to the table share so the created partition
has the correct info.
  @param thd               THD object
  @param share             Table share to be updated.
  @param info              Create info to be updated.
  @param part_elem         partition_element containing the info.

  @return    status
    @retval  TRUE  Error
    @retval  FALSE Success

  @details
    Set up
    1) Comment on partition
    2) MAX_ROWS, MIN_ROWS on partition
    3) Index file name on partition
    4) Data file name on partition
*/
bool set_up_table_before_create(THD *thd,
                                TABLE_SHARE *share,
                                const char *partition_name_with_path,
                                HA_CREATE_INFO *info,
                                partition_element *part_elem);

#endif /* SQL_PARTITION_INCLUDED */

server/private/sql_parse.h000064400000020674150400263730011677 0ustar00/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_PARSE_INCLUDED
#define SQL_PARSE_INCLUDED

#include "sql_acl.h"                            /* GLOBAL_ACLS */

class Comp_creator;
class Item;
class Object_creation_ctx;
class Parser_state;
struct TABLE_LIST;
class THD;
class Table_ident;
struct LEX;

enum enum_mysql_completiontype {
  ROLLBACK_RELEASE=-2, ROLLBACK=1,  ROLLBACK_AND_CHAIN=7,
  COMMIT_RELEASE=-1,   COMMIT=0,    COMMIT_AND_CHAIN=6
};

extern "C" int path_starts_from_data_home_dir(const char *dir);
int test_if_data_home_dir(const char *dir);
int error_if_data_home_dir(const char *path, const char *what);
my_bool net_allocate_new_packet(NET *net, void *thd, uint my_flags);

bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
bool multi_delete_precheck(THD *thd, TABLE_LIST *tables);
int mysql_multi_update_prepare(THD *thd);
int mysql_multi_delete_prepare(THD *thd);
int mysql_insert_select_prepare(THD *thd,select_result *sel_res);
bool update_precheck(THD *thd, TABLE_LIST *tables);
bool delete_precheck(THD *thd, TABLE_LIST *tables);
bool insert_precheck(THD *thd, TABLE_LIST *tables);
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
                           TABLE_LIST *create_table);
bool check_fk_parent_table_access(THD *thd,
                                  HA_CREATE_INFO *create_info,
                                  Alter_info *alter_info,
                                  const char* create_db);

bool parse_sql(THD *thd, Parser_state *parser_state,
               Object_creation_ctx *creation_ctx, bool do_pfs_digest=false);

void free_items(Item *item);
void cleanup_items(Item *item);

Comp_creator *comp_eq_creator(bool invert);
Comp_creator *comp_ge_creator(bool invert);
Comp_creator *comp_gt_creator(bool invert);
Comp_creator *comp_le_creator(bool invert);
Comp_creator *comp_lt_creator(bool invert);
Comp_creator *comp_ne_creator(bool invert);

int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
                         enum enum_schema_tables schema_table_idx);
void get_default_definer(THD *thd, LEX_USER *definer, bool role);
LEX_USER *create_default_definer(THD *thd, bool role);
LEX_USER *create_definer(THD *thd, LEX_CSTRING *user_name, LEX_CSTRING *host_name);
LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock=true);
bool sp_process_definer(THD *thd);
bool check_string_byte_length(const LEX_CSTRING *str, uint err_msg,
                              size_t max_byte_length);
bool check_string_char_length(const LEX_CSTRING *str, uint err_msg,
                              size_t max_char_length, CHARSET_INFO *cs,
                              bool no_error);
bool check_ident_length(const LEX_CSTRING *ident);
CHARSET_INFO* merge_charset_and_collation(CHARSET_INFO *cs, CHARSET_INFO *cl);
CHARSET_INFO *find_bin_collation(CHARSET_INFO *cs);
bool check_host_name(LEX_CSTRING *str);
bool check_identifier_name(LEX_CSTRING *str, uint max_char_length,
                           uint err_code, const char *param_for_err_msg);
bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length);
bool sqlcom_can_generate_row_events(const THD *thd);
bool stmt_causes_implicit_commit(THD *thd, uint mask);
bool is_update_query(enum enum_sql_command command);
bool is_log_table_write_query(enum enum_sql_command command);
bool alloc_query(THD *thd, const char *packet, size_t packet_length);
void mysql_init_select(LEX *lex);
void mysql_parse(THD *thd, char *rawbuf, uint length,
                 Parser_state *parser_state);
bool mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *sel);
void create_select_for_variable(THD *thd, LEX_CSTRING *var_name);
void create_table_set_open_action_and_adjust_tables(LEX *lex);
void mysql_init_multi_delete(LEX *lex);
bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
void create_table_set_open_action_and_adjust_tables(LEX *lex);
int bootstrap(MYSQL_FILE *file);
bool run_set_statement_if_requested(THD *thd, LEX *lex);
int mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt=false);
enum dispatch_command_return
{
  DISPATCH_COMMAND_SUCCESS=0,
  DISPATCH_COMMAND_CLOSE_CONNECTION= 1,
  DISPATCH_COMMAND_WOULDBLOCK= 2
};

dispatch_command_return do_command(THD *thd, bool blocking = true);
dispatch_command_return dispatch_command(enum enum_server_command command, THD *thd,
                                         char* packet, uint packet_length, bool blocking = true);
void log_slow_statement(THD *thd);
bool append_file_to_dir(THD *thd, const char **filename_ptr,
                        const LEX_CSTRING *table_name);
void execute_init_command(THD *thd, LEX_STRING *init_command,
                          mysql_rwlock_t *var_lock);
bool add_to_list(THD *thd, SQL_I_List<ORDER> &list, Item *group, bool asc);
void add_join_on(THD *thd, TABLE_LIST *b, Item *expr);
void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields,
                      SELECT_LEX *lex);
bool add_proc_to_list(THD *thd, Item *item);
bool push_new_name_resolution_context(THD *thd,
                                      TABLE_LIST *left_op,
                                      TABLE_LIST *right_op);
void init_update_queries(void);
Item *normalize_cond(THD *thd, Item *cond);
Item *negate_expression(THD *thd, Item *expr);
bool check_stack_overrun(THD *thd, long margin, uchar *dummy);

/* Variables */

extern const LEX_CSTRING any_db;
extern uint sql_command_flags[];
extern uint server_command_flags[];
extern const LEX_CSTRING command_name[];
extern uint server_command_flags[];

/* Inline functions */
inline bool check_identifier_name(LEX_CSTRING *str, uint err_code)
{
  return check_identifier_name(str, NAME_CHAR_LEN, err_code, "");
}

inline bool check_identifier_name(LEX_CSTRING *str)
{
  return check_identifier_name(str, NAME_CHAR_LEN, 0, "");
}

#ifndef NO_EMBEDDED_ACCESS_CHECKS
bool check_one_table_access(THD *thd, privilege_t privilege, TABLE_LIST *tables);
bool check_single_table_access(THD *thd, privilege_t privilege,
                               TABLE_LIST *tables, bool no_errors);
bool check_routine_access(THD *thd, privilege_t want_access,
                          const LEX_CSTRING *db,
                          const LEX_CSTRING *name,
                          const Sp_handler *sph, bool no_errors);
bool check_some_access(THD *thd, privilege_t want_access, TABLE_LIST *table);
bool check_some_routine_access(THD *thd, const char *db, const char *name,
                               const Sp_handler *sph);
bool check_table_access(THD *thd, privilege_t requirements,TABLE_LIST *tables,
                        bool any_combination_of_privileges_will_do,
                        uint number,
                        bool no_errors);
#else
inline bool check_one_table_access(THD *thd, privilege_t privilege, TABLE_LIST *tables)
{ return false; }
inline bool check_single_table_access(THD *thd, privilege_t privilege,
                                      TABLE_LIST *tables, bool no_errors)
{ return false; }
inline bool check_routine_access(THD *thd, privilege_t want_access,
                                 const LEX_CSTRING *db,
                                 const LEX_CSTRING *name,
                                 const Sp_handler *sph, bool no_errors)
{ return false; }
inline bool check_some_access(THD *thd, privilege_t want_access, TABLE_LIST *table)
{
  table->grant.privilege= want_access;
  return false;
}
inline bool check_some_routine_access(THD *thd, const char *db,
                                      const char *name,
                                      const Sp_handler *sph)
{ return false; }
inline bool
check_table_access(THD *thd, privilege_t requirements,TABLE_LIST *tables,
                   bool any_combination_of_privileges_will_do,
                   uint number,
                   bool no_errors)
{ return false; }
#endif /*NO_EMBEDDED_ACCESS_CHECKS*/

#endif /* SQL_PARSE_INCLUDED */
server/private/sql_cursor.h000064400000004414150400263730012074 0ustar00/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _sql_cursor_h_
#define _sql_cursor_h_

#ifdef USE_PRAGMA_INTERFACE
#pragma interface                              /* gcc class interface */
#endif

#include "sql_class.h"                          /* Query_arena */

class JOIN;

/**
  @file

  Declarations for implementation of server side cursors. Only
  read-only non-scrollable cursors are currently implemented.
*/

/**
  Server_side_cursor -- an interface for materialized
  implementation of cursors. All cursors are self-contained
  (created in their own memory root).  For that reason they must
  be deleted only using a pointer to Server_side_cursor, not to
  its base class.
*/

class Server_side_cursor: protected Query_arena
{
protected:
  /** Row destination used for fetch */
  select_result *result;
public:
  Server_side_cursor(MEM_ROOT *mem_root_arg, select_result *result_arg)
    :Query_arena(mem_root_arg, STMT_INITIALIZED), result(result_arg)
  {}

  virtual bool is_open() const= 0;

  virtual int open(JOIN *top_level_join)= 0;
  virtual void fetch(ulong num_rows)= 0;
  virtual void close()= 0;
  virtual bool export_structure(THD *thd, Row_definition_list *defs)
  {
    DBUG_ASSERT(0);
    return true;
  }
  virtual ~Server_side_cursor();

  static void *operator new(size_t size, MEM_ROOT *mem_root)
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr, size_t size);
  static void operator delete(void *, MEM_ROOT *){}
};


int mysql_open_cursor(THD *thd, select_result *result,
                      Server_side_cursor **res);

#endif /* _sql_cusor_h_ */
server/private/my_default.h000064400000003530150400263730012027 0ustar00/* Copyright (C) 2013 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/* Definitions for mysys/my_default.c */

#ifndef MY_DEFAULT_INCLUDED
#define MY_DEFAULT_INCLUDED

C_MODE_START

extern MYSQL_PLUGIN_IMPORT const char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix;
extern MYSQL_PLUGIN_IMPORT const char *my_defaults_file;
extern my_bool my_defaults_mark_files;

extern int get_defaults_options(char **argv);
extern int my_load_defaults(const char *conf_file, const char **groups,
                            int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups,
                         int *argc, char ***argv);
extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);


/** Simplify load_defaults() common use */
#define load_defaults_or_exit(A, B, C, D) switch (load_defaults(A, B, C, D)) { \
                                          case 0: break; \
                                          case 4: my_end(0); exit(0); \
                                          default: my_end(0); exit(1); }

C_MODE_END

#endif /* MY_DEFAULT_INCLUDED */
server/private/probes_mysql_nodtrace.h000064400000011615150400263730014277 0ustar00/*
 * Generated by dheadgen(1).
 */

#ifndef	_PROBES_MYSQL_D
#define	_PROBES_MYSQL_D

#ifdef	__cplusplus
extern "C" {
#endif

#define	MYSQL_CONNECTION_START(arg0, arg1, arg2)
#define	MYSQL_CONNECTION_START_ENABLED() (0)
#define	MYSQL_CONNECTION_DONE(arg0, arg1)
#define	MYSQL_CONNECTION_DONE_ENABLED() (0)
#define	MYSQL_COMMAND_START(arg0, arg1, arg2, arg3)
#define	MYSQL_COMMAND_START_ENABLED() (0)
#define	MYSQL_COMMAND_DONE(arg0)
#define	MYSQL_COMMAND_DONE_ENABLED() (0)
#define	MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4)
#define	MYSQL_QUERY_START_ENABLED() (0)
#define	MYSQL_QUERY_DONE(arg0)
#define	MYSQL_QUERY_DONE_ENABLED() (0)
#define	MYSQL_QUERY_PARSE_START(arg0)
#define	MYSQL_QUERY_PARSE_START_ENABLED() (0)
#define	MYSQL_QUERY_PARSE_DONE(arg0)
#define	MYSQL_QUERY_PARSE_DONE_ENABLED() (0)
#define	MYSQL_QUERY_CACHE_HIT(arg0, arg1)
#define	MYSQL_QUERY_CACHE_HIT_ENABLED() (0)
#define	MYSQL_QUERY_CACHE_MISS(arg0)
#define	MYSQL_QUERY_CACHE_MISS_ENABLED() (0)
#define	MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5)
#define	MYSQL_QUERY_EXEC_START_ENABLED() (0)
#define	MYSQL_QUERY_EXEC_DONE(arg0)
#define	MYSQL_QUERY_EXEC_DONE_ENABLED() (0)
#define	MYSQL_INSERT_ROW_START(arg0, arg1)
#define	MYSQL_INSERT_ROW_START_ENABLED() (0)
#define	MYSQL_INSERT_ROW_DONE(arg0)
#define	MYSQL_INSERT_ROW_DONE_ENABLED() (0)
#define	MYSQL_UPDATE_ROW_START(arg0, arg1)
#define	MYSQL_UPDATE_ROW_START_ENABLED() (0)
#define	MYSQL_UPDATE_ROW_DONE(arg0)
#define	MYSQL_UPDATE_ROW_DONE_ENABLED() (0)
#define	MYSQL_DELETE_ROW_START(arg0, arg1)
#define	MYSQL_DELETE_ROW_START_ENABLED() (0)
#define	MYSQL_DELETE_ROW_DONE(arg0)
#define	MYSQL_DELETE_ROW_DONE_ENABLED() (0)
#define	MYSQL_READ_ROW_START(arg0, arg1, arg2)
#define	MYSQL_READ_ROW_START_ENABLED() (0)
#define	MYSQL_READ_ROW_DONE(arg0)
#define	MYSQL_READ_ROW_DONE_ENABLED() (0)
#define	MYSQL_INDEX_READ_ROW_START(arg0, arg1)
#define	MYSQL_INDEX_READ_ROW_START_ENABLED() (0)
#define	MYSQL_INDEX_READ_ROW_DONE(arg0)
#define	MYSQL_INDEX_READ_ROW_DONE_ENABLED() (0)
#define	MYSQL_HANDLER_RDLOCK_START(arg0, arg1)
#define	MYSQL_HANDLER_RDLOCK_START_ENABLED() (0)
#define	MYSQL_HANDLER_WRLOCK_START(arg0, arg1)
#define	MYSQL_HANDLER_WRLOCK_START_ENABLED() (0)
#define	MYSQL_HANDLER_UNLOCK_START(arg0, arg1)
#define	MYSQL_HANDLER_UNLOCK_START_ENABLED() (0)
#define	MYSQL_HANDLER_RDLOCK_DONE(arg0)
#define	MYSQL_HANDLER_RDLOCK_DONE_ENABLED() (0)
#define	MYSQL_HANDLER_WRLOCK_DONE(arg0)
#define	MYSQL_HANDLER_WRLOCK_DONE_ENABLED() (0)
#define	MYSQL_HANDLER_UNLOCK_DONE(arg0)
#define	MYSQL_HANDLER_UNLOCK_DONE_ENABLED() (0)
#define	MYSQL_FILESORT_START(arg0, arg1)
#define	MYSQL_FILESORT_START_ENABLED() (0)
#define	MYSQL_FILESORT_DONE(arg0, arg1)
#define	MYSQL_FILESORT_DONE_ENABLED() (0)
#define	MYSQL_SELECT_START(arg0)
#define	MYSQL_SELECT_START_ENABLED() (0)
#define	MYSQL_SELECT_DONE(arg0, arg1)
#define	MYSQL_SELECT_DONE_ENABLED() (0)
#define	MYSQL_INSERT_START(arg0)
#define	MYSQL_INSERT_START_ENABLED() (0)
#define	MYSQL_INSERT_DONE(arg0, arg1)
#define	MYSQL_INSERT_DONE_ENABLED() (0)
#define	MYSQL_INSERT_SELECT_START(arg0)
#define	MYSQL_INSERT_SELECT_START_ENABLED() (0)
#define	MYSQL_INSERT_SELECT_DONE(arg0, arg1)
#define	MYSQL_INSERT_SELECT_DONE_ENABLED() (0)
#define	MYSQL_UPDATE_START(arg0)
#define	MYSQL_UPDATE_START_ENABLED() (0)
#define	MYSQL_UPDATE_DONE(arg0, arg1, arg2)
#define	MYSQL_UPDATE_DONE_ENABLED() (0)
#define	MYSQL_MULTI_UPDATE_START(arg0)
#define	MYSQL_MULTI_UPDATE_START_ENABLED() (0)
#define	MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2)
#define	MYSQL_MULTI_UPDATE_DONE_ENABLED() (0)
#define	MYSQL_DELETE_START(arg0)
#define	MYSQL_DELETE_START_ENABLED() (0)
#define	MYSQL_DELETE_DONE(arg0, arg1)
#define	MYSQL_DELETE_DONE_ENABLED() (0)
#define	MYSQL_MULTI_DELETE_START(arg0)
#define	MYSQL_MULTI_DELETE_START_ENABLED() (0)
#define	MYSQL_MULTI_DELETE_DONE(arg0, arg1)
#define	MYSQL_MULTI_DELETE_DONE_ENABLED() (0)
#define	MYSQL_NET_READ_START()
#define	MYSQL_NET_READ_START_ENABLED() (0)
#define	MYSQL_NET_READ_DONE(arg0, arg1)
#define	MYSQL_NET_READ_DONE_ENABLED() (0)
#define	MYSQL_NET_WRITE_START(arg0)
#define	MYSQL_NET_WRITE_START_ENABLED() (0)
#define	MYSQL_NET_WRITE_DONE(arg0)
#define	MYSQL_NET_WRITE_DONE_ENABLED() (0)
#define	MYSQL_KEYCACHE_READ_START(arg0, arg1, arg2, arg3)
#define	MYSQL_KEYCACHE_READ_START_ENABLED() (0)
#define	MYSQL_KEYCACHE_READ_BLOCK(arg0)
#define	MYSQL_KEYCACHE_READ_BLOCK_ENABLED() (0)
#define	MYSQL_KEYCACHE_READ_HIT()
#define	MYSQL_KEYCACHE_READ_HIT_ENABLED() (0)
#define	MYSQL_KEYCACHE_READ_MISS()
#define	MYSQL_KEYCACHE_READ_MISS_ENABLED() (0)
#define	MYSQL_KEYCACHE_READ_DONE(arg0, arg1)
#define	MYSQL_KEYCACHE_READ_DONE_ENABLED() (0)
#define	MYSQL_KEYCACHE_WRITE_START(arg0, arg1, arg2, arg3)
#define	MYSQL_KEYCACHE_WRITE_START_ENABLED() (0)
#define	MYSQL_KEYCACHE_WRITE_BLOCK(arg0)
#define	MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() (0)
#define	MYSQL_KEYCACHE_WRITE_DONE(arg0, arg1)
#define	MYSQL_KEYCACHE_WRITE_DONE_ENABLED() (0)

#ifdef  __cplusplus
}
#endif

#endif  /* _PROBES_MYSQL_D */
server/private/sql_class.h000064400001012157150400263730011670 0ustar00/*
   Copyright (c) 2009, 2022, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef SQL_CLASS_INCLUDED
#define SQL_CLASS_INCLUDED

/* Classes in mysql */

#include <atomic>
#include "dur_prop.h"
#include <waiting_threads.h>
#include "sql_const.h"
#include "lex_ident.h"
#include <mysql/plugin_audit.h>
#include "log.h"
#include "rpl_tblmap.h"
#include "mdl.h"
#include "field.h"                              // Create_field
#include "opt_trace_context.h"
#include "probes_mysql.h"
#include "sql_locale.h"     /* my_locale_st */
#include "sql_profile.h"    /* PROFILING */
#include "scheduler.h"      /* thd_scheduler */
#include "protocol.h"       /* Protocol_text, Protocol_binary */
#include "violite.h"        /* vio_is_connected */
#include "thr_lock.h"       /* thr_lock_type, THR_LOCK_DATA, THR_LOCK_INFO */
#include "thr_timer.h"
#include "thr_malloc.h"
#include "log_slow.h"       /* LOG_SLOW_DISABLE_... */
#include <my_tree.h>
#include "sql_digest_stream.h"            // sql_digest_state
#include <mysql/psi/mysql_stage.h>
#include <mysql/psi/mysql_statement.h>
#include <mysql/psi/mysql_idle.h>
#include <mysql/psi/mysql_table.h>
#include <mysql_com_server.h>
#include "session_tracker.h"
#include "backup.h"
#include "xa.h"
#include "scope.h"
#include "ddl_log.h"                            /* DDL_LOG_STATE */
#include "ha_handler_stats.h"                    // ha_handler_stats */

extern "C"
void set_thd_stage_info(void *thd,
                        const PSI_stage_info *new_stage,
                        PSI_stage_info *old_stage,
                        const char *calling_func,
                        const char *calling_file,
                        const unsigned int calling_line);

#define THD_STAGE_INFO(thd, stage) \
  (thd)->enter_stage(&stage, __func__, __FILE__, __LINE__)

#include "my_apc.h"
#include "rpl_gtid.h"

#include "wsrep.h"
#include "wsrep_on.h"
#include <inttypes.h>
#ifdef WITH_WSREP
/* wsrep-lib */
#include "wsrep_client_service.h"
#include "wsrep_client_state.h"
#include "wsrep_mutex.h"
#include "wsrep_condition_variable.h"

class Wsrep_applier_service;
enum wsrep_consistency_check_mode {
    NO_CONSISTENCY_CHECK,
    CONSISTENCY_CHECK_DECLARED,
    CONSISTENCY_CHECK_RUNNING,
};
#endif /* WITH_WSREP */

class Reprepare_observer;
class Relay_log_info;
struct rpl_group_info;
class Rpl_filter;
class Query_log_event;
class Load_log_event;
class Log_event_writer;
class sp_rcontext;
class sp_cache;
class Lex_input_stream;
class Parser_state;
class Rows_log_event;
class Sroutine_hash_entry;
class user_var_entry;
struct Trans_binlog_info;
class rpl_io_thread_info;
class rpl_sql_thread_info;
#ifdef HAVE_REPLICATION
struct Slave_info;
#endif

enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
			    DELAY_KEY_WRITE_ALL };
enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT,
                            SLAVE_EXEC_MODE_IDEMPOTENT,
                            SLAVE_EXEC_MODE_LAST_BIT };
enum enum_slave_run_triggers_for_rbr { SLAVE_RUN_TRIGGERS_FOR_RBR_NO,
                                       SLAVE_RUN_TRIGGERS_FOR_RBR_YES,
                                       SLAVE_RUN_TRIGGERS_FOR_RBR_LOGGING,
                                       SLAVE_RUN_TRIGGERS_FOR_RBR_ENFORCE};
enum enum_slave_type_conversions { SLAVE_TYPE_CONVERSIONS_ALL_LOSSY,
                                   SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY};

/*
  COLUMNS_READ:       A column is goind to be read.
  COLUMNS_WRITE:      A column is going to be written to.
  MARK_COLUMNS_READ:  A column is goind to be read.
                      A bit in read set is set to inform handler that the field
                      is to be read. If field list contains duplicates, then
                      thd->dup_field is set to point to the last found
                      duplicate.
  MARK_COLUMNS_WRITE: A column is going to be written to.
                      A bit is set in write set to inform handler that it needs
                      to update this field in write_row and update_row.
*/
enum enum_column_usage
{ COLUMNS_READ, COLUMNS_WRITE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};

static inline bool should_mark_column(enum_column_usage column_usage)
{ return column_usage >= MARK_COLUMNS_READ; }

enum enum_filetype { FILETYPE_CSV, FILETYPE_XML };

enum enum_binlog_row_image {
  /** PKE in the before image and changed columns in the after image */
  BINLOG_ROW_IMAGE_MINIMAL= 0,
  /** Whenever possible, before and after image contain all columns except blobs. */
  BINLOG_ROW_IMAGE_NOBLOB= 1,
  /** All columns in both before and after image. */
  BINLOG_ROW_IMAGE_FULL= 2
};


/* Bits for different SQL modes modes (including ANSI mode) */
#define MODE_REAL_AS_FLOAT              (1ULL << 0)
#define MODE_PIPES_AS_CONCAT            (1ULL << 1)
#define MODE_ANSI_QUOTES                (1ULL << 2)
#define MODE_IGNORE_SPACE               (1ULL << 3)
#define MODE_IGNORE_BAD_TABLE_OPTIONS   (1ULL << 4)
#define MODE_ONLY_FULL_GROUP_BY         (1ULL << 5)
#define MODE_NO_UNSIGNED_SUBTRACTION    (1ULL << 6)
#define MODE_NO_DIR_IN_CREATE           (1ULL << 7)
#define MODE_POSTGRESQL                 (1ULL << 8)
#define MODE_ORACLE                     (1ULL << 9)
#define MODE_MSSQL                      (1ULL << 10)
#define MODE_DB2                        (1ULL << 11)
#define MODE_MAXDB                      (1ULL << 12)
#define MODE_NO_KEY_OPTIONS             (1ULL << 13)
#define MODE_NO_TABLE_OPTIONS           (1ULL << 14)
#define MODE_NO_FIELD_OPTIONS           (1ULL << 15)
#define MODE_MYSQL323                   (1ULL << 16)
#define MODE_MYSQL40                    (1ULL << 17)
#define MODE_ANSI                       (1ULL << 18)
#define MODE_NO_AUTO_VALUE_ON_ZERO      (1ULL << 19)
#define MODE_NO_BACKSLASH_ESCAPES       (1ULL << 20)
#define MODE_STRICT_TRANS_TABLES        (1ULL << 21)
#define MODE_STRICT_ALL_TABLES          (1ULL << 22)
#define MODE_NO_ZERO_IN_DATE            (1ULL << 23)
#define MODE_NO_ZERO_DATE               (1ULL << 24)
#define MODE_INVALID_DATES              (1ULL << 25)
#define MODE_ERROR_FOR_DIVISION_BY_ZERO (1ULL << 26)
#define MODE_TRADITIONAL                (1ULL << 27)
#define MODE_NO_AUTO_CREATE_USER        (1ULL << 28)
#define MODE_HIGH_NOT_PRECEDENCE        (1ULL << 29)
#define MODE_NO_ENGINE_SUBSTITUTION     (1ULL << 30)
#define MODE_PAD_CHAR_TO_FULL_LENGTH    (1ULL << 31)
/* SQL mode bits defined above are common for MariaDB and MySQL */
#define MODE_MASK_MYSQL_COMPATIBLE      0xFFFFFFFFULL
/* The following modes are specific to MariaDB */
#define MODE_EMPTY_STRING_IS_NULL       (1ULL << 32)
#define MODE_SIMULTANEOUS_ASSIGNMENT    (1ULL << 33)
#define MODE_TIME_ROUND_FRACTIONAL      (1ULL << 34)
/* The following modes are specific to MySQL */
#define MODE_MYSQL80_TIME_TRUNCATE_FRACTIONAL (1ULL << 32)


/* Bits for different old style modes */
#define OLD_MODE_NO_DUP_KEY_WARNINGS_WITH_IGNORE	(1 << 0)
#define OLD_MODE_NO_PROGRESS_INFO			(1 << 1)
#define OLD_MODE_ZERO_DATE_TIME_CAST                    (1 << 2)
#define OLD_MODE_UTF8_IS_UTF8MB3      (1 << 3)

extern char internal_table_name[2];
extern char empty_c_string[1];
extern MYSQL_PLUGIN_IMPORT const char **errmesg;

extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd);
extern "C" unsigned long long thd_query_id(const MYSQL_THD thd);
extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen);
extern "C" const char *thd_priv_user(MYSQL_THD thd,  size_t *length);
extern "C" const char *thd_priv_host(MYSQL_THD thd,  size_t *length);
extern "C" const char *thd_user_name(MYSQL_THD thd);
extern "C" const char *thd_client_host(MYSQL_THD thd);
extern "C" const char *thd_client_ip(MYSQL_THD thd);
extern "C" LEX_CSTRING *thd_current_db(MYSQL_THD thd);
extern "C" int thd_current_status(MYSQL_THD thd);
extern "C" enum enum_server_command thd_current_command(MYSQL_THD thd);
extern "C" int thd_double_innodb_cardinality(MYSQL_THD thd);

/**
  @class CSET_STRING
  @brief Character set armed LEX_STRING
*/
class CSET_STRING
{
private:
  LEX_STRING string;
  CHARSET_INFO *cs;
public:
  CSET_STRING() : cs(&my_charset_bin)
  {
    string.str= NULL;
    string.length= 0;
  }
  CSET_STRING(char *str_arg, size_t length_arg, CHARSET_INFO *cs_arg) :
  cs(cs_arg)
  {
    DBUG_ASSERT(cs_arg != NULL);
    string.str= str_arg;
    string.length= length_arg;
  }

  inline char *str() const { return string.str; }
  inline size_t length() const { return string.length; }
  CHARSET_INFO *charset() const { return cs; }

  friend LEX_STRING * thd_query_string (MYSQL_THD thd);
};


class Recreate_info
{
  ha_rows m_records_copied;
  ha_rows m_records_duplicate;
public:
  Recreate_info()
   :m_records_copied(0),
    m_records_duplicate(0)
  { }
  Recreate_info(ha_rows records_copied,
                ha_rows records_duplicate)
   :m_records_copied(records_copied),
    m_records_duplicate(records_duplicate)
  { }
  ha_rows records_copied() const { return m_records_copied; }
  ha_rows records_duplicate() const { return m_records_duplicate; }
  ha_rows records_processed() const
  {
    return m_records_copied + m_records_duplicate;
  }
};


#define TC_HEURISTIC_RECOVER_COMMIT   1
#define TC_HEURISTIC_RECOVER_ROLLBACK 2
extern ulong tc_heuristic_recover;

typedef struct st_user_var_events
{
  user_var_entry *user_var_event;
  char *value;
  size_t length;
  const Type_handler *th;
  uint charset_number;
} BINLOG_USER_VAR_EVENT;

/*
  The COPY_INFO structure is used by INSERT/REPLACE code.
  The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY
  UPDATE code:
    If a row is inserted then the copied variable is incremented.
    If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the
      new data differs from the old one then the copied and the updated
      variables are incremented.
    The touched variable is incremented if a row was touched by the update part
      of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row
      was actually changed or not.
*/
typedef struct st_copy_info {
  ha_rows records;        /**< Number of processed records */
  ha_rows deleted;        /**< Number of deleted records */
  ha_rows updated;        /**< Number of updated records */
  ha_rows copied;         /**< Number of copied records */
  ha_rows accepted_rows;  /**< Number of accepted original rows
                             (same as number of rows in RETURNING) */
  ha_rows error_count;
  ha_rows touched; /* Number of touched records */
  enum enum_duplicates handle_duplicates;
  int escape_char, last_errno;
  bool ignore;
  /* for INSERT ... UPDATE */
  List<Item> *update_fields;
  List<Item> *update_values;
  /* for VIEW ... WITH CHECK OPTION */
  TABLE_LIST *view;
  TABLE_LIST *table_list;                       /* Normal table */
} COPY_INFO;


class Key_part_spec :public Sql_alloc {
public:
  Lex_ident field_name;
  uint length;
  bool generated;
  Key_part_spec(const LEX_CSTRING *name, uint len, bool gen= false)
    : field_name(*name), length(len), generated(gen)
  {}
  bool operator==(const Key_part_spec& other) const;
  /**
    Construct a copy of this Key_part_spec. field_name is copied
    by-pointer as it is known to never change. At the same time
    'length' may be reset in mysql_prepare_create_table, and this
    is why we supply it with a copy.

    @return If out of memory, 0 is returned and an error is set in
    THD.
  */
  Key_part_spec *clone(MEM_ROOT *mem_root) const
  { return new (mem_root) Key_part_spec(*this); }
  bool check_key_for_blob(const class handler *file) const;
  bool check_key_length_for_blob() const;
  bool check_primary_key_for_blob(const class handler *file) const
  {
    return check_key_for_blob(file) || check_key_length_for_blob();
  }
  bool check_foreign_key_for_blob(const class handler *file) const
  {
    return check_key_for_blob(file) || check_key_length_for_blob();
  }
  bool init_multiple_key_for_blob(const class handler *file);
};


class Alter_drop :public Sql_alloc {
public:
  enum drop_type { KEY, COLUMN, FOREIGN_KEY, CHECK_CONSTRAINT, PERIOD };
  const char *name;
  enum drop_type type;
  bool drop_if_exists;
  Alter_drop(enum drop_type par_type,const char *par_name, bool par_exists)
    :name(par_name), type(par_type), drop_if_exists(par_exists)
  {
    DBUG_ASSERT(par_name != NULL);
  }
  /**
    Used to make a clone of this object for ALTER/CREATE TABLE
    @sa comment for Key_part_spec::clone
  */
  Alter_drop *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Alter_drop(*this); }
  const char *type_name()
  {
    return type == COLUMN ? "COLUMN" :
           type == CHECK_CONSTRAINT ? "CONSTRAINT" :
           type == PERIOD ? "PERIOD" :
           type == KEY ? "INDEX" : "FOREIGN KEY";
  }
};


class Alter_column :public Sql_alloc {
public:
  LEX_CSTRING name;
  LEX_CSTRING new_name;
  Virtual_column_info *default_value;
  bool alter_if_exists;
  Alter_column(LEX_CSTRING par_name, Virtual_column_info *expr, bool par_exists)
    :name(par_name), new_name{NULL, 0}, default_value(expr), alter_if_exists(par_exists) {}
  Alter_column(LEX_CSTRING par_name, LEX_CSTRING _new_name, bool exists)
    :name(par_name), new_name(_new_name), default_value(NULL), alter_if_exists(exists) {}
  /**
    Used to make a clone of this object for ALTER/CREATE TABLE
    @sa comment for Key_part_spec::clone
  */
  Alter_column *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Alter_column(*this); }
  bool is_rename()
  {
    DBUG_ASSERT(!new_name.str || !default_value);
    return new_name.str;
  }
};


class Alter_rename_key : public Sql_alloc
{
public:
  LEX_CSTRING old_name;
  LEX_CSTRING new_name;
  bool alter_if_exists;

  Alter_rename_key(LEX_CSTRING old_name_arg, LEX_CSTRING new_name_arg, bool exists)
      : old_name(old_name_arg), new_name(new_name_arg), alter_if_exists(exists) {}

  Alter_rename_key *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Alter_rename_key(*this); }

};


/* An ALTER INDEX operation that changes the ignorability of an index. */
class Alter_index_ignorability: public Sql_alloc
{
public:
  Alter_index_ignorability(const char *name, bool is_ignored, bool if_exists) :
    m_name(name), m_is_ignored(is_ignored), m_if_exists(if_exists)
  {
    assert(name != NULL);
  }

  const char *name() const { return m_name; }
  bool if_exists() const { return m_if_exists; }

  /* The ignorability after the operation is performed. */
  bool is_ignored() const { return m_is_ignored; }
  Alter_index_ignorability *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Alter_index_ignorability(*this); }

private:
  const char *m_name;
  bool m_is_ignored;
  bool m_if_exists;
};


class Key :public Sql_alloc, public DDL_options {
public:
  enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FULLTEXT, SPATIAL, FOREIGN_KEY,
                 IGNORE_KEY};
  enum Keytype type;
  KEY_CREATE_INFO key_create_info;
  List<Key_part_spec> columns;
  LEX_CSTRING name;
  engine_option_value *option_list;
  bool generated;
  bool invisible;
  bool without_overlaps;
  bool old;
  uint length;
  Lex_ident period;

  Key(enum Keytype type_par, const LEX_CSTRING *name_arg,
      ha_key_alg algorithm_arg, bool generated_arg, DDL_options_st ddl_options)
    :DDL_options(ddl_options),
     type(type_par), key_create_info(default_key_create_info),
    name(*name_arg), option_list(NULL), generated(generated_arg),
    invisible(false), without_overlaps(false), old(false), length(0)
  {
    key_create_info.algorithm= algorithm_arg;
  }
  Key(enum Keytype type_par, const LEX_CSTRING *name_arg,
      KEY_CREATE_INFO *key_info_arg,
      bool generated_arg, List<Key_part_spec> *cols,
      engine_option_value *create_opt, DDL_options_st ddl_options)
    :DDL_options(ddl_options),
     type(type_par), key_create_info(*key_info_arg), columns(*cols),
    name(*name_arg), option_list(create_opt), generated(generated_arg),
    invisible(false), without_overlaps(false), old(false), length(0)
  {}
  Key(const Key &rhs, MEM_ROOT *mem_root);
  virtual ~Key() = default;
  /* Equality comparison of keys (ignoring name) */
  friend bool is_foreign_key_prefix(Key *a, Key *b);
  /**
    Used to make a clone of this object for ALTER/CREATE TABLE
    @sa comment for Key_part_spec::clone
  */
  virtual Key *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Key(*this, mem_root); }
};


class Foreign_key: public Key {
public:
  enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL,
		      FK_MATCH_PARTIAL, FK_MATCH_SIMPLE};
  LEX_CSTRING constraint_name;
  LEX_CSTRING ref_db;
  LEX_CSTRING ref_table;
  List<Key_part_spec> ref_columns;
  enum enum_fk_option delete_opt, update_opt;
  enum fk_match_opt match_opt;
  Foreign_key(const LEX_CSTRING *name_arg, List<Key_part_spec> *cols,
              const LEX_CSTRING *constraint_name_arg,
	      const LEX_CSTRING *ref_db_arg, const LEX_CSTRING *ref_table_arg,
              List<Key_part_spec> *ref_cols,
              enum_fk_option delete_opt_arg, enum_fk_option update_opt_arg,
              fk_match_opt match_opt_arg,
	      DDL_options ddl_options)
    :Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols, NULL,
         ddl_options),
    constraint_name(*constraint_name_arg),
    ref_db(*ref_db_arg), ref_table(*ref_table_arg), ref_columns(*ref_cols),
    delete_opt(delete_opt_arg), update_opt(update_opt_arg),
    match_opt(match_opt_arg)
  {
  }
 Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root);
  /**
    Used to make a clone of this object for ALTER/CREATE TABLE
    @sa comment for Key_part_spec::clone
  */
  Key *clone(MEM_ROOT *mem_root) const override
  { return new (mem_root) Foreign_key(*this, mem_root); }
  /* Used to validate foreign key options */
  bool validate(List<Create_field> &table_fields);
};

typedef struct st_mysql_lock
{
  TABLE **table;
  THR_LOCK_DATA **locks;
  uint table_count,lock_count;
  uint flags;
} MYSQL_LOCK;


class LEX_COLUMN : public Sql_alloc
{
public:
  String column;
  privilege_t rights;
  LEX_COLUMN (const String& x,const  privilege_t & y ): column (x),rights (y) {}
};

class MY_LOCALE;

/**
  Query_cache_tls -- query cache thread local data.
*/

struct Query_cache_block;

struct Query_cache_tls
{
  /*
    'first_query_block' should be accessed only via query cache
    functions and methods to maintain proper locking.
  */
  Query_cache_block *first_query_block;
  void set_first_query_block(Query_cache_block *first_query_block_arg)
  {
    first_query_block= first_query_block_arg;
  }

  Query_cache_tls() :first_query_block(NULL) {}
};

/* SIGNAL / RESIGNAL / GET DIAGNOSTICS */

/**
  This enumeration list all the condition item names of a condition in the
  SQL condition area.
*/
typedef enum enum_diag_condition_item_name
{
  /*
    Conditions that can be set by the user (SIGNAL/RESIGNAL),
    and by the server implementation.
  */

  DIAG_CLASS_ORIGIN= 0,
  FIRST_DIAG_SET_PROPERTY= DIAG_CLASS_ORIGIN,
  DIAG_SUBCLASS_ORIGIN= 1,
  DIAG_CONSTRAINT_CATALOG= 2,
  DIAG_CONSTRAINT_SCHEMA= 3,
  DIAG_CONSTRAINT_NAME= 4,
  DIAG_CATALOG_NAME= 5,
  DIAG_SCHEMA_NAME= 6,
  DIAG_TABLE_NAME= 7,
  DIAG_COLUMN_NAME= 8,
  DIAG_CURSOR_NAME= 9,
  DIAG_MESSAGE_TEXT= 10,
  DIAG_MYSQL_ERRNO= 11,
  LAST_DIAG_SET_PROPERTY= DIAG_MYSQL_ERRNO
} Diag_condition_item_name;

/**
  Name of each diagnostic condition item.
  This array is indexed by Diag_condition_item_name.
*/
extern const LEX_CSTRING Diag_condition_item_names[];

/**
  These states are bit coded with HARD. For each state there must be a pair
  <state_even_num>, and <state_odd_num>_HARD.
*/
enum killed_state
{
  NOT_KILLED= 0,
  KILL_HARD_BIT= 1,                             /* Bit for HARD KILL */
  KILL_BAD_DATA= 2,
  KILL_BAD_DATA_HARD= 3,
  KILL_QUERY= 4,
  KILL_QUERY_HARD= 5,
  /*
    ABORT_QUERY signals to the query processor to stop execution ASAP without
    issuing an error. Instead a warning is issued, and when possible a partial
    query result is returned to the client.
  */
  ABORT_QUERY= 6,
  ABORT_QUERY_HARD= 7,
  KILL_TIMEOUT= 8,
  KILL_TIMEOUT_HARD= 9,
  /*
    When binlog reading thread connects to the server it kills
    all the binlog threads with the same ID.
  */
  KILL_SLAVE_SAME_ID= 10,
  /*
    All of the following killed states will kill the connection
    KILL_CONNECTION must be the first of these and it must start with
    an even number (becasue of HARD bit)!
  */
  KILL_CONNECTION= 12,
  KILL_CONNECTION_HARD= 13,
  KILL_SYSTEM_THREAD= 14,
  KILL_SYSTEM_THREAD_HARD= 15,
  KILL_SERVER= 16,
  KILL_SERVER_HARD= 17,
  /*
    Used in threadpool to signal wait timeout.
  */
  KILL_WAIT_TIMEOUT= 18,
  KILL_WAIT_TIMEOUT_HARD= 19

};

#define killed_mask_hard(killed) ((killed_state) ((killed) & ~KILL_HARD_BIT))

enum killed_type
{
  KILL_TYPE_ID,
  KILL_TYPE_USER,
  KILL_TYPE_QUERY
};

#define SECONDS_TO_WAIT_FOR_KILL 2
#define SECONDS_TO_WAIT_FOR_DUMP_THREAD_KILL 10
#if !defined(_WIN32) && defined(HAVE_SELECT)
/* my_sleep() can wait for sub second times */
#define WAIT_FOR_KILL_TRY_TIMES 20
#else
#define WAIT_FOR_KILL_TRY_TIMES 2
#endif

#include "sql_lex.h"				/* Must be here */

class Delayed_insert;
class select_result;
class Time_zone;

#define THD_SENTRY_MAGIC 0xfeedd1ff
#define THD_SENTRY_GONE  0xdeadbeef

#define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC)

typedef struct system_variables
{
  /*
    How dynamically allocated system variables are handled:

    The global_system_variables and max_system_variables are "authoritative"
    They both should have the same 'version' and 'size'.
    When attempting to access a dynamic variable, if the session version
    is out of date, then the session version is updated and realloced if
    neccessary and bytes copied from global to make up for missing data.

    Note that one should use my_bool instead of bool here, as the variables
    are used with my_getopt.c
  */
  ulong dynamic_variables_version;
  char* dynamic_variables_ptr;
  uint dynamic_variables_head;    /* largest valid variable offset */
  uint dynamic_variables_size;    /* how many bytes are in use */
  
  ulonglong max_heap_table_size;
  ulonglong tmp_memory_table_size;
  ulonglong tmp_disk_table_size;
  ulonglong long_query_time;
  ulonglong max_statement_time;
  ulonglong optimizer_switch;
  ulonglong optimizer_trace;
  sql_mode_t sql_mode; ///< which non-standard SQL behaviour should be enabled
  sql_mode_t old_behavior; ///< which old SQL behaviour should be enabled
  ulonglong option_bits; ///< OPTION_xxx constants, e.g. OPTION_PROFILING
  ulonglong join_buff_space_limit;
  ulonglong log_slow_filter; 
  ulonglong log_slow_verbosity; 
  ulonglong log_slow_disabled_statements;
  ulonglong log_disabled_statements;
  ulonglong note_verbosity;
  ulonglong bulk_insert_buff_size;
  ulonglong join_buff_size;
  ulonglong sortbuff_size;
  ulonglong default_regex_flags;
  ulonglong max_mem_used;
  /*
    A bitmap of OPTIMIZER_ADJ_* flags (defined in sql_priv.h).
    See sys_vars.cc:adjust_secondary_key_cost for symbolic names.
  */
  ulonglong optimizer_adjust_secondary_key_costs;

  /**
     Place holders to store Multi-source variables in sys_var.cc during
     update and show of variables.
  */
  ulonglong slave_skip_counter;
  ulonglong max_relay_log_size;

  ha_rows select_limit;
  ha_rows max_join_size;
  ha_rows expensive_subquery_limit;
  ulong auto_increment_increment, auto_increment_offset;
#ifdef WITH_WSREP
  /*
    Stored values of the auto_increment_increment and auto_increment_offset
    that are will be restored when wsrep_auto_increment_control will be set
    to 'OFF', because the setting it to 'ON' leads to overwriting of the
    original values (which are set by the user) by calculated ones (which
    are based on the cluster size):
  */
  ulong saved_auto_increment_increment, saved_auto_increment_offset;
  ulong saved_lock_wait_timeout;
  ulonglong wsrep_gtid_seq_no;
#endif /* WITH_WSREP */
  uint eq_range_index_dive_limit;
  ulong column_compression_zlib_strategy;
  ulong lock_wait_timeout;
  ulong join_cache_level;
  ulong max_allowed_packet;
  ulong max_error_count;
  ulong max_length_for_sort_data;
  ulong max_recursive_iterations;
  ulong max_sort_length;
  ulong max_tmp_tables;
  ulong max_insert_delayed_threads;
  ulong min_examined_row_limit;
  ulong net_buffer_length;
  ulong net_interactive_timeout;
  ulong net_read_timeout;
  ulong net_retry_count;
  ulong net_wait_timeout;
  ulong net_write_timeout;
  ulonglong optimizer_join_limit_pref_ratio;
  ulong optimizer_prune_level;
  ulong optimizer_search_depth;
  ulong optimizer_selectivity_sampling_limit;
  ulong optimizer_use_condition_selectivity;
  ulong optimizer_max_sel_arg_weight;
  ulong optimizer_max_sel_args;
  ulong optimizer_trace_max_mem_size;
  ulong use_stat_tables;
  double sample_percentage;
  ulong histogram_size;
  ulong histogram_type;
  ulong preload_buff_size;
  ulong profiling_history_size;
  ulong read_buff_size;
  ulong read_rnd_buff_size;
  ulong mrr_buff_size;
  ulong div_precincrement;
  /* Total size of all buffers used by the subselect_rowid_merge_engine. */
  ulong rowid_merge_buff_size;
  ulong max_sp_recursion_depth;
  ulong default_week_format;
  ulong max_seeks_for_key;
  ulong range_alloc_block_size;
  ulong query_alloc_block_size;
  ulong query_prealloc_size;
  ulong trans_alloc_block_size;
  ulong trans_prealloc_size;
  ulong log_warnings;
  ulong log_slow_max_warnings;
  /* Flags for slow log filtering */
  ulong log_slow_rate_limit; 
  ulong binlog_format; ///< binlog format for this thd (see enum_binlog_format)
  ulong binlog_row_image;
  ulong progress_report_time;
  ulong completion_type;
  ulong query_cache_type;
  ulong tx_isolation;
  ulong updatable_views_with_limit;
  ulong alter_algorithm;
  int max_user_connections;
  ulong server_id;
  /**
    In slave thread we need to know in behalf of which
    thread the query is being run to replicate temp tables properly
  */
  my_thread_id pseudo_thread_id;
  /**
     When replicating an event group with GTID, keep these values around so
     slave binlog can receive the same GTID as the original.
  */
  uint32     gtid_domain_id;
  uint64     gtid_seq_no;

  uint group_concat_max_len;

  /**
    Default transaction access mode. READ ONLY (true) or READ WRITE (false).
  */
  my_bool tx_read_only;
  my_bool low_priority_updates;
  my_bool query_cache_wlock_invalidate;
  my_bool keep_files_on_create;

  my_bool old_mode;
  my_bool old_passwords;
  my_bool big_tables;
  my_bool only_standard_compliant_cte;
  my_bool query_cache_strip_comments;
  my_bool sql_log_slow;
  my_bool sql_log_bin;
  my_bool binlog_annotate_row_events;
  my_bool binlog_direct_non_trans_update;
  my_bool column_compression_zlib_wrap;

  plugin_ref table_plugin;
  plugin_ref tmp_table_plugin;
  plugin_ref enforced_table_plugin;

  /* Only charset part of these variables is sensible */
  CHARSET_INFO  *character_set_filesystem;
  CHARSET_INFO  *character_set_client;
  CHARSET_INFO  *character_set_results;

  /* Both charset and collation parts of these variables are important */
  CHARSET_INFO	*collation_server;
  CHARSET_INFO	*collation_database;
  CHARSET_INFO  *collation_connection;

  /* Names. These will be allocated in buffers in thd */
  LEX_CSTRING default_master_connection;

  /* Error messages */
  MY_LOCALE *lc_messages;
  const char ***errmsgs;             /* lc_messages->errmsg->errmsgs */

  /* Locale Support */
  MY_LOCALE *lc_time_names;

  Time_zone *time_zone;

  my_bool sysdate_is_now;

  /* deadlock detection */
  ulong wt_timeout_short, wt_deadlock_search_depth_short;
  ulong wt_timeout_long, wt_deadlock_search_depth_long;

  my_bool wsrep_on;
  my_bool wsrep_causal_reads;
  uint    wsrep_sync_wait;
  ulong   wsrep_retry_autocommit;
  ulonglong wsrep_trx_fragment_size;
  ulong   wsrep_trx_fragment_unit;
  ulong   wsrep_OSU_method;
  my_bool wsrep_dirty_reads;
  double long_query_time_double, max_statement_time_double;

  my_bool pseudo_slave_mode;

  char *session_track_system_variables;
  ulong session_track_transaction_info;
  my_bool session_track_schema;
  my_bool session_track_state_change;
#ifdef USER_VAR_TRACKING
  my_bool session_track_user_variables;
#endif // USER_VAR_TRACKING
  my_bool tcp_nodelay;

  ulong threadpool_priority;

  uint idle_transaction_timeout;
  uint idle_readonly_transaction_timeout;
  uint idle_write_transaction_timeout;
  uint column_compression_threshold;
  uint column_compression_zlib_level;
  uint in_subquery_conversion_threshold;

  ulonglong max_rowid_filter_size;

  vers_asof_timestamp_t vers_asof_timestamp;
  ulong vers_alter_history;
} SV;

/**
  Per thread status variables.
  Must be long/ulong up to last_system_status_var so that
  add_to_status/add_diff_to_status can work.
*/

typedef struct system_status_var
{
  ulong column_compressions;
  ulong column_decompressions;
  ulong com_stat[(uint) SQLCOM_END];
  ulong com_create_tmp_table;
  ulong com_drop_tmp_table;
  ulong com_other;

  ulong com_stmt_prepare;
  ulong com_stmt_reprepare;
  ulong com_stmt_execute;
  ulong com_stmt_send_long_data;
  ulong com_stmt_fetch;
  ulong com_stmt_reset;
  ulong com_stmt_close;

  ulong com_register_slave;
  ulong created_tmp_disk_tables_;
  ulong created_tmp_tables_;
  ulong ha_commit_count;
  ulong ha_delete_count;
  ulong ha_read_first_count;
  ulong ha_read_last_count;
  ulong ha_read_key_count;
  ulong ha_read_next_count;
  ulong ha_read_prev_count;
  ulong ha_read_retry_count;
  ulong ha_read_rnd_count;
  ulong ha_read_rnd_next_count;
  ulong ha_read_rnd_deleted_count;

  /*
    This number doesn't include calls to the default implementation and
    calls made by range access. The intent is to count only calls made by
    BatchedKeyAccess.
  */
  ulong ha_mrr_init_count;
  ulong ha_mrr_key_refills_count;
  ulong ha_mrr_rowid_refills_count;

  ulong ha_rollback_count;
  ulong ha_update_count;
  ulong ha_write_count;
  /* The following are for internal temporary tables */
  ulong ha_tmp_update_count;
  ulong ha_tmp_write_count;
  ulong ha_tmp_delete_count;
  ulong ha_prepare_count;
  ulong ha_icp_attempts;
  ulong ha_icp_match;
  ulong ha_discover_count;
  ulong ha_savepoint_count;
  ulong ha_savepoint_rollback_count;
  ulong ha_external_lock_count;

  ulong opened_tables;
  ulong opened_shares;
  ulong opened_views;               /* +1 opening a view */

  ulong select_full_join_count_;
  ulong select_full_range_join_count_;
  ulong select_range_count_;
  ulong select_range_check_count_;
  ulong select_scan_count_;
  ulong update_scan_count;
  ulong delete_scan_count;
  ulong executed_triggers;
  ulong long_query_count;
  ulong filesort_merge_passes_;
  ulong filesort_range_count_;
  ulong filesort_rows_;
  ulong filesort_scan_count_;
  ulong filesort_pq_sorts_;

  /* Features used */
  ulong feature_custom_aggregate_functions; /* +1 when custom aggregate
                                            functions are used */
  ulong feature_dynamic_columns;    /* +1 when creating a dynamic column */
  ulong feature_fulltext;	    /* +1 when MATCH is used */
  ulong feature_gis;                /* +1 opening a table with GIS features */
  ulong feature_invisible_columns;     /* +1 opening a table with invisible column */
  ulong feature_json;		    /* +1 when JSON function appears in the statement */
  ulong feature_locale;		    /* +1 when LOCALE is set */
  ulong feature_subquery;	    /* +1 when subqueries are used */
  ulong feature_system_versioning;  /* +1 opening a table WITH SYSTEM VERSIONING */
  ulong feature_application_time_periods;
                                    /* +1 opening a table with application-time period */
  ulong feature_insert_returning;  /* +1 when INSERT...RETURNING is used */
  ulong feature_timezone;	    /* +1 when XPATH is used */
  ulong feature_trigger;	    /* +1 opening a table with triggers */
  ulong feature_xml;		    /* +1 when XPATH is used */
  ulong feature_window_functions;   /* +1 when window functions are used */

  /* From MASTER_GTID_WAIT usage */
  ulong master_gtid_wait_timeouts;          /* Number of timeouts */
  ulong master_gtid_wait_time;              /* Time in microseconds */
  ulong master_gtid_wait_count;

  ulong empty_queries;
  ulong access_denied_errors;
  ulong lost_connections;
  ulong max_statement_time_exceeded;
  /*
   Number of times where column info was not
   sent with prepared statement metadata.
  */
  ulong skip_metadata_count;

  /*
    Number of statements sent from the client
  */
  ulong questions;
  /*
    IMPORTANT!
    SEE last_system_status_var DEFINITION BELOW.
    Below 'last_system_status_var' are all variables that cannot be handled
    automatically by add_to_status()/add_diff_to_status().
  */
  ulonglong bytes_received;
  ulonglong bytes_sent;
  ulonglong rows_read;
  ulonglong rows_sent;
  ulonglong rows_tmp_read;
  ulonglong binlog_bytes_written;
  ulonglong table_open_cache_hits;
  ulonglong table_open_cache_misses;
  ulonglong table_open_cache_overflows;
  double last_query_cost;
  double cpu_time, busy_time;
  uint32 threads_running;
  /* Don't initialize */
  /* Memory used for thread local storage */
  int64 max_local_memory_used;
  volatile int64 local_memory_used;
  /* Memory allocated for global usage */
  volatile int64 global_memory_used;
} STATUS_VAR;

/*
  This is used for 'SHOW STATUS'. It must be updated to the last ulong
  variable in system_status_var which is makes sense to add to the global
  counter
*/

#define last_system_status_var questions
#define last_cleared_system_status_var local_memory_used

/** Number of contiguous global status variables */
constexpr int COUNT_GLOBAL_STATUS_VARS= int(offsetof(STATUS_VAR,
                                                     last_system_status_var) /
                                            sizeof(ulong)) + 1;

/*
  Global status variables
*/

extern ulong feature_files_opened_with_delayed_keys, feature_check_constraint;

void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var);

void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
                        STATUS_VAR *dec_var);

uint calc_sum_of_all_status(STATUS_VAR *to);
static inline void calc_sum_of_all_status_if_needed(STATUS_VAR *to)
{
  if (to->local_memory_used == 0)
  {
    mysql_mutex_lock(&LOCK_status);
    *to= global_status_var;
    mysql_mutex_unlock(&LOCK_status);
    calc_sum_of_all_status(to);
    DBUG_ASSERT(to->local_memory_used);
  }
}

/*
  Update global_memory_used. We have to do this with atomic_add as the
  global value can change outside of LOCK_status.
*/
static inline void update_global_memory_status(int64 size)
{
  DBUG_PRINT("info", ("global memory_used: %lld  size: %lld",
                      (longlong) global_status_var.global_memory_used,
                      size));
  // workaround for gcc 4.2.4-1ubuntu4 -fPIE (from DEB_BUILD_HARDENING=1)
  int64 volatile * volatile ptr= &global_status_var.global_memory_used;
  my_atomic_add64_explicit(ptr, size, MY_MEMORY_ORDER_RELAXED);
}

/**
  Get collation by name, send error to client on failure.
  @param name     Collation name
  @param name_cs  Character set of the name string
  @return
  @retval         NULL on error
  @retval         Pointter to CHARSET_INFO with the given name on success
*/
static inline CHARSET_INFO *
mysqld_collation_get_by_name(const char *name, myf utf8_flag,
                             CHARSET_INFO *name_cs= system_charset_info)
{
  CHARSET_INFO *cs;
  MY_CHARSET_LOADER loader;
  my_charset_loader_init_mysys(&loader);

  if (!(cs= my_collation_get_by_name(&loader, name, MYF(utf8_flag))))
  {
    ErrConvString err(name, name_cs);
    my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr());
    if (loader.error[0])
      push_warning_printf(current_thd,
                          Sql_condition::WARN_LEVEL_WARN,
                          ER_UNKNOWN_COLLATION, "%s", loader.error);
  }
  return cs;
}

static inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
  return MY_TEST(cs->mbminlen == 1 && cs->number != 17 /* filename */);
}

/** THD registry */
class THD_list_iterator
{
protected:
  I_List<THD> threads;
  mutable mysql_rwlock_t lock;

public:

  /**
    Iterates registered threads.

    @param action      called for every element
    @param argument    opque argument passed to action

    @return
      @retval 0 iteration completed successfully
      @retval 1 iteration was interrupted (action returned 1)
  */
  template <typename T> int iterate(my_bool (*action)(THD *thd, T *arg), T *arg= 0)
  {
    int res= 0;
    mysql_rwlock_rdlock(&lock);
    I_List_iterator<THD> it(threads);
    while (auto tmp= it++)
      if ((res= action(tmp, arg)))
        break;
    mysql_rwlock_unlock(&lock);
    return res;
  }
  static THD_list_iterator *iterator();
};

/**
  A counter of THDs

  It must be specified as a first base class of THD, so that increment is
  done before any other THD constructors and decrement - after any other THD
  destructors.

  Destructor unblocks close_conneciton() if there are no more THD's left.
*/
struct THD_count
{
  static Atomic_counter<uint32_t> count;
  static uint value() { return static_cast<uint>(count); }
  static uint connection_thd_count();
  THD_count() { count++; }
  ~THD_count() { count--; }
};

#ifdef MYSQL_SERVER

void free_tmp_table(THD *thd, TABLE *entry);


/* The following macro is to make init of Query_arena simpler */
#ifdef DBUG_ASSERT_EXISTS
#define INIT_ARENA_DBUG_INFO is_backup_arena= 0; is_reprepared= FALSE;
#else
#define INIT_ARENA_DBUG_INFO
#endif

class Query_arena
{
public:
  /*
    List of items created in the parser for this query. Every item puts
    itself to the list on creation (see Item::Item() for details))
  */
  Item *free_list;
  MEM_ROOT *mem_root;                   // Pointer to current memroot
#ifdef DBUG_ASSERT_EXISTS
  bool is_backup_arena; /* True if this arena is used for backup. */
  bool is_reprepared;
#endif
  /*
    The states relfects three diffrent life cycles for three
    different types of statements:
    Prepared statement: STMT_INITIALIZED -> STMT_PREPARED -> STMT_EXECUTED.
    Stored procedure:   STMT_INITIALIZED_FOR_SP -> STMT_EXECUTED.
    Other statements:   STMT_CONVENTIONAL_EXECUTION never changes.

    Special case for stored procedure arguments: STMT_SP_QUERY_ARGUMENTS
                        This state never changes and used for objects
                        whose lifetime is whole duration of function call
                        (sp_rcontext, it's tables and items. etc). Such objects
                        should be deallocated after every execution of a stored
                        routine. Caller's arena/memroot can't be used for
                        placing such objects since memory allocated on caller's
                        arena not freed until termination of user's session.
  */
  enum enum_state
  {
    STMT_INITIALIZED= 0, STMT_INITIALIZED_FOR_SP= 1, STMT_PREPARED= 2,
    STMT_CONVENTIONAL_EXECUTION= 3, STMT_EXECUTED= 4,
    STMT_SP_QUERY_ARGUMENTS= 5, STMT_ERROR= -1
  };

  enum_state state;

public:
  /* We build without RTTI, so dynamic_cast can't be used. */
  enum Type
  {
    STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE
  };

  Query_arena(MEM_ROOT *mem_root_arg, enum enum_state state_arg) :
    free_list(0), mem_root(mem_root_arg), state(state_arg)
  { INIT_ARENA_DBUG_INFO; }
  /*
    This constructor is used only when Query_arena is created as
    backup storage for another instance of Query_arena.
  */
  Query_arena() { INIT_ARENA_DBUG_INFO; }

  virtual Type type() const;
  virtual ~Query_arena() = default;

  inline bool is_stmt_prepare() const { return state == STMT_INITIALIZED; }
  inline bool is_stmt_prepare_or_first_sp_execute() const
  { return (int)state < (int)STMT_PREPARED; }
  inline bool is_stmt_prepare_or_first_stmt_execute() const
  { return (int)state <= (int)STMT_PREPARED; }
  inline bool is_stmt_execute() const
  { return state == STMT_PREPARED || state == STMT_EXECUTED; }
  inline bool is_conventional() const
  { return state == STMT_CONVENTIONAL_EXECUTION; }

  inline void* alloc(size_t size) { return alloc_root(mem_root,size); }
  inline void* calloc(size_t size)
  {
    void *ptr;
    if (likely((ptr=alloc_root(mem_root,size))))
      bzero(ptr, size);
    return ptr;
  }
  inline char *strdup(const char *str)
  { return strdup_root(mem_root,str); }
  inline char *strmake(const char *str, size_t size)
  { return strmake_root(mem_root,str,size); }
  inline void *memdup(const void *str, size_t size)
  { return memdup_root(mem_root,str,size); }
  inline void *memdup_w_gap(const void *str, size_t size, size_t gap)
  {
    void *ptr;
    if (likely((ptr= alloc_root(mem_root,size+gap))))
      memcpy(ptr,str,size);
    return ptr;
  }

  void set_query_arena(Query_arena *set);

  void free_items();
  /* Close the active state associated with execution of this statement */
  virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/);
};


class Query_arena_memroot: public Query_arena, public Sql_alloc
{
public:
  Query_arena_memroot(MEM_ROOT *mem_root_arg, enum enum_state state_arg) :
    Query_arena(mem_root_arg, state_arg)
  {}
  Query_arena_memroot() : Query_arena()
  {}

  virtual ~Query_arena_memroot() = default;
};


class Query_arena_stmt
{
  THD *thd;
  Query_arena backup;
  Query_arena *arena;

public:
  Query_arena_stmt(THD *_thd);
  ~Query_arena_stmt();
  bool arena_replaced()
  {
    return arena != NULL;
  }
};


class Server_side_cursor;

/*
  Struct to catch changes in column metadata that is sent to client. 
  in the "result set metadata". Used to support 
  MARIADB_CLIENT_CACHE_METADATA.
*/
struct send_column_info_state
{
  /* Last client charset (affects metadata) */
  CHARSET_INFO *last_charset= nullptr;

  /* Checksum, only used to check changes if 'immutable' is false*/
  uint32 checksum= 0;

  /*
    Column info can only be changed by PreparedStatement::reprepare()
 
    There is a class of "weird" prepared statements like SELECT ? or SELECT @a
    that are not immutable, and depend on input parameters or user variables
  */
  bool immutable= false;

  bool initialized= false;

  /*  Used by PreparedStatement::reprepare()*/
  void reset()
  {
    initialized= false;
    checksum= 0;
  }
};


/**
  @class Statement
  @brief State of a single command executed against this connection.

  One connection can contain a lot of simultaneously running statements,
  some of which could be:
   - prepared, that is, contain placeholders,
   - opened as cursors. We maintain 1 to 1 relationship between
     statement and cursor - if user wants to create another cursor for his
     query, we create another statement for it.
  To perform some action with statement we reset THD part to the state  of
  that statement, do the action, and then save back modified state from THD
  to the statement. It will be changed in near future, and Statement will
  be used explicitly.
*/

class Statement: public ilink, public Query_arena
{
  Statement(const Statement &rhs);              /* not implemented: */
  Statement &operator=(const Statement &rhs);   /* non-copyable */
public:
  /*
    Uniquely identifies each statement object in thread scope; change during
    statement lifetime. FIXME: must be const
  */
   ulong id;

  enum enum_column_usage column_usage;

  LEX_CSTRING name; /* name for named prepared statements */
  LEX *lex;                                     // parse tree descriptor
  my_hrtime_t hr_prepare_time; // time of preparation in microseconds
  /*
    Points to the query associated with this statement. It's const, but
    we need to declare it char * because all table handlers are written
    in C and need to point to it.

    Note that if we set query = NULL, we must at the same time set
    query_length = 0, and protect the whole operation with
    LOCK_thd_data mutex. To avoid crashes in races, if we do not
    know that thd->query cannot change at the moment, we should print
    thd->query like this:
      (1) reserve the LOCK_thd_data mutex;
      (2) print or copy the value of query and query_length
      (3) release LOCK_thd_data mutex.
    This printing is needed at least in SHOW PROCESSLIST and SHOW
    ENGINE INNODB STATUS.
  */
  CSET_STRING query_string;
  /*
    If opt_query_cache_strip_comments is set, this contains query without
    comments. If not set, it contains pointer to query_string.
  */
  String base_query;


  inline char *query() const { return query_string.str(); }
  inline uint32 query_length() const
  {
    return static_cast<uint32>(query_string.length());
  }
  inline char *query_end() const
  {
    return query_string.str() + query_string.length();
  }
  CHARSET_INFO *query_charset() const { return query_string.charset(); }
  void set_query_inner(const CSET_STRING &string_arg)
  {
    query_string= string_arg;
  }
  void set_query_inner(char *query_arg, uint32 query_length_arg,
                       CHARSET_INFO *cs_arg)
  {
    set_query_inner(CSET_STRING(query_arg, query_length_arg, cs_arg));
  }
  void reset_query_inner()
  {
    set_query_inner(CSET_STRING());
  }
  /**
    Name of the current (default) database.

    If there is the current (default) database, "db.str" contains its name. If
    there is no current (default) database, "db.str" is NULL and "db.length" is
    0. In other words, db must either be NULL, or contain a
    valid database name.
  */

  LEX_CSTRING db;

  send_column_info_state column_info_state;
 
  /* This is set to 1 of last call to send_result_to_client() was ok */
  my_bool query_cache_is_applicable;

  /* This constructor is called for backup statements */
  Statement() = default;

  Statement(LEX *lex_arg, MEM_ROOT *mem_root_arg,
            enum enum_state state_arg, ulong id_arg);
  virtual ~Statement();

  /* Assign execution context (note: not all members) of given stmt to self */
  virtual void set_statement(Statement *stmt);
  void set_n_backup_statement(Statement *stmt, Statement *backup);
  void restore_backup_statement(Statement *stmt, Statement *backup);
  /* return class type */
  Type type() const override;
};


/**
  Container for all statements created/used in a connection.
  Statements in Statement_map have unique Statement::id (guaranteed by id
  assignment in Statement::Statement)
  Non-empty statement names are unique too: attempt to insert a new statement
  with duplicate name causes older statement to be deleted

  Statements are auto-deleted when they are removed from the map and when the
  map is deleted.
*/

class Statement_map
{
public:
  Statement_map();

  int insert(THD *thd, Statement *statement);

  Statement *find_by_name(const LEX_CSTRING *name)
  {
    Statement *stmt;
    stmt= (Statement*)my_hash_search(&names_hash, (uchar*)name->str,
                                     name->length);
    return stmt;
  }

  Statement *find(ulong id)
  {
    if (last_found_statement == 0 || id != last_found_statement->id)
    {
      Statement *stmt;
      stmt= (Statement *) my_hash_search(&st_hash, (uchar *) &id, sizeof(id));
      if (stmt && stmt->name.str)
        return NULL;
      last_found_statement= stmt;
    }
    return last_found_statement;
  }
  /*
    Close all cursors of this connection that use tables of a storage
    engine that has transaction-specific state and therefore can not
    survive COMMIT or ROLLBACK. Currently all but MyISAM cursors are closed.
  */
  void close_transient_cursors();
  void erase(Statement *statement);
  /* Erase all statements (calls Statement destructor) */
  void reset();
  ~Statement_map();
private:
  HASH st_hash;
  HASH names_hash;
  I_List<Statement> transient_cursor_list;
  Statement *last_found_statement;
};

struct st_savepoint {
  struct st_savepoint *prev;
  char                *name;
  uint                 length;
  Ha_trx_info         *ha_list;
  /** State of metadata locks before this savepoint was set. */
  MDL_savepoint        mdl_savepoint;
};

/**
  @class Security_context
  @brief A set of THD members describing the current authenticated user.
*/

class Security_context {
public:
  Security_context()
   :master_access(NO_ACL),
    db_access(NO_ACL)
  {}                      /* Remove gcc warning */
  /*
    host - host of the client
    user - user of the client, set to NULL until the user has been read from
    the connection
    priv_user - The user privilege we are using. May be "" for anonymous user.
    ip - client IP
  */
  const char *host;
  const char *user, *ip;
  char   priv_user[USERNAME_LENGTH];
  char   proxy_user[USERNAME_LENGTH + MAX_HOSTNAME + 5];
  /* The host privilege we are using */
  char   priv_host[MAX_HOSTNAME];
  /* The role privilege we are using */
  char   priv_role[USERNAME_LENGTH];
  /* The external user (if available) */
  char   *external_user;
  /* points to host if host is available, otherwise points to ip */
  const char *host_or_ip;
  privilege_t master_access;            /* Global privileges from mysql.user */
  privilege_t db_access;                /* Privileges for current db */

  bool password_expired;

  void init();
  void destroy();
  void skip_grants();
  inline char *priv_host_name()
  {
    return (*priv_host ? priv_host : (char *)"%");
  }

  bool set_user(char *user_arg);

#ifndef NO_EMBEDDED_ACCESS_CHECKS
  bool
  change_security_context(THD *thd,
                          LEX_CSTRING *definer_user,
                          LEX_CSTRING *definer_host,
                          LEX_CSTRING *db,
                          Security_context **backup);

  void
  restore_security_context(THD *thd, Security_context *backup);
#endif
  bool user_matches(Security_context *);
  /**
    Check global access
    @param want_access The required privileges
    @param match_any if the security context must match all or any of the req.
   *                 privileges.
    @return True if the security context fulfills the access requirements.
  */
  bool check_access(const privilege_t want_access, bool match_any = false);
  bool is_priv_user(const char *user, const char *host);
  bool is_user_defined() const
    { return user && user != delayed_user && user != slave_user; };
};


/**
  A registry for item tree transformations performed during
  query optimization. We register only those changes which require
  a rollback to re-execute a prepared statement or stored procedure
  yet another time.
*/

struct Item_change_record;
class Item_change_list
{
  I_List<Item_change_record> change_list;
public:
  void nocheck_register_item_tree_change(Item **place, Item *old_value,
                                         MEM_ROOT *runtime_memroot);
  void check_and_register_item_tree_change(Item **place, Item **new_value,
                                           MEM_ROOT *runtime_memroot);
  void rollback_item_tree_changes();
  void move_elements_to(Item_change_list *to)
  {
    change_list.move_elements_to(&to->change_list);
  }
  bool is_empty() { return change_list.is_empty(); }
};


class Item_change_list_savepoint: public Item_change_list
{
public:
  Item_change_list_savepoint(Item_change_list *list)
  {
    list->move_elements_to(this);
  }
  void rollback(Item_change_list *list)
  {
    list->rollback_item_tree_changes();
    move_elements_to(list);
  }
  ~Item_change_list_savepoint()
  {
    DBUG_ASSERT(is_empty());
  }
};


/**
  Type of locked tables mode.
  See comment for THD::locked_tables_mode for complete description.
*/

enum enum_locked_tables_mode
{
  LTM_NONE= 0,
  LTM_LOCK_TABLES,
  LTM_PRELOCKED,
  LTM_PRELOCKED_UNDER_LOCK_TABLES,
  LTM_always_last
};

/**
  The following structure is an extension to TABLE_SHARE and is
  exclusively for temporary tables.

  @note:
  Although, TDC_element has data members (like next, prev &
  all_tables) to store the list of TABLE_SHARE & TABLE objects
  related to a particular TABLE_SHARE, they cannot be moved to
  TABLE_SHARE in order to be reused for temporary tables. This
  is because, as concurrent threads iterating through hash of
  TDC_element's may need access to all_tables, but if all_tables
  is made part of TABLE_SHARE, then TDC_element->share->all_tables
  is not always guaranteed to be valid, as TDC_element can live
  longer than TABLE_SHARE.
*/
struct TMP_TABLE_SHARE : public TABLE_SHARE
{
private:
  /*
   Link to all temporary table shares. Declared as private to
   avoid direct manipulation with those objects. One should
   use methods of I_P_List template instead.
  */
  TMP_TABLE_SHARE *tmp_next;
  TMP_TABLE_SHARE **tmp_prev;

  friend struct All_tmp_table_shares;

public:
  /*
    Doubly-linked (back-linked) lists of used and unused TABLE objects
    for this share.
  */
  All_share_tables_list all_tmp_tables;
};

/**
  Helper class which specifies which members of TMP_TABLE_SHARE are
  used for participation in the list of temporary tables.
*/

struct All_tmp_table_shares
{
  static inline TMP_TABLE_SHARE **next_ptr(TMP_TABLE_SHARE *l)
  {
    return &l->tmp_next;
  }
  static inline TMP_TABLE_SHARE ***prev_ptr(TMP_TABLE_SHARE *l)
  {
    return &l->tmp_prev;
  }
};

/* Also used in rpl_rli.h. */
typedef I_P_List <TMP_TABLE_SHARE, All_tmp_table_shares> All_tmp_tables_list;

/**
  Class that holds information about tables which were opened and locked
  by the thread. It is also used to save/restore this information in
  push_open_tables_state()/pop_open_tables_state().
*/

class Open_tables_state
{
public:
  /**
    As part of class THD, this member is set during execution
    of a prepared statement. When it is set, it is used
    by the locking subsystem to report a change in table metadata.

    When Open_tables_state part of THD is reset to open
    a system or INFORMATION_SCHEMA table, the member is cleared
    to avoid spurious ER_NEED_REPREPARE errors -- system and
    INFORMATION_SCHEMA tables are not subject to metadata version
    tracking.
    @sa check_and_update_table_version()
  */
  Reprepare_observer *m_reprepare_observer;

  /**
    List of regular tables in use by this thread. Contains temporary and
    base tables that were opened with @see open_tables().
  */
  TABLE *open_tables;

  /**
    A list of temporary tables used by this thread. This includes
    user-level temporary tables, created with CREATE TEMPORARY TABLE,
    and internal temporary tables, created, e.g., to resolve a SELECT,
    or for an intermediate table used in ALTER.
  */
  All_tmp_tables_list *temporary_tables;

  /*
    Derived tables.
  */
  TABLE *derived_tables;

  /* 
    Temporary tables created for recursive table references.
  */
  TABLE *rec_tables;

  /*
    During a MySQL session, one can lock tables in two modes: automatic
    or manual. In automatic mode all necessary tables are locked just before
    statement execution, and all acquired locks are stored in 'lock'
    member. Unlocking takes place automatically as well, when the
    statement ends.
    Manual mode comes into play when a user issues a 'LOCK TABLES'
    statement. In this mode the user can only use the locked tables.
    Trying to use any other tables will give an error.
    The locked tables are also stored in this member, however,
    thd->locked_tables_mode is turned on.  Manual locking is described in
    the 'LOCK_TABLES' chapter of the MySQL manual.
    See also lock_tables() for details.
  */
  MYSQL_LOCK *lock;

  /*
    CREATE-SELECT keeps an extra lock for the table being
    created. This field is used to keep the extra lock available for
    lower level routines, which would otherwise miss that lock.
   */
  MYSQL_LOCK *extra_lock;

  /*
    Enum enum_locked_tables_mode and locked_tables_mode member are
    used to indicate whether the so-called "locked tables mode" is on,
    and what kind of mode is active.

    Locked tables mode is used when it's necessary to open and
    lock many tables at once, for usage across multiple
    (sub-)statements.
    This may be necessary either for queries that use stored functions
    and triggers, in which case the statements inside functions and
    triggers may be executed many times, or for implementation of
    LOCK TABLES, in which case the opened tables are reused by all
    subsequent statements until a call to UNLOCK TABLES.

    The kind of locked tables mode employed for stored functions and
    triggers is also called "prelocked mode".
    In this mode, first open_tables() call to open the tables used
    in a statement analyses all functions used by the statement
    and adds all indirectly used tables to the list of tables to
    open and lock.
    It also marks the parse tree of the statement as requiring
    prelocking. After that, lock_tables() locks the entire list
    of tables and changes THD::locked_tables_modeto LTM_PRELOCKED.
    All statements executed inside functions or triggers
    use the prelocked tables, instead of opening their own ones.
    Prelocked mode is turned off automatically once close_thread_tables()
    of the main statement is called.
  */
  enum enum_locked_tables_mode locked_tables_mode;
  uint current_tablenr;

  enum enum_flags {
    BACKUPS_AVAIL = (1U << 0)     /* There are backups available */
  };

  /*
    Flags with information about the open tables state.
  */
  uint state_flags;
  /**
     This constructor initializes Open_tables_state instance which can only
     be used as backup storage. To prepare Open_tables_state instance for
     operations which open/lock/close tables (e.g. open_table()) one has to
     call init_open_tables_state().
  */
  Open_tables_state() : state_flags(0U) { }

  void set_open_tables_state(Open_tables_state *state)
  {
    *this= *state;
  }

  void reset_open_tables_state(THD *thd)
  {
    open_tables= 0;
    temporary_tables= 0;
    derived_tables= 0;
    rec_tables= 0;
    extra_lock= 0;
    lock= 0;
    locked_tables_mode= LTM_NONE;
    state_flags= 0U;
    m_reprepare_observer= NULL;
  }
};


/**
  Storage for backup of Open_tables_state. Must
  be used only to open system tables (TABLE_CATEGORY_SYSTEM
  and TABLE_CATEGORY_LOG).
*/

class Open_tables_backup: public Open_tables_state
{
public:
  /**
    When we backup the open tables state to open a system
    table or tables, we want to save state of metadata
    locks which were acquired before the backup. It is used
    to release metadata locks on system tables after they are
    no longer used.
  */
  MDL_savepoint mdl_system_tables_svp;
};

/**
  @class Sub_statement_state
  @brief Used to save context when executing a function or trigger

  operations on stat tables aren't technically a sub-statement, but they are
  similar in a sense that they cannot change the transaction status.
*/

/* Defines used for Sub_statement_state::in_sub_stmt */

#define SUB_STMT_TRIGGER 1
#define SUB_STMT_FUNCTION 2
#define SUB_STMT_STAT_TABLES 4


class Sub_statement_state
{
public:
  Discrete_interval auto_inc_interval_for_cur_row;
  Discrete_intervals_list auto_inc_intervals_forced;
  SAVEPOINT *savepoints;
  ulonglong option_bits;
  ulonglong first_successful_insert_id_in_prev_stmt;
  ulonglong first_successful_insert_id_in_cur_stmt, insert_id_for_cur_row;
  ulonglong limit_found_rows;
  ulonglong tmp_tables_size;
  ulonglong client_capabilities;
  ulonglong cuted_fields, sent_row_count, examined_row_count;
  ulonglong affected_rows;
  ulonglong bytes_sent_old;
  ha_handler_stats handler_stats;
  ulong     tmp_tables_used;
  ulong     tmp_tables_disk_used;
  ulong     query_plan_fsort_passes;
  ulong query_plan_flags; 
  uint in_sub_stmt;    /* 0,  SUB_STMT_TRIGGER or SUB_STMT_FUNCTION */
  bool enable_slow_log;
  bool last_insert_id_used;
  enum enum_check_fields count_cuted_fields;
};


/* Flags for the THD::system_thread variable */
enum enum_thread_type
{
  NON_SYSTEM_THREAD= 0,
  SYSTEM_THREAD_DELAYED_INSERT= 1,
  SYSTEM_THREAD_SLAVE_IO= 2,
  SYSTEM_THREAD_SLAVE_SQL= 4,
  SYSTEM_THREAD_EVENT_SCHEDULER= 8,
  SYSTEM_THREAD_EVENT_WORKER= 16,
  SYSTEM_THREAD_BINLOG_BACKGROUND= 32,
  SYSTEM_THREAD_SLAVE_BACKGROUND= 64,
  SYSTEM_THREAD_GENERIC= 128,
  SYSTEM_THREAD_SEMISYNC_MASTER_BACKGROUND= 256
};

inline char const *
show_system_thread(enum_thread_type thread)
{
#define RETURN_NAME_AS_STRING(NAME) case (NAME): return #NAME
  switch (thread) {
    static char buf[64];
    RETURN_NAME_AS_STRING(NON_SYSTEM_THREAD);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_DELAYED_INSERT);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_IO);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_SQL);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_SCHEDULER);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_WORKER);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_BACKGROUND);
    RETURN_NAME_AS_STRING(SYSTEM_THREAD_SEMISYNC_MASTER_BACKGROUND);
  default:
    snprintf(buf, sizeof(buf), "<UNKNOWN SYSTEM THREAD: %d>", thread);
    return buf;
  }
#undef RETURN_NAME_AS_STRING
}

/**
  This class represents the interface for internal error handlers.
  Internal error handlers are exception handlers used by the server
  implementation.
*/

class Internal_error_handler
{
protected:
  Internal_error_handler() :
    m_prev_internal_handler(NULL)
  {}

  virtual ~Internal_error_handler() = default;

public:
  /**
    Handle a sql condition.
    This method can be implemented by a subclass to achieve any of the
    following:
    - mask a warning/error internally, prevent exposing it to the user,
    - mask a warning/error and throw another one instead.
    When this method returns true, the sql condition is considered
    'handled', and will not be propagated to upper layers.
    It is the responsability of the code installing an internal handler
    to then check for trapped conditions, and implement logic to recover
    from the anticipated conditions trapped during runtime.

    This mechanism is similar to C++ try/throw/catch:
    - 'try' correspond to <code>THD::push_internal_handler()</code>,
    - 'throw' correspond to <code>my_error()</code>,
    which invokes <code>my_message_sql()</code>,
    - 'catch' correspond to checking how/if an internal handler was invoked,
    before removing it from the exception stack with
    <code>THD::pop_internal_handler()</code>.

    @param thd the calling thread
    @param cond the condition raised.
    @return true if the condition is handled
  */
  virtual bool handle_condition(THD *thd,
                                uint sql_errno,
                                const char* sqlstate,
                                Sql_condition::enum_warning_level *level,
                                const char* msg,
                                Sql_condition ** cond_hdl) = 0;

private:
  Internal_error_handler *m_prev_internal_handler;
  friend class THD;
};


/**
  Implements the trivial error handler which cancels all error states
  and prevents an SQLSTATE to be set.
  Remembers the first error
*/

class Dummy_error_handler : public Internal_error_handler
{
  uint m_unhandled_errors;
  uint first_error;
public:
  Dummy_error_handler()
    : m_unhandled_errors(0), first_error(0)
  {}
  bool handle_condition(THD *thd,
                        uint sql_errno,
                        const char* sqlstate,
                        Sql_condition::enum_warning_level *level,
                        const char* msg,
                        Sql_condition ** cond_hdl) override
  {
    m_unhandled_errors++;
    if (!first_error)
      first_error= sql_errno;
    return TRUE;                                // Ignore error
  }
  bool any_error() { return m_unhandled_errors != 0; }
  uint got_error() { return first_error; }
};

/**
  Implements the trivial error handler which counts errors as they happen.
*/

class Counting_error_handler : public Internal_error_handler
{
public:
  int errors;
  bool handle_condition(THD *thd,
                        uint sql_errno,
                        const char* sqlstate,
                        Sql_condition::enum_warning_level *level,
                        const char* msg,
                        Sql_condition ** cond_hdl) override
  {
    if (*level == Sql_condition::WARN_LEVEL_ERROR)
      errors++;
    return false;
  }
  Counting_error_handler() : errors(0) {}
};


/**
  This class is an internal error handler implementation for
  DROP TABLE statements. The thing is that there may be warnings during
  execution of these statements, which should not be exposed to the user.
  This class is intended to silence such warnings.
*/

class Drop_table_error_handler : public Internal_error_handler
{
public:
  Drop_table_error_handler() = default;

public:
  bool handle_condition(THD *thd,
                        uint sql_errno,
                        const char* sqlstate,
                        Sql_condition::enum_warning_level *level,
                        const char* msg,
                        Sql_condition ** cond_hdl) override;

private:
};


/**
  Internal error handler to process an error from MDL_context::upgrade_lock()
  and mysql_lock_tables(). Used by implementations of HANDLER READ and
  LOCK TABLES LOCAL.
*/

class MDL_deadlock_and_lock_abort_error_handler: public Internal_error_handler
{
public:
  virtual
  bool handle_condition(THD *thd,
                        uint sql_errno,
                        const char *sqlstate,
                        Sql_condition::enum_warning_level *level,
                        const char* msg,
                        Sql_condition **cond_hdl) override;

  bool need_reopen() const { return m_need_reopen; };
  void init() { m_need_reopen= FALSE; };
private:
  bool m_need_reopen;
};


class Turn_errors_to_warnings_handler : public Internal_error_handler
{
public:
  Turn_errors_to_warnings_handler() = default;
  bool handle_condition(THD *,
                        uint,
                        const char*,
                        Sql_condition::enum_warning_level *level,
                        const char*,
                        Sql_condition ** cond_hdl) override
  {
    *cond_hdl= NULL;
    if (*level == Sql_condition::WARN_LEVEL_ERROR)
      *level= Sql_condition::WARN_LEVEL_WARN;
    return(0);
  }
};


struct Suppress_warnings_error_handler : public Internal_error_handler
{
  bool handle_condition(THD *,
                        uint,
                        const char *,
                        Sql_condition::enum_warning_level *level,
                        const char *,
                        Sql_condition **) override
  {
    return *level == Sql_condition::WARN_LEVEL_WARN;
  }
};



/**
  Tables that were locked with LOCK TABLES statement.

  Encapsulates a list of TABLE_LIST instances for tables
  locked by LOCK TABLES statement, memory root for metadata locks,
  and, generally, the context of LOCK TABLES statement.

  In LOCK TABLES mode, the locked tables are kept open between
  statements.
  Therefore, we can't allocate metadata locks on execution memory
  root -- as well as tables, the locks need to stay around till
  UNLOCK TABLES is called.
  The locks are allocated in the memory root encapsulated in this
  class.

  Some SQL commands, like FLUSH TABLE or ALTER TABLE, demand that
  the tables they operate on are closed, at least temporarily.
  This class encapsulates a list of TABLE_LIST instances, one
  for each base table from LOCK TABLES list,
  which helps conveniently close the TABLEs when it's necessary
  and later reopen them.

  Implemented in sql_base.cc
*/

class Locked_tables_list
{
public:
  MEM_ROOT m_locked_tables_root;
private:
  TABLE_LIST *m_locked_tables;
  TABLE_LIST **m_locked_tables_last;
  /** An auxiliary array used only in reopen_tables(). */
  TABLE_LIST **m_reopen_array;
  /**
    Count the number of tables in m_locked_tables list. We can't
    rely on thd->lock->table_count because it excludes
    non-transactional temporary tables. We need to know
    an exact number of TABLE objects.
  */
  uint m_locked_tables_count;
public:
  bool some_table_marked_for_reopen;

  Locked_tables_list()
    :m_locked_tables(NULL),
    m_locked_tables_last(&m_locked_tables),
    m_reopen_array(NULL),
    m_locked_tables_count(0),
    some_table_marked_for_reopen(0)
  {
    init_sql_alloc(key_memory_locked_table_list, &m_locked_tables_root,
                   MEM_ROOT_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
  }
  int unlock_locked_tables(THD *thd);
  int unlock_locked_table(THD *thd, MDL_ticket *mdl_ticket);
  ~Locked_tables_list()
  {
    reset();
  }
  void reset();
  bool init_locked_tables(THD *thd);
  TABLE_LIST *locked_tables() { return m_locked_tables; }
  void unlink_from_list(THD *thd, TABLE_LIST *table_list,
                        bool remove_from_locked_tables);
  void unlink_all_closed_tables(THD *thd,
                                MYSQL_LOCK *lock,
                                size_t reopen_count);
  bool reopen_tables(THD *thd, bool need_reopen);
  bool restore_lock(THD *thd, TABLE_LIST *dst_table_list, TABLE *table,
                    MYSQL_LOCK *lock);
  void add_back_last_deleted_lock(TABLE_LIST *dst_table_list);
  void mark_table_for_reopen(THD *thd, TABLE *table);
};


/**
  Storage engine specific thread local data.
*/

struct Ha_data
{
  /**
    Storage engine specific thread local data.
    Lifetime: one user connection.
  */
  void *ha_ptr;
  /**
    0: Life time: one statement within a transaction. If @@autocommit is
    on, also represents the entire transaction.
    @sa trans_register_ha()

    1: Life time: one transaction within a connection.
    If the storage engine does not participate in a transaction,
    this should not be used.
    @sa trans_register_ha()
  */
  Ha_trx_info ha_info[2];
  /**
    NULL: engine is not bound to this thread
    non-NULL: engine is bound to this thread, engine shutdown forbidden
  */
  plugin_ref lock;
  Ha_data() :ha_ptr(NULL) {}

  void reset()
  {
    ha_ptr= nullptr;
    for (auto &info : ha_info)
      info.reset();
    lock= nullptr;
  }
};

/**
  An instance of the global read lock in a connection.
  Implemented in lock.cc.
*/

class Global_read_lock
{
public:
  enum enum_grl_state
  {
    GRL_NONE,
    GRL_ACQUIRED,
    GRL_ACQUIRED_AND_BLOCKS_COMMIT
  };

  Global_read_lock()
    : m_state(GRL_NONE),
      m_mdl_global_read_lock(NULL)
  {}

  bool lock_global_read_lock(THD *thd);
  void unlock_global_read_lock(THD *thd);
  bool make_global_read_lock_block_commit(THD *thd);
  bool is_acquired() const { return m_state != GRL_NONE; }
  void set_explicit_lock_duration(THD *thd);
private:
  enum_grl_state m_state;
  /**
    Global read lock is acquired in two steps:
    1. acquire MDL_BACKUP_FTWRL1 in BACKUP namespace to prohibit DDL and DML
    2. upgrade to MDL_BACKUP_FTWRL2 to prohibit commits
  */
  MDL_ticket *m_mdl_global_read_lock;
};


/*
  Class to facilitate the commit of one transactions waiting for the commit of
  another transaction to complete first.

  This is used during (parallel) replication, to allow different transactions
  to be applied in parallel, but still commit in order.

  The transaction that wants to wait for a prior commit must first register
  to wait with register_wait_for_prior_commit(waitee). Such registration
  must be done holding the waitee->LOCK_wait_commit, to prevent the other
  THD from disappearing during the registration.

  Then during commit, if a THD is registered to wait, it will call
  wait_for_prior_commit() as part of ha_commit_trans(). If no wait is
  registered, or if the waitee for has already completed commit, then
  wait_for_prior_commit() returns immediately.

  And when a THD that may be waited for has completed commit (more precisely
  commit_ordered()), then it must call wakeup_subsequent_commits() to wake
  up any waiters. Note that this must be done at a point that is guaranteed
  to be later than any waiters registering themselves. It is safe to call
  wakeup_subsequent_commits() multiple times, as waiters are removed from
  registration as part of the wakeup.

  The reason for separate register and wait calls is that this allows to
  register the wait early, at a point where the waited-for THD is known to
  exist. And then the actual wait can be done much later, where the
  waited-for THD may have been long gone. By registering early, the waitee
  can signal before disappearing.
*/
struct wait_for_commit
{
  /*
    The LOCK_wait_commit protects the fields subsequent_commits_list and
    wakeup_subsequent_commits_running (for a waitee), and the pointer
    waitee and associated COND_wait_commit (for a waiter).
  */
  mysql_mutex_t LOCK_wait_commit;
  mysql_cond_t COND_wait_commit;
  /* List of threads that did register_wait_for_prior_commit() on us. */
  wait_for_commit *subsequent_commits_list;
  /* Link field for entries in subsequent_commits_list. */
  wait_for_commit *next_subsequent_commit;
  /*
    Our waitee, if we did register_wait_for_prior_commit(), and were not
    yet woken up. Else NULL.

    When this is cleared for wakeup, the COND_wait_commit condition is
    signalled.

    This pointer is protected by LOCK_wait_commit. But there is also a "fast
    path" where the waiter compares this to NULL without holding the lock.
    Such read must be done with acquire semantics (and all corresponding
    writes done with release semantics). This ensures that a wakeup with error
    is reliably detected as (waitee==NULL && wakeup_error != 0).
  */
  std::atomic<wait_for_commit *> waitee;
  /*
    Generic pointer for use by the transaction coordinator to optimise the
    waiting for improved group commit.

    Currently used by binlog TC to signal that a waiter is ready to commit, so
    that the waitee can grab it and group commit it directly. It is free to be
    used by another transaction coordinator for similar purposes.
  */
  void *opaque_pointer;
  /* The wakeup error code from the waitee. 0 means no error. */
  int wakeup_error;
  /*
    Flag set when wakeup_subsequent_commits_running() is active, see comments
    on that function for details.
  */
  bool wakeup_subsequent_commits_running;
  /*
    This flag can be set when a commit starts, but has not completed yet.
    It is used by binlog group commit to allow a waiting transaction T2 to
    join the group commit of an earlier transaction T1. When T1 has queued
    itself for group commit, it will set the commit_started flag. Then when
    T2 becomes ready to commit and needs to wait for T1 to commit first, T2
    can queue itself before waiting, and thereby participate in the same
    group commit as T1.
  */
  bool commit_started;
  /*
    Set to temporarily ignore calls to wakeup_subsequent_commits(). The
    caller must arrange that another wakeup_subsequent_commits() gets called
    later after wakeup_blocked has been set back to false.

    This is used for parallel replication with temporary tables.
    Temporary tables require strict single-threaded operation. The normal
    optimization, of doing wakeup_subsequent_commits early and overlapping
    part of the commit with the following transaction, is not safe. Thus
    when temporary tables are replicated, wakeup is blocked until the
    event group is fully done.
  */
  bool wakeup_blocked;

  void register_wait_for_prior_commit(wait_for_commit *waitee);
  int wait_for_prior_commit(THD *thd, bool allow_kill=true)
  {
    /*
      Quick inline check, to avoid function call and locking in the common case
      where no wakeup is registered, or a registered wait was already signalled.
    */
    if (waitee.load(std::memory_order_acquire))
      return wait_for_prior_commit2(thd, allow_kill);
    else
    {
      if (unlikely(wakeup_error))
        prior_commit_error(thd);
      return wakeup_error;
    }
  }
  void wakeup_subsequent_commits(int wakeup_error_arg)
  {
    /*
      Do the check inline, so only the wakeup case takes the cost of a function
      call for every commmit.

      Note that the check is done without locking. It is the responsibility of
      the user of the wakeup facility to ensure that no waiters can register
      themselves after the last call to wakeup_subsequent_commits().

      This avoids having to take another lock for every commit, which would be
      pointless anyway - even if we check under lock, there is nothing to
      prevent a waiter from arriving just after releasing the lock.
    */
    if (subsequent_commits_list)
      wakeup_subsequent_commits2(wakeup_error_arg);
  }
  void unregister_wait_for_prior_commit()
  {
    if (waitee.load(std::memory_order_relaxed))
      unregister_wait_for_prior_commit2();
    else
      wakeup_error= 0;
  }
  /*
    Remove a waiter from the list in the waitee. Used to unregister a wait.
    The caller must be holding the locks of both waiter and waitee.
  */
  void remove_from_list(wait_for_commit **next_ptr_ptr)
  {
    wait_for_commit *cur;

    while ((cur= *next_ptr_ptr) != NULL)
    {
      if (cur == this)
      {
        *next_ptr_ptr= this->next_subsequent_commit;
        break;
      }
      next_ptr_ptr= &cur->next_subsequent_commit;
    }
    waitee.store(NULL, std::memory_order_relaxed);
  }

  void wakeup(int wakeup_error);

  int wait_for_prior_commit2(THD *thd, bool allow_kill);
  void prior_commit_error(THD *thd);
  void wakeup_subsequent_commits2(int wakeup_error);
  void unregister_wait_for_prior_commit2();

  wait_for_commit();
  ~wait_for_commit();
  void reinit();
};


class Sp_caches
{
public:
  sp_cache *sp_proc_cache;
  sp_cache *sp_func_cache;
  sp_cache *sp_package_spec_cache;
  sp_cache *sp_package_body_cache;
  Sp_caches()
   :sp_proc_cache(NULL),
    sp_func_cache(NULL),
    sp_package_spec_cache(NULL),
    sp_package_body_cache(NULL)
  { }
  ~Sp_caches()
  {
    // All caches must be freed by the caller explicitly
    DBUG_ASSERT(sp_proc_cache == NULL);
    DBUG_ASSERT(sp_func_cache == NULL);
    DBUG_ASSERT(sp_package_spec_cache == NULL);
    DBUG_ASSERT(sp_package_body_cache == NULL);
  }
  void sp_caches_swap(Sp_caches &rhs)
  {
    swap_variables(sp_cache*, sp_proc_cache, rhs.sp_proc_cache);
    swap_variables(sp_cache*, sp_func_cache, rhs.sp_func_cache);
    swap_variables(sp_cache*, sp_package_spec_cache, rhs.sp_package_spec_cache);
    swap_variables(sp_cache*, sp_package_body_cache, rhs.sp_package_body_cache);
  }
  void sp_caches_clear();
  /**
    Clear content of sp related caches.
    Don't delete cache objects itself.
  */
  void sp_caches_empty();
};


extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);


class Gap_time_tracker;

/*
  Thread context for Gap_time_tracker class.
*/
class Gap_time_tracker_data
{
public:
  Gap_time_tracker_data(): bill_to(NULL) {}

  Gap_time_tracker *bill_to;
  ulonglong start_time;

  void init() { bill_to = NULL; }
};

/**
  Support structure for asynchronous group commit, or more generally
  any asynchronous operation that needs to finish before server writes
  response to client.

  An engine, or any other server component, can signal that there is
  a pending operation by incrementing a counter, i.e inc_pending_ops()
  and that pending operation is finished by decrementing that counter
  dec_pending_ops().

  NOTE: Currently, pending operations can not fail, i.e there is no
  way to pass a return code in dec_pending_ops()

  The server does not write response to the client before the counter
  becomes 0. In  case of group commit it ensures that data is persistent
  before success reported to client, i.e durability in ACID.
*/
struct thd_async_state
{
  enum class enum_async_state
  {
    NONE,
    SUSPENDED, /* do_command() did not finish, and needs to be resumed */
    RESUMED    /* do_command() is resumed*/
  };
  enum_async_state m_state{enum_async_state::NONE};

  /* Stuff we need to resume do_command where we finished last time*/
  enum enum_server_command m_command{COM_SLEEP};
  LEX_STRING m_packet{0,0};

  mysql_mutex_t m_mtx;
  mysql_cond_t m_cond;

  /** Pending counter*/
  Atomic_counter<int> m_pending_ops=0;

#ifndef DBUG_OFF
  /* Checks */
  pthread_t m_dbg_thread;
#endif

  thd_async_state()
  {
    mysql_mutex_init(PSI_NOT_INSTRUMENTED, &m_mtx, 0);
    mysql_cond_init(PSI_INSTRUMENT_ME, &m_cond, 0);
  }

  /*
   Currently only used with threadpool, one can "suspend" and "resume" a THD.
   Suspend only means leaving do_command earlier, after saving some state.
   Resume is continuing suspended THD's do_command(), from where it finished last time.
  */
  bool try_suspend()
  {
    bool ret;
    mysql_mutex_lock(&m_mtx);
    DBUG_ASSERT(m_state == enum_async_state::NONE);
    DBUG_ASSERT(m_pending_ops >= 0);

    if(m_pending_ops)
    {
      ret=true;
      m_state= enum_async_state::SUSPENDED;
    }
    else
    {
      /*
        If there is no pending operations, can't suspend, since
        nobody can resume it.
      */
      ret=false;
    }
    mysql_mutex_unlock(&m_mtx);
    return ret;
  }

  ~thd_async_state()
  {
    wait_for_pending_ops();
    mysql_mutex_destroy(&m_mtx);
    mysql_cond_destroy(&m_cond);
  }

  /*
    Increment pending asynchronous operations.
    The client response may not be written if
    this count > 0.
    So, without threadpool query needs to wait for
    the operations to finish.
    With threadpool, THD can be suspended and resumed
    when this counter goes to 0.
  */
  void inc_pending_ops()
  {
    mysql_mutex_lock(&m_mtx);

#ifndef DBUG_OFF
    /*
     Check that increments are always done by the same thread.
    */
    if (!m_pending_ops)
      m_dbg_thread= pthread_self();
    else
      DBUG_ASSERT(pthread_equal(pthread_self(),m_dbg_thread));
#endif

    m_pending_ops++;
    mysql_mutex_unlock(&m_mtx);
  }

  int dec_pending_ops(enum_async_state* state)
  {
    int ret;
    mysql_mutex_lock(&m_mtx);
    ret= --m_pending_ops;
    if (!ret)
      mysql_cond_signal(&m_cond);
    *state = m_state;
    mysql_mutex_unlock(&m_mtx);
    return ret;
  }

  /*
    This is used for "dirty" reading pending ops,
    when dirty read is OK.
  */
  int pending_ops()
  {
    return m_pending_ops;
  }

  /* Wait for pending operations to finish.*/
  void wait_for_pending_ops()
  {
    /*
      It is fine to read m_pending_ops and compare it with 0,
      without mutex protection.

      The value is only incremented by the current thread, and will
      be decremented by another one, thus "dirty" may show positive number
      when it is really 0, but this is not a problem, and the only
      bad thing from that will be rechecking under mutex.
    */
    if (!pending_ops())
      return;

    mysql_mutex_lock(&m_mtx);
    DBUG_ASSERT(m_pending_ops >= 0);
    while (m_pending_ops)
      mysql_cond_wait(&m_cond, &m_mtx);
    mysql_mutex_unlock(&m_mtx);
  }
};


enum class THD_WHERE
{
  NOWHERE = 0,
  CHECKING_TRANSFORMED_SUBQUERY,
  IN_ALL_ANY_SUBQUERY,
  JSON_TABLE_ARGUMENT,
  FIELD_LIST,
  PARTITION_FUNCTION,
  FROM_CLAUSE,
  DEFAULT_WHERE,
  ON_CLAUSE,
  WHERE_CLAUSE,
  SET_LIST,
  INSERT_LIST,
  VALUES_CLAUSE,
  UPDATE_CLAUSE,
  RETURNING,
  FOR_SYSTEM_TIME,
  ORDER_CLAUSE,
  HAVING_CLAUSE,
  GROUP_STATEMENT,
  PROCEDURE_LIST,
  CHECK_OPTION,
  DO_STATEMENT,
  HANDLER_STATEMENT,
  USE_WHERE_STRING, // ugh, a compromise for vcol...
};


class THD;
const char *thd_where(THD *thd);


/**
  @class THD
  For each client connection we create a separate thread with THD serving as
  a thread/connection descriptor
*/

class THD: public THD_count, /* this must be first */
           public Statement,
           /*
             This is to track items changed during execution of a prepared
             statement/stored procedure. It's created by
             nocheck_register_item_tree_change() in memory root of THD,
             and freed in rollback_item_tree_changes().
             For conventional execution it's always empty.
           */
           public Item_change_list,
           public MDL_context_owner,
           public Open_tables_state,
           public Sp_caches
{
private:
  inline bool is_stmt_prepare() const
  { DBUG_ASSERT(0); return Statement::is_stmt_prepare(); }

  inline bool is_stmt_prepare_or_first_sp_execute() const
  { DBUG_ASSERT(0); return Statement::is_stmt_prepare_or_first_sp_execute(); }

  inline bool is_stmt_prepare_or_first_stmt_execute() const
  { DBUG_ASSERT(0); return Statement::is_stmt_prepare_or_first_stmt_execute(); }

  inline bool is_conventional() const
  { DBUG_ASSERT(0); return Statement::is_conventional(); }

public:
  MDL_context mdl_context;

  /* Used to execute base64 coded binlog events in MySQL server */
  Relay_log_info* rli_fake;
  rpl_group_info* rgi_fake;
  /* Slave applier execution context */
  rpl_group_info* rgi_slave;

  union {
    rpl_io_thread_info *rpl_io_info;
    rpl_sql_thread_info *rpl_sql_info;
  } system_thread_info;
  /* Used for BACKUP LOCK */
  MDL_ticket *mdl_backup_ticket, *mdl_backup_lock;
  /* Used to register that thread has a MDL_BACKUP_WAIT_COMMIT lock */
  MDL_request *backup_commit_lock;

  void reset_for_next_command(bool do_clear_errors= 1);

#ifdef EMBEDDED_LIBRARY
  struct st_mysql  *mysql;
  unsigned long	 client_stmt_id;
  unsigned long  client_param_count;
  struct st_mysql_bind *client_params;
  char *extra_data;
  ulong extra_length;
  struct st_mysql_data *cur_data;
  struct st_mysql_data *first_data;
  struct st_mysql_data **data_tail;
  void clear_data_list();
  struct st_mysql_data *alloc_new_dataset();
  /*
    In embedded server it points to the statement that is processed
    in the current query. We store some results directly in statement
    fields then.
  */
  struct st_mysql_stmt *current_stmt;
#endif
#ifdef HAVE_QUERY_CACHE
  Query_cache_tls query_cache_tls;
#endif
  NET	  net;				// client connection descriptor
  /** Aditional network instrumentation for the server only. */
  NET_SERVER m_net_server_extension;
  scheduler_functions *scheduler;       // Scheduler for this connection
  Protocol *protocol;			// Current protocol
  Protocol_text   protocol_text;	// Normal protocol
  Protocol_binary protocol_binary;	// Binary protocol
  HASH    user_vars;			// hash for user variables
  String  packet;			// dynamic buffer for network I/O
  String  convert_buffer;               // buffer for charset conversions
  struct  my_rnd_struct rand;		// used for authentication
  struct  system_variables variables;	// Changeable local variables
  struct  system_status_var status_var; // Per thread statistic vars
  struct  system_status_var org_status_var; // For user statistics
  struct  system_status_var *initial_status_var; /* used by show status */
  ha_handler_stats handler_stats;       // Handler statistics
  THR_LOCK_INFO lock_info;              // Locking info of this thread
  /**
    Protects THD data accessed from other threads:
    - thd->query and thd->query_length (used by SHOW ENGINE
      INNODB STATUS and SHOW PROCESSLIST
    - thd->db (used in SHOW PROCESSLIST)
    Is locked when THD is deleted.
  */
  mutable mysql_mutex_t LOCK_thd_data;
  /*
    Protects:
    - kill information
    - mysys_var (used by KILL statement and shutdown).
    - Also ensures that THD is not deleted while mutex is hold
  */
  mutable mysql_mutex_t LOCK_thd_kill;

  /* all prepared statements and cursors of this connection */
  Statement_map stmt_map;

  /* Last created prepared statement */
  Statement *last_stmt;
  Statement *cur_stmt= 0;

  inline void set_last_stmt(Statement *stmt)
  { last_stmt= (is_error() ? NULL : stmt); }
  inline void clear_last_stmt() { last_stmt= NULL; }

  /*
    A pointer to the stack frame of handle_one_connection(),
    which is called first in the thread for handling a client
  */
  void *thread_stack;

  /**
    Currently selected catalog.
  */
  char *catalog;

  /**
    @note
    Some members of THD (currently 'Statement::db',
    'catalog' and 'query')  are set and alloced by the slave SQL thread
    (for the THD of that thread); that thread is (and must remain, for now)
    the only responsible for freeing these 3 members. If you add members
    here, and you add code to set them in replication, don't forget to
    free_them_and_set_them_to_0 in replication properly. For details see
    the 'err:' label of the handle_slave_sql() in sql/slave.cc.

    @see handle_slave_sql
  */

  Security_context main_security_ctx;
  Security_context *security_ctx;
  Security_context *security_context() const { return security_ctx; }
  void set_security_context(Security_context *sctx) { security_ctx = sctx; }

  /*
    Points to info-string that we show in SHOW PROCESSLIST
    You are supposed to update thd->proc_info only if you have coded
    a time-consuming piece that MySQL can get stuck in for a long time.

    Set it using the  thd_proc_info(THD *thread, const char *message)
    macro/function.

    This member is accessed and assigned without any synchronization.
    Therefore, it may point only to constant (statically
    allocated) strings, which memory won't go away over time.
  */
  const char *proc_info;

  void set_psi(PSI_thread *psi)
  {
    my_atomic_storeptr((void*volatile*)&m_psi, psi);
  }

  PSI_thread* get_psi()
  {
    return static_cast<PSI_thread*>(my_atomic_loadptr((void*volatile*)&m_psi));
  }

private:
  unsigned int m_current_stage_key;

  /** Performance schema thread instrumentation for this session. */
  PSI_thread *m_psi;

public:
  void enter_stage(const PSI_stage_info *stage,
                   const char *calling_func,
                   const char *calling_file,
                   const unsigned int calling_line)
  {
    DBUG_PRINT("THD::enter_stage", ("%s at %s:%d", stage->m_name,
                                    calling_file, calling_line));
    DBUG_ASSERT(stage);
    m_current_stage_key= stage->m_key;
    proc_info= stage->m_name;
#if defined(ENABLED_PROFILING)
    profiling.status_change(proc_info, calling_func, calling_file,
                            calling_line);
#endif
#ifdef HAVE_PSI_THREAD_INTERFACE
    m_stage_progress_psi= MYSQL_SET_STAGE(m_current_stage_key, calling_file, calling_line);
#endif
  }

  void backup_stage(PSI_stage_info *stage)
  {
    stage->m_key= m_current_stage_key;
    stage->m_name= proc_info;
  }

  const char *get_proc_info() const
  { return proc_info; }

  // Used by thd_where() when where==USE_WHERE_STRING
  const char *where_str;

  /*
    Used in error messages to tell user in what part of MySQL we found an
    error. E. g. when where= "having clause", if fix_fields() fails, user
    will know that the error was in having clause.
  */
  THD_WHERE where;

  /* Needed by MariaDB semi sync replication */
  Trans_binlog_info *semisync_info;

#ifndef DBUG_OFF
  /*
    If Active_tranx is missing an entry for a transaction which is planning to
    await an ACK, this ensures that the reason is because semi-sync was turned
    off then on in-between the binlogging of the transaction, and before it had
    started waiting for the ACK.
  */
  ulong expected_semi_sync_offs;
#endif

  /* If this is a semisync slave connection. */
  bool semi_sync_slave;
  ulonglong client_capabilities;  /* What the client supports */
  ulong max_client_packet_length;

  HASH		handler_tables_hash;
  /*
    A thread can hold named user-level locks. This variable
    contains granted tickets if a lock is present. See item_func.cc and
    chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK.
  */
  HASH ull_hash;
  /* Hash of used seqeunces (for PREVIOUS value) */
  HASH sequences;
#ifdef DBUG_ASSERT_EXISTS
  uint dbug_sentry; // watch out for memory corruption
#endif
  struct st_my_thread_var *mysys_var;

  /* Original charset number from the first client packet, or COM_CHANGE_USER*/
  CHARSET_INFO *org_charset;
private:
  /*
    Type of current query: COM_STMT_PREPARE, COM_QUERY, etc. Set from
    first byte of the packet in do_command()
  */
  enum enum_server_command m_command;

public:
  uint32     file_id;			// for LOAD DATA INFILE
  /* remote (peer) port */
  uint16     peer_port;
  my_time_t  start_time;             // start_time and its sec_part 
  ulong      start_time_sec_part;    // are almost always used separately
  my_hrtime_t user_time;
  // track down slow pthread_create
  ulonglong  prior_thr_create_utime, thr_create_utime;
  ulonglong  start_utime, utime_after_lock, utime_after_query;
  /* This can be used by handlers to send signals to the SQL level */
  ulonglong  replication_flags;
  // Process indicator
  struct {
    /*
      true, if the currently running command can send progress report
      packets to a client. Set by mysql_execute_command() for safe commands
      See CF_REPORT_PROGRESS
    */
    bool       report_to_client;
    /*
      true, if we will send progress report packets to a client
      (client has requested them, see MARIADB_CLIENT_PROGRESS; report_to_client
      is true; not in sub-statement)
    */
    bool       report;
    uint       stage, max_stage;
    ulonglong  counter, max_counter;
    ulonglong  next_report_time;
    Query_arena *arena;
  } progress;

  thr_lock_type update_lock_default;
  Delayed_insert *di;

  /* <> 0 if we are inside of trigger or stored function. */
  uint in_sub_stmt;
  /* True when opt_userstat_running is set at start of query */
  bool userstat_running;
  /*
    True if we have to log all errors. Are set by some engines to temporary
    force errors to the error log.
  */
  bool log_all_errors;

  /* Do not set socket timeouts for wait_timeout (used with threadpool) */
  bool skip_wait_timeout;

  bool prepare_derived_at_open;

  /* Set to 1 if status of this THD is already in global status */
  bool status_in_global;

  /* 
    To signal that the tmp table to be created is created for materialized
    derived table or a view.
  */ 
  bool create_tmp_table_for_derived;

  bool save_prep_leaf_list;

  /**
    The data member reset_sp_cache is to signal that content of sp_cache
    must be reset (all items be removed from it).
  */
  bool reset_sp_cache;

  /* container for handler's private per-connection data */
  Ha_data ha_data[MAX_HA];

  /**
    Bit field for the state of binlog warnings.

    The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of
    unsafeness that the current statement has.

    This must be a member of THD and not of LEX, because warnings are
    detected and issued in different places (@c
    decide_logging_format() and @c binlog_query(), respectively).
    Between these calls, the THD->lex object may change; e.g., if a
    stored routine is invoked.  Only THD persists between the calls.
  */
  uint32 binlog_unsafe_warning_flags;

#ifndef MYSQL_CLIENT
  binlog_cache_mngr *  binlog_setup_trx_data();
  /*
    If set, tell binlog to store the value as query 'xid' in the next
    Query_log_event
  */
  ulonglong binlog_xid;

  /*
    Public interface to write RBR events to the binlog
  */
  void binlog_start_trans_and_stmt();
  void binlog_set_stmt_begin();
  int binlog_write_row(TABLE* table, bool is_transactional,
                       const uchar *buf);
  int binlog_delete_row(TABLE* table, bool is_transactional,
                        const uchar *buf);
  int binlog_update_row(TABLE* table, bool is_transactional,
                        const uchar *old_data, const uchar *new_data);
  bool prepare_handlers_for_update(uint flag);
  bool binlog_write_annotated_row(Log_event_writer *writer);
  void binlog_prepare_for_row_logging();
  bool binlog_write_table_maps();
  bool binlog_write_table_map(TABLE *table, bool with_annotate);
  static void binlog_prepare_row_images(TABLE* table);

  void set_server_id(uint32 sid) { variables.server_id = sid; }

  /*
    Member functions to handle pending event for row-level logging.
  */
  template <class RowsEventT> Rows_log_event*
    binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
                                      size_t needed,
                                      bool is_transactional,
                                      RowsEventT* hint);
  Rows_log_event* binlog_get_pending_rows_event(bool is_transactional) const;
  void binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional);
  inline int binlog_flush_pending_rows_event(bool stmt_end)
  {
    return (binlog_flush_pending_rows_event(stmt_end, FALSE) || 
            binlog_flush_pending_rows_event(stmt_end, TRUE));
  }
  int binlog_flush_pending_rows_event(bool stmt_end, bool is_transactional);
  int binlog_remove_pending_rows_event(bool clear_maps, bool is_transactional);

  /**
    Determine the binlog format of the current statement.

    @retval 0 if the current statement will be logged in statement
    format.
    @retval nonzero if the current statement will be logged in row
    format.
   */
  int is_current_stmt_binlog_format_row() const {
    DBUG_ASSERT(current_stmt_binlog_format == BINLOG_FORMAT_STMT ||
                current_stmt_binlog_format == BINLOG_FORMAT_ROW);
    return current_stmt_binlog_format == BINLOG_FORMAT_ROW;
  }
  /**
    Determine if binlogging is disabled for this session
    @retval 0 if the current statement binlogging is disabled
              (could be because of binlog closed/binlog option
               is set to false).
    @retval 1 if the current statement will be binlogged
  */
  inline bool is_current_stmt_binlog_disabled() const
  {
    return (!(variables.option_bits & OPTION_BIN_LOG) ||
            !mysql_bin_log.is_open());
  }

  enum binlog_filter_state
  {
    BINLOG_FILTER_UNKNOWN,
    BINLOG_FILTER_CLEAR,
    BINLOG_FILTER_SET
  };

  inline void reset_binlog_local_stmt_filter()
  {
    m_binlog_filter_state= BINLOG_FILTER_UNKNOWN;
  }

  inline void clear_binlog_local_stmt_filter()
  {
    DBUG_ASSERT(m_binlog_filter_state == BINLOG_FILTER_UNKNOWN);
    m_binlog_filter_state= BINLOG_FILTER_CLEAR;
  }

  inline void set_binlog_local_stmt_filter()
  {
    DBUG_ASSERT(m_binlog_filter_state == BINLOG_FILTER_UNKNOWN);
    m_binlog_filter_state= BINLOG_FILTER_SET;
  }

  inline binlog_filter_state get_binlog_local_stmt_filter()
  {
    return m_binlog_filter_state;
  }

  /**
    Checks if a user connection is read-only
  */
  inline bool is_read_only_ctx()
  {
    return opt_readonly &&
           !(security_ctx->master_access & PRIV_IGNORE_READ_ONLY) &&
           !slave_thread;
  }

private:
  /**
    Indicate if the current statement should be discarded
    instead of written to the binlog.
    This is used to discard special statements, such as
    DML or DDL that affects only 'local' (non replicated)
    tables, such as performance_schema.*
  */
  binlog_filter_state m_binlog_filter_state;

  /**
    Indicates the format in which the current statement will be
    logged.  This can only be set from @c decide_logging_format().
  */
  enum_binlog_format current_stmt_binlog_format;

public:

  /* 1 if binlog table maps has been written */
  bool binlog_table_maps;

  void issue_unsafe_warnings();
  void reset_unsafe_warnings()
  { binlog_unsafe_warning_flags= 0; }

  void reset_binlog_for_next_statement()
  {
    binlog_table_maps= 0;
  }
  bool binlog_table_should_be_logged(const LEX_CSTRING *db);

#endif /* MYSQL_CLIENT */

public:

  struct st_transactions {
    SAVEPOINT *savepoints;
    THD_TRANS all;			// Trans since BEGIN WORK
    THD_TRANS stmt;			// Trans for current statement
    bool on;                            // see ha_enable_transaction()
    XID_STATE xid_state;
    XID implicit_xid;
    WT_THD wt;                          ///< for deadlock detection
    Rows_log_event *m_pending_rows_event;

    struct st_trans_time : public timeval
    {
      void reset(THD *thd)
      {
        tv_sec= thd->query_start();
        tv_usec= (long) thd->query_start_sec_part();
      }
    } start_time;

    /*
       Tables changed in transaction (that must be invalidated in query cache).
       List contain only transactional tables, that not invalidated in query
       cache (instead of full list of changed in transaction tables).
    */
    CHANGED_TABLE_LIST* changed_tables;
    MEM_ROOT mem_root; // Transaction-life memory allocation pool
    void cleanup()
    {
      DBUG_ENTER("THD::st_transactions::cleanup");
      changed_tables= 0;
      savepoints= 0;
      implicit_xid.null();
      free_root(&mem_root,MYF(MY_KEEP_PREALLOC));
      DBUG_VOID_RETURN;
    }
    void free()
    {
      free_root(&mem_root,MYF(0));
    }
    bool is_active()
    {
      return (all.ha_list != NULL);
    }
    bool is_empty()
    {
      return all.is_empty() && stmt.is_empty();
    }
    st_transactions()
    {
      bzero((char*)this, sizeof(*this));
      implicit_xid.null();
      init_sql_alloc(key_memory_thd_transactions, &mem_root,
                     DEFAULT_ROOT_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
    }
  } default_transaction, *transaction;
  Global_read_lock global_read_lock;
  Field      *dup_field;
#ifndef _WIN32
  sigset_t signals;
#endif
#ifdef SIGNAL_WITH_VIO_CLOSE
  Vio* active_vio;
#endif

  /*
    A permanent memory area of the statement. For conventional
    execution, the parsed tree and execution runtime reside in the same
    memory root. In this case stmt_arena points to THD. In case of
    a prepared statement or a stored procedure statement, thd->mem_root
    conventionally points to runtime memory, and thd->stmt_arena
    points to the memory of the PS/SP, where the parsed tree of the
    statement resides. Whenever you need to perform a permanent
    transformation of a parsed tree, you should allocate new memory in
    stmt_arena, to allow correct re-execution of PS/SP.
    Note: in the parser, stmt_arena == thd, even for PS/SP.
  */
  Query_arena *stmt_arena;

  /**
    Get either call or statement arena. In case some function is called from
    within a query the call arena has to be used for a memory allocation,
    else use the statement arena.
  */
  Query_arena *active_stmt_arena_to_use()
  {
    return (state  == Query_arena::STMT_SP_QUERY_ARGUMENTS) ? this :
                                                              stmt_arena;
  }

  void *bulk_param;

  /*
    map for tables that will be updated for a multi-table update query
    statement, for other query statements, this will be zero.
  */
  table_map table_map_for_update;

  /* Tells if LAST_INSERT_ID(#) was called for the current statement */
  bool arg_of_last_insert_id_function;
  /*
    ALL OVER THIS FILE, "insert_id" means "*automatically generated* value for
    insertion into an auto_increment column".
  */
  /*
    This is the first autogenerated insert id which was *successfully*
    inserted by the previous statement (exactly, if the previous statement
    didn't successfully insert an autogenerated insert id, then it's the one
    of the statement before, etc).
    It can also be set by SET LAST_INSERT_ID=# or SELECT LAST_INSERT_ID(#).
    It is returned by LAST_INSERT_ID().
  */
  ulonglong  first_successful_insert_id_in_prev_stmt;
  /*
    Variant of the above, used for storing in statement-based binlog. The
    difference is that the one above can change as the execution of a stored
    function progresses, while the one below is set once and then does not
    change (which is the value which statement-based binlog needs).
  */
  ulonglong  first_successful_insert_id_in_prev_stmt_for_binlog;
  /*
    This is the first autogenerated insert id which was *successfully*
    inserted by the current statement. It is maintained only to set
    first_successful_insert_id_in_prev_stmt when statement ends.
  */
  ulonglong  first_successful_insert_id_in_cur_stmt;
  /*
    We follow this logic:
    - when stmt starts, first_successful_insert_id_in_prev_stmt contains the
    first insert id successfully inserted by the previous stmt.
    - as stmt makes progress, handler::insert_id_for_cur_row changes;
    every time get_auto_increment() is called,
    auto_inc_intervals_in_cur_stmt_for_binlog is augmented with the
    reserved interval (if statement-based binlogging).
    - at first successful insertion of an autogenerated value,
    first_successful_insert_id_in_cur_stmt is set to
    handler::insert_id_for_cur_row.
    - when stmt goes to binlog,
    auto_inc_intervals_in_cur_stmt_for_binlog is binlogged if
    non-empty.
    - when stmt ends, first_successful_insert_id_in_prev_stmt is set to
    first_successful_insert_id_in_cur_stmt.
  */
  /*
    stmt_depends_on_first_successful_insert_id_in_prev_stmt is set when
    LAST_INSERT_ID() is used by a statement.
    If it is set, first_successful_insert_id_in_prev_stmt_for_binlog will be
    stored in the statement-based binlog.
    This variable is CUMULATIVE along the execution of a stored function or
    trigger: if one substatement sets it to 1 it will stay 1 until the
    function/trigger ends, thus making sure that
    first_successful_insert_id_in_prev_stmt_for_binlog does not change anymore
    and is propagated to the caller for binlogging.
  */
  bool       stmt_depends_on_first_successful_insert_id_in_prev_stmt;
  /*
    List of auto_increment intervals reserved by the thread so far, for
    storage in the statement-based binlog.
    Note that its minimum is not first_successful_insert_id_in_cur_stmt:
    assuming a table with an autoinc column, and this happens:
    INSERT INTO ... VALUES(3);
    SET INSERT_ID=3; INSERT IGNORE ... VALUES (NULL);
    then the latter INSERT will insert no rows
    (first_successful_insert_id_in_cur_stmt == 0), but storing "INSERT_ID=3"
    in the binlog is still needed; the list's minimum will contain 3.
    This variable is cumulative: if several statements are written to binlog
    as one (stored functions or triggers are used) this list is the
    concatenation of all intervals reserved by all statements.
  */
  Discrete_intervals_list auto_inc_intervals_in_cur_stmt_for_binlog;
  /* Used by replication and SET INSERT_ID */
  Discrete_intervals_list auto_inc_intervals_forced;
  /*
    There is BUG#19630 where statement-based replication of stored
    functions/triggers with two auto_increment columns breaks.
    We however ensure that it works when there is 0 or 1 auto_increment
    column; our rules are
    a) on master, while executing a top statement involving substatements,
    first top- or sub- statement to generate auto_increment values wins the
    exclusive right to see its values be written to binlog (the write
    will be done by the statement or its caller), and the losers won't see
    their values be written to binlog.
    b) on slave, while replicating a top statement involving substatements,
    first top- or sub- statement to need to read auto_increment values from
    the master's binlog wins the exclusive right to read them (so the losers
    won't read their values from binlog but instead generate on their own).
    a) implies that we mustn't backup/restore
    auto_inc_intervals_in_cur_stmt_for_binlog.
    b) implies that we mustn't backup/restore auto_inc_intervals_forced.

    If there are more than 1 auto_increment columns, then intervals for
    different columns may mix into the
    auto_inc_intervals_in_cur_stmt_for_binlog list, which is logically wrong,
    but there is no point in preventing this mixing by preventing intervals
    from the secondly inserted column to come into the list, as such
    prevention would be wrong too.
    What will happen in the case of
    INSERT INTO t1 (auto_inc) VALUES(NULL);
    where t1 has a trigger which inserts into an auto_inc column of t2, is
    that in binlog we'll store the interval of t1 and the interval of t2 (when
    we store intervals, soon), then in slave, t1 will use both intervals, t2
    will use none; if t1 inserts the same number of rows as on master,
    normally the 2nd interval will not be used by t1, which is fine. t2's
    values will be wrong if t2's internal auto_increment counter is different
    from what it was on master (which is likely). In 5.1, in mixed binlogging
    mode, row-based binlogging is used for such cases where two
    auto_increment columns are inserted.
  */
  inline void record_first_successful_insert_id_in_cur_stmt(ulonglong id_arg)
  {
    if (first_successful_insert_id_in_cur_stmt == 0)
      first_successful_insert_id_in_cur_stmt= id_arg;
  }
  inline ulonglong read_first_successful_insert_id_in_prev_stmt(void)
  {
    if (!stmt_depends_on_first_successful_insert_id_in_prev_stmt)
    {
      /* It's the first time we read it */
      first_successful_insert_id_in_prev_stmt_for_binlog=
        first_successful_insert_id_in_prev_stmt;
      stmt_depends_on_first_successful_insert_id_in_prev_stmt= 1;
    }
    return first_successful_insert_id_in_prev_stmt;
  }
  /*
    Used by Intvar_log_event::do_apply_event() and by "SET INSERT_ID=#"
    (mysqlbinlog). We'll soon add a variant which can take many intervals in
    argument.
  */
  inline void force_one_auto_inc_interval(ulonglong next_id)
  {
    auto_inc_intervals_forced.empty(); // in case of multiple SET INSERT_ID
    auto_inc_intervals_forced.append(next_id, ULONGLONG_MAX, 0);
  }
  inline void set_binlog_bit()
  {
    if (variables.sql_log_bin)
      variables.option_bits |= OPTION_BIN_LOG;
    else
      variables.option_bits &= ~OPTION_BIN_LOG;
  }

  ulonglong  limit_found_rows;

private:
  /**
    Stores the result of ROW_COUNT() function.

    ROW_COUNT() function is a MySQL extention, but we try to keep it
    similar to ROW_COUNT member of the GET DIAGNOSTICS stack of the SQL
    standard (see SQL99, part 2, search for ROW_COUNT). It's value is
    implementation defined for anything except INSERT, DELETE, UPDATE.

    ROW_COUNT is assigned according to the following rules:

      - In my_ok():
        - for DML statements: to the number of affected rows;
        - for DDL statements: to 0.

      - In my_eof(): to -1 to indicate that there was a result set.

        We derive this semantics from the JDBC specification, where int
        java.sql.Statement.getUpdateCount() is defined to (sic) "return the
        current result as an update count; if the result is a ResultSet
        object or there are no more results, -1 is returned".

      - In my_error(): to -1 to be compatible with the MySQL C API and
        MySQL ODBC driver.

      - For SIGNAL statements: to 0 per WL#2110 specification (see also
        sql_signal.cc comment). Zero is used since that's the "default"
        value of ROW_COUNT in the diagnostics area.
  */

  longlong m_row_count_func;    /* For the ROW_COUNT() function */

public:
  inline longlong get_row_count_func() const
  {
    return m_row_count_func;
  }

  inline void set_row_count_func(longlong row_count_func)
  {
    m_row_count_func= row_count_func;
  }
  inline void set_affected_rows(longlong row_count_func)
  {
    /*
      We have to add to affected_rows (used by slow log), as otherwise
      information for 'call' will be wrong
    */
    affected_rows+= (row_count_func >= 0 ? row_count_func : 0);
  }

  ha_rows    cuted_fields;

private:
  /*
    number of rows we actually sent to the client, including "synthetic"
    rows in ROLLUP etc.
  */
  ha_rows    m_sent_row_count;

  /**
    Number of rows read and/or evaluated for a statement. Used for
    slow log reporting.

    An examined row is defined as a row that is read and/or evaluated
    according to a statement condition, including in
    create_sort_index(). Rows may be counted more than once, e.g., a
    statement including ORDER BY could possibly evaluate the row in
    filesort() before reading it for e.g. update.
  */
  ha_rows    m_examined_row_count;

public:
  ha_rows get_sent_row_count() const
  { return m_sent_row_count; }

  ha_rows get_examined_row_count() const
  {
    DBUG_EXECUTE_IF("debug_huge_number_of_examined_rows",
                    return (ULONGLONG_MAX - 1000000););
    return m_examined_row_count;
  }

  ulonglong get_affected_rows() const
  { return affected_rows; }

  void set_sent_row_count(ha_rows count);
  void set_examined_row_count(ha_rows count);

  void inc_sent_row_count(ha_rows count);
  void inc_examined_row_count(ha_rows count);

  void inc_status_created_tmp_disk_tables();
  void inc_status_created_tmp_files();
  void inc_status_created_tmp_tables();
  void inc_status_select_full_join();
  void inc_status_select_full_range_join();
  void inc_status_select_range();
  void inc_status_select_range_check();
  void inc_status_select_scan();
  void inc_status_sort_merge_passes();
  void inc_status_sort_range();
  void inc_status_sort_rows(ha_rows count);
  void inc_status_sort_scan();
  void set_status_no_index_used();
  void set_status_no_good_index_used();

  /**
    The number of rows and/or keys examined by the query, both read,
    changed or written.
  */
  ulonglong accessed_rows_and_keys;

  /**
    Check if the number of rows accessed by a statement exceeded
    LIMIT ROWS EXAMINED. If so, signal the query engine to stop execution.
  */
  void check_limit_rows_examined()
  {
    if (++accessed_rows_and_keys > lex->limit_rows_examined_cnt)
      set_killed(ABORT_QUERY);
  }

  USER_CONN *user_connect;
  CHARSET_INFO *db_charset;
#if defined(ENABLED_PROFILING)
  PROFILING  profiling;
#endif

  /** Current stage progress instrumentation. */
  PSI_stage_progress *m_stage_progress_psi;
  /** Current statement digest. */
  sql_digest_state *m_digest;
  /** Current statement digest token array. */
  unsigned char *m_token_array;
  /** Top level statement digest. */
  sql_digest_state m_digest_state;

  /** Current statement instrumentation. */
  PSI_statement_locker *m_statement_psi;
#ifdef HAVE_PSI_STATEMENT_INTERFACE
  /** Current statement instrumentation state. */
  PSI_statement_locker_state m_statement_state;
#endif /* HAVE_PSI_STATEMENT_INTERFACE */

  /** Current transaction instrumentation. */
  PSI_transaction_locker *m_transaction_psi;
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
  /** Current transaction instrumentation state. */
  PSI_transaction_locker_state m_transaction_state;
#endif /* HAVE_PSI_TRANSACTION_INTERFACE */

  /** Idle instrumentation. */
  PSI_idle_locker *m_idle_psi;
#ifdef HAVE_PSI_IDLE_INTERFACE
  /** Idle instrumentation state. */
  PSI_idle_locker_state m_idle_state;
#endif /* HAVE_PSI_IDLE_INTERFACE */

  /*
    Id of current query. Statement can be reused to execute several queries
    query_id is global in context of the whole MySQL server.
    ID is automatically generated from mutex-protected counter.
    It's used in handler code for various purposes: to check which columns
    from table are necessary for this select, to check if it's necessary to
    update auto-updatable fields (like auto_increment and timestamp).
  */
  query_id_t query_id;
  privilege_t col_access;

  /* Statement id is thread-wide. This counter is used to generate ids */
  ulong      statement_id_counter;
  ulong	     rand_saved_seed1, rand_saved_seed2;

  /* The following variables are used when printing to slow log */
  ulong      query_plan_flags; 
  ulong      query_plan_fsort_passes; 
  ulong      tmp_tables_used;
  ulong      tmp_tables_disk_used;
  ulonglong  tmp_tables_size;
  ulonglong  bytes_sent_old;
  ulonglong  affected_rows;                     /* Number of changed rows */

  Opt_trace_context opt_trace;
  pthread_t  real_id;                           /* For debugging */
  my_thread_id  thread_id, thread_dbug_id;
  uint32      os_thread_id;
  uint	     tmp_table, global_disable_checkpoint;
  uint	     server_status,open_options;
  enum enum_thread_type system_thread;
  enum backup_stages current_backup_stage;
#ifdef WITH_WSREP
  bool wsrep_desynced_backup_stage;
#endif /* WITH_WSREP */
  /*
    Current or next transaction isolation level.
    When a connection is established, the value is taken from
    @@session.tx_isolation (default transaction isolation for
    the session), which is in turn taken from @@global.tx_isolation
    (the global value).
    If there is no transaction started, this variable
    holds the value of the next transaction's isolation level.
    When a transaction starts, the value stored in this variable
    becomes "actual".
    At transaction commit or rollback, we assign this variable
    again from @@session.tx_isolation.
    The only statement that can otherwise change the value
    of this variable is SET TRANSACTION ISOLATION LEVEL.
    Its purpose is to effect the isolation level of the next
    transaction in this session. When this statement is executed,
    the value in this variable is changed. However, since
    this statement is only allowed when there is no active
    transaction, this assignment (naturally) only affects the
    upcoming transaction.
    At the end of the current active transaction the value is
    be reset again from @@session.tx_isolation, as described
    above.
  */
  enum_tx_isolation tx_isolation;
  /*
    Current or next transaction access mode.
    See comment above regarding tx_isolation.
  */
  bool              tx_read_only;
  enum_check_fields count_cuted_fields;

  DYNAMIC_ARRAY user_var_events;        /* For user variables replication */
  MEM_ROOT      *user_var_events_alloc; /* Allocate above array elements here */

  /*
    Define durability properties that engines may check to
    improve performance. Not yet used in MariaDB
  */
  enum durability_properties durability_property;
 
  /*
    If checking this in conjunction with a wait condition, please
    include a check after enter_cond() if you want to avoid a race
    condition. For details see the implementation of awake(),
    especially the "broadcast" part.
  */
  killed_state volatile killed;

  /*
    The following is used if one wants to have a specific error number and
    text for the kill
  */
  struct err_info
  {
    int no;
    const char msg[256];
  } *killed_err;

  /* See also thd_killed() */
  inline bool check_killed(bool dont_send_error_message= 0)
  {
    if (unlikely(killed))
    {
      if (!dont_send_error_message)
        send_kill_message();
      return TRUE;
    }
    if (apc_target.have_apc_requests())
      apc_target.process_apc_requests(false);
    return FALSE;
  }

  /* scramble - random string sent to client on handshake */
  char	     scramble[SCRAMBLE_LENGTH+1];

  /*
    If this is a slave, the name of the connection stored here.
    This is used for taging error messages in the log files.
  */
  LEX_CSTRING connection_name;
  char       default_master_connection_buff[MAX_CONNECTION_NAME+1];
  uint8      password; /* 0, 1 or 2 */
  uint8      failed_com_change_user;
  bool       slave_thread;
  bool	     no_errors;

  /**
    Set to TRUE if execution of the current compound statement
    can not continue. In particular, disables activation of
    CONTINUE or EXIT handlers of stored routines.
    Reset in the end of processing of the current user request, in
    @see THD::reset_for_next_command().
  */
  bool is_fatal_error;
  /**
    Set by a storage engine to request the entire
    transaction (that possibly spans multiple engines) to
    rollback. Reset in ha_rollback.
  */
  bool       transaction_rollback_request;
  /**
    TRUE if we are in a sub-statement and the current error can
    not be safely recovered until we left the sub-statement mode.
    In particular, disables activation of CONTINUE and EXIT
    handlers inside sub-statements. E.g. if it is a deadlock
    error and requires a transaction-wide rollback, this flag is
    raised (traditionally, MySQL first has to close all the reads
    via @see handler::ha_index_or_rnd_end() and only then perform
    the rollback).
    Reset to FALSE when we leave the sub-statement mode.
  */
  bool       is_fatal_sub_stmt_error;
  bool	     rand_used, time_zone_used;
  bool       query_start_sec_part_used;
  /* for IS NULL => = last_insert_id() fix in remove_eq_conds() */
  bool       substitute_null_with_insert_id;
  bool	     in_lock_tables;
  bool       bootstrap, cleanup_done, free_connection_done;

  /**  is set if some thread specific value(s) used in a statement. */
  bool       thread_specific_used;
  /**  
    is set if a statement accesses a temporary table created through
    CREATE TEMPORARY TABLE. 
  */
private:
  bool       charset_is_system_charset, charset_is_collation_connection;
  bool       charset_is_character_set_filesystem;
public:
  bool       enable_slow_log;    /* Enable slow log for current statement */
  bool	     abort_on_warning;
  bool 	     got_warning;       /* Set on call to push_warning() */
  /* set during loop of derived table processing */
  bool       derived_tables_processing;
  bool       tablespace_op;	/* This is TRUE in DISCARD/IMPORT TABLESPACE */
  /* True if we have to log the current statement */
  bool	     log_current_statement;
  /**
    True if a slave error. Causes the slave to stop. Not the same
    as the statement execution error (is_error()), since
    a statement may be expected to return an error, e.g. because
    it returned an error on master, and this is OK on the slave.
  */
  bool       is_slave_error;
  /* True if we have printed something to the error log for this statement */
  bool       error_printed_to_log;

  /*
    True when a transaction is queued up for binlog group commit.
    Used so that if another transaction needs to wait for a row lock held by
    this transaction, it can signal to trigger the group commit immediately,
    skipping the normal --binlog-commit-wait-count wait.
  */
  bool waiting_on_group_commit;
  /*
    Set true when another transaction goes to wait on a row lock held by this
    transaction. Used together with waiting_on_group_commit.
  */
  bool has_waiter;
  /*
    In case of a slave, set to the error code the master got when executing
    the query. 0 if no error on the master.
    The stored into variable master error code may get reset inside
    execution stack when the event turns out to be ignored.
  */
  int	     slave_expected_error;
  enum_sql_command last_sql_command;  // Last sql_command exceuted in mysql_execute_command()

  sp_rcontext *spcont;		// SP runtime context

  /** number of name_const() substitutions, see sp_head.cc:subst_spvars() */
  uint       query_name_consts;

  NET*       slave_net;			// network connection from slave -> m.

  /*
    Used to update global user stats.  The global user stats are updated
    occasionally with the 'diff' variables.  After the update, the 'diff'
    variables are reset to 0.
  */
  /* Time when the current thread connected to MySQL. */
  time_t current_connect_time;
  /* Last time when THD stats were updated in global_user_stats. */
  time_t last_global_update_time;
  /* Number of commands not reflected in global_user_stats yet. */
  uint select_commands, update_commands, other_commands;
  ulonglong start_cpu_time;
  ulonglong start_bytes_received;

  /* Used by the sys_var class to store temporary values */
  union
  {
    my_bool   my_bool_value;
    int       int_value;
    uint      uint_value;
    long      long_value;
    ulong     ulong_value;
    ulonglong ulonglong_value;
    double    double_value;
    void      *ptr_value;
  } sys_var_tmp;

  struct {
    /*
      If true, mysql_bin_log::write(Log_event) call will not write events to
      binlog, and maintain 2 below variables instead (use
      mysql_bin_log.start_union_events to turn this on)
    */
    bool do_union;
    /*
      If TRUE, at least one mysql_bin_log::write(Log_event) call has been
      made after last mysql_bin_log.start_union_events() call.
    */
    bool unioned_events;
    /*
      If TRUE, at least one mysql_bin_log::write(Log_event e), where
      e.cache_stmt == TRUE call has been made after last
      mysql_bin_log.start_union_events() call.
    */
    bool unioned_events_trans;
    /*
      'queries' (actually SP statements) that run under inside this binlog
      union have thd->query_id >= first_query_id.
    */
    query_id_t first_query_id;
  } binlog_evt_union;

  /**
    Internal parser state.
    Note that since the parser is not re-entrant, we keep only one parser
    state here. This member is valid only when executing code during parsing.
  */
  Parser_state *m_parser_state;

  Locked_tables_list locked_tables_list;

#ifdef WITH_PARTITION_STORAGE_ENGINE
  partition_info *work_part_info;
#endif

#ifndef EMBEDDED_LIBRARY
  /**
    Array of active audit plugins which have been used by this THD.
    This list is later iterated to invoke release_thd() on those
    plugins.
  */
  DYNAMIC_ARRAY audit_class_plugins;
  /**
    Array of bits indicating which audit classes have already been
    added to the list of audit plugins which are currently in use.
  */
  unsigned long audit_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
  int audit_plugin_version;
#endif

#if defined(ENABLED_DEBUG_SYNC)
  /* Debug Sync facility. See debug_sync.cc. */
  struct st_debug_sync_control *debug_sync_control;
#endif /* defined(ENABLED_DEBUG_SYNC) */
  /**
    @param id                thread identifier
    @param is_wsrep_applier  thread type
  */
  THD(my_thread_id id, bool is_wsrep_applier= false);

  ~THD();

  void init();
  /*
    Initialize memory roots necessary for query processing and (!)
    pre-allocate memory for it. We can't do that in THD constructor because
    there are use cases (acl_init, delayed inserts, watcher threads,
    killing mysqld) where it's vital to not allocate excessive and not used
    memory. Note, that we still don't return error from init_for_queries():
    if preallocation fails, we should notice that at the first call to
    alloc_root.
  */
  void init_for_queries();
  void update_all_stats();
  void update_stats(void);
  void change_user(void);
  void cleanup(void);
  void cleanup_after_query();
  void free_connection();
  void reset_for_reuse();
  void store_globals();
  void reset_stack()
  {
    thread_stack= 0;
  }
  void reset_globals();
  bool trace_started()
  {
    return opt_trace.is_started();
  }
#ifdef SIGNAL_WITH_VIO_CLOSE
  inline void set_active_vio(Vio* vio)
  {
    mysql_mutex_lock(&LOCK_thd_data);
    active_vio = vio;
    mysql_mutex_unlock(&LOCK_thd_data);
  }
  inline void clear_active_vio()
  {
    mysql_mutex_lock(&LOCK_thd_data);
    active_vio = 0;
    mysql_mutex_unlock(&LOCK_thd_data);
  }
  void close_active_vio();
#endif
  void awake_no_mutex(killed_state state_to_set);
  void awake(killed_state state_to_set)
  {
    mysql_mutex_lock(&LOCK_thd_kill);
    mysql_mutex_lock(&LOCK_thd_data);
    awake_no_mutex(state_to_set);
    mysql_mutex_unlock(&LOCK_thd_data);
    mysql_mutex_unlock(&LOCK_thd_kill);
  }
  void abort_current_cond_wait(bool force);
 
  /** Disconnect the associated communication endpoint. */
  void disconnect();


  /*
    Allows this thread to serve as a target for others to schedule Async 
    Procedure Calls on.

    It's possible to schedule any code to be executed this way, by
    inheriting from the Apc_call object. Currently, only
    Show_explain_request uses this.
  */
  Apc_target apc_target;

  Gap_time_tracker_data gap_tracker_data;
#ifndef MYSQL_CLIENT
  enum enum_binlog_query_type {
    /* The query can be logged in row format or in statement format. */
    ROW_QUERY_TYPE,
    
    /* The query has to be logged in statement format. */
    STMT_QUERY_TYPE,
    
    QUERY_TYPE_COUNT
  };

  int binlog_query(enum_binlog_query_type qtype,
                   char const *query, ulong query_len, bool is_trans,
                   bool direct, bool suppress_use,
                   int errcode);
  bool binlog_current_query_unfiltered();
#endif

  inline void
  enter_cond(mysql_cond_t *cond, mysql_mutex_t* mutex,
             const PSI_stage_info *stage, PSI_stage_info *old_stage,
             const char *src_function, const char *src_file,
             int src_line) override
  {
    mysql_mutex_assert_owner(mutex);
    mysys_var->current_mutex = mutex;
    mysys_var->current_cond = cond;
    if (old_stage)
      backup_stage(old_stage);
    if (stage)
      enter_stage(stage, src_function, src_file, src_line);
  }
  inline void exit_cond(const PSI_stage_info *stage,
                        const char *src_function, const char *src_file,
                        int src_line) override
  {
    /*
      Putting the mutex unlock in thd->exit_cond() ensures that
      mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
      locked (if that would not be the case, you'll get a deadlock if someone
      does a THD::awake() on you).
    */
    mysql_mutex_unlock(mysys_var->current_mutex);
    mysql_mutex_lock(&mysys_var->mutex);
    mysys_var->current_mutex = 0;
    mysys_var->current_cond = 0;
    if (stage)
      enter_stage(stage, src_function, src_file, src_line);
    mysql_mutex_unlock(&mysys_var->mutex);
    return;
  }
  int is_killed() override { return killed; }
  THD* get_thd() override { return this; }

  /**
    A callback to the server internals that is used to address
    special cases of the locking protocol.
    Invoked when acquiring an exclusive lock, for each thread that
    has a conflicting shared metadata lock.

    This function:
    - aborts waiting of the thread on a data lock, to make it notice
      the pending exclusive lock and back off.
    - if the thread is an INSERT DELAYED thread, sends it a KILL
      signal to terminate it.

    @note This function does not wait for the thread to give away its
          locks. Waiting is done outside for all threads at once.

    @param ctx_in_use           The MDL context owner (thread) to wake up.
    @param needs_thr_lock_abort Indicates that to wake up thread
                                this call needs to abort its waiting
                                on table-level lock.

    @retval  TRUE  if the thread was woken up
    @retval  FALSE otherwise.
   */
  bool notify_shared_lock(MDL_context_owner *ctx_in_use,
                          bool needs_thr_lock_abort) override;

  // End implementation of MDL_context_owner interface.

  inline bool is_strict_mode() const
  {
    return (bool) (variables.sql_mode & (MODE_STRICT_TRANS_TABLES |
                                         MODE_STRICT_ALL_TABLES));
  }
  inline bool backslash_escapes() const
  {
    return !MY_TEST(variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES);
  }
  const Type_handler *type_handler_for_datetime() const;
  bool timestamp_to_TIME(MYSQL_TIME *ltime, my_time_t ts,
                         ulong sec_part, date_mode_t fuzzydate);
  inline my_time_t query_start() { return start_time; }
  inline ulong query_start_sec_part()
  { query_start_sec_part_used=1; return start_time_sec_part; }
  MYSQL_TIME query_start_TIME();
  time_round_mode_t temporal_round_mode() const
  {
    return variables.sql_mode & MODE_TIME_ROUND_FRACTIONAL ?
           TIME_FRAC_ROUND : TIME_FRAC_TRUNCATE;
  }

private:
  struct {
    my_hrtime_t start;
    my_time_t sec;
    ulong sec_part;
  } system_time;

  void set_system_time()
  {
    my_hrtime_t hrtime= my_hrtime();
    my_time_t sec= hrtime_to_my_time(hrtime);
    ulong sec_part= hrtime_sec_part(hrtime);
    if (sec > system_time.sec ||
        (sec == system_time.sec && sec_part > system_time.sec_part) ||
        hrtime.val < system_time.start.val)
    {
      system_time.sec= sec;
      system_time.sec_part= sec_part;
      system_time.start= hrtime;
    }
    else
    {
      if (system_time.sec_part < TIME_MAX_SECOND_PART)
        system_time.sec_part++;
      else
      {
        system_time.sec++;
        system_time.sec_part= 0;
      }
    }
  }

public:
  timeval transaction_time()
  {
    if (!in_multi_stmt_transaction_mode())
      transaction->start_time.reset(this);
    return transaction->start_time;
  }

  inline void set_start_time()
  {
    if (user_time.val)
    {
      start_time= hrtime_to_my_time(user_time);
      start_time_sec_part= hrtime_sec_part(user_time);
    }
    else
    {
      set_system_time();
      start_time= system_time.sec;
      start_time_sec_part= system_time.sec_part;
    }
    PSI_CALL_set_thread_start_time(start_time);
  }
  inline void set_time()
  {
    set_start_time();
    start_utime= utime_after_lock= microsecond_interval_timer();
  }
  /* only used in SET @@timestamp=... */
  inline void set_time(my_hrtime_t t)
  {
    user_time= t;
    set_time();
  }
  inline void force_set_time(my_time_t t, ulong sec_part)
  {
    start_time= system_time.sec= t;
    start_time_sec_part= system_time.sec_part= sec_part;
  }
  /*
    this is only used by replication and BINLOG command.
    usecs > TIME_MAX_SECOND_PART means "was not in binlog"
  */
  inline void set_time(my_time_t t, ulong sec_part)
  {
    if (opt_secure_timestamp > (slave_thread ? SECTIME_REPL : SECTIME_SUPER))
      set_time();                 // note that BINLOG itself requires SUPER
    else
    {
      if (sec_part <= TIME_MAX_SECOND_PART)
        force_set_time(t, sec_part);
      else if (t != system_time.sec)
        force_set_time(t, 0);
      else
      {
        start_time= t;
        start_time_sec_part= ++system_time.sec_part;
      }
      user_time.val= hrtime_from_time(start_time) + start_time_sec_part;
      PSI_CALL_set_thread_start_time(start_time);
      start_utime= utime_after_lock= microsecond_interval_timer();
    }
  }
  void set_time_after_lock()
  {
    utime_after_lock= microsecond_interval_timer();
    MYSQL_SET_STATEMENT_LOCK_TIME(m_statement_psi,
                                  (utime_after_lock - start_utime));
  }
  ulonglong current_utime()  { return microsecond_interval_timer(); }

  /* Tell SHOW PROCESSLIST to show time from this point */
  inline void set_time_for_next_stage()
  {
    utime_after_query= current_utime();
  }

  /**
   Update server status after execution of a top level statement.
   Currently only checks if a query was slow, and assigns
   the status accordingly.
   Evaluate the current time, and if it exceeds the long-query-time
   setting, mark the query as slow.
  */
  void update_server_status()
  {
    set_time_for_next_stage();
    if (utime_after_query >= utime_after_lock + variables.long_query_time)
      server_status|= SERVER_QUERY_WAS_SLOW;
  }
  inline ulonglong found_rows(void)
  {
    return limit_found_rows;
  }
  /**
    Returns TRUE if session is in a multi-statement transaction mode.

    OPTION_NOT_AUTOCOMMIT: When autocommit is off, a multi-statement
    transaction is implicitly started on the first statement after a
    previous transaction has been ended.

    OPTION_BEGIN: Regardless of the autocommit status, a multi-statement
    transaction can be explicitly started with the statements "START
    TRANSACTION", "BEGIN [WORK]", "[COMMIT | ROLLBACK] AND CHAIN", etc.

    Note: this doesn't tell you whether a transaction is active.
    A session can be in multi-statement transaction mode, and yet
    have no active transaction, e.g., in case of:
    set @@autocommit=0;
    set @a= 3;                                     <-- these statements don't
    set transaction isolation level serializable;  <-- start an active
    flush tables;                                  <-- transaction

    I.e. for the above scenario this function returns TRUE, even
    though no active transaction has begun.
    @sa in_active_multi_stmt_transaction()
  */
  inline bool in_multi_stmt_transaction_mode()
  {
    return variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
  }
  /**
    TRUE if the session is in a multi-statement transaction mode
    (@sa in_multi_stmt_transaction_mode()) *and* there is an
    active transaction, i.e. there is an explicit start of a
    transaction with BEGIN statement, or implicit with a
    statement that uses a transactional engine.

    For example, these scenarios don't start an active transaction
    (even though the server is in multi-statement transaction mode):

    set @@autocommit=0;
    select * from nontrans_table;
    set @var=TRUE;
    flush tables;

    Note, that even for a statement that starts a multi-statement
    transaction (i.e. select * from trans_table), this
    flag won't be set until we open the statement's tables
    and the engines register themselves for the transaction
    (see trans_register_ha()),
    hence this method is reliable to use only after
    open_tables() has completed.

    Why do we need a flag?
    ----------------------
    We need to maintain a (at first glance redundant)
    session flag, rather than looking at thd->transaction.all.ha_list
    because of explicit start of a transaction with BEGIN. 

    I.e. in case of
    BEGIN;
    select * from nontrans_t1; <-- in_active_multi_stmt_transaction() is true
  */
  inline bool in_active_multi_stmt_transaction()
  {
    return server_status & SERVER_STATUS_IN_TRANS;
  }
  /* Commit both statement and full transaction */
  int commit_whole_transaction_and_close_tables();
  void give_protection_error();
  /*
    Give an error if any of the following is true for this connection
    - BACKUP STAGE is active
    - FLUSH TABLE WITH READ LOCK is active
    - BACKUP LOCK table_name is active
  */
  inline bool has_read_only_protection()
  {
    if (current_backup_stage == BACKUP_FINISHED &&
        !global_read_lock.is_acquired() &&
        !mdl_backup_lock)
      return FALSE;
    give_protection_error();
    return TRUE;
  }
  inline bool fill_information_schema_tables()
  {
    return !stmt_arena->is_stmt_prepare();
  }
  inline void* trans_alloc(size_t size)
  {
    return alloc_root(&transaction->mem_root,size);
  }

  LEX_CSTRING strmake_lex_cstring(const char *str, size_t length)
  {
    const char *tmp= strmake_root(mem_root, str, length);
    if (!tmp)
      return {0,0};
    return {tmp, length};
  }
  LEX_CSTRING strmake_lex_cstring(const LEX_CSTRING &from)
  {
    return strmake_lex_cstring(from.str, from.length);
  }
  LEX_CSTRING strmake_lex_cstring_trim_whitespace(const LEX_CSTRING &from)
  {
    return strmake_lex_cstring(Lex_cstring(from).trim_whitespace(charset()));
  }

  LEX_STRING *make_lex_string(LEX_STRING *lex_str, const char* str, size_t length)
  {
    if (!(lex_str->str= strmake_root(mem_root, str, length)))
    {
      lex_str->length= 0;
      return 0;
    }
    lex_str->length= length;
    return lex_str;
  }
  LEX_CSTRING *make_lex_string(LEX_CSTRING *lex_str, const char* str, size_t length)
  {
    if (!(lex_str->str= strmake_root(mem_root, str, length)))
    {
      lex_str->length= 0;
      return 0;
    }
    lex_str->length= length;
    return lex_str;
  }
  // Remove double quotes:  aaa""bbb -> aaa"bbb
  bool quote_unescape(LEX_CSTRING *dst, const LEX_CSTRING *src, char quote)
  {
    const char *tmp= src->str;
    const char *tmpend= src->str + src->length;
    char *to;
    if (!(dst->str= to= (char *) alloc(src->length + 1)))
    {
      dst->length= 0; // Safety
      return true;
    }
    for ( ; tmp < tmpend; )
    {
      if ((*to++= *tmp++) == quote)
        tmp++;                                  // Skip double quotes
    }
    *to= 0;                                     // End null for safety
    dst->length= to - dst->str;
    return false;
  }

  LEX_CSTRING *make_clex_string(const char* str, size_t length)
  {
    LEX_CSTRING *lex_str;
    char *tmp;
    if (unlikely(!(lex_str= (LEX_CSTRING *)alloc_root(mem_root,
                                                      sizeof(LEX_CSTRING) +
                                                      length+1))))
      return 0;
    tmp= (char*) (lex_str+1);
    lex_str->str= tmp;
    memcpy(tmp, str, length);
    tmp[length]= 0;
    lex_str->length= length;
    return lex_str;
  }
  LEX_CSTRING *make_clex_string(const LEX_CSTRING from)
  {
    return make_clex_string(from.str, from.length);
  }

  // Allocate LEX_STRING for character set conversion
  bool alloc_lex_string(LEX_STRING *dst, size_t length)
  {
    if (likely((dst->str= (char*) alloc(length))))
      return false;
    dst->length= 0;  // Safety
    return true;     // EOM
  }
  bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
		      const char *from, size_t from_length,
		      CHARSET_INFO *from_cs);
  bool reinterpret_string_from_binary(LEX_CSTRING *to, CHARSET_INFO *to_cs,
                                      const char *from, size_t from_length);
  bool convert_string(LEX_CSTRING *to, CHARSET_INFO *to_cs,
                      const char *from, size_t from_length,
                      CHARSET_INFO *from_cs)
  {
    LEX_STRING tmp;
    bool rc= convert_string(&tmp, to_cs, from, from_length, from_cs);
    to->str= tmp.str;
    to->length= tmp.length;
    return rc;
  }
  bool convert_string(LEX_CSTRING *to, CHARSET_INFO *tocs,
                      const LEX_CSTRING *from, CHARSET_INFO *fromcs,
                      bool simple_copy_is_possible)
  {
    if (!simple_copy_is_possible)
      return unlikely(convert_string(to, tocs, from->str, from->length, fromcs));
    if (fromcs == &my_charset_bin)
      return reinterpret_string_from_binary(to, tocs, from->str, from->length);
    *to= *from;
    return false;
  }
  /*
    Convert a strings between character sets.
    Uses my_convert_fix(), which uses an mb_wc .. mc_mb loop internally.
    dstcs and srccs cannot be &my_charset_bin.
  */
  bool convert_fix(CHARSET_INFO *dstcs, LEX_STRING *dst,
                   CHARSET_INFO *srccs, const char *src, size_t src_length,
                   String_copier *status);

  /*
    Same as above, but additionally sends ER_INVALID_CHARACTER_STRING
    in case of bad byte sequences or Unicode conversion problems.
  */
  bool convert_with_error(CHARSET_INFO *dstcs, LEX_STRING *dst,
                          CHARSET_INFO *srccs,
                          const char *src, size_t src_length);
  /*
    If either "dstcs" or "srccs" is &my_charset_bin,
    then performs native copying using copy_fix().
    Otherwise, performs Unicode conversion using convert_fix().
  */
  bool copy_fix(CHARSET_INFO *dstcs, LEX_STRING *dst,
                CHARSET_INFO *srccs, const char *src, size_t src_length,
                String_copier *status);

  /*
    Same as above, but additionally sends ER_INVALID_CHARACTER_STRING
    in case of bad byte sequences or Unicode conversion problems.
  */
  bool copy_with_error(CHARSET_INFO *dstcs, LEX_STRING *dst,
                       CHARSET_INFO *srccs, const char *src, size_t src_length);

  bool convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs);

  /*
    Check if the string is wellformed, raise an error if not wellformed.
    @param str    - The string to check.
    @param length - the string length.
  */
  bool check_string_for_wellformedness(const char *str,
                                       size_t length,
                                       CHARSET_INFO *cs) const;

  bool to_ident_sys_alloc(Lex_ident_sys_st *to, const Lex_ident_cli_st *from);

  /*
    Create a string literal with optional client->connection conversion.
    @param str        - the string in the client character set
    @param length     - length of the string
    @param repertoire - the repertoire of the string
  */
  Item_basic_constant *make_string_literal(const char *str, size_t length,
                                           my_repertoire_t repertoire);
  Item_basic_constant *make_string_literal(const Lex_string_with_metadata_st &str)
  {
    my_repertoire_t repertoire= str.repertoire(variables.character_set_client);
    return make_string_literal(str.str, str.length, repertoire);
  }
  Item_basic_constant *make_string_literal_nchar(const Lex_string_with_metadata_st &str);
  Item_basic_constant *make_string_literal_charset(const Lex_string_with_metadata_st &str,
                                                   CHARSET_INFO *cs);
  bool make_text_string_sys(LEX_CSTRING *to,
                            const Lex_string_with_metadata_st *from)
  {
    return convert_string(to, system_charset_info,
                          from, charset(), charset_is_system_charset);
  }
  bool make_text_string_connection(LEX_CSTRING *to,
                                   const Lex_string_with_metadata_st *from)
  {
    return convert_string(to, variables.collation_connection,
                          from, charset(), charset_is_collation_connection);
  }
  bool make_text_string_filesystem(LEX_CSTRING *to,
                                   const Lex_string_with_metadata_st *from)
  {
    return convert_string(to, variables.character_set_filesystem,
                          from, charset(), charset_is_character_set_filesystem);
  }
  void add_changed_table(TABLE *table);
  void add_changed_table(const char *key, size_t key_length);
  CHANGED_TABLE_LIST * changed_table_dup(const char *key, size_t key_length);
  int prepare_explain_fields(select_result *result, List<Item> *field_list,
                             uint8 explain_flags, bool is_analyze);
  int send_explain_fields(select_result *result, uint8 explain_flags,
                          bool is_analyze);
  void make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
                               bool is_analyze);
  void make_explain_json_field_list(List<Item> &field_list, bool is_analyze);

  /**
    Clear the current error, if any.
    We do not clear is_fatal_error or is_fatal_sub_stmt_error since we
    assume this is never called if the fatal error is set.

    @todo: To silence an error, one should use Internal_error_handler
    mechanism. Issuing an error that can be possibly later "cleared" is not
    compatible with other installed error handlers and audit plugins.
  */
  inline void clear_error(bool clear_diagnostics= 0)
  {
    DBUG_ENTER("clear_error");
    if (get_stmt_da()->is_error() || clear_diagnostics)
      get_stmt_da()->reset_diagnostics_area();
    is_slave_error= 0;
    if (killed == KILL_BAD_DATA)
      reset_killed();
    my_errno= 0;
    DBUG_VOID_RETURN;
  }

#ifndef EMBEDDED_LIBRARY
  inline bool vio_ok() const { return net.vio != 0; }
  /** Return FALSE if connection to client is broken. */
  bool is_connected()
  {
    /*
      All system threads (e.g., the slave IO thread) are connected but
      not using vio. So this function always returns true for all
      system threads.
    */
    return system_thread || (vio_ok() ? vio_is_connected(net.vio) : FALSE);
  }
#else
  inline bool vio_ok() const { return TRUE; }
  inline bool is_connected() { return TRUE; }
#endif

   void my_ok_with_recreate_info(const Recreate_info &info, ulong warn_count);
  /**
    Mark the current error as fatal. Warning: this does not
    set any error, it sets a property of the error, so must be
    followed or prefixed with my_error().
  */
  inline void fatal_error()
  {
    DBUG_ASSERT(get_stmt_da()->is_error() || killed);
    is_fatal_error= 1;
    DBUG_PRINT("error",("Fatal error set"));
  }
  /**
    TRUE if there is an error in the error stack.

    Please use this method instead of direct access to
    net.report_error.

    If TRUE, the current (sub)-statement should be aborted.
    The main difference between this member and is_fatal_error
    is that a fatal error can not be handled by a stored
    procedure continue handler, whereas a normal error can.

    To raise this flag, use my_error().
  */
  inline bool is_error() const { return m_stmt_da->is_error(); }
  void set_bulk_execution(void *bulk)
  {
    bulk_param= bulk;
    m_stmt_da->set_bulk_execution(MY_TEST(bulk));
  }
  bool is_bulk_op() const { return MY_TEST(bulk_param); }

  /// Returns Diagnostics-area for the current statement.
  Diagnostics_area *get_stmt_da()
  { return m_stmt_da; }

  /// Returns Diagnostics-area for the current statement.
  const Diagnostics_area *get_stmt_da() const
  { return m_stmt_da; }

  /// Sets Diagnostics-area for the current statement.
  void set_stmt_da(Diagnostics_area *da)
  { m_stmt_da= da; }

  inline CHARSET_INFO *charset() const { return variables.character_set_client; }
  void update_charset();
  void update_charset(CHARSET_INFO *character_set_client,
                      CHARSET_INFO *collation_connection)
  {
    variables.character_set_client= character_set_client;
    variables.collation_connection= collation_connection;
    update_charset();
  }
  void update_charset(CHARSET_INFO *character_set_client,
                      CHARSET_INFO *collation_connection,
                      CHARSET_INFO *character_set_results)
  {
    variables.character_set_client= character_set_client;
    variables.collation_connection= collation_connection;
    variables.character_set_results= character_set_results;
    update_charset();
  }

  inline Query_arena *activate_stmt_arena_if_needed(Query_arena *backup)
  {
    if (state == Query_arena::STMT_SP_QUERY_ARGUMENTS)
      /*
        Caller uses the arena with state STMT_SP_QUERY_ARGUMENTS for stored
        routine's parameters. Lifetime of these objects spans a lifetime of
        stored routine call and freed every time the stored routine execution
        has been completed. That is the reason why switching to statement's
        arena is not performed for arguments, else we would observe increasing
        of memory usage while a stored routine be called over and over again.
      */
      return NULL;

    /*
      Use the persistent arena if we are in a prepared statement or a stored
      procedure statement and we have not already changed to use this arena.
    */
    if (!stmt_arena->is_conventional() && mem_root != stmt_arena->mem_root)
    {
      set_n_backup_active_arena(stmt_arena, backup);
      return stmt_arena;
    }
    return 0;
  }


  bool is_item_tree_change_register_required()
  {
    return !stmt_arena->is_conventional();
  }

  void register_item_tree_change(Item **place)
  {
    /* TODO: check for OOM condition here */
    if (is_item_tree_change_register_required())
      nocheck_register_item_tree_change(place, *place, mem_root);
  }

  void change_item_tree(Item **place, Item *new_value)
  {
    DBUG_ENTER("THD::change_item_tree");
    DBUG_PRINT("enter", ("Register: %p (%p) <- %p",
                       *place, place, new_value));
    register_item_tree_change(place);
    *place= new_value;
    DBUG_VOID_RETURN;
  }
  /**
    Make change in item tree after checking whether it needs registering


    @param place         place where we should assign new value
    @param new_value     place of the new value

    @details
    see check_and_register_item_tree_change details
  */
  void check_and_register_item_tree(Item **place, Item **new_value)
  {
    if (!stmt_arena->is_conventional())
      check_and_register_item_tree_change(place, new_value, mem_root);
    /*
      We have to use memcpy instead of  *place= *new_value merge to
      avoid problems with strict aliasing.
    */
    memcpy((char*) place, new_value, sizeof(*new_value));
  }

  /*
    Cleanup statement parse state (parse tree, lex) and execution
    state after execution of a non-prepared SQL statement.
  */
  void end_statement();

  /*
    Mark thread to be killed, with optional error number and string.
    string is not released, so it has to be allocted on thd mem_root
    or be a global string

    Ensure that we don't replace a kill with a lesser one. For example
    if user has done 'kill_connection' we shouldn't replace it with
    KILL_QUERY.
  */
  inline void set_killed(killed_state killed_arg,
                         int killed_errno_arg= 0,
                         const char *killed_err_msg_arg= 0)
  {
    mysql_mutex_lock(&LOCK_thd_kill);
    set_killed_no_mutex(killed_arg, killed_errno_arg, killed_err_msg_arg);
    mysql_mutex_unlock(&LOCK_thd_kill);
  }
  /*
    This is only used by THD::awake where we need to keep the lock mutex
    locked over some time.
    It's ok to have this inline, as in most cases killed_errno_arg will
    be a constant 0 and most of the function will disappear.
  */
  inline void set_killed_no_mutex(killed_state killed_arg,
                                  int killed_errno_arg= 0,
                                  const char *killed_err_msg_arg= 0)
  {
    if (killed <= killed_arg)
    {
      killed= killed_arg;
      if (killed_errno_arg)
      {
        /*
          If alloc fails, we only remember the killed flag.
          The worst things that can happen is that we get
          a suboptimal error message.
        */
        if (!killed_err)
          killed_err= (err_info*) my_malloc(PSI_INSTRUMENT_ME, sizeof(*killed_err), MYF(MY_WME));
        if (likely(killed_err))
        {
          killed_err->no= killed_errno_arg;
          ::strmake((char*) killed_err->msg, killed_err_msg_arg,
                    sizeof(killed_err->msg)-1);
        }
      }
    }
  }
  int killed_errno();
  void reset_killed();
  inline void reset_kill_query()
  {
    if (killed < KILL_CONNECTION)
    {
      reset_killed();
      mysys_var->abort= 0;
    }
  }
  inline void send_kill_message()
  {
    mysql_mutex_lock(&LOCK_thd_kill);
    int err= killed_errno();
    if (err)
      my_message(err, killed_err ? killed_err->msg : ER_THD(this, err), MYF(0));
    mysql_mutex_unlock(&LOCK_thd_kill);
  }
  /* return TRUE if we will abort query if we make a warning now */
  inline bool really_abort_on_warning()
  {
    return (abort_on_warning &&
            (!transaction->stmt.modified_non_trans_table ||
             (variables.sql_mode & MODE_STRICT_ALL_TABLES)));
  }
  void set_status_var_init();
  void reset_n_backup_open_tables_state(Open_tables_backup *backup);
  void restore_backup_open_tables_state(Open_tables_backup *backup);
  void reset_sub_statement_state(Sub_statement_state *backup, uint new_state);
  void restore_sub_statement_state(Sub_statement_state *backup);
  void store_slow_query_state(Sub_statement_state *backup);
  void reset_slow_query_state();
  void add_slow_query_state(Sub_statement_state *backup);
  void set_n_backup_active_arena(Query_arena *set, Query_arena *backup);
  void restore_active_arena(Query_arena *set, Query_arena *backup);

  inline void get_binlog_format(enum_binlog_format *format,
                                enum_binlog_format *current_format)
  {
    *format= (enum_binlog_format) variables.binlog_format;
    *current_format= current_stmt_binlog_format;
  }
  inline enum_binlog_format get_current_stmt_binlog_format()
  {
    return current_stmt_binlog_format;
  }
  inline void set_binlog_format(enum_binlog_format format,
                                enum_binlog_format current_format)
  {
    DBUG_ENTER("set_binlog_format");
    variables.binlog_format= format;
    current_stmt_binlog_format= current_format;
    DBUG_VOID_RETURN;
  }
  inline void set_binlog_format_stmt()
  {
    DBUG_ENTER("set_binlog_format_stmt");
    variables.binlog_format=    BINLOG_FORMAT_STMT;
    current_stmt_binlog_format= BINLOG_FORMAT_STMT;
    DBUG_VOID_RETURN;
  }
  /*
    @todo Make these methods private or remove them completely.  Only
    decide_logging_format should call them. /Sven
  */
  inline void set_current_stmt_binlog_format_row_if_mixed()
  {
    DBUG_ENTER("set_current_stmt_binlog_format_row_if_mixed");
    /*
      This should only be called from decide_logging_format.

      @todo Once we have ensured this, uncomment the following
      statement, remove the big comment below that, and remove the
      in_sub_stmt==0 condition from the following 'if'.
    */
    /* DBUG_ASSERT(in_sub_stmt == 0); */
    /*
      If in a stored/function trigger, the caller should already have done the
      change. We test in_sub_stmt to prevent introducing bugs where people
      wouldn't ensure that, and would switch to row-based mode in the middle
      of executing a stored function/trigger (which is too late, see also
      reset_current_stmt_binlog_format_row()); this condition will make their
      tests fail and so force them to propagate the
      lex->binlog_row_based_if_mixed upwards to the caller.
    */
    if ((wsrep_binlog_format(variables.binlog_format) == BINLOG_FORMAT_MIXED) && (in_sub_stmt == 0))
      set_current_stmt_binlog_format_row();

    DBUG_VOID_RETURN;
  }

  inline void set_current_stmt_binlog_format(enum_binlog_format format)
  {
    current_stmt_binlog_format= format;
  }

  inline void set_current_stmt_binlog_format_row()
  {
    DBUG_ENTER("set_current_stmt_binlog_format_row");
    current_stmt_binlog_format= BINLOG_FORMAT_ROW;
    DBUG_VOID_RETURN;
  }
  /* Set binlog format temporarily to statement. Returns old format */
  inline enum_binlog_format set_current_stmt_binlog_format_stmt()
  {
    enum_binlog_format orig_format= current_stmt_binlog_format;
    DBUG_ENTER("set_current_stmt_binlog_format_stmt");
    current_stmt_binlog_format= BINLOG_FORMAT_STMT;
    DBUG_RETURN(orig_format);
  }
  inline void restore_stmt_binlog_format(enum_binlog_format format)
  {
    DBUG_ENTER("restore_stmt_binlog_format");
    DBUG_ASSERT(!is_current_stmt_binlog_format_row());
    current_stmt_binlog_format= format;
    DBUG_VOID_RETURN;
  }
  inline void reset_current_stmt_binlog_format_row()
  {
    DBUG_ENTER("reset_current_stmt_binlog_format_row");
    /*
      If there are temporary tables, don't reset back to
      statement-based. Indeed it could be that:
      CREATE TEMPORARY TABLE t SELECT UUID(); # row-based
      # and row-based does not store updates to temp tables
      # in the binlog.
      INSERT INTO u SELECT * FROM t; # stmt-based
      and then the INSERT will fail as data inserted into t was not logged.
      So we continue with row-based until the temp table is dropped.
      If we are in a stored function or trigger, we mustn't reset in the
      middle of its execution (as the binary logging way of a stored function
      or trigger is decided when it starts executing, depending for example on
      the caller (for a stored function: if caller is SELECT or
      INSERT/UPDATE/DELETE...).
    */
    DBUG_PRINT("debug",
               ("temporary_tables: %s, in_sub_stmt: %s, system_thread: %s",
                YESNO(has_temporary_tables()), YESNO(in_sub_stmt),
                show_system_thread(system_thread)));
    if (in_sub_stmt == 0)
    {
      if (wsrep_binlog_format(variables.binlog_format) == BINLOG_FORMAT_ROW)
        set_current_stmt_binlog_format_row();
      else if (!has_temporary_tables())
        set_current_stmt_binlog_format_stmt();
    }
    DBUG_VOID_RETURN;
  }

  /**
    Set the current database; use deep copy of C-string.

    @param new_db     a pointer to the new database name.
    @param new_db_len length of the new database name.

    Initialize the current database from a NULL-terminated string with
    length. If we run out of memory, we free the current database and
    return TRUE.  This way the user will notice the error as there will be
    no current database selected (in addition to the error message set by
    malloc).

    @note This operation just sets {db, db_length}. Switching the current
    database usually involves other actions, like switching other database
    attributes including security context. In the future, this operation
    will be made private and more convenient interface will be provided.

    @return Operation status
      @retval FALSE Success
      @retval TRUE  Out-of-memory error
  */
  bool set_db(const LEX_CSTRING *new_db);

  /** Set the current database, without copying */
  void reset_db(const LEX_CSTRING *new_db);

  /*
    Copy the current database to the argument. Use the current arena to
    allocate memory for a deep copy: current database may be freed after
    a statement is parsed but before it's executed.

    Can only be called by owner of thd (no mutex protection)
  */
  bool copy_db_to(LEX_CSTRING *to)
  {
    if (db.str)
    {
      to->str= strmake(db.str, db.length);
      to->length= db.length;
      return to->str == NULL;                     /* True on error */
    }

    /*
      No default database is set. In this case if it's guaranteed that
      no CTE can be used in the statement then we can throw an error right
      now at the parser stage. Otherwise the decision about throwing such
      a message must be postponed until a post-parser stage when we are able
      to resolve all CTE names as we don't need this message to be thrown
      for any CTE references.
    */
    if (!lex->with_cte_resolution)
      my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
    return TRUE;
  }
  /* Get db name or "". */
  const char *get_db()
  { return safe_str(db.str); }

  thd_scheduler event_scheduler;

public:
  inline Internal_error_handler *get_internal_handler()
  { return m_internal_handler; }

  /**
    Add an internal error handler to the thread execution context.
    @param handler the exception handler to add
  */
  void push_internal_handler(Internal_error_handler *handler);

private:
  /**
    Handle a sql condition.
    @param sql_errno the condition error number
    @param sqlstate the condition sqlstate
    @param level the condition level
    @param msg the condition message text
    @param[out] cond_hdl the sql condition raised, if any
    @return true if the condition is handled
  */
  bool handle_condition(uint sql_errno,
                        const char* sqlstate,
                        Sql_condition::enum_warning_level *level,
                        const char* msg,
                        Sql_condition ** cond_hdl);

public:
  /**
    Remove the error handler last pushed.
  */
  Internal_error_handler *pop_internal_handler();

  /**
    Raise an exception condition.
    @param code the MYSQL_ERRNO error code of the error
  */
  void raise_error(uint code);

  /**
    Raise an exception condition, with a formatted message.
    @param code the MYSQL_ERRNO error code of the error
  */
  void raise_error_printf(uint code, ...);

  /**
    Raise a completion condition (warning).
    @param code the MYSQL_ERRNO error code of the warning
  */
  void raise_warning(uint code);

  /**
    Raise a completion condition (warning), with a formatted message.
    @param code the MYSQL_ERRNO error code of the warning
  */
  void raise_warning_printf(uint code, ...);

  /**
    Raise a completion condition (note), with a fixed message.
    @param code the MYSQL_ERRNO error code of the note
  */
  void raise_note(uint code);

  /**
    Raise an completion condition (note), with a formatted message.
    @param code the MYSQL_ERRNO error code of the note
  */
  void raise_note_printf(uint code, ...);

  /**
    @brief Push an error message into MySQL error stack with line
    and position information.

    This function provides semantic action implementers with a way
    to push the famous "You have a syntax error near..." error
    message into the error stack, which is normally produced only if
    a parse error is discovered internally by the Bison generated
    parser.
  */
  void parse_error(const char *err_text, const char *yytext)
  {
    Lex_input_stream *lip= &m_parser_state->m_lip;
    if (!yytext && !(yytext= lip->get_tok_start()))
        yytext= "";
    /* Push an error into the error stack */
    ErrConvString err(yytext, strlen(yytext), variables.character_set_client);
    my_printf_error(ER_PARSE_ERROR,  ER_THD(this, ER_PARSE_ERROR), MYF(0),
                    err_text, err.ptr(), lip->yylineno);
  }
  void parse_error(uint err_number, const char *yytext= 0)
  {
    parse_error(ER_THD(this, err_number), yytext);
  }
  void parse_error()
  {
    parse_error(ER_SYNTAX_ERROR);
  }
#ifdef mysqld_error_find_printf_error_used
  void parse_error(const char *t)
  {
  }
#endif
private:
  /*
    Only the implementation of the SIGNAL and RESIGNAL statements
    is permitted to raise SQL conditions in a generic way,
    or to raise them by bypassing handlers (RESIGNAL).
    To raise a SQL condition, the code should use the public
    raise_error() or raise_warning() methods provided by class THD.
  */
  friend class Sql_cmd_common_signal;
  friend class Sql_cmd_signal;
  friend class Sql_cmd_resignal;
  friend void push_warning(THD*, Sql_condition::enum_warning_level, uint, const char*);
  friend void my_message_sql(uint, const char *, myf);

  /**
    Raise a generic SQL condition.
    @param sql_errno the condition error number
    @param sqlstate the condition SQLSTATE
    @param level the condition level
    @param msg the condition message text
    @return The condition raised, or NULL
  */
  Sql_condition*
  raise_condition(uint sql_errno,
                  const char* sqlstate,
                  Sql_condition::enum_warning_level level,
                  const char* msg)
  {
    return raise_condition(sql_errno, sqlstate, level,
                           Sql_user_condition_identity(), msg);
  }

  /**
    Raise a generic or a user defined SQL condition.
    @param ucid      - the user condition identity
                       (or an empty identity if not a user condition)
    @param sql_errno - the condition error number
    @param sqlstate  - the condition SQLSTATE
    @param level     - the condition level
    @param msg       - the condition message text
    @return The condition raised, or NULL
  */
  Sql_condition*
  raise_condition(uint sql_errno,
                  const char* sqlstate,
                  Sql_condition::enum_warning_level level,
                  const Sql_user_condition_identity &ucid,
                  const char* msg);

  Sql_condition*
  raise_condition(const Sql_condition *cond)
  {
    Sql_condition *raised= raise_condition(cond->get_sql_errno(),
                                           cond->get_sqlstate(),
                                           cond->get_level(),
                                           *cond/*Sql_user_condition_identity*/,
                                           cond->get_message_text());
    if (raised)
      raised->copy_opt_attributes(cond);
    return raised;
  }

private:
  void push_warning_truncated_priv(Sql_condition::enum_warning_level level,
                                   uint sql_errno,
                                   const char *type_str, const char *val)
  {
    DBUG_ASSERT(sql_errno == ER_TRUNCATED_WRONG_VALUE ||
                sql_errno == ER_WRONG_VALUE);
    char buff[MYSQL_ERRMSG_SIZE];
    CHARSET_INFO *cs= &my_charset_latin1;
    cs->cset->snprintf(cs, buff, sizeof(buff),
                       ER_THD(this, sql_errno), type_str, val);
    /*
      Note: the format string can vary between ER_TRUNCATED_WRONG_VALUE
      and ER_WRONG_VALUE, but the code passed to push_warning() is
      always ER_TRUNCATED_WRONG_VALUE. This is intentional.
    */
    push_warning(this, level, ER_TRUNCATED_WRONG_VALUE, buff);
  }
public:
  void push_warning_truncated_wrong_value(Sql_condition::enum_warning_level level,
                                          const char *type_str, const char *val)
  {
    return push_warning_truncated_priv(level, ER_TRUNCATED_WRONG_VALUE,
                                       type_str, val);
  }
  void push_warning_wrong_value(Sql_condition::enum_warning_level level,
                                const char *type_str, const char *val)
  {
    return push_warning_truncated_priv(level, ER_WRONG_VALUE, type_str, val);
  }
  void push_warning_truncated_wrong_value(const char *type_str, const char *val)
  {
    return push_warning_truncated_wrong_value(Sql_condition::WARN_LEVEL_WARN,
                                              type_str, val);
  }
  void push_warning_truncated_value_for_field(Sql_condition::enum_warning_level
                                              level, const char *type_str,
                                              const char *val,
                                              const char *db_name,
                                              const char *table_name,
                                              const char *name)
  {
    DBUG_ASSERT(name);
    char buff[MYSQL_ERRMSG_SIZE];
    CHARSET_INFO *cs= &my_charset_latin1;

    if (!db_name)
      db_name= "";
    if (!table_name)
      table_name= "";
    cs->cset->snprintf(cs, buff, sizeof(buff),
                       ER_THD(this, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                       type_str, val, db_name, table_name, name,
                       (ulong) get_stmt_da()->current_row_for_warning());
    push_warning(this, level, ER_TRUNCATED_WRONG_VALUE, buff);

  }
  void push_warning_wrong_or_truncated_value(Sql_condition::enum_warning_level level,
                                             bool totally_useless_value,
                                             const char *type_str,
                                             const char *val,
                                             const char *db_name,
                                             const char *table_name,
                                             const char *field_name)
  {
    if (field_name)
      push_warning_truncated_value_for_field(level, type_str, val,
                                             db_name, table_name, field_name);
    else if (totally_useless_value)
      push_warning_wrong_value(level, type_str, val);
    else
      push_warning_truncated_wrong_value(level, type_str, val);
  }

public:
  /** Overloaded to guard query/query_length fields */
  void set_statement(Statement *stmt) override;
  inline void set_command(enum enum_server_command command)
  {
    DBUG_ASSERT(command != COM_SLEEP);
    m_command= command;
#ifdef HAVE_PSI_THREAD_INTERFACE
    PSI_STATEMENT_CALL(set_thread_command)(m_command);
#endif
  }
  /* As sleep needs a bit of special handling, we have a special case for it */
  inline void mark_connection_idle()
  {
    proc_info= 0;
    m_command= COM_SLEEP;
#ifdef HAVE_PSI_THREAD_INTERFACE
    PSI_STATEMENT_CALL(set_thread_command)(m_command);
#endif
  }

  inline enum enum_server_command get_command() const
  { return m_command; }

  /**
    Assign a new value to thd->query and thd->query_id and mysys_var.
    Protected with LOCK_thd_data mutex.
  */
  void set_query(char *query_arg, size_t query_length_arg,
                 CHARSET_INFO *cs_arg)
  {
    set_query(CSET_STRING(query_arg, query_length_arg, cs_arg));
  }
  void set_query(char *query_arg, size_t query_length_arg) /*Mutex protected*/
  {
    set_query(CSET_STRING(query_arg, query_length_arg, charset()));
  }
  void set_query(const CSET_STRING &string_arg)
  {
    mysql_mutex_lock(&LOCK_thd_data);
    set_query_inner(string_arg);
    mysql_mutex_unlock(&LOCK_thd_data);

    PSI_CALL_set_thread_info(query(), query_length());
  }
  void reset_query()               /* Mutex protected */
  { set_query(CSET_STRING()); }
  void set_query_and_id(char *query_arg, uint32 query_length_arg,
                        CHARSET_INFO *cs, query_id_t new_query_id);
  void set_query_id(query_id_t new_query_id)
  {
    query_id= new_query_id;
#ifdef WITH_WSREP
    if (WSREP_NNULL(this))
    {
      set_wsrep_next_trx_id(query_id);
      WSREP_DEBUG("assigned new next trx id: %" PRIu64, wsrep_next_trx_id());
    }
#endif /* WITH_WSREP */
  }
  void set_open_tables(TABLE *open_tables_arg)
  {
    mysql_mutex_lock(&LOCK_thd_data);
    open_tables= open_tables_arg;
    mysql_mutex_unlock(&LOCK_thd_data);
  }
  void set_mysys_var(struct st_my_thread_var *new_mysys_var);
  void enter_locked_tables_mode(enum_locked_tables_mode mode_arg)
  {
    DBUG_ASSERT(locked_tables_mode == LTM_NONE);

    if (mode_arg == LTM_LOCK_TABLES)
    {
      /*
        When entering LOCK TABLES mode we should set explicit duration
        for all metadata locks acquired so far in order to avoid releasing
        them till UNLOCK TABLES statement.
        We don't do this when entering prelocked mode since sub-statements
        don't release metadata locks and restoring status-quo after leaving
        prelocking mode gets complicated.
      */
      mdl_context.set_explicit_duration_for_all_locks();
    }

    locked_tables_mode= mode_arg;
  }
  void leave_locked_tables_mode();
  /* Relesae transactional locks if there are no active transactions */
  void release_transactional_locks()
  {
    if (!in_active_multi_stmt_transaction())
      mdl_context.release_transactional_locks(this);
  }
  int decide_logging_format(TABLE_LIST *tables);

  /*
   In Some cases when decide_logging_format is called it does not have
   all information to decide the logging format. So that cases we call
   decide_logging_format_2 at later stages in execution.

   One example would be binlog format for insert on duplicate key
   (IODKU) but column with unique key is not inserted.  We do not have
   inserted columns info when we call decide_logging_format so on
   later stage we call reconsider_logging_format_for_iodup()
  */
  void reconsider_logging_format_for_iodup(TABLE *table);

  enum need_invoker { INVOKER_NONE=0, INVOKER_USER, INVOKER_ROLE};
  void binlog_invoker(bool role) { m_binlog_invoker= role ? INVOKER_ROLE : INVOKER_USER; }
  enum need_invoker need_binlog_invoker() { return m_binlog_invoker; }
  void get_definer(LEX_USER *definer, bool role);
  void set_invoker(const LEX_CSTRING *user, const LEX_CSTRING *host)
  {
    invoker.user= *user;
    invoker.host= *host;
  }
  LEX_CSTRING get_invoker_user() { return invoker.user; }
  LEX_CSTRING get_invoker_host() { return invoker.host; }
  bool has_invoker() { return invoker.user.length > 0; }

  void print_aborted_warning(uint threshold, const char *reason)
  {
    if (global_system_variables.log_warnings > threshold)
    {
      char real_ip_str[64];
      real_ip_str[0]= 0;

      /* For proxied connections, add the real IP to the warning message */
      if (net.using_proxy_protocol && net.vio)
      {
        if(net.vio->localhost)
          snprintf(real_ip_str, sizeof(real_ip_str), " real ip: 'localhost'");
        else
        {
          char buf[INET6_ADDRSTRLEN];
          if (!vio_getnameinfo((sockaddr *)&(net.vio->remote), buf,
              sizeof(buf),NULL, 0, NI_NUMERICHOST))
          {
            snprintf(real_ip_str, sizeof(real_ip_str), " real ip: '%s'",buf);
          }
        }
      }
      Security_context *sctx= &main_security_ctx;
      sql_print_warning(ER_THD(this, ER_NEW_ABORTING_CONNECTION),
                        thread_id, (db.str ? db.str : "unconnected"),
                        sctx->user ? sctx->user : "unauthenticated",
                        sctx->host_or_ip, real_ip_str, reason);
    }
  }

public:
  void clear_wakeup_ready() { wakeup_ready= false; }
  /*
    Sleep waiting for others to wake us up with signal_wakeup_ready().
    Must call clear_wakeup_ready() before waiting.
  */
  void wait_for_wakeup_ready();
  /* Wake this thread up from wait_for_wakeup_ready(). */
  void signal_wakeup_ready();

  void add_status_to_global()
  {
    DBUG_ASSERT(status_in_global == 0);
    mysql_mutex_lock(&LOCK_status);
    add_to_status(&global_status_var, &status_var);
    /* Mark that this THD status has already been added in global status */
    status_var.global_memory_used= 0;
    status_in_global= 1;
    mysql_mutex_unlock(&LOCK_status);
  }

  wait_for_commit *wait_for_commit_ptr;
  int wait_for_prior_commit(bool allow_kill=true)
  {
    if (wait_for_commit_ptr)
      return wait_for_commit_ptr->wait_for_prior_commit(this, allow_kill);
    return 0;
  }
  void wakeup_subsequent_commits(int wakeup_error)
  {
    if (wait_for_commit_ptr)
      wait_for_commit_ptr->wakeup_subsequent_commits(wakeup_error);
  }
  wait_for_commit *suspend_subsequent_commits() {
    wait_for_commit *suspended= wait_for_commit_ptr;
    wait_for_commit_ptr= NULL;
    return suspended;
  }
  void resume_subsequent_commits(wait_for_commit *suspended) {
    DBUG_ASSERT(!wait_for_commit_ptr);
    wait_for_commit_ptr= suspended;
  }

  void mark_transaction_to_rollback(bool all);
  bool internal_transaction() { return transaction != &default_transaction; }
private:

  /** The current internal error handler for this thread, or NULL. */
  Internal_error_handler *m_internal_handler;

  /**
    The lex to hold the parsed tree of conventional (non-prepared) queries.
    Whereas for prepared and stored procedure statements we use an own lex
    instance for each new query, for conventional statements we reuse
    the same lex. (@see mysql_parse for details).
  */
  LEX main_lex;
  /**
    This memory root is used for two purposes:
    - for conventional queries, to allocate structures stored in main_lex
    during parsing, and allocate runtime data (execution plan, etc.)
    during execution.
    - for prepared queries, only to allocate runtime data. The parsed
    tree itself is reused between executions and thus is stored elsewhere.
  */
  MEM_ROOT main_mem_root;
  Diagnostics_area main_da;
  Diagnostics_area *m_stmt_da;

  /**
    It will be set if CURRENT_USER() or CURRENT_ROLE() is called in account
    management statements or default definer is set in CREATE/ALTER SP, SF,
    Event, TRIGGER or VIEW statements.

    Current user or role will be binlogged into Query_log_event if
    m_binlog_invoker is not NONE; It will be stored into invoker_host and
    invoker_user by SQL thread.
   */
  enum need_invoker m_binlog_invoker;

  /**
    It points to the invoker in the Query_log_event.
    SQL thread use it as the default definer in CREATE/ALTER SP, SF, Event,
    TRIGGER or VIEW statements or current user in account management
    statements if it is not NULL.
   */
  AUTHID invoker;

public:
  Session_tracker session_tracker;
  /*
    Flag, mutex and condition for a thread to wait for a signal from another
    thread.

    Currently used to wait for group commit to complete, and COND_wakeup_ready
    is used for threads to wait on semi-sync ACKs (though is protected by
    Repl_semi_sync_master::LOCK_binlog). Note the following relationships
    between these two use-cases when using
    rpl_semi_sync_master_wait_point=AFTER_SYNC during group commit:
      1) Non-leader threads use COND_wakeup_ready to wait for the leader thread
         to complete binlog commit.
      2) The leader thread uses COND_wakeup_ready to await ACKs from the
         replica before signalling the non-leader threads to wake up.

    With wait_point=AFTER_COMMIT, there is no overlap as binlogging has
    finished, so COND_wakeup_ready is safe to re-use.
  */
  bool wakeup_ready;
  mysql_mutex_t LOCK_wakeup_ready;
  mysql_cond_t COND_wakeup_ready;
  /*
    The GTID assigned to the last commit. If no GTID was assigned to any commit
    so far, this is indicated by last_commit_gtid.seq_no == 0.
  */
private:
  rpl_gtid m_last_commit_gtid;

public:
  rpl_gtid get_last_commit_gtid() { return m_last_commit_gtid; }
  void set_last_commit_gtid(rpl_gtid &gtid);


  LF_PINS *tdc_hash_pins;
  LF_PINS *xid_hash_pins;
  bool fix_xid_hash_pins();

  const XID *get_xid() const
  {
#ifdef WITH_WSREP
    if (!wsrep_xid.is_null())
      return &wsrep_xid;
#endif /* WITH_WSREP */
    return (transaction->xid_state.is_explicit_XA() ?
            transaction->xid_state.get_xid() :
            &transaction->implicit_xid);
  }

/* Members related to temporary tables. */
public:
  /* Opened table states. */
  enum Temporary_table_state {
    TMP_TABLE_IN_USE,
    TMP_TABLE_NOT_IN_USE,
    TMP_TABLE_ANY
  };
  bool has_thd_temporary_tables();
  bool has_temporary_tables();

  TABLE *create_and_open_tmp_table(LEX_CUSTRING *frm,
                                   const char *path,
                                   const char *db,
                                   const char *table_name,
                                   bool open_internal_tables);

  TABLE *find_temporary_table(const char *db, const char *table_name,
                              Temporary_table_state state= TMP_TABLE_IN_USE);
  TABLE *find_temporary_table(const TABLE_LIST *tl,
                              Temporary_table_state state= TMP_TABLE_IN_USE);

  TMP_TABLE_SHARE *find_tmp_table_share_w_base_key(const char *key,
                                                   uint key_length);
  TMP_TABLE_SHARE *find_tmp_table_share(const char *db,
                                        const char *table_name);
  TMP_TABLE_SHARE *find_tmp_table_share(const TABLE_LIST *tl);
  TMP_TABLE_SHARE *find_tmp_table_share(const char *key, size_t key_length);

  bool open_temporary_table(TABLE_LIST *tl);
  bool open_temporary_tables(TABLE_LIST *tl);

  bool close_temporary_tables();
  bool rename_temporary_table(TABLE *table, const LEX_CSTRING *db,
                              const LEX_CSTRING *table_name);
  bool drop_temporary_table(TABLE *table, bool *is_trans, bool delete_table);
  bool rm_temporary_table(handlerton *hton, const char *path);
  void mark_tmp_tables_as_free_for_reuse();
  void mark_tmp_table_as_free_for_reuse(TABLE *table);

  TMP_TABLE_SHARE* save_tmp_table_share(TABLE *table);
  void restore_tmp_table_share(TMP_TABLE_SHARE *share);
  void close_unused_temporary_table_instances(const TABLE_LIST *tl);

private:
  /* Whether a lock has been acquired? */
  bool m_tmp_tables_locked;

  uint create_tmp_table_def_key(char *key, const char *db,
                                const char *table_name);
  TMP_TABLE_SHARE *create_temporary_table(LEX_CUSTRING *frm,
                                          const char *path, const char *db,
                                          const char *table_name);
  TABLE *find_temporary_table(const char *key, uint key_length,
                              Temporary_table_state state);
  TABLE *open_temporary_table(TMP_TABLE_SHARE *share, const char *alias);
  bool find_and_use_tmp_table(const TABLE_LIST *tl, TABLE **out_table);
  bool use_temporary_table(TABLE *table, TABLE **out_table);
  void close_temporary_table(TABLE *table);
  bool log_events_and_free_tmp_shares();
  bool free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table);
  void free_temporary_table(TABLE *table);
  bool lock_temporary_tables();
  void unlock_temporary_tables();

  inline uint tmpkeyval(TMP_TABLE_SHARE *share)
  {
    return uint4korr(share->table_cache_key.str +
                     share->table_cache_key.length - 4);
  }

  inline TMP_TABLE_SHARE *tmp_table_share(TABLE *table)
  {
    DBUG_ASSERT(table->s->tmp_table);
    return static_cast<TMP_TABLE_SHARE *>(table->s);
  }

public:
  thd_async_state async_state;
#ifdef HAVE_REPLICATION
  /*
    If we do a purge of binary logs, log index info of the threads
    that are currently reading it needs to be adjusted. To do that
    each thread that is using LOG_INFO needs to adjust the pointer to it
  */
  LOG_INFO *current_linfo;
  Slave_info *slave_info;

  void set_current_linfo(LOG_INFO *linfo);
  void reset_current_linfo() { set_current_linfo(0); }

  int register_slave(uchar *packet, size_t packet_length);
  void unregister_slave();
  bool is_binlog_dump_thread();
#endif

  inline ulong wsrep_binlog_format(ulong binlog_format) const
  {
#ifdef WITH_WSREP
    // During CTAS we force ROW format
    if (wsrep_ctas)
      return BINLOG_FORMAT_ROW;
    else
      return ((wsrep_forced_binlog_format != BINLOG_FORMAT_UNSPEC) ?
               wsrep_forced_binlog_format : binlog_format);
#else
    return (binlog_format);
#endif
  }

#ifdef WITH_WSREP
  bool                      wsrep_applier; /* dedicated slave applier thread */
  bool                      wsrep_applier_closing; /* applier marked to close */
  bool                      wsrep_client_thread; /* to identify client threads*/
  query_id_t                wsrep_last_query_id;
  XID                       wsrep_xid;

  /** This flag denotes that record locking should be skipped during INSERT,
     gap locking during SELECT, and write-write conflicts due to innodb
     snapshot isolation during DELETE.
     Only used by the streaming replication thread that only modifies the
     mysql.wsrep_streaming_log table. */
  my_bool                   wsrep_skip_locking;

  mysql_cond_t              COND_wsrep_thd;

  // changed from wsrep_seqno_t to wsrep_trx_meta_t in wsrep API rev 75
  uint32                    wsrep_rand;
  rpl_group_info            *wsrep_rgi;
  bool                      wsrep_converted_lock_session;
  char                      wsrep_info[128]; /* string for dynamic proc info */
  ulong                     wsrep_retry_counter; // of autocommit
  bool                      wsrep_PA_safe;
  char*                     wsrep_retry_query;
  size_t                    wsrep_retry_query_len;
  enum enum_server_command  wsrep_retry_command;
  enum wsrep_consistency_check_mode 
                            wsrep_consistency_check;
  std::vector<wsrep::provider::status_variable> wsrep_status_vars;
  int                       wsrep_mysql_replicated;
  const char*               wsrep_TOI_pre_query; /* a query to apply before 
                                                    the actual TOI query */
  size_t                    wsrep_TOI_pre_query_len;
  wsrep_po_handle_t         wsrep_po_handle;
  size_t                    wsrep_po_cnt;
  void                      *wsrep_apply_format;
  uchar*                    wsrep_rbr_buf;
  wsrep_gtid_t              wsrep_sync_wait_gtid;
  uint64                    wsrep_last_written_gtid_seqno;
  uint64                    wsrep_current_gtid_seqno;
  ulong                     wsrep_affected_rows;
  bool                      wsrep_has_ignored_error;
  /* true if wsrep_on was ON in last wsrep_on_update */
  bool                      wsrep_was_on;

  /*
    When enabled, do not replicate/binlog updates from the current table that's
    being processed. At the moment, it is used to keep mysql.gtid_slave_pos
    table updates from being replicated to other nodes via galera replication.
  */
  bool                      wsrep_ignore_table;
  /* thread who has started kill for this THD protected by LOCK_thd_data*/
  my_thread_id              wsrep_aborter;
  /* Kill signal used, if thread was killed by manual KILL. Protected by
     LOCK_thd_kill. */
  std::atomic<killed_state> wsrep_abort_by_kill;
  /* */
  struct err_info*          wsrep_abort_by_kill_err;
#ifndef DBUG_OFF
  int                       wsrep_killed_state;
#endif /* DBUG_OFF */
  /* true if BF abort is observed in do_command() right after reading
  client's packet, and if the client has sent PS execute command. */
  bool                      wsrep_delayed_BF_abort;
  // true if this transaction is CREATE TABLE AS SELECT (CTAS)
  bool                      wsrep_ctas;
  /*
    Transaction id:
    * m_wsrep_next_trx_id is assigned on the first query after
      wsrep_next_trx_id() return WSREP_UNDEFINED_TRX_ID
    * Each storage engine must assign value of wsrep_next_trx_id()
      when the transaction starts.
    * Effective transaction id is returned via wsrep_trx_id()
   */
  /*
    Return effective transaction id
  */
  wsrep_trx_id_t wsrep_trx_id() const
  {
    return m_wsrep_client_state.transaction().id().get();
  }


  /*
    Set next trx id
   */
  void set_wsrep_next_trx_id(query_id_t query_id)
  {
    m_wsrep_next_trx_id = (wsrep_trx_id_t) query_id;
  }
  /*
    Return next trx id
   */
  wsrep_trx_id_t wsrep_next_trx_id() const
  {
    return m_wsrep_next_trx_id;
  }
  /*
    If node is async slave and have parallel execution, wait for prior commits.
   */
  bool wsrep_parallel_slave_wait_for_prior_commit();
private:
  wsrep_trx_id_t m_wsrep_next_trx_id; /* cast from query_id_t */
  /* wsrep-lib */
  Wsrep_mutex m_wsrep_mutex;
  Wsrep_condition_variable m_wsrep_cond;
  Wsrep_client_service m_wsrep_client_service;
  Wsrep_client_state m_wsrep_client_state;

public:
  Wsrep_client_state& wsrep_cs() { return m_wsrep_client_state; }
  const Wsrep_client_state& wsrep_cs() const { return m_wsrep_client_state; }
  const wsrep::transaction& wsrep_trx() const
  { return m_wsrep_client_state.transaction(); }
  const wsrep::streaming_context& wsrep_sr() const
  { return m_wsrep_client_state.transaction().streaming_context(); }
  /* Pointer to applier service for streaming THDs. This is needed to
     be able to delete applier service object in case of background
     rollback. */
  Wsrep_applier_service* wsrep_applier_service;
  /* wait_for_commit struct for binlog group commit */
  wait_for_commit wsrep_wfc;
#endif /* WITH_WSREP */

  /* Handling of timeouts for commands */
  thr_timer_t query_timer;

public:
  void set_query_timer()
  {
#ifndef EMBEDDED_LIBRARY
    /*
      Don't start a query timer if
      - If timeouts are not set
      - if we are in a stored procedure or sub statement
      - If this is a slave thread
      - If we already have set a timeout (happens when running prepared
        statements that calls mysql_execute_command())
    */
    if (!variables.max_statement_time || spcont  || in_sub_stmt ||
        slave_thread || query_timer.expired == 0)
      return;
    thr_timer_settime(&query_timer, variables.max_statement_time);
#endif
  }
  void reset_query_timer()
  {
#ifndef EMBEDDED_LIBRARY
    if (spcont || in_sub_stmt || slave_thread)
      return;
    if (!query_timer.expired)
      thr_timer_end(&query_timer);
#endif
  }
  bool restore_set_statement_var()
  {
    return main_lex.restore_set_statement_var();
  }
  /* Copy relevant `stmt` transaction flags to `all` transaction. */
  void merge_unsafe_rollback_flags()
  {
    if (transaction->stmt.modified_non_trans_table)
      transaction->all.modified_non_trans_table= TRUE;
    transaction->all.m_unsafe_rollback_flags|=
      (transaction->stmt.m_unsafe_rollback_flags &
       (THD_TRANS::MODIFIED_NON_TRANS_TABLE |
        THD_TRANS::DID_WAIT | THD_TRANS::CREATED_TEMP_TABLE |
        THD_TRANS::DROPPED_TEMP_TABLE | THD_TRANS::DID_DDL |
        THD_TRANS::EXECUTED_TABLE_ADMIN_CMD));
  }

  uint get_net_wait_timeout()
  {
    if (in_active_multi_stmt_transaction())
    {
      if (transaction->all.is_trx_read_write())
      {
        if (variables.idle_write_transaction_timeout > 0)
          return variables.idle_write_transaction_timeout;
      }
      else
      {
        if (variables.idle_readonly_transaction_timeout > 0)
          return variables.idle_readonly_transaction_timeout;
      }

      if (variables.idle_transaction_timeout > 0)
        return variables.idle_transaction_timeout;
    }

    return variables.net_wait_timeout;
  }

  /**
    Switch to a sublex, to parse a substatement or an expression.
  */
  void set_local_lex(sp_lex_local *sublex)
  {
    DBUG_ASSERT(lex->sphead);
    lex= sublex;
    /* Reset part of parser state which needs this. */
    m_parser_state->m_yacc.reset_before_substatement();
  }

  /**
    Switch back from a sublex (currently pointed by this->lex) to the old lex.
    Sublex is merged to "oldlex" and this->lex is set to "oldlex".

    This method is called after parsing a substatement or an expression.
    set_local_lex() must be previously called.
    @param oldlex - The old lex which was active before set_local_lex().
    @returns      - false on success, true on error (failed to merge LEX's).

    See also sp_head::merge_lex().
  */
  bool restore_from_local_lex_to_old_lex(LEX *oldlex);

  Item *sp_fix_func_item(Item **it_addr);
  Item *sp_prepare_func_item(Item **it_addr, uint cols= 1);
  bool sp_eval_expr(Field *result_field, Item **expr_item_ptr);

  bool sql_parser(LEX *old_lex, LEX *lex,
                  char *str, uint str_len, bool stmt_prepare_mode);

  myf get_utf8_flag() const
  {
    return (variables.old_behavior & OLD_MODE_UTF8_IS_UTF8MB3 ?
            MY_UTF8_IS_UTF8MB3 : 0);
  }

  /**
    Save current lex to the output parameter and reset it to point to
    main_lex. This method is called from mysql_client_binlog_statement()
    to temporary

    @param[out] backup_lex  original value of current lex
  */

  void backup_and_reset_current_lex(LEX **backup_lex)
  {
    *backup_lex= lex;
    lex= &main_lex;
  }


  /**
    Restore current lex to its original value it had before calling the method
    backup_and_reset_current_lex().

    @param backup_lex  original value of current lex
  */

  void restore_current_lex(LEX *backup_lex)
  {
    lex= backup_lex;
  }

  bool should_collect_handler_stats()
  {
    /*
      We update handler_stats.active to ensure that we have the same
      value across the whole statement.
      This function is only called from TABLE::init() so the value will
      be the same for the whole statement.
    */
    handler_stats.active=
      ((variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_ENGINE) ||
       lex->analyze_stmt);
    return handler_stats.active;
  }

  /* Return true if we should create a note when an unusable key is found */
  bool give_notes_for_unusable_keys()
  {
    return ((variables.note_verbosity & (NOTE_VERBOSITY_UNUSABLE_KEYS)) ||
            (lex->describe && // Is EXPLAIN
             (variables.note_verbosity & NOTE_VERBOSITY_EXPLAIN)));
  }
};


/*
  Start a new independent transaction for the THD.
  The old one is stored in this object and restored when calling
  restore_old_transaction() or when the object is freed
*/

class start_new_trans
{
  /* container for handler's private per-connection data */
  Ha_data old_ha_data[MAX_HA];
  struct THD::st_transactions *old_transaction, new_transaction;
  Open_tables_backup open_tables_state_backup;
  MDL_savepoint mdl_savepoint;
  PSI_transaction_locker *m_transaction_psi;
  THD *org_thd;
  uint in_sub_stmt;
  uint server_status;
  my_bool wsrep_on;

public:
  start_new_trans(THD *thd);
  ~start_new_trans()
  {
    destroy();
  }
  void destroy()
  {
    if (org_thd)                                // Safety
      restore_old_transaction();
    new_transaction.free();
  }
  void restore_old_transaction();
};

/** A short cut for thd->get_stmt_da()->set_ok_status(). */

inline void
my_ok(THD *thd, ulonglong affected_rows_arg= 0, ulonglong id= 0,
        const char *message= NULL)
{
  thd->set_row_count_func(affected_rows_arg);
  thd->set_affected_rows(affected_rows_arg);
  thd->get_stmt_da()->set_ok_status(affected_rows_arg, id, message);
}


/** A short cut for thd->get_stmt_da()->set_eof_status(). */

inline void
my_eof(THD *thd)
{
  thd->set_row_count_func(-1);
  thd->get_stmt_da()->set_eof_status(thd);

  TRANSACT_TRACKER(add_trx_state(thd, TX_RESULT_SET));
}

#define tmp_disable_binlog(A)                                              \
  {ulonglong tmp_disable_binlog__save_options= (A)->variables.option_bits; \
  (A)->variables.option_bits&= ~OPTION_BIN_LOG;                            \
  (A)->variables.option_bits|= OPTION_BIN_TMP_LOG_OFF;

#define reenable_binlog(A)                                                  \
  (A)->variables.option_bits= tmp_disable_binlog__save_options; }


inline date_conv_mode_t sql_mode_for_dates(THD *thd)
{
  static_assert((ulonglong(date_conv_mode_t::KNOWN_MODES) &
                 ulonglong(time_round_mode_t::KNOWN_MODES)) == 0,
                "date_conv_mode_t and time_round_mode_t must use different "
                "bit values");
  static_assert(MODE_NO_ZERO_DATE    == date_mode_t::NO_ZERO_DATE &&
                MODE_NO_ZERO_IN_DATE == date_mode_t::NO_ZERO_IN_DATE &&
                MODE_INVALID_DATES   == date_mode_t::INVALID_DATES,
                "sql_mode_t and date_mode_t values must be equal");
  return date_conv_mode_t(thd->variables.sql_mode &
          (MODE_NO_ZERO_DATE | MODE_NO_ZERO_IN_DATE | MODE_INVALID_DATES));
}

/*
  Used to hold information about file and file structure in exchange
  via non-DB file (...INTO OUTFILE..., ...LOAD DATA...)
  XXX: We never call destructor for objects of this class.
*/

class sql_exchange :public Sql_alloc
{
public:
  enum enum_filetype filetype; /* load XML, Added by Arnold & Erik */
  const char *file_name;
  String *field_term,*enclosed,*line_term,*line_start,*escaped;
  bool opt_enclosed;
  bool dumpfile;
  ulong skip_lines;
  CHARSET_INFO *cs;
  sql_exchange(const char *name, bool dumpfile_flag,
               enum_filetype filetype_arg= FILETYPE_CSV);
  bool escaped_given(void) const;
};

/*
  This is used to get result from a select
*/

class JOIN;

/* Pure interface for sending tabular data */
class select_result_sink: public Sql_alloc
{
public:
  THD *thd;
  select_result_sink(THD *thd_arg): thd(thd_arg) {}
  inline int send_data_with_check(List<Item> &items,
                              SELECT_LEX_UNIT *u,
                              ha_rows sent)
  {
    if (u->lim.check_offset(sent))
      return 0;

    if (u->thd->killed == ABORT_QUERY)
      return 0;

    return send_data(items);
  }
  /*
    send_data returns 0 on ok, 1 on error and -1 if data was ignored, for
    example for a duplicate row entry written to a temp table.
  */
  virtual int send_data(List<Item> &items)=0;
  virtual ~select_result_sink() = default;
  // Used in cursors to initialize and reset
  void reinit(THD *thd_arg) { thd= thd_arg; }
};

class select_result_interceptor;

/*
  Interface for sending tabular data, together with some other stuff:

  - Primary purpose seems to be seding typed tabular data:
     = the DDL is sent with send_fields()
     = the rows are sent with send_data()
  Besides that,
  - there seems to be an assumption that the sent data is a result of 
    SELECT_LEX_UNIT *unit,
  - nest_level is used by SQL parser
*/

class select_result :public select_result_sink 
{
protected:
  /* 
    All descendant classes have their send_data() skip the first 
    unit->offset_limit_cnt rows sent.  Select_materialize
    also uses unit->get_column_types().
  */
  SELECT_LEX_UNIT *unit;
  /* Something used only by the parser: */
public:
  ha_rows est_records;  /* estimated number of records in the result */
  select_result(THD *thd_arg): select_result_sink(thd_arg), est_records(0) {}
  void set_unit(SELECT_LEX_UNIT *unit_arg) { unit= unit_arg; }
  virtual ~select_result() = default;
  /**
    Change wrapped select_result.

    Replace the wrapped result object with new_result and call
    prepare() and prepare2() on new_result.

    This base class implementation doesn't wrap other select_results.

    @param new_result The new result object to wrap around

    @retval false Success
    @retval true  Error
  */
  virtual bool change_result(select_result *new_result)
  {
    return false;
  }
  virtual int prepare(List<Item> &list, SELECT_LEX_UNIT *u)
  {
    unit= u;
    return 0;
  }
  virtual int prepare2(JOIN *join) { return 0; }
  /*
    Because of peculiarities of prepared statements protocol
    we need to know number of columns in the result set (if
    there is a result set) apart from sending columns metadata.
  */
  virtual uint field_count(List<Item> &fields) const
  { return fields.elements; }
  virtual bool send_result_set_metadata(List<Item> &list, uint flags)=0;
  virtual bool initialize_tables (JOIN *join) { return 0; }
  virtual bool send_eof()=0;
  /**
    Check if this query returns a result set and therefore is allowed in
    cursors and set an error message if it is not the case.

    @retval FALSE     success
    @retval TRUE      error, an error message is set
  */
  virtual bool check_simple_select() const;
  virtual void abort_result_set() {}
  virtual void reset_for_next_ps_execution();
  void set_thd(THD *thd_arg) { thd= thd_arg; }
  void reinit(THD *thd_arg)
  {
    select_result_sink::reinit(thd_arg);
    unit= NULL;
  }
#ifdef EMBEDDED_LIBRARY
  virtual void begin_dataset() {}
#else
  void begin_dataset() {}
#endif
  virtual void update_used_tables() {}

  /* this method is called just before the first row of the table can be read */
  virtual void prepare_to_read_rows() {}

  void remove_offset_limit()
  {
    unit->lim.remove_offset();
  }

  /*
    This returns
    - NULL if the class sends output row to the client
    - this if the output is set elsewhere (a file, @variable, or table).
  */
  virtual select_result_interceptor *result_interceptor()=0;

  /*
    This method is used to distinguish an normal SELECT from the cursor
    structure discovery for cursor%ROWTYPE routine variables.
    If this method returns "true", then a SELECT execution performs only
    all preparation stages, but does not fetch any rows.
  */
  virtual bool view_structure_only() const { return false; }
};


/*
  This is a select_result_sink which simply writes all data into a (temporary)
  table. Creation/deletion of the table is outside of the scope of the class
  
  It is aimed at capturing SHOW EXPLAIN output, so:
  - Unlike select_result class, we don't assume that the sent data is an 
    output of a SELECT_LEX_UNIT (and so we don't apply "LIMIT x,y" from the
    unit)
  - We don't try to convert the target table to MyISAM 
*/

class select_result_explain_buffer : public select_result_sink
{
public:
  select_result_explain_buffer(THD *thd_arg, TABLE *table_arg) : 
    select_result_sink(thd_arg), dst_table(table_arg) {};

  TABLE *dst_table; /* table to write into */

  /* The following is called in the child thread: */
  int send_data(List<Item> &items) override;
};


/*
  This is a select_result_sink which stores the data in text form.

  It is only used to save EXPLAIN output.
*/

class select_result_text_buffer : public select_result_sink
{
public:
  select_result_text_buffer(THD *thd_arg): select_result_sink(thd_arg) {}
  int send_data(List<Item> &items) override;
  bool send_result_set_metadata(List<Item> &fields, uint flag);

  void save_to(String *res);
private:
  int append_row(List<Item> &items, bool send_names);

  List<char*> rows;
  int n_columns;
};


/*
  Base class for select_result descendands which intercept and
  transform result set rows. As the rows are not sent to the client,
  sending of result set metadata should be suppressed as well.
*/

class select_result_interceptor: public select_result
{
public:
  select_result_interceptor(THD *thd_arg):
    select_result(thd_arg), suppress_my_ok(false)
  {
    DBUG_ENTER("select_result_interceptor::select_result_interceptor");
    DBUG_PRINT("enter", ("this %p", this));
    DBUG_VOID_RETURN;
  }              /* Remove gcc warning */
  uint field_count(List<Item> &fields) const override { return 0; }
  bool send_result_set_metadata(List<Item> &fields, uint flag) override { return FALSE; }
  select_result_interceptor *result_interceptor() override { return this; }

  /*
    Instruct the object to not call my_ok(). Client output will be handled
    elsewhere. (this is used by ANALYZE $stmt feature).
  */
  void disable_my_ok_calls() { suppress_my_ok= true; }
  void reinit(THD *thd_arg)
  {
    select_result::reinit(thd_arg);
    suppress_my_ok= false;
  }
protected:
  bool suppress_my_ok;
};


class sp_cursor_statistics
{
protected:
  ulonglong m_fetch_count; // Number of FETCH commands since last OPEN
  ulonglong m_row_count;   // Number of successful FETCH since last OPEN
  bool m_found;            // If last FETCH fetched a row
public:
  sp_cursor_statistics()
   :m_fetch_count(0),
    m_row_count(0),
    m_found(false)
  { }
  bool found() const
  { return m_found; }

  ulonglong row_count() const
  { return m_row_count; }

  ulonglong fetch_count() const
  { return m_fetch_count; }
  void reset() { *this= sp_cursor_statistics(); }
};


/* A mediator between stored procedures and server side cursors */
class sp_lex_keeper;
class sp_cursor: public sp_cursor_statistics
{
private:
  /// An interceptor of cursor result set used to implement
  /// FETCH <cname> INTO <varlist>.
  class Select_fetch_into_spvars: public select_result_interceptor
  {
    List<sp_variable> *spvar_list;
    uint field_count;
    bool m_view_structure_only;
    bool send_data_to_variable_list(List<sp_variable> &vars, List<Item> &items);
  public:
    Select_fetch_into_spvars(THD *thd_arg, bool view_structure_only)
     :select_result_interceptor(thd_arg),
      m_view_structure_only(view_structure_only)
    {}
    void reset(THD *thd_arg)
    {
      select_result_interceptor::reinit(thd_arg);
      spvar_list= NULL;
      field_count= 0;
    }
    uint get_field_count() { return field_count; }
    void set_spvar_list(List<sp_variable> *vars) { spvar_list= vars; }

    bool send_eof() override { return FALSE; }
    int send_data(List<Item> &items) override;
    int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
    bool view_structure_only() const override { return m_view_structure_only; }
};

public:
  sp_cursor()
   :result(NULL, false),
    m_lex_keeper(NULL),
    server_side_cursor(NULL)
  { }
  sp_cursor(THD *thd_arg, sp_lex_keeper *lex_keeper, bool view_structure_only)
   :result(thd_arg, view_structure_only),
    m_lex_keeper(lex_keeper),
    server_side_cursor(NULL)
  {}

  virtual ~sp_cursor()
  { destroy(); }

  sp_lex_keeper *get_lex_keeper() { return m_lex_keeper; }

  int open(THD *thd);

  int close(THD *thd);

  my_bool is_open()
  { return MY_TEST(server_side_cursor); }

  int fetch(THD *, List<sp_variable> *vars, bool error_on_no_data);

  bool export_structure(THD *thd, Row_definition_list *list);

  void reset(THD *thd_arg, sp_lex_keeper *lex_keeper)
  {
    sp_cursor_statistics::reset();
    result.reinit(thd_arg);
    m_lex_keeper= lex_keeper;
    server_side_cursor= NULL;
  }

private:
  Select_fetch_into_spvars result;
  sp_lex_keeper *m_lex_keeper;
  Server_side_cursor *server_side_cursor;
  void destroy();
};


class select_send :public select_result {
  /**
    True if we have sent result set metadata to the client.
    In this case the client always expects us to end the result
    set with an eof or error packet
  */
  bool is_result_set_started;
public:
  select_send(THD *thd_arg):
    select_result(thd_arg), is_result_set_started(FALSE) {}
  bool send_result_set_metadata(List<Item> &list, uint flags) override;
  int send_data(List<Item> &items) override;
  bool send_eof() override;
  bool check_simple_select() const override { return FALSE; }
  void abort_result_set() override;
  void reset_for_next_ps_execution() override;
  select_result_interceptor *result_interceptor() override { return NULL; }
};


/*
  We need this class, because select_send::send_eof() will call ::my_eof.

  See also class Protocol_discard.
*/

class select_send_analyze : public select_send
{
  bool send_result_set_metadata(List<Item> &list, uint flags) override { return 0; }
  bool send_eof() override { return 0; }
  void abort_result_set() override {}
public:
  select_send_analyze(THD *thd_arg): select_send(thd_arg) {}
};


class select_to_file :public select_result_interceptor {
protected:
  sql_exchange *exchange;
  File file;
  IO_CACHE cache;
  ha_rows row_count;
  char path[FN_REFLEN];

public:
  select_to_file(THD *thd_arg, sql_exchange *ex):
    select_result_interceptor(thd_arg), exchange(ex), file(-1),row_count(0L)
  { path[0]=0; }
  ~select_to_file();
  bool send_eof() override;
  void abort_result_set() override;
  void reset_for_next_ps_execution() override;
  bool free_recources();
};


#define ESCAPE_CHARS "ntrb0ZN" // keep synchronous with READ_INFO::unescape


/*
 List of all possible characters of a numeric value text representation.
*/
#define NUMERIC_CHARS ".0123456789e+-"


class select_export :public select_to_file {
  uint field_term_length;
  int field_sep_char,escape_char,line_sep_char;
  int field_term_char; // first char of FIELDS TERMINATED BY or MAX_INT
  /*
    The is_ambiguous_field_sep field is true if a value of the field_sep_char
    field is one of the 'n', 't', 'r' etc characters
    (see the READ_INFO::unescape method and the ESCAPE_CHARS constant value).
  */
  bool is_ambiguous_field_sep;
  /*
     The is_ambiguous_field_term is true if field_sep_char contains the first
     char of the FIELDS TERMINATED BY (ENCLOSED BY is empty), and items can
     contain this character.
  */
  bool is_ambiguous_field_term;
  /*
    The is_unsafe_field_sep field is true if a value of the field_sep_char
    field is one of the '0'..'9', '+', '-', '.' and 'e' characters
    (see the NUMERIC_CHARS constant value).
  */
  bool is_unsafe_field_sep;
  bool fixed_row_size;
  CHARSET_INFO *write_cs; // output charset
public:
  select_export(THD *thd_arg, sql_exchange *ex): select_to_file(thd_arg, ex) {}
  ~select_export();
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  int send_data(List<Item> &items) override;
};


class select_dump :public select_to_file {
public:
  select_dump(THD *thd_arg, sql_exchange *ex): select_to_file(thd_arg, ex) {}
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  int send_data(List<Item> &items) override;
};


class select_insert :public select_result_interceptor {
 public:
  select_result *sel_result;
  TABLE_LIST *table_list;
  TABLE *table;
  List<Item> *fields;
  ulonglong autoinc_value_of_last_inserted_row; // autogenerated or not
  COPY_INFO info;
  bool insert_into_view;
  select_insert(THD *thd_arg, TABLE_LIST *table_list_par, TABLE *table_par,
                List<Item> *fields_par, List<Item> *update_fields,
                List<Item> *update_values, enum_duplicates duplic,
                bool ignore, select_result *sel_ret_list);
  ~select_insert();
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  int prepare2(JOIN *join) override;
  int send_data(List<Item> &items) override;
  virtual bool store_values(List<Item> &values);
  virtual bool can_rollback_data() { return 0; }
  bool prepare_eof();
  bool send_ok_packet();
  bool send_eof() override;
  void abort_result_set() override;
  /* not implemented: select_insert is never re-used in prepared statements */
  void reset_for_next_ps_execution() override;
};


class select_create: public select_insert {
  TABLE_LIST *create_table;
  Table_specification_st *create_info;
  TABLE_LIST *select_tables;
  Alter_info *alter_info;
  Field **field;
  /* lock data for tmp table */
  MYSQL_LOCK *m_lock;
  /* m_lock or thd->extra_lock */
  MYSQL_LOCK **m_plock;
  bool       exit_done;
  TMP_TABLE_SHARE *saved_tmp_table_share;
  DDL_LOG_STATE ddl_log_state_create, ddl_log_state_rm;

public:
  select_create(THD *thd_arg, TABLE_LIST *table_arg,
                Table_specification_st *create_info_par,
                Alter_info *alter_info_arg,
                List<Item> &select_fields,enum_duplicates duplic, bool ignore,
                TABLE_LIST *select_tables_arg):
    select_insert(thd_arg, table_arg, NULL, &select_fields, 0, 0, duplic,
                  ignore, NULL),
    create_table(table_arg),
    create_info(create_info_par),
    select_tables(select_tables_arg),
    alter_info(alter_info_arg),
    m_plock(NULL), exit_done(0),
    saved_tmp_table_share(0)
    {
      bzero(&ddl_log_state_create, sizeof(ddl_log_state_create));
      bzero(&ddl_log_state_rm, sizeof(ddl_log_state_rm));
    }
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;

  int binlog_show_create_table(TABLE **tables, uint count);
  bool store_values(List<Item> &values) override;
  bool send_eof() override;
  void abort_result_set() override;
  bool can_rollback_data() override { return 1; }

  // Needed for access from local class MY_HOOKS in prepare(), since thd is proteted.
  const THD *get_thd(void) { return thd; }
  const HA_CREATE_INFO *get_create_info() { return create_info; };
  int prepare2(JOIN *join) override { return 0; }

private:
  TABLE *create_table_from_items(THD *thd,
                                  List<Item> *items,
                                  MYSQL_LOCK **lock,
                                  TABLEOP_HOOKS *hooks);
};

#include <myisam.h>

#ifdef WITH_ARIA_STORAGE_ENGINE
#include <maria.h>
#else
#undef USE_ARIA_FOR_TMP_TABLES
#endif

#ifdef USE_ARIA_FOR_TMP_TABLES
#define TMP_ENGINE_COLUMNDEF MARIA_COLUMNDEF
#define TMP_ENGINE_HTON maria_hton
#define TMP_ENGINE_NAME "Aria"
inline uint tmp_table_max_key_length() { return maria_max_key_length(); }
inline uint tmp_table_max_key_parts() { return maria_max_key_segments(); }
#else
#define TMP_ENGINE_COLUMNDEF MI_COLUMNDEF
#define TMP_ENGINE_HTON myisam_hton
#define TMP_ENGINE_NAME "MyISAM"
inline uint tmp_table_max_key_length() { return MI_MAX_KEY_LENGTH; }
inline uint tmp_table_max_key_parts() { return MI_MAX_KEY_SEG; }
#endif

/*
  Param to create temporary tables when doing SELECT:s
  NOTE
    This structure is copied using memcpy as a part of JOIN.
*/

class TMP_TABLE_PARAM :public Sql_alloc
{
public:
  List<Item> copy_funcs;
  Copy_field *copy_field, *copy_field_end;
  uchar	    *group_buff;
  const char *tmp_name;
  Item	    **items_to_copy;			/* Fields in tmp table */
  TMP_ENGINE_COLUMNDEF *recinfo, *start_recinfo;
  KEY *keyinfo;
  ha_rows end_write_records;
  /**
    Number of normal fields in the query, including those referred to
    from aggregate functions. Hence, "SELECT `field1`,
    SUM(`field2`) from t1" sets this counter to 2.

    @see count_field_types
  */
  uint	field_count; 
  /**
    Number of fields in the query that have functions. Includes both
    aggregate functions (e.g., SUM) and non-aggregates (e.g., RAND).
    Also counts functions referred to from aggregate functions, i.e.,
    "SELECT SUM(RAND())" sets this counter to 2.

    @see count_field_types
  */
  uint  func_count;  
  /**
    Number of fields in the query that have aggregate functions. Note
    that the optimizer may choose to optimize away these fields by
    replacing them with constants, in which case sum_func_count will
    need to be updated.

    @see opt_sum_query, count_field_types
  */
  uint  sum_func_count;   
  uint  copy_func_count;                        // Allocated copy fields
  uint  hidden_field_count;
  uint	group_parts,group_length,group_null_parts;

  /*
    If we're doing a GROUP BY operation, shows which one is used:
    true  TemporaryTableWithPartialSums algorithm (see end_update()).
    false OrderedGroupBy algorithm (see end_write_group()).
  */
  uint	quick_group;
  /**
    Enabled when we have atleast one outer_sum_func. Needed when used
    along with distinct.

    @see create_tmp_table
  */
  bool  using_outer_summary_function;
  CHARSET_INFO *table_charset;
  bool schema_table;
  /* TRUE if the temp table is created for subquery materialization. */
  bool materialized_subquery;
  /* TRUE if all columns of the table are guaranteed to be non-nullable */
  bool force_not_null_cols;
  /*
    True if GROUP BY and its aggregate functions are already computed
    by a table access method (e.g. by loose index scan). In this case
    query execution should not perform aggregation and should treat
    aggregate functions as normal functions.
  */
  bool precomputed_group_by;
  bool group_concat;
  bool force_copy_fields;
  /*
    If TRUE, create_tmp_field called from create_tmp_table will convert
    all BIT fields to 64-bit longs. This is a workaround the limitation
    that MEMORY tables cannot index BIT columns.
  */
  bool bit_fields_as_long;
  /*
    Whether to create or postpone actual creation of this temporary table.
    TRUE <=> create_tmp_table will create only the TABLE structure.
  */
  bool skip_create_table;

  TMP_TABLE_PARAM()
    :copy_field(0), group_parts(0),
     group_length(0), group_null_parts(0),
     using_outer_summary_function(0),
     schema_table(0), materialized_subquery(0), force_not_null_cols(0),
     precomputed_group_by(0), group_concat(0),
     force_copy_fields(0), bit_fields_as_long(0), skip_create_table(0)
  {
    init();
  }
  ~TMP_TABLE_PARAM()
  {
    cleanup();
  }
  void init(void);
  inline void cleanup(void)
  {
    if (copy_field)				/* Fix for Intel compiler */
    {
      delete [] copy_field;
      copy_field= NULL;
      copy_field_end= NULL;
    }
  }
};


class select_unit :public select_result_interceptor
{
protected:
  uint curr_step, prev_step, curr_sel;
  enum sub_select_type step;
public:
  TMP_TABLE_PARAM tmp_table_param;
  /* Number of additional (hidden) field of the used temporary table */
  int addon_cnt;
  int write_err; /* Error code from the last send_data->ha_write_row call. */
  TABLE *table;

  select_unit(THD *thd_arg):
    select_result_interceptor(thd_arg), addon_cnt(0), table(0)
  {
    init();
    tmp_table_param.init();
  }
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  /**
    Do prepare() and prepare2() if they have been postponed until
    column type information is computed (used by select_union_direct).

    @param types Column types

    @return false on success, true on failure
  */
  virtual bool postponed_prepare(List<Item> &types)
  { return false; }
  int send_data(List<Item> &items) override;
  int write_record();
  int update_counter(Field *counter, longlong value);
  int delete_record();
  bool send_eof() override;
  virtual bool flush();
  void reset_for_next_ps_execution() override;
  virtual bool create_result_table(THD *thd, List<Item> *column_types,
                                   bool is_distinct, ulonglong options,
                                   const LEX_CSTRING *alias,
                                   bool bit_fields_as_long,
                                   bool create_table,
                                   bool keep_row_order,
                                   uint hidden);
  TMP_TABLE_PARAM *get_tmp_table_param() { return &tmp_table_param; }
  void init()
  {
    curr_step= prev_step= 0;
    curr_sel= UINT_MAX;
    step= UNION_TYPE;
    write_err= 0;
  }
  virtual void change_select();
  virtual bool force_enable_index_if_needed() { return false; }
};


/**
  @class select_unit_ext

  The class used when processing rows produced by operands of query expressions
  containing INTERSECT ALL and/or EXCEPT all operations. One or two extra fields
  of the temporary to store the rows of the partial and final result can be employed.
  Both of them contain counters. The second additional field is used only when
  the processed query expression contains INTERSECT ALL.

  Consider how these extra fields are used.

  Let
    table t1 (f char(8))
    table t2 (f char(8))
    table t3 (f char(8))
  contain the following sets:
    ("b"),("a"),("d"),("c"),("b"),("a"),("c"),("a")
    ("c"),("b"),("c"),("c"),("a"),("b"),("g")
    ("c"),("a"),("b"),("d"),("b"),("e")

  - Let's demonstrate how the the set operation INTERSECT ALL is proceesed
    for the query
              SELECT f FROM t1 INTERSECT ALL SELECT f FROM t2

    When send_data() is called for the rows of the first operand we put
    the processed record into the temporary table if there was no such record
    setting dup_cnt field to 1 and add_cnt field to 0 and increment the
    counter in the dup_cnt field by one otherwise. We get

      |add_cnt|dup_cnt| f |
      |0      |2      |b  |
      |0      |3      |a  |
      |0      |1      |d  |
      |0      |2      |c  |

    The call of send_eof() for the first operand swaps the values stored in
    dup_cnt and add_cnt. After this, we'll see the following rows in the
    temporary table

      |add_cnt|dup_cnt| f |
      |2      |0      |b  |
      |3      |0      |a  |
      |1      |0      |d  |
      |2      |0      |c  |

    When send_data() is called for the rows of the second operand we increment
    the counter in dup_cnt if the processed row is found in the table and do
    nothing otherwise. As a result we get

      |add_cnt|dup_cnt| f |
      |2      |2      |b  |
      |3      |1      |a  |
      |1      |0      |d  |
      |2      |3      |c  |

    At the call of send_eof() for the second operand first we disable index.
    Then for each record, the minimum of counters from dup_cnt and add_cnt m is
    taken. If m == 0 then the record is deleted. Otherwise record is replaced
    with m copies of it. Yet the counter in this copies are set to 1 for
    dup_cnt and to 0 for add_cnt

      |add_cnt|dup_cnt| f |
      |0      |1      |b  |
      |0      |1      |b  |
      |0      |1      |a  |
      |0      |1      |c  |
      |0      |1      |c  |

  - Let's demonstrate how the the set operation EXCEPT ALL is proceesed
    for the query
              SELECT f FROM t1 EXCEPT ALL SELECT f FROM t3

    Only one additional counter field dup_cnt is used for EXCEPT ALL.
    After the first operand has been processed we have in the temporary table

      |dup_cnt| f |
      |2      |b  |
      |3      |a  |
      |1      |d  |
      |2      |c  |

    When send_data() is called for the rows of the second operand we decrement
    the counter in dup_cnt if the processed row is found in the table and do
    nothing otherwise. If the counter becomes 0 we delete the record

      |dup_cnt| f |
      |2      |a  |
      |1      |c  |

    Finally at the call of send_eof() for the second operand we disable index
    unfold rows adding duplicates

      |dup_cnt| f |
      |1      |a  |
      |1      |a  |
      |1      |c  |
 */

class select_unit_ext :public select_unit
{
public:
  select_unit_ext(THD *thd_arg):
    select_unit(thd_arg), increment(0), is_index_enabled(TRUE), 
    curr_op_type(UNSPECIFIED)
  {
  };
  int send_data(List<Item> &items) override;
  void change_select() override;
  int unfold_record(ha_rows cnt);
  bool send_eof() override;
  bool force_enable_index_if_needed() override
  {
    is_index_enabled= true;
    return true;
  }
  bool disable_index_if_needed(SELECT_LEX *curr_sl);
  
  /* 
    How to change increment/decrement the counter in duplicate_cnt field 
    when processing a record produced by the current operand in send_data().
    The value can be 1 or -1
  */
  int increment;
  /* TRUE <=> the index of the result temporary table is enabled */
  bool is_index_enabled;
  /* The type of the set operation currently executed */
  enum set_op_type curr_op_type;
  /* 
    Points to the extra field of the temporary table where
    duplicate counters are stored
  */ 
  Field *duplicate_cnt;
  /* 
    Points to the extra field of the temporary table where additional
    counters used only for INTERSECT ALL operations are stored
  */
  Field *additional_cnt;
};

class select_union_recursive :public select_unit
{
 public:
  /* The temporary table with the new records generated by one iterative step */
  TABLE *incr_table;
  /* The TMP_TABLE_PARAM structure used to create incr_table */
  TMP_TABLE_PARAM incr_table_param;
  /* One of tables from the list rec_tables (determined dynamically) */
  TABLE *first_rec_table_to_update;
  /*
    The list of all recursive table references to the CTE for whose
    specification this select_union_recursive was created
 */
  List<TABLE_LIST> rec_table_refs;
  /*
    The count of how many times reset_for_next_ps_execution() was called with
    cleaned==false for the unit specifying the recursive CTE for which this
    object was created or for the unit specifying a CTE that mutually
    recursive with this CTE.
  */
  uint cleanup_count;
  long row_counter;

  select_union_recursive(THD *thd_arg):
    select_unit(thd_arg),
      incr_table(0), first_rec_table_to_update(0), cleanup_count(0),
      row_counter(0)
  { incr_table_param.init(); };

  int send_data(List<Item> &items) override;
  bool create_result_table(THD *thd, List<Item> *column_types,
                           bool is_distinct, ulonglong options,
                           const LEX_CSTRING *alias,
                           bool bit_fields_as_long,
                           bool create_table,
                           bool keep_row_order,
                           uint hidden) override;
  void reset_for_next_ps_execution() override;
};

/**
  UNION result that is passed directly to the receiving select_result
  without filling a temporary table.

  Function calls are forwarded to the wrapped select_result, but some
  functions are expected to be called only once for each query, so
  they are only executed for the first SELECT in the union (execept
  for send_eof(), which is executed only for the last SELECT).

  This select_result is used when a UNION is not DISTINCT and doesn't
  have a global ORDER BY clause. @see st_select_lex_unit::prepare().
*/

class select_union_direct :public select_unit
{
private:
  /* Result object that receives all rows */
  select_result *result;
  /* The last SELECT_LEX of the union */
  SELECT_LEX *last_select_lex;

  /* Wrapped result has received metadata */
  bool done_send_result_set_metadata;
  /* Wrapped result has initialized tables */
  bool done_initialize_tables;

  /* Accumulated limit_found_rows */
  ulonglong limit_found_rows;

  /* Number of rows offset */
  ha_rows offset;
  /* Number of rows limit + offset, @see select_union_direct::send_data() */
  ha_rows limit;

public:
  /* Number of rows in the union */
  ha_rows send_records; 
  select_union_direct(THD *thd_arg, select_result *result_arg,
                      SELECT_LEX *last_select_lex_arg):
  select_unit(thd_arg), result(result_arg),
    last_select_lex(last_select_lex_arg),
    done_send_result_set_metadata(false), done_initialize_tables(false),
    limit_found_rows(0)
    { send_records= 0; }
  bool change_result(select_result *new_result) override;
  uint field_count(List<Item> &fields) const override
  {
    // Only called for top-level select_results, usually select_send
    DBUG_ASSERT(false); /* purecov: inspected */
    return 0; /* purecov: inspected */
  }
  bool postponed_prepare(List<Item> &types) override;
  bool send_result_set_metadata(List<Item> &list, uint flags) override;
  int send_data(List<Item> &items) override;
  bool initialize_tables (JOIN *join) override;
  bool send_eof() override;
  bool flush() override { return false; }
  bool check_simple_select() const override
  {
    /* Only called for top-level select_results, usually select_send */
    DBUG_ASSERT(false); /* purecov: inspected */
    return false; /* purecov: inspected */
  }
  void abort_result_set() override
  {
    result->abort_result_set(); /* purecov: inspected */
  }
  void reset_for_next_ps_execution() override
  {
    send_records= 0;
  }
  void set_thd(THD *thd_arg)
  {
    /*
      Only called for top-level select_results, usually select_send,
      and for the results of subquery engines
      (select_<something>_subselect).
    */
    DBUG_ASSERT(false); /* purecov: inspected */
  }
  void remove_offset_limit()
  {
    // EXPLAIN should never output to a select_union_direct
    DBUG_ASSERT(false); /* purecov: inspected */
  }
#ifdef EMBEDDED_LIBRARY
  void begin_dataset() override
#else
  void begin_dataset()
#endif
  {
    // Only called for sp_cursor::Select_fetch_into_spvars
    DBUG_ASSERT(false); /* purecov: inspected */
  }
};


/* Base subselect interface class */
class select_subselect :public select_result_interceptor
{
protected:
  Item_subselect *item;
public:
  select_subselect(THD *thd_arg, Item_subselect *item_arg):
    select_result_interceptor(thd_arg), item(item_arg) {}
  int send_data(List<Item> &items) override=0;
  bool send_eof() override { return 0; };
};

/* Single value subselect interface class */
class select_singlerow_subselect :public select_subselect
{
public:
  select_singlerow_subselect(THD *thd_arg, Item_subselect *item_arg):
    select_subselect(thd_arg, item_arg)
  {}
  int send_data(List<Item> &items) override;
};


/*
  This class specializes select_union to collect statistics about the
  data stored in the temp table. Currently the class collects statistcs
  about NULLs.
*/

class select_materialize_with_stats : public select_unit
{
protected:
  class Column_statistics
  {
  public:
    /* Count of NULLs per column. */
    ha_rows null_count;
    /* The row number that contains the first NULL in a column. */
    ha_rows min_null_row;
    /* The row number that contains the last NULL in a column. */
    ha_rows max_null_row;
  };

  /* Array of statistics data per column. */
  Column_statistics* col_stat;

  /*
    The number of columns in the biggest sub-row that consists of only
    NULL values.
  */
  uint max_nulls_in_row;
  /*
    Count of rows writtent to the temp table. This is redundant as it is
    already stored in handler::stats.records, however that one is relatively
    expensive to compute (given we need that for evry row).
  */
  ha_rows count_rows;

protected:
  void reset();

public:
  select_materialize_with_stats(THD *thd_arg): select_unit(thd_arg)
  { tmp_table_param.init(); }
  bool create_result_table(THD *thd, List<Item> *column_types,
                           bool is_distinct, ulonglong options,
                           const LEX_CSTRING *alias,
                           bool bit_fields_as_long,
                           bool create_table,
                           bool keep_row_order,
                           uint hidden) override;
  bool init_result_table(ulonglong select_options);
  int send_data(List<Item> &items) override;
  void reset_for_next_ps_execution() override;
  ha_rows get_null_count_of_col(uint idx)
  {
    DBUG_ASSERT(idx < table->s->fields);
    return col_stat[idx].null_count;
  }
  ha_rows get_max_null_of_col(uint idx)
  {
    DBUG_ASSERT(idx < table->s->fields);
    return col_stat[idx].max_null_row;
  }
  ha_rows get_min_null_of_col(uint idx)
  {
    DBUG_ASSERT(idx < table->s->fields);
    return col_stat[idx].min_null_row;
  }
  uint get_max_nulls_in_row() { return max_nulls_in_row; }
};


/* used in independent ALL/ANY optimisation */
class select_max_min_finder_subselect :public select_subselect
{
  Item_cache *cache;
  bool (select_max_min_finder_subselect::*op)();
  bool fmax;
  bool is_all;
  void set_op(const Type_handler *ha);
public:
  select_max_min_finder_subselect(THD *thd_arg, Item_subselect *item_arg,
                                  bool mx, bool all):
    select_subselect(thd_arg, item_arg), cache(0), fmax(mx), is_all(all)
  {}
  void reset_for_next_ps_execution() override;
  int send_data(List<Item> &items) override;
  bool cmp_real();
  bool cmp_int();
  bool cmp_decimal();
  bool cmp_str();
  bool cmp_time();
  bool cmp_native();
};

/* EXISTS subselect interface class */
class select_exists_subselect :public select_subselect
{
public:
  select_exists_subselect(THD *thd_arg, Item_subselect *item_arg):
    select_subselect(thd_arg, item_arg) {}
  int send_data(List<Item> &items) override;
};


/*
  Optimizer and executor structure for the materialized semi-join info. This
  structure contains
   - The sj-materialization temporary table
   - Members needed to make index lookup or a full scan of the temptable.
*/
class POSITION;

class SJ_MATERIALIZATION_INFO : public Sql_alloc
{
public:
  /* Optimal join sub-order */
  POSITION *positions;

  uint tables; /* Number of tables in the sj-nest */

  /* Number of rows in the materialized table, before the de-duplication */
  double rows_with_duplicates;

  /* Expected #rows in the materialized table, after de-duplication */
  double rows;

  /* 
    Cost to materialize - execute the sub-join and write rows into temp.table
  */
  Cost_estimate materialization_cost;

  /* Cost to make one lookup in the temptable */
  Cost_estimate lookup_cost;
  
  /* Cost of scanning the materialized table */
  Cost_estimate scan_cost;

  /* --- Execution structures ---------- */
  
  /*
    TRUE <=> This structure is used for execution. We don't necessarily pick
    sj-materialization, so some of SJ_MATERIALIZATION_INFO structures are not
    used by materialization
  */
  bool is_used;
  
  bool materialized; /* TRUE <=> materialization already performed */
  /*
    TRUE  - the temptable is read with full scan
    FALSE - we use the temptable for index lookups
  */
  bool is_sj_scan; 
  
  /* The temptable and its related info */
  TMP_TABLE_PARAM sjm_table_param;
  List<Item> sjm_table_cols;
  TABLE *table;

  /* Structure used to make index lookups */
  struct st_table_ref *tab_ref;
  Item *in_equality; /* See create_subq_in_equalities() */

  Item *join_cond; /* See comments in make_join_select() */
  Copy_field *copy_field; /* Needed for SJ_Materialization scan */
};


/* Structs used when sorting */
struct SORT_FIELD_ATTR
{
  /*
    If using mem-comparable fixed-size keys:
    length of the mem-comparable image of the field, in bytes.

    If using packed keys: still the same? Not clear what is the use of it.
  */
  uint length;

  /*
    For most datatypes, this is 0.
    The exception are the VARBINARY columns.
    For those columns, the comparison actually compares

      (value_prefix(N), suffix=length(value))

    Here value_prefix is either the whole value or its prefix if it was too
    long, and the suffix is the length of the original value.
    (this way, for values X and Y:  if X=prefix(Y) then X compares as less
    than Y
  */
  uint suffix_length;

  /*
    If using packed keys, number of bytes that are used to store the length
    of the packed key.

  */
  uint length_bytes;

  /* Max. length of the original value, in bytes */
  uint original_length;
  enum Type { FIXED_SIZE, VARIABLE_SIZE } type;
  /*
    TRUE  : if the item or field is NULLABLE
    FALSE : otherwise
  */
  bool maybe_null;
  CHARSET_INFO *cs;
  uint pack_sort_string(uchar *to, const Binary_string *str,
                        CHARSET_INFO *cs) const;
  int compare_packed_fixed_size_vals(const uchar *a, size_t *a_len,
                                     const uchar *b, size_t *b_len);
  int compare_packed_varstrings(const uchar *a, size_t *a_len,
                                const uchar *b, size_t *b_len);
  bool check_if_packing_possible(THD *thd) const;
  bool is_variable_sized() { return type == VARIABLE_SIZE; }
  void set_length_and_original_length(THD *thd, uint length_arg);
};


struct SORT_FIELD: public SORT_FIELD_ATTR
{
  Field *field;				/* Field to sort */
  Item	*item;				/* Item if not sorting fields */
  bool reverse;				/* if descending sort */
};


typedef struct st_sort_buffer {
  uint index;					/* 0 or 1 */
  uint sort_orders;
  uint change_pos;				/* If sort-fields changed */
  char **buff;
  SORT_FIELD *sortorder;
} SORT_BUFFER;

/* Structure for db & table in sql_yacc */

class Table_ident :public Sql_alloc
{
public:
  LEX_CSTRING db;
  LEX_CSTRING table;
  SELECT_LEX_UNIT *sel;
  inline Table_ident(THD *thd, const LEX_CSTRING *db_arg,
                     const LEX_CSTRING *table_arg,
		     bool force)
    :table(*table_arg), sel((SELECT_LEX_UNIT *)0)
  {
    if (!force && (thd->client_capabilities & CLIENT_NO_SCHEMA))
      db= null_clex_str;
    else
      db= *db_arg;
  }
  inline Table_ident(const LEX_CSTRING *table_arg)
    :table(*table_arg), sel((SELECT_LEX_UNIT *)0)
  {
    db= null_clex_str;
  }
  /*
    This constructor is used only for the case when we create a derived
    table. A derived table has no name and doesn't belong to any database.
    Later, if there was an alias specified for the table, it will be set
    by add_table_to_list.
  */
  inline Table_ident(SELECT_LEX_UNIT *s) : sel(s)
  {
    /* We must have a table name here as this is used with add_table_to_list */
    db.str= empty_c_string;                    /* a subject to casedn_str */
    db.length= 0;
    table.str= internal_table_name;
    table.length=1;
  }
  bool is_derived_table() const { return MY_TEST(sel); }
  inline void change_db(LEX_CSTRING *db_name)
  {
    db= *db_name;
  }
  bool resolve_table_rowtype_ref(THD *thd, Row_definition_list &defs);
  bool append_to(THD *thd, String *to) const;
};


class Qualified_column_ident: public Table_ident
{
public:
  LEX_CSTRING m_column;
public:
  Qualified_column_ident(const LEX_CSTRING *column)
    :Table_ident(&null_clex_str),
    m_column(*column)
  { }
  Qualified_column_ident(const LEX_CSTRING *table, const LEX_CSTRING *column)
   :Table_ident(table),
    m_column(*column)
  { }
  Qualified_column_ident(THD *thd,
                         const LEX_CSTRING *db,
                         const LEX_CSTRING *table,
                         const LEX_CSTRING *column)
   :Table_ident(thd, db, table, false),
    m_column(*column)
  { }
  bool resolve_type_ref(THD *thd, Column_definition *def);
  bool append_to(THD *thd, String *to) const;
};


// this is needed for user_vars hash
class user_var_entry: public Type_handler_hybrid_field_type
{
  CHARSET_INFO *m_charset;
 public:
  user_var_entry() = default;                         /* Remove gcc warning */
  LEX_CSTRING name;
  char *value;
  size_t length;
  query_id_t update_query_id, used_query_id;

  double val_real(bool *null_value);
  longlong val_int(bool *null_value) const;
  String *val_str(bool *null_value, String *str, uint decimals) const;
  my_decimal *val_decimal(bool *null_value, my_decimal *result);
  CHARSET_INFO *charset() const { return m_charset; }
  void set_charset(CHARSET_INFO *cs) { m_charset= cs; }
};

user_var_entry *get_variable(HASH *hash, LEX_CSTRING *name,
				    bool create_if_not_exists);

class SORT_INFO;
class multi_delete :public select_result_interceptor
{
  TABLE_LIST *delete_tables, *table_being_deleted;
  Unique **tempfiles;
  ha_rows deleted, found;
  uint num_of_tables;
  int error;
  bool do_delete;
  /* True if at least one table we delete from is transactional */
  bool transactional_tables;
  /* True if at least one table we delete from is not transactional */
  bool normal_tables;
  bool delete_while_scanning;
  /*
     error handling (rollback and binlogging) can happen in send_eof()
     so that afterward abort_result_set() needs to find out that.
  */
  bool error_handled;

public:
  // Methods used by ColumnStore
  uint get_num_of_tables() const { return num_of_tables; }
  TABLE_LIST* get_tables() const { return delete_tables; }
public:
  multi_delete(THD *thd_arg, TABLE_LIST *dt, uint num_of_tables);
  ~multi_delete();
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  int send_data(List<Item> &items) override;
  bool initialize_tables (JOIN *join) override;
  int do_deletes();
  int do_table_deletes(TABLE *table, SORT_INFO *sort_info, bool ignore);
  bool send_eof() override;
  inline ha_rows num_deleted() const { return deleted; }
  void abort_result_set() override;
  void prepare_to_read_rows() override;
};


class multi_update :public select_result_interceptor
{
  TABLE_LIST *all_tables; /* query/update command tables */
  List<TABLE_LIST> *leaves;     /* list of leaves of join table tree */
  List<TABLE_LIST> updated_leaves;  /* list of of updated leaves */
  TABLE_LIST *update_tables;
  TABLE **tmp_tables, *main_table, *table_to_update;
  TMP_TABLE_PARAM *tmp_table_param;
  ha_rows updated, found;
  List <Item> *fields, *values;
  List <Item> **fields_for_table, **values_for_table;
  uint table_count;
  /*
   List of tables referenced in the CHECK OPTION condition of
   the updated view excluding the updated table.
  */
  List <TABLE> unupdated_check_opt_tables;
  Copy_field *copy_field;
  enum enum_duplicates handle_duplicates;
  bool do_update, trans_safe;
  /* True if the update operation has made a change in a transactional table */
  bool transactional_tables;
  bool ignore;
  /* 
     error handling (rollback and binlogging) can happen in send_eof()
     so that afterward  abort_result_set() needs to find out that.
  */
  bool error_handled;
  
  /* Need this to protect against multiple prepare() calls */
  bool prepared;

  // For System Versioning (may need to insert new fields to a table).
  ha_rows updated_sys_ver;

  bool has_vers_fields;

public:
  multi_update(THD *thd_arg, TABLE_LIST *ut, List<TABLE_LIST> *leaves_list,
	       List<Item> *fields, List<Item> *values,
	       enum_duplicates handle_duplicates, bool ignore);
  ~multi_update();
  bool init(THD *thd);
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  int send_data(List<Item> &items) override;
  bool initialize_tables (JOIN *join) override;
  int prepare2(JOIN *join) override;
  int  do_updates();
  bool send_eof() override;
  inline ha_rows num_found() const { return found; }
  inline ha_rows num_updated() const { return updated; }
  void abort_result_set() override;
  void update_used_tables() override;
  void prepare_to_read_rows() override;
};

class my_var_sp;
class my_var : public Sql_alloc  {
public:
  const LEX_CSTRING name;
  enum type { SESSION_VAR, LOCAL_VAR, PARAM_VAR };
  type scope;
  my_var(const LEX_CSTRING *j, enum type s) : name(*j), scope(s) { }
  virtual ~my_var() = default;
  virtual bool set(THD *thd, Item *val) = 0;
  virtual my_var_sp *get_my_var_sp() { return NULL; }
};

class my_var_sp: public my_var {
  const Sp_rcontext_handler *m_rcontext_handler;
  const Type_handler *m_type_handler;
public:
  uint offset;
  /*
    Routine to which this Item_splocal belongs. Used for checking if correct
    runtime context is used for variable handling.
  */
  sp_head *sp;
  my_var_sp(const Sp_rcontext_handler *rcontext_handler,
            const LEX_CSTRING *j, uint o, const Type_handler *type_handler,
            sp_head *s)
    : my_var(j, LOCAL_VAR),
      m_rcontext_handler(rcontext_handler),
      m_type_handler(type_handler), offset(o), sp(s) { }
  ~my_var_sp() = default;
  bool set(THD *thd, Item *val) override;
  my_var_sp *get_my_var_sp() override { return this; }
  const Type_handler *type_handler() const
  { return m_type_handler; }
  sp_rcontext *get_rcontext(sp_rcontext *local_ctx) const;
};

/*
  This class handles fields of a ROW SP variable when it's used as a OUT
  parameter in a stored procedure.
*/
class my_var_sp_row_field: public my_var_sp
{
  uint m_field_offset;
public:
  my_var_sp_row_field(const Sp_rcontext_handler *rcontext_handler,
                      const LEX_CSTRING *varname, const LEX_CSTRING *fieldname,
                      uint var_idx, uint field_idx, sp_head *s)
   :my_var_sp(rcontext_handler, varname, var_idx,
              &type_handler_double/*Not really used*/, s),
    m_field_offset(field_idx)
  { }
  bool set(THD *thd, Item *val) override;
};

class my_var_user: public my_var {
public:
  my_var_user(const LEX_CSTRING *j)
    : my_var(j, SESSION_VAR) { }
  ~my_var_user() = default;
  bool set(THD *thd, Item *val) override;
};

class select_dumpvar :public select_result_interceptor {
  ha_rows row_count;
  my_var_sp *m_var_sp_row; // Not NULL if SELECT INTO row_type_sp_variable
  bool send_data_to_var_list(List<Item> &items);
public:
  List<my_var> var_list;
  select_dumpvar(THD *thd_arg)
   :select_result_interceptor(thd_arg), row_count(0), m_var_sp_row(NULL)
  { var_list.empty(); }
  ~select_dumpvar() = default;
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
  int send_data(List<Item> &items) override;
  bool send_eof() override;
  bool check_simple_select() const override;
  void reset_for_next_ps_execution() override;
};

/* Bits in sql_command_flags */

#define CF_CHANGES_DATA           (1U << 0)
#define CF_REPORT_PROGRESS        (1U << 1)
#define CF_STATUS_COMMAND         (1U << 2)
#define CF_SHOW_TABLE_COMMAND     (1U << 3)
#define CF_WRITE_LOGS_COMMAND     (1U << 4)

/**
  Must be set for SQL statements that may contain
  Item expressions and/or use joins and tables.
  Indicates that the parse tree of such statement may
  contain rule-based optimizations that depend on metadata
  (i.e. number of columns in a table), and consequently
  that the statement must be re-prepared whenever
  referenced metadata changes. Must not be set for
  statements that themselves change metadata, e.g. RENAME,
  ALTER and other DDL, since otherwise will trigger constant
  reprepare. Consequently, complex item expressions and
  joins are currently prohibited in these statements.
*/
#define CF_REEXECUTION_FRAGILE    (1U << 5)
/**
  Implicitly commit before the SQL statement is executed.

  Statements marked with this flag will cause any active
  transaction to end (commit) before proceeding with the
  command execution.

  This flag should be set for statements that probably can't
  be rolled back or that do not expect any previously metadata
  locked tables.
*/
#define CF_IMPLICIT_COMMIT_BEGIN   (1U << 6)
/**
  Implicitly commit after the SQL statement.

  Statements marked with this flag are automatically committed
  at the end of the statement.

  This flag should be set for statements that will implicitly
  open and take metadata locks on system tables that should not
  be carried for the whole duration of a active transaction.
*/
#define CF_IMPLICIT_COMMIT_END    (1U << 7)
/**
  CF_IMPLICT_COMMIT_BEGIN and CF_IMPLICIT_COMMIT_END are used
  to ensure that the active transaction is implicitly committed
  before and after every DDL statement and any statement that
  modifies our currently non-transactional system tables.
*/
#define CF_AUTO_COMMIT_TRANS  (CF_IMPLICIT_COMMIT_BEGIN | CF_IMPLICIT_COMMIT_END)

/**
  Diagnostic statement.
  Diagnostic statements:
  - SHOW WARNING
  - SHOW ERROR
  - GET DIAGNOSTICS (WL#2111)
  do not modify the diagnostics area during execution.
*/
#define CF_DIAGNOSTIC_STMT        (1U << 8)

/**
  Identifies statements that may generate row events
  and that may end up in the binary log.
*/
#define CF_CAN_GENERATE_ROW_EVENTS (1U << 9)

/**
  Identifies statements which may deal with temporary tables and for which
  temporary tables should be pre-opened to simplify privilege checks.
*/
#define CF_PREOPEN_TMP_TABLES   (1U << 10)

/**
  Identifies statements for which open handlers should be closed in the
  beginning of the statement.
*/
#define CF_HA_CLOSE             (1U << 11)

/**
  Identifies statements that can be explained with EXPLAIN.
*/
#define CF_CAN_BE_EXPLAINED       (1U << 12)

/** Identifies statements which may generate an optimizer trace */
#define CF_OPTIMIZER_TRACE        (1U << 14)

/**
   Identifies statements that should always be disallowed in
   read only transactions.
*/
#define CF_DISALLOW_IN_RO_TRANS   (1U << 15)

/**
  Statement that need the binlog format to be unchanged.
*/
#define CF_FORCE_ORIGINAL_BINLOG_FORMAT (1U << 16)

/**
  Statement that inserts new rows (INSERT, REPLACE, LOAD, ALTER TABLE)
*/
#define CF_INSERTS_DATA (1U << 17)

/**
  Statement that updates existing rows (UPDATE, multi-update)
*/
#define CF_UPDATES_DATA (1U << 18)

/**
  Not logged into slow log as "admin commands"
*/
#define CF_ADMIN_COMMAND (1U << 19)

/**
  SP Bulk execution safe
*/
#define CF_PS_ARRAY_BINDING_SAFE (1U << 20)
/**
  SP Bulk execution optimized
*/
#define CF_PS_ARRAY_BINDING_OPTIMIZED (1U << 21)
/**
  If command creates or drops a table
*/
#define CF_SCHEMA_CHANGE (1U << 22)
/**
  If command creates or drops a database
*/
#define CF_DB_CHANGE (1U << 23)

#ifdef WITH_WSREP
/**
  DDL statement that may be subject to error filtering.
*/
#define CF_WSREP_MAY_IGNORE_ERRORS (1U << 24)
/**
   Basic DML statements that create writeset.
*/
#define CF_WSREP_BASIC_DML (1u << 25)

#endif /* WITH_WSREP */


/* Bits in server_command_flags */

/**
  Statement that deletes existing rows (DELETE, DELETE_MULTI)
*/
#define CF_DELETES_DATA (1U << 24)

/**
  Skip the increase of the global query id counter. Commonly set for
  commands that are stateless (won't cause any change on the server
  internal states).
*/
#define CF_SKIP_QUERY_ID        (1U << 0)

/**
  Skip the increase of the number of statements that clients have
  sent to the server. Commonly used for commands that will cause
  a statement to be executed but the statement might have not been
  sent by the user (ie: stored procedure).
*/
#define CF_SKIP_QUESTIONS       (1U << 1)
#ifdef WITH_WSREP
/**
  Do not check that wsrep snapshot is ready before allowing this command
*/
#define CF_SKIP_WSREP_CHECK     (1U << 2)
#else
#define CF_SKIP_WSREP_CHECK     0
#endif /* WITH_WSREP */


/* Inline functions */

inline bool add_item_to_list(THD *thd, Item *item)
{
  bool res;
  LEX *lex= thd->lex;
  if (lex->current_select->parsing_place == IN_RETURNING)
    res= lex->returning()->add_item_to_list(thd, item);
  else
    res= lex->current_select->add_item_to_list(thd, item);
  return res;
}

inline bool add_value_to_list(THD *thd, Item *value)
{
  return thd->lex->value_list.push_back(value, thd->mem_root);
}

inline bool add_order_to_list(THD *thd, Item *item, bool asc)
{
  return thd->lex->current_select->add_order_to_list(thd, item, asc);
}

inline bool add_gorder_to_list(THD *thd, Item *item, bool asc)
{
  return thd->lex->current_select->add_gorder_to_list(thd, item, asc);
}

inline bool add_group_to_list(THD *thd, Item *item, bool asc)
{
  return thd->lex->current_select->add_group_to_list(thd, item, asc);
}

inline Item *and_conds(THD *thd, Item *a, Item *b)
{
  if (!b) return a;
  if (!a) return b;
  return new (thd->mem_root) Item_cond_and(thd, a, b);
}

/* inline handler methods that need to know TABLE and THD structures */
inline void handler::increment_statistics(ulong SSV::*offset) const
{
  status_var_increment(table->in_use->status_var.*offset);
  table->in_use->check_limit_rows_examined();
}

inline void handler::decrement_statistics(ulong SSV::*offset) const
{
  status_var_decrement(table->in_use->status_var.*offset);
}


inline int handler::ha_ft_read(uchar *buf)
{
  int error= ft_read(buf);
  if (!error)
  {
    update_rows_read();

    if (table->vfield && buf == table->record[0])
      table->update_virtual_fields(this, VCOL_UPDATE_FOR_READ);
  }

  table->status=error ? STATUS_NOT_FOUND: 0;
  return error;
}

inline int handler::ha_rnd_pos_by_record(uchar *buf)
{
  int error= rnd_pos_by_record(buf);
  table->status=error ? STATUS_NOT_FOUND: 0;
  return error;
}

inline int handler::ha_read_first_row(uchar *buf, uint primary_key)
{
  int error= read_first_row(buf, primary_key);
  if (!error)
    update_rows_read();
  table->status=error ? STATUS_NOT_FOUND: 0;
  return error;
}

inline int handler::ha_write_tmp_row(uchar *buf)
{
  int error;
  MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str);
  increment_statistics(&SSV::ha_tmp_write_count);
  TABLE_IO_WAIT(tracker, PSI_TABLE_WRITE_ROW, MAX_KEY, error,
          { error= write_row(buf); })
  MYSQL_INSERT_ROW_DONE(error);
  return error;
}

inline int handler::ha_delete_tmp_row(uchar *buf)
{
  int error;
  MYSQL_DELETE_ROW_START(table_share->db.str, table_share->table_name.str);
  increment_statistics(&SSV::ha_tmp_delete_count);
  TABLE_IO_WAIT(tracker, PSI_TABLE_DELETE_ROW, MAX_KEY, error,
                { error= delete_row(buf); })
  MYSQL_DELETE_ROW_DONE(error);
  return error;
}

inline int handler::ha_update_tmp_row(const uchar *old_data, uchar *new_data)
{
  int error;
  MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
  increment_statistics(&SSV::ha_tmp_update_count);
  TABLE_IO_WAIT(tracker, PSI_TABLE_UPDATE_ROW, active_index, error,
          { error= update_row(old_data, new_data);})
  MYSQL_UPDATE_ROW_DONE(error);
  return error;
}

inline bool handler::has_long_unique()
{
  return table->s->long_unique_table;
}

extern pthread_attr_t *get_connection_attrib(void);

/**
   Set thread entering a condition

   This function should be called before putting a thread to wait for
   a condition. @a mutex should be held before calling this
   function. After being waken up, @f thd_exit_cond should be called.

   @param thd      The thread entering the condition, NULL means current thread
   @param cond     The condition the thread is going to wait for
   @param mutex    The mutex associated with the condition, this must be
                   held before call this function
   @param stage    The new process message for the thread
   @param old_stage The old process message for the thread
   @param src_function The caller source function name
   @param src_file The caller source file name
   @param src_line The caller source line number
*/
void thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, mysql_mutex_t *mutex,
                    const PSI_stage_info *stage, PSI_stage_info *old_stage,
                    const char *src_function, const char *src_file,
                    int src_line);

#define THD_ENTER_COND(P1, P2, P3, P4, P5) \
  thd_enter_cond(P1, P2, P3, P4, P5, __func__, __FILE__, __LINE__)

/**
   Set thread leaving a condition

   This function should be called after a thread being waken up for a
   condition.

   @param thd      The thread entering the condition, NULL means current thread
   @param stage    The process message, ususally this should be the old process
                   message before calling @f thd_enter_cond
   @param src_function The caller source function name
   @param src_file The caller source file name
   @param src_line The caller source line number
*/
void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage,
                   const char *src_function, const char *src_file,
                   int src_line);

#define THD_EXIT_COND(P1, P2) \
  thd_exit_cond(P1, P2, __func__, __FILE__, __LINE__)

inline bool binlog_should_compress(size_t len)
{
  return opt_bin_log_compress &&
    len >= opt_bin_log_compress_min_len;
}


/**
   Save thd sql_mode on instantiation.
   On destruction it resets the mode to the previously stored value.
*/
class Sql_mode_save
{
 public:
  Sql_mode_save(THD *thd) : thd(thd), old_mode(thd->variables.sql_mode) {}
  ~Sql_mode_save() { thd->variables.sql_mode = old_mode; }

 private:
  THD *thd;
  sql_mode_t old_mode; // SQL mode saved at construction time.
};


/*
  Save the current sql_mode. Switch off sql_mode flags which can prevent
  normal parsing of VIEWs, expressions in generated columns.
  Restore the old sql_mode on destructor.
*/
class Sql_mode_save_for_frm_handling: public Sql_mode_save
{
public:
  Sql_mode_save_for_frm_handling(THD *thd)
   :Sql_mode_save(thd)
  {
    /*
      - MODE_REAL_AS_FLOAT            affect only CREATE TABLE parsing
      + MODE_PIPES_AS_CONCAT          affect expression parsing
      + MODE_ANSI_QUOTES              affect expression parsing
      + MODE_IGNORE_SPACE             affect expression parsing
      - MODE_IGNORE_BAD_TABLE_OPTIONS affect only CREATE/ALTER TABLE parsing
      * MODE_ONLY_FULL_GROUP_BY       affect execution
      * MODE_NO_UNSIGNED_SUBTRACTION  affect execution
      - MODE_NO_DIR_IN_CREATE         affect table creation only
      - MODE_POSTGRESQL               compounded from other modes
      + MODE_ORACLE                   affects Item creation (e.g for CONCAT)
      - MODE_MSSQL                    compounded from other modes
      - MODE_DB2                      compounded from other modes
      - MODE_MAXDB                    affect only CREATE TABLE parsing
      - MODE_NO_KEY_OPTIONS           affect only SHOW
      - MODE_NO_TABLE_OPTIONS         affect only SHOW
      - MODE_NO_FIELD_OPTIONS         affect only SHOW
      - MODE_MYSQL323                 affect only SHOW
      - MODE_MYSQL40                  affect only SHOW
      - MODE_ANSI                     compounded from other modes
                                      (+ transaction mode)
      ? MODE_NO_AUTO_VALUE_ON_ZERO    affect UPDATEs
      + MODE_NO_BACKSLASH_ESCAPES     affect expression parsing
      + MODE_EMPTY_STRING_IS_NULL     affect expression parsing
    */
    thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
                                MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES |
                                MODE_ORACLE | MODE_EMPTY_STRING_IS_NULL);
  };
};


class Switch_to_definer_security_ctx
{
 public:
  Switch_to_definer_security_ctx(THD *thd, TABLE_LIST *table) :
    m_thd(thd), m_sctx(thd->security_ctx)
  {
    if (table->security_ctx)
      thd->security_ctx= table->security_ctx;
  }
  ~Switch_to_definer_security_ctx() { m_thd->security_ctx = m_sctx; }

 private:
  THD *m_thd;
  Security_context *m_sctx;
};


class Sql_mode_instant_set: public Sql_mode_save
{
public:
  Sql_mode_instant_set(THD *thd, sql_mode_t temporary_value)
   :Sql_mode_save(thd)
  {
    thd->variables.sql_mode= temporary_value;
  }
};


class Sql_mode_instant_remove: public Sql_mode_save
{
public:
  Sql_mode_instant_remove(THD *thd, sql_mode_t temporary_remove_flags)
   :Sql_mode_save(thd)
  {
    thd->variables.sql_mode&= ~temporary_remove_flags;
  }
};


class Abort_on_warning_instant_set
{
  THD *m_thd;
  bool m_save_abort_on_warning;
public:
  Abort_on_warning_instant_set(THD *thd, bool temporary_value)
   :m_thd(thd), m_save_abort_on_warning(thd->abort_on_warning)
  {
    thd->abort_on_warning= temporary_value;
  }
  ~Abort_on_warning_instant_set()
  {
    m_thd->abort_on_warning= m_save_abort_on_warning;
  }
};


class Check_level_instant_set
{
  THD *m_thd;
  enum_check_fields m_check_level;
public:
  Check_level_instant_set(THD *thd, enum_check_fields temporary_value)
   :m_thd(thd), m_check_level(thd->count_cuted_fields)
  {
    thd->count_cuted_fields= temporary_value;
  }
  ~Check_level_instant_set()
  {
    m_thd->count_cuted_fields= m_check_level;
  }
};


class Use_relaxed_field_copy: public Sql_mode_save,
                              public Check_level_instant_set,
                              public Abort_on_warning_instant_set
{
public:
  Use_relaxed_field_copy(THD *thd) :
      Sql_mode_save(thd), Check_level_instant_set(thd, CHECK_FIELD_IGNORE),
      Abort_on_warning_instant_set(thd, 0)
  {
    thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
    thd->variables.sql_mode|= MODE_INVALID_DATES;
  }
};


class Identifier_chain2
{
  LEX_CSTRING m_name[2];
public:
  Identifier_chain2()
   :m_name{Lex_cstring(), Lex_cstring()}
  { }
  Identifier_chain2(const LEX_CSTRING &a, const LEX_CSTRING &b)
   :m_name{a, b}
  { }

  const LEX_CSTRING& operator [] (size_t i) const
  {
    return m_name[i];
  }

  static Identifier_chain2 split(const LEX_CSTRING &txt)
  {
    DBUG_ASSERT(txt.str[txt.length] == '\0'); // Expect 0-terminated input
    const char *dot= strchr(txt.str, '.');
    if (!dot)
      return Identifier_chain2(Lex_cstring(), txt);
    size_t length0= dot - txt.str;
    Lex_cstring name0(txt.str, length0);
    Lex_cstring name1(txt.str + length0 + 1, txt.length - length0 - 1);
    return Identifier_chain2(name0, name1);
  }

  // Export as a qualified name string: 'db.name'
  size_t make_qname(char *dst, size_t dstlen, bool casedn_part1) const
  {
    size_t res= my_snprintf(dst, dstlen, "%.*s.%.*s",
                            (int) m_name[0].length, m_name[0].str,
                            (int) m_name[1].length, m_name[1].str);
    if (casedn_part1 && dstlen > m_name[0].length)
      my_casedn_str(system_charset_info, dst + m_name[0].length + 1);
    return res;
  }

  // Export as a qualified name string, allocate on mem_root.
  LEX_CSTRING make_qname(MEM_ROOT *mem_root, bool casedn_part1) const
  {
    LEX_STRING dst;
    /* format: [pkg + dot] + name + '\0' */
    size_t dst_size= m_name[0].length + 1 /*dot*/ + m_name[1].length + 1/*\0*/;
    if (unlikely(!(dst.str= (char*) alloc_root(mem_root, dst_size))))
      return {NULL, 0};
    if (!m_name[0].length)
    {
      DBUG_ASSERT(!casedn_part1); // Should not be called this way
      dst.length= my_snprintf(dst.str, dst_size, "%.*s",
                              (int) m_name[1].length, m_name[1].str);
      return {dst.str, dst.length};
    }
    dst.length= make_qname(dst.str, dst_size, casedn_part1);
    return {dst.str, dst.length};
  }
};


/**
  This class resembles the SQL Standard schema qualified object name:
  <schema qualified name> ::= [ <schema name> <period> ] <qualified identifier>
*/
class Database_qualified_name
{
public:
  LEX_CSTRING m_db;
  LEX_CSTRING m_name;
  Database_qualified_name(const LEX_CSTRING *db, const LEX_CSTRING *name)
   :m_db(*db), m_name(*name)
  { }
  Database_qualified_name(const LEX_CSTRING &db, const LEX_CSTRING &name)
   :m_db(db), m_name(name)
  { }
  Database_qualified_name(const char *db, size_t db_length,
                          const char *name, size_t name_length)
  {
    m_db.str= db;
    m_db.length= db_length;
    m_name.str= name;
    m_name.length= name_length;
  }

  bool eq(const Database_qualified_name *other) const
  {
    CHARSET_INFO *cs= lower_case_table_names ?
                      &my_charset_utf8mb3_general_ci :
                      &my_charset_utf8mb3_bin;
    return
      m_db.length == other->m_db.length &&
      m_name.length == other->m_name.length &&
      !cs->strnncoll(m_db.str, m_db.length,
                     other->m_db.str, other->m_db.length) &&
      !cs->strnncoll(m_name.str, m_name.length,
                     other->m_name.str, other->m_name.length);
  }
  void copy(MEM_ROOT *mem_root, const LEX_CSTRING &db,
                                const LEX_CSTRING &name);

  // Export db and name as a qualified name string: 'db.name'
  size_t make_qname(char *dst, size_t dstlen, bool casedn_name) const
  {
    return Identifier_chain2(m_db, m_name).make_qname(dst, dstlen, casedn_name);
  }
  // Export db and name as a qualified name string, allocate on mem_root.
  LEX_CSTRING make_qname(MEM_ROOT *mem_root, bool casedn_name) const
  {
    DBUG_SLOW_ASSERT(ok_for_lower_case_names(m_db.str));
    return Identifier_chain2(m_db, m_name).make_qname(mem_root, casedn_name);
  }

  bool make_package_routine_name(MEM_ROOT *mem_root,
                                 const LEX_CSTRING &package,
                                 const LEX_CSTRING &routine)
  {
    char *tmp;
    size_t length= package.length + 1 + routine.length + 1;
    if (unlikely(!(tmp= (char *) alloc_root(mem_root, length))))
      return true;
    m_name.length= Identifier_chain2(package, routine).make_qname(tmp, length,
                                                                  false);
    m_name.str= tmp;
    return false;
  }

  bool make_package_routine_name(MEM_ROOT *mem_root,
                                 const LEX_CSTRING &db,
                                 const LEX_CSTRING &package,
                                 const LEX_CSTRING &routine)
  {
    if (unlikely(make_package_routine_name(mem_root, package, routine)))
      return true;
    if (unlikely(!(m_db.str= strmake_root(mem_root, db.str, db.length))))
      return true;
    m_db.length= db.length;
    return false;
  }
};


class ErrConvDQName: public ErrConv
{
  const Database_qualified_name *m_name;
public:
  ErrConvDQName(const Database_qualified_name *name)
   :m_name(name)
  { }
  LEX_CSTRING lex_cstring() const override
  {
    size_t length= m_name->make_qname(err_buffer, sizeof(err_buffer), false);
    return {err_buffer, length};
  }
};

class Type_holder: public Sql_alloc,
                   public Item_args,
                   public Type_handler_hybrid_field_type,
                   public Type_all_attributes
{
  const TYPELIB *m_typelib;
  bool m_maybe_null;
public:
  Type_holder()
   :m_typelib(NULL),
    m_maybe_null(false)
  { }

  void set_type_maybe_null(bool maybe_null_arg) override
  { m_maybe_null= maybe_null_arg; }
  bool get_maybe_null() const { return m_maybe_null; }

  decimal_digits_t decimal_precision() const override
  {
    /*
      Type_holder is not used directly to create fields, so
      its virtual decimal_precision() is never called.
      We should eventually extend create_result_table() to accept
      an array of Type_holders directly, without having to allocate
      Item_type_holder's and put them into List<Item>.
    */
    DBUG_ASSERT(0);
    return 0;
  }
  void set_typelib(const TYPELIB *typelib) override
  {
    m_typelib= typelib;
  }
  const TYPELIB *get_typelib() const override
  {
    return m_typelib;
  }

  bool aggregate_attributes(THD *thd)
  {
    static LEX_CSTRING union_name= { STRING_WITH_LEN("UNION") };
    for (uint i= 0; i < arg_count; i++)
      m_maybe_null|= args[i]->maybe_null();
    return
       type_handler()->Item_hybrid_func_fix_attributes(thd,
                                                       union_name, this, this,
                                                       args, arg_count);
  }
};


/*
  A helper class to set THD flags to emit warnings/errors in case of
  overflow/type errors during assigning values into the SP variable fields.
  Saves original flags values in constructor.
  Restores original flags in destructor.
*/
class Sp_eval_expr_state
{
  THD *m_thd;
  enum_check_fields m_count_cuted_fields;
  bool m_abort_on_warning;
  bool m_stmt_modified_non_trans_table;
  void start()
  {
    m_thd->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL;
    m_thd->abort_on_warning= m_thd->is_strict_mode();
    m_thd->transaction->stmt.modified_non_trans_table= false;
  }
  void stop()
  {
    m_thd->count_cuted_fields= m_count_cuted_fields;
    m_thd->abort_on_warning= m_abort_on_warning;
    m_thd->transaction->stmt.modified_non_trans_table=
      m_stmt_modified_non_trans_table;
  }
public:
  Sp_eval_expr_state(THD *thd)
   :m_thd(thd),
    m_count_cuted_fields(thd->count_cuted_fields),
    m_abort_on_warning(thd->abort_on_warning),
    m_stmt_modified_non_trans_table(thd->transaction->stmt.
                                    modified_non_trans_table)
  {
    start();
  }
  ~Sp_eval_expr_state()
  {
    stop();
  }
};


#ifndef DBUG_OFF
void dbug_serve_apcs(THD *thd, int n_calls);
#endif 

class ScopedStatementReplication
{
public:
  ScopedStatementReplication(THD *thd) :
    saved_binlog_format(thd
                        ? thd->set_current_stmt_binlog_format_stmt()
                        : BINLOG_FORMAT_MIXED),
    thd(thd)
  {}
  ~ScopedStatementReplication()
  {
    if (thd)
      thd->restore_stmt_binlog_format(saved_binlog_format);
  }

private:
  const enum_binlog_format saved_binlog_format;
  THD *const thd;
};


/** THD registry */
class THD_list: public THD_list_iterator
{
public:
  /**
    Constructor replacement.

    Unfortunately we can't use fair constructor to initialize mutex
    for two reasons: PFS and embedded. The former can probably be fixed,
    the latter can probably be dropped.
  */
  void init()
  {
    mysql_rwlock_init(key_rwlock_THD_list, &lock);
  }

  /** Destructor replacement. */
  void destroy()
  {
    mysql_rwlock_destroy(&lock);
  }

  /**
    Inserts thread to registry.

    @param thd         thread

    Thread becomes accessible via server_threads.
  */
  void insert(THD *thd)
  {
    mysql_rwlock_wrlock(&lock);
    threads.append(thd);
    mysql_rwlock_unlock(&lock);
  }

  /**
    Removes thread from registry.

    @param thd         thread

    Thread becomes not accessible via server_threads.
  */
  void erase(THD *thd)
  {
    thd->assert_linked();
    mysql_rwlock_wrlock(&lock);
    thd->unlink();
    mysql_rwlock_unlock(&lock);
  }
};

extern THD_list server_threads;

void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps,
                                    uint field_count);
C_MODE_START
void mariadb_sleep_for_space(unsigned int seconds);
C_MODE_END

#endif /* MYSQL_SERVER */
#endif /* SQL_CLASS_INCLUDED */
server/private/pfs_socket_provider.h000064400000004322150400263730013750 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_SOCKET_PROVIDER_H
#define PFS_SOCKET_PROVIDER_H

/**
  @file include/pfs_socket_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_SOCKET_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_SOCKET_CALL(M) pfs_ ## M ## _v1

C_MODE_START

void pfs_register_socket_v1(const char *category,
                            PSI_socket_info_v1 *info,
                            int count);

PSI_socket*
pfs_init_socket_v1(PSI_socket_key key, const my_socket *fd,
                   const struct sockaddr *addr, socklen_t addr_len);

void pfs_destroy_socket_v1(PSI_socket *socket);

PSI_socket_locker*
pfs_start_socket_wait_v1(PSI_socket_locker_state *state,
                         PSI_socket *socket,
                         PSI_socket_operation op,
                         size_t count,
                         const char *src_file, uint src_line);

void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count);

void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state);

void pfs_set_socket_info_v1(PSI_socket *socket,
                            const my_socket *fd,
                            const struct sockaddr *addr,
                            socklen_t addr_len);

void pfs_set_socket_thread_owner_v1(PSI_socket *socket);

C_MODE_END

#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_SOCKET_INTERFACE */

#endif

server/private/rpl_gtid.h000064400000032563150400263730011512 0ustar00/* Copyright (c) 2013, Kristian Nielsen and MariaDB Services Ab.

   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 */

#ifndef RPL_GTID_H
#define RPL_GTID_H

#include "hash.h"
#include "queues.h"
#include <atomic>

/* Definitions for MariaDB global transaction ID (GTID). */


extern const LEX_CSTRING rpl_gtid_slave_state_table_name;

class String;
#define PARAM_GTID(G) G.domain_id, G.server_id, G.seq_no

#define GTID_MAX_STR_LENGTH (10+1+10+1+20)

struct rpl_gtid
{
  uint32 domain_id;
  uint32 server_id;
  uint64 seq_no;
};

inline bool operator==(const rpl_gtid& lhs, const rpl_gtid& rhs)
{
  return
    lhs.domain_id == rhs.domain_id &&
    lhs.server_id == rhs.server_id &&
    lhs.seq_no    == rhs.seq_no;
};

enum enum_gtid_skip_type {
  GTID_SKIP_NOT, GTID_SKIP_STANDALONE, GTID_SKIP_TRANSACTION
};


/*
  Structure to keep track of threads waiting in MASTER_GTID_WAIT().

  Since replication is (mostly) single-threaded, we want to minimise the
  performance impact on that from MASTER_GTID_WAIT(). To achieve this, we
  are careful to keep the common lock between replication threads and
  MASTER_GTID_WAIT threads held for as short as possible. We keep only
  a single thread waiting to be notified by the replication threads; this
  thread then handles all the (potentially heavy) lifting of dealing with
  all current waiting threads.
*/
struct gtid_waiting {
  /* Elements in the hash, basically a priority queue for each domain. */
  struct hash_element {
    QUEUE queue;
    uint32 domain_id;
  };
  /* A priority queue to handle waiters in one domain in seq_no order. */
  struct queue_element {
    uint64 wait_seq_no;
    THD *thd;
    int queue_idx;
    /*
      do_small_wait is true if we have responsibility for ensuring that there
      is a small waiter.
    */
    bool do_small_wait;
    /*
      The flag `done' is set when the wait is completed (either due to reaching
      the position waited for, or due to timeout or kill). The queue_element
      is in the queue if and only if `done' is true.
    */
    bool done;
  };

  mysql_mutex_t LOCK_gtid_waiting;
  HASH hash;

  void init();
  void destroy();
  hash_element *get_entry(uint32 domain_id);
  int wait_for_pos(THD *thd, String *gtid_str, longlong timeout_us);
  void promote_new_waiter(gtid_waiting::hash_element *he);
  int wait_for_gtid(THD *thd, rpl_gtid *wait_gtid, struct timespec *wait_until);
  void process_wait_hash(uint64 wakeup_seq_no, gtid_waiting::hash_element *he);
  int register_in_wait_queue(THD *thd, rpl_gtid *wait_gtid, hash_element *he,
                             queue_element *elem);
  void remove_from_wait_queue(hash_element *he, queue_element *elem);
};


class Relay_log_info;
struct rpl_group_info;
class Gtid_list_log_event;

/*
  Replication slave state.

  For every independent replication stream (identified by domain_id), this
  remembers the last gtid applied on the slave within this domain.

  Since events are always committed in-order within a single domain, this is
  sufficient to maintain the state of the replication slave.
*/
struct rpl_slave_state
{
  /* Elements in the list of GTIDs kept for each domain_id. */
  struct list_element
  {
    struct list_element *next;
    uint64 sub_id;
    uint32 domain_id;
    uint32 server_id;
    uint64 seq_no;
    /*
      hton of mysql.gtid_slave_pos* table used to record this GTID.
      Can be NULL if the gtid table failed to load (eg. missing
      mysql.gtid_slave_pos table following an upgrade).
    */
    void *hton;
  };

  /* Elements in the HASH that hold the state for one domain_id. */
  struct element
  {
    struct list_element *list;
    uint32 domain_id;
    /* Highest seq_no seen so far in this domain. */
    uint64 highest_seq_no;
    /*
      If this is non-NULL, then it is the waiter responsible for the small
      wait in MASTER_GTID_WAIT().
    */
    gtid_waiting::queue_element *gtid_waiter;
    /*
      If gtid_waiter is non-NULL, then this is the seq_no that its
      MASTER_GTID_WAIT() is waiting on. When we reach this seq_no, we need to
      signal the waiter on COND_wait_gtid.
    */
    uint64 min_wait_seq_no;
    mysql_cond_t COND_wait_gtid;

    /*
      For --gtid-ignore-duplicates. The Relay_log_info that currently owns
      this domain, and the number of worker threads that are active in it.

      The idea is that only one of multiple master connections is allowed to
      actively apply events for a given domain. Other connections must either
      discard the events (if the seq_no in GTID shows they have already been
      applied), or wait to see if the current owner will apply it.
    */
    const Relay_log_info *owner_rli;
    uint32 owner_count;
    mysql_cond_t COND_gtid_ignore_duplicates;

    list_element *grab_list() { list_element *l= list; list= NULL; return l; }
    void add(list_element *l)
    {
      l->next= list;
      list= l;
    }
  };

  /* Descriptor for mysql.gtid_slave_posXXX table in specific engine. */
  enum gtid_pos_table_state {
    GTID_POS_AUTO_CREATE,
    GTID_POS_CREATE_REQUESTED,
    GTID_POS_CREATE_IN_PROGRESS,
    GTID_POS_AVAILABLE
  };
  struct gtid_pos_table {
    struct gtid_pos_table *next;
    /*
      Use a void * here, rather than handlerton *, to make explicit that we
      are not using the value to access any functionality in the engine. It
      is just used as an opaque value to identify which engine we are using
      for each GTID row.
    */
    void *table_hton;
    LEX_CSTRING table_name;
    uint8 state;
  };

  /* Mapping from domain_id to its element. */
  HASH hash;
  /* GTIDs added since last purge of old mysql.gtid_slave_pos rows. */
  uint32 pending_gtid_count;
  /* Mutex protecting access to the state. */
  mysql_mutex_t LOCK_slave_state;
  /* Auxiliary buffer to sort gtid list. */
  DYNAMIC_ARRAY gtid_sort_array;

  uint64 last_sub_id;
  /*
    List of tables available for durably storing the slave GTID position.

    Accesses to this table is protected by LOCK_slave_state. However for
    efficiency, there is also a provision for read access to it from a running
    slave without lock.

    An element can be added at the head of a list by storing the new
    gtid_pos_tables pointer atomically with release semantics, to ensure that
    the next pointer of the new element is visible to readers of the new list.
    Other changes (like deleting or replacing elements) must happen only while
    all SQL driver threads are stopped. LOCK_slave_state must be held in any
    case.

    The list can be read without lock by an SQL driver thread or worker thread
    by reading the gtid_pos_tables pointer atomically with acquire semantics,
    to ensure that it will see the correct next pointer of a new head element.
  */
  std::atomic<gtid_pos_table*> gtid_pos_tables;
  /* The default entry in gtid_pos_tables, mysql.gtid_slave_pos. */
  std::atomic<gtid_pos_table*> default_gtid_pos_table;
  bool loaded;

  rpl_slave_state();
  ~rpl_slave_state();

  void truncate_hash();
  ulong count() const { return hash.records; }
  int update(uint32 domain_id, uint32 server_id, uint64 sub_id,
             uint64 seq_no, void *hton, rpl_group_info *rgi);
  int update_nolock(uint32 domain_id, uint32 server_id, uint64 sub_id,
                    uint64 seq_no, void *hton, rpl_group_info *rgi);
  int truncate_state_table(THD *thd);
  void select_gtid_pos_table(THD *thd, LEX_CSTRING *out_tablename);
  int record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
                  bool in_transaction, bool in_statement, void **out_hton);
  list_element *gtid_grab_pending_delete_list();
  LEX_CSTRING *select_gtid_pos_table(void *hton);
  void gtid_delete_pending(THD *thd, rpl_slave_state::list_element **list_ptr);
  uint64 next_sub_id(uint32 domain_id);
  int iterate(int (*cb)(rpl_gtid *, void *), void *data,
              rpl_gtid *extra_gtids, uint32 num_extra,
              bool sort);
  int tostring(String *dest, rpl_gtid *extra_gtids, uint32 num_extra);
  bool domain_to_gtid(uint32 domain_id, rpl_gtid *out_gtid);
  int load(THD *thd, const char *state_from_master, size_t len, bool reset,
           bool in_statement);
  bool is_empty();

  element *get_element(uint32 domain_id);
  int put_back_list(list_element *list);

  void update_state_hash(uint64 sub_id, rpl_gtid *gtid, void *hton,
                         rpl_group_info *rgi);
  int record_and_update_gtid(THD *thd, struct rpl_group_info *rgi);
  int check_duplicate_gtid(rpl_gtid *gtid, rpl_group_info *rgi);
  void release_domain_owner(rpl_group_info *rgi);
  void set_gtid_pos_tables_list(gtid_pos_table *new_list,
                                gtid_pos_table *default_entry);
  void add_gtid_pos_table(gtid_pos_table *entry);
  struct gtid_pos_table *alloc_gtid_pos_table(LEX_CSTRING *table_name,
      void *hton, rpl_slave_state::gtid_pos_table_state state);
  void free_gtid_pos_tables(struct gtid_pos_table *list);
};


/*
  Binlog state.
  This keeps the last GTID written to the binlog for every distinct
  (domain_id, server_id) pair.
  This will be logged at the start of the next binlog file as a
  Gtid_list_log_event; this way, it is easy to find the binlog file
  containing a given GTID, by simply scanning backwards from the newest
  one until a lower seq_no is found in the Gtid_list_log_event at the
  start of a binlog for the given domain_id and server_id.

  We also remember the last logged GTID for every domain_id. This is used
  to know where to start when a master is changed to a slave. As a side
  effect, it also allows to skip a hash lookup in the very common case of
  logging a new GTID with same server id as last GTID.
*/
struct rpl_binlog_state
{
  struct element {
    uint32 domain_id;
    HASH hash;                /* Containing all server_id for one domain_id */
    /* The most recent entry in the hash. */
    rpl_gtid *last_gtid;
    /* Counter to allocate next seq_no for this domain. */
    uint64 seq_no_counter;

    int update_element(const rpl_gtid *gtid);
  };
  /* Mapping from domain_id to collection of elements. */
  HASH hash;
  /* Mutex protecting access to the state. */
  mysql_mutex_t LOCK_binlog_state;
  my_bool initialized;

  /* Auxiliary buffer to sort gtid list. */
  DYNAMIC_ARRAY gtid_sort_array;

   rpl_binlog_state() :initialized(0) {}
  ~rpl_binlog_state();

  void init();
  void reset_nolock();
  void reset();
  void free();
  bool load(struct rpl_gtid *list, uint32 count);
  bool load(rpl_slave_state *slave_pos);
  int update_nolock(const struct rpl_gtid *gtid, bool strict);
  int update(const struct rpl_gtid *gtid, bool strict);
  int update_with_next_gtid(uint32 domain_id, uint32 server_id,
                             rpl_gtid *gtid);
  int alloc_element_nolock(const rpl_gtid *gtid);
  bool check_strict_sequence(uint32 domain_id, uint32 server_id, uint64 seq_no,
                             bool no_error= false);
  int bump_seq_no_if_needed(uint32 domain_id, uint64 seq_no);
  int write_to_iocache(IO_CACHE *dest);
  int read_from_iocache(IO_CACHE *src);
  uint32 count();
  int get_gtid_list(rpl_gtid *gtid_list, uint32 list_size);
  int get_most_recent_gtid_list(rpl_gtid **list, uint32 *size);
  bool append_pos(String *str);
  bool append_state(String *str);
  rpl_gtid *find_nolock(uint32 domain_id, uint32 server_id);
  rpl_gtid *find(uint32 domain_id, uint32 server_id);
  rpl_gtid *find_most_recent(uint32 domain_id);
  const char* drop_domain(DYNAMIC_ARRAY *ids, Gtid_list_log_event *glev, char*);
};


/*
  Represent the GTID state that a slave connection to a master requests
  the master to start sending binlog events from.
*/
struct slave_connection_state
{
  struct entry {
    rpl_gtid gtid;
    uint32 flags;
  };
  /* Bits for 'flags' */
  enum start_flags
  {
    START_OWN_SLAVE_POS= 0x1,
    START_ON_EMPTY_DOMAIN= 0x2
  };

  /* Mapping from domain_id to the entry with GTID requested for that domain. */
  HASH hash;

  /* Auxiliary buffer to sort gtid list. */
  DYNAMIC_ARRAY gtid_sort_array;

  slave_connection_state();
  ~slave_connection_state();

  void reset() { my_hash_reset(&hash); }
  int load(const char *slave_request, size_t len);
  int load(const rpl_gtid *gtid_list, uint32 count);
  int load(rpl_slave_state *state, rpl_gtid *extra_gtids, uint32 num_extra);
  rpl_gtid *find(uint32 domain_id);
  entry *find_entry(uint32 domain_id);
  int update(const rpl_gtid *in_gtid);
  void remove(const rpl_gtid *gtid);
  void remove_if_present(const rpl_gtid *in_gtid);
  ulong count() const { return hash.records; }
  int to_string(String *out_str);
  int append_to_string(String *out_str);
  int get_gtid_list(rpl_gtid *gtid_list, uint32 list_size);
  bool is_pos_reached();
};


extern bool rpl_slave_state_tostring_helper(String *dest, const rpl_gtid *gtid,
                                            bool *first);
extern int gtid_check_rpl_slave_state_table(TABLE *table);
extern rpl_gtid *gtid_parse_string_to_list(const char *p, size_t len,
                                           uint32 *out_len);

#endif  /* RPL_GTID_H */
server/private/handler.h000064400000610723150400263730011323 0ustar00#ifndef HANDLER_INCLUDED
#define HANDLER_INCLUDED
/*
   Copyright (c) 2000, 2019, Oracle and/or its affiliates.
   Copyright (c) 2009, 2023, MariaDB

   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
*/

/* Definitions for parameters to do with handler-routines */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_const.h"
#include "sql_basic_types.h"
#include "mysqld.h"                             /* server_id */
#include "sql_plugin.h"        /* plugin_ref, st_plugin_int, plugin */
#include "thr_lock.h"          /* thr_lock_type, THR_LOCK_DATA */
#include "sql_cache.h"
#include "structs.h"                            /* SHOW_COMP_OPTION */
#include "sql_array.h"          /* Dynamic_array<> */
#include "mdl.h"
#include "vers_string.h"
#include "ha_handler_stats.h"

#include "sql_analyze_stmt.h" // for Exec_time_tracker 

#include <my_compare.h>
#include <ft_global.h>
#include <keycache.h>
#include <mysql/psi/mysql_table.h>
#include "sql_sequence.h"
#include "mem_root_array.h"
#include <utility>     // pair
#include <my_attribute.h> /* __attribute__ */

class Alter_info;
class Virtual_column_info;
class sequence_definition;
class Rowid_filter;
class Field_string;
class Field_varstring;
class Field_blob;
class Column_definition;

// the following is for checking tables

#define HA_ADMIN_ALREADY_DONE	  1
#define HA_ADMIN_OK               0
#define HA_ADMIN_NOT_IMPLEMENTED -1
#define HA_ADMIN_FAILED		 -2
#define HA_ADMIN_CORRUPT         -3
#define HA_ADMIN_INTERNAL_ERROR  -4
#define HA_ADMIN_INVALID         -5
#define HA_ADMIN_REJECT          -6
#define HA_ADMIN_TRY_ALTER       -7
#define HA_ADMIN_WRONG_CHECKSUM  -8
#define HA_ADMIN_NOT_BASE_TABLE  -9
#define HA_ADMIN_NEEDS_UPGRADE  -10
#define HA_ADMIN_NEEDS_ALTER    -11
#define HA_ADMIN_NEEDS_CHECK    -12
#define HA_ADMIN_COMMIT_ERROR   -13

/**
   Return values for check_if_supported_inplace_alter().

   @see check_if_supported_inplace_alter() for description of
   the individual values.
*/
enum enum_alter_inplace_result {
  HA_ALTER_ERROR,
  HA_ALTER_INPLACE_COPY_NO_LOCK,
  HA_ALTER_INPLACE_COPY_LOCK,
  HA_ALTER_INPLACE_NOCOPY_LOCK,
  HA_ALTER_INPLACE_NOCOPY_NO_LOCK,
  HA_ALTER_INPLACE_INSTANT,
  HA_ALTER_INPLACE_NOT_SUPPORTED,
  HA_ALTER_INPLACE_EXCLUSIVE_LOCK,
  HA_ALTER_INPLACE_SHARED_LOCK,
  HA_ALTER_INPLACE_NO_LOCK
};

/* Flags for create_partitioning_metadata() */

enum chf_create_flags {
  CHF_CREATE_FLAG,
  CHF_DELETE_FLAG,
  CHF_RENAME_FLAG,
  CHF_INDEX_FLAG
};

/* Bits in table_flags() to show what database can do */

#define HA_NO_TRANSACTIONS     (1ULL << 0) /* Doesn't support transactions */
#define HA_PARTIAL_COLUMN_READ (1ULL << 1) /* read may not return all columns */
#define HA_TABLE_SCAN_ON_INDEX (1ULL << 2) /* No separate data/index file */
/*
  The following should be set if the following is not true when scanning
  a table with rnd_next()
  - We will see all rows (including deleted ones)
  - Row positions are 'table->s->db_record_offset' apart
  If this flag is not set, filesort will do a position() call for each matched
  row to be able to find the row later.
*/
#define HA_REC_NOT_IN_SEQ      (1ULL << 3)
#define HA_CAN_GEOMETRY        (1ULL << 4)
/*
  Reading keys in random order is as fast as reading keys in sort order
  (Used in records.cc to decide if we should use a record cache and by
  filesort to decide if we should sort key + data or key + pointer-to-row
*/
#define HA_FAST_KEY_READ       (1ULL << 5)
/*
  Set the following flag if we on delete should force all key to be read
  and on update read all keys that changes
*/
#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1ULL << 6)
#define HA_NULL_IN_KEY         (1ULL << 7) /* One can have keys with NULL */
#define HA_DUPLICATE_POS       (1ULL << 8)    /* ha_position() gives dup row */
#define HA_NO_BLOBS            (1ULL << 9) /* Doesn't support blobs */
#define HA_CAN_INDEX_BLOBS     (1ULL << 10)
#define HA_AUTO_PART_KEY       (1ULL << 11) /* auto-increment in multi-part key */
/*
  The engine requires every table to have a user-specified PRIMARY KEY.
  Do not set the flag if the engine can generate a hidden primary key internally.
  This flag is ignored if a SEQUENCE is created (which, in turn, needs
  HA_CAN_TABLES_WITHOUT_ROLLBACK flag)
*/
#define HA_REQUIRE_PRIMARY_KEY (1ULL << 12)
#define HA_STATS_RECORDS_IS_EXACT (1ULL << 13) /* stats.records is exact */
/*
  INSERT_DELAYED only works with handlers that uses MySQL internal table
  level locks
*/
#define HA_CAN_INSERT_DELAYED  (1ULL << 14)
/*
  If we get the primary key columns for free when we do an index read
  (usually, it also implies that HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
  flag is set).
*/
#define HA_PRIMARY_KEY_IN_READ_INDEX (1ULL << 15)
/*
  If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position()
  uses a primary key given by the record argument.
  Without primary key, we can't call position().
  If not set, the position is returned as the current rows position
  regardless of what argument is given.
*/ 
#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1ULL << 16) 
#define HA_CAN_RTREEKEYS       (1ULL << 17)
#define HA_NOT_DELETE_WITH_CACHE (1ULL << 18) /* unused */
/*
  The following is we need to a primary key to delete (and update) a row.
  If there is no primary key, all columns needs to be read on update and delete
*/
#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1ULL << 19)
#define HA_NO_PREFIX_CHAR_KEYS (1ULL << 20)
#define HA_CAN_FULLTEXT        (1ULL << 21)
#define HA_CAN_SQL_HANDLER     (1ULL << 22)
#define HA_NO_AUTO_INCREMENT   (1ULL << 23)
/* Has automatic checksums and uses the old checksum format */
#define HA_HAS_OLD_CHECKSUM    (1ULL << 24)
/* Table data are stored in separate files (for lower_case_table_names) */
#define HA_FILE_BASED	       (1ULL << 26)
#define HA_CAN_BIT_FIELD       (1ULL << 28) /* supports bit fields */
#define HA_NEED_READ_RANGE_BUFFER (1ULL << 29) /* for read_multi_range */
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1ULL << 30)
#define HA_NO_COPY_ON_ALTER    (1ULL << 31)
#define HA_HAS_RECORDS	       (1ULL << 32) /* records() gives exact count*/
/* Has it's own method of binlog logging */
#define HA_HAS_OWN_BINLOGGING  (1ULL << 33)
/*
  Engine is capable of row-format and statement-format logging,
  respectively
*/
#define HA_BINLOG_ROW_CAPABLE  (1ULL << 34)
#define HA_BINLOG_STMT_CAPABLE (1ULL << 35)

/*
    When a multiple key conflict happens in a REPLACE command mysql
    expects the conflicts to be reported in the ascending order of
    key names.

    For e.g.

    CREATE TABLE t1 (a INT, UNIQUE (a), b INT NOT NULL, UNIQUE (b), c INT NOT
                     NULL, INDEX(c));

    REPLACE INTO t1 VALUES (1,1,1),(2,2,2),(2,1,3);

    MySQL expects the conflict with 'a' to be reported before the conflict with
    'b'.

    If the underlying storage engine does not report the conflicting keys in
    ascending order, it causes unexpected errors when the REPLACE command is
    executed.

    This flag helps the underlying SE to inform the server that the keys are not
    ordered.
*/
#define HA_DUPLICATE_KEY_NOT_IN_ORDER    (1ULL << 36)

/*
  Engine supports REPAIR TABLE. Used by CHECK TABLE FOR UPGRADE if an
  incompatible table is detected. If this flag is set, CHECK TABLE FOR UPGRADE
  will report ER_TABLE_NEEDS_UPGRADE, otherwise ER_TABLE_NEED_REBUILD.
*/
#define HA_CAN_REPAIR                    (1ULL << 37)

/* Has automatic checksums and uses the new checksum format */
#define HA_HAS_NEW_CHECKSUM    (1ULL << 38)
#define HA_CAN_VIRTUAL_COLUMNS (1ULL << 39)
#define HA_MRR_CANT_SORT       (1ULL << 40)
/* All of VARCHAR is stored, including bytes after real varchar data */
#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41)

/*
  This storage engine supports condition pushdown
*/
#define HA_CAN_TABLE_CONDITION_PUSHDOWN (1ULL << 42)
/* old name for the same flag */
#define HA_MUST_USE_TABLE_CONDITION_PUSHDOWN HA_CAN_TABLE_CONDITION_PUSHDOWN

/**
  The handler supports read before write removal optimization

  Read before write removal may be used for storage engines which support
  write without previous read of the row to be updated. Handler returning
  this flag must implement start_read_removal() and end_read_removal().
  The handler may return "fake" rows constructed from the key of the row
  asked for. This is used to optimize UPDATE and DELETE by reducing the
  number of roundtrips between handler and storage engine.
  
  Example:
  UPDATE a=1 WHERE pk IN (<keys>)

  mysql_update()
  {
    if (<conditions for starting read removal>)
      start_read_removal()
      -> handler returns true if read removal supported for this table/query

    while(read_record("pk=<key>"))
      -> handler returns fake row with column "pk" set to <key>

      ha_update_row()
      -> handler sends write "a=1" for row with "pk=<key>"

    end_read_removal()
    -> handler returns the number of rows actually written
  }

  @note This optimization in combination with batching may be used to
        remove even more roundtrips.
*/
#define HA_READ_BEFORE_WRITE_REMOVAL  (1ULL << 43)

/*
  Engine supports extended fulltext API
 */
#define HA_CAN_FULLTEXT_EXT              (1ULL << 44)

/*
  Storage engine supports table export using the
  FLUSH TABLE <table_list> FOR EXPORT statement
  (meaning, after this statement one can copy table files out of the
  datadir and later "import" (somehow) in another MariaDB instance)
 */
#define HA_CAN_EXPORT                 (1ULL << 45)

/*
  Storage engine does not require an exclusive metadata lock
  on the table during optimize. (TODO and repair?).
  It can allow other connections to open the table.
  (it does not necessarily mean that other connections can
  read or modify the table - this is defined by THR locks and the
  ::store_lock() method).
*/
#define HA_CONCURRENT_OPTIMIZE          (1ULL << 46)

/*
  If the storage engine support tables that will not roll back on commit
  In addition the table should not lock rows and support READ and WRITE
  UNCOMMITTED.
  This is useful for implementing things like SEQUENCE but can also in
  the future be useful to do logging that should never roll back.
*/
#define HA_CAN_TABLES_WITHOUT_ROLLBACK  (1ULL << 47)

/*
  Mainly for usage by SEQUENCE engine. Setting this flag means
  that the table will never roll back and that all operations
  for this table should stored in the non transactional log
  space that will always be written, even on rollback.
*/

#define HA_PERSISTENT_TABLE              (1ULL << 48)

/*
  If storage engine uses another engine as a base
  This flag is also needed if the table tries to open the .frm file
  as part of drop table.
*/
#define HA_REUSES_FILE_NAMES             (1ULL << 49)

/*
  Set of all binlog flags. Currently only contain the capabilities
  flags.
 */
#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)

/* The following are used by Spider */
#define HA_CAN_FORCE_BULK_UPDATE (1ULL << 50)
#define HA_CAN_FORCE_BULK_DELETE (1ULL << 51)
#define HA_CAN_DIRECT_UPDATE_AND_DELETE (1ULL << 52)

/* The following is for partition handler */
#define HA_CAN_MULTISTEP_MERGE (1LL << 53)

/* calling cmp_ref() on the engine is expensive */
#define HA_SLOW_CMP_REF         (1ULL << 54)
#define HA_CMP_REF_IS_EXPENSIVE HA_SLOW_CMP_REF

/**
  Some engines are unable to provide an efficient implementation for rnd_pos().
  Server will try to avoid it, if possible

  TODO better to do it with cost estimates, not with an explicit flag
*/
#define HA_SLOW_RND_POS  (1ULL << 55)

/* Safe for online backup */
#define HA_CAN_ONLINE_BACKUPS (1ULL << 56)

/* Support native hash index */
#define HA_CAN_HASH_KEYS        (1ULL << 57)
#define HA_CRASH_SAFE           (1ULL << 58)

/*
  There is no need to evict the table from the table definition cache having
  run ANALYZE TABLE on it
 */
#define HA_ONLINE_ANALYZE             (1ULL << 59)
/*
  Rowid's are not comparable. This is set if the rowid is unique to the
  current open handler, like it is with federated where the rowid is a
  pointer to a local result set buffer. The effect of having this set is
  that the optimizer will not consider the following optimizations for
  the table:
  ror scans, filtering or duplicate weedout
*/
#define HA_NON_COMPARABLE_ROWID (1ULL << 60)

/* Implements SELECT ... FOR UPDATE SKIP LOCKED */
#define HA_CAN_SKIP_LOCKED  (1ULL << 61)

#define HA_LAST_TABLE_FLAG HA_CAN_SKIP_LOCKED


/* bits in index_flags(index_number) for what you can do with index */
#define HA_READ_NEXT            1       /* TODO really use this flag */
#define HA_READ_PREV            2       /* supports ::index_prev */
#define HA_READ_ORDER           4       /* index_next/prev follow sort order */
#define HA_READ_RANGE           8       /* can find all records in a range */
#define HA_ONLY_WHOLE_INDEX	16	/* Can't use part key searches */
#define HA_KEYREAD_ONLY         64	/* Support HA_EXTRA_KEYREAD */

/*
  Index scan will not return records in rowid order. Not guaranteed to be
  set for unordered (e.g. HASH) indexes.
*/
#define HA_KEY_SCAN_NOT_ROR     128 
#define HA_DO_INDEX_COND_PUSHDOWN  256 /* Supports Index Condition Pushdown */
/*
  Data is clustered on this key. This means that when you read the key
  you also get the row data without any additional disk reads.
*/
#define HA_CLUSTERED_INDEX      512

#define HA_DO_RANGE_FILTER_PUSHDOWN  1024

/*
  bits in alter_table_flags:
*/
/*
  These bits are set if different kinds of indexes can be created or dropped
  in-place without re-creating the table using a temporary table.
  NO_READ_WRITE indicates that the handler needs concurrent reads and writes
  of table data to be blocked.
  Partitioning needs both ADD and DROP to be supported by its underlying
  handlers, due to error handling, see bug#57778.
*/
#define HA_INPLACE_ADD_INDEX_NO_READ_WRITE         (1UL << 0)
#define HA_INPLACE_DROP_INDEX_NO_READ_WRITE        (1UL << 1)
#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE  (1UL << 2)
#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE (1UL << 3)
#define HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE      (1UL << 4)
#define HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE     (1UL << 5)
/*
  These are set if different kinds of indexes can be created or dropped
  in-place while still allowing concurrent reads (but not writes) of table
  data. If a handler is capable of one or more of these, it should also set
  the corresponding *_NO_READ_WRITE bit(s).
*/
#define HA_INPLACE_ADD_INDEX_NO_WRITE              (1UL << 6)
#define HA_INPLACE_DROP_INDEX_NO_WRITE             (1UL << 7)
#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE       (1UL << 8)
#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE      (1UL << 9)
#define HA_INPLACE_ADD_PK_INDEX_NO_WRITE           (1UL << 10)
#define HA_INPLACE_DROP_PK_INDEX_NO_WRITE          (1UL << 11)
/*
  HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
  supported at all.
  HA_FAST_CHANGE_PARTITION means that optimised variants of the changes
  exists but they are not necessarily done online.

  HA_ONLINE_DOUBLE_WRITE means that the handler supports writing to both
  the new partition and to the old partitions when updating through the
  old partitioning schema while performing a change of the partitioning.
  This means that we can support updating of the table while performing
  the copy phase of the change. For no lock at all also a double write
  from new to old must exist and this is not required when this flag is
  set.
  This is actually removed even before it was introduced the first time.
  The new idea is that handlers will handle the lock level already in
  store_lock for ALTER TABLE partitions.

  HA_PARTITION_ONE_PHASE is a flag that can be set by handlers that take
  care of changing the partitions online and in one phase. Thus all phases
  needed to handle the change are implemented inside the storage engine.
  The storage engine must also support auto-discovery since the frm file
  is changed as part of the change and this change must be controlled by
  the storage engine. A typical engine to support this is NDB (through
  WL #2498).
*/
#define HA_PARTITION_FUNCTION_SUPPORTED         (1UL << 12)
#define HA_FAST_CHANGE_PARTITION                (1UL << 13)
#define HA_PARTITION_ONE_PHASE                  (1UL << 14)

/*
  Note: the following includes binlog and closing 0.
  TODO remove the limit, use dynarrays
*/
#define MAX_HA 64

/*
  Use this instead of 0 as the initial value for the slot number of
  handlerton, so that we can distinguish uninitialized slot number
  from slot 0.
*/
#define HA_SLOT_UNDEF ((uint)-1)

/*
  Parameters for open() (in register form->filestat)
  HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED
*/

#define HA_OPEN_KEYFILE		1U
#define HA_READ_ONLY		16U	/* File opened as readonly */
/* Try readonly if can't open with read and write */
#define HA_TRY_READ_ONLY	32U

	/* Some key definitions */
#define HA_KEY_NULL_LENGTH	1
#define HA_KEY_BLOB_LENGTH	2

/* Maximum length of any index lookup key, in bytes */

#define MAX_KEY_LENGTH (MAX_DATA_LENGTH_FOR_KEY \
                         +(MAX_REF_PARTS \
                          *(HA_KEY_NULL_LENGTH + HA_KEY_BLOB_LENGTH)))

#define HA_LEX_CREATE_TMP_TABLE	1U
#define HA_CREATE_TMP_ALTER     8U
#define HA_LEX_CREATE_SEQUENCE  16U
#define HA_VERSIONED_TABLE      32U
#define HA_SKIP_KEY_SORT        64U
/*
  A temporary table that can be used by different threads, eg. replication
  threads. This flag ensure that memory is not allocated with THREAD_SPECIFIC,
  as we do for other temporary tables.
*/
#define HA_LEX_CREATE_GLOBAL_TMP_TABLE 128U

#define HA_MAX_REC_LENGTH	65535

/* Table caching type */
#define HA_CACHE_TBL_NONTRANSACT 0
#define HA_CACHE_TBL_NOCACHE     1U
#define HA_CACHE_TBL_ASKTRANSACT 2U
#define HA_CACHE_TBL_TRANSACT    4U

/**
  Options for the START TRANSACTION statement.

  Note that READ ONLY and READ WRITE are logically mutually exclusive.
  This is enforced by the parser and depended upon by trans_begin().

  We need two flags instead of one in order to differentiate between
  situation when no READ WRITE/ONLY clause were given and thus transaction
  is implicitly READ WRITE and the case when READ WRITE clause was used
  explicitly.
*/

// WITH CONSISTENT SNAPSHOT option
static const uint MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT = 1;
// READ ONLY option
static const uint MYSQL_START_TRANS_OPT_READ_ONLY          = 2;
// READ WRITE option
static const uint MYSQL_START_TRANS_OPT_READ_WRITE         = 4;

/* Flags for method is_fatal_error */
#define HA_CHECK_DUP_KEY 1U
#define HA_CHECK_DUP_UNIQUE 2U
#define HA_CHECK_FK_ERROR 4U
#define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE)
#define HA_CHECK_ALL (~0U)

/* Options for info_push() */
#define INFO_KIND_UPDATE_FIELDS       101
#define INFO_KIND_UPDATE_VALUES       102
#define INFO_KIND_FORCE_LIMIT_BEGIN   103
#define INFO_KIND_FORCE_LIMIT_END     104

enum legacy_db_type
{
  /* note these numerical values are fixed and can *not* be changed */
  DB_TYPE_UNKNOWN=0,
  DB_TYPE_HEAP=6,
  DB_TYPE_MYISAM=9,
  DB_TYPE_MRG_MYISAM=10,
  DB_TYPE_INNODB=12,
  DB_TYPE_EXAMPLE_DB=15,
  DB_TYPE_ARCHIVE_DB=16,
  DB_TYPE_CSV_DB=17,
  DB_TYPE_FEDERATED_DB=18,
  DB_TYPE_BLACKHOLE_DB=19,
  DB_TYPE_PARTITION_DB=20,
  DB_TYPE_BINLOG=21,
  DB_TYPE_PBXT=23,
  DB_TYPE_PERFORMANCE_SCHEMA=28,
  DB_TYPE_S3=41,
  DB_TYPE_ARIA=42,
  DB_TYPE_TOKUDB=43, /* disabled in MariaDB Server 10.5, removed in 10.6 */
  DB_TYPE_SEQUENCE=44,
  DB_TYPE_FIRST_DYNAMIC=45,
  DB_TYPE_DEFAULT=127 // Must be last
};
/*
  Better name for DB_TYPE_UNKNOWN. Should be used for engines that do not have
  a hard-coded type value here.
 */
#define DB_TYPE_AUTOASSIGN DB_TYPE_UNKNOWN

enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
		ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
		ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };

/* not part of the enum, so that it shouldn't be in switch(row_type) */
#define ROW_TYPE_MAX ((uint)ROW_TYPE_PAGE + 1)

/* Specifies data storage format for individual columns */
enum column_format_type {
  COLUMN_FORMAT_TYPE_DEFAULT=   0, /* Not specified (use engine default) */
  COLUMN_FORMAT_TYPE_FIXED=     1, /* FIXED format */
  COLUMN_FORMAT_TYPE_DYNAMIC=   2  /* DYNAMIC format */
};

enum enum_binlog_func {
  BFN_RESET_LOGS=        1,
  BFN_RESET_SLAVE=       2,
  BFN_BINLOG_WAIT=       3,
  BFN_BINLOG_END=        4,
  BFN_BINLOG_PURGE_FILE= 5
};

enum enum_binlog_command {
  LOGCOM_CREATE_TABLE,
  LOGCOM_ALTER_TABLE,
  LOGCOM_RENAME_TABLE,
  LOGCOM_DROP_TABLE,
  LOGCOM_CREATE_DB,
  LOGCOM_ALTER_DB,
  LOGCOM_DROP_DB
};

/* struct to hold information about the table that should be created */

/* Bits in used_fields */
#define HA_CREATE_USED_AUTO             (1UL << 0)
#define HA_CREATE_USED_RAID             (1UL << 1) //RAID is no longer available
#define HA_CREATE_USED_UNION            (1UL << 2)
#define HA_CREATE_USED_INSERT_METHOD    (1UL << 3)
#define HA_CREATE_USED_MIN_ROWS         (1UL << 4)
#define HA_CREATE_USED_MAX_ROWS         (1UL << 5)
#define HA_CREATE_USED_AVG_ROW_LENGTH   (1UL << 6)
#define HA_CREATE_USED_PACK_KEYS        (1UL << 7)
#define HA_CREATE_USED_CHARSET          (1UL << 8)
#define HA_CREATE_USED_DEFAULT_CHARSET  (1UL << 9)
#define HA_CREATE_USED_DATADIR          (1UL << 10)
#define HA_CREATE_USED_INDEXDIR         (1UL << 11)
#define HA_CREATE_USED_ENGINE           (1UL << 12)
#define HA_CREATE_USED_CHECKSUM         (1UL << 13)
#define HA_CREATE_USED_DELAY_KEY_WRITE  (1UL << 14)
#define HA_CREATE_USED_ROW_FORMAT       (1UL << 15)
#define HA_CREATE_USED_COMMENT          (1UL << 16)
#define HA_CREATE_USED_PASSWORD         (1UL << 17)
#define HA_CREATE_USED_CONNECTION       (1UL << 18)
#define HA_CREATE_USED_KEY_BLOCK_SIZE   (1UL << 19)
/* The following two are used by Maria engine: */
#define HA_CREATE_USED_TRANSACTIONAL    (1UL << 20)
#define HA_CREATE_USED_PAGE_CHECKSUM    (1UL << 21)
/** This is set whenever STATS_PERSISTENT=0|1|default has been
specified in CREATE/ALTER TABLE. See also HA_OPTION_STATS_PERSISTENT in
include/my_base.h. It is possible to distinguish whether
STATS_PERSISTENT=default has been specified or no STATS_PERSISTENT= is
given at all. */
#define HA_CREATE_USED_STATS_PERSISTENT (1UL << 22)
/**
   This is set whenever STATS_AUTO_RECALC=0|1|default has been
   specified in CREATE/ALTER TABLE. See enum_stats_auto_recalc.
   It is possible to distinguish whether STATS_AUTO_RECALC=default
   has been specified or no STATS_AUTO_RECALC= is given at all.
*/
#define HA_CREATE_USED_STATS_AUTO_RECALC (1UL << 23)
/**
   This is set whenever STATS_SAMPLE_PAGES=N|default has been
   specified in CREATE/ALTER TABLE. It is possible to distinguish whether
   STATS_SAMPLE_PAGES=default has been specified or no STATS_SAMPLE_PAGES= is
   given at all.
*/
#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1UL << 24)

/* Create a sequence */
#define HA_CREATE_USED_SEQUENCE           (1UL << 25)
/* Tell binlog_show_create_table to print all engine options */
#define HA_CREATE_PRINT_ALL_OPTIONS       (1UL << 26)

typedef ulonglong alter_table_operations;
typedef bool Log_func(THD*, TABLE*, bool, const uchar*, const uchar*);

/*
  These flags are set by the parser and describes the type of
  operation(s) specified by the ALTER TABLE statement.
*/

// Set by parser for ADD [COLUMN]
#define ALTER_PARSER_ADD_COLUMN     (1ULL <<  0)
// Set by parser for DROP [COLUMN]
#define ALTER_PARSER_DROP_COLUMN    (1ULL <<  1)
// Set for CHANGE [COLUMN] | MODIFY [CHANGE] & mysql_recreate_table
#define ALTER_CHANGE_COLUMN         (1ULL <<  2)
// Set for ADD INDEX | ADD KEY | ADD PRIMARY KEY | ADD UNIQUE KEY |
//         ADD UNIQUE INDEX | ALTER ADD [COLUMN]
#define ALTER_ADD_INDEX             (1ULL <<  3)
// Set for DROP PRIMARY KEY | DROP FOREIGN KEY | DROP KEY | DROP INDEX
#define ALTER_DROP_INDEX            (1ULL <<  4)
// Set for RENAME [TO]
#define ALTER_RENAME                (1ULL <<  5)
// Set for ORDER BY
#define ALTER_ORDER                 (1ULL <<  6)
// Set for table_options, like table comment
#define ALTER_OPTIONS               (1ULL <<  7)
// Set for ALTER [COLUMN] ... SET DEFAULT ... | DROP DEFAULT
#define ALTER_CHANGE_COLUMN_DEFAULT (1ULL <<  8)
// Set for DISABLE KEYS | ENABLE KEYS
#define ALTER_KEYS_ONOFF            (1ULL <<  9)
// Set for FORCE, ENGINE(same engine), by mysql_recreate_table()
#define ALTER_RECREATE              (1ULL << 10)
// Set for CONVERT TO
#define ALTER_CONVERT_TO            (1ULL << 11)
// Set for DROP ... ADD some_index
#define ALTER_RENAME_INDEX          (1ULL << 12)
// Set for ADD FOREIGN KEY
#define ALTER_ADD_FOREIGN_KEY       (1ULL << 21)
// Set for DROP FOREIGN KEY
#define ALTER_DROP_FOREIGN_KEY      (1ULL << 22)
#define ALTER_CHANGE_INDEX_COMMENT  (1ULL << 23)
// Set for ADD [COLUMN] FIRST | AFTER
#define ALTER_COLUMN_ORDER          (1ULL << 25)
#define ALTER_ADD_CHECK_CONSTRAINT  (1ULL << 27)
#define ALTER_DROP_CHECK_CONSTRAINT (1ULL << 28)
#define ALTER_RENAME_COLUMN         (1ULL << 29)
#define ALTER_COLUMN_UNVERSIONED    (1ULL << 30)
#define ALTER_ADD_SYSTEM_VERSIONING (1ULL << 31)
#define ALTER_DROP_SYSTEM_VERSIONING (1ULL << 32)
#define ALTER_ADD_PERIOD             (1ULL << 33)
#define ALTER_DROP_PERIOD            (1ULL << 34)

/*
  Following defines are used by ALTER_INPLACE_TABLE

  They do describe in more detail the type operation(s) to be executed
  by the storage engine. For example, which type of type of index to be
  added/dropped.  These are set by fill_alter_inplace_info().
*/

#define ALTER_RECREATE_TABLE	     ALTER_RECREATE
#define ALTER_CHANGE_CREATE_OPTION   ALTER_OPTIONS
#define ALTER_ADD_COLUMN             (ALTER_ADD_VIRTUAL_COLUMN | \
                                      ALTER_ADD_STORED_BASE_COLUMN | \
                                      ALTER_ADD_STORED_GENERATED_COLUMN)
#define ALTER_DROP_COLUMN             (ALTER_DROP_VIRTUAL_COLUMN | \
                                       ALTER_DROP_STORED_COLUMN)
#define ALTER_COLUMN_DEFAULT          ALTER_CHANGE_COLUMN_DEFAULT

// Add non-unique, non-primary index
#define ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX  (1ULL << 35)

// Drop non-unique, non-primary index
#define ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX (1ULL << 36)

// Add unique, non-primary index
#define ALTER_ADD_UNIQUE_INDEX               (1ULL << 37)

// Drop unique, non-primary index
#define ALTER_DROP_UNIQUE_INDEX              (1ULL << 38)

// Add primary index
#define ALTER_ADD_PK_INDEX                   (1ULL << 39)

// Drop primary index
#define ALTER_DROP_PK_INDEX                  (1ULL << 40)

// Virtual generated column
#define ALTER_ADD_VIRTUAL_COLUMN             (1ULL << 41)
// Stored base (non-generated) column
#define ALTER_ADD_STORED_BASE_COLUMN         (1ULL << 42)
// Stored generated column
#define ALTER_ADD_STORED_GENERATED_COLUMN    (1ULL << 43)

// Drop column
#define ALTER_DROP_VIRTUAL_COLUMN            (1ULL << 44)
#define ALTER_DROP_STORED_COLUMN             (1ULL << 45)

// Rename column (verified; ALTER_RENAME_COLUMN may use original name)
#define ALTER_COLUMN_NAME          	     (1ULL << 46)

// Change column datatype
#define ALTER_VIRTUAL_COLUMN_TYPE            (1ULL << 47)
#define ALTER_STORED_COLUMN_TYPE             (1ULL << 48)


// Engine can handle type change by itself in ALGORITHM=INPLACE
#define ALTER_COLUMN_TYPE_CHANGE_BY_ENGINE       (1ULL << 49)

// Reorder column
#define ALTER_STORED_COLUMN_ORDER            (1ULL << 50)

// Reorder column
#define ALTER_VIRTUAL_COLUMN_ORDER           (1ULL << 51)

// Change column from NOT NULL to NULL
#define ALTER_COLUMN_NULLABLE                (1ULL << 52)

// Change column from NULL to NOT NULL
#define ALTER_COLUMN_NOT_NULLABLE            (1ULL << 53)

// Change column generation expression
#define ALTER_VIRTUAL_GCOL_EXPR              (1ULL << 54)
#define ALTER_STORED_GCOL_EXPR               (1ULL << 55)

// column's engine options changed, something in field->option_struct
#define ALTER_COLUMN_OPTION                  (1ULL << 56)

// MySQL alias for the same thing:
#define ALTER_COLUMN_STORAGE_TYPE            ALTER_COLUMN_OPTION

// Change the column format of column
#define ALTER_COLUMN_COLUMN_FORMAT           (1ULL << 57)

/**
  Changes in generated columns that affect storage,
  for example, when a vcol type or expression changes
  and this vcol is indexed or used in a partitioning expression
*/
#define ALTER_COLUMN_VCOL                    (1ULL << 58)

/**
  ALTER TABLE for a partitioned table. The engine needs to commit
  online alter of all partitions atomically (using group_commit_ctx)
*/
#define ALTER_PARTITIONED                    (1ULL << 59)

/**
   Change in index length such that it doesn't require index rebuild.
*/
#define ALTER_COLUMN_INDEX_LENGTH            (1ULL << 60)

/**
  Indicate that index order might have been changed. Disables inplace algorithm
  by default (not for InnoDB).
*/
#define ALTER_INDEX_ORDER                    (1ULL << 61)

/**
  Means that the ignorability of an index is changed.
*/
#define ALTER_INDEX_IGNORABILITY              (1ULL << 62)

/*
  Flags set in partition_flags when altering partitions
*/

// Set for ADD PARTITION
#define ALTER_PARTITION_ADD         (1ULL << 1)
// Set for DROP PARTITION
#define ALTER_PARTITION_DROP        (1ULL << 2)
// Set for COALESCE PARTITION
#define ALTER_PARTITION_COALESCE    (1ULL << 3)
// Set for REORGANIZE PARTITION ... INTO
#define ALTER_PARTITION_REORGANIZE  (1ULL << 4)
// Set for partition_options
#define ALTER_PARTITION_INFO        (1ULL << 5)
// Set for LOAD INDEX INTO CACHE ... PARTITION
// Set for CACHE INDEX ... PARTITION
#define ALTER_PARTITION_ADMIN       (1ULL << 6)
// Set for REBUILD PARTITION
#define ALTER_PARTITION_REBUILD     (1ULL << 7)
// Set for partitioning operations specifying ALL keyword
#define ALTER_PARTITION_ALL         (1ULL << 8)
// Set for REMOVE PARTITIONING
#define ALTER_PARTITION_REMOVE      (1ULL << 9)
// Set for EXCHANGE PARITION
#define ALTER_PARTITION_EXCHANGE    (1ULL << 10)
// Set by Sql_cmd_alter_table_truncate_partition::execute()
#define ALTER_PARTITION_TRUNCATE    (1ULL << 11)
// Set for REORGANIZE PARTITION
#define ALTER_PARTITION_TABLE_REORG           (1ULL << 12)

/*
  This is master database for most of system tables. However there
  can be other databases which can hold system tables. Respective
  storage engines define their own system database names.
*/
extern const char *mysqld_system_database;

/*
  Structure to hold list of system_database.system_table.
  This is used at both mysqld and storage engine layer.
*/
struct st_system_tablename
{
  const char *db;
  const char *tablename;
};


typedef ulonglong my_xid; // this line is the same as in log_event.h
#define MYSQL_XID_PREFIX "MySQLXid"
#define MYSQL_XID_PREFIX_LEN 8 // must be a multiple of 8
#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id))
#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid))

#define XIDDATASIZE MYSQL_XIDDATASIZE
#define MAXGTRIDSIZE 64
#define MAXBQUALSIZE 64

#define COMPATIBLE_DATA_YES 0
#define COMPATIBLE_DATA_NO  1

/**
  struct xid_t is binary compatible with the XID structure as
  in the X/Open CAE Specification, Distributed Transaction Processing:
  The XA Specification, X/Open Company Ltd., 1991.
  http://www.opengroup.org/bookstore/catalog/c193.htm

  @see MYSQL_XID in mysql/plugin.h
*/
struct xid_t {
  long formatID;
  long gtrid_length;
  long bqual_length;
  char data[XIDDATASIZE];  // not \0-terminated !

  xid_t() = default;                                /* Remove gcc warning */
  bool eq(struct xid_t *xid) const
  { return !xid->is_null() && eq(xid->gtrid_length, xid->bqual_length, xid->data); }
  bool eq(long g, long b, const char *d) const
  { return !is_null() && g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
  void set(struct xid_t *xid)
  { memcpy(this, xid, xid->length()); }
  void set(long f, const char *g, long gl, const char *b, long bl)
  {
    formatID= f;
    if ((gtrid_length= gl))
      memcpy(data, g, gl);
    if ((bqual_length= bl))
      memcpy(data+gl, b, bl);
  }
  // Populate server_id if it's specified, otherwise use the current server_id
  void set(ulonglong xid, decltype(::server_id) trx_server_id= server_id)
  {
    my_xid tmp;
    formatID= 1;
    set(MYSQL_XID_PREFIX_LEN, 0, MYSQL_XID_PREFIX);
    memcpy(data+MYSQL_XID_PREFIX_LEN, &trx_server_id, sizeof(trx_server_id));
    tmp= xid;
    memcpy(data+MYSQL_XID_OFFSET, &tmp, sizeof(tmp));
    gtrid_length=MYSQL_XID_GTRID_LEN;
  }
  void set(long g, long b, const char *d)
  {
    formatID= 1;
    gtrid_length= g;
    bqual_length= b;
    memcpy(data, d, g+b);
  }
  bool is_null() const { return formatID == -1; }
  void null() { formatID= -1; }
  my_xid quick_get_my_xid()
  {
    my_xid tmp;
    memcpy(&tmp, data+MYSQL_XID_OFFSET, sizeof(tmp));
    return tmp;
  }
  my_xid get_my_xid()
  {
    return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 &&
           !memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ?
           quick_get_my_xid() : 0;
  }
  decltype(::server_id) get_trx_server_id()
  {
    decltype(::server_id) trx_server_id;
    memcpy(&trx_server_id, data+MYSQL_XID_PREFIX_LEN, sizeof(trx_server_id));
    return trx_server_id;
  }
  uint length()
  {
    return static_cast<uint>(sizeof(formatID)) + key_length();
  }
  uchar *key() const
  {
    return (uchar *)&gtrid_length;
  }
  uint key_length() const
  {
    return static_cast<uint>(sizeof(gtrid_length)+sizeof(bqual_length)+
                             gtrid_length+bqual_length);
  }
};
typedef struct xid_t XID;

/*
  Enumerates a sequence in the order of
  their creation that is in the top-down order of the index file.
  Ranges from zero through MAX_binlog_id.
  Not confuse the value with the binlog file numerical suffix,
  neither with the binlog file line in the binlog index file.
*/
typedef uint Binlog_file_id;
const Binlog_file_id MAX_binlog_id= UINT_MAX;
const my_off_t       MAX_off_t    = (~(my_off_t) 0);
/*
  Compound binlog-id and byte offset of transaction's first event
  in a sequence (e.g the recovery sequence) of binlog files.
  Binlog_offset(0,0) is the minimum value to mean
  the first byte of the first binlog file.
*/
typedef std::pair<Binlog_file_id, my_off_t> Binlog_offset;

/* binlog-based recovery transaction descriptor */
struct xid_recovery_member
{
  my_xid xid;
  uint in_engine_prepare;  // number of engines that have xid prepared
  bool decided_to_commit;
  /*
    Semisync recovery binlog offset. It's initialized with the maximum
    unreachable offset. The max value will remain for any transaction
    not found in binlog to yield its rollback decision as it's guaranteed
    to be within a truncated tail part of the binlog.
  */
  Binlog_offset binlog_coord;
  XID *full_xid;           // needed by wsrep or past it recovery
  decltype(::server_id) server_id;         // server id of orginal server

  xid_recovery_member(my_xid xid_arg, uint prepare_arg, bool decided_arg,
                      XID *full_xid_arg, decltype(::server_id) server_id_arg)
    : xid(xid_arg), in_engine_prepare(prepare_arg),
      decided_to_commit(decided_arg),
      binlog_coord(Binlog_offset(MAX_binlog_id, MAX_off_t)),
      full_xid(full_xid_arg), server_id(server_id_arg) {};
};

/* for recover() handlerton call */
#define MIN_XID_LIST_SIZE  128
#define MAX_XID_LIST_SIZE  (1024*128)

/*
  These structures are used to pass information from a set of SQL commands
  on add/drop/change tablespace definitions to the proper hton.
*/
#define UNDEF_NODEGROUP 65535
enum ts_command_type
{
  TS_CMD_NOT_DEFINED = -1,
  CREATE_TABLESPACE = 0,
  ALTER_TABLESPACE = 1,
  CREATE_LOGFILE_GROUP = 2,
  ALTER_LOGFILE_GROUP = 3,
  DROP_TABLESPACE = 4,
  DROP_LOGFILE_GROUP = 5,
  CHANGE_FILE_TABLESPACE = 6,
  ALTER_ACCESS_MODE_TABLESPACE = 7
};

enum ts_alter_tablespace_type
{
  TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
  ALTER_TABLESPACE_ADD_FILE = 1,
  ALTER_TABLESPACE_DROP_FILE = 2
};

enum tablespace_access_mode
{
  TS_NOT_DEFINED= -1,
  TS_READ_ONLY = 0,
  TS_READ_WRITE = 1,
  TS_NOT_ACCESSIBLE = 2
};

/* Statistics about batch operations like bulk_insert */
struct ha_copy_info
{
  ha_rows records;        /* Used to check if rest of variables can be used */
  ha_rows touched;
  ha_rows copied;
  ha_rows deleted;
  ha_rows updated;
};

struct handlerton;
class st_alter_tablespace : public Sql_alloc
{
  public:
  const char *tablespace_name;
  const char *logfile_group_name;
  enum ts_command_type ts_cmd_type;
  enum ts_alter_tablespace_type ts_alter_tablespace_type;
  const char *data_file_name;
  const char *undo_file_name;
  const char *redo_file_name;
  ulonglong extent_size;
  ulonglong undo_buffer_size;
  ulonglong redo_buffer_size;
  ulonglong initial_size;
  ulonglong autoextend_size;
  ulonglong max_size;
  uint nodegroup_id;
  handlerton *storage_engine;
  bool wait_until_completed;
  const char *ts_comment;
  enum tablespace_access_mode ts_access_mode;
  st_alter_tablespace()
  {
    tablespace_name= NULL;
    logfile_group_name= "DEFAULT_LG"; //Default log file group
    ts_cmd_type= TS_CMD_NOT_DEFINED;
    data_file_name= NULL;
    undo_file_name= NULL;
    redo_file_name= NULL;
    extent_size= 1024*1024;        //Default 1 MByte
    undo_buffer_size= 8*1024*1024; //Default 8 MByte
    redo_buffer_size= 8*1024*1024; //Default 8 MByte
    initial_size= 128*1024*1024;   //Default 128 MByte
    autoextend_size= 0;            //No autoextension as default
    max_size= 0;                   //Max size == initial size => no extension
    storage_engine= NULL;
    nodegroup_id= UNDEF_NODEGROUP;
    wait_until_completed= TRUE;
    ts_comment= NULL;
    ts_access_mode= TS_NOT_DEFINED;
  }
};

/* The handler for a table type.  Will be included in the TABLE structure */

struct TABLE;

/*
  Make sure that the order of schema_tables and enum_schema_tables are the same.
*/
enum enum_schema_tables
{
  SCH_ALL_PLUGINS,
  SCH_APPLICABLE_ROLES,
  SCH_CHARSETS,
  SCH_CHECK_CONSTRAINTS,
  SCH_COLLATIONS,
  SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
  SCH_COLUMNS,
  SCH_COLUMN_PRIVILEGES,
  SCH_ENABLED_ROLES,
  SCH_ENGINES,
  SCH_EVENTS,
  SCH_EXPLAIN,
  SCH_FILES,
  SCH_GLOBAL_STATUS,
  SCH_GLOBAL_VARIABLES,
  SCH_KEYWORDS,
  SCH_KEY_CACHES,
  SCH_KEY_COLUMN_USAGE,
  SCH_OPEN_TABLES,
  SCH_OPT_TRACE,
  SCH_PARAMETERS,
  SCH_PARTITIONS,
  SCH_PLUGINS,
  SCH_PROCESSLIST,
  SCH_PROFILES,
  SCH_REFERENTIAL_CONSTRAINTS,
  SCH_PROCEDURES,
  SCH_SCHEMATA,
  SCH_SCHEMA_PRIVILEGES,
  SCH_SESSION_STATUS,
  SCH_SESSION_VARIABLES,
  SCH_STATISTICS,
  SCH_SQL_FUNCTIONS,
  SCH_SYSTEM_VARIABLES,
  SCH_TABLES,
  SCH_TABLESPACES,
  SCH_TABLE_CONSTRAINTS,
  SCH_TABLE_NAMES,
  SCH_TABLE_PRIVILEGES,
  SCH_TRIGGERS,
  SCH_USER_PRIVILEGES,
  SCH_VIEWS
};

struct TABLE_SHARE;
struct HA_CREATE_INFO;
struct st_foreign_key_info;
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len,
                             const char *file, size_t file_len,
                             const char *status, size_t status_len);
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA];

#define view_pseudo_hton ((handlerton *)1)

/*
  Definitions for engine-specific table/field/index options in the CREATE TABLE.

  Options are declared with HA_*OPTION_* macros (HA_TOPTION_NUMBER,
  HA_FOPTION_ENUM, HA_IOPTION_STRING, etc).

  Every macros takes the option name, and the name of the underlying field of
  the appropriate C structure. The "appropriate C structure" is
  ha_table_option_struct for table level options,
  ha_field_option_struct for field level options,
  ha_index_option_struct for key level options. The engine either
  defines a structure of this name, or uses #define's to map
  these "appropriate" names to the actual structure type name.

  ULL options use a ulonglong as the backing store.
  HA_*OPTION_NUMBER() takes the option name, the structure field name,
  the default value for the option, min, max, and blk_siz values.

  STRING options use a char* as a backing store.
  HA_*OPTION_STRING takes the option name and the structure field name.
  The default value will be 0.

  ENUM options use a uint as a backing store (not enum!!!).
  HA_*OPTION_ENUM takes the option name, the structure field name,
  the default value for the option as a number, and a string with the
  permitted values for this enum - one string with comma separated values,
  for example: "gzip,bzip2,lzma"

  BOOL options use a bool as a backing store.
  HA_*OPTION_BOOL takes the option name, the structure field name,
  and the default value for the option.
  From the SQL, BOOL options accept YES/NO, ON/OFF, and 1/0.

  The name of the option is limited to 255 bytes,
  the value (for string options) - to the 32767 bytes.

  See ha_example.cc for an example.
*/

struct ha_table_option_struct;
struct ha_field_option_struct;
struct ha_index_option_struct;

enum ha_option_type { HA_OPTION_TYPE_ULL,    /* unsigned long long */
                      HA_OPTION_TYPE_STRING, /* char * */
                      HA_OPTION_TYPE_ENUM,   /* uint */
                      HA_OPTION_TYPE_BOOL,   /* bool */
                      HA_OPTION_TYPE_SYSVAR};/* type of the sysval */

#define HA_xOPTION_NUMBER(name, struc, field, def, min, max, blk_siz)   \
  { HA_OPTION_TYPE_ULL, name, sizeof(name)-1,                        \
    offsetof(struc, field), def, min, max, blk_siz, 0, 0 }
#define HA_xOPTION_STRING(name, struc, field)                        \
  { HA_OPTION_TYPE_STRING, name, sizeof(name)-1,                     \
    offsetof(struc, field), 0, 0, 0, 0, 0, 0}
#define HA_xOPTION_ENUM(name, struc, field, values, def)             \
  { HA_OPTION_TYPE_ENUM, name, sizeof(name)-1,                       \
    offsetof(struc, field), def, 0,                                  \
    sizeof(values)-1, 0, values, 0 }
#define HA_xOPTION_BOOL(name, struc, field, def)                     \
  { HA_OPTION_TYPE_BOOL, name, sizeof(name)-1,                       \
    offsetof(struc, field), def, 0, 1, 0, 0, 0 }
#define HA_xOPTION_SYSVAR(name, struc, field, sysvar)                \
  { HA_OPTION_TYPE_SYSVAR, name, sizeof(name)-1,                     \
    offsetof(struc, field), 0, 0, 0, 0, 0, MYSQL_SYSVAR(sysvar) }
#define HA_xOPTION_END { HA_OPTION_TYPE_ULL, 0, 0, 0, 0, 0, 0, 0, 0, 0 }

#define HA_TOPTION_NUMBER(name, field, def, min, max, blk_siz)          \
  HA_xOPTION_NUMBER(name, ha_table_option_struct, field, def, min, max, blk_siz)
#define HA_TOPTION_STRING(name, field)                               \
  HA_xOPTION_STRING(name, ha_table_option_struct, field)
#define HA_TOPTION_ENUM(name, field, values, def)                    \
  HA_xOPTION_ENUM(name, ha_table_option_struct, field, values, def)
#define HA_TOPTION_BOOL(name, field, def)                            \
  HA_xOPTION_BOOL(name, ha_table_option_struct, field, def)
#define HA_TOPTION_SYSVAR(name, field, sysvar)                       \
  HA_xOPTION_SYSVAR(name, ha_table_option_struct, field, sysvar)
#define HA_TOPTION_END HA_xOPTION_END

#define HA_FOPTION_NUMBER(name, field, def, min, max, blk_siz)          \
  HA_xOPTION_NUMBER(name, ha_field_option_struct, field, def, min, max, blk_siz)
#define HA_FOPTION_STRING(name, field)                               \
  HA_xOPTION_STRING(name, ha_field_option_struct, field)
#define HA_FOPTION_ENUM(name, field, values, def)                    \
  HA_xOPTION_ENUM(name, ha_field_option_struct, field, values, def)
#define HA_FOPTION_BOOL(name, field, def)                            \
  HA_xOPTION_BOOL(name, ha_field_option_struct, field, def)
#define HA_FOPTION_SYSVAR(name, field, sysvar)                       \
  HA_xOPTION_SYSVAR(name, ha_field_option_struct, field, sysvar)
#define HA_FOPTION_END HA_xOPTION_END

#define HA_IOPTION_NUMBER(name, field, def, min, max, blk_siz)          \
  HA_xOPTION_NUMBER(name, ha_index_option_struct, field, def, min, max, blk_siz)
#define HA_IOPTION_STRING(name, field)                               \
  HA_xOPTION_STRING(name, ha_index_option_struct, field)
#define HA_IOPTION_ENUM(name, field, values, def)                    \
  HA_xOPTION_ENUM(name, ha_index_option_struct, field, values, def)
#define HA_IOPTION_BOOL(name, field, def)                            \
  HA_xOPTION_BOOL(name, ha_index_option_struct, field, def)
#define HA_IOPTION_SYSVAR(name, field, sysvar)                       \
  HA_xOPTION_SYSVAR(name, ha_index_option_struct, field, sysvar)
#define HA_IOPTION_END HA_xOPTION_END

typedef struct st_ha_create_table_option {
  enum ha_option_type type;
  const char *name;
  size_t name_length;
  ptrdiff_t offset;
  ulonglong def_value;
  ulonglong min_value, max_value, block_size;
  const char *values;
  struct st_mysql_sys_var *var;
} ha_create_table_option;

class handler;
class group_by_handler;
class derived_handler;
class select_handler;
struct Query;
typedef class st_select_lex SELECT_LEX;
typedef struct st_order ORDER;

/*
  handlerton is a singleton structure - one instance per storage engine -
  to provide access to storage engine functionality that works on the
  "global" level (unlike handler class that works on a per-table basis)

  usually handlerton instance is defined statically in ha_xxx.cc as

  static handlerton { ... } xxx_hton;

  savepoint_*, prepare, recover, and *_by_xid pointers can be 0.
*/
struct handlerton
{
  /*
    Historical number used for frm file to determine the correct
    storage engine.  This is going away and new engines will just use
    "name" for this.
  */
  enum legacy_db_type db_type;
  /*
    each storage engine has it's own memory area (actually a pointer)
    in the thd, for storing per-connection information.
    It is accessed as

      thd->ha_data[xxx_hton.slot]

   slot number is initialized by MySQL after xxx_init() is called.
   */
   uint slot;
   /*
     to store per-savepoint data storage engine is provided with an area
     of a requested size (0 is ok here).
     savepoint_offset must be initialized statically to the size of
     the needed memory to store per-savepoint information.
     After xxx_init it is changed to be an offset to savepoint storage
     area and need not be used by storage engine.
     see binlog_hton and binlog_savepoint_set/rollback for an example.
   */
   uint savepoint_offset;
   /*
     handlerton methods:

     close_connection is only called if
     thd->ha_data[xxx_hton.slot] is non-zero, so even if you don't need
     this storage area - set it to something, so that MySQL would know
     this storage engine was accessed in this connection
   */
   int  (*close_connection)(handlerton *hton, THD *thd);
   /*
     Tell handler that query has been killed.
   */
   void (*kill_query)(handlerton *hton, THD *thd, enum thd_kill_levels level);
   /*
     sv points to an uninitialized storage area of requested size
     (see savepoint_offset description)
   */
   int  (*savepoint_set)(handlerton *hton, THD *thd, void *sv);
   /*
     sv points to a storage area, that was earlier passed
     to the savepoint_set call
   */
   int  (*savepoint_rollback)(handlerton *hton, THD *thd, void *sv);
   /**
     Check if storage engine allows to release metadata locks which were
     acquired after the savepoint if rollback to savepoint is done.
     @return true  - If it is safe to release MDL locks.
             false - If it is not.
   */
   bool (*savepoint_rollback_can_release_mdl)(handlerton *hton, THD *thd);
   int  (*savepoint_release)(handlerton *hton, THD *thd, void *sv);
   /*
     'all' is true if it's a real commit, that makes persistent changes
     'all' is false if it's not in fact a commit but an end of the
     statement that is part of the transaction.
     NOTE 'all' is also false in auto-commit mode where 'end of statement'
     and 'real commit' mean the same event.
   */
   int (*commit)(handlerton *hton, THD *thd, bool all);
   /*
     The commit_ordered() method is called prior to the commit() method, after
     the transaction manager has decided to commit (not rollback) the
     transaction. Unlike commit(), commit_ordered() is called only when the
     full transaction is committed, not for each commit of statement
     transaction in a multi-statement transaction.

     Not that like prepare(), commit_ordered() is only called when 2-phase
     commit takes place. Ie. when no binary log and only a single engine
     participates in a transaction, one commit() is called, no
     commit_ordered(). So engines must be prepared for this.

     The calls to commit_ordered() in multiple parallel transactions is
     guaranteed to happen in the same order in every participating
     handler. This can be used to ensure the same commit order among multiple
     handlers (eg. in table handler and binlog). So if transaction T1 calls
     into commit_ordered() of handler A before T2, then T1 will also call
     commit_ordered() of handler B before T2.

     Engines that implement this method should during this call make the
     transaction visible to other transactions, thereby making the order of
     transaction commits be defined by the order of commit_ordered() calls.

     The intention is that commit_ordered() should do the minimal amount of
     work that needs to happen in consistent commit order among handlers. To
     preserve ordering, calls need to be serialised on a global mutex, so
     doing any time-consuming or blocking operations in commit_ordered() will
     limit scalability.

     Handlers can rely on commit_ordered() calls to be serialised (no two
     calls can run in parallel, so no extra locking on the handler part is
     required to ensure this).

     Note that commit_ordered() can be called from a different thread than the
     one handling the transaction! So it can not do anything that depends on
     thread local storage, in particular it can not call my_error() and
     friends (instead it can store the error code and delay the call of
     my_error() to the commit() method).

     Similarly, since commit_ordered() returns void, any return error code
     must be saved and returned from the commit() method instead.

     The commit_ordered method is optional, and can be left unset if not
     needed in a particular handler (then there will be no ordering guarantees
     wrt. other engines and binary log).
   */
   void (*commit_ordered)(handlerton *hton, THD *thd, bool all);
   int  (*rollback)(handlerton *hton, THD *thd, bool all);
   int  (*prepare)(handlerton *hton, THD *thd, bool all);
   /*
     The prepare_ordered method is optional. If set, it will be called after
     successful prepare() in all handlers participating in 2-phase
     commit. Like commit_ordered(), it is called only when the full
     transaction is committed, not for each commit of statement transaction.

     The calls to prepare_ordered() among multiple parallel transactions are
     ordered consistently with calls to commit_ordered(). This means that
     calls to prepare_ordered() effectively define the commit order, and that
     each handler will see the same sequence of transactions calling into
     prepare_ordered() and commit_ordered().

     Thus, prepare_ordered() can be used to define commit order for handlers
     that need to do this in the prepare step (like binlog). It can also be
     used to release transaction's locks early in an order consistent with the
     order transactions will be eventually committed.

     Like commit_ordered(), prepare_ordered() calls are serialised to maintain
     ordering, so the intention is that they should execute fast, with only
     the minimal amount of work needed to define commit order. Handlers can
     rely on this serialisation, and do not need to do any extra locking to
     avoid two prepare_ordered() calls running in parallel.

     Like commit_ordered(), prepare_ordered() is not guaranteed to be called
     in the context of the thread handling the rest of the transaction. So it
     cannot invoke code that relies on thread local storage, in particular it
     cannot call my_error().

     prepare_ordered() cannot cause a rollback by returning an error, all
     possible errors must be handled in prepare() (the prepare_ordered()
     method returns void). In case of some fatal error, a record of the error
     must be made internally by the engine and returned from commit() later.

     Note that for user-level XA SQL commands, no consistent ordering among
     prepare_ordered() and commit_ordered() is guaranteed (as that would
     require blocking all other commits for an indefinite time).

     When 2-phase commit is not used (eg. only one engine (and no binlog) in
     transaction), neither prepare() nor prepare_ordered() is called.
   */
   void (*prepare_ordered)(handlerton *hton, THD *thd, bool all);
   int  (*recover)(handlerton *hton, XID *xid_list, uint len);
   int  (*commit_by_xid)(handlerton *hton, XID *xid);
   int  (*rollback_by_xid)(handlerton *hton, XID *xid);
   /*
     The commit_checkpoint_request() handlerton method is used to checkpoint
     the XA recovery process for storage engines that support two-phase
     commit.

     The method is optional - an engine that does not implemented is expected
     to work the traditional way, where every commit() durably flushes the
     transaction to disk in the engine before completion, so XA recovery will
     no longer be needed for that transaction.

     An engine that does implement commit_checkpoint_request() is also
     expected to implement commit_ordered(), so that ordering of commits is
     consistent between 2pc participants. Such engine is no longer required to
     durably flush to disk transactions in commit(), provided that the
     transaction has been successfully prepare()d and commit_ordered(); thus
     potentionally saving one fsync() call. (Engine must still durably flush
     to disk in commit() when no prepare()/commit_ordered() steps took place,
     at least if durable commits are wanted; this happens eg. if binlog is
     disabled).

     The TC will periodically (eg. once per binlog rotation) call
     commit_checkpoint_request(). When this happens, the engine must arrange
     for all transaction that have completed commit_ordered() to be durably
     flushed to disk (this does not include transactions that might be in the
     middle of executing commit_ordered()). When such flush has completed, the
     engine must call commit_checkpoint_notify_ha(), passing back the opaque
     "cookie".

     The flush and call of commit_checkpoint_notify_ha() need not happen
     immediately - it can be scheduled and performed asynchronously (ie. as
     part of next prepare(), or sync every second, or whatever), but should
     not be postponed indefinitely. It is however also permissible to do it
     immediately, before returning from commit_checkpoint_request().

     When commit_checkpoint_notify_ha() is called, the TC will know that the
     transactions are durably committed, and thus no longer require XA
     recovery. It uses that to reduce the work needed for any subsequent XA
     recovery process.
   */
   void (*commit_checkpoint_request)(void *cookie);
  /*
    "Disable or enable checkpointing internal to the storage engine. This is
    used for FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT to ensure that
    the engine will never start any recovery from a time between
    FLUSH TABLES ... ; UNLOCK TABLES.

    While checkpointing is disabled, the engine should pause any background
    write activity (such as tablespace checkpointing) that require consistency
    between different files (such as transaction log and tablespace files) for
    crash recovery to succeed. The idea is to use this to make safe
    multi-volume LVM snapshot backups.
  */
   int  (*checkpoint_state)(handlerton *hton, bool disabled);
   void *(*create_cursor_read_view)(handlerton *hton, THD *thd);
   void (*set_cursor_read_view)(handlerton *hton, THD *thd, void *read_view);
   void (*close_cursor_read_view)(handlerton *hton, THD *thd, void *read_view);
   handler *(*create)(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root);
   void (*drop_database)(handlerton *hton, char* path);
   /*
     return 0 if dropped successfully,
           -1 if nothing was done by design (as in e.g. blackhole)
           an error code (e.g. HA_ERR_NO_SUCH_TABLE) otherwise
   */
   int (*drop_table)(handlerton *hton, const char* path);
   int (*panic)(handlerton *hton, enum ha_panic_function flag);
   int (*start_consistent_snapshot)(handlerton *hton, THD *thd);
   bool (*flush_logs)(handlerton *hton);
   bool (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);
   uint (*partition_flags)();
   alter_table_operations (*alter_table_flags)(alter_table_operations flags);
   int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
   int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables, 
                        class Item *cond, 
                        enum enum_schema_tables);
   uint32 flags;                                /* global handler flags */
   /*
      Those handlerton functions below are properly initialized at handler
      init.
   */
   int (*binlog_func)(handlerton *hton, THD *thd, enum_binlog_func fn, void *arg);
   void (*binlog_log_query)(handlerton *hton, THD *thd, 
                            enum_binlog_command binlog_command,
                            const char *query, uint query_length,
                            const char *db, const char *table_name);

   void (*abort_transaction)(handlerton *hton, THD *bf_thd, THD *victim_thd,
                             my_bool signal) __attribute__((nonnull));
   int (*set_checkpoint)(handlerton *hton, const XID *xid);
   int (*get_checkpoint)(handlerton *hton, XID* xid);
  /**
     Check if the version of the table matches the version in the .frm
     file.

     This is mainly used to verify in recovery to check if an inplace
     ALTER TABLE succeded.
     Storage engines that does not support inplace alter table does not
     have to implement this function.

     @param hton      handlerton
     @param path      Path for table
     @param version   The unique id that is stored in the .frm file for
                      CREATE and updated for each ALTER TABLE (but not for
                      simple renames).
                      This is the ID used for the final table.
     @param create_id The value returned from handler->table_version() for
                      the original table (before ALTER TABLE).

     @retval 0     If id matches or table is newer than create_id (depending
                   on what version check the engine supports. This means that
                   The (inplace) alter table did succeed.
     @retval # > 0 Alter table did not succeed.

     Related to handler::discover_check_version().
   */
  int (*check_version)(handlerton *hton, const char *path,
                       const LEX_CUSTRING *version, ulonglong create_id);

  /* Called for all storage handlers after ddl recovery is done */
  int (*signal_ddl_recovery_done)(handlerton *hton);

   /*
     Optional clauses in the CREATE/ALTER TABLE
   */
   ha_create_table_option *table_options; // table level options
   ha_create_table_option *field_options; // these are specified per field
   ha_create_table_option *index_options; // these are specified per index

   /**
     The list of extensions of files created for a single table in the
     database directory (datadir/db_name/).

     Used by open_table_error(), by the default rename_table and delete_table
     handler methods, and by the default discovery implementation.
  
     For engines that have more than one file name extensions (separate
     metadata, index, and/or data files), the order of elements is relevant.
     First element of engine file name extensions array should be metadata
     file extention. This is implied by the open_table_error()
     and the default discovery implementation.
     
     Second element - data file extension. This is implied
     assumed by REPAIR TABLE ... USE_FRM implementation.
   */
   const char **tablefile_extensions; // by default - empty list

  /**********************************************************************
   Functions to intercept queries
  **********************************************************************/

  /*
    Create and return a group_by_handler, if the storage engine can execute
    the summary / group by query.
    If the storage engine can't do that, return NULL.

    The server guaranteeds that all tables in the list belong to this
    storage engine.
  */
  group_by_handler *(*create_group_by)(THD *thd, Query *query);

  /*
    Create and return a derived_handler if the storage engine can execute
    the derived table 'derived', otherwise return NULL.
    In a general case 'derived' may contain tables not from the engine.
    If the engine cannot handle or does not want to handle such pushed derived
    the function create_group_by has to return NULL.
  */
  derived_handler *(*create_derived)(THD *thd, TABLE_LIST *derived);

  /*
    Create and return a select_handler if the storage engine can execute
    the select statement 'select, otherwise return NULL
  */
  select_handler *(*create_select) (THD *thd, SELECT_LEX *select);
   
   /*********************************************************************
     Table discovery API.
     It allows the server to "discover" tables that exist in the storage
     engine, without user issuing an explicit CREATE TABLE statement.
   **********************************************************************/

   /*
     This method is required for any engine that supports automatic table
     discovery, there is no default implementation.

     Given a TABLE_SHARE discover_table() fills it in with a correct table
     structure using one of the TABLE_SHARE::init_from_* methods.

     Returns HA_ERR_NO_SUCH_TABLE if the table did not exist in the engine,
     zero if the table was discovered successfully, or any other
     HA_ERR_* error code as appropriate if the table existed, but the
     discovery failed.
   */
   int (*discover_table)(handlerton *hton, THD* thd, TABLE_SHARE *share);

   /*
     The discover_table_names method tells the server
     about all tables in the specified database that the engine
     knows about. Tables (or file names of tables) are added to
     the provided discovered_list collector object using
     add_table() or add_file() methods.
   */
   class discovered_list
   {
     public:
     virtual bool add_table(const char *tname, size_t tlen) = 0;
     virtual bool add_file(const char *fname) = 0;
     protected: virtual ~discovered_list() = default;
   };

   /*
     By default (if not implemented by the engine, but the discover_table() is
     implemented) it will perform a file-based discovery:

     - if tablefile_extensions[0] is not null, this will discovers all tables
       with the tablefile_extensions[0] extension.

     Returns 0 on success and 1 on error.
   */
   int (*discover_table_names)(handlerton *hton, LEX_CSTRING *db, MY_DIR *dir,
                               discovered_list *result);

   /*
     This is a method that allows to server to check if a table exists without
     an overhead of the complete discovery.

     By default (if not implemented by the engine, but the discovery_table() is
     implemented) it will try to perform a file-based discovery:

     - if tablefile_extensions[0] is not null this will look for a file name
       with the tablefile_extensions[0] extension.

     - if tablefile_extensions[0] is null, this will resort to discover_table().

     Note that resorting to discover_table() is slow and the engine
     should probably implement its own discover_table_existence() method,
     if its tablefile_extensions[0] is null.

     Returns 1 if the table exists and 0 if it does not.
   */
   int (*discover_table_existence)(handlerton *hton, const char *db,
                                   const char *table_name);

   /*
     This is the assisted table discovery method. Unlike the fully
     automatic discovery as above, here a user is expected to issue an
     explicit CREATE TABLE with the appropriate table attributes to
     "assist" the discovery of a table. But this "discovering" CREATE TABLE
     statement will not specify the table structure - the engine discovers
     it using this method. For example, FederatedX uses it in

      CREATE TABLE t1 ENGINE=FEDERATED CONNECTION="mysql://foo/bar/t1";

     Given a TABLE_SHARE discover_table_structure() fills it in with a correct
     table structure using one of the TABLE_SHARE::init_from_* methods.

     Assisted discovery works independently from the automatic discover.
     An engine is allowed to support only assisted discovery and not
     support automatic one. Or vice versa.
   */
   int (*discover_table_structure)(handlerton *hton, THD* thd,
                                   TABLE_SHARE *share, HA_CREATE_INFO *info);

  /*
    Notify the storage engine that the definition of the table (and the .frm
    file) has changed. Returns 0 if ok.
  */
  int (*notify_tabledef_changed)(handlerton *hton, LEX_CSTRING *db,
                                 LEX_CSTRING *table_name, LEX_CUSTRING *frm,
                                 LEX_CUSTRING *org_tabledef_version,
                                 handler *file);

   /*
     System Versioning
   */
   /** Determine if system-versioned data was modified by the transaction.
   @param[in,out] thd          current session
   @param[out]    trx_id       transaction start ID
   @return transaction commit ID
   @retval 0 if no system-versioned data was affected by the transaction */
   ulonglong (*prepare_commit_versioned)(THD *thd, ulonglong *trx_id);

  /** Disable or enable the internal writes of a storage engine */
  void (*disable_internal_writes)(bool disable);

  /* backup */
  void (*prepare_for_backup)(void);
  void (*end_backup)(void);

  /* Server shutdown early notification.*/
  void (*pre_shutdown)(void);

  /*
    Inform handler that partitioning engine has changed the .frm and the .par
    files
  */
  int (*create_partitioning_metadata)(const char *path,
                                      const char *old_path,
                                      chf_create_flags action_flag);
};


extern const char *hton_no_exts[];

static inline LEX_CSTRING *hton_name(const handlerton *hton)
{
  return &(hton2plugin[hton->slot]->name);
}

static inline handlerton *plugin_hton(plugin_ref plugin)
{
  return plugin_data(plugin, handlerton *);
}

static inline sys_var *find_hton_sysvar(handlerton *hton, st_mysql_sys_var *var)
{
  return find_plugin_sysvar(hton2plugin[hton->slot], var);
}

handlerton *ha_default_handlerton(THD *thd);
handlerton *ha_default_tmp_handlerton(THD *thd);

/* Possible flags of a handlerton (there can be 32 of them) */
#define HTON_NO_FLAGS                 0
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
#define HTON_ALTER_NOT_SUPPORTED     (1 << 1) //Engine does not support alter
#define HTON_CAN_RECREATE            (1 << 2) //Delete all is used for truncate
#define HTON_HIDDEN                  (1 << 3) //Engine does not appear in lists
#define HTON_NOT_USER_SELECTABLE     (1 << 5)
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
#define HTON_SUPPORT_LOG_TABLES      (1 << 7) //Engine supports log tables
#define HTON_NO_PARTITION            (1 << 8) //Not partition of these tables

/*
  This flag should be set when deciding that the engine does not allow
  row based binary logging (RBL) optimizations.

  Currently, setting this flag, means that table's read/write_set will
  be left untouched when logging changes to tables in this engine. In
  practice this means that the server will not mess around with
  table->write_set and/or table->read_set when using RBL and deciding
  whether to log full or minimal rows.

  It's valuable for instance for virtual tables, eg: Performance
  Schema which have no meaning for replication.
*/
#define HTON_NO_BINLOG_ROW_OPT       (1 << 9)
#define HTON_SUPPORTS_EXTENDED_KEYS  (1 <<10) //supports extended keys
#define HTON_NATIVE_SYS_VERSIONING (1 << 11) //Engine supports System Versioning

// MySQL compatibility. Unused.
#define HTON_SUPPORTS_FOREIGN_KEYS   (1 << 0) //Foreign key constraint supported.

#define HTON_CAN_MERGE               (1 <<11) //Merge type table
// Engine needs to access the main connect string in partitions
#define HTON_CAN_READ_CONNECT_STRING_IN_PARTITION (1 <<12)

/* can be replicated by wsrep replication provider plugin */
#define HTON_WSREP_REPLICATION (1 << 13)

/*
  Set this on the *slave* that's connected to a shared with a master storage.
  The slave will ignore any CREATE TABLE, DROP or updates for this engine.
*/
#define HTON_IGNORE_UPDATES (1 << 14)

/*
  Set this on the *master* that's connected to a shared with a slave storage.
  The table may not exists on the slave. The effects of having this flag are:
  - ALTER TABLE that changes engine from this table to another engine will
    be replicated as CREATE + INSERT
  - CREATE ... LIKE shared_table will be replicated as a full CREATE TABLE
  - ALTER TABLE for this engine will have "IF EXISTS" added.
  - RENAME TABLE for this engine will have "IF EXISTS" added.
  - DROP TABLE for this engine will have "IF EXISTS" added.
*/
#define HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE (1 << 15)

/*
  True if handler cannot rollback transactions. If not true, the transaction
  will be put in the transactional binlog cache.
  For some engines, like Aria, the rollback can happen in case of crash, but
  not trough a handler rollback call.
*/
#define HTON_NO_ROLLBACK (1 << 16)

/*
  This storage engine can support both transactional and non transactional
  tables
*/
#define HTON_TRANSACTIONAL_AND_NON_TRANSACTIONAL (1 << 17)

/*
  Table requires and close and reopen after truncate
  If the handler has HTON_CAN_RECREATE, this flag is not used
*/
#define HTON_REQUIRES_CLOSE_AFTER_TRUNCATE (1 << 18)

/* Truncate requires that all other handlers are closed */
#define HTON_TRUNCATE_REQUIRES_EXCLUSIVE_USE (1 << 19)
/*
  Used by mysql_inplace_alter_table() to decide if we should call
  hton->notify_tabledef_changed() before commit (MyRocks) or after (InnoDB).
*/
#define HTON_REQUIRES_NOTIFY_TABLEDEF_CHANGED_AFTER_COMMIT (1 << 20)

class Ha_trx_info;

struct THD_TRANS
{
  /* true is not all entries in the ht[] support 2pc */
  bool        no_2pc;
  /* storage engines that registered in this transaction */
  Ha_trx_info *ha_list;
  /* 
    The purpose of this flag is to keep track of non-transactional
    tables that were modified in scope of:
    - transaction, when the variable is a member of
    THD::transaction.all
    - top-level statement or sub-statement, when the variable is a
    member of THD::transaction.stmt
    This member has the following life cycle:
    * stmt.modified_non_trans_table is used to keep track of
    modified non-transactional tables of top-level statements. At
    the end of the previous statement and at the beginning of the session,
    it is reset to FALSE.  If such functions
    as mysql_insert, mysql_update, mysql_delete etc modify a
    non-transactional table, they set this flag to TRUE.  At the
    end of the statement, the value of stmt.modified_non_trans_table 
    is merged with all.modified_non_trans_table and gets reset.
    * all.modified_non_trans_table is reset at the end of transaction
    
    * Since we do not have a dedicated context for execution of a
    sub-statement, to keep track of non-transactional changes in a
    sub-statement, we re-use stmt.modified_non_trans_table. 
    At entrance into a sub-statement, a copy of the value of
    stmt.modified_non_trans_table (containing the changes of the
    outer statement) is saved on stack. Then 
    stmt.modified_non_trans_table is reset to FALSE and the
    substatement is executed. Then the new value is merged with the
    saved value.
  */
  bool modified_non_trans_table;

  void reset() {
    no_2pc= FALSE;
    modified_non_trans_table= FALSE;
    m_unsafe_rollback_flags= 0;
  }
  bool is_empty() const { return ha_list == NULL; }
  THD_TRANS() = default;                        /* Remove gcc warning */

  unsigned int m_unsafe_rollback_flags;
 /*
    Define the type of statements which cannot be rolled back safely.
    Each type occupies one bit in m_unsafe_rollback_flags.
    MODIFIED_NON_TRANS_TABLE is limited to mark only the temporary
    non-transactional table *when* it's cached along with the transactional
    events; the regular table is covered by the "namesake" bool var.
  */
  enum unsafe_statement_types
  {
    MODIFIED_NON_TRANS_TABLE= 1,
    CREATED_TEMP_TABLE= 2,
    DROPPED_TEMP_TABLE= 4,
    DID_WAIT= 8,
    DID_DDL= 0x10,
    EXECUTED_TABLE_ADMIN_CMD= 0x20
  };

  void mark_modified_non_trans_temp_table()
  {
    m_unsafe_rollback_flags|= MODIFIED_NON_TRANS_TABLE;
  }
  bool has_modified_non_trans_temp_table() const
  {
    return (m_unsafe_rollback_flags & MODIFIED_NON_TRANS_TABLE) != 0;
  }
  void mark_executed_table_admin_cmd()
  {
    DBUG_PRINT("debug", ("mark_executed_table_admin_cmd"));
    m_unsafe_rollback_flags|= EXECUTED_TABLE_ADMIN_CMD;
  }
  bool trans_executed_admin_cmd()
  {
    return (m_unsafe_rollback_flags & EXECUTED_TABLE_ADMIN_CMD) != 0;
  }
  void mark_created_temp_table()
  {
    DBUG_PRINT("debug", ("mark_created_temp_table"));
    m_unsafe_rollback_flags|= CREATED_TEMP_TABLE;
  }
  void mark_dropped_temp_table()
  {
    DBUG_PRINT("debug", ("mark_dropped_temp_table"));
    m_unsafe_rollback_flags|= DROPPED_TEMP_TABLE;
  }
  bool has_created_dropped_temp_table() const {
    return
      (m_unsafe_rollback_flags & (CREATED_TEMP_TABLE|DROPPED_TEMP_TABLE)) != 0;
  }
  void mark_trans_did_wait() { m_unsafe_rollback_flags|= DID_WAIT; }
  bool trans_did_wait() const {
    return (m_unsafe_rollback_flags & DID_WAIT) != 0;
  }
  bool is_trx_read_write() const;
  void mark_trans_did_ddl() { m_unsafe_rollback_flags|= DID_DDL; }
  bool trans_did_ddl() const {
    return (m_unsafe_rollback_flags & DID_DDL) != 0;
  }

};


/**
  Either statement transaction or normal transaction - related
  thread-specific storage engine data.

  If a storage engine participates in a statement/transaction,
  an instance of this class is present in
  thd->transaction.{stmt|all}.ha_list. The addition to
  {stmt|all}.ha_list is made by trans_register_ha().

  When it's time to commit or rollback, each element of ha_list
  is used to access storage engine's prepare()/commit()/rollback()
  methods, and also to evaluate if a full two phase commit is
  necessary.

  @sa General description of transaction handling in handler.cc.
*/

class Ha_trx_info
{
public:
  /** Register this storage engine in the given transaction context. */
  void register_ha(THD_TRANS *trans, handlerton *ht_arg)
  {
    DBUG_ASSERT(m_flags == 0);
    DBUG_ASSERT(m_ht == NULL);
    DBUG_ASSERT(m_next == NULL);

    m_ht= ht_arg;
    m_flags= (int) TRX_READ_ONLY; /* Assume read-only at start. */

    m_next= trans->ha_list;
    trans->ha_list= this;
  }

  /** Clear, prepare for reuse. */
  void reset()
  {
    m_next= NULL;
    m_ht= NULL;
    m_flags= 0;
  }

  Ha_trx_info() { reset(); }

  void set_trx_read_write()
  {
    DBUG_ASSERT(is_started());
    m_flags|= (int) TRX_READ_WRITE;
  }
  bool is_trx_read_write() const
  {
    DBUG_ASSERT(is_started());
    return m_flags & (int) TRX_READ_WRITE;
  }
  bool is_started() const { return m_ht != NULL; }
  /** Mark this transaction read-write if the argument is read-write. */
  void coalesce_trx_with(const Ha_trx_info *stmt_trx)
  {
    /*
      Must be called only after the transaction has been started.
      Can be called many times, e.g. when we have many
      read-write statements in a transaction.
    */
    DBUG_ASSERT(is_started());
    if (stmt_trx->is_trx_read_write())
      set_trx_read_write();
  }
  Ha_trx_info *next() const
  {
    DBUG_ASSERT(is_started());
    return m_next;
  }
  handlerton *ht() const
  {
    DBUG_ASSERT(is_started());
    return m_ht;
  }
private:
  enum { TRX_READ_ONLY= 0, TRX_READ_WRITE= 1 };
  /** Auxiliary, used for ha_list management */
  Ha_trx_info *m_next;
  /**
    Although a given Ha_trx_info instance is currently always used
    for the same storage engine, 'ht' is not-NULL only when the
    corresponding storage is a part of a transaction.
  */
  handlerton *m_ht;
  /**
    Transaction flags related to this engine.
    Not-null only if this instance is a part of transaction.
    May assume a combination of enum values above.
  */
  uchar       m_flags;
};


inline bool THD_TRANS::is_trx_read_write() const
{
  Ha_trx_info *ha_info;
  for (ha_info= ha_list; ha_info; ha_info= ha_info->next())
    if (ha_info->is_trx_read_write())
      return TRUE;
  return FALSE;
}


enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
			 ISO_REPEATABLE_READ, ISO_SERIALIZABLE};


typedef struct {
  ulonglong data_file_length;
  ulonglong max_data_file_length;
  ulonglong index_file_length;
  ulonglong max_index_file_length;
  ulonglong delete_length;
  ha_rows records;
  ulong mean_rec_length;
  time_t create_time;
  time_t check_time;
  time_t update_time;
  ulonglong check_sum;
  bool check_sum_null;
} PARTITION_STATS;

#define UNDEF_NODEGROUP 65535
class Item;
struct st_table_log_memory_entry;

class partition_info;

struct st_partition_iter;

enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES, HA_CHOICE_MAX };

enum enum_stats_auto_recalc { HA_STATS_AUTO_RECALC_DEFAULT= 0,
                              HA_STATS_AUTO_RECALC_ON,
                              HA_STATS_AUTO_RECALC_OFF };

/**
  A helper struct for schema DDL statements:
    CREATE SCHEMA [IF NOT EXISTS] name [ schema_specification... ]
    ALTER SCHEMA name [ schema_specification... ]

  It stores the "schema_specification" part of the CREATE/ALTER statements and
  is passed to mysql_create_db() and  mysql_alter_db().
  Currently consists of the schema default character set, collation
  and schema_comment.
*/
struct Schema_specification_st
{
  CHARSET_INFO *default_table_charset;
  LEX_CSTRING *schema_comment;
  void init()
  {
    bzero(this, sizeof(*this));
  }
};

class Create_field;

struct Table_period_info: Sql_alloc
{
  Table_period_info() :
    create_if_not_exists(false),
    constr(NULL),
    unique_keys(0) {}
  Table_period_info(const char *name_arg, size_t size) :
    name(name_arg, size),
    create_if_not_exists(false),
    constr(NULL),
    unique_keys(0){}

  Lex_ident name;

  struct start_end_t
  {
    start_end_t() = default;
    start_end_t(const LEX_CSTRING& _start, const LEX_CSTRING& _end) :
      start(_start),
      end(_end) {}
    Lex_ident start;
    Lex_ident end;
  };
  start_end_t period;
  bool create_if_not_exists;
  Virtual_column_info *constr;
  uint unique_keys;

  bool is_set() const
  {
    DBUG_ASSERT(bool(period.start) == bool(period.end));
    return period.start;
  }

  void set_period(const Lex_ident& start, const Lex_ident& end)
  {
    period.start= start;
    period.end= end;
  }
  bool check_field(const Create_field* f, const Lex_ident& f_name) const;
};

struct Vers_parse_info: public Table_period_info
{
  Vers_parse_info() :
    Table_period_info(STRING_WITH_LEN("SYSTEM_TIME")),
    versioned_fields(false),
    unversioned_fields(false),
    can_native(-1)
  {}

  Table_period_info::start_end_t as_row;

protected:
  friend struct Table_scope_and_contents_source_st;
  void set_start(const LEX_CSTRING field_name)
  {
    as_row.start= field_name;
    period.start= field_name;
  }
  void set_end(const LEX_CSTRING field_name)
  {
    as_row.end= field_name;
    period.end= field_name;
  }
  bool is_start(const char *name) const;
  bool is_end(const char *name) const;
  bool is_start(const Create_field &f) const;
  bool is_end(const Create_field &f) const;
  bool fix_implicit(THD *thd, Alter_info *alter_info);
  operator bool() const
  {
    return as_row.start || as_row.end || period.start || period.end;
  }
  bool need_check(const Alter_info *alter_info) const;
  bool check_conditions(const Lex_table_name &table_name,
                        const Lex_table_name &db) const;
  bool create_sys_field(THD *thd, const char *field_name,
                        Alter_info *alter_info, int flags);

public:
  static const Lex_ident default_start;
  static const Lex_ident default_end;

  bool fix_alter_info(THD *thd, Alter_info *alter_info,
                       HA_CREATE_INFO *create_info, TABLE *table);
  bool fix_create_like(Alter_info &alter_info, HA_CREATE_INFO &create_info,
                       TABLE_LIST &src_table, TABLE_LIST &table);
  bool check_sys_fields(const Lex_table_name &table_name,
                        const Lex_table_name &db, Alter_info *alter_info) const;

  /**
     At least one field was specified 'WITH/WITHOUT SYSTEM VERSIONING'.
     Useful for error handling.
  */
  bool versioned_fields : 1;
  bool unversioned_fields : 1;
  int can_native;
};

/**
  A helper struct for table DDL statements, e.g.:
  CREATE [OR REPLACE] [TEMPORARY]
    TABLE [IF NOT EXISTS] tbl_name table_contents_source;

  Represents a combinations of:
  1. The scope, i.e. TEMPORARY or not TEMPORARY
  2. The "table_contents_source" part of the table DDL statements,
     which can be initialized from either of these:
     - table_element_list ...      // Explicit definition (column and key list)
     - LIKE another_table_name ... // Copy structure from another table
     - [AS] SELECT ...             // Copy structure from a subquery
*/

struct Table_scope_and_contents_source_pod_st // For trivial members
{
  CHARSET_INFO *alter_table_convert_to_charset;
  LEX_CUSTRING tabledef_version;
  LEX_CUSTRING org_tabledef_version;            /* version of dropped table */
  LEX_CSTRING connect_string;
  LEX_CSTRING comment;
  LEX_CSTRING alias;
  LEX_CSTRING org_storage_engine_name, new_storage_engine_name;
  const char *password, *tablespace;
  const char *data_file_name, *index_file_name;
  ulonglong max_rows,min_rows;
  ulonglong auto_increment_value;
  ulong table_options;                  ///< HA_OPTION_ values
  ulong avg_row_length;
  ulong used_fields;
  ulong key_block_size;
  ulong expression_length;
  ulong field_check_constraints;
  /*
    number of pages to sample during
    stats estimation, if used, otherwise 0.
  */
  uint stats_sample_pages;
  uint null_bits;                       /* NULL bits at start of record */
  uint options;				/* OR of HA_CREATE_ options */
  uint merge_insert_method;
  uint extra_size;                      /* length of extra data segment */
  handlerton *db_type;
  /**
    Row type of the table definition.

    Defaults to ROW_TYPE_DEFAULT for all non-ALTER statements.
    For ALTER TABLE defaults to ROW_TYPE_NOT_USED (means "keep the current").

    Can be changed either explicitly by the parser.
    If nothing specified inherits the value of the original table (if present).
  */
  enum row_type row_type;
  enum ha_choice transactional;
  enum ha_storage_media storage_media;  ///< DEFAULT, DISK or MEMORY
  enum ha_choice page_checksum;         ///< If we have page_checksums
  engine_option_value *option_list;     ///< list of table create options
  enum_stats_auto_recalc stats_auto_recalc;
  bool varchar;                         ///< 1 if table has a VARCHAR
  bool sequence;                        // If SEQUENCE=1 was used

  List<Virtual_column_info> *check_constraint_list;

  /* the following three are only for ALTER TABLE, check_if_incompatible_data() */
  ha_table_option_struct *option_struct;           ///< structure with parsed table options
  ha_field_option_struct **fields_option_struct;   ///< array of field option structures
  ha_index_option_struct **indexes_option_struct;  ///< array of index option structures

  /* The following is used to remember the old state for CREATE OR REPLACE */
  TABLE *table;
  TABLE_LIST *pos_in_locked_tables;
  TABLE_LIST *merge_list;
  MDL_ticket *mdl_ticket;
  bool table_was_deleted;
  sequence_definition *seq_create_info;

  void init()
  {
    bzero(this, sizeof(*this));
  }
  bool tmp_table() const { return options & HA_LEX_CREATE_TMP_TABLE; }
  void use_default_db_type(THD *thd)
  {
    db_type= tmp_table() ? ha_default_tmp_handlerton(thd)
                         : ha_default_handlerton(thd);
  }

  bool versioned() const
  {
    return options & HA_VERSIONED_TABLE;
  }
};


struct Table_scope_and_contents_source_st:
         public Table_scope_and_contents_source_pod_st
{
  Vers_parse_info vers_info;
  Table_period_info period_info;

  void init()
  {
    Table_scope_and_contents_source_pod_st::init();
    vers_info= {};
    period_info= {};
  }

  bool fix_create_fields(THD *thd, Alter_info *alter_info,
                         const TABLE_LIST &create_table);
  bool fix_period_fields(THD *thd, Alter_info *alter_info);
  bool check_fields(THD *thd, Alter_info *alter_info,
                    const Lex_table_name &table_name,
                    const Lex_table_name &db,
                    int select_count= 0);
  bool check_period_fields(THD *thd, Alter_info *alter_info);

  void vers_check_native();
  bool vers_fix_system_fields(THD *thd, Alter_info *alter_info,
                              const TABLE_LIST &create_table);

  bool vers_check_system_fields(THD *thd, Alter_info *alter_info,
                                const Lex_table_name &table_name,
                                const Lex_table_name &db,
                                int select_count= 0);
};


/**
  This struct is passed to handler table routines, e.g. ha_create().
  It does not include the "OR REPLACE" and "IF NOT EXISTS" parts, as these
  parts are handled on the SQL level and are not needed on the handler level.
*/
struct HA_CREATE_INFO: public Table_scope_and_contents_source_st,
                       public Schema_specification_st
{
  /* TODO: remove after MDEV-20865 */
  Alter_info *alter_info;

  void init()
  {
    Table_scope_and_contents_source_st::init();
    Schema_specification_st::init();
    alter_info= NULL;
  }
  bool check_conflicting_charset_declarations(CHARSET_INFO *cs);
  bool add_table_option_default_charset(CHARSET_INFO *cs)
  {
    // cs can be NULL, e.g.:  CREATE TABLE t1 (..) CHARACTER SET DEFAULT;
    if (check_conflicting_charset_declarations(cs))
      return true;
    default_table_charset= cs;
    used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
    return false;
  }
  bool add_alter_list_item_convert_to_charset(CHARSET_INFO *cs)
  {
    /* 
      cs cannot be NULL, as sql_yacc.yy translates
         CONVERT TO CHARACTER SET DEFAULT
      to
         CONVERT TO CHARACTER SET <character-set-of-the-current-database>
      TODO: Shouldn't we postpone resolution of DEFAULT until the
      character set of the table owner database is loaded from its db.opt?
    */
    DBUG_ASSERT(cs);
    if (check_conflicting_charset_declarations(cs))
      return true;
    alter_table_convert_to_charset= default_table_charset= cs;
    used_fields|= (HA_CREATE_USED_CHARSET | HA_CREATE_USED_DEFAULT_CHARSET);  
    return false;
  }
  ulong table_options_with_row_type()
  {
    if (row_type == ROW_TYPE_DYNAMIC || row_type == ROW_TYPE_PAGE)
      return table_options | HA_OPTION_PACK_RECORD;
    else
      return table_options;
  }
};


/**
  This struct is passed to mysql_create_table() and similar creation functions,
  as well as to show_create_table().
*/
struct Table_specification_st: public HA_CREATE_INFO,
                               public DDL_options_st
{
  // Deep initialization
  void init()
  {
    HA_CREATE_INFO::init();
    DDL_options_st::init();
  }
  void init(DDL_options_st::Options options_arg)
  {
    HA_CREATE_INFO::init();
    DDL_options_st::init(options_arg);
  }
  /*
    Quick initialization, for parser.
    Most of the HA_CREATE_INFO is left uninitialized.
    It gets fully initialized in sql_yacc.yy, only when the parser
    scans a related keyword (e.g. CREATE, ALTER).
  */
  void lex_start()
  {
    HA_CREATE_INFO::options= 0;
    DDL_options_st::init();
  }
};


/**
  Structure describing changes to an index to be caused by ALTER TABLE.
*/

struct KEY_PAIR
{
  /**
    Pointer to KEY object describing old version of index in
    TABLE::key_info array for TABLE instance representing old
    version of table.
  */
  KEY *old_key;
  /**
    Pointer to KEY object describing new version of index in
    Alter_inplace_info::key_info_buffer array.
  */
  KEY *new_key;
};


/**
  In-place alter handler context.

  This is a superclass intended to be subclassed by individual handlers
  in order to store handler unique context between in-place alter API calls.

  The handler is responsible for creating the object. This can be done
  as early as during check_if_supported_inplace_alter().

  The SQL layer is responsible for destroying the object.
  The class extends Sql_alloc so the memory will be mem root allocated.

  @see Alter_inplace_info
*/

class inplace_alter_handler_ctx : public Sql_alloc
{
public:
  inplace_alter_handler_ctx() = default;

  virtual ~inplace_alter_handler_ctx() = default;
  virtual void set_shared_data(const inplace_alter_handler_ctx& ctx) {}
};


/**
  Class describing changes to be done by ALTER TABLE.
  Instance of this class is passed to storage engine in order
  to determine if this ALTER TABLE can be done using in-place
  algorithm. It is also used for executing the ALTER TABLE
  using in-place algorithm.
*/

class Alter_inplace_info
{
public:

  /**
    Create options (like MAX_ROWS) for the new version of table.

    @note The referenced instance of HA_CREATE_INFO object was already
          used to create new .FRM file for table being altered. So it
          has been processed by mysql_prepare_create_table() already.
          For example, this means that it has HA_OPTION_PACK_RECORD
          flag in HA_CREATE_INFO::table_options member correctly set.
  */
  HA_CREATE_INFO *create_info;

  /**
    Alter options, fields and keys for the new version of table.

    @note The referenced instance of Alter_info object was already
          used to create new .FRM file for table being altered. So it
          has been processed by mysql_prepare_create_table() already.
          In particular, this means that in Create_field objects for
          fields which were present in some form in the old version
          of table, Create_field::field member points to corresponding
          Field instance for old version of table.
  */
  Alter_info *alter_info;

  /**
    Array of KEYs for new version of table - including KEYs to be added.

    @note Currently this array is produced as result of
          mysql_prepare_create_table() call.
          This means that it follows different convention for
          KEY_PART_INFO::fieldnr values than objects in TABLE::key_info
          array.

    @todo This is mainly due to the fact that we need to keep compatibility
          with removed handler::add_index() call. We plan to switch to
          TABLE::key_info numbering later.

    KEYs are sorted - see sort_keys().
  */
  KEY  *key_info_buffer;

  /** Size of key_info_buffer array. */
  uint key_count;

  /** Size of index_drop_buffer array. */
  uint index_drop_count= 0;

  /**
     Array of pointers to KEYs to be dropped belonging to the TABLE instance
     for the old version of the table.
  */
  KEY  **index_drop_buffer= nullptr;

  /** Size of index_add_buffer array. */
  uint index_add_count= 0;

  /**
     Array of indexes into key_info_buffer for KEYs to be added,
     sorted in increasing order.
  */
  uint *index_add_buffer= nullptr;

  KEY_PAIR  *index_altered_ignorability_buffer= nullptr;

  /** Size of index_altered_ignorability_buffer array. */
  uint index_altered_ignorability_count= 0;

  /**
     Old and new index names. Used for index rename.
  */
  struct Rename_key_pair
  {
    Rename_key_pair(const KEY *old_key, const KEY *new_key)
        : old_key(old_key), new_key(new_key)
    {
    }
    const KEY *old_key;
    const KEY *new_key;
  };
  /**
     Vector of key pairs from DROP/ADD index which can be renamed.
  */
  typedef Mem_root_array<Rename_key_pair, true> Rename_keys_vector;

  /**
     A list of indexes which should be renamed.
     Index definitions stays the same.
  */
  Rename_keys_vector rename_keys;

  /**
     Context information to allow handlers to keep context between in-place
     alter API calls.

     @see inplace_alter_handler_ctx for information about object lifecycle.
  */
  inplace_alter_handler_ctx *handler_ctx= nullptr;

  /**
    If the table uses several handlers, like ha_partition uses one handler
    per partition, this contains a Null terminated array of ctx pointers
    that should all be committed together.
    Or NULL if only handler_ctx should be committed.
    Set to NULL if the low level handler::commit_inplace_alter_table uses it,
    to signal to the main handler that everything was committed as atomically.

    @see inplace_alter_handler_ctx for information about object lifecycle.
  */
  inplace_alter_handler_ctx **group_commit_ctx= nullptr;

  /**
     Flags describing in detail which operations the storage engine is to
     execute. Flags are defined in sql_alter.h
  */
  alter_table_operations handler_flags= 0;

  /* Alter operations involving parititons are strored here */
  ulong partition_flags;

  /**
     Partition_info taking into account the partition changes to be performed.
     Contains all partitions which are present in the old version of the table
     with partitions to be dropped or changed marked as such + all partitions
     to be added in the new version of table marked as such.
  */
  partition_info * const modified_part_info;

  /** true for ALTER IGNORE TABLE ... */
  const bool ignore;

  /** true for online operation (LOCK=NONE) */
  bool online= false;

  /**
    When ha_commit_inplace_alter_table() is called the the engine can
    set this to a function to be called after the ddl log
    is committed.
  */
  typedef void (inplace_alter_table_commit_callback)(void *);
  inplace_alter_table_commit_callback *inplace_alter_table_committed= nullptr;

  /* This will be used as the argument to the above function when called */
  void *inplace_alter_table_committed_argument= nullptr;

  /** which ALGORITHM and LOCK are supported by the storage engine */
  enum_alter_inplace_result inplace_supported;

  /**
     Can be set by handler to describe why a given operation cannot be done
     in-place (HA_ALTER_INPLACE_NOT_SUPPORTED) or why it cannot be done
     online (HA_ALTER_INPLACE_NO_LOCK or HA_ALTER_INPLACE_COPY_NO_LOCK)
     If set, it will be used with ER_ALTER_OPERATION_NOT_SUPPORTED_REASON if
     results from handler::check_if_supported_inplace_alter() doesn't match
     requirements set by user. If not set, the more generic
     ER_ALTER_OPERATION_NOT_SUPPORTED will be used.

     Please set to a properly localized string, for example using
     my_get_err_msg(), so that the error message as a whole is localized.
  */
  const char *unsupported_reason= nullptr;

  /** true when InnoDB should abort the alter when table is not empty */
  const bool error_if_not_empty;

  /** True when DDL should avoid downgrading the MDL */
  bool mdl_exclusive_after_prepare= false;

  Alter_inplace_info(HA_CREATE_INFO *create_info_arg,
                     Alter_info *alter_info_arg,
                     KEY *key_info_arg, uint key_count_arg,
                     partition_info *modified_part_info_arg,
                     bool ignore_arg, bool error_non_empty);

  ~Alter_inplace_info()
  {
    delete handler_ctx;
  }

  /**
    Used after check_if_supported_inplace_alter() to report
    error if the result does not match the LOCK/ALGORITHM
    requirements set by the user.

    @param not_supported  Part of statement that was not supported.
    @param try_instead    Suggestion as to what the user should
                          replace not_supported with.
  */
  void report_unsupported_error(const char *not_supported,
                                const char *try_instead) const;
 void add_altered_index_ignorability(KEY *old_key, KEY *new_key)
 {
   KEY_PAIR *key_pair= index_altered_ignorability_buffer +
                       index_altered_ignorability_count++;
   key_pair->old_key= old_key;
   key_pair->new_key= new_key;
   DBUG_PRINT("info", ("index had ignorability altered: %i to %i",
                      old_key->is_ignored,
                      new_key->is_ignored));
 }


};


typedef struct st_key_create_information
{
  enum ha_key_alg algorithm;
  ulong block_size;
  uint flags;                                   /* HA_USE.. flags */
  LEX_CSTRING parser_name;
  LEX_CSTRING comment;
  bool is_ignored;
} KEY_CREATE_INFO;


/*
  Class for maintaining hooks used inside operations on tables such
  as: create table functions, delete table functions, and alter table
  functions.

  Class is using the Template Method pattern to separate the public
  usage interface from the private inheritance interface.  This
  imposes no overhead, since the public non-virtual function is small
  enough to be inlined.

  The hooks are usually used for functions that does several things,
  e.g., create_table_from_items(), which both create a table and lock
  it.
 */
class TABLEOP_HOOKS
{
public:
  TABLEOP_HOOKS() = default;
  virtual ~TABLEOP_HOOKS() = default;

  inline void prelock(TABLE **tables, uint count)
  {
    do_prelock(tables, count);
  }

  inline int postlock(TABLE **tables, uint count)
  {
    return do_postlock(tables, count);
  }
private:
  /* Function primitive that is called prior to locking tables */
  virtual void do_prelock(TABLE **tables, uint count)
  {
    /* Default is to do nothing */
  }

  /**
     Primitive called after tables are locked.

     If an error is returned, the tables will be unlocked and error
     handling start.

     @return Error code or zero.
   */
  virtual int do_postlock(TABLE **tables, uint count)
  {
    return 0;                           /* Default is to do nothing */
  }
};

typedef struct st_savepoint SAVEPOINT;
extern ulong savepoint_alloc_size;
extern KEY_CREATE_INFO default_key_create_info;

/* Forward declaration for condition pushdown to storage engine */
typedef class Item COND;

typedef struct st_ha_check_opt
{
  st_ha_check_opt() = default;                        /* Remove gcc warning */
  uint flags;       /* isam layer flags (e.g. for myisamchk) */
  uint sql_flags;   /* sql layer flags - for something myisamchk cannot do */
  uint handler_flags; /* Reserved for handler usage */
  time_t start_time;   /* When check/repair starts */
  KEY_CACHE *key_cache; /* new key cache when changing key cache */
  void init();
} HA_CHECK_OPT;


/********************************************************************************
 * MRR
 ********************************************************************************/

typedef void *range_seq_t;

typedef struct st_range_seq_if
{
  /*
    Get key information
 
    SYNOPSIS
      get_key_info()
        init_params  The seq_init_param parameter 
        length       OUT length of the keys in this range sequence
        map          OUT key_part_map of the keys in this range sequence

    DESCRIPTION
      This function is set only when using HA_MRR_FIXED_KEY mode. In that mode, 
      all ranges are single-point equality ranges that use the same set of key
      parts. This function allows the MRR implementation to get the length of
      a key, and which keyparts it uses.
  */
  void (*get_key_info)(void *init_params, uint *length, key_part_map *map);

  /*
    Initialize the traversal of range sequence
    
    SYNOPSIS
      init()
        init_params  The seq_init_param parameter 
        n_ranges     The number of ranges obtained 
        flags        A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY

    RETURN
      An opaque value to be used as RANGE_SEQ_IF::next() parameter
  */
  range_seq_t (*init)(void *init_params, uint n_ranges, uint flags);


  /*
    Get the next range in the range sequence

    SYNOPSIS
      next()
        seq    The value returned by RANGE_SEQ_IF::init()
        range  OUT Information about the next range
    
    RETURN
      FALSE - Ok, the range structure filled with info about the next range
      TRUE  - No more ranges
  */
  bool (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);

  /*
    Check whether range_info orders to skip the next record

    SYNOPSIS
      skip_record()
        seq         The value returned by RANGE_SEQ_IF::init()
        range_info  Information about the next range 
                    (Ignored if MRR_NO_ASSOCIATION is set)
        rowid       Rowid of the record to be checked (ignored if set to 0)
    
    RETURN
      1 - Record with this range_info and/or this rowid shall be filtered
          out from the stream of records returned by multi_range_read_next()
      0 - The record shall be left in the stream
  */ 
  bool (*skip_record) (range_seq_t seq, range_id_t range_info, uchar *rowid);

  /*
    Check if the record combination matches the index condition
    SYNOPSIS
      skip_index_tuple()
        seq         The value returned by RANGE_SEQ_IF::init()
        range_info  Information about the next range 
    
    RETURN
      0 - The record combination satisfies the index condition
      1 - Otherwise
  */ 
  bool (*skip_index_tuple) (range_seq_t seq, range_id_t range_info);
} RANGE_SEQ_IF;

typedef bool (*SKIP_INDEX_TUPLE_FUNC) (range_seq_t seq, range_id_t range_info);

class Cost_estimate
{ 
public:
  double io_count;        /* number of I/O to fetch records                */
  double avg_io_cost;     /* cost of an average I/O oper. to fetch records */
  double idx_io_count;    /* number of I/O to read keys                    */
  double idx_avg_io_cost; /* cost of an average I/O oper. to fetch records */
  double cpu_cost;        /* total cost of operations in CPU               */
  double idx_cpu_cost;    /* cost of operations in CPU for index           */
  double import_cost;     /* cost of remote operations     */
  double mem_cost;        /* cost of used memory           */

  static constexpr double IO_COEFF= 1;
  static constexpr double CPU_COEFF= 1;
  static constexpr double MEM_COEFF= 1;
  static constexpr double IMPORT_COEFF= 1;

  Cost_estimate()
  {
    reset();
  }

  double total_cost() const
  {
    return IO_COEFF*io_count*avg_io_cost +
           IO_COEFF*idx_io_count*idx_avg_io_cost +
           CPU_COEFF*(cpu_cost + idx_cpu_cost) +
           MEM_COEFF*mem_cost + IMPORT_COEFF*import_cost;
  }

  double index_only_cost()
  {
    return IO_COEFF*idx_io_count*idx_avg_io_cost +
           CPU_COEFF*idx_cpu_cost;
  }

  /**
    Whether or not all costs in the object are zero

    @return true if all costs are zero, false otherwise
  */
  bool is_zero() const
  {
    return io_count == 0.0 && idx_io_count == 0.0 && cpu_cost == 0.0 &&
      import_cost == 0.0 && mem_cost == 0.0;
  }

  void reset()
  {
    avg_io_cost= 1.0;
    idx_avg_io_cost= 1.0;
    io_count= idx_io_count= cpu_cost= idx_cpu_cost= mem_cost= import_cost= 0.0;
  }

  void multiply(double m)
  {
    io_count *= m;
    cpu_cost *= m;
    idx_io_count *= m;
    idx_cpu_cost *= m;
    import_cost *= m;
    /* Don't multiply mem_cost */
  }

  void add(const Cost_estimate* cost)
  {
    if (cost->io_count != 0.0)
    {
      double io_count_sum= io_count + cost->io_count;
      avg_io_cost= (io_count * avg_io_cost +
                    cost->io_count * cost->avg_io_cost)
	            /io_count_sum;
      io_count= io_count_sum;
    }
    if (cost->idx_io_count != 0.0)
    {
      double idx_io_count_sum= idx_io_count + cost->idx_io_count;
      idx_avg_io_cost= (idx_io_count * idx_avg_io_cost +
                        cost->idx_io_count * cost->idx_avg_io_cost)
	               /idx_io_count_sum;
      idx_io_count= idx_io_count_sum;
    }
    cpu_cost += cost->cpu_cost;
    idx_cpu_cost += cost->idx_cpu_cost;
    import_cost += cost->import_cost;
  }

  void add_io(double add_io_cnt, double add_avg_cost)
  {
    /* In edge cases add_io_cnt may be zero */
    if (add_io_cnt > 0)
    {
      double io_count_sum= io_count + add_io_cnt;
      avg_io_cost= (io_count * avg_io_cost + 
                    add_io_cnt * add_avg_cost) / io_count_sum;
      io_count= io_count_sum;
    }
  }

  /// Add to CPU cost
  void add_cpu(double add_cpu_cost) { cpu_cost+= add_cpu_cost; }

  /// Add to import cost
  void add_import(double add_import_cost) { import_cost+= add_import_cost; }

  /// Add to memory cost
  void add_mem(double add_mem_cost) { mem_cost+= add_mem_cost; }

  /*
    To be used when we go from old single value-based cost calculations to
    the new Cost_estimate-based.
  */
  void convert_from_cost(double cost)
  {
    reset();
    io_count= cost;
  }
};

void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted, 
                         Cost_estimate *cost);

/*
  Indicates that all scanned ranges will be singlepoint (aka equality) ranges.
  The ranges may not use the full key but all of them will use the same number
  of key parts.
*/
#define HA_MRR_SINGLE_POINT 1U
#define HA_MRR_FIXED_KEY  2U

/* 
  Indicates that RANGE_SEQ_IF::next(&range) doesn't need to fill in the
  'range' parameter.
*/
#define HA_MRR_NO_ASSOCIATION 4U

/* 
  The MRR user will provide ranges in key order, and MRR implementation
  must return rows in key order.
*/
#define HA_MRR_SORTED 8U

/* MRR implementation doesn't have to retrieve full records */
#define HA_MRR_INDEX_ONLY 16U

/* 
  The passed memory buffer is of maximum possible size, the caller can't
  assume larger buffer.
*/
#define HA_MRR_LIMITS 32U


/*
  Flag set <=> default MRR implementation is used
  (The choice is made by **_info[_const]() function which may set this
   flag. SQL layer remembers the flag value and then passes it to
   multi_read_range_init().
*/
#define HA_MRR_USE_DEFAULT_IMPL 64U

/*
  Used only as parameter to multi_range_read_info():
  Flag set <=> the caller guarantees that the bounds of the scanned ranges
  will not have NULL values.
*/
#define HA_MRR_NO_NULL_ENDPOINTS 128U

/*
  The MRR user has materialized range keys somewhere in the user's buffer.
  This can be used for optimization of the procedure that sorts these keys
  since in this case key values don't have to be copied into the MRR buffer.

  In other words, it is guaranteed that after RANGE_SEQ_IF::next() call the 
  pointer in range->start_key.key will point to a key value that will remain 
  there until the end of the MRR scan.
*/
#define HA_MRR_MATERIALIZED_KEYS 256U

/*
  The following bits are reserved for use by MRR implementation. The intended
  use scenario:

  * sql layer calls handler->multi_range_read_info[_const]() 
    - MRR implementation figures out what kind of scan it will perform, saves
      the result in *mrr_mode parameter.
  * sql layer remembers what was returned in *mrr_mode

  * the optimizer picks the query plan (which may or may not include the MRR 
    scan that was estimated by the multi_range_read_info[_const] call)

  * if the query is an EXPLAIN statement, sql layer will call 
    handler->multi_range_read_explain_info(mrr_mode) to get a text description
    of the picked MRR scan; the description will be a part of EXPLAIN output.
*/
#define HA_MRR_IMPLEMENTATION_FLAG1 512U
#define HA_MRR_IMPLEMENTATION_FLAG2 1024U
#define HA_MRR_IMPLEMENTATION_FLAG3 2048U
#define HA_MRR_IMPLEMENTATION_FLAG4 4096U
#define HA_MRR_IMPLEMENTATION_FLAG5 8192U
#define HA_MRR_IMPLEMENTATION_FLAG6 16384U

#define HA_MRR_IMPLEMENTATION_FLAGS \
  (512U | 1024U | 2048U | 4096U | 8192U | 16384U)

/*
  This is a buffer area that the handler can use to store rows.
  'end_of_used_area' should be kept updated after calls to
  read-functions so that other parts of the code can use the
  remaining area (until next read calls is issued).
*/

typedef struct st_handler_buffer
{
  /* const? */uchar *buffer;         /* Buffer one can start using */
  /* const? */uchar *buffer_end;     /* End of buffer */
  uchar *end_of_used_area;     /* End of area that was used by handler */
} HANDLER_BUFFER;

typedef struct system_status_var SSV;

class ha_statistics
{
public:
  ulonglong data_file_length;		/* Length off data file */
  ulonglong max_data_file_length;	/* Length off data file */
  ulonglong index_file_length;
  ulonglong max_index_file_length;
  ulonglong delete_length;		/* Free bytes */
  ulonglong auto_increment_value;
  /*
    The number of records in the table. 
      0    - means the table has exactly 0 rows
    other  - if (table_flags() & HA_STATS_RECORDS_IS_EXACT)
               the value is the exact number of records in the table
             else
               it is an estimate
  */
  ha_rows records;
  ha_rows deleted;			/* Deleted records */
  ulong mean_rec_length;		/* physical reclength */
  time_t create_time;			/* When table was created */
  time_t check_time;
  time_t update_time;
  uint block_size;			/* index block size */
  ha_checksum checksum;
  bool checksum_null;

  /*
    number of buffer bytes that native mrr implementation needs,
  */
  uint mrr_length_per_rec; 

  ha_statistics():
    data_file_length(0), max_data_file_length(0),
    index_file_length(0), max_index_file_length(0), delete_length(0),
    auto_increment_value(0), records(0), deleted(0), mean_rec_length(0),
    create_time(0), check_time(0), update_time(0), block_size(8192),
    checksum(0), checksum_null(FALSE), mrr_length_per_rec(0)
  {}
};

extern "C" check_result_t handler_index_cond_check(void* h_arg);

extern "C" check_result_t handler_rowid_filter_check(void* h_arg);
extern "C" int handler_rowid_filter_is_active(void* h_arg);

uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
/*
  bitmap with first N+1 bits set
  (keypart_map for a key prefix of [0..N] keyparts)
*/
inline key_part_map make_keypart_map(uint N)
{
  return ((key_part_map)2 << (N)) - 1;
}

/*
  bitmap with first N bits set
  (keypart_map for a key prefix of [0..N-1] keyparts)
*/
inline key_part_map make_prev_keypart_map(uint N)
{
  return ((key_part_map)1 << (N)) - 1;
}


/** Base class to be used by handlers different shares */
class Handler_share
{
public:
  Handler_share() = default;
  virtual ~Handler_share() = default;
};

enum class Compare_keys : uint32_t
{
  Equal= 0,
  EqualButKeyPartLength,
  EqualButComment,
  NotEqual
};

/**
  The handler class is the interface for dynamically loadable
  storage engines. Do not add ifdefs and take care when adding or
  changing virtual functions to avoid vtable confusion

  Functions in this class accept and return table columns data. Two data
  representation formats are used:
  1. TableRecordFormat - Used to pass [partial] table records to/from
     storage engine

  2. KeyTupleFormat - used to pass index search tuples (aka "keys") to
     storage engine. See opt_range.cc for description of this format.

  TableRecordFormat
  =================
  [Warning: this description is work in progress and may be incomplete]
  The table record is stored in a fixed-size buffer:
   
    record: null_bytes, column1_data, column2_data, ...
  
  The offsets of the parts of the buffer are also fixed: every column has 
  an offset to its column{i}_data, and if it is nullable it also has its own
  bit in null_bytes. 

  The record buffer only includes data about columns that are marked in the
  relevant column set (table->read_set and/or table->write_set, depending on
  the situation). 
  <not-sure>It could be that it is required that null bits of non-present
  columns are set to 1</not-sure>

  VARIOUS EXCEPTIONS AND SPECIAL CASES

  If the table has no nullable columns, then null_bytes is still 
  present, its length is one byte <not-sure> which must be set to 0xFF 
  at all times. </not-sure>
  
  If the table has columns of type BIT, then certain bits from those columns
  may be stored in null_bytes as well. Grep around for Field_bit for
  details.

  For blob columns (see Field_blob), the record buffer stores length of the 
  data, following by memory pointer to the blob data. The pointer is owned 
  by the storage engine and is valid until the next operation.

  If a blob column has NULL value, then its length and blob data pointer
  must be set to 0.
*/

class handler :public Sql_alloc
{
public:
  typedef ulonglong Table_flags;
protected:
  TABLE_SHARE *table_share;   /* The table definition */
  TABLE *table;               /* The current open table */
  Table_flags cached_table_flags;       /* Set on init() and open() */

  ha_rows estimation_rows_to_insert;
  handler *lookup_handler;
  /* Statistics for the query. Updated if handler_stats.active is set */
  ha_handler_stats active_handler_stats;
  void set_handler_stats();
public:
  handlerton *ht;                 /* storage engine of this handler */
  uchar *ref;				/* Pointer to current row */
  uchar *dup_ref;			/* Pointer to duplicate row */
  uchar *lookup_buffer;

  /* General statistics for the table like number of row, file sizes etc */
  ha_statistics stats;
  /*
    Collect query stats here if pointer is != NULL.
    This is a pointer because if we do a clone of the handler, we want to
    use the original handler for collecting statistics.
  */
  ha_handler_stats *handler_stats;

  /** MultiRangeRead-related members: */
  range_seq_t mrr_iter;    /* Iterator to traverse the range sequence */
  RANGE_SEQ_IF mrr_funcs;  /* Range sequence traversal functions */
  HANDLER_BUFFER *multi_range_buffer; /* MRR buffer info */
  uint ranges_in_seq; /* Total number of ranges in the traversed sequence */
  /** Current range (the one we're now returning rows from) */
  KEY_MULTI_RANGE mrr_cur_range;

  /** The following are for read_range() */
  key_range save_end_range, *end_range;
  KEY_PART_INFO *range_key_part;
  int key_compare_result_on_equal;

  /* TRUE <=> source MRR ranges and the output are ordered */
  bool mrr_is_output_sorted;
  /** TRUE <=> we're currently traversing a range in mrr_cur_range. */
  bool mrr_have_range;
  bool eq_range;
  bool internal_tmp_table;                 /* If internal tmp table */
  bool implicit_emptied;                   /* Can be !=0 only if HEAP */
  bool mark_trx_read_write_done;           /* mark_trx_read_write was called */
  bool check_table_binlog_row_based_done; /* check_table_binlog.. was called */
  bool check_table_binlog_row_based_result; /* cached check_table_binlog... */
  /* 
    TRUE <=> the engine guarantees that returned records are within the range
    being scanned.
  */
  bool in_range_check_pushed_down;

  uint lookup_errkey;
  uint errkey;                             /* Last dup key */
  uint key_used_on_scan;
  uint active_index, keyread;

  /** Length of ref (1-8 or the clustered key length) */
  uint ref_length;
  FT_INFO *ft_handler;
  enum init_stat { NONE=0, INDEX, RND };
  init_stat inited, pre_inited;

  const COND *pushed_cond;
  /**
    next_insert_id is the next value which should be inserted into the
    auto_increment column: in a inserting-multi-row statement (like INSERT
    SELECT), for the first row where the autoinc value is not specified by the
    statement, get_auto_increment() called and asked to generate a value,
    next_insert_id is set to the next value, then for all other rows
    next_insert_id is used (and increased each time) without calling
    get_auto_increment().
  */
  ulonglong next_insert_id;
  /**
    insert id for the current row (*autogenerated*; if not
    autogenerated, it's 0).
    At first successful insertion, this variable is stored into
    THD::first_successful_insert_id_in_cur_stmt.
  */
  ulonglong insert_id_for_cur_row;
  /**
    Interval returned by get_auto_increment() and being consumed by the
    inserter.
  */
  /* Statistics  variables */
  ulonglong rows_read;
  ulonglong rows_tmp_read;
  ulonglong rows_changed;
  /* One bigger than needed to avoid to test if key == MAX_KEY */
  ulonglong index_rows_read[MAX_KEY+1];
  ha_copy_info copy_info;

private:
  /* ANALYZE time tracker, if present */
  Exec_time_tracker *tracker;
public:
  void set_time_tracker(Exec_time_tracker *tracker_arg) { tracker=tracker_arg;}
  Exec_time_tracker *get_time_tracker() { return tracker; }

  Item *pushed_idx_cond;
  uint pushed_idx_cond_keyno;  /* The index which the above condition is for */

  /* Rowid filter pushed into the engine */
  Rowid_filter *pushed_rowid_filter;
  /* true when the pushed rowid filter has been already filled */
  bool rowid_filter_is_active;
  /* Used for disabling/enabling pushed_rowid_filter */
  Rowid_filter *save_pushed_rowid_filter;
  bool save_rowid_filter_is_active;

  Discrete_interval auto_inc_interval_for_cur_row;
  /**
     Number of reserved auto-increment intervals. Serves as a heuristic
     when we have no estimation of how many records the statement will insert:
     the more intervals we have reserved, the bigger the next one. Reset in
     handler::ha_release_auto_increment().
  */
  uint auto_inc_intervals_count;

  /**
    Instrumented table associated with this handler.
    This member should be set to NULL when no instrumentation is in place,
    so that linking an instrumented/non instrumented server/plugin works.
    For example:
    - the server is compiled with the instrumentation.
    The server expects either NULL or valid pointers in m_psi.
    - an engine plugin is compiled without instrumentation.
    The plugin can not leave this pointer uninitialized,
    or can not leave a trash value on purpose in this pointer,
    as this would crash the server.
  */
  PSI_table *m_psi;

private:
  /** Internal state of the batch instrumentation. */
  enum batch_mode_t
  {
    /** Batch mode not used. */
    PSI_BATCH_MODE_NONE,
    /** Batch mode used, before first table io. */
    PSI_BATCH_MODE_STARTING,
    /** Batch mode used, after first table io. */
    PSI_BATCH_MODE_STARTED
  };
  /**
    Batch mode state.
    @sa start_psi_batch_mode.
    @sa end_psi_batch_mode.
  */
  batch_mode_t m_psi_batch_mode;
  /**
    The number of rows in the batch.
    @sa start_psi_batch_mode.
    @sa end_psi_batch_mode.
  */
  ulonglong m_psi_numrows;
  /**
    The current event in a batch.
    @sa start_psi_batch_mode.
    @sa end_psi_batch_mode.
  */
  PSI_table_locker *m_psi_locker;
  /**
    Storage for the event in a batch.
    @sa start_psi_batch_mode.
    @sa end_psi_batch_mode.
  */
  PSI_table_locker_state m_psi_locker_state;

public:
  virtual void unbind_psi();
  virtual void rebind_psi();
  /* Return error if definition doesn't match for already opened table */
  virtual int discover_check_version() { return 0; }

  /**
    Put the handler in 'batch' mode when collecting
    table io instrumented events.
    When operating in batch mode:
    - a single start event is generated in the performance schema.
    - all table io performed between @c start_psi_batch_mode
      and @c end_psi_batch_mode is not instrumented:
      the number of rows affected is counted instead in @c m_psi_numrows.
    - a single end event is generated in the performance schema
      when the batch mode ends with @c end_psi_batch_mode.
  */
  void start_psi_batch_mode();
  /** End a batch started with @c start_psi_batch_mode. */
  void end_psi_batch_mode();

  /* If we have row logging enabled for this table */
  bool row_logging, row_logging_init;
  /* If the row logging should be done in transaction cache */
  bool row_logging_has_trans;

private:
  /**
    The lock type set by when calling::ha_external_lock(). This is 
    propagated down to the storage engine. The reason for also storing 
    it here, is that when doing MRR we need to create/clone a second handler
    object. This cloned handler object needs to know about the lock_type used.
  */
  int m_lock_type;
  /**
    Pointer where to store/retrieve the Handler_share pointer.
    For non partitioned handlers this is &TABLE_SHARE::ha_share.
  */
  Handler_share **ha_share;

public:
  handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
    :table_share(share_arg), table(0),
    estimation_rows_to_insert(0),
    lookup_handler(this),
    ht(ht_arg), ref(0), lookup_buffer(NULL), handler_stats(NULL),
    end_range(NULL), implicit_emptied(0),
    mark_trx_read_write_done(0),
    check_table_binlog_row_based_done(0),
    check_table_binlog_row_based_result(0),
    in_range_check_pushed_down(FALSE), lookup_errkey(-1), errkey(-1),
    key_used_on_scan(MAX_KEY),
    active_index(MAX_KEY), keyread(MAX_KEY),
    ref_length(sizeof(my_off_t)),
    ft_handler(0), inited(NONE), pre_inited(NONE),
    pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0),
    tracker(NULL),
    pushed_idx_cond(NULL),
    pushed_idx_cond_keyno(MAX_KEY),
    pushed_rowid_filter(NULL),
    rowid_filter_is_active(0),
    save_pushed_rowid_filter(NULL),
    save_rowid_filter_is_active(false),
    auto_inc_intervals_count(0),
    m_psi(NULL),
    m_psi_batch_mode(PSI_BATCH_MODE_NONE),
    m_psi_numrows(0),
    m_psi_locker(NULL),
    row_logging(0), row_logging_init(0),
    m_lock_type(F_UNLCK), ha_share(NULL)
  {
    DBUG_PRINT("info",
               ("handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
                F_UNLCK, F_RDLCK, F_WRLCK));
    reset_statistics();
  }
  virtual ~handler(void)
  {
    DBUG_ASSERT(m_lock_type == F_UNLCK);
    DBUG_ASSERT(inited == NONE);
  }
  /* To check if table has been properely opened */
  bool is_open()
  {
    return ref != 0;
  }
  virtual handler *clone(const char *name, MEM_ROOT *mem_root);
  /** This is called after create to allow us to set up cached variables */
  void init()
  {
    cached_table_flags= table_flags();
  }
  /* ha_ methods: public wrappers for private virtual API */
  
  int ha_open(TABLE *table, const char *name, int mode, uint test_if_locked,
              MEM_ROOT *mem_root= 0, List<String> *partitions_to_open=NULL);
  int ha_index_init(uint idx, bool sorted)
  {
    DBUG_EXECUTE_IF("ha_index_init_fail", return HA_ERR_TABLE_DEF_CHANGED;);
    int result;
    DBUG_ENTER("ha_index_init");
    DBUG_ASSERT(inited==NONE);
    if (!(result= index_init(idx, sorted)))
    {
      inited=       INDEX;
      active_index= idx;
      end_range= NULL;
    }
    DBUG_RETURN(result);
  }
  int ha_index_end()
  {
    DBUG_ENTER("ha_index_end");
    DBUG_ASSERT(inited==INDEX);
    inited=       NONE;
    active_index= MAX_KEY;
    end_range=    NULL;
    DBUG_RETURN(index_end());
  }
  /* This is called after index_init() if we need to do a index scan */
  virtual int prepare_index_scan() { return 0; }
  virtual int prepare_index_key_scan_map(const uchar * key, key_part_map keypart_map)
  {
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
    return  prepare_index_key_scan(key, key_len);
  }
  virtual int prepare_index_key_scan( const uchar * key, uint key_len )
  { return 0; }
  virtual int prepare_range_scan(const key_range *start_key, const key_range *end_key)
  { return 0; }

  int ha_rnd_init(bool scan) __attribute__ ((warn_unused_result))
  {
    DBUG_EXECUTE_IF("ha_rnd_init_fail", return HA_ERR_TABLE_DEF_CHANGED;);
    int result;
    DBUG_ENTER("ha_rnd_init");
    DBUG_ASSERT(inited==NONE || (inited==RND && scan));
    inited= (result= rnd_init(scan)) ? NONE: RND;
    end_range= NULL;
    DBUG_RETURN(result);
  }
  int ha_rnd_end()
  {
    DBUG_ENTER("ha_rnd_end");
    DBUG_ASSERT(inited==RND);
    inited=NONE;
    end_range= NULL;
    DBUG_RETURN(rnd_end());
  }
  int ha_rnd_init_with_error(bool scan) __attribute__ ((warn_unused_result));
  int ha_reset();
  /* this is necessary in many places, e.g. in HANDLER command */
  int ha_index_or_rnd_end()
  {
    return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0;
  }
  /**
    The cached_table_flags is set at ha_open and ha_external_lock
  */
  Table_flags ha_table_flags() const
  {
    DBUG_ASSERT(cached_table_flags < (HA_LAST_TABLE_FLAG << 1));
    return cached_table_flags;
  }
  /**
    These functions represent the public interface to *users* of the
    handler class, hence they are *not* virtual. For the inheritance
    interface, see the (private) functions write_row(), update_row(),
    and delete_row() below.
  */
  int ha_external_lock(THD *thd, int lock_type);
  int ha_external_unlock(THD *thd) { return ha_external_lock(thd, F_UNLCK); }
  int ha_write_row(const uchar * buf);
  int ha_update_row(const uchar * old_data, const uchar * new_data);
  int ha_delete_row(const uchar * buf);
  void ha_release_auto_increment();

  bool keyread_enabled() { return keyread < MAX_KEY; }
  int ha_start_keyread(uint idx)
  {
    int res= keyread_enabled() ? 0 : extra_opt(HA_EXTRA_KEYREAD, idx);
    keyread= idx;
    return res;
  }
  int ha_end_keyread()
  {
    if (!keyread_enabled())
      return 0;
    keyread= MAX_KEY;
    return extra(HA_EXTRA_NO_KEYREAD);
  }

  int check_collation_compatibility();
  int check_long_hash_compatibility() const;
  int ha_check_for_upgrade(HA_CHECK_OPT *check_opt);
  /** to be actually called to get 'check()' functionality*/
  int ha_check(THD *thd, HA_CHECK_OPT *check_opt);
  int ha_repair(THD* thd, HA_CHECK_OPT* check_opt);
  void ha_start_bulk_insert(ha_rows rows, uint flags= 0)
  {
    DBUG_ENTER("handler::ha_start_bulk_insert");
    estimation_rows_to_insert= rows;
    bzero(&copy_info,sizeof(copy_info));
    start_bulk_insert(rows, flags);
    DBUG_VOID_RETURN;
  }
  int ha_end_bulk_insert();
  int ha_bulk_update_row(const uchar *old_data, const uchar *new_data,
                         ha_rows *dup_key_found);
  int ha_delete_all_rows();
  int ha_truncate();
  int ha_reset_auto_increment(ulonglong value);
  int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
  int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
  bool ha_check_and_repair(THD *thd);
  int ha_disable_indexes(key_map map, bool persist);
  int ha_enable_indexes(key_map map, bool persist);
  int ha_discard_or_import_tablespace(my_bool discard);
  int ha_rename_table(const char *from, const char *to);

  int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info);

  int ha_create_partitioning_metadata(const char *name, const char *old_name,
                                      chf_create_flags action_flag);

  int ha_change_partitions(HA_CREATE_INFO *create_info,
                           const char *path,
                           ulonglong * const copied,
                           ulonglong * const deleted,
                           const uchar *pack_frm_data,
                           size_t pack_frm_len);
  int ha_drop_partitions(const char *path);
  int ha_rename_partitions(const char *path);

  void adjust_next_insert_id_after_explicit_value(ulonglong nr);
  int update_auto_increment();
  virtual void print_error(int error, myf errflag);
  virtual bool get_error_message(int error, String *buf);
  uint get_dup_key(int error);
  bool has_dup_ref() const;
  /**
    Retrieves the names of the table and the key for which there was a
    duplicate entry in the case of HA_ERR_FOREIGN_DUPLICATE_KEY.

    If any of the table or key name is not available this method will return
    false and will not change any of child_table_name or child_key_name.

    @param child_table_name[out]    Table name
    @param child_table_name_len[in] Table name buffer size
    @param child_key_name[out]      Key name
    @param child_key_name_len[in]   Key name buffer size

    @retval  true                  table and key names were available
                                   and were written into the corresponding
                                   out parameters.
    @retval  false                 table and key names were not available,
                                   the out parameters were not touched.
  */
  virtual bool get_foreign_dup_key(char *child_table_name,
                                   uint child_table_name_len,
                                   char *child_key_name,
                                   uint child_key_name_len)
  { DBUG_ASSERT(false); return(false); }
  void reset_statistics()
  {
    rows_read= rows_changed= rows_tmp_read= 0;
    bzero(index_rows_read, sizeof(index_rows_read));
    bzero(&copy_info, sizeof(copy_info));
  }
  virtual void reset_copy_info() {}
  void ha_reset_copy_info()
  {
    bzero(&copy_info, sizeof(copy_info));
    reset_copy_info();
  }
  virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
  {
    table= table_arg;
    table_share= share;
    reset_statistics();
  }
  virtual double scan_time()
  {
    return ((ulonglong2double(stats.data_file_length) / stats.block_size + 2) *
            avg_io_cost());
  }

  virtual double key_scan_time(uint index)
  {
    return keyread_time(index, 1, records());
  }

  virtual double avg_io_cost()
  {
   return 1.0;
  }

  /**
     The cost of reading a set of ranges from the table using an index
     to access it.
     
     @param index  The index number.
     @param ranges The number of ranges to be read. If 0, it means that
                   we calculate separately the cost of reading the key.
     @param rows   Total number of rows to be read.
     
     This method can be used to calculate the total cost of scanning a table
     using an index by calling it using read_time(index, 1, table_size).
  */
  virtual double read_time(uint index, uint ranges, ha_rows rows)
  { return rows2double(ranges+rows); }

  /**
    Calculate cost of 'keyread' scan for given index and number of records.

     @param index    index to read
     @param ranges   #of ranges to read
     @param rows     #of records to read
  */
  virtual double keyread_time(uint index, uint ranges, ha_rows rows);

  virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; }

  /*
    True if changes to the table is persistent (if there are no rollback)
    This is used to decide:
    - If the table is stored in the transaction or non transactional binary
      log
    - How things are tracked in trx and in add_changed_table().
    - If we can combine several statements under one commit in the binary log.
  */
  bool has_transactions() const
  {
    return ((ha_table_flags() & (HA_NO_TRANSACTIONS | HA_PERSISTENT_TABLE))
            == 0);
  }
  /*
    True if table has both transactions and rollback. This is used to decide
    if we should write the changes to the binary log.  If this is true,
    we don't have to write failed statements to the log as they can be
    rolled back.
  */
  bool has_transactions_and_rollback() const
  {
    return has_transactions() && has_rollback();
  }
  /*
    True if the underlaying table support transactions and rollback
  */
  bool has_transaction_manager() const
  {
    return ((ha_table_flags() & HA_NO_TRANSACTIONS) == 0 && has_rollback());
  }

  /*
    True if the underlaying table support TRANSACTIONAL table option
  */
  bool has_transactional_option() const
  {
    extern handlerton *maria_hton;
    return partition_ht() == maria_hton || has_transaction_manager();
  }

  /*
    True if table has rollback. Used to check if an update on the table
    can be killed fast.
  */

  bool has_rollback() const
  {
    return ((ht->flags & HTON_NO_ROLLBACK) == 0);
  }

  /**
    This method is used to analyse the error to see whether the error
    is ignorable or not, certain handlers can have more error that are
    ignorable than others. E.g. the partition handler can get inserts
    into a range where there is no partition and this is an ignorable
    error.
    HA_ERR_FOUND_DUP_UNIQUE is a special case in MyISAM that means the
    same thing as HA_ERR_FOUND_DUP_KEY but can in some cases lead to
    a slightly different error message.
  */
  virtual bool is_fatal_error(int error, uint flags)
  {
    if (!error ||
        ((flags & HA_CHECK_DUP_KEY) &&
         (error == HA_ERR_FOUND_DUPP_KEY ||
          error == HA_ERR_FOUND_DUPP_UNIQUE)) ||
        error == HA_ERR_AUTOINC_ERANGE ||
        ((flags & HA_CHECK_FK_ERROR) &&
         (error == HA_ERR_ROW_IS_REFERENCED ||
          error == HA_ERR_NO_REFERENCED_ROW)))
      return FALSE;
    return TRUE;
  }

  /**
    Number of rows in table. It will only be called if
    (table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0
  */
  virtual int pre_records() { return 0; }
  virtual ha_rows records() { return stats.records; }
  /**
    Return upper bound of current number of records in the table
    (max. of how many records one will retrieve when doing a full table scan)
    If upper bound is not known, HA_POS_ERROR should be returned as a max
    possible upper bound.
  */
  virtual ha_rows estimate_rows_upper_bound()
  { return stats.records+EXTRA_RECORDS; }

  /**
    Get the row type from the storage engine.  If this method returns
    ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
  */
  virtual enum row_type get_row_type() const { return ROW_TYPE_NOT_USED; }

  virtual const char *index_type(uint key_number) { DBUG_ASSERT(0); return "";}


  /**
    Signal that the table->read_set and table->write_set table maps changed
    The handler is allowed to set additional bits in the above map in this
    call. Normally the handler should ignore all calls until we have done
    a ha_rnd_init() or ha_index_init(), write_row(), update_row or delete_row()
    as there may be several calls to this routine.
  */
  virtual void column_bitmaps_signal();
  /*
    We have to check for inited as some engines, like innodb, sets
    active_index during table scan.
  */
  uint get_index(void) const
  { return inited == INDEX ? active_index : MAX_KEY; }
  int ha_close(void);

  /**
    @retval  0   Bulk update used by handler
    @retval  1   Bulk update not used, normal operation used
  */
  virtual bool start_bulk_update() { return 1; }
  /**
    @retval  0   Bulk delete used by handler
    @retval  1   Bulk delete not used, normal operation used
  */
  virtual bool start_bulk_delete() { return 1; }
  /**
    After this call all outstanding updates must be performed. The number
    of duplicate key errors are reported in the duplicate key parameter.
    It is allowed to continue to the batched update after this call, the
    handler has to wait until end_bulk_update with changing state.

    @param    dup_key_found       Number of duplicate keys found

    @retval  0           Success
    @retval  >0          Error code
  */
  virtual int exec_bulk_update(ha_rows *dup_key_found)
  {
    DBUG_ASSERT(FALSE);
    return HA_ERR_WRONG_COMMAND;
  }
  /**
    Perform any needed clean-up, no outstanding updates are there at the
    moment.
  */
  virtual int end_bulk_update() { return 0; }
  /**
    Execute all outstanding deletes and close down the bulk delete.

    @retval 0             Success
    @retval >0            Error code
  */
  virtual int end_bulk_delete()
  {
    DBUG_ASSERT(FALSE);
    return HA_ERR_WRONG_COMMAND;
  }
  virtual int pre_index_read_map(const uchar *key,
                                 key_part_map keypart_map,
                                 enum ha_rkey_function find_flag,
                                 bool use_parallel)
   { return 0; }
  virtual int pre_index_first(bool use_parallel)
   { return 0; }
  virtual int pre_index_last(bool use_parallel)
   { return 0; }
  virtual int pre_index_read_last_map(const uchar *key,
                                      key_part_map keypart_map,
                                      bool use_parallel)
   { return 0; }
/*
  virtual int pre_read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
                                         KEY_MULTI_RANGE *ranges,
                                         uint range_count,
                                         bool sorted, HANDLER_BUFFER *buffer,
                                         bool use_parallel);
*/
  virtual int pre_multi_range_read_next(bool use_parallel)
  { return 0; }
  virtual int pre_read_range_first(const key_range *start_key,
                                   const key_range *end_key,
                                   bool eq_range, bool sorted,
                                   bool use_parallel)
   { return 0; }
  virtual int pre_ft_read(bool use_parallel)
   { return 0; }
  virtual int pre_rnd_next(bool use_parallel)
   { return 0; }
  int ha_pre_rnd_init(bool scan)
  {
    int result;
    DBUG_ENTER("ha_pre_rnd_init");
    DBUG_ASSERT(pre_inited==NONE || (pre_inited==RND && scan));
    pre_inited= (result= pre_rnd_init(scan)) ? NONE: RND;
    DBUG_RETURN(result);
  }
  int ha_pre_rnd_end()
  {
    DBUG_ENTER("ha_pre_rnd_end");
    DBUG_ASSERT(pre_inited==RND);
    pre_inited=NONE;
    DBUG_RETURN(pre_rnd_end());
  }
  virtual int pre_rnd_init(bool scan) { return 0; }
  virtual int pre_rnd_end() { return 0; }
  virtual int pre_index_init(uint idx, bool sorted) { return 0; }
  virtual int pre_index_end() { return 0; }
  int ha_pre_index_init(uint idx, bool sorted)
  {
    int result;
    DBUG_ENTER("ha_pre_index_init");
    DBUG_ASSERT(pre_inited==NONE);
    if (!(result= pre_index_init(idx, sorted)))
      pre_inited=INDEX;
    DBUG_RETURN(result);
  }
  int ha_pre_index_end()
  {
    DBUG_ENTER("ha_pre_index_end");
    DBUG_ASSERT(pre_inited==INDEX);
    pre_inited=NONE;
    DBUG_RETURN(pre_index_end());
  }
  int ha_pre_index_or_rnd_end()
  {
    return (pre_inited == INDEX ?
            ha_pre_index_end() :
            pre_inited == RND ? ha_pre_rnd_end() : 0 );
  }
  virtual bool vers_can_native(THD *thd)
  {
    return ht->flags & HTON_NATIVE_SYS_VERSIONING;
  }

  /**
     @brief
     Positions an index cursor to the index specified in the
     handle. Fetches the row if available. If the key value is null,
     begin at the first key of the index.
  */
protected:
  virtual int index_read_map(uchar * buf, const uchar * key,
                             key_part_map keypart_map,
                             enum ha_rkey_function find_flag)
  {
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
    return index_read(buf, key, key_len, find_flag);
  }
  /**
     @brief
     Positions an index cursor to the index specified in the
     handle. Fetches the row if available. If the key value is null,
     begin at the first key of the index.
  */
  virtual int index_read_idx_map(uchar * buf, uint index, const uchar * key,
                                 key_part_map keypart_map,
                                 enum ha_rkey_function find_flag);
  virtual int index_next(uchar * buf)
   { return  HA_ERR_WRONG_COMMAND; }
  virtual int index_prev(uchar * buf)
   { return  HA_ERR_WRONG_COMMAND; }
  virtual int index_first(uchar * buf)
   { return  HA_ERR_WRONG_COMMAND; }
  virtual int index_last(uchar * buf)
   { return  HA_ERR_WRONG_COMMAND; }
  virtual int index_next_same(uchar *buf, const uchar *key, uint keylen);
  /**
     @brief
     The following functions works like index_read, but it find the last
     row with the current key value or prefix.
     @returns @see index_read_map().
  */
  virtual int index_read_last_map(uchar * buf, const uchar * key,
                                  key_part_map keypart_map)
  {
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
    return index_read_last(buf, key, key_len);
  }
  virtual int close(void)=0;
  inline void update_rows_read()
  {
    if (likely(!internal_tmp_table))
      rows_read++;
    else
      rows_tmp_read++;
  }
  inline void update_index_statistics()
  {
    index_rows_read[active_index]++;
    update_rows_read();
  }
public:

  int ha_index_read_map(uchar * buf, const uchar * key,
                        key_part_map keypart_map,
                        enum ha_rkey_function find_flag);
  int ha_index_read_idx_map(uchar * buf, uint index, const uchar * key,
                            key_part_map keypart_map,
                            enum ha_rkey_function find_flag);
  int ha_index_next(uchar * buf);
  int ha_index_prev(uchar * buf);
  int ha_index_first(uchar * buf);
  int ha_index_last(uchar * buf);
  int ha_index_next_same(uchar *buf, const uchar *key, uint keylen);
  /*
    TODO: should we make for those functions non-virtual ha_func_name wrappers,
    too?
  */
  virtual ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
                                              void *seq_init_param, 
                                              uint n_ranges, uint *bufsz,
                                              uint *mrr_mode,
                                              Cost_estimate *cost);
  virtual ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
                                        uint key_parts, uint *bufsz, 
                                        uint *mrr_mode, Cost_estimate *cost);
  virtual int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
                                    uint n_ranges, uint mrr_mode, 
                                    HANDLER_BUFFER *buf);
  virtual int multi_range_read_next(range_id_t *range_info);
  /*
    Return string representation of the MRR plan.

    This is intended to be used for EXPLAIN, via the following scenario:
    1. SQL layer calls handler->multi_range_read_info().
    1.1. Storage engine figures out whether it will use some non-default
         MRR strategy, sets appropritate bits in *mrr_mode, and returns 
         control to SQL layer
    2. SQL layer remembers the returned mrr_mode
    3. SQL layer compares various options and choses the final query plan. As
       a part of that, it makes a choice of whether to use the MRR strategy
       picked in 1.1
    4. EXPLAIN code converts the query plan to its text representation. If MRR
       strategy is part of the plan, it calls
       multi_range_read_explain_info(mrr_mode) to get a text representation of
       the picked MRR strategy.

    @param mrr_mode   Mode which was returned by multi_range_read_info[_const]
    @param str        INOUT string to be printed for EXPLAIN
    @param str_end    End of the string buffer. The function is free to put the 
                      string into [str..str_end] memory range.
  */
  virtual int multi_range_read_explain_info(uint mrr_mode, char *str, 
                                            size_t size)
  { return 0; }

  virtual int read_range_first(const key_range *start_key,
                               const key_range *end_key,
                               bool eq_range, bool sorted);
  virtual int read_range_next();
  void set_end_range(const key_range *end_key);
  int compare_key(key_range *range);
  int compare_key2(key_range *range) const;
  virtual int ft_init() { return HA_ERR_WRONG_COMMAND; }
  virtual int pre_ft_init() { return HA_ERR_WRONG_COMMAND; }
  virtual void ft_end() {}
  virtual int pre_ft_end() { return 0; }
  virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
    { return NULL; }
public:
  virtual int ft_read(uchar *buf) { return HA_ERR_WRONG_COMMAND; }
  virtual int rnd_next(uchar *buf)=0;
  virtual int rnd_pos(uchar * buf, uchar *pos)=0;
  /**
    This function only works for handlers having
    HA_PRIMARY_KEY_REQUIRED_FOR_POSITION set.
    It will return the row with the PK given in the record argument.
  */
  virtual int rnd_pos_by_record(uchar *record)
  {
    int error;
    DBUG_ASSERT(table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION);

    error = ha_rnd_init(false);
    if (error != 0)
      return error;

    position(record);
    error = ha_rnd_pos(record, ref);
    ha_rnd_end();
    return error;
  }
  virtual int read_first_row(uchar *buf, uint primary_key);
public:

  /* Same as above, but with statistics */
  inline int ha_ft_read(uchar *buf);
  inline void ha_ft_end() { ft_end(); ft_handler=NULL; }
  int ha_rnd_next(uchar *buf);
  int ha_rnd_pos(uchar *buf, uchar *pos);
  inline int ha_rnd_pos_by_record(uchar *buf);
  inline int ha_read_first_row(uchar *buf, uint primary_key);

  /**
    The following 2 function is only needed for tables that may be
    internal temporary tables during joins.
  */
  virtual int remember_rnd_pos()
    { return HA_ERR_WRONG_COMMAND; }
  virtual int restart_rnd_next(uchar *buf)
    { return HA_ERR_WRONG_COMMAND; }

  virtual ha_rows records_in_range(uint inx, const key_range *min_key,
                                   const key_range *max_key,
                                   page_range *res)
    { return (ha_rows) 10; }
  /*
    If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, then it sets ref
    (reference to the row, aka position, with the primary key given in
    the record).
    Otherwise it set ref to the current row.
  */
  virtual void position(const uchar *record)=0;
  virtual int info(uint)=0; // see my_base.h for full description
  virtual void get_dynamic_partition_info(PARTITION_STATS *stat_info,
                                          uint part_id);
  virtual void set_partitions_to_open(List<String> *partition_names) {}
  virtual bool check_if_updates_are_ignored(const char *op) const;
  virtual int change_partitions_to_open(List<String> *partition_names)
  { return 0; }
  virtual int extra(enum ha_extra_function operation)
  { return 0; }
  virtual int extra_opt(enum ha_extra_function operation, ulong arg)
  { return extra(operation); }
  /*
    Table version id for the the table. This should change for each
    sucessfull ALTER TABLE.
    This is used by the handlerton->check_version() to ask the engine
    if the table definition has been updated.
    Storage engines that does not support inplace alter table does not
    have to support this call.
  */
  virtual ulonglong table_version() const { return 0; }

  /**
    In an UPDATE or DELETE, if the row under the cursor was locked by another
    transaction, and the engine used an optimistic read of the last
    committed row value under the cursor, then the engine returns 1 from this
    function. MySQL must NOT try to update this optimistic value. If the
    optimistic value does not match the WHERE condition, MySQL can decide to
    skip over this row. Currently only works for InnoDB. This can be used to
    avoid unnecessary lock waits.

    If this method returns nonzero, it will also signal the storage
    engine that the next read will be a locking re-read of the row.
  */
  bool ha_was_semi_consistent_read();
  virtual bool was_semi_consistent_read() { return 0; }
  /**
    Tell the engine whether it should avoid unnecessary lock waits.
    If yes, in an UPDATE or DELETE, if the row under the cursor was locked
    by another transaction, the engine may try an optimistic read of
    the last committed row value under the cursor.
  */
  virtual void try_semi_consistent_read(bool) {}
  virtual void unlock_row() {}
  virtual int start_stmt(THD *thd, thr_lock_type lock_type) {return 0;}
  virtual bool need_info_for_auto_inc() { return 0; }
  virtual bool can_use_for_auto_inc_init() { return 1; }
  virtual void get_auto_increment(ulonglong offset, ulonglong increment,
                                  ulonglong nb_desired_values,
                                  ulonglong *first_value,
                                  ulonglong *nb_reserved_values);
  void set_next_insert_id(ulonglong id)
  {
    DBUG_PRINT("info",("auto_increment: next value %lu", (ulong)id));
    next_insert_id= id;
  }
  virtual void restore_auto_increment(ulonglong prev_insert_id)
  {
    /*
      Insertion of a row failed, re-use the lastly generated auto_increment
      id, for the next row. This is achieved by resetting next_insert_id to
      what it was before the failed insertion (that old value is provided by
      the caller). If that value was 0, it was the first row of the INSERT;
      then if insert_id_for_cur_row contains 0 it means no id was generated
      for this first row, so no id was generated since the INSERT started, so
      we should set next_insert_id to 0; if insert_id_for_cur_row is not 0, it
      is the generated id of the first and failed row, so we use it.
    */
    next_insert_id= (prev_insert_id > 0) ? prev_insert_id :
      insert_id_for_cur_row;
  }

  virtual void update_create_info(HA_CREATE_INFO *create_info) {}
  int check_old_types();
  virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)
  { return HA_ADMIN_NOT_IMPLEMENTED; }
  virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt)
  { return HA_ADMIN_NOT_IMPLEMENTED; }
  /* end of the list of admin commands */

  virtual int indexes_are_disabled(void) {return 0;}
  virtual void append_create_info(String *packet) {}
  /**
    If index == MAX_KEY then a check for table is made and if index <
    MAX_KEY then a check is made if the table has foreign keys and if
    a foreign key uses this index (and thus the index cannot be dropped).

    @param  index            Index to check if foreign key uses it

    @retval   TRUE            Foreign key defined on table or index
    @retval   FALSE           No foreign key defined
  */
  virtual bool is_fk_defined_on_table_or_index(uint index)
  { return FALSE; }
  virtual char* get_foreign_key_create_info()
  { return(NULL);}  /* gets foreign key create string from InnoDB */
  /**
    Used in ALTER TABLE to check if changing storage engine is allowed.

    @note Called without holding thr_lock.c lock.

    @retval true   Changing storage engine is allowed.
    @retval false  Changing storage engine not allowed.
  */
  virtual bool can_switch_engines() { return true; }
  virtual int can_continue_handler_scan() { return 0; }
  /**
    Get the list of foreign keys in this table.

    @remark Returns the set of foreign keys where this table is the
            dependent or child table.

    @param thd  The thread handle.
    @param f_key_list[out]  The list of foreign keys.

    @return The handler error code or zero for success.
  */
  virtual int
  get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
  { return 0; }
  /**
    Get the list of foreign keys referencing this table.

    @remark Returns the set of foreign keys where this table is the
            referenced or parent table.

    @param thd  The thread handle.
    @param f_key_list[out]  The list of foreign keys.

    @return The handler error code or zero for success.
  */
  virtual int
  get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
  { return 0; }
  virtual bool referenced_by_foreign_key() const noexcept { return false;}
  virtual void init_table_handle_for_HANDLER()
  { return; }       /* prepare InnoDB for HANDLER */
  virtual void free_foreign_key_create_info(char* str) {}
  /** The following can be called without an open handler */
  virtual const char *table_type() const { return hton_name(ht)->str; }
  /* The following is same as table_table(), except for partition engine */
  virtual const char *real_table_type() const { return hton_name(ht)->str; }
  const char **bas_ext() const { return ht->tablefile_extensions; }

  virtual int get_default_no_partitions(HA_CREATE_INFO *create_info)
  { return 1;}
  virtual void set_auto_partitions(partition_info *part_info) { return; }
  virtual bool get_no_parts(const char *name,
                            uint *no_parts)
  {
    *no_parts= 0;
    return 0;
  }
  virtual void set_part_info(partition_info *part_info) {return;}
  virtual void return_record_by_parent() { return; }

  /* Information about index. Both index and part starts from 0 */
  virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0;

  uint max_record_length() const
  { return MY_MIN(HA_MAX_REC_LENGTH, max_supported_record_length()); }
  uint max_keys() const
  { return MY_MIN(MAX_KEY, max_supported_keys()); }
  uint max_key_parts() const
  { return MY_MIN(MAX_REF_PARTS, max_supported_key_parts()); }
  uint max_key_length() const
  { return MY_MIN(MAX_DATA_LENGTH_FOR_KEY, max_supported_key_length()); }
  uint max_key_part_length() const
  { return MY_MIN(MAX_DATA_LENGTH_FOR_KEY, max_supported_key_part_length()); }

  virtual uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
  virtual uint max_supported_keys() const { return 0; }
  virtual uint max_supported_key_parts() const { return MAX_REF_PARTS; }
  virtual uint max_supported_key_length() const { return MAX_DATA_LENGTH_FOR_KEY; }
  virtual uint max_supported_key_part_length() const { return 255; }
  virtual uint min_record_length(uint options) const { return 1; }

  virtual int pre_calculate_checksum() { return 0; }
  virtual int calculate_checksum();
  virtual bool is_crashed() const  { return 0; }
  virtual bool auto_repair(int error) const { return 0; }

  void update_global_table_stats();
  void update_global_index_stats();

  /**
    @note lock_count() can return > 1 if the table is MERGE or partitioned.
  */
  virtual uint lock_count(void) const { return 1; }
  /**
    Is not invoked for non-transactional temporary tables.

    @note store_lock() can return more than one lock if the table is MERGE
    or partitioned.

    @note that one can NOT rely on table->in_use in store_lock().  It may
    refer to a different thread if called from mysql_lock_abort_for_thread().

    @note If the table is MERGE, store_lock() can return less locks
    than lock_count() claimed. This can happen when the MERGE children
    are not attached when this is called from another thread.
  */
  virtual THR_LOCK_DATA **store_lock(THD *thd,
				     THR_LOCK_DATA **to,
				     enum thr_lock_type lock_type)=0;

  /** Type of table for caching query */
  virtual uint8 table_cache_type() { return HA_CACHE_TBL_NONTRANSACT; }


  /**
    @brief Register a named table with a call back function to the query cache.

    @param thd The thread handle
    @param table_key A pointer to the table name in the table cache
    @param key_length The length of the table name
    @param[out] engine_callback The pointer to the storage engine call back
      function
    @param[out] engine_data Storage engine specific data which could be
      anything

    This method offers the storage engine, the possibility to store a reference
    to a table name which is going to be used with query cache. 
    The method is called each time a statement is written to the cache and can
    be used to verify if a specific statement is cacheable. It also offers
    the possibility to register a generic (but static) call back function which
    is called each time a statement is matched against the query cache.

    @note If engine_data supplied with this function is different from
      engine_data supplied with the callback function, and the callback returns
      FALSE, a table invalidation on the current table will occur.

    @return Upon success the engine_callback will point to the storage engine
      call back function, if any, and engine_data will point to any storage
      engine data used in the specific implementation.
      @retval TRUE Success
      @retval FALSE The specified table or current statement should not be
        cached
  */

  virtual my_bool register_query_cache_table(THD *thd, const char *table_key,
                                             uint key_length,
                                             qc_engine_callback *callback,
                                             ulonglong *engine_data)
  {
    *callback= 0;
    return TRUE;
  }

  /*
    Count tables invisible from all tables list on which current one built
    (like myisammrg and partitioned tables)

    tables_type          mask for the tables should be added herdde

    returns number of such tables
  */

  virtual uint count_query_cache_dependant_tables(uint8 *tables_type
                                                  __attribute__((unused)))
  {
    return 0;
  }

  /*
    register tables invisible from all tables list on which current one built
    (like myisammrg and partitioned tables).

    @note they should be counted by method above

    cache                Query cache pointer
    block                Query cache block to write the table
    n                    Number of the table

    @retval FALSE - OK
    @retval TRUE  - Error
  */

  virtual my_bool
    register_query_cache_dependant_tables(THD *thd
                                          __attribute__((unused)),
                                          Query_cache *cache
                                          __attribute__((unused)),
                                          Query_cache_block_table **block
                                          __attribute__((unused)),
                                          uint *n __attribute__((unused)))
  {
    return FALSE;
  }

 /*
   Check if the key is a clustering key

   - Data is stored together with the primary key (no secondary lookup
     needed to find the row data). The optimizer uses this to find out
     the cost of fetching data.

     Note that in many cases a clustered key is also a reference key.
     This means that:

   - The key is part of each secondary key and is used
     to find the row data in the primary index when reading trough
     secondary indexes.
   - When doing a HA_KEYREAD_ONLY we get also all the primary key parts
     into the row. This is critical property used by index_merge.

   All the above is usually true for engines that store the row
   data in the primary key index (e.g. in a b-tree), and use the key
   key value as a position().  InnoDB is an example of such an engine.

   For a clustered (primary) key, the following should also hold:
   index_flags() should contain HA_CLUSTERED_INDEX
   table_flags() should contain HA_TABLE_SCAN_ON_INDEX

   For a reference key the following should also hold:
   table_flags() should contain HA_PRIMARY_KEY_IS_READ_INDEX.

   @retval TRUE   yes
   @retval FALSE  No.
 */

 /* The following code is for primary keys */
 bool pk_is_clustering_key(uint index) const
 {
   /*
     We have to check for MAX_INDEX as table->s->primary_key can be
     MAX_KEY in the case where there is no primary key.
   */
   return index != MAX_KEY && is_clustering_key(index);
 }
 /* Same as before but for other keys, in which case we can skip the check */
 bool is_clustering_key(uint index) const
 {
   DBUG_ASSERT(index != MAX_KEY);
   return (index_flags(index, 0, 1) & HA_CLUSTERED_INDEX);
 }

 virtual int cmp_ref(const uchar *ref1, const uchar *ref2)
 {
   return memcmp(ref1, ref2, ref_length);
 }

 /*
   Condition pushdown to storage engines
 */

 /**
   Push condition down to the table handler.

   @param  cond   Condition to be pushed. The condition tree must not be
                  modified by the by the caller.

   @return
     The 'remainder' condition that caller must use to filter out records.
     NULL means the handler will not return rows that do not match the
     passed condition.

   @note
   The pushed conditions form a stack (from which one can remove the
   last pushed condition using cond_pop).
   The table handler filters out rows using (pushed_cond1 AND pushed_cond2 
   AND ... AND pushed_condN)
   or less restrictive condition, depending on handler's capabilities.

   handler->ha_reset() call empties the condition stack.
   Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
   condition stack.
 */ 
 virtual const COND *cond_push(const COND *cond) { return cond; };
 /**
   Pop the top condition from the condition stack of the handler instance.

   Pops the top if condition stack, if stack is not empty.
 */
 virtual void cond_pop() { return; };

 /**
   Push metadata for the current operation down to the table handler.
 */
 virtual int info_push(uint info_type, void *info) { return 0; };

 /**
   Push down an index condition to the handler.

   The server will use this method to push down a condition it wants
   the handler to evaluate when retrieving records using a specified
   index. The pushed index condition will only refer to fields from
   this handler that is contained in the index (but it may also refer
   to fields in other handlers). Before the handler evaluates the
   condition it must read the content of the index entry into the 
   record buffer.

   The handler is free to decide if and how much of the condition it
   will take responsibility for evaluating. Based on this evaluation
   it should return the part of the condition it will not evaluate.
   If it decides to evaluate the entire condition it should return
   NULL. If it decides not to evaluate any part of the condition it
   should return a pointer to the same condition as given as argument.

   @param keyno    the index number to evaluate the condition on
   @param idx_cond the condition to be evaluated by the handler

   @return The part of the pushed condition that the handler decides
           not to evaluate
 */
 virtual Item *idx_cond_push(uint keyno, Item* idx_cond) { return idx_cond; }

 /** Reset information about pushed index conditions */
 virtual void cancel_pushed_idx_cond()
 {
   pushed_idx_cond= NULL;
   pushed_idx_cond_keyno= MAX_KEY;
   in_range_check_pushed_down= false;
 }

 virtual void cancel_pushed_rowid_filter()
 {
   pushed_rowid_filter= NULL;
   rowid_filter_is_active= false;
 }

 virtual void disable_pushed_rowid_filter()
 {
   DBUG_ASSERT(pushed_rowid_filter != NULL &&
               save_pushed_rowid_filter == NULL);
   save_pushed_rowid_filter= pushed_rowid_filter;
   if (rowid_filter_is_active)
     save_rowid_filter_is_active= rowid_filter_is_active;
   pushed_rowid_filter= NULL;
   rowid_filter_is_active= false;
 }

 virtual void enable_pushed_rowid_filter()
 {
   DBUG_ASSERT(save_pushed_rowid_filter != NULL &&
               pushed_rowid_filter == NULL);
   pushed_rowid_filter= save_pushed_rowid_filter;
   if (save_rowid_filter_is_active)
     rowid_filter_is_active= true;
   save_pushed_rowid_filter= NULL;
 }

 virtual bool rowid_filter_push(Rowid_filter *rowid_filter) { return true; }

 /* Needed for partition / spider */
  virtual TABLE_LIST *get_next_global_for_child() { return NULL; }

 /**
   Part of old, deprecated in-place ALTER API.
 */
 virtual bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
					 uint table_changes)
 { return COMPATIBLE_DATA_NO; }

 /* On-line/in-place ALTER TABLE interface. */

 /*
   Here is an outline of on-line/in-place ALTER TABLE execution through
   this interface.

   Phase 1 : Initialization
   ========================
   During this phase we determine which algorithm should be used
   for execution of ALTER TABLE and what level concurrency it will
   require.

   *) This phase starts by opening the table and preparing description
      of the new version of the table.
   *) Then we check if it is impossible even in theory to carry out
      this ALTER TABLE using the in-place algorithm. For example, because
      we need to change storage engine or the user has explicitly requested
      usage of the "copy" algorithm.
   *) If in-place ALTER TABLE is theoretically possible, we continue
      by compiling differences between old and new versions of the table
      in the form of HA_ALTER_FLAGS bitmap. We also build a few
      auxiliary structures describing requested changes and store
      all these data in the Alter_inplace_info object.
   *) Then the handler::check_if_supported_inplace_alter() method is called
      in order to find if the storage engine can carry out changes requested
      by this ALTER TABLE using the in-place algorithm. To determine this,
      the engine can rely on data in HA_ALTER_FLAGS/Alter_inplace_info
      passed to it as well as on its own checks. If the in-place algorithm
      can be used for this ALTER TABLE, the level of required concurrency for
      its execution is also returned.
      If any errors occur during the handler call, ALTER TABLE is aborted
      and no further handler functions are called.
   *) Locking requirements of the in-place algorithm are compared to any
      concurrency requirements specified by user. If there is a conflict
      between them, we either switch to the copy algorithm or emit an error.

   Phase 2 : Execution
   ===================

   In this phase the operations are executed.

   *) As the first step, we acquire a lock corresponding to the concurrency
      level which was returned by handler::check_if_supported_inplace_alter()
      and requested by the user. This lock is held for most of the
      duration of in-place ALTER (if HA_ALTER_INPLACE_COPY_LOCK
      or HA_ALTER_INPLACE_COPY_NO_LOCK were returned we acquire an
      exclusive lock for duration of the next step only).
   *) After that we call handler::ha_prepare_inplace_alter_table() to give the
      storage engine a chance to update its internal structures with a higher
      lock level than the one that will be used for the main step of algorithm.
      After that we downgrade the lock if it is necessary.
   *) After that, the main step of this phase and algorithm is executed.
      We call the handler::ha_inplace_alter_table() method, which carries out the
      changes requested by ALTER TABLE but does not makes them visible to other
      connections yet.
   *) We ensure that no other connection uses the table by upgrading our
      lock on it to exclusive.
   *) a) If the previous step succeeds, handler::ha_commit_inplace_alter_table() is
         called to allow the storage engine to do any final updates to its structures,
         to make all earlier changes durable and visible to other connections.
      b) If we have failed to upgrade lock or any errors have occurred during the
         handler functions calls (including commit), we call
         handler::ha_commit_inplace_alter_table()
         to rollback all changes which were done during previous steps.

  Phase 3 : Final
  ===============

  In this phase we:

  *) Update SQL-layer data-dictionary by installing .FRM file for the new version
     of the table.
  *) Inform the storage engine about this change by calling the
     hton::notify_table_changed()
  *) Destroy the Alter_inplace_info and handler_ctx objects.

 */

 /**
    Check if a storage engine supports a particular alter table in-place

    @param    altered_table     TABLE object for new version of table.
    @param    ha_alter_info     Structure describing changes to be done
                                by ALTER TABLE and holding data used
                                during in-place alter.

    @retval   HA_ALTER_ERROR                  Unexpected error.
    @retval   HA_ALTER_INPLACE_NOT_SUPPORTED  Not supported, must use copy.
    @retval   HA_ALTER_INPLACE_EXCLUSIVE_LOCK Supported, but requires X lock.
    @retval   HA_ALTER_INPLACE_COPY_LOCK
                                              Supported, but requires SNW lock
                                              during main phase. Prepare phase
                                              requires X lock.
    @retval   HA_ALTER_INPLACE_SHARED_LOCK    Supported, but requires SNW lock.
    @retval   HA_ALTER_INPLACE_COPY_NO_LOCK
                                              Supported, concurrent reads/writes
                                              allowed. However, prepare phase
                                              requires X lock.
    @retval   HA_ALTER_INPLACE_NO_LOCK        Supported, concurrent
                                              reads/writes allowed.

    @note The default implementation uses the old in-place ALTER API
    to determine if the storage engine supports in-place ALTER or not.

    @note Called without holding thr_lock.c lock.
 */
 virtual enum_alter_inplace_result
 check_if_supported_inplace_alter(TABLE *altered_table,
                                  Alter_inplace_info *ha_alter_info);


 /**
    Public functions wrapping the actual handler call.
    @see prepare_inplace_alter_table()
 */
 bool ha_prepare_inplace_alter_table(TABLE *altered_table,
                                     Alter_inplace_info *ha_alter_info);


 /**
    Public function wrapping the actual handler call.
    @see inplace_alter_table()
 */
 bool ha_inplace_alter_table(TABLE *altered_table,
                             Alter_inplace_info *ha_alter_info)
 {
   return inplace_alter_table(altered_table, ha_alter_info);
 }


 /**
    Public function wrapping the actual handler call.
    Allows us to enforce asserts regardless of handler implementation.
    @see commit_inplace_alter_table()
 */
 bool ha_commit_inplace_alter_table(TABLE *altered_table,
                                    Alter_inplace_info *ha_alter_info,
                                    bool commit);


protected:
 /**
    Allows the storage engine to update internal structures with concurrent
    writes blocked. If check_if_supported_inplace_alter() returns
    HA_ALTER_INPLACE_COPY_NO_LOCK or HA_ALTER_INPLACE_COPY_LOCK,
    this function is called with exclusive lock otherwise the same level
    of locking as for inplace_alter_table() will be used.

    @note Storage engines are responsible for reporting any errors by
    calling my_error()/print_error()

    @note If this function reports error, commit_inplace_alter_table()
    will be called with commit= false.

    @note For partitioning, failing to prepare one partition, means that
    commit_inplace_alter_table() will be called to roll back changes for
    all partitions. This means that commit_inplace_alter_table() might be
    called without prepare_inplace_alter_table() having been called first
    for a given partition.

    @param    altered_table     TABLE object for new version of table.
    @param    ha_alter_info     Structure describing changes to be done
                                by ALTER TABLE and holding data used
                                during in-place alter.

    @retval   true              Error
    @retval   false             Success
 */
 virtual bool prepare_inplace_alter_table(TABLE *altered_table,
                                          Alter_inplace_info *ha_alter_info)
 { return false; }


 /**
    Alter the table structure in-place with operations specified using HA_ALTER_FLAGS
    and Alter_inplace_info. The level of concurrency allowed during this
    operation depends on the return value from check_if_supported_inplace_alter().

    @note Storage engines are responsible for reporting any errors by
    calling my_error()/print_error()

    @note If this function reports error, commit_inplace_alter_table()
    will be called with commit= false.

    @param    altered_table     TABLE object for new version of table.
    @param    ha_alter_info     Structure describing changes to be done
                                by ALTER TABLE and holding data used
                                during in-place alter.

    @retval   true              Error
    @retval   false             Success
 */
 virtual bool inplace_alter_table(TABLE *altered_table,
                                  Alter_inplace_info *ha_alter_info)
 { return false; }


 /**
    Commit or rollback the changes made during prepare_inplace_alter_table()
    and inplace_alter_table() inside the storage engine.
    Note that in case of rollback the allowed level of concurrency during
    this operation will be the same as for inplace_alter_table() and thus
    might be higher than during prepare_inplace_alter_table(). (For example,
    concurrent writes were blocked during prepare, but might not be during
    rollback).

    @note Storage engines are responsible for reporting any errors by
    calling my_error()/print_error()

    @note If this function with commit= true reports error, it will be called
    again with commit= false.

    @note In case of partitioning, this function might be called for rollback
    without prepare_inplace_alter_table() having been called first.
    Also partitioned tables sets ha_alter_info->group_commit_ctx to a NULL
    terminated array of the partitions handlers and if all of them are
    committed as one, then group_commit_ctx should be set to NULL to indicate
    to the partitioning handler that all partitions handlers are committed.
    @see prepare_inplace_alter_table().

    @param    altered_table     TABLE object for new version of table.
    @param    ha_alter_info     Structure describing changes to be done
                                by ALTER TABLE and holding data used
                                during in-place alter.
    @param    commit            True => Commit, False => Rollback.

    @retval   true              Error
    @retval   false             Success
 */
 virtual bool commit_inplace_alter_table(TABLE *altered_table,
                                         Alter_inplace_info *ha_alter_info,
                                         bool commit)
{
  /* Nothing to commit/rollback, mark all handlers committed! */
  ha_alter_info->group_commit_ctx= NULL;
  return false;
}

public:
 /* End of On-line/in-place ALTER TABLE interface. */


  /**
    use_hidden_primary_key() is called in case of an update/delete when
    (table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
    but we don't have a primary key
  */
  virtual void use_hidden_primary_key();
  virtual alter_table_operations alter_table_flags(alter_table_operations flags)
  {
    if (ht->alter_table_flags)
      return ht->alter_table_flags(flags);
    return 0;
  }

  virtual LEX_CSTRING *engine_name();
  
  TABLE* get_table() { return table; }
  TABLE_SHARE* get_table_share() { return table_share; }
protected:
  /* Service methods for use by storage engines. */
  THD *ha_thd(void) const;

  /**
    Acquire the instrumented table information from a table share.
    @return an instrumented table share, or NULL.
  */
  PSI_table_share *ha_table_share_psi() const;

  /**
    Default rename_table() and delete_table() rename/delete files with a
    given name and extensions from bas_ext().

    These methods can be overridden, but their default implementation
    provide useful functionality.
  */
  virtual int rename_table(const char *from, const char *to);


public:
  /**
    Delete a table in the engine. Called for base as well as temporary
    tables.
  */
  virtual int delete_table(const char *name);
  bool check_table_binlog_row_based();
  bool prepare_for_row_logging();
  int prepare_for_insert(bool do_create);
  int binlog_log_row(TABLE *table,
                     const uchar *before_record,
                     const uchar *after_record,
                     Log_func *log_func);

  inline void clear_cached_table_binlog_row_based_flag()
  {
    check_table_binlog_row_based_done= 0;
  }
  virtual void handler_stats_updated() {}

  inline void ha_handler_stats_reset()
  {
    handler_stats= &active_handler_stats;
    active_handler_stats.reset();
    active_handler_stats.active= 1;
    handler_stats_updated();
  }
  inline void ha_handler_stats_disable()
  {
    if (handler_stats)
    {
      handler_stats= 0;
      active_handler_stats.active= 0;
      handler_stats_updated();
    }
  }

private:
  /* Cache result to avoid extra calls */
  inline void mark_trx_read_write()
  {
    if (unlikely(!mark_trx_read_write_done))
    {
      mark_trx_read_write_done= 1;
      mark_trx_read_write_internal();
    }
  }

private:
  void mark_trx_read_write_internal();
  bool check_table_binlog_row_based_internal();

  int create_lookup_handler();
  void alloc_lookup_buffer();
  int check_duplicate_long_entries(const uchar *new_rec);
  int check_duplicate_long_entries_update(const uchar *new_rec);
  int check_duplicate_long_entry_key(const uchar *new_rec, uint key_no);
  /** PRIMARY KEY/UNIQUE WITHOUT OVERLAPS check */
  int ha_check_overlaps(const uchar *old_data, const uchar* new_data);

protected:
  /*
    These are intended to be used only by handler::ha_xxxx() functions
    However, engines that implement read_range_XXX() (like MariaRocks)
    or embed other engines (like ha_partition) may need to call these also
  */
  inline void increment_statistics(ulong SSV::*offset) const;
  inline void decrement_statistics(ulong SSV::*offset) const;

private:
  /*
    Low-level primitives for storage engines.  These should be
    overridden by the storage engine class. To call these methods, use
    the corresponding 'ha_*' method above.
  */

  virtual int open(const char *name, int mode, uint test_if_locked)=0;
  /* Note: ha_index_read_idx_map() may bypass index_init() */
  virtual int index_init(uint idx, bool sorted) { return 0; }
  virtual int index_end() { return 0; }
  /**
    rnd_init() can be called two times without rnd_end() in between
    (it only makes sense if scan=1).
    then the second call should prepare for the new table scan (e.g
    if rnd_init allocates the cursor, second call should position it
    to the start of the table, no need to deallocate and allocate it again
  */
  virtual int rnd_init(bool scan)= 0;
  virtual int rnd_end() { return 0; }
  virtual int write_row(const uchar *buf __attribute__((unused)))
  {
    return HA_ERR_WRONG_COMMAND;
  }

  /**
    Update a single row.

    Note: If HA_ERR_FOUND_DUPP_KEY is returned, the handler must read
    all columns of the row so MySQL can create an error message. If
    the columns required for the error message are not read, the error
    message will contain garbage.
  */
  virtual int update_row(const uchar *old_data __attribute__((unused)),
                         const uchar *new_data __attribute__((unused)))
  {
    return HA_ERR_WRONG_COMMAND;
  }

  /*
    Optimized function for updating the first row. Only used by sequence
    tables
  */
  virtual int update_first_row(const uchar *new_data);

  virtual int delete_row(const uchar *buf __attribute__((unused)))
  {
    return HA_ERR_WRONG_COMMAND;
  }

  /* Perform initialization for a direct update request */
public:
  int ha_direct_update_rows(ha_rows *update_rows, ha_rows *found_rows);
  virtual int direct_update_rows_init(List<Item> *update_fields)
  {
    return HA_ERR_WRONG_COMMAND;
  }
private:
  virtual int pre_direct_update_rows_init(List<Item> *update_fields)
  {
    return HA_ERR_WRONG_COMMAND;
  }
  virtual int direct_update_rows(ha_rows *update_rows __attribute__((unused)),
                                 ha_rows *found_rows __attribute__((unused)))
  {
    return HA_ERR_WRONG_COMMAND;
  }
  virtual int pre_direct_update_rows()
  {
    return HA_ERR_WRONG_COMMAND;
  }

  /* Perform initialization for a direct delete request */
public:
  int ha_direct_delete_rows(ha_rows *delete_rows);
  virtual int direct_delete_rows_init()
  {
    return HA_ERR_WRONG_COMMAND;
  }
private:
  virtual int pre_direct_delete_rows_init()
  {
    return HA_ERR_WRONG_COMMAND;
  }
  virtual int direct_delete_rows(ha_rows *delete_rows __attribute__((unused)))
  {
    return HA_ERR_WRONG_COMMAND;
  }
  virtual int pre_direct_delete_rows()
  {
    return HA_ERR_WRONG_COMMAND;
  }

  /**
    Reset state of file to after 'open'.
    This function is called after every statement for all tables used
    by that statement.
  */
  virtual int reset() { return 0; }
  virtual Table_flags table_flags(void) const= 0;
  /**
    Is not invoked for non-transactional temporary tables.

    Tells the storage engine that we intend to read or write data
    from the table. This call is prefixed with a call to handler::store_lock()
    and is invoked only for those handler instances that stored the lock.

    Calls to rnd_init/index_init are prefixed with this call. When table
    IO is complete, we call external_lock(F_UNLCK).
    A storage engine writer should expect that each call to
    ::external_lock(F_[RD|WR]LOCK is followed by a call to
    ::external_lock(F_UNLCK). If it is not, it is a bug in MySQL.

    The name and signature originate from the first implementation
    in MyISAM, which would call fcntl to set/clear an advisory
    lock on the data file in this method.

    @param   lock_type    F_RDLCK, F_WRLCK, F_UNLCK

    @return  non-0 in case of failure, 0 in case of success.
    When lock_type is F_UNLCK, the return value is ignored.
  */
  virtual int external_lock(THD *thd __attribute__((unused)),
                            int lock_type __attribute__((unused)))
  {
    return 0;
  }
  virtual void release_auto_increment() { return; };
  /** admin commands - called from mysql_admin_table */
  virtual int check_for_upgrade(HA_CHECK_OPT *check_opt)
  { return 0; }
  virtual int check(THD* thd, HA_CHECK_OPT* check_opt)
  { return HA_ADMIN_NOT_IMPLEMENTED; }

  /**
     In this method check_opt can be modified
     to specify CHECK option to use to call check()
     upon the table.
  */
  virtual int repair(THD* thd, HA_CHECK_OPT* check_opt)
  {
    DBUG_ASSERT(!(ha_table_flags() & HA_CAN_REPAIR));
    return HA_ADMIN_NOT_IMPLEMENTED;
  }
protected:
  virtual void start_bulk_insert(ha_rows rows, uint flags) {}
  virtual int end_bulk_insert() { return 0; }
  virtual int index_read(uchar * buf, const uchar * key, uint key_len,
                         enum ha_rkey_function find_flag)
   { return  HA_ERR_WRONG_COMMAND; }
  virtual int index_read_last(uchar * buf, const uchar * key, uint key_len)
  {
    my_errno= HA_ERR_WRONG_COMMAND;
    return HA_ERR_WRONG_COMMAND;
  }
  friend class ha_partition;
  friend class ha_sequence;
public:
  /**
    This method is similar to update_row, however the handler doesn't need
    to execute the updates at this point in time. The handler can be certain
    that another call to bulk_update_row will occur OR a call to
    exec_bulk_update before the set of updates in this query is concluded.

    @param    old_data       Old record
    @param    new_data       New record
    @param    dup_key_found  Number of duplicate keys found

    @retval  0   Bulk delete used by handler
    @retval  1   Bulk delete not used, normal operation used
  */
  virtual int bulk_update_row(const uchar *old_data, const uchar *new_data,
                              ha_rows *dup_key_found)
  {
    DBUG_ASSERT(FALSE);
    return HA_ERR_WRONG_COMMAND;
  }
  /**
    This is called to delete all rows in a table
    If the handler don't support this, then this function will
    return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one
    by one.
  */
  virtual int delete_all_rows()
  { return (my_errno=HA_ERR_WRONG_COMMAND); }
  /**
    Quickly remove all rows from a table.

    @remark This method is responsible for implementing MySQL's TRUNCATE
            TABLE statement, which is a DDL operation. As such, a engine
            can bypass certain integrity checks and in some cases avoid
            fine-grained locking (e.g. row locks) which would normally be
            required for a DELETE statement.

    @remark Typically, truncate is not used if it can result in integrity
            violation. For example, truncate is not used when a foreign
            key references the table, but it might be used if foreign key
            checks are disabled.

    @remark Engine is responsible for resetting the auto-increment counter.

    @remark The table is locked in exclusive mode.
  */
  virtual int truncate()
  {
    int error= delete_all_rows();
    return error ? error : reset_auto_increment(0);
  }
  /**
    Reset the auto-increment counter to the given value, i.e. the next row
    inserted will get the given value.
  */
  virtual int reset_auto_increment(ulonglong value)
  { return 0; }
  virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt)
  { return HA_ADMIN_NOT_IMPLEMENTED; }
  virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt)
  { return HA_ADMIN_NOT_IMPLEMENTED; }
  virtual bool check_and_repair(THD *thd) { return TRUE; }
  virtual int disable_indexes(key_map map, bool persist) { return HA_ERR_WRONG_COMMAND; }
  virtual int enable_indexes(key_map map, bool persist) { return HA_ERR_WRONG_COMMAND; }
  virtual int discard_or_import_tablespace(my_bool discard)
  { return (my_errno=HA_ERR_WRONG_COMMAND); }
  virtual void drop_table(const char *name);
  virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0;

  virtual int create_partitioning_metadata(const char *name,
                                           const char *old_name,
                                           chf_create_flags action_flag)
  { return FALSE; }

  virtual int change_partitions(HA_CREATE_INFO *create_info,
                                const char *path,
                                ulonglong * const copied,
                                ulonglong * const deleted,
                                const uchar *pack_frm_data,
                                size_t pack_frm_len)
  { return HA_ERR_WRONG_COMMAND; }
  /* @return true if it's necessary to switch current statement log format from
   STATEMENT to ROW if binary log format is MIXED and autoincrement values
   are changed in the statement */
  virtual bool autoinc_lock_mode_stmt_unsafe() const
  { return false; }
  virtual int drop_partitions(const char *path)
  { return HA_ERR_WRONG_COMMAND; }
  virtual int rename_partitions(const char *path)
  { return HA_ERR_WRONG_COMMAND; }
  virtual bool set_ha_share_ref(Handler_share **arg_ha_share)
  {
    DBUG_ASSERT(!ha_share);
    DBUG_ASSERT(arg_ha_share);
    if (ha_share || !arg_ha_share)
      return true;
    ha_share= arg_ha_share;
    return false;
  }
  void set_table(TABLE* table_arg) { table= table_arg; }
  int get_lock_type() const { return m_lock_type; }
public:
  /* XXX to be removed, see ha_partition::partition_ht() */
  virtual handlerton *partition_ht() const
  { return ht; }
  virtual bool partition_engine() { return 0;}
  /*
    Used with 'wrapper' engines, like SEQUENCE, to access to the
    underlaying engine used for storage.
  */
  virtual handlerton *storage_ht() const
  { return ht; }
  inline int ha_write_tmp_row(uchar *buf);
  inline int ha_delete_tmp_row(uchar *buf);
  inline int ha_update_tmp_row(const uchar * old_data, uchar * new_data);

  virtual void set_lock_type(enum thr_lock_type lock);
  friend check_result_t handler_index_cond_check(void* h_arg);
  friend check_result_t handler_rowid_filter_check(void *h_arg);

  /**
    Find unique record by index or unique constrain

    @param record        record to find (also will be fillded with
                         actual record fields)
    @param unique_ref    index or unique constraiun number (depends
                         on what used in the engine

    @retval -1 Error
    @retval  1 Not found
    @retval  0 Found
  */
  virtual int find_unique_row(uchar *record, uint unique_ref)
  { return -1; /*unsupported */}

  bool native_versioned() const
  { DBUG_ASSERT(ht); return partition_ht()->flags & HTON_NATIVE_SYS_VERSIONING; }
  virtual void update_partition(uint	part_id)
  {}

  /**
    Some engines can perform column type conversion with ALGORITHM=INPLACE.
    These functions check for such possibility.
    Implementation could be based on Field_xxx::is_equal()
   */
  virtual bool can_convert_nocopy(const Field &,
                                  const Column_definition &) const
  {
    return false;
  }
  /* If the table is using sql level unique constraints on some column */
  inline bool has_long_unique();

  /* Used for ALTER TABLE.
  Some engines can handle some differences in indexes by themself. */
  virtual Compare_keys compare_key_parts(const Field &old_field,
                                         const Column_definition &new_field,
                                         const KEY_PART_INFO &old_part,
                                         const KEY_PART_INFO &new_part) const;


/*
  If lower_case_table_names == 2 (case-preserving but case-insensitive
  file system) and the storage is not HA_FILE_BASED, we need to provide
  a lowercase file name for the engine.
*/
  inline bool needs_lower_case_filenames()
  {
    return (lower_case_table_names == 2 && !(ha_table_flags() & HA_FILE_BASED));
  }

  bool log_not_redoable_operation(const char *operation);

protected:
  Handler_share *get_ha_share_ptr();
  void set_ha_share_ptr(Handler_share *arg_ha_share);
  void lock_shared_ha_data();
  void unlock_shared_ha_data();
};

#include "multi_range_read.h"
#include "group_by_handler.h"

bool key_uses_partial_cols(TABLE_SHARE *table, uint keyno);

	/* Some extern variables used with handlers */

extern const LEX_CSTRING ha_row_type[];
extern MYSQL_PLUGIN_IMPORT const char *tx_isolation_names[];
extern MYSQL_PLUGIN_IMPORT const char *binlog_format_names[];
extern TYPELIB tx_isolation_typelib;
extern const char *myisam_stats_method_names[];
extern ulong total_ha, total_ha_2pc;

/* lookups */
plugin_ref ha_resolve_by_name(THD *thd, const LEX_CSTRING *name, bool tmp_table);
plugin_ref ha_lock_engine(THD *thd, const handlerton *hton);
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type);
handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
                         handlerton *db_type);
handlerton *ha_checktype(THD *thd, handlerton *hton, bool no_substitute);

static inline handlerton *ha_checktype(THD *thd, enum legacy_db_type type,
                                       bool no_substitute = 0)
{
  return ha_checktype(thd, ha_resolve_by_legacy_type(thd, type), no_substitute);
}

static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type)
{
  return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type;
}

static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type)
{
  return (db_type == NULL ? "UNKNOWN" :
          db_type == view_pseudo_hton ? "VIEW" : hton_name(db_type)->str);
}

static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag)
{
  return db_type && (db_type->flags & flag);
}

static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
{
  return db_type && db_type->create;
}

/* basic stuff */
int ha_init_errors(void);
int ha_init(void);
int ha_end(void);
int ha_initialize_handlerton(void *plugin);
int ha_finalize_handlerton(void *plugin);

TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
void ha_close_connection(THD* thd);
void ha_kill_query(THD* thd, enum thd_kill_levels level);
void ha_signal_ddl_recovery_done();
bool ha_flush_logs();
void ha_drop_database(const char* path);
void ha_checkpoint_state(bool disable);
void ha_commit_checkpoint_request(void *cookie, void (*pre_hook)(void *));
int ha_create_table(THD *thd, const char *path, const char *db,
                    const char *table_name, HA_CREATE_INFO *create_info,
                    LEX_CUSTRING *frm, bool skip_frm_file);
int ha_delete_table(THD *thd, handlerton *db_type, const char *path,
                    const LEX_CSTRING *db, const LEX_CSTRING *alias,
                    bool generate_warning);
int ha_delete_table_force(THD *thd, const char *path, const LEX_CSTRING *db,
                          const LEX_CSTRING *alias);

void ha_prepare_for_backup();
void ha_end_backup();
void ha_pre_shutdown();

void ha_disable_internal_writes(bool disable);

/* statistics and info */
bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat);

/* discovery */
#ifdef MYSQL_SERVER
class Discovered_table_list: public handlerton::discovered_list
{
  THD *thd;
  const char *wild, *wend;
  bool with_temps; // whether to include temp tables in the result
public:
  Dynamic_array<LEX_CSTRING*> *tables;

  Discovered_table_list(THD *thd_arg, Dynamic_array<LEX_CSTRING*> *tables_arg,
                        const LEX_CSTRING *wild_arg);
  Discovered_table_list(THD *thd_arg, Dynamic_array<LEX_CSTRING*> *tables_arg)
    : thd(thd_arg), wild(NULL), with_temps(true), tables(tables_arg) {}
  ~Discovered_table_list() = default;

  bool add_table(const char *tname, size_t tlen) override;
  bool add_file(const char *fname) override;

  void sort();
  void remove_duplicates(); // assumes that the list is sorted
#ifndef DBUG_OFF
  /*
     Used to find unstable mtr tests querying
     INFORMATION_SCHEMA.TABLES without ORDER BY.
  */
  void sort_desc();
#endif /* DBUG_OFF */
};

int ha_discover_table(THD *thd, TABLE_SHARE *share);
int ha_discover_table_names(THD *thd, LEX_CSTRING *db, MY_DIR *dirp,
                            Discovered_table_list *result, bool reusable);
bool ha_table_exists(THD *thd, const LEX_CSTRING *db,
                     const LEX_CSTRING *table_name,
                     LEX_CUSTRING *table_version= 0,
                     LEX_CSTRING *partition_engine_name= 0,
                     handlerton **hton= 0, bool *is_sequence= 0);
bool ha_check_if_updates_are_ignored(THD *thd, handlerton *hton,
                                     const char *op);
#endif /* MYSQL_SERVER */

/* key cache */
extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_repartition_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);

/* transactions: interface to handlerton functions */
int ha_start_consistent_snapshot(THD *thd);
int ha_commit_or_rollback_by_xid(XID *xid, bool commit);
int ha_commit_one_phase(THD *thd, bool all);
int ha_commit_trans(THD *thd, bool all);
int ha_rollback_trans(THD *thd, bool all);
int ha_prepare(THD *thd);
int ha_recover(HASH *commit_list, MEM_ROOT *mem_root= NULL);
uint ha_recover_complete(HASH *commit_list, Binlog_offset *coord= NULL);

/* transactions: these functions never call handlerton functions directly */
int ha_enable_transaction(THD *thd, bool on);

/* savepoints */
int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv);
bool ha_rollback_to_savepoint_can_release_mdl(THD *thd);
int ha_savepoint(THD *thd, SAVEPOINT *sv);
int ha_release_savepoint(THD *thd, SAVEPOINT *sv);
#ifdef WITH_WSREP
int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal);
#endif

/* these are called by storage engines */
void trans_register_ha(THD *thd, bool all, handlerton *ht,
                       ulonglong trxid);

/*
  Storage engine has to assume the transaction will end up with 2pc if
   - there is more than one 2pc-capable storage engine available
   - in the current transaction 2pc was not disabled yet
*/
#define trans_need_2pc(thd, all)                   ((total_ha_2pc > 1) && \
        !((all ? &thd->transaction.all : &thd->transaction.stmt)->no_2pc))

const char *get_canonical_filename(handler *file, const char *path,
                                   char *tmp_path);
void commit_checkpoint_notify_ha(void *cookie);

inline const LEX_CSTRING *table_case_name(HA_CREATE_INFO *info, const LEX_CSTRING *name)
{
  return ((lower_case_table_names == 2 && info->alias.str) ? &info->alias : name);
}

typedef bool Log_func(THD*, TABLE*, bool, const uchar*, const uchar*);
int binlog_log_row(TABLE* table,
                   const uchar *before_record,
                   const uchar *after_record,
                   Log_func *log_func);

/**
  @def MYSQL_TABLE_IO_WAIT
  Instrumentation helper for table io_waits.
  Note that this helper is intended to be used from
  within the handler class only, as it uses members
  from @c handler
  Performance schema events are instrumented as follows:
  - in non batch mode, one event is generated per call
  - in batch mode, the number of rows affected is saved
  in @c m_psi_numrows, so that @c end_psi_batch_mode()
  generates a single event for the batch.
  @param OP the table operation to be performed
  @param INDEX the table index used if any, or MAX_KEY.
  @param PAYLOAD instrumented code to execute
  @sa handler::end_psi_batch_mode.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
  #define MYSQL_TABLE_IO_WAIT(OP, INDEX, RESULT, PAYLOAD)     \
    {                                                         \
      if (m_psi != NULL)                                      \
      {                                                       \
        switch (m_psi_batch_mode)                             \
        {                                                     \
          case PSI_BATCH_MODE_NONE:                           \
          {                                                   \
            PSI_table_locker *sub_locker= NULL;               \
            PSI_table_locker_state reentrant_safe_state;      \
            sub_locker= PSI_TABLE_CALL(start_table_io_wait)   \
              (& reentrant_safe_state, m_psi, OP, INDEX,      \
               __FILE__, __LINE__);                           \
            PAYLOAD                                           \
            if (sub_locker != NULL)                           \
              PSI_TABLE_CALL(end_table_io_wait)               \
                (sub_locker, 1);                              \
            break;                                            \
          }                                                   \
          case PSI_BATCH_MODE_STARTING:                       \
          {                                                   \
            m_psi_locker= PSI_TABLE_CALL(start_table_io_wait) \
              (& m_psi_locker_state, m_psi, OP, INDEX,        \
               __FILE__, __LINE__);                           \
            PAYLOAD                                           \
            if (!RESULT)                                      \
              m_psi_numrows++;                                \
            m_psi_batch_mode= PSI_BATCH_MODE_STARTED;         \
            break;                                            \
          }                                                   \
          case PSI_BATCH_MODE_STARTED:                        \
          default:                                            \
          {                                                   \
            DBUG_ASSERT(m_psi_batch_mode                      \
                        == PSI_BATCH_MODE_STARTED);           \
            PAYLOAD                                           \
            if (!RESULT)                                      \
              m_psi_numrows++;                                \
            break;                                            \
          }                                                   \
        }                                                     \
      }                                                       \
      else                                                    \
      {                                                       \
        PAYLOAD                                               \
      }                                                       \
    }
#else
  #define MYSQL_TABLE_IO_WAIT(OP, INDEX, RESULT, PAYLOAD) \
    PAYLOAD
#endif

#define TABLE_IO_WAIT(TRACKER, OP, INDEX, RESULT, PAYLOAD) \
  { \
    Exec_time_tracker *this_tracker; \
    if (unlikely((this_tracker= tracker))) \
      tracker->start_tracking(table->in_use); \
    \
    MYSQL_TABLE_IO_WAIT(OP, INDEX, RESULT, PAYLOAD); \
    \
    if (unlikely(this_tracker)) \
      tracker->stop_tracking(table->in_use); \
  }
void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag);
void print_keydup_error(TABLE *table, KEY *key, myf errflag);

int del_global_index_stat(THD *thd, TABLE* table, KEY* key_info);
int del_global_table_stat(THD *thd, const  LEX_CSTRING *db, const LEX_CSTRING *table);
uint ha_count_rw_all(THD *thd, Ha_trx_info **ptr_ha_info);
bool non_existing_table_error(int error);
uint ha_count_rw_2pc(THD *thd, bool all);
uint ha_check_and_coalesce_trx_read_only(THD *thd, Ha_trx_info *ha_list,
                                         bool all);

int get_select_field_pos(Alter_info *alter_info, int select_field_count,
                         bool versioned);

#ifndef DBUG_OFF
String dbug_format_row(TABLE *table, const uchar *rec, bool print_names= true);
#endif /* DBUG_OFF */
#endif /* HANDLER_INCLUDED */
server/private/mysqld_suffix.h000064400000002261150400263730012573 0ustar00#ifndef MYSQLD_SUFFIX_INCLUDED
#define MYSQLD_SUFFIX_INCLUDED

/* Copyright (c) 2000-2004, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

/**
  @file

  Set MYSQL_SERVER_SUFFIX_STR.

  The following code is quite ugly as there is no portable way to easily set a
  string to the value of a macro
*/

#ifdef MYSQL_SERVER_SUFFIX
#define MYSQL_SERVER_SUFFIX_STR STRINGIFY_ARG(MYSQL_SERVER_SUFFIX)
#else
#define MYSQL_SERVER_SUFFIX_STR MYSQL_SERVER_SUFFIX_DEF
#endif
#endif /* MYSQLD_SUFFIX_INCLUDED */
server/private/item_jsonfunc.h000064400000053764150400263730012557 0ustar00#ifndef ITEM_JSONFUNC_INCLUDED
#define ITEM_JSONFUNC_INCLUDED

/* Copyright (c) 2016, 2021, MariaDB

   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-1301  USA */


/* This file defines all JSON functions */


#include <json_lib.h>
#include "item_cmpfunc.h"      // Item_bool_func
#include "item_strfunc.h"      // Item_str_func
#include "item_sum.h"
#include "sql_type_json.h"

class json_path_with_flags
{
public:
  json_path_t p;
  bool constant;
  bool parsed;
  json_path_step_t *cur_step;
  void set_constant_flag(bool s_constant)
  {
    constant= s_constant;
    parsed= FALSE;
  }
};


void report_path_error_ex(const char *ps, json_path_t *p,
                          const char *fname, int n_param,
                          Sql_condition::enum_warning_level lv);
void report_json_error_ex(const char *js, json_engine_t *je,
                          const char *fname, int n_param,
                          Sql_condition::enum_warning_level lv);

class Json_engine_scan: public json_engine_t
{
public:
  Json_engine_scan(CHARSET_INFO *i_cs, const uchar *str, const uchar *end)
  {
    json_scan_start(this, i_cs, str, end);
  }
  Json_engine_scan(const String &str)
   :Json_engine_scan(str.charset(), (const uchar *) str.ptr(),
                                    (const uchar *) str.end())
  { }
  bool check_and_get_value_scalar(String *res, int *error);
  bool check_and_get_value_complex(String *res, int *error);
};


class Json_path_extractor: public json_path_with_flags
{
protected:
  String tmp_js, tmp_path;
  virtual ~Json_path_extractor() { }
  virtual bool check_and_get_value(Json_engine_scan *je,
                                   String *to, int *error)=0;
  bool extract(String *to, Item *js, Item *jp, CHARSET_INFO *cs);
};


class Item_func_json_valid: public Item_bool_func
{
protected:
  String tmp_value;

public:
  Item_func_json_valid(THD *thd, Item *json) : Item_bool_func(thd, json) {}
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_valid") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    if (Item_bool_func::fix_length_and_dec())
      return TRUE;
    set_maybe_null();
    return FALSE;
  }
  bool set_format_by_check_constraint(Send_field_extended_metadata *to) const
    override
  {
    static const Lex_cstring fmt(STRING_WITH_LEN("json"));
    return to->set_format_name(fmt);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_valid>(thd, this); }
  enum Functype functype() const override { return JSON_VALID_FUNC; }
};


class Item_func_json_exists: public Item_bool_func
{
protected:
  json_path_with_flags path;
  String tmp_js, tmp_path;

public:
  Item_func_json_exists(THD *thd, Item *js, Item *i_path):
    Item_bool_func(thd, js, i_path) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_exists") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_exists>(thd, this); }
  bool val_bool() override;
};


class Item_json_func: public Item_str_func
{
public:
  Item_json_func(THD *thd)
   :Item_str_func(thd) { }
  Item_json_func(THD *thd, Item *a)
   :Item_str_func(thd, a) { }
  Item_json_func(THD *thd, Item *a, Item *b)
   :Item_str_func(thd, a, b) { }
  Item_json_func(THD *thd, List<Item> &list)
   :Item_str_func(thd, list) { }
  const Type_handler *type_handler() const override
  {
    return Type_handler_json_common::json_type_handler(max_length);
  }
};


class Item_func_json_value: public Item_str_func,
                            public Json_path_extractor
{

public:
  Item_func_json_value(THD *thd, Item *js, Item *i_path):
    Item_str_func(thd, js, i_path) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_value") };
    return name;
  }
  bool fix_length_and_dec() override ;
  String *val_str(String *to) override
  {
    null_value= Json_path_extractor::extract(to, args[0], args[1],
                                             collation.collation);
    return null_value ? NULL : to;
  }
  bool check_and_get_value(Json_engine_scan *je,
                           String *res, int *error) override
  {
    return je->check_and_get_value_scalar(res, error);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_value>(thd, this); }
};


class Item_func_json_query: public Item_json_func,
                            public Json_path_extractor
{
public:
  Item_func_json_query(THD *thd, Item *js, Item *i_path):
    Item_json_func(thd, js, i_path) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_query") };
    return name;
  }
  bool fix_length_and_dec() override;
  String *val_str(String *to) override
  {
    null_value= Json_path_extractor::extract(to, args[0], args[1],
                                             collation.collation);
    return null_value ? NULL : to;
  }
  bool check_and_get_value(Json_engine_scan *je,
                           String *res, int *error) override
  {
    return je->check_and_get_value_complex(res, error);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_query>(thd, this); }
};


class Item_func_json_quote: public Item_str_func
{
protected:
  String tmp_s;

public:
  Item_func_json_quote(THD *thd, Item *s): Item_str_func(thd, s) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_quote") };
    return name;
  }
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_quote>(thd, this); }
};


class Item_func_json_unquote: public Item_str_func
{
protected:
  String tmp_s;
  String *read_json(json_engine_t *je);
public:
  Item_func_json_unquote(THD *thd, Item *s): Item_str_func(thd, s) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_unquote") };
    return name;
  }
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_unquote>(thd, this); }
};


class Item_json_str_multipath: public Item_json_func
{
protected:
  json_path_with_flags *paths;
  String *tmp_paths;
private:
  /**
    Number of paths returned by calling virtual method get_n_paths() and
    remembered inside fix_fields(). It is used by the virtual destructor
    ~Item_json_str_multipath() to iterate along allocated memory chunks stored
    in the array tmp_paths and free every of them. The virtual method
    get_n_paths() can't be used for this goal from within virtual destructor.
    We could get rid of the virtual method get_n_paths() and store the number
    of paths directly in the constructor of classes derived from the class
    Item_json_str_multipath but presence of the method get_n_paths() allows
    to check invariant that the number of arguments not changed between
    sequential runs of the same prepared statement that seems to be useful.
  */
  uint n_paths;
public:
  Item_json_str_multipath(THD *thd, List<Item> &list):
    Item_json_func(thd, list), paths(NULL), tmp_paths(0), n_paths(0) {}
  virtual ~Item_json_str_multipath();

  bool fix_fields(THD *thd, Item **ref) override;
  virtual uint get_n_paths() const = 0;
};


class Item_func_json_extract: public Item_json_str_multipath
{
protected:
  String tmp_js;
public:
  String *read_json(String *str, json_value_types *type,
                    char **out_val, int *value_len);
  Item_func_json_extract(THD *thd, List<Item> &list):
    Item_json_str_multipath(thd, list) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_extract") };
    return name;
  }
  enum Functype functype() const override { return JSON_EXTRACT_FUNC; }
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  longlong val_int() override;
  double val_real() override;
  my_decimal *val_decimal(my_decimal *) override;
  uint get_n_paths() const override { return arg_count - 1; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_extract>(thd, this); }
};


class Item_func_json_contains: public Item_bool_func
{
protected:
  String tmp_js;
  json_path_with_flags path;
  String tmp_path;
  bool a2_constant, a2_parsed;
  String tmp_val, *val;
public:
  Item_func_json_contains(THD *thd, List<Item> &list):
    Item_bool_func(thd, list) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_contains") };
    return name;
  }
  bool fix_length_and_dec() override;
  bool val_bool() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_contains>(thd, this); }
};


class Item_func_json_contains_path: public Item_bool_func
{
protected:
  String tmp_js;
  json_path_with_flags *paths;
  String *tmp_paths;
  bool mode_one;
  bool ooa_constant, ooa_parsed;
  bool *p_found;

public:
  Item_func_json_contains_path(THD *thd, List<Item> &list):
    Item_bool_func(thd, list), tmp_paths(0) {}
  virtual ~Item_func_json_contains_path();
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_contains_path") };
    return name;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  bool val_bool() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_contains_path>(thd, this); }
};


class Item_func_json_array: public Item_json_func
{
protected:
  String tmp_val;
  ulong result_limit;
public:
  Item_func_json_array(THD *thd):
    Item_json_func(thd) {}
  Item_func_json_array(THD *thd, List<Item> &list):
    Item_json_func(thd, list) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_array") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_array>(thd, this); }
};


class Item_func_json_array_append: public Item_json_str_multipath
{
protected:
  String tmp_js;
  String tmp_val;
public:
  Item_func_json_array_append(THD *thd, List<Item> &list):
    Item_json_str_multipath(thd, list) {}
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  uint get_n_paths() const override { return arg_count/2; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_array_append") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_array_append>(thd, this); }
};


class Item_func_json_array_insert: public Item_func_json_array_append
{
public:
  Item_func_json_array_insert(THD *thd, List<Item> &list):
    Item_func_json_array_append(thd, list) {}
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_array_insert") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_array_insert>(thd, this); }
};


class Item_func_json_object: public Item_func_json_array
{
public:
  Item_func_json_object(THD *thd):
    Item_func_json_array(thd) {}
  Item_func_json_object(THD *thd, List<Item> &list):
    Item_func_json_array(thd, list) {}
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_object") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_object>(thd, this); }
};


class Item_func_json_merge: public Item_func_json_array
{
protected:
  String tmp_js1, tmp_js2;
public:
  Item_func_json_merge(THD *thd, List<Item> &list):
    Item_func_json_array(thd, list) {}
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_merge_preserve") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_merge>(thd, this); }
};

class Item_func_json_merge_patch: public Item_func_json_merge
{
public:
  Item_func_json_merge_patch(THD *thd, List<Item> &list):
    Item_func_json_merge(thd, list) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_merge_patch") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_merge_patch>(thd, this); }
};

class Item_func_json_length: public Item_long_func
{
  bool check_arguments() const override
  {
    const LEX_CSTRING name= func_name_cstring();
    if (arg_count == 0 || arg_count > 2)
    {
      my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
      return true;
    }
    return args[0]->check_type_can_return_text(name) ||
      (arg_count > 1 && args[1]->check_type_general_purpose_string(name));
  }
protected:
  json_path_with_flags path;
  String tmp_js;
  String tmp_path;
public:
  Item_func_json_length(THD *thd, List<Item> &list):
    Item_long_func(thd, list) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_length") };
    return name;
  }
  bool fix_length_and_dec() override;
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_length>(thd, this); }
};


class Item_func_json_depth: public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_text(func_name_cstring()); }
protected:
  String tmp_js;
public:
  Item_func_json_depth(THD *thd, Item *js): Item_long_func(thd, js) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_depth") };
    return name;
  }
  bool fix_length_and_dec() override { max_length= 10; return FALSE; }
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_depth>(thd, this); }
};


class Item_func_json_type: public Item_str_func
{
protected:
  String tmp_js;
public:
  Item_func_json_type(THD *thd, Item *js): Item_str_func(thd, js) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_type") };
    return name;
  }
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_type>(thd, this); }
};


class Item_func_json_insert: public Item_json_str_multipath
{
protected:
  String tmp_js;
  String tmp_val;
  bool mode_insert, mode_replace;
public:
  Item_func_json_insert(bool i_mode, bool r_mode, THD *thd, List<Item> &list):
    Item_json_str_multipath(thd, list),
      mode_insert(i_mode), mode_replace(r_mode) {}
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  uint get_n_paths() const override { return arg_count/2; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING json_set=    {STRING_WITH_LEN("json_set") };
    static LEX_CSTRING json_insert= {STRING_WITH_LEN("json_insert") };
    static LEX_CSTRING json_replace= {STRING_WITH_LEN("json_replace") };
    return (mode_insert ?
            (mode_replace ? json_set : json_insert) : json_replace);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_insert>(thd, this); }
};


class Item_func_json_remove: public Item_json_str_multipath
{
protected:
  String tmp_js;
public:
  Item_func_json_remove(THD *thd, List<Item> &list):
    Item_json_str_multipath(thd, list) {}
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  uint get_n_paths() const override { return arg_count - 1; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_remove") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_remove>(thd, this); }
};


class Item_func_json_keys: public Item_str_func
{
protected:
  json_path_with_flags path;
  String tmp_js, tmp_path;

public:
  Item_func_json_keys(THD *thd, List<Item> &list):
    Item_str_func(thd, list) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_keys") };
    return name;
  }
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_keys>(thd, this); }
};


class Item_func_json_search: public Item_json_str_multipath
{
protected:
  String tmp_js, tmp_path, esc_value;
  bool mode_one;
  bool ooa_constant, ooa_parsed;
  int escape;
  int n_path_found;
  json_path_t sav_path;

  int compare_json_value_wild(json_engine_t *je, const String *cmp_str);

public:
  Item_func_json_search(THD *thd, List<Item> &list):
    Item_json_str_multipath(thd, list) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_search") };
    return name;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  String *val_str(String *) override;
  uint get_n_paths() const override { return arg_count > 4 ? arg_count - 4 : 0; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_search>(thd, this); }
};


class Item_func_json_format: public Item_json_func
{
public:
  enum formats
  {
    NONE,
    COMPACT,
    LOOSE,
    DETAILED
  };
protected:
  formats fmt;
  String tmp_js;
public:
  Item_func_json_format(THD *thd, Item *js, formats format):
    Item_json_func(thd, js), fmt(format) {}
  Item_func_json_format(THD *thd, List<Item> &list):
    Item_json_func(thd, list), fmt(DETAILED) {}

  LEX_CSTRING func_name_cstring() const override;
  bool fix_length_and_dec() override;
  String *val_str(String *str) override;
  String *val_json(String *str) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_format>(thd, this); }
};


class Item_func_json_arrayagg : public Item_func_group_concat
{
protected:
  /*
    Overrides Item_func_group_concat::skip_nulls()
    NULL-s should be added to the result as JSON null value.
  */
  bool skip_nulls() const override { return false; }
  String *get_str_from_item(Item *i, String *tmp) override;
  String *get_str_from_field(Item *i, Field *f, String *tmp,
                             const uchar *key, size_t offset) override;
  void cut_max_length(String *result,
                      uint old_length, uint max_length) const override;
public:
  String m_tmp_json; /* Used in get_str_from_*.. */
  Item_func_json_arrayagg(THD *thd, Name_resolution_context *context_arg,
                          bool is_distinct, List<Item> *is_select,
                          const SQL_I_List<ORDER> &is_order, String *is_separator,
                          bool limit_clause, Item *row_limit, Item *offset_limit):
      Item_func_group_concat(thd, context_arg, is_distinct, is_select, is_order,
                             is_separator, limit_clause, row_limit, offset_limit)
  {
  }
  Item_func_json_arrayagg(THD *thd, Item_func_json_arrayagg *item) :
    Item_func_group_concat(thd, item) {}
  const Type_handler *type_handler() const override
  {
    return Type_handler_json_common::json_type_handler_sum(this);
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_arrayagg(") };
    return name;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  enum Sumfunctype sum_func() const override { return JSON_ARRAYAGG_FUNC; }

  String* val_str(String *str) override;

  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_arrayagg>(thd, this); }
};


class Item_func_json_objectagg : public Item_sum
{
  String result;
public:
  Item_func_json_objectagg(THD *thd, Item *key, Item *value) :
    Item_sum(thd, key, value)
  {
    quick_group= FALSE;
    result.append('{');
  }

  Item_func_json_objectagg(THD *thd, Item_func_json_objectagg *item);
  void cleanup() override;

  enum Sumfunctype sum_func () const override { return JSON_OBJECTAGG_FUNC;}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("json_objectagg") };
    return name;
  }
  const Type_handler *type_handler() const override
  {
    return Type_handler_json_common::json_type_handler_sum(this);
  }
  void clear() override;
  bool add() override;
  void reset_field() override { DBUG_ASSERT(0); }        // not used
  void update_field() override { DBUG_ASSERT(0); }       // not used
  bool fix_fields(THD *,Item **) override;

  double val_real() override { return 0.0; }
  longlong val_int() override { return 0; }
  my_decimal *val_decimal(my_decimal *decimal_value) override
  {
    my_decimal_set_zero(decimal_value);
    return decimal_value;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return get_date_from_string(thd, ltime, fuzzydate);
  }
  String* val_str(String* str) override;
  Item *copy_or_same(THD* thd) override;
  void no_rows_in_result() override {}
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_json_objectagg>(thd, this); }
};

extern bool is_json_type(const Item *item);

#endif /* ITEM_JSONFUNC_INCLUDED */
server/private/sql_type_json.h000064400000014013150400263730012565 0ustar00#ifndef SQL_TYPE_JSON_INCLUDED
#define SQL_TYPE_JSON_INCLUDED
/*
   Copyright (c) 2019, 2021 MariaDB

   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-1301  USA
*/

#include "mariadb.h"
#include "sql_type.h"


class Type_handler_json_common
{
public:
  static Virtual_column_info *make_json_valid_expr(THD *thd,
                                            const LEX_CSTRING *field_name);
  static bool make_json_valid_expr_if_needed(THD *thd, Column_definition *c);
  static bool set_format_name(Send_field_extended_metadata *to)
  {
    static const Lex_cstring fmt(STRING_WITH_LEN("json"));
    return to->set_format_name(fmt);
  }
  static const Type_handler *json_type_handler(uint max_octet_length);
  static const Type_handler *json_blob_type_handler_by_length_bytes(uint len);
  static const Type_handler *json_type_handler_sum(const Item_sum *sum);
  static const Type_handler *json_type_handler_from_generic(const Type_handler *th);
  static bool has_json_valid_constraint(const Field *field);
  static const Type_collection *type_collection();
  static bool is_json_type_handler(const Type_handler *handler)
  {
    return handler->type_collection() == type_collection();
  }
};


template <class BASE, const Named_type_handler<BASE> &thbase>
class Type_handler_general_purpose_string_to_json:
                                            public BASE,
                                            public Type_handler_json_common
{
public:
  const Type_handler *type_handler_base() const override
  {
    return &thbase;
  }
  const Type_collection *type_collection() const override
  {
    return Type_handler_json_common::type_collection();
  }
  bool Column_definition_validate_check_constraint(THD *thd,
                                                   Column_definition *c)
                                                   const override
  {
    return make_json_valid_expr_if_needed(thd, c) ||
           BASE::Column_definition_validate_check_constraint(thd, c);
  }
  bool Column_definition_data_type_info_image(Binary_string *to,
                                              const Column_definition &def)
                                              const override
  {
    /*
      Override the inherited method to avoid JSON type handlers writing any
      extended metadata to FRM. JSON type handlers are currently detected
      only by CHECK(JSON_VALID()) constraint. This may change in the future
      to do write extended metadata to FRM, for more reliable detection.
    */
    return false;
  }

  bool Item_append_extended_type_info(Send_field_extended_metadata *to,
                                      const Item *item) const override
  {
    return set_format_name(to); // Send "format=json" in the protocol
  }

  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *hybrid,
                                       Type_all_attributes *attr,
                                       Item **items, uint nitems)
                                       const override
  {
    if (BASE::Item_hybrid_func_fix_attributes(thd, name, hybrid, attr,
                                              items, nitems))
      return true;
    /*
      The above call can change the type handler on "hybrid", e.g.
      choose a proper BLOB type handler according to the calculated max_length.
      Convert general purpose string type handler to its JSON counterpart.
      This makes hybrid functions preserve JSON data types, e.g.:
        COALESCE(json_expr1, json_expr2) -> JSON
    */
    hybrid->set_handler(json_type_handler_from_generic(hybrid->type_handler()));
    return false;
  }
};


class Type_handler_string_json:
  public Type_handler_general_purpose_string_to_json<Type_handler_string,
                                                     type_handler_string>
{ };


class Type_handler_varchar_json:
  public Type_handler_general_purpose_string_to_json<Type_handler_varchar,
                                                     type_handler_varchar>
{ };

class Type_handler_tiny_blob_json:
  public Type_handler_general_purpose_string_to_json<Type_handler_tiny_blob,
                                                     type_handler_tiny_blob>
{ };

class Type_handler_blob_json:
  public Type_handler_general_purpose_string_to_json<Type_handler_blob,
                                                     type_handler_blob>
{ };


class Type_handler_medium_blob_json:
  public Type_handler_general_purpose_string_to_json<Type_handler_medium_blob,
                                                     type_handler_medium_blob>
{ };

class Type_handler_long_blob_json:
  public Type_handler_general_purpose_string_to_json<Type_handler_long_blob,
                                                     type_handler_long_blob>
{ };



extern MYSQL_PLUGIN_IMPORT
  Named_type_handler<Type_handler_string_json> type_handler_string_json;

extern MYSQL_PLUGIN_IMPORT
  Named_type_handler<Type_handler_varchar_json> type_handler_varchar_json;

extern MYSQL_PLUGIN_IMPORT
  Named_type_handler<Type_handler_tiny_blob_json> type_handler_tiny_blob_json;

extern MYSQL_PLUGIN_IMPORT
  Named_type_handler<Type_handler_blob_json> type_handler_blob_json;

extern MYSQL_PLUGIN_IMPORT
  Named_type_handler<Type_handler_medium_blob_json> type_handler_medium_blob_json;

extern MYSQL_PLUGIN_IMPORT
  Named_type_handler<Type_handler_long_blob_json> type_handler_long_blob_json;


#endif // SQL_TYPE_JSON_INCLUDED
server/private/gstream.h000064400000004605150400263730011344 0ustar00#ifndef GSTREAM_INCLUDED
#define GSTREAM_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 <my_sys.h>                             /* MY_ALLOW_ZERO_PTR */
#include "m_ctype.h"           /* my_charset_latin1, my_charset_bin */

class Gis_read_stream
{
public:
  enum enum_tok_types
  {
    unknown,
    eostream,
    word,
    numeric,
    l_bra,
    r_bra,
    comma
  };

  Gis_read_stream(CHARSET_INFO *charset, const char *buffer, int size)
    :m_cur(buffer), m_limit(buffer + size), m_err_msg(NULL), m_charset(charset)
  {}
  Gis_read_stream(): m_cur(NullS), m_limit(NullS), m_err_msg(NullS)
  {}
  ~Gis_read_stream()
  {
    my_free(m_err_msg);
  }

  enum enum_tok_types get_next_toc_type();
  bool lookup_next_word(LEX_STRING *res);
  bool get_next_word(LEX_STRING *);
  bool get_next_number(double *);
  bool check_next_symbol(char);

  inline void skip_space()
  {
    while ((m_cur < m_limit) && my_isspace(&my_charset_latin1, *m_cur))
      m_cur++;
  }
  /* Skip next character, if match. Return 1 if no match */
  inline bool skip_char(char skip)
  {
    skip_space();
    if ((m_cur >= m_limit) || *m_cur != skip)
      return 1;					/* Didn't find char */
    m_cur++;
    return 0;
  }
  /* Returns the next notempty character. */
  char next_symbol() 
  {
    skip_space();
    if (m_cur >= m_limit)
      return 0;                                 /* EOL meet. */
    return *m_cur;
  }
  void set_error_msg(const char *msg);

  // caller should free this pointer
  char *get_error_msg()
  {
    char *err_msg = m_err_msg;
    m_err_msg= NullS;
    return err_msg;
  }

protected:
  const char *m_cur;
  const char *m_limit;
  char *m_err_msg;
  CHARSET_INFO *m_charset;
};

#endif /* GSTREAM_INCLUDED */
server/private/scope.h000064400000010451150400263730011007 0ustar00/*
   Copyright (c) 2020, MariaDB

   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
*/

#pragma once

#include <type_traits>
#include <utility>

namespace detail
{

template <typename Callable> class scope_exit
{
public:
  template <typename F>
  explicit scope_exit(F &&f) : function_(std::forward<F>(f))
  {
  }

  template <typename F>
  scope_exit(F &&f, bool engaged) : function_(std::forward<F>(f)), engaged_(engaged)
  {
  }

  scope_exit(scope_exit &&rhs)
      : function_(std::move(rhs.function_)), engaged_(rhs.engaged_)
  {
    rhs.release();
  }

  scope_exit(const scope_exit &)= delete;
  scope_exit &operator=(scope_exit &&)= delete;
  scope_exit &operator=(const scope_exit &)= delete;

  void release() { engaged_= false; }
  void engage() { DBUG_ASSERT(!engaged_); engaged_= true; }

  ~scope_exit()
  {
    if (engaged_)
      function_();
  }

private:
  Callable function_;
  bool engaged_= true;
};

} // end namespace detail

template <typename Callable>
inline
::detail::scope_exit<typename std::decay<Callable>::type>
make_scope_exit(Callable &&f, bool engaged= true)
{
  return ::detail::scope_exit<typename std::decay<Callable>::type>(
      std::forward<Callable>(f), engaged);
}

#define CONCAT_IMPL(x, y) x##y
#define CONCAT(x, y) CONCAT_IMPL(x, y)
#define ANONYMOUS_VARIABLE CONCAT(_anonymous_variable, __LINE__)

#define SCOPE_EXIT auto ANONYMOUS_VARIABLE= make_scope_exit

#define IF_CLASS(C) typename std::enable_if<std::is_class<C>::value>::type
#define IF_NOT_CLASS(C) typename std::enable_if<!std::is_class<C>::value>::type

namespace detail
{

template <typename T>
class Scope_value
{
public:
  // Use SFINAE for passing structs by reference and plain types by value.
  // This ctor is defined only if T is a class or struct:
  template <typename U = T, typename = IF_CLASS(U)>
  Scope_value(T &variable, const T &scope_value)
      : variable_(&variable), saved_value_(variable)
  {
    variable= scope_value;
  }

  // This ctor is defined only if T is NOT a class or struct:
  template <typename U = T, typename = IF_NOT_CLASS(U)>
  Scope_value(T &variable, const T scope_value)
      : variable_(&variable), saved_value_(variable)
  {
    variable= scope_value;
  }

  Scope_value(Scope_value &&rhs)
      : variable_(rhs.variable_), saved_value_(rhs.saved_value_)
  {
    rhs.variable_= NULL;
  }

  Scope_value(const Scope_value &)= delete;
  Scope_value &operator=(const Scope_value &)= delete;
  Scope_value &operator=(Scope_value &&)= delete;

  ~Scope_value()
  {
    if (variable_)
      *variable_= saved_value_;
  }

private:
  T *variable_;
  T saved_value_;
};

} // namespace detail

// Use like this:
// auto _= make_scope_value(var, tmp_value);

template <typename T, typename = IF_CLASS(T)>
inline
::detail::Scope_value<T> make_scope_value(T &variable, const T &scope_value)
{
  return ::detail::Scope_value<T>(variable, scope_value);
}

template <typename T, typename = IF_NOT_CLASS(T)>
inline
::detail::Scope_value<T> make_scope_value(T &variable, T scope_value)
{
  return ::detail::Scope_value<T>(variable, scope_value);
}

/*
  Note: perfect forwarding version can not pass const:

  template <typename T, typename U>
  inline
  detail::Scope_value<T> make_scope_value(T &variable, U &&scope_value)
  {
      return detail::Scope_value<T>(variable, std::forward<U>(scope_value));
  }

  as `const U &&` fails with error `expects an rvalue for 2nd argument`. That
  happens because const U && is treated as rvalue only (this is the exact syntax
  for declaring rvalues).
*/


#define SCOPE_VALUE auto ANONYMOUS_VARIABLE= make_scope_value
#define SCOPE_SET(VAR, MASK) auto ANONYMOUS_VARIABLE= make_scope_value(VAR, VAR | MASK)
#define SCOPE_CLEAR(VAR, MASK) auto ANONYMOUS_VARIABLE= make_scope_value(VAR, VAR & ~MASK)
server/private/sql_tvc.h000064400000004562150400263730011357 0ustar00/* Copyright (c) 2017, MariaDB

   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-1301  USA */

#ifndef SQL_TVC_INCLUDED
#define SQL_TVC_INCLUDED
#include "sql_type.h"

typedef List<Item> List_item;
typedef bool (Item::*Item_processor) (void *arg);
class select_result;
class Explain_select;
class Explain_query;
class Item_func_in;
class st_select_lex_unit;
typedef class st_select_lex SELECT_LEX;
class Type_holder;

/**
  @class table_value_constr
  @brief Definition of a Table Value Construction(TVC)
	
  It contains a list of lists of values which this TVC is defined by and
  reference on SELECT where this TVC is defined.
*/
class table_value_constr : public Sql_alloc
{
public:
  List<List_item> lists_of_values;
  select_result *result;
  SELECT_LEX *select_lex;
  Type_holder *type_holders;

  enum { QEP_NOT_PRESENT_YET, QEP_AVAILABLE} have_query_plan;

  Explain_select *explain;
  ulonglong select_options;
  
  table_value_constr(List<List_item> tvc_values, SELECT_LEX *sl,
		     ulonglong select_options_arg) :
    lists_of_values(tvc_values), result(0), select_lex(sl), type_holders(0),
    have_query_plan(QEP_NOT_PRESENT_YET), explain(0),
    select_options(select_options_arg)
  { };

  ha_rows get_records() { return lists_of_values.elements; }
  
  bool prepare(THD *thd_arg, SELECT_LEX *sl, 
	       select_result *tmp_result,
	       st_select_lex_unit *unit_arg);

  bool to_be_wrapped_as_with_tail();

  int save_explain_data_intern(THD *thd_arg,
			       Explain_query *output);
  bool optimize(THD *thd_arg);
  bool exec(SELECT_LEX *sl);

  void print(THD *thd_arg, String *str, enum_query_type query_type);
  bool walk_values(Item_processor processor, bool walk_subquery, void *arg);
};

st_select_lex *wrap_tvc_with_tail(THD *thd, st_select_lex *tvc_sl);

#endif /* SQL_TVC_INCLUDED */
server/private/sql_string.h000064400000115535150400263730012074 0ustar00#ifndef SQL_STRING_INCLUDED
#define SQL_STRING_INCLUDED

/*
   Copyright (c) 2000, 2013, Oracle and/or its affiliates.
   Copyright (c) 2008, 2020, 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 */

/* This file is originally from the mysql distribution. Coded by monty */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "m_ctype.h"                            /* my_charset_bin */
#include <my_sys.h>              /* alloc_root, my_free, my_realloc */
#include "m_string.h"                           /* TRASH */
#include "sql_list.h"

class String;
#ifdef MYSQL_SERVER
extern PSI_memory_key key_memory_String_value;
#define STRING_PSI_MEMORY_KEY key_memory_String_value
#else
#define STRING_PSI_MEMORY_KEY PSI_NOT_INSTRUMENTED
#endif

typedef struct st_io_cache IO_CACHE;
typedef struct st_mem_root MEM_ROOT;
#define ASSERT_LENGTH(A) DBUG_ASSERT(str_length + (uint32) (A) <= Alloced_length)

#include "pack.h"
class Binary_string;
int sortcmp(const Binary_string *s, const Binary_string *t, CHARSET_INFO *cs);
int stringcmp(const Binary_string *s, const Binary_string *t);
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
inline uint32 copy_and_convert(char *to, size_t to_length, CHARSET_INFO *to_cs,
                               const char *from, size_t from_length,
                               CHARSET_INFO *from_cs, uint *errors)
{
  return my_convert(to, (uint)to_length, to_cs, from, (uint)from_length,
                    from_cs, errors);
}


class String_copy_status: protected MY_STRCOPY_STATUS
{
public:
  const char *source_end_pos() const
  { return m_source_end_pos; }
  const char *well_formed_error_pos() const
  { return m_well_formed_error_pos; }
};


class Well_formed_prefix_status: public String_copy_status
{
public:
  Well_formed_prefix_status(CHARSET_INFO *cs,
                            const char *str, const char *end, size_t nchars)
  { cs->well_formed_char_length(str, end, nchars, this); }
};


class Well_formed_prefix: public Well_formed_prefix_status
{
  const char *m_str; // The beginning of the string
public:
  Well_formed_prefix(CHARSET_INFO *cs, const char *str, const char *end,
                     size_t nchars)
   :Well_formed_prefix_status(cs, str, end, nchars), m_str(str)
  { }
  Well_formed_prefix(CHARSET_INFO *cs, const char *str, size_t length,
                     size_t nchars)
   :Well_formed_prefix_status(cs, str, str + length, nchars), m_str(str)
  { }
  Well_formed_prefix(CHARSET_INFO *cs, const char *str, size_t length)
   :Well_formed_prefix_status(cs, str, str + length, length), m_str(str)
  { }
  Well_formed_prefix(CHARSET_INFO *cs, LEX_CSTRING str, size_t nchars)
   :Well_formed_prefix_status(cs, str.str, str.str + str.length, nchars),
    m_str(str.str)
  { }
  size_t length() const { return m_source_end_pos - m_str; }
};


class String_copier: public String_copy_status,
                     protected MY_STRCONV_STATUS
{
public:
  const char *cannot_convert_error_pos() const
  { return m_cannot_convert_error_pos; }
  const char *most_important_error_pos() const
  {
    return well_formed_error_pos() ? well_formed_error_pos() :
                                     cannot_convert_error_pos();
  }
  /*
    Convert a string between character sets.
    "dstcs" and "srccs" cannot be &my_charset_bin.
  */
  size_t convert_fix(CHARSET_INFO *dstcs, char *dst, size_t dst_length,
                     CHARSET_INFO *srccs, const char *src, size_t src_length,
                     size_t nchars)
  {
    return my_convert_fix(dstcs, dst, dst_length,
                          srccs, src, src_length, nchars, this, this);
  }
  /*
     Copy a string. Fix bad bytes/characters to '?'.
  */
  uint well_formed_copy(CHARSET_INFO *to_cs, char *to, size_t to_length,
                        CHARSET_INFO *from_cs, const char *from,
                        size_t from_length, size_t nchars);
  // Same as above, but without the "nchars" limit.
  uint well_formed_copy(CHARSET_INFO *to_cs, char *to, size_t to_length,
                        CHARSET_INFO *from_cs, const char *from,
                        size_t from_length)
  {
    return well_formed_copy(to_cs, to, to_length,
                            from_cs, from, from_length,
                            from_length /* No limit on "nchars"*/);
  }
};


size_t my_copy_with_hex_escaping(CHARSET_INFO *cs,
                                 char *dst, size_t dstlen,
                                 const char *src, size_t srclen);
uint convert_to_printable(char *to, size_t to_len,
                          const char *from, size_t from_len,
                          CHARSET_INFO *from_cs, size_t nbytes= 0);
size_t convert_to_printable_required_length(uint len);


class Charset
{
  CHARSET_INFO *m_charset;
public:
  Charset() :m_charset(&my_charset_bin) { }
  Charset(CHARSET_INFO *cs) :m_charset(cs) { }

  CHARSET_INFO *charset() const { return m_charset; }
  bool use_mb() const { return m_charset->use_mb(); }
  uint mbminlen() const { return m_charset->mbminlen; }
  uint mbmaxlen() const { return m_charset->mbmaxlen; }
  bool is_good_for_ft() const
  {
    // Binary and UCS2/UTF16/UTF32 are not supported
    return m_charset != &my_charset_bin && m_charset->mbminlen == 1;
  }

  size_t numchars(const char *str, const char *end) const
  {
    return m_charset->numchars(str, end);
  }
  size_t lengthsp(const char *str, size_t length) const
  {
    return m_charset->lengthsp(str, length);
  }
  size_t charpos(const char *str, const char *end, size_t pos) const
  {
    return m_charset->charpos(str, end, pos);
  }
  void set_charset(CHARSET_INFO *charset_arg)
  {
    m_charset= charset_arg;
  }
  void set_charset(const Charset &other)
  {
    m_charset= other.m_charset;
  }
  void swap(Charset &other)
  {
    swap_variables(CHARSET_INFO*, m_charset, other.m_charset);
  }
  bool same_encoding(const Charset &other) const
  {
    return my_charset_same(m_charset, other.m_charset);
  }
  /*
    Collation name without the character set name.
    For example, in case of "latin1_swedish_ci",
    this method returns "_swedish_ci".
  */
  LEX_CSTRING collation_specific_name() const;
  bool encoding_allows_reinterpret_as(CHARSET_INFO *cs) const;
  bool eq_collation_specific_names(CHARSET_INFO *cs) const;
  bool can_have_collate_clause() const
  {
    return m_charset != &my_charset_bin;
  }

  /*
    The MariaDB version when the last collation change happened,
    e.g. due to a bug fix. See functions below.
  */
  static ulong latest_mariadb_version_with_collation_change()
  {
    return 110002;
  }

  /*
    Check if the collation with the given ID changed its order
    since the given MariaDB version.
  */
  static bool collation_changed_order(ulong mysql_version, uint cs_number)
  {
    if ((mysql_version < 50048 &&
           (cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */
            cs_number == 41 || /* latin7_general_ci - bug #29461 */
            cs_number == 42 || /* latin7_general_cs - bug #29461 */
            cs_number == 20 || /* latin7_estonian_cs - bug #29461 */
            cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */
            cs_number == 22 || /* koi8u_general_ci - bug #29461 */
            cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */
            cs_number == 26)) || /* cp1250_general_ci - bug #29461 */
           (mysql_version < 50124 &&
           (cs_number == 33 || /* utf8mb3_general_ci - bug #27877 */
            cs_number == 35))) /* ucs2_general_ci - bug #27877 */
        return true;

    if (cs_number == 159 && /* ucs2_general_mysql500_ci - MDEV-30746 */
        ((mysql_version >= 100400 && mysql_version < 100429) ||
         (mysql_version >= 100500 && mysql_version < 100520) ||
         (mysql_version >= 100600 && mysql_version < 100613) ||
         (mysql_version >= 100700 && mysql_version < 100708) ||
         (mysql_version >= 100800 && mysql_version < 100808) ||
         (mysql_version >= 100900 && mysql_version < 100906) ||
         (mysql_version >= 101000 && mysql_version < 101004) ||
         (mysql_version >= 101100 && mysql_version < 101103) ||
         (mysql_version >= 110000 && mysql_version < 110002)))
      return true;
    return false;
  }

  /**
     Check if a collation has changed ID since the given version.
     Return the new ID.

     @param mysql_version
     @param cs_number     - collation ID

     @retval the new collation ID (or cs_number, if no change)
  */

  static uint upgrade_collation_id(ulong mysql_version, uint cs_number)
  {
    if (mysql_version >= 50300 && mysql_version <= 50399)
    {
      switch (cs_number) {
      case 149: return MY_PAGE2_COLLATION_ID_UCS2;   // ucs2_crotian_ci
      case 213: return MY_PAGE2_COLLATION_ID_UTF8;   // utf8_crotian_ci
      }
    }
    if ((mysql_version >= 50500 && mysql_version <= 50599) ||
        (mysql_version >= 100000 && mysql_version <= 100005))
    {
      switch (cs_number) {
      case 149: return MY_PAGE2_COLLATION_ID_UCS2;   // ucs2_crotian_ci
      case 213: return MY_PAGE2_COLLATION_ID_UTF8;   // utf8_crotian_ci
      case 214: return MY_PAGE2_COLLATION_ID_UTF32;  // utf32_croatian_ci
      case 215: return MY_PAGE2_COLLATION_ID_UTF16;  // utf16_croatian_ci
      case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci
      }
    }
    return cs_number;
  }

};


/**
   Storage for strings with both length and allocated length.
   Automatically grows on demand.
*/

class Binary_string: public Sql_alloc
{
protected:
  char *Ptr;
  uint32 str_length, Alloced_length, extra_alloc;
  bool alloced, thread_specific;
  void init_private_data()
  {
    Ptr= 0;
    Alloced_length= extra_alloc= str_length= 0;
    alloced= thread_specific= false;
  }
  inline void free_buffer()
  {
    if (alloced)
    {
      alloced=0;
      my_free(Ptr);
    }
  }
public:
  Binary_string()
  {
    init_private_data();
  }
  explicit Binary_string(size_t length_arg)
  {
    init_private_data();
    (void) real_alloc(length_arg);
  }
  /*
    NOTE: If one intend to use the c_ptr() method, the following two
    contructors need the size of memory for STR to be at least LEN+1 (to make
    room for zero termination).
  */
  Binary_string(const char *str, size_t len)
  {
    Ptr= (char*) str;
    str_length= (uint32) len;
    Alloced_length= 0;                          /* Memory cannot be written to */
    extra_alloc= 0;
    alloced= thread_specific= 0;
  }
  Binary_string(char *str, size_t len)
  {
    Ptr= str;
    str_length= Alloced_length= (uint32) len;
    extra_alloc= 0;
    alloced= thread_specific= 0;
  }
  explicit Binary_string(const Binary_string &str)
  {
    Ptr= str.Ptr;
    str_length= str.str_length;
    Alloced_length= str.Alloced_length;
    extra_alloc= 0;
    alloced= thread_specific= 0;
  }

  ~Binary_string()
  {
    free();
  }

  inline uint32 length() const { return str_length;}
  inline char& operator [] (size_t i) const { return Ptr[i]; }
  inline void length(size_t len) { str_length=(uint32)len ; }
  inline bool is_empty() const { return (str_length == 0); }
  inline const char *ptr() const { return Ptr; }
  inline const char *end() const { return Ptr + str_length; }
  bool has_8bit_bytes() const
  {
    for (const char *c= ptr(), *c_end= end(); c < c_end; c++)
    {
      if (!my_isascii(*c))
        return true;
    }
    return false;
  }

  bool bin_eq(const Binary_string *other) const
  {
    return length() == other->length() &&
           !memcmp(ptr(), other->ptr(), length());
  }

  /*
    PMG 2004.11.12
    This is a method that works the same as perl's "chop". It simply
    drops the last character of a string. This is useful in the case
    of the federated storage handler where I'm building a unknown
    number, list of values and fields to be used in a sql insert
    statement to be run on the remote server, and have a comma after each.
    When the list is complete, I "chop" off the trailing comma

    ex.
      String stringobj;
      stringobj.append("VALUES ('foo', 'fi', 'fo',");
      stringobj.chop();
      stringobj.append(")");

    In this case, the value of string was:

    VALUES ('foo', 'fi', 'fo',
    VALUES ('foo', 'fi', 'fo'
    VALUES ('foo', 'fi', 'fo')
  */
  inline void chop()
  {
    if (str_length)
    {
      str_length--;
      Ptr[str_length]= '\0';
      DBUG_ASSERT(strlen(Ptr) == str_length);
    }
  }

  // Returns offset to substring or -1
  int strstr(const Binary_string &search, uint32 offset=0) const;
  int strstr(const char *search, uint32 search_length, uint32 offset=0) const;
  // Returns offset to substring or -1
  int strrstr(const Binary_string &search, uint32 offset=0) const;

  /*
    The following append operations do not extend the strings and in production
    mode do NOT check that alloced memory!
    q_*** methods writes values of parameters itself
    qs_*** methods writes string representation of value
  */
  void q_append(const char c)
  {
    ASSERT_LENGTH(1);
    Ptr[str_length++] = c;
  }
  void q_append2b(const uint32 n)
  {
    ASSERT_LENGTH(2);
    int2store(Ptr + str_length, n);
    str_length += 2;
  }
  void q_append(const uint32 n)
  {
    ASSERT_LENGTH(4);
    int4store(Ptr + str_length, n);
    str_length += 4;
  }
  void q_append(double d)
  {
    ASSERT_LENGTH(8);
    float8store(Ptr + str_length, d);
    str_length += 8;
  }
  void q_append(double *d)
  {
    ASSERT_LENGTH(8);
    float8store(Ptr + str_length, *d);
    str_length += 8;
  }
  /*
    Append a wide character.
    The caller must have allocated at least cs->mbmaxlen bytes.
  */
  int q_append_wc(my_wc_t wc, CHARSET_INFO *cs)
  {
    int mblen;
    if ((mblen= cs->cset->wc_mb(cs, wc,
                                (uchar *) end(),
                                (uchar *) end() + cs->mbmaxlen)) > 0)
      str_length+= (uint32) mblen;
    return mblen;
  }
  void q_append(const char *data, size_t data_len)
  {
    ASSERT_LENGTH(data_len);
    if (data_len)
      memcpy(Ptr + str_length, data, data_len);
    DBUG_ASSERT(str_length <= UINT_MAX32 - data_len);
    str_length += (uint)data_len;
  }
  void q_append(const LEX_CSTRING *ls)
  {
    DBUG_ASSERT(ls->length < UINT_MAX32 &&
                ((ls->length == 0 && !ls->str) ||
                 ls->length == strlen(ls->str)));
    q_append(ls->str, (uint32) ls->length);
  }

  void write_at_position(uint32 position, uint32 value)
  {
    DBUG_ASSERT(str_length >= position + 4);
    int4store(Ptr + position,value);
  }

  void qs_append(const LEX_CSTRING *ls)
  {
    DBUG_ASSERT(ls->length < UINT_MAX32 &&
                ((ls->length == 0 && !ls->str) ||
                 ls->length == strlen(ls->str)));
    qs_append(ls->str, (uint32)ls->length);
  }
  void qs_append(const char *str, size_t len);
  void qs_append_hex(const char *str, uint32 len);
  void qs_append_hex_uint32(uint32 num);
  void qs_append(double d);
  void qs_append(const double *d);
  inline void qs_append(const char c)
  {
    ASSERT_LENGTH(1);
    Ptr[str_length]= c;
    str_length++;
  }
  void qs_append(int i);
  void qs_append(uint i)
  {
    qs_append((ulonglong)i);
  }
  void qs_append(ulong i)
  {
    qs_append((ulonglong)i);
  }
  void qs_append(ulonglong i);
  void qs_append(longlong i, int radix)
  {
    ASSERT_LENGTH(22);
    char *buff= Ptr + str_length;
    char *end= ll2str(i, buff, radix, 0);
    str_length+= (uint32) (end-buff);
  }

  /* Mark variable thread specific it it's not allocated already */
  inline void set_thread_specific()
  {
    if (!alloced)
      thread_specific= 1;
  }
  bool is_alloced() const { return alloced; }
  inline uint32 alloced_length() const { return Alloced_length;}
  inline uint32 extra_allocation() const { return extra_alloc;}
  inline void extra_allocation(size_t len) { extra_alloc= (uint32)len; }
  inline void mark_as_const() { Alloced_length= 0;}

  inline bool uses_buffer_owned_by(const Binary_string *s) const
  {
    return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->Alloced_length);
  }

  /* Swap two string objects. Efficient way to exchange data without memcpy. */
  void swap(Binary_string &s)
  {
    swap_variables(char *, Ptr, s.Ptr);
    swap_variables(uint32, str_length, s.str_length);
    swap_variables(uint32, Alloced_length, s.Alloced_length);
    swap_variables(bool, alloced, s.alloced);
  }

  /**
     Points the internal buffer to the supplied one. The old buffer is freed.
     @param str Pointer to the new buffer.
     @param arg_length Length of the new buffer in characters, excluding any
            null character.
     @note The new buffer will not be null terminated.
  */
  void set_alloced(char *str, size_t length, size_t alloced_length)
  {
    free_buffer();
    Ptr= str;
    str_length= (uint32) length;
    DBUG_ASSERT(alloced_length < UINT_MAX32);
    Alloced_length= (uint32) alloced_length;
  }
  inline void set(char *str, size_t arg_length)
  {
    set_alloced(str, arg_length, arg_length);
  }
  inline void set(const char *str, size_t length)
  {
    free_buffer();
    Ptr= (char*) str;
    str_length= (uint32) length;
    Alloced_length= 0;
  }

  void set(Binary_string &str, size_t offset, size_t length)
  {
    DBUG_ASSERT(&str != this);
    free_buffer();
    Ptr= str.Ptr + offset;
    str_length= (uint32) length;
    Alloced_length= 0;
    if (str.Alloced_length)
      Alloced_length= (uint32) (str.Alloced_length - offset);
  }
  LEX_CSTRING to_lex_cstring() const
  {
    LEX_CSTRING tmp= {Ptr, str_length};
    return tmp;
  }
  inline LEX_CSTRING *get_value(LEX_CSTRING *res) const
  {
    res->str=    Ptr;
    res->length= str_length;
    return res;
  }

  /* Take over handling of buffer from some other object */
  void reset(char *ptr_arg, size_t length_arg, size_t alloced_length_arg)
  {
    set_alloced(ptr_arg, length_arg, alloced_length_arg);
    alloced= ptr_arg != 0;
  }

  /* Forget about the buffer, let some other object handle it */
  char *release()
  {
    char *old= Ptr;
    init_private_data();
    return old;
  }

  /*
    This is used to set a new buffer for String.
    However if the String already has an allocated buffer, it will
    keep that one.
    It's not to be used to set the value or length of the string.
  */
  inline void set_buffer_if_not_allocated(char *str, size_t arg_length)
  {
    if (!alloced)
    {
      /*
        Following should really set str_length= 0, but some code may
        depend on that the String length is same as buffer length.
      */
      Ptr= str;
      str_length= Alloced_length= (uint32) arg_length;
    }
    /* One should set str_length before using it */
    MEM_UNDEFINED(&str_length, sizeof(str_length));
  }

  inline Binary_string& operator=(const Binary_string &s)
  {
    if (&s != this)
    {
      /*
        It is forbidden to do assignments like
        some_string = substring_of_that_string
      */
      DBUG_ASSERT(!s.uses_buffer_owned_by(this));
      set_alloced((char *) s.Ptr, s.str_length, s.Alloced_length);
    }
    return *this;
  }

  bool set_hex(ulonglong num);
  bool set_hex(const char *str, uint32 len);
  bool set_fcvt(double num, uint decimals);

  bool copy();                                  // Alloc string if not alloced
  bool copy(const Binary_string &s);            // Allocate new string
  bool copy(const char *s, size_t arg_length);	// Allocate new string
  bool copy_or_move(const char *s,size_t arg_length);

  /**
    Convert a string to a printable format.
    All non-convertable and control characters are replaced to 5-character
    sequences '\hhhh'.
  */
  bool copy_printable_hhhh(CHARSET_INFO *to_cs,
                           CHARSET_INFO *from_cs,
                           const char *from, size_t from_length);

  bool append_ulonglong(ulonglong val);
  bool append_longlong(longlong val);

  bool append(const char *s, size_t size)
  {
    if (!size)
      return false;
    if (realloc_with_extra_if_needed(str_length + size))
      return true;
    q_append(s, size);
    return false;
  }
  bool append(const LEX_CSTRING &s)
  {
    return append(s.str, s.length);
  }
  bool append(const Binary_string &s)
  {
    return append(s.ptr(), s.length());
  }
  bool append(IO_CACHE* file, uint32 arg_length);

  inline bool append_char(char chr)
  {
    if (str_length < Alloced_length)
    {
      Ptr[str_length++]= chr;
    }
    else
    {
      if (unlikely(realloc_with_extra(str_length + 1)))
	return true;
      Ptr[str_length++]= chr;
    }
    return false;
  }
  bool append_hex(const char *src, uint32 srclen)
  {
    for (const char *src_end= src + srclen ; src != src_end ; src++)
    {
      if (unlikely(append_char(_dig_vec_lower[((uchar) *src) >> 4])) ||
          unlikely(append_char(_dig_vec_lower[((uchar) *src) & 0x0F])))
        return true;
    }
    return false;
  }
  bool append_hex_uint32(uint32 num)
  {
    if (reserve(8))
      return true;
    qs_append_hex_uint32(num);
    return false;
  }
  bool append_with_step(const char *s, uint32 arg_length, uint32 step_alloc)
  {
    uint32 new_length= arg_length + str_length;
    if (new_length > Alloced_length &&
        unlikely(realloc(new_length + step_alloc)))
      return true;
    q_append(s, arg_length);
    return false;
  }

  inline char *c_ptr()
  {
    if (unlikely(!Ptr))
      return (char*) "";
    /*
      Here we assume that any buffer used to initalize String has
      an end \0 or have at least an accessable character at end.
      This is to handle the case of String("Hello",5) and
      String("hello",5) efficiently.

      We have two options here. To test for !Alloced_length or !alloced.
      Using "Alloced_length" is slightly safer so that we do not read
      from potentially unintialized memory (normally not dangerous but
      may give warnings in valgrind), but "alloced" is safer as there
      are less change to get memory loss from code that is using
      String((char*), length) or String.set((char*), length) and does
      not free things properly (and there is several places in the code
      where this happens and it is hard to find out if any of these will call
      c_ptr().
    */
    if (unlikely(!alloced && !Ptr[str_length]))
      return Ptr;
    if (str_length < Alloced_length)
    {
      Ptr[str_length]=0;
      return Ptr;
    }
    (void) realloc(str_length);               /* This will add end \0 */
    return Ptr;
  }
  /*
    One should use c_ptr() instead for most cases. This will be deleted soon,
    kept for compatiblity.
  */
  inline char *c_ptr_quick()
  {
    return c_ptr_safe();
  }
  /*
    This is to be used only in the case when one cannot use c_ptr().
    The cases are:
    - When one initializes String with an external buffer and length and
      buffer[length] could be uninitalized when c_ptr() is called.
    - When valgrind gives warnings about uninitialized memory with c_ptr().
  */
  inline char *c_ptr_safe()
  {
    if (Ptr && str_length < Alloced_length)
      Ptr[str_length]=0;
    else
      (void) realloc(str_length);
    return Ptr;
  }

  inline void free()
  {
    free_buffer();
    /*
      We have to clear the values as some Strings, like in Field, are
      reused after free(). Because of this we cannot use MEM_UNDEFINED() here.
    */
    Ptr= 0;
    str_length= 0;
    Alloced_length= extra_alloc= 0;
  }

  inline bool alloc(size_t arg_length)
  {
    /*
      Allocate if we need more space or if we don't have done any
      allocation yet (we don't want to have Ptr to be NULL for empty strings).

      Note that if arg_length == Alloced_length then we don't allocate.
      This ensures we don't do any extra allocations in protocol and String:int,
      but the string will not be automatically null terminated if c_ptr() is not
      called.
    */
    if (arg_length <= Alloced_length && Alloced_length)
      return 0;
    return real_alloc(arg_length);
  }
  bool real_alloc(size_t arg_length);  // Empties old string
  bool realloc_raw(size_t arg_length);
  bool realloc(size_t arg_length)
  {
    if (realloc_raw(arg_length+1))
      return TRUE;
    Ptr[arg_length]= 0; // This make other funcs shorter
    return FALSE;
  }
  bool realloc_with_extra(size_t arg_length)
  {
    if (extra_alloc < 4096)
      extra_alloc= extra_alloc*2+128;
    if (realloc_raw(arg_length + extra_alloc))
      return TRUE;
    Ptr[arg_length]=0;        // This make other funcs shorter
    return FALSE;
  }
  bool realloc_with_extra_if_needed(size_t arg_length)
  {
    if (arg_length < Alloced_length)
    {
      Ptr[arg_length]=0; // behave as if realloc was called.
      return 0;
    }
    return realloc_with_extra(arg_length);
  }
  // Shrink the buffer, but only if it is allocated on the heap.
  void shrink(size_t arg_length);

  void move(Binary_string &s)
  {
    set_alloced(s.Ptr, s.str_length, s.Alloced_length);
    extra_alloc= s.extra_alloc;
    alloced= s.alloced;
    thread_specific= s.thread_specific;
    s.alloced= 0;
  }
  bool fill(size_t max_length,char fill);
  /*
    Replace substring with string
    If wrong parameter or not enough memory, do nothing
  */
  bool replace(uint32 offset,uint32 arg_length, const char *to, uint32 length);
  bool replace(uint32 offset,uint32 arg_length, const Binary_string &to)
  {
    return replace(offset,arg_length,to.ptr(),to.length());
  }

  int reserve(size_t space_needed)
  {
    DBUG_ASSERT((ulonglong) str_length + space_needed < UINT_MAX32);
    return realloc(str_length + space_needed);
  }
  int reserve(size_t space_needed, size_t grow_by);

  inline char *prep_append(uint32 arg_length, uint32 step_alloc)
  {
    uint32 new_length= arg_length + str_length;
    if (new_length > Alloced_length)
    {
      if (unlikely(realloc(new_length + step_alloc)))
        return 0;
    }
    uint32 old_length= str_length;
    str_length+= arg_length;
    return Ptr + old_length;                  // Area to use
  }


  void q_net_store_length(ulonglong length)
  {
    DBUG_ASSERT(Alloced_length >= (str_length + net_length_size(length)));
    char *pos= (char *) net_store_length((uchar *)(Ptr + str_length), length);
    str_length= uint32(pos - Ptr);
  }
  void q_net_store_data(const uchar *from, size_t length)
  {
    DBUG_ASSERT(length < UINT_MAX32);
    DBUG_ASSERT(Alloced_length >= (str_length + length +
                                   net_length_size(length)));
    q_net_store_length(length);
    q_append((const char *)from, (uint32) length);
  }
};


class String: public Charset, public Binary_string
{
public:
  String() = default;
  String(size_t length_arg) :Binary_string(length_arg)
  { }
  /*
    NOTE: If one intend to use the c_ptr() method, the following two
    contructors need the size of memory for STR to be at least LEN+1 (to make
    room for zero termination).
  */
  String(const char *str, size_t len, CHARSET_INFO *cs)
   :Charset(cs), Binary_string(str, len)
  { }
  String(char *str, size_t len, CHARSET_INFO *cs)
   :Charset(cs), Binary_string(str, len)
  { }
  String(const String &str) = default;
  String(String &&str) noexcept
   :Charset(std::move(str)), Binary_string(std::move(str)){}

  void set(String &str,size_t offset,size_t arg_length)
  {
    Binary_string::set(str, offset, arg_length);
    set_charset(str);
  }
  inline void set(char *str,size_t arg_length, CHARSET_INFO *cs)
  {
    Binary_string::set(str, arg_length);
    set_charset(cs);
  }
  inline void set(const char *str,size_t arg_length, CHARSET_INFO *cs)
  {
    Binary_string::set(str, arg_length);
    set_charset(cs);
  }
  bool set_ascii(const char *str, size_t arg_length);
  inline void set_buffer_if_not_allocated(char *str,size_t arg_length,
                                          CHARSET_INFO *cs)
  {
    Binary_string::set_buffer_if_not_allocated(str, arg_length);
    set_charset(cs);
  }
  bool set_int(longlong num, bool unsigned_flag, CHARSET_INFO *cs);
  bool set(int num, CHARSET_INFO *cs) { return set_int(num, false, cs); }
  bool set(uint num, CHARSET_INFO *cs) { return set_int(num, true, cs); }
  bool set(long num, CHARSET_INFO *cs) { return set_int(num, false, cs); }
  bool set(ulong num, CHARSET_INFO *cs) { return set_int(num, true, cs); }
  bool set(longlong num, CHARSET_INFO *cs) { return set_int(num, false, cs); }
  bool set(ulonglong num, CHARSET_INFO *cs) { return set_int((longlong)num, true, cs); }
  bool set_real(double num,uint decimals, CHARSET_INFO *cs);
  bool set_fcvt(double num, uint decimals)
  {
    set_charset(&my_charset_latin1);
    return Binary_string::set_fcvt(num, decimals);
  }

  bool set_hex(ulonglong num)
  {
    set_charset(&my_charset_latin1);
    return Binary_string::set_hex(num);
  }
  bool set_hex(const char *str, uint32 len)
  {
    set_charset(&my_charset_latin1);
    return Binary_string::set_hex(str, len);
  }

  /* Take over handling of buffer from some other object */
  void reset(char *ptr_arg, size_t length_arg, size_t alloced_length_arg,
             CHARSET_INFO *cs)
  {
    Binary_string::reset(ptr_arg, length_arg, alloced_length_arg);
    set_charset(cs);
  }

  inline String& operator = (const String &s)
  {
    if (&s != this)
    {
      set_charset(s);
      Binary_string::operator=(s);
    }
    return *this;
  }

  bool copy()
  {
    return Binary_string::copy();
  }
  bool copy(const String &s)
  {
    set_charset(s);
    return Binary_string::copy(s);
  }
  bool copy(const char *s, size_t arg_length, CHARSET_INFO *cs)
  {
    set_charset(cs);
    return Binary_string::copy(s, arg_length);
  }
  bool copy_or_move(const char *s, size_t arg_length, CHARSET_INFO *cs)
  {
    set_charset(cs);
    return Binary_string::copy_or_move(s, arg_length);
  }
  static bool needs_conversion(size_t arg_length,
  			       CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
			       uint32 *offset);
  static bool needs_conversion_on_storage(size_t arg_length,
                                          CHARSET_INFO *cs_from,
                                          CHARSET_INFO *cs_to);
  bool copy_aligned(const char *s, size_t arg_length, size_t offset,
		    CHARSET_INFO *cs);
  bool set_or_copy_aligned(const char *s, size_t arg_length, CHARSET_INFO *cs);
  bool can_be_safely_converted_to(CHARSET_INFO *tocs) const
  {
    if (charset() == &my_charset_bin)
      return Well_formed_prefix(tocs, ptr(), length()).length() == length();
    String try_val;
    uint try_conv_error= 0;
    try_val.copy(ptr(), length(), charset(), tocs, &try_conv_error);
    return try_conv_error == 0;
  }
  bool copy(const char*s, size_t arg_length, CHARSET_INFO *csfrom,
	    CHARSET_INFO *csto, uint *errors);
  bool copy(const String *str, CHARSET_INFO *tocs, uint *errors)
  {
    return copy(str->ptr(), str->length(), str->charset(), tocs, errors);
  }
  bool copy(CHARSET_INFO *tocs,
            CHARSET_INFO *fromcs, const char *src, size_t src_length,
            size_t nchars, String_copier *copier)
  {
    if (unlikely(alloc(tocs->mbmaxlen * src_length)))
      return true;
    str_length= copier->well_formed_copy(tocs, Ptr, alloced_length(),
                                         fromcs, src, (uint) src_length,
                                         (uint) nchars);
    set_charset(tocs);
    return false;
  }
  // Append without character set conversion
  bool append(const String &s)
  {
    return Binary_string::append(s);
  }
  inline bool append(char chr)
  {
    return Binary_string::append_char(chr);
  }
  bool append_hex(const char *src, uint32 srclen)
  {
    return Binary_string::append_hex(src, srclen);
  }
  bool append_hex(const uchar *src, uint32 srclen)
  {
    return Binary_string::append_hex((const char*)src, srclen);
  }
  bool append_introducer_and_hex(const String *str)
  {
    return
      append('_')   ||
      append(str->charset()->cs_name) ||
      append(STRING_WITH_LEN(" 0x")) ||
      append_hex(str->ptr(), (uint32) str->length());
  }
  bool append(IO_CACHE* file, uint32 arg_length)
  {
    return Binary_string::append(file, arg_length);
  }
  inline bool append(const char *s, uint32 arg_length, uint32 step_alloc)
  {
    return append_with_step(s, arg_length, step_alloc);
  }

  // Append with optional character set conversion from ASCII (e.g. to UCS2)
  bool append(const LEX_STRING *ls)
  {
    DBUG_ASSERT(ls->length < UINT_MAX32 &&
                ((ls->length == 0 && !ls->str) ||
                 ls->length == strlen(ls->str)));
    return append(ls->str, (uint32) ls->length);
  }
  bool append(const LEX_CSTRING *ls)
  {
    DBUG_ASSERT(ls->length < UINT_MAX32 &&
                ((ls->length == 0 && !ls->str) ||
                 ls->length == strlen(ls->str)));
    return append(ls->str, (uint32) ls->length);
  }
  bool append(const LEX_CSTRING &ls)
  {
    return append(&ls);
  }
  bool append_name_value(const LEX_CSTRING &name,
                         const LEX_CSTRING &value,
                         uchar quot= '\0')
  {
    return
      append(name) ||
      append('=') ||
      (quot && append(quot)) ||
      append(value) ||
      (quot && append(quot));
  }
  bool append(const char *s, size_t size);
  bool append_parenthesized(long nr, int radix= 10);

  // Append with optional character set conversion from cs to charset()
  bool append(const char *s, size_t arg_length, CHARSET_INFO *cs);
  bool append(const LEX_CSTRING &s, CHARSET_INFO *cs)
  {
    return append(s.str, s.length, cs);
  }

  // Append a wide character
  bool append_wc(my_wc_t wc)
  {
    if (reserve(mbmaxlen()))
      return true;
    int mblen= q_append_wc(wc, charset());
    if (mblen > 0)
      return false;
    else if (mblen == MY_CS_ILUNI && wc != '?')
      return q_append_wc('?', charset()) <= 0;
    return true;
  }

  // Append a number with zero prefilling
  bool append_zerofill(uint num, uint width)
  {
    static const char zeros[15]= "00000000000000";
    char intbuff[15];
    uint length= (uint) (int10_to_str(num, intbuff, 10) - intbuff);
    if (length < width &&
        append(zeros, width - length, &my_charset_latin1))
      return true;
    return append(intbuff, length, &my_charset_latin1);
  }

  /*
    Append a bitmask in an uint32 with a translation into a
    C-style human readable representation, e.g.:
      0x05 -> "(flag04|flag01)"

    @param flags  - the flags to translate
    @param names  - an array of flag names
    @param count  - the number of available elements in "names"
  */
  bool append_flag32_names(uint32 flags, LEX_CSTRING names[], size_t count)
  {
    bool added= false;
    if (flags && append('('))
      return true;
    for (ulong i= 0; i <= 31; i++)
    {
      ulong bit= 31 - i;
      if (flags & (1 << bit))
      {
        if (added && append('|'))
          return true;
        if (bit < count ? append(names[bit]) : append('?'))
          return true;
        added= true;
      }
    }
    if (flags && append(')'))
      return true;
    return false;
  }

  void strip_sp();
  friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
  friend class Field;
  uint32 numchars() const
  {
    return (uint32) Charset::numchars(ptr(), end());
  }
  int charpos(longlong i, uint32 offset=0)
  {
    if (i <= 0)
      return (int) i;
    return (int) Charset::charpos(ptr() + offset, end(), (size_t) i);
  }
  size_t lengthsp() const
  {
    return Charset::lengthsp(Ptr, str_length);
  }

  void print(String *to) const;
  void print_with_conversion(String *to, CHARSET_INFO *cs) const;
  void print(String *to, CHARSET_INFO *cs) const
  {
    if (my_charset_same(charset(), cs))
      print(to);
    else
      print_with_conversion(to, cs);
  }

  static my_wc_t escaped_wc_for_single_quote(my_wc_t ch)
  {
    switch (ch)
    {
    case '\\':   return '\\';
    case '\0':   return '0';
    case '\'':   return '\'';
    case '\n':   return 'n';
    case '\r':   return 'r';
    case '\032': return 'Z';
    }
    return 0;
  }

  // Append for single quote using mb_wc/wc_mb Unicode conversion
  bool append_for_single_quote_using_mb_wc(const char *str, size_t length,
                                           CHARSET_INFO *cs);

  // Append for single quote with optional mb_wc/wc_mb conversion
  bool append_for_single_quote_opt_convert(const char *str,
                                           size_t length,
                                           CHARSET_INFO *cs)
  {
    return charset() == &my_charset_bin || cs == &my_charset_bin  ||
           my_charset_same(charset(), cs) ?
           append_for_single_quote(str, length) :
           append_for_single_quote_using_mb_wc(str, length, cs);
  }

  bool append_for_single_quote_opt_convert(const String &str)
  {
    return append_for_single_quote_opt_convert(str.ptr(),
                                               str.length(),
                                               str.charset());
  }

  bool append_for_single_quote(const char *st, size_t len);
  bool append_for_single_quote(const String *s)
  {
    return append_for_single_quote(s->ptr(), s->length());
  }

  void swap(String &s)
  {
    Charset::swap(s);
    Binary_string::swap(s);
  }

  uint well_formed_length() const
  {
    return (uint) Well_formed_prefix(charset(), ptr(), length()).length();
  }
  bool is_ascii() const
  {
    if (length() == 0)
      return TRUE;
    if (charset()->mbminlen > 1)
      return FALSE;
    return !has_8bit_bytes();
  }
  bool eq(const String *other, CHARSET_INFO *cs) const
  {
    return !sortcmp(this, other, cs);
  }
private:
  bool append_semi_hex(const char *s, uint len, CHARSET_INFO *cs);
};


// The following class is a backport from MySQL 5.6:
/**
  String class wrapper with a preallocated buffer of size buff_sz

  This class allows to replace sequences of:
     char buff[12345];
     String str(buff, sizeof(buff));
     str.length(0);
  with a simple equivalent declaration:
     StringBuffer<12345> str;
*/

template<size_t buff_sz>
class StringBuffer : public String
{
  char buff[buff_sz];

public:
  StringBuffer() : String(buff, buff_sz, &my_charset_bin) { length(0); }
  explicit StringBuffer(CHARSET_INFO *cs) : String(buff, buff_sz, cs)
  {
    length(0);
  }
  void set_buffer_if_not_allocated(CHARSET_INFO *cs)
  {
    if (!is_alloced())
    {
      Ptr= buff;
      Alloced_length= (uint32) buff_sz;
    }
    str_length= 0;                          /* Safety, not required */
    /* One should set str_length before using it */
    MEM_UNDEFINED(&str_length, sizeof(str_length));
    set_charset(cs);
  }
};


template<size_t buff_sz>
class BinaryStringBuffer : public Binary_string
{
  char buff[buff_sz];
public:
  BinaryStringBuffer() : Binary_string(buff, buff_sz) { length(0); }
};

static inline bool check_if_only_end_space(CHARSET_INFO *cs,
                                           const char *str,
                                           const char *end)
{
  return str + cs->scan(str, end, MY_SEQ_SPACES) == end;
}

int append_query_string(CHARSET_INFO *csinfo, String *to,
                        const char *str, size_t len, bool no_backslash);

#endif /* SQL_STRING_INCLUDED */
server/private/ddl_log.h000064400000030615150400263730011306 0ustar00/*
   Copyright (c) 2000, 2019, Oracle and/or its affiliates.
   Copyright (c) 2010, 2021, MariaDB

   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
*/

/* External interfaces to ddl log functions */

#ifndef DDL_LOG_INCLUDED
#define DDL_LOG_INCLUDED

enum ddl_log_entry_code
{
  /*
    DDL_LOG_UNKOWN
      Here mainly to detect blocks that are all zero

    DDL_LOG_EXECUTE_CODE:
      This is a code that indicates that this is a log entry to
      be executed, from this entry a linked list of log entries
      can be found and executed.
    DDL_LOG_ENTRY_CODE:
      An entry to be executed in a linked list from an execute log
      entry.
    DDL_LOG_IGNORE_ENTRY_CODE:
      An entry that is to be ignored
  */
  DDL_LOG_UNKNOWN= 0,
  DDL_LOG_EXECUTE_CODE= 1,
  DDL_LOG_ENTRY_CODE= 2,
  DDL_LOG_IGNORE_ENTRY_CODE= 3,
  DDL_LOG_ENTRY_CODE_LAST= 4
};


/*
  When adding things below, also add an entry to ddl_log_action_names and
  ddl_log_entry_phases in ddl_log.cc
*/

enum ddl_log_action_code
{
  /*
    The type of action that a DDL_LOG_ENTRY_CODE entry is to
    perform.
  */
  DDL_LOG_UNKNOWN_ACTION= 0,

  /* Delete a .frm file or a table in the partition engine */
  DDL_LOG_DELETE_ACTION= 1,

  /* Rename a .frm fire a table in the partition engine */
  DDL_LOG_RENAME_ACTION= 2,

  /*
    Rename an entity after removing the previous entry with the
    new name, that is replace this entry.
  */
  DDL_LOG_REPLACE_ACTION= 3,

  /* Exchange two entities by renaming them a -> tmp, b -> a, tmp -> b */
  DDL_LOG_EXCHANGE_ACTION= 4,
  /*
    log do_rename(): Rename of .frm file, table, stat_tables and triggers
  */
  DDL_LOG_RENAME_TABLE_ACTION= 5,
  DDL_LOG_RENAME_VIEW_ACTION= 6,
  DDL_LOG_DROP_INIT_ACTION= 7,
  DDL_LOG_DROP_TABLE_ACTION= 8,
  DDL_LOG_DROP_VIEW_ACTION= 9,
  DDL_LOG_DROP_TRIGGER_ACTION= 10,
  DDL_LOG_DROP_DB_ACTION=11,
  DDL_LOG_CREATE_TABLE_ACTION=12,
  DDL_LOG_CREATE_VIEW_ACTION=13,
  DDL_LOG_DELETE_TMP_FILE_ACTION=14,
  DDL_LOG_CREATE_TRIGGER_ACTION=15,
  DDL_LOG_ALTER_TABLE_ACTION=16,
  DDL_LOG_STORE_QUERY_ACTION=17,
  DDL_LOG_LAST_ACTION                          /* End marker */
};


/* Number of phases for each ddl_log_action_code */
extern const uchar ddl_log_entry_phases[DDL_LOG_LAST_ACTION];


enum enum_ddl_log_exchange_phase {
  EXCH_PHASE_NAME_TO_TEMP= 0,
  EXCH_PHASE_FROM_TO_NAME= 1,
  EXCH_PHASE_TEMP_TO_FROM= 2,
  EXCH_PHASE_END
};

enum enum_ddl_log_rename_table_phase {
  DDL_RENAME_PHASE_TRIGGER= 0,
  DDL_RENAME_PHASE_STAT,
  DDL_RENAME_PHASE_TABLE,
  DDL_RENAME_PHASE_END
};

enum enum_ddl_log_drop_table_phase {
  DDL_DROP_PHASE_TABLE=0,
  DDL_DROP_PHASE_TRIGGER,
  DDL_DROP_PHASE_BINLOG,
  DDL_DROP_PHASE_RESET,  /* Reset found list of dropped tables */
  DDL_DROP_PHASE_END
};

enum enum_ddl_log_drop_db_phase {
  DDL_DROP_DB_PHASE_INIT=0,
  DDL_DROP_DB_PHASE_LOG,
  DDL_DROP_DB_PHASE_END
};

enum enum_ddl_log_create_table_phase {
  DDL_CREATE_TABLE_PHASE_INIT=0,
  DDL_CREATE_TABLE_PHASE_LOG,
  DDL_CREATE_TABLE_PHASE_END
};

enum enum_ddl_log_create_view_phase {
  DDL_CREATE_VIEW_PHASE_NO_OLD_VIEW,
  DDL_CREATE_VIEW_PHASE_DELETE_VIEW_COPY,
  DDL_CREATE_VIEW_PHASE_OLD_VIEW_COPIED,
  DDL_CREATE_VIEW_PHASE_END
};

enum enum_ddl_log_create_trigger_phase {
  DDL_CREATE_TRIGGER_PHASE_NO_OLD_TRIGGER,
  DDL_CREATE_TRIGGER_PHASE_DELETE_COPY,
  DDL_CREATE_TRIGGER_PHASE_OLD_COPIED,
  DDL_CREATE_TRIGGER_PHASE_END
};

enum enum_ddl_log_alter_table_phase {
  DDL_ALTER_TABLE_PHASE_INIT,
  DDL_ALTER_TABLE_PHASE_RENAME_FAILED,
  DDL_ALTER_TABLE_PHASE_INPLACE_COPIED,
  DDL_ALTER_TABLE_PHASE_INPLACE,
  DDL_ALTER_TABLE_PHASE_PREPARE_INPLACE,
  DDL_ALTER_TABLE_PHASE_CREATED,
  DDL_ALTER_TABLE_PHASE_COPIED,
  DDL_ALTER_TABLE_PHASE_OLD_RENAMED,
  DDL_ALTER_TABLE_PHASE_UPDATE_TRIGGERS,
  DDL_ALTER_TABLE_PHASE_UPDATE_STATS,
  DDL_ALTER_TABLE_PHASE_UPDATE_BINARY_LOG,
  DDL_ALTER_TABLE_PHASE_END
};


/*
  Flags stored in DDL_LOG_ENTRY.flags
  The flag values can be reused for different commands
*/
#define DDL_LOG_FLAG_ALTER_RENAME         (1 << 0)
#define DDL_LOG_FLAG_ALTER_ENGINE_CHANGED (1 << 1)
#define DDL_LOG_FLAG_ONLY_FRM             (1 << 2)
#define DDL_LOG_FLAG_UPDATE_STAT          (1 << 3)
/*
  Set when using ALTER TABLE on a partitioned table and the table
  engine is not changed
*/
#define DDL_LOG_FLAG_ALTER_PARTITION      (1 << 4)

/*
  Setting ddl_log_entry.phase to this has the same effect as setting
  the phase to the maximum phase (..PHASE_END) for an entry.
*/

#define DDL_LOG_FINAL_PHASE ((uchar) 0xff)

typedef struct st_ddl_log_entry
{
  LEX_CSTRING name;
  LEX_CSTRING from_name;
  LEX_CSTRING handler_name;
  LEX_CSTRING db;
  LEX_CSTRING from_db;
  LEX_CSTRING from_handler_name;
  LEX_CSTRING tmp_name;                /* frm file or temporary file name */
  LEX_CSTRING extra_name;              /* Backup table name */
  uchar uuid[MY_UUID_SIZE];            // UUID for new frm file

  ulonglong xid;                       // Xid stored in the binary log
  /*
    unique_id can be used to store a unique number to check current state.
    Currently it is used to store new size of frm file, link to another ddl log
    entry or store an a uniq version for a storage engine in alter table.
    For execute entries this is reused as an execute counter to ensure we
    don't repeat an entry too many times if executing the entry fails.
  */
  ulonglong unique_id;
  uint next_entry;
  uint entry_pos;                      // Set by write_dll_log_entry()
  uint16 flags;                        // Flags unique for each command
  enum ddl_log_entry_code entry_type;  // Set automatically
  enum ddl_log_action_code action_type;
  /*
    Most actions have only one phase. REPLACE does however have two
    phases. The first phase removes the file with the new name if
    there was one there before and the second phase renames the
    old name to the new name.
  */
  uchar phase;                         // set automatically
} DDL_LOG_ENTRY;

typedef struct st_ddl_log_memory_entry
{
  uint entry_pos;
  struct st_ddl_log_memory_entry *next_log_entry;
  struct st_ddl_log_memory_entry *prev_log_entry;
  struct st_ddl_log_memory_entry *next_active_log_entry;
} DDL_LOG_MEMORY_ENTRY;


/*
  State of the ddl log during execution of a DDL.

  A ddl log state has one execute entry (main entry pointing to the first
  action entry) and many 'action entries' linked in a list in the order
  they should be executed.
  One recovery the log is parsed and all execute entries will be executed.

  All entries are stored as separate blocks in the ddl recovery file.
*/

typedef struct st_ddl_log_state
{
  /* List of ddl log entries */
  DDL_LOG_MEMORY_ENTRY *list;
  /* One execute entry per list */
  DDL_LOG_MEMORY_ENTRY *execute_entry;
  /*
    Entry used for PHASE updates. Normally same as first in 'list', but in
    case of a query log event, this points to the main event.
  */
  DDL_LOG_MEMORY_ENTRY *main_entry;
  uint16 flags;                                 /* Cache for flags */
  bool is_active() { return list != 0; }
} DDL_LOG_STATE;


/* These functions are for recovery */
bool ddl_log_initialize();
void ddl_log_release();
bool ddl_log_close_binlogged_events(HASH *xids);
int ddl_log_execute_recovery();

/* functions for updating the ddl log */
bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry,
                           DDL_LOG_MEMORY_ENTRY **active_entry);

bool ddl_log_write_execute_entry(uint first_entry,
                                 DDL_LOG_MEMORY_ENTRY **active_entry);
bool ddl_log_disable_execute_entry(DDL_LOG_MEMORY_ENTRY **active_entry);

void ddl_log_complete(DDL_LOG_STATE *ddl_log_state);
bool ddl_log_revert(THD *thd, DDL_LOG_STATE *ddl_log_state);

bool ddl_log_update_phase(DDL_LOG_STATE *entry, uchar phase);
bool ddl_log_add_flag(DDL_LOG_STATE *entry, uint16 flag);
bool ddl_log_update_unique_id(DDL_LOG_STATE *state, ulonglong id);
bool ddl_log_update_xid(DDL_LOG_STATE *state, ulonglong xid);
bool ddl_log_disable_entry(DDL_LOG_STATE *state);
bool ddl_log_increment_phase(uint entry_pos);
void ddl_log_release_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry);
bool ddl_log_sync();
bool ddl_log_execute_entry(THD *thd, uint first_entry);

void ddl_log_release_entries(DDL_LOG_STATE *ddl_log_state);
bool ddl_log_rename_table(THD *thd, DDL_LOG_STATE *ddl_state,
                          handlerton *hton,
                          const LEX_CSTRING *org_db,
                          const LEX_CSTRING *org_alias,
                          const LEX_CSTRING *new_db,
                          const LEX_CSTRING *new_alias);
bool ddl_log_rename_view(THD *thd, DDL_LOG_STATE *ddl_state,
                         const LEX_CSTRING *org_db,
                         const LEX_CSTRING *org_alias,
                         const LEX_CSTRING *new_db,
                         const LEX_CSTRING *new_alias);
bool ddl_log_drop_table_init(THD *thd, DDL_LOG_STATE *ddl_state,
                             const LEX_CSTRING *db,
                             const LEX_CSTRING *comment);
bool ddl_log_drop_view_init(THD *thd, DDL_LOG_STATE *ddl_state,
                            const LEX_CSTRING *db);
bool ddl_log_drop_table(THD *thd, DDL_LOG_STATE *ddl_state,
                        handlerton *hton,
                        const LEX_CSTRING *path,
                        const LEX_CSTRING *db,
                        const LEX_CSTRING *table);
bool ddl_log_drop_view(THD *thd, DDL_LOG_STATE *ddl_state,
                        const LEX_CSTRING *path,
                        const LEX_CSTRING *db,
                        const LEX_CSTRING *table);
bool ddl_log_drop_trigger(THD *thd, DDL_LOG_STATE *ddl_state,
                          const LEX_CSTRING *db,
                          const LEX_CSTRING *table,
                          const LEX_CSTRING *trigger_name,
                          const LEX_CSTRING *query);
bool ddl_log_drop_view(THD *thd, DDL_LOG_STATE *ddl_state,
                        const LEX_CSTRING *path,
                        const LEX_CSTRING *db,
                        const LEX_CSTRING *table);
bool ddl_log_drop_view(THD *thd, DDL_LOG_STATE *ddl_state,
                       const LEX_CSTRING *db);
bool ddl_log_drop_db(THD *thd, DDL_LOG_STATE *ddl_state,
                     const LEX_CSTRING *db, const LEX_CSTRING *path);
bool ddl_log_create_table(THD *thd, DDL_LOG_STATE *ddl_state,
                          handlerton *hton,
                          const LEX_CSTRING *path,
                          const LEX_CSTRING *db,
                          const LEX_CSTRING *table,
                          bool only_frm);
bool ddl_log_create_view(THD *thd, DDL_LOG_STATE *ddl_state,
                         const LEX_CSTRING *path,
                         enum_ddl_log_create_view_phase phase);
bool ddl_log_delete_tmp_file(THD *thd, DDL_LOG_STATE *ddl_state,
                             const LEX_CSTRING *path,
                             DDL_LOG_STATE *depending_state);
bool ddl_log_create_trigger(THD *thd, DDL_LOG_STATE *ddl_state,
                            const LEX_CSTRING *db, const LEX_CSTRING *table,
                            const LEX_CSTRING *trigger_name,
                            enum_ddl_log_create_trigger_phase phase);
bool ddl_log_alter_table(THD *thd, DDL_LOG_STATE *ddl_state,
                         handlerton *org_hton,
                         const LEX_CSTRING *db, const LEX_CSTRING *table,
                         handlerton *new_hton,
                         handlerton *partition_underlying_hton,
                         const LEX_CSTRING *new_db,
                         const LEX_CSTRING *new_table,
                         const LEX_CSTRING *frm_path,
                         const LEX_CSTRING *backup_table_name,
                         const LEX_CUSTRING *version,
                         ulonglong table_version,
                         bool is_renamed);
bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_log_state,
                         const char *query, size_t length);
extern mysql_mutex_t LOCK_gdl;
#endif /* DDL_LOG_INCLUDED */
server/private/grant.h000064400000005306150400263730011014 0ustar00/*
   Copyright (c) 2020, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef SQL_GRANT_INCLUDED
#define SQL_GRANT_INCLUDED

#include "lex_string.h"
#include "privilege.h"

class LEX_COLUMN;
class Lex_ident_sys;
class Table_ident;

/*
  Represents the object name in this standard SQL grammar:
    GRANT <object privileges> ON <object name>
*/
class Grant_object_name
{
public:
  enum Type
  {
    STAR,            // ON *
    IDENT_STAR,      // ON db.*
    STAR_STAR,       // ON *.*
    TABLE_IDENT      // ON db.name
  };
  Lex_cstring m_db;
  Table_ident *m_table_ident;
  Type m_type;
public:
  Grant_object_name(Table_ident *table_ident)
   :m_table_ident(table_ident),
    m_type(TABLE_IDENT)
  { }
  Grant_object_name(const LEX_CSTRING &db, Type type)
   :m_db(db),
    m_table_ident(NULL),
    m_type(type)
  { }
  privilege_t all_privileges_by_type() const;
};



/*
  Represents standard SQL statements described by:
  - <grant privilege statement>
  - <revoke privilege statement>
*/
class Grant_privilege
{
protected:
  List<LEX_COLUMN> m_columns;
  Lex_cstring m_db;
  privilege_t m_object_privilege;
  privilege_t m_column_privilege_total;
  bool m_all_privileges;
public:
  Grant_privilege()
   :m_object_privilege(NO_ACL),
    m_column_privilege_total(NO_ACL),
    m_all_privileges(false)
  { }
  Grant_privilege(privilege_t privilege, bool all_privileges)
   :m_object_privilege(privilege),
    m_column_privilege_total(NO_ACL),
    m_all_privileges(all_privileges)
  { }
  void add_object_privilege(privilege_t privilege)
  {
    m_object_privilege|= privilege;
  }
  bool add_column_privilege(THD *thd, const Lex_ident_sys &col,
                            privilege_t privilege);
  bool add_column_list_privilege(THD *thd, List<Lex_ident_sys> &list,
                                 privilege_t privilege);
  bool set_object_name(THD *thd,
                       const Grant_object_name &ident,
                       SELECT_LEX *sel,
                       privilege_t with_grant_option);
  const List<LEX_COLUMN> & columns() const { return m_columns; }
};


#endif // SQL_GRANT_INCLUDED
server/private/unireg.h000064400000017044150400263730011174 0ustar00#ifndef UNIREG_INCLUDED
#define UNIREG_INCLUDED

/*
   Copyright (c) 2000, 2011, Oracle and/or its affiliates.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


#include <mysql_version.h>                      /* FRM_VER */

/*  Extra functions used by unireg library */

#ifndef NO_ALARM_LOOP
#define NO_ALARM_LOOP		/* lib5 and popen can't use alarm */
#endif

/* These paths are converted to other systems (WIN95) before use */

#define LANGUAGE	"english/"
#define ERRMSG_FILE	"errmsg.sys"
#define TEMP_PREFIX	"MY"
#define LOG_PREFIX	"ML"
#define PROGDIR		"bin/"
#ifndef MYSQL_DATADIR
#define MYSQL_DATADIR		"data/"
#endif
#ifndef SHAREDIR
#define SHAREDIR	"share/"
#endif
#ifndef PLUGINDIR
#define PLUGINDIR	"lib/plugin"
#endif

#define MAX_ERROR_RANGES 4  /* 1000-2000, 2000-3000, 3000-4000, 4000-5000 */
#define ERRORS_PER_RANGE 1000

#define DEFAULT_ERRMSGS           my_default_lc_messages->errmsgs->errmsgs
#define CURRENT_THD_ERRMSGS       (current_thd)->variables.errmsgs

#ifndef mysqld_error_find_printf_error_used
#define ER_DEFAULT(X) DEFAULT_ERRMSGS[((X)-ER_ERROR_FIRST) / ERRORS_PER_RANGE][(X)% ERRORS_PER_RANGE]
#define ER_THD(thd,X) ((thd)->variables.errmsgs[((X)-ER_ERROR_FIRST) / ERRORS_PER_RANGE][(X) % ERRORS_PER_RANGE])
#define ER(X)         ER_THD(current_thd, (X))
#endif
#define ER_THD_OR_DEFAULT(thd,X) ((thd) ? ER_THD(thd, (X)) : ER_DEFAULT(X))

#define SPECIAL_USE_LOCKS	1		/* Lock used databases */
#define SPECIAL_NO_NEW_FUNC	2		/* Skip new functions */
#define SPECIAL_SKIP_SHOW_DB    4               /* Don't allow 'show db' */
#define SPECIAL_WAIT_IF_LOCKED	8		/* Wait if locked database */
#define SPECIAL_SAME_DB_NAME   16		/* form name = file name */
#define SPECIAL_ENGLISH        32		/* English error messages */
#define SPECIAL_NO_RESOLVE     64		/* Obsolete */
#define SPECIAL_NO_PRIOR	128		/* Obsolete */
#define SPECIAL_BIG_SELECTS	256		/* Don't use heap tables */
#define SPECIAL_NO_HOST_CACHE	512		/* Don't cache hosts */
#define SPECIAL_SHORT_LOG_FORMAT 1024
#define SPECIAL_SAFE_MODE	2048
#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */

	/* Extern defines */
#define store_record(A,B) memcpy((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
#define restore_record(A,B) memcpy((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
#define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
#define empty_record(A) { \
                          restore_record((A),s->default_values); \
                          if ((A)->s->null_bytes) \
                            bfill((A)->null_flags,(A)->s->null_bytes,255); \
                        }

	/* Defines for use with openfrm, openprt and openfrd */

#define READ_ALL               (1 <<  0) /* openfrm: Read all parameters */
#define EXTRA_RECORD           (1 <<  3) /* Reserve space for an extra record */
#define DELAYED_OPEN           (1 << 12) /* Open table later */
#define OPEN_VIEW_NO_PARSE     (1 << 14) /* Open frm only if it's a view,
                                            but do not parse view itself */
/**
  This flag is used in function get_all_tables() which fills
  I_S tables with data which are retrieved from frm files and storage engine
  The flag means that we need to open FRM file only to get necessary data.
*/
#define OPEN_FRM_FILE_ONLY     (1 << 15)
/**
  This flag is used in function get_all_tables() which fills
  I_S tables with data which are retrieved from frm files and storage engine
  The flag means that we need to process tables only to get necessary data.
  Views are not processed.
*/
#define OPEN_TABLE_ONLY        (1 << 16)
/**
  This flag is used in function get_all_tables() which fills
  I_S tables with data which are retrieved from frm files and storage engine
  The flag means that we need to process views only to get necessary data.
  Tables are not processed.
*/
#define OPEN_VIEW_ONLY         (1 << 17)
/**
  This flag is used in function get_all_tables() which fills
  I_S tables with data which are retrieved from frm files and storage engine.
  The flag means that we need to open a view using
  open_normal_and_derived_tables() function.
*/
#define OPEN_VIEW_FULL         (1 << 18)
/**
  This flag is used in function get_all_tables() which fills
  I_S tables with data which are retrieved from frm files and storage engine.
  The flag means that I_S table uses optimization algorithm.
*/
#define OPTIMIZE_I_S_TABLE     (1 << 19)
/**
  This flag is used to instruct tdc_open_view() to check metadata version.
*/
#define CHECK_METADATA_VERSION (1 << 20)

/*
  The flag means that we need to process trigger files only.
*/
#define OPEN_TRIGGER_ONLY      (1 << 21)

/*
  Minimum length pattern before Turbo Boyer-Moore is used
  for SELECT "text" LIKE "%pattern%", excluding the two
  wildcards in class Item_func_like.
*/
#define MIN_TURBOBM_PATTERN_LEN 3

/* 
   Defines for binary logging.
   Do not decrease the value of BIN_LOG_HEADER_SIZE.
   Do not even increase it before checking code.
*/

#define BIN_LOG_HEADER_SIZE    4 

#define DEFAULT_KEY_CACHE_NAME "default"


/* Include prototypes for unireg */

#include "mysqld_error.h"
#include "structs.h"				/* All structs we need */
#include "sql_list.h"                           /* List<> */
#include "field.h"                              /* Create_field */

/*
  Types of values in the MariaDB extra2 frm segment.
  Each value is written as
    type:       1 byte
    length:     1 byte  (1..255) or \0 and 2 bytes.
    binary value of the 'length' bytes.

  Older MariaDB servers can ignore values of unknown types if
  the type code is less than 128 (EXTRA2_ENGINE_IMPORTANT).
  Otherwise older (but newer than 10.0.1) servers are required
  to report an error.
*/
enum extra2_frm_value_type {
  EXTRA2_TABLEDEF_VERSION=0,
  EXTRA2_DEFAULT_PART_ENGINE=1,
  EXTRA2_GIS=2,
  EXTRA2_APPLICATION_TIME_PERIOD=3,
  EXTRA2_PERIOD_FOR_SYSTEM_TIME=4,
  EXTRA2_INDEX_FLAGS=5,

#define EXTRA2_ENGINE_IMPORTANT 128

  EXTRA2_ENGINE_TABLEOPTS=128,
  EXTRA2_FIELD_FLAGS=129,
  EXTRA2_FIELD_DATA_TYPE_INFO=130,
  EXTRA2_PERIOD_WITHOUT_OVERLAPS=131,
};

enum extra2_field_flags {
  VERS_OPTIMIZED_UPDATE= 1 << INVISIBLE_MAX_BITS,
};

enum extra2_index_flags {
  EXTRA2_DEFAULT_INDEX_FLAGS,
  EXTRA2_IGNORED_KEY
};


static inline size_t extra2_read_len(const uchar **extra2, const uchar *end)
{
  size_t length= *(*extra2)++;
  if (length)
    return length;

  if ((*extra2) + 2 >= end)
    return 0;
  length= uint2korr(*extra2);
  (*extra2)+= 2;
  if (length < 256 || *extra2 + length > end)
    return 0;
  return length;
}

LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING &table,
                             HA_CREATE_INFO *create_info,
                             List<Create_field> &create_fields,
                             uint keys, KEY *key_info, handler *db_file);

#define FRM_HEADER_SIZE 64
#define FRM_FORMINFO_SIZE 288
#define FRM_MAX_SIZE (1024*1024)

static inline bool is_binary_frm_header(uchar *head)
{
  return head[0] == 254
      && head[1] == 1
      && head[2] >= FRM_VER
      && head[2] <= FRM_VER_CURRENT;
}

#endif
server/private/lex_string.h000064400000007744150400263730012067 0ustar00/*
   Copyright (c) 2018, 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-1301  USA */


#ifndef LEX_STRING_INCLUDED
#define LEX_STRING_INCLUDED


typedef struct st_mysql_const_lex_string LEX_CSTRING;


class Lex_cstring : public LEX_CSTRING
{
  public:
  Lex_cstring()
  {
    str= NULL;
    length= 0;
  }
  Lex_cstring(const LEX_CSTRING &str)
  {
    LEX_CSTRING::operator=(str);
  }
  Lex_cstring(const char *_str, size_t _len)
  {
    str= _str;
    length= _len;
  }
  Lex_cstring(const char *start, const char *end)
  {
    DBUG_ASSERT(start <= end);
    str= start;
    length= end - start;
  }
  void set(const char *_str, size_t _len)
  {
    str= _str;
    length= _len;
  }

  /*
    Trim left white spaces.
    Assumes that there are no multi-bytes characters
    that can be considered white-space.
  */
  Lex_cstring ltrim_whitespace(CHARSET_INFO *cs) const
  {
    DBUG_ASSERT(cs->mbminlen == 1);
    Lex_cstring str= *this;
    while (str.length > 0 && my_isspace(cs, str.str[0]))
    {
      str.length--;
      str.str++;
    }
    return str;
  }

  /*
    Trim right white spaces.
    Assumes that there are no multi-bytes characters
    that can be considered white-space.
    Also, assumes that the character set supports backward space parsing.
  */
  Lex_cstring rtrim_whitespace(CHARSET_INFO *cs) const
  {
    DBUG_ASSERT(cs->mbminlen == 1);
    Lex_cstring str= *this;
    while (str.length > 0 && my_isspace(cs, str.str[str.length - 1]))
    {
      str.length --;
    }
    return str;
  }

  /*
    Trim all spaces.
  */
  Lex_cstring trim_whitespace(CHARSET_INFO *cs) const
  {
    return ltrim_whitespace(cs).rtrim_whitespace(cs);
  }

  /*
    Trim all spaces and return the length of the leading space sequence.
  */
  Lex_cstring trim_whitespace(CHARSET_INFO *cs, size_t *prefix_length) const
  {
    Lex_cstring tmp= Lex_cstring(*this).ltrim_whitespace(cs);
    if (prefix_length)
      *prefix_length= tmp.str - str;
    return tmp.rtrim_whitespace(cs);
  }

};


class Lex_cstring_strlen: public Lex_cstring
{
public:
  Lex_cstring_strlen(const char *from)
   :Lex_cstring(from, from ? strlen(from) : 0)
  { }
};


/* Functions to compare if two lex strings are equal */

static inline bool lex_string_cmp(CHARSET_INFO *charset, const LEX_CSTRING *a,
                                  const LEX_CSTRING *b)
{
  return my_strcasecmp(charset, a->str, b->str);
}

/*
  Compare to LEX_CSTRING's and return 0 if equal
*/

static inline bool cmp(const LEX_CSTRING *a, const LEX_CSTRING *b)
{
  return a->length != b->length ||
    (a->length && memcmp(a->str, b->str, a->length));
}
static inline bool cmp(const LEX_CSTRING a, const LEX_CSTRING b)
{
  return a.length != b.length || (a.length && memcmp(a.str, b.str, a.length));
}

/*
  Compare if two LEX_CSTRING are equal. Assumption is that
  character set is ASCII (like for plugin names)
*/

static inline bool lex_string_eq(const LEX_CSTRING *a, const LEX_CSTRING *b)
{
  if (a->length != b->length)
    return 0;                                   /* Different */
  return strcasecmp(a->str, b->str) == 0;
}

/*
  To be used when calling lex_string_eq with STRING_WITH_LEN() as second
  argument
*/

static inline bool lex_string_eq(const LEX_CSTRING *a, const char *b, size_t b_length)
{
  if (a->length != b_length)
    return 0;                                   /* Different */
  return strcasecmp(a->str, b) == 0;
}

#endif /* LEX_STRING_INCLUDED */
server/private/log_event.h000064400000554052150400263730011672 0ustar00/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, 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 */

/**
  @addtogroup Replication
  @{

  @file
  
  @brief Binary log event definitions.  This includes generic code
  common to all types of log events, as well as specific code for each
  type of log event.
*/


#ifndef _log_event_h
#define _log_event_h

#if defined(USE_PRAGMA_INTERFACE) && defined(MYSQL_SERVER)
#pragma interface			/* gcc class implementation */
#endif

#include <my_bitmap.h>
#include "rpl_constants.h"
#include <vector>
#include <string>
#include <functional>
#include <memory>
#include <map>

#ifdef MYSQL_CLIENT
#include "sql_const.h"
#include "rpl_utility.h"
#include "hash.h"
#include "rpl_tblmap.h"
#include "sql_string.h"
#endif

#ifdef MYSQL_SERVER
#include "rpl_record.h"
#include "rpl_reporting.h"
#include "sql_class.h"                          /* THD */
#endif

#include "rpl_gtid.h"

#include "log_event_data_type.h"

/* Forward declarations */
#ifndef MYSQL_CLIENT
class String;
#endif

#define PREFIX_SQL_LOAD "SQL_LOAD-"
#define LONG_FIND_ROW_THRESHOLD 60 /* seconds */

/**
   Either assert or return an error.

   In debug build, the condition will be checked, but in non-debug
   builds, the error code given will be returned instead.

   @param COND   Condition to check
   @param ERRNO  Error number to return in non-debug builds
*/
#ifdef DBUG_OFF
#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \
  do { if (!(COND)) return ERRNO; } while (0)
#else
#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \
  DBUG_ASSERT(COND)
#endif

#define LOG_READ_EOF    -1
#define LOG_READ_BOGUS  -2
#define LOG_READ_IO     -3
#define LOG_READ_MEM    -5
#define LOG_READ_TRUNC  -6
#define LOG_READ_TOO_LARGE -7
#define LOG_READ_CHECKSUM_FAILURE -8
#define LOG_READ_DECRYPT -9

#define LOG_EVENT_OFFSET 4

/*
   3 is MySQL 4.x; 4 is MySQL 5.0.0.
   Compared to version 3, version 4 has:
   - a different Start_log_event, which includes info about the binary log
   (sizes of headers); this info is included for better compatibility if the
   master's MySQL version is different from the slave's.
   - all events have a unique ID (the triplet (server_id, timestamp at server
   start, other) to be sure an event is not executed more than once in a
   multimaster setup, example:
                M1
              /   \
             v     v
             M2    M3
             \     /
              v   v
                S
   if a query is run on M1, it will arrive twice on S, so we need that S
   remembers the last unique ID it has processed, to compare and know if the
   event should be skipped or not. Example of ID: we already have the server id
   (4 bytes), plus:
   timestamp_when_the_master_started (4 bytes), a counter (a sequence number
   which increments every time we write an event to the binlog) (3 bytes).
   Q: how do we handle when the counter is overflowed and restarts from 0 ?

   - Query and Load (Create or Execute) events may have a more precise
     timestamp (with microseconds), number of matched/affected/warnings rows
   and fields of session variables: SQL_MODE,
   FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, SQL_AUTO_IS_NULL, the collations and
   charsets, the PASSWORD() version (old/new/...).
*/
#define BINLOG_VERSION    4

/*
 We could have used SERVER_VERSION_LENGTH, but this introduces an
 obscure dependency - if somebody decided to change SERVER_VERSION_LENGTH
 this would break the replication protocol
*/
#define ST_SERVER_VER_LEN 50

/*
  These are flags and structs to handle all the LOAD DATA INFILE options (LINES
  TERMINATED etc).
*/

/*
  These are flags and structs to handle all the LOAD DATA INFILE options (LINES
  TERMINATED etc).
  DUMPFILE_FLAG is probably useless (DUMPFILE is a clause of SELECT, not of LOAD
  DATA).
*/
#define DUMPFILE_FLAG		0x1
#define OPT_ENCLOSED_FLAG	0x2
#define REPLACE_FLAG		0x4
#define IGNORE_FLAG		0x8

#define FIELD_TERM_EMPTY	0x1
#define ENCLOSED_EMPTY		0x2
#define LINE_TERM_EMPTY		0x4
#define LINE_START_EMPTY	0x8
#define ESCAPED_EMPTY		0x10

#define NUM_LOAD_DELIM_STRS 5

/*
  The following is the max table_map_id. This is limited by that we
  are using 6 bytes for it in replication
*/
#define MAX_TABLE_MAP_ID ((1ULL << (6*8)) -1)

/*****************************************************************************

  MySQL Binary Log

  This log consists of events.  Each event has a fixed-length header,
  possibly followed by a variable length data body.

  The data body consists of an optional fixed length segment (post-header)
  and  an optional variable length segment.

  See the #defines below for the format specifics.

  The events which really update data are Query_log_event,
  Execute_load_query_log_event and old Load_log_event and
  Execute_load_log_event events (Execute_load_query is used together with
  Begin_load_query and Append_block events to replicate LOAD DATA INFILE.
  Create_file/Append_block/Execute_load (which includes Load_log_event)
  were used to replicate LOAD DATA before the 5.0.3).

 ****************************************************************************/

#define LOG_EVENT_HEADER_LEN 19     /* the fixed header length */
#define OLD_HEADER_LEN       13     /* the fixed header length in 3.23 */
/*
   Fixed header length, where 4.x and 5.0 agree. That is, 5.0 may have a longer
   header (it will for sure when we have the unique event's ID), but at least
   the first 19 bytes are the same in 4.x and 5.0. So when we have the unique
   event's ID, LOG_EVENT_HEADER_LEN will be something like 26, but
   LOG_EVENT_MINIMAL_HEADER_LEN will remain 19.
*/
#define LOG_EVENT_MINIMAL_HEADER_LEN 19

/* event-specific post-header sizes */
// where 3.23, 4.x and 5.0 agree
#define QUERY_HEADER_MINIMAL_LEN     (4 + 4 + 1 + 2)
// where 5.0 differs: 2 for len of N-bytes vars.
#define QUERY_HEADER_LEN     (QUERY_HEADER_MINIMAL_LEN + 2)
#define STOP_HEADER_LEN      0
#define LOAD_HEADER_LEN      (4 + 4 + 4 + 1 +1 + 4)
#define SLAVE_HEADER_LEN     0
#define START_V3_HEADER_LEN     (2 + ST_SERVER_VER_LEN + 4)
#define ROTATE_HEADER_LEN    8 // this is FROZEN (the Rotate post-header is frozen)
#define INTVAR_HEADER_LEN      0
#define CREATE_FILE_HEADER_LEN 4
#define APPEND_BLOCK_HEADER_LEN 4
#define EXEC_LOAD_HEADER_LEN   4
#define DELETE_FILE_HEADER_LEN 4
#define NEW_LOAD_HEADER_LEN    LOAD_HEADER_LEN
#define RAND_HEADER_LEN        0
#define USER_VAR_HEADER_LEN    0
#define FORMAT_DESCRIPTION_HEADER_LEN (START_V3_HEADER_LEN+1+LOG_EVENT_TYPES)
#define XID_HEADER_LEN         0
#define BEGIN_LOAD_QUERY_HEADER_LEN APPEND_BLOCK_HEADER_LEN
#define ROWS_HEADER_LEN_V1     8
#define TABLE_MAP_HEADER_LEN   8
#define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1)
#define EXECUTE_LOAD_QUERY_HEADER_LEN  (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN)
#define INCIDENT_HEADER_LEN    2
#define HEARTBEAT_HEADER_LEN   0
#define IGNORABLE_HEADER_LEN   0
#define ROWS_HEADER_LEN_V2    10
#define ANNOTATE_ROWS_HEADER_LEN  0
#define BINLOG_CHECKPOINT_HEADER_LEN 4
#define GTID_HEADER_LEN       19
#define GTID_LIST_HEADER_LEN   4
#define START_ENCRYPTION_HEADER_LEN 0
#define XA_PREPARE_HEADER_LEN 0

/* 
  Max number of possible extra bytes in a replication event compared to a
  packet (i.e. a query) sent from client to master;
  First, an auxiliary log_event status vars estimation:
*/
#define MAX_SIZE_LOG_EVENT_STATUS (1 + 4          /* type, flags2 */   + \
                                   1 + 8          /* type, sql_mode */ + \
                                   1 + 1 + 255    /* type, length, catalog */ + \
                                   1 + 4          /* type, auto_increment */ + \
                                   1 + 6          /* type, charset */ + \
                                   1 + 1 + 255    /* type, length, time_zone */ + \
                                   1 + 2          /* type, lc_time_names_number */ + \
                                   1 + 2          /* type, charset_database_number */ + \
                                   1 + 8          /* type, table_map_for_update */ + \
                                   1 + 4          /* type, master_data_written */ + \
                                   1 + 3          /* type, sec_part of NOW() */ + \
                                   1 + 16 + 1 + 60/* type, user_len, user, host_len, host */)
#define MAX_LOG_EVENT_HEADER   ( /* in order of Query_log_event::write */ \
  LOG_EVENT_HEADER_LEN + /* write_header */ \
  QUERY_HEADER_LEN     + /* write_data */   \
  EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN + /*write_post_header_for_derived */ \
  MAX_SIZE_LOG_EVENT_STATUS + /* status */ \
  NAME_LEN + 1)

/*
  The new option is added to handle large packets that are sent from the master 
  to the slave. It is used to increase the thd(max_allowed) for both the
  DUMP thread on the master and the SQL/IO thread on the slave. 
*/
#define MAX_MAX_ALLOWED_PACKET (1024*1024*1024)

/* 
   Event header offsets; 
   these point to places inside the fixed header.
*/

#define EVENT_TYPE_OFFSET    4
#define SERVER_ID_OFFSET     5
#define EVENT_LEN_OFFSET     9
#define LOG_POS_OFFSET       13
#define FLAGS_OFFSET         17

/* start event post-header (for v3 and v4) */

#define ST_BINLOG_VER_OFFSET  0
#define ST_SERVER_VER_OFFSET  2
#define ST_CREATED_OFFSET     (ST_SERVER_VER_OFFSET + ST_SERVER_VER_LEN)
#define ST_COMMON_HEADER_LEN_OFFSET (ST_CREATED_OFFSET + 4)

/* slave event post-header (this event is never written) */

#define SL_MASTER_PORT_OFFSET   8
#define SL_MASTER_POS_OFFSET    0
#define SL_MASTER_HOST_OFFSET   10

/* query event post-header */

#define Q_THREAD_ID_OFFSET	0
#define Q_EXEC_TIME_OFFSET	4
#define Q_DB_LEN_OFFSET		8
#define Q_ERR_CODE_OFFSET	9
#define Q_STATUS_VARS_LEN_OFFSET 11
#define Q_DATA_OFFSET		QUERY_HEADER_LEN
/* these are codes, not offsets; not more than 256 values (1 byte). */
#define Q_FLAGS2_CODE           0
#define Q_SQL_MODE_CODE         1
/*
  Q_CATALOG_CODE is catalog with end zero stored; it is used only by MySQL
  5.0.x where 0<=x<=3. We have to keep it to be able to replicate these
  old masters.
*/
#define Q_CATALOG_CODE          2
#define Q_AUTO_INCREMENT	3
#define Q_CHARSET_CODE          4
#define Q_TIME_ZONE_CODE        5
/*
  Q_CATALOG_NZ_CODE is catalog withOUT end zero stored; it is used by MySQL
  5.0.x where x>=4. Saves one byte in every Query_log_event in binlog,
  compared to Q_CATALOG_CODE. The reason we didn't simply re-use
  Q_CATALOG_CODE is that then a 5.0.3 slave of this 5.0.x (x>=4) master would
  crash (segfault etc) because it would expect a 0 when there is none.
*/
#define Q_CATALOG_NZ_CODE       6

#define Q_LC_TIME_NAMES_CODE    7

#define Q_CHARSET_DATABASE_CODE 8

#define Q_TABLE_MAP_FOR_UPDATE_CODE 9

#define Q_MASTER_DATA_WRITTEN_CODE 10

#define Q_INVOKER 11

#define Q_HRNOW 128
#define Q_XID   129

/* Intvar event post-header */

/* Intvar event data */
#define I_TYPE_OFFSET        0
#define I_VAL_OFFSET         1

/* Rand event data */
#define RAND_SEED1_OFFSET 0
#define RAND_SEED2_OFFSET 8

/* User_var event data */
#define UV_VAL_LEN_SIZE        4
#define UV_VAL_IS_NULL         1
#define UV_VAL_TYPE_SIZE       1
#define UV_NAME_LEN_SIZE       4
#define UV_CHARSET_NUMBER_SIZE 4

/* Load event post-header */
#define L_THREAD_ID_OFFSET   0
#define L_EXEC_TIME_OFFSET   4
#define L_SKIP_LINES_OFFSET  8
#define L_TBL_LEN_OFFSET     12
#define L_DB_LEN_OFFSET      13
#define L_NUM_FIELDS_OFFSET  14
#define L_SQL_EX_OFFSET      18
#define L_DATA_OFFSET        LOAD_HEADER_LEN

/* Rotate event post-header */
#define R_POS_OFFSET       0
#define R_IDENT_OFFSET     8

/* CF to DF handle LOAD DATA INFILE */

/* CF = "Create File" */
#define CF_FILE_ID_OFFSET  0
#define CF_DATA_OFFSET     CREATE_FILE_HEADER_LEN

/* AB = "Append Block" */
#define AB_FILE_ID_OFFSET  0
#define AB_DATA_OFFSET     APPEND_BLOCK_HEADER_LEN

/* EL = "Execute Load" */
#define EL_FILE_ID_OFFSET  0

/* DF = "Delete File" */
#define DF_FILE_ID_OFFSET  0

/* TM = "Table Map" */
#define TM_MAPID_OFFSET    0
#define TM_FLAGS_OFFSET    6

/* RW = "RoWs" */
#define RW_MAPID_OFFSET    0
#define RW_FLAGS_OFFSET    6
#define RW_VHLEN_OFFSET    8
#define RW_V_TAG_LEN       1
#define RW_V_EXTRAINFO_TAG 0

/* ELQ = "Execute Load Query" */
#define ELQ_FILE_ID_OFFSET QUERY_HEADER_LEN
#define ELQ_FN_POS_START_OFFSET ELQ_FILE_ID_OFFSET + 4
#define ELQ_FN_POS_END_OFFSET ELQ_FILE_ID_OFFSET + 8
#define ELQ_DUP_HANDLING_OFFSET ELQ_FILE_ID_OFFSET + 12

/* 4 bytes which all binlogs should begin with */
#define BINLOG_MAGIC        (const uchar*) "\xfe\x62\x69\x6e"

/*
  The 2 flags below were useless :
  - the first one was never set
  - the second one was set in all Rotate events on the master, but not used for
  anything useful.
  So they are now removed and their place may later be reused for other
  flags. Then one must remember that Rotate events in 4.x have
  LOG_EVENT_FORCED_ROTATE_F set, so one should not rely on the value of the
  replacing flag when reading a Rotate event.
  I keep the defines here just to remember what they were.
*/
#ifdef TO_BE_REMOVED
#define LOG_EVENT_TIME_F            0x1
#define LOG_EVENT_FORCED_ROTATE_F   0x2
#endif

/*
   This flag only makes sense for Format_description_log_event. It is set
   when the event is written, and *reset* when a binlog file is
   closed (yes, it's the only case when MySQL modifies already written
   part of binlog).  Thus it is a reliable indicator that binlog was
   closed correctly.  (Stop_log_event is not enough, there's always a
   small chance that mysqld crashes in the middle of insert and end of
   the binlog would look like a Stop_log_event).

   This flag is used to detect a restart after a crash, and to provide
   "unbreakable" binlog. The problem is that on a crash storage engines
   rollback automatically, while binlog does not.  To solve this we use this
   flag and automatically append ROLLBACK to every non-closed binlog (append
   virtually, on reading, file itself is not changed). If this flag is found,
   mysqlbinlog simply prints "ROLLBACK" Replication master does not abort on
   binlog corruption, but takes it as EOF, and replication slave forces a
   rollback in this case.

   Note, that old binlogs does not have this flag set, so we get a
   a backward-compatible behaviour.
*/

#define LOG_EVENT_BINLOG_IN_USE_F       0x1

/**
  @def LOG_EVENT_THREAD_SPECIFIC_F

  If the query depends on the thread (for example: TEMPORARY TABLE).
  Currently this is used by mysqlbinlog to know it must print
  SET @@PSEUDO_THREAD_ID=xx; before the query (it would not hurt to print it
  for every query but this would be slow).
*/
#define LOG_EVENT_THREAD_SPECIFIC_F 0x4

/**
  @def LOG_EVENT_SUPPRESS_USE_F

  Suppress the generation of 'USE' statements before the actual
  statement. This flag should be set for any events that does not need
  the current database set to function correctly. Most notable cases
  are 'CREATE DATABASE' and 'DROP DATABASE'.

  This flags should only be used in exceptional circumstances, since
  it introduce a significant change in behaviour regarding the
  replication logic together with the flags --binlog-do-db and
  --replicated-do-db.
 */
#define LOG_EVENT_SUPPRESS_USE_F    0x8

/*
  Note: this is a place holder for the flag
  LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F (0x10), which is not used any
  more, please do not reused this value for other flags.
 */

/**
   @def LOG_EVENT_ARTIFICIAL_F
   
   Artificial events are created arbitrarily and not written to binary
   log

   These events should not update the master log position when slave
   SQL thread executes them.
*/
#define LOG_EVENT_ARTIFICIAL_F 0x20

/**
   @def LOG_EVENT_RELAY_LOG_F
   
   Events with this flag set are created by slave IO thread and written
   to relay log
*/
#define LOG_EVENT_RELAY_LOG_F 0x40

/**
   @def LOG_EVENT_IGNORABLE_F

   For an event, 'e', carrying a type code, that a slave,
   's', does not recognize, 's' will check 'e' for
   LOG_EVENT_IGNORABLE_F, and if the flag is set, then 'e'
   is ignored. Otherwise, 's' acknowledges that it has
   found an unknown event in the relay log.
*/
#define LOG_EVENT_IGNORABLE_F 0x80

/**
   @def LOG_EVENT_ACCEPT_OWN_F

   Flag sets by the semisync slave for accepting
   the same server_id ("own") events which the slave must not have
   in its state. Typically such events were never committed by
   their originator (this server) and discared at its semisync-slave recovery.
*/
#define LOG_EVENT_ACCEPT_OWN_F 0x4000

/**
   @def LOG_EVENT_SKIP_REPLICATION_F

   Flag set by application creating the event (with @@skip_replication); the
   slave will skip replication of such events if
   --replicate-events-marked-for-skip is not set to REPLICATE.

   This is a MariaDB flag; we allocate it from the end of the available
   values to reduce risk of conflict with new MySQL flags.
*/
#define LOG_EVENT_SKIP_REPLICATION_F 0x8000


/**
  @def OPTIONS_WRITTEN_TO_BIN_LOG

  OPTIONS_WRITTEN_TO_BIN_LOG are the bits of thd->options which must
  be written to the binlog. OPTIONS_WRITTEN_TO_BIN_LOG could be
  written into the Format_description_log_event, so that if later we
  don't want to replicate a variable we did replicate, or the
  contrary, it's doable. But it should not be too hard to deduct
  the value of OPTIONS_WRITTEN_TO_BIN_LOG from the master's version.

  This is done in deduct_options_written_to_bin_log().
  You *must* update it, when changing the definition below.
*/
#define OPTIONS_WRITTEN_TO_BIN_LOG (OPTION_EXPLICIT_DEF_TIMESTAMP |\
   OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS |  \
   OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NOT_AUTOCOMMIT | OPTION_IF_EXISTS)

#define CHECKSUM_CRC32_SIGNATURE_LEN 4
/**
   defined statically while there is just one alg implemented
*/
#define BINLOG_CHECKSUM_LEN CHECKSUM_CRC32_SIGNATURE_LEN
#define BINLOG_CHECKSUM_ALG_DESC_LEN 1  /* 1 byte checksum alg descriptor */

/*
  These are capability numbers for MariaDB slave servers.

  Newer MariaDB slaves set this to inform the master about their capabilities.
  This allows the master to decide which events it can send to the slave
  without breaking replication on old slaves that maybe do not understand
  all events from newer masters.

  As new releases are backwards compatible, a given capability implies also
  all capabilities with smaller number.

  Older MariaDB slaves and other MySQL slave servers do not set this, so they
  are recorded with capability 0.
*/

/* MySQL or old MariaDB slave with no announced capability. */
#define MARIA_SLAVE_CAPABILITY_UNKNOWN 0
/* MariaDB >= 5.3, which understands ANNOTATE_ROWS_EVENT. */
#define MARIA_SLAVE_CAPABILITY_ANNOTATE 1
/*
  MariaDB >= 5.5. This version has the capability to tolerate events omitted
  from the binlog stream without breaking replication (MySQL slaves fail
  because they mis-compute the offsets into the master's binlog).
*/
#define MARIA_SLAVE_CAPABILITY_TOLERATE_HOLES 2
/* MariaDB >= 10.0, which knows about binlog_checkpoint_log_event. */
#define MARIA_SLAVE_CAPABILITY_BINLOG_CHECKPOINT 3
/* MariaDB >= 10.0.1, which knows about global transaction id events. */
#define MARIA_SLAVE_CAPABILITY_GTID 4

/* Our capability. */
#define MARIA_SLAVE_CAPABILITY_MINE MARIA_SLAVE_CAPABILITY_GTID


/*
  When the size of 'log_pos' within Heartbeat_log_event exceeds UINT32_MAX it
  cannot be accommodated in common_header, as 'log_pos' is of 4 bytes size. In
  such cases, sub_header, of size 8 bytes will hold larger 'log_pos' value.
*/
#define HB_SUB_HEADER_LEN 8


/**
  @enum Log_event_type

  Enumeration type for the different types of log events.
*/
enum Log_event_type
{
  /*
    Every time you update this enum (when you add a type), you have to
    fix Format_description_log_event::Format_description_log_event().
  */
  UNKNOWN_EVENT= 0,
  START_EVENT_V3= 1,
  QUERY_EVENT= 2,
  STOP_EVENT= 3,
  ROTATE_EVENT= 4,
  INTVAR_EVENT= 5,
  LOAD_EVENT= 6,
  SLAVE_EVENT= 7,
  CREATE_FILE_EVENT= 8,
  APPEND_BLOCK_EVENT= 9,
  EXEC_LOAD_EVENT= 10,
  DELETE_FILE_EVENT= 11,
  /*
    NEW_LOAD_EVENT is like LOAD_EVENT except that it has a longer
    sql_ex, allowing multibyte TERMINATED BY etc; both types share the
    same class (Load_log_event)
  */
  NEW_LOAD_EVENT= 12,
  RAND_EVENT= 13,
  USER_VAR_EVENT= 14,
  FORMAT_DESCRIPTION_EVENT= 15,
  XID_EVENT= 16,
  BEGIN_LOAD_QUERY_EVENT= 17,
  EXECUTE_LOAD_QUERY_EVENT= 18,

  TABLE_MAP_EVENT = 19,

  /*
    These event numbers were used for 5.1.0 to 5.1.15 and are
    therefore obsolete.
   */
  PRE_GA_WRITE_ROWS_EVENT = 20,
  PRE_GA_UPDATE_ROWS_EVENT = 21,
  PRE_GA_DELETE_ROWS_EVENT = 22,

  /*
    These event numbers are used from 5.1.16 until mysql-5.6.6,
    and in MariaDB
   */
  WRITE_ROWS_EVENT_V1 = 23,
  UPDATE_ROWS_EVENT_V1 = 24,
  DELETE_ROWS_EVENT_V1 = 25,

  /*
    Something out of the ordinary happened on the master
   */
  INCIDENT_EVENT= 26,

  /*
    Heartbeat event to be send by master at its idle time 
    to ensure master's online status to slave 
  */
  HEARTBEAT_LOG_EVENT= 27,
  
  /*
    In some situations, it is necessary to send over ignorable
    data to the slave: data that a slave can handle in case there
    is code for handling it, but which can be ignored if it is not
    recognized.

    These mysql-5.6 events are not recognized (and ignored) by MariaDB
  */
  IGNORABLE_LOG_EVENT= 28,
  ROWS_QUERY_LOG_EVENT= 29,
 
  /* Version 2 of the Row events, generated only by mysql-5.6.6+ */
  WRITE_ROWS_EVENT = 30,
  UPDATE_ROWS_EVENT = 31,
  DELETE_ROWS_EVENT = 32,
 
  /* MySQL 5.6 GTID events, ignored by MariaDB */
  GTID_LOG_EVENT= 33,
  ANONYMOUS_GTID_LOG_EVENT= 34,
  PREVIOUS_GTIDS_LOG_EVENT= 35,

  /* MySQL 5.7 events, ignored by MariaDB */
  TRANSACTION_CONTEXT_EVENT= 36,
  VIEW_CHANGE_EVENT= 37,
  /* not ignored */
  XA_PREPARE_LOG_EVENT= 38,

  /**
    Extension of UPDATE_ROWS_EVENT, allowing partial values according
    to binlog_row_value_options.
  */
  PARTIAL_UPDATE_ROWS_EVENT = 39,
  TRANSACTION_PAYLOAD_EVENT = 40,
  HEARTBEAT_LOG_EVENT_V2 = 41,

  /*
    Add new events here - right above this comment!
    Existing events (except ENUM_END_EVENT) should never change their numbers
  */

  /* New MySQL/Sun events are to be added right above this comment */
  MYSQL_EVENTS_END,

  MARIA_EVENTS_BEGIN= 160,
  /* New Maria event numbers start from here */
  ANNOTATE_ROWS_EVENT= 160,
  /*
    Binlog checkpoint event. Used for XA crash recovery on the master, not used
    in replication.
    A binlog checkpoint event specifies a binlog file such that XA crash
    recovery can start from that file - and it is guaranteed to find all XIDs
    that are prepared in storage engines but not yet committed.
  */
  BINLOG_CHECKPOINT_EVENT= 161,
  /*
    Gtid event. For global transaction ID, used to start a new event group,
    instead of the old BEGIN query event, and also to mark stand-alone
    events.
  */
  GTID_EVENT= 162,
  /*
    Gtid list event. Logged at the start of every binlog, to record the
    current replication state. This consists of the last GTID seen for
    each replication domain.
  */
  GTID_LIST_EVENT= 163,

  START_ENCRYPTION_EVENT= 164,

  /*
    Compressed binlog event.

    Note that the order between WRITE/UPDATE/DELETE events is significant;
    this is so that we can convert from the compressed to the uncompressed
    event type with (type-WRITE_ROWS_COMPRESSED_EVENT + WRITE_ROWS_EVENT)
    and similar for _V1.
  */
  QUERY_COMPRESSED_EVENT = 165,
  WRITE_ROWS_COMPRESSED_EVENT_V1 = 166,
  UPDATE_ROWS_COMPRESSED_EVENT_V1 = 167,
  DELETE_ROWS_COMPRESSED_EVENT_V1 = 168,
  WRITE_ROWS_COMPRESSED_EVENT = 169,
  UPDATE_ROWS_COMPRESSED_EVENT = 170,
  DELETE_ROWS_COMPRESSED_EVENT = 171,

  /* Add new MariaDB events here - right above this comment!  */

  ENUM_END_EVENT /* end marker */
};


/*
  Bit flags for what has been writing to cache. Used to
  discard logs with table map events but not row events and
  nothing else important. This is stored by cache.
*/

enum enum_logged_status
{
  LOGGED_TABLE_MAP= 1,
  LOGGED_ROW_EVENT= 2,
  LOGGED_NO_DATA=   4,
  LOGGED_CRITICAL=  8
};

static inline bool LOG_EVENT_IS_QUERY(enum Log_event_type type)
{
  return type == QUERY_EVENT || type == QUERY_COMPRESSED_EVENT;
}


static inline bool LOG_EVENT_IS_WRITE_ROW(enum Log_event_type type)
{
  return type == WRITE_ROWS_EVENT || type == WRITE_ROWS_EVENT_V1 ||
    type == WRITE_ROWS_COMPRESSED_EVENT ||
    type == WRITE_ROWS_COMPRESSED_EVENT_V1;
}


static inline bool LOG_EVENT_IS_UPDATE_ROW(enum Log_event_type type)
{
  return type == UPDATE_ROWS_EVENT || type == UPDATE_ROWS_EVENT_V1 ||
    type == UPDATE_ROWS_COMPRESSED_EVENT ||
    type == UPDATE_ROWS_COMPRESSED_EVENT_V1;
}


static inline bool LOG_EVENT_IS_DELETE_ROW(enum Log_event_type type)
{
  return type == DELETE_ROWS_EVENT || type == DELETE_ROWS_EVENT_V1 ||
    type == DELETE_ROWS_COMPRESSED_EVENT ||
    type == DELETE_ROWS_COMPRESSED_EVENT_V1;
}


static inline bool LOG_EVENT_IS_ROW_COMPRESSED(enum Log_event_type type)
{
  return type == WRITE_ROWS_COMPRESSED_EVENT ||
    type == WRITE_ROWS_COMPRESSED_EVENT_V1 ||
    type == UPDATE_ROWS_COMPRESSED_EVENT ||
    type == UPDATE_ROWS_COMPRESSED_EVENT_V1 ||
    type == DELETE_ROWS_COMPRESSED_EVENT ||
    type == DELETE_ROWS_COMPRESSED_EVENT_V1;
}


static inline bool LOG_EVENT_IS_ROW_V2(enum Log_event_type type)
{
  return (type >= WRITE_ROWS_EVENT && type <= DELETE_ROWS_EVENT) ||
    (type >= WRITE_ROWS_COMPRESSED_EVENT && type <= DELETE_ROWS_COMPRESSED_EVENT);
}


/*
   The number of types we handle in Format_description_log_event (UNKNOWN_EVENT
   is not to be handled, it does not exist in binlogs, it does not have a
   format).
*/
#define LOG_EVENT_TYPES (ENUM_END_EVENT-1)

enum Int_event_type
{
  INVALID_INT_EVENT = 0, LAST_INSERT_ID_EVENT = 1, INSERT_ID_EVENT = 2
};

#ifdef MYSQL_SERVER
class String;
class MYSQL_BIN_LOG;
class THD;
#endif

class Format_description_log_event;
class Relay_log_info;
class binlog_cache_data;

bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file);

#ifdef MYSQL_CLIENT
enum enum_base64_output_mode {
  BASE64_OUTPUT_NEVER= 0,
  BASE64_OUTPUT_AUTO= 1,
  BASE64_OUTPUT_UNSPEC= 2,
  BASE64_OUTPUT_DECODE_ROWS= 3,
  /* insert new output modes here */
  BASE64_OUTPUT_MODE_COUNT
};

bool copy_event_cache_to_string_and_reinit(IO_CACHE *cache, LEX_STRING *to);

/*
  A structure for mysqlbinlog to know how to print events

  This structure is passed to the event's print() methods,

  There are two types of settings stored here:
  1. Last db, flags2, sql_mode etc comes from the last printed event.
     They are stored so that only the necessary USE and SET commands
     are printed.
  2. Other information on how to print the events, e.g. short_form,
     hexdump_from.  These are not dependent on the last event.
*/
typedef struct st_print_event_info
{
  /*
    Settings for database, sql_mode etc that comes from the last event
    that was printed.  We cache these so that we don't have to print
    them if they are unchanged.
  */
  char db[FN_REFLEN+1]; // TODO: make this a LEX_STRING when thd->db is
  char charset[6]; // 3 variables, each of them storable in 2 bytes
  char time_zone_str[MAX_TIME_ZONE_NAME_LENGTH];
  char delimiter[16];
  sql_mode_t sql_mode;		/* must be same as THD.variables.sql_mode */
  my_thread_id thread_id;
  ulonglong row_events;
  ulong auto_increment_increment, auto_increment_offset;
  uint lc_time_names_number;
  uint charset_database_number;
  uint verbose;
  uchar gtid_ev_flags2;
  uint32 flags2;
  uint32 server_id;
  uint32 domain_id;
  uint8 common_header_len;
  enum_base64_output_mode base64_output_mode;
  my_off_t hexdump_from;

  table_mapping m_table_map;
  table_mapping m_table_map_ignored;
  bool flags2_inited;
  bool sql_mode_inited;
  bool charset_inited;
  bool thread_id_printed;
  bool server_id_printed;
  bool domain_id_printed;
  bool allow_parallel;
  bool allow_parallel_printed;
  bool found_row_event;
  bool print_row_count;
  static const uint max_delimiter_size= 16;
  /* Settings on how to print the events */
  bool short_form;
  /*
    This is set whenever a Format_description_event is printed.
    Later, when an event is printed in base64, this flag is tested: if
    no Format_description_event has been seen, it is unsafe to print
    the base64 event, so an error message is generated.
  */
  bool printed_fd_event;
  /*
    Track when @@skip_replication changes so we need to output a SET
    statement for it.
  */
  bool skip_replication;
  bool print_table_metadata;

  /*
     These two caches are used by the row-based replication events to
     collect the header information and the main body of the events
     making up a statement.
   */
  IO_CACHE head_cache;
  IO_CACHE body_cache;
  IO_CACHE tail_cache;
#ifdef WHEN_FLASHBACK_REVIEW_READY
  /* Storing the SQL for reviewing */
  IO_CACHE review_sql_cache;
#endif
  FILE *file;
  st_print_event_info();

  ~st_print_event_info() {
    close_cached_file(&head_cache);
    close_cached_file(&body_cache);
    close_cached_file(&tail_cache);
#ifdef WHEN_FLASHBACK_REVIEW_READY
    close_cached_file(&review_sql_cache);
#endif
  }
  bool init_ok() /* tells if construction was successful */
    { return my_b_inited(&head_cache) && my_b_inited(&body_cache)
#ifdef WHEN_FLASHBACK_REVIEW_READY
      && my_b_inited(&review_sql_cache)
#endif
    ; }
  void flush_for_error()
  {
    if (!copy_event_cache_to_file_and_reinit(&head_cache, file))
      copy_event_cache_to_file_and_reinit(&body_cache, file);
    fflush(file);
  }

  my_bool is_xa_trans();
} PRINT_EVENT_INFO;
#endif  // MYSQL_CLIENT

/**
  This class encapsulates writing of Log_event objects to IO_CACHE.
  Automatically calculates the checksum and encrypts the data, if necessary.
*/

class Log_event_writer
{
  /* Log_event_writer is updated when ctx is set */
  int (Log_event_writer::*encrypt_or_write)(const uchar *pos, size_t len);
public:
  ulonglong bytes_written;
  void *ctx;         ///< Encryption context or 0 if no encryption is needed
  uint checksum_len;
  int write(Log_event *ev);
  int write_header(uchar *pos, size_t len);
  int write_data(const uchar *pos, size_t len);
  int write_footer();
  my_off_t pos() { return my_b_safe_tell(file); }
  void add_status(enum_logged_status status);
  void set_incident();
  void set_encrypted_writer()
  { encrypt_or_write= &Log_event_writer::encrypt_and_write; }

  Log_event_writer(IO_CACHE *file_arg, binlog_cache_data *cache_data_arg,
                   Binlog_crypt_data *cr= 0)
    :encrypt_or_write(&Log_event_writer::write_internal),
    bytes_written(0), ctx(0),
    file(file_arg), cache_data(cache_data_arg), crypto(cr) { }

private:
  IO_CACHE *file;
  binlog_cache_data *cache_data;
  /**
    Placeholder for event checksum while writing to binlog.
   */
  ha_checksum crc;
  /**
    Encryption data (key, nonce). Only used if ctx != 0.
  */
  Binlog_crypt_data *crypto;
  /**
    Event length to be written into the next encrypted block
  */
  uint event_len;
  int write_internal(const uchar *pos, size_t len);
  int encrypt_and_write(const uchar *pos, size_t len);
  int maybe_write_event_len(uchar *pos, size_t len);
};

/**
  the struct aggregates two parameters that identify an event
  uniquely in scope of communication of a particular master and slave couple.
  I.e there can not be 2 events from the same staying connected master which
  have the same coordinates.
  @note
  Such identifier is not yet unique generally as the event originating master
  is resettable. Also the crashed master can be replaced with some other.
*/
typedef struct event_coordinates
{
  char * file_name; // binlog file name (directories stripped)
  my_off_t  pos;       // event's position in the binlog file
} LOG_POS_COORD;

/**
  @class Log_event

  This is the abstract base class for binary log events.
  
  @section Log_event_binary_format Binary Format

  Any @c Log_event saved on disk consists of the following three
  components.

  - Common-Header
  - Post-Header
  - Body

  The Common-Header, documented in the table @ref Table_common_header
  "below", always has the same form and length within one version of
  MySQL.  Each event type specifies a format and length of the
  Post-Header.  The length of the Common-Header is the same for all
  events of the same type.  The Body may be of different format and
  length even for different events of the same type.  The binary
  formats of Post-Header and Body are documented separately in each
  subclass.  The binary format of Common-Header is as follows.

  <table>
  <caption>Common-Header</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>timestamp</td>
    <td>4 byte unsigned integer</td>
    <td>The time when the query started, in seconds since 1970.
    </td>
  </tr>

  <tr>
    <td>type</td>
    <td>1 byte enumeration</td>
    <td>See enum #Log_event_type.</td>
  </tr>

  <tr>
    <td>server_id</td>
    <td>4 byte unsigned integer</td>
    <td>Server ID of the server that created the event.</td>
  </tr>

  <tr>
    <td>total_size</td>
    <td>4 byte unsigned integer</td>
    <td>The total size of this event, in bytes.  In other words, this
    is the sum of the sizes of Common-Header, Post-Header, and Body.
    </td>
  </tr>

  <tr>
    <td>master_position</td>
    <td>4 byte unsigned integer</td>
    <td>The position of the next event in the master binary log, in
    bytes from the beginning of the file.  In a binlog that is not a
    relay log, this is just the position of the next event, in bytes
    from the beginning of the file.  In a relay log, this is
    the position of the next event in the master's binlog.
    </td>
  </tr>

  <tr>
    <td>flags</td>
    <td>2 byte bitfield</td>
    <td>See Log_event::flags.</td>
  </tr>
  </table>

  Summing up the numbers above, we see that the total size of the
  common header is 19 bytes.

  @subsection Log_event_format_of_atomic_primitives Format of Atomic Primitives

  - All numbers, whether they are 16-, 24-, 32-, or 64-bit numbers,
  are stored in little endian, i.e., the least significant byte first,
  unless otherwise specified.

  @anchor packed_integer
  - Some events use a special format for efficient representation of
  unsigned integers, called Packed Integer.  A Packed Integer has the
  capacity of storing up to 8-byte integers, while small integers
  still can use 1, 3, or 4 bytes.  The value of the first byte
  determines how to read the number, according to the following table:

  <table>
  <caption>Format of Packed Integer</caption>

  <tr>
    <th>First byte</th>
    <th>Format</th>
  </tr>

  <tr>
    <td>0-250</td>
    <td>The first byte is the number (in the range 0-250), and no more
    bytes are used.</td>
  </tr>

  <tr>
    <td>252</td>
    <td>Two more bytes are used.  The number is in the range
    251-0xffff.</td>
  </tr>

  <tr>
    <td>253</td>
    <td>Three more bytes are used.  The number is in the range
    0xffff-0xffffff.</td>
  </tr>

  <tr>
    <td>254</td>
    <td>Eight more bytes are used.  The number is in the range
    0xffffff-0xffffffffffffffff.</td>
  </tr>

  </table>

  - Strings are stored in various formats.  The format of each string
  is documented separately.
*/
class Log_event
{
public:
  /**
     Enumeration of what kinds of skipping (and non-skipping) that can
     occur when the slave executes an event.

     @see shall_skip
     @see do_shall_skip
   */
  enum enum_skip_reason {
    /**
       Don't skip event.
    */
    EVENT_SKIP_NOT,

    /**
       Skip event by ignoring it.

       This means that the slave skip counter will not be changed.
    */
    EVENT_SKIP_IGNORE,

    /**
       Skip event and decrease skip counter.
    */
    EVENT_SKIP_COUNT
  };

  enum enum_event_cache_type 
  {
    EVENT_INVALID_CACHE,
    /* 
      If possible the event should use a non-transactional cache before
      being flushed to the binary log. This means that it must be flushed
      right after its correspondent statement is completed.
    */
    EVENT_STMT_CACHE,
    /* 
      The event should use a transactional cache before being flushed to
      the binary log. This means that it must be flushed upon commit or 
      rollback. 
    */
    EVENT_TRANSACTIONAL_CACHE,
    /* 
      The event must be written directly to the binary log without going
      through a cache.
    */
    EVENT_NO_CACHE,
    /**
       If there is a need for different types, introduce them before this.
    */
    EVENT_CACHE_COUNT
  };

  /*
    The following type definition is to be used whenever data is placed 
    and manipulated in a common buffer. Use this typedef for buffers
    that contain data containing binary and character data.
  */
  typedef unsigned char Byte;

  /*
    The offset in the log where this event originally appeared (it is
    preserved in relay logs, making SHOW SLAVE STATUS able to print
    coordinates of the event in the master's binlog). Note: when a
    transaction is written by the master to its binlog (wrapped in
    BEGIN/COMMIT) the log_pos of all the queries it contains is the
    one of the BEGIN (this way, when one does SHOW SLAVE STATUS it
    sees the offset of the BEGIN, which is logical as rollback may
    occur), except the COMMIT query which has its real offset.
  */
  my_off_t log_pos;
  /*
     A temp buffer for read_log_event; it is later analysed according to the
     event's type, and its content is distributed in the event-specific fields.
  */
  uchar *temp_buf;
  
  /*
    TRUE <=> this event 'owns' temp_buf and should call my_free() when done
    with it
  */
  bool event_owns_temp_buf;

  /*
    Timestamp on the master(for debugging and replication of
    NOW()/TIMESTAMP).  It is important for queries and LOAD DATA
    INFILE. This is set at the event's creation time, except for Query
    and Load (et al.) events where this is set at the query's
    execution time, which guarantees good replication (otherwise, we
    could have a query and its event with different timestamps).
  */
  my_time_t when;
  ulong     when_sec_part;
  /* The number of seconds the query took to run on the master. */
  ulong exec_time;
  /* Number of bytes written by write() function */
  size_t data_written;

  /*
    The master's server id (is preserved in the relay log; used to
    prevent from infinite loops in circular replication).
  */
  uint32 server_id;

  /**
    Some 16 flags. See the definitions above for LOG_EVENT_TIME_F,
    LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F,
    LOG_EVENT_SUPPRESS_USE_F, and LOG_EVENT_SKIP_REPLICATION_F for notes.
  */
  uint16 flags;

  enum_event_cache_type cache_type;

  /**
    A storage to cache the global system variable's value.
    Handling of a separate event will be governed its member.
  */
  ulong slave_exec_mode;

  Log_event_writer *writer;

#ifdef MYSQL_SERVER
  THD* thd;

  Log_event();
  Log_event(THD* thd_arg, uint16 flags_arg, bool is_transactional);

  /*
    init_show_field_list() prepares the column names and types for the
    output of SHOW BINLOG EVENTS; it is used only by SHOW BINLOG
    EVENTS.
  */
  static void init_show_field_list(THD *thd, List<Item>* field_list);
#ifdef HAVE_REPLICATION
  int net_send(Protocol *protocol, const char* log_name, my_off_t pos);

  /*
    pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends
    a string to display to the user, so it resembles print().
  */

  virtual void pack_info(Protocol *protocol);

#endif /* HAVE_REPLICATION */
  virtual const char* get_db()
  {
    return thd ? thd->db.str : 0;
  }
#else
  Log_event() : temp_buf(0), when(0), flags(0) {}
  ha_checksum crc;
  /* print*() functions are used by mysqlbinlog */
  virtual bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0;
  bool print_timestamp(IO_CACHE* file, time_t *ts = 0);
  bool print_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info,
                    bool is_more);
  bool print_base64(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info,
                    bool do_print_encoded);
#endif /* MYSQL_SERVER */

  /* The following code used for Flashback */
#ifdef MYSQL_CLIENT
  my_bool is_flashback;
  my_bool need_flashback_review;
  String  output_buf; // Storing the event output
#ifdef WHEN_FLASHBACK_REVIEW_READY
  String  m_review_dbname;
  String  m_review_tablename;

  void set_review_dbname(const char *name)
  {
    if (name)
    {
      m_review_dbname.free();
      m_review_dbname.append(name);
    }
  }
  void set_review_tablename(const char *name)
  {
    if (name)
    {
      m_review_tablename.free();
      m_review_tablename.append(name);
    }
  }
  const char *get_review_dbname() const { return m_review_dbname.ptr(); }
  const char *get_review_tablename() const { return m_review_tablename.ptr(); }
#endif
#endif

  /*
    read_log_event() functions read an event from a binlog or relay
    log; used by SHOW BINLOG EVENTS, the binlog_dump thread on the
    master (reads master's binlog), the slave IO thread (reads the
    event sent by binlog_dump), the slave SQL thread (reads the event
    from the relay log).  If mutex is 0, the read will proceed without
    mutex.  We need the description_event to be able to parse the
    event (to know the post-header's size); in fact in read_log_event
    we detect the event's type, then call the specific event's
    constructor and pass description_event as an argument.
  */
  static Log_event* read_log_event(IO_CACHE* file, int *out_error,
                                   const Format_description_log_event
                                   *description_event,
                                   my_bool crc_check,
                                   my_bool print_errors= 1);

  /**
    Reads an event from a binlog or relay log. Used by the dump thread
    this method reads the event into a raw buffer without parsing it.

    @Note If mutex is 0, the read will proceed without mutex.

    @Note If a log name is given than the method will check if the
    given binlog is still active.

    @param[in]  file                log file to be read
    @param[out] packet              packet to hold the event
    @param[in]  checksum_alg_arg    verify the event checksum using this
                                    algorithm (or don't if it's
                                    use BINLOG_CHECKSUM_ALG_OFF)

    @retval 0                   success
    @retval LOG_READ_EOF        end of file, nothing was read
    @retval LOG_READ_BOGUS      malformed event
    @retval LOG_READ_IO         io error while reading
    @retval LOG_READ_MEM        packet memory allocation failed
    @retval LOG_READ_TRUNC      only a partial event could be read
    @retval LOG_READ_TOO_LARGE  event too large
   */
  static int read_log_event(IO_CACHE* file, String* packet,
                            const Format_description_log_event *fdle,
                            enum enum_binlog_checksum_alg checksum_alg_arg);
  /* 
     The value is set by caller of FD constructor and
     Log_event::write_header() for the rest.
     In the FD case it's propagated into the last byte 
     of post_header_len[] at FD::write().
     On the slave side the value is assigned from post_header_len[last] 
     of the last seen FD event.
  */
  enum enum_binlog_checksum_alg checksum_alg;

  static void *operator new(size_t size)
  {
    extern PSI_memory_key key_memory_log_event;
    return my_malloc(key_memory_log_event, size, MYF(MY_WME|MY_FAE));
  }

  static void operator delete(void *ptr, size_t)
  {
    my_free(ptr);
  }

  /* Placement version of the above operators */
  static void *operator new(size_t, void* ptr) { return ptr; }
  static void operator delete(void*, void*) { }

#ifdef MYSQL_SERVER
  bool write_header(size_t event_data_length);
  bool write_data(const uchar *buf, size_t data_length)
  { return writer->write_data(buf, data_length); }
  bool write_data(const char *buf, size_t data_length)
  { return write_data((uchar*)buf, data_length); }
  bool write_footer()
  { return writer->write_footer(); }

  my_bool need_checksum();

  virtual bool write()
  {
    return write_header(get_data_size()) || write_data_header() ||
	   write_data_body() || write_footer();
  }
  virtual bool write_data_header()
  { return 0; }
  virtual bool write_data_body()
  { return 0; }

  /* Return start of query time or current time */
  inline my_time_t get_time()
  {
    THD *tmp_thd;
    if (when)
      return when;
    if (thd)
    {
      when= thd->start_time;
      when_sec_part= thd->start_time_sec_part;
      return when;
    }
    /* thd will only be 0 here at time of log creation */
    if ((tmp_thd= current_thd))
    {
      when= tmp_thd->start_time;
      when_sec_part= tmp_thd->start_time_sec_part;
      return when;
    }
    my_hrtime_t hrtime= my_hrtime();
    when= hrtime_to_my_time(hrtime);
    when_sec_part= hrtime_sec_part(hrtime);
    return when;
  }
#endif
  virtual Log_event_type get_type_code() = 0;
  virtual enum_logged_status logged_status() { return LOGGED_CRITICAL; }
  virtual bool is_valid() const = 0;
  virtual my_off_t get_header_len(my_off_t len) { return len; }
  void set_artificial_event() { flags |= LOG_EVENT_ARTIFICIAL_F; }
  void set_relay_log_event() { flags |= LOG_EVENT_RELAY_LOG_F; }
  bool is_artificial_event() const { return flags & LOG_EVENT_ARTIFICIAL_F; }
  bool is_relay_log_event() const { return flags & LOG_EVENT_RELAY_LOG_F; }
  inline bool use_trans_cache() const
  { 
    return (cache_type == Log_event::EVENT_TRANSACTIONAL_CACHE);
  }
  inline void set_direct_logging()
  {
    cache_type = Log_event::EVENT_NO_CACHE;
  }
  inline bool use_direct_logging()
  {
    return (cache_type == Log_event::EVENT_NO_CACHE);
  }
  Log_event(const uchar *buf, const Format_description_log_event
            *description_event);
  virtual ~Log_event() { free_temp_buf();}
  void register_temp_buf(uchar* buf, bool must_free)
  { 
    temp_buf= buf; 
    event_owns_temp_buf= must_free;
  }
  void free_temp_buf()
  {
    if (temp_buf)
    {
      if (event_owns_temp_buf)
        my_free(temp_buf);
      temp_buf = 0;
    }
  }
  /*
    Get event length for simple events. For complicated events the length
    is calculated during write()
  */
  virtual int get_data_size() { return 0;}
  static Log_event* read_log_event(const uchar *buf, uint event_len,
				   const char **error,
                                   const Format_description_log_event
                                   *description_event, my_bool crc_check,
                                   my_bool print_errors= 1);
  /**
    Returns the human readable name of the given event type.
  */
  static const char* get_type_str(Log_event_type type);
  /**
    Returns the human readable name of this event's type.
  */
  const char* get_type_str();

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)

  /**
     Apply the event to the database.

     This function represents the public interface for applying an
     event.

     @see do_apply_event
   */
  int apply_event(rpl_group_info *rgi)
  {
    int res;
    THD_STAGE_INFO(thd, stage_apply_event);
    res= do_apply_event(rgi);
    THD_STAGE_INFO(thd, stage_after_apply_event);
    return res;
  }


  /**
     Update the relay log position.

     This function represents the public interface for "stepping over"
     the event and will update the relay log information.

     @see do_update_pos
   */
  int update_pos(rpl_group_info *rgi)
  {
    return do_update_pos(rgi);
  }

  /**
     Decide if the event shall be skipped, and the reason for skipping
     it.

     @see do_shall_skip
   */
  enum_skip_reason shall_skip(rpl_group_info *rgi)
  {
    return do_shall_skip(rgi);
  }


  /*
    Check if an event is non-final part of a stand-alone event group,
    such as Intvar_log_event (such events should be processed as part
    of the following event group, not individually).
    See also is_part_of_group()
  */
  static bool is_part_of_group(enum Log_event_type ev_type)
  {
    switch (ev_type)
    {
    case GTID_EVENT:
    case INTVAR_EVENT:
    case RAND_EVENT:
    case USER_VAR_EVENT:
    case TABLE_MAP_EVENT:
    case ANNOTATE_ROWS_EVENT:
      return true;
    case DELETE_ROWS_EVENT:
    case UPDATE_ROWS_EVENT:
    case WRITE_ROWS_EVENT:
    /*
      ToDo: also check for non-final Rows_log_event (though such events
      are usually in a BEGIN-COMMIT group).
    */
    default:
      return false;
    }
  }
  /*
    Same as above, but works on the object. In addition this is true for all
    rows event except the last one.
  */
  virtual bool is_part_of_group() { return 0; }

  static bool is_group_event(enum Log_event_type ev_type)
  {
    switch (ev_type)
    {
    case START_EVENT_V3:
    case STOP_EVENT:
    case ROTATE_EVENT:
    case SLAVE_EVENT:
    case FORMAT_DESCRIPTION_EVENT:
    case INCIDENT_EVENT:
    case HEARTBEAT_LOG_EVENT:
    case BINLOG_CHECKPOINT_EVENT:
    case GTID_LIST_EVENT:
    case START_ENCRYPTION_EVENT:
      return false;

    default:
      return true;
    }
  }
  
protected:

  /**
     Helper function to ignore an event w.r.t. the slave skip counter.

     This function can be used inside do_shall_skip() for functions
     that cannot end a group. If the slave skip counter is 1 when
     seeing such an event, the event shall be ignored, the counter
     left intact, and processing continue with the next event.

     A typical usage is:
     @code
     enum_skip_reason do_shall_skip(rpl_group_info *rgi) {
       return continue_group(rgi);
     }
     @endcode

     @return Skip reason
   */
  enum_skip_reason continue_group(rpl_group_info *rgi);

  /**
    Primitive to apply an event to the database.

    This is where the change to the database is made.

    @note The primitive is protected instead of private, since there
    is a hierarchy of actions to be performed in some cases.

    @see Format_description_log_event::do_apply_event()

    @param rli Pointer to relay log info structure

    @retval 0     Event applied successfully
    @retval errno Error code if event application failed
  */
  virtual int do_apply_event(rpl_group_info *rgi)
  {
    return 0;                /* Default implementation does nothing */
  }


  /**
     Advance relay log coordinates.

     This function is called to advance the relay log coordinates to
     just after the event.  It is essential that both the relay log
     coordinate and the group log position is updated correctly, since
     this function is used also for skipping events.

     Normally, each implementation of do_update_pos() shall:

     - Update the event position to refer to the position just after
       the event.

     - Update the group log position to refer to the position just
       after the event <em>if the event is last in a group</em>

     @param rli Pointer to relay log info structure

     @retval 0     Coordinates changed successfully
     @retval errno Error code if advancing failed (usually just
                   1). Observe that handler errors are returned by the
                   do_apply_event() function, and not by this one.
   */
  virtual int do_update_pos(rpl_group_info *rgi);


  /**
     Decide if this event shall be skipped or not and the reason for
     skipping it.

     The default implementation decide that the event shall be skipped
     if either:

     - the server id of the event is the same as the server id of the
       server and <code>rli->replicate_same_server_id</code> is true,
       or

     - if <code>rli->slave_skip_counter</code> is greater than zero.

     @see do_apply_event
     @see do_update_pos

     @retval Log_event::EVENT_SKIP_NOT
     The event shall not be skipped and should be applied.

     @retval Log_event::EVENT_SKIP_IGNORE
     The event shall be skipped by just ignoring it, i.e., the slave
     skip counter shall not be changed. This happends if, for example,
     the originating server id of the event is the same as the server
     id of the slave.

     @retval Log_event::EVENT_SKIP_COUNT
     The event shall be skipped because the slave skip counter was
     non-zero. The caller shall decrease the counter by one.
   */
  virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi);
#endif
};


/*
   One class for each type of event.
   Two constructors for each class:
   - one to create the event for logging (when the server acts as a master),
   called after an update to the database is done,
   which accepts parameters like the query, the database, the options for LOAD
   DATA INFILE...
   - one to create the event from a packet (when the server acts as a slave),
   called before reproducing the update, which accepts parameters (like a
   buffer). Used to read from the master, from the relay log, and in
   mysqlbinlog. This constructor must be format-tolerant.
*/

/**
  @class Query_log_event
   
  A @c Query_log_event is created for each query that modifies the
  database, unless the query is logged row-based.

  @section Query_log_event_binary_format Binary format

  See @ref Log_event_binary_format "Binary format for log events" for
  a general discussion and introduction to the binary format of binlog
  events.

  The Post-Header has five components:

  <table>
  <caption>Post-Header for Query_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>slave_proxy_id</td>
    <td>4 byte unsigned integer</td>
    <td>An integer identifying the client thread that issued the
    query.  The id is unique per server.  (Note, however, that two
    threads on different servers may have the same slave_proxy_id.)
    This is used when a client thread creates a temporary table local
    to the client.  The slave_proxy_id is used to distinguish
    temporary tables that belong to different clients.
    </td>
  </tr>

  <tr>
    <td>exec_time</td>
    <td>4 byte unsigned integer</td>
    <td>The time from when the query started to when it was logged in
    the binlog, in seconds.</td>
  </tr>

  <tr>
    <td>db_len</td>
    <td>1 byte integer</td>
    <td>The length of the name of the currently selected database.</td>
  </tr>

  <tr>
    <td>error_code</td>
    <td>2 byte unsigned integer</td>
    <td>Error code generated by the master.  If the master fails, the
    slave will fail with the same error code, except for the error
    codes ER_DB_CREATE_EXISTS == 1007 and ER_DB_DROP_EXISTS == 1008.
    </td>
  </tr>

  <tr>
    <td>status_vars_len</td>
    <td>2 byte unsigned integer</td>
    <td>The length of the status_vars block of the Body, in bytes. See
    @ref query_log_event_status_vars "below".
    </td>
  </tr>
  </table>

  The Body has the following components:

  <table>
  <caption>Body for Query_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>@anchor query_log_event_status_vars status_vars</td>
    <td>status_vars_len bytes</td>
    <td>Zero or more status variables.  Each status variable consists
    of one byte identifying the variable stored, followed by the value
    of the variable.  The possible variables are listed separately in
    the table @ref Table_query_log_event_status_vars "below".  MySQL
    always writes events in the order defined below; however, it is
    capable of reading them in any order.  </td>
  </tr>

  <tr>
    <td>db</td>
    <td>db_len+1</td>
    <td>The currently selected database, as a null-terminated string.

    (The trailing zero is redundant since the length is already known;
    it is db_len from Post-Header.)
    </td>
  </tr>

  <tr>
    <td>query</td>
    <td>variable length string without trailing zero, extending to the
    end of the event (determined by the length field of the
    Common-Header)
    </td>
    <td>The SQL query.</td>
  </tr>
  </table>

  The following table lists the status variables that may appear in
  the status_vars field.

  @anchor Table_query_log_event_status_vars
  <table>
  <caption>Status variables for Query_log_event</caption>

  <tr>
    <th>Status variable</th>
    <th>1 byte identifier</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>flags2</td>
    <td>Q_FLAGS2_CODE == 0</td>
    <td>4 byte bitfield</td>
    <td>The flags in @c thd->options, binary AND-ed with @c
    OPTIONS_WRITTEN_TO_BIN_LOG.  The @c thd->options bitfield contains
    options for "SELECT".  @c OPTIONS_WRITTEN identifies those options
    that need to be written to the binlog (not all do).

    These flags correspond to the SQL variables SQL_AUTO_IS_NULL,
    FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, and AUTOCOMMIT, documented in
    the "SET Syntax" section of the MySQL Manual.

    This field is always written to the binlog in version >= 5.0, and
    never written in version < 5.0.
    </td>
  </tr>

  <tr>
    <td>sql_mode</td>
    <td>Q_SQL_MODE_CODE == 1</td>
    <td>8 byte bitfield</td>
    <td>The @c sql_mode variable.  See the section "SQL Modes" in the
    MySQL manual, and see sql_priv.h for a list of the possible
    flags. Currently (2007-10-04), the following flags are available:
    <pre>
    MODE_REAL_AS_FLOAT==0x1
    MODE_PIPES_AS_CONCAT==0x2
    MODE_ANSI_QUOTES==0x4
    MODE_IGNORE_SPACE==0x8
    MODE_IGNORE_BAD_TABLE_OPTIONS==0x10
    MODE_ONLY_FULL_GROUP_BY==0x20
    MODE_NO_UNSIGNED_SUBTRACTION==0x40
    MODE_NO_DIR_IN_CREATE==0x80
    MODE_POSTGRESQL==0x100
    MODE_ORACLE==0x200
    MODE_MSSQL==0x400
    MODE_DB2==0x800
    MODE_MAXDB==0x1000
    MODE_NO_KEY_OPTIONS==0x2000
    MODE_NO_TABLE_OPTIONS==0x4000
    MODE_NO_FIELD_OPTIONS==0x8000
    MODE_MYSQL323==0x10000
    MODE_MYSQL323==0x20000
    MODE_MYSQL40==0x40000
    MODE_ANSI==0x80000
    MODE_NO_AUTO_VALUE_ON_ZERO==0x100000
    MODE_NO_BACKSLASH_ESCAPES==0x200000
    MODE_STRICT_TRANS_TABLES==0x400000
    MODE_STRICT_ALL_TABLES==0x800000
    MODE_NO_ZERO_IN_DATE==0x1000000
    MODE_NO_ZERO_DATE==0x2000000
    MODE_INVALID_DATES==0x4000000
    MODE_ERROR_FOR_DIVISION_BY_ZERO==0x8000000
    MODE_TRADITIONAL==0x10000000
    MODE_NO_AUTO_CREATE_USER==0x20000000
    MODE_HIGH_NOT_PRECEDENCE==0x40000000
    MODE_PAD_CHAR_TO_FULL_LENGTH==0x80000000
    </pre>
    All these flags are replicated from the server.  However, all
    flags except @c MODE_NO_DIR_IN_CREATE are honored by the slave;
    the slave always preserves its old value of @c
    MODE_NO_DIR_IN_CREATE.  For a rationale, see comment in
    @c Query_log_event::do_apply_event in @c log_event.cc.

    This field is always written to the binlog.
    </td>
  </tr>

  <tr>
    <td>catalog</td>
    <td>Q_CATALOG_NZ_CODE == 6</td>
    <td>Variable-length string: the length in bytes (1 byte) followed
    by the characters (at most 255 bytes)
    </td>
    <td>Stores the client's current catalog.  Every database belongs
    to a catalog, the same way that every table belongs to a
    database.  Currently, there is only one catalog, "std".

    This field is written if the length of the catalog is > 0;
    otherwise it is not written.
    </td>
  </tr>

  <tr>
    <td>auto_increment</td>
    <td>Q_AUTO_INCREMENT == 3</td>
    <td>two 2 byte unsigned integers, totally 2+2=4 bytes</td>

    <td>The two variables auto_increment_increment and
    auto_increment_offset, in that order.  For more information, see
    "System variables" in the MySQL manual.

    This field is written if auto_increment > 1.  Otherwise, it is not
    written.
    </td>
  </tr>

  <tr>
    <td>charset</td>
    <td>Q_CHARSET_CODE == 4</td>
    <td>three 2 byte unsigned integers, totally 2+2+2=6 bytes</td>
    <td>The three variables character_set_client,
    collation_connection, and collation_server, in that order.
    character_set_client is a code identifying the character set and
    collation used by the client to encode the query.
    collation_connection identifies the character set and collation
    that the master converts the query to when it receives it; this is
    useful when comparing literal strings.  collation_server is the
    default character set and collation used when a new database is
    created.

    See also "Connection Character Sets and Collations" in the MySQL
    5.1 manual.

    All three variables are codes identifying a (character set,
    collation) pair.  To see which codes map to which pairs, run the
    query "SELECT id, character_set_name, collation_name FROM
    COLLATIONS".

    Cf. Q_CHARSET_DATABASE_CODE below.

    This field is always written.
    </td>
  </tr>

  <tr>
    <td>time_zone</td>
    <td>Q_TIME_ZONE_CODE == 5</td>
    <td>Variable-length string: the length in bytes (1 byte) followed
    by the characters (at most 255 bytes).
    <td>The time_zone of the master.

    See also "System Variables" and "MySQL Server Time Zone Support"
    in the MySQL manual.

    This field is written if the length of the time zone string is >
    0; otherwise, it is not written.
    </td>
  </tr>

  <tr>
    <td>lc_time_names_number</td>
    <td>Q_LC_TIME_NAMES_CODE == 7</td>
    <td>2 byte integer</td>
    <td>A code identifying a table of month and day names.  The
    mapping from codes to languages is defined in @c sql_locale.cc.

    This field is written if it is not 0, i.e., if the locale is not
    en_US.
    </td>
  </tr>

  <tr>
    <td>charset_database_number</td>
    <td>Q_CHARSET_DATABASE_CODE == 8</td>
    <td>2 byte integer</td>

    <td>The value of the collation_database system variable (in the
    source code stored in @c thd->variables.collation_database), which
    holds the code for a (character set, collation) pair as described
    above (see Q_CHARSET_CODE).

    collation_database was used in old versions (???WHEN).  Its value
    was loaded when issuing a "use db" query and could be changed by
    issuing a "SET collation_database=xxx" query.  It used to affect
    the "LOAD DATA INFILE" and "CREATE TABLE" commands.

    In newer versions, "CREATE TABLE" has been changed to take the
    character set from the database of the created table, rather than
    the character set of the current database.  This makes a
    difference when creating a table in another database than the
    current one.  "LOAD DATA INFILE" has not yet changed to do this,
    but there are plans to eventually do it, and to make
    collation_database read-only.

    This field is written if it is not 0.
    </td>
  </tr>
  <tr>
    <td>table_map_for_update</td>
    <td>Q_TABLE_MAP_FOR_UPDATE_CODE == 9</td>
    <td>8 byte integer</td>

    <td>The value of the table map that is to be updated by the
    multi-table update query statement. Every bit of this variable
    represents a table, and is set to 1 if the corresponding table is
    to be updated by this statement.

    The value of this variable is set when executing a multi-table update
    statement and used by slave to apply filter rules without opening
    all the tables on slave. This is required because some tables may
    not exist on slave because of the filter rules.
    </td>
  </tr>
  </table>

  @subsection Query_log_event_notes_on_previous_versions Notes on Previous Versions

  * Status vars were introduced in version 5.0.  To read earlier
  versions correctly, check the length of the Post-Header.

  * The status variable Q_CATALOG_CODE == 2 existed in MySQL 5.0.x,
  where 0<=x<=3.  It was identical to Q_CATALOG_CODE, except that the
  string had a trailing '\0'.  The '\0' was removed in 5.0.4 since it
  was redundant (the string length is stored before the string).  The
  Q_CATALOG_CODE will never be written by a new master, but can still
  be understood by a new slave.

  * See Q_CHARSET_DATABASE_CODE in the table above.

  * When adding new status vars, please don't forget to update the
  MAX_SIZE_LOG_EVENT_STATUS, and update function code_name

*/
class Query_log_event: public Log_event
{
  LEX_CSTRING user;
  LEX_CSTRING host;
protected:
  Log_event::Byte* data_buf;
public:
  const char* query;
  const char* catalog;
  const char* db;
  /*
    If we already know the length of the query string
    we pass it with q_len, so we would not have to call strlen()
    otherwise, set it to 0, in which case, we compute it with strlen()
  */
  uint32 q_len;
  uint32 db_len;
  uint16 error_code;
  my_thread_id thread_id;
  /*
    For events created by Query_log_event::do_apply_event (and
    Load_log_event::do_apply_event()) we need the *original* thread
    id, to be able to log the event with the original (=master's)
    thread id (fix for BUG#1686).
  */
  ulong slave_proxy_id;

  /*
    Binlog format 3 and 4 start to differ (as far as class members are
    concerned) from here.
  */

  uint catalog_len;			// <= 255 char; 0 means uninited

  /*
    We want to be able to store a variable number of N-bit status vars:
    (generally N=32; but N=64 for SQL_MODE) a user may want to log the number
    of affected rows (for debugging) while another does not want to lose 4
    bytes in this.
    The storage on disk is the following:
    status_vars_len is part of the post-header,
    status_vars are in the variable-length part, after the post-header, before
    the db & query.
    status_vars on disk is a sequence of pairs (code, value) where 'code' means
    'sql_mode', 'affected' etc. Sometimes 'value' must be a short string, so
    its first byte is its length. For now the order of status vars is:
    flags2 - sql_mode - catalog - autoinc - charset
    We should add the same thing to Load_log_event, but in fact
    LOAD DATA INFILE is going to be logged with a new type of event (logging of
    the plain text query), so Load_log_event would be frozen, so no need. The
    new way of logging LOAD DATA INFILE would use a derived class of
    Query_log_event, so automatically benefit from the work already done for
    status variables in Query_log_event.
 */
  uint16 status_vars_len;

  /*
    'flags2' is a second set of flags (on top of those in Log_event), for
    session variables. These are thd->options which is & against a mask
    (OPTIONS_WRITTEN_TO_BIN_LOG).
    flags2_inited helps make a difference between flags2==0 (3.23 or 4.x
    master, we don't know flags2, so use the slave server's global options) and
    flags2==0 (5.0 master, we know this has a meaning of flags all down which
    must influence the query).
  */
  uint32 flags2_inited;
  bool sql_mode_inited;
  bool charset_inited;

  uint32 flags2;
  sql_mode_t sql_mode;
  ulong auto_increment_increment, auto_increment_offset;
  char charset[6];
  uint time_zone_len; /* 0 means uninited */
  const char *time_zone_str;
  uint lc_time_names_number; /* 0 means en_US */
  uint charset_database_number;
  /*
    map for tables that will be updated for a multi-table update query
    statement, for other query statements, this will be zero.
  */
  ulonglong table_map_for_update;
  /* Xid for the event, if such exists */
  ulonglong xid;
  /*
    Holds the original length of a Query_log_event that comes from a
    master of version < 5.0 (i.e., binlog_version < 4). When the IO
    thread writes the relay log, it augments the Query_log_event with a
    Q_MASTER_DATA_WRITTEN_CODE status_var that holds the original event
    length. This field is initialized to non-zero in the SQL thread when
    it reads this augmented event. SQL thread does not write 
    Q_MASTER_DATA_WRITTEN_CODE to the slave's server binlog.
  */
  uint32 master_data_written;

#ifdef MYSQL_SERVER

  Query_log_event(THD* thd_arg, const char* query_arg, size_t query_length,
                  bool using_trans, bool direct, bool suppress_use, int error);
  const char* get_db() override { return db; }
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info);
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Query_log_event();
  Query_log_event(const uchar *buf, uint event_len,
                  const Format_description_log_event *description_event,
                  Log_event_type event_type);
  ~Query_log_event()
  {
    if (data_buf)
      my_free(data_buf);
  }
  Log_event_type get_type_code() override { return QUERY_EVENT; }
  static int dummy_event(String *packet, ulong ev_offset, enum enum_binlog_checksum_alg checksum_alg);
  static int begin_event(String *packet, ulong ev_offset, enum enum_binlog_checksum_alg checksum_alg);
#ifdef MYSQL_SERVER
  bool write() override;
  virtual bool write_post_header_for_derived() { return FALSE; }
#endif
  bool is_valid() const override { return query != 0; }

  /*
    Returns number of bytes additionally written to post header by derived
    events (so far it is only Execute_load_query event).
  */
  virtual ulong get_post_header_size_for_derived() { return 0; }
  /* Writes derived event-specific part of post header. */

public:        /* !!! Public in this patch to allow old usage */
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
  int do_apply_event(rpl_group_info *rgi) override;

  int do_apply_event(rpl_group_info *rgi,
                       const char *query_arg,
                       uint32 q_len_arg);
  static bool peek_is_commit_rollback(const uchar *event_start,
                                      size_t event_len,
                                      enum enum_binlog_checksum_alg
                                      checksum_alg);
#endif /* HAVE_REPLICATION */
  /*
    If true, the event always be applied by slave SQL thread or be printed by
    mysqlbinlog
   */
  bool is_trans_keyword(bool is_xa)
  {
    /*
      Before the patch for bug#50407, The 'SAVEPOINT and ROLLBACK TO'
      queries input by user was written into log events directly.
      So the keywords can be written in both upper case and lower case
      together, strncasecmp is used to check both cases. they also could be
      binlogged with comments in the front of these keywords. for examples:
        / * bla bla * / SAVEPOINT a;
        / * bla bla * / ROLLBACK TO a;
      but we don't handle these cases and after the patch, both quiries are
      binlogged in upper case with no comments.
     */
    return is_xa ? !strncasecmp(query, C_STRING_WITH_LEN("XA "))
                 : (!strncmp(query, "BEGIN", q_len) ||
                    !strncmp(query, "COMMIT", q_len) ||
                    !strncasecmp(query, "SAVEPOINT", 9) ||
                    !strncasecmp(query, "ROLLBACK", 8));
  }
  virtual bool is_begin()    { return !strcmp(query, "BEGIN"); }
  virtual bool is_commit()   { return !strcmp(query, "COMMIT"); }
  virtual bool is_rollback() { return !strcmp(query, "ROLLBACK"); }
};

class Query_compressed_log_event:public Query_log_event{
protected:
  Log_event::Byte* query_buf;  // point to the uncompressed query
public:
  Query_compressed_log_event(const uchar *buf, uint event_len,
    const Format_description_log_event *description_event,
    Log_event_type event_type);
  ~Query_compressed_log_event()
  {
    if (query_buf)
      my_free(query_buf);
  }
  Log_event_type get_type_code() override { return QUERY_COMPRESSED_EVENT; }

  /*
    the min length of log_bin_compress_min_len is 10,
    means that Begin/Commit/Rollback would never be compressed!  
  */
  bool is_begin() override    { return false; }
  bool is_commit() override   { return false; }
  bool is_rollback() override { return false; }
#ifdef MYSQL_SERVER
  Query_compressed_log_event(THD* thd_arg, const char* query_arg,
                             ulong query_length,
                             bool using_trans, bool direct, bool suppress_use,
                             int error);
  bool write() override;
#endif
};


/*****************************************************************************
  sql_ex_info struct
 ****************************************************************************/
struct sql_ex_info
{
  const char* field_term;
  const char* enclosed;
  const char* line_term;
  const char* line_start;
  const char* escaped;
  int cached_new_format= -1;
  uint8 field_term_len= 0, enclosed_len= 0, line_term_len= 0,
    line_start_len= 0, escaped_len= 0;
  char opt_flags;
  char empty_flags= 0;

  // store in new format even if old is possible
  void force_new_format() { cached_new_format = 1;}
  int data_size()
  {
    return (new_format() ?
	    field_term_len + enclosed_len + line_term_len +
	    line_start_len + escaped_len + 6 : 7);
  }
  bool write_data(Log_event_writer *writer);
  const uchar *init(const uchar *buf, const uchar* buf_end, bool use_new_format);
  bool new_format()
  {
    return ((cached_new_format != -1) ? cached_new_format :
	    (cached_new_format=(field_term_len > 1 ||
				enclosed_len > 1 ||
				line_term_len > 1 || line_start_len > 1 ||
				escaped_len > 1)));
  }
};

/**
  @class Load_log_event

  This log event corresponds to a "LOAD DATA INFILE" SQL query on the
  following form:

  @verbatim
   (1)    USE db;
   (2)    LOAD DATA [CONCURRENT] [LOCAL] INFILE 'file_name'
   (3)    [REPLACE | IGNORE]
   (4)    INTO TABLE 'table_name'
   (5)    [FIELDS
   (6)      [TERMINATED BY 'field_term']
   (7)      [[OPTIONALLY] ENCLOSED BY 'enclosed']
   (8)      [ESCAPED BY 'escaped']
   (9)    ]
  (10)    [LINES
  (11)      [TERMINATED BY 'line_term']
  (12)      [LINES STARTING BY 'line_start']
  (13)    ]
  (14)    [IGNORE skip_lines LINES]
  (15)    (field_1, field_2, ..., field_n)@endverbatim

  @section Load_log_event_binary_format Binary Format

  The Post-Header consists of the following six components.

  <table>
  <caption>Post-Header for Load_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>slave_proxy_id</td>
    <td>4 byte unsigned integer</td>
    <td>An integer identifying the client thread that issued the
    query.  The id is unique per server.  (Note, however, that two
    threads on different servers may have the same slave_proxy_id.)
    This is used when a client thread creates a temporary table local
    to the client.  The slave_proxy_id is used to distinguish
    temporary tables that belong to different clients.
    </td>
  </tr>

  <tr>
    <td>exec_time</td>
    <td>4 byte unsigned integer</td>
    <td>The time from when the query started to when it was logged in
    the binlog, in seconds.</td>
  </tr>

  <tr>
    <td>skip_lines</td>
    <td>4 byte unsigned integer</td>
    <td>The number on line (14) above, if present, or 0 if line (14)
    is left out.
    </td>
  </tr>

  <tr>
    <td>table_name_len</td>
    <td>1 byte unsigned integer</td>
    <td>The length of 'table_name' on line (4) above.</td>
  </tr>

  <tr>
    <td>db_len</td>
    <td>1 byte unsigned integer</td>
    <td>The length of 'db' on line (1) above.</td>
  </tr>

  <tr>
    <td>num_fields</td>
    <td>4 byte unsigned integer</td>
    <td>The number n of fields on line (15) above.</td>
  </tr>
  </table>    

  The Body contains the following components.

  <table>
  <caption>Body of Load_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>sql_ex</td>
    <td>variable length</td>

    <td>Describes the part of the query on lines (3) and
    (5)&ndash;(13) above.  More precisely, it stores the five strings
    (on lines) field_term (6), enclosed (7), escaped (8), line_term
    (11), and line_start (12); as well as a bitfield indicating the
    presence of the keywords REPLACE (3), IGNORE (3), and OPTIONALLY
    (7).

    The data is stored in one of two formats, called "old" and "new".
    The type field of Common-Header determines which of these two
    formats is used: type LOAD_EVENT means that the old format is
    used, and type NEW_LOAD_EVENT means that the new format is used.
    When MySQL writes a Load_log_event, it uses the new format if at
    least one of the five strings is two or more bytes long.
    Otherwise (i.e., if all strings are 0 or 1 bytes long), the old
    format is used.

    The new and old format differ in the way the five strings are
    stored.

    <ul>
    <li> In the new format, the strings are stored in the order
    field_term, enclosed, escaped, line_term, line_start. Each string
    consists of a length (1 byte), followed by a sequence of
    characters (0-255 bytes).  Finally, a boolean combination of the
    following flags is stored in 1 byte: REPLACE_FLAG==0x4,
    IGNORE_FLAG==0x8, and OPT_ENCLOSED_FLAG==0x2.  If a flag is set,
    it indicates the presence of the corresponding keyword in the SQL
    query.

    <li> In the old format, we know that each string has length 0 or
    1.  Therefore, only the first byte of each string is stored.  The
    order of the strings is the same as in the new format.  These five
    bytes are followed by the same 1 byte bitfield as in the new
    format.  Finally, a 1 byte bitfield called empty_flags is stored.
    The low 5 bits of empty_flags indicate which of the five strings
    have length 0.  For each of the following flags that is set, the
    corresponding string has length 0; for the flags that are not set,
    the string has length 1: FIELD_TERM_EMPTY==0x1,
    ENCLOSED_EMPTY==0x2, LINE_TERM_EMPTY==0x4, LINE_START_EMPTY==0x8,
    ESCAPED_EMPTY==0x10.
    </ul>

    Thus, the size of the new format is 6 bytes + the sum of the sizes
    of the five strings.  The size of the old format is always 7
    bytes.
    </td>
  </tr>

  <tr>
    <td>field_lens</td>
    <td>num_fields 1 byte unsigned integers</td>
    <td>An array of num_fields integers representing the length of
    each field in the query.  (num_fields is from the Post-Header).
    </td>
  </tr>

  <tr>
    <td>fields</td>
    <td>num_fields null-terminated strings</td>
    <td>An array of num_fields null-terminated strings, each
    representing a field in the query.  (The trailing zero is
    redundant, since the length are stored in the num_fields array.)
    The total length of all strings equals to the sum of all
    field_lens, plus num_fields bytes for all the trailing zeros.
    </td>
  </tr>

  <tr>
    <td>table_name</td>
    <td>null-terminated string of length table_len+1 bytes</td>
    <td>The 'table_name' from the query, as a null-terminated string.
    (The trailing zero is actually redundant since the table_len is
    known from Post-Header.)
    </td>
  </tr>

  <tr>
    <td>db</td>
    <td>null-terminated string of length db_len+1 bytes</td>
    <td>The 'db' from the query, as a null-terminated string.
    (The trailing zero is actually redundant since the db_len is known
    from Post-Header.)
    </td>
  </tr>

  <tr>
    <td>file_name</td>
    <td>variable length string without trailing zero, extending to the
    end of the event (determined by the length field of the
    Common-Header)
    </td>
    <td>The 'file_name' from the query.
    </td>
  </tr>

  </table>

  @subsection Load_log_event_notes_on_previous_versions Notes on Previous Versions

  This event type is understood by current versions, but only
  generated by MySQL 3.23 and earlier.
*/
class Load_log_event: public Log_event
{
private:
protected:
  int copy_log_event(const uchar *buf, ulong event_len,
                     int body_offset,
                     const Format_description_log_event* description_event);

public:
  bool print_query(THD *thd, bool need_db, const char *cs, String *buf,
                   my_off_t *fn_start, my_off_t *fn_end,
                   const char *qualify_db);
  my_thread_id thread_id;
  ulong slave_proxy_id;
  uint32 table_name_len;
  /*
    No need to have a catalog, as these events can only come from 4.x.
    TODO: this may become false if Dmitri pushes his new LOAD DATA INFILE in
    5.0 only (not in 4.x).
  */
  uint32 db_len;
  uint32 fname_len;
  uint32 num_fields;
  const char* fields;
  const uchar* field_lens;
  uint32 field_block_len;

  const char* table_name;
  const char* db;
  const char* fname;
  uint32 skip_lines;
  sql_ex_info sql_ex;
  bool local_fname;
  /**
    Indicates that this event corresponds to LOAD DATA CONCURRENT,

    @note Since Load_log_event event coming from the binary log
          lacks information whether LOAD DATA on master was concurrent
          or not, this flag is only set to TRUE for an auxiliary
          Load_log_event object which is used in mysql_load() to
          re-construct LOAD DATA statement from function parameters,
          for logging.
  */
  bool is_concurrent;

  /* fname doesn't point to memory inside Log_event::temp_buf  */
  void set_fname_outside_temp_buf(const char *afname, size_t alen)
  {
    fname= afname;
    fname_len= (uint)alen;
    local_fname= TRUE;
  }
  /* fname doesn't point to memory inside Log_event::temp_buf  */
  int  check_fname_outside_temp_buf()
  {
    return local_fname;
  }

#ifdef MYSQL_SERVER
  String field_lens_buf;
  String fields_buf;

  Load_log_event(THD* thd, const sql_exchange* ex, const char* db_arg,
		 const char* table_name_arg,
		 List<Item>& fields_arg,
                 bool is_concurrent_arg,
                 enum enum_duplicates handle_dup, bool ignore,
		 bool using_trans);
  void set_fields(const char* db, List<Item> &fields_arg,
                  Name_resolution_context *context);
  const char* get_db() override { return db; }
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool commented);
#endif

  /*
    Note that for all the events related to LOAD DATA (Load_log_event,
    Create_file/Append/Exec/Delete, we pass description_event; however as
    logging of LOAD DATA is going to be changed in 4.1 or 5.0, this is only used
    for the common_header_len (post_header_len will not be changed).
  */
  Load_log_event(const uchar *buf, uint event_len,
                 const Format_description_log_event* description_event);
  ~Load_log_event() = default;
  Log_event_type get_type_code() override
  {
    return sql_ex.new_format() ? NEW_LOAD_EVENT: LOAD_EVENT;
  }
#ifdef MYSQL_SERVER
  bool write_data_header() override;
  bool write_data_body() override;
#endif
  bool is_valid() const override { return table_name != 0; }
  int get_data_size() override
  {
    return (table_name_len + db_len + 2 + fname_len
	    + LOAD_HEADER_LEN
	    + sql_ex.data_size() + field_block_len + num_fields);
  }

public:        /* !!! Public in this patch to allow old usage */
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override
  {
    return do_apply_event(thd->slave_net,rgi,0);
  }

  int do_apply_event(NET *net, rpl_group_info *rgi,
                     bool use_rli_only_for_errors);
#endif
};

/**
  @class Start_log_event_v3

  Start_log_event_v3 is the Start_log_event of binlog format 3 (MySQL 3.23 and
  4.x).

  Format_description_log_event derives from Start_log_event_v3; it is
  the Start_log_event of binlog format 4 (MySQL 5.0), that is, the
  event that describes the other events' Common-Header/Post-Header
  lengths. This event is sent by MySQL 5.0 whenever it starts sending
  a new binlog if the requested position is >4 (otherwise if ==4 the
  event will be sent naturally).

  @section Start_log_event_v3_binary_format Binary Format
*/
class Start_log_event_v3: public Log_event
{
public:
  /*
    If this event is at the start of the first binary log since server
    startup 'created' should be the timestamp when the event (and the
    binary log) was created.  In the other case (i.e. this event is at
    the start of a binary log created by FLUSH LOGS or automatic
    rotation), 'created' should be 0.  This "trick" is used by MySQL
    >=4.0.14 slaves to know whether they must drop stale temporary
    tables and whether they should abort unfinished transaction.

    Note that when 'created'!=0, it is always equal to the event's
    timestamp; indeed Start_log_event is written only in log.cc where
    the first constructor below is called, in which 'created' is set
    to 'when'.  So in fact 'created' is a useless variable. When it is
    0 we can read the actual value from timestamp ('when') and when it
    is non-zero we can read the same value from timestamp
    ('when'). Conclusion:
     - we use timestamp to print when the binlog was created.
     - we use 'created' only to know if this is a first binlog or not.
     In 3.23.57 we did not pay attention to this identity, so mysqlbinlog in
     3.23.57 does not print 'created the_date' if created was zero. This is now
     fixed.
  */
  time_t created;
  uint16 binlog_version;
  char server_version[ST_SERVER_VER_LEN];
  /*
    We set this to 1 if we don't want to have the created time in the log,
    which is the case when we rollover to a new log.
  */
  bool dont_set_created;

#ifdef MYSQL_SERVER
  Start_log_event_v3();
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  Start_log_event_v3() = default;
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Start_log_event_v3(const uchar *buf, uint event_len,
                     const Format_description_log_event* description_event);
  ~Start_log_event_v3() = default;
  Log_event_type get_type_code() override { return START_EVENT_V3;}
  my_off_t get_header_len(my_off_t l __attribute__((unused))) override
  { return LOG_EVENT_MINIMAL_HEADER_LEN; }
#ifdef MYSQL_SERVER
  bool write() override;
#endif
  bool is_valid() const override { return server_version[0] != 0; }
  int get_data_size() override
  {
    return START_V3_HEADER_LEN; //no variable-sized part
  }

protected:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info*) override
  {
    /*
      Events from ourself should be skipped, but they should not
      decrease the slave skip counter.
     */
    if (this->server_id == global_system_variables.server_id)
      return Log_event::EVENT_SKIP_IGNORE;
    else
      return Log_event::EVENT_SKIP_NOT;
  }
#endif
};

/**
  @class Start_encryption_log_event

  Start_encryption_log_event marks the beginning of encrypted data (all events
  after this event are encrypted).

  It contains the cryptographic scheme used for the encryption as well as any
  data required to decrypt (except the actual key).

  For binlog cryptoscheme 1: key version, and nonce for iv generation.
*/
class Start_encryption_log_event : public Log_event
{
public:
#ifdef MYSQL_SERVER
  Start_encryption_log_event(uint crypto_scheme_arg, uint key_version_arg,
                             const uchar* nonce_arg)
  : crypto_scheme(crypto_scheme_arg), key_version(key_version_arg)
  {
    cache_type = EVENT_NO_CACHE;
    DBUG_ASSERT(crypto_scheme == 1);
    memcpy(nonce, nonce_arg, BINLOG_NONCE_LENGTH);
  }

  bool write_data_body() override
  {
    uchar scheme_buf= crypto_scheme;
    uchar key_version_buf[BINLOG_KEY_VERSION_LENGTH];
    int4store(key_version_buf, key_version);
    return write_data(&scheme_buf, sizeof(scheme_buf)) ||
           write_data(key_version_buf, sizeof(key_version_buf)) ||
           write_data(nonce, BINLOG_NONCE_LENGTH);
  }
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Start_encryption_log_event(const uchar *buf, uint event_len,
                             const Format_description_log_event
                             *description_event);

  bool is_valid() const override { return crypto_scheme == 1; }

  Log_event_type get_type_code() override { return START_ENCRYPTION_EVENT; }

  int get_data_size() override
  {
    return BINLOG_CRYPTO_SCHEME_LENGTH + BINLOG_KEY_VERSION_LENGTH +
           BINLOG_NONCE_LENGTH;
  }

  uint crypto_scheme;
  uint key_version;
  uchar nonce[BINLOG_NONCE_LENGTH];

protected:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info* rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info* rgi) override
  {
     return Log_event::EVENT_SKIP_NOT;
  }
#endif

};


class Version
{
protected:
  uchar m_ver[3];
  int cmp(const Version &other) const
  {
    return memcmp(m_ver, other.m_ver, 3);
  }
public:
  Version()
  {
    m_ver[0]= m_ver[1]= m_ver[2]= '\0';
  }
  Version(uchar v0, uchar v1, uchar v2)
  {
    m_ver[0]= v0;
    m_ver[1]= v1;
    m_ver[2]= v2;
  }
  Version(const char *version, const char **endptr);
  const uchar& operator [] (size_t i) const
  {
    DBUG_ASSERT(i < 3);
    return m_ver[i];
  }
  bool operator<(const Version &other) const { return cmp(other) < 0; }
  bool operator>(const Version &other) const { return cmp(other) > 0; }
  bool operator<=(const Version &other) const { return cmp(other) <= 0; }
  bool operator>=(const Version &other) const { return cmp(other) >= 0; }
};


/**
  @class Format_description_log_event

  For binlog version 4.
  This event is saved by threads which read it, as they need it for future
  use (to decode the ordinary events).

  @section Format_description_log_event_binary_format Binary Format
*/

class Format_description_log_event: public Start_log_event_v3
{
public:
  /*
     The size of the fixed header which _all_ events have
     (for binlogs written by this version, this is equal to
     LOG_EVENT_HEADER_LEN), except FORMAT_DESCRIPTION_EVENT and ROTATE_EVENT
     (those have a header of size LOG_EVENT_MINIMAL_HEADER_LEN).
  */
  uint8 common_header_len;
  uint8 number_of_event_types;
  /* 
     The list of post-headers' lengths followed 
     by the checksum alg description byte
  */
  uint8 *post_header_len;
  class master_version_split: public Version {
  public:
    enum {KIND_MYSQL, KIND_MARIADB};
    int kind;
    master_version_split() :kind(KIND_MARIADB) { }
    master_version_split(const char *version);
    bool version_is_valid() const
    {
      /* It is invalid only when all version numbers are 0 */
      return !(m_ver[0] == 0 && m_ver[1] == 0 && m_ver[2] == 0);
    }
  };
  master_version_split server_version_split;
  const uint8 *event_type_permutation;
  uint32 options_written_to_bin_log;

  Format_description_log_event(uint8 binlog_ver, const char* server_ver=0);
  Format_description_log_event(const uchar *buf, uint event_len,
                               const Format_description_log_event
                               *description_event);
  ~Format_description_log_event()
  {
    my_free(post_header_len);
  }
  Log_event_type get_type_code() override { return FORMAT_DESCRIPTION_EVENT;}
#ifdef MYSQL_SERVER
  bool write() override;
#endif
  bool header_is_valid() const
  {
    return ((common_header_len >= ((binlog_version==1) ? OLD_HEADER_LEN :
                                   LOG_EVENT_MINIMAL_HEADER_LEN)) &&
            (post_header_len != NULL));
  }

  bool is_valid() const override
  {
    return header_is_valid() && server_version_split.version_is_valid();
  }

  int get_data_size() override
  {
    /*
      The vector of post-header lengths is considered as part of the
      post-header, because in a given version it never changes (contrary to the
      query in a Query_log_event).
    */
    return FORMAT_DESCRIPTION_HEADER_LEN;
  }

  Binlog_crypt_data crypto_data;
  bool start_decryption(Start_encryption_log_event* sele);
  void copy_crypto_data(const Format_description_log_event* o)
  {
    crypto_data= o->crypto_data;
  }
  void reset_crypto()
  {
    crypto_data.scheme= 0;
  }

  void calc_server_version_split();
  void deduct_options_written_to_bin_log();
  static bool is_version_before_checksum(const master_version_split *version_split);
protected:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
};


/**
  @class Intvar_log_event

  An Intvar_log_event will be created just before a Query_log_event,
  if the query uses one of the variables LAST_INSERT_ID or INSERT_ID.
  Each Intvar_log_event holds the value of one of these variables.

  @section Intvar_log_event_binary_format Binary Format

  The Post-Header for this event type is empty.  The Body has two
  components:

  <table>
  <caption>Body for Intvar_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>type</td>
    <td>1 byte enumeration</td>
    <td>One byte identifying the type of variable stored.  Currently,
    two identifiers are supported:  LAST_INSERT_ID_EVENT==1 and
    INSERT_ID_EVENT==2.
    </td>
  </tr>

  <tr>
    <td>value</td>
    <td>8 byte unsigned integer</td>
    <td>The value of the variable.</td>
  </tr>

  </table>
*/
class Intvar_log_event: public Log_event
{
public:
  ulonglong val;
  uchar type;

#ifdef MYSQL_SERVER
Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg,
                 bool using_trans, bool direct)
    :Log_event(thd_arg,0,using_trans),val(val_arg),type(type_arg)
  {
    if (direct)
      cache_type= Log_event::EVENT_NO_CACHE;
  }
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Intvar_log_event(const uchar *buf,
                   const Format_description_log_event *description_event);
  ~Intvar_log_event() = default;
  Log_event_type get_type_code() override { return INTVAR_EVENT;}
  const char* get_var_type_name();
  int get_data_size() override { return  9; /* sizeof(type) + sizeof(val) */;}
#ifdef MYSQL_SERVER
  bool write() override;
#ifdef HAVE_REPLICATION
   bool is_part_of_group() override { return 1; }
#endif
#endif
  bool is_valid() const override { return 1; }

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
};


/**
  @class Rand_log_event

  Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0.
  4.1.1 does not need it (it's repeatable again) so this event needn't be
  written in 4.1.1 for PASSWORD() (but the fact that it is written is just a
  waste, it does not cause bugs).

  The state of the random number generation consists of 128 bits,
  which are stored internally as two 64-bit numbers.

  @section Rand_log_event_binary_format Binary Format  

  The Post-Header for this event type is empty.  The Body has two
  components:

  <table>
  <caption>Body for Rand_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>seed1</td>
    <td>8 byte unsigned integer</td>
    <td>64 bit random seed1.</td>
  </tr>

  <tr>
    <td>seed2</td>
    <td>8 byte unsigned integer</td>
    <td>64 bit random seed2.</td>
  </tr>
  </table>
*/

class Rand_log_event: public Log_event
{
 public:
  ulonglong seed1;
  ulonglong seed2;

#ifdef MYSQL_SERVER
  Rand_log_event(THD* thd_arg, ulonglong seed1_arg, ulonglong seed2_arg,
                 bool using_trans, bool direct)
    :Log_event(thd_arg,0,using_trans),seed1(seed1_arg),seed2(seed2_arg)
  {
    if (direct)
      cache_type= Log_event::EVENT_NO_CACHE;
  }
#ifdef HAVE_REPLICATION
   void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Rand_log_event(const uchar *buf,
                 const Format_description_log_event *description_event);
  ~Rand_log_event() = default;
  Log_event_type get_type_code() override { return RAND_EVENT;}
  int get_data_size() override { return 16; /* sizeof(ulonglong) * 2*/ }
#ifdef MYSQL_SERVER
  bool write() override;
#ifdef HAVE_REPLICATION
   bool is_part_of_group() override { return 1; }
#endif
#endif
  bool is_valid() const override { return 1; }

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
};


class Xid_apply_log_event: public Log_event
{
public:
#ifdef MYSQL_SERVER
  Xid_apply_log_event(THD* thd_arg):
   Log_event(thd_arg, 0, TRUE) {}
#endif
  Xid_apply_log_event(const uchar *buf,
                const Format_description_log_event *description_event):
   Log_event(buf, description_event) {}

  ~Xid_apply_log_event() {}
  bool is_valid() const override { return 1; }
private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  virtual int do_commit()= 0;
  int do_apply_event(rpl_group_info *rgi) override;
  int do_record_gtid(THD *thd, rpl_group_info *rgi, bool in_trans,
                     void **out_hton, bool force_err= false);
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
  virtual const char* get_query()= 0;
#endif
};


/**
  @class Xid_log_event

  Logs xid of the transaction-to-be-committed in the 2pc protocol.
  Has no meaning in replication, slaves ignore it.

  @section Xid_log_event_binary_format Binary Format  
*/
#ifdef MYSQL_CLIENT
typedef ulonglong my_xid; // this line is the same as in handler.h
#endif

class Xid_log_event: public Xid_apply_log_event
{
public:
  my_xid xid;

#ifdef MYSQL_SERVER
  Xid_log_event(THD* thd_arg, my_xid x, bool direct):
   Xid_apply_log_event(thd_arg), xid(x)
   {
     if (direct)
       cache_type= Log_event::EVENT_NO_CACHE;
   }
#ifdef HAVE_REPLICATION
  const char* get_query() override
  {
    return "COMMIT /* implicit, from Xid_log_event */";
  }
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Xid_log_event(const uchar *buf,
                const Format_description_log_event *description_event);
  ~Xid_log_event() = default;
  Log_event_type get_type_code() override { return XID_EVENT;}
  int get_data_size() override { return sizeof(xid); }
#ifdef MYSQL_SERVER
  bool write() override;
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_commit() override;
#endif
};


/**
  @class XA_prepare_log_event

  Similar to Xid_log_event except that
  - it is specific to XA transaction
  - it carries out the prepare logics rather than the final committing
    when @c one_phase member is off. The latter option is only for
    compatibility with the upstream.

  From the groupping perspective the event finalizes the current
  "prepare" group that is started with Gtid_log_event similarly to the
  regular replicated transaction.
*/

/**
  Function serializes XID which is characterized by by four last arguments
  of the function.
  Serialized XID is presented in valid hex format and is returned to
  the caller in a buffer pointed by the first argument.
  The buffer size provived by the caller must be not less than
  8 + 2 * XIDDATASIZE +  4 * sizeof(XID::formatID) + 1, see
  {MYSQL_,}XID definitions.

  @param buf  pointer to a buffer allocated for storing serialized data
  @param fmt  formatID value
  @param gln  gtrid_length value
  @param bln  bqual_length value
  @param dat  data value

  @return  the value of the buffer pointer
*/

inline char *serialize_xid(char *buf, long fmt, long gln, long bln,
                           const char *dat)
{
  int i;
  char *c= buf;
  /*
    Build a string consisting of the hex format representation of XID
    as passed through fmt,gln,bln,dat argument:
      X'hex11hex12...hex1m',X'hex21hex22...hex2n',11
    and store it into buf.
  */
  c[0]= 'X';
  c[1]= '\'';
  c+= 2;
  for (i= 0; i < gln; i++)
  {
    c[0]=_dig_vec_lower[((uchar*) dat)[i] >> 4];
    c[1]=_dig_vec_lower[((uchar*) dat)[i] & 0x0f];
    c+= 2;
  }
  c[0]= '\'';
  c[1]= ',';
  c[2]= 'X';
  c[3]= '\'';
  c+= 4;

  for (; i < gln + bln; i++)
  {
    c[0]=_dig_vec_lower[((uchar*) dat)[i] >> 4];
    c[1]=_dig_vec_lower[((uchar*) dat)[i] & 0x0f];
    c+= 2;
  }
  c[0]= '\'';
  sprintf(c+1, ",%lu", fmt);

 return buf;
}

/*
  The size of the string containing serialized Xid representation
  is computed as a sum of
  eight as the number of formatting symbols (X'',X'',)
  plus 2 x XIDDATASIZE (2 due to hex format),
  plus space for decimal digits of XID::formatID,
  plus one for 0x0.
*/
static const uint ser_buf_size=
  8 + 2 * MYSQL_XIDDATASIZE + 4 * sizeof(long) + 1;

struct event_mysql_xid_t :  MYSQL_XID
{
  char buf[ser_buf_size];
  char *serialize()
  {
    return serialize_xid(buf, formatID, gtrid_length, bqual_length, data);
  }
};

#ifndef MYSQL_CLIENT
struct event_xid_t : XID
{
  char buf[ser_buf_size];

  char *serialize(char *buf_arg)
  {
    return serialize_xid(buf_arg, formatID, gtrid_length, bqual_length, data);
  }
  char *serialize()
  {
    return serialize(buf);
  }
};
#endif

class XA_prepare_log_event: public Xid_apply_log_event
{
protected:

  /* Constant contributor to subheader in write() by members of XID struct. */
  static const int xid_subheader_no_data= 12;
  event_mysql_xid_t m_xid;
  void *xid;
  bool one_phase;

public:
#ifdef MYSQL_SERVER
  XA_prepare_log_event(THD* thd_arg, XID *xid_arg, bool one_phase_arg):
    Xid_apply_log_event(thd_arg), xid(xid_arg), one_phase(one_phase_arg)
  {
    cache_type= Log_event::EVENT_NO_CACHE;
  }
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
  XA_prepare_log_event(const uchar *buf,
                       const Format_description_log_event *description_event);
  ~XA_prepare_log_event() {}
  Log_event_type get_type_code() override { return XA_PREPARE_LOG_EVENT; }
  bool is_valid() const override { return m_xid.formatID != -1; }
  int get_data_size() override
  {
    return xid_subheader_no_data + m_xid.gtrid_length + m_xid.bqual_length;
  }

#ifdef MYSQL_SERVER
  bool write() override;
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  char query[sizeof("XA COMMIT ONE PHASE") + 1 + ser_buf_size];
  int do_commit() override;
  const char* get_query() override
  {
    sprintf(query,
            (one_phase ? "XA COMMIT %s ONE PHASE" : "XA PREPARE %s"),
            m_xid.serialize());
    return query;
  }
#endif
};


/**
  @class User_var_log_event

  Every time a query uses the value of a user variable, a User_var_log_event is
  written before the Query_log_event, to set the user variable.

  @section User_var_log_event_binary_format Binary Format  
*/


class User_var_log_event: public Log_event, public Log_event_data_type
{
public:
  const char *name;
  size_t name_len;
  const char *val;
  size_t val_len;
  bool is_null;
#ifdef MYSQL_SERVER
  bool deferred;
  query_id_t query_id;
  User_var_log_event(THD* thd_arg, const char *name_arg, size_t name_len_arg,
                     const char *val_arg, size_t val_len_arg,
                     const Log_event_data_type &data_type,
                     bool using_trans, bool direct)
    :Log_event(thd_arg, 0, using_trans),
    Log_event_data_type(data_type),
    name(name_arg), name_len(name_len_arg), val(val_arg),
    val_len(val_len_arg),
    deferred(false)
    {
      is_null= !val;
      if (direct)
        cache_type= Log_event::EVENT_NO_CACHE;
    }
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  User_var_log_event(const uchar *buf, uint event_len,
                     const Format_description_log_event *description_event);
  ~User_var_log_event() = default;
  Log_event_type get_type_code() override { return USER_VAR_EVENT;}
#ifdef MYSQL_SERVER
  bool write() override;
  /* 
     Getter and setter for deferred User-event. 
     Returns true if the event is not applied directly 
     and which case the applier adjusts execution path.
  */
  bool is_deferred() { return deferred; }
  /*
    In case of the deferred applying the variable instance is flagged
    and the parsing time query id is stored to be used at applying time.
  */
  void set_deferred(query_id_t qid) { deferred= true; query_id= qid; }
#ifdef HAVE_REPLICATION
   bool is_part_of_group() override { return 1; }
#endif
#endif
  bool is_valid() const override { return name != 0; }

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
};


/**
  @class Stop_log_event

  @section Stop_log_event_binary_format Binary Format

  The Post-Header and Body for this event type are empty; it only has
  the Common-Header.
*/
class Stop_log_event: public Log_event
{
public:
#ifdef MYSQL_SERVER
  Stop_log_event() :Log_event()
  {}
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Stop_log_event(const uchar *buf,
                 const Format_description_log_event *description_event):
    Log_event(buf, description_event)
  {}
  ~Stop_log_event() = default;
  Log_event_type get_type_code() override { return STOP_EVENT;}
  bool is_valid() const override { return 1; }

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override
  {
    /*
      Events from ourself should be skipped, but they should not
      decrease the slave skip counter.
     */
    if (this->server_id == global_system_variables.server_id)
      return Log_event::EVENT_SKIP_IGNORE;
    else
      return Log_event::EVENT_SKIP_NOT;
  }
#endif
};

/**
  @class Rotate_log_event

  This will be deprecated when we move to using sequence ids.

  @section Rotate_log_event_binary_format Binary Format

  The Post-Header has one component:

  <table>
  <caption>Post-Header for Rotate_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>position</td>
    <td>8 byte integer</td>
    <td>The position within the binlog to rotate to.</td>
  </tr>

  </table>

  The Body has one component:

  <table>
  <caption>Body for Rotate_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>new_log</td>
    <td>variable length string without trailing zero, extending to the
    end of the event (determined by the length field of the
    Common-Header)
    </td>
    <td>Name of the binlog to rotate to.</td>
  </tr>

  </table>
*/

class Rotate_log_event: public Log_event
{
public:
  enum {
    DUP_NAME= 2, // if constructor should dup the string argument
    RELAY_LOG=4  // rotate event for relay log
  };
  const char *new_log_ident;
  ulonglong pos;
  uint ident_len;
  uint flags;
#ifdef MYSQL_SERVER
  Rotate_log_event(const char* new_log_ident_arg,
		   uint ident_len_arg,
		   ulonglong pos_arg, uint flags);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Rotate_log_event(const uchar *buf, uint event_len,
                   const Format_description_log_event* description_event);
  ~Rotate_log_event()
  {
    if (flags & DUP_NAME)
      my_free((void*) new_log_ident);
  }
  Log_event_type get_type_code() override { return ROTATE_EVENT;}
  my_off_t get_header_len(my_off_t l __attribute__((unused))) override
  { return LOG_EVENT_MINIMAL_HEADER_LEN; }
  int get_data_size() override { return  ident_len + ROTATE_HEADER_LEN;}
  bool is_valid() const override { return new_log_ident != 0; }
#ifdef MYSQL_SERVER
  bool write() override;
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
};


class Binlog_checkpoint_log_event: public Log_event
{
public:
  char *binlog_file_name;
  uint binlog_file_len;

#ifdef MYSQL_SERVER
  Binlog_checkpoint_log_event(const char *binlog_file_name_arg,
                              uint binlog_file_len_arg);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol *protocol) override;
#endif
#else
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
  Binlog_checkpoint_log_event(const uchar *buf, uint event_len,
                              const Format_description_log_event
                              *description_event);
  ~Binlog_checkpoint_log_event() { my_free(binlog_file_name); }
  Log_event_type get_type_code() override { return BINLOG_CHECKPOINT_EVENT;}
  int get_data_size() override
  { return binlog_file_len + BINLOG_CHECKPOINT_HEADER_LEN;}
  bool is_valid() const override { return binlog_file_name != 0; }
#ifdef MYSQL_SERVER
  bool write() override;
#ifdef HAVE_REPLICATION
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
#endif
};


/**
  @class Gtid_log_event

  This event is logged as part of every event group to give the global
  transaction id (GTID) of that group.

  It replaces the BEGIN query event used in earlier versions to begin most
  event groups, but is also used for events that used to be stand-alone.

  @section Gtid_log_event_binary_format Binary Format

  The binary format for Gtid_log_event has 6 extra reserved bytes to make the
  length a total of 19 byte (+ 19 bytes of header in common with all events).
  This is just the minimal size for a BEGIN query event, which makes it easy
  to replace this event with such BEGIN event to remain compatible with old
  slave servers.

  <table>
  <caption>Post-Header</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>seq_no</td>
    <td>8 byte unsigned integer</td>
    <td>increasing id within one server_id. Starts at 1, holes in the sequence
        may occur</td>
  </tr>

  <tr>
    <td>domain_id</td>
    <td>4 byte unsigned integer</td>
    <td>Replication domain id, identifying independent replication streams></td>
  </tr>

  <tr>
    <td>flags</td>
    <td>1 byte bitfield</td>
    <td>Bit 0 set indicates stand-alone event (no terminating COMMIT)</td>
    <td>Bit 1 set indicates group commit, and that commit id exists</td>
    <td>Bit 2 set indicates a transactional event group (can be safely rolled
        back).</td>
    <td>Bit 3 set indicates that user allowed optimistic parallel apply (the
        @@SESSION.replicate_allow_parallel value was true at commit).</td>
    <td>Bit 4 set indicates that this transaction encountered a row (or other)
        lock wait during execution.</td>
  </tr>

  <tr>
    <td>Reserved (no group commit) / commit id (group commit) (see flags bit 1)</td>
    <td>6 bytes / 8 bytes</td>
    <td>Reserved bytes, set to 0. Maybe be used for future expansion (no
        group commit). OR commit id, same for all GTIDs in the same group
        commit (see flags bit 1).</td>
  </tr>
  </table>

  The Body of Gtid_log_event is empty. The total event size is 19 bytes +
  the normal 19 bytes common-header.
*/

class Gtid_log_event: public Log_event
{
public:
  uint64 seq_no;
  uint64 commit_id;
  uint32 domain_id;
#ifdef MYSQL_SERVER
  event_xid_t xid;
#else
  event_mysql_xid_t xid;
#endif
  uchar flags2;
  uint  flags_extra; // more flags area placed after the regular flags2's one
  /*
    Number of engine participants in transaction minus 1.
    When zero the event does not contain that information.
  */
  uint8 extra_engines;

  /* Flags2. */

  /* FL_STANDALONE is set when there is no terminating COMMIT event. */
  static const uchar FL_STANDALONE= 1;
  /*
    FL_GROUP_COMMIT_ID is set when event group is part of a group commit on the
    master. Groups with same commit_id are part of the same group commit.
  */
  static const uchar FL_GROUP_COMMIT_ID= 2;
  /*
    FL_TRANSACTIONAL is set for an event group that can be safely rolled back
    (no MyISAM, eg.).
  */
  static const uchar FL_TRANSACTIONAL= 4;
  /*
    FL_ALLOW_PARALLEL reflects the (negation of the) value of
    @@SESSION.skip_parallel_replication at the time of commit.
  */
  static const uchar FL_ALLOW_PARALLEL= 8;
  /*
    FL_WAITED is set if a row lock wait (or other wait) is detected during the
    execution of the transaction.
  */
  static const uchar FL_WAITED= 16;
  /* FL_DDL is set for event group containing DDL. */
  static const uchar FL_DDL= 32;
  /* FL_PREPARED_XA is set for XA transaction. */
  static const uchar FL_PREPARED_XA= 64;
  /* FL_"COMMITTED or ROLLED-BACK"_XA is set for XA transaction. */
  static const uchar FL_COMPLETED_XA= 128;

  /* Flags_extra. */

  /*
    FL_EXTRA_MULTI_ENGINE is set for event group comprising a transaction
    involving multiple storage engines. No flag and extra data are added
    to the event when the transaction involves only one engine.
  */
  static const uchar FL_EXTRA_MULTI_ENGINE= 1;

#ifdef MYSQL_SERVER
  Gtid_log_event(THD *thd_arg, uint64 seq_no, uint32 domain_id, bool standalone,
                 uint16 flags, bool is_transactional, uint64 commit_id,
                 bool has_xid= false, bool is_ro_1pc= false);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol *protocol) override;
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
#else
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
  Gtid_log_event(const uchar *buf, uint event_len,
                 const Format_description_log_event *description_event);
  ~Gtid_log_event() = default;
  Log_event_type get_type_code() override { return GTID_EVENT; }
  enum_logged_status logged_status() override { return LOGGED_NO_DATA; }
  int get_data_size() override
  {
    return GTID_HEADER_LEN + ((flags2 & FL_GROUP_COMMIT_ID) ? 2 : 0);
  }

  bool is_valid() const override
  {
    /*
      seq_no is set to 0 if the structure of a serialized GTID event does not
      align with that as indicated by flags and extra_flags.
    */
    return seq_no != 0;
  }

#ifdef MYSQL_SERVER
  bool write() override;
  static int make_compatible_event(String *packet, bool *need_dummy_event,
                                    ulong ev_offset, enum enum_binlog_checksum_alg checksum_alg);
  static bool peek(const uchar *event_start, size_t event_len,
                   enum enum_binlog_checksum_alg checksum_alg,
                   uint32 *domain_id, uint32 *server_id, uint64 *seq_no,
                   uchar *flags2, const Format_description_log_event *fdev);
#endif
};


/**
  @class Gtid_list_log_event

  This event is logged at the start of every binlog file to record the
  current replication state: the last global transaction id (GTID) applied
  on the server within each replication domain.

  It consists of a list of GTIDs, one for each replication domain ever seen
  on the server.

  @section Gtid_list_log_event_binary_format Binary Format

  <table>
  <caption>Post-Header</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>count</td>
    <td>4 byte unsigned integer</td>
    <td>The lower 28 bits are the number of GTIDs. The upper 4 bits are
        flags bits.</td>
  </tr>
  </table>

  <table>
  <caption>Body</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>domain_id</td>
    <td>4 byte unsigned integer</td>
    <td>Replication domain id of one GTID</td>
  </tr>

  <tr>
    <td>server_id</td>
    <td>4 byte unsigned integer</td>
    <td>Server id of one GTID</td>
  </tr>

  <tr>
    <td>seq_no</td>
    <td>8 byte unsigned integer</td>
    <td>sequence number of one GTID</td>
  </tr>
  </table>

  The three elements in the body repeat COUNT times to form the GTID list.

  At the time of writing, only two flag bit are in use.

  Bit 28 of `count' is used for flag FLAG_UNTIL_REACHED, which is sent in a
  Gtid_list event from the master to the slave to indicate that the START
  SLAVE UNTIL master_gtid_pos=xxx condition has been reached. (This flag is
  only sent in "fake" events generated on the fly, it is not written into
  the binlog).
*/

class Gtid_list_log_event: public Log_event
{
public:
  uint32 count;
  uint32 gl_flags;
  struct rpl_gtid *list;
  uint64 *sub_id_list;

  static const uint element_size= 4+4+8;
  /* Upper bits stored in 'count'. See comment above */
  enum gtid_flags
  {
    FLAG_UNTIL_REACHED= (1<<28),
    FLAG_IGN_GTIDS= (1<<29),
  };
#ifdef MYSQL_SERVER
  Gtid_list_log_event(rpl_binlog_state *gtid_set, uint32 gl_flags);
  Gtid_list_log_event(slave_connection_state *gtid_set, uint32 gl_flags);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol *protocol) override;
#endif
#else
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
  Gtid_list_log_event(const uchar *buf, uint event_len,
                      const Format_description_log_event *description_event);
  ~Gtid_list_log_event() { my_free(list); my_free(sub_id_list); }
  Log_event_type get_type_code() override { return GTID_LIST_EVENT; }
  int get_data_size() override {
    /*
      Replacing with dummy event, needed for older slaves, requires a minimum
      of 6 bytes in the body.
    */
    return (count==0 ?
            GTID_LIST_HEADER_LEN+2 : GTID_LIST_HEADER_LEN+count*element_size);
  }
  bool is_valid() const override { return list != NULL; }
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  bool to_packet(String *packet);
  bool write() override;
  int do_apply_event(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
  static bool peek(const char *event_start, size_t event_len,
                   enum enum_binlog_checksum_alg checksum_alg,
                   rpl_gtid **out_gtid_list, uint32 *out_list_len,
                   const Format_description_log_event *fdev);
};


/* the classes below are for the new LOAD DATA INFILE logging */

/**
  @class Create_file_log_event

  @section Create_file_log_event_binary_format Binary Format
*/

class Create_file_log_event: public Load_log_event
{
protected:
  /*
    Pretend we are Load event, so we can write out just
    our Load part - used on the slave when writing event out to
    SQL_LOAD-*.info file
  */
  bool fake_base;
public:
  uchar *block;
  const uchar *event_buf;
  uint block_len;
  uint file_id;
  bool inited_from_old;

#ifdef MYSQL_SERVER
  Create_file_log_event(THD* thd, sql_exchange* ex, const char* db_arg,
			const char* table_name_arg,
			List<Item>& fields_arg,
                        bool is_concurrent_arg,
			enum enum_duplicates handle_dup, bool ignore,
			uchar* block_arg, uint block_len_arg,
			bool using_trans);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
             bool enable_local);
#endif

  Create_file_log_event(const uchar *buf, uint event_len,
                        const Format_description_log_event* description_event);
  ~Create_file_log_event()
  {
    my_free((void*) event_buf);
  }

  Log_event_type get_type_code() override
  {
    return fake_base ? Load_log_event::get_type_code() : CREATE_FILE_EVENT;
  }
  int get_data_size() override
  {
    return (fake_base ? Load_log_event::get_data_size() :
	    Load_log_event::get_data_size() +
	    4 + 1 + block_len);
  }
  bool is_valid() const override { return inited_from_old || block != 0; }
#ifdef MYSQL_SERVER
  bool write_data_header() override;
  bool write_data_body() override;
  /*
    Cut out Create_file extensions and
    write it as Load event - used on the slave
  */
  bool write_base();
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
#endif
};


/**
  @class Append_block_log_event

  @section Append_block_log_event_binary_format Binary Format
*/

class Append_block_log_event: public Log_event
{
public:
  uchar* block;
  uint block_len;
  uint file_id;
  /*
    'db' is filled when the event is created in mysql_load() (the
    event needs to have a 'db' member to be well filtered by
    binlog-*-db rules). 'db' is not written to the binlog (it's not
    used by Append_block_log_event::write()), so it can't be read in
    the Append_block_log_event(const uchar *buf, int event_len)
    constructor.  In other words, 'db' is used only for filtering by
    binlog-*-db rules.  Create_file_log_event is different: it's 'db'
    (which is inherited from Load_log_event) is written to the binlog
    and can be re-read.
  */
  const char* db;

#ifdef MYSQL_SERVER
  Append_block_log_event(THD* thd, const char* db_arg, uchar* block_arg,
			 uint block_len_arg, bool using_trans);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
  virtual int get_create_or_append() const;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Append_block_log_event(const uchar *buf, uint event_len,
                         const Format_description_log_event
                         *description_event);
  ~Append_block_log_event() = default;
  Log_event_type get_type_code() override { return APPEND_BLOCK_EVENT;}
  int get_data_size() override { return  block_len + APPEND_BLOCK_HEADER_LEN ;}
  bool is_valid() const override { return block != 0; }
#ifdef MYSQL_SERVER
  bool write() override;
  const char* get_db() override { return db; }
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
#endif
};


/**
  @class Delete_file_log_event

  @section Delete_file_log_event_binary_format Binary Format
*/

class Delete_file_log_event: public Log_event
{
public:
  uint file_id;
  const char* db; /* see comment in Append_block_log_event */

#ifdef MYSQL_SERVER
  Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
             bool enable_local);
#endif

  Delete_file_log_event(const uchar *buf, uint event_len,
                        const Format_description_log_event* description_event);
  ~Delete_file_log_event() = default;
  Log_event_type get_type_code() override { return DELETE_FILE_EVENT;}
  int get_data_size() override { return DELETE_FILE_HEADER_LEN ;}
  bool is_valid() const override { return file_id != 0; }
#ifdef MYSQL_SERVER
  bool write() override;
  const char* get_db() override { return db; }
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
#endif
};


/**
  @class Execute_load_log_event

  @section Delete_file_log_event_binary_format Binary Format
*/

class Execute_load_log_event: public Log_event
{
public:
  uint file_id;
  const char* db; /* see comment in Append_block_log_event */

#ifdef MYSQL_SERVER
  Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif

  Execute_load_log_event(const uchar *buf, uint event_len,
                         const Format_description_log_event
                         *description_event);
  ~Execute_load_log_event() = default;
  Log_event_type get_type_code() override { return EXEC_LOAD_EVENT;}
  int get_data_size() override { return  EXEC_LOAD_HEADER_LEN ;}
  bool is_valid() const override { return file_id != 0; }
#ifdef MYSQL_SERVER
  bool write() override;
  const char* get_db() override { return db; }
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
#endif
};


/**
  @class Begin_load_query_log_event

  Event for the first block of file to be loaded, its only difference from
  Append_block event is that this event creates or truncates existing file
  before writing data.

  @section Begin_load_query_log_event_binary_format Binary Format
*/
class Begin_load_query_log_event: public Append_block_log_event
{
public:
#ifdef MYSQL_SERVER
  Begin_load_query_log_event(THD* thd_arg, const char *db_arg,
                             uchar* block_arg, uint block_len_arg,
                             bool using_trans);
#ifdef HAVE_REPLICATION
  Begin_load_query_log_event(THD* thd);
  int get_create_or_append() const override;
#endif /* HAVE_REPLICATION */
#endif
  Begin_load_query_log_event(const uchar *buf, uint event_len,
                             const Format_description_log_event
                             *description_event);
  ~Begin_load_query_log_event() = default;
  Log_event_type get_type_code() override { return BEGIN_LOAD_QUERY_EVENT; }
private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
};


/*
  Elements of this enum describe how LOAD DATA handles duplicates.
*/
enum enum_load_dup_handling { LOAD_DUP_ERROR= 0, LOAD_DUP_IGNORE,
                              LOAD_DUP_REPLACE };

/**
  @class Execute_load_query_log_event

  Event responsible for LOAD DATA execution, it similar to Query_log_event
  but before executing the query it substitutes original filename in LOAD DATA
  query with name of temporary file.

  @section Execute_load_query_log_event_binary_format Binary Format
*/
class Execute_load_query_log_event: public Query_log_event
{
public:
  uint file_id;       // file_id of temporary file
  uint fn_pos_start;  // pointer to the part of the query that should
                      // be substituted
  uint fn_pos_end;    // pointer to the end of this part of query
  /*
    We have to store type of duplicate handling explicitly, because
    for LOAD DATA it also depends on LOCAL option. And this part
    of query will be rewritten during replication so this information
    may be lost...
  */
  enum_load_dup_handling dup_handling;

#ifdef MYSQL_SERVER
  Execute_load_query_log_event(THD* thd, const char* query_arg,
                               ulong query_length, uint fn_pos_start_arg,
                               uint fn_pos_end_arg,
                               enum_load_dup_handling dup_handling_arg,
                               bool using_trans, bool direct,
                               bool suppress_use, int errcode);
#ifdef HAVE_REPLICATION
  void pack_info(Protocol* protocol) override;
#endif /* HAVE_REPLICATION */
#else
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
  /* Prints the query as LOAD DATA LOCAL and with rewritten filename */
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
	     const char *local_fname);
#endif
  Execute_load_query_log_event(const uchar *buf, uint event_len,
                               const Format_description_log_event
                               *description_event);
  ~Execute_load_query_log_event() = default;

  Log_event_type get_type_code() override { return EXECUTE_LOAD_QUERY_EVENT; }
  bool is_valid() const override { return Query_log_event::is_valid() && file_id != 0; }

  ulong get_post_header_size_for_derived() override;
#ifdef MYSQL_SERVER
  bool write_post_header_for_derived() override;
#endif

private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
#endif
};


#ifdef MYSQL_CLIENT
/**
  @class Unknown_log_event

  @section Unknown_log_event_binary_format Binary Format
*/
class Unknown_log_event: public Log_event
{
public:
  enum { UNKNOWN, ENCRYPTED } what;
  /*
    Even if this is an unknown event, we still pass description_event to
    Log_event's ctor, this way we can extract maximum information from the
    event's header (the unique ID for example).
  */
  Unknown_log_event(const uchar *buf,
                    const Format_description_log_event *description_event):
    Log_event(buf, description_event), what(UNKNOWN)
  {}
  /* constructor for hopelessly corrupted events */
  Unknown_log_event(): Log_event(), what(ENCRYPTED) {}
  ~Unknown_log_event() = default;
  bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
  Log_event_type get_type_code() override { return UNKNOWN_EVENT;}
  bool is_valid() const override { return 1; }
};
#endif
char *str_to_hex(char *to, const char *from, size_t len);

/**
  @class Annotate_rows_log_event

  In row-based mode, if binlog_annotate_row_events = ON, each group of
  Table_map_log_events is preceded by an Annotate_rows_log_event which
  contains the query which caused the subsequent rows operations.

  The Annotate_rows_log_event has no post-header and its body contains
  the corresponding query (without trailing zero). Note. The query length
  is to be calculated as a difference between the whole event length and
  the common header length.
*/
class Annotate_rows_log_event: public Log_event
{
public:
#ifndef MYSQL_CLIENT
  Annotate_rows_log_event(THD*, bool using_trans, bool direct);
#endif
  Annotate_rows_log_event(const uchar *buf, uint event_len,
                          const Format_description_log_event*);
  ~Annotate_rows_log_event();

  int get_data_size() override;
  Log_event_type get_type_code() override;
  enum_logged_status logged_status() override { return LOGGED_NO_DATA; }
  bool is_valid() const override;

#ifndef MYSQL_CLIENT
#ifdef HAVE_REPLICATION
   bool is_part_of_group() override { return 1; }
#endif
  bool write_data_header() override;
  bool write_data_body() override;
#endif

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
  void pack_info(Protocol*) override;
#endif

#ifdef MYSQL_CLIENT
  bool print(FILE*, PRINT_EVENT_INFO*) override;
#endif

#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
private:
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info*) override;
#endif

private:
  char *m_query_txt;
  uint  m_query_len;
  char *m_save_thd_query_txt;
  uint  m_save_thd_query_len;
  bool  m_saved_thd_query;
  bool  m_used_query_txt;
};

/**
  @class Table_map_log_event

  In row-based mode, every row operation event is preceded by a
  Table_map_log_event which maps a table definition to a number.  The
  table definition consists of database name, table name, and column
  definitions.

  @section Table_map_log_event_binary_format Binary Format

  The Post-Header has the following components:

  <table>
  <caption>Post-Header for Table_map_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>table_id</td>
    <td>6 bytes unsigned integer</td>
    <td>The number that identifies the table.</td>
  </tr>

  <tr>
    <td>flags</td>
    <td>2 byte bitfield</td>
    <td>Reserved for future use; currently always 0.</td>
  </tr>

  </table>

  The Body has the following components:

  <table>
  <caption>Body for Table_map_log_event</caption>

  <tr>
    <th>Name</th>
    <th>Format</th>
    <th>Description</th>
  </tr>

  <tr>
    <td>database_name</td>
    <td>one byte string length, followed by null-terminated string</td>
    <td>The name of the database in which the table resides.  The name
    is represented as a one byte unsigned integer representing the
    number of bytes in the name, followed by length bytes containing
    the database name, followed by a terminating 0 byte.  (Note the
    redundancy in the representation of the length.)  </td>
  </tr>

  <tr>
    <td>table_name</td>
    <td>one byte string length, followed by null-terminated string</td>
    <td>The name of the table, encoded the same way as the database
    name above.</td>
  </tr>

  <tr>
    <td>column_count</td>
    <td>@ref packed_integer "Packed Integer"</td>
    <td>The number of columns in the table, represented as a packed
    variable-length integer.</td>
  </tr>

  <tr>
    <td>column_type</td>
    <td>List of column_count 1 byte enumeration values</td>
    <td>The type of each column in the table, listed from left to
    right.  Each byte is mapped to a column type according to the
    enumeration type enum_field_types defined in mysql_com.h.  The
    mapping of types to numbers is listed in the table @ref
    Table_table_map_log_event_column_types "below" (along with
    description of the associated metadata field).  </td>
  </tr>

  <tr>
    <td>metadata_length</td>
    <td>@ref packed_integer "Packed Integer"</td>
    <td>The length of the following metadata block</td>
  </tr>

  <tr>
    <td>metadata</td>
    <td>list of metadata for each column</td>
    <td>For each column from left to right, a chunk of data who's
    length and semantics depends on the type of the column.  The
    length and semantics for the metadata for each column are listed
    in the table @ref Table_table_map_log_event_column_types
    "below".</td>
  </tr>

  <tr>
    <td>null_bits</td>
    <td>column_count bits, rounded up to nearest byte</td>
    <td>For each column, a bit indicating whether data in the column
    can be NULL or not.  The number of bytes needed for this is
    int((column_count+7)/8).  The flag for the first column from the
    left is in the least-significant bit of the first byte, the second
    is in the second least significant bit of the first byte, the
    ninth is in the least significant bit of the second byte, and so
    on.  </td>
  </tr>
  <tr>
    <td>optional metadata fields</td>
    <td>optional metadata fields are stored in Type, Length, Value(TLV) format.
    Type takes 1 byte. Length is a packed integer value. Values takes
    Length bytes.
    </td>
    <td>There are some optional metadata defined. They are listed in the table
    @ref Table_table_map_event_optional_metadata. Optional metadata fields
    follow null_bits. Whether binlogging an optional metadata is decided by the
    server. The order is not defined, so they can be binlogged in any order.
    </td>
  </tr>

  </table>

  The table below lists all column types, along with the numerical
  identifier for it and the size and interpretation of meta-data used
  to describe the type.

  @anchor Table_table_map_log_event_column_types
  <table>
  <caption>Table_map_log_event column types: numerical identifier and
  metadata</caption>
  <tr>
    <th>Name</th>
    <th>Identifier</th>
    <th>Size of metadata in bytes</th>
    <th>Description of metadata</th>
  </tr>

  <tr>
    <td>MYSQL_TYPE_DECIMAL</td><td>0</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_TINY</td><td>1</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_SHORT</td><td>2</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_LONG</td><td>3</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_FLOAT</td><td>4</td>
    <td>1 byte</td>
    <td>1 byte unsigned integer, representing the "pack_length", which
    is equal to sizeof(float) on the server from which the event
    originates.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_DOUBLE</td><td>5</td>
    <td>1 byte</td>
    <td>1 byte unsigned integer, representing the "pack_length", which
    is equal to sizeof(double) on the server from which the event
    originates.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_NULL</td><td>6</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_TIMESTAMP</td><td>7</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_LONGLONG</td><td>8</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_INT24</td><td>9</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_DATE</td><td>10</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_TIME</td><td>11</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_DATETIME</td><td>12</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_YEAR</td><td>13</td>
    <td>0</td>
    <td>No column metadata.</td>
  </tr>

  <tr>
    <td><i>MYSQL_TYPE_NEWDATE</i></td><td><i>14</i></td>
    <td>&ndash;</td>
    <td><i>This enumeration value is only used internally and cannot
    exist in a binlog.</i></td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_VARCHAR</td><td>15</td>
    <td>2 bytes</td>
    <td>2 byte unsigned integer representing the maximum length of
    the string.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_BIT</td><td>16</td>
    <td>2 bytes</td>
    <td>A 1 byte unsigned int representing the length in bits of the
    bitfield (0 to 64), followed by a 1 byte unsigned int
    representing the number of bytes occupied by the bitfield.  The
    number of bytes is either int((length+7)/8) or int(length/8).</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_NEWDECIMAL</td><td>246</td>
    <td>2 bytes</td>
    <td>A 1 byte unsigned int representing the precision, followed
    by a 1 byte unsigned int representing the number of decimals.</td>
  </tr>

  <tr>
    <td><i>MYSQL_TYPE_ENUM</i></td><td><i>247</i></td>
    <td>&ndash;</td>
    <td><i>This enumeration value is only used internally and cannot
    exist in a binlog.</i></td>
  </tr>

  <tr>
    <td><i>MYSQL_TYPE_SET</i></td><td><i>248</i></td>
    <td>&ndash;</td>
    <td><i>This enumeration value is only used internally and cannot
    exist in a binlog.</i></td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_TINY_BLOB</td><td>249</td>
    <td>&ndash;</td>
    <td><i>This enumeration value is only used internally and cannot
    exist in a binlog.</i></td>
  </tr>

  <tr>
    <td><i>MYSQL_TYPE_MEDIUM_BLOB</i></td><td><i>250</i></td>
    <td>&ndash;</td>
    <td><i>This enumeration value is only used internally and cannot
    exist in a binlog.</i></td>
  </tr>

  <tr>
    <td><i>MYSQL_TYPE_LONG_BLOB</i></td><td><i>251</i></td>
    <td>&ndash;</td>
    <td><i>This enumeration value is only used internally and cannot
    exist in a binlog.</i></td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_BLOB</td><td>252</td>
    <td>1 byte</td>
    <td>The pack length, i.e., the number of bytes needed to represent
    the length of the blob: 1, 2, 3, or 4.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_VAR_STRING</td><td>253</td>
    <td>2 bytes</td>
    <td>This is used to store both strings and enumeration values.
    The first byte is a enumeration value storing the <i>real
    type</i>, which may be either MYSQL_TYPE_VAR_STRING or
    MYSQL_TYPE_ENUM.  The second byte is a 1 byte unsigned integer
    representing the field size, i.e., the number of bytes needed to
    store the length of the string.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_STRING</td><td>254</td>
    <td>2 bytes</td>
    <td>The first byte is always MYSQL_TYPE_VAR_STRING (i.e., 253).
    The second byte is the field size, i.e., the number of bytes in
    the representation of size of the string: 3 or 4.</td>
  </tr>

  <tr>
    <td>MYSQL_TYPE_GEOMETRY</td><td>255</td>
    <td>1 byte</td>
    <td>The pack length, i.e., the number of bytes needed to represent
    the length of the geometry: 1, 2, 3, or 4.</td>
  </tr>

  </table>
  The table below lists all optional metadata types, along with the numerical
  identifier for it and the size and interpretation of meta-data used
  to describe the type.

  @anchor Table_table_map_event_optional_metadata
  <table>
  <caption>Table_map_event optional metadata types: numerical identifier and
  metadata. Optional metadata fields are stored in TLV fields.
  Format of values are described in this table. </caption>
  <tr>
    <th>Type</th>
    <th>Description</th>
    <th>Format</th>
  </tr>
  <tr>
    <td>SIGNEDNESS</td>
    <td>signedness of numeric colums. This is included for all values of
    binlog_row_metadata.</td>
    <td>For each numeric column, a bit indicates whether the numeric
    colunm has unsigned flag. 1 means it is unsigned. The number of
    bytes needed for this is int((column_count + 7) / 8). The order is
    the same as the order of column_type field.</td>
  </tr>
  <tr>
    <td>DEFAULT_CHARSET</td>
    <td>Charsets of character columns. It has a default charset for
    the case that most of character columns have same charset and the
    most used charset is binlogged as default charset.Collation
    numbers are binlogged for identifying charsets. They are stored in
    packed length format.  Either DEFAULT_CHARSET or COLUMN_CHARSET is
    included for all values of binlog_row_metadata.</td>
    <td>Default charset's collation is logged first. The charsets which are not
    same to default charset are logged following default charset. They are
    logged as column index and charset collation number pair sequence. The
    column index is counted only in all character columns. The order is same to
    the order of column_type
    field. </td>
  </tr>
  <tr>
    <td>COLUMN_CHARSET</td>
    <td>Charsets of character columns. For the case that most of columns have
    different charsets, this field is logged. It is never logged with
    DEFAULT_CHARSET together.  Either DEFAULT_CHARSET or COLUMN_CHARSET is
    included for all values of binlog_row_metadata.</td>
    <td>It is a collation number sequence for all character columns.</td>
  </tr>
  <tr>
    <td>COLUMN_NAME</td>
    <td>Names of columns. This is only included if
    binlog_row_metadata=FULL.</td>
    <td>A sequence of column names. For each column name, 1 byte for
    the string length in bytes is followed by a string without null
    terminator.</td>
  </tr>
  <tr>
    <td>SET_STR_VALUE</td>
    <td>The string values of SET columns. This is only included if
    binlog_row_metadata=FULL.</td>
    <td>For each SET column, a pack_length representing the value
    count is followed by a sequence of length and string pairs. length
    is the byte count in pack_length format. The string has no null
    terminator.</td>
  </tr>
  <tr>
    <td>ENUM_STR_VALUE</td>
    <td>The string values is ENUM columns. This is only included
    if binlog_row_metadata=FULL.</td>
    <td>The format is the same as SET_STR_VALUE.</td>
  </tr>
  <tr>
    <td>GEOMETRY_TYPE</td>
    <td>The real type of geometry columns. This is only included
    if binlog_row_metadata=FULL.</td>
    <td>A sequence of real type of geometry columns are stored in pack_length
    format. </td>
  </tr>
  <tr>
    <td>SIMPLE_PRIMARY_KEY</td>
    <td>The primary key without any prefix. This is only included
    if binlog_row_metadata=FULL and there is a primary key where every
    key part covers an entire column.</td>
    <td>A sequence of column indexes. The indexes are stored in pack_length
    format.</td>
  </tr>
  <tr>
    <td>PRIMARY_KEY_WITH_PREFIX</td>
    <td>The primary key with some prefix. It doesn't appear together with
    SIMPLE_PRIMARY_KEY. This is only included if
    binlog_row_metadata=FULL and there is a primary key where some key
    part covers a prefix of the column.</td>
    <td>A sequence of column index and prefix length pairs. Both
    column index and prefix length are in pack_length format. Prefix length
    0 means that the whole column value is used.</td>
  </tr>
  <tr>
    <td>ENUM_AND_SET_DEFAULT_CHARSET</td>
    <td>Charsets of ENUM and SET columns. It has the same layout as
    DEFAULT_CHARSET.  If there are SET or ENUM columns and
    binlog_row_metadata=FULL, exactly one of
    ENUM_AND_SET_DEFAULT_CHARSET and ENUM_AND_SET_COLUMN_CHARSET
    appears (the encoder chooses the representation that uses the
    least amount of space).  Otherwise, none of them appears.</td>
    <td>The same format as for DEFAULT_CHARSET, except it counts ENUM
    and SET columns rather than character columns.</td>
  </tr>
  <tr>
    <td>ENUM_AND_SET_COLUMN_CHARSET</td>
    <td>Charsets of ENUM and SET columns. It has the same layout as
    COLUMN_CHARSET.  If there are SET or ENUM columns and
    binlog_row_metadata=FULL, exactly one of
    ENUM_AND_SET_DEFAULT_CHARSET and ENUM_AND_SET_COLUMN_CHARSET
    appears (the encoder chooses the representation that uses the
    least amount of space).  Otherwise, none of them appears.</td>
    <td>The same format as for COLUMN_CHARSET, except it counts ENUM
    and SET columns rather than character columns.</td>
  </tr>
  </table>
*/
class Table_map_log_event : public Log_event
{
public:
  /* Constants */
  enum
  {
    TYPE_CODE = TABLE_MAP_EVENT
  };

  /**
     Enumeration of the errors that can be returned.
   */
  enum enum_error
  {
    ERR_OPEN_FAILURE = -1,               /**< Failure to open table */
    ERR_OK = 0,                                 /**< No error */
    ERR_TABLE_LIMIT_EXCEEDED = 1,      /**< No more room for tables */
    ERR_OUT_OF_MEM = 2,                         /**< Out of memory */
    ERR_BAD_TABLE_DEF = 3,     /**< Table definition does not match */
    ERR_RBR_TO_SBR = 4  /**< daisy-chanining RBR to SBR not allowed */
  };

  enum enum_flag
  {
    /* 
       Nothing here right now, but the flags support is there in
       preparation for changes that are coming.  Need to add a
       constant to make it compile under HP-UX: aCC does not like
       empty enumerations.
    */
    ENUM_FLAG_COUNT
  };

  typedef uint16 flag_set;
  /**
    DEFAULT_CHARSET and COLUMN_CHARSET don't appear together, and
    ENUM_AND_SET_DEFAULT_CHARSET and ENUM_AND_SET_COLUMN_CHARSET don't
    appear together. They are just alternative ways to pack character
    set information. When binlogging, it logs character sets in the
    way that occupies least storage.

    SIMPLE_PRIMARY_KEY and PRIMARY_KEY_WITH_PREFIX don't appear together.
    SIMPLE_PRIMARY_KEY is for the primary keys which only use whole values of
    pk columns. PRIMARY_KEY_WITH_PREFIX is
    for the primary keys which just use part value of pk columns.
   */
  enum Optional_metadata_field_type
  {
    SIGNEDNESS = 1,  // UNSIGNED flag of numeric columns
    DEFAULT_CHARSET, /* Character set of string columns, optimized to
                        minimize space when many columns have the
                        same charset. */
    COLUMN_CHARSET,  /* Character set of string columns, optimized to
                        minimize space when columns have many
                        different charsets. */
    COLUMN_NAME,
    SET_STR_VALUE,                // String value of SET columns
    ENUM_STR_VALUE,               // String value of ENUM columns
    GEOMETRY_TYPE,                // Real type of geometry columns
    SIMPLE_PRIMARY_KEY,           // Primary key without prefix
    PRIMARY_KEY_WITH_PREFIX,      // Primary key with prefix
    ENUM_AND_SET_DEFAULT_CHARSET, /* Character set of enum and set
                                     columns, optimized to minimize
                                     space when many columns have the
                                     same charset. */
    ENUM_AND_SET_COLUMN_CHARSET,  /* Character set of enum and set
                                     columns, optimized to minimize
                                     space when many columns have the
                                     same charset. */
  };
  /**
    Metadata_fields organizes m_optional_metadata into a structured format which
    is easy to access.
  */
  // Values for binlog_row_metadata sysvar
  enum enum_binlog_row_metadata
  {
    BINLOG_ROW_METADATA_NO_LOG= 0,
    BINLOG_ROW_METADATA_MINIMAL= 1,
    BINLOG_ROW_METADATA_FULL= 2
  };
  struct Optional_metadata_fields
  {
    typedef std::pair<unsigned int, unsigned int> uint_pair;
    typedef std::vector<std::string> str_vector;

    struct Default_charset
    {
      Default_charset() : default_charset(0) {}
      bool empty() const { return default_charset == 0; }

      // Default charset for the columns which are not in charset_pairs.
      unsigned int default_charset;

      /* The uint_pair means <column index, column charset number>. */
      std::vector<uint_pair> charset_pairs;
    };

    // Contents of DEFAULT_CHARSET field is converted into Default_charset.
    Default_charset m_default_charset;
    // Contents of ENUM_AND_SET_DEFAULT_CHARSET are converted into
    // Default_charset.
    Default_charset m_enum_and_set_default_charset;
    std::vector<bool> m_signedness;
    // Character set number of every string column
    std::vector<unsigned int> m_column_charset;
    // Character set number of every ENUM or SET column.
    std::vector<unsigned int> m_enum_and_set_column_charset;
    std::vector<std::string> m_column_name;
    // each str_vector stores values of one enum/set column
    std::vector<str_vector> m_enum_str_value;
    std::vector<str_vector> m_set_str_value;
    std::vector<unsigned int> m_geometry_type;
    /*
      The uint_pair means <column index, prefix length>.  Prefix length is 0 if
      whole column value is used.
    */
    std::vector<uint_pair> m_primary_key;

    /*
      It parses m_optional_metadata and populates into above variables.

      @param[in] optional_metadata points to the begin of optional metadata
                                   fields in table_map_event.
      @param[in] optional_metadata_len length of optional_metadata field.
     */
    Optional_metadata_fields(unsigned char* optional_metadata,
                             unsigned int optional_metadata_len);
  };

  /**
    Print column metadata. Its format looks like:
    # Columns(colume_name type, colume_name type, ...)
    if colume_name field is not logged into table_map_log_event, then
    only type is printed.

    @@param[out] file the place where colume metadata is printed
    @@param[in]  The metadata extracted from optional metadata fields
 */
  void print_columns(IO_CACHE *file,
                     const Optional_metadata_fields &fields);
  /**
    Print primary information. Its format looks like:
    # Primary Key(colume_name, column_name(prifix), ...)
    if colume_name field is not logged into table_map_log_event, then
    colume index is printed.

    @@param[out] file the place where primary key is printed
    @@param[in]  The metadata extracted from optional metadata fields
 */
  void print_primary_key(IO_CACHE *file,
                         const Optional_metadata_fields &fields);

  /* Special constants representing sets of flags */
  enum 
  {
    TM_NO_FLAGS = 0U,
    TM_BIT_LEN_EXACT_F = (1U << 0),
    // MariaDB flags (we starts from the other end)
    TM_BIT_HAS_TRIGGERS_F= (1U << 14)
  };

  flag_set get_flags(flag_set flag) const { return m_flags & flag; }

#ifdef MYSQL_SERVER
  Table_map_log_event(THD *thd, TABLE *tbl, ulonglong tid,
                      bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
  Table_map_log_event(const uchar *buf, uint event_len,
                      const Format_description_log_event *description_event);
#endif

  ~Table_map_log_event();

#ifdef MYSQL_CLIENT
  table_def *create_table_def()
  {
    return new table_def(m_coltype, m_colcnt, m_field_metadata,
                         m_field_metadata_size, m_null_bits, m_flags);
  }
  int rewrite_db(const char* new_name, size_t new_name_len,
                 const Format_description_log_event*);
#endif
  ulonglong get_table_id() const        { return m_table_id; }
  const char *get_table_name() const { return m_tblnam; }
  const char *get_db_name() const    { return m_dbnam; }

  Log_event_type get_type_code() override { return TABLE_MAP_EVENT; }
  enum_logged_status logged_status() override { return LOGGED_TABLE_MAP; }
  bool is_valid() const override { return m_memory != NULL; /* we check malloc */ }

  int get_data_size() override { return (uint) m_data_size; } 
#ifdef MYSQL_SERVER
#ifdef HAVE_REPLICATION
   bool is_part_of_group() override { return 1; }
#endif
  virtual int save_field_metadata();
  bool write_data_header() override;
  bool write_data_body() override;
  const char *get_db() override { return m_dbnam; }
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  void pack_info(Protocol *protocol) override;
#endif

#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif


private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif

#ifdef MYSQL_SERVER
  TABLE         *m_table;
  Binlog_type_info *binlog_type_info_array;


  // Metadata fields buffer
  StringBuffer<1024> m_metadata_buf;

  /**
    Capture the optional metadata fields which should be logged into
    table_map_log_event and serialize them into m_metadata_buf.
  */
  void init_metadata_fields();
  bool init_signedness_field();
  /**
    Capture and serialize character sets.  Character sets for
    character columns (TEXT etc) and character sets for ENUM and SET
    columns are stored in different metadata fields. The reason is
    that TEXT character sets are included even when
    binlog_row_metadata=MINIMAL, whereas ENUM and SET character sets
    are included only when binlog_row_metadata=FULL.

    @param include_type Predicate to determine if a given Field object
    is to be included in the metadata field.

    @param default_charset_type Type code when storing in "default
    charset" format.  (See comment above Table_maps_log_event in
    libbinlogevents/include/rows_event.h)

    @param column_charset_type Type code when storing in "column
    charset" format.  (See comment above Table_maps_log_event in
    libbinlogevents/include/rows_event.h)
  */
  bool init_charset_field(bool(* include_type)(Binlog_type_info *, Field *),
                          Optional_metadata_field_type default_charset_type,
                          Optional_metadata_field_type column_charset_type);
  bool init_column_name_field();
  bool init_set_str_value_field();
  bool init_enum_str_value_field();
  bool init_geometry_type_field();
  bool init_primary_key_field();
#endif

#ifdef MYSQL_CLIENT
  class Charset_iterator;
  class Default_charset_iterator;
  class Column_charset_iterator;
#endif
  char const    *m_dbnam;
  size_t         m_dblen;
  char const    *m_tblnam;
  size_t         m_tbllen;
  ulong          m_colcnt;
  uchar         *m_coltype;

  uchar         *m_memory;
  ulonglong      m_table_id;
  flag_set       m_flags;

  size_t         m_data_size;

  uchar          *m_field_metadata;        // buffer for field metadata
  /*
    The size of field metadata buffer set by calling save_field_metadata()
  */
  ulong          m_field_metadata_size;   
  uchar         *m_null_bits;
  uchar         *m_meta_memory;
  unsigned int   m_optional_metadata_len;
  unsigned char *m_optional_metadata;
};


/**
  @class Rows_log_event

 Common base class for all row-containing log events.

 RESPONSIBILITIES

   Encode the common parts of all events containing rows, which are:
   - Write data header and data body to an IO_CACHE.
   - Provide an interface for adding an individual row to the event.

  @section Rows_log_event_binary_format Binary Format
*/


class Rows_log_event : public Log_event
{
public:
  /**
     Enumeration of the errors that can be returned.
   */
  enum enum_error
  {
    ERR_OPEN_FAILURE = -1,               /**< Failure to open table */
    ERR_OK = 0,                                 /**< No error */
    ERR_TABLE_LIMIT_EXCEEDED = 1,      /**< No more room for tables */
    ERR_OUT_OF_MEM = 2,                         /**< Out of memory */
    ERR_BAD_TABLE_DEF = 3,     /**< Table definition does not match */
    ERR_RBR_TO_SBR = 4  /**< daisy-chanining RBR to SBR not allowed */
  };

  /*
    These definitions allow you to combine the flags into an
    appropriate flag set using the normal bitwise operators.  The
    implicit conversion from an enum-constant to an integer is
    accepted by the compiler, which is then used to set the real set
    of flags.
  */
  enum enum_flag
  {
    /* Last event of a statement */
    STMT_END_F = (1U << 0),

    /* Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options */
    NO_FOREIGN_KEY_CHECKS_F = (1U << 1),

    /* Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */
    RELAXED_UNIQUE_CHECKS_F = (1U << 2),

    /** 
      Indicates that rows in this event are complete, that is contain
      values for all columns of the table.
     */
    COMPLETE_ROWS_F = (1U << 3),

    /* Value of the OPTION_NO_CHECK_CONSTRAINT_CHECKS flag in thd->options */
    NO_CHECK_CONSTRAINT_CHECKS_F = (1U << 7)
  };

  typedef uint16 flag_set;

  /* Special constants representing sets of flags */
  enum 
  {
      RLE_NO_FLAGS = 0U
  };

  virtual ~Rows_log_event();

  void set_flags(flag_set flags_arg) { m_flags |= flags_arg; }
  void clear_flags(flag_set flags_arg) { m_flags &= ~flags_arg; }
  flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }
  void update_flags() { int2store(temp_buf + m_flags_pos, m_flags); }

  Log_event_type get_type_code() override { return m_type; } /* Specific type (_V1 etc) */
  enum_logged_status logged_status() override { return LOGGED_ROW_EVENT; }
  virtual Log_event_type get_general_type_code() = 0; /* General rows op type, no version */

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  void pack_info(Protocol *protocol) override;
#endif

#ifdef MYSQL_CLIENT
  /* not for direct call, each derived has its own ::print() */
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override= 0;
  void change_to_flashback_event(PRINT_EVENT_INFO *print_event_info, uchar *rows_buff, Log_event_type ev_type);
  bool print_verbose(IO_CACHE *file,
                     PRINT_EVENT_INFO *print_event_info);
  size_t print_verbose_one_row(IO_CACHE *file, table_def *td,
                               PRINT_EVENT_INFO *print_event_info,
                               MY_BITMAP *cols_bitmap,
                               const uchar *ptr, const uchar *prefix,
                               const my_bool no_fill_output= 0); // if no_fill_output=1, then print result is unnecessary
  size_t calc_row_event_length(table_def *td,
                               PRINT_EVENT_INFO *print_event_info,
                               MY_BITMAP *cols_bitmap,
                               const uchar *value);
  void count_row_events(PRINT_EVENT_INFO *print_event_info);

#endif

#ifdef MYSQL_SERVER
  int add_row_data(uchar *data, size_t length)
  {
    return do_add_row_data(data,length); 
  }
#endif

  /* Member functions to implement superclass interface */
  int get_data_size() override;

  MY_BITMAP const *get_cols() const { return &m_cols; }
  MY_BITMAP const *get_cols_ai() const { return &m_cols_ai; }
  size_t get_width() const          { return m_width; }
  ulonglong get_table_id() const        { return m_table_id; }

#if defined(MYSQL_SERVER)
  /*
    This member function compares the table's read/write_set
    with this event's m_cols and m_cols_ai. Comparison takes
    into account what type of rows event is this: Delete, Write or
    Update, therefore it uses the correct m_cols[_ai] according
    to the event type code.

    Note that this member function should only be called for the
    following events:
    - Delete_rows_log_event
    - Write_rows_log_event
    - Update_rows_log_event

    @param[IN] table The table to compare this events bitmaps
                     against.

    @return TRUE if sets match, FALSE otherwise. (following
                 bitmap_cmp return logic).

   */
  bool read_write_bitmaps_cmp(TABLE *table)
  {
    bool res= FALSE;

    switch (get_general_type_code())
    {
      case DELETE_ROWS_EVENT:
        res= bitmap_cmp(get_cols(), table->read_set);
        break;
      case UPDATE_ROWS_EVENT:
        res= (bitmap_cmp(get_cols(), table->read_set) &&
              bitmap_cmp(get_cols_ai(), table->rpl_write_set));
        break;
      case WRITE_ROWS_EVENT:
        res= bitmap_cmp(get_cols(), table->rpl_write_set);
        break;
      default:
        /*
          We should just compare bitmaps for Delete, Write
          or Update rows events.
        */
        DBUG_ASSERT(0);
    }
    return res;
  }
#endif

#ifdef MYSQL_SERVER
  bool write_data_header() override;
  bool write_data_body() override;
  virtual bool write_compressed();
  const char *get_db() override { return m_table->s->db.str; }
#ifdef HAVE_REPLICATION
   bool is_part_of_group() override { return get_flags(STMT_END_F) != 0; }
#endif
#endif
  /*
    Check that malloc() succeeded in allocating memory for the rows
    buffer and the COLS vector. Checking that an Update_rows_log_event
    is valid is done in the Update_rows_log_event::is_valid()
    function.
  */
  bool is_valid() const override
  {
    return m_cols.bitmap;
  }

  uint     m_row_count;         /* The number of rows added to the event */

  const uchar* get_extra_row_data() const   { return m_extra_row_data; }

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  virtual uint8 get_trg_event_map()= 0;

  inline bool do_invoke_trigger()
  {
    return (slave_run_triggers_for_rbr && !master_had_triggers) ||
            slave_run_triggers_for_rbr == SLAVE_RUN_TRIGGERS_FOR_RBR_ENFORCE;
  }
#endif

protected:
  /* 
     The constructors are protected since you're supposed to inherit
     this class, not create instances of this class.
  */
#ifdef MYSQL_SERVER
  Rows_log_event(THD*, TABLE*, ulonglong table_id,
		 MY_BITMAP const *cols, bool is_transactional,
		 Log_event_type event_type);
#endif
  Rows_log_event(const uchar *row_data, uint event_len,
		 const Format_description_log_event *description_event);
  void uncompress_buf();

#ifdef MYSQL_CLIENT
  bool print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
#endif

#ifdef MYSQL_SERVER
  virtual int do_add_row_data(uchar *data, size_t length);
#endif

#ifdef MYSQL_SERVER
  TABLE *m_table;		/* The table the rows belong to */
#endif
  ulonglong       m_table_id;	/* Table ID */
  MY_BITMAP   m_cols;		/* Bitmap denoting columns available */
  ulong       m_width;          /* The width of the columns bitmap */
  /*
    Bitmap for columns available in the after image, if present. These
    fields are only available for Update_rows events. Observe that the
    width of both the before image COLS vector and the after image
    COLS vector is the same: the number of columns of the table on the
    master.
  */
  MY_BITMAP   m_cols_ai;

  ulong       m_master_reclength; /* Length of record on master side */

  /* Bit buffers in the same memory as the class */
  my_bitmap_map  m_bitbuf[128/(sizeof(my_bitmap_map)*8)];
  my_bitmap_map  m_bitbuf_ai[128/(sizeof(my_bitmap_map)*8)];

  uchar    *m_rows_buf;		/* The rows in packed format */
  uchar    *m_rows_cur;		/* One-after the end of the data */
  uchar    *m_rows_end;		/* One-after the end of the allocated space */

  size_t   m_rows_before_size;  /* The length before m_rows_buf */
  size_t   m_flags_pos; /* The position of the m_flags */

  flag_set m_flags;		/* Flags for row-level events */

  Log_event_type m_type;        /* Actual event type */

  uchar    *m_extra_row_data;   /* Pointer to extra row data if any */
                                /* If non null, first byte is length */

  bool m_vers_from_plain;


  /* helper functions */

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  const uchar *m_curr_row;     /* Start of the row being processed */
  const uchar *m_curr_row_end; /* One-after the end of the current row */
  uchar    *m_key;      /* Buffer to keep key value during searches */
  KEY      *m_key_info; /* Pointer to KEY info for m_key_nr */
  uint      m_key_nr;   /* Key number */
  bool master_had_triggers;     /* set after tables opening */

  /*
    RAII helper class to automatically handle the override/restore of thd->db
    when applying row events, so it will be visible in SHOW PROCESSLIST.

    If triggers will be invoked, their logic frees the current thread's db,
    so we use set_db() to use a copy of the table share's database.

    If not using triggers, the db is never freed, and we can reference the
    same memory owned by the table share.
  */
  class Db_restore_ctx
  {
  private:
    THD *thd;
    LEX_CSTRING restore_db;
    bool db_copied;

    Db_restore_ctx(Rows_log_event *rev)
        : thd(rev->thd), restore_db(rev->thd->db)
    {
      TABLE *table= rev->m_table;

      if (table->triggers && rev->do_invoke_trigger())
      {
        thd->reset_db(&null_clex_str);
        thd->set_db(&table->s->db);
        db_copied= true;
      }
      else
      {
        thd->reset_db(&table->s->db);
        db_copied= false;
      }
    }

    ~Db_restore_ctx()
    {
      if (db_copied)
        thd->set_db(&null_clex_str);
      thd->reset_db(&restore_db);
    }

    friend class Rows_log_event;
  };

  int find_key(); // Find a best key to use in find_row()
  int find_row(rpl_group_info *);
  int write_row(rpl_group_info *, const bool);
  int update_sequence();

  // Unpack the current row into m_table->record[0], but with
  // a different columns bitmap.
  int unpack_current_row(rpl_group_info *rgi, MY_BITMAP const *cols)
  {
    DBUG_ASSERT(m_table);

    ASSERT_OR_RETURN_ERROR(m_curr_row <= m_rows_end, HA_ERR_CORRUPT_EVENT);
    return ::unpack_row(rgi, m_table, m_width, m_curr_row, cols,
                                   &m_curr_row_end, &m_master_reclength, m_rows_end);
  }

  // Unpack the current row into m_table->record[0]
  int unpack_current_row(rpl_group_info *rgi)
  {
    DBUG_ASSERT(m_table);

    ASSERT_OR_RETURN_ERROR(m_curr_row <= m_rows_end, HA_ERR_CORRUPT_EVENT);
    return ::unpack_row(rgi, m_table, m_width, m_curr_row, &m_cols,
                                   &m_curr_row_end, &m_master_reclength, m_rows_end);
  }
  bool process_triggers(trg_event_type event,
                        trg_action_time_type time_type,
                        bool old_row_is_record1);

  /**
    Helper function to check whether there is an auto increment
    column on the table where the event is to be applied.

    @return true if there is an autoincrement field on the extra
            columns, false otherwise.
   */
  inline bool is_auto_inc_in_extra_columns()
  {
    DBUG_ASSERT(m_table);
    return (m_table->next_number_field &&
            m_table->next_number_field->field_index >= m_width);
  }
#endif

private:

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
  int do_update_pos(rpl_group_info *rgi) override;
  enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;

  /*
    Primitive to prepare for a sequence of row executions.

    DESCRIPTION

      Before doing a sequence of do_prepare_row() and do_exec_row()
      calls, this member function should be called to prepare for the
      entire sequence. Typically, this member function will allocate
      space for any buffers that are needed for the two member
      functions mentioned above.

    RETURN VALUE

      The member function will return 0 if all went OK, or a non-zero
      error code otherwise.
  */
  virtual 
  int do_before_row_operations(const Slave_reporting_capability *const log) = 0;

  /*
    Primitive to clean up after a sequence of row executions.

    DESCRIPTION
    
      After doing a sequence of do_prepare_row() and do_exec_row(),
      this member function should be called to clean up and release
      any allocated buffers.
      
      The error argument, if non-zero, indicates an error which happened during
      row processing before this function was called. In this case, even if 
      function is successful, it should return the error code given in the argument.
  */
  virtual 
  int do_after_row_operations(const Slave_reporting_capability *const log,
                              int error) = 0;

  /*
    Primitive to do the actual execution necessary for a row.

    DESCRIPTION
      The member function will do the actual execution needed to handle a row.
      The row is located at m_curr_row. When the function returns,
      m_curr_row_end should point at the next row (one byte after the end
      of the current row).    

    RETURN VALUE
      0 if execution succeeded, 1 if execution failed.
      
  */
  virtual int do_exec_row(rpl_group_info *rli) = 0;
#endif /* defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) */

  friend class Old_rows_log_event;
};

/**
  @class Write_rows_log_event

  Log row insertions and updates. The event contain several
  insert/update rows for a table. Note that each event contains only
  rows for one table.

  @section Write_rows_log_event_binary_format Binary Format
*/
class Write_rows_log_event : public Rows_log_event
{
public:
  enum 
  {
    /* Support interface to THD::binlog_prepare_pending_rows_event */
    TYPE_CODE = WRITE_ROWS_EVENT
  };

#if defined(MYSQL_SERVER)
  Write_rows_log_event(THD*, TABLE*, ulonglong table_id,
                       bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
  Write_rows_log_event(const uchar *buf, uint event_len,
                       const Format_description_log_event *description_event);
#endif
#if defined(MYSQL_SERVER) 
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
                                          bool is_transactional,
                                          const uchar *before_record
                                          __attribute__((unused)),
                                          const uchar *after_record)
  {
    DBUG_ASSERT(!table->versioned(VERS_TRX_ID));
    return thd->binlog_write_row(table, is_transactional, after_record);
  }
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  uint8 get_trg_event_map() override;
#endif

private:
  Log_event_type get_general_type_code() override { return (Log_event_type)TYPE_CODE; }

#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_before_row_operations(const Slave_reporting_capability *const) override;
  int do_after_row_operations(const Slave_reporting_capability *const,int) override;
  int do_exec_row(rpl_group_info *) override;
#endif
};

class Write_rows_compressed_log_event : public Write_rows_log_event
{
public:
#if defined(MYSQL_SERVER)
  Write_rows_compressed_log_event(THD*, TABLE*, ulonglong table_id,
                       bool is_transactional);
  bool write() override;
#endif
#ifdef HAVE_REPLICATION
  Write_rows_compressed_log_event(const uchar *buf, uint event_len,
                       const Format_description_log_event *description_event);
#endif
private:
#if defined(MYSQL_CLIENT)
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
};

/**
  @class Update_rows_log_event

  Log row updates with a before image. The event contain several
  update rows for a table. Note that each event contains only rows for
  one table.

  Also note that the row data consists of pairs of row data: one row
  for the old data and one row for the new data.

  @section Update_rows_log_event_binary_format Binary Format
*/
class Update_rows_log_event : public Rows_log_event
{
public:
  enum 
  {
    /* Support interface to THD::binlog_prepare_pending_rows_event */
    TYPE_CODE = UPDATE_ROWS_EVENT
  };

#ifdef MYSQL_SERVER
  Update_rows_log_event(THD*, TABLE*, ulonglong table_id,
                        bool is_transactional);

  void init(MY_BITMAP const *cols);
#endif

  virtual ~Update_rows_log_event();

#ifdef HAVE_REPLICATION
  Update_rows_log_event(const uchar *buf, uint event_len,
			const Format_description_log_event *description_event);
#endif

#ifdef MYSQL_SERVER
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
                                          bool is_transactional,
                                          const uchar *before_record,
                                          const uchar *after_record)
  {
    DBUG_ASSERT(!table->versioned(VERS_TRX_ID));
    return thd->binlog_update_row(table, is_transactional,
                                  before_record, after_record);
  }
#endif

  bool is_valid() const override
  {
    return Rows_log_event::is_valid() && m_cols_ai.bitmap;
  }

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  uint8 get_trg_event_map() override;
#endif

protected:
  Log_event_type get_general_type_code() override { return (Log_event_type)TYPE_CODE; }

#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_before_row_operations(const Slave_reporting_capability *const) override;
  int do_after_row_operations(const Slave_reporting_capability *const,int) override;
  int do_exec_row(rpl_group_info *) override;
#endif /* defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) */
};

class Update_rows_compressed_log_event : public Update_rows_log_event
{
public:
#if defined(MYSQL_SERVER)
  Update_rows_compressed_log_event(THD*, TABLE*, ulonglong table_id,
                        bool is_transactional);
  bool write() override;
#endif
#ifdef HAVE_REPLICATION
  Update_rows_compressed_log_event(const uchar *buf, uint event_len,
                       const Format_description_log_event *description_event);
#endif
private:
#if defined(MYSQL_CLIENT)
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
};

/**
  @class Delete_rows_log_event

  Log row deletions. The event contain several delete rows for a
  table. Note that each event contains only rows for one table.

  RESPONSIBILITIES

    - Act as a container for rows that has been deleted on the master
      and should be deleted on the slave. 

  COLLABORATION

    Row_writer
      Create the event and add rows to the event.
    Row_reader
      Extract the rows from the event.

  @section Delete_rows_log_event_binary_format Binary Format
*/
class Delete_rows_log_event : public Rows_log_event
{
public:
  enum 
  {
    /* Support interface to THD::binlog_prepare_pending_rows_event */
    TYPE_CODE = DELETE_ROWS_EVENT
  };

#ifdef MYSQL_SERVER
  Delete_rows_log_event(THD*, TABLE*, ulonglong, bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
  Delete_rows_log_event(const uchar *buf, uint event_len,
			const Format_description_log_event *description_event);
#endif
#ifdef MYSQL_SERVER
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
                                          bool is_transactional,
                                          const uchar *before_record,
                                          const uchar *after_record
                                          __attribute__((unused)))
  {
    DBUG_ASSERT(!table->versioned(VERS_TRX_ID));
    return thd->binlog_delete_row(table, is_transactional,
                                  before_record);
  }
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  uint8 get_trg_event_map() override;
#endif

protected:
  Log_event_type get_general_type_code() override { return (Log_event_type)TYPE_CODE; }

#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_before_row_operations(const Slave_reporting_capability *const) override;
  int do_after_row_operations(const Slave_reporting_capability *const,int) override;
  int do_exec_row(rpl_group_info *) override;
#endif
};

class Delete_rows_compressed_log_event : public Delete_rows_log_event
{
public:
#if defined(MYSQL_SERVER)
  Delete_rows_compressed_log_event(THD*, TABLE*, ulonglong,
                                   bool is_transactional);
  bool write() override;
#endif
#ifdef HAVE_REPLICATION
  Delete_rows_compressed_log_event(const uchar *buf, uint event_len,
                       const Format_description_log_event *description_event);
#endif
private:
#if defined(MYSQL_CLIENT)
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
};


#include "log_event_old.h"

/**
  @class Incident_log_event

   Class representing an incident, an occurence out of the ordinary,
   that happened on the master.

   The event is used to inform the slave that something out of the
   ordinary happened on the master that might cause the database to be
   in an inconsistent state.

   <table id="IncidentFormat">
   <caption>Incident event format</caption>
   <tr>
     <th>Symbol</th>
     <th>Format</th>
     <th>Description</th>
   </tr>
   <tr>
     <td>INCIDENT</td>
     <td align="right">2</td>
     <td>Incident number as an unsigned integer</td>
   </tr>
   <tr>
     <td>MSGLEN</td>
     <td align="right">1</td>
     <td>Message length as an unsigned integer</td>
   </tr>
   <tr>
     <td>MESSAGE</td>
     <td align="right">MSGLEN</td>
     <td>The message, if present. Not null terminated.</td>
   </tr>
   </table>

  @section Delete_rows_log_event_binary_format Binary Format
*/
class Incident_log_event : public Log_event {
public:
#ifdef MYSQL_SERVER
  Incident_log_event(THD *thd_arg, Incident incident)
    : Log_event(thd_arg, 0, FALSE), m_incident(incident)
  {
    DBUG_ENTER("Incident_log_event::Incident_log_event");
    DBUG_PRINT("enter", ("m_incident: %d", m_incident));
    m_message.str= NULL;                    /* Just as a precaution */
    m_message.length= 0;
    set_direct_logging();
    /* Replicate the incident regardless of @@skip_replication. */
    flags&= ~LOG_EVENT_SKIP_REPLICATION_F;
    DBUG_VOID_RETURN;
  }

  Incident_log_event(THD *thd_arg, Incident incident, const LEX_CSTRING *msg)
    : Log_event(thd_arg, 0, FALSE), m_incident(incident)
  {
    extern PSI_memory_key key_memory_Incident_log_event_message;
    DBUG_ENTER("Incident_log_event::Incident_log_event");
    DBUG_PRINT("enter", ("m_incident: %d", m_incident));
    m_message.length= 0;
    if (!(m_message.str= (char*) my_malloc(key_memory_Incident_log_event_message,
                                           msg->length + 1, MYF(MY_WME))))
    {
      /* Mark this event invalid */
      m_incident= INCIDENT_NONE;
      DBUG_VOID_RETURN;
    }
    strmake(m_message.str, msg->str, msg->length);
    m_message.length= msg->length;
    set_direct_logging();
    /* Replicate the incident regardless of @@skip_replication. */
    flags&= ~LOG_EVENT_SKIP_REPLICATION_F;
    DBUG_VOID_RETURN;
  }
#endif

#ifdef MYSQL_SERVER
#ifdef HAVE_REPLICATION
  void pack_info(Protocol*) override;
#endif
  bool write_data_header() override;
  bool write_data_body() override;
#endif

  Incident_log_event(const uchar *buf, uint event_len,
                     const Format_description_log_event *descr_event);

  virtual ~Incident_log_event();

#ifdef MYSQL_CLIENT
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
  int do_apply_event(rpl_group_info *rgi) override;
#endif

  Log_event_type get_type_code() override { return INCIDENT_EVENT; }

  bool is_valid() const override
  {
    return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
  }
  int get_data_size() override {
    return INCIDENT_HEADER_LEN + 1 + (uint) m_message.length;
  }

private:
  const char *description() const;

  Incident m_incident;
  LEX_STRING m_message;
};

/**
  @class Ignorable_log_event

  Base class for ignorable log events. Events deriving from
  this class can be safely ignored by slaves that cannot
  recognize them. Newer slaves, will be able to read and
  handle them. This has been designed to be an open-ended
  architecture, so adding new derived events shall not harm
  the old slaves that support ignorable log event mechanism
  (they will just ignore unrecognized ignorable events).

  @note The only thing that makes an event ignorable is that it has
  the LOG_EVENT_IGNORABLE_F flag set.  It is not strictly necessary
  that ignorable event types derive from Ignorable_log_event; they may
  just as well derive from Log_event and pass LOG_EVENT_IGNORABLE_F as
  argument to the Log_event constructor.
**/

class Ignorable_log_event : public Log_event {
public:
  int number;
  const char *description;

#ifndef MYSQL_CLIENT
  Ignorable_log_event(THD *thd_arg)
    :Log_event(thd_arg, LOG_EVENT_IGNORABLE_F, FALSE),
    number(0), description("internal")
  {
    DBUG_ENTER("Ignorable_log_event::Ignorable_log_event");
    DBUG_VOID_RETURN;
  }
#endif

  Ignorable_log_event(const uchar *buf,
                      const Format_description_log_event *descr_event,
                      const char *event_name);
  virtual ~Ignorable_log_event();

#ifndef MYSQL_CLIENT
#ifdef HAVE_REPLICATION
   void pack_info(Protocol*) override;
#endif
#else
  bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif

  Log_event_type get_type_code() override { return IGNORABLE_LOG_EVENT; }

  bool is_valid() const override { return 1; }

  int get_data_size() override { return IGNORABLE_HEADER_LEN; }
};

#ifdef MYSQL_CLIENT
bool copy_cache_to_string_wrapped(IO_CACHE *body,
                                  LEX_STRING *to,
                                  bool do_wrap,
                                  const char *delimiter,
                                  bool is_verbose);
bool copy_cache_to_file_wrapped(IO_CACHE *body,
                                FILE *file,
                                bool do_wrap,
                                const char *delimiter,
                                bool is_verbose);
#endif

#ifdef MYSQL_SERVER
/*****************************************************************************

  Heartbeat Log Event class

  Replication event to ensure to slave that master is alive.
  The event is originated by master's dump thread and sent straight to
  slave without being logged. Slave itself does not store it in relay log
  but rather uses a data for immediate checks and throws away the event.

  Two members of the class log_ident and Log_event::log_pos comprise 
  @see the event_coordinates instance. The coordinates that a heartbeat
  instance carries correspond to the last event master has sent from
  its binlog.

 ****************************************************************************/
class Heartbeat_log_event: public Log_event
{
public:
  uint8 hb_flags;
  Heartbeat_log_event(const uchar *buf, uint event_len,
                      const Format_description_log_event* description_event);
  Log_event_type get_type_code() override { return HEARTBEAT_LOG_EVENT; }
  bool is_valid() const override
    {
      return (log_ident != NULL && ident_len <= FN_REFLEN-1 &&
              log_pos >= BIN_LOG_HEADER_SIZE);
    }
  const uchar * get_log_ident() { return log_ident; }
  uint get_ident_len() { return ident_len; }
  
private:
  uint ident_len;
  const uchar *log_ident;
};

inline int Log_event_writer::write(Log_event *ev)
{
  ev->writer= this;
  int res= ev->write();
  IF_DBUG(ev->writer= 0,); // writer must be set before every Log_event::write
  add_status(ev->logged_status());
  return res;
}

/**
   The function is called by slave applier in case there are
   active table filtering rules to force gathering events associated
   with Query-log-event into an array to execute
   them once the fate of the Query is determined for execution.
*/
bool slave_execute_deferred_events(THD *thd);
#endif

bool event_that_should_be_ignored(const uchar *buf);
bool event_checksum_test(uchar *buf, ulong event_len,
                         enum_binlog_checksum_alg alg);
enum enum_binlog_checksum_alg get_checksum_alg(const uchar *buf, ulong len);
extern TYPELIB binlog_checksum_typelib;
#ifdef WITH_WSREP
enum Log_event_type wsrep_peak_event(rpl_group_info *rgi, ulonglong* event_size);
#endif /* WITH_WSREP */

/**
  @} (end of group Replication)
*/


int binlog_buf_compress(const uchar *src, uchar *dst, uint32 len,
                        uint32 *comlen);
int binlog_buf_uncompress(const uchar *src, uchar *dst, uint32 len,
                          uint32 *newlen);
uint32 binlog_get_compress_len(uint32 len);
uint32 binlog_get_uncompress_len(const uchar *buf);

int query_event_uncompress(const Format_description_log_event *description_event,
                           bool contain_checksum,
                           const uchar *src, ulong src_len, uchar *buf,
                           ulong buf_size, bool* is_malloc,
                           uchar **dst, ulong *newlen);
int row_log_event_uncompress(const Format_description_log_event
                             *description_event,
                             bool contain_checksum,
                             const uchar *src, ulong src_len,
                             uchar* buf, ulong buf_size, bool *is_malloc,
                             uchar **dst, ulong *newlen);

#endif /* _log_event_h */
server/private/ssl_compat.h000064400000006113150400263740012043 0ustar00/*
 Copyright (c) 2016, 2021, 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-1301  USA */

#include <openssl/opensslv.h>

/* OpenSSL version specific definitions */
#if defined(OPENSSL_VERSION_NUMBER)

#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
	!(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000L)
#define HAVE_OPENSSL11 1
#define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION)
#define ERR_remove_state(X) ERR_clear_error()
#define EVP_CIPHER_CTX_SIZE 200
#define EVP_MD_CTX_SIZE 80
#undef EVP_MD_CTX_init
#define EVP_MD_CTX_init(X) do { memset((X), 0, EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
#undef EVP_CIPHER_CTX_init
#define EVP_CIPHER_CTX_init(X) do { memset((X), 0, EVP_CIPHER_CTX_SIZE); EVP_CIPHER_CTX_reset(X); } while(0)

/*
  Macros below are deprecated. OpenSSL 1.1 may define them or not,
  depending on how it was built.
*/
#undef ERR_free_strings
#define ERR_free_strings()
#undef EVP_cleanup
#define EVP_cleanup()
#undef CRYPTO_cleanup_all_ex_data
#define CRYPTO_cleanup_all_ex_data()
#undef SSL_load_error_strings
#define SSL_load_error_strings()

#else
#define HAVE_OPENSSL10 1
#ifdef HAVE_WOLFSSL
#define SSL_LIBRARY "WolfSSL " WOLFSSL_VERSION
#else
#define SSL_LIBRARY SSLeay_version(SSLEAY_VERSION)
#endif

#ifdef HAVE_WOLFSSL
#undef ERR_remove_state
#define ERR_remove_state(x) do {} while(0)
#elif defined (HAVE_ERR_remove_thread_state)
#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
#endif /* HAVE_ERR_remove_thread_state */

#endif /* HAVE_OPENSSL11 */
#endif

#ifdef HAVE_WOLFSSL
#define EVP_MD_CTX_SIZE                 sizeof(wc_Md5)
#endif

#ifndef HAVE_OPENSSL11
#ifndef ASN1_STRING_get0_data
#define ASN1_STRING_get0_data(X)        ASN1_STRING_data(X)
#endif
#ifndef EVP_MD_CTX_SIZE
#define EVP_MD_CTX_SIZE                 sizeof(EVP_MD_CTX)
#endif

#ifndef DH_set0_pqg
#define DH_set0_pqg(D,P,Q,G)            ((D)->p= (P), (D)->g= (G))
#endif

#define EVP_CIPHER_CTX_encrypting(ctx)  ((ctx)->encrypt)
#define EVP_CIPHER_CTX_SIZE             sizeof(EVP_CIPHER_CTX)

#ifndef HAVE_WOLFSSL
#define OPENSSL_init_ssl(X,Y)           SSL_library_init()
#define EVP_MD_CTX_reset(X) EVP_MD_CTX_cleanup(X)
#define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X)
#define X509_get0_notBefore(X) X509_get_notBefore(X)
#define X509_get0_notAfter(X) X509_get_notAfter(X)
#endif
#endif

#ifndef TLS1_3_VERSION
#define SSL_CTX_set_ciphersuites(X,Y) 0
#endif

#ifdef	__cplusplus
extern "C" {
#endif /* __cplusplus */

int check_openssl_compatibility();

#ifdef	__cplusplus
}
#endif
server/private/pfs_table_provider.h000064400000005101150400263740013544 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_TABLE_PROVIDER_H
#define PFS_TABLE_PROVIDER_H

/**
  @file include/pfs_table_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_TABLE_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_TABLE_CALL(M) pfs_ ## M ## _v1

C_MODE_START

PSI_table_share*
pfs_get_table_share_v1(my_bool temporary, struct TABLE_SHARE *share);

void pfs_release_table_share_v1(PSI_table_share* share);

void
pfs_drop_table_share_v1(my_bool temporary,
                        const char *schema_name, int schema_name_length,
                        const char *table_name, int table_name_length);

PSI_table*
pfs_open_table_v1(PSI_table_share *share, const void *identity);

void pfs_unbind_table_v1(PSI_table *table);

PSI_table *
pfs_rebind_table_v1(PSI_table_share *share, const void *identity, PSI_table *table);

void pfs_close_table_v1(struct TABLE_SHARE *server_share, PSI_table *table);

PSI_table_locker*
pfs_start_table_io_wait_v1(PSI_table_locker_state *state,
                           PSI_table *table,
                           PSI_table_io_operation op,
                           uint index,
                           const char *src_file, uint src_line);

PSI_table_locker*
pfs_start_table_lock_wait_v1(PSI_table_locker_state *state,
                             PSI_table *table,
                             PSI_table_lock_operation op,
                             ulong op_flags,
                             const char *src_file, uint src_line);

void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows);

void pfs_end_table_lock_wait_v1(PSI_table_locker* locker);

void pfs_unlock_table_v1(PSI_table *table);

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_TABLE_INTERFACE */

#endif

server/private/sql_alter.h000064400000035655150400263740011702 0ustar00/* Copyright (c) 2010, 2014, Oracle and/or its affiliates.
   Copyright (c) 2013, 2021, 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 */

#ifndef SQL_ALTER_TABLE_H
#define SQL_ALTER_TABLE_H

class Alter_drop;
class Alter_column;
class Alter_rename_key;
class Alter_index_ignorability;
class Key;

/**
  Data describing the table being created by CREATE TABLE or
  altered by ALTER TABLE.
*/

class Alter_info
{
public:

  enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };

  bool vers_prohibited(THD *thd) const;

  /**
     The different values of the ALGORITHM clause.
     Describes which algorithm to use when altering the table.
  */
  enum enum_alter_table_algorithm
  {
/*
  Use thd->variables.alter_algorithm for alter method. If this is also
  default then use the fastest possible ALTER TABLE method
  (INSTANT, NOCOPY, INPLACE, COPY)
*/
    ALTER_TABLE_ALGORITHM_DEFAULT,

    // Copy if supported, error otherwise.
    ALTER_TABLE_ALGORITHM_COPY,

    // In-place if supported, error otherwise.
    ALTER_TABLE_ALGORITHM_INPLACE,

    // No Copy will refuse any operation which does rebuild.
    ALTER_TABLE_ALGORITHM_NOCOPY,

    // Instant should allow any operation that changes metadata only.
    ALTER_TABLE_ALGORITHM_INSTANT,

    // When there is no specification of algorithm during alter table.
    ALTER_TABLE_ALGORITHM_NONE
  };


  /**
     The different values of the LOCK clause.
     Describes the level of concurrency during ALTER TABLE.
  */
  enum enum_alter_table_lock
  {
    // Maximum supported level of concurency for the given operation.
    ALTER_TABLE_LOCK_DEFAULT,

    // Allow concurrent reads & writes. If not supported, give error.
    ALTER_TABLE_LOCK_NONE,

    // Allow concurrent reads only. If not supported, give error.
    ALTER_TABLE_LOCK_SHARED,

    // Block reads and writes.
    ALTER_TABLE_LOCK_EXCLUSIVE
  };

  Lex_table_name db, table_name;

  // Columns and keys to be dropped.
  List<Alter_drop>              drop_list;
  // Columns for ALTER_CHANGE_COLUMN_DEFAULT.
  List<Alter_column>            alter_list;
  // List of keys, used by both CREATE and ALTER TABLE.
  List<Key>                     key_list;
  // List of keys to be renamed.
  List<Alter_rename_key>        alter_rename_key_list;
  // List of columns, used by both CREATE and ALTER TABLE.
  List<Create_field>            create_list;
  // Indexes whose ignorability needs to be changed.
  List<Alter_index_ignorability>  alter_index_ignorability_list;
  List<Virtual_column_info>     check_constraint_list;
  // Type of ALTER TABLE operation.
  alter_table_operations        flags;
  ulong                         partition_flags;
  // Enable or disable keys.
  enum_enable_or_disable        keys_onoff;
  // Used only in add_stat_drop_index()
  TABLE                         *original_table;
  // List of partitions.
  List<const char>              partition_names;
  // Number of partitions.
  uint                          num_parts;

  /* List of fields that we should delete statistics from */
  List<Field> drop_stat_fields;

  struct DROP_INDEX_STAT_PARAMS
  {
    KEY *key;
    bool ext_prefixes_only;
  };

  struct RENAME_COLUMN_STAT_PARAMS
  {
    Field *field;
    LEX_CSTRING *name;
    uint duplicate_counter;                       // For temporary names
  };
  struct RENAME_INDEX_STAT_PARAMS
  {
    const KEY *key;
    const LEX_CSTRING *name;
    uint duplicate_counter;                       // For temporary names
    uint usage_count;                             // How many rename entries
  };

  /* List of index that we should delete statistics from */
  List<DROP_INDEX_STAT_PARAMS> drop_stat_indexes;

  List<RENAME_COLUMN_STAT_PARAMS> rename_stat_fields;

  List<RENAME_INDEX_STAT_PARAMS> rename_stat_indexes;

  bool add_stat_drop_index(KEY *key, bool ext_prefixes_only,
                           MEM_ROOT *mem_root)
  {
    DROP_INDEX_STAT_PARAMS *param;
    if (!(param= (DROP_INDEX_STAT_PARAMS*)
          alloc_root(mem_root, sizeof(*param))))
      return true;
    param->key=  key;
    param->ext_prefixes_only= ext_prefixes_only;
    return drop_stat_indexes.push_back(param, mem_root);
  }

  bool add_stat_drop_index(THD *thd, const LEX_CSTRING *key_name);

  bool add_stat_rename_index(const KEY *key, const LEX_CSTRING *name,
                             MEM_ROOT *mem_root)
  {
    RENAME_INDEX_STAT_PARAMS *param;
    if (!(param= (RENAME_INDEX_STAT_PARAMS*)
          alloc_root(mem_root, sizeof(*param))))
      return true;
    param->key=  key;
    param->name= name;
    param->usage_count= 0;
    return rename_stat_indexes.push_back(param, mem_root);
  }

  bool add_stat_rename_field(Field *field, LEX_CSTRING *name,
                             MEM_ROOT *mem_root)
  {
    RENAME_COLUMN_STAT_PARAMS *param;
    if (!(param= (RENAME_COLUMN_STAT_PARAMS*)
          alloc_root(mem_root, sizeof(*param))))
      return true;
    param->field= field;
    param->name=  name;
    param->duplicate_counter= 0;
    return rename_stat_fields.push_back(param, mem_root);
  }

  bool collect_renamed_fields(THD *thd);

  /* Delete/update statistics in EITS tables */
  void apply_statistics_deletes_renames(THD *thd, TABLE *table);

private:
  // Type of ALTER TABLE algorithm.
  enum_alter_table_algorithm    requested_algorithm;

public:
  // Type of ALTER TABLE lock.
  enum_alter_table_lock         requested_lock;


  Alter_info() :
  flags(0), partition_flags(0),
    keys_onoff(LEAVE_AS_IS),
    original_table(0),
    num_parts(0),
    requested_algorithm(ALTER_TABLE_ALGORITHM_NONE),
    requested_lock(ALTER_TABLE_LOCK_DEFAULT)
  {}

  void reset()
  {
    drop_list.empty();
    alter_list.empty();
    key_list.empty();
    alter_rename_key_list.empty();
    create_list.empty();
    alter_index_ignorability_list.empty();
    check_constraint_list.empty();
    drop_stat_fields.empty();
    drop_stat_indexes.empty();
    rename_stat_fields.empty();
    rename_stat_indexes.empty();
    flags= 0;
    partition_flags= 0;
    keys_onoff= LEAVE_AS_IS;
    num_parts= 0;
    partition_names.empty();
    requested_algorithm= ALTER_TABLE_ALGORITHM_NONE;
    requested_lock= ALTER_TABLE_LOCK_DEFAULT;
  }


  /**
    Construct a copy of this object to be used for mysql_alter_table
    and mysql_create_table.

    Historically, these two functions modify their Alter_info
    arguments. This behaviour breaks re-execution of prepared
    statements and stored procedures and is compensated by always
    supplying a copy of Alter_info to these functions.

    @param  rhs       Alter_info to make copy of
    @param  mem_root  Mem_root for new Alter_info

    @note You need to use check the error in THD for out
    of memory condition after calling this function.
  */
  Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root);


  /**
     Parses the given string and sets requested_algorithm
     if the string value matches a supported value.
     Supported values: INPLACE, COPY, DEFAULT

     @param  str    String containing the supplied value
     @retval false  Supported value found, state updated
     @retval true   Not supported value, no changes made
  */
  bool set_requested_algorithm(const LEX_CSTRING *str);


  /**
     Parses the given string and sets requested_lock
     if the string value matches a supported value.
     Supported values: NONE, SHARED, EXCLUSIVE, DEFAULT

     @param  str    String containing the supplied value
     @retval false  Supported value found, state updated
     @retval true   Not supported value, no changes made
  */

  bool set_requested_lock(const LEX_CSTRING *str);

  /**
    Set the requested algorithm to the given algorithm value
    @param algo_value	algorithm to be set
   */
  void set_requested_algorithm(enum_alter_table_algorithm algo_value);

  /**
     Returns the algorithm value in the format "algorithm=value"
  */
  const char* algorithm_clause(THD *thd) const;

  /**
     Returns the lock value in the format "lock=value"
  */
  const char* lock() const;

  /**
     Check whether the given result can be supported
     with the specified user alter algorithm.

     @param  thd            Thread handle
     @param  ha_alter_info  Structure describing changes to be done
                            by ALTER TABLE and holding data during
                            in-place alter
     @retval false  Supported operation
     @retval true   Not supported value
  */
  bool supports_algorithm(THD *thd,
                          const Alter_inplace_info *ha_alter_info);

  /**
     Check whether the given result can be supported
     with the specified user lock type.

     @param  ha_alter_info  Structure describing changes to be done
                            by ALTER TABLE and holding data during
                            in-place alter
     @retval false  Supported lock type
     @retval true   Not supported value
  */
  bool supports_lock(THD *thd, const Alter_inplace_info *ha_alter_info);

  /**
    Return user requested algorithm. If user does not specify
    algorithm then return alter_algorithm variable value.
   */
  enum_alter_table_algorithm algorithm(const THD *thd) const;

  uint check_vcol_field(Item_field *f) const;

private:
  Alter_info &operator=(const Alter_info &rhs); // not implemented
  Alter_info(const Alter_info &rhs);            // not implemented
};


/** Runtime context for ALTER TABLE. */
class Alter_table_ctx
{
public:
  Alter_table_ctx();

  Alter_table_ctx(THD *thd, TABLE_LIST *table_list, uint tables_opened_arg,
                  const LEX_CSTRING *new_db_arg, const LEX_CSTRING *new_name_arg);

  /**
     @return true if the table is moved to another database, false otherwise.
  */
  bool is_database_changed() const
  { return (new_db.str != db.str); };

  /**
     @return true if the table is renamed, false otherwise.
  */
  bool is_table_renamed() const
  { return (is_database_changed() || new_name.str != table_name.str); };

  /**
     @return filename (including .frm) for the new table.
  */
  const char *get_new_filename() const
  {
    DBUG_ASSERT(!tmp_table);
    return new_filename;
  }

  /**
     @return path to the original table.
  */
  const char *get_path() const
  {
    DBUG_ASSERT(!tmp_table);
    return path;
  }

  /**
     @return path to the new table.
  */
  const char *get_new_path() const
  {
    DBUG_ASSERT(!tmp_table);
    return new_path;
  }

  /**
     @return path to the temporary table created during ALTER TABLE.
  */
  const char *get_tmp_path() const
  { return tmp_path; }

  const LEX_CSTRING get_tmp_cstring_path() const
  {
    LEX_CSTRING tmp= { tmp_path, strlen(tmp_path) };
    return tmp;
  };

  /**
    Mark ALTER TABLE as needing to produce foreign key error if
    it deletes a row from the table being changed.
  */
  void set_fk_error_if_delete_row(FOREIGN_KEY_INFO *fk)
  {
    fk_error_if_delete_row= true;
    fk_error_id= fk->foreign_id->str;
    fk_error_table= fk->foreign_table->str;
  }

  void report_implicit_default_value_error(THD *thd, const TABLE_SHARE *) const;
public:
  Create_field *implicit_default_value_error_field= nullptr;
  bool         error_if_not_empty= false;
  uint         tables_opened= 0;
  LEX_CSTRING  db;
  LEX_CSTRING  table_name;
  LEX_CSTRING  storage_engine_name;
  LEX_CSTRING  alias;
  LEX_CSTRING  new_db;
  LEX_CSTRING  new_name;
  LEX_CSTRING  new_alias;
  LEX_CSTRING  tmp_name;
  LEX_CSTRING  tmp_storage_engine_name;
  LEX_CUSTRING tmp_id, id;
  char         tmp_buff[80];
  uchar        id_buff[MY_UUID_SIZE];
  char         storage_engine_buff[NAME_LEN], tmp_storage_engine_buff[NAME_LEN];
  bool         storage_engine_partitioned;
  bool         tmp_storage_engine_name_partitioned;

  /**
    Indicates that if a row is deleted during copying of data from old version
    of table to the new version ER_FK_CANNOT_DELETE_PARENT error should be
    emitted.
  */
  bool fk_error_if_delete_row= false;
  /** Name of foreign key for the above error. */
  const char *fk_error_id= nullptr;
  /** Name of table for the above error. */
  const char *fk_error_table= nullptr;
  bool modified_primary_key= false;
  bool fast_alter_partition= false;
  /** Indicates that we are altering temporary table */
  bool tmp_table= false;

private:
  char new_filename[FN_REFLEN + 1];
  char new_alias_buff[NAME_LEN + 1];
  char tmp_name_buff[NAME_LEN + 1];
  char path[FN_REFLEN + 1];
  char new_path[FN_REFLEN + 1];
  char tmp_path[FN_REFLEN + 1];

  Alter_table_ctx &operator=(const Alter_table_ctx &rhs); // not implemented
  Alter_table_ctx(const Alter_table_ctx &rhs);            // not implemented
};


/**
  Sql_cmd_common_alter_table represents the common properties of the ALTER TABLE
  statements.
  @todo move Alter_info and other ALTER generic structures from Lex here.
*/
class Sql_cmd_common_alter_table : public Sql_cmd
{
protected:
  /**
    Constructor.
  */
  Sql_cmd_common_alter_table() = default;

  virtual ~Sql_cmd_common_alter_table() = default;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }
};

/**
  Sql_cmd_alter_table represents the generic ALTER TABLE statement.
  @todo move Alter_info and other ALTER specific structures from Lex here.
*/
class Sql_cmd_alter_table : public Sql_cmd_common_alter_table,
                            public Storage_engine_name
{
public:
  /**
    Constructor, used to represent a ALTER TABLE statement.
  */
  Sql_cmd_alter_table() = default;

  ~Sql_cmd_alter_table() = default;

  Storage_engine_name *option_storage_engine_name() override { return this; }

  bool execute(THD *thd) override;
};


/**
  Sql_cmd_alter_sequence represents the ALTER SEQUENCE statement.
*/
class Sql_cmd_alter_sequence : public Sql_cmd,
                               public DDL_options
{
public:
  /**
    Constructor, used to represent a ALTER TABLE statement.
  */
  Sql_cmd_alter_sequence(const DDL_options &options)
   :DDL_options(options)
  {}

  ~Sql_cmd_alter_sequence() = default;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_SEQUENCE;
  }
  bool execute(THD *thd) override;
};


/**
  Sql_cmd_alter_table_tablespace represents ALTER TABLE
  IMPORT/DISCARD TABLESPACE statements.
*/
class Sql_cmd_discard_import_tablespace : public Sql_cmd_common_alter_table
{
public:
  enum enum_tablespace_op_type
  {
    DISCARD_TABLESPACE, IMPORT_TABLESPACE
  };

  Sql_cmd_discard_import_tablespace(enum_tablespace_op_type tablespace_op_arg)
    : m_tablespace_op(tablespace_op_arg)
  {}

  bool execute(THD *thd) override;

private:
  const enum_tablespace_op_type m_tablespace_op;
};

#endif
server/private/strfunc.h000064400000004343150400263740011366 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef STRFUNC_INCLUDED
#define STRFUNC_INCLUDED

typedef struct st_typelib TYPELIB;

ulonglong find_set(const TYPELIB *lib,
                   const char *x, size_t length, CHARSET_INFO *cs,
		   char **err_pos, uint *err_len, bool *set_warning);
ulonglong find_set_from_flags(TYPELIB *lib, uint default_name,
                              ulonglong cur_set, ulonglong default_set,
                              const char *str, uint length, CHARSET_INFO *cs,
                              char **err_pos, uint *err_len, bool *set_warning);
uint find_type(const TYPELIB *lib, const char *find, size_t length,
               bool part_match);
uint find_type2(const TYPELIB *lib, const char *find, size_t length,
                CHARSET_INFO *cs);
void unhex_type2(TYPELIB *lib);
uint check_word(TYPELIB *lib, const char *val, const char *end,
		const char **end_of_word);
int find_string_in_array(LEX_CSTRING * const haystack,
                         LEX_CSTRING * const needle,
                         CHARSET_INFO * const cs);
const char *flagset_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
                        const char *lib[]);
const char *set_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
                          const char *lib[]);

/*
  These functions were protected by INNODB_COMPATIBILITY_HOOKS
 */
uint strconvert(CHARSET_INFO *from_cs, const char *from, size_t from_length,
                CHARSET_INFO *to_cs, char *to, size_t to_length, uint *errors);

#endif /* STRFUNC_INCLUDED */
server/private/lex.h000064400000072203150400263740010472 0ustar00#ifndef LEX_INCLUDED
#define LEX_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
   Copyright (c) 2009, 2015, MariaDB

   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 */


/* This file includes all reserved words and functions */

#include "lex_symbol.h"

SYM_GROUP sym_group_common= {"", ""};
SYM_GROUP sym_group_geom= {"Spatial extensions", "HAVE_SPATIAL"};
SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};

/* We don't want to include sql_yacc.h into gen_lex_hash */
#ifdef NO_YACC_SYMBOLS
#define SYM_OR_NULL(A) 0
#else
#define SYM_OR_NULL(A) A
#endif

#define SYM(A) SYM_OR_NULL(A),0,&sym_group_common

/*
  Symbols are broken into separated arrays to allow field names with
  same name as functions.
  These are kept sorted for human lookup (the symbols are hashed).

  NOTE! The symbol tables should be the same regardless of what features
  are compiled into the server. Don't add ifdef'ed symbols to the
  lists
  NOTE!!
  If you add or delete symbols from this file, you must also update results for
  the perfschema.start_server_low_digest_sql_length test!
*/

SYMBOL symbols[] = {
  { "&&",		SYM(AND_AND_SYM)},
  { "<=",		SYM(LE)},
  { "<>",		SYM(NE)},
  { "!=",		SYM(NE)},
  { ">=",		SYM(GE)},
  { "<<",		SYM(SHIFT_LEFT)},
  { ">>",		SYM(SHIFT_RIGHT)},
  { "<=>",		SYM(EQUAL_SYM)},
  { "ACCESSIBLE",	SYM(ACCESSIBLE_SYM)},
  { "ACCOUNT",		SYM(ACCOUNT_SYM)},
  { "ACTION",		SYM(ACTION)},
  { "ADD",		SYM(ADD)},
  { "ADMIN",            SYM(ADMIN_SYM)},
  { "AFTER",		SYM(AFTER_SYM)},
  { "AGAINST",          SYM(AGAINST)},
  { "AGGREGATE",	SYM(AGGREGATE_SYM)},
  { "ALL",		SYM(ALL)},
  { "ALGORITHM",	SYM(ALGORITHM_SYM)},
  { "ALTER",		SYM(ALTER)},
  { "ALWAYS",           SYM(ALWAYS_SYM)},
  { "ANALYZE",		SYM(ANALYZE_SYM)},
  { "AND",		SYM(AND_SYM)},
  { "ANY",              SYM(ANY_SYM)},
  { "AS",		SYM(AS)},
  { "ASC",		SYM(ASC)},
  { "ASCII",		SYM(ASCII_SYM)},
  { "ASENSITIVE",       SYM(ASENSITIVE_SYM)},
  { "AT",		SYM(AT_SYM)},
  { "ATOMIC",		SYM(ATOMIC_SYM)},
  { "AUTHORS",	        SYM(AUTHORS_SYM)},
  { "AUTO_INCREMENT",	SYM(AUTO_INC)},
  { "AUTOEXTEND_SIZE",	SYM(AUTOEXTEND_SIZE_SYM)},
  { "AVG",		SYM(AVG_SYM)},
  { "AVG_ROW_LENGTH",	SYM(AVG_ROW_LENGTH)},
  { "BACKUP",	        SYM(BACKUP_SYM)},
  { "BEFORE",	        SYM(BEFORE_SYM)},
  { "BEGIN",	        SYM(BEGIN_MARIADB_SYM)},
  { "BETWEEN",		SYM(BETWEEN_SYM)},
  { "BIGINT",		SYM(BIGINT)},
  { "BINARY",		SYM(BINARY)},
  { "BINLOG",		SYM(BINLOG_SYM)},
  { "BIT",		SYM(BIT_SYM)},
  { "BLOB",		SYM(BLOB_MARIADB_SYM)},
  { "BLOCK",  SYM(BLOCK_SYM)},
  { "BODY",             SYM(BODY_MARIADB_SYM)},
  { "BOOL",		SYM(BOOL_SYM)},
  { "BOOLEAN",		SYM(BOOLEAN_SYM)},
  { "BOTH",		SYM(BOTH)},
  { "BTREE",		SYM(BTREE_SYM)},
  { "BY",		SYM(BY)},
  { "BYTE",		SYM(BYTE_SYM)},
  { "CACHE",		SYM(CACHE_SYM)},
  { "CALL",             SYM(CALL_SYM)},
  { "CASCADE",		SYM(CASCADE)},
  { "CASCADED",         SYM(CASCADED)},
  { "CASE",		SYM(CASE_SYM)},
  { "CATALOG_NAME",     SYM(CATALOG_NAME_SYM)},
  { "CHAIN",		SYM(CHAIN_SYM)},
  { "CHANGE",		SYM(CHANGE)},
  { "CHANGED",		SYM(CHANGED)},
  { "CHAR",		SYM(CHAR_SYM)},
  { "CHARACTER",	SYM(CHAR_SYM)},
  { "CHARSET",		SYM(CHARSET)},
  { "CHECK",		SYM(CHECK_SYM)},
  { "CHECKPOINT",	SYM(CHECKPOINT_SYM)},
  { "CHECKSUM",		SYM(CHECKSUM_SYM)},
  { "CIPHER",		SYM(CIPHER_SYM)},
  { "CLASS_ORIGIN",     SYM(CLASS_ORIGIN_SYM)},
  { "CLIENT",		SYM(CLIENT_SYM)},
  { "CLOB",             SYM(CLOB_MARIADB_SYM)},
  { "CLOSE",		SYM(CLOSE_SYM)},
  { "COALESCE",		SYM(COALESCE)},
  { "CODE",             SYM(CODE_SYM)},
  { "COLLATE",		SYM(COLLATE_SYM)},
  { "COLLATION",	SYM(COLLATION_SYM)},
  { "COLUMN",		SYM(COLUMN_SYM)},
  { "COLUMN_NAME",      SYM(COLUMN_NAME_SYM)},
  { "COLUMNS",		SYM(COLUMNS)},
  { "COLUMN_ADD",       SYM(COLUMN_ADD_SYM)},
  { "COLUMN_CHECK",     SYM(COLUMN_CHECK_SYM)},
  { "COLUMN_CREATE",    SYM(COLUMN_CREATE_SYM)},
  { "COLUMN_DELETE",    SYM(COLUMN_DELETE_SYM)},
  { "COLUMN_GET",       SYM(COLUMN_GET_SYM)},
  { "COMMENT",		SYM(COMMENT_SYM)},
  { "COMMIT",		SYM(COMMIT_SYM)},
  { "COMMITTED",	SYM(COMMITTED_SYM)},
  { "COMPACT",		SYM(COMPACT_SYM)},
  { "COMPLETION",	SYM(COMPLETION_SYM)},
  { "COMPRESSED",	SYM(COMPRESSED_SYM)},
  { "CONCURRENT",	SYM(CONCURRENT)},
  { "CONDITION",        SYM(CONDITION_SYM)},
  { "CONNECTION",       SYM(CONNECTION_SYM)},
  { "CONSISTENT",	SYM(CONSISTENT_SYM)},
  { "CONSTRAINT",	SYM(CONSTRAINT)},
  { "CONSTRAINT_CATALOG", SYM(CONSTRAINT_CATALOG_SYM)},
  { "CONSTRAINT_NAME",  SYM(CONSTRAINT_NAME_SYM)},
  { "CONSTRAINT_SCHEMA", SYM(CONSTRAINT_SCHEMA_SYM)},
  { "CONTAINS",         SYM(CONTAINS_SYM)},
  { "CONTEXT",    SYM(CONTEXT_SYM)},
  { "CONTINUE",         SYM(CONTINUE_MARIADB_SYM)},
  { "CONTRIBUTORS",     SYM(CONTRIBUTORS_SYM)},
  { "CONVERT",		SYM(CONVERT_SYM)},
  { "CPU",        SYM(CPU_SYM)},
  { "CREATE",		SYM(CREATE)},
  { "CROSS",		SYM(CROSS)},
  { "CUBE",		SYM(CUBE_SYM)},
  { "CURRENT",          SYM(CURRENT_SYM)},
  { "CURRENT_DATE",	SYM(CURDATE)},
  { "CURRENT_POS",      SYM(CURRENT_POS_SYM)},
  { "CURRENT_ROLE",	SYM(CURRENT_ROLE)},
  { "CURRENT_TIME",	SYM(CURTIME)},
  { "CURRENT_TIMESTAMP", SYM(NOW_SYM)},
  { "CURRENT_USER",	SYM(CURRENT_USER)},
  { "CURSOR",           SYM(CURSOR_SYM)},
  { "CURSOR_NAME",      SYM(CURSOR_NAME_SYM)},
  { "CYCLE",            SYM(CYCLE_SYM)},
  { "DATA",		SYM(DATA_SYM)},
  { "DATABASE",		SYM(DATABASE)},
  { "DATABASES",	SYM(DATABASES)},
  { "DATAFILE", 	SYM(DATAFILE_SYM)},
  { "DATE",		SYM(DATE_SYM)},
  { "DATETIME",		SYM(DATETIME)},
  { "DAY",		SYM(DAY_SYM)},
  { "DAY_HOUR",		SYM(DAY_HOUR_SYM)},
  { "DAY_MICROSECOND",	SYM(DAY_MICROSECOND_SYM)},
  { "DAY_MINUTE",	SYM(DAY_MINUTE_SYM)},
  { "DAY_SECOND",	SYM(DAY_SECOND_SYM)},
  { "DEALLOCATE",       SYM(DEALLOCATE_SYM)},
  { "DEC",		SYM(DECIMAL_SYM)},
  { "DECIMAL",		SYM(DECIMAL_SYM)},
  { "DECLARE",          SYM(DECLARE_MARIADB_SYM)},
  { "DEFAULT",		SYM(DEFAULT)},
  { "DEFINER",          SYM(DEFINER_SYM)},
  { "DELAYED",		SYM(DELAYED_SYM)},
  { "DELAY_KEY_WRITE",	SYM(DELAY_KEY_WRITE_SYM)},
  { "DELETE",		SYM(DELETE_SYM)},
  { "DELETE_DOMAIN_ID", SYM(DELETE_DOMAIN_ID_SYM)},
  { "DESC",		SYM(DESC)},
  { "DESCRIBE",		SYM(DESCRIBE)},
  { "DES_KEY_FILE",	SYM(DES_KEY_FILE)},
  { "DETERMINISTIC",    SYM(DETERMINISTIC_SYM)},
  { "DIAGNOSTICS",      SYM(DIAGNOSTICS_SYM)},
  { "DIRECTORY",	SYM(DIRECTORY_SYM)},
  { "DISABLE",		SYM(DISABLE_SYM)},
  { "DISCARD",		SYM(DISCARD)},
  { "DISK",		SYM(DISK_SYM)},
  { "DISTINCT",		SYM(DISTINCT)},
  { "DISTINCTROW",	SYM(DISTINCT)},	/* Access likes this */
  { "DIV",		SYM(DIV_SYM)},
  { "DO",		SYM(DO_SYM)},
  { "DOUBLE",		SYM(DOUBLE_SYM)},
  { "DO_DOMAIN_IDS",    SYM(DO_DOMAIN_IDS_SYM)},
  { "DROP",		SYM(DROP)},
  { "DUAL",		SYM(DUAL_SYM)},
  { "DUMPFILE",		SYM(DUMPFILE)},
  { "DUPLICATE",	SYM(DUPLICATE_SYM)},
  { "DYNAMIC",		SYM(DYNAMIC_SYM)},
  { "EACH",             SYM(EACH_SYM)},
  { "ELSE",             SYM(ELSE)},
  { "ELSEIF",           SYM(ELSEIF_MARIADB_SYM)},
  { "ELSIF",            SYM(ELSIF_MARIADB_SYM)},
  { "EMPTY",		SYM(EMPTY_SYM)},
  { "ENABLE",		SYM(ENABLE_SYM)},
  { "ENABLE_GOVERNOR",         SYM(ENABLE_GOVERNOR_SYM)},
  { "ENABLE_GOVERNOR_RECON",   SYM(ENABLE_GOVERNOR_RECONN_SYM)},
  { "ENABLE_GOVERNOR_LVE",      SYM(ENABLE_GOVERNOR_LVE_SYM)},
  { "ENABLE_GOVERNOR_RECON_LVE",  SYM(ENABLE_GOVERNOR_RECONN_LVE_SYM)},
  { "ENCLOSED",		SYM(ENCLOSED)},
  { "END",		SYM(END)},
  { "ENDS",		SYM(ENDS_SYM)},
  { "ENGINE",		SYM(ENGINE_SYM)},
  { "ENGINES",		SYM(ENGINES_SYM)},
  { "ENUM",		SYM(ENUM)},
  { "ERROR",            SYM(ERROR_SYM)},
  { "ERRORS",		SYM(ERRORS)},
  { "ESCAPE",		SYM(ESCAPE_SYM)},
  { "ESCAPED",		SYM(ESCAPED)},
  { "EVENT",		SYM(EVENT_SYM)},
  { "EVENTS",		SYM(EVENTS_SYM)},
  { "EVERY",		SYM(EVERY_SYM)},
  { "EXAMINED",         SYM(EXAMINED_SYM)},
  { "EXCEPT",           SYM(EXCEPT_SYM)},
  { "EXCHANGE",         SYM(EXCHANGE_SYM)},
  { "EXCLUDE",          SYM(EXCLUDE_SYM)},
  { "EXECUTE",		SYM(EXECUTE_SYM)},
  { "EXCEPTION",	SYM(EXCEPTION_MARIADB_SYM)},
  { "EXISTS",		SYM(EXISTS)},
  { "EXIT",             SYM(EXIT_MARIADB_SYM)},
  { "EXPANSION",	SYM(EXPANSION_SYM)},
  { "EXPIRE",		SYM(EXPIRE_SYM)},
  { "EXPORT",           SYM(EXPORT_SYM)},
  { "EXPLAIN",		SYM(DESCRIBE)},
  { "EXTENDED",		SYM(EXTENDED_SYM)},
  { "EXTENT_SIZE",	SYM(EXTENT_SIZE_SYM)},
  { "FALSE",		SYM(FALSE_SYM)},
  { "FAST",		SYM(FAST_SYM)},
  { "FAULTS",  SYM(FAULTS_SYM)},
  { "FEDERATED", SYM(FEDERATED_SYM)},
  { "FETCH",            SYM(FETCH_SYM)},
  { "FIELDS",		SYM(COLUMNS)},
  { "FILE",		SYM(FILE_SYM)},
  { "FIRST",		SYM(FIRST_SYM)},
  { "FIXED",		SYM(FIXED_SYM)},
  { "FLOAT",		SYM(FLOAT_SYM)},
  { "FLOAT4",		SYM(FLOAT_SYM)},
  { "FLOAT8",		SYM(DOUBLE_SYM)},
  { "FLUSH",		SYM(FLUSH_SYM)},
  { "FOLLOWING",        SYM(FOLLOWING_SYM)},
  { "FOLLOWS",          SYM(FOLLOWS_SYM)},
  { "FOR",		SYM(FOR_SYM)},
  { "FORCE",		SYM(FORCE_SYM)},
  { "FOREIGN",		SYM(FOREIGN)},
  { "FORMAT",		SYM(FORMAT_SYM)},
  { "FOUND",            SYM(FOUND_SYM)},
  { "FROM",		SYM(FROM)},
  { "FULL",		SYM(FULL)},
  { "FULLTEXT",		SYM(FULLTEXT_SYM)},
  { "FUNCTION",		SYM(FUNCTION_SYM)},
  { "GENERAL",          SYM(GENERAL)},
  { "GENERATED",        SYM(GENERATED_SYM)},
  { "GET_FORMAT",       SYM(GET_FORMAT)},
  { "GET",              SYM(GET_SYM)},
  { "GLOBAL",		SYM(GLOBAL_SYM)},
  { "GOTO",             SYM(GOTO_MARIADB_SYM)},
  { "GRANT",		SYM(GRANT)},
  { "GRANTS",	        SYM(GRANTS)},
  { "GROUP",		SYM(GROUP_SYM)},
  { "HANDLER",		SYM(HANDLER_SYM)},
  { "HARD",		SYM(HARD_SYM)},
  { "HASH",		SYM(HASH_SYM)},
  { "HAVING",		SYM(HAVING)},
  { "HELP",		SYM(HELP_SYM)},
  { "HIGH_PRIORITY",	SYM(HIGH_PRIORITY)},
  { "HISTORY",      	SYM(HISTORY_SYM)},
  { "HOST",		SYM(HOST_SYM)},
  { "HOSTS",		SYM(HOSTS_SYM)},
  { "HOUR",		SYM(HOUR_SYM)},
  { "HOUR_MICROSECOND",	SYM(HOUR_MICROSECOND_SYM)},
  { "HOUR_MINUTE",	SYM(HOUR_MINUTE_SYM)},
  { "HOUR_SECOND",	SYM(HOUR_SECOND_SYM)},
  { "ID",               SYM(ID_SYM)},
  { "IDENTIFIED",	SYM(IDENTIFIED_SYM)},
  { "IF",		SYM(IF_SYM)},
  { "IGNORE",		SYM(IGNORE_SYM)},
  { "IGNORED",		SYM(IGNORED_SYM)},
  { "IGNORE_DOMAIN_IDS", SYM(IGNORE_DOMAIN_IDS_SYM)},
  { "IGNORE_SERVER_IDS", SYM(IGNORE_SERVER_IDS_SYM)},
  { "IMMEDIATE",	SYM(IMMEDIATE_SYM)},
  { "IMPORT",		SYM(IMPORT)},
  { "INTERSECT",        SYM(INTERSECT_SYM)},
  { "IN",		SYM(IN_SYM)},
  { "INCREMENT",        SYM(INCREMENT_SYM)},
  { "INDEX",		SYM(INDEX_SYM)},
  { "INDEXES",		SYM(INDEXES)},
  { "INFILE",		SYM(INFILE)},
  { "INITIAL_SIZE",	SYM(INITIAL_SIZE_SYM)},
  { "INNER",		SYM(INNER_SYM)},
  { "INOUT",            SYM(INOUT_SYM)},
  { "INSENSITIVE",      SYM(INSENSITIVE_SYM)},
  { "INSERT",		SYM(INSERT)},
  { "INSERT_METHOD",    SYM(INSERT_METHOD)},
  { "INSTALL",          SYM(INSTALL_SYM)},
  { "INT",		SYM(INT_SYM)},
  { "INT1",		SYM(TINYINT)},
  { "INT2",		SYM(SMALLINT)},
  { "INT3",		SYM(MEDIUMINT)},
  { "INT4",		SYM(INT_SYM)},
  { "INT8",		SYM(BIGINT)},
  { "INTEGER",		SYM(INT_SYM)},
  { "INTERVAL",		SYM(INTERVAL_SYM)},
  { "INVISIBLE",        SYM(INVISIBLE_SYM)},
  { "INTO",		SYM(INTO)},
  { "IO",     SYM(IO_SYM)},
  { "IO_THREAD",        SYM(RELAY_THREAD)},
  { "IPC",    SYM(IPC_SYM)},
  { "IS",		SYM(IS)},
  { "ISOLATION",	SYM(ISOLATION)},
  { "ISOPEN",           SYM(ISOPEN_SYM)},
  { "ISSUER",		SYM(ISSUER_SYM)},
  { "ITERATE",          SYM(ITERATE_SYM)},
  { "INVOKER",          SYM(INVOKER_SYM)},
  { "JOIN",		SYM(JOIN_SYM)},
  { "JSON",		SYM(JSON_SYM)},
  { "JSON_TABLE",	SYM(JSON_TABLE_SYM)},
  { "KEY",		SYM(KEY_SYM)},
  { "KEYS",		SYM(KEYS)},
  { "KEY_BLOCK_SIZE",	SYM(KEY_BLOCK_SIZE)},
  { "KILL",		SYM(KILL_SYM)},
  { "LANGUAGE",         SYM(LANGUAGE_SYM)},
  { "LAST",		SYM(LAST_SYM)},
  { "LAST_VALUE",	SYM(LAST_VALUE)},
  { "LASTVAL",		SYM(LASTVAL_SYM)},
  { "LEADING",		SYM(LEADING)},
  { "LEAVE",            SYM(LEAVE_SYM)},
  { "LEAVES",		SYM(LEAVES)},
  { "LEFT",		SYM(LEFT)},
  { "LESS",             SYM(LESS_SYM)},
  { "LEVEL",		SYM(LEVEL_SYM)},
  { "LIKE",		SYM(LIKE)},
  { "LIMIT",		SYM(LIMIT)},
  { "LINEAR",		SYM(LINEAR_SYM)},
  { "LINES",		SYM(LINES)},
  { "LIST",             SYM(LIST_SYM)},
  { "LOAD",		SYM(LOAD)},
  { "LOCAL",		SYM(LOCAL_SYM)},
  { "LOCALTIME",	SYM(NOW_SYM)},
  { "LOCALTIMESTAMP",	SYM(NOW_SYM)},
  { "LOCK",		SYM(LOCK_SYM)},
  { "LOCKED",		SYM(LOCKED_SYM)},
  { "LOCKS",		SYM(LOCKS_SYM)},
  { "LOGFILE",		SYM(LOGFILE_SYM)},
  { "LOGS",		SYM(LOGS_SYM)},
  { "LONG",		SYM(LONG_SYM)},
  { "LONGBLOB",		SYM(LONGBLOB)},
  { "LONGTEXT",		SYM(LONGTEXT)},
  { "LOOP",             SYM(LOOP_SYM)},
  { "LOW_PRIORITY",	SYM(LOW_PRIORITY)},
  { "MASTER",           SYM(MASTER_SYM)},
  { "MASTER_CONNECT_RETRY",           SYM(MASTER_CONNECT_RETRY_SYM)},
  { "MASTER_DELAY",     SYM(MASTER_DELAY_SYM)},
  { "MASTER_GTID_POS",  SYM(MASTER_GTID_POS_SYM)},
  { "MASTER_HOST",           SYM(MASTER_HOST_SYM)},
  { "MASTER_LOG_FILE",           SYM(MASTER_LOG_FILE_SYM)},
  { "MASTER_LOG_POS",           SYM(MASTER_LOG_POS_SYM)},
  { "MASTER_PASSWORD",           SYM(MASTER_PASSWORD_SYM)},
  { "MASTER_PORT",           SYM(MASTER_PORT_SYM)},
  { "MASTER_SERVER_ID",           SYM(MASTER_SERVER_ID_SYM)},
  { "MASTER_SSL",       SYM(MASTER_SSL_SYM)},
  { "MASTER_SSL_CA",    SYM(MASTER_SSL_CA_SYM)},
  { "MASTER_SSL_CAPATH",SYM(MASTER_SSL_CAPATH_SYM)},
  { "MASTER_SSL_CERT",  SYM(MASTER_SSL_CERT_SYM)},
  { "MASTER_SSL_CIPHER",SYM(MASTER_SSL_CIPHER_SYM)},
  { "MASTER_SSL_CRL",   SYM(MASTER_SSL_CRL_SYM)},
  { "MASTER_SSL_CRLPATH",SYM(MASTER_SSL_CRLPATH_SYM)},
  { "MASTER_SSL_KEY",   SYM(MASTER_SSL_KEY_SYM)},
  { "MASTER_SSL_VERIFY_SERVER_CERT", SYM(MASTER_SSL_VERIFY_SERVER_CERT_SYM)},
  { "MASTER_USER",           SYM(MASTER_USER_SYM)},
  { "MASTER_USE_GTID",  SYM(MASTER_USE_GTID_SYM)},
  { "MASTER_HEARTBEAT_PERIOD", SYM(MASTER_HEARTBEAT_PERIOD_SYM)},
  { "MATCH",		SYM(MATCH)},
  { "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)},
  { "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR)},
  { "MAX_ROWS",		SYM(MAX_ROWS)},
  { "MAX_SIZE",		SYM(MAX_SIZE_SYM)},
  { "MAX_STATEMENT_TIME",   SYM(MAX_STATEMENT_TIME_SYM)},
  { "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR)},
  { "MAX_USER_CONNECTIONS", SYM(MAX_USER_CONNECTIONS_SYM)},
  { "MAXVALUE",         SYM(MAXVALUE_SYM)},
  { "MEDIUM",		SYM(MEDIUM_SYM)},
  { "MEDIUMBLOB",	SYM(MEDIUMBLOB)},
  { "MEDIUMINT",	SYM(MEDIUMINT)},
  { "MEDIUMTEXT",	SYM(MEDIUMTEXT)},
  { "MEMORY",		SYM(MEMORY_SYM)},
  { "MERGE",		SYM(MERGE_SYM)},
  { "MESSAGE_TEXT",     SYM(MESSAGE_TEXT_SYM)},
  { "MICROSECOND",	SYM(MICROSECOND_SYM)},
  { "MIDDLEINT",	SYM(MEDIUMINT)},	/* For powerbuilder */
  { "MIGRATE",          SYM(MIGRATE_SYM)},
  { "MINUS",            SYM(MINUS_ORACLE_SYM)},
  { "MINUTE",		SYM(MINUTE_SYM)},
  { "MINUTE_MICROSECOND", SYM(MINUTE_MICROSECOND_SYM)},
  { "MINUTE_SECOND",	SYM(MINUTE_SECOND_SYM)},
  { "MINVALUE",		SYM(MINVALUE_SYM)},
  { "MIN_ROWS",		SYM(MIN_ROWS)},
  { "MOD",		SYM(MOD_SYM)},
  { "MODE",		SYM(MODE_SYM)},
  { "MODIFIES",		SYM(MODIFIES_SYM)},
  { "MODIFY",		SYM(MODIFY_SYM)},
  { "MONITOR",          SYM(MONITOR_SYM)},
  { "MONTH",		SYM(MONTH_SYM)},
  { "MUTEX",  SYM(MUTEX_SYM)},
  { "MYSQL",            SYM(MYSQL_SYM)},
  { "MYSQL_ERRNO",      SYM(MYSQL_ERRNO_SYM)},
  { "NAME",             SYM(NAME_SYM)},
  { "NAMES",		SYM(NAMES_SYM)},
  { "NATIONAL",		SYM(NATIONAL_SYM)},
  { "NATURAL",		SYM(NATURAL)},
  { "NCHAR",		SYM(NCHAR_SYM)},
  { "NESTED",		SYM(NESTED_SYM)},
  { "NEVER",		SYM(NEVER_SYM)},
  { "NEXT",		SYM(NEXT_SYM)},
  { "NEXTVAL",		SYM(NEXTVAL_SYM)},
  { "NO",		SYM(NO_SYM)},
  { "NOMAXVALUE",	SYM(NOMAXVALUE_SYM)},
  { "NOMINVALUE",	SYM(NOMINVALUE_SYM)},
  { "NOCACHE",          SYM(NOCACHE_SYM)},
  { "NOCYCLE",          SYM(NOCYCLE_SYM)},
  { "NO_WAIT",		SYM(NO_WAIT_SYM)},
  { "NOWAIT",		SYM(NOWAIT_SYM)},
  { "NODEGROUP",	SYM(NODEGROUP_SYM)},
  { "NONE",		SYM(NONE_SYM)},
  { "NOT",		SYM(NOT_SYM)},
  { "NOTFOUND",         SYM(NOTFOUND_SYM)},
  { "NO_WRITE_TO_BINLOG",  SYM(NO_WRITE_TO_BINLOG)},
  { "NULL",		SYM(NULL_SYM)},
  { "NUMBER",           SYM(NUMBER_MARIADB_SYM)},
  { "NUMERIC",		SYM(NUMERIC_SYM)},
  { "NVARCHAR",		SYM(NVARCHAR_SYM)},
  { "OF",		SYM(OF_SYM)},
  { "OFFSET",		SYM(OFFSET_SYM)},
  { "OLD_PASSWORD",	SYM(OLD_PASSWORD_SYM)},
  { "ON",		SYM(ON)},
  { "ONE",              SYM(ONE_SYM)},
  { "ONLINE",		SYM(ONLINE_SYM)},
  { "ONLY",             SYM(ONLY_SYM)},
  { "OPEN",		SYM(OPEN_SYM)},
  { "OPTIMIZE",		SYM(OPTIMIZE)},
  { "OPTIONS",		SYM(OPTIONS_SYM)},
  { "OPTION",		SYM(OPTION)},
  { "OPTIONALLY",	SYM(OPTIONALLY)},
  { "OR",		SYM(OR_SYM)},
  { "ORDER",		SYM(ORDER_SYM)},
  { "ORDINALITY",	SYM(ORDINALITY_SYM)},
  { "OTHERS",           SYM(OTHERS_MARIADB_SYM)},
  { "OUT",              SYM(OUT_SYM)},
  { "OUTER",		SYM(OUTER)},
  { "OUTFILE",		SYM(OUTFILE)},
  { "OVER",             SYM(OVER_SYM)},
  { "OVERLAPS",         SYM(OVERLAPS_SYM)},
  { "OWNER",		SYM(OWNER_SYM)},
  { "PACKAGE",          SYM(PACKAGE_MARIADB_SYM)},
  { "PACK_KEYS",	SYM(PACK_KEYS_SYM)},
  { "PAGE",	        SYM(PAGE_SYM)},
  { "PAGE_CHECKSUM",	SYM(PAGE_CHECKSUM_SYM)},
  { "PARSER",           SYM(PARSER_SYM)},
  { "PARSE_VCOL_EXPR",  SYM(PARSE_VCOL_EXPR_SYM)},
  { "PATH",		SYM(PATH_SYM)},
  { "PERIOD",		SYM(PERIOD_SYM)},
  { "PARTIAL",		SYM(PARTIAL)},
  { "PARTITION",        SYM(PARTITION_SYM)},
  { "PARTITIONING",     SYM(PARTITIONING_SYM)},
  { "PARTITIONS",       SYM(PARTITIONS_SYM)},
  { "PASSWORD",		SYM(PASSWORD_SYM)},
  { "PERSISTENT",	SYM(PERSISTENT_SYM)},
  { "PHASE",            SYM(PHASE_SYM)},
  { "PLUGIN",           SYM(PLUGIN_SYM)},
  { "PLUGINS",          SYM(PLUGINS_SYM)},
  { "PORT",		SYM(PORT_SYM)},
  { "PORTION",		SYM(PORTION_SYM)},
  { "PRECEDES",         SYM(PRECEDES_SYM)},
  { "PRECEDING",        SYM(PRECEDING_SYM)},
  { "PRECISION",	SYM(PRECISION)},
  { "PREPARE",          SYM(PREPARE_SYM)},
  { "PRESERVE",		SYM(PRESERVE_SYM)},
  { "PREV",		SYM(PREV_SYM)},
  { "PREVIOUS",		SYM(PREVIOUS_SYM)},
  { "PRIMARY",		SYM(PRIMARY_SYM)},
  { "PRIVILEGES",	SYM(PRIVILEGES)},
  { "PROCEDURE",	SYM(PROCEDURE_SYM)},
  { "PROCESS"	,	SYM(PROCESS)},
  { "PROCESSLIST",	SYM(PROCESSLIST_SYM)},
  { "PROFILE",          SYM(PROFILE_SYM)},
  { "PROFILES",         SYM(PROFILES_SYM)},
  { "PROXY",            SYM(PROXY_SYM)},
  { "PURGE",		SYM(PURGE)},
  { "QUARTER",          SYM(QUARTER_SYM)},
  { "QUERY",		SYM(QUERY_SYM)},
  { "QUICK",	        SYM(QUICK)},
  { "RAISE",            SYM(RAISE_MARIADB_SYM)},
  { "RANGE",            SYM(RANGE_SYM)},
  { "RAW",              SYM(RAW_MARIADB_SYM)},
  { "READ",		SYM(READ_SYM)},
  { "READ_ONLY",	SYM(READ_ONLY_SYM)},
  { "READ_WRITE",	SYM(READ_WRITE_SYM)},
  { "READS",		SYM(READS_SYM)},
  { "REAL",		SYM(REAL)},
  { "REBUILD",		SYM(REBUILD_SYM)},
  { "RECOVER",          SYM(RECOVER_SYM)},
  { "RECURSIVE",        SYM(RECURSIVE_SYM)},
  { "REDO_BUFFER_SIZE",	SYM(REDO_BUFFER_SIZE_SYM)},
  { "REDOFILE",         SYM(REDOFILE_SYM)},
  { "REDUNDANT",	SYM(REDUNDANT_SYM)},
  { "REFERENCES",	SYM(REFERENCES)},
  { "REGEXP",		SYM(REGEXP)},
  { "RELAY",            SYM(RELAY)},
  { "RELAYLOG",         SYM(RELAYLOG_SYM)},
  { "RELAY_LOG_FILE",   SYM(RELAY_LOG_FILE_SYM)},
  { "RELAY_LOG_POS",    SYM(RELAY_LOG_POS_SYM)},
  { "RELAY_THREAD",     SYM(RELAY_THREAD)},
  { "RELEASE",		SYM(RELEASE_SYM)},
  { "RELOAD",		SYM(RELOAD)},
  { "REMOVE",		SYM(REMOVE_SYM)},
  { "RENAME",		SYM(RENAME)},
  { "REORGANIZE",	SYM(REORGANIZE_SYM)},
  { "REPAIR",		SYM(REPAIR)},
  { "REPEATABLE",	SYM(REPEATABLE_SYM)},
  { "REPLACE",		SYM(REPLACE)},
  { "REPLAY",           SYM(REPLAY_SYM)},
  { "REPLICA",      SYM(SLAVE)},
  { "REPLICAS",     SYM(SLAVES)},
  { "REPLICA_POS",  SYM(SLAVE_POS_SYM)},
  { "REPLICATION",	SYM(REPLICATION)},
  { "REPEAT",           SYM(REPEAT_SYM)},
  { "REQUIRE",	        SYM(REQUIRE_SYM)},
  { "RESET",		SYM(RESET_SYM)},
  { "RESIGNAL",         SYM(RESIGNAL_SYM)},
  { "RESTART",		SYM(RESTART_SYM)},
  { "RESTORE",		SYM(RESTORE_SYM)},
  { "RESTRICT",		SYM(RESTRICT)},
  { "RESUME",           SYM(RESUME_SYM)},
  { "RETURNED_SQLSTATE",SYM(RETURNED_SQLSTATE_SYM)},
  { "RETURN",           SYM(RETURN_MARIADB_SYM)},
  { "RETURNING",        SYM(RETURNING_SYM)},
  { "RETURNS",		SYM(RETURNS_SYM)},
  { "REUSE",            SYM(REUSE_SYM)},
  { "REVERSE",		SYM(REVERSE_SYM)},
  { "REVOKE",		SYM(REVOKE)},
  { "RIGHT",		SYM(RIGHT)},
  { "RLIKE",		SYM(REGEXP)},	/* Like in mSQL2 */
  { "ROLE",             SYM(ROLE_SYM)},
  { "ROLLBACK",		SYM(ROLLBACK_SYM)},
  { "ROLLUP",		SYM(ROLLUP_SYM)},
  { "ROUTINE",		SYM(ROUTINE_SYM)},
  { "ROW",		SYM(ROW_SYM)},
  { "ROWCOUNT",         SYM(ROWCOUNT_SYM)}, /* Oracle-N */
  { "ROWNUM",           SYM(ROWNUM_SYM)}, /* Oracle-R */
  { "ROWS",		SYM(ROWS_SYM)},
  { "ROWTYPE",          SYM(ROWTYPE_MARIADB_SYM)},
  { "ROW_COUNT",        SYM(ROW_COUNT_SYM)},
  { "ROW_FORMAT",	SYM(ROW_FORMAT_SYM)},
  { "RTREE",		SYM(RTREE_SYM)},
  { "SAVEPOINT",	SYM(SAVEPOINT_SYM)},
  { "SCHEDULE",		SYM(SCHEDULE_SYM)},
  { "SCHEMA",		SYM(DATABASE)},
  { "SCHEMA_NAME",      SYM(SCHEMA_NAME_SYM)},
  { "SCHEMAS",          SYM(DATABASES)},
  { "SECOND",		SYM(SECOND_SYM)},
  { "SECOND_MICROSECOND", SYM(SECOND_MICROSECOND_SYM)},
  { "SECURITY",         SYM(SECURITY_SYM)},
  { "SELECT",		SYM(SELECT_SYM)},
  { "SENSITIVE",        SYM(SENSITIVE_SYM)},
  { "SEPARATOR",	SYM(SEPARATOR_SYM)},
  { "SEQUENCE",		SYM(SEQUENCE_SYM)},
  { "SERIAL",		SYM(SERIAL_SYM)},
  { "SERIALIZABLE",	SYM(SERIALIZABLE_SYM)},
  { "SESSION",		SYM(SESSION_SYM)},
  { "SERVER",           SYM(SERVER_SYM)},
  { "SET",		SYM(SET)},
  { "SETVAL",		SYM(SETVAL_SYM)},
  { "SHARE",		SYM(SHARE_SYM)},
  { "SHOW",		SYM(SHOW)},
  { "SHUTDOWN",		SYM(SHUTDOWN)},
  { "SIGNAL",           SYM(SIGNAL_SYM)},
  { "SIGNED",		SYM(SIGNED_SYM)},
  { "SIMPLE",		SYM(SIMPLE_SYM)},
  { "SKIP",             SYM(SKIP_SYM)},
  { "SLAVE",            SYM(SLAVE)},
  { "SLAVES",           SYM(SLAVES)},
  { "SLAVE_POS",        SYM(SLAVE_POS_SYM)},
  { "SLOW",             SYM(SLOW)},
  { "SNAPSHOT",         SYM(SNAPSHOT_SYM)},
  { "SMALLINT",		SYM(SMALLINT)},
  { "SOCKET",		SYM(SOCKET_SYM)},
  { "SOFT",             SYM(SOFT_SYM)},
  { "SOME",             SYM(ANY_SYM)},
  { "SONAME",		SYM(SONAME_SYM)},
  { "SOUNDS",		SYM(SOUNDS_SYM)},
  { "SOURCE",           SYM(SOURCE_SYM)},
  { "STAGE",            SYM(STAGE_SYM)},
  { "STORED",           SYM(STORED_SYM)},
  { "SPATIAL",		SYM(SPATIAL_SYM)},
  { "SPECIFIC",         SYM(SPECIFIC_SYM)},
  { "REF_SYSTEM_ID",    SYM(REF_SYSTEM_ID_SYM)},
  { "SQL",              SYM(SQL_SYM)},
  { "SQLEXCEPTION",     SYM(SQLEXCEPTION_SYM)},
  { "SQLSTATE",         SYM(SQLSTATE_SYM)},
  { "SQLWARNING",       SYM(SQLWARNING_SYM)},
  { "SQL_BIG_RESULT",	SYM(SQL_BIG_RESULT)},
  { "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT)},
  { "SQL_CACHE",        SYM(SQL_CACHE_SYM)},
  { "SQL_CALC_FOUND_ROWS", SYM(SQL_CALC_FOUND_ROWS)},
  { "SQL_NO_CACHE",	SYM(SQL_NO_CACHE_SYM)},
  { "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT)},
  { "SQL_THREAD",	SYM(SQL_THREAD)},
  { "SQL_TSI_SECOND",   SYM(SECOND_SYM)},
  { "SQL_TSI_MINUTE",   SYM(MINUTE_SYM)},
  { "SQL_TSI_HOUR",     SYM(HOUR_SYM)},
  { "SQL_TSI_DAY",      SYM(DAY_SYM)},
  { "SQL_TSI_WEEK",     SYM(WEEK_SYM)},
  { "SQL_TSI_MONTH",    SYM(MONTH_SYM)},
  { "SQL_TSI_QUARTER",  SYM(QUARTER_SYM)},
  { "SQL_TSI_YEAR",     SYM(YEAR_SYM)},
  { "SSL",		SYM(SSL_SYM)},
  { "START",		SYM(START_SYM)},
  { "STARTING",		SYM(STARTING)},
  { "STARTS",		SYM(STARTS_SYM)},
  { "STATEMENT",	SYM(STATEMENT_SYM)},
  { "STATS_AUTO_RECALC",SYM(STATS_AUTO_RECALC_SYM)},
  { "STATS_PERSISTENT",	SYM(STATS_PERSISTENT_SYM)},
  { "STATS_SAMPLE_PAGES",SYM(STATS_SAMPLE_PAGES_SYM)},
  { "STATUS",		SYM(STATUS_SYM)},
  { "STOP",		SYM(STOP_SYM)},
  { "STORAGE",		SYM(STORAGE_SYM)},
  { "STRAIGHT_JOIN",	SYM(STRAIGHT_JOIN)},
  { "STRING",		SYM(STRING_SYM)},
  { "SUBCLASS_ORIGIN",  SYM(SUBCLASS_ORIGIN_SYM)},
  { "SUBJECT",		SYM(SUBJECT_SYM)},
  { "SUBPARTITION",     SYM(SUBPARTITION_SYM)},
  { "SUBPARTITIONS",    SYM(SUBPARTITIONS_SYM)},
  { "SUPER",		SYM(SUPER_SYM)},
  { "SUSPEND",          SYM(SUSPEND_SYM)},
  { "SWAPS",      SYM(SWAPS_SYM)},
  { "SWITCHES",   SYM(SWITCHES_SYM)},
  { "SYSDATE",		SYM(SYSDATE)},
  { "SYSTEM",     SYM(SYSTEM)},
  { "SYSTEM_TIME",      SYM(SYSTEM_TIME_SYM)},
  { "TABLE",		SYM(TABLE_SYM)},
  { "TABLE_NAME",       SYM(TABLE_NAME_SYM)},
  { "TABLES",		SYM(TABLES)},
  { "TABLESPACE",	        SYM(TABLESPACE)},
  { "TABLE_CHECKSUM",	SYM(TABLE_CHECKSUM_SYM)},
  { "TEMPORARY",	SYM(TEMPORARY)},
  { "TEMPTABLE",	SYM(TEMPTABLE_SYM)},
  { "TERMINATED",	SYM(TERMINATED)},
  { "TEXT",		SYM(TEXT_SYM)},
  { "THAN",             SYM(THAN_SYM)},
  { "THEN",		SYM(THEN_SYM)},
  { "TIES",             SYM(TIES_SYM)},
  { "TIME",		SYM(TIME_SYM)},
  { "TIMESTAMP",	SYM(TIMESTAMP)},
  { "TIMESTAMPADD",     SYM(TIMESTAMP_ADD)},
  { "TIMESTAMPDIFF",    SYM(TIMESTAMP_DIFF)},
  { "TINYBLOB",		SYM(TINYBLOB)},
  { "TINYINT",		SYM(TINYINT)},
  { "TINYTEXT",		SYM(TINYTEXT)},
  { "TO",		SYM(TO_SYM)},
  { "TRAILING",		SYM(TRAILING)},
  { "TRANSACTION",	SYM(TRANSACTION_SYM)},
  { "TRANSACTIONAL",	SYM(TRANSACTIONAL_SYM)},
  { "THREADS",          SYM(THREADS_SYM)},
  { "TRIGGER",          SYM(TRIGGER_SYM)},
  { "TRIGGERS",         SYM(TRIGGERS_SYM)},
  { "TRUE",		SYM(TRUE_SYM)},
  { "TRUNCATE",		SYM(TRUNCATE_SYM)},
  { "TYPE",		SYM(TYPE_SYM)},
  { "UNBOUNDED",        SYM(UNBOUNDED_SYM)},
  { "UNCOMMITTED",	SYM(UNCOMMITTED_SYM)},
  { "UNDEFINED",	SYM(UNDEFINED_SYM)},
  { "UNDO_BUFFER_SIZE",	SYM(UNDO_BUFFER_SIZE_SYM)},
  { "UNDOFILE", 	SYM(UNDOFILE_SYM)},
  { "UNDO",             SYM(UNDO_SYM)},
  { "UNICODE",	        SYM(UNICODE_SYM)},
  { "UNION",	        SYM(UNION_SYM)},
  { "UNIQUE",		SYM(UNIQUE_SYM)},
  { "UNKNOWN",		SYM(UNKNOWN_SYM)},
  { "UNLOCK",		SYM(UNLOCK_SYM)},
  { "UNINSTALL",        SYM(UNINSTALL_SYM)},
  { "UNSIGNED",		SYM(UNSIGNED)},
  { "UNTIL",		SYM(UNTIL_SYM)},
  { "UPDATE",		SYM(UPDATE_SYM)},
  { "UPGRADE",          SYM(UPGRADE_SYM)},
  { "USAGE",		SYM(USAGE)},
  { "USE",		SYM(USE_SYM)},
  { "USER",		SYM(USER_SYM)},
  { "USER_RESOURCES",	SYM(RESOURCES)},
  { "USE_FRM",		SYM(USE_FRM)},
  { "USING",		SYM(USING)},
  { "UTC_DATE",         SYM(UTC_DATE_SYM)},
  { "UTC_TIME",         SYM(UTC_TIME_SYM)},
  { "UTC_TIMESTAMP",    SYM(UTC_TIMESTAMP_SYM)},
  { "VALUE",		SYM(VALUE_SYM)},
  { "VALUES",		SYM(VALUES)},
  { "VARBINARY",	SYM(VARBINARY)},
  { "VARCHAR",		SYM(VARCHAR)},
  { "VARCHARACTER",	SYM(VARCHAR)},
  { "VARCHAR2",         SYM(VARCHAR2_MARIADB_SYM)},
  { "VARIABLES",	SYM(VARIABLES)},
  { "VARYING",		SYM(VARYING)},
  { "VIA",              SYM(VIA_SYM)},
  { "VIEW",		SYM(VIEW_SYM)},
  { "VIRTUAL",          SYM(VIRTUAL_SYM)},
  { "VISIBLE",          SYM(VISIBLE_SYM)},
  { "VERSIONING",       SYM(VERSIONING_SYM)},
  { "WAIT",		SYM(WAIT_SYM)},
  { "WARNINGS",		SYM(WARNINGS)},
  { "WEEK",		SYM(WEEK_SYM)},
  { "WEIGHT_STRING",	SYM(WEIGHT_STRING_SYM)},
  { "WHEN",		SYM(WHEN_SYM)},
  { "WHERE",		SYM(WHERE)},
  { "WHILE",            SYM(WHILE_SYM)},
  { "WINDOW",           SYM(WINDOW_SYM)},
  { "WITH",		SYM(WITH)},
  { "WITHIN",   SYM(WITHIN)},
  { "WITHOUT",          SYM(WITHOUT)},
  { "WORK",		SYM(WORK_SYM)},
  { "WRAPPER",		SYM(WRAPPER_SYM)},
  { "WRITE",		SYM(WRITE_SYM)},
  { "X509",		SYM(X509_SYM)},
  { "XOR",		SYM(XOR)},
  { "XA",               SYM(XA_SYM)},
  { "XML",              SYM(XML_SYM)}, /* LOAD XML Arnold/Erik */
  { "YEAR",		SYM(YEAR_SYM)},
  { "YEAR_MONTH",	SYM(YEAR_MONTH_SYM)},
  { "ZEROFILL",		SYM(ZEROFILL)},
  { "||",		SYM(OR2_SYM)}
};


SYMBOL sql_functions[] = {
  { "ADDDATE",		SYM(ADDDATE_SYM)},
  { "BIT_AND",		SYM(BIT_AND)},
  { "BIT_OR",		SYM(BIT_OR)},
  { "BIT_XOR",		SYM(BIT_XOR)},
  { "CAST",		SYM(CAST_SYM)},
  { "COUNT",		SYM(COUNT_SYM)},
  { "CUME_DIST",        SYM(CUME_DIST_SYM)},
  { "CURDATE",		SYM(CURDATE)},
  { "CURTIME",		SYM(CURTIME)},
  { "DATE_ADD",		SYM(DATE_ADD_INTERVAL)},
  { "DATE_SUB",		SYM(DATE_SUB_INTERVAL)},
  { "DENSE_RANK",       SYM(DENSE_RANK_SYM)},
  { "EXTRACT",		SYM(EXTRACT_SYM)},
  { "FIRST_VALUE",      SYM(FIRST_VALUE_SYM)},
  { "GROUP_CONCAT",	SYM(GROUP_CONCAT_SYM)},
  { "JSON_ARRAYAGG",	SYM(JSON_ARRAYAGG_SYM)},
  { "JSON_OBJECTAGG",	SYM(JSON_OBJECTAGG_SYM)},
  { "LAG",              SYM(LAG_SYM)},
  { "LEAD",             SYM(LEAD_SYM)},
  { "MAX",		SYM(MAX_SYM)},
  { "MEDIAN", SYM(MEDIAN_SYM)},
  { "MID",		SYM(SUBSTRING)},	/* unireg function */
  { "MIN",		SYM(MIN_SYM)},
  { "NOW",		SYM(NOW_SYM)},
  { "NTH_VALUE",        SYM(NTH_VALUE_SYM)},
  { "NTILE",            SYM(NTILE_SYM)},
  { "POSITION",		SYM(POSITION_SYM)},
  { "PERCENT_RANK",     SYM(PERCENT_RANK_SYM)},
  { "PERCENTILE_CONT",  SYM(PERCENTILE_CONT_SYM)},
  { "PERCENTILE_DISC",  SYM(PERCENTILE_DISC_SYM)},
  { "RANK",             SYM(RANK_SYM)},
  { "ROW_NUMBER",       SYM(ROW_NUMBER_SYM)},
  { "SESSION_USER",     SYM(USER_SYM)},
  { "STD",		SYM(STD_SYM)},
  { "STDDEV",		SYM(STD_SYM)},
  { "STDDEV_POP",	SYM(STD_SYM)},
  { "STDDEV_SAMP",	SYM(STDDEV_SAMP_SYM)},
  { "SUBDATE",		SYM(SUBDATE_SYM)},
  { "SUBSTR",		SYM(SUBSTRING)},
  { "SUBSTRING",	SYM(SUBSTRING)},
  { "SUM",		SYM(SUM_SYM)},
  { "SYSTEM_USER",      SYM(USER_SYM)},
  { "TRIM",		SYM(TRIM)},
  { "TRIM_ORACLE",	SYM(TRIM_ORACLE)},
  { "VARIANCE",		SYM(VARIANCE_SYM)},
  { "VAR_POP",		SYM(VARIANCE_SYM)},
  { "VAR_SAMP",		SYM(VAR_SAMP_SYM)},
};

size_t symbols_length= sizeof(symbols) / sizeof(SYMBOL);
size_t sql_functions_length= sizeof(sql_functions) / sizeof(SYMBOL);

#endif /* LEX_INCLUDED */
server/private/sql_type_geom.h000064400000045216150400263740012555 0ustar00#ifndef SQL_TYPE_GEOM_H_INCLUDED
#define SQL_TYPE_GEOM_H_INCLUDED
/*
   Copyright (c) 2015 MariaDB Foundation
   Copyright (c) 2019, 2022, 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 Street, Fifth Floor, Boston, MA 02111-1301 USA */

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation				// gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_type.h"

#ifdef HAVE_SPATIAL
class Type_handler_geometry: public Type_handler_string_result
{
public:
  enum geometry_types
  {
    GEOM_GEOMETRY = 0, GEOM_POINT = 1, GEOM_LINESTRING = 2, GEOM_POLYGON = 3,
    GEOM_MULTIPOINT = 4, GEOM_MULTILINESTRING = 5, GEOM_MULTIPOLYGON = 6,
    GEOM_GEOMETRYCOLLECTION = 7
  };
  static bool check_type_geom_or_binary(const LEX_CSTRING &opname,
                                        const Item *item);
  static bool check_types_geom_or_binary(const LEX_CSTRING &opname,
                                         Item * const *args,
                                         uint start, uint end);
  static const Type_handler_geometry *type_handler_geom_by_type(uint type);
  LEX_CSTRING extended_metadata_data_type_name() const;
public:
  virtual ~Type_handler_geometry() {}
  enum_field_types field_type() const override { return MYSQL_TYPE_GEOMETRY; }
  bool Item_append_extended_type_info(Send_field_extended_metadata *to,
                                      const Item *item) const override
  {
    LEX_CSTRING tmp= extended_metadata_data_type_name();
    return tmp.length ? to->set_data_type_name(tmp) : false;
  }
  bool is_param_long_data_type() const override { return true; }
  uint32 max_display_length_for_field(const Conv_source &src) const override;
  uint32 calc_pack_length(uint32 length) const override;
  const Type_collection *type_collection() const override;
  const Type_handler *type_handler_for_comparison() const override;
  virtual geometry_types geometry_type() const { return GEOM_GEOMETRY; }
  virtual Item *create_typecast_item(THD *thd, Item *item,
                                     const Type_cast_attributes &attr)
                                     const override;
  const Type_handler *type_handler_frm_unpack(const uchar *buffer)
                                              const override;
  bool is_binary_compatible_geom_super_type_for(const Type_handler_geometry *th)
                                                const
  {
    return geometry_type() == GEOM_GEOMETRY ||
           geometry_type() == th->geometry_type();
  }
  bool type_can_have_key_part() const override { return true; }
  bool subquery_type_allows_materialization(const Item *, const Item *, bool)
    const override
  {
    return false; // Materialization does not work with GEOMETRY columns
  }
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override;
  bool Item_param_set_from_value(THD *thd,
                                 Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *value) const override;
  Field *make_conversion_table_field(MEM_ROOT *root,
                                     TABLE *table, uint metadata,
                                     const Field *target) const override;
  Log_event_data_type user_var_log_event_data_type(uint charset_nr)
                                                              const override
  {
    return Log_event_data_type(name().lex_cstring(), result_type(),
                               charset_nr, false/*unsigned*/);
  }

  uint Column_definition_gis_options_image(uchar *buff,
                                           const Column_definition &def)
                                           const override;
  bool Column_definition_data_type_info_image(Binary_string *to,
                                              const Column_definition &def)
                                              const override
  {
    return false;
  }
  void
  Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
                                        uchar *buff) const override;
  bool
  Column_definition_attributes_frm_unpack(Column_definition_attributes *attr,
                                          TABLE_SHARE *share,
                                          const uchar *buffer,
                                          LEX_CUSTRING *gis_options) const
    override;
  bool Column_definition_fix_attributes(Column_definition *c) const override;
  void Column_definition_reuse_fix_attributes(THD *thd,
                                              Column_definition *c,
                                              const Field *field) const
    override;
  bool Column_definition_prepare_stage1(THD *thd,
                                        MEM_ROOT *mem_root,
                                        Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags,
                                        const Column_derived_attributes
                                              *derived_attr)
                                        const override;
  bool Column_definition_prepare_stage2(Column_definition *c,
                                        handler *file,
                                        ulonglong table_flags) const override;
  bool Key_part_spec_init_primary(Key_part_spec *part,
                                  const Column_definition &def,
                                  const handler *file) const override;
  bool Key_part_spec_init_unique(Key_part_spec *part,
                                 const Column_definition &def,
                                 const handler *file,
                                 bool *has_key_needed) const override;
  bool Key_part_spec_init_multiple(Key_part_spec *part,
                                   const Column_definition &def,
                                   const handler *file) const override;
  bool Key_part_spec_init_foreign(Key_part_spec *part,
                                  const Column_definition &def,
                                  const handler *file) const override;
  bool Key_part_spec_init_spatial(Key_part_spec *part,
                                  const Column_definition &def) const override;
  Field *make_table_field(MEM_ROOT *root,
                          const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *share) const override;

  Field *make_table_field_from_def(TABLE_SHARE *share,
                                   MEM_ROOT *mem_root,
                                   const LEX_CSTRING *name,
                                   const Record_addr &addr,
                                   const Bit_addr &bit,
                                   const Column_definition_attributes *attr,
                                   uint32 flags) const override;

  bool can_return_int() const override { return false; }
  bool can_return_decimal() const override { return false; }
  bool can_return_real() const override { return false; }
  bool can_return_text() const override { return false; }
  bool can_return_date() const override { return false; }
  bool can_return_time() const override { return false; }
  bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const override;
  bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
  bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
  bool Item_hybrid_func_fix_attributes(THD *thd,
                                       const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *h,
                                       Type_all_attributes *attr,
                                       Item **items, uint nitems) const
    override;
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override;
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override;
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override;

  bool Item_func_signed_fix_length_and_dec(Item_func_signed *) const override;
  bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *) const
    override;
  bool Item_double_typecast_fix_length_and_dec(Item_double_typecast *) const
    override;
  bool Item_float_typecast_fix_length_and_dec(Item_float_typecast *) const
    override;
  bool Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *) const
    override;
  bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const
    override;
  bool Item_time_typecast_fix_length_and_dec(Item_time_typecast *) const
    override;
  bool Item_date_typecast_fix_length_and_dec(Item_date_typecast *) const
    override;
  bool Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *) const
    override;
};


class Type_handler_point: public Type_handler_geometry
{
  // Binary length of a POINT value: 4 byte SRID + 21 byte WKB POINT
  static uint octet_length() { return 25; }
public:
  geometry_types geometry_type() const override { return GEOM_POINT; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
  bool Key_part_spec_init_primary(Key_part_spec *part,
                                  const Column_definition &def,
                                  const handler *file) const override;
  bool Key_part_spec_init_unique(Key_part_spec *part,
                                 const Column_definition &def,
                                 const handler *file,
                                 bool *has_key_needed) const override;
  bool Key_part_spec_init_multiple(Key_part_spec *part,
                                   const Column_definition &def,
                                   const handler *file) const override;
  bool Key_part_spec_init_foreign(Key_part_spec *part,
                                  const Column_definition &def,
                                  const handler *file) const override;
};


class Type_handler_linestring: public Type_handler_geometry
{
public:
  geometry_types geometry_type() const override { return GEOM_LINESTRING; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
};


class Type_handler_polygon: public Type_handler_geometry
{
public:
  geometry_types geometry_type() const override { return GEOM_POLYGON; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
};


class Type_handler_multipoint: public Type_handler_geometry
{
public:
  geometry_types geometry_type() const override { return GEOM_MULTIPOINT; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
};


class Type_handler_multilinestring: public Type_handler_geometry
{
public:
  geometry_types geometry_type() const override { return GEOM_MULTILINESTRING; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
};


class Type_handler_multipolygon: public Type_handler_geometry
{
public:
  geometry_types geometry_type() const override { return GEOM_MULTIPOLYGON; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
};


class Type_handler_geometrycollection: public Type_handler_geometry
{
public:
  geometry_types geometry_type() const override { return GEOM_GEOMETRYCOLLECTION; }
  Item *make_constructor_item(THD *thd, List<Item> *args) const override;
};

extern Named_type_handler<Type_handler_geometry> type_handler_geometry;
extern Named_type_handler<Type_handler_point> type_handler_point;
extern Named_type_handler<Type_handler_linestring> type_handler_linestring;
extern Named_type_handler<Type_handler_polygon> type_handler_polygon;
extern Named_type_handler<Type_handler_multipoint> type_handler_multipoint;
extern Named_type_handler<Type_handler_multilinestring> type_handler_multilinestring;
extern Named_type_handler<Type_handler_multipolygon> type_handler_multipolygon;
extern Named_type_handler<Type_handler_geometrycollection> type_handler_geometrycollection;

class Type_collection_geometry: public Type_collection
{
  const Type_handler *aggregate_common(const Type_handler *a,
                                       const Type_handler *b) const
  {
    if (a == b)
      return a;
    if (dynamic_cast<const Type_handler_geometry*>(a) &&
        dynamic_cast<const Type_handler_geometry*>(b))
      return &type_handler_geometry;
    return NULL;
  }
  const Type_handler *aggregate_if_null(const Type_handler *a,
                                        const Type_handler *b) const
  {
    return a == &type_handler_null ? b :
           b == &type_handler_null ? a :
           NULL;
  }
  const Type_handler *aggregate_if_long_blob(const Type_handler *a,
                                             const Type_handler *b) const
  {
    return a == &type_handler_long_blob ? &type_handler_long_blob :
           b == &type_handler_long_blob ? &type_handler_long_blob :
           NULL;
  }
  const Type_handler *aggregate_if_string(const Type_handler *a,
                                          const Type_handler *b) const;
#ifndef DBUG_OFF
  bool init_aggregators(Type_handler_data *data, const Type_handler *geom) const;
#endif
public:
  bool init(Type_handler_data *data) override;
  const Type_handler *aggregate_for_result(const Type_handler *a,
                                           const Type_handler *b)
                                           const override;
  const Type_handler *aggregate_for_comparison(const Type_handler *a,
                                               const Type_handler *b)
                                               const override;
  const Type_handler *aggregate_for_min_max(const Type_handler *a,
                                            const Type_handler *b)
                                            const override;
  const Type_handler *aggregate_for_num_op(const Type_handler *a,
                                           const Type_handler *b)
                                           const override
  {
    return NULL;
  }
};

extern Type_collection_geometry type_collection_geometry;
const Type_handler *
Type_collection_geometry_handler_by_name(const LEX_CSTRING &name);

#include "field.h"

class Field_geom :public Field_blob
{
  const Type_handler_geometry *m_type_handler;
public:
  uint srid;
  uint precision;
  enum storage_type { GEOM_STORAGE_WKB= 0, GEOM_STORAGE_BINARY= 1};
  enum storage_type storage;

  Field_geom(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
	     enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
	     TABLE_SHARE *share, uint blob_pack_length,
	     const Type_handler_geometry *gth,
	     uint field_srid)
     :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
                 field_name_arg, share, blob_pack_length, &my_charset_bin),
      m_type_handler(gth)
  { srid= field_srid; }
  enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                    const Relay_log_info *rli,
                                    const Conv_param &param) const override;
  enum ha_base_keytype key_type() const  override
  {
    return HA_KEYTYPE_VARBINARY2;
  }
  const Type_handler *type_handler() const override
  {
    return m_type_handler;
  }
  const Type_handler_geometry *type_handler_geom() const
  {
    return m_type_handler;
  }
  void set_type_handler(const Type_handler_geometry *th)
  {
    m_type_handler= th;
  }
  enum_field_types type() const override
  {
    return MYSQL_TYPE_GEOMETRY;
  }
  enum_field_types real_type() const override
  {
    return MYSQL_TYPE_GEOMETRY;
  }
  Information_schema_character_attributes
    information_schema_character_attributes() const override
  {
    return Information_schema_character_attributes();
  }
  void make_send_field(Send_field *to) override
  {
    Field_longstr::make_send_field(to);
    LEX_CSTRING tmp= m_type_handler->extended_metadata_data_type_name();
    if (tmp.length)
      to->set_data_type_name(tmp);
  }
  Data_type_compatibility can_optimize_range(const Item_bool_func *cond,
                                             const Item *item,
                                             bool is_eq_func) const override;
  void sql_type(String &str) const override;
  Copy_func *get_copy_func(const Field *from) const override
  {
    const Type_handler_geometry *fth=
      dynamic_cast<const Type_handler_geometry*>(from->type_handler());
    if (fth && m_type_handler->is_binary_compatible_geom_super_type_for(fth))
      return get_identical_copy_func();
    return do_conv_blob;
  }
  bool memcpy_field_possible(const Field *from) const override
  {
    const Type_handler_geometry *fth=
      dynamic_cast<const Type_handler_geometry*>(from->type_handler());
    return fth &&
           m_type_handler->is_binary_compatible_geom_super_type_for(fth) &&
           !table->copy_blobs;
  }
  bool is_equal(const Column_definition &new_field) const override;
  int  store(const char *to, size_t length, CHARSET_INFO *charset) override;
  int  store(double nr) override;
  int  store(longlong nr, bool unsigned_val) override;
  int  store_decimal(const my_decimal *) override;
  uint size_of() const  override{ return sizeof(*this); }
  /**
   Key length is provided only to support hash joins. (compared byte for byte)
   Ex: SELECT .. FROM t1,t2 WHERE t1.field_geom1=t2.field_geom2.

   The comparison is not very relevant, as identical geometry might be
   represented differently, but we need to support it either way.
  */
  uint32 key_length() const  override{ return packlength; }
  uint get_key_image(uchar *buff,uint length,
                     const uchar *ptr_arg, imagetype type_arg) const override;

  /**
    Non-nullable GEOMETRY types cannot have defaults,
    but the underlying blob must still be reset.
   */
  int reset(void)  override{ return Field_blob::reset() || !maybe_null(); }
  bool load_data_set_null(THD *thd) override;
  bool load_data_set_no_data(THD *thd, bool fixed_format) override;

  uint get_srid() const { return srid; }
  void print_key_value(String *out, uint32 length) override
  {
    out->append(STRING_WITH_LEN("unprintable_geometry_value"));
  }
  Binlog_type_info binlog_type_info() const override;
};

#endif // HAVE_SPATIAL

#endif // SQL_TYPE_GEOM_H_INCLUDED
server/private/mysys_err.h000064400000005716150400263740011743 0ustar00/*
   Copyright (c) 2000, 2010, Oracle and/or its affiliates.

   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 */

#ifndef _mysys_err_h
#define _mysys_err_h

#ifdef	__cplusplus
extern "C" {
#endif

#define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */
#define EE(X)    (globerrs[(X) - EE_ERROR_FIRST])

extern const char *globerrs[];  /* my_error_messages is here */

/* Error message numbers in global map */
/*
  Do not add error numbers before EE_ERROR_FIRST.
  If necessary to add lower numbers, change EE_ERROR_FIRST accordingly.

  We start with error 1 to not confuse peoples with 'error 0'
*/

#define EE_ERROR_FIRST          1 /*Copy first error nr.*/
#define EE_CANTCREATEFILE	1
#define EE_READ			2
#define EE_WRITE		3
#define EE_BADCLOSE		4
#define EE_OUTOFMEMORY		5
#define EE_DELETE		6
#define EE_LINK			7
#define EE_EOFERR		9
#define EE_CANTLOCK		10
#define EE_CANTUNLOCK		11
#define EE_DIR			12
#define EE_STAT			13
#define EE_CANT_CHSIZE		14
#define EE_CANT_OPEN_STREAM	15
#define EE_GETWD		16
#define EE_SETWD		17
#define EE_LINK_WARNING		18
#define EE_OPEN_WARNING		19
#define EE_DISK_FULL		20
#define EE_CANT_MKDIR		21
#define EE_UNKNOWN_CHARSET	22
#define EE_OUT_OF_FILERESOURCES	23
#define EE_CANT_READLINK	24
#define EE_CANT_SYMLINK		25
#define EE_REALPATH		26
#define EE_SYNC			27
#define EE_UNKNOWN_COLLATION	28
#define EE_FILENOTFOUND		29
#define EE_FILE_NOT_CLOSED	30
#define EE_CHANGE_OWNERSHIP     31
#define EE_CHANGE_PERMISSIONS   32
#define EE_CANT_SEEK            33
#define EE_CANT_CHMOD           34
#define EE_CANT_COPY_OWNERSHIP  35
#define EE_BADMEMORYRELEASE     36
#define EE_PERM_LOCK_MEMORY     37
#define EE_MEMCNTL              38
#define EE_DUPLICATE_CHARSET    39
#define EE_ERROR_LAST           39 /* Copy last error nr */

/* Add error numbers before EE_ERROR_LAST and change it accordingly. */

  /* exit codes for all MySQL programs */

#define EXIT_UNSPECIFIED_ERROR		1
#define EXIT_UNKNOWN_OPTION		2
#define EXIT_AMBIGUOUS_OPTION		3
#define EXIT_NO_ARGUMENT_ALLOWED	4
#define EXIT_ARGUMENT_REQUIRED		5
#define EXIT_VAR_PREFIX_NOT_UNIQUE	6
#define EXIT_UNKNOWN_VARIABLE		7
#define EXIT_OUT_OF_MEMORY		8
#define EXIT_UNKNOWN_SUFFIX		9
#define EXIT_NO_PTR_TO_VARIABLE		10
#define EXIT_CANNOT_CONNECT_TO_SERVICE	11
#define EXIT_OPTION_DISABLED            12
#define EXIT_ARGUMENT_INVALID           13

#ifdef	__cplusplus
}
#endif
#endif
server/private/queues.h000064400000006625150400263740011216 0ustar00/* Copyright (C) 2010 Monty Program Ab
   All Rights reserved

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  SUCH DAMAGE.
*/

/*
  Code for general handling of priority Queues.
  Implementation of queues from "Algorithms in C" by Robert Sedgewick.
*/

#ifndef _queues_h
#define _queues_h

#include <my_cmp.h>

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct st_queue {
  uchar **root;
  void *first_cmp_arg;
  uint elements;
  uint max_elements;
  uint offset_to_key;          /* compare is done on element+offset */
  uint offset_to_queue_pos;    /* If we want to store position in element */
  uint auto_extent;
  int max_at_top;	/* Normally 1, set to -1 if queue_top gives max */
  qsort_cmp2 compare;
} QUEUE;

#define queue_first_element(queue) 1
#define queue_last_element(queue) (queue)->elements
#define queue_empty(queue) ((queue)->elements == 0)
#define queue_top(queue) ((queue)->root[1])
#define queue_element(queue,index) ((queue)->root[index])
#define queue_end(queue) ((queue)->root[(queue)->elements])
#define queue_replace_top(queue) _downheap(queue, 1)
#define queue_set_cmp_arg(queue, set_arg) (queue)->first_cmp_arg= set_arg
#define queue_set_max_at_top(queue, set_arg) \
  (queue)->max_at_top= set_arg ? -1 : 1
#define queue_remove_top(queue_arg) queue_remove((queue_arg), queue_first_element(queue_arg))

int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
	       my_bool max_at_top, qsort_cmp2 compare,
	       void *first_cmp_arg, uint offset_to_queue_pos,
               uint auto_extent);
int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
                 my_bool max_at_top, qsort_cmp2 compare,
                 void *first_cmp_arg, uint offset_to_queue_pos,
                 uint auto_extent);
int resize_queue(QUEUE *queue, uint max_elements);
void delete_queue(QUEUE *queue);
void queue_insert(QUEUE *queue, uchar *element);
int queue_insert_safe(QUEUE *queue, uchar *element);
uchar *queue_remove(QUEUE *queue,uint idx);
void queue_replace(QUEUE *queue,uint idx);

#define queue_remove_all(queue) { (queue)->elements= 0; }
#define queue_is_full(queue) (queue->elements == queue->max_elements)
void _downheap(QUEUE *queue, uint idx);
void queue_fix(QUEUE *queue);
#define is_queue_inited(queue) ((queue)->root != 0)

#ifdef	__cplusplus
}
#endif
#endif
server/private/tztime.h000064400000006505150400263740011220 0ustar00#ifndef TZTIME_INCLUDED
#define TZTIME_INCLUDED

/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */


#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class interface */
#endif

#include "my_time.h"                            /* my_time_t */
#include "mysql_time.h"                         /* MYSQL_TIME */
#include "sql_list.h"                           /* Sql_alloc */
#include "sql_string.h"                         /* String */

class THD;

#if !defined(TESTTIME) && !defined(TZINFO2SQL)

class THD;

/**
  This class represents abstract time zone and provides 
  basic interface for MYSQL_TIME <-> my_time_t conversion.
  Actual time zones which are specified by DB, or via offset 
  or use system functions are its descendants.
*/
class Time_zone: public Sql_alloc 
{
public:
  Time_zone() = default;                              /* Remove gcc warning */
  /**
    Converts local time in broken down MYSQL_TIME representation to 
    my_time_t (UTC seconds since Epoch) represenation.
    Returns 0 in case of error. May set error_code to ER_WARN_DATA_OUT_OF_RANGE
    or ER_WARN_INVALID_TIMESTAMP, see TIME_to_timestamp())
  */
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, 
                                    uint *error_code) const = 0;
  /**
    Converts time in my_time_t representation to local time in
    broken down MYSQL_TIME representation.
  */
  virtual void   gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const = 0;
  /**
    Because of constness of String returned by get_name() time zone name 
    have to be already zeroended to be able to use String::ptr() instead
    of c_ptr().
  */
  virtual const String * get_name() const = 0;

  /** 
    We need this only for surpressing warnings, objects of this type are
    allocated on MEM_ROOT and should not require destruction.
  */
  virtual ~Time_zone() = default;

protected:
  static inline void adjust_leap_second(MYSQL_TIME *t);
};

extern Time_zone * my_tz_UTC;
extern MYSQL_PLUGIN_IMPORT Time_zone * my_tz_SYSTEM;
extern Time_zone * my_tz_OFFSET0;
extern Time_zone * my_tz_find(THD *thd, const String *name);
extern my_bool     my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap);
extern void        my_tz_free();
extern my_time_t   sec_since_epoch_TIME(MYSQL_TIME *t);

/**
  Number of elements in table list produced by my_tz_get_table_list()
  (this table list contains tables which are needed for dynamical loading
  of time zone descriptions). Actually it is imlementation detail that
  should not be used anywhere outside of tztime.h and tztime.cc.
*/

static const int MY_TZ_TABLES_COUNT= 4;

#endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */
#endif /* TZTIME_INCLUDED */
server/private/sp_rcontext.h000064400000033776150400263740012266 0ustar00/* -*- C++ -*- */
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _SP_RCONTEXT_H_
#define _SP_RCONTEXT_H_

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_class.h"                    // select_result_interceptor
#include "sp_pcontext.h"                  // sp_condition_value

///////////////////////////////////////////////////////////////////////////
// sp_rcontext declaration.
///////////////////////////////////////////////////////////////////////////

class sp_cursor;
class sp_lex_keeper;
class sp_instr_cpush;
class sp_instr_hpush_jump;
class Query_arena;
class sp_head;
class Item_cache;
class Virtual_tmp_table;


/*
  This class is a runtime context of a Stored Routine. It is used in an
  execution and is intended to contain all dynamic objects (i.e.  objects, which
  can be changed during execution), such as:
    - stored routine variables;
    - cursors;
    - handlers;

  Runtime context is used with sp_head class. sp_head class is intended to
  contain all static things, related to the stored routines (code, for example).
  sp_head instance creates runtime context for the execution of a stored
  routine.

  There is a parsing context (an instance of sp_pcontext class), which is used
  on parsing stage. However, now it contains some necessary for an execution
  things, such as definition of used stored routine variables. That's why
  runtime context needs a reference to the parsing context.
*/

class sp_rcontext : public Sql_alloc
{
public:
  /// Construct and properly initialize a new sp_rcontext instance. The static
  /// create-function is needed because we need a way to return an error from
  /// the constructor.
  ///
  /// @param thd              Thread handle.
  /// @param root_parsing_ctx Top-level parsing context for this stored program.
  /// @param return_value_fld Field object to store the return value
  ///                         (for stored functions only).
  ///
  /// @return valid sp_rcontext object or NULL in case of OOM-error.
  static sp_rcontext *create(THD *thd,
                             const sp_head *owner,
                             const sp_pcontext *root_parsing_ctx,
                             Field *return_value_fld,
                             Row_definition_list &defs);

  ~sp_rcontext();

private:
  sp_rcontext(const sp_head *owner,
              const sp_pcontext *root_parsing_ctx,
              Field *return_value_fld,
              bool in_sub_stmt);

  // Prevent use of copying constructor and operator.
  sp_rcontext(const sp_rcontext &);
  void operator=(sp_rcontext &);

public:
  /// This class stores basic information about SQL-condition, such as:
  ///   - SQL error code;
  ///   - error level;
  ///   - SQLSTATE;
  ///   - text message.
  ///
  /// It's used to organize runtime SQL-handler call stack.
  ///
  /// Standard Sql_condition class can not be used, because we don't always have
  /// an Sql_condition object for an SQL-condition in Diagnostics_area.
  ///
  /// Eventually, this class should be moved to sql_error.h, and be a part of
  /// standard SQL-condition processing (Diagnostics_area should contain an
  /// object for active SQL-condition, not just information stored in DA's
  /// fields).
  class Sql_condition_info : public Sql_alloc,
                             public Sql_condition_identity
  {
  public:
    /// Text message.
    char *message;

    /// The constructor.
    ///
    /// @param _sql_condition  The SQL condition.
    /// @param arena           Query arena for SP
    Sql_condition_info(const Sql_condition *_sql_condition,
                       Query_arena *arena)
      :Sql_condition_identity(*_sql_condition)
    {
      message= strdup_root(arena->mem_root, _sql_condition->get_message_text());
    }
  };

private:
  /// This class represents a call frame of SQL-handler (one invocation of a
  /// handler). Basically, it's needed to store continue instruction pointer for
  /// CONTINUE SQL-handlers.
  class Handler_call_frame : public Sql_alloc
  {
  public:
    /// SQL-condition, triggered handler activation.
    const Sql_condition_info *sql_condition;

    /// Continue-instruction-pointer for CONTINUE-handlers.
    /// The attribute contains 0 for EXIT-handlers.
    uint continue_ip;

    /// The constructor.
    ///
    /// @param _sql_condition SQL-condition, triggered handler activation.
    /// @param _continue_ip   Continue instruction pointer.
    Handler_call_frame(const Sql_condition_info *_sql_condition,
                       uint _continue_ip)
     :sql_condition(_sql_condition),
      continue_ip(_continue_ip)
    { }
 };

public:
  /// Arena used to (re) allocate items on. E.g. reallocate INOUT/OUT
  /// SP-variables when they don't fit into prealloced items. This is common
  /// situation with String items. It is used mainly in sp_eval_func_item().
  Query_arena *callers_arena;

  /// Flag to end an open result set before start executing an SQL-handler
  /// (if one is found). Otherwise the client will hang due to a violation
  /// of the client/server protocol.
  bool end_partial_result_set;
  bool pause_state;
  bool quit_func;
  uint instr_ptr;

  /// The stored program for which this runtime context is created. Used for
  /// checking if correct runtime context is used for variable handling,
  /// and to access the package run-time context.
  /// Also used by slow log.
  const sp_head *m_sp;

  /////////////////////////////////////////////////////////////////////////
  // SP-variables.
  /////////////////////////////////////////////////////////////////////////

  uint argument_count() const
  {
    return m_root_parsing_ctx->context_var_count();
  }

  int set_variable(THD *thd, uint var_idx, Item **value);
  int set_variable_row_field(THD *thd, uint var_idx, uint field_idx,
                             Item **value);
  int set_variable_row_field_by_name(THD *thd, uint var_idx,
                                     const LEX_CSTRING &field_name,
                                     Item **value);
  int set_variable_row(THD *thd, uint var_idx, List<Item> &items);

  int set_parameter(THD *thd, uint var_idx, Item **value)
  {
    DBUG_ASSERT(var_idx < argument_count());
    return set_variable(thd, var_idx, value);
  }

  Item_field *get_variable(uint var_idx) const
  { return m_var_items[var_idx]; }

  Item **get_variable_addr(uint var_idx) const
  { return ((Item **) m_var_items.array()) + var_idx; }

  Item_field *get_parameter(uint var_idx) const
  {
    DBUG_ASSERT(var_idx < argument_count());
    return get_variable(var_idx);
  }

  bool find_row_field_by_name_or_error(uint *field_idx, uint var_idx,
                                       const LEX_CSTRING &field_name);

  bool set_return_value(THD *thd, Item **return_value_item);

  bool is_return_value_set() const
  { return m_return_value_set; }

  /////////////////////////////////////////////////////////////////////////
  // SQL-handlers.
  /////////////////////////////////////////////////////////////////////////

  /// Push an sp_instr_hpush_jump instance to the handler call stack.
  ///
  /// @param entry    The condition handler entry
  ///
  /// @return error flag.
  /// @retval false on success.
  /// @retval true on error.
  bool push_handler(sp_instr_hpush_jump *entry);

  /// Pop and delete given number of instances from the handler
  /// call stack.
  ///
  /// @param count Number of handler entries to pop & delete.
  void pop_handlers(size_t count);

  const Sql_condition_info *raised_condition() const
  {
    return m_handler_call_stack.elements() ?
      (*m_handler_call_stack.back())->sql_condition : NULL;
  }

  /// Handle current SQL condition (if any).
  ///
  /// This is the public-interface function to handle SQL conditions in
  /// stored routines.
  ///
  /// @param thd            Thread handle.
  /// @param ip[out]        Instruction pointer to the first handler
  ///                       instruction.
  /// @param cur_spi        Current SP instruction.
  ///
  /// @retval true if an SQL-handler has been activated. That means, all of
  /// the following conditions are satisfied:
  ///   - the SP-instruction raised SQL-condition(s),
  ///   - and there is an SQL-handler to process at least one of those
  ///     SQL-conditions,
  ///   - and that SQL-handler has been activated.
  /// Note, that the return value has nothing to do with "error flag"
  /// semantics.
  ///
  /// @retval false otherwise.
  bool handle_sql_condition(THD *thd,
                            uint *ip,
                            const sp_instr *cur_spi);

  /// Remove latest call frame from the handler call stack.
  ///
  /// @param da Diagnostics area containing handled conditions.
  ///
  /// @return continue instruction pointer of the removed handler.
  uint exit_handler(Diagnostics_area *da);

  /////////////////////////////////////////////////////////////////////////
  // Cursors.
  /////////////////////////////////////////////////////////////////////////

  /// Push a cursor to the cursor stack.
  ///
  /// @param cursor The cursor
  ///
  void push_cursor(sp_cursor *cur);

  void pop_cursor(THD *thd);
  /// Pop and delete given number of sp_cursor instance from the cursor stack.
  ///
  /// @param count Number of cursors to pop & delete.
  void pop_cursors(THD *thd, size_t count);

  void pop_all_cursors(THD *thd)
  { pop_cursors(thd, m_ccount); }

  sp_cursor *get_cursor(uint i) const
  { return m_cstack[i]; }

  /////////////////////////////////////////////////////////////////////////
  // CASE expressions.
  /////////////////////////////////////////////////////////////////////////

  /// Set CASE expression to the specified value.
  ///
  /// @param thd             Thread handler.
  /// @param case_expr_id    The CASE expression identifier.
  /// @param case_expr_item  The CASE expression value
  ///
  /// @return error flag.
  /// @retval false on success.
  /// @retval true on error.
  ///
  /// @note The idea is to reuse Item_cache for the expression of the one
  /// CASE statement. This optimization takes place when there is CASE
  /// statement inside of a loop. So, in other words, we will use the same
  /// object on each iteration instead of creating a new one for each
  /// iteration.
  ///
  /// TODO
  ///   Hypothetically, a type of CASE expression can be different for each
  ///   iteration. For instance, this can happen if the expression contains
  ///   a session variable (something like @@VAR) and its type is changed
  ///   from one iteration to another.
  ///
  ///   In order to cope with this problem, we check type each time, when we
  ///   use already created object. If the type does not match, we re-create
  ///   Item.  This also can (should?) be optimized.
  bool set_case_expr(THD *thd, int case_expr_id, Item **case_expr_item_ptr);

  Item *get_case_expr(int case_expr_id) const
  { return m_case_expr_holders[case_expr_id]; }

  Item ** get_case_expr_addr(int case_expr_id) const
  { return (Item**) m_case_expr_holders.array() + case_expr_id; }

private:
  /// Internal function to allocate memory for arrays.
  ///
  /// @param thd Thread handle.
  ///
  /// @return error flag: false on success, true in case of failure.
  bool alloc_arrays(THD *thd);

  /// Create and initialize a table to store SP-variables.
  ///
  /// param thd Thread handle.
  ///
  /// @return error flag.
  /// @retval false on success.
  /// @retval true on error.
  bool init_var_table(THD *thd, List<Spvar_definition> &defs);

  /// Create and initialize an Item-adapter (Item_field) for each SP-var field.
  ///
  /// param thd Thread handle.
  ///
  /// @return error flag.
  /// @retval false on success.
  /// @retval true on error.
  bool init_var_items(THD *thd, List<Spvar_definition> &defs);

  /// Create an instance of appropriate Item_cache class depending on the
  /// specified type in the callers arena.
  ///
  /// @note We should create cache items in the callers arena, as they are
  /// used between in several instructions.
  ///
  /// @param thd   Thread handler.
  /// @param item  Item to get the expression type.
  ///
  /// @return Pointer to valid object on success, or NULL in case of error.
  Item_cache *create_case_expr_holder(THD *thd, const Item *item) const;

  Virtual_tmp_table *virtual_tmp_table_for_row(uint idx);

private:
  /// Top-level (root) parsing context for this runtime context.
  const sp_pcontext *m_root_parsing_ctx;

  /// Virtual table for storing SP-variables.
  Virtual_tmp_table *m_var_table;

  /// Collection of Item_field proxies, each of them points to the
  /// corresponding field in m_var_table.
  Bounds_checked_array<Item_field *> m_var_items;

  /// This is a pointer to a field, which should contain return value for
  /// stored functions (only). For stored procedures, this pointer is NULL.
  Field *m_return_value_fld;

  /// Indicates whether the return value (in m_return_value_fld) has been
  /// set during execution.
  bool m_return_value_set;

  /// Flag to tell if the runtime context is created for a sub-statement.
  bool m_in_sub_stmt;

  /// Stack of visible handlers.
  Dynamic_array<sp_instr_hpush_jump *> m_handlers;

  /// Stack of caught SQL conditions.
  Dynamic_array<Handler_call_frame *> m_handler_call_stack;

  /// Stack of cursors.
  Bounds_checked_array<sp_cursor *> m_cstack;

  /// Current number of cursors in m_cstack.
  uint m_ccount;

  /// Array of CASE expression holders.
  Bounds_checked_array<Item_cache *> m_case_expr_holders;
}; // class sp_rcontext : public Sql_alloc

#endif /* _SP_RCONTEXT_H_ */
server/private/wsrep.h000064400000006354150400263740011046 0ustar00/* Copyright 2014 Codership Oy <http://www.codership.com> & SkySQL Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef WSREP_INCLUDED
#define WSREP_INCLUDED

#include <my_config.h>
#include "log.h"

#ifdef WITH_WSREP
#define IF_WSREP(A,B) A
#define DBUG_ASSERT_IF_WSREP(A) DBUG_ASSERT(A)

extern ulong wsrep_debug; // wsrep_mysqld.cc
extern void WSREP_LOG(void (*fun)(const char* fmt, ...), const char* fmt, ...);

#define WSREP_DEBUG(...)                                                \
    if (wsrep_debug)     WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_INFO(...)  WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_WARN(...)  WSREP_LOG(sql_print_warning,     ##__VA_ARGS__)
#define WSREP_ERROR(...) WSREP_LOG(sql_print_error,       ##__VA_ARGS__)
#define WSREP_UNKNOWN(fmt, ...) WSREP_ERROR("UNKNOWN: " fmt, ##__VA_ARGS__)

#define WSREP_LOG_CONFLICT_THD(thd, role)                               \
  WSREP_INFO("%s: \n "                                                  \
             "  THD: %lu, mode: %s, state: %s, conflict: %s, seqno: %lld\n " \
             "  SQL: %s",                                               \
             role,                                                      \
             thd_get_thread_id(thd),                                    \
             wsrep_thd_client_mode_str(thd),                            \
             wsrep_thd_client_state_str(thd),                           \
             wsrep_thd_transaction_state_str(thd),                      \
             wsrep_thd_trx_seqno(thd),                                  \
             wsrep_thd_query(thd)                                       \
            );

#define WSREP_LOG_CONFLICT(bf_thd, victim_thd, bf_abort)                \
  if (wsrep_debug || wsrep_log_conflicts)                               \
  {                                                                     \
    WSREP_INFO("cluster conflict due to %s for threads:",               \
               (bf_abort) ? "high priority abort" : "certification failure" \
              );                                                        \
    if (bf_thd)     WSREP_LOG_CONFLICT_THD(bf_thd, "Winning thread");   \
    if (victim_thd) WSREP_LOG_CONFLICT_THD(victim_thd, "Victim thread"); \
    WSREP_INFO("context: %s:%d", __FILE__, __LINE__); \
  }


#else /* !WITH_WSREP */

/* These macros are needed to compile MariaDB without WSREP support
 * (e.g. embedded) */

#define IF_WSREP(A,B) B
//#define DBUG_ASSERT_IF_WSREP(A)
#define WSREP_DEBUG(...)
//#define WSREP_INFO(...)
//#define WSREP_WARN(...)
#define WSREP_ERROR(...)
#endif /* WITH_WSREP */

#endif /* WSREP_INCLUDED */
server/private/sql_sort.h000064400000052717150400263740011560 0ustar00#ifndef SQL_SORT_INCLUDED
#define SQL_SORT_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2020, 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 "my_base.h"                            /* ha_rows */
#include <my_cmp.h>
#include "queues.h"
#include "sql_string.h"
#include "sql_class.h"

class Field;
struct TABLE;

/* Defines used by filesort and uniques */

#define MERGEBUFF		7
#define MERGEBUFF2		15

/*
   The structure SORT_ADDON_FIELD describes a fixed layout
   for field values appended to sorted values in records to be sorted
   in the sort buffer.
   Only fixed layout is supported now.
   Null bit maps for the appended values is placed before the values 
   themselves. Offsets are from the last sorted field, that is from the
   record referefence, which is still last component of sorted records.
   It is preserved for backward compatiblility.
   The structure is used tp store values of the additional fields 
   in the sort buffer. It is used also when these values are read
   from a temporary file/buffer. As the reading procedures are beyond the
   scope of the 'filesort' code the values have to be retrieved via
   the callback function 'unpack_addon_fields'.
*/

typedef struct st_sort_addon_field
{
  /* Sort addon packed field */
  Field *field;          /* Original field */
  uint   offset;         /* Offset from the last sorted field */
  uint   null_offset;    /* Offset to to null bit from the last sorted field */
  uint   length;         /* Length in the sort buffer */
  uint8  null_bit;       /* Null bit mask for the field */
} SORT_ADDON_FIELD;

struct BUFFPEK_COMPARE_CONTEXT
{
  qsort_cmp2 key_compare;
  void *key_compare_arg;
};


/**
  Descriptor for a merge chunk to be sort-merged.
  A merge chunk is a sequence of pre-sorted records, written to a
  temporary file. A Merge_chunk instance describes where this chunk is stored
  in the file, and where it is located when it is in memory.

  It is a POD because
   - we read/write them from/to files.

  We have accessors (getters/setters) for all struct members.
 */

struct Merge_chunk {
public:
  my_off_t file_position() const { return m_file_position; }
  void set_file_position(my_off_t val) { m_file_position= val; }
  void advance_file_position(my_off_t val) { m_file_position+= val; }

  uchar *buffer_start() { return m_buffer_start; }
  const uchar *buffer_end() const { return m_buffer_end; }

  void set_buffer(uchar *start, uchar *end)
  {
    m_buffer_start= start;
    m_buffer_end= end;
  }
  void set_buffer_start(uchar *start)
  {
    m_buffer_start= start;
  }
  void set_buffer_end(uchar *end)
  {
    DBUG_ASSERT(m_buffer_end == NULL || end <= m_buffer_end);
    m_buffer_end= end;
  }

  void init_current_key() { m_current_key= m_buffer_start; }
  uchar *current_key() { return m_current_key; }
  void advance_current_key(uint val) { m_current_key+= val; }

  void decrement_rowcount(ha_rows val) { m_rowcount-= val; }
  void set_rowcount(ha_rows val)       { m_rowcount= val; }
  ha_rows rowcount() const             { return m_rowcount; }

  ha_rows mem_count() const { return m_mem_count; }
  void set_mem_count(ha_rows val) { m_mem_count= val; }
  ha_rows decrement_mem_count() { return --m_mem_count; }

  ha_rows max_keys() const { return m_max_keys; }
  void set_max_keys(ha_rows val) { m_max_keys= val; }

  size_t  buffer_size() const { return m_buffer_end - m_buffer_start; }

  /**
    Tries to merge *this with *mc, returns true if successful.
    The assumption is that *this is no longer in use,
    and the space it has been allocated can be handed over to a
    buffer which is adjacent to it.
   */
  bool merge_freed_buff(Merge_chunk *mc) const
  {
    if (mc->m_buffer_end == m_buffer_start)
    {
      mc->m_buffer_end= m_buffer_end;
      mc->m_max_keys+= m_max_keys;
      return true;
    }
    else if (mc->m_buffer_start == m_buffer_end)
    {
      mc->m_buffer_start= m_buffer_start;
      mc->m_max_keys+= m_max_keys;
      return true;
    }
    return false;
  }

  /// The current key for this chunk
  uchar *m_current_key= nullptr;
  /// Current position in the file to be sorted.
  my_off_t m_file_position= 0;
  /// Start of main-memory buffer for this chunk.
  uchar *m_buffer_start= nullptr;
  /// End of main-memory buffer for this chunk.
  uchar *m_buffer_end= nullptr;
  /// Number of unread rows in this chunk.
  ha_rows m_rowcount= 0;
  /// Number of rows in the main-memory buffer.
  ha_rows m_mem_count= 0;
  /// If we have fixed-size rows: max number of rows in buffer.
  ha_rows m_max_keys= 0;
};

typedef Bounds_checked_array<SORT_ADDON_FIELD> Addon_fields_array;
typedef Bounds_checked_array<SORT_FIELD> Sort_keys_array;

/**
  This class wraps information about usage of addon fields.
  An Addon_fields object is used both during packing of data in the filesort
  buffer, and later during unpacking in 'Filesort_info::unpack_addon_fields'.

  @see documentation for the Sort_addon_field struct.
  @see documentation for get_addon_fields()
 */
class Addon_fields {
public:
  Addon_fields(Addon_fields_array arr)
    : m_field_descriptors(arr),
      m_addon_buf(),
      m_addon_buf_length(),
      m_using_packed_addons(false)
  {
    DBUG_ASSERT(!arr.is_null());
  }

  SORT_ADDON_FIELD *begin() { return m_field_descriptors.begin(); }
  SORT_ADDON_FIELD *end()   { return m_field_descriptors.end(); }

    /// rr_unpack_from_tempfile needs an extra buffer when unpacking.
  uchar *allocate_addon_buf(uint sz)
  {
    m_addon_buf= (uchar *)my_malloc(PSI_INSTRUMENT_ME, sz, MYF(MY_WME | MY_THREAD_SPECIFIC));
    if (m_addon_buf)
      m_addon_buf_length= sz;
    return m_addon_buf;
  }

  void free_addon_buff()
  {
    my_free(m_addon_buf);
    m_addon_buf= NULL;
    m_addon_buf_length= 0;
  }

  uchar *get_addon_buf() { return m_addon_buf; }
  uint   get_addon_buf_length() const { return m_addon_buf_length; }

  void set_using_packed_addons(bool val)
  {
    m_using_packed_addons= val;
  }

  bool using_packed_addons() const
  {
    return m_using_packed_addons;
  }

  static bool can_pack_addon_fields(uint record_length)
  {
    return (record_length <= (0xFFFF));
  }

  /**
    @returns Total number of bytes used for packed addon fields.
    the size of the length field + size of null bits + sum of field sizes.
   */
  static uint read_addon_length(uchar *p)
  {
    return size_of_length_field + uint2korr(p);
  }

  /**
    Stores the number of bytes used for packed addon fields.
   */
  static void store_addon_length(uchar *p, uint sz)
  {
    // We actually store the length of everything *after* the length field.
    int2store(p, sz - size_of_length_field);
  }

  static const uint size_of_length_field= 2;

private:
  Addon_fields_array m_field_descriptors;

  uchar    *m_addon_buf;            ///< Buffer for unpacking addon fields.
  uint      m_addon_buf_length;     ///< Length of the buffer.
  bool      m_using_packed_addons;  ///< Are we packing the addon fields?
};

/**
  This class wraps information about usage of sort keys.
  A Sort_keys object is used both during packing of data in the filesort
  buffer, and later during unpacking in 'Filesort_info::unpack_addon_fields'.

  @see SORT_FIELD struct.
*/

class Sort_keys :public Sql_alloc,
                 public Sort_keys_array
{
public:
  Sort_keys(SORT_FIELD* arr, size_t count):
    Sort_keys_array(arr, count),
    m_using_packed_sortkeys(false),
    size_of_packable_fields(0),
    sort_length_with_original_values(0),
    sort_length_with_memcmp_values(0),
    parameters_computed(false)
  {
    DBUG_ASSERT(!is_null());
  }

  bool using_packed_sortkeys() const
  { return m_using_packed_sortkeys; }

  void set_using_packed_sortkeys(bool val)
  {
    m_using_packed_sortkeys= val;
  }
  void set_size_of_packable_fields(uint len)
  {
    size_of_packable_fields= len;
  }

  uint get_size_of_packable_fields()
  {
    return size_of_packable_fields;
  }

  void set_sort_length_with_original_values(uint len)
  {
    sort_length_with_original_values= len;
  }

  uint get_sort_length_with_original_values()
  {
    return sort_length_with_original_values;
  }

  void set_sort_length_with_memcmp_values(uint len)
  {
    sort_length_with_memcmp_values= len;
  }

  uint get_sort_length_with_memcmp_values()
  {
    return sort_length_with_memcmp_values;
  }

  static void store_sortkey_length(uchar *p, uint sz)
  {
    int4store(p, sz - size_of_length_field);
  }

  static uint read_sortkey_length(uchar *p)
  {
    return size_of_length_field + uint4korr(p);
  }

  void increment_size_of_packable_fields(uint len)
  {
    size_of_packable_fields+= len;
  }

  void increment_original_sort_length(uint len)
  {
    sort_length_with_original_values+= len;
  }

  bool is_parameters_computed() { return parameters_computed; }
  void set_parameters_computed(bool val) { parameters_computed= val; }

  static const uint size_of_length_field= 4;

private:
  bool m_using_packed_sortkeys;     // Are we packing sort keys
  uint size_of_packable_fields;     // Total length bytes for packable columns

  /*
    The sort length for all the keyparts storing the original values
  */
  uint sort_length_with_original_values;

  /*
    The sort length for all the keyparts storing the mem-comparable images
  */
  uint sort_length_with_memcmp_values;

  /*
    TRUE       parameters(like sort_length_* , size_of_packable_field)
               are computed
    FALSE      otherwise.
  */
  bool parameters_computed;
};


/**
PACKED SORT KEYS

Description

In this optimization where we would like the pack the values of the sort key
inside the sort buffer for each record.

Contents:
1. Background
1.1 Implementation details
2. Solution : Packed Sort Keys
2.1 Packed key format
2.2 Which format to use
3. Special cases
3.1 Handling very long strings
3.2 Handling for long binary strings
3.3 Handling very long strings with Packed sort keys
4. Sort key columns in addon_fields

1. Background
Before this optimization of using packed sort keys, filesort() sorted the
data using mem-comparable keys.

That is, if we wanted to sort by

  ORDER BY col1, col2, ... colN
then the filesort code would for each row generate one "Sort Key"
and then sort the rows by their Sort Keys.

The Sort Keys are mem-comparable (that is, are compared by memcmp()) and
they are of FIXED SIZE. The sort key has the same length regardless of
what value it represents. This causes INEFFICIENT MEMORY USAGE.

1.1 Implementation details

make_sortkey() is the function that produces a sort key
from a record.

The function treats Field and Item objects differently.

class Field has:

a) void make_sort_key(uchar *buff, uint length);
   make_sort_key is a non-virtual function which handles encoding of
   SQL null values.

b) virtual void sort_string(uchar *buff,uint length)=0;
    sort_string produces mem-comparable image of the field value
    for each datatype.

For Items, Type_handler has a virtual function:

  virtual void make_sort_key(uchar *to, Item *item,
                             const SORT_FIELD_ATTR *sort_field,
                             Sort_param *param) const= 0;
  which various datatypes overload.


2. SOLUTION: PACKED SORT KEYS

Note that one can have mem-comparable keys are that are not fixed-size.
MyRocks uses such encoding for example.

However for this optimization it was decided to store the original
(non-mem-comparable) values instead and use a datatype-aware
key comparison function.

2.1 Packed key format
The keys are stored in a new variable-size data format called "packed".

The format is as follows:

  <sort_key_length><packed_value_1><packed_value2> ....... <packed_valueN>

  format for a n-part sort key

<sort_key_length> is the length of the whole key.
Each packed value is encoded as follows:

  <null_byte=0>  // This is a an SQL NULL
  [<null_byte=1>] <packed_value>  // this a non-NULL value
null_byte is present if the field/item is NULLable.
SQL NULL is encoded as just one NULL-indicator byte. The value itself is omitted.

The format of the packed_value depends on the datatype.
For "non-packable" datatypes it is just their mem-comparable form, as before.

The "packable" datatypes are currently variable-length strings and the
packed format for them is (for binary blobs, see a note below):

<length> <string>
2.2 Which format to use

The advantage of Packed Key Format is potential space savings for
variable-length fields.

The disadvantages are:

a) It may actually take more space, because of sort_key_length and
   length fields.
b) The comparison function is more expensive.

Currently the logic is: use Packed Key Format if we would save 128 or more
bytes when constructing a sort key from values that have empty string
for each packable component.

3. SPECIAL CASES
3.1 HANDLING VERY LONG STRINGS
the size of sort key part was limited by @@max_sort_length variable.
It is defined as:

The number of bytes to use when sorting data values. The server uses only the
first max_sort_length bytes of each value and ignores the rest.

3.2 HANDLING VERY LONG BINARY STRINGS
Long binary strings receive special treatment. A sort key for the long
binary string is truncated at max_sort_length bytes like described above,
but then a "suffix" is appended which contains the total length of the
value before the truncation.

3.3 HANDLING VERY LONG STRINGS WITH PACKED SORT KEY
Truncating multi-byte string at N bytes is not safe because one can cut in the
middle of a character. One is tempted to solve this by discarding the partial
character but that's also not a good idea as in some collations multiple
characters may produce one weight (this is called "contraction").

This combination of circumstances:

The string value is very long, so truncation is necessary
The collation is "complex", so truncation is dangerous
is deemed to be relatively rare so it was decided to just use
the non-packed sort keys in this case.

4. SORT KEY COLUMNS IN ADDON FIELDS
Currently, each sort key column is actually stored twice
1. as part of the sort key
2. in the addon_fields
This made total sense when sort key stored the mem-comparable image
(from which one cannot restore the original value in general case).
But since we now store the original value, we could also remove it from the
addon_fields and further save space. This is still a limitation and needs
to be fixed later

@see Sort_keys

**/

/**
  The sort record format may use one of two formats for the non-sorted part of
  the record:

  1. Use the rowid

    |<sort_key>|   <rowid>  |
    /          / ref_length /

  2. Use "addon fields"

    |<sort_key>|<null bits>|<field a><field b>...|
    /          /         addon_length            /

  The packed format for "addon fields"

    |<sort_key>|<length>|<null bits>|<field a><field b>...|
    /          /         addon_length                     /

  <sort_key>  The key may use one of the two formats:
              A. fixed-size mem-comparable form. The record is always
                 sort_length bytes long.
              B. "PackedKeyFormat" - the records are variable-size.

  <key>       Fields are fixed-size, specially encoded with
              Field::make_sort_key() so we can do byte-by-byte compare.

  <length>    Contains the *actual* packed length (after packing) of
              everything after the sort keys.
              The size of the length field is 2 bytes,
              which should cover most use cases: addon data <= 65535 bytes.
              This is the same as max record size in MySQL.
  <null bits> One bit for each nullable field, indicating whether the field
              is null or not. May have size zero if no fields are nullable.
  <field xx>  Are stored with field->pack(), and retrieved with
              field->unpack(). Addon fields within a record are stored
              consecutively, with no "holes" or padding. They will have zero
              size for NULL values.

*/

class Sort_param {
public:
  uint rec_length;            // Length of sorted records.
  uint sort_length;           // Length of sorted columns.
  uint ref_length;            // Length of record ref.
  uint addon_length;          // Length of addon_fields
  uint res_length;            // Length of records in final sorted file/buffer.
  uint max_keys_per_buffer;   // Max keys / buffer.
  uint min_dupl_count;
  ha_rows max_rows;           // Select limit, or HA_POS_ERROR if unlimited.
  ha_rows examined_rows;      // Number of examined rows.
  TABLE *sort_form;           // For quicker make_sortkey.
  /**
    ORDER BY list with some precalculated info for filesort.
    Array is created and owned by a Filesort instance.
   */
  Bounds_checked_array<SORT_FIELD> local_sortorder;
  Addon_fields *addon_fields;     // Descriptors for companion fields.
  Sort_keys *sort_keys;
  ha_rows *accepted_rows;         /* For ROWNUM */
  bool using_pq;
  bool set_all_read_bits;

  uchar *unique_buff;
  bool not_killable;
  String tmp_buffer;
  // The fields below are used only by Unique class.
  qsort_cmp2 compare;
  BUFFPEK_COMPARE_CONTEXT cmp_context;

  Sort_param()
  {
    memset(reinterpret_cast<void*>(this), 0, sizeof(*this));
    tmp_buffer.set_thread_specific();
    /*
      Fix memset() clearing the charset.
      TODO: The constructor should be eventually rewritten not to use memset().
    */
    tmp_buffer.set_charset(&my_charset_bin);
  }
  void init_for_filesort(uint sortlen, TABLE *table,
                         ha_rows maxrows, Filesort *filesort);

   void  (*unpack)(TABLE *);
  /// Enables the packing of addons if possible.
  void try_to_pack_addons(ulong max_length_for_sort_data);

  /// Are we packing the "addon fields"?
  bool using_packed_addons() const
  {
    DBUG_ASSERT(m_using_packed_addons ==
                (addon_fields != NULL &&
                 addon_fields->using_packed_addons()));
    return m_using_packed_addons;
  }

  bool using_packed_sortkeys() const
  {
    DBUG_ASSERT(m_using_packed_sortkeys ==
                (sort_keys != NULL && sort_keys->using_packed_sortkeys()));
    return m_using_packed_sortkeys;
  }

  /// Are we using "addon fields"?
  bool using_addon_fields() const
  {
    return addon_fields != NULL;
  }

  uint32 get_result_length(uchar *plen)
  {
    if (!m_using_packed_addons)
      return res_length;
    return Addon_fields::read_addon_length(plen);
  }

  uint32 get_addon_length(uchar *plen)
  {
    if (using_packed_addons())
      return Addon_fields::read_addon_length(plen);
    else
      return addon_length;
  }

  uint32 get_sort_length(uchar *plen)
  {
    if (using_packed_sortkeys())
      return Sort_keys::read_sortkey_length(plen) +
              /*
                when addon fields are not present, then the sort_length also
                includes the res_length. For packed keys here we add
                the res_length
              */
             (using_addon_fields() ? 0: res_length);
    else
      return sort_length;
  }

  uint get_record_length(uchar *plen)
  {
    if (m_packed_format)
    {
      uint sort_len= get_sort_length(plen);
      return sort_len + get_addon_length(plen + sort_len);
    }
    else
      return rec_length;
  }

  /**
    Getter for record length and result length.
    @param record_start Pointer to record.
    @param [out] recl   Store record length here.
    @param [out] resl   Store result length here.
   */
  void get_rec_and_res_len(uchar *record_start, uint *recl, uint *resl)
  {
    if (m_packed_format)
    {
      uint sort_len= get_sort_length(record_start);
      uint addon_len= get_addon_length(record_start + sort_len);
      *recl= sort_len + addon_len;
      *resl= using_addon_fields() ? addon_len : res_length;
    }
    else
    {
      *recl= rec_length;
      *resl= res_length;
    }
  }

  void try_to_pack_sortkeys();

  qsort_cmp2 get_compare_function() const
  {
    return using_packed_sortkeys() ?
           get_packed_keys_compare_ptr() :
           get_ptr_compare(sort_length);
  }
  void* get_compare_argument(size_t *sort_len) const
  {
    return using_packed_sortkeys() ?
           (void*) this :
           (void*) sort_len;
  }

  bool is_packed_format() const
  {
    return m_packed_format;
  }

private:
  uint m_packable_length;
  bool m_using_packed_addons; ///< caches the value of using_packed_addons()
  /* caches the value of using_packed_sortkeys() */
  bool m_using_packed_sortkeys;
  bool m_packed_format;
};

typedef Bounds_checked_array<uchar> Sort_buffer;

int merge_many_buff(Sort_param *param, Sort_buffer sort_buffer,
                    Merge_chunk *buffpek, uint *maxbuffer, IO_CACHE *t_file);
ulong read_to_buffer(IO_CACHE *fromfile, Merge_chunk *buffpek,
                     Sort_param *param, bool packing_format);
bool merge_buffers(Sort_param *param,IO_CACHE *from_file,
                   IO_CACHE *to_file, Sort_buffer sort_buffer,
                   Merge_chunk *lastbuff, Merge_chunk *Fb,
                   Merge_chunk *Tb, int flag);
int merge_index(Sort_param *param, Sort_buffer sort_buffer,
                Merge_chunk *buffpek, uint maxbuffer,
                IO_CACHE *tempfile, IO_CACHE *outfile);
void reuse_freed_buff(QUEUE *queue, Merge_chunk *reuse, uint key_length);

#endif /* SQL_SORT_INCLUDED */
server/private/derror.h000064400000001724150400263740011177 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef DERROR_INCLUDED
#define DERROR_INCLUDED

bool init_errmessage(void);
void free_error_messages();
bool read_texts(const char *file_name, const char *language,
                const char ****data);

#endif /* DERROR_INCLUDED */
server/private/sql_binlog.h000064400000001577150400263740012041 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_BINLOG_INCLUDED
#define SQL_BINLOG_INCLUDED

class THD;

void mysql_client_binlog_statement(THD *thd);

#endif /* SQL_BINLOG_INCLUDED */
server/private/rpl_constants.h000064400000006435150400263740012577 0ustar00/* Copyright (c) 2007 MySQL AB, 2008 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

#ifndef RPL_CONSTANTS_H
#define RPL_CONSTANTS_H

#include <my_sys.h>
#include <my_crypt.h>

/**
   Enumeration of the incidents that can occur for the server.
 */
enum Incident {
  /** No incident */
  INCIDENT_NONE = 0,

  /** There are possibly lost events in the replication stream */
  INCIDENT_LOST_EVENTS = 1,

  /** Shall be last event of the enumeration */
  INCIDENT_COUNT
};


/**
   Enumeration of the reserved formats of Binlog extra row information
*/
enum ExtraRowInfoFormat {

  /** Reserved formats  0 -> 63 inclusive */
  ERIF_LASTRESERVED =  63,

  /**
      Available / uncontrolled formats
      64 -> 254 inclusive
  */
  ERIF_OPEN1        =  64,
  ERIF_OPEN2        =  65,

  ERIF_LASTOPEN     =  254,

  /**
     Multi-payload format 255

      Length is total length, payload is sequence of
      sub-payloads with their own headers containing
      length + format.
  */
  ERIF_MULTI        =  255
};

/*
   1 byte length, 1 byte format
   Length is total length in bytes, including 2 byte header
   Length values 0 and 1 are currently invalid and reserved.
*/
#define EXTRA_ROW_INFO_LEN_OFFSET 0
#define EXTRA_ROW_INFO_FORMAT_OFFSET 1
#define EXTRA_ROW_INFO_HDR_BYTES 2
#define EXTRA_ROW_INFO_MAX_PAYLOAD (255 - EXTRA_ROW_INFO_HDR_BYTES)

enum enum_binlog_checksum_alg {
  BINLOG_CHECKSUM_ALG_OFF= 0,    // Events are without checksum though its generator
                                 // is checksum-capable New Master (NM).
  BINLOG_CHECKSUM_ALG_CRC32= 1,  // CRC32 of zlib algorithm.
  BINLOG_CHECKSUM_ALG_ENUM_END,  // the cut line: valid alg range is [1, 0x7f].
  BINLOG_CHECKSUM_ALG_UNDEF= 255 // special value to tag undetermined yet checksum
                                 // or events from checksum-unaware servers
};

#define BINLOG_CRYPTO_SCHEME_LENGTH 1
#define BINLOG_KEY_VERSION_LENGTH   4
#define BINLOG_IV_LENGTH            MY_AES_BLOCK_SIZE
#define BINLOG_IV_OFFS_LENGTH       4
#define BINLOG_NONCE_LENGTH         (BINLOG_IV_LENGTH - BINLOG_IV_OFFS_LENGTH)

struct Binlog_crypt_data {
  uint  scheme;
  uint  key_version, key_length, ctx_size;
  uchar key[MY_AES_MAX_KEY_LENGTH];
  uchar nonce[BINLOG_NONCE_LENGTH];

  int init(uint sch, uint kv)
  {
    scheme= sch;
    ctx_size= encryption_ctx_size(ENCRYPTION_KEY_SYSTEM_DATA, kv);
    key_version= kv;
    key_length= sizeof(key);
    return encryption_key_get(ENCRYPTION_KEY_SYSTEM_DATA, kv, key, &key_length);
  }

  void set_iv(uchar* iv, uint32 offs) const
  {
    memcpy(iv, nonce, BINLOG_NONCE_LENGTH);
    int4store(iv + BINLOG_NONCE_LENGTH, offs);
  }
};

#endif /* RPL_CONSTANTS_H */
server/private/sql_alloc.h000064400000003304150400263740011647 0ustar00#ifndef SQL_ALLOC_INCLUDED
#define SQL_ALLOC_INCLUDED
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2017, 2018, 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-1301  USA */

#include <my_sys.h>                    /* alloc_root, MEM_ROOT, TRASH */

/* MariaDB standard class memory allocator */

class Sql_alloc
{
public:
  static void *operator new(size_t size) throw ()
  {
    return thd_alloc(_current_thd(), size);
  }
  static void *operator new[](size_t size) throw ()
  {
    return thd_alloc(_current_thd(), size);
  }
  static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw()
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr, size_t size) { TRASH_FREE(ptr, size); }
  static void operator delete(void *, MEM_ROOT *){}
  static void operator delete[](void *, MEM_ROOT *)
  { /* never called */ }
  static void operator delete[](void *ptr, size_t size) { TRASH_FREE(ptr, size); }
};
#endif /* SQL_ALLOC_INCLUDED */
server/private/event_queue.h000064400000006556150400263740012237 0ustar00#ifndef _EVENT_QUEUE_H_
#define _EVENT_QUEUE_H_
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.

   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,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**

  @addtogroup Event_Scheduler
  @{

  @file event_queue.h

  Queue of events awaiting execution.
*/

#ifdef HAVE_PSI_INTERFACE
extern PSI_mutex_key key_LOCK_event_queue;
extern PSI_cond_key key_COND_queue_state;
#endif /* HAVE_PSI_INTERFACE */

#include "queues.h"                             // QUEUE
#include "sql_string.h"                         /* LEX_CSTRING */
#include "my_time.h"                    /* my_time_t, interval_type */

class Event_basic;
class Event_queue_element;
class Event_queue_element_for_exec;

class THD;

/**
  Queue of active events awaiting execution.
*/

class Event_queue
{
public:
  Event_queue();
  ~Event_queue();

  bool
  init_queue(THD *thd);

  /* Methods for queue management follow */

  bool
  create_event(THD *thd, Event_queue_element *new_element,
               bool *created);

  void
  update_event(THD *thd, const LEX_CSTRING *dbname, const LEX_CSTRING *name,
               Event_queue_element *new_element);

  void
  drop_event(THD *thd, const LEX_CSTRING *dbname, const LEX_CSTRING *name);

  void
  drop_schema_events(THD *thd, const LEX_CSTRING *schema);

  void
  recalculate_activation_times(THD *thd);

  bool
  get_top_for_execution_if_time(THD *thd,
                                Event_queue_element_for_exec **event_name);


  void
  dump_internal_status();

private:
  void
  empty_queue();

  void
  deinit_queue();
  /* helper functions for working with mutexes & conditionals */
  void
  lock_data(const char *func, uint line);

  void
  unlock_data(const char *func, uint line);

  void
  cond_wait(THD *thd, struct timespec *abstime, const PSI_stage_info *stage,
            const char *src_func, const char *src_file, uint src_line);

  void
  find_n_remove_event(const LEX_CSTRING *db, const LEX_CSTRING *name);


  void
  drop_matching_events(THD *thd, const LEX_CSTRING *pattern,
                       bool (*)(const LEX_CSTRING*, Event_basic *));


  void
  dbug_dump_queue(my_time_t now);

  /* LOCK_event_queue is the mutex which protects the access to the queue. */
  mysql_mutex_t LOCK_event_queue;
  mysql_cond_t COND_queue_state;

  /* The sorted queue with the Event_queue_element objects */
  QUEUE queue;

  my_time_t next_activation_at;

  uint mutex_last_locked_at_line;
  uint mutex_last_unlocked_at_line;
  uint mutex_last_attempted_lock_at_line;
  const char* mutex_last_locked_in_func;
  const char* mutex_last_unlocked_in_func;
  const char* mutex_last_attempted_lock_in_func;
  bool mutex_queue_data_locked;
  bool mutex_queue_data_attempting_lock;
  bool waiting_on_cond;
};
/**
  @} (End of group Event_Scheduler)
*/

#endif /* _EVENT_QUEUE_H_ */
server/private/sql_rename.h000064400000001726150400263740012032 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_RENAME_INCLUDED
#define SQL_RENAME_INCLUDED

class THD;
struct TABLE_LIST;

bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent,
                         bool if_exists);

#endif /* SQL_RENAME_INCLUDED */
server/private/my_bit.h000064400000014064150400263740011166 0ustar00/* Copyright (c) 2007, 2011, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, 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 */

#ifndef MY_BIT_INCLUDED
#define MY_BIT_INCLUDED

/*
  Some useful bit functions
*/

C_MODE_START

extern const uchar _my_bits_reverse_table[256];


/*
  my_bit_log2_xxx()

  In the given value, find the highest bit set,
  which is the smallest X that satisfies the condition: (2^X >= value).
  Can be used as a reverse operation for (1<<X), to find X.

  Examples:
  - returns 0 for (1<<0)
  - returns 1 for (1<<1)
  - returns 2 for (1<<2)
  - returns 2 for 3, which has (1<<2) as the highest bit set.

  Note, the behaviour of log2(0) is not defined.
  Let's return 0 for the input 0, for the code simplicity.
  See the 000x branch. It covers both (1<<0) and 0.
*/
static inline CONSTEXPR uint my_bit_log2_hex_digit(uint8 value)
{
  return value & 0x0C ? /*1100*/ (value & 0x08 ? /*1000*/ 3 : /*0100*/ 2) :
                        /*0010*/ (value & 0x02 ? /*0010*/ 1 : /*000x*/ 0);
}
static inline CONSTEXPR uint my_bit_log2_uint8(uint8 value)
{
  return value & 0xF0 ? my_bit_log2_hex_digit((uint8) (value >> 4)) + 4:
                        my_bit_log2_hex_digit(value);
}
static inline CONSTEXPR uint my_bit_log2_uint16(uint16 value)
{
  return value & 0xFF00 ? my_bit_log2_uint8((uint8) (value >> 8)) + 8 :
                          my_bit_log2_uint8((uint8) value);
}
static inline CONSTEXPR uint my_bit_log2_uint32(uint32 value)
{
  return value & 0xFFFF0000UL ?
         my_bit_log2_uint16((uint16) (value >> 16)) + 16 :
         my_bit_log2_uint16((uint16) value);
}
static inline CONSTEXPR uint my_bit_log2_uint64(ulonglong value)
{
  return value & 0xFFFFFFFF00000000ULL ?
         my_bit_log2_uint32((uint32) (value >> 32)) + 32 :
         my_bit_log2_uint32((uint32) value);
}
static inline CONSTEXPR uint my_bit_log2_size_t(size_t value)
{
#ifdef __cplusplus
  static_assert(sizeof(size_t) <= sizeof(ulonglong),
                "size_t <= ulonglong is an assumption that needs to be fixed "
                "for this architecture. Please create an issue on "
                "https://jira.mariadb.org");
#endif
  return my_bit_log2_uint64((ulonglong) value);
}


/*
Count bits in 32bit integer

  Algorithm by Sean Anderson, according to:
  http://graphics.stanford.edu/~seander/bithacks.html
  under "Counting bits set, in parallel"

 (Original code public domain).
*/
static inline uint my_count_bits_uint32(uint32 v)
{
  v = v - ((v >> 1) & 0x55555555);
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
  return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}


static inline uint my_count_bits(ulonglong x)
{
  return my_count_bits_uint32((uint32)x) + my_count_bits_uint32((uint32)(x >> 32));
}




/*
  Next highest power of two

  SYNOPSIS
    my_round_up_to_next_power()
    v		Value to check

  RETURN
    Next or equal power of 2
    Note: 0 will return 0

  NOTES
    Algorithm by Sean Anderson, according to:
    http://graphics.stanford.edu/~seander/bithacks.html
    (Original code public domain)

    Comments shows how this works with 01100000000000000000000000001011
*/

static inline uint32 my_round_up_to_next_power(uint32 v)
{
  v--;			/* 01100000000000000000000000001010 */
  v|= v >> 1;		/* 01110000000000000000000000001111 */
  v|= v >> 2;		/* 01111100000000000000000000001111 */
  v|= v >> 4;		/* 01111111110000000000000000001111 */
  v|= v >> 8;		/* 01111111111111111100000000001111 */
  v|= v >> 16;		/* 01111111111111111111111111111111 */
  return v+1;		/* 10000000000000000000000000000000 */
}

static inline uint32 my_clear_highest_bit(uint32 v)
{
  uint32 w=v >> 1;
  w|= w >> 1;
  w|= w >> 2;
  w|= w >> 4;
  w|= w >> 8;
  w|= w >> 16;
  return v & w;
}

static inline uint32 my_reverse_bits(uint32 key)
{
  return
    ((uint32)_my_bits_reverse_table[ key      & 255] << 24) |
    ((uint32)_my_bits_reverse_table[(key>> 8) & 255] << 16) |
    ((uint32)_my_bits_reverse_table[(key>>16) & 255] <<  8) |
     (uint32)_my_bits_reverse_table[(key>>24)      ];
}

/*
  a number with the n lowest bits set
  an overflow-safe version of  (1 << n) - 1
*/
static inline uint64 my_set_bits(int n)
{
  return (((1ULL << (n - 1)) - 1) << 1) | 1;
}

/* Create a mask of the significant bits for the last byte (1,3,7,..255) */
static inline uchar last_byte_mask(uint bits)
{
  /* Get the number of used bits-1 (0..7) in the last byte */
  unsigned int const used = (bits - 1U) & 7U;
  /* Return bitmask for the significant bits */
  return (uchar) ((2U << used) - 1);
}

static inline uint my_bits_in_bytes(uint n)
{
  return ((n + 7) / 8);
}

#ifdef _MSC_VER
#include <intrin.h>
#endif

/*
  Find the position of the first(least significant) bit set in
  the argument. Returns 64 if the argument was 0.
*/
static inline uint my_find_first_bit(ulonglong n)
{
  if(!n)
    return 64;
#if defined(__GNUC__)
  return __builtin_ctzll(n);
#elif defined(_MSC_VER)
#if defined(_M_IX86)
  unsigned long bit;
  if( _BitScanForward(&bit, (uint)n))
    return bit;
  _BitScanForward(&bit, (uint)(n>>32));
  return bit + 32;
#else
  unsigned long bit;
  _BitScanForward64(&bit, n);
  return bit;
#endif
#else
  /* Generic case */
  uint  shift= 0;
  static const uchar last_bit[16] = { 32, 0, 1, 0,
                                      2, 0, 1, 0,
                                      3, 0, 1, 0,
                                      2, 0, 1, 0};
  uint bit;
  while ((bit = last_bit[(n >> shift) & 0xF]) == 32)
    shift+= 4;
  return shift+bit;
#endif
}
C_MODE_END

#endif /* MY_BIT_INCLUDED */
server/private/my_crypt.h000064400000001610150400263740011542 0ustar00/*
 Copyright (c) 2014 Google Inc.
 Copyright (c) 2014, 2015 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 */

#ifndef MY_CRYPT_INCLUDED
#define MY_CRYPT_INCLUDED

#include <my_config.h> /* HAVE_EncryptAes128{Ctr,Gcm} */
#include <mysql/service_my_crypt.h>

#endif /* MY_CRYPT_INCLUDED */
server/private/pfs_file_provider.h000064400000006121150400263740013377 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_FILE_PROVIDER_H
#define PFS_FILE_PROVIDER_H

/**
  @file include/pfs_file_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_FILE_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_FILE_CALL(M) pfs_ ## M ## _v1

C_MODE_START

void pfs_register_file_v1(const char *category,
                          PSI_file_info_v1 *info,
                          int count);

void pfs_create_file_v1(PSI_file_key key, const char *name, File file);

PSI_file_locker*
pfs_get_thread_file_name_locker_v1(PSI_file_locker_state *state,
                                   PSI_file_key key,
                                   PSI_file_operation op,
                                   const char *name, const void *identity);

PSI_file_locker*
pfs_get_thread_file_stream_locker_v1(PSI_file_locker_state *state,
                                     PSI_file *file, PSI_file_operation op);

PSI_file_locker*
pfs_get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state,
                                         File file, PSI_file_operation op);

void pfs_start_file_open_wait_v1(PSI_file_locker *locker,
                                 const char *src_file,
                                 uint src_line);

PSI_file* pfs_end_file_open_wait_v1(PSI_file_locker *locker, void *result);

void pfs_end_file_open_wait_and_bind_to_descriptor_v1
  (PSI_file_locker *locker, File file);

void pfs_end_temp_file_open_wait_and_bind_to_descriptor_v1
  (PSI_file_locker *locker, File file, const char *filename);

void pfs_start_file_wait_v1(PSI_file_locker *locker,
                            size_t count,
                            const char *src_file,
                            uint src_line);

void pfs_end_file_wait_v1(PSI_file_locker *locker,
                          size_t byte_count);

void pfs_start_file_close_wait_v1(PSI_file_locker *locker,
                                  const char *src_file,
                                  uint src_line);

void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc);

void pfs_end_file_rename_wait_v1(PSI_file_locker *locker, const char *old_name,
                                 const char *new_name, int rc);

C_MODE_END

#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_FILE_INTERFACE */

#endif

server/private/wsrep_client_state.h000064400000003036150400263740013576 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_CLIENT_STATE_H
#define WSREP_CLIENT_STATE_H

/* wsrep-lib */
#include "wsrep/client_state.hpp"
#include "my_global.h"

class THD;

class Wsrep_client_state : public wsrep::client_state
{
public:
  Wsrep_client_state(THD* thd,
                     wsrep::mutex& mutex,
                     wsrep::condition_variable& cond,
                     wsrep::server_state& server_state,
                     wsrep::client_service& client_service,
                     const wsrep::client_id& id)
    : wsrep::client_state(mutex,
                          cond,
                          server_state,
                          client_service,
                          id,
                          wsrep::client_state::m_local)
    , m_thd(thd)
  { }
  THD* thd() { return m_thd; }
private:
  THD* m_thd;
};

#endif /* WSREP_CLIENT_STATE_H */
server/private/structs.h000064400000063413150400263740011414 0ustar00#ifndef STRUCTS_INCLUDED
#define STRUCTS_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
   Copyright (c) 2009, 2019, 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 */



/* The old structures from unireg */

#include "sql_plugin.h"                         /* plugin_ref */
#include "sql_const.h"                          /* MAX_REFLENGTH */
#include "my_time.h"                   /* enum_mysql_timestamp_type */
#include "thr_lock.h"                  /* thr_lock_type */
#include "my_base.h"                   /* ha_rows, ha_key_alg */
#include <mysql_com.h>                  /* USERNAME_LENGTH */
#include "sql_bitmap.h"

struct TABLE;
class Type_handler;
class Field;
class Index_statistics;
struct Lex_ident_cli_st;

class THD;

/* Array index type for table.field[] */
typedef uint16 field_index_t;

typedef struct st_date_time_format {
  uchar positions[8];
  char  time_separator;			/* Separator between hour and minute */
  uint flag;				/* For future */
  LEX_CSTRING format;
} DATE_TIME_FORMAT;


typedef struct st_keyfile_info {	/* used with ha_info() */
  uchar ref[MAX_REFLENGTH];		/* Pointer to current row */
  uchar dupp_ref[MAX_REFLENGTH];	/* Pointer to dupp row */
  uint ref_length;			/* Length of ref (1-8) */
  uint block_size;			/* index block size */
  File filenr;				/* (uniq) filenr for table */
  ha_rows records;			/* Records i datafilen */
  ha_rows deleted;			/* Deleted records */
  ulonglong data_file_length;		/* Length off data file */
  ulonglong max_data_file_length;	/* Length off data file */
  ulonglong index_file_length;
  ulonglong max_index_file_length;
  ulonglong delete_length;		/* Free bytes */
  ulonglong auto_increment_value;
  int errkey,sortkey;			/* Last errorkey and sorted by */
  time_t create_time;			/* When table was created */
  time_t check_time;
  time_t update_time;
  ulong mean_rec_length;		/* physical reclength */
} KEYFILE_INFO;


typedef struct st_key_part_info {	/* Info about a key part */
  Field *field;                         /* the Field object for the indexed
                                           prefix of the original table Field.
                                           NOT necessarily the original Field */
  uint  offset;                         /* Offset in record (from 0) */
  uint  null_offset;                    /* Offset to null_bit in record */
  /* Length of key part in bytes, excluding NULL flag and length bytes */
  uint length;
  /* 
    Number of bytes required to store the keypart value. This may be
    different from the "length" field as it also counts
     - possible NULL-flag byte (see HA_KEY_NULL_LENGTH)
     - possible HA_KEY_BLOB_LENGTH bytes needed to store actual value length.
  */
  uint store_length;
  uint16 key_type;
  field_index_t fieldnr;                /* Fieldnr begins counting from 1 */
  uint16 key_part_flag;                 /* 0 or HA_REVERSE_SORT */
  uint8 type;
  uint8 null_bit;                       /* Position to null_bit */
} KEY_PART_INFO ;

class engine_option_value;
struct ha_index_option_struct;

typedef struct st_key {
  uint  key_length;                /* total length of user defined key parts  */
  ulong flags;                     /* dupp key and pack flags */
  uint  user_defined_key_parts;    /* How many key_parts */
  uint  usable_key_parts; /* Should normally be = user_defined_key_parts */
  uint  ext_key_parts;             /* Number of key parts in extended key */
  ulong ext_key_flags;             /* Flags for extended key              */
  /*
    Parts of primary key that are in the extension of this index. 

    Example: if this structure describes idx1, which is defined as 
      INDEX idx1 (pk2, col2)
    and pk is defined as:
      PRIMARY KEY (pk1, pk2)
    then 
      pk1 is in the extension idx1, ext_key_part_map.is_set(0) == true
      pk2 is explicitly present in idx1, it is not in the extension, so
      ext_key_part_map.is_set(1) == false
  */
  key_part_map ext_key_part_map;
  /*
    Bitmap of indexes having common parts with this index
    (only key parts from key definitions are taken into account)
  */
  key_map overlapped;
  /* Set of keys constraint correlated with this key */
  key_map constraint_correlated;
  LEX_CSTRING name;
  uint  block_size;
  enum  ha_key_alg algorithm;
  /* 
    The flag is on if statistical data for the index prefixes
    has to be taken from the system statistical tables.
  */
  bool is_statistics_from_stat_tables;
  /*
    Note that parser is used when the table is opened for use, and
    parser_name is used when the table is being created.
  */
  union
  {
    plugin_ref parser;                  /* Fulltext [pre]parser */
    LEX_CSTRING *parser_name;           /* Fulltext [pre]parser name */
  };
  KEY_PART_INFO *key_part;
  /* Unique name for cache;  db + \0 + table_name + \0 + key_name + \0 */
  uchar *cache_name;
  /*
    Array of AVG(#records with the same field value) for 1st ... Nth key part.
    0 means 'not known'.
    For temporary heap tables this member is NULL.
  */
  ulong *rec_per_key;

  /*
    This structure is used for statistical data on the index
    that has been read from the statistical table index_stat
  */ 
  Index_statistics *read_stats;
  /*
    This structure is used for statistical data on the index that
    is collected by the function collect_statistics_for_table
  */
  Index_statistics *collected_stats;
 
  TABLE *table;
  LEX_CSTRING comment;
  /** reference to the list of options or NULL */
  engine_option_value *option_list;
  ha_index_option_struct *option_struct;                  /* structure with parsed options */

  double actual_rec_per_key(uint i) const;

  bool without_overlaps;
  /*
    TRUE if index needs to be ignored
  */
  bool is_ignored;
} KEY;


struct st_join_table;

typedef struct st_reginfo {		/* Extra info about reg */
  struct st_join_table *join_tab;	/* Used by SELECT() */
  enum thr_lock_type lock_type;		/* How database is used */
  bool skip_locked;
  bool not_exists_optimize;
  /*
    TRUE <=> range optimizer found that there is no rows satisfying
    table conditions.
  */
  bool impossible_range;
} REGINFO;


/*
  Originally MySQL used MYSQL_TIME structure inside server only, but since
  4.1 it's exported to user in the new client API. Define aliases for
  new names to keep existing code simple.
*/

typedef enum enum_mysql_timestamp_type timestamp_type;


typedef struct {
  ulong year,month,day,hour;
  ulonglong minute,second,second_part;
  bool neg;
} INTERVAL;


typedef struct st_known_date_time_format {
  const char *format_name;
  const char *date_format;
  const char *datetime_format;
  const char *time_format;
} KNOWN_DATE_TIME_FORMAT;

extern const char *show_comp_option_name[];

typedef int *(*update_var)(THD *, struct st_mysql_show_var *);

struct USER_AUTH : public Sql_alloc
{
  LEX_CSTRING plugin, auth_str, pwtext;
  USER_AUTH *next;
  USER_AUTH() : next(NULL)
  {
    plugin.str= auth_str.str= "";
    pwtext.str= NULL;
    plugin.length= auth_str.length= pwtext.length= 0;
  }
};

struct AUTHID
{
  LEX_CSTRING user, host;
  void init() { memset(this, 0, sizeof(*this)); }
  void copy(MEM_ROOT *root, const LEX_CSTRING *usr, const LEX_CSTRING *host);
  bool is_role() const { return user.str[0] && (!host.str || !host.str[0]); }
  void set_lex_string(LEX_CSTRING *l, char *buf)
  {
    if (is_role())
      *l= user;
    else
    {
      l->str= buf;
      l->length= strxmov(buf, user.str, "@", host.str, NullS) - buf;
    }
  }
  void parse(const char *str, size_t length);
  bool read_from_mysql_proc_row(THD *thd, TABLE *table);
};


struct LEX_USER: public AUTHID
{
  USER_AUTH *auth;
  bool has_auth()
  {
    return auth && (auth->plugin.length || auth->auth_str.length || auth->pwtext.length);
  }
};

/*
  This structure specifies the maximum amount of resources which
  can be consumed by each account. Zero value of a member means
  there is no limit.
*/
typedef struct user_resources {
  /* Maximum number of queries/statements per hour. */
  uint questions;
  /*
     Maximum number of updating statements per hour (which statements are
     updating is defined by sql_command_flags array).
  */
  uint updates;
  /* Maximum number of connections established per hour. */
  uint conn_per_hour;
  /*
    Maximum number of concurrent connections. If -1 then no new
    connections allowed
  */
  int user_conn;
  /* Max query timeout */
  double max_statement_time;

  /*
     Values of this enum and specified_limits member are used by the
     parser to store which user limits were specified in GRANT statement.
  */
  enum {QUERIES_PER_HOUR= 1, UPDATES_PER_HOUR= 2, CONNECTIONS_PER_HOUR= 4,
        USER_CONNECTIONS= 8, MAX_STATEMENT_TIME= 16};
  uint specified_limits;
} USER_RESOURCES;


/*
  This structure is used for counting resources consumed and for checking
  them against specified user limits.
*/
typedef struct  user_conn {
  /*
     Pointer to user+host key (pair separated by '\0') defining the entity
     for which resources are counted (By default it is user account thus
     priv_user/priv_host pair is used. If --old-style-user-limits option
     is enabled, resources are counted for each user+host separately).
  */
  char *user;
  /* Pointer to host part of the key. */
  char *host;
  /**
     The moment of time when per hour counters were reset last time
     (i.e. start of "hour" for conn_per_hour, updates, questions counters).
  */
  ulonglong reset_utime;
  /* Total length of the key. */
  uint len;
  /* Current amount of concurrent connections for this account. */
  int connections;
  /*
     Current number of connections per hour, number of updating statements
     per hour and total number of statements per hour for this account.
  */
  uint conn_per_hour, updates, questions;
  /* Maximum amount of resources which account is allowed to consume. */
  USER_RESOURCES user_resources;
} USER_CONN;

typedef struct st_user_stats
{
  char user[MY_MAX(USERNAME_LENGTH, LIST_PROCESS_HOST_LEN) + 1];
  // Account name the user is mapped to when this is a user from mapped_user.
  // Otherwise, the same value as user.
  char priv_user[MY_MAX(USERNAME_LENGTH, LIST_PROCESS_HOST_LEN) + 1];
  uint user_name_length;
  uint total_connections;
  uint total_ssl_connections;
  uint concurrent_connections;
  time_t connected_time;  // in seconds
  ha_rows rows_read, rows_sent;
  ha_rows rows_updated, rows_deleted, rows_inserted;
  ulonglong bytes_received;
  ulonglong bytes_sent;
  ulonglong binlog_bytes_written;
  ulonglong select_commands, update_commands, other_commands;
  ulonglong commit_trans, rollback_trans;
  ulonglong denied_connections, lost_connections, max_statement_time_exceeded;
  ulonglong access_denied_errors;
  ulonglong empty_queries;
  double busy_time;       // in seconds
  double cpu_time;        // in seconds
} USER_STATS;

typedef struct st_table_stats
{
  char table[NAME_LEN * 2 + 2];  // [db] + '\0' + [table] + '\0'
  size_t table_name_length;
  ulonglong rows_read, rows_changed;
  ulonglong rows_changed_x_indexes;
  /* Stores enum db_type, but forward declarations cannot be done */
  int engine_type;
} TABLE_STATS;

typedef struct st_index_stats
{
  // [db] + '\0' + [table] + '\0' + [index] + '\0'
  char index[NAME_LEN * 3 + 3];
  size_t index_name_length;                       /* Length of 'index' */
  ulonglong rows_read;
} INDEX_STATS;


	/* Bits in form->update */
#define REG_MAKE_DUPP		1U	/* Make a copy of record when read */
#define REG_NEW_RECORD		2U	/* Write a new record if not found */
#define REG_UPDATE		4U	/* Uppdate record */
#define REG_DELETE		8U	/* Delete found record */
#define REG_PROG		16U	/* User is updating database */
#define REG_CLEAR_AFTER_WRITE	32U
#define REG_MAY_BE_UPDATED	64U
#define REG_AUTO_UPDATE		64U	/* Used in D-forms for scroll-tables */
#define REG_OVERWRITE		128U
#define REG_SKIP_DUP		256U

	/* Bits in form->status */
#define STATUS_NO_RECORD	(1U+2U)	/* Record isn't usable */
#define STATUS_GARBAGE		1U
#define STATUS_NOT_FOUND	2U	/* No record in database when needed */
#define STATUS_NO_PARENT	4U	/* Parent record wasn't found */
#define STATUS_NOT_READ		8U	/* Record isn't read */
#define STATUS_UPDATED		16U	/* Record is updated by formula */
#define STATUS_NULL_ROW		32U	/* table->null_row is set */
#define STATUS_DELETED		64U

/*
  Such interval is "discrete": it is the set of
  { auto_inc_interval_min + k * increment,
    0 <= k <= (auto_inc_interval_values-1) }
  Where "increment" is maintained separately by the user of this class (and is
  currently only thd->variables.auto_increment_increment).
  It mustn't derive from Sql_alloc, because SET INSERT_ID needs to
  allocate memory which must stay allocated for use by the next statement.
*/
class Discrete_interval {
private:
  ulonglong interval_min;
  ulonglong interval_values;
  ulonglong  interval_max;    // excluded bound. Redundant.
public:
  Discrete_interval *next;    // used when linked into Discrete_intervals_list
  void replace(ulonglong start, ulonglong val, ulonglong incr)
  {
    interval_min=    start;
    interval_values= val;
    interval_max=    (val == ULONGLONG_MAX) ? val : start + val * incr;
  }
  Discrete_interval(ulonglong start, ulonglong val, ulonglong incr) :
    next(NULL) { replace(start, val, incr); };
  Discrete_interval() : next(NULL) { replace(0, 0, 0); };
  ulonglong minimum() const { return interval_min;    };
  ulonglong values()  const { return interval_values; };
  ulonglong maximum() const { return interval_max;    };
  /*
    If appending [3,5] to [1,2], we merge both in [1,5] (they should have the
    same increment for that, user of the class has to ensure that). That is
    just a space optimization. Returns 0 if merge succeeded.
  */
  bool merge_if_contiguous(ulonglong start, ulonglong val, ulonglong incr)
  {
    if (interval_max == start)
    {
      if (val == ULONGLONG_MAX)
      {
        interval_values=   interval_max= val;
      }
      else
      {
        interval_values+=  val;
        interval_max=      start + val * incr;
      }
      return 0;
    }
    return 1;
  };
};

/* List of Discrete_interval objects */
class Discrete_intervals_list {
private:
  Discrete_interval        *head;
  Discrete_interval        *tail;
  /*
    When many intervals are provided at the beginning of the execution of a
    statement (in a replication slave or SET INSERT_ID), "current" points to
    the interval being consumed by the thread now (so "current" goes from
    "head" to "tail" then to NULL).
  */
  Discrete_interval        *current;
  uint                  elements; // number of elements
  void set_members(Discrete_interval *h, Discrete_interval *t,
                   Discrete_interval *c, uint el)
  {  
    head= h;
    tail= t;
    current= c;
    elements= el;
  }
  void operator=(Discrete_intervals_list &);  /* prevent use of these */
  Discrete_intervals_list(const Discrete_intervals_list &);

public:
  Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {};
  void empty_no_free()
  {
    set_members(NULL, NULL, NULL, 0);
  }
  void empty()
  {
    for (Discrete_interval *i= head; i;)
    {
      Discrete_interval *next= i->next;
      delete i;
      i= next;
    }
    empty_no_free();
  }
  void copy_shallow(const Discrete_intervals_list * dli)
  {
    head= dli->get_head();
    tail= dli->get_tail();
    current= dli->get_current();
    elements= dli->nb_elements();
  }
  void swap (Discrete_intervals_list * dli)
  {
    Discrete_interval *h, *t, *c;
    uint el;
    h= dli->get_head();
    t= dli->get_tail();
    c= dli->get_current();
    el= dli->nb_elements();
    dli->copy_shallow(this);
    set_members(h, t, c, el);
  }
  const Discrete_interval* get_next()
  {
    Discrete_interval *tmp= current;
    if (current != NULL)
      current= current->next;
    return tmp;
  }
  ~Discrete_intervals_list() { empty(); };
  bool append(ulonglong start, ulonglong val, ulonglong incr);
  bool append(Discrete_interval *interval);
  ulonglong minimum()     const { return (head ? head->minimum() : 0); };
  ulonglong maximum()     const { return (head ? tail->maximum() : 0); };
  uint      nb_elements() const { return elements; }
  Discrete_interval* get_head() const { return head; };
  Discrete_interval* get_tail() const { return tail; };
  Discrete_interval* get_current() const { return current; };
};


/*
  DDL options:
  - CREATE IF NOT EXISTS
  - DROP IF EXISTS
  - CREATE LIKE
  - REPLACE
*/
struct DDL_options_st
{
public:
  enum Options
  {
    OPT_NONE= 0,
    OPT_IF_NOT_EXISTS= 2,              // CREATE TABLE IF NOT EXISTS
    OPT_LIKE= 4,                       // CREATE TABLE LIKE
    OPT_OR_REPLACE= 16,                // CREATE OR REPLACE TABLE
    OPT_OR_REPLACE_SLAVE_GENERATED= 32,// REPLACE was added on slave, it was
                                       // not in the original query on master.
    OPT_IF_EXISTS= 64,
    OPT_CREATE_SELECT= 128             // CREATE ... SELECT
  };

private:
  Options m_options;

public:
  Options create_like_options() const
  {
    return (DDL_options_st::Options)
           (((uint) m_options) & (OPT_IF_NOT_EXISTS | OPT_OR_REPLACE));
  }
  void init() { m_options= OPT_NONE; }
  void init(Options options) { m_options= options; }
  void set(Options other)
  {
    m_options= other;
  }
  void set(const DDL_options_st other)
  {
    m_options= other.m_options;
  }
  bool if_not_exists() const { return m_options & OPT_IF_NOT_EXISTS; }
  bool or_replace() const { return m_options & OPT_OR_REPLACE; }
  bool or_replace_slave_generated() const
  { return m_options & OPT_OR_REPLACE_SLAVE_GENERATED; }
  bool like() const { return m_options & OPT_LIKE; }
  bool if_exists() const { return m_options & OPT_IF_EXISTS; }
  bool is_create_select() const { return m_options & OPT_CREATE_SELECT; }

  void add(const DDL_options_st::Options other)
  {
    m_options= (Options) ((uint) m_options | (uint) other);
  }
  void add(const DDL_options_st &other)
  {
    add(other.m_options);
  }
  DDL_options_st operator|(const DDL_options_st &other)
  {
    add(other.m_options);
    return *this;
  }
  DDL_options_st operator|=(DDL_options_st::Options other)
  {
    add(other);
    return *this;
  }
};


class DDL_options: public DDL_options_st
{
public:
  DDL_options() { init(); }
  DDL_options(Options options) { init(options); }
  DDL_options(const DDL_options_st &options)
  { DDL_options_st::operator=(options); }
};


struct Lex_length_and_dec_st
{
private:
  const char *m_length;
  const char *m_dec;
public:
  void set(const char *length, const char *dec)
  {
    m_length= length;
    m_dec= dec;
  }
  const char *length() const { return m_length; }
  const char *dec() const { return m_dec; }
};


struct Lex_field_type_st: public Lex_length_and_dec_st
{
private:
  const Type_handler *m_handler;
  void set(const Type_handler *handler, const char *length, const char *dec)
  {
    m_handler= handler;
    Lex_length_and_dec_st::set(length, dec);
  }
public:
  void set(const Type_handler *handler, Lex_length_and_dec_st length_and_dec)
  {
    m_handler= handler;
    Lex_length_and_dec_st::operator=(length_and_dec);
  }
  void set_handler_length_flags(const Type_handler *handler, const char *length,
                                uint32 flags);
  void set(const Type_handler *handler, const char *length)
  {
    set(handler, length, 0);
  }
  void set(const Type_handler *handler)
  {
    set(handler, 0, 0);
  }
  void set_handler(const Type_handler *handler)
  {
    m_handler= handler;
  }
  const Type_handler *type_handler() const { return m_handler; }
};


struct Lex_dyncol_type_st: public Lex_length_and_dec_st
{
private:
  int m_type; // enum_dynamic_column_type is not visible here, so use int
public:
  void set(int type, const char *length, const char *dec)
  {
    m_type= type;
    Lex_length_and_dec_st::set(length, dec);
  }
  void set(int type, Lex_length_and_dec_st length_and_dec)
  {
    m_type= type;
    Lex_length_and_dec_st::operator=(length_and_dec);
  }
  void set(int type, const char *length)
  {
    set(type, length, 0);
  }
  void set(int type)
  {
    set(type, 0, 0);
  }
  int dyncol_type() const { return m_type; }
};


struct Lex_spblock_handlers_st
{
public:
  int hndlrs;
  void init(int count) { hndlrs= count; }
};


struct Lex_spblock_st: public Lex_spblock_handlers_st
{
public:
  int vars;
  int conds;
  int curs;
  void init()
  {
    vars= conds= hndlrs= curs= 0;
  }
  void init_using_vars(uint nvars)
  {
    vars= nvars;
    conds= hndlrs= curs= 0;
  }
  void join(const Lex_spblock_st &b1, const Lex_spblock_st &b2)
  {
    vars= b1.vars + b2.vars;
    conds= b1.conds + b2.conds;
    hndlrs= b1.hndlrs + b2.hndlrs;
    curs= b1.curs + b2.curs;
  }
};


class Lex_spblock: public Lex_spblock_st
{
public:
  Lex_spblock() { init(); }
  Lex_spblock(const Lex_spblock_handlers_st &other)
  {
    vars= conds= curs= 0;
    hndlrs= other.hndlrs;
  }
};


struct Lex_for_loop_bounds_st
{
public:
  class sp_assignment_lex *m_index;  // The first iteration value (or cursor)
  class sp_assignment_lex *m_target_bound; // The last iteration value
  int8 m_direction;
  bool m_implicit_cursor;
  bool is_for_loop_cursor() const { return m_target_bound == NULL; }
};


class Lex_for_loop_bounds_intrange: public Lex_for_loop_bounds_st
{
public:
  Lex_for_loop_bounds_intrange(int8 direction,
                               class sp_assignment_lex *left_expr,
                               class sp_assignment_lex *right_expr)
  {
    m_direction= direction;
    m_index=        direction > 0 ? left_expr  : right_expr;
    m_target_bound= direction > 0 ? right_expr : left_expr;
    m_implicit_cursor= false;
  }
};


struct Lex_for_loop_st
{
public:
  class sp_variable *m_index;  // The first iteration value (or cursor)
  class sp_variable *m_target_bound; // The last iteration value
  int m_cursor_offset;
  int8 m_direction;
  bool m_implicit_cursor;
  void init()
  {
    m_index= 0;
    m_target_bound= 0;
    m_cursor_offset= 0;
    m_direction= 0;
    m_implicit_cursor= false;
  }
  bool is_for_loop_cursor() const { return m_target_bound == NULL; }
  bool is_for_loop_explicit_cursor() const
  {
    return is_for_loop_cursor() && !m_implicit_cursor;
  }
};


enum trim_spec { TRIM_LEADING, TRIM_TRAILING, TRIM_BOTH };

struct Lex_trim_st
{
  Item *m_remove;
  Item *m_source;
  trim_spec m_spec;
public:
  void set(trim_spec spec, Item *remove, Item *source)
  {
    m_spec= spec;
    m_remove= remove;
    m_source= source;
  }
  void set(trim_spec spec, Item *source)
  {
    set(spec, NULL, source);
  }
  Item *make_item_func_trim_std(THD *thd) const;
  Item *make_item_func_trim_oracle(THD *thd) const;
};


class Lex_trim: public Lex_trim_st
{
public:
  Lex_trim(trim_spec spec, Item *source) { set(spec, source); }
};


class Lex_substring_spec_st
{
public:
  Item *m_subject;
  Item *m_from;
  Item *m_for;
  static Lex_substring_spec_st init(Item *subject,
                                    Item *from,
                                    Item *xfor= NULL)
  {
    Lex_substring_spec_st res;
    res.m_subject= subject;
    res.m_from= from;
    res.m_for= xfor;
    return res;
  }
};


class st_select_lex;

class Lex_select_lock
{
public:
  struct
  {
    uint defined_lock:1;
    uint update_lock:1;
    uint defined_timeout:1;
    uint skip_locked:1;
  };
  ulong timeout;


  void empty()
  {
    defined_lock= update_lock= defined_timeout= skip_locked= FALSE;
    timeout= 0;
  }
  void set_to(st_select_lex *sel);
};

class Lex_select_limit
{
public:
  /* explicit LIMIT clause was used */
  bool explicit_limit;
  bool with_ties;
  Item *select_limit, *offset_limit;

  void clear()
  {
    explicit_limit= FALSE;    // No explicit limit given by user
    with_ties= FALSE;         // No use of WITH TIES operator
    select_limit= NULL;       // denotes the default limit = HA_POS_ERROR
    offset_limit= NULL;       // denotes the default offset = 0
  }
};

struct st_order;

class Load_data_param
{
protected:
  CHARSET_INFO *m_charset;   // Character set of the file
  ulonglong m_fixed_length;  // Sum of target field lengths for fixed format
  bool m_is_fixed_length;
  bool m_use_blobs;
public:
  Load_data_param(CHARSET_INFO *cs, bool is_fixed_length):
    m_charset(cs),
    m_fixed_length(0),
    m_is_fixed_length(is_fixed_length),
    m_use_blobs(false)
  { }
  bool add_outvar_field(THD *thd, const Field *field);
  bool add_outvar_user_var(THD *thd);
  CHARSET_INFO *charset() const { return m_charset; }
  bool is_fixed_length() const { return m_is_fixed_length; }
  bool use_blobs() const { return m_use_blobs; }
};


class Load_data_outvar
{
public:
  virtual ~Load_data_outvar() = default;
  virtual bool load_data_set_null(THD *thd, const Load_data_param *param)= 0;
  virtual bool load_data_set_value(THD *thd, const char *pos, uint length,
                                   const Load_data_param *param)= 0;
  virtual bool load_data_set_no_data(THD *thd, const Load_data_param *param)= 0;
  virtual void load_data_print_for_log_event(THD *thd, class String *to) const= 0;
  virtual bool load_data_add_outvar(THD *thd, Load_data_param *param) const= 0;
  virtual uint load_data_fixed_length() const= 0;
};


class Timeval: public timeval
{
protected:
  Timeval() = default;
public:
  Timeval(my_time_t sec, ulong usec)
  {
    tv_sec= sec;
    /*
      Since tv_usec is not always of type ulong, cast usec parameter
      explicitly to uint to avoid compiler warnings about losing
      integer precision.
    */
    DBUG_ASSERT(usec < 1000000);
    tv_usec= (uint)usec;
  }
  explicit Timeval(const timeval &tv)
   :timeval(tv)
  { }
};


#endif /* STRUCTS_INCLUDED */
server/private/init.h000064400000001524150400263740010643 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef INIT_INCLUDED
#define INIT_INCLUDED

void unireg_init(ulong options);

#endif /* INIT_INCLUDED */
server/private/sql_get_diagnostics.h000064400000017273150400263740013735 0ustar00/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_GET_DIAGNOSTICS_H
#define SQL_GET_DIAGNOSTICS_H

/** Diagnostics information forward reference. */
class Diagnostics_information;


/**
  Sql_cmd_get_diagnostics represents a GET DIAGNOSTICS statement.

  The GET DIAGNOSTICS statement retrieves exception or completion
  condition information from a diagnostics area, usually pertaining
  to the last non-diagnostic SQL statement that was executed.
*/
class Sql_cmd_get_diagnostics : public Sql_cmd
{
public:
  /**
    Constructor, used to represent a GET DIAGNOSTICS statement.

    @param info Diagnostics information to be obtained.
  */
  Sql_cmd_get_diagnostics(Diagnostics_information *info)
    : m_info(info)
  {}

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_GET_DIAGNOSTICS;
  }

  bool execute(THD *thd) override;

private:
  /** The information to be obtained. */
  Diagnostics_information *m_info;
};


/**
  Represents the diagnostics information to be obtained.

  Diagnostic information is made available through statement
  information and condition information items.
*/
class Diagnostics_information : public Sql_alloc
{
public:
  /**
    Which diagnostics area to access.
    Only CURRENT is supported for now.
  */
  enum Which_area
  {
    /** Access the first diagnostics area. */
    CURRENT_AREA
  };

  /** Set which diagnostics area to access. */
  void set_which_da(Which_area area)
  { m_area= area; }

  /** Get which diagnostics area to access. */
  Which_area get_which_da(void) const
  { return m_area; }

  /**
    Aggregate diagnostics information.

    @param thd  The current thread.
    @param da   The diagnostics area.

    @retval false on success.
    @retval true on error
  */
  virtual bool aggregate(THD *thd, const Diagnostics_area *da) = 0;

protected:
  /**
    Diagnostics_information objects are allocated in thd->mem_root.
    Do not rely on the destructor for any cleanup.
  */
  virtual ~Diagnostics_information()
  {
    DBUG_ASSERT(false);
  }

  /**
    Evaluate a diagnostics information item in a specific context.

    @param thd        The current thread.
    @param diag_item  The diagnostics information item.
    @param ctx        The context to evaluate the item.

    @retval false on success.
    @retval true on error.
  */
  template <typename Diag_item, typename Context>
  bool evaluate(THD *thd, Diag_item *diag_item, Context ctx)
  {
    Item *value;

    /* Get this item's value. */
    if (! (value= diag_item->get_value(thd, ctx)))
      return true;

    /* Set variable/parameter value. */
    return diag_item->set_value(thd, &value);
  }

private:
  /** Which diagnostics area to access. */
  Which_area m_area;
};


/**
  A diagnostics information item. Used to associate a specific
  diagnostics information item to a target variable.
*/
class Diagnostics_information_item : public Sql_alloc
{
public:
  /**
    Set a value for this item.

    @param thd    The current thread.
    @param value  The obtained value.

    @retval false on success.
    @retval true on error.
  */
  bool set_value(THD *thd, Item **value);

protected:
  /**
    Constructor, used to represent a diagnostics information item.

    @param target A target that gets the value of this item.
  */
  Diagnostics_information_item(Item *target)
    : m_target(target)
  {}

  /**
    Diagnostics_information_item objects are allocated in thd->mem_root.
    Do not rely on the destructor for any cleanup.
  */
  virtual ~Diagnostics_information_item()
  {
    DBUG_ASSERT(false);
  }

private:
  /** The target variable that will receive the value of this item. */
  Item *m_target;
};


/**
  A statement information item.
*/
class Statement_information_item : public Diagnostics_information_item
{
public:
  /** The name of a statement information item. */
  enum Name
  {
    NUMBER,
    ROW_COUNT
  };

  /**
    Constructor, used to represent a statement information item.

    @param name   The name of this item.
    @param target A target that gets the value of this item.
  */
  Statement_information_item(Name name, Item *target)
    : Diagnostics_information_item(target), m_name(name)
  {}

  /** Obtain value of this statement information item. */
  Item *get_value(THD *thd, const Diagnostics_area *da);

private:
  /** The name of this statement information item. */
  Name m_name;
};


/**
  Statement information.

  @remark Provides information about the execution of a statement.
*/
class Statement_information : public Diagnostics_information
{
public:
  /**
    Constructor, used to represent the statement information of a
    GET DIAGNOSTICS statement.

    @param items  List of requested statement information items.
  */
  Statement_information(List<Statement_information_item> *items)
    : m_items(items)
  {}

  /** Obtain statement information in the context of a diagnostics area. */
  bool aggregate(THD *thd, const Diagnostics_area *da) override;

private:
  /* List of statement information items. */
  List<Statement_information_item> *m_items;
};


/**
  A condition information item.
*/
class Condition_information_item : public Diagnostics_information_item
{
public:
  /**
    The name of a condition information item.
  */
  enum Name
  {
    CLASS_ORIGIN,
    SUBCLASS_ORIGIN,
    CONSTRAINT_CATALOG,
    CONSTRAINT_SCHEMA,
    CONSTRAINT_NAME,
    CATALOG_NAME,
    SCHEMA_NAME,
    TABLE_NAME,
    COLUMN_NAME,
    CURSOR_NAME,
    MESSAGE_TEXT,
    MYSQL_ERRNO,
    RETURNED_SQLSTATE
  };

  /**
    Constructor, used to represent a condition information item.

    @param name   The name of this item.
    @param target A target that gets the value of this item.
  */
  Condition_information_item(Name name, Item *target)
    : Diagnostics_information_item(target), m_name(name)
  {}

  /** Obtain value of this condition information item. */
  Item *get_value(THD *thd, const Sql_condition *cond);

private:
  /** The name of this condition information item. */
  Name m_name;

  /** Create an string item to represent a condition item string. */
  Item *make_utf8_string_item(THD *thd, const String *str);
};


/**
  Condition information.

  @remark Provides information about conditions raised during the
          execution of a statement.
*/
class Condition_information : public Diagnostics_information
{
public:
  /**
    Constructor, used to represent the condition information of a
    GET DIAGNOSTICS statement.

    @param cond_number_expr Number that identifies the diagnostic condition.
    @param items List of requested condition information items.
  */
  Condition_information(Item *cond_number_expr,
                        List<Condition_information_item> *items)
    : m_cond_number_expr(cond_number_expr), m_items(items)
  {}

  /** Obtain condition information in the context of a diagnostics area. */
  bool aggregate(THD *thd, const Diagnostics_area *da) override;

private:
  /**
    Number that identifies the diagnostic condition for which
    information is to be obtained.
  */
  Item *m_cond_number_expr;

  /** List of condition information items. */
  List<Condition_information_item> *m_items;
};

#endif

server/private/sql_bitmap.h000064400000017245150400263740012042 0ustar00/* Copyright (c) 2003, 2013, Oracle and/or its affiliates
   Copyright (c) 2009, 2013, Monty Program Ab.

   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 */

/*
  Implementation of a bitmap type.
  The idea with this is to be able to handle any constant number of bits but
  also be able to use 32 or 64 bits bitmaps very efficiently
*/

#ifndef SQL_BITMAP_INCLUDED
#define SQL_BITMAP_INCLUDED

#include <my_sys.h>
#include <my_bitmap.h>
#include <my_bit.h>


/* An iterator to quickly walk over bits in ulonglong bitmap. */
class Table_map_iterator
{
  ulonglong bmp;
public:
  Table_map_iterator(ulonglong t): bmp(t){}
  uint next_bit()
  {
    if (!bmp)
      return BITMAP_END;
    uint bit= my_find_first_bit(bmp);
    bmp &= ~(1ULL << bit);
    return bit;
  }
  int operator++(int) { return next_bit(); }
  enum { BITMAP_END= 64 };
};

template <uint width> class Bitmap
{
/*
  Workaround GCC optimizer bug (generating SSE instuctions on unaligned data)
*/
#if defined (__GNUC__) && defined(__x86_64__) && (__GNUC__ < 6) && !defined(__clang__)
#define NEED_GCC_NO_SSE_WORKAROUND
#endif

#ifdef NEED_GCC_NO_SSE_WORKAROUND
#pragma GCC push_options
#pragma GCC target ("no-sse")
#endif

private:
  static const int BITS_PER_ELEMENT= sizeof(ulonglong) * 8;
  static const int ARRAY_ELEMENTS= (width + BITS_PER_ELEMENT - 1) / BITS_PER_ELEMENT;
  static const ulonglong ALL_BITS_SET= ULLONG_MAX;

  ulonglong buffer[ARRAY_ELEMENTS];

  uint bit_index(uint n) const
  {
    DBUG_ASSERT(n < width);
    return ARRAY_ELEMENTS == 1 ? 0 : n / BITS_PER_ELEMENT;
  }
  ulonglong bit_mask(uint n) const
  {
    DBUG_ASSERT(n < width);
    return ARRAY_ELEMENTS == 1 ? 1ULL << n : 1ULL << (n % BITS_PER_ELEMENT);
  }
  ulonglong last_element_mask(int n) const
  {
    DBUG_ASSERT(n % BITS_PER_ELEMENT != 0);
    return bit_mask(n) - 1;
  }

public:
  /*
   The default constructor does nothing.
   The caller is supposed to either zero the memory
   or to call set_all()/clear_all()/set_prefix()
   to initialize bitmap.
  */
  Bitmap() = default;

  explicit Bitmap(uint prefix)
  {
    set_prefix(prefix);
  }
  void init(uint prefix)
  {
    set_prefix(prefix);
  }
  uint length() const
  {
    return width;
  }
  void set_bit(uint n)
  {
    buffer[bit_index(n)] |= bit_mask(n);
  }
  void clear_bit(uint n)
  {
    buffer[bit_index(n)] &= ~bit_mask(n);
  }
  bool is_set(uint n) const
  {
    return buffer[bit_index(n)] & bit_mask(n);
  }
  void set_prefix(uint prefix_size)
  {
    set_if_smaller(prefix_size, width);

    size_t idx= prefix_size / BITS_PER_ELEMENT;

    for (size_t i= 0; i < idx; i++)
      buffer[i]= ALL_BITS_SET;

    if (prefix_size % BITS_PER_ELEMENT)
      buffer[idx++]= last_element_mask(prefix_size);

    for (size_t i= idx; i < ARRAY_ELEMENTS; i++)
      buffer[i]= 0;
  }
  bool is_prefix(uint prefix_size) const
  {
    DBUG_ASSERT(prefix_size <= width);

    size_t idx= prefix_size / BITS_PER_ELEMENT;

    for (size_t i= 0; i < idx; i++)
      if (buffer[i] != ALL_BITS_SET)
        return false;

    if (prefix_size % BITS_PER_ELEMENT)
      if (buffer[idx++] != last_element_mask(prefix_size))
        return false;

    for (size_t i= idx; i < ARRAY_ELEMENTS; i++)
      if (buffer[i] != 0)
        return false;

    return true;
  }
  void set_all()
  {
    if (width % BITS_PER_ELEMENT)
      set_prefix(width);
    else if (ARRAY_ELEMENTS > 1)
      memset(buffer, 0xff, sizeof(buffer));
    else
      buffer[0] = ALL_BITS_SET;
  }
  void clear_all()
  {
    if (ARRAY_ELEMENTS > 1)
      memset(buffer, 0, sizeof(buffer));
    else
      buffer[0]= 0;
  }
  void intersect(const Bitmap& map2)
  {
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      buffer[i] &= map2.buffer[i];
  }

private:
  /*
     Intersect with a bitmap represented as as longlong.
     In addition, pad the rest of the bitmap with 0 or 1 bits
     depending on pad_with_ones parameter.
  */
  void intersect_and_pad(ulonglong map2buff, bool pad_with_ones)
  {
    buffer[0] &= map2buff;

    for (size_t i= 1; i < ARRAY_ELEMENTS; i++)
      buffer[i]= pad_with_ones ? ALL_BITS_SET : 0;

    if (ARRAY_ELEMENTS > 1 && (width % BITS_PER_ELEMENT) && pad_with_ones)
      buffer[ARRAY_ELEMENTS - 1]= last_element_mask(width);
  }

public:
  void intersect(ulonglong map2buff)
  {
    intersect_and_pad(map2buff, 0);
  }
  /* Use highest bit for all bits above first element. */
  void intersect_extended(ulonglong map2buff)
  {
    intersect_and_pad(map2buff, (map2buff & (1ULL << 63)));
  }
  void subtract(const Bitmap& map2)
  {
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      buffer[i] &= ~(map2.buffer[i]);
  }
  void merge(const Bitmap& map2)
  {
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      buffer[i] |= map2.buffer[i];
  }
  bool is_clear_all() const
  {
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      if (buffer[i])
        return false;
    return true;
  }
  bool is_subset(const Bitmap& map2) const
  {
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      if (buffer[i] & ~(map2.buffer[i]))
        return false;
    return true;
  }
  bool is_overlapping(const Bitmap& map2) const
  {
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      if (buffer[i] & map2.buffer[i])
        return true;
    return false;
  }
  bool operator==(const Bitmap& map2) const
  {
    if (ARRAY_ELEMENTS > 1)
      return !memcmp(buffer,map2.buffer,sizeof(buffer));
    return buffer[0] == map2.buffer[0];
  }
  bool operator!=(const Bitmap& map2) const
  {
    return !(*this == map2);
  }
  /*
    Print hexadecimal representation of bitmap.
    Truncate trailing zeros.
  */
  char *print(char *buf) const
  {
    size_t last; /*index of the last non-zero element, or 0. */

    for (last= ARRAY_ELEMENTS - 1; last && !buffer[last]; last--){}

    const int HEX_DIGITS_PER_ELEMENT= BITS_PER_ELEMENT / 4;
    for (size_t i= 0; i < last; i++)
    {
      ulonglong num = buffer[i];
      uint shift = BITS_PER_ELEMENT - 4;
      size_t pos= i * HEX_DIGITS_PER_ELEMENT;
      for (size_t j= 0; j < HEX_DIGITS_PER_ELEMENT; j++)
      {
        buf[pos + j]= _dig_vec_upper[(num >> shift) & 0xf];
        shift += 4;
      }
    }
    longlong2str(buffer[last], buf, 16);
    return buf;
  }
  ulonglong to_ulonglong() const
  {
    return buffer[0];
  }
  uint bits_set()
  {
    uint res= 0;
    for (size_t i= 0; i < ARRAY_ELEMENTS; i++)
      res += my_count_bits(buffer[i]);
    return res;
  }
  class Iterator
  {
    const Bitmap& map;
    uint offset;
    Table_map_iterator tmi;
  public:
    Iterator(const Bitmap<width>& map2) : map(map2), offset(0), tmi(map2.buffer[0]) {}
    int operator++(int)
    {
      for (;;)
      {
        int nextbit= tmi++;

        if (nextbit != Table_map_iterator::BITMAP_END)
          return offset + nextbit;

        if (offset + BITS_PER_ELEMENT >= map.length())
          return BITMAP_END;

        offset += BITS_PER_ELEMENT;
        tmi= Table_map_iterator(map.buffer[offset / BITS_PER_ELEMENT]);
      }
    }
    enum { BITMAP_END = width };
  };

#ifdef NEED_GCC_NO_SSE_WORKAROUND
#pragma GCC pop_options
#undef NEED_GCC_NO_SSE_WORKAROUND
#endif
};

typedef Bitmap<MAX_INDEXES> key_map; /* Used for finding keys */

#endif /* SQL_BITMAP_INCLUDED */
server/private/mysqld_default_groups.h000064400000000314150400263740014310 0ustar00const char *load_default_groups[]= {
"mysqld", "server", MYSQL_BASE_VERSION,
"mariadb", MARIADB_BASE_VERSION,
"mariadbd", MARIADBD_BASE_VERSION,
"client-server",
#ifdef WITH_WSREP
"galera",
#endif
0, 0};
server/private/select_handler.h000064400000004264150400263740012660 0ustar00/*
   Copyright (c) 2018, 2019 MariaDB

   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-1301  USA */

#ifndef SELECT_HANDLER_INCLUDED
#define SELECT_HANDLER_INCLUDED

#include "mariadb.h"
#include "sql_priv.h"

/**
  @class select_handler

  This interface class is to be used for execution of select queries
  by foreign engines
*/

class select_handler
{
 public:
  THD *thd;
  handlerton *ht;

  SELECT_LEX *select;  // Select to be excuted

  /*
    Temporary table where all results should be stored in record[0]
    The table has a field for every item from the select_lex::item_list.
    The table is actually never filled. Only its record buffer is used.
  */
  TABLE *table;
  List<Item> result_columns;

  bool is_analyze;

  bool send_result_set_metadata();
  bool send_data();

  select_handler(THD *thd_arg, handlerton *ht_arg);

  virtual ~select_handler();

  int execute();

  virtual bool prepare();

  static TABLE *create_tmp_table(THD *thd, SELECT_LEX *sel);

protected:
  /*
    Functions to scan the select result set.
    All these returns 0 if ok, error code in case of error.
  */

  /* Initialize the process of producing rows of result set */
  virtual int init_scan() = 0;

  /*
    Put the next produced row of the result set in table->record[0]
    and return 0. Return HA_ERR_END_OF_FILE if there are no more rows,
    return other error number in case of fatal error.
  */
  virtual int next_row() = 0;

  /* Finish scanning */
  virtual int end_scan() = 0;

  /* Report errors */
  virtual void print_error(int error, myf errflag);

  bool send_eof();
};

#endif /* SELECT_HANDLER_INCLUDED */
server/private/sql_analyse.h000064400000025565150400263740012226 0ustar00#ifndef SQL_ANALYSE_INCLUDED
#define SQL_ANALYSE_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */


/* Analyse database */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface				/* gcc class implementation */
#endif

#include "procedure.h"                          /* Procedure */

#define my_thd_charset	default_charset_info

#define DEC_IN_AVG 4

typedef struct st_number_info
{
  // if zerofill is true, the number must be zerofill, or string
  bool	    negative, is_float, zerofill, maybe_zerofill;
  int8	    integers;
  int8	    decimals;
  double    dval;
  ulonglong ullval;
} NUM_INFO;

typedef struct st_extreme_value_number_info
{
  ulonglong ullval;
  longlong  llval;
  double    max_dval, min_dval;
} EV_NUM_INFO;

typedef struct st_tree_info
{
  bool	 found;
  String *str;
  Item	 *item;
} TREE_INFO;

uint check_ulonglong(const char *str, uint length);
bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num);
bool test_if_number(NUM_INFO *info, const char *str, uint str_len);
int compare_double(const double *s, const double *t);
int compare_double2(void *, const void *s, const void *t);
int compare_longlong(const longlong *s, const longlong *t);
int compare_longlong2(void *, const void *s, const void *t);
int compare_ulonglong(const ulonglong *s, const ulonglong *t);
int compare_ulonglong2(void *, const void *s, const void *t);
int compare_decimal2(void *len, const void *s, const void *t);
Procedure *proc_analyse_init(THD *thd, ORDER *param, select_result *result,
			     List<Item> &field_list);
int free_string(void* str, TREE_FREE, void*);
class analyse;

class field_info :public Sql_alloc
{
protected:
  ulong   treemem, tree_elements, empty, nulls, min_length, max_length;
  uint	  room_in_tree;
  bool found;
  TREE	  tree;
  Item	  *item;
  analyse *pc;

public:
  field_info(Item* a, analyse* b) : treemem(0), tree_elements(0), empty(0),
    nulls(0), min_length(0), max_length(0), room_in_tree(1),
    found(0),item(a), pc(b) {};

  virtual ~field_info() { delete_tree(&tree, 0); }
  virtual void	 add() = 0;
  virtual void	 get_opt_type(String*, ha_rows) = 0;
  virtual String *get_min_arg(String *) = 0;
  virtual String *get_max_arg(String *) = 0;
  virtual String *avg(String*, ha_rows) = 0;
  virtual String *std(String*, ha_rows) = 0;
  virtual tree_walk_action collect_enum() = 0;
  virtual uint decimals() { return 0; }
  friend  class analyse;
};

int collect_string(void *element, element_count count, void *info);

int sortcmp2(void *, const void *a, const void *b);

class field_str :public field_info
{
  String      min_arg, max_arg;
  ulonglong   sum;
  bool	      must_be_blob, was_zero_fill, was_maybe_zerofill,
	      can_be_still_num;
  NUM_INFO    num_info;
  EV_NUM_INFO ev_num_info;

public:
  field_str(Item* a, analyse* b) :field_info(a,b), 
    min_arg("",0,default_charset_info),
    max_arg("",0,default_charset_info), sum(0),
    must_be_blob(0), was_zero_fill(0),
    was_maybe_zerofill(0), can_be_still_num(1)
    {
      init_tree(&tree, 0, 0, sizeof(String), sortcmp2, free_string, NULL,
                MYF(MY_THREAD_SPECIFIC));
    };

  void	 add() override;
  void	 get_opt_type(String*, ha_rows) override;
  String *get_min_arg(String *not_used __attribute__((unused))) override
  { return &min_arg; }
  String *get_max_arg(String *not_used __attribute__((unused))) override
  { return &max_arg; }
  String *avg(String *s, ha_rows rows) override
  {
    if (!(rows - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
      s->set_real((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
	     DEC_IN_AVG,my_thd_charset);
    return s;
  }
  friend int collect_string(String *element, element_count count,
			    TREE_INFO *info);
  tree_walk_action collect_enum() override
  { return collect_string; }
  String *std(String *s __attribute__((unused)),
	      ha_rows rows __attribute__((unused))) override
  { return (String*) 0; }
};


int collect_decimal(void *element, element_count count, void *info);

class field_decimal :public field_info
{
  my_decimal min_arg, max_arg;
  my_decimal sum[2], sum_sqr[2];
  int cur_sum;
  int bin_size;
public:
  field_decimal(Item* a, analyse* b) :field_info(a,b)
  {
    bin_size= my_decimal_get_binary_size(a->max_length, a->decimals);
    init_tree(&tree, 0, 0, bin_size, compare_decimal2, 0, (void *) &bin_size,
              MYF(MY_THREAD_SPECIFIC));
  };

  void	 add() override;
  void	 get_opt_type(String*, ha_rows) override;
  String *get_min_arg(String *) override;
  String *get_max_arg(String *) override;
  String *avg(String *s, ha_rows rows) override;
  friend int collect_decimal(uchar *element, element_count count,
                             TREE_INFO *info);
  tree_walk_action collect_enum() override
  { return collect_decimal; }
  String *std(String *s, ha_rows rows) override;
};


int collect_real(void *element, element_count count, void *info);

class field_real: public field_info
{
  double min_arg, max_arg;
  double sum, sum_sqr;
  uint	 max_notzero_dec_len;

public:
  field_real(Item* a, analyse* b) :field_info(a,b),
    min_arg(0), max_arg(0),  sum(0), sum_sqr(0), max_notzero_dec_len(0)
    {
      init_tree(&tree, 0, 0, sizeof(double), compare_double2, NULL, NULL,
                MYF(MY_THREAD_SPECIFIC));
    }

  void	 add() override;
  void	 get_opt_type(String*, ha_rows) override;
  String *get_min_arg(String *s) override
  {
    s->set_real(min_arg, item->decimals, my_thd_charset);
    return s;
  }
  String *get_max_arg(String *s) override
  {
    s->set_real(max_arg, item->decimals, my_thd_charset);
    return s;
  }
  String *avg(String *s, ha_rows rows) override
  {
    if (!(rows - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
      s->set_real(((double)sum / (double) (rows - nulls)), item->decimals,my_thd_charset);
    return s;
  }
  String *std(String *s, ha_rows rows) override
  {
    double tmp = ulonglong2double(rows);
    if (!(tmp - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
    {
      double tmp2 = ((sum_sqr - sum * sum / (tmp - nulls)) /
		     (tmp - nulls));
      s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), item->decimals,my_thd_charset);
    }
    return s;
  }
  uint	 decimals() override { return item->decimals; }
  friend int collect_real(double *element, element_count count,
			  TREE_INFO *info);
  tree_walk_action collect_enum() override
  { return collect_real;}
};

int collect_longlong(void *element, element_count count, void *info);

class field_longlong: public field_info
{
  longlong min_arg, max_arg;
  longlong sum, sum_sqr;

public:
  field_longlong(Item* a, analyse* b) :field_info(a,b), 
    min_arg(0), max_arg(0), sum(0), sum_sqr(0)
  {
    init_tree(&tree, 0, 0, sizeof(longlong), compare_longlong2, NULL, NULL,
              MYF(MY_THREAD_SPECIFIC));
  }

  void	 add() override;
  void	 get_opt_type(String*, ha_rows) override;
  String *get_min_arg(String *s) override { s->set(min_arg,my_thd_charset); return s; }
  String *get_max_arg(String *s) override { s->set(max_arg,my_thd_charset); return s; }
  String *avg(String *s, ha_rows rows) override
  {
    if (!(rows - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
      s->set_real(((double) sum / (double) (rows - nulls)), DEC_IN_AVG,my_thd_charset);
    return s;
  }
  String *std(String *s, ha_rows rows) override
  {
    double tmp = ulonglong2double(rows);
    if (!(tmp - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
    {
      double tmp2 = ((sum_sqr - sum * sum / (tmp - nulls)) /
		    (tmp - nulls));
      s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG,my_thd_charset);
    }
    return s;
  }
  friend int collect_longlong(longlong *element, element_count count,
			      TREE_INFO *info);
  tree_walk_action collect_enum() override
  { return collect_longlong;}
};

int collect_ulonglong(void *element, element_count count, void *info);

class field_ulonglong: public field_info
{
  ulonglong min_arg, max_arg;
  ulonglong sum, sum_sqr;

public:
  field_ulonglong(Item* a, analyse * b) :field_info(a,b),
    min_arg(0), max_arg(0), sum(0),sum_sqr(0)
  {
    init_tree(&tree, 0, 0, sizeof(ulonglong), compare_ulonglong2, NULL, NULL,
              MYF(MY_THREAD_SPECIFIC));
  }
  void	 add() override;
  void	 get_opt_type(String*, ha_rows) override;
  String *get_min_arg(String *s) override { s->set(min_arg,my_thd_charset); return s; }
  String *get_max_arg(String *s) override { s->set(max_arg,my_thd_charset); return s; }
  String *avg(String *s, ha_rows rows) override
  {
    if (!(rows - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
      s->set_real((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
	     DEC_IN_AVG,my_thd_charset);
    return s;
  }
  String *std(String *s, ha_rows rows) override
  {
    double tmp = ulonglong2double(rows);
    if (!(tmp - nulls))
      s->set_real((double) 0.0, 1,my_thd_charset);
    else
    {
      double tmp2 = ((ulonglong2double(sum_sqr) - 
		     ulonglong2double(sum * sum) / (tmp - nulls)) /
		     (tmp - nulls));
      s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG,my_thd_charset);
    }
    return s;
  }
  friend int collect_ulonglong(ulonglong *element, element_count count,
			       TREE_INFO *info);
  tree_walk_action collect_enum() override
  { return collect_ulonglong; }
};


Procedure *proc_analyse_init(THD *thd, ORDER *param,
			     select_result *result,
			     List<Item> &field_list);

class analyse: public Procedure
{
protected:
  Item_proc    *func_items[10];
  List<Item>   fields, result_fields;
  field_info   **f_info, **f_end;
  ha_rows      rows;
  uint	       output_str_length;

public:
  uint max_tree_elements, max_treemem;

  analyse(select_result *res) :Procedure(res, PROC_NO_SORT), f_info(0),
    rows(0), output_str_length(0) {}

  ~analyse()
  {
    if (f_info)
    {
      for (field_info **f=f_info; f != f_end; f++)
	delete (*f);
    }
  }
  void add() override {}
  bool change_columns(THD *thd, List<Item> &fields) override;
  int  send_row(List<Item> &field_list) override;
  void end_group(void) override {}
  int end_of_records(void) override;
  friend Procedure *proc_analyse_init(THD *thd, ORDER *param,
				      select_result *result,
				      List<Item> &field_list);
};

#endif /* SQL_ANALYSE_INCLUDED */
server/private/wsrep_sst.h000064400000007557150400263740011745 0ustar00/* Copyright (C) 2013-2018 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA. */

#ifndef WSREP_SST_H
#define WSREP_SST_H

#include <my_config.h>

#include "wsrep/gtid.hpp"
#include <my_global.h>
#include <string>

#define WSREP_SST_OPT_ROLE     "--role"
#define WSREP_SST_OPT_ADDR     "--address"
#define WSREP_SST_OPT_AUTH     "--auth"
#define WSREP_SST_OPT_DATA     "--datadir"
#define WSREP_SST_OPT_CONF     "--defaults-file"
#define WSREP_SST_OPT_CONF_SUFFIX "--defaults-group-suffix"
#define WSREP_SST_OPT_CONF_EXTRA  "--defaults-extra-file"
#define WSREP_SST_OPT_PARENT   "--parent"
#define WSREP_SST_OPT_BINLOG   "--binlog"
#define WSREP_SST_OPT_BINLOG_INDEX "--binlog-index"
#define WSREP_SST_OPT_PROGRESS "--progress"
#define WSREP_SST_OPT_MYSQLD   "--mysqld-args"

// mysqldump-specific options
#define WSREP_SST_OPT_USER     "--user"
#define WSREP_SST_OPT_PSWD     "--password"
#define WSREP_SST_OPT_HOST     "--host"
#define WSREP_SST_OPT_PORT     "--port"
#define WSREP_SST_OPT_LPORT    "--local-port"

// donor-specific
#define WSREP_SST_OPT_SOCKET   "--socket"
#define WSREP_SST_OPT_GTID     "--gtid"
#define WSREP_SST_OPT_BYPASS   "--bypass"
#define WSREP_SST_OPT_GTID_DOMAIN_ID "--gtid-domain-id"

#define WSREP_SST_MYSQLDUMP    "mysqldump"
#define WSREP_SST_RSYNC        "rsync"
#define WSREP_SST_SKIP         "skip"
#define WSREP_SST_MARIABACKUP  "mariabackup"
#define WSREP_SST_XTRABACKUP   "xtrabackup"
#define WSREP_SST_XTRABACKUPV2 "xtrabackupv2"
#define WSREP_SST_DEFAULT      WSREP_SST_RSYNC
#define WSREP_SST_ADDRESS_AUTO "AUTO"
#define WSREP_SST_AUTH_MASK    "********"

/* system variables */
extern const char* wsrep_sst_method;
extern const char* wsrep_sst_receive_address;
extern const char* wsrep_sst_donor;
extern const char* wsrep_sst_auth;
extern my_bool wsrep_sst_donor_rejects_queries;

/*! Synchronizes applier thread start with init thread */
extern void wsrep_sst_grab();
/*! Init thread waits for SST completion */
extern bool wsrep_sst_wait();
/*! Signals wsrep that initialization is complete, writesets can be applied */
extern bool wsrep_sst_continue();
extern void wsrep_sst_auth_init();
extern void wsrep_sst_auth_free();

extern void wsrep_SE_init_grab();   /*! grab init critical section */
extern void wsrep_SE_init_wait();   /*! wait for SE init to complete */
extern void wsrep_SE_init_done();   /*! signal that SE init is complte */
extern void wsrep_SE_initialized(); /*! mark SE initialization complete */

/**
   Return a string containing the state transfer request string.
   Note that the string may contain a '\0' in the middle.
*/
std::string wsrep_sst_prepare();

/**
   Donate a SST.

  @param request SST request string received from the joiner. Note that
                 the string may contain a '\0' in the middle.
  @param gtid    Current position of the donor
  @param bypass  If true, full SST is not needed. Joiner needs to be
                 notified that it can continue starting from gtid.
 */
int wsrep_sst_donate(const std::string& request,
                     const wsrep::gtid& gtid,
                     bool bypass);

#else
#define wsrep_SE_initialized() do { } while(0)
#define wsrep_SE_init_grab() do { } while(0)
#define wsrep_SE_init_done() do { } while(0)
#define wsrep_sst_continue() (0)

#endif /* WSREP_SST_H */
server/private/rowid_filter.h000064400000036165150400263740012402 0ustar00/*
   Copyright (c) 2018, 2019 MariaDB

   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-1301  USA */

#ifndef ROWID_FILTER_INCLUDED
#define ROWID_FILTER_INCLUDED


#include "mariadb.h"
#include "sql_array.h"

/*

  What rowid / primary filters are
  --------------------------------

  Consider a join query Q of the form
    SELECT * FROM T1, ... , Tk WHERE P.

  For any of the table reference Ti(Q) from the from clause of Q different
  rowid / primary key filters (pk-filters for short) can be built.
  A pk-filter F built for Ti(Q) is a set of rowids / primary keys of Ti
  F= {pk1,...,pkN} such that for any row r=r1||...||rk from the result set of Q
  ri's rowid / primary key pk(ri) is contained in F.

  When pk-filters are useful
  --------------------------

  If building a pk-filter F for Ti(Q )is not too costly and its cardinality #F
  is much less than the cardinality of T - #T then using the pk-filter when
  executing Q might be quite beneficial.

  Let r be a random row from Ti. Let s(F) be the probability that pk(r)
  belongs to F. Let BC(F) be the cost of building F.

  Suppose that the optimizer has chosen for Q a plan with this join order
  T1 => ... Tk and that the table Ti is accessed by a ref access using index I.
  Let K = {k1,...,kM} be the set of all rowid/primary keys values used to access
  rows of Ti when looking for matches in this table.to join Ti by index I.

  Let's assume that two set sets K and F are uncorrelated.  With this assumption
  if before accessing data from Ti by the rowid / primary key k we first
  check whether k is in F then we can expect saving on M*(1-s(S)) accesses of
  data rows from Ti. If we can guarantee that test whether k is in F is
  relatively cheap then we can gain a lot assuming that BC(F) is much less
  then the cost of fetching M*(1-s(S)) records from Ti and following
  evaluation of conditions pushed into Ti.

  Making pk-filter test cheap
  ---------------------------

  If the search structure to test whether an element is in F can be fully
  placed in RAM then this test is expected to be be much cheaper than a random
  access of a record from Ti. We'll consider two search structures for
  pk-filters: ordered array and bloom filter. Ordered array is easy to
  implement, but it's space consuming. If a filter contains primary keys
  then at least space for each primary key from the filter must be allocated
  in the search structure. On a the opposite a bloom filter requires a
  fixed number of bits and this number does not depend on the cardinality
  of the pk-filter (10 bits per element will serve pk-filter of any size).

*/

/*

  How and when the optimizer builds and uses range rowid filters
  --------------------------------------------------------------

  1. In make_join_statistics()
       for each join table s
         after the call of get_quick_record_count()
           the TABLE::method init_cost_info_for_usable_range_rowid_filters()
           is called
           The method build an array of Range_rowid_filter_cost_info elements
           containing the cost info on possible range filters for s->table.
           The array is optimized for further usage.

  2. For each partial join order when the optimizer considers joining
     table s to this partial join
       In the function best_access_path()
       a. When evaluating a ref access r by index idx to join s
          the optimizer estimates the effect of usage of each possible
          range filter f and chooses one with the best gain. The gain
          is taken into account when the cost of thr ref access r is
          calculated. If it turns out that this is the best ref access
          to join s then the info about the chosen filter together
          with the info on r is remembered in the corresponding element
          of the array of POSITION structures.
          [We evaluate every pair (ref access, range_filter) rather then
           every pair (best ref access, range filter) because if the index
           ref_idx used for ref access r correlates with the index rf_idx
           used  by the filter f then the pair (r,f) is not evaluated
           at all as we don't know how to estimate the effect of correlation
           between ref_idx and rf_idx.]
       b. When evaluating the best range access to join table s the
          optimizer estimates the effect of usage of each possible
          range filter f and chooses one with the best gain.
          [Here we should have evaluated every pair (range access,
           range filter) as well, but it's not done yet.]

  3. When the cheapest execution plan has been chosen and after the
     call of JOIN::get_best_combination()
       The method JOIN::make_range_rowid_filters() is called
       For each range rowid filter used in the chosen execution plan
       the method creates a quick select object to be able to perform
       index range scan to fill the filter at the execution stage.
       The method also creates Range_rowid_filter objects that are
       used at the execution stage.

  4. Just before the execution stage
       The method JOIN::init_range_rowid_filters() is called.
       For each join table s that is to be accessed with usage of a range
       filter the method allocates containers for the range filter and
       it lets the engine know that the filter will be used when
       accessing s.

  5. At the execution stage
       In the function sub_select() just before the first access of a join
       table s employing a range filter
         The method JOIN_TAB::build_range_rowid_filter_if_needed() is called
         The method fills the filter using the quick select created by
         JOIN::make_range_rowid_filters().

  6. The accessed key tuples are checked against the filter within the engine
     using the info pushed into it.

*/

struct TABLE;
class SQL_SELECT;
class Rowid_filter_container;
class Range_rowid_filter_cost_info;

/* Cost to write rowid into array */
#define ARRAY_WRITE_COST      0.005
/* Factor used to calculate cost of sorting rowids in array */
#define ARRAY_SORT_C          0.01
/* Cost to evaluate condition */
#define COST_COND_EVAL  0.2

typedef enum
{
  SORTED_ARRAY_CONTAINER,
  BLOOM_FILTER_CONTAINER      // Not used yet
} Rowid_filter_container_type;

/**
  @class Rowid_filter_container

  The interface for different types of containers to store info on the set
  of rowids / primary keys that defines a pk-filter.

  There will be two implementations of this abstract class.
  - sorted array
  - bloom filter
*/

class Rowid_filter_container : public Sql_alloc
{
public:

  virtual Rowid_filter_container_type get_type() = 0;

  /* Allocate memory for the container */
  virtual bool alloc() = 0;

  /*
    @brief Add info on a rowid / primary to the container
    @param ctxt   The context info (opaque)
    @param elem   The rowid / primary key to be added to the container
    @retval       true if elem is successfully added
  */
  virtual bool add(void *ctxt, char *elem) = 0;

  /*
    @brief Check whether a rowid / primary key is in container
    @param ctxt   The context info (opaque)
    @param elem   The rowid / primary key to be checked against the container
    @retval       False if elem is definitely not in the container
  */
  virtual bool check(void *ctxt, char *elem) = 0;

  /* True if the container does not contain any element */
  virtual bool is_empty() = 0;

  virtual ~Rowid_filter_container() = default;
};


/**
  @class Rowid_filter

  The interface for different types of pk-filters

  Currently we support only range pk filters.
*/

class Rowid_filter : public Sql_alloc
{
protected:

  /* The container to store info the set of elements in the filter */
  Rowid_filter_container *container;

  Rowid_filter_tracker *tracker;

public:
  enum build_return_code {
    SUCCESS,
    NON_FATAL_ERROR,
    FATAL_ERROR,
  };
  Rowid_filter(Rowid_filter_container *container_arg)
    : container(container_arg) {}

  /*
    Build the filter :
    fill it with info on the set of elements placed there
  */
  virtual build_return_code build() = 0;

  /*
    Check whether an element is in the filter.
    Returns false is the elements is definitely not in the filter.
  */
  virtual bool check(char *elem) = 0;

  virtual ~Rowid_filter() = default;

  bool is_empty() { return container->is_empty(); }

  Rowid_filter_container *get_container() { return container; }

  void set_tracker(Rowid_filter_tracker *track_arg) { tracker= track_arg; }
  Rowid_filter_tracker *get_tracker() { return tracker; }
};


/**
  @class Rowid_filter_container

  The implementation of the Rowid_interface used for pk-filters
  that are filled when performing range index scans.
*/

class Range_rowid_filter: public Rowid_filter
{
  /* The table for which the rowid filter is built */
  TABLE *table;
  /* The select to perform the range scan to fill the filter */
  SQL_SELECT *select;
  /* The cost info on the filter (used for EXPLAIN/ANALYZE) */
  Range_rowid_filter_cost_info *cost_info;

public:
  Range_rowid_filter(TABLE *tab,
                     Range_rowid_filter_cost_info *cost_arg,
                     Rowid_filter_container *container_arg,
                     SQL_SELECT *sel)
    : Rowid_filter(container_arg), table(tab), select(sel), cost_info(cost_arg)
  {}

  ~Range_rowid_filter();

  build_return_code build() override;

  bool check(char *elem) override
  {
    if (container->is_empty())
      return false;
    bool was_checked= container->check(table, elem);
    tracker->increment_checked_elements_count(was_checked);
    return was_checked;
  }

  SQL_SELECT *get_select() { return select; }
};


/**
  @class Refpos_container_sorted_array

  The wrapper class over Dynamic_array<char> to facilitate operations over
  array of elements of the type char[N] where N is the same for all elements
*/

class Refpos_container_sorted_array : public Sql_alloc
{
  /* 
    Maximum number of elements in the array
    (Now is used only at the initialization of the dynamic array)
  */
  uint max_elements;
  /* Number of bytes allocated for an element */
  uint elem_size;
  /* The dynamic array over which the wrapper is built */
  Dynamic_array<char> *array;

public:

 Refpos_container_sorted_array(uint max_elems, uint elem_sz)
    :  max_elements(max_elems), elem_size(elem_sz), array(0) {}

  ~Refpos_container_sorted_array()
  {
    delete array;
    array= 0;
  }

  bool alloc()
  {
    array= new Dynamic_array<char> (PSI_INSTRUMENT_MEM,
                                    elem_size * max_elements,
                                    elem_size * max_elements/sizeof(char) + 1);
    return array == NULL;
  }

  bool add(char *elem)
  {
    for (uint i= 0; i < elem_size; i++)
    {
      if (array->append(elem[i]))
	return true;
    }
    return false;
  }

  char *get_pos(uint n)
  {
    return array->get_pos(n * elem_size);
  }

  uint elements() { return (uint) (array->elements() / elem_size); }

  void sort(qsort_cmp2 cmp, void *cmp_arg)
  {
    my_qsort2(array->front(), array->elements() / elem_size, elem_size, cmp,
              cmp_arg);
  }

  bool is_empty() { return elements() == 0; }
};


/**
  @class Rowid_filter_sorted_array

  The implementation of the Rowid_filter_container interface as
  a sorted array container of rowids / primary keys
*/

class Rowid_filter_sorted_array: public Rowid_filter_container
{
  /* The dynamic array to store rowids / primary keys */
  Refpos_container_sorted_array refpos_container;
  /* Initially false, becomes true after the first call of (check() */
  bool is_checked;

public:
  Rowid_filter_sorted_array(uint elems, uint elem_size)
    : refpos_container(elems, elem_size), is_checked(false) {}

  Rowid_filter_container_type get_type() override
  { return SORTED_ARRAY_CONTAINER; }

  bool alloc() override { return refpos_container.alloc(); }

  bool add(void *ctxt, char *elem) override { return refpos_container.add(elem); }

  bool check(void *ctxt, char *elem) override;

  bool is_empty() override { return refpos_container.is_empty(); }
};

/**
  @class Range_rowid_filter_cost_info

  An objects of this class is created for each potentially usable
  range filter. It contains the info that allows to figure out
  whether usage of the range filter promises some gain.
*/

class Range_rowid_filter_cost_info : public Sql_alloc
{
  /* The table for which the range filter is to be built (if needed) */
  TABLE *table;
  /* Estimated number of elements in the filter */
  ulonglong est_elements;
  /* The cost of building the range filter */
  double b;
  /*
     a*N-b yields the gain of the filter
     for N key tuples of the index key_no
  */
  double a;
  /* The value of N where the gain is  0 */
  double cross_x;
  /* Used for pruning of the potential range filters */
  key_map abs_independent;

  /*
    These two parameters are used to choose the best range filter
    in the function TABLE::best_range_rowid_filter_for_partial_join
  */
  double a_adj;
  double cross_x_adj;

public:
  /* The type of the container of the range filter */
  Rowid_filter_container_type container_type;
  /* The index whose range scan would be used to build the range filter */
  uint key_no;
  /* The selectivity of the range filter */
  double selectivity;

  Range_rowid_filter_cost_info() : table(0), key_no(0) {}

  void init(Rowid_filter_container_type cont_type,
            TABLE *tab, uint key_no);

  double build_cost(Rowid_filter_container_type container_type);

  inline double lookup_cost(Rowid_filter_container_type cont_type);

  inline double
  avg_access_and_eval_gain_per_row(Rowid_filter_container_type cont_type);

  inline double avg_adjusted_gain_per_row(double access_cost_factor);

  inline void set_adjusted_gain_param(double access_cost_factor);

  /* Get the gain that usage of filter promises for r key tuples */
  inline double get_gain(double r)
  {
    return r * a - b;
  }

  /* Get the adjusted gain that usage of filter promises for r key tuples */
  inline double get_adjusted_gain(double r)
  {
    return r * a_adj - b;
  }

  /*
    The gain promised by usage of the filter for r key tuples
    due to less condition evaluations
  */
  inline double get_cmp_gain(double r)
  {
    return r * (1 - selectivity) / TIME_FOR_COMPARE;
  }

  Rowid_filter_container *create_container();

  double get_a() const { return a; }

  void trace_info(THD *thd);

  friend
  void TABLE::prune_range_rowid_filters();

  friend
  void TABLE::init_cost_info_for_usable_range_rowid_filters(THD *thd);

  friend
  Range_rowid_filter_cost_info *
  TABLE::best_range_rowid_filter_for_partial_join(uint access_key_no,
                                                  double records,
                                                  double access_cost_factor);
};

#endif /* ROWID_FILTER_INCLUDED */
server/private/pfs_idle_provider.h000064400000002551150400263740013400 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_IDLE_PROVIDER_H
#define PFS_IDLE_PROVIDER_H

/**
  @file include/pfs_idle_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_IDLE_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_IDLE_CALL(M) pfs_ ## M ## _v1

C_MODE_START

PSI_idle_locker*
pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint src_line);

void pfs_end_idle_wait_v1(PSI_idle_locker* locker);

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_IDLE_INTERFACE */

#endif

server/private/thr_lock.h000064400000016266150400263740011516 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 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 */

/* For use with thr_lock:s */

#ifndef _thr_lock_h
#define _thr_lock_h
#ifdef	__cplusplus
extern "C" {
#endif
#include <my_pthread.h>
#include <my_list.h>

struct st_thr_lock;
extern ulong locks_immediate,locks_waited ;

/*
  Important: if a new lock type is added, a matching lock description
             must be added to sql_test.cc's lock_descriptions array.
*/
enum thr_lock_type { TL_IGNORE=-1,
		     TL_UNLOCK,			/* UNLOCK ANY LOCK */
                     /*
                       Parser only! At open_tables() becomes TL_READ or
                       TL_READ_NO_INSERT depending on the binary log format
                       (SBR/RBR) and on the table category (log table).
                       Used for tables that are read by statements which
                       modify tables.
                     */
                     TL_READ_DEFAULT,
		     TL_READ,			/* Read lock */
		     TL_READ_WITH_SHARED_LOCKS,
		     /* High prior. than TL_WRITE. Allow concurrent insert */
		     TL_READ_HIGH_PRIORITY,
		     /* READ, Don't allow concurrent insert */
		     TL_READ_NO_INSERT,
		     /* READ, but skip locks if found */
		     TL_READ_SKIP_LOCKED,
		     /* 
			Write lock, but allow other threads to read / write.
			Used by BDB tables in MySQL to mark that someone is
			reading/writing to the table.
		      */
		     TL_WRITE_ALLOW_WRITE,
		     /*
		       WRITE lock used by concurrent insert. Will allow
		       READ, if one could use concurrent insert on table.
		     */
		     TL_WRITE_CONCURRENT_INSERT,
		     /* Write used by INSERT DELAYED.  Allows READ locks */
		     TL_WRITE_DELAYED,
                     /* 
                       parser only! Late bound low_priority flag. 
                       At open_tables() becomes thd->update_lock_default.
                     */
                     TL_WRITE_DEFAULT,
		     /* WRITE lock that has lower priority than TL_READ */
		     TL_WRITE_LOW_PRIORITY,
		     /* WRITE, but skip locks if found */
		     TL_WRITE_SKIP_LOCKED,
		     /* Normal WRITE lock */
		     TL_WRITE,
		     /* Abort new lock request with an error */
		     TL_WRITE_ONLY};

/*
  TL_FIRST_WRITE is here to impose some consistency in the sql
  layer on determining read/write transactions and to
  provide some API compatibility if additional transactions
  are added. Above or equal to TL_FIRST_WRITE is a write transaction
  while < TL_FIRST_WRITE is a read transaction.
*/
#define TL_FIRST_WRITE TL_WRITE_ALLOW_WRITE

enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
                            THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 };


/* Priority for locks */
#define THR_LOCK_LATE_PRIV  1U	/* For locks to be merged with org lock */
#define THR_LOCK_MERGE_PRIV 2U	/* For merge tables */

#define THR_UNLOCK_UPDATE_STATUS 1U

extern ulong max_write_lock_count;
extern my_bool thr_lock_inited;
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;

/*
  A description of the thread which owns the lock. The address
  of an instance of this structure is used to uniquely identify the thread.
*/

typedef struct st_thr_lock_info
{
  pthread_t thread;
  my_thread_id thread_id;
  void *mysql_thd;        // THD pointer
} THR_LOCK_INFO;


typedef struct st_thr_lock_data {
  THR_LOCK_INFO *owner;
  struct st_thr_lock_data *next,**prev;
  struct st_thr_lock *lock;
  mysql_cond_t *cond;
  void *status_param;			/* Param to status functions */
  void *debug_print_param;              /* For error messages */
  struct PSI_table *m_psi;
  enum thr_lock_type type;
  enum thr_lock_type org_type;		/* Cache for MariaDB */
  uint priority;
} THR_LOCK_DATA;

struct st_lock_list {
  THR_LOCK_DATA *data,**last;
};

typedef struct st_thr_lock {
  LIST list;
  mysql_mutex_t mutex;
  struct st_lock_list read_wait;
  struct st_lock_list read;
  struct st_lock_list write_wait;
  struct st_lock_list write;
  /* write_lock_count is incremented for write locks and reset on read locks */
  ulong write_lock_count;
  uint read_no_write_count;
  my_bool (*get_status)(void*, my_bool);/* Called when one gets a lock */
  void (*copy_status)(void*,void*);
  void (*update_status)(void*);		/* Before release of write */
  void (*restore_status)(void*);        /* Before release of read */
  my_bool (*start_trans)(void*);	/* When all locks are taken */
  my_bool (*check_status)(void *);
  void   (*fix_status)(void *, void *);/* For thr_merge_locks() */
  const char *name;                     /* Used for error reporting */
  my_bool allow_multiple_concurrent_insert;
} THR_LOCK;


extern LIST *thr_lock_thread_list;
extern mysql_mutex_t THR_LOCK_lock;
struct st_my_thread_var;

my_bool init_thr_lock(void);		/* Must be called once/thread */
void thr_lock_info_init(THR_LOCK_INFO *info, struct st_my_thread_var *tmp);
void thr_lock_init(THR_LOCK *lock);
void thr_lock_delete(THR_LOCK *lock);
void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data,
			void *status_param);
void thr_unlock(THR_LOCK_DATA *data, uint unlock_flags);
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
                                         uint count, THR_LOCK_INFO *owner,
                                         ulong lock_wait_timeout);
void thr_multi_unlock(THR_LOCK_DATA **data,uint count, uint unlock_flags);
void thr_merge_locks(THR_LOCK_DATA **data, uint org_count, uint new_count);
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
void thr_print_locks(void);		/* For debugging */
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
                                     enum thr_lock_type new_lock_type,
                                     ulong lock_wait_timeout);
void    thr_downgrade_write_lock(THR_LOCK_DATA *data,
                                 enum thr_lock_type new_lock_type);
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data,
                                  ulong lock_wait_timeout);
void thr_set_lock_wait_callback(void (*before_wait)(void),
                                void (*after_wait)(void));

#ifdef WITH_WSREP
  typedef my_bool (* wsrep_thd_is_brute_force_fun)(const MYSQL_THD, my_bool);
  typedef my_bool(* wsrep_abort_thd_fun)(MYSQL_THD, MYSQL_THD, my_bool);
  typedef my_bool (* wsrep_on_fun)(const MYSQL_THD);
  void wsrep_thr_lock_init(
    wsrep_thd_is_brute_force_fun bf_fun, wsrep_abort_thd_fun abort_fun,
    my_bool debug, my_bool convert_LOCK_to_trx, wsrep_on_fun on_fun);
#endif

#ifdef	__cplusplus
}
#endif
#endif /* _thr_lock_h */
server/private/my_atomic_wrapper.h000064400000005753150400263740013431 0ustar00/* Copyright (c) 2020, 2021, MariaDB

   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 */

#pragma once
#ifdef __cplusplus
#include <atomic>
/**
  A wrapper for std::atomic, defaulting to std::memory_order_relaxed.

  When it comes to atomic loads or stores at std::memory_order_relaxed
  on IA-32 or AMD64, this wrapper is only introducing some constraints
  to the C++ compiler, to prevent some optimizations of loads or
  stores.

  On POWER and ARM, atomic loads and stores involve different instructions
  from normal loads and stores and will thus incur some overhead.

  Because atomic read-modify-write operations will always incur
  overhead, we intentionally do not define
  operator++(), operator--(), operator+=(), operator-=(), or similar,
  to make the overhead stand out in the users of this code.
*/
template <typename Type> class Atomic_relaxed
{
  std::atomic<Type> m;
public:
  Atomic_relaxed(const Atomic_relaxed<Type> &rhs)
  { m.store(rhs, std::memory_order_relaxed); }
  Atomic_relaxed(Type val) : m(val) {}
  Atomic_relaxed() = default;

  Type load(std::memory_order o= std::memory_order_relaxed) const
  { return m.load(o); }
  void store(Type i, std::memory_order o= std::memory_order_relaxed)
  { m.store(i, o); }
  operator Type() const { return m.load(); }
  Type operator=(const Type i) { store(i); return i; }
  Type operator=(const Atomic_relaxed<Type> &rhs) { return *this= Type{rhs}; }
  Type operator+=(const Type i) { return fetch_add(i); }
  Type fetch_add(const Type i, std::memory_order o= std::memory_order_relaxed)
  { return m.fetch_add(i, o); }
  Type fetch_sub(const Type i, std::memory_order o= std::memory_order_relaxed)
  { return m.fetch_sub(i, o); }
  Type fetch_xor(const Type i, std::memory_order o= std::memory_order_relaxed)
  { return m.fetch_xor(i, o); }
  Type fetch_and(const Type i, std::memory_order o= std::memory_order_relaxed)
  { return m.fetch_and(i, o); }
  Type fetch_or(const Type i, std::memory_order o= std::memory_order_relaxed)
  { return m.fetch_or(i, o); }
  bool compare_exchange_strong(Type& i1, const Type i2,
                               std::memory_order o1= std::memory_order_relaxed,
                               std::memory_order o2= std::memory_order_relaxed)
  { return m.compare_exchange_strong(i1, i2, o1, o2); }
  Type exchange(const Type i, std::memory_order o= std::memory_order_relaxed)
  { return m.exchange(i, o); }
};
#endif /* __cplusplus */
server/private/sql_lex.h000064400000521004150400263740011347 0ustar00/* Copyright (c) 2000, 2019, Oracle and/or its affiliates.
   Copyright (c) 2010, 2022, 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 */

/**
  @defgroup Semantic_Analysis Semantic Analysis
*/

#ifndef SQL_LEX_INCLUDED
#define SQL_LEX_INCLUDED

#include "violite.h"                            /* SSL_type */
#include "sql_trigger.h"
#include "thr_lock.h"                  /* thr_lock_type, TL_UNLOCK */
#include "mem_root_array.h"
#include "grant.h"
#include "sql_cmd.h"
#include "sql_alter.h"                // Alter_info
#include "sql_window.h"
#include "sql_trigger.h"
#include "sp.h"                       // enum enum_sp_type
#include "sql_tvc.h"
#include "item.h"
#include "sql_limit.h"                // Select_limit_counters
#include "json_table.h"               // Json_table_column
#include "sql_schema.h"
#include "table.h"

/* Used for flags of nesting constructs */
#define SELECT_NESTING_MAP_SIZE 64
typedef Bitmap<SELECT_NESTING_MAP_SIZE> nesting_map;

/* YACC and LEX Definitions */


/**
  A string with metadata. Usually points to a string in the client
  character set, but unlike Lex_ident_cli_st (see below) it does not
  necessarily point to a query fragment. It can also point to memory
  of other kinds (e.g. an additional THD allocated memory buffer
  not overlapping with the current query text).

  We'll add more flags here eventually, to know if the string has, e.g.:
  - multi-byte characters
  - bad byte sequences
  - backslash escapes:   'a\nb'
  and reuse the original query fragments instead of making the string
  copy too early, in Lex_input_stream::get_text().
  This will allow to avoid unnecessary copying, as well as
  create more optimal Item types in sql_yacc.yy
*/
struct Lex_string_with_metadata_st: public LEX_CSTRING
{
private:
  bool m_is_8bit; // True if the string has 8bit characters
  char m_quote;   // Quote character, or 0 if not quoted
public:
  void set_8bit(bool is_8bit) { m_is_8bit= is_8bit; }
  void set_metadata(bool is_8bit, char quote)
  {
    m_is_8bit= is_8bit;
    m_quote= quote;
  }
  void set(const char *s, size_t len, bool is_8bit, char quote)
  {
    str= s;
    length= len;
    set_metadata(is_8bit, quote);
  }
  void set(const LEX_CSTRING *s, bool is_8bit, char quote)
  {
    ((LEX_CSTRING &)*this)= *s;
    set_metadata(is_8bit, quote);
  }
  bool is_8bit() const { return m_is_8bit; }
  bool is_quoted() const { return m_quote != '\0'; }
  char quote() const { return m_quote; }
  // Get string repertoire by the 8-bit flag and the character set
  my_repertoire_t repertoire(CHARSET_INFO *cs) const
  {
    return !m_is_8bit && my_charset_is_ascii_based(cs) ?
           MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
  }
  // Get string repertoire by the 8-bit flag, for ASCII-based character sets
  my_repertoire_t repertoire() const
  {
    return !m_is_8bit ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
  }
};


/*
  Used to store identifiers in the client character set.
  Points to a query fragment.
*/
struct Lex_ident_cli_st: public Lex_string_with_metadata_st
{
public:
  void set_keyword(const char *s, size_t len)
  {
    set(s, len, false, '\0');
  }
  void set_ident(const char *s, size_t len, bool is_8bit)
  {
    set(s, len, is_8bit, '\0');
  }
  void set_ident_quoted(const char *s, size_t len, bool is_8bit, char quote)
  {
    set(s, len, is_8bit, quote);
  }
  void set_unquoted(const LEX_CSTRING *s, bool is_8bit)
  {
    set(s, is_8bit, '\0');
  }
  const char *pos() const { return str - is_quoted(); }
  const char *end() const { return str + length + is_quoted(); }
};


class Lex_ident_cli: public Lex_ident_cli_st
{
public:
  Lex_ident_cli(const LEX_CSTRING *s, bool is_8bit)
  {
    set_unquoted(s, is_8bit);
  }
  Lex_ident_cli(const char *s, size_t len)
  {
    set_ident(s, len, false);
  }
};


struct Lex_ident_sys_st: public LEX_CSTRING
{
public:
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr,size_t size) { TRASH_FREE(ptr, size); }
  static void operator delete(void *ptr, MEM_ROOT *mem_root) {}

  bool copy_ident_cli(THD *thd, const Lex_ident_cli_st *str);
  bool copy_keyword(THD *thd, const Lex_ident_cli_st *str);
  bool copy_sys(THD *thd, const LEX_CSTRING *str);
  bool convert(THD *thd, const LEX_CSTRING *str, CHARSET_INFO *cs);
  bool copy_or_convert(THD *thd, const Lex_ident_cli_st *str, CHARSET_INFO *cs);
  bool is_null() const { return str == NULL; }
  bool to_size_number(ulonglong *to) const;
  void set_valid_utf8(const LEX_CSTRING *name)
  {
    DBUG_ASSERT(Well_formed_prefix(system_charset_info, name->str,
                                   name->length).length() == name->length);
    str= name->str ; length= name->length;
  }
};


class Lex_ident_sys: public Lex_ident_sys_st
{
public:
  Lex_ident_sys(THD *thd, const Lex_ident_cli_st *str)
  {
    if (copy_ident_cli(thd, str))
      ((LEX_CSTRING &) *this)= null_clex_str;
  }
  Lex_ident_sys()
  {
    ((LEX_CSTRING &) *this)= null_clex_str;
  }
  Lex_ident_sys(const char *name, size_t length)
  {
    LEX_CSTRING tmp= {name, length};
    set_valid_utf8(&tmp);
  }
  Lex_ident_sys(THD *thd, const LEX_CSTRING *str)
  {
    set_valid_utf8(str);
  }
  Lex_ident_sys & operator=(const Lex_ident_sys_st &name)
  {
    Lex_ident_sys_st::operator=(name);
    return *this;
  }
};


struct Lex_column_list_privilege_st
{
  List<Lex_ident_sys> *m_columns;
  privilege_t m_privilege;
};


class Lex_column_list_privilege: public Lex_column_list_privilege_st
{
public:
  Lex_column_list_privilege(List<Lex_ident_sys> *columns, privilege_t privilege)
  {
    m_columns= columns;
    m_privilege= privilege;
  }
};


/**
  ORDER BY ... LIMIT parameters;
*/
class Lex_order_limit_lock: public Sql_alloc
{
public:
  SQL_I_List<st_order> *order_list;   /* ORDER clause */
  Lex_select_lock lock;
  Lex_select_limit limit;

  Lex_order_limit_lock() :order_list(NULL)
  {}

  bool set_to(st_select_lex *sel);
};


enum sub_select_type
{
  UNSPECIFIED_TYPE,
  /* following 3 enums should be as they are*/
  UNION_TYPE, INTERSECT_TYPE, EXCEPT_TYPE,
  GLOBAL_OPTIONS_TYPE, DERIVED_TABLE_TYPE, OLAP_TYPE
};

enum set_op_type
{
  UNSPECIFIED,
  UNION_DISTINCT, UNION_ALL,
  EXCEPT_DISTINCT, EXCEPT_ALL,
  INTERSECT_DISTINCT, INTERSECT_ALL
};

inline int cmp_unit_op(enum sub_select_type op1, enum sub_select_type op2)
{
  DBUG_ASSERT(op1 >= UNION_TYPE && op1 <= EXCEPT_TYPE);
  DBUG_ASSERT(op2 >= UNION_TYPE && op2 <= EXCEPT_TYPE);
  return (op1 == INTERSECT_TYPE ? 1 : 0) - (op2 == INTERSECT_TYPE ? 1 : 0);
}

enum unit_common_op {OP_MIX, OP_UNION, OP_INTERSECT, OP_EXCEPT};

enum enum_view_suid
{
  VIEW_SUID_INVOKER= 0,
  VIEW_SUID_DEFINER= 1,
  VIEW_SUID_DEFAULT= 2
};


enum plsql_cursor_attr_t
{
  PLSQL_CURSOR_ATTR_ISOPEN,
  PLSQL_CURSOR_ATTR_FOUND,
  PLSQL_CURSOR_ATTR_NOTFOUND,
  PLSQL_CURSOR_ATTR_ROWCOUNT
};


enum enum_sp_suid_behaviour
{
  SP_IS_DEFAULT_SUID= 0,
  SP_IS_NOT_SUID,
  SP_IS_SUID
};


enum enum_sp_aggregate_type
{
  DEFAULT_AGGREGATE= 0,
  NOT_AGGREGATE,
  GROUP_AGGREGATE
};


/* These may not be declared yet */
class Table_ident;
class sql_exchange;
class LEX_COLUMN;
class sp_head;
class sp_name;
class sp_instr;
class sp_pcontext;
class sp_variable;
class sp_expr_lex;
class sp_assignment_lex;
class st_alter_tablespace;
class partition_info;
class Event_parse_data;
class set_var_base;
class sys_var;
class Item_func_match;
class File_parser;
class Key_part_spec;
class Item_window_func;
struct sql_digest_state;
class With_clause;
class my_var;
class select_handler;
class Pushdown_select;

#define ALLOC_ROOT_SET 1024

#ifdef MYSQL_SERVER
/*
  There are 8 different type of table access so there is no more than
  combinations 2^8 = 256:

  . STMT_READS_TRANS_TABLE

  . STMT_READS_NON_TRANS_TABLE

  . STMT_READS_TEMP_TRANS_TABLE

  . STMT_READS_TEMP_NON_TRANS_TABLE

  . STMT_WRITES_TRANS_TABLE

  . STMT_WRITES_NON_TRANS_TABLE

  . STMT_WRITES_TEMP_TRANS_TABLE

  . STMT_WRITES_TEMP_NON_TRANS_TABLE

  The unsafe conditions for each combination is represented within a byte
  and stores the status of the option --binlog-direct-non-trans-updates,
  whether the trx-cache is empty or not, and whether the isolation level
  is lower than ISO_REPEATABLE_READ:

  . option (OFF/ON)
  . trx-cache (empty/not empty)
  . isolation (>= ISO_REPEATABLE_READ / < ISO_REPEATABLE_READ)

  bits 0 : . OFF, . empty, . >= ISO_REPEATABLE_READ
  bits 1 : . OFF, . empty, . < ISO_REPEATABLE_READ
  bits 2 : . OFF, . not empty, . >= ISO_REPEATABLE_READ
  bits 3 : . OFF, . not empty, . < ISO_REPEATABLE_READ
  bits 4 : . ON, . empty, . >= ISO_REPEATABLE_READ
  bits 5 : . ON, . empty, . < ISO_REPEATABLE_READ
  bits 6 : . ON, . not empty, . >= ISO_REPEATABLE_READ
  bits 7 : . ON, . not empty, . < ISO_REPEATABLE_READ
*/
extern uint binlog_unsafe_map[256];
/*
  Initializes the array with unsafe combinations and its respective
  conditions.
*/
void binlog_unsafe_map_init();
#endif

#ifdef MYSQL_SERVER
/*
  The following hack is needed because yy_*.cc do not define
  YYSTYPE before including this file
*/
#ifdef MYSQL_YACC
#define LEX_YYSTYPE void *
#else
#include "lex_symbol.h"
#ifdef MYSQL_LEX
#include "item_func.h"            /* Cast_target used in yy_mariadb.hh */
#include "sql_get_diagnostics.h"  /* Types used in yy_mariadb.hh */
#include "sp_pcontext.h"
#include "yy_mariadb.hh"
#define LEX_YYSTYPE YYSTYPE *
#else
#define LEX_YYSTYPE void *
#endif
#endif
#endif

// describe/explain types
#define DESCRIBE_NORMAL         1
#define DESCRIBE_EXTENDED       2
/*
  This is not within #ifdef because we want "EXPLAIN PARTITIONS ..." to produce
  additional "partitions" column even if partitioning is not compiled in.
*/
#define DESCRIBE_PARTITIONS	4
#define DESCRIBE_EXTENDED2	8

#ifdef MYSQL_SERVER

extern const LEX_STRING  empty_lex_str;
extern const LEX_CSTRING empty_clex_str;
extern const LEX_CSTRING star_clex_str;
extern const LEX_CSTRING param_clex_str;

enum enum_sp_data_access
{
  SP_DEFAULT_ACCESS= 0,
  SP_CONTAINS_SQL,
  SP_NO_SQL,
  SP_READS_SQL_DATA,
  SP_MODIFIES_SQL_DATA
};

const LEX_CSTRING sp_data_access_name[]=
{
  { STRING_WITH_LEN("") },
  { STRING_WITH_LEN("CONTAINS SQL") },
  { STRING_WITH_LEN("NO SQL") },
  { STRING_WITH_LEN("READS SQL DATA") },
  { STRING_WITH_LEN("MODIFIES SQL DATA") }
};

#define DERIVED_SUBQUERY        1
#define DERIVED_VIEW            2
#define DERIVED_WITH            4

enum enum_view_create_mode
{
  VIEW_CREATE_NEW,              // check that there are not such VIEW/table
  VIEW_ALTER,                   // check that VIEW .frm with such name exists
  VIEW_CREATE_OR_REPLACE        // check only that there are not such table
};


class Create_view_info: public Sql_alloc
{
public:
  LEX_CSTRING select;              // The SELECT statement of CREATE VIEW
  enum enum_view_create_mode mode;
  uint16 algorithm;
  uint8 check;
  enum enum_view_suid suid;
  Create_view_info(enum_view_create_mode mode_arg,
                   uint16 algorithm_arg,
                   enum_view_suid suid_arg)
   :select(null_clex_str),
    mode(mode_arg),
    algorithm(algorithm_arg),
    check(VIEW_CHECK_NONE),
    suid(suid_arg)
  { }
};


enum enum_drop_mode
{
  DROP_DEFAULT, // mode is not specified
  DROP_CASCADE, // CASCADE option
  DROP_RESTRICT // RESTRICT option
};

/* Options to add_table_to_list() */
#define TL_OPTION_UPDATING      1
#define TL_OPTION_FORCE_INDEX   2
#define TL_OPTION_IGNORE_LEAVES 4
#define TL_OPTION_ALIAS         8
#define TL_OPTION_SEQUENCE      16
#define TL_OPTION_TABLE_FUNCTION        32

typedef List<Item> List_item;
typedef Mem_root_array<ORDER*, true> Group_list_ptrs;

/* SERVERS CACHE CHANGES */
typedef struct st_lex_server_options
{
  long port;
  LEX_CSTRING server_name, host, db, username, password, scheme, socket, owner;
  void reset(LEX_CSTRING name)
  {
    server_name= name;
    host= db= username= password= scheme= socket= owner= null_clex_str;
    port= -1;
  }
} LEX_SERVER_OPTIONS;


/**
  Structure to hold parameters for CHANGE MASTER, START SLAVE, and STOP SLAVE.

  Remark: this should not be confused with Master_info (and perhaps
  would better be renamed to st_lex_replication_info).  Some fields,
  e.g., delay, are saved in Relay_log_info, not in Master_info.
*/
struct LEX_MASTER_INFO
{
  DYNAMIC_ARRAY repl_ignore_server_ids;
  DYNAMIC_ARRAY repl_do_domain_ids;
  DYNAMIC_ARRAY repl_ignore_domain_ids;
  const char *host, *user, *password, *log_file_name;
  const char *ssl_key, *ssl_cert, *ssl_ca, *ssl_capath, *ssl_cipher;
  const char *ssl_crl, *ssl_crlpath;
  const char *relay_log_name;
  LEX_CSTRING connection_name;
  /* Value in START SLAVE UNTIL master_gtid_pos=xxx */
  LEX_CSTRING gtid_pos_str;
  ulonglong pos;
  ulong relay_log_pos;
  ulong server_id;
  uint port, connect_retry;
  float heartbeat_period;
  int sql_delay;
  /*
    Enum is used for making it possible to detect if the user
    changed variable or if it should be left at old value
   */
  enum {LEX_MI_UNCHANGED= 0, LEX_MI_DISABLE, LEX_MI_ENABLE}
    ssl, ssl_verify_server_cert, heartbeat_opt, repl_ignore_server_ids_opt,
    repl_do_domain_ids_opt, repl_ignore_domain_ids_opt;
  enum {
    LEX_GTID_UNCHANGED, LEX_GTID_NO, LEX_GTID_CURRENT_POS, LEX_GTID_SLAVE_POS
  } use_gtid_opt;

  void init()
  {
    bzero(this, sizeof(*this));
    my_init_dynamic_array(PSI_INSTRUMENT_ME, &repl_ignore_server_ids,
                          sizeof(::server_id), 0, 16, MYF(0));
    my_init_dynamic_array(PSI_INSTRUMENT_ME, &repl_do_domain_ids,
                          sizeof(ulong), 0, 16, MYF(0));
    my_init_dynamic_array(PSI_INSTRUMENT_ME, &repl_ignore_domain_ids,
                          sizeof(ulong), 0, 16, MYF(0));
    sql_delay= -1;
  }
  void reset(bool is_change_master)
  {
    if (unlikely(is_change_master))
    {
      delete_dynamic(&repl_ignore_server_ids);
      /* Free all the array elements. */
      delete_dynamic(&repl_do_domain_ids);
      delete_dynamic(&repl_ignore_domain_ids);
    }

    host= user= password= log_file_name= ssl_key= ssl_cert= ssl_ca=
      ssl_capath= ssl_cipher= ssl_crl= ssl_crlpath= relay_log_name= NULL;
    pos= relay_log_pos= server_id= port= connect_retry= 0;
    heartbeat_period= 0;
    ssl= ssl_verify_server_cert= heartbeat_opt=
      repl_ignore_server_ids_opt= repl_do_domain_ids_opt=
      repl_ignore_domain_ids_opt= LEX_MI_UNCHANGED;
    gtid_pos_str= null_clex_str;
    use_gtid_opt= LEX_GTID_UNCHANGED;
    sql_delay= -1;
  }
};

typedef struct st_lex_reset_slave
{
  bool all;
} LEX_RESET_SLAVE;

enum olap_type 
{
  UNSPECIFIED_OLAP_TYPE, CUBE_TYPE, ROLLUP_TYPE
};

/* 
  String names used to print a statement with index hints.
  Keep in sync with index_hint_type.
*/
extern const char * index_hint_type_name[];
typedef uchar index_clause_map;

/*
  Bits in index_clause_map : one for each possible FOR clause in
  USE/FORCE/IGNORE INDEX index hint specification
*/
#define INDEX_HINT_MASK_JOIN  (1)
#define INDEX_HINT_MASK_GROUP (1 << 1)
#define INDEX_HINT_MASK_ORDER (1 << 2)

#define INDEX_HINT_MASK_ALL (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | \
                             INDEX_HINT_MASK_ORDER)

class select_result_sink;

/* Single element of an USE/FORCE/IGNORE INDEX list specified as a SQL hint  */
class Index_hint : public Sql_alloc
{
public:
  /* The type of the hint : USE/FORCE/IGNORE */
  enum index_hint_type type;
  /* Where the hit applies to. A bitmask of INDEX_HINT_MASK_<place> values */
  index_clause_map clause;
  /* 
    The index name. Empty (str=NULL) name represents an empty list 
    USE INDEX () clause 
  */ 
  LEX_CSTRING key_name;

  Index_hint (enum index_hint_type type_arg, index_clause_map clause_arg,
              const char *str, size_t length) :
    type(type_arg), clause(clause_arg)
  {
    key_name.str= str;
    key_name.length= length;
  }

  void print(THD *thd, String *str);
}; 

/* 
  The state of the lex parsing for selects 
   
   master and slaves are pointers to select_lex.
   master is pointer to upper level node.
   slave is pointer to lower level node
   select_lex is a SELECT without union
   unit is container of either
     - One SELECT
     - UNION of selects
   select_lex and unit are both inherited form st_select_lex_node
   neighbors are two select_lex or units on the same level

   All select describing structures linked with following pointers:
   - list of neighbors (next/prev) (prev of first element point to slave
     pointer of upper structure)
     - For select this is a list of UNION's (or one element list)
     - For units this is a list of sub queries for the upper level select

   - pointer to master (master), which is
     If this is a unit
       - pointer to outer select_lex
     If this is a select_lex
       - pointer to outer unit structure for select

   - pointer to slave (slave), which is either:
     If this is a unit:
       - first SELECT that belong to this unit
     If this is a select_lex
       - first unit that belong to this SELECT (subquries or derived tables)

   - list of all select_lex (link_next/link_prev)
     This is to be used for things like derived tables creation, where we
     go through this list and create the derived tables.

   If unit contain several selects (UNION now, INTERSECT etc later)
   then it have special select_lex called fake_select_lex. It used for
   storing global parameters (like ORDER BY, LIMIT) and executing union.
   Subqueries used in global ORDER BY clause will be attached to this
   fake_select_lex, which will allow them correctly resolve fields of
   'upper' UNION and outer selects.

   For example for following query:

   select *
     from table1
     where table1.field IN (select * from table1_1_1 union
                            select * from table1_1_2)
     union
   select *
     from table2
     where table2.field=(select (select f1 from table2_1_1_1_1
                                   where table2_1_1_1_1.f2=table2_1_1.f3)
                           from table2_1_1
                           where table2_1_1.f1=table2.f2)
     union
   select * from table3;

   we will have following structure:

   select1: (select * from table1 ...)
   select2: (select * from table2 ...)
   select3: (select * from table3)
   select1.1.1: (select * from table1_1_1)
   ...

     main unit
     fake0
     select1 select2 select3
     |^^     |^
    s|||     ||master
    l|||     |+---------------------------------+
    a|||     +---------------------------------+|
    v|||master                         slave   ||
    e||+-------------------------+             ||
     V|            neighbor      |             V|
     unit1.1<+==================>unit1.2       unit2.1
     fake1.1
     select1.1.1 select 1.1.2    select1.2.1   select2.1.1
                                               |^
                                               ||
                                               V|
                                               unit2.1.1.1
                                               select2.1.1.1.1


   relation in main unit will be following:
   (bigger picture for:
      main unit
      fake0
      select1 select2 select3
   in the above picture)

         main unit
         |^^^^|fake_select_lex
         |||||+--------------------------------------------+
         ||||+--------------------------------------------+|
         |||+------------------------------+              ||
         ||+--------------+                |              ||
    slave||master         |                |              ||
         V|      neighbor |       neighbor |        master|V
         select1<========>select2<========>select3        fake0

    list of all select_lex will be following (as it will be constructed by
    parser):

    select1->select2->select3->select2.1.1->select 2.1.2->select2.1.1.1.1-+
                                                                          |
    +---------------------------------------------------------------------+
    |
    +->select1.1.1->select1.1.2

*/

/* 
    Base class for st_select_lex (SELECT_LEX) & 
    st_select_lex_unit (SELECT_LEX_UNIT)
*/
struct LEX;
class st_select_lex;
class st_select_lex_unit;


class st_select_lex_node {
protected:
  st_select_lex_node *next, **prev,   /* neighbor list */
    *master, *slave,                  /* vertical links */
    *link_next, **link_prev;          /* list of whole SELECT_LEX */
  enum sub_select_type linkage;

  void init_query_common();

public:
  ulonglong options;
  uint8 uncacheable;
  bool distinct:1;
  bool no_table_names_allowed:1; /* used for global order by */
  /*
    result of this query can't be cached, bit field, can be :
      UNCACHEABLE_DEPENDENT_GENERATED
      UNCACHEABLE_DEPENDENT_INJECTED
      UNCACHEABLE_RAND
      UNCACHEABLE_SIDEEFFECT
      UNCACHEABLE_EXPLAIN
      UNCACHEABLE_PREPARE
  */

  bool is_linkage_set() const
  {
    return linkage == UNION_TYPE || linkage == INTERSECT_TYPE || linkage == EXCEPT_TYPE;
  }
  enum sub_select_type get_linkage() { return linkage; }
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return (void*) alloc_root(mem_root, (uint) size); }
  static void operator delete(void *ptr,size_t size) { TRASH_FREE(ptr, size); }
  static void operator delete(void *ptr, MEM_ROOT *mem_root) {}

  // Ensures that at least all members used during cleanup() are initialized.
  st_select_lex_node()
    : next(NULL), prev(NULL),
      master(NULL), slave(NULL),
      link_next(NULL), link_prev(NULL),
      linkage(UNSPECIFIED_TYPE)
  {
  }

  inline st_select_lex_node* get_master() { return master; }
  void include_down(st_select_lex_node *upper);
  void attach_single(st_select_lex_node *slave_arg);
  void include_neighbour(st_select_lex_node *before);
  void link_chain_down(st_select_lex_node *first);
  void link_neighbour(st_select_lex_node *neighbour)
  {
    DBUG_ASSERT(next == NULL);
    DBUG_ASSERT(neighbour != NULL);
    next= neighbour;
    neighbour->prev= &next;
  }
  void cut_next() { next= NULL; }
  void include_standalone(st_select_lex_node *sel, st_select_lex_node **ref);
  void include_global(st_select_lex_node **plink);
  void exclude();
  void exclude_from_tree();
  void exclude_from_global()
  {
    if (!link_prev)
      return;
    if (((*link_prev)= link_next))
      link_next->link_prev= link_prev;
    link_next= NULL;
    link_prev= NULL;
  }
  void substitute_in_tree(st_select_lex_node *subst);

  void set_slave(st_select_lex_node *slave_arg) { slave= slave_arg; }
  void move_node(st_select_lex_node *where_to_move)
  {
    if (where_to_move == this)
      return;
    if (next)
      next->prev= prev;
    *prev= next;
    *where_to_move->prev= this;
    next= where_to_move;
  }
  st_select_lex_node *insert_chain_before(st_select_lex_node **ptr_pos_to_insert,
                                          st_select_lex_node *end_chain_node);
  void move_as_slave(st_select_lex_node *new_master);
  void set_linkage(enum sub_select_type l)
  {
    DBUG_ENTER("st_select_lex_node::set_linkage");
    DBUG_PRINT("info", ("node: %p  linkage: %d->%d", this, linkage, l));
    linkage= l;
    DBUG_VOID_RETURN;
  }
  /*
    This method created for reiniting LEX in mysql_admin_table() and can be
    used only if you are going remove all SELECT_LEX & units except belonger
    to LEX (LEX::unit & LEX::select, for other purposes there are
    SELECT_LEX_UNIT::exclude_level & SELECT_LEX_UNIT::exclude_tree.

    It is also used in parsing to detach builtin select.
  */
  void cut_subtree() { slave= 0; }
  friend class st_select_lex_unit;
  friend bool mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *sel);
  friend bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
                              bool open_view_no_parse);
  friend class st_select_lex;
private:
  void fast_exclude();
};
typedef class st_select_lex_node SELECT_LEX_NODE;

/* 
   SELECT_LEX_UNIT - unit of selects (UNION, INTERSECT, ...) group 
   SELECT_LEXs
*/
class THD;
class select_result;
class JOIN;
class select_unit;
class Procedure;
class Explain_query;

void delete_explain_query(LEX *lex);
void create_explain_query(LEX *lex, MEM_ROOT *mem_root);
void create_explain_query_if_not_exists(LEX *lex, MEM_ROOT *mem_root);
bool print_explain_for_slow_log(LEX *lex, THD *thd, String *str);


class st_select_lex_unit: public st_select_lex_node {
protected:
  TABLE_LIST result_table_list;
  select_unit *union_result;
  ulonglong found_rows_for_union;

  bool prepare_join(THD *thd, SELECT_LEX *sl, select_result *result,
                    ulonglong additional_options,
                    bool is_union_select);
  bool join_union_type_handlers(THD *thd,
                                class Type_holder *holders, uint count);
  bool join_union_type_attributes(THD *thd,
                                  class Type_holder *holders, uint count);
public:
  bool join_union_item_types(THD *thd, List<Item> &types, uint count);
  // Ensures that at least all members used during cleanup() are initialized.
  st_select_lex_unit()
    : union_result(NULL), table(NULL),  result(NULL), fake_select_lex(NULL),
      last_procedure(NULL),cleaned(false), bag_set_op_optimized(false),
      have_except_all_or_intersect_all(false)
  {
  }

  TABLE *table; /* temporary table using for appending UNION results */
  select_result *result;
  st_select_lex *pre_last_parse;
  /*
    Node on which we should return current_select pointer after parsing
    subquery
  */
  st_select_lex *return_to;
  /* LIMIT clause runtime counters */
  Select_limit_counters lim;
  /* not NULL if unit used in subselect, point to subselect item */
  Item_subselect *item;
  /*
    TABLE_LIST representing this union in the embedding select. Used for
    derived tables/views handling.
  */
  TABLE_LIST *derived;
  /* With clause attached to this unit (if any) */
  With_clause *with_clause;
  /* With element where this unit is used as the specification (if any) */
  With_element *with_element;
  /* The unit used as a CTE specification from which this unit is cloned */
  st_select_lex_unit *cloned_from;
  /* thread handler */
  THD *thd;
  /*
    SELECT_LEX for hidden SELECT in union which process global
    ORDER BY and LIMIT
  */
  st_select_lex *fake_select_lex;
  /**
    SELECT_LEX that stores LIMIT and OFFSET for UNION ALL when noq
    fake_select_lex is used.
  */
  st_select_lex *saved_fake_select_lex;

  /* pointer to the last node before last subsequence of UNION ALL */
  st_select_lex *union_distinct;
  Procedure *last_procedure;     /* Pointer to procedure, if such exists */

  // list of fields which points to temporary table for union
  List<Item> item_list;
  /*
    list of types of items inside union (used for union & derived tables)
    
    Item_type_holders from which this list consist may have pointers to Field,
    pointers is valid only after preparing SELECTS of this unit and before
    any SELECT of this unit execution
  */
  List<Item> types;

  bool prepared:1; // prepare phase already performed for UNION (unit)
  bool optimized:1; // optimize phase already performed for UNION (unit)
  bool optimized_2:1;
  bool executed:1; // already executed
  bool cleaned:1;
  bool bag_set_op_optimized:1;
  bool optimize_started:1;
  bool have_except_all_or_intersect_all:1;
  /**
     TRUE if the unit contained TVC at the top level that has been wrapped
     into SELECT:
     VALUES (v1) ... (vn) => SELECT * FROM (VALUES (v1) ... (vn)) as tvc
  */
  bool with_wrapped_tvc:1;
  bool is_view:1;
  bool describe:1; /* union exec() called for EXPLAIN */
  bool columns_are_renamed:1;

protected:
  /* This is bool, not bit, as it's used and set in many places */
  bool saved_error;
public:

  /**
    Pointer to 'last' select, or pointer to select where we stored
    global parameters for union.

    If this is a union of multiple selects, the parser puts the global
    parameters in fake_select_lex. If the union doesn't use a
    temporary table, st_select_lex_unit::prepare() nulls out
    fake_select_lex, but saves a copy in saved_fake_select_lex in
    order to preserve the global parameters.

    If it is not a union, first_select() is the last select.

    @return select containing the global parameters
  */
  inline st_select_lex *global_parameters()
  {
    if (fake_select_lex != NULL)
      return fake_select_lex;
    else if (saved_fake_select_lex != NULL)
      return saved_fake_select_lex;
    return first_select();
  };

  void init_query();
  st_select_lex* outer_select();
  const st_select_lex* first_select() const
  {
    return reinterpret_cast<const st_select_lex*>(slave);
  }
  st_select_lex* first_select()
  {
    return reinterpret_cast<st_select_lex*>(slave);
  }
  void set_with_clause(With_clause *with_cl);
  st_select_lex_unit* next_unit()
  {
    return reinterpret_cast<st_select_lex_unit*>(next);
  }
  st_select_lex* return_after_parsing() { return return_to; }
  void exclude_level();
  // void exclude_tree(); // it is not used for long time
  bool is_excluded() { return prev == NULL; }

  /* UNION methods */
  bool prepare(TABLE_LIST *derived_arg, select_result *sel_result,
               ulonglong additional_options);
  bool optimize();
  void optimize_bag_operation(bool is_outer_distinct);
  bool exec();
  bool exec_recursive();
  bool cleanup();
  inline void unclean() { cleaned= 0; }
  void reinit_exec_mechanism();

  void print(String *str, enum_query_type query_type);

  bool add_fake_select_lex(THD *thd);
  void init_prepare_fake_select_lex(THD *thd, bool first_execution);
  inline bool is_prepared() { return prepared; }
  bool change_result(select_result_interceptor *result,
                     select_result_interceptor *old_result);
  void set_limit(st_select_lex *values);
  void set_thd(THD *thd_arg) { thd= thd_arg; }
  inline bool is_unit_op ();
  bool union_needs_tmp_table();

  void set_unique_exclude();
  bool check_distinct_in_union();

  friend struct LEX;
  friend int subselect_union_engine::exec();

  List<Item> *get_column_types(bool for_cursor);

  select_unit *get_union_result() { return union_result; }
  int save_union_explain(Explain_query *output);
  int save_union_explain_part2(Explain_query *output);
  unit_common_op common_op();

  bool explainable() const;

  void reset_distinct();
  void fix_distinct();

  void register_select_chain(SELECT_LEX *first_sel);

  bool set_nest_level(int new_nest_level);
  bool check_parameters(SELECT_LEX *main_select);

  bool set_lock_to_the_last_select(Lex_select_lock l);
  void print_lock_from_the_last_select(String *str);

  bool can_be_merged();

  friend class st_select_lex;
};

typedef class st_select_lex_unit SELECT_LEX_UNIT;
typedef Bounds_checked_array<Item*> Ref_ptr_array;


/**
  Structure which consists of the field and the item that
  corresponds to this field.
*/

class Field_pair :public Sql_alloc
{
public:
  Field *field;
  Item *corresponding_item;
  Field_pair(Field *fld, Item *item)
    :field(fld), corresponding_item(item) {}
};

Field_pair *get_corresponding_field_pair(Item *item,
                                         List<Field_pair> pair_list);
Field_pair *find_matching_field_pair(Item *item, List<Field_pair> pair_list);


#define TOUCHED_SEL_COND 1/* WHERE/HAVING/ON should be reinited before use */
#define TOUCHED_SEL_DERIVED (1<<1)/* derived should be reinited before use */

#define UNIT_NEST_FL        1
/*
  SELECT_LEX - store information of parsed SELECT statment
*/
class st_select_lex: public st_select_lex_node
{
public:
  /*
    Currently the field first_nested is used only by parser.
    It containa either a reference to the first select
    of the nest of selects to which 'this' belongs to, or
    in the case of priority jump it contains a reference to
    the select to which the priority nest has to be attached to.
    If there is no priority jump then the first select of the
    nest contains the reference to itself in first_nested.
    Example:
      select1 union select2 intersect select
    Here we have a priority jump at select2.
    So select2->first_nested points to select1,
    while select3->first_nested points to select2 and
    select1->first_nested points to select1.
  */

  Name_resolution_context context;
  LEX_CSTRING db;

  /*
    Point to the LEX in which it was created, used in view subquery detection.

    TODO: make also st_select_lex::parent_stmt_lex (see LEX::stmt_lex)
    and use st_select_lex::parent_lex & st_select_lex::parent_stmt_lex
    instead of global (from THD) references where it is possible.
  */
  LEX *parent_lex;
  st_select_lex *first_nested;
  Item *where, *having;                         /* WHERE & HAVING clauses */
  Item *prep_where; /* saved WHERE clause for prepared statement processing */
  Item *prep_having;/* saved HAVING clause for prepared statement processing */
  Item *cond_pushed_into_where;  /* condition pushed into WHERE  */
  Item *cond_pushed_into_having; /* condition pushed into HAVING */

  /*
    nest_levels are local to the query or VIEW,
    and that view merge procedure does not re-calculate them.
    So we also have to remember unit against which we count levels.
  */
  SELECT_LEX_UNIT *nest_level_base;
  Item_sum *inner_sum_func_list; /* list of sum func in nested selects */ 
  /* 
    This is a copy of the original JOIN USING list that comes from
    the parser. The parser :
      1. Sets the natural_join of the second TABLE_LIST in the join
         and the st_select_lex::prev_join_using.
      2. Makes a parent TABLE_LIST and sets its is_natural_join/
       join_using_fields members.
      3. Uses the wrapper TABLE_LIST as a table in the upper level.
    We cannot assign directly to join_using_fields in the parser because
    at stage (1.) the parent TABLE_LIST is not constructed yet and
    the assignment will override the JOIN USING fields of the lower level
    joins on the right.
  */
  List<String> *prev_join_using;
  JOIN *join; /* after JOIN::prepare it is pointer to corresponding JOIN */
  TABLE_LIST *embedding;          /* table embedding to the above list   */
  table_value_constr *tvc;

  /* The interface employed to execute the select query by a foreign engine */
  select_handler *select_h;
  /* The object used to organize execution of the query by a foreign engine */
  select_handler *pushdown_select;
  List<TABLE_LIST> *join_list;    /* list for the currently parsed join  */
  st_select_lex *merged_into; /* select which this select is merged into */
                              /* (not 0 only for views/derived tables)   */
  const char *type;           /* type of select for EXPLAIN          */


  /* List of references to fields referenced from inner selects */
  List<Item_outer_ref> inner_refs_list;
  List<Item> attach_to_conds;
  /* Saved values of the WHERE and HAVING clauses*/
  Item::cond_result cond_value, having_value;
  /* 
    Usually it is pointer to ftfunc_list_alloc, but in union used to create
    fake select_lex for calling mysql_select under results of union
  */
  List<Item_func_match> *ftfunc_list;
  List<Item_func_match> ftfunc_list_alloc;
  /*
    The list of items to which MIN/MAX optimizations of opt_sum_query()
    have been applied. Used to rollback those optimizations if it's needed.
  */
  List<Item_sum> min_max_opt_list;
  List<TABLE_LIST> top_join_list; /* join list of the top level          */
  List<TABLE_LIST> sj_nests;      /* Semi-join nests within this join */
  /*
    Beginning of the list of leaves in a FROM clause, where the leaves
    inlcude all base tables including view tables. The tables are connected
    by TABLE_LIST::next_leaf, so leaf_tables points to the left-most leaf.

    List of all base tables local to a subquery including all view
    tables. Unlike 'next_local', this in this list views are *not*
    leaves. Created in setup_tables() -> make_leaves_list().
  */
  /* 
    Subqueries that will need to be converted to semi-join nests, including
    those converted to jtbm nests. The list is emptied when conversion is done.
  */
  List<Item_in_subselect> sj_subselects;
  /*
    List of IN-predicates in this st_select_lex that
    can be transformed into IN-subselect defined with TVC.
  */
  List<Item_func_in> in_funcs;
  /**
    Flag to guard against double initialization of leaf tables list
  */
  bool leaf_tables_saved;
  List<TABLE_LIST> leaf_tables;
  List<TABLE_LIST> leaf_tables_exec;
  List<TABLE_LIST> leaf_tables_prep;

  /* current index hint kind. used in filling up index_hints */
  enum index_hint_type current_index_hint_type;

  /*
    FROM clause - points to the beginning of the TABLE_LIST::next_local list.
  */
  SQL_I_List<TABLE_LIST>  table_list;

  /*
    GROUP BY clause.
    This list may be mutated during optimization (by remove_const()),
    so for prepared statements, we keep a copy of the ORDER.next pointers in
    group_list_ptrs, and re-establish the original list before each execution.
  */
  SQL_I_List<ORDER>       group_list;
  SQL_I_List<ORDER>       save_group_list;
  Group_list_ptrs        *group_list_ptrs;

  List<Item>          item_list;  /* list of fields & expressions */
  List<Item>          pre_fix;    /* above list before fix_fields */
  List<Item>          fix_after_optimize;
  SQL_I_List<ORDER> order_list;   /* ORDER clause */
  SQL_I_List<ORDER> save_order_list;
  SQL_I_List<ORDER> gorder_list;
  Lex_select_limit limit_params;  /* LIMIT clause parameters */

  /* Structure to store fields that are used in the GROUP BY of this select */
  List<Field_pair> grouping_tmp_fields;
  List<udf_func>     udf_list;                  /* udf function calls stack */
  List<Index_hint> *index_hints;  /* list of USE/FORCE/IGNORE INDEX */
  /*
    This list is used to restore the names of items
    from item_list after each execution of the statement.
  */
  List<Lex_ident_sys> *orig_names_of_item_list_elems;
  List<List_item> save_many_values;
  List<Item> *save_insert_list;

  bool                is_item_list_lookup:1;
  /*
    Needed to correctly generate 'PRIMARY' or 'SIMPLE' for select_type column
    of EXPLAIN
  */
  bool have_merged_subqueries:1;
  bool is_set_query_expr_tail:1;
  bool with_sum_func:1;   /* sum function indicator */
  bool with_rownum:1;     /* rownum() function indicator */
  bool braces:1;    /* SELECT ... UNION (SELECT ... ) <- this braces */
  bool automatic_brackets:1; /* dummy select for INTERSECT precedence */
  /* TRUE when having fix field called in processing of this SELECT */
  bool having_fix_field:1;
  /*
    TRUE when fix field is called for a new condition pushed into the
    HAVING clause of this SELECT
  */
  bool having_fix_field_for_pushed_cond:1;
  /*
    there are subquery in HAVING clause => we can't close tables before
    query processing end even if we use temporary table
  */
  bool subquery_in_having:1;
  /* TRUE <=> this SELECT is correlated w.r.t. some ancestor select */
  bool with_all_modifier:1;  /* used for selects in union */
  bool is_correlated:1;
  bool first_natural_join_processing:1;
  bool first_cond_optimization:1;
  /**
    The purpose of this flag is to run initialization phase for rownum
    only once. This flag is set on at st_select_lex::init_query and reset to
    the value false after the method optimize_rownum() has been called
    from the method JOIN::optimize_inner.
  */
  bool first_rownum_optimization:1;
  /* do not wrap view fields with Item_ref */
  bool no_wrap_view_item:1;
  /* exclude this select from check of unique_table() */
  bool exclude_from_table_unique_test:1;
  bool in_tvc:1;
  bool skip_locked:1;
  bool m_non_agg_field_used:1;
  bool m_agg_func_used:1;
  bool m_custom_agg_func_used:1;
  /* the select is "service-select" and can not have tables */
  bool is_service_select:1;

  /// Array of pointers to top elements of all_fields list
  Ref_ptr_array ref_pointer_array;
  ulong table_join_options;

  /*
    number of items in select_list and HAVING clause used to get number
    bigger then can be number of entries that will be added to all item
    list during split_sum_func
  */
  uint select_n_having_items;
  uint cond_count;    /* number of sargable Items in where/having/on */
  uint between_count; /* number of between predicates in where/having/on */
  uint max_equal_elems; /* max number of elements in multiple equalities */   
  /*
    Number of fields used in select list or where clause of current select
    and all inner subselects.
  */
  uint select_n_where_fields;
  /* Total number of elements in group by and order by lists */
  uint order_group_num;
  /* reserved for exists 2 in */
  uint select_n_reserved;
  /*
   it counts the number of bit fields in the SELECT list. These are used when
   DISTINCT is converted to a GROUP BY involving BIT fields.
  */
  uint hidden_bit_fields;
  /*
    Number of fields used in the definition of all the windows functions.
    This includes:
      1) Fields in the arguments
      2) Fields in the PARTITION BY clause
      3) Fields in the ORDER BY clause
  */
  /*
    Number of current derived table made with TVC during the
    transformation of IN-predicate into IN-subquery for this
    st_select_lex.
  */
  uint curr_tvc_name;
  /* true <=> select has been created a TVC wrapper */
  bool is_tvc_wrapper;
  uint fields_in_window_functions;
  uint insert_tables;
  enum_parsing_place parsing_place; /* where we are parsing expression */
  enum_parsing_place save_parsing_place;
  enum_parsing_place context_analysis_place; /* where we are in prepare */
  enum leaf_list_state {UNINIT, READY, SAVED};
  enum leaf_list_state prep_leaf_list_state;
  enum olap_type olap;
  /* SELECT [FOR UPDATE/LOCK IN SHARE MODE] [SKIP LOCKED] */
  enum select_lock_type {NONE, IN_SHARE_MODE, FOR_UPDATE};
  enum select_lock_type select_lock;

  uint in_sum_expr;
  uint select_number; /* number of select (used for EXPLAIN) */
  uint with_wild;     /* item list contain '*' ; Counter */
  /* Number of Item_sum-derived objects in this SELECT */
  uint n_sum_items;
  /* Number of Item_sum-derived objects in children and descendant SELECTs */
  uint n_child_sum_items;
  uint versioned_tables;                 /* For versioning */
  int nest_level;     /* nesting level of select */
  /* index in the select list of the expression currently being fixed */
  int cur_pos_in_select_list;

  /*
    This array is used to note  whether we have any candidates for
    expression caching in the corresponding clauses
  */
  bool expr_cache_may_be_used[PARSING_PLACE_SIZE];
  uint8 nest_flags; 
  /*
    This variable is required to ensure proper work of subqueries and
    stored procedures. Generally, one should use the states of
    Query_arena to determine if it's a statement prepare or first
    execution of a stored procedure. However, in case when there was an
    error during the first execution of a stored procedure, the SP body
    is not expelled from the SP cache. Therefore, a deeply nested
    subquery might be left unoptimized. So we need this per-subquery
    variable to inidicate the optimization/execution state of every
    subquery. Prepared statements work OK in that regard, as in
    case of an error during prepare the PS is not created.
  */
  uint8 changed_elements; // see TOUCHED_SEL_*

  /**
    The set of those tables whose fields are referenced in the select list of
    this select level.
  */
  table_map select_list_tables;

  /* Set to 1 if any field in field list has ROWNUM() */
  bool rownum_in_field_list;

  /* namp of nesting SELECT visibility (for aggregate functions check) */
  nesting_map name_visibility_map;
  table_map with_dep;
  index_clause_map current_index_hint_clause;

  /* it is for correct printing SELECT options */
  thr_lock_type lock_type;
  
  /** System Versioning */
  int vers_setup_conds(THD *thd, TABLE_LIST *tables);
  /* push new Item_field into item_list */
  bool vers_push_field(THD *thd, TABLE_LIST *table,
                       const LEX_CSTRING field_name);

  int period_setup_conds(THD *thd, TABLE_LIST *table);
  void init_query();
  void init_select();
  st_select_lex_unit* master_unit() { return (st_select_lex_unit*) master; }
  inline void set_master_unit(st_select_lex_unit *master_unit)
  {
    master= (st_select_lex_node *)master_unit;
  }
  void set_master(st_select_lex *master_arg)
  {
    master= master_arg;
  }
  st_select_lex_unit* first_inner_unit() 
  { 
    return (st_select_lex_unit*) slave; 
  }
  st_select_lex* outer_select();
  bool is_query_topmost(THD *thd);
  st_select_lex* next_select() { return (st_select_lex*) next; }
  st_select_lex* next_select_in_list() 
  {
    return (st_select_lex*) link_next;
  }
  st_select_lex_node** next_select_in_list_addr()
  {
    return &link_next;
  }
  st_select_lex* return_after_parsing()
  {
    return master_unit()->return_after_parsing();
  }
  inline bool is_subquery_function() { return master_unit()->item != 0; }

  bool mark_as_dependent(THD *thd, st_select_lex *last,
                         Item_ident *dependency);

  void set_braces(bool value)
  {
    braces= value;
  }
  bool inc_in_sum_expr();
  uint get_in_sum_expr();

  bool add_item_to_list(THD *thd, Item *item);
  bool add_group_to_list(THD *thd, Item *item, bool asc);
  bool add_ftfunc_to_list(THD *thd, Item_func_match *func);
  bool add_order_to_list(THD *thd, Item *item, bool asc);
  bool add_gorder_to_list(THD *thd, Item *item, bool asc);
  TABLE_LIST* add_table_to_list(THD *thd, Table_ident *table,
                                LEX_CSTRING *alias,
                                ulong table_options,
                                thr_lock_type flags= TL_UNLOCK,
                                enum_mdl_type mdl_type= MDL_SHARED_READ,
                                List<Index_hint> *hints= 0,
                                List<String> *partition_names= 0,
                                LEX_STRING *option= 0);
  TABLE_LIST* get_table_list();
  bool init_nested_join(THD *thd);
  TABLE_LIST *end_nested_join(THD *thd);
  TABLE_LIST *nest_last_join(THD *thd);
  void add_joined_table(TABLE_LIST *table);
  bool add_cross_joined_table(TABLE_LIST *left_op, TABLE_LIST *right_op,
                              bool straight_fl);
  TABLE_LIST *convert_right_join();
  List<Item>* get_item_list();
  bool save_item_list_names(THD *thd);
  void restore_item_list_names();

  ulong get_table_join_options();
  void set_lock_for_tables(thr_lock_type lock_type, bool for_update,
                           bool skip_locks);
  /*
    This method created for reiniting LEX in mysql_admin_table() and can be
    used only if you are going remove all SELECT_LEX & units except belonger
    to LEX (LEX::unit & LEX::select, for other purposes there are
    SELECT_LEX_UNIT::exclude_level & SELECT_LEX_UNIT::exclude_tree
  */
  void cut_subtree() { slave= 0; }
  bool test_limit();
  /**
    Get offset for LIMIT.

    Evaluate offset item if necessary.

    @return Number of rows to skip.
  */
  ha_rows get_offset();
  /**
   Get limit.

   Evaluate limit item if necessary.

   @return Limit of rows in result.
  */
  ha_rows get_limit();

  friend struct LEX;
  st_select_lex() : group_list_ptrs(NULL), braces(0),
                    automatic_brackets(0), n_sum_items(0), n_child_sum_items(0)
  {}
  void make_empty_select()
  {
    init_query();
    init_select();
  }
  bool setup_ref_array(THD *thd, uint order_group_num);
  uint get_cardinality_of_ref_ptrs_slice(uint order_group_num_arg);
  void print(THD *thd, String *str, enum_query_type query_type);
  void print_lock_type(String *str);
  void print_item_list(THD *thd, String *str, enum_query_type query_type);
  void print_set_clause(THD *thd, String *str, enum_query_type query_type);
  void print_on_duplicate_key_clause(THD *thd, String *str,
                                     enum_query_type query_type);
  static void print_order(String *str,
                          ORDER *order,
                          enum_query_type query_type);
  void print_limit(THD *thd, String *str, enum_query_type query_type);
  void fix_prepare_information(THD *thd, Item **conds, Item **having_conds);
  /*
    Destroy the used execution plan (JOIN) of this subtree (this
    SELECT_LEX and all nested SELECT_LEXes and SELECT_LEX_UNITs).
  */
  bool cleanup();
  /*
    Recursively cleanup the join of this select lex and of all nested
    select lexes.
  */
  void cleanup_all_joins(bool full);

  void set_index_hint_type(enum index_hint_type type, index_clause_map clause);

  /* 
   Add a index hint to the tagged list of hints. The type and clause of the
   hint will be the current ones (set by set_index_hint()) 
  */
  bool add_index_hint (THD *thd, const char *str, size_t length);

  /* make a list to hold index hints */
  void alloc_index_hints (THD *thd);
  /* read and clear the index hints */
  List<Index_hint>* pop_index_hints(void) 
  {
    List<Index_hint> *hints= index_hints;
    index_hints= NULL;
    return hints;
  }

  inline void clear_index_hints(void) { index_hints= NULL; }
  bool is_part_of_union() { return master_unit()->is_unit_op(); }
  bool is_top_level_node() 
  { 
    return (select_number == 1) && !is_part_of_union();
  }
  bool optimize_unflattened_subqueries(bool const_only);
  /* Set the EXPLAIN type for this subquery. */
  void set_explain_type(bool on_the_fly);
  bool handle_derived(LEX *lex, uint phases);
  void append_table_to_list(TABLE_LIST *TABLE_LIST::*link, TABLE_LIST *table);
  bool get_free_table_map(table_map *map, uint *tablenr);
  void replace_leaf_table(TABLE_LIST *table, List<TABLE_LIST> &tbl_list);
  void remap_tables(TABLE_LIST *derived, table_map map,
                    uint tablenr, st_select_lex *parent_lex);
  bool merge_subquery(THD *thd, TABLE_LIST *derived, st_select_lex *subq_lex,
                      uint tablenr, table_map map);
  inline bool is_mergeable()
  {
    return (next_select() == 0 && group_list.elements == 0 &&
            having == 0 && with_sum_func == 0 && with_rownum == 0 &&
            table_list.elements >= 1 && !(options & SELECT_DISTINCT) &&
            limit_params.select_limit == 0);
  }
  void mark_as_belong_to_derived(TABLE_LIST *derived);
  void increase_derived_records(ha_rows records);
  void update_used_tables();
  void update_correlated_cache();
  void mark_const_derived(bool empty);

  bool save_leaf_tables(THD *thd);
  bool save_prep_leaf_tables(THD *thd);

  void set_unique_exclude();

  bool is_merged_child_of(st_select_lex *ancestor);

  /*
    For MODE_ONLY_FULL_GROUP_BY we need to maintain two flags:
     - Non-aggregated fields are used in this select.
     - Aggregate functions are used in this select.
    In MODE_ONLY_FULL_GROUP_BY only one of these may be true.
  */
  bool non_agg_field_used() const { return m_non_agg_field_used; }
  bool agg_func_used()      const { return m_agg_func_used; }
  bool custom_agg_func_used() const { return m_custom_agg_func_used; }

  void set_non_agg_field_used(bool val) { m_non_agg_field_used= val; }
  void set_agg_func_used(bool val)      { m_agg_func_used= val; }
  void set_custom_agg_func_used(bool val) { m_custom_agg_func_used= val; }
  inline void set_with_clause(With_clause *with_clause);
  With_clause *get_with_clause()
  {
    return master_unit()->with_clause;
  }
  With_element *get_with_element()
  {
    return master_unit()->cloned_from ?
           master_unit()->cloned_from->with_element :
           master_unit()->with_element;
  }
  With_element *find_table_def_in_with_clauses(TABLE_LIST *table,
                                               st_select_lex_unit * excl_spec);
  bool check_unrestricted_recursive(bool only_standard_compliant);
  bool check_subqueries_with_recursive_references();
  void collect_grouping_fields_for_derived(THD *thd, ORDER *grouping_list);
  bool collect_grouping_fields(THD *thd);
  bool collect_fields_equal_to_grouping(THD *thd);
  void check_cond_extraction_for_grouping_fields(THD *thd, Item *cond);
  Item *build_cond_for_grouping_fields(THD *thd, Item *cond,
                                       bool no_to_clones);
  
  List<Window_spec> window_specs;
  bool is_win_spec_list_built;
  void prepare_add_window_spec(THD *thd);
  bool add_window_def(THD *thd, LEX_CSTRING *win_name, LEX_CSTRING *win_ref,
                      SQL_I_List<ORDER> win_partition_list,
                      SQL_I_List<ORDER> win_order_list,
                      Window_frame *win_frame);
  bool add_window_spec(THD *thd, LEX_CSTRING *win_ref,
                       SQL_I_List<ORDER> win_partition_list,
                       SQL_I_List<ORDER> win_order_list,
                       Window_frame *win_frame);
  List<Item_window_func> window_funcs;
  bool add_window_func(Item_window_func *win_func);

  bool have_window_funcs() const { return (window_funcs.elements !=0); }
  ORDER *find_common_window_func_partition_fields(THD *thd);

  bool cond_pushdown_is_allowed() const
  { return !olap && !limit_params.explicit_limit && !tvc && !with_rownum; }
  
  bool build_pushable_cond_for_having_pushdown(THD *thd, Item *cond);
  void pushdown_cond_into_where_clause(THD *thd, Item *extracted_cond,
                                       Item **remaining_cond,
                                       Item_transformer transformer,
                                       uchar *arg);
  Item *pushdown_from_having_into_where(THD *thd, Item *having);

  select_handler *find_select_handler(THD *thd);

  bool is_set_op()
  {
    return linkage == UNION_TYPE || 
           linkage == EXCEPT_TYPE || 
           linkage == INTERSECT_TYPE;
  }

  inline void add_where_field(st_select_lex *sel)
  {
    DBUG_ASSERT(this != sel);
    select_n_where_fields+= sel->select_n_where_fields;
  }
  inline void set_linkage_and_distinct(enum sub_select_type l, bool d)
  {
    DBUG_ENTER("SELECT_LEX::set_linkage_and_distinct");
    DBUG_PRINT("info", ("select: %p  distinct %d", this, d));
    set_linkage(l);
    DBUG_ASSERT(l == UNION_TYPE ||
                l == INTERSECT_TYPE ||
                l == EXCEPT_TYPE);
    if (d && master_unit() && master_unit()->union_distinct != this)
      master_unit()->union_distinct= this;
    distinct= d;
    with_all_modifier= !distinct;
    DBUG_VOID_RETURN;
  }
  bool set_nest_level(int new_nest_level);
  bool check_parameters(SELECT_LEX *main_select);
  void mark_select()
  {
    DBUG_ENTER("st_select_lex::mark_select()");
    DBUG_PRINT("info", ("Select #%d", select_number));
    DBUG_VOID_RETURN;
  }
  void register_unit(SELECT_LEX_UNIT *unit,
                     Name_resolution_context *outer_context);
  SELECT_LEX_UNIT *attach_selects_chain(SELECT_LEX *sel,
                                        Name_resolution_context *context);
  void add_statistics(SELECT_LEX_UNIT *unit);
  bool make_unique_derived_name(THD *thd, LEX_CSTRING *alias);
  void lex_start(LEX *plex);
  bool is_unit_nest() { return (nest_flags & UNIT_NEST_FL); }
  void mark_as_unit_nest() { nest_flags= UNIT_NEST_FL; }

  TABLE_LIST *find_table(THD *thd,
                         const LEX_CSTRING *db_name,
                         const LEX_CSTRING *table_name);
};
typedef class st_select_lex SELECT_LEX;

inline bool st_select_lex_unit::is_unit_op ()
{
  if (!first_select()->next_select())
  {
    if (first_select()->tvc)
      return 1;
    else
      return 0;
  }

  enum sub_select_type linkage= first_select()->next_select()->linkage;
  return linkage == UNION_TYPE || linkage == INTERSECT_TYPE ||
    linkage == EXCEPT_TYPE;
}


struct st_sp_chistics
{
  LEX_CSTRING comment;
  enum enum_sp_suid_behaviour suid;
  bool detistic;
  enum enum_sp_data_access daccess;
  enum enum_sp_aggregate_type agg_type;
  void init() { bzero(this, sizeof(*this)); }
  void set(const st_sp_chistics &other) { *this= other; }
  bool read_from_mysql_proc_row(THD *thd, TABLE *table);
};


class Sp_chistics: public st_sp_chistics
{
public:
  Sp_chistics() { init(); }
};


struct st_trg_chistics: public st_trg_execution_order
{
  enum trg_action_time_type action_time;
  enum trg_event_type event;

  const char *ordering_clause_begin;
  const char *ordering_clause_end;

};

enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE,
                      XA_SUSPEND, XA_FOR_MIGRATE};

class Sroutine_hash_entry;

/*
  Class representing list of all tables used by statement and other
  information which is necessary for opening and locking its tables,
  like SQL command for this statement.

  Also contains information about stored functions used by statement
  since during its execution we may have to add all tables used by its
  stored functions/triggers to this list in order to pre-open and lock
  them.

  Also used by LEX::reset_n_backup/restore_backup_query_tables_list()
  methods to save and restore this information.
*/

class Query_tables_list
{
public:
  /**
    SQL command for this statement. Part of this class since the
    process of opening and locking tables for the statement needs
    this information to determine correct type of lock for some of
    the tables.
  */
  enum_sql_command sql_command;
  /* Global list of all tables used by this statement */
  TABLE_LIST *query_tables;
  /* Pointer to next_global member of last element in the previous list. */
  TABLE_LIST **query_tables_last;
  /*
    If non-0 then indicates that query requires prelocking and points to
    next_global member of last own element in query table list (i.e. last
    table which was not added to it as part of preparation to prelocking).
    0 - indicates that this query does not need prelocking.
  */
  TABLE_LIST **query_tables_own_last;
  /*
    Set of stored routines called by statement.
    (Note that we use lazy-initialization for this hash).
  */
  enum { START_SROUTINES_HASH_SIZE= 16 };
  HASH sroutines;
  /*
    List linking elements of 'sroutines' set. Allows you to add new elements
    to this set as you iterate through the list of existing elements.
    'sroutines_list_own_last' is pointer to ::next member of last element of
    this list which represents routine which is explicitly used by query.
    'sroutines_list_own_elements' number of explicitly used routines.
    We use these two members for restoring of 'sroutines_list' to the state
    in which it was right after query parsing.
  */
  SQL_I_List<Sroutine_hash_entry> sroutines_list;
  Sroutine_hash_entry **sroutines_list_own_last;
  uint sroutines_list_own_elements;

   /*
    These constructor and destructor serve for creation/destruction
    of Query_tables_list instances which are used as backup storage.
  */
  Query_tables_list() = default;
  ~Query_tables_list() = default;

  /* Initializes (or resets) Query_tables_list object for "real" use. */
  void reset_query_tables_list(bool init);
  void destroy_query_tables_list();
  void set_query_tables_list(Query_tables_list *state)
  {
    *this= *state;
  }

  /*
    Direct addition to the list of query tables.
    If you are using this function, you must ensure that the table
    object, in particular table->db member, is initialized.
  */
  void add_to_query_tables(TABLE_LIST *table)
  {
    *(table->prev_global= query_tables_last)= table;
    query_tables_last= &table->next_global;
  }
  bool requires_prelocking()
  {
    return MY_TEST(query_tables_own_last);
  }
  void mark_as_requiring_prelocking(TABLE_LIST **tables_own_last)
  {
    query_tables_own_last= tables_own_last;
  }
  /* Return pointer to first not-own table in query-tables or 0 */
  TABLE_LIST* first_not_own_table()
  {
    return ( query_tables_own_last ? *query_tables_own_last : 0);
  }
  void chop_off_not_own_tables()
  {
    if (query_tables_own_last)
    {
      *query_tables_own_last= 0;
      query_tables_last= query_tables_own_last;
      query_tables_own_last= 0;
    }
  }

  /** Return a pointer to the last element in query table list. */
  TABLE_LIST *last_table()
  {
    /* Don't use offsetof() macro in order to avoid warnings. */
    return query_tables ?
           (TABLE_LIST*) ((char*) query_tables_last -
                          ((char*) &(query_tables->next_global) -
                           (char*) query_tables)) :
           0;
  }

  /**
    Enumeration listing of all types of unsafe statement.

    @note The order of elements of this enumeration type must
    correspond to the order of the elements of the @c explanations
    array defined in the body of @c THD::issue_unsafe_warnings.
  */
  enum enum_binlog_stmt_unsafe {
    /**
      SELECT..LIMIT is unsafe because the set of rows returned cannot
      be predicted.
    */
    BINLOG_STMT_UNSAFE_LIMIT= 0,
    /**
      INSERT DELAYED is unsafe because the time when rows are inserted
      cannot be predicted.
    */
    BINLOG_STMT_UNSAFE_INSERT_DELAYED,
    /**
      Access to log tables is unsafe because slave and master probably
      log different things.
    */
    BINLOG_STMT_UNSAFE_SYSTEM_TABLE,
    /**
      Inserting into an autoincrement column in a stored routine is unsafe.
      Even with just one autoincrement column, if the routine is invoked more than 
      once slave is not guaranteed to execute the statement graph same way as 
      the master.
      And since it's impossible to estimate how many times a routine can be invoked at 
      the query pre-execution phase (see lock_tables), the statement is marked
      pessimistically unsafe. 
    */
    BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS,
    /**
      Using a UDF (user-defined function) is unsafe.
    */
    BINLOG_STMT_UNSAFE_UDF,
    /**
      Using most system variables is unsafe, because slave may run
      with different options than master.
    */
    BINLOG_STMT_UNSAFE_SYSTEM_VARIABLE,
    /**
      Using some functions is unsafe (e.g., UUID).
    */
    BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION,

    /**
      Mixing transactional and non-transactional statements are unsafe if
      non-transactional reads or writes are occur after transactional
      reads or writes inside a transaction.
    */
    BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS,

    /**
      Mixing self-logging and non-self-logging engines in a statement
      is unsafe.
    */
    BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE,

    /**
      Statements that read from both transactional and non-transactional
      tables and write to any of them are unsafe.
    */
    BINLOG_STMT_UNSAFE_MIXED_STATEMENT,

    /**
      INSERT...IGNORE SELECT is unsafe because which rows are ignored depends
      on the order that rows are retrieved by SELECT. This order cannot be
      predicted and may differ on master and the slave.
    */
    BINLOG_STMT_UNSAFE_INSERT_IGNORE_SELECT,

    /**
      INSERT...SELECT...UPDATE is unsafe because which rows are updated depends
      on the order that rows are retrieved by SELECT. This order cannot be
      predicted and may differ on master and the slave.
    */
    BINLOG_STMT_UNSAFE_INSERT_SELECT_UPDATE,

    /**
     Query that writes to a table with auto_inc column after selecting from 
     other tables are unsafe as the order in which the rows are retrieved by
     select may differ on master and slave.
    */
    BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT,

    /**
      INSERT...REPLACE SELECT is unsafe because which rows are replaced depends
      on the order that rows are retrieved by SELECT. This order cannot be
      predicted and may differ on master and the slave.
    */
    BINLOG_STMT_UNSAFE_REPLACE_SELECT,

    /**
      CREATE TABLE... IGNORE... SELECT is unsafe because which rows are ignored
      depends on the order that rows are retrieved by SELECT. This order cannot
      be predicted and may differ on master and the slave.
    */
    BINLOG_STMT_UNSAFE_CREATE_IGNORE_SELECT,

    /**
      CREATE TABLE...REPLACE... SELECT is unsafe because which rows are replaced
      depends on the order that rows are retrieved from SELECT. This order
      cannot be predicted and may differ on master and the slave
    */
    BINLOG_STMT_UNSAFE_CREATE_REPLACE_SELECT,

    /**
      CREATE TABLE...SELECT on a table with auto-increment column is unsafe
      because which rows are replaced depends on the order that rows are
      retrieved from SELECT. This order cannot be predicted and may differ on
      master and the slave
    */
    BINLOG_STMT_UNSAFE_CREATE_SELECT_AUTOINC,

    /**
      UPDATE...IGNORE is unsafe because which rows are ignored depends on the
      order that rows are updated. This order cannot be predicted and may differ
      on master and the slave.
    */
    BINLOG_STMT_UNSAFE_UPDATE_IGNORE,

    /**
      INSERT... ON DUPLICATE KEY UPDATE on a table with more than one
      UNIQUE KEYS  is unsafe.
    */
    BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS,

    /**
       INSERT into auto-inc field which is not the first part of composed
       primary key.
    */
    BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST,

    /**
       Autoincrement lock mode is incompatible with STATEMENT binlog format.
    */
    BINLOG_STMT_UNSAFE_AUTOINC_LOCK_MODE,

    /**
       INSERT .. SELECT ... SKIP LOCKED is unlikely to have the same
       rows locked on the replica.
       primary key.
    */
    BINLOG_STMT_UNSAFE_SKIP_LOCKED,

    /* The last element of this enumeration type. */
    BINLOG_STMT_UNSAFE_COUNT
  };
  /**
    This has all flags from 0 (inclusive) to BINLOG_STMT_FLAG_COUNT
    (exclusive) set.
  */
  static const uint32 BINLOG_STMT_UNSAFE_ALL_FLAGS=
    ((1U << BINLOG_STMT_UNSAFE_COUNT) - 1);

  /**
    Maps elements of enum_binlog_stmt_unsafe to error codes.
  */
  static const int binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT];

  /**
    Determine if this statement is marked as unsafe.

    @retval 0 if the statement is not marked as unsafe.
    @retval nonzero if the statement is marked as unsafe.
  */
  inline bool is_stmt_unsafe() const {
    return get_stmt_unsafe_flags() != 0;
  }

  inline bool is_stmt_unsafe(enum_binlog_stmt_unsafe unsafe)
  {
    return binlog_stmt_flags & (1 << unsafe);
  }

  /**
    Flag the current (top-level) statement as unsafe.
    The flag will be reset after the statement has finished.

    @param unsafe_type The type of unsafety: one of the @c
    BINLOG_STMT_FLAG_UNSAFE_* flags in @c enum_binlog_stmt_flag.
  */
  inline void set_stmt_unsafe(enum_binlog_stmt_unsafe unsafe_type) {
    DBUG_ENTER("set_stmt_unsafe");
    DBUG_ASSERT(unsafe_type >= 0 && unsafe_type < BINLOG_STMT_UNSAFE_COUNT);
    binlog_stmt_flags|= (1U << unsafe_type);
    DBUG_VOID_RETURN;
  }

  /**
    Set the bits of binlog_stmt_flags determining the type of
    unsafeness of the current statement.  No existing bits will be
    cleared, but new bits may be set.

    @param flags A binary combination of zero or more bits, (1<<flag)
    where flag is a member of enum_binlog_stmt_unsafe.
  */
  inline void set_stmt_unsafe_flags(uint32 flags) {
    DBUG_ENTER("set_stmt_unsafe_flags");
    DBUG_ASSERT((flags & ~BINLOG_STMT_UNSAFE_ALL_FLAGS) == 0);
    binlog_stmt_flags|= flags;
    DBUG_VOID_RETURN;
  }

  /**
    Return a binary combination of all unsafe warnings for the
    statement.  If the statement has been marked as unsafe by the
    'flag' member of enum_binlog_stmt_unsafe, then the return value
    from this function has bit (1<<flag) set to 1.
  */
  inline uint32 get_stmt_unsafe_flags() const {
    DBUG_ENTER("get_stmt_unsafe_flags");
    DBUG_RETURN(binlog_stmt_flags & BINLOG_STMT_UNSAFE_ALL_FLAGS);
  }

  /**
    Mark the current statement as safe; i.e., clear all bits in
    binlog_stmt_flags that correspond to elements of
    enum_binlog_stmt_unsafe.
  */
  inline void clear_stmt_unsafe() {
    DBUG_ENTER("clear_stmt_unsafe");
    binlog_stmt_flags&= ~BINLOG_STMT_UNSAFE_ALL_FLAGS;
    DBUG_VOID_RETURN;
  }

  /**
    Determine if this statement is a row injection.

    @retval 0 if the statement is not a row injection
    @retval nonzero if the statement is a row injection
  */
  inline bool is_stmt_row_injection() const {
    return binlog_stmt_flags & (1U << BINLOG_STMT_TYPE_ROW_INJECTION);
  }

  /**
    Flag the statement as a row injection.  A row injection is either
    a BINLOG statement, or a row event in the relay log executed by
    the slave SQL thread.
  */
  inline void set_stmt_row_injection() {
    DBUG_ENTER("set_stmt_row_injection");
    binlog_stmt_flags|= (1U << BINLOG_STMT_TYPE_ROW_INJECTION);
    DBUG_VOID_RETURN;
  }

  enum enum_stmt_accessed_table
  {
    /*
       If a transactional table is about to be read. Note that
       a write implies a read.
    */
    STMT_READS_TRANS_TABLE= 0,
    /*
       If a non-transactional table is about to be read. Note that
       a write implies a read.
    */
    STMT_READS_NON_TRANS_TABLE,
    /*
       If a temporary transactional table is about to be read. Note
       that a write implies a read.
    */
    STMT_READS_TEMP_TRANS_TABLE,
    /*
       If a temporary non-transactional table is about to be read. Note
      that a write implies a read.
    */
    STMT_READS_TEMP_NON_TRANS_TABLE,
    /*
       If a transactional table is about to be updated.
    */
    STMT_WRITES_TRANS_TABLE,
    /*
       If a non-transactional table is about to be updated.
    */
    STMT_WRITES_NON_TRANS_TABLE,
    /*
       If a temporary transactional table is about to be updated.
    */
    STMT_WRITES_TEMP_TRANS_TABLE,
    /*
       If a temporary non-transactional table is about to be updated.
    */
    STMT_WRITES_TEMP_NON_TRANS_TABLE,
    /*
      The last element of the enumeration. Please, if necessary add
      anything before this.
    */
    STMT_ACCESS_TABLE_COUNT
  };

#ifndef DBUG_OFF
  static inline const char *stmt_accessed_table_string(enum_stmt_accessed_table accessed_table)
  {
    switch (accessed_table)
    {
      case STMT_READS_TRANS_TABLE:
         return "STMT_READS_TRANS_TABLE";
      break;
      case STMT_READS_NON_TRANS_TABLE:
        return "STMT_READS_NON_TRANS_TABLE";
      break;
      case STMT_READS_TEMP_TRANS_TABLE:
        return "STMT_READS_TEMP_TRANS_TABLE";
      break;
      case STMT_READS_TEMP_NON_TRANS_TABLE:
        return "STMT_READS_TEMP_NON_TRANS_TABLE";
      break;  
      case STMT_WRITES_TRANS_TABLE:
        return "STMT_WRITES_TRANS_TABLE";
      break;
      case STMT_WRITES_NON_TRANS_TABLE:
        return "STMT_WRITES_NON_TRANS_TABLE";
      break;
      case STMT_WRITES_TEMP_TRANS_TABLE:
        return "STMT_WRITES_TEMP_TRANS_TABLE";
      break;
      case STMT_WRITES_TEMP_NON_TRANS_TABLE:
        return "STMT_WRITES_TEMP_NON_TRANS_TABLE";
      break;
      case STMT_ACCESS_TABLE_COUNT:
      default:
        DBUG_ASSERT(0);
      break;
    }
    MY_ASSERT_UNREACHABLE();
    return "";
  }
#endif  /* DBUG */
               
  #define BINLOG_DIRECT_ON 0xF0    /* unsafe when
                                      --binlog-direct-non-trans-updates
                                      is ON */

  #define BINLOG_DIRECT_OFF 0xF    /* unsafe when
                                      --binlog-direct-non-trans-updates
                                      is OFF */

  #define TRX_CACHE_EMPTY 0x33     /* unsafe when trx-cache is empty */

  #define TRX_CACHE_NOT_EMPTY 0xCC /* unsafe when trx-cache is not empty */

  #define IL_LT_REPEATABLE 0xAA    /* unsafe when < ISO_REPEATABLE_READ */

  #define IL_GTE_REPEATABLE 0x55   /* unsafe when >= ISO_REPEATABLE_READ */
  
  /**
    Sets the type of table that is about to be accessed while executing a
    statement.

    @param accessed_table Enumeration type that defines the type of table,
                           e.g. temporary, transactional, non-transactional.
  */
  inline void set_stmt_accessed_table(enum_stmt_accessed_table accessed_table)
  {
    DBUG_ENTER("LEX::set_stmt_accessed_table");

    DBUG_ASSERT(accessed_table >= 0 && accessed_table < STMT_ACCESS_TABLE_COUNT);
    stmt_accessed_table_flag |= (1U << accessed_table);

    DBUG_VOID_RETURN;
  }

  /**
    Checks if a type of table is about to be accessed while executing a
    statement.

    @param accessed_table Enumeration type that defines the type of table,
           e.g. temporary, transactional, non-transactional.

    @return
      @retval TRUE  if the type of the table is about to be accessed
      @retval FALSE otherwise
  */
  inline bool stmt_accessed_table(enum_stmt_accessed_table accessed_table)
  {
    DBUG_ENTER("LEX::stmt_accessed_table");

    DBUG_ASSERT(accessed_table >= 0 && accessed_table < STMT_ACCESS_TABLE_COUNT);

    DBUG_RETURN((stmt_accessed_table_flag & (1U << accessed_table)) != 0);
  }

  /**
    Checks either a trans/non trans temporary table is being accessed while
    executing a statement.

    @return
      @retval TRUE  if a temporary table is being accessed
      @retval FALSE otherwise
  */
  inline bool stmt_accessed_temp_table()
  {
    DBUG_ENTER("THD::stmt_accessed_temp_table");
    DBUG_RETURN(stmt_accessed_non_trans_temp_table() ||
                stmt_accessed_trans_temp_table());
  }

  /**
    Checks if a temporary transactional table is being accessed while executing
    a statement.

    @return
      @retval TRUE  if a temporary transactional table is being accessed
      @retval FALSE otherwise
  */
  inline bool stmt_accessed_trans_temp_table()
  {
    DBUG_ENTER("THD::stmt_accessed_trans_temp_table");

    DBUG_RETURN((stmt_accessed_table_flag &
                ((1U << STMT_READS_TEMP_TRANS_TABLE) |
                 (1U << STMT_WRITES_TEMP_TRANS_TABLE))) != 0);
  }
  inline bool stmt_writes_to_non_temp_table()
  {
    DBUG_ENTER("THD::stmt_writes_to_non_temp_table");

    DBUG_RETURN((stmt_accessed_table_flag &
                ((1U << STMT_WRITES_TRANS_TABLE) |
                 (1U << STMT_WRITES_NON_TRANS_TABLE))));
  }

  /**
    Checks if a temporary non-transactional table is about to be accessed
    while executing a statement.

    @return
      @retval TRUE  if a temporary non-transactional table is about to be
                    accessed
      @retval FALSE otherwise
  */
  inline bool stmt_accessed_non_trans_temp_table()
  {
    DBUG_ENTER("THD::stmt_accessed_non_trans_temp_table");

    DBUG_RETURN((stmt_accessed_table_flag &
                ((1U << STMT_READS_TEMP_NON_TRANS_TABLE) |
                 (1U << STMT_WRITES_TEMP_NON_TRANS_TABLE))) != 0);
  }

  /*
    Checks if a mixed statement is unsafe.

    
    @param in_multi_stmt_transaction_mode defines if there is an on-going
           multi-transactional statement.
    @param binlog_direct defines if --binlog-direct-non-trans-updates is
           active.
    @param trx_cache_is_not_empty defines if the trx-cache is empty or not.
    @param trx_isolation defines the isolation level.
 
    @return
      @retval TRUE if the mixed statement is unsafe
      @retval FALSE otherwise
  */
  inline bool is_mixed_stmt_unsafe(bool in_multi_stmt_transaction_mode,
                                   bool binlog_direct,
                                   bool trx_cache_is_not_empty,
                                   uint tx_isolation)
  {
    bool unsafe= FALSE;

    if (in_multi_stmt_transaction_mode)
    {
       uint condition=
         (binlog_direct ? BINLOG_DIRECT_ON : BINLOG_DIRECT_OFF) &
         (trx_cache_is_not_empty ? TRX_CACHE_NOT_EMPTY : TRX_CACHE_EMPTY) &
         (tx_isolation >= ISO_REPEATABLE_READ ? IL_GTE_REPEATABLE : IL_LT_REPEATABLE);

      unsafe= (binlog_unsafe_map[stmt_accessed_table_flag] & condition);

#if !defined(DBUG_OFF)
      DBUG_PRINT("LEX::is_mixed_stmt_unsafe", ("RESULT %02X %02X %02X", condition,
              binlog_unsafe_map[stmt_accessed_table_flag],
              (binlog_unsafe_map[stmt_accessed_table_flag] & condition)));
 
      int type_in= 0;
      for (; type_in < STMT_ACCESS_TABLE_COUNT; type_in++)
      {
        if (stmt_accessed_table((enum_stmt_accessed_table) type_in))
          DBUG_PRINT("LEX::is_mixed_stmt_unsafe", ("ACCESSED %s ",
                  stmt_accessed_table_string((enum_stmt_accessed_table) type_in)));
      }
#endif
    }

    if (stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE) &&
      stmt_accessed_table(STMT_READS_TRANS_TABLE) &&
      tx_isolation < ISO_REPEATABLE_READ)
      unsafe= TRUE;
    else if (stmt_accessed_table(STMT_WRITES_TEMP_NON_TRANS_TABLE) &&
      stmt_accessed_table(STMT_READS_TRANS_TABLE) &&
      tx_isolation < ISO_REPEATABLE_READ)
      unsafe= TRUE;

    return(unsafe);
  }

  /**
    true if the parsed tree contains references to stored procedures
    or functions, false otherwise
  */
  bool uses_stored_routines() const
  { return sroutines_list.elements != 0; }

private:

  /**
    Enumeration listing special types of statements.

    Currently, the only possible type is ROW_INJECTION.
  */
  enum enum_binlog_stmt_type {
    /**
      The statement is a row injection (i.e., either a BINLOG
      statement or a row event executed by the slave SQL thread).
    */
    BINLOG_STMT_TYPE_ROW_INJECTION = BINLOG_STMT_UNSAFE_COUNT,

    /** The last element of this enumeration type. */
    BINLOG_STMT_TYPE_COUNT
  };

  /**
    Bit field indicating the type of statement.

    There are two groups of bits:

    - The low BINLOG_STMT_UNSAFE_COUNT bits indicate the types of
      unsafeness that the current statement has.

      - The next BINLOG_STMT_TYPE_COUNT-BINLOG_STMT_TYPE_COUNT bits indicate if
      the statement is of some special type.

    This must be a member of LEX, not of THD: each stored procedure
    needs to remember its unsafeness state between calls and each
    stored procedure has its own LEX object (but no own THD object).
  */
  uint32 binlog_stmt_flags;

  /**
    Bit field that determines the type of tables that are about to be
    be accessed while executing a statement.
  */
  uint32 stmt_accessed_table_flag;
};


/*
  st_parsing_options contains the flags for constructions that are
  allowed in the current statement.
*/

struct st_parsing_options
{
  bool allows_variable;
  bool lookup_keywords_after_qualifier;

  st_parsing_options() { reset(); }
  void reset();
};


/**
  The state of the lexical parser, when parsing comments.
*/
enum enum_comment_state
{
  /**
    Not parsing comments.
  */
  NO_COMMENT,
  /**
    Parsing comments that need to be preserved.
    Typically, these are user comments '/' '*' ... '*' '/'.
  */
  PRESERVE_COMMENT,
  /**
    Parsing comments that need to be discarded.
    Typically, these are special comments '/' '*' '!' ... '*' '/',
    or '/' '*' '!' 'M' 'M' 'm' 'm' 'm' ... '*' '/', where the comment
    markers should not be expanded.
  */
  DISCARD_COMMENT
};


/**
  @brief This class represents the character input stream consumed during
  lexical analysis.

  In addition to consuming the input stream, this class performs some
  comment pre processing, by filtering out out of bound special text
  from the query input stream.
  Two buffers, with pointers inside each buffers, are maintained in
  parallel. The 'raw' buffer is the original query text, which may
  contain out-of-bound comments. The 'cpp' (for comments pre processor)
  is the pre-processed buffer that contains only the query text that
  should be seen once out-of-bound data is removed.
*/

class Lex_input_stream
{
  size_t unescape(CHARSET_INFO *cs, char *to,
                  const char *str, const char *end, int sep);
  my_charset_conv_wc_mb get_escape_func(THD *thd, my_wc_t sep) const;
public:
  Lex_input_stream() = default;

  ~Lex_input_stream() = default;

  /**
     Object initializer. Must be called before usage.

     @retval FALSE OK
     @retval TRUE  Error
  */
  bool init(THD *thd, char *buff, size_t length);

  void reset(char *buff, size_t length);

  /**
    The main method to scan the next token, with token contraction processing
    for LALR(2) resolution, e.g. translate "WITH" followed by "ROLLUP"
    to a single token WITH_ROLLUP_SYM.
  */
  int lex_token(union YYSTYPE *yylval, THD *thd);

  void reduce_digest_token(uint token_left, uint token_right);

private:

  enum Ident_mode
  {
    GENERAL_KEYWORD_OR_FUNC_LPAREN,
    QUALIFIED_SPECIAL_FUNC_LPAREN
  };

  int scan_ident_common(THD *thd, Lex_ident_cli_st *str, Ident_mode mode);

  /**
    Set the echo mode.

    When echo is true, characters parsed from the raw input stream are
    preserved. When false, characters parsed are silently ignored.
    @param echo the echo mode.
  */
  void set_echo(bool echo)
  {
    m_echo= echo;
  }

  void save_in_comment_state()
  {
    m_echo_saved= m_echo;
    in_comment_saved= in_comment;
  }

  void restore_in_comment_state()
  {
    m_echo= m_echo_saved;
    in_comment= in_comment_saved;
  }

  /**
    Skip binary from the input stream.
    @param n number of bytes to accept.
  */
  void skip_binary(int n)
  {
    if (m_echo)
    {
      memcpy(m_cpp_ptr, m_ptr, n);
      m_cpp_ptr += n;
    }
    m_ptr += n;
  }

  /**
    Get a character, and advance in the stream.
    @return the next character to parse.
  */
  unsigned char yyGet()
  {
    char c= *m_ptr++;
    if (m_echo)
      *m_cpp_ptr++ = c;
    return c;
  }

  /**
    Get the last character accepted.
    @return the last character accepted.
  */
  unsigned char yyGetLast() const
  {
    return m_ptr[-1];
  }

  /**
    Look at the next character to parse, but do not accept it.
  */
  unsigned char yyPeek() const
  {
    return m_ptr[0];
  }

  /**
    Look ahead at some character to parse.
    @param n offset of the character to look up
  */
  unsigned char yyPeekn(int n) const
  {
    return m_ptr[n];
  }

  /**
    Cancel the effect of the last yyGet() or yySkip().
    Note that the echo mode should not change between calls to yyGet / yySkip
    and yyUnget. The caller is responsible for ensuring that.
  */
  void yyUnget()
  {
    m_ptr--;
    if (m_echo)
      m_cpp_ptr--;
  }

  /**
    Accept a character, by advancing the input stream.
  */
  void yySkip()
  {
    if (m_echo)
      *m_cpp_ptr++ = *m_ptr++;
    else
      m_ptr++;
  }

  /**
    Accept multiple characters at once.
    @param n the number of characters to accept.
  */
  void yySkipn(int n)
  {
    if (m_echo)
    {
      memcpy(m_cpp_ptr, m_ptr, n);
      m_cpp_ptr += n;
    }
    m_ptr += n;
  }

  /**
    Puts a character back into the stream, canceling
    the effect of the last yyGet() or yySkip().
    Note that the echo mode should not change between calls
    to unput, get, or skip from the stream.
  */
  char *yyUnput(char ch)
  {
    *--m_ptr= ch;
    if (m_echo)
      m_cpp_ptr--;
    return m_ptr;
  }

  /**
    End of file indicator for the query text to parse.
    @param n number of characters expected
    @return true if there are less than n characters to parse
  */
  bool eof(int n) const
  {
    return ((m_ptr + n) >= m_end_of_query);
  }

  /** Mark the stream position as the start of a new token. */
  void start_token()
  {
    m_tok_start_prev= m_tok_start;
    m_tok_start= m_ptr;
    m_tok_end= m_ptr;

    m_cpp_tok_start_prev= m_cpp_tok_start;
    m_cpp_tok_start= m_cpp_ptr;
    m_cpp_tok_end= m_cpp_ptr;
  }

  /**
    Adjust the starting position of the current token.
    This is used to compensate for starting whitespace.
  */
  void restart_token()
  {
    m_tok_start= m_ptr;
    m_cpp_tok_start= m_cpp_ptr;
  }

  /**
    Get the maximum length of the utf8-body buffer.
    The utf8 body can grow because of the character set conversion and escaping.
  */
  size_t get_body_utf8_maximum_length(THD *thd) const;

  /** Get the length of the current token, in the raw buffer. */
  uint yyLength() const
  {
    /*
      The assumption is that the lexical analyser is always 1 character ahead,
      which the -1 account for.
    */
    DBUG_ASSERT(m_ptr > m_tok_start);
    return (uint) ((m_ptr - m_tok_start) - 1);
  }

  /**
    Test if a lookahead token was already scanned by lex_token(),
    for LALR(2) resolution.
  */
  bool has_lookahead() const
  {
    return lookahead_token >= 0;
  }

public:

  /**
    End of file indicator for the query text to parse.
    @return true if there are no more characters to parse
  */
  bool eof() const
  {
    return (m_ptr >= m_end_of_query);
  }

  /** Get the raw query buffer. */
  const char *get_buf() const
  {
    return m_buf;
  }

  /** Get the pre-processed query buffer. */
  const char *get_cpp_buf() const
  {
    return m_cpp_buf;
  }

  /** Get the end of the raw query buffer. */
  const char *get_end_of_query() const
  {
    return m_end_of_query;
  }

  /** Get the token start position, in the raw buffer. */
  const char *get_tok_start() const
  {
    return has_lookahead() ? m_tok_start_prev : m_tok_start;
  }

  void set_cpp_tok_start(const char *pos)
  {
    m_cpp_tok_start= pos;
  }

  /** Get the token end position, in the raw buffer. */
  const char *get_tok_end() const
  {
    return m_tok_end;
  }

  /** Get the current stream pointer, in the raw buffer. */
  const char *get_ptr() const
  {
    return m_ptr;
  }

  /** Get the token start position, in the pre-processed buffer. */
  const char *get_cpp_tok_start() const
  {
    return has_lookahead() ? m_cpp_tok_start_prev : m_cpp_tok_start;
  }

  /** Get the token end position, in the pre-processed buffer. */
  const char *get_cpp_tok_end() const
  {
    return m_cpp_tok_end;
  }

  /**
    Get the token end position in the pre-processed buffer,
    with trailing spaces removed.
  */
  const char *get_cpp_tok_end_rtrim() const
  {
    const char *p;
    for (p= m_cpp_tok_end;
         p > m_cpp_buf && my_isspace(system_charset_info, p[-1]);
         p--)
    { }
    return p;
  }

  /** Get the current stream pointer, in the pre-processed buffer. */
  const char *get_cpp_ptr() const
  {
    return m_cpp_ptr;
  }

  /**
    Get the current stream pointer, in the pre-processed buffer,
    with traling spaces removed.
  */
  const char *get_cpp_ptr_rtrim() const
  {
    const char *p;
    for (p= m_cpp_ptr;
         p > m_cpp_buf && my_isspace(system_charset_info, p[-1]);
         p--)
    { }
    return p;
  }
  /** Get the utf8-body string. */
  LEX_CSTRING body_utf8() const
  {
    return LEX_CSTRING({m_body_utf8, (size_t) (m_body_utf8_ptr - m_body_utf8)});
  }

  void body_utf8_start(THD *thd, const char *begin_ptr);
  void body_utf8_append(const char *ptr);
  void body_utf8_append(const char *ptr, const char *end_ptr);
  void body_utf8_append_ident(THD *thd,
                              const Lex_string_with_metadata_st *txt,
                              const char *end_ptr);
  void body_utf8_append_escape(THD *thd,
                               const LEX_CSTRING *txt,
                               CHARSET_INFO *txt_cs,
                               const char *end_ptr,
                               my_wc_t sep);

private:
  /**
    LALR(2) resolution, look ahead token.
    Value of the next token to return, if any,
    or -1, if no token was parsed in advance.
    Note: 0 is a legal token, and represents YYEOF.
  */
  int lookahead_token;

  /** LALR(2) resolution, value of the look ahead token.*/
  LEX_YYSTYPE lookahead_yylval;

  bool get_text(Lex_string_with_metadata_st *to,
                uint sep, int pre_skip, int post_skip);

  void add_digest_token(uint token, LEX_YYSTYPE yylval);

  bool consume_comment(int remaining_recursions_permitted);
  int lex_one_token(union YYSTYPE *yylval, THD *thd);
  int find_keyword(Lex_ident_cli_st *str, uint len, bool function) const;
  int find_keyword_qualified_special_func(Lex_ident_cli_st *str, uint len) const;
  LEX_CSTRING get_token(uint skip, uint length);
  int scan_ident_start(THD *thd, Lex_ident_cli_st *str);
  int scan_ident_middle(THD *thd, Lex_ident_cli_st *str,
                        CHARSET_INFO **cs, my_lex_states *);
  int scan_ident_delimited(THD *thd, Lex_ident_cli_st *str, uchar quote_char);
  bool get_7bit_or_8bit_ident(THD *thd, uchar *last_char);

  /** Current thread. */
  THD *m_thd;

  /** Pointer to the current position in the raw input stream. */
  char *m_ptr;

  /** Starting position of the last token parsed, in the raw buffer. */
  const char *m_tok_start;

  /** Ending position of the previous token parsed, in the raw buffer. */
  const char *m_tok_end;

  /** End of the query text in the input stream, in the raw buffer. */
  const char *m_end_of_query;

  /** Starting position of the previous token parsed, in the raw buffer. */
  const char *m_tok_start_prev;

  /** Begining of the query text in the input stream, in the raw buffer. */
  const char *m_buf;

  /** Length of the raw buffer. */
  size_t m_buf_length;

  /** Echo the parsed stream to the pre-processed buffer. */
  bool m_echo:1;
  bool m_echo_saved:1;

  /** Pre-processed buffer. */
  char *m_cpp_buf;

  /** Pointer to the current position in the pre-processed input stream. */
  char *m_cpp_ptr;

  /**
    Starting position of the last token parsed,
    in the pre-processed buffer.
  */
  const char *m_cpp_tok_start;

  /**
    Starting position of the previous token parsed,
    in the pre-procedded buffer.
  */
  const char *m_cpp_tok_start_prev;

  /**
    Ending position of the previous token parsed,
    in the pre-processed buffer.
  */
  const char *m_cpp_tok_end;

  /** UTF8-body buffer created during parsing. */
  char *m_body_utf8;

  /** Pointer to the current position in the UTF8-body buffer. */
  char *m_body_utf8_ptr;

  /**
    Position in the pre-processed buffer. The query from m_cpp_buf to
    m_cpp_utf_processed_ptr is converted to UTF8-body.
  */
  const char *m_cpp_utf8_processed_ptr;

public:

  /** Current state of the lexical analyser. */
  enum my_lex_states next_state;

  /**
    Position of ';' in the stream, to delimit multiple queries.
    This delimiter is in the raw buffer.
  */
  const char *found_semicolon;

  /** SQL_MODE = IGNORE_SPACE. */
  bool ignore_space:1;

  /**
    TRUE if we're parsing a prepared statement: in this mode
    we should allow placeholders.
  */
  bool stmt_prepare_mode:1;
  /**
    TRUE if we should allow multi-statements.
  */
  bool multi_statements:1;

  /** Current line number. */
  uint yylineno;

  /**
    Current statement digest instrumentation.
  */
  sql_digest_state* m_digest;

private:
  /** State of the lexical analyser for comments. */
  enum_comment_state in_comment;
  enum_comment_state in_comment_saved;

  /**
    Starting position of the TEXT_STRING or IDENT in the pre-processed
    buffer.

    NOTE: this member must be used within MYSQLlex() function only.
  */
  const char *m_cpp_text_start;

  /**
    Ending position of the TEXT_STRING or IDENT in the pre-processed
    buffer.

    NOTE: this member must be used within MYSQLlex() function only.
    */
  const char *m_cpp_text_end;

  /**
    Character set specified by the character-set-introducer.

    NOTE: this member must be used within MYSQLlex() function only.
  */
  CHARSET_INFO *m_underscore_cs;
};


/**
  Abstract representation of a statement.
  This class is an interface between the parser and the runtime.
  The parser builds the appropriate sub classes of Sql_statement
  to represent a SQL statement in the parsed tree.
  The execute() method in the sub classes contain the runtime implementation.
  Note that this interface is used for SQL statement recently implemented,
  the code for older statements tend to load the LEX structure with more
  attributes instead.
  The recommended way to implement new statements is to sub-class
  Sql_statement, as this improves code modularity (see the 'big switch' in
  dispatch_command()), and decrease the total size of the LEX structure
  (therefore saving memory in stored programs).
*/
class Sql_statement : public Sql_alloc
{
public:
  /**
    Execute this SQL statement.
    @param thd the current thread.
    @return 0 on success.
  */
  virtual bool execute(THD *thd) = 0;

protected:
  /**
    Constructor.
    @param lex the LEX structure that represents parts of this statement.
  */
  Sql_statement(LEX *lex)
    : m_lex(lex)
  {}

  /** Destructor. */
  virtual ~Sql_statement()
  {
    /*
      Sql_statement objects are allocated in thd->mem_root.
      In MySQL, the C++ destructor is never called, the underlying MEM_ROOT is
      simply destroyed instead.
      Do not rely on the destructor for any cleanup.
    */
    DBUG_ASSERT(FALSE);
  }

protected:
  /**
    The legacy LEX structure for this statement.
    The LEX structure contains the existing properties of the parsed tree.
    TODO: with time, attributes from LEX should move to sub classes of
    Sql_statement, so that the parser only builds Sql_statement objects
    with the minimum set of attributes, instead of a LEX structure that
    contains the collection of every possible attribute.
  */
  LEX *m_lex;
};


class Delete_plan;
class SQL_SELECT;

class Explain_query;
class Explain_update;
class Explain_delete;

/* 
  Query plan of a single-table UPDATE.
  (This is actually a plan for single-table DELETE also)
*/

class Update_plan
{
protected:
  bool impossible_where;
  bool no_partitions;
public:
  /* Allocate things there */
  MEM_ROOT *mem_root;

  TABLE *table;
  SQL_SELECT *select;
  uint index;
  ha_rows scanned_rows;
  /*
    Top-level select_lex. Most of its fields are not used, we need it only to
    get to the subqueries.
  */
  SELECT_LEX *select_lex;
  
  key_map possible_keys;
  bool using_filesort;
  bool using_io_buffer;
  
  /* Set this plan to be a plan to do nothing because of impossible WHERE */
  void set_impossible_where() { impossible_where= true; }
  void set_no_partitions() { no_partitions= true; }

  Explain_update* save_explain_update_data(THD *thd, MEM_ROOT *mem_root);
protected:
  bool save_explain_data_intern(THD *thd, MEM_ROOT *mem_root, Explain_update *eu, bool is_analyze);
public:
  virtual ~Update_plan() = default;

  Update_plan(MEM_ROOT *mem_root_arg) : 
    impossible_where(false), no_partitions(false), 
    mem_root(mem_root_arg), 
    using_filesort(false), using_io_buffer(false)
  {}
};


/* Query plan of a single-table DELETE */
class Delete_plan : public Update_plan
{
  bool deleting_all_rows;
public:

  /* Construction functions */
  Delete_plan(MEM_ROOT *mem_root_arg) : 
    Update_plan(mem_root_arg), 
    deleting_all_rows(false)
  {}

  /* Set this query plan to be a plan to make a call to h->delete_all_rows() */
  void set_delete_all_rows(ha_rows rows_arg) 
  { 
    deleting_all_rows= true;
    scanned_rows= rows_arg;
  }
  void cancel_delete_all_rows()
  {
    deleting_all_rows= false;
  }

  Explain_delete* save_explain_delete_data(THD *thd, MEM_ROOT *mem_root);
};

enum account_lock_type
{
  ACCOUNTLOCK_UNSPECIFIED= 0,
  ACCOUNTLOCK_LOCKED,
  ACCOUNTLOCK_UNLOCKED
};

enum password_exp_type
{
  PASSWORD_EXPIRE_UNSPECIFIED= 0,
  PASSWORD_EXPIRE_NOW,
  PASSWORD_EXPIRE_NEVER,
  PASSWORD_EXPIRE_DEFAULT,
  PASSWORD_EXPIRE_INTERVAL
};

struct Account_options: public USER_RESOURCES
{
  Account_options() = default;

  void reset()
  {
    bzero(this, sizeof(*this));
    ssl_type= SSL_TYPE_NOT_SPECIFIED;
  }

  enum SSL_type ssl_type;                       // defined in violite.h
  LEX_CSTRING x509_subject, x509_issuer, ssl_cipher;
  account_lock_type account_locked;
  password_exp_type password_expire;
  longlong num_expiration_days;
};

class Query_arena_memroot;
/* The state of the lex parsing. This is saved in the THD struct */


class Lex_prepared_stmt
{
  Lex_ident_sys m_name; // Statement name (in all queries)
  Item *m_code;         // PREPARE or EXECUTE IMMEDIATE source expression
  List<Item> m_params;  // List of parameters for EXECUTE [IMMEDIATE]
public:

  Lex_prepared_stmt()
   :m_code(NULL)
  { }
  const Lex_ident_sys &name() const
  {
    return m_name;
  }
  uint param_count() const
  {
    return m_params.elements;
  }
  List<Item> &params()
  {
    return m_params;
  }
  void set(const Lex_ident_sys_st &ident, Item *code, List<Item> *params)
  {
    DBUG_ASSERT(m_params.elements == 0);
    m_name= ident;
    m_code= code;
    if (params)
      m_params= *params;
  }
  bool params_fix_fields(THD *thd)
  {
    // Fix Items in the EXECUTE..USING list
    List_iterator_fast<Item> param_it(m_params);
    while (Item *param= param_it++)
    {
      if (param->fix_fields_if_needed_for_scalar(thd, 0))
        return true;
    }
    return false;
  }
  bool get_dynamic_sql_string(THD *thd, LEX_CSTRING *dst, String *buffer);
  void lex_start()
  {
    m_params.empty();
  }
};


class Lex_grant_object_name: public Grant_object_name, public Sql_alloc
{
public:
  Lex_grant_object_name(Table_ident *table_ident)
   :Grant_object_name(table_ident)
  { }
  Lex_grant_object_name(const LEX_CSTRING &db, Type type)
   :Grant_object_name(db, type)
  { }
};


class Lex_grant_privilege: public Grant_privilege, public Sql_alloc
{
public:
  Lex_grant_privilege() {}
  Lex_grant_privilege(privilege_t grant, bool all_privileges= false)
   :Grant_privilege(grant, all_privileges)
  { }
};


struct LEX: public Query_tables_list
{
  SELECT_LEX_UNIT unit;                         /* most upper unit */
  SELECT_LEX *first_select_lex() { return unit.first_select(); }
  const SELECT_LEX *first_select_lex() const { return unit.first_select(); }

private:
  SELECT_LEX builtin_select;

public:
  /* current SELECT_LEX in parsing */
  SELECT_LEX *current_select;
  /* list of all SELECT_LEX */
  SELECT_LEX *all_selects_list;
  /* current with clause in parsing if any, otherwise 0*/
  With_clause *curr_with_clause;
  /* pointer to the first with clause in the current statement */
  With_clause *with_clauses_list;
  /*
    (*with_clauses_list_last_next) contains a pointer to the last
     with clause in the current statement
  */
  With_clause **with_clauses_list_last_next;
  /*
    When a copy of a with element is parsed this is set to the offset of
    the with element in the input string, otherwise it's set to 0
  */
  my_ptrdiff_t clone_spec_offset;

  Create_view_info *create_view;

  /* Query Plan Footprint of a currently running select  */
  Explain_query *explain;

  // type information
  CHARSET_INFO *charset;
  /*
    LEX which represents current statement (conventional, SP or PS)

    For example during view parsing THD::lex will point to the views LEX and
    lex::stmt_lex will point to LEX of the statement where the view will be
    included

    Currently it is used to have always correct select numbering inside
    statement (LEX::current_select_number) without storing and restoring a
    global counter which was THD::select_number.

    TODO: make some unified statement representation (now SP has different)
    to store such data like LEX::current_select_number.
  */
  LEX *stmt_lex;

  LEX_CSTRING name;
  const char *help_arg;
  const char *backup_dir;                       /* For RESTORE/BACKUP */
  const char* to_log;                           /* For PURGE MASTER LOGS TO */
  String *wild; /* Wildcard in SHOW {something} LIKE 'wild'*/ 
  sql_exchange *exchange;
  select_result *result;
  /**
    @c the two may also hold BINLOG arguments: either comment holds a
    base64-char string or both represent the BINLOG fragment user variables.
  */
  LEX_CSTRING comment, ident;
  LEX_USER *grant_user;
  XID *xid;
  THD *thd;

  /* maintain a list of used plugins for this LEX */
  DYNAMIC_ARRAY plugins;
  plugin_ref plugins_static_buffer[INITIAL_LEX_PLUGIN_LIST_SIZE];

  /** SELECT of CREATE VIEW statement */
  LEX_STRING create_view_select;

  /** Start of 'ON table', in trigger statements.  */
  const char* raw_trg_on_table_name_begin;
  /** End of 'ON table', in trigger statements. */
  const char* raw_trg_on_table_name_end;

  /* Partition info structure filled in by PARTITION BY parse part */
  partition_info *part_info;

  /*
    The definer of the object being created (view, trigger, stored routine).
    I.e. the value of DEFINER clause.
  */
  LEX_USER *definer;

  /* Used in ALTER/CREATE user to store account locking options */
  Account_options account_options;

  Table_type table_type;                        /* Used for SHOW CREATE */
  List<Key_part_spec> ref_list;
  List<LEX_USER>      users_list;
  List<Item>          *insert_list= nullptr,field_list,value_list,update_list;
  List<List_item>     many_values;
  List<set_var_base>  var_list;
  List<set_var_base>  stmt_var_list; //SET_STATEMENT values
  List<set_var_base>  old_var_list; // SET STATEMENT old values
private:
  Query_arena_memroot *arena_for_set_stmt;
  MEM_ROOT *mem_root_for_set_stmt;
  bool sp_block_finalize(THD *thd, const Lex_spblock_st spblock,
                                   class sp_label **splabel);
  bool sp_change_context(THD *thd, const sp_pcontext *ctx, bool exclusive);
  bool sp_exit_block(THD *thd, sp_label *lab);
  bool sp_exit_block(THD *thd, sp_label *lab, Item *when);

  bool sp_continue_loop(THD *thd, sp_label *lab);

  bool sp_for_loop_condition(THD *thd, const Lex_for_loop_st &loop);
  bool sp_for_loop_increment(THD *thd, const Lex_for_loop_st &loop);

  /*
    Check if Item_field and Item_ref are allowed in the current statement.
    @retval false OK (fields are allowed)
    @retval true  ERROR (fields are not allowed). Error is raised.
  */
  bool check_expr_allows_fields_or_error(THD *thd, const char *name) const;

protected:
  bool sp_continue_loop(THD *thd, sp_label *lab, Item *when);

public:
  void parse_error(uint err_number= ER_SYNTAX_ERROR);
  inline bool is_arena_for_set_stmt() {return arena_for_set_stmt != 0;}
  bool set_arena_for_set_stmt(Query_arena *backup);
  void reset_arena_for_set_stmt(Query_arena *backup);
  void free_arena_for_set_stmt();

  void print(String *str, enum_query_type qtype);
  List<Item_func_set_user_var> set_var_list; // in-query assignment list
  List<Item_param>    param_list;
  List<LEX_CSTRING>   view_list; // view list (list of field names in view)
  List<LEX_STRING>   *column_list; // list of column names (in ANALYZE)
  List<LEX_STRING>   *index_list;  // list of index names (in ANALYZE)
  /*
    A stack of name resolution contexts for the query. This stack is used
    at parse time to set local name resolution contexts for various parts
    of a query. For example, in a JOIN ... ON (some_condition) clause the
    Items in 'some_condition' must be resolved only against the operands
    of the the join, and not against the whole clause. Similarly, Items in
    subqueries should be resolved against the subqueries (and outer queries).
    The stack is used in the following way: when the parser detects that
    all Items in some clause need a local context, it creates a new context
    and pushes it on the stack. All newly created Items always store the
    top-most context in the stack. Once the parser leaves the clause that
    required a local context, the parser pops the top-most context.
  */
  List<Name_resolution_context> context_stack;
  SELECT_LEX *select_stack[MAX_SELECT_NESTING + 1];
  uint select_stack_top;
  /*
    Usually this is set to 0, but for INSERT/REPLACE SELECT it is set to 1.
    When parsing such statements the pointer to the most outer select is placed
    into the second element of select_stack rather than into the first.
  */
  uint select_stack_outer_barrier;

  SQL_I_List<ORDER> proc_list;
  SQL_I_List<TABLE_LIST> auxiliary_table_list, save_list;
  Column_definition *last_field;
  Table_function_json_table *json_table;
  Item_sum *in_sum_func;
  udf_func udf;
  HA_CHECK_OPT   check_opt;                        // check/repair options
  Table_specification_st create_info;
  Key *last_key;
  LEX_MASTER_INFO mi;                              // used by CHANGE MASTER
  LEX_SERVER_OPTIONS server_options;
  LEX_CSTRING relay_log_connection_name;
  LEX_RESET_SLAVE reset_slave_info;
  ulonglong type;
  ulong next_binlog_file_number;
  /* The following is used by KILL */
  killed_state kill_signal;
  killed_type  kill_type;
  uint current_select_number; // valid for statment LEX (not view)

  /*
    The following bool variables should not be bit fields as they are not
    reset for every query
  */
  bool autocommit;          // Often used, better as bool
  bool sp_lex_in_use;       // Keep track on lex usage in SPs for error handling

  /* Bit fields, reset for every query */
  bool is_shutdown_wait_for_slaves:1;
  bool selects_allow_procedure:1;
  /*
    A special command "PARSE_VCOL_EXPR" is defined for the parser
    to translate a defining expression of a virtual column into an
    Item object.
    The following flag is used to prevent other applications to use
    this command.
  */
  bool parse_vcol_expr:1;
  bool analyze_stmt:1; /* TRUE<=> this is "ANALYZE $stmt" */
  bool explain_json:1;
  /*
    true <=> The parsed fragment requires resolution of references to CTE
    at the end of parsing. This name resolution process involves searching
    for possible dependencies between CTE defined in the parsed fragment and
    detecting possible recursive references.
    The flag is set to true if the fragment contains CTE definitions.
  */
  bool with_cte_resolution:1;
  /*
    true <=> only resolution of references to CTE are required in the parsed
    fragment, no checking of dependencies between CTE is required.
    This flag is used only when parsing clones of CTE specifications.
  */
  bool only_cte_resolution:1;
  bool local_file:1;
  bool check_exists:1;
  bool verbose:1, no_write_to_binlog:1;
  bool safe_to_cache_query:1;
  bool ignore:1;
  bool next_is_main:1; // use "main" SELECT_LEX for nrxt allocation;
  bool next_is_down:1; // use "main" SELECT_LEX for nrxt allocation;
  /*
    field_list was created for view and should be removed before PS/SP
    rexecuton
  */
  bool empty_field_list_on_rset:1;
  /**
    During name resolution search only in the table list given by
    Name_resolution_context::first_name_resolution_table and
    Name_resolution_context::last_name_resolution_table
    (see Item_field::fix_fields()).
  */
  bool use_only_table_context:1;
  bool escape_used:1;
  bool default_used:1;    /* using default() function */
  bool with_rownum:1;     /* Using rownum() function */
  bool is_lex_started:1;  /* If lex_start() did run. For debugging. */
  /*
    This variable is used in post-parse stage to declare that sum-functions,
    or functions which have sense only if GROUP BY is present, are allowed.
    For example in a query
    SELECT ... FROM ...WHERE MIN(i) == 1 GROUP BY ... HAVING MIN(i) > 2
    MIN(i) in the WHERE clause is not allowed in the opposite to MIN(i)
    in the HAVING clause. Due to possible nesting of select construct
    the variable can contain 0 or 1 for each nest level.
  */
  nesting_map allow_sum_func;

  Sql_cmd *m_sql_cmd;

  /*
    Usually `expr` rule of yacc is quite reused but some commands better
    not support subqueries which comes standard with this rule, like
    KILL, HA_READ, CREATE/ALTER EVENT etc. Set this to a non-NULL
    clause name to get an error.
  */
  const char *clause_that_disallows_subselect;

  enum enum_duplicates duplicates;
  enum enum_tx_isolation tx_isolation;
  enum enum_ha_read_modes ha_read_mode;
  union {
    enum ha_rkey_function ha_rkey_mode;
    enum xa_option_words xa_opt;
    bool with_admin_option;                     // GRANT role
    bool with_persistent_for_clause; // uses PERSISTENT FOR clause (in ANALYZE)
  };
  enum enum_var_type option_type;
  enum enum_drop_mode drop_mode;

  enum backup_stages backup_stage;
  enum Foreign_key::fk_match_opt fk_match_option;
  enum_fk_option fk_update_opt;
  enum_fk_option fk_delete_opt;
  enum enum_yes_no_unknown tx_chain, tx_release;
  st_parsing_options parsing_options;
  /*
    In sql_cache we store SQL_CACHE flag as specified by user to be
    able to restore SELECT statement from internal structures.
  */
  enum e_sql_cache { SQL_CACHE_UNSPECIFIED, SQL_NO_CACHE, SQL_CACHE };
  e_sql_cache sql_cache;

  uint slave_thd_opt, start_transaction_opt;
  uint profile_query_id;
  uint profile_options;
  int nest_level;

  /*
    In LEX representing update which were transformed to multi-update
    stores total number of tables. For LEX representing multi-delete
    holds number of tables from which we will delete records.
  */
  uint table_count_update;

  uint8 describe;
  /*
    A flag that indicates what kinds of derived tables are present in the
    query (0 if no derived tables, otherwise a combination of flags
    DERIVED_SUBQUERY and DERIVED_VIEW).
  */
  uint8 derived_tables;
  uint8 context_analysis_only;
  uint8 lex_options; // see OPTION_LEX_*

  Alter_info alter_info;
  Lex_prepared_stmt prepared_stmt;
  /*
    For CREATE TABLE statement last element of table list which is not
    part of SELECT or LIKE part (i.e. either element for table we are
    creating or last of tables referenced by foreign keys).
  */
  TABLE_LIST *create_last_non_select_table;
  sp_head *sphead;
  sp_name *spname;
  sp_pcontext *spcont;

  st_sp_chistics sp_chistics;

  Event_parse_data *event_parse_data;

  /* Characterstics of trigger being created */
  st_trg_chistics trg_chistics;
  /*
    List of all items (Item_trigger_field objects) representing fields in
    old/new version of row in trigger. We use this list for checking whenever
    all such fields are valid at trigger creation time and for binding these
    fields to TABLE object at table open (altough for latter pointer to table
    being opened is probably enough).
  */
  SQL_I_List<Item_trigger_field> trg_table_fields;

  /*
    stmt_definition_begin is intended to point to the next word after
    DEFINER-clause in the following statements:
      - CREATE TRIGGER (points to "TRIGGER");
      - CREATE PROCEDURE (points to "PROCEDURE");
      - CREATE FUNCTION (points to "FUNCTION" or "AGGREGATE");
      - CREATE EVENT (points to "EVENT")

    This pointer is required to add possibly omitted DEFINER-clause to the
    DDL-statement before dumping it to the binlog.

    keyword_delayed_begin_offset is the offset to the beginning of the DELAYED
    keyword in INSERT DELAYED statement. keyword_delayed_end_offset is the
    offset to the character right after the DELAYED keyword.
  */
  union {
    const char *stmt_definition_begin;
    uint keyword_delayed_begin_offset;
  };

  union {
    const char *stmt_definition_end;
    uint keyword_delayed_end_offset;
  };

  /**
    Collects create options for KEY
  */
  engine_option_value *option_list;

  /**
    Helper pointer to the end of the list when parsing options for
      LEX::create_info.option_list (for table)
      LEX::last_field->option_list (for fields)
      LEX::option_list             (for indexes)
  */
  engine_option_value *option_list_last;


  /*
    Reference to a struct that contains information in various commands
    to add/create/drop/change table spaces.
  */
  st_alter_tablespace *alter_tablespace_info;

  /*
    The set of those tables whose fields are referenced in all subqueries
    of the query.
    TODO: possibly this it is incorrect to have used tables in LEX because
    with subquery, it is not clear what does the field mean. To fix this
    we should aggregate used tables information for selected expressions
    into the select_lex.
  */
  table_map  used_tables;
  /**
    Maximum number of rows and/or keys examined by the query, both read,
    changed or written. This is the argument of LIMIT ROWS EXAMINED.
    The limit is represented by two variables - the Item is needed because
    in case of parameters we have to delay its evaluation until execution.
    Once evaluated, its value is stored in examined_rows_limit_cnt.
  */
  Item *limit_rows_examined;
  ulonglong limit_rows_examined_cnt;
  /**
    Holds a set of domain_ids for deletion at FLUSH..DELETE_DOMAIN_ID
  */
  DYNAMIC_ARRAY delete_gtid_domain;
  static const ulong initial_gtid_domain_buffer_size= 16;
  uint32 gtid_domain_static_buffer[initial_gtid_domain_buffer_size];

  inline void set_limit_rows_examined()
  {
    if (limit_rows_examined)
      limit_rows_examined_cnt= limit_rows_examined->val_uint();
    else
      limit_rows_examined_cnt= ULONGLONG_MAX;
  }


  LEX_CSTRING *win_ref;
  Window_frame *win_frame;
  Window_frame_bound *frame_top_bound;
  Window_frame_bound *frame_bottom_bound;
  Window_spec *win_spec;

  Item *upd_del_where;

  /* System Versioning */
  vers_select_conds_t vers_conditions;
  vers_select_conds_t period_conditions;

  inline void free_set_stmt_mem_root()
  {
    DBUG_ASSERT(!is_arena_for_set_stmt());
    if (mem_root_for_set_stmt)
    {
      free_root(mem_root_for_set_stmt, MYF(0));
      delete mem_root_for_set_stmt;
      mem_root_for_set_stmt= 0;
    }
  }

  LEX();

  virtual ~LEX()
  {
    free_set_stmt_mem_root();
    destroy_query_tables_list();
    plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements);
    delete_dynamic(&plugins);
  }

  virtual class Query_arena *query_arena()
  {
    DBUG_ASSERT(0);
    return NULL;
  }

  void start(THD *thd);

  inline bool is_ps_or_view_context_analysis()
  {
    return (context_analysis_only &
            (CONTEXT_ANALYSIS_ONLY_PREPARE |
             CONTEXT_ANALYSIS_ONLY_VCOL_EXPR |
             CONTEXT_ANALYSIS_ONLY_VIEW));
  }

  inline bool is_view_context_analysis()
  {
    return (context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW);
  }

  /**
    Mark all queries in this lex structure as uncacheable for the cause given

    @param cause    the reason queries are to be marked as uncacheable

    Note, any cause is sufficient for st_select_lex_unit::can_be_merged() to
    disallow query merges.
  */

  inline void uncacheable(uint8 cause)
  {
    safe_to_cache_query= 0;

    if (current_select) // initialisation SP variables has no SELECT
    {
      /*
        There are no sense to mark select_lex and union fields of LEX,
        but we should merk all subselects as uncacheable from current till
        most upper
      */
      SELECT_LEX *sl;
      SELECT_LEX_UNIT *un;
      for (sl= current_select, un= sl->master_unit();
           un && un != &unit;
           sl= sl->outer_select(), un= (sl ? sl->master_unit() : NULL))
      {
       sl->uncacheable|= cause;
       un->uncacheable|= cause;
      }
      if (sl)
        sl->uncacheable|= cause;
    }
    if (first_select_lex())
      first_select_lex()->uncacheable|= cause;
  }
  void set_trg_event_type_for_tables();

  TABLE_LIST *unlink_first_table(bool *link_to_local);
  void link_first_table_back(TABLE_LIST *first, bool link_to_local);
  void first_lists_tables_same();
  void fix_first_select_number();

  bool can_be_merged();
  bool can_use_merged();
  bool can_not_use_merged();
  bool only_view_structure();
  bool need_correct_ident();
  uint8 get_effective_with_check(TABLE_LIST *view);
  /*
    Is this update command where 'WHITH CHECK OPTION' clause is important

    SYNOPSIS
      LEX::which_check_option_applicable()

    RETURN
      TRUE   have to take 'WHITH CHECK OPTION' clause into account
      FALSE  'WHITH CHECK OPTION' clause do not need
  */
  inline bool which_check_option_applicable()
  {
    switch (sql_command) {
    case SQLCOM_UPDATE:
    case SQLCOM_UPDATE_MULTI:
    case SQLCOM_DELETE:
    case SQLCOM_DELETE_MULTI:
    case SQLCOM_INSERT:
    case SQLCOM_INSERT_SELECT:
    case SQLCOM_REPLACE:
    case SQLCOM_REPLACE_SELECT:
    case SQLCOM_LOAD:
      return TRUE;
    default:
      return FALSE;
    }
  }

  void cleanup_after_one_table_open();

  bool push_context(Name_resolution_context *context);

  Name_resolution_context *pop_context();

  SELECT_LEX *select_stack_head()
  {
    if (likely(select_stack_top))
      return select_stack[select_stack_top - 1];
    return NULL;
  }

  bool push_select(SELECT_LEX *select_lex)
  {
    DBUG_ENTER("LEX::push_select");
    DBUG_PRINT("info", ("Top Select was %p (%d)  depth: %u  pushed: %p (%d)",
                        select_stack_head(),
                        select_stack_top,
                        (select_stack_top ?
                         select_stack_head()->select_number :
                         0),
                        select_lex, select_lex->select_number));
    if (unlikely(select_stack_top > MAX_SELECT_NESTING))
    {
      my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT, MYF(0));
      DBUG_RETURN(TRUE);
    }
    if (push_context(&select_lex->context))
      DBUG_RETURN(TRUE);
    select_stack[select_stack_top++]= select_lex;
    current_select= select_lex;
    DBUG_RETURN(FALSE);
  }

  SELECT_LEX *pop_select()
  {
    DBUG_ENTER("LEX::pop_select");
    SELECT_LEX *select_lex;
    if (likely(select_stack_top))
      select_lex= select_stack[--select_stack_top];
    else
      select_lex= 0;
    DBUG_PRINT("info", ("Top Select is %p (%d)  depth: %u  poped: %p (%d)",
                        select_stack_head(),
                        select_stack_top,
                        (select_stack_top ?
                         select_stack_head()->select_number :
                         0),
                        select_lex,
                        (select_lex ? select_lex->select_number : 0)));
    DBUG_ASSERT(select_lex);

    pop_context();

    if (unlikely(!select_stack_top))
    {
      current_select= &builtin_select;
      DBUG_PRINT("info", ("Top Select is empty -> sel builtin: %p  service: %u",
                          current_select, builtin_select.is_service_select));
      builtin_select.is_service_select= false;
    }
    else
      current_select= select_stack[select_stack_top - 1];

    DBUG_RETURN(select_lex);
  }

  SELECT_LEX *current_select_or_default()
  {
    return current_select ? current_select : &builtin_select;
  }

  bool copy_db_to(LEX_CSTRING *to);

  void inc_select_stack_outer_barrier()
  {
    select_stack_outer_barrier++;
  }

  SELECT_LEX *parser_current_outer_select()
  {
    return select_stack_top - 1 == select_stack_outer_barrier ?
             0 : select_stack[select_stack_top - 2];
  }

  Name_resolution_context *current_context()
  {
    return context_stack.head();
  }

  /*
    Restore the LEX and THD in case of a parse error.
  */
  static void cleanup_lex_after_parse_error(THD *thd);

  void reset_n_backup_query_tables_list(Query_tables_list *backup);
  void restore_backup_query_tables_list(Query_tables_list *backup);

  bool table_or_sp_used();

  bool is_partition_management() const;
  bool part_values_current(THD *thd);
  bool part_values_history(THD *thd);

  /**
    @brief check if the statement is a single-level join
    @return result of the check
      @retval TRUE  The statement doesn't contain subqueries, unions and 
                    stored procedure calls.
      @retval FALSE There are subqueries, UNIONs or stored procedure calls.
  */
  bool is_single_level_stmt() 
  { 
    /* 
      This check exploits the fact that the last added to all_select_list is
      on its top. So select_lex (as the first added) will be at the tail 
      of the list.
    */ 
    if (first_select_lex() == all_selects_list && !sroutines.records)
    {
      return TRUE;
    }
    return FALSE;
  }

  bool save_prep_leaf_tables();

  int print_explain(select_result_sink *output, uint8 explain_flags,
                    bool is_analyze, bool *printed_anything);
  bool restore_set_statement_var();

  void init_last_field(Column_definition *field, const LEX_CSTRING *name,
                       const CHARSET_INFO *cs);
  bool last_field_generated_always_as_row_start_or_end(Lex_ident *p,
                                                       const char *type,
                                                       uint flags);
  bool last_field_generated_always_as_row_start();
  bool last_field_generated_always_as_row_end();
  bool set_bincmp(CHARSET_INFO *cs, bool bin);

  bool new_sp_instr_stmt(THD *, const LEX_CSTRING &prefix,
                         const LEX_CSTRING &suffix);
  bool sp_proc_stmt_statement_finalize_buf(THD *, const LEX_CSTRING &qbuf);
  bool sp_proc_stmt_statement_finalize(THD *, bool no_lookahead);

  sp_variable *sp_param_init(LEX_CSTRING *name);
  bool sp_param_fill_definition(sp_variable *spvar,
                                const Lex_field_type_st &def);
  bool sf_return_fill_definition(const Lex_field_type_st &def);

  int case_stmt_action_then();
  bool setup_select_in_parentheses();
  bool set_trigger_new_row(const LEX_CSTRING *name, Item *val);
  bool set_trigger_field(const LEX_CSTRING *name1, const LEX_CSTRING *name2,
                         Item *val);
  bool set_system_variable(enum_var_type var_type, sys_var *var,
                           const Lex_ident_sys_st *base_name, Item *val);
  bool set_system_variable(enum_var_type var_type,
                           const Lex_ident_sys_st *name, Item *val);
  bool set_system_variable(THD *thd, enum_var_type var_type,
                           const Lex_ident_sys_st *name1,
                           const Lex_ident_sys_st *name2,
                           Item *val);
  bool set_default_system_variable(enum_var_type var_type,
                                   const Lex_ident_sys_st *name,
                                   Item *val);
  bool set_user_variable(THD *thd, const LEX_CSTRING *name, Item *val);
  void set_stmt_init();
  sp_name *make_sp_name(THD *thd, const LEX_CSTRING *name);
  sp_name *make_sp_name(THD *thd, const LEX_CSTRING *name1,
                                  const LEX_CSTRING *name2);
  sp_name *make_sp_name_package_routine(THD *thd, const LEX_CSTRING *name);
  sp_head *make_sp_head(THD *thd, const sp_name *name, const Sp_handler *sph,
                        enum_sp_aggregate_type agg_type);
  sp_head *make_sp_head_no_recursive(THD *thd, const sp_name *name,
                                     const Sp_handler *sph,
                                     enum_sp_aggregate_type agg_type);
  bool sp_body_finalize_routine(THD *);
  bool sp_body_finalize_trigger(THD *);
  bool sp_body_finalize_event(THD *);
  bool sp_body_finalize_function(THD *);
  bool sp_body_finalize_procedure(THD *);
  bool sp_body_finalize_procedure_standalone(THD *, const sp_name *end_name);
  sp_package *create_package_start(THD *thd,
                                   enum_sql_command command,
                                   const Sp_handler *sph,
                                   const sp_name *name,
                                   DDL_options_st options);
  bool create_package_finalize(THD *thd,
                               const sp_name *name,
                               const sp_name *name2,
                               const char *cpp_body_end);
  bool call_statement_start(THD *thd, sp_name *name);
  bool call_statement_start(THD *thd, const Lex_ident_sys_st *name);
  bool call_statement_start(THD *thd, const Lex_ident_sys_st *name1,
                                      const Lex_ident_sys_st *name2);
  bool call_statement_start(THD *thd,
                            const Lex_ident_sys_st *db,
                            const Lex_ident_sys_st *pkg,
                            const Lex_ident_sys_st *proc);
  sp_variable *find_variable(const LEX_CSTRING *name,
                             sp_pcontext **ctx,
                             const Sp_rcontext_handler **rh) const;
  sp_variable *find_variable(const LEX_CSTRING *name,
                             const Sp_rcontext_handler **rh) const
  {
    sp_pcontext *not_used_ctx;
    return find_variable(name, &not_used_ctx, rh);
  }
  bool set_variable(const Lex_ident_sys_st *name, Item *item);
  bool set_variable(const Lex_ident_sys_st *name1,
                    const Lex_ident_sys_st *name2, Item *item);
  void sp_variable_declarations_init(THD *thd, int nvars);
  bool sp_variable_declarations_finalize(THD *thd, int nvars,
                                         const Column_definition *cdef,
                                         Item *def);
  bool sp_variable_declarations_set_default(THD *thd, int nvars, Item *def);
  bool sp_variable_declarations_row_finalize(THD *thd, int nvars,
                                             Row_definition_list *row,
                                             Item *def);
  bool sp_variable_declarations_with_ref_finalize(THD *thd, int nvars,
                                                  Qualified_column_ident *col,
                                                  Item *def);
  bool sp_variable_declarations_rowtype_finalize(THD *thd, int nvars,
                                                 Qualified_column_ident *,
                                                 Item *def);
  bool sp_variable_declarations_cursor_rowtype_finalize(THD *thd, int nvars,
                                                        uint offset,
                                                        Item *def);
  bool sp_variable_declarations_table_rowtype_finalize(THD *thd, int nvars,
                                                       const LEX_CSTRING &db,
                                                       const LEX_CSTRING &table,
                                                       Item *def);
  bool sp_variable_declarations_column_type_finalize(THD *thd, int nvars,
                                                     Qualified_column_ident *ref,
                                                     Item *def);
  bool sp_variable_declarations_vartype_finalize(THD *thd, int nvars,
                                                 const LEX_CSTRING &name,
                                                 Item *def);
  bool sp_variable_declarations_copy_type_finalize(THD *thd, int nvars,
                                                   const Column_definition &ref,
                                                   Row_definition_list *fields,
                                                   Item *def);

  LEX_USER *current_user_for_set_password(THD *thd);
  bool sp_create_set_password_instr(THD *thd,
                                    LEX_USER *user,
                                    USER_AUTH *auth,
                                    bool no_lookahead);
  bool sp_create_set_password_instr(THD *thd,
                                    USER_AUTH *auth,
                                    bool no_lookahead)
  {
    LEX_USER *user;
    return !(user= current_user_for_set_password(thd)) ||
           sp_create_set_password_instr(thd, user, auth, no_lookahead);
  }

  bool sp_handler_declaration_init(THD *thd, int type);
  bool sp_handler_declaration_finalize(THD *thd, int type);

  bool sp_declare_cursor(THD *thd, const LEX_CSTRING *name,
                         class sp_lex_cursor *cursor_stmt,
                         sp_pcontext *param_ctx, bool add_cpush_instr);

  bool sp_open_cursor(THD *thd, const LEX_CSTRING *name,
                      List<sp_assignment_lex> *parameters);
  Item_splocal *create_item_for_sp_var(const Lex_ident_cli_st *name,
                                       sp_variable *spvar);

  Item *create_item_qualified_asterisk(THD *thd, const Lex_ident_sys_st *name);
  Item *create_item_qualified_asterisk(THD *thd,
                                       const Lex_ident_sys_st *a,
                                       const Lex_ident_sys_st *b);
  Item *create_item_qualified_asterisk(THD *thd, const Lex_ident_cli_st *cname)
  {
    Lex_ident_sys name(thd, cname);
    if (name.is_null())
      return NULL; // EOM
    return create_item_qualified_asterisk(thd, &name);
  }
  Item *create_item_qualified_asterisk(THD *thd,
                                       const Lex_ident_cli_st *ca,
                                       const Lex_ident_cli_st *cb)
  {
    Lex_ident_sys a(thd, ca), b(thd, cb);
    if (a.is_null() || b.is_null())
      return NULL; // EOM
    return create_item_qualified_asterisk(thd, &a, &b);
  }

  Item *create_item_ident_field(THD *thd,
                                const Lex_ident_sys_st &db,
                                const Lex_ident_sys_st &table,
                                const Lex_ident_sys_st &name);
  Item *create_item_ident_nosp(THD *thd, Lex_ident_sys_st *name)
  {
    return create_item_ident_field(thd, Lex_ident_sys(), Lex_ident_sys(), *name);
  }
  Item *create_item_ident_sp(THD *thd, Lex_ident_sys_st *name,
                             const char *start, const char *end);
  Item *create_item_ident(THD *thd, Lex_ident_cli_st *cname)
  {
    Lex_ident_sys name(thd, cname);
    if (name.is_null())
      return NULL; // EOM
    return sphead ?
           create_item_ident_sp(thd, &name, cname->pos(), cname->end()) :
           create_item_ident_nosp(thd, &name);
  }
  /*
    Create an Item corresponding to a qualified name: a.b
    when the parser is out of an SP context.
      @param THD        - THD, for mem_root
      @param a          - the first name
      @param b          - the second name
      @retval           - a pointer to a created item, or NULL on error.

    Possible Item types that can be created:
    - Item_trigger_field
    - Item_field
    - Item_ref
  */
  Item *create_item_ident_nospvar(THD *thd,
                                  const Lex_ident_sys_st *a,
                                  const Lex_ident_sys_st *b);
  /*
    Create an Item corresponding to a ROW field valiable:  var.field
      @param THD        - THD, for mem_root
      @param rh [OUT]   - the rcontext handler (local vs package variables)
      @param var        - the ROW variable name
      @param field      - the ROW variable field name
      @param spvar      - the variable that was previously found by name
                          using "var_name".
      @param start      - position in the query (for binary log)
      @param end        - end in the query (for binary log)
  */
  Item_splocal *create_item_spvar_row_field(THD *thd,
                                            const Sp_rcontext_handler *rh,
                                            const Lex_ident_sys *var,
                                            const Lex_ident_sys *field,
                                            sp_variable *spvar,
                                            const char *start,
                                            const char *end);
  /*
    Create an item from its qualified name.
    Depending on context, it can be either a ROW variable field,
    or trigger, table field, table field reference.
    See comments to create_item_spvar_row_field() and
    create_item_ident_nospvar().
      @param thd         - THD, for mem_root
      @param a           - the first name
      @param b           - the second name
      @retval            - NULL on error, or a pointer to a new Item.
  */
  Item *create_item_ident(THD *thd,
                          const Lex_ident_cli_st *a,
                          const Lex_ident_cli_st *b);
  /*
    Create an item from its qualified name.
    Depending on context, it can be a table field, a table field reference,
    or a sequence NEXTVAL and CURRVAL.
      @param thd         - THD, for mem_root
      @param a           - the first name
      @param b           - the second name
      @param c           - the third name
      @retval            - NULL on error, or a pointer to a new Item.
  */
  Item *create_item_ident(THD *thd,
                          const Lex_ident_sys_st *a,
                          const Lex_ident_sys_st *b,
                          const Lex_ident_sys_st *c);

  Item *create_item_ident(THD *thd,
                          const Lex_ident_cli_st *ca,
                          const Lex_ident_cli_st *cb,
                          const Lex_ident_cli_st *cc)
  {
    Lex_ident_sys b(thd, cb), c(thd, cc);
    if (b.is_null() || c.is_null())
      return NULL;
    if (ca->pos() == cb->pos())  // SELECT .t1.col1
    {
      DBUG_ASSERT(ca->length == 0);
      Lex_ident_sys none;
      return create_item_ident(thd, &none, &b, &c);
    }
    Lex_ident_sys a(thd, ca);
    return a.is_null() ? NULL : create_item_ident(thd, &a, &b, &c);
  }

  /*
    Create an item for "NEXT VALUE FOR sequence_name"
  */
  Item *create_item_func_nextval(THD *thd, Table_ident *ident);
  Item *create_item_func_nextval(THD *thd, const LEX_CSTRING *db,
                                           const LEX_CSTRING *name);
  /*
    Create an item for "PREVIOUS VALUE FOR sequence_name"
  */
  Item *create_item_func_lastval(THD *thd, Table_ident *ident);
  Item *create_item_func_lastval(THD *thd, const LEX_CSTRING *db,
                                           const LEX_CSTRING *name);
  
  /*
    Create an item for "SETVAL(sequence_name, value [, is_used [, round]])
  */
  Item *create_item_func_setval(THD *thd, Table_ident *ident, longlong value,
                                ulonglong round, bool is_used);

  /*
    Create an item for a name in LIMIT clause: LIMIT var
      @param THD         - THD, for mem_root
      @param var_name    - the variable name
      @retval            - a new Item corresponding to the SP variable,
                           or NULL on error
                           (non in SP, unknown variable, wrong data type).
  */
  Item *create_item_limit(THD *thd, const Lex_ident_cli_st *var_name);

  /*
    Create an item for a qualified name in LIMIT clause: LIMIT var.field
      @param THD         - THD, for mem_root
      @param var_name    - the variable name
      @param field_name  - the variable field name
      @param start       - start in the query (for binary log)
      @param end         - end in the query (for binary log)
      @retval            - a new Item corresponding to the SP variable,
                           or NULL on error
                           (non in SP, unknown variable, unknown ROW field,
                            wrong data type).
  */
  Item *create_item_limit(THD *thd,
                          const Lex_ident_cli_st *var_name,
                          const Lex_ident_cli_st *field_name);

  Item *create_item_query_expression(THD *thd, st_select_lex_unit *unit);

  Item *make_item_func_sysdate(THD *thd, uint fsp);

  static const Schema *
    find_func_schema_by_name_or_error(const Lex_ident_sys &schema_name,
                                      const Lex_ident_sys &func_name);
  Item *make_item_func_replace(THD *thd,
                               const Lex_ident_cli_st &schema_name,
                               const Lex_ident_cli_st &func_name,
                               Item *org, Item *find, Item *replace);
  Item *make_item_func_replace(THD *thd,
                               const Lex_ident_cli_st &schema_name,
                               const Lex_ident_cli_st &func_name,
                               List<Item> *args);
  Item *make_item_func_substr(THD *thd,
                              const Lex_ident_cli_st &schema_name,
                              const Lex_ident_cli_st &func_name,
                              const Lex_substring_spec_st &spec);
  Item *make_item_func_substr(THD *thd,
                              const Lex_ident_cli_st &schema_name,
                              const Lex_ident_cli_st &func_name,
                              List<Item> *args);
  Item *make_item_func_trim(THD *thd,
                            const Lex_ident_cli_st &schema_name,
                            const Lex_ident_cli_st &func_name,
                            const Lex_trim_st &spec);
  Item *make_item_func_trim(THD *thd,
                            const Lex_ident_cli_st &schema_name,
                            const Lex_ident_cli_st &func_name,
                            List<Item> *args);
  Item *make_item_func_call_generic(THD *thd,
                                    const Lex_ident_cli_st *db,
                                    const Lex_ident_cli_st *name,
                                    List<Item> *args);
  Item *make_item_func_call_generic(THD *thd,
                                    const Lex_ident_sys &db,
                                    const Lex_ident_sys &name,
                                    List<Item> *args);
  Item *make_item_func_call_generic(THD *thd,
                                    Lex_ident_cli_st *db,
                                    Lex_ident_cli_st *pkg,
                                    Lex_ident_cli_st *name,
                                    List<Item> *args);
  Item *make_item_func_call_native_or_parse_error(THD *thd,
                                                  Lex_ident_cli_st &name,
                                                  List<Item> *args);
  my_var *create_outvar(THD *thd, const LEX_CSTRING *name);

  /*
    Create a my_var instance for a ROW field variable that was used
    as an OUT SP parameter: CALL p1(var.field);
      @param THD        - THD, for mem_root
      @param var_name   - the variable name
      @param field_name - the variable field name
  */
  my_var *create_outvar(THD *thd,
                        const LEX_CSTRING *var_name,
                        const LEX_CSTRING *field_name);

  bool is_trigger_new_or_old_reference(const LEX_CSTRING *name) const;

  Item *create_and_link_Item_trigger_field(THD *thd, const LEX_CSTRING *name,
                                           bool new_row);
  // For syntax with colon, e.g. :NEW.a  or :OLD.a
  Item *make_item_colon_ident_ident(THD *thd,
                                    const Lex_ident_cli_st *a,
                                    const Lex_ident_cli_st *b);
  // PLSQL: cursor%ISOPEN etc
  Item *make_item_plsql_cursor_attr(THD *thd, const LEX_CSTRING *name,
                                    plsql_cursor_attr_t attr);

  // For "SELECT @@var", "SELECT @@var.field"
  Item *make_item_sysvar(THD *thd,
                         enum_var_type type,
                         const LEX_CSTRING *name)
  {
    return make_item_sysvar(thd, type, name, &null_clex_str);
  }
  Item *make_item_sysvar(THD *thd,
                         enum_var_type type,
                         const LEX_CSTRING *name,
                         const LEX_CSTRING *component);
  void sp_block_init(THD *thd, const LEX_CSTRING *label);
  void sp_block_init(THD *thd)
  {
    // Unlabeled blocks get an empty label
    sp_block_init(thd, &empty_clex_str);
  }
  bool sp_block_finalize(THD *thd, const Lex_spblock_st spblock)
  {
    class sp_label *tmp;
    return sp_block_finalize(thd, spblock, &tmp);
  }
  bool sp_block_finalize(THD *thd)
  {
    return sp_block_finalize(thd, Lex_spblock());
  }
  bool sp_block_finalize(THD *thd, const Lex_spblock_st spblock,
                                   const LEX_CSTRING *end_label);
  bool sp_block_finalize(THD *thd, const LEX_CSTRING *end_label)
  {
    return sp_block_finalize(thd, Lex_spblock(), end_label);
  }
  bool sp_declarations_join(Lex_spblock_st *res,
                            const Lex_spblock_st b1,
                            const Lex_spblock_st b2) const
  {
    if ((b2.vars || b2.conds) && (b1.curs || b1.hndlrs))
    {
      my_error(ER_SP_VARCOND_AFTER_CURSHNDLR, MYF(0));
      return true;
    }
    if (b2.curs && b1.hndlrs)
    {
      my_error(ER_SP_CURSOR_AFTER_HANDLER, MYF(0));
      return true;
    }
    res->join(b1, b2);
    return false;
  }
  bool sp_block_with_exceptions_finalize_declarations(THD *thd);
  bool sp_block_with_exceptions_finalize_executable_section(THD *thd,
                                                  uint executable_section_ip);
  bool sp_block_with_exceptions_finalize_exceptions(THD *thd,
                                                  uint executable_section_ip,
                                                  uint exception_count);
  bool sp_block_with_exceptions_add_empty(THD *thd);
  bool sp_exit_statement(THD *thd, Item *when);
  bool sp_exit_statement(THD *thd, const LEX_CSTRING *label_name, Item *item);
  bool sp_leave_statement(THD *thd, const LEX_CSTRING *label_name);
  bool sp_goto_statement(THD *thd, const LEX_CSTRING *label_name);

  bool sp_continue_statement(THD *thd);
  bool sp_continue_statement(THD *thd, const LEX_CSTRING *label_name);
  bool sp_iterate_statement(THD *thd, const LEX_CSTRING *label_name);

  bool maybe_start_compound_statement(THD *thd);
  bool sp_push_loop_label(THD *thd, const LEX_CSTRING *label_name);
  bool sp_push_loop_empty_label(THD *thd);
  bool sp_pop_loop_label(THD *thd, const LEX_CSTRING *label_name);
  void sp_pop_loop_empty_label(THD *thd);
  bool sp_while_loop_expression(THD *thd, Item *expr);
  bool sp_while_loop_finalize(THD *thd);
  bool sp_if_after_statements(THD *thd);
  bool sp_push_goto_label(THD *thd, const LEX_CSTRING *label_name);

  Item_param *add_placeholder(THD *thd, const LEX_CSTRING *name,
                              const char *start, const char *end);

  /* Integer range FOR LOOP methods */
  sp_variable *sp_add_for_loop_variable(THD *thd, const LEX_CSTRING *name,
                                        Item *value);
  sp_variable *sp_add_for_loop_target_bound(THD *thd, Item *value)
  {
    LEX_CSTRING name= { STRING_WITH_LEN("[target_bound]") };
    return sp_add_for_loop_variable(thd, &name, value);
  }
  bool sp_for_loop_intrange_declarations(THD *thd, Lex_for_loop_st *loop,
                                        const LEX_CSTRING *index,
                                        const Lex_for_loop_bounds_st &bounds);
  bool sp_for_loop_intrange_condition_test(THD *thd, const Lex_for_loop_st &loop);
  bool sp_for_loop_intrange_iterate(THD *thd, const Lex_for_loop_st &loop);

  /* Cursor FOR LOOP methods */
  bool sp_for_loop_cursor_declarations(THD *thd, Lex_for_loop_st *loop,
                                       const LEX_CSTRING *index,
                                       const Lex_for_loop_bounds_st &bounds);
  sp_variable *sp_add_for_loop_cursor_variable(THD *thd,
                                               const LEX_CSTRING *name,
                                               const class sp_pcursor *cur,
                                               uint coffset,
                                               sp_assignment_lex *param_lex,
                                               Item_args *parameters);
  bool sp_for_loop_implicit_cursor_statement(THD *thd,
                                             Lex_for_loop_bounds_st *bounds,
                                             sp_lex_cursor *cur);
  bool sp_for_loop_cursor_condition_test(THD *thd, const Lex_for_loop_st &loop);
  bool sp_for_loop_cursor_iterate(THD *thd, const Lex_for_loop_st &);

  /* Generic FOR LOOP methods*/

  /*
    Generate FOR loop declarations and
    initialize "loop" from "index" and "bounds".

    @param [IN]  thd    - current THD, for mem_root and error reporting
    @param [OUT] loop   - the loop generated SP variables are stored here,
                          together with additional loop characteristics.
    @param [IN]  index  - the loop index variable name
    @param [IN]  bounds - the loop bounds (in sp_assignment_lex format)
                          and additional loop characteristics,
                          as created by the sp_for_loop_bounds rule.
    @retval true        - on error
    @retval false       - on success

    This methods adds declarations:
    - An explicit integer or cursor%ROWTYPE "index" variable
    - An implicit integer upper bound variable, in case of integer range loops
    - A CURSOR, in case of an implicit CURSOR loops
    The generated variables are stored into "loop".
    Additional loop characteristics are copied from "bounds" to "loop".
  */
  bool sp_for_loop_declarations(THD *thd, Lex_for_loop_st *loop,
                                const LEX_CSTRING *index,
                                const Lex_for_loop_bounds_st &bounds)
  {
    return bounds.is_for_loop_cursor() ?
           sp_for_loop_cursor_declarations(thd, loop, index, bounds) :
           sp_for_loop_intrange_declarations(thd, loop, index, bounds);
  }

  /*
    Generate a conditional jump instruction to leave the loop,
    using a proper condition depending on the loop type:
    - Item_func_le            -- integer range loops
    - Item_func_ge            -- integer range reverse loops
    - Item_func_cursor_found  -- cursor loops
  */
  bool sp_for_loop_condition_test(THD *thd, const Lex_for_loop_st &loop)
  {
    return loop.is_for_loop_cursor() ?
           sp_for_loop_cursor_condition_test(thd, loop) :
           sp_for_loop_intrange_condition_test(thd, loop);
  }

  /*
    Generate "increment" instructions followed by a jump to the
    condition test in the beginnig of the loop.
    "Increment" depends on the loop type and can be:
    - index:= index + 1;       -- integer range loops
    - index:= index - 1;       -- integer range reverse loops
    - FETCH cursor INTO index; -- cursor loops
  */
  bool sp_for_loop_finalize(THD *thd, const Lex_for_loop_st &loop)
  {
    if (loop.is_for_loop_cursor() ?
        sp_for_loop_cursor_iterate(thd, loop) :
        sp_for_loop_intrange_iterate(thd, loop))
      return true;
    // Generate a jump to the beginning of the loop
    return sp_while_loop_finalize(thd);
  }
  bool sp_for_loop_outer_block_finalize(THD *thd, const Lex_for_loop_st &loop);

  /*
    Make an Item when an identifier is found in the FOR loop bounds:
      FOR rec IN cursor
      FOR rec IN var1 .. var2
      FOR rec IN row1.field1 .. xxx
  */
  Item *create_item_for_loop_bound(THD *thd,
                                   const LEX_CSTRING *a,
                                   const LEX_CSTRING *b,
                                   const LEX_CSTRING *c);
  /* End of FOR LOOP methods */

  bool add_signal_statement(THD *thd, const class sp_condition_value *value);
  bool add_resignal_statement(THD *thd, const class sp_condition_value *value);

  // Check if "KEY IF NOT EXISTS name" used outside of ALTER context
  bool check_add_key(DDL_options_st ddl)
  {
    if (ddl.if_not_exists() && sql_command != SQLCOM_ALTER_TABLE)
    {
      parse_error();
      return true;
    }
    return false;
  }
  // Add a key as a part of CREATE TABLE or ALTER TABLE
  bool add_key(Key::Keytype key_type, const LEX_CSTRING *key_name,
               ha_key_alg algorithm, DDL_options_st ddl)
  {
    if (check_add_key(ddl) ||
        !(last_key= new Key(key_type, key_name, algorithm, false, ddl)))
      return true;
    alter_info.key_list.push_back(last_key);
    return false;
  }
  // Add a key for a CREATE INDEX statement
  bool add_create_index(Key::Keytype key_type, const LEX_CSTRING *key_name,
                        ha_key_alg algorithm, DDL_options_st ddl)
  {
    if (check_create_options(ddl) ||
       !(last_key= new Key(key_type, key_name, algorithm, false, ddl)))
      return true;
    alter_info.key_list.push_back(last_key);
    return false;
  }
  bool add_create_index_prepare(Table_ident *table)
  {
    sql_command= SQLCOM_CREATE_INDEX;
    if (!current_select->add_table_to_list(thd, table, NULL,
                                           TL_OPTION_UPDATING,
                                           TL_READ_NO_INSERT,
                                           MDL_SHARED_UPGRADABLE))
      return true;
    alter_info.reset();
    alter_info.flags= ALTER_ADD_INDEX;
    option_list= NULL;
    return false;
  }
  /*
    Add an UNIQUE or PRIMARY key which is a part of a column definition:
      CREATE TABLE t1 (a INT PRIMARY KEY);
  */
  void add_key_to_list(LEX_CSTRING *field_name,
                       enum Key::Keytype type, bool check_exists);
  // Add a constraint as a part of CREATE TABLE or ALTER TABLE
  bool add_constraint(const LEX_CSTRING &name, Virtual_column_info *constr,
                      bool if_not_exists)
  {
    constr->name= name;
    constr->if_not_exists= if_not_exists;
    alter_info.check_constraint_list.push_back(constr);
    return false;
  }
  bool add_alter_list(LEX_CSTRING par_name, Virtual_column_info *expr,
                      bool par_exists);
  bool add_alter_list(LEX_CSTRING name, LEX_CSTRING new_name, bool exists);
  void set_command(enum_sql_command command,
                   DDL_options_st options)
  {
    sql_command= command;
    create_info.set(options);
  }
  void set_command(enum_sql_command command,
                   uint scope,
                   DDL_options_st options)
  {
    set_command(command, options);
    create_info.options|= scope; // HA_LEX_CREATE_TMP_TABLE or 0
  }
  bool check_create_options(DDL_options_st options)
  {
    if (options.or_replace() && options.if_not_exists())
    {
      my_error(ER_WRONG_USAGE, MYF(0), "OR REPLACE", "IF NOT EXISTS");
      return true;
    }
    return false;
  }
  bool set_create_options_with_check(DDL_options_st options)
  {
    create_info.set(options);
    return check_create_options(create_info);
  }
  bool add_create_options_with_check(DDL_options_st options)
  {
    create_info.add(options);
    return check_create_options(create_info);
  }
  bool sp_add_cfetch(THD *thd, const LEX_CSTRING *name);
  bool sp_add_agg_cfetch();

  bool set_command_with_check(enum_sql_command command,
                              uint scope,
                              DDL_options_st options)
  {
    set_command(command, scope, options);
    return check_create_options(options);
  }
  bool set_command_with_check(enum_sql_command command, DDL_options_st options)
  {
    set_command(command, options);
    return check_create_options(options);
  }
  /*
    DROP shares lex->create_info to store TEMPORARY and IF EXISTS options
    to save on extra initialization in lex_start().
    Add some wrappers, to avoid direct use of lex->create_info in the
    caller code processing DROP statements (which might look confusing).
  */
  bool tmp_table() const { return create_info.tmp_table(); }
  bool if_exists() const { return create_info.if_exists(); }

  /*
    Run specified phases for derived tables/views in the given list

    @param table_list - list of derived tables/view to handle
    @param phase      - phases to process tables/views through

    @details
    This method runs phases specified by the 'phases' on derived
    tables/views found in the 'table_list' with help of the
    TABLE_LIST::handle_derived function.
    'this' is passed as an argument to the TABLE_LIST::handle_derived.

    @return false -  ok
    @return true  -  error
  */
  bool handle_list_of_derived(TABLE_LIST *table_list, uint phases)
  {
    for (TABLE_LIST *tl= table_list; tl; tl= tl->next_local)
    {
      if (tl->is_view_or_derived() && tl->handle_derived(this, phases))
        return true;
    }
    return false;
  }

  bool create_like() const
  {
    DBUG_ASSERT(!create_info.like() ||
                !first_select_lex()->item_list.elements);
    return create_info.like();
  }

  bool create_select() const
  {
    DBUG_ASSERT(!create_info.like() ||
                !first_select_lex()->item_list.elements);
    return first_select_lex()->item_list.elements;
  }

  bool create_simple() const
  {
    return !create_like() && !create_select();
  }

  SELECT_LEX *exclude_last_select();
  SELECT_LEX *exclude_not_first_select(SELECT_LEX *exclude);
  void check_automatic_up(enum sub_select_type type);
  bool create_or_alter_view_finalize(THD *thd, Table_ident *table_ident);
  bool add_alter_view(THD *thd, uint16 algorithm, enum_view_suid suid,
                      Table_ident *table_ident);
  bool add_create_view(THD *thd, DDL_options_st ddl,
                       uint16 algorithm, enum_view_suid suid,
                       Table_ident *table_ident);
  bool add_grant_command(THD *thd, const List<LEX_COLUMN> &columns);

  bool stmt_grant_table(THD *thd,
                        Grant_privilege *grant,
                        const Lex_grant_object_name &ident,
                        privilege_t grant_option);

  bool stmt_revoke_table(THD *thd,
                         Grant_privilege *grant,
                         const Lex_grant_object_name &ident);

  bool stmt_grant_sp(THD *thd,
                     Grant_privilege *grant,
                     const Lex_grant_object_name &ident,
                     const Sp_handler &sph,
                     privilege_t grant_option);

  bool stmt_revoke_sp(THD *thd,
                      Grant_privilege *grant,
                      const Lex_grant_object_name &ident,
                      const Sp_handler &sph);

  bool stmt_grant_proxy(THD *thd, LEX_USER *user, privilege_t grant_option);
  bool stmt_revoke_proxy(THD *thd, LEX_USER *user);

  Vers_parse_info &vers_get_info()
  {
    return create_info.vers_info;
  }

  /* The list of history-generating DML commands */
  bool vers_history_generating() const
  {
    switch (sql_command)
    {
      case SQLCOM_DELETE:
        return !vers_conditions.delete_history;
      case SQLCOM_UPDATE:
      case SQLCOM_UPDATE_MULTI:
      case SQLCOM_DELETE_MULTI:
      case SQLCOM_REPLACE:
      case SQLCOM_REPLACE_SELECT:
        return true;
      case SQLCOM_INSERT:
      case SQLCOM_INSERT_SELECT:
        return duplicates == DUP_UPDATE;
      case SQLCOM_LOAD:
        return duplicates == DUP_REPLACE;
      default:
        /*
          Row injections (i.e. row binlog events and BINLOG statements) should
          generate history.
        */
        return is_stmt_row_injection();
    }
  }

  int add_period(Lex_ident name, Lex_ident_sys_st start, Lex_ident_sys_st end)
  {
    if (check_period_name(name.str)) {
      my_error(ER_WRONG_COLUMN_NAME, MYF(0), name.str);
      return 1;
    }

    if (lex_string_cmp(system_charset_info, &start, &end) == 0)
    {
      my_error(ER_FIELD_SPECIFIED_TWICE, MYF(0), start.str);
      return 1;
    }

    Table_period_info &info= create_info.period_info;

    if (check_exists && info.name.streq(name))
      return 0;

    if (info.is_set())
    {
       my_error(ER_MORE_THAN_ONE_PERIOD, MYF(0));
       return 1;
    }
    info.set_period(start, end);
    info.name= name;

    info.constr= new Virtual_column_info();
    info.constr->expr= lt_creator.create(thd,
                                         create_item_ident_nosp(thd, &start),
                                         create_item_ident_nosp(thd, &end));
    add_constraint(null_clex_str, info.constr, false);
    return 0;
  }

  sp_package *get_sp_package() const;

  /**
    Check if the select is a simple select (not an union).
    @retval
      0 ok
    @retval
      1 error   ; In this case the error messege is sent to the client
  */
  bool check_simple_select(const LEX_CSTRING *option)
  {
    if (current_select != &builtin_select)
    {
      char command[80];
      strmake(command, option->str, MY_MIN(option->length, sizeof(command)-1));
      my_error(ER_CANT_USE_OPTION_HERE, MYF(0), command);
      return true;
    }
    return false;
  }

  SELECT_LEX_UNIT *alloc_unit();
  SELECT_LEX *alloc_select(bool is_select);
  SELECT_LEX_UNIT *create_unit(SELECT_LEX*);
  SELECT_LEX *wrap_unit_into_derived(SELECT_LEX_UNIT *unit);
  SELECT_LEX *wrap_select_chain_into_derived(SELECT_LEX *sel);
  void init_select()
  {
    current_select->init_select();
    wild= 0;
    exchange= 0;
  }
  bool main_select_push(bool service= false);
  bool insert_select_hack(SELECT_LEX *sel);
  SELECT_LEX *create_priority_nest(SELECT_LEX *first_in_nest);

  bool set_main_unit(st_select_lex_unit *u)
  {
    unit.options= u->options;
    unit.uncacheable= u->uncacheable;
    unit.register_select_chain(u->first_select());
    unit.first_select()->options|= builtin_select.options;
    unit.fake_select_lex= u->fake_select_lex;
    unit.union_distinct= u->union_distinct;
    unit.set_with_clause(u->with_clause);
    builtin_select.exclude_from_global();
    return false;
  }
  bool check_main_unit_semantics();

  SELECT_LEX_UNIT *parsed_select_expr_start(SELECT_LEX *s1, SELECT_LEX *s2,
                                            enum sub_select_type unit_type,
                                            bool distinct);
  SELECT_LEX_UNIT *parsed_select_expr_cont(SELECT_LEX_UNIT *unit,
                                           SELECT_LEX *s2,
                                           enum sub_select_type unit_type,
                                           bool distinct, bool oracle);
  bool parsed_multi_operand_query_expression_body(SELECT_LEX_UNIT *unit);
  SELECT_LEX_UNIT *add_tail_to_query_expression_body(SELECT_LEX_UNIT *unit,
						     Lex_order_limit_lock *l);
  SELECT_LEX_UNIT *
  add_tail_to_query_expression_body_ext_parens(SELECT_LEX_UNIT *unit,
					       Lex_order_limit_lock *l);
  SELECT_LEX_UNIT *parsed_body_ext_parens_primary(SELECT_LEX_UNIT *unit,
                                                  SELECT_LEX *primary,
                                              enum sub_select_type unit_type,
                                              bool distinct);
  SELECT_LEX_UNIT *
  add_primary_to_query_expression_body(SELECT_LEX_UNIT *unit,
                                       SELECT_LEX *sel,
                                       enum sub_select_type unit_type,
                                       bool distinct,
                                       bool oracle);
  SELECT_LEX_UNIT *
  add_primary_to_query_expression_body(SELECT_LEX_UNIT *unit,
                                       SELECT_LEX *sel,
                                       enum sub_select_type unit_type,
                                       bool distinct);
  SELECT_LEX_UNIT *
  add_primary_to_query_expression_body_ext_parens(
                                       SELECT_LEX_UNIT *unit,
                                       SELECT_LEX *sel,
                                       enum sub_select_type unit_type,
                                       bool distinct);
  SELECT_LEX *parsed_subselect(SELECT_LEX_UNIT *unit);
  bool parsed_insert_select(SELECT_LEX *firs_select);
  void save_values_list_state();
  void restore_values_list_state();
  bool parsed_TVC_start();
  SELECT_LEX *parsed_TVC_end();
  TABLE_LIST *parsed_derived_table(SELECT_LEX_UNIT *unit,
                                   int for_system_time,
                                   LEX_CSTRING *alias);
  bool parsed_create_view(SELECT_LEX_UNIT *unit, int check);
  bool select_finalize(st_select_lex_unit *expr);
  bool select_finalize(st_select_lex_unit *expr, Lex_select_lock l);
  void relink_hack(st_select_lex *select_lex);

  bool stmt_install_plugin(const DDL_options_st &opt,
                           const Lex_ident_sys_st &name,
                           const LEX_CSTRING &soname);
  void stmt_install_plugin(const LEX_CSTRING &soname);

  bool stmt_uninstall_plugin_by_name(const DDL_options_st &opt,
                                     const Lex_ident_sys_st &name);
  bool stmt_uninstall_plugin_by_soname(const DDL_options_st &opt,
                                       const LEX_CSTRING &soname);
  bool stmt_prepare_validate(const char *stmt_type);
  bool stmt_prepare(const Lex_ident_sys_st &ident, Item *code);
  bool stmt_execute(const Lex_ident_sys_st &ident, List<Item> *params);
  bool stmt_execute_immediate(Item *code, List<Item> *params);
  void stmt_deallocate_prepare(const Lex_ident_sys_st &ident);

  bool stmt_alter_table_exchange_partition(Table_ident *table);

  void stmt_purge_to(const LEX_CSTRING &to);
  bool stmt_purge_before(Item *item);

  SELECT_LEX *returning()
  { return &builtin_select; }
  bool has_returning()
  { return !builtin_select.item_list.is_empty(); }

private:
  bool stmt_create_routine_start(const DDL_options_st &options)
  {
    create_info.set(options);
    return main_select_push() || check_create_options(options);
  }
public:
  bool stmt_create_function_start(const DDL_options_st &options)
  {
    sql_command= SQLCOM_CREATE_SPFUNCTION;
    return stmt_create_routine_start(options);
  }
  bool stmt_create_procedure_start(const DDL_options_st &options)
  {
    sql_command= SQLCOM_CREATE_PROCEDURE;
    return stmt_create_routine_start(options);
  }
  void stmt_create_routine_finalize()
  {
    pop_select(); // main select
  }

  bool stmt_create_stored_function_start(const DDL_options_st &options,
                                         enum_sp_aggregate_type,
                                         const sp_name *name);
  bool stmt_create_stored_function_finalize_standalone(const sp_name *end_name);

  bool stmt_create_udf_function(const DDL_options_st &options,
                                enum_sp_aggregate_type agg_type,
                                const Lex_ident_sys_st &name,
                                Item_result return_type,
                                const LEX_CSTRING &soname);

  bool stmt_drop_function(const DDL_options_st &options,
                          const Lex_ident_sys_st &db,
                          const Lex_ident_sys_st &name);

  bool stmt_drop_function(const DDL_options_st &options,
                          const Lex_ident_sys_st &name);

  bool stmt_drop_procedure(const DDL_options_st &options,
                           sp_name *name);

  bool stmt_alter_function_start(sp_name *name);
  bool stmt_alter_procedure_start(sp_name *name);

  sp_condition_value *stmt_signal_value(const Lex_ident_sys_st &ident);

  Spvar_definition *row_field_name(THD *thd, const Lex_ident_sys_st &name);

  bool set_field_type_udt(Lex_field_type_st *type,
                          const LEX_CSTRING &name,
                          const Lex_length_and_dec_st &attr);
  bool set_cast_type_udt(Lex_cast_type_st *type,
                         const LEX_CSTRING &name);

  bool map_data_type(const Lex_ident_sys_st &schema,
                     Lex_field_type_st *type) const;

  void mark_first_table_as_inserting();

  bool fields_are_impossible()
  {
    // no select or it is last select with no tables (service select)
    return !select_stack_head() ||
           (select_stack_top == 1 &&
            select_stack[0]->is_service_select);
  }

  bool add_table_foreign_key(const LEX_CSTRING *name,
                             const LEX_CSTRING *constraint_name,
                             Table_ident *table_name,
                             DDL_options ddl_options);
  bool add_column_foreign_key(const LEX_CSTRING *name,
                              const LEX_CSTRING *constraint_name,
                              Table_ident *ref_table_name,
                              DDL_options ddl_options);

  bool check_dependencies_in_with_clauses();
  bool check_cte_dependencies_and_resolve_references();
  bool resolve_references_to_cte(TABLE_LIST *tables,
                                 TABLE_LIST **tables_last,
                                 st_select_lex_unit *excl_spec);

  /**
    Turn on the SELECT_DESCRIBE flag for every SELECT_LEX involved into
    the statement being processed in case the statement is EXPLAIN UPDATE/DELETE.

    @param lex  current LEX
  */

  void promote_select_describe_flag_if_needed()
  {
    if (describe)
      builtin_select.options |= SELECT_DESCRIBE;
  }

};


/**
  Set_signal_information is a container used in the parsed tree to represent
  the collection of assignments to condition items in the SIGNAL and RESIGNAL
  statements.
*/
class Set_signal_information
{
public:
  /** Empty default constructor, use clear() */
 Set_signal_information() = default; 

  /** Copy constructor. */
  Set_signal_information(const Set_signal_information& set);

  /** Destructor. */
  ~Set_signal_information() = default;

  /** Clear all items. */
  void clear();

  /**
    For each condition item assignment, m_item[] contains the parsed tree
    that represents the expression assigned, if any.
    m_item[] is an array indexed by Diag_condition_item_name.
  */
  Item *m_item[LAST_DIAG_SET_PROPERTY+1];
};


/**
  The internal state of the syntax parser.
  This object is only available during parsing,
  and is private to the syntax parser implementation (sql_yacc.yy).
*/
class Yacc_state
{
public:
  Yacc_state() : yacc_yyss(NULL), yacc_yyvs(NULL) { reset(); }

  void reset()
  {
    if (yacc_yyss != NULL) {
      my_free(yacc_yyss);
      yacc_yyss = NULL;
    }
    if (yacc_yyvs != NULL) {
      my_free(yacc_yyvs);
      yacc_yyvs = NULL;
    }
    m_set_signal_info.clear();
    m_lock_type= TL_READ_DEFAULT;
    m_mdl_type= MDL_SHARED_READ;
  }

  ~Yacc_state();

  /**
    Reset part of the state which needs resetting before parsing
    substatement.
  */
  void reset_before_substatement()
  {
    m_lock_type= TL_READ_DEFAULT;
    m_mdl_type= MDL_SHARED_READ;
  }

  /**
    Bison internal state stack, yyss, when dynamically allocated using
    my_yyoverflow().
  */
  uchar *yacc_yyss;

  /**
    Bison internal semantic value stack, yyvs, when dynamically allocated using
    my_yyoverflow().
  */
  uchar *yacc_yyvs;

  /**
    Fragments of parsed tree,
    used during the parsing of SIGNAL and RESIGNAL.
  */
  Set_signal_information m_set_signal_info;

  /**
    Type of lock to be used for tables being added to the statement's
    table list in table_factor, table_alias_ref, single_multi and
    table_wild_one rules.
    Statements which use these rules but require lock type different
    from one specified by this member have to override it by using
    st_select_lex::set_lock_for_tables() method.

    The default value of this member is TL_READ_DEFAULT. The only two
    cases in which we change it are:
    - When parsing SELECT HIGH_PRIORITY.
    - Rule for DELETE. In which we use this member to pass information
      about type of lock from delete to single_multi part of rule.

    We should try to avoid introducing new use cases as we would like
    to get rid of this member eventually.
  */
  thr_lock_type m_lock_type;

  /**
    The type of requested metadata lock for tables added to
    the statement table list.
  */
  enum_mdl_type m_mdl_type;

  /*
    TODO: move more attributes from the LEX structure here.
  */
};

/**
  Internal state of the parser.
  The complete state consist of:
  - state data used during lexical parsing,
  - state data used during syntactic parsing.
*/
class Parser_state
{
public:
  Parser_state()
    : m_yacc()
  {}

  /**
     Object initializer. Must be called before usage.

     @retval FALSE OK
     @retval TRUE  Error
  */
  bool init(THD *thd, char *buff, size_t length)
  {
    return m_lip.init(thd, buff, length);
  }

  ~Parser_state() = default;

  Lex_input_stream m_lip;
  Yacc_state m_yacc;

  /**
    Current performance digest instrumentation. 
  */
  PSI_digest_locker* m_digest_psi;

  void reset(char *found_semicolon, unsigned int length)
  {
    m_lip.reset(found_semicolon, length);
    m_yacc.reset();
  }
};


extern sql_digest_state *
digest_add_token(sql_digest_state *state, uint token, LEX_YYSTYPE yylval);

extern sql_digest_state *
digest_reduce_token(sql_digest_state *state, uint token_left, uint token_right);

struct st_lex_local: public LEX, public Sql_alloc
{
};


/**
  An st_lex_local extension with automatic initialization for SP purposes.
  Used to parse sub-expressions and SP sub-statements.

  This class is reused for:
  1. sp_head::reset_lex() based constructs
    - SP variable assignments (e.g. SET x=10;)
    - FOR loop conditions and index variable increments
    - Cursor statements
    - SP statements
    - SP function RETURN statements
    - CASE statements
    - REPEAT..UNTIL expressions
    - WHILE expressions
    - EXIT..WHEN and CONTINUE..WHEN statements
  2. sp_assignment_lex based constructs:
    - CURSOR parameter assignments
*/
class sp_lex_local: public st_lex_local
{
public:
  sp_lex_local(THD *thd, const LEX *oldlex)
  {
    /* Reset most stuff. */
    start(thd);
    /* Keep the parent SP stuff */
    sphead= oldlex->sphead;
    spcont= oldlex->spcont;
    /* Keep the parent trigger stuff too */
    trg_chistics= oldlex->trg_chistics;
    trg_table_fields.empty();
    sp_lex_in_use= false;
  }
};


class sp_lex_set_var: public sp_lex_local
{
public:
  sp_lex_set_var(THD *thd, const LEX *oldlex)
   :sp_lex_local(thd, oldlex)
  {
    // Set new LEX as if we at start of set rule
    init_select();
    sql_command= SQLCOM_SET_OPTION;
    var_list.empty();
    autocommit= 0;
    option_type= oldlex->option_type; // Inherit from the outer lex
  }
};


class sp_expr_lex: public sp_lex_local
{
  Item *m_item;       // The expression
public:
  sp_expr_lex(THD *thd, LEX *oldlex)
   :sp_lex_local(thd, oldlex),
    m_item(NULL)
  { }
  void set_item(Item *item)
  {
    m_item= item;
  }
  Item *get_item() const
  {
    return m_item;
  }
  bool sp_continue_when_statement(THD *thd);
  bool sp_continue_when_statement(THD *thd, const LEX_CSTRING *label_name);
  int case_stmt_action_expr();
  int case_stmt_action_when(bool simple);
  bool sp_while_loop_expression(THD *thd)
  {
    return LEX::sp_while_loop_expression(thd, get_item());
  }
  bool sp_repeat_loop_finalize(THD *thd);
  bool sp_if_expr(THD *thd);
};


/**
  An assignment specific LEX, which additionally has an Item (an expression)
  and an associated with the Item free_list, which is usually freed
  after the expression is calculated.

  Note, consider changing some of sp_lex_local to sp_assignment_lex,
  as the latter allows to use a simpler grammar in sql_yacc.yy (IMO).

  If the expression is simple (e.g. does not have function calls),
  then m_item and m_free_list point to the same Item.

  If the expressions is complex (e.g. have function calls),
  then m_item points to the leftmost Item, while m_free_list points
  to the rightmost item.
  For example:
      f1(COALESCE(f2(10), f2(20)))
  - m_item points to Item_func_sp for f1 (the leftmost Item)
  - m_free_list points to Item_int for 20 (the rightmost Item)

  Note, we could avoid storing m_item at all, as we can always reach
  the leftmost item from the rightmost item by iterating through m_free_list.
  But with a separate m_item the code should be faster.
*/
class sp_assignment_lex: public sp_lex_local
{
  Item *m_item;       // The expression
  Item *m_free_list;  // The associated free_list (sub-expressions)
public:
  sp_assignment_lex(THD *thd, LEX *oldlex)
   :sp_lex_local(thd, oldlex),
    m_item(NULL),
    m_free_list(NULL)
  { }
  void set_item_and_free_list(Item *item, Item *free_list)
  {
    m_item= item;
    m_free_list= free_list;
  }
  Item *get_item() const
  {
    return m_item;
  }
  Item *get_free_list() const
  {
    return m_free_list;
  }
};


extern void lex_init(void);
extern void lex_free(void);
extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
extern void lex_end_nops(LEX *lex);
extern void lex_unlock_plugins(LEX *lex);
void end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex);
int init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex);
extern int MYSQLlex(union YYSTYPE *yylval, THD *thd);
extern int ORAlex(union YYSTYPE *yylval, THD *thd);

inline void trim_whitespace(CHARSET_INFO *cs, LEX_CSTRING *str,
                            size_t * prefix_length = 0)
{
  *str= Lex_cstring(*str).trim_whitespace(cs, prefix_length);
}


extern bool is_lex_native_function(const LEX_CSTRING *name); 
extern bool is_native_function(THD *thd, const LEX_CSTRING *name);
extern bool is_native_function_with_warn(THD *thd, const LEX_CSTRING *name);

/**
  @} (End of group Semantic_Analysis)
*/

void my_missing_function_error(const LEX_CSTRING &token, const char *name);
bool is_keyword(const char *name, uint len);
int set_statement_var_if_exists(THD *thd, const char *var_name,
                                size_t var_name_length, ulonglong value);

Virtual_column_info *add_virtual_expression(THD *thd, Item *expr);
Item* handle_sql2003_note184_exception(THD *thd, Item* left, bool equal,
                                       Item *expr);

bool sp_create_assignment_lex(THD *thd, const char *pos);
bool sp_create_assignment_instr(THD *thd, bool no_lookahead,
                                bool need_set_keyword= true);

void mark_or_conds_to_avoid_pushdown(Item *cond);

#endif /* MYSQL_SERVER */
#endif /* SQL_LEX_INCLUDED */
server/private/dur_prop.h000064400000002072150400263740011531 0ustar00/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.

   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-1301  USA */

#ifndef _my_dur_prop_h
#define _my_dur_prop_h

enum durability_properties
{
  /*
    Preserves the durability properties defined by the engine
  */
  HA_REGULAR_DURABILITY= 0,
  /*
     Ignore the durability properties defined by the engine and
     write only in-memory entries.
  */
  HA_IGNORE_DURABILITY= 1
};

#endif /* _my_dur_prop_h */
server/private/sql_schema.h000064400000006347150400263740012027 0ustar00#ifndef SQL_SCHEMA_H_INCLUDED
#define SQL_SCHEMA_H_INCLUDED
/*
 Copyright (c) 2020, 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 "mysqld.h"
#include "lex_string.h"

class Lex_ident_sys;
class Create_func;

class Schema
{
  LEX_CSTRING m_name;
public:
  Schema(const LEX_CSTRING &name)
   :m_name(name)
  { }
  virtual ~Schema() = default;
  const LEX_CSTRING &name() const { return m_name; }
  virtual const Type_handler *map_data_type(THD *thd, const Type_handler *src)
                                            const
  {
    return src;
  }

  /**
    Find a native function builder, return an error if not found,
    build an Item otherwise.
  */
  Item *make_item_func_call_native(THD *thd,
                                   const Lex_ident_sys &name,
                                   List<Item> *args) const;

  /**
    Find the native function builder associated with a given function name.
    @param thd The current thread
    @param name The native function name
    @return The native function builder associated with the name, or NULL
  */
  virtual Create_func *find_native_function_builder(THD *thd,
                                                    const LEX_CSTRING &name)
                                                    const;

  // Builders for native SQL function with a special syntax in sql_yacc.yy
  virtual Item *make_item_func_replace(THD *thd,
                                       Item *subj,
                                       Item *find,
                                       Item *replace) const;
  virtual Item *make_item_func_substr(THD *thd,
                                      const Lex_substring_spec_st &spec) const;

  virtual Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const;

  /*
    For now we have *hard-coded* compatibility schemas:
      schema_mariadb, schema_oracle, schema_maxdb.
    But eventually we'll turn then into real databases on disk.
    So the code below compares names according to the filesystem
    case sensitivity, like it is done for regular databases.

    Note, this is different to information_schema, whose name
    is always case insensitive. This is intentional!
    The assymetry will be gone when we'll implement SQL standard
    regular and delimited identifiers.
  */
  bool eq_name(const LEX_CSTRING &name) const
  {
    return !table_alias_charset->strnncoll(m_name.str, m_name.length,
                                           name.str, name.length);
  }
  static Schema *find_by_name(const LEX_CSTRING &name);
  static Schema *find_implied(THD *thd);
};


extern Schema mariadb_schema;
extern const Schema &oracle_schema_ref;

#endif // SQL_SCHEMA_H_INCLUDED
server/private/table_cache.h000064400000010210150400263740012102 0ustar00#ifndef TABLE_CACHE_H_INCLUDED
#define TABLE_CACHE_H_INCLUDED
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2010, 2011 Monty Program Ab
   Copyright (C) 2013 Sergey Vojtovich and MariaDB Foundation

   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 */


struct Share_free_tables
{
  typedef I_P_List <TABLE, TABLE_share> List;
  List list;
  /** Avoid false sharing between instances */
  char pad[CPU_LEVEL1_DCACHE_LINESIZE];
};


struct TDC_element
{
  uchar m_key[NAME_LEN + 1 + NAME_LEN + 1];
  uint m_key_length;
  bool flushed;
  TABLE_SHARE *share;

  /**
    Protects ref_count, m_flush_tickets, all_tables, flushed, all_tables_refs.
  */
  mysql_mutex_t LOCK_table_share;
  mysql_cond_t COND_release;
  TDC_element *next, **prev;            /* Link to unused shares */
  uint ref_count;                       /* How many TABLE objects uses this */
  uint all_tables_refs;                 /* Number of refs to all_tables */
  /**
    List of tickets representing threads waiting for the share to be flushed.
  */
  Wait_for_flush_list m_flush_tickets;
  /*
    Doubly-linked (back-linked) lists of used and unused TABLE objects
    for this share.
  */
  All_share_tables_list all_tables;
  /** Avoid false sharing between TDC_element and free_tables */
  char pad[CPU_LEVEL1_DCACHE_LINESIZE];
  Share_free_tables free_tables[1];

  inline void wait_for_refs(uint my_refs);
  void flush(THD *thd, bool mark_flushed);
  void flush_unused(bool mark_flushed);
};


extern ulong tdc_size;
extern ulong tc_size;
extern uint32 tc_instances;

extern bool tdc_init(void);
extern void tdc_start_shutdown(void);
extern void tdc_deinit(void);
extern ulong tdc_records(void);
extern void tdc_purge(bool all);
extern TDC_element *tdc_lock_share(THD *thd, const char *db,
                                   const char *table_name);
extern void tdc_unlock_share(TDC_element *element);
int tdc_share_is_cached(THD *thd, const char *db, const char *table_name);
extern TABLE_SHARE *tdc_acquire_share(THD *thd, TABLE_LIST *tl, uint flags,
                                      TABLE **out_table= 0);
extern void tdc_release_share(TABLE_SHARE *share);
void tdc_remove_referenced_share(THD *thd, TABLE_SHARE *share);
void tdc_remove_table(THD *thd, const char *db, const char *table_name);

extern int tdc_wait_for_old_version(THD *thd, const char *db,
                                    const char *table_name,
                                    ulong wait_timeout, uint deadlock_weight);
extern int tdc_iterate(THD *thd, my_hash_walk_action action, void *argument,
                       bool no_dups= false);

extern uint tc_records(void);
int show_tc_active_instances(THD *thd, SHOW_VAR *var, void *buff,
                             system_status_var *, enum enum_var_type scope);
extern void tc_purge();
extern void tc_add_table(THD *thd, TABLE *table);
extern void tc_release_table(TABLE *table);
extern TABLE *tc_acquire_table(THD *thd, TDC_element *element);

/**
  Create a table cache key for non-temporary table.

  @param key         Buffer for key (must be at least NAME_LEN*2+2 bytes).
  @param db          Database name.
  @param table_name  Table name.

  @return Length of key.
*/

inline uint tdc_create_key(char *key, const char *db, const char *table_name)
{
  /*
    In theory caller should ensure that both db and table_name are
    not longer than NAME_LEN bytes. In practice we play safe to avoid
    buffer overruns.
  */
  return (uint) (strmake(strmake(key, db, NAME_LEN) + 1, table_name,
                         NAME_LEN) - key + 1);
}
#endif /* TABLE_CACHE_H_INCLUDED */
server/private/sql_table.h000064400000022614150400263740011651 0ustar00/* Copyright (c) 2006, 2014, Oracle and/or its affiliates.
   Copyright (c) 2011, 2017, 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 */

#ifndef SQL_TABLE_INCLUDED
#define SQL_TABLE_INCLUDED

#include <my_sys.h>                             // pthread_mutex_t
#include "m_string.h"                           // LEX_CUSTRING

class Alter_info;
class Alter_table_ctx;
class Column_definition;
class Create_field;
struct TABLE_LIST;
class THD;
struct TABLE;
struct handlerton;
class handler;
class String;
typedef struct st_ha_check_opt HA_CHECK_OPT;
struct HA_CREATE_INFO;
struct Table_specification_st;
typedef struct st_key KEY;
typedef struct st_key_cache KEY_CACHE;
typedef struct st_lock_param_type ALTER_PARTITION_PARAM_TYPE;
typedef struct st_order ORDER;
typedef struct st_ddl_log_state DDL_LOG_STATE;

enum enum_explain_filename_mode
{
  EXPLAIN_ALL_VERBOSE= 0,
  EXPLAIN_PARTITIONS_VERBOSE,
  EXPLAIN_PARTITIONS_AS_COMMENT
};


/* depends on errmsg.txt Database `db`, Table `t` ... */
#define EXPLAIN_FILENAME_MAX_EXTRA_LENGTH 63

#define WFRM_WRITE_SHADOW 1
#define WFRM_INSTALL_SHADOW 2
#define WFRM_KEEP_SHARE 4

/* Flags for conversion functions. */
static const uint FN_FROM_IS_TMP=  1 << 0;
static const uint FN_TO_IS_TMP=    1 << 1;
static const uint FN_IS_TMP=       FN_FROM_IS_TMP | FN_TO_IS_TMP;
static const uint NO_FRM_RENAME=   1 << 2;
static const uint FRM_ONLY=        1 << 3;
/** Don't remove table in engine. Remove only .FRM and maybe .PAR files. */
static const uint NO_HA_TABLE=     1 << 4;
/** Don't resolve MySQL's fake "foo.sym" symbolic directory names. */
static const uint SKIP_SYMDIR_ACCESS= 1 << 5;
/** Don't check foreign key constraints while renaming table */
static const uint NO_FK_CHECKS=    1 << 6;
/* Don't delete .par table in quick_rm_table() */
static const uint NO_PAR_TABLE=   1 << 7;

uint filename_to_tablename(const char *from, char *to, size_t to_length,
                           bool stay_quiet = false);
uint tablename_to_filename(const char *from, char *to, size_t to_length);
uint check_n_cut_mysql50_prefix(const char *from, char *to, size_t to_length);
bool check_mysql50_prefix(const char *name);
uint build_table_filename(char *buff, size_t bufflen, const char *db,
                          const char *table, const char *ext, uint flags);
uint build_table_shadow_filename(char *buff, size_t bufflen,
                                 ALTER_PARTITION_PARAM_TYPE *lpt);
void build_lower_case_table_filename(char *buff, size_t bufflen,
                                     const LEX_CSTRING *db,
                                     const LEX_CSTRING *table,
                                     uint flags);
uint build_tmptable_filename(THD* thd, char *buff, size_t bufflen);
bool mysql_create_table(THD *thd, TABLE_LIST *create_table,
                        Table_specification_st *create_info,
                        Alter_info *alter_info);
bool add_keyword_to_query(THD *thd, String *result, const LEX_CSTRING *keyword,
                          const LEX_CSTRING *add);

/*
  mysql_create_table_no_lock can be called in one of the following
  mutually exclusive situations:

  - Just a normal ordinary CREATE TABLE statement that explicitly
    defines the table structure.

  - CREATE TABLE ... SELECT. It is special, because only in this case,
    the list of fields is allowed to have duplicates, as long as one of the
    duplicates comes from the select list, and the other doesn't. For
    example in

       CREATE TABLE t1 (a int(5) NOT NUL) SELECT b+10 as a FROM t2;

    the list in alter_info->create_list will have two fields `a`.

  - ALTER TABLE, that creates a temporary table #sql-xxx, which will be later
    renamed to replace the original table.

  - ALTER TABLE as above, but which only modifies the frm file, it only
    creates an frm file for the #sql-xxx, the table in the engine is not
    created.

  - Assisted discovery, CREATE TABLE statement without the table structure.

  These situations are distinguished by the following "create table mode"
  values, where a CREATE ... SELECT is denoted by any non-negative number
  (which should be the number of fields in the SELECT ... part), and other
  cases use constants as defined below.
*/
#define C_CREATE_SELECT(X)        ((X) > 0 ? (X) : 0)
#define C_ORDINARY_CREATE         0
#define C_ASSISTED_DISCOVERY     -1
#define C_ALTER_TABLE            -2
#define C_ALTER_TABLE_FRM_ONLY   -3

int mysql_create_table_no_lock(THD *thd,
                               DDL_LOG_STATE *ddl_log_state,
                               DDL_LOG_STATE *ddl_log_state_rm,
                               Table_specification_st *create_info,
                               Alter_info *alter_info, bool *is_trans,
                               int create_table_mode, TABLE_LIST *table);

handler *mysql_create_frm_image(THD *thd, HA_CREATE_INFO *create_info,
                                Alter_info *alter_info, int create_table_mode,
                                KEY **key_info, uint *key_count,
                                LEX_CUSTRING *frm);

int mysql_discard_or_import_tablespace(THD *thd, TABLE_LIST *table_list,
                                       bool discard);

bool mysql_prepare_alter_table(THD *thd, TABLE *table,
                               HA_CREATE_INFO *create_info,
                               Alter_info *alter_info,
                               Alter_table_ctx *alter_ctx);
bool mysql_trans_prepare_alter_copy_data(THD *thd);
bool mysql_trans_commit_alter_copy_data(THD *thd);
bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
                       const LEX_CSTRING *new_name,
                       HA_CREATE_INFO *create_info,
                       TABLE_LIST *table_list,
                       class Recreate_info *recreate_info,
                       Alter_info *alter_info,
                       uint order_num, ORDER *order, bool ignore,
                       bool if_exists);
bool mysql_compare_tables(TABLE *table,
                          Alter_info *alter_info,
                          HA_CREATE_INFO *create_info,
                          bool *metadata_equal);
bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list,
                          class Recreate_info *recreate_info, bool table_copy);
bool mysql_create_like_table(THD *thd, TABLE_LIST *table,
                             TABLE_LIST *src_table,
                             Table_specification_st *create_info);
bool mysql_rename_table(handlerton *base, const LEX_CSTRING *old_db,
                        const LEX_CSTRING *old_name, const LEX_CSTRING *new_db,
                        const LEX_CSTRING *new_name, LEX_CUSTRING *id,
                        uint flags);
bool mysql_backup_table(THD* thd, TABLE_LIST* table_list);
bool mysql_restore_table(THD* thd, TABLE_LIST* table_list);

template<typename T> class List;
void fill_checksum_table_metadata_fields(THD *thd, List<Item> *fields);
bool mysql_checksum_table(THD* thd, TABLE_LIST* table_list,
                          HA_CHECK_OPT* check_opt);
bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists,
                    bool drop_temporary, bool drop_sequence,
                    bool dont_log_query);
int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
                            const LEX_CSTRING *db,
                            DDL_LOG_STATE *ddl_log_state,
                            bool if_exists,
                            bool drop_temporary, bool drop_view,
                            bool drop_sequence,
                            bool dont_log_query, bool dont_free_locks);
bool log_drop_table(THD *thd, const LEX_CSTRING *db_name,
                    const LEX_CSTRING *table_name, const LEX_CSTRING *handler,
                    bool partitioned, const LEX_CUSTRING *id,
                    bool temporary_table);
bool quick_rm_table(THD *thd, handlerton *base, const LEX_CSTRING *db,
                    const LEX_CSTRING *table_name, uint flags,
                    const char *table_path=0);
void close_cached_table(THD *thd, TABLE *table);
void sp_prepare_create_field(THD *thd, Column_definition *sql_field);
bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags);
int write_bin_log(THD *thd, bool clear_error,
                  char const *query, ulong query_length,
                  bool is_trans= FALSE);
int write_bin_log_with_if_exists(THD *thd, bool clear_error,
                                 bool is_trans, bool add_if_exists);

void promote_first_timestamp_column(List<Create_field> *column_definitions);

/*
  These prototypes where under INNODB_COMPATIBILITY_HOOKS.
*/
uint explain_filename(THD* thd, const char *from, char *to, uint to_length,
                      enum_explain_filename_mode explain_mode);


extern MYSQL_PLUGIN_IMPORT const LEX_CSTRING primary_key_name;

bool check_engine(THD *, const char *, const char *, HA_CREATE_INFO *);

#endif /* SQL_TABLE_INCLUDED */
server/private/sql_plist.h000064400000017064150400263740011720 0ustar00#ifndef SQL_PLIST_H
#define SQL_PLIST_H
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */


template <typename T, typename L>
class I_P_List_iterator;
class I_P_List_null_counter;
template <typename T> class I_P_List_no_push_back;


/**
   Intrusive parameterized list.

   Unlike I_List does not require its elements to be descendant of ilink
   class and therefore allows them to participate in several such lists
   simultaneously.

   Unlike List is doubly-linked list and thus supports efficient deletion
   of element without iterator.

   @param T  Type of elements which will belong to list.
   @param B  Class which via its methods specifies which members
             of T should be used for participating in this list.
             Here is typical layout of such class:

             struct B
             {
               static inline T **next_ptr(T *el)
               {
                 return &el->next;
               }
               static inline T ***prev_ptr(T *el)
               {
                 return &el->prev;
               }
             };
   @param C  Policy class specifying how counting of elements in the list
             should be done. Instance of this class is also used as a place
             where information about number of list elements is stored.
             @sa I_P_List_null_counter, I_P_List_counter
   @param I  Policy class specifying whether I_P_List should support
             efficient push_back() operation. Instance of this class
             is used as place where we store information to support
             this operation.
             @sa I_P_List_no_push_back, I_P_List_fast_push_back.
*/

template <typename T, typename B,
          typename C = I_P_List_null_counter,
          typename I = I_P_List_no_push_back<T> >
class I_P_List : public C, public I
{
  T *m_first;

  /*
    Do not prohibit copying of I_P_List object to simplify their usage in
    backup/restore scenarios. Note that performing any operations on such
    is a bad idea.
  */
public:
  I_P_List() : I(&m_first), m_first(NULL) {};
  /*
    empty() is used in many places in the code instead of a constructor, to
    initialize a bzero-ed I_P_List instance.
  */

  inline void empty()      { m_first= NULL; C::reset(); I::set_last(&m_first); }
  inline bool is_empty() const { return (m_first == NULL); }
  inline void push_front(T* a)
  {
    *B::next_ptr(a)= m_first;
    if (m_first)
      *B::prev_ptr(m_first)= B::next_ptr(a);
    else
      I::set_last(B::next_ptr(a));
    m_first= a;
    *B::prev_ptr(a)= &m_first;
    C::inc();
  }
  inline void push_back(T *a)
  {
    T **last= I::get_last();
    *B::next_ptr(a)= *last;
    *last= a;
    *B::prev_ptr(a)= last;
    I::set_last(B::next_ptr(a));
    C::inc();
  }
  inline void insert_after(T *pos, T *a)
  {
    if (pos == NULL)
      push_front(a);
    else
    {
      *B::next_ptr(a)= *B::next_ptr(pos);
      *B::prev_ptr(a)= B::next_ptr(pos);
      *B::next_ptr(pos)= a;
      if (*B::next_ptr(a))
      {
        T *old_next= *B::next_ptr(a);
        *B::prev_ptr(old_next)= B::next_ptr(a);
      }
      else
        I::set_last(B::next_ptr(a));
      C::inc();
    }
  }
  inline void remove(T *a)
  {
    T *next= *B::next_ptr(a);
    if (next)
      *B::prev_ptr(next)= *B::prev_ptr(a);
    else
      I::set_last(*B::prev_ptr(a));
    **B::prev_ptr(a)= next;
    C::dec();
  }
  inline T* front() { return m_first; }
  inline const T *front() const { return m_first; }
  inline T* pop_front()
  {
    T *result= front();

    if (result)
      remove(result);

    return result;
  }
  void swap(I_P_List<T, B, C> &rhs)
  {
    swap_variables(T *, m_first, rhs.m_first);
    I::swap(rhs);
    if (m_first)
      *B::prev_ptr(m_first)= &m_first;
    else
      I::set_last(&m_first);
    if (rhs.m_first)
      *B::prev_ptr(rhs.m_first)= &rhs.m_first;
    else
      I::set_last(&rhs.m_first);
    C::swap(rhs);
  }
  typedef B Adapter;
  typedef I_P_List<T, B, C, I> Base;
  typedef I_P_List_iterator<T, Base> Iterator;
  typedef I_P_List_iterator<const T, Base> Const_Iterator;
#ifndef _lint
  friend class I_P_List_iterator<T, Base>;
  friend class I_P_List_iterator<const T, Base>;
#endif
};


/**
   Iterator for I_P_List.
*/

template <typename T, typename L>
class I_P_List_iterator
{
  const L *list;
  T *current;
public:
  I_P_List_iterator(const L &a)
    : list(&a), current(a.m_first) {}
  I_P_List_iterator(const L &a, T* current_arg)
    : list(&a), current(current_arg) {}
  inline void init(const L &a)
  {
    list= &a;
    current= a.m_first;
  }
  /**
    Operator for it++

    @note since we save next element pointer, caller may remove current element.
    Such modification doesn't invalidate iterator.
  */
  inline T* operator++(int)
  {
    T *result= current;
    if (result)
      current= *L::Adapter::next_ptr(current);
    return result;
  }
  /* Operator for ++it */
  inline T* operator++()
  {
    current= *L::Adapter::next_ptr(current);
    return current;
  }
  inline void rewind()
  {
    current= list->m_first;
  }
};


/**
  Hook class which via its methods specifies which members
  of T should be used for participating in a intrusive list.
*/

template <typename T, T* T::*next, T** T::*prev>
struct I_P_List_adapter
{
  static inline T **next_ptr(T *el) { return &(el->*next); }
  static inline const T* const* next_ptr(const T *el) { return &(el->*next); }
  static inline T ***prev_ptr(T *el) { return &(el->*prev); }
};


/**
  Element counting policy class for I_P_List to be used in
  cases when no element counting should be done.
*/

class I_P_List_null_counter
{
protected:
  void reset() {}
  void inc() {}
  void dec() {}
  void swap(I_P_List_null_counter &) {}
};


/**
  Element counting policy class for I_P_List which provides
  basic element counting.
*/

class I_P_List_counter
{
  uint m_counter;
protected:
  I_P_List_counter() : m_counter (0) {}
  void reset() {m_counter= 0;}
  void inc() {m_counter++;}
  void dec() {m_counter--;}
  void swap(I_P_List_counter &rhs)
  { swap_variables(uint, m_counter, rhs.m_counter); }
public:
  uint elements() const { return m_counter; }
};


/**
  A null insertion policy class for I_P_List to be used
  in cases when push_back() operation is not necessary.
*/

template <typename T> class I_P_List_no_push_back
{
protected:
  I_P_List_no_push_back(T **) {}
  void set_last(T **) {}
  /*
    T** get_last() const method is intentionally left unimplemented
    in order to prohibit usage of push_back() method in lists which
    use this policy.
  */
  void swap(I_P_List_no_push_back<T> &) {}
};


/**
  An insertion policy class for I_P_List which can
  be used when fast push_back() operation is required.
*/

template <typename T> class I_P_List_fast_push_back
{
  T **m_last;
protected:
  I_P_List_fast_push_back(T **a) : m_last(a) { };
  void set_last(T **a) { m_last= a; }
  T** get_last() const { return m_last; }
  void swap(I_P_List_fast_push_back<T> &rhs)
  { swap_variables(T**, m_last, rhs.m_last); }
};

#endif
server/private/sql_help.h000064400000001743150400263740011512 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_HELP_INCLUDED
#define SQL_HELP_INCLUDED

class THD;


/*
  Function prototypes
*/

bool mysqld_help (THD *thd, const char *text);

bool mysqld_help_prepare(THD *thd, const char *text, List<Item> *fields);

#endif /* SQL_HELP_INCLUDED */
server/private/message.h000064400000002253150400263740011324 0ustar00/*
  To change or add messages mysqld writes to the Windows error log, run
   mc.exe message.mc
  and checkin generated messages.h, messages.rc and msg000001.bin under the 
  source control.
  mc.exe can be installed with Windows SDK, some Visual Studio distributions 
  do not include it.
*/
//
//  Values are 32 bit values laid out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +---+-+-+-----------------------+-------------------------------+
//  |Sev|C|R|     Facility          |               Code            |
//  +---+-+-+-----------------------+-------------------------------+
//
//  where
//
//      Sev - is the severity code
//
//          00 - Success
//          01 - Informational
//          10 - Warning
//          11 - Error
//
//      C - is the Customer code flag
//
//      R - is a reserved bit
//
//      Facility - is the facility code
//
//      Code - is the facility's status code
//
//
// Define the facility codes
//


//
// Define the severity codes
//


//
// MessageId: MSG_DEFAULT
//
// MessageText:
//
// %1
// 
//
#define MSG_DEFAULT                      0xC0000064L

server/private/sql_connect.h000064400000007767150400263740012227 0ustar00/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_CONNECT_INCLUDED
#define SQL_CONNECT_INCLUDED

#include <my_sys.h>                          /* pthread_handler_t */
#include "mysql_com.h"                         /* enum_server_command */
#include "structs.h"
#include <mysql/psi/mysql_socket.h>
#include <hash.h>
#include "violite.h"

/*
  Object to hold connect information to be given to the newly created thread
*/

struct scheduler_functions;

class CONNECT : public ilink {
public:
  MYSQL_SOCKET sock;
#ifdef _WIN32
  HANDLE pipe;
  CONNECT(HANDLE pipe_arg): pipe(pipe_arg), vio_type(VIO_TYPE_NAMEDPIPE),
    scheduler(thread_scheduler), thread_id(0), prior_thr_create_utime(0)
  {
    count++;
  }
#endif
  enum enum_vio_type vio_type;
  scheduler_functions *scheduler;
  my_thread_id thread_id;

  /* Own variables */
  ulonglong    prior_thr_create_utime;

  static Atomic_counter<uint32_t> count;

  CONNECT(MYSQL_SOCKET sock_arg, enum enum_vio_type vio_type_arg,
          scheduler_functions *scheduler_arg): sock(sock_arg),
    vio_type(vio_type_arg), scheduler(scheduler_arg), thread_id(0),
    prior_thr_create_utime(0)
  {
    count++;
  }
  ~CONNECT()
  {
    count--;
    DBUG_ASSERT(vio_type == VIO_CLOSED);
  }
  void close_and_delete(uint err);
  void close_with_error(uint sql_errno,
                        const char *message, uint close_error);
  THD *create_thd(THD *thd);
};


class THD;
typedef struct user_conn USER_CONN;

void init_max_user_conn(void);
void init_global_user_stats(void);
void init_global_table_stats(void);
void init_global_index_stats(void);
void init_global_client_stats(void);
void free_max_user_conn(void);
void free_global_user_stats(void);
void free_global_table_stats(void);
void free_global_index_stats(void);
void free_global_client_stats(void);

pthread_handler_t handle_one_connection(void *arg);
void do_handle_one_connection(CONNECT *connect, bool put_in_cache);
bool init_new_connection_handler_thread();
void reset_mqh(LEX_USER *lu, bool get_them);
bool check_mqh(THD *thd, uint check_command);
void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
void decrease_user_connections(USER_CONN *uc);
#else
#define decrease_user_connections(X) do { } while(0)       /* nothing */
#endif
bool thd_init_client_charset(THD *thd, uint cs_number);
void setup_connection_thread_globals(THD *thd);
bool thd_prepare_connection(THD *thd);
bool thd_is_connection_alive(THD *thd);
int thd_set_peer_addr(THD *thd, sockaddr_storage *addr,
                      const char *ip, uint port,
                      bool check_proxy_networks,
                      uint *host_errors);

bool login_connection(THD *thd);
void prepare_new_connection_state(THD* thd);
void end_connection(THD *thd);
void update_global_user_stats(THD* thd, bool create_user, time_t now);
int get_or_create_user_conn(THD *thd, const char *user,
                            const char *host, const USER_RESOURCES *mqh);
int check_for_max_user_connections(THD *thd, USER_CONN *uc);

extern HASH global_user_stats;
extern HASH global_client_stats;
extern HASH global_table_stats;
extern HASH global_index_stats;

extern mysql_mutex_t LOCK_global_user_client_stats;
extern mysql_mutex_t LOCK_global_table_stats;
extern mysql_mutex_t LOCK_global_index_stats;
extern mysql_mutex_t LOCK_stats;

#endif /* SQL_CONNECT_INCLUDED */
server/private/semisync_master_ack_receiver.h000064400000021005150400263740015603 0ustar00/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.

   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-1301  USA */

#ifndef SEMISYNC_MASTER_ACK_RECEIVER_DEFINED
#define SEMISYNC_MASTER_ACK_RECEIVER_DEFINED

#include "my_global.h"
#include "my_pthread.h"
#include "sql_class.h"
#include "semisync.h"
#include "socketpair.h"
#include <vector>

struct Slave :public ilink
{
  THD *thd;
  Vio vio;
#ifdef HAVE_POLL
  uint m_fds_index;
#endif
  bool active;
  my_socket sock_fd() const { return vio.mysql_socket.fd; }
  uint server_id() const { return thd->variables.server_id; }
};

typedef I_List<Slave> Slave_ilist;
typedef I_List_iterator<Slave> Slave_ilist_iterator;

/**
  Ack_receiver is responsible to control ack receive thread and maintain
  slave information used by ack receive thread.

  There are mainly four operations on ack receive thread:
  start: start ack receive thread
  stop: stop ack receive thread
  add_slave: maintain a new semisync slave's information
  remove_slave: remove a semisync slave's information
 */

class Ack_receiver : public Repl_semi_sync_base
{
public:
  Ack_receiver();
  ~Ack_receiver() = default;
  void cleanup();
  /**
     Notify ack receiver to receive acks on the dump session.

     It adds the given dump thread into the slave list and wakes
     up ack thread if it is waiting for any slave coming.

     @param[in] thd  THD of a dump thread.

     @return it return false if succeeds, otherwise true is returned.
  */
  bool add_slave(THD *thd);

  /**
    Notify ack receiver not to receive ack on the dump session.

    it removes the given dump thread from slave list.

    @param[in] thd  THD of a dump thread.
  */
  void remove_slave(THD *thd);

  /**
    Start ack receive thread

    @return it return false if succeeds, otherwise true is returned.
  */
  bool start();

  /**
     Stop ack receive thread
  */
  void stop();

  /**
     The core of ack receive thread.

     It monitors all slaves' sockets and receives acks when they come.
  */
  void run();

  void set_trace_level(unsigned long trace_level)
  {
    m_trace_level= trace_level;
  }
  bool running()
  {
    return m_status != ST_DOWN;
  }

private:
  enum status {ST_UP, ST_DOWN, ST_STOPPING};
  enum status m_status;
  /*
    Protect m_status, m_slaves_changed and m_slaves. ack thread and other
    session may access the variables at the same time.
  */
  mysql_mutex_t m_mutex;
  mysql_cond_t m_cond, m_cond_reply;
  /* If slave list is updated(add or remove). */
  bool m_slaves_changed;

  Slave_ilist m_slaves;
  pthread_t m_pid;

/* Declare them private, so no one can copy the object. */
  Ack_receiver(const Ack_receiver &ack_receiver);
  Ack_receiver& operator=(const Ack_receiver &ack_receiver);

  void set_stage_info(const PSI_stage_info &stage);
  void wait_for_slave_connection(THD *thd);
};


extern my_socket global_ack_signal_fd;

class Ack_listener
{
public:
  my_socket local_read_signal;
  const Slave_ilist &m_slaves;
  int error;

  Ack_listener(const Slave_ilist &slaves)
    :local_read_signal(-1), m_slaves(slaves), error(0)
  {
    my_socket pipes[2];
#ifdef _WIN32
    error= create_socketpair(pipes);
#else
    if (!pipe(pipes))
    {
      fcntl(pipes[0], F_SETFL, O_NONBLOCK);
      fcntl(pipes[1], F_SETFL, O_NONBLOCK);
    }
    else
    {
      pipes[0]= pipes[1]= -1;
    }
#endif /* _WIN32 */
    local_read_signal= pipes[0];
    global_ack_signal_fd= pipes[1];
  }

  virtual ~Ack_listener()
  {
#ifdef _WIN32
    my_socket pipes[2];
    pipes[0]= local_read_signal;
    pipes[1]= global_ack_signal_fd;
    close_socketpair(pipes);
#else
    if (global_ack_signal_fd >= 0)
      close(global_ack_signal_fd);
    if (local_read_signal >= 0)
      close(local_read_signal);
#endif /* _WIN32 */
    global_ack_signal_fd= local_read_signal= -1;
  }

  int got_error()  { return error; }

  virtual bool has_signal_data()= 0;

  /* Clear data sent by signal_listener() to abort read */
  void clear_signal()
  {
    if (has_signal_data())
    {
      char buff[100];
      /* Clear the signal message */
#ifndef _WIN32
      (void) !read(local_read_signal, buff, sizeof(buff));
#else
      recv(local_read_signal, buff, sizeof(buff), 0);
#endif /* _WIN32 */
    }
  }
};

static inline void signal_listener()
{
#ifndef _WIN32
  my_write(global_ack_signal_fd, (uchar*) "a", 1, MYF(0));
#else
  send(global_ack_signal_fd, "a", 1, 0);
#endif /* _WIN32 */
}

#ifdef HAVE_POLL
#include <sys/poll.h>

class Poll_socket_listener final : public Ack_listener
{
private:
  std::vector<pollfd> m_fds;

public:
  Poll_socket_listener(const Slave_ilist &slaves)
    :Ack_listener(slaves)
  {}

  virtual ~Poll_socket_listener() = default;

  bool listen_on_sockets()
  {
    return poll(m_fds.data(), m_fds.size(), -1);
  }

  bool is_socket_active(const Slave *slave)
  {
    return m_fds[slave->m_fds_index].revents & POLLIN;
  }

  bool is_socket_hangup(const Slave *slave)
  {
    return m_fds[slave->m_fds_index].revents & POLLHUP;
  }

  void clear_socket_info(const Slave *slave)
  {
    m_fds[slave->m_fds_index].fd= -1;
    m_fds[slave->m_fds_index].events= 0;
  }

  bool has_signal_data() override
  {
    /* The signal fd is always first */
    return (m_fds[0].revents & POLLIN);
  }

  int init_slave_sockets()
  {
    Slave_ilist_iterator it(const_cast<Slave_ilist&>(m_slaves));
    Slave *slave;
    uint fds_index= 0;
    pollfd poll_fd;

    m_fds.clear();
    /* First put in the signal socket */
    poll_fd.fd= local_read_signal;
    poll_fd.events= POLLIN;
    m_fds.push_back(poll_fd);
    fds_index++;

    while ((slave= it++))
    {
      slave->active= 1;
      pollfd poll_fd;
      poll_fd.fd= slave->sock_fd();
      poll_fd.events= POLLIN;
      m_fds.push_back(poll_fd);
      slave->m_fds_index= fds_index++;
    }
    return fds_index;
  }
};

#else //NO POLL

class Select_socket_listener final : public Ack_listener
{
private:
  my_socket m_max_fd;
  fd_set m_init_fds;
  fd_set m_fds;

public:
  Select_socket_listener(const Slave_ilist &slaves)
    :Ack_listener(slaves), m_max_fd(INVALID_SOCKET)
  {}

  virtual ~Select_socket_listener() = default;

  bool listen_on_sockets()
  {
    /* Reinitialize the fds with active fds before calling select */
    m_fds= m_init_fds;
    /* select requires max fd + 1 for the first argument */
    return select((int) m_max_fd+1, &m_fds, NULL, NULL, NULL);
  }

  bool is_socket_active(const Slave *slave)
  {
    return FD_ISSET(slave->sock_fd(), &m_fds);
  }

  bool is_socket_hangup(const Slave *slave)
  {
    return 0;
  }

  bool has_signal_data() override
  {
    return FD_ISSET(local_read_signal, &m_fds);
  }

  void clear_socket_info(const Slave *slave)
  {
    FD_CLR(slave->sock_fd(), &m_init_fds);
  }

  int init_slave_sockets()
  {
    Slave_ilist_iterator it(const_cast<Slave_ilist&>(m_slaves));
    Slave *slave;
    uint fds_index= 0;

    FD_ZERO(&m_init_fds);
    m_max_fd= -1;

    /* First put in the signal socket */
    FD_SET(local_read_signal, &m_init_fds);
    fds_index++;
    set_if_bigger(m_max_fd, local_read_signal);
#ifndef _WIN32
    if (local_read_signal > FD_SETSIZE)
    {
      int socket_id= local_read_signal;
      sql_print_error("Semisync slave socket fd is %u. "
                      "select() cannot handle if the socket fd is "
                      "greater than %u (FD_SETSIZE).", socket_id, FD_SETSIZE);
      return -1;
    }
#endif

    while ((slave= it++))
    {
      my_socket socket_id= slave->sock_fd();
      set_if_bigger(m_max_fd, socket_id);
#ifndef _WIN32
      if (socket_id > FD_SETSIZE)
      {
        sql_print_error("Semisync slave socket fd is %u. "
                        "select() cannot handle if the socket fd is "
                        "greater than %u (FD_SETSIZE).", socket_id, FD_SETSIZE);
        it.remove();
        continue;
      }
#endif //_WIN32
      FD_SET(socket_id, &m_init_fds);
      fds_index++;
      slave->active= 1;
    }
    return fds_index;
  }
  my_socket get_max_fd() { return m_max_fd; }
};

#endif //HAVE_POLL

extern Ack_receiver ack_receiver;
#endif
server/private/my_cpu.h000064400000011367150400263740011202 0ustar00#ifndef MY_CPU_INCLUDED
#define MY_CPU_INCLUDED
/* Copyright (c) 2013, 2020, MariaDB

   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
*/

/* instructions for specific cpu's */

/*
  Macros for adjusting thread priority (hardware multi-threading)
  The defines are the same ones used by the linux kernel
*/

#ifdef _ARCH_PWR8
#ifdef __GLIBC__
#include <sys/platform/ppc.h>
/* Very low priority */
#define HMT_very_low() __ppc_set_ppr_very_low()
/* Low priority */
#define HMT_low() __ppc_set_ppr_low()
/* Medium low priority */
#define HMT_medium_low() __ppc_set_ppr_med_low()
/* Medium priority */
#define HMT_medium() __ppc_set_ppr_med()
/* Medium high priority */
#define HMT_medium_high() __ppc_set_ppr_med_high()
/* High priority */
#define HMT_high() asm volatile("or 3,3,3")
#else /* GLIBC */
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
#define HMT_very_low() __asm__ volatile ("or 31,31,31")
#define HMT_low() __asm__ volatile ("or 1,1,1")
#define HMT_medium_low() __asm__ volatile ("or 6,6,6")
#define HMT_medium() __asm__ volatile ("or 2,2,2")
#define HMT_medium_high() __asm__ volatile ("or 5,5,5")
#define HMT_high() asm volatile("or 3,3,3")
#endif /* GLIBC */
#else
#define HMT_very_low()
#define HMT_low()
#define HMT_medium_low()
#define HMT_medium()
#define HMT_medium_high()
#define HMT_high()
#endif

#if defined __i386__ || defined __x86_64__ || defined _WIN32
# define HAVE_PAUSE_INSTRUCTION /* added in Intel Pentium 4 */
#endif

#ifdef _WIN32
#elif defined HAVE_PAUSE_INSTRUCTION
#elif defined(_ARCH_PWR8)
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#else
# include "my_global.h"
# include "my_atomic.h"
#endif

static inline void MY_RELAX_CPU(void)
{
#ifdef _WIN32
  /*
    In the Win32 API, the x86 PAUSE instruction is executed by calling
    the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
    independent way by using YieldProcessor.
  */
  YieldProcessor();
#elif defined HAVE_PAUSE_INSTRUCTION
  /*
    According to the gcc info page, asm volatile means that the
    instruction has important side-effects and must not be removed.
    Also asm volatile may trigger a memory barrier (spilling all registers
    to memory).
  */
#ifdef __SUNPRO_CC
  asm ("pause" );
#else
  __asm__ __volatile__ ("pause");
#endif
#elif defined(_ARCH_PWR8)
  /* Changed from __ppc_get_timebase for musl and clang compatibility */
  __builtin_ppc_get_timebase();
#elif defined __GNUC__ && defined __riscv
  /* The GCC-only __builtin_riscv_pause() or the pause instruction is
  encoded like a fence instruction with special parameters. On RISC-V
  implementations that do not support arch=+zihintpause this
  instruction could be interpreted as a more expensive memory fence;
  it should not be an illegal instruction. */
  __asm__ volatile(".long 0x0100000f" ::: "memory");
#elif defined __GNUC__
  /* Mainly, prevent the compiler from optimizing away delay loops */
  __asm__ __volatile__ ("":::"memory");
#endif
}


#ifdef HAVE_PAUSE_INSTRUCTION
# ifdef __cplusplus
extern "C" {
# endif
extern unsigned my_cpu_relax_multiplier;
void my_cpu_init(void);
# ifdef __cplusplus
}
# endif
#else
# define my_cpu_relax_multiplier 200
# define my_cpu_init() /* nothing */
#endif

/*
  LF_BACKOFF should be used to improve performance on hyperthreaded CPUs. Intel
  recommends to use it in spin loops also on non-HT machines to reduce power
  consumption (see e.g http://softwarecommunity.intel.com/articles/eng/2004.htm)

  Running benchmarks for spinlocks implemented with InterlockedCompareExchange
  and YieldProcessor shows that much better performance is achieved by calling
  YieldProcessor in a loop - that is, yielding longer. On Intel boxes setting
  loop count in the range 200-300 brought best results.
*/

static inline int LF_BACKOFF(void)
{
  unsigned i= my_cpu_relax_multiplier;
  while (i--)
    MY_RELAX_CPU();
  return 1;
}

/**
  Run a delay loop while waiting for a shared resource to be released.
  @param delay originally, roughly microseconds on 100 MHz Intel Pentium
*/
static inline void ut_delay(unsigned delay)
{
  unsigned i= my_cpu_relax_multiplier / 4 * delay;
  HMT_low();
  while (i--)
    MY_RELAX_CPU();
  HMT_medium();
}

#endif
server/private/my_stacktrace.h000064400000006217150400263740012535 0ustar00/*
   Copyright (c) 2001, 2011, Oracle and/or its affiliates.
   Copyright (c) 2020, 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 */

#ifndef _my_stacktrace_h_
#define _my_stacktrace_h_

#ifdef TARGET_OS_LINUX
#if defined (__x86_64__) || defined (__i386__) || \
    (defined(__alpha__) && defined(__GNUC__))
#define HAVE_STACKTRACE 1
#endif
#elif defined(_WIN32) || defined(HAVE_PRINTSTACK)
#define HAVE_STACKTRACE 1
#endif

#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD)
#undef HAVE_STACKTRACE
#define HAVE_STACKTRACE 1
#endif

#define HAVE_WRITE_CORE

#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && HAVE_ABI_CXA_DEMANGLE && \
    HAVE_WEAK_SYMBOL
#define BACKTRACE_DEMANGLE 1
#endif

C_MODE_START

#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack,
                         my_bool silent);
int my_safe_print_str(const char* val, size_t max_len);
void my_write_core(int sig);
# if BACKTRACE_DEMANGLE
char *my_demangle(const char *mangled_name, int *status);
# endif /* BACKTRACE_DEMANGLE */
# ifdef _WIN32
#  define my_setup_stacktrace()
void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
# else
void my_setup_stacktrace(void);
# endif /* _WIN32 */
#else
# define my_setup_stacktrace()
#endif /* ! (defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)) */

#ifndef _WIN32
#define MY_ADDR_RESOLVE_FORK
#endif

#if defined(HAVE_BFD_H) || defined(MY_ADDR_RESOLVE_FORK)
#define HAVE_MY_ADDR_RESOLVE 1
#endif

typedef struct {
  const char *file;
  const char *func;
  uint line;
} my_addr_loc;

#ifdef HAVE_MY_ADDR_RESOLVE
int my_addr_resolve(void *ptr, my_addr_loc *loc);
const char *my_addr_resolve_init();
#else
#define my_addr_resolve_init()  (0)
#define my_addr_resolve(A,B)    (1)
#endif

#ifdef HAVE_WRITE_CORE
void my_write_core(int sig);
#endif

/**
  A (very) limited version of snprintf, which writes the result to STDERR.
  @sa my_safe_snprintf
  Implemented with simplicity, and async-signal-safety in mind.
  @note Has an internal buffer capacity of 512 bytes,
  which should suffice for our signal handling routines.
*/
size_t my_safe_printf_stderr(const char* fmt, ...)
  ATTRIBUTE_FORMAT(printf, 1, 2);

/**
  Writes up to count bytes from buffer to STDERR.
  Implemented with simplicity, and async-signal-safety in mind.
  @param   buf   Buffer containing data to be written.
  @param   count Number of bytes to write.
  @returns Number of bytes written.
*/
size_t my_write_stderr(const void *buf, size_t count);

C_MODE_END

#endif /* _my_stacktrace_h_ */
server/private/item_xmlfunc.h000064400000010777150400263740012404 0ustar00#ifndef ITEM_XMLFUNC_INCLUDED
#define ITEM_XMLFUNC_INCLUDED

/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2009, 2019, MariaDB

   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 */


/* This file defines all XML functions */


typedef struct my_xml_node_st MY_XML_NODE;


/* Structure to store nodeset elements */
class MY_XPATH_FLT
{
public:
  uint num;     // Absolute position in MY_XML_NODE array
  uint pos;     // Relative position in context
  uint size;    // Context size
public:
  MY_XPATH_FLT(uint32 num_arg, uint32 pos_arg)
   :num(num_arg), pos(pos_arg), size(0)
  { }
  MY_XPATH_FLT(uint32 num_arg, uint32 pos_arg, uint32 size_arg)
   :num(num_arg), pos(pos_arg), size(size_arg)
  { }
  bool append_to(Native *to) const
  {
    return to->append((const char*) this, (uint32) sizeof(*this));
  }
};


class NativeNodesetBuffer: public NativeBuffer<16*sizeof(MY_XPATH_FLT)>
{
public:
  const MY_XPATH_FLT &element(uint i) const
  {
    const MY_XPATH_FLT *p= (MY_XPATH_FLT*) (ptr() + i * sizeof(MY_XPATH_FLT));
    return *p;
  }
  uint32 elements() const
  {
    return length() / sizeof(MY_XPATH_FLT);
  }
};


class Item_xml_str_func: public Item_str_func
{
protected:
  /*
    A helper class to store raw and parsed XML.
  */
  class XML
  {
    bool m_cached;
    String *m_raw_ptr;   // Pointer to text representation
    String m_raw_buf;    // Cached text representation
    String m_parsed_buf; // Array of MY_XML_NODEs, pointing to raw_buffer
    bool parse();
    void reset()
    {
      m_cached= false;
      m_raw_ptr= (String *) 0;
    }
  public:
    XML() { reset(); }
    void set_charset(CHARSET_INFO *cs) { m_parsed_buf.set_charset(cs); }
    String *raw() { return m_raw_ptr; }
    String *parsed() { return &m_parsed_buf; }
    const MY_XML_NODE *node(uint idx);
    bool cached() { return m_cached; }
    bool parse(String *raw, bool cache);
    bool parse(Item *item, bool cache)
    {
      String *res;
      if (!(res= item->val_str(&m_raw_buf)))
      {
        m_raw_ptr= (String *) 0;
        m_cached= cache;
        return true;
      }
      return parse(res, cache);
    }
  };
  String m_xpath_query; // XPath query text
  Item *nodeset_func;
  XML xml;
  bool get_xml(XML *xml_arg, bool cache= false)
  {
    if (!cache && xml_arg->cached())
      return xml_arg->raw() == 0;
    return xml_arg->parse(args[0], cache);
  }
public:
  Item_xml_str_func(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b)
  {
    set_maybe_null();
  }
  Item_xml_str_func(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c)
  {
    set_maybe_null();
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  bool const_item() const override
  {
    return const_item_cache && (!nodeset_func || nodeset_func->const_item());
  }
};


class Item_func_xml_extractvalue: public Item_xml_str_func
{
public:
  Item_func_xml_extractvalue(THD *thd, Item *a, Item *b):
    Item_xml_str_func(thd, a, b) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("extractvalue") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_xml_extractvalue>(thd, this); }
};


class Item_func_xml_update: public Item_xml_str_func
{
  NativeNodesetBuffer tmp_native_value2;
  String tmp_value3;
  bool collect_result(String *str,
                      const MY_XML_NODE *cut,
                      const String *replace);
public:
  Item_func_xml_update(THD *thd, Item *a, Item *b, Item *c):
    Item_xml_str_func(thd, a, b, c) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("updatexml") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_xml_update>(thd, this); }
};

#endif /* ITEM_XMLFUNC_INCLUDED */
server/private/sql_error.h000064400000115244150400263740011715 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 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 Street, Fifth Floor, Boston, MA 02110-1335  USA */

#ifndef SQL_ERROR_H
#define SQL_ERROR_H

#include "sql_list.h" 	/* Sql_alloc, MEM_ROOT, list */
#include "sql_type_int.h" // Longlong_hybrid
#include "sql_string.h"                        /* String */
#include "sql_plist.h" /* I_P_List */
#include "mysql_com.h" /* MYSQL_ERRMSG_SIZE */
#include "my_time.h"   /* MYSQL_TIME */
#include "decimal.h"

class THD;
class my_decimal;
class sp_condition_value;

/* Types of LOG warnings, used by note_verbosity */

#define NOTE_VERBOSITY_NORMAL             (1U << 0)
/* Show warnings about keys parts that cannot be used */
#define NOTE_VERBOSITY_UNUSABLE_KEYS      (1U << 1)
/* Show warnings in explain for key parts that cannot be used */
#define NOTE_VERBOSITY_EXPLAIN            (1U << 2)

///////////////////////////////////////////////////////////////////////////

class Sql_state
{
protected:
  /**
    This member is always NUL terminated.
  */
  char m_sqlstate[SQLSTATE_LENGTH + 1];
public:
  Sql_state()
  {
    memset(m_sqlstate, 0, sizeof(m_sqlstate));
  }

  Sql_state(const char *sqlstate)
  {
    set_sqlstate(sqlstate);
  }

  const char* get_sqlstate() const
  { return m_sqlstate; }

  void set_sqlstate(const Sql_state *other)
  {
    *this= *other;
  }
  void set_sqlstate(const char *sqlstate)
  {
    memcpy(m_sqlstate, sqlstate, SQLSTATE_LENGTH);
    m_sqlstate[SQLSTATE_LENGTH]= '\0';
  }
  bool eq(const Sql_state *other) const
  {
    return strcmp(m_sqlstate, other->m_sqlstate) == 0;
  }

  bool has_sql_state() const { return m_sqlstate[0] != '\0'; }

  /**
    Checks if this SQL state defines a WARNING condition.
    Note: m_sqlstate must contain a valid SQL-state.

    @retval true if this SQL state defines a WARNING condition.
    @retval false otherwise.
  */
  inline bool is_warning() const
  { return m_sqlstate[0] == '0' && m_sqlstate[1] == '1'; }


  /**
    Checks if this SQL state defines a NOT FOUND condition.
    Note: m_sqlstate must contain a valid SQL-state.

    @retval true if this SQL state defines a NOT FOUND condition.
    @retval false otherwise.
  */
  inline bool is_not_found() const
  { return m_sqlstate[0] == '0' && m_sqlstate[1] == '2'; }


  /**
    Checks if this SQL state defines an EXCEPTION condition.
    Note: m_sqlstate must contain a valid SQL-state.

    @retval true if this SQL state defines an EXCEPTION condition.
    @retval false otherwise.
  */
  inline bool is_exception() const
  { return m_sqlstate[0] != '0' || m_sqlstate[1] > '2'; }

};


class Sql_state_errno: public Sql_state
{
protected:
  /**
    MySQL extension, MYSQL_ERRNO condition item.
    SQL error number. One of ER_ codes from share/errmsg.txt.
    Set by set_error_status.
  */
  uint m_sql_errno;

public:
  Sql_state_errno()
   :m_sql_errno(0)
  { }
  Sql_state_errno(uint sql_errno)
   :m_sql_errno(sql_errno)
  { }
  Sql_state_errno(uint sql_errno, const char *sql_state)
   :Sql_state(sql_state),
    m_sql_errno(sql_errno)
  { }
  /**
    Get the SQL_ERRNO of this condition.
    @return the sql error number condition item.
  */
  uint get_sql_errno() const
  { return m_sql_errno; }

  void set(uint sql_errno, const char *sqlstate)
  {
    m_sql_errno= sql_errno;
    set_sqlstate(sqlstate);
  }
  void clear()
  {
    m_sql_errno= 0;
  }
};


class Sql_state_errno_level: public Sql_state_errno
{
public:
  /*
    Enumeration value describing the severity of the error.

    Note that these enumeration values must correspond to the indices
    of the sql_print_message_handlers array.
  */
  enum enum_warning_level
  { WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END};

protected:
  /** Severity (error, warning, note) of this condition. */
  enum_warning_level m_level;

  void assign_defaults(const Sql_state_errno *value);

public:
  /**
    Get the error level of this condition.
    @return the error level condition item.
  */
  enum_warning_level get_level() const
  { return m_level; }

   Sql_state_errno_level()
    :m_level(WARN_LEVEL_ERROR)
  { }

  Sql_state_errno_level(uint sqlerrno, const char* sqlstate,
                         enum_warning_level level)
   :Sql_state_errno(sqlerrno, sqlstate),
    m_level(level)
  { }
  Sql_state_errno_level(const Sql_state_errno &state_errno,
                         enum_warning_level level)
   :Sql_state_errno(state_errno),
    m_level(level)
  { }
  void clear()
  {
    m_level= WARN_LEVEL_ERROR;
    Sql_state_errno::clear();
  }
};


/*
  class Sql_user_condition_identity.
  Instances of this class uniquely idetify user defined conditions (EXCEPTION).

    SET sql_mode=ORACLE;
    CREATE PROCEDURE p1
    AS
      a EXCEPTION;
    BEGIN
      RAISE a;
    EXCEPTION
      WHEN a THEN NULL;
    END;

  Currently a user defined condition is identified by a pointer to
  its parse time sp_condition_value instance. This can change when
  we add packages. See MDEV-10591.
*/
class Sql_user_condition_identity
{
protected:
  const sp_condition_value *m_user_condition_value;
public:
  Sql_user_condition_identity()
   :m_user_condition_value(NULL)
  { }
  Sql_user_condition_identity(const sp_condition_value *value)
   :m_user_condition_value(value)
  { }
  const sp_condition_value *get_user_condition_value() const
  { return m_user_condition_value; }

  void set(const Sql_user_condition_identity &identity)
  {
    *this= identity;
  }
  void clear()
  {
    m_user_condition_value= NULL;
  }
};


/**
  class Sql_condition_identity.
  Instances of this class uniquely identify conditions
  (including user-defined exceptions for sql_mode=ORACLE)
  and store everything that is needed for handler search
  purposes in sp_pcontext::find_handler().
*/
class Sql_condition_identity: public Sql_state_errno_level,
                              public Sql_user_condition_identity
{
public:
  Sql_condition_identity() = default;
  Sql_condition_identity(const Sql_state_errno_level &st,
                         const Sql_user_condition_identity &ucid)
   :Sql_state_errno_level(st),
    Sql_user_condition_identity(ucid)
  { }
  Sql_condition_identity(const Sql_state_errno &st,
                         enum_warning_level level,
                         const Sql_user_condition_identity &ucid)
   :Sql_state_errno_level(st, level),
    Sql_user_condition_identity(ucid)
  { }
  Sql_condition_identity(uint sqlerrno,
                         const char* sqlstate,
                         enum_warning_level level,
                         const Sql_user_condition_identity &ucid)
    :Sql_state_errno_level(sqlerrno, sqlstate, level),
     Sql_user_condition_identity(ucid)
  { }
  void clear()
  {
    Sql_state_errno_level::clear();
    Sql_user_condition_identity::clear();
  }
};


class Sql_condition_items
{
protected:
  /** SQL CLASS_ORIGIN condition item. */
  String m_class_origin;

  /** SQL SUBCLASS_ORIGIN condition item. */
  String m_subclass_origin;

  /** SQL CONSTRAINT_CATALOG condition item. */
  String m_constraint_catalog;

  /** SQL CONSTRAINT_SCHEMA condition item. */
  String m_constraint_schema;

  /** SQL CONSTRAINT_NAME condition item. */
  String m_constraint_name;

  /** SQL CATALOG_NAME condition item. */
  String m_catalog_name;

  /** SQL SCHEMA_NAME condition item. */
  String m_schema_name;

  /** SQL TABLE_NAME condition item. */
  String m_table_name;

  /** SQL COLUMN_NAME condition item. */
  String m_column_name;

  /** SQL CURSOR_NAME condition item. */
  String m_cursor_name;

  Sql_condition_items()
   :m_class_origin((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_subclass_origin((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_constraint_catalog((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_constraint_schema((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_constraint_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_catalog_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_schema_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_table_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_column_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
    m_cursor_name((const char*) NULL, 0, & my_charset_utf8mb3_bin)
  { }

  void clear()
  {
    m_class_origin.length(0);
    m_subclass_origin.length(0);
    m_constraint_catalog.length(0);
    m_constraint_schema.length(0);
    m_constraint_name.length(0);
    m_catalog_name.length(0);
    m_schema_name.length(0);
    m_table_name.length(0);
    m_column_name.length(0);
    m_cursor_name.length(0);
  }
};


/**
  Representation of a SQL condition.
  A SQL condition can be a completion condition (note, warning),
  or an exception condition (error, not found).
*/
class Sql_condition : public Sql_alloc,
                      public Sql_condition_identity,
                      public Sql_condition_items
{
public:

  /**
    Convert a bitmask consisting of MYSQL_TIME_{NOTE|WARN}_XXX bits
    to WARN_LEVEL_XXX
  */
  static enum_warning_level time_warn_level(uint warnings)
  {
    return MYSQL_TIME_WARN_HAVE_WARNINGS(warnings) ?
           WARN_LEVEL_WARN : WARN_LEVEL_NOTE;
  }

  /**
    Get the MESSAGE_TEXT of this condition.
    @return the message text.
  */
  const char* get_message_text() const;

  /**
    Get the MESSAGE_OCTET_LENGTH of this condition.
    @return the length in bytes of the message text.
  */
  int get_message_octet_length() const;

private:
  /*
    The interface of Sql_condition is mostly private, by design,
    so that only the following code:
    - various raise_error() or raise_warning() methods in class THD,
    - the implementation of SIGNAL / RESIGNAL / GET DIAGNOSTICS
    - catch / re-throw of SQL conditions in stored procedures (sp_rcontext)
    is allowed to create / modify a SQL condition.
    Enforcing this policy prevents confusion, since the only public
    interface available to the rest of the server implementation
    is the interface offered by the THD methods (THD::raise_error()),
    which should be used.
  */
  friend class THD;
  friend class Warning_info;
  friend class Sql_cmd_common_signal;
  friend class Sql_cmd_signal;
  friend class Sql_cmd_resignal;
  friend class sp_rcontext;
  friend class Condition_information_item;

  /**
    Default constructor.
    This constructor is usefull when allocating arrays.
    Note that the init() method should be called to complete the Sql_condition.
  */
  Sql_condition()
   :m_mem_root(NULL)
  { }

  /**
    Complete the Sql_condition initialisation.
    @param mem_root The memory root to use for the condition items
    of this condition
  */
  void init(MEM_ROOT *mem_root)
  {
    DBUG_ASSERT(mem_root != NULL);
    DBUG_ASSERT(m_mem_root == NULL);
    m_mem_root= mem_root;
  }

  /**
    Constructor.
    @param mem_root The memory root to use for the condition items
    of this condition
  */
  Sql_condition(MEM_ROOT *mem_root)
   :m_mem_root(mem_root)
  {
    DBUG_ASSERT(mem_root != NULL);
  }

  Sql_condition(MEM_ROOT *mem_root, const Sql_user_condition_identity &ucid)
   :Sql_condition_identity(Sql_state_errno_level(), ucid),
    m_mem_root(mem_root)
  {
    DBUG_ASSERT(mem_root != NULL);
  }
  /**
    Constructor for a fixed message text.
    @param mem_root - memory root
    @param value    - the error number and the sql state for this condition
    @param level    - the error level for this condition
    @param msg      - the message text for this condition
  */
  Sql_condition(MEM_ROOT *mem_root,
                const Sql_condition_identity &value,
                const char *msg)
   :Sql_condition_identity(value),
    m_mem_root(mem_root)
  {
    DBUG_ASSERT(mem_root != NULL);
    DBUG_ASSERT(value.get_sql_errno() != 0);
    DBUG_ASSERT(msg != NULL);
    set_builtin_message_text(msg);
  }

  /** Destructor. */
  ~Sql_condition() = default;

  /**
    Copy optional condition items attributes.
    @param cond the condition to copy.
  */
  void copy_opt_attributes(const Sql_condition *cond);

  /**
    Set the condition message test.
    @param str Message text, expressed in the character set derived from
    the server --language option
  */
  void set_builtin_message_text(const char* str);

  /** Set the CLASS_ORIGIN of this condition. */
  void set_class_origin();

  /** Set the SUBCLASS_ORIGIN of this condition. */
  void set_subclass_origin();

  /**
    Assign the condition items 'MYSQL_ERRNO', 'level' and 'MESSAGE_TEXT'
    default values of a condition.
    @param thd   - current thread, to access to localized error messages
    @param from  - copy condition items from here (can be NULL)
  */
  void assign_defaults(THD *thd, const Sql_state_errno *from);

  /**
    Clear this SQL condition.
  */
  void clear()
  {
    Sql_condition_identity::clear();
    Sql_condition_items::clear();
    m_message_text.length(0);
  }

private:
  /** Message text, expressed in the character set implied by --language. */
  String m_message_text;

  /** Pointers for participating in the list of conditions. */
  Sql_condition *next_in_wi;
  Sql_condition **prev_in_wi;

  /** Memory root to use to hold condition item values. */
  MEM_ROOT *m_mem_root;
};

///////////////////////////////////////////////////////////////////////////

/**
  Information about warnings of the current connection.
*/
class Warning_info
{
  /** The type of the counted and doubly linked list of conditions. */
  typedef I_P_List<Sql_condition,
                   I_P_List_adapter<Sql_condition,
                                    &Sql_condition::next_in_wi,
                                    &Sql_condition::prev_in_wi>,
                   I_P_List_counter,
                   I_P_List_fast_push_back<Sql_condition> >
          Sql_condition_list;

  /** A memory root to allocate warnings and errors */
  MEM_ROOT           m_warn_root;

  /** List of warnings of all severities (levels). */
  Sql_condition_list   m_warn_list;

  /** A break down of the number of warnings per severity (level). */
  uint	             m_warn_count[(uint) Sql_condition::WARN_LEVEL_END];

  /**
    The number of warnings of the current statement. Warning_info
    life cycle differs from statement life cycle -- it may span
    multiple statements. In that case we get
    m_current_statement_warn_count 0, whereas m_warn_list is not empty.
  */
  uint	             m_current_statement_warn_count;

  /*
    Row counter, to print in errors and warnings. Not increased in
    create_sort_index(); may differ from examined_row_count.
  */
  ulong              m_current_row_for_warning;

  /** Used to optionally clear warnings only once per statement. */
  ulonglong          m_warn_id;

  /**
    A pointer to an element of m_warn_list. It determines SQL-condition
    instance which corresponds to the error state in Diagnostics_area.
  
    This is needed for properly processing SQL-conditions in SQL-handlers.
    When an SQL-handler is found for the current error state in Diagnostics_area,
    this pointer is needed to remove the corresponding SQL-condition from the
    Warning_info list.
  
    @note m_error_condition might be NULL in the following cases:
       - Diagnostics_area set to fatal error state (like OOM);
       - Max number of Warning_info elements has been reached (thus, there is
         no corresponding SQL-condition object in Warning_info).
  */
  const Sql_condition *m_error_condition;

  /** Indicates if push_warning() allows unlimited number of warnings. */
  bool               m_allow_unlimited_warnings;
  bool		     initialized;    /* Set to 1 if init() has been called */

  /** Read only status. */
  bool m_read_only;

  /** Pointers for participating in the stack of Warning_info objects. */
  Warning_info *m_next_in_da;
  Warning_info **m_prev_in_da;

  List<Sql_condition> m_marked_sql_conditions;

public:
  Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings,
               bool initialized);
  ~Warning_info();
  /* Allocate memory for structures */
  void init();
  void free_memory();

private:
  Warning_info(const Warning_info &rhs); /* Not implemented */
  Warning_info& operator=(const Warning_info &rhs); /* Not implemented */

  /**
    Checks if Warning_info contains SQL-condition with the given message.

    @param message_str    Message string.
    @param message_length Length of message string.

    @return true if the Warning_info contains an SQL-condition with the given
    message.
  */
  bool has_sql_condition(const char *message_str, size_t message_length) const;

  /**
    Checks if Warning_info contains SQL-condition with the given error id

    @param sql_errno SQL-condition error number

    @return true if the Warning_info contains an SQL-condition with the given
    error id.
  */
  bool has_sql_condition(uint sql_errno) const;

  /**
    Reset the warning information. Clear all warnings,
    the number of warnings, reset current row counter
    to point to the first row.

    @param new_id new Warning_info id.
  */
  void clear(ulonglong new_id);

  /**
    Only clear warning info if haven't yet done that already
    for the current query. Allows to be issued at any time
    during the query, without risk of clearing some warnings
    that have been generated by the current statement.

    @todo: This is a sign of sloppy coding. Instead we need to
    designate one place in a statement life cycle where we call
    Warning_info::clear().

    @param query_id Current query id.
  */
  void opt_clear(ulonglong query_id)
  {
    if (query_id != m_warn_id)
      clear(query_id);
  }

  /**
    Concatenate the list of warnings.

    It's considered tolerable to lose an SQL-condition in case of OOM-error,
    or if the number of SQL-conditions in the Warning_info reached top limit.

    @param thd    Thread context.
    @param source Warning_info object to copy SQL-conditions from.
  */
  void append_warning_info(THD *thd, const Warning_info *source);

  /**
    Reset between two COM_ commands. Warnings are preserved
    between commands, but statement_warn_count indicates
    the number of warnings of this particular statement only.
  */
  void reset_for_next_command()
  { m_current_statement_warn_count= 0; }

  /**
    Mark active SQL-conditions for later removal.
    This is done to simulate stacked DAs for HANDLER statements.
  */
  void mark_sql_conditions_for_removal();

  /**
    Unmark SQL-conditions, which were marked for later removal.
    This is done to simulate stacked DAs for HANDLER statements.
  */
  void unmark_sql_conditions_from_removal()
  { m_marked_sql_conditions.empty(); }

  /**
    Remove SQL-conditions that are marked for deletion.
    This is done to simulate stacked DAs for HANDLER statements.
  */
  void remove_marked_sql_conditions();

  /**
    Check if the given SQL-condition is marked for removal in this Warning_info
    instance.

    @param cond the SQL-condition.

    @retval true if the given SQL-condition is marked for removal in this
                 Warning_info instance.
    @retval false otherwise.
  */
  bool is_marked_for_removal(const Sql_condition *cond) const;

  /**
    Mark a single SQL-condition for removal (add the given SQL-condition to the
    removal list of this Warning_info instance).
  */
  void mark_condition_for_removal(Sql_condition *cond)
  { m_marked_sql_conditions.push_back(cond, &m_warn_root); }

  /**
    Used for @@warning_count system variable, which prints
    the number of rows returned by SHOW WARNINGS.
  */
  ulong warn_count() const
  {
    /*
      This may be higher than warn_list.elements() if we have
      had more warnings than thd->variables.max_error_count.
    */
    return (m_warn_count[(uint) Sql_condition::WARN_LEVEL_NOTE] +
            m_warn_count[(uint) Sql_condition::WARN_LEVEL_ERROR] +
            m_warn_count[(uint) Sql_condition::WARN_LEVEL_WARN]);
  }

  /**
    The number of errors, or number of rows returned by SHOW ERRORS,
    also the value of session variable @@error_count.
  */
  ulong error_count() const
  { return m_warn_count[(uint) Sql_condition::WARN_LEVEL_ERROR]; }

  /**
    The number of conditions (errors, warnings and notes) in the list.
  */
  uint cond_count() const
  {
    return m_warn_list.elements();
  }

  /** Id of the warning information area. */
  ulonglong id() const { return m_warn_id; }

  /** Set id of the warning information area. */
  void id(ulonglong id_arg) { m_warn_id= id_arg; }

  /** Do we have any errors and warnings that we can *show*? */
  bool is_empty() const { return m_warn_list.is_empty(); }

  /** Increment the current row counter to point at the next row. */
  void inc_current_row_for_warning() { m_current_row_for_warning++; }

  /** Reset the current row counter. Start counting from the first row. */
  void reset_current_row_for_warning() { m_current_row_for_warning= 1; }

  ulong set_current_row_for_warning(ulong row)
  {
    ulong old_row= m_current_row_for_warning;
    m_current_row_for_warning= row;
    return old_row;
  }

  /** Return the current counter value. */
  ulong current_row_for_warning() const { return m_current_row_for_warning; }

  /** Return the number of warnings thrown by the current statement. */
  ulong current_statement_warn_count() const
  { return m_current_statement_warn_count; }

  /** Make sure there is room for the given number of conditions. */
  void reserve_space(THD *thd, uint count);

  /**
    Add a new SQL-condition to the current list and increment the respective
    counters.

    @param thd        Thread context.
    @param identity   SQL-condition identity
    @param msg        SQL-condition message.

    @return a pointer to the added SQL-condition.
  */
  Sql_condition *push_warning(THD *thd,
                              const Sql_condition_identity *identity,
                              const char* msg);

  /**
    Add a new SQL-condition to the current list and increment the respective
    counters.

    @param thd            Thread context.
    @param sql_condition  SQL-condition to copy values from.

    @return a pointer to the added SQL-condition.
  */
  Sql_condition *push_warning(THD *thd, const Sql_condition *sql_condition);

  /**
    Set the read only status for this statement area.
    This is a privileged operation, reserved for the implementation of
    diagnostics related statements, to enforce that the statement area is
    left untouched during execution.
    The diagnostics statements are:
    - SHOW WARNINGS
    - SHOW ERRORS
    - GET DIAGNOSTICS
    @param read_only the read only property to set.
  */
  void set_read_only(bool read_only_arg)
  { m_read_only= read_only_arg; }

  /**
    Read only status.
    @return the read only property.
  */
  bool is_read_only() const
  { return m_read_only; }

  /**
    @return SQL-condition, which corresponds to the error state in
    Diagnostics_area.

    @see m_error_condition.
  */
  const Sql_condition *get_error_condition() const
  { return m_error_condition; }

  /**
    Set SQL-condition, which corresponds to the error state in Diagnostics_area.

    @see m_error_condition.
  */
  void set_error_condition(const Sql_condition *error_condition)
  { m_error_condition= error_condition; }

  /**
    Reset SQL-condition, which corresponds to the error state in
    Diagnostics_area.

    @see m_error_condition.
  */
  void clear_error_condition()
  { m_error_condition= NULL; }

  // for:
  //   - m_next_in_da / m_prev_in_da
  //   - is_marked_for_removal()
  friend class Diagnostics_area;
};


extern size_t err_conv(char *buff, uint to_length, const char *from,
                       uint from_length, CHARSET_INFO *from_cs);

class ErrBuff
{
protected:
  mutable char err_buffer[MYSQL_ERRMSG_SIZE];
public:
  ErrBuff()
  {
    err_buffer[0]= '\0';
  }
  const char *ptr() const { return err_buffer; }
  LEX_CSTRING set_longlong(const Longlong_hybrid &nr) const
  {
    int radix= nr.is_unsigned() ? 10 : -10;
    const char *end= longlong10_to_str(nr.value(), err_buffer, radix);
    DBUG_ASSERT(end >= err_buffer);
    return {err_buffer, (size_t) (end - err_buffer)};
  }
  LEX_CSTRING set_double(double nr) const
  {
    size_t length= my_gcvt(nr, MY_GCVT_ARG_DOUBLE,
                           sizeof(err_buffer), err_buffer, 0);
    return {err_buffer, length};
  }
  LEX_CSTRING set_decimal(const decimal_t *d) const
  {
    int length= sizeof(err_buffer);
    decimal2string(d, err_buffer, &length, 0, 0, ' ');
    DBUG_ASSERT(length >= 0);
    return {err_buffer, (size_t) length};
  }
  LEX_CSTRING set_str(const char *str, size_t len, CHARSET_INFO *cs) const
  {
    DBUG_ASSERT(len < UINT_MAX32);
    len= err_conv(err_buffer, (uint) sizeof(err_buffer), str, (uint) len, cs);
    return {err_buffer, len};
  }
  LEX_CSTRING set_mysql_time(const MYSQL_TIME *ltime) const
  {
    int length= my_TIME_to_str(ltime, err_buffer, AUTO_SEC_PART_DIGITS);
    DBUG_ASSERT(length >= 0);
    return {err_buffer, (size_t) length};
  }
};


class ErrConv: public ErrBuff
{
public:
  ErrConv() = default;
  virtual ~ErrConv() = default;
  virtual LEX_CSTRING lex_cstring() const= 0;
  inline const char *ptr() const
  {
    return lex_cstring().str;
  }
};

class ErrConvString : public ErrConv
{
  const char *str;
  size_t len;
  CHARSET_INFO *cs;
public:
  ErrConvString(const char *str_arg, size_t len_arg, CHARSET_INFO *cs_arg)
    : ErrConv(), str(str_arg), len(len_arg), cs(cs_arg) {}
  ErrConvString(const char *str_arg, CHARSET_INFO *cs_arg)
    : ErrConv(), str(str_arg), len(strlen(str_arg)), cs(cs_arg) {}
  ErrConvString(const String *s)
    : ErrConv(), str(s->ptr()), len(s->length()), cs(s->charset()) {}
  LEX_CSTRING lex_cstring() const override
  {
    return set_str(str, len, cs);
  }
};

class ErrConvInteger : public ErrConv, public Longlong_hybrid
{
public:
  ErrConvInteger(const Longlong_hybrid &nr)
   : ErrConv(), Longlong_hybrid(nr) { }
  LEX_CSTRING lex_cstring() const override
  {
    return set_longlong(static_cast<Longlong_hybrid>(*this));
  }
};

class ErrConvDouble: public ErrConv
{
  double num;
public:
  ErrConvDouble(double num_arg) : ErrConv(), num(num_arg) {}
  LEX_CSTRING lex_cstring() const override
  {
    return set_double(num);
  }
};

class ErrConvTime : public ErrConv
{
  const MYSQL_TIME *ltime;
public:
  ErrConvTime(const MYSQL_TIME *ltime_arg) : ErrConv(), ltime(ltime_arg) {}
  LEX_CSTRING lex_cstring() const override
  {
    return set_mysql_time(ltime);
  }
};

class ErrConvDecimal : public ErrConv
{
  const decimal_t *d;
public:
  ErrConvDecimal(const decimal_t *d_arg) : ErrConv(), d(d_arg) {}
  LEX_CSTRING lex_cstring() const override
  {
    return set_decimal(d);
  }
};

///////////////////////////////////////////////////////////////////////////

/**
  Stores status of the currently executed statement.
  Cleared at the beginning of the statement, and then
  can hold either OK, ERROR, or EOF status.
  Can not be assigned twice per statement.
*/

class Diagnostics_area: public Sql_state_errno,
                        public Sql_user_condition_identity
{
private:
  /** The type of the counted and doubly linked list of conditions. */
  typedef I_P_List<Warning_info,
                   I_P_List_adapter<Warning_info,
                                    &Warning_info::m_next_in_da,
                                    &Warning_info::m_prev_in_da>,
                   I_P_List_counter,
                   I_P_List_fast_push_back<Warning_info> >
          Warning_info_list;

public:
  /** Const iterator used to iterate through the warning list. */
  typedef Warning_info::Sql_condition_list::Const_Iterator
    Sql_condition_iterator;

  enum enum_diagnostics_status
  {
    /** The area is cleared at start of a statement. */
    DA_EMPTY= 0,
    /** Set whenever one calls my_ok(). */
    DA_OK,
    /** Set whenever one calls my_eof(). */
    DA_EOF,
    /** Set whenever one calls my_ok() in PS bulk mode. */
    DA_OK_BULK,
    /** Set whenever one calls my_eof() in PS bulk mode. */
    DA_EOF_BULK,
    /** Set whenever one calls my_error() or my_message(). */
    DA_ERROR,
    /** Set in case of a custom response, such as one from COM_STMT_PREPARE. */
    DA_DISABLED
  };

  void set_overwrite_status(bool can_overwrite_status)
  { m_can_overwrite_status= can_overwrite_status; }

  /** True if status information is sent to the client. */
  bool is_sent() const { return m_is_sent; }

  void set_is_sent(bool is_sent_arg) { m_is_sent= is_sent_arg; }

  void set_ok_status(ulonglong affected_rows,
                     ulonglong last_insert_id,
                     const char *message);

  void set_eof_status(THD *thd);

  void set_error_status(uint sql_errno);

  void set_error_status(uint sql_errno,
                        const char *message,
                        const char *sqlstate,
                        const Sql_user_condition_identity &ucid,
                        const Sql_condition *error_condition);

  void set_error_status(uint sql_errno,
                        const char *message,
                        const char *sqlstate,
                        const Sql_condition *error_condition)
  {
    set_error_status(sql_errno, message, sqlstate,
                     Sql_user_condition_identity(),
                     error_condition);
  }

  void disable_status();

  void reset_diagnostics_area();

  bool is_set() const { return m_status != DA_EMPTY; }

  bool is_error() const { return m_status == DA_ERROR; }

  bool is_eof() const { return m_status == DA_EOF; }

  bool is_ok() const { return m_status == DA_OK; }

  bool is_disabled() const { return m_status == DA_DISABLED; }

  void set_bulk_execution(bool bulk) { is_bulk_execution= bulk; }

  bool is_bulk_op() const { return is_bulk_execution; }

  enum_diagnostics_status status() const { return m_status; }

  const char *message() const
  {
    DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK ||
                m_status == DA_OK_BULK || m_status == DA_EOF_BULK);
    return m_message;
  }


  uint sql_errno() const
  {
    DBUG_ASSERT(m_status == DA_ERROR);
    return Sql_state_errno::get_sql_errno();
  }

  const char* get_sqlstate() const
  { DBUG_ASSERT(m_status == DA_ERROR); return Sql_state::get_sqlstate(); }

  ulonglong affected_rows() const
  {
    DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK);
    return m_affected_rows;
  }

  void set_message(const char *msg)
  {
    strmake_buf(m_message, msg);
  }

  ulonglong last_insert_id() const
  {
    DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK);
    return m_last_insert_id;
  }

  uint statement_warn_count() const
  {
    DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK ||
                m_status == DA_EOF ||m_status == DA_EOF_BULK );
    return m_statement_warn_count;
  }

  uint unsafe_statement_warn_count() const
  {
    return m_statement_warn_count;
  }

  /**
    Get the current errno, state and id of the user defined condition
    and return them as Sql_condition_identity.
  */
  Sql_condition_identity get_error_condition_identity() const
  {
    DBUG_ASSERT(m_status == DA_ERROR);
    return Sql_condition_identity(*this /*Sql_state_errno*/,
                                  Sql_condition::WARN_LEVEL_ERROR,
                                  *this /*Sql_user_condition_identity*/);
  }

  /* Used to count any warnings pushed after calling set_ok_status(). */
  void increment_warning()
  {
    if (m_status != DA_EMPTY)
      m_statement_warn_count++;
  }

  Diagnostics_area(bool initialize);
  Diagnostics_area(ulonglong warning_info_id, bool allow_unlimited_warnings,
                   bool initialize);
  void init() { m_main_wi.init() ; }
  void free_memory() { m_main_wi.free_memory() ; }

  void push_warning_info(Warning_info *wi)
  { m_wi_stack.push_front(wi); }

  void pop_warning_info()
  {
    DBUG_ASSERT(m_wi_stack.elements() > 0);
    m_wi_stack.remove(m_wi_stack.front());
  }

  void set_warning_info_id(ulonglong id)
  { get_warning_info()->id(id); }

  ulonglong warning_info_id() const
  { return get_warning_info()->id(); }

  /**
    Compare given current warning info and current warning info
    and see if they are different. They will be different if
    warnings have been generated or statements that use tables
    have been executed. This is checked by comparing m_warn_id.

    @param wi  Warning info to compare with current Warning info.

    @return    false if they are equal, true if they are not.
  */
  bool warning_info_changed(const Warning_info *wi) const
  { return get_warning_info()->id() != wi->id(); }

  bool is_warning_info_empty() const
  { return get_warning_info()->is_empty(); }

  ulong current_statement_warn_count() const
  { return get_warning_info()->current_statement_warn_count(); }

  bool has_sql_condition(const char *message_str, size_t message_length) const
  { return get_warning_info()->has_sql_condition(message_str, message_length); }

  bool has_sql_condition(uint sql_errno) const
  { return get_warning_info()->has_sql_condition(sql_errno); }

  void reset_for_next_command()
  { get_warning_info()->reset_for_next_command(); }

  void clear_warning_info(ulonglong id)
  { get_warning_info()->clear(id); }

  void opt_clear_warning_info(ulonglong query_id)
  { get_warning_info()->opt_clear(query_id); }

  long set_current_row_for_warning(long row)
  { return get_warning_info()->set_current_row_for_warning(row); }

  ulong current_row_for_warning() const
  { return get_warning_info()->current_row_for_warning(); }

  void inc_current_row_for_warning()
  { get_warning_info()->inc_current_row_for_warning(); }

  void reset_current_row_for_warning()
  { get_warning_info()->reset_current_row_for_warning(); }

  bool is_warning_info_read_only() const
  { return get_warning_info()->is_read_only(); }

  void set_warning_info_read_only(bool read_only_arg)
  { get_warning_info()->set_read_only(read_only_arg); }

  ulong error_count() const
  { return get_warning_info()->error_count(); }

  ulong warn_count() const
  { return get_warning_info()->warn_count(); }

  uint cond_count() const
  { return get_warning_info()->cond_count(); }

  Sql_condition_iterator sql_conditions() const
  { return get_warning_info()->m_warn_list; }

  void reserve_space(THD *thd, uint count)
  { get_warning_info()->reserve_space(thd, count); }

  Sql_condition *push_warning(THD *thd, const Sql_condition *sql_condition)
  { return get_warning_info()->push_warning(thd, sql_condition); }

  Sql_condition *push_warning(THD *thd,
                              uint sql_errno_arg,
                              const char* sqlstate,
                              Sql_condition::enum_warning_level level,
                              const Sql_user_condition_identity &ucid,
                              const char* msg)
  {
    Sql_condition_identity tmp(sql_errno_arg, sqlstate, level, ucid);
    return get_warning_info()->push_warning(thd, &tmp, msg);
  }

  Sql_condition *push_warning(THD *thd,
                              uint sqlerrno,
                              const char* sqlstate,
                              Sql_condition::enum_warning_level level,
                              const char* msg)
  {
    return push_warning(thd, sqlerrno, sqlstate, level,
                        Sql_user_condition_identity(), msg);
  }
  void mark_sql_conditions_for_removal()
  { get_warning_info()->mark_sql_conditions_for_removal(); }

  void unmark_sql_conditions_from_removal()
  { get_warning_info()->unmark_sql_conditions_from_removal(); }

  void remove_marked_sql_conditions()
  { get_warning_info()->remove_marked_sql_conditions(); }

  const Sql_condition *get_error_condition() const
  { return get_warning_info()->get_error_condition(); }

  void copy_sql_conditions_to_wi(THD *thd, Warning_info *dst_wi) const
  { dst_wi->append_warning_info(thd, get_warning_info()); }

  void copy_sql_conditions_from_wi(THD *thd, const Warning_info *src_wi)
  { get_warning_info()->append_warning_info(thd, src_wi); }

  void copy_non_errors_from_wi(THD *thd, const Warning_info *src_wi);

private:
  Warning_info *get_warning_info() { return m_wi_stack.front(); }

  const Warning_info *get_warning_info() const { return m_wi_stack.front(); }

private:
  /** True if status information is sent to the client. */
  bool m_is_sent;

  /** Set to make set_error_status after set_{ok,eof}_status possible. */
  bool m_can_overwrite_status;

  /** Message buffer. Can be used by OK or ERROR status. */
  char m_message[MYSQL_ERRMSG_SIZE];

  /**
    The number of rows affected by the last statement. This is
    semantically close to thd->m_row_count_func, but has a different
    life cycle. thd->m_row_count_func stores the value returned by
    function ROW_COUNT() and is cleared only by statements that
    update its value, such as INSERT, UPDATE, DELETE and few others.
    This member is cleared at the beginning of the next statement.

    We could possibly merge the two, but life cycle of thd->m_row_count_func
    can not be changed.
  */
  ulonglong    m_affected_rows;

  /**
    Similarly to the previous member, this is a replacement of
    thd->first_successful_insert_id_in_prev_stmt, which is used
    to implement LAST_INSERT_ID().
  */

  ulonglong   m_last_insert_id;
  /**
    Number of warnings of this last statement. May differ from
    the number of warnings returned by SHOW WARNINGS e.g. in case
    the statement doesn't clear the warnings, and doesn't generate
    them.
  */
  uint	     m_statement_warn_count;

  enum_diagnostics_status m_status;

  my_bool is_bulk_execution;

  Warning_info m_main_wi;

  Warning_info_list m_wi_stack;
};

///////////////////////////////////////////////////////////////////////////

void convert_error_to_warning(THD *thd);

void push_warning(THD *thd, Sql_condition::enum_warning_level level,
                  uint code, const char *msg);

void push_warning_printf(THD *thd, Sql_condition::enum_warning_level level,
                         uint code, const char *format, ...);

bool mysqld_show_warnings(THD *thd, ulong levels_to_show);

size_t convert_error_message(char *to, size_t to_length,
                             CHARSET_INFO *to_cs,
                             const char *from, size_t from_length,
                             CHARSET_INFO *from_cs, uint *errors);

extern const LEX_CSTRING warning_level_names[];

bool is_sqlstate_valid(const LEX_CSTRING *sqlstate);
/**
  Checks if the specified SQL-state-string defines COMPLETION condition.
  This function assumes that the given string contains a valid SQL-state.

  @param s the condition SQLSTATE.

  @retval true if the given string defines COMPLETION condition.
  @retval false otherwise.
*/
inline bool is_sqlstate_completion(const char *s)
{ return s[0] == '0' && s[1] == '0'; }


#endif // SQL_ERROR_H
server/private/sql_callback.h000064400000003006150400263740012310 0ustar00/*
  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

  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
*/

#ifndef SQL_CALLBACK_INCLUDED
#define SQL_CALLBACK_INCLUDED

/**
   Macro used for an internal callback.

   The macro will check that the object exists and that the function
   is defined. If that is the case, it will call the function with the
   given parameters.

   If the object or the function is not defined, the callback will be
   considered successful (nothing needed to be done) and will
   therefore return no error.
 */

#define MYSQL_CALLBACK(OBJ, FUNC, PARAMS)         \
  do {                                            \
    if ((OBJ) && ((OBJ)->FUNC))                   \
      (OBJ)->FUNC PARAMS;                         \
  } while (0)

#define MYSQL_CALLBACK_ELSE(OBJ, FUNC, PARAMS, ELSE)    \
  (((OBJ) && ((OBJ)->FUNC)) ? (OBJ)->FUNC PARAMS : (ELSE))

#endif /* SQL_CALLBACK_INCLUDED */
server/private/vers_string.h000064400000004746150400263740012256 0ustar00/*
   Copyright (c) 2018, 2020, 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-1301  USA */

#ifndef VERS_STRING_INCLUDED
#define VERS_STRING_INCLUDED

#include "lex_string.h"

/*
  LEX_CSTRING with comparison semantics.
*/

// db and table names: case sensitive (or insensitive) in table_alias_charset
struct Compare_table_names
{
  int operator()(const LEX_CSTRING& a, const LEX_CSTRING& b) const
  {
    DBUG_ASSERT(a.str[a.length] == 0);
    DBUG_ASSERT(b.str[b.length] == 0);
    return table_alias_charset->strnncoll(a.str, a.length,
                                          b.str, b.length);
  }
};

// column names and other identifiers: case insensitive in system_charset_info
struct Compare_identifiers
{
  int operator()(const LEX_CSTRING& a, const LEX_CSTRING& b) const
  {
    DBUG_ASSERT(a.str != NULL);
    DBUG_ASSERT(b.str != NULL);
    DBUG_ASSERT(a.str[a.length] == 0);
    DBUG_ASSERT(b.str[b.length] == 0);
    return my_strcasecmp(system_charset_info, a.str, b.str);
  }
};


template <class Compare>
struct Lex_cstring_with_compare : public Lex_cstring
{
public:
  Lex_cstring_with_compare() = default;
  Lex_cstring_with_compare(const char *_str, size_t _len) :
    Lex_cstring(_str, _len)
  { }
  Lex_cstring_with_compare(const LEX_STRING src) :
    Lex_cstring(src.str, src.length)
  { }
  Lex_cstring_with_compare(const LEX_CSTRING src) : Lex_cstring(src.str, src.length)
  { }
  Lex_cstring_with_compare(const char *_str) : Lex_cstring(_str, strlen(_str))
  { }
  bool streq(const Lex_cstring_with_compare& b) const
  {
    return Lex_cstring::length == b.length && 0 == Compare()(*this, b);
  }
  operator const char* () const
  {
    return str;
  }
  operator bool () const
  {
    return str != NULL;
  }
};

typedef Lex_cstring_with_compare<Compare_identifiers> Lex_ident;
typedef Lex_cstring_with_compare<Compare_table_names> Lex_table_name;

#endif // VERS_STRING_INCLUDED
server/private/ha_partition.h000064400000175635150400263740012400 0ustar00#ifndef HA_PARTITION_INCLUDED
#define HA_PARTITION_INCLUDED

/*
   Copyright (c) 2005, 2012, Oracle and/or its affiliates.
   Copyright (c) 2009, 2022, 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 "sql_partition.h"      /* part_id_range, partition_element */
#include "queues.h"             /* QUEUE */

struct Ordered_blob_storage
{
  String blob;
  bool set_read_value;
  Ordered_blob_storage() : set_read_value(false)
  {}
};

#define PAR_EXT ".par"
#define PARTITION_BYTES_IN_POS 2
#define ORDERED_PART_NUM_OFFSET sizeof(Ordered_blob_storage **)
#define ORDERED_REC_OFFSET (ORDERED_PART_NUM_OFFSET + PARTITION_BYTES_IN_POS)


/** Struct used for partition_name_hash */
typedef struct st_part_name_def
{
  uchar *partition_name;
  uint length;
  uint32 part_id;
  my_bool is_subpart;
} PART_NAME_DEF;

/** class where to save partitions Handler_share's */
class Parts_share_refs
{
public:
  uint num_parts;                              /**< Size of ha_share array */
  Handler_share **ha_shares;                   /**< Storage for each part */
  Parts_share_refs()
  {
    num_parts= 0;
    ha_shares= NULL;
  }
  ~Parts_share_refs()
  {
    uint i;
    for (i= 0; i < num_parts; i++)
      delete ha_shares[i];
    delete[] ha_shares;
  }
  bool init(uint arg_num_parts)
  {
    DBUG_ASSERT(!num_parts && !ha_shares);
    num_parts= arg_num_parts;
    /* Allocate an array of Handler_share pointers */
    ha_shares= new Handler_share *[num_parts];
    if (!ha_shares)
    {
      num_parts= 0;
      return true;
    }
    memset(ha_shares, 0, sizeof(Handler_share*) * num_parts);
    return false;
  }
};

class ha_partition;

/* Partition Full Text Search info */
struct st_partition_ft_info
{
  struct _ft_vft        *please;
  st_partition_ft_info  *next;
  ha_partition          *file;
  FT_INFO               **part_ft_info;
};


#ifdef HAVE_PSI_MUTEX_INTERFACE
extern PSI_mutex_key key_partition_auto_inc_mutex;
#endif

/**
  Partition specific Handler_share.
*/
class Partition_share : public Handler_share
{
public:
  bool auto_inc_initialized;
  mysql_mutex_t auto_inc_mutex;                /**< protecting auto_inc val */
  ulonglong next_auto_inc_val;                 /**< first non reserved value */
  /**
    Hash of partition names. Initialized in the first ha_partition::open()
    for the table_share. After that it is read-only, i.e. no locking required.
  */
  bool partition_name_hash_initialized;
  HASH partition_name_hash;
  const char *partition_engine_name;
  /** Storage for each partitions Handler_share */
  Parts_share_refs partitions_share_refs;
  Partition_share()
    : auto_inc_initialized(false),
    next_auto_inc_val(0),
    partition_name_hash_initialized(false),
    partition_engine_name(NULL),
    partition_names(NULL)
  {
    mysql_mutex_init(key_partition_auto_inc_mutex,
                    &auto_inc_mutex,
                    MY_MUTEX_INIT_FAST);
  }

  ~Partition_share()
  {
    mysql_mutex_destroy(&auto_inc_mutex);
    if (partition_names)
    {
      my_free(partition_names);
    }
    if (partition_name_hash_initialized)
    {
      my_hash_free(&partition_name_hash);
    }
  }
  
  bool init(uint num_parts);

  /**
    Release reserved auto increment values not used.
    @param thd             Thread.
    @param table_share     Table Share
    @param next_insert_id  Next insert id (first non used auto inc value).
    @param max_reserved    End of reserved auto inc range.
  */
  void release_auto_inc_if_possible(THD *thd, TABLE_SHARE *table_share,
                                    const ulonglong next_insert_id,
                                    const ulonglong max_reserved);

  /** lock mutex protecting auto increment value next_auto_inc_val. */
  inline void lock_auto_inc()
  {
    mysql_mutex_lock(&auto_inc_mutex);
  }
  /** unlock mutex protecting auto increment value next_auto_inc_val. */
  inline void unlock_auto_inc()
  {
    mysql_mutex_unlock(&auto_inc_mutex);
  }
  /**
    Populate partition_name_hash with partition and subpartition names
    from part_info.
    @param part_info  Partition info containing all partitions metadata.

    @return Operation status.
      @retval false Success.
      @retval true  Failure.
  */
  bool populate_partition_name_hash(partition_info *part_info);
  /** Get partition name.

  @param part_id  Partition id (for subpartitioned table only subpartition
                  names will be returned.)

  @return partition name or NULL if error.
  */
  const char *get_partition_name(size_t part_id) const;
private:
  const uchar **partition_names;
  /**
    Insert [sub]partition name into  partition_name_hash
    @param name        Partition name.
    @param part_id     Partition id.
    @param is_subpart  True if subpartition else partition.

    @return Operation status.
      @retval false Success.
      @retval true  Failure.
  */
  bool insert_partition_name_in_hash(const char *name,
                                     uint part_id,
                                     bool is_subpart);
};


/*
  List of ranges to be scanned by ha_partition's MRR implementation

  This object is
   - A KEY_MULTI_RANGE structure (the MRR range)
   - Storage for the range endpoints that the KEY_MULTI_RANGE has pointers to
   - list of such ranges (connected through the "next" pointer).
*/

typedef struct st_partition_key_multi_range
{
  /*
    Number of the range. The ranges are numbered in the order RANGE_SEQ_IF has
    emitted them, starting from 1. The numbering in used by ordered MRR scans.
  */
  uint id;
  uchar *key[2];
  /*
    Sizes of allocated memory in key[]. These may be larger then the actual
    values as this structure is reused across MRR scans
  */
  uint length[2];

  /*
    The range.
    key_multi_range.ptr is a pointer to the this PARTITION_KEY_MULTI_RANGE
    object
  */
  KEY_MULTI_RANGE key_multi_range;

  // Range id from the SQL layer
  range_id_t ptr;

  // The next element in the list of MRR ranges.
  st_partition_key_multi_range *next;
} PARTITION_KEY_MULTI_RANGE;


/*
  List of ranges to be scanned in a certain [sub]partition

  The idea is that there's a list of ranges to be scanned in the table
  (formed by PARTITION_KEY_MULTI_RANGE structures),
  and for each [sub]partition, we only need to scan a subset of that list.

     PKMR1 --> PKMR2 --> PKMR3 -->... // list of PARTITION_KEY_MULTI_RANGE
       ^                   ^
       |                   |
     PPKMR1 ----------> PPKMR2 -->... // list of PARTITION_PART_KEY_MULTI_RANGE

  This way, per-partition lists of PARTITION_PART_KEY_MULTI_RANGE have pointers
  to the elements of the global list of PARTITION_KEY_MULTI_RANGE.
*/

typedef struct st_partition_part_key_multi_range
{
  PARTITION_KEY_MULTI_RANGE *partition_key_multi_range;
  st_partition_part_key_multi_range *next;
} PARTITION_PART_KEY_MULTI_RANGE;


class ha_partition;

/*
  The structure holding information about range sequence to be used with one
  partition.
  (pointer to this is used as seq_init_param for RANGE_SEQ_IF structure when
   invoking MRR for an individual partition)
*/

typedef struct st_partition_part_key_multi_range_hld
{
  /* Owner object */
  ha_partition *partition;

  /* id of the the partition this structure is for */
  uint32 part_id;

  /* Current range we're iterating through */
  PARTITION_PART_KEY_MULTI_RANGE *partition_part_key_multi_range;
} PARTITION_PART_KEY_MULTI_RANGE_HLD;


extern "C" int cmp_key_part_id(void *key_p, const void *ref1, const void *ref2);
extern "C" int cmp_key_rowid_part_id(void *ptr, const void *ref1, const void *ref2);

class ha_partition final :public handler
{
private:
  enum partition_index_scan_type
  {
    partition_index_read= 0,
    partition_index_first= 1,
    partition_index_last= 3,
    partition_index_read_last= 4,
    partition_read_range = 5,
    partition_no_index_scan= 6,
    partition_read_multi_range = 7,
    partition_ft_read= 8
  };
  /* Data for the partition handler */
  int  m_mode;                          // Open mode
  uint m_open_test_lock;                // Open test_if_locked
  uchar *m_file_buffer;                 // Content of the .par file
  char *m_name_buffer_ptr;		// Pointer to first partition name
  MEM_ROOT m_mem_root;
  plugin_ref *m_engine_array;           // Array of types of the handlers
  handler **m_file;                     // Array of references to handler inst.
  uint m_file_tot_parts;                // Debug
  handler **m_new_file;                 // Array of references to new handlers
  handler **m_reorged_file;             // Reorganised partitions
  handler **m_added_file;               // Added parts kept for errors
  LEX_CSTRING *m_connect_string;
  partition_info *m_part_info;          // local reference to partition
  Field **m_part_field_array;           // Part field array locally to save acc
  uchar *m_ordered_rec_buffer;          // Row and key buffer for ord. idx scan
  st_partition_ft_info *ft_first;
  st_partition_ft_info *ft_current;
  /*
    Current index.
    When used in key_rec_cmp: If clustered pk, index compare
    must compare pk if given index is same for two rows.
    So normally m_curr_key_info[0]= current index and m_curr_key[1]= NULL,
    and if clustered pk, [0]= current index, [1]= pk, [2]= NULL
  */
  KEY *m_curr_key_info[3];              // Current index
  uchar *m_rec0;                        // table->record[0]
  const uchar *m_err_rec;               // record which gave error
  QUEUE m_queue;                        // Prio queue used by sorted read

  /*
    Length of an element in m_ordered_rec_buffer. The elements are composed of

      [part_no] [table->record copy] [underlying_table_rowid]

    underlying_table_rowid is only stored when the table has no extended keys.
  */
  size_t m_priority_queue_rec_len;

  /*
    If true, then sorting records by key value also sorts them by their
    underlying_table_rowid.
  */
  bool m_using_extended_keys;

  /*
    Since the partition handler is a handler on top of other handlers, it
    is necessary to keep information about what the underlying handler
    characteristics is. It is not possible to keep any handler instances
    for this since the MySQL Server sometimes allocating the handler object
    without freeing them.
  */
  enum enum_handler_status
  {
    handler_not_initialized= 0,
    handler_initialized,
    handler_opened,
    handler_closed
  };
  enum_handler_status m_handler_status;

  uint m_reorged_parts;                  // Number of reorganised parts
  uint m_tot_parts;                      // Total number of partitions;
  uint m_num_locks;                       // For engines like ha_blackhole, which needs no locks
  uint m_last_part;                      // Last file that we update,write,read
  part_id_range m_part_spec;             // Which parts to scan
  uint m_scan_value;                     // Value passed in rnd_init
                                         // call
  uint m_ref_length;                     // Length of position in this
                                         // handler object
  key_range m_start_key;                 // index read key range
  enum partition_index_scan_type m_index_scan_type;// What type of index
                                                   // scan
  uint m_top_entry;                      // Which partition is to
                                         // deliver next result
  uint m_rec_length;                     // Local copy of record length

  bool m_ordered;                        // Ordered/Unordered index scan
  bool m_create_handler;                 // Handler used to create table
  bool m_is_sub_partitioned;             // Is subpartitioned
  bool m_ordered_scan_ongoing;
  bool m_rnd_init_and_first;
  bool m_ft_init_and_first;

  /*
    If set, this object was created with ha_partition::clone and doesn't
    "own" the m_part_info structure.
  */
  ha_partition *m_is_clone_of;
  MEM_ROOT *m_clone_mem_root;

  /*
    We keep track if all underlying handlers are MyISAM since MyISAM has a
    great number of extra flags not needed by other handlers.
  */
  bool m_myisam;                         // Are all underlying handlers
                                         // MyISAM
  /*
    We keep track of InnoDB handlers below since it requires proper setting
    of query_id in fields at index_init and index_read calls.
  */
  bool m_innodb;                        // Are all underlying handlers
                                        // InnoDB
  bool m_myisammrg;                     // Are any of the handlers of type MERGE
  /*
    When calling extra(HA_EXTRA_CACHE) we do not pass this to the underlying
    handlers immediately. Instead we cache it and call the underlying
    immediately before starting the scan on the partition. This is to
    prevent allocating a READ CACHE for each partition in parallel when
    performing a full table scan on MyISAM partitioned table.
    This state is cleared by extra(HA_EXTRA_NO_CACHE).
  */
  bool m_extra_cache;
  uint m_extra_cache_size;
  /* The same goes for HA_EXTRA_PREPARE_FOR_UPDATE */
  bool m_extra_prepare_for_update;
  /* Which partition has active cache */
  uint m_extra_cache_part_id;

  void init_handler_variables();
  /*
    Variables for lock structures.
  */

  bool auto_increment_lock;             /**< lock reading/updating auto_inc */
  /**
    Flag to keep the auto_increment lock through out the statement.
    This to ensure it will work with statement based replication.
  */
  bool auto_increment_safe_stmt_log_lock;
  /** For optimizing ha_start_bulk_insert calls */
  MY_BITMAP m_bulk_insert_started;
  ha_rows   m_bulk_inserted_rows;
  /** used for prediction of start_bulk_insert rows */
  enum_monotonicity_info m_part_func_monotonicity_info;
  part_id_range m_direct_update_part_spec;
  bool                m_pre_calling;
  bool                m_pre_call_use_parallel;
  /* Keep track of bulk access requests */
  bool                bulk_access_executing;

  /** keep track of locked partitions */
  MY_BITMAP m_locked_partitions;
  /** Stores shared auto_increment etc. */
  Partition_share *part_share;
  void sum_copy_info(handler *file);
  void sum_copy_infos();
  void reset_copy_info() override;
  /** Temporary storage for new partitions Handler_shares during ALTER */
  List<Parts_share_refs> m_new_partitions_share_refs;
  /** Sorted array of partition ids in descending order of number of rows. */
  uint32 *m_part_ids_sorted_by_num_of_records;
  /* Compare function for my_qsort2, for reversed order. */
  static int compare_number_of_records(void *me, const void *a, const void *b);
  /** keep track of partitions to call ha_reset */
  MY_BITMAP m_partitions_to_reset;
  /** partitions that returned HA_ERR_KEY_NOT_FOUND. */
  MY_BITMAP m_key_not_found_partitions;
  bool m_key_not_found;
  List<String> *m_partitions_to_open;
  MY_BITMAP m_opened_partitions;
  /** This is one of the m_file-s that it guaranteed to be opened. */
  /**  It is set in open_read_partitions() */
  handler *m_file_sample;
public:
  handler **get_child_handlers()
  {
    return m_file;
  }
  ha_partition *get_clone_source()
  {
    return m_is_clone_of;
  }
  virtual part_id_range *get_part_spec()
  {
    return &m_part_spec;
  }
  virtual uint get_no_current_part_id()
  {
    return NO_CURRENT_PART_ID;
  }
  Partition_share *get_part_share() { return part_share; }
  handler *clone(const char *name, MEM_ROOT *mem_root) override;
  void set_part_info(partition_info *part_info) override
  {
     m_part_info= part_info;
     m_is_sub_partitioned= part_info->is_sub_partitioned();
  }
  Compare_keys compare_key_parts(
    const Field &old_field,
    const Column_definition &new_field,
    const KEY_PART_INFO &old_part,
    const KEY_PART_INFO &new_part) const override;

  void return_record_by_parent() override;

  bool vers_can_native(THD *thd) override
  {
    if (thd->lex->part_info)
    {
      // PARTITION BY SYSTEM_TIME is not supported for now
      return thd->lex->part_info->part_type != VERSIONING_PARTITION;
    }
    else
    {
      bool can= true;
      for (uint i= 0; i < m_tot_parts && can; i++)
        can= can && m_file[i]->vers_can_native(thd);
      return can;
    }
  }

  /*
    -------------------------------------------------------------------------
    MODULE create/delete handler object
    -------------------------------------------------------------------------
    Object create/delete method. Normally called when a table object
    exists. There is also a method to create the handler object with only
    partition information. This is used from mysql_create_table when the
    table is to be created and the engine type is deduced to be the
    partition handler.
    -------------------------------------------------------------------------
  */
    ha_partition(handlerton *hton, TABLE_SHARE * table);
    ha_partition(handlerton *hton, partition_info * part_info);
    ha_partition(handlerton *hton, TABLE_SHARE *share,
                 partition_info *part_info_arg,
                 ha_partition *clone_arg,
                 MEM_ROOT *clone_mem_root_arg);
   ~ha_partition();
   void ha_partition_init();
  /*
    A partition handler has no characteristics in itself. It only inherits
    those from the underlying handlers. Here we set-up those constants to
    enable later calls of the methods to retrieve constants from the under-
    lying handlers. Returns false if not successful.
  */
   bool initialize_partition(MEM_ROOT *mem_root);

  /*
    -------------------------------------------------------------------------
    MODULE meta data changes
    -------------------------------------------------------------------------
    Meta data routines to CREATE, DROP, RENAME table and often used at
    ALTER TABLE (update_create_info used from ALTER TABLE and SHOW ..).

    create_partitioning_metadata is called before opening a new handler object
    with openfrm to call create. It is used to create any local handler
    object needed in opening the object in openfrm
    -------------------------------------------------------------------------
  */
  int delete_table(const char *from) override;
  int rename_table(const char *from, const char *to) override;
  int create(const char *name, TABLE *form,
             HA_CREATE_INFO *create_info) override;
  int create_partitioning_metadata(const char *name,
                                   const char *old_name,
                                   chf_create_flags action_flag)
    override;
  bool check_if_updates_are_ignored(const char *op) const override;
  void update_create_info(HA_CREATE_INFO *create_info) override;
  int change_partitions(HA_CREATE_INFO *create_info, const char *path,
                        ulonglong * const copied, ulonglong * const deleted,
                        const uchar *pack_frm_data, size_t pack_frm_len)
    override;
  int drop_partitions(const char *path) override;
  int rename_partitions(const char *path) override;
  bool get_no_parts(const char *, uint *num_parts) override
  {
    DBUG_ENTER("ha_partition::get_no_parts");
    *num_parts= m_tot_parts;
    DBUG_RETURN(0);
  }
  void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) override;
  bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
                                  uint table_changes) override;
  void update_part_create_info(HA_CREATE_INFO *create_info, uint part_id)
  {
    m_file[part_id]->update_create_info(create_info);
  }
private:
  int copy_partitions(ulonglong * const copied, ulonglong * const deleted);
  void cleanup_new_partition(uint part_count);
  int prepare_new_partition(TABLE *table, HA_CREATE_INFO *create_info,
                            handler *file, const char *part_name,
                            partition_element *p_elem);
  /*
    delete_table and rename_table uses very similar logic which
    is packed into this routine.
  */
  uint del_ren_table(const char *from, const char *to);
  /*
    One method to create the table_name.par file containing the names of the
    underlying partitions, their engine and the number of partitions.
    And one method to read it in.
  */
  bool create_handler_file(const char *name);
  bool setup_engine_array(MEM_ROOT *mem_root, handlerton *first_engine);
  int read_par_file(const char *name);
  handlerton *get_def_part_engine(const char *name);
  bool get_from_handler_file(const char *name, MEM_ROOT *mem_root,
                             bool is_clone);
  bool re_create_par_file(const char *name);
  bool new_handlers_from_part_info(MEM_ROOT *mem_root);
  bool create_handlers(MEM_ROOT *mem_root);
  void clear_handler_file();
  int set_up_table_before_create(TABLE *table_arg,
                                 const char *partition_name_with_path,
                                 HA_CREATE_INFO *info,
                                 partition_element *p_elem);
  partition_element *find_partition_element(uint part_id);
  bool insert_partition_name_in_hash(const char *name, uint part_id,
                                     bool is_subpart);
  bool populate_partition_name_hash();
  Partition_share *get_share();
  bool set_ha_share_ref(Handler_share **ha_share) override;
  void fix_data_dir(char* path);
  bool init_partition_bitmaps();
  void free_partition_bitmaps();

public:

  /*
    -------------------------------------------------------------------------
    MODULE open/close object
    -------------------------------------------------------------------------
    Open and close handler object to ensure all underlying files and
    objects allocated and deallocated for query handling is handled
    properly.
    -------------------------------------------------------------------------

    A handler object is opened as part of its initialisation and before
    being used for normal queries (not before meta-data changes always.
    If the object was opened it will also be closed before being deleted.
  */
  int open(const char *name, int mode, uint test_if_locked) override;
  int close() override;

  /*
    -------------------------------------------------------------------------
    MODULE start/end statement
    -------------------------------------------------------------------------
    This module contains methods that are used to understand start/end of
    statements, transaction boundaries, and aid for proper concurrency
    control.
    The partition handler need not implement abort and commit since this
    will be handled by any underlying handlers implementing transactions.
    There is only one call to each handler type involved per transaction
    and these go directly to the handlers supporting transactions
    -------------------------------------------------------------------------
  */
  THR_LOCK_DATA **store_lock(THD * thd, THR_LOCK_DATA ** to,
                             enum thr_lock_type lock_type) override;
  int external_lock(THD * thd, int lock_type) override;
  LEX_CSTRING *engine_name() override { return hton_name(partition_ht()); }
  /*
    When table is locked a statement is started by calling start_stmt
    instead of external_lock
  */
  int start_stmt(THD * thd, thr_lock_type lock_type) override;
  /*
    Lock count is number of locked underlying handlers (I assume)
  */
  uint lock_count() const override;
  /*
    Call to unlock rows not to be updated in transaction
  */
  void unlock_row() override;
  /*
    Check if semi consistent read
  */
  bool was_semi_consistent_read() override;
  /*
    Call to hint about semi consistent read
  */
  void try_semi_consistent_read(bool) override;

  /*
    NOTE: due to performance and resource issues with many partitions,
    we only use the m_psi on the ha_partition handler, excluding all
    partitions m_psi.
  */
#ifdef HAVE_M_PSI_PER_PARTITION
  /*
    Bind the table/handler thread to track table i/o.
  */
  virtual void unbind_psi();
  virtual int rebind();
#endif
  int discover_check_version() override;
  /*
    -------------------------------------------------------------------------
    MODULE change record
    -------------------------------------------------------------------------
    This part of the handler interface is used to change the records
    after INSERT, DELETE, UPDATE, REPLACE method calls but also other
    special meta-data operations as ALTER TABLE, LOAD DATA, TRUNCATE.
    -------------------------------------------------------------------------

    These methods are used for insert (write_row), update (update_row)
    and delete (delete_row). All methods to change data always work on
    one row at a time. update_row and delete_row also contains the old
    row.
    delete_all_rows will delete all rows in the table in one call as a
    special optimisation for DELETE from table;

    Bulk inserts are supported if all underlying handlers support it.
    start_bulk_insert and end_bulk_insert is called before and after a
    number of calls to write_row.
  */
  int write_row(const uchar * buf) override;
  bool start_bulk_update() override;
  int exec_bulk_update(ha_rows *dup_key_found) override;
  int end_bulk_update() override;
  int bulk_update_row(const uchar *old_data, const uchar *new_data,
                      ha_rows *dup_key_found) override;
  int update_row(const uchar * old_data, const uchar * new_data) override;
  int direct_update_rows_init(List<Item> *update_fields) override;
  int pre_direct_update_rows_init(List<Item> *update_fields) override;
  int direct_update_rows(ha_rows *update_rows, ha_rows *found_rows) override;
  int pre_direct_update_rows() override;
  bool start_bulk_delete() override;
  int end_bulk_delete() override;
  int delete_row(const uchar * buf) override;
  int direct_delete_rows_init() override;
  int pre_direct_delete_rows_init() override;
  int direct_delete_rows(ha_rows *delete_rows) override;
  int pre_direct_delete_rows() override;
  int delete_all_rows() override;
  int truncate() override;
  void start_bulk_insert(ha_rows rows, uint flags) override;
  int end_bulk_insert() override;
private:
  ha_rows guess_bulk_insert_rows();
  void start_part_bulk_insert(THD *thd, uint part_id);
  long estimate_read_buffer_size(long original_size);
public:

  /*
    Method for truncating a specific partition.
    (i.e. ALTER TABLE t1 TRUNCATE PARTITION p).

    @remark This method is a partitioning-specific hook
            and thus not a member of the general SE API.
  */
  int truncate_partition(Alter_info *, bool *binlog_stmt);

  bool is_fatal_error(int error, uint flags) override
  {
    if (!handler::is_fatal_error(error, flags) ||
        error == HA_ERR_NO_PARTITION_FOUND ||
        error == HA_ERR_NOT_IN_LOCK_PARTITIONS)
      return FALSE;
    return TRUE;
  }


  /*
    -------------------------------------------------------------------------
    MODULE full table scan
    -------------------------------------------------------------------------
    This module is used for the most basic access method for any table
    handler. This is to fetch all data through a full table scan. No
    indexes are needed to implement this part.
    It contains one method to start the scan (rnd_init) that can also be
    called multiple times (typical in a nested loop join). Then proceeding
    to the next record (rnd_next) and closing the scan (rnd_end).
    To remember a record for later access there is a method (position)
    and there is a method used to retrieve the record based on the stored
    position.
    The position can be a file position, a primary key, a ROWID dependent
    on the handler below.
    -------------------------------------------------------------------------
  */
  /*
    unlike index_init(), rnd_init() can be called two times
    without rnd_end() in between (it only makes sense if scan=1).
    then the second call should prepare for the new table scan
    (e.g if rnd_init allocates the cursor, second call should
    position it to the start of the table, no need to deallocate
    and allocate it again
  */
  int rnd_init(bool scan) override;
  int rnd_end() override;
  int rnd_next(uchar * buf) override;
  int rnd_pos(uchar * buf, uchar * pos) override;
  int rnd_pos_by_record(uchar *record) override;
  void position(const uchar * record) override;

  /*
    -------------------------------------------------------------------------
    MODULE index scan
    -------------------------------------------------------------------------
    This part of the handler interface is used to perform access through
    indexes. The interface is defined as a scan interface but the handler
    can also use key lookup if the index is a unique index or a primary
    key index.
    Index scans are mostly useful for SELECT queries but are an important
    part also of UPDATE, DELETE, REPLACE and CREATE TABLE table AS SELECT
    and so forth.
    Naturally an index is needed for an index scan and indexes can either
    be ordered, hash based. Some ordered indexes can return data in order
    but not necessarily all of them.
    There are many flags that define the behavior of indexes in the
    various handlers. These methods are found in the optimizer module.
    -------------------------------------------------------------------------

    index_read is called to start a scan of an index. The find_flag defines
    the semantics of the scan. These flags are defined in
    include/my_base.h
    index_read_idx is the same but also initializes index before calling doing
    the same thing as index_read. Thus it is similar to index_init followed
    by index_read. This is also how we implement it.

    index_read/index_read_idx does also return the first row. Thus for
    key lookups, the index_read will be the only call to the handler in
    the index scan.

    index_init initializes an index before using it and index_end does
    any end processing needed.
  */
  int index_read_map(uchar * buf, const uchar * key,
                     key_part_map keypart_map,
                     enum ha_rkey_function find_flag) override;
  int index_init(uint idx, bool sorted) override;
  int index_end() override;

  /**
    @breif
    Positions an index cursor to the index specified in the handle. Fetches the
    row if available. If the key value is null, begin at first key of the
    index.
  */
  int index_read_idx_map(uchar *buf, uint index, const uchar *key,
                         key_part_map keypart_map,
                         enum ha_rkey_function find_flag) override;
  /*
    These methods are used to jump to next or previous entry in the index
    scan. There are also methods to jump to first and last entry.
  */
  int index_next(uchar * buf) override;
  int index_prev(uchar * buf) override;
  int index_first(uchar * buf) override;
  int index_last(uchar * buf) override;
  int index_next_same(uchar * buf, const uchar * key, uint keylen) override;

  int index_read_last_map(uchar *buf,
                          const uchar *key,
                          key_part_map keypart_map) override;

  /*
    read_first_row is virtual method but is only implemented by
    handler.cc, no storage engine has implemented it so neither
    will the partition handler.

    int read_first_row(uchar *buf, uint primary_key) override;
  */


  int read_range_first(const key_range * start_key,
                       const key_range * end_key,
                       bool eq_range, bool sorted) override;
  int read_range_next() override;


  HANDLER_BUFFER *m_mrr_buffer;
  uint *m_mrr_buffer_size;
  uchar *m_mrr_full_buffer;
  uint m_mrr_full_buffer_size;
  uint m_mrr_new_full_buffer_size;
  MY_BITMAP m_mrr_used_partitions;
  uint *m_stock_range_seq;
  /* not used: uint m_current_range_seq; */

  /* Value of mrr_mode passed to ha_partition::multi_range_read_init */
  uint m_mrr_mode;

  /* Value of n_ranges passed to ha_partition::multi_range_read_init */
  uint m_mrr_n_ranges;

  /*
    Ordered MRR mode:  m_range_info[N] has the range_id of the last record that
    we've got from partition N
  */
  range_id_t *m_range_info;

  /*
    TRUE <=> This ha_partition::multi_range_read_next() call is the first one
  */
  bool m_multi_range_read_first;

  /* not used: uint m_mrr_range_init_flags; */

  /* Number of elements in the list pointed by m_mrr_range_first. Not used */
  uint m_mrr_range_length;

  /* Linked list of ranges to scan */
  PARTITION_KEY_MULTI_RANGE *m_mrr_range_first;
  PARTITION_KEY_MULTI_RANGE *m_mrr_range_current;

  /*
    For each partition: number of ranges MRR scan will scan in the partition
  */
  uint *m_part_mrr_range_length;

  /* For each partition: List of ranges to scan in this partition */
  PARTITION_PART_KEY_MULTI_RANGE **m_part_mrr_range_first;
  PARTITION_PART_KEY_MULTI_RANGE **m_part_mrr_range_current;
  PARTITION_PART_KEY_MULTI_RANGE_HLD *m_partition_part_key_multi_range_hld;

  /*
    Sequence of ranges to be scanned (TODO: why not store this in
    handler::mrr_{iter,funcs}?)
  */
  range_seq_t m_seq;
  RANGE_SEQ_IF *m_seq_if;

  /* Range iterator structure to be supplied to partitions */
  RANGE_SEQ_IF m_part_seq_if;

  virtual int multi_range_key_create_key(
    RANGE_SEQ_IF *seq,
    range_seq_t seq_it
  );
  ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
                                      void *seq_init_param,
                                      uint n_ranges, uint *bufsz,
                                      uint *mrr_mode,
                                      Cost_estimate *cost) override;
  ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
                                uint key_parts, uint *bufsz,
                                uint *mrr_mode, Cost_estimate *cost) override;
  int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
                            uint n_ranges, uint mrr_mode,
                            HANDLER_BUFFER *buf) override;
  int multi_range_read_next(range_id_t *range_info) override;
  int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
    override;
  uint last_part() { return m_last_part; }

private:
  bool init_record_priority_queue();
  void destroy_record_priority_queue();
  int common_index_read(uchar * buf, bool have_start_key);
  int common_first_last(uchar * buf);
  int partition_scan_set_up(uchar * buf, bool idx_read_flag);
  bool check_parallel_search();
  int handle_pre_scan(bool reverse_order, bool use_parallel);
  int handle_unordered_next(uchar * buf, bool next_same);
  int handle_unordered_scan_next_partition(uchar * buf);
  int handle_ordered_index_scan(uchar * buf, bool reverse_order);
  int handle_ordered_index_scan_key_not_found();
  int handle_ordered_next(uchar * buf, bool next_same);
  int handle_ordered_prev(uchar * buf);
  void return_top_record(uchar * buf);
  void swap_blobs(uchar* rec_buf, Ordered_blob_storage ** storage, bool restore);
public:
  /*
    -------------------------------------------------------------------------
    MODULE information calls
    -------------------------------------------------------------------------
    This calls are used to inform the handler of specifics of the ongoing
    scans and other actions. Most of these are used for optimisation
    purposes.
    -------------------------------------------------------------------------
  */
  int info(uint) override;
  void get_dynamic_partition_info(PARTITION_STATS *stat_info, uint part_id)
    override;
  void set_partitions_to_open(List<String> *partition_names) override;
  int change_partitions_to_open(List<String> *partition_names) override;
  int open_read_partitions(char *name_buff, size_t name_buff_size);
  int extra(enum ha_extra_function operation) override;
  int extra_opt(enum ha_extra_function operation, ulong arg) override;
  int reset() override;
  uint count_query_cache_dependant_tables(uint8 *tables_type) override;
  my_bool register_query_cache_dependant_tables(THD *thd,
                                                Query_cache *cache,
                                                Query_cache_block_table **block,
                                                uint *n) override;

private:
  typedef int handler_callback(handler *, void *);

  my_bool reg_query_cache_dependant_table(THD *thd,
                                          char *engine_key,
                                          uint engine_key_len,
                                          char *query_key, uint query_key_len,
                                          uint8 type,
                                          Query_cache *cache,
                                          Query_cache_block_table
                                          **block_table,
                                          handler *file, uint *n);
  static const uint NO_CURRENT_PART_ID= NOT_A_PARTITION_ID;
  int loop_partitions(handler_callback callback, void *param);
  int loop_partitions_over_map(const MY_BITMAP *map,
                               handler_callback callback,
                               void *param);
  int loop_read_partitions(handler_callback callback, void *param);
  int loop_extra_alter(enum ha_extra_function operations);
  void late_extra_cache(uint partition_id);
  void late_extra_no_cache(uint partition_id);
  void prepare_extra_cache(uint cachesize);
  handler *get_open_file_sample() const { return m_file_sample; }
public:

  /*
    -------------------------------------------------------------------------
    MODULE optimiser support
    -------------------------------------------------------------------------
    -------------------------------------------------------------------------
  */

  /*
    NOTE !!!!!!
     -------------------------------------------------------------------------
     -------------------------------------------------------------------------
     One important part of the public handler interface that is not depicted in
     the methods is the attribute records

     which is defined in the base class. This is looked upon directly and is
     set by calling info(HA_STATUS_INFO) ?
     -------------------------------------------------------------------------
  */

private:
  /* Helper functions for optimizer hints. */
  ha_rows min_rows_for_estimate();
  uint get_biggest_used_partition(uint *part_index);
public:

  /*
    keys_to_use_for_scanning can probably be implemented as the
    intersection of all underlying handlers if mixed handlers are used.
    This method is used to derive whether an index can be used for
    index-only scanning when performing an ORDER BY query.
    Only called from one place in sql_select.cc
  */
  const key_map *keys_to_use_for_scanning() override;

  /*
    Called in test_quick_select to determine if indexes should be used.
  */
  double scan_time() override;

  double key_scan_time(uint inx) override;

  double keyread_time(uint inx, uint ranges, ha_rows rows) override;

  /*
    The next method will never be called if you do not implement indexes.
  */
  double read_time(uint index, uint ranges, ha_rows rows) override;
  /*
    For the given range how many records are estimated to be in this range.
    Used by optimiser to calculate cost of using a particular index.
  */
  ha_rows records_in_range(uint inx,
                           const key_range * min_key,
                           const key_range * max_key,
                           page_range *pages) override;

  /*
    Upper bound of number records returned in scan is sum of all
    underlying handlers.
  */
  ha_rows estimate_rows_upper_bound() override;

  /*
    table_cache_type is implemented by the underlying handler but all
    underlying handlers must have the same implementation for it to work.
  */
  uint8 table_cache_type() override;
  ha_rows records() override;

  /* Calculate hash value for PARTITION BY KEY tables. */
  static uint32 calculate_key_hash_value(Field **field_array);

  /*
    -------------------------------------------------------------------------
    MODULE print messages
    -------------------------------------------------------------------------
    This module contains various methods that returns text messages for
    table types, index type and error messages.
    -------------------------------------------------------------------------
  */
  /*
    The name of the index type that will be used for display
    Here we must ensure that all handlers use the same index type
    for each index created.
  */
  const char *index_type(uint inx) override;

  /* The name of the table type that will be used for display purposes */
  const char *real_table_type() const override;
  /* The name of the row type used for the underlying tables. */
  enum row_type get_row_type() const override;

  /*
     Handler specific error messages
  */
  void print_error(int error, myf errflag) override;
  bool get_error_message(int error, String * buf) override;
  /*
   -------------------------------------------------------------------------
    MODULE handler characteristics
    -------------------------------------------------------------------------
    This module contains a number of methods defining limitations and
    characteristics of the handler. The partition handler will calculate
    this characteristics based on underlying handler characteristics.
    -------------------------------------------------------------------------

    This is a list of flags that says what the storage engine
    implements. The current table flags are documented in handler.h
    The partition handler will support whatever the underlying handlers
    support except when specifically mentioned below about exceptions
    to this rule.
    NOTE: This cannot be cached since it can depend on TRANSACTION ISOLATION
    LEVEL which is dynamic, see bug#39084.

    HA_TABLE_SCAN_ON_INDEX:
    Used to avoid scanning full tables on an index. If this flag is set then
    the handler always has a primary key (hidden if not defined) and this
    index is used for scanning rather than a full table scan in all
    situations.
    (InnoDB, Federated)

    HA_REC_NOT_IN_SEQ:
    This flag is set for handlers that cannot guarantee that the rows are
    returned according to incremental positions (0, 1, 2, 3...).
    This also means that rnd_next() should return HA_ERR_RECORD_DELETED
    if it finds a deleted row.
    (MyISAM (not fixed length row), HEAP, InnoDB)

    HA_CAN_GEOMETRY:
    Can the storage engine handle spatial data.
    Used to check that no spatial attributes are declared unless
    the storage engine is capable of handling it.
    (MyISAM)

    HA_FAST_KEY_READ:
    Setting this flag indicates that the handler is equally fast in
    finding a row by key as by position.
    This flag is used in a very special situation in conjunction with
    filesort's. For further explanation see intro to init_read_record.
    (HEAP, InnoDB)

    HA_NULL_IN_KEY:
    Is NULL values allowed in indexes.
    If this is not allowed then it is not possible to use an index on a
    NULLable field.
    (HEAP, MyISAM, InnoDB)

    HA_DUPLICATE_POS:
    Tells that we can the position for the conflicting duplicate key
    record is stored in table->file->dupp_ref. (insert uses rnd_pos() on
    this to find the duplicated row)
    (MyISAM)

    HA_CAN_INDEX_BLOBS:
    Is the storage engine capable of defining an index of a prefix on
    a BLOB attribute.
    (Federated, MyISAM, InnoDB)

    HA_AUTO_PART_KEY:
    Auto increment fields can be part of a multi-part key. For second part
    auto-increment keys, the auto_incrementing is done in handler.cc
    (Federated, MyISAM)

    HA_REQUIRE_PRIMARY_KEY:
    Can't define a table without primary key (and cannot handle a table
    with hidden primary key)
    (No handler has this limitation currently)

    HA_STATS_RECORDS_IS_EXACT:
    Does the counter of records after the info call specify an exact
    value or not. If it does this flag is set.
    Only MyISAM and HEAP uses exact count.

    HA_CAN_INSERT_DELAYED:
    Can the storage engine support delayed inserts.
    To start with the partition handler will not support delayed inserts.
    Further investigation needed.
    (HEAP, MyISAM)

    HA_PRIMARY_KEY_IN_READ_INDEX:
    This parameter is set when the handler will also return the primary key
    when doing read-only-key on another index.

    HA_NOT_DELETE_WITH_CACHE:
    Seems to be an old MyISAM feature that is no longer used. No handler
    has it defined but it is checked in init_read_record.
    Further investigation needed.
    (No handler defines it)

    HA_NO_PREFIX_CHAR_KEYS:
    Indexes on prefixes of character fields is not allowed.
    (Federated)

    HA_CAN_FULLTEXT:
    Does the storage engine support fulltext indexes
    The partition handler will start by not supporting fulltext indexes.
    (MyISAM)

    HA_CAN_SQL_HANDLER:
    Can the HANDLER interface in the MySQL API be used towards this
    storage engine.
    (MyISAM, InnoDB)

    HA_NO_AUTO_INCREMENT:
    Set if the storage engine does not support auto increment fields.
    (Currently not set by any handler)

    HA_HAS_CHECKSUM:
    Special MyISAM feature. Has special SQL support in CREATE TABLE.
    No special handling needed by partition handler.
    (MyISAM)

    HA_FILE_BASED:
    Should file names always be in lower case (used by engines
    that map table names to file names.
    Since partition handler has a local file this flag is set.
    (Federated, MyISAM)

    HA_CAN_BIT_FIELD:
    Is the storage engine capable of handling bit fields?
    (MyISAM)

    HA_NEED_READ_RANGE_BUFFER:
    Is Read Multi-Range supported => need multi read range buffer
    This parameter specifies whether a buffer for read multi range
    is needed by the handler. Whether the handler supports this
    feature or not is dependent of whether the handler implements
    read_multi_range* calls or not. The only handler currently
    supporting this feature is NDB so the partition handler need
    not handle this call. There are methods in handler.cc that will
    transfer those calls into index_read and other calls in the
    index scan module.
    (No handler defines it)

    HA_PRIMARY_KEY_REQUIRED_FOR_POSITION:
    Does the storage engine need a PK for position?
    (InnoDB)

    HA_FILE_BASED is always set for partition handler since we use a
    special file for handling names of partitions, engine types.
    HA_REC_NOT_IN_SEQ is always set for partition handler since we cannot
    guarantee that the records will be returned in sequence.
    HA_DUPLICATE_POS,
    HA_CAN_INSERT_DELAYED, HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is disabled
    until further investigated.
  */
  Table_flags table_flags() const override;

  /*
    This is a bitmap of flags that says how the storage engine
    implements indexes. The current index flags are documented in
    handler.h. If you do not implement indexes, just return zero
    here.

    part is the key part to check. First key part is 0
    If all_parts it's set, MySQL want to know the flags for the combined
    index up to and including 'part'.

    HA_READ_NEXT:
    Does the index support read next, this is assumed in the server
    code and never checked so all indexes must support this.
    Note that the handler can be used even if it doesn't have any index.
    (HEAP, MyISAM, Federated, InnoDB)

    HA_READ_PREV:
    Can the index be used to scan backwards.
    (HEAP, MyISAM, InnoDB)

    HA_READ_ORDER:
    Can the index deliver its record in index order. Typically true for
    all ordered indexes and not true for hash indexes.
    In first step this is not true for partition handler until a merge
    sort has been implemented in partition handler.
    Used to set keymap part_of_sortkey
    This keymap is only used to find indexes usable for resolving an ORDER BY
    in the query. Thus in most cases index_read will work just fine without
    order in result production. When this flag is set it is however safe to
    order all output started by index_read since most engines do this. With
    read_multi_range calls there is a specific flag setting order or not
    order so in those cases ordering of index output can be avoided.
    (InnoDB, HEAP, MyISAM)

    HA_READ_RANGE:
    Specify whether index can handle ranges, typically true for all
    ordered indexes and not true for hash indexes.
    Used by optimiser to check if ranges (as key >= 5) can be optimised
    by index.
    (InnoDB, MyISAM, HEAP)

    HA_ONLY_WHOLE_INDEX:
    Can't use part key searches. This is typically true for hash indexes
    and typically not true for ordered indexes.
    (Federated, HEAP)

    HA_KEYREAD_ONLY:
    Does the storage engine support index-only scans on this index.
    Enables use of HA_EXTRA_KEYREAD and HA_EXTRA_NO_KEYREAD
    Used to set key_map keys_for_keyread and to check in optimiser for
    index-only scans.  When doing a read under HA_EXTRA_KEYREAD the handler
    only have to fill in the columns the key covers. If
    HA_PRIMARY_KEY_IN_READ_INDEX is set then also the PRIMARY KEY columns
    must be updated in the row.
    (InnoDB, MyISAM)
  */
  ulong index_flags(uint inx, uint part, bool all_parts) const override
  {
    /*
      The following code is not safe if you are using different
      storage engines or different index types per partition.
    */
    ulong part_flags= m_file[0]->index_flags(inx, part, all_parts);

    /*
      The underlying storage engine might support Rowid Filtering. But
      ha_partition does not forward the needed SE API calls, so the feature
      will not be used.

      Note: It's the same with IndexConditionPushdown, except for its variant
      of IndexConditionPushdown+BatchedKeyAccess (that one works). Because of
      that, we do not clear HA_DO_INDEX_COND_PUSHDOWN here.
    */
    return part_flags & ~HA_DO_RANGE_FILTER_PUSHDOWN;
  }

  /**
    wrapper function for handlerton alter_table_flags, since
    the ha_partition_hton cannot know all its capabilities
  */
  alter_table_operations alter_table_flags(alter_table_operations flags)
    override;
  /*
    unireg.cc will call the following to make sure that the storage engine
    can handle the data it is about to send.

    The maximum supported values is the minimum of all handlers in the table
  */
  uint min_of_the_max_uint(uint (handler::*operator_func)(void) const) const;
  uint max_supported_record_length() const override;
  uint max_supported_keys() const override;
  uint max_supported_key_parts() const override;
  uint max_supported_key_length() const override;
  uint max_supported_key_part_length() const override;
  uint min_record_length(uint options) const override;

  /*
    -------------------------------------------------------------------------
    MODULE compare records
    -------------------------------------------------------------------------
    cmp_ref checks if two references are the same. For most handlers this is
    a simple memcmp of the reference. However some handlers use primary key
    as reference and this can be the same even if memcmp says they are
    different. This is due to character sets and end spaces and so forth.
    For the partition handler the reference is first two bytes providing the
    partition identity of the referred record and then the reference of the
    underlying handler.
    Thus cmp_ref for the partition handler always returns FALSE for records
    not in the same partition and uses cmp_ref on the underlying handler
    to check whether the rest of the reference part is also the same.
    -------------------------------------------------------------------------
  */
  int cmp_ref(const uchar * ref1, const uchar * ref2) override;
  /*
    -------------------------------------------------------------------------
    MODULE auto increment
    -------------------------------------------------------------------------
    This module is used to handle the support of auto increments.

    This variable in the handler is used as part of the handler interface
    It is maintained by the parent handler object and should not be
    touched by child handler objects (see handler.cc for its use).

    auto_increment_column_changed
     -------------------------------------------------------------------------
  */
  bool need_info_for_auto_inc() override;
  bool can_use_for_auto_inc_init() override;
  void get_auto_increment(ulonglong offset, ulonglong increment,
                          ulonglong nb_desired_values,
                          ulonglong *first_value,
                          ulonglong *nb_reserved_values) override;
  void release_auto_increment() override;
private:
  int reset_auto_increment(ulonglong value) override;
  int update_next_auto_inc_val();
  virtual void lock_auto_increment()
  {
    /* lock already taken */
    if (auto_increment_safe_stmt_log_lock)
      return;
    if (table_share->tmp_table == NO_TMP_TABLE)
    {
      part_share->lock_auto_inc();
      DBUG_ASSERT(!auto_increment_lock);
      auto_increment_lock= TRUE;
    }
  }
  virtual void unlock_auto_increment()
  {
    /*
      If auto_increment_safe_stmt_log_lock is true, we have to keep the lock.
      It will be set to false and thus unlocked at the end of the statement by
      ha_partition::release_auto_increment.
    */
    if (auto_increment_lock && !auto_increment_safe_stmt_log_lock)
    {
      auto_increment_lock= FALSE;
      part_share->unlock_auto_inc();
    }
  }
  virtual void set_auto_increment_if_higher(Field *field)
  {
    ulonglong nr= (((Field_num*) field)->unsigned_flag ||
                   field->val_int() > 0) ? field->val_int() : 0;
    update_next_auto_inc_val();
    lock_auto_increment();
    /* must check when the mutex is taken */
    if (nr >= part_share->next_auto_inc_val)
      part_share->next_auto_inc_val= nr + 1;
    unlock_auto_increment();
  }

  void check_insert_or_replace_autoincrement()
  {
    /*
      If we INSERT or REPLACE into the table having the AUTO_INCREMENT column,
      we have to read all partitions for the next autoincrement value
      unless we already did it.
    */
    if (!part_share->auto_inc_initialized &&
        (ha_thd()->lex->sql_command == SQLCOM_INSERT ||
         ha_thd()->lex->sql_command == SQLCOM_INSERT_SELECT ||
         ha_thd()->lex->sql_command == SQLCOM_REPLACE ||
         ha_thd()->lex->sql_command == SQLCOM_REPLACE_SELECT) &&
        table->found_next_number_field)
      bitmap_set_all(&m_part_info->read_partitions);
  }

public:

  /*
     -------------------------------------------------------------------------
     MODULE initialize handler for HANDLER call
     -------------------------------------------------------------------------
     This method is a special InnoDB method called before a HANDLER query.
     -------------------------------------------------------------------------
  */
  void init_table_handle_for_HANDLER() override;

  /*
    The remainder of this file defines the handler methods not implemented
    by the partition handler
  */

  /*
    -------------------------------------------------------------------------
    MODULE foreign key support
    -------------------------------------------------------------------------
    The following methods are used to implement foreign keys as supported by
    InnoDB. Implement this ??
    get_foreign_key_create_info is used by SHOW CREATE TABLE to get a textual
    description of how the CREATE TABLE part to define FOREIGN KEY's is done.
    free_foreign_key_create_info is used to free the memory area that provided
    this description.
    can_switch_engines checks if it is ok to switch to a new engine based on
    the foreign key info in the table.
    -------------------------------------------------------------------------

    virtual char* get_foreign_key_create_info()
    virtual void free_foreign_key_create_info(char* str)

    virtual int get_foreign_key_list(THD *thd,
    List<FOREIGN_KEY_INFO> *f_key_list)
    bool referenced_by_foreign_key() const noexcept override
  */
    bool can_switch_engines() override;
  /*
    -------------------------------------------------------------------------
    MODULE fulltext index
    -------------------------------------------------------------------------
  */
    void ft_close_search(FT_INFO *handler);
    int ft_init() override;
    int pre_ft_init() override;
    void ft_end() override;
    int pre_ft_end() override;
    FT_INFO *ft_init_ext(uint flags, uint inx, String *key) override;
    int ft_read(uchar *buf) override;
    int pre_ft_read(bool use_parallel) override;

  /*
     -------------------------------------------------------------------------
     MODULE restart full table scan at position (MyISAM)
     -------------------------------------------------------------------------
     The following method is only used by MyISAM when used as
     temporary tables in a join.
     int restart_rnd_next(uchar *buf, uchar *pos) override;
  */

  /*
    -------------------------------------------------------------------------
    MODULE in-place ALTER TABLE
    -------------------------------------------------------------------------
    These methods are in the handler interface. (used by innodb-plugin)
    They are used for in-place alter table:
    -------------------------------------------------------------------------
  */
    enum_alter_inplace_result
      check_if_supported_inplace_alter(TABLE *altered_table,
                                       Alter_inplace_info *ha_alter_info)
      override;
    bool prepare_inplace_alter_table(TABLE *altered_table,
                                     Alter_inplace_info *ha_alter_info)
      override;
    bool inplace_alter_table(TABLE *altered_table,
                            Alter_inplace_info *ha_alter_info) override;
    bool commit_inplace_alter_table(TABLE *altered_table,
                                    Alter_inplace_info *ha_alter_info,
                                    bool commit) override;
  /*
    -------------------------------------------------------------------------
    MODULE tablespace support
    -------------------------------------------------------------------------
    Admin of table spaces is not applicable to the partition handler (InnoDB)
    This means that the following method is not implemented:
    -------------------------------------------------------------------------
    virtual int discard_or_import_tablespace(my_bool discard)
  */

  /*
    -------------------------------------------------------------------------
    MODULE admin MyISAM
    -------------------------------------------------------------------------

    -------------------------------------------------------------------------
      OPTIMIZE TABLE, CHECK TABLE, ANALYZE TABLE and REPAIR TABLE are
      mapped to a routine that handles looping over a given set of
      partitions and those routines send a flag indicating to execute on
      all partitions.
    -------------------------------------------------------------------------
  */
    int optimize(THD* thd, HA_CHECK_OPT *check_opt) override;
    int analyze(THD* thd, HA_CHECK_OPT *check_opt) override;
    int check(THD* thd, HA_CHECK_OPT *check_opt) override;
    int repair(THD* thd, HA_CHECK_OPT *check_opt) override;
    bool check_and_repair(THD *thd) override;
    bool auto_repair(int error) const override;
    bool is_crashed() const override;
    int check_for_upgrade(HA_CHECK_OPT *check_opt) override;

  /*
    -------------------------------------------------------------------------
    MODULE condition pushdown
    -------------------------------------------------------------------------
  */
    const COND *cond_push(const COND *cond) override;
    void cond_pop() override;
    int info_push(uint info_type, void *info) override;

    private:
    int handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, uint flags);
    int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, uint part_id,
                        uint flag);
    /**
      Check if the rows are placed in the correct partition.  If the given
      argument is true, then move the rows to the correct partition.
    */
    int check_misplaced_rows(uint read_part_id, bool repair);
    void append_row_to_str(String &str);
    public:

    int pre_calculate_checksum() override;
    int calculate_checksum() override;

  /* Enabled keycache for performance reasons, WL#4571 */
    int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt) override;
    int preload_keys(THD* thd, HA_CHECK_OPT* check_opt) override;
    TABLE_LIST *get_next_global_for_child() override;

  /*
    -------------------------------------------------------------------------
    MODULE enable/disable indexes
    -------------------------------------------------------------------------
    Enable/Disable Indexes are only supported by HEAP and MyISAM.
    -------------------------------------------------------------------------
  */
    int disable_indexes(key_map map, bool persist) override;
    int enable_indexes(key_map map, bool persist) override;
    int indexes_are_disabled() override;

  /*
    -------------------------------------------------------------------------
    MODULE append_create_info
    -------------------------------------------------------------------------
    append_create_info is only used by MyISAM MERGE tables and the partition
    handler will not support this handler as underlying handler.
    Implement this??
    -------------------------------------------------------------------------
    virtual void append_create_info(String *packet)
  */

  /*
    the following heavily relies on the fact that all partitions
    are in the same storage engine.

    When this limitation is lifted, the following hack should go away,
    and a proper interface for engines needs to be introduced:

      an PARTITION_SHARE structure that has a pointer to the TABLE_SHARE.
      is given to engines everywhere where TABLE_SHARE is used now
      has members like option_struct, ha_data
      perhaps TABLE needs to be split the same way too...

    this can also be done before partition will support a mix of engines,
    but preferably together with other incompatible API changes.
  */
  handlerton *partition_ht() const override
  {
    handlerton *h= m_file[0]->ht;
    for (uint i=1; i < m_tot_parts; i++)
      DBUG_ASSERT(h == m_file[i]->ht);
    return h;
  }

  bool partition_engine() override { return 1;}
  ha_rows part_records(partition_element *part_elem)
  {
    DBUG_ASSERT(m_part_info);
    uint32 sub_factor= m_part_info->num_subparts ? m_part_info->num_subparts : 1;
    uint32 part_id= part_elem->id * sub_factor;
    uint32 part_id_end= part_id + sub_factor;
    DBUG_ASSERT(part_id_end <= m_tot_parts);
    ha_rows part_recs= 0;
    for (; part_id < part_id_end; ++part_id)
    {
      handler *file= m_file[part_id];
      file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK | HA_STATUS_OPEN);
      part_recs+= file->stats.records;
    }
    return part_recs;
  }

  int notify_tabledef_changed(LEX_CSTRING *db, LEX_CSTRING *table,
                              LEX_CUSTRING *frm, LEX_CUSTRING *version);

  friend int cmp_key_rowid_part_id(void *ptr, const void *ref1,
                                   const void *ref2);
  friend int cmp_key_part_id(void *key_p, const void *ref1, const void *ref2);

  bool can_convert_nocopy(const Field &field,
                          const Column_definition &new_field) const override;
  void handler_stats_updated() override;
};
#endif /* HA_PARTITION_INCLUDED */
server/private/sql_window.h000064400000015236150400263740012073 0ustar00/*
   Copyright (c) 2016, 2022 MariaDB

   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-1301  USA */

#ifndef SQL_WINDOW_INCLUDED
#define SQL_WINDOW_INCLUDED

#include "filesort.h"

class Item_window_func;

/*
  Window functions module. 
  
  Each instance of window function has its own element in SELECT_LEX::window_specs.
*/


class Window_frame_bound : public Sql_alloc
{

public:
 
  enum Bound_precedence_type
  {
    PRECEDING,
    CURRENT,           // Used for CURRENT ROW window frame bounds
    FOLLOWING
  };

  Bound_precedence_type precedence_type;
 

  /* 
    For UNBOUNDED PRECEDING / UNBOUNDED FOLLOWING window frame bounds
    precedence type is seto to PRECEDING / FOLLOWING and
    offset is set to NULL. 
    The offset is not meaningful with precedence type CURRENT 
  */
  Item *offset;

  Window_frame_bound(Bound_precedence_type prec_type,
                     Item *offset_val)
    : precedence_type(prec_type), offset(offset_val) {}

  bool is_unbounded() { return offset == NULL; }

  void print(String *str, enum_query_type query_type);

};


class Window_frame : public Sql_alloc
{
  
public:

  enum Frame_units
  {
    UNITS_ROWS,
    UNITS_RANGE
  };

  enum Frame_exclusion
  {
    EXCL_NONE,
    EXCL_CURRENT_ROW,
    EXCL_GROUP,
    EXCL_TIES
  };

  Frame_units units;

  Window_frame_bound *top_bound;

  Window_frame_bound *bottom_bound;

  Frame_exclusion exclusion;

  Window_frame(Frame_units win_frame_units,
               Window_frame_bound *win_frame_top_bound,
               Window_frame_bound *win_frame_bottom_bound,
               Frame_exclusion win_frame_exclusion)
    : units(win_frame_units), top_bound(win_frame_top_bound),
      bottom_bound(win_frame_bottom_bound), exclusion(win_frame_exclusion) {}

  bool check_frame_bounds();

  void print(String *str, enum_query_type query_type);

};

class Window_spec : public Sql_alloc
{
  bool window_names_are_checked;
 public:
  virtual ~Window_spec() = default;

  LEX_CSTRING *window_ref;

  SQL_I_List<ORDER> *partition_list;
  SQL_I_List<ORDER> *save_partition_list;

  SQL_I_List<ORDER> *order_list;
  SQL_I_List<ORDER> *save_order_list;

  Window_frame *window_frame;

  Window_spec *referenced_win_spec;

  /*
    Window_spec objects are numbered by the number of their appearance in the
    query. This is used by compare_order_elements() to provide a predictable
    ordering of PARTITION/ORDER BY clauses.
  */
  int win_spec_number;

  Window_spec(LEX_CSTRING *win_ref, SQL_I_List<ORDER> *part_list,
              SQL_I_List<ORDER> *ord_list, Window_frame *win_frame)
    : window_names_are_checked(false), window_ref(win_ref),
      partition_list(part_list), save_partition_list(NULL),
      order_list(ord_list), save_order_list(NULL),
      window_frame(win_frame), referenced_win_spec(NULL) {}

  virtual const char *name() { return NULL; }

  bool check_window_names(List_iterator_fast<Window_spec> &it);

  const char *window_reference()
  {
    return window_ref ? window_ref->str : NULL;
  }

  void join_partition_and_order_lists()
  {
    *(partition_list->next)= order_list->first;
  }

  void disjoin_partition_and_order_lists()
  {
    *(partition_list->next)= NULL;
  }

  void print(String *str, enum_query_type query_type);
  void print_order(String *str, enum_query_type query_type);
  void print_partition(String *str, enum_query_type query_type);

};

class Window_def : public Window_spec
{
 public:

  LEX_CSTRING *window_name;

  Window_def(LEX_CSTRING *win_name,
             LEX_CSTRING *win_ref, 
             SQL_I_List<ORDER> *part_list,
             SQL_I_List<ORDER> *ord_list,
             Window_frame *win_frame) 
    : Window_spec(win_ref, part_list, ord_list, win_frame),
      window_name(win_name) {}
 
  const char *name() override { return window_name->str; }

};

int setup_windows(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
	          List<Item> &fields, List<Item> &all_fields, 
                  List<Window_spec> &win_specs, List<Item_window_func> &win_funcs);


//////////////////////////////////////////////////////////////////////////////
// Classes that make window functions computation a part of SELECT's query plan
//////////////////////////////////////////////////////////////////////////////

class Frame_cursor;
/*
  This handles computation of one window function.

  Currently, we make a spearate filesort() call for each window function.
*/

class Window_func_runner : public Sql_alloc
{
public:
  /* Add the function to be computed during the execution pass  */
  bool add_function_to_run(Item_window_func *win_func);

  /* Compute and fill the fields in the table. */
  bool exec(THD *thd, TABLE *tbl, SORT_INFO *filesort_result);

private:
  /* A list of window functions for which this Window_func_runner will compute
     values during the execution phase. */
  List<Item_window_func> window_functions;
};


/*
  Represents a group of window functions that require the same sorting of 
  rows and so share the filesort() call.

*/

class Window_funcs_sort : public Sql_alloc
{
public:
  bool setup(THD *thd, SQL_SELECT *sel, List_iterator<Item_window_func> &it,
             st_join_table *join_tab);
  bool exec(JOIN *join, bool keep_filesort_result);
  void cleanup() { delete filesort; }

  friend class Window_funcs_computation;

private:
  Window_func_runner runner;

  /* Window functions can be computed over this sorting */
  Filesort *filesort;
};


struct st_join_table;
class Explain_aggr_window_funcs;

/*
  This is a "window function computation phase": a single object of this class
  takes care of computing all window functions in a SELECT.

  - JOIN optimizer is exected to call setup() during query optimization.
  - JOIN::exec() should call exec() once it has collected join output in a
    temporary table.
*/

class Window_funcs_computation : public Sql_alloc
{
  List<Window_funcs_sort> win_func_sorts;
public:
  bool setup(THD *thd, List<Item_window_func> *window_funcs, st_join_table *tab);
  bool exec(JOIN *join, bool keep_last_filesort_result);

  Explain_aggr_window_funcs *save_explain_plan(MEM_ROOT *mem_root, bool is_analyze);
  void cleanup();
};


#endif /* SQL_WINDOW_INCLUDED */
server/private/pfs_statement_provider.h000064400000010373150400263740014470 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_STATEMENT_PROVIDER_H
#define PFS_STATEMENT_PROVIDER_H

/**
  @file include/pfs_statement_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_STATEMENT_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_STATEMENT_CALL(M) pfs_ ## M ## _v1
#define PSI_DIGEST_CALL(M) pfs_ ## M ## _v1

C_MODE_START

void pfs_register_statement_v1(const char *category,
                               PSI_statement_info_v1 *info,
                               int count);

PSI_statement_locker*
pfs_get_thread_statement_locker_v1(PSI_statement_locker_state *state,
                                   PSI_statement_key key,
                                   const void *charset,
                                   PSI_sp_share *sp_share);

PSI_statement_locker*
pfs_refine_statement_v1(PSI_statement_locker *locker,
                        PSI_statement_key key);

void pfs_start_statement_v1(PSI_statement_locker *locker,
                            const char *db, uint db_len,
                            const char *src_file, uint src_line);

void pfs_set_statement_text_v1(PSI_statement_locker *locker,
                               const char *text, uint text_len);

void pfs_set_statement_lock_time_v1(PSI_statement_locker *locker,
                                    ulonglong count);

void pfs_set_statement_rows_sent_v1(PSI_statement_locker *locker,
                                    ulonglong count);

void pfs_set_statement_rows_examined_v1(PSI_statement_locker *locker,
                                        ulonglong count);

void pfs_inc_statement_created_tmp_disk_tables_v1(PSI_statement_locker *locker,
                                                  ulong count);

void pfs_inc_statement_created_tmp_tables_v1(PSI_statement_locker *locker,
                                             ulong count);

void pfs_inc_statement_select_full_join_v1(PSI_statement_locker *locker,
                                           ulong count);

void pfs_inc_statement_select_full_range_join_v1(PSI_statement_locker *locker,
                                                 ulong count);

void pfs_inc_statement_select_range_v1(PSI_statement_locker *locker,
                                       ulong count);

void pfs_inc_statement_select_range_check_v1(PSI_statement_locker *locker,
                                             ulong count);

void pfs_inc_statement_select_scan_v1(PSI_statement_locker *locker,
                                      ulong count);

void pfs_inc_statement_sort_merge_passes_v1(PSI_statement_locker *locker,
                                            ulong count);

void pfs_inc_statement_sort_range_v1(PSI_statement_locker *locker,
                                     ulong count);

void pfs_inc_statement_sort_rows_v1(PSI_statement_locker *locker,
                                    ulong count);

void pfs_inc_statement_sort_scan_v1(PSI_statement_locker *locker,
                                    ulong count);

void pfs_set_statement_no_index_used_v1(PSI_statement_locker *locker);

void pfs_set_statement_no_good_index_used_v1(PSI_statement_locker *locker);

void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da);

PSI_digest_locker *pfs_digest_start_v1(PSI_statement_locker *locker);

void pfs_digest_end_v1(PSI_digest_locker *locker,
                       const sql_digest_storage *digest);

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_STATEMENT_INTERFACE */

#endif

server/private/scheduler.h000064400000006177150400263740011667 0ustar00#ifndef SCHEDULER_INCLUDED
#define SCHEDULER_INCLUDED

/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2012, Monty Program Ab

   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 */

/*
  Classes for the thread scheduler
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface
#endif

class THD;

/* Functions used when manipulating threads */

struct scheduler_functions
{
  uint max_threads;
  Atomic_counter<uint> *connection_count;
  ulong *max_connections;
  bool (*init)(void);
  void (*add_connection)(CONNECT *connect);
  void (*thd_wait_begin)(THD *thd, int wait_type);
  void (*thd_wait_end)(THD *thd);
  void (*post_kill_notification)(THD *thd);
  void (*end)(void);
  /** resume previous unfinished command (threadpool only)*/
  void (*thd_resume)(THD* thd);
};


/**
  Scheduler types enumeration.

  The default of --thread-handling is the first one in the
  thread_handling_names array, this array has to be consistent with
  the order in this array, so to change default one has to change the
  first entry in this enum and the first entry in the
  thread_handling_names array.

  @note The last entry of the enumeration is also used to mark the
  thread handling as dynamic. In this case the name of the thread
  handling is fetched from the name of the plugin that implements it.
*/
enum scheduler_types
{
  /*
    The default of --thread-handling is the first one in the
    thread_handling_names array, this array has to be consistent with
    the order in this array, so to change default one has to change
    the first entry in this enum and the first entry in the
    thread_handling_names array.
  */
  SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
  SCHEDULER_NO_THREADS,
  SCHEDULER_TYPES_COUNT
};

void one_thread_per_connection_scheduler(scheduler_functions *func,
    ulong *arg_max_connections, Atomic_counter<uint> *arg_connection_count);
void one_thread_scheduler(scheduler_functions *func, Atomic_counter<uint> *arg_connection_count);

extern void scheduler_init();
extern void post_kill_notification(THD *);
/*
 To be used for pool-of-threads (implemeneted differently on various OSs)
*/
struct thd_scheduler
{
public:
  void *data;                  /* scheduler-specific data structure */
};

#ifdef HAVE_POOL_OF_THREADS
void pool_of_threads_scheduler(scheduler_functions* func,
   ulong *arg_max_connections,
   Atomic_counter<uint> *arg_connection_count);
#else
#define pool_of_threads_scheduler(A,B,C) \
  one_thread_per_connection_scheduler(A, B, C)
#endif /*HAVE_POOL_OF_THREADS*/

#endif /* SCHEDULER_INCLUDED */
server/private/item_row.h000064400000012145150400263740011526 0ustar00#ifndef ITEM_ROW_INCLUDED
#define ITEM_ROW_INCLUDED

/*
   Copyright (c) 2002, 2013, Oracle and/or its affiliates.

   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 */

/**
  Row items used for comparing rows and IN operations on rows:

  @verbatim
  (a, b, c) > (10, 10, 30)
  (a, b, c) = (select c, d, e, from t1 where x=12)
  (a, b, c) IN ((1,2,2), (3,4,5), (6,7,8)
  (a, b, c) IN (select c, d, e, from t1)
  @endverbatim
*/


/**
   Item which stores (x,y,...) and ROW(x,y,...).
   Note that this can be recursive: ((x,y),(z,t)) is a ROW of ROWs.
*/
class Item_row: public Item_fixed_hybrid,
                private Item_args,
                private Used_tables_and_const_cache
{
  table_map not_null_tables_cache;
  /**
    If elements are made only of constants, of which one or more are
    NULL. For example, this item is (1,2,NULL), or ( (1,NULL), (2,3) ).
  */
  bool with_null;
public:
  Item_row(THD *thd, List<Item> &list)
   :Item_fixed_hybrid(thd), Item_args(thd, list),
    not_null_tables_cache(0), with_null(0)
  { }
  Item_row(THD *thd, Item_row *row)
   :Item_fixed_hybrid(thd), Item_args(thd, static_cast<Item_args*>(row)),
    Used_tables_and_const_cache(),
    not_null_tables_cache(0), with_null(0)
  { }

  enum Type type() const override { return ROW_ITEM; };
  const Type_handler *type_handler() const override { return &type_handler_row; }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    return NULL; // Check with Vicentiu why it's called for Item_row
  }
  void illegal_method_call(const char *);
  bool is_null() override { return null_value; }
  void make_send_field(THD *thd, Send_field *) override
  {
    illegal_method_call((const char*)"make_send_field");
  };
  double val_real() override
  {
    illegal_method_call((const char*)"val");
    return 0;
  };
  longlong val_int() override
  {
    illegal_method_call((const char*)"val_int");
    return 0;
  };
  String *val_str(String *) override
  {
    illegal_method_call((const char*)"val_str");
    return 0;
  };
  my_decimal *val_decimal(my_decimal *) override
  {
    illegal_method_call((const char*)"val_decimal");
    return 0;
  };
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    illegal_method_call((const char*)"get_date");
    return true;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  void cleanup() override;
  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
                      List<Item> &fields, uint flags) override;
  table_map used_tables() const override { return used_tables_cache; };
  bool const_item() const override { return const_item_cache; };
  void update_used_tables() override
  {
    used_tables_and_const_cache_init();
    used_tables_and_const_cache_update_and_join(arg_count, args);
  }
  table_map not_null_tables() const override { return not_null_tables_cache; }
  void print(String *str, enum_query_type query_type) override;

  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    if (walk_args(processor, walk_subquery, arg))
      return true;
    return (this->*processor)(arg);
  }
  Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
  bool eval_not_null_tables(void *opt_arg) override;
  bool find_not_null_fields(table_map allowed) override;

  uint cols() const override { return arg_count; }
  Item* element_index(uint i) override { return args[i]; }
  Item** addr(uint i) override { return args + i; }
  bool check_cols(uint c) override;
  bool null_inside() override { return with_null; };
  void bring_value() override;

  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    Item_args::propagate_equal_fields(thd, Context_identity(), cond);
    return this;
  }

  bool excl_dep_on_table(table_map tab_map) override
  {
    return Item_args::excl_dep_on_table(tab_map);
  }

  bool excl_dep_on_grouping_fields(st_select_lex *sel) override
  {
    return Item_args::excl_dep_on_grouping_fields(sel);
  }

  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override
  {
    return Item_args::excl_dep_on_in_subq_left_part(subq_pred);
  }

  bool check_vcol_func_processor(void *arg) override {return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_row>(thd, this); }
  Item *do_build_clone(THD *thd) const override;
};

#endif /* ITEM_ROW_INCLUDED */
server/private/rpl_parallel.h000064400000042065150400263740012356 0ustar00#ifndef RPL_PARALLEL_H
#define RPL_PARALLEL_H

#include "log_event.h"


struct rpl_parallel;
struct rpl_parallel_entry;
struct rpl_parallel_thread_pool;
extern struct rpl_parallel_thread_pool pool_bkp_for_pfs;

class Relay_log_info;
struct inuse_relaylog;


/*
  Structure used to keep track of the parallel replication of a batch of
  event-groups that group-committed together on the master.

  It is used to ensure that every event group in one batch has reached the
  commit stage before the next batch starts executing.

  Note the lifetime of this structure:

   - It is allocated when the first event in a new batch of group commits
     is queued, from the free list rpl_parallel_entry::gco_free_list.

   - The gco for the batch currently being queued is owned by
     rpl_parallel_entry::current_gco. The gco for a previous batch that has
     been fully queued is owned by the gco->prev_gco pointer of the gco for
     the following batch.

   - The worker thread waits on gco->COND_group_commit_orderer for
     rpl_parallel_entry::count_committing_event_groups to reach wait_count
     before starting; the first waiter links the gco into the next_gco
     pointer of the gco of the previous batch for signalling.

   - When an event group reaches the commit stage, it signals the
     COND_group_commit_orderer if its gco->next_gco pointer is non-NULL and
     rpl_parallel_entry::count_committing_event_groups has reached
     gco->next_gco->wait_count.

   - The gco lives until all its event groups have completed their commit.
     This is detected by rpl_parallel_entry::last_committed_sub_id being
     greater than or equal gco->last_sub_id. Once this happens, the gco is
     freed. Note that since update of last_committed_sub_id can happen
     out-of-order, the thread that frees a given gco can be for any later
     event group, not necessarily an event group from the gco being freed.
*/
struct group_commit_orderer {
  /* Wakeup condition, used with rpl_parallel_entry::LOCK_parallel_entry. */
  mysql_cond_t COND_group_commit_orderer;
  uint64 wait_count;
  group_commit_orderer *prev_gco;
  group_commit_orderer *next_gco;
  /*
    The sub_id of last event group in the previous GCO.
    Only valid if prev_gco != NULL.
  */
  uint64 prior_sub_id;
  /*
    The sub_id of the last event group in this GCO. Only valid when next_gco
    is non-NULL.
  */
  uint64 last_sub_id;
  /*
    This flag is set when this GCO has been installed into the next_gco pointer
    of the previous GCO.
  */
  bool installed;

  enum force_switch_bits
  {
    /*
      This flag is set for a GCO in which we have event groups with multiple
      different commit_id values from the master. This happens when we
      optimistically try to execute in parallel transactions not known to be
      conflict-free.

      When this flag is set, in case of DDL we need to start a new GCO
      regardless of current commit_id, as DDL is not safe to
      speculatively apply in parallel with prior event groups.
    */
    MULTI_BATCH= 1,
    /*
      This flag is set for a GCO that contains DDL. If set, it forces
      a switch to a new GCO upon seeing a new commit_id, as DDL is not
      safe to speculatively replicate in parallel with subsequent
      transactions.
    */
    FORCE_SWITCH= 2
  };
  uint8 flags;
#ifndef DBUG_OFF
  /*
    Flag set when the GCO has been freed and entered the free list, to catch
    (in debug) errors in the complex lifetime of this object.
  */
  bool gc_done;
#endif
};


struct rpl_parallel_thread {
  bool delay_start;
  bool running;
  bool stop;
  bool pause_for_ftwrl;
  mysql_mutex_t LOCK_rpl_thread;
  mysql_cond_t COND_rpl_thread;
  mysql_cond_t COND_rpl_thread_queue;
  mysql_cond_t COND_rpl_thread_stop;
  struct rpl_parallel_thread *next;             /* For free list. */
  struct rpl_parallel_thread_pool *pool;
  THD *thd;
  /*
    Who owns the thread, if any (it's a pointer into the
    rpl_parallel_entry::rpl_threads array.
  */
  struct rpl_parallel_thread **current_owner;
  /* The rpl_parallel_entry of the owner. */
  rpl_parallel_entry *current_entry;
  struct queued_event {
    queued_event *next;
    /*
      queued_event can hold either an event to be executed, or just a binlog
      position to be updated without any associated event.
    */
    enum queued_event_t {
      QUEUED_EVENT,
      QUEUED_POS_UPDATE,
      QUEUED_MASTER_RESTART
    } typ;
    union {
      Log_event *ev;                            /* QUEUED_EVENT */
      rpl_parallel_entry *entry_for_queued;     /* QUEUED_POS_UPDATE and
                                                   QUEUED_MASTER_RESTART */
    };
    rpl_group_info *rgi;
    inuse_relaylog *ir;
    ulonglong future_event_relay_log_pos;
    char event_relay_log_name[FN_REFLEN];
    char future_event_master_log_name[FN_REFLEN];
    ulonglong event_relay_log_pos;
    my_off_t future_event_master_log_pos;
    size_t event_size;
  } *event_queue, *last_in_queue;
  uint64 queued_size;
  /* These free lists are protected by LOCK_rpl_thread. */
  queued_event *qev_free_list;
  rpl_group_info *rgi_free_list;
  group_commit_orderer *gco_free_list;
  /*
    These free lists are local to the thread, so need not be protected by any
    lock. They are moved to the global free lists in batches in the function
    batch_free(), to reduce LOCK_rpl_thread contention.

    The lists are not NULL-terminated (as we do not need to traverse them).
    Instead, if they are non-NULL, the loc_XXX_last_ptr_ptr points to the
    `next' pointer of the last element, which is used to link into the front
    of the global freelists.
  */
  queued_event *loc_qev_list, **loc_qev_last_ptr_ptr;
  size_t loc_qev_size;
  uint64 qev_free_pending;
  rpl_group_info *loc_rgi_list, **loc_rgi_last_ptr_ptr;
  group_commit_orderer *loc_gco_list, **loc_gco_last_ptr_ptr;
  /* These keep track of batch update of inuse_relaylog refcounts. */
  inuse_relaylog *accumulated_ir_last;
  uint64 accumulated_ir_count;

  char channel_name[MAX_CONNECTION_NAME];
  uint channel_name_length;
  rpl_gtid last_seen_gtid;
  int last_error_number;
  char last_error_message[MAX_SLAVE_ERRMSG];
  ulonglong last_error_timestamp;
  ulonglong worker_idle_time;
  ulong last_trans_retry_count;
  ulonglong start_time;
  void start_time_tracker()
  {
    start_time= microsecond_interval_timer();
  }
  ulonglong compute_time_lapsed()
  {
    return (ulonglong)((microsecond_interval_timer() - start_time) / 1000000.0);
  }
  void add_to_worker_idle_time_and_reset()
  {
    worker_idle_time+= compute_time_lapsed();
    start_time=0;
  }
  ulonglong get_worker_idle_time()
  {
    if (start_time)
      return (worker_idle_time + compute_time_lapsed());
    else
      return worker_idle_time;
  }
  void enqueue(queued_event *qev)
  {
    if (last_in_queue)
      last_in_queue->next= qev;
    else
      event_queue= qev;
    last_in_queue= qev;
    queued_size+= qev->event_size;
  }

  void dequeue1(queued_event *list)
  {
    DBUG_ASSERT(list == event_queue);
    event_queue= last_in_queue= NULL;
  }

  void dequeue2(size_t dequeue_size)
  {
    queued_size-= dequeue_size;
  }

  queued_event *get_qev_common(Log_event *ev, ulonglong event_size);
  queued_event *get_qev(Log_event *ev, ulonglong event_size,
                        Relay_log_info *rli);
  queued_event *retry_get_qev(Log_event *ev, queued_event *orig_qev,
                              const char *relay_log_name,
                              ulonglong event_pos, ulonglong event_size);
  /*
    Put a qev on the local free list, to be later released to the global free
    list by batch_free().
  */
  void loc_free_qev(queued_event *qev);
  /*
    Release an rgi immediately to the global free list. Requires holding the
    LOCK_rpl_thread mutex.
  */
  void free_qev(queued_event *qev);
  rpl_group_info *get_rgi(Relay_log_info *rli, Gtid_log_event *gtid_ev,
                          rpl_parallel_entry *e, ulonglong event_size);
  /*
    Put an gco on the local free list, to be later released to the global free
    list by batch_free().
  */
  void loc_free_rgi(rpl_group_info *rgi);
  /*
    Release an rgi immediately to the global free list. Requires holding the
    LOCK_rpl_thread mutex.
  */
  void free_rgi(rpl_group_info *rgi);
  group_commit_orderer *get_gco(uint64 wait_count, group_commit_orderer *prev,
                                uint64 first_sub_id);
  /*
    Put a gco on the local free list, to be later released to the global free
    list by batch_free().
  */
  void loc_free_gco(group_commit_orderer *gco);
  /*
    Move all local free lists to the global ones. Requires holding
    LOCK_rpl_thread.
  */
  void batch_free();
  /* Update inuse_relaylog refcounts with what we have accumulated so far. */
  void inuse_relaylog_refcount_update();
  rpl_parallel_thread();
};


struct pool_bkp_for_pfs{
  uint32 count;
  bool inited, is_valid;
  struct rpl_parallel_thread **rpl_thread_arr;
  void init(uint32 thd_count)
  {
    DBUG_ASSERT(thd_count);
    rpl_thread_arr= (rpl_parallel_thread **)
                      my_malloc(PSI_INSTRUMENT_ME,
                                thd_count * sizeof(rpl_parallel_thread*),
                                MYF(MY_WME | MY_ZEROFILL));
    for (uint i=0; i<thd_count; i++)
      rpl_thread_arr[i]= (rpl_parallel_thread *)
                          my_malloc(PSI_INSTRUMENT_ME, sizeof(rpl_parallel_thread),
                                    MYF(MY_WME | MY_ZEROFILL));
    count= thd_count;
    inited= true;
  }

  void destroy()
  {
    if (inited)
    {
      for (uint i=0; i<count; i++)
        my_free(rpl_thread_arr[i]);

      my_free(rpl_thread_arr);
      rpl_thread_arr= NULL;
    }
    inited= false;
  }
};

struct rpl_parallel_thread_pool {
  struct rpl_parallel_thread **threads;
  struct rpl_parallel_thread *free_list;
  mysql_mutex_t LOCK_rpl_thread_pool;
  mysql_cond_t COND_rpl_thread_pool;
  uint32 count;
  bool inited;
  /*
    While FTWRL runs, this counter is incremented to make SQL thread or
    STOP/START slave not try to start new activity while that operation
    is in progress.
  */
  bool busy;
  struct pool_bkp_for_pfs pfs_bkp;

  rpl_parallel_thread_pool();
  void copy_pool_for_pfs(Relay_log_info *rli);
  int init(uint32 size);
  void destroy();
  void deactivate();
  void destroy_cond_mutex();
  struct rpl_parallel_thread *get_thread(rpl_parallel_thread **owner,
                                         rpl_parallel_entry *entry);
  void release_thread(rpl_parallel_thread *rpt);
};


struct rpl_parallel_entry {
  /*
    A small struct to put worker threads references into a FIFO (using an
    I_List) for round-robin scheduling.
  */
  struct sched_bucket : public ilink {
    sched_bucket() : thr(nullptr) { }
    rpl_parallel_thread *thr;
  };
  /*
    A struct to keep track of into which "generation" an XA XID was last
    scheduled. A "generation" means that we know that every worker thread
    slot in the rpl_parallel_entry was scheduled at least once. When more
    that two generations have passed, we can safely reuse the XID in a
    different worker.
  */
  struct xid_active_generation {
    uint64 generation;
    sched_bucket *thr;
    xid_t xid;
  };

  mysql_mutex_t LOCK_parallel_entry;
  mysql_cond_t COND_parallel_entry;
  uint32 domain_id;
  /*
    Incremented by wait_for_workers_idle() and rpl_pause_for_ftwrl() to show
    that they are waiting, so that finish_event_group knows to signal them
    when last_committed_sub_id is increased.
  */
  uint32 need_sub_id_signal;
  uint64 last_commit_id;
  bool active;
  /*
    Set when SQL thread is shutting down, and no more events can be processed,
    so worker threads must force abort any current transactions without
    waiting for event groups to complete.
  */
  bool force_abort;
  /*
   At STOP SLAVE (force_abort=true), we do not want to process all events in
   the queue (which could unnecessarily delay stop, if a lot of events happen
   to be queued). The stop_sub_id provides a safe point at which to stop, so
   that everything before becomes committed and nothing after does. The value
   corresponds to rpl_group_info::gtid_sub_id; if that is less than or equal
   to stop_sub_id, we execute the associated event group, else we skip it (and
   all following) and stop.
  */
  uint64 stop_sub_id;

  /*
    Array recording the last rpl_thread_max worker threads that we
    queued event for. This is used to limit how many workers a single domain
    can occupy (--slave-domain-parallel-threads).

    The array is structured as a FIFO using an I_List thread_sched_fifo.

    Note that workers are never explicitly deleted from the array. Instead,
    we need to check (under LOCK_rpl_thread) that the thread still belongs
    to us before re-using (rpl_thread::current_owner).
  */
  sched_bucket *rpl_threads;
  I_List<sched_bucket> *thread_sched_fifo;
  uint32 rpl_thread_max;
  /*
    Keep track of all XA XIDs that may still be active in a worker thread.
    The elements are of type xid_active_generation.
  */
  DYNAMIC_ARRAY maybe_active_xid;
  /*
    Keeping track of the current scheduling generation.

    A new generation means that every worker thread in the rpl_threads array
    have been scheduled at least one event group.

    When we have scheduled to slot current_generation_idx= 0, 1, ..., N-1 in this
    order, we know that (at least) one generation has passed.
  */
  uint64 current_generation;
  uint32 current_generation_idx;

  /*
    The sub_id of the last transaction to commit within this domain_id.
    Must be accessed under LOCK_parallel_entry protection.

    Event groups commit in order, so the rpl_group_info for an event group
    will be alive (at least) as long as
    rpl_group_info::gtid_sub_id > last_committed_sub_id. This can be used to
    safely refer back to previous event groups if they are still executing,
    and ignore them if they completed, without requiring explicit
    synchronisation between the threads.
  */
  uint64 last_committed_sub_id;
  /*
    The sub_id of the last event group in this replication domain that was
    queued for execution by a worker thread.
  */
  uint64 current_sub_id;
  /*
    The largest sub_id that has started its transaction. Protected by
    LOCK_parallel_entry.

    (Transactions can start out-of-order, so this value signifies that no
    transactions with larger sub_id have started, but not necessarily that all
    transactions with smaller sub_id have started).
  */
  uint64 largest_started_sub_id;
  rpl_group_info *current_group_info;
  /*
    If we get an error in some event group, we set the sub_id of that event
    group here. Then later event groups (with higher sub_id) can know not to
    try to start (event groups that already started will be rolled back when
    wait_for_prior_commit() returns error).
    The value is ULONGLONG_MAX when no error occurred.
  */
  uint64 stop_on_error_sub_id;
  /*
    During FLUSH TABLES WITH READ LOCK, transactions with sub_id larger than
    this value must not start, but wait until the global read lock is released.
    The value is set to ULONGLONG_MAX when no FTWRL is pending.
  */
  uint64 pause_sub_id;
  /* Total count of event groups queued so far. */
  uint64 count_queued_event_groups;
  /*
    Count of event groups that have started (but not necessarily completed)
    the commit phase. We use this to know when every event group in a previous
    batch of master group commits have started committing on the slave, so
    that it is safe to start executing the events in the following batch.
  */
  uint64 count_committing_event_groups;
  /* The group_commit_orderer object for the events currently being queued. */
  group_commit_orderer *current_gco;

  void check_scheduling_generation(sched_bucket *cur);
  sched_bucket *check_xa_xid_dependency(xid_t *xid);
  rpl_parallel_thread * choose_thread(rpl_group_info *rgi, bool *did_enter_cond,
                                      PSI_stage_info *old_stage,
                                      Gtid_log_event *gtid_ev);
  int queue_master_restart(rpl_group_info *rgi,
                           Format_description_log_event *fdev);
  /*
    the initial size of maybe_ array corresponds to the case of
    each worker receives perhaps unlikely XA-PREPARE and XA-COMMIT within
    the same generation.
  */
  inline uint active_xid_init_alloc() { return 3 * 2 * rpl_thread_max; }
};
struct rpl_parallel {
  HASH domain_hash;
  rpl_parallel_entry *current;
  bool sql_thread_stopping;

  rpl_parallel();
  ~rpl_parallel();
  void reset();
  rpl_parallel_entry *find(uint32 domain_id);
  void wait_for_done(THD *thd, Relay_log_info *rli);
  void stop_during_until();
  int wait_for_workers_idle(THD *thd);
  int do_event(rpl_group_info *serial_rgi, Log_event *ev, ulonglong event_size);

  static bool workers_idle(Relay_log_info *rli);
};


extern struct rpl_parallel_thread_pool global_rpl_thread_pool;


extern void wait_for_pending_deadlock_kill(THD *thd, rpl_group_info *rgi);
extern int rpl_parallel_resize_pool_if_no_slaves(void);
extern int rpl_parallel_activate_pool(rpl_parallel_thread_pool *pool);
extern int rpl_parallel_inactivate_pool(rpl_parallel_thread_pool *pool);
extern bool process_gtid_for_restart_pos(Relay_log_info *rli, rpl_gtid *gtid);
extern int rpl_pause_for_ftwrl(THD *thd);
extern void rpl_unpause_after_ftwrl(THD *thd);

#endif  /* RPL_PARALLEL_H */
server/private/wsrep_condition_variable.h000064400000002714150400263740014755 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_CONDITION_VARIABLE_H
#define WSREP_CONDITION_VARIABLE_H

/* wsrep-lib */
#include "wsrep/condition_variable.hpp"

/* implementation */
#include "my_pthread.h"

class Wsrep_condition_variable : public wsrep::condition_variable
{
public:

  Wsrep_condition_variable(mysql_cond_t* cond)
    : m_cond(cond)
  { }
  ~Wsrep_condition_variable() = default;

  void notify_one() override
  {
    mysql_cond_signal(m_cond);
  }

  void notify_all() override
  {
    mysql_cond_broadcast(m_cond);
  }

  void wait(wsrep::unique_lock<wsrep::mutex>& lock) override
  {
    mysql_mutex_t* mutex= static_cast<mysql_mutex_t*>(lock.mutex()->native());
    mysql_cond_wait(m_cond, mutex);
  }
private:
  mysql_cond_t* m_cond;
};

#endif /* WSREP_CONDITION_VARIABLE_H */
server/private/sql_type_real.h000064400000002351150400263740012542 0ustar00/* Copyright (c) 2019 MariaDB

   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-1301  USA */

#ifndef SQL_TYPE_REAL_INCLUDED
#define SQL_TYPE_REAL_INCLUDED

#include <cmath>

class Float
{
  float m_value;
public:
  Float(float nr)
   :m_value(nr)
  {
    DBUG_ASSERT(!std::isnan(nr));
    DBUG_ASSERT(!std::isinf(nr));
  }
  Float(double nr)
   :m_value((float) nr)
  {
    DBUG_ASSERT(!std::isnan(nr));
    DBUG_ASSERT(!std::isinf(nr));
    DBUG_ASSERT(nr <= FLT_MAX);
    DBUG_ASSERT(nr >= -FLT_MAX);
  }
  Float(const uchar *ptr)
  {
    float4get(m_value, ptr);
  }
  bool to_string(String *to, uint dec) const;
};


#endif // SQL_TYPE_REAL_INCLUDED
server/private/thr_timer.h000064400000003033150400263750011673 0ustar00/* Copyright (c) 2014 Monty Program Ab

   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 or later 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 */

/* Prototypes when using thr_timer functions */

#ifndef THR_TIMER_INCLUDED
#define THR_TIMER_INCLUDED
#ifdef	__cplusplus
extern "C" {
#endif

typedef struct st_timer {
  struct timespec expire_time;
  ulonglong period;
  my_bool expired;
  uint index_in_queue;
  void (*func)(void*);
  void *func_arg;
} thr_timer_t;

/* Main functions for library */
my_bool init_thr_timer(uint init_size_for_timer_queue);
void end_thr_timer();

/* Functions for handling one timer */
void thr_timer_init(thr_timer_t *timer_data, void(*function)(void*),
                    void *arg);
void thr_timer_set_period(thr_timer_t* timer_data, ulonglong microseconds);
my_bool thr_timer_settime(thr_timer_t *timer_data, ulonglong microseconds);
void    thr_timer_end(thr_timer_t *timer_data);

#ifdef	__cplusplus
}
#endif /* __cplusplus */
#endif /* THR_TIMER_INCLUDED */
server/private/sql_do.h000064400000001672150400263750011166 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_DO_INCLUDED
#define SQL_DO_INCLUDED

#include "sql_list.h"                           /* List */

class THD;
class Item;

bool mysql_do(THD *thd, List<Item> &values);

#endif /* SQL_DO_INCLUDED */
server/private/item_sum.h000064400000215137150400263750011532 0ustar00#ifndef ITEM_SUM_INCLUDED
#define ITEM_SUM_INCLUDED
/* Copyright (c) 2000, 2013 Oracle and/or its affiliates.
   Copyright (c) 2008, 2023, 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 */


/* classes for sum functions */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include <my_tree.h>
#include "sql_udf.h"                            /* udf_handler */

class Item_sum;
class Aggregator_distinct;
class Aggregator_simple;

/**
  The abstract base class for the Aggregator_* classes.
  It implements the data collection functions (setup/add/clear)
  as either pass-through to the real functionality or
  as collectors into an Unique (for distinct) structure.

  Note that update_field/reset_field are not in that
  class, because they're simply not called when
  GROUP BY/DISTINCT can be handled with help of index on grouped 
  fields (quick_group = 0);
*/

class Aggregator : public Sql_alloc
{
  friend class Item_sum;
  friend class Item_sum_sum;
  friend class Item_sum_count;
  friend class Item_sum_avg;

  /* 
    All members are protected as this class is not usable outside of an 
    Item_sum descendant.
  */
protected:
  /* the aggregate function class to act on */
  Item_sum *item_sum;

public:
  Aggregator (Item_sum *arg): item_sum(arg) {}
  virtual ~Aggregator () = default;                   /* Keep gcc happy */

  enum Aggregator_type { SIMPLE_AGGREGATOR, DISTINCT_AGGREGATOR };
  virtual Aggregator_type Aggrtype() = 0;

  /**
    Called before adding the first row. 
    Allocates and sets up the internal aggregation structures used, 
    e.g. the Unique instance used to calculate distinct.
  */
  virtual bool setup(THD *) = 0;

  /**
    Called when we need to wipe out all the data from the aggregator :
    all the values acumulated and all the state.
    Cleans up the internal structures and resets them to their initial state.
  */
  virtual void clear() = 0;

  /**
    Called when there's a new value to be aggregated.
    Updates the internal state of the aggregator to reflect the new value.
  */
  virtual bool add() = 0;

  /**
    Called when there are no more data and the final value is to be retrieved.
    Finalises the state of the aggregator, so the final result can be retrieved.
  */
  virtual void endup() = 0;

  /** Decimal value of being-aggregated argument */
  virtual my_decimal *arg_val_decimal(my_decimal * value) = 0;
  /** Floating point value of being-aggregated argument */
  virtual double arg_val_real() = 0;
  /**
    NULLness of being-aggregated argument.

    @param use_null_value Optimization: to determine if the argument is NULL
    we must, in the general case, call is_null() on it, which itself might
    call val_*() on it, which might be costly. If you just have called
    arg_val*(), you can pass use_null_value=true; this way, arg_is_null()
    might avoid is_null() and instead do a cheap read of the Item's null_value
    (updated by arg_val*()).
  */
  virtual bool arg_is_null(bool use_null_value) = 0;
};


class st_select_lex;
class Window_spec;

/**
  Class Item_sum is the base class used for special expressions that SQL calls
  'set functions'. These expressions are formed with the help of aggregate
  functions such as SUM, MAX, GROUP_CONCAT etc.

 GENERAL NOTES

  A set function cannot be used in certain positions where expressions are
  accepted. There are some quite explicable restrictions for the usage of 
  set functions.

  In the query:
    SELECT AVG(b) FROM t1 WHERE SUM(b) > 20 GROUP by a
  the usage of the set function AVG(b) is legal, while the usage of SUM(b)
  is illegal. A WHERE condition must contain expressions that can be 
  evaluated for each row of the table. Yet the expression SUM(b) can be
  evaluated only for each group of rows with the same value of column a.
  In the query:
    SELECT AVG(b) FROM t1 WHERE c > 30 GROUP BY a HAVING SUM(b) > 20
  both set function expressions AVG(b) and SUM(b) are legal.

  We can say that in a query without nested selects an occurrence of a
  set function in an expression of the SELECT list or/and in the HAVING
  clause is legal, while in the WHERE clause it's illegal.

  The general rule to detect whether a set function is legal in a query with
  nested subqueries is much more complicated.

  Consider the the following query:
    SELECT t1.a FROM t1 GROUP BY t1.a
      HAVING t1.a > ALL (SELECT t2.c FROM t2 WHERE SUM(t1.b) < t2.c).
  The set function SUM(b) is used here in the WHERE clause of the subquery.
  Nevertheless it is legal since it is under the HAVING clause of the query
  to which this function relates. The expression SUM(t1.b) is evaluated
  for each group defined in the main query, not for groups of the subquery.

  The problem of finding the query where to aggregate a particular
  set function is not so simple as it seems to be.

  In the query: 
    SELECT t1.a FROM t1 GROUP BY t1.a
     HAVING t1.a > ALL(SELECT t2.c FROM t2 GROUP BY t2.c
                         HAVING SUM(t1.a) < t2.c)
  the set function can be evaluated for both outer and inner selects.
  If we evaluate SUM(t1.a) for the outer query then we get the value of t1.a
  multiplied by the cardinality of a group in table t1. In this case 
  in each correlated subquery SUM(t1.a) is used as a constant. But we also
  can evaluate SUM(t1.a) for the inner query. In this case t1.a will be a
  constant for each correlated subquery and summation is performed
  for each group of table t2.
  (Here it makes sense to remind that the query
    SELECT c FROM t GROUP BY a HAVING SUM(1) < a 
  is quite legal in our SQL).

  So depending on what query we assign the set function to we
  can get different result sets.

  The general rule to detect the query where a set function is to be
  evaluated can be formulated as follows.
  Consider a set function S(E) where E is an expression with occurrences
  of column references C1, ..., CN. Resolve these column references against
  subqueries that contain the set function S(E). Let Q be the innermost
  subquery of those subqueries. (It should be noted here that S(E)
  in no way can be evaluated in the subquery embedding the subquery Q,
  otherwise S(E) would refer to at least one unbound column reference)
  If S(E) is used in a construct of Q where set functions are allowed then
  we evaluate S(E) in Q.
  Otherwise we look for a innermost subquery containing S(E) of those where
  usage of S(E) is allowed.

  Let's demonstrate how this rule is applied to the following queries.

  1. SELECT t1.a FROM t1 GROUP BY t1.a
       HAVING t1.a > ALL(SELECT t2.b FROM t2 GROUP BY t2.b
                           HAVING t2.b > ALL(SELECT t3.c FROM t3 GROUP BY t3.c
                                                HAVING SUM(t1.a+t2.b) < t3.c))
  For this query the set function SUM(t1.a+t2.b) depends on t1.a and t2.b
  with t1.a defined in the outermost query, and t2.b defined for its
  subquery. The set function is in the HAVING clause of the subquery and can
  be evaluated in this subquery.

  2. SELECT t1.a FROM t1 GROUP BY t1.a
       HAVING t1.a > ALL(SELECT t2.b FROM t2
                           WHERE t2.b > ALL (SELECT t3.c FROM t3 GROUP BY t3.c
                                               HAVING SUM(t1.a+t2.b) < t3.c))
  Here the set function SUM(t1.a+t2.b)is in the WHERE clause of the second
  subquery - the most upper subquery where t1.a and t2.b are defined.
  If we evaluate the function in this subquery we violate the context rules.
  So we evaluate the function in the third subquery (over table t3) where it
  is used under the HAVING clause.

  3. SELECT t1.a FROM t1 GROUP BY t1.a
       HAVING t1.a > ALL(SELECT t2.b FROM t2
                           WHERE t2.b > ALL (SELECT t3.c FROM t3 
                                               WHERE SUM(t1.a+t2.b) < t3.c))
  In this query evaluation of SUM(t1.a+t2.b) is not legal neither in the second
  nor in the third subqueries. So this query is invalid.

  Mostly set functions cannot be nested. In the query
    SELECT t1.a from t1 GROUP BY t1.a HAVING AVG(SUM(t1.b)) > 20
  the expression SUM(b) is not acceptable, though it is under a HAVING clause.
  Yet it is acceptable in the query:
    SELECT t.1 FROM t1 GROUP BY t1.a HAVING SUM(t1.b) > 20.

  An argument of a set function does not have to be a reference to a table
  column as we saw it in examples above. This can be a more complex expression
    SELECT t1.a FROM t1 GROUP BY t1.a HAVING SUM(t1.b+1) > 20.
  The expression SUM(t1.b+1) has a very clear semantics in this context:
  we sum up the values of t1.b+1 where t1.b varies for all values within a
  group of rows that contain the same t1.a value.

  A set function for an outer query yields a constant within a subquery. So
  the semantics of the query
    SELECT t1.a FROM t1 GROUP BY t1.a
      HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c
                        HAVING AVG(t2.c+SUM(t1.b)) > 20)
  is still clear. For a group of the rows with the same t1.a values we
  calculate the value of SUM(t1.b). This value 's' is substituted in the
  the subquery:
    SELECT t2.c FROM t2 GROUP BY t2.c HAVING AVG(t2.c+s)
  than returns some result set.

  By the same reason the following query with a subquery 
    SELECT t1.a FROM t1 GROUP BY t1.a
      HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c
                        HAVING AVG(SUM(t1.b)) > 20)
  is also acceptable.

 IMPLEMENTATION NOTES

  Three methods were added to the class to check the constraints specified
  in the previous section. These methods utilize several new members.

  The field 'nest_level' contains the number of the level for the subquery
  containing the set function. The main SELECT is of level 0, its subqueries
  are of levels 1, the subqueries of the latter are of level 2 and so on.

  The field 'aggr_level' is to contain the nest level of the subquery
  where the set function is aggregated.

  The field 'max_arg_level' is for the maximum of the nest levels of the
  unbound column references occurred in the set function. A column reference
  is unbound  within a set function if it is not bound by any subquery
  used as a subexpression in this function. A column reference is bound by
  a subquery if it is a reference to the column by which the aggregation
  of some set function that is used in the subquery is calculated.
  For the set function used in the query
    SELECT t1.a FROM t1 GROUP BY t1.a
      HAVING t1.a > ALL(SELECT t2.b FROM t2 GROUP BY t2.b
                          HAVING t2.b > ALL(SELECT t3.c FROM t3 GROUP BY t3.c
                                              HAVING SUM(t1.a+t2.b) < t3.c))
  the value of max_arg_level is equal to 1 since t1.a is bound in the main
  query, and t2.b is bound by the first subquery whose nest level is 1.
  Obviously a set function cannot be aggregated in the subquery whose
  nest level is less than max_arg_level. (Yet it can be aggregated in the
  subqueries whose nest level is greater than max_arg_level.)
  In the query
    SELECT t.a FROM t1 HAVING AVG(t1.a+(SELECT MIN(t2.c) FROM t2))
  the value of the max_arg_level for the AVG set function is 0 since
  the reference t2.c is bound in the subquery.

  The field 'max_sum_func_level' is to contain the maximum of the
  nest levels of the set functions that are used as subexpressions of
  the arguments of the given set function, but not aggregated in any
  subquery within this set function. A nested set function s1 can be
  used within set function s0 only if s1.max_sum_func_level <
  s0.max_sum_func_level. Set function s1 is considered as nested
  for set function s0 if s1 is not calculated in any subquery
  within s0.

  A set function that is used as a subexpression in an argument of another
  set function refers to the latter via the field 'in_sum_func'.

  The condition imposed on the usage of set functions are checked when
  we traverse query subexpressions with the help of the recursive method
  fix_fields. When we apply this method to an object of the class
  Item_sum, first, on the descent, we call the method init_sum_func_check
  that initialize members used at checking. Then, on the ascent, we
  call the method check_sum_func that validates the set function usage
  and reports an error if it is illegal.
  The method register_sum_func serves to link the items for the set functions
  that are aggregated in the embedding (sub)queries. Circular chains of such
  functions are attached to the corresponding st_select_lex structures
  through the field inner_sum_func_list.

  Exploiting the fact that the members mentioned above are used in one
  recursive function we could have allocated them on the thread stack.
  Yet we don't do it now.
  
  We assume that the nesting level of subquries does not exceed 127.
  TODO: to catch queries where the limit is exceeded to make the
  code clean here.  

  @note
  The implementation takes into account the used strategy:
  - Items resolved at optimization phase return 0 from Item_sum::used_tables().
  - Items that depend on the number of join output records, but not columns of
  any particular table (like COUNT(*)), returm 0 from Item_sum::used_tables(),
  but still return false from Item_sum::const_item().
*/

class Item_sum :public Item_func_or_sum
{
  friend class Aggregator_distinct;
  friend class Aggregator_simple;

protected:
  /**
    Aggregator class instance. Not set initially. Allocated only after
    it is determined if the incoming data are already distinct.
  */
  Aggregator *aggr;

private:
  /**
    Used in making ROLLUP. Set for the ROLLUP copies of the original
    Item_sum and passed to create_tmp_field() to cause it to work
    over the temp table buffer that is referenced by
    Item_result_field::result_field.
  */
  bool force_copy_fields;

  /**
    Indicates how the aggregate function was specified by the parser :
    1 if it was written as AGGREGATE(DISTINCT),
    0 if it was AGGREGATE()
  */
  bool with_distinct;

  /* TRUE if this is aggregate function of a window function */
  bool window_func_sum_expr_flag;

public:

  bool has_force_copy_fields() const { return force_copy_fields; }
  bool has_with_distinct()     const { return with_distinct; }

  enum Sumfunctype
  { COUNT_FUNC, COUNT_DISTINCT_FUNC, SUM_FUNC, SUM_DISTINCT_FUNC, AVG_FUNC,
    AVG_DISTINCT_FUNC, MIN_FUNC, MAX_FUNC, STD_FUNC,
    VARIANCE_FUNC, SUM_BIT_FUNC, UDF_SUM_FUNC, GROUP_CONCAT_FUNC,
    ROW_NUMBER_FUNC, RANK_FUNC, DENSE_RANK_FUNC, PERCENT_RANK_FUNC,
    CUME_DIST_FUNC, NTILE_FUNC, FIRST_VALUE_FUNC, LAST_VALUE_FUNC,
    NTH_VALUE_FUNC, LEAD_FUNC, LAG_FUNC, PERCENTILE_CONT_FUNC,
    PERCENTILE_DISC_FUNC, SP_AGGREGATE_FUNC, JSON_ARRAYAGG_FUNC,
    JSON_OBJECTAGG_FUNC
  };

  Item **ref_by; /* pointer to a ref to the object used to register it */
  Item_sum *next; /* next in the circular chain of registered objects  */
  Item_sum *in_sum_func;  /* embedding set function if any */ 
  st_select_lex * aggr_sel; /* select where the function is aggregated       */ 
  int8 nest_level;        /* number of the nesting level of the set function */
  int8 aggr_level;        /* nesting level of the aggregating subquery       */
  int8 max_arg_level;     /* max level of unbound column references          */
  int8 max_sum_func_level;/* max level of aggregation for embedded functions */

  /*
    true  (the default value) means this aggregate function can be computed
          with TemporaryTableWithPartialSums algorithm (see end_update()).
    false means this aggregate function needs OrderedGroupBy algorithm (see
          end_write_group()).
  */
  bool quick_group;
  /*
    This list is used by the check for mixing non aggregated fields and
    sum functions in the ONLY_FULL_GROUP_BY_MODE. We save all outer fields
    directly or indirectly used under this function it as it's unclear
    at the moment of fixing outer field whether it's aggregated or not.
  */
  List<Item_field> outer_fields;

protected:  
  /* 
    Copy of the arguments list to hold the original set of arguments.
    Used in EXPLAIN EXTENDED instead of the current argument list because 
    the current argument list can be altered by usage of temporary tables.
  */
  Item **orig_args, *tmp_orig_args[2];
  
  static size_t ram_limitation(THD *thd);
public:
  // Methods used by ColumnStore
  Item **get_orig_args() const { return orig_args; }
public:  

  void mark_as_sum_func();
  Item_sum(THD *thd): Item_func_or_sum(thd), quick_group(1)
  {
    mark_as_sum_func();
    init_aggregator();
  }
  Item_sum(THD *thd, Item *a): Item_func_or_sum(thd, a), quick_group(1),
    orig_args(tmp_orig_args)
  {
    mark_as_sum_func();
    init_aggregator();
  }
  Item_sum(THD *thd, Item *a, Item *b): Item_func_or_sum(thd, a, b),
    quick_group(1), orig_args(tmp_orig_args)
  {
    mark_as_sum_func();
    init_aggregator();
  }
  Item_sum(THD *thd, List<Item> &list);
  //Copy constructor, need to perform subselects with temporary tables
  Item_sum(THD *thd, Item_sum *item);
  enum Type type() const override { return SUM_FUNC_ITEM; }
  virtual enum Sumfunctype sum_func () const=0;
  bool is_aggr_sum_func()
  {
    switch (sum_func()) {
    case COUNT_FUNC:
    case COUNT_DISTINCT_FUNC:
    case SUM_FUNC:
    case SUM_DISTINCT_FUNC:
    case AVG_FUNC:
    case AVG_DISTINCT_FUNC:
    case MIN_FUNC:
    case MAX_FUNC:
    case STD_FUNC:
    case VARIANCE_FUNC:
    case SUM_BIT_FUNC:
    case UDF_SUM_FUNC:
    case GROUP_CONCAT_FUNC:
    case JSON_ARRAYAGG_FUNC:
      return true;
    default:
      return false;
    }
  }
  /**
    Resets the aggregate value to its default and aggregates the current
    value of its attribute(s).
  */
  inline bool reset_and_add() 
  { 
    aggregator_clear();
    return aggregator_add();
  };

  /*
    Called when new group is started and results are being saved in
    a temporary table. Similarly to reset_and_add() it resets the 
    value to its default and aggregates the value of its 
    attribute(s), but must also store it in result_field. 
    This set of methods (result_item(), reset_field, update_field()) of
    Item_sum is used only if quick_group is not null. Otherwise
    copy_or_same() is used to obtain a copy of this item.
  */
  virtual void reset_field()=0;
  /*
    Called for each new value in the group, when temporary table is in use.
    Similar to add(), but uses temporary table field to obtain current value,
    Updated value is then saved in the field.
  */
  virtual void update_field()=0;
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    null_value=1;
    return FALSE;
  }
  virtual Item *result_item(THD *thd, Field *field);

  void update_used_tables() override;
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override
  {
    /*
      Item_sum (and derivants) of the original WHERE/HAVING clauses
      should already be replaced to Item_aggregate_ref by the time when
      build_equal_items() is called. See Item::split_sum_func2().
    */
    DBUG_ASSERT(0);
    return Item::build_equal_items(thd, inherited, link_item_fields,
                                   cond_equal_ref);
  }
  bool is_null() override { return null_value; }
  /**
    make_const()
    Called if we've managed to calculate the value of this Item in
    opt_sum_query(), hence it can be considered constant at all subsequent
    steps.
  */
  void make_const () 
  { 
    used_tables_cache= 0;
    const_item_cache= true;
  }
  void reset_forced_const() { const_item_cache= false; }
  bool const_during_execution() const override { return false; }
  void print(String *str, enum_query_type query_type) override;
  void fix_num_length_and_dec();

  /**
    Mark an aggregate as having no rows.

    This function is called by the execution engine to assign 'NO ROWS
    FOUND' value to an aggregate item, when the underlying result set
    has no rows. Such value, in a general case, may be different from
    the default value of the item after 'clear()': e.g. a numeric item
    may be initialized to 0 by clear() and to NULL by
    no_rows_in_result().
  */
  void no_rows_in_result() override
  {
    set_aggregator(current_thd, with_distinct ?
                   Aggregator::DISTINCT_AGGREGATOR :
                   Aggregator::SIMPLE_AGGREGATOR);
    aggregator_clear();
  }
  virtual void make_unique() { force_copy_fields= TRUE; }
  virtual Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    return create_tmp_field(root, param->group(), table);
  }
  bool collect_outer_ref_processor(void *param) override;
  bool init_sum_func_check(THD *thd);
  bool check_sum_func(THD *thd, Item **ref);
  bool register_sum_func(THD *thd, Item **ref);
  st_select_lex *depended_from() 
    { return (nest_level == aggr_level ? 0 : aggr_sel); }

  Item *get_arg(uint i) const { return args[i]; }
  Item *set_arg(uint i, THD *thd, Item *new_val);
  uint get_arg_count() const { return arg_count; }
  virtual Item **get_args() { return fixed() ? orig_args : args; }

  /* Initialization of distinct related members */
  void init_aggregator()
  {
    aggr= NULL;
    with_distinct= FALSE;
    force_copy_fields= FALSE;
  }

  /**
    Called to initialize the aggregator.
  */

  inline bool aggregator_setup(THD *thd) { return aggr->setup(thd); };

  /**
    Called to cleanup the aggregator.
  */

  inline void aggregator_clear() { aggr->clear(); }

  /**
    Called to add value to the aggregator.
  */

  inline bool aggregator_add() { return aggr->add(); };

  /* stores the declared DISTINCT flag (from the parser) */
  void set_distinct(bool distinct)
  {
    with_distinct= distinct;
    quick_group= with_distinct ? 0 : 1;
  }

  /*
    Set the type of aggregation : DISTINCT or not.

    May be called multiple times.
  */

  int set_aggregator(THD *thd, Aggregator::Aggregator_type aggregator);

  virtual void clear()= 0;
  virtual bool add()= 0;
  virtual bool setup(THD *thd) { return false; }

  virtual bool supports_removal() const { return false; }
  virtual void remove() { DBUG_ASSERT(0); }

  void cleanup() override;
  bool check_vcol_func_processor(void *arg) override;
  virtual void setup_window_func(THD *thd, Window_spec *window_spec) {}
  void mark_as_window_func_sum_expr() { window_func_sum_expr_flag= true; }
  bool is_window_func_sum_expr() { return window_func_sum_expr_flag; }
  virtual void setup_caches(THD *thd) {};
  virtual void set_partition_row_count(ulonglong count) { DBUG_ASSERT(0); }

  /*
    While most Item_sum descendants employ standard aggregators configured
    through Item_sum::set_aggregator() call, there are exceptions like
    Item_func_group_concat, which implements its own custom aggregators for
    deduplication values.
    This function distinguishes between the use of standard and custom
    aggregators by the object
  */
  virtual bool uses_non_standard_aggregator_for_distinct() const
  { return false; }
};


class Unique;


/**
 The distinct aggregator. 
 Implements AGGFN (DISTINCT ..)
 Collects all the data into an Unique (similarly to what Item_sum
 does currently when with_distinct=true) and then (if applicable) iterates over
 the list of unique values and pumps them back into its object
*/

class Aggregator_distinct : public Aggregator
{
  friend class Item_sum_sum;

  /* 
    flag to prevent consecutive runs of endup(). Normally in endup there are 
    expensive calculations (like walking the distinct tree for example) 
    which we must do only once if there are no data changes.
    We can re-use the data for the second and subsequent val_xxx() calls.
    endup_done set to TRUE also means that the calculated values for
    the aggregate functions are correct and don't need recalculation.
  */
  bool endup_done;

  /*
    Used depending on the type of the aggregate function and the presence of
    blob columns in it:
    - For COUNT(DISTINCT) and no blob fields this points to a real temporary
      table. It's used as a hash table.
    - For AVG/SUM(DISTINCT) or COUNT(DISTINCT) with blob fields only the
      in-memory data structure of a temporary table is constructed.
      It's used by the Field classes to transform data into row format.
  */
  TABLE *table;
  
  /*
    An array of field lengths on row allocated and used only for 
    COUNT(DISTINCT) with multiple columns and no blobs. Used in 
    Aggregator_distinct::composite_key_cmp (called from Unique to compare 
    nodes
  */
  uint32 *field_lengths;

  /*
    Used in conjunction with 'table' to support the access to Field classes 
    for COUNT(DISTINCT). Needed by copy_fields()/copy_funcs().
  */
  TMP_TABLE_PARAM *tmp_table_param;
  
  /*
    If there are no blobs in the COUNT(DISTINCT) arguments, we can use a tree,
    which is faster than heap table. In that case, we still use the table
    to help get things set up, but we insert nothing in it. 
    For AVG/SUM(DISTINCT) we always use this tree (as it takes a single 
    argument) to get the distinct rows.
  */
  Unique *tree;

  /* 
    The length of the temp table row. Must be a member of the class as it
    gets passed down to simple_raw_key_cmp () as a compare function argument
    to Unique. simple_raw_key_cmp () is used as a fast comparison function 
    when the entire row can be binary compared.
  */  
  uint tree_key_length;

  /* 
    Set to true if the result is known to be always NULL.
    If set deactivates creation and usage of the temporary table (in the 
    'table' member) and the Unique instance (in the 'tree' member) as well as 
    the calculation of the final value on the first call to 
    Item_[sum|avg|count]::val_xxx(). 
  */
  bool always_null;

  /**
    When feeding back the data in endup() from Unique/temp table back to
    Item_sum::add() methods we must read the data from Unique (and not
    recalculate the functions that are given as arguments to the aggregate
    function.
    This flag is to tell the arg_*() methods to take the data from the Unique
    instead of calling the relevant val_..() method.
  */
  bool use_distinct_values;

public:
  Aggregator_distinct (Item_sum *sum) :
    Aggregator(sum), table(NULL), tmp_table_param(NULL), tree(NULL),
    always_null(false), use_distinct_values(false) {}
  virtual ~Aggregator_distinct ();
  Aggregator_type Aggrtype() override { return DISTINCT_AGGREGATOR; }

  bool setup(THD *) override;
  void clear() override; 
  bool add() override;
  void endup() override;
  my_decimal *arg_val_decimal(my_decimal * value) override;
  double arg_val_real() override;
  bool arg_is_null(bool use_null_value) override;

  bool unique_walk_function(void *element);
  bool unique_walk_function_for_count(void *element);
  static int composite_key_cmp(void *arg, const void *key1, const void *key2);
};


/**
  The pass-through aggregator. 
  Implements AGGFN (DISTINCT ..) by knowing it gets distinct data on input. 
  So it just pumps them back to the Item_sum descendant class.
*/
class Aggregator_simple : public Aggregator
{
public:

  Aggregator_simple (Item_sum *sum) :
    Aggregator(sum) {}
  Aggregator_type Aggrtype() override { return Aggregator::SIMPLE_AGGREGATOR; }

  bool setup(THD * thd) override { return item_sum->setup(thd); }
  void clear() override { item_sum->clear(); }
  bool add() override { return item_sum->add(); }
  void endup() override {};
  my_decimal *arg_val_decimal(my_decimal * value) override;
  double arg_val_real() override;
  bool arg_is_null(bool use_null_value) override;
};


class Item_sum_num :public Item_sum
{
public:
  Item_sum_num(THD *thd): Item_sum(thd) {}
  Item_sum_num(THD *thd, Item *item_par):
    Item_sum(thd, item_par) {}
  Item_sum_num(THD *thd, Item *a, Item* b):
    Item_sum(thd, a, b) {}
  Item_sum_num(THD *thd, List<Item> &list):
    Item_sum(thd, list) {}
  Item_sum_num(THD *thd, Item_sum_num *item):
    Item_sum(thd, item) {}
  bool fix_fields(THD *, Item **) override;
};


class Item_sum_double :public Item_sum_num
{
public:
  Item_sum_double(THD *thd): Item_sum_num(thd) {}
  Item_sum_double(THD *thd, Item *item_par): Item_sum_num(thd, item_par) {}
  Item_sum_double(THD *thd, List<Item> &list): Item_sum_num(thd, list) {}
  Item_sum_double(THD *thd, Item_sum_double *item) :Item_sum_num(thd, item) {}
  longlong val_int() override
  {
    return val_int_from_real();
  }
  String *val_str(String*str) override
  {
    return val_string_from_real(str);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return val_decimal_from_real(to);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return get_date_from_real(thd, ltime, fuzzydate);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
};


class Item_sum_int :public Item_sum_num
{
public:
  Item_sum_int(THD *thd): Item_sum_num(thd) {}
  Item_sum_int(THD *thd, Item *item_par): Item_sum_num(thd, item_par) {}
  Item_sum_int(THD *thd, List<Item> &list): Item_sum_num(thd, list) {}
  Item_sum_int(THD *thd, Item_sum_int *item) :Item_sum_num(thd, item) {}
  double val_real() override { DBUG_ASSERT(fixed()); return (double) val_int(); }
  String *val_str(String*str) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return get_date_from_int(thd, ltime, fuzzydate);
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=21;
    base_flags&= ~item_base_t::MAYBE_NULL;
    null_value=0;
    return false;
  }
};


class Item_sum_sum :public Item_sum_num,
                   public Type_handler_hybrid_field_type 
{
protected:
  bool direct_added;
  bool direct_reseted_field;
  bool direct_sum_is_null;
  double direct_sum_real;
  double sum;
  my_decimal direct_sum_decimal;
  my_decimal dec_buffs[2];
  uint curr_dec_buff;
  bool fix_length_and_dec() override;

public:
  Item_sum_sum(THD *thd, Item *item_par, bool distinct):
    Item_sum_num(thd, item_par), direct_added(FALSE),
    direct_reseted_field(FALSE)
  {
    set_distinct(distinct);
  }
  Item_sum_sum(THD *thd, Item_sum_sum *item);
  enum Sumfunctype sum_func() const override
  {
    return has_with_distinct() ? SUM_DISTINCT_FUNC : SUM_FUNC;
  }
  void cleanup() override;
  void direct_add(my_decimal *add_sum_decimal);
  void direct_add(double add_sum_real, bool add_sum_is_null);
  void clear() override;
  bool add() override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String*str) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }
  void fix_length_and_dec_double();
  void fix_length_and_dec_decimal();
  void reset_field() override;
  void update_field() override;
  void no_rows_in_result() override {}
  LEX_CSTRING func_name_cstring() const override
  { 
    static LEX_CSTRING name_distinct= { STRING_WITH_LEN("sum(distinct ")};
    static LEX_CSTRING name_normal=   { STRING_WITH_LEN("sum(") };
    return has_with_distinct() ? name_distinct : name_normal;
  }
  Item *copy_or_same(THD* thd) override;
  void remove() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_sum>(thd, this); }

  bool supports_removal() const override
  {
    return true;
  }

private:
  void add_helper(bool perform_removal);
  ulonglong count;
};


class Item_sum_count :public Item_sum_int
{
  bool direct_counted;
  bool direct_reseted_field;
  longlong direct_count;
  longlong count;

  friend class Aggregator_distinct;

  void clear() override;
  bool add() override;
  void cleanup() override;
  void remove() override;

public:
  Item_sum_count(THD *thd, Item *item_par):
    Item_sum_int(thd, item_par), direct_counted(FALSE),
    direct_reseted_field(FALSE), count(0)
  {}

  /**
    Constructs an instance for COUNT(DISTINCT)

    @param list  a list of the arguments to the aggregate function

    This constructor is called by the parser only for COUNT (DISTINCT).
  */

  Item_sum_count(THD *thd, List<Item> &list):
    Item_sum_int(thd, list), direct_counted(FALSE),
    direct_reseted_field(FALSE), count(0)
  {
    set_distinct(TRUE);
  }
  Item_sum_count(THD *thd, Item_sum_count *item):
    Item_sum_int(thd, item), direct_counted(FALSE),
    direct_reseted_field(FALSE), count(item->count)
  {}
  enum Sumfunctype sum_func () const override
  { 
    return has_with_distinct() ? COUNT_DISTINCT_FUNC : COUNT_FUNC; 
  }
  void no_rows_in_result() override { count=0; }
  void make_const(longlong count_arg) 
  { 
    count=count_arg;
    Item_sum::make_const();
  }
  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }
  longlong val_int() override;
  void reset_field() override;
  void update_field() override;
  void direct_add(longlong add_count);
  LEX_CSTRING func_name_cstring() const override
  { 
    static LEX_CSTRING name_distinct= { STRING_WITH_LEN("count(distinct ")};
    static LEX_CSTRING name_normal=   { STRING_WITH_LEN("count(") };
    return has_with_distinct() ? name_distinct : name_normal;
  }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_count>(thd, this); }

  bool supports_removal() const override
  {
    return true;
  }
};


class Item_sum_avg :public Item_sum_sum
{
public:
  // TODO-cvicentiu given that Item_sum_sum now uses a counter of its own, in
  // order to implement remove(), it is possible to remove this member.
  ulonglong count;
  uint prec_increment;
  uint f_precision, f_scale, dec_bin_size;

  Item_sum_avg(THD *thd, Item *item_par, bool distinct):
    Item_sum_sum(thd, item_par, distinct), count(0)
  {}
  Item_sum_avg(THD *thd, Item_sum_avg *item)
    :Item_sum_sum(thd, item), count(item->count),
    prec_increment(item->prec_increment) {}

  void fix_length_and_dec_double();
  void fix_length_and_dec_decimal();
  bool fix_length_and_dec() override;
  enum Sumfunctype sum_func () const override
  {
    return has_with_distinct() ? AVG_DISTINCT_FUNC : AVG_FUNC;
  }
  void clear() override;
  bool add() override;
  void remove() override;
  double val_real() override;
  // In SPs we might force the "wrong" type with select into a declare variable
  longlong val_int() override { return val_int_from_real(); }
  my_decimal *val_decimal(my_decimal *) override;
  String *val_str(String *str) override;
  void reset_field() override;
  void update_field() override;
  Item *result_item(THD *thd, Field *field) override;
  void no_rows_in_result() override {}
  LEX_CSTRING func_name_cstring() const override
  { 
    static LEX_CSTRING name_distinct= { STRING_WITH_LEN("avg(distinct ")};
    static LEX_CSTRING name_normal=   { STRING_WITH_LEN("avg(") };
    return has_with_distinct() ? name_distinct : name_normal;
  }
  Item *copy_or_same(THD* thd) override;
  Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override;
  void cleanup() override
  {
    count= 0;
    Item_sum_sum::cleanup();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_avg>(thd, this); }

  bool supports_removal() const override
  {
    return true;
  }
};


/*
  variance(a) =

  =  sum (ai - avg(a))^2 / count(a) )
  =  sum (ai^2 - 2*ai*avg(a) + avg(a)^2) / count(a)
  =  (sum(ai^2) - sum(2*ai*avg(a)) + sum(avg(a)^2))/count(a) = 
  =  (sum(ai^2) - 2*avg(a)*sum(a) + count(a)*avg(a)^2)/count(a) = 
  =  (sum(ai^2) - 2*sum(a)*sum(a)/count(a) + count(a)*sum(a)^2/count(a)^2 )/count(a) = 
  =  (sum(ai^2) - 2*sum(a)^2/count(a) + sum(a)^2/count(a) )/count(a) = 
  =  (sum(ai^2) - sum(a)^2/count(a))/count(a)

But, this falls prey to catastrophic cancellation.  Instead, use the recurrence formulas

  M_{1} = x_{1}, ~ M_{k} = M_{k-1} + (x_{k} - M_{k-1}) / k newline 
  S_{1} = 0, ~ S_{k} = S_{k-1} + (x_{k} - M_{k-1}) times (x_{k} - M_{k}) newline
  for 2 <= k <= n newline
  ital variance = S_{n} / (n-1)

*/

class Stddev
{
  double m_m;
  double m_s;
  ulonglong m_count;
public:
  Stddev() :m_m(0), m_s(0), m_count(0) { }
  Stddev(double nr) :m_m(nr), m_s(0.0), m_count(1) { }
  Stddev(const uchar *);
  void to_binary(uchar *) const;
  void recurrence_next(double nr);
  double result(bool is_simple_variance);
  ulonglong count() const { return m_count; }
  static uint32 binary_size()
  {
    return (uint32) (sizeof(double) * 2 + sizeof(ulonglong));
  };
};



class Item_sum_variance :public Item_sum_double
{
  Stddev m_stddev;
  bool fix_length_and_dec() override;

public:
  uint sample;
  uint prec_increment;

  Item_sum_variance(THD *thd, Item *item_par, uint sample_arg):
    Item_sum_double(thd, item_par),
    sample(sample_arg)
    {}
  Item_sum_variance(THD *thd, Item_sum_variance *item);
  Sumfunctype sum_func () const override { return VARIANCE_FUNC; }
  void fix_length_and_dec_double();
  void fix_length_and_dec_decimal();
  void clear() override final;
  bool add() override final;
  double val_real() override;
  void reset_field() override final;
  void update_field() override final;
  Item *result_item(THD *thd, Field *field) override;
  void no_rows_in_result() override final {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name_sample= { STRING_WITH_LEN("var_samp(")};
    static LEX_CSTRING name_normal=   { STRING_WITH_LEN("variance(") };
    return sample ? name_sample : name_normal;
  }
  Item *copy_or_same(THD* thd) override;
  Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override
    final;
  void cleanup() override final
  {
    m_stddev= Stddev();
    Item_sum_double::cleanup();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_variance>(thd, this); }
};

/*
   standard_deviation(a) = sqrt(variance(a))
*/

class Item_sum_std final :public Item_sum_variance
{
  public:
  Item_sum_std(THD *thd, Item *item_par, uint sample_arg):
    Item_sum_variance(thd, item_par, sample_arg) {}
  Item_sum_std(THD *thd, Item_sum_std *item)
    :Item_sum_variance(thd, item)
    {}
  enum Sumfunctype sum_func () const override final { return STD_FUNC; }
  double val_real() override final;
  Item *result_item(THD *thd, Field *field) override final;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING std_name= {STRING_WITH_LEN("std(") };
    static LEX_CSTRING stddev_samp_name= {STRING_WITH_LEN("stddev_samp(") };
    return sample ? stddev_samp_name : std_name;
  }
  Item *copy_or_same(THD* thd) override final;
  Item *do_get_copy(THD *thd) const override final
  { return get_item_copy<Item_sum_std>(thd, this); }
};


class Item_sum_hybrid : public Item_sum,
                       public Type_handler_hybrid_field_type
{
public:
  Item_sum_hybrid(THD *thd, Item *item_par):
    Item_sum(thd, item_par),
    Type_handler_hybrid_field_type(&type_handler_slonglong)
  { collation.set(&my_charset_bin); }
  Item_sum_hybrid(THD *thd, Item *a, Item *b):
    Item_sum(thd, a, b),
    Type_handler_hybrid_field_type(&type_handler_slonglong)
  { collation.set(&my_charset_bin); }
  Item_sum_hybrid(THD *thd, Item_sum_hybrid *item)
    :Item_sum(thd, item),
    Type_handler_hybrid_field_type(item)
  { }
  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }
  bool fix_length_and_dec_generic();
  bool fix_length_and_dec_numeric(const Type_handler *h);
  bool fix_length_and_dec_sint_ge0();
  bool fix_length_and_dec_string();
};


// This class is a string or number function depending on num_func
class Arg_comparator;
class Item_cache;
class Item_sum_min_max :public Item_sum_hybrid
{
protected:
  bool direct_added;
  Item *direct_item;
  Item_cache *value, *arg_cache;
  Arg_comparator *cmp;
  int cmp_sign;
  bool was_values;  // Set if we have found at least one row (for max/min only)
  bool was_null_value;

public:
  Item_sum_min_max(THD *thd, Item *item_par,int sign):
    Item_sum_hybrid(thd, item_par),
    direct_added(FALSE), value(0), arg_cache(0), cmp(0),
    cmp_sign(sign), was_values(TRUE)
  { collation.set(&my_charset_bin); }
  Item_sum_min_max(THD *thd, Item_sum_min_max *item)
    :Item_sum_hybrid(thd, item),
    direct_added(FALSE), value(item->value), arg_cache(0),
    cmp_sign(item->cmp_sign), was_values(item->was_values)
  { }
  bool fix_fields(THD *, Item **) override;
  bool fix_length_and_dec() override;
  void setup_hybrid(THD *thd, Item *item, Item *value_arg);
  void clear() override;
  void direct_add(Item *item);
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  void reset_field() override;
  String *val_str(String *) override;
  bool val_native(THD *thd, Native *) override;
  const Type_handler *real_type_handler() const override
  {
    return get_arg(0)->real_type_handler();
  }
  const TYPELIB *get_typelib() const override
  { return args[0]->get_typelib(); }
  void update_field() override;
  void min_max_update_str_field();
  void min_max_update_real_field();
  void min_max_update_int_field();
  void min_max_update_decimal_field();
  void min_max_update_native_field();
  void cleanup() override;
  bool any_value() { return was_values; }
  void no_rows_in_result() override;
  void restore_to_before_no_rows_in_result() override;
  Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override;
  void setup_caches(THD *thd) override
  { setup_hybrid(thd, arguments()[0], NULL); }
};


class Item_sum_min final :public Item_sum_min_max
{
public:
  Item_sum_min(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, 1) {}
  Item_sum_min(THD *thd, Item_sum_min *item) :Item_sum_min_max(thd, item) {}
  enum Sumfunctype sum_func () const override {return MIN_FUNC;}

  bool add() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING sum_name= {STRING_WITH_LEN("min(") };
    return sum_name;
  }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_min>(thd, this); }
};


class Item_sum_max final :public Item_sum_min_max
{
public:
  Item_sum_max(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, -1) {}
  Item_sum_max(THD *thd, Item_sum_max *item) :Item_sum_min_max(thd, item) {}
  enum Sumfunctype sum_func() const override {return MAX_FUNC;}

  bool add() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING sum_name= {STRING_WITH_LEN("max(") };
    return sum_name;
  }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_max>(thd, this); }
};


class Item_sum_bit :public Item_sum_int
{
public:
  Item_sum_bit(THD *thd, Item *item_par, ulonglong reset_arg):
    Item_sum_int(thd, item_par), reset_bits(reset_arg), bits(reset_arg),
    as_window_function(FALSE), num_values_added(0) {}
  Item_sum_bit(THD *thd, Item_sum_bit *item):
    Item_sum_int(thd, item), reset_bits(item->reset_bits), bits(item->bits),
    as_window_function(item->as_window_function),
    num_values_added(item->num_values_added)
  {
    if (as_window_function)
      memcpy(bit_counters, item->bit_counters, sizeof(bit_counters));
  }
  enum Sumfunctype sum_func () const override { return SUM_BIT_FUNC;}
  void clear() override;
  longlong val_int() override;
  void reset_field() override;
  void update_field() override;
  const Type_handler *type_handler() const override
  { return &type_handler_ulonglong; }
  bool fix_length_and_dec() override
  {
    if (args[0]->check_type_can_return_int(func_name_cstring()))
      return true;
    decimals= 0; max_length=21; unsigned_flag= 1;
    base_flags&= ~item_base_t::MAYBE_NULL;
    null_value= 0;
    return FALSE;
  }
  void cleanup() override
  {
    bits= reset_bits;
    if (as_window_function)
      clear_as_window();
    Item_sum_int::cleanup();
  }
  void setup_window_func(THD *, Window_spec *) override
  {
    as_window_function= TRUE;
    clear_as_window();
  }
  void remove() override
  {
    if (as_window_function)
    {
      remove_as_window(args[0]->val_int());
      return;
    }
    // Unless we're counting bits, we can not remove anything.
    DBUG_ASSERT(0);
  }

  bool supports_removal() const override
  {
    return true;
  }

protected:
  enum bit_counters { NUM_BIT_COUNTERS= 64 };
  ulonglong reset_bits,bits;
  /*
    Marks whether the function is to be computed as a window function.
  */
  bool as_window_function;
  // When used as an aggregate window function, we need to store
  // this additional information.
  ulonglong num_values_added;
  ulonglong bit_counters[NUM_BIT_COUNTERS];
  bool add_as_window(ulonglong value);
  bool remove_as_window(ulonglong value);
  bool clear_as_window();
  virtual void set_bits_from_counters()= 0;
};


class Item_sum_or final :public Item_sum_bit
{
public:
  Item_sum_or(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
  Item_sum_or(THD *thd, Item_sum_or *item) :Item_sum_bit(thd, item) {}
  bool add() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING sum_name= {STRING_WITH_LEN("bit_or(") };
    return sum_name;
  }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_or>(thd, this); }

private:
  void set_bits_from_counters() override;
};


class Item_sum_and final :public Item_sum_bit
{
public:
  Item_sum_and(THD *thd, Item *item_par):
    Item_sum_bit(thd, item_par, ULONGLONG_MAX) {}
  Item_sum_and(THD *thd, Item_sum_and *item) :Item_sum_bit(thd, item) {}
  bool add() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING sum_min_name= {STRING_WITH_LEN("bit_and(") };
    return sum_min_name;
  }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_and>(thd, this); }

private:
  void set_bits_from_counters() override;
};

class Item_sum_xor final :public Item_sum_bit
{
public:
  Item_sum_xor(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
  Item_sum_xor(THD *thd, Item_sum_xor *item) :Item_sum_bit(thd, item) {}
  bool add() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING sum_min_name= {STRING_WITH_LEN("bit_xor(") };
    return sum_min_name;
  }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_xor>(thd, this); }

private:
  void set_bits_from_counters() override;
};

class sp_head;
class sp_name;
class Query_arena;
struct st_sp_security_context;

/*
  Item_sum_sp handles STORED AGGREGATE FUNCTIONS

  Each Item_sum_sp represents a custom aggregate function. Inside the
  function's body, we require at least one occurrence of FETCH GROUP NEXT ROW
  instruction. This cursor is what makes custom stored aggregates possible.

  During computation the function's add method is called. This in turn performs
  an execution of the function. The function will execute from the current
  function context (and instruction), if one exists, or from the start if not.
  See Item_sp for more details.

  Upon encounter of FETCH GROUP NEXT ROW instruction, the function will pause
  execution. We assume that the user has performed the necessary additions for
  a row, between two encounters of FETCH GROUP NEXT ROW.

  Example:
  create aggregate function f1(x INT) returns int
  begin
    declare continue handler for not found return s;
    declare s int default 0
    loop
      fetch group next row;
      set s = s + x;
    end loop;
  end

  The function will always stop after an encounter of FETCH GROUP NEXT ROW,
  except (!) on first encounter, as the value for the first row in the
  group is already set in the argument x. This behaviour is done so when
  a user writes a function, he should "logically" include FETCH GROUP NEXT ROW
  before any "add" instructions in the stored function. This means however that
  internally, the first occurrence doesn't stop the function. See the
  implementation of FETCH GROUP NEXT ROW for details as to how it happens.

  Either way, one should assume that after calling "Item_sum_sp::add()" that
  the values for that particular row have been added to the aggregation.

  To produce values for val_xxx methods we need an extra syntactic construct.
  We require a continue handler when "no more rows are available". val_xxx
  methods force a function return by executing the function again, while
  setting a server flag that no more rows have been found. This implies
  that val_xxx methods should only be called once per group however.

  Example:
  DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN ret_val;
*/
class Item_sum_sp :public Item_sum,
                   public Item_sp
{
 private:
  bool execute();

public:
  Item_sum_sp(THD *thd, Name_resolution_context *context_arg, sp_name *name,
              sp_head *sp);

  Item_sum_sp(THD *thd, Name_resolution_context *context_arg, sp_name *name,
              sp_head *sp, List<Item> &list);
  Item_sum_sp(THD *thd, Item_sum_sp *item);

  enum Sumfunctype sum_func () const override
  {
    return SP_AGGREGATE_FUNC;
  }
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  {
    return create_table_field_from_handler(root, table);
  }
  bool fix_length_and_dec() override;
  bool fix_fields(THD *thd, Item **ref) override;
  LEX_CSTRING func_name_cstring() const override;
  const Type_handler *type_handler() const override;
  bool add() override;

  /* val_xx functions */
  longlong val_int() override
  {
    if(execute())
      return 0;
    return sp_result_field->val_int();
  }

  double val_real() override
  {
    if(execute())
      return 0.0;
    return sp_result_field->val_real();
  }

  my_decimal *val_decimal(my_decimal *dec_buf) override
  {
    if(execute())
      return NULL;
    return sp_result_field->val_decimal(dec_buf);
  }

  bool val_native(THD *thd, Native *to) override
  {
    return (null_value= execute()) || sp_result_field->val_native(to);
  }

  String *val_str(String *str) override
  {
    String buf;
    char buff[20];
    buf.set(buff, 20, str->charset());
    buf.length(0);
    if (execute())
      return NULL;
    /*
      result_field will set buf pointing to internal buffer
      of the resul_field. Due to this it will change any time
      when SP is executed. In order to prevent occasional
      corruption of returned value, we make here a copy.
    */
    sp_result_field->val_str(&buf);
    str->copy(buf);
    return str;
  }
  void reset_field() override{DBUG_ASSERT(0);}
  void update_field() override{DBUG_ASSERT(0);}
  void clear() override;
  void cleanup() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return execute() || sp_result_field->get_date(ltime, fuzzydate);
  }
  inline Field *get_sp_result_field()
  {
    return sp_result_field;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_sp>(thd, this); }
  Item *copy_or_same(THD *thd) override;
};

/* Items to get the value of a stored sum function */

class Item_sum_field :public Item
{
protected:
  Field *field;
public:
  Item_sum_field(THD *thd, Item_sum *item)
    :Item(thd), field(item->result_field)
  {
    name= item->name;
    set_maybe_null();
    decimals= item->decimals;
    max_length= item->max_length;
    unsigned_flag= item->unsigned_flag;
  }
  table_map used_tables() const override { return (table_map) 1L; }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    return create_tmp_field_ex_simple(root, table, src, param);
  }
  void save_in_result_field(bool no_conversions) override { DBUG_ASSERT(0); }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(name.str, arg, VCOL_IMPOSSIBLE);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
};


class Item_avg_field :public Item_sum_field
{
protected:
  uint prec_increment;
public:
  Item_avg_field(THD *thd, Item_sum_avg *item)
   :Item_sum_field(thd, item), prec_increment(item->prec_increment)
  { }
  enum Type type() const override { return FIELD_AVG_ITEM; }
  bool is_null() override { update_null_value(); return null_value; }
};


class Item_avg_field_double :public Item_avg_field
{
public:
  Item_avg_field_double(THD *thd, Item_sum_avg *item)
   :Item_avg_field(thd, item)
  { }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  longlong val_int() override { return val_int_from_real(); }
  my_decimal *val_decimal(my_decimal *dec) override
  { return val_decimal_from_real(dec); }
  String *val_str(String *str) override
  { return val_string_from_real(str); }
  double val_real() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_avg_field_double>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_avg_field_decimal :public Item_avg_field
{
  uint f_precision, f_scale, dec_bin_size;
public:
  Item_avg_field_decimal(THD *thd, Item_sum_avg *item)
   :Item_avg_field(thd, item),
    f_precision(item->f_precision),
    f_scale(item->f_scale),
    dec_bin_size(item->dec_bin_size)
  { }
  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
  double val_real() override
  {
    return VDec(this).to_double();
  }
  longlong val_int() override
  {
    return VDec(this).to_longlong(unsigned_flag);
  }
  String *val_str(String *str) override
  {
    return VDec(this).to_string_round(str, decimals);
  }
  my_decimal *val_decimal(my_decimal *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_avg_field_decimal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_variance_field :public Item_sum_field
{
  uint sample;
public:
  Item_variance_field(THD *thd, Item_sum_variance *item)
   :Item_sum_field(thd, item), sample(item->sample)
  { }
  enum Type type() const override {return FIELD_VARIANCE_ITEM; }
  double val_real() override;
  longlong val_int() override { return val_int_from_real(); }
  String *val_str(String *str) override
  { return val_string_from_real(str); }
  my_decimal *val_decimal(my_decimal *dec_buf) override
  { return val_decimal_from_real(dec_buf); }
  bool is_null() override { update_null_value(); return null_value; }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_variance_field>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_std_field :public Item_variance_field
{
public:
  Item_std_field(THD *thd, Item_sum_std *item)
   :Item_variance_field(thd, item)
  { }
  enum Type type() const override { return FIELD_STD_ITEM; }
  double val_real() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_std_field>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/*
  User defined aggregates
*/

#ifdef HAVE_DLOPEN

class Item_udf_sum : public Item_sum
{
protected:
  udf_handler udf;

public:
  Item_udf_sum(THD *thd, udf_func *udf_arg):
    Item_sum(thd), udf(udf_arg)
  { quick_group=0; }
  Item_udf_sum(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_sum(thd, list), udf(udf_arg)
  { quick_group=0;}
  Item_udf_sum(THD *thd, Item_udf_sum *item)
    :Item_sum(thd, item), udf(item->udf)
  { udf.not_original= TRUE; }
  LEX_CSTRING func_name_cstring() const override
  {
    const char *tmp= udf.name();
    return {tmp, strlen(tmp) };
  }
  bool fix_fields(THD *thd, Item **ref) override
  {
    DBUG_ASSERT(fixed() == 0);

    if (init_sum_func_check(thd))
      return TRUE;

    base_flags|= item_base_t::FIXED;
    /*
      We set const_item_cache to false in constructors.
      It can be later changed to "true", in a Item_sum::make_const() call.
      No make_const() calls should have happened so far.
    */
    DBUG_ASSERT(!const_item_cache);
    if (udf.fix_fields(thd, this, this->arg_count, this->args))
      return TRUE;
    /**
      The above call for udf.fix_fields() updates
      the Used_tables_and_const_cache part of "this" as if it was a regular
      non-aggregate UDF function and can change both const_item_cache and
      used_tables_cache members.
      - The used_tables_cache will be re-calculated in update_used_tables()
        which is called from check_sum_func() below. So we don't care about
        its current value.
      - The const_item_cache must stay "false" until a Item_sum::make_const()
        call happens, if ever. So we need to reset const_item_cache back to
        "false" here.
    */
    const_item_cache= false;
    memcpy (orig_args, args, sizeof (Item *) * arg_count);
    return check_sum_func(thd, ref);
  }
  enum Sumfunctype sum_func () const override { return UDF_SUM_FUNC; }
  virtual bool have_field_update(void) const { return 0; }

  void clear() override;
  bool add() override;
  bool supports_removal() const override;
  void remove() override;
  void reset_field() override {};
  void update_field() override {}
  void cleanup() override;
  void print(String *str, enum_query_type query_type) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
};


class Item_sum_udf_float :public Item_udf_sum
{
 public:
  Item_sum_udf_float(THD *thd, udf_func *udf_arg):
    Item_udf_sum(thd, udf_arg) {}
  Item_sum_udf_float(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_udf_sum(thd, udf_arg, list) {}
  Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
    :Item_udf_sum(thd, item) {}
  longlong val_int() override { return val_int_from_real(); }
  double val_real() override;
  String *val_str(String*str) override;
  my_decimal *val_decimal(my_decimal *) override;
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  bool fix_length_and_dec() override
  { fix_num_length_and_dec(); return FALSE; }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_udf_float>(thd, this); }
};


class Item_sum_udf_int :public Item_udf_sum
{
public:
  Item_sum_udf_int(THD *thd, udf_func *udf_arg):
    Item_udf_sum(thd, udf_arg) {}
  Item_sum_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_udf_sum(thd, udf_arg, list) {}
  Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
    :Item_udf_sum(thd, item) {}
  longlong val_int() override;
  double val_real() override
  { DBUG_ASSERT(fixed()); return (double) Item_sum_udf_int::val_int(); }
  String *val_str(String*str) override;
  my_decimal *val_decimal(my_decimal *) override;
  const Type_handler *type_handler() const override
  {
    if (unsigned_flag)
      return &type_handler_ulonglong;
    return &type_handler_slonglong;
  }
  bool fix_length_and_dec() override { decimals=0; max_length=21; return FALSE; }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_udf_int>(thd, this); }
};


class Item_sum_udf_str :public Item_udf_sum
{
public:
  Item_sum_udf_str(THD *thd, udf_func *udf_arg):
    Item_udf_sum(thd, udf_arg) {}
  Item_sum_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_udf_sum(thd, udf_arg, list) {}
  Item_sum_udf_str(THD *thd, Item_sum_udf_str *item)
    :Item_udf_sum(thd, item) {}
  String *val_str(String *) override;
  double val_real() override
  {
    int err_not_used;
    char *end_not_used;
    String *res;
    res=val_str(&str_value);
    return res ? res->charset()->strntod((char*) res->ptr(),res->length(),
			                 &end_not_used, &err_not_used) : 0.0;
  }
  longlong val_int() override
  {
    int err_not_used;
    char *end;
    String *res;
    CHARSET_INFO *cs;

    if (!(res= val_str(&str_value)))
      return 0;                                 /* Null value */
    cs= res->charset();
    end= (char*) res->ptr()+res->length();
    return cs->strtoll10(res->ptr(), &end, &err_not_used);
  }
  my_decimal *val_decimal(my_decimal *dec) override;
  const Type_handler *type_handler() const override
  { return string_type_handler(); }
  bool fix_length_and_dec() override;
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_udf_str>(thd, this); }
};


class Item_sum_udf_decimal :public Item_udf_sum
{
public:
  Item_sum_udf_decimal(THD *thd, udf_func *udf_arg):
    Item_udf_sum(thd, udf_arg) {}
  Item_sum_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_udf_sum(thd, udf_arg, list) {}
  Item_sum_udf_decimal(THD *thd, Item_sum_udf_decimal *item)
    :Item_udf_sum(thd, item) {}
  String *val_str(String *str) override
  {
    return VDec(this).to_string_round(str, decimals);
  }
  double val_real() override
  {
    return VDec(this).to_double();
  }
  longlong val_int() override
  {
    return VDec(this).to_longlong(unsigned_flag);
  }
  my_decimal *val_decimal(my_decimal *) override;
  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
  bool fix_length_and_dec() override
  { fix_num_length_and_dec(); return FALSE; }
  Item *copy_or_same(THD* thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_udf_decimal>(thd, this); }
};

#else /* Dummy functions to get yy_*.cc files compiled */

class Item_sum_udf_float :public Item_sum_double
{
 public:
  Item_sum_udf_float(THD *thd, udf_func *udf_arg):
    Item_sum_double(thd) {}
  Item_sum_udf_float(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_sum_double(thd) {}
  Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
    :Item_sum_double(thd, item) {}
  enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
  double val_real() { DBUG_ASSERT(fixed()); return 0.0; }
  void clear() {}
  bool add() { return 0; }  
  void reset_field() { DBUG_ASSERT(0); };
  void update_field() {}
};


class Item_sum_udf_int :public Item_sum_double
{
public:
  Item_sum_udf_int(THD *thd, udf_func *udf_arg):
    Item_sum_double(thd) {}
  Item_sum_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_sum_double(thd) {}
  Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
    :Item_sum_double(thd, item) {}
  enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
  longlong val_int() { DBUG_ASSERT(fixed()); return 0; }
  double val_real() { DBUG_ASSERT(fixed()); return 0; }
  void clear() {}
  bool add() { return 0; }  
  void reset_field() { DBUG_ASSERT(0); };
  void update_field() {}
};


class Item_sum_udf_decimal :public Item_sum_double
{
 public:
  Item_sum_udf_decimal(THD *thd, udf_func *udf_arg):
    Item_sum_double(thd) {}
  Item_sum_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_sum_double(thd) {}
  Item_sum_udf_decimal(THD *thd, Item_sum_udf_float *item)
    :Item_sum_double(thd, item) {}
  enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
  double val_real() { DBUG_ASSERT(fixed()); return 0.0; }
  my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed()); return 0; }
  void clear() {}
  bool add() { return 0; }
  void reset_field() { DBUG_ASSERT(0); };
  void update_field() {}
};


class Item_sum_udf_str :public Item_sum_double
{
public:
  Item_sum_udf_str(THD *thd, udf_func *udf_arg):
    Item_sum_double(thd) {}
  Item_sum_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_sum_double(thd) {}
  Item_sum_udf_str(THD *thd, Item_sum_udf_str *item)
    :Item_sum_double(thd, item) {}
  String *val_str(String *)
    { DBUG_ASSERT(fixed()); null_value=1; return 0; }
  double val_real() { DBUG_ASSERT(fixed()); null_value=1; return 0.0; }
  longlong val_int() { DBUG_ASSERT(fixed()); null_value=1; return 0; }
  bool fix_length_and_dec() override
  { base_flags|= item_base_t::MAYBE_NULL; max_length=0; return FALSE; }
  enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
  void clear() {}
  bool add() { return 0; }  
  void reset_field() { DBUG_ASSERT(0); };
  void update_field() {}
};

#endif /* HAVE_DLOPEN */

C_MODE_START
int group_concat_key_cmp_with_distinct(void *arg, const void *key1,
                                       const void *key2);
int group_concat_key_cmp_with_distinct_with_nulls(void *arg, const void *key1,
                                                  const void *key2);
int group_concat_key_cmp_with_order(void *arg, const void *key1,
                                    const void *key2);
int group_concat_key_cmp_with_order_with_nulls(void *arg, const void *key1,
                                               const void *key2);
int dump_leaf_key(void* key_arg,
                  element_count count __attribute__((unused)),
                  void* item_arg);
C_MODE_END

class Item_func_group_concat : public Item_sum
{
protected:
  TMP_TABLE_PARAM *tmp_table_param;
  String result;
  String *separator;
  TREE tree_base;
  TREE *tree;
  size_t tree_len;
  Item **ref_pointer_array;

  /**
     If DISTINCT is used with this GROUP_CONCAT, this member is used to filter
     out duplicates. 
     @see Item_func_group_concat::setup
     @see Item_func_group_concat::add
     @see Item_func_group_concat::clear
   */
  Unique *unique_filter;
  TABLE *table;
  ORDER **order;
  Name_resolution_context *context;
  /** The number of ORDER BY items. */
  uint arg_count_order;
  /** The number of selected items, aka the expr list. */
  uint arg_count_field;
  uint row_count;
  bool distinct;
  bool warning_for_row;
  bool always_null;
  bool force_copy_fields;
  /** True if entire result of GROUP_CONCAT has been written to output buffer. */
  bool result_finalized;
  /** Limits the rows in the result */
  Item *row_limit;
  /** Skips a particular number of rows in from the result*/
  Item *offset_limit;
  bool limit_clause;
  /* copy of the offset limit */
  ulonglong copy_offset_limit;
  /*copy of the row limit */
  ulonglong copy_row_limit;

  /*
    Following is 0 normal object and pointer to original one for copy
    (to correctly free resources)
  */
  Item_func_group_concat *original;

  /*
    Used by Item_func_group_concat and Item_func_json_arrayagg. The latter
    needs null values but the former doesn't.
  */
  bool add(bool exclude_nulls);

  friend int group_concat_key_cmp_with_distinct(void *arg, const void *key1,
                                                const void *key2);
  friend int group_concat_key_cmp_with_distinct_with_nulls(void *arg,
                                                           const void *key1,
                                                           const void *key2);
  friend int group_concat_key_cmp_with_order(void *arg, const void *key1,
                                             const void *key2);
  friend int group_concat_key_cmp_with_order_with_nulls(void *arg,
                                                        const void *key1,
                                                        const void *key2);
  friend int dump_leaf_key(void* key_arg,
                           element_count count __attribute__((unused)),
			   void* item_arg);

  bool repack_tree(THD *thd);

  /*
    Says whether the function should skip NULL arguments
    or add them to the result.
    Redefined in JSON_ARRAYAGG.
  */
  virtual bool skip_nulls() const { return true; }
  virtual String *get_str_from_item(Item *i, String *tmp)
    { return i->val_str(tmp); }
  virtual String *get_str_from_field(Item *i, Field *f, String *tmp,
                                     const uchar *key, size_t offset)
    { return f->val_str(tmp, key + offset); }
  virtual void cut_max_length(String *result,
                              uint old_length, uint max_length) const;
  bool uses_non_standard_aggregator_for_distinct() const override
    { return distinct; }

public:
  // Methods used by ColumnStore
  bool get_distinct() const { return distinct; }
  uint get_count_field() const { return arg_count_field; }
  uint get_order_field() const { return arg_count_order; }
  const String* get_separator() const { return separator; }
  ORDER** get_order() const { return order; }

public:
  Item_func_group_concat(THD *thd, Name_resolution_context *context_arg,
                         bool is_distinct, List<Item> *is_select,
                         const SQL_I_List<ORDER> &is_order, String *is_separator,
                         bool limit_clause, Item *row_limit, Item *offset_limit);

  Item_func_group_concat(THD *thd, Item_func_group_concat *item);
  ~Item_func_group_concat();
  void cleanup() override;

  enum Sumfunctype sum_func () const override {return GROUP_CONCAT_FUNC;}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING sum_name= {STRING_WITH_LEN("group_concat(") };
    return sum_name;
  }
  const Type_handler *type_handler() const override
  {
    if (too_big_for_varchar())
      return &type_handler_blob;
    return &type_handler_varchar;
  }
  void clear() override;
  bool add() override
  {
    return add(skip_nulls());
  }
  void reset_field() override { DBUG_ASSERT(0); }        // not used
  void update_field() override { DBUG_ASSERT(0); }       // not used
  bool fix_fields(THD *,Item **) override;
  bool setup(THD *thd) override;
  void make_unique() override;
  double val_real() override
  {
    int error;
    const char *end;
    String *res;
    if (!(res= val_str(&str_value)))
      return 0.0;
    end= res->ptr() + res->length();
    return (my_strtod(res->ptr(), (char**) &end, &error));
  }
  longlong val_int() override
  {
    String *res;
    char *end_ptr;
    int error;
    if (!(res= val_str(&str_value)))
      return (longlong) 0;
    end_ptr= (char*) res->ptr()+ res->length();
    return my_strtoll10(res->ptr(), &end_ptr, &error);
  }
  my_decimal *val_decimal(my_decimal *decimal_value) override
  {
    return val_decimal_from_string(decimal_value);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return get_date_from_string(thd, ltime, fuzzydate);
  }
  String *val_str(String *str) override;
  Item *copy_or_same(THD* thd) override;
  void no_rows_in_result() override {}
  void print(String *str, enum_query_type query_type) override;
  bool change_context_processor(void *cntx) override
    { context= (Name_resolution_context *)cntx; return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_group_concat>(thd, this); }
  qsort_cmp2 get_comparator_function_for_distinct();
  qsort_cmp2 get_comparator_function_for_order_by();
  uchar* get_record_pointer();
  uint get_null_bytes();

};

#endif /* ITEM_SUM_INCLUDED */
server/private/sql_explain.h000064400000070534150400263750012227 0ustar00/*
   Copyright (c) 2013 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*

== EXPLAIN/ANALYZE architecture ==

=== [SHOW] EXPLAIN data ===
Query optimization produces two data structures:
1. execution data structures themselves (eg. JOINs, JOIN_TAB, etc, etc)
2. Explain data structures.

#2 are self contained set of data structures that has sufficient info to
produce output of SHOW EXPLAIN, EXPLAIN [FORMAT=JSON], or 
ANALYZE [FORMAT=JSON], without accessing the execution data structures.

(the only exception is that Explain data structures keep Item* pointers,
and we require that one might call item->print(QT_EXPLAIN) when printing
FORMAT=JSON output)

=== ANALYZE data ===
EXPLAIN data structures have embedded ANALYZE data structures. These are 
objects that are used to track how the parts of query plan were executed:
how many times each part of query plan was invoked, how many rows were
read/returned, etc.

Each execution data structure keeps a direct pointer to its ANALYZE data
structure. It is needed so that execution code can quickly increment the
counters.

(note that this increases the set of data that is frequently accessed 
during the execution. What is the impact of this?)

Since ANALYZE/EXPLAIN data structures are separated from execution data
structures, it is easy to have them survive until the end of the query,
where we can return ANALYZE [FORMAT=JSON] output to the user, or print 
it into the slow query log.

*/

#ifndef SQL_EXPLAIN_INCLUDED
#define SQL_EXPLAIN_INCLUDED

class String_list: public List<char>
{
public:
  const char *append_str(MEM_ROOT *mem_root, const char *str);
};

class Json_writer;

/**************************************************************************************
 
  Data structures for producing EXPLAIN outputs.

  These structures
  - Can be produced inexpensively from query plan.
  - Store sufficient information to produce tabular EXPLAIN output (the goal is 
    to be able to produce JSON also)

*************************************************************************************/


const uint FAKE_SELECT_LEX_ID= UINT_MAX;

class Explain_query;

/* 
  A node can be either a SELECT, or a UNION.
*/
class Explain_node : public Sql_alloc
{
public:
  Explain_node(MEM_ROOT *root) :
    cache_tracker(NULL),
    subq_materialization(NULL),
    connection_type(EXPLAIN_NODE_OTHER),
    children(root)
  {}
  /* A type specifying what kind of node this is */
  enum explain_node_type 
  {
    EXPLAIN_UNION, 
    EXPLAIN_SELECT,
    EXPLAIN_BASIC_JOIN,
    EXPLAIN_UPDATE,
    EXPLAIN_DELETE, 
    EXPLAIN_INSERT
  };
  
  /* How this node is connected */
  enum explain_connection_type {
    EXPLAIN_NODE_OTHER,
    EXPLAIN_NODE_DERIVED, /* Materialized derived table */
    EXPLAIN_NODE_NON_MERGED_SJ /* aka JTBM semi-join */
  };

  virtual enum explain_node_type get_type()= 0;
  virtual uint get_select_id()= 0;

  /**
    expression cache statistics
  */
  Expression_cache_tracker* cache_tracker;

  /**
    If not NULL, this node is a SELECT (or UNION) in a materialized
    IN-subquery.
  */
  Explain_subq_materialization* subq_materialization;

  /*
    How this node is connected to its parent.
    (NOTE: EXPLAIN_NODE_NON_MERGED_SJ is set very late currently)
  */
  enum explain_connection_type connection_type;

protected:
  /* 
    A node may have children nodes. When a node's explain structure is 
    created, children nodes may not yet have QPFs. This is why we store ids.
  */
  Dynamic_array<int> children;
public:
  void add_child(int select_no)
  {
    children.append(select_no);
  }

  virtual int print_explain(Explain_query *query, select_result_sink *output, 
                            uint8 explain_flags, bool is_analyze)=0;
  virtual void print_explain_json(Explain_query *query, Json_writer *writer, 
                                  bool is_analyze)= 0;

  int print_explain_for_children(Explain_query *query, select_result_sink *output, 
                                 uint8 explain_flags, bool is_analyze);
  void print_explain_json_for_children(Explain_query *query,
                                       Json_writer *writer, bool is_analyze);
  bool print_explain_json_cache(Json_writer *writer, bool is_analyze);
  bool print_explain_json_subq_materialization(Json_writer *writer,
                                               bool is_analyze);
  virtual ~Explain_node() = default;
};


class Explain_table_access;


/* 
  A basic join. This is only used for SJ-Materialization nests.

  Basic join doesn't have ORDER/GROUP/DISTINCT operations. It also cannot be
  degenerate.

  It has its own select_id.
*/
class Explain_basic_join : public Explain_node
{
public:
  enum explain_node_type get_type() override { return EXPLAIN_BASIC_JOIN; }
  
  Explain_basic_join(MEM_ROOT *root) : Explain_node(root), join_tabs(NULL) {}
  ~Explain_basic_join();

  bool add_table(Explain_table_access *tab, Explain_query *query);

  uint get_select_id() override { return select_id; }

  uint select_id;

  int print_explain(Explain_query *query, select_result_sink *output,
                    uint8 explain_flags, bool is_analyze) override;
  void print_explain_json(Explain_query *query, Json_writer *writer, 
                          bool is_analyze) override;

  void print_explain_json_interns(Explain_query *query, Json_writer *writer,
                                  bool is_analyze);

  /* A flat array of Explain structs for tables. */
  Explain_table_access** join_tabs;
  uint n_join_tabs;
};


class Explain_aggr_node;
/*
  EXPLAIN structure for a SELECT.
  
  A select can be:
  1. A degenerate case. In this case, message!=NULL, and it contains a 
     description of what kind of degenerate case it is (e.g. "Impossible 
     WHERE").
  2. a non-degenrate join. In this case, join_tabs describes the join.

  In the non-degenerate case, a SELECT may have a GROUP BY/ORDER BY operation.

  In both cases, the select may have children nodes. class Explain_node
  provides a way get node's children.
*/

class Explain_select : public Explain_basic_join
{
public:
  enum explain_node_type get_type() override { return EXPLAIN_SELECT; }

  Explain_select(MEM_ROOT *root, bool is_analyze) : 
  Explain_basic_join(root),
#ifndef DBUG_OFF
    select_lex(NULL),
#endif
    linkage(UNSPECIFIED_TYPE),
    is_lateral(false),
    message(NULL),
    having(NULL), having_value(Item::COND_UNDEF),
    using_temporary(false), using_filesort(false),
    time_tracker(is_analyze),
    aggr_tree(NULL)
  {}

  void add_linkage(Json_writer *writer);

public:
#ifndef DBUG_OFF
  SELECT_LEX *select_lex;
#endif
  const char *select_type;
  enum sub_select_type linkage;
  bool is_lateral;

  /*
    If message != NULL, this is a degenerate join plan, and all subsequent
    members have no info 
  */
  const char *message;

  /* Expensive constant condition */
  Item *exec_const_cond;
  Item *outer_ref_cond;
  Item *pseudo_bits_cond;

  /* HAVING condition */
  Item *having;
  Item::cond_result having_value;

  /* Global join attributes. In tabular form, they are printed on the first row */
  bool using_temporary;
  bool using_filesort;

  /* ANALYZE members */
  Time_and_counter_tracker time_tracker;
  
  /* 
    Part of query plan describing sorting, temp.table usage, and duplicate 
    removal
  */
  Explain_aggr_node* aggr_tree;

  int print_explain(Explain_query *query, select_result_sink *output, 
                    uint8 explain_flags, bool is_analyze) override;
  void print_explain_json(Explain_query *query, Json_writer *writer, 
                          bool is_analyze) override;
  
  Table_access_tracker *get_using_temporary_read_tracker()
  {
    return &using_temporary_read_tracker;
  }
private:
  Table_access_tracker using_temporary_read_tracker;
};

/////////////////////////////////////////////////////////////////////////////
// EXPLAIN structures for ORDER/GROUP operations.
/////////////////////////////////////////////////////////////////////////////
typedef enum 
{
  AGGR_OP_TEMP_TABLE,
  AGGR_OP_FILESORT,
  //AGGR_OP_READ_SORTED_FILE, // need this?
  AGGR_OP_REMOVE_DUPLICATES,
  AGGR_OP_WINDOW_FUNCS
  //AGGR_OP_JOIN // Need this?
} enum_explain_aggr_node_type;


class Explain_aggr_node : public Sql_alloc
{
public:
  virtual enum_explain_aggr_node_type get_type()= 0;
  virtual ~Explain_aggr_node() = default;
  Explain_aggr_node *child;
};

class Explain_aggr_filesort : public Explain_aggr_node
{
  List<Item> sort_items;
  List<ORDER::enum_order> sort_directions;
public:
  enum_explain_aggr_node_type get_type() override { return AGGR_OP_FILESORT; }
  Filesort_tracker tracker;

  Explain_aggr_filesort(MEM_ROOT *mem_root, bool is_analyze, 
                        Filesort *filesort);

  void print_json_members(Json_writer *writer, bool is_analyze);
};

class Explain_aggr_tmp_table : public Explain_aggr_node
{
public:
  enum_explain_aggr_node_type get_type() override { return AGGR_OP_TEMP_TABLE; }
};

class Explain_aggr_remove_dups : public Explain_aggr_node
{
public:
  enum_explain_aggr_node_type get_type() override { return AGGR_OP_REMOVE_DUPLICATES; }
};

class Explain_aggr_window_funcs : public Explain_aggr_node
{
  List<Explain_aggr_filesort> sorts;
public:
  enum_explain_aggr_node_type get_type() override { return AGGR_OP_WINDOW_FUNCS; }

  void print_json_members(Json_writer *writer, bool is_analyze);
  friend class Window_funcs_computation;
};

/////////////////////////////////////////////////////////////////////////////

extern const char *unit_operation_text[4];
extern const char *pushed_derived_text;
extern const char *pushed_select_text;

/*
  Explain structure for a UNION.

  A UNION may or may not have "Using filesort".
*/

class Explain_union : public Explain_node
{
public:
  Explain_union(MEM_ROOT *root, bool is_analyze) : 
    Explain_node(root), union_members(PSI_INSTRUMENT_MEM),
    is_recursive_cte(false),
    fake_select_lex_explain(root, is_analyze)
  {}

  enum explain_node_type get_type() override { return EXPLAIN_UNION; }
  unit_common_op operation;

  uint get_select_id() override
  {
    DBUG_ASSERT(union_members.elements() > 0);
    return union_members.at(0);
  }
  /*
    Members of the UNION.  Note: these are different from UNION's "children".
    Example:

      (select * from t1) union 
      (select * from t2) order by (select col1 from t3 ...)

    here 
      - select-from-t1 and select-from-t2 are "union members",
      - select-from-t3 is the only "child".
  */
  Dynamic_array<int> union_members;

  void add_select(int select_no)
  {
    union_members.append(select_no);
  }
  int print_explain(Explain_query *query, select_result_sink *output, 
                    uint8 explain_flags, bool is_analyze) override;
  void print_explain_json(Explain_query *query, Json_writer *writer, 
                          bool is_analyze) override;

  const char *fake_select_type;
  bool using_filesort;
  bool using_tmp;
  bool is_recursive_cte;
  
  /*
    Explain data structure for "fake_select_lex" (i.e. for the degenerate
    SELECT that reads UNION result).
    It doesn't have a query plan, but we still need execution tracker, etc.
  */
  Explain_select fake_select_lex_explain;

  Table_access_tracker *get_fake_select_lex_tracker()
  {
    return &fake_select_lex_tracker;
  }
  Table_access_tracker *get_tmptable_read_tracker()
  {
    return &tmptable_read_tracker;
  }
private:
  uint make_union_table_name(char *buf);
  
  Table_access_tracker fake_select_lex_tracker;
  /* This one is for reading after ORDER BY */
  Table_access_tracker tmptable_read_tracker; 
};


class Explain_update;
class Explain_delete;
class Explain_insert;


/*
  Explain structure for a query (i.e. a statement).

  This should be able to survive when the query plan was deleted. Currently, 
  we do not intend for it survive until after query's MEM_ROOT is freed. It
  does surivive freeing of query's items.
   
  For reference, the process of post-query cleanup is as follows:

    >dispatch_command
    | >mysql_parse
    | |  ...
    | | lex_end()
    | |  ...
    | | >THD::cleanup_after_query
    | | | ...
    | | | free_items()
    | | | ...
    | | <THD::cleanup_after_query
    | |
    | <mysql_parse
    |
    | log_slow_statement()
    | 
    | free_root()
    | 
    >dispatch_command
  
  That is, the order of actions is:
    - free query's Items
    - write to slow query log 
    - free query's MEM_ROOT
    
*/

class Explain_query : public Sql_alloc
{
public:
  Explain_query(THD *thd, MEM_ROOT *root);
  ~Explain_query();

  /* Add a new node */
  void add_node(Explain_node *node);
  void add_insert_plan(Explain_insert *insert_plan_arg);
  void add_upd_del_plan(Explain_update *upd_del_plan_arg);

  /* This will return a select, or a union */
  Explain_node *get_node(uint select_id);

  /* This will return a select (even if there is a union with this id) */
  Explain_select *get_select(uint select_id);
  
  Explain_union *get_union(uint select_id);
 
  /* Produce a tabular EXPLAIN output */
  int print_explain(select_result_sink *output, uint8 explain_flags, 
                    bool is_analyze);
  
  /* Send tabular EXPLAIN to the client */
  int send_explain(THD *thd, bool extended);
  
  /* Return tabular EXPLAIN output as a text string */
  bool print_explain_str(THD *thd, String *out_str, bool is_analyze);

  void print_explain_json(select_result_sink *output, bool is_analyze);

  /* If true, at least part of EXPLAIN can be printed */
  bool have_query_plan() { return insert_plan || upd_del_plan|| get_node(1) != NULL; }

  void query_plan_ready();

  MEM_ROOT *mem_root;

  Explain_update *get_upd_del_plan() { return upd_del_plan; }
private:
  /* Explain_delete inherits from Explain_update */
  Explain_update *upd_del_plan;

  /* Query "plan" for INSERTs */
  Explain_insert *insert_plan;

  Dynamic_array<Explain_union*> unions;
  Dynamic_array<Explain_select*> selects;
  
  THD *thd; // for APC start/stop
  bool apc_enabled;
  /* 
    Debugging aid: count how many times add_node() was called. Ideally, it
    should be one, we currently allow O(1) query plan saves for each
    select or union.  The goal is not to have O(#rows_in_some_table), which 
    is unacceptable.
  */
  longlong operations;
};


/* 
  Some of the tags have matching text. See extra_tag_text for text names, and 
  Explain_table_access::append_tag_name() for code to convert from tag form to text
  form.
*/
enum explain_extra_tag
{
  ET_none= 0, /* not-a-tag */
  ET_USING_INDEX_CONDITION,
  ET_USING_INDEX_CONDITION_BKA,
  ET_USING, /* For quick selects of various kinds */
  ET_RANGE_CHECKED_FOR_EACH_RECORD,
  ET_USING_WHERE_WITH_PUSHED_CONDITION,
  ET_USING_WHERE,
  ET_NOT_EXISTS,

  ET_USING_INDEX,
  ET_FULL_SCAN_ON_NULL_KEY,
  ET_SKIP_OPEN_TABLE,
  ET_OPEN_FRM_ONLY,
  ET_OPEN_FULL_TABLE,

  ET_SCANNED_0_DATABASES,
  ET_SCANNED_1_DATABASE,
  ET_SCANNED_ALL_DATABASES,

  ET_USING_INDEX_FOR_GROUP_BY,

  ET_USING_MRR, // does not print "Using mrr". 

  ET_DISTINCT,
  ET_LOOSESCAN,
  ET_START_TEMPORARY,
  ET_END_TEMPORARY,
  ET_FIRST_MATCH,
  
  ET_USING_JOIN_BUFFER,

  ET_CONST_ROW_NOT_FOUND,
  ET_UNIQUE_ROW_NOT_FOUND,
  ET_IMPOSSIBLE_ON_CONDITION,
  ET_TABLE_FUNCTION,

  ET_total
};


/*
  Explain data structure describing join buffering use.
*/

class EXPLAIN_BKA_TYPE
{
public:
  EXPLAIN_BKA_TYPE() : join_alg(NULL) {}

  size_t join_buffer_size;

  bool incremental;

  /* 
    NULL if no join buferring used.
    Other values: BNL, BNLH, BKA, BKAH.
  */
  const char *join_alg;

  /* Information about MRR usage.  */
  StringBuffer<64> mrr_type;
  
  bool is_using_jbuf() { return (join_alg != NULL); }
};


/*
  Data about how an index is used by some access method
*/
class Explain_index_use : public Sql_alloc
{
  char *key_name;
  uint key_len;
  char *filter_name;
  uint filter_len;
public:
  String_list key_parts_list;
  
  Explain_index_use()
  {
    clear();
  }

  void clear()
  {
    key_name= NULL;
    key_len= (uint)-1;
    filter_name= NULL;
    filter_len= (uint)-1;
  }
  bool set(MEM_ROOT *root, KEY *key_name, uint key_len_arg);
  bool set_pseudo_key(MEM_ROOT *root, const char *key_name);

  inline const char *get_key_name() const { return key_name; }
  inline uint get_key_len() const { return key_len; }
  //inline const char *get_filter_name() const { return filter_name; }
};


/*
  Query Plan data structure for Rowid filter.
*/
class Explain_rowid_filter : public Sql_alloc
{
public:
  /* Quick select used to collect the rowids into filter */
  Explain_quick_select *quick;

  /* How many rows the above quick select is expected to return */
  ha_rows rows;

  /* Expected selectivity for the filter */
  double selectivity;

  /* Tracker with the information about how rowid filter is executed */
  Rowid_filter_tracker *tracker;

  void print_explain_json(Explain_query *query, Json_writer *writer,
                          bool is_analyze);

  /*
    TODO:
      Here should be ANALYZE members:
      - r_rows for the quick select
      - An object that tracked the table access time
      - real selectivity of the filter.
  */
};


/*
  QPF for quick range selects, as well as index_merge select
*/
class Explain_quick_select : public Sql_alloc
{
public:
  Explain_quick_select(int quick_type_arg) : quick_type(quick_type_arg) 
  {}

  const int quick_type;

  bool is_basic() 
  {
    return (quick_type == QUICK_SELECT_I::QS_TYPE_RANGE || 
            quick_type == QUICK_SELECT_I::QS_TYPE_RANGE_DESC ||
            quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX);
  }
  
  /* This is used when quick_type == QUICK_SELECT_I::QS_TYPE_RANGE */
  Explain_index_use range;
  
  /* Used in all other cases */
  List<Explain_quick_select> children;
  
  void print_extra(String *str);
  void print_key(String *str);
  void print_key_len(String *str);

  void print_json(Json_writer *writer);

  void print_extra_recursive(String *str);
private:
  const char *get_name_by_type();
};


/*
  Data structure for "range checked for each record". 
  It's a set of keys, tabular explain prints hex bitmap, json prints key names.
*/

typedef const char* NAME;

class Explain_range_checked_fer : public Sql_alloc
{
public:
  String_list key_set;
  key_map keys_map;
private:
  ha_rows full_scan, index_merge;
  ha_rows *keys_stat;
  NAME *keys_stat_names;
  uint keys;

public:
  Explain_range_checked_fer()
    :Sql_alloc(), full_scan(0), index_merge(0),
    keys_stat(0), keys_stat_names(0), keys(0)
  {}

  int append_possible_keys_stat(MEM_ROOT *alloc,
                                TABLE *table, key_map possible_keys);
  void collect_data(QUICK_SELECT_I *quick);
  void print_json(Json_writer *writer, bool is_analyze);
};


/*
  EXPLAIN data structure for a single JOIN_TAB.
*/

class Explain_table_access : public Sql_alloc
{
public:
  Explain_table_access(MEM_ROOT *root, bool timed) :
    derived_select_number(0),
    non_merged_sjm_number(0),
    extra_tags(root),
    range_checked_fer(NULL),
    full_scan_on_null_key(false),
    start_dups_weedout(false),
    end_dups_weedout(false),
    where_cond(NULL),
    cache_cond(NULL),
    pushed_index_cond(NULL),
    sjm_nest(NULL),
    pre_join_sort(NULL),
    handler_for_stats(NULL),
    jbuf_unpack_tracker(timed),
    rowid_filter(NULL)
  {}
  ~Explain_table_access() { delete sjm_nest; }

  void push_extra(enum explain_extra_tag extra_tag);

  /* Internals */

  /* id and 'select_type' are cared-of by the parent Explain_select */
  StringBuffer<32> table_name;
  StringBuffer<32> used_partitions;
  String_list used_partitions_list;
  // valid with ET_USING_MRR
  StringBuffer<32> mrr_type;
  StringBuffer<32> firstmatch_table_name;

  /* 
    Non-zero number means this is a derived table. The number can be used to
    find the query plan for the derived table
  */
  int derived_select_number;
  /* TODO: join with the previous member. */
  int non_merged_sjm_number;

  enum join_type type;

  bool used_partitions_set;
  
  /* Empty means "NULL" will be printed */
  String_list possible_keys;

  bool rows_set; /* not set means 'NULL' should be printed */
  bool filtered_set; /* not set means 'NULL' should be printed */
  // Valid if ET_USING_INDEX_FOR_GROUP_BY is present
  bool loose_scan_is_scanning;
  
  /*
    Index use: key name and length.
    Note: that when one is accessing I_S tables, those may show use of 
    non-existant indexes.

    key.key_name == NULL means 'NULL' will be shown in tabular output.
    key.key_len == (uint)-1 means 'NULL' will be shown in tabular output.
  */
  Explain_index_use key;
  
  /*
    when type==JT_HASH_NEXT, 'key' stores the hash join pseudo-key.
    hash_next_key stores the table's key.
  */
  Explain_index_use hash_next_key;
  
  String_list ref_list;

  ha_rows rows;
  double filtered;

  /* 
    Contents of the 'Extra' column. Some are converted into strings, some have
    parameters, values for which are stored below.
  */
  Dynamic_array<enum explain_extra_tag> extra_tags;

  // Valid if ET_USING tag is present
  Explain_quick_select *quick_info;
  
  /* Non-NULL value means this tab uses "range checked for each record" */
  Explain_range_checked_fer *range_checked_fer;
 
  bool full_scan_on_null_key;

  // valid with ET_USING_JOIN_BUFFER
  EXPLAIN_BKA_TYPE bka_type;

  bool start_dups_weedout;
  bool end_dups_weedout;
  
  /*
    Note: lifespan of WHERE condition is less than lifespan of this object.
    The below two are valid if tags include "ET_USING_WHERE".
    (TODO: indexsubquery may put ET_USING_WHERE without setting where_cond?)
  */
  Item *where_cond;
  Item *cache_cond;
  
  /*
    This is either pushed index condition, or BKA's index condition. 
    (the latter refers to columns of other tables and so can only be checked by
     BKA code). Examine extra_tags to tell which one it is.
  */
  Item *pushed_index_cond;

  Explain_basic_join *sjm_nest;
  
  /*
    This describes a possible filesort() call that is done before doing the
    join operation.
  */
  Explain_aggr_filesort *pre_join_sort;

  /* ANALYZE members */

  /* Tracker for reading the table */
  Table_access_tracker tracker;
  Exec_time_tracker op_tracker;
  Gap_time_tracker extra_time_tracker;

  /*
    Handler object to get the handler_stats from.

    Notes:
    This pointer is only valid until notify_tables_are_closed() is called.
    After that, the tables may be freed or reused, together with their
    handler_stats objects.
    notify_tables_are_closed() disables printing of FORMAT=JSON output.
    r_engine_stats is only printed in FORMAT=JSON output, so we're fine.

    We do not store pointers to temporary (aka "work") tables here.
    Temporary tables may be freed (e.g. by JOIN::cleanup()) or re-created
    during query execution (when HEAP table is converted into Aria).
  */
  handler *handler_for_stats;

  /* When using join buffer: Track the reads from join buffer */
  Table_access_tracker jbuf_tracker;

  /* When using join buffer: time spent unpacking rows from the join buffer */
  Time_and_counter_tracker jbuf_unpack_tracker;

  /*
    When using join buffer: time spent after unpacking rows from the join
    buffer. This will capture the time spent checking the Join Condition:
    the condition that depends on this table and preceding tables.
  */
  Gap_time_tracker jbuf_extra_time_tracker;

  /* When using join buffer: Track the number of incoming record combinations */
  Counter_tracker jbuf_loops_tracker;

  Explain_rowid_filter *rowid_filter;

  int print_explain(select_result_sink *output, uint8 explain_flags, 
                    bool is_analyze,
                    uint select_id, const char *select_type,
                    bool using_temporary, bool using_filesort);
  void print_explain_json(Explain_query *query, Json_writer *writer,
                          bool is_analyze);

private:
  void append_tag_name(String *str, enum explain_extra_tag tag);
  void fill_key_str(String *key_str, bool is_json) const;
  void fill_key_len_str(String *key_len_str, bool is_json) const;
  double get_r_filtered();
  void tag_to_json(Json_writer *writer, enum explain_extra_tag tag);
};


/*
  EXPLAIN structure for single-table UPDATE. 
  
  This is similar to Explain_table_access, except that it is more restrictive.
  Also, it can have UPDATE operation options, but currently there aren't any.

  Explain_delete inherits from this.
*/

class Explain_update : public Explain_node
{
public:

  Explain_update(MEM_ROOT *root, bool is_analyze) : 
    Explain_node(root),
    filesort_tracker(NULL),
    command_tracker(is_analyze),
    handler_for_stats(NULL)
  {}

  enum explain_node_type get_type() override { return EXPLAIN_UPDATE; }
  uint get_select_id() override { return 1; /* always root */ }

  const char *select_type;

  StringBuffer<32> used_partitions;
  String_list used_partitions_list;
  bool used_partitions_set;

  bool impossible_where;
  bool no_partitions;
  StringBuffer<64> table_name;

  enum join_type jtype;
  String_list possible_keys;

  /* Used key when doing a full index scan (possibly with limit) */
  Explain_index_use key;

  /* 
    MRR that's used with quick select. This should probably belong to the
    quick select
  */
  StringBuffer<64> mrr_type;
  
  Explain_quick_select *quick_info;

  bool using_where;
  Item *where_cond;

  ha_rows rows;

  bool using_io_buffer;

  /* Tracker for doing reads when filling the buffer */
  Table_access_tracker buf_tracker;
  
  bool is_using_filesort() { return filesort_tracker? true: false; }
  /*
    Non-null value of filesort_tracker means "using filesort"

    if we are using filesort, then table_tracker is for the io done inside
    filesort.
    
    'tracker' is for tracking post-filesort reads.
  */
  Filesort_tracker *filesort_tracker;

  /* ANALYZE members and methods */
  Table_access_tracker tracker;

  /* This tracks execution of the whole command */
  Time_and_counter_tracker command_tracker;
  
  /* TODO: This tracks time to read rows from the table */
  Exec_time_tracker table_tracker;

  /* The same as  Explain_table_access::handler_for_stats */
  handler *handler_for_stats;

  int print_explain(Explain_query *query, select_result_sink *output,
                    uint8 explain_flags, bool is_analyze) override;
  void print_explain_json(Explain_query *query, Json_writer *writer,
                          bool is_analyze) override;
};


/*
  EXPLAIN data structure for an INSERT.
  
  At the moment this doesn't do much as we don't really have any query plans
  for INSERT statements.
*/

class Explain_insert : public Explain_node
{
public:
  Explain_insert(MEM_ROOT *root) : 
  Explain_node(root)
  {}

  StringBuffer<64> table_name;

  enum explain_node_type get_type() override { return EXPLAIN_INSERT; }
  uint get_select_id() override { return 1; /* always root */ }

  int print_explain(Explain_query *query, select_result_sink *output,
                    uint8 explain_flags, bool is_analyze) override;
  void print_explain_json(Explain_query *query, Json_writer *writer,
                          bool is_analyze) override;
};


/* 
  EXPLAIN data of a single-table DELETE.
*/

class Explain_delete: public Explain_update
{
public:
  Explain_delete(MEM_ROOT *root, bool is_analyze) : 
  Explain_update(root, is_analyze)
  {}

  /*
    TRUE means we're going to call handler->delete_all_rows() and not read any
    rows.
  */
  bool deleting_all_rows;

  enum explain_node_type get_type() override { return EXPLAIN_DELETE; }
  uint get_select_id() override { return 1; /* always root */ }

  int print_explain(Explain_query *query, select_result_sink *output, 
                    uint8 explain_flags, bool is_analyze) override;
  void print_explain_json(Explain_query *query, Json_writer *writer,
                          bool is_analyze) override;
};


/*
  EXPLAIN data structure for subquery materialization.

  All decisions are made at execution time so here we just store the tracker
  that has all the info.
*/

class Explain_subq_materialization : public Sql_alloc
{
public:
  Explain_subq_materialization(MEM_ROOT *mem_root)
    : tracker(mem_root)
  {}

  Subq_materialization_tracker *get_tracker() { return &tracker; }

  void print_explain_json(Json_writer *writer, bool is_analyze);

private:
  Subq_materialization_tracker tracker;
};

#endif //SQL_EXPLAIN_INCLUDED
server/private/partition_element.h000064400000012131150400263750013417 0ustar00#ifndef PARTITION_ELEMENT_INCLUDED
#define PARTITION_ELEMENT_INCLUDED

/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.

   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 "my_base.h"                            /* ha_rows */
#include "handler.h"                            /* UNDEF_NODEGROUP */

/**
 * An enum and a struct to handle partitioning and subpartitioning.
 */
enum partition_type {
  NOT_A_PARTITION= 0,
  RANGE_PARTITION,
  HASH_PARTITION,
  LIST_PARTITION,
  VERSIONING_PARTITION
};

enum partition_state {
  PART_NORMAL= 0,
  PART_IS_DROPPED= 1,
  PART_TO_BE_DROPPED= 2,
  PART_TO_BE_ADDED= 3,
  PART_TO_BE_REORGED= 4,
  PART_REORGED_DROPPED= 5,
  PART_CHANGED= 6,
  PART_IS_CHANGED= 7,
  PART_IS_ADDED= 8,
  PART_ADMIN= 9
};

/*
  This struct is used to keep track of column expressions as part
  of the COLUMNS concept in conjunction with RANGE and LIST partitioning.
  The value can be either of MINVALUE, MAXVALUE and an expression that
  must be constant and evaluate to the same type as the column it
  represents.

  The data in this fixed in two steps. The parser will only fill in whether
  it is a max_value or provide an expression. Filling in
  column_value, part_info, partition_id, null_value is done by the
  function fix_column_value_function. However the item tree needs
  fixed also before writing it into the frm file (in add_column_list_values).
  To distinguish between those two variants, fixed= 1 after the
  fixing in add_column_list_values and fixed= 2 otherwise. This is
  since the fixing in add_column_list_values isn't a complete fixing.
*/

typedef struct p_column_list_val
{
  void* column_value;
  Item* item_expression;
  partition_info *part_info;
  uint partition_id;
  bool max_value; // MAXVALUE for RANGE type or DEFAULT value for LIST type
  bool null_value;
  char fixed;
} part_column_list_val;


/*
  This struct is used to contain the value of an element
  in the VALUES IN struct. It needs to keep knowledge of
  whether it is a signed/unsigned value and whether it is
  NULL or not.
*/

typedef struct p_elem_val
{
  longlong value;
  uint added_items;
  bool null_value;
  bool unsigned_flag;
  part_column_list_val *col_val_array;
} part_elem_value;

struct st_ddl_log_memory_entry;

enum stat_trx_field
{
  STAT_TRX_END= 0
};

class partition_element :public Sql_alloc
{
public:
  enum elem_type_enum
  {
    CONVENTIONAL= 0,
    CURRENT,
    HISTORY
  };

  List<partition_element> subpartitions;
  List<part_elem_value> list_val_list;
  ha_rows part_max_rows;
  ha_rows part_min_rows;
  longlong range_value;
  const char *partition_name;
  const char *tablespace_name;
  struct st_ddl_log_memory_entry *log_entry;
  const char* part_comment;
  const char* data_file_name;
  const char* index_file_name;
  handlerton *engine_type;
  LEX_CSTRING connect_string;
  enum partition_state part_state;
  uint16 nodegroup_id;
  bool has_null_value;
  bool signed_flag;                          // Range value signed
  bool max_value;                            // MAXVALUE range
  uint32 id;
  bool empty;
  elem_type_enum type;

  partition_element()
  : part_max_rows(0), part_min_rows(0), range_value(0),
    partition_name(NULL), tablespace_name(NULL),
    log_entry(NULL), part_comment(NULL),
    data_file_name(NULL), index_file_name(NULL),
    engine_type(NULL), connect_string(null_clex_str), part_state(PART_NORMAL),
    nodegroup_id(UNDEF_NODEGROUP), has_null_value(FALSE),
    signed_flag(FALSE), max_value(FALSE),
    id(UINT_MAX32),
    empty(true),
    type(CONVENTIONAL)
  {}
  partition_element(partition_element *part_elem)
  : part_max_rows(part_elem->part_max_rows),
    part_min_rows(part_elem->part_min_rows),
    range_value(0), partition_name(NULL),
    tablespace_name(part_elem->tablespace_name),
    log_entry(NULL),
    part_comment(part_elem->part_comment),
    data_file_name(part_elem->data_file_name),
    index_file_name(part_elem->index_file_name),
    engine_type(part_elem->engine_type),
    connect_string(null_clex_str),
    part_state(part_elem->part_state),
    nodegroup_id(part_elem->nodegroup_id),
    has_null_value(FALSE),
    signed_flag(part_elem->signed_flag),
    max_value(part_elem->max_value),
    id(part_elem->id),
    empty(part_elem->empty),
    type(CONVENTIONAL)
  {}
  ~partition_element() = default;

  part_column_list_val& get_col_val(uint idx)
  {
    part_elem_value *ev= list_val_list.head();
    DBUG_ASSERT(ev);
    DBUG_ASSERT(ev->col_val_array);
    return ev->col_val_array[idx];
  }
};

#endif /* PARTITION_ELEMENT_INCLUDED */
server/private/my_uctype.h000064400000207630150400263750011725 0ustar00#ifndef MY_UCTYPE_INCLUDED
#define MY_UCTYPE_INCLUDED

/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

/*
  Unicode ctype data
  Generated from UnicodeData-5.0.0d9.txt
*/
static unsigned char uctype_page00[256]=
{
 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
  8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 16, 16, 16, 16, 16, 16,
 16, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 16, 16, 16, 16, 16,
 16, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 16, 16, 16, 16, 32,
 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
  8, 16, 16, 16, 16, 16, 16, 16, 16, 16,  2, 16, 16, 32, 16, 16,
 16, 16, 20, 20, 16,  2, 16, 16, 16, 20,  2, 16, 20, 20, 20, 16,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1, 16,  1,  1,  1,  1,  1,  1,  1,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2, 16,  2,  2,  2,  2,  2,  2,  2,  2
};

static unsigned char uctype_page01[256]=
{
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  2,  1,  2,  1,  2,  1,  2,  1,
  2,  1,  2,  1,  2,  1,  2,  1,  2,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  1,  2,  1,  2,  1,  2,  2,
  2,  1,  1,  2,  1,  2,  1,  1,  2,  1,  1,  1,  2,  2,  1,  1,
  1,  1,  2,  1,  1,  2,  1,  1,  1,  2,  2,  2,  1,  1,  2,  1,
  1,  2,  1,  2,  1,  2,  1,  1,  2,  1,  2,  2,  1,  2,  1,  1,
  2,  1,  1,  1,  2,  1,  2,  1,  1,  2,  2,  2,  1,  2,  2,  2,
  2,  2,  2,  2,  1,  1,  2,  1,  1,  2,  1,  1,  2,  1,  2,  1,
  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  2,  1,  1,  2,  1,  2,  1,  1,  1,  2,  1,  2,  1,  2,  1,  2
};

static unsigned char uctype_page02[256]=
{
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  2,  2,  2,  2,  2,  2,  1,  1,  2,  1,  1,  2,
  2,  1,  2,  1,  1,  1,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2, 16, 16, 16, 16,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  2,  2,  2,  2,  2, 16, 16, 16, 16, 16, 16, 16, 16, 16,  2, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
};

static unsigned char uctype_page03[256]=
{
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
  0,  0,  0,  0, 16, 16,  0,  0,  0,  0,  2,  2,  2,  2, 16,  0,
  0,  0,  0,  0, 16, 16,  1, 16,  1,  1,  1,  0,  1,  0,  1,  1,
  2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,
  2,  2,  1,  1,  1,  2,  2,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  2,  2,  2,  2,  1,  2, 16,  1,  2,  1,  1,  2,  2,  1,  1,  1
};

static unsigned char uctype_page04[256]=
{
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2, 16, 18, 18, 18, 18,  0, 18, 18,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2
};

static unsigned char uctype_page05[256]=
{
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  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,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  0,  0,  2, 16, 16, 16, 16, 16, 16,
  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  0, 16, 16,  0,  0,  0,  0,  0,
  0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 16, 18,
 16, 18, 18, 16, 18, 18, 16, 18,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,
  2,  2,  2, 16, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page06[256]=
{
 32, 32, 32, 32,  0,  0,  0,  0,  0,  0,  0, 16, 16, 16, 16, 16,
 18, 18, 18, 18, 18, 18,  0,  0,  0,  0,  0, 16,  0,  0, 16, 16,
  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 16, 16, 16, 16,  2,  2,
 18,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2, 16,  2, 18, 18, 18, 18, 18, 18, 18, 32, 18, 18,
 18, 18, 18, 18, 18,  2,  2, 18, 18, 16, 18, 18, 18, 18,  2,  2,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  2,  2,  2, 16, 16,  2
};

static unsigned char uctype_page07[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0, 32,
  2, 18,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  0,  0,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 18, 18, 18, 18, 18,
 18, 18, 18, 18,  2,  2, 16, 16, 16, 16,  2,  0,  0,  0,  0,  0
};

static unsigned char uctype_page09[256]=
{
  0, 18, 18, 18,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0, 18,  2, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  0,  0,
  2, 18, 18, 18, 18,  0,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2, 18, 18, 16, 16,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,  2,  2,  2,
  0, 18, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  2,
  2,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  0,  2,  0,  0,  0,  2,  2,  2,  2,  0,  0, 18,  2, 18, 18,
 18, 18, 18, 18, 18,  0,  0, 18, 18,  0,  0, 18, 18, 18,  2,  0,
  0,  0,  0,  0,  0,  0,  0, 18,  0,  0,  0,  0,  2,  2,  0,  2,
  2,  2, 18, 18,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
  2,  2, 16, 16, 20, 20, 20, 20, 20, 20, 16,  0,  0,  0,  0,  0
};

static unsigned char uctype_page0A[256]=
{
  0, 18, 18, 18,  0,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  2,
  2,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  0,  2,  2,  0,  2,  2,  0,  2,  2,  0,  0, 18,  0, 18, 18,
 18, 18, 18,  0,  0,  0,  0, 18, 18,  0,  0, 18, 18, 18,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,  2,  2,  0,  2,  0,
  0,  0,  0,  0,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
 18, 18,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0, 18, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,
  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  0,  2,  2,  0,  2,  2,  2,  2,  2,  0,  0, 18,  2, 18, 18,
 18, 18, 18, 18, 18, 18,  0, 18, 18, 18,  0, 18, 18, 18,  0,  0,
  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2, 18, 18,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
  0, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page0B[256]=
{
  0, 18, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  2,
  2,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  0,  2,  2,  0,  2,  2,  2,  2,  2,  0,  0, 18,  2, 18, 18,
 18, 18, 18, 18,  0,  0,  0, 18, 18,  0,  0, 18, 18, 18,  0,  0,
  0,  0,  0,  0,  0,  0, 18, 18,  0,  0,  0,  0,  2,  2,  0,  2,
  2,  2,  0,  0,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
 16,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0, 18,  2,  0,  2,  2,  2,  2,  2,  2,  0,  0,  0,  2,  2,
  2,  0,  2,  2,  2,  2,  0,  0,  0,  2,  2,  0,  2,  0,  2,  2,
  0,  0,  0,  2,  2,  0,  0,  0,  2,  2,  2,  0,  0,  0,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0, 18, 18,
 18, 18, 18,  0,  0,  0, 18, 18, 18,  0, 18, 18, 18, 18,  0,  0,
  0,  0,  0,  0,  0,  0,  0, 18,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
 20, 20, 20, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0
};

static unsigned char uctype_page0C[256]=
{
  0, 18, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,
  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  0,  0,  0,  0, 18, 18,
 18, 18, 18, 18, 18,  0, 18, 18, 18,  0, 18, 18, 18, 18,  0,  0,
  0,  0,  0,  0,  0, 18, 18,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  0,  0,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,
  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  0,  0, 18,  2, 18, 18,
 18, 18, 18, 18, 18,  0, 18, 18, 18,  0, 18, 18, 18, 18,  0,  0,
  0,  0,  0,  0,  0, 18, 18,  0,  0,  0,  0,  0,  0,  0,  2,  0,
  2,  2, 18, 18,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
  0, 16, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page0D[256]=
{
  0,  0, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,
  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0, 18, 18,
 18, 18, 18, 18,  0,  0, 18, 18, 18,  0, 18, 18, 18, 18,  0,  0,
  0,  0,  0,  0,  0,  0,  0, 18,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  0,  0,  0,  0,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0, 18, 18,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  0,  0,  0, 18,  0,  0,  0,  0, 18,
 18, 18, 18, 18, 18,  0, 18,  0, 18, 18, 18, 18, 18, 18, 18, 18,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0, 18, 18, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page0E[256]=
{
  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2, 18,  2,  2, 18, 18, 18, 18, 18, 18, 18,  0,  0,  0,  0, 16,
  2,  2,  2,  2,  2,  2,  2, 18, 18, 18, 18, 18, 18, 18, 18, 16,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 16, 16,  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,  2,  2,  0,  2,  0,  0,  2,  2,  0,  2,  0,  0,  2,  0,  0,
  0,  0,  0,  0,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,
  0,  2,  2,  2,  0,  2,  0,  2,  0,  0,  2,  2,  0,  2,  2,  2,
  2, 18,  2,  2, 18, 18, 18, 18, 18, 18,  0, 18, 18,  2,  0,  0,
  2,  2,  2,  2,  2,  0,  2,  0, 18, 18, 18, 18, 18, 18,  0,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  0,  0,  2,  2,  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
};

static unsigned char uctype_page0F[256]=
{
  2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 16, 16, 16, 16, 16, 16,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 16, 18, 16, 18, 16, 18, 16, 16, 16, 16, 18, 18,
  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,
  0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 16, 18, 18,  2,  2,  2,  2,  0,  0,  0,  0,
 18, 18, 18, 18, 18, 18, 18, 18,  0, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  0, 16, 16,
 16, 16, 16, 16, 16, 16, 18, 16, 16, 16, 16, 16, 16,  0,  0, 16,
 16, 16,  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
};

static unsigned char uctype_page10[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  0,  2,  2,  2,  2,  2,  0,  2,  2,  0, 18, 18, 18, 18,
 18, 18, 18,  0,  0,  0, 18, 18, 18, 18,  0,  0,  0,  0,  0,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 16, 16, 16, 16, 16, 16,
  2,  2,  2,  2,  2,  2, 18, 18, 18, 18,  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,  0,  0,  0,  0,  0,  0,  0,  0,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16,  2,  0,  0,  0
};

static unsigned char uctype_page11[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  0,  0,  0,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page12[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  0,  2,  2,  2,  2,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,  2,  2,  2,  2,  0,
  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2
};

static unsigned char uctype_page13[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0, 18,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page14[256]=
{
  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2
};

static unsigned char uctype_page16[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16,  2,
  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  8,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16, 16,  7,  7,
  7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page17[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,
  2,  2, 18, 18, 18,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2, 18, 18, 18, 16, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2, 18, 18,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,
  2,  0, 18, 18,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2, 32, 32, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 16, 16, 16,  2, 16, 16, 16, 16,  2, 18,  0,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  0,  0,  0,  0,  0,  0,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page18[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18,  8,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2, 18,  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,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page19[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  0,  0,  0,  0,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  0,  0,  0,  0,
 16,  0,  0,  0, 16, 16,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,
  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18,  2,  2,  2,  2,  2,  2,  2, 18, 18,  0,  0,  0,  0,  0,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  0,  0,  0,  0, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
};

static unsigned char uctype_page1A[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2, 18, 18, 18, 18, 18,  0,  0, 16, 16,
  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,  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,  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,  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
};

static unsigned char uctype_page1B[256]=
{
 18, 18, 18, 18, 18,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16,  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,  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,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page1D[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,  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, 18, 18
};

static unsigned char uctype_page1E[256]=
{
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page1F[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  0,  0,  1,  1,  1,  1,  1,  1,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  0,  0,  1,  1,  1,  1,  1,  1,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  0,  1,  0,  1,  0,  1,  0,  1,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1,  1,  1,  1,
  2,  2,  2,  2,  2,  0,  2,  2,  1,  1,  1,  1,  1, 16,  2, 16,
 16, 16,  2,  2,  2,  0,  2,  2,  1,  1,  1,  1,  1, 16, 16, 16,
  2,  2,  2,  2,  0,  0,  2,  2,  1,  1,  1,  1,  0, 16, 16, 16,
  2,  2,  2,  2,  2,  2,  2,  2,  1,  1,  1,  1,  1, 16, 16, 16,
  0,  0,  2,  2,  2,  0,  2,  2,  1,  1,  1,  1,  1, 16, 16,  0
};

static unsigned char uctype_page20[256]=
{
  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8, 32, 32, 32, 32, 32,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16,  8,  8, 32, 32, 32, 32, 32,  8,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  8,
 32, 32, 32, 32,  0,  0,  0,  0,  0,  0, 32, 32, 32, 32, 32, 32,
 20,  2,  0,  0, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16,  2,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16,  0,
  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16,  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,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page21[256]=
{
 16, 16,  1, 16, 16, 16, 16,  1, 16, 16,  2,  1,  1,  1,  2,  2,
  1,  1,  1,  2, 16,  1, 16, 16, 16,  1,  1,  1,  1,  1, 16, 16,
 16, 16, 16, 16,  1, 16,  1, 16,  1, 16,  1,  1,  1,  1, 16,  2,
  1,  1,  1,  1,  2,  2,  2,  2,  2,  2, 16, 16,  2,  2,  1,  1,
 16, 16, 16, 16, 16,  1,  2,  2,  2,  2, 16, 16, 16, 16,  2,  0,
  0,  0,  0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,
  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,
  7,  7,  7,  1,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
};

static unsigned char uctype_page23[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page24[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16,  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,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
};

static unsigned char uctype_page26[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16,  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,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page27[256]=
{
  0, 16, 16, 16, 16,  0, 16, 16, 16, 16,  0,  0, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16,  0, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0, 16,  0, 16,
 16, 16, 16,  0,  0,  0, 16,  0, 16, 16, 16, 16, 16, 16, 16,  0,
  0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 20, 20, 20, 20, 16,  0,  0,  0, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
};

static unsigned char uctype_page2B[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,
 16, 16, 16, 16,  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,  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,
  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,  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
};

static unsigned char uctype_page2C[256]=
{
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,
  1,  2,  1,  1,  1,  2,  2,  1,  2,  1,  2,  1,  2,  0,  0,  0,
  0,  0,  0,  0,  2,  1,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,
  1,  2,  1,  2,  2, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0, 16, 16, 16, 16, 20, 16, 16
};

static unsigned char uctype_page2D[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  0,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  0,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  0,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  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
};

static unsigned char uctype_page2E[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0, 16, 16,  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,  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,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_page2F[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16,  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,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0
};

static unsigned char uctype_page30[256]=
{
  8, 16, 16, 16, 16,  2,  2,  7, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16,  7,  7,  7,  7,  7,  7,  7,  7,  7, 18, 18, 18, 18, 18, 18,
 16,  2,  2,  2,  2,  2, 16, 16,  7,  7,  7,  2,  2, 16, 16, 16,
  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  0,  0, 18, 18, 16, 16,  2,  2,  2,
 16,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16,  2,  2,  2,  2
};

static unsigned char uctype_page31[256]=
{
  0,  0,  0,  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,
  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,
 16, 16, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  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,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2
};

static unsigned char uctype_page32[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0
};

static unsigned char uctype_page4D[256]=
{
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
};

static unsigned char uctype_page9F[256]=
{
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  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,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_pageA4[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16,  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
};

static unsigned char uctype_pageA7[256]=
{
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16,  2,  2,  2,  2,  0,  0,  0,  0,  0,
 16, 16,  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,
  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,  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,  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
};

static unsigned char uctype_pageA8[256]=
{
  2,  2, 18,  2,  2,  2, 18,  2,  2,  2,  2, 18,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2, 18, 18, 18, 18, 18, 16, 16, 16, 16,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2, 16, 16, 16, 16,  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,  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,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_pageD7[256]=
{
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
  3,  3,  3,  3,  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,  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
};

static unsigned char uctype_pageD8[256]=
{
 32,  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,  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,  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,  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,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_pageDB[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,  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,  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, 32,
 32,  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,  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,  0,  0, 32
};

static unsigned char uctype_pageDC[256]=
{
 32,  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,  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,  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,  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,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_pageDF[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,  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,  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,  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,  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, 32
};

static unsigned char uctype_pageE0[256]=
{
 32,  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,  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,  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,  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,  0,  0,  0,  0,  0,  0,  0
};

static unsigned char uctype_pageF8[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,  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,  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,  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,  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, 32
};

static unsigned char uctype_pageFA[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  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
};

static unsigned char uctype_pageFB[256]=
{
  2,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  2,  2,  2,  2,  2,  0,  0,  0,  0,  0,  2, 18,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2, 16,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  0,  2,  0,
  2,  2,  0,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  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,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2
};

static unsigned char uctype_pageFD[256]=
{
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  0,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  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,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16,  0,  0
};

static unsigned char uctype_pageFE[256]=
{
 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  0,  0,  0,  0,  0,  0,
 18, 18, 18, 18,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16,  0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16, 16,  0, 16, 16, 16, 16,  0,  0,  0,  0,
  2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,  0, 32
};

static unsigned char uctype_pageFF[256]=
{
  0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 16, 16, 16, 16, 16, 16,
 16,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 16, 16, 16, 16, 16,
 16,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16, 16, 16, 16,
 16, 16, 16, 16, 16, 16,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  0,
  0,  0,  2,  2,  2,  2,  2,  2,  0,  0,  2,  2,  2,  2,  2,  2,
  0,  0,  2,  2,  2,  2,  2,  2,  0,  0,  2,  2,  2,  0,  0,  0,
 16, 16, 16, 16, 16, 16, 16,  0, 16, 16, 16, 16, 16, 16, 16,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0, 32, 32, 32, 16, 16,  0,  0
};

MY_UNI_CTYPE my_uni_ctype[256]={
	{0,uctype_page00},
	{0,uctype_page01},
	{0,uctype_page02},
	{0,uctype_page03},
	{0,uctype_page04},
	{0,uctype_page05},
	{0,uctype_page06},
	{0,uctype_page07},
	{0,NULL},
	{0,uctype_page09},
	{0,uctype_page0A},
	{0,uctype_page0B},
	{0,uctype_page0C},
	{0,uctype_page0D},
	{0,uctype_page0E},
	{0,uctype_page0F},
	{0,uctype_page10},
	{0,uctype_page11},
	{0,uctype_page12},
	{0,uctype_page13},
	{0,uctype_page14},
	{2,NULL},
	{0,uctype_page16},
	{0,uctype_page17},
	{0,uctype_page18},
	{0,uctype_page19},
	{0,uctype_page1A},
	{0,uctype_page1B},
	{0,NULL},
	{0,uctype_page1D},
	{0,uctype_page1E},
	{0,uctype_page1F},
	{0,uctype_page20},
	{0,uctype_page21},
	{16,NULL},
	{0,uctype_page23},
	{0,uctype_page24},
	{16,NULL},
	{0,uctype_page26},
	{0,uctype_page27},
	{16,NULL},
	{16,NULL},
	{16,NULL},
	{0,uctype_page2B},
	{0,uctype_page2C},
	{0,uctype_page2D},
	{0,uctype_page2E},
	{0,uctype_page2F},
	{0,uctype_page30},
	{0,uctype_page31},
	{0,uctype_page32},
	{16,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{0,uctype_page4D},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{0,uctype_page9F},
	{2,NULL},
	{2,NULL},
	{2,NULL},
	{2,NULL},
	{0,uctype_pageA4},
	{0,NULL},
	{0,NULL},
	{0,uctype_pageA7},
	{0,uctype_pageA8},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{3,NULL},
	{0,uctype_pageD7},
	{0,uctype_pageD8},
	{0,NULL},
	{0,NULL},
	{0,uctype_pageDB},
	{0,uctype_pageDC},
	{0,NULL},
	{0,NULL},
	{0,uctype_pageDF},
	{0,uctype_pageE0},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,NULL},
	{0,uctype_pageF8},
	{2,NULL},
	{0,uctype_pageFA},
	{0,uctype_pageFB},
	{2,NULL},
	{0,uctype_pageFD},
	{0,uctype_pageFE},
	{0,uctype_pageFF}
};


#endif /* MY_UCTYPE_INCLUDED */
server/private/opt_range.h000064400000164307150400263750011670 0ustar00/*
   Copyright (c) 2000, 2010, Oracle and/or its affiliates.

   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 */


/* classes to use when handling where clause */

#ifndef _opt_range_h
#define _opt_range_h

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "records.h"                            /* READ_RECORD */
#include "queues.h"                             /* QUEUE */
#include "filesort.h"                           /* SORT_INFO */

/*
  It is necessary to include set_var.h instead of item.h because there
  are dependencies on include order for set_var.h and item.h. This
  will be resolved later.
*/
#include "sql_class.h"                          // set_var.h: THD
#include "set_var.h"                            /* Item */

class JOIN;
class Item_sum;

struct KEY_PART {
  uint16           key,part;
  /* See KEY_PART_INFO for meaning of the next two: */
  uint16           store_length, length;
  uint8            null_bit;
  /*
    Keypart flags (0 when this structure is used by partition pruning code
    for fake partitioning index description)
  */
  uint8 flag;
  Field            *field;
  Field::imagetype image_type;
};


class RANGE_OPT_PARAM;
/*
  A construction block of the SEL_ARG-graph.

  The following description only covers graphs of SEL_ARG objects with
  sel_arg->type==KEY_RANGE:

  One SEL_ARG object represents an "elementary interval" in form

      min_value <=?  table.keypartX  <=? max_value

  The interval is a non-empty interval of any kind: with[out] minimum/maximum
  bound, [half]open/closed, single-point interval, etc.

  1. SEL_ARG GRAPH STRUCTURE

  SEL_ARG objects are linked together in a graph. The meaning of the graph
  is better demostrated by an example:

     tree->keys[i]
      |
      |             $              $
      |    part=1   $     part=2   $    part=3
      |             $              $
      |  +-------+  $   +-------+  $   +--------+
      |  | kp1<1 |--$-->| kp2=5 |--$-->| kp3=10 |
      |  +-------+  $   +-------+  $   +--------+
      |      |      $              $       |
      |      |      $              $   +--------+
      |      |      $              $   | kp3=12 |
      |      |      $              $   +--------+
      |  +-------+  $              $
      \->| kp1=2 |--$--------------$-+
         +-------+  $              $ |   +--------+
             |      $              $  ==>| kp3=11 |
         +-------+  $              $ |   +--------+
         | kp1=3 |--$--------------$-+       |
         +-------+  $              $     +--------+
             |      $              $     | kp3=14 |
            ...     $              $     +--------+

  The entire graph is partitioned into "interval lists".

  An interval list is a sequence of ordered disjoint intervals over the same
  key part. SEL_ARG are linked via "next" and "prev" pointers. Additionally,
  all intervals in the list form an RB-tree, linked via left/right/parent
  pointers. The RB-tree root SEL_ARG object will be further called "root of the
  interval list".

    In the example pic, there are 4 interval lists:
    "kp<1 OR kp1=2 OR kp1=3", "kp2=5", "kp3=10 OR kp3=12", "kp3=11 OR kp3=13".
    The vertical lines represent SEL_ARG::next/prev pointers.

  In an interval list, each member X may have SEL_ARG::next_key_part pointer
  pointing to the root of another interval list Y. The pointed interval list
  must cover a key part with greater number (i.e. Y->part > X->part).

    In the example pic, the next_key_part pointers are represented by
    horisontal lines.

  2. SEL_ARG GRAPH SEMANTICS

  It represents a condition in a special form (we don't have a name for it ATM)
  The SEL_ARG::next/prev is "OR", and next_key_part is "AND".

  For example, the picture represents the condition in form:
   (kp1 < 1 AND kp2=5 AND (kp3=10 OR kp3=12)) OR
   (kp1=2 AND (kp3=11 OR kp3=14)) OR
   (kp1=3 AND (kp3=11 OR kp3=14))


  3. SEL_ARG GRAPH USE

  Use get_mm_tree() to construct SEL_ARG graph from WHERE condition.
  Then walk the SEL_ARG graph and get a list of dijsoint ordered key
  intervals (i.e. intervals in form

   (constA1, .., const1_K) < (keypart1,.., keypartK) < (constB1, .., constB_K)

  Those intervals can be used to access the index. The uses are in:
   - check_quick_select() - Walk the SEL_ARG graph and find an estimate of
                            how many table records are contained within all
                            intervals.
   - get_quick_select()   - Walk the SEL_ARG, materialize the key intervals,
                            and create QUICK_RANGE_SELECT object that will
                            read records within these intervals.

  4. SPACE COMPLEXITY NOTES

    SEL_ARG graph is a representation of an ordered disjoint sequence of
    intervals over the ordered set of index tuple values.

    For multi-part keys, one can construct a WHERE expression such that its
    list of intervals will be of combinatorial size. Here is an example:

      (keypart1 IN (1,2, ..., n1)) AND
      (keypart2 IN (1,2, ..., n2)) AND
      (keypart3 IN (1,2, ..., n3))

    For this WHERE clause the list of intervals will have n1*n2*n3 intervals
    of form

      (keypart1, keypart2, keypart3) = (k1, k2, k3), where 1 <= k{i} <= n{i}

    SEL_ARG graph structure aims to reduce the amount of required space by
    "sharing" the elementary intervals when possible (the pic at the
    beginning of this comment has examples of such sharing). The sharing may
    prevent combinatorial blowup:

      There are WHERE clauses that have combinatorial-size interval lists but
      will be represented by a compact SEL_ARG graph.
      Example:
        (keypartN IN (1,2, ..., n1)) AND
        ...
        (keypart2 IN (1,2, ..., n2)) AND
        (keypart1 IN (1,2, ..., n3))

    but not in all cases:

    - There are WHERE clauses that do have a compact SEL_ARG-graph
      representation but get_mm_tree() and its callees will construct a
      graph of combinatorial size.
      Example:
        (keypart1 IN (1,2, ..., n1)) AND
        (keypart2 IN (1,2, ..., n2)) AND
        ...
        (keypartN IN (1,2, ..., n3))

    - There are WHERE clauses for which the minimal possible SEL_ARG graph
      representation will have combinatorial size.
      Example:
        By induction: Let's take any interval on some keypart in the middle:

           kp15=c0

        Then let's AND it with this interval 'structure' from preceding and
        following keyparts:

          (kp14=c1 AND kp16=c3) OR keypart14=c2) (*)

        We will obtain this SEL_ARG graph:

             kp14     $      kp15      $      kp16
                      $                $
         +---------+  $   +---------+  $   +---------+
         | kp14=c1 |--$-->| kp15=c0 |--$-->| kp16=c3 |
         +---------+  $   +---------+  $   +---------+
              |       $                $
         +---------+  $   +---------+  $
         | kp14=c2 |--$-->| kp15=c0 |  $
         +---------+  $   +---------+  $
                      $                $

       Note that we had to duplicate "kp15=c0" and there was no way to avoid
       that.
       The induction step: AND the obtained expression with another "wrapping"
       expression like (*).
       When the process ends because of the limit on max. number of keyparts
       we'll have:

         WHERE clause length  is O(3*#max_keyparts)
         SEL_ARG graph size   is O(2^(#max_keyparts/2))

       (it is also possible to construct a case where instead of 2 in 2^n we
        have a bigger constant, e.g. 4, and get a graph with 4^(31/2)= 2^31
        nodes)

    We avoid consuming too much memory by setting a limit on the number of
    SEL_ARG object we can construct during one range analysis invocation.

  5. SEL_ARG GRAPH WEIGHT

    A SEL_ARG graph has a property we call weight, and we define it as follows:

    <definition>
    If the SEL_ARG graph does not have any node with multiple incoming
    next_key_part edges, then its weight is the number of SEL_ARG objects used.

    If there is a node with multiple incoming next_key_part edges, clone that
    node, (and the nodes connected to it via prev/next links) and redirect one
    of the incoming next_key_part edges to the clone.

    Continue with cloning until we get a graph that has no nodes with multiple
    incoming next_key_part edges. Then, the number of SEL_ARG objects in the
    graph is the weight of the original graph.
    </definition>

    Example:

            kp1     $     kp2      $       kp3
                    $              $
      |  +-------+  $              $
      \->| kp1=2 |--$--------------$-+
         +-------+  $              $ |   +--------+
             |      $              $  ==>| kp3=11 |
         +-------+  $              $ |   +--------+
         | kp1>3 |--$--------------$-+       |
         +-------+  $              $     +--------+
                    $              $     | kp3=14 |
                    $              $     +--------+
                    $              $         |
                    $              $     +--------+
                    $              $     | kp3=14 |
                    $              $     +--------+

    Here, the weight is 2 + 2*3=8.

    The rationale behind using this definition of weight is:
    - it has the same order-of-magnitude as the number of ranges that the
      SEL_ARG graph is describing,
    - it is a lot easier to compute than computing the number of ranges,
    - it can be updated incrementally when performing AND/OR operations on
      parts of the graph.
*/

class SEL_ARG :public Sql_alloc
{
  static int sel_cmp(Field *field, uchar *a, uchar *b, uint8 a_flag,
                     uint8 b_flag);
public:
  uint8 min_flag,max_flag,maybe_flag;
  uint8 part;					// Which key part
  uint8 maybe_null;
  /*
    The ordinal number the least significant component encountered in
    the ranges of the SEL_ARG tree (the first component has number 1)

    Note: this number is currently not precise, it is an upper bound.
    @seealso SEL_ARG::get_max_key_part()
  */
  uint16 max_part_no;
  /*
    Number of children of this element in the RB-tree, plus 1 for this
    element itself.
  */
  uint32 elements;
  /*
    Valid only for elements which are RB-tree roots: Number of times this
    RB-tree is referred to (it is referred by SEL_ARG::next_key_part or by
    SEL_TREE::keys[i] or by a temporary SEL_ARG* variable)
  */
  ulong use_count;

  Field *field;
  uchar *min_value,*max_value;			// Pointer to range

  /*
    eq_tree() requires that left == right == 0 if the type is MAYBE_KEY.
   */
  SEL_ARG *left,*right;   /* R-B tree children */
  SEL_ARG *next,*prev;    /* Links for bi-directional interval list */
  SEL_ARG *parent;        /* R-B tree parent */
  SEL_ARG *next_key_part;
  enum leaf_color { BLACK,RED } color;
  enum Type { IMPOSSIBLE, MAYBE, MAYBE_KEY, KEY_RANGE } type;

  /*
    For R-B root nodes only: the graph weight, as defined above in the
    SEL_ARG GRAPH WEIGHT section.
  */
  uint weight;
  enum { MAX_WEIGHT = 32000 };

#ifndef DBUG_OFF
  uint verify_weight();
#endif

  /* See RANGE_OPT_PARAM::alloced_sel_args */
  enum { DEFAULT_MAX_SEL_ARGS = 16000 };

  SEL_ARG() = default;
  SEL_ARG(SEL_ARG &);
  SEL_ARG(Field *,const uchar *, const uchar *);
  SEL_ARG(Field *field, uint8 part, uchar *min_value, uchar *max_value,
	  uint8 min_flag, uint8 max_flag, uint8 maybe_flag);
  SEL_ARG(enum Type type_arg)
    :min_flag(0), max_part_no(0) /* first key part means 1. 0 mean 'no parts'*/,
     elements(1),use_count(1),left(0),right(0),
     next_key_part(0), color(BLACK), type(type_arg), weight(1)
  {}
  /**
    returns true if a range predicate is equal. Use all_same()
    to check for equality of all the predicates on this keypart.
  */
  inline bool is_same(const SEL_ARG *arg) const
  {
    if (type != arg->type || part != arg->part)
      return false;
    if (type != KEY_RANGE)
      return true;
    return cmp_min_to_min(arg) == 0 && cmp_max_to_max(arg) == 0;
  }

  uint get_max_key_part() const;

  /**
    returns true if all the predicates in the keypart tree are equal
  */
  bool all_same(const SEL_ARG *arg) const
  {
    if (type != arg->type || part != arg->part)
      return false;
    if (type != KEY_RANGE)
      return true;
    if (arg == this)
      return true;
    const SEL_ARG *cmp_arg= arg->first();
    const SEL_ARG *cur_arg= first();
    for (; cur_arg && cmp_arg && cur_arg->is_same(cmp_arg);
         cur_arg= cur_arg->next, cmp_arg= cmp_arg->next) ;
    if (cur_arg || cmp_arg)
      return false;
    return true;
  }
  inline void merge_flags(SEL_ARG *arg) { maybe_flag|=arg->maybe_flag; }
  inline void maybe_smaller() { maybe_flag=1; }
  /* Return true iff it's a single-point null interval */
  inline bool is_null_interval() { return maybe_null && max_value[0] == 1; }
  inline int cmp_min_to_min(const SEL_ARG* arg) const
  {
    return sel_cmp(field,min_value, arg->min_value, min_flag, arg->min_flag);
  }
  inline int cmp_min_to_max(const SEL_ARG* arg) const
  {
    return sel_cmp(field,min_value, arg->max_value, min_flag, arg->max_flag);
  }
  inline int cmp_max_to_max(const SEL_ARG* arg) const
  {
    return sel_cmp(field,max_value, arg->max_value, max_flag, arg->max_flag);
  }
  inline int cmp_max_to_min(const SEL_ARG* arg) const
  {
    return sel_cmp(field,max_value, arg->min_value, max_flag, arg->min_flag);
  }
  SEL_ARG *clone_and(THD *thd, SEL_ARG* arg)
  {						// Get overlapping range
    uchar *new_min,*new_max;
    uint8 flag_min,flag_max;
    if (cmp_min_to_min(arg) >= 0)
    {
      new_min=min_value; flag_min=min_flag;
    }
    else
    {
      new_min=arg->min_value; flag_min=arg->min_flag; /* purecov: deadcode */
    }
    if (cmp_max_to_max(arg) <= 0)
    {
      new_max=max_value; flag_max=max_flag;
    }
    else
    {
      new_max=arg->max_value; flag_max=arg->max_flag;
    }
    return new (thd->mem_root) SEL_ARG(field, part, new_min, new_max, flag_min,
                                       flag_max,
                                       MY_TEST(maybe_flag && arg->maybe_flag));
  }
  SEL_ARG *clone_first(SEL_ARG *arg)
  {						// min <= X < arg->min
    return new SEL_ARG(field,part, min_value, arg->min_value,
		       min_flag, arg->min_flag & NEAR_MIN ? 0 : NEAR_MAX,
		       maybe_flag | arg->maybe_flag);
  }
  SEL_ARG *clone_last(SEL_ARG *arg)
  {						// min <= X <= key_max
    return new SEL_ARG(field, part, min_value, arg->max_value,
		       min_flag, arg->max_flag, maybe_flag | arg->maybe_flag);
  }
  SEL_ARG *clone(RANGE_OPT_PARAM *param, SEL_ARG *new_parent, SEL_ARG **next);

  bool copy_min(SEL_ARG* arg)
  {						// Get overlapping range
    if (cmp_min_to_min(arg) > 0)
    {
      min_value=arg->min_value; min_flag=arg->min_flag;
      if ((max_flag & (NO_MAX_RANGE | NO_MIN_RANGE)) ==
	  (NO_MAX_RANGE | NO_MIN_RANGE))
	return 1;				// Full range
    }
    maybe_flag|=arg->maybe_flag;
    return 0;
  }
  bool copy_max(SEL_ARG* arg)
  {						// Get overlapping range
    if (cmp_max_to_max(arg) <= 0)
    {
      max_value=arg->max_value; max_flag=arg->max_flag;
      if ((max_flag & (NO_MAX_RANGE | NO_MIN_RANGE)) ==
	  (NO_MAX_RANGE | NO_MIN_RANGE))
	return 1;				// Full range
    }
    maybe_flag|=arg->maybe_flag;
    return 0;
  }

  void copy_min_to_min(SEL_ARG *arg)
  {
    min_value=arg->min_value; min_flag=arg->min_flag;
  }
  void copy_min_to_max(SEL_ARG *arg)
  {
    max_value=arg->min_value;
    max_flag=arg->min_flag & NEAR_MIN ? 0 : NEAR_MAX;
  }
  void copy_max_to_min(SEL_ARG *arg)
  {
    min_value=arg->max_value;
    min_flag=arg->max_flag & NEAR_MAX ? 0 : NEAR_MIN;
  }
  /* returns a number of keypart values (0 or 1) appended to the key buffer */
  int store_min(uint length, uchar **min_key,uint min_key_flag)
  {
    /* "(kp1 > c1) AND (kp2 OP c2) AND ..." -> (kp1 > c1) */
    if ((min_flag & GEOM_FLAG) ||
        (!(min_flag & NO_MIN_RANGE) &&
	!(min_key_flag & (NO_MIN_RANGE | NEAR_MIN))))
    {
      if (maybe_null && *min_value)
      {
	**min_key=1;
	bzero(*min_key+1,length-1);
      }
      else
	memcpy(*min_key,min_value,length);
      (*min_key)+= length;
      return 1;
    }
    return 0;
  }
  /* returns a number of keypart values (0 or 1) appended to the key buffer */
  int store_max(uint length, uchar **max_key, uint max_key_flag)
  {
    if (!(max_flag & NO_MAX_RANGE) &&
	!(max_key_flag & (NO_MAX_RANGE | NEAR_MAX)))
    {
      if (maybe_null && *max_value)
      {
	**max_key=1;
	bzero(*max_key+1,length-1);
      }
      else
	memcpy(*max_key,max_value,length);
      (*max_key)+= length;
      return 1;
    }
    return 0;
  }

  /*
    Returns a number of keypart values appended to the key buffer
    for min key and max key. This function is used by both Range
    Analysis and Partition pruning. For partition pruning we have
    to ensure that we don't store also subpartition fields. Thus
    we have to stop at the last partition part and not step into
    the subpartition fields. For Range Analysis we set last_part
    to MAX_KEY which we should never reach.
  */
  int store_min_key(KEY_PART *key,
                    uchar **range_key,
                    uint *range_key_flag,
                    uint last_part)
  {
    SEL_ARG *key_tree= first();
    uint res= key_tree->store_min(key[key_tree->part].store_length,
                                  range_key, *range_key_flag);
    // add flags only if a key_part is written to the buffer
    if (!res)
      return 0;
    *range_key_flag|= key_tree->min_flag;
    if (key_tree->next_key_part &&
	key_tree->next_key_part->type == SEL_ARG::KEY_RANGE &&
        key_tree->part != last_part &&
	key_tree->next_key_part->part == key_tree->part+1 &&
	!(*range_key_flag & (NO_MIN_RANGE | NEAR_MIN)))
      res+= key_tree->next_key_part->store_min_key(key,
                                                   range_key,
                                                   range_key_flag,
                                                   last_part);
    return res;
  }

  /* returns a number of keypart values appended to the key buffer */
  int store_max_key(KEY_PART *key,
                    uchar **range_key,
                    uint *range_key_flag,
                    uint last_part)
  {
    SEL_ARG *key_tree= last();
    uint res=key_tree->store_max(key[key_tree->part].store_length,
                                 range_key, *range_key_flag);
    if (!res)
      return 0;
    *range_key_flag|= key_tree->max_flag;
    if (key_tree->next_key_part &&
	key_tree->next_key_part->type == SEL_ARG::KEY_RANGE &&
        key_tree->part != last_part &&
	key_tree->next_key_part->part == key_tree->part+1 &&
	!(*range_key_flag & (NO_MAX_RANGE | NEAR_MAX)))
      res+= key_tree->next_key_part->store_max_key(key,
                                                   range_key,
                                                   range_key_flag,
                                                   last_part);
    return res;
  }

  SEL_ARG *insert(SEL_ARG *key);
  SEL_ARG *tree_delete(SEL_ARG *key);
  SEL_ARG *find_range(SEL_ARG *key);
  SEL_ARG *rb_insert(SEL_ARG *leaf);
  friend SEL_ARG *rb_delete_fixup(SEL_ARG *root,SEL_ARG *key, SEL_ARG *par);
#ifdef EXTRA_DEBUG
  friend int test_rb_tree(SEL_ARG *element,SEL_ARG *parent);
  void test_use_count(SEL_ARG *root);
#endif
  SEL_ARG *first();
  const SEL_ARG *first() const;
  SEL_ARG *last();
  void make_root();
  inline bool simple_key()
  {
    return !next_key_part && elements == 1;
  }
  void increment_use_count(long count)
  {
    if (next_key_part)
    {
      next_key_part->use_count+=count;
      count*= (next_key_part->use_count-count);
      for (SEL_ARG *pos=next_key_part->first(); pos ; pos=pos->next)
	if (pos->next_key_part)
	  pos->increment_use_count(count);
    }
  }
  void incr_refs()
  {
    increment_use_count(1);
    use_count++;
  }
  void incr_refs_all()
  {
    for (SEL_ARG *pos=first(); pos ; pos=pos->next)
    {
      pos->increment_use_count(1);
    }
    use_count++;
  }
  void free_tree()
  {
    for (SEL_ARG *pos=first(); pos ; pos=pos->next)
      if (pos->next_key_part)
      {
	pos->next_key_part->use_count--;
	pos->next_key_part->free_tree();
      }
  }

  inline SEL_ARG **parent_ptr()
  {
    return parent->left == this ? &parent->left : &parent->right;
  }


  /*
    Check if this SEL_ARG object represents a single-point interval

    SYNOPSIS
      is_singlepoint()

    DESCRIPTION
      Check if this SEL_ARG object (not tree) represents a single-point
      interval, i.e. if it represents a "keypart = const" or
      "keypart IS NULL".

    RETURN
      TRUE   This SEL_ARG object represents a singlepoint interval
      FALSE  Otherwise
  */

  bool is_singlepoint() const
  {
    /*
      Check for NEAR_MIN ("strictly less") and NO_MIN_RANGE (-inf < field)
      flags, and the same for right edge.
    */
    if (min_flag || max_flag)
      return FALSE;
    uchar *min_val= min_value;
    uchar *max_val= max_value;

    if (maybe_null)
    {
      /* First byte is a NULL value indicator */
      if (*min_val != *max_val)
        return FALSE;

      if (*min_val)
        return TRUE; /* This "x IS NULL" */
      min_val++;
      max_val++;
    }
    return !field->key_cmp(min_val, max_val);
  }
  SEL_ARG *clone_tree(RANGE_OPT_PARAM *param);
};

extern MYSQL_PLUGIN_IMPORT SEL_ARG null_element;

class SEL_ARG_IMPOSSIBLE: public SEL_ARG
{
public:
  SEL_ARG_IMPOSSIBLE(Field *field)
   :SEL_ARG(field, 0, 0)
  {
    type= SEL_ARG::IMPOSSIBLE;
  }
};


class RANGE_OPT_PARAM
{
public:
  THD	*thd;   /* Current thread handle */
  TABLE *table; /* Table being analyzed */
  table_map prev_tables;
  table_map read_tables;
  table_map current_table; /* Bit of the table being analyzed */

  /* Array of parts of all keys for which range analysis is performed */
  KEY_PART *key_parts;
  KEY_PART *key_parts_end;
  MEM_ROOT *mem_root; /* Memory that will be freed when range analysis completes */
  MEM_ROOT *old_root; /* Memory that will last until the query end */
  /*
    Number of indexes used in range analysis (In SEL_TREE::keys only first
    #keys elements are not empty)
  */
  uint keys;

  /*
    If true, the index descriptions describe real indexes (and it is ok to
    call field->optimize_range(real_keynr[...], ...).
    Otherwise index description describes fake indexes.
  */
  bool using_real_indexes;

  /*
    Aggressively remove "scans" that do not have conditions on first
    keyparts. Such scans are usable when doing partition pruning but not
    regular range optimization.
  */
  bool remove_jump_scans;

  /*
    TRUE <=> Range analyzer should remove parts of condition that are found
    to be always FALSE.
  */
  bool remove_false_where_parts;

  /*
    Which functions should give SQL notes for unusable keys.
  */
  Item_func::Bitmap note_unusable_keys;

  /*
    used_key_no -> table_key_no translation table. Only makes sense if
    using_real_indexes==TRUE
  */
  uint real_keynr[MAX_KEY];

  /*
    Used to store 'current key tuples', in both range analysis and
    partitioning (list) analysis
  */
  uchar *min_key;
  uchar *max_key;

  /* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */
  uint alloced_sel_args;

  bool force_default_mrr;
  KEY_PART *key[MAX_KEY]; /* First key parts of keys used in the query */

  bool statement_should_be_aborted() const
  {
    return
      thd->killed ||
      thd->is_error() ||
      alloced_sel_args > thd->variables.optimizer_max_sel_args;
  }
};


class Explain_quick_select;
/*
  A "MIN_TUPLE < tbl.key_tuple < MAX_TUPLE" interval. 
  
  One of endpoints may be absent. 'flags' member has flags which tell whether
  the endpoints are '<' or '<='.
*/
class QUICK_RANGE :public Sql_alloc {
 public:
  uchar *min_key,*max_key;
  uint16 min_length,max_length,flag;
  key_part_map min_keypart_map, // bitmap of used keyparts in min_key
               max_keypart_map; // bitmap of used keyparts in max_key
#ifdef HAVE_valgrind
  uint16 dummy;					/* Avoid warnings on 'flag' */
#endif
  QUICK_RANGE();				/* Full range */
  QUICK_RANGE(THD *thd, const uchar *min_key_arg, uint min_length_arg,
              key_part_map min_keypart_map_arg,
	      const uchar *max_key_arg, uint max_length_arg,
              key_part_map max_keypart_map_arg,
	      uint flag_arg)
    : min_key((uchar*) thd->memdup(min_key_arg, min_length_arg + 1)),
      max_key((uchar*) thd->memdup(max_key_arg, max_length_arg + 1)),
      min_length((uint16) min_length_arg),
      max_length((uint16) max_length_arg),
      flag((uint16) flag_arg),
      min_keypart_map(min_keypart_map_arg),
      max_keypart_map(max_keypart_map_arg)
    {
#ifdef HAVE_valgrind
      dummy=0;
#endif
    }

  /**
     Initializes a key_range object for communication with storage engine. 

     This function facilitates communication with the Storage Engine API by
     translating the minimum endpoint of the interval represented by this
     QUICK_RANGE into an index range endpoint specifier for the engine.

     @param Pointer to an uninitialized key_range C struct.

     @param prefix_length The length of the search key prefix to be used for
     lookup.
     
     @param keypart_map A set (bitmap) of keyparts to be used.
  */
  void make_min_endpoint(key_range *kr, uint prefix_length, 
                         key_part_map keypart_map) {
    make_min_endpoint(kr);
    kr->length= MY_MIN(kr->length, prefix_length);
    kr->keypart_map&= keypart_map;
  }
  
  /**
     Initializes a key_range object for communication with storage engine. 

     This function facilitates communication with the Storage Engine API by
     translating the minimum endpoint of the interval represented by this
     QUICK_RANGE into an index range endpoint specifier for the engine.

     @param Pointer to an uninitialized key_range C struct.
  */
  void make_min_endpoint(key_range *kr) {
    kr->key= (const uchar*)min_key;
    kr->length= min_length;
    kr->keypart_map= min_keypart_map;
    kr->flag= ((flag & NEAR_MIN) ? HA_READ_AFTER_KEY :
               (flag & EQ_RANGE) ? HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT);
  }

  /**
     Initializes a key_range object for communication with storage engine. 

     This function facilitates communication with the Storage Engine API by
     translating the maximum endpoint of the interval represented by this
     QUICK_RANGE into an index range endpoint specifier for the engine.

     @param Pointer to an uninitialized key_range C struct.

     @param prefix_length The length of the search key prefix to be used for
     lookup.
     
     @param keypart_map A set (bitmap) of keyparts to be used.
  */
  void make_max_endpoint(key_range *kr, uint prefix_length, 
                         key_part_map keypart_map) {
    make_max_endpoint(kr);
    kr->length= MY_MIN(kr->length, prefix_length);
    kr->keypart_map&= keypart_map;
  }

  /**
     Initializes a key_range object for communication with storage engine. 

     This function facilitates communication with the Storage Engine API by
     translating the maximum endpoint of the interval represented by this
     QUICK_RANGE into an index range endpoint specifier for the engine.

     @param Pointer to an uninitialized key_range C struct.
  */
  void make_max_endpoint(key_range *kr) {
    kr->key= (const uchar*)max_key;
    kr->length= max_length;
    kr->keypart_map= max_keypart_map;
    /*
      We use READ_AFTER_KEY here because if we are reading on a key
      prefix we want to find all keys with this prefix
    */
    kr->flag= (flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY);
  }
};


/*
  Quick select interface.
  This class is a parent for all QUICK_*_SELECT and FT_SELECT classes.

  The usage scenario is as follows:
  1. Create quick select
    quick= new QUICK_XXX_SELECT(...);

  2. Perform lightweight initialization. This can be done in 2 ways:
  2.a: Regular initialization
    if (quick->init())
    {
      //the only valid action after failed init() call is delete
      delete quick;
    }
  2.b: Special initialization for quick selects merged by QUICK_ROR_*_SELECT
    if (quick->init_ror_merged_scan())
      delete quick;

  3. Perform zero, one, or more scans.
    while (...)
    {
      // initialize quick select for scan. This may allocate
      // buffers and/or prefetch rows.
      if (quick->reset())
      {
        //the only valid action after failed reset() call is delete
        delete quick;
        //abort query
      }

      // perform the scan
      do
      {
        res= quick->get_next();
      } while (res && ...)
    }

  4. Delete the select:
    delete quick;
  
  NOTE 
    quick select doesn't use Sql_alloc/MEM_ROOT allocation because "range
    checked for each record" functionality may create/destroy
    O(#records_in_some_table) quick selects during query execution.
*/

class QUICK_SELECT_I
{
public:
  ha_rows records;  /* estimate of # of records to be retrieved */
  double  read_time; /* time to perform this retrieval          */
  TABLE   *head;
  /*
    Index this quick select uses, or MAX_KEY for quick selects
    that use several indexes
  */
  uint index;

  /*
    Total length of first used_key_parts parts of the key.
    Applicable if index!= MAX_KEY.
  */
  uint max_used_key_length;

  /*
    Max. number of (first) key parts this quick select uses for retrieval.
    eg. for "(key1p1=c1 AND key1p2=c2) OR key1p1=c2" used_key_parts == 2.
    Applicable if index!= MAX_KEY.

    For QUICK_GROUP_MIN_MAX_SELECT it includes MIN/MAX argument keyparts.
  */
  uint used_key_parts;

  QUICK_SELECT_I();
  virtual ~QUICK_SELECT_I() = default;;

  /*
    Do post-constructor initialization.
    SYNOPSIS
      init()

    init() performs initializations that should have been in constructor if
    it was possible to return errors from constructors. The join optimizer may
    create and then delete quick selects without retrieving any rows so init()
    must not contain any IO or CPU intensive code.

    If init() call fails the only valid action is to delete this quick select,
    reset() and get_next() must not be called.

    RETURN
      0      OK
      other  Error code
  */
  virtual int  init() = 0;

  /*
    Initialize quick select for row retrieval.
    SYNOPSIS
      reset()

    reset() should be called when it is certain that row retrieval will be
    necessary. This call may do heavyweight initialization like buffering first
    N records etc. If reset() call fails get_next() must not be called.
    Note that reset() may be called several times if 
     * the quick select is executed in a subselect
     * a JOIN buffer is used
    
    RETURN
      0      OK
      other  Error code
  */
  virtual int  reset(void) = 0;

  virtual int  get_next() = 0;   /* get next record to retrieve */

  /* Range end should be called when we have looped over the whole index */
  virtual void range_end() {}

  virtual bool reverse_sorted() = 0;
  virtual bool unique_key_range() { return false; }

  /*
    Request that this quick select produces sorted output. Not all quick
    selects can do it, the caller is responsible for calling this function
    only for those quick selects that can.
  */
  virtual void need_sorted_output() = 0;
  enum {
    QS_TYPE_RANGE = 0,
    QS_TYPE_INDEX_INTERSECT = 1,
    QS_TYPE_INDEX_MERGE = 2,
    QS_TYPE_RANGE_DESC = 3,
    QS_TYPE_FULLTEXT   = 4,
    QS_TYPE_ROR_INTERSECT = 5,
    QS_TYPE_ROR_UNION = 6,
    QS_TYPE_GROUP_MIN_MAX = 7
  };

  /* Get type of this quick select - one of the QS_TYPE_* values */
  virtual int get_type() = 0;

  /*
    Initialize this quick select as a merged scan inside a ROR-union or a ROR-
    intersection scan. The caller must not additionally call init() if this
    function is called.
    SYNOPSIS
      init_ror_merged_scan()
        reuse_handler  If true, the quick select may use table->handler,
                       otherwise it must create and use a separate handler
                       object.
    RETURN
      0     Ok
      other Error
  */
  virtual int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc)
  { DBUG_ASSERT(0); return 1; }

  /*
    Save ROWID of last retrieved row in file->ref. This used in ROR-merging.
  */
  virtual void save_last_pos(){};
  
  void add_key_and_length(String *key_names,
                          String *used_lengths,
                          bool *first);

  /*
    Append comma-separated list of keys this quick select uses to key_names;
    append comma-separated list of corresponding used lengths to used_lengths.
    This is used by select_describe.
  */
  virtual void add_keys_and_lengths(String *key_names,
                                    String *used_lengths)=0;

  void add_key_name(String *str, bool *first);

  /* Save information about quick select's query plan */
  virtual Explain_quick_select* get_explain(MEM_ROOT *alloc)= 0;

  /*
    Return 1 if any index used by this quick select
    uses field which is marked in passed bitmap.
  */
  virtual bool is_keys_used(const MY_BITMAP *fields);

  /**
    Simple sanity check that the quick select has been set up
    correctly. Function is overridden by quick selects that merge
    indices.
   */
  virtual bool is_valid() { return index != MAX_KEY; };

  /*
    rowid of last row retrieved by this quick select. This is used only when
    doing ROR-index_merge selects
  */
  uchar    *last_rowid;

  /*
    Table record buffer used by this quick select.
  */
  uchar    *record;

  virtual void replace_handler(handler *new_file)
  {
    DBUG_ASSERT(0); /* Only supported in QUICK_RANGE_SELECT */
  }

#ifndef DBUG_OFF
  /*
    Print quick select information to DBUG_FILE. Caller is responsible
    for locking DBUG_FILE before this call and unlocking it afterwards.
  */
  virtual void dbug_dump(int indent, bool verbose)= 0;
#endif

  /*
    Returns a QUICK_SELECT with reverse order of to the index.
  */
  virtual QUICK_SELECT_I *make_reverse(uint used_key_parts_arg) { return NULL; }

  /*
    Add the key columns used by the quick select into table's read set.

    This is used by an optimization in filesort.
  */
  virtual void add_used_key_part_to_set()=0;
};


struct st_qsel_param;
class PARAM;


/*
  MRR range sequence, array<QUICK_RANGE> implementation: sequence traversal
  context.
*/
typedef struct st_quick_range_seq_ctx
{
  QUICK_RANGE **first;
  QUICK_RANGE **cur;
  QUICK_RANGE **last;
} QUICK_RANGE_SEQ_CTX;

range_seq_t quick_range_seq_init(void *init_param, uint n_ranges, uint flags);
bool quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);


/*
  Quick select that does a range scan on a single key. The records are
  returned in key order.
*/
class QUICK_RANGE_SELECT : public QUICK_SELECT_I
{
protected:
  THD *thd;
  bool no_alloc;
  MEM_ROOT *parent_alloc;

  /* true if we enabled key only reads */
  handler *file;

  /* Members to deal with case when this quick select is a ROR-merged scan */
  bool in_ror_merged_scan;
  MY_BITMAP column_bitmap;
  bool free_file;   /* TRUE <=> this->file is "owned" by this quick select */

  /* Range pointers to be used when not using MRR interface */
  /* Members needed to use the MRR interface */
  QUICK_RANGE_SEQ_CTX qr_traversal_ctx;
public:
  uint mrr_flags; /* Flags to be used with MRR interface */
protected:
  uint mrr_buf_size; /* copy from thd->variables.mrr_buff_size */  
  HANDLER_BUFFER *mrr_buf_desc; /* the handler buffer */

  /* Info about index we're scanning */
  
  DYNAMIC_ARRAY ranges;     /* ordered array of range ptrs */
  QUICK_RANGE **cur_range;  /* current element in ranges  */
  
  QUICK_RANGE *last_range;
  
  KEY_PART *key_parts;
  KEY_PART_INFO *key_part_info;
  
  bool dont_free; /* Used by QUICK_SELECT_DESC */

  int cmp_next(QUICK_RANGE *range);
  int cmp_prev(QUICK_RANGE *range);
  bool row_in_ranges();
public:
  MEM_ROOT alloc;

  QUICK_RANGE_SELECT(THD *thd, TABLE *table,uint index_arg,bool no_alloc,
                     MEM_ROOT *parent_alloc, bool *create_err);
  ~QUICK_RANGE_SELECT();
  virtual QUICK_RANGE_SELECT *clone(bool *create_error)
    { return new QUICK_RANGE_SELECT(thd, head, index, no_alloc, parent_alloc,
                                    create_error); }
  
  void need_sorted_output() override;
  int init() override;
  int reset(void) override;
  int get_next() override;
  void range_end() override;
  int get_next_prefix(uint prefix_length, uint group_key_parts, 
                      uchar *cur_prefix);
  bool reverse_sorted() override { return 0; }
  bool unique_key_range() override;
  int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc) override;
  void save_last_pos() override
  { file->position(record); }
  int get_type() override { return QS_TYPE_RANGE; }
  void add_keys_and_lengths(String *key_names, String *used_lengths) override;
  Explain_quick_select *get_explain(MEM_ROOT *alloc) override;
#ifndef DBUG_OFF
  void dbug_dump(int indent, bool verbose) override;
#endif
  void replace_handler(handler *new_file) override { file= new_file; }
  QUICK_SELECT_I *make_reverse(uint used_key_parts_arg) override;

  void add_used_key_part_to_set() override;

private:
  /* Default copy ctor used by QUICK_SELECT_DESC */
  friend class TRP_ROR_INTERSECT;
  friend
  QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
                                               struct st_table_ref *ref,
                                               ha_rows records);
  friend bool get_quick_keys(PARAM *param, QUICK_RANGE_SELECT *quick, 
                             KEY_PART *key, SEL_ARG *key_tree, 
                             uchar *min_key, uint min_key_flag,
                             uchar *max_key, uint max_key_flag);
  friend QUICK_RANGE_SELECT *get_quick_select(PARAM*,uint idx,
                                              SEL_ARG *key_tree,
                                              uint mrr_flags,
                                              uint mrr_buf_size,
                                              MEM_ROOT *alloc);
  friend class QUICK_SELECT_DESC;
  friend class QUICK_INDEX_SORT_SELECT;
  friend class QUICK_INDEX_MERGE_SELECT;
  friend class QUICK_ROR_INTERSECT_SELECT;
  friend class QUICK_INDEX_INTERSECT_SELECT;
  friend class QUICK_GROUP_MIN_MAX_SELECT;
  friend bool quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);
  friend range_seq_t quick_range_seq_init(void *init_param,
                                          uint n_ranges, uint flags);
  friend 
  int read_keys_and_merge_scans(THD *thd, TABLE *head,
                                List<QUICK_RANGE_SELECT> quick_selects,
                                QUICK_RANGE_SELECT *pk_quick_select,
                                READ_RECORD *read_record,
                                bool intersection,
                                key_map *filtered_scans,
                                Unique **unique_ptr);

};


class QUICK_RANGE_SELECT_GEOM: public QUICK_RANGE_SELECT
{
public:
  QUICK_RANGE_SELECT_GEOM(THD *thd, TABLE *table, uint index_arg,
                          bool no_alloc, MEM_ROOT *parent_alloc, 
                          bool *create_err)
    :QUICK_RANGE_SELECT(thd, table, index_arg, no_alloc, parent_alloc,
    create_err)
    {};
  QUICK_RANGE_SELECT *clone(bool *create_error) override
    {
      DBUG_ASSERT(0);
      return new QUICK_RANGE_SELECT_GEOM(thd, head, index, no_alloc,
                                         parent_alloc, create_error);
    }
  int get_next() override;
};


/*
  QUICK_INDEX_SORT_SELECT is the base class for the common functionality of:
  - QUICK_INDEX_MERGE_SELECT, access based on multi-index merge/union 
  - QUICK_INDEX_INTERSECT_SELECT, access based on  multi-index intersection 
    

    QUICK_INDEX_SORT_SELECT uses
     * QUICK_RANGE_SELECTs to get rows
     * Unique class
       - to remove duplicate rows for QUICK_INDEX_MERGE_SELECT
       - to intersect rows for QUICK_INDEX_INTERSECT_SELECT

  INDEX MERGE OPTIMIZER
    Current implementation doesn't detect all cases where index merge could
    be used, in particular:

     * index_merge+'using index' is not supported

     * If WHERE part contains complex nested AND and OR conditions, some ways
       to retrieve rows using index merge will not be considered. The choice
       of read plan may depend on the order of conjuncts/disjuncts in WHERE
       part of the query, see comments near imerge_list_or_list and
       SEL_IMERGE::or_sel_tree_with_checks functions for details.

     * There is no "index_merge_ref" method (but index merge on non-first
       table in join is possible with 'range checked for each record').


  ROW RETRIEVAL ALGORITHM

    index merge/intersection uses Unique class for duplicates removal. 
    index merge/intersection takes advantage of Clustered Primary Key (CPK)
    if the table has one.
    The index merge/intersection algorithm consists of two phases:

    Phase 1 
    (implemented by a QUICK_INDEX_MERGE_SELECT::read_keys_and_merge call):

    prepare()
    {
      activate 'index only';
      while(retrieve next row for non-CPK scan)
      {
        if (there is a CPK scan and row will be retrieved by it)
          skip this row;
        else
          put its rowid into Unique;
      }
      deactivate 'index only';
    }

    Phase 2 
    (implemented as sequence of QUICK_INDEX_MERGE_SELECT::get_next calls):

    fetch()
    {
      retrieve all rows from row pointers stored in Unique
      (merging/intersecting them);
      free Unique;
      if (! intersection) 
        retrieve all rows for CPK scan;
    }
*/

class QUICK_INDEX_SORT_SELECT : public QUICK_SELECT_I
{
protected:
  Unique *unique;
public:
  QUICK_INDEX_SORT_SELECT(THD *thd, TABLE *table);
  ~QUICK_INDEX_SORT_SELECT();

  int  init() override;
  void need_sorted_output() override { DBUG_ASSERT(0); /* Can't do it */ }
  int  reset(void) override;
  bool reverse_sorted() override { return false; }
  bool unique_key_range() override { return false; }
  bool is_keys_used(const MY_BITMAP *fields) override;
#ifndef DBUG_OFF
  void dbug_dump(int indent, bool verbose) override;
#endif
  Explain_quick_select *get_explain(MEM_ROOT *alloc) override;

  bool push_quick_back(QUICK_RANGE_SELECT *quick_sel_range);

  /* range quick selects this index merge/intersect consists of */
  List<QUICK_RANGE_SELECT> quick_selects;

  /* quick select that uses clustered primary key (NULL if none) */
  QUICK_RANGE_SELECT* pk_quick_select;

  MEM_ROOT alloc;
  THD *thd;
  bool is_valid() override
  {
    List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
    QUICK_RANGE_SELECT *quick;
    bool valid= true;
    while ((quick= it++))
    {
      if (!quick->is_valid())
      {
        valid= false;
        break;
      }
    }
    return valid;
  }
  virtual int read_keys_and_merge()= 0;
  /* used to get rows collected in Unique */
  READ_RECORD read_record;

  void add_used_key_part_to_set() override;
};



class QUICK_INDEX_MERGE_SELECT : public QUICK_INDEX_SORT_SELECT
{
private:
  /* true if this select is currently doing a clustered PK scan */
  bool  doing_pk_scan;
protected:
  int read_keys_and_merge() override;

public:
  QUICK_INDEX_MERGE_SELECT(THD *thd_arg, TABLE *table)
    :QUICK_INDEX_SORT_SELECT(thd_arg, table) {}

  int get_next() override;
  int get_type() override { return QS_TYPE_INDEX_MERGE; }
  void add_keys_and_lengths(String *key_names, String *used_lengths) override;
};

class QUICK_INDEX_INTERSECT_SELECT : public QUICK_INDEX_SORT_SELECT
{
protected:
  int read_keys_and_merge() override;

public:
  QUICK_INDEX_INTERSECT_SELECT(THD *thd_arg, TABLE *table)
    :QUICK_INDEX_SORT_SELECT(thd_arg, table) {}

  key_map filtered_scans;
  int get_next() override;
  int get_type() override { return QS_TYPE_INDEX_INTERSECT; }
  void add_keys_and_lengths(String *key_names, String *used_lengths) override;
  Explain_quick_select *get_explain(MEM_ROOT *alloc) override;
};


/*
  Rowid-Ordered Retrieval (ROR) index intersection quick select.
  This quick select produces intersection of row sequences returned
  by several QUICK_RANGE_SELECTs it "merges".

  All merged QUICK_RANGE_SELECTs must return rowids in rowid order.
  QUICK_ROR_INTERSECT_SELECT will return rows in rowid order, too.

  All merged quick selects retrieve {rowid, covered_fields} tuples (not full
  table records).
  QUICK_ROR_INTERSECT_SELECT retrieves full records if it is not being used
  by QUICK_ROR_INTERSECT_SELECT and all merged quick selects together don't
  cover needed all fields.

  If one of the merged quick selects is a Clustered PK range scan, it is
  used only to filter rowid sequence produced by other merged quick selects.
*/

class QUICK_ROR_INTERSECT_SELECT : public QUICK_SELECT_I
{
public:
  QUICK_ROR_INTERSECT_SELECT(THD *thd, TABLE *table,
                             bool retrieve_full_rows,
                             MEM_ROOT *parent_alloc);
  ~QUICK_ROR_INTERSECT_SELECT();

  int  init() override;
  void need_sorted_output() override { DBUG_ASSERT(0); /* Can't do it */ }
  int  reset(void) override;
  int  get_next() override;
  bool reverse_sorted() override { return false; }
  bool unique_key_range() override { return false; }
  int get_type() override { return QS_TYPE_ROR_INTERSECT; }
  void add_keys_and_lengths(String *key_names, String *used_lengths) override;
  Explain_quick_select *get_explain(MEM_ROOT *alloc) override;
  bool is_keys_used(const MY_BITMAP *fields) override;
  void add_used_key_part_to_set() override;
#ifndef DBUG_OFF
  void dbug_dump(int indent, bool verbose) override;
#endif
  int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc) override;
  bool push_quick_back(MEM_ROOT *alloc, QUICK_RANGE_SELECT *quick_sel_range);

  class QUICK_SELECT_WITH_RECORD : public Sql_alloc
  {
  public:
    QUICK_RANGE_SELECT *quick;
    uchar *key_tuple;
    ~QUICK_SELECT_WITH_RECORD() { delete quick; }
  };

  /*
    Range quick selects this intersection consists of, not including
    cpk_quick.
  */
  List<QUICK_SELECT_WITH_RECORD> quick_selects;

  bool is_valid() override
  {
    List_iterator_fast<QUICK_SELECT_WITH_RECORD> it(quick_selects);
    QUICK_SELECT_WITH_RECORD *quick;
    bool valid= true;
    while ((quick= it++))
    {
      if (!quick->quick->is_valid())
      {
        valid= false;
        break;
      }
    }
    return valid;
  }

  /*
    Merged quick select that uses Clustered PK, if there is one. This quick
    select is not used for row retrieval, it is used for row retrieval.
  */
  QUICK_RANGE_SELECT *cpk_quick;

  MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
  THD *thd;       /* current thread */
  bool need_to_fetch_row; /* if true, do retrieve full table records. */
  /* in top-level quick select, true if merged scans where initialized */
  bool scans_inited; 
};


/*
  Rowid-Ordered Retrieval index union select.
  This quick select produces union of row sequences returned by several
  quick select it "merges".

  All merged quick selects must return rowids in rowid order.
  QUICK_ROR_UNION_SELECT will return rows in rowid order, too.

  All merged quick selects are set not to retrieve full table records.
  ROR-union quick select always retrieves full records.

*/

class QUICK_ROR_UNION_SELECT : public QUICK_SELECT_I
{
public:
  QUICK_ROR_UNION_SELECT(THD *thd, TABLE *table);
  ~QUICK_ROR_UNION_SELECT();

  int  init() override;
  void need_sorted_output() override { DBUG_ASSERT(0); /* Can't do it */ }
  int  reset(void) override;
  int  get_next() override;
  bool reverse_sorted() override { return false; }
  bool unique_key_range() override { return false; }
  int get_type() override { return QS_TYPE_ROR_UNION; }
  void add_keys_and_lengths(String *key_names, String *used_lengths) override;
  Explain_quick_select *get_explain(MEM_ROOT *alloc) override;
  bool is_keys_used(const MY_BITMAP *fields) override;
  void add_used_key_part_to_set() override;
#ifndef DBUG_OFF
  void dbug_dump(int indent, bool verbose) override;
#endif

  bool push_quick_back(QUICK_SELECT_I *quick_sel_range);

  List<QUICK_SELECT_I> quick_selects; /* Merged quick selects */

  bool is_valid() override
  {
    List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
    QUICK_SELECT_I *quick;
    bool valid= true;
    while ((quick= it++))
    {
      if (!quick->is_valid())
      {
        valid= false;
        break;
      }
    }
    return valid;
  }

  QUEUE queue;    /* Priority queue for merge operation */
  MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */

  THD *thd;             /* current thread */
  uchar *cur_rowid;      /* buffer used in get_next() */
  uchar *prev_rowid;     /* rowid of last row returned by get_next() */
  bool have_prev_rowid; /* true if prev_rowid has valid data */
  uint rowid_length;    /* table rowid length */
private:
  bool scans_inited; 
};


/*
  Index scan for GROUP-BY queries with MIN/MAX aggregate functions.

  This class provides a specialized index access method for GROUP-BY queries
  of the forms:

       SELECT A_1,...,A_k, [B_1,...,B_m], [MIN(C)], [MAX(C)]
         FROM T
        WHERE [RNG(A_1,...,A_p ; where p <= k)]
         [AND EQ(B_1,...,B_m)]
         [AND PC(C)]
         [AND PA(A_i1,...,A_iq)]
       GROUP BY A_1,...,A_k;

    or

       SELECT DISTINCT A_i1,...,A_ik
         FROM T
        WHERE [RNG(A_1,...,A_p ; where p <= k)]
         [AND PA(A_i1,...,A_iq)];

  where all selected fields are parts of the same index.
  The class of queries that can be processed by this quick select is fully
  specified in the description of get_best_trp_group_min_max() in opt_range.cc.

  The get_next() method directly produces result tuples, thus obviating the
  need to call end_send_group() because all grouping is already done inside
  get_next().

  Since one of the requirements is that all select fields are part of the same
  index, this class produces only index keys, and not complete records.
*/

class QUICK_GROUP_MIN_MAX_SELECT : public QUICK_SELECT_I
{
private:
  handler * const file;   /* The handler used to get data. */
  JOIN *join;            /* Descriptor of the current query */
  KEY  *index_info;      /* The index chosen for data access */
  uchar *record;          /* Buffer where the next record is returned. */
  uchar *tmp_record;      /* Temporary storage for next_min(), next_max(). */
  uchar *group_prefix;    /* Key prefix consisting of the GROUP fields. */
  const uint group_prefix_len; /* Length of the group prefix. */
  uint group_key_parts;  /* A number of keyparts in the group prefix */
  bool have_min;         /* Specify whether we are computing */
  bool have_max;         /*   a MIN, a MAX, or both.         */
  bool have_agg_distinct;/*   aggregate_function(DISTINCT ...).  */
  bool seen_first_key;   /* Denotes whether the first key was retrieved.*/
  bool doing_key_read;   /* true if we enabled key only reads */

  KEY_PART_INFO *min_max_arg_part; /* The keypart of the only argument field */
                                   /* of all MIN/MAX functions.              */
  uint min_max_arg_len;  /* The length of the MIN/MAX argument field */
  uchar *key_infix;       /* Infix of constants from equality predicates. */
  uint key_infix_len;
  DYNAMIC_ARRAY min_max_ranges; /* Array of range ptrs for the MIN/MAX field. */
  uint real_prefix_len; /* Length of key prefix extended with key_infix. */
  uint real_key_parts;  /* A number of keyparts in the above value.      */
  List<Item_sum> *min_functions;
  List<Item_sum> *max_functions;
  List_iterator<Item_sum> *min_functions_it;
  List_iterator<Item_sum> *max_functions_it;
  /* 
    Use index scan to get the next different key instead of jumping into it 
    through index read 
  */
  bool is_index_scan; 
public:
  /*
    The following two members are public to allow easy access from
    TRP_GROUP_MIN_MAX::make_quick()
  */
  MEM_ROOT alloc; /* Memory pool for this and quick_prefix_select data. */
  QUICK_RANGE_SELECT *quick_prefix_select;/* For retrieval of group prefixes. */
private:
  int  next_prefix();
  int  next_min_in_range();
  int  next_max_in_range();
  int  next_min();
  int  next_max();
  void update_min_result();
  void update_max_result();
  int cmp_min_max_key(const uchar *key, uint16 length);
public:
  QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join, bool have_min,
                             bool have_max, bool have_agg_distinct,
                             KEY_PART_INFO *min_max_arg_part,
                             uint group_prefix_len, uint group_key_parts,
                             uint used_key_parts, KEY *index_info, uint
                             use_index, double read_cost, ha_rows records, uint
                             key_infix_len, uchar *key_infix, MEM_ROOT
                             *parent_alloc, bool is_index_scan);
  ~QUICK_GROUP_MIN_MAX_SELECT();
  bool add_range(SEL_ARG *sel_range);
  void update_key_stat();
  void adjust_prefix_ranges();
  bool alloc_buffers();
  int init() override;
  void need_sorted_output() override { /* always do it */ }
  int reset() override;
  int get_next() override;
  bool reverse_sorted() override { return false; }
  bool unique_key_range() override { return false; }
  int get_type() override { return QS_TYPE_GROUP_MIN_MAX; }
  void add_keys_and_lengths(String *key_names, String *used_lengths) override;
  void add_used_key_part_to_set() override;
#ifndef DBUG_OFF
  void dbug_dump(int indent, bool verbose) override;
#endif
  bool is_agg_distinct() { return have_agg_distinct; }
  bool loose_scan_is_scanning() { return is_index_scan; }
  Explain_quick_select *get_explain(MEM_ROOT *alloc) override;
};


class QUICK_SELECT_DESC: public QUICK_RANGE_SELECT
{
public:
  QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint used_key_parts);
  QUICK_RANGE_SELECT *clone(bool *create_error) override
    { DBUG_ASSERT(0); return new QUICK_SELECT_DESC(this, used_key_parts); }
  int get_next() override;
  bool reverse_sorted() override { return 1; }
  int get_type() override { return QS_TYPE_RANGE_DESC; }
  QUICK_SELECT_I *make_reverse(uint used_key_parts_arg) override
  {
    return this; // is already reverse sorted
  }
private:
  bool range_reads_after_key(QUICK_RANGE *range);
  int reset(void) override { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); }
  List<QUICK_RANGE> rev_ranges;
  List_iterator<QUICK_RANGE> rev_it;
  uint used_key_parts;
};


class SQL_SELECT :public Sql_alloc {
 public:
  QUICK_SELECT_I *quick;	// If quick-select used
  COND		*cond;		// where condition

  /*
    When using Index Condition Pushdown: condition that we've had before
    extracting and pushing index condition.
    In other cases, NULL.
  */
  Item *pre_idx_push_select_cond;
  TABLE	*head;
  IO_CACHE file;		// Positions to used records
  ha_rows records;		// Records in use if read from file
  double read_time;		// Time to read rows
  key_map quick_keys;		// Possible quick keys
  key_map needed_reg;		// Possible quick keys after prev tables.
  table_map const_tables,read_tables;
  /* See PARAM::possible_keys */
  key_map possible_keys;
  bool	free_cond; /* Currently not used and always FALSE */

  SQL_SELECT();
  ~SQL_SELECT();
  void cleanup();
  void set_quick(QUICK_SELECT_I *new_quick) { delete quick; quick= new_quick; }

  /*
    @return
      true  - for ERROR and IMPOSSIBLE_RANGE
      false   - Ok
  */
  bool check_quick(THD *thd, bool force_quick_range, ha_rows limit,
                   Item_func::Bitmap note_unusable_keys)
  {
    key_map tmp;
    tmp.set_all();
    return test_quick_select(thd, tmp, 0, limit, force_quick_range,
                             FALSE, FALSE, FALSE,
                             note_unusable_keys) != OK;
  }

  /* 
    RETURN
      0   if record must be skipped <-> (cond && cond->val_bool() == false)
     -1   if error
      1   otherwise
  */   
  inline int skip_record(THD *thd)
  {
    int rc= MY_TEST(!cond || cond->val_bool());
    if (thd->is_error())
      rc= -1;
    return rc;
  }

  enum quick_select_return_type {
    IMPOSSIBLE_RANGE = -1,
    ERROR,
    OK
  };

  enum quick_select_return_type
  test_quick_select(THD *thd, key_map keys, table_map prev_tables,
                    ha_rows limit,
                    bool force_quick_range,
                    bool ordered_output,
                    bool remove_false_parts_of_where,
                    bool only_single_index_range_scan,
                    Item_func::Bitmap note_unusable_keys);
};

typedef enum SQL_SELECT::quick_select_return_type quick_select_return;


class SQL_SELECT_auto
{
  SQL_SELECT *select;
public:
  SQL_SELECT_auto(): select(NULL)
  {}
  ~SQL_SELECT_auto()
  {
    delete select;
  }
  SQL_SELECT_auto&
  operator= (SQL_SELECT *_select)
  {
    select= _select;
    return *this;
  }
  operator SQL_SELECT * () const
  {
    return select;
  }
  SQL_SELECT *
  operator-> () const
  {
    return select;
  }
  operator bool () const
  {
    return select;
  }
};


class FT_SELECT: public QUICK_RANGE_SELECT 
{
public:
  FT_SELECT(THD *thd, TABLE *table, uint key, bool *create_err) :
      QUICK_RANGE_SELECT (thd, table, key, 1, NULL, create_err) 
  { (void) init(); }
  ~FT_SELECT() { file->ft_end(); }
  QUICK_RANGE_SELECT *clone(bool *create_error) override
    { DBUG_ASSERT(0); return new FT_SELECT(thd, head, index, create_error); }
  int init() override { return file->ft_init(); }
  int reset() override { return 0; }
  int get_next() override { return file->ha_ft_read(record); }
  int get_type() override { return QS_TYPE_FULLTEXT; }
};

FT_SELECT *get_ft_select(THD *thd, TABLE *table, uint key);
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
                                             struct st_table_ref *ref,
                                             ha_rows records);
SQL_SELECT *make_select(TABLE *head, table_map const_tables,
			table_map read_tables, COND *conds,
                        SORT_INFO* filesort,
                        bool allow_null_cond,  int *error);

bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond);

bool eq_ranges_exceeds_limit(RANGE_SEQ_IF *seq, void *seq_init_param,
                             uint limit);

#ifdef WITH_PARTITION_STORAGE_ENGINE
bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond);
#endif
void store_key_image_to_rec(Field *field, uchar *ptr, uint len);

extern String null_string;

/* check this number of rows (default value) */
#define SELECTIVITY_SAMPLING_LIMIT 100
/* but no more then this part of table (10%) */
#define SELECTIVITY_SAMPLING_SHARE 0.10
/* do not check if we are going check less then this number of records */
#define SELECTIVITY_SAMPLING_THRESHOLD 10

#endif
server/private/gcalc_tools.h000064400000027174150400263750012203 0ustar00/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
   Copyright (C) 2011 Monty Program Ab.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */


#ifndef GCALC_TOOLS_INCLUDED
#define GCALC_TOOLS_INCLUDED

#include "gcalc_slicescan.h"
#include "sql_string.h"


/*
  The Gcalc_function class objects are used to check for a binary relation.
  The relation can be constructed with the prefix notation using predicates as
        op_not (as !A)
        op_union ( A || B || C... )
        op_intersection ( A && B && C ... )
        op_symdifference ( A+B+C+... == 1 )
        op_difference ( A && !(B||C||..))
  with the calls of the add_operation(operation, n_operands) method.
  The relation is calculated over a set of shapes, that in turn have
  to be added with the add_new_shape() method. All the 'shapes' can
  be set to 0 with clear_shapes() method and single value
  can be changed with the invert_state() method.
  Then the value of the relation can be calculated with the count() method.
  Frequently used method is find_function(Gcalc_scan_iterator it) that
  iterates through the 'it' until the relation becomes TRUE.
*/

class Gcalc_function
{
private:
  String shapes_buffer;
  String function_buffer;
  int *i_states;
  int *b_states;
  uint32 cur_object_id;
  uint n_shapes;
  int count_internal(const char *cur_func, uint set_type,
                     const char **end);
public:
  enum op_type
  {
    v_empty=          0x00000000,
    v_find_t=         0x01000000,
    v_find_f=         0x02000000,
    v_t_found=        0x03000000,
    v_f_found=        0x04000000,
    v_mask=           0x07000000,

    op_not=           0x80000000,
    op_shape=         0x00000000,
    op_union=         0x10000000,
    op_intersection=  0x20000000,
    op_symdifference= 0x30000000,
    op_difference=    0x40000000,
    op_repeat=        0x50000000,
    op_border=        0x60000000,
    op_internals=     0x70000000,
    op_false=         0x08000000,
    op_any=           0x78000000 /* The mask to get any of the operations */
  };
  enum shape_type
  {
    shape_point= 0,
    shape_line= 1,
    shape_polygon= 2,
    shape_hole= 3
  };
  enum count_result
  {
    result_false= 0,
    result_true= 1,
    result_unknown= 2
  };
  Gcalc_function() : n_shapes(0) {}
  gcalc_shape_info add_new_shape(uint32 shape_id, shape_type shape_kind);
  /*
    Adds the leaf operation that returns the shape value.
    Also adds the shape to the list of operands.
  */
  int single_shape_op(shape_type shape_kind, gcalc_shape_info *si);
  void add_operation(uint operation, uint32 n_operands);
  void add_not_operation(op_type operation, uint32 n_operands);
  uint32 get_next_expression_pos() { return function_buffer.length(); }
  void add_operands_to_op(uint32 operation_pos, uint32 n_operands);
  int repeat_expression(uint32 exp_pos);
  void set_cur_obj(uint32 cur_obj) { cur_object_id= cur_obj; }
  int reserve_shape_buffer(uint n_shapes);
  int reserve_op_buffer(uint n_ops);
  uint get_nshapes() const { return n_shapes; }
  shape_type get_shape_kind(gcalc_shape_info si) const
  {
    return (shape_type) uint4korr(shapes_buffer.ptr() + (si*4));
  }

  void set_states(int *shape_states) { i_states= shape_states; }
  int alloc_states();
  void invert_i_state(gcalc_shape_info shape) { i_states[shape]^= 1; }
  void set_i_state(gcalc_shape_info shape) { i_states[shape]= 1; }
  void clear_i_state(gcalc_shape_info shape) { i_states[shape]= 0; }
  void set_b_state(gcalc_shape_info shape) { b_states[shape]= 1; }
  void clear_b_state(gcalc_shape_info shape) { b_states[shape]= 0; }
  int get_state(gcalc_shape_info shape)
    { return i_states[shape] | b_states[shape]; }
  int get_i_state(gcalc_shape_info shape) { return i_states[shape]; }
  int get_b_state(gcalc_shape_info shape) { return b_states[shape]; }
  int count()
    { return count_internal(function_buffer.ptr(), 0, 0); }
  int count_last()
    { return count_internal(function_buffer.ptr(), 1, 0); }
  void clear_i_states();
  void clear_b_states();
  void reset();

  int check_function(Gcalc_scan_iterator &scan_it);
};


/*
  Gcalc_operation_transporter class extends the Gcalc_shape_transporter.
  In addition to the parent's functionality, it fills the Gcalc_function
  object so it has the function that determines the proper shape.
  For example Multipolyline will be represented as an union of polylines.
*/

class Gcalc_operation_transporter : public Gcalc_shape_transporter
{
protected:
  Gcalc_function *m_fn;
  gcalc_shape_info m_si;
public:
  Gcalc_operation_transporter(Gcalc_function *fn, Gcalc_heap *heap) :
    Gcalc_shape_transporter(heap), m_fn(fn) {}

  int single_point(double x, double y) override;
  int start_line() override;
  int complete_line() override;
  int start_poly() override;
  int complete_poly() override;
  int start_ring() override;
  int complete_ring() override;
  int add_point(double x, double y) override;
  int start_collection(int n_objects) override;
  int empty_shape() override;
};


/*
   When we calculate the result of an spatial operation like
   Union or Intersection, we receive vertexes of the result
   one-by-one, and probably need to treat them in variative ways.
   So, the Gcalc_result_receiver class designed to get these
   vertexes and construct shapes/objects out of them.
   and to store the result in an appropriate format
*/

class Gcalc_result_receiver
{
  String buffer;
  uint32 n_points;
  Gcalc_function::shape_type common_shapetype;
  bool collection_result;
  uint32 n_shapes;
  uint32 n_holes;

  Gcalc_function::shape_type cur_shape;
  uint32 shape_pos;
  double first_x, first_y, prev_x, prev_y;
  double shape_area;
public:
Gcalc_result_receiver() :
    n_points(0),
    common_shapetype(Gcalc_function::shape_point),
    collection_result(FALSE), n_shapes(0), n_holes(0),
    cur_shape(Gcalc_function::shape_point), shape_pos(0)
    {}
  int start_shape(Gcalc_function::shape_type shape);
  int add_point(double x, double y);
  int complete_shape();
  int single_point(double x, double y);
  int done();
  void reset();

  const char *result() { return buffer.ptr(); }
  uint length() { return buffer.length(); }
  int get_nshapes() { return n_shapes; }
  int get_nholes() { return n_holes; }
  int get_result_typeid();
  uint32 position() { return buffer.length(); }
  int move_hole(uint32 dest_position, uint32 source_position,
                uint32 *position_shift);
};


/*
  Gcalc_operation_reducer class incapsulates the spatial
  operation functionality. It analyses the slices generated by
  the slicescan and calculates the shape of the result defined
  by some Gcalc_function.
*/

class Gcalc_operation_reducer : public Gcalc_dyn_list
{
public:
  enum modes
  {
    /* Numeric values important here - careful with changing */
    default_mode= 0,
    prefer_big_with_holes= 1,
    polygon_selfintersections_allowed= 2,  /* allowed in the result */
    line_selfintersections_allowed= 4      /* allowed in the result */
  };

  Gcalc_operation_reducer(size_t blk_size=8192);
  Gcalc_operation_reducer(const Gcalc_operation_reducer &gor);
  void init(Gcalc_function *fn, modes mode= default_mode);
  Gcalc_operation_reducer(Gcalc_function *fn, modes mode= default_mode,
		       size_t blk_size=8192);
  GCALC_DECL_TERMINATED_STATE(killed)
  int count_slice(Gcalc_scan_iterator *si);
  int count_all(Gcalc_heap *hp);
  int get_result(Gcalc_result_receiver *storage);
  void reset();

#ifndef GCALC_DBUG_OFF
  int n_res_points;
#endif /*GCALC_DBUG_OFF*/
  class res_point : public Gcalc_dyn_list::Item
  {
  public:
    int intersection_point;
    union
    {
      const Gcalc_heap::Info *pi;
      res_point *first_poly_node;
    };
    union
    {
      res_point *outer_poly;
      uint32 poly_position;
    };
    res_point *up;
    res_point *down;
    res_point *glue;
    Gcalc_function::shape_type type;
    Gcalc_dyn_list::Item **prev_hook;
#ifndef GCALC_DBUG_OFF
    int point_n;
#endif /*GCALC_DBUG_OFF*/
    void set(const Gcalc_scan_iterator *si);
    res_point *get_next() { return (res_point *)next; }
  };

  class active_thread : public Gcalc_dyn_list::Item
  {
  public:
    res_point *rp;
    res_point *thread_start;

    const Gcalc_heap::Info *p1, *p2;
    res_point *enabled() { return rp; }
    active_thread *get_next() { return (active_thread *)next; }
  };

  class poly_instance : public Gcalc_dyn_list::Item
  {
  public:
    uint32 *after_poly_position;
    poly_instance *get_next() { return (poly_instance *)next; }
  };

  class line : public Gcalc_dyn_list::Item
  {
  public:
    active_thread *t;
    int incoming;
    const Gcalc_scan_iterator::point *p;
    line *get_next() { return (line *)next; }
  };

  class poly_border : public Gcalc_dyn_list::Item
  {
  public:
    active_thread *t;
    int incoming;
    int prev_state;
    const Gcalc_scan_iterator::point *p;
    poly_border *get_next() { return (poly_border *)next; }
  };

  line *m_lines;
  Gcalc_dyn_list::Item **m_lines_hook;
  poly_border *m_poly_borders;
  Gcalc_dyn_list::Item **m_poly_borders_hook;
  line *new_line() { return (line *) new_item(); }
  poly_border *new_poly_border() { return (poly_border *) new_item(); }
  int add_line(int incoming, active_thread *t,
               const Gcalc_scan_iterator::point *p);
  int add_poly_border(int incoming, active_thread *t, int prev_state,
                      const Gcalc_scan_iterator::point *p);

protected:
  Gcalc_function *m_fn;
  Gcalc_dyn_list::Item **m_res_hook;
  res_point *m_result;
  int m_mode;

  res_point *result_heap;
  active_thread *m_first_active_thread;

  res_point *add_res_point(Gcalc_function::shape_type type);
  active_thread *new_active_thread() { return (active_thread *)new_item(); }

  poly_instance *new_poly() { return (poly_instance *) new_item(); }

private:
  int start_line(active_thread *t, const Gcalc_scan_iterator::point *p,
                 const Gcalc_scan_iterator *si);
  int end_line(active_thread *t, const Gcalc_scan_iterator *si);
  int connect_threads(int incoming_a, int incoming_b,
                      active_thread *ta, active_thread *tb,
                      const Gcalc_scan_iterator::point *pa,
                      const Gcalc_scan_iterator::point *pb,
                      active_thread *prev_range,
                      const Gcalc_scan_iterator *si,
                      Gcalc_function::shape_type s_t);
  int add_single_point(const Gcalc_scan_iterator *si);
  poly_border *get_pair_border(poly_border *b1);
  int continue_range(active_thread *t, const Gcalc_heap::Info *p,
                     const Gcalc_heap::Info *p_next);
  int continue_i_range(active_thread *t,
                       const Gcalc_heap::Info *ii);
  int end_couple(active_thread *t0, active_thread *t1, const Gcalc_heap::Info *p);
  int get_single_result(res_point *res, Gcalc_result_receiver *storage);
  int get_result_thread(res_point *cur, Gcalc_result_receiver *storage,
			int move_upward, res_point *first_poly_node);
  int get_polygon_result(res_point *cur, Gcalc_result_receiver *storage,
                         res_point *first_poly_node);
  int get_line_result(res_point *cur, Gcalc_result_receiver *storage);

  void free_result(res_point *res);
};

#endif /*GCALC_TOOLS_INCLUDED*/

server/private/wsrep_schema.h000064400000011517150400263750012364 0ustar00/* Copyright (C) 2015-2024 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */


#ifndef WSREP_SCHEMA_H
#define WSREP_SCHEMA_H

/* wsrep-lib */
#include "wsrep_types.h"

#include "mysqld.h"
#include "wsrep_mysqld.h"
/*
  Forward decls
*/
class THD;
class Relay_log_info;
struct TABLE;
struct TABLE_LIST;
struct st_mysql_lex_string;
typedef struct st_mysql_lex_string LEX_STRING;
class Gtid_log_event;

/** Name of the table in `wsrep_schema_str` used for storing streaming
replication data. In an InnoDB full format, e.g. "database/tablename". */
extern const char* wsrep_sr_table_name_full;

class Wsrep_schema
{
 public:

  Wsrep_schema();
  ~Wsrep_schema();

  /*
    Initialize wsrep schema. Storage engines must be running before
    calling this function.
  */
  int init();

  /*
    Store wsrep view info into wsrep schema.
  */
  int store_view(THD*, const Wsrep_view& view);

  /*
    Restore view info from stable storage.
  */
  Wsrep_view restore_view(THD* thd, const Wsrep_id& own_id) const;

  /**
    Append transaction fragment to fragment storage.
    Transaction must have been started for THD before this call.
    In order to make changes durable, transaction must be committed
    separately after this call.

    @param thd THD object
    @param server_id Wsrep server identifier
    @param transaction_id Transaction identifier
    @param flags Flags for the fragment
    @param data Fragment data buffer

    @return Zero in case of success, non-zero on failure.
  */
  int append_fragment(THD* thd,
                      const wsrep::id& server_id,
                      wsrep::transaction_id transaction_id,
                      wsrep::seqno seqno,
                      int flags,
                      const wsrep::const_buffer& data);
  /**
     Update existing fragment meta data. The fragment must have been
     inserted before using append_fragment().

     @param thd THD object
     @param ws_meta Wsrep meta data

     @return Zero in case of success, non-zero on failure.
   */
  int update_fragment_meta(THD* thd,
                           const wsrep::ws_meta& ws_meta);

  /**
     Remove fragments from storage. This method must be called
     inside active transaction. Fragment removal will be committed
     once the transaction commits.

     @param thd Pointer to THD object
     @param server_id Identifier of the running server
     @param transaction_id Identifier of the current transaction
     @param fragments Vector of fragment seqnos to be removed
  */
  int remove_fragments(THD*                             thd,
                       const wsrep::id&                 server_id,
                       wsrep::transaction_id            transaction_id,
                       const std::vector<wsrep::seqno>& fragments);

  /**
     Replay a transaction from stored fragments. The caller must have
     started a transaction for a thd.

     @param thd Pointer to THD object
     @param ws_meta Write set meta data for commit fragment.
     @param fragments Vector of fragments to be replayed

     @return Zero on success, non-zero on failure.
  */
  int replay_transaction(THD* thd,
                         Relay_log_info* rli,
                         const wsrep::ws_meta& ws_meta,
                         const std::vector<wsrep::seqno>& fragments);

  /**
     Recover streaming transactions from SR table.
     This method should be called after storage enignes are initialized.
     It will scan SR table and replay found streaming transactions.

     @param orig_thd The THD object of the calling thread.

     @return Zero on success, non-zero on failure.
  */
  int recover_sr_transactions(THD* orig_thd);

  /**
     Store GTID-event to mysql.gtid_slave_pos table.

     @param thd  The THD object of the calling thread.
     @param gtid GTID event from binlog.

     @return Zero on success, non-zero on failure.
  */
  int store_gtid_event(THD* thd, const Gtid_log_event *gtid);

 private:
  /* Non-copyable */
  Wsrep_schema(const Wsrep_schema&);
  Wsrep_schema& operator=(const Wsrep_schema&);
};

extern Wsrep_schema* wsrep_schema;

extern LEX_CSTRING WSREP_LEX_SCHEMA;
extern LEX_CSTRING WSREP_LEX_STREAMING;
extern LEX_CSTRING WSREP_LEX_CLUSTER;
extern LEX_CSTRING WSREP_LEX_MEMBERS;

#endif /* !WSREP_SCHEMA_H */
server/private/events.h000064400000011140150400263750011200 0ustar00#ifndef _EVENT_H_
#define _EVENT_H_
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @defgroup Event_Scheduler Event Scheduler
  @ingroup Runtime_Environment
  @{

  @file events.h

  A public interface of Events_Scheduler module.
*/

#ifdef HAVE_PSI_INTERFACE
extern PSI_mutex_key key_event_scheduler_LOCK_scheduler_state;
extern PSI_cond_key key_event_scheduler_COND_state;
extern PSI_thread_key key_thread_event_scheduler, key_thread_event_worker;
#endif /* HAVE_PSI_INTERFACE */

extern PSI_memory_key key_memory_event_basic_root;

/* Always defined, for SHOW PROCESSLIST. */
extern PSI_stage_info stage_waiting_on_empty_queue;
extern PSI_stage_info stage_waiting_for_next_activation;
extern PSI_stage_info stage_waiting_for_scheduler_to_stop;

#include "sql_string.h"                         /* LEX_CSTRING */
#include "my_time.h"                            /* interval_type */

class Event_db_repository;
class Event_parse_data;
class Event_queue;
class Event_scheduler;
struct TABLE_LIST;
class THD;
typedef class Item COND;

int
sortcmp_lex_string(const LEX_CSTRING *s, const LEX_CSTRING *t,
                   const CHARSET_INFO *cs);

/**
  @brief A facade to the functionality of the Event Scheduler.

  Every public operation against the scheduler has to be executed via the
  interface provided by a static method of this class. No instance of this
  class is ever created and it has no non-static data members.

  The life cycle of the Events module is the following:

  At server start up:
     init_mutexes() -> init()
  When the server is running:
     create_event(), drop_event(), start_or_stop_event_scheduler(), etc
  At shutdown:
     deinit(), destroy_mutexes().

  The peculiar initialization and shutdown cycle is an adaptation to the
  outside server startup/shutdown framework and mimics the rest of MySQL
  subsystems (ACL, time zone tables, etc).
*/

class Events
{
public:
  /*
    the following block is to support --event-scheduler command line option
    and the @@global.event_scheduler SQL variable.
    See sys_var.cc
  */
  enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED,
                                  EVENTS_ORIGINAL };
  /* Protected using LOCK_global_system_variables only. */
  static ulong opt_event_scheduler, startup_state;
  static ulong inited;
  static bool check_if_system_tables_error();
  static bool start(int *err_no);
  static bool stop();

public:
  /* A hack needed for Event_queue_element */
  static Event_db_repository *
  get_db_repository() { return db_repository; }

  static bool init(THD *thd, bool opt_noacl);

  static void
  deinit();

  static void
  init_mutexes();

  static void
  destroy_mutexes();

  static bool
  create_event(THD *thd, Event_parse_data *parse_data);

  static bool
  update_event(THD *thd, Event_parse_data *parse_data,
               LEX_CSTRING *new_dbname, LEX_CSTRING *new_name);

  static bool
  drop_event(THD *thd, const LEX_CSTRING *dbname, const LEX_CSTRING *name,
             bool if_exists);

  static void
  drop_schema_events(THD *thd, const char *db);

  static bool
  show_create_event(THD *thd, const LEX_CSTRING *dbname,
                    const LEX_CSTRING *name);

  /* Needed for both SHOW CREATE EVENT and INFORMATION_SCHEMA */
  static int
  reconstruct_interval_expression(String *buf, interval_type interval,
                                  longlong expression);

  static int
  fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */);

  static void
  dump_internal_status();

  static void set_original_state(ulong startup_state_org)
  {
    startup_state= startup_state_org;
  }

private:

  static bool
  load_events_from_db(THD *thd);

private:
  static Event_queue         *event_queue;
  static Event_scheduler     *scheduler;
  static Event_db_repository *db_repository;

private:
  /* Prevent use of these */
  Events(const Events &);
  void operator=(Events &);
};

/**
  @} (end of group Event Scheduler)
*/

#endif /* _EVENT_H_ */
server/private/json_table.h000064400000022442150400263750012023 0ustar00#ifndef JSON_TABLE_INCLUDED
#define JSON_TABLE_INCLUDED

/* Copyright (c) 2020, MariaDB Corporation. All rights reserved.

   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 <json_lib.h>

class Json_table_column;

/*
  The Json_table_nested_path represents the 'current nesting' level
  for a set of JSON_TABLE columns.
  Each column (Json_table_column instance) is linked with corresponding
  'nested path' object and gets its piece of JSON to parse during the computation
  phase.
  The root 'nested_path' is always present as a part of Table_function_json_table,
  then other 'nested_paths' can be created and linked into a tree structure when new
  'NESTED PATH' is met. The nested 'nested_paths' are linked with 'm_nested', the same-level
  'nested_paths' are linked with 'm_next_nested'.
  So for instance
    JSON_TABLE( '...', '$[*]'
       COLUMNS( a INT PATH '$.a' ,
          NESTED PATH '$.b[*]' COLUMNS (b INT PATH '$',
                                        NESTED PATH '$.c[*]' COLUMNS(x INT PATH '$')),
          NESTED PATH '$.n[*]' COLUMNS (z INT PATH '$'))
  results in 4 'nested_path' created:
                 root          nested_b       nested_c     nested_n
  m_path           '$[*]'         '$.b[*]'        '$.c[*]'     '$.n[*]
  m_nested          &nested_b     &nested_c       NULL         NULL
  n_next_nested     NULL          &nested_n       NULL         NULL

  and 4 columns created:
              a          b            x            z
  m_nest    &root      &nested_b    &nested_c    &nested_n
*/

class Json_table_nested_path : public Sql_alloc
{
public:
  json_path_t m_path;  /* The JSON Path to get the rows from */
  bool m_null; // TRUE <=> producing a NULL-complemented row.

  /*** Construction interface ***/
  Json_table_nested_path():
    m_null(TRUE), m_nested(NULL), m_next_nested(NULL)
  {}

  int set_path(THD *thd, const LEX_CSTRING &path);

  /*** Methods for performing a scan ***/
  void scan_start(CHARSET_INFO *i_cs, const uchar *str, const uchar *end);
  int scan_next();
  bool check_error(const char *str);

  /*** Members for getting the values we've scanned to ***/
  const uchar *get_value() { return m_engine.value_begin; }
  const uchar *get_value_end() { return m_engine.s.str_end; }

  /* Counts the rows produced. Used by FOR ORDINALITY columns */
  longlong m_ordinality_counter;

  int print(THD *thd, Field ***f, String *str,
            List_iterator_fast<Json_table_column> &it,
            Json_table_column **last_column);
private:
  /* The head of the list of nested NESTED PATH statements. */
  Json_table_nested_path *m_nested;

  /* in the above list items are linked with the */
  Json_table_nested_path *m_next_nested;

  /*** Members describing NESTED PATH structure ***/
  /* Parent nested path. The "root" path has this NULL */
  Json_table_nested_path *m_parent;

  /*** Members describing current JSON Path scan state ***/
  /* The JSON Parser and JSON Path evaluator */
  json_engine_t m_engine;

  /* The path the parser is currently pointing to */
  json_path_t m_cur_path;

  /* The child NESTED PATH we're currently scanning */
  Json_table_nested_path *m_cur_nested;

  static bool column_in_this_or_nested(const Json_table_nested_path *p,
                                       const Json_table_column *jc);
  friend class Table_function_json_table;
};


/*
  @brief
    Describes the column definition in JSON_TABLE(...) syntax.

  @detail
    Has methods for printing/handling errors but otherwise it's a static
    object.
*/

class Json_table_column : public Sql_alloc
{
public:
  enum enum_type
  {
    FOR_ORDINALITY,
    PATH,
    EXISTS_PATH
  };

  enum enum_on_type
  {
    ON_EMPTY,
    ON_ERROR
  };

  enum enum_on_response
  {
    RESPONSE_NOT_SPECIFIED,
    RESPONSE_ERROR,
    RESPONSE_NULL,
    RESPONSE_DEFAULT
  };

  struct On_response
  {
  public:
    Json_table_column::enum_on_response m_response;
    Item *m_default;
    int respond(Json_table_column *jc, Field *f, uint error_num);
    int print(const char *name, String *str) const;
    bool specified() const { return m_response != RESPONSE_NOT_SPECIFIED; }
  };

  enum_type m_column_type;
  bool m_format_json;
  json_path_t m_path;
  On_response m_on_error;
  On_response m_on_empty;
  Create_field *m_field;
  Json_table_nested_path *m_nest;
  CHARSET_INFO *m_explicit_cs;

  void set(enum_type ctype)
  {
    m_column_type= ctype;
  }
  int set(THD *thd, enum_type ctype, const LEX_CSTRING &path, CHARSET_INFO *cs);
  Json_table_column(Create_field *f, Json_table_nested_path *nest) :
    m_field(f), m_nest(nest), m_explicit_cs(NULL)
  {
    m_on_error.m_response= RESPONSE_NOT_SPECIFIED;
    m_on_empty.m_response= RESPONSE_NOT_SPECIFIED;
  }
  int print(THD *tnd, Field **f, String *str);
};


/*
  Class represents the table function, the function
  that returns the table as a result so supposed to appear
  in the FROM list of the SELECT statement.
  At the moment there is only one such function JSON_TABLE,
  so the class named after it, but should be refactored
  into the hierarchy root if we create more of that functions.

  As the parser finds the table function in the list it
  creates an instance of Table_function_json_table storing it
  into the TABLE_LIST::table_function.
  Then the ha_json_table instance is created based on it in
  the create_table_for_function().

  == Replication: whether JSON_TABLE is deterministic ==

  In sql_yacc.yy, we set BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION whenever
  JSON_TABLE is used. The reasoning behind this is as follows:

  In the current MariaDB code, evaluation of JSON_TABLE is deterministic,
  that is, for a given input string JSON_TABLE will always produce the same
  set of rows in the same order.  However one can think of JSON documents
  that one can consider indentical which will produce different output.
  In order to be feature-proof and withstand changes like:
  - sorting JSON object members by name (like MySQL does)
  - changing the way duplicate object members are handled
  we mark the function as SBR-unsafe.
  (If there is ever an issue with this, marking the function as SBR-safe
   is a non-intrusive change we will always be able to make)
*/

class Table_function_json_table : public Sql_alloc
{
public:
  /*** Basic properties of the original JSON_TABLE(...) ***/
  Item *m_json; /* The JSON value to be parsed. */

  /* The COLUMNS(...) part representation. */
  Json_table_nested_path m_nested_path;

  /* The list of table column definitions. */
  List<Json_table_column> m_columns;

  /*** Name resolution functions ***/
  bool setup(THD *thd, TABLE_LIST *sql_table, SELECT_LEX *s_lex);

  int walk_items(Item_processor processor, bool walk_subquery,
                 void *argument);

  /*** Functions for interaction with the Query Optimizer ***/
  void fix_after_pullout(TABLE_LIST *sql_table,
                         st_select_lex *new_parent, bool merge);
  void update_used_tables() { m_json->update_used_tables(); }

  table_map used_tables() const { return m_json->used_tables(); }
  bool join_cache_allowed() const
  {
    /*
      Can use join cache when we have an outside reference.
      If there's dependency on any other table or randomness,
      cannot use it.
    */
    return !(used_tables() & ~OUTER_REF_TABLE_BIT);
  }
  void get_estimates(ha_rows *out_rows,
                     double *scan_time, double *startup_cost);

  int print(THD *thd, TABLE_LIST *sql_table,
            String *str, enum_query_type query_type);

  /*** Construction interface to be used from the parser ***/
  Table_function_json_table(Item *json):
    m_json(json),
    m_context_setup_done(false)
  {
    cur_parent= &m_nested_path;
    last_sibling_hook= &m_nested_path.m_nested;
  }

  void start_nested_path(Json_table_nested_path *np);
  void end_nested_path();
  Json_table_nested_path *get_cur_nested_path() { return cur_parent; }
  void set_name_resolution_context(Name_resolution_context *arg)
  {
    m_context= arg;
  }

  /* SQL Parser: current column in JSON_TABLE (...) syntax */
  Json_table_column *m_cur_json_table_column;

private:
  /* Context to be used for resolving the first argument. */
  Name_resolution_context *m_context;

  bool m_context_setup_done;

  /* Current NESTED PATH level being parsed */
  Json_table_nested_path *cur_parent;

  /*
    Pointer to the list tail where we add the next NESTED PATH.
    It points to the cur_parnt->m_nested for the first nested
    and prev_nested->m_next_nested for the coesequent ones.
  */
  Json_table_nested_path **last_sibling_hook;
};

bool push_table_function_arg_context(LEX *lex, MEM_ROOT *alloc);

TABLE *create_table_for_function(THD *thd, TABLE_LIST *sql_table);

table_map add_table_function_dependencies(List<TABLE_LIST> *join_list,
                                          table_map nest_tables);

#endif /* JSON_TABLE_INCLUDED */

server/private/my_service_manager.h000064400000004002150400263750013532 0ustar00/*
   Copyright (c) 2015 Daniel Black. All rights reserved.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA
*/


#ifndef MY_SERVICE_MANAGER_INCLUDED
#define MY_SERVICE_MANAGER_INCLUDED

#if defined(HAVE_SYSTEMD) && !defined(EMBEDDED_LIBRARY)
/*
  sd-daemon.h may include inttypes.h. Explicitly request format macros before
  the first inclusion of inttypes.h.
*/
#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif  // !defined(__STDC_FORMAT_MACROS)
#include <systemd/sd-daemon.h>
/** INTERVAL in seconds followed by printf style status */
#define service_manager_extend_timeout(INTERVAL, FMTSTR, ...) \
  sd_notifyf(0, "STATUS=" FMTSTR "\nEXTEND_TIMEOUT_USEC=%u\n", ##__VA_ARGS__, INTERVAL * 1000000)
/* sd_listen_fds_with_names added v227 however RHEL/Centos7 has v219, fallback to sd_listen_fds */
#ifndef HAVE_SYSTEMD_SD_LISTEN_FDS_WITH_NAMES
#define sd_listen_fds_with_names(FD, NAMES) sd_listen_fds(FD)
#endif

#else
#define sd_listen_fds_with_names(FD, NAMES) (0)
#define sd_is_socket_unix(FD, TYPE, LISTENING, PATH, SIZE) (0)
#define sd_is_socket_inet(FD, FAMILY, TYPE, LISTENING, PORT) (0)
#define SD_LISTEN_FDS_START (0)
#define sd_notify(X, Y)
#define sd_notifyf(E, F, ...)
#ifdef _WIN32
  #define service_manager_extend_timeout(I, F, ...) \
    mysqld_win_extend_service_timeout(I)
#else
  #define service_manager_extend_timeout(I, FMTSTR, ...)
#endif
#endif

#endif /* MY_SERVICE_MANAGER_INCLUDED */
server/private/item_windowfunc.h000064400000103013150400263750013076 0ustar00/*
   Copyright (c) 2016, 2020, MariaDB

   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-1301  USA */

#ifndef ITEM_WINDOWFUNC_INCLUDED
#define ITEM_WINDOWFUNC_INCLUDED

#include "item.h"

class Window_spec;


int test_if_group_changed(List<Cached_item> &list);


/* A wrapper around test_if_group_changed */
class Group_bound_tracker
{
public:

  Group_bound_tracker(THD *thd, SQL_I_List<ORDER> *list)
  {
    for (ORDER *curr = list->first; curr; curr=curr->next)
    {
        Cached_item *tmp= new_Cached_item(thd, curr->item[0], TRUE);
        group_fields.push_back(tmp);
    }
  }

  void init()
  {
    first_check= true;
  }

  /*
    Check if the current row is in a different group than the previous row
    this function was called for.
    XXX: Side-effect: The new row's group becomes the current row's group.

    Returns true if there is a change between the current_group and the cached
    value, or if it is the first check after a call to init.
  */
  bool check_if_next_group()
  {
    if (test_if_group_changed(group_fields) > -1 || first_check)
    {
      first_check= false;
      return true;
    }
    return false;
  }

  /*
    Check if the current row is in a different group than the previous row
    check_if_next_group was called for.

    Compares the groups without the additional side effect of updating the
    current cached values.
  */
  int compare_with_cache()
  {
    List_iterator<Cached_item> li(group_fields);
    Cached_item *ptr;
    int res;
    while ((ptr= li++))
    {
      if ((res= ptr->cmp_read_only()))
        return res;
    }
    return 0;
  }
  ~Group_bound_tracker()
  {
    group_fields.delete_elements();
  }

private:
  List<Cached_item> group_fields;
  /*
    During the first check_if_next_group, the list of cached_items is not
    initialized. The compare function will return that the items match if
    the field's value is the same as the Cached_item's default value (0).
    This flag makes sure that we always return true during the first check.

    XXX This is better to be implemented within test_if_group_changed, but
    since it is used in other parts of the codebase, we keep it here for now.
  */
   bool first_check;
};

/*
  ROW_NUMBER() OVER (...)

  @detail
  - This is a Window function (not just an aggregate)
  - It can be computed by doing one pass over select output, provided 
    the output is sorted according to the window definition.
*/

class Item_sum_row_number: public Item_sum_int
{
  longlong count;

public:

  Item_sum_row_number(THD *thd)
    : Item_sum_int(thd),  count(0) {}

  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }

  void clear() override
  {
    count= 0;
  }

  bool add() override
  {
    count++;
    return false;
  }

  void reset_field() override { DBUG_ASSERT(0); }
  void update_field() override {}

  enum Sumfunctype sum_func() const override
  {
    return ROW_NUMBER_FUNC;
  }

  longlong val_int() override
  {
    return count;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("row_number") };
    return name;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_row_number>(thd, this); }
};


/*
  RANK() OVER (...) Windowing function

  @detail
  - This is a Window function (not just an aggregate)
  - It can be computed by doing one pass over select output, provided 
    the output is sorted according to the window definition.

  The function is defined as:

  "The rank of row R is defined as 1 (one) plus the number of rows that 
  precede R and are not peers of R"

  "This implies that if two or more rows are not distinct with respect to 
  the window ordering, then there will be one or more"
*/

class Item_sum_rank: public Item_sum_int
{
protected:
  longlong row_number; // just ROW_NUMBER()
  longlong cur_rank;   // current value

  Group_bound_tracker *peer_tracker;
public:

  Item_sum_rank(THD *thd) : Item_sum_int(thd), peer_tracker(NULL) {}

  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }

  void clear() override
  {
    /* This is called on partition start */
    cur_rank= 1;
    row_number= 0;
  }

  bool add() override;

  longlong val_int() override
  {
    return cur_rank;
  }

  void reset_field() override { DBUG_ASSERT(0); }
  void update_field() override {}

  enum Sumfunctype sum_func () const override
  {
    return RANK_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("rank") };
    return name;
  }

  void setup_window_func(THD *thd, Window_spec *window_spec) override;

  void cleanup() override
  {
    if (peer_tracker)
    {
      delete peer_tracker;
      peer_tracker= NULL;
    }
    Item_sum_int::cleanup();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_rank>(thd, this); }
};


/*
  DENSE_RANK() OVER (...) Windowing function

  @detail
  - This is a Window function (not just an aggregate)
  - It can be computed by doing one pass over select output, provided 
    the output is sorted according to the window definition.

  The function is defined as:

  "If DENSE_RANK is specified, then the rank of row R is defined as the 
  number of rows preceding and including R that are distinct with respect 
  to the window ordering"

  "This implies that there are no gaps in the sequential rank numbering of
  rows in each window partition."
*/


class Item_sum_dense_rank: public Item_sum_int
{
  longlong dense_rank;
  bool first_add;
  Group_bound_tracker *peer_tracker;
 public:
  /*
     XXX(cvicentiu) This class could potentially be implemented in the rank
     class, with a switch for the DENSE case.
  */
  void clear() override
  {
    dense_rank= 0;
    first_add= true;
  }
  bool add() override;
  void reset_field() override { DBUG_ASSERT(0); }
  void update_field() override {}
  longlong val_int() override
  {
    return dense_rank;
  }

  Item_sum_dense_rank(THD *thd)
    : Item_sum_int(thd), dense_rank(0), first_add(true), peer_tracker(NULL) {}
  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }
  enum Sumfunctype sum_func () const override
  {
    return DENSE_RANK_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("dense_rank") };
    return name;
  }

  void setup_window_func(THD *thd, Window_spec *window_spec) override;

  void cleanup() override
  {
    if (peer_tracker)
    {
      delete peer_tracker;
      peer_tracker= NULL;
    }
    Item_sum_int::cleanup();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_dense_rank>(thd, this); }
};

class Item_sum_hybrid_simple : public Item_sum_hybrid
{
 public:
  Item_sum_hybrid_simple(THD *thd, Item *arg):
   Item_sum_hybrid(thd, arg),
   value(NULL)
  { }

  Item_sum_hybrid_simple(THD *thd, Item *arg1, Item *arg2):
   Item_sum_hybrid(thd, arg1, arg2),
   value(NULL)
  { }

  bool add() override;
  bool fix_fields(THD *, Item **) override;
  bool fix_length_and_dec() override;
  void setup_hybrid(THD *thd, Item *item);
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  void reset_field() override;
  String *val_str(String *) override;
  bool val_native(THD *thd, Native *to) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }
  void update_field() override;
  Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override;
  void clear() override
  {
    value->clear();
    null_value= 1;
  }

 private:
  Item_cache *value;
};

/*
   This item will remember the first value added to it. It will not update
   the value unless it is cleared.
*/
class Item_sum_first_value : public Item_sum_hybrid_simple
{
 public:
  Item_sum_first_value(THD* thd, Item* arg_expr) :
    Item_sum_hybrid_simple(thd, arg_expr) {}


  enum Sumfunctype sum_func () const override
  {
    return FIRST_VALUE_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("first_value") };
    return name;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_first_value>(thd, this); }
};

/*
   This item will remember the last value added to it.

   This item does not support removal, and can be cleared only by calling
   clear().
*/
class Item_sum_last_value : public Item_sum_hybrid_simple
{
 public:
  Item_sum_last_value(THD* thd, Item* arg_expr) :
    Item_sum_hybrid_simple(thd, arg_expr) {}

  enum Sumfunctype sum_func() const override
  {
    return LAST_VALUE_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("last_value") };
    return name;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_last_value>(thd, this); }
};


class Item_sum_nth_value : public Item_sum_hybrid_simple
{
 public:
  Item_sum_nth_value(THD *thd, Item *arg_expr, Item* offset_expr) :
    Item_sum_hybrid_simple(thd, arg_expr, offset_expr) {}

  enum Sumfunctype sum_func() const override
  {
    return NTH_VALUE_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("nth_value") };
    return name;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_nth_value>(thd, this); }
};


class Item_sum_lead : public Item_sum_hybrid_simple
{
 public:
  Item_sum_lead(THD *thd, Item *arg_expr, Item* offset_expr) :
    Item_sum_hybrid_simple(thd, arg_expr, offset_expr) {}

  enum Sumfunctype sum_func() const override
  {
    return LEAD_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("lead") };
    return name;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_lead>(thd, this); }
};


class Item_sum_lag : public Item_sum_hybrid_simple
{
 public:
  Item_sum_lag(THD *thd, Item *arg_expr, Item* offset_expr) :
    Item_sum_hybrid_simple(thd, arg_expr, offset_expr) {}

  enum Sumfunctype sum_func() const override
  {
    return LAG_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("lag") };
    return name;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_lag>(thd, this); }
};


class Partition_row_count
{
public:
  Partition_row_count() :partition_row_count_(0) { }
  void set_partition_row_count(ulonglong count)
  {
    partition_row_count_ = count;
  }
  double calc_val_real(bool *null_value,
                       ulonglong current_row_count)
  {
    if ((*null_value= (partition_row_count_ == 0)))
      return 0;
    return static_cast<double>(current_row_count) / partition_row_count_;
  }
protected:
  longlong get_row_count() { return partition_row_count_; }
  ulonglong partition_row_count_;
};


class Current_row_count
{
public:
  Current_row_count() :current_row_count_(0) { }
protected:
  ulonglong get_row_number() { return current_row_count_ ; }
  ulonglong current_row_count_;
};


/*
  @detail
  "The relative rank of a row R is defined as (RK-1)/(NR-1), where RK is 
  defined to be the RANK of R and NR is defined to be the number of rows in
  the window partition of R."

  Computation of this function requires two passes:
  - First pass to find #rows in the partition
    This is held within the row_count context.
  - Second pass to compute rank of current row and the value of the function
*/
class Item_sum_percent_rank: public Item_sum_double,
                             public Partition_row_count
{
 public:
  Item_sum_percent_rank(THD *thd)
    : Item_sum_double(thd), cur_rank(1), peer_tracker(NULL) {}

  longlong val_int() override
  {
   /*
      Percent rank is a real value so calling the integer value should never
      happen. It makes no sense as it gets truncated to either 0 or 1.
   */
    DBUG_ASSERT(0);
    return 0;
  }

  double val_real() override
  {
   /*
     We can not get the real value without knowing the number of rows
     in the partition. Don't divide by 0.
   */
   ulonglong partition_rows = get_row_count();
   null_value= partition_rows > 0 ? false : true;

   return partition_rows > 1 ?
             static_cast<double>(cur_rank - 1) / (partition_rows - 1) : 0;
  }

  enum Sumfunctype sum_func () const override
  {
    return PERCENT_RANK_FUNC;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("percent_rank") };
    return name;
  }

  void update_field() override {}

  void clear() override
  {
    cur_rank= 1;
    row_number= 0;
  }
  bool add() override;
  const Type_handler *type_handler() const override
  { return &type_handler_double; }

  bool fix_length_and_dec() override
  {
    decimals = 10;  // TODO-cvicentiu find out how many decimals the standard
                    // requires.
    return FALSE;
  }

  void setup_window_func(THD *thd, Window_spec *window_spec) override;

  void reset_field() override { DBUG_ASSERT(0); }

  void set_partition_row_count(ulonglong count) override
  {
    Partition_row_count::set_partition_row_count(count);
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_percent_rank>(thd, this); }

 private:
  longlong cur_rank;   // Current rank of the current row.
  longlong row_number; // Value if this were ROW_NUMBER() function.

  Group_bound_tracker *peer_tracker;

  void cleanup() override
  {
    if (peer_tracker)
    {
      delete peer_tracker;
      peer_tracker= NULL;
    }
    Item_sum_num::cleanup();
  }
};




/*
  @detail
  "The relative rank of a row R is defined as NP/NR, where 
  - NP is defined to be the number of rows preceding or peer with R in the 
    window ordering of the window partition of R
  - NR is defined to be the number of rows in the window partition of R.

  Just like with Item_sum_percent_rank, computation of this function requires
  two passes.
*/

class Item_sum_cume_dist: public Item_sum_double,
                          public Partition_row_count,
                          public Current_row_count
{
 public:
  Item_sum_cume_dist(THD *thd) :Item_sum_double(thd) { }
  Item_sum_cume_dist(THD *thd, Item *arg) :Item_sum_double(thd, arg) { }

  double val_real() override
  {
    return calc_val_real(&null_value, current_row_count_);
  }

  bool add() override
  {
    current_row_count_++;
    return false;
  }

  enum Sumfunctype sum_func() const override
  {
    return CUME_DIST_FUNC;
  }

  void clear() override
  {
    current_row_count_= 0;
    partition_row_count_= 0;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cume_dist") };
    return name;
  }

  void update_field() override {}
  const Type_handler *type_handler() const override
  { return &type_handler_double; }

  bool fix_length_and_dec() override
  {
    decimals = 10;  // TODO-cvicentiu find out how many decimals the standard
                    // requires.
    return FALSE;
  }
  
  void reset_field() override { DBUG_ASSERT(0); }

  void set_partition_row_count(ulonglong count) override
  {
    Partition_row_count::set_partition_row_count(count);
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_cume_dist>(thd, this); }

};

class Item_sum_ntile : public Item_sum_int,
                       public Partition_row_count,
                       public Current_row_count
{
 public:
  Item_sum_ntile(THD* thd, Item* num_quantiles_expr) :
    Item_sum_int(thd, num_quantiles_expr), n_old_val_(0)
  { }

  longlong val_int() override
  {
    if (get_row_count() == 0)
    {
      null_value= true;
      return 0;
    }

    longlong num_quantiles= get_num_quantiles();

    if (num_quantiles <= 0 || 
      (static_cast<ulonglong>(num_quantiles) != n_old_val_ && n_old_val_ > 0))
    {
      my_error(ER_INVALID_NTILE_ARGUMENT, MYF(0));
      return true;
    }
    n_old_val_= static_cast<ulonglong>(num_quantiles);
    null_value= false;
    ulonglong quantile_size = get_row_count() / num_quantiles;
    ulonglong extra_rows = get_row_count() - quantile_size * num_quantiles;

    if (current_row_count_ <= extra_rows * (quantile_size + 1))
      return (current_row_count_ - 1) / (quantile_size + 1) + 1;

    return (current_row_count_ - 1 - extra_rows) / quantile_size + 1;
  }

  bool add() override
  {
    current_row_count_++;
    return false;
  }

  enum Sumfunctype sum_func() const override
  {
    return NTILE_FUNC;
  }

  void clear() override
  {
    current_row_count_= 0;
    partition_row_count_= 0;
    n_old_val_= 0;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ntile") };
    return name;
  }

  void update_field() override {}

  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }

  void reset_field() override { DBUG_ASSERT(0); }

  void set_partition_row_count(ulonglong count) override
  {
    Partition_row_count::set_partition_row_count(count);
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_ntile>(thd, this); }

 private:
  longlong get_num_quantiles() { return args[0]->val_int(); }
  ulonglong n_old_val_;
};

class Item_sum_percentile_disc : public Item_sum_num,
                                 public Type_handler_hybrid_field_type,
                                 public Partition_row_count,
                                 public Current_row_count
{
public:
  Item_sum_percentile_disc(THD *thd, Item* arg) : Item_sum_num(thd, arg),
                           Type_handler_hybrid_field_type(&type_handler_slonglong),
                           value(NULL), val_calculated(FALSE), first_call(TRUE),
                           prev_value(0), order_item(NULL){}

  double val_real() override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return 0;
    }
    null_value= false;
    return value->val_real();
  }

  longlong val_int() override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return 0;
    }
    null_value= false;
    return value->val_int();
  }

  my_decimal* val_decimal(my_decimal* dec) override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return 0;
    }
    null_value= false;
    return value->val_decimal(dec);
  }

  String* val_str(String *str) override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return 0;
    }
    null_value= false;
    return value->val_str(str);
  }

  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return true;
    }
    null_value= false;
    return value->get_date(thd, ltime, fuzzydate);
  }

  bool val_native(THD *thd, Native *to) override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return true;
    }
    null_value= false;
    return value->val_native(thd, to);
  }

  bool add() override
  {
    Item *arg= get_arg(0);
    if (arg->is_null())
      return false;

    if (first_call)
    {
      prev_value= arg->val_real();
      if (prev_value > 1 || prev_value < 0)
      {
        my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0), func_name());
        return true;
      }
      first_call= false;
    }

    double arg_val= arg->val_real();

    if (prev_value != arg_val)
    {
      my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0), func_name());
      return true;
    }

    if (val_calculated)
      return false;

    value->store(order_item);
    value->cache_value();
    if (value->null_value)
      return false;

    current_row_count_++;
    double val= calc_val_real(&null_value, current_row_count_);

    if (val >= prev_value && !val_calculated)
      val_calculated= true;
    return false;
  }

  enum Sumfunctype sum_func() const override
  {
    return PERCENTILE_DISC_FUNC;
  }

  void clear() override
  {
    val_calculated= false;
    first_call= true;
    value->clear();
    partition_row_count_= 0;
    current_row_count_= 0;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("percentile_disc") };
    return name;
  }

  void update_field() override {}
  const Type_handler *type_handler() const override
  {return Type_handler_hybrid_field_type::type_handler();}

  bool fix_length_and_dec() override
  {
    decimals = 10;  // TODO-cvicentiu find out how many decimals the standard
                    // requires.
    return FALSE;
  }

  void reset_field() override { DBUG_ASSERT(0); }

  void set_partition_row_count(ulonglong count) override
  {
    Partition_row_count::set_partition_row_count(count);
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_percentile_disc>(thd, this); }
  void setup_window_func(THD *thd, Window_spec *window_spec) override;
  void setup_hybrid(THD *thd, Item *item);
  bool fix_fields(THD *thd, Item **ref) override;

private:
  Item_cache *value;
  bool val_calculated;
  bool first_call;
  double prev_value;
  Item *order_item;
};

class Item_sum_percentile_cont : public Item_sum_double,
                                 public Partition_row_count,
                                 public Current_row_count
{
public:
  Item_sum_percentile_cont(THD *thd, Item* arg) : Item_sum_double(thd, arg),
                           floor_value(NULL), ceil_value(NULL), first_call(TRUE),prev_value(0),
                           ceil_val_calculated(FALSE), floor_val_calculated(FALSE), order_item(NULL){}

  double val_real() override
  {
    if (get_row_count() == 0 || get_arg(0)->is_null())
    {
      null_value= true;
      return 0;
    }
    null_value= false;
    double val= 1 + prev_value * (get_row_count()-1);

    /*
      Applying the formula to get the value
      If (CRN = FRN = RN) then the result is (value of expression from row at RN)
      Otherwise the result is
      (CRN - RN) * (value of expression for row at FRN) +
      (RN - FRN) * (value of expression for row at CRN)
    */

    if(ceil(val) == floor(val))
      return floor_value->val_real();

    double ret_val=  ((val - floor(val)) * ceil_value->val_real()) +
                  ((ceil(val) - val) * floor_value->val_real());

    return ret_val;
  }

  bool add() override
  {
    Item *arg= get_arg(0);
    if (arg->is_null())
      return false;

    if (first_call)
    {
      first_call= false;
      prev_value= arg->val_real();
      if (prev_value > 1 || prev_value < 0)
      {
        my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0), func_name());
        return true;
      }
    }

    double arg_val= arg->val_real();
    if (prev_value != arg_val)
    {
      my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0), func_name());
      return true;
    }

    if (!floor_val_calculated)
    {
      floor_value->store(order_item);
      floor_value->cache_value();
      if (floor_value->null_value)
        return false;
    }
    if (floor_val_calculated && !ceil_val_calculated)
    {
      ceil_value->store(order_item);
      ceil_value->cache_value();
      if (ceil_value->null_value)
        return false;
    }

    current_row_count_++;
    double val= 1 + prev_value * (get_row_count()-1);

    if (!floor_val_calculated && get_row_number() == floor(val))
      floor_val_calculated= true;

    if (!ceil_val_calculated && get_row_number() == ceil(val))
      ceil_val_calculated= true;
    return false;
  }

  enum Sumfunctype sum_func() const override
  {
    return PERCENTILE_CONT_FUNC;
  }

  void clear() override
  {
    first_call= true;
    floor_value->clear();
    ceil_value->clear();
    floor_val_calculated= false;
    ceil_val_calculated= false;
    partition_row_count_= 0;
    current_row_count_= 0;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("percentile_cont") };
    return name;
  }
  void update_field() override {}

  bool fix_length_and_dec() override
  {
    decimals = 10;  // TODO-cvicentiu find out how many decimals the standard
                    // requires.
    return FALSE;
  }

  void reset_field() override { DBUG_ASSERT(0); }

  void set_partition_row_count(ulonglong count) override
  {
    Partition_row_count::set_partition_row_count(count);
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_sum_percentile_cont>(thd, this); }
  void setup_window_func(THD *thd, Window_spec *window_spec) override;
  void setup_hybrid(THD *thd, Item *item);
  bool fix_fields(THD *thd, Item **ref) override;

private:
  Item_cache *floor_value;
  Item_cache *ceil_value;
  bool first_call;
  double prev_value;
  bool ceil_val_calculated;
  bool floor_val_calculated;
  Item *order_item;
};




class Item_window_func : public Item_func_or_sum
{
  /* Window function parameters as we've got them from the parser */
public:
  LEX_CSTRING *window_name;
public:
  Window_spec *window_spec;
  
public:
  Item_window_func(THD *thd, Item_sum *win_func, LEX_CSTRING *win_name)
    : Item_func_or_sum(thd, (Item *) win_func),
      window_name(win_name), window_spec(NULL), 
      force_return_blank(true),
      read_value_from_result_field(false) {}

  Item_window_func(THD *thd, Item_sum *win_func, Window_spec *win_spec)
    : Item_func_or_sum(thd, (Item *) win_func), 
      window_name(NULL), window_spec(win_spec), 
      force_return_blank(true),
      read_value_from_result_field(false) {}

  Item_sum *window_func() const { return (Item_sum *) args[0]; }

  void update_used_tables() override;

  /*
    This is used by filesort to mark the columns it needs to read (because they
    participate in the sort criteria and/or row retrieval. Window functions can
    only be used in sort criteria).

    Sorting by window function value is only done after the window functions
    have been computed. In that case, window function will need to read its
    temp.table field. In order to allow that, mark that field in the read_set.
  */
  bool register_field_in_read_map(void *arg) override
  {
    TABLE *table= (TABLE*) arg;
    if (result_field && (result_field->table == table || !table))
    {
      bitmap_set_bit(result_field->table->read_set, result_field->field_index);
    }
    return 0;
  }

  bool is_frame_prohibited() const
  {
    switch (window_func()->sum_func()) {
    case Item_sum::ROW_NUMBER_FUNC:
    case Item_sum::RANK_FUNC:
    case Item_sum::DENSE_RANK_FUNC:
    case Item_sum::PERCENT_RANK_FUNC:
    case Item_sum::CUME_DIST_FUNC:
    case Item_sum::NTILE_FUNC:
    case Item_sum::PERCENTILE_CONT_FUNC:
    case Item_sum::PERCENTILE_DISC_FUNC:
      return true;
    default: 
      return false;
    }
  }

  bool requires_special_cursors() const
  {
    switch (window_func()->sum_func()) {
    case Item_sum::FIRST_VALUE_FUNC:
    case Item_sum::LAST_VALUE_FUNC:
    case Item_sum::NTH_VALUE_FUNC:
    case Item_sum::LAG_FUNC:
    case Item_sum::LEAD_FUNC:
      return true;
    default:
      return false;
    }
  }

  bool requires_partition_size() const
  {
    switch (window_func()->sum_func()) {
    case Item_sum::PERCENT_RANK_FUNC:
    case Item_sum::CUME_DIST_FUNC:
    case Item_sum::NTILE_FUNC:
    case Item_sum::PERCENTILE_CONT_FUNC:
    case Item_sum::PERCENTILE_DISC_FUNC:
      return true;
    default:
      return false;
    }
  }

  bool requires_peer_size() const
  {
    switch (window_func()->sum_func()) {
    case Item_sum::CUME_DIST_FUNC:
      return true;
    default:
      return false;
    }
  }

  bool is_order_list_mandatory() const
  {
    switch (window_func()->sum_func()) {
    case Item_sum::RANK_FUNC:
    case Item_sum::DENSE_RANK_FUNC:
    case Item_sum::PERCENT_RANK_FUNC:
    case Item_sum::CUME_DIST_FUNC:
    case Item_sum::LAG_FUNC:
    case Item_sum::LEAD_FUNC:
    case Item_sum::PERCENTILE_CONT_FUNC:
    case Item_sum::PERCENTILE_DISC_FUNC:
      return true;
    default: 
      return false;
    }
  }  

  bool only_single_element_order_list() const
  {
    switch (window_func()->sum_func()){
    case Item_sum::PERCENTILE_CONT_FUNC:
    case Item_sum::PERCENTILE_DISC_FUNC:
      return true;
    default:
      return false;
    }
  }

  bool check_result_type_of_order_item();



  /*
    Computation functions.
    TODO: consoder merging these with class Group_bound_tracker.
  */
  void setup_partition_border_check(THD *thd);

  const Type_handler *type_handler() const override
  {
    return ((Item_sum *) args[0])->type_handler();
  }
  enum Item::Type type() const override { return Item::WINDOW_FUNC_ITEM; }

private:
  /* 
    Window functions are very special functions, so val_() methods have
    special meaning for them:

    - Phase#1, "Initial" we run the join and put its result into temporary 
      table. For window functions, we write the default value (NULL?) as 
      a placeholder.
      
    - Phase#2: "Computation": executor does the scan in {PARTITION, ORDER BY} 
      order of this window function. It calls appropriate methods to inform 
      the window function about rows entering/leaving the window. 
      It calls window_func()->val_int() so that current window function value
      can be saved and stored in the temp.table.

    - Phase#3: "Retrieval" the temporary table is read and passed to query 
      output. However, Item_window_func still remains in the select list,
      so item_windowfunc->val_int() will be called.
      During Phase#3, read_value_from_result_field= true.
  */
  bool force_return_blank;
  bool read_value_from_result_field;
  void print_for_percentile_functions(String *str, enum_query_type query_type);

public:
  void set_phase_to_initial()
  {
    force_return_blank= true;
    read_value_from_result_field= false;
  }
  void set_phase_to_computation()
  {
    force_return_blank= false;
    read_value_from_result_field= false;
  }
  void set_phase_to_retrieval()
  {
    force_return_blank= false;
    read_value_from_result_field= true;
  }

  bool is_null() override
  {
    if (force_return_blank)
      return true;

    if (read_value_from_result_field)
      return result_field->is_null();

    return window_func()->is_null();
  }

  double val_real() override 
  {
    double res;
    if (force_return_blank)
    {
      res= 0.0;
      null_value= true;
    }
    else if (read_value_from_result_field)
    {
      res= result_field->val_real();
      null_value= result_field->is_null();
    }
    else
    {
      res= window_func()->val_real();
      null_value= window_func()->null_value;
    }
    return res;
  }

  longlong val_int() override
  {
    longlong res;
    if (force_return_blank)
    {
      res= 0;
      null_value= true;
    }
    else if (read_value_from_result_field)
    {
      res= result_field->val_int();
      null_value= result_field->is_null();
    }
    else
    {
      res= window_func()->val_int();
      null_value= window_func()->null_value;
    }
    return res;
  }

  String* val_str(String* str) override
  {
    String *res;
    if (force_return_blank)
    {
      null_value= true;
      res= NULL;
    }
    else if (read_value_from_result_field)
    {
      if ((null_value= result_field->is_null()))
        res= NULL;
      else
        res= result_field->val_str(str);
    }
    else
    {
      res= window_func()->val_str(str);
      null_value= window_func()->null_value;
    }
    return res;
  }

  bool val_native(THD *thd, Native *to) override
  {
    if (force_return_blank)
      return null_value= true;
    if (read_value_from_result_field)
      return val_native_from_field(result_field, to);
    return val_native_from_item(thd, window_func(), to);
  }

  my_decimal* val_decimal(my_decimal* dec) override
  {
    my_decimal *res;
    if (force_return_blank)
    {
      null_value= true;
      res= NULL;
    }
    else if (read_value_from_result_field)
    {
      if ((null_value= result_field->is_null()))
        res= NULL;
      else
        res= result_field->val_decimal(dec);
    }
    else
    {
      res= window_func()->val_decimal(dec);
      null_value= window_func()->null_value;
    }
    return res;
  }

  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    bool res;
    if (force_return_blank)
    {
      null_value= true;
      res= true;
    }
    else if (read_value_from_result_field)
    {
      if ((null_value= result_field->is_null()))
        res= true;
      else
        res= result_field->get_date(ltime, fuzzydate);
    }
    else
    {
      res= window_func()->get_date(thd, ltime, fuzzydate);
      null_value= window_func()->null_value;
    }
    return res;
  }

  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
                              List<Item> &fields, uint flags) override;

  bool fix_length_and_dec() override
  {
    Type_std_attributes::set(window_func());
    return FALSE;
  }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("WF") };
    return name;
  }

  bool fix_fields(THD *thd, Item **ref) override;

  bool resolve_window_name(THD *thd);
  
  void print(String *str, enum_query_type query_type) override;

 Item *do_get_copy(THD *thd) const override { return 0; }

};

#endif /* ITEM_WINDOWFUNC_INCLUDED */
server/private/sql_repl.h000064400000005745150400263750011533 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_REPL_INCLUDED
#define SQL_REPL_INCLUDED

#include "rpl_filter.h"

#ifdef HAVE_REPLICATION
#include "slave.h"

struct slave_connection_state;

extern my_bool opt_show_slave_auth_info;
extern char *master_host, *master_info_file;

extern int max_binlog_dump_events;
extern my_bool opt_sporadic_binlog_dump_fail;

int start_slave(THD* thd, Master_info* mi, bool net_report);
int stop_slave(THD* thd, Master_info* mi, bool net_report);
bool change_master(THD* thd, Master_info* mi, bool *master_info_added);
bool mysql_show_binlog_events(THD* thd);
int reset_slave(THD *thd, Master_info* mi);
int reset_master(THD* thd, rpl_gtid *init_state, uint32 init_state_len,
                 ulong next_log_number);
bool purge_master_logs(THD* thd, const char* to_log);
bool purge_master_logs_before_date(THD* thd, time_t purge_time);
bool log_in_use(const char* log_name);
void adjust_linfo_offsets(my_off_t purge_offset);
void show_binlogs_get_fields(THD *thd, List<Item> *field_list);
bool show_binlogs(THD* thd);
extern int init_master_info(Master_info* mi);
bool kill_zombie_dump_threads(THD *thd, uint32 slave_server_id);
int check_binlog_magic(IO_CACHE* log, const char** errmsg);
int compare_log_name(const char *log_1, const char *log_2);

struct LOAD_FILE_IO_CACHE : public IO_CACHE
{
  THD* thd;
  my_off_t last_pos_in_file;
  bool wrote_create_file, log_delayed;
  int (*real_read_function)(struct st_io_cache *,uchar *,size_t);
};

int log_loaded_block(IO_CACHE* file, uchar *Buffer, size_t Count);
int init_replication_sys_vars();
void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags);

#ifdef HAVE_PSI_INTERFACE
extern PSI_mutex_key key_LOCK_slave_state, key_LOCK_binlog_state;
#endif
void rpl_init_gtid_slave_state();
void rpl_deinit_gtid_slave_state();
void rpl_init_gtid_waiting();
void rpl_deinit_gtid_waiting();
int gtid_state_from_binlog_pos(const char *name, uint32 pos, String *out_str);
int rpl_append_gtid_state(String *dest, bool use_binlog);
int rpl_load_gtid_state(slave_connection_state *state, bool use_binlog);
bool rpl_gtid_pos_check(THD *thd, char *str, size_t len);
bool rpl_gtid_pos_update(THD *thd, char *str, size_t len);
#else

struct LOAD_FILE_IO_CACHE : public IO_CACHE { };

#endif /* HAVE_REPLICATION */

#endif /* SQL_REPL_INCLUDED */
server/private/rpl_reporting.h000064400000007201150400263750012565 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef RPL_REPORTING_H
#define RPL_REPORTING_H

#include <my_sys.h>                             /* loglevel */

/**
   Maximum size of an error message from a slave thread.
 */
#define MAX_SLAVE_ERRMSG      1024

/**
   Mix-in to handle the message logging and reporting for relay log
   info and master log info structures.

   By inheriting from this class, the class is imbued with
   capabilities to do slave reporting.
 */
class Slave_reporting_capability
{
public:
  /** lock used to synchronize m_last_error on 'SHOW SLAVE STATUS' **/
  mutable mysql_mutex_t err_lock;
  /**
     Constructor.

     @param thread_name Printable name of the slave thread that is reporting.
   */
  Slave_reporting_capability(char const *thread_name);
  mutable my_thread_id err_thread_id;

  /**
     Writes a message and, if it's an error message, to Last_Error
     (which will be displayed by SHOW SLAVE STATUS).

     @param level       The severity level
     @param err_code    The error code
     @param msg         The message (usually related to the error
                        code, but can contain more information), in
                        printf() format.
  */
  void report(loglevel level, int err_code, const char *extra_info,
              const char *msg, ...) const
    ATTRIBUTE_FORMAT(printf, 5, 6);

  /**
     Clear errors. They will not show up under <code>SHOW SLAVE
     STATUS</code>.
   */
  void clear_error() {
    mysql_mutex_lock(&err_lock);
    m_last_error.clear();
    mysql_mutex_unlock(&err_lock);
  }

  /**
     Error information structure.
   */
  class Error {
    friend class Slave_reporting_capability;
  public:
    Error()
    {
      clear();
    }

    void clear()
    {
      number= 0;
      message[0]= '\0';
      timestamp[0]= '\0';
    }
    void update_timestamp()
    {
      struct tm tm_tmp;
      struct tm *start;

      skr= my_time(0);
      localtime_r(&skr, &tm_tmp);
      start=&tm_tmp;

      snprintf(timestamp, sizeof(timestamp), "%02d%02d%02d %02d:%02d:%02d",
               start->tm_year % 100,
               start->tm_mon+1,
               start->tm_mday,
               start->tm_hour,
               start->tm_min,
               start->tm_sec);
      timestamp[15]= '\0';
    }

    /** Error code */
    uint32 number;
    /** Error message */
    char message[MAX_SLAVE_ERRMSG];
    /** Error timestamp as string */
    char timestamp[64];
    /** Error timestamp as time_t variable. Used in performance_schema */
    time_t skr;
  };

  Error const& last_error() const { return m_last_error; }

  virtual ~Slave_reporting_capability()= 0;
private:
  /**
     Last error produced by the I/O or SQL thread respectively.
   */
  mutable Error m_last_error;

  char const *const m_thread_name;

  // not implemented
  Slave_reporting_capability(const Slave_reporting_capability& rhs);
  Slave_reporting_capability& operator=(const Slave_reporting_capability& rhs);
};

#endif // RPL_REPORTING_H

server/private/sql_prepare.h000064400000026221150400263750012217 0ustar00#ifndef SQL_PREPARE_H
#define SQL_PREPARE_H
/* Copyright (c) 1995-2008 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 "sql_error.h"


#define LAST_STMT_ID 0xFFFFFFFF
#define STMT_ID_MASK 0x7FFFFFFF

class THD;
struct LEX;

/**
  An interface that is used to take an action when
  the locking module notices that a table version has changed
  since the last execution. "Table" here may refer to any kind of
  table -- a base table, a temporary table, a view or an
  information schema table.

  When we open and lock tables for execution of a prepared
  statement, we must verify that they did not change
  since statement prepare. If some table did change, the statement
  parse tree *may* be no longer valid, e.g. in case it contains
  optimizations that depend on table metadata.

  This class provides an interface (a method) that is
  invoked when such a situation takes place.
  The implementation of the method simply reports an error, but
  the exact details depend on the nature of the SQL statement.

  At most 1 instance of this class is active at a time, in which
  case THD::m_reprepare_observer is not NULL.

  @sa check_and_update_table_version() for details of the
  version tracking algorithm 

  @sa Open_tables_state::m_reprepare_observer for the life cycle
  of metadata observers.
*/

class Reprepare_observer
{
public:
  /**
    Check if a change of metadata is OK. In future
    the signature of this method may be extended to accept the old
    and the new versions, but since currently the check is very
    simple, we only need the THD to report an error.
  */
  bool report_error(THD *thd);
  bool is_invalidated() const { return m_invalidated; }
  void reset_reprepare_observer() { m_invalidated= FALSE; }
private:
  bool m_invalidated;
};


void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length);
void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length);
void mysqld_stmt_execute_bulk(THD *thd, char *packet, uint packet_length);
void mysqld_stmt_bulk_execute(THD *thd, char *packet, uint packet_length);
void mysqld_stmt_close(THD *thd, char *packet);
void mysql_sql_stmt_prepare(THD *thd);
void mysql_sql_stmt_execute(THD *thd);
void mysql_sql_stmt_execute_immediate(THD *thd);
void mysql_sql_stmt_close(THD *thd);
void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length);
void mysqld_stmt_reset(THD *thd, char *packet);
void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
void reinit_stmt_before_use(THD *thd, LEX *lex);

my_bool bulk_parameters_iterations(THD *thd);
my_bool bulk_parameters_set(THD *thd);
/**
  Execute a fragment of server code in an isolated context, so that
  it doesn't leave any effect on THD. THD must have no open tables.
  The code must not leave any open tables around.
  The result of execution (if any) is stored in Ed_result.
*/

class Server_runnable
{
public:
  virtual bool execute_server_code(THD *thd)= 0;
  virtual ~Server_runnable();
};


/**
  Execute direct interface.

  @todo Implement support for prelocked mode.
*/

class Ed_row;

/**
  Ed_result_set -- a container with result set rows.
  @todo Implement support for result set metadata and
  automatic type conversion.
*/

class Ed_result_set
{
public:
  operator List<Ed_row>&() { return *m_rows; }
  unsigned int size() const { return m_rows->elements; }

  Ed_result_set(List<Ed_row> *rows_arg, size_t column_count,
                MEM_ROOT *mem_root_arg);

  /** We don't call member destructors, they all are POD types. */
  ~Ed_result_set() = default;

  size_t get_field_count() const { return m_column_count; }

  static void *operator new(size_t size, MEM_ROOT *mem_root)
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr, size_t size) throw ();
  static void operator delete(void *, MEM_ROOT *){}
private:
  Ed_result_set(const Ed_result_set &);        /* not implemented */
  Ed_result_set &operator=(Ed_result_set &);   /* not implemented */
private:
  MEM_ROOT m_mem_root;
  size_t m_column_count;
  List<Ed_row> *m_rows;
  Ed_result_set *m_next_rset;
  friend class Ed_connection;
};


class Ed_connection
{
public:
  /**
    Construct a new "execute direct" connection.

    The connection can be used to execute SQL statements.
    If the connection failed to initialize, the error
    will be returned on the attempt to execute a statement.

    @pre thd  must have no open tables
              while the connection is used. However,
              Ed_connection works okay in LOCK TABLES mode.
              Other properties of THD, such as the current warning
              information, errors, etc. do not matter and are
              preserved by Ed_connection. One thread may have many
              Ed_connections created for it.
  */
  Ed_connection(THD *thd);

  /**
    Execute one SQL statement.

    Until this method is executed, no other methods of
    Ed_connection can be used. Life cycle of Ed_connection is:

    Initialized -> a statement has been executed ->
    look at result, move to next result ->
    look at result, move to next result ->
    ...
    moved beyond the last result == Initialized.

    This method can be called repeatedly. Once it's invoked,
    results of the previous execution are lost.

    A result of execute_direct() can be either:

    - success, no result set rows. In this case get_field_count()
    returns 0. This happens after execution of INSERT, UPDATE,
    DELETE, DROP and similar statements. Some other methods, such
    as get_affected_rows() can be used to retrieve additional
    result information.

    - success, there are some result set rows (maybe 0). E.g.
    happens after SELECT. In this case get_field_count() returns
    the number of columns in a result set and store_result()
    can be used to retrieve a result set..

    - an error, methods to retrieve error information can
    be used.

    @return execution status
    @retval FALSE  success, use get_field_count()
                   to determine what to do next.
    @retval TRUE   error, use get_last_error()
                   to see the error number.
  */
  bool execute_direct(Protocol *p, LEX_STRING sql_text);

  /**
    Same as the previous, but takes an instance of Server_runnable
    instead of SQL statement text.

    @return execution status
      
    @retval  FALSE  success, use get_field_count() 
                    if your code fragment is supposed to
                    return a result set
    @retval  TRUE   failure
  */
  bool execute_direct(Protocol *p, Server_runnable *server_runnable);

  /**
    Get the number of affected (deleted, updated)
    rows for the current statement. Can be
    used for statements with get_field_count() == 0.

    @sa Documentation for C API function
    mysql_affected_rows().
  */
  ulonglong get_affected_rows() const
  {
    return m_diagnostics_area.affected_rows();
  }

  /**
    Get the last insert id, if any.

    @sa Documentation for mysql_insert_id().
  */
  ulonglong get_last_insert_id() const
  {
    return m_diagnostics_area.last_insert_id();
  }

  /**
    Get the total number of warnings for the last executed
    statement. Note, that there is only one warning list even
    if a statement returns multiple results.

    @sa Documentation for C API function
    mysql_num_warnings().
  */
  ulong get_warn_count() const
  {
    return m_diagnostics_area.warn_count();
  }

  /**
    The following members are only valid if execute_direct()
    or move_to_next_result() returned an error.
    They never fail, but if they are called when there is no
    result, or no error, the result is not defined.
  */
  const char *get_last_error() const { return m_diagnostics_area.message(); }
  unsigned int get_last_errno() const { return m_diagnostics_area.sql_errno(); }
  const char *get_last_sqlstate() const { return m_diagnostics_area.get_sqlstate(); }

  /**
    Provided get_field_count() is not 0, this never fails. You don't
    need to free the result set, this is done automatically when
    you advance to the next result set or destroy the connection.
    Not returning const because of List iterator not accepting
    Should be used when you would like Ed_connection to manage
    result set memory for you.
  */
  Ed_result_set *use_result_set() { return m_current_rset; }
  /**
    Provided get_field_count() is not 0, this never fails. You
    must free the returned result set. This can be called only
    once after execute_direct().
    Should be used when you would like to get the results
    and destroy the connection.
  */
  Ed_result_set *store_result_set();

  /**
    If the query returns multiple results, this method
    can be checked if there is another result beyond the next
    one.
    Never fails.
  */
  bool has_next_result() const { return MY_TEST(m_current_rset->m_next_rset); }
  /**
    Only valid to call if has_next_result() returned true.
    Otherwise the result is undefined.
  */
  bool move_to_next_result()
  {
    m_current_rset= m_current_rset->m_next_rset;
    return MY_TEST(m_current_rset);
  }

  ~Ed_connection() { free_old_result(); }
private:
  Diagnostics_area m_diagnostics_area;
  /**
    Execute direct interface does not support multi-statements, only
    multi-results. So we never have a situation when we have
    a mix of result sets and OK or error packets. We either
    have a single result set, a single error, or a single OK,
    or we have a series of result sets, followed by an OK or error.
  */
  THD *m_thd;
  Ed_result_set *m_rsets;
  Ed_result_set *m_current_rset;
private:
  void free_old_result();
  void add_result_set(Ed_result_set *ed_result_set);
private:
  Ed_connection(const Ed_connection &);        /* not implemented */
  Ed_connection &operator=(Ed_connection &);   /* not implemented */
};


/** One result set column. */

struct Ed_column: public LEX_STRING
{
  /** Implementation note: destructor for this class is never called. */
};


/** One result set record. */

class Ed_row: public Sql_alloc
{
public:
  const Ed_column &operator[](const unsigned int column_index) const
  {
    return *get_column(column_index);
  }
  const Ed_column *get_column(const unsigned int column_index) const
  {
    DBUG_ASSERT(column_index < size());
    return m_column_array + column_index;
  }
  size_t size() const { return m_column_count; }

  Ed_row(Ed_column *column_array_arg, size_t column_count_arg)
    :m_column_array(column_array_arg),
    m_column_count(column_count_arg)
  {}
private:
  Ed_column *m_column_array;
  size_t m_column_count; /* TODO: change to point to metadata */
};

extern Atomic_counter<uint32_t> local_connection_thread_count;

#endif // SQL_PREPARE_H
server/private/hostname.h000064400000012453150400263750011522 0ustar00/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef HOSTNAME_INCLUDED
#define HOSTNAME_INCLUDED

#include "my_net.h"
#include "hash_filo.h"

struct Host_errors
{
public:
  Host_errors();
  ~Host_errors();

  void reset();
  void aggregate(const Host_errors *errors);

  /** Number of connect errors. */
  ulong m_connect;

  /** Number of host blocked errors. */
  ulong m_host_blocked;
  /** Number of transient errors from getnameinfo(). */
  ulong m_nameinfo_transient;
  /** Number of permanent errors from getnameinfo(). */
  ulong m_nameinfo_permanent;
  /** Number of errors from is_hostname_valid(). */
  ulong m_format;
  /** Number of transient errors from getaddrinfo(). */
  ulong m_addrinfo_transient;
  /** Number of permanent errors from getaddrinfo(). */
  ulong m_addrinfo_permanent;
  /** Number of errors from Forward-Confirmed reverse DNS checks. */
  ulong m_FCrDNS;
  /** Number of errors from host grants. */
  ulong m_host_acl;
  /** Number of errors from missing auth plugin. */
  ulong m_no_auth_plugin;
  /** Number of errors from auth plugin. */
  ulong m_auth_plugin;
  /** Number of errors from authentication plugins. */
  ulong m_handshake;
  /** Number of errors from proxy user. */
  ulong m_proxy_user;
  /** Number of errors from proxy user acl. */
  ulong m_proxy_user_acl;
  /** Number of errors from authentication. */
  ulong m_authentication;
  /** Number of errors from ssl. */
  ulong m_ssl;
  /** Number of errors from max user connection. */
  ulong m_max_user_connection;
  /** Number of errors from max user connection per hour. */
  ulong m_max_user_connection_per_hour;
  /** Number of errors from the default database. */
  ulong m_default_database;
  /** Number of errors from init_connect. */
  ulong m_init_connect;
  /** Number of errors from the server itself. */
  ulong m_local;

  bool has_error() const
  {
    return ((m_host_blocked != 0)
      || (m_nameinfo_transient != 0)
      || (m_nameinfo_permanent != 0)
      || (m_format != 0)
      || (m_addrinfo_transient != 0)
      || (m_addrinfo_permanent != 0)
      || (m_FCrDNS != 0)
      || (m_host_acl != 0)
      || (m_no_auth_plugin != 0)
      || (m_auth_plugin != 0)
      || (m_handshake != 0)
      || (m_proxy_user != 0)
      || (m_proxy_user_acl != 0)
      || (m_authentication != 0)
      || (m_ssl != 0)
      || (m_max_user_connection != 0)
      || (m_max_user_connection_per_hour != 0)
      || (m_default_database != 0)
      || (m_init_connect != 0)
      || (m_local != 0));
  }

  void sum_connect_errors()
  {
    /* Current (historical) behavior: */
    m_connect= m_handshake;
  }

  void clear_connect_errors()
  {
    m_connect= 0;
  }
};

/** Size of IP address string in the hash cache. */
#define HOST_ENTRY_KEY_SIZE INET6_ADDRSTRLEN

/**
  An entry in the hostname hash table cache.

  Host name cache does two things:
    - caches host names to save DNS look ups;
    - counts errors from IP.

  Host name can be empty (that means DNS look up failed),
  but errors still are counted.
*/
class Host_entry : public hash_filo_element
{
public:
  Host_entry *next()
  { return (Host_entry*) hash_filo_element::next(); }

  /**
    Client IP address. This is the key used with the hash table.

    The client IP address is always expressed in IPv6, even when the
    network IPv6 stack is not present.

    This IP address is never used to connect to a socket.
  */
  char ip_key[HOST_ENTRY_KEY_SIZE];

  /**
    One of the host names for the IP address. May be a zero length string.
  */
  char m_hostname[HOSTNAME_LENGTH + 1];
  /** Length in bytes of @c m_hostname. */
  uint m_hostname_length;
  /** The hostname is validated and used for authorization. */
  bool m_host_validated;
  ulonglong m_first_seen;
  ulonglong m_last_seen;
  ulonglong m_first_error_seen;
  ulonglong m_last_error_seen;
  /** Error statistics. */
  Host_errors m_errors;

  void set_error_timestamps(ulonglong now)
  {
    if (m_first_error_seen == 0)
      m_first_error_seen= now;
    m_last_error_seen= now;
  }
};

/** The size of the host_cache. */
extern ulong host_cache_size;

#define RC_OK 0
#define RC_BLOCKED_HOST 1
int ip_to_hostname(struct sockaddr_storage *ip_storage,
                   const char *ip_string,
                   const char **hostname, uint *connect_errors);

void inc_host_errors(const char *ip_string, Host_errors *errors);
void reset_host_connect_errors(const char *ip_string);
bool hostname_cache_init();
void hostname_cache_free();
void hostname_cache_refresh(void);
uint hostname_cache_size();
void hostname_cache_resize(uint size);
void hostname_cache_lock();
void hostname_cache_unlock();
Host_entry *hostname_cache_first();

#endif /* HOSTNAME_INCLUDED */
server/private/thread_cache.h000064400000013421150400263750012272 0ustar00/*
  Copyright (C) 2020 MariaDB Foundation

  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
*/


/**
  MariaDB thread cache for "one thread per connection" scheduler.

  Thread cache allows to re-use threads (as well as THD objects) for
  subsequent connections.
*/
class Thread_cache
{
  mutable mysql_cond_t COND_thread_cache;
  mutable mysql_cond_t COND_flush_thread_cache;
  mutable mysql_mutex_t LOCK_thread_cache;
  /** Queue of new connection requests. */
  I_List<CONNECT> list;
  /** Number of threads parked in the cache. */
  ulong cached_thread_count;
  /** Number of active flush requests. */
  uint32_t kill_cached_threads;
  /**
    PFS stuff, only used during initialization.
    Unfortunately needs to survive till destruction.
  */
  PSI_cond_key key_COND_thread_cache, key_COND_flush_thread_cache;
  PSI_mutex_key key_LOCK_thread_cache;

public:
  void init()
  {
#ifdef HAVE_PSI_INTERFACE
    PSI_cond_info conds[]=
    {
      { &key_COND_thread_cache, "COND_thread_cache", PSI_FLAG_GLOBAL },
      { &key_COND_flush_thread_cache, "COND_flush_thread_cache",
        PSI_FLAG_GLOBAL }
    };
    PSI_mutex_info mutexes[]=
    {
      { &key_LOCK_thread_cache, "LOCK_thread_cache", PSI_FLAG_GLOBAL }
    };
    mysql_mutex_register("sql", mutexes, array_elements(mutexes));
    mysql_cond_register("sql", conds, array_elements(conds));
#endif
    mysql_mutex_init(key_LOCK_thread_cache, &LOCK_thread_cache,
                     MY_MUTEX_INIT_FAST);
    mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, 0);
    mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, 0);
    list.empty();
    kill_cached_threads= 0;
    cached_thread_count= 0;
  }


  void destroy()
  {
    DBUG_ASSERT(cached_thread_count == 0);
    DBUG_ASSERT(list.is_empty());
    mysql_cond_destroy(&COND_flush_thread_cache);
    mysql_cond_destroy(&COND_thread_cache);
    mysql_mutex_destroy(&LOCK_thread_cache);
  }


  /**
    Flushes thread cache.

    Awakes parked threads and requests them to shutdown.
    Waits until last parked thread leaves the cache.
  */
  void flush()
  {
    mysql_mutex_lock(&LOCK_thread_cache);
    kill_cached_threads++;
    while (cached_thread_count)
    {
      mysql_cond_broadcast(&COND_thread_cache);
      mysql_cond_wait(&COND_flush_thread_cache, &LOCK_thread_cache);
    }
    kill_cached_threads--;
    mysql_mutex_unlock(&LOCK_thread_cache);
  }


  /**
    Flushes thread cache and forbids threads parking in the cache.

    This is a pre-shutdown hook.
  */
  void final_flush()
  {
    kill_cached_threads++;
    flush();
  }


  /**
    Requests parked thread to serve new connection.

    @return
      @retval true connection is enqueued and parked thread is about to serve it
      @retval false thread cache is empty
  */
  bool enqueue(CONNECT *connect)
  {
    mysql_mutex_lock(&LOCK_thread_cache);
    if (cached_thread_count)
    {
      list.push_back(connect);
      cached_thread_count--;
      mysql_mutex_unlock(&LOCK_thread_cache);
      mysql_cond_signal(&COND_thread_cache);
      return true;
    }
    mysql_mutex_unlock(&LOCK_thread_cache);
    return false;
  }


  /**
    Parks thread in the cache.

    Thread execution is suspended until either of the following occurs:
    - thread is requested to serve new connection;
    - thread cache is flushed;
    - THREAD_CACHE_TIMEOUT elapsed.

    @return
      @retval pointer to CONNECT if requested to serve new connection
      @retval 0 if thread cache is flushed or on timeout
  */
  CONNECT *park()
  {
    struct timespec abstime;
    CONNECT *connect;
    bool flushed= false;
    DBUG_ENTER("Thread_cache::park");
    set_timespec(abstime, THREAD_CACHE_TIMEOUT);

    /*
      Delete the instrumentation for the job that just completed,
      before parking this pthread in the cache (blocked on COND_thread_cache).
    */
    PSI_CALL_delete_current_thread();

#ifndef DBUG_OFF
    while (_db_is_pushed_())
      _db_pop_();
#endif

    mysql_mutex_lock(&LOCK_thread_cache);
    if ((connect= list.get()))
      cached_thread_count++;
    else if (cached_thread_count < thread_cache_size && !kill_cached_threads)
    {
      /* Don't kill the thread, just put it in cache for reuse */
      DBUG_PRINT("info", ("Adding thread to cache"));
      cached_thread_count++;
      for (;;)
      {
        int error= mysql_cond_timedwait(&COND_thread_cache, &LOCK_thread_cache,
                                         &abstime);
        flushed= kill_cached_threads;
        if ((connect= list.get()))
          break;
        else if (flushed || error == ETIMEDOUT || error == ETIME)
        {
          /*
            If timeout, end thread.
            If a new thread is requested, we will handle the call, even if we
            got a timeout (as we are already awake and free)
          */
          cached_thread_count--;
          break;
        }
      }
    }
    mysql_mutex_unlock(&LOCK_thread_cache);
    if (flushed)
      mysql_cond_signal(&COND_flush_thread_cache);
    DBUG_RETURN(connect);
  }


  /** Returns the number of parked threads. */
  ulong size() const
  {
    mysql_mutex_lock(&LOCK_thread_cache);
    ulong r= cached_thread_count;
    mysql_mutex_unlock(&LOCK_thread_cache);
    return r;
  }
};

extern Thread_cache thread_cache;
server/private/rpl_tblmap.h000064400000006151150400263750012036 0ustar00/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef TABLE_MAPPING_H
#define TABLE_MAPPING_H

/* Forward declarations */
#ifndef MYSQL_CLIENT
struct TABLE;
#else
class Table_map_log_event;
typedef Table_map_log_event TABLE;
void free_table_map_log_event(TABLE *table);
#endif


/*
  CLASS table_mapping

  RESPONSIBILITIES
    The table mapping is used to map table id's to table pointers

  COLLABORATION
    RELAY_LOG    For mapping table id:s to tables when receiving events.
 */

/*
  Guilhem to Mats:
  in the table_mapping class, the memory is allocated and never freed (until
  destruction). So this is a good candidate for allocating inside a MEM_ROOT:
  it gives the efficient allocation in chunks (like in expand()). So I have
  introduced a MEM_ROOT.

  Note that inheriting from Sql_alloc had no effect: it has effects only when
  "ptr= new table_mapping" is called, and this is never called. And it would
  then allocate from thd->mem_root which is a highly volatile object (reset
  from example after executing each query, see dispatch_command(), it has a
  free_root() at end); as the table_mapping object is supposed to live longer
  than a query, it was dangerous.
  A dedicated MEM_ROOT needs to be used, see below.
*/

#include "hash.h"                               /* HASH */

class table_mapping {

private:
  MEM_ROOT m_mem_root;

public:

  enum enum_error {
      ERR_NO_ERROR = 0,
      ERR_LIMIT_EXCEEDED,
      ERR_MEMORY_ALLOCATION
  };

  table_mapping();
  ~table_mapping();

  TABLE* get_table(ulonglong table_id);

  int       set_table(ulonglong table_id, TABLE* table);
  int       remove_table(ulonglong table_id);
  void      clear_tables();
  ulong     count() const { return m_table_ids.records; }

private:
  /*
    This is a POD (Plain Old Data).  Keep it that way (we apply offsetof() to
    it, which only works for PODs)
  */
  struct entry { 
    ulonglong table_id;
    union {
      TABLE *table;
      entry *next;
    };
  };

  entry *find_entry(ulonglong table_id)
  {
    return (entry *) my_hash_search(&m_table_ids,
                                    (uchar*)&table_id,
                                    sizeof(table_id));
  }
  int expand();

  /*
    Head of the list of free entries; "free" in the sense that it's an
    allocated entry free for use, NOT in the sense that it's freed
    memory.
  */
  entry *m_free;

  /* Correspondance between an id (a number) and a TABLE object */
  HASH m_table_ids;
};

#endif
server/private/sp_cache.h000064400000003775150400263750011460 0ustar00/* -*- C++ -*- */
/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _SP_CACHE_H_
#define _SP_CACHE_H_

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

/*
  Stored procedures/functions cache. This is used as follows:
   * Each thread has its own cache.
   * Each sp_head object is put into its thread cache before it is used, and
     then remains in the cache until deleted.
*/

class sp_head;
class sp_cache;
class Database_qualified_name;

/*
  Cache usage scenarios:
  1. Application-wide init:
    sp_cache_init();

  2. SP execution in thread:
  2.1 While holding sp_head* pointers:
  
    // look up a routine in the cache (no checks if it is up to date or not)
    sp_cache_lookup(); 
    
    sp_cache_insert();
    sp_cache_invalidate();
  
  2.2 When not holding any sp_head* pointers:
    sp_cache_flush_obsolete();
  
  3. Before thread exit:
    sp_cache_clear();
*/

void sp_cache_init();
void sp_cache_end();
void sp_cache_clear(sp_cache **cp);
void sp_cache_insert(sp_cache **cp, sp_head *sp);
sp_head *sp_cache_lookup(sp_cache **cp, const Database_qualified_name *name);
void sp_cache_invalidate();
void sp_cache_flush_obsolete(sp_cache **cp, sp_head **sp);
ulong sp_cache_version();
void sp_cache_enforce_limit(sp_cache *cp, ulong upper_limit_for_elements);

#endif /* _SP_CACHE_H_ */
server/private/waiting_threads.h000064400000010664150400263750013062 0ustar00/* Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef _waiting_threads_h
#define _waiting_threads_h

#include <my_sys.h>

#include <lf.h>

C_MODE_START

typedef struct st_wt_resource_id WT_RESOURCE_ID;
typedef struct st_wt_resource WT_RESOURCE;

typedef struct st_wt_resource_type {
  my_bool (*compare)(const void *a, const void *b);
  const void *(*make_key)(const WT_RESOURCE_ID *id, uint *len); /* not used */
} WT_RESOURCE_TYPE;

struct st_wt_resource_id {
  ulonglong value;
  const WT_RESOURCE_TYPE *type;
};
/* the below differs from sizeof(WT_RESOURCE_ID) by the amount of padding */
#define sizeof_WT_RESOURCE_ID (sizeof(ulonglong)+sizeof(void*))

#define WT_WAIT_STATS  24
#define WT_CYCLE_STATS 32
extern ulonglong wt_wait_table[WT_WAIT_STATS];
extern uint32    wt_wait_stats[WT_WAIT_STATS+1];
extern uint32    wt_cycle_stats[2][WT_CYCLE_STATS+1];
extern uint32    wt_success_stats;

typedef struct st_wt_thd {
  /*
    XXX
    there's no protection (mutex) against concurrent access of the
    dynarray below. it is assumed that a caller will have it anyway
    (not to protect this array but to protect its own - caller's -
    data structures), and we'll get it for free. A caller needs to
    ensure that a blocker won't release a resource before a blocked
    thread starts waiting, which is usually done with a mutex.
    
    If the above assumption is wrong, we'll need to add a mutex here.
  */
  DYNAMIC_ARRAY   my_resources;
  /*
    'waiting_for' is modified under waiting_for->lock, and only by thd itself
    'waiting_for' is read lock-free (using pinning protocol), but a thd object
    can read its own 'waiting_for' without any locks or tricks.
  */
  WT_RESOURCE    *waiting_for;
  LF_PINS        *pins;

  /* pointers to values */
  const ulong *timeout_short;
  const ulong *deadlock_search_depth_short;
  const ulong *timeout_long;
  const ulong *deadlock_search_depth_long;

  /*
    weight relates to the desirability of a transaction being killed if it's
    part of a deadlock. In a deadlock situation transactions with lower weights
    are killed first.

    Examples of using the weight to implement different selection strategies:

    1. Latest
        Keep all weights equal.
    2. Random
        Assign weights at random.
        (variant: modify a weight randomly before every lock request)
    3. Youngest
        Set weight to -NOW()
    4. Minimum locks
        count locks granted in your lock manager, store the value as a weight
    5. Minimum work
        depends on the definition of "work". For example, store the number
        of rows modifies in this transaction (or a length of REDO log for a
        transaction) as a weight.

    It is only statistically relevant and is not protected by any locks.
  */
  ulong volatile weight;
  /*
    'killed' is indirectly protected by waiting_for->lock because
    a killed thread needs to clear its 'waiting_for' and thus needs a lock.
    That is a thread needs an exclusive lock to read 'killed' reliably.
    But other threads may change 'killed' from 0 to 1, a shared
    lock is enough for that.
   */
  my_bool killed;
#ifndef DBUG_OFF
  const char     *name;
#endif
} WT_THD;

#define WT_TIMEOUT              ETIMEDOUT
#define WT_OK                   0
#define WT_DEADLOCK             -1
#define WT_DEPTH_EXCEEDED       -2
#define WT_FREE_TO_GO           -3

void wt_init(void);
void wt_end(void);
void wt_thd_lazy_init(WT_THD *, const ulong *, const ulong *, const ulong *, const ulong *);
void wt_thd_destroy(WT_THD *);
int wt_thd_will_wait_for(WT_THD *, WT_THD *, const WT_RESOURCE_ID *);
int wt_thd_cond_timedwait(WT_THD *, mysql_mutex_t *);
void wt_thd_release(WT_THD *, const WT_RESOURCE_ID *);
#define wt_thd_release_all(THD) wt_thd_release((THD), 0)
my_bool wt_resource_id_memcmp(const void *, const void *);

C_MODE_END

#endif
server/private/sql_insert.h000064400000005133150400263750012064 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_INSERT_INCLUDED
#define SQL_INSERT_INCLUDED

#include "sql_class.h"                          /* enum_duplicates */
#include "sql_list.h"

/* Instead of including sql_lex.h we add this typedef here */
typedef List<Item> List_item;
typedef struct st_copy_info COPY_INFO;

int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
                         List<Item> &fields, List_item *values,
                         List<Item> &update_fields,
                         List<Item> &update_values, enum_duplicates duplic,
                         COND **where, bool select_insert, bool * const cache_results);
bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
                  List<List_item> &values, List<Item> &update_fields,
                  List<Item> &update_values, enum_duplicates flag,
                  bool ignore, select_result* result);
void upgrade_lock_type_for_insert(THD *thd, thr_lock_type *lock_type,
                                  enum_duplicates duplic,
                                  bool is_multi_insert);
int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
                                           TABLE_LIST *table_list);
int vers_insert_history_row(TABLE *table);
int check_duplic_insert_without_overlaps(THD *thd, TABLE *table,
                                         enum_duplicates duplic);
int write_record(THD *thd, TABLE *table, COPY_INFO *info,
                 select_result *returning= NULL);
void kill_delayed_threads(void);
bool binlog_create_table(THD *thd, TABLE *table, bool replace);
bool binlog_drop_table(THD *thd, TABLE *table);

static inline void restore_default_record_for_insert(TABLE *t)
{
  restore_record(t,s->default_values);
  if (t->triggers)
    t->triggers->default_extra_null_bitmap();
}

#ifdef EMBEDDED_LIBRARY
inline void kill_delayed_threads(void) {}
#endif

#endif /* SQL_INSERT_INCLUDED */
server/private/backup.h000064400000003247150400263750011152 0ustar00#ifndef BACKUP_INCLUDED
#define BACKUP_INCLUDED
/* Copyright (c) 2018, 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-1301  USA */

enum backup_stages
{
  BACKUP_START, BACKUP_FLUSH, BACKUP_WAIT_FOR_FLUSH, BACKUP_LOCK_COMMIT,
  BACKUP_END, BACKUP_FINISHED
};

extern TYPELIB backup_stage_names;

struct backup_log_info {
  LEX_CSTRING  query;
  LEX_CUSTRING org_table_id;                         /* Unique id from frm */
  LEX_CSTRING  org_database, org_table;
  LEX_CSTRING  org_storage_engine_name;
  LEX_CSTRING  new_database, new_table;
  LEX_CSTRING  new_storage_engine_name;
  LEX_CUSTRING new_table_id;                         /* Unique id from frm */
  bool org_partitioned;
  bool new_partitioned;
};

void backup_init();
bool run_backup_stage(THD *thd, backup_stages stage);
bool backup_end(THD *thd);
void backup_set_alter_copy_lock(THD *thd, TABLE *altered_table);
bool backup_reset_alter_copy_lock(THD *thd);

bool backup_lock(THD *thd, TABLE_LIST *table);
void backup_unlock(THD *thd);
void backup_log_ddl(const backup_log_info *info);
#endif /* BACKUP_INCLUDED */
server/private/item_create.h000064400000026355150400263750012173 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
   Copyright (c) 2008, 2022, MariaDB

   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 */

/* Functions to create an item. Used by sql/sql_yacc.yy */

#ifndef ITEM_CREATE_H
#define ITEM_CREATE_H

#include "item_func.h" // Cast_target

typedef struct st_udf_func udf_func;

/**
  Public function builder interface.
  The parser (sql/sql_yacc.yy) uses a factory / builder pattern to
  construct an <code>Item</code> object for each function call.
  All the concrete function builders implements this interface,
  either directly or indirectly with some adapter helpers.
  Keeping the function creation separated from the bison grammar allows
  to simplify the parser, and avoid the need to introduce a new token
  for each function, which has undesirable side effects in the grammar.
*/

class Create_func
{
public:
  /**
    The builder create method.
    Given the function name and list or arguments, this method creates
    an <code>Item</code> that represents the function call.
    In case or errors, a NULL item is returned, and an error is reported.
    Note that the <code>thd</code> object may be modified by the builder.
    In particular, the following members/methods can be set/called,
    depending on the function called and the function possible side effects.
    <ul>
      <li><code>thd->lex->binlog_row_based_if_mixed</code></li>
      <li><code>thd->lex->current_context()</code></li>
      <li><code>thd->lex->safe_to_cache_query</code></li>
      <li><code>thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT)</code></li>
      <li><code>thd->lex->uncacheable(UNCACHEABLE_RAND)</code></li>
      <li><code>thd->lex->add_time_zone_tables_to_query_tables(thd)</code></li>
    </ul>
    @param thd The current thread
    @param name The function name
    @param item_list The list of arguments to the function, can be NULL
    @return An item representing the parsed function call, or NULL
  */
  virtual Item *create_func(THD *thd, const LEX_CSTRING *name,
                            List<Item> *item_list) = 0;

protected:
  /** Constructor */
  Create_func() = default;
  /** Destructor */
  virtual ~Create_func() = default;
};


/**
  Adapter for functions that takes exactly zero arguments.
*/

class Create_func_arg0 : public Create_func
{
public:
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    Builder method, with no arguments.
    @param thd The current thread
    @return An item representing the function call
  */
  virtual Item *create_builder(THD *thd) = 0;

protected:
  /** Constructor. */
  Create_func_arg0() = default;
  /** Destructor. */
  virtual ~Create_func_arg0() = default;
};


/**
  Adapter for functions that takes exactly one argument.
*/

class Create_func_arg1 : public Create_func
{
public:
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    Builder method, with one argument.
    @param thd The current thread
    @param arg1 The first argument of the function
    @return An item representing the function call
  */
  virtual Item *create_1_arg(THD *thd, Item *arg1) = 0;

protected:
  /** Constructor. */
  Create_func_arg1() = default;
  /** Destructor. */
  virtual ~Create_func_arg1() = default;
};


/**
  Adapter for functions that takes exactly two arguments.
*/

class Create_func_arg2 : public Create_func
{
public:
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    Builder method, with two arguments.
    @param thd The current thread
    @param arg1 The first argument of the function
    @param arg2 The second argument of the function
    @return An item representing the function call
  */
  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) = 0;

protected:
  /** Constructor. */
  Create_func_arg2() = default;
  /** Destructor. */
  virtual ~Create_func_arg2() = default;
};


/**
  Adapter for functions that takes exactly three arguments.
*/

class Create_func_arg3 : public Create_func
{
public:
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    Builder method, with three arguments.
    @param thd The current thread
    @param arg1 The first argument of the function
    @param arg2 The second argument of the function
    @param arg3 The third argument of the function
    @return An item representing the function call
  */
  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) = 0;

protected:
  /** Constructor. */
  Create_func_arg3() = default;
  /** Destructor. */
  virtual ~Create_func_arg3() = default;
};




/**
  Adapter for native functions with a variable number of arguments.
  The main use of this class is to discard the following calls:
  <code>foo(expr1 AS name1, expr2 AS name2, ...)</code>
  which are syntactically correct (the syntax can refer to a UDF),
  but semantically invalid for native functions.
*/

class Create_native_func : public Create_func
{
public:
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    Builder method, with no arguments.
    @param thd The current thread
    @param name The native function name
    @param item_list The function parameters, none of which are named
    @return An item representing the function call
  */
  virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
                              List<Item> *item_list) = 0;

protected:
  /** Constructor. */
  Create_native_func() = default;
  /** Destructor. */
  virtual ~Create_native_func() = default;
};


/**
  Function builder for qualified functions.
  This builder is used with functions call using a qualified function name
  syntax, as in <code>db.func(expr, expr, ...)</code>.
*/

class Create_qfunc : public Create_func
{
public:
  /**
    The builder create method, for unqualified functions.
    This builder will use the current database for the database name.
    @param thd The current thread
    @param name The function name
    @param item_list The list of arguments to the function, can be NULL
    @return An item representing the parsed function call
  */
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    The builder create method, for qualified functions.
    @param thd The current thread
    @param db The database name
    @param name The function name
    @param use_explicit_name Should the function be represented as 'db.name'?
    @param item_list The list of arguments to the function, can be NULL
    @return An item representing the parsed function call
  */
  virtual Item *create_with_db(THD *thd,
                               const LEX_CSTRING *db,
                               const LEX_CSTRING *name,
                               bool use_explicit_name,
                               List<Item> *item_list) = 0;

protected:
  /** Constructor. */
  Create_qfunc() = default;
  /** Destructor. */
  virtual ~Create_qfunc() = default;
};


/**
  Find the function builder for qualified functions.
  @param thd The current thread
  @return A function builder for qualified functions
*/
extern Create_qfunc * find_qualified_function_builder(THD *thd);


#ifdef HAVE_DLOPEN
/**
  Function builder for User Defined Functions.
*/

class Create_udf_func : public Create_func
{
public:
  Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
    override;

  /**
    The builder create method, for User Defined Functions.
    @param thd The current thread
    @param fct The User Defined Function metadata
    @param item_list The list of arguments to the function, can be NULL
    @return An item representing the parsed function call
  */
  Item *create(THD *thd, udf_func *fct, List<Item> *item_list);

  /** Singleton. */
  static Create_udf_func s_singleton;

protected:
  /** Constructor. */
  Create_udf_func() = default;
  /** Destructor. */
  virtual ~Create_udf_func() = default;
};
#endif


struct Native_func_registry
{
  LEX_CSTRING name;
  Create_func *builder;
};


class Native_functions_hash: public HASH
{
public:
  Native_functions_hash()
  {
    bzero((void*) this, sizeof(*this));
  }
  ~Native_functions_hash()
  {
    /*
      No automatic free because objects of this type
      are expected to be declared statically.
      The code in cleanup() calls my_hash_free() which may not work correctly
      at the very end of mariadbd shutdown.
      The the upper level code should call cleanup() explicitly.

      Unfortunatelly, it's not possible to use DBUG_ASSERT(!records) here,
      because the server terminates using exit() in some cases,
      e.g. in the test main.named_pipe with the "Create named pipe failed"
      error.
    */
  }
  bool init(size_t count);
  bool append(const Native_func_registry array[], size_t count);
  bool remove(const Native_func_registry array[], size_t count);
  bool replace(const Native_func_registry array[], size_t count)
  {
    DBUG_ENTER("Native_functions_hash::replace");
    remove(array, count);
    DBUG_RETURN(append(array, count));
  }
  void cleanup();
  /**
    Find the native function builder associated with a given function name.
    @param thd The current thread
    @param name The native function name
    @return The native function builder associated with the name, or NULL
  */
  Create_func *find(THD *thd, const LEX_CSTRING &name) const;
};

extern MYSQL_PLUGIN_IMPORT Native_functions_hash native_functions_hash;
extern MYSQL_PLUGIN_IMPORT Native_functions_hash native_functions_hash_oracle;

extern const Native_func_registry func_array[];
extern const size_t func_array_length;

int item_create_init();
void item_create_cleanup();

Item *create_func_dyncol_create(THD *thd, List<DYNCALL_CREATE_DEF> &list);
Item *create_func_dyncol_add(THD *thd, Item *str,
                             List<DYNCALL_CREATE_DEF> &list);
Item *create_func_dyncol_delete(THD *thd, Item *str, List<Item> &nums);
Item *create_func_dyncol_get(THD *thd, Item *num, Item *str,
                             const Type_handler *handler,
                             const char *c_len, const char *c_dec,
                             CHARSET_INFO *cs);
Item *create_func_dyncol_json(THD *thd, Item *str);


class Native_func_registry_array
{
  const Native_func_registry *m_elements;
  size_t m_count;
public:
  Native_func_registry_array()
   :m_elements(NULL),
    m_count(0)
  { }
  Native_func_registry_array(const Native_func_registry *elements, size_t count)
   :m_elements(elements),
    m_count(count)
  { }
  const Native_func_registry& element(size_t i) const
  {
    DBUG_ASSERT(i < m_count);
    return m_elements[i];
  }
  const Native_func_registry *elements() const { return m_elements; }
  size_t count() const { return m_count; }
};


#endif
server/private/my_stack_alloc.h000064400000014535150400263750012673 0ustar00/* Copyright 2019 MariaDB corporation AB

   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
*/

#ifndef _my_stack_alloc_h
#define _my_stack_alloc_h

#ifdef _MSC_VER
#include <intrin.h> // For MSVC-specific intrinsics
#else
#include <sys/resource.h>
#endif


/*
  Get the address of the current stack.
  This will fallback to using an estimate for the stack pointer
  in the cases where either the compiler or the architecture is
  not supported.
*/

static inline void *my_get_stack_pointer(void *default_stack)
{
  void *stack_ptr= NULL;

#if defined(__GNUC__) || defined(__clang__) /* GCC and Clang compilers */
#if defined(__i386__) /* Intel x86 (32-bit) */
  __asm__ volatile ("movl %%esp, %0" : "=r" (stack_ptr));
#elif defined(__x86_64__) && defined (__ILP32__) /* Intel x86-64 (64-bit), X32 ABI */
  __asm__ volatile ("movl %%esp, %0" : "=r" (stack_ptr));
#elif defined(__x86_64__) /* Intel x86-64 (64-bit) */
  __asm__ volatile ("movq %%rsp, %0" : "=r" (stack_ptr));
#elif defined(__powerpc__) /* PowerPC (32-bit) */
  __asm__ volatile ("mr %0, 1" : "=r" (stack_ptr)); /* GPR1 is the stack pointer */
#elif defined(__ppc64__) /* PowerPC (64-bit) */
  __asm__ volatile ("mr %0, 1" : "=r" (stack_ptr));
#elif defined(__arm__) /* ARM 32-bit */
  __asm__ volatile ("mov %0, sp" : "=r" (stack_ptr));
#elif defined(__aarch64__) /* ARM 64-bit */
  __asm__ volatile ("mov %0, sp" : "=r" (stack_ptr));
#elif defined(__sparc__) /* SPARC 32-bit */
  __asm__ volatile ("mov %%sp, %0" : "=r" (stack_ptr));
#elif defined(__sparc64__) /* SPARC 64-bit */
  __asm__ volatile ("mov %%sp, %0" : "=r" (stack_ptr));
#elif defined(__s390x__)
  stack_ptr= __builtin_frame_address(0);
#else
  /* Generic fallback for unsupported architectures in GCC/Clang */
  stack_ptr= default_stack ? default_stack : (void*) &stack_ptr;
#endif
#elif defined(_MSC_VER) /* MSVC compiler (Intel only) */
#if defined(_M_IX86) /* Intel x86 (32-bit) */
  __asm { mov stack_ptr, esp }
#elif defined(_M_X64) /* Intel x86-64 (64-bit) */
  /* rsp can’t be accessed directly in MSVC x64 */
  stack_ptr= _AddressOfReturnAddress();
#else
  /* Generic fallback for unsupported architectures in MSVC */
  stack_ptr= default_stack ? default_stack : (void*) &stack_ptr;
#endif
#else
  /* Generic fallback for unsupported compilers */
  stack_ptr= default_stack ? default_stack : (void*) &stack_ptr;
#endif
  return stack_ptr;
}


/*
  Do allocation through alloca if there is enough stack available.
  If not, use my_malloc() instead.

  The idea is that to be able to alloc as much as possible through the
  stack.  To ensure this, we have two different limits, on for big
  blocks and one for small blocks.  This will enable us to continue to
  do allocation for small blocks even when there is less stack space
  available.
  This is for example used by Aria when traversing the b-tree and the code
  needs to allocate one b-tree page and a few keys for each recursion. Even
  if there is not space to allocate the b-tree pages on stack we can still
  continue to allocate the keys.
*/

/*
  Default suggested allocations
*/

/* Allocate big blocks as long as there is this much left */
#define STACK_ALLOC_BIG_BLOCK 1024*64

/* Allocate small blocks as long as there is this much left */
#define STACK_ALLOC_SMALL_BLOCK 1024*32

/* Allocate small blocks as long as the block size is not bigger than */
#define STACK_ALLOC_SMALL_BLOCK_SIZE 4096

/*
  Allocate a block on stack or through malloc.
  The 'must_be_freed' variable will be set to 1 if malloc was called.
  'must_be_freed' must be a variable on the stack!
*/

#ifdef HAVE_ALLOCA
#define alloc_on_stack(stack_end, res, must_be_freed, size)            \
do                                                                     \
{                                                                      \
  size_t alloc_size= (size);                                           \
  void *stack= my_get_stack_pointer(0);                                \
  size_t stack_left= available_stack_size(stack, (stack_end));         \
  if (stack_left > alloc_size + STACK_ALLOC_SMALL_BLOCK &&             \
      (stack_left > alloc_size + STACK_ALLOC_BIG_BLOCK ||              \
       (STACK_ALLOC_SMALL_BLOCK_SIZE >= alloc_size)))                  \
  {                                                                    \
    (must_be_freed)= 0;                                                \
    (res)= alloca(size);                                               \
  }                                                                    \
  else                                                                 \
  {                                                                    \
    (must_be_freed)= 1;                                                \
    (res)= my_malloc(PSI_INSTRUMENT_ME, size, MYF(MY_THREAD_SPECIFIC | MY_WME));          \
  }                                                                    \
} while(0)
#else
#define alloc_on_stack(stack_end, res, must_be_freed, size)            \
  do {                                                                 \
    (must_be_freed)= 1;                                                \
    (res)= my_malloc(PSI_INSTRUMENT_ME, size, MYF(MY_THREAD_SPECIFIC | MY_WME));          \
  } while(0)
#endif /* HAVE_ALLOCA */


/*
  Free memory allocated by stack_alloc
*/

static inline void stack_alloc_free(void *res, my_bool must_be_freed)
{
  if (must_be_freed)
    my_free(res);
}
#endif /* _my_stack_alloc_h */


/* Get start and end of stack */

/*
  This is used in the case when we not know the exact stack start
  and have to estimate stack start with get_stack_pointer()
*/
#define MY_STACK_SAFE_MARGIN 8192

extern void my_get_stack_bounds(void **stack_start, void **stack_end,
                                void *fallback_stack_start,
                                size_t fallback_stack_size);
server/private/session_tracker.h000064400000033703150400263750013103 0ustar00#ifndef SESSION_TRACKER_INCLUDED
#define SESSION_TRACKER_INCLUDED

/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2016, 2017, 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-1301  USA */

#include "m_string.h"
#include "thr_lock.h"
#include "sql_hset.h"

#ifndef EMBEDDED_LIBRARY
/* forward declarations */
class THD;
class set_var;
class String;
class user_var_entry;


enum enum_session_tracker
{
  SESSION_SYSVARS_TRACKER,                       /* Session system variables */
  CURRENT_SCHEMA_TRACKER,                        /* Current schema */
  SESSION_STATE_CHANGE_TRACKER,
  TRANSACTION_INFO_TRACKER,                      /* Transaction state */
#ifdef USER_VAR_TRACKING
  USER_VARIABLES_TRACKER,
#endif // USER_VAR_TRACKING
  SESSION_TRACKER_END                            /* must be the last */
};

/**
  State_tracker

  An abstract class that defines the interface for any of the server's
  'session state change tracker'. A tracker, however, is a sub- class of
  this class which takes care of tracking the change in value of a part-
  icular session state type and thus defines various methods listed in this
  interface. The change information is later serialized and transmitted to
  the client through protocol's OK packet.

  Tracker system variables :-
  A tracker is normally mapped to a system variable. So in order to enable,
  disable or modify the sub-entities of a tracker, the user needs to modify
  the respective system variable either through SET command or via command
  line option. As required in system variable handling, this interface also
  includes two functions to help in the verification of the supplied value
  (ON_UPDATE) of the tracker system variable, namely - update().
*/

class State_tracker
{
protected:
  /**
    Is tracking enabled for a particular session state type ?

    @note: it is a cache of the corresponding thd->variables.session_track_xxx
    variable
  */
  bool m_enabled;

  void set_changed(THD *thd);

private:
  /** Has the session state type changed ? */
  bool m_changed;

public:
  virtual ~State_tracker() = default;

  /** Getters */
  bool is_enabled() const
  { return m_enabled; }

  bool is_changed() const
  { return m_changed; }

  void reset_changed() { m_changed= false; }

  /**
    Called by THD::init() when new connection is being created

    We may inherit m_changed from previous connection served by this THD if
    connection was broken or client didn't have session tracking capability.
    Thus we have to reset it here.
  */
  virtual bool enable(THD *thd)
  {
    reset_changed();
    return update(thd, 0);
  }

  /** To be invoked when the tracker's system variable is updated (ON_UPDATE).*/
  virtual bool update(THD *thd, set_var *var)= 0;

  /** Store changed data into the given buffer. */
  virtual bool store(THD *thd, String *buf)= 0;

  /** Mark the entity as changed. */
  void mark_as_changed(THD *thd) { if (is_enabled()) set_changed(thd); }
};


/**
  Session_sysvars_tracker

  This is a tracker class that enables & manages the tracking of session
  system variables. It internally maintains a hash of user supplied variable
  references and a boolean field to store if the variable was changed by the
  last statement.
*/

class Session_sysvars_tracker: public State_tracker
{
  struct sysvar_node_st {
    sys_var *m_svar;
    bool *test_load;
    bool m_changed;
  };

  class vars_list
  {
    /**
      Registered system variables. (@@session_track_system_variables)
      A hash to store the name of all the system variables specified by the
      user.
    */
    HASH m_registered_sysvars;
    /**
      If TRUE then we want to check all session variable.
    */
    bool track_all;
    void init()
    {
      my_hash_init(PSI_INSTRUMENT_ME, &m_registered_sysvars, &my_charset_bin,
                   0, 0, 0, sysvars_get_key, my_free,
                   HASH_UNIQUE |
                       (mysqld_server_initialized ? HASH_THREAD_SPECIFIC : 0));
    }
    void free_hash()
    {
      DBUG_ASSERT(my_hash_inited(&m_registered_sysvars));
      my_hash_free(&m_registered_sysvars);
    }

    sysvar_node_st *search(const sys_var *svar)
    {
      return reinterpret_cast<sysvar_node_st*>(
               my_hash_search(&m_registered_sysvars,
                             reinterpret_cast<const uchar*>(&svar),
                             sizeof(sys_var*)));
    }

    sysvar_node_st *at(ulong i)
    {
      DBUG_ASSERT(i < m_registered_sysvars.records);
      return reinterpret_cast<sysvar_node_st*>(
               my_hash_element(&m_registered_sysvars, i));
    }
  public:
    vars_list(): track_all(false) { init(); }
    ~vars_list() { if (my_hash_inited(&m_registered_sysvars)) free_hash(); }
    void deinit() { free_hash(); }

    sysvar_node_st *insert_or_search(const sys_var *svar)
    {
      sysvar_node_st *res= search(svar);
      if (!res)
      {
        if (track_all)
        {
          insert(svar);
          return search(svar);
        }
      }
      return res;
    }

    bool insert(const sys_var *svar);
    void reinit();
    void reset();
    inline bool is_enabled()
    {
      return track_all || m_registered_sysvars.records;
    }
    void copy(vars_list* from, THD *thd);
    bool parse_var_list(THD *thd, LEX_STRING var_list, bool throw_error,
                        CHARSET_INFO *char_set);
    bool construct_var_list(char *buf, size_t buf_len);
    bool store(THD *thd, String *buf);
  };
  /**
    Two objects of vars_list type are maintained to manage
    various operations.
  */
  vars_list orig_list;
  bool m_parsed;

public:
  void init(THD *thd);
  void deinit(THD *thd);
  bool enable(THD *thd) override;
  bool update(THD *thd, set_var *var) override;
  bool store(THD *thd, String *buf) override;
  void mark_as_changed(THD *thd, const sys_var *var);
  void deinit() { orig_list.deinit(); }
  /* callback */
  static const uchar *sysvars_get_key(const void *entry, size_t *length,
                                      my_bool);

  friend bool sysvartrack_global_update(THD *thd, char *str, size_t len);
};


bool sysvartrack_validate_value(THD *thd, const char *str, size_t len);
bool sysvartrack_global_update(THD *thd, char *str, size_t len);


/**
  Current_schema_tracker,

  This is a tracker class that enables & manages the tracking of current
  schema for a particular connection.
*/

class Current_schema_tracker: public State_tracker
{
public:
  bool update(THD *thd, set_var *var) override;
  bool store(THD *thd, String *buf) override;
};


/*
  Session_state_change_tracker

  This is a boolean tracker class that will monitor any change that contributes
  to a session state change.
  Attributes that contribute to session state change include:
     - Successful change to System variables
     - User defined variables assignments
     - temporary tables created, altered or deleted
     - prepared statements added or removed
     - change in current database
     - change of current role
*/

class Session_state_change_tracker: public State_tracker
{
public:
  bool update(THD *thd, set_var *var) override;
  bool store(THD *thd, String *buf) override;
};


/*
  Transaction_state_tracker
*/

/**
  Transaction state (no transaction, transaction active, work attached, etc.)
*/
enum enum_tx_state {
  TX_EMPTY        =   0,  ///< "none of the below"
  TX_EXPLICIT     =   1,  ///< an explicit transaction is active
  TX_IMPLICIT     =   2,  ///< an implicit transaction is active
  TX_READ_TRX     =   4,  ///<     transactional reads  were done
  TX_READ_UNSAFE  =   8,  ///< non-transaction   reads  were done
  TX_WRITE_TRX    =  16,  ///<     transactional writes were done
  TX_WRITE_UNSAFE =  32,  ///< non-transactional writes were done
  TX_STMT_UNSAFE  =  64,  ///< "unsafe" (non-deterministic like UUID()) stmts
  TX_RESULT_SET   = 128,  ///< result set was sent
  TX_WITH_SNAPSHOT= 256,  ///< WITH CONSISTENT SNAPSHOT was used
  TX_LOCKED_TABLES= 512   ///< LOCK TABLES is active
};


/**
  Transaction access mode
*/
enum enum_tx_read_flags {
  TX_READ_INHERIT =   0,  ///< not explicitly set, inherit session.tx_read_only
  TX_READ_ONLY    =   1,  ///< START TRANSACTION READ ONLY,  or tx_read_only=1
  TX_READ_WRITE   =   2,  ///< START TRANSACTION READ WRITE, or tx_read_only=0
};


/**
  Transaction isolation level
*/
enum enum_tx_isol_level {
  TX_ISOL_INHERIT     = 0, ///< not explicitly set, inherit session.tx_isolation
  TX_ISOL_UNCOMMITTED = 1,
  TX_ISOL_COMMITTED   = 2,
  TX_ISOL_REPEATABLE  = 3,
  TX_ISOL_SERIALIZABLE= 4
};


/**
  Transaction tracking level
*/
enum enum_session_track_transaction_info {
  TX_TRACK_NONE      = 0,  ///< do not send tracker items on transaction info
  TX_TRACK_STATE     = 1,  ///< track transaction status
  TX_TRACK_CHISTICS  = 2   ///< track status and characteristics
};


/**
  This is a tracker class that enables & manages the tracking of
  current transaction info for a particular connection.
*/

class Transaction_state_tracker : public State_tracker
{
  /** Helper function: turn table info into table access flag */
  enum_tx_state calc_trx_state(THD *thd, thr_lock_type l, bool has_trx);
public:

  bool enable(THD *thd) override
  {
    m_enabled= false;
    tx_changed= TX_CHG_NONE;
    tx_curr_state= TX_EMPTY;
    tx_reported_state= TX_EMPTY;
    tx_read_flags= TX_READ_INHERIT;
    tx_isol_level= TX_ISOL_INHERIT;
    return State_tracker::enable(thd);
  }

  bool update(THD *thd, set_var *var) override;
  bool store(THD *thd, String *buf) override;

  /** Change transaction characteristics */
  void set_read_flags(THD *thd, enum enum_tx_read_flags flags);
  void set_isol_level(THD *thd, enum enum_tx_isol_level level);

  /** Change transaction state */
  void clear_trx_state(THD *thd, uint clear);
  void add_trx_state(THD *thd, uint add);
  void inline add_trx_state(THD *thd, thr_lock_type l, bool has_trx)
  {
    add_trx_state(thd, calc_trx_state(thd, l, has_trx));
  }
  void add_trx_state_from_thd(THD *thd);
  void end_trx(THD *thd);


private:
  enum enum_tx_changed {
    TX_CHG_NONE     = 0,  ///< no changes from previous stmt
    TX_CHG_STATE    = 1,  ///< state has changed from previous stmt
    TX_CHG_CHISTICS = 2   ///< characteristics have changed from previous stmt
  };

  /** any trackable changes caused by this statement? */
  uint                     tx_changed;

  /** transaction state */
  uint                     tx_curr_state,  tx_reported_state;

  /** r/w or r/o set? session default? */
  enum enum_tx_read_flags  tx_read_flags;

  /**  isolation level */
  enum enum_tx_isol_level  tx_isol_level;

  inline void update_change_flags(THD *thd)
  {
    tx_changed &= uint(~TX_CHG_STATE);
    tx_changed |= (tx_curr_state != tx_reported_state) ? TX_CHG_STATE : 0;
    if (tx_changed != TX_CHG_NONE)
      set_changed(thd);
  }
};

#define TRANSACT_TRACKER(X) \
 do { if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) \
        thd->session_tracker.transaction_info.X; } while(0)


/**
  User_variables_tracker

  This is a tracker class that enables & manages the tracking of user variables.
*/

#ifdef USER_VAR_TRACKING
class User_variables_tracker: public State_tracker
{
  Hash_set<const user_var_entry> m_changed_user_variables;
public:
  User_variables_tracker():
    m_changed_user_variables(PSI_INSTRUMENT_ME, &my_charset_bin, 0, 0,
                             sizeof(const user_var_entry*), 0, 0, HASH_UNIQUE |
                             mysqld_server_initialized ? HASH_THREAD_SPECIFIC : 0) {}
  bool update(THD *thd, set_var *var);
  bool store(THD *thd, String *buf);
  void mark_as_changed(THD *thd, const user_var_entry *var)
  {
    if (is_enabled())
    {
      m_changed_user_variables.insert(var);
      set_changed(thd);
    }
  }
  void deinit() { m_changed_user_variables.~Hash_set(); }
};
#endif // USER_VAR_TRACKING


/**
  Session_tracker

  This class holds an object each for all tracker classes and provides
  methods necessary for systematic detection and generation of session
  state change information.
*/

class Session_tracker
{
  State_tracker *m_trackers[SESSION_TRACKER_END];

  /* The following two functions are private to disable copying. */
  Session_tracker(Session_tracker const &other)
  {
    DBUG_ASSERT(FALSE);
  }
  Session_tracker& operator= (Session_tracker const &rhs)
  {
    DBUG_ASSERT(FALSE);
    return *this;
  }

public:
  Current_schema_tracker current_schema;
  Session_state_change_tracker state_change;
  Transaction_state_tracker transaction_info;
  Session_sysvars_tracker sysvars;
#ifdef USER_VAR_TRACKING
  User_variables_tracker user_variables;
#endif // USER_VAR_TRACKING

  Session_tracker()
  {
    m_trackers[SESSION_SYSVARS_TRACKER]= &sysvars;
    m_trackers[CURRENT_SCHEMA_TRACKER]= &current_schema;
    m_trackers[SESSION_STATE_CHANGE_TRACKER]= &state_change;
    m_trackers[TRANSACTION_INFO_TRACKER]= &transaction_info;
#ifdef USER_VAR_TRACKING
    m_trackers[USER_VARIABLES_TRACKER]= &user_variables;
#endif // USER_VAR_TRACKING
  }

  void enable(THD *thd)
  {
    for (int i= 0; i < SESSION_TRACKER_END; i++)
      m_trackers[i]->enable(thd);
  }

  void store(THD *thd, String *main_buf);
};


int session_tracker_init();
#else

#define TRANSACT_TRACKER(X) do{}while(0)

class Session_tracker
{
  class Dummy_tracker
  {
  public:
    void mark_as_changed(THD *thd) {}
    void mark_as_changed(THD *thd, const sys_var *var) {}
  };
public:
  Dummy_tracker current_schema;
  Dummy_tracker state_change;
  Dummy_tracker sysvars;
};

#endif //EMBEDDED_LIBRARY

#endif /* SESSION_TRACKER_INCLUDED */
server/private/sql_i_s.h000064400000020050150400263750011325 0ustar00#ifndef SQL_I_S_INCLUDED
#define SQL_I_S_INCLUDED
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
   Copyright (c) 2009, 2019, MariaDB

   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 "sql_const.h"              // MAX_FIELD_VARCHARLENGTH
#include "sql_basic_types.h"        // enum_nullability
#include "sql_string.h"             // strlen, MY_CS_NAME_SIZE
#include "lex_string.h"             // LEX_CSTRING
#include "mysql_com.h"              // enum_field_types
#include "my_time.h"                // TIME_SECOND_PART_DIGITS
#include "sql_type.h"               // Type_handler_xxx

struct TABLE_LIST;
struct TABLE;
typedef class Item COND;

#ifdef MYSQL_CLIENT
#error MYSQL_CLIENT must not be defined
#endif // MYSQL_CLIENT


bool schema_table_store_record(THD *thd, TABLE *table);
COND *make_cond_for_info_schema(THD *thd, COND *cond, TABLE_LIST *table);


enum enum_show_open_table
{
  SKIP_OPEN_TABLE= 0U,              // do not open table
  OPEN_FRM_ONLY=   1U,              // open FRM file only
  OPEN_FULL_TABLE= 2U               // open FRM,MYD, MYI files
};


namespace Show {
class Type
{
  /**
     This denotes data type for the column. For the most part, there seems to
     be one entry in the enum for each SQL data type, although there seem to
     be a number of additional entries in the enum.
  */
  const Type_handler *m_type_handler;
  /**
     For string-type columns, this is the maximum number of
     characters. Otherwise, it is the 'display-length' for the column.
  */
  uint m_char_length;
  uint m_unsigned_flag;
  const Typelib *m_typelib;
public:
  Type(const Type_handler *th, uint length, uint unsigned_flag,
       const Typelib *typelib= NULL)
   :m_type_handler(th), m_char_length(length), m_unsigned_flag(unsigned_flag),
    m_typelib(typelib)
  { }
  const Type_handler *type_handler() const { return m_type_handler; }
  uint char_length()      const { return m_char_length; }
  decimal_digits_t decimal_precision() const
  { return (decimal_digits_t) ((m_char_length / 100) % 100); }
  decimal_digits_t decimal_scale() const
  { return (decimal_digits_t) (m_char_length % 10); }
  uint fsp() const
  {
    DBUG_ASSERT(m_char_length <= TIME_SECOND_PART_DIGITS);
    return m_char_length;
  }
  uint unsigned_flag()    const { return m_unsigned_flag; }
  const Typelib *typelib() const { return m_typelib; }
};
} // namespace Show



class ST_FIELD_INFO: public Show::Type
{
protected:
  LEX_CSTRING m_name;                 // I_S column name
  enum_nullability m_nullability;     // NULLABLE or NOT NULL
  LEX_CSTRING m_old_name;             // SHOW column name
  enum_show_open_table m_open_method;
public:
  ST_FIELD_INFO(const LEX_CSTRING &name, const Type &type,
                enum_nullability nullability,
                LEX_CSTRING &old_name,
                enum_show_open_table open_method)
   :Type(type), m_name(name),
    m_nullability(nullability),
    m_old_name(old_name),
    m_open_method(open_method)
  { }
  ST_FIELD_INFO(const char *name, const Type &type,
                enum_nullability nullability,
                const char *old_name,
                enum_show_open_table open_method)
   :Type(type),
    m_nullability(nullability),
    m_open_method(open_method)
  {
    m_name.str= name;
    m_name.length= safe_strlen(name);
    m_old_name.str= old_name;
    m_old_name.length= safe_strlen(old_name);
  }
  const LEX_CSTRING &name() const { return m_name; }
  bool nullable() const { return m_nullability == NULLABLE; }
  const LEX_CSTRING &old_name() const { return m_old_name; }
  enum_show_open_table open_method() const { return  m_open_method; }
  bool end_marker() const { return m_name.str == NULL; }
};


namespace Show
{


class Enum: public Type
{
public:
  Enum(const Typelib *typelib) :Type(&type_handler_enum, 0, false, typelib) { }
};


class Blob: public Type
{
public:
  Blob(uint length) :Type(&type_handler_blob, length, false) { }
};


class Varchar: public Type
{
public:
  Varchar(uint length) :Type(&type_handler_varchar, length, false)
  {
    DBUG_ASSERT(length * 3 <= MAX_FIELD_VARCHARLENGTH);
  }
};


class Longtext: public Type
{
public:
  Longtext(uint length) :Type(&type_handler_varchar, length, false) { }
};


class Yes_or_empty: public Varchar
{
public:
  Yes_or_empty(): Varchar(3) { }
};


class Catalog: public Varchar
{
public:
  Catalog(): Varchar(FN_REFLEN) { }
};


class Name: public Varchar
{
public:
  Name(): Varchar(NAME_CHAR_LEN) { }
};


class Definer: public Varchar
{
public:
  Definer(): Varchar(DEFINER_CHAR_LENGTH) { }
};


class Userhost: public Varchar
{
public:
  Userhost(): Varchar(USERNAME_CHAR_LENGTH + HOSTNAME_LENGTH + 2) { }
};


class CSName: public Varchar
{
public:
  CSName(): Varchar(MY_CS_NAME_SIZE) { }
};


class SQLMode: public Varchar
{
public:
  SQLMode(): Varchar(32*256) { }
};


class Datetime: public Type
{
public:
  Datetime(uint dec) :Type(&type_handler_datetime2, dec, false) { }
};


class Decimal: public Type
{
public:
  Decimal(uint length) :Type(&type_handler_newdecimal, length, false) { }
};


class ULonglong: public Type
{
public:
  ULonglong(uint length) :Type(&type_handler_ulonglong, length, true) { }
  ULonglong() :ULonglong(MY_INT64_NUM_DECIMAL_DIGITS) { }
};


class ULong: public Type
{
public:
  ULong(uint length) :Type(&type_handler_ulong, length, true) { }
  ULong() :ULong(MY_INT32_NUM_DECIMAL_DIGITS) { }
};


class SLonglong: public Type
{
public:
  SLonglong(uint length) :Type(&type_handler_slonglong, length, false) { }
  SLonglong() :SLonglong(MY_INT64_NUM_DECIMAL_DIGITS) { }
};


class SLong: public Type
{
public:
  SLong(uint length) :Type(&type_handler_slong, length, false) { }
  SLong() :SLong(MY_INT32_NUM_DECIMAL_DIGITS) { }
};


class SShort: public Type
{
public:
  SShort(uint length) :Type(&type_handler_sshort, length, false) { }
};


class STiny: public Type
{
public:
  STiny(uint length) :Type(&type_handler_stiny, length, false) { }
};


class Double: public Type
{
public:
  Double(uint length) :Type(&type_handler_double, length, false) { }
};


class Float: public Type
{
public:
  Float(uint length) :Type(&type_handler_float, length, false) { }
};



class Column: public ST_FIELD_INFO
{
public:
  Column(const char *name, const Type &type,
         enum_nullability nullability,
         const char *old_name,
         enum_show_open_table open_method= SKIP_OPEN_TABLE)
   :ST_FIELD_INFO(name, type, nullability,
                  old_name, open_method)
  { }
  Column(const char *name, const Type &type,
         enum_nullability nullability,
         enum_show_open_table open_method= SKIP_OPEN_TABLE)
   :ST_FIELD_INFO(name, type, nullability,
                  NullS, open_method)
  { }
};


// End marker
class CEnd: public Column
{
public:
  CEnd() :Column(NullS, Varchar(0), NOT_NULL, NullS, SKIP_OPEN_TABLE) { }
};


} // namespace Show


struct TABLE_LIST;
typedef class Item COND;

typedef struct st_schema_table
{
  const char *table_name;
  ST_FIELD_INFO *fields_info;
  /* for FLUSH table_name */
  int (*reset_table) ();
  /* Fill table with data */
  int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond);
  /* Handle fileds for old SHOW */
  int (*old_format) (THD *thd, struct st_schema_table *schema_table);
  int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table,
                        bool res, const LEX_CSTRING *db_name,
                        const LEX_CSTRING *table_name);
  int idx_field1, idx_field2; 
  bool hidden;
  uint i_s_requested_object;  /* the object we need to open(TABLE | VIEW) */
} ST_SCHEMA_TABLE;


#endif // SQL_I_S_INCLUDED
server/private/item_geofunc.h000064400000113770150400263750012354 0ustar00#ifndef ITEM_GEOFUNC_INCLUDED
#define ITEM_GEOFUNC_INCLUDED

/* Copyright (c) 2000, 2016 Oracle and/or its affiliates.
   Copyright (C) 2011, 2021, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


/* This file defines all spatial functions */

#ifdef HAVE_SPATIAL

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_type_geom.h"
#include "item.h"
#include "gstream.h"
#include "spatial.h"
#include "gcalc_slicescan.h"
#include "gcalc_tools.h"

class Item_geometry_func: public Item_str_func
{
public:
  Item_geometry_func(THD *thd): Item_str_func(thd) {}
  Item_geometry_func(THD *thd, Item *a): Item_str_func(thd, a) {}
  Item_geometry_func(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  Item_geometry_func(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c) {}
  Item_geometry_func(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
  bool fix_length_and_dec() override;
  const Type_handler *type_handler() const override
  { return &type_handler_geometry; }
};


/*
  Functions returning REAL measurements of a single GEOMETRY argument
*/
class Item_real_func_args_geometry: public Item_real_func
{
protected:
  String value;
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count == 1);
    return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
                                                            args[0]);
  }
public:
  Item_real_func_args_geometry(THD *thd, Item *a)
   :Item_real_func(thd, a) {}
};


/*
  Functions returning INT measurements of a single GEOMETRY argument
*/
class Item_long_func_args_geometry: public Item_long_func
{
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count == 1);
    return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
                                                            args[0]);
  }
protected:
  String value;
public:
  Item_long_func_args_geometry(THD *thd, Item *a)
   :Item_long_func(thd, a) {}
};


/*
  Functions returning BOOL measurements of a single GEOMETRY argument
*/
class Item_bool_func_args_geometry: public Item_bool_func
{
protected:
  String value;
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count == 1);
    return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
                                                            args[0]);
  }
public:
  Item_bool_func_args_geometry(THD *thd, Item *a)
   :Item_bool_func(thd, a) {}
};


/*
  Functions returning ASCII string measurements of a single GEOMETRY argument
*/
class Item_str_ascii_func_args_geometry: public Item_str_ascii_func
{
protected:
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 1);
    return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
                                                            args[0]);
  }
public:
  Item_str_ascii_func_args_geometry(THD *thd, Item *a)
   :Item_str_ascii_func(thd, a) {}
  Item_str_ascii_func_args_geometry(THD *thd, Item *a, Item *b)
   :Item_str_ascii_func(thd, a, b) {}
  Item_str_ascii_func_args_geometry(THD *thd, Item *a, Item *b, Item *c)
   :Item_str_ascii_func(thd, a, b, c) {}
};


/*
  Functions returning binary string measurements of a single GEOMETRY argument
*/
class Item_binary_func_args_geometry: public Item_str_func
{
protected:
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 1);
    return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
                                                            args[0]);
  }
public:
  Item_binary_func_args_geometry(THD *thd, Item *a)
   :Item_str_func(thd, a) {}
};


/*
  Functions returning GEOMETRY measurements of a single GEOEMETRY argument
*/
class Item_geometry_func_args_geometry: public Item_geometry_func
{
protected:
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 1);
    return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
                                                            args[0]);
  }
public:
  Item_geometry_func_args_geometry(THD *thd, Item *a)
   :Item_geometry_func(thd, a) {}
  Item_geometry_func_args_geometry(THD *thd, Item *a, Item *b)
   :Item_geometry_func(thd, a, b) {}
};


/*
  Functions returning REAL result relationships between two GEOMETRY arguments
*/
class Item_real_func_args_geometry_geometry: public Item_real_func
{
protected:
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 2);
    return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
                                                             args, 0, 2);
  }
public:
  Item_real_func_args_geometry_geometry(THD *thd, Item *a, Item *b)
   :Item_real_func(thd, a, b) {}
};


/*
  Functions returning BOOL result relationships between two GEOMETRY arguments
*/
class Item_bool_func_args_geometry_geometry: public Item_bool_func
{
protected:
  String value;
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 2);
    return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
                                                             args, 0, 2);
  }
public:
  Item_bool_func_args_geometry_geometry(THD *thd, Item *a, Item *b, Item *c)
   :Item_bool_func(thd, a, b, c) {}
};


class Item_func_geometry_from_text: public Item_geometry_func
{
  bool check_arguments() const override
  {
    return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
           check_argument_types_can_return_int(1, MY_MIN(2, arg_count));
  }
public:
  Item_func_geometry_from_text(THD *thd, Item *a): Item_geometry_func(thd, a) {}
  Item_func_geometry_from_text(THD *thd, Item *a, Item *srid):
    Item_geometry_func(thd, a, srid) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_geometryfromtext") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_geometry_from_text>(thd, this); }
};

class Item_func_geometry_from_wkb: public Item_geometry_func
{
  bool check_arguments() const override
  {
    return
      Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(), args[0]) ||
      check_argument_types_can_return_int(1, MY_MIN(2, arg_count));
  }
public:
  Item_func_geometry_from_wkb(THD *thd, Item *a): Item_geometry_func(thd, a) {}
  Item_func_geometry_from_wkb(THD *thd, Item *a, Item *srid):
    Item_geometry_func(thd, a, srid) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_geometryfromwkb") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_geometry_from_wkb>(thd, this); }
};


class Item_func_geometry_from_json: public Item_geometry_func
{
  String tmp_js;
  bool check_arguments() const override
  {
    // TODO: check with Alexey, for better args[1] and args[2] type control
    return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
           check_argument_types_traditional_scalar(1, MY_MIN(3, arg_count));
  }
public:
  Item_func_geometry_from_json(THD *thd, Item *js): Item_geometry_func(thd, js) {}
  Item_func_geometry_from_json(THD *thd, Item *js, Item *opt):
    Item_geometry_func(thd, js, opt) {}
  Item_func_geometry_from_json(THD *thd, Item *js, Item *opt, Item *srid):
    Item_geometry_func(thd, js, opt, srid) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_geomfromgeojson") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_geometry_from_json>(thd, this); }
};


class Item_func_as_wkt: public Item_str_ascii_func_args_geometry
{
public:
  Item_func_as_wkt(THD *thd, Item *a)
   :Item_str_ascii_func_args_geometry(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_astext") };
    return name;
  }
  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_as_wkt>(thd, this); }
};

class Item_func_as_wkb: public Item_binary_func_args_geometry
{
public:
  Item_func_as_wkb(THD *thd, Item *a)
   :Item_binary_func_args_geometry(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_aswkb") };
    return name;
  }
  String *val_str(String *) override;
  const Type_handler *type_handler() const override
  { return &type_handler_long_blob; }
  bool fix_length_and_dec() override
  {
    collation.set(&my_charset_bin);
    decimals=0;
    max_length= (uint32) UINT_MAX32;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_as_wkb>(thd, this); }
};


class Item_func_as_geojson: public Item_str_ascii_func_args_geometry
{
  bool check_arguments() const override
  {
    // TODO: check with Alexey, for better args[1] and args[2] type control
    return Item_str_ascii_func_args_geometry::check_arguments() ||
           check_argument_types_traditional_scalar(1, MY_MIN(3, arg_count));
  }
public:
  Item_func_as_geojson(THD *thd, Item *js)
   :Item_str_ascii_func_args_geometry(thd, js) {}
  Item_func_as_geojson(THD *thd, Item *js, Item *max_dec_digits)
   :Item_str_ascii_func_args_geometry(thd, js, max_dec_digits) {}
  Item_func_as_geojson(THD *thd, Item *js, Item *max_dec_digits, Item *opt)
   :Item_str_ascii_func_args_geometry(thd, js, max_dec_digits, opt) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_asgeojson") };
    return name;
  }
  bool fix_length_and_dec() override;
  String *val_str_ascii(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_as_geojson>(thd, this); }
};


class Item_func_geometry_type: public Item_str_ascii_func_args_geometry
{
public:
  Item_func_geometry_type(THD *thd, Item *a)
   :Item_str_ascii_func_args_geometry(thd, a) {}
  String *val_str_ascii(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_geometrytype") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    // "GeometryCollection" is the longest
    fix_length_and_charset(20, default_charset());
    set_maybe_null();
    return FALSE;
  };
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_geometry_type>(thd, this); }
};


// #define HEAVY_CONVEX_HULL
class Item_func_convexhull: public Item_geometry_func_args_geometry
{
  class ch_node: public Gcalc_dyn_list::Item
  {
  public:
    const Gcalc_heap::Info *pi;
    ch_node *prev;
    Gcalc_dyn_list::Item *next;
    ch_node *get_next() { return (ch_node *) next; }
  };

  Gcalc_heap collector;
  Gcalc_function func;
  Gcalc_dyn_list res_heap;

  Gcalc_result_receiver res_receiver;
  String tmp_value;
#ifdef HEAVY_CONVEX_HULL
  Gcalc_scan_iterator scan_it;
#endif /*HEAVY_CONVEX_HULL*/
  ch_node *new_ch_node() { return (ch_node *) res_heap.new_item(); }
  int add_node_to_line(ch_node **p_cur, int dir, const Gcalc_heap::Info *pi);
public:
  Item_func_convexhull(THD *thd, Item *a)
   :Item_geometry_func_args_geometry(thd, a),
    res_heap(8192, sizeof(ch_node))
    {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_convexhull") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_convexhull>(thd, this); }
};


class Item_func_centroid: public Item_geometry_func_args_geometry
{
public:
  Item_func_centroid(THD *thd, Item *a)
   :Item_geometry_func_args_geometry(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_centroid") };
    return name;
  }
  String *val_str(String *) override;
  const Type_handler *type_handler() const override
  {
    return &type_handler_point;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_centroid>(thd, this); }
};

class Item_func_envelope: public Item_geometry_func_args_geometry
{
public:
  Item_func_envelope(THD *thd, Item *a)
   :Item_geometry_func_args_geometry(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_envelope") };
    return name;
  }
  String *val_str(String *) override;
  const Type_handler *type_handler() const override
  {
    return &type_handler_polygon;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_envelope>(thd, this); }
};


class Item_func_boundary: public Item_geometry_func_args_geometry
{
  class Transporter : public Gcalc_shape_transporter
  {
    Gcalc_result_receiver *m_receiver;
    uint n_points;
    Gcalc_function::shape_type current_type;
    double last_x, last_y;
  public:
    Transporter(Gcalc_result_receiver *receiver) :
      Gcalc_shape_transporter(NULL), m_receiver(receiver)
    {}
    int single_point(double x, double y) override;
    int start_line() override;
    int complete_line() override;
    int start_poly() override;
    int complete_poly() override;
    int start_ring() override;
    int complete_ring() override;
    int add_point(double x, double y) override;

    int start_collection(int n_objects) override;
  };
  Gcalc_result_receiver res_receiver;
public:
  Item_func_boundary(THD *thd, Item *a)
   :Item_geometry_func_args_geometry(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_boundary") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_boundary>(thd, this); }
};


class Item_func_point: public Item_geometry_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_real(0, 2); }
public:
  Item_func_point(THD *thd, Item *a, Item *b): Item_geometry_func(thd, a, b) {}
  Item_func_point(THD *thd, Item *a, Item *b, Item *srid):
    Item_geometry_func(thd, a, b, srid) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("point") };
    return name;
  }
  String *val_str(String *) override;
  const Type_handler *type_handler() const override
  {
    return &type_handler_point;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_point>(thd, this); }
};

class Item_func_spatial_decomp: public Item_geometry_func_args_geometry
{
  enum Functype decomp_func;
public:
  Item_func_spatial_decomp(THD *thd, Item *a, Item_func::Functype ft):
    Item_geometry_func_args_geometry(thd, a) { decomp_func = ft; }
  LEX_CSTRING func_name_cstring() const override
  { 
    static LEX_CSTRING startpoint= {STRING_WITH_LEN("st_startpoint") };
    static LEX_CSTRING endpoint= {STRING_WITH_LEN("st_endpoint") };
    static LEX_CSTRING exteriorring= {STRING_WITH_LEN("st_exteriorring") };
    static LEX_CSTRING unknown= {STRING_WITH_LEN("spatial_decomp_unknown") };
    switch (decomp_func) {
      case SP_STARTPOINT:
        return startpoint;
      case SP_ENDPOINT:
        return endpoint;
      case SP_EXTERIORRING:
        return exteriorring;
      default:
	DBUG_ASSERT(0);  // Should never happened
        return unknown;
    }
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_spatial_decomp>(thd, this); }
};

class Item_func_spatial_decomp_n: public Item_geometry_func_args_geometry
{
  enum Functype decomp_func_n;
  bool check_arguments() const override
  {
    return Item_geometry_func_args_geometry::check_arguments() ||
           args[1]->check_type_can_return_int(func_name_cstring());
  }
public:
  Item_func_spatial_decomp_n(THD *thd, Item *a, Item *b, Item_func::Functype ft)
   :Item_geometry_func_args_geometry(thd, a, b),
    decomp_func_n(ft)
  { }
  LEX_CSTRING func_name_cstring() const override
  { 
    static LEX_CSTRING pointn= {STRING_WITH_LEN("st_pointn") };
    static LEX_CSTRING geometryn= {STRING_WITH_LEN("st_geometryn") };
    static LEX_CSTRING interiorringn= {STRING_WITH_LEN("st_interiorringn") };
    static LEX_CSTRING unknown= {STRING_WITH_LEN("spatial_decomp_unknown") };

    switch (decomp_func_n) {
      case SP_POINTN:
        return pointn;
      case SP_GEOMETRYN:
        return geometryn;
      case SP_INTERIORRINGN:
        return interiorringn;
      default:
	DBUG_ASSERT(0);  // Should never happened
        return unknown;
    }
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_spatial_decomp_n>(thd, this); }
};

class Item_func_spatial_collection: public Item_geometry_func
{
  bool check_arguments() const override
  {
    return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(), args,
                                                             0, arg_count);
  }
  enum Geometry::wkbType coll_type; 
  enum Geometry::wkbType item_type;
public:
  Item_func_spatial_collection(THD *thd,
     List<Item> &list, enum Geometry::wkbType ct, enum Geometry::wkbType it):
  Item_geometry_func(thd, list)
  {
    coll_type=ct;
    item_type=it;
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    if (Item_geometry_func::fix_length_and_dec())
      return TRUE;
    for (unsigned int i= 0; i < arg_count; ++i)
    {
      if (args[i]->fixed() && args[i]->field_type() != MYSQL_TYPE_GEOMETRY)
      {
        String str;
        args[i]->print(&str, QT_NO_DATA_EXPANSION);
        str.append('\0');
        my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "non geometric",
                 str.ptr());
        return TRUE;
      }
    }
    return FALSE;
  }
};


class Item_func_geometrycollection: public Item_func_spatial_collection
{
public:
  Item_func_geometrycollection(THD *thd, List<Item> &list)
   :Item_func_spatial_collection(thd, list,
                                 Geometry::wkb_geometrycollection,
                                 Geometry::wkb_point)
  { }
  const Type_handler *type_handler() const override
  {
    return &type_handler_geometrycollection;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("geometrycollection") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_geometrycollection>(thd, this); }
};


class Item_func_linestring: public Item_func_spatial_collection
{
public:
  Item_func_linestring(THD *thd, List<Item> &list)
   :Item_func_spatial_collection(thd, list,
                                 Geometry::wkb_linestring,
                                 Geometry::wkb_point)
  { }
  const Type_handler *type_handler() const override
  { return &type_handler_linestring; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("linestring") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_linestring>(thd, this); }
};


class Item_func_polygon: public Item_func_spatial_collection
{
public:
  Item_func_polygon(THD *thd, List<Item> &list)
   :Item_func_spatial_collection(thd, list,
                                 Geometry::wkb_polygon,
                                 Geometry::wkb_linestring)
  { }
  const Type_handler *type_handler() const override
  { return &type_handler_polygon; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("polygon") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_polygon>(thd, this); }
};


class Item_func_multilinestring: public Item_func_spatial_collection
{
public:
  Item_func_multilinestring(THD *thd, List<Item> &list)
   :Item_func_spatial_collection(thd, list,
                                 Geometry::wkb_multilinestring,
                                 Geometry::wkb_linestring)
  { }
  const Type_handler *type_handler() const override
  {
    return &type_handler_multilinestring;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("multilinestring") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_multilinestring>(thd, this); }
};


class Item_func_multipoint: public Item_func_spatial_collection
{
public:
  Item_func_multipoint(THD *thd, List<Item> &list)
   :Item_func_spatial_collection(thd, list,
                                 Geometry::wkb_multipoint,
                                 Geometry::wkb_point)
  { }
  const Type_handler *type_handler() const override
  {
    return &type_handler_multipoint;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("multipoint") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_multipoint>(thd, this); }
};


class Item_func_multipolygon: public Item_func_spatial_collection
{
public:
  Item_func_multipolygon(THD *thd, List<Item> &list)
   :Item_func_spatial_collection(thd, list,
                                 Geometry::wkb_multipolygon,
                                 Geometry::wkb_polygon)
  { }
  const Type_handler *type_handler() const override
  {
    return &type_handler_multipolygon;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("multipolygon") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_multipolygon>(thd, this); }
};



/*
  Spatial relations
*/

class Item_func_spatial_rel: public Item_bool_func2_with_rev
{
protected:
  enum Functype spatial_rel;
  String tmp_value1, tmp_value2;
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
                       KEY_PART *key_part,
                       Item_func::Functype type, Item *value) override;
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 2);
    return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
                                                             args, 0, 2);
  }
public:
  Item_func_spatial_rel(THD *thd, Item *a, Item *b, enum Functype sp_rel):
    Item_bool_func2_with_rev(thd, a, b), spatial_rel(sp_rel)
  {
    set_maybe_null();
  }
  enum Functype functype() const override { return spatial_rel; }
  enum Functype rev_functype() const override
  {
    switch (spatial_rel)
    {
      case SP_CONTAINS_FUNC:
        return SP_WITHIN_FUNC;
      case SP_WITHIN_FUNC:
        return SP_CONTAINS_FUNC;
      default:
        return spatial_rel;
    }
  }
  bool is_null() override { (void) val_int(); return null_value; }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override
  {
    return add_key_fields_optimize_op(join, key_fields, and_level,
                                      usable_tables, sargables, false);
  }
  bool need_parentheses_in_default() override { return false; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
};


class Item_func_spatial_mbr_rel: public Item_func_spatial_rel
{
public:
  Item_func_spatial_mbr_rel(THD *thd, Item *a, Item *b, enum Functype sp_rel):
    Item_func_spatial_rel(thd, a, b, sp_rel)
  { }
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_spatial_mbr_rel>(thd, this); }
};


class Item_func_spatial_precise_rel: public Item_func_spatial_rel
{
  Gcalc_heap collector;
  Gcalc_scan_iterator scan_it;
  Gcalc_function func;
public:
  Item_func_spatial_precise_rel(THD *thd, Item *a, Item *b, enum Functype sp_rel):
    Item_func_spatial_rel(thd, a, b, sp_rel), collector()
  { }
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_spatial_precise_rel>(thd, this); }
};


class Item_func_spatial_relate: public Item_bool_func_args_geometry_geometry
{
  Gcalc_heap collector;
  Gcalc_scan_iterator scan_it;
  Gcalc_function func;
  String tmp_value1, tmp_value2, tmp_matrix;
  bool check_arguments() const override
  {
    return Item_bool_func_args_geometry_geometry::check_arguments() ||
           args[2]->check_type_general_purpose_string(func_name_cstring());
  }
public:
  Item_func_spatial_relate(THD *thd, Item *a, Item *b, Item *matrix):
    Item_bool_func_args_geometry_geometry(thd, a, b, matrix)
  { }
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_relate") };
    return name;
  }
  bool need_parentheses_in_default() override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_spatial_relate>(thd, this); }
};


/*
  Spatial operations
*/

class Item_func_spatial_operation final: public Item_geometry_func
{
  bool check_arguments() const override
  {
    DBUG_ASSERT(arg_count >= 2);
    return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
                                                             args, 0, 2);
  }
public:
  Gcalc_function::op_type spatial_op;
  Gcalc_heap collector;
  Gcalc_function func;

  Gcalc_result_receiver res_receiver;
  Gcalc_operation_reducer operation;
  String tmp_value1,tmp_value2;
public:
  Item_func_spatial_operation(THD *thd, Item *a,Item *b,
                              Gcalc_function::op_type sp_op):
    Item_geometry_func(thd, a, b), spatial_op(sp_op)
  {}
  virtual ~Item_func_spatial_operation();
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override;
  void print(String *str, enum_query_type query_type) override
  {
    Item_func::print(str, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_spatial_operation>(thd, this); }
};


class Item_func_buffer final : public Item_geometry_func_args_geometry
{
  bool check_arguments() const override
  {
    return Item_geometry_func_args_geometry::check_arguments() ||
           args[1]->check_type_can_return_real(func_name_cstring());
  }
protected:
  class Transporter : public Gcalc_operation_transporter
  {
    int m_npoints;
    double m_d;
    double x1,y1,x2,y2;
    double x00,y00,x01,y01;
    int add_edge_buffer(double x3, double y3, bool round_p1, bool round_p2);
    int add_last_edge_buffer();
    int add_point_buffer(double x, double y);
    int complete();
    int m_nshapes;
    Gcalc_function::op_type buffer_op;
    int last_shape_pos;
    bool skip_line;

  public:
    Transporter(Gcalc_function *fn, Gcalc_heap *heap, double d) :
      Gcalc_operation_transporter(fn, heap), m_npoints(0), m_d(d),
      m_nshapes(0), buffer_op((d > 0.0) ? Gcalc_function::op_union :
                                          Gcalc_function::op_difference),
      skip_line(FALSE)
    {}
    int single_point(double x, double y) override;
    int start_line() override;
    int complete_line() override;
    int start_poly() override;
    int complete_poly() override;
    int start_ring() override;
    int complete_ring() override;
    int add_point(double x, double y) override;

    int start_collection(int n_objects) override;
  };
  Gcalc_heap collector;
  Gcalc_function func;

  Gcalc_result_receiver res_receiver;
  Gcalc_operation_reducer operation;

public:
  Item_func_buffer(THD *thd, Item *obj, Item *distance)
   :Item_geometry_func_args_geometry(thd, obj, distance) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_buffer") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_buffer>(thd, this); }
};


class Item_func_isempty: public Item_bool_func_args_geometry
{
public:
  Item_func_isempty(THD *thd, Item *a)
   :Item_bool_func_args_geometry(thd, a) {}
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_isempty") };
    return name;
  }
  bool fix_length_and_dec() override
  { set_maybe_null(); return FALSE; }
  bool need_parentheses_in_default() override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isempty>(thd, this); }
};

class Item_func_issimple: public Item_long_func_args_geometry
{
  Gcalc_heap collector;
  Gcalc_function func;
  Gcalc_scan_iterator scan_it;
  String tmp;
public:
  Item_func_issimple(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_issimple") };
    return name;
  }
  bool fix_length_and_dec() override { decimals=0; max_length=2; return FALSE; }
  decimal_digits_t decimal_precision() const override { return 1; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_issimple>(thd, this); }
};

class Item_func_isclosed: public Item_long_func_args_geometry
{
public:
  Item_func_isclosed(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_isclosed") };
    return name;
  }
  bool fix_length_and_dec() override { decimals=0; max_length=2; return FALSE; }
  decimal_digits_t decimal_precision() const override { return 1; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isclosed>(thd, this); }
};

class Item_func_isring: public Item_func_issimple
{
public:
  Item_func_isring(THD *thd, Item *a): Item_func_issimple(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_isring") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isring>(thd, this); }
};

class Item_func_dimension: public Item_long_func_args_geometry
{
public:
  Item_func_dimension(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_dimension") };
    return name;
  }
  bool fix_length_and_dec() override
  { max_length= 10; set_maybe_null(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dimension>(thd, this); }
};


class Item_func_x: public Item_real_func_args_geometry
{
public:
  Item_func_x(THD *thd, Item *a): Item_real_func_args_geometry(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_x") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    if (Item_real_func::fix_length_and_dec())
      return TRUE;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_x>(thd, this); }
};


class Item_func_y: public Item_real_func_args_geometry
{
public:
  Item_func_y(THD *thd, Item *a): Item_real_func_args_geometry(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_y") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    if (Item_real_func::fix_length_and_dec())
      return TRUE;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_y>(thd, this); }
};


class Item_func_numgeometries: public Item_long_func_args_geometry
{
public:
  Item_func_numgeometries(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_numgeometries") };
    return name;
  }
  bool fix_length_and_dec() override
  { max_length= 10; set_maybe_null(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_numgeometries>(thd, this); }
};


class Item_func_numinteriorring: public Item_long_func_args_geometry
{
public:
  Item_func_numinteriorring(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_numinteriorrings") };
    return name;
  }
  bool fix_length_and_dec() override
  { max_length= 10; set_maybe_null(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_numinteriorring>(thd, this); }
};


class Item_func_numpoints: public Item_long_func_args_geometry
{
public:
  Item_func_numpoints(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_numpoints") };
    return name;
  }
  bool fix_length_and_dec() override
  { max_length= 10; set_maybe_null(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_numpoints>(thd, this); }
};


class Item_func_area: public Item_real_func_args_geometry
{
public:
  Item_func_area(THD *thd, Item *a): Item_real_func_args_geometry(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_area") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    if (Item_real_func::fix_length_and_dec())
      return TRUE;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_area>(thd, this); }
};


class Item_func_glength: public Item_real_func_args_geometry
{
  String value;
public:
  Item_func_glength(THD *thd, Item *a)
   :Item_real_func_args_geometry(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_length") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    if (Item_real_func::fix_length_and_dec())
      return TRUE;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_glength>(thd, this); }
};


class Item_func_srid: public Item_long_func_args_geometry
{
public:
  Item_func_srid(THD *thd, Item *a)
   :Item_long_func_args_geometry(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("srid") };
    return name;
  }
  bool fix_length_and_dec() override
  { max_length= 10; set_maybe_null(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_srid>(thd, this); }
};


class Item_func_distance: public Item_real_func_args_geometry_geometry
{
  String tmp_value1;
  String tmp_value2;
  Gcalc_heap collector;
  Gcalc_function func;
  Gcalc_scan_iterator scan_it;
public:
  Item_func_distance(THD *thd, Item *a, Item *b)
   :Item_real_func_args_geometry_geometry(thd, a, b) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_distance") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_distance>(thd, this); }
};


class Item_func_sphere_distance: public Item_real_func
{
  double spherical_distance_points(Geometry *g1, Geometry *g2,
                                   const double sphere_r);
public:
  Item_func_sphere_distance(THD *thd, List<Item> &list):
    Item_real_func(thd, list) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_distance_sphere") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sphere_distance>(thd, this); }
};


class Item_func_pointonsurface: public Item_geometry_func_args_geometry
{
  String tmp_value;
  Gcalc_heap collector;
  Gcalc_function func;
  Gcalc_scan_iterator scan_it;
public:
  Item_func_pointonsurface(THD *thd, Item *a)
   :Item_geometry_func_args_geometry(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_pointonsurface") };
    return name;
  }
  String *val_str(String *) override;
  const Type_handler *type_handler() const override
  {
    return &type_handler_point;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_pointonsurface>(thd, this); }
};


#ifndef DBUG_OFF
class Item_func_gis_debug: public Item_long_func
{
  public:
    Item_func_gis_debug(THD *thd, Item *a): Item_long_func(thd, a)
    { null_value= false; }
    bool fix_length_and_dec() override { fix_char_length(10); return FALSE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("st_gis_debug") };
    return name;
  }
    longlong val_int() override;
    bool check_vcol_func_processor(void *arg) override
    {
      return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
    }
    Item *do_get_copy(THD *thd) const override
    { return get_item_copy<Item_func_gis_debug>(thd, this); }
};
#endif


#define GEOM_NEW(thd, obj_constructor) new (thd->mem_root) obj_constructor
#define GEOM_TYPE(x) (x)

#else /*HAVE_SPATIAL*/

#define GEOM_NEW(thd, obj_constructor) NULL
#define GEOM_TYPE(x) NULL

#endif /*HAVE_SPATIAL*/
#endif /* ITEM_GEOFUNC_INCLUDED */
server/private/my_tree.h000064400000007627150400263750011357 0ustar00/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _tree_h
#define _tree_h
#ifdef	__cplusplus
extern "C" {
#endif

#include "my_base.h"		/* get 'enum ha_rkey_function' */
#include "my_alloc.h"           /* MEM_ROOT */

/* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */
#define MAX_TREE_HEIGHT	64

#define ELEMENT_KEY(tree,element)\
(tree->offset_to_key ? (void*)((uchar*) element+tree->offset_to_key) :\
			*((void**) (element+1)))

#define tree_set_pointer(element,ptr) *((uchar **) (element+1))=((uchar*) (ptr))

/*
  A tree with its flag set to TREE_ONLY_DUPS behaves differently on inserting 
  an element that is not in the tree:
  the element is not added at all, but instead tree_insert() returns a special
  address TREE_ELEMENT_UNIQUE as an indication that the function has not failed
  due to lack of memory. 
*/

#define TREE_ELEMENT_UNIQUE ((TREE_ELEMENT *) 1)
#define TREE_NO_DUPS 1
#define TREE_ONLY_DUPS 2

typedef enum { left_root_right, right_root_left } TREE_WALK;
typedef uint32 element_count;
typedef int (*tree_walk_action)(void *,element_count,void *);

typedef enum { free_init, free_free, free_end } TREE_FREE;
typedef int (*tree_element_free)(void*, TREE_FREE, void *);

typedef struct st_tree_element {
  struct st_tree_element *left,*right;
  uint32 count:31,
	 colour:1;			/* black is marked as 1 */
} TREE_ELEMENT;

#define ELEMENT_CHILD(element, offs) (*(TREE_ELEMENT**)((char*)element + offs))

typedef struct st_tree {
  TREE_ELEMENT *root;
  TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
  uint offset_to_key,elements_in_tree,size_of_element;
  size_t memory_limit, allocated;
  qsort_cmp2 compare;
  void *custom_arg;
  MEM_ROOT mem_root;
  my_bool with_delete;
  tree_element_free free;
  myf my_flags;
  uint flag;
} TREE;

	/* Functions on whole tree */
void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
               int size, qsort_cmp2 compare,
	       tree_element_free free_element, void *custom_arg,
               myf my_flags);
int delete_tree(TREE*, my_bool abort);
int reset_tree(TREE*);

  /* similar to delete tree, except we do not my_free() blocks in mem_root */
#define is_tree_inited(tree) ((tree)->root != 0)

	/* Functions on leafs */
TREE_ELEMENT *tree_insert(TREE *tree,void *key, uint key_size, 
                          void *custom_arg);
void *tree_search(TREE *tree, void *key, void *custom_arg);
int tree_walk(TREE *tree,tree_walk_action action,
	      void *argument, TREE_WALK visit);
int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg);
void *tree_search_key(TREE *tree, const void *key, 
                      TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos,
                      enum ha_rkey_function flag, void *custom_arg);
void *tree_search_edge(TREE *tree, TREE_ELEMENT **parents, 
                        TREE_ELEMENT ***last_pos, int child_offs);
void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs, 
                       int r_offs);
ha_rows tree_record_pos(TREE *tree, const void *key, 
                     enum ha_rkey_function search_flag, void *custom_arg);
#define reset_free_element(tree) (tree)->free= 0

#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*))

#ifdef	__cplusplus
}
#endif
#endif
server/private/sql_mode.h000064400000015117150400263750011507 0ustar00#ifndef SQL_MODE_H_INCLUDED
#define SQL_MODE_H_INCLUDED
/*
   Copyright (c) 2019, MariaDB.

   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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_basic_types.h"

/*
  class Sql_mode_dependency

  A combination of hard and soft dependency on sql_mode.
  Used to watch if a GENERATED ALWAYS AS expression guarantees consitent
  data written to its virtual column.

  A virtual column can appear in an index if:
  - the generation expression does not depend on any sql_mode flags, or
  - the generation expression has a soft dependency on an sql_mode flag,
    and the column knows how to handle this dependeny.

  A virtual column cannot appear in an index if:
  - its generation expression has a hard dependency
  - its generation expression has a soft dependency, but the column
    cannot handle it on store.
  An error is reported in such cases.

  How dependencies appear:
  - When a column return value depends on some sql_mode flag,
    its Item_field adds a corresponding bit to m_soft. For example,
    Item_field for a CHAR(N) column adds the PAD_CHAR_TO_FULL_LENGTH flag.
  - When an SQL function/operator return value depends on some sql_mode flag,
    it adds a corresponding bit to m_soft. For example, Item_func_minus
    adds the MODE_NO_UNSIGNED_SUBTRACTION in case of unsigned arguments.

  How dependency are processed (see examples below):
  - All SQL functions/operators bit-OR all hard dependencies from all arguments.
  - Some soft dependencies can be handled by the underlying Field on store,
    e.g. CHAR(N) can handle PAD_CHAR_TO_FULL_LENGTH.
  - Some soft dependencies can be handled by SQL functions and operators,
    e.g. RTRIM(expr) removes expr's soft dependency on PAD_CHAR_TO_FULL_LENGTH.
    If a function or operator handles a soft dependency on a certain sql_mode
    flag, it removes the corresponding bit from m_soft (see below).
    Note, m_hard is not touched in such cases.
  - When an expression with a soft dependency on a certain sql_mode flag
    goes as an argument to an SQL function/operator which cannot handle
    this flag, the dependency escalates from soft to hard
    (by moving the corresponding bit from m_soft to m_hard) and cannot be
    handled any more on the upper level, neither by a Field on store,
    nor by another SQL function/operator.

  There are four kinds of Items:
  1. Items that generate a soft or hard dependency, e.g.
     - Item_field for CHAR(N) - generates soft/PAD_CHAR_TO_FULL_LENGTH
     - Item_func_minus        - generates soft/NO_UNSIGNED_SUBTRACTION
  2. Items that convert a soft dependency to a hard dependency.
     This happens e.g. when an Item_func instance gets a soft dependency
     from its arguments, and it does not know how to handle this dependency.
     Most Item_func descendants do this.
  3. Items that remove soft dependencies, e.g.:
     - Item_func_rtrim - removes soft/PAD_CHAR_TO_FULL_LENGTH
                         that came from args[0] (under certain conditions)
     - Item_func_rpad  - removes soft/PAD_CJAR_TO_FULL_LENGTH
                         that came from args[0] (under certain conditions)
  4. Items that repeat soft dependency from its arguments to the caller.
     They are not implemented yet. But functions like Item_func_coalesce,
     Item_func_case, Item_func_case_abbreviation2 could do this.

  Examples:

  1. CREATE OR REPLACE TABLE t1 (a CHAR(5), v CHAR(20) AS(a), KEY(v));

     Here `v` has a soft dependency on `a`.
     The value of `a` depends on PAD_CHAR_TO_FULL_LENGTH, it can return:
     - 'a'                         - if PAD_CHAR_TO_FULL_LENGTH is disabled
     - 'a' followed by four spaces - if PAD_CHAR_TO_FULL_LENGTH is enabled
     But `v` will pad trailing spaces to the full length on store anyway.
     So Field_string handles this soft dependency on store.
     This combination of the virtial column data type and its generation
     expression is safe and provides consistent data in `v`, which is
     'a' followed by four spaces, no matter what PAD_CHAR_TO_FULL_LENGTH is.

  2. CREATE OR REPLACE TABLE t1 (a CHAR(5), v VARCHAR(20) AS(a), KEY(v));

     Here `v` has a soft dependency on `a`. But Field_varstring does
     not pad spaces on store, so it cannot handle this dependency.
     This combination of the virtual column data type and its generation
     expression is not safe. An error is returned.

  3. CREATE OR REPLACE TABLE t1 (a CHAR(5), v INT AS(LENGTH(a)), KEY(v));

     Here `v` has a hard dependency on `a`, because the value of `a`
     is wrapped to the function LENGTH().
     The value of `LENGTH(a)` depends on PAD_CHAR_TO_FULL_LENGTH, it can return:
     - 1  - if PAD_CHAR_TO_FULL_LENGTH is disabled
     - 4  - if PAD_CHAR_TO_FULL_LENGTH is enabled
     This combination cannot provide consistent data stored to `v`,
     therefore it's disallowed.
*/
class Sql_mode_dependency
{
  sql_mode_t m_hard;
  sql_mode_t m_soft;
public:
  Sql_mode_dependency()
   :m_hard(0), m_soft(0)
  { }
  Sql_mode_dependency(sql_mode_t hard, sql_mode_t soft)
   :m_hard(hard), m_soft(soft)
  { }
  sql_mode_t hard() const { return m_hard; }
  sql_mode_t soft() const { return m_soft; }
  operator bool () const
  {
    return m_hard > 0 || m_soft > 0;
  }
  Sql_mode_dependency operator|(const Sql_mode_dependency &other) const
  {
    return Sql_mode_dependency(m_hard | other.m_hard, m_soft | other.m_soft);
  }
  Sql_mode_dependency operator&(const Sql_mode_dependency &other) const
  {
    return Sql_mode_dependency(m_hard & other.m_hard, m_soft & other.m_soft);
  }
  Sql_mode_dependency &operator|=(const Sql_mode_dependency &other)
  {
    m_hard|= other.m_hard;
    m_soft|= other.m_soft;
    return *this;
  }
  Sql_mode_dependency &operator&=(const Sql_mode_dependency &other)
  {
    m_hard&= other.m_hard;
    m_soft&= other.m_soft;
    return *this;
  }
  Sql_mode_dependency &soft_to_hard()
  {
    m_hard|= m_soft;
    m_soft= 0;
    return *this;
  }
  void push_dependency_warnings(THD *thd) const;
};


#endif // SQL_MODE_H_INCLUDED
server/private/lex_symbol.h000064400000002453150400263750012060 0ustar00/* Copyright (c) 2000, 2001, 2004, 2006, 2007 MySQL AB
   Use is subject to license terms

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


/* This struct includes all reserved words and functions */

#ifndef _lex_symbol_h
#define _lex_symbol_h

struct st_sym_group;

typedef struct st_symbol {
  const char *name;
  uint	tok;
  uint length;
  struct st_sym_group *group;
} SYMBOL;

typedef struct st_lex_symbol
{
  SYMBOL *symbol;
  char   *str;
  uint   length;
} LEX_SYMBOL;

typedef struct st_sym_group {
  const char *name;
  const char *needed_define;
} SYM_GROUP;

extern SYM_GROUP sym_group_common;
extern SYM_GROUP sym_group_geom;
extern SYM_GROUP sym_group_rtree;

#endif /* _lex_symbol_h */
server/private/sql_hset.h000064400000006511150400263750011524 0ustar00#ifndef SQL_HSET_INCLUDED
#define SQL_HSET_INCLUDED
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#include "my_global.h"
#include "hash.h"


/**
  A type-safe wrapper around mysys HASH.
*/

template <typename T>
class Hash_set
{
public:
  enum { START_SIZE= 8 };
  /**
    Constructs an empty unique hash.
  */
  Hash_set(PSI_memory_key psi_key,
           const uchar *(*K)(const void *, size_t *, my_bool),
           CHARSET_INFO *cs= &my_charset_bin)
  {
    my_hash_init(psi_key, &m_hash, cs, START_SIZE, 0, 0, K, 0, HASH_UNIQUE);
  }

  Hash_set(PSI_memory_key psi_key, CHARSET_INFO *charset, ulong default_array_elements,
           size_t key_offset, size_t key_length, my_hash_get_key get_key,
           void (*free_element)(void*), uint flags)
  {
    my_hash_init(psi_key, &m_hash, charset, default_array_elements, key_offset,
                 key_length, get_key, free_element, flags);
  }
  /**
    Destroy the hash by freeing the buckets table. Does
    not call destructors for the elements.
  */
  ~Hash_set()
  {
    my_hash_free(&m_hash);
  }
  /**
    Insert a single value into a hash. Does not tell whether
    the value was inserted -- if an identical value existed,
    it is not replaced.

    @retval TRUE  Out of memory.
    @retval FALSE OK. The value either was inserted or existed
                  in the hash.
  */
  bool insert(T *value)
  {
    return my_hash_insert(&m_hash, reinterpret_cast<const uchar*>(value));
  }
  bool remove(T *value)
  {
    return my_hash_delete(&m_hash, reinterpret_cast<uchar*>(value));
  }
  T *find(const void *key, size_t klen) const
  {
    return (T*)my_hash_search(&m_hash, reinterpret_cast<const uchar *>(key), klen);
  }
  /** Is this hash set empty? */
  bool is_empty() const { return m_hash.records == 0; }
  /** Returns the number of unique elements. */
  size_t size() const { return static_cast<size_t>(m_hash.records); }
  /** Erases all elements from the container */
  void clear() { my_hash_reset(&m_hash); }
  const T* at(size_t i) const
  {
    return reinterpret_cast<T*>(my_hash_element(const_cast<HASH*>(&m_hash), i));
  }
  /** An iterator over hash elements. Is not insert-stable. */
  class Iterator
  {
  public:
    Iterator(Hash_set &hash_set)
      : m_hash(&hash_set.m_hash),
        m_idx(0)
    {}
    /**
      Return the current element and reposition the iterator to the next
      element.
    */
    inline T *operator++(int)
    {
      if (m_idx < m_hash->records)
        return reinterpret_cast<T*>(my_hash_element(m_hash, m_idx++));
      return NULL;
    }
    void rewind() { m_idx= 0; }
  private:
    HASH *m_hash;
    uint m_idx;
  };
private:
  HASH m_hash;
};

#endif // SQL_HSET_INCLUDED
server/private/my_check_opt.h000064400000005072150400263750012347 0ustar00/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

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 Street, Fifth Floor, Boston, MA 02110-1335  USA */

#ifndef _my_check_opt_h
#define _my_check_opt_h

#ifdef	__cplusplus
extern "C" {
#endif

/*
  All given definitions needed for MyISAM storage engine:
  myisamchk.c or/and ha_myisam.cc or/and micheck.c
  Some definitions are needed by the MySQL parser.
*/

#define T_AUTO_INC		(1UL << 0)
#define T_AUTO_REPAIR		(1UL << 1)
#define T_BACKUP_DATA		(1UL << 2)
#define T_CALC_CHECKSUM		(1UL << 3)
#define T_CHECK			(1UL << 4)
#define T_CHECK_ONLY_CHANGED	(1UL << 5)
#define T_CREATE_MISSING_KEYS	(1UL << 6)
#define T_DESCRIPT		(1UL << 7)
#define T_DONT_CHECK_CHECKSUM	(1UL << 8)
#define T_EXTEND		(1UL << 9)
#define T_FAST			(1UL << 10)
#define T_FORCE_CREATE		(1UL << 11)
#define T_FORCE_UNIQUENESS	(1UL << 12)
#define T_INFO			(1UL << 13)
/** CHECK TABLE...MEDIUM (the default) */
#define T_MEDIUM		(1UL << 14)
/** CHECK TABLE...QUICK */
#define T_QUICK			(1UL << 15)
#define T_READONLY		(1UL << 16)
#define T_REP			(1UL << 17)
#define T_REP_BY_SORT		(1UL << 18)
#define T_REP_PARALLEL		(1UL << 19)
#define T_RETRY_WITHOUT_QUICK	(1UL << 20)
#define T_SAFE_REPAIR		(1UL << 21)
#define T_SILENT		(1UL << 22)
#define T_SORT_INDEX		(1UL << 23)
#define T_SORT_RECORDS		(1UL << 24)
#define T_STATISTICS		(1UL << 25)
#define T_UNPACK		(1UL << 26)
#define T_UPDATE_STATE		(1UL << 27)
#define T_VERBOSE		(1UL << 28)
#define T_VERY_SILENT		(1UL << 29)
#define T_WAIT_FOREVER		(1UL << 30)
#define T_WRITE_LOOP		(1UL << 31)
#define T_ZEROFILL              (1ULL << 32)
#define T_ZEROFILL_KEEP_LSN     (1ULL << 33)
/** If repair should not bump create_rename_lsn */
#define T_NO_CREATE_RENAME_LSN  (1ULL << 34)
/** If repair shouldn't do any locks */
#define T_NO_LOCKS		(1ULL << 35)
#define T_CREATE_UNIQUE_BY_SORT (1ULL << 36)
#define T_SUPPRESS_ERR_HANDLING (1ULL << 37)
#define T_FORCE_SORT_MEMORY     (1ULL << 38)

#define T_REP_ANY		(T_REP | T_REP_BY_SORT | T_REP_PARALLEL)

#ifdef	__cplusplus
}
#endif
#endif
server/private/semisync_slave.h000064400000007225150400263750012731 0ustar00/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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-1301  USA */


#ifndef SEMISYNC_SLAVE_H
#define SEMISYNC_SLAVE_H

#include "semisync.h"
#include "my_global.h"
#include "sql_priv.h"
#include "rpl_mi.h"
#include "mysql.h"
#include <sql_common.h>

class Master_info;

/**
   The extension class for the slave of semi-synchronous replication
*/
class Repl_semi_sync_slave
  :public Repl_semi_sync_base {
public:
  Repl_semi_sync_slave() :m_slave_enabled(false) {}
  ~Repl_semi_sync_slave() = default;

  void set_trace_level(unsigned long trace_level) {
    m_trace_level = trace_level;
  }

  /* Initialize this class after MySQL parameters are initialized. this
   * function should be called once at bootstrap time.
   */
  int init_object();

  inline bool get_slave_enabled() {
    return m_slave_enabled;
  }

  void set_slave_enabled(bool enabled) {
    m_slave_enabled = enabled;
  }

  inline bool is_delay_master(){
    return m_delay_master;
  }

  void set_delay_master(bool enabled) {
    m_delay_master = enabled;
  }

  void set_kill_conn_timeout(unsigned int timeout) {
    m_kill_conn_timeout = timeout;
  }

  /* A slave reads the semi-sync packet header and separate the metadata
   * from the payload data.
   *
   * Input:
   *  header      - (IN)  packet header pointer
   *  total_len   - (IN)  total packet length: metadata + payload
   *  semi_flags  - (IN)  store flags: SEMI_SYNC_SLAVE_DELAY_SYNC and
                          SEMI_SYNC_NEED_ACK
   *  payload     - (IN)  payload: the replication event
   *  payload_len - (IN)  payload length
   *
   * Return:
   *  0: success;  non-zero: error
   */
  int slave_read_sync_header(const uchar *header, unsigned long total_len,
                             int *semi_flags,
                             const uchar **payload, unsigned long *payload_len);

  /* A slave replies to the master indicating its replication process.  It
   * indicates that the slave has received all events before the specified
   * binlog position.
   */
  int slave_reply(Master_info* mi);
  void slave_start(Master_info *mi);
  void slave_stop(Master_info *mi);
  void slave_reconnect(Master_info *mi);
  int request_transmit(Master_info *mi);
  void kill_connection(MYSQL *mysql);

private:
  /* True when init_object has been called */
  bool m_init_done;
  bool m_slave_enabled;        /* semi-sync is enabled on the slave */
  bool m_delay_master;
  unsigned int m_kill_conn_timeout;
};


/* System and status variables for the slave component */
extern my_bool global_rpl_semi_sync_slave_enabled;
extern ulong rpl_semi_sync_slave_trace_level;
extern Repl_semi_sync_slave repl_semisync_slave;

extern char rpl_semi_sync_slave_delay_master;
extern unsigned int rpl_semi_sync_slave_kill_conn_timeout;
extern unsigned long long rpl_semi_sync_slave_send_ack;

extern int rpl_semi_sync_enabled(THD *thd, SHOW_VAR *var, void *buff,
                                 system_status_var *status_var,
                                 enum_var_type scope);
#endif /* SEMISYNC_SLAVE_H */
server/private/partition_info.h000064400000045544150400263750012737 0ustar00#ifndef PARTITION_INFO_INCLUDED
#define PARTITION_INFO_INCLUDED

/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_class.h"
#include "partition_element.h"
#include "sql_partition.h"

class partition_info;
struct TABLE_LIST;
/* Some function typedefs */
typedef int (*get_part_id_func)(partition_info *part_info, uint32 *part_id,
                                 longlong *func_value);
typedef int (*get_subpart_id_func)(partition_info *part_info, uint32 *part_id);
typedef bool (*check_constants_func)(THD *thd, partition_info *part_info);
 
struct st_ddl_log_memory_entry;

#define MAX_PART_NAME_SIZE 8


struct Vers_part_info : public Sql_alloc
{
  Vers_part_info() :
    limit(0),
    now_part(NULL),
    hist_part(NULL)
  {
    interval.type= INTERVAL_LAST;
  }
  Vers_part_info(Vers_part_info &src) :
    interval(src.interval),
    limit(src.limit),
    now_part(NULL),
    hist_part(NULL)
  {
  }
  bool initialized()
  {
    if (now_part)
    {
      DBUG_ASSERT(now_part->id != UINT_MAX32);
      DBUG_ASSERT(now_part->type == partition_element::CURRENT);
      if (hist_part)
      {
        DBUG_ASSERT(hist_part->id != UINT_MAX32);
        DBUG_ASSERT(hist_part->type == partition_element::HISTORY);
      }
      return true;
    }
    return false;
  }
  struct {
    my_time_t start;
    INTERVAL step;
    enum interval_type type;
    bool is_set() { return type < INTERVAL_LAST; }
  } interval;
  ulonglong limit;
  partition_element *now_part;
  partition_element *hist_part;
};

/*
  See generate_partition_syntax() for details of how the data is used
  in partition expression.
*/
class partition_info : public Sql_alloc
{
public:
  /*
   * Here comes a set of definitions needed for partitioned table handlers.
   */
  List<partition_element> partitions;
  List<partition_element> temp_partitions;

  /*
    These are mutually exclusive with part_expr/subpart_expr depending on
    what is specified in partitioning filter: expression or column list.
  */
  List<const char> part_field_list;
  List<const char> subpart_field_list;
  
  /* 
    If there is no subpartitioning, use only this func to get partition ids.
    If there is subpartitioning, use the this func to get partition id when
    you have both partition and subpartition fields.
  */
  get_part_id_func get_partition_id;

  /* Get partition id when we don't have subpartition fields */
  get_part_id_func get_part_partition_id;

  /* 
    Get subpartition id when we have don't have partition fields by we do
    have subpartition ids.
    Mikael said that for given constant tuple 
    {subpart_field1, ..., subpart_fieldN} the subpartition id will be the
    same in all subpartitions
  */
  get_subpart_id_func get_subpartition_id;

  /*
    When we have various string fields we might need some preparation
    before and clean-up after calling the get_part_id_func's. We need
    one such method for get_part_partition_id and one for
    get_subpartition_id.
  */
  get_part_id_func get_part_partition_id_charset;
  get_subpart_id_func get_subpartition_id_charset;

  check_constants_func check_constants;

  /* NULL-terminated array of fields used in partitioned expression */
  Field **part_field_array;
  Field **subpart_field_array;
  Field **part_charset_field_array;
  Field **subpart_charset_field_array;
  /* 
    Array of all fields used in partition and subpartition expression,
    without duplicates, NULL-terminated.
  */
  Field **full_part_field_array;
  /*
    Set of all fields used in partition and subpartition expression.
    Required for testing of partition fields in write_set when
    updating. We need to set all bits in read_set because the row may
    need to be inserted in a different [sub]partition.
  */
  MY_BITMAP full_part_field_set;

  /*
    When we have a field that requires transformation before calling the
    partition functions we must allocate field buffers for the field of
    the fields in the partition function.
  */
  uchar **part_field_buffers;
  uchar **subpart_field_buffers;
  uchar **restore_part_field_ptrs;
  uchar **restore_subpart_field_ptrs;

  Item *part_expr;
  Item *subpart_expr;

  Item *item_free_list;

  struct st_ddl_log_memory_entry *first_log_entry;
  struct st_ddl_log_memory_entry *exec_log_entry;
  struct st_ddl_log_memory_entry *frm_log_entry;

  /* 
    Bitmaps of partitions used by the current query. 
    * read_partitions  - partitions to be used for reading.
    * lock_partitions  - partitions that must be locked (read or write).
    Usually read_partitions is the same set as lock_partitions, but
    in case of UPDATE the WHERE clause can limit the read_partitions set,
    but not neccesarily the lock_partitions set.
    Usage pattern:
    * Initialized in ha_partition::open().
    * read+lock_partitions is set  according to explicit PARTITION,
      WL#5217, in open_and_lock_tables().
    * Bits in read_partitions can be cleared in prune_partitions()
      in the optimizing step.
      (WL#4443 is about allowing prune_partitions() to affect lock_partitions
      and be done before locking too).
    * When the partition enabled handler get an external_lock call it locks
      all partitions in lock_partitions (and remembers which partitions it
      locked, so that it can unlock them later). In case of LOCK TABLES it will
      lock all partitions, and keep them locked while lock_partitions can
      change for each statement under LOCK TABLES.
    * Freed at the same time item_free_list is freed.
  */
  MY_BITMAP read_partitions;
  MY_BITMAP lock_partitions;
  bool bitmaps_are_initialized;

  union {
    longlong *range_int_array;
    LIST_PART_ENTRY *list_array;
    part_column_list_val *range_col_array;
    part_column_list_val *list_col_array;
  };

  Vers_part_info *vers_info;
  
  /********************************************
   * INTERVAL ANALYSIS
   ********************************************/
  /*
    Partitioning interval analysis function for partitioning, or NULL if 
    interval analysis is not supported for this kind of partitioning.
  */
  get_partitions_in_range_iter get_part_iter_for_interval;
  /*
    Partitioning interval analysis function for subpartitioning, or NULL if
    interval analysis is not supported for this kind of partitioning.
  */
  get_partitions_in_range_iter get_subpart_iter_for_interval;
  
  /********************************************
   * INTERVAL ANALYSIS ENDS 
   ********************************************/

  longlong err_value;
  char* part_info_string;

  partition_element *curr_part_elem;     // part or sub part
  partition_element *current_partition;  // partition
  part_elem_value *curr_list_val;
  uint curr_list_object;
  uint num_columns;

  TABLE *table;
  /*
    These key_map's are used for Partitioning to enable quick decisions
    on whether we can derive more information about which partition to
    scan just by looking at what index is used.
  */
  key_map all_fields_in_PF, all_fields_in_PPF, all_fields_in_SPF;
  key_map some_fields_in_PF;

  handlerton *default_engine_type;
  partition_type part_type;
  partition_type subpart_type;

  uint part_info_len;

  uint num_parts;
  uint num_subparts;
  uint count_curr_subparts;                  // used during parsing

  uint num_list_values;

  uint num_part_fields;
  uint num_subpart_fields;
  uint num_full_part_fields;

  uint has_null_part_id;
  uint32 default_partition_id;
  /*
    This variable is used to calculate the partition id when using
    LINEAR KEY/HASH. This functionality is kept in the MySQL Server
    but mainly of use to handlers supporting partitioning.
  */
  uint16 linear_hash_mask;
  /*
    PARTITION BY KEY ALGORITHM=N
    Which algorithm to use for hashing the fields.
    N = 1 - Use 5.1 hashing (numeric fields are hashed as binary)
    N = 2 - Use 5.5 hashing (numeric fields are hashed like latin1 bytes)
  */
  enum enum_key_algorithm
    {
      KEY_ALGORITHM_NONE= 0,
      KEY_ALGORITHM_51= 1,
      KEY_ALGORITHM_55= 2
    };
  enum_key_algorithm key_algorithm;

  /* Only the number of partitions defined (uses default names and options). */
  bool use_default_partitions;
  bool use_default_num_partitions;
  /* Only the number of subpartitions defined (uses default names etc.). */
  bool use_default_subpartitions;
  bool use_default_num_subpartitions;
  bool default_partitions_setup;
  bool defined_max_value;
  inline bool has_default_partititon()
  {
    return (part_type == LIST_PARTITION && defined_max_value);
  }
  bool list_of_part_fields;                  // KEY or COLUMNS PARTITIONING
  bool list_of_subpart_fields;               // KEY SUBPARTITIONING
  bool linear_hash_ind;                      // LINEAR HASH/KEY
  bool fixed;
  bool is_auto_partitioned;
  bool has_null_value;
  bool column_list;                          // COLUMNS PARTITIONING, 5.5+

  partition_info()
  : get_partition_id(NULL), get_part_partition_id(NULL),
    get_subpartition_id(NULL),
    part_field_array(NULL), subpart_field_array(NULL),
    part_charset_field_array(NULL),
    subpart_charset_field_array(NULL),
    full_part_field_array(NULL),
    part_field_buffers(NULL), subpart_field_buffers(NULL),
    restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL),
    part_expr(NULL), subpart_expr(NULL), item_free_list(NULL),
    first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL),
    bitmaps_are_initialized(FALSE),
    list_array(NULL), vers_info(NULL), err_value(0),
    part_info_string(NULL),
    curr_part_elem(NULL), current_partition(NULL),
    curr_list_object(0), num_columns(0), table(NULL),
    default_engine_type(NULL),
    part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION),
    part_info_len(0),
    num_parts(0), num_subparts(0),
    count_curr_subparts(0),
    num_list_values(0), num_part_fields(0), num_subpart_fields(0),
    num_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0),
    key_algorithm(KEY_ALGORITHM_NONE),
    use_default_partitions(TRUE), use_default_num_partitions(TRUE),
    use_default_subpartitions(TRUE), use_default_num_subpartitions(TRUE),
    default_partitions_setup(FALSE), defined_max_value(FALSE),
    list_of_part_fields(FALSE), list_of_subpart_fields(FALSE),
    linear_hash_ind(FALSE), fixed(FALSE),
    is_auto_partitioned(FALSE),
    has_null_value(FALSE), column_list(FALSE)
  {
    all_fields_in_PF.clear_all();
    all_fields_in_PPF.clear_all();
    all_fields_in_SPF.clear_all();
    some_fields_in_PF.clear_all();
    partitions.empty();
    temp_partitions.empty();
    part_field_list.empty();
    subpart_field_list.empty();
  }
  ~partition_info() = default;

  partition_info *get_clone(THD *thd, bool empty_data_and_index_file= FALSE);
  bool set_named_partition_bitmap(const char *part_name, size_t length);
  bool set_partition_bitmaps(List<String> *partition_names);
  /* Answers the question if subpartitioning is used for a certain table */
  bool is_sub_partitioned()
  {
    return (subpart_type == NOT_A_PARTITION ?  FALSE : TRUE);
  }

  /* Returns the total number of partitions on the leaf level */
  uint get_tot_partitions()
  {
    return num_parts * (is_sub_partitioned() ? num_subparts : 1);
  }

  bool set_up_defaults_for_partitioning(THD *thd, handler *file,
                                        HA_CREATE_INFO *info,
                                        uint start_no);
  const char *find_duplicate_field();
  char *find_duplicate_name();
  bool check_engine_mix(handlerton *engine_type, bool default_engine);
  bool check_partition_info(THD *thd, handlerton **eng_type,
                            handler *file, HA_CREATE_INFO *info,
                            partition_info *add_or_reorg_part= NULL);
  void print_no_partition_found(TABLE *table, myf errflag);
  void print_debug(const char *str, uint*);
  Item* get_column_item(Item *item, Field *field);
  int fix_partition_values(THD *thd,
                           part_elem_value *val,
                           partition_element *part_elem);
  bool fix_column_value_functions(THD *thd,
                                  part_elem_value *val,
                                  uint part_id);
  bool fix_parser_data(THD *thd);
  int add_max_value(THD *thd);
  void init_col_val(part_column_list_val *col_val, Item *item);
  int reorganize_into_single_field_col_val(THD *thd);
  part_column_list_val *add_column_value(THD *thd);
  bool set_part_expr(THD *thd, Item *item_ptr, bool is_subpart);
  bool set_up_charset_field_preps(THD *thd);
  bool check_partition_field_length();
  bool init_column_part(THD *thd);
  bool add_column_list_value(THD *thd, Item *item);
  partition_element *get_part_elem(const char *partition_name, char *file_name,
                                   size_t file_name_size, uint32 *part_id);
  void report_part_expr_error(bool use_subpart_expr);
  bool has_same_partitioning(partition_info *new_part_info);
  bool error_if_requires_values() const;
private:
  bool set_up_default_partitions(THD *thd, handler *file, HA_CREATE_INFO *info,
                                 uint start_no);
  bool set_up_default_subpartitions(THD *thd, handler *file,
                                    HA_CREATE_INFO *info);
  char *create_default_partition_names(THD *thd, uint part_no, uint num_parts,
                                       uint start_no);
  char *create_default_subpartition_name(THD *thd, uint subpart_no,
                                         const char *part_name);
  bool prune_partition_bitmaps(List<String> *partition_names); // set_read_partitions() in 8.0
  bool add_named_partition(const char *part_name, size_t length);
public:
  bool has_unique_name(partition_element *element);
  bool field_in_partition_expr(Field *field) const;

  bool vers_init_info(THD *thd);
  bool vers_set_interval(THD *thd, Item *interval,
                         interval_type int_type, Item *starts,
                         const char *table_name);
  bool vers_set_limit(ulonglong limit)
  {
    DBUG_ASSERT(part_type == VERSIONING_PARTITION);
    vers_info->limit= limit;
    return !limit;
  }
  bool vers_require_hist_part(THD *thd) const
  {
    return part_type == VERSIONING_PARTITION &&
      thd->lex->vers_history_generating();
  }
  int vers_set_hist_part(THD *thd);
  void vers_check_limit(THD *thd);
  bool vers_fix_field_list(THD *thd);
  void vers_update_el_ids();
  partition_element *get_partition(uint part_id)
  {
    List_iterator<partition_element> it(partitions);
    partition_element *el;
    while ((el= it++))
    {
      if (el->id == part_id)
        return el;
    }
    return NULL;
  }
  uint next_part_no(uint new_parts) const;
};

uint32 get_next_partition_id_range(struct st_partition_iter* part_iter);
bool check_partition_dirs(partition_info *part_info);

/* Initialize the iterator to return a single partition with given part_id */

static inline void init_single_partition_iterator(uint32 part_id,
                                           PARTITION_ITERATOR *part_iter)
{
  part_iter->part_nums.start= part_iter->part_nums.cur= part_id;
  part_iter->part_nums.end= part_id+1;
  part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
  part_iter->ret_default_part= part_iter->ret_default_part_orig= FALSE;
  part_iter->get_next= get_next_partition_id_range;
}

/* Initialize the iterator to enumerate all partitions */
static inline
void init_all_partitions_iterator(partition_info *part_info,
                                  PARTITION_ITERATOR *part_iter)
{
  part_iter->part_nums.start= part_iter->part_nums.cur= 0;
  part_iter->part_nums.end= part_info->num_parts;
  part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
  part_iter->ret_default_part= part_iter->ret_default_part_orig= FALSE;
  part_iter->get_next= get_next_partition_id_range;
}


/**
  @brief Update part_field_list by row_end field name

  @returns true on error; false on success
*/
inline
bool partition_info::vers_fix_field_list(THD * thd)
{
  if (!table->versioned())
  {
    // frm must be corrupted, normally CREATE/ALTER TABLE checks for that
    my_error(ER_FILE_CORRUPT, MYF(0), table->s->path.str);
    return true;
  }
  DBUG_ASSERT(part_type == VERSIONING_PARTITION);
  DBUG_ASSERT(table->versioned(VERS_TIMESTAMP));

  Field *row_end= table->vers_end_field();
  // needed in handle_list_of_fields()
  row_end->flags|= GET_FIXED_FIELDS_FLAG;
  Name_resolution_context *context= &thd->lex->current_select->context;
  Item *row_end_item= new (thd->mem_root) Item_field(thd, context, row_end);
  Item *row_end_ts= new (thd->mem_root) Item_func_unix_timestamp(thd, row_end_item);
  set_part_expr(thd, row_end_ts, false);

  return false;
}


/**
  @brief Update partition_element's id

  @returns true on error; false on success
*/
inline
void partition_info::vers_update_el_ids()
{
  DBUG_ASSERT(part_type == VERSIONING_PARTITION);
  DBUG_ASSERT(table->versioned(VERS_TIMESTAMP));

  List_iterator<partition_element> it(partitions);
  partition_element *el;
  for(uint32 id= 0; ((el= it++)); id++)
  {
    DBUG_ASSERT(el->type != partition_element::CONVENTIONAL);
    /* Newly added element is inserted before AS_OF_NOW. */
    if (el->id == UINT_MAX32 || el->type == partition_element::CURRENT)
    {
      el->id= id;
      if (el->type == partition_element::CURRENT)
        break;
    }
  }
}


inline
bool make_partition_name(char *move_ptr, uint i)
{
  int res= snprintf(move_ptr, MAX_PART_NAME_SIZE + 1, "p%u", i);
  return res < 0 || res > MAX_PART_NAME_SIZE;
}


#ifdef WITH_PARTITION_STORAGE_ENGINE
inline
uint partition_info::next_part_no(uint new_parts) const
{
  if (part_type != VERSIONING_PARTITION)
    return num_parts;
  DBUG_ASSERT(new_parts > 0);
  /* Choose first non-occupied name suffix */
  uint32 suffix= num_parts - 1;
  DBUG_ASSERT(suffix > 0);
  char part_name[MAX_PART_NAME_SIZE + 1];
  List_iterator_fast<partition_element> it(table->part_info->partitions);
  for (uint cur_part= 0; cur_part < new_parts; ++cur_part, ++suffix)
  {
    uint32 cur_suffix= suffix;
    if (make_partition_name(part_name, suffix))
      return 0;
    partition_element *el;
    it.rewind();
    while ((el= it++))
    {
      if (0 == my_strcasecmp(&my_charset_latin1, el->partition_name, part_name))
      {
        if (make_partition_name(part_name, ++suffix))
          return 0;
        it.rewind();
      }
    }
    if (cur_part > 0 && suffix > cur_suffix)
      cur_part= 0;
  }
  return suffix - new_parts;
}
#endif

#endif /* PARTITION_INFO_INCLUDED */
server/private/sql_join_cache.h000064400000137035150400263750012651 0ustar00/*
   Copyright (c) 2011, 2012, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*
  This file contains declarations for implementations
  of block based join algorithms
*/

#define JOIN_CACHE_INCREMENTAL_BIT           1
#define JOIN_CACHE_HASHED_BIT                2
#define JOIN_CACHE_BKA_BIT                   4

/* 
  Categories of data fields of variable length written into join cache buffers.
  The value of any of these fields is written into cache together with the
  prepended length of the value.     
*/
#define CACHE_BLOB      1        /* blob field  */
#define CACHE_STRIPPED  2        /* field stripped of trailing spaces */
#define CACHE_VARSTR1   3        /* short string value (length takes 1 byte) */ 
#define CACHE_VARSTR2   4        /* long string value (length takes 2 bytes) */
#define CACHE_ROWID     5        /* ROWID field */

/*
  The CACHE_FIELD structure used to describe fields of records that
  are written into a join cache buffer from record buffers and backward.
*/
typedef struct st_cache_field {
  uchar *str;   /**< buffer from/to where the field is to be copied */ 
  uint length;  /**< maximal number of bytes to be copied from/to str */
  /* 
    Field object for the moved field
    (0 - for a flag field, see JOIN_CACHE::create_flag_fields).
  */
  Field *field;
  uint type;    /**< category of the of the copied field (CACHE_BLOB et al.) */
  /* 
    The number of the record offset value for the field in the sequence
    of offsets placed after the last field of the record. These
    offset values are used to access fields referred to from other caches.
    If the value is 0 then no offset for the field is saved in the
    trailing sequence of offsets.
  */ 
  uint referenced_field_no; 
  /* The remaining structure fields are used as containers for temp values */
  uint blob_length; /**< length of the blob to be copied */
  uint offset;      /**< field offset to be saved in cache buffer */
} CACHE_FIELD;


class JOIN_TAB_SCAN;

class EXPLAIN_BKA_TYPE;

/*
  JOIN_CACHE is the base class to support the implementations of 
  - Block Nested Loop (BNL) Join Algorithm,
  - Block Nested Loop Hash (BNLH) Join Algorithm,
  - Batched Key Access (BKA) Join Algorithm.

  The first algorithm is supported by the derived class JOIN_CACHE_BNL,
  the second algorithm is supported by the derived class JOIN_CACHE_BNLH,
  while the third algorithm is implemented in two variant supported by
  the classes JOIN_CACHE_BKA and JOIN_CACHE_BKAH.
  These three algorithms have a lot in common. Each of them first accumulates
  the records of the left join operand in a join buffer and then searches for
  matching rows of the second operand for all accumulated records.
  For the first two algorithms this strategy saves on logical I/O operations:
  the entire set of records from the join buffer requires only one look-through
  of the records provided by the second operand. 
  For the third algorithm the accumulation of records allows to optimize
  fetching rows of the second operand from disk for some engines (MyISAM, 
  InnoDB), or to minimize the number of round-trips between the Server and
  the engine nodes.        
*/ 

class JOIN_CACHE :public Sql_alloc
{

private:

  /* Size of the offset of a record from the cache */   
  uint size_of_rec_ofs;    
  /* Size of the length of a record in the cache */
  uint size_of_rec_len;
  /* Size of the offset of a field within a record in the cache */   
  uint size_of_fld_ofs;

  /* This structure is used only for explain, not for execution */
  bool for_explain_only;

protected:
       
  /* 3 functions below actually do not use the hidden parameter 'this' */ 

  /* Calculate the number of bytes used to store an offset value */
  uint offset_size(size_t len)
  { return (len < 256 ? 1 : len < 256*256 ? 2 : 4); }

  /* Get the offset value that takes ofs_sz bytes at the position ptr */
  ulong get_offset(uint ofs_sz, uchar *ptr)
  {
    switch (ofs_sz) {
    case 1: return uint(*ptr);
    case 2: return uint2korr(ptr);
    case 4: return uint4korr(ptr);
    }
    return 0;
  }

  /* Set the offset value ofs that takes ofs_sz bytes at the position ptr */ 
  void store_offset(uint ofs_sz, uchar *ptr, ulong ofs)
  {
    switch (ofs_sz) {
    case 1: *ptr= (uchar) ofs; return;
    case 2: int2store(ptr, (uint16) ofs); return;
    case 4: int4store(ptr, (uint32) ofs); return;
    }
  }
  size_t calc_avg_record_length();
  
  /* 
    The maximum total length of the fields stored for a record in the cache.
    For blob fields only the sizes of the blob lengths are taken into account. 
  */
  uint length;

  /* 
    Representation of the executed multi-way join through which all needed
    context can be accessed.  
  */   
  JOIN *join;  

  /*
    JOIN_TAB of the first table that can have it's fields in the join cache. 
    That is, tables in the [start_tab, tab) range can have their fields in the
    join cache. 
    If a join tab in the range represents an SJM-nest, then all tables from the
    nest can have their fields in the join cache, too.
  */
  JOIN_TAB *start_tab;

  /* 
    The total number of flag and data fields that can appear in a record
    written into the cache. Fields with null values are always skipped 
    to save space. 
  */
  uint fields;

  /* 
    The total number of flag fields in a record put into the cache. They are
    used for table null bitmaps, table null row flags, and an optional match
    flag. Flag fields go before other fields in a cache record with the match
    flag field placed always at the very beginning of the record.
  */
  uint flag_fields;

  /* The total number of blob fields that are written into the cache */ 
  uint blobs;

  /* 
    The total number of fields referenced from field descriptors for other join
    caches. These fields are used to construct key values.
    When BKA join algorithm is employed the constructed key values serve to
    access matching rows with index lookups.
    The key values are put into a hash table when the BNLH join algorithm
    is employed and when BKAH is used for the join operation. 
  */   
  uint referenced_fields;
   
  /* 
    The current number of already created data field descriptors.
    This number can be useful for implementations of the init methods.  
  */
  uint data_field_count; 

  /* 
    The current number of already created pointers to the data field
    descriptors. This number can be useful for implementations of
    the init methods.  
  */
  uint data_field_ptr_count;
 
  /* 
    Array of the descriptors of fields containing 'fields' elements.
    These are all fields that are stored for a record in the cache. 
  */
  CACHE_FIELD *field_descr;

  /* 
    Array of pointers to the blob descriptors that contains 'blobs' elements.
  */
  CACHE_FIELD **blob_ptr;

  /* 
    This flag indicates that records written into the join buffer contain
    a match flag field.
    This is set to true for the first inner table of an outer join or a
    semi-join.
    The flag must be set by the init method.
    Currently any implementation of the virtial init method calls
    the function JOIN_CACHE::calc_record_fields() to set this flag.
  */
  bool with_match_flag;
  /*
    This flag indicates that any record is prepended with the length of the
    record which allows us to skip the record or part of it without reading.
  */
  bool with_length;

  /* 
    The maximal number of bytes used for a record representation in
    the cache excluding the space for blob data. 
    For future derived classes this representation may contains some
    redundant info such as a key value associated with the record.     
  */
  uint pack_length;
  /* 
    The value of pack_length incremented by the total size of all 
    pointers of a record in the cache to the blob data. 
  */
  uint pack_length_with_blob_ptrs;

  /* 
    The total size of the record base prefix. The base prefix of record may
    include the following components:
     - the length of the record
     - the link to a record in a previous buffer.
    Each record in the buffer are supplied with the same set of the components.
  */
  uint base_prefix_length;

  /*
    The expected length of a record in the join buffer together with     
    all prefixes and postfixes
  */
  size_t avg_record_length;

  /* The expected size of the space per record in the auxiliary buffer */
  size_t avg_aux_buffer_incr;

  /* Pointer to the beginning of the join buffer */
  uchar *buff;         
  /* 
    Size of the entire memory allocated for the join buffer.
    Part of this memory may be reserved for the auxiliary buffer.
  */ 
  size_t buff_size;
  /* The minimal join buffer size when join buffer still makes sense to use */
  size_t min_buff_size;
  /* The maximum expected size if the join buffer to be used */
  size_t max_buff_size;
  /* Size of the auxiliary buffer */ 
  size_t aux_buff_size;

  /* The number of records put into the join buffer */ 
  size_t records;
  /* 
    The number of records in the fully refilled join buffer of
    the minimal size equal to min_buff_size
  */
  size_t min_records;

  /* 
    Pointer to the current position in the join buffer.
    This member is used both when writing to buffer and
    when reading from it.
  */
  uchar *pos;
  /* 
    Pointer to the first free position in the join buffer,
    right after the last record into it.
  */
  uchar *end_pos; 

  /* 
    Pointer to the beginning of the first field of the current read/write
    record from the join buffer. The value is adjusted by the 
    get_record/put_record functions.
  */
  uchar *curr_rec_pos;
  /* 
    Pointer to the beginning of the first field of the last record
    from the join buffer.
  */
  uchar *last_rec_pos;

  /* 
    Flag is set if the blob data for the last record in the join buffer
    is in record buffers rather than in the join cache.
  */
  bool last_rec_blob_data_is_in_rec_buff;

  /* 
    Pointer to the position to the current record link. 
    Record links are used only with linked caches. Record links allow to set
    connections between parts of one join record that are stored in different
    join buffers.
    In the simplest case a record link is just a pointer to the beginning of
    the record stored in the buffer.
    In a more general case a link could be a reference to an array of pointers
    to records in the buffer.
  */
  uchar *curr_rec_link;

  /* 
    This flag is set to TRUE if join_tab is the first inner table of an outer
    join and  the latest record written to the join buffer is detected to be
    null complemented after checking on conditions over the outer tables for
    this outer join operation
  */ 
  bool last_written_is_null_compl;

  /*
    The number of fields put in the join buffer of the join cache that are
    used in building keys to access the table join_tab
  */
  uint local_key_arg_fields;
  /* 
    The total number of the fields in the previous caches that are used
    in building keys to access the table join_tab
  */
  uint external_key_arg_fields;

  /* 
    This flag indicates that the key values will be read directly from the join
    buffer. It will save us building key values in the key buffer.
  */
  bool use_emb_key;
  /* The length of an embedded key value */ 
  uint emb_key_length;

  /* This flag is used only when 'not exists' optimization can be applied */
  bool not_exists_opt_is_applicable;

  /*
    This object provides the methods to iterate over records of
    the joined table join_tab when looking for join matches between
    records from join buffer and records from join_tab.
    BNL and BNLH join algorithms retrieve all records from join_tab,
    while BKA/BKAH algorithm iterates only over those records from
    join_tab that can be accessed by look-ups with join keys built
    from records in join buffer.  
  */
  JOIN_TAB_SCAN *join_tab_scan;

  void calc_record_fields();     
  void collect_info_on_key_args();
  int alloc_fields();
  void create_flag_fields();
  void create_key_arg_fields();
  void create_remaining_fields();
  void set_constants();
  int alloc_buffer();

  /* Shall reallocate the join buffer */
  virtual int realloc_buffer();
  
  /* Check the possibility to read the access keys directly from join buffer */ 
  bool check_emb_key_usage();

  uint get_size_of_rec_offset() { return size_of_rec_ofs; }
  uint get_size_of_rec_length() { return size_of_rec_len; }
  uint get_size_of_fld_offset() { return size_of_fld_ofs; }

  uchar *get_rec_ref(uchar *ptr)
  {
    return buff+get_offset(size_of_rec_ofs, ptr-size_of_rec_ofs);
  }
  ulong get_rec_length(uchar *ptr)
  { 
    return (ulong) get_offset(size_of_rec_len, ptr);
  }
  ulong get_fld_offset(uchar *ptr)
  { 
    return (ulong) get_offset(size_of_fld_ofs, ptr);
  }

  void store_rec_ref(uchar *ptr, uchar* ref)
  {
    store_offset(size_of_rec_ofs, ptr-size_of_rec_ofs, (ulong) (ref-buff));
  }
  void store_rec_length(uchar *ptr, ulong len)
  {
    store_offset(size_of_rec_len, ptr, len);
  }
  void store_fld_offset(uchar *ptr, ulong ofs)
  {
    store_offset(size_of_fld_ofs, ptr, ofs);
  }

  /* Write record fields and their required offsets into the join buffer */ 
  uint write_record_data(uchar *link, bool *is_full);

  /* Get the total length of all prefixes of a record in the join buffer */ 
  virtual uint get_prefix_length() { return base_prefix_length; }
  /* Get maximum total length of all affixes of a record in the join buffer */
  virtual uint get_record_max_affix_length(); 

  /* 
    Shall get maximum size of the additional space per record used for
    record keys
  */
  virtual uint get_max_key_addon_space_per_record() { return 0; }

  /* 
    This method must determine for how much the auxiliary buffer should be
    incremented when a new record is added to the join buffer.
    If no auxiliary buffer is needed the function should return 0.
  */
  virtual uint aux_buffer_incr(size_t recno);

  /* Shall calculate how much space is remaining in the join buffer */ 
  virtual size_t rem_space() 
  { 
    return MY_MAX(buff_size-(end_pos-buff)-aux_buff_size,0);
  }

  /* 
    Shall calculate how much space is taken by allocation of the key
    for a record in the join buffer
  */
  virtual uint extra_key_length() { return 0; }

  /*  Read all flag and data fields of a record from the join buffer */
  uint read_all_record_fields();
  
  /* Read all flag fields of a record from the join buffer */
  uint read_flag_fields();

  /* Read a data record field from the join buffer */
  uint read_record_field(CACHE_FIELD *copy, bool last_record);

  /* Read a referenced field from the join buffer */
  bool read_referenced_field(CACHE_FIELD *copy, uchar *rec_ptr, uint *len);

  /* 
    Shall skip record from the join buffer if its match flag
    is set to MATCH_FOUND
 */
  virtual bool skip_if_matched();

  /* 
    Shall skip record from the join buffer if its match flag
    commands to do so
  */
  virtual bool skip_if_not_needed_match();

  /* 
    True if rec_ptr points to the record whose blob data stay in
    record buffers
  */
  bool blob_data_is_in_rec_buff(uchar *rec_ptr)
  {
    return rec_ptr == last_rec_pos && last_rec_blob_data_is_in_rec_buff;
  }

  /* Find matches from the next table for records from the join buffer */
  virtual enum_nested_loop_state join_matching_records(bool skip_last);

  /* Shall set an auxiliary buffer up (currently used only by BKA joins) */
  virtual int setup_aux_buffer(HANDLER_BUFFER &aux_buff) 
  {
    DBUG_ASSERT(0);
    return 0;
  }

  /*
    Shall get the number of ranges in the cache buffer passed
    to the MRR interface
  */  
  virtual uint get_number_of_ranges_for_mrr() { return 0; };

  /* 
    Shall prepare to look for records from the join cache buffer that would
    match the record of the joined table read into the record buffer
  */ 
  virtual bool prepare_look_for_matches(bool skip_last)= 0;
  /* 
    Shall return a pointer to the record from join buffer that is checked
    as the next candidate for a match with the current record from join_tab.
    Each implementation of this virtual function should bare in mind
    that the record position it returns shall be exactly the position
    passed as the parameter to the implementations of the virtual functions 
    skip_next_candidate_for_match and read_next_candidate_for_match.
  */   
  virtual uchar *get_next_candidate_for_match()= 0;
  /*
    Shall check whether the given record from the join buffer has its match
    flag settings commands to skip the record in the buffer.
  */
  virtual bool skip_next_candidate_for_match(uchar *rec_ptr)= 0;
  /*
    Shall read the given record from the join buffer into the
    the corresponding record buffer
  */
  virtual void read_next_candidate_for_match(uchar *rec_ptr)= 0;

  /* 
    Shall return the location of the association label returned by 
    the multi_read_range_next function for the current record loaded
    into join_tab's record buffer
  */
  virtual uchar **get_curr_association_ptr() { return 0; };

  /* Add null complements for unmatched outer records from the join buffer */
  virtual enum_nested_loop_state join_null_complements(bool skip_last);

  /* Restore the fields of the last record from the join buffer */
  virtual void restore_last_record();

  /* Set match flag for a record in join buffer if it has not been set yet */
  bool set_match_flag_if_none(JOIN_TAB *first_inner, uchar *rec_ptr);

  enum_nested_loop_state generate_full_extensions(uchar *rec_ptr);

  /* Check matching to a partial join record from the join buffer */
  bool check_match(uchar *rec_ptr);

  /* 
    This constructor creates an unlinked join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter.
  */   
  JOIN_CACHE(JOIN *j, JOIN_TAB *tab)
  {
    join= j;
    join_tab= tab;
    prev_cache= next_cache= 0;
    buff= 0;
    min_buff_size= max_buff_size= 0;            // Caches
    not_exists_opt_is_applicable= false;
  }

  /* 
    This constructor creates a linked join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter. The parameter 'prev' specifies the previous
    cache object to which this cache is linked.
  */   
  JOIN_CACHE(JOIN *j, JOIN_TAB *tab, JOIN_CACHE *prev)   
  {  
    join= j;
    join_tab= tab;
    next_cache= 0;
    prev_cache= prev;
    buff= 0;
    min_buff_size= max_buff_size= 0;            // Caches
    if (prev)
      prev->next_cache= this;
  }

public:
 
  /*
    The enumeration type Join_algorithm includes a mnemonic constant for
    each join algorithm that employs join buffers
  */

  enum Join_algorithm
  { 
    BNL_JOIN_ALG,     /* Block Nested Loop Join algorithm                  */
    BNLH_JOIN_ALG,    /* Block Nested Loop Hash Join algorithm             */
    BKA_JOIN_ALG,     /* Batched Key Access Join algorithm                 */
    BKAH_JOIN_ALG    /* Batched Key Access with Hash Table Join Algorithm */
  };

  /* 
    The enumeration type Match_flag describes possible states of the match flag
    field  stored for the records of the first inner tables of outer joins and
    semi-joins in the cases when the first match strategy is used for them.
    When a record with match flag field is written into the join buffer the
    state of the field usually is MATCH_NOT_FOUND unless this is a record of the
    first inner table of the outer join for which the on precondition (the
    condition from on expression over outer tables)  has turned out not to be 
    true. In the last case the state of the match flag is MATCH_IMPOSSIBLE.
    The state of the match flag field is changed to MATCH_FOUND as soon as
    the first full matching combination of inner tables of the outer join or
    the semi-join is discovered. 
  */
  enum Match_flag { MATCH_NOT_FOUND, MATCH_FOUND, MATCH_IMPOSSIBLE };

  /* Table to be joined with the partial join records from the cache */ 
  JOIN_TAB *join_tab;

  /* Pointer to the previous join cache if there is any */
  JOIN_CACHE *prev_cache;
  /* Pointer to the next join cache if there is any */
  JOIN_CACHE *next_cache;

  /* Shall initialize the join cache structure */ 
  virtual int init(bool for_explain);

  /* Get the current size of the cache join buffer */ 
  size_t get_join_buffer_size() { return buff_size; }
  /* Set the size of the cache join buffer to a new value */
  void set_join_buffer_size(size_t sz) { buff_size= sz; }

  /* Get the minimum possible size of the cache join buffer */
  size_t get_min_join_buffer_size();
  /* Get the maximum possible size of the cache join buffer */ 
  size_t get_max_join_buffer_size(bool optimize_buff_size,
                                  size_t min_buffer_size_arg);

  /* Shrink the size if the cache join buffer in a given ratio */
  bool shrink_join_buffer_in_ratio(ulonglong n, ulonglong d);

  /*  Shall return the type of the employed join algorithm */
  virtual enum Join_algorithm get_join_alg()= 0;

  /* 
    The function shall return TRUE only when there is a key access
    to the join table
  */
  virtual bool is_key_access()= 0;

  /* Shall reset the join buffer for reading/writing */
  virtual void reset(bool for_writing);

  /* 
    This function shall add a record into the join buffer and return TRUE
    if it has been decided that it should be the last record in the buffer.
  */ 
  virtual bool put_record();

  /* 
    This function shall read the next record into the join buffer and return
    TRUE if there is no more next records.
  */ 
  virtual bool get_record();

  /* 
    This function shall read the record at the position rec_ptr
    in the join buffer
  */ 
  virtual void get_record_by_pos(uchar *rec_ptr);

  /* Shall return the value of the match flag for the positioned record */
  virtual enum Match_flag get_match_flag_by_pos(uchar *rec_ptr);

  /*
    Shall return the value of the match flag for the positioned record
    from the join buffer attached to the specified table
  */
  virtual enum Match_flag
    get_match_flag_by_pos_from_join_buffer(uchar *rec_ptr, JOIN_TAB *tab);

  /* Shall return the position of the current record */
  virtual uchar *get_curr_rec() { return curr_rec_pos; }

  /* Shall set the current record link */
  virtual void set_curr_rec_link(uchar *link) { curr_rec_link= link; }

  /* Shall return the current record link */
  virtual uchar *get_curr_rec_link()
  { 
    return (curr_rec_link ? curr_rec_link : get_curr_rec());
  }
     
  /* Join records from the join buffer with records from the next join table */ 
  enum_nested_loop_state join_records(bool skip_last);

  /* Add a comment on the join algorithm employed by the join cache */
  virtual bool save_explain_data(EXPLAIN_BKA_TYPE *explain);

  THD *thd();

  virtual ~JOIN_CACHE() = default;
  void reset_join(JOIN *j) { join= j; }
  void free()
  { 
    my_free(buff);
    buff= 0;
  }   
  
  friend class JOIN_CACHE_HASHED;
  friend class JOIN_CACHE_BNL;
  friend class JOIN_CACHE_BKA;
  friend class JOIN_TAB_SCAN;
  friend class JOIN_TAB_SCAN_MRR;

};


/*
  The class JOIN_CACHE_HASHED is the base class for the classes
  JOIN_CACHE_HASHED_BNL and JOIN_CACHE_HASHED_BKA. The first of them supports
  an implementation of Block Nested Loop Hash (BNLH) Join Algorithm,
  while the second is used for a variant of the BKA Join algorithm that performs
  only one lookup for any records from join buffer with the same key value. 
  For a join cache of this class the records from the join buffer that have
  the same access key are linked into a chain attached to a key entry structure
  that either itself contains the key value, or, in the case when the keys are
  embedded, refers to its occurrence in one of the records from the chain.
  To build the chains with the same keys a hash table is employed. It is placed
  at the very end of the join buffer. The array of hash entries is allocated
  first at the very bottom of the join buffer, while key entries are placed
  before this array.
  A hash entry contains a header of the list of the key entries with the same
  hash value. 
  Each key entry is a structure of the following type:
    struct st_join_cache_key_entry {
      union { 
        uchar[] value;
        cache_ref *value_ref; // offset from the beginning of the buffer
      } hash_table_key;
      key_ref next_key; // offset backward from the beginning of hash table
      cache_ref *last_rec // offset from the beginning of the buffer
    }
  The references linking the records in a chain are always placed at the very
  beginning of the record info stored in the join buffer. The records are 
  linked in a circular list. A new record is always added to the end of this 
  list.

  The following picture represents a typical layout for the info stored in the
  join buffer of a join cache object of the JOIN_CACHE_HASHED class.
    
  buff
  V
  +----------------------------------------------------------------------------+
  |     |[*]record_1_1|                                                        |
  |     ^ |                                                                    |
  |     | +--------------------------------------------------+                 |
  |     |                           |[*]record_2_1|          |                 |
  |     |                           ^ |                      V                 |
  |     |                           | +------------------+   |[*]record_1_2|   |
  |     |                           +--------------------+-+   |               |
  |+--+ +---------------------+                          | |   +-------------+ |
  ||  |                       |                          V |                 | |
  |||[*]record_3_1|         |[*]record_1_3|              |[*]record_2_2|     | |
  ||^                       ^                            ^                   | |
  ||+----------+            |                            |                   | |
  ||^          |            |<---------------------------+-------------------+ |
  |++          | | ... mrr  |   buffer ...           ... |     |               |
  |            |            |                            |                     |
  |      +-----+--------+   |                      +-----|-------+             |
  |      V     |        |   |                      V     |       |             |
  ||key_3|[/]|[*]|      |   |                |key_2|[/]|[*]|     |             |
  |                   +-+---|-----------------------+            |             |
  |                   V |   |                       |            |             |
  |             |key_1|[*]|[*]|         |   | ... |[*]|   ...  |[*]|  ...  |   |
  +----------------------------------------------------------------------------+
                                        ^           ^            ^
                                        |           i-th entry   j-th entry
                                        hash table

  i-th hash entry:
    circular record chain for key_1:
      record_1_1
      record_1_2
      record_1_3 (points to record_1_1)
    circular record chain for key_3:
      record_3_1 (points to itself)

  j-th hash entry:
    circular record chain for key_2:
      record_2_1
      record_2_2 (points to record_2_1)

*/

class JOIN_CACHE_HASHED: public JOIN_CACHE
{

  typedef uint (JOIN_CACHE_HASHED::*Hash_func) (uchar *key, uint key_len);
  typedef bool (JOIN_CACHE_HASHED::*Hash_cmp_func) (uchar *key1, uchar *key2,
                                                    uint key_len);
  
private:

  /* Size of the offset of a key entry in the hash table */
  uint size_of_key_ofs;

  /* 
    Length of the key entry in the hash table.
    A key entry either contains the key value, or it contains a reference
    to the key value if use_emb_key flag is set for the cache.
  */ 
  uint key_entry_length;
 
  /* The beginning of the hash table in the join buffer */
  uchar *hash_table;
  /* Number of hash entries in the hash table */
  uint hash_entries;


  /* The position of the currently retrieved key entry in the hash table */
  uchar *curr_key_entry;

  /* The offset of the data fields from the beginning of the record fields */
  uint data_fields_offset;

  inline uint get_hash_idx_simple(uchar *key, uint key_len);
  inline uint get_hash_idx_complex(uchar *key, uint key_len);

  inline bool equal_keys_simple(uchar *key1, uchar *key2, uint key_len);
  inline bool equal_keys_complex(uchar *key1, uchar *key2, uint key_len);

  int init_hash_table();
  void cleanup_hash_table();
  
protected:

  /* 
    Index info on the TABLE_REF object used by the hash join
    to look for matching records
  */    
  KEY *ref_key_info;
  /* 
    Number of the key parts the TABLE_REF object used by the hash join
    to look for matching records
  */    
  uint ref_used_key_parts;

  /*
    The hash function used in the hash table,
    usually set by the init() method
  */ 
  Hash_func hash_func;
  /*
    The function to check whether two key entries in the hash table
    are equal or not, usually set by the init() method
  */ 
  Hash_cmp_func hash_cmp_func;

  /* 
    Length of a key value.
    It is assumed that all key values have the same length.
  */
  uint key_length;
  /* Buffer to store key values for probing */
  uchar *key_buff;

  /* Number of key entries in the hash table (number of distinct keys) */
  uint key_entries;

  /* The position of the last key entry in the hash table */
  uchar *last_key_entry;

  /* 
    The offset of the record fields from the beginning of the record
    representation. The record representation starts with a reference to
    the next record in the key record chain followed by the length of
    the trailing record data followed by a reference to the record segment
    in the previous cache, if any, followed by the record fields.
  */ 
  uint rec_fields_offset;

  uint get_size_of_key_offset() { return size_of_key_ofs; }

  /* 
    Get the position of the next_key_ptr field pointed to by 
    a linking reference stored at the position key_ref_ptr. 
    This reference is actually the offset backward from the
    beginning of hash table.
  */  
  uchar *get_next_key_ref(uchar *key_ref_ptr)
  {
    return hash_table-get_offset(size_of_key_ofs, key_ref_ptr);
  }

  /* 
    Store the linking reference to the next_key_ptr field at 
    the position key_ref_ptr. The position of the next_key_ptr
    field is pointed to by ref. The stored reference is actually
    the offset backward from the beginning of the hash table.
  */  
  void store_next_key_ref(uchar *key_ref_ptr, uchar *ref)
  {
    store_offset(size_of_key_ofs, key_ref_ptr, (ulong) (hash_table-ref));
  }     
  
  /* 
    Check whether the reference to the next_key_ptr field at the position
    key_ref_ptr contains  a nil value.
  */
  bool is_null_key_ref(uchar *key_ref_ptr)
  {
    ulong nil= 0;
    return memcmp(key_ref_ptr, &nil, size_of_key_ofs ) == 0;
  } 

  /* 
    Set the reference to the next_key_ptr field at the position
    key_ref_ptr equal to nil.
  */
  void store_null_key_ref(uchar *key_ref_ptr)
  {
    ulong nil= 0;
    store_offset(size_of_key_ofs, key_ref_ptr, nil);
  } 

  uchar *get_next_rec_ref(uchar *ref_ptr)
  {
    return buff+get_offset(get_size_of_rec_offset(), ref_ptr);
  }

  void store_next_rec_ref(uchar *ref_ptr, uchar *ref)
  {
    store_offset(get_size_of_rec_offset(), ref_ptr, (ulong) (ref-buff));
  } 

  /*
    Get the position of the embedded key value for the current
    record pointed to by get_curr_rec().
  */ 
  uchar *get_curr_emb_key()
  {
    return get_curr_rec()+data_fields_offset;
  }

  /*
    Get the position of the embedded key value pointed to by a reference
    stored at ref_ptr. The stored reference is actually the offset from
    the beginning of the join buffer.
  */  
  uchar *get_emb_key(uchar *ref_ptr)
  {
    return buff+get_offset(get_size_of_rec_offset(), ref_ptr);
  }

  /* 
    Store the reference to an embedded key at the position key_ref_ptr.
    The position of the embedded key is pointed to by ref. The stored
    reference is actually the offset from the beginning of the join buffer.
  */  
  void store_emb_key_ref(uchar *ref_ptr, uchar *ref)
  {
    store_offset(get_size_of_rec_offset(), ref_ptr, (ulong) (ref-buff));
  }
  
  /* Get the total length of all prefixes of a record in hashed join buffer */ 
  uint get_prefix_length() override 
  { 
    return base_prefix_length + get_size_of_rec_offset();
  }

  /* 
    Get maximum size of the additional space per record used for
    the hash table with record keys
  */
  uint get_max_key_addon_space_per_record() override;

  /* 
    Calculate how much space in the buffer would not be occupied by
    records, key entries and additional memory for the MMR buffer.
  */ 
  size_t rem_space() override 
  { 
    return MY_MAX(last_key_entry-end_pos-aux_buff_size,0);
  }

  /* 
    Calculate how much space is taken by allocation of the key
    entry for a record in the join buffer
  */
  uint extra_key_length() override { return key_entry_length; }

  /* 
    Skip record from a hashed join buffer if its match flag
    is set to MATCH_FOUND
  */
  bool skip_if_matched() override;

  /*
    Skip record from a hashed join buffer if its match flag setting 
    commands to do so
  */
  bool skip_if_not_needed_match() override;

  /* Search for a key in the hash table of the join buffer */
  bool key_search(uchar *key, uint key_len, uchar **key_ref_ptr);

  /* Reallocate the join buffer of a hashed join cache */
  int realloc_buffer() override;

  /* 
    This constructor creates an unlinked hashed join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter.
  */   
  JOIN_CACHE_HASHED(JOIN *j, JOIN_TAB *tab) :JOIN_CACHE(j, tab) {}

  /* 
    This constructor creates a linked hashed join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter. The parameter 'prev' specifies the previous
    cache object to which this cache is linked.
  */   
  JOIN_CACHE_HASHED(JOIN *j, JOIN_TAB *tab, JOIN_CACHE *prev) 
		    :JOIN_CACHE(j, tab, prev) {}

public:

  /* Initialize a hashed join cache */       
  int init(bool for_explain) override;

  /* Reset the buffer of a hashed join cache for reading/writing */
  void reset(bool for_writing) override;

  /* Add a record into the buffer of a hashed join cache */
  bool put_record() override;

  /* Read the next record from the buffer of a hashed join cache */
  bool get_record() override;

  /*
    Shall check whether all records in a key chain have 
    their match flags set on
  */   
  virtual bool check_all_match_flags_for_key(uchar *key_chain_ptr);

  uint get_next_key(uchar **key); 
  
  /* Get the head of the record chain attached to the current key entry */ 
  uchar *get_curr_key_chain()
  {
    return get_next_rec_ref(curr_key_entry+key_entry_length-
                            get_size_of_rec_offset());
  }
  
};


/*
  The class JOIN_TAB_SCAN is a companion class for the classes JOIN_CACHE_BNL
  and JOIN_CACHE_BNLH. Actually the class implements the iterator over the
  table joinded by BNL/BNLH join algorithm.
  The virtual functions open, next and close are called for any iteration over
  the table. The function open is called to initiate the process of the 
  iteration. The function next shall read the next record from the joined
  table. The record is read into the record buffer of the joined table.
  The record is to be matched with records from the join cache buffer. 
  The function close shall perform the finalizing actions for the iteration.
*/
   
class JOIN_TAB_SCAN: public Sql_alloc
{

private:
  /* TRUE if this is the first record from the joined table to iterate over */
  bool is_first_record;

protected:

  /* The joined table to be iterated over */
  JOIN_TAB *join_tab;
  /* The join cache used to join the table join_tab */ 
  JOIN_CACHE *cache;
  /* 
    Representation of the executed multi-way join through which
    all needed context can be accessed.  
  */   
  JOIN *join;

public:
  
  JOIN_TAB_SCAN(JOIN *j, JOIN_TAB *tab)
  {
    join= j;
    join_tab= tab;
    cache= join_tab->cache;
  }

  virtual ~JOIN_TAB_SCAN() = default;
 
  /* 
    Shall calculate the increment of the auxiliary buffer for a record
    write if such a buffer is used by the table scan object 
  */
  virtual uint aux_buffer_incr(size_t recno) { return 0; }

  /* Initiate the process of iteration over the joined table */
  virtual int open();
  /* 
    Shall read the next candidate for matches with records from 
    the join buffer.
  */
  virtual int next();
  /* 
    Perform the finalizing actions for the process of iteration
    over the joined_table.
  */ 
  virtual void close();

};

/*
  The class JOIN_CACHE_BNL is used when the BNL join algorithm is
  employed to perform a join operation   
*/

class JOIN_CACHE_BNL :public JOIN_CACHE
{
private:
  /* 
    The number of the records in the join buffer that have to be
    checked yet for a match with the current record of join_tab 
    read into the record buffer.
  */
  uint rem_records;

protected:

  bool prepare_look_for_matches(bool skip_last) override;

  uchar *get_next_candidate_for_match() override;

  bool skip_next_candidate_for_match(uchar *rec_ptr) override;

  void read_next_candidate_for_match(uchar *rec_ptr) override;

public:

  /* 
    This constructor creates an unlinked BNL join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter.
  */   
  JOIN_CACHE_BNL(JOIN *j, JOIN_TAB *tab) :JOIN_CACHE(j, tab) {}

  /* 
    This constructor creates a linked BNL join cache. The cache is to be 
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter. The parameter 'prev' specifies the previous
    cache object to which this cache is linked.
  */   
  JOIN_CACHE_BNL(JOIN *j, JOIN_TAB *tab, JOIN_CACHE *prev) 
    :JOIN_CACHE(j, tab, prev) {}

  /* Initialize the BNL cache */       
  int init(bool for_explain) override;

  enum Join_algorithm get_join_alg() override { return BNL_JOIN_ALG; }

  bool is_key_access() override { return FALSE; }

};


/*
  The class JOIN_CACHE_BNLH is used when the BNLH join algorithm is
  employed to perform a join operation   
*/

class JOIN_CACHE_BNLH :public JOIN_CACHE_HASHED
{

protected:

  /* 
    The pointer to the last record from the circular list of the records
    that  match the join key built out of the record in the join buffer for
    the join_tab table
  */
  uchar *last_matching_rec_ref_ptr;
  /*
    The pointer to the next current  record from the circular list of the
    records that match the join key built out of the record in the join buffer
    for the join_tab table. This pointer is used by the class method 
    get_next_candidate_for_match to iterate over records from the circular
    list.
  */
  uchar *next_matching_rec_ref_ptr;

  /*
    Get the chain of records from buffer matching the current candidate
    record for join
  */
  uchar *get_matching_chain_by_join_key();

  bool prepare_look_for_matches(bool skip_last) override;

  uchar *get_next_candidate_for_match() override;

  bool skip_next_candidate_for_match(uchar *rec_ptr) override;

  void read_next_candidate_for_match(uchar *rec_ptr) override;

public:

  /* 
    This constructor creates an unlinked BNLH join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter.
  */   
  JOIN_CACHE_BNLH(JOIN *j, JOIN_TAB *tab) : JOIN_CACHE_HASHED(j, tab) {}

  /* 
    This constructor creates a linked BNLH join cache. The cache is to be 
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter. The parameter 'prev' specifies the previous
    cache object to which this cache is linked.
  */   
  JOIN_CACHE_BNLH(JOIN *j, JOIN_TAB *tab, JOIN_CACHE *prev) 
    : JOIN_CACHE_HASHED(j, tab, prev) {}

  /* Initialize the BNLH cache */       
  int init(bool for_explain) override;

  enum Join_algorithm get_join_alg() override { return BNLH_JOIN_ALG; }

  bool is_key_access() override { return TRUE; }

};


/*
  The class JOIN_TAB_SCAN_MRR is a companion class for the classes
  JOIN_CACHE_BKA and JOIN_CACHE_BKAH. Actually the class implements the
  iterator over the records from join_tab selected by BKA/BKAH join
  algorithm as the candidates to be joined. 
  The virtual functions open, next and close are called for any iteration over
  join_tab record candidates. The function open is called to initiate the
  process of the iteration. The function next shall read the next record from
  the set of the record candidates. The record is read into the record buffer
  of the joined table. The function close shall perform the finalizing actions
  for the iteration.
*/
   
class JOIN_TAB_SCAN_MRR: public JOIN_TAB_SCAN
{
  /* Interface object to generate key ranges for MRR */
  RANGE_SEQ_IF range_seq_funcs;

  /* Number of ranges to be processed by the MRR interface */
  uint ranges;

  /* Flag to to be passed to the MRR interface */ 
  uint mrr_mode;

  /* MRR buffer assotiated with this join cache */
  HANDLER_BUFFER mrr_buff;

  /* Shall initialize the MRR buffer */
  virtual void init_mrr_buff()
  {
    cache->setup_aux_buffer(mrr_buff);
  }

public:

  JOIN_TAB_SCAN_MRR(JOIN *j, JOIN_TAB *tab, uint flags, RANGE_SEQ_IF rs_funcs)
    :JOIN_TAB_SCAN(j, tab), range_seq_funcs(rs_funcs), mrr_mode(flags) {}

  uint aux_buffer_incr(size_t recno) override;

  int open() override;
 
  int next() override;

  friend class JOIN_CACHE_BKA; /* it needs to add an mrr_mode flag after JOIN_CACHE::init() call */
};

/*
  The class JOIN_CACHE_BKA is used when the BKA join algorithm is
  employed to perform a join operation   
*/

class JOIN_CACHE_BKA :public JOIN_CACHE
{
private:

  /* Flag to to be passed to the companion JOIN_TAB_SCAN_MRR object */
  uint mrr_mode;

  /* 
    This value is set to 1 by the class prepare_look_for_matches method
    and back to 0 by the class get_next_candidate_for_match method
  */
  uint rem_records;

  /*
    This field contains the current association label set by a call of
    the multi_range_read_next handler function.
    See the function JOIN_CACHE_BKA::get_curr_key_association()
  */
  uchar *curr_association;

protected:

  /* 
    Get the number of ranges in the cache buffer passed to the MRR
    interface. For each record its own range is passed.
  */
  uint get_number_of_ranges_for_mrr() override { return (uint)records; }

 /*
   Setup the MRR buffer as the space between the last record put
   into the join buffer and the very end of the join buffer 
 */
  int setup_aux_buffer(HANDLER_BUFFER &aux_buff) override
  {
    aux_buff.buffer= end_pos;
    aux_buff.buffer_end= buff+buff_size;
    return 0;
  }

  bool prepare_look_for_matches(bool skip_last) override;

  uchar *get_next_candidate_for_match() override;

  bool skip_next_candidate_for_match(uchar *rec_ptr) override;

  void read_next_candidate_for_match(uchar *rec_ptr) override;

public:

  /* 
    This constructor creates an unlinked BKA join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter.
    The MRR mode initially is set to 'flags'.
  */   
  JOIN_CACHE_BKA(JOIN *j, JOIN_TAB *tab, uint flags)
    :JOIN_CACHE(j, tab), mrr_mode(flags) {}
  /* 
    This constructor creates a linked BKA join cache. The cache is to be 
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter. The parameter 'prev' specifies the previous
    cache object to which this cache is linked.
    The MRR mode initially is set to 'flags'.
  */   
  JOIN_CACHE_BKA(JOIN *j, JOIN_TAB *tab, uint flags, JOIN_CACHE *prev)
    :JOIN_CACHE(j, tab, prev), mrr_mode(flags) {}
  
  JOIN_CACHE_BKA(JOIN_CACHE_BKA *bka)
    :JOIN_CACHE(bka->join, bka->join_tab, bka->prev_cache),
      mrr_mode(bka->mrr_mode)  {}

  uchar **get_curr_association_ptr() override { return &curr_association; }

  /* Initialize the BKA cache */       
  int init(bool for_explain) override;

  enum Join_algorithm get_join_alg() override { return BKA_JOIN_ALG; }

  bool is_key_access() override { return TRUE; }

  /* Get the key built over the next record from the join buffer */
  uint get_next_key(uchar **key);

  /* Check index condition of the joined table for a record from BKA cache */
  bool skip_index_tuple(range_id_t range_info);

  bool save_explain_data(EXPLAIN_BKA_TYPE *explain) override;
};



/*
  The class JOIN_CACHE_BKAH is used when the BKAH join algorithm is
  employed to perform a join operation   
*/

class JOIN_CACHE_BKAH :public JOIN_CACHE_BNLH
{

private:
  /* Flag to to be passed to the companion JOIN_TAB_SCAN_MRR object */
  uint mrr_mode;

  /* 
    This flag is set to TRUE if the implementation of the MRR interface cannot
    handle range association labels and does not return them to the caller of
    the multi_range_read_next handler function. E.g. the implementation of
    the MRR inteface for the Falcon engine could not return association
    labels to the caller of multi_range_read_next.
    The flag is set by JOIN_CACHE_BKA::init() and is not ever changed.
  */       
  bool no_association;

  /* 
    This field contains the association label returned by the 
    multi_range_read_next function.
    See the function JOIN_CACHE_BKAH::get_curr_key_association()
  */
  uchar *curr_matching_chain;

protected:

  uint get_number_of_ranges_for_mrr() override { return key_entries; }

  /* 
    Initialize the MRR buffer allocating some space within the join buffer.
    The entire space between the last record put into the join buffer and the
    last key entry added to the hash table is used for the MRR buffer.
  */
  int setup_aux_buffer(HANDLER_BUFFER &aux_buff) override
  {
    aux_buff.buffer= end_pos;
    aux_buff.buffer_end= last_key_entry;
    return 0;
  }

  bool prepare_look_for_matches(bool skip_last) override;

  /*
    The implementations of the methods
    - get_next_candidate_for_match
    - skip_recurrent_candidate_for_match
    - read_next_candidate_for_match
    are inherited from the JOIN_CACHE_BNLH class
  */

public:

  /* 
    This constructor creates an unlinked BKAH join cache. The cache is to be
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter.
    The MRR mode initially is set to 'flags'.
  */   
  JOIN_CACHE_BKAH(JOIN *j, JOIN_TAB *tab, uint flags) 
    :JOIN_CACHE_BNLH(j, tab), mrr_mode(flags) {}

  /* 
    This constructor creates a linked BKAH join cache. The cache is to be 
    used to join table 'tab' to the result of joining the previous tables 
    specified by the 'j' parameter. The parameter 'prev' specifies the previous
    cache object to which this cache is linked.
    The MRR mode initially is set to 'flags'.
  */   
  JOIN_CACHE_BKAH(JOIN *j, JOIN_TAB *tab, uint flags, JOIN_CACHE *prev)
    :JOIN_CACHE_BNLH(j, tab, prev), mrr_mode(flags)  {}

  JOIN_CACHE_BKAH(JOIN_CACHE_BKAH *bkah)
    :JOIN_CACHE_BNLH(bkah->join, bkah->join_tab, bkah->prev_cache),
      mrr_mode(bkah->mrr_mode)  {}

  uchar **get_curr_association_ptr() override { return &curr_matching_chain; }

  /* Initialize the BKAH cache */       
  int init(bool for_explain) override;

  enum Join_algorithm get_join_alg() override { return BKAH_JOIN_ALG; }

  /* Check index condition of the joined table for a record from BKAH cache */
  bool skip_index_tuple(range_id_t range_info);

  bool save_explain_data(EXPLAIN_BKA_TYPE *explain) override;
};
server/private/sql_type_fixedbin.h000064400000175500150400263750013417 0ustar00#ifndef SQL_TYPE_FIXEDBIN_H
#define SQL_TYPE_FIXEDBIN_H
/* Copyright (c) 2019,2021 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 */

/*
  This is a common code for plugin (?) types that are generally
  handled like strings, but have their own fixed size on-disk binary storage
  format and their own (variable size) canonical string representation.

  Examples are INET6 and UUID types.
*/

#define MYSQL_SERVER
#include "sql_class.h" // THD, SORT_FIELD_ATTR
#include "opt_range.h" // SEL_ARG, null_element
#include "sql_type_fixedbin_storage.h"

/***********************************************************************/


template<class FbtImpl> class Type_collection_fbt;

template<class FbtImpl, class TypeCollectionImpl = Type_collection_fbt<FbtImpl> >
class Type_handler_fbt: public Type_handler
{
  /* =[ internal helper classes ]=============================== */

public:
  class Fbt: public FbtImpl
  {
  protected:
    using FbtImpl::m_buffer;
    bool make_from_item(Item *item, bool warn)
    {
      if (item->type_handler() == singleton())
      {
        Native tmp(m_buffer, sizeof(m_buffer));
        bool rc= item->val_native(current_thd, &tmp);
        if (rc)
          return true;
        DBUG_ASSERT(tmp.length() == sizeof(m_buffer));
        if (tmp.ptr() != m_buffer)
          memcpy(m_buffer, tmp.ptr(), sizeof(m_buffer));
        return false;
      }
      StringBuffer<FbtImpl::max_char_length()+1> tmp;
      String *str= item->val_str(&tmp);
      return str ? make_from_character_or_binary_string(str, warn) : true;
    }

    bool character_string_to_fbt(const char *str, size_t str_length,
                                  CHARSET_INFO *cs)
    {
      if (cs->state & MY_CS_NONASCII)
      {
        char tmp[FbtImpl::max_char_length()+1];
        String_copier copier;
        uint length= copier.well_formed_copy(&my_charset_latin1, tmp, sizeof(tmp),
                                             cs, str, str_length);
        return FbtImpl::ascii_to_fbt(tmp, length);
      }
      return FbtImpl::ascii_to_fbt(str, str_length);
    }
    bool make_from_character_or_binary_string(const String *str, bool warn)
    {
      if (str->charset() != &my_charset_bin)
      {
        bool rc= character_string_to_fbt(str->ptr(), str->length(),
                                          str->charset());
        if (rc && warn)
          current_thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
                       singleton()->name().ptr(), ErrConvString(str).ptr());
        return rc;
      }
      if (str->length() != sizeof(m_buffer))
      {
        if (warn)
          current_thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
                       singleton()->name().ptr(), ErrConvString(str).ptr());
        return true;
      }
      DBUG_ASSERT(str->ptr() != m_buffer);
      memcpy(m_buffer, str->ptr(), sizeof(m_buffer));
      return false;
    }
    bool binary_to_fbt(const char *str, size_t length)
    {
      if (length != sizeof(m_buffer))
        return true;
      memcpy(m_buffer, str, length);
      return false;
    }

    Fbt() { }

  public:

     static Fbt zero()
     {
       Fbt fbt;
       fbt.set_zero();
       return fbt;
     }

     static Fbt record_to_memory(const char *ptr)
     {
       Fbt fbt;
       FbtImpl::record_to_memory(fbt.m_buffer, ptr);
       return fbt;
     }
    /*
      Check at Item's fix_fields() time if "item" can return a nullable value
      on conversion to Fbt, or conversion produces a NOT NULL Fbt value.
    */
    static bool fix_fields_maybe_null_on_conversion_to_fbt(Item *item)
    {
      if (item->maybe_null())
        return true;
      if (item->type_handler() == singleton())
        return false;
      if (!item->const_item() || item->is_expensive())
        return true;
      return Fbt_null(item, false).is_null();
    }

    /*
      Check at fix_fields() time if any of the items can return a nullable
      value on conversion to Fbt.
    */
    static bool fix_fields_maybe_null_on_conversion_to_fbt(Item **items,
                                                           uint count)
    {
      for (uint i= 0; i < count; i++)
      {
        if (Fbt::fix_fields_maybe_null_on_conversion_to_fbt(items[i]))
          return true;
      }
      return false;
    }

  public:

    Fbt(Item *item, bool *error, bool warn= true)
    {
      *error= make_from_item(item, warn);
    }
    void to_record(char *str, size_t str_size) const
    {
      DBUG_ASSERT(str_size >= sizeof(m_buffer));
      FbtImpl::memory_to_record(str, m_buffer);
    }
    bool to_binary(String *to) const
    {
      return to->copy(m_buffer, sizeof(m_buffer), &my_charset_bin);
    }
    bool to_native(Native *to) const
    {
      return to->copy(m_buffer, sizeof(m_buffer));
    }
    bool to_string(String *to) const
    {
      to->set_charset(&my_charset_latin1);
      if (to->alloc(FbtImpl::max_char_length()+1))
        return true;
      to->length((uint32) FbtImpl::to_string(const_cast<char*>(to->ptr()),
                                             FbtImpl::max_char_length()+1));
      return false;
    }
    int cmp(const Binary_string &other) const
    {
      return FbtImpl::cmp(FbtImpl::to_lex_cstring(), other.to_lex_cstring());
    }
    int cmp(const Fbt &other) const
    {
      return FbtImpl::cmp(FbtImpl::to_lex_cstring(), other.to_lex_cstring());
    }
  };

  class Fbt_null: public Fbt, public Null_flag
  {
  public:
    // Initialize from a text representation
    Fbt_null(const char *str, size_t length, CHARSET_INFO *cs)
     :Null_flag(Fbt::character_string_to_fbt(str, length, cs)) { }
    Fbt_null(const String &str)
     :Fbt_null(str.ptr(), str.length(), str.charset()) { }
    // Initialize from a binary representation
    Fbt_null(const char *str, size_t length)
     :Null_flag(Fbt::binary_to_fbt(str, length)) { }
    Fbt_null(const Binary_string &str)
     :Fbt_null(str.ptr(), str.length()) { }
    // Initialize from an Item
    Fbt_null(Item *item, bool warn= true)
     :Null_flag(Fbt::make_from_item(item, warn)) { }
  public:
    const Fbt& to_fbt() const
    {
      DBUG_ASSERT(!is_null());
      return *this;
    }
    void to_record(char *str, size_t str_size) const
    {
      to_fbt().to_record(str, str_size);
    }
    bool to_binary(String *to) const
    {
      return to_fbt().to_binary(to);
    }
    bool to_string(String *to) const
    {
      return to_fbt().to_string(to);
    }
  };

  /* =[ API classes ]=========================================== */

  class Type_std_attributes_fbt: public Type_std_attributes
  {
  public:
    Type_std_attributes_fbt()
     :Type_std_attributes(
        Type_numeric_attributes(FbtImpl::max_char_length(), 0, true),
        DTCollation_numeric())
    { }
  };

  class Item_literal_fbt: public Item_literal
  {
    Fbt m_value;
  public:
    Item_literal_fbt(THD *thd)
     :Item_literal(thd),
      m_value(Fbt::zero())
    { }
    Item_literal_fbt(THD *thd, const Fbt &value)
     :Item_literal(thd),
      m_value(value)
    { }
    const Type_handler *type_handler() const override
    {
      return singleton();
    }
    bool val_bool() override
    {
      return m_value.to_bool();
    }
    longlong val_int() override
    {
      return 0;
    }
    double val_real() override
    {
      return 0;
    }
    String *val_str(String *to) override
    {
      return m_value.to_string(to) ? NULL : to;
    }
    my_decimal *val_decimal(my_decimal *to) override
    {
      my_decimal_set_zero(to);
      return to;
    }
    bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
    {
      set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
      return false;
    }
    bool val_native(THD *thd, Native *to) override
    {
      return m_value.to_native(to);
    }
    void print(String *str, enum_query_type query_type) override
    {
      StringBuffer<FbtImpl::max_char_length()+64> tmp;
      tmp.append(singleton()->name().lex_cstring());
      my_caseup_str(&my_charset_latin1, tmp.c_ptr());
      str->append(tmp);
      str->append('\'');
      m_value.to_string(&tmp);
      str->append(tmp);
      str->append('\'');
    }
    Item *do_get_copy(THD *thd) const override
    { return get_item_copy<Item_literal_fbt>(thd, this); }
    Item *do_build_clone(THD *thd) const override { return get_copy(thd); }

    // Non-overriding methods
    void set_value(const Fbt &value)
    {
      m_value= value;
    }
  };

  class Field_fbt: public Field
  {
    static void set_min_value(char *ptr)
    {
      memset(ptr, 0, FbtImpl::binary_length());
    }
    static void set_max_value(char *ptr)
    {
      memset(ptr, 0xFF, FbtImpl::binary_length());
    }
    void store_warning(const ErrConv &str,
                       Sql_condition::enum_warning_level level)
    {
      if (get_thd()->count_cuted_fields <= CHECK_FIELD_EXPRESSION)
        return;
      const TABLE_SHARE *s= table->s;
      static const Name type_name= singleton()->name();
      get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
        str.ptr(), s ? s->db.str : nullptr, s ? s->table_name.str : nullptr,
        field_name.str);
    }
    int set_null_with_warn(const ErrConv &str)
    {
      store_warning(str, Sql_condition::WARN_LEVEL_WARN);
      set_null();
      return 1;
    }
    int set_min_value_with_warn(const ErrConv &str)
    {
      store_warning(str, Sql_condition::WARN_LEVEL_WARN);
      set_min_value((char*) ptr);
      return 1;
    }
    int set_max_value_with_warn(const ErrConv &str)
    {
      store_warning(str, Sql_condition::WARN_LEVEL_WARN);
      set_max_value((char*) ptr);
      return 1;
    }
    int store_fbt_null_with_warn(const Fbt_null &fbt,
                                   const ErrConvString &err)
    {
      DBUG_ASSERT(marked_for_write_or_computed());
      if (fbt.is_null())
        return maybe_null() ? set_null_with_warn(err)
                            : set_min_value_with_warn(err);
      fbt.to_record((char *) ptr, FbtImpl::binary_length());
      return 0;
    }

  public:
    Field_fbt(const LEX_CSTRING *field_name_arg, const Record_addr &rec)
      :Field(rec.ptr(), FbtImpl::max_char_length(),
             rec.null_ptr(), rec.null_bit(), Field::NONE, field_name_arg)
    {
      flags|= BINARY_FLAG | UNSIGNED_FLAG;
    }
    const Type_handler *type_handler() const override
    {
      return singleton();
    }
    uint32 max_display_length() const override { return field_length; }
    bool str_needs_quotes() const override { return true; }
    const DTCollation &dtcollation() const override
    {
      static DTCollation_numeric c;
      return c;
    }
    CHARSET_INFO *charset(void) const override { return &my_charset_numeric; }
    const CHARSET_INFO *sort_charset(void) const override { return &my_charset_bin; }
    /**
      This makes client-server protocol convert the value according
      to @@character_set_client.
    */
    bool binary() const override { return false; }
    enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }

    bool is_equal(const Column_definition &new_field) const override
    {
      return new_field.type_handler() == type_handler();
    }
    bool eq_def(const Field *field) const override
    {
      return Field::eq_def(field);
    }
    double pos_in_interval(Field *min, Field *max) override
    {
      return pos_in_interval_val_str(min, max, 0);
    }
    int cmp(const uchar *a, const uchar *b) const override
    { return memcmp(a, b, pack_length()); }

    void sort_string(uchar *to, uint length) override
    {
      DBUG_ASSERT(length == pack_length());
      memcpy(to, ptr, length);
    }
    uint32 pack_length() const override
    {
      return FbtImpl::binary_length();
    }
    uint pack_length_from_metadata(uint field_metadata) const override
    {
      return FbtImpl::binary_length();
    }

    void sql_type(String &str) const override
    {
      static Name name= singleton()->name();
      str.set_ascii(name.ptr(), name.length());
    }

    void make_send_field(Send_field *to) override
    {
      Field::make_send_field(to);
      to->set_data_type_name(singleton()->name().lex_cstring());
    }

    bool validate_value_in_record(THD *thd, const uchar *record) const override
    {
      return false;
    }

    bool val_native(Native *to) override
    {
      DBUG_ASSERT(marked_for_read());
      if (to->alloc(FbtImpl::binary_length()))
        return true;
      to->length(FbtImpl::binary_length());
      FbtImpl::record_to_memory((char*) to->ptr(), (const char*) ptr);
      return false;
    }

    Fbt to_fbt() const
    {
      DBUG_ASSERT(marked_for_read());
      return Fbt::record_to_memory((const char*) ptr);
    }

    String *val_str(String *val_buffer, String *) override
    {
      return to_fbt().to_string(val_buffer) ? NULL : val_buffer;
    }

    my_decimal *val_decimal(my_decimal *to) override
    {
      DBUG_ASSERT(marked_for_read());
      my_decimal_set_zero(to);
      return to;
    }

    longlong val_int() override
    {
      DBUG_ASSERT(marked_for_read());
      return 0;
    }

    double val_real() override
    {
      DBUG_ASSERT(marked_for_read());
      return 0;
    }

    bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
    {
      DBUG_ASSERT(marked_for_read());
      set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
      return false;
    }

    bool val_bool(void) override
    {
      DBUG_ASSERT(marked_for_read());
      return !Fbt::only_zero_bytes((const char *) ptr, FbtImpl::binary_length());
    }

    int store_native(const Native &value) override
    {
      DBUG_ASSERT(marked_for_write_or_computed());
      DBUG_ASSERT(value.length() == FbtImpl::binary_length());
      FbtImpl::memory_to_record((char*) ptr, value.ptr());
      return 0;
    }

    int store(const char *str, size_t length, CHARSET_INFO *cs) override
    {
      return cs == &my_charset_bin ? store_binary(str, length)
                                   : store_text(str, length, cs);
    }

    int store_text(const char *str, size_t length, CHARSET_INFO *cs) override
    {
      return store_fbt_null_with_warn(Fbt_null(str, length, cs),
                                        ErrConvString(str, length, cs));
    }

    int store_binary(const char *str, size_t length) override
    {
      return store_fbt_null_with_warn(Fbt_null(str, length),
                                        ErrConvString(str, length,
                                                      &my_charset_bin));
    }

    int store_hex_hybrid(const char *str, size_t length) override
    {
      return Field_fbt::store_binary(str, length);
    }

    int store_decimal(const my_decimal *num) override
    {
      DBUG_ASSERT(marked_for_write_or_computed());
      return set_min_value_with_warn(ErrConvDecimal(num));
    }

    int store(longlong nr, bool unsigned_flag) override
    {
      DBUG_ASSERT(marked_for_write_or_computed());
      return set_min_value_with_warn(
              ErrConvInteger(Longlong_hybrid(nr, unsigned_flag)));
    }

    int store(double nr) override
    {
      DBUG_ASSERT(marked_for_write_or_computed());
      return set_min_value_with_warn(ErrConvDouble(nr));
    }

    int store_time_dec(const MYSQL_TIME *ltime, uint dec) override
    {
      DBUG_ASSERT(marked_for_write_or_computed());
      return set_min_value_with_warn(ErrConvTime(ltime));
    }

    /*** Field conversion routines ***/
    int store_field(Field *from) override
    {
      // INSERT INTO t1 (fbt_field) SELECT different_field_type FROM t2;
      return from->save_in_field(this);
    }
    int save_in_field(Field *to) override
    {
      // INSERT INTO t2 (different_field_type) SELECT fbt_field FROM t1;
      if (to->charset() == &my_charset_bin &&
          dynamic_cast<const Type_handler_general_purpose_string*>
            (to->type_handler()))
      {
        NativeBuffer<FbtImpl::binary_length()+1> res;
        val_native(&res);
        return to->store(res.ptr(), res.length(), &my_charset_bin);
      }
      return save_in_field_str(to);
    }
    Copy_func *get_copy_func(const Field *from) const override
    {
      // ALTER to FBT from another field
      return do_field_string;
    }

    Copy_func *get_copy_func_to(const Field *to) const override
    {
      if (type_handler() == to->type_handler())
      {
        // ALTER from FBT to FBT
        DBUG_ASSERT(pack_length() == to->pack_length());
        DBUG_ASSERT(charset() == to->charset());
        DBUG_ASSERT(sort_charset() == to->sort_charset());
        return Field::do_field_eq;
      }
      // ALTER from FBT to another fbt type
      if (to->charset() == &my_charset_bin &&
          dynamic_cast<const Type_handler_general_purpose_string*>
            (to->type_handler()))
      {
        /*
          ALTER from FBT to a binary string type, e.g.:
            BINARY, TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB
        */
        return do_field_fbt_native_to_binary;
      }
      return do_field_string;
    }

    static void do_field_fbt_native_to_binary(Copy_field *copy)
    {
      NativeBuffer<FbtImpl::binary_length()+1> res;
      copy->from_field->val_native(&res);
      copy->to_field->store(res.ptr(), res.length(), &my_charset_bin);
    }

    bool memcpy_field_possible(const Field *from) const override
    {
      // INSERT INTO t1 (fbt_field) SELECT field2 FROM t2;
      return type_handler() == from->type_handler();
    }
    enum_conv_type rpl_conv_type_from(const Conv_source &source,
                                      const Relay_log_info *rli,
                                      const Conv_param &param) const override
    {
      if (type_handler() == source.type_handler() ||
          (source.type_handler() == &type_handler_string &&
           source.type_handler()->max_display_length_for_field(source) ==
           FbtImpl::binary_length()))
        return rpl_conv_type_from_same_data_type(source.metadata(), rli, param);
      return CONV_TYPE_IMPOSSIBLE;
    }

    /*** Optimizer routines ***/
    bool test_if_equality_guarantees_uniqueness(const Item *const_item) const override
    {
      /*
        This condition:
          WHERE fbt_field=const
        should return a single distinct value only,
        as comparison is done according to FBT.
      */
      return true;
    }
    bool can_be_substituted_to_equal_item(const Context &ctx,
                                          const Item_equal *item_equal)
                                          override
    {
      switch (ctx.subst_constraint()) {
      case ANY_SUBST:
        return ctx.compare_type_handler() == item_equal->compare_type_handler();
      case IDENTITY_SUBST:
        return true;
      }
      return false;
    }
    Item *get_equal_const_item(THD *thd, const Context &ctx,
                               Item *const_item) override
    {
      Fbt_null tmp(const_item);
      if (tmp.is_null())
        return NULL;
      return new (thd->mem_root) Item_literal_fbt(thd, tmp);
    }
    Data_type_compatibility can_optimize_keypart_ref(const Item_bool_func *cond,
                                                     const Item *item)
                                                     const override
    {
      /*
        Mixing of two different non-traditional types is currently prevented.
        This may change in the future.
      */
      DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()->
                  is_traditional_scalar_type() ||
                  item->type_handler() == type_handler());
      return Data_type_compatibility::OK;
    }
    /**
      Test if Field can use range optimizer for a standard comparison operation:
        <=, <, =, <=>, >, >=
      Note, this method does not cover spatial operations.
    */
    Data_type_compatibility can_optimize_range(const Item_bool_func *cond,
                                               const Item *item,
                                               bool is_eq_func) const override
    {
      // See the DBUG_ASSERT comment in can_optimize_keypart_ref()
      DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()->
                  is_traditional_scalar_type() ||
                  item->type_handler() == type_handler());
      return Data_type_compatibility::OK;
    }
    void hash_not_null(Hasher *hasher) override
    {
      FbtImpl::hash_record(ptr, hasher);
    }
    SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *prm, KEY_PART *key_part,
                         const Item_bool_func *cond,
                         scalar_comparison_op op, Item *value) override
    {
      DBUG_ENTER("Field_fbt::get_mm_leaf");
      if (can_optimize_scalar_range(prm, key_part, cond, op, value) !=
          Data_type_compatibility::OK)
        DBUG_RETURN(0);
      int err= value->save_in_field_no_warnings(this, 1);
      if ((op != SCALAR_CMP_EQUAL && is_real_null()) || err < 0)
        DBUG_RETURN(&null_element);
      if (err > 0)
      {
        if (op == SCALAR_CMP_EQ || op == SCALAR_CMP_EQUAL)
          DBUG_RETURN(new (prm->mem_root) SEL_ARG_IMPOSSIBLE(this));
        DBUG_RETURN(NULL); /*  Cannot infer anything */
      }
      DBUG_RETURN(stored_field_make_mm_leaf(prm, key_part, op, value));
    }
    Data_type_compatibility can_optimize_hash_join(const Item_bool_func *cond,
                                                   const Item *item)
                                                   const override
    {
      return can_optimize_keypart_ref(cond, item);
    }
    Data_type_compatibility can_optimize_group_min_max(
                                    const Item_bool_func *cond,
                                    const Item *const_item) const override
    {
      return Data_type_compatibility::OK;
    }

    uint row_pack_length() const override { return pack_length(); }

    Binlog_type_info binlog_type_info() const override
    {
      DBUG_ASSERT(type() == binlog_type());
      return Binlog_type_info_fixed_string(Field_fbt::binlog_type(),
                                           FbtImpl::binary_length(), &my_charset_bin);
    }

    uchar *pack(uchar *to, const uchar *from, uint max_length) override
    {
      DBUG_PRINT("debug", ("Packing field '%s'", field_name.str));
      return FbtImpl::pack(to, from, max_length);
    }

    const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
                        uint param_data) override
    {
      return FbtImpl::unpack(to, from, from_end, param_data);
    }

    uint max_packed_col_length(uint max_length) override
    {
      return StringPack::max_packed_col_length(max_length);
    }

    uint packed_col_length(const uchar *fbt_ptr, uint length) override
    {
      return StringPack::packed_col_length(fbt_ptr, length);
    }

    uint size_of() const override { return sizeof(*this); }
  };


  class cmp_item_fbt: public cmp_item_scalar
  {
    Fbt m_native;
  public:
    cmp_item_fbt()
     :cmp_item_scalar(),
      m_native(Fbt::zero())
    { }
    void store_value(Item *item) override
    {
      m_native= Fbt(item, &m_null_value);
    }
    int cmp_not_null(const Value *val) override
    {
      DBUG_ASSERT(!val->is_null());
      DBUG_ASSERT(val->is_string());
      Fbt_null tmp(val->m_string);
      DBUG_ASSERT(!tmp.is_null());
      return m_native.cmp(tmp);
    }
    int cmp(Item *arg) override
    {
      Fbt_null tmp(arg);
      return m_null_value || tmp.is_null() ? UNKNOWN : m_native.cmp(tmp) != 0;
    }
    int compare(const cmp_item *ci) const override
    {
      const cmp_item_fbt *tmp= static_cast<const cmp_item_fbt*>(ci);
      DBUG_ASSERT(!m_null_value);
      DBUG_ASSERT(!tmp->m_null_value);
      return m_native.cmp(tmp->m_native);
    }
    cmp_item *make_same(THD *thd) override
    {
      return new (thd->mem_root) cmp_item_fbt();
    }
  };

  class in_fbt :public in_vector
  {
    Fbt m_value;
    static int cmp_fbt(void *cmp_arg, const void *a, const void *b)
    {
      return static_cast<const Fbt*>(a)->cmp(*static_cast<const Fbt*>(b));
    }
  public:
    in_fbt(THD *thd, uint elements)
     :in_vector(thd, elements, sizeof(Fbt), cmp_fbt, 0),
      m_value(Fbt::zero())
    { }
    const Type_handler *type_handler() const override
    {
      return singleton();
    }
    bool set(uint pos, Item *item) override
    {
      Fbt *buff= &((Fbt *) base)[pos];
      Fbt_null value(item);
      if (value.is_null())
      {
        *buff= Fbt::zero();
        return true;
      }
      *buff= value;
      return false;
    }
    uchar *get_value(Item *item) override
    {
      Fbt_null value(item);
      if (value.is_null())
        return 0;
      m_value= value;
      return (uchar *) &m_value;
    }
    Item* create_item(THD *thd) override
    {
      return new (thd->mem_root) Item_literal_fbt(thd);
    }
    void value_to_item(uint pos, Item *item) override
    {
      const Fbt &buff= (((Fbt*) base)[pos]);
      static_cast<Item_literal_fbt*>(item)->set_value(buff);
    }
  };

  class Item_copy_fbt: public Item_copy
  {
    NativeBuffer<Fbt::binary_length()+1> m_value;
  public:
    Item_copy_fbt(THD *thd, Item *item_arg): Item_copy(thd, item_arg) {}

    bool val_native(THD *thd, Native *to) override
    {
      if (null_value)
        return true;
      return to->copy(m_value.ptr(), m_value.length());
    }
    String *val_str(String *to) override
    {
      if (null_value)
        return NULL;
      Fbt_null tmp(m_value.ptr(), m_value.length());
      return tmp.is_null() || tmp.to_string(to) ? NULL : to;
    }
    my_decimal *val_decimal(my_decimal *to) override
    {
      my_decimal_set_zero(to);
      return to;
    }
    double val_real() override
    {
      return 0;
    }
    longlong val_int() override
    {
      return 0;
    }
    bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
    {
      set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
      return null_value;
    }
    void copy() override
    {
      null_value= item->val_native(current_thd, &m_value);
      DBUG_ASSERT(null_value == item->null_value);
    }
    int save_in_field(Field *field, bool no_conversions) override
    {
      return Item::save_in_field(field, no_conversions);
    }
    Item *do_get_copy(THD *thd) const override
    { return get_item_copy<Item_copy_fbt>(thd, this); }
    Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
  };

  class Item_char_typecast_func_handler_fbt_to_binary:
                                         public Item_handled_func::Handler_str
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *item)
                                            const override
    {
      if (item->max_length > MAX_FIELD_VARCHARLENGTH)
        return Type_handler::blob_type_handler(item->max_length);
      if (item->max_length > 255)
        return &type_handler_varchar;
      return &type_handler_string;
    }
    bool fix_length_and_dec(Item_handled_func *xitem) const override
    {
      return false;
    }
    String *val_str(Item_handled_func *item, String *to) const override
    {
      DBUG_ASSERT(dynamic_cast<const Item_char_typecast*>(item));
      return static_cast<Item_char_typecast*>(item)->
               val_str_binary_from_native(to);
    }
  };

  class Item_typecast_fbt: public Item_func
  {
  public:
    Item_typecast_fbt(THD *thd, Item *a) :Item_func(thd, a) {}

    const Type_handler *type_handler() const override
    { return singleton(); }

    enum Functype functype() const override { return CHAR_TYPECAST_FUNC; }
    bool eq(const Item *item, bool binary_cmp) const override
    {
      if (this == item)
        return true;
      if (item->type() != FUNC_ITEM ||
          functype() != ((Item_func*)item)->functype())
        return false;
      if (type_handler() != item->type_handler())
        return false;
      Item_typecast_fbt *cast= (Item_typecast_fbt*) item;
      return args[0]->eq(cast->args[0], binary_cmp);
    }
    LEX_CSTRING func_name_cstring() const override
    {
      static Name name= singleton()->name();
      size_t len= 9+name.length()+1;
      char *buf= (char*)current_thd->alloc(len);
      strmov(strmov(buf, "cast_as_"), name.ptr());
      return { buf, len };
    }
    void print(String *str, enum_query_type query_type) override
    {
      str->append(STRING_WITH_LEN("cast("));
      args[0]->print(str, query_type);
      str->append(STRING_WITH_LEN(" as "));
      str->append(singleton()->name().lex_cstring());
      str->append(')');
    }
    bool fix_length_and_dec() override
    {
      Type_std_attributes::operator=(Type_std_attributes_fbt());
      if (Fbt::fix_fields_maybe_null_on_conversion_to_fbt(args[0]))
        set_maybe_null();
      return false;
    }
    String *val_str(String *to) override
    {
      Fbt_null tmp(args[0]);
      return (null_value= tmp.is_null() || tmp.to_string(to)) ? NULL : to;
    }
    longlong val_int() override
    {
      return 0;
    }
    double val_real() override
    {
      return 0;
    }
    my_decimal *val_decimal(my_decimal *to) override
    {
      my_decimal_set_zero(to);
      return to;
    }
    bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
    {
      set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
      return false;
    }
    bool val_native(THD *thd, Native *to) override
    {
      Fbt_null tmp(args[0]);
      return null_value= tmp.is_null() || tmp.to_native(to);
    }
    Item *do_get_copy(THD *thd) const override
    { return get_item_copy<Item_typecast_fbt>(thd, this); }
  };

  class Item_cache_fbt: public Item_cache
  {
    NativeBuffer<FbtImpl::binary_length()+1> m_value;
  public:
    Item_cache_fbt(THD *thd)
     :Item_cache(thd, singleton()) { }
    Item *do_get_copy(THD *thd) const override
    { return get_item_copy<Item_cache_fbt>(thd, this); }
    Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
    bool cache_value() override
    {
      if (!example)
        return false;
      value_cached= true;
      null_value_inside= null_value=
        example->val_native_with_conversion_result(current_thd,
                                                   &m_value, type_handler());
      return true;
    }
    String* val_str(String *to) override
    {
      if (!has_value())
        return NULL;
      Fbt_null tmp(m_value.ptr(), m_value.length());
      return tmp.is_null() || tmp.to_string(to) ? NULL : to;
    }
    my_decimal *val_decimal(my_decimal *to) override
    {
      if (!has_value())
        return NULL;
      my_decimal_set_zero(to);
      return to;
    }
    longlong val_int() override
    {
      if (!has_value())
        return 0;
      return 0;
    }
    double val_real() override
    {
      if (!has_value())
        return 0;
      return 0;
    }
    longlong val_datetime_packed(THD *) override
    {
      DBUG_ASSERT(0);
      if (!has_value())
        return 0;
      return 0;
    }
    longlong val_time_packed(THD *) override
    {
      DBUG_ASSERT(0);
      if (!has_value())
        return 0;
      return 0;
    }
    bool get_date(THD *, MYSQL_TIME *ltime, date_mode_t) override
    {
      if (!has_value())
        return true;
      set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
      return false;
    }
    bool val_native(THD *, Native *to) override
    {
      if (!has_value())
        return true;
      return to->copy(m_value.ptr(), m_value.length());
    }
  };

  /* =[ methods ]=============================================== */
private:

  bool character_or_binary_string_to_native(THD *thd, const String *str,
                                            Native *to) const
  {
    if (str->charset() == &my_charset_bin)
    {
      // Convert from a binary string
      if (str->length() != FbtImpl::binary_length() ||
          to->copy(str->ptr(), str->length()))
      {
        thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
                                      name().ptr(), ErrConvString(str).ptr());
        return true;
      }
      return false;
    }
    // Convert from a character string
    Fbt_null tmp(*str);
    if (tmp.is_null())
      thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
                                    name().ptr(), ErrConvString(str).ptr());
    return tmp.is_null() || tmp.to_native(to);
  }

public:
  ~Type_handler_fbt() override {}

  const Type_collection *type_collection() const override
  {
    return TypeCollectionImpl::singleton();
  }

  const Name &default_value() const override
  {
    return FbtImpl::default_value();
  }
  ulong KEY_pack_flags(uint column_nr) const override
  {
    return FbtImpl::KEY_pack_flags(column_nr);
  }
  protocol_send_type_t protocol_send_type() const override
  {
    return PROTOCOL_SEND_STRING;
  }
  bool Item_append_extended_type_info(Send_field_extended_metadata *to,
                                      const Item *item) const override
  {
    return to->set_data_type_name(name().lex_cstring());
  }

  enum_field_types field_type() const override
  {
    return MYSQL_TYPE_STRING;
  }

  Item_result result_type() const override
  {
    return STRING_RESULT;
  }

  Item_result cmp_type() const override
  {
    return STRING_RESULT;
  }

  enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
                                       const override
  {
    return DYN_COL_STRING;
  }

  uint32 max_display_length_for_field(const Conv_source &src) const override
  {
    return FbtImpl::max_char_length();
  }

  const Type_handler *type_handler_for_comparison() const override
  {
    return this;
  }

  int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const override
  {
    DBUG_ASSERT(field->type_handler() == this);
    Fbt_null ni(item); // Convert Item to Fbt
    if (ni.is_null())
      return 0;
    NativeBuffer<FbtImpl::binary_length()+1> tmp;
    if (field->val_native(&tmp))
    {
      DBUG_ASSERT(0);
      return 0;
    }
    return -ni.cmp(tmp);
  }
  CHARSET_INFO *charset_for_protocol(const Item *item) const override
  {
    return item->collation.collation;
  }

  bool is_scalar_type() const override { return true; }
  bool is_val_native_ready() const override { return true; }
  bool can_return_int() const override { return false; }
  bool can_return_decimal() const override { return false; }
  bool can_return_real() const override { return false; }
  bool can_return_str() const override { return true; }
  bool can_return_text() const override { return true; }
  bool can_return_date() const override { return false; }
  bool can_return_time() const override { return false; }
  bool convert_to_binary_using_val_native() const override { return true; }

  decimal_digits_t  Item_time_precision(THD *thd, Item *item) const override
  {
    return 0;
  }
  decimal_digits_t Item_datetime_precision(THD *thd, Item *item) const override
  {
    return 0;
  }
  decimal_digits_t Item_decimal_scale(const Item *item) const override
  {
    return 0;
  }
  decimal_digits_t  Item_decimal_precision(const Item *item) const override
  {
    /* This will be needed if we ever allow cast from Fbt to DECIMAL. */
    return (FbtImpl::binary_length()*8+7)/10*3; // = bytes to decimal digits
  }

  /*
    Returns how many digits a divisor adds into a division result.
    See Item::divisor_precision_increment() in item.h for more comments.
  */
  decimal_digits_t Item_divisor_precision_increment(const Item *) const override
  {
    return 0;
  }
  /**
    Makes a temporary table Field to handle numeric aggregate functions,
    e.g. SUM(DISTINCT expr), AVG(DISTINCT expr), etc.
  */
  Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const override
  {
    DBUG_ASSERT(0);
    return 0;
  }
  Field *make_conversion_table_field(MEM_ROOT *root, TABLE *table, uint metadata,
                                     const Field *target) const override
  {
    const Record_addr tmp(NULL, Bit_addr(true));
    return new (table->in_use->mem_root) Field_fbt(&empty_clex_str, tmp);
  }
  // Fix attributes after the parser
  bool Column_definition_fix_attributes(Column_definition *c) const override
  {
    c->length= FbtImpl::max_char_length();
    return false;
  }

  bool Column_definition_prepare_stage1(THD *thd, MEM_ROOT *mem_root,
                                        Column_definition *def,
                                        handler *file, ulonglong table_flags,
                                        const Column_derived_attributes *derived_attr)
                                        const override
  {
    def->prepare_stage1_simple(&my_charset_numeric);
    return false;
  }

  bool Column_definition_redefine_stage1(Column_definition *def,
                                         const Column_definition *dup,
                                         const handler *file) const override
  {
    def->redefine_stage1_common(dup, file);
    def->set_compression_method(dup->compression_method());
    def->create_length_to_internal_length_string();
    return false;
  }

  bool Column_definition_prepare_stage2(Column_definition *def, handler *file,
                                        ulonglong table_flags) const override
  {
    def->pack_flag= FIELDFLAG_BINARY;
    return false;
  }

  bool partition_field_check(const LEX_CSTRING &field_name,
                             Item *item_expr) const override
  {
    if (item_expr->cmp_type() != STRING_RESULT)
    {
      my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
      return true;
    }
    return false;
  }

  bool partition_field_append_value(String *to, Item *item_expr,
                                    CHARSET_INFO *field_cs,
                                    partition_value_print_mode_t mode)
                                    const override
  {
    StringBuffer<FbtImpl::max_char_length()+64> fbtstr;
    Fbt_null fbt(item_expr);
    if (fbt.is_null())
    {
      my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
      return true;
    }
    return fbt.to_string(&fbtstr) ||
           to->append('\'') ||
           to->append(fbtstr) ||
           to->append('\'');
  }

  Field *make_table_field(MEM_ROOT *root, const LEX_CSTRING *name,
                          const Record_addr &addr,
                          const Type_all_attributes &attr,
                          TABLE_SHARE *table) const override
  {
    return new (root) Field_fbt(name, addr);
  }

  Field * make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root,
                            const LEX_CSTRING *name, const Record_addr &addr,
                            const Bit_addr &bit,
                            const Column_definition_attributes *attr,
                            uint32 flags) const override
  {
    return new (mem_root) Field_fbt(name, addr);
  }
  void Column_definition_attributes_frm_pack(const Column_definition_attributes *def,
                                        uchar *buff) const override
  {
    def->frm_pack_basic(buff);
    def->frm_pack_charset(buff);
  }
  bool Column_definition_attributes_frm_unpack(Column_definition_attributes *def,
                                          TABLE_SHARE *share, const uchar *buffer,
                                          LEX_CUSTRING *gis_options)
                                          const override
  {
    def->frm_unpack_basic(buffer);
    return def->frm_unpack_charset(share, buffer);
  }
  void make_sort_key_part(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field,
                          String *) const override
  {
    DBUG_ASSERT(item->type_handler() == this);
    NativeBuffer<FbtImpl::binary_length()+1> tmp;
    item->val_native_result(current_thd, &tmp);
    if (item->maybe_null())
    {
      if (item->null_value)
      {
        memset(to, 0, FbtImpl::binary_length() + 1);
        return;
      }
      *to++= 1;
    }
    DBUG_ASSERT(!item->null_value);
    DBUG_ASSERT(FbtImpl::binary_length() == tmp.length());
    DBUG_ASSERT(FbtImpl::binary_length() == sort_field->length);
    FbtImpl::memory_to_record((char*) to, tmp.ptr());
  }
  uint make_packed_sort_key_part(uchar *to, Item *item,
                                 const SORT_FIELD_ATTR *sort_field,
                                 String *) const override
  {
    DBUG_ASSERT(item->type_handler() == this);
    NativeBuffer<FbtImpl::binary_length()+1> tmp;
    item->val_native_result(current_thd, &tmp);
    if (item->maybe_null())
    {
      if (item->null_value)
      {
        *to++=0;
        return 0;
      }
      *to++= 1;
    }
    DBUG_ASSERT(!item->null_value);
    DBUG_ASSERT(FbtImpl::binary_length() == tmp.length());
    DBUG_ASSERT(FbtImpl::binary_length() == sort_field->length);
    FbtImpl::memory_to_record((char*) to, tmp.ptr());
    return tmp.length();
  }
  void sort_length(THD *thd, const Type_std_attributes *item,
                  SORT_FIELD_ATTR *attr) const override
  {
    attr->original_length= attr->length= FbtImpl::binary_length();
    attr->suffix_length= 0;
  }
  uint32 max_display_length(const Item *item) const override
  {
    return FbtImpl::max_char_length();
  }
  uint32 calc_pack_length(uint32 length) const override
  {
    return FbtImpl::binary_length();
  }
  void Item_update_null_value(Item *item) const override
  {
    NativeBuffer<FbtImpl::binary_length()+1> tmp;
    item->val_native(current_thd, &tmp);
  }
  bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override
  {
    value->m_type= DYN_COL_STRING;
    String *str= item->val_str(&value->m_string);
    if (str != &value->m_string && !item->null_value)
    {
      // "item" returned a non-NULL value
      if (Fbt_null(*str).is_null())
      {
        /*
          The value was not-null, but conversion to FBT failed:
            SELECT a, DECODE_ORACLE(fbtcol, 'garbage', '<NULL>', '::01', '01')
            FROM t1;
        */
        thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
                                      name().ptr(), ErrConvString(str).ptr());
        value->m_type= DYN_COL_NULL;
        return true;
      }
      // "item" returned a non-NULL value, and it was a valid FBT
      value->m_string.set(str->ptr(), str->length(), str->charset());
    }
    return check_null(item, value);
  }
  void Item_param_setup_conversion(THD *thd, Item_param *param) const override
  {
    param->setup_conversion_string(thd, thd->variables.character_set_client);
  }
  void Item_param_set_param_func(Item_param *param,
                                 uchar **pos, ulong len) const override
  {
    param->set_param_str(pos, len);
  }
  bool Item_param_set_from_value(THD *thd, Item_param *param,
                                 const Type_all_attributes *attr,
                                 const st_value *val) const override
  {
    param->unsigned_flag= false;
    param->setup_conversion_string(thd, attr->collation.collation);
    /*
      Exact value of max_length is not known unless fbt is converted to
      charset of connection, so we have to set it later.
    */
    return param->set_str(val->m_string.ptr(), val->m_string.length(),
                          attr->collation.collation,
                          attr->collation.collation);
  }
  bool Item_param_val_native(THD *thd, Item_param *item, Native *to)
                             const override
  {
    StringBuffer<FbtImpl::max_char_length()+1> buffer;
    String *str= item->val_str(&buffer);
    if (!str)
      return true;
    Fbt_null tmp(*str);
    return tmp.is_null() || tmp.to_native(to);
  }
  bool Item_send(Item *item, Protocol *p, st_value *buf) const override
  {
    return Item_send_str(item, p, buf);
  }
  int Item_save_in_field(Item *item, Field *field, bool no_conversions)
                         const override
  {
    if (field->type_handler() == this)
    {
      NativeBuffer<MAX_FIELD_WIDTH> tmp;
      bool rc= item->val_native(current_thd, &tmp);
      if (rc || item->null_value)
        return set_field_to_null_with_conversions(field, no_conversions);
      field->set_notnull();
      return field->store_native(tmp);
    }
    return item->save_str_in_field(field, no_conversions);
  }

  String *print_item_value(THD *thd, Item *item, String *str) const override
  {
    StringBuffer<FbtImpl::max_char_length()+64> buf;
    String *result= item->val_str(&buf);
    /*
      TODO: This should eventually use one of these notations:
      1. CAST('xxx' AS Fbt)
         Problem: CAST is not supported as a NAME_CONST() argument.
      2. Fbt'xxx'
         Problem: This syntax is not supported by the parser yet.
    */
    return !result || str->realloc(result->length() + 2) ||
           str->append(STRING_WITH_LEN("'")) ||
           str->append(result->ptr(), result->length()) ||
           str->append(STRING_WITH_LEN("'")) ? nullptr : str;
  }

  /**
    Check if
      WHERE expr=value AND expr=const
    can be rewritten as:
      WHERE const=value AND expr=const

    "this" is the comparison handler that is used by "target".

    @param target       - the predicate expr=value,
                          whose "expr" argument will be replaced to "const".
    @param target_expr  - the target's "expr" which will be replaced to "const".
    @param target_value - the target's second argument, it will remain unchanged.
    @param source       - the equality predicate expr=const (or expr<=>const)
                          that can be used to rewrite the "target" part
                          (under certain conditions, see the code).
    @param source_expr  - the source's "expr". It should be exactly equal to
                          the target's "expr" to make condition rewrite possible.
    @param source_const - the source's "const" argument, it will be inserted
                          into "target" instead of "expr".
  */
  bool can_change_cond_ref_to_const(Item_bool_func2 *target, Item *target_expr,
                               Item *target_value, Item_bool_func2 *source,
                               Item *source_expr, Item *source_const)
                               const override
  {
    /*
      WHERE COALESCE(col)='xxx' AND COALESCE(col)=CONCAT(a);  -->
      WHERE COALESCE(col)='xxx' AND         'xxx'=CONCAT(a);
    */
    return target->compare_type_handler() == source->compare_type_handler();
  }
  bool subquery_type_allows_materialization(const Item *inner,
                                       const Item *outer, bool) const override
  {
    /*
      Example:
        SELECT * FROM t1 WHERE a IN (SELECT col FROM t1 GROUP BY col);
      Allow materialization only if the outer column is also FBT.
      This can be changed for more relaxed rules in the future.
    */
    DBUG_ASSERT(inner->type_handler() == this);
    return outer->type_handler() == this;
  }
  /**
    Make a simple constant replacement item for a constant "src",
    so the new item can futher be used for comparison with "cmp", e.g.:
      src = cmp   ->  replacement = cmp

    "this" is the type handler that is used to compare "src" and "cmp".

    @param thd - current thread, for mem_root
    @param src - The item that we want to replace. It's a const item,
                 but it can be complex enough to calculate on every row.
    @param cmp - The src's comparand.
    @retval    - a pointer to the created replacement Item
    @retval    - NULL, if could not create a replacement (e.g. on EOM).
                 NULL is also returned for ROWs, because instead of replacing
                 a Item_row to a new Item_row, Type_handler_row just replaces
                 its elements.
  */
  Item *make_const_item_for_comparison(THD *thd, Item *src,
                                       const Item *cmp) const override
  {
    Fbt_null tmp(src);
    if (tmp.is_null())
      return new (thd->mem_root) Item_null(thd, src->name.str);
    return new (thd->mem_root) Item_literal_fbt(thd, tmp);
  }
  Item_cache *Item_get_cache(THD *thd, const Item *item) const override
  {
    return new (thd->mem_root) Item_cache_fbt(thd);
  }

  Item *create_typecast_item(THD *thd, Item *item,
                             const Type_cast_attributes &attr) const override
  {
    return new (thd->mem_root) Item_typecast_fbt(thd, item);
  }
  Item_copy *create_item_copy(THD *thd, Item *item) const override
  {
    return new (thd->mem_root) Item_copy_fbt(thd, item);
  }
  int cmp_native(const Native &a, const Native &b) const override
  {
    return FbtImpl::cmp(a.to_lex_cstring(), b.to_lex_cstring());
  }
  bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override
  {
    return cmp->set_cmp_func_native(thd);
  }
  bool Item_const_eq(const Item_const *a, const Item_const *b,
                             bool binary_cmp) const override
  {
    return false;
  }
  bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
                     Item *a, Item *b) const override
  {
    Fbt_null na(a), nb(b);
    return !na.is_null() && !nb.is_null() && !na.cmp(nb);
  }
  bool Item_bool_rowready_func2_fix_length_and_dec(THD *thd,
                                 Item_bool_rowready_func2 *func) const override
  {
    if (Type_handler::Item_bool_rowready_func2_fix_length_and_dec(thd, func))
      return true;
    if (!func->maybe_null() &&
        Fbt::fix_fields_maybe_null_on_conversion_to_fbt(func->arguments(), 2))
      func->set_maybe_null();
    return false;
  }
  bool Item_hybrid_func_fix_attributes(THD *thd, const LEX_CSTRING &name,
                                       Type_handler_hybrid_field_type *h,
                                       Type_all_attributes *attr,
                                       Item **items, uint nitems) const override
  {
    attr->Type_std_attributes::operator=(Type_std_attributes_fbt());
    h->set_handler(this);
    /*
      If some of the arguments cannot be safely converted to "FBT NOT NULL",
      then mark the entire function nullability as NULL-able.
      Otherwise, keep the generic nullability calculated by earlier stages:
      - either by the most generic way in Item_func::fix_fields()
      - or by Item_func_xxx::fix_length_and_dec() before the call of
        Item_hybrid_func_fix_attributes()
      IFNULL() is special. It does not need to test args[0].
    */
    uint first= dynamic_cast<Item_func_ifnull*>(attr) ? 1 : 0;
    for (uint i= first; i < nitems; i++)
    {
      if (Fbt::fix_fields_maybe_null_on_conversion_to_fbt(items[i]))
      {
        attr->set_type_maybe_null(true);
        break;
      }
    }
    return false;
  }
  bool Item_func_min_max_fix_attributes(THD *thd, Item_func_min_max *func,
                                        Item **items, uint nitems) const override
  {
    return Item_hybrid_func_fix_attributes(thd, func->func_name_cstring(),
                                           func, func, items, nitems);

  }
  bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override
  {
    func->Type_std_attributes::operator=(Type_std_attributes_fbt());
    func->set_handler(this);
    return false;
  }
  bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }
  bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }
  bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }

  bool Item_val_native_with_conversion(THD *thd, Item *item,
                                       Native *to) const override
  {
    if (item->type_handler() == this)
      return item->val_native(thd, to); // No conversion needed
    StringBuffer<FbtImpl::max_char_length()+1> buffer;
    String *str= item->val_str(&buffer);
    return str ? character_or_binary_string_to_native(thd, str, to) : true;
  }
  bool Item_val_native_with_conversion_result(THD *thd, Item *item,
                                              Native *to) const override
  {
    if (item->type_handler() == this)
      return item->val_native_result(thd, to); // No conversion needed
    StringBuffer<FbtImpl::max_char_length()+1> buffer;
    String *str= item->str_result(&buffer);
    return str ? character_or_binary_string_to_native(thd, str, to) : true;
  }

  bool Item_val_bool(Item *item) const override
  {
    NativeBuffer<FbtImpl::binary_length()+1> tmp;
    if (item->val_native(current_thd, &tmp))
      return false;
    return !Fbt::only_zero_bytes(tmp.ptr(), tmp.length());
  }
  void Item_get_date(THD *thd, Item *item, Temporal::Warn *buff,
                     MYSQL_TIME *ltime, date_mode_t fuzzydate) const override
  {
    set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
  }

  longlong Item_val_int_signed_typecast(Item *item) const override
  {
    DBUG_ASSERT(0);
    return 0;
  }

  longlong Item_val_int_unsigned_typecast(Item *item) const override
  {
    DBUG_ASSERT(0);
    return 0;
  }

  String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str)
                                      const override
  {
    NativeBuffer<FbtImpl::binary_length()+1> tmp;
    if ((item->null_value= item->arguments()[0]->val_native(current_thd, &tmp)))
      return nullptr;
    DBUG_ASSERT(tmp.length() == FbtImpl::binary_length());
    if (str->set_hex(tmp.ptr(), tmp.length()))
    {
      str->length(0);
      str->set_charset(item->collation.collation);
    }
    return str;
  }

  String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *item,
                                              String *str) const override
  {
    NativeBuffer<FbtImpl::binary_length()+1> native;
    if (item->val_native(current_thd, &native))
    {
      DBUG_ASSERT(item->null_value);
      return nullptr;
    }
    DBUG_ASSERT(native.length() == FbtImpl::binary_length());
    Fbt_null tmp(native.ptr(), native.length());
    return tmp.is_null() || tmp.to_string(str) ? nullptr : str;
  }
  double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
                                              const override
  {
    return 0;
  }
  longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
                                               const override
  {
    return 0;
  }
  my_decimal *
  Item_func_hybrid_field_type_val_decimal(Item_func_hybrid_field_type *,
                                          my_decimal *to) const override
  {
    my_decimal_set_zero(to);
    return to;
  }
  void Item_func_hybrid_field_type_get_date(THD *,
                                            Item_func_hybrid_field_type *,
                                            Temporal::Warn *,
                                            MYSQL_TIME *to,
                                            date_mode_t fuzzydate)
                                            const override
  {
    set_zero_time(to, MYSQL_TIMESTAMP_TIME);
  }
  // WHERE is Item_func_min_max_val_native???
  String *Item_func_min_max_val_str(Item_func_min_max *func, String *str)
                                    const override
  {
    Fbt_null tmp(func);
    return tmp.is_null() || tmp.to_string(str) ? nullptr : str;
  }
  double Item_func_min_max_val_real(Item_func_min_max *) const override
  {
    return 0;
  }
  longlong Item_func_min_max_val_int(Item_func_min_max *) const override
  {
    return 0;
  }
  my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
                                            my_decimal *to) const override
  {
    my_decimal_set_zero(to);
    return to;
  }
  bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*, MYSQL_TIME *to,
                                  date_mode_t fuzzydate) const override
  {
    set_zero_time(to, MYSQL_TIMESTAMP_TIME);
    return false;
  }

  bool Item_func_between_fix_length_and_dec(Item_func_between *func) const override
  {
    if (!func->maybe_null() &&
        Fbt::fix_fields_maybe_null_on_conversion_to_fbt(func->arguments(), 3))
      func->set_maybe_null();
    return false;
  }
  longlong Item_func_between_val_int(Item_func_between *func) const override
  {
    return func->val_int_cmp_native();
  }

  cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override
  {
    return new (thd->mem_root) cmp_item_fbt;
  }

  in_vector *make_in_vector(THD *thd, const Item_func_in *func,
                            uint nargs) const override
  {
    return new (thd->mem_root) in_fbt(thd, nargs);
  }

  bool Item_func_in_fix_comparator_compatible_types(THD *thd,
                                                    Item_func_in *func)
                                                    const override
  {
    if (!func->maybe_null() &&
        Fbt::fix_fields_maybe_null_on_conversion_to_fbt(func->arguments(),
                                                        func->argument_count()))
      func->set_maybe_null();
    if (func->compatible_types_scalar_bisection_possible())
    {
      return func->value_list_convert_const_to_int(thd) ||
             func->fix_for_scalar_comparison_using_bisection(thd);
    }
    return
      func->fix_for_scalar_comparison_using_cmp_items(thd,
                                                      1U << (uint) STRING_RESULT);
  }
  bool Item_func_round_fix_length_and_dec(Item_func_round *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }
  bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }

  bool Item_func_abs_fix_length_and_dec(Item_func_abs *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }

  bool Item_func_neg_fix_length_and_dec(Item_func_neg *func) const override
  {
    return Item_func_or_sum_illegal_param(func);
  }

  bool Item_func_signed_fix_length_and_dec(Item_func_signed *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_double_typecast_fix_length_and_dec(Item_double_typecast *item)
                                          const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_float_typecast_fix_length_and_dec(Item_float_typecast *item)
                                         const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *item)
                                           const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *item)
                                             const override
  {
    if (item->cast_charset() == &my_charset_bin)
    {
      static Item_char_typecast_func_handler_fbt_to_binary
               item_char_typecast_func_handler_fbt_to_binary;
      item->fix_length_and_dec_native_to_binary(FbtImpl::binary_length());
      item->set_func_handler(&item_char_typecast_func_handler_fbt_to_binary);
      return false;
    }
    item->fix_length_and_dec_str();
    return false;
  }

  bool Item_time_typecast_fix_length_and_dec(Item_time_typecast *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_date_typecast_fix_length_and_dec(Item_date_typecast *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *item)
                                            const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_func_plus_fix_length_and_dec(Item_func_plus *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_func_minus_fix_length_and_dec(Item_func_minus *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_func_mul_fix_length_and_dec(Item_func_mul *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_func_div_fix_length_and_dec(Item_func_div *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }
  bool Item_func_mod_fix_length_and_dec(Item_func_mod *item) const override
  {
    return Item_func_or_sum_illegal_param(item);
  }

  static Type_handler_fbt *singleton()
  {
    static Type_handler_fbt th;
    return &th;
  }
};

template<class FbtImpl>
class Type_collection_fbt: public Type_collection
{
  const Type_handler *aggregate_common(const Type_handler *a,
                                       const Type_handler *b) const
  {
    if (a == b)
      return a;
    return NULL;
  }
  const Type_handler *aggregate_if_string(const Type_handler *a,
                                          const Type_handler *b) const
  {
    static const Type_aggregator::Pair agg[]=
    {
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_null,        Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_varchar,     Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_string,      Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_tiny_blob,   Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_blob,        Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_medium_blob, Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_long_blob,   Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_hex_hybrid,  Type_handler_fbt<FbtImpl>::singleton()},
      {NULL,NULL,NULL}
    };
    return Type_aggregator::find_handler_in_array(agg, a, b, true);
  }
public:
  const Type_handler *aggregate_for_result(const Type_handler *a,
                                           const Type_handler *b)
                                           const override
  {
    const Type_handler *h;
    if ((h= aggregate_common(a, b)) || (h= aggregate_if_string(a, b)))
      return h;
    return NULL;
  }

  const Type_handler *aggregate_for_min_max(const Type_handler *a,
                                            const Type_handler *b)
                                            const override
  {
    return aggregate_for_result(a, b);
  }

  const Type_handler *aggregate_for_comparison(const Type_handler *a,
                                               const Type_handler *b)
                                               const override
  {
    if (const Type_handler *h= aggregate_common(a, b))
      return h;
    static const Type_aggregator::Pair agg[]=
    {
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_null,      Type_handler_fbt<FbtImpl>::singleton()},
      {Type_handler_fbt<FbtImpl>::singleton(), &type_handler_long_blob, Type_handler_fbt<FbtImpl>::singleton()},
      {NULL,NULL,NULL}
    };
    return Type_aggregator::find_handler_in_array(agg, a, b, true);
  }

  const Type_handler *aggregate_for_num_op(const Type_handler *a,
                                           const Type_handler *b)
                                           const override
  {
    return NULL;
  }

  static Type_collection_fbt *singleton()
  {
    static Type_collection_fbt tc;
    return &tc;
  }
};

#endif /* SQL_TYPE_FIXEDBIN_H */
server/private/wsrep_high_priority_service.h000064400000011460150400263750015521 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_HIGH_PRIORITY_SERVICE_H
#define WSREP_HIGH_PRIORITY_SERVICE_H

#include "wsrep/high_priority_service.hpp"
#include "my_global.h"
#include "sql_error.h" /* Diagnostics area */
#include "sql_class.h" /* rpl_group_info */

class THD;
class Relay_log_info;
class Wsrep_server_service;

class Wsrep_high_priority_service :
  public wsrep::high_priority_service,
  public wsrep::high_priority_context
{
public:
  Wsrep_high_priority_service(THD*);
  ~Wsrep_high_priority_service();
  int start_transaction(const wsrep::ws_handle&,
                        const wsrep::ws_meta&) override;
  int next_fragment(const wsrep::ws_meta&) override;
  const wsrep::transaction& transaction() const override;
  int adopt_transaction(const wsrep::transaction&) override;
  int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&,
                      wsrep::mutable_buffer&) override = 0;
  int append_fragment_and_commit(const wsrep::ws_handle&,
                                 const wsrep::ws_meta&,
                                 const wsrep::const_buffer&,
                                 const wsrep::xid&) override;
  int remove_fragments(const wsrep::ws_meta&) override;
  int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) override;
  int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&) override;
  int apply_toi(const wsrep::ws_meta&, const wsrep::const_buffer&,
                wsrep::mutable_buffer&) override;
  void store_globals() override;
  void reset_globals() override;
  void switch_execution_context(wsrep::high_priority_service&) override;
  int log_dummy_write_set(const wsrep::ws_handle&,
                          const wsrep::ws_meta&,
                          wsrep::mutable_buffer&) override;
  void adopt_apply_error(wsrep::mutable_buffer&) override;

  virtual bool check_exit_status() const = 0;
  void debug_crash(const char*) override;
protected:
  friend Wsrep_server_service;
  THD* m_thd;
  Relay_log_info*   m_rli;
  rpl_group_info*   m_rgi;
  struct shadow
  {
    ulonglong      option_bits;
    uint           server_status;
    struct st_vio* vio;
    ulong          tx_isolation;
    char*          db;
    size_t         db_length;
    //struct timeval user_time;
    my_hrtime_t user_time;
    longlong       row_count_func;
    bool           wsrep_applier;
  } m_shadow;
};

class Wsrep_applier_service : public Wsrep_high_priority_service
{
public:
  Wsrep_applier_service(THD*);
  ~Wsrep_applier_service();
  int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&,
                      wsrep::mutable_buffer&) override;
  int apply_nbo_begin(const wsrep::ws_meta&, const wsrep::const_buffer& data,
                      wsrep::mutable_buffer& err) override;
  void after_apply() override;
  bool is_replaying() const override { return false; }
  bool check_exit_status() const override;
};

class Wsrep_replayer_service : public Wsrep_high_priority_service
{
public:
  Wsrep_replayer_service(THD* replayer_thd, THD* orig_thd);
  ~Wsrep_replayer_service();
  int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&,
                      wsrep::mutable_buffer&) override;
  int apply_nbo_begin(const wsrep::ws_meta&, const wsrep::const_buffer& data,
                      wsrep::mutable_buffer& err) override
  {
    DBUG_ASSERT(0); /* DDL should never cause replaying */
    return 0;
  }
  void after_apply() override { }
  bool is_replaying() const override { return true; }
  void replay_status(enum wsrep::provider::status status)
  { m_replay_status = status; }
  enum wsrep::provider::status replay_status() const
  { return m_replay_status; }
  /* Replayer should never be forced to exit */
  bool check_exit_status() const override { return false; }
private:
  THD* m_orig_thd;
  struct da_shadow
  {
    enum Diagnostics_area::enum_diagnostics_status status;
    ulonglong affected_rows;
    ulonglong last_insert_id;
    char message[MYSQL_ERRMSG_SIZE];
    da_shadow()
      : status()
      , affected_rows()
      , last_insert_id()
      , message()
    { }
  } m_da_shadow;
  enum wsrep::provider::status m_replay_status;
};

#endif /* WSREP_HIGH_PRIORITY_SERVICE_H */
server/private/lock.h000064400000004233150400263750010631 0ustar00/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef LOCK_INCLUDED
#define LOCK_INCLUDED

#include "thr_lock.h"                           /* thr_lock_type */
#include "mdl.h"

// Forward declarations
struct TABLE;
struct TABLE_LIST;
class THD;
typedef struct st_mysql_lock MYSQL_LOCK;


MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count, uint flags);
bool mysql_lock_tables(THD *thd, MYSQL_LOCK *sql_lock, uint flags);
int mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock, bool free_lock);
int mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock);
int mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock);
int mysql_unlock_some_tables(THD *thd, TABLE **table,uint count, uint flag);
int mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table);
bool mysql_lock_abort_for_thread(THD *thd, TABLE *table);
MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b);
/* Lock based on name */
bool lock_schema_name(THD *thd, const char *db);
/* Lock based on stored routine name */
bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
                      const char *db, const char *name);

/* flags for get_lock_data */
#define GET_LOCK_UNLOCK         0
#define GET_LOCK_STORE_LOCKS    1
#define GET_LOCK_ACTION_MASK    1
#define GET_LOCK_ON_THD         (1 << 1)
#define GET_LOCK_SKIP_SEQUENCES (1 << 2)

MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, uint flags);
void reset_lock_data(MYSQL_LOCK *sql_lock, bool unlock);

#endif /* LOCK_INCLUDED */
server/private/sql_audit.h000064400000033167150400263750011676 0ustar00#ifndef SQL_AUDIT_INCLUDED
#define SQL_AUDIT_INCLUDED

/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 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 <mysql/plugin_audit.h>
#include "sql_class.h"

extern unsigned long mysql_global_audit_mask[];


extern void mysql_audit_initialize();
extern void mysql_audit_finalize();


extern void mysql_audit_init_thd(THD *thd);
extern void mysql_audit_free_thd(THD *thd);
extern void mysql_audit_acquire_plugins(THD *thd, ulong *event_class_mask);


#ifndef EMBEDDED_LIBRARY
extern void mysql_audit_notify(THD *thd, uint event_class, const void *event);

static inline bool mysql_audit_general_enabled()
{
  return mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK;
}

static inline bool mysql_audit_connection_enabled()
{
  return mysql_global_audit_mask[0] & MYSQL_AUDIT_CONNECTION_CLASSMASK;
}

static inline bool mysql_audit_table_enabled()
{
  return mysql_global_audit_mask[0] & MYSQL_AUDIT_TABLE_CLASSMASK;
}

#else
static inline void mysql_audit_notify(THD *thd, uint event_class,
                                      const void *event) {}
#define mysql_audit_general_enabled() 0
#define mysql_audit_connection_enabled() 0
#define mysql_audit_table_enabled() 0
#endif
extern my_bool mysql_audit_release_required(THD *thd);
extern void mysql_audit_release(THD *thd);

static inline unsigned int strlen_uint(const char *s)
{
  return (uint)strlen(s);
}

static inline unsigned int safe_strlen_uint(const char *s)
{
  return (uint)safe_strlen(s);
}

#define MAX_USER_HOST_SIZE 512
static inline uint make_user_name(THD *thd, char *buf)
{
  const Security_context *sctx= thd->security_ctx;
  char *end= strxnmov(buf, MAX_USER_HOST_SIZE,
                  sctx->priv_user[0] ? sctx->priv_user : "", "[",
                  sctx->user ? sctx->user : "", "] @ ",
                  sctx->host ? sctx->host : "", " [",
                  sctx->ip ? sctx->ip : "", "]", NullS);
  return (uint)(end-buf);
}

/**
  Call audit plugins of GENERAL audit class, MYSQL_AUDIT_GENERAL_LOG subtype.
  
  @param[in] thd
  @param[in] time             time that event occurred
  @param[in] user             User name
  @param[in] userlen          User name length
  @param[in] cmd              Command name
  @param[in] cmdlen           Command name length
  @param[in] query            Query string
  @param[in] querylen         Query string length
*/
 
static inline
void mysql_audit_general_log(THD *thd, time_t time,
                             const char *user, uint userlen,
                             const char *cmd, uint cmdlen,
                             const char *query, uint querylen)
{
  if (mysql_audit_general_enabled())
  {
    mysql_event_general event;

    event.event_subclass= MYSQL_AUDIT_GENERAL_LOG;
    event.general_error_code= 0;
    event.general_time= time;
    event.general_user= user;
    event.general_user_length= userlen;
    event.general_command= cmd;
    event.general_command_length= cmdlen;
    event.general_query= query;
    event.general_query_length= querylen;
    event.general_rows= 0;

    if (thd)
    {
      event.general_thread_id= (unsigned long)thd->thread_id;
      event.general_charset= thd->variables.character_set_client;
      event.database= thd->db;
      event.query_id= thd->query_id;
    }
    else
    {
      event.general_thread_id= 0;
      event.general_charset= global_system_variables.character_set_client;
      event.database= null_clex_str;
      event.query_id= 0;
    }

    mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, &event);
  }
}

/**
  Call audit plugins of GENERAL audit class.
  event_subtype should be set to one of:
    MYSQL_AUDIT_GENERAL_ERROR
    MYSQL_AUDIT_GENERAL_RESULT
    MYSQL_AUDIT_GENERAL_STATUS
  
  @param[in] thd
  @param[in] event_subtype    Type of general audit event.
  @param[in] error_code       Error code
  @param[in] msg              Message
*/
static inline
void mysql_audit_general(THD *thd, uint event_subtype,
                         int error_code, const char *msg)
{
  DBUG_ENTER("mysql_audit_general");
  if (mysql_audit_general_enabled())
  {
    char user_buff[MAX_USER_HOST_SIZE+1];
    mysql_event_general event;

    event.event_subclass= event_subtype;
    event.general_error_code= error_code;
    event.general_time= my_time(0);
    event.general_command= msg;
    event.general_command_length= safe_strlen_uint(msg);

    if (thd)
    {
      event.general_user= user_buff;
      event.general_user_length= make_user_name(thd, user_buff);
      event.general_thread_id= (unsigned long)thd->thread_id;
      event.general_query= thd->query_string.str();
      event.general_query_length= (unsigned) thd->query_string.length();
      event.general_charset= thd->query_string.charset();
      event.general_rows= thd->get_stmt_da()->current_row_for_warning();
      event.database= thd->db;
      event.query_id= thd->query_id;
    }
    else
    {
      event.general_user= NULL;
      event.general_user_length= 0;
      event.general_thread_id= 0;
      event.general_query= NULL;
      event.general_query_length= 0;
      event.general_charset= &my_charset_bin;
      event.general_rows= 0;
      event.database= null_clex_str;
      event.query_id= 0;
    }

    mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, &event);
  }
  DBUG_VOID_RETURN;
}

static inline
void mysql_audit_notify_connection_connect(THD *thd)
{
  if (mysql_audit_connection_enabled())
  {
    const Security_context *sctx= thd->security_ctx;
    mysql_event_connection event;

    event.event_subclass= MYSQL_AUDIT_CONNECTION_CONNECT;
    event.status= thd->get_stmt_da()->is_error() ?
                  thd->get_stmt_da()->sql_errno() : 0;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= sctx->user;
    event.user_length= safe_strlen_uint(sctx->user);
    event.priv_user= sctx->priv_user;
    event.priv_user_length= strlen_uint(sctx->priv_user);
    event.external_user= sctx->external_user;
    event.external_user_length= safe_strlen_uint(sctx->external_user);
    event.proxy_user= sctx->proxy_user;
    event.proxy_user_length= strlen_uint(sctx->proxy_user);
    event.host= sctx->host;
    event.host_length= safe_strlen_uint(sctx->host);
    event.ip= sctx->ip;
    event.ip_length= safe_strlen_uint(sctx->ip);
    event.database= thd->db;

    mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
  }
}

static inline
void mysql_audit_notify_connection_disconnect(THD *thd, int errcode)
{
  if (mysql_audit_connection_enabled())
  {
    const Security_context *sctx= thd->security_ctx;
    mysql_event_connection event;

    event.event_subclass= MYSQL_AUDIT_CONNECTION_DISCONNECT;
    event.status= errcode;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= sctx->user;
    event.user_length= safe_strlen_uint(sctx->user);
    event.priv_user= sctx->priv_user;
    event.priv_user_length= strlen_uint(sctx->priv_user);
    event.external_user= sctx->external_user;
    event.external_user_length= safe_strlen_uint(sctx->external_user);
    event.proxy_user= sctx->proxy_user;
    event.proxy_user_length= strlen_uint(sctx->proxy_user);
    event.host= sctx->host;
    event.host_length= safe_strlen_uint(sctx->host);
    event.ip= sctx->ip;
    event.ip_length= safe_strlen_uint(sctx->ip) ;
    event.database= thd->db;

    mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
  }
}

static inline
void mysql_audit_notify_connection_change_user(THD *thd,
                                               const Security_context *old_ctx)
{
  if (mysql_audit_connection_enabled())
  {
    mysql_event_connection event;

    event.event_subclass= MYSQL_AUDIT_CONNECTION_CHANGE_USER;
    event.status= thd->get_stmt_da()->is_error() ?
                  thd->get_stmt_da()->sql_errno() : 0;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= old_ctx->user;
    event.user_length= safe_strlen_uint(old_ctx->user);
    event.priv_user= old_ctx->priv_user;
    event.priv_user_length= strlen_uint(old_ctx->priv_user);
    event.external_user= old_ctx->external_user;
    event.external_user_length= safe_strlen_uint(old_ctx->external_user);
    event.proxy_user= old_ctx->proxy_user;
    event.proxy_user_length= strlen_uint(old_ctx->proxy_user);
    event.host= old_ctx->host;
    event.host_length= safe_strlen_uint(old_ctx->host);
    event.ip= old_ctx->ip;
    event.ip_length= safe_strlen_uint(old_ctx->ip);
    event.database= thd->db;

    mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
  }
}


static inline
void mysql_audit_external_lock_ex(THD *thd, my_thread_id thread_id,
    const char *user, const char *host, const char *ip, query_id_t query_id,
    TABLE_SHARE *share, int lock)
{
  if (lock != F_UNLCK && mysql_audit_table_enabled())
  {
    const Security_context *sctx= thd->security_ctx;
    mysql_event_table event;

    event.event_subclass= MYSQL_AUDIT_TABLE_LOCK;
    event.read_only= lock == F_RDLCK;
    event.thread_id= (unsigned long)thread_id;
    event.user= user;
    event.priv_user= sctx->priv_user;
    event.priv_host= sctx->priv_host;
    event.external_user= sctx->external_user;
    event.proxy_user= sctx->proxy_user;
    event.host= host;
    event.ip= ip;
    event.database= share->db;
    event.table= share->table_name;
    event.new_database= null_clex_str;
    event.new_table= null_clex_str;
    event.query_id= query_id;

    mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
  }
}

static inline
void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
{
  mysql_audit_external_lock_ex(thd, thd->thread_id, thd->security_ctx->user,
      thd->security_ctx->host, thd->security_ctx->ip, thd->query_id,
      share, lock);
}

static inline
void mysql_audit_create_table(TABLE *table)
{
  if (mysql_audit_table_enabled())
  {
    THD *thd= table->in_use;
    const TABLE_SHARE *share= table->s;
    const Security_context *sctx= thd->security_ctx;
    mysql_event_table event;

    event.event_subclass= MYSQL_AUDIT_TABLE_CREATE;
    event.read_only= 0;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= sctx->user;
    event.priv_user= sctx->priv_user;
    event.priv_host= sctx->priv_host;
    event.external_user= sctx->external_user;
    event.proxy_user= sctx->proxy_user;
    event.host= sctx->host;
    event.ip= sctx->ip;
    event.database=     share->db;
    event.table=        share->table_name;
    event.new_database= null_clex_str;
    event.new_table=    null_clex_str;
    event.query_id=     thd->query_id;

    mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
  }
}

static inline
void mysql_audit_drop_table(THD *thd, TABLE_LIST *table)
{
  if (mysql_audit_table_enabled())
  {
    const Security_context *sctx= thd->security_ctx;
    mysql_event_table event;

    event.event_subclass= MYSQL_AUDIT_TABLE_DROP;
    event.read_only= 0;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= sctx->user;
    event.priv_user= sctx->priv_user;
    event.priv_host= sctx->priv_host;
    event.external_user= sctx->external_user;
    event.proxy_user= sctx->proxy_user;
    event.host= sctx->host;
    event.ip= sctx->ip;
    event.database=     table->db;
    event.table=        table->table_name;
    event.new_database= null_clex_str;
    event.new_table=    null_clex_str;
    event.query_id=     thd->query_id;

    mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
  }
}

static inline
void mysql_audit_rename_table(THD *thd, const LEX_CSTRING *old_db,
                              const LEX_CSTRING *old_tb,
                              const LEX_CSTRING *new_db, const LEX_CSTRING *new_tb)
{
  if (mysql_audit_table_enabled())
  {
    const Security_context *sctx= thd->security_ctx;
    mysql_event_table event;

    event.event_subclass= MYSQL_AUDIT_TABLE_RENAME;
    event.read_only= 0;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= sctx->user;
    event.priv_user= sctx->priv_user;
    event.priv_host= sctx->priv_host;
    event.external_user= sctx->external_user;
    event.proxy_user= sctx->proxy_user;
    event.host= sctx->host;
    event.ip= sctx->ip;
    event.database=  *old_db;
    event.table=     *old_tb;
    event.new_database= *new_db;
    event.new_table= *new_tb;
    event.query_id= thd->query_id;

    mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
  }
}

static inline
void mysql_audit_alter_table(THD *thd, TABLE_LIST *table)
{
  if (mysql_audit_table_enabled())
  {
    const Security_context *sctx= thd->security_ctx;
    mysql_event_table event;

    event.event_subclass= MYSQL_AUDIT_TABLE_ALTER;
    event.read_only= 0;
    event.thread_id= (unsigned long)thd->thread_id;
    event.user= sctx->user;
    event.priv_user= sctx->priv_user;
    event.priv_host= sctx->priv_host;
    event.external_user= sctx->external_user;
    event.proxy_user= sctx->proxy_user;
    event.host= sctx->host;
    event.ip= sctx->ip;
    event.database= table->db;
    event.table= table->table_name;
    event.new_database= null_clex_str;
    event.new_table= null_clex_str;
    event.query_id= thd->query_id;

    mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
  }
}

#endif /* SQL_AUDIT_INCLUDED */
server/private/cset_narrowing.h000064400000007600150400263750012726 0ustar00/*
   Copyright (c) 2023, 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef CSET_NARROWING_H_INCLUDED
#define CSET_NARROWING_H_INCLUDED

/*
  A singleton class to provide "utf8mb3_from_mb4.charset()".

  This is a variant of utf8mb3_general_ci that one can use when they have data
  in MB4 and want to make index lookup keys in MB3.
*/
extern
class Charset_utf8narrow
{
  struct my_charset_handler_st cset_handler;
  struct charset_info_st cset;
public:
  Charset_utf8narrow() :
    cset_handler(*my_charset_utf8mb3_general_ci.cset),
    cset(my_charset_utf8mb3_general_ci) /* Copy the CHARSET_INFO structure */
  {
    /* Insert our function wc_mb */
    cset_handler.wc_mb= my_wc_mb_utf8mb4_bmp_only;
    cset.cset=&cset_handler;

    /* Charsets are compared by their name, so assign a different name */
    LEX_CSTRING tmp= {STRING_WITH_LEN("utf8_mb4_to_mb3")};
    cset.cs_name= tmp;
  }

  CHARSET_INFO *charset() { return &cset; }

} utf8mb3_from_mb4;


/*
  A class to temporary change a field that uses utf8mb3_general_ci to enable
  correct lookup key construction from string value in utf8mb4_general_ci

  Intended usage:

    // can do this in advance:
    bool do_narrowing= Utf8_narrow::should_do_narrowing(field, value_cset);
    ...

    // This sets the field to do narrowing if necessary:
    Utf8_narrow narrow(field, do_narrowing);

    // write to 'field' here
    // item->save_in_field(field) or something else

    // Stop doing narrowing
    narrow.stop();
*/

class Utf8_narrow
{
  Field *field;
  DTCollation save_collation;

public:
  static bool should_do_narrowing(const THD *thd, CHARSET_INFO *field_cset,
                                  CHARSET_INFO *value_cset);

  static bool should_do_narrowing(const Field *field, CHARSET_INFO *value_cset)
  {
    CHARSET_INFO *field_cset= field->charset();
    THD *thd= field->table->in_use;
    return should_do_narrowing(thd, field_cset, value_cset);
  }

  Utf8_narrow(Field *field_arg, bool is_applicable)
  {
    field= NULL;
    if (is_applicable)
    {
      DTCollation mb3_from_mb4= utf8mb3_from_mb4.charset();
      field= field_arg;
      save_collation= field->dtcollation();
      field->change_charset(mb3_from_mb4);
    }
  }

  void stop()
  {
    if (field)
     field->change_charset(save_collation);
#ifndef NDEBUG
    field= NULL;
#endif
  }

  ~Utf8_narrow()
  {
    DBUG_ASSERT(!field);
  }
};


/*
  @brief
  Check if two fields can participate in a multiple equality using charset
  narrowing.

  @detail
    Normally, check_simple_equality() checks this by calling:

      left_field->eq_def(right_field)

    This function does the same but takes into account we might use charset
    narrowing:
     - collations are not the same but rather an utf8mb{3,4}_general_ci pair
     - for field lengths, should compare # characters, not #bytes.
*/

inline
bool fields_equal_using_narrowing(const THD *thd, const Field *left, const Field *right)
{
  return
    dynamic_cast<const Field_longstr*>(left) &&
    dynamic_cast<const Field_longstr*>(right) &&
    left->real_type() == right->real_type() &&
    (Utf8_narrow::should_do_narrowing(left, right->charset()) ||
     Utf8_narrow::should_do_narrowing(right, left->charset())) &&
    left->char_length() == right->char_length();
};


#endif /* CSET_NARROWING_H_INCLUDED */
server/private/semisync.h000064400000004357150400263750011542 0ustar00/* Copyright (C) 2007 Google Inc.
   Copyright (C) 2008 MySQL AB

   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 */


#ifndef SEMISYNC_H
#define SEMISYNC_H

#include "mysqld.h"
#include "log_event.h"
#include "replication.h"

/**
   This class is used to trace function calls and other process
   information
*/
class Trace {
public:
  static const unsigned long k_trace_function;
  static const unsigned long k_trace_general;
  static const unsigned long k_trace_detail;
  static const unsigned long k_trace_net_wait;

  unsigned long           m_trace_level;                      /* the level for tracing */

  Trace()
    :m_trace_level(0L)
  {}
  Trace(unsigned long trace_level)
    :m_trace_level(trace_level)
  {}
};

/**
   Base class for semi-sync master and slave classes
*/
class Repl_semi_sync_base
  :public Trace {
public:
  static const unsigned char  k_sync_header[2];     /* three byte packet header */

  /* Constants in network packet header. */
  static const unsigned char k_packet_magic_num;
  static const unsigned char k_packet_flag_sync;
};

/* The layout of a semisync slave reply packet:
   1 byte for the magic num
   8 bytes for the binlog positon
   n bytes for the binlog filename, terminated with a '\0'
*/
#define REPLY_MAGIC_NUM_LEN 1
#define REPLY_BINLOG_POS_LEN 8
#define REPLY_BINLOG_NAME_LEN (FN_REFLEN + 1)
#define REPLY_MAGIC_NUM_OFFSET 0
#define REPLY_BINLOG_POS_OFFSET (REPLY_MAGIC_NUM_OFFSET + REPLY_MAGIC_NUM_LEN)
#define REPLY_BINLOG_NAME_OFFSET (REPLY_BINLOG_POS_OFFSET + REPLY_BINLOG_POS_LEN)
#define REPLY_MESSAGE_MAX_LENGTH \
    (REPLY_MAGIC_NUM_LEN + REPLY_BINLOG_POS_LEN + REPLY_BINLOG_NAME_LEN)

#endif /* SEMISYNC_H */
server/private/sql_handler.h000064400000005536150400263750012204 0ustar00#ifndef SQL_HANDLER_INCLUDED
#define SQL_HANDLER_INCLUDED
/* Copyright (c) 2006, 2015, Oracle and/or its affiliates.
   Copyright (C) 2010, 2015, MariaDB

   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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_class.h"                 /* enum_ha_read_mode */
#include "my_base.h"                   /* ha_rkey_function, ha_rows */
#include "sql_list.h"                  /* List */

/* Open handlers are stored here */

class SQL_HANDLER {
public:
  TABLE *table;
  List<Item> fields;                            /* Fields, set on open */
  THD *thd;
  LEX_CSTRING handler_name;
  LEX_CSTRING db;
  LEX_CSTRING table_name;
  MEM_ROOT mem_root;
  MYSQL_LOCK *lock;
  MDL_request mdl_request;

  key_part_map keypart_map;
  int keyno;                                    /* Used key */
  uint key_len;
  enum enum_ha_read_modes mode;

  /* This is only used when deleting many handler objects */
  SQL_HANDLER *next;

  Query_arena arena;
  char *base_data;
  SQL_HANDLER(THD *thd_arg) :
    thd(thd_arg), arena(&mem_root, Query_arena::STMT_INITIALIZED)
  { init(); clear_alloc_root(&mem_root); base_data= 0; }
  void init()
  {
    keyno= -1;
    table= 0;
    lock= 0;
    mdl_request.ticket= 0;
  }
  void reset();

  ~SQL_HANDLER();
};

class THD;
struct TABLE_LIST;

bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen);
bool mysql_ha_close(THD *thd, TABLE_LIST *tables);
bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes, const char *,
                   List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
void mysql_ha_flush(THD *thd);
void mysql_ha_flush_tables(THD *thd, TABLE_LIST *all_tables);
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables);
void mysql_ha_cleanup_no_free(THD *thd);
void mysql_ha_cleanup(THD *thd);
void mysql_ha_set_explicit_lock_duration(THD *thd);
void mysql_ha_rm_temporary_tables(THD *thd);

SQL_HANDLER *mysql_ha_read_prepare(THD *thd, TABLE_LIST *tables,
                                   enum enum_ha_read_modes mode,
                                   const char *keyname,
                                   List<Item> *key_expr, enum ha_rkey_function ha_rkey_mode,
                                   Item *cond);
#endif
server/private/my_libwrap.h000064400000002237150400263750012050 0ustar00#ifndef MY_LIBWRAP_INCLUDED
#define MY_LIBWRAP_INCLUDED

/* Copyright (c) 2000, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

#ifdef HAVE_LIBWRAP
#include <tcpd.h>
#include <syslog.h>
#ifdef NEED_SYS_SYSLOG_H
#include <sys/syslog.h>
#endif /* NEED_SYS_SYSLOG_H */

extern void my_fromhost(struct request_info *req);
extern int my_hosts_access(struct request_info *req);
extern char *my_eval_client(struct request_info *req);

#endif /* HAVE_LIBWRAP */
#endif /* MY_LIBWRAP_INCLUDED */
server/private/atomic/generic-msvc.h000064400000007224150400263750013542 0ustar00#ifndef ATOMIC_MSC_INCLUDED
#define ATOMIC_MSC_INCLUDED

/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.

   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 <windows.h>

static inline int my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set)
{
  int32 initial_cmp= *cmp;
  int32 initial_a= InterlockedCompareExchange((volatile LONG*)a,
                                              set, initial_cmp);
  int ret= (initial_a == initial_cmp);
  if (!ret)
    *cmp= initial_a;
  return ret;
}

static inline int my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set)
{
  int64 initial_cmp= *cmp;
  int64 initial_a= InterlockedCompareExchange64((volatile LONGLONG*)a,
                                                (LONGLONG)set,
                                                (LONGLONG)initial_cmp);
  int ret= (initial_a == initial_cmp);
  if (!ret)
    *cmp= initial_a;
  return ret;
}

static inline int my_atomic_casptr(void * volatile *a, void **cmp, void *set)
{
  void *initial_cmp= *cmp;
  void *initial_a= InterlockedCompareExchangePointer(a, set, initial_cmp);
  int ret= (initial_a == initial_cmp);
  if (!ret)
    *cmp= initial_a;
  return ret;
}

static inline int32 my_atomic_add32(int32 volatile *a, int32 v)
{
  return (int32)InterlockedExchangeAdd((volatile LONG*)a, v);
}

static inline int64 my_atomic_add64(int64 volatile *a, int64 v)
{
  return (int64)InterlockedExchangeAdd64((volatile LONGLONG*)a, (LONGLONG)v);
}


/*
  According to MSDN:

  Simple reads and writes to properly-aligned 32-bit variables are atomic
  operations.
  ...
  Simple reads and writes to properly aligned 64-bit variables are atomic on
  64-bit Windows. Reads and writes to 64-bit values are not guaranteed to be
  atomic on 32-bit Windows.

  https://msdn.microsoft.com/en-us/library/windows/desktop/ms684122(v=vs.85).aspx
*/

static inline int32 my_atomic_load32(int32 volatile *a)
{
  int32 value= *a;
  MemoryBarrier();
  return value;
}

static inline int64 my_atomic_load64(int64 volatile *a)
{
#ifdef _M_X64
  int64 value= *a;
  MemoryBarrier();
  return value;
#else
  return (int64) InterlockedCompareExchange64((volatile LONGLONG *) a, 0, 0);
#endif
}

static inline void* my_atomic_loadptr(void * volatile *a)
{
  void *value= *a;
  MemoryBarrier();
  return value;
}

static inline int32 my_atomic_fas32(int32 volatile *a, int32 v)
{
  return (int32)InterlockedExchange((volatile LONG*)a, v);
}

static inline int64 my_atomic_fas64(int64 volatile *a, int64 v)
{
  return (int64)InterlockedExchange64((volatile LONGLONG*)a, v);
}

static inline void * my_atomic_fasptr(void * volatile *a, void * v)
{
  return InterlockedExchangePointer(a, v);
}

static inline void my_atomic_store32(int32 volatile *a, int32 v)
{
  MemoryBarrier();
  *a= v;
}

static inline void my_atomic_store64(int64 volatile *a, int64 v)
{
#ifdef _M_X64
  MemoryBarrier();
  *a= v;
#else
  (void) InterlockedExchange64((volatile LONGLONG *) a, v);
#endif
}

static inline void my_atomic_storeptr(void * volatile *a, void *v)
{
  MemoryBarrier();
  *a= v;
}

#endif /* ATOMIC_MSC_INCLUDED */
server/private/atomic/solaris.h000064400000006125150400263750012633 0ustar00#ifndef ATOMIC_SOLARIS_INCLUDED
#define ATOMIC_SOLARIS_INCLUDED

/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.

   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 <atomic.h>

#if defined(__GNUC__)
#define atomic_typeof(T,V)      __typeof__(V)
#else
#define atomic_typeof(T,V)      T
#endif

static inline int my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set)
{
  int ret;
  atomic_typeof(uint32_t, *cmp) sav;
  sav= atomic_cas_32((volatile uint32_t *)a, (uint32_t)*cmp, (uint32_t)set);
  ret= (sav == *cmp);
  if (!ret)
    *cmp= sav;
  return ret;
}

static inline int my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set)
{
  int ret;
  atomic_typeof(uint64_t, *cmp) sav;
  sav= atomic_cas_64((volatile uint64_t *)a, (uint64_t)*cmp, (uint64_t)set);
  ret= (sav == *cmp);
  if (!ret)
    *cmp= sav;
  return ret;
}

static inline int my_atomic_casptr(void * volatile *a, void **cmp, void *set)
{
  int ret;
  atomic_typeof(void *, *cmp) sav;
  sav= atomic_cas_ptr((volatile void **)a, (void *)*cmp, (void *)set);
  ret= (sav == *cmp);
  if (!ret)
    *cmp= sav;
  return ret;
}

static inline int32 my_atomic_add32(int32 volatile *a, int32 v)
{
  int32 nv= atomic_add_32_nv((volatile uint32_t *)a, v);
  return nv - v;
}

static inline int64 my_atomic_add64(int64 volatile *a, int64 v)
{
  int64 nv= atomic_add_64_nv((volatile uint64_t *)a, v);
  return nv - v;
}

static inline int32 my_atomic_fas32(int32 volatile *a, int32 v)
{
  return atomic_swap_32((volatile uint32_t *)a, (uint32_t)v);
}

static inline int64 my_atomic_fas64(int64 volatile *a, int64 v)
{
  return atomic_swap_64((volatile uint64_t *)a, (uint64_t)v);
}

static inline void * my_atomic_fasptr(void * volatile *a, void * v)
{
  return atomic_swap_ptr(a, v);
}

static inline int32 my_atomic_load32(int32 volatile *a)
{
  return atomic_or_32_nv((volatile uint32_t *)a, 0);
}

static inline int64 my_atomic_load64(int64 volatile *a)
{
  return atomic_or_64_nv((volatile uint64_t *)a, 0);
}

static inline void* my_atomic_loadptr(void * volatile *a)
{
  return atomic_add_ptr_nv(a, 0);
}

static inline void my_atomic_store32(int32 volatile *a, int32 v)
{
  (void) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v);
}

static inline void my_atomic_store64(int64 volatile *a, int64 v)
{
  (void) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v);
}

static inline void my_atomic_storeptr(void * volatile *a, void *v)
{
  (void) atomic_swap_ptr((volatile void **)a, (void *)v);
}

#endif /* ATOMIC_SOLARIS_INCLUDED */
server/private/atomic/gcc_builtins.h000064400000007341150400263750013625 0ustar00#ifndef ATOMIC_GCC_BUILTINS_INCLUDED
#define ATOMIC_GCC_BUILTINS_INCLUDED

/* Copyright (c) 2017 MariaDB Foundation

   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 */


#define MY_MEMORY_ORDER_RELAXED __ATOMIC_RELAXED
#define MY_MEMORY_ORDER_CONSUME __ATOMIC_CONSUME
#define MY_MEMORY_ORDER_ACQUIRE __ATOMIC_ACQUIRE
#define MY_MEMORY_ORDER_RELEASE __ATOMIC_RELEASE
#define MY_MEMORY_ORDER_ACQ_REL __ATOMIC_ACQ_REL
#define MY_MEMORY_ORDER_SEQ_CST __ATOMIC_SEQ_CST

#define my_atomic_store32_explicit(P, D, O) __atomic_store_n((P), (D), (O))
#define my_atomic_store64_explicit(P, D, O) __atomic_store_n((P), (D), (O))
#define my_atomic_storeptr_explicit(P, D, O) __atomic_store_n((P), (D), (O))

#define my_atomic_load32_explicit(P, O) __atomic_load_n((P), (O))
#define my_atomic_load64_explicit(P, O) __atomic_load_n((P), (O))
#define my_atomic_loadptr_explicit(P, O) __atomic_load_n((P), (O))

#define my_atomic_fas32_explicit(P, D, O) __atomic_exchange_n((P), (D), (O))
#define my_atomic_fas64_explicit(P, D, O) __atomic_exchange_n((P), (D), (O))
#define my_atomic_fasptr_explicit(P, D, O) __atomic_exchange_n((P), (D), (O))

#define my_atomic_add32_explicit(P, A, O) __atomic_fetch_add((P), (A), (O))
#define my_atomic_add64_explicit(P, A, O) __atomic_fetch_add((P), (A), (O))

#define my_atomic_cas32_weak_explicit(P, E, D, S, F) \
  __atomic_compare_exchange_n((P), (E), (D), 1, (S), (F))
#define my_atomic_cas64_weak_explicit(P, E, D, S, F) \
  __atomic_compare_exchange_n((P), (E), (D), 1, (S), (F))
#define my_atomic_casptr_weak_explicit(P, E, D, S, F) \
  __atomic_compare_exchange_n((P), (E), (D), 1, (S), (F))

#define my_atomic_cas32_strong_explicit(P, E, D, S, F) \
  __atomic_compare_exchange_n((P), (E), (D), 0, (S), (F))
#define my_atomic_cas64_strong_explicit(P, E, D, S, F) \
  __atomic_compare_exchange_n((P), (E), (D), 0, (S), (F))
#define my_atomic_casptr_strong_explicit(P, E, D, S, F) \
  __atomic_compare_exchange_n((P), (E), (D), 0, (S), (F))

#define my_atomic_store32(P, D) __atomic_store_n((P), (D), __ATOMIC_SEQ_CST)
#define my_atomic_store64(P, D) __atomic_store_n((P), (D), __ATOMIC_SEQ_CST)
#define my_atomic_storeptr(P, D) __atomic_store_n((P), (D), __ATOMIC_SEQ_CST)

#define my_atomic_load32(P) __atomic_load_n((P), __ATOMIC_SEQ_CST)
#define my_atomic_load64(P) __atomic_load_n((P), __ATOMIC_SEQ_CST)
#define my_atomic_loadptr(P) __atomic_load_n((P), __ATOMIC_SEQ_CST)

#define my_atomic_fas32(P, D) __atomic_exchange_n((P), (D), __ATOMIC_SEQ_CST)
#define my_atomic_fas64(P, D) __atomic_exchange_n((P), (D), __ATOMIC_SEQ_CST)
#define my_atomic_fasptr(P, D) __atomic_exchange_n((P), (D), __ATOMIC_SEQ_CST)

#define my_atomic_add32(P, A) __atomic_fetch_add((P), (A), __ATOMIC_SEQ_CST)
#define my_atomic_add64(P, A) __atomic_fetch_add((P), (A), __ATOMIC_SEQ_CST)

#define my_atomic_cas32(P, E, D) \
  __atomic_compare_exchange_n((P), (E), (D), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
#define my_atomic_cas64(P, E, D) \
  __atomic_compare_exchange_n((P), (E), (D), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
#define my_atomic_casptr(P, E, D) \
  __atomic_compare_exchange_n((P), (E), (D), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)

#endif /* ATOMIC_GCC_BUILTINS_INCLUDED */
server/private/span.h000064400000007533150400263760010651 0ustar00/*****************************************************************************

Copyright (c) 2019, 2020 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 Street, Fifth Floor, Boston, MA 02110-1335 USA

*****************************************************************************/

#pragma once

#include <cstddef>
#include <iterator>

namespace st_
{

namespace detail
{

template <class T> struct remove_cv
{
  typedef T type;
};
template <class T> struct remove_cv<const T>
{
  typedef T type;
};
template <class T> struct remove_cv<volatile T>
{
  typedef T type;
};
template <class T> struct remove_cv<const volatile T>
{
  typedef T type;
};

} // namespace detail

template <class ElementType> class span
{
public:
  typedef ElementType element_type;
  typedef typename detail::remove_cv<ElementType>::type value_type;
  typedef size_t size_type;
  typedef ptrdiff_t difference_type;
  typedef element_type *pointer;
  typedef const element_type *const_pointer;
  typedef element_type &reference;
  typedef const element_type &const_reference;
  typedef pointer iterator;
  typedef const_pointer const_iterator;
  typedef std::reverse_iterator<iterator> reverse_iterator;

  span() : data_(NULL), size_(0) {}

  span(pointer ptr, size_type count) : data_(ptr), size_(count) {}

  span(pointer first, pointer last) : data_(first), size_(last - first) {}

  template <size_t N> span(element_type (&arr)[N]) : data_(arr), size_(N) {}

  template <class Container>
  span(Container &cont) : data_(cont.data()), size_(cont.size())
  {
  }

  template <class Container>
  span(const Container &cont) : data_(cont.data()), size_(cont.size())
  {
  }

  span(const span &other) : data_(other.data_), size_(other.size_) {}

  ~span() = default;

  span &operator=(const span &other)
  {
    data_= other.data();
    size_= other.size();
    return *this;
  }

  template <size_t Count> span<element_type> first() const
  {
    assert(!empty());
    return span(data(), 1);
  }
  template <size_t Count> span<element_type> last() const
  {
    assert(!empty());
    return span(data() + size() - 1, 1);
  }

  span<element_type> first(size_type count) const
  {
    assert(!empty());
    return span(data(), 1);
  }
  span<element_type> last(size_type count) const
  {
    assert(!empty());
    return span(data() + size() - 1, 1);
  }
  span<element_type> subspan(size_type offset, size_type count) const
  {
    assert(!empty());
    assert(size() >= offset + count);
    return span(data() + offset, count);
  }

  size_type size() const { return size_; }
  size_type size_bytes() const { return size() * sizeof(ElementType); }
  bool empty() const __attribute__((warn_unused_result))
  {
    return size() == 0;
  }

  reference operator[](size_type idx) const
  {
    assert(size() > idx);
    return data()[idx];
  }
  reference front() const
  {
    assert(!empty());
    return data()[0];
  }
  reference back() const
  {
    assert(!empty());
    return data()[size() - 1];
  }
  pointer data() const { return data_; }

  iterator begin() const { return data_; }
  iterator end() const { return data_ + size_; }
  reverse_iterator rbegin() const
  {
    return std::reverse_iterator<iterator>(end());
  }
  reverse_iterator rend() const
  {
    return std::reverse_iterator<iterator>(begin());
  }

private:
  pointer data_;
  size_type size_;
};

} // namespace st_
server/private/rpl_filter.h000064400000010667150400263760012054 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   
   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 */

#ifndef RPL_FILTER_H
#define RPL_FILTER_H

#include "mysql.h"
#include "mysqld.h"
#include "sql_list.h"                           /* I_List */
#include "hash.h"                               /* HASH */

class String;
struct TABLE_LIST;
typedef struct st_dynamic_array DYNAMIC_ARRAY;

typedef struct st_table_rule_ent
{
  char* db;
  char* tbl_name;
  uint key_len;
} TABLE_RULE_ENT;

/*
  Rpl_filter

  Inclusion and exclusion rules of tables and databases.
  Also handles rewrites of db.
  Used for replication and binlogging.
 */
class Rpl_filter 
{
public:
  Rpl_filter();
  ~Rpl_filter();
  Rpl_filter(Rpl_filter const&);
  Rpl_filter& operator=(Rpl_filter const&);
 
  /* Checks - returns true if ok to replicate/log */

#ifndef MYSQL_CLIENT
  bool tables_ok(const char* db, TABLE_LIST *tables);
#endif 
  bool db_ok(const char* db);
  bool db_ok_with_wild_table(const char *db);

  bool is_on();
  bool is_db_empty();

  /* Setters - add filtering rules */

  int add_do_table(const char* table_spec);
  int add_ignore_table(const char* table_spec);

  int set_do_table(const char* table_spec);
  int set_ignore_table(const char* table_spec);

  int add_wild_do_table(const char* table_spec);
  int add_wild_ignore_table(const char* table_spec);

  int set_wild_do_table(const char* table_spec);
  int set_wild_ignore_table(const char* table_spec);

  int add_do_db(const char* db_spec);
  int add_ignore_db(const char* db_spec);

  int set_do_db(const char* db_spec);
  int set_ignore_db(const char* db_spec);

  void set_parallel_mode(enum_slave_parallel_mode mode)
  {
    parallel_mode= mode;
  }
  /* Return given parallel mode or if one is not given, the default mode */
  enum_slave_parallel_mode get_parallel_mode()
  {
    return parallel_mode;
  }

  void add_db_rewrite(const char* from_db, const char* to_db);

  /* Getters - to get information about current rules */

  void get_do_table(String* str);
  void get_ignore_table(String* str);

  void get_wild_do_table(String* str);
  void get_wild_ignore_table(String* str);

  bool rewrite_db_is_empty();
  const char* get_rewrite_db(const char* db, size_t *new_len);
  void copy_rewrite_db(Rpl_filter *from);

  I_List<i_string>* get_do_db();
  I_List<i_string>* get_ignore_db();

  void get_do_db(String* str);
  void get_ignore_db(String* str);

private:

  void init_table_rule_hash(HASH* h, bool* h_inited);
  void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited);

  int add_table_rule(HASH* h, const char* table_spec);
  int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec);

  typedef int (Rpl_filter::*Add_filter)(char const*);

  int parse_filter_rule(const char* spec, Add_filter func);

  void free_string_array(DYNAMIC_ARRAY *a);
  void free_string_list(I_List<i_string> *l);

  void table_rule_ent_hash_to_str(String* s, HASH* h, bool inited);
  void table_rule_ent_dynamic_array_to_str(String* s, DYNAMIC_ARRAY* a,
                                           bool inited);
  void db_rule_ent_list_to_str(String* s, I_List<i_string>* l);
  TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len);

  int add_string_list(I_List<i_string> *list, const char* spec);

  /*
    Those 4 structures below are uninitialized memory unless the
    corresponding *_inited variables are "true".
  */
  HASH do_table;
  HASH ignore_table;
  DYNAMIC_ARRAY wild_do_table;
  DYNAMIC_ARRAY wild_ignore_table;
  enum_slave_parallel_mode parallel_mode;

  bool table_rules_on;
  bool do_table_inited;
  bool ignore_table_inited;
  bool wild_do_table_inited;
  bool wild_ignore_table_inited;

  I_List<i_string> do_db;
  I_List<i_string> ignore_db;

  I_List<i_string_pair> rewrite_db;
};

extern Rpl_filter *global_rpl_filter;
extern Rpl_filter *binlog_filter;

#endif // RPL_FILTER_H
server/private/wsrep_storage_service.h000064400000003421150400263760014304 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_STORAGE_SERVICE_H
#define WSREP_STORAGE_SERVICE_H

#include "wsrep/storage_service.hpp"
#include "wsrep/client_state.hpp"

class THD;
class Wsrep_server_service;
class Wsrep_storage_service :
  public wsrep::storage_service,
  public wsrep::high_priority_context
{
public:
  Wsrep_storage_service(THD*);
  ~Wsrep_storage_service();
  int start_transaction(const wsrep::ws_handle&) override;
  void adopt_transaction(const wsrep::transaction&) override;
  int append_fragment(const wsrep::id&,
                      wsrep::transaction_id,
                      int flags,
                      const wsrep::const_buffer&,
                      const wsrep::xid&) override;
  int update_fragment_meta(const wsrep::ws_meta&) override;
  int remove_fragments() override;
  int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) override;
  int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&) override;
  void store_globals() override;
  void reset_globals() override;
private:
  friend class Wsrep_server_service;
  THD* m_thd;
};

#endif /* WSREP_STORAGE_SERVICE_H */
server/private/pfs_memory_provider.h000064400000003132150400263760013771 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_MEMORY_PROVIDER_H
#define PFS_MEMORY_PROVIDER_H

/**
  @file include/pfs_memory_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_MEMORY_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_MEMORY_CALL(M) pfs_ ## M ## _v1

C_MODE_START

void pfs_register_memory_v1
    (const char *category, struct PSI_memory_info_v1 *info, int count);

PSI_memory_key
pfs_memory_alloc_v1
  (PSI_memory_key key, size_t size, PSI_thread **owner);

PSI_memory_key
pfs_memory_realloc_v1
  (PSI_memory_key key, size_t old_size, size_t new_size, PSI_thread **owner);

void pfs_memory_free_v1
  (PSI_memory_key key, size_t size, PSI_thread *owner);

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_MEMORY_INTERFACE */

#endif

server/private/wsrep_utils.h000064400000022112150400263760012256 0ustar00/* Copyright (C) 2013-2015 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA. */

#ifndef WSREP_UTILS_H
#define WSREP_UTILS_H

#include "wsrep_priv.h"
#include "wsrep_mysqld.h"

unsigned int wsrep_check_ip (const char* const addr, bool *is_ipv6);
size_t wsrep_guess_ip (char* buf, size_t buf_len);

/* returns the length of the host part of the address string */
size_t wsrep_host_len(const char* addr, size_t addr_len);

namespace wsp {

class Address {
public:
  Address()
    : m_address_len(0), m_family(UNSPEC), m_port(0), m_valid(false)
  {
    memset(m_address, 0, sizeof(m_address));
  }
  Address(const char *addr_in)
    : m_address_len(0), m_family(UNSPEC), m_port(0), m_valid(false)
  {
    memset(m_address, 0, sizeof(m_address));
    parse_addr(addr_in);
  }
  bool is_valid() { return m_valid; }
  bool is_ipv6() { return (m_family == INET6); }

  const char* get_address() { return m_address; }
  size_t get_address_len() { return m_address_len; }
  int get_port() { return m_port; }
  void set_port(int port) { m_port= port; }

private:
  enum family {
    UNSPEC= 0,
    INET,                                       /* IPv4 */
    INET6,                                      /* IPv6 */
  };

  char   m_address[256];
  size_t m_address_len;
  family m_family;
  int    m_port;
  bool   m_valid;

  void parse_addr(const char *addr_in) {
    const char *start;
    const char *end;
    const char *port;
    const char* open_bracket= strchr(const_cast<char *>(addr_in), '[');
    const char* close_bracket= strchr(const_cast<char *>(addr_in), ']');
    const char* colon= strchr(const_cast<char *>(addr_in), ':');
    const char* dot= strchr(const_cast<char *>(addr_in), '.');

    int cc= colon_count(addr_in);

    if (open_bracket != NULL ||
        dot == NULL ||
        (colon != NULL && (dot == NULL || colon < dot)))
    {
      // This could be an IPv6 address or a hostname
      if (open_bracket != NULL) {
        /* Sanity check: Address with '[' must include ']' */
        if (close_bracket == NULL &&
            open_bracket < close_bracket)       /* Error: malformed address */
        {
          m_valid= false;
          return;
        }

        start= open_bracket + 1;
        end= close_bracket;

        /* Check for port */
        port= strchr(close_bracket, ':');
        if ((port != NULL) && parse_port(port + 1))
        {
          return;                               /* Error: invalid port */
        }
        m_family= INET6;
      }
      else
      {
        switch (cc) {
        case 0:
          /* Hostname with no port */
          start= addr_in;
          end= addr_in + strlen(addr_in);
          break;
        case 1:
          /* Hostname with port (host:port) */
          start= addr_in;
          end= colon;
          if (parse_port(colon + 1))
            return;                             /* Error: invalid port */
          break;
        default:
          /* IPv6 address */
          start= addr_in;
          end= addr_in + strlen(addr_in);
          m_family= INET6;
          break;
        }
      }
    } else {                                    /* IPv4 address or hostname */
      start= addr_in;
      if (colon != NULL) {                      /* Port */
        end= colon;
        if (parse_port(colon + 1))
          return;                               /* Error: invalid port */
      } else {
        end= addr_in + strlen(addr_in);
      }
    }

    size_t len= end - start;

    /* Safety */
    if (len >= sizeof(m_address))
    {
      // The supplied address is too large to fit into the internal buffer.
      m_valid= false;
      return;
    }

    memcpy(m_address, start, len);
    m_address[len]= '\0';
    m_address_len= ++ len;
    m_valid= true;
    return;
  }

  int colon_count(const char *addr) {
    int count= 0, i= 0;

    while(addr[i] != '\0')
    {
      if (addr[i] == ':') ++count;
      ++ i;
    }
    return count;
  }

  bool parse_port(const char *port) {
    errno= 0;                                   /* Reset the errno */
    m_port= strtol(port, NULL, 10);
    if (errno == EINVAL || errno == ERANGE)
    {
      m_port= 0;                                /* Error: invalid port */
      m_valid= false;
      return true;
    }
    return false;
  }
};

class Config_state
{
public:
  Config_state() : view_(), status_(wsrep::server_state::s_disconnected)
  {}

  void set(const wsrep::view& view)
  {
    wsrep_notify_status(status_, &view);

    lock();
    view_= view;
    unlock();
  }

  void set(enum wsrep::server_state::state status)
  {
    if (status == wsrep::server_state::s_donor ||
	status == wsrep::server_state::s_synced)
      wsrep_notify_status(status, &view_);
    else
      wsrep_notify_status(status);

    lock();
    status_= status;
    unlock();
  }

  const wsrep::view& get_view_info() const
  {
    return view_;
  }

  enum wsrep::server_state::state get_status() const
  {
    return status_;
  }

  int lock()
  {
    return mysql_mutex_lock(&LOCK_wsrep_config_state);
  }

  int unlock()
  {
    return mysql_mutex_unlock(&LOCK_wsrep_config_state);
  }

private:
  wsrep::view view_;
  enum wsrep::server_state::state status_;
};

} /* namespace wsp */

extern wsp::Config_state *wsrep_config_state;

namespace wsp {
/* a class to manage env vars array */
class env
{
private:
    size_t len_;
    char** env_;
    int    errno_;
    bool ctor_common(char** e);
    void dtor();
    env& operator =(env);
public:
    explicit env(char** env);
    explicit env(const env&);
    ~env();
    int append(const char* var); /* add a new env. var */
    int error() const { return errno_; }
    char** operator()() { return env_; }
};

/* A small class to run external programs. */
class process
{
private:
    const char* const str_;
    FILE*       io_;
    int         err_;
    pid_t       pid_;

public:
/*! @arg type is a pointer to a null-terminated string which  must  contain
         either  the  letter  'r'  for  reading  or the letter 'w' for writing.
    @arg env optional null-terminated vector of environment variables
 */
    process  (const char* cmd, const char* type, char** env);
    ~process ();

    FILE* pipe () { return io_;  }
    int   error() { return err_; }
    int   wait ();
    const char* cmd() { return str_; }
};

class thd
{
  class thd_init
  {
  public:
    thd_init()  { my_thread_init(); }
    ~thd_init() { my_thread_end();  }
  }
  init;

  thd (const thd&);
  thd& operator= (const thd&);

public:

  thd(my_bool wsrep_on, bool system_thread=false);
  ~thd();
  THD* const ptr;
};

class string
{
public:
    string() : string_(0) {}
    explicit string(size_t s) : string_(static_cast<char*>(malloc(s))) {}
    char* operator()() { return string_; }
    void set(char* str) { if (string_) free (string_); string_= str; }
    ~string() { set (0); }
private:
    char* string_;
};

/* scope level lock */
class auto_lock
{
public:
  auto_lock(mysql_mutex_t* m) : m_(m) { mysql_mutex_lock(m_); }
  ~auto_lock() { mysql_mutex_unlock(m_); }
private:
  mysql_mutex_t& operator =(mysql_mutex_t&);
  mysql_mutex_t* const m_;
};

#ifdef REMOVED
class lock
{
  pthread_mutex_t* const mtx_;

public:

  lock (pthread_mutex_t* mtx) : mtx_(mtx)
  {
    int err= pthread_mutex_lock (mtx_);

    if (err)
    {
      WSREP_ERROR("Mutex lock failed: %s", strerror(err));
      abort();
    }
  }

  virtual ~lock ()
  {
    int err= pthread_mutex_unlock (mtx_);

    if (err)
    {
      WSREP_ERROR("Mutex unlock failed: %s", strerror(err));
      abort();
    }
  }

  inline void wait (pthread_cond_t* cond)
  {
    pthread_cond_wait (cond, mtx_);
  }

private:

  lock (const lock&);
  lock& operator=(const lock&);

};

class monitor
{
  int             mutable refcnt;
  pthread_mutex_t mutable mtx;
  pthread_cond_t  mutable cond;

public:

  monitor() : refcnt(0)
  {
    pthread_mutex_init (&mtx, NULL);
    pthread_cond_init  (&cond, NULL);
  }

  ~monitor()
  {
    pthread_mutex_destroy (&mtx);
    pthread_cond_destroy  (&cond);
  }

  void enter() const
  {
    lock l(&mtx);

    while (refcnt)
    {
      l.wait(&cond);
    }
    refcnt++;
  }

  void leave() const
  {
    lock l(&mtx);

    refcnt--;
    if (refcnt == 0)
    {
      pthread_cond_signal (&cond);
    }
  }

private:

  monitor (const monitor&);
  monitor& operator= (const monitor&);
};

class critical
{
  const monitor& mon;

public:

  critical(const monitor& m) : mon(m) { mon.enter(); }

  ~critical() { mon.leave(); }

private:

  critical (const critical&);
  critical& operator= (const critical&);
};
#endif

} // namespace wsrep

#endif /* WSREP_UTILS_H */
server/private/mariadb.h000064400000002375150400263760011306 0ustar00/* Copyright (c) 2010, 2017, 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-1301  USA */

/*
  Include file that should always be included first in all file in the sql
  directory. Used to ensure that some files, like my_global.h and my_config.h
  are always included first.
  It can also be used to speed up compilation by using precompiled headers.

  This file should include a minum set of header files used by all files
  and header files that are very seldom changed.
  It can also include some defines that all files should be aware of.
*/

#ifndef MARIADB_INCLUDED
#define MARIADB_INCLUDED
#include <my_global.h>
#endif /* MARIADB_INCLUDED */
server/private/parse_file.h000064400000010443150400263760012013 0ustar00/* -*- C++ -*- */
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _PARSE_FILE_H_
#define _PARSE_FILE_H_

#include "sql_string.h"                         // LEX_STRING
#include "sql_alloc.h"                          // Sql_alloc

class THD;

typedef struct st_mem_root MEM_ROOT;

#define PARSE_FILE_TIMESTAMPLENGTH 19

enum file_opt_type {
  FILE_OPTIONS_STRING,		/**< String (LEX_STRING) */
  FILE_OPTIONS_ESTRING,		/**< Escaped string (LEX_STRING) */
  FILE_OPTIONS_ULONGLONG,	/**< ulonglong parameter (ulonglong) */
  FILE_OPTIONS_VIEW_ALGO,	/**< Similar to longlong, but needs conversion */
  FILE_OPTIONS_TIMESTAMP,	/**< timestamp (LEX_STRING have to be
				   allocated with length 20 (19+1) */
  FILE_OPTIONS_STRLIST,         /**< list of escaped strings
                                   (List<LEX_STRING>) */
  FILE_OPTIONS_ULLLIST          /**< list of ulonglong values
                                   (List<ulonglong>) */
};

struct File_option
{
  LEX_CSTRING name;             /**< Name of the option */
  my_ptrdiff_t offset;          /**< offset to base address of value */
  file_opt_type type;           /**< Option type */
};


/**
  This hook used to catch no longer supported keys and process them for
  backward compatibility.
*/

class Unknown_key_hook
{
public:
  Unknown_key_hook() = default;                       /* Remove gcc warning */
  virtual ~Unknown_key_hook() = default;              /* Remove gcc warning */
  virtual bool process_unknown_string(const char *&unknown_key, uchar* base,
                                      MEM_ROOT *mem_root, const char *end)= 0;
};


/** Dummy hook for parsers which do not need hook for unknown keys. */

class File_parser_dummy_hook: public Unknown_key_hook
{
public:
  File_parser_dummy_hook() = default;                 /* Remove gcc warning */
  bool process_unknown_string(const char *&unknown_key, uchar* base,
                              MEM_ROOT *mem_root, const char *end) override;
};

extern File_parser_dummy_hook file_parser_dummy_hook;

bool get_file_options_ulllist(const char *&ptr, const char *end,
                              const char *line, uchar* base,
                              File_option *parameter,
                              MEM_ROOT *mem_root);

const char *
parse_escaped_string(const char *ptr, const char *end, MEM_ROOT *mem_root,
                     LEX_CSTRING *str);

class File_parser;
File_parser *sql_parse_prepare(const LEX_CSTRING *file_name,
			       MEM_ROOT *mem_root, bool bad_format_errors);

my_bool
sql_create_definition_file(const LEX_CSTRING *dir,
                           const LEX_CSTRING *file_name,
			   const LEX_CSTRING *type,
			   uchar* base, File_option *parameters);
my_bool rename_in_schema_file(THD *thd,
                              const char *schema, const char *old_name,
                              const char *new_db, const char *new_name);

int sql_backup_definition_file(const LEX_CSTRING *org_name,
                                   LEX_CSTRING *new_name);
int sql_restore_definition_file(const LEX_CSTRING *name);

class File_parser: public Sql_alloc
{
  char *start, *end;
  LEX_CSTRING file_type;
  bool content_ok;
public:
  File_parser() :start(0), end(0), content_ok(0)
    { file_type.str= 0; file_type.length= 0; }

  bool ok() { return content_ok; }
  const LEX_CSTRING *type() const { return &file_type; }
  my_bool parse(uchar* base, MEM_ROOT *mem_root,
		struct File_option *parameters, uint required,
                Unknown_key_hook *hook) const;

  friend File_parser *sql_parse_prepare(const LEX_CSTRING *file_name,
					MEM_ROOT *mem_root,
					bool bad_format_errors);
};
#endif /* _PARSE_FILE_H_ */
server/private/sql_lifo_buffer.h000064400000022714150400263760013047 0ustar00/*
   Copyright (c) 2010, 2011, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @defgroup Bi-directional LIFO buffers used by DS-MRR implementation
  @{
*/

class Forward_lifo_buffer;
class Backward_lifo_buffer;


/*
  A base class for in-memory buffer used by DS-MRR implementation. Common
  properties:
  - The buffer is last-in-first-out, i.e. elements that are written last are
    read first.
  - The buffer contains fixed-size elements. The elements are either atomic
    byte sequences or pairs of them.
  - The buffer resides in the memory provided by the user. It is possible to
     = dynamically (ie. between write operations) add ajacent memory space to
       the buffer
     = dynamically remove unused space from the buffer.
    The intent of this is to allow to have two buffers on adjacent memory
    space, one is being read from (and so its space shrinks), while the other 
    is being written to (and so it needs more and more space).

  There are two concrete classes, Forward_lifo_buffer and Backward_lifo_buffer.
*/

class Lifo_buffer 
{
protected:
  size_t size1;
  size_t size2;

public:
  /**
    write() will put into buffer size1 bytes pointed by write_ptr1. If
    size2!=0, then they will be accompanied by size2 bytes pointed by
    write_ptr2.
  */
  uchar *write_ptr1;
  uchar *write_ptr2;

  /**
    read() will do reading by storing pointers to read data into read_ptr1 or
    into (read_ptr1, read_ptr2), depending on whether the buffer was set to
    store single objects or pairs.
  */
  uchar *read_ptr1;
  uchar *read_ptr2;

protected:
  uchar *start; /**< points to start of buffer space */
  uchar *end;   /**< points to just beyond the end of buffer space */
public:

  enum enum_direction {
    BACKWARD=-1, /**< buffer is filled/read from bigger to smaller memory addresses */
    FORWARD=1  /**< buffer is filled/read from smaller to bigger memory addresses */
  };

  virtual enum_direction type() = 0;

  /* Buffer space control functions */

  /** Let the buffer store data in the given space. */
  void set_buffer_space(uchar *start_arg, uchar *end_arg) 
  {
    start= start_arg;
    end= end_arg;
    if (end != start)
      TRASH_ALLOC(start, size_t(end - start));
    reset();
  }
  
  /** 
    Specify where write() should get the source data from, as well as source
    data size.
  */
  void setup_writing(size_t len1, size_t len2)
  {
    size1= len1;
    size2= len2;
  }

  /** 
    Specify where read() should store pointers to read data, as well as read
    data size. The sizes must match those passed to setup_writing().
  */
  void setup_reading(size_t len1, size_t len2)
  {
    DBUG_ASSERT(len1 == size1);
    DBUG_ASSERT(len2 == size2);
  }
  
  bool can_write()
  {
    return have_space_for(size1 + size2);
  }
  virtual void write() = 0;

  bool is_empty() { return used_size() == 0; }
  virtual bool read() = 0;
  
  void sort(qsort_cmp2 cmp_func, void *cmp_func_arg)
  {
    size_t elem_size= size1 + size2;
    size_t n_elements= used_size() / elem_size;
    my_qsort2(used_area(), n_elements, elem_size, cmp_func, cmp_func_arg);
  }

  virtual void reset() = 0;
  virtual uchar *end_of_space() = 0;
protected:
  virtual size_t used_size() = 0;
  
  /* To be used only by iterator class: */
  virtual uchar *get_pos()= 0;
  virtual bool read(uchar **position, uchar **ptr1, uchar **ptr2)= 0;
  friend class Lifo_buffer_iterator;
public:
  virtual bool have_space_for(size_t bytes) = 0;

  virtual void remove_unused_space(uchar **unused_start, uchar **unused_end)=0;
  virtual uchar *used_area() = 0; 
  virtual ~Lifo_buffer() = default;
};


/**
  Forward LIFO buffer

  The buffer that is being written to from start to end and read in the
  reverse.  'pos' points to just beyond the end of used space.

  It is possible to grow/shink the buffer at the end bound

     used space      unused space  
   *==============*-----------------*
   ^              ^                 ^
   |              |                 +--- end
   |              +---- pos              
   +--- start           
*/

class Forward_lifo_buffer: public Lifo_buffer
{
  uchar *pos;
public:
  enum_direction type() override { return FORWARD; }
  size_t used_size() override
  {
    return (size_t)(pos - start);
  }
  void reset() override
  {
    pos= start;
  }
  uchar *end_of_space() override { return pos; }
  bool have_space_for(size_t bytes) override
  {
    return (pos + bytes < end);
  }

  void write() override
  {
    write_bytes(write_ptr1, size1);
    if (size2)
      write_bytes(write_ptr2, size2);
  }
  void write_bytes(const uchar *data, size_t bytes)
  {
    DBUG_ASSERT(have_space_for(bytes));
    memcpy(pos, data, bytes);
    pos += bytes;
  }
  bool have_data(uchar *position, size_t bytes)
  {
    return ((position - start) >= (ptrdiff_t)bytes);
  }
  uchar *read_bytes(uchar **position, size_t bytes)
  {
    DBUG_ASSERT(have_data(*position, bytes));
    *position= (*position) - bytes;
    return *position;
  }
  bool read() override { return read(&pos, &read_ptr1, &read_ptr2); }
  bool read(uchar **position, uchar **ptr1, uchar **ptr2) override
  {
    if (!have_data(*position, size1 + size2))
      return TRUE;
    if (size2)
      *ptr2= read_bytes(position, size2);
    *ptr1= read_bytes(position, size1);
    return FALSE;
  }
  void remove_unused_space(uchar **unused_start, uchar **unused_end) override
  {
    DBUG_ASSERT(0); /* Don't need this yet */
  }
  /**
    Add more space to the buffer. The caller is responsible that the space
    being added is adjacent to the end of the buffer.

    @param unused_start Start of space
    @param unused_end   End of space
  */
  void grow(uchar *unused_start, uchar *unused_end)
  {
    DBUG_ASSERT(unused_end >= unused_start);
    DBUG_ASSERT(end == unused_start);
    TRASH_ALLOC(unused_start, size_t(unused_end - unused_start));
    end= unused_end;
  }
  /* Return pointer to start of the memory area that is occupied by the data */
  uchar *used_area() override { return start; }
  friend class Lifo_buffer_iterator;
  uchar *get_pos() override { return pos; }
};



/**
  Backward LIFO buffer

  The buffer that is being written to from start to end and read in the
  reverse.  'pos' points to the start of used space.

  It is possible to grow/shink the buffer at the start.

     unused space      used space  
   *--------------*=================*
   ^              ^                 ^
   |              |                 +--- end
   |              +---- pos              
   +--- start           
*/
class Backward_lifo_buffer: public Lifo_buffer
{
  uchar *pos;
public:
  enum_direction type() override { return BACKWARD; }
 
  size_t used_size() override
  {
    return (size_t)(end - pos);
  }
  void reset() override
  {
    pos= end;
  }
  uchar *end_of_space() override { return end; }
  bool have_space_for(size_t bytes) override
  {
    return (pos - bytes >= start);
  }
  void write() override
  {
    if (write_ptr2)
      write_bytes(write_ptr2, size2);
    write_bytes(write_ptr1, size1);
  }
  void write_bytes(const uchar *data, size_t bytes)
  {
    DBUG_ASSERT(have_space_for(bytes));
    pos -= bytes;
    memcpy(pos, data, bytes);
  }
  bool read() override
  {
    return read(&pos, &read_ptr1, &read_ptr2);
  }
  bool read(uchar **position, uchar **ptr1, uchar **ptr2) override
  {
    if (!have_data(*position, size1 + size2))
      return TRUE;
    *ptr1= read_bytes(position, size1);
    if (size2)
      *ptr2= read_bytes(position, size2);
    return FALSE;
  }
  bool have_data(uchar *position, size_t bytes)
  {
    return ((end - position) >= (ptrdiff_t)bytes);
  }
  uchar *read_bytes(uchar **position, size_t bytes)
  {
    DBUG_ASSERT(have_data(*position, bytes));
    uchar *ret= *position;
    *position= *position + bytes;
    return ret;
  }
  /**
    Stop using/return the unused part of the space
    @param unused_start  OUT Start of the unused space
    @param unused_end    OUT End of the unused space
  */
  void remove_unused_space(uchar **unused_start, uchar **unused_end) override
  {
    *unused_start= start;
    *unused_end= pos;
    start= pos;
  }
  void grow(uchar *unused_start, uchar *unused_end)
  {
    DBUG_ASSERT(0); /* Not used for backward buffers */
  }
  /* Return pointer to start of the memory area that is occupied by the data */
  uchar *used_area() override { return pos; }
  friend class Lifo_buffer_iterator;
  uchar *get_pos() override { return pos; }
};


/** Iterator to walk over contents of the buffer without reading from it */
class Lifo_buffer_iterator
{
  uchar *pos;
  Lifo_buffer *buf;
  
public:
  /* The data is read to here */
  uchar *read_ptr1;
  uchar *read_ptr2;

  void init(Lifo_buffer *buf_arg)
  {
    buf= buf_arg;
    pos= buf->get_pos();
  }
  /*
    Read the next value. The calling convention is the same as buf->read()
    has.

    @retval FALSE - ok
    @retval TRUE  - EOF, reached the end of the buffer
  */
  bool read() 
  {
    return buf->read(&pos, &read_ptr1, &read_ptr2);
  }
};


server/private/winservice.h000064400000002252150400263760012057 0ustar00/*
   Copyright (c) 2011, 2012, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*
  Extract properties of a windows service binary path
*/
#ifdef __cplusplus
extern "C" {
#endif

#include <windows.h> 
typedef struct mysqld_service_properties_st
{
  char mysqld_exe[MAX_PATH];
  char inifile[MAX_PATH];
  char datadir[MAX_PATH];
  int  version_major;
  int  version_minor;
  int  version_patch;
} mysqld_service_properties;

extern int get_mysql_service_properties(const wchar_t *bin_path, 
  mysqld_service_properties *props);

#ifdef __cplusplus
}
#endif
server/private/table.h000064400000342035150400263760010776 0ustar00#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
   Copyright (c) 2009, 2022, MariaDB

   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 "sql_plist.h"
#include "sql_list.h"                           /* Sql_alloc */
#include "mdl.h"
#include "datadict.h"
#include "sql_string.h"                         /* String */
#include "lex_string.h"
#include "lex_ident.h"

#ifndef MYSQL_CLIENT

#include "my_cpu.h"                             /* LF_BACKOFF() */
#include "hash.h"                               /* HASH */
#include "handler.h"                /* row_type, ha_choice, handler */
#include "mysql_com.h"              /* enum_field_types */
#include "thr_lock.h"                  /* thr_lock_type */
#include "filesort_utils.h"
#include "parse_file.h"
#include "sql_i_s.h"
#include "sql_type.h"               /* vers_kind_t */
#include "privilege.h"              /* privilege_t */
#include "my_bit.h"

/*
  Buffer for unix timestamp in microseconds:
  9,223,372,036,854,775,807 (signed int64 maximal value)
  1 234 567 890 123 456 789

  Note: we can use unsigned for calculation, but practically they
  are the same by probability to overflow them (signed int64 in
  microseconds is enough for almost 3e5 years) and signed allow to
  avoid increasing the buffer (the old buffer for human readable
  date was 19+1).
*/
#define MICROSECOND_TIMESTAMP_BUFFER_SIZE (19 + 1)

/* Structs that defines the TABLE */

class Item;				/* Needed by ORDER */
typedef Item (*Item_ptr);
class Item_subselect;
class Item_field;
class Item_func_hash;
class GRANT_TABLE;
class st_select_lex_unit;
class st_select_lex;
class partition_info;
class COND_EQUAL;
class Security_context;
struct TABLE_LIST;
class ACL_internal_schema_access;
class ACL_internal_table_access;
class Field;
class Table_statistics;
class With_element;
struct TDC_element;
class Virtual_column_info;
class Table_triggers_list;
class TMP_TABLE_PARAM;
class SEQUENCE;
class Range_rowid_filter_cost_info;
class derived_handler;
class Pushdown_derived;
struct Name_resolution_context;
class Table_function_json_table;

/*
  Used to identify NESTED_JOIN structures within a join (applicable only to
  structures that have not been simplified away and embed more the one
  element)
*/
typedef ulonglong nested_join_map;

#define VIEW_MD5_LEN 32


#define tmp_file_prefix "#sql"			/**< Prefix for tmp tables */
#define tmp_file_prefix_length 4
#define TMP_TABLE_KEY_EXTRA 8

/**
  Enumerate possible types of a table from re-execution
  standpoint.
  TABLE_LIST class has a member of this type.
  At prepared statement prepare, this member is assigned a value
  as of the current state of the database. Before (re-)execution
  of a prepared statement, we check that the value recorded at
  prepare matches the type of the object we obtained from the
  table definition cache.

  @sa check_and_update_table_version()
  @sa Execute_observer
  @sa Prepared_statement::reprepare()
*/

enum enum_table_ref_type
{
  /** Initial value set by the parser */
  TABLE_REF_NULL= 0,
  TABLE_REF_VIEW,
  TABLE_REF_BASE_TABLE,
  TABLE_REF_I_S_TABLE,
  TABLE_REF_TMP_TABLE
};


/*************************************************************************/

/**
 Object_creation_ctx -- interface for creation context of database objects
 (views, stored routines, events, triggers). Creation context -- is a set
 of attributes, that should be fixed at the creation time and then be used
 each time the object is parsed or executed.
*/

class Object_creation_ctx
{
public:
  Object_creation_ctx *set_n_backup(THD *thd);

  void restore_env(THD *thd, Object_creation_ctx *backup_ctx);

protected:
  Object_creation_ctx() = default;
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0;

  virtual void change_env(THD *thd) const = 0;

public:
  virtual ~Object_creation_ctx() = default;
};

/*************************************************************************/

/**
 Default_object_creation_ctx -- default implementation of
 Object_creation_ctx.
*/

class Default_object_creation_ctx : public Object_creation_ctx
{
public:
  CHARSET_INFO *get_client_cs()
  {
    return m_client_cs;
  }

  CHARSET_INFO *get_connection_cl()
  {
    return m_connection_cl;
  }

protected:
  Default_object_creation_ctx(THD *thd);

  Default_object_creation_ctx(CHARSET_INFO *client_cs,
                              CHARSET_INFO *connection_cl);

protected:
  Object_creation_ctx *create_backup_ctx(THD *thd) const override;

  void change_env(THD *thd) const override;

protected:
  /**
    client_cs stores the value of character_set_client session variable.
    The only character set attribute is used.

    Client character set is included into query context, because we save
    query in the original character set, which is client character set. So,
    in order to parse the query properly we have to switch client character
    set on parsing.
  */
  CHARSET_INFO *m_client_cs;

  /**
    connection_cl stores the value of collation_connection session
    variable. Both character set and collation attributes are used.

    Connection collation is included into query context, becase it defines
    the character set and collation of text literals in internal
    representation of query (item-objects).
  */
  CHARSET_INFO *m_connection_cl;
};

class Query_arena;

/*************************************************************************/

/**
 View_creation_ctx -- creation context of view objects.
*/

class View_creation_ctx : public Default_object_creation_ctx,
                          public Sql_alloc
{
public:
  static View_creation_ctx *create(THD *thd);

  static View_creation_ctx *create(THD *thd,
                                   TABLE_LIST *view);

private:
  View_creation_ctx(THD *thd)
    : Default_object_creation_ctx(thd)
  { }
};

/*************************************************************************/

/* Order clause list element */

typedef int (*fast_field_copier)(Field *to, Field *from);


typedef struct st_order {
  struct st_order *next;
  Item	 **item;			/* Point at item in select fields */
  Item	 *item_ptr;			/* Storage for initial item */
  /*
    Reference to the function we are trying to optimize copy to
    a temporary table
  */
  fast_field_copier fast_field_copier_func;
  /* Field for which above optimizer function setup */
  Field  *fast_field_copier_setup;
  int    counter;                       /* position in SELECT list, correct
                                           only if counter_used is true*/
  enum enum_order {
    ORDER_NOT_RELEVANT,
    ORDER_ASC,
    ORDER_DESC
  };

  enum_order direction;                 /* Requested direction of ordering */
  bool	 in_field_list;			/* true if in select field list */
  bool   counter_used;                  /* parameter was counter of columns */
  Field  *field;			/* If tmp-table group */
  char	 *buff;				/* If tmp-table group */
  table_map used; /* NOTE: the below is only set to 0 but is still used by eq_ref_table */
  table_map depend_map;
} ORDER;

/**
  State information for internal tables grants.
  This structure is part of the TABLE_LIST, and is updated
  during the ACL check process.
  @sa GRANT_INFO
*/
struct st_grant_internal_info
{
  /** True if the internal lookup by schema name was done. */
  bool m_schema_lookup_done;
  /** Cached internal schema access. */
  const ACL_internal_schema_access *m_schema_access;
  /** True if the internal lookup by table name was done. */
  bool m_table_lookup_done;
  /** Cached internal table access. */
  const ACL_internal_table_access *m_table_access;
};
typedef struct st_grant_internal_info GRANT_INTERNAL_INFO;

/**
   @brief The current state of the privilege checking process for the current
   user, SQL statement and SQL object.

   @details The privilege checking process is divided into phases depending on
   the level of the privilege to be checked and the type of object to be
   accessed. Due to the mentioned scattering of privilege checking
   functionality, it is necessary to keep track of the state of the
   process. This information is stored in privilege, want_privilege, and
   orig_want_privilege.

   A GRANT_INFO also serves as a cache of the privilege hash tables. Relevant
   members are grant_table and version.
 */
typedef struct st_grant_info
{
  /**
     @brief A copy of the privilege information regarding the current host,
     database, object and user.

     @details The version of this copy is found in GRANT_INFO::version.
   */
  GRANT_TABLE *grant_table_user;
  GRANT_TABLE *grant_table_role;
  /**
     @brief Used for cache invalidation when caching privilege information.

     @details The privilege information is stored on disk, with dedicated
     caches residing in memory: table-level and column-level privileges,
     respectively, have their own dedicated caches.

     The GRANT_INFO works as a level 1 cache with this member updated to the
     current value of the global variable @c grant_version (@c static variable
     in sql_acl.cc). It is updated Whenever the GRANT_INFO is refreshed from
     the level 2 cache. The level 2 cache is the @c column_priv_hash structure
     (@c static variable in sql_acl.cc)

     @see grant_version
   */
  uint version;
  /**
     @brief The set of privileges that the current user has fulfilled for a
     certain host, database, and object.
     
     @details This field is continually updated throughout the access checking
     process. In each step the "wanted privilege" is checked against the
     fulfilled privileges. When/if the intersection of these sets is empty,
     access is granted.

     The set is implemented as a bitmap, with the bits defined in sql_acl.h.
   */
  privilege_t privilege;
  /**
     @brief the set of privileges that the current user needs to fulfil in
     order to carry out the requested operation.
   */
  privilege_t want_privilege;
  /**
    Stores the requested access acl of top level tables list. Is used to
    check access rights to the underlying tables of a view.
  */
  privilege_t orig_want_privilege;
  /** The grant state for internal tables. */
  GRANT_INTERNAL_INFO m_internal;

  st_grant_info()
   :privilege(NO_ACL),
    want_privilege(NO_ACL),
    orig_want_privilege(NO_ACL)
  { }

  /* OR table and all column privileges */
  privilege_t all_privilege();
} GRANT_INFO;

enum tmp_table_type
{
  NO_TMP_TABLE= 0, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
  INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };


enum vcol_init_mode
{
  VCOL_INIT_DEPENDENCY_FAILURE_IS_WARNING= 1,
  VCOL_INIT_DEPENDENCY_FAILURE_IS_ERROR= 2
  /*
    There may be new flags here.
    e.g. to automatically remove sql_mode dependency:
      GENERATED ALWAYS AS (char_col) ->
      GENERATED ALWAYS AS (RTRIM(char_col))
  */
};


enum enum_vcol_update_mode
{
  VCOL_UPDATE_FOR_READ= 0,
  VCOL_UPDATE_FOR_WRITE,
  VCOL_UPDATE_FOR_DELETE,
  VCOL_UPDATE_INDEXED,
  VCOL_UPDATE_INDEXED_FOR_UPDATE,
  VCOL_UPDATE_FOR_REPLACE
};

/* Field visibility enums */

enum __attribute__((packed)) field_visibility_t {
  VISIBLE= 0,
  INVISIBLE_USER,
  /* automatically added by the server. Can be queried explicitly
  in SELECT, otherwise invisible from anything" */
  INVISIBLE_SYSTEM,
  INVISIBLE_FULL
};

#define INVISIBLE_MAX_BITS              3
#define HA_HASH_FIELD_LENGTH            8
#define HA_HASH_KEY_LENGTH_WITHOUT_NULL 8
#define HA_HASH_KEY_LENGTH_WITH_NULL    9


int fields_in_hash_keyinfo(KEY *keyinfo);

void setup_keyinfo_hash(KEY *key_info);

void re_setup_keyinfo_hash(KEY *key_info);

/**
  Category of table found in the table share.
*/
enum enum_table_category
{
  /**
    Unknown value.
  */
  TABLE_UNKNOWN_CATEGORY=0,

  /**
    Temporary table.
    The table is visible only in the session.
    Therefore,
    - FLUSH TABLES WITH READ LOCK
    - SET GLOBAL READ_ONLY = ON
    do not apply to this table.
    Note that LOCK TABLE t FOR READ/WRITE
    can be used on temporary tables.
    Temporary tables are not part of the table cache.
  */
  TABLE_CATEGORY_TEMPORARY=1,

  /**
    User table.
    These tables do honor:
    - LOCK TABLE t FOR READ/WRITE
    - FLUSH TABLES WITH READ LOCK
    - SET GLOBAL READ_ONLY = ON
    User tables are cached in the table cache.
  */
  TABLE_CATEGORY_USER=2,

  /**
    System table, maintained by the server.
    These tables do honor:
    - LOCK TABLE t FOR READ/WRITE
    - FLUSH TABLES WITH READ LOCK
    - SET GLOBAL READ_ONLY = ON
    Typically, writes to system tables are performed by
    the server implementation, not explicitly be a user.
    System tables are cached in the table cache.
  */
  TABLE_CATEGORY_SYSTEM=3,

  /**
    Log tables.
    These tables are an interface provided by the system
    to inspect the system logs.
    These tables do *not* honor:
    - LOCK TABLE t FOR READ/WRITE
    - FLUSH TABLES WITH READ LOCK
    - SET GLOBAL READ_ONLY = ON
    as there is no point in locking explicitly
    a LOG table.
    An example of LOG tables are:
    - mysql.slow_log
    - mysql.general_log,
    which *are* updated even when there is either
    a GLOBAL READ LOCK or a GLOBAL READ_ONLY in effect.
    User queries do not write directly to these tables
    (there are exceptions for log tables).
    The server implementation perform writes.
    Log tables are cached in the table cache.
  */
  TABLE_CATEGORY_LOG=4,

  /*
    Types below are read only tables, not affected by FLUSH TABLES or
    MDL locks.
  */
  /**
    Information schema tables.
    These tables are an interface provided by the system
    to inspect the system metadata.
    These tables do *not* honor:
    - LOCK TABLE t FOR READ/WRITE
    - FLUSH TABLES WITH READ LOCK
    - SET GLOBAL READ_ONLY = ON
    as there is no point in locking explicitly
    an INFORMATION_SCHEMA table.
    Nothing is directly written to information schema tables.
    Note that this value is not used currently,
    since information schema tables are not shared,
    but implemented as session specific temporary tables.
  */
  /*
    TODO: Fixing the performance issues of I_S will lead
    to I_S tables in the table cache, which should use
    this table type.
  */
  TABLE_CATEGORY_INFORMATION=5,

  /**
    Performance schema tables.
    These tables are an interface provided by the system
    to inspect the system performance data.
    These tables do *not* honor:
    - LOCK TABLE t FOR READ/WRITE
    - FLUSH TABLES WITH READ LOCK
    - SET GLOBAL READ_ONLY = ON
    as there is no point in locking explicitly
    a PERFORMANCE_SCHEMA table.
    An example of PERFORMANCE_SCHEMA tables are:
    - performance_schema.*
    which *are* updated (but not using the handler interface)
    even when there is either
    a GLOBAL READ LOCK or a GLOBAL READ_ONLY in effect.
    User queries do not write directly to these tables
    (there are exceptions for SETUP_* tables).
    The server implementation perform writes.
    Performance tables are cached in the table cache.
  */
  TABLE_CATEGORY_PERFORMANCE=6
};

typedef enum enum_table_category TABLE_CATEGORY;

TABLE_CATEGORY get_table_category(const Lex_ident_db &db,
                                  const Lex_ident_table &name);


typedef struct st_table_field_type
{
  LEX_CSTRING name;
  LEX_CSTRING type;
  LEX_CSTRING cset;
} TABLE_FIELD_TYPE;


typedef struct st_table_field_def
{
  uint count;
  const TABLE_FIELD_TYPE *field;
  uint primary_key_parts;
  const uint *primary_key_columns;
} TABLE_FIELD_DEF;


class Table_check_intact
{
protected:
  bool has_keys;
  virtual void report_error(uint code, const char *fmt, ...)= 0;

public:
  Table_check_intact(bool keys= false) : has_keys(keys) {}
  virtual ~Table_check_intact() = default;

  /** Checks whether a table is intact. */
  bool check(TABLE *table, const TABLE_FIELD_DEF *table_def);
};


/*
  If the table isn't valid, report the error to the server log only.
*/
class Table_check_intact_log_error : public Table_check_intact
{
protected:
  void report_error(uint, const char *fmt, ...) override;
public:
  Table_check_intact_log_error() : Table_check_intact(true) {}
};


/**
  Class representing the fact that some thread waits for table
  share to be flushed. Is used to represent information about
  such waits in MDL deadlock detector.
*/

class Wait_for_flush : public MDL_wait_for_subgraph
{
  MDL_context *m_ctx;
  TABLE_SHARE *m_share;
  uint m_deadlock_weight;
public:
  Wait_for_flush(MDL_context *ctx_arg, TABLE_SHARE *share_arg,
               uint deadlock_weight_arg)
    : m_ctx(ctx_arg), m_share(share_arg),
      m_deadlock_weight(deadlock_weight_arg)
  {}

  MDL_context *get_ctx() const { return m_ctx; }

  bool accept_visitor(MDL_wait_for_graph_visitor *dvisitor) override;

  uint get_deadlock_weight() const override;

  /**
    Pointers for participating in the list of waiters for table share.
  */
  Wait_for_flush *next_in_share;
  Wait_for_flush **prev_in_share;
};


typedef I_P_List <Wait_for_flush,
                  I_P_List_adapter<Wait_for_flush,
                                   &Wait_for_flush::next_in_share,
                                   &Wait_for_flush::prev_in_share> >
                 Wait_for_flush_list;


enum open_frm_error {
  OPEN_FRM_OK = 0,
  OPEN_FRM_OPEN_ERROR,
  OPEN_FRM_READ_ERROR,
  OPEN_FRM_CORRUPTED,
  OPEN_FRM_DISCOVER,
  OPEN_FRM_ERROR_ALREADY_ISSUED,
  OPEN_FRM_NOT_A_VIEW,
  OPEN_FRM_NOT_A_TABLE,
  OPEN_FRM_NEEDS_REBUILD
};

/**
  Control block to access table statistics loaded 
  from persistent statistical tables
*/


#define TABLE_STAT_NO_STATS    0
#define TABLE_STAT_TABLE       1
#define TABLE_STAT_COLUMN      2
#define TABLE_STAT_INDEX       4
#define TABLE_STAT_HISTOGRAM   8

/*
  EITS statistics information for a table.

  This data is loaded from mysql.{table|index|column}_stats tables and
  then most of the time is owned by table's TABLE_SHARE object.

  Individual TABLE objects also have pointer to this object, and we do
  reference counting to know when to free it. See
  TABLE::update_engine_stats(), TABLE::free_engine_stats(),
  TABLE_SHARE::update_engine_stats(), TABLE_SHARE::destroy().
  These implement a "shared pointer"-like functionality.

  When new statistics is loaded, we create new TABLE_STATISTICS_CB and make
  the TABLE_SHARE point to it. Some TABLE object may still be using older
  TABLE_STATISTICS_CB objects.  Reference counting allows to free
  TABLE_STATISTICS_CB when it is no longer used.
*/

class TABLE_STATISTICS_CB
{
  uint usage_count;                             // Instances of this stat

public:
  TABLE_STATISTICS_CB();
  ~TABLE_STATISTICS_CB();
  MEM_ROOT  mem_root; /* MEM_ROOT to allocate statistical data for the table */
  Table_statistics *table_stats; /* Structure to access the statistical data */
  ulong total_hist_size;         /* Total size of all histograms */
  uint  stats_available;

  bool histograms_exists() const
  {
    return total_hist_size != 0;
  }
  bool unused()
  {
    return usage_count == 0;
  }
  /* Copy (latest) state from TABLE_SHARE to TABLE */
  void update_stats_in_table(TABLE *table);
  friend struct TABLE;
  friend struct TABLE_SHARE;
};

/**
  This structure is shared between different table objects. There is one
  instance of table share per one table in the database.
*/

struct TABLE_SHARE
{
  TABLE_SHARE() = default;                    /* Remove gcc warning */

  /** Category of this table. */
  TABLE_CATEGORY table_category;

  /* hash of field names (contains pointers to elements of field array) */
  HASH	name_hash;			/* hash of field names */
  MEM_ROOT mem_root;
  TYPELIB keynames;			/* Pointers to keynames */
  TYPELIB fieldnames;			/* Pointer to fieldnames */
  TYPELIB *intervals;			/* pointer to interval info */
  mysql_mutex_t LOCK_ha_data;           /* To protect access to ha_data */
  mysql_mutex_t LOCK_share;             /* To protect TABLE_SHARE */
  mysql_mutex_t LOCK_statistics;        /* To protect against concurrent load */

  TDC_element *tdc;

  LEX_CUSTRING tabledef_version;

  engine_option_value *option_list;     /* text options for table */
  ha_table_option_struct *option_struct; /* structure with parsed options */

  /* The following is copied to each TABLE on OPEN */
  Field **field;
  Field **found_next_number_field;
  KEY  *key_info;			/* data of keys in database */
  Virtual_column_info **check_constraints;
  uint	*blob_field;			/* Index to blobs in Field arrray*/
  LEX_CUSTRING vcol_defs;              /* definitions of generated columns */

  /*
    EITS statistics data from the last time the table was opened or ANALYZE
    table was run.
    This is typically same as any related TABLE::stats_cb until ANALYZE
    table is run.
    This pointer is only to be de-referenced under LOCK_share as the
    pointer can change by another thread running ANALYZE TABLE.
    Without using a LOCK_share one can check if the statistics has been
    updated by checking if TABLE::stats_cb != TABLE_SHARE::stats_cb.
  */
  TABLE_STATISTICS_CB *stats_cb;

  uchar	*default_values;		/* row with default values */
  LEX_CSTRING comment;			/* Comment about table */
  CHARSET_INFO *table_charset;		/* Default charset of string fields */

  MY_BITMAP *check_set;                 /* Fields used by check constrant */
  MY_BITMAP all_set;
  /*
    Key which is used for looking-up table in table cache and in the list
    of thread's temporary tables. Has the form of:
      "database_name\0table_name\0" + optional part for temporary tables.

    Note that all three 'table_cache_key', 'db' and 'table_name' members
    must be set (and be non-zero) for tables in table cache. They also
    should correspond to each other.
    To ensure this one can use set_table_cache() methods.
  */
  LEX_CSTRING table_cache_key;
  LEX_CSTRING db;                        /* Pointer to db */
  LEX_CSTRING table_name;                /* Table name (for open) */
  LEX_CSTRING path;                	/* Path to .frm file (from datadir) */
  LEX_CSTRING normalized_path;		/* unpack_filename(path) */
  LEX_CSTRING connect_string;

  /* 
     Set of keys in use, implemented as a Bitmap.
     Excludes keys disabled by ALTER TABLE ... DISABLE KEYS.
  */
  key_map keys_in_use;

  /* The set of ignored indexes for a table. */
  key_map ignored_indexes;

  key_map keys_for_keyread;
  ha_rows min_rows, max_rows;		/* create information */
  ulong   avg_row_length;		/* create information */
  ulong   mysql_version;		/* 0 if .frm is created before 5.0 */
  ulong   reclength;			/* Recordlength */
  /* Stored record length. No generated-only virtual fields are included */
  ulong   stored_rec_length;            

  plugin_ref db_plugin;			/* storage engine plugin */
  inline handlerton *db_type() const	/* table_type for handler */
  { 
    return is_view   ? view_pseudo_hton :
           db_plugin ? plugin_hton(db_plugin) : NULL;
  }
  enum row_type row_type;		/* How rows are stored */
  enum Table_type table_type;
  enum tmp_table_type tmp_table;

  /** Transactional or not. */
  enum ha_choice transactional;
  /** Per-page checksums or not. */
  enum ha_choice page_checksum;

  uint key_block_size;			/* create key_block_size, if used */
  uint stats_sample_pages;		/* number of pages to sample during
					stats estimation, if used, otherwise 0. */
  enum_stats_auto_recalc stats_auto_recalc; /* Automatic recalc of stats. */
  uint null_bytes, last_null_bit_pos;
  /*
    Same as null_bytes, except that if there is only a 'delete-marker' in
    the record then this value is 0.
  */
  uint null_bytes_for_compare;
  uint fields;                          /* number of fields */
  /* number of stored fields, purely virtual not included */
  uint stored_fields;
  uint virtual_fields;                  /* number of purely virtual fields */
  /* number of purely virtual not stored blobs */
  uint virtual_not_stored_blob_fields;
  uint null_fields;                     /* number of null fields */
  uint blob_fields;                     /* number of blob fields */
  uint varchar_fields;                  /* number of varchar fields */
  uint default_fields;                  /* number of default fields */
  uint visible_fields;                  /* number of visible fields */

  uint default_expressions;
  uint table_check_constraints, field_check_constraints;

  uint rec_buff_length;                 /* Size of table->record[] buffer */
  uint keys, key_parts;
  uint ext_key_parts;       /* Total number of key parts in extended keys */
  uint max_key_length, max_unique_length;
  uint uniques;                         /* Number of UNIQUE index */
  uint db_create_options;		/* Create options from database */
  uint db_options_in_use;		/* Options in use */
  uint db_record_offset;		/* if HA_REC_IN_SEQ */
  uint rowid_field_offset;		/* Field_nr +1 to rowid field */
  /* Primary key index number, used in TABLE::key_info[] */
  uint primary_key;                     
  uint next_number_index;               /* autoincrement key number */
  uint next_number_key_offset;          /* autoinc keypart offset in a key */
  uint next_number_keypart;             /* autoinc keypart number in a key */
  enum open_frm_error error;            /* error from open_table_def() */
  uint open_errno;                      /* error from open_table_def() */
  uint column_bitmap_size;
  uchar frm_version;

  enum enum_v_keys { NOT_INITIALIZED=0, NO_V_KEYS, V_KEYS };
  enum_v_keys check_set_initialized;

  bool use_ext_keys;                    /* Extended keys can be used */
  bool null_field_first;
  bool system;                          /* Set if system table (one record) */
  bool not_usable_by_query_cache;
  bool online_backup;                   /* Set if on-line backup supported */
  /*
    This is used by log tables, for tables that have their own internal
    binary logging or for tables that doesn't support statement or row logging
   */
  bool no_replicate;
  bool crashed;
  bool is_view;
  bool can_cmp_whole_record;
  /* This is set for temporary tables where CREATE was binary logged */
  bool table_creation_was_logged;
  bool non_determinstic_insert;
  bool has_update_default_function;
  bool can_do_row_logging;              /* 1 if table supports RBR */
  bool long_unique_table;
  /* 1 if frm version cannot be updated as part of upgrade */
  bool keep_original_mysql_version;

  ulonglong table_map_id;               /* for row-based replication */

  /*
    Things that are incompatible between the stored version and the
    current version. This is a set of HA_CREATE... bits that can be used
    to modify create_info->used_fields for ALTER TABLE.
  */
  ulong incompatible_version;

  /**
    For shares representing views File_parser object with view
    definition read from .FRM file.
  */
  const File_parser *view_def;

  /* For sequence tables, the current sequence state */
  SEQUENCE *sequence;

#ifdef WITH_PARTITION_STORAGE_ENGINE
  /* filled in when reading from frm */
  bool auto_partitioned;
  char *partition_info_str;
  uint  partition_info_str_len;
  uint  partition_info_buffer_size;
  plugin_ref default_part_plugin;
#endif

  /**
    System versioning and application-time periods support.
  */
  struct period_info_t
  {
    field_index_t start_fieldno;
    field_index_t end_fieldno;
    Lex_ident name;
    Lex_ident constr_name;
    uint unique_keys;
    Field *start_field(TABLE_SHARE *s) const
    {
      return s->field[start_fieldno];
    }
    Field *end_field(TABLE_SHARE *s) const
    {
      return s->field[end_fieldno];
    }
  };

  vers_kind_t versioned;
  period_info_t vers;
  period_info_t period;

  bool init_period_from_extra2(period_info_t *period, const uchar *data,
                               const uchar *end);

  Field *vers_start_field()
  {
    DBUG_ASSERT(versioned);
    return field[vers.start_fieldno];
  }

  Field *vers_end_field()
  {
    DBUG_ASSERT(versioned);
    return field[vers.end_fieldno];
  }

  Field *period_start_field() const
  {
    DBUG_ASSERT(period.name);
    return field[period.start_fieldno];
  }

  Field *period_end_field() const
  {
    DBUG_ASSERT(period.name);
    return field[period.end_fieldno];
  }

  /**
    Cache the checked structure of this table.

    The pointer data is used to describe the structure that
    a instance of the table must have. Each element of the
    array specifies a field that must exist on the table.

    The pointer is cached in order to perform the check only
    once -- when the table is loaded from the disk.
  */
  const TABLE_FIELD_DEF *table_field_def_cache;

  /** Main handler's share */
  Handler_share *ha_share;

  /** Instrumentation for this table share. */
  PSI_table_share *m_psi;

  inline void reset() { bzero((void*)this, sizeof(*this)); }

  /*
    Set share's table cache key and update its db and table name appropriately.

    SYNOPSIS
      set_table_cache_key()
        key_buff    Buffer with already built table cache key to be
                    referenced from share.
        key_length  Key length.

    NOTES
      Since 'key_buff' buffer will be referenced from share it should has same
      life-time as share itself.
      This method automatically ensures that TABLE_SHARE::table_name/db have
      appropriate values by using table cache key as their source.
  */

  void set_table_cache_key(char *key_buff, uint key_length)
  {
    table_cache_key.str= key_buff;
    table_cache_key.length= key_length;
    /*
      Let us use the fact that the key is "db/0/table_name/0" + optional
      part for temporary tables.
    */
    db.str=            table_cache_key.str;
    db.length=         strlen(db.str);
    table_name.str=    db.str + db.length + 1;
    table_name.length= strlen(table_name.str);
  }


  /*
    Set share's table cache key and update its db and table name appropriately.

    SYNOPSIS
      set_table_cache_key()
        key_buff    Buffer to be used as storage for table cache key
                    (should be at least key_length bytes).
        key         Value for table cache key.
        key_length  Key length.

    NOTE
      Since 'key_buff' buffer will be used as storage for table cache key
      it should has same life-time as share itself.
  */

  void set_table_cache_key(char *key_buff, const char *key, uint key_length)
  {
    memcpy(key_buff, key, key_length);
    set_table_cache_key(key_buff, key_length);
  }

  inline bool require_write_privileges()
  {
    return (table_category == TABLE_CATEGORY_LOG);
  }

  inline ulonglong get_table_def_version()
  {
    return table_map_id;
  }

  /**
    Convert unrelated members of TABLE_SHARE to one enum
    representing its type.

    @todo perhaps we need to have a member instead of a function.
  */
  enum enum_table_ref_type get_table_ref_type() const
  {
    if (is_view)
      return TABLE_REF_VIEW;
    switch (tmp_table) {
    case NO_TMP_TABLE:
      return TABLE_REF_BASE_TABLE;
    case SYSTEM_TMP_TABLE:
      return TABLE_REF_I_S_TABLE;
    default:
      return TABLE_REF_TMP_TABLE;
    }
  }
  /**
    Return a table metadata version.
     * for base tables and views, we return table_map_id.
       It is assigned from a global counter incremented for each
       new table loaded into the table definition cache (TDC).
     * for temporary tables it's table_map_id again. But for
       temporary tables table_map_id is assigned from
       thd->query_id. The latter is assigned from a thread local
       counter incremented for every new SQL statement. Since
       temporary tables are thread-local, each temporary table
       gets a unique id.
     * for everything else (e.g. information schema tables),
       the version id is zero.

   This choice of version id is a large compromise
   to have a working prepared statement validation in 5.1. In
   future version ids will be persistent, as described in WL#4180.

   Let's try to explain why and how this limited solution allows
   to validate prepared statements.

   Firstly, sets (in mathematical sense) of version numbers
   never intersect for different table types. Therefore,
   version id of a temporary table is never compared with
   a version id of a view, and vice versa.

   Secondly, for base tables and views, we know that each DDL flushes
   the respective share from the TDC. This ensures that whenever
   a table is altered or dropped and recreated, it gets a new
   version id.
   Unfortunately, since elements of the TDC are also flushed on
   LRU basis, this choice of version ids leads to false positives.
   E.g. when the TDC size is too small, we may have a SELECT
   * FROM INFORMATION_SCHEMA.TABLES flush all its elements, which
   in turn will lead to a validation error and a subsequent
   reprepare of all prepared statements.  This is
   considered acceptable, since as long as prepared statements are
   automatically reprepared, spurious invalidation is only
   a performance hit. Besides, no better simple solution exists.

   For temporary tables, using thd->query_id ensures that if
   a temporary table was altered or recreated, a new version id is
   assigned. This suits validation needs very well and will perhaps
   never change.

   Metadata of information schema tables never changes.
   Thus we can safely assume 0 for a good enough version id.

   Finally, by taking into account table type, we always
   track that a change has taken place when a view is replaced
   with a base table, a base table is replaced with a temporary
   table and so on.

   @sa TABLE_LIST::is_the_same_definition()
  */
  ulonglong get_table_ref_version() const
  {
    return (tmp_table == SYSTEM_TMP_TABLE) ? 0 : table_map_id;
  }

  bool visit_subgraph(Wait_for_flush *waiting_ticket,
                      MDL_wait_for_graph_visitor *gvisitor);

  bool wait_for_old_version(THD *thd, struct timespec *abstime,
                            uint deadlock_weight);
  /** Release resources and free memory occupied by the table share. */
  void destroy();

  void set_use_ext_keys_flag(bool fl) 
  {
    use_ext_keys= fl;
  }
  
  uint actual_n_key_parts(THD *thd);

  LEX_CUSTRING *frm_image; ///< only during CREATE TABLE (@sa ha_create_table)

  /*
    populates TABLE_SHARE from the table description in the binary frm image.
    if 'write' is true, this frm image is also written into a corresponding
    frm file, that serves as a persistent metadata cache to avoid
    discovering the table over and over again
  */
  int init_from_binary_frm_image(THD *thd, bool write,
                                 const uchar *frm_image, size_t frm_length,
                                 const uchar *par_image=0,
                                 size_t par_length=0);

  /*
    populates TABLE_SHARE from the table description, specified as the
    complete CREATE TABLE sql statement.
    if 'write' is true, this frm image is also written into a corresponding
    frm file, that serves as a persistent metadata cache to avoid
    discovering the table over and over again
  */
  int init_from_sql_statement_string(THD *thd, bool write,
                                     const char *sql, size_t sql_length);
  /*
    writes the frm image to an frm file, corresponding to this table
  */
  bool write_frm_image(const uchar *frm_image, size_t frm_length);
  bool write_par_image(const uchar *par_image, size_t par_length);

  /* Only used by S3 */
  bool write_frm_image(void)
  { return frm_image ? write_frm_image(frm_image->str, frm_image->length) : 0; }

  /*
    returns an frm image for this table.
    the memory is allocated and must be freed later
  */
  bool read_frm_image(const uchar **frm_image, size_t *frm_length);

  /* frees the memory allocated in read_frm_image */
  void free_frm_image(const uchar *frm);

  void set_overlapped_keys();
  void set_ignored_indexes();
  key_map usable_indexes(THD *thd);
  bool old_long_hash_function() const
  {
    return mysql_version < 100428 ||
           (mysql_version >= 100500 && mysql_version < 100519) ||
           (mysql_version >= 100600 && mysql_version < 100612) ||
           (mysql_version >= 100700 && mysql_version < 100708) ||
           (mysql_version >= 100800 && mysql_version < 100807) ||
           (mysql_version >= 100900 && mysql_version < 100905) ||
           (mysql_version >= 101000 && mysql_version < 101003) ||
           (mysql_version >= 101100 && mysql_version < 101102);
  }
  Item_func_hash *make_long_hash_func(THD *thd,
                                      MEM_ROOT *mem_root,
                                      List<Item> *field_list) const;
  void update_engine_independent_stats(TABLE_STATISTICS_CB *stat);
  bool histograms_exists();
};

/* not NULL, but cannot be dereferenced */
#define UNUSABLE_TABLE_SHARE ((TABLE_SHARE*)1)

/**
   Class is used as a BLOB field value storage for
   intermediate GROUP_CONCAT results. Used only for
   GROUP_CONCAT with  DISTINCT or ORDER BY options.
 */

class Blob_mem_storage: public Sql_alloc
{
private:
  MEM_ROOT storage;
  /**
    Sign that some values were cut
    during saving into the storage.
  */
  bool truncated_value;
public:
  Blob_mem_storage() :truncated_value(false)
  {
    init_alloc_root(key_memory_blob_mem_storage,
                    &storage, MAX_FIELD_VARCHARLENGTH, 0, MYF(0));
  }
  ~ Blob_mem_storage()
  {
    free_root(&storage, MYF(0));
  }
  void reset()
  {
    free_root(&storage, MYF(MY_MARK_BLOCKS_FREE));
    truncated_value= false;
  }
  /**
     Fuction creates duplicate of 'from'
     string in 'storage' MEM_ROOT.

     @param from           string to copy
     @param length         string length

     @retval Pointer to the copied string.
     @retval 0 if an error occurred.
  */
  char *store(const char *from, size_t length)
  {
    return (char*) memdup_root(&storage, from, length);
  }
  void set_truncated_value(bool is_truncated_value)
  {
    truncated_value= is_truncated_value;
  }
  bool is_truncated_value() { return truncated_value; }
};


/* Information for one open table */
enum index_hint_type
{
  INDEX_HINT_IGNORE,
  INDEX_HINT_USE,
  INDEX_HINT_FORCE
};

struct st_cond_statistic;

#define      CHECK_ROW_FOR_NULLS_TO_REJECT   (1 << 0)
#define      REJECT_ROW_DUE_TO_NULL_FIELDS   (1 << 1)

class SplM_opt_info;

struct vers_select_conds_t;

struct TABLE
{
  TABLE() = default;                               /* Remove gcc warning */

  TABLE_SHARE	*s;
  handler	*file;
  TABLE *next, *prev;

private:
  /**
     Links for the list of all TABLE objects for this share.
     Declared as private to avoid direct manipulation with those objects.
     One should use methods of I_P_List template instead.
  */
  TABLE *share_all_next, **share_all_prev;
  TABLE *global_free_next, **global_free_prev;
  friend struct All_share_tables;
  friend struct Table_cache_instance;

public:

  uint32 instance; /** Table cache instance this TABLE is belonging to */
  THD	*in_use;                        /* Which thread uses this */

  uchar *record[3];			/* Pointer to records */
  uchar *write_row_record;		/* Used as optimisation in
					   THD::write_row */
  uchar *insert_values;                  /* used by INSERT ... UPDATE */
  /* 
    Map of keys that can be used to retrieve all data from this table 
    needed by the query without reading the row.
  */
  key_map covering_keys, intersect_keys;
  /*
    A set of keys that can be used in the query that references this
    table.

    All indexes disabled on the table's TABLE_SHARE (see TABLE::s) will be 
    subtracted from this set upon instantiation. Thus for any TABLE t it holds
    that t.keys_in_use_for_query is a subset of t.s.keys_in_use. Generally we 
    must not introduce any new keys here (see setup_tables).

    The set is implemented as a bitmap.
  */
  key_map keys_in_use_for_query;
  /* Map of keys that can be used to calculate GROUP BY without sorting */
  key_map keys_in_use_for_group_by;
  /* Map of keys that can be used to calculate ORDER BY without sorting */
  key_map keys_in_use_for_order_by;
  /* Map of keys dependent on some constraint */
  key_map constraint_dependent_keys;
  KEY  *key_info;			/* data of keys in database */

  Field **field;                        /* Pointer to fields */
  Field **vfield;                       /* Pointer to virtual fields*/
  Field **default_field;                /* Fields with non-constant DEFAULT */
  Field *next_number_field;		/* Set if next_number is activated */
  Field *found_next_number_field;	/* Set on open */
  Virtual_column_info **check_constraints;

  /* Table's triggers, 0 if there are no of them */
  Table_triggers_list *triggers;
  TABLE_LIST *pos_in_table_list;/* Element referring to this table */
  /* Position in thd->locked_table_list under LOCK TABLES */
  TABLE_LIST *pos_in_locked_tables;
  /* Tables used in DEFAULT and CHECK CONSTRAINT (normally sequence tables) */
  TABLE_LIST *internal_tables;

  /*
    Not-null for temporary tables only. Non-null values means this table is
    used to compute GROUP BY, it has a unique of GROUP BY columns.
    (set by create_tmp_table)
  */
  ORDER		*group;
  String	alias;            	  /* alias or table name */
  uchar		*null_flags;
  MY_BITMAP     def_read_set, def_write_set, tmp_set;
  MY_BITMAP     def_rpl_write_set;
  MY_BITMAP     eq_join_set;         /* used to mark equi-joined fields */
  MY_BITMAP     cond_set;   /* used to mark fields from sargable conditions*/
  /* Active column sets */
  MY_BITMAP     *read_set, *write_set, *rpl_write_set;
  /* On INSERT: fields that the user specified a value for */
  MY_BITMAP	has_value_set;

  /*
   The ID of the query that opened and is using this table. Has different
   meanings depending on the table type.

   Temporary tables:

   table->query_id is set to thd->query_id for the duration of a statement
   and is reset to 0 once it is closed by the same statement. A non-zero
   table->query_id means that a statement is using the table even if it's
   not the current statement (table is in use by some outer statement).

   Non-temporary tables:

   Under pre-locked or LOCK TABLES mode: query_id is set to thd->query_id
   for the duration of a statement and is reset to 0 once it is closed by
   the same statement. A non-zero query_id is used to control which tables
   in the list of pre-opened and locked tables are actually being used.
  */
  query_id_t	query_id;

  /*
    This structure is used for statistical data on the table that
    is collected by the function collect_statistics_for_table
  */
  Table_statistics *collected_stats;

  /* The estimate of the number of records in the table used by optimizer */ 
  ha_rows used_stat_records;

  key_map opt_range_keys;
  /* 
    The following structure is filled for each key that has
    opt_range_keys.is_set(key) == TRUE
  */
  struct OPT_RANGE
  {
    uint        key_parts;
    uint        ranges;
    ha_rows     rows;
    double      cost;
    /*
      If there is a range access by i-th index then the cost of
      index only access for it is stored in index_only_costs[i]
    */
    double      index_only_cost;
  } *opt_range;
  /* 
     Bitmaps of key parts that =const for the duration of join execution. If
     we're in a subquery, then the constant may be different across subquery
     re-executions.
  */
  key_part_map *const_key_parts;

  /* 
    Estimate of number of records that satisfy SARGable part of the table
    condition, or table->file->records if no SARGable condition could be
    constructed.
    This value is used by join optimizer as an estimate of number of records
    that will pass the table condition (condition that depends on fields of 
    this table and constants)
  */
  ha_rows       opt_range_condition_rows;

  double cond_selectivity;
  List<st_cond_statistic> *cond_selectivity_sampling_explain;

  table_map	map;                    /* ID bit of table (1,2,4,8,16...) */

  uint          lock_position;          /* Position in MYSQL_LOCK.table */
  uint          lock_data_start;        /* Start pos. in MYSQL_LOCK.locks */
  uint          lock_count;             /* Number of locks */
  uint		tablenr,used_fields;
  uint          temp_pool_slot;		/* Used by intern temp tables */
  uint		status;                 /* What's in record[0] */
  uint		db_stat;		/* mode of file as in handler.h */
  /* number of select if it is derived table */
  uint          derived_select_number;
  /*
    Possible values:
     - 0 by default
     - JOIN_TYPE_{LEFT|RIGHT} if the table is inner w.r.t an outer join
       operation
     - 1 if the SELECT has mixed_implicit_grouping=1. example:
       select max(col1), col2 from t1. In this case, the query produces
       one row with all columns having NULL values.

    Interpetation: If maybe_null!=0, all fields of the table are considered
    NULLable (and have NULL values when null_row=true)
  */
  uint maybe_null;
  int		current_lock;           /* Type of lock on table */
  bool copy_blobs;			/* copy_blobs when storing */
  /*
    Set if next_number_field is in the UPDATE fields of INSERT ... ON DUPLICATE
    KEY UPDATE.
  */
  bool next_number_field_updated;

  /*
    If true, the current table row is considered to have all columns set to 
    NULL, including columns declared as "not null" (see maybe_null).
  */
  bool null_row;
  /*
    No rows that contain null values can be placed into this table.
    Currently this flag can be set to true only for a temporary table
    that used to store the result of materialization of a subquery.
  */
  bool no_rows_with_nulls;
  /*
    This field can contain two bit flags: 
      CHECK_ROW_FOR_NULLS_TO_REJECT
      REJECT_ROW_DUE_TO_NULL_FIELDS
    The first flag is set for the dynamic contexts where it is prohibited
    to write any null into the table.
    The second flag is set only if the first flag is set on.
    The informs the outer scope that there was an attept to write null
    into a field of the table in the context where it is prohibited.
    This flag should be set off as soon as the first flag is set on.
    Currently these flags are used only the tables tno_rows_with_nulls set
    to true. 
  */       
  uint8 null_catch_flags;

  /*
    TODO: Each of the following flags take up 8 bits. They can just as easily
    be put into one single unsigned long and instead of taking up 18
    bytes, it would take up 4.
  */
  bool force_index;

  /**
    Flag set when the statement contains FORCE INDEX FOR ORDER BY
    See TABLE_LIST::process_index_hints().
  */
  bool force_index_order;

  /**
    Flag set when the statement contains FORCE INDEX FOR GROUP BY
    See TABLE_LIST::process_index_hints().
  */
  bool force_index_group;
  /*
    TRUE<=> this table was created with create_tmp_table(... distinct=TRUE..)
    call
  */
  bool distinct;
  bool const_table,no_rows, used_for_duplicate_elimination;
  /**
    Forces DYNAMIC Aria row format for internal temporary tables.
  */
  bool keep_row_order;

  bool no_keyread;
  /**
    If set, indicate that the table is not replicated by the server.
  */
  bool locked_by_logger;
  bool locked_by_name;
  bool fulltext_searched;
  bool no_cache;
  /* To signal that the table is associated with a HANDLER statement */
  bool open_by_handler;
  /*
    To indicate that a non-null value of the auto_increment field
    was provided by the user or retrieved from the current record.
    Used only in the MODE_NO_AUTO_VALUE_ON_ZERO mode.
  */
  bool auto_increment_field_not_null;
  /*
     NOTE: alias_name_used is only a hint! It works only in need_correct_ident()
     condition. On other cases it is FALSE even if table_name is alias.

     E.g. in update t1 as x set a = 1
  */
  bool alias_name_used;              /* true if table_name is alias */
  bool get_fields_in_item_tree;      /* Signal to fix_field */
  List<Virtual_column_info> vcol_refix_list;
private:
  bool m_needs_reopen;
  bool created;    /* For tmp tables. TRUE <=> tmp table was actually created.*/
public:
#ifdef HAVE_REPLICATION
  /* used in RBR Triggers */
  bool master_had_triggers;
#endif

  REGINFO reginfo;			/* field connections */
  MEM_ROOT mem_root;
  /* this is for temporary tables created inside Item_func_group_concat */
  union {
    bool group_concat;                  /* used during create_tmp_table() */
    Blob_mem_storage *blob_storage;     /* used after create_tmp_table()  */
  };
  GRANT_INFO grant;
  /*
    The arena which the items for expressions from the table definition
    are associated with.  
    Currently only the items of the expressions for virtual columns are
    associated with this arena.
    TODO: To attach the partitioning expressions to this arena.  
  */
  Query_arena *expr_arena;
#ifdef WITH_PARTITION_STORAGE_ENGINE
  partition_info *part_info;            /* Partition related information */
  /* If true, all partitions have been pruned away */
  bool all_partitions_pruned_away;
#endif
  uint max_keys; /* Size of allocated key_info array. */
  bool stats_is_read;     /* Persistent statistics is read for the table */
  bool histograms_are_read;
  MDL_ticket *mdl_ticket;

  /*
    This is used only for potentially splittable materialized tables and it
    points to the info used by the optimizer to apply splitting optimization
  */
  SplM_opt_info *spl_opt_info;
  key_map keys_usable_for_splitting;

  /*
    Conjunction of the predicates of the form IS NOT NULL(f) where f refers to
    a column of this TABLE such that they can be inferred from the condition
    of the  WHERE clause or from some ON expression of the processed select
    and can be useful for range optimizer.
  */
  Item *notnull_cond;
  TABLE_STATISTICS_CB *stats_cb;

  inline void reset() { bzero((void*)this, sizeof(*this)); }
  void init(THD *thd, TABLE_LIST *tl);
  bool fill_item_list(List<Item> *item_list) const;
  void reset_item_list(List<Item> *item_list, uint skip) const;
  void clear_column_bitmaps(void);
  void prepare_for_position(void);
  MY_BITMAP *prepare_for_keyread(uint index, MY_BITMAP *map);
  MY_BITMAP *prepare_for_keyread(uint index)
  { return prepare_for_keyread(index, &tmp_set); }
  void mark_index_columns(uint index, MY_BITMAP *bitmap);
  void mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap);
  void mark_index_columns_for_read(uint index);
  void restore_column_maps_after_keyread(MY_BITMAP *backup);
  void mark_auto_increment_column(bool insert_fl);
  void mark_columns_needed_for_update(void);
  void mark_columns_needed_for_delete(void);
  void mark_columns_needed_for_insert(void);
  void mark_columns_per_binlog_row_image(void);
  inline bool mark_column_with_deps(Field *field);
  inline bool mark_virtual_column_with_deps(Field *field);
  inline void mark_virtual_column_deps(Field *field);
  bool mark_virtual_columns_for_write(bool insert_fl);
  bool check_virtual_columns_marked_for_read();
  bool check_virtual_columns_marked_for_write();
  void mark_default_fields_for_write(bool insert_fl);
  void mark_columns_used_by_virtual_fields(void);
  void mark_check_constraint_columns_for_read(void);
  int verify_constraints(bool ignore_failure);
  void free_engine_stats();
  void update_engine_independent_stats();
  inline void column_bitmaps_set(MY_BITMAP *read_set_arg)
  {
    read_set= read_set_arg;
    if (file)
      file->column_bitmaps_signal();
  }
  inline void column_bitmaps_set(MY_BITMAP *read_set_arg,
                                 MY_BITMAP *write_set_arg)
  {
    read_set= read_set_arg;
    write_set= write_set_arg;
    if (file)
      file->column_bitmaps_signal();
  }
  inline void column_bitmaps_set_no_signal(MY_BITMAP *read_set_arg,
                                           MY_BITMAP *write_set_arg)
  {
    read_set= read_set_arg;
    write_set= write_set_arg;
  }
  inline void use_all_columns()
  {
    column_bitmaps_set(&s->all_set, &s->all_set);
  }
  inline void use_all_stored_columns();
  inline void default_column_bitmaps()
  {
    read_set= &def_read_set;
    write_set= &def_write_set;
    rpl_write_set= 0;
  }
  /** Should this instance of the table be reopened? */
  inline bool needs_reopen()
  { return !db_stat || m_needs_reopen; }
  /*
    Mark that all current connection instances of the table should be
    reopen at end of statement
  */
  void mark_table_for_reopen();
  /* Should only be called from Locked_tables_list::mark_table_for_reopen() */
  void internal_set_needs_reopen(bool value)
  {
    m_needs_reopen= value;
  }

  bool init_expr_arena(MEM_ROOT *mem_root);

  bool alloc_keys(uint key_count);
  bool check_tmp_key(uint key, uint key_parts,
                     uint (*next_field_no) (uchar *), uchar *arg);
  bool add_tmp_key(uint key, uint key_parts,
                   uint (*next_field_no) (uchar *), uchar *arg,
                   bool unique);
  void create_key_part_by_field(KEY_PART_INFO *key_part_info,
                                Field *field, uint fieldnr);
  void use_index(int key_to_save);
  void set_table_map(table_map map_arg, uint tablenr_arg)
  {
    map= map_arg;
    tablenr= tablenr_arg;
  }

  /// Return true if table is instantiated, and false otherwise.
  bool is_created() const
  {
    DBUG_ASSERT(!created || file != 0);
    return created;
  }

  /**
    Set the table as "created", and enable flags in storage engine
    that could not be enabled without an instantiated table.
  */
  void set_created()
  {
    if (created)
      return;
    if (file->keyread_enabled())
      file->extra(HA_EXTRA_KEYREAD);
    created= true;
  }

  void reset_created()
  {
    created= 0;
  }

  /*
    Returns TRUE if the table is filled at execution phase (and so, the
    optimizer must not do anything that depends on the contents of the table,
    like range analysis or constant table detection)
  */
  bool is_filled_at_execution();

  bool update_const_key_parts(COND *conds);
  void update_keypart_vcol_info();

  inline void initialize_opt_range_structures();

  my_ptrdiff_t default_values_offset() const
  { return (my_ptrdiff_t) (s->default_values - record[0]); }

  void move_fields(Field **ptr, const uchar *to, const uchar *from);
  void remember_blob_values(String *blob_storage);
  void restore_blob_values(String *blob_storage);

  uint actual_n_key_parts(KEY *keyinfo);
  ulong actual_key_flags(KEY *keyinfo);
  int update_virtual_field(Field *vf, bool ignore_warnings);
  int update_virtual_fields(handler *h, enum_vcol_update_mode update_mode);
  int update_default_fields(bool ignore_errors);
  void evaluate_update_default_function();
  void reset_default_fields();
  inline ha_rows stat_records() { return used_stat_records; }

  void prepare_triggers_for_insert_stmt_or_event();
  bool prepare_triggers_for_delete_stmt_or_event();
  bool prepare_triggers_for_update_stmt_or_event();

  Field **field_to_fill();
  bool validate_default_values_of_unset_fields(THD *thd) const;

  bool insert_all_rows_into_tmp_table(THD *thd, 
                                      TABLE *tmp_table,
                                      TMP_TABLE_PARAM *tmp_table_param,
                                      bool with_cleanup);
  bool vcol_fix_expr(THD *thd);
  bool vcol_cleanup_expr(THD *thd);
  Field *find_field_by_name(LEX_CSTRING *str) const;
  bool export_structure(THD *thd, class Row_definition_list *defs);
  bool is_splittable() { return spl_opt_info != NULL; }
  void set_spl_opt_info(SplM_opt_info *spl_info);
  void deny_splitting();
  double get_materialization_cost(); // Now used only if is_splittable()==true
  void add_splitting_info_for_key_field(struct KEY_FIELD *key_field);

  key_map with_impossible_ranges;

  /* Number of cost info elements for possible range filters */
  uint range_rowid_filter_cost_info_elems;
  /* Pointer to the array of cost info elements for range filters */
  Range_rowid_filter_cost_info *range_rowid_filter_cost_info;
  /* The array of pointers to cost info elements for range filters */
  Range_rowid_filter_cost_info **range_rowid_filter_cost_info_ptr;

  void init_cost_info_for_usable_range_rowid_filters(THD *thd);
  void prune_range_rowid_filters();
  void trace_range_rowid_filters(THD *thd) const;
  Range_rowid_filter_cost_info *
  best_range_rowid_filter_for_partial_join(uint access_key_no,
                                           double records,
                                           double access_cost_factor);

  /**
    System Versioning support
   */
  bool vers_write;

  bool versioned() const
  {
    return s->versioned;
  }

  bool versioned(vers_kind_t type) const
  {
    DBUG_ASSERT(type);
    return s->versioned == type;
  }

  bool versioned_write() const
  {
    DBUG_ASSERT(versioned() || !vers_write);
    return versioned() ? vers_write : false;
  }

  bool versioned_write(vers_kind_t type) const
  {
    DBUG_ASSERT(type);
    DBUG_ASSERT(versioned() || !vers_write);
    return versioned(type) ? vers_write : false;
  }

  Field *vers_start_field() const
  {
    DBUG_ASSERT(s->versioned);
    return field[s->vers.start_fieldno];
  }

  Field *vers_end_field() const
  {
    DBUG_ASSERT(s->versioned);
    return field[s->vers.end_fieldno];
  }

  Field *period_start_field() const
  {
    DBUG_ASSERT(s->period.name);
    return field[s->period.start_fieldno];
  }

  Field *period_end_field() const
  {
    DBUG_ASSERT(s->period.name);
    return field[s->period.end_fieldno];
  }


  ulonglong vers_start_id() const;
  ulonglong vers_end_id() const;

  int update_generated_fields();
  void period_prepare_autoinc();
  int period_make_insert(Item *src, Field *dst);
  int insert_portion_of_time(THD *thd, const vers_select_conds_t &period_conds,
                             ha_rows *rows_inserted);
  bool vers_check_update(List<Item> &items);
  static bool check_period_overlaps(const KEY &key, const uchar *lhs, const uchar *rhs);
  int delete_row();
  /* Used in majority of DML (called from fill_record()) */
  void vers_update_fields();
  /* Used in DELETE, DUP REPLACE and insert history row */
  void vers_update_end();
  void find_constraint_correlated_indexes();

/** Number of additional fields used in versioned tables */
#define VERSIONING_FIELDS 2
};


/**
   Helper class which specifies which members of TABLE are used for
   participation in the list of used/unused TABLE objects for the share.
*/

struct TABLE_share
{
  static inline TABLE **next_ptr(TABLE *l)
  {
    return &l->next;
  }
  static inline TABLE ***prev_ptr(TABLE *l)
  {
    return (TABLE ***) &l->prev;
  }
};

struct All_share_tables
{
  static inline TABLE **next_ptr(TABLE *l)
  {
    return &l->share_all_next;
  }
  static inline TABLE ***prev_ptr(TABLE *l)
  {
    return &l->share_all_prev;
  }
};

typedef I_P_List <TABLE, All_share_tables> All_share_tables_list;

enum enum_schema_table_state
{ 
  NOT_PROCESSED= 0,
  PROCESSED_BY_CREATE_SORT_INDEX,
  PROCESSED_BY_JOIN_EXEC
};

enum enum_fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_NO_ACTION,
  FK_OPTION_CASCADE, FK_OPTION_SET_NULL, FK_OPTION_SET_DEFAULT };

typedef struct st_foreign_key_info
{
  LEX_CSTRING *foreign_id;
  LEX_CSTRING *foreign_db;
  LEX_CSTRING *foreign_table;
  LEX_CSTRING *referenced_db;
  LEX_CSTRING *referenced_table;
  enum_fk_option update_method;
  enum_fk_option delete_method;
  LEX_CSTRING *referenced_key_name;
  List<LEX_CSTRING> foreign_fields;
  List<LEX_CSTRING> referenced_fields;
private:
  unsigned char *fields_nullable= nullptr;

  /**
    Get the number of fields exist in foreign key relationship
  */
  unsigned get_n_fields() const noexcept
  {
    unsigned n_fields= foreign_fields.elements;
    if (n_fields == 0)
      n_fields= referenced_fields.elements;
    return n_fields;
  }

  /**
    Assign nullable field for referenced and foreign fields
    based on number of fields. This nullable fields
    should be allocated by engine for passing the
    foreign key information
    @param thd thread to allocate the memory
    @param num_fields number of fields
  */
  void assign_nullable(THD *thd, unsigned num_fields) noexcept
  {
    fields_nullable=
      (unsigned char *)thd_calloc(thd,
                                  my_bits_in_bytes(2 * num_fields));
  }

public:
  /**
    Set nullable bit for the field in the given field
    @param referenced set null bit for referenced column
    @param field field number
    @param n_fields number of fields
  */
  void set_nullable(THD *thd, bool referenced,
                    unsigned field, unsigned n_fields) noexcept
  {
    if (!fields_nullable)
      assign_nullable(thd, n_fields);
    DBUG_ASSERT(fields_nullable);
    DBUG_ASSERT(field < n_fields);
    size_t bit= size_t{field} + referenced * n_fields;
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion"
#endif
    fields_nullable[bit / 8]|= static_cast<unsigned char>(1 << (bit % 8));
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
  }

  /**
    Check whether the given field_no in foreign key field or
    referenced key field
    @param referenced check referenced field nullable value
    @param field  field number
    @return true if the field is nullable or false if it is not
  */
  bool is_nullable(bool referenced, unsigned field) const noexcept
  {
    if (!fields_nullable)
      return false;
    unsigned n_field= get_n_fields();
    DBUG_ASSERT(field < n_field);
    size_t bit= size_t{field} + referenced * n_field;
    return fields_nullable[bit / 8] & (1U << (bit % 8));
  }

} FOREIGN_KEY_INFO;

LEX_CSTRING *fk_option_name(enum_fk_option opt);
static inline bool fk_modifies_child(enum_fk_option opt)
{
  return opt >= FK_OPTION_CASCADE;
}


class IS_table_read_plan;

/*
  Types of derived tables. The ending part is a bitmap of phases that are
  applicable to a derived table of the type.
*/
#define DTYPE_ALGORITHM_UNDEFINED    0U
#define DTYPE_VIEW                   1U
#define DTYPE_TABLE                  2U
#define DTYPE_MERGE                  4U
#define DTYPE_MATERIALIZE            8U
#define DTYPE_MULTITABLE             16U
#define DTYPE_MASK                   (DTYPE_VIEW|DTYPE_TABLE|DTYPE_MULTITABLE)

/*
  Phases of derived tables/views handling, see sql_derived.cc
  Values are used as parts of a bitmap attached to derived table types.
*/
#define DT_INIT             1U
#define DT_PREPARE          2U
#define DT_OPTIMIZE         4U
#define DT_MERGE            8U
#define DT_MERGE_FOR_INSERT 16U
#define DT_CREATE           32U
#define DT_FILL             64U
#define DT_REINIT           128U
#define DT_PHASES           8U
/* Phases that are applicable to all derived tables. */
#define DT_COMMON       (DT_INIT + DT_PREPARE + DT_REINIT + DT_OPTIMIZE)
/* Phases that are applicable only to materialized derived tables. */
#define DT_MATERIALIZE  (DT_CREATE + DT_FILL)

#define DT_PHASES_MERGE (DT_COMMON | DT_MERGE | DT_MERGE_FOR_INSERT)
#define DT_PHASES_MATERIALIZE (DT_COMMON | DT_MATERIALIZE)

#define VIEW_ALGORITHM_UNDEFINED 0
/* Special value for ALTER VIEW: inherit original algorithm. */
#define VIEW_ALGORITHM_INHERIT   DTYPE_VIEW
#define VIEW_ALGORITHM_MERGE    (DTYPE_VIEW | DTYPE_MERGE)
#define VIEW_ALGORITHM_TMPTABLE (DTYPE_VIEW | DTYPE_MATERIALIZE)

/*
  View algorithm values as stored in the FRM. Values differ from in-memory
  representation for backward compatibility.
*/

#define VIEW_ALGORITHM_UNDEFINED_FRM  0U
#define VIEW_ALGORITHM_MERGE_FRM      1U
#define VIEW_ALGORITHM_TMPTABLE_FRM   2U

#define JOIN_TYPE_LEFT	1U
#define JOIN_TYPE_RIGHT	2U
#define JOIN_TYPE_OUTER 4U	/* Marker that this is an outer join */

/* view WITH CHECK OPTION parameter options */
#define VIEW_CHECK_NONE       0
#define VIEW_CHECK_LOCAL      1
#define VIEW_CHECK_CASCADED   2

/* result of view WITH CHECK OPTION parameter check */
#define VIEW_CHECK_OK         0
#define VIEW_CHECK_ERROR      1
#define VIEW_CHECK_SKIP       2

/** The threshold size a blob field buffer before it is freed */
#define MAX_TDC_BLOB_SIZE 65536

/** number of bytes used by field positional indexes in frm */
constexpr uint frm_fieldno_size= 2;
/** number of bytes used by key position number in frm */
constexpr uint frm_keyno_size= 2;
static inline field_index_t read_frm_fieldno(const uchar *data)
{ return uint2korr(data); }
static inline void store_frm_fieldno(uchar *data, field_index_t fieldno)
{ int2store(data, fieldno); }
static inline uint16 read_frm_keyno(const uchar *data)
{ return uint2korr(data); }
static inline void store_frm_keyno(uchar *data, uint16 keyno)
{ int2store(data, keyno); }
static inline size_t extra2_str_size(size_t len)
{ return (len > 255 ? 3 : 1) + len; }

class select_unit;
class TMP_TABLE_PARAM;

Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
                        LEX_CSTRING *name);

struct Field_translator
{
  Item *item;
  LEX_CSTRING name;
};


/*
  Column reference of a NATURAL/USING join. Since column references in
  joins can be both from views and stored tables, may point to either a
  Field (for tables), or a Field_translator (for views).
*/

class Natural_join_column: public Sql_alloc
{
public:
  Field_translator *view_field;  /* Column reference of merge view. */
  Item_field       *table_field; /* Column reference of table or temp view. */
  TABLE_LIST *table_ref; /* Original base table/view reference. */
  /*
    True if a common join column of two NATURAL/USING join operands. Notice
    that when we have a hierarchy of nested NATURAL/USING joins, a column can
    be common at some level of nesting but it may not be common at higher
    levels of nesting. Thus this flag may change depending on at which level
    we are looking at some column.
  */
  bool is_common;
public:
  Natural_join_column(Field_translator *field_param, TABLE_LIST *tab);
  Natural_join_column(Item_field *field_param, TABLE_LIST *tab);
  LEX_CSTRING *name();
  Item *create_item(THD *thd);
  Field *field();
  const char *safe_table_name();
  const char *safe_db_name();
  GRANT_INFO *grant();
};


/**
   Type of table which can be open for an element of table list.
*/

enum enum_open_type
{
  OT_TEMPORARY_OR_BASE= 0, OT_TEMPORARY_ONLY, OT_BASE_ONLY
};


class SJ_MATERIALIZATION_INFO;
class Index_hint;
class Item_in_subselect;

/* trivial class, for %union in sql_yacc.yy */
struct vers_history_point_t
{
  vers_kind_t unit;
  Item *item;
};

class Vers_history_point : public vers_history_point_t
{
  void fix_item();

public:
  Vers_history_point() { empty(); }
  Vers_history_point(vers_kind_t unit_arg, Item *item_arg)
  {
    unit= unit_arg;
    item= item_arg;
    fix_item();
  }
  Vers_history_point(vers_history_point_t p)
  {
    unit= p.unit;
    item= p.item;
    fix_item();
  }
  void empty() { unit= VERS_TIMESTAMP; item= NULL; }
  void print(String *str, enum_query_type, const char *prefix, size_t plen) const;
  bool check_unit(THD *thd);
  bool eq(const vers_history_point_t &point) const;
};

struct vers_select_conds_t
{
  vers_system_time_t type;
  vers_system_time_t orig_type;
  bool used:1;
  bool delete_history:1;
  Vers_history_point start;
  Vers_history_point end;
  Lex_ident name;

  Item_field *field_start;
  Item_field *field_end;

  const TABLE_SHARE::period_info_t *period;

  void empty()
  {
    type= SYSTEM_TIME_UNSPECIFIED;
    orig_type= SYSTEM_TIME_UNSPECIFIED;
    used= false;
    delete_history= false;
    start.empty();
    end.empty();
  }

  void init(vers_system_time_t _type,
            Vers_history_point _start= Vers_history_point(),
            Vers_history_point _end= Vers_history_point(),
            Lex_ident          _name= "SYSTEM_TIME")
  {
    type= _type;
    orig_type= _type;
    used= false;
    delete_history= (type == SYSTEM_TIME_HISTORY ||
      type == SYSTEM_TIME_BEFORE);
    start= _start;
    end= _end;
    name= _name;
  }

  void set_all()
  {
    type= SYSTEM_TIME_ALL;
    name= "SYSTEM_TIME";
  }

  void print(String *str, enum_query_type query_type) const;

  bool init_from_sysvar(THD *thd);

  bool is_set() const
  {
    return type != SYSTEM_TIME_UNSPECIFIED;
  }
  bool check_units(THD *thd);
  bool was_set() const
  {
    return orig_type != SYSTEM_TIME_UNSPECIFIED;
  }
  bool need_setup() const
  {
    return type != SYSTEM_TIME_UNSPECIFIED && type != SYSTEM_TIME_ALL;
  }
  bool eq(const vers_select_conds_t &conds) const;
};

/*
  Table reference in the FROM clause.

  These table references can be of several types that correspond to
  different SQL elements. Below we list all types of TABLE_LISTs with
  the necessary conditions to determine when a TABLE_LIST instance
  belongs to a certain type.

  1) table (TABLE_LIST::view == NULL)
     - base table
       (TABLE_LIST::derived == NULL)
     - FROM-clause subquery - TABLE_LIST::table is a temp table
       (TABLE_LIST::derived != NULL)
     - information schema table
       (TABLE_LIST::schema_table != NULL)
       NOTICE: for schema tables TABLE_LIST::field_translation may be != NULL
  2) view (TABLE_LIST::view != NULL)
     - merge    (TABLE_LIST::effective_algorithm == VIEW_ALGORITHM_MERGE)
           also (TABLE_LIST::field_translation != NULL)
     - tmptable (TABLE_LIST::effective_algorithm == VIEW_ALGORITHM_TMPTABLE)
           also (TABLE_LIST::field_translation == NULL)
  2.5) TODO: Add derived tables description here
  3) nested table reference (TABLE_LIST::nested_join != NULL)
     - table sequence - e.g. (t1, t2, t3)
       TODO: how to distinguish from a JOIN?
     - general JOIN
       TODO: how to distinguish from a table sequence?
     - NATURAL JOIN
       (TABLE_LIST::natural_join != NULL)
       - JOIN ... USING
         (TABLE_LIST::join_using_fields != NULL)
     - semi-join nest (sj_on_expr!= NULL && sj_subq_pred!=NULL)
  4) jtbm semi-join (jtbm_subselect != NULL)
*/

/** last_leaf_for_name_resolutioning support. */

struct LEX;
class Index_hint;

/*
  @struct TABLE_CHAIN
  @brief Subchain of global chain of table references

  The structure contains a pointer to the address of the next_global
  pointer to the first TABLE_LIST objectof the subchain and the address
  of the next_global pointer to the element right after the last
  TABLE_LIST object of the subchain.  For an empty subchain both pointers
  have the same value.
*/

struct TABLE_CHAIN
{
  TABLE_CHAIN() = default;

  TABLE_LIST **start_pos;
  TABLE_LIST ** end_pos;

  void set_start_pos(TABLE_LIST **pos) { start_pos= pos; }
  void set_end_pos(TABLE_LIST **pos) { end_pos= pos; }
};

class Table_ident;
struct TABLE_LIST
{
  TABLE_LIST(THD *thd,
             LEX_CSTRING db_str,
             bool fqtn,
             LEX_CSTRING alias_str,
             bool has_alias_ptr,
             Table_ident *table_ident,
             thr_lock_type lock_t,
             enum_mdl_type mdl_t,
             ulong table_opts,
             bool info_schema,
             st_select_lex *sel,
             List<Index_hint> *index_hints_ptr,
             LEX_STRING *option_ptr);

  TABLE_LIST() = default;                          /* Remove gcc warning */

  enum prelocking_types
  {
    PRELOCK_NONE, PRELOCK_ROUTINE, PRELOCK_FK
  };

  /**
    Prepare TABLE_LIST that consists of one table instance to use in
    open_and_lock_tables
  */
  inline void reset() { bzero((void*)this, sizeof(*this)); }
  inline void init_one_table(const LEX_CSTRING *db_arg,
                             const LEX_CSTRING *table_name_arg,
                             const LEX_CSTRING *alias_arg,
                             enum thr_lock_type lock_type_arg)
  {
    enum enum_mdl_type mdl_type;
    if (lock_type_arg >= TL_FIRST_WRITE)
      mdl_type= MDL_SHARED_WRITE;
    else if (lock_type_arg == TL_READ_NO_INSERT)
      mdl_type= MDL_SHARED_NO_WRITE;
    else
      mdl_type= MDL_SHARED_READ;

    reset();
    DBUG_ASSERT(!db_arg->str || strlen(db_arg->str) == db_arg->length);
    DBUG_ASSERT(!table_name_arg->str || strlen(table_name_arg->str) == table_name_arg->length);
    DBUG_ASSERT(!alias_arg || strlen(alias_arg->str) == alias_arg->length);
    db= *db_arg;
    table_name= *table_name_arg;
    alias= (alias_arg ? *alias_arg : *table_name_arg);
    lock_type= lock_type_arg;
    updating= lock_type >= TL_FIRST_WRITE;
    MDL_REQUEST_INIT(&mdl_request, MDL_key::TABLE, db.str, table_name.str,
                     mdl_type, MDL_TRANSACTION);
  }

  TABLE_LIST(TABLE *table_arg, thr_lock_type lock_type)
  {
    DBUG_ASSERT(table_arg->s);
    init_one_table(&table_arg->s->db, &table_arg->s->table_name,
                   NULL, lock_type);
    table= table_arg;
    vers_conditions.name= table->s->vers.name;
  }

  inline void init_one_table_for_prelocking(const LEX_CSTRING *db_arg,
                                            const LEX_CSTRING *table_name_arg,
                                            const LEX_CSTRING *alias_arg,
                                            enum thr_lock_type lock_type_arg,
                                            prelocking_types prelocking_type,
                                            TABLE_LIST *belong_to_view_arg,
                                            uint8 trg_event_map_arg,
                                            TABLE_LIST ***last_ptr,
                                            my_bool insert_data)

  {
    init_one_table(db_arg, table_name_arg, alias_arg, lock_type_arg);
    cacheable_table= 1;
    prelocking_placeholder= prelocking_type;
    open_type= (prelocking_type == PRELOCK_ROUTINE ?
                OT_TEMPORARY_OR_BASE :
                OT_BASE_ONLY);
    belong_to_view= belong_to_view_arg;
    trg_event_map= trg_event_map_arg;
    /* MDL is enough for read-only FK checks, we don't need the table */
    if (prelocking_type == PRELOCK_FK && lock_type < TL_FIRST_WRITE)
      open_strategy= OPEN_STUB;

    **last_ptr= this;
    prev_global= *last_ptr;
    *last_ptr= &next_global;
    for_insert_data= insert_data;
  }


  /*
    List of tables local to a subquery (used by SQL_I_List). Considers
    views as leaves (unlike 'next_leaf' below). Created at parse time
    in st_select_lex::add_table_to_list() -> table_list.link_in_list().
  */
  TABLE_LIST *next_local;
  /* link in a global list of all queries tables */
  TABLE_LIST *next_global, **prev_global;
  LEX_CSTRING   db;
  LEX_CSTRING   table_name;
  LEX_CSTRING   schema_table_name;
  LEX_CSTRING   alias;
  const char    *option;                /* Used by cache index  */
  Item		*on_expr;		/* Used with outer join */
  Name_resolution_context *on_context;  /* For ON expressions */
  Table_function_json_table *table_function; /* If it's the table function. */

  Item          *sj_on_expr;
  /*
    (Valid only for semi-join nests) Bitmap of tables that are within the
    semi-join (this is different from bitmap of all nest's children because
    tables that were pulled out of the semi-join nest remain listed as
    nest's children).
  */
  table_map     sj_inner_tables;
  /* Number of IN-compared expressions */
  uint          sj_in_exprs;
  
  /* If this is a non-jtbm semi-join nest: corresponding subselect predicate */
  Item_in_subselect  *sj_subq_pred;

  table_map     original_subq_pred_used_tables;

  /* If this is a jtbm semi-join object: corresponding subselect predicate */
  Item_in_subselect  *jtbm_subselect;
  /* TODO: check if this can be joined with tablenr_exec */
  uint jtbm_table_no;

  SJ_MATERIALIZATION_INFO *sj_mat_info;

  /*
    The structure of ON expression presented in the member above
    can be changed during certain optimizations. This member
    contains a snapshot of AND-OR structure of the ON expression
    made after permanent transformations of the parse tree, and is
    used to restore ON clause before every reexecution of a prepared
    statement or stored procedure.
  */
  Item          *prep_on_expr;
  COND_EQUAL    *cond_equal;            /* Used with outer join */
  /*
    During parsing - left operand of NATURAL/USING join where 'this' is
    the right operand. After parsing (this->natural_join == this) iff
    'this' represents a NATURAL or USING join operation. Thus after
    parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
  */
  TABLE_LIST *natural_join;
  /*
    True if 'this' represents a nested join that is a NATURAL JOIN.
    For one of the operands of 'this', the member 'natural_join' points
    to the other operand of 'this'.
  */
  bool is_natural_join;
  /* Field names in a USING clause for JOIN ... USING. */
  List<String> *join_using_fields;
  /*
    Explicitly store the result columns of either a NATURAL/USING join or
    an operand of such a join.
  */
  List<Natural_join_column> *join_columns;
  /* TRUE if join_columns contains all columns of this table reference. */
  bool is_join_columns_complete;

  /*
    List of nodes in a nested join tree, that should be considered as
    leaves with respect to name resolution. The leaves are: views,
    top-most nodes representing NATURAL/USING joins, subqueries, and
    base tables. All of these TABLE_LIST instances contain a
    materialized list of columns. The list is local to a subquery.
  */
  TABLE_LIST *next_name_resolution_table;
  /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
  List<Index_hint> *index_hints;
  TABLE        *table;                          /* opened table */
  ulonglong         table_id; /* table id (from binlog) for opened table */
  /*
    select_result for derived table to pass it from table creation to table
    filling procedure
  */
  select_unit  *derived_result;
  /* Stub used for materialized derived tables. */
  table_map	map;                    /* ID bit of table (1,2,4,8,16...) */
  table_map get_map()
  {
    return jtbm_subselect? table_map(1) << jtbm_table_no : table->map;
  }
  uint get_tablenr()
  {
    return jtbm_subselect? jtbm_table_no : table->tablenr;
  }
  void set_tablenr(uint new_tablenr)
  {
    if (jtbm_subselect)
    {
      jtbm_table_no= new_tablenr;
    }
    if (table)
    {
      table->tablenr= new_tablenr;
      table->map= table_map(1) << new_tablenr;
    }
  }
  /*
    Reference from aux_tables to local list entry of main select of
    multi-delete statement:
    delete t1 from t2,t1 where t1.a<'B' and t2.b=t1.b;
    here it will be reference of first occurrence of t1 to second (as you
    can see this lists can't be merged)
  */
  TABLE_LIST	*correspondent_table;
  /**
     @brief Normally, this field is non-null for anonymous derived tables only.

     @details This field is set to non-null for 
     
     - Anonymous derived tables, In this case it points to the SELECT_LEX_UNIT
     representing the derived table. E.g. for a query
     
     @verbatim SELECT * FROM (SELECT a FROM t1) b @endverbatim
     
     For the @c TABLE_LIST representing the derived table @c b, @c derived
     points to the SELECT_LEX_UNIT representing the result of the query within
     parenteses.
     
     - Views. This is set for views with @verbatim ALGORITHM = TEMPTABLE
     @endverbatim by mysql_make_view().
     
     @note Inside views, a subquery in the @c FROM clause is not allowed.
     @note Do not use this field to separate views/base tables/anonymous
     derived tables. Use TABLE_LIST::is_anonymous_derived_table().
  */
  st_select_lex_unit *derived;		/* SELECT_LEX_UNIT of derived table */
  With_element *with;          /* With element defining this table (if any) */
  /* Bitmap of the defining with element */
  table_map with_internal_reference_map;
  TABLE_LIST * next_with_rec_ref;
  bool is_derived_with_recursive_reference;
  bool block_handle_derived;
  /* The interface employed to materialize the table by a foreign engine */
  derived_handler *dt_handler;
  /* The text of the query specifying the derived table */
  LEX_CSTRING derived_spec;
  /*
    The object used to organize execution of the query that specifies
    the derived table by a foreign engine
  */
  Pushdown_derived *pushdown_derived;
  ST_SCHEMA_TABLE *schema_table;        /* Information_schema table */
  st_select_lex	*schema_select_lex;
  /*
    True when the view field translation table is used to convert
    schema table fields for backwards compatibility with SHOW command.
  */
  bool schema_table_reformed;
  TMP_TABLE_PARAM *schema_table_param;
  /* link to select_lex where this table was used */
  st_select_lex	*select_lex;
  LEX *view;                    /* link on VIEW lex for merging */
  Field_translator *field_translation;	/* array of VIEW fields */
  /* pointer to element after last one in translation table above */
  Field_translator *field_translation_end;
  bool field_translation_updated;
  /*
    List (based on next_local) of underlying tables of this view. I.e. it
    does not include the tables of subqueries used in the view. Is set only
    for merged views.
  */
  TABLE_LIST	*merge_underlying_list;
  /*
    - 0 for base tables
    - in case of the view it is the list of all (not only underlying
    tables but also used in subquery ones) tables of the view.
  */
  List<TABLE_LIST> *view_tables;
  /* most upper view this table belongs to */
  TABLE_LIST	*belong_to_view;
  /* A merged derived table this table belongs to */
  TABLE_LIST    *belong_to_derived;
  /*
    The view directly referencing this table
    (non-zero only for merged underlying tables of a view).
  */
  TABLE_LIST	*referencing_view;

  table_map view_used_tables;
  table_map     map_exec;
  /* TODO: check if this can be joined with jtbm_table_no */
  uint          tablenr_exec;
  uint          maybe_null_exec;

  /* Ptr to parent MERGE table list item. See top comment in ha_myisammrg.cc */
  TABLE_LIST    *parent_l;
  /*
    Security  context (non-zero only for tables which belong
    to view with SQL SECURITY DEFINER)
  */
  Security_context *security_ctx;
  uchar tabledef_version_buf[MY_UUID_SIZE >
                               MICROSECOND_TIMESTAMP_BUFFER_SIZE-1 ?
                             MY_UUID_SIZE + 1 :
                             MICROSECOND_TIMESTAMP_BUFFER_SIZE];
  LEX_CUSTRING tabledef_version;

  /*
    This view security context (non-zero only for views with
    SQL SECURITY DEFINER)
  */
  Security_context *view_sctx;
  bool allowed_show;
  Item          *where;                 /* VIEW WHERE clause condition */
  Item          *check_option;          /* WITH CHECK OPTION condition */
  LEX_STRING	select_stmt;		/* text of (CREATE/SELECT) statement */
  LEX_CSTRING	md5;			/* md5 of query text */
  LEX_CSTRING	source;			/* source of CREATE VIEW */
  LEX_CSTRING	view_db;		/* saved view database */
  LEX_CSTRING	view_name;		/* saved view name */
  LEX_STRING	hr_timestamp;           /* time stamp of last operation */
  LEX_USER      definer;                /* definer of view */
  ulonglong	file_version;		/* version of file's field set */
  ulonglong	mariadb_version;	/* version of server on creation */
  ulonglong     updatable_view;         /* VIEW can be updated */
  /** 
      @brief The declared algorithm, if this is a view.
      @details One of
      - VIEW_ALGORITHM_UNDEFINED
      - VIEW_ALGORITHM_TMPTABLE
      - VIEW_ALGORITHM_MERGE
      @to do Replace with an enum 
  */
  ulonglong	algorithm;
  ulonglong     view_suid;              /* view is suid (TRUE dy default) */
  ulonglong     with_check;             /* WITH CHECK OPTION */
  /*
    effective value of WITH CHECK OPTION (differ for temporary table
    algorithm)
  */
  uint8         effective_with_check;
  /** 
      @brief The view algorithm that is actually used, if this is a view.
      @details One of
      - VIEW_ALGORITHM_UNDEFINED
      - VIEW_ALGORITHM_TMPTABLE
      - VIEW_ALGORITHM_MERGE
      @to do Replace with an enum 
  */
  uint8         derived_type;
  GRANT_INFO	grant;
  /* data need by some engines in query cache*/
  ulonglong     engine_data;
  /* call back function for asking handler about caching in query cache */
  qc_engine_callback callback_func;
  thr_lock_type lock_type;

  /*
    Two fields below are set during parsing this table reference in the cases
    when the table reference can be potentially a reference to a CTE table.
    In this cases the fact that the reference is a reference to a CTE or not
    will be ascertained at the very end of parsing of the query when referencies
    to CTE are resolved. For references to CTE and to derived tables no mdl
    requests are needed while for other table references they are. If a request
    is possibly postponed the info that allows to issue this request must be
    saved in 'mdl_type' and 'table_options'.
  */
  enum_mdl_type mdl_type;
  ulong         table_options;

  uint		outer_join;		/* Which join type */
  uint		shared;			/* Used in multi-upd */
  bool          updatable;		/* VIEW/TABLE can be updated now */
  bool		straight;		/* optimize with prev table */
  bool          updating;               /* for replicate-do/ignore table */
  bool		force_index;		/* prefer index over table scan */
  bool          ignore_leaves;          /* preload only non-leaf nodes */
  bool          crashed;                /* Table was found crashed */
  bool          skip_locked;            /* Skip locked in view defination */
  table_map     dep_tables;             /* tables the table depends on      */
  table_map     on_expr_dep_tables;     /* tables on expression depends on  */
  struct st_nested_join *nested_join;   /* if the element is a nested join  */
  TABLE_LIST *embedding;             /* nested join containing the table */
  List<TABLE_LIST> *join_list;/* join list the table belongs to   */
  bool          lifted;               /* set to true when the table is moved to
                                         the upper level at the parsing stage */
  bool		cacheable_table;	/* stop PS caching */
  /* used in multi-upd/views privilege check */
  bool		table_in_first_from_clause;
  /**
     Specifies which kind of table should be open for this element
     of table list.
  */
  enum enum_open_type open_type;
  /* TRUE if this merged view contain auto_increment field */
  bool          contain_auto_increment;
  bool          compact_view_format;    /* Use compact format for SHOW CREATE VIEW */
  /* view where processed */
  bool          where_processed;
  /* TRUE <=> VIEW CHECK OPTION expression has been processed */
  bool          check_option_processed;
  /* TABLE_TYPE_UNKNOWN if any type is acceptable */
  Table_type    required_type;
  handlerton	*db_type;		/* table_type for handler */
  char		timestamp_buffer[MICROSECOND_TIMESTAMP_BUFFER_SIZE];
  /*
    This TABLE_LIST object is just placeholder for prelocking, it will be
    used for implicit LOCK TABLES only and won't be used in real statement.
  */
  prelocking_types prelocking_placeholder;
  /**
     Indicates that if TABLE_LIST object corresponds to the table/view
     which requires special handling.
  */
  enum enum_open_strategy
  {
    /* Normal open. */
    OPEN_NORMAL= 0,
    /* Associate a table share only if the the table exists. */
    OPEN_IF_EXISTS,
    /* Don't associate a table share. */
    OPEN_STUB
  } open_strategy;
  /** TRUE if an alias for this table was specified in the SQL. */
  bool          is_alias;
  /** TRUE if the table is referred to in the statement using a fully
      qualified name (<db_name>.<table_name>).
  */
  bool          is_fqtn;

  /* TRUE <=> derived table should be filled right after optimization. */
  bool          fill_me;
  /* TRUE <=> view/DT is merged. */
  /* TODO: replace with derived_type */
  bool          merged;
  bool          merged_for_insert;
  bool          sequence;  /* Part of NEXTVAL/CURVAL/LASTVAL */

  /*
    Items created by create_view_field and collected to change them in case
    of materialization of the view/derived table
  */
  List<Item>    used_items;
  /* Sublist (tail) of persistent used_items */
  List<Item>    persistent_used_items;

  /* View creation context. */

  View_creation_ctx *view_creation_ctx;

  /*
    Attributes to save/load view creation context in/from frm-file.

    Ther are required only to be able to use existing parser to load
    view-definition file. As soon as the parser parsed the file, view
    creation context is initialized and the attributes become redundant.

    These attributes MUST NOT be used for any purposes but the parsing.
  */

  LEX_CSTRING view_client_cs_name;
  LEX_CSTRING view_connection_cl_name;

  /*
    View definition (SELECT-statement) in the UTF-form.
  */

  LEX_CSTRING view_body_utf8;

   /* End of view definition context. */

  /**
    Indicates what triggers we need to pre-load for this TABLE_LIST
    when opening an associated TABLE. This is filled after
    the parsed tree is created.

    slave_fk_event_map is filled on the slave side with bitmaps value
    representing row-based event operation to help find and prelock
    possible FK constrain-related child tables.
  */
  uint8 trg_event_map, slave_fk_event_map;
  /* TRUE <=> this table is a const one and was optimized away. */
  bool optimized_away;

  /**
    TRUE <=> already materialized. Valid only for materialized derived
    tables/views.
  */
  bool materialized;
  /* I_S: Flags to open_table (e.g. OPEN_TABLE_ONLY or OPEN_VIEW_ONLY) */
  uint i_s_requested_object;

  bool prohibit_cond_pushdown;

  /*
    I_S: how to read the tables (SKIP_OPEN_TABLE/OPEN_FRM_ONLY/OPEN_FULL_TABLE)
  */
  uint table_open_method;
  /*
    I_S: where the schema table was filled
    (this is a hack. The code should be able to figure out whether reading
    from I_S should be done by create_sort_index() or by JOIN::exec.)
  */
  enum enum_schema_table_state schema_table_state;

  /* Something like a "query plan" for reading INFORMATION_SCHEMA table */
  IS_table_read_plan *is_table_read_plan;

  MDL_request mdl_request;

#ifdef WITH_PARTITION_STORAGE_ENGINE
  /* List to carry partition names from PARTITION (...) clause in statement */
  List<String> *partition_names;
#endif /* WITH_PARTITION_STORAGE_ENGINE */

  void calc_md5(char *buffer);
  int view_check_option(THD *thd, bool ignore_failure);
  bool create_field_translation(THD *thd);
  bool setup_underlying(THD *thd);
  void cleanup_items();
  bool placeholder()
  {
    return derived || view || schema_table || !table || table_function;
  }
  void print(THD *thd, table_map eliminated_tables, String *str, 
             enum_query_type query_type);
  void print_leaf_tables(THD *thd, String *str,
                         enum_query_type query_type);
  bool check_single_table(TABLE_LIST **table, table_map map,
                          TABLE_LIST *view);
  bool set_insert_values(MEM_ROOT *mem_root);
  void replace_view_error_with_generic(THD *thd);
  TABLE_LIST *find_underlying_table(TABLE *table);
  TABLE_LIST *first_leaf_for_name_resolution();
  TABLE_LIST *last_leaf_for_name_resolution();

  /* System Versioning */
  vers_select_conds_t vers_conditions;
  vers_select_conds_t period_conditions;

  bool has_period() const
  {
    return period_conditions.is_set();
  }

  my_bool for_insert_data;

  /**
     @brief
       Find the bottom in the chain of embedded table VIEWs.

     @detail
       This is used for single-table UPDATE/DELETE when they are modifying a
       single-table VIEW.
  */
  TABLE_LIST *find_table_for_update()
  {
    TABLE_LIST *tbl= this;
    while(!tbl->is_multitable() && tbl->single_table_updatable() &&
        tbl->merge_underlying_list)
    {
      tbl= tbl->merge_underlying_list;
    }
    return tbl;
  }
  TABLE *get_real_join_table();
  bool is_leaf_for_name_resolution();
  inline TABLE_LIST *top_table()
    { return belong_to_view ? belong_to_view : this; }
  inline bool prepare_check_option(THD *thd)
  {
    bool res= FALSE;
    if (effective_with_check)
      res= prep_check_option(thd, effective_with_check);
    return res;
  }
  inline bool prepare_where(THD *thd, Item **conds,
                            bool no_where_clause)
  {
    if (!view || is_merged_derived())
      return prep_where(thd, conds, no_where_clause);
    return FALSE;
  }

  void register_want_access(privilege_t want_access);
  bool prepare_security(THD *thd);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  Security_context *find_view_security_context(THD *thd);
  bool prepare_view_security_context(THD *thd, bool upgrade_check);
#endif
  /*
    Cleanup for re-execution in a prepared statement or a stored
    procedure.
  */
  void reinit_before_use(THD *thd);
  Item_subselect *containing_subselect();

  /* 
    Compiles the tagged hints list and fills up TABLE::keys_in_use_for_query,
    TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by,
    TABLE::force_index and TABLE::covering_keys.
  */
  bool process_index_hints(TABLE *table);

  bool is_the_same_definition(THD *thd, TABLE_SHARE *s);
  /**
    Record the value of metadata version of the corresponding
    table definition cache element in this parse tree node.

    @sa check_and_update_table_version()
  */
  inline void set_table_ref_id(TABLE_SHARE *s)
  { set_table_ref_id(s->get_table_ref_type(), s->get_table_ref_version()); }

  inline void set_table_ref_id(enum_table_ref_type table_ref_type_arg,
                               ulonglong table_ref_version_arg)
  {
    m_table_ref_type= table_ref_type_arg;
    m_table_ref_version= table_ref_version_arg;
  }

  void set_table_id(TABLE_SHARE *s)
  {
    set_table_ref_id(s);
    set_tabledef_version(s);
  }

  void set_tabledef_version(TABLE_SHARE *s)
  {
    if (!tabledef_version.length && s->tabledef_version.length)
    {
      DBUG_ASSERT(s->tabledef_version.length <
                  sizeof(tabledef_version_buf));
      tabledef_version.str= tabledef_version_buf;
      memcpy(tabledef_version_buf, s->tabledef_version.str,
             (tabledef_version.length= s->tabledef_version.length));
      // safety
      tabledef_version_buf[tabledef_version.length]= 0;
    }
  }

  /* Set of functions returning/setting state of a derived table/view. */
  bool is_non_derived() const { return (!derived_type); }
  bool is_view_or_derived() const { return derived_type; }
  bool is_view() const { return (derived_type & DTYPE_VIEW); }
  bool is_derived() const { return (derived_type & DTYPE_TABLE); }
  bool is_with_table();
  bool is_recursive_with_table();
  bool is_with_table_recursive_reference();
  void register_as_derived_with_rec_ref(With_element *rec_elem);
  bool is_nonrecursive_derived_with_rec_ref();
  bool fill_recursive(THD *thd);

  inline void set_view()
  {
    derived_type= DTYPE_VIEW;
  }
  inline void set_derived()
  {
    derived_type= DTYPE_TABLE;
  }
  bool is_merged_derived() const { return (derived_type & DTYPE_MERGE); }
  inline void set_merged_derived()
  {
    DBUG_ENTER("set_merged_derived");
    DBUG_PRINT("enter", ("Alias: '%s'  Unit: %p",
                        (alias.str ? alias.str : "<NULL>"),
                         get_unit()));
    derived_type= static_cast<uint8>((derived_type & DTYPE_MASK) | DTYPE_MERGE);
    set_check_merged();
    DBUG_VOID_RETURN;
  }
  bool is_materialized_derived() const
  {
    return (derived_type & DTYPE_MATERIALIZE);
  }
  void set_materialized_derived()
  {
    DBUG_ENTER("set_materialized_derived");
    DBUG_PRINT("enter", ("Alias: '%s'  Unit: %p",
                        (alias.str ? alias.str : "<NULL>"),
                         get_unit()));
    derived_type= static_cast<uint8>((derived_type &
                                      (derived ? DTYPE_MASK : DTYPE_VIEW)) |
                                     DTYPE_MATERIALIZE);
    set_check_materialized();
    DBUG_VOID_RETURN;
  }
  bool is_multitable() const { return (derived_type & DTYPE_MULTITABLE); }
  inline void set_multitable()
  {
    derived_type|= DTYPE_MULTITABLE;
  }
  bool set_as_with_table(THD *thd, With_element *with_elem);
  void reset_const_table();
  bool handle_derived(LEX *lex, uint phases);

  /**
     @brief True if this TABLE_LIST represents an anonymous derived table,
     i.e.  the result of a subquery.
  */
  bool is_anonymous_derived_table() const { return derived && !view; }

  /**
     @brief Returns the name of the database that the referenced table belongs
     to.
  */
  const LEX_CSTRING get_db_name() const
  {
    return view != NULL ? view_db : db;
  }

  /**
     @brief Returns the name of the table that this TABLE_LIST represents.

     @details The unqualified table name or view name for a table or view,
     respectively.
   */
  const LEX_CSTRING get_table_name() const
  {
    return view != NULL ? view_name : table_name;
  }
  bool is_active_sjm();
  bool is_sjm_scan_table();
  bool is_jtbm() { return MY_TEST(jtbm_subselect != NULL); }
  st_select_lex_unit *get_unit();
  st_select_lex *get_single_select();
  void wrap_into_nested_join(List<TABLE_LIST> &join_list);
  bool init_derived(THD *thd, bool init_view);
  int fetch_number_of_rows();
  bool change_refs_to_fields();

  bool single_table_updatable();

  bool is_inner_table_of_outer_join()
  {
    for (TABLE_LIST *tbl= this; tbl; tbl= tbl->embedding)
    {
      if (tbl->outer_join)
        return true;
    }
    return false;
  } 
  void set_lock_type(THD* thd, enum thr_lock_type lock);

  derived_handler *find_derived_handler(THD *thd);
  TABLE_LIST *get_first_table();

  void remove_join_columns()
  {
    if (join_columns)
    {
      join_columns->empty();
      join_columns= NULL;
      is_join_columns_complete= FALSE;
    }
  }

  inline void set_view_def_version(LEX_STRING *version)
  {
    m_table_ref_type= TABLE_REF_VIEW;
    tabledef_version.str= (const uchar *) version->str;
    tabledef_version.length= version->length;
  }
private:
  bool prep_check_option(THD *thd, uint8 check_opt_type);
  bool prep_where(THD *thd, Item **conds, bool no_where_clause);
  void set_check_materialized();
#ifndef DBUG_OFF
  void set_check_merged();
#else
  inline void set_check_merged() {}
#endif
  /** See comments for set_table_ref_id() */
  enum enum_table_ref_type m_table_ref_type;
  /** See comments for set_table_ref_id() */
  ulonglong m_table_ref_version;
};

#define ERROR_TABLE  ((TABLE_LIST*) 0x1)

class Item;

/*
  Iterator over the fields of a generic table reference.
*/

class Field_iterator: public Sql_alloc
{
public:
  Field_iterator() = default;                         /* Remove gcc warning */
  virtual ~Field_iterator() = default;
  virtual void set(TABLE_LIST *)= 0;
  virtual void next()= 0;
  virtual bool end_of_fields()= 0;              /* Return 1 at end of list */
  virtual LEX_CSTRING *name()= 0;
  virtual Item *create_item(THD *)= 0;
  virtual Field *field()= 0;
};


/* 
  Iterator over the fields of a base table, view with temporary
  table, or subquery.
*/

class Field_iterator_table: public Field_iterator
{
  Field **ptr;
public:
  Field_iterator_table() :ptr(0) {}
  void set(TABLE_LIST *table) override { ptr= table->table->field; }
  void set_table(TABLE *table) { ptr= table->field; }
  void next() override { ptr++; }
  bool end_of_fields() override { return *ptr == 0; }
  LEX_CSTRING *name() override;
  Item *create_item(THD *thd) override;
  Field *field() override { return *ptr; }
};


/* Iterator over the fields of a merge view. */

class Field_iterator_view: public Field_iterator
{
  Field_translator *ptr, *array_end;
  TABLE_LIST *view;
public:
  Field_iterator_view() :ptr(0), array_end(0) {}
  void set(TABLE_LIST *table) override;
  void next() override { ptr++; }
  bool end_of_fields() override { return ptr == array_end; }
  LEX_CSTRING *name() override;
  Item *create_item(THD *thd) override;
  Item **item_ptr() {return &ptr->item; }
  Field *field() override { return 0; }
  inline Item *item() { return ptr->item; }
  Field_translator *field_translator() { return ptr; }
};


/*
  Field_iterator interface to the list of materialized fields of a
  NATURAL/USING join.
*/

class Field_iterator_natural_join: public Field_iterator
{
  List_iterator_fast<Natural_join_column> column_ref_it;
  Natural_join_column *cur_column_ref;
public:
  Field_iterator_natural_join() :cur_column_ref(NULL) {}
  ~Field_iterator_natural_join() = default;
  void set(TABLE_LIST *table) override;
  void next() override;
  bool end_of_fields() override { return !cur_column_ref; }
  LEX_CSTRING *name() override { return cur_column_ref->name(); }
  Item *create_item(THD *thd) override { return cur_column_ref->create_item(thd); }
  Field *field() override { return cur_column_ref->field(); }
  Natural_join_column *column_ref() { return cur_column_ref; }
};


/*
  Generic iterator over the fields of an arbitrary table reference.

  DESCRIPTION
    This class unifies the various ways of iterating over the columns
    of a table reference depending on the type of SQL entity it
    represents. If such an entity represents a nested table reference,
    this iterator encapsulates the iteration over the columns of the
    members of the table reference.

  IMPLEMENTATION
    The implementation assumes that all underlying NATURAL/USING table
    references already contain their result columns and are linked into
    the list TABLE_LIST::next_name_resolution_table.
*/

class Field_iterator_table_ref: public Field_iterator
{
  TABLE_LIST *table_ref, *first_leaf, *last_leaf;
  Field_iterator_table        table_field_it;
  Field_iterator_view         view_field_it;
  Field_iterator_natural_join natural_join_it;
  Field_iterator *field_it;
  void set_field_iterator();
public:
  Field_iterator_table_ref() :field_it(NULL) {}
  void set(TABLE_LIST *table) override;
  void next() override;
  bool end_of_fields() override
  { return (table_ref == last_leaf && field_it->end_of_fields()); }
  LEX_CSTRING *name() override { return field_it->name(); }
  const char *get_table_name();
  const char *get_db_name();
  GRANT_INFO *grant();
  Item *create_item(THD *thd) override { return field_it->create_item(thd); }
  Field *field() override { return field_it->field(); }
  Natural_join_column *get_or_create_column_ref(THD *thd, TABLE_LIST *parent_table_ref);
  Natural_join_column *get_natural_column_ref();
};


#define JOIN_OP_NEST       1
#define REBALANCED_NEST    2

typedef struct st_nested_join
{
  List<TABLE_LIST>  join_list;       /* list of elements in the nested join */
  /*
    Currently the valid values for nest type are:
    JOIN_OP_NEST - for nest created for JOIN operation used as an operand in
    a join expression, contains 2 elements;
    JOIN_OP_NEST | REBALANCED_NEST -  nest created after tree re-balancing
    in st_select_lex::add_cross_joined_table(), contains 1 element;
    0 - for all other nests.
    Examples:
    1.  SELECT * FROM t1 JOIN t2 LEFT JOIN t3 ON t2.a=t3.a;
    Here the nest created for LEFT JOIN at first has nest_type==JOIN_OP_NEST.
    After re-balancing in st_select_lex::add_cross_joined_table() this nest
    has nest_type==JOIN_OP_NEST | REBALANCED_NEST. The nest for JOIN created
    in st_select_lex::add_cross_joined_table() has nest_type== JOIN_OP_NEST.
    2.  SELECT * FROM t1 JOIN (t2 LEFT JOIN t3 ON t2.a=t3.a)
    Here the nest created for LEFT JOIN has nest_type==0, because it's not
    an operand in a join expression. The nest created for JOIN has nest_type
    set to JOIN_OP_NEST.
  */
  uint nest_type;
  /* 
    Bitmap of tables within this nested join (including those embedded within
    its children), including tables removed by table elimination.
  */
  table_map         used_tables;
  table_map         not_null_tables; /* tables that rejects nulls           */
  /**
    Used for pointing out the first table in the plan being covered by this
    join nest. It is used exclusively within make_outerjoin_info().
   */
  struct st_join_table *first_nested;
  /* 
    Used to count tables in the nested join in 2 isolated places:
    1. In make_outerjoin_info(). 
    2. check_interleaving_with_nj/restore_prev_nj_state (these are called
       by the join optimizer. 
    Before each use the counters are zeroed by reset_nj_counters.
  */
  uint              counter;

  /*
    Number of elements in join_list that participate in the join plan choice:
    - Base tables that were not removed by table elimination
    - Join nests that were not removed by mark_join_nest_as_const
  */
  uint              n_tables;
  nested_join_map   nj_map;          /* Bit used to identify this nested join*/
  /*
    (Valid only for semi-join nests) Bitmap of tables outside the semi-join
    that are used within the semi-join's ON condition.
  */
  table_map         sj_depends_on;
  /* Outer non-trivially correlated tables */
  table_map         sj_corr_tables;
  List<Item_ptr>    sj_outer_expr_list;
  /**
     True if this join nest node is completely covered by the query execution
     plan. This means two things.

     1. All tables on its @c join_list are covered by the plan.

     2. All child join nest nodes are fully covered.
   */
  bool is_fully_covered() const { return n_tables == counter; }
} NESTED_JOIN;


typedef struct st_changed_table_list
{
  struct	st_changed_table_list *next;
  char		*key;
  size_t  key_length;
} CHANGED_TABLE_LIST;


typedef struct st_open_table_list{
  struct st_open_table_list *next;
  char	*db,*table;
  uint32 in_use,locked;
} OPEN_TABLE_LIST;


static inline MY_BITMAP *tmp_use_all_columns(TABLE *table,
                                             MY_BITMAP **bitmap)
{
  MY_BITMAP *old= *bitmap;
  *bitmap= &table->s->all_set;
  return old;
}


static inline void tmp_restore_column_map(MY_BITMAP **bitmap,
                                          MY_BITMAP *old)
{
  *bitmap= old;
}

/* The following is only needed for debugging */

static inline MY_BITMAP *dbug_tmp_use_all_columns(TABLE *table,
                                                      MY_BITMAP **bitmap)
{
#ifdef DBUG_ASSERT_EXISTS
  return tmp_use_all_columns(table, bitmap);
#else
  return 0;
#endif
}

static inline void dbug_tmp_restore_column_map(MY_BITMAP **bitmap,
                                               MY_BITMAP *old)
{
#ifdef DBUG_ASSERT_EXISTS
  tmp_restore_column_map(bitmap, old);
#endif
}


/* 
  Variant of the above : handle both read and write sets.
  Provide for the possiblity of the read set being the same as the write set
*/
static inline void dbug_tmp_use_all_columns(TABLE *table,
                                            MY_BITMAP **save,
                                            MY_BITMAP **read_set,
                                            MY_BITMAP **write_set)
{
#ifdef DBUG_ASSERT_EXISTS
  save[0]= *read_set;
  save[1]= *write_set;
  (void) tmp_use_all_columns(table, read_set);
  (void) tmp_use_all_columns(table, write_set);
#endif
}


static inline void dbug_tmp_restore_column_maps(MY_BITMAP **read_set,
                                                MY_BITMAP **write_set,
                                                MY_BITMAP **old)
{
#ifdef DBUG_ASSERT_EXISTS
  tmp_restore_column_map(read_set, old[0]);
  tmp_restore_column_map(write_set, old[1]);
#endif
}

bool ok_for_lower_case_names(const char *names);

enum get_table_share_flags {
  GTS_TABLE                = 1,
  GTS_VIEW                 = 2,
  GTS_NOLOCK               = 4,
  GTS_USE_DISCOVERY        = 8,
  GTS_FORCE_DISCOVERY      = 16
};

size_t max_row_length(TABLE *table, MY_BITMAP const *cols, const uchar *data);

void init_mdl_requests(TABLE_LIST *table_list);

enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
                       const LEX_CSTRING *alias, uint db_stat, uint prgflag,
                       uint ha_open_flags, TABLE *outparam,
                       bool is_create_table,
                       List<String> *partitions_to_open= NULL);
bool copy_keys_from_share(TABLE *outparam, MEM_ROOT *root);
bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
                     bool *error_reported, vcol_init_mode expr);
TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
                               const char *key, uint key_length);
void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
                          uint key_length,
                          const char *table_name, const char *path);
void free_table_share(TABLE_SHARE *share);
enum open_frm_error open_table_def(THD *thd, TABLE_SHARE *share,
                                   uint flags = GTS_TABLE);

void open_table_error(TABLE_SHARE *share, enum open_frm_error error,
                      int db_errno);
void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form);
bool check_db_name(LEX_STRING *db);
bool check_column_name(const char *name);
bool check_period_name(const char *name);
bool check_table_name(const char *name, size_t length, bool check_for_path_chars);
int rename_file_ext(const char * from,const char * to,const char * ext);
char *get_field(MEM_ROOT *mem, Field *field);
bool get_field(MEM_ROOT *mem, Field *field, class String *res);

bool validate_comment_length(THD *thd, LEX_CSTRING *comment, size_t max_len,
                             uint err_code, const char *name);

int closefrm(TABLE *table);
void free_blobs(TABLE *table);
void free_field_buffers_larger_than(TABLE *table, uint32 size);
ulong get_form_pos(File file, uchar *head, TYPELIB *save_names);
void append_unescaped(String *res, const char *pos, size_t length);
void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo,
                        HA_CREATE_INFO *create_info, uint keys, KEY *key_info);
const char *fn_frm_ext(const char *name);

/* Check that the integer is in the internal */
static inline int set_zone(int nr,int min_zone,int max_zone)
{
  if (nr <= min_zone)
    return min_zone;
  if (nr >= max_zone)
    return max_zone;
  return nr;
}

/* performance schema */
extern LEX_CSTRING PERFORMANCE_SCHEMA_DB_NAME;

extern LEX_CSTRING GENERAL_LOG_NAME;
extern LEX_CSTRING SLOW_LOG_NAME;
extern LEX_CSTRING TRANSACTION_REG_NAME;

/* information schema */
extern LEX_CSTRING INFORMATION_SCHEMA_NAME;
extern Lex_ident_db MYSQL_SCHEMA_NAME;

/* table names */
extern LEX_CSTRING MYSQL_PROC_NAME;

inline bool is_infoschema_db(const LEX_CSTRING *name)
{
  return lex_string_eq(&INFORMATION_SCHEMA_NAME, name);
}

inline bool is_perfschema_db(const LEX_CSTRING *name)
{
  return lex_string_eq(&PERFORMANCE_SCHEMA_DB_NAME, name);
}

inline void mark_as_null_row(TABLE *table)
{
  table->null_row=1;
  table->status|=STATUS_NULL_ROW;
  if (table->s->null_bytes)
    bfill(table->null_flags,table->s->null_bytes,255);
}

/*
  Restore table to state before mark_as_null_row() call.
  This assumes that the caller has restored table->null_flags,
  as is done in unclear_tables().
*/

inline void unmark_as_null_row(TABLE *table)
{
  table->null_row= 0;
  table->status&= ~STATUS_NULL_ROW;
}

bool is_simple_order(ORDER *order);

class Open_tables_backup;

/** Transaction Registry Table (TRT)

    This table holds transaction IDs, their corresponding times and other
    transaction-related data which is used for transaction order resolution.
    When versioned table marks its records lifetime with transaction IDs,
    TRT is used to get their actual timestamps. */

class TR_table: public TABLE_LIST
{
  THD *thd;
  Open_tables_backup *open_tables_backup;

public:
  enum field_id_t {
    FLD_TRX_ID= 0,
    FLD_COMMIT_ID,
    FLD_BEGIN_TS,
    FLD_COMMIT_TS,
    FLD_ISO_LEVEL,
    FIELD_COUNT
  };

  enum enabled {NO, MAYBE, YES};
  static enum enabled use_transaction_registry;

  /**
     @param[in,out] Thread handle
     @param[in] Current transaction is read-write.
   */
  TR_table(THD *_thd, bool rw= false);
  /**
     Opens a transaction_registry table.

     @retval true on error, false otherwise.
   */
  bool open();
  ~TR_table();
  /**
     @retval current thd
  */
  THD *get_thd() const { return thd; }
  /**
     Stores value to internal transaction_registry TABLE object.

     @param[in] field number in a TABLE
     @param[in] value to store
   */
  void store(uint field_id, ulonglong val);
  /**
     Stores value to internal transaction_registry TABLE object.

     @param[in] field number in a TABLE
     @param[in] value to store
   */
  void store(uint field_id, timeval ts);
  /**
    Update the transaction_registry right before commit.
    @param start_id    transaction identifier at start
    @param end_id      transaction identifier at commit

    @retval false      on success
    @retval true       on error (the transaction must be rolled back)
  */
  bool update(ulonglong start_id, ulonglong end_id);
  // return true if found; false if not found or error
  bool query(ulonglong trx_id);
  /**
     Gets a row from transaction_registry with the closest commit_timestamp to
     first argument. We can search for a value which a lesser or greater than
     first argument. Also loads a row into an internal TABLE object.

     @param[in] timestamp
     @param[in] true if we search for a lesser timestamp, false if greater
     @retval true if exists, false it not exists or an error occurred
   */
  bool query(MYSQL_TIME &commit_time, bool backwards);
  /**
     Checks whether transaction1 sees transaction0.

     @param[out] true if transaction1 sees transaction0, undefined on error and
       when transaction1=transaction0 and false otherwise
     @param[in] transaction_id of transaction1
     @param[in] transaction_id of transaction0
     @param[in] commit time of transaction1 or 0 if we want it to be queried
     @param[in] isolation level (from handler.h) of transaction1
     @param[in] commit time of transaction0 or 0 if we want it to be queried
     @retval true on error, false otherwise
   */
  bool query_sees(bool &result, ulonglong trx_id1, ulonglong trx_id0,
                  ulonglong commit_id1= 0,
                  enum_tx_isolation iso_level1= ISO_READ_UNCOMMITTED,
                  ulonglong commit_id0= 0);

  /**
     @retval transaction isolation level of a row from internal TABLE object.
   */
  enum_tx_isolation iso_level() const;
  /**
     Stores transactioin isolation level to internal TABLE object.
   */
  void store_iso_level(enum_tx_isolation iso_level)
  {
    DBUG_ASSERT(iso_level <= ISO_SERIALIZABLE);
    store(FLD_ISO_LEVEL, iso_level + 1);
  }

  /**
     Writes a message to MariaDB log about incorrect transaction_registry schema.

     @param[in] a message explained what's incorrect in schema
   */
  void warn_schema_incorrect(const char *reason);
  /**
     Checks whether transaction_registry table has a correct schema.

     @retval true if schema is incorrect and false otherwise
   */
  bool check(bool error);

  TABLE * operator-> () const
  {
    return table;
  }
  Field * operator[] (uint field_id) const
  {
    DBUG_ASSERT(field_id < FIELD_COUNT);
    return table->field[field_id];
  }
  operator bool () const
  {
    return table;
  }
  bool operator== (const TABLE_LIST &subj) const
  {
    return (!cmp(&db, &subj.db) && !cmp(&table_name, &subj.table_name));
  }
  bool operator!= (const TABLE_LIST &subj) const
  {
    return !(*this == subj);
  }
};

#endif /* MYSQL_CLIENT */

#endif /* TABLE_INCLUDED */
server/private/sql_derived.h000064400000002411150400263760012177 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_DERIVED_INCLUDED
#define SQL_DERIVED_INCLUDED

struct TABLE_LIST;
class THD;
struct LEX;

bool mysql_handle_derived(LEX *lex, uint phases);
bool mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases);

Item *transform_condition_or_part(THD *thd,
                                  Item *cond,
                                  Item_transformer transformer,
                                  uchar *arg);

bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived);

#endif /* SQL_DERIVED_INCLUDED */
server/private/my_md5.h000064400000002716150400263760011100 0ustar00#ifndef MY_MD5_INCLUDED
#define MY_MD5_INCLUDED

/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2013 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#include "m_string.h"

#define MD5_HASH_SIZE 16 /* Hash size in bytes */

/*
  Wrapper function for MD5 implementation.
*/
#ifdef __cplusplus
extern "C" {
#endif

#define compute_md5_hash(A,B,C) my_md5(A,B,C)

/*
  Convert an array of bytes to a hexadecimal representation.

  Used to generate a hexadecimal representation of a message digest.
*/
static inline void array_to_hex(char *to, const unsigned char *str, uint len)
{
  const unsigned char *str_end= str + len;
  for (; str != str_end; ++str)
  {
    *to++= _dig_vec_lower[((uchar) *str) >> 4];
    *to++= _dig_vec_lower[((uchar) *str) & 0x0F];
  }
}

#ifdef __cplusplus
}
#endif

#endif /* MY_MD5_INCLUDED */
server/private/my_bitmap.h000064400000013372150400263760011667 0ustar00/* Copyright (c) 2001, 2011, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef _my_bitmap_h_
#define _my_bitmap_h_

#define MY_BIT_NONE (~(uint) 0)

#include <m_string.h>
#include <my_pthread.h>

typedef ulonglong my_bitmap_map;

typedef struct st_bitmap
{
  my_bitmap_map *bitmap;
  my_bitmap_map *last_word_ptr;
  /*
     mutex will be acquired for the duration of each bitmap operation if
     thread_safe flag in bitmap_init was set.  Otherwise, we optimize by not
     acquiring the mutex
   */
  mysql_mutex_t *mutex;
  my_bitmap_map last_bit_mask;
  uint32	n_bits; /* number of bits occupied by the above */
  my_bool       bitmap_allocated;
} MY_BITMAP;

#ifdef	__cplusplus
extern "C" {
#endif

/* Reset memory. Faster then doing a full bzero */
#define my_bitmap_clear(A) ((A)->bitmap= 0)

extern void create_last_bit_mask(MY_BITMAP *map);
extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
                              my_bool thread_safe);
extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2);
extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
                                     const MY_BITMAP *map2);
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
                                       const MY_BITMAP *map2);
extern my_bool bitmap_exists_intersection(MY_BITMAP **bitmap_array,
                                          uint bitmap_count,
                                          uint start_bit, uint end_bit);

extern uint bitmap_set_next(MY_BITMAP *map);
extern uint bitmap_get_first_clear(const MY_BITMAP *map);
extern uint bitmap_get_first_set(const MY_BITMAP *map);
extern uint bitmap_bits_set(const MY_BITMAP *map);
extern uint bitmap_get_next_set(const MY_BITMAP *map, uint bitmap_bit);
extern void my_bitmap_free(MY_BITMAP *map);
extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit);
extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size);
extern void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_invert(MY_BITMAP *map);
extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
/* Functions to export/import bitmaps to an architecture independent format */
extern void bitmap_export(uchar *to, MY_BITMAP *map);
extern void bitmap_import(MY_BITMAP *map, uchar *from);

extern uint bitmap_lock_set_next(MY_BITMAP *map);
extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);

#define my_bitmap_map_bytes sizeof(my_bitmap_map)
#define my_bitmap_map_bits  (my_bitmap_map_bytes*8)
/* Size in bytes to store 'bits' number of bits */
#define bitmap_buffer_size(bits) (MY_ALIGN((bits), my_bitmap_map_bits)/8)
#define my_bitmap_buffer_size(map) bitmap_buffer_size((map)->n_bits)
#define no_bytes_in_export_map(map) (((map)->n_bits + 7)/8)
#define no_words_in_map(map) (((map)->n_bits + (my_bitmap_map_bits-1))/my_bitmap_map_bits)

/* Fast, not thread safe, bitmap functions */
/* The following functions must be compatible with create_last_bit_mask()! */
static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit)
{
  DBUG_ASSERT(bit < map->n_bits);
  map->bitmap[bit/my_bitmap_map_bits]|=
    (1ULL << (bit & (my_bitmap_map_bits-1)));
}
static inline void
bitmap_flip_bit(MY_BITMAP *map,uint bit)
{
  DBUG_ASSERT(bit < map->n_bits);
  map->bitmap[bit/my_bitmap_map_bits]^=
    (1ULL << (bit & (my_bitmap_map_bits-1)));
}
static inline void
bitmap_clear_bit(MY_BITMAP *map,uint bit)
{
  DBUG_ASSERT(bit < map->n_bits);
  map->bitmap[bit/my_bitmap_map_bits]&=
    ~(1ULL << (bit & (my_bitmap_map_bits-1)));
}
static inline uint
bitmap_is_set(const MY_BITMAP *map,uint bit)
{
  DBUG_ASSERT(bit < map->n_bits);
  return (!!(map->bitmap[bit/my_bitmap_map_bits] &
             (1ULL << (bit & (my_bitmap_map_bits-1)))));
}

/* Return true if bitmaps are equal */
static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
{
  DBUG_ASSERT(map1->n_bits == map2->n_bits);
  return (memcmp(map1->bitmap, map2->bitmap,
                 my_bitmap_buffer_size(map1)) == 0);
}

#define bitmap_clear_all(MAP) \
  { memset((MAP)->bitmap, 0, my_bitmap_buffer_size(MAP)); }

static inline void
bitmap_set_all(const MY_BITMAP *map)
{
  if (map->n_bits)
  {
    memset(map->bitmap, 0xFF, my_bitmap_map_bytes * (no_words_in_map(map)-1));
    DBUG_ASSERT(map->bitmap + no_words_in_map(map)-1 == map->last_word_ptr);
    *map->last_word_ptr= ~map->last_bit_mask;
  }
}

#ifdef	__cplusplus
}
#endif

#endif /* _my_bitmap_h_ */
server/private/create_options.h000064400000010654150400263760012724 0ustar00/* Copyright (C) 2010 Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @file

  Engine defined options of tables/fields/keys in CREATE/ALTER TABLE.
*/

#ifndef SQL_CREATE_OPTIONS_INCLUDED
#define SQL_CREATE_OPTIONS_INCLUDED

#include "sql_class.h"

enum { ENGINE_OPTION_MAX_LENGTH=32767 };

class engine_option_value: public Sql_alloc
{
 public:
  LEX_CSTRING name;
  LEX_CSTRING value;
  engine_option_value *next;    ///< parser puts them in a FIFO linked list
  bool parsed;                  ///< to detect unrecognized options
  bool quoted_value;            ///< option=VAL vs. option='VAL'

  engine_option_value(engine_option_value *src,
                      engine_option_value **start, engine_option_value **end) :
    name(src->name), value(src->value),
    next(NULL), parsed(src->parsed), quoted_value(src->quoted_value)
  {
    link(start, end);
  }
  engine_option_value(LEX_CSTRING &name_arg, LEX_CSTRING &value_arg,
                      bool quoted,
                      engine_option_value **start, engine_option_value **end) :
    name(name_arg), value(value_arg),
    next(NULL), parsed(false), quoted_value(quoted)
  {
    link(start, end);
  }
  engine_option_value(LEX_CSTRING &name_arg,
                      engine_option_value **start, engine_option_value **end) :
    name(name_arg), value(null_clex_str),
    next(NULL), parsed(false), quoted_value(false)
  {
    link(start, end);
  }
  engine_option_value(LEX_CSTRING &name_arg, ulonglong value_arg,
                      engine_option_value **start, engine_option_value **end,
                      MEM_ROOT *root) :
    name(name_arg), next(NULL), parsed(false), quoted_value(false)
  {
    char *str;
    if (likely((value.str= str= (char *)alloc_root(root, 22))))
    {
      value.length= longlong10_to_str(value_arg, str, 10) - str;
      link(start, end);
    }
  }
  static uchar *frm_read(const uchar *buff, const uchar *buff_end,
                         engine_option_value **start,
                         engine_option_value **end, MEM_ROOT *root);
  void link(engine_option_value **start, engine_option_value **end);
  uint frm_length();
  uchar *frm_image(uchar *buff);
};

typedef struct st_key KEY;
class Create_field;

bool resolve_sysvar_table_options(handlerton *hton);
void free_sysvar_table_options(handlerton *hton);
bool parse_engine_table_options(THD *thd, handlerton *ht, TABLE_SHARE *share);
bool parse_option_list(THD* thd, void *option_struct,
                       engine_option_value **option_list,
                       ha_create_table_option *rules,
                       bool suppress_warning, MEM_ROOT *root);
bool extend_option_list(THD* thd, handlerton *hton, bool create,
                        engine_option_value **option_list,
                        ha_create_table_option *rules);

bool engine_table_options_frm_read(const uchar *buff, size_t length,
                                   TABLE_SHARE *share);
engine_option_value *merge_engine_table_options(engine_option_value *source,
                                                engine_option_value *changes,
                                                MEM_ROOT *root);

uint engine_table_options_frm_length(engine_option_value *table_option_list,
                                     List<Create_field> &create_fields,
                                     uint keys, KEY *key_info);
uchar *engine_table_options_frm_image(uchar *buff,
                                      engine_option_value *table_option_list,
                                      List<Create_field> &create_fields,
                                      uint keys, KEY *key_info);

bool engine_options_differ(void *old_struct, void *new_struct,
                           ha_create_table_option *rules);
bool is_engine_option_known(engine_option_value *opt,
                            ha_create_table_option *rules);
#endif
server/private/filesort.h000064400000016163150400263760011536 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef FILESORT_INCLUDED
#define FILESORT_INCLUDED

#include "my_base.h"                            /* ha_rows */
#include "sql_alloc.h"
#include "filesort_utils.h"

class SQL_SELECT;
class THD;
struct TABLE;
class Filesort_tracker;
struct SORT_FIELD;
struct SORT_FIELD_ATTR;
typedef struct st_order ORDER;
class JOIN;
class Addon_fields;
class Sort_keys;


/**
  Sorting related info.
  To be extended by another WL to include complete filesort implementation.
*/
class Filesort: public Sql_alloc
{
public:
  /** List of expressions to order the table by */
  ORDER *order;
  /** Number of records to return */
  ha_rows limit;
  /** ORDER BY list with some precalculated info for filesort */
  SORT_FIELD *sortorder;
  /* Used with ROWNUM. Contains the number of rows filesort has found so far */
  ha_rows *accepted_rows;
  /** select to use for getting records */
  SQL_SELECT *select;

  /** TRUE <=> free select on destruction */
  bool own_select;
  /** TRUE means we are using Priority Queue for order by with limit. */
  bool using_pq;
  /* 
    TRUE means sort operation must produce table rowids. 
    FALSE means that it also has an option of producing {sort_key, addon_fields}
          pairs.

    Usually initialized with value of join_tab->keep_current_rowid to allow for
    a call to table->file->position() using these table rowids.
  */
  bool sort_positions;
  /*
    TRUE means all the fields of table of whose bitmap read_set is set
         need to be read while reading records in the sort buffer.
    FALSE otherwise
  */
  bool set_all_read_bits;

  Filesort_tracker *tracker;
  Sort_keys *sort_keys;

  /* Unpack temp table columns to base table columns*/
  void (*unpack)(TABLE *);

  Filesort(ORDER *order_arg, ha_rows limit_arg, bool sort_positions_arg,
           SQL_SELECT *select_arg):
    order(order_arg),
    limit(limit_arg),
    sortorder(NULL),
    accepted_rows(0),
    select(select_arg),
    own_select(false), 
    using_pq(false),
    sort_positions(sort_positions_arg),
    set_all_read_bits(false),
    sort_keys(NULL),
    unpack(NULL)
  {
    DBUG_ASSERT(order);
  };

  ~Filesort() { cleanup(); }
  /* Prepare ORDER BY list for sorting. */
  Sort_keys* make_sortorder(THD *thd, JOIN *join, table_map first_table_bit);

private:
  void cleanup();
};


class SORT_INFO
{
  /// Buffer for sorting keys.
  Filesort_buffer filesort_buffer;

public:
  SORT_INFO()
    :addon_fields(NULL), record_pointers(0),
     sort_keys(NULL),
     sorted_result_in_fsbuf(FALSE)
  {
    buffpek.str= 0;
    my_b_clear(&io_cache);
  }

  ~SORT_INFO();

  void free_data()
  {
    close_cached_file(&io_cache);
    free_addon_buff();
    my_free(record_pointers);
    my_free(buffpek.str);
    my_free(addon_fields);
    free_sort_buffer();
  }

  void reset()
  {
    free_data();
    record_pointers= 0;
    buffpek.str= 0;
    addon_fields= 0;
    sorted_result_in_fsbuf= false;
  }

  void free_addon_buff();

  IO_CACHE  io_cache;           /* If sorted through filesort */
  LEX_STRING buffpek;           /* Buffer for buffpek structures */
  Addon_fields *addon_fields;   /* Addon field descriptors */
  uchar     *record_pointers;    /* If sorted in memory */
  Sort_keys *sort_keys;         /* Sort key descriptors*/

  /**
    If the entire result of filesort fits in memory, we skip the merge phase.
    We may leave the result in filesort_buffer
    (indicated by sorted_result_in_fsbuf), or we may strip away
    the sort keys, and copy the sorted result into a new buffer.
    @see save_index()
   */
  bool      sorted_result_in_fsbuf;

  /*
    How many rows in final result.
    Also how many rows in record_pointers, if used
  */
  ha_rows   return_rows;
  ha_rows   examined_rows;	/* How many rows read */
  ha_rows   found_rows;         /* How many rows was accepted */

  /** Sort filesort_buffer */
  void sort_buffer(Sort_param *param, uint count)
  { filesort_buffer.sort_buffer(param, count); }

  uchar **get_sort_keys()
  { return filesort_buffer.get_sort_keys(); }

  uchar *get_sorted_record(uint ix)
  { return filesort_buffer.get_sorted_record(ix); }

  uchar *alloc_sort_buffer(uint num_records, uint record_length)
  { return filesort_buffer.alloc_sort_buffer(num_records, record_length); }

  void free_sort_buffer()
  { filesort_buffer.free_sort_buffer(); }

  bool isfull() const
  { return filesort_buffer.isfull(); }
  void init_record_pointers()
  { filesort_buffer.init_record_pointers(); }
  void init_next_record_pointer()
  { filesort_buffer.init_next_record_pointer(); }
  uchar *get_next_record_pointer()
  { return filesort_buffer.get_next_record_pointer(); }
  void adjust_next_record_pointer(uint val)
  { filesort_buffer.adjust_next_record_pointer(val); }

  Bounds_checked_array<uchar> get_raw_buf()
  { return filesort_buffer.get_raw_buf(); }

  size_t sort_buffer_size() const
  { return filesort_buffer.sort_buffer_size(); }

  bool is_allocated() const
  { return filesort_buffer.is_allocated(); }
  void set_sort_length(uint val)
  { filesort_buffer.set_sort_length(val); }
  uint get_sort_length() const
  { return filesort_buffer.get_sort_length(); }

  bool has_filesort_result_in_memory() const
  {
    return record_pointers || sorted_result_in_fsbuf;
  }

  /// Are we using "addon fields"?
  bool using_addon_fields() const
  {
    return addon_fields != NULL;
  }

  /// Are we using "packed addon fields"?
  bool using_packed_addons();

  /**
    Copies (unpacks) values appended to sorted fields from a buffer back to
    their regular positions specified by the Field::ptr pointers.
    @param buff            Buffer which to unpack the value from
  */
  template<bool Packed_addon_fields>
  inline void unpack_addon_fields(uchar *buff);

  bool using_packed_sortkeys();

  friend SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
                             Filesort_tracker* tracker, JOIN *join,
                             table_map first_table_bit);
};

SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
                    Filesort_tracker* tracker, JOIN *join=NULL,
                    table_map first_table_bit=0);

bool filesort_use_addons(TABLE *table, uint sortlength,
                         uint *length, uint *fields, uint *null_fields,
                         uint *m_packable_length);

void change_double_for_sort(double nr,uchar *to);
void store_length(uchar *to, uint length, uint pack_length);
void
reverse_key(uchar *to, const SORT_FIELD_ATTR *sort_field);

#endif /* FILESORT_INCLUDED */
server/private/sql_cache.h000064400000052254150400263760011632 0ustar00/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef _SQL_CACHE_H
#define _SQL_CACHE_H

#include "hash.h"
#include "my_base.h"                            /* ha_rows */

class MY_LOCALE;
struct TABLE_LIST;
class Time_zone;
struct LEX;
struct TABLE;
typedef struct st_changed_table_list CHANGED_TABLE_LIST;

/* Query cache */

/*
   Can't create new free memory block if unused memory in block less
   then QUERY_CACHE_MIN_ALLOCATION_UNIT.
   if QUERY_CACHE_MIN_ALLOCATION_UNIT == 0 then
   QUERY_CACHE_MIN_ALLOCATION_UNIT choosed automatically
*/
#define QUERY_CACHE_MIN_ALLOCATION_UNIT		512

/* inittial size of hashes */
#define QUERY_CACHE_DEF_QUERY_HASH_SIZE		1024
#define QUERY_CACHE_DEF_TABLE_HASH_SIZE		1024

/* minimal result data size when data allocated */
#define QUERY_CACHE_MIN_RESULT_DATA_SIZE	(1024*4)

/* 
   start estimation of first result block size only when number of queries
   bigger then: 
*/
#define QUERY_CACHE_MIN_ESTIMATED_QUERIES_NUMBER 3



/* memory bins size spacing (see at Query_cache::init_cache (sql_cache.cc)) */
#define QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2	4
#define QUERY_CACHE_MEM_BIN_STEP_PWR2		2
#define QUERY_CACHE_MEM_BIN_PARTS_INC		1
#define QUERY_CACHE_MEM_BIN_PARTS_MUL		1.2
#define QUERY_CACHE_MEM_BIN_SPC_LIM_PWR2	3

/* how many free blocks check when finding most suitable before other 'end'
   of list of free blocks */
#define QUERY_CACHE_MEM_BIN_TRY                 5

/* packing parameters */
#define QUERY_CACHE_PACK_ITERATION		2
#define QUERY_CACHE_PACK_LIMIT			(512*1024L)

#define TABLE_COUNTER_TYPE uint

struct Query_cache_block;
struct Query_cache_block_table;
struct Query_cache_table;
struct Query_cache_query;
struct Query_cache_result;
class Query_cache;
struct Query_cache_tls;
struct LEX;
class THD;

typedef my_bool (*qc_engine_callback)(THD *thd, const char *table_key,
                                      uint key_length,
                                      ulonglong *engine_data);

/**
  This class represents a node in the linked chain of queries
  belonging to one table.

  @note The root of this linked list is not a query-type block, but the table-
        type block which all queries has in common.
*/
struct Query_cache_block_table
{
  Query_cache_block_table() = default;                /* Remove gcc warning */

  /**
    This node holds a position in a static table list belonging
    to the associated query (base 0).
  */
  TABLE_COUNTER_TYPE n;

  /**
    Pointers to the next and previous node, linking all queries with 
    a common table.
  */
  Query_cache_block_table *next, *prev;

  /**
    A pointer to the table-type block which all
    linked queries has in common.
  */
  Query_cache_table *parent;

  /**
    A method to calculate the address of the query cache block
    owning this node. The purpose of this calculation is to 
    make it easier to move the query cache block without having
    to modify all the pointer addresses.
  */
  inline Query_cache_block *block();
};

struct Query_cache_block
{
  Query_cache_block() = default;                      /* Remove gcc warning */
  enum block_type {FREE, QUERY, RESULT, RES_CONT, RES_BEG,
		   RES_INCOMPLETE, TABLE, INCOMPLETE};

  size_t length;					// length of all block
  size_t used;					// length of data
  /*
    Not used **pprev, **prev because really needed access to pervious block:
    *pprev to join free blocks
    *prev to access to opposite side of list in cyclic sorted list
  */
  Query_cache_block *pnext,*pprev,		// physical next/previous block
		    *next,*prev;		// logical next/previous block
  block_type type;
  TABLE_COUNTER_TYPE n_tables;			// number of tables in query

  inline bool is_free(void) { return type == FREE; }
  void init(size_t length);
  void destroy();
  uint headers_len() const;
  uchar* data(void) const;
  Query_cache_query *query();
  Query_cache_table *table();
  Query_cache_result *result();
  Query_cache_block_table *table(TABLE_COUNTER_TYPE n);
};

struct Query_cache_query
{
  ulonglong limit_found_rows;
  mysql_rwlock_t lock;
  Query_cache_block *res;
  Query_cache_tls *wri;
  size_t len;
  unsigned int last_pkt_nr;
  uint8 tbls_type;
  uint8 ready;
  ulonglong hit_count;

  Query_cache_query() = default;                      /* Remove gcc warning */
  inline void init_n_lock();
  void unlock_n_destroy();
  inline ulonglong found_rows()		   { return limit_found_rows; }
  inline void found_rows(ulonglong rows)   { limit_found_rows= rows; }
  inline Query_cache_block *result()	   { return res; }
  inline void result(Query_cache_block *p) { res= p; }
  inline Query_cache_tls *writer()	   { return wri; }
  inline void writer(Query_cache_tls *p)   { wri= p; }
  inline uint8 tables_type()               { return tbls_type; }
  inline void tables_type(uint8 type)      { tbls_type= type; }
  inline size_t length()			   { return len; }
  inline size_t add(size_t packet_len)	   { return(len+= packet_len); }
  inline void length(size_t length_arg)	   { len= length_arg; }
  inline uchar* query()
  {
    return (((uchar*)this) + ALIGN_SIZE(sizeof(Query_cache_query)));
  }
  /**
    following used to check if result ready in plugin without
    locking rw_lock of the query.
  */
  inline void set_results_ready()          { ready= 1; }
  inline bool is_results_ready()           { return ready; }
  inline void increment_hits() { hit_count++; }
  inline ulonglong hits() { return hit_count; }
  void lock_writing();
  void lock_reading();
  bool try_lock_writing();
  void unlock_writing();
  void unlock_reading();
};


struct Query_cache_table
{
  Query_cache_table() = default;                      /* Remove gcc warning */
  char *tbl;
  uint32 key_len;
  uint8 suffix_len;                          /* For partitioned tables */
  uint8 table_type;
  /* unique for every engine reference */
  qc_engine_callback callback_func;
  /* data need by some engines */
  ulonglong engine_data_buff;

  /**
    The number of queries depending of this table.
  */
  int32 m_cached_query_count;
  /**
    If table included in the table hash to be found by other queries
  */
  my_bool hashed;

  inline char *db()			     { return (char *) data(); }
  inline char *table()			     { return tbl; }
  inline void table(char *table_arg)	     { tbl= table_arg; }
  inline uint32 key_length()                 { return key_len; }
  inline void key_length(uint32 len)         { key_len= len; }
  inline uint8 suffix_length()               { return suffix_len; }
  inline void suffix_length(uint8 len)       { suffix_len= len; }
  inline uint8 type()                        { return table_type; }
  inline void type(uint8 t)                  { table_type= t; }
  inline qc_engine_callback callback()       { return callback_func; }
  inline void callback(qc_engine_callback fn){ callback_func= fn; }
  inline ulonglong engine_data()             { return engine_data_buff; }
  inline void engine_data(ulonglong data_arg){ engine_data_buff= data_arg; }
  inline my_bool is_hashed()                 { return hashed; }
  inline void set_hashed(my_bool hash)       { hashed= hash; }
  inline uchar* data()
  {
    return (uchar*)(((uchar*)this)+
		  ALIGN_SIZE(sizeof(Query_cache_table)));
  }
};

struct Query_cache_result
{
  Query_cache_result() = default;                     /* Remove gcc warning */
  Query_cache_block *query;

  inline uchar* data()
  {
    return (uchar*)(((uchar*) this)+
		  ALIGN_SIZE(sizeof(Query_cache_result)));
  }
  /* data_continue (if not whole packet contained by this block) */
  inline Query_cache_block *parent()		  { return query; }
  inline void parent (Query_cache_block *p)	  { query=p; }
};


extern "C"
{
  const uchar *query_cache_query_get_key(const void *record, size_t *length,
                                         my_bool);
  const uchar *query_cache_table_get_key(const void *record, size_t *length,
                                         my_bool);
}
extern "C" void query_cache_invalidate_by_MyISAM_filename(const char* filename);


struct Query_cache_memory_bin
{
  Query_cache_memory_bin() = default;                 /* Remove gcc warning */
#ifndef DBUG_OFF
  size_t size;
#endif
  uint number;
  Query_cache_block *free_blocks;

  inline void init(size_t size_arg)
  {
#ifndef DBUG_OFF
    size = size_arg;
#endif
    number = 0;
    free_blocks = 0;
  }
};

struct Query_cache_memory_bin_step
{
  Query_cache_memory_bin_step() = default;            /* Remove gcc warning */
  size_t size;
  size_t increment;
  size_t idx;
  inline void init(size_t size_arg, size_t idx_arg, size_t increment_arg)
  {
    size = size_arg;
    idx = idx_arg;
    increment = increment_arg;
  }
};

class Query_cache
{
public:
  /* Info */
  size_t query_cache_size, query_cache_limit;
  /* statistics */
  size_t free_memory, queries_in_cache, hits, inserts, refused,
    free_memory_blocks, total_blocks, lowmem_prunes;


private:
#ifndef DBUG_OFF
  my_thread_id m_cache_lock_thread_id;
#endif
  mysql_cond_t COND_cache_status_changed;
  uint m_requests_in_progress;
  enum Cache_lock_status { UNLOCKED, LOCKED_NO_WAIT, LOCKED };
  Cache_lock_status m_cache_lock_status;
  enum Cache_staus {OK, DISABLE_REQUEST, DISABLED};
  Cache_staus m_cache_status;

  void free_query_internal(Query_cache_block *point);
  void invalidate_table_internal(uchar *key, size_t key_length);

protected:
  /*
    The following mutex is locked when searching or changing global
    query, tables lists or hashes. When we are operating inside the
    query structure we locked an internal query block mutex.
    LOCK SEQUENCE (to prevent deadlocks):
      1. structure_guard_mutex
      2. query block (for operation inside query (query block/results))

    Thread doing cache flush releases the mutex once it sets
    m_cache_lock_status flag, so other threads may bypass the cache as
    if it is disabled, not waiting for reset to finish.  The exception
    is other threads that were going to do cache flush---they'll wait
    till the end of a flush operation.
  */
  mysql_mutex_t structure_guard_mutex;
  size_t additional_data_size;
  uchar *cache;					// cache memory
  Query_cache_block *first_block;		// physical location block list
  Query_cache_block *queries_blocks;		// query list (LIFO)
  Query_cache_block *tables_blocks;

  Query_cache_memory_bin *bins;			// free block lists
  Query_cache_memory_bin_step *steps;		// bins spacing info
  HASH queries, tables;
  /* options */
  size_t min_allocation_unit, min_result_data_size;
  uint def_query_hash_size, def_table_hash_size;
  
  size_t mem_bin_num, mem_bin_steps;		// See at init_cache & find_bin

  bool initialized;

  /* Exclude/include from cyclic double linked list */
  static void double_linked_list_exclude(Query_cache_block *point,
					 Query_cache_block **list_pointer);
  static void double_linked_list_simple_include(Query_cache_block *point,
						Query_cache_block **
						list_pointer);
  static void double_linked_list_join(Query_cache_block *head_tail,
				      Query_cache_block *tail_head);

  /* The following functions require that structure_guard_mutex is locked */
  void flush_cache();
  my_bool free_old_query();
  void free_query(Query_cache_block *point);
  my_bool allocate_data_chain(Query_cache_block **result_block,
			      size_t data_len,
			      Query_cache_block *query_block,
			      my_bool first_block);
  void invalidate_table(THD *thd, TABLE_LIST *table);
  void invalidate_table(THD *thd, TABLE *table);
  void invalidate_table(THD *thd, uchar *key, size_t  key_length);
  void invalidate_table(THD *thd, Query_cache_block *table_block);
  void invalidate_query_block_list(Query_cache_block_table *list_root);

  TABLE_COUNTER_TYPE
    register_tables_from_list(THD *thd, TABLE_LIST *tables_used,
                              TABLE_COUNTER_TYPE counter,
                              Query_cache_block_table **block_table);
  my_bool register_all_tables(THD *thd, Query_cache_block *block,
			      TABLE_LIST *tables_used,
			      TABLE_COUNTER_TYPE tables);
  void unlink_table(Query_cache_block_table *node);
  Query_cache_block *get_free_block (size_t len, my_bool not_less,
				      size_t min);
  void free_memory_block(Query_cache_block *point);
  void split_block(Query_cache_block *block, size_t len);
  Query_cache_block *join_free_blocks(Query_cache_block *first_block,
				       Query_cache_block *block_in_list);
  my_bool append_next_free_block(Query_cache_block *block,
				 size_t add_size);
  void exclude_from_free_memory_list(Query_cache_block *free_block);
  void insert_into_free_memory_list(Query_cache_block *new_block);
  my_bool move_by_type(uchar **border, Query_cache_block **before,
		       size_t *gap, Query_cache_block *i);
  uint find_bin(size_t size);
  void move_to_query_list_end(Query_cache_block *block);
  void insert_into_free_memory_sorted_list(Query_cache_block *new_block,
					   Query_cache_block **list);
  void pack_cache();
  void relink(Query_cache_block *oblock,
	      Query_cache_block *nblock,
	      Query_cache_block *next,
	      Query_cache_block *prev,
	      Query_cache_block *pnext,
	      Query_cache_block *pprev);
  my_bool join_results(size_t join_limit);

  /*
    Following function control structure_guard_mutex
    by themself or don't need structure_guard_mutex
  */
  size_t init_cache();
  void make_disabled();
  void free_cache();
  Query_cache_block *write_block_data(size_t data_len, uchar* data,
				       size_t header_len,
				       Query_cache_block::block_type type,
				       TABLE_COUNTER_TYPE ntab = 0);
  my_bool append_result_data(Query_cache_block **result,
			     size_t data_len, uchar* data,
			     Query_cache_block *parent);
  my_bool write_result_data(Query_cache_block **result,
			    size_t data_len, uchar* data,
			    Query_cache_block *parent,
			    Query_cache_block::block_type
			    type=Query_cache_block::RESULT);
  inline size_t get_min_first_result_data_size();
  inline size_t get_min_append_result_data_size();
  Query_cache_block *allocate_block(size_t len, my_bool not_less,
				     size_t min);
  /*
    If query is cacheable return number tables in query
    (query without tables not cached)
  */
  TABLE_COUNTER_TYPE is_cacheable(THD *thd,
                                  LEX *lex, TABLE_LIST *tables_used,
                                  uint8 *tables_type);
  TABLE_COUNTER_TYPE process_and_count_tables(THD *thd,
                                              TABLE_LIST *tables_used,
                                              uint8 *tables_type);

  static my_bool ask_handler_allowance(THD *thd, TABLE_LIST *tables_used);
 public:

  Query_cache(size_t query_cache_limit = ULONG_MAX,
	      size_t min_allocation_unit = QUERY_CACHE_MIN_ALLOCATION_UNIT,
	      size_t min_result_data_size = QUERY_CACHE_MIN_RESULT_DATA_SIZE,
	      uint def_query_hash_size = QUERY_CACHE_DEF_QUERY_HASH_SIZE,
	      uint def_table_hash_size = QUERY_CACHE_DEF_TABLE_HASH_SIZE);

  inline bool is_disabled(void) { return m_cache_status != OK; }
  inline bool is_disable_in_progress(void)
  { return m_cache_status == DISABLE_REQUEST; }

  /* initialize cache (mutex) */
  void init();
  /* resize query cache (return real query size, 0 if disabled) */
  size_t resize(size_t query_cache_size);
  /* set limit on result size */
  inline void result_size_limit(size_t limit){query_cache_limit=limit;}
  /* set minimal result data allocation unit size */
  size_t set_min_res_unit(size_t size);

  /* register query in cache */
  void store_query(THD *thd, TABLE_LIST *used_tables);

  /*
    Check if the query is in the cache and if this is true send the
    data to client.
  */
  int send_result_to_client(THD *thd, char *query, uint query_length);

  /* Remove all queries that uses any of the listed following tables */
  void invalidate(THD *thd, TABLE_LIST *tables_used,
		  my_bool using_transactions);
  void invalidate(THD *thd, CHANGED_TABLE_LIST *tables_used);
  void invalidate_locked_for_write(THD *thd, TABLE_LIST *tables_used);
  void invalidate(THD *thd, TABLE *table, my_bool using_transactions);
  void invalidate(THD *thd, const char *key, size_t key_length,
		  my_bool using_transactions);

  /* Remove all queries that uses any of the tables in following database */
  void invalidate(THD *thd, const char *db);

  /* Remove all queries that uses any of the listed following table */
  void invalidate_by_MyISAM_filename(const char *filename);

  void flush();
  void pack(THD *thd,
            size_t join_limit = QUERY_CACHE_PACK_LIMIT,
	    uint iteration_limit = QUERY_CACHE_PACK_ITERATION);

  void destroy();

  void insert(THD *thd, Query_cache_tls *query_cache_tls,
              const char *packet,
              size_t length,
              unsigned pkt_nr);
  my_bool insert_table(THD *thd, size_t key_len, const char *key,
		       Query_cache_block_table *node,
		       size_t db_length, uint8 suffix_length_arg,
                       uint8 cache_type,
		       qc_engine_callback callback,
		       ulonglong engine_data,
                       my_bool hash);

  void end_of_result(THD *thd);
  void abort(THD *thd, Query_cache_tls *query_cache_tls);

  /*
    The following functions are only used when debugging
    We don't protect these with ifndef DBUG_OFF to not have to recompile
    everything if we want to add checks of the cache at some places.
  */
  void wreck(uint line, const char *message);
  void bins_dump();
  void cache_dump();
  void queries_dump();
  void tables_dump();
  my_bool check_integrity(bool not_locked);
  my_bool in_list(Query_cache_block * root, Query_cache_block * point,
		  const char *name);
  my_bool in_table_list(Query_cache_block_table * root,
			Query_cache_block_table * point,
			const char *name);
  my_bool in_blocks(Query_cache_block * point);

  /* Table key generation */
  static uint filename_2_table_key (char *key, const char *filename,
				    uint32 *db_langth);

  enum Cache_try_lock_mode {WAIT, TIMEOUT, TRY};
  bool try_lock(THD *thd, Cache_try_lock_mode mode= WAIT);
  void lock(THD *thd);
  void lock_and_suspend(void);
  void unlock(void);

  void disable_query_cache(THD *thd);
};

#ifdef HAVE_QUERY_CACHE
struct Query_cache_query_flags
{
  unsigned int client_long_flag:1;
  unsigned int client_protocol_41:1;
  unsigned int client_extended_metadata:1;
  unsigned int client_depr_eof:1;
  unsigned int protocol_type:2;
  unsigned int more_results_exists:1;
  unsigned int in_trans:1;
  unsigned int autocommit:1;
  unsigned int pkt_nr;
  uint character_set_client_num;
  uint character_set_results_num;
  uint collation_connection_num;
  uint group_concat_max_len;
  ha_rows limit;
  Time_zone *time_zone;
  sql_mode_t sql_mode;
  ulonglong max_sort_length;
  size_t default_week_format;
  size_t div_precision_increment;
  MY_LOCALE *lc_time_names;
};
#define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags)
#define QUERY_CACHE_DB_LENGTH_SIZE 2
#include "sql_cache.h"
#define query_cache_abort(A,B) query_cache.abort(A,B)
#define query_cache_end_of_result(A) query_cache.end_of_result(A)
#define query_cache_store_query(A, B) query_cache.store_query(A, B)
#define query_cache_destroy() query_cache.destroy()
#define query_cache_result_size_limit(A) query_cache.result_size_limit(A)
#define query_cache_init() query_cache.init()
#define query_cache_resize(A) query_cache.resize(A)
#define query_cache_set_min_res_unit(A) query_cache.set_min_res_unit(A)
#define query_cache_invalidate3(A, B, C) query_cache.invalidate(A, B, C)
#define query_cache_invalidate1(A, B) query_cache.invalidate(A, B)
#define query_cache_send_result_to_client(A, B, C) \
  query_cache.send_result_to_client(A, B, C)
#define query_cache_invalidate_by_MyISAM_filename_ref \
  &query_cache_invalidate_by_MyISAM_filename
/* note the "maybe": it's a read without mutex */
#define query_cache_maybe_disabled(T)                                 \
  (T->variables.query_cache_type == 0 || query_cache.query_cache_size == 0)
#define query_cache_is_cacheable_query(L) \
  (((L)->sql_command == SQLCOM_SELECT) && (L)->safe_to_cache_query)
#else
#define QUERY_CACHE_FLAGS_SIZE 0
#define query_cache_store_query(A, B)     do { } while(0)
#define query_cache_destroy()             do { } while(0)
#define query_cache_result_size_limit(A)  do { } while(0)
#define query_cache_init()                do { } while(0)
#define query_cache_resize(A)             do { } while(0)
#define query_cache_set_min_res_unit(A)   do { } while(0)
#define query_cache_invalidate3(A, B, C)  do { } while(0)
#define query_cache_invalidate1(A,B)      do { } while(0)
#define query_cache_send_result_to_client(A, B, C) 0
#define query_cache_invalidate_by_MyISAM_filename_ref NULL

#define query_cache_abort(A,B)            do { } while(0)
#define query_cache_end_of_result(A)      do { } while(0)
#define query_cache_maybe_disabled(T) 1
#define query_cache_is_cacheable_query(L) 0
#endif /*HAVE_QUERY_CACHE*/

extern MYSQL_PLUGIN_IMPORT Query_cache query_cache;
#endif
server/private/sql_reload.h000064400000002014150400263760012022 0ustar00#ifndef SQL_RELOAD_INCLUDED
#define SQL_RELOAD_INCLUDED
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

class THD;
struct TABLE_LIST;

bool reload_acl_and_cache(THD *thd, unsigned long long options,
                          TABLE_LIST *tables, int *write_to_binlog);

bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables);

#endif
server/private/log.h000064400000132003150400263760010460 0ustar00/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, 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 */

#ifndef LOG_H
#define LOG_H

#include "handler.h"                            /* my_xid */
#include "rpl_constants.h"

class Relay_log_info;

class Format_description_log_event;

bool reopen_fstreams(const char *filename, FILE *outstream, FILE *errstream);
void setup_log_handling();
bool trans_has_updated_trans_table(const THD* thd);
bool stmt_has_updated_trans_table(const THD *thd);
bool use_trans_cache(const THD* thd, bool is_transactional);
bool ending_trans(THD* thd, const bool all);
bool ending_single_stmt_trans(THD* thd, const bool all);
bool trans_has_updated_non_trans_table(const THD* thd);
bool stmt_has_updated_non_trans_table(const THD* thd);

/*
  Transaction Coordinator log - a base abstract class
  for two different implementations
*/
class TC_LOG
{
  public:
  int using_heuristic_recover();
  TC_LOG() = default;
  virtual ~TC_LOG() = default;

  virtual int open(const char *opt_name)=0;
  virtual void close()=0;
  /*
    Transaction coordinator 2-phase commit.

    Must invoke the run_prepare_ordered and run_commit_ordered methods, as
    described below for these methods.

    In addition, must invoke THD::wait_for_prior_commit(), or equivalent
    wait, to ensure that one commit waits for another if registered to do so.
  */
  virtual int log_and_order(THD *thd, my_xid xid, bool all,
                            bool need_prepare_ordered,
                            bool need_commit_ordered) = 0;
  virtual int unlog(ulong cookie, my_xid xid)=0;
  virtual int unlog_xa_prepare(THD *thd, bool all)= 0;
  virtual void commit_checkpoint_notify(void *cookie)= 0;

protected:
  /*
    These methods are meant to be invoked from log_and_order() implementations
    to run any prepare_ordered() respectively commit_ordered() methods in
    participating handlers.

    They must be called using suitable thread syncronisation to ensure that
    they are each called in the correct commit order among all
    transactions. However, it is only necessary to call them if the
    corresponding flag passed to log_and_order is set (it is safe, but not
    required, to call them when the flag is false).

    The caller must be holding LOCK_prepare_ordered respectively
    LOCK_commit_ordered when calling these methods.
  */
  void run_prepare_ordered(THD *thd, bool all);
  void run_commit_ordered(THD *thd, bool all);
};

/*
  Locks used to ensure serialised execution of TC_LOG::run_prepare_ordered()
  and TC_LOG::run_commit_ordered(), or any other code that calls handler
  prepare_ordered() or commit_ordered() methods.
*/
extern mysql_mutex_t LOCK_prepare_ordered;
extern mysql_cond_t COND_prepare_ordered;
extern mysql_mutex_t LOCK_after_binlog_sync;
extern mysql_mutex_t LOCK_commit_ordered;
#ifdef HAVE_PSI_INTERFACE
extern PSI_mutex_key key_LOCK_prepare_ordered, key_LOCK_commit_ordered;
extern PSI_mutex_key key_LOCK_after_binlog_sync;
extern PSI_cond_key key_COND_prepare_ordered;
#endif

class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
{
public:
  TC_LOG_DUMMY() = default;
  int open(const char *opt_name) override        { return 0; }
  void close() override                          { }
  /*
    TC_LOG_DUMMY is only used when there are <= 1 XA-capable engines, and we
    only use internal XA during commit when >= 2 XA-capable engines
    participate.
  */
  int log_and_order(THD *thd, my_xid xid, bool all,
                    bool need_prepare_ordered, bool need_commit_ordered) override
  {
    DBUG_ASSERT(0);
    return 1;
  }
  int unlog(ulong cookie, my_xid xid) override  { return 0; }
  int unlog_xa_prepare(THD *thd, bool all) override
  {
    return 0;
  }
  void commit_checkpoint_notify(void *cookie) override { DBUG_ASSERT(0); };
};

#define TC_LOG_PAGE_SIZE   8192

#ifdef HAVE_MMAP
class TC_LOG_MMAP: public TC_LOG
{
  public:                // only to keep Sun Forte on sol9x86 happy
  typedef enum {
    PS_POOL,                 // page is in pool
    PS_ERROR,                // last sync failed
    PS_DIRTY                 // new xids added since last sync
  } PAGE_STATE;

  struct pending_cookies {
    uint count;
    uint pending_count;
    ulong cookies[1];
  };

  private:
  typedef struct st_page {
    struct st_page *next; // page a linked in a fifo queue
    my_xid *start, *end;  // usable area of a page
    my_xid *ptr;          // next xid will be written here
    int size, free;       // max and current number of free xid slots on the page
    int waiters;          // number of waiters on condition
    PAGE_STATE state;     // see above
    mysql_mutex_t lock; // to access page data or control structure
    mysql_cond_t  cond; // to wait for a sync
  } PAGE;

  /* List of THDs for which to invoke commit_ordered(), in order. */
  struct commit_entry
  {
    struct commit_entry *next;
    THD *thd;
  };

  char logname[FN_REFLEN];
  File fd;
  my_off_t file_length;
  uint npages, inited;
  uchar *data;
  struct st_page *pages, *syncing, *active, *pool, **pool_last_ptr;
  /*
    note that, e.g. LOCK_active is only used to protect
    'active' pointer, to protect the content of the active page
    one has to use active->lock.
    Same for LOCK_pool and LOCK_sync
  */
  mysql_mutex_t LOCK_active, LOCK_pool, LOCK_sync, LOCK_pending_checkpoint;
  mysql_cond_t COND_pool, COND_active;
  /*
    Queue of threads that need to call commit_ordered().
    Access to this queue must be protected by LOCK_prepare_ordered.
  */
  commit_entry *commit_ordered_queue;
  /*
    This flag and condition is used to reserve the queue while threads in it
    each run the commit_ordered() methods one after the other. Only once the
    last commit_ordered() in the queue is done can we start on a new queue
    run.

    Since we start this process in the first thread in the queue and finish in
    the last (and possibly different) thread, we need a condition variable for
    this (we cannot unlock a mutex in a different thread than the one who
    locked it).

    The condition is used together with the LOCK_prepare_ordered mutex.
  */
  mysql_cond_t COND_queue_busy;
  my_bool commit_ordered_queue_busy;
  pending_cookies* pending_checkpoint;

  public:
  TC_LOG_MMAP(): inited(0), pending_checkpoint(0) {}
  int open(const char *opt_name) override;
  void close() override;
  int log_and_order(THD *thd, my_xid xid, bool all,
                    bool need_prepare_ordered, bool need_commit_ordered) override;
  int unlog(ulong cookie, my_xid xid) override;
  int unlog_xa_prepare(THD *thd, bool all) override
  {
    return 0;
  }
  void commit_checkpoint_notify(void *cookie) override;
  int recover();

  private:
  int log_one_transaction(my_xid xid);
  void get_active_from_pool();
  int sync();
  int overflow();
  int delete_entry(ulong cookie);
};
#else
#define TC_LOG_MMAP TC_LOG_DUMMY
#endif

extern TC_LOG *tc_log;
extern TC_LOG_MMAP tc_log_mmap;
extern TC_LOG_DUMMY tc_log_dummy;

/* log info errors */
#define LOG_INFO_EOF -1
#define LOG_INFO_IO  -2
#define LOG_INFO_INVALID -3
#define LOG_INFO_SEEK -4
#define LOG_INFO_MEM -6
#define LOG_INFO_FATAL -7
#define LOG_INFO_IN_USE -8
#define LOG_INFO_EMFILE -9


/* bitmap to SQL_LOG::close() */
#define LOG_CLOSE_INDEX		1
#define LOG_CLOSE_TO_BE_OPENED	2
#define LOG_CLOSE_STOP_EVENT	4
#define LOG_CLOSE_DELAYED_CLOSE 8

/* 
  Maximum unique log filename extension.
  Note: setting to 0x7FFFFFFF due to atol windows 
        overflow/truncate.
 */
#define MAX_LOG_UNIQUE_FN_EXT 0x7FFFFFFF

/* 
   Number of warnings that will be printed to error log
   before extension number is exhausted.
*/
#define LOG_WARN_UNIQUE_FN_EXT_LEFT 1000

class Relay_log_info;

/*
  Note that we destroy the lock mutex in the desctructor here.
  This means that object instances cannot be destroyed/go out of scope,
  until we have reset thd->current_linfo to NULL;
 */
typedef struct st_log_info
{
  char log_file_name[FN_REFLEN];
  my_off_t index_file_offset, index_file_start_offset;
  my_off_t pos;
  bool fatal; // if the purge happens to give us a negative offset
  st_log_info() : index_file_offset(0), index_file_start_offset(0),
      pos(0), fatal(0)
  {
    DBUG_ENTER("LOG_INFO");
    log_file_name[0] = '\0';
    DBUG_VOID_RETURN;
  }
} LOG_INFO;

/*
  Currently we have only 3 kinds of logging functions: old-fashioned
  logs, stdout and csv logging routines.
*/
#define MAX_LOG_HANDLERS_NUM 3

/* log event handler flags */
#define LOG_NONE       1U
#define LOG_FILE       2U
#define LOG_TABLE      4U

class Log_event;
class Rows_log_event;

enum enum_log_type { LOG_UNKNOWN, LOG_NORMAL, LOG_BIN };
enum enum_log_state { LOG_OPENED, LOG_CLOSED, LOG_TO_BE_OPENED };

/*
  Use larger buffers when reading from and to binary log
  We make it one step smaller than 64K to account for malloc overhead.
*/
#define LOG_BIN_IO_SIZE MY_ALIGN_DOWN(65536-1, IO_SIZE)

/*
  TODO use mmap instead of IO_CACHE for binlog
  (mmap+fsync is two times faster than write+fsync)
*/

class MYSQL_LOG
{
public:
  MYSQL_LOG();
  virtual ~MYSQL_LOG() = default;
  void init_pthread_objects();
  void cleanup();
  bool open(
#ifdef HAVE_PSI_INTERFACE
            PSI_file_key log_file_key,
#endif
            const char *log_name,
            enum_log_type log_type,
            const char *new_name, ulong next_file_number,
            enum cache_type io_cache_type_arg);
  void close(uint exiting);
  inline bool is_open() { return log_state != LOG_CLOSED; }
  const char *generate_name(const char *log_name,
                            const char *suffix,
                            bool strip_ext, char *buff);
  virtual int generate_new_name(char *new_name, const char *log_name,
                                ulong next_log_number);
 protected:
  /* LOCK_log is inited by init_pthread_objects() */
  mysql_mutex_t LOCK_log;
  char *name;
  char log_file_name[FN_REFLEN];
  char time_buff[20], db[NAME_LEN + 1];
  bool write_error, inited;
  IO_CACHE log_file;
  enum_log_type log_type;
  volatile enum_log_state log_state;
  enum cache_type io_cache_type;
  friend class Log_event;
#ifdef HAVE_PSI_INTERFACE
  /** Instrumentation key to use for file io in @c log_file */
  PSI_file_key m_log_file_key;
#endif

  bool init_and_set_log_file_name(const char *log_name,
                                  const char *new_name,
                                  ulong next_log_number,
                                  enum_log_type log_type_arg,
                                  enum cache_type io_cache_type_arg);
};

/* Tell the io thread if we can delay the master info sync. */
#define SEMI_SYNC_SLAVE_DELAY_SYNC 1
/* Tell the io thread if the current event needs a ack. */
#define SEMI_SYNC_NEED_ACK  2

class MYSQL_QUERY_LOG: public MYSQL_LOG
{
public:
  MYSQL_QUERY_LOG() : last_time(0) {}
  void reopen_file();
  bool write(time_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id,
             const char *command_type, size_t command_type_len,
             const char *sql_text, size_t sql_text_len);
  bool write(THD *thd, time_t current_time,
             const char *user_host, size_t user_host_len,
             ulonglong query_utime, ulonglong lock_utime, bool is_command,
             const char *sql_text, size_t sql_text_len);
  bool open_slow_log(const char *log_name)
  {
    char buf[FN_REFLEN];
    return open(
#ifdef HAVE_PSI_INTERFACE
                key_file_slow_log,
#endif
                generate_name(log_name, "-slow.log", 0, buf),
                LOG_NORMAL, 0, 0, WRITE_CACHE);
  }
  bool open_query_log(const char *log_name)
  {
    char buf[FN_REFLEN];
    return open(
#ifdef HAVE_PSI_INTERFACE
                key_file_query_log,
#endif
                generate_name(log_name, ".log", 0, buf),
                LOG_NORMAL, 0, 0, WRITE_CACHE);
  }

private:
  time_t last_time;
};

/*
  We assign each binlog file an internal ID, used to identify them for unlog().
  The IDs start from 0 and increment for each new binlog created.

  In unlog() we need to know the ID of the binlog file that the corresponding
  transaction was written into. We also need a special value for a corner
  case where there is no corresponding binlog id (since nothing was logged).
  And we need an error flag to mark that unlog() must return failure.

  We use the following macros to pack all of this information into the single
  ulong available with log_and_order() / unlog().

  Note that we cannot use the value 0 for cookie, as that is reserved as error
  return value from log_and_order().
  */
#define BINLOG_COOKIE_ERROR_RETURN 0
#define BINLOG_COOKIE_DUMMY_ID 1
#define BINLOG_COOKIE_BASE 2
#define BINLOG_COOKIE_DUMMY(error_flag) \
  ( (BINLOG_COOKIE_DUMMY_ID<<1) | ((error_flag)&1) )
#define BINLOG_COOKIE_MAKE(id, error_flag) \
  ( (((id)+BINLOG_COOKIE_BASE)<<1) | ((error_flag)&1) )
#define BINLOG_COOKIE_GET_ERROR_FLAG(c) ((c) & 1)
#define BINLOG_COOKIE_GET_ID(c) ( ((ulong)(c)>>1) - BINLOG_COOKIE_BASE )
#define BINLOG_COOKIE_IS_DUMMY(c) \
  ( ((ulong)(c)>>1) == BINLOG_COOKIE_DUMMY_ID )

class binlog_cache_mngr;
class binlog_cache_data;
struct rpl_gtid;
struct wait_for_commit;

class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
{
#ifdef HAVE_PSI_INTERFACE
  /** The instrumentation key to use for @ LOCK_index. */
  PSI_mutex_key m_key_LOCK_index;
  /** The instrumentation key to use for @ COND_relay_log_updated */
  PSI_cond_key m_key_relay_log_update;
  /** The instrumentation key to use for @ COND_bin_log_updated */
  PSI_cond_key m_key_bin_log_update;
  /** The instrumentation key to use for opening the log file. */
  PSI_file_key m_key_file_log, m_key_file_log_cache;
  /** The instrumentation key to use for opening the log index file. */
  PSI_file_key m_key_file_log_index, m_key_file_log_index_cache;

  PSI_cond_key m_key_COND_queue_busy;
  /** The instrumentation key to use for LOCK_binlog_end_pos. */
  PSI_mutex_key m_key_LOCK_binlog_end_pos;
#else
  static constexpr PSI_mutex_key m_key_LOCK_index= 0;
  static constexpr PSI_cond_key m_key_relay_log_update= 0;
  static constexpr PSI_cond_key m_key_bin_log_update= 0;
  static constexpr PSI_file_key m_key_file_log= 0, m_key_file_log_cache= 0;
  static constexpr PSI_file_key m_key_file_log_index= 0;
  static constexpr PSI_file_key m_key_file_log_index_cache= 0;
  static constexpr PSI_cond_key m_key_COND_queue_busy= 0;
  static constexpr PSI_mutex_key m_key_LOCK_binlog_end_pos= 0;
#endif

  struct group_commit_entry
  {
    struct group_commit_entry *next;
    THD *thd;
    binlog_cache_mngr *cache_mngr;
    bool using_stmt_cache;
    bool using_trx_cache;
    /*
      Extra events (COMMIT/ROLLBACK/XID, and possibly INCIDENT) to be
      written during group commit. The incident_event is only valid if
      trx_data->has_incident() is true.
    */
    Log_event *end_event;
    Log_event *incident_event;
    /* Set during group commit to record any per-thread error. */
    int error;
    int commit_errno;
    IO_CACHE *error_cache;
    /* This is the `all' parameter for ha_commit_ordered(). */
    bool all;
    /*
      True if we need to increment xid_count in trx_group_commit_leader() and
      decrement in unlog() (this is needed if there is a participating engine
      that does not implement the commit_checkpoint_request() handlerton
      method).
    */
    bool need_unlog;
    /*
      Fields used to pass the necessary information to the last thread in a
      group commit, only used when opt_optimize_thread_scheduling is not set.
    */
    bool check_purge;
    /* Flag used to optimise around wait_for_prior_commit. */
    bool queued_by_other;
    ulong binlog_id;
    bool ro_1pc;  // passes the binlog_cache_mngr::ro_1pc value to Gtid ctor
  };

  /*
    When this is set, a RESET MASTER is in progress.

    Then we should not write any binlog checkpoints into the binlog (that
    could result in deadlock on LOCK_log, and we will delete all binlog files
    anyway). Instead we should signal COND_xid_list whenever a new binlog
    checkpoint arrives - when all have arrived, RESET MASTER will complete.
  */
  uint reset_master_pending;
  ulong mark_xid_done_waiting;

  /* LOCK_log and LOCK_index are inited by init_pthread_objects() */
  mysql_mutex_t LOCK_index;
  mysql_mutex_t LOCK_binlog_end_pos;
  mysql_mutex_t LOCK_xid_list;
  mysql_cond_t  COND_xid_list;
  mysql_cond_t  COND_relay_log_updated, COND_bin_log_updated;
  ulonglong bytes_written;
  IO_CACHE index_file;
  char index_file_name[FN_REFLEN];
  /*
    purge_file is a temp file used in purge_logs so that the index file
    can be updated before deleting files from disk, yielding better crash
    recovery. It is created on demand the first time purge_logs is called
    and then reused for subsequent calls. It is cleaned up in cleanup().
  */
  IO_CACHE purge_index_file;
  char purge_index_file_name[FN_REFLEN];
  /*
     The max size before rotation (usable only if log_type == LOG_BIN: binary
     logs and relay logs).
     For a binlog, max_size should be max_binlog_size.
     max_size is set in init(), and dynamically changed (when one does SET
     GLOBAL MAX_BINLOG_SIZE|MAX_RELAY_LOG_SIZE) from sys_vars.cc
  */
  ulong max_size;
  /*
    Number generated by last call of find_uniq_filename(). Corresponds
    closely with current_binlog_id
  */
  ulong last_used_log_number;
  // current file sequence number for load data infile binary logging
  uint file_id;
  uint open_count;				// For replication
  int readers_count;
  /* Queue of transactions queued up to participate in group commit. */
  group_commit_entry *group_commit_queue;
  /*
    Condition variable to mark that the group commit queue is busy.
    Used when each thread does it's own commit_ordered() (when
    binlog_optimize_thread_scheduling=1).
    Used with the LOCK_commit_ordered mutex.
  */
  my_bool group_commit_queue_busy;
  mysql_cond_t COND_queue_busy;
  /* Total number of committed transactions. */
  ulonglong num_commits;
  /* Number of group commits done. */
  ulonglong num_group_commits;
  /* The reason why the group commit was grouped */
  ulonglong group_commit_trigger_count, group_commit_trigger_timeout;
  ulonglong group_commit_trigger_lock_wait;

  /* binlog encryption data */
  struct Binlog_crypt_data crypto;

  /* pointer to the sync period variable, for binlog this will be
     sync_binlog_period, for relay log this will be
     sync_relay_log_period
  */
  uint *sync_period_ptr;
  uint sync_counter;
  bool state_file_deleted;
  bool binlog_state_recover_done;

  inline uint get_sync_period()
  {
    return *sync_period_ptr;
  }

  int write_to_file(IO_CACHE *cache);
  /*
    This is used to start writing to a new log file. The difference from
    new_file() is locking. new_file_without_locking() does not acquire
    LOCK_log.
  */
  int new_file_without_locking();
  int new_file_impl();
  void do_checkpoint_request(ulong binlog_id);
  void purge();
  int write_transaction_or_stmt(group_commit_entry *entry, uint64 commit_id);
  int queue_for_group_commit(group_commit_entry *entry);
  bool write_transaction_to_binlog_events(group_commit_entry *entry);
  void trx_group_commit_leader(group_commit_entry *leader);
  bool is_xidlist_idle_nolock();
public:
  /*
    A list of struct xid_count_per_binlog is used to keep track of how many
    XIDs are in prepared, but not committed, state in each binlog. And how
    many commit_checkpoint_request()'s are pending.

    When count drops to zero in a binlog after rotation, it means that there
    are no more XIDs in prepared state, so that binlog is no longer needed
    for XA crash recovery, and we can log a new binlog checkpoint event.

    The list is protected against simultaneous access from multiple
    threads by LOCK_xid_list.
  */
  struct xid_count_per_binlog : public ilink {
    char *binlog_name;
    uint binlog_name_len;
    ulong binlog_id;
    /* Total prepared XIDs and pending checkpoint requests in this binlog. */
    long xid_count;
    long notify_count;
    /* For linking in requests to the binlog background thread. */
    xid_count_per_binlog *next_in_queue;
    xid_count_per_binlog(char *log_file_name, uint log_file_name_len)
      :binlog_id(0), xid_count(0), notify_count(0)
    {
      binlog_name_len= log_file_name_len;
      binlog_name= (char *) my_malloc(PSI_INSTRUMENT_ME, binlog_name_len, MYF(MY_ZEROFILL));
      if (binlog_name)
        memcpy(binlog_name, log_file_name, binlog_name_len);
    }
    ~xid_count_per_binlog()
    {
      my_free(binlog_name);
    }
  };
  I_List<xid_count_per_binlog> binlog_xid_count_list;
  mysql_mutex_t LOCK_binlog_background_thread;
  mysql_cond_t COND_binlog_background_thread;
  mysql_cond_t COND_binlog_background_thread_end;

  void stop_background_thread();

  using MYSQL_LOG::generate_name;
  using MYSQL_LOG::is_open;

  /* This is relay log */
  bool is_relay_log;
  ulong relay_signal_cnt;  // update of the counter is checked by heartbeat
  enum enum_binlog_checksum_alg checksum_alg_reset; // to contain a new value when binlog is rotated
  /*
    Holds the last seen in Relay-Log FD's checksum alg value.
    The initial value comes from the slave's local FD that heads
    the very first Relay-Log file. In the following the value may change
    with each received master's FD_m.
    Besides to be used in verification events that IO thread receives
    (except the 1st fake Rotate, see @c Master_info:: checksum_alg_before_fd), 
    the value specifies if/how to compute checksum for slave's local events
    and the first fake Rotate (R_f^1) coming from the master.
    R_f^1 needs logging checksum-compatibly with the RL's heading FD_s.

    Legends for the checksum related comments:

    FD     - Format-Description event,
    R      - Rotate event
    R_f    - the fake Rotate event
    E      - an arbirary event

    The underscore indexes for any event
    `_s'   indicates the event is generated by Slave
    `_m'   - by Master

    Two special underscore indexes of FD:
    FD_q   - Format Description event for queuing   (relay-logging)
    FD_e   - Format Description event for executing (relay-logging)

    Upper indexes:
    E^n    - n:th event is a sequence

    RL     - Relay Log
    (A)    - checksum algorithm descriptor value
    FD.(A) - the value of (A) in FD
  */
  enum enum_binlog_checksum_alg relay_log_checksum_alg;
  /*
    These describe the log's format. This is used only for relay logs.
    _for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
    necessary to have 2 distinct objects, because the I/O thread may be reading
    events in a different format from what the SQL thread is reading (consider
    the case of a master which has been upgraded from 5.0 to 5.1 without doing
    RESET MASTER, or from 4.x to 5.0).
  */
  Format_description_log_event *description_event_for_exec,
    *description_event_for_queue;
  /*
    Binlog position of last commit (or non-transactional write) to the binlog.
    Access to this is protected by LOCK_commit_ordered.
  */
  char last_commit_pos_file[FN_REFLEN];
  my_off_t last_commit_pos_offset;
  ulong current_binlog_id;

  /*
    Tracks the number of times that the master has been reset
  */
  Atomic_counter<uint64> reset_master_count;

  MYSQL_BIN_LOG(uint *sync_period);
  /*
    note that there's no destructor ~MYSQL_BIN_LOG() !
    The reason is that we don't want it to be automatically called
    on exit() - but only during the correct shutdown process
  */

#ifdef HAVE_PSI_INTERFACE
  void set_psi_keys(PSI_mutex_key key_LOCK_index,
                    PSI_cond_key key_relay_log_update,
                    PSI_cond_key key_bin_log_update,
                    PSI_file_key key_file_log,
                    PSI_file_key key_file_log_cache,
                    PSI_file_key key_file_log_index,
                    PSI_file_key key_file_log_index_cache,
                    PSI_cond_key key_COND_queue_busy,
                    PSI_mutex_key key_LOCK_binlog_end_pos)
  {
    m_key_LOCK_index= key_LOCK_index;
    m_key_relay_log_update=  key_relay_log_update;
    m_key_bin_log_update=    key_bin_log_update;
    m_key_file_log= key_file_log;
    m_key_file_log_cache= key_file_log_cache;
    m_key_file_log_index= key_file_log_index;
    m_key_file_log_index_cache= key_file_log_index_cache;
    m_key_COND_queue_busy= key_COND_queue_busy;
    m_key_LOCK_binlog_end_pos= key_LOCK_binlog_end_pos;
  }
#endif

  int open(const char *opt_name) override;
  void close() override;
  int generate_new_name(char *new_name, const char *log_name,
                        ulong next_log_number) override;
  int log_and_order(THD *thd, my_xid xid, bool all,
                    bool need_prepare_ordered, bool need_commit_ordered) override;
  int unlog(ulong cookie, my_xid xid) override;
  int unlog_xa_prepare(THD *thd, bool all) override;
  void commit_checkpoint_notify(void *cookie) override;
  int recover(LOG_INFO *linfo, const char *last_log_name, IO_CACHE *first_log,
              Format_description_log_event *fdle, bool do_xa);
  int do_binlog_recovery(const char *opt_name, bool do_xa_recovery);
#if !defined(MYSQL_CLIENT)

  int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event,
                                       bool is_transactional);
  int remove_pending_rows_event(THD *thd, bool is_transactional);

#endif /* !defined(MYSQL_CLIENT) */
  void reset_bytes_written()
  {
    bytes_written = 0;
  }
  void harvest_bytes_written(Atomic_counter<uint64> *counter)
  {
#ifdef DBUG_TRACE
    char buf1[22],buf2[22];
#endif
    DBUG_ENTER("harvest_bytes_written");
    (*counter)+=bytes_written;
    DBUG_PRINT("info",("counter: %s  bytes_written: %s", llstr(*counter,buf1),
		       llstr(bytes_written,buf2)));
    bytes_written=0;
    DBUG_VOID_RETURN;
  }
  void set_max_size(ulong max_size_arg);

  /* Handle signaling that relay has been updated */
  void signal_relay_log_update()
  {
    mysql_mutex_assert_owner(&LOCK_log);
    DBUG_ASSERT(is_relay_log);
    DBUG_ENTER("MYSQL_BIN_LOG::signal_relay_log_update");
    relay_signal_cnt++;
    mysql_cond_broadcast(&COND_relay_log_updated);
    DBUG_VOID_RETURN;
  }
  void signal_bin_log_update()
  {
    mysql_mutex_assert_owner(&LOCK_binlog_end_pos);
    DBUG_ASSERT(!is_relay_log);
    DBUG_ENTER("MYSQL_BIN_LOG::signal_bin_log_update");
    mysql_cond_broadcast(&COND_bin_log_updated);
    DBUG_VOID_RETURN;
  }
  void update_binlog_end_pos()
  {
    if (is_relay_log)
      signal_relay_log_update();
    else
    {
      lock_binlog_end_pos();
      binlog_end_pos= my_b_safe_tell(&log_file);
      signal_bin_log_update();
      unlock_binlog_end_pos();
    }
  }
  void update_binlog_end_pos(my_off_t pos)
  {
    mysql_mutex_assert_owner(&LOCK_log);
    mysql_mutex_assert_not_owner(&LOCK_binlog_end_pos);
    lock_binlog_end_pos();
    /*
      Note: it would make more sense to assert(pos > binlog_end_pos)
      but there are two places triggered by mtr that has pos == binlog_end_pos
      i didn't investigate but accepted as it should do no harm
    */
    DBUG_ASSERT(pos >= binlog_end_pos);
    binlog_end_pos= pos;
    signal_bin_log_update();
    unlock_binlog_end_pos();
  }

  void wait_for_sufficient_commits();
  void binlog_trigger_immediate_group_commit();
  void wait_for_update_relay_log(THD* thd);
  void init(ulong max_size);
  void init_pthread_objects();
  void cleanup();
  bool open(const char *log_name,
            const char *new_name,
            ulong next_log_number,
	    enum cache_type io_cache_type_arg,
	    ulong max_size,
            bool null_created,
            bool need_mutex);
  bool open_index_file(const char *index_file_name_arg,
                       const char *log_name, bool need_mutex);
  /* Use this to start writing a new log file */
  int new_file();

  bool write(Log_event* event_info,
             my_bool *with_annotate= 0); // binary log write
  bool write_transaction_to_binlog(THD *thd, binlog_cache_mngr *cache_mngr,
                                   Log_event *end_ev, bool all,
                                   bool using_stmt_cache, bool using_trx_cache,
                                   bool is_ro_1pc);

  bool write_incident_already_locked(THD *thd);
  bool write_incident(THD *thd);
  void write_binlog_checkpoint_event_already_locked(const char *name, uint len);
  int  write_cache(THD *thd, IO_CACHE *cache);
  void set_write_error(THD *thd, bool is_transactional);
  bool check_write_error(THD *thd);
  bool check_cache_error(THD *thd, binlog_cache_data *cache_data);

  void start_union_events(THD *thd, query_id_t query_id_param);
  void stop_union_events(THD *thd);
  bool is_query_in_union(THD *thd, query_id_t query_id_param);

  bool write_event(Log_event *ev, binlog_cache_data *data, IO_CACHE *file);
  bool write_event(Log_event *ev) { return write_event(ev, 0, &log_file); }

  bool write_event_buffer(uchar* buf,uint len);
  bool append(Log_event* ev);
  bool append_no_lock(Log_event* ev);

  void mark_xids_active(ulong cookie, uint xid_count);
  void mark_xid_done(ulong cookie, bool write_checkpoint);
  void make_log_name(char* buf, const char* log_ident);
  bool is_active(const char* log_file_name);
  bool can_purge_log(const char *log_file_name);
  int update_log_index(LOG_INFO* linfo, bool need_update_threads);
  int rotate(bool force_rotate, bool* check_purge);
  void checkpoint_and_purge(ulong binlog_id);
  int rotate_and_purge(bool force_rotate, DYNAMIC_ARRAY* drop_gtid_domain= NULL);
  /**
     Flush binlog cache and synchronize to disk.

     This function flushes events in binlog cache to binary log file,
     it will do synchronizing according to the setting of system
     variable 'sync_binlog'. If file is synchronized, @c synced will
     be set to 1, otherwise 0.

     @param[out] synced if not NULL, set to 1 if file is synchronized, otherwise 0

     @retval 0 Success
     @retval other Failure
  */
  bool flush_and_sync(bool *synced);
  int purge_logs(const char *to_log, bool included,
                 bool need_mutex, bool need_update_threads,
                 ulonglong *decrease_log_space);
  int purge_logs_before_date(time_t purge_time);
  int purge_first_log(Relay_log_info* rli, bool included);
  int set_purge_index_file_name(const char *base_file_name);
  int open_purge_index_file(bool destroy);
  bool truncate_and_remove_binlogs(const char *truncate_file,
                                   my_off_t truncate_pos,
                                   rpl_gtid *gtid);
  bool is_inited_purge_index_file();
  int close_purge_index_file();
  int clean_purge_index_file();
  int sync_purge_index_file();
  int register_purge_index_entry(const char* entry);
  int register_create_index_entry(const char* entry);
  int purge_index_entry(THD *thd, ulonglong *decrease_log_space,
                        bool need_mutex);
  bool reset_logs(THD* thd, bool create_new_log,
                  rpl_gtid *init_state, uint32 init_state_len,
                  ulong next_log_number);
  void wait_for_last_checkpoint_event();
  void close(uint exiting);
  void clear_inuse_flag_when_closing(File file);

  // iterating through the log index file
  int find_log_pos(LOG_INFO* linfo, const char* log_name,
		   bool need_mutex);
  int find_next_log(LOG_INFO* linfo, bool need_mutex);
  int get_current_log(LOG_INFO* linfo);
  int raw_get_current_log(LOG_INFO* linfo);
  uint next_file_id();
  inline char* get_index_fname() { return index_file_name;}
  inline char* get_log_fname() { return log_file_name; }
  inline char* get_name() { return name; }
  inline mysql_mutex_t* get_log_lock() { return &LOCK_log; }
  inline mysql_cond_t* get_bin_log_cond() { return &COND_bin_log_updated; }
  inline IO_CACHE* get_log_file() { return &log_file; }
  inline uint64 get_reset_master_count() { return reset_master_count; }

  inline void lock_index() { mysql_mutex_lock(&LOCK_index);}
  inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);}
  inline IO_CACHE *get_index_file() { return &index_file;}
  inline uint32 get_open_count() { return open_count; }
  void set_status_variables(THD *thd);
  bool is_xidlist_idle();
  bool write_gtid_event(THD *thd, bool standalone, bool is_transactional,
                        uint64 commit_id,
                        bool has_xid= false, bool ro_1pc= false);
  int read_state_from_file();
  int write_state_to_file();
  int get_most_recent_gtid_list(rpl_gtid **list, uint32 *size);
  bool append_state_pos(String *str);
  bool append_state(String *str);
  bool is_empty_state();
  bool find_in_binlog_state(uint32 domain_id, uint32 server_id,
                            rpl_gtid *out_gtid);
  bool lookup_domain_in_binlog_state(uint32 domain_id, rpl_gtid *out_gtid);
  int bump_seq_no_counter_if_needed(uint32 domain_id, uint64 seq_no);
  bool check_strict_gtid_sequence(uint32 domain_id, uint32 server_id,
                                  uint64 seq_no, bool no_error= false);

  /**
   * used when opening new file, and binlog_end_pos moves backwards
   */
  void reset_binlog_end_pos(const char file_name[FN_REFLEN], my_off_t pos)
  {
    mysql_mutex_assert_owner(&LOCK_log);
    mysql_mutex_assert_not_owner(&LOCK_binlog_end_pos);
    lock_binlog_end_pos();
    binlog_end_pos= pos;
    safe_strcpy(binlog_end_pos_file, sizeof(binlog_end_pos_file), file_name);
    signal_bin_log_update();
    unlock_binlog_end_pos();
  }

  /*
    It is called by the threads(e.g. dump thread) which want to read
    log without LOCK_log protection.
  */
  my_off_t get_binlog_end_pos(char file_name_buf[FN_REFLEN]) const
  {
    mysql_mutex_assert_not_owner(&LOCK_log);
    mysql_mutex_assert_owner(&LOCK_binlog_end_pos);
    safe_strcpy(file_name_buf, FN_REFLEN, binlog_end_pos_file);
    return binlog_end_pos;
  }
  void lock_binlog_end_pos() { mysql_mutex_lock(&LOCK_binlog_end_pos); }
  void unlock_binlog_end_pos() { mysql_mutex_unlock(&LOCK_binlog_end_pos); }
  mysql_mutex_t* get_binlog_end_pos_lock() { return &LOCK_binlog_end_pos; }

  /*
    Ensures the log's state is either LOG_OPEN or LOG_CLOSED. If something
    failed along the desired path and left the log in invalid state, i.e.
    LOG_TO_BE_OPENED, forces the state to be LOG_CLOSED.
  */
  void try_fix_log_state()
  {
    mysql_mutex_lock(get_log_lock());
    /* Only change the log state if it is LOG_TO_BE_OPENED */
    if (log_state == LOG_TO_BE_OPENED)
      log_state= LOG_CLOSED;
    mysql_mutex_unlock(get_log_lock());
  }

  int wait_for_update_binlog_end_pos(THD* thd, struct timespec * timeout);

  /*
    Binlog position of end of the binlog.
    Access to this is protected by LOCK_binlog_end_pos

    The difference between this and last_commit_pos_{file,offset} is that
    the commit position is updated later. If semi-sync wait point is set
    to WAIT_AFTER_SYNC, the commit pos is update after semi-sync-ack has
    been received and the end point is updated after the write as it's needed
    for the dump threads to be able to semi-sync the event.
  */
  my_off_t binlog_end_pos;
  char binlog_end_pos_file[FN_REFLEN];
};

class Log_event_handler
{
public:
  Log_event_handler() = default;
  virtual bool init()= 0;
  virtual void cleanup()= 0;

  virtual bool log_slow(THD *thd, my_hrtime_t current_time,
                        const char *user_host, size_t user_host_len, ulonglong query_utime,
                        ulonglong lock_utime, bool is_command,
                        const char *sql_text, size_t sql_text_len)= 0;
  virtual bool log_error(enum loglevel level, const char *format,
                         va_list args)= 0;
  virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id,
                           const char *command_type, size_t command_type_len,
                           const char *sql_text, size_t sql_text_len,
                           CHARSET_INFO *client_cs)= 0;
  virtual ~Log_event_handler() = default;
};


int check_if_log_table(const TABLE_LIST *table, bool check_if_opened,
                       const char *errmsg);

class Log_to_csv_event_handler: public Log_event_handler
{
  friend class LOGGER;

public:
  Log_to_csv_event_handler();
  ~Log_to_csv_event_handler();
  bool init() override;
  void cleanup() override;

  bool log_slow(THD *thd, my_hrtime_t current_time,
                        const char *user_host, size_t user_host_len, ulonglong query_utime,
                        ulonglong lock_utime, bool is_command,
                        const char *sql_text, size_t sql_text_len) override;
  bool log_error(enum loglevel level, const char *format,
                         va_list args) override;
  bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id,
                           const char *command_type, size_t command_type_len,
                           const char *sql_text, size_t sql_text_len,
                           CHARSET_INFO *client_cs) override;

  int activate_log(THD *thd, uint log_type);
};


/* type of the log table */
#define QUERY_LOG_SLOW 1
#define QUERY_LOG_GENERAL 2

class Log_to_file_event_handler: public Log_event_handler
{
  MYSQL_QUERY_LOG mysql_log;
  MYSQL_QUERY_LOG mysql_slow_log;
  bool is_initialized;
public:
  Log_to_file_event_handler(): is_initialized(FALSE)
  {}
  bool init() override;
  void cleanup() override;

  bool log_slow(THD *thd, my_hrtime_t current_time,
                        const char *user_host, size_t user_host_len, ulonglong query_utime,
                        ulonglong lock_utime, bool is_command,
                        const char *sql_text, size_t sql_text_len) override;
  bool log_error(enum loglevel level, const char *format,
                         va_list args) override;
  bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id,
                           const char *command_type, size_t command_type_len,
                           const char *sql_text, size_t sql_text_len,
                           CHARSET_INFO *client_cs) override;
  void flush();
  void init_pthread_objects();
  MYSQL_QUERY_LOG *get_mysql_slow_log() { return &mysql_slow_log; }
  MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; }
};


/* Class which manages slow, general and error log event handlers */
class LOGGER
{
  mysql_rwlock_t LOCK_logger;
  /* flag to check whether logger mutex is initialized */
  uint inited;

  /* available log handlers */
  Log_to_csv_event_handler *table_log_handler;
  Log_to_file_event_handler *file_log_handler;

  /* NULL-terminated arrays of log handlers */
  Log_event_handler *error_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];
  Log_event_handler *slow_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];
  Log_event_handler *general_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];

public:

  bool is_log_tables_initialized;

  LOGGER() : inited(0), table_log_handler(NULL),
             file_log_handler(NULL), is_log_tables_initialized(FALSE)
  {}
  void lock_shared() { mysql_rwlock_rdlock(&LOCK_logger); }
  void lock_exclusive() { mysql_rwlock_wrlock(&LOCK_logger); }
  void unlock() { mysql_rwlock_unlock(&LOCK_logger); }
  bool is_log_table_enabled(uint log_table_type);
  bool log_command(THD *thd, enum enum_server_command command);

  /*
    We want to initialize all log mutexes as soon as possible,
    but we cannot do it in constructor, as safe_mutex relies on
    initialization, performed by MY_INIT(). This why this is done in
    this function.
  */
  void init_base();
  void init_log_tables();
  bool flush_slow_log();
  bool flush_general_log();
  /* Perform basic logger cleanup. this will leave e.g. error log open. */
  void cleanup_base();
  /* Free memory. Nothing could be logged after this function is called */
  void cleanup_end();
  bool error_log_print(enum loglevel level, const char *format,
                      va_list args);
  bool slow_log_print(THD *thd, const char *query, size_t query_length,
                      ulonglong current_utime);
  bool general_log_print(THD *thd,enum enum_server_command command,
                         const char *format, va_list args);
  bool general_log_write(THD *thd, enum enum_server_command command,
                         const char *query, size_t query_length);

  /* we use this function to setup all enabled log event handlers */
  int set_handlers(ulonglong slow_log_printer,
                   ulonglong general_log_printer);
  void init_error_log(ulonglong error_log_printer);
  void init_slow_log(ulonglong slow_log_printer);
  void init_general_log(ulonglong general_log_printer);
  void deactivate_log_handler(THD* thd, uint log_type);
  bool activate_log_handler(THD* thd, uint log_type);
  MYSQL_QUERY_LOG *get_slow_log_file_handler() const
  { 
    if (file_log_handler)
      return file_log_handler->get_mysql_slow_log();
    return NULL;
  }
  MYSQL_QUERY_LOG *get_log_file_handler() const
  { 
    if (file_log_handler)
      return file_log_handler->get_mysql_log();
    return NULL;
  }
};

enum enum_binlog_format {
  BINLOG_FORMAT_MIXED= 0, ///< statement if safe, otherwise row - autodetected
  BINLOG_FORMAT_STMT=  1, ///< statement-based
  BINLOG_FORMAT_ROW=   2, ///< row-based
  BINLOG_FORMAT_UNSPEC=3  ///< thd_binlog_format() returns it when binlog is closed
};

int query_error_code(THD *thd, bool not_killed);
uint purge_log_get_error_code(int res);

int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
void sql_print_error(const char *format, ...);
void sql_print_warning(const char *format, ...);
void sql_print_information(const char *format, ...);
void sql_print_information_v(const char *format, va_list ap);
typedef void (*sql_print_message_func)(const char *format, ...);
extern sql_print_message_func sql_print_message_handlers[];

int error_log_print(enum loglevel level, const char *format,
                    va_list args);

bool slow_log_print(THD *thd, const char *query, uint query_length,
                    ulonglong current_utime);

bool general_log_print(THD *thd, enum enum_server_command command,
                       const char *format,...);

bool general_log_write(THD *thd, enum enum_server_command command,
                       const char *query, size_t query_length);

void binlog_report_wait_for(THD *thd, THD *other_thd);
void sql_perror(const char *message);
bool flush_error_log();

File open_binlog(IO_CACHE *log, const char *log_file_name,
                 const char **errmsg);

void make_default_log_name(char **out, const char* log_ext, bool once);
void binlog_reset_cache(THD *thd);
bool write_annotated_row(THD *thd);

extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
extern handlerton *binlog_hton;
extern LOGGER logger;

extern const char *log_bin_index;
extern const char *log_bin_basename;

/**
  Turns a relative log binary log path into a full path, based on the
  opt_bin_logname or opt_relay_logname.

  @param from         The log name we want to make into an absolute path.
  @param to           The buffer where to put the results of the 
                      normalization.
  @param is_relay_log Switch that makes is used inside to choose which
                      option (opt_bin_logname or opt_relay_logname) to
                      use when calculating the base path.

  @returns true if a problem occurs, false otherwise.
 */

inline bool normalize_binlog_name(char *to, const char *from, bool is_relay_log)
{
  DBUG_ENTER("normalize_binlog_name");
  bool error= false;
  char buff[FN_REFLEN];
  char *ptr= (char*) from;
  char *opt_name= is_relay_log ? opt_relay_logname : opt_bin_logname;

  DBUG_ASSERT(from);

  /* opt_name is not null and not empty and from is a relative path */
  if (opt_name && opt_name[0] && from && !test_if_hard_path(from))
  {
    // take the path from opt_name
    // take the filename from from 
    char log_dirpart[FN_REFLEN], log_dirname[FN_REFLEN];
    size_t log_dirpart_len, log_dirname_len;
    dirname_part(log_dirpart, opt_name, &log_dirpart_len);
    dirname_part(log_dirname, from, &log_dirname_len);

    /* log may be empty => relay-log or log-bin did not 
        hold paths, just filename pattern */
    if (log_dirpart_len > 0)
    {
      /* create the new path name */
      if(fn_format(buff, from+log_dirname_len, log_dirpart, "",
                   MYF(MY_UNPACK_FILENAME | MY_SAFE_PATH)) == NULL)
      {
        error= true;
        goto end;
      }

      ptr= buff;
    }
  }

  DBUG_ASSERT(ptr);

  if (ptr)
    strmake(to, ptr, strlen(ptr));

end:
  DBUG_RETURN(error);
}

static inline TC_LOG *get_tc_log_implementation()
{
  if (total_ha_2pc <= 1)
    return &tc_log_dummy;
  if (opt_bin_log)
    return &mysql_bin_log;
  return &tc_log_mmap;
}

#ifdef WITH_WSREP
IO_CACHE* wsrep_get_cache(THD *, bool);
bool wsrep_is_binlog_cache_empty(THD *);
void wsrep_thd_binlog_trx_reset(THD * thd);
void wsrep_thd_binlog_stmt_rollback(THD * thd);
#endif /* WITH_WSREP */

class Gtid_list_log_event;
const char *
get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list);

int binlog_commit(THD *thd, bool all, bool is_ro_1pc= false);
int binlog_commit_by_xid(handlerton *hton, XID *xid);
int binlog_rollback_by_xid(handlerton *hton, XID *xid);

#endif /* LOG_H */
server/private/transaction.h000064400000002672150400263760012234 0ustar00/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef TRANSACTION_H
#define TRANSACTION_H

#ifdef USE_PRAGMA_INTERFACE
#pragma interface                      /* gcc class implementation */
#endif

#include <m_string.h>

class THD;

void trans_track_end_trx(THD *thd);

bool trans_begin(THD *thd, uint flags= 0);
bool trans_commit(THD *thd);
bool trans_commit_implicit(THD *thd);
bool trans_rollback(THD *thd);
bool trans_rollback_implicit(THD *thd);

bool trans_commit_stmt(THD *thd);
bool trans_rollback_stmt(THD *thd);

bool trans_savepoint(THD *thd, LEX_CSTRING name);
bool trans_rollback_to_savepoint(THD *thd, LEX_CSTRING name);
bool trans_release_savepoint(THD *thd, LEX_CSTRING name);

void trans_reset_one_shot_chistics(THD *thd);

#endif /* TRANSACTION_H */
server/private/wsrep_binlog.h000064400000006561150400263760012402 0ustar00/* Copyright (C) 2013 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA. */

#ifndef WSREP_BINLOG_H
#define WSREP_BINLOG_H

#include "my_global.h"
#include "sql_class.h" // THD, IO_CACHE

#define HEAP_PAGE_SIZE 65536 /* 64K */
#define WSREP_MAX_WS_SIZE 2147483647 /* 2GB */

/*
  Write the contents of a cache to a memory buffer.

  This function quite the same as MYSQL_BIN_LOG::write_cache(),
  with the exception that here we write in buffer instead of log file.
 */
int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len);

/*
  Write the contents of a cache to wsrep provider.

  This function quite the same as MYSQL_BIN_LOG::write_cache(),
  with the exception that here we write in buffer instead of log file.

  @param len  total amount of data written
  @return     wsrep error status
 */
int  wsrep_write_cache(THD*      thd,
                       IO_CACHE* cache,
                       size_t*   len);

/* Dump replication buffer to disk */
void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len);

/* Dump replication buffer along with header to a file */
void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf,
                                    size_t buf_len);

/**
   Write a skip event into binlog.

   @param thd Thread object pointer
   @return Zero in case of success, non-zero on failure.
*/
int wsrep_write_skip_event(THD* thd);

/*
  Write dummy event into binlog in place of unused GTID.
  The binlog write is done in thd context.
*/
int wsrep_write_dummy_event_low(THD *thd, const char *msg);
/*
  Write dummy event to binlog in place of unused GTID and
  commit. The binlog write and commit are done in temporary
  thd context, the original thd state is not altered.
*/
int wsrep_write_dummy_event(THD* thd, const char *msg);

void wsrep_register_binlog_handler(THD *thd, bool trx);

/**
   Return true if committing THD will write to binlog during commit.
   This is the case for:
   - Local THD, binlog is open
   - Replaying THD, binlog is open
   - Applier THD, log-slave-updates is enabled
*/
bool wsrep_commit_will_write_binlog(THD *thd);

/**
   Register THD for group commit. The wsrep_trx must be in committing state,
   i.e. the call must be done after wsrep_before_commit() but before
   commit order is released.

   This call will release commit order critical section if it is
   determined that the commit will go through binlog group commit.
 */
void wsrep_register_for_group_commit(THD *thd);

/**
   Deregister THD from group commit. The wsrep_trx must be in committing state,
   as for wsrep_register_for_group_commit() above.

   This call must be used only for THDs which will not go through
   binlog group commit.
*/
void wsrep_unregister_from_group_commit(THD *thd);

#endif /* WSREP_BINLOG_H */
server/private/mysqld.h000064400000117066150400263770011225 0ustar00/* Copyright (c) 2006, 2016, Oracle and/or its affiliates.
   Copyright (c) 2010, 2020, 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 */

#ifndef MYSQLD_INCLUDED
#define MYSQLD_INCLUDED

#include "sql_basic_types.h"			/* query_id_t */
#include "sql_mode.h"                           /* Sql_mode_dependency */
#include "sql_plugin.h"
#include "sql_bitmap.h"                         /* Bitmap */
#include "my_decimal.h"                         /* my_decimal */
#include "mysql_com.h"                     /* SERVER_VERSION_LENGTH */
#include "my_counter.h"
#include "mysql/psi/mysql_file.h"          /* MYSQL_FILE */
#include "mysql/psi/mysql_socket.h"        /* MYSQL_SOCKET */
#include "sql_list.h"                      /* I_List */
#include "sql_cmd.h"
#include <my_rnd.h>
#include "my_pthread.h"
#include "my_rdtsc.h"

class THD;
class CONNECT;
struct handlerton;
class Time_zone;

struct scheduler_functions;

typedef struct st_mysql_show_var SHOW_VAR;

/* Bits from testflag */
#define TEST_PRINT_CACHED_TABLES 1U
#define TEST_NO_KEY_GROUP	 2U
#define TEST_MIT_THREAD		4U
#define TEST_BLOCKING		8U
#define TEST_KEEP_TMP_TABLES	16U
#define TEST_READCHECK		64U	/**< Force use of readcheck */
#define TEST_NO_EXTRA		128U
#define TEST_CORE_ON_SIGNAL	256U	/**< Give core if signal */
#define TEST_SIGINT		1024U	/**< Allow sigint on threads */
#define TEST_SYNCHRONIZATION    2048U   /**< get server to do sleep in
                                           some places */

/* Keep things compatible */
#define OPT_DEFAULT SHOW_OPT_DEFAULT
#define OPT_SESSION SHOW_OPT_SESSION
#define OPT_GLOBAL SHOW_OPT_GLOBAL

extern MYSQL_PLUGIN_IMPORT MY_TIMER_INFO sys_timer_info;

/*
  Values for --slave-parallel-mode
  Must match order in slave_parallel_mode_typelib in sys_vars.cc.
*/
enum enum_slave_parallel_mode {
  SLAVE_PARALLEL_NONE,
  SLAVE_PARALLEL_MINIMAL,
  SLAVE_PARALLEL_CONSERVATIVE,
  SLAVE_PARALLEL_OPTIMISTIC,
  SLAVE_PARALLEL_AGGRESSIVE
};

/* Function prototypes */
void kill_mysql(THD *thd);
void close_connection(THD *thd, uint sql_errno= 0);
void handle_connection_in_main_thread(CONNECT *thd);
void create_thread_to_handle_connection(CONNECT *connect);
void unlink_thd(THD *thd);
void refresh_status(THD *thd);
bool is_secure_file_path(char *path);
extern void init_net_server_extension(THD *thd);
extern void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock);
extern void create_new_thread(CONNECT *connect);

extern void ssl_acceptor_stats_update(int sslaccept_ret);
extern int reinit_ssl();

extern "C" MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;

/**
  Character set of the buildin error messages loaded from errmsg.sys.
*/
extern CHARSET_INFO *error_message_charset_info;

extern CHARSET_INFO *character_set_filesystem;

extern MY_BITMAP temp_pool;
extern bool opt_large_files;
extern bool opt_update_log, opt_bin_log, opt_error_log, opt_bin_log_compress; 
extern uint opt_bin_log_compress_min_len;
extern my_bool opt_log, opt_bootstrap;
extern my_bool opt_backup_history_log;
extern my_bool opt_backup_progress_log;
extern my_bool opt_support_flashback;
extern ulonglong log_output_options;
extern ulong log_backup_output_options;
extern bool opt_disable_networking, opt_skip_show_db;
extern bool opt_skip_name_resolve;
extern bool opt_ignore_builtin_innodb;
extern my_bool opt_character_set_client_handshake;
extern my_bool debug_assert_on_not_freed_memory;
extern MYSQL_PLUGIN_IMPORT bool volatile abort_loop;
extern my_bool opt_safe_user_create;
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern ulong slave_exec_mode_options, slave_ddl_exec_mode_options;
extern ulong slave_retried_transactions;
extern ulong transactions_multi_engine;
extern ulong rpl_transactions_multi_engine;
extern ulong transactions_gtid_foreign_engine;
extern ulong slave_run_triggers_for_rbr;
extern ulonglong slave_type_conversions_options;
extern my_bool read_only, opt_readonly;
extern MYSQL_PLUGIN_IMPORT my_bool lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth;
extern my_bool opt_require_secure_transport;
extern const char *current_dbug_option;
extern char* opt_secure_file_priv;
extern char* opt_secure_backup_file_priv;
extern size_t opt_secure_backup_file_priv_len;
extern my_bool sp_automatic_privileges, opt_noacl;
extern ulong use_stat_tables;
extern my_bool opt_old_style_user_limits, trust_function_creators;
extern uint opt_crash_binlog_innodb;
extern const char *shared_memory_base_name;
extern MYSQL_PLUGIN_IMPORT char *mysqld_unix_port;
extern my_bool opt_enable_shared_memory;
extern ulong opt_replicate_events_marked_for_skip;
extern char *default_tz_name;
extern Time_zone *default_tz;
extern char *my_bind_addr_str;
extern char *default_storage_engine, *default_tmp_storage_engine;
extern char *enforced_storage_engine;
extern char *gtid_pos_auto_engines;
extern plugin_ref *opt_gtid_pos_auto_plugins;
extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
extern bool opt_using_transactions;
extern ulong current_pid;
extern double expire_logs_days;
extern ulong binlog_expire_logs_seconds;
extern my_bool relay_log_recovery;

#include <governor-mysql/lve-patch/main.h>

extern uint sync_binlog_period, sync_relaylog_period, 
            sync_relayloginfo_period, sync_masterinfo_period;
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
extern ulong tc_log_page_waits;
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
extern my_bool relay_log_recovery;
extern uint select_errors,ha_open_options;
extern ulonglong test_flags;
extern uint protocol_version, dropping_tables;
extern MYSQL_PLUGIN_IMPORT uint mysqld_port;
extern ulong delay_key_write_options;
extern char *opt_logname, *opt_slow_logname, *opt_bin_logname, 
            *opt_relay_logname;
extern char *opt_binlog_index_name;
extern char *opt_backup_history_logname, *opt_backup_progress_logname,
            *opt_backup_settings_name;
extern const char *log_output_str;
extern const char *log_backup_output_str;

/* System Versioning begin */
enum vers_system_time_t
{
  SYSTEM_TIME_UNSPECIFIED = 0,
  SYSTEM_TIME_AS_OF,
  SYSTEM_TIME_FROM_TO,
  SYSTEM_TIME_BETWEEN,
  SYSTEM_TIME_BEFORE,  // used for DELETE HISTORY ... BEFORE
  SYSTEM_TIME_HISTORY, // used for DELETE HISTORY
  SYSTEM_TIME_ALL
};

struct vers_asof_timestamp_t
{
  ulong type;
  my_time_t unix_time;
  ulong second_part;
};

enum vers_alter_history_enum
{
  VERS_ALTER_HISTORY_ERROR= 0,
  VERS_ALTER_HISTORY_KEEP
};
/* System Versioning end */

extern char *mysql_home_ptr, *pidfile_name_ptr;
extern MYSQL_PLUGIN_IMPORT char glob_hostname[FN_REFLEN];
extern char mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
extern char default_logfile_name[FN_REFLEN];
extern char log_error_file[FN_REFLEN], *opt_tc_log_file, *opt_ddl_recovery_file;
extern const double log_10[309];
extern ulonglong keybuff_size;
extern ulonglong thd_startup_options;
extern my_thread_id global_thread_id;
extern ulong binlog_cache_use, binlog_cache_disk_use;
extern ulong binlog_stmt_cache_use, binlog_stmt_cache_disk_use;
extern ulong aborted_threads, aborted_connects, aborted_connects_preauth;
extern ulong delayed_insert_timeout;
extern ulong delayed_insert_limit, delayed_queue_size;
extern ulong delayed_insert_threads, delayed_insert_writes;
extern ulong delayed_rows_in_use,delayed_insert_errors;
extern Atomic_counter<uint32_t> slave_open_temp_tables;
extern ulonglong query_cache_size;
extern ulong query_cache_limit;
extern ulong query_cache_min_res_unit;
extern ulong slow_launch_threads, slow_launch_time;
extern MYSQL_PLUGIN_IMPORT ulong max_connections;
extern uint max_digest_length;
extern ulong max_connect_errors, connect_timeout;
extern uint max_password_errors;
extern my_bool slave_allow_batching;
extern my_bool allow_slave_start;
extern LEX_CSTRING reason_slave_blocked;
extern ulong slave_trans_retries;
extern ulong slave_trans_retry_interval;
extern uint  slave_net_timeout;
extern int max_user_connections;
extern ulong what_to_log,flush_time;
extern uint max_prepared_stmt_count, prepared_stmt_count;
extern MYSQL_PLUGIN_IMPORT ulong open_files_limit;
extern ulonglong binlog_cache_size, binlog_stmt_cache_size, binlog_file_cache_size;
extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
extern ulong max_binlog_size;
extern ulong slave_max_allowed_packet;
extern ulong opt_binlog_rows_event_max_size;
extern ulong binlog_row_metadata;
extern ulong thread_cache_size;
extern ulong stored_program_cache_size;
extern ulong opt_slave_parallel_threads;
extern ulong opt_slave_domain_parallel_threads;
extern ulong opt_slave_parallel_max_queued;
extern ulong opt_slave_parallel_mode;
extern ulong opt_binlog_commit_wait_count;
extern ulong opt_binlog_commit_wait_usec;
extern my_bool opt_gtid_ignore_duplicates;
extern uint opt_gtid_cleanup_batch_size;
extern ulong back_log;
extern ulong executed_events;
extern char language[FN_REFLEN];
extern "C" MYSQL_PLUGIN_IMPORT ulong server_id;
extern ulong concurrency;
extern time_t server_start_time, flush_status_time;
extern char *opt_mysql_tmpdir, mysql_charsets_dir[];
extern size_t mysql_unpacked_real_data_home_len;
extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
extern const char *first_keyword, *delayed_user, *slave_user;
extern MYSQL_PLUGIN_IMPORT const char  *my_localhost;
extern MYSQL_PLUGIN_IMPORT const char **errmesg;			/* Error messages */
extern const char *myisam_recover_options_str;
extern const LEX_CSTRING in_left_expr_name, in_additional_cond, in_having_cond;
extern const LEX_CSTRING NULL_clex_str;
extern const LEX_CSTRING error_clex_str;
extern SHOW_VAR status_vars[];
extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
extern struct my_rnd_struct sql_rand;
extern const char *opt_date_time_formats[];
extern handlerton *partition_hton;
extern handlerton *myisam_hton;
extern handlerton *heap_hton;
extern const char *load_default_groups[];
extern struct my_option my_long_options[];
int handle_early_options();
extern int MYSQL_PLUGIN_IMPORT mysqld_server_started;
extern int mysqld_server_initialized;
extern "C" MYSQL_PLUGIN_IMPORT int orig_argc;
extern "C" MYSQL_PLUGIN_IMPORT char **orig_argv;
extern pthread_attr_t connection_attrib;
extern my_bool old_mode;
extern LEX_STRING opt_init_connect, opt_init_slave;
extern char err_shared_dir[];
extern ulong connection_errors_select;
extern ulong connection_errors_accept;
extern ulong connection_errors_tcpwrap;
extern ulong connection_errors_internal;
extern ulong connection_errors_max_connection;
extern ulong connection_errors_peer_addr;
extern ulong log_warnings;
extern my_bool encrypt_binlog;
extern my_bool encrypt_tmp_disk_tables, encrypt_tmp_files;
extern ulong encryption_algorithm;
extern const char *encryption_algorithm_names[];
extern long opt_secure_timestamp;
extern uint default_password_lifetime;
extern my_bool disconnect_on_expired_password;

enum secure_timestamp { SECTIME_NO, SECTIME_SUPER, SECTIME_REPL, SECTIME_YES };

#ifdef HAVE_MMAP
extern PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active,
       key_LOCK_pool, key_LOCK_pending_checkpoint;
#endif /* HAVE_MMAP */

extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list,
  key_BINLOG_LOCK_binlog_background_thread,
  key_LOCK_binlog_end_pos,
  key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi,
  key_LOCK_crypt, key_LOCK_delayed_create,
  key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
  key_LOCK_gdl, key_LOCK_global_system_variables,
  key_LOCK_logger, key_LOCK_manager,
  key_LOCK_prepared_stmt_count,
  key_LOCK_rpl_status, key_LOCK_server_started,
  key_LOCK_status,
  key_LOCK_thd_data, key_LOCK_thd_kill,
  key_LOCK_user_conn, key_LOG_LOCK_log,
  key_master_info_data_lock, key_master_info_run_lock,
  key_master_info_sleep_lock, key_master_info_start_stop_lock,
  key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock,
  key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
  key_rpl_group_info_sleep_lock,
  key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
  key_TABLE_SHARE_LOCK_statistics,
  key_LOCK_start_thread,
  key_LOCK_error_messages,
  key_PARTITION_LOCK_auto_inc;
extern PSI_mutex_key key_RELAYLOG_LOCK_index;
extern PSI_mutex_key key_LOCK_relaylog_end_pos;
extern PSI_mutex_key key_LOCK_slave_state, key_LOCK_binlog_state,
  key_LOCK_rpl_thread, key_LOCK_rpl_thread_pool, key_LOCK_parallel_entry;

extern PSI_mutex_key key_TABLE_SHARE_LOCK_share, key_LOCK_stats,
  key_LOCK_global_user_client_stats, key_LOCK_global_table_stats,
  key_LOCK_global_index_stats, key_LOCK_wakeup_ready, key_LOCK_wait_commit,
  key_TABLE_SHARE_LOCK_rotation;
extern PSI_mutex_key key_LOCK_gtid_waiting;

extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
  key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
  key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,
  key_LOCK_SEQUENCE,
  key_rwlock_LOCK_vers_stats, key_rwlock_LOCK_stat_serial,
  key_rwlock_THD_list;

#ifdef HAVE_MMAP
extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
#endif /* HAVE_MMAP */

extern PSI_cond_key key_BINLOG_COND_xid_list, key_BINLOG_update_cond,
  key_BINLOG_COND_binlog_background_thread,
  key_BINLOG_COND_binlog_background_thread_end,
  key_COND_cache_status_changed, key_COND_manager,
  key_COND_rpl_status, key_COND_server_started,
  key_delayed_insert_cond, key_delayed_insert_cond_client,
  key_item_func_sleep_cond, key_master_info_data_cond,
  key_master_info_start_cond, key_master_info_stop_cond,
  key_master_info_sleep_cond,
  key_relay_log_info_data_cond, key_relay_log_info_log_space_cond,
  key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
  key_rpl_group_info_sleep_cond,
  key_TABLE_SHARE_cond, key_user_level_lock_cond,
  key_COND_start_thread;
extern PSI_cond_key key_RELAYLOG_COND_relay_log_updated,
  key_RELAYLOG_COND_bin_log_updated, key_COND_wakeup_ready,
  key_COND_wait_commit;
extern PSI_cond_key key_RELAYLOG_COND_queue_busy;
extern PSI_cond_key key_TC_LOG_MMAP_COND_queue_busy;
extern PSI_cond_key key_COND_rpl_thread, key_COND_rpl_thread_queue,
  key_COND_rpl_thread_stop, key_COND_rpl_thread_pool,
  key_COND_parallel_entry, key_COND_group_commit_orderer;
extern PSI_cond_key key_COND_wait_gtid, key_COND_gtid_ignore_duplicates;
extern PSI_cond_key key_TABLE_SHARE_COND_rotation;

extern PSI_thread_key key_thread_delayed_insert,
  key_thread_handle_manager, key_thread_kill_server, key_thread_main,
  key_thread_one_connection, key_thread_signal_hand,
  key_thread_slave_background, key_rpl_parallel_thread;

extern PSI_file_key key_file_binlog, key_file_binlog_cache,
       key_file_binlog_index, key_file_binlog_index_cache, key_file_casetest,
  key_file_dbopt, key_file_ERRMSG, key_select_to_file,
  key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
  key_file_loadfile, key_file_log_event_data, key_file_log_event_info,
  key_file_master_info, key_file_misc, key_file_partition_ddl_log,
  key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
  key_file_trg, key_file_trn, key_file_init, key_file_log_ddl;
extern PSI_file_key key_file_query_log, key_file_slow_log;
extern PSI_file_key key_file_relaylog, key_file_relaylog_index,
                    key_file_relaylog_cache, key_file_relaylog_index_cache;
extern PSI_socket_key key_socket_tcpip, key_socket_unix,
  key_socket_client_connection;
extern PSI_file_key key_file_binlog_state;

#ifdef HAVE_des
extern char* des_key_file;
extern PSI_file_key key_file_des_key_file;
extern PSI_mutex_key key_LOCK_des_key_file;
extern mysql_mutex_t LOCK_des_key_file;
#endif

#ifdef HAVE_PSI_INTERFACE
void init_server_psi_keys();
#endif /* HAVE_PSI_INTERFACE */

extern PSI_memory_key key_memory_locked_table_list;
extern PSI_memory_key key_memory_locked_thread_list;
extern PSI_memory_key key_memory_thd_transactions;
extern PSI_memory_key key_memory_delegate;
extern PSI_memory_key key_memory_acl_mem;
extern PSI_memory_key key_memory_acl_memex;
extern PSI_memory_key key_memory_acl_cache;
extern PSI_memory_key key_memory_thd_main_mem_root;
extern PSI_memory_key key_memory_help;
extern PSI_memory_key key_memory_frm;
extern PSI_memory_key key_memory_table_share;
extern PSI_memory_key key_memory_gdl;
extern PSI_memory_key key_memory_table_triggers_list;
extern PSI_memory_key key_memory_prepared_statement_map;
extern PSI_memory_key key_memory_prepared_statement_main_mem_root;
extern PSI_memory_key key_memory_protocol_rset_root;
extern PSI_memory_key key_memory_warning_info_warn_root;
extern PSI_memory_key key_memory_sp_cache;
extern PSI_memory_key key_memory_sp_head_main_root;
extern PSI_memory_key key_memory_sp_head_execute_root;
extern PSI_memory_key key_memory_sp_head_call_root;
extern PSI_memory_key key_memory_table_mapping_root;
extern PSI_memory_key key_memory_quick_range_select_root;
extern PSI_memory_key key_memory_quick_index_merge_root;
extern PSI_memory_key key_memory_quick_ror_intersect_select_root;
extern PSI_memory_key key_memory_quick_ror_union_select_root;
extern PSI_memory_key key_memory_quick_group_min_max_select_root;
extern PSI_memory_key key_memory_test_quick_select_exec;
extern PSI_memory_key key_memory_prune_partitions_exec;
extern PSI_memory_key key_memory_binlog_recover_exec;
extern PSI_memory_key key_memory_blob_mem_storage;

extern PSI_memory_key key_memory_Sys_var_charptr_value;
extern PSI_memory_key key_memory_THD_db;
extern PSI_memory_key key_memory_user_var_entry;
extern PSI_memory_key key_memory_user_var_entry_value;
extern PSI_memory_key key_memory_Slave_job_group_group_relay_log_name;
extern PSI_memory_key key_memory_Relay_log_info_group_relay_log_name;
extern PSI_memory_key key_memory_binlog_cache_mngr;
extern PSI_memory_key key_memory_Row_data_memory_memory;
extern PSI_memory_key key_memory_errmsgs;
extern PSI_memory_key key_memory_Event_queue_element_for_exec_names;
extern PSI_memory_key key_memory_Event_scheduler_scheduler_param;
extern PSI_memory_key key_memory_Gis_read_stream_err_msg;
extern PSI_memory_key key_memory_Geometry_objects_data;
extern PSI_memory_key key_memory_host_cache_hostname;
extern PSI_memory_key key_memory_User_level_lock;
extern PSI_memory_key key_memory_Filesort_info_record_pointers;
extern PSI_memory_key key_memory_Sort_param_tmp_buffer;
extern PSI_memory_key key_memory_Filesort_info_merge;
extern PSI_memory_key key_memory_Filesort_buffer_sort_keys;
extern PSI_memory_key key_memory_handler_errmsgs;
extern PSI_memory_key key_memory_handlerton;
extern PSI_memory_key key_memory_XID;
extern PSI_memory_key key_memory_MYSQL_LOCK;
extern PSI_memory_key key_memory_MYSQL_LOG_name;
extern PSI_memory_key key_memory_TC_LOG_MMAP_pages;
extern PSI_memory_key key_memory_my_str_malloc;
extern PSI_memory_key key_memory_MYSQL_BIN_LOG_basename;
extern PSI_memory_key key_memory_MYSQL_BIN_LOG_index;
extern PSI_memory_key key_memory_MYSQL_RELAY_LOG_basename;
extern PSI_memory_key key_memory_MYSQL_RELAY_LOG_index;
extern PSI_memory_key key_memory_rpl_filter;
extern PSI_memory_key key_memory_Security_context;
extern PSI_memory_key key_memory_NET_buff;
extern PSI_memory_key key_memory_NET_compress_packet;
extern PSI_memory_key key_memory_my_bitmap_map;
extern PSI_memory_key key_memory_QUICK_RANGE_SELECT_mrr_buf_desc;
extern PSI_memory_key key_memory_TABLE_RULE_ENT;
extern PSI_memory_key key_memory_Mutex_cond_array_Mutex_cond;
extern PSI_memory_key key_memory_Owned_gtids_sidno_to_hash;
extern PSI_memory_key key_memory_Sid_map_Node;
extern PSI_memory_key key_memory_bison_stack;
extern PSI_memory_key key_memory_TABLE_sort_io_cache;
extern PSI_memory_key key_memory_DATE_TIME_FORMAT;
extern PSI_memory_key key_memory_DDL_LOG_MEMORY_ENTRY;
extern PSI_memory_key key_memory_ST_SCHEMA_TABLE;
extern PSI_memory_key key_memory_ignored_db;
extern PSI_memory_key key_memory_SLAVE_INFO;
extern PSI_memory_key key_memory_log_event_old;
extern PSI_memory_key key_memory_HASH_ROW_ENTRY;
extern PSI_memory_key key_memory_table_def_memory;
extern PSI_memory_key key_memory_MPVIO_EXT_auth_info;
extern PSI_memory_key key_memory_LOG_POS_COORD;
extern PSI_memory_key key_memory_XID_STATE;
extern PSI_memory_key key_memory_Rpl_info_file_buffer;
extern PSI_memory_key key_memory_Rpl_info_table;
extern PSI_memory_key key_memory_binlog_pos;
extern PSI_memory_key key_memory_db_worker_hash_entry;
extern PSI_memory_key key_memory_rpl_slave_command_buffer;
extern PSI_memory_key key_memory_binlog_ver_1_event;
extern PSI_memory_key key_memory_rpl_slave_check_temp_dir;
extern PSI_memory_key key_memory_TABLE;
extern PSI_memory_key key_memory_binlog_statement_buffer;
extern PSI_memory_key key_memory_user_conn;
extern PSI_memory_key key_memory_dboptions_hash;
extern PSI_memory_key key_memory_dbnames_cache;
extern PSI_memory_key key_memory_hash_index_key_buffer;
extern PSI_memory_key key_memory_THD_handler_tables_hash;
extern PSI_memory_key key_memory_JOIN_CACHE;
extern PSI_memory_key key_memory_READ_INFO;
extern PSI_memory_key key_memory_partition_syntax_buffer;
extern PSI_memory_key key_memory_global_system_variables;
extern PSI_memory_key key_memory_THD_variables;
extern PSI_memory_key key_memory_PROFILE;
extern PSI_memory_key key_memory_LOG_name;
extern PSI_memory_key key_memory_string_iterator;
extern PSI_memory_key key_memory_frm_extra_segment_buff;
extern PSI_memory_key key_memory_frm_form_pos;
extern PSI_memory_key key_memory_frm_string;
extern PSI_memory_key key_memory_Unique_sort_buffer;
extern PSI_memory_key key_memory_Unique_merge_buffer;
extern PSI_memory_key key_memory_shared_memory_name;
extern PSI_memory_key key_memory_opt_bin_logname;
extern PSI_memory_key key_memory_Query_cache;
extern PSI_memory_key key_memory_READ_RECORD_cache;
extern PSI_memory_key key_memory_Quick_ranges;
extern PSI_memory_key key_memory_File_query_log_name;
extern PSI_memory_key key_memory_Table_trigger_dispatcher;
extern PSI_memory_key key_memory_show_slave_status_io_gtid_set;
extern PSI_memory_key key_memory_write_set_extraction;
extern PSI_memory_key key_memory_thd_timer;
extern PSI_memory_key key_memory_THD_Session_tracker;
extern PSI_memory_key key_memory_THD_Session_sysvar_resource_manager;
extern PSI_memory_key key_memory_get_all_tables;
extern PSI_memory_key key_memory_fill_schema_schemata;
extern PSI_memory_key key_memory_native_functions;
extern PSI_memory_key key_memory_JSON;
extern PSI_memory_key key_memory_WSREP;

/*
  MAINTAINER: Please keep this list in order, to limit merge collisions.
  Hint: grep PSI_stage_info | sort -u
*/
extern PSI_stage_info stage_apply_event;
extern PSI_stage_info stage_after_create;
extern PSI_stage_info stage_after_opening_tables;
extern PSI_stage_info stage_after_table_lock;
extern PSI_stage_info stage_allocating_local_table;
extern PSI_stage_info stage_alter_inplace_prepare;
extern PSI_stage_info stage_alter_inplace;
extern PSI_stage_info stage_alter_inplace_commit;
extern PSI_stage_info stage_after_apply_event;
extern PSI_stage_info stage_changing_master;
extern PSI_stage_info stage_checking_master_version;
extern PSI_stage_info stage_checking_permissions;
extern PSI_stage_info stage_checking_privileges_on_cached_query;
extern PSI_stage_info stage_checking_query_cache_for_query;
extern PSI_stage_info stage_cleaning_up;
extern PSI_stage_info stage_closing_tables;
extern PSI_stage_info stage_connecting_to_master;
extern PSI_stage_info stage_converting_heap_to_myisam;
extern PSI_stage_info stage_copying_to_group_table;
extern PSI_stage_info stage_copying_to_tmp_table;
extern PSI_stage_info stage_copy_to_tmp_table;
extern PSI_stage_info stage_creating_delayed_handler;
extern PSI_stage_info stage_creating_sort_index;
extern PSI_stage_info stage_creating_table;
extern PSI_stage_info stage_creating_tmp_table;
extern PSI_stage_info stage_deleting_from_main_table;
extern PSI_stage_info stage_deleting_from_reference_tables;
extern PSI_stage_info stage_discard_or_import_tablespace;
extern PSI_stage_info stage_end;
extern PSI_stage_info stage_enabling_keys;
extern PSI_stage_info stage_executing;
extern PSI_stage_info stage_execution_of_init_command;
extern PSI_stage_info stage_explaining;
extern PSI_stage_info stage_finding_key_cache;
extern PSI_stage_info stage_finished_reading_one_binlog_switching_to_next_binlog;
extern PSI_stage_info stage_flushing_relay_log_and_master_info_repository;
extern PSI_stage_info stage_flushing_relay_log_info_file;
extern PSI_stage_info stage_freeing_items;
extern PSI_stage_info stage_fulltext_initialization;
extern PSI_stage_info stage_got_handler_lock;
extern PSI_stage_info stage_got_old_table;
extern PSI_stage_info stage_init;
extern PSI_stage_info stage_init_update;
extern PSI_stage_info stage_insert;
extern PSI_stage_info stage_invalidating_query_cache_entries_table;
extern PSI_stage_info stage_invalidating_query_cache_entries_table_list;
extern PSI_stage_info stage_killing_slave;
extern PSI_stage_info stage_logging_slow_query;
extern PSI_stage_info stage_making_temp_file_append_before_load_data;
extern PSI_stage_info stage_making_temp_file_create_before_load_data;
extern PSI_stage_info stage_manage_keys;
extern PSI_stage_info stage_master_has_sent_all_binlog_to_slave;
extern PSI_stage_info stage_opening_tables;
extern PSI_stage_info stage_optimizing;
extern PSI_stage_info stage_preparing;
extern PSI_stage_info stage_purging_old_relay_logs;
extern PSI_stage_info stage_query_end;
extern PSI_stage_info stage_starting_cleanup;
extern PSI_stage_info stage_slave_sql_cleanup;
extern PSI_stage_info stage_rollback;
extern PSI_stage_info stage_rollback_implicit;
extern PSI_stage_info stage_commit;
extern PSI_stage_info stage_commit_implicit;
extern PSI_stage_info stage_queueing_master_event_to_the_relay_log;
extern PSI_stage_info stage_reading_event_from_the_relay_log;
extern PSI_stage_info stage_recreating_table;
extern PSI_stage_info stage_registering_slave_on_master;
extern PSI_stage_info stage_removing_duplicates;
extern PSI_stage_info stage_removing_tmp_table;
extern PSI_stage_info stage_rename;
extern PSI_stage_info stage_rename_result_table;
extern PSI_stage_info stage_requesting_binlog_dump;
extern PSI_stage_info stage_reschedule;
extern PSI_stage_info stage_searching_rows_for_update;
extern PSI_stage_info stage_sending_binlog_event_to_slave;
extern PSI_stage_info stage_sending_cached_result_to_client;
extern PSI_stage_info stage_sending_data;
extern PSI_stage_info stage_setup;
extern PSI_stage_info stage_slave_has_read_all_relay_log;
extern PSI_stage_info stage_show_explain;
extern PSI_stage_info stage_sorting;
extern PSI_stage_info stage_sorting_for_group;
extern PSI_stage_info stage_sorting_for_order;
extern PSI_stage_info stage_sorting_result;
extern PSI_stage_info stage_sql_thd_waiting_until_delay;
extern PSI_stage_info stage_statistics;
extern PSI_stage_info stage_storing_result_in_query_cache;
extern PSI_stage_info stage_storing_row_into_queue;
extern PSI_stage_info stage_system_lock;
extern PSI_stage_info stage_unlocking_tables;
extern PSI_stage_info stage_table_lock;
extern PSI_stage_info stage_filling_schema_table;
extern PSI_stage_info stage_update;
extern PSI_stage_info stage_updating;
extern PSI_stage_info stage_updating_main_table;
extern PSI_stage_info stage_updating_reference_tables;
extern PSI_stage_info stage_upgrading_lock;
extern PSI_stage_info stage_user_lock;
extern PSI_stage_info stage_user_sleep;
extern PSI_stage_info stage_verifying_table;
extern PSI_stage_info stage_waiting_for_ddl;
extern PSI_stage_info stage_waiting_for_delay_list;
extern PSI_stage_info stage_waiting_for_disk_space;
extern PSI_stage_info stage_waiting_for_flush;
extern PSI_stage_info stage_waiting_for_gtid_to_be_written_to_binary_log;
extern PSI_stage_info stage_waiting_for_handler_insert;
extern PSI_stage_info stage_waiting_for_handler_lock;
extern PSI_stage_info stage_waiting_for_handler_open;
extern PSI_stage_info stage_waiting_for_insert;
extern PSI_stage_info stage_waiting_for_master_to_send_event;
extern PSI_stage_info stage_waiting_for_master_update;
extern PSI_stage_info stage_waiting_for_relay_log_space;
extern PSI_stage_info stage_waiting_for_slave_mutex_on_exit;
extern PSI_stage_info stage_waiting_for_slave_thread_to_start;
extern PSI_stage_info stage_waiting_for_query_cache_lock;
extern PSI_stage_info stage_waiting_for_table_flush;
extern PSI_stage_info stage_waiting_for_the_next_event_in_relay_log;
extern PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position;
extern PSI_stage_info stage_waiting_to_finalize_termination;
extern PSI_stage_info stage_binlog_waiting_background_tasks;
extern PSI_stage_info stage_binlog_write;
extern PSI_stage_info stage_binlog_processing_checkpoint_notify;
extern PSI_stage_info stage_binlog_stopping_background_thread;
extern PSI_stage_info stage_waiting_for_work_from_sql_thread;
extern PSI_stage_info stage_waiting_for_prior_transaction_to_commit;
extern PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit;
extern PSI_stage_info stage_waiting_for_room_in_worker_thread;
extern PSI_stage_info stage_waiting_for_workers_idle;
extern PSI_stage_info stage_waiting_for_ftwrl;
extern PSI_stage_info stage_waiting_for_ftwrl_threads_to_pause;
extern PSI_stage_info stage_waiting_for_rpl_thread_pool;
extern PSI_stage_info stage_master_gtid_wait_primary;
extern PSI_stage_info stage_master_gtid_wait;
extern PSI_stage_info stage_gtid_wait_other_connection;
extern PSI_stage_info stage_slave_background_process_request;
extern PSI_stage_info stage_slave_background_wait_request;
extern PSI_stage_info stage_waiting_for_deadlock_kill;
extern PSI_stage_info stage_starting;

#ifdef HAVE_PSI_STATEMENT_INTERFACE
/**
  Statement instrumentation keys (sql).
  The last entry, at [SQLCOM_END], is for parsing errors.
*/
extern PSI_statement_info sql_statement_info[(uint) SQLCOM_END + 1];

/**
  Statement instrumentation keys (com).
  The last entry, at [COM_END], is for packet errors.
*/
extern PSI_statement_info com_statement_info[(uint) COM_END + 1];

/**
  Statement instrumentation key for replication.
*/
extern PSI_statement_info stmt_info_rpl;

void init_sql_statement_info();
void init_com_statement_info();
#endif /* HAVE_PSI_STATEMENT_INTERFACE */

#ifndef _WIN32
extern pthread_t signal_thread;
#endif

#ifdef HAVE_OPENSSL
extern struct st_VioSSLFd * ssl_acceptor_fd;
#endif /* HAVE_OPENSSL */

/*
  The following variables were under INNODB_COMPABILITY_HOOKS
 */
extern my_bool opt_large_pages;
extern uint opt_large_page_size;
extern MYSQL_PLUGIN_IMPORT char lc_messages_dir[FN_REFLEN];
extern char *lc_messages_dir_ptr, *log_error_file_ptr;
extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN];
extern MYSQL_PLUGIN_IMPORT uint reg_ext_length;
extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names;
extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded;
extern ulong specialflag;
extern uint mysql_data_home_len;
extern uint mysql_real_data_home_len;
extern const char *mysql_real_data_home_ptr;
extern ulong thread_handling;
extern "C" MYSQL_PLUGIN_IMPORT char server_version[SERVER_VERSION_LENGTH];
extern char *server_version_ptr;
extern bool using_custom_server_version;
extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[];
extern char mysql_unpacked_real_data_home[];
extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables;
extern char default_logfile_name[FN_REFLEN];
extern char *my_proxy_protocol_networks;

#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))

extern MYSQL_PLUGIN_IMPORT const key_map key_map_empty;
extern MYSQL_PLUGIN_IMPORT key_map key_map_full;          /* Should be threaded as const */

/*
  Server mutex locks and condition variables.
 */
extern mysql_mutex_t
       LOCK_item_func_sleep, LOCK_status,
       LOCK_error_log, LOCK_delayed_insert, LOCK_short_uuid_generator,
       LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
       LOCK_active_mi, LOCK_manager, LOCK_user_conn,
       LOCK_prepared_stmt_count, LOCK_error_messages,  LOCK_backup_log;
extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_global_system_variables;
extern mysql_rwlock_t LOCK_all_status_vars;
extern mysql_mutex_t LOCK_start_thread;
extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_server_started;
extern MYSQL_PLUGIN_IMPORT mysql_cond_t COND_server_started;
extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
extern mysql_rwlock_t LOCK_ssl_refresh;
extern mysql_prlock_t LOCK_system_variables_hash;
extern mysql_cond_t COND_start_thread;
extern mysql_cond_t COND_manager;

extern my_bool opt_use_ssl;
extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
  *opt_ssl_key, *opt_ssl_crl, *opt_ssl_crlpath;
extern ulonglong tls_version;

#ifdef MYSQL_SERVER

/**
  only options that need special treatment in get_one_option() deserve
  to be listed below
*/
enum options_mysqld
{
  OPT_to_set_the_start_number=256,
  OPT_BINLOG_DO_DB,
  OPT_BINLOG_FORMAT,
  OPT_BINLOG_IGNORE_DB,
  OPT_BIN_LOG,
  OPT_BOOTSTRAP,
  OPT_EXPIRE_LOGS_DAYS,
  OPT_BINLOG_EXPIRE_LOGS_SECONDS,
  OPT_CONSOLE,
  OPT_DEBUG_SYNC_TIMEOUT,
  OPT_REMOVED_OPTION,
  OPT_IGNORE_DB_DIRECTORY,
  OPT_ISAM_LOG,
  OPT_KEY_BUFFER_SIZE,
  OPT_KEY_CACHE_AGE_THRESHOLD,
  OPT_KEY_CACHE_BLOCK_SIZE,
  OPT_KEY_CACHE_DIVISION_LIMIT,
  OPT_KEY_CACHE_PARTITIONS,
  OPT_KEY_CACHE_CHANGED_BLOCKS_HASH_SIZE,
  OPT_LOG_BASENAME,
  OPT_LOG_ERROR,
  OPT_LOG_SLOW_FILTER,
  OPT_LOWER_CASE_TABLE_NAMES,
  OPT_PLUGIN_LOAD,
  OPT_PLUGIN_LOAD_ADD,
  OPT_PFS_INSTRUMENT,
  OPT_REPLICATE_DO_DB,
  OPT_REPLICATE_DO_TABLE,
  OPT_REPLICATE_IGNORE_DB,
  OPT_REPLICATE_IGNORE_TABLE,
  OPT_REPLICATE_REWRITE_DB,
  OPT_REPLICATE_WILD_DO_TABLE,
  OPT_REPLICATE_WILD_IGNORE_TABLE,
  OPT_SAFE,
  OPT_SERVER_ID,
  OPT_SILENT,
  OPT_SKIP_HOST_CACHE,
  OPT_SLAVE_PARALLEL_MODE,
  OPT_SSL_CA,
  OPT_SSL_CAPATH,
  OPT_SSL_CERT,
  OPT_SSL_CIPHER,
  OPT_SSL_CRL,
  OPT_SSL_CRLPATH,
  OPT_SSL_KEY,
  OPT_THREAD_CONCURRENCY,
  OPT_WANT_CORE,
#ifdef WITH_WSREP
  OPT_WSREP_CAUSAL_READS,
  OPT_WSREP_SYNC_WAIT,
#endif /* WITH_WSREP */
  OPT_MYSQL_COMPATIBILITY,
  OPT_TLS_VERSION, OPT_SECURE_AUTH,
  OPT_MYSQL_TO_BE_IMPLEMENTED,
  OPT_which_is_always_the_last
};
#endif

/**
   Query type constants (usable as bitmap flags).
*/
enum enum_query_type
{
  /// Nothing specific, ordinary SQL query.
  QT_ORDINARY= 0,
  /// In utf8.
  QT_TO_SYSTEM_CHARSET= (1 << 0),
  /// Without character set introducers.
  QT_WITHOUT_INTRODUCERS= (1 << 1),
  /// view internal representation (like QT_ORDINARY except ORDER BY clause)
  QT_VIEW_INTERNAL= (1 << 2),
  /// If identifiers should not include database names, where unambiguous
  QT_ITEM_IDENT_SKIP_DB_NAMES= (1 << 3),
  /// If identifiers should not include table names, where unambiguous
  QT_ITEM_IDENT_SKIP_TABLE_NAMES= (1 << 4),
  /// If Item_cache_wrapper should not print <expr_cache>
  QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS= (1 << 5),
  /// If Item_subselect should print as just "(subquery#1)"
  /// rather than display the subquery body
  QT_ITEM_SUBSELECT_ID_ONLY= (1 << 6),
  /// If NULLIF(a,b) should print itself as
  /// CASE WHEN a_for_comparison=b THEN NULL ELSE a_for_return_value END
  /// when "a" was replaced to two different items
  /// (e.g. by equal fields propagation in optimize_cond())
  /// or always as NULLIF(a, b).
  /// The default behaviour is to use CASE syntax when
  /// a_for_return_value is not the same as a_for_comparison.
  /// SHOW CREATE {VIEW|PROCEDURE|FUNCTION} and other cases where the
  /// original representation is required, should set this flag.
  QT_ITEM_ORIGINAL_FUNC_NULLIF= (1 << 7),
  /// good for parsing
  QT_PARSABLE= (1 << 8),

  // If an expression is constant, print the expression, not the value
  // it evaluates to. Should be used for error messages, so that they
  // don't reveal values.
  QT_NO_DATA_EXPANSION= (1 << 9),

  /// This value means focus on readability, not on ability to parse back, etc.
  QT_EXPLAIN=           QT_TO_SYSTEM_CHARSET |
                        QT_ITEM_IDENT_SKIP_DB_NAMES |
                        QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS |
                        QT_ITEM_SUBSELECT_ID_ONLY,

  QT_SHOW_SELECT_NUMBER= (1<<10),

  /// Do not print database name or table name in the identifiers (even if
  /// this means the printout will be ambigous). It is assumed that the caller
  ///  passing this flag knows what they are doing.
  QT_ITEM_IDENT_DISABLE_DB_TABLE_NAMES= (1 <<11),

  /// This is used for EXPLAIN EXTENDED extra warnings / Be more detailed
  /// Be more detailed than QT_EXPLAIN.
  /// Perhaps we should eventually include QT_ITEM_IDENT_SKIP_CURRENT_DATABASE
  /// here, as it would give better readable results
  QT_EXPLAIN_EXTENDED=  QT_TO_SYSTEM_CHARSET|
                        QT_SHOW_SELECT_NUMBER,

  // Remove wrappers added for TVC when creating or showing view
  QT_NO_WRAPPERS_FOR_TVC_IN_VIEW= (1 << 12),

  /// Print for FRM file. Focus on parse-back.
  /// e.g. VIEW expressions and virtual column expressions
  QT_FOR_FRM= (1 << 13)
};


/* query_id */
extern Atomic_counter<query_id_t> global_query_id;

/* increment query_id and return it.  */
inline __attribute__((warn_unused_result)) query_id_t next_query_id()
{
  return global_query_id++;
}

inline query_id_t get_query_id()
{
  return global_query_id;
}

/* increment global_thread_id and return it.  */
extern __attribute__((warn_unused_result)) my_thread_id next_thread_id(void);

/*
  TODO: Replace this with an inline function.
 */
#ifndef EMBEDDED_LIBRARY
extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
#else
extern "C" void unireg_clear(int exit_code);
#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
#endif

inline void table_case_convert(char * name, uint length)
{
  if (lower_case_table_names)
    files_charset_info->casedn(name, length, name, length);
}

extern char *set_server_version(char *buf, size_t size);

#define current_thd _current_thd()
void set_current_thd(THD *thd);

/*
  @todo remove, make it static in ha_maria.cc
  currently it's needed for sql_select.cc
*/
extern handlerton *maria_hton;

extern uint64 global_gtid_counter;
extern my_bool opt_gtid_strict_mode;
extern my_bool opt_userstat_running, debug_assert_if_crashed_table;
extern uint mysqld_extra_port;
extern ulong opt_progress_report_time;
extern ulong extra_max_connections;
extern ulonglong denied_connections;
extern ulong thread_created;
extern scheduler_functions *thread_scheduler, *extra_thread_scheduler;
extern char *opt_log_basename;
extern my_bool opt_master_verify_checksum;
extern my_bool opt_stack_trace, disable_log_notes;
extern my_bool opt_expect_abort;
extern my_bool opt_slave_sql_verify_checksum;
extern my_bool opt_mysql56_temporal_format, strict_password_validation;
extern ulong binlog_checksum_options;
extern bool max_user_connections_checking;
extern ulong opt_binlog_dbug_fsync_sleep;
static const int SERVER_UID_SIZE= 29;
extern char server_uid[SERVER_UID_SIZE+1];

extern uint volatile global_disable_checkpoint;
extern my_bool opt_help;

extern int mysqld_main(int argc, char **argv);

#ifdef _WIN32
extern HANDLE hEventShutdown;
extern void mysqld_win_initiate_shutdown();
extern void mysqld_win_set_startup_complete();
extern void mysqld_win_extend_service_timeout(DWORD sec);
extern void mysqld_set_service_status_callback(void (*)(DWORD, DWORD, DWORD));
extern void mysqld_win_set_service_name(const char *name);
#endif

#endif /* MYSQLD_INCLUDED */
server/private/sql_show.h000064400000022620150400263770011542 0ustar00/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.
   Copyright (c) 2012, 2016, MariaDB

   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 */

#ifndef SQL_SHOW_H
#define SQL_SHOW_H

#include "sql_list.h"                           /* List */
#include "handler.h"                            /* enum_schema_tables */
#include "table.h"                              /* enum_schema_table_state */
#include "my_apc.h"

/* Forward declarations */
class JOIN;
class String;
class THD;
class sp_name;
struct TABLE_LIST;
typedef class st_select_lex SELECT_LEX;
struct LEX;
typedef struct st_mysql_show_var SHOW_VAR;
typedef struct st_schema_table ST_SCHEMA_TABLE;
struct TABLE;
typedef struct system_status_var STATUS_VAR;

/* Used by handlers to store things in schema tables */
#define IS_FILES_FILE_ID              0
#define IS_FILES_FILE_NAME            1
#define IS_FILES_FILE_TYPE            2
#define IS_FILES_TABLESPACE_NAME      3
#define IS_FILES_TABLE_CATALOG        4
#define IS_FILES_TABLE_SCHEMA         5
#define IS_FILES_TABLE_NAME           6
#define IS_FILES_LOGFILE_GROUP_NAME   7
#define IS_FILES_LOGFILE_GROUP_NUMBER 8
#define IS_FILES_ENGINE               9
#define IS_FILES_FULLTEXT_KEYS       10
#define IS_FILES_DELETED_ROWS        11
#define IS_FILES_UPDATE_COUNT        12
#define IS_FILES_FREE_EXTENTS        13
#define IS_FILES_TOTAL_EXTENTS       14
#define IS_FILES_EXTENT_SIZE         15
#define IS_FILES_INITIAL_SIZE        16
#define IS_FILES_MAXIMUM_SIZE        17
#define IS_FILES_AUTOEXTEND_SIZE     18
#define IS_FILES_CREATION_TIME       19
#define IS_FILES_LAST_UPDATE_TIME    20
#define IS_FILES_LAST_ACCESS_TIME    21
#define IS_FILES_RECOVER_TIME        22
#define IS_FILES_TRANSACTION_COUNTER 23
#define IS_FILES_VERSION             24
#define IS_FILES_ROW_FORMAT          25
#define IS_FILES_TABLE_ROWS          26
#define IS_FILES_AVG_ROW_LENGTH      27
#define IS_FILES_DATA_LENGTH         28
#define IS_FILES_MAX_DATA_LENGTH     29
#define IS_FILES_INDEX_LENGTH        30
#define IS_FILES_DATA_FREE           31
#define IS_FILES_CREATE_TIME         32
#define IS_FILES_UPDATE_TIME         33
#define IS_FILES_CHECK_TIME          34
#define IS_FILES_CHECKSUM            35
#define IS_FILES_STATUS              36
#define IS_FILES_EXTRA               37

typedef enum { WITHOUT_DB_NAME, WITH_DB_NAME } enum_with_db_name;

int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond);

int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
                      Table_specification_st *create_info_arg,
                      enum_with_db_name with_db_name);

int show_create_table_ex(THD *thd, TABLE_LIST *table_list,
                         const char * forced_db, const char *forced_name,
                         String *packet,
                         Table_specification_st *create_info_arg,
                         enum_with_db_name with_db_name);

int copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table);

bool append_identifier(THD *thd, String *packet, const char *name, size_t length);
static inline bool append_identifier(THD *thd, String *packet, const LEX_CSTRING *name)
{
  return append_identifier(thd, packet, name->str, name->length);
}
void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild);
int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd);
bool mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
                                   List<Item> *field_list, String *buffer);
bool mysqld_show_create(THD *thd, TABLE_LIST *table_list);
void mysqld_show_create_db_get_fields(THD *thd, List<Item> *field_list);
bool mysqld_show_create_db(THD *thd, LEX_CSTRING *db_name,
                           LEX_CSTRING *orig_db_name,
                           const DDL_options_st &options);

void mysqld_list_processes(THD *thd,const char *user,bool verbose);
int mysqld_show_status(THD *thd);
int mysqld_show_variables(THD *thd,const char *wild);
bool mysqld_show_storage_engines(THD *thd);
bool mysqld_show_authors(THD *thd);
bool mysqld_show_contributors(THD *thd);
bool mysqld_show_privileges(THD *thd);
char *make_backup_log_name(char *buff, const char *name, const char* log_ext);
uint calc_sum_of_all_status(STATUS_VAR *to);
bool append_definer(THD *thd, String *buffer, const LEX_CSTRING *definer_user,
                    const LEX_CSTRING *definer_host);
int add_status_vars(SHOW_VAR *list);
void remove_status_vars(SHOW_VAR *list);
ulonglong get_status_vars_version(void);
void init_status_vars();
void free_status_vars();
void reset_status_vars();
bool show_create_trigger(THD *thd, const sp_name *trg_name);
void view_store_options(THD *thd, TABLE_LIST *table, String *buff);

void init_fill_schema_files_row(TABLE* table);
void initialize_information_schema_acl();

ST_SCHEMA_TABLE *find_schema_table(THD *thd, const LEX_CSTRING *table_name,
                                   bool *in_plugin);
static inline ST_SCHEMA_TABLE *find_schema_table(THD *thd, const LEX_CSTRING *table_name)
{ bool unused; return find_schema_table(thd, table_name, &unused); }

ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
int make_schema_select(THD *thd,  SELECT_LEX *sel,
                       ST_SCHEMA_TABLE *schema_table);
int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list);
bool get_schema_tables_result(JOIN *join,
                              enum enum_schema_table_state executed_place);
enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table);
TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list);

const char* get_one_variable(THD *thd, const SHOW_VAR *variable,
                             enum_var_type value_type, SHOW_TYPE show_type,
                             system_status_var *status_var,
                             const CHARSET_INFO **charset, char *buff,
                             size_t *length);

/* These functions were under INNODB_COMPATIBILITY_HOOKS */
int get_quote_char_for_identifier(THD *thd, const char *name, size_t length);
THD *find_thread_by_id(longlong id, bool query_id= false);

class select_result_explain_buffer;
/*
  SHOW EXPLAIN request object. 
*/

class Show_explain_request : public Apc_target::Apc_call
{
public:
  THD *target_thd;  /* thd that we're running SHOW EXPLAIN for */
  THD *request_thd; /* thd that run SHOW EXPLAIN command */
  
  /* If true, there was some error when producing EXPLAIN output. */
  bool failed_to_produce;
   
  /* SHOW EXPLAIN will be stored here */
  select_result_explain_buffer *explain_buf;
  
  /* Query that we've got SHOW EXPLAIN for */
  String query_str;
  
  /* Overloaded virtual function */
  void call_in_target_thread() override;
};

/**
  Condition pushdown used for INFORMATION_SCHEMA / SHOW queries.
  This structure is to implement an optimization when
  accessing data dictionary data in the INFORMATION_SCHEMA
  or SHOW commands.
  When the query contain a TABLE_SCHEMA or TABLE_NAME clause,
  narrow the search for data based on the constraints given.
*/
typedef struct st_lookup_field_values
{
  /**
    Value of a TABLE_SCHEMA clause.
    Note that this value length may exceed @c NAME_LEN.
    @sa wild_db_value
  */
  LEX_CSTRING db_value;
  /**
    Value of a TABLE_NAME clause.
    Note that this value length may exceed @c NAME_LEN.
    @sa wild_table_value
  */
  LEX_CSTRING table_value;
  /**
    True when @c db_value is a LIKE clause,
    false when @c db_value is an '=' clause.
  */
  bool wild_db_value;
  /**
    True when @c table_value is a LIKE clause,
    false when @c table_value is an '=' clause.
  */
  bool wild_table_value;
} LOOKUP_FIELD_VALUES;  

/*
  INFORMATION_SCHEMA: Execution plan for get_all_tables() call
*/

class IS_table_read_plan : public Sql_alloc
{
public:
  IS_table_read_plan() : no_rows(false), trivial_show_command(FALSE) {}

  bool no_rows;
  /*
    For EXPLAIN only: For SHOW KEYS and SHOW COLUMNS, we know which
    db_name.table_name will be read, however for some reason we don't
    set the fields in this->lookup_field_vals.
    In order to not have JOIN::save_explain_data() walking over uninitialized
    data, we set trivial_show_command=true.
  */
  bool trivial_show_command;

  LOOKUP_FIELD_VALUES lookup_field_vals;
  Item *partial_cond;

  bool has_db_lookup_value()
  {
    return (lookup_field_vals.db_value.length &&
           !lookup_field_vals.wild_db_value);
  }
  bool has_table_lookup_value()
  {
    return (lookup_field_vals.table_value.length &&
            !lookup_field_vals.wild_table_value);
  }
};

bool optimize_schema_tables_reads(JOIN *join);
bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables);

/* Handle the ignored database directories list for SHOW/I_S. */
bool ignore_db_dirs_init();
void ignore_db_dirs_free();
void ignore_db_dirs_reset();
bool ignore_db_dirs_process_additions();
bool push_ignored_db_dir(const char *path);
extern char *opt_ignore_db_dirs;

#endif /* SQL_SHOW_H */
server/private/sql_delete.h000064400000002477150400263770012034 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_DELETE_INCLUDED
#define SQL_DELETE_INCLUDED

#include "my_base.h"                            /* ha_rows */

class THD;
struct TABLE_LIST;
class Item;
class select_result;

typedef class Item COND;
template <typename T> class SQL_I_List;

int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds,
                         bool *delete_while_scanning);
bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
                  SQL_I_List<ORDER> *order, ha_rows rows, 
                  ulonglong options, select_result *result);

#endif /* SQL_DELETE_INCLUDED */
server/private/my_alarm.h000064400000004575150400263770011515 0ustar00/*
   Copyright (c) 2000, 2010, Oracle and/or its affiliates.

   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 */

/*
  File to include when we want to use alarm or a loop_counter to display
  some information when a program is running
*/
#ifndef _my_alarm_h
#define _my_alarm_h
#ifdef	__cplusplus
extern "C" {
#endif

extern int volatile my_have_got_alarm;
extern ulong my_time_to_wait_for_lock;

#if defined(HAVE_ALARM) && !defined(NO_ALARM_LOOP)
#include <signal.h>
#ifdef HAVE_SIGHANDLER_T
#define sig_return sighandler_t
#elif defined(SOLARIS) || defined(__sun) || defined(__APPLE__) || \
    defined(_AIX) || \
    defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
    defined(__DragonFly__)
typedef void (*sig_return)(int); /* Returns type from signal */
#else
typedef void (*sig_return)(void); /* Returns type from signal */
#endif
#define ALARM_VARIABLES uint alarm_old=0; \
			sig_return alarm_signal=0
#define ALARM_INIT	my_have_got_alarm=0 ; \
			alarm_old=(uint) alarm(MY_HOW_OFTEN_TO_ALARM); \
			alarm_signal=signal(SIGALRM,my_set_alarm_variable);
#define ALARM_END	(void) signal(SIGALRM,alarm_signal); \
			(void) alarm(alarm_old);
#define ALARM_TEST	my_have_got_alarm
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
#define ALARM_REINIT	(void) alarm(MY_HOW_OFTEN_TO_ALARM); \
			(void) signal(SIGALRM,my_set_alarm_variable);\
			my_have_got_alarm=0;
#else
#define ALARM_REINIT	(void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \
			my_have_got_alarm=0;
#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */
#else
#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
#define ALARM_INIT
#define ALARM_END
#define ALARM_TEST (alarm_pos++ >= alarm_end_pos)
#define ALARM_REINIT (alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE)
#endif /* HAVE_ALARM */

#ifdef	__cplusplus
}
#endif
#endif
server/private/item_cmpfunc.h000064400000407563150400263770012371 0ustar00#ifndef ITEM_CMPFUNC_INCLUDED
#define ITEM_CMPFUNC_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
   Copyright (c) 2009, 2022, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


/* compare and test functions */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "item_func.h"             /* Item_int_func, Item_bool_func */
#include "item.h"

extern Item_result item_cmp_type(Item_result a,Item_result b);
inline Item_result item_cmp_type(const Item *a, const Item *b)
{
  return item_cmp_type(a->cmp_type(), b->cmp_type());
}
inline Item_result item_cmp_type(Item_result a, const Item *b)
{
  return item_cmp_type(a, b->cmp_type());
}
class Item_bool_func2;
class Arg_comparator;

typedef int (Arg_comparator::*arg_cmp_func)();

typedef int (*Item_field_cmpfunc)(Item *f1, Item *f2, void *arg); 

class Arg_comparator: public Sql_alloc
{
  Item **a, **b;
  const Type_handler *m_compare_handler;
  CHARSET_INFO *m_compare_collation;
  arg_cmp_func func;
  Item_func_or_sum *owner;
  bool set_null;                   // TRUE <=> set owner->null_value
  Arg_comparator *comparators;   // used only for compare_row()
  double precision;
  /* Fields used in DATE/DATETIME comparison. */
  Item *a_cache, *b_cache;         // Cached values of a and b items
                                   //   when one of arguments is NULL.

  int set_cmp_func(THD *thd, Item_func_or_sum *owner_arg,
                   const Type_handler *compare_handler,
                   Item **a1, Item **a2);

  int compare_not_null_values(longlong val1, longlong val2)
  {
    if (set_null)
      owner->null_value= false;
    if (val1 < val2) return -1;
    if (val1 == val2) return 0;
    return 1;
  }
  NativeBuffer<STRING_BUFFER_USUAL_SIZE> m_native1, m_native2;
public:
  /* Allow owner function to use string buffers. */
  String value1, value2;

  Arg_comparator():
    m_compare_handler(&type_handler_null),
    m_compare_collation(&my_charset_bin),
    set_null(TRUE), comparators(0),
    a_cache(0), b_cache(0) {};
  Arg_comparator(Item **a1, Item **a2): a(a1), b(a2),
    m_compare_handler(&type_handler_null),
    m_compare_collation(&my_charset_bin),
    set_null(TRUE), comparators(0),
    a_cache(0), b_cache(0) {};

public:
  bool set_cmp_func_for_row_arguments(THD *thd);
  bool set_cmp_func_row(THD *thd);
  bool set_cmp_func_string(THD *thd);
  bool set_cmp_func_time(THD *thd);
  bool set_cmp_func_datetime(THD *thd);
  bool set_cmp_func_native(THD *thd);
  bool set_cmp_func_int(THD *thd);
  bool set_cmp_func_real(THD *thd);
  bool set_cmp_func_decimal(THD *thd);

  inline int set_cmp_func(THD *thd, Item_func_or_sum *owner_arg,
                          const Type_handler *compare_handler,
                          Item **a1, Item **a2, bool set_null_arg)
  {
    set_null= set_null_arg;
    return set_cmp_func(thd, owner_arg, compare_handler, a1, a2);
  }
  int set_cmp_func(THD *thd, Item_func_or_sum *owner_arg,
                   Item **a1, Item **a2, bool set_null_arg)
  {
    Item *tmp_args[2]= { *a1, *a2 };
    Type_handler_hybrid_field_type tmp;
    if (tmp.aggregate_for_comparison(owner_arg->func_name_cstring(),
                                     tmp_args, 2, false))
      return 1;
    return set_cmp_func(thd, owner_arg, tmp.type_handler(),
                        a1, a2, set_null_arg);
  }

  inline int compare() { return (this->*func)(); }

  int compare_string();		 // compare args[0] & args[1]
  int compare_real();            // compare args[0] & args[1]
  int compare_decimal();         // compare args[0] & args[1]
  int compare_int_signed();      // compare args[0] & args[1]
  int compare_int_signed_unsigned();
  int compare_int_unsigned_signed();
  int compare_int_unsigned();
  int compare_row();             // compare args[0] & args[1]
  int compare_e_string();	 // compare args[0] & args[1]
  int compare_e_real();          // compare args[0] & args[1]
  int compare_e_decimal();       // compare args[0] & args[1]
  int compare_e_int();           // compare args[0] & args[1]
  int compare_e_int_diff_signedness();
  int compare_e_row();           // compare args[0] & args[1]
  int compare_real_fixed();
  int compare_e_real_fixed();
  int compare_datetime();
  int compare_e_datetime();
  int compare_time();
  int compare_e_time();
  int compare_native();
  int compare_e_native();
  int compare_json_str_basic(Item *j, Item *s);
  int compare_json_str();
  int compare_str_json();
  int compare_e_json_str_basic(Item *j, Item *s);
  int compare_e_json_str();
  int compare_e_str_json();

  void min_max_update_field_native(THD *thd, Field *field, Item *item,
                                   int cmp_sign);

  Item** cache_converted_constant(THD *thd, Item **value, Item **cache,
                                  const Type_handler *type);
  inline bool is_owner_equal_func()
  {
    return (owner->type() == Item::FUNC_ITEM &&
           ((Item_func*)owner)->functype() == Item_func::EQUAL_FUNC);
  }
  const Type_handler *compare_type_handler() const { return m_compare_handler; }
  Item_result compare_type() const { return m_compare_handler->cmp_type(); }
  CHARSET_INFO *compare_collation() const { return m_compare_collation; }
  Arg_comparator *subcomparators() const { return comparators; }
  void cleanup()
  {
    delete [] comparators;
    comparators= 0;
  }
  friend class Item_func;
  friend class Item_bool_rowready_func2;
};


class SEL_ARG;
struct KEY_PART;

class Item_bool_func :public Item_int_func,
                      public Type_cmp_attributes
{
protected:
  /*
    Build a SEL_TREE for a simple predicate
    @param  param       PARAM from SQL_SELECT::test_quick_select
    @param  field       field in the predicate
    @param  value       constant in the predicate
    @return Pointer to the tree built tree
  */
  virtual SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                                     Field *field, Item *value)
  {
    DBUG_ENTER("Item_bool_func::get_func_mm_tree");
    DBUG_ASSERT(0);
    DBUG_RETURN(0);
  }
  /*
    Return the full select tree for "field_item" and "value":
    - a single SEL_TREE if the field is not in a multiple equality, or
    - a conjunction of all SEL_TREEs for all fields from
      the same multiple equality with "field_item".
  */
  SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
                                  Item_field *field_item, Item *value);
  /**
    Test if "item" and "value" are suitable for the range optimization
    and get their full select tree.

    "Suitable" means:
    - "item" is a field or a field reference
    - "value" is NULL                (e.g. WHERE field IS NULL), or
      "value" is an unexpensive item (e.g. WHERE field OP value)

    @param item  - the argument that is checked to be a field
    @param value - the other argument
    @returns - NULL if the arguments are not suitable for the range optimizer.
    @returns - the full select tree if the arguments are suitable.
  */
  SEL_TREE *get_full_func_mm_tree_for_args(RANGE_OPT_PARAM *param,
                                           Item *item, Item *value)
  {
    DBUG_ENTER("Item_bool_func::get_full_func_mm_tree_for_args");
    Item *field= item->real_item();
    if (field->type() == Item::FIELD_ITEM && !field->const_item() &&
        (!value || !value->is_expensive()))
      DBUG_RETURN(get_full_func_mm_tree(param, (Item_field *) field, value));
    DBUG_RETURN(NULL);
  }
  SEL_TREE *get_mm_parts(RANGE_OPT_PARAM *param, Field *field,
                         Item_func::Functype type, Item *value);
  SEL_TREE *get_ne_mm_tree(RANGE_OPT_PARAM *param,
                           Field *field, Item *lt_value, Item *gt_value);
  virtual SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
                               KEY_PART *key_part,
                               Item_func::Functype type, Item *value);
  void raise_note_if_key_become_unused(THD *thd, const Item_args &old_args);
public:
  Item_bool_func(THD *thd): Item_int_func(thd) {}
  Item_bool_func(THD *thd, Item *a): Item_int_func(thd, a) {}
  Item_bool_func(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {}
  Item_bool_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {}
  Item_bool_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
  Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {}
  const Type_handler *type_handler() const override
  { return &type_handler_bool; }
  const Type_handler *fixed_type_handler() const override
  { return &type_handler_bool; }
  CHARSET_INFO *compare_collation() const override { return NULL; }
  longlong val_int() override final
  {
    DBUG_ASSERT(!is_cond());
    return val_bool();
  }
  bool val_bool() override= 0;
  bool fix_length_and_dec() override { decimals=0; max_length=1; return FALSE; }
  decimal_digits_t decimal_precision() const override { return 1; }
  bool need_parentheses_in_default() override { return true; }
};


/**
  Abstract Item class, to represent <code>X IS [NOT] (TRUE | FALSE)</code>
  boolean predicates.
*/

class Item_func_truth : public Item_bool_func
{
public:
  bool val_bool() override;
  bool fix_length_and_dec() override;
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override { return CMP_PRECEDENCE; }

protected:
  Item_func_truth(THD *thd, Item *a, bool a_value, bool a_affirmative):
    Item_bool_func(thd, a), value(a_value), affirmative(a_affirmative)
  {}

  ~Item_func_truth() = default;
private:
  /**
    True for <code>X IS [NOT] TRUE</code>,
    false for <code>X IS [NOT] FALSE</code> predicates.
  */
  const bool value;
  /**
    True for <code>X IS Y</code>, false for <code>X IS NOT Y</code> predicates.
  */
  const bool affirmative;
};


/**
  This Item represents a <code>X IS TRUE</code> boolean predicate.
*/

class Item_func_istrue : public Item_func_truth
{
public:
  Item_func_istrue(THD *thd, Item *a): Item_func_truth(thd, a, true, true) {}
  ~Item_func_istrue() = default;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("istrue") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_istrue>(thd, this); }
};


/**
  This Item represents a <code>X IS NOT TRUE</code> boolean predicate.
*/

class Item_func_isnottrue : public Item_func_truth
{
public:
  Item_func_isnottrue(THD *thd, Item *a):
    Item_func_truth(thd, a, true, false) {}
  ~Item_func_isnottrue() = default;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("isnottrue") };
    return name;
  }
  bool find_not_null_fields(table_map allowed) override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isnottrue>(thd, this); }
  bool eval_not_null_tables(void *) override
  { not_null_tables_cache= 0; return false; }
};


/**
  This Item represents a <code>X IS FALSE</code> boolean predicate.
*/

class Item_func_isfalse : public Item_func_truth
{
public:
  Item_func_isfalse(THD *thd, Item *a): Item_func_truth(thd, a, false, true) {}
  ~Item_func_isfalse() = default;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("isfalse") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isfalse>(thd, this); }
};


/**
  This Item represents a <code>X IS NOT FALSE</code> boolean predicate.
*/

class Item_func_isnotfalse : public Item_func_truth
{
public:
  Item_func_isnotfalse(THD *thd, Item *a):
    Item_func_truth(thd, a, false, false) {}
  ~Item_func_isnotfalse() = default;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("isnotfalse") };
    return name;
  }
  bool find_not_null_fields(table_map allowed) override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isnotfalse>(thd, this); }
  bool eval_not_null_tables(void *) override
  { not_null_tables_cache= 0; return false; }
};


class Item_cache;
#define UNKNOWN (-1)


/*
  Item_in_optimizer(left_expr, Item_in_subselect(...))

  Item_in_optimizer is used to wrap an instance of Item_in_subselect. This
  class does the following:
   - Evaluate the left expression and store it in Item_cache_* object (to
     avoid re-evaluating it many times during subquery execution)
   - Shortcut the evaluation of "NULL IN (...)" to NULL in the cases where we
     don't care if the result is NULL or FALSE.

  NOTE
    It is not quite clear why the above listed functionality should be
    placed into a separate class called 'Item_in_optimizer'.
*/

class Item_in_optimizer: public Item_bool_func
{
protected:
  Item_cache *cache;
  Item *expr_cache;
  /*
    Stores the value of "NULL IN (SELECT ...)" for uncorrelated subqueries:
      UNKNOWN - "NULL in (SELECT ...)" has not yet been evaluated
      FALSE   - result is FALSE
      TRUE    - result is NULL
  */
  int result_for_null_param;
public:
  Item_in_optimizer(THD *thd, Item *a, Item *b):
    Item_bool_func(thd, a, b), cache(0), expr_cache(0),
    result_for_null_param(UNKNOWN)
  {
    with_flags|= item_with_t::SUBQUERY;
  }
  bool fix_fields(THD *, Item **) override;
  bool fix_left(THD *thd);
  table_map not_null_tables() const override { return 0; }
  bool is_null() override;
  bool val_bool() override;
  void cleanup() override;
  enum Functype functype() const override { return IN_OPTIMIZER_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<in_optimizer>") };
    return name;
  }
  Item_cache **get_cache() { return &cache; }
  Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
  Item *expr_cache_insert_transformer(THD *thd, uchar *unused) override;
  bool is_expensive_processor(void *arg) override;
  bool is_expensive() override;
  void set_join_tab_idx(uint8 join_tab_idx_arg) override
  { args[1]->set_join_tab_idx(join_tab_idx_arg); }
  void get_cache_parameters(List<Item> &parameters) override;
  bool is_top_level_item() const override;
  bool eval_not_null_tables(void *opt_arg) override;
  bool find_not_null_fields(table_map allowed) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref,
                         bool merge) override;
  bool invisible_mode();
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
  void reset_cache() { cache= NULL; }
  void print(String *str, enum_query_type query_type) override;
  void restore_first_argument();
  Item* get_wrapped_in_subselect_item()
  { return args[1]; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_in_optimizer>(thd, this); }
  enum precedence precedence() const override { return args[1]->precedence(); }
};


/*
  Functions and operators with two arguments that can use range optimizer.
*/
class Item_bool_func2 :public Item_bool_func
{                                              /* Bool with 2 string args */
protected:
  void add_key_fields_optimize_op(JOIN *join, KEY_FIELD **key_fields,
                                  uint *and_level, table_map usable_tables,
                                  SARGABLE_PARAM **sargables, bool equal_func);
public:
  Item_bool_func2(THD *thd, Item *a, Item *b):
    Item_bool_func(thd, a, b) { }

  bool is_null() override { return MY_TEST(args[0]->is_null() || args[1]->is_null()); }
  COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
                        bool top_level) override;
  bool count_sargable_conds(void *arg) override;
  /*
    Specifies which result type the function uses to compare its arguments.
    This method is used in equal field propagation.
  */
  virtual const Type_handler *compare_type_handler() const
  {
    /*
      Have STRING_RESULT by default, which means the function compares
      val_str() results of the arguments. This is suitable for Item_func_like
      and for Item_func_spatial_rel.
      Note, Item_bool_rowready_func2 overrides this default behaviour.
    */
    return &type_handler_varchar;
  }
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override
  {
    DBUG_ENTER("Item_bool_func2::get_mm_tree");
    DBUG_ASSERT(arg_count == 2);
    SEL_TREE *ftree= get_full_func_mm_tree_for_args(param, args[0], args[1]);
    if (!ftree)
      ftree= Item_func::get_mm_tree(param, cond_ptr);
    DBUG_RETURN(ftree);
  }
};


/**
  A class for functions and operators that can use the range optimizer and
  have a reverse function/operator that can also use the range optimizer,
  so this condition:
    WHERE value OP field
  can be optimized as equivalent to:
    WHERE field REV_OP value

  This class covers:
  - scalar comparison predicates:  <, <=, =, <=>, >=, >
  - MBR and precise spatial relation predicates (e.g. SP_TOUCHES(x,y))

  For example:
    WHERE 10 > field
  can be optimized as:
    WHERE field < 10
*/
class Item_bool_func2_with_rev :public Item_bool_func2
{
protected:
  SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                             Field *field, Item *value) override
  {
    DBUG_ENTER("Item_bool_func2_with_rev::get_func_mm_tree");
    Item_func::Functype func_type=
      (value != arguments()[0]) ? functype() : rev_functype();
    DBUG_RETURN(get_mm_parts(param, field, func_type, value));
  }
public:
  Item_bool_func2_with_rev(THD *thd, Item *a, Item *b):
    Item_bool_func2(thd, a, b) { }
  virtual enum Functype rev_functype() const= 0;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override
  {
    DBUG_ENTER("Item_bool_func2_with_rev::get_mm_tree");
    DBUG_ASSERT(arg_count == 2);
    SEL_TREE *ftree;
    /*
      Even if get_full_func_mm_tree_for_args(param, args[0], args[1]) will not
      return a range predicate it may still be possible to create one
      by reversing the order of the operands. Note that this only
      applies to predicates where both operands are fields. Example: A
      query of the form

         WHERE t1.a OP t2.b

      In this case, args[0] == t1.a and args[1] == t2.b.
      When creating range predicates for t2,
      get_full_func_mm_tree_for_args(param, args[0], args[1])
      will return NULL because 'field' belongs to t1 and only
      predicates that applies to t2 are of interest. In this case a
      call to get_full_func_mm_tree_for_args() with reversed operands
      may succeed.
    */
    if (!(ftree= get_full_func_mm_tree_for_args(param, args[0], args[1])) &&
        !(ftree= get_full_func_mm_tree_for_args(param, args[1], args[0])))
      ftree= Item_func::get_mm_tree(param, cond_ptr);
    DBUG_RETURN(ftree);
  }
};


class Item_bool_rowready_func2 :public Item_bool_func2_with_rev
{
protected:
  Arg_comparator cmp;
  bool check_arguments() const override
  {
    return check_argument_types_like_args0();
  }
public:
  Item_bool_rowready_func2(THD *thd, Item *a, Item *b):
    Item_bool_func2_with_rev(thd, a, b), cmp(tmp_arg, tmp_arg + 1)
  { }
  Sql_mode_dependency value_depends_on_sql_mode() const override;
  void print(String *str, enum_query_type query_type) override
  {
    Item_func::print_op(str, query_type);
  }
  enum precedence precedence() const override { return CMP_PRECEDENCE; }
  Item *neg_transformer(THD *thd) override;
  virtual Item *negated_item(THD *thd);
  Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    Item_args::propagate_equal_fields(thd,
                                      Context(ANY_SUBST,
                                              cmp.compare_type_handler(),
                                              compare_collation()),
                                      cond);
    return this;
  }
  bool fix_length_and_dec() override;
  bool fix_length_and_dec_generic(THD *thd,
                                  const Type_handler *compare_handler)
  {
    DBUG_ASSERT(args == tmp_arg);
    return cmp.set_cmp_func(thd, this, compare_handler,
                            tmp_arg, tmp_arg + 1, true/*set_null*/);
  }
  int set_cmp_func(THD *thd)
  {
    DBUG_ASSERT(args == tmp_arg);
    return cmp.set_cmp_func(thd, this, tmp_arg, tmp_arg + 1, true/*set_null*/);
  }
  CHARSET_INFO *compare_collation() const override
  { return cmp.compare_collation(); }
  const Type_handler *compare_type_handler() const override
  {
    return cmp.compare_type_handler();
  }
  Arg_comparator *get_comparator() { return &cmp; }
  void cleanup() override
  {
    Item_bool_func2::cleanup();
    cmp.cleanup();
  }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override
  {
    return add_key_fields_optimize_op(join, key_fields, and_level,
                                      usable_tables, sargables, false);
  }
  Item *do_build_clone(THD *thd) const override
  {
    Item_bool_rowready_func2 *clone=
      (Item_bool_rowready_func2 *) Item_func::do_build_clone(thd);
    if (clone)
    {
      clone->cmp.comparators= 0;
    }
    return clone;
  }
};

/**
  XOR inherits from Item_bool_func because it is not optimized yet.
  Later, when XOR is optimized, it needs to inherit from
  Item_cond instead. See WL#5800.
*/
class Item_func_xor :public Item_bool_func
{
public:
  Item_func_xor(THD *thd, Item *i1, Item *i2): Item_bool_func(thd, i1, i2) {}
  enum Functype functype() const override { return XOR_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("xor") };
    return name;
  }
  enum precedence precedence() const override { return XOR_PRECEDENCE; }
  void print(String *str, enum_query_type query_type) override
  { Item_func::print_op(str, query_type); }
  bool val_bool() override;
  bool find_not_null_fields(table_map allowed) override { return false; }
  Item *neg_transformer(THD *thd) override;
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) override
  {
    Item_args::propagate_equal_fields(thd, Context_boolean(), cond);
    return this;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_xor>(thd, this); }
};

class Item_func_not :public Item_bool_func
{
  bool abort_on_null;
public:
  Item_func_not(THD *thd, Item *a):
    Item_bool_func(thd, a), abort_on_null(FALSE) {}
  void top_level_item() override { abort_on_null= 1; }
  bool is_top_level_item() const override { return abort_on_null; }
  bool val_bool() override;
  enum Functype functype() const override { return NOT_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("not") };
    return name;
  }
  bool find_not_null_fields(table_map allowed) override { return false; }
  enum precedence precedence() const override { return NEG_PRECEDENCE; }
  Item *neg_transformer(THD *thd) override;
  bool fix_fields(THD *, Item **) override;
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_not>(thd, this); }
};

class Item_maxmin_subselect;

/*
  trigcond<param>(arg) ::= param? arg : TRUE

  The class Item_func_trig_cond is used for guarded predicates 
  which are employed only for internal purposes.
  A guarded predicate is an object consisting of an a regular or
  a guarded predicate P and a pointer to a boolean guard variable g. 
  A guarded predicate P/g is evaluated to true if the value of the
  guard g is false, otherwise it is evaluated to the same value that
  the predicate P: val(P/g)= g ? val(P):true.
  Guarded predicates allow us to include predicates into a conjunction
  conditionally. Currently they are utilized for pushed down predicates
  in queries with outer join operations.

  In the future, probably, it makes sense to extend this class to
  the objects consisting of three elements: a predicate P, a pointer
  to a variable g and a firing value s with following evaluation
  rule: val(P/g,s)= g==s? val(P) : true. It will allow us to build only
  one item for the objects of the form P/g1/g2... 

  Objects of this class are built only for query execution after
  the execution plan has been already selected. That's why this
  class needs only val_int out of generic methods. 
 
  Current uses of Item_func_trig_cond objects:
   - To wrap selection conditions when executing outer joins
   - To wrap condition that is pushed down into subquery
*/

class Item_func_trig_cond: public Item_bool_func
{
  bool *trig_var;
public:
  Item_func_trig_cond(THD *thd, Item *a, bool *f): Item_bool_func(thd, a)
  { trig_var= f; }
  bool val_bool() override { return *trig_var ? args[0]->val_bool() : true; }
  enum Functype functype() const override { return TRIG_COND_FUNC; };
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("trigcond") };
    return name;
  }
  bool const_item() const override { return FALSE; }
  bool *get_trig_var() { return trig_var; }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_trig_cond>(thd, this); }
};

class Item_func_not_all :public Item_func_not
{
  /* allow to check presence of values in max/min optimization */
  Item_sum_min_max *test_sum_item;
  Item_maxmin_subselect *test_sub_item;

public:
  bool show;

  Item_func_not_all(THD *thd, Item *a):
    Item_func_not(thd, a), test_sum_item(0), test_sub_item(0), show(0)
    {}
  table_map not_null_tables() const override { return 0; }
  bool val_bool() override;
  enum Functype functype() const override { return NOT_ALL_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<not>") };
    return name;
  }
  enum precedence precedence() const override
  { return show ? Item_func::precedence() : args[0]->precedence(); }
  bool fix_fields(THD *thd, Item **ref) override
  { return Item_func::fix_fields(thd, ref);}
  void print(String *str, enum_query_type query_type) override;
  void set_sum_test(Item_sum_min_max *item) { test_sum_item= item; test_sub_item= 0; };
  void set_sub_test(Item_maxmin_subselect *item) { test_sub_item= item; test_sum_item= 0;};
  bool empty_underlying_subquery();
  Item *neg_transformer(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_not_all>(thd, this); }
};


class Item_func_nop_all :public Item_func_not_all
{
public:

  Item_func_nop_all(THD *thd, Item *a): Item_func_not_all(thd, a) {}
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<nop>") };
    return name;
  }
  Item *neg_transformer(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_nop_all>(thd, this); }
};


class Item_func_eq :public Item_bool_rowready_func2
{
  bool abort_on_null;
public:
  Item_func_eq(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b),
    abort_on_null(false), in_equality_no(UINT_MAX)
  {}
  bool val_bool() override;
  enum Functype functype() const override { return EQ_FUNC; }
  enum Functype rev_functype() const override { return EQ_FUNC; }
  cond_result eq_cmp_result() const override { return COND_TRUE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("=") };
    return name;
  }
  void top_level_item() override { abort_on_null= true; }
  Item *negated_item(THD *thd) override;
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override;
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override
  {
    return add_key_fields_optimize_op(join, key_fields, and_level,
                                      usable_tables, sargables, true);
  }
  bool check_equality(THD *thd, COND_EQUAL *cond, List<Item> *eq_list) override;
  /* 
    - If this equality is created from the subquery's IN-equality:
      number of the item it was created from, e.g. for
       (a,b) IN (SELECT c,d ...)  a=c will have in_equality_no=0, 
       and b=d will have in_equality_no=1.
    - Otherwise, UINT_MAX
  */
  uint in_equality_no;
  uint exists2in_reserved_items() override { return 1; };
  friend class  Arg_comparator;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_eq>(thd, this); }
  Item *do_build_clone(THD *thd) const override;
};

class Item_func_equal final :public Item_bool_rowready_func2
{
public:
  Item_func_equal(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b) {}
  bool val_bool() override;
  bool fix_length_and_dec() override;
  table_map not_null_tables() const override { return 0; }
  bool find_not_null_fields(table_map allowed) override { return false; }
  enum Functype functype() const override { return EQUAL_FUNC; }
  enum Functype rev_functype() const override { return EQUAL_FUNC; }
  cond_result eq_cmp_result() const override { return COND_TRUE; }
  bool is_null() override { return false; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<=>") };
    return name;
  }
  Item *neg_transformer(THD *thd) override { return 0; }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override
  {
    return add_key_fields_optimize_op(join, key_fields, and_level,
                                      usable_tables, sargables, true);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_equal>(thd, this); }
};


class Item_func_ge :public Item_bool_rowready_func2
{
public:
  Item_func_ge(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b) {};
  bool val_bool() override;
  enum Functype functype() const override { return GE_FUNC; }
  enum Functype rev_functype() const override { return LE_FUNC; }
  cond_result eq_cmp_result() const override { return COND_TRUE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN(">=") };
    return name;
  }
  Item *negated_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ge>(thd, this); }
};


class Item_func_gt :public Item_bool_rowready_func2
{
public:
  Item_func_gt(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b) {};
  bool val_bool() override;
  enum Functype functype() const override { return GT_FUNC; }
  enum Functype rev_functype() const override { return LT_FUNC; }
  cond_result eq_cmp_result() const override { return COND_FALSE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN(">") };
    return name;
  }
  Item *negated_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_gt>(thd, this); }
};


class Item_func_le :public Item_bool_rowready_func2
{
public:
  Item_func_le(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b) {};
  bool val_bool() override;
  enum Functype functype() const override { return LE_FUNC; }
  enum Functype rev_functype() const override { return GE_FUNC; }
  cond_result eq_cmp_result() const override { return COND_TRUE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<=") };
    return name;
  }
  Item *negated_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_le>(thd, this); }
};


class Item_func_lt :public Item_bool_rowready_func2
{
public:
  Item_func_lt(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b) {}
  bool val_bool() override;
  enum Functype functype() const override { return LT_FUNC; }
  enum Functype rev_functype() const override { return GT_FUNC; }
  cond_result eq_cmp_result() const override { return COND_FALSE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<") };
    return name;
  }
  Item *negated_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_lt>(thd, this); }
};


class Item_func_ne :public Item_bool_rowready_func2
{
protected:
  SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                             Field *field, Item *value) override;
public:
  Item_func_ne(THD *thd, Item *a, Item *b):
    Item_bool_rowready_func2(thd, a, b) {}
  bool val_bool() override;
  enum Functype functype() const override { return NE_FUNC; }
  enum Functype rev_functype() const override { return NE_FUNC; }
  cond_result eq_cmp_result() const override { return COND_FALSE; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<>") };
    return name;
  }
  Item *negated_item(THD *thd) override;
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
                      table_map usable_tables, SARGABLE_PARAM **sargables) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ne>(thd, this); }
};


/*
  The class Item_func_opt_neg is defined to factor out the functionality
  common for the classes Item_func_between and Item_func_in. The objects
  of these classes can express predicates or there negations.
  The alternative approach would be to create pairs Item_func_between,
  Item_func_notbetween and Item_func_in, Item_func_notin.

*/

class Item_func_opt_neg :public Item_bool_func
{
protected:
  /*
    The data type handler that will be used for comparison.
    Data type handlers of all arguments are mixed to here.
  */
  Type_handler_hybrid_field_type m_comparator;
  /*
    The collation that will be used for comparison in case
    when m_compare_type is STRING_RESULT.
  */
  DTCollation cmp_collation;
public:
  bool negated;     /* <=> the item represents NOT <func> */
  bool pred_level;  /* <=> [NOT] <func> is used on a predicate level */
public:
  Item_func_opt_neg(THD *thd, Item *a, Item *b, Item *c):
    Item_bool_func(thd, a, b, c), negated(0), pred_level(0) {}
  Item_func_opt_neg(THD *thd, List<Item> &list):
    Item_bool_func(thd, list), negated(0), pred_level(0) {}
public:
  void top_level_item() override { pred_level= 1; }
  bool is_top_level_item() const override { return pred_level; }
  Item *neg_transformer(THD *thd) override
  {
    negated= !negated;
    return this;
  }
  bool eq(const Item *item, bool binary_cmp) const override;
  CHARSET_INFO *compare_collation() const override
  {
    return cmp_collation.collation;
  }
  Item *propagate_equal_fields(THD *, const Context &,
                               COND_EQUAL *) override= 0;
};

class Item_func_between :public Item_func_opt_neg
{
protected:
  SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                             Field *field, Item *value) override;
  bool val_int_cmp_int_finalize(longlong value, longlong a, longlong b);
public:
  String value0,value1,value2;
  Item_func_between(THD *thd, Item *a, Item *b, Item *c):
    Item_func_opt_neg(thd, a, b, c) { }
  bool val_bool() override
  {
    DBUG_ASSERT(fixed());
    return m_comparator.type_handler()->Item_func_between_val_int(this);
  }
  enum Functype functype() const override { return BETWEEN; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("between") };
    return name;
  }
  enum precedence precedence() const override { return BETWEEN_PRECEDENCE; }
  bool fix_length_and_dec() override;
  bool fix_length_and_dec_string(THD *)
  {
    return agg_arg_charsets_for_comparison(cmp_collation, args, 3);
  }
  bool fix_length_and_dec_temporal(THD *);
  bool fix_length_and_dec_numeric(THD *);
  void print(String *str, enum_query_type query_type) override;
  bool eval_not_null_tables(void *opt_arg) override;
  bool find_not_null_fields(table_map allowed) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  bool count_sargable_conds(void *arg) override;
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    Item_args::propagate_equal_fields(thd,
                                      Context(ANY_SUBST,
                                              m_comparator.type_handler(),
                                              compare_collation()),
                                      cond);
    return this;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_between>(thd, this); }

  longlong val_int_cmp_string();
  longlong val_int_cmp_datetime();
  longlong val_int_cmp_time();
  longlong val_int_cmp_native();
  longlong val_int_cmp_int();
  longlong val_int_cmp_real();
  longlong val_int_cmp_decimal();
};


class Item_func_strcmp :public Item_long_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_str(0, 2); }
  String value1, value2;
  DTCollation cmp_collation;
public:
  Item_func_strcmp(THD *thd, Item *a, Item *b):
    Item_long_func(thd, a, b) {}
  longlong val_int() override;
  decimal_digits_t decimal_precision() const override { return 1; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("strcmp") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
      return TRUE;
    fix_char_length(2); // returns "1" or "0" or "-1"
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_strcmp>(thd, this); }
};


struct interval_range
{
  Item_result type;
  double dbl;
  my_decimal dec;
};

class Item_func_interval :public Item_long_func
{
  Item_row *row;
  bool use_decimal_comparison;
  interval_range *intervals;
  bool check_arguments() const override
  {
    return check_argument_types_like_args0();
  }
public:
  Item_func_interval(THD *thd, Item_row *a):
    Item_long_func(thd, a), row(a), intervals(0)
  { }
  longlong val_int() override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("interval") };
    return name;
  }
  decimal_digits_t decimal_precision() const override { return 2; }
  void print(String *str, enum_query_type query_type) override
  {
    str->append(func_name_cstring());
    print_args(str, 0, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_interval>(thd, this); }
};


class Item_func_coalesce :public Item_func_case_expression
{
public:
  Item_func_coalesce(THD *thd, Item *a, Item *b):
    Item_func_case_expression(thd, a, b) {}
  Item_func_coalesce(THD *thd, List<Item> &list):
    Item_func_case_expression(thd, list) {}
  double real_op() override;
  longlong int_op() override;
  String *str_op(String *) override;
  my_decimal *decimal_op(my_decimal *) override;
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  bool native_op(THD *thd, Native *to) override;
  bool fix_length_and_dec() override
  {
    if (aggregate_for_result(func_name_cstring(), args, arg_count, true))
      return TRUE;
    fix_attributes(args, arg_count);
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("coalesce") };
    return name;
  }
  table_map not_null_tables() const override { return 0; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_coalesce>(thd, this); }
};


/*
  Case abbreviations that aggregate its result field type by two arguments:
    IFNULL(arg1, arg2)
    IF(switch, arg1, arg2)
    NVL2(switch, arg1, arg2)
*/
class Item_func_case_abbreviation2 :public Item_func_case_expression
{
protected:
  bool fix_length_and_dec2(Item **items)
  {
    if (aggregate_for_result(func_name_cstring(), items, 2, true))
      return TRUE;
    fix_attributes(items, 2);
    return FALSE;
  }

  void cache_type_info(const Item *source, bool maybe_null_arg)
  {
    Type_std_attributes::set(source);
    set_handler(source->type_handler());
    set_maybe_null(maybe_null_arg);
  }

  bool fix_length_and_dec2_eliminate_null(Item **items)
  {
    // Let IF(cond, expr, NULL) and IF(cond, NULL, expr) inherit type from expr.
    if (items[0]->type() == NULL_ITEM)
    {
      cache_type_info(items[1], true);
      // If both arguments are NULL, make resulting type BINARY(0).
      if (items[1]->type() == NULL_ITEM)
        set_handler(&type_handler_string);
    }
    else if (items[1]->type() == NULL_ITEM)
    {
      cache_type_info(items[0], true);
    }
    else
    {
      if (fix_length_and_dec2(items))
        return TRUE;
    }
    return FALSE;
  }

public:
  Item_func_case_abbreviation2(THD *thd, Item *a, Item *b):
    Item_func_case_expression(thd, a, b) { }
  Item_func_case_abbreviation2(THD *thd, Item *a, Item *b, Item *c):
    Item_func_case_expression(thd, a, b, c) { }
};


class Item_func_ifnull :public Item_func_case_abbreviation2
{
public:
  Item_func_ifnull(THD *thd, Item *a, Item *b):
    Item_func_case_abbreviation2(thd, a, b) {}
  double real_op() override;
  longlong int_op() override;
  String *str_op(String *str) override;
  my_decimal *decimal_op(my_decimal *) override;
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  bool native_op(THD *thd, Native *to) override;
  bool fix_length_and_dec() override
  {
    /*
      Set nullability from args[1] by default.
      Note, some type handlers may reset maybe_null
      in Item_hybrid_func_fix_attributes() if args[1]
      is NOT NULL but cannot always be converted to
      the data type of "this" safely.
      E.g. Type_handler_inet6 does:
        IFNULL(inet6_not_null_expr, 'foo') -> INET6 NULL
        IFNULL(inet6_not_null_expr, '::1') -> INET6 NOT NULL
    */
    copy_flags(args[1], item_base_t::MAYBE_NULL);
    if (Item_func_case_abbreviation2::fix_length_and_dec2(args))
      return TRUE;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ifnull") };
    return name;
  }

  table_map not_null_tables() const override { return 0; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ifnull>(thd, this); }
};


/**
  Case abbreviations that have a switch argument and
  two return arguments to choose from. Returns the value
  of either of the two return arguments depending on the switch argument value.

  IF(switch, arg1, arg2)
  NVL(switch, arg1, arg2)
*/
class Item_func_case_abbreviation2_switch: public Item_func_case_abbreviation2
{
protected:
  virtual Item *find_item() const= 0;

public:
  Item_func_case_abbreviation2_switch(THD *thd, Item *a, Item *b, Item *c)
    :Item_func_case_abbreviation2(thd, a, b, c)
  { }

  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    Datetime_truncation_not_needed dt(thd, find_item(), fuzzydate);
    return (null_value= dt.copy_to_mysql_time(ltime, mysql_timestamp_type()));
  }
  bool time_op(THD *thd, MYSQL_TIME *ltime) override
  {
    return (null_value= Time(find_item()).copy_to_mysql_time(ltime));
  }
  longlong int_op() override
  {
    return val_int_from_item(find_item());
  }
  double real_op() override
  {
    return val_real_from_item(find_item());
  }
  my_decimal *decimal_op(my_decimal *decimal_value) override
  {
    return val_decimal_from_item(find_item(), decimal_value);
  }
  String *str_op(String *str) override
  {
    return val_str_from_item(find_item(), str);
  }
  bool native_op(THD *thd, Native *to) override
  {
    return val_native_with_conversion_from_item(thd, find_item(), to,
                                                type_handler());
  }
};


class Item_func_if :public Item_func_case_abbreviation2_switch
{
protected:
  Item *find_item() const override
  { return args[0]->val_bool() ? args[1] : args[2]; }

public:
  Item_func_if(THD *thd, Item *a, Item *b, Item *c):
    Item_func_case_abbreviation2_switch(thd, a, b, c)
  {}
  bool fix_fields(THD *, Item **) override;
  bool fix_length_and_dec() override
  {
    return fix_length_and_dec2_eliminate_null(args + 1);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("if") };
    return name;
  }
  bool eval_not_null_tables(void *opt_arg) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_if>(thd, this); }
private:
  void cache_type_info(Item *source);
};


class Item_func_nvl2 :public Item_func_case_abbreviation2_switch
{
protected:
  Item *find_item() const override
  { return args[0]->is_null() ? args[2] : args[1]; }

public:
  Item_func_nvl2(THD *thd, Item *a, Item *b, Item *c):
    Item_func_case_abbreviation2_switch(thd, a, b, c)
  {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("nvl2") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    return fix_length_and_dec2_eliminate_null(args + 1);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_nvl2>(thd, this); }
};


class Item_func_nullif :public Item_func_case_expression
{
  Arg_comparator cmp;
  /*
    NULLIF(a,b) is a short for:
      CASE WHEN a=b THEN NULL ELSE a END

    The left "a" is for comparison purposes.
    The right "a" is for return value purposes.
    These are two different "a" and they can be replaced to different items.

    The left "a" is in a comparison and can be replaced by:
    - Item_func::convert_const_compared_to_int_field()
    - agg_item_set_converter() in set_cmp_func()
    - cache_converted_constant() in set_cmp_func()

    Both "a"s are subject to equal fields propagation and can be replaced by:
    - Item_field::propagate_equal_fields(ANY_SUBST) for the left "a"
    - Item_field::propagate_equal_fields(IDENTITY_SUBST) for the right "a"
  */
  Item_cache *m_cache;
  int compare();
  void reset_first_arg_if_needed()
  { 
    if (arg_count == 3 && args[0] != args[2])
      args[0]= args[2];
  }
  Item *m_arg0;
public:
  /*
    Here we pass three arguments to the parent constructor, as NULLIF
    is a three-argument function, it needs two copies of the first argument
    (see above). But fix_fields() will be confused if we try to prepare the
    same Item twice (if args[0]==args[2]), so we hide the third argument
    (decrementing arg_count) and copy args[2]=args[0] again after fix_fields().
    See also Item_func_nullif::fix_length_and_dec().
  */
  Item_func_nullif(THD *thd, Item *a, Item *b):
    Item_func_case_expression(thd, a, b, a),
    m_cache(NULL),
    m_arg0(NULL)
  { arg_count--; }
  void cleanup() override
  {
    Item_func_hybrid_field_type::cleanup();
    arg_count= 2; // See the comment to the constructor
  }
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  double real_op() override;
  longlong int_op() override;
  String *str_op(String *str) override;
  my_decimal *decimal_op(my_decimal *) override;
  bool native_op(THD *thd, Native *to) override;
  bool fix_length_and_dec() override;
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("nullif") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, 
                      List<Item> &fields, uint flags) override;
  void update_used_tables() override;
  table_map not_null_tables() const override { return 0; }
  bool is_null() override;
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    Context cmpctx(ANY_SUBST, cmp.compare_type_handler(),
                              cmp.compare_collation());
    const Item *old0= args[0];
    args[0]->propagate_equal_fields_and_change_item_tree(thd, cmpctx,
                                                         cond, &args[0]);
    args[1]->propagate_equal_fields_and_change_item_tree(thd, cmpctx,
                                                         cond, &args[1]);
    /*
      MDEV-9712 Performance degradation of nested NULLIF
      ANY_SUBST is more relaxed than IDENTITY_SUBST.
      If ANY_SUBST did not change args[0],
      then we can skip propagation for args[2].
    */
    if (old0 != args[0])
      args[2]->propagate_equal_fields_and_change_item_tree(thd,
                                                           Context_identity(),
                                                           cond, &args[2]);
    return this;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_nullif>(thd, this); }
  Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override
  { reset_first_arg_if_needed(); return this; }
  Item *derived_field_transformer_for_where(THD *thd, uchar *arg) override
  { reset_first_arg_if_needed(); return this; }
  Item *grouping_field_transformer_for_where(THD *thd, uchar *arg) override
  { reset_first_arg_if_needed(); return this; }
  Item *in_subq_field_transformer_for_where(THD *thd, uchar *arg) override
  { reset_first_arg_if_needed(); return this; }
  Item *in_subq_field_transformer_for_having(THD *thd, uchar *arg) override
  { reset_first_arg_if_needed(); return this; }
};


/* Functions to handle the optimized IN */


/* A vector of values of some type  */

class in_vector :public Sql_alloc
{
public:
  char *base;
  uint size;
  qsort_cmp2 compare;
  CHARSET_INFO *collation;
  uint count;
  uint used_count;
  in_vector() = default;
  in_vector(THD *thd, uint elements, uint element_length, qsort_cmp2 cmp_func,
  	    CHARSET_INFO *cmp_coll)
    :base((char*) thd_calloc(thd, elements * element_length)),
     size(element_length), compare(cmp_func), collation(cmp_coll),
     count(elements), used_count(elements) {}
  virtual ~in_vector() = default;
  /*
    Store an Item value at the given position.
    @returns false - the Item was not NULL, and the conversion from the
                     Item data type to the cmp_item data type went without
                     errors
    @returns true  - the Item was NULL, or data type conversion returned NULL
  */
  virtual bool set(uint pos, Item *item)=0;
  virtual uchar *get_value(Item *item)=0;
  void sort()
  {
    my_qsort2(base,used_count,size,compare,(void*)collation);
  }
  bool find(Item *item);
  
  /* 
    Create an instance of Item_{type} (e.g. Item_decimal) constant object
    which type allows it to hold an element of this vector without any
    conversions.
    The purpose of this function is to be able to get elements of this
    vector in form of Item_xxx constants without creating Item_xxx object
    for every array element you get (i.e. this implements "FlyWeight" pattern)
  */
  virtual Item* create_item(THD *thd) { return NULL; }
  
  /*
    Store the value at position #pos into provided item object
    SYNOPSIS
      value_to_item()
        pos   Index of value to store
        item  Constant item to store value into. The item must be of the same
              type that create_item() returns.
  */
  virtual void value_to_item(uint pos, Item *item) { }
  
  /* Compare values number pos1 and pos2 for equality */
  bool compare_elems(uint pos1, uint pos2)
  {
    return MY_TEST(compare(const_cast<charset_info_st *>(collation),
                           base + pos1 * size, base + pos2 * size));
  }
  virtual const Type_handler *type_handler() const= 0;
};

class in_string :public in_vector
{
  char buff[STRING_BUFFER_USUAL_SIZE];
  String tmp;
  class Item_string_for_in_vector: public Item_string
  {
  public:
    Item_string_for_in_vector(THD *thd, CHARSET_INFO *cs):
      Item_string(thd, cs)
    { }
    void set_value(const String *str)
    {
      str_value= *str;
      collation.set(str->charset());
    }
  };
public:
  in_string(THD *thd, uint elements, qsort_cmp2 cmp_func, CHARSET_INFO *cs);
  ~in_string();
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  Item* create_item(THD *thd) override;
  void value_to_item(uint pos, Item *item) override
  {    
    String *str=((String*) base)+pos;
    Item_string_for_in_vector *to= (Item_string_for_in_vector*) item;
    to->set_value(str);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_varchar; }
};

class in_longlong :public in_vector
{
protected:
  /*
    Here we declare a temporary variable (tmp) of the same type as the
    elements of this vector. tmp is used in finding if a given value is in 
    the list. 
  */
  struct packed_longlong 
  {
    longlong val;
    longlong unsigned_flag;  // Use longlong, not bool, to preserve alignment
  } tmp;
public:
  in_longlong(THD *thd, uint elements);
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  Item* create_item(THD *thd) override;
  void value_to_item(uint pos, Item *item) override
  {
    ((Item_int*) item)->value= ((packed_longlong*) base)[pos].val;
    ((Item_int*) item)->unsigned_flag= (bool)
      ((packed_longlong*) base)[pos].unsigned_flag;
  }
  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }

  friend int cmp_longlong(void *cmp_arg, const void *a, const void *b);
};


class in_timestamp :public in_vector
{
  Timestamp_or_zero_datetime tmp;
public:
  in_timestamp(THD *thd, uint elements);
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  Item* create_item(THD *thd) override;
  void value_to_item(uint pos, Item *item) override;
  const Type_handler *type_handler() const  override
  { return &type_handler_timestamp2; }
};


/*
  Class to represent a vector of constant DATE/DATETIME values.
*/
class in_temporal :public in_longlong
{
public:
  /* Cache for the left item. */

  in_temporal(THD *thd, uint elements)
    :in_longlong(thd, elements) {};
  Item *create_item(THD *thd) override;
  void value_to_item(uint pos, Item *item) override
  {
    packed_longlong *val= reinterpret_cast<packed_longlong*>(base)+pos;
    Item_datetime *dt= static_cast<Item_datetime*>(item);
    dt->set(val->val, type_handler()->mysql_timestamp_type());
  }
  friend int cmp_longlong(void *cmp_arg, const void *a, const void *b);
};


class in_datetime :public in_temporal
{
public:
  in_datetime(THD *thd, uint elements)
   :in_temporal(thd, elements)
  {}
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  const Type_handler *type_handler() const override
  { return &type_handler_datetime2; }
};


class in_time :public in_temporal
{
public:
  in_time(THD *thd, uint elements)
   :in_temporal(thd, elements)
  {}
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  const Type_handler *type_handler() const override
  { return &type_handler_time2; }
};


class in_double :public in_vector
{
  double tmp;
public:
  in_double(THD *thd, uint elements);
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  Item *create_item(THD *thd) override;
  void value_to_item(uint pos, Item *item) override
  {
    ((Item_float*)item)->value= ((double*) base)[pos];
  }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
};


class in_decimal :public in_vector
{
  my_decimal val;
public:
  in_decimal(THD *thd, uint elements);
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  Item *create_item(THD *thd) override;
  void value_to_item(uint pos, Item *item) override
  {
    my_decimal *dec= ((my_decimal *)base) + pos;
    Item_decimal *item_dec= (Item_decimal*)item;
    item_dec->set_decimal_value(dec);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
};


/*
** Classes for easy comparing of non const items
*/

class cmp_item :public Sql_alloc
{
public:
  CHARSET_INFO *cmp_charset;
  cmp_item() { cmp_charset= &my_charset_bin; }
  virtual ~cmp_item() = default;
  virtual void store_value(Item *item)= 0;
  /**
     @returns result (TRUE, FALSE or UNKNOWN) of
     "stored argument's value <> item's value"
  */
  virtual int cmp(Item *item)= 0;
  virtual int cmp_not_null(const Value *value)= 0;
  // for optimized IN with row
  virtual int compare(const cmp_item *item) const= 0;
  virtual cmp_item *make_same(THD *thd)= 0;
  /*
    Store a scalar or a ROW value into "this".
    @returns false - the value (or every component in case of ROW) was
                     not NULL and the data type conversion went without errors.
    @returns true  - the value (or some of its components) was NULL, or the
                     data type conversion of a not-NULL value returned NULL.
  */
  virtual bool store_value_by_template(THD *thd, cmp_item *tmpl, Item *item)=0;
};

/// cmp_item which stores a scalar (i.e. non-ROW).
class cmp_item_scalar : public cmp_item
{
protected:
  bool m_null_value;                            ///< If stored value is NULL
  bool store_value_by_template(THD *thd, cmp_item *tmpl, Item *item) override
  {
    store_value(item);
    return m_null_value;
  }
};

class cmp_item_string : public cmp_item_scalar
{
protected:
  String *value_res;
public:
  cmp_item_string () = default;
  cmp_item_string (CHARSET_INFO *cs) { cmp_charset= cs; }
  void set_charset(CHARSET_INFO *cs) { cmp_charset= cs; }
  friend class cmp_item_sort_string;
  friend class cmp_item_sort_string_in_static;
};

class cmp_item_sort_string :public cmp_item_string
{
protected:
  char value_buff[STRING_BUFFER_USUAL_SIZE];
  String value;
public:
  cmp_item_sort_string():
    cmp_item_string() {}
  cmp_item_sort_string(CHARSET_INFO *cs):
    cmp_item_string(cs),
    value(value_buff, sizeof(value_buff), cs) {}
  void store_value(Item *item) override
  {
    value_res= item->val_str(&value);
    m_null_value= item->null_value;
    // Make sure to cache the result String inside "value"
    if (value_res && value_res != &value)
    {
      if (value.copy(*value_res))
        value.set("", 0, item->collation.collation);
      value_res= &value;
    }
  }
  int cmp_not_null(const Value *val) override
  {
    DBUG_ASSERT(!val->is_null());
    DBUG_ASSERT(val->is_string());
    return sortcmp(value_res, &val->m_string, cmp_charset) != 0;
  }
  int cmp(Item *arg) override
  {
    char buff[STRING_BUFFER_USUAL_SIZE];
    String tmp(buff, sizeof(buff), cmp_charset), *res= arg->val_str(&tmp);
    if (m_null_value || arg->null_value)
      return UNKNOWN;
    if (value_res && res)
      return sortcmp(value_res, res, cmp_charset) != 0;
    else if (!value_res && !res)
      return FALSE;
    else
      return TRUE;
  }
  int compare(const cmp_item *ci) const override
  {
    cmp_item_string *l_cmp= (cmp_item_string *) ci;
    return sortcmp(value_res, l_cmp->value_res, cmp_charset);
  }
  cmp_item *make_same(THD *thd) override;
  void set_charset(CHARSET_INFO *cs)
  {
    cmp_charset= cs;
    value.set_buffer_if_not_allocated(value_buff, sizeof(value_buff), cs);
  }
};

class cmp_item_int : public cmp_item_scalar
{
  longlong value;
public:
  cmp_item_int() = default;                           /* Remove gcc warning */
  void store_value(Item *item) override
  {
    value= item->val_int();
    m_null_value= item->null_value;
  }
  int cmp_not_null(const Value *val) override
  {
    DBUG_ASSERT(!val->is_null());
    DBUG_ASSERT(val->is_longlong());
    return value != val->value.m_longlong;
  }
  int cmp(Item *arg) override
  {
    const bool rc= value != arg->val_int();
    return (m_null_value || arg->null_value) ? UNKNOWN : rc;
  }
  int compare(const cmp_item *ci) const override
  {
    cmp_item_int *l_cmp= (cmp_item_int *)ci;
    return (value < l_cmp->value) ? -1 : ((value == l_cmp->value) ? 0 : 1);
  }
  cmp_item *make_same(THD *thd) override;
};

/*
  Compare items in the DATETIME context.
*/
class cmp_item_temporal: public cmp_item_scalar
{
protected:
  longlong value;
public:
  cmp_item_temporal() = default;
  int compare(const cmp_item *ci) const override;
};


class cmp_item_datetime: public cmp_item_temporal
{
public:
  cmp_item_datetime()
   :cmp_item_temporal()
  { }
  void store_value(Item *item) override
  {
    value= item->val_datetime_packed(current_thd);
    m_null_value= item->null_value;
  }
  int cmp_not_null(const Value *val) override;
  int cmp(Item *arg) override;
  cmp_item *make_same(THD *thd) override;
};


class cmp_item_time: public cmp_item_temporal
{
public:
  cmp_item_time()
   :cmp_item_temporal()
  { }
  void store_value(Item *item) override
  {
    value= item->val_time_packed(current_thd);
    m_null_value= item->null_value;
  }
  int cmp_not_null(const Value *val) override;
  int cmp(Item *arg) override;
  cmp_item *make_same(THD *thd) override;
};


class cmp_item_timestamp: public cmp_item_scalar
{
  Timestamp_or_zero_datetime_native m_native;
public:
  cmp_item_timestamp() :cmp_item_scalar() { }
  void store_value(Item *item) override;
  int cmp_not_null(const Value *val) override;
  int cmp(Item *arg) override;
  int compare(const cmp_item *ci) const override;
  cmp_item *make_same(THD *thd) override;
};


class cmp_item_real : public cmp_item_scalar
{
  double value;
public:
  cmp_item_real() = default;                          /* Remove gcc warning */
  void store_value(Item *item) override
  {
    value= item->val_real();
    m_null_value= item->null_value;
  }
  int cmp_not_null(const Value *val) override
  {
    DBUG_ASSERT(!val->is_null());
    DBUG_ASSERT(val->is_double());
    return value != val->value.m_double;
  }
  int cmp(Item *arg) override
  {
    const bool rc= value != arg->val_real();
    return (m_null_value || arg->null_value) ? UNKNOWN : rc;
  }
  int compare(const cmp_item *ci) const override
  {
    cmp_item_real *l_cmp= (cmp_item_real *) ci;
    return (value < l_cmp->value)? -1 : ((value == l_cmp->value) ? 0 : 1);
  }
  cmp_item *make_same(THD *thd) override;
};


class cmp_item_decimal : public cmp_item_scalar
{
  my_decimal value;
public:
  cmp_item_decimal() = default;                       /* Remove gcc warning */
  void store_value(Item *item) override;
  int cmp(Item *arg) override;
  int cmp_not_null(const Value *val) override;
  int compare(const cmp_item *c) const override;
  cmp_item *make_same(THD *thd) override;
};


/* 
   cmp_item for optimized IN with row (right part string, which never
   be changed)
*/

class cmp_item_sort_string_in_static :public cmp_item_string
{
 protected:
  String value;
public:
  cmp_item_sort_string_in_static(CHARSET_INFO *cs):
    cmp_item_string(cs) {}
  void store_value(Item *item) override
  {
    value_res= item->val_str(&value);
    m_null_value= item->null_value;
  }
  int cmp_not_null(const Value *val) override
  {
    DBUG_ASSERT(false);
    return TRUE;
  }
  int cmp(Item *item) override
  {
    // Should never be called
    DBUG_ASSERT(false);
    return TRUE;
  }
  int compare(const cmp_item *ci) const override
  {
    cmp_item_string *l_cmp= (cmp_item_string *) ci;
    return sortcmp(value_res, l_cmp->value_res, cmp_charset);
  }
  cmp_item *make_same(THD *) override
  {
    return new cmp_item_sort_string_in_static(cmp_charset);
  }
};


/**
  A helper class to handle situations when some item "pred" (the predicant)
  is consequently compared to a list of other items value0..valueN (the values).
  Currently used to handle:
  - <in predicate>
    pred IN (value0, value1, value2)
  - <simple case>
    CASE pred WHEN value0 .. WHEN value1 .. WHEN value2 .. END

  Every pair {pred,valueN} can be compared by its own Type_handler.
  Some pairs can use the same Type_handler.
  In cases when all pairs use exactly the same Type_handler,
  we say "all types are compatible".

  For example, for an expression
    1 IN (1, 1e0, 1.0, 2)
  - pred   is 1
  - value0 is 1
  - value1 is 1e0
  - value2 is 1.1
  - value3 is 2

  Pairs (pred,valueN) are compared as follows:
    N   expr1  Type
    -   -----  ----
    0       1   INT
    1     1e0   DOUBLE
    2     1.0   DECIMAL
    3       2   INT

  Types are not compatible in this example.

  During add_value() calls, each pair {pred,valueN} is analysed:
  - If valueN is an explicit NULL, it can be ignored in the caller asks to do so
  - If valueN is not an explicit NULL (or if the caller didn't ask to skip
    NULLs), then the value add an element in the array m_comparators[].

  Every element m_comparators[] stores the following information:
  1. m_arg_index - the position of the value expression in the original
     argument array, e.g. in Item_func_in::args[] or Item_func_case::args[].

  2. m_handler - the pointer to the data type handler that the owner
     will use to compare the pair {args[m_predicate_index],args[m_arg_index]}.

  3. m_handler_index - the index of an m_comparators[] element corresponding
     to the leftmost pair that uses exactly the same Type_handler for
     comparison. m_handler_index helps to maintain unique data type handlers.
   - m_comparators[i].m_handler_index==i means that this is the
     leftmost pair that uses the Type_handler m_handler for comparision.
   - If m_comparators[i].m_handlex_index!=i, it means that some earlier
     element m_comparators[j<i] is already using this Type_handler
     pointed by m_handler.

  4. m_cmp_item - the pointer to a cmp_item instance to handle comparison
     for this pair. Only unique type handlers have m_cmp_item!=NULL.
     Non-unique type handlers share the same cmp_item instance.
     For all m_comparators[] elements the following assersion it true:
       (m_handler_index==i) == (m_cmp_item!=NULL)
*/
class Predicant_to_list_comparator
{
  // Allocate memory on thd memory root for "nvalues" values.
  bool alloc_comparators(THD *thd, uint nvalues);

  /**
    Look up m_comparators[] for a comparator using the given data type handler.
    @param [OUT] idx     - the index of the found comparator is returned here
    @param [IN]  handler - the data type handler to find
    @param [IN]  count   - search in the range [0,count) only
    @retval true         - this type handler was not found
                           (*idx is not defined in this case).
    @retval false        - this type handler was found (the position of the
                           found handler is returned in idx).
  */
  bool find_handler(uint *idx, const Type_handler *handler, uint count)
  {
    DBUG_ASSERT(count < m_comparator_count);
    for (uint i= 0 ; i < count; i++)
    {
      if (m_comparators[i].m_handler == handler)
      {
        *idx= i;
        return false;
      }
    }
    return true;
  }

  /**
    Populate m_comparators[i].m_handler_index for all elements in
    m_comparators using the information in m_comparators[i].m_handlers,
    which was previously populated by a add_predicant() call and a number
    of add_value() calls.
    @param [OUT] compatible - If all comparator types are compatible,
                              their data type handler is returned here.
    @param [OUT] unuque_cnt - The number of unique data type handlers found.
                              If the value returned in *unique_cnt is 0,
                              it means all values were explicit NULLs:
                                expr0 IN (NULL,NULL,..,NULL)
    @param [OUT] found_type - The bit mask for all found cmp_type()'s.
  */
  void detect_unique_handlers(Type_handler_hybrid_field_type *compatible,
                              uint *unique_cnt, uint *found_types);
  /**
    Creates a cmp_item instances for all unique handlers and stores
    them into m_comparators[i].m_cmp_item, using the information previously
    populated by add_predicant(), add_value(), detect_unque_handlers().
  */

  /*
    Compare the predicant to the value pointed by m_comparators[i].
    @param  args    - the same argument array which was previously used
                      with add_predicant() and add_value().
    @param  i       - which pair to check.
    @retval true    - the predicant is not equal to the value.
    @retval false   - the predicant is equal to the value.
    @retval UNKNOWN - the result is uncertain yet because the predicant
                      and/or the value returned NULL,
                      more pairs {pred,valueN} should be checked.
  */
  int cmp_arg(Item_args *args, uint i)
  {
    Predicant_to_value_comparator *cmp=
      &m_comparators[m_comparators[i].m_handler_index];
    cmp_item *in_item= cmp->m_cmp_item;
    DBUG_ASSERT(in_item);
    /*
      If this is the leftmost pair that uses the data type handler
      pointed by m_comparators[i].m_handler, then we need to cache
      the predicant value representation used by this handler.
    */
    if (m_comparators[i].m_handler_index == i)
      in_item->store_value(args->arguments()[m_predicant_index]);
    /*
      If the predicant item has null_value==true then:
      - In case of scalar expression we can returns UNKNOWN immediately.
        No needs to check the result of the value item.
      - In case of ROW, null_value==true means that *some* row elements
        returned NULL, but *some* elements can still be non-NULL!
        We need to get the result of the value item and test
        if non-NULL elements in the predicant and the value produce
        TRUE (not equal), or UNKNOWN.
    */
    if (args->arguments()[m_predicant_index]->null_value &&
        m_comparators[i].m_handler != &type_handler_row)
      return UNKNOWN;
    return in_item->cmp(args->arguments()[m_comparators[i].m_arg_index]);
  }
  int cmp_args_nulls_equal(THD *thd, Item_args *args, uint i)
  {
    Predicant_to_value_comparator *cmp=
      &m_comparators[m_comparators[i].m_handler_index];
    cmp_item *in_item= cmp->m_cmp_item;
    DBUG_ASSERT(in_item);
    Item *predicant= args->arguments()[m_predicant_index];
    Item *arg= args->arguments()[m_comparators[i].m_arg_index];
    ValueBuffer<MAX_FIELD_WIDTH> val;
    if (m_comparators[i].m_handler_index == i)
      in_item->store_value(predicant);
    m_comparators[i].m_handler->Item_save_in_value(thd, arg, &val);
    if (predicant->null_value && val.is_null())
      return FALSE; // Two nulls are equal
    if (predicant->null_value || val.is_null())
      return UNKNOWN;
    return in_item->cmp_not_null(&val);
  }
  /**
    Predicant_to_value_comparator - a comparator for one pair (pred,valueN).
    See comments above.
  */
  struct Predicant_to_value_comparator
  {
    const Type_handler *m_handler;
    cmp_item *m_cmp_item;
    uint m_arg_index;
    uint m_handler_index;
    void cleanup()
    {
      if (m_cmp_item)
        delete m_cmp_item;
      memset(this, 0, sizeof(*this));
    }
  };

  Predicant_to_value_comparator *m_comparators; // The comparator array
  uint m_comparator_count;// The number of elements in m_comparators[]
  uint m_predicant_index; // The position of the predicant in its argument list,
                          // e.g. for Item_func_in m_predicant_index is 0,
                          // as predicant is stored in Item_func_in::args[0].
                          // For Item_func_case m_predicant_index is
                          // set to Item_func_case::first_expr_num.

public:
  Predicant_to_list_comparator(THD *thd, uint nvalues)
   :m_comparator_count(0),
    m_predicant_index(0)
  {
    alloc_comparators(thd, nvalues);
  }

  uint comparator_count() const { return m_comparator_count; }
  const Type_handler *get_comparator_type_handler(uint i) const
  {
    DBUG_ASSERT(i < m_comparator_count);
    return m_comparators[i].m_handler;
  }
  uint get_comparator_arg_index(uint i) const
  {
    DBUG_ASSERT(i < m_comparator_count);
    return m_comparators[i].m_arg_index;
  }
  cmp_item *get_comparator_cmp_item(uint i) const
  {
    DBUG_ASSERT(i < m_comparator_count);
    return m_comparators[i].m_cmp_item;
  }

#ifndef DBUG_OFF
  void debug_print(THD *thd)
  {
    for (uint i= 0; i < m_comparator_count; i++)
    {
      DBUG_EXECUTE_IF("Predicant_to_list_comparator",
                      push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
                      ER_UNKNOWN_ERROR, "DBUG: [%d] arg=%d handler=%d (%s)", i,
                      m_comparators[i].m_arg_index,
                      m_comparators[i].m_handler_index,
                      m_comparators[m_comparators[i].m_handler_index].
                                    m_handler->name().ptr()););
    }
  }
#endif

  void add_predicant(Item_args *args, uint predicant_index)
  {
    DBUG_ASSERT(m_comparator_count == 0); // Set in constructor
    DBUG_ASSERT(m_predicant_index == 0);  // Set in constructor
    DBUG_ASSERT(predicant_index < args->argument_count());
    m_predicant_index= predicant_index;
  }
  /**
    Add a new element into m_comparators[], using a {pred,valueN} pair.

    @param funcname        - the name of the operation, for error reporting
    @param args            - the owner function's argument list
    @param value_index     - the value position in args
    @retval true           - could not add an element because of non-comparable
                             arguments (e.g. ROWs with size)
    @retval false          - a new element was successfully added.
  */
  bool add_value(const LEX_CSTRING &funcname, Item_args *args,
                 uint value_index);

  /**
    Add a new element into m_comparators[], ignoring explicit NULL values.
    If the value appeared to be an explicit NULL, nulls_found[0] is set to true.
  */
  bool add_value_skip_null(const LEX_CSTRING &funcname,
                           Item_args *args, uint value_index,
                           bool *nulls_found);

  /**
    Signal "this" that there will be no new add_value*() calls,
    so it can prepare its internal structures for comparison.

    @param [OUT] compatible - If all comparators are compatible,
                              their data type handler is returned here.
    @param [OUT] unuque_cnt - The number of unique data type handlers found.
                              If the value returned in *unique_cnt is 0,
                              it means all values were explicit NULLs:
                                expr0 IN (NULL,NULL,..,NULL)
    @param [OUT] found_type - The bit mask for all found cmp_type()'s.
  */
  void all_values_added(Type_handler_hybrid_field_type *compatible,
                        uint *unique_cnt, uint *found_types)
  {
    detect_unique_handlers(compatible, unique_cnt, found_types);
  }
  /**
    Creates cmp_item instances for all unique handlers and stores
    them into m_comparators[].m_cmp_item, using the information previously
    populated by add_predicant(), add_value() and detect_unque_handlers().
  */
  bool make_unique_cmp_items(THD *thd, CHARSET_INFO *cs);
  void cleanup()
  {
    DBUG_ASSERT(m_comparators);
    for (uint i= 0; i < m_comparator_count; i++)
      m_comparators[i].cleanup();
    memset(m_comparators, 0, sizeof(m_comparators[0]) * m_comparator_count);
    m_comparator_count= 0;
    m_predicant_index= 0;
  }
  bool init_clone(THD *thd, uint nvalues)
  {
    m_comparator_count= 0;
    m_predicant_index= 0;
    return alloc_comparators(thd, nvalues);
  }
  /**
    @param [IN] args  - The argument list that was previously used with
                        add_predicant() and add_value().
    @param [OUT] idx  - In case if a value that is equal to the predicant
                        was found, the index of the matching value is returned
                        here. Otherwise, *idx is not changed.
    @param [IN/OUT] found_unknown_values - how to handle UNKNOWN results.
                        If found_unknown_values is NULL (e.g. Item_func_case),
                        cmp() returns immediately when the first UNKNOWN
                        result is found.
                        If found_unknown_values is non-NULL (Item_func_in),
                        cmp() does not return when an UNKNOWN result is found,
                        sets *found_unknown_values to true, and continues
                        to compare the remaining pairs to find FALSE
                        (i.e. the value that is equal to the predicant).

    @retval     false - Found a value that is equal to the predicant
    @retval     true  - Didn't find an equal value
  */
  bool cmp(Item_args *args, uint *idx, bool *found_unknown_values)
  {
    for (uint i= 0 ; i < m_comparator_count ; i++)
    {
      DBUG_ASSERT(m_comparators[i].m_handler != NULL);
      const int rc= cmp_arg(args, i);
      if (rc == FALSE)
      {
        *idx= m_comparators[i].m_arg_index;
        return false; // Found a matching value
      }
      if (rc == UNKNOWN)
      {
        if (!found_unknown_values)
          return true;
        *found_unknown_values= true;
      }
    }
    return true; // Not found
  }
  /*
    Same as above, but treats two NULLs as equal, e.g. as in DECODE_ORACLE().
  */
  bool cmp_nulls_equal(THD *thd, Item_args *args, uint *idx)
  {
    for (uint i= 0 ; i < m_comparator_count ; i++)
    {
      DBUG_ASSERT(m_comparators[i].m_handler != NULL);
      if (cmp_args_nulls_equal(thd, args, i) == FALSE)
      {
        *idx= m_comparators[i].m_arg_index;
        return false; // Found a matching value
      }
    }
    return true; // Not found
  }
};


/*
  The class Item_func_case is the CASE ... WHEN ... THEN ... END function
  implementation.
*/

class Item_func_case :public Item_func_case_expression
{
protected:
  String tmp_value;
  DTCollation cmp_collation;
  bool aggregate_then_and_else_arguments(THD *thd, uint count);
  virtual Item **else_expr_addr() const= 0;
  virtual Item *find_item()= 0;
  inline void print_when_then_arguments(String *str,
                                        enum_query_type query_type,
                                        Item **items, uint count);
  inline void print_else_argument(String *str, enum_query_type query_type,
                                  Item *item);
  void reorder_args(uint start);
public:
  Item_func_case(THD *thd, List<Item> &list)
   :Item_func_case_expression(thd, list)
  { }
  double real_op() override;
  longlong int_op() override;
  String *str_op(String *) override;
  my_decimal *decimal_op(my_decimal *) override;
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  bool native_op(THD *thd, Native *to) override;
  bool fix_fields(THD *thd, Item **ref) override;
  table_map not_null_tables() const override { return 0; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("case") };
    return name;
  }
  CHARSET_INFO *compare_collation() const { return cmp_collation.collation; }
  bool need_parentheses_in_default() override { return true; }
};


/*
  CASE WHEN cond THEN res [WHEN cond THEN res...] [ELSE res] END

  Searched CASE checks all WHEN expressions one after another.
  When some WHEN expression evaluated to TRUE then the
  value of the corresponding THEN expression is returned.
*/
class Item_func_case_searched: public Item_func_case
{
  uint when_count() const { return arg_count / 2; }
  bool with_else() const { return arg_count % 2; }
  Item **else_expr_addr() const override
  { return with_else() ? &args[arg_count - 1] : 0; }
public:
  Item_func_case_searched(THD *thd, List<Item> &list)
   :Item_func_case(thd, list)
  {
    DBUG_ASSERT(arg_count >= 2);
    reorder_args(0);
  }
  enum Functype functype() const override { return CASE_SEARCHED_FUNC; }
  void print(String *str, enum_query_type query_type) override;
  bool fix_length_and_dec() override;
  Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    // None of the arguments are in a comparison context
    Item_args::propagate_equal_fields(thd, Context_identity(), cond);
    return this;
  }
  Item *find_item() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_case_searched>(thd, this); }
};


/*
  CASE pred WHEN value THEN res [WHEN value THEN res...] [ELSE res] END

  When the predicant expression is specified then it is compared to each WHEN
  expression individually. When an equal WHEN expression is found
  the corresponding THEN expression is returned.
  In order to do correct comparisons several comparators are used. One for
  each result type. Different result types that are used in particular
  CASE ... END expression are collected in the fix_length_and_dec() member
  function and only comparators for there result types are used.
*/
class Item_func_case_simple: public Item_func_case,
                             public Predicant_to_list_comparator
{
protected:
  uint m_found_types;
  uint when_count() const { return (arg_count - 1) / 2; }
  bool with_else() const { return arg_count % 2 == 0; }
  Item **else_expr_addr() const override
  { return with_else() ? &args[arg_count - 1] : 0; }
  bool aggregate_switch_and_when_arguments(THD *thd, bool nulls_equal);
  bool prepare_predicant_and_values(THD *thd, uint *found_types,
                                              bool nulls_equal);
public:
  Item_func_case_simple(THD *thd, List<Item> &list)
   :Item_func_case(thd, list),
    Predicant_to_list_comparator(thd, arg_count),
    m_found_types(0)
  {
    DBUG_ASSERT(arg_count >= 3);
    reorder_args(1);
  }
  void cleanup() override
  {
    DBUG_ENTER("Item_func_case_simple::cleanup");
    Item_func::cleanup();
    Predicant_to_list_comparator::cleanup();
    DBUG_VOID_RETURN;
  }
  enum Functype functype() const override { return CASE_SIMPLE_FUNC; }
  void print(String *str, enum_query_type query_type) override;
  bool fix_length_and_dec() override;
  Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override;
  Item *find_item() override;
  Item *do_build_clone(THD *thd) const override
  {
    Item_func_case_simple *clone= (Item_func_case_simple *)
                                  Item_func_case::do_build_clone(thd);
    uint ncases= when_count();
    if (clone && clone->Predicant_to_list_comparator::init_clone(thd, ncases))
      return NULL;
    return clone;
  } 
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_case_simple>(thd, this); }
};


class Item_func_decode_oracle: public Item_func_case_simple
{
public:
  Item_func_decode_oracle(THD *thd, List<Item> &list)
   :Item_func_case_simple(thd, list)
  { }
  const Schema *schema() const override { return &oracle_schema_ref; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("decode") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  bool fix_length_and_dec() override;
  Item *find_item() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_decode_oracle>(thd, this); }
};


/*
  The Item_func_in class implements
  in_expr IN (<in value list>)
  and
  in_expr NOT IN (<in value list>)

  The current implementation distinguishes 2 cases:
  1) all items in <in value list> are constants and have the same
    result type. This case is handled by in_vector class,
    implementing fast bisection search.
  2) otherwise Item_func_in employs several cmp_item objects to perform
    comparisons of in_expr and an item from <in value list>. One cmp_item
    object for each result type. Different result types are collected in the
    fix_length_and_dec() member function by means of collect_cmp_types()
    function.

  Bisection is possible when:
  1. All types are similar
  2. All expressions in <in value list> are const
  In the presence of NULLs, the correct result of evaluating this item
  must be UNKNOWN or FALSE. To achieve that:
  - If type is scalar, we can use bisection and the "have_null" boolean.
  - If type is ROW, we will need to scan all of <in value list> when
    searching, so bisection is impossible. Unless:
  3. UNKNOWN and FALSE are equivalent results
  4. Neither left expression nor <in value list> contain any NULL value
*/
class Item_func_in :public Item_func_opt_neg,
                    public Predicant_to_list_comparator
{
  /**
     Usable if <in value list> is made only of constants. Returns true if one
     of these constants contains a NULL. Example:
     IN ( (-5, (12,NULL)), ... ).
  */
  bool list_contains_null();
  bool all_items_are_consts(Item **items, uint nitems) const
  {
    for (uint i= 0; i < nitems; i++)
    {
      if (!items[i]->can_eval_in_optimize())
        return false;
    }
    return true;
  }
  bool prepare_predicant_and_values(THD *thd, uint *found_types);
  bool check_arguments() const override
  {
    return check_argument_types_like_args0();
  }
protected:
  SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                             Field *field, Item *value) override;
  bool transform_into_subq;
  bool transform_into_subq_checked;
public:
  /// An array of values, created when the bisection lookup method is used
  in_vector *array;
  /**
    If there is some NULL among <in value list>, during a val_int() call; for
    example
    IN ( (1,(3,'col')), ... ), where 'col' is a column which evaluates to
    NULL.
  */
  bool have_null;
  /**
    true when all arguments of the IN list are of compatible types
    and can be used safely as comparisons for key conditions
  */
  bool arg_types_compatible;

  TABLE_LIST *emb_on_expr_nest;

  Item_func_in(THD *thd, List<Item> &list):
    Item_func_opt_neg(thd, list),
    Predicant_to_list_comparator(thd, arg_count - 1),
    transform_into_subq(false),
    transform_into_subq_checked(false),
    array(0), have_null(0),
    arg_types_compatible(FALSE), emb_on_expr_nest(0)
  { }
  bool val_bool() override;
  bool fix_fields(THD *, Item **) override;
  bool fix_length_and_dec() override;
  bool compatible_types_scalar_bisection_possible()
  {
    DBUG_ASSERT(m_comparator.cmp_type() != ROW_RESULT);
    return all_items_are_consts(args + 1, arg_count - 1);     // Bisection #2
  }
  bool compatible_types_row_bisection_possible()
  {
    DBUG_ASSERT(m_comparator.cmp_type() == ROW_RESULT);
    return all_items_are_consts(args + 1, arg_count - 1) &&   // Bisection #2
           ((is_top_level_item() && !negated) ||              // Bisection #3
            (!list_contains_null() && !args[0]->maybe_null())); // Bisection #4
  }
  bool agg_all_arg_charsets_for_comparison()
  {
    return agg_arg_charsets_for_comparison(cmp_collation, args, arg_count);
  }
  void fix_in_vector();
  bool value_list_convert_const_to_int(THD *thd);
  bool fix_for_scalar_comparison_using_bisection(THD *thd)
  {
    array= m_comparator.type_handler()->make_in_vector(thd, this, arg_count - 1);
    if (!array)      // OOM
      return true;
    fix_in_vector();
    return false;
  }
  bool fix_for_scalar_comparison_using_cmp_items(THD *thd, uint found_types);

  bool fix_for_row_comparison_using_cmp_items(THD *thd);
  bool fix_for_row_comparison_using_bisection(THD *thd);

  void cleanup() override
  {
    DBUG_ENTER("Item_func_in::cleanup");
    Item_int_func::cleanup();
    delete array;
    array= 0;
    Predicant_to_list_comparator::cleanup();
    DBUG_VOID_RETURN;
  }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
                      table_map usable_tables, SARGABLE_PARAM **sargables)
    override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
  SEL_TREE *get_func_row_mm_tree(RANGE_OPT_PARAM *param, Item_row *key_row); 
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    /*
      Note, we pass ANY_SUBST, this makes sure that non of the args
      will be replaced to a zero-filled Item_string.
      Such a change would require rebuilding of cmp_items.
    */
    if (arg_types_compatible)
    {
      Context cmpctx(ANY_SUBST, m_comparator.type_handler(),
                     Item_func_in::compare_collation());
      args[0]->propagate_equal_fields_and_change_item_tree(thd, cmpctx,
                                                           cond, &args[0]);
    }
    for (uint i= 0; i < comparator_count(); i++)
    {
      Context cmpctx(ANY_SUBST, get_comparator_type_handler(i),
                     Item_func_in::compare_collation());
      uint idx= get_comparator_arg_index(i);
      args[idx]->propagate_equal_fields_and_change_item_tree(thd, cmpctx,
                                                             cond, &args[idx]);
    }
    return this;
  }
  void print(String *str, enum_query_type query_type) override;
  enum Functype functype() const override { return IN_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("in") };
    return name;
  }
  enum precedence precedence() const override { return IN_PRECEDENCE; }
  bool eval_not_null_tables(void *opt_arg) override;
  bool find_not_null_fields(table_map allowed) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  bool count_sargable_conds(void *arg) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_in>(thd, this); }
  Item *do_build_clone(THD *thd) const override
  {
    Item_func_in *clone= (Item_func_in *) Item_func::do_build_clone(thd);
    if (clone)
    {
      clone->array= 0;
      if (clone->Predicant_to_list_comparator::init_clone(thd, arg_count - 1))
        return NULL;
    }
    return clone;
  }
  void mark_as_condition_AND_part(TABLE_LIST *embedding) override;
  bool to_be_transformed_into_in_subq(THD *thd);
  bool create_value_list_for_tvc(THD *thd, List< List<Item> > *values);
  Item *in_predicate_to_in_subs_transformer(THD *thd, uchar *arg) override;
  Item *in_predicate_to_equality_transformer(THD *thd, uchar *arg) override;
  uint32 max_length_of_left_expr();
};

class cmp_item_row :public cmp_item
{
  cmp_item **comparators;
  uint n;
  bool alloc_comparators(THD *thd, uint n);
  bool aggregate_row_elements_for_comparison(THD *thd,
                                             Type_handler_hybrid_field_type *cmp,
                                             Item_args *tmp,
                                             const LEX_CSTRING &funcname,
                                             uint col,
                                             uint level);
public:
  cmp_item_row(): comparators(0), n(0) {}
  ~cmp_item_row();
  void store_value(Item *item) override;
  bool prepare_comparators(THD *, const LEX_CSTRING &funcname,
                           const Item_args *args, uint level);
  int cmp(Item *arg) override;
  int cmp_not_null(const Value *) override
  {
    DBUG_ASSERT(false);
    return TRUE;
  }
  int compare(const cmp_item *arg) const override;
  cmp_item *make_same(THD *thd) override;
  bool store_value_by_template(THD *thd, cmp_item *tmpl, Item *) override;
  friend class Item_func_in;
  cmp_item *get_comparator(uint i) { return comparators[i]; }
};


class in_row :public in_vector
{
  cmp_item_row tmp;
public:
  in_row(THD *thd, uint elements, Item *);
  ~in_row();
  bool set(uint pos, Item *item) override;
  uchar *get_value(Item *item) override;
  friend class Item_func_in;
  const Type_handler *type_handler() const override { return &type_handler_row; }
  cmp_item *get_cmp_item() { return &tmp; }
};

/* Functions used by where clause */
class Item_func_null_predicate :public Item_bool_func
{
protected:
  SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                             Field *field, Item *value) override
  {
    DBUG_ENTER("Item_func_null_predicate::get_func_mm_tree");
    DBUG_RETURN(get_mm_parts(param, field, functype(), value));
  }
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
                       KEY_PART *key_part,
                       Item_func::Functype type, Item *value) override;
public:
  Item_func_null_predicate(THD *thd, Item *a): Item_bool_func(thd, a) { }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
                      table_map usable_tables, SARGABLE_PARAM **sargables)
    override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override
  {
    DBUG_ENTER("Item_func_null_predicate::get_mm_tree");
    SEL_TREE *ftree= get_full_func_mm_tree_for_args(param, args[0], NULL);
    if (!ftree)
      ftree= Item_func::get_mm_tree(param, cond_ptr);
    DBUG_RETURN(ftree);
  }
  CHARSET_INFO *compare_collation() const override
  { return args[0]->collation.collation; }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=1;
    base_flags&= ~item_base_t::MAYBE_NULL;
    return FALSE;
  }
  bool count_sargable_conds(void *arg) override;
};


class Item_func_isnull :public Item_func_null_predicate
{
public:
  Item_func_isnull(THD *thd, Item *a): Item_func_null_predicate(thd, a) {}
  bool val_bool() override;
  enum Functype functype() const override { return ISNULL_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("isnull") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override { return CMP_PRECEDENCE; }

  bool arg_is_datetime_notnull_field()
  {
    Item **args= arguments();
    if (args[0]->real_item()->type() == Item::FIELD_ITEM)
    {
      Field *field=((Item_field*) args[0]->real_item())->field;

      if ((field->flags & NOT_NULL_FLAG) &&
          field->type_handler()->cond_notnull_field_isnull_to_field_eq_zero())
        return true;
    }
    return false;
  }

  /* Optimize case of not_null_column IS NULL */
  void update_used_tables() override
  {
    if (!args[0]->maybe_null() && !arg_is_datetime_notnull_field())
    {
      used_tables_cache= 0;			/* is always false */
      const_item_cache= 1;
    }
    else
    {
      args[0]->update_used_tables();
      used_tables_cache= args[0]->used_tables();
      const_item_cache= args[0]->const_item();
    }
  }
  COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
                        bool top_level) override;
  table_map not_null_tables() const override { return 0; }
  bool find_not_null_fields(table_map allowed) override;
  Item *neg_transformer(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isnull>(thd, this); }
};

/* Functions used by HAVING for rewriting IN subquery */

class Item_in_subselect;

/* 
  This is like IS NOT NULL but it also remembers if it ever has
  encountered a NULL.
*/
class Item_is_not_null_test :public Item_func_isnull
{
  Item_in_subselect* owner;
public:
  Item_is_not_null_test(THD *thd, Item_in_subselect* ow, Item *a):
    Item_func_isnull(thd, a), owner(ow)
  {}
  enum Functype functype() const override { return ISNOTNULLTEST_FUNC; }
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<is_not_null_test>") };
    return name;
  }
  void update_used_tables() override;
  /*
    we add RAND_TABLE_BIT to prevent moving this item from HAVING to WHERE
  */
  table_map used_tables() const override
    { return used_tables_cache | RAND_TABLE_BIT; }
  bool const_item() const override { return FALSE; }
};


class Item_func_isnotnull :public Item_func_null_predicate
{
  bool abort_on_null;
public:
  Item_func_isnotnull(THD *thd, Item *a):
    Item_func_null_predicate(thd, a), abort_on_null(0)
  { }
  bool val_bool() override;
  enum Functype functype() const override { return ISNOTNULL_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("isnotnull") };
    return name;
  }
  enum precedence precedence() const override { return CMP_PRECEDENCE; }
  table_map not_null_tables() const override
  { return abort_on_null ? not_null_tables_cache : 0; }
  Item *neg_transformer(THD *thd) override;
  void print(String *str, enum_query_type query_type) override;
  void top_level_item() override { abort_on_null=1; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_isnotnull>(thd, this); }
};


class Item_func_like :public Item_bool_func2
{
  // Turbo Boyer-Moore data
  bool        canDoTurboBM;	// pattern is '%abcd%' case
  const char* pattern;
  int         pattern_len;

  // TurboBM buffers, *this is owner
  int* bmGs; //   good suffix shift table, size is pattern_len + 1
  int* bmBc; // bad character shift table, size is alphabet_size

  void turboBM_compute_suffixes(int* suff);
  void turboBM_compute_good_suffix_shifts(int* suff);
  void turboBM_compute_bad_character_shifts();
  bool turboBM_matches(const char* text, int text_len) const;
  enum { alphabet_size = 256 };

  Item *escape_item;

  bool escape_used_in_parsing;
  bool use_sampling;

  DTCollation cmp_collation;
  String cmp_value1, cmp_value2;
  bool with_sargable_pattern() const;
protected:
  SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
                             Field *field, Item *value) override
  {
    DBUG_ENTER("Item_func_like::get_func_mm_tree");
    DBUG_RETURN(get_mm_parts(param, field, LIKE_FUNC, value));
  }
  SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
                       KEY_PART *key_part,
                       Item_func::Functype type, Item *value) override;
public:
  int escape;
  bool negated;

  Item_func_like(THD *thd, Item *a, Item *b, Item *escape_arg, bool escape_used):
    Item_bool_func2(thd, a, b), canDoTurboBM(FALSE), pattern(0), pattern_len(0),
    bmGs(0), bmBc(0), escape_item(escape_arg),
    escape_used_in_parsing(escape_used), use_sampling(0), negated(0) {}

  bool get_negated() const { return negated; } // Used by ColumnStore

  Sql_mode_dependency value_depends_on_sql_mode() const override;
  bool val_bool() override;
  enum Functype functype() const override { return LIKE_FUNC; }
  void print(String *str, enum_query_type query_type) override;
  CHARSET_INFO *compare_collation() const override
  { return cmp_collation.collation; }
  cond_result eq_cmp_result() const override
  {
    /**
      We cannot always rewrite conditions as follows:
        from:  WHERE expr1=const AND expr1 LIKE expr2
        to:    WHERE expr1=const AND const LIKE expr2
      or
        from:  WHERE expr1=const AND expr2 LIKE expr1
        to:    WHERE expr1=const AND expr2 LIKE const

      because LIKE works differently comparing to the regular "=" operator:

      1. LIKE performs a stricter one-character-to-one-character comparison
         and does not recognize contractions and expansions.
         Replacing "expr1" to "const in LIKE would make the condition
         stricter in case of a complex collation.

      2. LIKE does not ignore trailing spaces and thus works differently
         from the "=" operator in case of "PAD SPACE" collations
         (which are the majority in MariaDB). So, for "PAD SPACE" collations:

         - expr1=const       - ignores trailing spaces
         - const LIKE expr2  - does not ignore trailing spaces
         - expr2 LIKE const  - does not ignore trailing spaces

      Allow only "binary" for now.
      It neither ignores trailing spaces nor has contractions/expansions.

      TODO:
      We could still replace "expr1" to "const" in "expr1 LIKE expr2"
      in case of a "PAD SPACE" collation, but only if "expr2" has '%'
      at the end.         
    */
    return compare_collation() == &my_charset_bin ? COND_TRUE : COND_OK;
  }
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
                      table_map usable_tables, SARGABLE_PARAM **sargables)
    override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    /*
      LIKE differs from the regular comparison operator ('=') in the following:
      - LIKE never ignores trailing spaces (even for PAD SPACE collations)
        Propagation of equal fields with a PAD SPACE collation into LIKE
        is not safe.
        Example:
          WHERE a='a ' AND a LIKE 'a'     - returns true for 'a'
        cannot be rewritten to:
          WHERE a='a ' AND 'a ' LIKE 'a'  - returns false for 'a'
        Note, binary collations in MySQL/MariaDB, e.g. latin1_bin,
        still have the PAD SPACE attribute and ignore trailing spaces!
      - LIKE does not take into account contractions, expansions,
        and ignorable characters.
        Propagation of equal fields with contractions/expansions/ignorables
        is also not safe.

      It's safe to propagate my_charset_bin (BINARY/VARBINARY/BLOB) values,
      because they do not ignore trailing spaces and have one-to-one mapping
      between a string and its weights.
      The below condition should be true only for my_charset_bin
      (as of version 10.1.7).
    */
    uint flags= Item_func_like::compare_collation()->state;
    if ((flags & MY_CS_NOPAD) && !(flags & MY_CS_NON1TO1))
      Item_args::propagate_equal_fields(thd,
                                        Context(ANY_SUBST,
                                                &type_handler_long_blob,
                                                compare_collation()),
                                        cond);
    return this;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("like") };
    return name;
  }
  enum precedence precedence() const override { return IN_PRECEDENCE; }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override
  {
    max_length= 1;
    Item_args old_predicant(args[0]);
    if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
      return true;
    raise_note_if_key_become_unused(current_thd, old_predicant);
    return false;
  }
  void cleanup() override;

  Item *neg_transformer(THD *thd) override
  {
    negated= !negated;
    return this;
  }

  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    return (walk_args(processor, walk_subquery, arg) ||
            escape_item->walk(processor, walk_subquery, arg) ||
            (this->*processor)(arg));
  }

  bool find_selective_predicates_list_processor(void *arg) override;
  
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_like>(thd, this); }
};


typedef struct pcre2_real_code_8 pcre2_code;
typedef struct pcre2_real_match_data_8 pcre2_match_data;
#define PCRE2_SIZE size_t
class Regexp_processor_pcre
{
  pcre2_code *m_pcre;
  pcre2_match_data *m_pcre_match_data;
  bool m_conversion_is_needed;
  bool m_is_const;
  int m_library_flags;
  CHARSET_INFO *m_library_charset;
  String m_prev_pattern;
  int m_pcre_exec_rc;
  PCRE2_SIZE *m_SubStrVec;
  void pcre_exec_warn(int rc) const;
  int pcre_exec_with_warn(const pcre2_code *code,
                          pcre2_match_data *data,
                          const char *subject, int length, int startoffset,
                          int options);
public:
  String *convert_if_needed(String *src, String *converter);
  String subject_converter;
  String pattern_converter;
  String replace_converter;
  Regexp_processor_pcre() :
    m_pcre(NULL), m_pcre_match_data(NULL),
    m_conversion_is_needed(true), m_is_const(0),
    m_library_flags(0),
    m_library_charset(&my_charset_utf8mb4_general_ci)
  {}
  int default_regex_flags();
  void init(CHARSET_INFO *data_charset, int extra_flags);
  bool fix_owner(Item_func *owner, Item *subject_arg, Item *pattern_arg);
  bool compile(String *pattern, bool send_error);
  bool compile(Item *item, bool send_error);
  bool recompile(Item *item)
  {
    return !m_is_const && compile(item, false);
  }
  bool exec(const char *str, size_t length, size_t offset);
  bool exec(String *str, int offset, uint n_result_offsets_to_convert);
  bool exec(Item *item, int offset, uint n_result_offsets_to_convert);
  bool match() const { return m_pcre_exec_rc < 0 ? 0 : 1; }
  int nsubpatterns() const { return m_pcre_exec_rc <= 0 ? 0 : m_pcre_exec_rc; }
  size_t subpattern_start(int n) const
  {
    return m_pcre_exec_rc <= 0 ? 0 : m_SubStrVec[n * 2];
  }
  size_t subpattern_end(int n) const
  {
    return m_pcre_exec_rc <= 0 ? 0 : m_SubStrVec[n * 2 + 1];
  }
  size_t subpattern_length(int n) const
  {
    return subpattern_end(n) - subpattern_start(n);
  }
  void reset()
  {
    m_pcre= NULL;
    m_pcre_match_data= NULL;
    m_prev_pattern.length(0);
  }
  void cleanup();
  bool is_compiled() const { return m_pcre != NULL; }
  bool is_const() const { return m_is_const; }
  void set_const(bool arg) { m_is_const= arg; }
  CHARSET_INFO * library_charset() const { return m_library_charset; }
};


class Item_func_regex :public Item_bool_func
{
  Regexp_processor_pcre re;
  DTCollation cmp_collation;
public:
  Item_func_regex(THD *thd, Item *a, Item *b): Item_bool_func(thd, a, b)
  {}
  void cleanup() override
  {
    DBUG_ENTER("Item_func_regex::cleanup");
    Item_bool_func::cleanup();
    re.cleanup();
    DBUG_VOID_RETURN;
  }
  bool val_bool() override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("regexp") };
    return name;
  }
  enum precedence precedence() const override { return IN_PRECEDENCE; }
  Item *do_get_copy(THD *thd) const override { return 0; }
  void print(String *str, enum_query_type query_type) override
  {
    print_op(str, query_type);
  }

  CHARSET_INFO *compare_collation() const override
  { return cmp_collation.collation; }
};


/*
  In the corner case REGEXP_INSTR could return (2^32 + 1),
  which would not fit into Item_long_func range.
  But string lengths are limited with max_allowed_packet,
  which cannot be bigger than 1024*1024*1024.
*/
class Item_func_regexp_instr :public Item_long_func
{
  bool check_arguments() const override
  {
    return (args[0]->check_type_can_return_str(func_name_cstring()) ||
            args[1]->check_type_can_return_text(func_name_cstring()));
  }
  Regexp_processor_pcre re;
  DTCollation cmp_collation;
public:
  Item_func_regexp_instr(THD *thd, Item *a, Item *b)
   :Item_long_func(thd, a, b)
  {}
  void cleanup() override
  {
    DBUG_ENTER("Item_func_regexp_instr::cleanup");
    Item_int_func::cleanup();
    re.cleanup();
    DBUG_VOID_RETURN;
  }
  longlong val_int() override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("regexp_instr") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override { return 0; }
};


typedef class Item COND;

class Item_cond :public Item_bool_func
{
protected:
  List<Item> list;
  bool abort_on_null;
  table_map and_tables_cache;

public:
  /* Item_cond() is only used to create top level items */
  Item_cond(THD *thd): Item_bool_func(thd), abort_on_null(1)
  { const_item_cache=0; }
  Item_cond(THD *thd, Item *i1, Item *i2);
  Item_cond(THD *thd, Item_cond *item);
  Item_cond(THD *thd, List<Item> &nlist):
    Item_bool_func(thd), list(nlist), abort_on_null(0) {}
  bool add(Item *item, MEM_ROOT *root)
  {
    DBUG_ASSERT(item);
    return list.push_back(item, root);
  }
  bool add_at_head(Item *item, MEM_ROOT *root)
  {
    DBUG_ASSERT(item);
    return list.push_front(item, root);
  }
  void add_at_head(List<Item> *nlist)
  {
    DBUG_ASSERT(nlist->elements);
    list.prepend(nlist);
  }
  void add_at_end(List<Item> *nlist)
  {
    DBUG_ASSERT(nlist->elements);
    list.append(nlist);
  }
  bool fix_fields(THD *, Item **ref) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;

  enum Type type() const override { return COND_ITEM; }
  List<Item>* argument_list() { return &list; }
  table_map used_tables() const override;
  void update_used_tables() override
  {
    used_tables_and_const_cache_init();
    used_tables_and_const_cache_update_and_join(list);
  }
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override;
  COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
                        bool top_level) override;
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
  void print(String *str, enum_query_type query_type) override;
  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
                      List<Item> &fields, uint flags) override;
  friend int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
                         COND **conds);
  void top_level_item() override { abort_on_null=1; }
  bool top_level() { return abort_on_null; }
  void copy_andor_arguments(THD *thd, Item_cond *item);
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
  Item *do_transform(THD *thd, Item_transformer transformer, uchar *arg,
                     bool toplevel);
  Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override
  {
    return do_transform(thd, transformer, arg, 0);
  }
  Item *top_level_transform(THD *thd, Item_transformer transformer, uchar *arg)
    override
  {
    return do_transform(thd, transformer, arg, 1);
  }
  void traverse_cond(Cond_traverser, void *arg, traverse_order order) override;
  void neg_arguments(THD *thd);
  Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) override;
  Item *do_compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                   Item_transformer transformer, uchar *arg_t, bool toplevel);
  Item *compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                Item_transformer transformer, uchar *arg_t) override
  {
    return do_compile(thd, analyzer, arg_p, transformer, arg_t, 0);
  }
  Item* top_level_compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                          Item_transformer transformer, uchar *arg_t) override
  {
    return do_compile(thd, analyzer, arg_p, transformer, arg_t, 1);
  }
  bool eval_not_null_tables(void *opt_arg) override;
  bool find_not_null_fields(table_map allowed) override;
  Item *do_build_clone(THD *thd) const override;
  bool excl_dep_on_table(table_map tab_map) override;
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override;

private:
  void merge_sub_condition(List_iterator<Item>& li);
};

template <template<class> class LI, class T> class Item_equal_iterator;

/*
  The class Item_equal is used to represent conjunctions of equality
  predicates of the form field1 = field2, and field=const in where
  conditions and on expressions.

  All equality predicates of the form field1=field2 contained in a
  conjunction are substituted for a sequence of items of this class.
  An item of this class Item_equal(f1,f2,...fk) represents a
  multiple equality f1=f2=...=fk.l

  If a conjunction contains predicates f1=f2 and f2=f3, a new item of
  this class is created Item_equal(f1,f2,f3) representing the multiple
  equality f1=f2=f3 that substitutes the above equality predicates in
  the conjunction.
  A conjunction of the predicates f2=f1 and f3=f1 and f3=f2 will be
  substituted for the item representing the same multiple equality
  f1=f2=f3.
  An item Item_equal(f1,f2) can appear instead of a conjunction of 
  f2=f1 and f1=f2, or instead of just the predicate f1=f2.

  An item of the class Item_equal inherits equalities from outer 
  conjunctive levels.

  Suppose we have a where condition of the following form:
  WHERE f1=f2 AND f3=f4 AND f3=f5 AND ... AND (...OR (f1=f3 AND ...)).
  In this case:
    f1=f2 will be substituted for Item_equal(f1,f2);
    f3=f4 and f3=f5  will be substituted for Item_equal(f3,f4,f5);
    f1=f3 will be substituted for Item_equal(f1,f2,f3,f4,f5);

  An object of the class Item_equal can contain an optional constant
  item c. Then it represents a multiple equality of the form 
  c=f1=...=fk.

  Objects of the class Item_equal are used for the following:

  1. An object Item_equal(t1.f1,...,tk.fk) allows us to consider any
  pair of tables ti and tj as joined by an equi-condition.
  Thus it provide us with additional access paths from table to table.

  2. An object Item_equal(t1.f1,...,tk.fk) is applied to deduce new
  SARGable predicates:
    f1=...=fk AND P(fi) => f1=...=fk AND P(fi) AND P(fj).
  It also can give us additional index scans and can allow us to
  improve selectivity estimates.

  3. An object Item_equal(t1.f1,...,tk.fk) is used to optimize the 
  selected execution plan for the query: if table ti is accessed 
  before the table tj then in any predicate P in the where condition
  the occurrence of tj.fj is substituted for ti.fi. This can allow
  an evaluation of the predicate at an earlier step.

  When feature 1 is supported they say that join transitive closure 
  is employed.
  When feature 2 is supported they say that search argument transitive
  closure is employed.
  Both features are usually supported by preprocessing original query and
  adding additional predicates.
  We do not just add predicates, we rather dynamically replace some
  predicates that can not be used to access tables in the investigated
  plan for those, obtained by substitution of some fields for equal fields,
  that can be used.     

  Prepared Statements/Stored Procedures note: instances of class
  Item_equal are created only at the time a PS/SP is executed and
  are deleted in the end of execution. All changes made to these
  objects need not be registered in the list of changes of the parse
  tree and do not harm PS/SP re-execution.

  Item equal objects are employed only at the optimize phase. Usually they are
  not supposed to be evaluated.  Yet in some cases we call the method val_int()
  for them. We have to take care of restricting the predicate such an
  object represents f1=f2= ...=fn to the projection of known fields fi1=...=fik.
*/

class Item_equal: public Item_bool_func
{
  /*
    The list of equal items. Currently the list can contain:
     - Item_fields items for references to table columns
     - Item_direct_view_ref items for references to view columns
     - one const item

    If the list contains a constant item this item is always first in the list.
    The list contains at least two elements.
    Currently all Item_fields/Item_direct_view_ref items in the list should
    refer to table columns with equavalent type definitions. In particular
    if these are string columns they should have the same charset/collation.

    Use objects of the companion class Item_equal_fields_iterator to iterate
    over all items from the list of the Item_field/Item_direct_view_ref classes.
  */ 
  List<Item> equal_items; 
  /* 
     TRUE <-> one of the items is a const item.
     Such item is always first in in the equal_items list
  */
  bool with_const;        
  /* 
    The field eval_item is used when this item is evaluated
    with the method val_int()
  */  
  cmp_item *eval_item;
  /*
    This initially is set to FALSE. It becomes TRUE when this item is evaluated
    as being always false. If the flag is TRUE the contents of the list 
    the equal_items should be ignored.
  */
  bool cond_false;
  /*
    This initially is set to FALSE. It becomes TRUE when this item is evaluated
    as being always true. If the flag is TRUE the contents of the list 
    the equal_items should be ignored.
  */
  bool cond_true;
  /*
    For Item_equal objects inside an OR clause: one of the fields that were
    used in the original equality.
  */
  Item_field *context_field;

  bool link_equal_fields;

  const Type_handler *m_compare_handler;
  CHARSET_INFO *m_compare_collation;
public:

  COND_EQUAL *upper_levels;       /* multiple equalities of upper and levels */

  Item_equal(THD *thd, const Type_handler *handler,
             Item *f1, Item *f2, bool with_const_item);
  Item_equal(THD *thd, Item_equal *item_equal);
  /* Currently the const item is always the first in the list of equal items */
  inline Item* get_const() { return with_const ? equal_items.head() : NULL; }
  void add_const(THD *thd, Item *c);
  /** Add a non-constant item to the multiple equality */
  void add(Item *f, MEM_ROOT *root) { equal_items.push_back(f, root); }
  bool contains(Field *field);
  Item* get_first(struct st_join_table *context, Item *field);
  /** Get number of field items / references to field items in this object */   
  uint n_field_items() { return equal_items.elements - MY_TEST(with_const); }
  void merge(THD *thd, Item_equal *item);
  bool merge_with_check(THD *thd, Item_equal *equal_item, bool save_merged);
  void merge_into_list(THD *thd, List<Item_equal> *list, bool save_merged,
                      bool only_intersected);
  void update_const(THD *thd);
  enum Functype functype() const override { return MULT_EQUAL_FUNC; }
  bool val_bool() override; 
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("multiple equal") };
    return name;
  }
  void sort(Item_field_cmpfunc compare, void *arg);
  bool fix_length_and_dec() override;
  bool fix_fields(THD *thd, Item **ref) override;
  void cleanup() override
  {
    delete eval_item;
    eval_item= NULL;
  }
  void update_used_tables() override;
  bool find_not_null_fields(table_map allowed) override;
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override;
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                      uint *and_level, table_map usable_tables,
                      SARGABLE_PARAM **sargables) override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
  Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
  void print(String *str, enum_query_type query_type) override;
  const Type_handler *compare_type_handler() const { return m_compare_handler; }
  CHARSET_INFO *compare_collation() const override
  { return m_compare_collation; }

  void set_context_field(Item_field *ctx_field) { context_field= ctx_field; }
  void set_link_equal_fields(bool flag) { link_equal_fields= flag; }
  Item* do_get_copy(THD *thd) const override { return 0; }
  /*
    This does not comply with the specification of the virtual method,
    but Item_equal items are processed distinguishly anyway
  */
  bool excl_dep_on_table(table_map tab_map) override
  {
    return used_tables() & tab_map;
  }
  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override;
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override;
  bool create_pushable_equalities(THD *thd, List<Item> *equalities,
                                  Pushdown_checker checker, uchar *arg,
                                  bool clone_const);
  /* Return the number of elements in this multiple equality */
  uint elements_count() { return equal_items.elements; }
  friend class Item_equal_fields_iterator;
  bool count_sargable_conds(void *arg) override;
  Item *multiple_equality_transformer(THD *thd, uchar *arg) override;
  friend class Item_equal_iterator<List_iterator_fast,Item>;
  friend class Item_equal_iterator<List_iterator,Item>;
  friend Item *eliminate_item_equal(THD *thd, COND *cond,
                                    COND_EQUAL *upper_levels,
                                    Item_equal *item_equal);
  friend bool setup_sj_materialization_part1(struct st_join_table *tab);
  friend bool setup_sj_materialization_part2(struct st_join_table *tab);
}; 

class COND_EQUAL: public Sql_alloc
{
public:
  uint max_members;               /* max number of members the current level
                                     list and all lower level lists */ 
  COND_EQUAL *upper_levels;       /* multiple equalities of upper and levels */
  List<Item_equal> current_level; /* list of multiple equalities of 
                                     the current and level           */
  COND_EQUAL()
  { 
    upper_levels= 0;
  }
  COND_EQUAL(Item_equal *item, MEM_ROOT *mem_root)
   :upper_levels(0)
  {
    current_level.push_back(item, mem_root);
  }
  void copy(COND_EQUAL &cond_equal)
  {
    max_members= cond_equal.max_members;
    upper_levels= cond_equal.upper_levels;
    if (cond_equal.current_level.is_empty())
      current_level.empty();
    else
      current_level= cond_equal.current_level;
  }
  bool is_empty()
  {
    return (current_level.elements == 0);
  }
};


/* 
  The template Item_equal_iterator is used to define classes
  Item_equal_fields_iterator and Item_equal_fields_iterator_slow.
  These are helper classes for the class Item equal
  Both classes are used to iterate over references to table/view columns
  from the list of equal items that included in an Item_equal object. 
  The second class supports the operation of removal of the current member
  from the list when performing an iteration.
*/ 

template <template<class> class LI, typename T> class Item_equal_iterator
  : public LI<T>
{
protected:
  Item_equal *item_equal;
  Item *curr_item= nullptr;
public:
  Item_equal_iterator(Item_equal &item_eq)
    :LI<T> (item_eq.equal_items), item_equal(&item_eq)
  {
    if (item_eq.with_const)
    {
      LI<T> *list_it= this;
      curr_item=  (*list_it)++;
    }
  }
  Item* operator++(int)
  { 
    LI<T> *list_it= this;
    curr_item= (*list_it)++;
    return curr_item;
  }
  void rewind(void) 
  { 
    LI<T> *list_it= this;
    list_it->rewind();
    if (item_equal->with_const)
      curr_item= (*list_it)++;
  }  
  Field *get_curr_field()
  {
    Item_field *item= (Item_field *) (curr_item->real_item());
     return item->field;
  }  
};

typedef  Item_equal_iterator<List_iterator_fast,Item >  Item_equal_iterator_fast;

class Item_equal_fields_iterator
  :public Item_equal_iterator_fast
{
public:
  Item_equal_fields_iterator(Item_equal &item_eq) 
    :Item_equal_iterator_fast(item_eq)
  { }
  Item ** ref()
  {
    return List_iterator_fast<Item>::ref();
  }
};

typedef Item_equal_iterator<List_iterator,Item > Item_equal_iterator_iterator_slow;

class Item_equal_fields_iterator_slow
  :public Item_equal_iterator_iterator_slow
{
public:
  Item_equal_fields_iterator_slow(Item_equal &item_eq) 
    :Item_equal_iterator_iterator_slow(item_eq)
  { }
  void remove()
  {
    List_iterator<Item>::remove();
  }
};


class Item_cond_and final :public Item_cond
{
public:
  COND_EQUAL m_cond_equal;  /* contains list of Item_equal objects for 
                               the current and level and reference
                               to multiple equalities of upper and levels */  
  Item_cond_and(THD *thd): Item_cond(thd) {}
  Item_cond_and(THD *thd, Item *i1,Item *i2): Item_cond(thd, i1, i2) {}
  Item_cond_and(THD *thd, Item_cond_and *item): Item_cond(thd, item) {}
  Item_cond_and(THD *thd, List<Item> &list_arg): Item_cond(thd, list_arg) {}
  enum Functype functype() const override { return COND_AND_FUNC; }
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("and") };
    return name;
  }
  enum precedence precedence() const override { return AND_PRECEDENCE; }
  table_map not_null_tables() const override
  { return abort_on_null ? not_null_tables_cache: and_tables_cache; }
  Item *copy_andor_structure(THD *thd) override;
  Item *neg_transformer(THD *thd) override;
  void mark_as_condition_AND_part(TABLE_LIST *embedding) override;
  uint exists2in_reserved_items() override { return list.elements; };
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override;
  bool set_format_by_check_constraint(Send_field_extended_metadata *to) const
    override;
  void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
                      table_map usable_tables, SARGABLE_PARAM **sargables)
    override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cond_and>(thd, this); }
};

inline bool is_cond_and(Item *item)
{
  Item_func *func_item= item->get_item_func();
  return func_item && func_item->functype() == Item_func::COND_AND_FUNC;
}

class Item_cond_or final :public Item_cond
{
public:
  Item_cond_or(THD *thd): Item_cond(thd) {}
  Item_cond_or(THD *thd, Item *i1,Item *i2): Item_cond(thd, i1, i2) {}
  Item_cond_or(THD *thd, Item_cond_or *item): Item_cond(thd, item) {}
  Item_cond_or(THD *thd, List<Item> &list_arg): Item_cond(thd, list_arg) {}
  enum Functype functype() const override { return COND_OR_FUNC; }
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("or") };
    return name;
  }
  enum precedence precedence() const override { return OR_PRECEDENCE; }
  table_map not_null_tables() const override { return and_tables_cache; }
  Item *copy_andor_structure(THD *thd) override;
  Item *neg_transformer(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cond_or>(thd, this); }
};

class Item_func_dyncol_check :public Item_bool_func
{
public:
  Item_func_dyncol_check(THD *thd, Item *str): Item_bool_func(thd, str) {}
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_check") };
    return name;
  }
  bool need_parentheses_in_default() override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dyncol_check>(thd, this); }
};

class Item_func_dyncol_exists :public Item_bool_func
{
public:
  Item_func_dyncol_exists(THD *thd, Item *str, Item *num):
    Item_bool_func(thd, str, num) {}
  bool val_bool() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_exists") };
    return name;
  }
  bool need_parentheses_in_default() override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dyncol_exists>(thd, this); }
};


class Item_func_cursor_bool_attr: public Item_bool_func, public Cursor_ref
{
public:
  Item_func_cursor_bool_attr(THD *thd, const LEX_CSTRING *name, uint offset)
   :Item_bool_func(thd), Cursor_ref(name, offset)
  { }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), arg, VCOL_SESSION_FUNC);
  }
  void print(String *str, enum_query_type query_type) override
  {
    Cursor_ref::print_func(str, func_name_cstring());
  }
};


class Item_func_cursor_isopen: public Item_func_cursor_bool_attr
{
public:
  Item_func_cursor_isopen(THD *thd, const LEX_CSTRING *name, uint offset)
   :Item_func_cursor_bool_attr(thd, name, offset) { }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("%ISOPEN") };
    return name;
  }
  bool val_bool() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_cursor_isopen>(thd, this); }
};


class Item_func_cursor_found: public Item_func_cursor_bool_attr
{
public:
  Item_func_cursor_found(THD *thd, const LEX_CSTRING *name, uint offset)
   :Item_func_cursor_bool_attr(thd, name, offset)
  {
    set_maybe_null();
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("%FOUND") };
    return name;
  }
  bool val_bool() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_cursor_found>(thd, this); }
};


class Item_func_cursor_notfound: public Item_func_cursor_bool_attr
{
public:
  Item_func_cursor_notfound(THD *thd, const LEX_CSTRING *name, uint offset)
   :Item_func_cursor_bool_attr(thd, name, offset)
  {
    set_maybe_null();
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("%NOTFOUND") };
    return name;
  }
  bool val_bool() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_cursor_notfound>(thd, this); }
};



inline bool is_cond_or(Item *item)
{
  Item_func *func_item= item->get_item_func();
  return func_item && func_item->functype() == Item_func::COND_OR_FUNC;
}

Item *and_expressions(Item *a, Item *b, Item **org_item);

class Comp_creator
{
public:
  Comp_creator() = default;                           /* Remove gcc warning */
  virtual ~Comp_creator() = default;                  /* Remove gcc warning */
  /**
    Create operation with given arguments.
  */
  virtual Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b)
                                           const = 0;
  /**
    Create operation with given arguments in swap order.
  */
  virtual Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b)
                                                const = 0;
  virtual const char* symbol(bool invert) const = 0;
  virtual bool eqne_op() const = 0;
  virtual bool l_op() const = 0;
};

class Eq_creator :public Comp_creator
{
public:
  Eq_creator() = default;                             /* Remove gcc warning */
  virtual ~Eq_creator() = default;                    /* Remove gcc warning */
  Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override;
  Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override;
  const char* symbol(bool invert) const override { return invert? "<>" : "="; }
  bool eqne_op() const override { return 1; }
  bool l_op() const override { return 0; }
};

class Ne_creator :public Comp_creator
{
public:
  Ne_creator() = default;                             /* Remove gcc warning */
  virtual ~Ne_creator() = default;                    /* Remove gcc warning */
  Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override;
  Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override;
  const char* symbol(bool invert) const override { return invert? "=" : "<>"; }
  bool eqne_op() const override { return 1; }
  bool l_op() const override { return 0; }
};

class Gt_creator :public Comp_creator
{
public:
  Gt_creator() = default;                             /* Remove gcc warning */
  virtual ~Gt_creator() = default;                    /* Remove gcc warning */
  Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override;
  Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override;
  const char* symbol(bool invert) const override { return invert? "<=" : ">"; }
  bool eqne_op() const override { return 0; }
  bool l_op() const override { return 0; }
};

class Lt_creator :public Comp_creator
{
public:
  Lt_creator() = default;                             /* Remove gcc warning */
  virtual ~Lt_creator() = default;                    /* Remove gcc warning */
  Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override;
  Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override;
  const char* symbol(bool invert) const override { return invert? ">=" : "<"; }
  bool eqne_op() const override { return 0; }
  bool l_op() const override { return 1; }
};

class Ge_creator :public Comp_creator
{
public:
  Ge_creator() = default;                             /* Remove gcc warning */
  virtual ~Ge_creator() = default;                    /* Remove gcc warning */
  Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override;
  Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override;
  const char* symbol(bool invert) const override { return invert? "<" : ">="; }
  bool eqne_op() const override { return 0; }
  bool l_op() const override { return 0; }
};

class Le_creator :public Comp_creator
{
public:
  Le_creator() = default;                             /* Remove gcc warning */
  virtual ~Le_creator() = default;                    /* Remove gcc warning */
  Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override;
  Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override;
  const char* symbol(bool invert) const override { return invert? ">" : "<="; }
  bool eqne_op() const override { return 0; }
  bool l_op() const override { return 1; }
};

/*
  These need definitions from this file but the variables are defined
  in mysqld.h. The variables really belong in this component, but for
  the time being we leave them in mysqld.cc to avoid merge problems.
*/
extern Eq_creator eq_creator;
extern Ne_creator ne_creator;
extern Gt_creator gt_creator;
extern Lt_creator lt_creator;
extern Ge_creator ge_creator;
extern Le_creator le_creator;

#endif /* ITEM_CMPFUNC_INCLUDED */
server/private/wsrep_xid.h000064400000003015150400263770011704 0ustar00/* Copyright (C) 2015-2025 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA. */

#ifndef WSREP_XID_H
#define WSREP_XID_H

#include <my_config.h>

#ifdef WITH_WSREP

#include "wsrep_mysqld.h"
#include "wsrep/gtid.hpp"
#include "handler.h" // XID typedef

void wsrep_xid_init(xid_t*, const wsrep::gtid&, const wsrep_server_gtid_t&);
const wsrep::id& wsrep_xid_uuid(const XID&);
wsrep::seqno wsrep_xid_seqno(const XID&);

template<typename T> T wsrep_get_SE_checkpoint();
bool wsrep_set_SE_checkpoint(const wsrep::gtid& gtid, const wsrep_server_gtid_t&);
//void wsrep_get_SE_checkpoint(XID&);             /* uncomment if needed */
//void wsrep_set_SE_checkpoint(XID&);             /* uncomment if needed */

void wsrep_sort_xid_array(XID *array, int len);
std::string wsrep_xid_print(const XID *xid);
bool wsrep_is_xid_gtid_undefined(const XID *xid);

#endif /* WITH_WSREP */
#endif /* WSREP_UTILS_H */
server/private/rijndael.h000064400000003257150400263770011500 0ustar00#ifndef RIJNDAEL_INCLUDED
#define RIJNDAEL_INCLUDED

/* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

 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 */


/*
  rijndael-alg-fst.h

  @version 3.0 (December 2000)
  Optimised ANSI C code for the Rijndael cipher (now AES)
  @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
  @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
  @author Paulo Barreto <paulo.barreto@terra.com.br>

  This code is hereby placed in the public domain.
  Modified by Peter Zaitsev to fit MySQL coding style.
 */

#define AES_MAXKC	(256/32)
#define AES_MAXKB	(256/8)
#define AES_MAXNR	14

int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
			int keyBits);
int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
			int keyBits);
void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
		     const uint8 pt[16], uint8 ct[16]);
void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
		     const uint8 ct[16], uint8 pt[16]);

#endif /* RIJNDAEL_INCLUDED */
server/private/sql_load.h000064400000002374150400263770011505 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_LOAD_INCLUDED
#define SQL_LOAD_INCLUDED

#include "sql_list.h"                           /* List */

class Item;

#include "sql_class.h"                          /* enum_duplicates */

class sql_exchange;

int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
	        List<Item> &fields_vars, List<Item> &set_fields,
                List<Item> &set_values_list,
                enum enum_duplicates handle_duplicates, bool ignore,
                bool local_file);


#endif /* SQL_LOAD_INCLUDED */
server/private/sql_array.h000064400000015333150400263770011703 0ustar00#ifndef SQL_ARRAY_INCLUDED
#define SQL_ARRAY_INCLUDED

/* Copyright (c) 2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.
   Copyright (c) 2020, 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 <my_sys.h>

/**
   A wrapper class which provides array bounds checking.
   We do *not* own the array, we simply have a pointer to the first element,
   and a length.

   @remark
   We want the compiler-generated versions of:
   - the copy CTOR (memberwise initialization)
   - the assignment operator (memberwise assignment)

   @param Element_type The type of the elements of the container.
 */
template <typename Element_type> class Bounds_checked_array
{
public:
  Bounds_checked_array()= default;

  Bounds_checked_array(Element_type *el, size_t size_arg)
    : m_array(el), m_size(size_arg)
  {}

  void reset() { m_array= NULL; m_size= 0; }
 
  void reset(Element_type *array_arg, size_t size_arg)
  {
    m_array= array_arg;
    m_size= size_arg;
  }

  /**
    Set a new bound on the array. Does not resize the underlying
    array, so the new size must be smaller than or equal to the
    current size.
   */
  void resize(size_t new_size)
  {
    DBUG_ASSERT(new_size <= m_size);
    m_size= new_size;
  }

  Element_type &operator[](size_t n)
  {
    DBUG_ASSERT(n < m_size);
    return m_array[n];
  }

  const Element_type &operator[](size_t n) const
  {
    DBUG_ASSERT(n < m_size);
    return m_array[n];
  }

  size_t element_size() const { return sizeof(Element_type); }
  size_t size() const         { return m_size; }

  bool is_null() const { return m_array == NULL; }

  void pop_front()
  {
    DBUG_ASSERT(m_size > 0);
    m_array+= 1;
    m_size-= 1;
  }

  Element_type *array() const { return m_array; }

  Element_type *begin() const { return array(); }
  Element_type *end() const { return array() + m_size; }


  bool operator==(const Bounds_checked_array<Element_type>&rhs) const
  {
    return m_array == rhs.m_array && m_size == rhs.m_size;
  }
  bool operator!=(const Bounds_checked_array<Element_type>&rhs) const
  {
    return m_array != rhs.m_array || m_size != rhs.m_size;
  }

private:
  Element_type *m_array= nullptr;
  size_t        m_size= 0;
};

/*
  A typesafe wrapper around DYNAMIC_ARRAY

  TODO: Change creator to take a THREAD_SPECIFIC option.
*/

template <class Elem> class Dynamic_array
{
  DYNAMIC_ARRAY array;
public:
  Dynamic_array(PSI_memory_key psi_key, uint prealloc=16, uint increment=16)
  {
    init(psi_key, prealloc, increment);
  }

  Dynamic_array(MEM_ROOT *root, uint prealloc=16, uint increment=16)
  {
    void *init_buffer= alloc_root(root, sizeof(Elem) * prealloc);
    init_dynamic_array2(root->m_psi_key, &array, sizeof(Elem), init_buffer,
                           prealloc, increment, MYF(0));
  }

  void init(PSI_memory_key psi_key, uint prealloc=16, uint increment=16)
  {
    init_dynamic_array2(psi_key, &array, sizeof(Elem), 0, prealloc, increment, MYF(0));
  }

  /**
     @note Though formally this could be declared "const" it would be
     misleading at it returns a non-const pointer to array's data.
  */
  Elem& at(size_t idx)
  {
    DBUG_ASSERT(idx < array.elements);
    return *(((Elem*)array.buffer) + idx);
  }

  /// Const variant of at(), which cannot change data
  const Elem& at(size_t idx) const
  {
    return *(((Elem*)array.buffer) + idx);
  }

  Elem& operator[](size_t idx)
  {
    return at(idx);
  }

  /// Const variant of operator[]
  const Elem& operator[](size_t idx) const
  {
    return at(idx);
  }

  /// @returns pointer to first element
  Elem *front()
  {
    return (Elem*)array.buffer;
  }

  /// @returns pointer to first element
  const Elem *front() const
  {
    return (const Elem*)array.buffer;
  }

  /// @returns pointer to last element
  Elem *back()
  {
    return ((Elem*)array.buffer) + array.elements - 1;
  }

  /// @returns pointer to last element
  const Elem *back() const
  {
    return ((const Elem*)array.buffer) + array.elements - 1;
  }

  size_t size() const { return array.elements; }

  const Elem *end() const
  {
    return back() + 1;
  }

  /// @returns pointer to n-th element
  Elem *get_pos(size_t idx)
  {
    return ((Elem*)array.buffer) + idx;
  }

  /// @returns pointer to n-th element
  const Elem *get_pos(size_t idx) const
  {
    return ((const Elem*)array.buffer) + idx;
  }

  /**
     @retval false ok
     @retval true  OOM, @c my_error() has been called.
  */
  bool append(const Elem &el)
  {
    return insert_dynamic(&array, &el);
  }

  bool append_val(Elem el)
  {
    return (insert_dynamic(&array, (uchar*)&el));
  }

  bool push(Elem &el)
  {
    return append(el);
  }

  /// Pops the last element. Does nothing if array is empty.
  Elem& pop()
  {
    return *((Elem*)pop_dynamic(&array));
  }

  void del(size_t idx)
  {
    DBUG_ASSERT(idx <= array.max_element);
    delete_dynamic_element(&array, (uint)idx);
  }

  size_t elements() const
  {
    return array.elements;
  }

  void elements(size_t num_elements)
  {
    DBUG_ASSERT(num_elements <= array.max_element);
    array.elements= (uint)num_elements;
  }

  void clear()
  {
    elements(0);
  }

  void set(uint idx, const Elem &el)
  {
    set_dynamic(&array, &el, idx);
  }

  void freeze()
  {
    freeze_size(&array);
  }

  bool reserve(size_t new_size)
  {
    return allocate_dynamic(&array, (uint)new_size);
  }


  bool resize(size_t new_size, Elem default_val)
  {
    size_t old_size= elements();
    if (reserve(new_size))
      return true;
    
    if (new_size > old_size)
    {
      set_dynamic(&array, (uchar*)&default_val, (uint)(new_size - 1));
      /*for (size_t i= old_size; i != new_size; i++)
      {
        at(i)= default_val;
      }*/
    }
    return false;
  }

  ~Dynamic_array()
  {
    delete_dynamic(&array);
  }

  void free_memory()
  {
    delete_dynamic(&array);
  }

  void sort(int (*cmp_func)(const void *, const void *))
  {
    my_qsort(array.buffer, array.elements, sizeof(Elem), cmp_func);
  }

  void sort(qsort_cmp2 cmp_func, void *data)
  {
    my_qsort2(array.buffer, array.elements, sizeof(Elem), cmp_func, data);
  }
};

typedef Bounds_checked_array<Item*> Ref_ptr_array;

#endif /* SQL_ARRAY_INCLUDED */
server/private/rpl_record_old.h000064400000002577150400263770012705 0ustar00/* Copyright (c) 2007, 2010, Oracle and/or its affiliates.

   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 */

#ifndef RPL_RECORD_OLD_H
#define RPL_RECORD_OLD_H

#include "log_event.h"                          /* Log_event_type */

#ifndef MYSQL_CLIENT
size_t pack_row_old(TABLE *table, MY_BITMAP const* cols,
                    uchar *row_data, const uchar *record);

#ifdef HAVE_REPLICATION
int unpack_row_old(rpl_group_info *rgi,
                   TABLE *table, uint const colcnt, uchar *record,
                   uchar const *row, uchar const *row_buffer_end,
                   MY_BITMAP const *cols,
                   uchar const **row_end, ulong *master_reclength,
                   MY_BITMAP* const rw_set,
                   Log_event_type const event_type);
#endif
#endif
#endif
server/private/socketpair.h000064400000001512150400263770012044 0ustar00/* Copyright (c) 2023, MariaDB Plc

   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-1301  USA */

#ifdef _WIN32
C_MODE_START
  int create_socketpair(SOCKET socks[2]);
  void close_socketpair(SOCKET socks[2]);
C_MODE_END
#endif /* _WIN32 */
server/private/item.h000064400001041224150400263770010643 0ustar00#ifndef SQL_ITEM_INCLUDED
#define SQL_ITEM_INCLUDED

/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
   Copyright (c) 2009, 2022, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "sql_priv.h"                /* STRING_BUFFER_USUAL_SIZE */
#include "unireg.h"
#include "sql_const.h"                 /* RAND_TABLE_BIT, MAX_FIELD_NAME */
#include "field.h"                              /* Derivation */
#include "sql_type.h"
#include "sql_time.h"
#include "sql_schema.h"
#include "mem_root_array.h"
#include <typeinfo>

#include "cset_narrowing.h"

C_MODE_START
#include <ma_dyncol.h>

/*
  A prototype for a C-compatible structure to store a value of any data type.
  Currently it has to stay in /sql, as it depends on String and my_decimal.
  We'll do the following changes:
  1. add pure C "struct st_string" and "struct st_my_decimal"
  2. change type of m_string to struct st_string and move inside the union
  3. change type of m_decmal to struct st_my_decimal and move inside the union
  4. move the definition to some file in /include
*/
class st_value
{
public:
  st_value() {}
  st_value(char *buffer, size_t buffer_size) :
  m_string(buffer, buffer_size, &my_charset_bin)
  {}
  enum enum_dynamic_column_type m_type;
  union
  {
    longlong m_longlong;
    double m_double;
    MYSQL_TIME m_time;
  } value;
  String m_string;
  my_decimal m_decimal;
};

C_MODE_END


class Value: public st_value
{
public:
  Value(char *buffer, size_t buffer_size) : st_value(buffer, buffer_size)
  {}
  Value()
  {}
  bool is_null() const { return m_type == DYN_COL_NULL; }
  bool is_longlong() const
  {
    return m_type == DYN_COL_UINT || m_type == DYN_COL_INT;
  }
  bool is_double() const { return m_type == DYN_COL_DOUBLE; }
  bool is_temporal() const { return m_type == DYN_COL_DATETIME; }
  bool is_string() const { return m_type == DYN_COL_STRING; }
  bool is_decimal() const { return m_type == DYN_COL_DECIMAL; }
};


template<size_t buffer_size>
class ValueBuffer: public Value
{
  char buffer[buffer_size];
public:
  ValueBuffer(): Value(buffer, buffer_size)
  {}
  void reset_buffer()
  {
    m_string.set_buffer_if_not_allocated(buffer, buffer_size, &my_charset_bin);
  }
};


#ifdef DBUG_OFF
static inline const char *dbug_print_item(Item *item) { return NULL; }
#else
const char *dbug_print_item(Item *item);
#endif

class Virtual_tmp_table;
class sp_head;
class Protocol;
struct TABLE_LIST;
void item_init(void);			/* Init item functions */
class Item_basic_value;
class Item_result_field;
class Item_field;
class Item_ref;
class Item_param;
class user_var_entry;
class JOIN;
struct KEY_FIELD;
struct SARGABLE_PARAM;
class RANGE_OPT_PARAM;
class SEL_TREE;

enum precedence {
  LOWEST_PRECEDENCE,
  ASSIGN_PRECEDENCE,    // :=
  OR_PRECEDENCE,        // OR, || (unless PIPES_AS_CONCAT)
  XOR_PRECEDENCE,       // XOR
  AND_PRECEDENCE,       // AND, &&
  NOT_PRECEDENCE,       // NOT (unless HIGH_NOT_PRECEDENCE)
  CMP_PRECEDENCE,       // =, <=>, >=, >, <=, <, <>, !=, IS
  BETWEEN_PRECEDENCE,   // BETWEEN
  IN_PRECEDENCE,        // IN, LIKE, REGEXP
  BITOR_PRECEDENCE,     // |
  BITAND_PRECEDENCE,    // &
  SHIFT_PRECEDENCE,     // <<, >>
  INTERVAL_PRECEDENCE,  // first argument in +INTERVAL
  ADD_PRECEDENCE,       // +, -
  MUL_PRECEDENCE,       // *, /, DIV, %, MOD
  BITXOR_PRECEDENCE,    // ^
  PIPES_PRECEDENCE,     // || (if PIPES_AS_CONCAT)
  NEG_PRECEDENCE,       // unary -, ~, !, NOT (if HIGH_NOT_PRECEDENCE)
  COLLATE_PRECEDENCE,   // BINARY, COLLATE
  DEFAULT_PRECEDENCE,
  HIGHEST_PRECEDENCE
};

bool mark_unsupported_function(const char *where, void *store, uint result);

/* convenience helper for mark_unsupported_function() above */
bool mark_unsupported_function(const char *w1, const char *w2,
                               void *store, uint result);

/* Bits for the split_sum_func() function */
#define SPLIT_SUM_SKIP_REGISTERED 1     /* Skip registered funcs */
#define SPLIT_SUM_SELECT 2		/* SELECT item; Split all parts */

/*
  Values for item->marker for cond items in the WHERE clause as used
  by the optimizer.

  Note that for Item_fields, the marker contains
  'select->cur_pos_in_select_list
*/
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
#define MARKER_UNDEF_POS      -1
#define MARKER_UNUSED         0
#define MARKER_CHANGE_COND    1
#define MARKER_PROCESSED      2
#define MARKER_CHECK_ON_READ  3
#define MARKER_NULL_KEY       4
#define MARKER_FOUND_IN_ORDER 6

/* Used as bits in marker by Item::check_pushable_cond() */
#define MARKER_NO_EXTRACTION              (1 << 6)
#define MARKER_FULL_EXTRACTION            (1 << 7)
#define MARKER_DELETION                   (1 << 8)
#define MARKER_IMMUTABLE                  (1 << 9)
#define MARKER_SUBSTITUTION               (1 << 10)

/* Used as bits in marker by window functions */
#define MARKER_SORTORDER_CHANGE           (1 << 11)
#define MARKER_PARTITION_CHANGE           (1 << 12)
#define MARKER_FRAME_CHANGE               (1 << 13)
#define MARKER_EXTRACTION_MASK                                         \
  (MARKER_NO_EXTRACTION | MARKER_FULL_EXTRACTION | MARKER_DELETION |   \
   MARKER_IMMUTABLE)

extern const char *item_empty_name;

void dummy_error_processor(THD *thd, void *data);

void view_error_processor(THD *thd, void *data);

typedef List<TABLE_LIST>* ignored_tables_list_t;
bool ignored_list_includes_table(ignored_tables_list_t list, TABLE_LIST *tbl);

/*
  Instances of Name_resolution_context store the information necessary for
  name resolution of Items and other context analysis of a query made in
  fix_fields().

  This structure is a part of SELECT_LEX, a pointer to this structure is
  assigned when an item is created (which happens mostly during  parsing
  (sql_yacc.yy)), but the structure itself will be initialized after parsing
  is complete

  TODO: move subquery of INSERT ... SELECT and CREATE ... SELECT to
  separate SELECT_LEX which allow to remove tricks of changing this
  structure before and after INSERT/CREATE and its SELECT to make correct
  field name resolution.
*/
struct Name_resolution_context: Sql_alloc
{
  /*
    The name resolution context to search in when an Item cannot be
    resolved in this context (the context of an outer select)
  */
  Name_resolution_context *outer_context= nullptr;

  /*
    List of tables used to resolve the items of this context.  Usually these
    are tables from the FROM clause of SELECT statement.  The exceptions are
    INSERT ... SELECT and CREATE ... SELECT statements, where SELECT
    subquery is not moved to a separate SELECT_LEX.  For these types of
    statements we have to change this member dynamically to ensure correct
    name resolution of different parts of the statement.
  */
  TABLE_LIST *table_list= nullptr;
  /*
    In most cases the two table references below replace 'table_list' above
    for the purpose of name resolution. The first and last name resolution
    table references allow us to search only in a sub-tree of the nested
    join tree in a FROM clause. This is needed for NATURAL JOIN, JOIN ... USING
    and JOIN ... ON. 
  */
  TABLE_LIST *first_name_resolution_table= nullptr;
  /*
    Last table to search in the list of leaf table references that begins
    with first_name_resolution_table.
  */
  TABLE_LIST *last_name_resolution_table= nullptr;

  /* Cache first_name_resolution_table in setup_natural_join_row_types */
  TABLE_LIST *natural_join_first_table= nullptr;
  /*
    SELECT_LEX item belong to, in case of merged VIEW it can differ from
    SELECT_LEX where item was created, so we can't use table_list/field_list
    from there
  */
  st_select_lex *select_lex= nullptr;

  /*
    Processor of errors caused during Item name resolving, now used only to
    hide underlying tables in errors about views (i.e. it substitute some
    errors for views)
  */
  void (*error_processor)(THD *, void *)= &dummy_error_processor;
  void *error_processor_data= nullptr;

  /*
    When TRUE items are resolved in this context both against the
    SELECT list and this->table_list. If FALSE, items are resolved
    only against this->table_list.
  */
  bool resolve_in_select_list= false;

  /*
    Bitmap of tables that should be ignored when doing name resolution.
    Normally it is {0}. Non-zero values are used by table functions.
  */
  ignored_tables_list_t ignored_tables= nullptr;

  /*
    Security context of this name resolution context. It's used for views
    and is non-zero only if the view is defined with SQL SECURITY DEFINER.
  */
  Security_context *security_ctx= nullptr;

  Name_resolution_context() = default;

  /**
    Name resolution context with resolution in only one table
  */
  Name_resolution_context(TABLE_LIST *table) :
    first_name_resolution_table(table), last_name_resolution_table(table)
  {}

  void init()
  {
    resolve_in_select_list= FALSE;
    error_processor= &dummy_error_processor;
    ignored_tables= nullptr;
    first_name_resolution_table= nullptr;
    last_name_resolution_table= nullptr;
  }

  void resolve_in_table_list_only(TABLE_LIST *tables)
  {
    table_list= first_name_resolution_table= tables;
    resolve_in_select_list= FALSE;
  }

  void process_error(THD *thd)
  {
    (*error_processor)(thd, error_processor_data);
  }
  st_select_lex *outer_select()
  {
    return (outer_context ?
            outer_context->select_lex :
            NULL);
  }
};


/*
  Store and restore the current state of a name resolution context.
*/

class Name_resolution_context_state
{
private:
  TABLE_LIST *save_table_list;
  TABLE_LIST *save_first_name_resolution_table;
  TABLE_LIST *save_next_name_resolution_table;
  bool        save_resolve_in_select_list;
  TABLE_LIST *save_next_local;

public:
  Name_resolution_context_state() = default;          /* Remove gcc warning */

public:
  /* Save the state of a name resolution context. */
  void save_state(Name_resolution_context *context, TABLE_LIST *table_list)
  {
    save_table_list=                  context->table_list;
    save_first_name_resolution_table= context->first_name_resolution_table;
    save_resolve_in_select_list=      context->resolve_in_select_list;
    save_next_local=                  table_list->next_local;
    save_next_name_resolution_table=  table_list->next_name_resolution_table;
  }

  /* Restore a name resolution context from saved state. */
  void restore_state(Name_resolution_context *context, TABLE_LIST *table_list)
  {
    table_list->next_local=                save_next_local;
    table_list->next_name_resolution_table= save_next_name_resolution_table;
    context->table_list=                   save_table_list;
    context->first_name_resolution_table=  save_first_name_resolution_table;
    context->resolve_in_select_list=       save_resolve_in_select_list;
  }

  TABLE_LIST *get_first_name_resolution_table()
  {
    return save_first_name_resolution_table;
  }
};

class Name_resolution_context_backup
{
  Name_resolution_context &ctx;
  TABLE_LIST &table_list;
  table_map save_map;
  Name_resolution_context_state ctx_state;

public:
  Name_resolution_context_backup(Name_resolution_context &_ctx, TABLE_LIST &_table_list)
    : ctx(_ctx), table_list(_table_list), save_map(_table_list.map)
  {
    ctx_state.save_state(&ctx, &table_list);
    ctx.table_list= &table_list;
    ctx.first_name_resolution_table= &table_list;
  }
  ~Name_resolution_context_backup()
  {
    ctx_state.restore_state(&ctx, &table_list);
    table_list.map= save_map;
  }
};


/*
  This enum is used to report information about monotonicity of function
  represented by Item* tree.
  Monotonicity is defined only for Item* trees that represent table
  partitioning expressions (i.e. have no subselects/user vars/PS parameters
  etc etc). An Item* tree is assumed to have the same monotonicity properties
  as its corresponding function F:

  [signed] longlong F(field1, field2, ...) {
    put values of field_i into table record buffer;
    return item->val_int(); 
  }

  NOTE
  At the moment function monotonicity is not well defined (and so may be
  incorrect) for Item trees with parameters/return types that are different
  from INT_RESULT, may be NULL, or are unsigned.
  It will be possible to address this issue once the related partitioning bugs
  (BUG#16002, BUG#15447, BUG#13436) are fixed.

  The NOT_NULL enums are used in TO_DAYS, since TO_DAYS('2001-00-00') returns
  NULL which puts those rows into the NULL partition, but
  '2000-12-31' < '2001-00-00' < '2001-01-01'. So special handling is needed
  for this (see Bug#20577).
*/

typedef enum monotonicity_info 
{
   NON_MONOTONIC,              /* none of the below holds */
   MONOTONIC_INCREASING,       /* F() is unary and (x < y) => (F(x) <= F(y)) */
   MONOTONIC_INCREASING_NOT_NULL,  /* But only for valid/real x and y */
   MONOTONIC_STRICT_INCREASING,/* F() is unary and (x < y) => (F(x) <  F(y)) */
   MONOTONIC_STRICT_INCREASING_NOT_NULL  /* But only for valid/real x and y */
} enum_monotonicity_info;

/*************************************************************************/

class sp_rcontext;

/**
  A helper class to collect different behavior of various kinds of SP variables:
  - local SP variables and SP parameters
  - PACKAGE BODY routine variables
  - (there will be more kinds in the future)
*/

class Sp_rcontext_handler
{
public:
  virtual ~Sp_rcontext_handler() = default;
  /**
    A prefix used for SP variable names in queries:
    - EXPLAIN EXTENDED
    - SHOW PROCEDURE CODE
    Local variables and SP parameters have empty prefixes.
    Package body variables are marked with a special prefix.
    This improves readability of the output of these queries,
    especially when a local variable or a parameter has the same
    name with a package body variable.
  */
  virtual const LEX_CSTRING *get_name_prefix() const= 0;
  /**
    At execution time THD->spcont points to the run-time context (sp_rcontext)
    of the currently executed routine.
    Local variables store their data in the sp_rcontext pointed by thd->spcont.
    Package body variables store data in separate sp_rcontext that belongs
    to the package.
    This method provides access to the proper sp_rcontext structure,
    depending on the SP variable kind.
  */
  virtual sp_rcontext *get_rcontext(sp_rcontext *ctx) const= 0;
};


class Sp_rcontext_handler_local: public Sp_rcontext_handler
{
public:
  const LEX_CSTRING *get_name_prefix() const override;
  sp_rcontext *get_rcontext(sp_rcontext *ctx) const override;
};


class Sp_rcontext_handler_package_body: public Sp_rcontext_handler
{
public:
  const LEX_CSTRING *get_name_prefix() const override;
  sp_rcontext *get_rcontext(sp_rcontext *ctx) const override;
};


extern MYSQL_PLUGIN_IMPORT
  Sp_rcontext_handler_local sp_rcontext_handler_local;


extern MYSQL_PLUGIN_IMPORT
  Sp_rcontext_handler_package_body sp_rcontext_handler_package_body;



class Item_equal;

struct st_join_table* const NO_PARTICULAR_TAB= (struct st_join_table*)0x1;

typedef struct replace_equal_field_arg 
{
  Item_equal *item_equal;
  struct st_join_table *context_tab;
} REPLACE_EQUAL_FIELD_ARG;

class Settable_routine_parameter
{
public:
  /*
    Set required privileges for accessing the parameter.

    SYNOPSIS
      set_required_privilege()
        rw        if 'rw' is true then we are going to read and set the
                  parameter, so SELECT and UPDATE privileges might be
                  required, otherwise we only reading it and SELECT
                  privilege might be required.
  */
  Settable_routine_parameter() = default;
  virtual ~Settable_routine_parameter() = default;
  virtual void set_required_privilege(bool rw) {};

  /*
    Set parameter value.

    SYNOPSIS
      set_value()
        thd       thread handle
        ctx       context to which parameter belongs (if it is local
                  variable).
        it        item which represents new value

    RETURN
      FALSE if parameter value has been set,
      TRUE if error has occurred.
  */
  virtual bool set_value(THD *thd, sp_rcontext *ctx, Item **it)= 0;

  virtual void set_out_param_info(Send_field *info) {}

  virtual const Send_field *get_out_param_info() const
  { return NULL; }

  virtual Item_param *get_item_param() { return 0; }
};


/*
  A helper class to calculate offset and length of a query fragment
  - outside of SP
  - inside an SP
  - inside a compound block
*/
class Query_fragment
{
  uint m_pos;
  uint m_length;
  void set(size_t pos, size_t length)
  {
    DBUG_ASSERT(pos < UINT_MAX32);
    DBUG_ASSERT(length < UINT_MAX32);
    m_pos= (uint) pos;
    m_length= (uint) length;
  }
public:
  Query_fragment(THD *thd, sp_head *sphead, const char *start, const char *end);
  uint pos() const { return m_pos; }
  uint length() const { return m_length; }
};


/**
  This is used for items in the query that needs to be rewritten
  before binlogging

  At the moment this applies to Item_param and Item_splocal
*/
class Rewritable_query_parameter
{
  public:
  /*
    Offset inside the query text.
    Value of 0 means that this object doesn't have to be replaced
    (for example SP variables in control statements)
  */
  my_ptrdiff_t pos_in_query;

  /*
    Byte length of parameter name in the statement.  This is not
    Item::name.length because name.length contains byte length of UTF8-encoded
    name, but the query string is in the client charset.
  */
  uint len_in_query;

  bool limit_clause_param;

  Rewritable_query_parameter(uint pos_in_q= 0, uint len_in_q= 0)
    : pos_in_query(pos_in_q), len_in_query(len_in_q),
      limit_clause_param(false)
  { }

  virtual ~Rewritable_query_parameter() = default;

  virtual bool append_for_log(THD *thd, String *str) = 0;
};

class Copy_query_with_rewrite
{
  THD *thd;
  const char *src;
  size_t src_len, from;
  String *dst;

  bool copy_up_to(size_t bytes)
  {
    DBUG_ASSERT(bytes >= from);
    return dst->append(src + from, uint32(bytes - from));
  }

public:

  Copy_query_with_rewrite(THD *t, const char *s, size_t l, String *d)
    :thd(t), src(s), src_len(l), from(0), dst(d) { }

  bool append(Rewritable_query_parameter *p)
  {
    if (copy_up_to(p->pos_in_query) || p->append_for_log(thd, dst))
      return true;
    from= p->pos_in_query + p->len_in_query;
    return false;
  }

  bool finalize()
  { return copy_up_to(src_len); }
};

struct st_dyncall_create_def
{
  Item  *key, *value;
  CHARSET_INFO *cs;
  uint len, frac;
  DYNAMIC_COLUMN_TYPE type;
};

typedef struct st_dyncall_create_def DYNCALL_CREATE_DEF;


typedef bool (Item::*Item_processor) (void *arg);
/*
  Analyzer function
    SYNOPSIS
      argp   in/out IN:  Analysis parameter
                    OUT: Parameter to be passed to the transformer

    RETURN 
      TRUE   Invoke the transformer
      FALSE  Don't do it

*/
typedef bool (Item::*Item_analyzer) (uchar **argp);
typedef Item* (Item::*Item_transformer) (THD *thd, uchar *arg);
typedef void (*Cond_traverser) (const Item *item, void *arg);
typedef bool (Item::*Pushdown_checker) (uchar *arg);

struct st_cond_statistic;

struct find_selective_predicates_list_processor_data
{
  TABLE *table;
  List<st_cond_statistic> list;
};

class MY_LOCALE;

class Item_equal;
class COND_EQUAL;

class st_select_lex_unit;

class Item_func_not;
class Item_splocal;

/**
  String_copier that sends Item specific warnings.
*/
class String_copier_for_item: public String_copier
{
  THD *m_thd;
public:
  bool copy_with_warn(CHARSET_INFO *dstcs, String *dst,
                      CHARSET_INFO *srccs, const char *src,
                      uint32 src_length, uint32 nchars);
  String_copier_for_item(THD *thd): m_thd(thd) { }
};


/**
  A helper class describing what kind of Item created a temporary field.
  - If m_field is set, then the temporary field was created from Field
    (e.g. when the Item was Item_field, or Item_ref pointing to Item_field)
  - If m_default_field is set, then there is a usable DEFAULT value.
    (e.g. when the Item is Item_field)
  - If m_item_result_field is set, then the temporary field was created
    from certain sub-types of Item_result_field (e.g. Item_func)
  See create_tmp_field() in sql_select.cc for details.
*/

class Tmp_field_src
{
  Field *m_field;
  Field *m_default_field;
  Item_result_field *m_item_result_field;
public:
  Tmp_field_src()
   :m_field(0),
    m_default_field(0),
    m_item_result_field(0)
  { }
  Field *field() const { return m_field; }
  Field *default_field() const { return m_default_field; }
  Item_result_field *item_result_field() const { return m_item_result_field; }
  void set_field(Field *field) { m_field= field; }
  void set_default_field(Field *field) { m_default_field= field; }
  void set_item_result_field(Item_result_field *item)
  { m_item_result_field= item; }
};


/**
  Parameters for create_tmp_field_ex().
  See create_tmp_field() in sql_select.cc for details.
*/

class Tmp_field_param
{
  bool m_group;
  bool m_modify_item;
  bool m_table_cant_handle_bit_fields;
  bool m_make_copy_field;
public:
  Tmp_field_param(bool group,
                  bool modify_item,
                  bool table_cant_handle_bit_fields,
                  bool make_copy_field)
   :m_group(group),
    m_modify_item(modify_item),
    m_table_cant_handle_bit_fields(table_cant_handle_bit_fields),
    m_make_copy_field(make_copy_field)
  { }
  bool group() const { return m_group; }
  bool modify_item() const { return m_modify_item; }
  bool table_cant_handle_bit_fields() const
  { return m_table_cant_handle_bit_fields; }
  bool make_copy_field() const { return m_make_copy_field; }
  void set_modify_item(bool to) { m_modify_item= to; }
};


class Item_const
{
public:
  virtual ~Item_const() = default;
  virtual const Type_all_attributes *get_type_all_attributes_from_const() const= 0;
  virtual bool const_is_null() const { return false; }
  virtual const longlong *const_ptr_longlong() const { return NULL; }
  virtual const double *const_ptr_double() const { return NULL; }
  virtual const my_decimal *const_ptr_my_decimal() const { return NULL; }
  virtual const MYSQL_TIME *const_ptr_mysql_time() const { return NULL; }
  virtual const String *const_ptr_string() const { return NULL; }
};

struct subselect_table_finder_param
{
  THD *thd;
  /*
    We're searching for different TABLE_LIST objects referring to the same
    table as this one
  */
  const TABLE_LIST *find;
  /* NUL - not found, ERROR_TABLE - search error, or the found table reference */
  TABLE_LIST *dup;
};

/****************************************************************************/

#define STOP_PTR ((void *) 1)

/* Base flags (including IN) for an item */

typedef uint8 item_flags_t;

enum class item_base_t : item_flags_t
{
  NONE=                  0,
#define ITEM_FLAGS_MAYBE_NULL_SHIFT 0 // Must match MAYBE_NULL
  MAYBE_NULL=            (1<<0),   // May be NULL.
  IN_ROLLUP=             (1<<1),   // Appears in GROUP BY list
                                   // of a query with ROLLUP.
  FIXED=                 (1<<2),   // Was fixed with fix_fields().
  IS_EXPLICIT_NAME=      (1<<3),   // The name of this Item was set by the user
                                   // (or was auto generated otherwise)
  IS_IN_WITH_CYCLE=      (1<<4),   // This item is in CYCLE clause
                                   // of WITH.
  IS_COND=               (1<<5)    // The item is used as <search condition>.
                                   // Must be evaluated using val_bool().
                                   // Note, not all items used as a search
                                   // condition set this flag yet.
};


/* Flags that tells us what kind of items the item contains */

enum class item_with_t : item_flags_t
{
  NONE=             0,
  SP_VAR=      (1<<0), // If Item contains a stored procedure variable
  WINDOW_FUNC= (1<<1), // If item contains a window func
  FIELD=       (1<<2), // If any item except Item_sum contains a field.
  SUM_FUNC=    (1<<3), // If item contains a sum func
  SUBQUERY=    (1<<4), // If item containts a sub query
  ROWNUM_FUNC= (1<<5), // If ROWNUM function was used
  PARAM=       (1<<6)  // If user parameter was used
};


/* Make operations in item_base_t and item_with_t work like 'int' */
static inline item_base_t operator&(const item_base_t a, const item_base_t b)
{
  return (item_base_t) (((item_flags_t) a) & ((item_flags_t) b));
}

static inline item_base_t & operator&=(item_base_t &a, item_base_t b)
{
  a= (item_base_t) (((item_flags_t) a) & (item_flags_t) b);
  return a;
}

static inline item_base_t operator|(const item_base_t a, const item_base_t b)
{
  return (item_base_t) (((item_flags_t) a) | ((item_flags_t) b));
}

static inline item_base_t & operator|=(item_base_t &a, item_base_t b)
{
  a= (item_base_t) (((item_flags_t) a) | (item_flags_t) b);
  return a;
}

static inline item_base_t operator~(const item_base_t a)
{
  return (item_base_t) ~(item_flags_t) a;
}

static inline item_with_t operator&(const item_with_t a, const item_with_t b)
{
  return (item_with_t) (((item_flags_t) a) & ((item_flags_t) b));
}

static inline item_with_t & operator&=(item_with_t &a, item_with_t b)
{
  a= (item_with_t) (((item_flags_t) a) & (item_flags_t) b);
  return a;
}

static inline item_with_t operator|(const item_with_t a, const item_with_t b)
{
  return (item_with_t) (((item_flags_t) a) | ((item_flags_t) b));
}

static inline item_with_t & operator|=(item_with_t &a, item_with_t b)
{
  a= (item_with_t) (((item_flags_t) a) | (item_flags_t) b);
  return a;
}

static inline item_with_t operator~(const item_with_t a)
{
  return (item_with_t) ~(item_flags_t) a;
}


class Item :public Value_source,
            public Type_all_attributes
{
  static void *operator new(size_t size);

public:
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr,size_t size) { TRASH_FREE(ptr, size); }
  static void operator delete(void *ptr, MEM_ROOT *mem_root) {}

  enum Type {FIELD_ITEM= 0, FUNC_ITEM, SUM_FUNC_ITEM,
             WINDOW_FUNC_ITEM,
             /*
               NOT NULL literal-alike constants, which do not change their
               value during an SQL statement execution, but can optionally
               change their value between statements:
               - Item_literal               - real NOT NULL constants
               - Item_param                 - can change between statements
               - Item_splocal               - can change between statements
               - Item_user_var_as_out_param - hack
               Note, Item_user_var_as_out_param actually abuses the type code.
               It should be moved out of the Item tree eventually.
             */
             CONST_ITEM,
             NULL_ITEM,     // Item_null or Item_param bound to NULL
             COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM,
             CONTEXTUALLY_TYPED_VALUE_ITEM,
             PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM,
             FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM,
             SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER,
             PARAM_ITEM, TRIGGER_FIELD_ITEM,
             EXPR_CACHE_ITEM};

  enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
  enum traverse_order { POSTFIX, PREFIX };

protected:
  SEL_TREE *get_mm_tree_for_const(RANGE_OPT_PARAM *param);

  /**
    Create a field based on the exact data type handler.
  */
  Field *create_table_field_from_handler(MEM_ROOT *root, TABLE *table)
  {
    const Type_handler *h= type_handler();
    return h->make_and_init_table_field(root, &name,
                                        Record_addr(maybe_null()),
                                        *this, table);
  }
  /**
    Create a field based on field_type of argument.
    This is used to create a field for
    - IFNULL(x,something)
    - time functions
    - prepared statement placeholders
    - SP variables with data type references: DECLARE a TYPE OF t1.a;
    @retval  NULL  error
    @retval  !NULL on success
  */
  Field *tmp_table_field_from_field_type(MEM_ROOT *root, TABLE *table)
  {
    DBUG_ASSERT(fixed());
    const Type_handler *h= type_handler()->type_handler_for_tmp_table(this);
    return h->make_and_init_table_field(root, &name,
                                        Record_addr(maybe_null()),
                                        *this, table);
  }
  /**
    Create a temporary field for a simple Item, which does not
    need any special action after the field creation:
    - is not an Item_field descendant (and not a reference to Item_field)
    - is not an Item_result_field descendant
    - does not need to copy any DEFAULT value to the result Field
    - does not need to set Field::is_created_from_null_item for the result
    See create_tmp_field_ex() for details on parameters and return values.
  */
  Field *create_tmp_field_ex_simple(MEM_ROOT *root,
                                    TABLE *table,
                                    Tmp_field_src *src,
                                    const Tmp_field_param *param)
  {
    DBUG_ASSERT(!param->make_copy_field());
    DBUG_ASSERT(!is_result_field());
    DBUG_ASSERT(type() != NULL_ITEM);
    return tmp_table_field_from_field_type(root, table);
  }
  Field *create_tmp_field_int(MEM_ROOT *root, TABLE *table,
                              uint convert_int_length);
  Field *tmp_table_field_from_field_type_maybe_null(MEM_ROOT *root,
                                            TABLE *table,
                                            Tmp_field_src *src,
                                            const Tmp_field_param *param,
                                            bool is_explicit_null);

  virtual void raise_error_not_evaluable();
  void push_note_converted_to_negative_complement(THD *thd);
  void push_note_converted_to_positive_complement(THD *thd);

  /* Helper methods, to get an Item value from another Item */
  double val_real_from_item(Item *item)
  {
    DBUG_ASSERT(fixed());
    double value= item->val_real();
    null_value= item->null_value;
    return value;
  }
  longlong val_int_from_item(Item *item)
  {
    DBUG_ASSERT(fixed());
    longlong value= item->val_int();
    null_value= item->null_value;
    return value;
  }
  String *val_str_from_item(Item *item, String *str)
  {
    DBUG_ASSERT(fixed());
    String *res= item->val_str(str);
    if (res)
      res->set_charset(collation.collation);
    if ((null_value= item->null_value))
      res= NULL;
    return res;
  }
  bool val_native_from_item(THD *thd, Item *item, Native *to)
  {
    DBUG_ASSERT(fixed());
    null_value= item->val_native(thd, to);
    DBUG_ASSERT(null_value == item->null_value);
    return null_value;
  }
  bool val_native_from_field(Field *field, Native *to)
  {
    if ((null_value= field->is_null()))
      return true;
    return (null_value= field->val_native(to));
  }
  bool val_native_with_conversion_from_item(THD *thd, Item *item, Native *to,
                                            const Type_handler *handler)
  {
    DBUG_ASSERT(fixed());
    return (null_value= item->val_native_with_conversion(thd, to, handler));
  }
  my_decimal *val_decimal_from_item(Item *item, my_decimal *decimal_value)
  {
    DBUG_ASSERT(fixed());
    my_decimal *value= item->val_decimal(decimal_value);
    if ((null_value= item->null_value))
      value= NULL;
    return value;
  }
  bool get_date_from_item(THD *thd, Item *item,
                          MYSQL_TIME *ltime, date_mode_t fuzzydate)
  {
    bool rc= item->get_date(thd, ltime, fuzzydate);
    null_value= MY_TEST(rc || item->null_value);
    return rc;
  }
public:

  /*
    Cache val_str() into the own buffer, e.g. to evaluate constant
    expressions with subqueries in the ORDER/GROUP clauses.
  */
  String *val_str() { return val_str(&str_value); }
  String *val_str_null_to_empty(String *to)
  {
    String *res= val_str(to);
    if (res)
      return res;
    to->set_charset(collation.collation);
    to->length(0);
    return to;
  }
  String *val_str_null_to_empty(String *to, bool null_to_empty)
  {
    return null_to_empty ? val_str_null_to_empty(to) : val_str(to);
  }
  virtual Item_func *get_item_func() { return NULL; }

  const MY_LOCALE *locale_from_val_str();

  /* All variables for the Item class */

  /**
     Intrusive list pointer for free list. If not null, points to the next
     Item on some Query_arena's free list. For instance, stored procedures
     have their own Query_arena's.

     @see Query_arena::free_list
   */
  Item *next;

  /*
    str_values's main purpose is to be used to cache the value in
    save_in_field. Calling full_name() for Item_field will also use str_value.
  */
  String str_value;

  LEX_CSTRING name;			/* Name of item */
  /* Original item name (if it was renamed)*/
  const char *orig_name;

  /* All common bool variables for an Item is stored here */
  item_base_t base_flags;
  item_with_t with_flags;

   /* Marker is used in some functions to temporary mark an item */
  int16 marker;

  /*
    Tells is the val() value of the item is/was null.
    This should not be part of the bit flags as it's changed a lot and also
    we use pointers to it
  */
  bool null_value;
  /* Cache of the result of is_expensive(). */
  int8 is_expensive_cache;
  /**
    The index in the JOIN::join_tab array of the JOIN_TAB this Item
    is attached to. Items are attached (or 'pushed') to JOIN_TABs
    during optimization by the make_cond_for_table procedure. During
    query execution, this item is evaluated when the join loop reaches
    the corresponding JOIN_TAB.

    If the value of join_tab_idx >= MAX_TABLES, this means that there is no
    corresponding JOIN_TAB.
  */
  uint8 join_tab_idx;

  inline bool maybe_null() const
  { return (bool) (base_flags & item_base_t::MAYBE_NULL); }
  inline bool in_rollup() const
  { return (bool) (base_flags & item_base_t::IN_ROLLUP); }
  inline bool fixed() const
  { return (bool) (base_flags & item_base_t::FIXED); }
  inline bool is_explicit_name() const
  { return (bool) (base_flags & item_base_t::IS_EXPLICIT_NAME); }
  inline bool is_in_with_cycle() const
  { return (bool) (base_flags & item_base_t::IS_IN_WITH_CYCLE); }
  inline bool is_cond() const
  { return (bool) (base_flags & item_base_t::IS_COND); }

  inline bool with_sp_var() const
  { return (bool) (with_flags & item_with_t::SP_VAR); }
  inline bool with_window_func() const
  { return (bool) (with_flags & item_with_t::WINDOW_FUNC); }
  inline bool with_field() const
  { return (bool) (with_flags & item_with_t::FIELD); }
  inline bool with_sum_func() const
  { return (bool) (with_flags & item_with_t::SUM_FUNC); }
  inline bool with_subquery() const
  { return (bool) (with_flags & item_with_t::SUBQUERY); }
  inline bool with_rownum_func() const
  { return (bool) (with_flags & item_with_t::ROWNUM_FUNC); }
  inline bool with_param() const
  { return (bool) (with_flags & item_with_t::PARAM); }
  inline void copy_flags(const Item *org, item_base_t mask)
  {
    base_flags= (item_base_t) (((item_flags_t) base_flags &
                                ~(item_flags_t) mask) |
                               ((item_flags_t) org->base_flags &
                                (item_flags_t) mask));
  }
  inline void copy_flags(const Item *org, item_with_t mask)
  {
    with_flags= (item_with_t) (((item_flags_t) with_flags &
                                ~(item_flags_t) mask) |
                               ((item_flags_t) org->with_flags &
                                (item_flags_t) mask));
  }

  // alloc & destruct is done as start of select on THD::mem_root
  Item(THD *thd);
  /*
     Constructor used by Item_field, Item_ref & aggregate (sum) functions.
     Used for duplicating lists in processing queries with temporary
     tables
     Also it used for Item_cond_and/Item_cond_or for creating
     top AND/OR structure of WHERE clause to protect it of
     optimisation changes in prepared statements
  */
  Item(THD *thd, Item *item);
  Item();                                        /* For const item */
  virtual ~Item()
  {
#ifdef EXTRA_DEBUG
    name.str= 0;
    name.length= 0;
#endif
  }		/*lint -e1509 */
  void set_name(THD *thd, const char *str, size_t length, CHARSET_INFO *cs);
  void set_name(THD *thd, String *str)
  {
    set_name(thd, str->ptr(), str->length(), str->charset());
  }
  void set_name(THD *thd, const LEX_CSTRING &str,
                CHARSET_INFO *cs= system_charset_info)
  {
    set_name(thd, str.str, str.length, cs);
  }
  void set_name_no_truncate(THD *thd, const char *str, uint length,
                            CHARSET_INFO *cs);
  void init_make_send_field(Send_field *tmp_field, const Type_handler *h);
  void share_name_with(const Item *item)
  {
    name= item->name;
    copy_flags(item, item_base_t::IS_EXPLICIT_NAME);
  }
  virtual void cleanup();
  virtual void make_send_field(THD *thd, Send_field *field);

  bool fix_fields_if_needed(THD *thd, Item **ref)
  {
    return fixed() ? false : fix_fields(thd, ref);
  }

  /*
   fix_fields_if_needed_for_scalar() is used where we need to filter items
   that can't be scalars and want to return error for it.
  */
  bool fix_fields_if_needed_for_scalar(THD *thd, Item **ref)
  {
    return fix_fields_if_needed(thd, ref) || check_cols(1);
  }
  bool fix_fields_if_needed_for_bool(THD *thd, Item **ref)
  {
    return fix_fields_if_needed_for_scalar(thd, ref);
  }
  bool fix_fields_if_needed_for_order_by(THD *thd, Item **ref)
  {
    return fix_fields_if_needed_for_scalar(thd, ref);
  }
  /*
    By default we assume that an Item is fixed by the constructor
  */
  virtual bool fix_fields(THD *, Item **)
  {
    /*
      This should not normally be called, because usually before
      fix_fields() we check fixed() to be false.
      But historically we allow fix_fields() to be called for Items
      who return basic_const_item()==true.
    */
    DBUG_ASSERT(fixed());
    DBUG_ASSERT(basic_const_item());
    return false;
  }
  virtual void unfix_fields()
  {
    DBUG_ASSERT(0);
  }

  /*
    Fix after some tables has been pulled out. Basically re-calculate all
    attributes that are dependent on the tables.
  */
  virtual void fix_after_pullout(st_select_lex *new_parent, Item **ref,
                                 bool merge)
    {};

  /*
    This is for items that require a fixup after the JOIN::prepare()
    is done.
  */
  virtual void fix_after_optimize(THD *thd)
  {}
  /*
    This method should be used in case where we are sure that we do not need
    complete fix_fields() procedure.
    Usually this method is used by the optimizer when it has to create a new
    item out of other already fixed items. For example, if the optimizer has
    to create a new Item_func for an inferred equality whose left and right
    parts are already fixed items. In some cases the optimizer cannot use
    directly fixed items as the arguments of the created functional item, 
    but rather uses intermediate type conversion items. Then the method is
    supposed to be applied recursively.  
  */
  virtual void quick_fix_field()
  {
    DBUG_ASSERT(0);
  }

  bool save_in_value(THD *thd, st_value *value)
  {
    return type_handler()->Item_save_in_value(thd, this, value);
  }

  /* Function returns 1 on overflow and -1 on fatal errors */
  int save_in_field_no_warnings(Field *field, bool no_conversions);
  virtual int save_in_field(Field *field, bool no_conversions);
  virtual bool save_in_param(THD *thd, Item_param *param);
  virtual void save_org_in_field(Field *field,
                                 fast_field_copier data
                                 __attribute__ ((__unused__)))
  { (void) save_in_field(field, 1); }
  virtual fast_field_copier setup_fast_field_copier(Field *field)
  { return NULL; }
  virtual int save_safe_in_field(Field *field)
  { return save_in_field(field, 1); }
  virtual bool send(Protocol *protocol, st_value *buffer)
  {
    return type_handler()->Item_send(this, protocol, buffer);
  }
  virtual bool eq(const Item *, bool binary_cmp) const;
  enum_field_types field_type() const
  {
    return type_handler()->field_type();
  }
  virtual const Type_handler *type_handler() const= 0;
  /**
    Detects if an Item has a fixed data type which is known
    even before fix_fields().
    Currently it's important only to find Items with a fixed boolean
    data type. More item types can be marked in the future as having
    a fixed data type (e.g. all literals, all fixed type functions, etc).

    @retval  NULL if the Item type is not known before fix_fields()
    @retval  the pointer to the data type handler, if the data type
             is known before fix_fields().
  */
  virtual const Type_handler *fixed_type_handler() const
  {
    return NULL;
  }
  const Type_handler *type_handler_for_comparison() const
  {
    return type_handler()->type_handler_for_comparison();
  }
  virtual const Type_handler *real_type_handler() const
  {
    return type_handler();
  }
  const Type_handler *cast_to_int_type_handler() const
  {
    return real_type_handler()->cast_to_int_type_handler();
  }
  /* result_type() of an item specifies how the value should be returned */
  Item_result result_type() const
  {
    return type_handler()->result_type();
  }
  /* ... while cmp_type() specifies how it should be compared */
  Item_result cmp_type() const
  {
    return type_handler()->cmp_type();
  }
  const Type_handler *string_type_handler() const
  {
    return Type_handler::string_type_handler(max_length);
  }
  /*
    Calculate the maximum length of an expression.
    This method is used in data type aggregation for UNION, e.g.:
      SELECT 'b' UNION SELECT COALESCE(double_10_3_field) FROM t1;

    The result is usually equal to max_length, except for some numeric types.
    In case of the INT, FLOAT, DOUBLE data types Item::max_length and
    Item::decimals are ignored, so the returned value depends only on the
    data type itself. E.g. for an expression of the DOUBLE(10,3) data type,
    the result is always 53 (length 10 and precision 3 do not matter).

    max_length is ignored for these numeric data types because the length limit
    means only "expected maximum length", it is not a hard limit, so it does
    not impose any data truncation. E.g. a column of the type INT(4) can
    normally store big values up to 2147483647 without truncation. When we're
    aggregating such column for UNION it's important to create a long enough
    result column, not to lose any data.

    For detailed behaviour of various data types see implementations of
    the corresponding Type_handler_xxx::max_display_length().

    Note, Item_field::max_display_length() overrides this to get
    max_display_length() from the underlying field.
  */
  virtual uint32 max_display_length() const
  {
    return type_handler()->max_display_length(this);
  }
  const TYPELIB *get_typelib() const override { return NULL; }
  /* optimized setting of maybe_null without jumps. Minimizes code size */
  inline void set_maybe_null(bool maybe_null_arg)
  {
    base_flags= ((item_base_t) ((base_flags & ~item_base_t::MAYBE_NULL)) |
                 (item_base_t) (maybe_null_arg <<
                                ITEM_FLAGS_MAYBE_NULL_SHIFT));
  }
  /* This is used a lot, so make it simpler to use */
  void set_maybe_null()
  {
    base_flags|= item_base_t::MAYBE_NULL;
  }
  /* This is used when calling Type_all_attributes::set_type_maybe_null() */
  void set_type_maybe_null(bool maybe_null_arg) override
  {
    set_maybe_null(maybe_null_arg);
  }

  void set_typelib(const TYPELIB *typelib) override
  {
    // Non-field Items (e.g. hybrid functions) never have ENUM/SET types yet.
    DBUG_ASSERT(0);
  }
  Item_cache* get_cache(THD *thd) const
  {
    return type_handler()->Item_get_cache(thd, this);
  }
  virtual enum Type type() const =0;
  bool is_of_type(Type t, Item_result cmp) const
  {
    return type() == t && cmp_type() == cmp;
  }
  /*
    real_type() is the type of base item.  This is same as type() for
    most items, except Item_ref() and Item_cache_wrapper() where it
    shows the type for the underlying item.
  */
  virtual enum Type real_type() const { return type(); }
  
  /*
    Return information about function monotonicity. See comment for
    enum_monotonicity_info for details. This function can only be called
    after fix_fields() call.
  */
  virtual enum_monotonicity_info get_monotonicity_info() const
  { return NON_MONOTONIC; }

  /*
    Convert "func_arg $CMP$ const" half-interval into
            "FUNC(func_arg) $CMP2$ const2"

    SYNOPSIS
      val_int_endpoint()
        left_endp  FALSE  <=> The interval is "x < const" or "x <= const"
                   TRUE   <=> The interval is "x > const" or "x >= const"

        incl_endp  IN   FALSE <=> the comparison is '<' or '>'
                        TRUE  <=> the comparison is '<=' or '>='
                   OUT  The same but for the "F(x) $CMP$ F(const)" comparison

    DESCRIPTION
      This function is defined only for unary monotonic functions. The caller
      supplies the source half-interval

         x $CMP$ const

      The value of const is supplied implicitly as the value this item's
      argument, the form of $CMP$ comparison is specified through the
      function's arguments. The calle returns the result interval
         
         F(x) $CMP2$ F(const)
      
      passing back F(const) as the return value, and the form of $CMP2$ 
      through the out parameter. NULL values are assumed to be comparable and
      be less than any non-NULL values.

    RETURN
      The output range bound, which equal to the value of val_int()
        - If the value of the function is NULL then the bound is the 
          smallest possible value of LONGLONG_MIN 
  */
  virtual longlong val_int_endpoint(bool left_endp, bool *incl_endp)
  { DBUG_ASSERT(0); return 0; }


  /* valXXX methods must return NULL or 0 or 0.0 if null_value is set. */
  /*
    Return double precision floating point representation of item.

    SYNOPSIS
      val_real()

    RETURN
      In case of NULL value return 0.0 and set null_value flag to TRUE.
      If value is not null null_value flag will be reset to FALSE.
  */
  virtual double val_real()=0;
  Double_null to_double_null()
  {
    // val_real() must be caleed on a separate line. See to_longlong_null()
    double nr= val_real();
    return Double_null(nr, null_value);
  }
  /*
    Return integer representation of item.

    SYNOPSIS
      val_int()

    RETURN
      In case of NULL value return 0 and set null_value flag to TRUE.
      If value is not null null_value flag will be reset to FALSE.
  */
  virtual longlong val_int()=0;
  Longlong_hybrid to_longlong_hybrid()
  {
    return Longlong_hybrid(val_int(), unsigned_flag);
  }
  Longlong_null to_longlong_null()
  {
    longlong nr= val_int();
    /*
      C++ does not guarantee the order of parameter evaluation,
      so to make sure "null_value" is passed to the constructor
      after the val_int() call, val_int() is caled on a separate line.
    */
    return Longlong_null(nr, null_value);
  }
  Longlong_hybrid_null to_longlong_hybrid_null()
  {
    return Longlong_hybrid_null(to_longlong_null(), unsigned_flag);
  }
  /**
    Get a value for CAST(x AS SIGNED).
    Too large positive unsigned integer values are converted
    to negative complements.
    Values of non-integer data types are adjusted to the SIGNED range.
  */
  virtual longlong val_int_signed_typecast()
  {
    return cast_to_int_type_handler()->Item_val_int_signed_typecast(this);
  }
  longlong val_int_signed_typecast_from_str();
  /**
    Get a value for CAST(x AS UNSIGNED).
    Negative signed integer values are converted
    to positive complements.
    Values of non-integer data types are adjusted to the UNSIGNED range.
  */
  virtual longlong val_int_unsigned_typecast()
  {
    return cast_to_int_type_handler()->Item_val_int_unsigned_typecast(this);
  }
  longlong val_int_unsigned_typecast_from_int();
  longlong val_int_unsigned_typecast_from_str();
  longlong val_int_unsigned_typecast_from_real();

  /**
    Get a value for CAST(x AS UNSIGNED).
    Huge positive unsigned values are converted to negative complements.
  */
  longlong val_int_signed_typecast_from_int();
  longlong val_int_signed_typecast_from_real();

  /*
    This is just a shortcut to avoid the cast. You should still use
    unsigned_flag to check the sign of the item.
  */
  inline ulonglong val_uint() { return (ulonglong) val_int(); }

  virtual bool hash_not_null(Hasher *hasher)
  {
    DBUG_ASSERT(0);
    return true;
  }

  /*
    Return string representation of this item object.

    SYNOPSIS
      val_str()
      str   an allocated buffer this or any nested Item object can use to
            store return value of this method.

    NOTE
      The caller can modify the returned String, if it's not marked
      "const" (with the String::mark_as_const() method). That means that
      if the item returns its own internal buffer (e.g. tmp_value), it
      *must* be marked "const" [1]. So normally it's preferable to
      return the result value in the String, that was passed as an
      argument. But, for example, SUBSTR() returns a String that simply
      points into the buffer of SUBSTR()'s args[0]->val_str(). Such a
      String is always "const", so it's ok to use tmp_value for that and
      avoid reallocating/copying of the argument String.

      [1] consider SELECT CONCAT(f, ":", f) FROM (SELECT func() AS f);
      here the return value of f() is used twice in the top-level
      select, and if they share the same tmp_value buffer, modifying the
      first one will implicitly modify the second too.

    RETURN
      In case of NULL value return 0 (NULL pointer) and set null_value flag
      to TRUE.
      If value is not null null_value flag will be reset to FALSE.
  */
  virtual String *val_str(String *str)=0;


  bool val_native_with_conversion(THD *thd, Native *to, const Type_handler *th)
  {
    return th->Item_val_native_with_conversion(thd, this, to);
  }
  bool val_native_with_conversion_result(THD *thd, Native *to,
                                         const Type_handler *th)
  {
    return th->Item_val_native_with_conversion_result(thd, this, to);
  }

  virtual bool val_native(THD *thd, Native *to)
  {
   /*
     The default implementation for the Items that do not need native format:
     - Item_basic_value (default implementation)
     - Item_copy
     - Item_exists_subselect
     - Item_sum_field
     - Item_sum_or_func (default implementation)
     - Item_proc
     - Item_type_holder (as val_xxx() are never called for it);

     These hybrid Item types override val_native():
     - Item_field
     - Item_param
     - Item_sp_variable
     - Item_ref
     - Item_cache_wrapper
     - Item_direct_ref
     - Item_direct_view_ref
     - Item_ref_null_helper
     - Item_name_const
     - Item_time_literal
     - Item_sum_or_func
         Note, these hybrid type Item_sum_or_func descendants
         override the default implementation:
         * Item_sum_hybrid
         * Item_func_hybrid_field_type
         * Item_func_min_max
         * Item_func_sp
         * Item_func_last_value
         * Item_func_rollup_const
   */
    DBUG_ASSERT(0);
    return (null_value= 1);
  }
  virtual bool val_native_result(THD *thd, Native *to)
  {
    return val_native(thd, to);
  }

  /*
    Returns string representation of this item in ASCII format.

    SYNOPSIS
      val_str_ascii()
      str - similar to val_str();

    NOTE
      This method is introduced for performance optimization purposes.

      1. val_str() result of some Items in string context
      depends on @@character_set_results.
      @@character_set_results can be set to a "real multibyte" character
      set like UCS2, UTF16, UTF32. (We'll use only UTF32 in the examples
      below for convenience.)

      So the default string result of such functions
      in these circumstances is real multi-byte character set, like UTF32.

      For example, all numbers in string context
      return result in @@character_set_results:

      SELECT CONCAT(20010101); -> UTF32

      We do sprintf() first (to get ASCII representation)
      and then convert to UTF32;
      
      So these kind "data sources" can use ASCII representation
      internally, but return multi-byte data only because
      @@character_set_results wants so.
      Therefore, conversion from ASCII to UTF32 is applied internally.


      2. Some other functions need in fact ASCII input.

      For example,
        inet_aton(), GeometryFromText(), Convert_TZ(), GET_FORMAT().

      Similar, fields of certain type, like DATE, TIME,
      when you insert string data into them, expect in fact ASCII input.
      If they get non-ASCII input, for example UTF32, they
      convert input from UTF32 to ASCII, and then use ASCII
      representation to do further processing.


      3. Now imagine we pass result of a data source of the first type
         to a data destination of the second type.

      What happens:
        a. data source converts data from ASCII to UTF32, because
           @@character_set_results wants so and passes the result to
           data destination.
        b. data destination gets UTF32 string.
        c. data destination converts UTF32 string to ASCII,
           because it needs ASCII representation to be able to handle data
           correctly.

      As a result we get two steps of unnecessary conversion:
      From ASCII to UTF32, then from UTF32 to ASCII.

      A better way to handle these situations is to pass ASCII
      representation directly from the source to the destination.

      This is why val_str_ascii() introduced.

    RETURN
      Similar to val_str()
  */
  virtual String *val_str_ascii(String *str);

  /*
    Returns the result of val_str_ascii(), translating NULLs back
    to empty strings (if MODE_EMPTY_STRING_IS_NULL is set).
  */
  String *val_str_ascii_revert_empty_string_is_null(THD *thd, String *str);

  /*
    Returns the val_str() value converted to the given character set.
  */
  String *val_str(String *str, String *converter, CHARSET_INFO *to);

  virtual String *val_json(String *str) { return val_str(str); }
  /*
    Return decimal representation of item with fixed point.

    SYNOPSIS
      val_decimal()
      decimal_buffer  buffer which can be used by Item for returning value
                      (but can be not)

    NOTE
      Returned value should not be changed if it is not the same which was
      passed via argument.

    RETURN
      Return pointer on my_decimal (it can be other then passed via argument)
        if value is not NULL (null_value flag will be reset to FALSE).
      In case of NULL value it return 0 pointer and set null_value flag
        to TRUE.
  */
  virtual my_decimal *val_decimal(my_decimal *decimal_buffer)= 0;
  /*
    Return boolean value of item.

    RETURN
      FALSE value is false or NULL
      TRUE value is true (not equal to 0)
  */
  virtual bool val_bool()
  {
    return type_handler()->Item_val_bool(this);
  }

  bool eval_const_cond()
  {
    DBUG_ASSERT(const_item());
    DBUG_ASSERT(!is_expensive());
    return val_bool();
  }
  bool can_eval_in_optimize()
  {
    return const_item() && !is_expensive();
  }

  /*
    save_val() is method of val_* family which stores value in the given
    field.
  */
  virtual void save_val(Field *to) { save_org_in_field(to, NULL); }
  /*
    save_result() is method of val*result() family which stores value in
    the given field.
  */
  virtual void save_result(Field *to) { save_val(to); }
  /* Helper functions, see item_sum.cc */
  String *val_string_from_real(String *str);
  String *val_string_from_int(String *str);
  my_decimal *val_decimal_from_real(my_decimal *decimal_value);
  my_decimal *val_decimal_from_int(my_decimal *decimal_value);
  my_decimal *val_decimal_from_string(my_decimal *decimal_value);
  longlong val_int_from_real()
  {
    DBUG_ASSERT(fixed());
    return Converter_double_to_longlong_with_warn(val_real(), false).result();
  }
  longlong val_int_from_str(int *error);

  /*
    Returns true if this item can be calculated during
    value_depends_on_sql_mode()
  */
  bool value_depends_on_sql_mode_const_item()
  {
    /*
      Currently we use value_depends_on_sql_mode() only for virtual
      column expressions. They should not contain any expensive items.
      If we ever get a crash on the assert below, it means
      check_vcol_func_processor() is badly implemented for this item.
    */
    DBUG_ASSERT(!is_expensive());
    /*
      It should return const_item() actually.
      But for some reasons Item_field::const_item() returns true
      at value_depends_on_sql_mode() call time.
      This should be checked and fixed.
    */
    return basic_const_item();
  }
  virtual Sql_mode_dependency value_depends_on_sql_mode() const
  {
    return Sql_mode_dependency();
  }

  int save_time_in_field(Field *field, bool no_conversions);
  int save_date_in_field(Field *field, bool no_conversions);
  int save_str_in_field(Field *field, bool no_conversions);
  int save_real_in_field(Field *field, bool no_conversions);
  int save_int_in_field(Field *field, bool no_conversions);
  int save_bool_in_field(Field *field, bool no_conversions);
  int save_decimal_in_field(Field *field, bool no_conversions);

  int save_str_value_in_field(Field *field, String *result);

  virtual Field *get_tmp_table_field() { return 0; }
  virtual Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table);
  inline const char *full_name() const { return full_name_cstring().str; }
  virtual LEX_CSTRING full_name_cstring() const
  {
    if (name.str)
      return name;
    return { STRING_WITH_LEN("???") };
  }
  const char *field_name_or_null()
  { return real_item()->type() == Item::FIELD_ITEM ? name.str : NULL; }
  const TABLE_SHARE *field_table_or_null();

  /*
    *result* family of methods is analog of *val* family (see above) but
    return value of result_field of item if it is present. If Item have not
    result field, it return val(). This methods set null_value flag in same
    way as *val* methods do it.
  */
  virtual double  val_result() { return val_real(); }
  virtual longlong val_int_result() { return val_int(); }
  virtual String *str_result(String* tmp) { return val_str(tmp); }
  virtual my_decimal *val_decimal_result(my_decimal *val)
  { return val_decimal(val); }
  virtual bool val_bool_result() { return val_bool(); }
  virtual bool is_null_result() { return is_null(); }
  /*
    Returns 1 if result type and collation for val_str() can change between
    calls
  */
  virtual bool dynamic_result() { return 0; }
  /* 
    Bitmap of tables used by item
    (note: if you need to check dependencies on individual columns, check out
     class Field_enumerator)
  */
  virtual table_map used_tables() const { return (table_map) 0L; }
  virtual table_map all_used_tables() const { return used_tables(); }
  /*
    Return table map of tables that can't be NULL tables (tables that are
    used in a context where if they would contain a NULL row generated
    by a LEFT or RIGHT join, the item would not be true).
    This expression is used on WHERE item to determinate if a LEFT JOIN can be
    converted to a normal join.
    Generally this function should return used_tables() if the function
    would return null if any of the arguments are null
    As this is only used in the beginning of optimization, the value don't
    have to be updated in update_used_tables()
  */
  virtual table_map not_null_tables() const { return used_tables(); }
  /*
    Returns true if this is a simple constant item like an integer, not
    a constant expression. Used in the optimizer to propagate basic constants.
  */
  virtual bool basic_const_item() const { return 0; }
  /**
    Determines if the expression is allowed as
    a virtual column assignment source:
      INSERT INTO t1 (vcol) VALUES (10)    -> error
      INSERT INTO t1 (vcol) VALUES (NULL)  -> ok
  */
  virtual bool vcol_assignment_allowed_value() const { return false; }
  /**
    Test if "this" is an ORDER position (rather than an expression).
    Notes:
    - can be called before fix_fields().
    - local SP variables (even of integer types) are always expressions, not
      positions. (And they can't be used before fix_fields is called for them).
  */
  virtual bool is_order_clause_position() const { return false; }
  /*
    Determines if the Item is an evaluable expression, that is
    it can return a value, so we can call methods val_xxx(), get_date(), etc.
    Most items are evaluable expressions.
    Examples of non-evaluable expressions:
    - Item_contextually_typed_value_specification (handling DEFAULT and IGNORE)
    - Item_type_param bound to DEFAULT and IGNORE
    We cannot call the mentioned methods for these Items,
    their method implementations typically have DBUG_ASSERT(0).
  */
  virtual bool is_evaluable_expression() const { return true; }

  /**
   * Check whether the item is a parameter  ('?') of stored routine.
   * Default implementation returns false. Method is overridden in the class
   * Item_param where it returns true.
   */
  virtual bool is_stored_routine_parameter() const { return false; }

  bool check_is_evaluable_expression_or_error()
  {
    if (is_evaluable_expression())
      return false; // Ok
    raise_error_not_evaluable();
    return true;    // Error
  }

  /*
    Create a shallow copy of the item (usually invoking copy constructor).
    For deep copying see build_clone().

    Return value:
    - pointer to a copy of the Item
    - nullptr if the item is not copyable
  */
  Item *get_copy(THD *thd) const
  {
    Item *copy= do_get_copy(thd);
    if (copy)
    {
      // Make sure the copy is of same type as this item
      DBUG_ASSERT(typeid(*copy) == typeid(*this));
    }
    return copy;
  }

  /*
    Creates a clone of the item by deep copying.

    Return value:
    - pointer to a clone of the Item
    - nullptr if the item is not clonable
  */
  Item* build_clone(THD *thd) const
  {
    Item *clone= do_build_clone(thd);
    if (clone)
    {
      // Make sure the clone is of same type as this item
      DBUG_ASSERT(typeid(*clone) == typeid(*this));
    }
    return clone;
  }

  /*
    Clones the constant item (not necessary returning the same item type)

    Return value:
    - pointer to a clone of the Item
    - nullptr if the item is not clonable

    Note: the clone may have item type different from this
    (i.e., instance of another basic constant class may be returned).
    For real clones look at build_clone()/get_copy() methods
  */
  virtual Item *clone_item(THD *thd) const { return nullptr; }

  virtual cond_result eq_cmp_result() const { return COND_OK; }
  inline uint float_length(uint decimals_par) const
  { return decimals < FLOATING_POINT_DECIMALS ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;}
  /* Returns total number of decimal digits */
  decimal_digits_t decimal_precision() const override
  {
    return type_handler()->Item_decimal_precision(this);
  }
  /* Returns the number of integer part digits only */
  inline decimal_digits_t decimal_int_part() const
  { return (decimal_digits_t) my_decimal_int_part(decimal_precision(), decimals); }
  /*
    Returns the number of fractional digits only.
    NOT_FIXED_DEC is replaced to the maximum possible number
    of fractional digits, taking into account the data type.
  */
  decimal_digits_t decimal_scale() const
  {
    return type_handler()->Item_decimal_scale(this);
  }
  /*
    Returns how many digits a divisor adds into a division result.
    This is important when the integer part of the divisor can be 0.
    In this  example:
      SELECT 1 / 0.000001; -> 1000000.0000
    the divisor adds 5 digits into the result precision.

    Currently this method only replaces NOT_FIXED_DEC to
    TIME_SECOND_PART_DIGITS for temporal data types.
    This method can be made virtual, to create more efficient (smaller)
    data types for division results.
    For example, in
      SELECT 1/1.000001;
    the divisor could provide no additional precision into the result,
    so could any other items that are know to return a result
    with non-zero integer part.
  */
  uint divisor_precision_increment() const
  {
    return type_handler()->Item_divisor_precision_increment(this);
  }
  /**
    TIME or DATETIME precision of the item: 0..6
  */
  uint time_precision(THD *thd)
  {
    return const_item() ? type_handler()->Item_time_precision(thd, this) :
                          MY_MIN(decimals, TIME_SECOND_PART_DIGITS);
  }
  uint datetime_precision(THD *thd)
  {
    return const_item() ? type_handler()->Item_datetime_precision(thd, this) :
                          MY_MIN(decimals, TIME_SECOND_PART_DIGITS);
  }
  virtual longlong val_int_min() const
  {
    return LONGLONG_MIN;
  }
  /* 
    Returns true if this is constant (during query execution, i.e. its value
    will not change until next fix_fields) and its value is known.
  */
  virtual bool const_item() const { return used_tables() == 0; }
  /* 
    Returns true if this is constant but its value may be not known yet.
    (Can be used for parameters of prep. stmts or of stored procedures.)
  */
  virtual bool const_during_execution() const 
  { return (used_tables() & ~PARAM_TABLE_BIT) == 0; }

  /**
    This method is used for to:
      - to generate a view definition query (SELECT-statement);
      - to generate a SQL-query for EXPLAIN EXTENDED;
      - to generate a SQL-query to be shown in INFORMATION_SCHEMA;
      - debug.

    For more information about view definition query, INFORMATION_SCHEMA
    query and why they should be generated from the Item-tree, @see
    mysql_register_view().
  */
  virtual enum precedence precedence() const { return DEFAULT_PRECEDENCE; }
  enum precedence higher_precedence() const
  { return (enum precedence)(precedence() + 1); }
  void print_parenthesised(String *str, enum_query_type query_type,
                           enum precedence parent_prec);
  /**
    This helper is used to print expressions as a part of a table definition,
    in particular for
      - generated columns
      - check constraints
      - default value expressions
      - partitioning expressions
  */
  void print_for_table_def(String *str)
  {
    print_parenthesised(str,
                     (enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF |
                                       QT_ITEM_IDENT_SKIP_DB_NAMES |
                                       QT_ITEM_IDENT_SKIP_TABLE_NAMES |
                                       QT_NO_DATA_EXPANSION |
                                       QT_TO_SYSTEM_CHARSET |
                                       QT_FOR_FRM),
                     LOWEST_PRECEDENCE);
  }
  virtual void print(String *str, enum_query_type query_type);
  class Print: public String
  {
  public:
    Print(Item *item, enum_query_type type)
    {
      item->print(this, type);
    }
  };

  void print_item_w_name(String *str, enum_query_type query_type);
  void print_value(String *str);

  virtual void update_used_tables() {}
  virtual COND *build_equal_items(THD *thd, COND_EQUAL *inheited,
                                  bool link_item_fields,
                                  COND_EQUAL **cond_equal_ref)
  {
    update_used_tables();
    DBUG_ASSERT(!cond_equal_ref || !cond_equal_ref[0]);
    return this;
  }
  virtual COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
                                bool top_level);
  virtual void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
                              uint *and_level,
                              table_map usable_tables,
                              SARGABLE_PARAM **sargables)
  {
    return;
  }
   /*
     Make a select tree for all keys in a condition or a condition part
     @param param         Context
     @param cond_ptr[OUT] Store a replacement item here if the condition
                          can be simplified, e.g.:
                            WHERE part1 OR part2 OR part3
                          with one of the partN evaluating to SEL_TREE::ALWAYS.
   */
   virtual SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
  /*
    Checks whether the item is:
    - a simple equality (field=field_item or field=constant_item), or
    - a row equality
    and form multiple equality predicates.
  */
  virtual bool check_equality(THD *thd, COND_EQUAL *cond, List<Item> *eq_list)
  {
    return false;
  }
  virtual void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
                              List<Item> &fields, uint flags) {}
  /* Called for items that really have to be split */
  void split_sum_func2(THD *thd, Ref_ptr_array ref_pointer_array,
                       List<Item> &fields,
                       Item **ref, uint flags);
  virtual bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)= 0;
  bool get_date_from_int(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
  bool get_date_from_real(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
  bool get_date_from_string(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
  bool get_time(THD *thd, MYSQL_TIME *ltime)
  { return get_date(thd, ltime, Time::Options(thd)); }
  // Get a DATE or DATETIME value in numeric packed format for comparison
  virtual longlong val_datetime_packed(THD *thd)
  {
    return Datetime(thd, this, Datetime::Options_cmp(thd)).to_packed();
  }
  // Get a TIME value in numeric packed format for comparison
  virtual longlong val_time_packed(THD *thd)
  {
    return Time(thd, this, Time::Options_cmp(thd)).to_packed();
  }
  longlong val_datetime_packed_result(THD *thd);
  longlong val_time_packed_result(THD *thd);

  virtual bool get_date_result(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
  { return get_date(thd, ltime,fuzzydate); }

  /*
    The method allows to determine nullness of a complex expression 
    without fully evaluating it, instead of calling val/result*() then 
    checking null_value. Used in Item_func_isnull/Item_func_isnotnull
    and Item_sum_count.
    Any new item which can be NULL must implement this method.
  */
  virtual bool is_null() { return 0; }

  /*
   Make sure the null_value member has a correct value.
  */
  virtual void update_null_value ()
  {
    return type_handler()->Item_update_null_value(this);
  }

  /*
    Inform the item that there will be no distinction between its result
    being FALSE or NULL.

    NOTE
      This function will be called for eg. Items that are top-level AND-parts
      of the WHERE clause. Items implementing this function (currently
      Item_cond_and and subquery-related item) enable special optimizations
      when they are "top level".
  */
  virtual void top_level_item() {}
  /*
    Return TRUE if it is item of top WHERE level (AND/OR)  and it is
    important, return FALSE if it not important (we can not use to simplify
    calculations) or not top level
  */
  virtual bool is_top_level_item() const
  { return FALSE; /* not important */}
  /*
    return IN/ALL/ANY subquery or NULL
  */
  virtual Item_in_subselect* get_IN_subquery()
  { return NULL; /* in is not IN/ALL/ANY */ }
  /*
    set field of temporary table for Item which can be switched on temporary
    table during query processing (grouping and so on)
  */
  virtual bool is_result_field() { return 0; }
  virtual bool is_bool_literal() const { return false; }
  /* This is to handle printing of default values */
  virtual bool need_parentheses_in_default() { return false; }
  virtual void save_in_result_field(bool no_conversions) {}
  /*
    Data type format implied by the CHECK CONSTRAINT,
    to be sent to the client in the result set metadata.
  */
  virtual bool set_format_by_check_constraint(Send_field_extended_metadata *)
                                                                        const
  {
    return false;
  }
  /*
    set value of aggregate function in case of no rows for grouping were found
  */
  virtual void no_rows_in_result() {}
  virtual void restore_to_before_no_rows_in_result() {}
  virtual Item *copy_or_same(THD *thd) { return this; }
  virtual Item *copy_andor_structure(THD *thd) { return this; }
  virtual Item *real_item() { return this; }
  const Item *real_item() const { return const_cast<Item*>(this)->real_item(); }
  virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); }
  virtual Item *make_odbc_literal(THD *thd, const LEX_CSTRING *typestr)
  {
    return this;
  }

  static CHARSET_INFO *default_charset();

  CHARSET_INFO *charset_for_protocol(void) const
  {
    return type_handler()->charset_for_protocol(this);
  };

  virtual bool walk(Item_processor processor, bool walk_subquery, void *arg)
  {
    return (this->*processor)(arg);
  }

  virtual Item* transform(THD *thd, Item_transformer transformer, uchar *arg);
  virtual Item* top_level_transform(THD *thd, Item_transformer transformer,
                                    uchar *arg)
  {
    return transform(thd, transformer, arg);
  }

  /*
    This function performs a generic "compilation" of the Item tree.
    The process of compilation is assumed to go as follows: 
    
    compile()
    {
      if (this->*some_analyzer(...))
      {
        compile children if any;
        this->*some_transformer(...);
      }
    }

    i.e. analysis is performed top-down while transformation is done
    bottom-up.      
  */
  virtual Item* compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                        Item_transformer transformer, uchar *arg_t)
  {
    if ((this->*analyzer) (arg_p))
      return ((this->*transformer) (thd, arg_t));
    return 0;
  }
  virtual Item* top_level_compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                                  Item_transformer transformer, uchar *arg_t)
  {
    return compile(thd, analyzer, arg_p, transformer, arg_t);
  }

   virtual void traverse_cond(Cond_traverser traverser,
                              void *arg, traverse_order order)
   {
     (*traverser)(this, arg);
   }

  /*========= Item processors, to be used with Item::walk() ========*/
  virtual bool remove_dependence_processor(void *arg) { return 0; }
  virtual bool cleanup_processor(void *arg);
  virtual bool cleanup_excluding_fields_processor (void *arg)
  { return cleanup_processor(arg); }
  bool cleanup_excluding_immutables_processor (void *arg);
  virtual bool cleanup_excluding_const_fields_processor (void *arg)
  { return cleanup_processor(arg); }
  virtual bool collect_item_field_processor(void *arg) { return 0; }
  virtual bool unknown_splocal_processor(void *arg) { return 0; }
  virtual bool collect_outer_ref_processor(void *arg) {return 0; }
  virtual bool check_inner_refs_processor(void *arg) { return 0; }
  virtual bool find_item_in_field_list_processor(void *arg) { return 0; }
  virtual bool find_item_processor(void *arg);
  virtual bool change_context_processor(void *arg) { return 0; }
  virtual bool reset_query_id_processor(void *arg) { return 0; }
  virtual bool is_expensive_processor(void *arg) { return 0; }
  bool remove_immutable_flag_processor (void *arg);

  // FIXME reduce the number of "add field to bitmap" processors
  virtual bool add_field_to_set_processor(void *arg) { return 0; }
  virtual bool register_field_in_read_map(void *arg) { return 0; }
  virtual bool register_field_in_write_map(void *arg) { return 0; }
  virtual bool register_field_in_bitmap(void *arg) { return 0; }
  virtual bool update_table_bitmaps_processor(void *arg) { return 0; }

  virtual bool enumerate_field_refs_processor(void *arg) { return 0; }
  virtual bool mark_as_eliminated_processor(void *arg) { return 0; }
  virtual bool eliminate_subselect_processor(void *arg) { return 0; }
  virtual bool view_used_tables_processor(void *arg) { return 0; }
  virtual bool eval_not_null_tables(void *arg) { return 0; }
  virtual bool is_subquery_processor(void *arg) { return 0; }
  virtual bool count_sargable_conds(void *arg) { return 0; }
  virtual bool limit_index_condition_pushdown_processor(void *arg) { return 0; }
  virtual bool exists2in_processor(void *arg) { return 0; }
  virtual bool find_selective_predicates_list_processor(void *arg) { return 0; }
  virtual bool cleanup_is_expensive_cache_processor(void *arg)
  {
    is_expensive_cache= (int8)(-1);
    return 0;
  }

  virtual bool set_extraction_flag_processor(void *arg)
  {
    set_extraction_flag(*(int16*)arg);
    return 0;
  }
  virtual bool subselect_table_finder_processor(void *arg) { return 0; };

  /* 
    TRUE if the expression depends only on the table indicated by tab_map
    or can be converted to such an exression using equalities.
    Not to be used for AND/OR formulas.
  */
  virtual bool excl_dep_on_table(table_map tab_map) { return false; }
  /*
    TRUE if the expression depends only on grouping fields of sel
    or can be converted to such an expression using equalities.
    It also checks if the expression doesn't contain stored procedures,
    subqueries or randomly generated elements.
    Not to be used for AND/OR formulas.
  */
  virtual bool excl_dep_on_grouping_fields(st_select_lex *sel)
  { return false; }
  /*
    TRUE if the expression depends only on fields from the left part of
    IN subquery or can be converted to such an expression using equalities.
    Not to be used for AND/OR formulas.
  */
  virtual bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred)
  { return false; }

  virtual bool switch_to_nullable_fields_processor(void *arg) { return 0; }
  virtual bool find_function_processor (void *arg) { return 0; }
  /*
    Check if a partition function is allowed
    SYNOPSIS
      check_partition_func_processor()
      int_arg                        Ignored
    RETURN VALUE
      TRUE                           Partition function not accepted
      FALSE                          Partition function accepted

    DESCRIPTION
    check_partition_func_processor is used to check if a partition function
    uses an allowed function. An allowed function will always ensure that
    X=Y guarantees that also part_function(X)=part_function(Y) where X is
    a set of partition fields and so is Y. The problems comes mainly from
    character sets where two equal strings can be quite unequal. E.g. the
    german character for double s is equal to 2 s.

    The default is that an item is not allowed
    in a partition function. Allowed functions
    can never depend on server version, they cannot depend on anything
    related to the environment. They can also only depend on a set of
    fields in the table itself. They cannot depend on other tables and
    cannot contain any queries and cannot contain udf's or similar.
    If a new Item class is defined and it inherits from a class that is
    allowed in a partition function then it is very important to consider
    whether this should be inherited to the new class. If not the function
    below should be defined in the new Item class.

    The general behaviour is that most integer functions are allowed.
    If the partition function contains any multi-byte collations then
    the function check_part_func_fields will report an error on the
    partition function independent of what functions are used. So the
    only character sets allowed are single character collation and
    even for those only a limited set of functions are allowed. The
    problem with multi-byte collations is that almost every string
    function has the ability to change things such that two strings
    that are equal will not be equal after manipulated by a string
    function. E.g. two strings one contains a double s, there is a
    special german character that is equal to two s. Now assume a
    string function removes one character at this place, then in
    one the double s will be removed and in the other there will
    still be one s remaining and the strings are no longer equal
    and thus the partition function will not sort equal strings into
    the same partitions.

    So the check if a partition function is valid is two steps. First
    check that the field types are valid, next check that the partition
    function is valid. The current set of partition functions valid
    assumes that there are no multi-byte collations amongst the partition
    fields.
  */
  virtual bool check_partition_func_processor(void *arg) { return true; }
  virtual bool post_fix_fields_part_expr_processor(void *arg) { return 0; }
  virtual bool rename_fields_processor(void *arg) { return 0; }
  virtual bool rename_table_processor(void *arg) { return 0; }
  /*
    TRUE if the function is knowingly TRUE or FALSE.
    Not to be used for AND/OR formulas.
  */
  virtual bool is_simplified_cond_processor(void *arg) { return false; }

  /** Processor used to check acceptability of an item in the defining
      expression for a virtual column 

    @param arg     always ignored

    @retval 0    the item is accepted in the definition of a virtual column
    @retval 1    otherwise
  */
  struct vcol_func_processor_result
  {
    uint errors;                                /* Bits of possible errors */
    const char *name;                           /* Not supported function */
    Alter_info *alter_info;
    vcol_func_processor_result() :
      errors(0), name(NULL), alter_info(NULL) {}
  };
  struct func_processor_rename
  {
    LEX_CSTRING db_name;
    LEX_CSTRING table_name;
    List<Create_field> fields;
  };
  struct func_processor_rename_table
  {
    Lex_ident_db old_db;
    Lex_ident_table old_table;
    Lex_ident_db new_db;
    Lex_ident_table new_table;
  };
  virtual bool check_vcol_func_processor(void *arg)
  {
    return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE);
  }
  virtual bool check_handler_func_processor(void *arg) { return 0; }
  virtual bool check_field_expression_processor(void *arg) { return 0; }
  virtual bool check_func_default_processor(void *arg) { return 0; }
  virtual bool update_func_default_processor(void *arg) { return 0; }
  /*
    Check if an expression value has allowed arguments, like DATE/DATETIME
    for date functions. Also used by partitioning code to reject
    timezone-dependent expressions in a (sub)partitioning function.
  */
  virtual bool check_valid_arguments_processor(void *arg) { return 0; }
  virtual bool update_vcol_processor(void *arg) { return 0; }
  virtual bool set_fields_as_dependent_processor(void *arg) { return 0; }
  /*
    Find if some of the key parts of table keys (the reference on table is
    passed as an argument) participate in the expression.
    If there is some, sets a bit for this key in the proper key map.
  */
  virtual bool check_index_dependence(void *arg) { return 0; }
  /*============== End of Item processor list ======================*/

  /*
    Given a condition P from the WHERE clause or from an ON expression of
    the processed SELECT S and a set of join tables from S marked in the
    parameter 'allowed'={T} a call of P->find_not_null_fields({T}) has to
    find the set fields {F} of the tables from 'allowed' such that:
    - each field from {F} is declared as nullable
    - each record of table t from {T} that contains NULL as the value for at
      at least one field from {F} can be ignored when building the result set
      for S
    It is assumed here that the condition P is conjunctive and all its column
    references belong to T.

    Examples:
      CREATE TABLE t1 (a int, b int);
      CREATE TABLE t2 (a int, b int);

      SELECT * FROM t1,t2 WHERE t1.a=t2.a and t1.b > 5;
      A call of find_not_null_fields() for the whole WHERE condition and {t1,t2}
      should find {t1.a,t1.b,t2.a}

      SELECT * FROM t1 LEFT JOIN ON (t1.a=t2.a and t2.a > t2.b);
      A call of find_not_null_fields() for the ON expression and {t2}
      should find {t2.a,t2.b}

    The function returns TRUE if it succeeds to prove that all records of
    a table from {T} can be ignored. Otherwise it always returns FALSE.

    Example:
      SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t2.a IS NULL;
    A call of find_not_null_fields() for the WHERE condition and {t1,t2}
    will return TRUE.

    It is assumed that the implementation of this virtual function saves
    the info on the found set of fields in the structures associates with
    tables from {T}.
  */
  virtual bool find_not_null_fields(table_map allowed) { return false; }

  bool cache_const_expr_analyzer(uchar **arg);
  Item* cache_const_expr_transformer(THD *thd, uchar *arg);

  virtual Item* propagate_equal_fields(THD*, const Context &, COND_EQUAL *)
  {
    return this;
  };

  Item* propagate_equal_fields_and_change_item_tree(THD *thd,
                                                    const Context &ctx,
                                                    COND_EQUAL *cond,
                                                    Item **place);

  /* arg points to REPLACE_EQUAL_FIELD_ARG object */
  virtual Item *replace_equal_field(THD *thd, uchar *arg) { return this; }

  struct Collect_deps_prm
  {
    List<Item> *parameters;
    /* unit from which we count nest_level */
    st_select_lex_unit *nest_level_base;
    uint count;
    int nest_level;
    bool collect;
  };

  /*
    For SP local variable returns pointer to Item representing its
    current value and pointer to current Item otherwise.
  */
  virtual Item *this_item() { return this; }
  virtual const Item *this_item() const { return this; }

  /*
    For SP local variable returns address of pointer to Item representing its
    current value and pointer passed via parameter otherwise.
  */
  virtual Item **this_item_addr(THD *thd, Item **addr_arg) { return addr_arg; }

  // Row emulation
  virtual uint cols() const { return 1; }
  virtual Item* element_index(uint i) { return this; }
  virtual Item** addr(uint i) { return 0; }
  virtual bool check_cols(uint c);
  bool check_type_traditional_scalar(const LEX_CSTRING &opname) const;
  bool check_type_scalar(const LEX_CSTRING &opname) const;
  bool check_type_or_binary(const LEX_CSTRING &opname,
                            const Type_handler *handler) const;
  bool check_type_general_purpose_string(const LEX_CSTRING &opname) const;
  bool check_type_can_return_int(const LEX_CSTRING &opname) const;
  bool check_type_can_return_decimal(const LEX_CSTRING &opname) const;
  bool check_type_can_return_real(const LEX_CSTRING &opname) const;
  bool check_type_can_return_str(const LEX_CSTRING &opname) const;
  bool check_type_can_return_text(const LEX_CSTRING &opname) const;
  bool check_type_can_return_date(const LEX_CSTRING &opname) const;
  bool check_type_can_return_time(const LEX_CSTRING &opname) const;
  // It is not row => null inside is impossible
  virtual bool null_inside() { return 0; }
  // used in row subselects to get value of elements
  virtual void bring_value() {}

  const Type_handler *type_handler_long_or_longlong() const
  {
    return Type_handler::type_handler_long_or_longlong(max_char_length(),
                                                       unsigned_flag);
  }

  /**
    Create field for temporary table.
    @param table          Temporary table
    @param [OUT] src      Who created the fields
    @param param          Create parameters
    @retval               NULL (on error)
    @retval               a pointer to a newly create Field (on success)
  */
  virtual Field *create_tmp_field_ex(MEM_ROOT *root,
                                     TABLE *table,
                                     Tmp_field_src *src,
                                     const Tmp_field_param *param)= 0;
  virtual Item_field *field_for_view_update() { return 0; }

  virtual Item *neg_transformer(THD *thd) { return NULL; }
  virtual Item *update_value_transformer(THD *thd, uchar *select_arg)
  { return this; }
  virtual Item *expr_cache_insert_transformer(THD *thd, uchar *unused)
  { return this; }
  virtual Item *derived_field_transformer_for_having(THD *thd, uchar *arg)
  { return this; }
  virtual Item *derived_field_transformer_for_where(THD *thd, uchar *arg)
  { return this; }
  virtual Item *grouping_field_transformer_for_where(THD *thd, uchar *arg)
  { return this; }
  /* Now is not used. */
  virtual Item *in_subq_field_transformer_for_where(THD *thd, uchar *arg)
  { return this; }
  virtual Item *in_subq_field_transformer_for_having(THD *thd, uchar *arg)
  { return this; }
  virtual Item *in_predicate_to_in_subs_transformer(THD *thd, uchar *arg)
  { return this; }
  virtual Item *in_predicate_to_equality_transformer(THD *thd, uchar *arg)
  { return this; }
  virtual Item *field_transformer_for_having_pushdown(THD *thd, uchar *arg)
  { return this; }
  virtual Item *multiple_equality_transformer(THD *thd, uchar *arg);
  virtual bool expr_cache_is_needed(THD *) { return FALSE; }
  virtual Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs);
  bool needs_charset_converter(uint32 length, CHARSET_INFO *tocs) const
  {
    /*
      This will return "true" if conversion happens:
      - between two non-binary different character sets
      - from "binary" to "unsafe" character set
        (those that can have non-well-formed string)
      - from "binary" to UCS2-alike character set with mbminlen>1,
        when prefix left-padding is needed for an incomplete character:
        binary 0xFF -> ucs2 0x00FF)
    */
    if (!String::needs_conversion_on_storage(length,
                                             collation.collation, tocs))
      return false;
    /*
      No needs to add converter if an "arg" is NUMERIC or DATETIME
      value (which is pure ASCII) and at the same time target DTCollation
      is ASCII-compatible. For example, no needs to rewrite:
        SELECT * FROM t1 WHERE datetime_field = '2010-01-01';
      to
        SELECT * FROM t1 WHERE CONVERT(datetime_field USING cs) = '2010-01-01';

      TODO: avoid conversion of any values with
      repertoire ASCII and 7bit-ASCII-compatible,
      not only numeric/datetime origin.
    */
    if (collation.derivation == DERIVATION_NUMERIC &&
        collation.repertoire == MY_REPERTOIRE_ASCII &&
        !(collation.collation->state & MY_CS_NONASCII) &&
        !(tocs->state & MY_CS_NONASCII))
      return false;
    return true;
  }
  bool needs_charset_converter(CHARSET_INFO *tocs)
  {
    // Pass 1 as length to force conversion if tocs->mbminlen>1.
    return needs_charset_converter(1, tocs);
  }
  Item *const_charset_converter(THD *thd, CHARSET_INFO *tocs, bool lossless,
                                const char *func_name);
  Item *const_charset_converter(THD *thd, CHARSET_INFO *tocs, bool lossless)
  { return const_charset_converter(thd, tocs, lossless, NULL); }
  void delete_self()
  {
    cleanup();
    delete this;
  }

  virtual const Item_const *get_item_const() const { return NULL; }
  virtual Item_splocal *get_item_splocal() { return 0; }
  virtual Rewritable_query_parameter *get_rewritable_query_parameter()
  { return 0; }

  /*
    Return Settable_routine_parameter interface of the Item.  Return 0
    if this Item is not Settable_routine_parameter.
  */
  virtual Settable_routine_parameter *get_settable_routine_parameter()
  {
    return 0;
  }

  virtual Load_data_outvar *get_load_data_outvar()
  {
    return 0;
  }
  Load_data_outvar *get_load_data_outvar_or_error()
  {
    Load_data_outvar *dst= get_load_data_outvar();
    if (dst)
      return dst;
    my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), name.str);
    return NULL;
  }

  /**
    Test whether an expression is expensive to compute. Used during
    optimization to avoid computing expensive expressions during this
    phase. Also used to force temp tables when sorting on expensive
    functions.
    @todo
    Normally we should have a method:
      cost Item::execution_cost(),
    where 'cost' is either 'double' or some structure of various cost
    parameters.

    @note
      This function is now used to prevent evaluation of expensive subquery
      predicates during the optimization phase. It also prevents evaluation
      of predicates that are not computable at this moment.
  */
  virtual bool is_expensive()
  {
    if (is_expensive_cache < 0)
      is_expensive_cache= walk(&Item::is_expensive_processor, 0, NULL);
    return MY_TEST(is_expensive_cache);
  }
  String *check_well_formed_result(String *str, bool send_error= 0);
  bool eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs); 
  bool too_big_for_varchar() const
  { return max_char_length() > CONVERT_IF_BIGGER_TO_BLOB; }
  void fix_length_and_charset(uint32 max_char_length_arg, CHARSET_INFO *cs)
  {
    max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
    collation.collation= cs;
  }
  void fix_char_length(size_t max_char_length_arg)
  {
    max_length= char_to_byte_length_safe(max_char_length_arg,
                                         collation.collation->mbmaxlen);
  }
  /*
    Return TRUE if the item points to a column of an outer-joined table.
  */
  virtual bool is_outer_field() const { DBUG_ASSERT(fixed()); return FALSE; }

  Item* set_expr_cache(THD *thd);

  virtual Item_equal *get_item_equal() { return NULL; }
  virtual void set_item_equal(Item_equal *item_eq) {};
  virtual Item_equal *find_item_equal(COND_EQUAL *cond_equal) { return NULL; }
  /**
    Set the join tab index to the minimal (left-most) JOIN_TAB to which this
    Item is attached. The number is an index is depth_first_tab() traversal
    order.
  */
  virtual void set_join_tab_idx(uint8 join_tab_idx_arg)
  {
    if (join_tab_idx_arg < join_tab_idx)
      join_tab_idx= join_tab_idx_arg;
  }
  uint get_join_tab_idx() const { return join_tab_idx; }

  table_map view_used_tables(TABLE_LIST *view)
  {
    view->view_used_tables= 0;
    walk(&Item::view_used_tables_processor, 0, view);
    return view->view_used_tables;
  }

  /**
    Collect and add to the list cache parameters for this Item.

    @note Now implemented only for subqueries and in_optimizer,
    if we need it for general function then this method should
    be defined for Item_func.
  */
  virtual void get_cache_parameters(List<Item> &parameters) { };

  virtual void mark_as_condition_AND_part(TABLE_LIST *embedding) {};

  /* how much position should be reserved for Exists2In transformation */
  virtual uint exists2in_reserved_items() { return 0; };

  virtual Item *neg(THD *thd);

  /**
    Inform the item that it is located under a NOT, which is a top-level item.
  */
  virtual void under_not(Item_func_not * upper
                         __attribute__((unused))) {};

  void register_in(THD *thd);	 
  
  bool depends_only_on(table_map view_map) 
  { return marker & MARKER_FULL_EXTRACTION; }
  int get_extraction_flag()
  { return marker & MARKER_EXTRACTION_MASK; }
  void set_extraction_flag(int16 flags)
  {
    marker &= ~MARKER_EXTRACTION_MASK;
    marker|= flags;
  }
  void clear_extraction_flag()
  {
    marker &= ~MARKER_EXTRACTION_MASK;
  }
  void check_pushable_cond(Pushdown_checker excl_dep_func, uchar *arg);
  bool pushable_cond_checker_for_derived(uchar *arg)
  {
    return excl_dep_on_table(*((table_map *)arg));
  }
  bool pushable_cond_checker_for_subquery(uchar *arg)
  {
    DBUG_ASSERT(((Item*) arg)->get_IN_subquery());
    return excl_dep_on_in_subq_left_part(((Item*)arg)->get_IN_subquery());
  }
  Item *build_pushable_cond(THD *thd,
                            Pushdown_checker checker,
                            uchar *arg);
  /*
    Checks if this item depends only on the arg table
  */
  bool pushable_equality_checker_for_derived(uchar *arg)
  {
    return (used_tables() == *((table_map *)arg));
  }
  /*
    Checks if this item consists in the left part of arg IN subquery predicate
  */
  bool pushable_equality_checker_for_subquery(uchar *arg);

  /**
    This method is to set relationship between a positional parameter
    represented by the '?' and an actual argument value passed to the
    call of PS/SP by the USING clause. The method is overridden in classes
    Item_param and Item_default_value.
  */
  virtual bool associate_with_target_field(THD *, Item_field *)
  {
    DBUG_ASSERT(fixed());
    return false;
  }

protected:
  /*
    Service function for public method get_copy(). See comments for get_copy()
    above. Override this method in derived classes to create shallow copies of
    the item
  */
  virtual Item *do_get_copy(THD *thd) const = 0;

  /*
    Service function for public method build_clone(). See comments for
    build_clone() above. Override this method in derived classes to create
    deep copies (clones) of the item where possible
  */
  virtual Item* do_build_clone(THD *thd) const = 0;
};

MEM_ROOT *get_thd_memroot(THD *thd);

template <class T>
inline Item* get_item_copy (THD *thd, const T* item)
{
  Item *copy= new (get_thd_memroot(thd)) T(*item);
  if (likely(copy))
    copy->register_in(thd);
  return copy;
}	


#ifndef DBUG_OFF
/**
  A helper class to print the data type and the value for an Item
  in debug builds.
*/
class DbugStringItemTypeValue: public StringBuffer<128>
{
public:
  DbugStringItemTypeValue(THD *thd, const Item *item)
  {
    append('(');
    Name Item_name= item->type_handler()->name();
    append(Item_name.ptr(), Item_name.length());
    append(')');
    const_cast<Item*>(item)->print(this, QT_EXPLAIN);
    /* Append end \0 to allow usage of c_ptr() */
    append('\0');
    str_length--;
  }
};
#endif /* DBUG_OFF */


/**
  Compare two Items for List<Item>::add_unique()
*/

bool cmp_items(Item *a, Item *b);


/**
  Array of items, e.g. function or aggerate function arguments.
*/
class Item_args
{
protected:
  Item **args, *tmp_arg[2];
  uint arg_count;
  void set_arguments(THD *thd, List<Item> &list);
  bool walk_args(Item_processor processor, bool walk_subquery, void *arg)
  {
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->walk(processor, walk_subquery, arg))
        return true;
    }
    return false;
  }
  bool transform_args(THD *thd, Item_transformer transformer, uchar *arg);
  void propagate_equal_fields(THD *, const Item::Context &, COND_EQUAL *);
  bool excl_dep_on_table(table_map tab_map)
  {
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->const_item())
        continue;
      if (!args[i]->excl_dep_on_table(tab_map))
        return false;
    }
    return true;
  }
  bool excl_dep_on_grouping_fields(st_select_lex *sel);
  bool eq(const Item_args *other, bool binary_cmp) const
  {
    for (uint i= 0; i < arg_count ; i++)
    {
      if (!args[i]->eq(other->args[i], binary_cmp))
        return false;
    }
    return true;
  }
  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred)
  {
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->const_item())
        continue;
      if (!args[i]->excl_dep_on_in_subq_left_part(subq_pred))
        return false;
    }
    return true;
  }
public:
  Item_args(void)
    :args(NULL), arg_count(0)
  { }
  Item_args(Item *a)
    :args(tmp_arg), arg_count(1)
  {
    args[0]= a;
  }
  Item_args(Item *a, Item *b)
    :args(tmp_arg), arg_count(2)
  {
    args[0]= a; args[1]= b;
  }
  Item_args(THD *thd, Item *a, Item *b, Item *c)
  {
    arg_count= 0;
    if (likely((args= (Item**) thd_alloc(thd, sizeof(Item*) * 3))))
    {
      arg_count= 3;
      args[0]= a; args[1]= b; args[2]= c;
    }
  }
  Item_args(THD *thd, Item *a, Item *b, Item *c, Item *d)
  {
    arg_count= 0;
    if (likely((args= (Item**) thd_alloc(thd, sizeof(Item*) * 4))))
    {
      arg_count= 4;
      args[0]= a; args[1]= b; args[2]= c; args[3]= d;
    }
  }
  Item_args(THD *thd, Item *a, Item *b, Item *c, Item *d, Item* e)
  {
    arg_count= 5;
    if (likely((args= (Item**) thd_alloc(thd, sizeof(Item*) * 5))))
    {
      arg_count= 5;
      args[0]= a; args[1]= b; args[2]= c; args[3]= d; args[4]= e;
    }
  }
  Item_args(THD *thd, List<Item> &list)
  {
    set_arguments(thd, list);
  }
  Item_args(THD *thd, const Item_args *other);
  bool alloc_arguments(THD *thd, uint count);
  void add_argument(Item *item)
  {
    args[arg_count++]= item;
  }
  /**
    Extract row elements from the given position.
    For example, for this input:  (1,2),(3,4),(5,6)
      pos=0 will extract  (1,3,5)
      pos=1 will extract  (2,4,6)
    @param  thd  - current thread, to allocate memory on its mem_root
    @param  rows - an array of compatible ROW-type items
    @param  pos  - the element position to extract
  */
  bool alloc_and_extract_row_elements(THD *thd, const Item_args *rows, uint pos)
  {
    DBUG_ASSERT(rows->argument_count() > 0);
    DBUG_ASSERT(rows->arguments()[0]->cols() > pos);
    if (alloc_arguments(thd, rows->argument_count()))
      return true;
    for (uint i= 0; i < rows->argument_count(); i++)
    {
      DBUG_ASSERT(rows->arguments()[0]->cols() == rows->arguments()[i]->cols());
      Item *arg= rows->arguments()[i]->element_index(pos);
      add_argument(arg);
    }
    DBUG_ASSERT(argument_count() == rows->argument_count());
    return false;
  }
  inline Item **arguments() const { return args; }
  inline uint argument_count() const { return arg_count; }
  inline void remove_arguments() { arg_count=0; }
  Sql_mode_dependency value_depends_on_sql_mode_bit_or() const;
};


/*
  Class to be used to enumerate all field references in an item tree. This
  includes references to outside but not fields of the tables within a
  subquery.
  Suggested usage:

    class My_enumerator : public Field_enumerator 
    {
      virtual void visit_field() { ... your actions ...} 
    }

    My_enumerator enumerator;
    item->walk(Item::enumerate_field_refs_processor, ...,&enumerator);

  This is similar to Visitor pattern.
*/

class Field_enumerator
{
public:
  virtual void visit_field(Item_field *field)= 0;
  virtual ~Field_enumerator() = default;;             /* purecov: inspected */
  Field_enumerator() = default;                       /* Remove gcc warning */
};

class Item_string;


class Item_fixed_hybrid: public Item
{
public:
  Item_fixed_hybrid(THD *thd): Item(thd)
  {
    base_flags&= ~item_base_t::FIXED;
  }
  Item_fixed_hybrid(THD *thd, Item_fixed_hybrid *item)
   :Item(thd, item)
  {
    base_flags|= (item->base_flags & item_base_t::FIXED);
  }
  bool fix_fields(THD *thd, Item **ref) override
  {
    DBUG_ASSERT(!fixed());
    base_flags|= item_base_t::FIXED;
    return false;
  }
  void cleanup() override
  {
    Item::cleanup();
    base_flags&= ~item_base_t::FIXED;
  }
  void quick_fix_field() override
  { base_flags|= item_base_t::FIXED; }
  void unfix_fields() override
  { base_flags&= ~item_base_t::FIXED; }
};


/**
  A common class for Item_basic_constant and Item_param
*/
class Item_basic_value :public Item,
                        public Item_const
{
protected:
  // Value metadata, e.g. to make string processing easier
  class Metadata: private MY_STRING_METADATA
  {
  public:
    Metadata(const String *str)
    {
      my_string_metadata_get(this, str->charset(), str->ptr(), str->length());
    }
    Metadata(const String *str, my_repertoire_t repertoire_arg)
    {
      MY_STRING_METADATA::repertoire= repertoire_arg;
      MY_STRING_METADATA::char_length= str->numchars();
    }
    my_repertoire_t repertoire() const
    {
      return MY_STRING_METADATA::repertoire;
    }
    size_t char_length() const { return MY_STRING_METADATA::char_length; }
  };
  void fix_charset_and_length(CHARSET_INFO *cs,
                              Derivation dv, Metadata metadata)
  {
    /*
      We have to have a different max_length than 'length' here to
      ensure that we get the right length if we do use the item
      to create a new table. In this case max_length must be the maximum
      number of chars for a string of this type because we in Create_field::
      divide the max_length with mbmaxlen).
    */
    collation.set(cs, dv, metadata.repertoire());
    fix_char_length(metadata.char_length());
    decimals= NOT_FIXED_DEC;
  }
  void fix_charset_and_length_from_str_value(const String &str, Derivation dv)
  {
    fix_charset_and_length(str.charset(), dv, Metadata(&str));
  }
  Item_basic_value(THD *thd): Item(thd) {}
  Item_basic_value(): Item() {}
public:
  Field *create_tmp_field_ex(MEM_ROOT *root,
                             TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {

    /*
      create_tmp_field_ex() for this type of Items is called for:
      - CREATE TABLE ... SELECT
      - In ORDER BY: SELECT max(a) FROM t1 GROUP BY a ORDER BY 'const';
      - In CURSORS:
          DECLARE c CURSOR FOR SELECT 'test';
          OPEN c;
    */
    return tmp_table_field_from_field_type_maybe_null(root,
                                            table, src, param,
                                            type() == Item::NULL_ITEM);
  }
  bool eq(const Item *item, bool binary_cmp) const override;
  const Type_all_attributes *get_type_all_attributes_from_const() const
    override
  { return this; }
};


class Item_basic_constant :public Item_basic_value
{
public:
  Item_basic_constant(THD *thd): Item_basic_value(thd) {};
  Item_basic_constant(): Item_basic_value() {};
  bool check_vcol_func_processor(void *) override { return false; }
  const Item_const *get_item_const() const override { return this; }
  virtual Item_basic_constant *make_string_literal_concat(THD *thd,
                                                          const LEX_CSTRING *)
  {
    DBUG_ASSERT(0);
    return this;
  }
  bool val_bool() override = 0;
};


/*****************************************************************************
  The class is a base class for representation of stored routine variables in
  the Item-hierarchy. There are the following kinds of SP-vars:
    - local variables (Item_splocal);
    - CASE expression (Item_case_expr);
*****************************************************************************/

class Item_sp_variable :public Item_fixed_hybrid
{
protected:
  /*
    THD, which is stored in fix_fields() and is used in this_item() to avoid
    current_thd use.
  */
  THD *m_thd;

  bool fix_fields_from_item(THD *thd, Item **, const Item *);
public:
  LEX_CSTRING m_name;

public:
#ifdef DBUG_ASSERT_EXISTS
  /*
    Routine to which this Item_splocal belongs. Used for checking if correct
    runtime context is used for variable handling.
  */
  const sp_head *m_sp;
#endif

public:
  Item_sp_variable(THD *thd, const LEX_CSTRING *sp_var_name);

public:
  bool fix_fields(THD *thd, Item **) override= 0;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *sp) override;
  my_decimal *val_decimal(my_decimal *decimal_value) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *to) override;
  bool is_null() override;

public:
  void make_send_field(THD *thd, Send_field *field) override;
  bool const_item() const override { return true; }
  Field *create_tmp_field_ex(MEM_ROOT *root,
                             TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    return create_tmp_field_ex_simple(root, table, src, param);
  }
  inline int save_in_field(Field *field, bool no_conversions) override;
  inline bool send(Protocol *protocol, st_value *buffer) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(m_name.str, arg, VCOL_IMPOSSIBLE);
  }
};

/*****************************************************************************
  Item_sp_variable inline implementation.
*****************************************************************************/

inline int Item_sp_variable::save_in_field(Field *field, bool no_conversions)
{
  return this_item()->save_in_field(field, no_conversions);
}

inline bool Item_sp_variable::send(Protocol *protocol, st_value *buffer)
{
  return this_item()->send(protocol, buffer);
}


/*****************************************************************************
  A reference to local SP variable (incl. reference to SP parameter), used in
  runtime.
*****************************************************************************/

class Item_splocal :public Item_sp_variable,
                    private Settable_routine_parameter,
                    public Rewritable_query_parameter,
                    public Type_handler_hybrid_field_type
{
protected:
  const Sp_rcontext_handler *m_rcontext_handler;

  uint m_var_idx;

  Type m_type;

  bool append_value_for_log(THD *thd, String *str);

  sp_rcontext *get_rcontext(sp_rcontext *local_ctx) const;
  Item_field *get_variable(sp_rcontext *ctx) const;

public:
  Item_splocal(THD *thd, const Sp_rcontext_handler *rh,
               const LEX_CSTRING *sp_var_name, uint sp_var_idx,
               const Type_handler *handler,
               uint pos_in_q= 0, uint len_in_q= 0);

  bool fix_fields(THD *, Item **) override;
  Item *this_item() override;
  const Item *this_item() const override;
  Item **this_item_addr(THD *thd, Item **) override;

  void print(String *str, enum_query_type query_type) override;

public:
  inline const LEX_CSTRING *my_name() const;

  inline uint get_var_idx() const;

  Type type() const override { return m_type; }
  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }
  uint cols() const override { return this_item()->cols(); }
  Item* element_index(uint i) override
  { return this_item()->element_index(i); }
  Item** addr(uint i) override { return this_item()->addr(i); }
  bool check_cols(uint c) override;

private:
  bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;

public:
  Item_splocal *get_item_splocal() override { return this; }

  Rewritable_query_parameter *get_rewritable_query_parameter() override
  { return this; }

  Settable_routine_parameter *get_settable_routine_parameter() override
  { return this; }

  bool append_for_log(THD *thd, String *str) override;

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_splocal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }

  /*
    Override the inherited create_field_for_create_select(),
    because we want to preserve the exact data type for:
      DECLARE a1 INT;
      DECLARE a2 TYPE OF t1.a2;
      CREATE TABLE t1 AS SELECT a1, a2;
    The inherited implementation would create a column
    based on result_type(), which is less exact.
  */
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  { return create_table_field_from_handler(root, table); }

  bool is_valid_limit_clause_variable_with_error() const
  {
    /*
      In case if the variable has an anchored data type, e.g.:
        DECLARE a TYPE OF t1.a;
      type_handler() is set to &type_handler_null and this
      function detects such variable as not valid in LIMIT.
    */
    if (type_handler()->is_limit_clause_valid_type())
      return true;
    my_error(ER_WRONG_SPVAR_TYPE_IN_LIMIT, MYF(0));
    return false;
  }
};


/**
  An Item_splocal variant whose data type becomes known only at
  sp_rcontext creation time, e.g. "DECLARE var1 t1.col1%TYPE".
*/
class Item_splocal_with_delayed_data_type: public Item_splocal
{
public:
  Item_splocal_with_delayed_data_type(THD *thd,
                                      const Sp_rcontext_handler *rh,
                                      const LEX_CSTRING *sp_var_name,
                                      uint sp_var_idx,
                                      uint pos_in_q, uint len_in_q)
   :Item_splocal(thd, rh, sp_var_name, sp_var_idx, &type_handler_null,
                 pos_in_q, len_in_q)
  { }

  Item *do_get_copy(THD *) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
};


/**
  SP variables that are fields of a ROW.
  DELCARE r ROW(a INT,b INT);
  SELECT r.a; -- This is handled by Item_splocal_row_field
*/
class Item_splocal_row_field :public Item_splocal
{
protected:
  LEX_CSTRING m_field_name;
  uint m_field_idx;
  bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;
public:
  Item_splocal_row_field(THD *thd,
                         const Sp_rcontext_handler *rh,
                         const LEX_CSTRING *sp_var_name,
                         const LEX_CSTRING *sp_field_name,
                         uint sp_var_idx, uint sp_field_idx,
                         const Type_handler *handler,
                         uint pos_in_q= 0, uint len_in_q= 0)
   :Item_splocal(thd, rh, sp_var_name, sp_var_idx, handler, pos_in_q, len_in_q),
    m_field_name(*sp_field_name),
    m_field_idx(sp_field_idx)
  { }
  bool fix_fields(THD *thd, Item **) override;
  Item *this_item() override;
  const Item *this_item() const override;
  Item **this_item_addr(THD *thd, Item **) override;
  bool append_for_log(THD *thd, String *str) override;
  void print(String *str, enum_query_type query_type) override;

  Item *do_get_copy(THD *) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
};


class Item_splocal_row_field_by_name :public Item_splocal_row_field
{
  bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;
public:
  Item_splocal_row_field_by_name(THD *thd,
                                 const Sp_rcontext_handler *rh,
                                 const LEX_CSTRING *sp_var_name,
                                 const LEX_CSTRING *sp_field_name,
                                 uint sp_var_idx,
                                 const Type_handler *handler,
                                 uint pos_in_q= 0, uint len_in_q= 0)
   :Item_splocal_row_field(thd, rh, sp_var_name, sp_field_name,
                           sp_var_idx, 0 /* field index will be set later */,
                           handler, pos_in_q, len_in_q)
  { }
  bool fix_fields(THD *thd, Item **it) override;
  void print(String *str, enum_query_type query_type) override;

  Item *do_get_copy(THD *) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
};


/*****************************************************************************
  Item_splocal inline implementation.
*****************************************************************************/

inline const LEX_CSTRING *Item_splocal::my_name() const
{
  return &m_name;
}

inline uint Item_splocal::get_var_idx() const
{
  return m_var_idx;
}

/*****************************************************************************
  A reference to case expression in SP, used in runtime.
*****************************************************************************/

class Item_case_expr :public Item_sp_variable
{
public:
  Item_case_expr(THD *thd, uint case_expr_id);

public:
  bool fix_fields(THD *thd, Item **) override;
  Item *this_item() override;
  const Item *this_item() const override;
  Item **this_item_addr(THD *thd, Item **) override;

  Type type() const override;
  const Type_handler *type_handler() const override
  { return this_item()->type_handler(); }

public:
  /*
    NOTE: print() is intended to be used from views and for debug.
    Item_case_expr can not occur in views, so here it is only for debug
    purposes.
  */
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }

private:
  uint m_case_expr_id;
};

/*****************************************************************************
  Item_case_expr inline implementation.
*****************************************************************************/

inline enum Item::Type Item_case_expr::type() const
{
  return this_item()->type();
}

/*
  NAME_CONST(given_name, const_value). 
  This 'function' has all properties of the supplied const_value (which is 
  assumed to be a literal constant), and the name given_name. 

  This is used to replace references to SP variables when we write PROCEDURE
  statements into the binary log.

  TODO
    Together with Item_splocal and Item::this_item() we can actually extract
    common a base of this class and Item_splocal. Maybe it is possible to
    extract a common base with class Item_ref, too.
*/

class Item_name_const : public Item_fixed_hybrid
{
  Item *value_item;
  Item *name_item;
public:
  Item_name_const(THD *thd, Item *name_arg, Item *val);

  bool fix_fields(THD *, Item **) override;

  Type type() const override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *sp) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *to) override;
  bool is_null() override;
  void print(String *str, enum_query_type query_type) override;

  const Type_handler *type_handler() const override
  {
    return value_item->type_handler();
  }

  bool const_item() const override { return true; }

  Field *create_tmp_field_ex(MEM_ROOT *root,
                             TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    /*
      We can get to here when using a CURSOR for a query with NAME_CONST():
        DECLARE c CURSOR FOR SELECT NAME_CONST('x','y') FROM t1;
        OPEN c;
    */
    return tmp_table_field_from_field_type_maybe_null(root, table, src, param,
                                              type() == Item::NULL_ITEM);
  }
  int save_in_field(Field *field, bool no_conversions) override
  {
    return value_item->save_in_field(field, no_conversions);
  }

  bool send(Protocol *protocol, st_value *buffer) override
  {
    return value_item->send(protocol, buffer);
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("name_const()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_name_const>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_literal: public Item_basic_constant
{
public:
  Item_literal(THD *thd): Item_basic_constant(thd)
  { }
  Item_literal(): Item_basic_constant()
  {}
  Type type() const override { return CONST_ITEM; }
  bool check_partition_func_processor(void *int_arg) override { return false;}
  bool const_item() const override { return true; }
  bool basic_const_item() const override { return true; }
  bool is_expensive() override { return false; }
  bool cleanup_is_expensive_cache_processor(void *arg) override { return 0; }
};


class Item_num: public Item_literal
{
public:
  Item_num(THD *thd): Item_literal(thd) { collation= DTCollation_numeric(); }
  Item_num(): Item_literal() { collation= DTCollation_numeric(); }
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
};

#define NO_CACHED_FIELD_INDEX ((field_index_t) ~0U)

class st_select_lex;


class Item_result_field :public Item_fixed_hybrid /* Item with result field */
{
protected:
  Field *create_tmp_field_ex_from_handler(MEM_ROOT *root, TABLE *table,
                                          Tmp_field_src *src,
                                          const Tmp_field_param *param,
                                          const Type_handler *h);
public:
  Field *result_field;				/* Save result here */
  Item_result_field(THD *thd): Item_fixed_hybrid(thd), result_field(0) {}
  // Constructor used for Item_sum/Item_cond_and/or (see Item comment)
  Item_result_field(THD *thd, Item_result_field *item):
    Item_fixed_hybrid(thd, item), result_field(item->result_field)
  {}
  ~Item_result_field() = default;
  Field *get_tmp_table_field() override { return result_field; }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    DBUG_ASSERT(fixed());
    const Type_handler *h= type_handler()->type_handler_for_tmp_table(this);
    return create_tmp_field_ex_from_handler(root, table, src, param, h);
  }
  void get_tmp_field_src(Tmp_field_src *src, const Tmp_field_param *param);
  /*
    This implementation of used_tables() used by Item_avg_field and
    Item_variance_field which work when only temporary table left, so theu
    return table map of the temporary table.
  */
  table_map used_tables() const override { return 1; }
  bool is_result_field() override { return true; }
  void save_in_result_field(bool no_conversions) override
  {
    save_in_field(result_field, no_conversions);
  }
  void cleanup() override;
  bool check_vcol_func_processor(void *) override { return false; }
};


class Item_ident :public Item_result_field
{
protected:
  /* 
    We have to store initial values of db_name, table_name and field_name
    to be able to restore them during cleanup() because they can be 
    updated during fix_fields() to values from Field object and life-time 
    of those is shorter than life-time of Item_field.
  */
  Lex_table_name orig_db_name;
  Lex_table_name orig_table_name;
  Lex_ident      orig_field_name;

  void undeclared_spvar_error() const;

public:
  Name_resolution_context *context;
  Lex_table_name db_name;
  Lex_table_name table_name;
  Lex_ident      field_name;
  /*
    Cached pointer to table which contains this field, used for the same reason
    by prep. stmt. too in case then we have not-fully qualified field.
    0 - means no cached value.
  */
  TABLE_LIST *cached_table;
  st_select_lex *depended_from;
  /*
    Cached value of index for this field in table->field array, used by prepared
    stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX
    if index value is not known.
  */
  field_index_t cached_field_index;
  /*
    Some Items resolved in another select should not be marked as dependency
    of the subquery where they are. During normal name resolution, we check
    this. Stored procedures and prepared statements first try to resolve an
    ident item using a cached table reference and field position from the
    previous query execution (cached_table/cached_field_index). If the
    tables were not changed, the ident matches the table/field, and we have
    faster resolution of the ident without looking through all tables and
    fields in the query. But in this case, we can not check all conditions
    about this ident item dependency, so we should cache the condition in
    this variable.
  */
  bool can_be_depended;
  /*
     NOTE: came from TABLE::alias_name_used and this is only a hint!
     See comment for TABLE::alias_name_used.
  */
  bool alias_name_used; /* true if item was resolved against alias */

  Item_ident(THD *thd, Name_resolution_context *context_arg,
             const LEX_CSTRING &db_name_arg, const LEX_CSTRING &table_name_arg,
             const LEX_CSTRING &field_name_arg);
  Item_ident(THD *thd, Item_ident *item);
  Item_ident(THD *thd, TABLE_LIST *view_arg, const LEX_CSTRING &field_name_arg);
  LEX_CSTRING full_name_cstring() const override;
  void cleanup() override;
  st_select_lex *get_depended_from() const;
  bool remove_dependence_processor(void * arg) override;
  void print(String *str, enum_query_type query_type) override;
  bool change_context_processor(void *cntx) override
    { context= (Name_resolution_context *)cntx; return FALSE; }
  /**
    Collect outer references
  */
  bool collect_outer_ref_processor(void *arg) override;
  friend bool insert_fields(THD *thd, Name_resolution_context *context,
                            const char *db_name,
                            const char *table_name, List_iterator<Item> *it,
                            bool any_privileges, bool returning_field);
};


class Item_field :public Item_ident,
                  public Load_data_outvar
{
protected:
  void set_field(Field *field);
public:
  Field *field;
  Item_equal *item_equal;
  /*
    if any_privileges set to TRUE then here real effective privileges will
    be stored
  */
  privilege_t have_privileges;
  /* field need any privileges (for VIEW creation) */
  bool any_privileges;
  Item_field(THD *thd, Name_resolution_context *context_arg,
             const LEX_CSTRING &db_arg, const LEX_CSTRING &table_name_arg,
	     const LEX_CSTRING &field_name_arg);
  Item_field(THD *thd, Name_resolution_context *context_arg,
             const LEX_CSTRING &field_name_arg)
   :Item_field(thd, context_arg, null_clex_str, null_clex_str, field_name_arg)
  { }
  Item_field(THD *thd, Name_resolution_context *context_arg)
   :Item_field(thd, context_arg, null_clex_str, null_clex_str, null_clex_str)
  { }
  /*
    Constructor needed to process subselect with temporary tables (see Item)
  */
  Item_field(THD *thd, Item_field *item);
  /*
    Constructor used inside setup_wild(), ensures that field, table,
    and database names will live as long as Item_field (this is important
    in prepared statements).
  */
  Item_field(THD *thd, Name_resolution_context *context_arg, Field *field);
  /*
    If this constructor is used, fix_fields() won't work, because
    db_name, table_name and column_name are unknown. It's necessary to call
    reset_field() before fix_fields() for all fields created this way.
  */
  Item_field(THD *thd, Field *field);
  Type type() const override { return FIELD_ITEM; }
  bool eq(const Item *item, bool binary_cmp) const override;
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  String *val_str(String*) override;
  void save_result(Field *to) override;
  double val_result() override;
  longlong val_int_result() override;
  bool val_native(THD *thd, Native *to) override;
  bool val_native_result(THD *thd, Native *to) override;
  String *str_result(String* tmp) override;
  my_decimal *val_decimal_result(my_decimal *) override;
  bool val_bool_result() override;
  bool is_null_result() override;
  bool send(Protocol *protocol, st_value *buffer) override;
  Load_data_outvar *get_load_data_outvar() override { return this; }
  bool load_data_set_null(THD *thd, const Load_data_param *param) override
  {
    return field->load_data_set_null(thd);
  }
  bool load_data_set_value(THD *thd, const char *pos, uint length,
                           const Load_data_param *param) override
  {
    field->load_data_set_value(pos, length, param->charset());
    return false;
  }
  bool load_data_set_no_data(THD *thd, const Load_data_param *param) override;
  void load_data_print_for_log_event(THD *thd, String *to) const override;
  bool load_data_add_outvar(THD *thd, Load_data_param *param) const override
  {
    return param->add_outvar_field(thd, field);
  }
  uint load_data_fixed_length() const override
  {
    return field->field_length;
  }
  void reset_field(Field *f);
  bool fix_fields(THD *, Item **) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  void make_send_field(THD *thd, Send_field *tmp_field) override;
  int save_in_field(Field *field,bool no_conversions) override;
  void save_org_in_field(Field *field, fast_field_copier optimizer_data)
    override;
  fast_field_copier setup_fast_field_copier(Field *field) override;
  table_map used_tables() const override;
  table_map all_used_tables() const override;
  const Type_handler *type_handler() const override
  {
    const Type_handler *handler= field->type_handler();
    return handler->type_handler_for_item_field();
  }
  const Type_handler *real_type_handler() const override
  {
    if (field->is_created_from_null_item)
      return &type_handler_null;
    return field->type_handler();
  }
  uint32 character_octet_length() const override
  {
    return field->character_octet_length();
  }
  Field *create_tmp_field_from_item_field(MEM_ROOT *root, TABLE *new_table,
                                          Item_ref *orig_item,
                                          const Tmp_field_param *param);
  Field *create_tmp_field_ex(MEM_ROOT *root,
                             TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override;
  const TYPELIB *get_typelib() const override { return field->get_typelib(); }
  enum_monotonicity_info get_monotonicity_info() const override
  {
    return MONOTONIC_STRICT_INCREASING;
  }
  Sql_mode_dependency value_depends_on_sql_mode() const override
  {
    return Sql_mode_dependency(0, field->value_depends_on_sql_mode());
  }
  bool hash_not_null(Hasher *hasher) override
  {
    if (field->is_null())
      return true;
    field->hash_not_null(hasher);
    return false;
  }
  longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool get_date_result(THD *thd, MYSQL_TIME *ltime,date_mode_t fuzzydate)
    override;
  longlong val_datetime_packed(THD *thd) override;
  longlong val_time_packed(THD *thd) override;
  bool is_null() override { return field->is_null(); }
  void update_null_value() override;
  void update_table_bitmaps()
  {
    if (field && field->table)
    {
      TABLE *tab= field->table;
      tab->covering_keys.intersect(field->part_of_key);
      if (tab->read_set)
        tab->mark_column_with_deps(field);
    }
  }
  void update_used_tables() override
  {
    update_table_bitmaps();
  }
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override
  {
    /*
      normilize_cond() replaced all conditions of type
         WHERE/HAVING field
      to:
        WHERE/HAVING field<>0
      By the time of a build_equal_items() call, all such conditions should
      already be replaced. No Item_field are possible.
      Note, some Item_field derivants are still possible.
      Item_insert_value:
        SELECT * FROM t1 WHERE VALUES(a);
      Item_default_value:
        SELECT * FROM t1 WHERE DEFAULT(a);
    */
    DBUG_ASSERT(type() != FIELD_ITEM);
    return Item_ident::build_equal_items(thd, inherited, link_item_fields,
                                         cond_equal_ref);
  }
  bool is_result_field() override { return false; }
  void save_in_result_field(bool no_conversions) override;
  Item *get_tmp_table_item(THD *thd) override;
  bool find_not_null_fields(table_map allowed) override;
  bool collect_item_field_processor(void * arg) override;
  bool unknown_splocal_processor(void *arg) override;
  bool add_field_to_set_processor(void * arg) override;
  bool find_item_in_field_list_processor(void *arg) override;
  bool register_field_in_read_map(void *arg) override;
  bool register_field_in_write_map(void *arg) override;
  bool register_field_in_bitmap(void *arg) override;
  bool check_partition_func_processor(void *) override {return false;}
  bool post_fix_fields_part_expr_processor(void *bool_arg) override;
  bool check_valid_arguments_processor(void *bool_arg) override;
  bool check_field_expression_processor(void *arg) override;
  bool enumerate_field_refs_processor(void *arg) override;
  bool update_table_bitmaps_processor(void *arg) override;
  bool switch_to_nullable_fields_processor(void *arg) override;
  bool update_vcol_processor(void *arg) override;
  bool rename_fields_processor(void *arg) override;
  bool rename_table_processor(void *arg) override;
  bool check_vcol_func_processor(void *arg) override;
  bool set_fields_as_dependent_processor(void *arg) override
  {
    if (!(used_tables() & OUTER_REF_TABLE_BIT))
    {
      depended_from= (st_select_lex *) arg;
      item_equal= NULL;
    }
    return 0;
  }
  void cleanup() override;
  Item_equal *get_item_equal() override { return item_equal; }
  void set_item_equal(Item_equal *item_eq) override { item_equal= item_eq; }
  Item_equal *find_item_equal(COND_EQUAL *cond_equal) override;
  Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) override;
  Item *replace_equal_field(THD *thd, uchar *arg) override;
  uint32 max_display_length() const override
  { return field->max_display_length(); }
  Item_field *field_for_view_update() override { return this; }
  int fix_outer_field(THD *thd, Field **field, Item **reference);
  Item *update_value_transformer(THD *thd, uchar *select_arg) override;
  Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override;
  Item *derived_field_transformer_for_where(THD *thd, uchar *arg) override;
  Item *grouping_field_transformer_for_where(THD *thd, uchar *arg) override;
  Item *in_subq_field_transformer_for_where(THD *thd, uchar *arg) override;
  Item *in_subq_field_transformer_for_having(THD *thd, uchar *arg) override;
  void print(String *str, enum_query_type query_type) override;
  bool excl_dep_on_table(table_map tab_map) override;
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override;
  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override;
  bool cleanup_excluding_fields_processor(void *arg) override
  { return field ? 0 : cleanup_processor(arg); }
  bool cleanup_excluding_const_fields_processor(void *arg) override
  { return field && const_item() ? 0 : cleanup_processor(arg); }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_field>(thd, this); }
  Item* do_build_clone(THD *thd) const override { return get_copy(thd); }
  bool is_outer_field() const override
  {
    DBUG_ASSERT(fixed());
    return field->table->pos_in_table_list->outer_join;
  }
  bool check_index_dependence(void *arg) override;
  friend class Item_default_value;
  friend class Item_insert_value;
  friend class st_select_lex_unit;
};


/**
  Item_field for the ROW data type
*/
class Item_field_row: public Item_field,
                      public Item_args
{
public:
  Item_field_row(THD *thd, Field *field)
   :Item_field(thd, field),
    Item_args()
  { }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_field_row>(thd, this); }

  const Type_handler *type_handler() const override
  { return &type_handler_row; }
  uint cols() const override { return arg_count; }
  Item* element_index(uint i) override { return arg_count ? args[i] : this; }
  Item** addr(uint i) override { return arg_count ? args + i : NULL; }
  bool check_cols(uint c) override
  {
    if (cols() != c)
    {
      my_error(ER_OPERAND_COLUMNS, MYF(0), c);
      return true;
    }
    return false;
  }
  bool row_create_items(THD *thd, List<Spvar_definition> *list);
};


/*
  @brief 
    Item_temptable_field is the same as Item_field, except that print() 
    continues to work even if the table has been dropped.

  @detail

    We need this item for "ANALYZE statement" feature. Query execution has 
    these steps:

      1. Run the query.
      2. Cleanup starts. Temporary tables are destroyed
      3. print "ANALYZE statement" output, if needed
      4. Call close_thread_table() for regular tables.

    Step #4 is done after step #3, so "ANALYZE stmt" has no problem printing
    Item_field objects that refer to regular tables.

    However, Step #3 is done after Step #2. Attempt to print Item_field objects
    that refer to temporary tables will cause access to freed memory. 
    
    To resolve this, we use Item_temptable_field to refer to items in temporary
    (work) tables.
*/

class Item_temptable_field :public Item_field
{
public:
  Item_temptable_field(THD *thd, Name_resolution_context *context_arg, Field *field)
   : Item_field(thd, context_arg, field) {}

  Item_temptable_field(THD *thd, Field *field)
   : Item_field(thd, field) {}

  Item_temptable_field(THD *thd, Item_field *item) : Item_field(thd, item) {};

  void print(String *str, enum_query_type query_type) override;
};


class Item_null :public Item_basic_constant
{
public:
  Item_null(THD *thd, const char *name_par=0, CHARSET_INFO *cs= &my_charset_bin):
    Item_basic_constant(thd)
  {
    set_maybe_null();
    null_value= TRUE;
    max_length= 0;
    name.str= name_par ? name_par : "NULL";
    name.length= strlen(name.str);
    collation.set(cs, DERIVATION_IGNORABLE, MY_REPERTOIRE_ASCII);
  }
  Type type() const override { return NULL_ITEM; }
  bool vcol_assignment_allowed_value() const override { return true; }
  bool val_bool() override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *str) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  longlong val_datetime_packed(THD *) override;
  longlong val_time_packed(THD *) override;
  int save_in_field(Field *field, bool no_conversions) override;
  int save_safe_in_field(Field *field) override;
  bool send(Protocol *protocol, st_value *buffer) override;
  const Type_handler *type_handler() const override
  { return &type_handler_null; }
  bool basic_const_item() const override { return true; }
  Item *clone_item(THD *thd) const override;
  bool const_is_null() const override { return true; }
  bool is_null() override { return true; }

  void print(String *str, enum_query_type) override
  {
    str->append(NULL_clex_str);
  }

  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override;
  bool check_partition_func_processor(void *) override { return false; }
  Item_basic_constant *make_string_literal_concat(THD *thd,
                                                  const LEX_CSTRING *)
    override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_null>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};

class Item_null_result :public Item_null
{
public:
  Field *result_field;
  Item_null_result(THD *thd): Item_null(thd), result_field(0) {}
  bool is_result_field() override { return result_field != 0; }
  const Type_handler *type_handler() const override
  {
    if (result_field)
      return result_field->type_handler();
    return &type_handler_null;
  }
  Field *create_tmp_field_ex(MEM_ROOT *, TABLE *, Tmp_field_src *,
                             const Tmp_field_param *) override
  {
    DBUG_ASSERT(0);
    return NULL;
  }
  void save_in_result_field(bool no_conversions) override
  {
    save_in_field(result_field, no_conversions);
  }
  bool check_partition_func_processor(void *int_arg) override { return true; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE);
  }
};

/*
  Item represents one placeholder ('?') of prepared statement

  Notes:
  Item_param::field_type() is used when this item is in a temporary table.
  This is NOT placeholder metadata sent to client, as this value
  is assigned after sending metadata (in setup_one_conversion_function).
  For example in case of 'SELECT ?' you'll get MYSQL_TYPE_STRING both
  in result set and placeholders metadata, no matter what type you will
  supply for this placeholder in mysql_stmt_execute.

  Item_param has two Type_handler pointers,
  which can point to different handlers:

  1. In the Type_handler_hybrid_field_type member
     It's initialized in:
     - Item_param::setup_conversion(), for client-server PS protocol,
       according to the bind type.
     - Item_param::set_from_item(), for EXECUTE and EXECUTE IMMEDIATE,
       according to the actual parameter data type.

  2. In the "value" member.
     It's initialized in:
     - Item_param::set_param_func(), for client-server PS protocol.
     - Item_param::set_from_item(), for EXECUTE and EXECUTE IMMEDIATE.
*/

class Item_param :public Item_basic_value,
                  private Settable_routine_parameter,
                  public Rewritable_query_parameter,
                  private Type_handler_hybrid_field_type
{
  /*
    NO_VALUE is a special value meaning that the parameter has not been
    assigned yet. Item_param::state is assigned to NO_VALUE in constructor
    and is used at prepare time.

    1. At prepare time
      Item_param::fix_fields() sets "fixed" to true,
      but as Item_param::state is still NO_VALUE,
      Item_param::basic_const_item() returns false. This prevents various
      optimizations to happen at prepare time fix_fields().
      For example, in this query:
        PREPARE stmt FROM 'SELECT FORMAT(10000,2,?)';
      Item_param::basic_const_item() is tested from
      Item_func_format::fix_length_and_dec().

    2. At execute time:
      When Item_param gets a value
      (or a pseudo-value like DEFAULT_VALUE or IGNORE_VALUE):
      - Item_param::state changes from NO_VALUE to something else
      - Item_param::fixed is changed to true
      All Item_param::set_xxx() make sure to do so.
      In the state with an assigned value:
      - Item_param::basic_const_item() returns true
      - Item::type() returns NULL_ITEM or CONST_ITEM,
        depending on the value assigned.
      So in this state Item_param behaves in many cases like a literal.

      When Item_param::cleanup() is called:
      - Item_param::state does not change
      - Item_param::fixed changes to false
      Note, this puts Item_param into an inconsistent state:
      - Item_param::basic_const_item() still returns "true"
      - Item_param::type() still pretends to be a basic constant Item
      Both are not expected in combination with fixed==false.
      However, these methods are not really called in this state,
      see asserts in Item_param::basic_const_item() and Item_param::type().

      When Item_param::reset() is called:
      - Item_param::state changes to NO_VALUE
      - Item_param::fixed changes to false
  */
  enum enum_item_param_state
  {
    NO_VALUE, NULL_VALUE, SHORT_DATA_VALUE, LONG_DATA_VALUE,
    DEFAULT_VALUE, IGNORE_VALUE
  } state;

  void fix_temporal(uint32 max_length_arg, uint decimals_arg);

  struct CONVERSION_INFO
  {
    /*
      Character sets conversion info for string values.
      Character sets of client and connection defined at bind time are used
      for all conversions, even if one of them is later changed (i.e.
      between subsequent calls to mysql_stmt_execute).
    */
    CHARSET_INFO *character_set_client;
    CHARSET_INFO *character_set_of_placeholder;
    /*
      This points at character set of connection if conversion
      to it is required (i. e. if placeholder typecode is not BLOB).
      Otherwise it's equal to character_set_client (to simplify
      check in convert_str_value()).
    */
    CHARSET_INFO *final_character_set_of_str_value;
  private:
    bool needs_conversion() const
    {
      return final_character_set_of_str_value !=
             character_set_of_placeholder;
    }
    bool convert(THD *thd, String *str);
  public:
    void set(THD *thd, CHARSET_INFO *cs);
    bool convert_if_needed(THD *thd, String *str)
    {
      /*
        Check is so simple because all charsets were set up properly
        in setup_one_conversion_function, where typecode of
        placeholder was also taken into account: the variables are different
        here only if conversion is really necessary.
      */
      if (needs_conversion())
        return convert(thd, str);
      str->set_charset(final_character_set_of_str_value);
      return false;
    }
  };

  bool m_empty_string_is_null;

  class PValue_simple
  {
  public:
    union
    {
      longlong integer;
      double   real;
      CONVERSION_INFO cs_info;
      MYSQL_TIME     time;
    };
    void swap(PValue_simple &other)
    {
      swap_variables(PValue_simple, *this, other);
    }
  };

  class PValue: public Type_handler_hybrid_field_type,
                public PValue_simple,
                public Value_source
  {
  public:
    PValue(): Type_handler_hybrid_field_type(&type_handler_null) {}
    my_decimal m_decimal;
    String m_string;
    /*
      A buffer for string and long data values. Historically all allocated
      values returned from val_str() were treated as eligible to
      modification. I. e. in some cases Item_func_concat can append it's
      second argument to return value of the first one. Because of that we
      can't return the original buffer holding string data from val_str(),
      and have to have one buffer for data and another just pointing to
      the data. This is the latter one and it's returned from val_str().
      Can not be declared inside the union as it's not a POD type.
    */
    String m_string_ptr;

    void swap(PValue &other)
    {
      Type_handler_hybrid_field_type::swap(other);
      PValue_simple::swap(other);
      m_decimal.swap(other.m_decimal);
      m_string.swap(other.m_string);
      m_string_ptr.swap(other.m_string_ptr);
    }
    double val_real(const Type_std_attributes *attr) const;
    longlong val_int(const Type_std_attributes *attr) const;
    my_decimal *val_decimal(my_decimal *dec, const Type_std_attributes *attr);
    String *val_str(String *str, const Type_std_attributes *attr);
  };

  PValue value;

  const String *value_query_val_str(THD *thd, String* str) const;
  Item *value_clone_item(THD *thd) const;
  bool is_evaluable_expression() const override;
  bool can_return_value() const;

public:
  /*
    Used for bulk protocol only.
  */
  enum enum_indicator_type indicator;

  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }

  bool vcol_assignment_allowed_value() const override
  {
    switch (state) {
    case NULL_VALUE:
    case DEFAULT_VALUE:
    case IGNORE_VALUE:
      return true;
    case NO_VALUE:
    case SHORT_DATA_VALUE:
    case LONG_DATA_VALUE:
      break;
    }
    return false;
  }

  Item_param(THD *thd, const LEX_CSTRING *name_arg,
             uint pos_in_query_arg, uint len_in_query_arg);

  void cleanup() override
  {
    m_default_field= NULL;
    Item::cleanup();
  }

  Type type() const override
  {
    // Don't pretend to be a constant unless value for this item is set.
    switch (state) {
    case NO_VALUE:         return PARAM_ITEM;
    case NULL_VALUE:       return NULL_ITEM;
    case SHORT_DATA_VALUE: return CONST_ITEM;
    case LONG_DATA_VALUE:  return CONST_ITEM;
    case DEFAULT_VALUE:    return PARAM_ITEM;
    case IGNORE_VALUE:     return PARAM_ITEM;
    }
    DBUG_ASSERT(0);
    return PARAM_ITEM;
  }

  bool is_order_clause_position() const override
  {
    return state == SHORT_DATA_VALUE &&
           type_handler()->is_order_clause_position_type();
  }

  const Item_const *get_item_const() const override
  {
    switch (state) {
    case SHORT_DATA_VALUE:
    case LONG_DATA_VALUE:
    case NULL_VALUE:
      return this;
    case IGNORE_VALUE:
    case DEFAULT_VALUE:
    case NO_VALUE:
      break;
    }
    return NULL;
  }

  bool const_is_null() const override { return state == NULL_VALUE; }
  bool can_return_const_value(Item_result type) const
  {
    return can_return_value() &&
           value.type_handler()->cmp_type() == type &&
           type_handler()->cmp_type() == type;
  }
  const longlong *const_ptr_longlong() const override
  { return can_return_const_value(INT_RESULT) ? &value.integer : NULL; }
  const double *const_ptr_double() const override
  { return can_return_const_value(REAL_RESULT) ? &value.real : NULL; }
  const my_decimal *const_ptr_my_decimal() const override
  { return can_return_const_value(DECIMAL_RESULT) ? &value.m_decimal : NULL; }
  const MYSQL_TIME *const_ptr_mysql_time() const override
  { return can_return_const_value(TIME_RESULT) ? &value.time : NULL; }
  const String *const_ptr_string() const override
  { return can_return_const_value(STRING_RESULT) ? &value.m_string : NULL; }

  double val_real() override
  {
    return can_return_value() ? value.val_real(this) : 0e0;
  }
  longlong val_int() override
  {
    return can_return_value() ? value.val_int(this) : 0;
  }
  my_decimal *val_decimal(my_decimal *dec) override
  {
    return can_return_value() ? value.val_decimal(dec, this) : NULL;
  }
  String *val_str(String *str) override
  {
    return can_return_value() ? value.val_str(str, this) : NULL;
  }
  bool get_date(THD *thd, MYSQL_TIME *tm, date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *to) override
  {
    return Item_param::type_handler()->Item_param_val_native(thd, this, to);
  }

  int save_in_field(Field *field, bool no_conversions) override;

  void set_default(bool set_type_handler_null);
  void set_ignore(bool set_type_handler_null);
  void set_null();
  void set_int(longlong i, uint32 max_length_arg);
  void set_double(double i);
  void set_decimal(const char *str, ulong length);
  void set_decimal(const my_decimal *dv, bool unsigned_arg);
  bool set_str(const char *str, ulong length,
               CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
  bool set_longdata(const char *str, ulong length);
  void set_time(MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg);
  void set_time(const MYSQL_TIME *tm, uint32 max_length_arg, uint decimals_arg);
  bool set_from_item(THD *thd, Item *item);
  void reset();

  void set_param_tiny(uchar **pos, ulong len);
  void set_param_short(uchar **pos, ulong len);
  void set_param_int32(uchar **pos, ulong len);
  void set_param_int64(uchar **pos, ulong len);
  void set_param_float(uchar **pos, ulong len);
  void set_param_double(uchar **pos, ulong len);
  void set_param_decimal(uchar **pos, ulong len);
  void set_param_time(uchar **pos, ulong len);
  void set_param_datetime(uchar **pos, ulong len);
  void set_param_date(uchar **pos, ulong len);
  void set_param_str(uchar **pos, ulong len);

  void setup_conversion(THD *thd, uchar param_type);
  void setup_conversion_blob(THD *thd);
  void setup_conversion_string(THD *thd, CHARSET_INFO *fromcs);

  /*
    Assign placeholder value from bind data.
    Note, that 'len' has different semantics in embedded library (as we
    don't need to check that packet is not broken there). See
    sql_prepare.cc for details.
  */
  void set_param_func(uchar **pos, ulong len)
  {
    /*
      To avoid Item_param::set_xxx() asserting on data type mismatch,
      we set the value type handler here:
      - It can not be initialized yet after Item_param::setup_conversion().
      - Also, for LIMIT clause parameters, the value type handler might have
        changed from the real type handler to type_handler_longlong.
        So here we'll restore it.
    */
    const Type_handler *h= Item_param::type_handler();
    value.set_handler(h);
    h->Item_param_set_param_func(this, pos, len);
  }

  bool set_value(THD *thd, const Type_all_attributes *attr,
                 const st_value *val, const Type_handler *h)
  {
    value.set_handler(h); // See comments in set_param_func()
    return h->Item_param_set_from_value(thd, this, attr, val);
  }

  bool set_limit_clause_param(longlong nr)
  {
    value.set_handler(&type_handler_slonglong);
    set_int(nr, MY_INT64_NUM_DECIMAL_DIGITS);
    return !unsigned_flag && value.integer < 0;
  }
  const String *query_val_str(THD *thd, String *str) const;

  bool convert_str_value(THD *thd);

  /*
    If value for parameter was not set we treat it as non-const
    so no one will use parameters value in fix_fields still
    parameter is constant during execution.
  */
  bool const_item() const override
  {
    return state != NO_VALUE;
  }
  table_map used_tables() const override
  {
    return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT;
  }
  void print(String *str, enum_query_type query_type) override;
  bool is_null() override
  { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; }
  bool basic_const_item() const override;
  bool has_no_value() const
  {
    return state == NO_VALUE;
  }
  bool has_long_data_value() const
  {
    return state == LONG_DATA_VALUE;
  }
  bool has_int_value() const
  {
    return state == SHORT_DATA_VALUE &&
           value.type_handler()->cmp_type() == INT_RESULT;
  }
  bool is_stored_routine_parameter() const override { return true; }
  /*
    This method is used to make a copy of a basic constant item when
    propagating constants in the optimizer. The reason to create a new
    item and not use the existing one is not precisely known (2005/04/16).
    Probably we are trying to preserve tree structure of items, in other
    words, avoid pointing at one item from two different nodes of the tree.
    Return a new basic constant item if parameter value is a basic
    constant, assert otherwise. This method is called only if
    basic_const_item returned TRUE.
  */
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override;
  Item *clone_item(THD *thd) const override;
  void set_param_type_and_swap_value(Item_param *from);

  Rewritable_query_parameter *get_rewritable_query_parameter() override
  { return this; }
  Settable_routine_parameter *get_settable_routine_parameter() override
  { return m_is_settable_routine_parameter ? this : nullptr; }

  bool append_for_log(THD *thd, String *str) override;
  bool check_vcol_func_processor(void *) override { return false; }
  Item *do_get_copy(THD *thd) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }

  bool add_as_clone(THD *thd);
  void sync_clones();
  bool register_clone(Item_param *i) { return m_clones.push_back(i); }

  void raise_error_not_evaluable() override
  {
    invalid_default_param();
  }
private:
  void invalid_default_param() const;
  bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;
  void set_out_param_info(Send_field *info) override;

public:
  const Send_field *get_out_param_info() const override;
  Item_param *get_item_param() override { return this; }
  void make_send_field(THD *thd, Send_field *field) override;

  /**
    See comments on @see Item::associate_with_target_field for method
    description
  */
  bool associate_with_target_field(THD *, Item_field *field) override
  {
    m_associated_field= field;
    return false;
  }
  bool assign_default(Field *field);

private:
  Send_field *m_out_param_info;
  bool m_is_settable_routine_parameter;
  /*
    Array of all references of this parameter marker used in a CTE to its clones
    created for copies of this marker used the CTE's copies. It's used to
    synchronize the actual value of the parameter with the values of the clones.
  */
  Mem_root_array<Item_param *, true> m_clones;
  Item_field *m_associated_field;
  Field *m_default_field;
};


class Item_int :public Item_num
{
public:
  longlong value;
  Item_int(THD *thd, int32 i,size_t length= MY_INT32_NUM_DECIMAL_DIGITS):
    Item_num(thd), value((longlong) i)
    { max_length=(uint32)length; }
  Item_int(THD *thd, longlong i,size_t length= MY_INT64_NUM_DECIMAL_DIGITS):
    Item_num(thd), value(i)
    { max_length=(uint32)length; }
  Item_int(THD *thd, ulonglong i, size_t length= MY_INT64_NUM_DECIMAL_DIGITS):
    Item_num(thd), value((longlong)i)
    { max_length=(uint32)length; unsigned_flag= 1; }
  Item_int(THD *thd, const char *str_arg,longlong i,size_t length):
    Item_num(thd), value(i)
    {
      max_length=(uint32)length;
      name.str= str_arg; name.length= safe_strlen(name.str);
    }
  Item_int(THD *thd, const char *str_arg,longlong i,size_t length, bool flag):
    Item_num(thd), value(i)
    {
      max_length=(uint32)length;
      name.str= str_arg; name.length= safe_strlen(name.str);
      unsigned_flag= flag;
    }
  Item_int(const char *str_arg,longlong i,size_t length):
    Item_num(), value(i)
    {
      max_length=(uint32)length;
      name.str= str_arg; name.length= safe_strlen(name.str);
      unsigned_flag= 1;
    }
  Item_int(THD *thd, const char *str_arg, size_t length=64);
  const Type_handler *type_handler() const override
  { return type_handler_long_or_longlong(); }
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  { return tmp_table_field_from_field_type(root, table); }
  const longlong *const_ptr_longlong() const override { return &value; }
  bool val_bool() override { return value != 0; }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return value;
  }
  longlong val_int_min() const override { return value; }
  double val_real() override { return (double) value; }
  my_decimal *val_decimal(my_decimal *) override;
  String *val_str(String*) override;
  int save_in_field(Field *field, bool no_conversions) override;
  bool is_order_clause_position() const override { return true; }
  Item *clone_item(THD *thd) const override;
  void print(String *str, enum_query_type query_type) override;
  Item *neg(THD *thd) override;
  decimal_digits_t decimal_precision() const override
  { return (decimal_digits_t) (max_length - MY_TEST(value < 0)); }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_int>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/*
  We sometimes need to distinguish a number from a boolean:
  a[1] and a[true] are different things in XPath.
  Also in JSON boolean values should be treated differently.
*/
class Item_bool :public Item_int
{
public:
  Item_bool(THD *thd, const char *str_arg, longlong i):
    Item_int(thd, str_arg, i, 1) {}
  Item_bool(THD *thd, bool i) :Item_int(thd, (longlong) i, 1) { }
  Item_bool(const char *str_arg, longlong i):
    Item_int(str_arg, i, 1) {}
  bool is_bool_literal() const override { return true; }
  Item *neg_transformer(THD *thd) override;
  const Type_handler *type_handler() const override
  { return &type_handler_bool; }
  const Type_handler *fixed_type_handler() const override
  { return &type_handler_bool; }
  void quick_fix_field() override
  {
    /*
      We can get here when Item_bool is created instead of a constant
      predicate at various condition optimization stages in sql_select.
    */
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_bool>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_bool_static :public Item_bool
{
public:
  Item_bool_static(const char *str_arg, longlong i):
    Item_bool(str_arg, i) {};

  void set_join_tab_idx(uint8 join_tab_idx_arg) override
  { DBUG_ASSERT(0); }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_bool_static>(thd, this); }
};

extern const Item_bool_static Item_false, Item_true;

class Item_uint :public Item_int
{
public:
  Item_uint(THD *thd, const char *str_arg, size_t length);
  Item_uint(THD *thd, ulonglong i): Item_int(thd, i, 10) {}
  Item_uint(THD *thd, const char *str_arg, longlong i, uint length);
  double val_real() override { return ulonglong2double((ulonglong)value); }
  Item *clone_item(THD *thd) const override;
  Item *neg(THD *thd) override;
  decimal_digits_t decimal_precision() const override
  { return decimal_digits_t(max_length); }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_uint>(thd, this); }
};


class Item_datetime :public Item_int
{
protected:
  MYSQL_TIME ltime;
public:
  Item_datetime(THD *thd): Item_int(thd, 0) { unsigned_flag=0; }
  int save_in_field(Field *field, bool no_conversions) override;
  longlong val_int() override;
  double val_real() override { return (double)val_int(); }
  void set(longlong packed, enum_mysql_timestamp_type ts_type);
  bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate) override
  {
    *to= ltime;
    return false;
  }
};


/* decimal (fixed point) constant */
class Item_decimal :public Item_num
{
protected:
  my_decimal decimal_value;
public:
  Item_decimal(THD *thd, const char *str_arg, size_t length,
               CHARSET_INFO *charset);
  Item_decimal(THD *thd, const char *str, const my_decimal *val_arg,
               uint decimal_par, uint length);
  Item_decimal(THD *thd, const my_decimal *value_par);
  Item_decimal(THD *thd, longlong val, bool unsig);
  Item_decimal(THD *thd, double val, int precision, int scale);
  Item_decimal(THD *thd, const uchar *bin, int precision, int scale);

  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
  bool val_bool() override
  { return decimal_value.to_bool(); }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return decimal_value.to_longlong(unsigned_flag);
  }
  double val_real() override
  { return decimal_value.to_double(); }
  String *val_str(String *to) override
  { return decimal_value.to_string(to); }
  my_decimal *val_decimal(my_decimal *val) override
  { return &decimal_value; }
  const my_decimal *const_ptr_my_decimal() const override
  { return &decimal_value; }
  int save_in_field(Field *field, bool no_conversions) override;
  Item *clone_item(THD *thd) const override;
  void print(String *str, enum_query_type query_type) override
  {
    decimal_value.to_string(&str_value);
    str->append(str_value);
  }
  Item *neg(THD *thd) override;
  decimal_digits_t decimal_precision() const override
  { return decimal_value.precision(); }
  void set_decimal_value(my_decimal *value_par);
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_decimal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_float :public Item_num
{
  const char *presentation;
public:
  double value;
  Item_float(THD *thd, const char *str_arg, size_t length);
  Item_float(THD *thd, const char *str, double val_arg, uint decimal_par,
             uint length): Item_num(thd), value(val_arg)
  {
    presentation= name.str= str;
    name.length= safe_strlen(str);
    decimals=(uint8) decimal_par;
    max_length= length;
  }
  Item_float(THD *thd, double value_par, uint decimal_par):
    Item_num(thd), presentation(0), value(value_par)
  {
    decimals= (uint8) decimal_par;
  }
  int save_in_field(Field *field, bool no_conversions) override;
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  const double *const_ptr_double() const override { return &value; }
  bool val_bool() override { return value != 0.0; }
  double val_real() override { return value; }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    if (value <= (double) LONGLONG_MIN)
    {
       return LONGLONG_MIN;
    }
    else if (value >= (double) (ulonglong) LONGLONG_MAX)
    {
      return LONGLONG_MAX;
    }
    return (longlong) rint(value);
  }
  String *val_str(String*) override;
  my_decimal *val_decimal(my_decimal *) override;
  Item *clone_item(THD *thd) const override;
  Item *neg(THD *thd) override;
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_float>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_static_float_func :public Item_float
{
  const char *func_name;
public:
  Item_static_float_func(THD *thd, const char *str, double val_arg,
                         uint decimal_par, uint length):
    Item_float(thd, NullS, val_arg, decimal_par, length), func_name(str)
  {}
  void print(String *str, enum_query_type) override
  {
    str->append(func_name, strlen(func_name));
  }
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
  {
    return const_charset_converter(thd, tocs, true, func_name);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_static_float_func>(thd, this); }
};


class Item_string :public Item_literal
{
protected:
  void fix_from_value(Derivation dv, const Metadata metadata)
  {
    fix_charset_and_length(str_value.charset(), dv, metadata);
  }
  void fix_and_set_name_from_value(THD *thd, Derivation dv,
                                   const Metadata metadata)
  {
    fix_from_value(dv, metadata);
    set_name(thd, &str_value);
  }
protected:
  /* Just create an item and do not fill string representation */
  Item_string(THD *thd, CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE):
    Item_literal(thd)
  {
    collation.set(cs, dv);
    max_length= 0;
    set_name(thd, NULL, 0, system_charset_info);
    decimals= NOT_FIXED_DEC;
  }
public:
  Item_string(THD *thd, CHARSET_INFO *csi, const char *str_arg, uint length_arg)
   :Item_literal(thd)
  {
    collation.set(csi, DERIVATION_COERCIBLE);
    set_name(thd, NULL, 0, system_charset_info);
    decimals= NOT_FIXED_DEC;
    str_value.copy(str_arg, length_arg, csi);
    max_length= str_value.numchars() * csi->mbmaxlen;
  }
  // Constructors with the item name set from its value
  Item_string(THD *thd, const char *str, uint length, CHARSET_INFO *cs,
              Derivation dv, my_repertoire_t repertoire)
   :Item_literal(thd)
  {
    str_value.set_or_copy_aligned(str, length, cs);
    fix_and_set_name_from_value(thd, dv, Metadata(&str_value, repertoire));
  }
  Item_string(THD *thd, const char *str, size_t length,
              CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
   :Item_literal(thd)
  {
    str_value.set_or_copy_aligned(str, length, cs);
    fix_and_set_name_from_value(thd, dv, Metadata(&str_value));
  }
  Item_string(THD *thd, const String *str, CHARSET_INFO *tocs, uint *conv_errors,
              Derivation dv, my_repertoire_t repertoire)
   :Item_literal(thd)
  {
    if (str_value.copy(str, tocs, conv_errors))
      str_value.set("", 0, tocs); // EOM ?
    str_value.mark_as_const();
    fix_and_set_name_from_value(thd, dv, Metadata(&str_value, repertoire));
  }
  // Constructors with an externally provided item name
  Item_string(THD *thd, const LEX_CSTRING &name_par, const LEX_CSTRING &str,
              CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
   :Item_literal(thd)
  {
    str_value.set_or_copy_aligned(str.str, str.length, cs);
    fix_from_value(dv, Metadata(&str_value));
    set_name(thd, name_par);
  }
  Item_string(THD *thd, const LEX_CSTRING &name_par, const LEX_CSTRING &str,
              CHARSET_INFO *cs, Derivation dv, my_repertoire_t repertoire)
   :Item_literal(thd)
  {
    str_value.set_or_copy_aligned(str.str, str.length, cs);
    fix_from_value(dv, Metadata(&str_value, repertoire));
    set_name(thd, name_par);
  }
  void print_value(String *to) const
  {
    str_value.print(to);
  }
  bool val_bool() override { return val_real() != 0.0; }
  double val_real() override;
  longlong val_int() override;
  const String *const_ptr_string() const override { return &str_value; }
  String *val_str(String*) override
  {
    return (String*) &str_value;
  }
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return get_date_from_string(thd, ltime, fuzzydate);
  }
  int save_in_field(Field *field, bool no_conversions) override;
  const Type_handler *type_handler() const override
  { return &type_handler_varchar; }
  Item *clone_item(THD *thd) const override;
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
  {
    return const_charset_converter(thd, tocs, true);
  }
  inline void append(const char *str, uint length)
  {
    str_value.append(str, length);
    max_length= str_value.numchars() * collation.collation->mbmaxlen;
  }
  void print(String *str, enum_query_type query_type) override;

  /**
    Return TRUE if character-set-introducer was explicitly specified in the
    original query for this item (text literal).

    This operation is to be called from Item_string::print(). The idea is
    that when a query is generated (re-constructed) from the Item-tree,
    character-set-introducers should appear only for those literals, where
    they were explicitly specified by the user. Otherwise, that may lead to
    loss collation information (character set introducers implies default
    collation for the literal).

    Basically, that makes sense only for views and hopefully will be gone
    one day when we start using original query as a view definition.

    @return This operation returns the value of m_cs_specified attribute.
      @retval TRUE if character set introducer was explicitly specified in
      the original query.
      @retval FALSE otherwise.
  */
  virtual bool is_cs_specified() const
  {
    return false;
  }

  String *check_well_formed_result(bool send_error)
  { return Item::check_well_formed_result(&str_value, send_error); }

  Item_basic_constant *make_string_literal_concat(THD *thd,
                                                  const LEX_CSTRING *) override;
  Item *make_odbc_literal(THD *thd, const LEX_CSTRING *typestr) override;

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_string>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }

};


class Item_string_with_introducer :public Item_string
{
public:
  Item_string_with_introducer(THD *thd, const LEX_CSTRING &str,
                              CHARSET_INFO *cs):
    Item_string(thd, str.str, str.length, cs)
  { }
  Item_string_with_introducer(THD *thd, const LEX_CSTRING &name_arg,
                              const LEX_CSTRING &str, CHARSET_INFO *tocs):
    Item_string(thd, name_arg, str, tocs)
  { }
  bool is_cs_specified() const override
  {
    return true;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_string_with_introducer>(thd, this); }
};


class Item_string_sys :public Item_string
{
public:
  Item_string_sys(THD *thd, const char *str, uint length):
    Item_string(thd, str, length, system_charset_info)
  { }
  Item_string_sys(THD *thd, const char *str):
    Item_string(thd, str, (uint) strlen(str), system_charset_info)
  { }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_string_sys>(thd, this); }
};


class Item_string_ascii :public Item_string
{
public:
  Item_string_ascii(THD *thd, const char *str, uint length):
    Item_string(thd, str, length, &my_charset_latin1,
                DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII)
  { }
  Item_string_ascii(THD *thd, const char *str):
    Item_string(thd, str, (uint) strlen(str), &my_charset_latin1,
                DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII)
  { }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_string_ascii>(thd, this); }
};


class Item_static_string_func :public Item_string
{
  const LEX_CSTRING func_name;
public:
  Item_static_string_func(THD *thd, const LEX_CSTRING &name_par,
                          const LEX_CSTRING &str, CHARSET_INFO *cs,
                          Derivation dv= DERIVATION_COERCIBLE):
    Item_string(thd, LEX_CSTRING({NullS,0}), str, cs, dv), func_name(name_par)
  {}
  Item_static_string_func(THD *thd, const LEX_CSTRING &name_par,
                          const String *str,
                          CHARSET_INFO *tocs, uint *conv_errors,
                          Derivation dv, my_repertoire_t repertoire):
    Item_string(thd, str, tocs, conv_errors, dv, repertoire),
    func_name(name_par)
  {}
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
  {
    return const_charset_converter(thd, tocs, true, func_name.str);
  }

  void print(String *str, enum_query_type) override
  {
    str->append(func_name);
  }

  bool check_partition_func_processor(void *) override { return true; }

  bool check_vcol_func_processor(void *arg) override
  { // VCOL_TIME_FUNC because the value is not constant, but does not
    // require fix_fields() to be re-run for every statement.
    return mark_unsupported_function(func_name.str, arg, VCOL_TIME_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_static_string_func>(thd, this); }
};


/* for show tables */
class Item_partition_func_safe_string: public Item_string
{
public:
  Item_partition_func_safe_string(THD *thd, const LEX_CSTRING &name_arg,
                                  uint length, CHARSET_INFO *cs):
    Item_string(thd, name_arg, LEX_CSTRING({0,0}), cs)
  {
    max_length= length;
  }
  bool check_vcol_func_processor(void *arg) override 
  {
    return mark_unsupported_function("safe_string", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_partition_func_safe_string>(thd, this); }
};


/**
  Item_empty_string -- is a utility class to put an item into List<Item>
  which is then used in protocol.send_result_set_metadata() when sending SHOW output to
  the client.
*/

class Item_empty_string :public Item_partition_func_safe_string
{
public:
  Item_empty_string(THD *thd, const LEX_CSTRING &header, uint length,
                    CHARSET_INFO *cs= &my_charset_utf8mb3_general_ci)
   :Item_partition_func_safe_string(thd, header, length * cs->mbmaxlen, cs)
  { }
  Item_empty_string(THD *thd, const char *header, uint length,
                    CHARSET_INFO *cs= &my_charset_utf8mb3_general_ci)
   :Item_partition_func_safe_string(thd, LEX_CSTRING({header, strlen(header)}),
                                    length * cs->mbmaxlen, cs)
  { }
  void make_send_field(THD *thd, Send_field *field) override;
};


class Item_return_int :public Item_int
{
  enum_field_types int_field_type;
public:
  Item_return_int(THD *thd, const char *name_arg, uint length,
		  enum_field_types field_type_arg, longlong value_arg= 0):
    Item_int(thd, name_arg, value_arg, length), int_field_type(field_type_arg)
  {
    unsigned_flag=1;
  }
  const Type_handler *type_handler() const override
  {
    const Type_handler *h=
      Type_handler::get_handler_by_field_type(int_field_type);
    return unsigned_flag ? h->type_handler_unsigned() : h;
  }
};


/**
  Item_hex_constant -- a common class for hex literals: X'HHHH' and 0xHHHH
*/
class Item_hex_constant: public Item_literal
{
private:
  void hex_string_init(THD *thd, const char *str, size_t str_length);
public:
  Item_hex_constant(THD *thd): Item_literal(thd)
  {
    hex_string_init(thd, "", 0);
  }
  Item_hex_constant(THD *thd, const char *str, size_t str_length):
    Item_literal(thd)
  {
    hex_string_init(thd, str, str_length);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_varchar; }
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
  {
    return const_charset_converter(thd, tocs, true);
  }
  const String *const_ptr_string() const override { return &str_value; }
  String *val_str(String*) override { return &str_value; }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
};


/**
  Item_hex_hybrid -- is a class implementing 0xHHHH literals, e.g.:
    SELECT 0x3132;
  They can behave as numbers and as strings depending on context.
*/
class Item_hex_hybrid: public Item_hex_constant
{
public:
  Item_hex_hybrid(THD *thd): Item_hex_constant(thd) {}
  Item_hex_hybrid(THD *thd, const char *str, size_t str_length):
    Item_hex_constant(thd, str, str_length) {}
  const Type_handler *type_handler() const override
  { return &type_handler_hex_hybrid; }
  decimal_digits_t decimal_precision() const override;
  bool val_bool() override
  {
    return longlong_from_hex_hybrid(str_value.ptr(), str_value.length()) != 0;
  }
  double val_real() override
  {
    return (double) (ulonglong) Item_hex_hybrid::val_int();
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return longlong_from_hex_hybrid(str_value.ptr(), str_value.length());
  }
  my_decimal *val_decimal(my_decimal *decimal_value) override
  {
    longlong value= Item_hex_hybrid::val_int();
    int2my_decimal(E_DEC_FATAL_ERROR, value, TRUE, decimal_value);
    return decimal_value;
  }
  int save_in_field(Field *field, bool) override
  {
    field->set_notnull();
    return field->store_hex_hybrid(str_value.ptr(), str_value.length());
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_hex_hybrid>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  Item_hex_string -- is a class implementing X'HHHH' literals, e.g.:
    SELECT X'3132';
  Unlike Item_hex_hybrid, X'HHHH' literals behave as strings in all contexts.
  X'HHHH' are also used in replication of string constants in case of
  "dangerous" charsets (sjis, cp932, big5, gbk) who can have backslash (0x5C)
  as the second byte of a multi-byte character, so using '\' escaping for
  these charsets is not desirable.
*/
class Item_hex_string: public Item_hex_constant
{
public:
  Item_hex_string(THD *thd): Item_hex_constant(thd) {}
  Item_hex_string(THD *thd, const char *str, size_t str_length):
    Item_hex_constant(thd, str, str_length) {}
  bool val_bool() override
  {
    return double_from_string_with_check(&str_value) != 0.0;
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return longlong_from_string_with_check(&str_value);
  }
  double val_real() override
  {
    return double_from_string_with_check(&str_value);
  }
  my_decimal *val_decimal(my_decimal *decimal_value) override
  {
    return val_decimal_from_string(decimal_value);
  }
  int save_in_field(Field *field, bool) override
  {
    field->set_notnull();
    return field->store(str_value.ptr(), str_value.length(), 
                        collation.collation);
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_hex_string>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_bin_string: public Item_hex_hybrid
{
public:
  Item_bin_string(THD *thd, const char *str, size_t str_length);
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_bin_string>(thd, this); }
};


class Item_timestamp_literal: public Item_literal
{
  Timestamp_or_zero_datetime m_value;
public:
  Item_timestamp_literal(THD *thd)
   :Item_literal(thd)
  { }
  const Type_handler *type_handler() const override
  { return &type_handler_timestamp2; }
  int save_in_field(Field *field, bool) override
  {
    Timestamp_or_zero_datetime_native native(m_value, decimals);
    return native.save_in_field(field, decimals);
  }
  bool val_bool() override
  {
    return m_value.to_bool();
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return m_value.to_datetime(current_thd).to_longlong();
  }
  double val_real() override
  {
    return m_value.to_datetime(current_thd).to_double();
  }
  String *val_str(String *to) override
  {
    return m_value.to_datetime(current_thd).to_string(to, decimals);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return m_value.to_datetime(current_thd).to_decimal(to);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    bool res= m_value.to_TIME(thd, ltime, fuzzydate);
    DBUG_ASSERT(!res);
    return res;
  }
  bool val_native(THD *thd, Native *to) override
  {
    return m_value.to_native(to, decimals);
  }
  void set_value(const Timestamp_or_zero_datetime &value)
  {
    m_value= value;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_timestamp_literal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_temporal_literal :public Item_literal
{
public:
  Item_temporal_literal(THD *thd)
   :Item_literal(thd)
  {
    collation= DTCollation_numeric();
    decimals= 0;
  }
  Item_temporal_literal(THD *thd, decimal_digits_t dec_arg):
    Item_literal(thd)
  {
    collation= DTCollation_numeric();
    decimals= dec_arg;
  }

  int save_in_field(Field *field, bool no_conversions) override
  { return save_date_in_field(field, no_conversions); }
};


/**
  DATE'2010-01-01'
*/
class Item_date_literal: public Item_temporal_literal
{
protected:
  Date cached_time;
  bool update_null()
  {
    return (maybe_null() &&
            (null_value= cached_time.check_date_with_warn(current_thd)));
  }
public:
  Item_date_literal(THD *thd, const Date *ltime)
    :Item_temporal_literal(thd),
     cached_time(*ltime)
  {
    DBUG_ASSERT(cached_time.is_valid_date());
    max_length= MAX_DATE_WIDTH;
    /*
      If date has zero month or day, it can return NULL in case of
      NO_ZERO_DATE or NO_ZERO_IN_DATE.
      If date is `February 30`, it can return NULL in case if
      no ALLOW_INVALID_DATES is set.
      We can't set null_value using the current sql_mode here in constructor,
      because sql_mode can change in case of prepared statements
      between PREPARE and EXECUTE.
      Here we only set maybe_null to true if the value has such anomalies.
      Later (during execution time), if maybe_null is true, then the value
      will be checked per row, according to the execution time sql_mode.
      The check_date() below call should cover all cases mentioned.
    */
    set_maybe_null(cached_time.check_date(TIME_NO_ZERO_DATE |
                                          TIME_NO_ZERO_IN_DATE));
  }
  const Type_handler *type_handler() const override
  { return &type_handler_newdate; }
  void print(String *str, enum_query_type query_type) override;
  const MYSQL_TIME *const_ptr_mysql_time() const override
  {
    return cached_time.get_mysql_time();
  }
  Item *clone_item(THD *thd) const override;
  bool val_bool() override
  {
    return update_null() ? false : cached_time.to_bool();
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return update_null() ? 0 : cached_time.to_longlong();
  }
  double val_real() override
  {
    return update_null() ? 0 : cached_time.to_double();
  }
  String *val_str(String *to) override
  {
    return update_null() ? 0 : cached_time.to_string(to);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return update_null() ? 0 : cached_time.to_decimal(to);
  }
  longlong val_datetime_packed(THD *thd) override
  {
    return update_null() ? 0 : cached_time.valid_date_to_packed();
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_date_literal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  TIME'10:10:10'
*/
class Item_time_literal final: public Item_temporal_literal
{
protected:
  Time cached_time;
public:
  Item_time_literal(THD *thd, const Time *ltime, decimal_digits_t dec_arg):
    Item_temporal_literal(thd, dec_arg),
    cached_time(*ltime)
  {
    DBUG_ASSERT(cached_time.is_valid_time());
    max_length= MIN_TIME_WIDTH + (decimals ? decimals + 1 : 0);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_time2; }
  void print(String *str, enum_query_type query_type) override;
  const MYSQL_TIME *const_ptr_mysql_time() const override
  {
    return cached_time.get_mysql_time();
  }
  Item *clone_item(THD *thd) const override;
  bool val_bool() override
  {
    return cached_time.to_bool();
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return cached_time.to_longlong();
  }
  double val_real() override { return cached_time.to_double(); }
  String *val_str(String *to) override
  { return cached_time.to_string(to, decimals); }
  my_decimal *val_decimal(my_decimal *to) override
  { return cached_time.to_decimal(to); }
  longlong val_time_packed(THD *thd) override
  {
    return cached_time.valid_time_to_packed();
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *to) override
  {
    return Time(thd, this).to_native(to, decimals);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_time_literal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  TIMESTAMP'2001-01-01 10:20:30'
*/

class Item_datetime_literal: public Item_temporal_literal
{
protected:
  Datetime cached_time;
  bool update_null()
  {
    return (maybe_null() &&
            (null_value= cached_time.check_date_with_warn(current_thd)));
  }
public:
  Item_datetime_literal(THD *thd, const Datetime *ltime,
                        decimal_digits_t dec_arg):
    Item_temporal_literal(thd, dec_arg),
    cached_time(*ltime)
  {
    DBUG_ASSERT(cached_time.is_valid_datetime());
    max_length= MAX_DATETIME_WIDTH + (decimals ? decimals + 1 : 0);
    // See the comment on maybe_null in Item_date_literal
    set_maybe_null(cached_time.check_date(TIME_NO_ZERO_DATE |
                                          TIME_NO_ZERO_IN_DATE));
  }
  const Type_handler *type_handler() const override
  { return &type_handler_datetime2; }
  void print(String *str, enum_query_type query_type) override;
  const MYSQL_TIME *const_ptr_mysql_time() const override
  {
    return cached_time.get_mysql_time();
  }
  Item *clone_item(THD *thd) const override;
  bool val_bool() override
  {
    return update_null() ? false : cached_time.to_bool();
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return update_null() ? 0 : cached_time.to_longlong();
  }
  double val_real() override
  {
    return update_null() ? 0 : cached_time.to_double();
  }
  String *val_str(String *to) override
  {
    return update_null() ? NULL : cached_time.to_string(to, decimals);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return update_null() ? NULL : cached_time.to_decimal(to);
  }
  longlong val_datetime_packed(THD *thd) override
  {
    return update_null() ? 0 : cached_time.valid_datetime_to_packed();
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_datetime_literal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  An error-safe counterpart for Item_date_literal
*/
class Item_date_literal_for_invalid_dates: public Item_date_literal
{
  /**
    During equal field propagation we can replace non-temporal constants
    found in equalities to their native temporal equivalents:
      WHERE date_column='2001-01-01'      ... ->
      WHERE date_column=DATE'2001-01-01'  ...

    This is done to make the equal field propagation code handle mixtures of
    different temporal types in the same expressions easier (MDEV-8706), e.g.
      WHERE LENGTH(date_column)=10 AND date_column=TIME'00:00:00'

    Item_date_literal_for_invalid_dates::get_date()
    (unlike the regular Item_date_literal::get_date())
    does not check the result for NO_ZERO_IN_DATE and NO_ZERO_DATE,
    always returns success (false), and does not produce error/warning messages.

    We need these _for_invalid_dates classes to be able to rewrite:
      SELECT * FROM t1 WHERE date_column='0000-00-00' ...
    to:
      SELECT * FROM t1 WHERE date_column=DATE'0000-00-00' ...

    to avoid returning NULL value instead of '0000-00-00' even
    in sql_mode=TRADITIONAL.
  */
public:
  Item_date_literal_for_invalid_dates(THD *thd, const Date *ltime)
   :Item_date_literal(thd, ltime)
  {
    base_flags&= ~item_base_t::MAYBE_NULL;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    cached_time.copy_to_mysql_time(ltime);
    return (null_value= false);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_date_literal_for_invalid_dates>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  An error-safe counterpart for Item_datetime_literal
  (see Item_date_literal_for_invalid_dates for comments)
*/
class Item_datetime_literal_for_invalid_dates final: public Item_datetime_literal
{
public:
  Item_datetime_literal_for_invalid_dates(THD *thd,
                                          const Datetime *ltime,
                                          decimal_digits_t dec_arg)
   :Item_datetime_literal(thd, ltime, dec_arg)
  {
    base_flags&= ~item_base_t::MAYBE_NULL;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    cached_time.copy_to_mysql_time(ltime);
    return (null_value= false);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_datetime_literal_for_invalid_dates>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Used_tables_and_const_cache
{
public:
  /*
    In some cases used_tables_cache is not what used_tables() return
    so the method should be used where one need used tables bit map
    (even internally in Item_func_* code).
  */
  table_map used_tables_cache;
  bool const_item_cache;

  Used_tables_and_const_cache()
   :used_tables_cache(0),
    const_item_cache(true)
  { }
  Used_tables_and_const_cache(const Used_tables_and_const_cache *other)
   :used_tables_cache(other->used_tables_cache),
    const_item_cache(other->const_item_cache)
  { }
  inline void used_tables_and_const_cache_init()
  {
    used_tables_cache= 0;
    const_item_cache= true;
  }
  inline void used_tables_and_const_cache_join(const Item *item)
  {
    used_tables_cache|= item->used_tables();
    const_item_cache&= item->const_item();
  }
  inline void used_tables_and_const_cache_update_and_join(Item *item)
  {
    item->update_used_tables();
    used_tables_and_const_cache_join(item);
  }
  /*
    Call update_used_tables() for all "argc" items in the array "argv"
    and join with the current cache.
    "this" must be initialized with a constructor or
    re-initialized with used_tables_and_const_cache_init().
  */
  void used_tables_and_const_cache_update_and_join(uint argc, Item **argv)
  {
    for (uint i=0 ; i < argc ; i++)
      used_tables_and_const_cache_update_and_join(argv[i]);
  }
  /*
    Call update_used_tables() for all items in the list
    and join with the current cache.
    "this" must be initialized with a constructor or
    re-initialized with used_tables_and_const_cache_init().
  */
  void used_tables_and_const_cache_update_and_join(List<Item> &list)
  {
    List_iterator_fast<Item> li(list);
    Item *item;
    while ((item=li++))
      used_tables_and_const_cache_update_and_join(item);
  }
};


/**
  An abstract class representing common features of
  regular functions and aggregate functions.
*/
class Item_func_or_sum: public Item_result_field,
                        public Item_args,
                        public Used_tables_and_const_cache
{
protected:
  bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems,
                        uint flags, int item_sep)
  {
    return Type_std_attributes::agg_arg_charsets(c, func_name_cstring(),
                                                 items, nitems,
                                                 flags, item_sep);
  }
  bool agg_arg_charsets_for_string_result(DTCollation &c,
                                          Item **items, uint nitems,
                                          int item_sep= 1)
  {
    return Type_std_attributes::
      agg_arg_charsets_for_string_result(c, func_name_cstring(),
                                         items, nitems, item_sep);
  }
  bool agg_arg_charsets_for_string_result_with_comparison(DTCollation &c,
                                                          Item **items,
                                                          uint nitems,
                                                          int item_sep= 1)
  {
    return Type_std_attributes::
      agg_arg_charsets_for_string_result_with_comparison(c, func_name_cstring(),
                                                         items, nitems,
                                                         item_sep);
  }

  /*
    Aggregate arguments for comparison, e.g: a=b, a LIKE b, a RLIKE b
    - don't convert to @@character_set_connection if all arguments are numbers
    - don't allow DERIVATION_NONE
  */
  bool agg_arg_charsets_for_comparison(DTCollation &c,
                                       Item **items, uint nitems,
                                       int item_sep= 1)
  {
    return Type_std_attributes::
      agg_arg_charsets_for_comparison(c, func_name_cstring(), items, nitems, item_sep);
  }

public:
  // This method is used by Arg_comparator
  bool agg_arg_charsets_for_comparison(CHARSET_INFO **cs, Item **a, Item **b,
                                       bool allow_narrowing)
  {
    THD *thd= current_thd;
    DTCollation tmp;
    if (tmp.set((*a)->collation, (*b)->collation, MY_COLL_CMP_CONV) ||
        tmp.derivation == DERIVATION_NONE)
    {
      my_error(ER_CANT_AGGREGATE_2COLLATIONS,MYF(0),
               (*a)->collation.collation->coll_name.str,
               (*a)->collation.derivation_name(),
               (*b)->collation.collation->coll_name.str,
               (*b)->collation.derivation_name(),
               func_name());
      return true;
    }

    if (allow_narrowing &&
        (*a)->collation.derivation == (*b)->collation.derivation)
    {
      // allow_narrowing==true only for = and <=> comparisons.
      if (Utf8_narrow::should_do_narrowing(thd, (*a)->collation.collation,
                                                (*b)->collation.collation))
      {
        // a is a subset, b is a superset (e.g. utf8mb3 vs utf8mb4)
        *cs= (*b)->collation.collation; // Compare using the wider cset
        return false;
      }
      else
      if (Utf8_narrow::should_do_narrowing(thd, (*b)->collation.collation,
                                                (*a)->collation.collation))
      {
        // a is a superset, b is a subset (e.g. utf8mb4 vs utf8mb3)
        *cs= (*a)->collation.collation; // Compare using the wider cset
        return false;
      }
    }
    /*
      If necessary, convert both *a and *b to the collation in tmp:
    */
    Single_coll_err error_for_a= {(*b)->collation, true};
    Single_coll_err error_for_b= {(*a)->collation, false};

    if (agg_item_set_converter(tmp, func_name_cstring(),
                               a, 1, MY_COLL_CMP_CONV, 1,
                               /*just for error message*/ &error_for_a) ||
        agg_item_set_converter(tmp, func_name_cstring(),
                               b, 1, MY_COLL_CMP_CONV, 1,
                               /*just for error message*/ &error_for_b))
        return true;
    *cs= tmp.collation;
    return false;
  }

public:
  Item_func_or_sum(THD *thd): Item_result_field(thd), Item_args() {}
  Item_func_or_sum(THD *thd, Item *a): Item_result_field(thd), Item_args(a) { }
  Item_func_or_sum(THD *thd, Item *a, Item *b):
    Item_result_field(thd), Item_args(a, b) { }
  Item_func_or_sum(THD *thd, Item *a, Item *b, Item *c):
    Item_result_field(thd), Item_args(thd, a, b, c) { }
  Item_func_or_sum(THD *thd, Item *a, Item *b, Item *c, Item *d):
    Item_result_field(thd), Item_args(thd, a, b, c, d) { }
  Item_func_or_sum(THD *thd, Item *a, Item *b, Item *c, Item *d, Item *e):
    Item_result_field(thd), Item_args(thd, a, b, c, d, e) { }
  Item_func_or_sum(THD *thd, Item_func_or_sum *item):
    Item_result_field(thd, item), Item_args(thd, item),
    Used_tables_and_const_cache(item) { }
  Item_func_or_sum(THD *thd, List<Item> &list):
    Item_result_field(thd), Item_args(thd, list) { }
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    if (walk_args(processor, walk_subquery, arg))
      return true;
    return (this->*processor)(arg);
  }
  /*
    Built-in schema, e.g. mariadb_schema, oracle_schema, maxdb_schema
  */
  virtual const Schema *schema() const
  {
    // A function does not belong to a built-in schema by default
    return NULL;
  }
  /*
    This method is used for debug purposes to print the name of an
    item to the debug log. The second use of this method is as
    a helper function of print() and error messages, where it is
    applicable. To suit both goals it should return a meaningful,
    distinguishable and sintactically correct string. This method
    should not be used for runtime type identification, use enum
    {Sum}Functype and Item_func::functype()/Item_sum::sum_func()
    instead.
    Added here, to the parent class of both Item_func and Item_sum.

    NOTE: for Items inherited from Item_sum, func_name() and
    func_name_cstring() returns part of function name till first
    argument (including '(') to make difference in names for functions
    with 'distinct' clause and without 'distinct' and also to make
    printing of items inherited from Item_sum uniform.
  */
  inline const char *func_name() const
  { return (char*) func_name_cstring().str; }
  virtual LEX_CSTRING func_name_cstring() const= 0;
  virtual bool fix_length_and_dec()= 0;
  bool const_item() const override { return const_item_cache; }
  table_map used_tables() const override { return used_tables_cache; }
  Item* do_build_clone(THD *thd) const override;
  Sql_mode_dependency value_depends_on_sql_mode() const override
  {
    return Item_args::value_depends_on_sql_mode_bit_or().soft_to_hard();
  }
};

class sp_head;
class sp_name;
struct st_sp_security_context;

class Item_sp
{
protected:
  // Can be NULL in some non-SELECT queries
  Name_resolution_context *context;
public:
  sp_name *m_name;
  sp_head *m_sp;
  TABLE *dummy_table;
  uchar result_buf[64];
  sp_rcontext *func_ctx;
  MEM_ROOT sp_mem_root;
  Query_arena *sp_query_arena;

  /*
     The result field of the stored function.
  */
  Field *sp_result_field;
  Item_sp(THD *thd, Name_resolution_context *context_arg, sp_name *name_arg);
  Item_sp(THD *thd, Item_sp *item);
  LEX_CSTRING func_name_cstring(THD *thd, bool is_package_function) const;
  void cleanup();
  bool sp_check_access(THD *thd);
  bool execute(THD *thd, bool *null_value, Item **args, uint arg_count);
  bool execute_impl(THD *thd, Item **args, uint arg_count);
  bool init_result_field(THD *thd, uint max_length, uint maybe_null,
                         bool *null_value, LEX_CSTRING *name);
  void process_error(THD *thd)
  {
    if (context)
      context->process_error(thd);
  }
};

class Item_ref :public Item_ident
{
protected:
  void set_properties();
  bool set_properties_only; // the item doesn't need full fix_fields
public:
  enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF, AGGREGATE_REF };
  Item **ref;
  bool reference_trough_name;
  Item_ref(THD *thd, Name_resolution_context *context_arg,
           const LEX_CSTRING &db_arg, const LEX_CSTRING &table_name_arg,
           const LEX_CSTRING &field_name_arg):
    Item_ident(thd, context_arg, db_arg, table_name_arg, field_name_arg),
    set_properties_only(0), ref(0), reference_trough_name(1) {}
  Item_ref(THD *thd, Name_resolution_context *context_arg,
           const LEX_CSTRING &field_name_arg)
   :Item_ref(thd, context_arg, null_clex_str, null_clex_str, field_name_arg)
  { }
  /*
    This constructor is used in two scenarios:
    A) *item = NULL
      No initialization is performed, fix_fields() call will be necessary.
      
    B) *item points to an Item this Item_ref will refer to. This is 
      used for GROUP BY. fix_fields() will not be called in this case,
      so we call set_properties to make this item "fixed". set_properties
      performs a subset of action Item_ref::fix_fields does, and this subset
      is enough for Item_ref's used in GROUP BY.
    
    TODO we probably fix a superset of problems like in BUG#6658. Check this 
         with Bar, and if we have a more broader set of problems like this.
  */
  Item_ref(THD *thd, Name_resolution_context *context_arg, Item **item,
           const LEX_CSTRING &table_name_arg, const LEX_CSTRING &field_name_arg,
           bool alias_name_used_arg= FALSE);
  Item_ref(THD *thd, TABLE_LIST *view_arg, Item **item,
           const LEX_CSTRING &field_name_arg, bool alias_name_used_arg= FALSE);

  /* Constructor need to process subselect with temporary tables (see Item) */
  Item_ref(THD *thd, Item_ref *item)
    :Item_ident(thd, item), set_properties_only(0), ref(item->ref) {}
  enum Type type() const override	{ return REF_ITEM; }
  enum Type real_type() const override
  { return ref ? (*ref)->type() : REF_ITEM; }
  bool eq(const Item *item, bool binary_cmp) const override
  {
    const Item *it= item->real_item();
    return ref && (*ref)->eq(it, binary_cmp);
  }
  void save_val(Field *to) override;
  void save_result(Field *to) override;
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  String *val_str(String* tmp) override;
  bool val_native(THD *thd, Native *to) override;
  bool is_null() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  longlong val_datetime_packed(THD *) override;
  longlong val_time_packed(THD *) override;
  double val_result() override;
  longlong val_int_result() override;
  String *str_result(String* tmp) override;
  bool val_native_result(THD *thd, Native *to) override;
  my_decimal *val_decimal_result(my_decimal *) override;
  bool val_bool_result() override;
  bool is_null_result() override;
  bool send(Protocol *prot, st_value *buffer) override;
  void make_send_field(THD *thd, Send_field *field) override;
  bool fix_fields(THD *, Item **) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  int save_in_field(Field *field, bool no_conversions) override;
  void save_org_in_field(Field *field, fast_field_copier optimizer_data)
    override;
  fast_field_copier setup_fast_field_copier(Field *field) override
  { return (*ref)->setup_fast_field_copier(field); }
  const Type_handler *type_handler() const override
  { return (*ref)->type_handler(); }
  const Type_handler *real_type_handler() const override
  { return (*ref)->real_type_handler(); }
  uint32 character_octet_length() const override
  {
    return Item_ref::real_item()->character_octet_length();
  }
  Field *get_tmp_table_field() override
  { return result_field ? result_field : (*ref)->get_tmp_table_field(); }
  Item *get_tmp_table_item(THD *thd) override;
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override;
  Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) override;
  table_map used_tables() const override;
  void update_used_tables() override;
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override
  {
    /*
      normilize_cond() replaced all conditions of type
         WHERE/HAVING field
      to:
        WHERE/HAVING field<>0
      By the time of a build_equal_items() call, all such conditions should
      already be replaced. No Item_ref referencing to Item_field are possible.
    */
    DBUG_ASSERT(real_type() != FIELD_ITEM);
    return Item_ident::build_equal_items(thd, inherited, link_item_fields,
                                         cond_equal_ref);
  }
  bool const_item() const override
  {
    return (*ref)->const_item();
  }
  table_map not_null_tables() const override
  {
    return depended_from ? 0 : (*ref)->not_null_tables();
  }
  bool find_not_null_fields(table_map allowed) override
  {
    return depended_from ? false : (*ref)->find_not_null_fields(allowed);
  }
  void save_in_result_field(bool no_conversions) override
  {
    (*ref)->save_in_field(result_field, no_conversions);
  }
  Item *real_item() override { return ref ? (*ref)->real_item() : this; }
  const Item *real_item() const
  {
    return const_cast<Item_ref*>(this)->Item_ref::real_item();
  }
  const TYPELIB *get_typelib() const override
  {
    return ref ? (*ref)->get_typelib() : NULL;
  }

  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    if (ref && *ref)
      return (*ref)->walk(processor, walk_subquery, arg) ||
             (this->*processor)(arg); 
    else
      return FALSE;
  }
  Item* transform(THD *thd, Item_transformer, uchar *arg) override;
  Item* compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                Item_transformer transformer, uchar *arg_t) override;
  bool enumerate_field_refs_processor(void *arg) override
  { return (*ref)->enumerate_field_refs_processor(arg); }
  void no_rows_in_result() override
  {
    (*ref)->no_rows_in_result();
  }
  void restore_to_before_no_rows_in_result() override
  {
    (*ref)->restore_to_before_no_rows_in_result();
  }
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override
  {
    return ref ? (*ref)->precedence() : DEFAULT_PRECEDENCE;
  }
  void cleanup() override;
  Item_field *field_for_view_update() override
  { return (*ref)->field_for_view_update(); }
  Load_data_outvar *get_load_data_outvar() override
  {
    return (*ref)->get_load_data_outvar();
  }
  virtual Ref_Type ref_type() { return REF; }

  // Row emulation: forwarding of ROW-related calls to ref
  uint cols() const override
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->cols() : 1;
  }
  Item* element_index(uint i) override
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->element_index(i) : this;
  }
  Item** addr(uint i) override
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->addr(i) : 0;
  }
  bool check_cols(uint c) override
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->check_cols(c) 
                                              : Item::check_cols(c);
  }
  bool null_inside() override
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->null_inside() : 0;
  }
  void bring_value() override
  {
    if (ref && result_type() == ROW_RESULT)
      (*ref)->bring_value();
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("ref", arg, VCOL_IMPOSSIBLE);
  }
  bool basic_const_item() const override
  { return ref && (*ref)->basic_const_item(); }
  bool is_outer_field() const override
  {
    DBUG_ASSERT(fixed());
    DBUG_ASSERT(ref);
    return (*ref)->is_outer_field();
  }
  Item *do_build_clone(THD *thd) const override;
  /**
    Checks if the item tree that ref points to contains a subquery.
  */
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_ref>(thd, this); }
  bool excl_dep_on_table(table_map tab_map) override
  {
    table_map used= used_tables();
    if (used & OUTER_REF_TABLE_BIT)
      return false;
    return (used == tab_map) || (*ref)->excl_dep_on_table(tab_map);
  }
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override
  { return (*ref)->excl_dep_on_grouping_fields(sel); }
  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override
  { return (*ref)->excl_dep_on_in_subq_left_part(subq_pred); }
  bool cleanup_excluding_fields_processor(void *arg) override
  {
    Item *item= real_item();
    if (item && item->type() == FIELD_ITEM &&
        ((Item_field *)item)->field)
      return 0;
    return cleanup_processor(arg);
  }
  bool cleanup_excluding_const_fields_processor(void *arg) override
  {
    Item *item= real_item();
    if (item && item->type() == FIELD_ITEM &&
        ((Item_field *) item)->field && item->const_item())
      return 0;
    return cleanup_processor(arg);
  }
  Item *field_transformer_for_having_pushdown(THD *thd, uchar *arg) override
  { return (*ref)->field_transformer_for_having_pushdown(thd, arg); }
};


/*
  The same as Item_ref, but get value from val_* family of method to get
  value of item on which it referred instead of result* family.
*/
class Item_direct_ref :public Item_ref
{
public:
  Item_direct_ref(THD *thd, Name_resolution_context *context_arg, Item **item,
                  const LEX_CSTRING &table_name_arg,
                  const LEX_CSTRING &field_name_arg,
                  bool alias_name_used_arg= FALSE):
    Item_ref(thd, context_arg, item, table_name_arg,
             field_name_arg, alias_name_used_arg)
  {}
  /* Constructor need to process subselect with temporary tables (see Item) */
  Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {}
  Item_direct_ref(THD *thd, TABLE_LIST *view_arg, Item **item,
                  const LEX_CSTRING &field_name_arg,
                  bool alias_name_used_arg= FALSE):
    Item_ref(thd, view_arg, item, field_name_arg,
             alias_name_used_arg)
  {}

  bool fix_fields(THD *thd, Item **it) override
  {
    if ((*ref)->fix_fields_if_needed_for_scalar(thd, ref))
      return TRUE;
    return Item_ref::fix_fields(thd, it);
  }
  void save_val(Field *to) override;
  /* Below we should have all val() methods as in Item_ref */
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  String *val_str(String* tmp) override;
  bool val_native(THD *thd, Native *to) override;
  bool is_null() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  longlong val_datetime_packed(THD *) override;
  longlong val_time_packed(THD *) override;
  Ref_Type ref_type() override { return DIRECT_REF; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_direct_ref>(thd, this); }

  /* Should be called if ref is changed */
  inline void ref_changed()
  {
    set_properties();
  }
};


/**
  This class is the same as Item_direct_ref but created to wrap Item_ident
  before fix_fields() call
*/

class Item_direct_ref_to_ident :public Item_direct_ref
{
  Item_ident *ident;
public:
  Item_direct_ref_to_ident(THD *thd, Item_ident *item):
    Item_direct_ref(thd, item->context, (Item**)&item, item->table_name,
                    item->field_name, FALSE)
  {
    ident= item;
    ref= (Item**)&ident;
  }

  bool fix_fields(THD *thd, Item **it) override
  {
    DBUG_ASSERT(ident->type() == FIELD_ITEM || ident->type() == REF_ITEM);
    if (ident->fix_fields_if_needed_for_scalar(thd, ref))
      return TRUE;
    set_properties();
    return FALSE;
  }

  void print(String *str, enum_query_type query_type) override
  { ident->print(str, query_type); }
};


class Item_cache;
class Expression_cache;
class Expression_cache_tracker;

/**
  The objects of this class can store its values in an expression cache.
*/

class Item_cache_wrapper :public Item_result_field
{
private:
  /* Pointer on the cached expression */
  Item *orig_item;
  Expression_cache *expr_cache;
  /*
    In order to put the expression into the expression cache and return
    value of val_*() method, we will need to get the expression value twice
    (probably in different types).  In order to avoid making two
    (potentially costly) orig_item->val_*() calls, we store expression value
    in this Item_cache object.
  */
  Item_cache *expr_value;

  List<Item> parameters;

  Item *check_cache();
  void cache();
  void init_on_demand();

public:
  Item_cache_wrapper(THD *thd, Item *item_arg);
  ~Item_cache_wrapper();

  Type type() const override { return EXPR_CACHE_ITEM; }
  Type real_type() const override { return orig_item->type(); }
  bool set_cache(THD *thd);
  Expression_cache_tracker* init_tracker(MEM_ROOT *mem_root);
  bool fix_fields(THD *thd, Item **it) override;
  void cleanup() override;
  Item *get_orig_item() const { return orig_item; }

  /* Methods of getting value which should be cached in the cache */
  void save_val(Field *to) override;
  double val_real() override;
  longlong val_int() override;
  String *val_str(String* tmp) override;
  bool val_native(THD *thd, Native *to) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  bool is_null() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool send(Protocol *protocol, st_value *buffer) override;
  void save_org_in_field(Field *field, fast_field_copier) override
  {
    save_val(field);
  }
  void save_in_result_field(bool) override { save_val(result_field); }
  Item* get_tmp_table_item(THD *thd_arg) override;

  /* Following methods make this item transparent as much as possible */

  void print(String *str, enum_query_type query_type) override;
  LEX_CSTRING full_name_cstring() const override
  { return orig_item->full_name_cstring(); }
  void make_send_field(THD *thd, Send_field *field) override
  { orig_item->make_send_field(thd, field); }
  bool eq(const Item *item, bool binary_cmp) const override
  {
    const Item *it= item->real_item();
    return orig_item->eq(it, binary_cmp);
  }
  void fix_after_pullout(st_select_lex *new_parent, Item **refptr, bool merge)
    override
  {
    orig_item->fix_after_pullout(new_parent, &orig_item, merge);
  }
  int save_in_field(Field *to, bool no_conversions) override;
  const Type_handler *type_handler() const override
  { return orig_item->type_handler(); }
  table_map used_tables() const override
  { return orig_item->used_tables(); }
  void update_used_tables() override
  {
    orig_item->update_used_tables();
  }
  bool const_item() const override { return orig_item->const_item(); }
  table_map not_null_tables() const override
  { return orig_item->not_null_tables(); }
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    return orig_item->walk(processor, walk_subquery, arg) ||
      (this->*processor)(arg);
  }
  bool enumerate_field_refs_processor(void *arg) override
  { return orig_item->enumerate_field_refs_processor(arg); }
  Item_field *field_for_view_update() override
  { return orig_item->field_for_view_update(); }

  /* Row emulation: forwarding of ROW-related calls to orig_item */
  uint cols() const override
  { return result_type() == ROW_RESULT ? orig_item->cols() : 1; }
  Item* element_index(uint i) override
  { return result_type() == ROW_RESULT ? orig_item->element_index(i) : this; }
  Item** addr(uint i) override
  { return result_type() == ROW_RESULT ? orig_item->addr(i) : 0; }
  bool check_cols(uint c) override
  {
    return (result_type() == ROW_RESULT ?
            orig_item->check_cols(c) :
            Item::check_cols(c));
  }
  bool null_inside() override
  { return result_type() == ROW_RESULT ? orig_item->null_inside() : 0; }
  void bring_value() override
  {
    if (result_type() == ROW_RESULT)
      orig_item->bring_value();
  }
  bool is_expensive() override { return orig_item->is_expensive(); }
  bool is_expensive_processor(void *arg) override
  { return orig_item->is_expensive_processor(arg); }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("cache", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_wrapper>(thd, this); }
  Item *do_build_clone(THD *) const override { return nullptr; }
};


/*
  Class for view fields, the same as Item_direct_ref, but call fix_fields
  of reference if it is not called yet
*/
class Item_direct_view_ref :public Item_direct_ref
{
  Item_equal *item_equal;
  TABLE_LIST *view;
  TABLE *null_ref_table;

#define NO_NULL_TABLE (reinterpret_cast<TABLE *>(0x1))

  void set_null_ref_table()
  {
    if (!view->is_inner_table_of_outer_join() ||
        !(null_ref_table= view->get_real_join_table()))
      null_ref_table= NO_NULL_TABLE;
    if (null_ref_table && null_ref_table != NO_NULL_TABLE)
      set_maybe_null();
  }

  bool check_null_ref()
  {
    DBUG_ASSERT(null_ref_table);
    if (null_ref_table != NO_NULL_TABLE && null_ref_table->null_row)
    {
      null_value= 1;
      return TRUE;
    }
    return FALSE;
  }

public:
  Item_direct_view_ref(THD *thd, Name_resolution_context *context_arg,
                       Item **item,
                       LEX_CSTRING &table_name_arg,
                       LEX_CSTRING &field_name_arg,
                       TABLE_LIST *view_arg):
    Item_direct_ref(thd, context_arg, item, table_name_arg, field_name_arg),
    item_equal(0), view(view_arg),
    null_ref_table(NULL)
  {
    if (fixed())
      set_null_ref_table();
  }

  bool fix_fields(THD *, Item **) override;
  bool eq(const Item *item, bool binary_cmp) const override;
  Item *get_tmp_table_item(THD *thd) override
  {
    if (const_item())
      return copy_or_same(thd);
    Item *item= Item_ref::get_tmp_table_item(thd);
    item->name= name;
    return item;
  }
  Ref_Type ref_type() override { return VIEW_REF; }
  Item_equal *get_item_equal() override { return item_equal; }
  void set_item_equal(Item_equal *item_eq) override { item_equal= item_eq; }
  Item_equal *find_item_equal(COND_EQUAL *cond_equal) override;
  Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) override;
  Item *replace_equal_field(THD *thd, uchar *arg) override;
  table_map used_tables() const override;
  void update_used_tables() override;
  table_map not_null_tables() const override;
  bool const_item() const override
  {
    return (*ref)->const_item() && (null_ref_table == NO_NULL_TABLE);
  }
  TABLE *get_null_ref_table() const { return null_ref_table; }
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    return (*ref)->walk(processor, walk_subquery, arg) ||
           (this->*processor)(arg);
  }
  bool view_used_tables_processor(void *arg) override
  {
    TABLE_LIST *view_arg= (TABLE_LIST *) arg;
    if (view_arg == view)
      view_arg->view_used_tables|= (*ref)->used_tables();
    return 0;
  }
  bool excl_dep_on_table(table_map tab_map) override;
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override;
  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override;
  Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override;
  Item *derived_field_transformer_for_where(THD *thd, uchar *arg) override;
  Item *grouping_field_transformer_for_where(THD *thd, uchar *arg) override;
  Item *in_subq_field_transformer_for_where(THD *thd, uchar *arg) override;
  Item *in_subq_field_transformer_for_having(THD *thd, uchar *arg) override;

  void save_val(Field *to) override
  {
    if (check_null_ref())
      to->set_null();
    else
      Item_direct_ref::save_val(to);
  }
  double val_real() override
  {
    if (check_null_ref())
      return 0;
    else
      return Item_direct_ref::val_real();
  }
  longlong val_int() override
  {
    if (check_null_ref())
      return 0;
    else
      return Item_direct_ref::val_int();
  }
  String *val_str(String* tmp) override
  {
    if (check_null_ref())
      return NULL;
    else
      return Item_direct_ref::val_str(tmp);
  }
  bool val_native(THD *thd, Native *to) override
  {
    if (check_null_ref())
      return true;
    return Item_direct_ref::val_native(thd, to);
  }
  my_decimal *val_decimal(my_decimal *tmp) override
  {
    if (check_null_ref())
      return NULL;
    else
      return Item_direct_ref::val_decimal(tmp);
  }
  bool val_bool() override
  {
    if (check_null_ref())
      return 0;
    else
      return Item_direct_ref::val_bool();
  }
  bool is_null() override
  {
    if (check_null_ref())
      return 1;
    else
      return Item_direct_ref::is_null();
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    if (check_null_ref())
    {
      bzero((char*) ltime,sizeof(*ltime));
      return 1;
    }
    return Item_direct_ref::get_date(thd, ltime, fuzzydate);
  }
  longlong val_time_packed(THD *thd) override
  {
    if (check_null_ref())
      return 0;
    else
      return Item_direct_ref::val_time_packed(thd);
  }
  longlong val_datetime_packed(THD *thd) override
  {
    if (check_null_ref())
      return 0;
    else
      return Item_direct_ref::val_datetime_packed(thd);
  }
  bool send(Protocol *protocol, st_value *buffer) override;
  void save_org_in_field(Field *field, fast_field_copier) override
  {
    if (check_null_ref())
      field->set_null();
    else
      Item_direct_ref::save_val(field);
  }
  void save_in_result_field(bool no_conversions) override
  {
    if (check_null_ref())
      result_field->set_null();
    else
      Item_direct_ref::save_in_result_field(no_conversions);
  }

  int save_in_field(Field *field, bool no_conversions) override
  {
    if (check_null_ref())
      return set_field_to_null_with_conversions(field, no_conversions);

    return Item_direct_ref::save_in_field(field, no_conversions);
  }

  void cleanup() override
  {
    null_ref_table= NULL;
    item_equal= NULL;
    Item_direct_ref::cleanup();
  }
  /*
    TODO move these val_*_result function to Item_direct_ref (maybe)
  */
  double val_result() override;
  longlong val_int_result() override;
  String *str_result(String* tmp) override;
  my_decimal *val_decimal_result(my_decimal *val) override;
  bool val_bool_result() override;

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_direct_view_ref>(thd, this); }
  Item *field_transformer_for_having_pushdown(THD *, uchar *) override
  { return this; }
};


/*
  Class for outer fields.
  An object of this class is created when the select where the outer field was
  resolved is a grouping one. After it has been fixed the ref field will point
  to either an Item_ref or an Item_direct_ref object which will be used to
  access the field.
  See also comments for the fix_inner_refs() and the
  Item_field::fix_outer_field() functions.
*/

class Item_sum;
class Item_outer_ref :public Item_direct_ref
{
public:
  Item *outer_ref;
  /* The aggregate function under which this outer ref is used, if any. */
  Item_sum *in_sum_func;
  /*
    TRUE <=> that the outer_ref is already present in the select list
    of the outer select.
  */
  bool found_in_select_list;
  bool found_in_group_by;
  Item_outer_ref(THD *thd, Name_resolution_context *context_arg,
                 Item_field *outer_field_arg):
    Item_direct_ref(thd, context_arg, 0, outer_field_arg->table_name,
                    outer_field_arg->field_name),
    outer_ref(outer_field_arg), in_sum_func(0),
    found_in_select_list(0), found_in_group_by(0)
  {
    ref= &outer_ref;
    set_properties();
    /* reset flag set in set_properties() */
    base_flags&= ~item_base_t::FIXED;
  }
  Item_outer_ref(THD *thd, Name_resolution_context *context_arg, Item **item,
                 const LEX_CSTRING &table_name_arg, LEX_CSTRING &field_name_arg,
                 bool alias_name_used_arg):
    Item_direct_ref(thd, context_arg, item, table_name_arg, field_name_arg,
                    alias_name_used_arg),
    outer_ref(0), in_sum_func(0), found_in_select_list(1), found_in_group_by(0)
  {}
  void save_in_result_field(bool no_conversions) override
  {
    outer_ref->save_org_in_field(result_field, NULL);
  }
  bool fix_fields(THD *, Item **) override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  table_map used_tables() const override
  {
    return (*ref)->const_item() ? 0 : OUTER_REF_TABLE_BIT;
  }
  table_map not_null_tables() const override { return 0; }
  Ref_Type ref_type() override { return OUTER_REF; }
  bool check_inner_refs_processor(void * arg) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_outer_ref>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_in_subselect;


/*
  An object of this class:
   - Converts val_XXX() calls to ref->val_XXX_result() calls, like Item_ref.
   - Sets owner->was_null=TRUE if it has returned a NULL value from any
     val_XXX() function. This allows to inject an Item_ref_null_helper
     object into subquery and then check if the subquery has produced a row
     with NULL value.
*/

class Item_ref_null_helper: public Item_ref
{
protected:
  Item_in_subselect* owner;
public:
  Item_ref_null_helper(THD *thd, Name_resolution_context *context_arg,
                       Item_in_subselect* master, Item **item,
		       const LEX_CSTRING &table_name_arg,
                       const LEX_CSTRING &field_name_arg):
    Item_ref(thd, context_arg, item, table_name_arg, field_name_arg),
    owner(master) {}
  void save_val(Field *to) override;
  double val_real() override;
  longlong val_int() override;
  String* val_str(String* s) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *to) override;
  void print(String *str, enum_query_type query_type) override;
  table_map used_tables() const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_ref_null_helper>(thd, this); }
};

/*
  The following class is used to optimize comparing of date and bigint columns
  We need to save the original item ('ref') to be able to call
  ref->save_in_field(). This is used to create index search keys.
  
  An instance of Item_int_with_ref may have signed or unsigned integer value.
  
*/

class Item_int_with_ref :public Item_int
{
  Item *ref;
public:
  Item_int_with_ref(THD *thd, longlong i, Item *ref_arg, bool unsigned_arg):
    Item_int(thd, i), ref(ref_arg)
  {
    unsigned_flag= unsigned_arg;
  }
  int save_in_field(Field *field, bool no_conversions) override
  {
    return ref->save_in_field(field, no_conversions);
  }
  Item *clone_item(THD *thd) const override;
  Item *real_item() override { return ref; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_int_with_ref>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};

#ifdef MYSQL_SERVER
#include "item_sum.h"
#include "item_func.h"
#include "item_row.h"
#include "item_cmpfunc.h"
#include "item_strfunc.h"
#include "item_timefunc.h"
#include "item_subselect.h"
#include "item_xmlfunc.h"
#include "item_jsonfunc.h"
#include "item_create.h"
#include "item_vers.h"
#endif

/**
  Base class to implement typed value caching Item classes

  Item_copy_ classes are very similar to the corresponding Item_
  classes (e.g. Item_copy_string is similar to Item_string) but they add
  the following additional functionality to Item_ :
    1. Nullability
    2. Possibility to store the value not only on instantiation time,
       but also later.
  Item_copy_ classes are a functionality subset of Item_cache_ 
  classes, as e.g. they don't support comparisons with the original Item
  as Item_cache_ classes do.
  Item_copy_ classes are used in GROUP BY calculation.
  TODO: Item_copy should be made an abstract interface and Item_copy_
  classes should inherit both the respective Item_ class and the interface.
  Ideally we should drop Item_copy_ classes altogether and merge 
  their functionality to Item_cache_ (and these should be made to inherit
  from Item_).
*/

class Item_copy :public Item,
                 public Type_handler_hybrid_field_type
{
protected:  

  /**
    Type_handler_hybrid_field_type is used to
    store the type of the resulting field that would be used to store the data
    in the cache. This is to avoid calls to the original item.
  */

  /** The original item that is copied */
  Item *item;

  /**
    Constructor of the Item_copy class

    stores metadata information about the original class as well as a 
    pointer to it.
  */
  Item_copy(THD *thd, Item *org): Item(thd)
  {
    DBUG_ASSERT(org->fixed());
    item= org;
    null_value= item->maybe_null();
    copy_flags(item, item_base_t::MAYBE_NULL);
    Type_std_attributes::set(item);
    name= item->name;
    set_handler(item->type_handler());
#ifndef DBUG_OFF
    copied_in= 0;
#endif
  }

#ifndef DBUG_OFF
  bool copied_in;
#endif

public:

  /** 
    Update the cache with the value of the original item
   
    This is the method that updates the cached value.
    It must be explicitly called by the user of this class to store the value 
    of the original item in the cache.
  */
  virtual void copy() = 0;

  Item *get_item() { return item; }
  /** All of the subclasses should have the same type tag */
  Type type() const override { return COPY_STR_ITEM; }

  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }

  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    DBUG_ASSERT(0);
    return NULL;
  }
  void make_send_field(THD *thd, Send_field *field) override
  { item->make_send_field(thd, field); }
  table_map used_tables() const override { return (table_map) 1L; }
  bool const_item() const override { return false; }
  bool is_null() override { return null_value; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("copy", arg, VCOL_IMPOSSIBLE);
  }

  /*
    Override the methods below as pure virtual to make sure all the
    sub-classes implement them.
  */
  String *val_str(String*) override = 0;
  my_decimal *val_decimal(my_decimal *) override = 0;
  double val_real() override = 0;
  longlong val_int() override = 0;
  int save_in_field(Field *field, bool no_conversions) override = 0;
  bool walk(Item_processor processor, bool walk_subquery, void *args) override
  {
    return (item->walk(processor, walk_subquery, args)) ||
      (this->*processor)(args);
  }
};

/**
 Implementation of a string cache.
 
 Uses Item::str_value for storage
*/ 
class Item_copy_string : public Item_copy
{
public:
  Item_copy_string(THD *thd, Item *item_arg): Item_copy(thd, item_arg) {}

  String *val_str(String*) override;
  my_decimal *val_decimal(my_decimal *) override;
  double val_real() override;
  longlong val_int() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    DBUG_ASSERT(copied_in);
    return get_date_from_string(thd, ltime, fuzzydate);
  }
  void copy() override;
  int save_in_field(Field *field, bool no_conversions) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_copy_string>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  We need a separate class Item_copy_timestamp because
  TIMESTAMP->string->TIMESTAMP conversion is not round trip safe
  near the DST change, e.g. '2010-10-31 02:25:26' can mean:
   - my_time_t(1288477526) - summer time in Moscow
   - my_time_t(1288481126) - winter time in Moscow, one hour later
*/
class Item_copy_timestamp: public Item_copy
{
  Timestamp_or_zero_datetime m_value;
  bool sane() const { return !null_value || m_value.is_zero_datetime(); }
public:
  Item_copy_timestamp(THD *thd, Item *arg): Item_copy(thd, arg) { }
  const Type_handler *type_handler() const override
  { return &type_handler_timestamp2; }
  void copy() override
  {
    Timestamp_or_zero_datetime_native_null tmp(current_thd, item, false);
    null_value= tmp.is_null();
    m_value= tmp.is_null() ? Timestamp_or_zero_datetime() :
                             Timestamp_or_zero_datetime(tmp);
#ifndef DBUG_OFF
    copied_in=1;
#endif
  }
  int save_in_field(Field *field, bool) override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    if (null_value)
      return set_field_to_null(field);
    Timestamp_or_zero_datetime_native native(m_value, decimals);
    return native.save_in_field(field, decimals);
  }
  longlong val_int() override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    return null_value ? 0 :
           m_value.to_datetime(current_thd).to_longlong();
  }
  double val_real() override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    return null_value ? 0e0 :
           m_value.to_datetime(current_thd).to_double();
  }
  String *val_str(String *to) override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    return null_value ? NULL :
           m_value.to_datetime(current_thd).to_string(to, decimals);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    return null_value ? NULL :
           m_value.to_datetime(current_thd).to_decimal(to);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    bool res= m_value.to_TIME(thd, ltime, fuzzydate);
    DBUG_ASSERT(!res);
    return null_value || res;
  }
  bool val_native(THD *thd, Native *to) override
  {
    DBUG_ASSERT(copied_in);
    DBUG_ASSERT(sane());
    return null_value || m_value.to_native(to, decimals);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_copy_timestamp>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/*
  Cached_item_XXX objects are not exactly caches. They do the following:

  Each Cached_item_XXX object has
   - its source item
   - saved value of the source item
   - cmp() method that compares the saved value with the current value of the
     source item, and if they were not equal saves item's value into the saved
     value.

  TODO: add here:
   - a way to save the new value w/o comparison
   - a way to do less/equal/greater comparison
*/

class Cached_item :public Sql_alloc
{
public:
  bool null_value;
  Cached_item() :null_value(0) {}
  /*
    Compare the cached value with the source value. If not equal, copy
    the source value to the cache.
    @return
      true  - Not equal
      false - Equal
  */
  virtual bool cmp(void)=0;

  /* Compare the cached value with the source value, without copying */
  virtual int  cmp_read_only()=0;

  virtual ~Cached_item(); /*line -e1509 */
};

class Cached_item_item : public Cached_item
{
protected:
  Item *item;

  Cached_item_item(Item *arg) : item(arg) {}
public:
  void fetch_value_from(Item *new_item)
  {
    Item *save= item;
    item= new_item;
    cmp();
    item= save;
  }
};

class Cached_item_str :public Cached_item_item
{
  uint32 value_max_length;
  String value,tmp_value;
public:
  Cached_item_str(THD *thd, Item *arg);
  bool cmp() override;
  int cmp_read_only() override;
  ~Cached_item_str();                           // Deallocate String:s
};


class Cached_item_real :public Cached_item_item
{
  double value;
public:
  Cached_item_real(Item *item_par) :Cached_item_item(item_par),value(0.0) {}
  bool cmp() override;
  int cmp_read_only() override;
};

class Cached_item_int :public Cached_item_item
{
  longlong value;
public:
  Cached_item_int(Item *item_par) :Cached_item_item(item_par),value(0) {}
  bool cmp() override;
  int cmp_read_only() override;
};


class Cached_item_decimal :public Cached_item_item
{
  my_decimal value;
public:
  Cached_item_decimal(Item *item_par);
  bool cmp() override;
  int cmp_read_only() override;
};

class Cached_item_field :public Cached_item
{
  uchar *buff;
  Field *field;
  uint length;

public:
  Cached_item_field(THD *thd, Field *arg_field): field(arg_field)
  {
    field= arg_field;
    /* TODO: take the memory allocation below out of the constructor. */
    buff= (uchar*) thd_calloc(thd, length= field->pack_length());
  }
  bool cmp() override;
  int cmp_read_only() override;
};

class Item_default_value : public Item_field
{
  bool vcol_assignment_ok:1;
  bool m_associated:1;
  bool m_share_field:1;

  void calculate();
public:
  Item *arg= nullptr;
  Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a,
                     bool vcol_assignment_arg)
    : Item_field(thd, context_arg),
      vcol_assignment_ok(vcol_assignment_arg), arg(a)
  {
    m_associated= false;
    m_share_field= false;
  }
  Type type() const override { return DEFAULT_VALUE_ITEM; }
  bool eq(const Item *item, bool binary_cmp) const override;
  bool fix_fields(THD *, Item **) override;
  void cleanup() override;
  void print(String *str, enum_query_type query_type) override;
  String *val_str(String *str) override;
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *decimal_value) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime,date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *to) override;
  bool val_native_result(THD *thd, Native *to) override;
  longlong val_datetime_packed(THD *thd) override
  { return Item::val_datetime_packed(thd); }
  longlong val_time_packed(THD *thd) override
  { return Item::val_time_packed(thd); }

  /* Result variants */
  double val_result() override;
  longlong val_int_result() override;
  String *str_result(String* tmp) override;
  my_decimal *val_decimal_result(my_decimal *val) override;
  bool val_bool_result() override;
  bool is_null_result() override;
  bool get_date_result(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
    override;

  bool send(Protocol *protocol, st_value *buffer) override;
  int save_in_field(Field *field_arg, bool no_conversions) override;
  void save_in_result_field(bool no_conversions) override;
  bool save_in_param(THD *, Item_param *param) override
  {
    // It should not be possible to have "EXECUTE .. USING DEFAULT(a)"
    DBUG_ASSERT(0);
    param->set_default(true);
    return false;
  }
  table_map used_tables() const override;
  void update_used_tables() override
  {
    if (field && field->default_value)
      field->default_value->expr->update_used_tables();
  }
  bool vcol_assignment_allowed_value() const override
  { return vcol_assignment_ok; }
  Item *get_tmp_table_item(THD *) override { return this; }
  Item_field *field_for_view_update() override { return nullptr; }
  bool update_vcol_processor(void *) override { return false; }
  bool check_field_expression_processor(void *arg) override;
  bool check_func_default_processor(void *) override { return true; }
  bool update_func_default_processor(void *arg) override;
  bool register_field_in_read_map(void *arg) override;
  bool walk(Item_processor processor, bool walk_subquery, void *args) override
  {
    return (arg && arg->walk(processor, walk_subquery, args)) ||
      (this->*processor)(args);
  }
  Item *transform(THD *thd, Item_transformer transformer, uchar *args)
    override;
  Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override
  { return NULL; }
  Item *derived_field_transformer_for_where(THD *thd, uchar *arg) override
  { return NULL; }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override;

  /**
    See comments on @see Item::associate_with_target_field for method
    description
  */
  bool associate_with_target_field(THD *thd, Item_field *field) override;
  Item *do_get_copy(THD *thd) const override
  {
    Item_default_value *new_item=
      (Item_default_value *) get_item_copy<Item_default_value>(thd, this);
    // This is a copy so do not manage the field and should not delete it
    new_item->m_share_field= 1;
    return new_item;
  }
  Item* do_build_clone(THD *thd) const override { return get_copy(thd); }
private:
  bool tie_field(THD *thd);
};


class Item_contextually_typed_value_specification: public Item
{
public:
  Item_contextually_typed_value_specification(THD *thd) :Item(thd)
  { }
  Type type() const override { return CONTEXTUALLY_TYPED_VALUE_ITEM; }
  bool vcol_assignment_allowed_value() const override { return true; }
  bool eq(const Item *item, bool binary_cmp) const override { return false; }
  bool is_evaluable_expression() const override { return false; }
  Field *create_tmp_field_ex(MEM_ROOT *,
                             TABLE *, Tmp_field_src *,
                             const Tmp_field_param *) override
  {
    DBUG_ASSERT(0);
    return NULL;
  }
  String *val_str(String *str) override
  {
    DBUG_ASSERT(0); // never should be called
    null_value= true;
    return 0;
  }
  double val_real() override
  {
    DBUG_ASSERT(0); // never should be called
    null_value= true;
    return 0.0;
  }
  longlong val_int() override
  {
    DBUG_ASSERT(0); // never should be called
    null_value= true;
    return 0;
  }
  my_decimal *val_decimal(my_decimal *) override
  {
    DBUG_ASSERT(0); // never should be called
    null_value= true;
    return 0;
  }
  bool get_date(THD *, MYSQL_TIME *, date_mode_t) override
  {
    DBUG_ASSERT(0); // never should be called
    return (null_value= true);
  }
  bool send(Protocol *, st_value *) override
  {
    DBUG_ASSERT(0);
    return true;
  }
  const Type_handler *type_handler() const override
  {
    DBUG_ASSERT(0);
    return &type_handler_null;
  }
};


/*
  <default specification> ::= DEFAULT
*/
class Item_default_specification:
        public Item_contextually_typed_value_specification
{
public:
  Item_default_specification(THD *thd)
   :Item_contextually_typed_value_specification(thd)
  { }
  void print(String *str, enum_query_type) override
  {
    str->append(STRING_WITH_LEN("default"));
  }
  int save_in_field(Field *field_arg, bool) override
  {
    return field_arg->save_in_field_default_value(false);
  }
  bool save_in_param(THD *, Item_param *param) override
  {
    param->set_default(true);
    return false;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_default_specification>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/**
  This class is used as bulk parameter INGNORE representation.

  It just do nothing when assigned to a field

  This is a non-standard MariaDB extension.
*/

class Item_ignore_specification:
        public Item_contextually_typed_value_specification
{
public:
  Item_ignore_specification(THD *thd)
   :Item_contextually_typed_value_specification(thd)
  { }
  void print(String *str, enum_query_type) override
  {
    str->append(STRING_WITH_LEN("ignore"));
  }
  int save_in_field(Field *field_arg, bool) override
  {
    return field_arg->save_in_field_ignore_value(false);
  }
  bool save_in_param(THD *, Item_param *param) override
  {
    param->set_ignore(true);
    return false;
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_ignore_specification>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/*
  Item_insert_value -- an implementation of VALUES() function.
  You can use the VALUES(col_name) function in the UPDATE clause
  to refer to column values from the INSERT portion of the INSERT
  ... UPDATE statement. In other words, VALUES(col_name) in the
  UPDATE clause refers to the value of col_name that would be
  inserted, had no duplicate-key conflict occurred.
  In all other places this function returns NULL.
*/

class Item_insert_value : public Item_field
{
public:
  Item *arg;
  Item_insert_value(THD *thd, Name_resolution_context *context_arg, Item *a)
    :Item_field(thd, context_arg),
     arg(a) {}
  bool eq(const Item *item, bool binary_cmp) const override;
  bool fix_fields(THD *, Item **) override;
  void print(String *str, enum_query_type query_type) override;
  int save_in_field(Field *field_arg, bool no_conversions) override
  {
    return Item_field::save_in_field(field_arg, no_conversions);
  }
  Type type() const override { return INSERT_VALUE_ITEM; }
  /*
   We use RAND_TABLE_BIT to prevent Item_insert_value from
   being treated as a constant and precalculated before execution
  */
  table_map used_tables() const override { return RAND_TABLE_BIT; }

  Item_field *field_for_view_update() override { return nullptr; }

  bool walk(Item_processor processor, bool walk_subquery, void *args) override
  {
    return arg->walk(processor, walk_subquery, args) ||
	    (this->*processor)(args);
  }
  bool check_partition_func_processor(void *) override { return true; }
  bool update_vcol_processor(void *) override { return false; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("value()", arg, VCOL_IMPOSSIBLE);
  }
};


class Table_triggers_list;

/*
  Represents NEW/OLD version of field of row which is
  changed/read in trigger.

  Note: For this item main part of actual binding to Field object happens
        not during fix_fields() call (like for Item_field) but right after
        parsing of trigger definition, when table is opened, with special
        setup_field() call. On fix_fields() stage we simply choose one of
        two Field instances representing either OLD or NEW version of this
        field.
*/
class Item_trigger_field : public Item_field,
                           private Settable_routine_parameter
{
private:
  GRANT_INFO *table_grants;
public:
  /* Next in list of all Item_trigger_field's in trigger */
  Item_trigger_field *next_trg_field;
  /* Pointer to Table_trigger_list object for table of this trigger */
  Table_triggers_list *triggers;
  /* Is this item represents row from NEW or OLD row ? */
  enum __attribute__((packed)) row_version_type {OLD_ROW, NEW_ROW};
  row_version_type row_version;
  /* Index of the field in the TABLE::field array */
  field_index_t field_idx;

private:
  /*
    Trigger field is read-only unless it belongs to the NEW row in a
    BEFORE INSERT of BEFORE UPDATE trigger.
  */
  bool read_only;

  /*
    'want_privilege' holds privileges required to perform operation on
    this trigger field (SELECT_ACL if we are going to read it and
    UPDATE_ACL if we are going to update it).  It is initialized at
    parse time but can be updated later if this trigger field is used
    as OUT or INOUT parameter of stored routine (in this case
    set_required_privilege() is called to appropriately update
    want_privilege and cleanup() is responsible for restoring of
    original want_privilege once parameter's value is updated).
  */
  privilege_t original_privilege;
  privilege_t want_privilege;
public:

Item_trigger_field(THD *thd, Name_resolution_context *context_arg,
                     row_version_type row_ver_arg,
                     const LEX_CSTRING &field_name_arg,
                     privilege_t priv, const bool ro)
    :Item_field(thd, context_arg, field_name_arg),
    table_grants(NULL),  next_trg_field(NULL),  triggers(NULL),
    row_version(row_ver_arg), field_idx(NO_CACHED_FIELD_INDEX),
    read_only (ro),  original_privilege(priv), want_privilege(priv)
  {
  }
  void setup_field(THD *thd, TABLE *table, GRANT_INFO *table_grant_info);
  Type type() const override { return TRIGGER_FIELD_ITEM; }
  bool eq(const Item *item, bool binary_cmp) const override;
  bool fix_fields(THD *, Item **) override;
  void print(String *str, enum_query_type query_type) override;
  table_map used_tables() const override { return (table_map)0L; }
  Field *get_tmp_table_field() override { return nullptr; }
  Item *copy_or_same(THD *) override { return this; }
  Item *get_tmp_table_item(THD *thd) override { return copy_or_same(thd); }
  void cleanup() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_trigger_field>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }

private:
  void set_required_privilege(bool rw) override;
  bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;

public:
  Settable_routine_parameter *get_settable_routine_parameter() override
  {
    return read_only ? nullptr : this;
  }

  bool set_value(THD *thd, Item **it)
  {
    return set_value(thd, NULL, it);
  }

public:
  bool unknown_splocal_processor(void *) override { return false; }
  bool check_vcol_func_processor(void *arg) override;
};


/**
  @todo
  Implement the is_null() method for this class. Currently calling is_null()
  on any Item_cache object resolves to Item::is_null(), which returns FALSE
  for any value.
*/

class Item_cache: public Item_fixed_hybrid,
                  public Type_handler_hybrid_field_type
{
protected:
  Item *example;
  /**
    Field that this object will get value from. This is used by 
    index-based subquery engines to detect and remove the equality injected 
    by IN->EXISTS transformation.
  */  
  Field *cached_field;
  /*
    TRUE <=> cache holds value of the last stored item (i.e actual value).
    store() stores item to be cached and sets this flag to FALSE.
    On the first call of val_xxx function if this flag is set to FALSE the 
    cache_value() will be called to actually cache value of saved item.
    cache_value() will set this flag to TRUE.
  */
  bool value_cached;

  table_map used_table_map;
public:
  /*
    This is set if at least one of the values of a sub query is NULL
    Item_cache_row returns this with null_inside().
    For not row items, it's set to the value of null_value
    It is set after cache_value() is called.
  */
  bool null_value_inside;

  Item_cache(THD *thd):
    Item_fixed_hybrid(thd),
    Type_handler_hybrid_field_type(&type_handler_string),
    example(0), cached_field(0),
    value_cached(0),
    used_table_map(0)
  {
    set_maybe_null();
    null_value= 1;
    null_value_inside= true;
    quick_fix_field();
  }
protected:
  Item_cache(THD *thd, const Type_handler *handler):
    Item_fixed_hybrid(thd),
    Type_handler_hybrid_field_type(handler),
    example(0), cached_field(0),
    value_cached(0),
    used_table_map(0)
  {
    set_maybe_null();
    null_value= 1;
    null_value_inside= true;
    quick_fix_field();
  }

public:
  virtual bool allocate(THD *thd, uint i) { return 0; }
  virtual bool setup(THD *thd, Item *item)
  {
    example= item;
    Type_std_attributes::set(item);
    base_flags|= item->base_flags & item_base_t::IS_COND;
    if (item->type() == FIELD_ITEM)
      cached_field= ((Item_field *)item)->field;
    return 0;
  };

  void set_used_tables(table_map map) { used_table_map= map; }
  table_map used_tables() const override { return used_table_map; }
  Type type() const override { return CACHE_ITEM; }

  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    return create_tmp_field_ex_simple(root, table, src, param);
  }

  virtual void keep_array() {}
#ifndef DBUG_OFF
  bool is_array_kept() { return TRUE; }
#endif
  void print(String *str, enum_query_type query_type) override;
  bool eq_def(const Field *field) 
  {
    return cached_field ? cached_field->eq_def (field) : FALSE;
  }
  bool eq(const Item *item, bool binary_cmp) const override
  {
    return this == item;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    if (example)
    {
      Item::vcol_func_processor_result *res=
        (Item::vcol_func_processor_result*) arg;
      example->check_vcol_func_processor(arg);
      /*
        Item_cache of a non-deterministic function requires re-fixing
        even if the function itself doesn't (e.g. CURRENT_TIMESTAMP)
      */
      if (res->errors & VCOL_NOT_STRICTLY_DETERMINISTIC)
        res->errors|= VCOL_SESSION_FUNC;
      return false;
    }
    return mark_unsupported_function("cache", arg, VCOL_IMPOSSIBLE);
  }
  bool fix_fields(THD *thd, Item **ref) override
  {
    quick_fix_field();
    if (example && !example->fixed())
      return example->fix_fields(thd, ref);
    return 0;
  }
  void cleanup() override
  {
    clear();
    Item_fixed_hybrid::cleanup();
  }
  /**
     Check if saved item has a non-NULL value.
     Will cache value of saved item if not already done. 
     @return TRUE if cached value is non-NULL.
   */
  bool has_value()
  {
    return (value_cached || cache_value()) && !null_value;
  }

  virtual void store(Item *item);
  virtual Item *get_item() { return example; }
  virtual bool cache_value()= 0;
  bool basic_const_item() const override
  { return example && example->basic_const_item(); }
  virtual void clear() { null_value= TRUE; value_cached= FALSE; }
  bool is_null() override { return !has_value(); }
  bool is_expensive() override
  {
    if (value_cached)
      return false;
    return example->is_expensive();
  }
  bool is_expensive_processor(void *arg) override
  {
    DBUG_ASSERT(example);
    if (value_cached)
      return false;
    return example->is_expensive_processor(arg);
  }
  virtual void set_null();
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    if (arg == STOP_PTR)
      return FALSE;
    if (example && example->walk(processor, walk_subquery, arg))
      return TRUE;
    return (this->*processor)(arg);
  }
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override;
  void split_sum_func2_example(THD *thd,  Ref_ptr_array ref_pointer_array,
                               List<Item> &fields, uint flags)
  {
    example->split_sum_func2(thd, ref_pointer_array, fields, &example, flags);
  }
  Item *get_example() const { return example; }

  virtual Item *convert_to_basic_const_item(THD *thd) { return 0; };
  Item *derived_field_transformer_for_having(THD *thd, uchar *) override
  { return convert_to_basic_const_item(thd); }
  Item *derived_field_transformer_for_where(THD *thd, uchar *) override
  { return convert_to_basic_const_item(thd); }
  Item *grouping_field_transformer_for_where(THD *thd, uchar *) override
  { return convert_to_basic_const_item(thd); }
  Item *in_subq_field_transformer_for_where(THD *thd, uchar *) override
  { return convert_to_basic_const_item(thd); }
  Item *in_subq_field_transformer_for_having(THD *thd, uchar *) override
  { return convert_to_basic_const_item(thd); }
};


class Item_cache_int: public Item_cache
{
protected:
  longlong value;
public:
  Item_cache_int(THD *thd, const Type_handler *handler):
    Item_cache(thd, handler), value(0) {}

  double val_real() override;
  longlong val_int() override;
  String* val_str(String *str) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_int(thd, ltime, fuzzydate); }
  bool cache_value() override;
  int save_in_field(Field *field, bool no_conversions) override;
  Item *convert_to_basic_const_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_int>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_bool: public Item_cache_int
{
public:
  Item_cache_bool(THD *thd)
   :Item_cache_int(thd, &type_handler_bool)
  { }
  bool cache_value() override;
  bool val_bool() override
  {
    return !has_value() ? false : (bool) value;
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return Item_cache_bool::val_bool();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_bool>(thd, this); }
};


class Item_cache_year: public Item_cache_int
{
public:
  Item_cache_year(THD *thd, const Type_handler *handler)
   :Item_cache_int(thd, handler) { }
  bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override
  {
    return type_handler_year.Item_get_date_with_warn(thd, this, to, mode);
  }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_temporal: public Item_cache_int
{
protected:
  Item_cache_temporal(THD *thd, const Type_handler *handler);
public:
  bool cache_value() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  int save_in_field(Field *field, bool no_conversions) override;
  bool setup(THD *thd, Item *item) override
  {
    if (Item_cache_int::setup(thd, item))
      return true;
    set_if_smaller(decimals, TIME_SECOND_PART_DIGITS);
    return false;
  }
  void store_packed(longlong val_arg, Item *example);
  /*
    Having a clone_item method tells optimizer that this object
    is a constant and need not be optimized further.
    Important when storing packed datetime values.
  */
  Item *clone_item(THD *thd) const override;
  Item *convert_to_basic_const_item(THD *thd) override;
  virtual Item *make_literal(THD *) =0;
};


class Item_cache_time: public Item_cache_temporal
{
public:
  Item_cache_time(THD *thd)
   :Item_cache_temporal(thd, &type_handler_time2) { }
  bool cache_value() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_time>(thd, this); }
  Item *make_literal(THD *) override;
  longlong val_datetime_packed(THD *thd) override
  {
    Datetime::Options_cmp opt(thd);
    return has_value() ? Datetime(thd, this, opt).to_packed() : 0;
  }
  longlong val_time_packed(THD *) override
  {
    return has_value() ? value : 0;
  }
  longlong val_int() override
  {
    return has_value() ? Time(this).to_longlong() : 0;
  }
  double val_real() override
  {
    return has_value() ? Time(this).to_double() : 0;
  }
  String *val_str(String *to) override
  {
    return has_value() ? Time(this).to_string(to, decimals) : NULL;
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return has_value() ? Time(this).to_decimal(to) : NULL;
  }
  bool val_native(THD *thd, Native *to) override
  {
    return has_value() ? Time(thd, this).to_native(to, decimals) : true;
  }
};


class Item_cache_datetime: public Item_cache_temporal
{
public:
  Item_cache_datetime(THD *thd)
   :Item_cache_temporal(thd, &type_handler_datetime2) { }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_datetime>(thd, this); }
  Item *make_literal(THD *) override;
  longlong val_datetime_packed(THD *) override
  {
    return has_value() ? value : 0;
  }
  longlong val_time_packed(THD *thd) override
  {
    return Time(thd, this, Time::Options_cmp(thd)).to_packed();
  }
  longlong val_int() override
  {
    return has_value() ? Datetime(this).to_longlong() : 0;
  }
  double val_real() override
  {
    return has_value() ? Datetime(this).to_double() : 0;
  }
  String *val_str(String *to) override
  {
    return has_value() ? Datetime(this).to_string(to, decimals) : NULL;
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return has_value() ? Datetime(this).to_decimal(to) : NULL;
  }
};


class Item_cache_date: public Item_cache_temporal
{
public:
  Item_cache_date(THD *thd)
   :Item_cache_temporal(thd, &type_handler_newdate) { }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_date>(thd, this); }
  Item *make_literal(THD *) override;
  longlong val_datetime_packed(THD *) override
  {
    return has_value() ? value : 0;
  }
  longlong val_time_packed(THD *thd) override
  {
    return Time(thd, this, Time::Options_cmp(thd)).to_packed();
  }
  longlong val_int() override
  { return has_value() ? Date(this).to_longlong() : 0; }
  double val_real() override
  { return has_value() ? Date(this).to_double() : 0; }
  String *val_str(String *to) override
  {
    return has_value() ? Date(this).to_string(to) : NULL;
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return has_value() ? Date(this).to_decimal(to) : NULL;
  }
};


class Item_cache_timestamp: public Item_cache
{
  Timestamp_or_zero_datetime_native m_native;
  Datetime to_datetime(THD *thd);
public:
  Item_cache_timestamp(THD *thd)
   :Item_cache(thd, &type_handler_timestamp2) { }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_timestamp>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
  bool cache_value() override;
  String* val_str(String *to) override
  {
    return to_datetime(current_thd).to_string(to, decimals);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return to_datetime(current_thd).to_decimal(to);
  }
  longlong val_int() override
  {
    return to_datetime(current_thd).to_longlong();
  }
  double val_real() override
  {
    return to_datetime(current_thd).to_double();
  }
  longlong val_datetime_packed(THD *thd) override
  {
    return to_datetime(thd).to_packed();
  }
  longlong val_time_packed(THD *) override
  {
    DBUG_ASSERT(0);
    return 0;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  int save_in_field(Field *field, bool no_conversions) override;
  bool val_native(THD *thd, Native *to) override;
};


class Item_cache_real: public Item_cache
{
protected:
  double value;
public:
  Item_cache_real(THD *thd, const Type_handler *h)
   :Item_cache(thd, h),
    value(0)
  {}
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_real(thd, ltime, fuzzydate); }
  bool cache_value() override;
  Item *convert_to_basic_const_item(THD *thd) override;
};


class Item_cache_double: public Item_cache_real
{
public:
  Item_cache_double(THD *thd)
   :Item_cache_real(thd, &type_handler_double)
  { }
  String *val_str(String *str) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_double>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_float: public Item_cache_real
{
public:
  Item_cache_float(THD *thd)
   :Item_cache_real(thd, &type_handler_float)
  { }
  String *val_str(String *str) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_float>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_decimal: public Item_cache
{
protected:
  my_decimal decimal_value;
public:
  Item_cache_decimal(THD *thd): Item_cache(thd, &type_handler_newdecimal) {}

  double val_real() override;
  longlong val_int() override;
  String* val_str(String *str) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override
  {
    return decimal_to_datetime_with_warn(thd, VDec(this).ptr(), to, mode,
                                         NULL, NULL);
  }
  bool cache_value() override;
  Item *convert_to_basic_const_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_decimal>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_str: public Item_cache
{
  char buffer[STRING_BUFFER_USUAL_SIZE];
  String *value, value_buff;
  bool is_varbinary;
  
public:
  Item_cache_str(THD *thd, const Item *item):
    Item_cache(thd, item->type_handler()), value(0),
    is_varbinary(item->type() == FIELD_ITEM &&
                 Item_cache_str::field_type() == MYSQL_TYPE_VARCHAR &&
                 !((const Item_field *) item)->field->has_charset())
  {
    collation.set(const_cast<DTCollation&>(item->collation));
  }
  double val_real() override;
  longlong val_int() override;
  String* val_str(String *) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_string(thd, ltime, fuzzydate); }
  CHARSET_INFO *charset() const { return value->charset(); };
  int save_in_field(Field *field, bool no_conversions) override;
  bool cache_value() override;
  Item *convert_to_basic_const_item(THD *thd) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_str>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_str_for_nullif: public Item_cache_str
{
public:
  Item_cache_str_for_nullif(THD *thd, const Item *item)
   :Item_cache_str(thd, item)
  { }
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
  {
    /**
      Item_cache_str::safe_charset_converter() returns a new Item_cache
      with Item_func_conv_charset installed on "example". The original
      Item_cache is not referenced (neither directly nor recursively)
      from the result of Item_cache_str::safe_charset_converter().

      For NULLIF() purposes we need a different behavior:
      we need a new instance of Item_func_conv_charset,
      with the original Item_cache referenced in args[0]. See MDEV-9181.
    */
    return Item::safe_charset_converter(thd, tocs);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_str_for_nullif>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


class Item_cache_row: public Item_cache
{
  Item_cache  **values;
  uint item_count;
  bool save_array;
public:
  Item_cache_row(THD *thd):
    Item_cache(thd, &type_handler_row), values(0), item_count(2),
    save_array(0) {}

  /*
    'allocate' used only in row transformer, to preallocate space for row
    cache.
  */
  bool allocate(THD *thd, uint num) override;
  /*
    'setup' is needed only by row => it not called by simple row subselect
    (only by IN subselect (in subselect optimizer))
  */
  bool setup(THD *thd, Item *item) override;
  void store(Item *item) override;
  void illegal_method_call(const char *);
  void make_send_field(THD *, Send_field *) override
  {
    illegal_method_call("make_send_field");
  };
  double val_real() override
  {
    illegal_method_call("val");
    return 0;
  };
  longlong val_int() override
  {
    illegal_method_call("val_int");
    return 0;
  };
  String *val_str(String *) override
  {
    illegal_method_call("val_str");
    return nullptr;
  };
  my_decimal *val_decimal(my_decimal *) override
  {
    illegal_method_call("val_decimal");
    return nullptr;
  };
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    illegal_method_call("val_decimal");
    return true;
  }

  uint cols() const override { return item_count; }
  Item *element_index(uint i) override { return values[i]; }
  Item **addr(uint i) override { return (Item **) (values + i); }
  bool check_cols(uint c) override;
  bool null_inside() override;
  void bring_value() override;
  void keep_array() override { save_array= 1; }
#ifndef DBUG_OFF
  bool is_array_kept() { return save_array; }
#endif
  void cleanup() override
  {
    DBUG_ENTER("Item_cache_row::cleanup");
    Item_cache::cleanup();
    if (!save_array)
      values= 0;
    DBUG_VOID_RETURN;
  }
  bool cache_value() override;
  void set_null() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_cache_row>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/*
  Item_type_holder used to store type. name, length of Item for UNIONS &
  derived tables.

  Item_type_holder do not need cleanup() because its time of live limited by
  single SP/PS execution.
*/
class Item_type_holder: public Item, public Type_handler_hybrid_field_type
{
protected:
  const TYPELIB *enum_set_typelib;
public:
  Item_type_holder(THD *thd, Item *item, const Type_handler *handler,
                   const Type_all_attributes *attr, bool maybe_null_arg)
   :Item(thd), Type_handler_hybrid_field_type(handler),
    enum_set_typelib(attr->get_typelib())
  {
    name= item->name;
    Type_std_attributes::set(*attr);
    set_maybe_null(maybe_null_arg);
    copy_flags(item, item_base_t::IS_EXPLICIT_NAME |
                     item_base_t::IS_IN_WITH_CYCLE);
  }

  const Type_handler *type_handler() const override
  {
    return Type_handler_hybrid_field_type::type_handler()->
             type_handler_for_item_field();
  }
  const Type_handler *real_type_handler() const override
  {
    return Type_handler_hybrid_field_type::type_handler();
  }

  Type type() const override { return TYPE_HOLDER; }
  const TYPELIB *get_typelib() const override { return enum_set_typelib; }
  /*
    When handling a query like this:
      VALUES ('') UNION VALUES( _utf16 0x0020 COLLATE utf16_bin);
    Item_type_holder can be passed to
      Type_handler_xxx::Item_hybrid_func_fix_attributes()
    We don't want the latter to perform character set conversion of a
    Item_type_holder by calling its val_str(), which calls DBUG_ASSERT(0).
    Let's override const_item() and is_expensive() to avoid this.
    Note, Item_hybrid_func_fix_attributes() could probably
    have a new argument to distinguish what we need:
    - (a) aggregate data type attributes only
    - (b) install converters after attribute aggregation
    So st_select_lex_unit::join_union_type_attributes() could
    ask it to do (a) only, without (b).
  */
  bool const_item() const override { return false; }
  bool is_expensive() override { return true; }
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal *) override;
  String *val_str(String*) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    return Item_type_holder::real_type_handler()->
      make_and_init_table_field(root, &name, Record_addr(maybe_null()),
                                *this, table);
  }
  Item *do_get_copy(THD *) const override { return nullptr; }
  Item *do_build_clone(THD *) const override { return nullptr; }
};


class st_select_lex;
void mark_select_range_as_dependent(THD *thd,
                                    st_select_lex *last_select,
                                    st_select_lex *current_sel,
                                    Field *found_field, Item *found_item,
                                    Item_ident *resolved_item,
                                    bool suppress_warning_output);

extern Cached_item *new_Cached_item(THD *thd, Item *item,
                                    bool pass_through_ref);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item);
extern int stored_field_cmp_to_item(THD *thd, Field *field, Item *item);

extern const String my_null_string;

/**
  Interface for Item iterator
*/

class Item_iterator
{
public:
  /**
    Shall set this iterator to the position before the first item

    @note
    This method also may perform some other initialization actions like
    allocation of certain resources.
  */
  virtual void open()= 0;
  /**
    Shall return the next Item (or NULL if there is no next item) and
    move pointer to position after it.
  */
  virtual Item *next()= 0;
  /**
    Shall force iterator to free resources (if it holds them)

    @note
    One should not use the iterator without open() call after close()
  */
  virtual void close()= 0;

  virtual ~Item_iterator() = default;
};


/**
  Item iterator over List_iterator_fast for Item references
*/

class Item_iterator_ref_list: public Item_iterator
{
  List_iterator<Item*> list;
public:
  Item_iterator_ref_list(List_iterator<Item*> &arg_list):
    list(arg_list) {}
  void open() override { list.rewind(); }
  Item *next() override { return *(list++); }
  void close() override {}
};


/**
  Item iterator over List_iterator_fast for Items
*/

class Item_iterator_list: public Item_iterator
{
  List_iterator<Item> list;
public:
  Item_iterator_list(List_iterator<Item> &arg_list):
    list(arg_list) {}
  void open() override { list.rewind(); }
  Item *next() override { return (list++); }
  void close() override {}
};


/**
  Item iterator over Item interface for rows
*/

class Item_iterator_row: public Item_iterator
{
  Item *base_item;
  uint current;
public:
  Item_iterator_row(Item *base) : base_item(base), current(0) {}
  void open() override { current= 0; }
  Item *next() override
  {
    if (current >= base_item->cols())
      return NULL;
    return base_item->element_index(current++);
  }
  void close() override {}
};


/*
  fix_escape_item() sets the out "escape" parameter to:
  - native code in case of an 8bit character set
  - Unicode code point in case of a multi-byte character set

  The value meaning a not-initialized ESCAPE character must not be equal to
  any valid value, so must be outside of these ranges:
  - -128..+127, not to conflict with a valid 8bit charcter
  - 0..0x10FFFF, not to conflict with a valid Unicode code point
  The exact value does not matter.
*/
#define ESCAPE_NOT_INITIALIZED -1000

/*
  It's used in ::fix_fields() methods of LIKE and JSON_SEARCH
  functions to handle the ESCAPE parameter.
  This parameter is quite non-standard so the specific function.
*/
bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str,
                     bool escape_used_in_parsing, CHARSET_INFO *cmp_cs,
                     int *escape);

inline bool Virtual_column_info::is_equal(const Virtual_column_info* vcol) const
{
  return type_handler()  == vcol->type_handler()
      && stored_in_db == vcol->is_stored()
      && expr->eq(vcol->expr, true);
}

inline void Virtual_column_info::print(String* str)
{
  expr->print_for_table_def(str);
}

class Item_direct_ref_to_item : public Item_direct_ref
{
  Item *m_item;
public:
  Item_direct_ref_to_item(THD *thd, Item *item);

  void change_item(THD *thd, Item *);

  bool fix_fields(THD *thd, Item **it) override;

  void print(String *str, enum_query_type query_type) override;

  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override;
  Item *get_tmp_table_item(THD *thd) override
  { return m_item->get_tmp_table_item(thd); }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_direct_ref_to_item>(thd, this); }
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override
  {
    return m_item->build_equal_items(thd, inherited, link_item_fields,
                                     cond_equal_ref);
  }
  LEX_CSTRING full_name_cstring() const override
  { return m_item->full_name_cstring(); }
  void make_send_field(THD *thd, Send_field *field) override
  { m_item->make_send_field(thd, field); }
  bool eq(const Item *item, bool binary_cmp) const override
  {
    const Item *it= item->real_item();
    return m_item->eq(it, binary_cmp);
  }
  void fix_after_pullout(st_select_lex *new_parent, Item **refptr, bool merge) override
  { m_item->fix_after_pullout(new_parent, &m_item, merge); }
  void save_val(Field *to) override
  { return m_item->save_val(to); }
  void save_result(Field *to) override
  { return m_item->save_result(to); }
  int save_in_field(Field *to, bool no_conversions) override
  { return m_item->save_in_field(to, no_conversions); }
  const Type_handler *type_handler() const override { return m_item->type_handler(); }
  table_map used_tables() const override { return m_item->used_tables(); }
  void update_used_tables() override
  { m_item->update_used_tables(); }
  bool const_item() const override { return m_item->const_item(); }
  table_map not_null_tables() const override { return m_item->not_null_tables(); }
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    return m_item->walk(processor, walk_subquery, arg) ||
      (this->*processor)(arg);
  }
  bool enumerate_field_refs_processor(void *arg) override
  { return m_item->enumerate_field_refs_processor(arg); }
  Item_field *field_for_view_update() override
  { return m_item->field_for_view_update(); }

  /* Row emulation: forwarding of ROW-related calls to orig_item */
  uint cols() const override
  { return m_item->cols(); }
  Item* element_index(uint i) override
  { return this; }
  Item** addr(uint i) override
  { return  &m_item; }
  bool check_cols(uint c) override
  { return Item::check_cols(c); }
  bool null_inside() override
  { return m_item->null_inside(); }
  void bring_value() override
  {}

  Item_equal *get_item_equal() override { return m_item->get_item_equal(); }
  void set_item_equal(Item_equal *item_eq) override { m_item->set_item_equal(item_eq); }
  Item_equal *find_item_equal(COND_EQUAL *cond_equal) override
  { return m_item->find_item_equal(cond_equal); }
  Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) override
  { return m_item->propagate_equal_fields(thd, ctx, cond); }
  Item *replace_equal_field(THD *thd, uchar *arg) override
  { return m_item->replace_equal_field(thd, arg); }

  bool excl_dep_on_table(table_map tab_map) override
  { return m_item->excl_dep_on_table(tab_map); }
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override
  { return m_item->excl_dep_on_grouping_fields(sel); }
  bool is_expensive() override { return m_item->is_expensive(); }
  void set_item(Item *item) { m_item= item; }
  Item *do_build_clone(THD *thd) const override
  {
    Item *clone_item= m_item->build_clone(thd);
    if (clone_item)
    {
      Item_direct_ref_to_item *copy= (Item_direct_ref_to_item *) get_copy(thd);
      if (!copy)
        return 0;
      copy->set_item(clone_item);
      return copy;
    }
    return 0;
  }

  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
                      List<Item> &fields, uint flags) override
  {
    m_item->split_sum_func(thd, ref_pointer_array, fields, flags);
  }
  /*
    This processor states that this is safe for virtual columns
    (because this Item transparency)
  */
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
};

inline bool TABLE::mark_column_with_deps(Field *field)
{
  bool res;
  if (!(res= bitmap_fast_test_and_set(read_set, field->field_index)))
  {
    if (field->vcol_info)
      mark_virtual_column_deps(field);
  }
  return res;
}

inline bool TABLE::mark_virtual_column_with_deps(Field *field)
{
  bool res;
  DBUG_ASSERT(field->vcol_info);
  if (!(res= bitmap_fast_test_and_set(read_set, field->field_index)))
    mark_virtual_column_deps(field);
  return res;
}

inline void TABLE::mark_virtual_column_deps(Field *field)
{
  DBUG_ASSERT(field->vcol_info);
  DBUG_ASSERT(field->vcol_info->expr);
  field->vcol_info->expr->walk(&Item::register_field_in_read_map, 1, 0);
}

inline void TABLE::use_all_stored_columns()
{
  bitmap_set_all(read_set);
  if (Field **vf= vfield)
    for (; *vf; vf++)
      bitmap_clear_bit(read_set, (*vf)->field_index);
}

#endif /* SQL_ITEM_INCLUDED */
server/private/ft_global.h000064400000006051150400263770011634 0ustar00/* Copyright (c) 2000-2005, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

/* Written by Sergei A. Golubchik, who has a shared copyright to this code */

/* some definitions for full-text indices */

/* #include "myisam.h" */

#ifndef _ft_global_h
#define _ft_global_h
#ifdef  __cplusplus
extern "C" {
#endif

#include <my_compare.h>

#define HA_FT_MAXBYTELEN 254
#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)

#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|"

typedef struct st_ft_info FT_INFO;
struct _ft_vft
{
  int       (*read_next)(FT_INFO *, char *);
  float     (*find_relevance)(FT_INFO *, uchar *, uint);
  void      (*close_search)(FT_INFO *);
  float     (*get_relevance)(FT_INFO *);
  void      (*reinit_search)(FT_INFO *);
};

typedef struct st_ft_info_ext FT_INFO_EXT;
struct _ft_vft_ext
{
  uint      (*get_version)();        // Extended API version
  ulonglong (*get_flags)();
  ulonglong (*get_docid)(FT_INFO_EXT *);
  ulonglong (*count_matches)(FT_INFO_EXT *);
};

/* Flags for extended FT API */
#define FTS_ORDERED_RESULT                (1LL << 1)
#define FTS_DOCID_IN_RESULT               (1LL << 2)

#define FTS_DOC_ID_COL_NAME "FTS_DOC_ID"

#ifndef FT_CORE
struct st_ft_info
{
  struct _ft_vft *please; /* INTERCAL style :-) */
};

struct st_ft_info_ext
{
  struct _ft_vft     *please; /* INTERCAL style :-) */
  struct _ft_vft_ext *could_you;
};
#endif

extern const char *ft_stopword_file;
extern const char *ft_precompiled_stopwords[];

extern ulong ft_min_word_len;
extern ulong ft_max_word_len;
extern ulong ft_query_expansion_limit;
extern const char *ft_boolean_syntax;
extern struct st_mysql_ftparser ft_default_parser;

int ft_init_stopwords(void);
void ft_free_stopwords(void);

#define FT_NL     0
#define FT_BOOL   1
#define FT_SORTED 2
#define FT_EXPAND 4   /* query expansion */

FT_INFO *ft_init_search(uint,void *, uint, uchar *, size_t,
                        CHARSET_INFO *, uchar *);
my_bool ft_boolean_check_syntax_string(const uchar *, size_t length,
                                       CHARSET_INFO *cs);

/* Internal symbols for fulltext between maria and MyISAM */

#define HA_FT_WTYPE  HA_KEYTYPE_FLOAT
#define HA_FT_WLEN   4
#define FT_SEGS      2

#define ft_sintXkorr(A)    mi_sint4korr(A)
#define ft_intXstore(T,A)  mi_int4store(T,A)

extern const HA_KEYSEG ft_keysegs[FT_SEGS];

typedef union {int32 i; float f;} FT_WEIGTH;

#ifdef  __cplusplus
}
#endif
#endif
server/private/bounded_queue.h000064400000013715150400263770012534 0ustar00/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef BOUNDED_QUEUE_INCLUDED
#define BOUNDED_QUEUE_INCLUDED

#include "my_base.h"
#include <my_sys.h>
#include "queues.h"
#include <string.h>

class Sort_param;

/**
  A priority queue with a fixed, limited size.

  This is a wrapper on top of QUEUE and the queue_xxx() functions.
  It keeps the top-N elements which are inserted.

  Elements of type Element_type are pushed into the queue.
  For each element, we call a user-supplied keymaker_function,
  to generate a key of type Key_type for the element.
  Instances of Key_type are compared with the user-supplied compare_function.

  The underlying QUEUE implementation needs one extra element for replacing
  the lowest/highest element when pushing into a full queue.
 */
template<typename Element_type, typename Key_type>
class Bounded_queue
{
public:
  Bounded_queue()
  {
    memset(&m_queue, 0, sizeof(m_queue));
  }

  ~Bounded_queue()
  {
    delete_queue(&m_queue);
  }

  /**
     Function for making sort-key from input data.
     @param param Sort parameters.
     @param to    Where to put the key.
     @param from  The input data.
  */
  typedef uint (*keymaker_function)(Sort_param *param,
                                    Key_type *to,
                                    Element_type *from,
                                    bool packing_keys);

  /**
    Initialize the queue.

    @param max_elements   The size of the queue.
    @param max_at_top     Set to true if you want biggest element on top.
           false: We keep the n largest elements.
                  pop() will return the smallest key in the result set.
           true:  We keep the n smallest elements.
                  pop() will return the largest key in the result set.
    @param compare_length Length of the data (i.e. the keys) used for sorting.
    @param keymaker       Function which generates keys for elements.
    @param sort_param     Sort parameters.
    @param sort_keys      Array of pointers to keys to sort.

    @retval 0 OK, 1 Could not allocate memory.

    We do *not* take ownership of any of the input pointer arguments.
   */
  int init(ha_rows max_elements, bool max_at_top,
           size_t compare_length,
           keymaker_function keymaker, Sort_param *sort_param,
           Key_type **sort_keys);

  /**
    Pushes an element on the queue.
    If the queue is already full, we discard one element.
    Calls keymaker_function to generate a key for the element.

    @param element        The element to be pushed.
   */
  void push(Element_type *element);

  /**
    Removes the top element from the queue.

    @retval Pointer to the (key of the) removed element.

    @note This function is for unit testing, where we push elements into to the
          queue, and test that the appropriate keys are retained.
          Interleaving of push() and pop() operations has not been tested.
   */
  Key_type **pop()
  {
    // Don't return the extra element to the client code.
    if (queue_is_full((&m_queue)))
      queue_remove(&m_queue, 0);
    DBUG_ASSERT(m_queue.elements > 0);
    if (m_queue.elements == 0)
      return NULL;
    return reinterpret_cast<Key_type**>(queue_remove(&m_queue, 0));
  }

  /**
    The number of elements in the queue.
   */
  uint num_elements() const { return m_queue.elements; }

  /**
    Is the queue initialized?
   */
  bool is_initialized() const { return m_queue.max_elements > 0; }

private:
  Key_type         **m_sort_keys;
  size_t             m_compare_length;
  keymaker_function  m_keymaker;
  Sort_param        *m_sort_param;
  st_queue           m_queue;
};


template<typename Element_type, typename Key_type>
int Bounded_queue<Element_type, Key_type>::init(ha_rows max_elements,
                                                bool max_at_top,
                                                size_t compare_length,
                                                keymaker_function keymaker,
                                                Sort_param *sort_param,
                                                Key_type **sort_keys)
{
  DBUG_ASSERT(sort_keys != NULL);

  m_sort_keys=      sort_keys;
  m_compare_length= compare_length;
  m_keymaker=       keymaker;
  m_sort_param=     sort_param;
  // init_queue() takes an uint, and also does (max_elements + 1)
  if (max_elements >= (UINT_MAX - 1))
    return 1;
  // We allocate space for one extra element, for replace when queue is full.
  return init_queue(&m_queue, (uint) max_elements + 1,
                    0, max_at_top,
                    get_ptr_compare(compare_length),
                    &m_compare_length, 0, 0);
}


template<typename Element_type, typename Key_type>
void Bounded_queue<Element_type, Key_type>::push(Element_type *element)
{
  DBUG_ASSERT(is_initialized());
  if (queue_is_full((&m_queue)))
  {
    // Replace top element with new key, and re-order the queue.
    Key_type **pq_top= reinterpret_cast<Key_type **>(queue_top(&m_queue));
    (void)(*m_keymaker)(m_sort_param, *pq_top, element, false);
    queue_replace_top(&m_queue);
  } else {
    // Insert new key into the queue.
    (*m_keymaker)(m_sort_param, m_sort_keys[m_queue.elements],
                  element, false);
    queue_insert(&m_queue,
                 reinterpret_cast<uchar*>(&m_sort_keys[m_queue.elements]));
  }
}

#endif  // BOUNDED_QUEUE_INCLUDED
server/private/pfs_transaction_provider.h000064400000005436150400263770015020 0ustar00/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_TRANSACTION_PROVIDER_H
#define PFS_TRANSACTION_PROVIDER_H

/**
  @file include/pfs_transaction_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_TRANSACTION_CALL(M) pfs_ ## M ## _v1

C_MODE_START

PSI_transaction_locker*
pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state,
                                     const void *xid,
                                     ulonglong trxid,
                                     int isolation_level,
                                     my_bool read_only,
                                     my_bool autocommit);

void pfs_start_transaction_v1(PSI_transaction_locker *locker,
                              const char *src_file, uint src_line);

void pfs_set_transaction_xid_v1(PSI_transaction_locker *locker,
                                const void *xid,
                                int xa_state);

void pfs_set_transaction_xa_state_v1(PSI_transaction_locker *locker,
                                     int xa_state);

void pfs_set_transaction_gtid_v1(PSI_transaction_locker *locker,
                                 const void *sid,
                                 const void *gtid_spec);

void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker,
                                  const ulonglong *trxid);

void pfs_inc_transaction_savepoints_v1(PSI_transaction_locker *locker,
                                       ulong count);

void pfs_inc_transaction_rollback_to_savepoint_v1(PSI_transaction_locker *locker,
                                                  ulong count);

void pfs_inc_transaction_release_savepoint_v1(PSI_transaction_locker *locker,
                                              ulong count);

void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit);

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_TRANSACTION_INTERFACE */

#endif

server/private/sql_manager.h000064400000001700150400263770012170 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_MANAGER_INCLUDED
#define SQL_MANAGER_INCLUDED

void start_handle_manager();
void stop_handle_manager();
bool mysql_manager_submit(void (*action)(void *), void *data);

#endif /* SQL_MANAGER_INCLUDED */
server/private/client_settings.h000064400000003617150400263770013106 0ustar00/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
   
   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 */


#ifndef CLIENT_SETTINGS_INCLUDED
#define CLIENT_SETTINGS_INCLUDED
#else
#error You have already included an client_settings.h and it should not be included twice
#endif /* CLIENT_SETTINGS_INCLUDED */

#include <thr_alarm.h>
#include <sql_common.h>

/*
 Note: CLIENT_CAPABILITIES is also defined in libmysql/client_settings.h.
 When adding capabilities here, consider if they should be also added to
 the libmysql version.
*/
#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \
                             CLIENT_LONG_FLAG |     \
                             CLIENT_TRANSACTIONS |  \
                             CLIENT_PROTOCOL_41 |   \
                             CLIENT_SECURE_CONNECTION | \
                             CLIENT_PLUGIN_AUTH | \
                             CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
                             CLIENT_CONNECT_ATTRS)

#define read_user_name(A) A[0]= 0
#undef _CUSTOMCONFIG_

#define mysql_server_init(a,b,c) mysql_client_plugin_init()
#define mysql_server_end()       mysql_client_plugin_deinit()

#ifdef HAVE_REPLICATION
C_MODE_START
void slave_io_thread_detach_vio();
C_MODE_END
#else
#define slave_io_thread_detach_vio()
#endif

server/private/item_strfunc.h000064400000215061150400263770012410 0ustar00#ifndef ITEM_STRFUNC_INCLUDED
#define ITEM_STRFUNC_INCLUDED

/*
   Copyright (c) 2000, 2011, Oracle and/or its affiliates.
   Copyright (c) 2009, 2021, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


/* This file defines all string functions */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

extern size_t username_char_length;

class Item_str_func :public Item_func
{
protected:
  /**
     Sets the result value of the function an empty string, using the current
     character set. No memory is allocated.
     @retval A pointer to the str_value member.
   */
  virtual String *make_empty_result(String *str)
  {
    /*
      Reset string length to an empty string. We don't use str_value.set() as
      we don't want to free and potentially have to reallocate the buffer
      for each call.
    */
    if (!str->is_alloced())
      str->set("", 0, collation.collation); /* Avoid null ptrs */
    else
    {
      str->length(0);                      /* Reuse allocated area */
      str->set_charset(collation.collation);
    }
    return str;
  }
public:
  Item_str_func(THD *thd): Item_func(thd) { decimals=NOT_FIXED_DEC; }
  Item_str_func(THD *thd, Item *a): Item_func(thd, a) {decimals=NOT_FIXED_DEC; }
  Item_str_func(THD *thd, Item *a, Item *b):
    Item_func(thd, a, b) { decimals=NOT_FIXED_DEC; }
  Item_str_func(THD *thd, Item *a, Item *b, Item *c):
    Item_func(thd, a, b, c) { decimals=NOT_FIXED_DEC; }
  Item_str_func(THD *thd, Item *a, Item *b, Item *c, Item *d):
    Item_func(thd, a, b, c, d) { decimals=NOT_FIXED_DEC; }
  Item_str_func(THD *thd, Item *a, Item *b, Item *c, Item *d, Item* e):
    Item_func(thd, a, b, c, d, e) { decimals=NOT_FIXED_DEC; }
  Item_str_func(THD *thd, List<Item> &list):
    Item_func(thd, list) { decimals=NOT_FIXED_DEC; }
  longlong val_int() override;
  double val_real() override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_string(thd, ltime, fuzzydate); }
  const Type_handler *type_handler() const override
  { return string_type_handler(); }
  void left_right_max_length();
  bool fix_fields(THD *thd, Item **ref) override;
};



/*
  Functions that return values with ASCII repertoire
*/
class Item_str_ascii_func :public Item_str_func
{
  String ascii_buf;
public:
  Item_str_ascii_func(THD *thd): Item_str_func(thd) {}
  Item_str_ascii_func(THD *thd, Item *a): Item_str_func(thd, a) {}
  Item_str_ascii_func(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  Item_str_ascii_func(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c) {}
  String *val_str(String *str) override
  {
    return val_str_from_val_str_ascii(str, &ascii_buf);
  }
  String *val_str_ascii(String *) override= 0;
};


/**
  Functions that return a checksum or a hash of the argument,
  or somehow else encode or decode the argument,
  returning an ASCII-repertoire string.
*/
class Item_str_ascii_checksum_func: public Item_str_ascii_func
{
public:
  Item_str_ascii_checksum_func(THD *thd, Item *a)
   :Item_str_ascii_func(thd, a) { }
  Item_str_ascii_checksum_func(THD *thd, Item *a, Item *b)
   :Item_str_ascii_func(thd, a, b) { }
  bool eq(const Item *item, bool binary_cmp) const override
  {
    // Always use binary argument comparison: MD5('x') != MD5('X')
    return Item_func::eq(item, true);
  }
};


/**
  Functions that return a checksum or a hash of the argument,
  or somehow else encode or decode the argument,
  returning a binary string.
*/
class Item_str_binary_checksum_func: public Item_str_func
{
public:
  Item_str_binary_checksum_func(THD *thd, Item *a)
   :Item_str_func(thd, a) { }
  Item_str_binary_checksum_func(THD *thd, Item *a, Item *b)
   :Item_str_func(thd, a, b) { }
  bool eq(const Item *item, bool binary_cmp) const override
  {
    /*
      Always use binary argument comparison:
        FROM_BASE64('test') != FROM_BASE64('TEST')
    */
    return Item_func::eq(item, true);
  }
};


class Item_func_md5 :public Item_str_ascii_checksum_func
{
public:
  Item_func_md5(THD *thd, Item *a): Item_str_ascii_checksum_func(thd, a) {}
  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override
  {
    fix_length_and_charset(32, default_charset());
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("md5") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_md5>(thd, this); }
};


class Item_func_sha :public Item_str_ascii_checksum_func
{
public:
  Item_func_sha(THD *thd, Item *a): Item_str_ascii_checksum_func(thd, a) {}
  String *val_str_ascii(String *) override;    
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sha") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sha>(thd, this); }
};

class Item_func_sha2 :public Item_str_ascii_checksum_func
{
public:
  Item_func_sha2(THD *thd, Item *a, Item *b)
   :Item_str_ascii_checksum_func(thd, a, b) {}
  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sha2") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sha2>(thd, this); }
};

class Item_func_to_base64 :public Item_str_ascii_checksum_func
{
  String tmp_value;
public:
  Item_func_to_base64(THD *thd, Item *a)
   :Item_str_ascii_checksum_func(thd, a) {}
  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("to_base64") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_to_base64>(thd, this); }
};

class Item_func_from_base64 :public Item_str_binary_checksum_func
{
  String tmp_value;
public:
  Item_func_from_base64(THD *thd, Item *a)
   :Item_str_binary_checksum_func(thd, a) { }
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("from_base64") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_from_base64>(thd, this); }
};

#include <my_crypt.h>

class Item_aes_crypt :public Item_str_binary_checksum_func
{
  enum { AES_KEY_LENGTH = 128 };
  void create_key(String *user_key, uchar* key);

protected:
  int what;
  String tmp_value;
public:
  Item_aes_crypt(THD *thd, Item *a, Item *b)
   :Item_str_binary_checksum_func(thd, a, b) {}
  String *val_str(String *) override;
};

class Item_func_aes_encrypt :public Item_aes_crypt
{
public:
  Item_func_aes_encrypt(THD *thd, Item *a, Item *b)
   :Item_aes_crypt(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("aes_encrypt") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_aes_encrypt>(thd, this); }
};

class Item_func_aes_decrypt :public Item_aes_crypt
{
public:
  Item_func_aes_decrypt(THD *thd, Item *a, Item *b):
    Item_aes_crypt(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("aes_decrypt") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_aes_decrypt>(thd, this); }
};


class Item_func_concat :public Item_str_func
{
protected:
  String tmp_value;
  /*
    Append a non-NULL value to the result.
    @param [IN]     thd          - The current thread.
    @param [IN/OUT] res          - The current val_str() return value.
    @param [IN]     app          - The value to be appended.
    @retval                      - false on success, true on error
  */
  bool append_value(THD *thd, String *res, const String *app);
  bool realloc_result(String *str, uint length) const;
public:
  Item_func_concat(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
  Item_func_concat(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("concat") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_concat>(thd, this); }
};


/*
  This class handles the || operator in sql_mode=ORACLE.
  Unlike the traditional MariaDB concat(), it treats NULL arguments as ''.
*/
class Item_func_concat_operator_oracle :public Item_func_concat
{
public:
  Item_func_concat_operator_oracle(THD *thd, List<Item> &list)
   :Item_func_concat(thd, list)
  { }
  Item_func_concat_operator_oracle(THD *thd, Item *a, Item *b)
   :Item_func_concat(thd, a, b)
  { }
  String *val_str(String *) override;
  const Schema *schema() const override { return &oracle_schema_ref; }
  void print(String *str, enum_query_type query_type) override
  {
    if (query_type & QT_FOR_FRM)
    {
      // 10.3 downgrade compatibility for FRM
      str->append(STRING_WITH_LEN("concat_operator_oracle"));
    }
    else
      print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  {
    return get_item_copy<Item_func_concat_operator_oracle>(thd, this);
  }
};


class Item_func_decode_histogram :public Item_str_func
{
public:
  Item_func_decode_histogram(THD *thd, Item *a, Item *b):
    Item_str_func(thd, a, b) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    collation.set(system_charset_info);
    max_length= MAX_BLOB_WIDTH;
    set_maybe_null();
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("decode_histogram") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_decode_histogram>(thd, this); }
};

class Item_func_concat_ws :public Item_str_func
{
  String tmp_value;
public:
  Item_func_concat_ws(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("concat_ws") };
    return name;
  }
  table_map not_null_tables() const override { return 0; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_concat_ws>(thd, this); }
};

class Item_func_reverse :public Item_str_func
{
  String tmp_value;
public:
  Item_func_reverse(THD *thd, Item *a): Item_str_func(thd, a) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("reverse") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_reverse>(thd, this); }
};


class Item_func_replace :public Item_str_func
{
  String tmp_value,tmp_value2;
protected:
  String *val_str_internal(String *str, bool null_to_empty);
public:
  Item_func_replace(THD *thd, Item *org, Item *find, Item *replace):
    Item_str_func(thd, org, find, replace) {}
  String *val_str(String *to) override { return val_str_internal(to, false); };
  bool fix_length_and_dec() override;
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("replace") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_replace>(thd, this); }
};


class Item_func_replace_oracle :public Item_func_replace
{
  String tmp_emtpystr;
public:
  Item_func_replace_oracle(THD *thd, Item *org, Item *find, Item *replace):
    Item_func_replace(thd, org, find, replace) {}
  String *val_str(String *to) override
  { return val_str_internal(to, true); };
  const Schema *schema() const override { return &oracle_schema_ref; }
  void print(String *str, enum_query_type query_type) override
  {
    if (query_type & QT_FOR_FRM)
    {
      // 10.3 downgrade compatibility for FRM
      str->append(STRING_WITH_LEN("replace_oracle"));
    }
    else
      print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_replace_oracle>(thd, this); }
};


class Item_func_regexp_replace :public Item_str_func
{
  Regexp_processor_pcre re;
  bool append_replacement(String *str,
                          const LEX_CSTRING *source,
                          const LEX_CSTRING *replace);
protected:
  String *val_str_internal(String *str, bool null_to_empty);
public:
  Item_func_regexp_replace(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c)
    {}
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  void cleanup() override
  {
    DBUG_ENTER("Item_func_regexp_replace::cleanup");
    Item_str_func::cleanup();
    re.cleanup();
    DBUG_VOID_RETURN;
  }
  String *val_str(String *str) override
  {
    return val_str_internal(str, false);
  }
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("regexp_replace") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override { return 0;}
};


class Item_func_regexp_replace_oracle: public Item_func_regexp_replace
{
public:
  Item_func_regexp_replace_oracle(THD *thd, Item *a, Item *b, Item *c)
   :Item_func_regexp_replace(thd, a, b, c)
  {}
  const Schema *schema() const override { return &oracle_schema_ref; }
  bool fix_length_and_dec() override
  {
    bool rc= Item_func_regexp_replace::fix_length_and_dec();
    set_maybe_null(); // Empty result is converted to NULL
    return rc;
  }
  String *val_str(String *str) override
  {
    return val_str_internal(str, true);
  }
};


class Item_func_regexp_substr :public Item_str_func
{
  Regexp_processor_pcre re;
public:
  Item_func_regexp_substr(THD *thd, Item *a, Item *b):
    Item_str_func(thd, a, b)
    {}
  void cleanup() override
  {
    DBUG_ENTER("Item_func_regexp_substr::cleanup");
    Item_str_func::cleanup();
    re.cleanup();
    DBUG_VOID_RETURN;
  }
  String *val_str(String *str) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("regexp_substr") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override { return 0; }
};


class Item_func_insert :public Item_str_func
{
  String tmp_value;
public:
  Item_func_insert(THD *thd, Item *org, Item *start, Item *length,
                   Item *new_str):
    Item_str_func(thd, org, start, length, new_str) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("insert") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_insert>(thd, this); }
};


class Item_str_conv :public Item_str_func
{
protected:
  uint multiply;
  my_charset_conv_case converter;
  String tmp_value;
public:
  Item_str_conv(THD *thd, Item *item): Item_str_func(thd, item) {}
  String *val_str(String *) override;
};


class Item_func_lcase :public Item_str_conv
{
public:
  Item_func_lcase(THD *thd, Item *item): Item_str_conv(thd, item) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("lcase") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_lcase>(thd, this); }
};

class Item_func_ucase :public Item_str_conv
{
public:
  Item_func_ucase(THD *thd, Item *item): Item_str_conv(thd, item) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ucase") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ucase>(thd, this); }
};


class Item_func_left :public Item_str_func
{
  String tmp_value;
public:
  Item_func_left(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  bool hash_not_null(Hasher *hasher) override;
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("left") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_left>(thd, this); }
};


class Item_func_right :public Item_str_func
{
  String tmp_value;
public:
  Item_func_right(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("right") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_right>(thd, this); }
};


class Item_func_substr :public Item_str_func
{
  String tmp_value;
protected:
  virtual longlong get_position() { return args[1]->val_int(); }
public:
  Item_func_substr(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  Item_func_substr(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c) {}
  Item_func_substr(THD *thd, List<Item> &list)
    :Item_str_func(thd, list) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("substr") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_substr>(thd, this); }
};

class Item_func_substr_oracle :public Item_func_substr
{
protected:
  longlong get_position() override
  { longlong pos= args[1]->val_int(); return pos == 0 ? 1 : pos; }
  String *make_empty_result(String *str) override
  { null_value= 1; return NULL; }
public:
  Item_func_substr_oracle(THD *thd, Item *a, Item *b):
    Item_func_substr(thd, a, b) {}
  Item_func_substr_oracle(THD *thd, Item *a, Item *b, Item *c):
    Item_func_substr(thd, a, b, c) {}
  Item_func_substr_oracle(THD *thd, List<Item> &list)
    :Item_func_substr(thd, list) {}
  bool fix_length_and_dec() override
  {
    bool res= Item_func_substr::fix_length_and_dec();
    set_maybe_null();
    return res;
  }
  const Schema *schema() const override { return &oracle_schema_ref; }
  void print(String *str, enum_query_type query_type) override
  {
    if (query_type & QT_FOR_FRM)
    {
      // 10.3 downgrade compatibility for FRM
      str->append(STRING_WITH_LEN("substr_oracle"));
    }
    else
      print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_substr_oracle>(thd, this); }
};

class Item_func_substr_index :public Item_str_func
{
  String tmp_value;
public:
  Item_func_substr_index(THD *thd, Item *a,Item *b,Item *c):
    Item_str_func(thd, a, b, c) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("substring_index") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_substr_index>(thd, this); }

};


class Item_func_trim :public Item_str_func
{
protected:
  String tmp_value;
  String remove;
  String *trimmed_value(String *res, uint32 offset, uint32 length)
  {
    if (length == 0)
      return make_empty_result(&tmp_value);

    tmp_value.set(*res, offset, length);
    /*
      Make sure to return correct charset and collation:
      TRIM(0x000000 FROM _ucs2 0x0061)
      should set charset to "binary" rather than to "ucs2".
    */
    tmp_value.set_charset(collation.collation);
    return &tmp_value;
  }
  String *non_trimmed_value(String *res)
  {
    return trimmed_value(res, 0, res->length());
  }
public:
  Item_func_trim(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
  Item_func_trim(THD *thd, Item *a): Item_str_func(thd, a) {}
  Sql_mode_dependency value_depends_on_sql_mode() const override;
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  const Schema *schema() const override { return &mariadb_schema; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("trim") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  virtual LEX_CSTRING mode_name() const { return { "both", 4}; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_trim>(thd, this); }
};


class Item_func_trim_oracle :public Item_func_trim
{
protected:
  String *make_empty_result(String *str) override
  { null_value= 1; return NULL; }
public:
  Item_func_trim_oracle(THD *thd, Item *a, Item *b):
    Item_func_trim(thd, a, b) {}
  Item_func_trim_oracle(THD *thd, Item *a): Item_func_trim(thd, a) {}
  const Schema *schema() const override { return &oracle_schema_ref; }
  bool fix_length_and_dec() override
  {
    bool res= Item_func_trim::fix_length_and_dec();
    set_maybe_null();
    return res;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_trim_oracle>(thd, this); }
};


class Item_func_ltrim :public Item_func_trim
{
public:
  Item_func_ltrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {}
  Item_func_ltrim(THD *thd, Item *a): Item_func_trim(thd, a) {}
  Sql_mode_dependency value_depends_on_sql_mode() const override
  {
    return Item_func::value_depends_on_sql_mode();
  }
  String *val_str(String *) override;
  const Schema *schema() const override { return &mariadb_schema; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ltrim") };
    return name;
  }
  LEX_CSTRING mode_name() const override
  { return { STRING_WITH_LEN("leading") }; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ltrim>(thd, this); }
};


class Item_func_ltrim_oracle :public Item_func_ltrim
{
protected:
  String *make_empty_result(String *str) override
  { null_value= 1; return NULL; }
public:
  Item_func_ltrim_oracle(THD *thd, Item *a, Item *b):
    Item_func_ltrim(thd, a, b) {}
  Item_func_ltrim_oracle(THD *thd, Item *a): Item_func_ltrim(thd, a) {}
  const Schema *schema() const override { return &oracle_schema_ref; }
  bool fix_length_and_dec() override
  {
    bool res= Item_func_ltrim::fix_length_and_dec();
    set_maybe_null();
    return res;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ltrim_oracle>(thd, this); }
};


class Item_func_rtrim :public Item_func_trim
{
public:
  Item_func_rtrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {}
  Item_func_rtrim(THD *thd, Item *a): Item_func_trim(thd, a) {}
  String *val_str(String *) override;
  const Schema *schema() const override { return &mariadb_schema; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("rtrim") };
    return name;
  }
  LEX_CSTRING mode_name() const override
  { return { STRING_WITH_LEN("trailing") }; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_rtrim>(thd, this); }
};


class Item_func_rtrim_oracle :public Item_func_rtrim
{
protected:
  String *make_empty_result(String *str) override
  { null_value= 1; return NULL; }
public:
  Item_func_rtrim_oracle(THD *thd, Item *a, Item *b):
    Item_func_rtrim(thd, a, b) {}
  Item_func_rtrim_oracle(THD *thd, Item *a): Item_func_rtrim(thd, a) {}
  const Schema *schema() const override { return &oracle_schema_ref; }
  bool fix_length_and_dec() override
  {
    bool res= Item_func_rtrim::fix_length_and_dec();
    set_maybe_null();
    return res;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_rtrim_oracle>(thd, this); }
};

/*
  Item_func_password -- new (4.1.1) PASSWORD() function implementation.
  Returns strcat('*', octet2hex(sha1(sha1(password)))). '*' stands for new
  password format, sha1(sha1(password) is so-called hash_stage2 value.
  Length of returned string is always 41 byte. To find out how entire
  authentication procedure works, see comments in password.c.
*/

class Item_func_password :public Item_str_ascii_checksum_func
{
public:
  enum PW_Alg {OLD, NEW};
private:
  char tmp_value[SCRAMBLED_PASSWORD_CHAR_LENGTH+1]; 
  enum PW_Alg alg;
  bool deflt;
public:
  Item_func_password(THD *thd, Item *a):
    Item_str_ascii_checksum_func(thd, a), alg(NEW), deflt(1) {}
  Item_func_password(THD *thd, Item *a, PW_Alg al):
    Item_str_ascii_checksum_func(thd, a), alg(al), deflt(0) {}
  String *val_str_ascii(String *str) override;
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override
  {
    fix_length_and_charset((alg == 1 ?
                            SCRAMBLED_PASSWORD_CHAR_LENGTH :
                            SCRAMBLED_PASSWORD_CHAR_LENGTH_323),
                           default_charset());
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING password_normal= {STRING_WITH_LEN("password") };
    static LEX_CSTRING password_old= {STRING_WITH_LEN("old_password") };
    return (deflt || alg == 1) ? password_normal : password_old;
  }
  static char *alloc(THD *thd, const char *password, size_t pass_len,
                     enum PW_Alg al);
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_password>(thd, this); }
};



class Item_func_des_encrypt :public Item_str_binary_checksum_func
{
  String tmp_value,tmp_arg;
public:
  Item_func_des_encrypt(THD *thd, Item *a)
   :Item_str_binary_checksum_func(thd, a) {}
  Item_func_des_encrypt(THD *thd, Item *a, Item *b)
   :Item_str_binary_checksum_func(thd, a, b) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    /* 9 = MAX ((8- (arg_len % 8)) + 1) */
    max_length = args[0]->max_length + 9;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("des_encrypt") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_des_encrypt>(thd, this); }
};

class Item_func_des_decrypt :public Item_str_binary_checksum_func
{
  String tmp_value;
public:
  Item_func_des_decrypt(THD *thd, Item *a)
   :Item_str_binary_checksum_func(thd, a) {}
  Item_func_des_decrypt(THD *thd, Item *a, Item *b)
   :Item_str_binary_checksum_func(thd, a, b) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    /* 9 = MAX ((8- (arg_len % 8)) + 1) */
    max_length= args[0]->max_length;
    if (max_length >= 9U)
      max_length-= 9U;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("des_decrypt") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_des_decrypt>(thd, this); }
};


/**
  QQ: Item_func_encrypt should derive from Item_str_ascii_checksum_func.
  However, it should be fixed to handle UCS2, UTF16, UTF32 properly first,
  as the underlying crypt() call expects a null-terminated input string.
*/
class Item_func_encrypt :public Item_str_binary_checksum_func
{
  String tmp_value;

  /* Encapsulate common constructor actions */
  void constructor_helper()
  {
    collation.set(&my_charset_bin);
  }
public:
  Item_func_encrypt(THD *thd, Item *a): Item_str_binary_checksum_func(thd, a)
  {
    constructor_helper();
  }
  Item_func_encrypt(THD *thd, Item *a, Item *b)
   :Item_str_binary_checksum_func(thd, a, b)
  {
    constructor_helper();
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    max_length = 13;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("encrypt") };
    return name;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_encrypt>(thd, this); }
};

#include "sql_crypt.h"


class Item_func_encode :public Item_str_binary_checksum_func
{
private:
  /** Whether the PRNG has already been seeded. */
  bool seeded;
protected:
  SQL_CRYPT sql_crypt;
public:
  Item_func_encode(THD *thd, Item *a, Item *seed_arg):
    Item_str_binary_checksum_func(thd, a, seed_arg) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("encode") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_encode>(thd, this); }
protected:
  virtual void crypto_transform(String *);
private:
  /** Provide a seed for the PRNG sequence. */
  bool seed();
};


class Item_func_decode :public Item_func_encode
{
public:
  Item_func_decode(THD *thd, Item *a, Item *seed_arg): Item_func_encode(thd, a, seed_arg) {}
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("decode") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_decode>(thd, this); }
protected:
  void crypto_transform(String *) override;
};


class Item_func_sysconst :public Item_str_func
{
public:
  Item_func_sysconst(THD *thd): Item_str_func(thd)
  { collation.set(system_charset_info,DERIVATION_SYSCONST); }
  Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override;
  /*
    Used to create correct Item name in new converted item in
    safe_charset_converter, return string representation of this function
    call
  */
  virtual const char *fully_qualified_func_name() const = 0;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(fully_qualified_func_name(), arg,
                                     VCOL_SESSION_FUNC);
  }
  bool const_item() const override;
};


class Item_func_database :public Item_func_sysconst
{
public:
  Item_func_database(THD *thd): Item_func_sysconst(thd) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    max_length= NAME_CHAR_LEN * system_charset_info->mbmaxlen;
    set_maybe_null();
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("database") };
    return name;
  }
  const char *fully_qualified_func_name() const override
  { return "database()"; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_database>(thd, this); }
};


class Item_func_sqlerrm :public Item_func_sysconst
{
public:
  Item_func_sqlerrm(THD *thd): Item_func_sysconst(thd) {}
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("SQLERRM") };
    return name;
  }
  const char *fully_qualified_func_name() const override
  { return "SQLERRM"; }
  void print(String *str, enum_query_type query_type) override
  {
    str->append(func_name_cstring());
  }
  bool fix_length_and_dec() override
  {
    max_length= 512 * system_charset_info->mbmaxlen;
    null_value= false;
    base_flags&= ~item_base_t::MAYBE_NULL;
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sqlerrm>(thd, this); }
};


class Item_func_user :public Item_func_sysconst
{
protected:
  bool init (const char *user, const char *host);

public:
  Item_func_user(THD *thd): Item_func_sysconst(thd)
  {
    str_value.set("", 0, system_charset_info);
  }
  String *val_str(String *) override
  {
    DBUG_ASSERT(fixed());
    return (null_value ? 0 : &str_value);
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override
  {
    max_length= (uint32) (username_char_length +
                 HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("user") };
    return name;
  }
  const char *fully_qualified_func_name() const override
  { return "user()"; }
  int save_in_field(Field *field, bool no_conversions) override
  {
    return save_str_value_in_field(field, &str_value);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_user>(thd, this); }
};


class Item_func_current_user :public Item_func_user
{
  Name_resolution_context *context;

public:
  Item_func_current_user(THD *thd, Name_resolution_context *context_arg):
    Item_func_user(thd), context(context_arg) {}
  bool fix_fields(THD *thd, Item **ref) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("current_user") };
    return name;
  }
  const char *fully_qualified_func_name() const override
  { return "current_user()"; }
  bool check_vcol_func_processor(void *arg) override
  {
    context= 0;
    return mark_unsupported_function(fully_qualified_func_name(), arg,
                                     VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_current_user>(thd, this); }
};


class Item_func_current_role :public Item_func_sysconst
{
  Name_resolution_context *context;

public:
  Item_func_current_role(THD *thd, Name_resolution_context *context_arg):
    Item_func_sysconst(thd), context(context_arg) {}
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override
  {
    max_length= (uint32) username_char_length * SYSTEM_CHARSET_MBMAXLEN;
    return FALSE;
  }
  int save_in_field(Field *field, bool no_conversions) override
  { return save_str_value_in_field(field, &str_value); }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("current_role") };
    return name;
  }
  const char *fully_qualified_func_name() const override
  { return "current_role()"; }
  String *val_str(String *) override
  {
    DBUG_ASSERT(fixed());
    return null_value ? NULL : &str_value;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    context= 0;
    return mark_unsupported_function(fully_qualified_func_name(), arg,
                                     VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_current_role>(thd, this); }
};


class Item_func_soundex :public Item_str_func
{
  String tmp_value;
public:
  Item_func_soundex(THD *thd, Item *a): Item_str_func(thd, a) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("soundex") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_soundex>(thd, this); }
};


class Item_func_elt :public Item_str_func
{
public:
  Item_func_elt(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *str) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("elt") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_elt>(thd, this); }
};


class Item_func_make_set :public Item_str_func
{
  String tmp_str;

public:
  Item_func_make_set(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
  String *val_str(String *str) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("make_set") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_make_set>(thd, this); }
};


class Item_func_format :public Item_str_ascii_func
{
  const MY_LOCALE *locale;
public:
  Item_func_format(THD *thd, Item *org, Item *dec):
    Item_str_ascii_func(thd, org, dec) {}
  Item_func_format(THD *thd, Item *org, Item *dec, Item *lang):
    Item_str_ascii_func(thd, org, dec, lang) {}

  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("format") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_format>(thd, this); }
};


class Item_func_char :public Item_str_func
{
public:
  Item_func_char(THD *thd, List<Item> &list): Item_str_func(thd, list)
  { collation.set(&my_charset_bin); }
  Item_func_char(THD *thd, List<Item> &list, CHARSET_INFO *cs):
    Item_str_func(thd, list)
  { collation.set(cs); }
  Item_func_char(THD *thd, Item *arg1, CHARSET_INFO *cs):
    Item_str_func(thd, arg1)
  { collation.set(cs); }
  String *val_str(String *) override;
  void append_char(String * str, int32 num);
  bool fix_length_and_dec() override
  {
    max_length= arg_count * 4;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("char") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_char>(thd, this); }
};

class Item_func_chr :public Item_func_char
{
public:
  Item_func_chr(THD *thd, Item *arg1, CHARSET_INFO *cs):
    Item_func_char(thd, arg1, cs) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    max_length= 4;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("chr") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_chr>(thd, this); }
};

class Item_func_repeat :public Item_str_func
{
  String tmp_value;
public:
  Item_func_repeat(THD *thd, Item *arg1, Item *arg2):
    Item_str_func(thd, arg1, arg2) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("repeat") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_repeat>(thd, this); }
};


class Item_func_space :public Item_str_func
{
public:
  Item_func_space(THD *thd, Item *arg1): Item_str_func(thd, arg1) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("space") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_space>(thd, this); }
};


class Item_func_binlog_gtid_pos :public Item_str_func
{
public:
  Item_func_binlog_gtid_pos(THD *thd, Item *arg1, Item *arg2):
    Item_str_func(thd, arg1, arg2) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("binlog_gtid_pos") };
    return name;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_binlog_gtid_pos>(thd, this); }
};


class Item_func_pad: public Item_str_func
{
protected:
  String tmp_value, pad_str;
public:
  Item_func_pad(THD *thd, Item *arg1, Item *arg2, Item *arg3):
    Item_str_func(thd, arg1, arg2, arg3) {}
  Item_func_pad(THD *thd, Item *arg1, Item *arg2):
    Item_str_func(thd, arg1, arg2) {}
  Item_func_pad(THD *thd, List<Item> &list):
    Item_str_func(thd,list) {}
  bool fix_length_and_dec() override;
};


class Item_func_rpad :public Item_func_pad
{
public:
  Item_func_rpad(THD *thd, Item *arg1, Item *arg2, Item *arg3):
    Item_func_pad(thd, arg1, arg2, arg3) {}
  Item_func_rpad(THD *thd, Item *arg1, Item *arg2):
    Item_func_pad(thd, arg1, arg2) {}
  Item_func_rpad(THD *thd, List<Item> &list):
    Item_func_pad(thd,list) {}
  String *val_str(String *) override;
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("rpad") };
    return name;
  }
  Sql_mode_dependency value_depends_on_sql_mode() const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_rpad>(thd, this); }
};


class Item_func_rpad_oracle :public Item_func_rpad
{
  String *make_empty_result(String *str) override
  { null_value= 1; return NULL; }
public:
  Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3):
    Item_func_rpad(thd, arg1, arg2, arg3) {}
  Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2):
    Item_func_rpad(thd, arg1, arg2) {}
  Item_func_rpad_oracle(THD *thd, List<Item> &list):
    Item_func_rpad(thd,list) {}
  bool fix_length_and_dec() override
  {
    bool res= Item_func_rpad::fix_length_and_dec();
    set_maybe_null();
    return res;
  }
  const Schema *schema() const override { return &oracle_schema_ref; }
  void print(String *str, enum_query_type query_type) override
  {
    if (query_type & QT_FOR_FRM)
    {
      // 10.3 downgrade compatibility for FRM
      str->append(STRING_WITH_LEN("rpad_oracle"));
    }
    else
      print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_rpad_oracle>(thd, this); }
};


class Item_func_lpad :public Item_func_pad
{
public:
  Item_func_lpad(THD *thd, Item *arg1, Item *arg2, Item *arg3):
    Item_func_pad(thd, arg1, arg2, arg3) {}
  Item_func_lpad(THD *thd, Item *arg1, Item *arg2):
    Item_func_pad(thd, arg1, arg2) {}
  Item_func_lpad(THD *thd, List<Item> &list):
    Item_func_pad(thd,list) {}
  String *val_str(String *) override;
  const Schema *schema() const override { return &mariadb_schema; }
  void print(String *str, enum_query_type query_type) override
  {
    print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("lpad") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_lpad>(thd, this); }
};


class Item_func_lpad_oracle :public Item_func_lpad
{
  String *make_empty_result(String *str) override
  { null_value= 1; return NULL; }
public:
  Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3):
    Item_func_lpad(thd, arg1, arg2, arg3) {}
  Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2):
    Item_func_lpad(thd, arg1, arg2) {}
  Item_func_lpad_oracle(THD *thd, List<Item> &list):
    Item_func_lpad(thd,list) {}
  bool fix_length_and_dec() override
  {
    bool res= Item_func_lpad::fix_length_and_dec();
    set_maybe_null();
    return res;
  }
  const Schema *schema() const override { return &oracle_schema_ref; }
  void print(String *str, enum_query_type query_type) override
  {
    if (query_type & QT_FOR_FRM)
    {
      // 10.3 downgrade compatibility for FRM
      str->append(STRING_WITH_LEN("lpad_oracle"));
    }
    else
      print_sql_mode_qualified_name(str, query_type);
    print_args_parenthesized(str, query_type);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_lpad_oracle>(thd, this); }
};


class Item_func_conv :public Item_str_func
{
public:
  Item_func_conv(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("conv") };
    return name;
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    collation.set(default_charset());
    fix_char_length(65);
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_conv>(thd, this); }
};


class Item_func_hex :public Item_str_ascii_checksum_func
{
protected:
  String tmp_value;
  /*
    Calling arg[0]->type_handler() can be expensive on every row.
    It's a virtual method, and in case if args[0] is a complex Item,
    its type_handler() can call more virtual methods.
    So let's cache it during fix_length_and_dec().
  */
  const Type_handler *m_arg0_type_handler;
public:
  Item_func_hex(THD *thd, Item *a):
    Item_str_ascii_checksum_func(thd, a), m_arg0_type_handler(NULL) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("hex") };
    return name;
  }
  String *val_str_ascii_from_val_int(String *str);
  String *val_str_ascii_from_val_real(String *str);
  String *val_str_ascii_from_val_str(String *str);
  String *val_str_ascii(String *str) override
  {
    DBUG_ASSERT(fixed());
    return m_arg0_type_handler->Item_func_hex_val_str_ascii(this, str);
  }
  bool fix_length_and_dec() override
  {
    m_arg0_type_handler= args[0]->type_handler();
    collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
    decimals=0;
    /*
      Reserve space for 16 characters for signed numeric data types:
        hex(-1) -> 'FFFFFFFFFFFFFFFF'.
      For unsigned numeric types, HEX() can create too large columns.
      This should be eventually fixed to create minimum possible columns.
    */
    const Type_handler_numeric *tn=
      dynamic_cast<const Type_handler_numeric*>(m_arg0_type_handler);
    size_t char_length= (tn && !(tn->flags() & UNSIGNED_FLAG)) ?
                        (size_t) 16 : (size_t) args[0]->max_length * 2;
    fix_char_length(char_length);
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_hex>(thd, this); }
};

class Item_func_unhex :public Item_str_func
{
  String tmp_value;
public:
  Item_func_unhex(THD *thd, Item *a): Item_str_func(thd, a)
  {
    /* there can be bad hex strings */
    set_maybe_null();
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("unhex") };
    return name;
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    collation.set(&my_charset_bin);
    decimals=0;
    max_length=(1+args[0]->max_length)/2;
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_unhex>(thd, this); }
};


#ifndef DBUG_OFF
class Item_func_like_range :public Item_str_func
{
protected:
  String min_str;
  String max_str;
  const bool is_min;
public:
  Item_func_like_range(THD *thd, Item *a, Item *b, bool is_min_arg):
    Item_str_func(thd, a, b), is_min(is_min_arg)
  {
    set_maybe_null();
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    collation.set(args[0]->collation);
    decimals=0;
    max_length= MAX_BLOB_WIDTH;
    return FALSE;
  }
};


class Item_func_like_range_min :public Item_func_like_range
{
public:
  Item_func_like_range_min(THD *thd, Item *a, Item *b):
    Item_func_like_range(thd, a, b, true) { }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("like_range_min") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_like_range_min>(thd, this); }
};


class Item_func_like_range_max :public Item_func_like_range
{
public:
  Item_func_like_range_max(THD *thd, Item *a, Item *b):
    Item_func_like_range(thd, a, b, false) { }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("like_range_max") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_like_range_max>(thd, this); }
};
#endif


class Item_func_binary :public Item_str_func
{
public:
  Item_func_binary(THD *thd, Item *a): Item_str_func(thd, a) {}
  String *val_str(String *a) override
  {
    DBUG_ASSERT(fixed());
    String *tmp=args[0]->val_str(a);
    null_value=args[0]->null_value;
    if (tmp)
      tmp->set_charset(&my_charset_bin);
    return tmp;
  }
  bool fix_length_and_dec() override
  {
    collation.set(&my_charset_bin);
    max_length=args[0]->max_length;
    return FALSE;
  }
  void print(String *str, enum_query_type query_type) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_binary") };
    return name;
  }
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_binary>(thd, this); }
};


class Item_load_file :public Item_str_func
{
  String tmp_value;
public:
  Item_load_file(THD *thd, Item *a): Item_str_func(thd, a) {}
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("load_file") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
    set_maybe_null();
    max_length=MAX_BLOB_WIDTH;
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_load_file>(thd, this); }
};


class Item_func_export_set: public Item_str_func
{
 public:
  Item_func_export_set(THD *thd, Item *a, Item *b, Item* c):
    Item_str_func(thd, a, b, c) {}
  Item_func_export_set(THD *thd, Item *a, Item *b, Item* c, Item* d):
    Item_str_func(thd, a, b, c, d) {}
  Item_func_export_set(THD *thd, Item *a, Item *b, Item* c, Item* d, Item* e):
    Item_str_func(thd, a, b, c, d, e) {}
  String  *val_str(String *str) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("export_set") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_export_set>(thd, this); }
};


class Item_func_quote :public Item_str_func
{
  String tmp_value;
public:
  Item_func_quote(THD *thd, Item *a): Item_str_func(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("quote") };
    return name;
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    collation.set(args[0]->collation);
    ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 +
                                  2 * collation.collation->mbmaxlen;
    // NULL argument is returned as a string "NULL" without quotes
    if (args[0]->maybe_null())
      set_if_bigger(max_result_length, 4 * collation.collation->mbmaxlen);
    max_length= (uint32) MY_MIN(max_result_length, MAX_BLOB_WIDTH);
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_quote>(thd, this); }
};

class Item_func_conv_charset :public Item_str_func
{
  bool use_cached_value;
  String tmp_value;
public:
  bool safe;
  Item_func_conv_charset(THD *thd, Item *a, CHARSET_INFO *cs):
    Item_str_func(thd, a)
  {
    collation.set(cs, DERIVATION_IMPLICIT);
    use_cached_value= 0; safe= 0;
  }
  Item_func_conv_charset(THD *thd, Item *a, CHARSET_INFO *cs, bool cache_if_const):
    Item_str_func(thd, a)
  {
    collation.set(cs, DERIVATION_IMPLICIT);
    if (cache_if_const && args[0]->can_eval_in_optimize())
    {
      uint errors= 0;
      String tmp, *str= args[0]->val_str(&tmp);
      if (!str || str_value.copy(str->ptr(), str->length(),
                                 str->charset(), cs, &errors))
        null_value= 1;
      use_cached_value= 1;
      str_value.mark_as_const();
      safe= (errors == 0);
    }
    else
    {
      use_cached_value= 0;
      /*
        Conversion from and to "binary" is safe.
        Conversion to Unicode is safe.
        Conversion from an expression with the ASCII repertoire
        to any character set that can store characters U+0000..U+007F
        is safe:
        - All supported multibyte character sets can store U+0000..U+007F
        - All supported 7bit character sets can store U+0000..U+007F
          except those marked with MY_CS_NONASCII (e.g. swe7).
        Other kind of conversions are potentially lossy.
      */
      safe= (args[0]->collation.collation == &my_charset_bin ||
             cs == &my_charset_bin ||
             (cs->state & MY_CS_UNICODE) ||
             (args[0]->collation.repertoire == MY_REPERTOIRE_ASCII &&
              (cs->mbmaxlen > 1 || !(cs->state & MY_CS_NONASCII))));
    }
  }
  String *val_str(String *) override;
  longlong val_int() override
  {
    if (args[0]->result_type() == STRING_RESULT)
      return Item_str_func::val_int();
    longlong res= args[0]->val_int();
    if ((null_value= args[0]->null_value))
      return 0;
    return res;
  }
  double val_real() override
  {
    if (args[0]->result_type() == STRING_RESULT)
      return Item_str_func::val_real();
    double res= args[0]->val_real();
    if ((null_value= args[0]->null_value))
      return 0;
    return res;
  }
  my_decimal *val_decimal(my_decimal *d) override
  {
    if (args[0]->result_type() == STRING_RESULT)
      return Item_str_func::val_decimal(d);
    my_decimal *res= args[0]->val_decimal(d);
    if ((null_value= args[0]->null_value))
      return NULL;
    return res;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    if (args[0]->result_type() == STRING_RESULT)
      return Item_str_func::get_date(thd, ltime, fuzzydate);
    bool res= args[0]->get_date(thd, ltime, fuzzydate);
    if ((null_value= args[0]->null_value))
      return 1;
    return res;
  }
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("convert") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_conv_charset>(thd, this); }
  int save_in_field(Field*, bool) override;
};

class Item_func_set_collation :public Item_str_func
{
  CHARSET_INFO *m_set_collation;
public:
  Item_func_set_collation(THD *thd, Item *a, CHARSET_INFO *set_collation):
    Item_str_func(thd, a), m_set_collation(set_collation) {}
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  bool eq(const Item *item, bool binary_cmp) const override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("collate") };
    return name;
  }
  enum precedence precedence() const override { return COLLATE_PRECEDENCE; }
  enum Functype functype() const override { return COLLATE_FUNC; }
  void print(String *str, enum_query_type query_type) override;
  Item_field *field_for_view_update() override
  {
    /* this function is transparent for view updating */
    return args[0]->field_for_view_update();
  }
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_set_collation>(thd, this); }
};


class Item_func_expr_str_metadata :public Item_str_func
{
public:
  Item_func_expr_str_metadata(THD *thd, Item *a): Item_str_func(thd, a) { }
  bool fix_length_and_dec() override
  {
     collation.set(system_charset_info);
     max_length= 64 * collation.collation->mbmaxlen; // should be enough
     base_flags&= ~item_base_t::MAYBE_NULL;
     return FALSE;
  };
  table_map not_null_tables() const override { return 0; }
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  { return this; }
  bool const_item() const override { return true; }
};


class Item_func_charset :public Item_func_expr_str_metadata
{
  LEX_CSTRING m_cached_charset_info;

public:
  Item_func_charset(THD *thd, Item *a)
    :Item_func_expr_str_metadata(thd, a) { }
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("charset") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_charset>(thd, this); }
  table_map used_tables() const override { return 0; }
  bool fix_length_and_dec() override
  {
    if (Item_func_expr_str_metadata::fix_length_and_dec())
      return true;
    /*
      Since this is a const item which doesn't use tables (see used_tables()),
      we don't want to access the function arguments during execution.
      That's why we store the charset here during the preparation phase
      and only return it later at the execution phase
    */
    DBUG_ASSERT(args[0]->fixed());
    m_cached_charset_info.str= args[0]->charset_for_protocol()->cs_name.str;
    m_cached_charset_info.length=
        args[0]->charset_for_protocol()->cs_name.length;
    return false;
  }
};


class Item_func_collation :public Item_func_expr_str_metadata
{
public:
  Item_func_collation(THD *thd, Item *a)
    :Item_func_expr_str_metadata(thd, a) {}
  String *val_str(String *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("collation") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_collation>(thd, this); }
};


class Item_func_weight_string :public Item_str_func
{
  String tmp_value;
  uint weigth_flags;
  uint nweights;
  uint result_length;
public:
  Item_func_weight_string(THD *thd, Item *a, uint result_length_arg,
                          uint nweights_arg, uint flags_arg):
    Item_str_func(thd, a)
  {
    nweights= nweights_arg;
    weigth_flags= flags_arg;
    result_length= result_length_arg;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("weight_string") };
    return name;
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override;
  bool eq(const Item *item, bool binary_cmp) const override
  {
    if (!Item_str_func::eq(item, binary_cmp))
      return false;
    Item_func_weight_string *that= (Item_func_weight_string *)item;
    return this->weigth_flags == that->weigth_flags &&
           this->nweights == that->nweights &&
           this->result_length == that->result_length;
  }
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  { return this; }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_weight_string>(thd, this); }
};

class Item_func_crc32 :public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_str(func_name_cstring()); }
  String value;
public:
  Item_func_crc32(THD *thd, Item *a): Item_long_func(thd, a)
  { unsigned_flag= 1; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("crc32") };
    return name;
  }
  bool fix_length_and_dec() override { max_length=10; return FALSE; }
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_crc32>(thd, this); }
};

class Item_func_uncompressed_length : public Item_long_func_length
{
  String value;
public:
  Item_func_uncompressed_length(THD *thd, Item *a)
   :Item_long_func_length(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("uncompressed_length") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    max_length=10;
    set_maybe_null();
    return FALSE; }
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_uncompressed_length>(thd, this); }
};

#ifdef HAVE_COMPRESS
#define ZLIB_DEPENDED_FUNCTION ;
#else
#define ZLIB_DEPENDED_FUNCTION { null_value=1; return 0; }
#endif

class Item_func_compress: public Item_str_binary_checksum_func
{
  String tmp_value;
public:
  Item_func_compress(THD *thd, Item *a)
   :Item_str_binary_checksum_func(thd, a) {}
  bool fix_length_and_dec() override
  {
    max_length= (args[0]->max_length * 120) / 100 + 12;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("compress") };
    return name;
  }
  String *val_str(String *) override ZLIB_DEPENDED_FUNCTION
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_compress>(thd, this); }
};

class Item_func_uncompress: public Item_str_binary_checksum_func
{
  String tmp_value;
public:
  Item_func_uncompress(THD *thd, Item *a)
   :Item_str_binary_checksum_func(thd, a) {}
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    max_length= MAX_BLOB_WIDTH;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("uncompress") };
    return name;
  }
  String *val_str(String *) override ZLIB_DEPENDED_FUNCTION
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_uncompress>(thd, this); }
};


class Item_func_uuid: public Item_str_func
{
  /* Set if uuid should be returned without separators (Oracle sys_guid) */
  bool without_separators;
public:
Item_func_uuid(THD *thd, bool without_separators_arg): Item_str_func(thd),
    without_separators(without_separators_arg)
  {}
  bool fix_length_and_dec() override
  {
    collation.set(DTCollation_numeric());
    fix_char_length(without_separators ? MY_UUID_ORACLE_STRING_LENGTH :
                    MY_UUID_STRING_LENGTH);
    return FALSE;
  }
  bool const_item() const override { return false; }
  table_map used_tables() const override { return RAND_TABLE_BIT; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING mariadb_name=  {STRING_WITH_LEN("uuid") };
    static LEX_CSTRING oracle_name=   {STRING_WITH_LEN("sys_guid") };
    return without_separators ? oracle_name : mariadb_name;
  }
  String *val_str(String *) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_NON_DETERMINISTIC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_uuid>(thd, this); }
};


class Item_func_dyncol_create: public Item_str_func
{
protected:
  DYNCALL_CREATE_DEF *defs;
  DYNAMIC_COLUMN_VALUE *vals;
  uint *keys_num;
  LEX_STRING *keys_str;
  bool names, force_names;
  bool prepare_arguments(THD *thd, bool force_names);
  void print_arguments(String *str, enum_query_type query_type);
public:
  Item_func_dyncol_create(THD *thd, List<Item> &args, DYNCALL_CREATE_DEF *dfs);
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_create") };
    return name;
  }
  String *val_str(String *) override;
  void print(String *str, enum_query_type query_type) override;
  enum Functype functype() const override { return DYNCOL_FUNC; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dyncol_create>(thd, this); }
};


class Item_func_dyncol_add: public Item_func_dyncol_create
{
public:
  Item_func_dyncol_add(THD *thd, List<Item> &args_arg, DYNCALL_CREATE_DEF *dfs):
    Item_func_dyncol_create(thd, args_arg, dfs)
  {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_add") };
    return name;
  }
  String *val_str(String *) override;
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dyncol_add>(thd, this); }
};

class Item_func_dyncol_json: public Item_str_func
{
public:
  Item_func_dyncol_json(THD *thd, Item *str): Item_str_func(thd, str)
    {collation.set(DYNCOL_UTF);}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_json") };
    return name;
  }
  String *val_str(String *) override;
  bool fix_length_and_dec() override
  {
    max_length= MAX_BLOB_WIDTH;
    set_maybe_null();
    decimals= 0;
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dyncol_json>(thd, this); }
};

/*
  The following functions is always called from an Item_cast function
*/

class Item_dyncol_get: public Item_str_func
{
public:
  Item_dyncol_get(THD *thd, Item *str, Item *num): Item_str_func(thd, str, num)
  {}
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    max_length= MAX_BLOB_WIDTH;
    return FALSE;
  }
  /* Mark that collation can change between calls */
  bool dynamic_result() override { return 1; }

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_get") };
    return name;
  }
  String *val_str(String *) override;
  longlong val_int() override;
  longlong val_int_signed_typecast() override
  {
    unsigned_flag= false;   // Mark that we want to have a signed value
    longlong value= val_int(); // val_int() can change unsigned_flag
    if (!null_value && unsigned_flag && value < 0)
      push_note_converted_to_negative_complement(current_thd);
    return value;
  }
  longlong val_int_unsigned_typecast() override
  {
    unsigned_flag= true; // Mark that we want to have an unsigned value
    longlong value= val_int(); // val_int() can change unsigned_flag
    if (!null_value && unsigned_flag == 0 && value < 0)
      push_note_converted_to_positive_complement(current_thd);
    return value;
  }
  double val_real() override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_dyn_value(THD *thd, DYNAMIC_COLUMN_VALUE *val, String *tmp);
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_dyncol_get>(thd, this); }
};


class Item_func_dyncol_list: public Item_str_func
{
public:
  Item_func_dyncol_list(THD *thd, Item *str): Item_str_func(thd, str)
    {collation.set(DYNCOL_UTF);}
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    max_length= MAX_BLOB_WIDTH;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("column_list") };
    return name;
  }
  String *val_str(String *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dyncol_list>(thd, this); }
};

/*
  this is used by JOIN_TAB::keep_current_rowid
  and stores handler::position().
  It has nothing to do with _rowid pseudo-column, that the parser supports.
*/
class Item_temptable_rowid :public Item_str_func
{
public:
  TABLE *table;
  Item_temptable_rowid(TABLE *table_arg);
  const Type_handler *type_handler() const override
  { return &type_handler_string; }
  Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table)
  { return create_table_field_from_handler(root, table); }
  String *val_str(String *str) override;
  enum Functype functype() const override { return  TEMPTABLE_ROWID; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<rowid>") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_temptable_rowid>(thd, this); }
};
#ifdef WITH_WSREP

#include "wsrep_api.h"

class Item_func_wsrep_last_written_gtid: public Item_str_ascii_func
{
  String gtid_str;
public:
  Item_func_wsrep_last_written_gtid(THD *thd): Item_str_ascii_func(thd) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_last_written_gtid") };
    return name;
  }
  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override
  {
    max_length= WSREP_GTID_STR_LEN;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_wsrep_last_written_gtid>(thd, this); }
};

class Item_func_wsrep_last_seen_gtid: public Item_str_ascii_func
{
  String gtid_str;
public:
  Item_func_wsrep_last_seen_gtid(THD *thd): Item_str_ascii_func(thd) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_last_seen_gtid") };
    return name;
  }
  String *val_str_ascii(String *) override;
  bool fix_length_and_dec() override
  {
    max_length= WSREP_GTID_STR_LEN;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_wsrep_last_seen_gtid>(thd, this); }
};

class Item_func_wsrep_sync_wait_upto: public Item_int_func
{
  String value;
public:
 Item_func_wsrep_sync_wait_upto(THD *thd, Item *a): Item_int_func(thd, a) {}
 Item_func_wsrep_sync_wait_upto(THD *thd, Item *a, Item* b): Item_int_func(thd, a, b) {}
  const Type_handler *type_handler() const override
  { return &type_handler_string; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_sync_wait_upto_gtid") };
    return name;
  }
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_wsrep_sync_wait_upto>(thd, this); }
};
#endif /* WITH_WSREP */

#endif /* ITEM_STRFUNC_INCLUDED */
server/private/sql_view.h000064400000004646150400263770011544 0ustar00#ifndef SQL_VIEW_INCLUDED
#define SQL_VIEW_INCLUDED

/* -*- C++ -*- */
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates.
   Copyright (c) 2015, MariaDB

   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 "sql_class.h"     /* Required by sql_lex.h */
#include "sql_lex.h"       /* enum_view_create_mode, enum_drop_mode */

/* Forward declarations */

class File_parser;


/* Function declarations */

bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
                          enum_view_create_mode mode);

bool mysql_create_view(THD *thd, TABLE_LIST *view,
                       enum_view_create_mode mode);

bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
                     bool open_view_no_parse);


bool mysql_drop_view(THD *thd, TABLE_LIST *view, enum_drop_mode drop_mode);

bool check_key_in_view(THD *thd, TABLE_LIST * view);

bool insert_view_fields(THD *thd, List<Item> *list, TABLE_LIST *view);

int view_checksum(THD *thd, TABLE_LIST *view);
int view_check(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt);
int view_repair(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt);

extern TYPELIB updatable_views_with_limit_typelib;

bool check_duplicate_names(THD *thd, List<Item>& item_list,
                           bool gen_unique_view_names);
bool mysql_rename_view(THD *thd, const LEX_CSTRING *new_db,
                       const LEX_CSTRING *new_name,
                       const LEX_CSTRING *old_db,
                       const LEX_CSTRING *old_name);

void make_valid_column_names(THD *thd, List<Item> &item_list);

#define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL)

extern const LEX_CSTRING view_type;

void make_valid_column_names(List<Item> &item_list);

bool mariadb_view_version_get(TABLE_SHARE *share);

#endif /* SQL_VIEW_INCLUDED */
server/private/password.h000064400000002222150400263770011541 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef PASSWORD_INCLUDED
#define PASSWORD_INCLUDED

C_MODE_START

void my_make_scrambled_password_323(char *to, const char *password,
                                    size_t pass_len);
void my_make_scrambled_password(char *to, const char *password,
                                size_t pass_len);

void hash_password(ulong *result, const char *password, uint password_len);

C_MODE_END

#endif /* PASSWORD_INCLUDED */
server/private/violite.h000064400000023546150400264000011351 0ustar00/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
   Copyright (c) 2012, 2020, 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*
 * Vio Lite.
 * Purpose: include file for Vio that will work with C and C++
 */

#ifndef vio_violite_h_
#define	vio_violite_h_

#include "my_net.h"   /* needed because of struct in_addr */
#include <mysql/psi/mysql_socket.h>

/* Simple vio interface in C;  The functions are implemented in violite.c */

#ifdef	__cplusplus
extern "C" {
#endif /* __cplusplus */

#ifdef __cplusplus
typedef struct st_vio Vio;
#endif /* __cplusplus */

enum enum_vio_type
{
  VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE,
  VIO_TYPE_SSL
  /* see also vio_type_names[] */
};

enum enum_vio_state
{
  VIO_STATE_NOT_INITIALIZED, VIO_STATE_ACTIVE, VIO_STATE_SHUTDOWN,
  VIO_STATE_CLOSED
};

#define FIRST_VIO_TYPE VIO_CLOSED
#define LAST_VIO_TYPE VIO_TYPE_SSL

/**
  VIO I/O events.
*/
enum enum_vio_io_event
{
  VIO_IO_EVENT_READ,
  VIO_IO_EVENT_WRITE,
  VIO_IO_EVENT_CONNECT
};

struct vio_keepalive_opts
{
  int interval;
  int idle;
  int probes;
};


#define VIO_TLSv1_0   1
#define VIO_TLSv1_1   2
#define VIO_TLSv1_2   4
#define VIO_TLSv1_3   8

#define VIO_LOCALHOST 1U                        /* a localhost connection */
#define VIO_BUFFERED_READ 2U                    /* use buffered read */
#define VIO_READ_BUFFER_SIZE 16384U             /* size of read buffer */
#define VIO_DESCRIPTION_SIZE 30                 /* size of description */

Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
Vio*  mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
#ifdef _WIN32
Vio* vio_new_win32pipe(HANDLE hPipe);
#else
#define HANDLE void *
#endif /* _WIN32 */

void	vio_delete(Vio* vio);
int	vio_close(Vio* vio);
my_bool vio_reset(Vio* vio, enum enum_vio_type type,
                  my_socket sd, void *ssl, uint flags);
size_t	vio_read(Vio *vio, uchar *	buf, size_t size);
size_t  vio_read_buff(Vio *vio, uchar * buf, size_t size);
size_t	vio_write(Vio *vio, const uchar * buf, size_t size);
int	vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);
my_bool	vio_is_blocking(Vio *vio);
/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */
int vio_nodelay(Vio *vio, my_bool on);
int	vio_fastsend(Vio *vio);
/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */
int	vio_keepalive(Vio *vio, my_bool	onoff);
int	vio_set_keepalive_options(Vio * vio, const struct vio_keepalive_opts *opts);
/* Whenever we should retry the last read/write operation. */
my_bool	vio_should_retry(Vio *vio);
/* Check that operation was timed out */
my_bool vio_was_timeout(Vio *vio);
/* Short text description of the socket for those, who are curious.. */
const char* vio_description(Vio *vio);
/* Return the type of the connection */
enum enum_vio_type vio_type(Vio* vio);
/* Return last error number */
int	vio_errno(Vio*vio);
/* Get socket number */
my_socket vio_fd(Vio*vio);
/* Remote peer's address and name in text form */
my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
/* Wait for an I/O event notification. */
int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout);
my_bool vio_is_connected(Vio *vio);
ssize_t vio_pending(Vio *vio);
/* Set timeout for a network operation. */
extern int vio_timeout(Vio *vio, uint which, int timeout_sec);
extern void vio_set_wait_callback(void (*before_wait)(void),
                                void (*after_wait)(void));
/* Connect to a peer. */
my_bool vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len,
                           int timeout);

void vio_get_normalized_ip(const struct sockaddr *src, size_t src_length, struct sockaddr *dst);

my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, size_t addr_length,
                                     char *ip_string, size_t ip_string_size);

my_bool vio_is_no_name_error(int err_code);

int vio_getnameinfo(const struct sockaddr *sa,
                    char *hostname, size_t hostname_size,
                    char *port, size_t port_size,
                    int flags);

#ifdef HAVE_OPENSSL
/* apple deprecated openssl in MacOSX Lion */
#ifdef __APPLE__
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

#define HEADER_DES_LOCL_H dummy_something
#define YASSL_MYSQL_COMPATIBLE
#ifndef YASSL_PREFIX
#define YASSL_PREFIX
#endif
/* Set yaSSL to use same type as MySQL do for socket handles */
typedef my_socket YASSL_SOCKET_T;
#define YASSL_SOCKET_T_DEFINED
#define template _template /* bug in WolfSSL 4.4.0, see also my_crypt.cc */
#include <openssl/ssl.h>
#undef template
#include <openssl/err.h>
#ifdef DEPRECATED
#undef DEPRECATED
#endif

enum enum_ssl_init_error
{
  SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,
  SSL_INITERR_NOMATCH, SSL_INITERR_BAD_PATHS, SSL_INITERR_CIPHERS,
  SSL_INITERR_MEMFAIL, SSL_INITERR_DH, SSL_INITERR_PROTOCOL,
  SSL_INITERR_LASTERR
};
const char* sslGetErrString(enum enum_ssl_init_error err);

struct st_VioSSLFd
{
  SSL_CTX *ssl_context;
};

int sslaccept(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);

void vio_check_ssl_init();

struct st_VioSSLFd
*new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
		       const char *ca_file,  const char *ca_path,
		       const char *cipher, enum enum_ssl_init_error *error,
                       const char *crl_file, const char *crl_path);
struct st_VioSSLFd
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
		      const char *ca_file,const char *ca_path,
		      const char *cipher, enum enum_ssl_init_error *error,
		      const char *crl_file, const char *crl_path,
		      ulonglong tls_version);
void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
#endif /* HAVE_OPENSSL */

void vio_end(void);

const char *vio_type_name(enum enum_vio_type vio_type, size_t *len);

#ifdef	__cplusplus
}
#endif

#if !defined(DONT_MAP_VIO)
#define vio_delete(vio) 			(vio)->viodelete(vio)
#define vio_errno(vio)	 			(vio)->vioerrno(vio)
#define vio_read(vio, buf, size)                ((vio)->read)(vio,buf,size)
#define vio_write(vio, buf, size)               ((vio)->write)(vio, buf, size)
#define vio_blocking(vio, set_blocking_mode, old_mode)\
 	(vio)->vioblocking(vio, set_blocking_mode, old_mode)
#define vio_is_blocking(vio) 			(vio)->is_blocking(vio)
#define vio_fastsend(vio)			(vio)->fastsend(vio)
#define vio_keepalive(vio, set_keep_alive)	(vio)->viokeepalive(vio, set_keep_alive)
#define vio_should_retry(vio) 			(vio)->should_retry(vio)
#define vio_was_timeout(vio)                    (vio)->was_timeout(vio)
#define vio_close(vio)				((vio)->vioclose)(vio)
#define vio_shutdown(vio,how)			((vio)->shutdown)(vio,how)
#define vio_peer_addr(vio, buf, prt, buflen)	(vio)->peer_addr(vio, buf, prt, buflen)
#define vio_io_wait(vio, event, timeout)        (vio)->io_wait(vio, event, timeout)
#define vio_is_connected(vio)                   (vio)->is_connected(vio)
#endif /* !defined(DONT_MAP_VIO) */

#ifdef _WIN32

/* shutdown(2) flags */
#ifndef SHUT_RD
#define SHUT_RD SD_RECEIVE
#endif

#endif

/* This enumerator is used in parser - should be always visible */
enum SSL_type
{
  SSL_TYPE_NOT_SPECIFIED= -1,
  SSL_TYPE_NONE,
  SSL_TYPE_ANY,
  SSL_TYPE_X509,
  SSL_TYPE_SPECIFIED
};

/* HFTODO - hide this if we don't want client in embedded server */
/* This structure is for every connection on both sides */
struct st_vio
{
  MYSQL_SOCKET  mysql_socket;     /* Instrumented socket */
  my_bool		localhost;	/* Are we from localhost? */
  int			fcntl_mode;	/* Buffered fcntl(sd,F_GETFL) */
  struct sockaddr_storage local;	/* Local internet address */
  struct sockaddr_storage remote;	/* Remote internet address */
  enum enum_vio_type	type;		/* Type of connection */
  enum enum_vio_state	state;		/* State of the connection */
  const char		*desc;		/* String description */
  char                  *read_buffer;   /* buffer for vio_read_buff */
  char                  *read_pos;      /* start of unfetched data in the
                                           read buffer */
  char                  *read_end;      /* end of unfetched data */
  int                   read_timeout;   /* Timeout value (ms) for read ops. */
  int                   write_timeout;  /* Timeout value (ms) for write ops. */
  /* function pointers. They are similar for socket/SSL/whatever */
  void    (*viodelete)(Vio*);
  int     (*vioerrno)(Vio*);
  size_t  (*read)(Vio*, uchar *, size_t);
  size_t  (*write)(Vio*, const uchar *, size_t);
  int     (*timeout)(Vio*, uint, my_bool);
  int     (*vioblocking)(Vio*, my_bool, my_bool *);
  my_bool (*is_blocking)(Vio*);
  int     (*viokeepalive)(Vio*, my_bool);
  int     (*fastsend)(Vio*);
  my_bool (*peer_addr)(Vio*, char *, uint16*, size_t);
  void    (*in_addr)(Vio*, struct sockaddr_storage*);
  my_bool (*should_retry)(Vio*);
  my_bool (*was_timeout)(Vio*);
  int     (*vioclose)(Vio*);
  my_bool (*is_connected)(Vio*);
  int (*shutdown)(Vio *, int);
  my_bool (*has_data) (Vio*);
  int (*io_wait)(Vio*, enum enum_vio_io_event, int);
  my_bool (*connect)(Vio*, struct sockaddr *, socklen_t, int);
#ifdef HAVE_OPENSSL
  void	  *ssl_arg;
#endif
#ifdef _WIN32
  HANDLE hPipe;
  OVERLAPPED overlapped;
  int shutdown_flag;
  void *tp_ctx; /* threadpool context */
#endif
};
#endif /* vio_violite_h_ */
server/private/sp.h000064400000054074150400264000010320 0ustar00/* -*- C++ -*- */
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2009, 2020, 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 */

#ifndef _SP_H_
#define _SP_H_

#include "my_global.h"                          /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_string.h"                         // LEX_STRING
#include "sql_cmd.h"
#include "mdl.h"

class Field;
class Open_tables_backup;
class Open_tables_state;
class Query_arena;
class Query_tables_list;
class Sroutine_hash_entry;
class THD;
class sp_cache;
class sp_head;
class sp_package;
class sp_pcontext;
class sp_name;
class Database_qualified_name;
struct st_sp_chistics;
class Stored_program_creation_ctx;
struct LEX;
struct TABLE;
struct TABLE_LIST;
typedef struct st_hash HASH;
template <typename T> class SQL_I_List;

/*
  Values for the type enum. This reflects the order of the enum declaration
  in the CREATE TABLE command.
  See also storage/perfschema/my_thread.h
*/
enum enum_sp_type
{
  SP_TYPE_FUNCTION=1,
  SP_TYPE_PROCEDURE=2,
  SP_TYPE_PACKAGE=3,
  SP_TYPE_PACKAGE_BODY=4,
  SP_TYPE_TRIGGER=5,
  SP_TYPE_EVENT=6,
};

class Sp_handler
{
  bool sp_resolve_package_routine_explicit(THD *thd,
                                           sp_head *caller,
                                           sp_name *name,
                                           const Sp_handler **pkg_routine_hndlr,
                                           Database_qualified_name *pkgname)
                                           const;
  bool sp_resolve_package_routine_implicit(THD *thd,
                                           sp_head *caller,
                                           sp_name *name,
                                           const Sp_handler **pkg_routine_hndlr,
                                           Database_qualified_name *pkgname)
                                           const;
protected:
  int db_find_routine_aux(THD *thd, const Database_qualified_name *name,
                          TABLE *table) const;
  int db_find_routine(THD *thd, const Database_qualified_name *name,
                      sp_head **sphp) const;
  int db_find_and_cache_routine(THD *thd,
                                const Database_qualified_name *name,
                                sp_head **sp) const;
  int db_load_routine(THD *thd, const Database_qualified_name *name,
                      sp_head **sphp,
                      sql_mode_t sql_mode,
                      const LEX_CSTRING &params,
                      const LEX_CSTRING &returns,
                      const LEX_CSTRING &body,
                      const st_sp_chistics &chistics,
                      const AUTHID &definer,
                      longlong created, longlong modified,
                      sp_package *parent,
                      Stored_program_creation_ctx *creation_ctx) const;
  int sp_drop_routine_internal(THD *thd,
                               const Database_qualified_name *name,
                               TABLE *table) const;

  sp_head *sp_clone_and_link_routine(THD *thd,
                                     const Database_qualified_name *name,
                                     sp_head *sp) const;
  int sp_cache_package_routine(THD *thd,
                               const LEX_CSTRING &pkgname_cstr,
                               const Database_qualified_name *name,
                               sp_head **sp) const;
  int sp_cache_package_routine(THD *thd,
                               const Database_qualified_name *name,
                               sp_head **sp) const;
  sp_head *sp_find_package_routine(THD *thd,
                                   const LEX_CSTRING pkgname_str,
                                   const Database_qualified_name *name,
                                   bool cache_only) const;
  sp_head *sp_find_package_routine(THD *thd,
                                   const Database_qualified_name *name,
                                   bool cache_only) const;
public: // TODO: make it private or protected
  virtual int sp_find_and_drop_routine(THD *thd, TABLE *table,
                                       const Database_qualified_name *name)
                                       const;

public:
  virtual ~Sp_handler() = default;
  static const Sp_handler *handler(enum enum_sql_command cmd);
  static const Sp_handler *handler(enum_sp_type type);
  static const Sp_handler *handler(MDL_key::enum_mdl_namespace ns);
  /*
    Return a handler only those SP objects that store
    definitions in the mysql.proc system table
  */
  static const Sp_handler *handler_mysql_proc(enum_sp_type type)
  {
    const Sp_handler *sph= handler(type);
    return sph ? sph->sp_handler_mysql_proc() : NULL;
  }

  static bool eq_routine_name(const LEX_CSTRING &name1,
                              const LEX_CSTRING &name2)
  {
    return system_charset_info->strnncoll(name1.str, name1.length,
                                          name2.str, name2.length) == 0;
  }
  const char *type_str() const { return type_lex_cstring().str; }
  virtual const char *show_create_routine_col1_caption() const
  {
    DBUG_ASSERT(0);
    return "";
  }
  virtual const char *show_create_routine_col3_caption() const
  {
    DBUG_ASSERT(0);
    return "";
  }
  virtual const Sp_handler *package_routine_handler() const
  {
    return this;
  }
  virtual enum_sp_type type() const= 0;
  virtual LEX_CSTRING type_lex_cstring() const= 0;
  virtual LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const
  {
    static LEX_CSTRING m_empty_body= {STRING_WITH_LEN("???")};
    DBUG_ASSERT(0);
    return m_empty_body;
  }
  virtual MDL_key::enum_mdl_namespace get_mdl_type() const= 0;
  virtual const Sp_handler *sp_handler_mysql_proc() const { return this; }
  virtual sp_cache **get_cache(THD *) const { return NULL; }
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  virtual HASH *get_priv_hash() const { return NULL; }
#endif
  virtual ulong recursion_depth(THD *thd) const { return 0; }
  /**
    Return appropriate error about recursion limit reaching

    @param thd  Thread handle
    @param sp   SP routine

    @remark For functions and triggers we return error about
            prohibited recursion. For stored procedures we
            return about reaching recursion limit.
  */
  virtual void recursion_level_error(THD *thd, const sp_head *sp) const
  {
    my_error(ER_SP_NO_RECURSION, MYF(0));
  }
  virtual bool add_instr_freturn(THD *thd, sp_head *sp,
                                 sp_pcontext *spcont,
                                 Item *item, LEX *lex) const;
  virtual bool add_instr_preturn(THD *thd, sp_head *sp,
                                 sp_pcontext *spcont) const;

  void add_used_routine(Query_tables_list *prelocking_ctx,
                        Query_arena *arena,
                        const Database_qualified_name *name) const;

  bool sp_resolve_package_routine(THD *thd,
                                  sp_head *caller,
                                  sp_name *name,
                                  const Sp_handler **pkg_routine_handler,
                                  Database_qualified_name *pkgname) const;
  virtual sp_head *sp_find_routine(THD *thd,
                                   const Database_qualified_name *name,
                                   bool cache_only) const;
  virtual int sp_cache_routine(THD *thd, const Database_qualified_name *name,
                               sp_head **sp) const;

  int sp_cache_routine_reentrant(THD *thd,
                                 const Database_qualified_name *nm,
                                 sp_head **sp) const;

  bool sp_exist_routines(THD *thd, TABLE_LIST *procs) const;
  bool sp_show_create_routine(THD *thd,
                              const Database_qualified_name *name) const;

  bool sp_create_routine(THD *thd, const sp_head *sp) const;

  int sp_update_routine(THD *thd, const Database_qualified_name *name,
                        const st_sp_chistics *chistics) const;

  int sp_drop_routine(THD *thd, const Database_qualified_name *name) const;

  sp_head *sp_load_for_information_schema(THD *thd, TABLE *proc_table,
                                          const LEX_CSTRING &db,
                                          const LEX_CSTRING &name,
                                          const LEX_CSTRING &params,
                                          const LEX_CSTRING &returns,
                                          sql_mode_t sql_mode,
                                          bool *free_sp_head) const;

  /*
    Make a SHOW CREATE statement.
      @retval   true on error
      @retval   false on success
  */
  virtual bool show_create_sp(THD *thd, String *buf,
                              const LEX_CSTRING &db,
                              const LEX_CSTRING &name,
                              const LEX_CSTRING &params,
                              const LEX_CSTRING &returns,
                              const LEX_CSTRING &body,
                              const st_sp_chistics &chistics,
                              const AUTHID &definer,
                              const DDL_options_st ddl_options,
                              sql_mode_t sql_mode) const;

};


class Sp_handler_procedure: public Sp_handler
{
public:
  enum_sp_type type() const override { return SP_TYPE_PROCEDURE; }
  LEX_CSTRING type_lex_cstring() const override
  {
    static LEX_CSTRING m_type_str= { STRING_WITH_LEN("PROCEDURE")};
    return m_type_str;
  }
  LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override;
  const char *show_create_routine_col1_caption() const override
  {
    return "Procedure";
  }
  const char *show_create_routine_col3_caption() const override
  {
    return "Create Procedure";
  }
  MDL_key::enum_mdl_namespace get_mdl_type() const override
  {
    return MDL_key::PROCEDURE;
  }
  const Sp_handler *package_routine_handler() const override;
  sp_cache **get_cache(THD *) const override;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  HASH *get_priv_hash() const override;
#endif
  ulong recursion_depth(THD *thd) const override;
  void recursion_level_error(THD *thd, const sp_head *sp) const override;
  bool add_instr_preturn(THD *thd, sp_head *sp, sp_pcontext *spcont) const override;
};


class Sp_handler_package_procedure: public Sp_handler_procedure
{
public:
  int sp_cache_routine(THD *thd, const Database_qualified_name *name,
                       sp_head **sp) const override
  {
    return sp_cache_package_routine(thd, name, sp);
  }
  sp_head *sp_find_routine(THD *thd,
                           const Database_qualified_name *name,
                           bool cache_only) const override
  {
    return sp_find_package_routine(thd, name, cache_only);
  }
};


class Sp_handler_function: public Sp_handler
{
public:
  enum_sp_type type() const override { return SP_TYPE_FUNCTION; }
  LEX_CSTRING type_lex_cstring() const override
  {
    static LEX_CSTRING m_type_str= { STRING_WITH_LEN("FUNCTION")};
    return m_type_str;
  }
  LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override;
  const char *show_create_routine_col1_caption() const override
  {
    return "Function";
  }
  const char *show_create_routine_col3_caption() const override
  {
    return "Create Function";
  }
  MDL_key::enum_mdl_namespace get_mdl_type() const override
  {
    return MDL_key::FUNCTION;
  }
  const Sp_handler *package_routine_handler() const override;
  sp_cache **get_cache(THD *) const override;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  HASH *get_priv_hash() const override;
#endif
  bool add_instr_freturn(THD *thd, sp_head *sp, sp_pcontext *spcont,
                         Item *item, LEX *lex) const override;
};


class Sp_handler_package_function: public Sp_handler_function
{
public:
  int sp_cache_routine(THD *thd, const Database_qualified_name *name,
                       sp_head **sp) const override
  {
    return sp_cache_package_routine(thd, name, sp);
  }
  sp_head *sp_find_routine(THD *thd,
                           const Database_qualified_name *name,
                           bool cache_only) const override
  {
    return sp_find_package_routine(thd, name, cache_only);
  }
};


class Sp_handler_package: public Sp_handler
{
public:
  bool show_create_sp(THD *thd, String *buf,
                      const LEX_CSTRING &db,
                      const LEX_CSTRING &name,
                      const LEX_CSTRING &params,
                      const LEX_CSTRING &returns,
                      const LEX_CSTRING &body,
                      const st_sp_chistics &chistics,
                      const AUTHID &definer,
                      const DDL_options_st ddl_options,
                      sql_mode_t sql_mode) const override;
};


class Sp_handler_package_spec: public Sp_handler_package
{
public: // TODO: make it private or protected
  int sp_find_and_drop_routine(THD *thd, TABLE *table,
                               const Database_qualified_name *name)
                               const override;
public:
  enum_sp_type type() const override { return SP_TYPE_PACKAGE; }
  LEX_CSTRING type_lex_cstring() const override
  {
    static LEX_CSTRING m_type_str= {STRING_WITH_LEN("PACKAGE")};
    return m_type_str;
  }
  LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override
  {
    static LEX_CSTRING m_empty_body= {STRING_WITH_LEN("BEGIN END")};
    return m_empty_body;
  }
  const char *show_create_routine_col1_caption() const override
  {
    return "Package";
  }
  const char *show_create_routine_col3_caption() const override
  {
    return "Create Package";
  }
  MDL_key::enum_mdl_namespace get_mdl_type() const override
  {
    return MDL_key::PACKAGE_BODY;
  }
  sp_cache **get_cache(THD *) const override;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  HASH *get_priv_hash() const override;
#endif
};


class Sp_handler_package_body: public Sp_handler_package
{
public:
  enum_sp_type type() const override { return SP_TYPE_PACKAGE_BODY; }
  LEX_CSTRING type_lex_cstring() const override
  {
    static LEX_CSTRING m_type_str= {STRING_WITH_LEN("PACKAGE BODY")};
    return m_type_str;
  }
  LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override
  {
    static LEX_CSTRING m_empty_body= {STRING_WITH_LEN("BEGIN END")};
    return m_empty_body;
  }
  const char *show_create_routine_col1_caption() const override
  {
    return "Package body";
  }
  const char *show_create_routine_col3_caption() const override
  {
    return "Create Package Body";
  }
  MDL_key::enum_mdl_namespace get_mdl_type() const override
  {
    return MDL_key::PACKAGE_BODY;
  }
  sp_cache **get_cache(THD *) const override;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  HASH *get_priv_hash() const override;
#endif
};


class Sp_handler_trigger: public Sp_handler
{
public:
  enum_sp_type type() const override { return SP_TYPE_TRIGGER; }
  LEX_CSTRING type_lex_cstring() const override
  {
    static LEX_CSTRING m_type_str= { STRING_WITH_LEN("TRIGGER")};
    return m_type_str;
  }
  MDL_key::enum_mdl_namespace get_mdl_type() const override
  {
    DBUG_ASSERT(0);
    return MDL_key::TRIGGER;
  }
  const Sp_handler *sp_handler_mysql_proc() const override { return NULL; }
};


extern MYSQL_PLUGIN_IMPORT Sp_handler_function sp_handler_function;
extern MYSQL_PLUGIN_IMPORT Sp_handler_procedure sp_handler_procedure;
extern MYSQL_PLUGIN_IMPORT Sp_handler_package_spec sp_handler_package_spec;
extern MYSQL_PLUGIN_IMPORT Sp_handler_package_body sp_handler_package_body;
extern MYSQL_PLUGIN_IMPORT Sp_handler_package_function sp_handler_package_function;
extern MYSQL_PLUGIN_IMPORT Sp_handler_package_procedure sp_handler_package_procedure;
extern MYSQL_PLUGIN_IMPORT Sp_handler_trigger sp_handler_trigger;


inline const Sp_handler *Sp_handler::handler(enum_sql_command cmd)
{
  switch (cmd) {
  case SQLCOM_CREATE_PROCEDURE:
  case SQLCOM_ALTER_PROCEDURE:
  case SQLCOM_DROP_PROCEDURE:
  case SQLCOM_SHOW_PROC_CODE:
  case SQLCOM_SHOW_CREATE_PROC:
  case SQLCOM_SHOW_STATUS_PROC:
    return &sp_handler_procedure;
  case SQLCOM_CREATE_SPFUNCTION:
  case SQLCOM_ALTER_FUNCTION:
  case SQLCOM_DROP_FUNCTION:
  case SQLCOM_SHOW_FUNC_CODE:
  case SQLCOM_SHOW_CREATE_FUNC:
  case SQLCOM_SHOW_STATUS_FUNC:
    return &sp_handler_function;
  case SQLCOM_CREATE_PACKAGE:
  case SQLCOM_DROP_PACKAGE:
  case SQLCOM_SHOW_CREATE_PACKAGE:
  case SQLCOM_SHOW_STATUS_PACKAGE:
    return &sp_handler_package_spec;
  case SQLCOM_CREATE_PACKAGE_BODY:
  case SQLCOM_DROP_PACKAGE_BODY:
  case SQLCOM_SHOW_CREATE_PACKAGE_BODY:
  case SQLCOM_SHOW_STATUS_PACKAGE_BODY:
  case SQLCOM_SHOW_PACKAGE_BODY_CODE:
    return &sp_handler_package_body;
  default:
    break;
  }
  return NULL;
}


inline const Sp_handler *Sp_handler::handler(enum_sp_type type)
{
  switch (type) {
  case SP_TYPE_PROCEDURE:
    return &sp_handler_procedure;
  case SP_TYPE_FUNCTION:
    return &sp_handler_function;
  case SP_TYPE_PACKAGE:
    return &sp_handler_package_spec;
  case SP_TYPE_PACKAGE_BODY:
    return &sp_handler_package_body;
  case SP_TYPE_TRIGGER:
    return &sp_handler_trigger;
  case SP_TYPE_EVENT:
    break;
  }
  return NULL;
}


inline const Sp_handler *Sp_handler::handler(MDL_key::enum_mdl_namespace type)
{
  switch (type) {
  case MDL_key::FUNCTION:
    return &sp_handler_function;
  case MDL_key::PROCEDURE:
    return &sp_handler_procedure;
  case MDL_key::PACKAGE_BODY:
    return &sp_handler_package_body;
  case MDL_key::BACKUP:
  case MDL_key::SCHEMA:
  case MDL_key::TABLE:
  case MDL_key::TRIGGER:
  case MDL_key::EVENT:
  case MDL_key::USER_LOCK:
  case MDL_key::NAMESPACE_END:
    break;
  }
  return NULL;
}


/* Tells what SP_DEFAULT_ACCESS should be mapped to */
#define SP_DEFAULT_ACCESS_MAPPING SP_CONTAINS_SQL

// Return codes from sp_create_*, sp_drop_*, and sp_show_*:
#define SP_OK                 0
#define SP_KEY_NOT_FOUND     -1
#define SP_OPEN_TABLE_FAILED -2
#define SP_WRITE_ROW_FAILED  -3
#define SP_DELETE_ROW_FAILED -4
#define SP_GET_FIELD_FAILED  -5
#define SP_PARSE_ERROR       -6
#define SP_INTERNAL_ERROR    -7
#define SP_NO_DB_ERROR       -8
#define SP_BAD_IDENTIFIER    -9
#define SP_BODY_TOO_LONG    -10
#define SP_FLD_STORE_FAILED -11

/* DB storage of Stored PROCEDUREs and FUNCTIONs */
enum
{
  MYSQL_PROC_FIELD_DB = 0,
  MYSQL_PROC_FIELD_NAME,
  MYSQL_PROC_MYSQL_TYPE,
  MYSQL_PROC_FIELD_SPECIFIC_NAME,
  MYSQL_PROC_FIELD_LANGUAGE,
  MYSQL_PROC_FIELD_ACCESS,
  MYSQL_PROC_FIELD_DETERMINISTIC,
  MYSQL_PROC_FIELD_SECURITY_TYPE,
  MYSQL_PROC_FIELD_PARAM_LIST,
  MYSQL_PROC_FIELD_RETURNS,
  MYSQL_PROC_FIELD_BODY,
  MYSQL_PROC_FIELD_DEFINER,
  MYSQL_PROC_FIELD_CREATED,
  MYSQL_PROC_FIELD_MODIFIED,
  MYSQL_PROC_FIELD_SQL_MODE,
  MYSQL_PROC_FIELD_COMMENT,
  MYSQL_PROC_FIELD_CHARACTER_SET_CLIENT,
  MYSQL_PROC_FIELD_COLLATION_CONNECTION,
  MYSQL_PROC_FIELD_DB_COLLATION,
  MYSQL_PROC_FIELD_BODY_UTF8,
  MYSQL_PROC_FIELD_AGGREGATE,
  MYSQL_PROC_FIELD_COUNT
};

/* Drop all routines in database 'db' */
int
sp_drop_db_routines(THD *thd, const char *db);

/**
   Acquires exclusive metadata lock on all stored routines in the
   given database.

   @param  thd  Thread handler
   @param  db   Database name

   @retval  false  Success
   @retval  true   Failure
 */
bool lock_db_routines(THD *thd, const char *db);

/**
  Structure that represents element in the set of stored routines
  used by statement or routine.
*/

class Sroutine_hash_entry
{
public:
  /**
    Metadata lock request for routine.
    MDL_key in this request is also used as a key for set.
  */
  MDL_request mdl_request;
  /**
    Next element in list linking all routines in set. See also comments
    for LEX::sroutine/sroutine_list and sp_head::m_sroutines.
  */
  Sroutine_hash_entry *next;
  /**
    Uppermost view which directly or indirectly uses this routine.
    0 if routine is not used in view. Note that it also can be 0 if
    statement uses routine both via view and directly.
  */
  TABLE_LIST *belong_to_view;
  /**
    This is for prepared statement validation purposes.
    A statement looks up and pre-loads all its stored functions
    at prepare. Later on, if a function is gone from the cache,
    execute may fail.
    Remember the version of sp_head at prepare to be able to
    invalidate the prepared statement at execute if it
    changes.
  */
  ulong m_sp_cache_version;

  const Sp_handler *m_handler;

  int sp_cache_routine(THD *thd, sp_head **sp) const;
};


bool sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
                         const MDL_key *key,
                         const Sp_handler *handler,
                         TABLE_LIST *belong_to_view);
void sp_remove_not_own_routines(Query_tables_list *prelocking_ctx);
bool sp_update_sp_used_routines(HASH *dst, HASH *src);
void sp_update_stmt_used_routines(THD *thd, Query_tables_list *prelocking_ctx,
                                  HASH *src, TABLE_LIST *belong_to_view);
void sp_update_stmt_used_routines(THD *thd, Query_tables_list *prelocking_ctx,
                                  SQL_I_List<Sroutine_hash_entry> *src,
                                  TABLE_LIST *belong_to_view);

extern "C" const uchar *sp_sroutine_key(const void *ptr, size_t *plen,
                                        my_bool);

/*
  Routines which allow open/lock and close mysql.proc table even when
  we already have some tables open and locked.
*/
TABLE *open_proc_table_for_read(THD *thd);

bool load_charset(THD *thd,
                  MEM_ROOT *mem_root,
                  Field *field,
                  CHARSET_INFO *dflt_cs,
                  CHARSET_INFO **cs);

bool load_collation(THD *thd,MEM_ROOT *mem_root,
                    Field *field,
                    CHARSET_INFO *dflt_cl,
                    CHARSET_INFO **cl);

void sp_returns_type(THD *thd,
                     String &result,
                     const sp_head *sp);

#endif /* _SP_H_ */
server/private/opt_subselect.h000064400000034327150400264000012550 0ustar00/*
   Copyright (c) 2010, 2019, MariaDB

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*
  Semi-join subquery optimization code definitions
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

int check_and_do_in_subquery_rewrites(JOIN *join);
bool convert_join_subqueries_to_semijoins(JOIN *join);
int pull_out_semijoin_tables(JOIN *join);
bool optimize_semijoin_nests(JOIN *join, table_map all_table_map);
bool setup_degenerate_jtbm_semi_joins(JOIN *join,
                                      List<TABLE_LIST> *join_list,
                                      List<Item> &eq_list);
bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
                           List<Item> &eq_list);
void cleanup_empty_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list);

// used by Loose_scan_opt
ulonglong get_bound_sj_equalities(TABLE_LIST *sj_nest, 
                                  table_map remaining_tables);

/*
  This is a class for considering possible loose index scan optimizations.
  It's usage pattern is as follows:
    best_access_path()
    {
       Loose_scan_opt opt;

       opt.init()
       for each index we can do ref access with
       {
         opt.next_ref_key();
         for each keyuse 
           opt.add_keyuse();
         opt.check_ref_access();
       }

       if (some criteria for range scans)
         opt.check_range_access();
       
       opt.get_best_option();
    }
*/

class Loose_scan_opt
{
  /* All methods must check this before doing anything else */
  bool try_loosescan;

  /*
    If we consider (oe1, .. oeN) IN (SELECT ie1, .. ieN) then ieK=oeK is
    called sj-equality. If oeK depends only on preceding tables then such
    equality is called 'bound'.
  */
  ulonglong bound_sj_equalities;
 
  /* Accumulated properties of ref access we're now considering: */
  ulonglong handled_sj_equalities;
  key_part_map loose_scan_keyparts;
  uint max_loose_keypart;
  bool part1_conds_met;

  /*
    Use of quick select is a special case. Some of its properties:
  */
  uint quick_uses_applicable_index;
  uint quick_max_loose_keypart;
  
  /* Best loose scan method so far */
  uint   best_loose_scan_key;
  double best_loose_scan_cost;
  double best_loose_scan_records;
  KEYUSE *best_loose_scan_start_key;

  uint best_max_loose_keypart;
  table_map best_ref_depend_map;

public:
  Loose_scan_opt():
    try_loosescan(false),
    bound_sj_equalities(0),
    quick_uses_applicable_index(0),
    quick_max_loose_keypart(0),
    best_loose_scan_key(0),
    best_loose_scan_cost(0),
    best_loose_scan_records(0),
    best_loose_scan_start_key(NULL),
    best_max_loose_keypart(0),
    best_ref_depend_map(0)
  {
  }

  void init(JOIN *join, JOIN_TAB *s, table_map remaining_tables)
  {
    /*
      Discover the bound equalities. We need to do this if
        1. The next table is an SJ-inner table, and
        2. It is the first table from that semijoin, and
        3. We're not within a semi-join range (i.e. all semi-joins either have
           all or none of their tables in join_table_map), except
           s->emb_sj_nest (which we've just entered, see #2).
        4. All non-IN-equality correlation references from this sj-nest are 
           bound
        5. But some of the IN-equalities aren't (so this can't be handled by 
           FirstMatch strategy)
    */
    best_loose_scan_cost= DBL_MAX;
    if (!join->emb_sjm_nest && s->emb_sj_nest &&                        // (1)
        s->emb_sj_nest->sj_in_exprs < 64 && 
        ((remaining_tables & s->emb_sj_nest->sj_inner_tables) ==        // (2)
         s->emb_sj_nest->sj_inner_tables) &&                            // (2)
        join->cur_sj_inner_tables == 0 &&                               // (3)
        !(remaining_tables & 
          s->emb_sj_nest->nested_join->sj_corr_tables) &&               // (4)
        remaining_tables & s->emb_sj_nest->nested_join->sj_depends_on &&// (5)
        optimizer_flag(join->thd, OPTIMIZER_SWITCH_LOOSE_SCAN))
    {
      /* This table is an LooseScan scan candidate */
      bound_sj_equalities= get_bound_sj_equalities(s->emb_sj_nest, 
                                                   remaining_tables);
      try_loosescan= TRUE;
      DBUG_PRINT("info", ("Will try LooseScan scan, bound_map=%llx",
                          (longlong)bound_sj_equalities));
    }
  }

  void next_ref_key()
  {
    handled_sj_equalities=0;
    loose_scan_keyparts= 0;
    max_loose_keypart= 0;
    part1_conds_met= FALSE;
  }
  
  void add_keyuse(table_map remaining_tables, KEYUSE *keyuse)
  {
    if (try_loosescan && keyuse->sj_pred_no != UINT_MAX &&
        (keyuse->table->file->index_flags(keyuse->key, 0, 1 ) & HA_READ_ORDER))

    {
      if (!(remaining_tables & keyuse->used_tables))
      {
        /* 
          This allows to use equality propagation to infer that some 
          sj-equalities are bound.
        */
        bound_sj_equalities |= 1ULL << keyuse->sj_pred_no;
      }
      else
      {
        handled_sj_equalities |= 1ULL << keyuse->sj_pred_no;
        loose_scan_keyparts |= ((key_part_map)1) << keyuse->keypart;
        set_if_bigger(max_loose_keypart, keyuse->keypart);
      }
    }
  }

  bool have_a_case() { return MY_TEST(handled_sj_equalities); }

  void check_ref_access_part1(JOIN_TAB *s, uint key, KEYUSE *start_key, 
                              table_map found_part)
  {
    /*
      Check if we can use LooseScan semi-join strategy. We can if
      1. This is the right table at right location
      2. All IN-equalities are either
         - "bound", ie. the outer_expr part refers to the preceding tables
         - "handled", ie. covered by the index we're considering
      3. Index order allows to enumerate subquery's duplicate groups in
         order. This happens when the index definition matches this
         pattern:

           (handled_col|bound_col)* (other_col|bound_col)

    */
    if (try_loosescan &&                                       // (1)
        (handled_sj_equalities | bound_sj_equalities) ==       // (2)
        PREV_BITS(ulonglong, s->emb_sj_nest->sj_in_exprs) &&   // (2)
        (PREV_BITS(key_part_map, max_loose_keypart+1) &        // (3)
         (found_part | loose_scan_keyparts)) ==                // (3)
        PREV_BITS(key_part_map, max_loose_keypart+1) &&        // (3)
        !key_uses_partial_cols(s->table->s, key))
    {
      if (s->quick && s->quick->index == key && 
          s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_RANGE)
      {
        quick_uses_applicable_index= TRUE;
        quick_max_loose_keypart= max_loose_keypart;
      }
      DBUG_PRINT("info", ("Can use LooseScan scan"));

      if (found_part & 1)
      {
        /* Can use LooseScan on ref access if the first key part is bound */
        part1_conds_met= TRUE;
      }

      /* 
        Check if this is a special case where there are no usable bound
        IN-equalities, i.e. we have

          outer_expr IN (SELECT innertbl.key FROM ...) 
        
        and outer_expr cannot be evaluated yet, so it's actually full
        index scan and not a ref access.
        We can do full index scan if it uses index-only.
      */
      if (!(found_part & 1 ) && /* no usable ref access for 1st key part */
          s->table->covering_keys.is_set(key))
      {
        part1_conds_met= TRUE;
        DBUG_PRINT("info", ("Can use full index scan for LooseScan"));
        
        /* Calculate the cost of complete loose index scan.  */
        double records= rows2double(s->table->file->stats.records);

        /* The cost is entire index scan cost (divided by 2) */
        double read_time= s->table->file->keyread_time(key, 1,
                                                       (ha_rows) records);

        /*
          Now find out how many different keys we will get (for now we
          ignore the fact that we have "keypart_i=const" restriction for
          some key components, that may make us think think that loose
          scan will produce more distinct records than it actually will)
        */
        ulong rpc;
        if ((rpc= s->table->key_info[key].rec_per_key[max_loose_keypart]))
          records= records / rpc;

        // TODO: previous version also did /2
        if (read_time < best_loose_scan_cost)
        {
          best_loose_scan_key= key;
          best_loose_scan_cost= read_time;
          best_loose_scan_records= records;
          best_max_loose_keypart= max_loose_keypart;
          best_loose_scan_start_key= start_key;
          best_ref_depend_map= 0;
        }
      }
    }
  }
  
  void check_ref_access_part2(uint key, KEYUSE *start_key, double records, 
                              double read_time, table_map ref_depend_map_arg)
  {
    if (part1_conds_met && read_time < best_loose_scan_cost)
    {
      /* TODO use rec-per-key-based fanout calculations */
      best_loose_scan_key= key;
      best_loose_scan_cost= read_time;
      best_loose_scan_records= records;
      best_max_loose_keypart= max_loose_keypart;
      best_loose_scan_start_key= start_key;
      best_ref_depend_map= ref_depend_map_arg;
    }
  }

  void check_range_access(JOIN *join, uint idx, QUICK_SELECT_I *quick)
  {
    /* TODO: this the right part restriction: */
    if (quick_uses_applicable_index && idx == join->const_tables && 
        quick->read_time < best_loose_scan_cost)
    {
      best_loose_scan_key= quick->index;
      best_loose_scan_cost= quick->read_time;
      /* this is ok because idx == join->const_tables */
      best_loose_scan_records= rows2double(quick->records);
      best_max_loose_keypart= quick_max_loose_keypart;
      best_loose_scan_start_key= NULL;
      best_ref_depend_map= 0;
    }
  }

  void save_to_position(JOIN_TAB *tab, POSITION *pos)
  {
    pos->read_time=       best_loose_scan_cost;
    if (best_loose_scan_cost != DBL_MAX)
    {
      pos->records_read=    best_loose_scan_records;
      pos->key=             best_loose_scan_start_key;
      pos->cond_selectivity= 1.0;
      pos->loosescan_picker.loosescan_key=   best_loose_scan_key;
      pos->loosescan_picker.loosescan_parts= best_max_loose_keypart + 1;
      pos->use_join_buffer= FALSE;
      pos->table=           tab;
      pos->range_rowid_filter_info= tab->range_rowid_filter_info;
      pos->ref_depend_map=  best_ref_depend_map;
      DBUG_PRINT("info", ("Produced a LooseScan plan, key %s, %s",
                          tab->table->key_info[best_loose_scan_key].name.str,
                          best_loose_scan_start_key? "(ref access)":
                                                     "(range/index access)"));
    }
  }
};


void optimize_semi_joins(JOIN *join, table_map remaining_tables, uint idx,
                         double *current_record_count,
                         double *current_read_time, POSITION *loose_scan_pos);
void update_sj_state(JOIN *join, const JOIN_TAB *new_tab,
                     uint idx, table_map remaining_tables);
void restore_prev_sj_state(const table_map remaining_tables, 
                                  const JOIN_TAB *tab, uint idx);

void fix_semijoin_strategies_for_picked_join_order(JOIN *join);

bool setup_sj_materialization_part1(JOIN_TAB *sjm_tab);
bool setup_sj_materialization_part2(JOIN_TAB *sjm_tab);
uint get_number_of_tables_at_top_level(JOIN *join);


/*
  Temporary table used by semi-join DuplicateElimination strategy

  This consists of the temptable itself and data needed to put records
  into it. The table's DDL is as follows:

    CREATE TABLE tmptable (col VARCHAR(n) BINARY, PRIMARY KEY(col));

  where the primary key can be replaced with unique constraint if n exceeds
  the limit (as it is always done for query execution-time temptables).

  The record value is a concatenation of rowids of tables from the join we're
  executing. If a join table is on the inner side of the outer join, we
  assume that its rowid can be NULL and provide means to store this rowid in
  the tuple.
*/

class SJ_TMP_TABLE : public Sql_alloc
{
public:
  /*
    Array of pointers to tables whose rowids compose the temporary table
    record.
  */
  class TAB
  {
  public:
    JOIN_TAB *join_tab;
    uint rowid_offset;
    ushort null_byte;
    uchar null_bit;
  };
  TAB *tabs;
  TAB *tabs_end;
  
  /* 
    is_degenerate==TRUE means this is a special case where the temptable record
    has zero length (and presence of a unique key means that the temptable can
    have either 0 or 1 records). 
    In this case we don't create the physical temptable but instead record
    its state in SJ_TMP_TABLE::have_degenerate_row.
  */
  bool is_degenerate;

  /* 
    When is_degenerate==TRUE: the contents of the table (whether it has the
    record or not).
  */
  bool have_degenerate_row;
  
  /* table record parameters */
  uint null_bits;
  uint null_bytes;
  uint rowid_len;

  /* The temporary table itself (NULL means not created yet) */
  TABLE *tmp_table;
  
  /*
    These are the members we got from temptable creation code. We'll need
    them if we'll need to convert table from HEAP to MyISAM/Maria.
  */
  TMP_ENGINE_COLUMNDEF *start_recinfo;
  TMP_ENGINE_COLUMNDEF *recinfo;

  SJ_TMP_TABLE *next_flush_table; 

  int sj_weedout_delete_rows();
  int sj_weedout_check_row(THD *thd);
  bool create_sj_weedout_tmp_table(THD *thd);
};

int setup_semijoin_loosescan(JOIN *join);
int setup_semijoin_dups_elimination(JOIN *join, ulonglong options, 
                                    uint no_jbuf_after);
void destroy_sj_tmp_tables(JOIN *join);
int clear_sj_tmp_tables(JOIN *join);
int rewrite_to_index_subquery_engine(JOIN *join);


void get_delayed_table_estimates(TABLE *table,
                                 ha_rows *out_rows, 
                                 double *scan_time,
                                 double *startup_cost);

enum_nested_loop_state join_tab_execution_startup(JOIN_TAB *tab);

server/private/sql_acl.h000064400000033464150400264000011314 0ustar00#ifndef SQL_ACL_INCLUDED
#define SQL_ACL_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2017, 2020, 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 "violite.h"                            /* SSL_type */
#include "sql_class.h"                          /* LEX_COLUMN */
#include "grant.h"
#include "sql_cmd.h"                            /* Sql_cmd */


enum mysql_db_table_field
{
  MYSQL_DB_FIELD_HOST = 0,
  MYSQL_DB_FIELD_DB,
  MYSQL_DB_FIELD_USER,
  MYSQL_DB_FIELD_SELECT_PRIV,
  MYSQL_DB_FIELD_INSERT_PRIV,
  MYSQL_DB_FIELD_UPDATE_PRIV,
  MYSQL_DB_FIELD_DELETE_PRIV,
  MYSQL_DB_FIELD_CREATE_PRIV,
  MYSQL_DB_FIELD_DROP_PRIV,
  MYSQL_DB_FIELD_GRANT_PRIV,
  MYSQL_DB_FIELD_REFERENCES_PRIV,
  MYSQL_DB_FIELD_INDEX_PRIV,
  MYSQL_DB_FIELD_ALTER_PRIV,
  MYSQL_DB_FIELD_CREATE_TMP_TABLE_PRIV,
  MYSQL_DB_FIELD_LOCK_TABLES_PRIV,
  MYSQL_DB_FIELD_CREATE_VIEW_PRIV,
  MYSQL_DB_FIELD_SHOW_VIEW_PRIV,
  MYSQL_DB_FIELD_CREATE_ROUTINE_PRIV,
  MYSQL_DB_FIELD_ALTER_ROUTINE_PRIV,
  MYSQL_DB_FIELD_EXECUTE_PRIV,
  MYSQL_DB_FIELD_EVENT_PRIV,
  MYSQL_DB_FIELD_TRIGGER_PRIV,
  MYSQL_DB_FIELD_DELETE_VERSIONING_ROWS_PRIV,
  MYSQL_DB_FIELD_COUNT
};

extern const TABLE_FIELD_DEF mysql_db_table_def;
extern bool mysql_user_table_is_in_short_password_format;

extern LEX_CSTRING host_not_specified;
extern LEX_CSTRING current_user;
extern LEX_CSTRING current_role;
extern LEX_CSTRING current_user_and_current_role;


static inline int access_denied_error_code(int passwd_used)
{
#ifdef mysqld_error_find_printf_error_used
  return 0;
#else
  return passwd_used == 2 ? ER_ACCESS_DENIED_NO_PASSWORD_ERROR
                          : ER_ACCESS_DENIED_ERROR;
#endif
}

/* prototypes */

bool hostname_requires_resolving(const char *hostname);
bool  acl_init(bool dont_read_acl_tables);
bool acl_reload(THD *thd);
void acl_free(bool end=0);
privilege_t acl_get(const char *host, const char *ip,
                    const char *user, const char *db, my_bool db_is_pattern);
bool acl_authenticate(THD *thd, uint com_change_user_pkt_len);
bool acl_getroot(Security_context *sctx, const char *user, const char *host,
                 const char *ip, const char *db);
bool acl_check_host(const char *host, const char *ip);
bool check_change_password(THD *thd, LEX_USER *user);
bool change_password(THD *thd, LEX_USER *user);

bool mysql_grant_role(THD *thd, List<LEX_USER> &user_list, bool revoke);
bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
                 privilege_t rights, bool revoke, bool is_proxy);
int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
                       List <LEX_COLUMN> &column_list, privilege_t rights,
                       bool revoke);
bool mysql_routine_grant(THD *thd, TABLE_LIST *table, const Sp_handler *sph,
                         List <LEX_USER> &user_list, privilege_t rights,
                         bool revoke, bool write_to_binlog);
bool grant_init();
void grant_free(void);
bool grant_reload(THD *thd);
bool check_grant(THD *thd, privilege_t want_access, TABLE_LIST *tables,
                 bool any_combination_will_do, uint number, bool no_errors);
bool check_grant_column (THD *thd, GRANT_INFO *grant,
                         const char *db_name, const char *table_name,
                         const char *name, size_t length, Security_context *sctx);
bool check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref,
                                     const char *name, size_t length, Field *fld);
bool check_grant_all_columns(THD *thd, privilege_t want_access,
                             Field_iterator_table_ref *fields);
bool check_grant_routine(THD *thd, privilege_t want_access,
                         TABLE_LIST *procs, const Sp_handler *sph,
                         bool no_error);
bool check_grant_db(THD *thd,const char *db);
bool check_global_access(THD *thd, const privilege_t want_access, bool no_errors= false);
bool check_access(THD *thd, privilege_t want_access,
                  const char *db, privilege_t *save_priv,
                  GRANT_INTERNAL_INFO *grant_internal_info,
                  bool dont_check_global_grants, bool no_errors);
privilege_t get_table_grant(THD *thd, TABLE_LIST *table);
privilege_t get_column_grant(THD *thd, GRANT_INFO *grant,
                             const char *db_name, const char *table_name,
                             const char *field_name);
bool get_show_user(THD *thd, LEX_USER *lex_user, const char **username,
                   const char **hostname, const char **rolename);
void mysql_show_grants_get_fields(THD *thd, List<Item> *fields,
                                  const char *name, size_t length);
bool mysql_show_grants(THD *thd, LEX_USER *user);
bool mysql_show_create_user(THD *thd, LEX_USER *user);
int fill_schema_enabled_roles(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_schema_applicable_roles(THD *thd, TABLE_LIST *tables, COND *cond);
void get_privilege_desc(char *to, uint max_length, privilege_t access);
void get_mqh(const char *user, const char *host, USER_CONN *uc);
bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role);
bool mysql_drop_user(THD *thd, List <LEX_USER> &list, bool handle_as_role);
bool mysql_rename_user(THD *thd, List <LEX_USER> &list);
int mysql_alter_user(THD *thd, List <LEX_USER> &list);
bool mysql_revoke_all(THD *thd, List <LEX_USER> &list);
void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
                                     const char *db, const char *table);
bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
                          const Sp_handler *sph);
bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
                         const Sp_handler *sph);
bool check_routine_level_acl(THD *thd, const char *db, const char *name,
                             const Sp_handler *sph);
bool is_acl_user(const char *host, const char *user);
int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr);

/**
  Result of an access check for an internal schema or table.
  Internal ACL checks are always performed *before* using
  the grant tables.
  This mechanism enforces that the server implementation has full
  control on its internal tables.
  Depending on the internal check result, the server implementation
  can choose to:
  - always allow access,
  - always deny access,
  - delegate the decision to the database administrator,
  by using the grant tables.
*/
enum ACL_internal_access_result
{
  /**
    Access granted for all the requested privileges,
    do not use the grant tables.
  */
  ACL_INTERNAL_ACCESS_GRANTED,
  /** Access denied, do not use the grant tables. */
  ACL_INTERNAL_ACCESS_DENIED,
  /** No decision yet, use the grant tables. */
  ACL_INTERNAL_ACCESS_CHECK_GRANT
};

/**
  Per internal table ACL access rules.
  This class is an interface.
  Per table(s) specific access rule should be implemented in a subclass.
  @sa ACL_internal_schema_access
*/
class ACL_internal_table_access
{
public:
  ACL_internal_table_access() = default;

  virtual ~ACL_internal_table_access() = default;

  /**
    Check access to an internal table.
    When a privilege is granted, this method add the requested privilege
    to save_priv.
    @param want_access the privileges requested
    @param [in, out] save_priv the privileges granted
    @return
      @retval ACL_INTERNAL_ACCESS_GRANTED All the requested privileges
      are granted, and saved in save_priv.
      @retval ACL_INTERNAL_ACCESS_DENIED At least one of the requested
      privileges was denied.
      @retval ACL_INTERNAL_ACCESS_CHECK_GRANT No requested privilege
      was denied, and grant should be checked for at least one
      privilege. Requested privileges that are granted, if any, are saved
      in save_priv.
  */
  virtual ACL_internal_access_result check(privilege_t want_access,
            privilege_t *save_priv, bool any_combination_will_do) const= 0;
};

/**
  Per internal schema ACL access rules.
  This class is an interface.
  Each per schema specific access rule should be implemented
  in a different subclass, and registered.
  Per schema access rules can control:
  - every schema privileges on schema.*
  - every table privileges on schema.table
  @sa ACL_internal_schema_registry
*/
class ACL_internal_schema_access
{
public:
  ACL_internal_schema_access() = default;

  virtual ~ACL_internal_schema_access() = default;

  /**
    Check access to an internal schema.
    @param want_access the privileges requested
    @param [in, out] save_priv the privileges granted
    @return
      @retval ACL_INTERNAL_ACCESS_GRANTED All the requested privileges
      are granted, and saved in save_priv.
      @retval ACL_INTERNAL_ACCESS_DENIED At least one of the requested
      privileges was denied.
      @retval ACL_INTERNAL_ACCESS_CHECK_GRANT No requested privilege
      was denied, and grant should be checked for at least one
      privilege. Requested privileges that are granted, if any, are saved
      in save_priv.
  */
  virtual ACL_internal_access_result check(privilege_t want_access,
                                           privilege_t *save_priv) const= 0;

  /**
    Search for per table ACL access rules by table name.
    @param name the table name
    @return per table access rules, or NULL
  */
  virtual const ACL_internal_table_access *lookup(const char *name) const= 0;
};

/**
  A registry for per internal schema ACL.
  An 'internal schema' is a database schema maintained by the
  server implementation, such as 'performance_schema' and 'INFORMATION_SCHEMA'.
*/
class ACL_internal_schema_registry
{
public:
  static void register_schema(const LEX_CSTRING *name,
                              const ACL_internal_schema_access *access);
  static const ACL_internal_schema_access *lookup(const char *name);
};

const ACL_internal_schema_access *
get_cached_schema_access(GRANT_INTERNAL_INFO *grant_internal_info,
                         const char *schema_name);

const ACL_internal_table_access *
get_cached_table_access(GRANT_INTERNAL_INFO *grant_internal_info,
                        const char *schema_name,
                        const char *table_name);

bool acl_check_proxy_grant_access (THD *thd, const char *host, const char *user,
                                   bool with_grant);
int acl_setrole(THD *thd, const char *rolename, privilege_t access);
int acl_check_setrole(THD *thd, const char *rolename, privilege_t *access);
int acl_check_set_default_role(THD *thd, const char *host, const char *user,
                               const char *role);
int acl_set_default_role(THD *thd, const char *host, const char *user,
                         const char *rolename);

extern SHOW_VAR acl_statistics[];

/* Check if a role is granted to a user/role.

   If hostname == NULL, search for a role as the starting grantee.
*/
bool check_role_is_granted(const char *username,
                           const char *hostname,
                           const char *rolename);

#ifndef DBUG_OFF
extern ulong role_global_merges, role_db_merges, role_table_merges,
             role_column_merges, role_routine_merges;
#endif


class Sql_cmd_grant: public Sql_cmd
{
protected:
  enum_sql_command m_command;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  void warn_hostname_requires_resolving(THD *thd, List<LEX_USER> &list);
  bool user_list_reset_mqh(THD *thd, List<LEX_USER> &list);
  void grant_stage0(THD *thd);
#endif
public:
  Sql_cmd_grant(enum_sql_command command)
   :m_command(command)
  { }
  bool is_revoke() const { return m_command == SQLCOM_REVOKE; }
  enum_sql_command sql_command_code() const override { return m_command; }
};


class Sql_cmd_grant_proxy: public Sql_cmd_grant
{
  privilege_t m_grant_option;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  bool check_access_proxy(THD *thd, List<LEX_USER> &list);
#endif
public:
  Sql_cmd_grant_proxy(enum_sql_command command, privilege_t grant_option)
   :Sql_cmd_grant(command), m_grant_option(grant_option)
  { }
  bool execute(THD *thd) override;
};


class Sql_cmd_grant_object: public Sql_cmd_grant, public Grant_privilege
{
protected:
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  bool grant_stage0_exact_object(THD *thd, TABLE_LIST *table);
#endif
public:
  Sql_cmd_grant_object(enum_sql_command command, const Grant_privilege &grant)
   :Sql_cmd_grant(command), Grant_privilege(grant)
  { }
};


class Sql_cmd_grant_table: public Sql_cmd_grant_object
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  bool execute_table_mask(THD *thd);
  bool execute_exact_table(THD *thd, TABLE_LIST *table);
#endif
public:
  Sql_cmd_grant_table(enum_sql_command command, const Grant_privilege &grant)
   :Sql_cmd_grant_object(command, grant)
  { }
  bool execute(THD *thd) override;
};



class Sql_cmd_grant_sp: public Sql_cmd_grant_object
{
  const Sp_handler &m_sph;
public:
  Sql_cmd_grant_sp(enum_sql_command command, const Grant_privilege &grant,
                   const Sp_handler &sph)
   :Sql_cmd_grant_object(command, grant),
    m_sph(sph)
  { }
  bool execute(THD *thd) override;
};

#endif /* SQL_ACL_INCLUDED */
server/private/probes_mysql_dtrace.h000064400000100355150400264000013731 0ustar00/* Generated by the Systemtap dtrace wrapper */


#define _SDT_HAS_SEMAPHORES 1


#define STAP_HAS_SEMAPHORES 1 /* deprecated */


#include <sys/sdt.h>

/* MYSQL_CONNECTION_START ( unsigned long conn_id, char * user, char * host ) */
#if defined STAP_SDT_V1
#define MYSQL_CONNECTION_START_ENABLED() __builtin_expect (connection__start_semaphore, 0)
#define mysql_connection__start_semaphore connection__start_semaphore
#else
#define MYSQL_CONNECTION_START_ENABLED() __builtin_expect (mysql_connection__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_connection__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_CONNECTION_START(arg1, arg2, arg3) \
DTRACE_PROBE3 (mysql, connection__start, arg1, arg2, arg3)

/* MYSQL_CONNECTION_DONE ( int status, unsigned long conn_id ) */
#if defined STAP_SDT_V1
#define MYSQL_CONNECTION_DONE_ENABLED() __builtin_expect (connection__done_semaphore, 0)
#define mysql_connection__done_semaphore connection__done_semaphore
#else
#define MYSQL_CONNECTION_DONE_ENABLED() __builtin_expect (mysql_connection__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_connection__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_CONNECTION_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, connection__done, arg1, arg2)

/* MYSQL_COMMAND_START ( unsigned long conn_id, int command, char * user, char * host ) */
#if defined STAP_SDT_V1
#define MYSQL_COMMAND_START_ENABLED() __builtin_expect (command__start_semaphore, 0)
#define mysql_command__start_semaphore command__start_semaphore
#else
#define MYSQL_COMMAND_START_ENABLED() __builtin_expect (mysql_command__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_command__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_COMMAND_START(arg1, arg2, arg3, arg4) \
DTRACE_PROBE4 (mysql, command__start, arg1, arg2, arg3, arg4)

/* MYSQL_COMMAND_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_COMMAND_DONE_ENABLED() __builtin_expect (command__done_semaphore, 0)
#define mysql_command__done_semaphore command__done_semaphore
#else
#define MYSQL_COMMAND_DONE_ENABLED() __builtin_expect (mysql_command__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_command__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_COMMAND_DONE(arg1) \
DTRACE_PROBE1 (mysql, command__done, arg1)

/* MYSQL_QUERY_START ( char * query, unsigned long conn_id, char * db_name, char * user, char * host ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_START_ENABLED() __builtin_expect (query__start_semaphore, 0)
#define mysql_query__start_semaphore query__start_semaphore
#else
#define MYSQL_QUERY_START_ENABLED() __builtin_expect (mysql_query__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_START(arg1, arg2, arg3, arg4, arg5) \
DTRACE_PROBE5 (mysql, query__start, arg1, arg2, arg3, arg4, arg5)

/* MYSQL_QUERY_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_DONE_ENABLED() __builtin_expect (query__done_semaphore, 0)
#define mysql_query__done_semaphore query__done_semaphore
#else
#define MYSQL_QUERY_DONE_ENABLED() __builtin_expect (mysql_query__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_DONE(arg1) \
DTRACE_PROBE1 (mysql, query__done, arg1)

/* MYSQL_QUERY_PARSE_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_PARSE_START_ENABLED() __builtin_expect (query__parse__start_semaphore, 0)
#define mysql_query__parse__start_semaphore query__parse__start_semaphore
#else
#define MYSQL_QUERY_PARSE_START_ENABLED() __builtin_expect (mysql_query__parse__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__parse__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_PARSE_START(arg1) \
DTRACE_PROBE1 (mysql, query__parse__start, arg1)

/* MYSQL_QUERY_PARSE_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_PARSE_DONE_ENABLED() __builtin_expect (query__parse__done_semaphore, 0)
#define mysql_query__parse__done_semaphore query__parse__done_semaphore
#else
#define MYSQL_QUERY_PARSE_DONE_ENABLED() __builtin_expect (mysql_query__parse__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__parse__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_PARSE_DONE(arg1) \
DTRACE_PROBE1 (mysql, query__parse__done, arg1)

/* MYSQL_QUERY_CACHE_HIT ( char * query, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_CACHE_HIT_ENABLED() __builtin_expect (query__cache__hit_semaphore, 0)
#define mysql_query__cache__hit_semaphore query__cache__hit_semaphore
#else
#define MYSQL_QUERY_CACHE_HIT_ENABLED() __builtin_expect (mysql_query__cache__hit_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__cache__hit_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_CACHE_HIT(arg1, arg2) \
DTRACE_PROBE2 (mysql, query__cache__hit, arg1, arg2)

/* MYSQL_QUERY_CACHE_MISS ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_CACHE_MISS_ENABLED() __builtin_expect (query__cache__miss_semaphore, 0)
#define mysql_query__cache__miss_semaphore query__cache__miss_semaphore
#else
#define MYSQL_QUERY_CACHE_MISS_ENABLED() __builtin_expect (mysql_query__cache__miss_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__cache__miss_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_CACHE_MISS(arg1) \
DTRACE_PROBE1 (mysql, query__cache__miss, arg1)

/* MYSQL_QUERY_EXEC_START ( char * query, unsigned long connid, char * db_name, char * user, char * host, int exec_type ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_EXEC_START_ENABLED() __builtin_expect (query__exec__start_semaphore, 0)
#define mysql_query__exec__start_semaphore query__exec__start_semaphore
#else
#define MYSQL_QUERY_EXEC_START_ENABLED() __builtin_expect (mysql_query__exec__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__exec__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_EXEC_START(arg1, arg2, arg3, arg4, arg5, arg6) \
DTRACE_PROBE6 (mysql, query__exec__start, arg1, arg2, arg3, arg4, arg5, arg6)

/* MYSQL_QUERY_EXEC_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_QUERY_EXEC_DONE_ENABLED() __builtin_expect (query__exec__done_semaphore, 0)
#define mysql_query__exec__done_semaphore query__exec__done_semaphore
#else
#define MYSQL_QUERY_EXEC_DONE_ENABLED() __builtin_expect (mysql_query__exec__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_query__exec__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_QUERY_EXEC_DONE(arg1) \
DTRACE_PROBE1 (mysql, query__exec__done, arg1)

/* MYSQL_INSERT_ROW_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_INSERT_ROW_START_ENABLED() __builtin_expect (insert__row__start_semaphore, 0)
#define mysql_insert__row__start_semaphore insert__row__start_semaphore
#else
#define MYSQL_INSERT_ROW_START_ENABLED() __builtin_expect (mysql_insert__row__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_insert__row__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INSERT_ROW_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, insert__row__start, arg1, arg2)

/* MYSQL_INSERT_ROW_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_INSERT_ROW_DONE_ENABLED() __builtin_expect (insert__row__done_semaphore, 0)
#define mysql_insert__row__done_semaphore insert__row__done_semaphore
#else
#define MYSQL_INSERT_ROW_DONE_ENABLED() __builtin_expect (mysql_insert__row__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_insert__row__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INSERT_ROW_DONE(arg1) \
DTRACE_PROBE1 (mysql, insert__row__done, arg1)

/* MYSQL_UPDATE_ROW_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_UPDATE_ROW_START_ENABLED() __builtin_expect (update__row__start_semaphore, 0)
#define mysql_update__row__start_semaphore update__row__start_semaphore
#else
#define MYSQL_UPDATE_ROW_START_ENABLED() __builtin_expect (mysql_update__row__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_update__row__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_UPDATE_ROW_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, update__row__start, arg1, arg2)

/* MYSQL_UPDATE_ROW_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_UPDATE_ROW_DONE_ENABLED() __builtin_expect (update__row__done_semaphore, 0)
#define mysql_update__row__done_semaphore update__row__done_semaphore
#else
#define MYSQL_UPDATE_ROW_DONE_ENABLED() __builtin_expect (mysql_update__row__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_update__row__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_UPDATE_ROW_DONE(arg1) \
DTRACE_PROBE1 (mysql, update__row__done, arg1)

/* MYSQL_DELETE_ROW_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_DELETE_ROW_START_ENABLED() __builtin_expect (delete__row__start_semaphore, 0)
#define mysql_delete__row__start_semaphore delete__row__start_semaphore
#else
#define MYSQL_DELETE_ROW_START_ENABLED() __builtin_expect (mysql_delete__row__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_delete__row__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_DELETE_ROW_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, delete__row__start, arg1, arg2)

/* MYSQL_DELETE_ROW_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_DELETE_ROW_DONE_ENABLED() __builtin_expect (delete__row__done_semaphore, 0)
#define mysql_delete__row__done_semaphore delete__row__done_semaphore
#else
#define MYSQL_DELETE_ROW_DONE_ENABLED() __builtin_expect (mysql_delete__row__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_delete__row__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_DELETE_ROW_DONE(arg1) \
DTRACE_PROBE1 (mysql, delete__row__done, arg1)

/* MYSQL_READ_ROW_START ( char * db, char * table, int scan_flag ) */
#if defined STAP_SDT_V1
#define MYSQL_READ_ROW_START_ENABLED() __builtin_expect (read__row__start_semaphore, 0)
#define mysql_read__row__start_semaphore read__row__start_semaphore
#else
#define MYSQL_READ_ROW_START_ENABLED() __builtin_expect (mysql_read__row__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_read__row__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_READ_ROW_START(arg1, arg2, arg3) \
DTRACE_PROBE3 (mysql, read__row__start, arg1, arg2, arg3)

/* MYSQL_READ_ROW_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_READ_ROW_DONE_ENABLED() __builtin_expect (read__row__done_semaphore, 0)
#define mysql_read__row__done_semaphore read__row__done_semaphore
#else
#define MYSQL_READ_ROW_DONE_ENABLED() __builtin_expect (mysql_read__row__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_read__row__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_READ_ROW_DONE(arg1) \
DTRACE_PROBE1 (mysql, read__row__done, arg1)

/* MYSQL_INDEX_READ_ROW_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_INDEX_READ_ROW_START_ENABLED() __builtin_expect (index__read__row__start_semaphore, 0)
#define mysql_index__read__row__start_semaphore index__read__row__start_semaphore
#else
#define MYSQL_INDEX_READ_ROW_START_ENABLED() __builtin_expect (mysql_index__read__row__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_index__read__row__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INDEX_READ_ROW_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, index__read__row__start, arg1, arg2)

/* MYSQL_INDEX_READ_ROW_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() __builtin_expect (index__read__row__done_semaphore, 0)
#define mysql_index__read__row__done_semaphore index__read__row__done_semaphore
#else
#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() __builtin_expect (mysql_index__read__row__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_index__read__row__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INDEX_READ_ROW_DONE(arg1) \
DTRACE_PROBE1 (mysql, index__read__row__done, arg1)

/* MYSQL_HANDLER_RDLOCK_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_HANDLER_RDLOCK_START_ENABLED() __builtin_expect (handler__rdlock__start_semaphore, 0)
#define mysql_handler__rdlock__start_semaphore handler__rdlock__start_semaphore
#else
#define MYSQL_HANDLER_RDLOCK_START_ENABLED() __builtin_expect (mysql_handler__rdlock__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_handler__rdlock__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_HANDLER_RDLOCK_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, handler__rdlock__start, arg1, arg2)

/* MYSQL_HANDLER_WRLOCK_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_HANDLER_WRLOCK_START_ENABLED() __builtin_expect (handler__wrlock__start_semaphore, 0)
#define mysql_handler__wrlock__start_semaphore handler__wrlock__start_semaphore
#else
#define MYSQL_HANDLER_WRLOCK_START_ENABLED() __builtin_expect (mysql_handler__wrlock__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_handler__wrlock__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_HANDLER_WRLOCK_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, handler__wrlock__start, arg1, arg2)

/* MYSQL_HANDLER_UNLOCK_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_HANDLER_UNLOCK_START_ENABLED() __builtin_expect (handler__unlock__start_semaphore, 0)
#define mysql_handler__unlock__start_semaphore handler__unlock__start_semaphore
#else
#define MYSQL_HANDLER_UNLOCK_START_ENABLED() __builtin_expect (mysql_handler__unlock__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_handler__unlock__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_HANDLER_UNLOCK_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, handler__unlock__start, arg1, arg2)

/* MYSQL_HANDLER_RDLOCK_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() __builtin_expect (handler__rdlock__done_semaphore, 0)
#define mysql_handler__rdlock__done_semaphore handler__rdlock__done_semaphore
#else
#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() __builtin_expect (mysql_handler__rdlock__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_handler__rdlock__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_HANDLER_RDLOCK_DONE(arg1) \
DTRACE_PROBE1 (mysql, handler__rdlock__done, arg1)

/* MYSQL_HANDLER_WRLOCK_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() __builtin_expect (handler__wrlock__done_semaphore, 0)
#define mysql_handler__wrlock__done_semaphore handler__wrlock__done_semaphore
#else
#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() __builtin_expect (mysql_handler__wrlock__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_handler__wrlock__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_HANDLER_WRLOCK_DONE(arg1) \
DTRACE_PROBE1 (mysql, handler__wrlock__done, arg1)

/* MYSQL_HANDLER_UNLOCK_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() __builtin_expect (handler__unlock__done_semaphore, 0)
#define mysql_handler__unlock__done_semaphore handler__unlock__done_semaphore
#else
#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() __builtin_expect (mysql_handler__unlock__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_handler__unlock__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_HANDLER_UNLOCK_DONE(arg1) \
DTRACE_PROBE1 (mysql, handler__unlock__done, arg1)

/* MYSQL_FILESORT_START ( char * db, char * table ) */
#if defined STAP_SDT_V1
#define MYSQL_FILESORT_START_ENABLED() __builtin_expect (filesort__start_semaphore, 0)
#define mysql_filesort__start_semaphore filesort__start_semaphore
#else
#define MYSQL_FILESORT_START_ENABLED() __builtin_expect (mysql_filesort__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_filesort__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_FILESORT_START(arg1, arg2) \
DTRACE_PROBE2 (mysql, filesort__start, arg1, arg2)

/* MYSQL_FILESORT_DONE ( int status, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_FILESORT_DONE_ENABLED() __builtin_expect (filesort__done_semaphore, 0)
#define mysql_filesort__done_semaphore filesort__done_semaphore
#else
#define MYSQL_FILESORT_DONE_ENABLED() __builtin_expect (mysql_filesort__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_filesort__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_FILESORT_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, filesort__done, arg1, arg2)

/* MYSQL_SELECT_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_SELECT_START_ENABLED() __builtin_expect (select__start_semaphore, 0)
#define mysql_select__start_semaphore select__start_semaphore
#else
#define MYSQL_SELECT_START_ENABLED() __builtin_expect (mysql_select__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_select__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_SELECT_START(arg1) \
DTRACE_PROBE1 (mysql, select__start, arg1)

/* MYSQL_SELECT_DONE ( int status, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_SELECT_DONE_ENABLED() __builtin_expect (select__done_semaphore, 0)
#define mysql_select__done_semaphore select__done_semaphore
#else
#define MYSQL_SELECT_DONE_ENABLED() __builtin_expect (mysql_select__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_select__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_SELECT_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, select__done, arg1, arg2)

/* MYSQL_INSERT_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_INSERT_START_ENABLED() __builtin_expect (insert__start_semaphore, 0)
#define mysql_insert__start_semaphore insert__start_semaphore
#else
#define MYSQL_INSERT_START_ENABLED() __builtin_expect (mysql_insert__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_insert__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INSERT_START(arg1) \
DTRACE_PROBE1 (mysql, insert__start, arg1)

/* MYSQL_INSERT_DONE ( int status, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_INSERT_DONE_ENABLED() __builtin_expect (insert__done_semaphore, 0)
#define mysql_insert__done_semaphore insert__done_semaphore
#else
#define MYSQL_INSERT_DONE_ENABLED() __builtin_expect (mysql_insert__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_insert__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INSERT_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, insert__done, arg1, arg2)

/* MYSQL_INSERT_SELECT_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_INSERT_SELECT_START_ENABLED() __builtin_expect (insert__select__start_semaphore, 0)
#define mysql_insert__select__start_semaphore insert__select__start_semaphore
#else
#define MYSQL_INSERT_SELECT_START_ENABLED() __builtin_expect (mysql_insert__select__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_insert__select__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INSERT_SELECT_START(arg1) \
DTRACE_PROBE1 (mysql, insert__select__start, arg1)

/* MYSQL_INSERT_SELECT_DONE ( int status, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_INSERT_SELECT_DONE_ENABLED() __builtin_expect (insert__select__done_semaphore, 0)
#define mysql_insert__select__done_semaphore insert__select__done_semaphore
#else
#define MYSQL_INSERT_SELECT_DONE_ENABLED() __builtin_expect (mysql_insert__select__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_insert__select__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_INSERT_SELECT_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, insert__select__done, arg1, arg2)

/* MYSQL_UPDATE_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_UPDATE_START_ENABLED() __builtin_expect (update__start_semaphore, 0)
#define mysql_update__start_semaphore update__start_semaphore
#else
#define MYSQL_UPDATE_START_ENABLED() __builtin_expect (mysql_update__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_update__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_UPDATE_START(arg1) \
DTRACE_PROBE1 (mysql, update__start, arg1)

/* MYSQL_UPDATE_DONE ( int status, unsigned long rowsmatches, unsigned long rowschanged ) */
#if defined STAP_SDT_V1
#define MYSQL_UPDATE_DONE_ENABLED() __builtin_expect (update__done_semaphore, 0)
#define mysql_update__done_semaphore update__done_semaphore
#else
#define MYSQL_UPDATE_DONE_ENABLED() __builtin_expect (mysql_update__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_update__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_UPDATE_DONE(arg1, arg2, arg3) \
DTRACE_PROBE3 (mysql, update__done, arg1, arg2, arg3)

/* MYSQL_MULTI_UPDATE_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_MULTI_UPDATE_START_ENABLED() __builtin_expect (multi__update__start_semaphore, 0)
#define mysql_multi__update__start_semaphore multi__update__start_semaphore
#else
#define MYSQL_MULTI_UPDATE_START_ENABLED() __builtin_expect (mysql_multi__update__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_multi__update__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_MULTI_UPDATE_START(arg1) \
DTRACE_PROBE1 (mysql, multi__update__start, arg1)

/* MYSQL_MULTI_UPDATE_DONE ( int status, unsigned long rowsmatches, unsigned long rowschanged ) */
#if defined STAP_SDT_V1
#define MYSQL_MULTI_UPDATE_DONE_ENABLED() __builtin_expect (multi__update__done_semaphore, 0)
#define mysql_multi__update__done_semaphore multi__update__done_semaphore
#else
#define MYSQL_MULTI_UPDATE_DONE_ENABLED() __builtin_expect (mysql_multi__update__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_multi__update__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_MULTI_UPDATE_DONE(arg1, arg2, arg3) \
DTRACE_PROBE3 (mysql, multi__update__done, arg1, arg2, arg3)

/* MYSQL_DELETE_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_DELETE_START_ENABLED() __builtin_expect (delete__start_semaphore, 0)
#define mysql_delete__start_semaphore delete__start_semaphore
#else
#define MYSQL_DELETE_START_ENABLED() __builtin_expect (mysql_delete__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_delete__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_DELETE_START(arg1) \
DTRACE_PROBE1 (mysql, delete__start, arg1)

/* MYSQL_DELETE_DONE ( int status, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_DELETE_DONE_ENABLED() __builtin_expect (delete__done_semaphore, 0)
#define mysql_delete__done_semaphore delete__done_semaphore
#else
#define MYSQL_DELETE_DONE_ENABLED() __builtin_expect (mysql_delete__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_delete__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_DELETE_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, delete__done, arg1, arg2)

/* MYSQL_MULTI_DELETE_START ( char * query ) */
#if defined STAP_SDT_V1
#define MYSQL_MULTI_DELETE_START_ENABLED() __builtin_expect (multi__delete__start_semaphore, 0)
#define mysql_multi__delete__start_semaphore multi__delete__start_semaphore
#else
#define MYSQL_MULTI_DELETE_START_ENABLED() __builtin_expect (mysql_multi__delete__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_multi__delete__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_MULTI_DELETE_START(arg1) \
DTRACE_PROBE1 (mysql, multi__delete__start, arg1)

/* MYSQL_MULTI_DELETE_DONE ( int status, unsigned long rows ) */
#if defined STAP_SDT_V1
#define MYSQL_MULTI_DELETE_DONE_ENABLED() __builtin_expect (multi__delete__done_semaphore, 0)
#define mysql_multi__delete__done_semaphore multi__delete__done_semaphore
#else
#define MYSQL_MULTI_DELETE_DONE_ENABLED() __builtin_expect (mysql_multi__delete__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_multi__delete__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_MULTI_DELETE_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, multi__delete__done, arg1, arg2)

/* MYSQL_NET_READ_START ( ) */
#if defined STAP_SDT_V1
#define MYSQL_NET_READ_START_ENABLED() __builtin_expect (net__read__start_semaphore, 0)
#define mysql_net__read__start_semaphore net__read__start_semaphore
#else
#define MYSQL_NET_READ_START_ENABLED() __builtin_expect (mysql_net__read__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_net__read__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_NET_READ_START() \
DTRACE_PROBE (mysql, net__read__start)

/* MYSQL_NET_READ_DONE ( int status, unsigned long bytes ) */
#if defined STAP_SDT_V1
#define MYSQL_NET_READ_DONE_ENABLED() __builtin_expect (net__read__done_semaphore, 0)
#define mysql_net__read__done_semaphore net__read__done_semaphore
#else
#define MYSQL_NET_READ_DONE_ENABLED() __builtin_expect (mysql_net__read__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_net__read__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_NET_READ_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, net__read__done, arg1, arg2)

/* MYSQL_NET_WRITE_START ( unsigned long bytes ) */
#if defined STAP_SDT_V1
#define MYSQL_NET_WRITE_START_ENABLED() __builtin_expect (net__write__start_semaphore, 0)
#define mysql_net__write__start_semaphore net__write__start_semaphore
#else
#define MYSQL_NET_WRITE_START_ENABLED() __builtin_expect (mysql_net__write__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_net__write__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_NET_WRITE_START(arg1) \
DTRACE_PROBE1 (mysql, net__write__start, arg1)

/* MYSQL_NET_WRITE_DONE ( int status ) */
#if defined STAP_SDT_V1
#define MYSQL_NET_WRITE_DONE_ENABLED() __builtin_expect (net__write__done_semaphore, 0)
#define mysql_net__write__done_semaphore net__write__done_semaphore
#else
#define MYSQL_NET_WRITE_DONE_ENABLED() __builtin_expect (mysql_net__write__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_net__write__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_NET_WRITE_DONE(arg1) \
DTRACE_PROBE1 (mysql, net__write__done, arg1)

/* MYSQL_KEYCACHE_READ_START ( char * filepath, unsigned long bytes, unsigned long mem_used, unsigned long mem_free ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_READ_START_ENABLED() __builtin_expect (keycache__read__start_semaphore, 0)
#define mysql_keycache__read__start_semaphore keycache__read__start_semaphore
#else
#define MYSQL_KEYCACHE_READ_START_ENABLED() __builtin_expect (mysql_keycache__read__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__read__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_READ_START(arg1, arg2, arg3, arg4) \
DTRACE_PROBE4 (mysql, keycache__read__start, arg1, arg2, arg3, arg4)

/* MYSQL_KEYCACHE_READ_BLOCK ( unsigned long bytes ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() __builtin_expect (keycache__read__block_semaphore, 0)
#define mysql_keycache__read__block_semaphore keycache__read__block_semaphore
#else
#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() __builtin_expect (mysql_keycache__read__block_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__read__block_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_READ_BLOCK(arg1) \
DTRACE_PROBE1 (mysql, keycache__read__block, arg1)

/* MYSQL_KEYCACHE_READ_HIT ( ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_READ_HIT_ENABLED() __builtin_expect (keycache__read__hit_semaphore, 0)
#define mysql_keycache__read__hit_semaphore keycache__read__hit_semaphore
#else
#define MYSQL_KEYCACHE_READ_HIT_ENABLED() __builtin_expect (mysql_keycache__read__hit_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__read__hit_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_READ_HIT() \
DTRACE_PROBE (mysql, keycache__read__hit)

/* MYSQL_KEYCACHE_READ_MISS ( ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_READ_MISS_ENABLED() __builtin_expect (keycache__read__miss_semaphore, 0)
#define mysql_keycache__read__miss_semaphore keycache__read__miss_semaphore
#else
#define MYSQL_KEYCACHE_READ_MISS_ENABLED() __builtin_expect (mysql_keycache__read__miss_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__read__miss_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_READ_MISS() \
DTRACE_PROBE (mysql, keycache__read__miss)

/* MYSQL_KEYCACHE_READ_DONE ( unsigned long mem_used, unsigned long mem_free ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_READ_DONE_ENABLED() __builtin_expect (keycache__read__done_semaphore, 0)
#define mysql_keycache__read__done_semaphore keycache__read__done_semaphore
#else
#define MYSQL_KEYCACHE_READ_DONE_ENABLED() __builtin_expect (mysql_keycache__read__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__read__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_READ_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, keycache__read__done, arg1, arg2)

/* MYSQL_KEYCACHE_WRITE_START ( char * filepath, unsigned long bytes, unsigned long mem_used, unsigned long mem_free ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_WRITE_START_ENABLED() __builtin_expect (keycache__write__start_semaphore, 0)
#define mysql_keycache__write__start_semaphore keycache__write__start_semaphore
#else
#define MYSQL_KEYCACHE_WRITE_START_ENABLED() __builtin_expect (mysql_keycache__write__start_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__write__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_WRITE_START(arg1, arg2, arg3, arg4) \
DTRACE_PROBE4 (mysql, keycache__write__start, arg1, arg2, arg3, arg4)

/* MYSQL_KEYCACHE_WRITE_BLOCK ( unsigned long bytes ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() __builtin_expect (keycache__write__block_semaphore, 0)
#define mysql_keycache__write__block_semaphore keycache__write__block_semaphore
#else
#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() __builtin_expect (mysql_keycache__write__block_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__write__block_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_WRITE_BLOCK(arg1) \
DTRACE_PROBE1 (mysql, keycache__write__block, arg1)

/* MYSQL_KEYCACHE_WRITE_DONE ( unsigned long mem_used, unsigned long mem_free ) */
#if defined STAP_SDT_V1
#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() __builtin_expect (keycache__write__done_semaphore, 0)
#define mysql_keycache__write__done_semaphore keycache__write__done_semaphore
#else
#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() __builtin_expect (mysql_keycache__write__done_semaphore, 0)
#endif
__extension__ extern unsigned short mysql_keycache__write__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
#define MYSQL_KEYCACHE_WRITE_DONE(arg1, arg2) \
DTRACE_PROBE2 (mysql, keycache__write__done, arg1, arg2)

server/private/slave.h000064400000027763150400264000011015 0ustar00/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
   Copyright (c) 2009, 2016, MariaDB

   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 */

#ifndef SLAVE_H
#define SLAVE_H

/**
  MASTER_DELAY can be at most (1 << 31) - 1.
*/
#define MASTER_DELAY_MAX (0x7FFFFFFF)
#if INT_MAX < 0x7FFFFFFF
#error "don't support platforms where INT_MAX < 0x7FFFFFFF"
#endif

/**
  @defgroup Replication Replication
  @{

  @file
*/

/** 
   Some of defines are need in parser even though replication is not 
   compiled in (embedded).
*/

/**
   The maximum is defined as (ULONG_MAX/1000) with 4 bytes ulong
*/
#define SLAVE_MAX_HEARTBEAT_PERIOD 4294967

#ifdef HAVE_REPLICATION

#include "log.h"
#include "my_list.h"
#include "rpl_filter.h"
#include "rpl_tblmap.h"
#include "rpl_gtid.h"
#include "log_event.h"

#define SLAVE_NET_TIMEOUT  60

#define MAX_SLAVE_ERROR    ER_ERROR_LAST+1

#define MAX_REPLICATION_THREAD 64

// Forward declarations
class Relay_log_info;
class Master_info;
class Master_info_index;
struct rpl_group_info;
struct rpl_parallel_thread;

int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
                          const char *default_val);
int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val);
int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f);

/*****************************************************************************

  MySQL Replication

  Replication is implemented via two types of threads:

    I/O Thread - One of these threads is started for each master server.
                 They maintain a connection to their master server, read log
                 events from the master as they arrive, and queues them into
                 a single, shared relay log file.  A Master_info 
                 represents each of these threads.

    SQL Thread - One of these threads is started and reads from the relay log
                 file, executing each event.  A Relay_log_info 
                 represents this thread.

  Buffering in the relay log file makes it unnecessary to reread events from
  a master server across a slave restart.  It also decouples the slave from
  the master where long-running updates and event logging are concerned--ie
  it can continue to log new events while a slow query executes on the slave.

*****************************************************************************/

/*
  MUTEXES in replication:

  LOCK_active_mi: [note: this was originally meant for multimaster, to switch
  from a master to another, to protect active_mi] It is used to SERIALIZE ALL
  administrative commands of replication: START SLAVE, STOP SLAVE, CHANGE
  MASTER, RESET SLAVE, end_slave() (when mysqld stops) [init_slave() does not
  need it it's called early]. Any of these commands holds the mutex from the
  start till the end. This thus protects us against a handful of deadlocks
  (consider start_slave_thread() which, when starting the I/O thread, releases
  mi->run_lock, keeps rli->run_lock, and tries to re-acquire mi->run_lock).

  Currently active_mi never moves (it's created at startup and deleted at
  shutdown, and not changed: it always points to the same Master_info struct),
  because we don't have multimaster. So for the moment, mi does not move, and
  mi->rli does not either.

  In Master_info: run_lock, data_lock
  run_lock protects all information about the run state: slave_running, thd
  and the existence of the I/O thread (to stop/start it, you need this mutex).
  data_lock protects some moving members of the struct: counters (log name,
  position) and relay log (MYSQL_BIN_LOG object).

  In Relay_log_info: run_lock, data_lock
  see Master_info
  However, note that run_lock does not protect
  Relay_log_info.run_state; that is protected by data_lock.
  
  Order of acquisition: if you want to have LOCK_active_mi and a run_lock, you
  must acquire LOCK_active_mi first.

  In MYSQL_BIN_LOG: LOCK_log, LOCK_index of the binlog and the relay log
  LOCK_log: when you write to it. LOCK_index: when you create/delete a binlog
  (so that you have to update the .index file).
*/

extern ulong master_retry_count;
extern MY_BITMAP slave_error_mask;
extern char slave_skip_error_names[];
extern bool use_slave_mask;
extern char slave_transaction_retry_error_names[];
extern uint *slave_transaction_retry_errors;
extern uint slave_transaction_retry_error_length;
extern char *slave_load_tmpdir;
extern char *master_info_file;
extern MYSQL_PLUGIN_IMPORT char *relay_log_info_file;
extern char *opt_relay_logname, *opt_relaylog_index_name;
extern my_bool opt_skip_slave_start, opt_reckless_slave;
extern my_bool opt_log_slave_updates;
extern char *opt_slave_skip_errors;
extern char *opt_slave_transaction_retry_errors;
extern my_bool opt_replicate_annotate_row_events;
extern ulonglong relay_log_space_limit;
extern ulonglong opt_read_binlog_speed_limit;
extern ulonglong slave_skipped_errors;
extern const char *relay_log_index;
extern const char *relay_log_basename;

/*
  4 possible values for Master_info::slave_running and
  Relay_log_info::slave_running.
  The values 0,1,2,3 are very important: to keep the diff small, I didn't
  substitute places where we use 0/1 with the newly defined symbols.
  So don't change these values.
  The same way, code is assuming that in Relay_log_info we use only values
  0/1.
  I started with using an enum, but
  enum_variable=1; is not legal so would have required many line changes.
*/
#define MYSQL_SLAVE_NOT_RUN         0
#define MYSQL_SLAVE_RUN_NOT_CONNECT 1
#define MYSQL_SLAVE_RUN_CONNECT     2
#define MYSQL_SLAVE_RUN_READING     3

#define RPL_LOG_NAME (rli->group_master_log_name[0] ? rli->group_master_log_name :\
 "FIRST")
#define IO_RPL_LOG_NAME (mi->master_log_name[0] ? mi->master_log_name :\
 "FIRST")

/*
  If the following is set, if first gives an error, second will be
  tried. Otherwise, if first fails, we fail.
*/
#define SLAVE_FORCE_ALL 4

/*
  Values for the option --replicate-events-marked-for-skip.
  Must match the names in replicate_events_marked_for_skip_names in sys_vars.cc
*/
#define RPL_SKIP_REPLICATE 0
#define RPL_SKIP_FILTER_ON_SLAVE 1
#define RPL_SKIP_FILTER_ON_MASTER 2


int init_slave();
int init_recovery(Master_info* mi, const char** errmsg);
bool init_slave_skip_errors(const char* arg);
bool init_slave_transaction_retry_errors(const char* arg);
int register_slave_on_master(MYSQL* mysql);
int terminate_slave_threads(Master_info* mi, int thread_mask,
			     bool skip_lock = 0);
int start_slave_threads(THD *thd,
                        bool need_slave_mutex, bool wait_for_start,
			Master_info* mi, const char* master_info_fname,
			const char* slave_info_fname, int thread_mask);
/*
  cond_lock is usually same as start_lock. It is needed for the case when
  start_lock is 0 which happens if start_slave_thread() is called already
  inside the start_lock section, but at the same time we want a
  mysql_cond_wait() on start_cond, start_lock
*/
int start_slave_thread(
#ifdef HAVE_PSI_INTERFACE
                       PSI_thread_key thread_key,
#endif
                       pthread_handler h_func,
                       mysql_mutex_t *start_lock,
                       mysql_mutex_t *cond_lock,
                       mysql_cond_t *start_cond,
                       volatile uint *slave_running,
                       volatile ulong *slave_run_id,
                       Master_info *mi);

/* If fd is -1, dump to NET */
int mysql_table_dump(THD* thd, const char* db,
		     const char* tbl_name, int fd = -1);

/* retrieve table from master and copy to slave*/
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
		       Master_info* mi, MYSQL* mysql, bool overwrite);

void show_master_info_get_fields(THD *thd, List<Item> *field_list,
                                     bool full, size_t gtid_pos_length);
bool show_master_info(THD* thd, Master_info* mi, bool full);
bool show_all_master_info(THD* thd);
void show_binlog_info_get_fields(THD *thd, List<Item> *field_list);
bool show_binlog_info(THD* thd);
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
                        bool (*pred)(const void *), const void *param,
                        bool maria_master= false);
bool rpl_master_erroneous_autoinc(THD* thd);

const char *print_slave_db_safe(const char *db);
void skip_load_data_infile(NET* net);

void slave_prepare_for_shutdown();
void end_slave(); /* release slave threads */
void close_active_mi(); /* clean up slave threads data */
void clear_until_condition(Relay_log_info* rli);
void clear_slave_error(Relay_log_info* rli);
void end_relay_log_info(Relay_log_info* rli);
void init_thread_mask(int* mask,Master_info* mi,bool inverse);
Format_description_log_event *
read_relay_log_description_event(IO_CACHE *cur_log, ulonglong start_pos,
                                 const char **errmsg);

int init_relay_log_pos(Relay_log_info* rli,const char* log,ulonglong pos,
		       bool need_data_lock, const char** errmsg,
                       bool look_for_description_event);

int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
		     const char** errmsg);
void set_slave_thread_options(THD* thd);
void set_slave_thread_default_charset(THD *thd, rpl_group_info *rgi);
int rotate_relay_log(Master_info* mi);
int has_temporary_error(THD *thd);
int sql_delay_event(Log_event *ev, THD *thd, rpl_group_info *rgi);
int apply_event_and_update_pos(Log_event* ev, THD* thd,
                               struct rpl_group_info *rgi);
int apply_event_and_update_pos_for_parallel(Log_event* ev, THD* thd,
                                            struct rpl_group_info *rgi);

int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val);
int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
                          const char *default_val);
int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f);

pthread_handler_t handle_slave_io(void *arg);
void slave_output_error_info(rpl_group_info *rgi, THD *thd);
pthread_handler_t handle_slave_sql(void *arg);
bool net_request_file(NET* net, const char* fname);
void slave_background_kill_request(THD *to_kill);
void slave_background_gtid_pos_create_request
        (rpl_slave_state::gtid_pos_table *table_entry);
void slave_background_gtid_pending_delete_request(void);

extern Master_info *active_mi; /* active_mi for multi-master */
extern Master_info *default_master_info; /* To replace active_mi */
extern Master_info_index *master_info_index;
extern LEX_CSTRING default_master_connection_name;
extern my_bool replicate_same_server_id;

extern int disconnect_slave_event_count, abort_slave_event_count ;

/* the master variables are defaults read from my.cnf or command line */
extern uint report_port;
extern char *master_info_file, *report_user;
extern char *report_host, *report_password;

extern I_List<THD> threads;

/*
  Check that a binlog event (read from the relay log) is valid to update
  last_master_timestamp. That is, a valid event is one with a consistent
  timestamp which originated from a primary server.
*/
static inline bool event_can_update_last_master_timestamp(Log_event *ev)
{
  return ev && !(ev->is_artificial_event() || ev->is_relay_log_event() ||
                 (ev->when == 0));
}

#else
#define close_active_mi() /* no-op */
#endif /* HAVE_REPLICATION */

/* masks for start/stop operations on io and sql slave threads */
#define SLAVE_IO  1
#define SLAVE_SQL 2

/**
  @} (end of group Replication)
*/

#endif
server/private/sql_cmd.h000064400000022315150400264000011311 0ustar00/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @file Representation of an SQL command.
*/

#ifndef SQL_CMD_INCLUDED
#define SQL_CMD_INCLUDED

/*
  When a command is added here, be sure it's also added in mysqld.cc
  in "struct show_var_st status_vars[]= {" ...

  If the command returns a result set or is not allowed in stored
  functions or triggers, please also make sure that
  sp_get_flags_for_command (sp_head.cc) returns proper flags for the
  added SQLCOM_.
*/

enum enum_sql_command {
  SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE,
  SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT,
  SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX,

  SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
  SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS,
  SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX,
  SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_BINLOG_STAT, SQLCOM_SHOW_SLAVE_STAT,
  SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
  SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
  SQLCOM_SHOW_TRIGGERS,

  SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
  SQLCOM_GRANT,
  SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB,
  SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT,
  SQLCOM_CREATE_FUNCTION, SQLCOM_DROP_FUNCTION,
  SQLCOM_REVOKE,SQLCOM_OPTIMIZE, SQLCOM_CHECK,
  SQLCOM_ASSIGN_TO_KEYCACHE, SQLCOM_PRELOAD_KEYS,
  SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE,
  SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
  SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
  SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
  SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER,
  SQLCOM_RENAME_TABLE,  
  SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
  SQLCOM_SHOW_OPEN_TABLES,
  SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
  SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
  SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_DO,
  SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
  SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
  SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
  SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
  SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
  SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION,
  SQLCOM_SHOW_CREATE_PROC, SQLCOM_SHOW_CREATE_FUNC,
  SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC,
  SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE,
  SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW,
  SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
  SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
  SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
  SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
  SQLCOM_ALTER_TABLESPACE,
  SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
  SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
  SQLCOM_SHOW_PLUGINS, SQLCOM_SHOW_CONTRIBUTORS,
  SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER,
  SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
  SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
  SQLCOM_SHOW_CREATE_TRIGGER,
  SQLCOM_ALTER_DB_UPGRADE,
  SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
  SQLCOM_SIGNAL, SQLCOM_RESIGNAL,
  SQLCOM_SHOW_RELAYLOG_EVENTS,
  SQLCOM_GET_DIAGNOSTICS,
  SQLCOM_SHOW_CLIENT_STATS, SQLCOM_SHOW_THREAD_STATS, SQLCOM_ENABLE_GOVERNOR, SQLCOM_ENABLE_RECONN_GOVERNOR,
  SQLCOM_ENABLE_GOVERNOR_LVE, SQLCOM_ENABLE_RECONN_GOVERNOR_LVE,
  SQLCOM_SLAVE_ALL_START, SQLCOM_SLAVE_ALL_STOP,
  SQLCOM_SHOW_EXPLAIN, SQLCOM_SHUTDOWN,
  SQLCOM_CREATE_ROLE, SQLCOM_DROP_ROLE, SQLCOM_GRANT_ROLE, SQLCOM_REVOKE_ROLE,
  SQLCOM_COMPOUND,
  SQLCOM_SHOW_GENERIC,
  SQLCOM_ALTER_USER,
  SQLCOM_SHOW_CREATE_USER,
  SQLCOM_EXECUTE_IMMEDIATE,
  SQLCOM_CREATE_SEQUENCE,
  SQLCOM_DROP_SEQUENCE,
  SQLCOM_ALTER_SEQUENCE,
  SQLCOM_CREATE_PACKAGE,
  SQLCOM_DROP_PACKAGE,
  SQLCOM_CREATE_PACKAGE_BODY,
  SQLCOM_DROP_PACKAGE_BODY,
  SQLCOM_SHOW_CREATE_PACKAGE,
  SQLCOM_SHOW_CREATE_PACKAGE_BODY,
  SQLCOM_SHOW_STATUS_PACKAGE,
  SQLCOM_SHOW_STATUS_PACKAGE_BODY,
  SQLCOM_SHOW_PACKAGE_BODY_CODE,
  SQLCOM_BACKUP, SQLCOM_BACKUP_LOCK,

  /*
    When a command is added here, be sure it's also added in mysqld.cc
    in "struct show_var_st com_status_vars[]= {" ...
  */
  /* This should be the last !!! */
  SQLCOM_END
};


class Storage_engine_name
{
protected:
  LEX_CSTRING m_storage_engine_name;
public:
  Storage_engine_name()
  {
    m_storage_engine_name.str= NULL;
    m_storage_engine_name.length= 0;
  }
  Storage_engine_name(const LEX_CSTRING &name)
   :m_storage_engine_name(name)
  { }
  Storage_engine_name(const LEX_STRING &name)
  {
    m_storage_engine_name.str= name.str;
    m_storage_engine_name.length= name.length;
  }
  bool resolve_storage_engine_with_error(THD *thd,
                                         handlerton **ha,
                                         bool tmp_table);
  bool is_set() { return m_storage_engine_name.str != NULL; }
  const LEX_CSTRING *name() const { return &m_storage_engine_name; }
};


/**
  @class Sql_cmd - Representation of an SQL command.

  This class is an interface between the parser and the runtime.
  The parser builds the appropriate derived classes of Sql_cmd
  to represent a SQL statement in the parsed tree.
  The execute() method in the derived classes of Sql_cmd contain the runtime
  implementation.
  Note that this interface is used for SQL statements recently implemented,
  the code for older statements tend to load the LEX structure with more
  attributes instead.
  Implement new statements by sub-classing Sql_cmd, as this improves
  code modularity (see the 'big switch' in dispatch_command()), and decreases
  the total size of the LEX structure (therefore saving memory in stored
  programs).
  The recommended name of a derived class of Sql_cmd is Sql_cmd_<derived>.

  Notice that the Sql_cmd class should not be confused with the
  Statement class.  Statement is a class that is used to manage an SQL
  command or a set of SQL commands. When the SQL statement text is
  analyzed, the parser will create one or more Sql_cmd objects to
  represent the actual SQL commands.
*/
class Sql_cmd : public Sql_alloc
{
private:
  Sql_cmd(const Sql_cmd &);         // No copy constructor wanted
  void operator=(Sql_cmd &);        // No assignment operator wanted

public:
  /**
    @brief Return the command code for this statement
  */
  virtual enum_sql_command sql_command_code() const = 0;

  /**
    Execute this SQL statement.
    @param thd the current thread.
    @retval false on success.
    @retval true on error
  */
  virtual bool execute(THD *thd) = 0;

  virtual Storage_engine_name *option_storage_engine_name()
  {
    return NULL;
  }

protected:
  Sql_cmd() = default;

  virtual ~Sql_cmd()
  {
    /*
      Sql_cmd objects are allocated in thd->mem_root.
      In MySQL, the C++ destructor is never called, the underlying MEM_ROOT is
      simply destroyed instead.
      Do not rely on the destructor for any cleanup.
    */
    DBUG_ASSERT(FALSE);
  }
};

class Sql_cmd_show_slave_status: public Sql_cmd
{
protected:
  bool show_all_slaves_status;
public:
  Sql_cmd_show_slave_status()
    :show_all_slaves_status(false)
  {}

  Sql_cmd_show_slave_status(bool status_all)
    :show_all_slaves_status(status_all)
  {}

  enum_sql_command sql_command_code() const override { return SQLCOM_SHOW_SLAVE_STAT; }

  bool execute(THD *thd) override;
  bool is_show_all_slaves_stat() { return show_all_slaves_status; }
};


class Sql_cmd_create_table_like: public Sql_cmd,
                                 public Storage_engine_name
{
public:
  Storage_engine_name *option_storage_engine_name() override { return this; }
  bool execute(THD *thd) override;
};

class Sql_cmd_create_table: public Sql_cmd_create_table_like
{
public:
  enum_sql_command sql_command_code() const override { return SQLCOM_CREATE_TABLE; }
};

class Sql_cmd_create_sequence: public Sql_cmd_create_table_like
{
public:
  enum_sql_command sql_command_code() const override { return SQLCOM_CREATE_SEQUENCE; }
};


/**
  Sql_cmd_call represents the CALL statement.
*/
class Sql_cmd_call : public Sql_cmd
{
public:
  class sp_name *m_name;
  const class Sp_handler *m_handler;
  Sql_cmd_call(class sp_name *name, const class Sp_handler *handler)
   :m_name(name),
    m_handler(handler)
  {}

  virtual ~Sql_cmd_call() = default;

  /**
    Execute a CALL statement at runtime.
    @param thd the current thread.
    @return false on success.
  */
  bool execute(THD *thd) override;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_CALL;
  }
};

#endif // SQL_CMD_INCLUDED
server/private/debug.h000064400000002322150400264000010751 0ustar00#ifndef DEBUG_INCLUDED
#define DEBUG_INCLUDED

/* Copyright (c) 2021, 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 */

/**
  @file

  Declarations for debug_crash_here and other future mariadb server debug
  functionality.
*/

/* debug_crash_here() functionallity.
 See mysql_test/suite/atomic/create_table.test for an example of how it
 can be used
*/

#ifndef DBUG_OFF
void debug_crash_here(const char *keyword);
bool debug_simulate_error(const char *keyword, uint error);
#else
#define debug_crash_here(A) do { } while(0)
#define debug_simulate_error(A, B) 0
#endif

#endif /* DEBUG_INCLUDED */
server/private/item_timefunc.h000064400000176147150400264000012534 0ustar00#ifndef ITEM_TIMEFUNC_INCLUDED
#define ITEM_TIMEFUNC_INCLUDED
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
   Copyright (c) 2009-2011, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


/* Function items used by mysql */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

class MY_LOCALE;


bool get_interval_value(THD *thd, Item *args,
                        interval_type int_type, INTERVAL *interval);


class Item_long_func_date_field: public Item_long_ge0_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_date(func_name_cstring()); }
public:
  Item_long_func_date_field(THD *thd, Item *a)
   :Item_long_ge0_func(thd, a) { }
};


class Item_long_func_time_field: public Item_long_ge0_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_time(func_name_cstring()); }
public:
  Item_long_func_time_field(THD *thd, Item *a)
   :Item_long_ge0_func(thd, a) { }
};


class Item_func_period_add :public Item_long_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_int(0, 2); }
public:
  Item_func_period_add(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("period_add") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_period_add>(thd, this); }
};


class Item_func_period_diff :public Item_long_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_int(0, 2); }
public:
  Item_func_period_diff(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("period_diff") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_period_diff>(thd, this); }
};


class Item_func_to_days :public Item_long_func_date_field
{
public:
  Item_func_to_days(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("to_days") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0; 
    max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  enum_monotonicity_info get_monotonicity_info() const override;
  longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_to_days>(thd, this); }
};


class Item_func_to_seconds :public Item_longlong_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_date(0, arg_count); }
public:
  Item_func_to_seconds(THD *thd, Item *a): Item_longlong_func(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("to_seconds") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0; 
    fix_char_length(12);
    set_maybe_null();
    return FALSE;
  }
  enum_monotonicity_info get_monotonicity_info() const override;
  longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
  bool check_partition_func_processor(void *bool_arg) override { return FALSE;}

  /* Only meaningful with date part and optional time part */
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_to_seconds>(thd, this); }
};


class Item_func_dayofmonth :public Item_long_func_date_field
{
public:
  Item_func_dayofmonth(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("dayofmonth") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0; 
    max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dayofmonth>(thd, this); }
};


class Item_func_month :public Item_long_ge0_func
{
public:
  Item_func_month(THD *thd, Item *a): Item_long_ge0_func(thd, a)
  { }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("month") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals= 0;
    fix_char_length(2);
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_month>(thd, this); }
};


class Item_func_monthname :public Item_str_func
{
  MY_LOCALE *locale;
public:
  Item_func_monthname(THD *thd, Item *a): Item_str_func(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("monthname") };
    return name;
  }
  String *val_str(String *str) override;
  bool fix_length_and_dec() override;
  bool check_partition_func_processor(void *int_arg) override {return TRUE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_monthname>(thd, this); }
};


class Item_func_dayofyear :public Item_long_func_date_field
{
public:
  Item_func_dayofyear(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("dayofyear") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals= 0;
    fix_char_length(3);
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dayofyear>(thd, this); }
};


class Item_func_hour :public Item_long_func_time_field
{
public:
  Item_func_hour(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("hour") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_time_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_hour>(thd, this); }
};


class Item_func_minute :public Item_long_func_time_field
{
public:
  Item_func_minute(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("minute") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_time_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_minute>(thd, this); }
};


class Item_func_quarter :public Item_long_func_date_field
{
public:
  Item_func_quarter(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("quarter") };
    return name;
  }
  bool fix_length_and_dec() override
  {
     decimals=0;
     max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
     set_maybe_null();
     return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_quarter>(thd, this); }
};


class Item_func_second :public Item_long_func_time_field
{
public:
  Item_func_second(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("second") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_time_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_second>(thd, this); }
};


class Item_func_week :public Item_long_ge0_func
{
  bool check_arguments() const override
  {
    return args[0]->check_type_can_return_date(func_name_cstring()) ||
           (arg_count > 1 && args[1]->check_type_can_return_int(func_name_cstring()));
  }
public:
  Item_func_week(THD *thd, Item *a): Item_long_ge0_func(thd, a) {}
  Item_func_week(THD *thd, Item *a, Item *b): Item_long_ge0_func(thd, a, b) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("week") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    if (arg_count == 2)
      return FALSE;
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return arg_count == 2;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_week>(thd, this); }
};

class Item_func_yearweek :public Item_long_func
{
  bool check_arguments() const override
  {
    return args[0]->check_type_can_return_date(func_name_cstring()) ||
           args[1]->check_type_can_return_int(func_name_cstring());
  }
public:
  Item_func_yearweek(THD *thd, Item *a, Item *b)
   :Item_long_func(thd, a, b) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("yearweek") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_yearweek>(thd, this); }
};


class Item_func_year :public Item_long_func_date_field
{
public:
  Item_func_year(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("year") };
    return name;
  }
  enum_monotonicity_info get_monotonicity_info() const override;
  longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=4*MY_CHARSET_BIN_MB_MAXLEN;
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_year>(thd, this); }
};


class Item_func_weekday :public Item_long_func
{
  bool odbc_type;
public:
  Item_func_weekday(THD *thd, Item *a, bool type_arg):
    Item_long_func(thd, a), odbc_type(type_arg) { }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING dayofweek= {STRING_WITH_LEN("dayofweek") };
    static LEX_CSTRING weekday= {STRING_WITH_LEN("weekday") };
    return (odbc_type ? dayofweek : weekday);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
  bool fix_length_and_dec() override
  {
    decimals= 0;
    fix_char_length(1);
    set_maybe_null();
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_weekday>(thd, this); }
};

class Item_func_dayname :public Item_str_func
{
  MY_LOCALE *locale;
 public:
  Item_func_dayname(THD *thd, Item *a): Item_str_func(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("dayname") };
    return name;
  }
  String *val_str(String *str) override;
  const Type_handler *type_handler() const override
  { return &type_handler_varchar; }
  bool fix_length_and_dec() override;
  bool check_partition_func_processor(void *int_arg) override {return TRUE;}
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_date_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_dayname>(thd, this); }
};


class Item_func_seconds_hybrid: public Item_func_numhybrid
{
public:
  Item_func_seconds_hybrid(THD *thd): Item_func_numhybrid(thd) {}
  Item_func_seconds_hybrid(THD *thd, Item *a): Item_func_numhybrid(thd, a) {}
  void fix_length_and_dec_generic(uint dec)
  {
    DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
    decimals= dec;
    max_length=17 + (decimals ? decimals + 1 : 0);
    set_maybe_null();
    if (decimals)
      set_handler(&type_handler_newdecimal);
    else
      set_handler(type_handler_long_or_longlong());
  }
  double real_op() override { DBUG_ASSERT(0); return 0; }
  String *str_op(String *str) override { DBUG_ASSERT(0); return 0; }
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    DBUG_ASSERT(0);
    return true;
  }
};


class Item_func_unix_timestamp :public Item_func_seconds_hybrid
{
  bool get_timestamp_value(my_time_t *seconds, ulong *second_part);
public:
  Item_func_unix_timestamp(THD *thd): Item_func_seconds_hybrid(thd) {}
  Item_func_unix_timestamp(THD *thd, Item *a):
    Item_func_seconds_hybrid(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("unix_timestamp") };
    return name;
  }
  enum_monotonicity_info get_monotonicity_info() const override;
  longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  /*
    UNIX_TIMESTAMP() depends on the current timezone
    (and thus may not be used as a partitioning function)
    when its argument is NOT of the TIMESTAMP type.
  */
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_timestamp_args();
  }
  bool check_vcol_func_processor(void *arg) override
  {
    if (arg_count)
      return FALSE;
    return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
  }
  bool fix_length_and_dec() override
  {
    fix_length_and_dec_generic(arg_count ?
                               args[0]->datetime_precision(current_thd) : 0);
    return FALSE;
  }
  longlong int_op() override;
  my_decimal *decimal_op(my_decimal* buf) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_unix_timestamp>(thd, this); }
};


class Item_func_time_to_sec :public Item_func_seconds_hybrid
{
public:
  Item_func_time_to_sec(THD *thd, Item *item):
    Item_func_seconds_hybrid(thd, item) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("time_to_sec") };
    return name;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_time_args();
  }
  bool fix_length_and_dec() override
  {
    fix_length_and_dec_generic(args[0]->time_precision(current_thd));
    return FALSE;
  }
  longlong int_op() override;
  my_decimal *decimal_op(my_decimal* buf) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_time_to_sec>(thd, this); }
};


class Item_datefunc :public Item_func
{
public:
  Item_datefunc(THD *thd): Item_func(thd) { }
  Item_datefunc(THD *thd, Item *a): Item_func(thd, a) { }
  Item_datefunc(THD *thd, Item *a, Item *b): Item_func(thd, a, b) { }
  const Type_handler *type_handler() const override
  { return &type_handler_newdate; }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return Date(this).to_longlong();
  }
  double val_real() override
  { return Date(this).to_double(); }
  String *val_str(String *to) override
  { return Date(this).to_string(to); }
  my_decimal *val_decimal(my_decimal *to) override
  { return Date(this).to_decimal(to); }
  bool fix_length_and_dec() override
  {
    fix_attributes_date();
    set_maybe_null(arg_count > 0);
    return FALSE;
  }
};


class Item_timefunc :public Item_func
{
public:
  Item_timefunc(THD *thd): Item_func(thd) {}
  Item_timefunc(THD *thd, Item *a): Item_func(thd, a) {}
  Item_timefunc(THD *thd, Item *a, Item *b): Item_func(thd, a, b) {}
  Item_timefunc(THD *thd, Item *a, Item *b, Item *c): Item_func(thd, a, b ,c) {}
  const Type_handler *type_handler() const override
  { return &type_handler_time2; }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return Time(this).to_longlong();
  }
  double val_real() override
  { return Time(this).to_double(); }
  String *val_str(String *to) override
  { return Time(this).to_string(to, decimals); }
  my_decimal *val_decimal(my_decimal *to) override
  { return Time(this).to_decimal(to); }
  bool val_native(THD *thd, Native *to) override
  { return Time(thd, this).to_native(to, decimals); }
};


class Item_datetimefunc :public Item_func
{
public:
  Item_datetimefunc(THD *thd): Item_func(thd) {}
  Item_datetimefunc(THD *thd, Item *a): Item_func(thd, a) {}
  Item_datetimefunc(THD *thd, Item *a, Item *b): Item_func(thd, a, b) {}
  Item_datetimefunc(THD *thd, Item *a, Item *b, Item *c):
    Item_func(thd, a, b ,c) {}
  const Type_handler *type_handler() const override
  { return &type_handler_datetime2; }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    return Datetime(this).to_longlong();
  }
  double val_real() override { return Datetime(this).to_double(); }
  String *val_str(String *to) override
  { return Datetime(this).to_string(to, decimals); }
  my_decimal *val_decimal(my_decimal *to) override
  { return Datetime(this).to_decimal(to); }
};


/* Abstract CURTIME function. Children should define what time zone is used */

class Item_func_curtime :public Item_timefunc
{
  MYSQL_TIME ltime;
  query_id_t last_query_id;
public:
  Item_func_curtime(THD *thd, uint dec): Item_timefunc(thd), last_query_id(0)
  { decimals= dec; }
  bool fix_fields(THD *, Item **) override;
  bool fix_length_and_dec() override
  { fix_attributes_time(decimals); return FALSE; }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  /* 
    Abstract method that defines which time zone is used for conversion.
    Converts time current time in my_time_t representation to broken-down
    MYSQL_TIME representation using UTC-SYSTEM or per-thread time zone.
  */
  virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
  }
  void print(String *str, enum_query_type query_type) override;
};


class Item_func_curtime_local :public Item_func_curtime
{
public:
  Item_func_curtime_local(THD *thd, uint dec): Item_func_curtime(thd, dec) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("curtime") };
    return name;
  }
  void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_curtime_local>(thd, this); }
};


class Item_func_curtime_utc :public Item_func_curtime
{
public:
  Item_func_curtime_utc(THD *thd, uint dec): Item_func_curtime(thd, dec) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("utc_time") };
    return name;
  }
  void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_curtime_utc>(thd, this); }
};


/* Abstract CURDATE function. See also Item_func_curtime. */

class Item_func_curdate :public Item_datefunc
{
  query_id_t last_query_id;
  MYSQL_TIME ltime;
public:
  Item_func_curdate(THD *thd): Item_datefunc(thd), last_query_id(0) {}
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
  }
};


class Item_func_curdate_local :public Item_func_curdate
{
public:
  Item_func_curdate_local(THD *thd): Item_func_curdate(thd) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("curdate") };
    return name;
  }
  void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_curdate_local>(thd, this); }
};


class Item_func_curdate_utc :public Item_func_curdate
{
public:
  Item_func_curdate_utc(THD *thd): Item_func_curdate(thd) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("utc_date") };
    return name;
  }
  void store_now_in_TIME(THD* thd, MYSQL_TIME *now_time) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_curdate_utc>(thd, this); }
};


/* Abstract CURRENT_TIMESTAMP function. See also Item_func_curtime */

class Item_func_now :public Item_datetimefunc
{
  MYSQL_TIME ltime;
  query_id_t last_query_id;
public:
  Item_func_now(THD *thd, uint dec): Item_datetimefunc(thd), last_query_id(0)
  { decimals= dec; }
  bool fix_fields(THD *, Item **) override;
  bool fix_length_and_dec() override
  { fix_attributes_datetime(decimals); return FALSE;}
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
  bool check_vcol_func_processor(void *arg) override
  {
    /*
      NOW is safe for replication as slaves will run with same time as
      master
    */
    return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
  }
  void print(String *str, enum_query_type query_type) override;
};


class Item_func_now_local :public Item_func_now
{
public:
  Item_func_now_local(THD *thd, uint dec): Item_func_now(thd, dec) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("current_timestamp") };
    return name;
  }
  int save_in_field(Field *field, bool no_conversions) override;
  void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
  enum Functype functype() const override { return NOW_FUNC; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_now_local>(thd, this); }
};


class Item_func_now_utc :public Item_func_now
{
public:
  Item_func_now_utc(THD *thd, uint dec): Item_func_now(thd, dec) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("utc_timestamp") };
    return name;
  }
  void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
  enum Functype functype() const override { return NOW_UTC_FUNC; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_TIME_FUNC | VCOL_NON_DETERMINISTIC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_now_utc>(thd, this); }
};


/*
  This is like NOW(), but always uses the real current time, not the
  query_start(). This matches the Oracle behavior.
*/
class Item_func_sysdate_local :public Item_func_now
{
public:
  Item_func_sysdate_local(THD *thd, uint dec): Item_func_now(thd, dec) {}
  bool const_item() const override { return 0; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sysdate") };
    return name;
  }
  void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  table_map used_tables() const override { return RAND_TABLE_BIT; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_TIME_FUNC | VCOL_NON_DETERMINISTIC);
  }
  enum Functype functype() const override { return SYSDATE_FUNC; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sysdate_local>(thd, this); }
};


class Item_func_from_days :public Item_datefunc
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_int(func_name_cstring()); }
public:
  Item_func_from_days(THD *thd, Item *a): Item_datefunc(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("from_days") };
    return name;
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return has_date_args() || has_time_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_from_days>(thd, this); }
};


class Item_func_date_format :public Item_str_func
{
  bool check_arguments() const override
  {
    return args[0]->check_type_can_return_date(func_name_cstring()) ||
           check_argument_types_can_return_text(1, arg_count);
  }
  const MY_LOCALE *locale;
  int fixed_length;
  String value;
protected:
  bool is_time_format;
public:
  Item_func_date_format(THD *thd, Item *a, Item *b):
    Item_str_func(thd, a, b), locale(0), is_time_format(false) {}
  Item_func_date_format(THD *thd, Item *a, Item *b, Item *c):
    Item_str_func(thd, a, b, c), locale(0), is_time_format(false) {}
  String *val_str(String *str) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("date_format") };
    return name;
  }
  bool fix_length_and_dec() override;
  uint format_length(const String *format);
  bool eq(const Item *item, bool binary_cmp) const override;
  bool check_vcol_func_processor(void *arg) override
  {
    if (arg_count > 2)
      return false;
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_date_format>(thd, this); }
};

class Item_func_time_format: public Item_func_date_format
{
public:
  Item_func_time_format(THD *thd, Item *a, Item *b):
    Item_func_date_format(thd, a, b) { is_time_format= true; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("time_format") };
    return name;
  }
  bool check_vcol_func_processor(void *arg) override { return false; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_time_format>(thd, this); }
};


/* the max length of datetime format models string in Oracle is 144 */
#define MAX_DATETIME_FORMAT_MODEL_LEN 144

class Item_func_tochar :public Item_str_func
{
  const MY_LOCALE *locale;
  THD *thd;
  String warning_message;
  bool fixed_length;

  /*
    When datetime format models is parsed, use uint16 integers to
    represent the format models and store in fmt_array.
  */
  uint16 fmt_array[MAX_DATETIME_FORMAT_MODEL_LEN+1];

  bool check_arguments() const override
  {
    return
      (args[0]->check_type_can_return_date(func_name_cstring()) &&
       args[0]->check_type_can_return_time(func_name_cstring())) ||
      check_argument_types_can_return_text(1, arg_count);
  }

public:
  Item_func_tochar(THD *thd, Item *a, Item *b):
    Item_str_func(thd, a, b), locale(0)
  {
    /* NOTE: max length of warning message is 64 */
    warning_message.alloc(64);
    warning_message.length(0);
  }
  ~Item_func_tochar() { warning_message.free(); }
  String *val_str(String *str) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("to_char") };
    return name;
  }
  bool fix_length_and_dec() override;
  bool parse_format_string(const String *format, uint *fmt_len);

  bool check_vcol_func_processor(void *arg) override
  {
    if (arg_count > 2)
      return false;
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }

  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_tochar>(thd, this); }
};


class Item_func_from_unixtime :public Item_datetimefunc
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_decimal(func_name_cstring()); }
  Time_zone *tz;
 public:
  Item_func_from_unixtime(THD *thd, Item *a): Item_datetimefunc(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("from_unixtime") };
    return name;
  }
  bool fix_length_and_dec() override;
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_from_unixtime>(thd, this); }
};


/* 
  We need Time_zone class declaration for storing pointers in
  Item_func_convert_tz.
*/
class Time_zone;

/*
  This class represents CONVERT_TZ() function.
  The important fact about this function that it is handled in special way.
  When such function is met in expression time_zone system tables are added
  to global list of tables to open, so later those already opened and locked
  tables can be used during this function calculation for loading time zone
  descriptions.
*/
class Item_func_convert_tz :public Item_datetimefunc
{
  bool check_arguments() const override
  {
    return args[0]->check_type_can_return_date(func_name_cstring()) ||
           check_argument_types_can_return_text(1, arg_count);
  }
  /*
    If time zone parameters are constants we are caching objects that
    represent them (we use separate from_tz_cached/to_tz_cached members
    to indicate this fact, since NULL is legal value for from_tz/to_tz
    members.
  */
  bool from_tz_cached, to_tz_cached;
  Time_zone *from_tz, *to_tz;
 public:
  Item_func_convert_tz(THD *thd, Item *a, Item *b, Item *c):
    Item_datetimefunc(thd, a, b, c), from_tz_cached(0), to_tz_cached(0) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("convert_tz") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    fix_attributes_datetime(args[0]->datetime_precision(current_thd));
    set_maybe_null();
    return FALSE;
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  void cleanup() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_convert_tz>(thd, this); }
};


class Item_func_sec_to_time :public Item_timefunc
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_decimal(func_name_cstring()); }
public:
  Item_func_sec_to_time(THD *thd, Item *item): Item_timefunc(thd, item) {}
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  bool fix_length_and_dec() override
  {
    fix_attributes_time(args[0]->decimals);
    set_maybe_null();
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sec_to_time") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sec_to_time>(thd, this); }
};


class Item_date_add_interval :public Item_handled_func
{
public:
  const interval_type int_type; // keep it public
  const bool date_sub_interval; // keep it public
  Item_date_add_interval(THD *thd, Item *a, Item *b, interval_type type_arg,
                         bool neg_arg):
    Item_handled_func(thd, a, b), int_type(type_arg),
    date_sub_interval(neg_arg) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("date_add_interval") };
    return name;
  }
  bool fix_length_and_dec() override;
  bool eq(const Item *item, bool binary_cmp) const override;
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override { return INTERVAL_PRECEDENCE; }
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_date_add_interval>(thd, this); }
};


class Item_extract :public Item_int_func,
                    public Type_handler_hybrid_field_type
{
  date_mode_t m_date_mode;
  const Type_handler_int_result *handler_by_length(uint32 length,
                                                   uint32 threashold)
  {
    if (length >= threashold)
      return &type_handler_slonglong;
    return &type_handler_slong;
  }
  void set_date_length(uint32 length)
  {
    /*
      DATE components (e.g. YEAR, YEAR_MONTH, QUARTER, MONTH, WEEK)
      return non-negative values but historically EXTRACT for date
      components always returned the signed int data type.
      So do equivalent functions YEAR(), QUARTER(), MONTH(), WEEK().
      Let's set the data type to "signed int, but not negative",
      so "this" produces better data types in VARCHAR and DECIMAL context
      by using the fact that all of the max_length characters are spent
      for digits (non of them are spent for the sign).
    */
    set_handler(&type_handler_slong_ge0);
    fix_char_length(length);
    m_date_mode= date_mode_t(0);
  }
  void set_day_length(uint32 length)
  {
    /*
      Units starting with DAY can be negative:
        EXTRACT(DAY FROM '-24:00:00') -> -1
    */
    set_handler(handler_by_length(max_length= length + 1/*sign*/, 11));
    m_date_mode= Temporal::Options(TIME_INTERVAL_DAY, current_thd);
  }
  void set_time_length(uint32 length)
  {
    set_handler(handler_by_length(max_length= length + 1/*sign*/, 11));
    m_date_mode= Temporal::Options(TIME_INTERVAL_hhmmssff, current_thd);
  }
 public:
  const interval_type int_type; // keep it public
  Item_extract(THD *thd, interval_type type_arg, Item *a):
    Item_int_func(thd, a),
    Type_handler_hybrid_field_type(&type_handler_slonglong),
    m_date_mode(date_mode_t(0)),
    int_type(type_arg)
  { }
  const Type_handler *type_handler() const override
  {
    return Type_handler_hybrid_field_type::type_handler();
  }
  longlong val_int() override;
  enum Functype functype() const override { return EXTRACT_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("extract") };
    return name;
  }
  bool check_arguments() const override;
  bool fix_length_and_dec() override;
  bool eq(const Item *item, bool binary_cmp) const override;
  void print(String *str, enum_query_type query_type) override;
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override
  {
    if (int_type != INTERVAL_WEEK)
      return FALSE;
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  bool check_valid_arguments_processor(void *int_arg) override
  {
    switch (int_type) {
    case INTERVAL_YEAR:
    case INTERVAL_YEAR_MONTH:
    case INTERVAL_QUARTER:
    case INTERVAL_MONTH:
    /* case INTERVAL_WEEK: Not allowed as partitioning function, bug#57071 */
    case INTERVAL_DAY:
      return !has_date_args();
    case INTERVAL_DAY_HOUR:
    case INTERVAL_DAY_MINUTE:
    case INTERVAL_DAY_SECOND:
    case INTERVAL_DAY_MICROSECOND:
      return !has_datetime_args();
    case INTERVAL_HOUR:
    case INTERVAL_HOUR_MINUTE:
    case INTERVAL_HOUR_SECOND:
    case INTERVAL_MINUTE:
    case INTERVAL_MINUTE_SECOND:
    case INTERVAL_SECOND:
    case INTERVAL_MICROSECOND:
    case INTERVAL_HOUR_MICROSECOND:
    case INTERVAL_MINUTE_MICROSECOND:
    case INTERVAL_SECOND_MICROSECOND:
      return !has_time_args();
    default:
      /*
        INTERVAL_LAST is only an end marker,
        INTERVAL_WEEK depends on default_week_format which is a session
        variable and cannot be used for partitioning. See bug#57071.
      */
      break;
    }
    return true;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_extract>(thd, this); }
};


class Item_char_typecast :public Item_handled_func
{
  uint cast_length;
  CHARSET_INFO *cast_cs, *from_cs;
  bool charset_conversion;
  String tmp_value;
  bool m_suppress_warning_to_error_escalation;
public:
  bool has_explicit_length() const { return cast_length != ~0U; }
private:
  String *reuse(String *src, size_t length);
  String *copy(String *src, CHARSET_INFO *cs);
  uint adjusted_length_with_warn(uint length);
  void check_truncation_with_warn(String *src, size_t dstlen);
  void fix_length_and_dec_internal(CHARSET_INFO *fromcs);
public:
  // Methods used by ColumnStore
  uint get_cast_length() const { return cast_length; }
public:
  Item_char_typecast(THD *thd, Item *a, uint length_arg, CHARSET_INFO *cs_arg):
    Item_handled_func(thd, a), cast_length(length_arg), cast_cs(cs_arg),
    m_suppress_warning_to_error_escalation(false) {}
  enum Functype functype() const override { return CHAR_TYPECAST_FUNC; }
  bool eq(const Item *item, bool binary_cmp) const override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_char") };
    return name;
  }
  CHARSET_INFO *cast_charset() const { return cast_cs; }
  String *val_str_generic(String *a);
  String *val_str_binary_from_native(String *a);
  void fix_length_and_dec_generic();
  void fix_length_and_dec_numeric();
  void fix_length_and_dec_str();
  void fix_length_and_dec_native_to_binary(uint32 octet_length);
  bool fix_length_and_dec() override
  {
    return args[0]->type_handler()->Item_char_typecast_fix_length_and_dec(this);
  }
  void print(String *str, enum_query_type query_type) override;
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_char_typecast>(thd, this); }
};


class Item_interval_DDhhmmssff_typecast :public Item_char_typecast
{
  uint m_fsp;
public:
  Item_interval_DDhhmmssff_typecast(THD *thd, Item *a, uint fsp)
   :Item_char_typecast(thd, a,Interval_DDhhmmssff::max_char_length(fsp),
                       &my_charset_latin1),
    m_fsp(fsp)
  { }
  String *val_str(String *to) override
  {
    Interval_DDhhmmssff it(current_thd, args[0], m_fsp);
    null_value= !it.is_valid_interval_DDhhmmssff();
    return it.to_string(to, m_fsp);
  }
};


class Item_date_typecast :public Item_datefunc
{
public:
  Item_date_typecast(THD *thd, Item *a): Item_datefunc(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_date") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override
  {
    print_cast_temporal(str, query_type);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool fix_length_and_dec() override
  {
    return args[0]->type_handler()->Item_date_typecast_fix_length_and_dec(this);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_date_typecast>(thd, this); }
};


class Item_time_typecast :public Item_timefunc
{
public:
  Item_time_typecast(THD *thd, Item *a, uint dec_arg):
    Item_timefunc(thd, a) { decimals= dec_arg; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_time") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override
  {
    print_cast_temporal(str, query_type);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool fix_length_and_dec() override
  {
    return args[0]->type_handler()->
           Item_time_typecast_fix_length_and_dec(this);
  }
  Sql_mode_dependency value_depends_on_sql_mode() const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_time_typecast>(thd, this); }
};


class Item_datetime_typecast :public Item_datetimefunc
{
public:
  Item_datetime_typecast(THD *thd, Item *a, uint dec_arg):
    Item_datetimefunc(thd, a) { decimals= dec_arg; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_datetime") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override
  {
    print_cast_temporal(str, query_type);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool fix_length_and_dec() override
  {
    return args[0]->type_handler()->
           Item_datetime_typecast_fix_length_and_dec(this);
  }
  Sql_mode_dependency value_depends_on_sql_mode() const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_datetime_typecast>(thd, this); }
};


class Item_func_makedate :public Item_datefunc
{
  bool check_arguments() const override
  { return check_argument_types_can_return_int(0, arg_count); }
public:
  Item_func_makedate(THD *thd, Item *a, Item *b):
    Item_datefunc(thd, a, b) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("makedate") };
    return name;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_makedate>(thd, this); }
};


class Item_func_timestamp :public Item_datetimefunc
{
  bool check_arguments() const override
  {
    return args[0]->check_type_can_return_date(func_name_cstring()) ||
           args[1]->check_type_can_return_time(func_name_cstring());
  }
public:
  Item_func_timestamp(THD *thd, Item *a, Item *b)
   :Item_datetimefunc(thd, a, b)
  { }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("timestamp") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    THD *thd= current_thd;
    uint dec0= args[0]->datetime_precision(thd);
    uint dec1= Interval_DDhhmmssff::fsp(thd, args[1]);
    fix_attributes_datetime(MY_MAX(dec0, dec1));
    set_maybe_null();
    return false;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    Datetime dt(thd, args[0], Datetime::Options(TIME_CONV_NONE, thd));
    if (!dt.is_valid_datetime())
      return (null_value= 1);

    Interval_DDhhmmssff it(thd, args[1]);
    if (!it.is_valid_interval_DDhhmmssff())
      return (null_value= true);
    return (null_value= Sec6_add(dt.get_mysql_time(), it.get_mysql_time(), 1).
                           to_datetime(ltime));
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_timestamp>(thd, this); }
};


/**
  ADDTIME(t,a) and SUBTIME(t,a) are time functions that calculate a
  time/datetime value

  t: time_or_datetime_expression
  a: time_expression

  Result: Time value or datetime value
*/

class Item_func_add_time :public Item_handled_func
{
  int sign;
public:
  // Methods used by ColumnStore
  int get_sign() const { return sign; }
public:
  Item_func_add_time(THD *thd, Item *a, Item *b, bool neg_arg)
   :Item_handled_func(thd, a, b), sign(neg_arg ? -1 : 1)
  { }
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING addtime= { STRING_WITH_LEN("addtime") };
    static LEX_CSTRING subtime= { STRING_WITH_LEN("subtime") };
    return sign > 0 ? addtime : subtime;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_add_time>(thd, this); }
};


class Item_func_timediff :public Item_timefunc
{
  bool check_arguments() const override
  { return check_argument_types_can_return_time(0, arg_count); }
public:
  Item_func_timediff(THD *thd, Item *a, Item *b): Item_timefunc(thd, a, b) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("timediff") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    THD *thd= current_thd;
    uint dec= MY_MAX(args[0]->time_precision(thd),
                     args[1]->time_precision(thd));
    fix_attributes_time(dec);
    set_maybe_null();
    return FALSE;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_timediff>(thd, this); }
};

class Item_func_maketime :public Item_timefunc
{
  bool check_arguments() const override
  {
    return check_argument_types_can_return_int(0, 2) ||
           args[2]->check_type_can_return_decimal(func_name_cstring());
  }
public:
  Item_func_maketime(THD *thd, Item *a, Item *b, Item *c):
    Item_timefunc(thd, a, b, c)
  {}
  bool fix_length_and_dec() override
  {
    fix_attributes_time(args[2]->decimals);
    set_maybe_null();
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("maketime") };
    return name;
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_maketime>(thd, this); }
};


class Item_func_microsecond :public Item_long_func_time_field
{
public:
  Item_func_microsecond(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("microsecond") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    set_maybe_null();
    fix_char_length(6);
    return FALSE;
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool check_valid_arguments_processor(void *int_arg) override
  {
    return !has_time_args();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_microsecond>(thd, this); }
};


class Item_func_timestamp_diff :public Item_longlong_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_date(0, arg_count); }
  const interval_type int_type;
public:
  // Methods used by ColumnStore
  interval_type get_int_type() const { return int_type; };
public:
  Item_func_timestamp_diff(THD *thd, Item *a, Item *b, interval_type type_arg):
    Item_longlong_func(thd, a, b), int_type(type_arg) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("timestampdiff") };
    return name;
  }
  longlong val_int() override;
  bool fix_length_and_dec() override
  {
    decimals=0;
    set_maybe_null();
    return FALSE;
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_timestamp_diff>(thd, this); }
};


enum date_time_format
{
  USA_FORMAT, JIS_FORMAT, ISO_FORMAT, EUR_FORMAT, INTERNAL_FORMAT
};

class Item_func_get_format :public Item_str_ascii_func
{
public:
  const timestamp_type type; // keep it public
  Item_func_get_format(THD *thd, timestamp_type type_arg, Item *a):
    Item_str_ascii_func(thd, a), type(type_arg)
  {}
  String *val_str_ascii(String *str) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("get_format") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    decimals=0;
    fix_length_and_charset(17, default_charset());
    return FALSE;
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_get_format>(thd, this); }
};


class Item_func_str_to_date :public Item_handled_func
{
  bool const_item;
  String subject_converter;
  String format_converter;
  CHARSET_INFO *internal_charset;
public:
  Item_func_str_to_date(THD *thd, Item *a, Item *b):
    Item_handled_func(thd, a, b), const_item(false),
    internal_charset(NULL)
  {}
  bool get_date_common(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate,
                       timestamp_type);
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("str_to_date") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_str_to_date>(thd, this); }
};


class Item_func_last_day :public Item_datefunc
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_date(func_name_cstring()); }
public:
  Item_func_last_day(THD *thd, Item *a): Item_datefunc(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("last_day") };
    return name;
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_last_day>(thd, this); }
};


/*****************************************************************************/

class Func_handler_date_add_interval
{
protected:
  static uint interval_dec(const Item *item, interval_type int_type)
  {
    if (int_type == INTERVAL_MICROSECOND ||
        (int_type >= INTERVAL_DAY_MICROSECOND &&
         int_type <= INTERVAL_SECOND_MICROSECOND))
      return TIME_SECOND_PART_DIGITS;
    if (int_type == INTERVAL_SECOND && item->decimals > 0)
      return MY_MIN(item->decimals, TIME_SECOND_PART_DIGITS);
    return 0;
  }
  interval_type int_type(const Item_handled_func *item) const
  {
    return static_cast<const Item_date_add_interval*>(item)->int_type;
  }
  bool sub(const Item_handled_func *item) const
  {
    return static_cast<const Item_date_add_interval*>(item)->date_sub_interval;
  }
  bool add(THD *thd, Item *item, interval_type type, bool sub, MYSQL_TIME *to) const
  {
    INTERVAL interval;
    if (get_interval_value(thd, item, type, &interval))
      return true;
    if (sub)
      interval.neg = !interval.neg;
    return date_add_interval(thd, to, type, interval);
  }
};


class Func_handler_date_add_interval_datetime:
        public Item_handled_func::Handler_datetime,
        public Func_handler_date_add_interval
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    uint dec= MY_MAX(item->arguments()[0]->datetime_precision(current_thd),
                     interval_dec(item->arguments()[1], int_type(item)));
    item->fix_attributes_datetime(dec);
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    Datetime::Options opt(TIME_CONV_NONE, thd);
    Datetime dt(thd, item->arguments()[0], opt);
    if (!dt.is_valid_datetime() ||
         dt.check_date_with_warn(thd, TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE))
      return (item->null_value= true);
    dt.copy_to_mysql_time(to);
    return (item->null_value= add(thd, item->arguments()[1],
                                  int_type(item), sub(item), to));
  }
};


class Func_handler_date_add_interval_datetime_arg0_time:
        public Func_handler_date_add_interval_datetime
{
public:
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override;
};


class Func_handler_date_add_interval_date:
        public Item_handled_func::Handler_date,
        public Func_handler_date_add_interval
{
public:
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    /*
      The first argument is known to be of the DATE data type (not DATETIME).
      We don't need rounding here.
    */
    Date d(thd, item->arguments()[0], TIME_CONV_NONE);
    if (!d.is_valid_date() ||
         d.check_date_with_warn(thd, TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE))
      return (item->null_value= true);
    d.copy_to_mysql_time(to);
    return (item->null_value= add(thd, item->arguments()[1],
                                  int_type(item), sub(item), to));
  }
};


class Func_handler_date_add_interval_time:
        public Item_handled_func::Handler_time,
        public Func_handler_date_add_interval
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    uint dec= MY_MAX(item->arguments()[0]->time_precision(current_thd),
                     interval_dec(item->arguments()[1], int_type(item)));
    item->fix_attributes_time(dec);
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    Time t(thd, item->arguments()[0]);
    if (!t.is_valid_time())
      return (item->null_value= true);
    t.copy_to_mysql_time(to);
    return (item->null_value= add(thd, item->arguments()[1],
                                  int_type(item), sub(item), to));
  }
};


class Func_handler_date_add_interval_string:
        public Item_handled_func::Handler_temporal_string,
        public Func_handler_date_add_interval
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    uint dec= MY_MAX(item->arguments()[0]->datetime_precision(current_thd),
                     interval_dec(item->arguments()[1], int_type(item)));
    item->Type_std_attributes::set(
      Type_temporal_attributes_not_fixed_dec(MAX_DATETIME_WIDTH, dec, false),
      DTCollation(item->default_charset(),
                  DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII));
    item->fix_char_length(item->max_length);
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    if (item->arguments()[0]->
          get_date(thd, to, Datetime::Options(TIME_CONV_NONE, thd)) ||
        (to->time_type != MYSQL_TIMESTAMP_TIME &&
         check_date_with_warn(thd, to, TIME_NO_ZEROS, MYSQL_TIMESTAMP_ERROR)))
      return (item->null_value= true);
    return (item->null_value= add(thd, item->arguments()[1],
                                  int_type(item), sub(item), to));
  }
};


class Func_handler_sign
{
protected:
  int m_sign;
  Func_handler_sign(int sign) :m_sign(sign) { }
};


class Func_handler_add_time_datetime:
        public Item_handled_func::Handler_datetime,
        public Func_handler_sign
{
public:
  Func_handler_add_time_datetime(int sign)
   :Func_handler_sign(sign)
  { }
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    THD *thd= current_thd;
    uint dec0= item->arguments()[0]->datetime_precision(thd);
    uint dec1= Interval_DDhhmmssff::fsp(thd, item->arguments()[1]);
    item->fix_attributes_datetime(MY_MAX(dec0, dec1));
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    DBUG_ASSERT(item->fixed());
    Datetime::Options opt(TIME_CONV_NONE, thd);
    Datetime dt(thd, item->arguments()[0], opt);
    if (!dt.is_valid_datetime())
      return (item->null_value= true);
    Interval_DDhhmmssff it(thd, item->arguments()[1]);
    if (!it.is_valid_interval_DDhhmmssff())
      return (item->null_value= true);
    return (item->null_value= (Sec6_add(dt.get_mysql_time(),
                                        it.get_mysql_time(), m_sign).
                               to_datetime(to)));
  }
};


class Func_handler_add_time_time:
        public Item_handled_func::Handler_time,
        public Func_handler_sign
{
public:
  Func_handler_add_time_time(int sign)
   :Func_handler_sign(sign)
  { }
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    THD *thd= current_thd;
    uint dec0= item->arguments()[0]->time_precision(thd);
    uint dec1= Interval_DDhhmmssff::fsp(thd, item->arguments()[1]);
    item->fix_attributes_time(MY_MAX(dec0, dec1));
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    DBUG_ASSERT(item->fixed());
    Time t(thd, item->arguments()[0]);
    if (!t.is_valid_time())
      return (item->null_value= true);
    Interval_DDhhmmssff i(thd, item->arguments()[1]);
    if (!i.is_valid_interval_DDhhmmssff())
      return (item->null_value= true);
    return (item->null_value= (Sec6_add(t.get_mysql_time(),
                                        i.get_mysql_time(), m_sign).
                                 to_time(thd, to, item->decimals)));
  }
};


class Func_handler_add_time_string:
        public Item_handled_func::Handler_temporal_string,
        public Func_handler_sign
{
public:
  Func_handler_add_time_string(int sign)
   :Func_handler_sign(sign)
  { }
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    uint dec0= item->arguments()[0]->decimals;
    uint dec1= Interval_DDhhmmssff::fsp(current_thd, item->arguments()[1]);
    uint dec= MY_MAX(dec0, dec1);
    item->Type_std_attributes::set(
      Type_temporal_attributes_not_fixed_dec(MAX_DATETIME_WIDTH, dec, false),
      DTCollation(item->default_charset(),
                  DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII));
    item->fix_char_length(item->max_length);
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    DBUG_ASSERT(item->fixed());
    // Detect a proper timestamp type based on the argument values
    Temporal_hybrid l_time1(thd, item->arguments()[0],
                            Temporal::Options(TIME_TIME_ONLY, thd));
    if (!l_time1.is_valid_temporal())
      return (item->null_value= true);
    Interval_DDhhmmssff l_time2(thd, item->arguments()[1]);
    if (!l_time2.is_valid_interval_DDhhmmssff())
      return (item->null_value= true);
    Sec6_add add(l_time1.get_mysql_time(), l_time2.get_mysql_time(), m_sign);
    return (item->null_value= (l_time1.get_mysql_time()->time_type ==
                                 MYSQL_TIMESTAMP_TIME ?
                               add.to_time(thd, to, item->decimals) :
                               add.to_datetime(to)));
  }
};


class Func_handler_str_to_date_datetime_sec:
        public Item_handled_func::Handler_datetime
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    item->fix_attributes_datetime(0);
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    return static_cast<Item_func_str_to_date*>(item)->
             get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_DATETIME);
  }
};


class Func_handler_str_to_date_datetime_usec:
        public Item_handled_func::Handler_datetime
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    item->fix_attributes_datetime(TIME_SECOND_PART_DIGITS);
    return false;
  }
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    return static_cast<Item_func_str_to_date*>(item)->
             get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_DATETIME);
  }
};


class Func_handler_str_to_date_date: public Item_handled_func::Handler_date
{
public:
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    return static_cast<Item_func_str_to_date*>(item)->
             get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_DATE);
  }
};


class Func_handler_str_to_date_time: public Item_handled_func::Handler_time
{
public:
  bool get_date(THD *thd, Item_handled_func *item,
                MYSQL_TIME *to, date_mode_t fuzzy) const override
  {
    if (static_cast<Item_func_str_to_date*>(item)->
         get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_TIME))
      return true;
    if (to->day)
    {
      /*
        Day part for time type can be nonzero value and so
        we should add hours from day part to hour part to
        keep valid time value.
      */
      to->hour+= to->day * 24;
      to->day= 0;
    }
    return false;
  }
};


class Func_handler_str_to_date_time_sec: public Func_handler_str_to_date_time
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    item->fix_attributes_time(0);
    return false;
  }
};


class Func_handler_str_to_date_time_usec: public Func_handler_str_to_date_time
{
public:
  bool fix_length_and_dec(Item_handled_func *item) const override
  {
    item->fix_attributes_time(TIME_SECOND_PART_DIGITS);
    return false;
  }
};


#endif /* ITEM_TIMEFUNC_INCLUDED */
server/private/rpl_utility.h000064400000022636150400264000012255 0ustar00/*
   Copyright (c) 2006, 2010, Oracle and/or its affiliates.

   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 */

#ifndef RPL_UTILITY_H
#define RPL_UTILITY_H

#ifndef __cplusplus
#error "Don't include this C++ header file from a non-C++ file!"
#endif

#include "sql_priv.h"
#include "m_string.h"                           /* bzero, memcpy */
#ifdef MYSQL_SERVER
#include "table.h"                              /* TABLE_LIST */
#endif
#include "mysql_com.h"

class Relay_log_info;
class Log_event;
struct rpl_group_info;

/**
  A table definition from the master.

  The responsibilities of this class is:
  - Extract and decode table definition data from the table map event
  - Check if table definition in table map is compatible with table
    definition on slave
 */

class table_def
{
public:
  /**
    Constructor.

    @param types Array of types, each stored as a byte
    @param size  Number of elements in array 'types'
    @param field_metadata Array of extra information about fields
    @param metadata_size Size of the field_metadata array
    @param null_bitmap The bitmap of fields that can be null
   */
  table_def(unsigned char *types, ulong size, uchar *field_metadata,
            int metadata_size, uchar *null_bitmap, uint16 flags);

  ~table_def();

  /**
    Return the number of fields there is type data for.

    @return The number of fields that there is type data for.
   */
  ulong size() const { return m_size; }


  /**
    Returns internal binlog type code for one field,
    without translation to real types.
  */
  enum_field_types binlog_type(ulong index) const
  {
    return static_cast<enum_field_types>(m_type[index]);
  }
  /*
    Return a representation of the type data for one field.

    @param index Field index to return data for

    @return Will return a representation of the type data for field
    <code>index</code>. Currently, only the type identifier is
    returned.
   */
  enum_field_types type(ulong index) const
  {
    DBUG_ASSERT(index < m_size);
    /*
      If the source type is MYSQL_TYPE_STRING, it can in reality be
      either MYSQL_TYPE_STRING, MYSQL_TYPE_ENUM, or MYSQL_TYPE_SET, so
      we might need to modify the type to get the real type.
    */
    enum_field_types source_type= binlog_type(index);
    uint16 source_metadata= m_field_metadata[index];
    switch (source_type)
    {
    case MYSQL_TYPE_STRING:
    {
      int real_type= source_metadata >> 8;
      if (real_type == MYSQL_TYPE_ENUM || real_type == MYSQL_TYPE_SET)
        source_type= static_cast<enum_field_types>(real_type);
      break;
    }

    /*
      This type has not been used since before row-based replication,
      so we can safely assume that it really is MYSQL_TYPE_NEWDATE.
    */
    case MYSQL_TYPE_DATE:
      source_type= MYSQL_TYPE_NEWDATE;
      break;

    default:
      /* Do nothing */
      break;
    }

    return source_type;
  }
#ifdef MYSQL_SERVER
  const Type_handler *field_type_handler(uint index) const;
#endif

  /*
    This function allows callers to get the extra field data from the
    table map for a given field. If there is no metadata for that field
    or there is no extra metadata at all, the function returns 0.

    The function returns the value for the field metadata for column at 
    position indicated by index. As mentioned, if the field was a type 
    that stores field metadata, that value is returned else zero (0) is 
    returned. This method is used in the unpack() methods of the 
    corresponding fields to properly extract the data from the binary log 
    in the event that the master's field is smaller than the slave.
  */
  uint16 field_metadata(uint index) const
  {
    DBUG_ASSERT(index < m_size);
    if (m_field_metadata_size)
      return m_field_metadata[index];
    else
      return 0;
  }

  /*
    This function returns whether the field on the master can be null.
    This value is derived from field->maybe_null().
  */
  my_bool maybe_null(uint index) const
  {
    DBUG_ASSERT(index < m_size);
    return ((m_null_bits[(index / 8)] & 
            (1 << (index % 8))) == (1 << (index %8)));
  }

  /*
    This function returns the field size in raw bytes based on the type
    and the encoded field data from the master's raw data. This method can 
    be used for situations where the slave needs to skip a column (e.g., 
    WL#3915) or needs to advance the pointer for the fields in the raw 
    data from the master to a specific column.
  */
  uint32 calc_field_size(uint col, uchar *master_data) const;

  /**
    Decide if the table definition is compatible with a table.

    Compare the definition with a table to see if it is compatible
    with it.

    A table definition is compatible with a table if:
      - The columns types of the table definition is a (not
        necessarily proper) prefix of the column type of the table.

      - The other way around.

      - Each column on the master that also exists on the slave can be
        converted according to the current settings of @c
        SLAVE_TYPE_CONVERSIONS.

    @param thd
    @param rli   Pointer to relay log info
    @param table Pointer to table to compare with.

    @param[out] tmp_table_var Pointer to temporary table for holding
    conversion table.

    @retval 1  if the table definition is not compatible with @c table
    @retval 0  if the table definition is compatible with @c table
  */
#ifndef MYSQL_CLIENT
  bool compatible_with(THD *thd, rpl_group_info *rgi, TABLE *table,
                      TABLE **conv_table_var) const;

  /**
   Create a virtual in-memory temporary table structure.

   The table structure has records and field array so that a row can
   be unpacked into the record for further processing.

   In the virtual table, each field that requires conversion will
   have a non-NULL value, while fields that do not require
   conversion will have a NULL value.

   Some information that is missing in the events, such as the
   character set for string types, are taken from the table that the
   field is going to be pushed into, so the target table that the data
   eventually need to be pushed into need to be supplied.

   @param thd Thread to allocate memory from.
   @param rli Relay log info structure, for error reporting.
   @param target_table Target table for fields.

   @return A pointer to a temporary table with memory allocated in the
   thread's memroot, NULL if the table could not be created
   */
  TABLE *create_conversion_table(THD *thd, rpl_group_info *rgi,
                                 TABLE *target_table) const;
#endif


private:
  ulong m_size;           // Number of elements in the types array
  unsigned char *m_type;  // Array of type descriptors
  uint m_field_metadata_size;
  uint16 *m_field_metadata;
  uchar *m_null_bits;
  uint16 m_flags;         // Table flags
  uchar *m_memory;
};


#ifndef MYSQL_CLIENT
/**
   Extend the normal table list with a few new fields needed by the
   slave thread, but nowhere else.
 */
struct RPL_TABLE_LIST
  : public TABLE_LIST
{
  bool m_tabledef_valid;
  table_def m_tabledef;
  TABLE *m_conv_table;
  bool master_had_triggers;
};


/* Anonymous namespace for template functions/classes */
CPP_UNNAMED_NS_START

  /*
    Smart pointer that will automatically call my_afree (a macro) when
    the pointer goes out of scope.  This is used so that I do not have
    to remember to call my_afree() before each return.  There is no
    overhead associated with this, since all functions are inline.

    I (Matz) would prefer to use the free function as a template
    parameter, but that is not possible when the "function" is a
    macro.
  */
  template <class Obj>
  class auto_afree_ptr
  {
    Obj* m_ptr;
  public:
    auto_afree_ptr(Obj* ptr) : m_ptr(ptr) { }
    ~auto_afree_ptr() { if (m_ptr) my_afree(m_ptr); }
    void assign(Obj* ptr) {
      /* Only to be called if it hasn't been given a value before. */
      DBUG_ASSERT(m_ptr == NULL);
      m_ptr= ptr;
    }
    Obj* get() { return m_ptr; }
  };

CPP_UNNAMED_NS_END

class Deferred_log_events
{
private:
  DYNAMIC_ARRAY array;
  Log_event *last_added;

public:
  Deferred_log_events(Relay_log_info *rli);
  ~Deferred_log_events();
  /* queue for exection at Query-log-event time prior the Query */
  int add(Log_event *ev);
  bool is_empty();
  bool execute(struct rpl_group_info *rgi);
  void rewind();
  bool is_last(Log_event *ev) { return ev == last_added; };
};

#endif

// NB. number of printed bit values is limited to sizeof(buf) - 1
#define DBUG_PRINT_BITSET(N,FRM,BS)                \
  do {                                             \
    char buf[256];                                 \
    uint i;                                        \
    for (i = 0 ; i < MY_MIN(sizeof(buf) - 1, (BS)->n_bits) ; i++) \
      buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
    buf[i] = '\0';                                 \
    DBUG_PRINT((N), ((FRM), buf));                 \
  } while (0)

#endif /* RPL_UTILITY_H */
server/private/rpl_rli.h000064400000077752150400264000011351 0ustar00/* Copyright (c) 2005, 2017, Oracle and/or its affiliates.
   Copyright (c) 2009, 2017, 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 */

#ifndef RPL_RLI_H
#define RPL_RLI_H

#include "rpl_tblmap.h"
#include "rpl_reporting.h"
#include "rpl_utility.h"
#include "log.h"                         /* LOG_INFO, MYSQL_BIN_LOG */
#include "sql_class.h"                   /* THD */
#include "log_event.h"
#include "rpl_parallel.h"

struct RPL_TABLE_LIST;
class Master_info;
class Rpl_filter;


/****************************************************************************

  Replication SQL Thread

  Relay_log_info contains:
    - the current relay log
    - the current relay log offset
    - master log name
    - master log sequence corresponding to the last update
    - misc information specific to the SQL thread

  Relay_log_info is initialized from the slave.info file if such
  exists.  Otherwise, data members are intialized with defaults. The
  initialization is done with Relay_log_info::init() call.

  The format of slave.info file:

  relay_log_name
  relay_log_pos
  master_log_name
  master_log_pos

  To clean up, call end_relay_log_info()

*****************************************************************************/

struct rpl_group_info;
struct inuse_relaylog;

class Relay_log_info : public Slave_reporting_capability
{
public:
  /**
     Flags for the state of reading the relay log. Note that these are
     bit masks.
  */
  enum enum_state_flag {
    /** We are inside a group of events forming a statement */
    IN_STMT=1,
    /** We have inside a transaction */
    IN_TRANSACTION=2
  };

  /*
    The SQL thread owns one Relay_log_info, and each client that has
    executed a BINLOG statement owns one Relay_log_info. This function
    returns zero for the Relay_log_info object that belongs to the SQL
    thread and nonzero for Relay_log_info objects that belong to
    clients.
  */
  inline bool belongs_to_client()
  {
    DBUG_ASSERT(sql_driver_thd);
    return !sql_driver_thd->slave_thread;
  }

  /*
    If true, events with the same server id should be replicated. This
    field is set on creation of a relay log info structure by copying
    the value of ::replicate_same_server_id and can be overridden if
    necessary. For example of when this is done, check sql_binlog.cc,
    where the BINLOG statement can be used to execute "raw" events.
   */
  bool replicate_same_server_id;

  /*** The following variables can only be read when protect by data lock ****/

  /*
    info_fd - file descriptor of the info file. set only during
    initialization or clean up - safe to read anytime
    cur_log_fd - file descriptor of the current read  relay log
  */
  File info_fd,cur_log_fd;

  /*
    Protected with internal locks.
    Must get data_lock when resetting the logs.
  */
  MYSQL_BIN_LOG relay_log;
  LOG_INFO linfo;

  /*
   cur_log
     Pointer that either points at relay_log.get_log_file() or
     &rli->cache_buf, depending on whether the log is hot or there was
     the need to open a cold relay_log.

   cache_buf 
     IO_CACHE used when opening cold relay logs.
   */
  IO_CACHE cache_buf,*cur_log;

  /*
    Keeps track of the number of transactions that commits
    before fsyncing. The option --sync-relay-log-info determines 
    how many transactions should commit before fsyncing.
  */ 
  uint sync_counter;

  /*
    Identifies when the recovery process is going on.
    See sql/slave.cc:init_recovery for further details.
  */ 
  bool is_relay_log_recovery;

  /* The following variables are safe to read any time */

  /* IO_CACHE of the info file - set only during init or end */
  IO_CACHE info_file;

  /*
    List of temporary tables used by this connection.
    This is updated when a temporary table is created or dropped by
    a replication thread.

    Not reset when replication ends, to allow one to access the tables
    when replication restarts.

    Protected by data_lock.
  */
  All_tmp_tables_list *save_temporary_tables;

  /*
    standard lock acquisition order to avoid deadlocks:
    run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index
  */
  mysql_mutex_t data_lock, run_lock;
  /*
    start_cond is broadcast when SQL thread is started
    stop_cond - when stopped
    data_cond - when data protected by data_lock changes
  */
  mysql_cond_t start_cond, stop_cond, data_cond;
  /* parent Master_info structure */
  Master_info *mi;

  /*
    List of active relay log files.
    (This can be more than one in case of parallel replication).
  */
  inuse_relaylog *inuse_relaylog_list;
  inuse_relaylog *last_inuse_relaylog;

  /*
    Needed to deal properly with cur_log getting closed and re-opened with
    a different log under our feet
  */
  uint32 cur_log_old_open_count;

  /*
    If on init_info() call error_on_rli_init_info is true that means
    that previous call to init_info() terminated with an error, RESET
    SLAVE must be executed and the problem fixed manually.
   */
  bool error_on_rli_init_info;

  /*
    Let's call a group (of events) :
      - a transaction
      or
      - an autocommiting query + its associated events (INSERT_ID,
    TIMESTAMP...)
    We need these rli coordinates :
    - relay log name and position of the beginning of the group we currently
    are executing. Needed to know where we have to restart when replication has
    stopped in the middle of a group (which has been rolled back by the slave).
    - relay log name and position just after the event we have just
    executed. This event is part of the current group.
    Formerly we only had the immediately above coordinates, plus a 'pending'
    variable, but this dealt wrong with the case of a transaction starting on a
    relay log and finishing (commiting) on another relay log. Case which can
    happen when, for example, the relay log gets rotated because of
    max_binlog_size.

    Note: group_relay_log_name, group_relay_log_pos must only be
    written from the thread owning the Relay_log_info (SQL thread if
    !belongs_to_client(); client thread executing BINLOG statement if
    belongs_to_client()).
  */
  char group_relay_log_name[FN_REFLEN];
  ulonglong group_relay_log_pos;
  char event_relay_log_name[FN_REFLEN];
  ulonglong event_relay_log_pos;
  ulonglong future_event_relay_log_pos;
  /*
    The master log name for current event. Only used in parallel replication.
  */
  char future_event_master_log_name[FN_REFLEN];

  /*
     Original log name and position of the group we're currently executing
     (whose coordinates are group_relay_log_name/pos in the relay log)
     in the master's binlog. These concern the *group*, because in the master's
     binlog the log_pos that comes with each event is the position of the
     beginning of the group.

    Note: group_master_log_name, group_master_log_pos must only be
    written from the thread owning the Relay_log_info (SQL thread if
    !belongs_to_client(); client thread executing BINLOG statement if
    belongs_to_client()).
  */
  char group_master_log_name[FN_REFLEN];
  volatile my_off_t group_master_log_pos;

  /*
    Handling of the relay_log_space_limit optional constraint.
    ignore_log_space_limit is used to resolve a deadlock between I/O and SQL
    threads, the SQL thread sets it to unblock the I/O thread and make it
    temporarily forget about the constraint.
  */
  ulonglong log_space_limit;
  Atomic_counter<uint64> log_space_total;
  bool ignore_log_space_limit;

  /*
    Used by the SQL thread to instructs the IO thread to rotate 
    the logs when the SQL thread needs to purge to release some
    disk space.
   */
  bool sql_force_rotate_relay;

  time_t last_master_timestamp;
  /*
    The SQL driver thread sets this true while it is waiting at the end of the
    relay log for more events to arrive. SHOW SLAVE STATUS uses this to report
    Seconds_Behind_Master as zero while the SQL thread is so waiting.
  */
  bool sql_thread_caught_up;

  void clear_until_condition();
  /**
    Reset the delay.
    This is used by RESET SLAVE to clear the delay.
  */
  void clear_sql_delay()
  {
    sql_delay= 0;
  }


  /*
    Needed for problems when slave stops and we want to restart it
    skipping one or more events in the master log that have caused
    errors, and have been manually applied by DBA already.
    Must be ulong as it's referred to from set_var.cc
  */
  volatile ulonglong slave_skip_counter;
  ulonglong max_relay_log_size;

  volatile ulong abort_pos_wait;	/* Incremented on change master */
  volatile ulong slave_run_id;		/* Incremented on slave start */
  mysql_mutex_t log_space_lock;
  mysql_cond_t log_space_cond;
  /*
    THD for the main sql thread, the one that starts threads to process
    slave requests. If there is only one thread, then this THD is also
    used for SQL processing.
    A kill sent to this THD will kill the replication.
  */
  THD *sql_driver_thd;
#ifndef DBUG_OFF
  int events_till_abort;
#endif  

  enum_gtid_skip_type gtid_skip_flag;

  /*
    inited changes its value within LOCK_active_mi-guarded critical
    sections  at times of start_slave_threads() (0->1) and end_slave() (1->0).
    Readers may not acquire the mutex while they realize potential concurrency
    issue.
    If not set, the value of other members of the structure are undefined.
  */
  volatile bool inited;
  volatile bool abort_slave;
  volatile bool stop_for_until;
  volatile uint slave_running;

  /* 
     Condition and its parameters from START SLAVE UNTIL clause.
     
     UNTIL condition is tested with is_until_satisfied() method that is 
     called by exec_relay_log_event(). is_until_satisfied() caches the result
     of the comparison of log names because log names don't change very often;
     this cache is invalidated by parts of code which change log names with
     notify_*_log_name_updated() methods. (They need to be called only if SQL
     thread is running).
   */
  
  enum {
    UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS, UNTIL_GTID
  } until_condition;
  char until_log_name[FN_REFLEN];
  ulonglong until_log_pos;
  /* extension extracted from log_name and converted to int */
  ulong until_log_name_extension;   
  /* 
     Cached result of comparison of until_log_name and current log name
     -2 means unitialised, -1,0,1 are comarison results 
  */
  enum 
  { 
    UNTIL_LOG_NAMES_CMP_UNKNOWN= -2, UNTIL_LOG_NAMES_CMP_LESS= -1,
    UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1
  } until_log_names_cmp_result;
  /* Condition for UNTIL master_gtid_pos. */
  slave_connection_state until_gtid_pos;

  /*
    retried_trans is a cumulative counter: how many times the slave
    has retried a transaction (any) since slave started.
    Protected by data_lock.
  */
  ulong retried_trans;
  /*
    Number of executed events for SLAVE STATUS.
    Protected by slave_executed_entries_lock
  */
  Atomic_counter<uint32_t> executed_entries;

  /*
    If the end of the hot relay log is made of master's events ignored by the
    slave I/O thread, these two keep track of the coords (in the master's
    binlog) of the last of these events seen by the slave I/O thread. If not,
    ign_master_log_name_end[0] == 0.
    As they are like a Rotate event read/written from/to the relay log, they
    are both protected by rli->relay_log.LOCK_log.
  */
  char ign_master_log_name_end[FN_REFLEN];
  ulonglong ign_master_log_pos_end;
  /* Similar for ignored GTID events. */
  slave_connection_state ign_gtids;

  /* 
    Indentifies where the SQL Thread should create temporary files for the
    LOAD DATA INFILE. This is used for security reasons.
   */ 
  char slave_patternload_file[FN_REFLEN]; 
  size_t slave_patternload_file_size;  

  rpl_parallel parallel;
  /*
    The relay_log_state keeps track of the current binlog state of the
    execution of the relay log. This is used to know where to resume
    current GTID position if the slave thread is stopped and
    restarted.  It is only accessed from the SQL thread, so it does
    not need any locking.
  */
  rpl_binlog_state relay_log_state;
  /*
    The restart_gtid_state is used when the SQL thread restarts on a relay log
    in GTID mode. In multi-domain parallel replication, each domain may have a
    separat position, so some events in more progressed domains may need to be
    skipped. This keeps track of the domains that have not yet reached their
    starting event.
  */
  slave_connection_state restart_gtid_pos;

  Relay_log_info(bool is_slave_recovery, const char* thread_name= "SQL");
  ~Relay_log_info();

  /*
    Invalidate cached until_log_name and group_relay_log_name comparison
    result. Should be called after any update of group_realy_log_name if
    there chances that sql_thread is running.
  */
  inline void notify_group_relay_log_name_update()
  {
    if (until_condition==UNTIL_RELAY_POS)
      until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN;
  }

  /*
    The same as previous but for group_master_log_name. 
  */
  inline void notify_group_master_log_name_update()
  {
    if (until_condition==UNTIL_MASTER_POS)
      until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN;
  }

  void inc_group_relay_log_pos(ulonglong log_pos,
			       rpl_group_info *rgi,
			       bool skip_lock=0);

  int wait_for_pos(THD* thd, String* log_name, longlong log_pos, 
		   longlong timeout);
  void close_temporary_tables();

  /* Check if UNTIL condition is satisfied. See slave.cc for more. */
  bool is_until_satisfied(Log_event *ev);
  inline ulonglong until_pos()
  {
    DBUG_ASSERT(until_condition == UNTIL_MASTER_POS ||
                until_condition == UNTIL_RELAY_POS);
    return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos :
	    group_relay_log_pos);
  }
  inline char *until_name()
  {
    DBUG_ASSERT(until_condition == UNTIL_MASTER_POS ||
                until_condition == UNTIL_RELAY_POS);
    return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_name :
	    group_relay_log_name);
  }
  /**
    Helper function to do after statement completion.

    This function is called from an event to complete the group by
    either stepping the group position, if the "statement" is not
    inside a transaction; or increase the event position, if the
    "statement" is inside a transaction.

    @param event_log_pos
    Master log position of the event. The position is recorded in the
    relay log info and used to produce information for <code>SHOW
    SLAVE STATUS</code>.
  */
  bool stmt_done(my_off_t event_log_pos, THD *thd, rpl_group_info *rgi);
  int alloc_inuse_relaylog(const char *name);
  void free_inuse_relaylog(inuse_relaylog *ir);
  void reset_inuse_relaylog();
  int update_relay_log_state(rpl_gtid *gtid_list, uint32 count);

  /**
     Is the replication inside a group?

     The reader of the relay log is inside a group if either:
     - The IN_TRANSACTION flag is set, meaning we're inside a transaction
     - The IN_STMT flag is set, meaning we have read at least one row from
       a multi-event entry.

     This flag reflects the state of the log 'just now', ie after the last
     read event would be executed.
     This allow us to test if we can stop replication before reading
     the next entry.

     @retval true Replication thread is currently inside a group
     @retval false Replication thread is currently not inside a group
   */
  bool is_in_group() const {
    return (m_flags & (IN_STMT | IN_TRANSACTION));
  }

  /**
     Set the value of a replication state flag.

     @param flag Flag to set
   */
  void set_flag(enum_state_flag flag)
  {
    m_flags|= flag;
  }

  /**
     Get the value of a replication state flag.

     @param flag Flag to get value of

     @return @c true if the flag was set, @c false otherwise.
   */
  bool get_flag(enum_state_flag flag)
  {
    return m_flags & flag;
  }

  /**
     Clear the value of a replication state flag.

     @param flag Flag to clear
   */
  void clear_flag(enum_state_flag flag)
  {
    m_flags&= ~flag;
  }

  bool flush();

  /**
    Reads the relay_log.info file.
  */
  int init(const char* info_filename);

  /**
    Indicate that a delay starts.

    This does not actually sleep; it only sets the state of this
    Relay_log_info object to delaying so that the correct state can be
    reported by SHOW SLAVE STATUS and SHOW PROCESSLIST.

    Requires rli->data_lock.

    @param delay_end The time when the delay shall end.
  */
  void start_sql_delay(time_t delay_end)
  {
    mysql_mutex_assert_owner(&data_lock);
    sql_delay_end= delay_end;
    THD_STAGE_INFO(sql_driver_thd, stage_sql_thd_waiting_until_delay);
  }

  int32 get_sql_delay() { return sql_delay; }
  void set_sql_delay(int32 _sql_delay) { sql_delay= _sql_delay; }
  time_t get_sql_delay_end() { return sql_delay_end; }
  rpl_gtid last_seen_gtid;
  ulong last_trans_retry_count;
private:


  /**
    Delay slave SQL thread by this amount, compared to master (in
    seconds). This is set with CHANGE MASTER TO MASTER_DELAY=X.

    Guarded by data_lock.  Initialized by the client thread executing
    START SLAVE.  Written by client threads executing CHANGE MASTER TO
    MASTER_DELAY=X.  Read by SQL thread and by client threads
    executing SHOW SLAVE STATUS.  Note: must not be written while the
    slave SQL thread is running, since the SQL thread reads it without
    a lock when executing Relay_log_info::flush().
  */
  int sql_delay;

  /**
    During a delay, specifies the point in time when the delay ends.

    This is used for the SQL_Remaining_Delay column in SHOW SLAVE STATUS.

    Guarded by data_lock. Written by the sql thread.  Read by client
    threads executing SHOW SLAVE STATUS.

    This is calculated as:
    clock_time_for_event_on_master + clock_difference_between_master_and_slave +
    SQL_DELAY.
  */
  time_t sql_delay_end;

  /*
    Before the MASTER_DELAY parameter was added (WL#344),
    relay_log.info had 4 lines. Now it has 5 lines.
  */
  static const int LINES_IN_RELAY_LOG_INFO_WITH_DELAY= 5;
  /*
    Hint for when to stop event distribution by sql driver thread.
    The flag is set ON by a non-group event when this event is in the middle
    of a group (e.g a transaction group) so it's too early
    to refresh the current-relay-log vs until-log cached comparison result.
    And it is checked and to decide whether it's a right time to do so
    when the being processed group has been fully scheduled.
  */
  bool until_relay_log_names_defer;

  /*
    Holds the state of the data in the relay log.
    We need this to ensure that we are not in the middle of a
    statement or inside BEGIN ... COMMIT when should rotate the
    relay log.
  */
  uint32 m_flags;
};


/*
  In parallel replication, if we need to re-try a transaction due to a
  deadlock or other temporary error, we may need to go back and re-read events
  out of an earlier relay log.

  This structure keeps track of the relaylogs that are potentially in use.
  Each rpl_group_info has a pointer to one of those, corresponding to the
  first GTID event.

  A pair of reference count keeps track of how long a relay log is potentially
  in use. When the `completed' flag is set, all events have been read out of
  the relay log, but the log might still be needed for retry in worker
  threads.  As worker threads complete an event group, they increment
  atomically the `dequeued_count' with number of events queued. Thus, when
  completed is set and dequeued_count equals queued_count, the relay log file
  is finally done with and can be purged.

  By separating the queued and dequeued count, only the dequeued_count needs
  multi-thread synchronisation; the completed flag and queued_count fields
  are only accessed by the SQL driver thread and need no synchronisation.
*/
struct inuse_relaylog {
  inuse_relaylog *next;
  Relay_log_info *rli;
  /*
    relay_log_state holds the binlog state corresponding to the start of this
    relay log file. It is an array with relay_log_state_count elements.
  */
  rpl_gtid *relay_log_state;
  uint32 relay_log_state_count;
  /* Number of events in this relay log queued for worker threads. */
  Atomic_counter<int64> queued_count;
  /* Number of events completed by worker threads. */
  Atomic_counter<int64> dequeued_count;
  /* Set when all events have been read from a relaylog. */
  bool completed;
  char name[FN_REFLEN];

  inuse_relaylog(Relay_log_info *rli_arg, rpl_gtid *relay_log_state_arg,
                 uint32 relay_log_state_count_arg,
                 const char *name_arg):
    next(0), rli(rli_arg), relay_log_state(relay_log_state_arg),
    relay_log_state_count(relay_log_state_count_arg), queued_count(0),
    dequeued_count(0), completed(false)
  {
    strmake_buf(name, name_arg);
  }
};


/*
  This is data for various state needed to be kept for the processing of
  one event group (transaction) during replication.

  In single-threaded replication, there will be one global rpl_group_info and
  one global Relay_log_info per master connection. They will be linked
  together.

  In parallel replication, there will be one rpl_group_info object for
  each running sql thread, each having their own thd.

  All rpl_group_info will share the same Relay_log_info.
*/

struct rpl_group_info
{
  rpl_group_info *next;             /* For free list in rpl_parallel_thread */
  Relay_log_info *rli;
  THD *thd;
  /*
    Current GTID being processed.
    The sub_id gives the binlog order within one domain_id. A zero sub_id
    means that there is no active GTID.
  */
  uint64 gtid_sub_id;
  rpl_gtid current_gtid;
  uint64 commit_id;
  /*
    This is used to keep transaction commit order.
    We will signal this when we commit, and can register it to wait for the
    commit_orderer of the previous commit to signal us.
  */
  wait_for_commit commit_orderer;
  /*
    If non-zero, the sub_id of a prior event group whose commit we have to wait
    for before committing ourselves. Then wait_commit_group_info points to the
    event group to wait for.

    Before using this, rpl_parallel_entry::last_committed_sub_id should be
    compared against wait_commit_sub_id. Only if last_committed_sub_id is
    smaller than wait_commit_sub_id must the wait be done (otherwise the
    waited-for transaction is already committed, so we would otherwise wait
    for the wrong commit).
  */
  uint64 wait_commit_sub_id;
  rpl_group_info *wait_commit_group_info;
  /*
    This holds a pointer to a struct that keeps track of the need to wait
    for the previous batch of event groups to reach the commit stage, before
    this batch can start to execute.

    (When we execute in parallel the transactions that group committed
    together on the master, we still need to wait for any prior transactions
    to have reached the commit stage).

    The pointed-to gco is only valid for as long as
    gtid_sub_id < parallel_entry->last_committed_sub_id. After that, it can
    be freed by another thread.
  */
  group_commit_orderer *gco;

  struct rpl_parallel_entry *parallel_entry;

  /*
    A container to hold on Intvar-, Rand-, Uservar- log-events in case
    the slave is configured with table filtering rules.
    The withhold events are executed when their parent Query destiny is
    determined for execution as well.
  */
  Deferred_log_events *deferred_events;

  /*
    State of the container: true stands for IRU events gathering, 
    false does for execution, either deferred or direct.
  */
  bool deferred_events_collecting;

  Annotate_rows_log_event *m_annotate_event;

  RPL_TABLE_LIST *tables_to_lock;           /* RBR: Tables to lock  */
  uint tables_to_lock_count;        /* RBR: Count of tables to lock */
  table_mapping m_table_map;      /* RBR: Mapping table-id to table */
  mysql_mutex_t sleep_lock;
  mysql_cond_t sleep_cond;

  /*
    trans_retries varies between 0 to slave_transaction_retries and counts how
    many times the slave has retried the present transaction; gets reset to 0
    when the transaction finally succeeds.
  */
  ulong trans_retries;

  /*
    Used to defer stopping the SQL thread to give it a chance
    to finish up the current group of events.
    The timestamp is set and reset in @c sql_slave_killed().
  */
  time_t last_event_start_time;

  char *event_relay_log_name;
  char event_relay_log_name_buf[FN_REFLEN];
  ulonglong event_relay_log_pos;
  ulonglong future_event_relay_log_pos;
  /*
    The master log name for current event. Only used in parallel replication.
  */
  char future_event_master_log_name[FN_REFLEN];
  bool is_parallel_exec;
  /* When gtid_pending is true, we have not yet done record_gtid(). */
  bool gtid_pending;
  int worker_error;
  /*
    Set true when we signalled that we reach the commit phase. Used to avoid
    counting one event group twice.
  */
  bool did_mark_start_commit;
  /* Copy of flags2 from GTID event. */
  uchar gtid_ev_flags2;
  enum {
    GTID_DUPLICATE_NULL=0,
    GTID_DUPLICATE_IGNORE=1,
    GTID_DUPLICATE_OWNER=2
  };
  /*
    When --gtid-ignore-duplicates, this is set to one of the above three
    values:
    GTID_DUPLICATE_NULL    - Not using --gtid-ignore-duplicates.
    GTID_DUPLICATE_IGNORE  - This gtid already applied, skip the event group.
    GTID_DUPLICATE_OWNER   - We are the current owner of the domain, and must
                             apply the event group and then release the domain.
  */
  uint8 gtid_ignore_duplicate_state;

  /*
    Runtime state for printing a note when slave is taking
    too long while processing a row event.
   */
  longlong row_stmt_start_timestamp;
  bool long_find_row_note_printed;
  /* Needs room for "Gtid D-S-N\x00". */
  char gtid_info_buf[5+10+1+10+1+20+1];

  /*
    The timestamp, from the master, of the commit event.
    Used to do delayed update of rli->last_master_timestamp, for getting
    reasonable values out of Seconds_Behind_Master in SHOW SLAVE STATUS.
  */
  time_t last_master_timestamp;

  /*
    Information to be able to re-try an event group in case of a deadlock or
    other temporary error.
  */
  inuse_relaylog *relay_log;
  uint64 retry_start_offset;
  uint64 retry_event_count;
  /*
    If `speculation' is != SPECULATE_NO, then we are optimistically running
    this transaction in parallel, even though it might not be safe (there may
    be a conflict with a prior event group).

    In this case, a conflict can cause other errors than deadlocks (like
    duplicate key for example). So in case of _any_ error, we need to roll
    back and retry the event group.
  */
  enum enum_speculation {
    /*
      This transaction was group-committed together on the master with the
      other transactions with which it is replicated in parallel.
    */
    SPECULATE_NO,
    /*
      We will optimistically try to run this transaction in parallel with
      other transactions, even though it is not known to be conflict free.
      If we get a conflict, we will detect it as a deadlock, roll back and
      retry.
    */
    SPECULATE_OPTIMISTIC,
    /*
      This transaction got a conflict during speculative parallel apply, or
      it was marked on the master as likely to cause a conflict or unsafe to
      speculate. So it will wait for the prior transaction to commit before
      starting to replicate.
    */
    SPECULATE_WAIT
  } speculation;
  enum enum_retry_killed {
    RETRY_KILL_NONE = 0,
    RETRY_KILL_PENDING,
    RETRY_KILL_KILLED
  };
  uchar killed_for_retry;

  rpl_group_info(Relay_log_info *rli_);
  ~rpl_group_info();
  void reinit(Relay_log_info *rli);

  /* 
     Returns true if the argument event resides in the containter;
     more specifically, the checking is done against the last added event.
  */
  bool is_deferred_event(Log_event * ev)
  {
    return deferred_events_collecting ? deferred_events->is_last(ev) : false;
  };
  /* The general cleanup that slave applier may need at the end of query. */
  inline void cleanup_after_query()
  {
    if (deferred_events)
      deferred_events->rewind();
  };
  /* The general cleanup that slave applier may need at the end of session. */
  void cleanup_after_session()
  {
    if (deferred_events)
    {
      delete deferred_events;
      deferred_events= NULL;
    }
  };

  /**
    Save pointer to Annotate_rows event and switch on the
    binlog_annotate_row_events for this sql thread.
    To be called when sql thread receives an Annotate_rows event.
  */
  inline void set_annotate_event(Annotate_rows_log_event *event)
  {
    DBUG_ASSERT(m_annotate_event == NULL);
    m_annotate_event= event;
    this->thd->variables.binlog_annotate_row_events= 1;
  }

  /**
    Returns pointer to the saved Annotate_rows event or NULL if there is
    no saved event.
  */
  inline Annotate_rows_log_event* get_annotate_event()
  {
    return m_annotate_event;
  }

  /**
    Delete saved Annotate_rows event (if any) and switch off the
    binlog_annotate_row_events for this sql thread.
    To be called when sql thread has applied the last (i.e. with
    STMT_END_F flag) rbr event.
  */
  inline void free_annotate_event()
  {
    if (m_annotate_event)
    {
      this->thd->variables.binlog_annotate_row_events= 0;
      delete m_annotate_event;
      m_annotate_event= 0;
    }
  }

  bool get_table_data(TABLE *table_arg, table_def **tabledef_var, TABLE **conv_table_var) const
  {
    DBUG_ASSERT(tabledef_var && conv_table_var);
    for (TABLE_LIST *ptr= tables_to_lock ; ptr != NULL ; ptr= ptr->next_global)
      if (ptr->table == table_arg)
      {
        *tabledef_var= &static_cast<RPL_TABLE_LIST*>(ptr)->m_tabledef;
        *conv_table_var= static_cast<RPL_TABLE_LIST*>(ptr)->m_conv_table;
        DBUG_PRINT("debug", ("Fetching table data for table %s.%s:"
                             " tabledef: %p, conv_table: %p",
                             table_arg->s->db.str, table_arg->s->table_name.str,
                             *tabledef_var, *conv_table_var));
        return true;
      }
    return false;
  }

  void clear_tables_to_lock();
  void cleanup_context(THD *, bool, bool keep_domain_owner= false);
  void slave_close_thread_tables(THD *);
  void mark_start_commit_no_lock();
  void mark_start_commit();
  char *gtid_info();
  void unmark_start_commit();

  longlong get_row_stmt_start_timestamp()
  {
    return row_stmt_start_timestamp;
  }

  void set_row_stmt_start_timestamp()
  {
    if (row_stmt_start_timestamp == 0)
      row_stmt_start_timestamp= microsecond_interval_timer();
  }

  void reset_row_stmt_start_timestamp()
  {
    row_stmt_start_timestamp= 0;
  }

  void set_long_find_row_note_printed()
  {
    long_find_row_note_printed= true;
  }

  void unset_long_find_row_note_printed()
  {
    long_find_row_note_printed= false;
  }

  bool is_long_find_row_note_printed()
  {
    return long_find_row_note_printed;
  }

  inline void inc_event_relay_log_pos()
  {
    if (!is_parallel_exec)
      rli->event_relay_log_pos= future_event_relay_log_pos;
  }
};


/*
  The class rpl_sql_thread_info is the THD::system_thread_info for an SQL
  thread; this is either the driver SQL thread or a worker thread for parallel
  replication.
*/
class rpl_sql_thread_info
{
public:
  char cached_charset[6];
  Rpl_filter* rpl_filter;

  rpl_sql_thread_info(Rpl_filter *filter);

  /*
    Last charset (6 bytes) seen by slave SQL thread is cached here; it helps
    the thread save 3 get_charset() per Query_log_event if the charset is not
    changing from event to event (common situation).
    When the 6 bytes are equal to 0 is used to mean "cache is invalidated".
  */
  void cached_charset_invalidate();
  bool cached_charset_compare(char *charset) const;
};


extern struct rpl_slave_state *rpl_global_gtid_slave_state;
extern gtid_waiting rpl_global_gtid_waiting;

int rpl_load_gtid_slave_state(THD *thd);
int find_gtid_slave_pos_tables(THD *thd);
int event_group_new_gtid(rpl_group_info *rgi, Gtid_log_event *gev);
void delete_or_keep_event_post_apply(rpl_group_info *rgi,
                                     Log_event_type typ, Log_event *ev);

#endif /* RPL_RLI_H */
server/private/custom_conf.h000064400000002072150400264000012204 0ustar00/* Copyright (c) 2000, 2006 MySQL AB
   Use is subject to license terms

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#ifndef __MYSQL_CUSTOM_BUILD_CONFIG__
#define __MYSQL_CUSTOM_BUILD_CONFIG__

#define MYSQL_PORT		5002
#ifdef _WIN32
#define MYSQL_NAMEDPIPE		"SwSqlServer"
#define MYSQL_SERVICENAME	"SwSqlServer"
#define KEY_SERVICE_PARAMETERS
"SYSTEM\\CurrentControlSet\\Services\\SwSqlServer\\Parameters"
#endif

#endif /* __MYSQL_CUSTOM_BUILD_CONFIG__ */
server/private/win_tzname_data.h000064400000014552150400264000013037 0ustar00/* This file  was generated using gen_win_tzname_data.ps1 */
{L"Dateline Standard Time","Etc/GMT+12"},
{L"UTC-11","Etc/GMT+11"},
{L"Aleutian Standard Time","America/Adak"},
{L"Hawaiian Standard Time","Pacific/Honolulu"},
{L"Marquesas Standard Time","Pacific/Marquesas"},
{L"Alaskan Standard Time","America/Anchorage"},
{L"UTC-09","Etc/GMT+9"},
{L"Pacific Standard Time (Mexico)","America/Tijuana"},
{L"UTC-08","Etc/GMT+8"},
{L"Pacific Standard Time","America/Los_Angeles"},
{L"US Mountain Standard Time","America/Phoenix"},
{L"Mountain Standard Time (Mexico)","America/Mazatlan"},
{L"Mountain Standard Time","America/Denver"},
{L"Yukon Standard Time","America/Whitehorse"},
{L"Central America Standard Time","America/Guatemala"},
{L"Central Standard Time","America/Chicago"},
{L"Easter Island Standard Time","Pacific/Easter"},
{L"Central Standard Time (Mexico)","America/Mexico_City"},
{L"Canada Central Standard Time","America/Regina"},
{L"SA Pacific Standard Time","America/Bogota"},
{L"Eastern Standard Time (Mexico)","America/Cancun"},
{L"Eastern Standard Time","America/New_York"},
{L"Haiti Standard Time","America/Port-au-Prince"},
{L"Cuba Standard Time","America/Havana"},
{L"US Eastern Standard Time","America/Indianapolis"},
{L"Turks And Caicos Standard Time","America/Grand_Turk"},
{L"Paraguay Standard Time","America/Asuncion"},
{L"Atlantic Standard Time","America/Halifax"},
{L"Venezuela Standard Time","America/Caracas"},
{L"Central Brazilian Standard Time","America/Cuiaba"},
{L"SA Western Standard Time","America/La_Paz"},
{L"Pacific SA Standard Time","America/Santiago"},
{L"Newfoundland Standard Time","America/St_Johns"},
{L"Tocantins Standard Time","America/Araguaina"},
{L"E. South America Standard Time","America/Sao_Paulo"},
{L"SA Eastern Standard Time","America/Cayenne"},
{L"Argentina Standard Time","America/Buenos_Aires"},
{L"Greenland Standard Time","America/Godthab"},
{L"Montevideo Standard Time","America/Montevideo"},
{L"Magallanes Standard Time","America/Punta_Arenas"},
{L"Saint Pierre Standard Time","America/Miquelon"},
{L"Bahia Standard Time","America/Bahia"},
{L"UTC-02","Etc/GMT+2"},
{L"Azores Standard Time","Atlantic/Azores"},
{L"Cape Verde Standard Time","Atlantic/Cape_Verde"},
{L"UTC","Etc/UTC"},
{L"GMT Standard Time","Europe/London"},
{L"Greenwich Standard Time","Atlantic/Reykjavik"},
{L"Sao Tome Standard Time","Africa/Sao_Tome"},
{L"Morocco Standard Time","Africa/Casablanca"},
{L"W. Europe Standard Time","Europe/Berlin"},
{L"Central Europe Standard Time","Europe/Budapest"},
{L"Romance Standard Time","Europe/Paris"},
{L"Central European Standard Time","Europe/Warsaw"},
{L"W. Central Africa Standard Time","Africa/Lagos"},
{L"Jordan Standard Time","Asia/Amman"},
{L"GTB Standard Time","Europe/Bucharest"},
{L"Middle East Standard Time","Asia/Beirut"},
{L"Egypt Standard Time","Africa/Cairo"},
{L"E. Europe Standard Time","Europe/Chisinau"},
{L"Syria Standard Time","Asia/Damascus"},
{L"West Bank Standard Time","Asia/Hebron"},
{L"South Africa Standard Time","Africa/Johannesburg"},
{L"FLE Standard Time","Europe/Kiev"},
{L"Israel Standard Time","Asia/Jerusalem"},
{L"South Sudan Standard Time","Africa/Juba"},
{L"Kaliningrad Standard Time","Europe/Kaliningrad"},
{L"Sudan Standard Time","Africa/Khartoum"},
{L"Libya Standard Time","Africa/Tripoli"},
{L"Namibia Standard Time","Africa/Windhoek"},
{L"Arabic Standard Time","Asia/Baghdad"},
{L"Turkey Standard Time","Europe/Istanbul"},
{L"Arab Standard Time","Asia/Riyadh"},
{L"Belarus Standard Time","Europe/Minsk"},
{L"Russian Standard Time","Europe/Moscow"},
{L"E. Africa Standard Time","Africa/Nairobi"},
{L"Iran Standard Time","Asia/Tehran"},
{L"Arabian Standard Time","Asia/Dubai"},
{L"Astrakhan Standard Time","Europe/Astrakhan"},
{L"Azerbaijan Standard Time","Asia/Baku"},
{L"Russia Time Zone 3","Europe/Samara"},
{L"Mauritius Standard Time","Indian/Mauritius"},
{L"Saratov Standard Time","Europe/Saratov"},
{L"Georgian Standard Time","Asia/Tbilisi"},
{L"Volgograd Standard Time","Europe/Volgograd"},
{L"Caucasus Standard Time","Asia/Yerevan"},
{L"Afghanistan Standard Time","Asia/Kabul"},
{L"West Asia Standard Time","Asia/Tashkent"},
{L"Ekaterinburg Standard Time","Asia/Yekaterinburg"},
{L"Pakistan Standard Time","Asia/Karachi"},
{L"Qyzylorda Standard Time","Asia/Qyzylorda"},
{L"India Standard Time","Asia/Calcutta"},
{L"Sri Lanka Standard Time","Asia/Colombo"},
{L"Nepal Standard Time","Asia/Katmandu"},
{L"Central Asia Standard Time","Asia/Bishkek"},
{L"Bangladesh Standard Time","Asia/Dhaka"},
{L"Omsk Standard Time","Asia/Omsk"},
{L"Myanmar Standard Time","Asia/Rangoon"},
{L"SE Asia Standard Time","Asia/Bangkok"},
{L"Altai Standard Time","Asia/Barnaul"},
{L"W. Mongolia Standard Time","Asia/Hovd"},
{L"North Asia Standard Time","Asia/Krasnoyarsk"},
{L"N. Central Asia Standard Time","Asia/Novosibirsk"},
{L"Tomsk Standard Time","Asia/Tomsk"},
{L"China Standard Time","Asia/Shanghai"},
{L"North Asia East Standard Time","Asia/Irkutsk"},
{L"Singapore Standard Time","Asia/Singapore"},
{L"W. Australia Standard Time","Australia/Perth"},
{L"Taipei Standard Time","Asia/Taipei"},
{L"Ulaanbaatar Standard Time","Asia/Ulaanbaatar"},
{L"Aus Central W. Standard Time","Australia/Eucla"},
{L"Transbaikal Standard Time","Asia/Chita"},
{L"Tokyo Standard Time","Asia/Tokyo"},
{L"North Korea Standard Time","Asia/Pyongyang"},
{L"Korea Standard Time","Asia/Seoul"},
{L"Yakutsk Standard Time","Asia/Yakutsk"},
{L"Cen. Australia Standard Time","Australia/Adelaide"},
{L"AUS Central Standard Time","Australia/Darwin"},
{L"E. Australia Standard Time","Australia/Brisbane"},
{L"AUS Eastern Standard Time","Australia/Sydney"},
{L"West Pacific Standard Time","Pacific/Port_Moresby"},
{L"Tasmania Standard Time","Australia/Hobart"},
{L"Vladivostok Standard Time","Asia/Vladivostok"},
{L"Lord Howe Standard Time","Australia/Lord_Howe"},
{L"Bougainville Standard Time","Pacific/Bougainville"},
{L"Russia Time Zone 10","Asia/Srednekolymsk"},
{L"Magadan Standard Time","Asia/Magadan"},
{L"Norfolk Standard Time","Pacific/Norfolk"},
{L"Sakhalin Standard Time","Asia/Sakhalin"},
{L"Central Pacific Standard Time","Pacific/Guadalcanal"},
{L"Russia Time Zone 11","Asia/Kamchatka"},
{L"New Zealand Standard Time","Pacific/Auckland"},
{L"UTC+12","Etc/GMT-12"},
{L"Fiji Standard Time","Pacific/Fiji"},
{L"Chatham Islands Standard Time","Pacific/Chatham"},
{L"UTC+13","Etc/GMT-13"},
{L"Tonga Standard Time","Pacific/Tongatapu"},
{L"Samoa Standard Time","Pacific/Apia"},
{L"Line Islands Standard Time","Pacific/Kiritimati"},
server/private/sql_plugin_compat.h000064400000004275150400264000013414 0ustar00/* Copyright (C) 2013 Sergei Golubchik and Monty Program Ab

   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 */

/* old plugin api structures, used for backward compatibility */

#define upgrade_var(X) latest->X= X
#define upgrade_str(X) strmake_buf(latest->X, X)
#define downgrade_var(X) X= latest->X
#define downgrade_str(X) strmake_buf(X, latest->X)

/**************************************************************/
/* Authentication API, version 0x0100 *************************/
#define MIN_AUTHENTICATION_INTERFACE_VERSION 0x0100

struct MYSQL_SERVER_AUTH_INFO_0x0100 {
  const char *user_name;
  unsigned int user_name_length;
  const char *auth_string;
  unsigned long auth_string_length;
  char authenticated_as[49]; 
  char external_user[512];
  int  password_used;
  const char *host_or_ip;
  unsigned int host_or_ip_length;

  void upgrade(MYSQL_SERVER_AUTH_INFO *latest)
  {
    upgrade_var(user_name);
    upgrade_var(user_name_length);
    upgrade_var(auth_string);
    upgrade_var(auth_string_length);
    upgrade_str(authenticated_as);
    upgrade_str(external_user);
    upgrade_var(password_used);
    upgrade_var(host_or_ip);
    upgrade_var(host_or_ip_length);
  }
  void downgrade(MYSQL_SERVER_AUTH_INFO *latest)
  {
    downgrade_var(user_name);
    downgrade_var(user_name_length);
    downgrade_var(auth_string);
    downgrade_var(auth_string_length);
    downgrade_str(authenticated_as);
    downgrade_str(external_user);
    downgrade_var(password_used);
    downgrade_var(host_or_ip);
    downgrade_var(host_or_ip_length);
  }
};

/**************************************************************/

server/private/aria_backup.h000064400000003013150400264000012122 0ustar00/* Copyright (C) 2018,2020 MariaDB Corporation Ab

   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 Street, Fifth Floor, Boston, MA 02111-1301 USA */

/* Interfaces for doing backups of Aria tables */

C_MODE_START

typedef struct st_aria_table_capabilities
{
  my_off_t header_size;
  ulong bitmap_pages_covered;
  uint block_size;
  uint keypage_header;
  enum data_file_type data_file_type;
  my_bool checksum;
  my_bool transactional;
  my_bool encrypted;
  /* This is true if the table can be copied without any locks */
  my_bool online_backup_safe;
  /* s3 capabilities */
  ulong s3_block_size;
  uint8 compression;
} ARIA_TABLE_CAPABILITIES;

int aria_get_capabilities(File kfile, ARIA_TABLE_CAPABILITIES *cap);
int aria_read_index(File kfile, ARIA_TABLE_CAPABILITIES *cap, ulonglong block,
                    uchar *buffer);
int aria_read_data(File dfile, ARIA_TABLE_CAPABILITIES *cap, ulonglong block,
                   uchar *buffer, size_t *bytes_read);
C_MODE_END
server/private/t_ctype.h000064400000013007150400264000011334 0ustar00/* Copyright (C) 2000 MySQL AB
   Use is subject to license terms

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/*
  Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved.
  Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved.
  Permission to use, copy, modify, distribute and sell this software
   and its documentation for any purpose is hereby granted without fee,
   provided that the above copyright notice appear in all copies.
   Smaphan Raruenrom and Pruet Boonma makes no representations about 
   the suitability of this software for any purpose.  It is provided
    "as is" without express or implied warranty.
*/

/* LC_COLLATE category + Level information */

#ifndef _t_ctype_h
#define _t_ctype_h

#define TOT_LEVELS 5
#define LAST_LEVEL 4  /* TOT_LEVELS - 1 */

#define IGNORE 0


/* level 1 symbols & order */
enum l1_symbols {
    L1_08 = TOT_LEVELS,
    L1_18,
    L1_28,
    L1_38,
    L1_48,
    L1_58,
    L1_68,
    L1_78,
    L1_88,
    L1_98,
    L1_A8,
    L1_B8,
    L1_C8,
    L1_D8,
    L1_E8,
    L1_F8,
    L1_G8,
    L1_H8,
    L1_I8,
    L1_J8,
    L1_K8,
    L1_L8,
    L1_M8,
    L1_N8,
    L1_O8,
    L1_P8,
    L1_Q8,
    L1_R8,
    L1_S8,
    L1_T8,
    L1_U8,
    L1_V8,
    L1_W8,
    L1_X8,
    L1_Y8,
    L1_Z8,
    L1_KO_KAI,
    L1_KHO_KHAI,
    L1_KHO_KHUAT,
    L1_KHO_KHWAI,
    L1_KHO_KHON,
    L1_KHO_RAKHANG,
    L1_NGO_NGU,
    L1_CHO_CHAN,
    L1_CHO_CHING,
    L1_CHO_CHANG,
    L1_SO_SO,
    L1_CHO_CHOE,
    L1_YO_YING,
    L1_DO_CHADA,
    L1_TO_PATAK,
    L1_THO_THAN,
    L1_THO_NANGMONTHO,
    L1_THO_PHUTHAO,
    L1_NO_NEN,
    L1_DO_DEK,
    L1_TO_TAO,
    L1_THO_THUNG,
    L1_THO_THAHAN,
    L1_THO_THONG,
    L1_NO_NU,
    L1_BO_BAIMAI,
    L1_PO_PLA,
    L1_PHO_PHUNG,
    L1_FO_FA,
    L1_PHO_PHAN,
    L1_FO_FAN,
    L1_PHO_SAMPHAO,
    L1_MO_MA,
    L1_YO_YAK,
    L1_RO_RUA,
    L1_RU,
    L1_LO_LING,
    L1_LU,
    L1_WO_WAEN,
    L1_SO_SALA,
    L1_SO_RUSI,
    L1_SO_SUA,
    L1_HO_HIP,
    L1_LO_CHULA,
    L1_O_ANG,
    L1_HO_NOKHUK,
    L1_NKHIT,
    L1_SARA_A,
    L1_MAI_HAN_AKAT,
    L1_SARA_AA,
    L1_SARA_AM,
    L1_SARA_I,
    L1_SARA_II,
    L1_SARA_UE,
    L1_SARA_UEE,
    L1_SARA_U,
    L1_SARA_UU,
    L1_SARA_E,
    L1_SARA_AE,
    L1_SARA_O,
    L1_SARA_AI_MAIMUAN,
    L1_SARA_AI_MAIMALAI
};

/* level 2 symbols & order */
enum l2_symbols {
    L2_BLANK = TOT_LEVELS,
    L2_THAII,
    L2_YAMAK,
    L2_PINTHU,
    L2_GARAN,
    L2_TYKHU,
    L2_TONE1,
    L2_TONE2,
    L2_TONE3,
    L2_TONE4
};

/* level 3 symbols & order */
enum l3_symbols {
	L3_BLANK = TOT_LEVELS,
    L3_SPACE,
    L3_NB_SACE,
    L3_LOW_LINE,
    L3_HYPHEN,
    L3_COMMA,
    L3_SEMICOLON,
    L3_COLON,
    L3_EXCLAMATION,
    L3_QUESTION,
    L3_SOLIDUS,
    L3_FULL_STOP,
    L3_PAIYAN_NOI,
    L3_MAI_YAMOK,
    L3_GRAVE,
    L3_CIRCUMFLEX,
    L3_TILDE,
    L3_APOSTROPHE,
    L3_QUOTATION,
    L3_L_PARANTHESIS,
    L3_L_BRACKET,
    L3_L_BRACE,
    L3_R_BRACE,
    L3_R_BRACKET,
    L3_R_PARENTHESIS,
    L3_AT,
    L3_BAHT,
    L3_DOLLAR,
    L3_FONGMAN,
    L3_ANGKHANKHU,
    L3_KHOMUT,
    L3_ASTERISK,
    L3_BK_SOLIDUS,
    L3_AMPERSAND,
    L3_NUMBER,
    L3_PERCENT,
    L3_PLUS,
    L3_LESS_THAN,
    L3_EQUAL,
    L3_GREATER_THAN,
    L3_V_LINE
};

/* level 4 symbols & order */
enum l4_symbols {
    L4_BLANK = TOT_LEVELS,
    L4_MIN,
    L4_CAP,
    L4_EXT
};

enum level_symbols {
    L_UPRUPR = TOT_LEVELS,
    L_UPPER,
    L_MIDDLE,
    L_LOWER
};

#define	_is(c)			(t_ctype[(c)][LAST_LEVEL])
#define _level			8
#define _consnt			16
#define _ldvowel		32
#define _fllwvowel		64
#define _uprvowel		128
#define _lwrvowel		256
#define _tone			512
#define _diacrt1		1024
#define _diacrt2		2048
#define _combine		4096
#define _stone			8192
#define _tdig			16384
#define _rearvowel		(_fllwvowel | _uprvowel | _lwrvowel)
#define _diacrt			(_diacrt1 | _diacrt2)
#define levelof(c)		( _is(c) & _level )
#define isthai(c)		( (c) >= 128 )
#define istalpha(c)		( _is(c) & (_consnt|_ldvowel|_rearvowel|\
                         _tone|_diacrt1|_diacrt2) )
#define isconsnt(c)		( _is(c) & _consnt )
#define isldvowel(c)	( _is(c) & _ldvowel )
#define isfllwvowel(c)	( _is(c) & _fllwvowel )
#define ismidvowel(c)	( _is(c) & (_ldvowel|_fllwvowel) )
#define isuprvowel(c)	( _is(c) & _uprvowel )
#define islwrvowel(c)	( _is(c) & _lwrvowel )
#define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel))
#define isrearvowel(c)	( _is(c) & _rearvowel )
#define isvowel(c)      ( _is(c) & (_ldvowel|_rearvowel) )
#define istone(c)       ( _is(c) & _tone )
#define isunldable(c)   ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) )
#define iscombinable(c) ( _is(c) & _combine )
#define istdigit(c)     ( _is(c) & _tdig )
#define isstone(c)      ( _is(c) & _stone )
#define isdiacrt1(c)	( _is(c) & _diacrt1)
#define isdiacrt2(c)	( _is(c) & _diacrt2)
#define isdiacrt(c)		( _is(c) & _diacrt) 

/* Function prototype called by sql/field.cc */
void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length);

#endif  
server/private/my_minidump.h000064400000001520150400264000012211 0ustar00/* Copyright (c) 2021, 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 <windows.h>
#ifdef __cplusplus
extern "C" {
#endif

BOOL my_create_minidump(DWORD pid, BOOL verbose);

#ifdef __cplusplus
}
#endif
server/private/item_subselect.h000064400000163421150400264000012702 0ustar00#ifndef ITEM_SUBSELECT_INCLUDED
#define ITEM_SUBSELECT_INCLUDED

/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.

   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 */

/* subselect Item */

#include "item.h"
#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include <queues.h>

class st_select_lex;
class st_select_lex_unit;
class JOIN;
class select_result_interceptor;
class subselect_engine;
class subselect_hash_sj_engine;
class Item_bool_func2;
class Comp_creator;
class With_element;
class Field_pair;

typedef class st_select_lex SELECT_LEX;

/**
  Convenience typedef used in this file, and further used by any files
  including this file.
*/
typedef Comp_creator* (*chooser_compare_func_creator)(bool invert);
class Cached_item;
class Subq_materialization_tracker;
class Explain_subq_materialization;

/* base class for subselects */

class Item_subselect :public Item_result_field,
                      protected Used_tables_and_const_cache
{
  /*
    Set to TRUE if the value is assigned for the subselect
    FALSE: subquery not executed or the subquery returns an empty result
  */
  bool value_assigned;
  bool own_engine;  /* the engine was not taken from other Item_subselect */
protected:
  /* thread handler, will be assigned in fix_fields only */
  THD *thd;
  /* old engine if engine was changed */
  subselect_engine *old_engine;
  /* allowed number of columns (1 for single value subqueries) */
  uint max_columns;
  /* where subquery is placed */
  enum_parsing_place parsing_place;
  /* work with 'substitution' */
  bool have_to_be_excluded;
  
  bool inside_first_fix_fields;
  bool done_first_fix_fields;
  Item *expr_cache;
  /*
    Set to TRUE if at optimization or execution time we determine that this
    item's value is a constant. We need this member because it is not possible
    to substitute 'this' with a constant item.
  */
  bool forced_const;
  /* Set to the result of the last call of is_expensive()  */
  bool expensive_fl;
#ifndef DBUG_OFF
  /* Count the number of times this subquery predicate has been executed. */
  uint exec_counter;
#endif
public:
  /* 
    Used inside Item_subselect::fix_fields() according to this scenario:
      > Item_subselect::fix_fields
        > engine->prepare
          > child_join->prepare
            (Here we realize we need to do the rewrite and set
             substitution= some new Item, eg. Item_in_optimizer )
          < child_join->prepare
        < engine->prepare
        *ref= substitution;
        substitution= NULL;
      < Item_subselect::fix_fields
  */
  /* TODO make this protected member again. */
  Item *substitution;
  /* engine that perform execution of subselect (single select or union) */
  /* TODO make this protected member again. */
  subselect_engine *engine;
  /* unit of subquery */
  st_select_lex_unit *unit;
  /* Cached buffers used when calling filesort in sub queries */
  Filesort_buffer filesort_buffer;
  LEX_STRING sortbuffer;
  /* A reference from inside subquery predicate to somewhere outside of it */
  class Ref_to_outside : public Sql_alloc
  {
  public:
    st_select_lex *select; /* Select where the reference is pointing to */
    /* 
      What is being referred. This may be NULL when we're referring to an
      aggregate function.
    */ 
    Item *item; 
  };
  /*
    References from within this subquery to somewhere outside of it (i.e. to
    parent select, grandparent select, etc)
  */
  List<Ref_to_outside> upper_refs;
  st_select_lex *parent_select;

  /*
   TRUE<=>Table Elimination has made it redundant to evaluate this select
          (and so it is not part of QEP, etc)
  */
  bool eliminated;
  
  /* subquery is transformed */
  bool changed;

  /* TRUE <=> The underlying SELECT is correlated w.r.t some ancestor select */
  bool is_correlated;

  /* 
    TRUE <=> the subquery contains a recursive reference in the FROM list
    of one of its selects. In this case some of subquery optimization
    strategies cannot be applied for the subquery;
  */
  bool with_recursive_reference; 

  /* To link Item_subselects containing references to the same recursive CTE */ 
  Item_subselect *next_with_rec_ref;

  enum subs_type {UNKNOWN_SUBS, SINGLEROW_SUBS,
		  EXISTS_SUBS, IN_SUBS, ALL_SUBS, ANY_SUBS};

  Item_subselect(THD *thd);

  virtual subs_type substype() { return UNKNOWN_SUBS; }
  bool is_exists_predicate()
  {
    return substype() == Item_subselect::EXISTS_SUBS;
  }
  bool is_in_predicate()
  {
    return get_IN_subquery() != NULL;
  }

  /*
    We need this method, because some compilers do not allow 'this'
    pointer in constructor initialization list, but we need to pass a pointer
    to subselect Item class to select_result_interceptor's constructor.
  */
  virtual void init (st_select_lex *select_lex,
		     select_result_interceptor *result);

  ~Item_subselect();
  void cleanup() override;
  virtual void reset()
  {
    eliminated= FALSE;
    null_value= 1;
  }
  /**
    Set the subquery result to a default value consistent with the semantics of
    the result row produced for queries with implicit grouping.
  */
  void no_rows_in_result() override= 0;
  virtual bool select_transformer(JOIN *join);
  bool assigned() { return value_assigned; }
  void assigned(bool a) { value_assigned= a; }
  enum Type type() const override;
  bool is_null() override
  {
    update_null_value();
    return null_value;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool mark_as_dependent(THD *thd, st_select_lex *select, Item *item);
  void fix_after_pullout(st_select_lex *new_parent, Item **ref,
                         bool merge) override;
  void recalc_used_tables(st_select_lex *new_parent, bool after_pullout);
  virtual bool exec();
  /*
    If subquery optimization or execution determines that the subquery has
    an empty result, mark the subquery predicate as a constant value.
  */
  void make_const()
  { 
    used_tables_cache= 0;
    const_item_cache= 0;
    forced_const= TRUE; 
  }
  virtual bool fix_length_and_dec();
  table_map used_tables() const override;
  table_map not_null_tables() const override { return 0; }
  bool const_item() const override;
  inline table_map get_used_tables_cache() { return used_tables_cache; }
  Item *get_tmp_table_item(THD *thd) override;
  void update_used_tables() override;
  void print(String *str, enum_query_type query_type) override;
  virtual bool have_guarded_conds() { return FALSE; }
  bool change_engine(subselect_engine *eng)
  {
    old_engine= engine;
    engine= eng;
    return eng == 0;
  }
  bool engine_changed(subselect_engine *eng) { return engine != eng; }
  /*
    True if this subquery has been already evaluated. Implemented only for
    single select and union subqueries only.
  */
  bool is_evaluated() const;
  bool is_uncacheable() const;
  bool is_expensive() override;

  /*
    Used by max/min subquery to initialize value presence registration
    mechanism. Engine call this method before rexecution query.
  */
  virtual void reset_value_registration() {}
  enum_parsing_place place() { return parsing_place; }
  bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
  bool unknown_splocal_processor(void *arg) override;
  bool mark_as_eliminated_processor(void *arg) override;
  bool eliminate_subselect_processor(void *arg) override;
  bool enumerate_field_refs_processor(void *arg) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("select ...", arg, VCOL_IMPOSSIBLE);
  }
  /**
    Callback to test if an IN predicate is expensive.

    @notes
    The return value affects the behavior of make_cond_for_table().

    @retval TRUE  if the predicate is expensive
    @retval FALSE otherwise
  */
  bool is_expensive_processor(void *arg) override { return is_expensive(); }
  bool update_table_bitmaps_processor(void *arg) override;

  /**
    Get the SELECT_LEX structure associated with this Item.
    @return the SELECT_LEX structure associated with this Item
  */
  st_select_lex* get_select_lex();
  bool expr_cache_is_needed(THD *) override;
  void get_cache_parameters(List<Item> &parameters) override;
  bool is_subquery_processor (void *opt_arg) override { return 1; }
  bool exists2in_processor(void *opt_arg) override { return 0; }
  bool limit_index_condition_pushdown_processor(void *opt_arg) override
  {
    return TRUE;
  }
  bool subselect_table_finder_processor(void *arg) override;

  void register_as_with_rec_ref(With_element *with_elem);
  void init_expr_cache_tracker(THD *thd);

  Item* do_build_clone(THD *thd) const override { return nullptr; }
  Item *do_get_copy(THD *thd) const override { return 0; }

  st_select_lex *wrap_tvc_into_select(THD *thd, st_select_lex *tvc_sl);

  friend class select_result_interceptor;
  friend class Item_in_optimizer;
  friend bool Item_field::fix_fields(THD *, Item **);
  friend int  Item_field::fix_outer_field(THD *, Field **, Item **);
  friend bool Item_ref::fix_fields(THD *, Item **);
  friend void mark_select_range_as_dependent(THD*,
                                             st_select_lex*, st_select_lex*,
                                             Field*, Item*, Item_ident*,
                                             bool);
  friend bool convert_join_subqueries_to_semijoins(JOIN *join);
};

/* single value subselect */

class Item_cache;
class Item_singlerow_subselect :public Item_subselect
{
protected:
  Item_cache *value, **row;
public:
  Item_singlerow_subselect(THD *thd_arg, st_select_lex *select_lex);
  Item_singlerow_subselect(THD *thd_arg): Item_subselect(thd_arg), value(0), row (0)
  {}

  void cleanup() override;
  subs_type substype() override { return SINGLEROW_SUBS; }

  void reset() override;
  void no_rows_in_result() override;
  bool select_transformer(JOIN *join) override;
  void store(uint i, Item* item);
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *) override;
  bool val_native(THD *thd, Native *) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  const Type_handler *type_handler() const override;
  bool fix_length_and_dec() override;

  uint cols() const override;
  Item* element_index(uint i) override
  { return reinterpret_cast<Item*>(row[i]); }
  Item** addr(uint i) override { return (Item**)row + i; }
  bool check_cols(uint c) override;
  bool null_inside() override;
  void bring_value() override;

  /**
    This method is used to implement a special case of semantic tree
    rewriting, mandated by a SQL:2003 exception in the specification.
    The only caller of this method is handle_sql2003_note184_exception(),
    see the code there for more details.
    Note that this method breaks the object internal integrity, by
    removing it's association with the corresponding SELECT_LEX,
    making this object orphan from the parse tree.
    No other method, beside the destructor, should be called on this
    object, as it is now invalid.
    @return the SELECT_LEX structure that was given in the constructor.
  */
  st_select_lex* invalidate_and_restore_select_lex();

  Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override;

  friend class select_singlerow_subselect;
};

/* used in static ALL/ANY optimization */
class select_max_min_finder_subselect;
class Item_maxmin_subselect :public Item_singlerow_subselect
{
protected:
  bool max;
  bool was_values;  // Set if we have found at least one row
public:
  Item_maxmin_subselect(THD *thd, Item_subselect *parent,
			st_select_lex *select_lex, bool max);
  void print(String *str, enum_query_type query_type) override;
  void cleanup() override;
  bool any_value() { return was_values; }
  void register_value() { was_values= TRUE; }
  void reset_value_registration() override { was_values= FALSE; }
  void no_rows_in_result() override;
};

/* exists subselect */

class Item_exists_subselect :public Item_subselect
{
protected:
  Item_func_not *upper_not;
  bool value; /* value of this item (boolean: exists/not-exists) */
  bool abort_on_null;

  void init_length_and_dec();
  bool select_prepare_to_be_in();

public:
  /*
    Used by subquery optimizations to keep track about in which clause this
    subquery predicate is located: 
      NO_JOIN_NEST      - the predicate is an AND-part of the WHERE
      join nest pointer - the predicate is an AND-part of ON expression
                          of a join nest   
      NULL              - for all other locations
  */
  TABLE_LIST *emb_on_expr_nest;
  /**
    Reference on the Item_in_optimizer wrapper of this subquery
  */
  Item_in_optimizer *optimizer;
  /* true if we got this from EXISTS or to IN */
  bool exists_transformed;

  Item_exists_subselect(THD *thd_arg, st_select_lex *select_lex);
  Item_exists_subselect(THD *thd_arg):
    Item_subselect(thd_arg), upper_not(NULL), abort_on_null(0),
    emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0)
  {}

  subs_type substype() override { return EXISTS_SUBS; }
  void reset() override
  {
    eliminated= FALSE;
    value= 0;
  }
  void no_rows_in_result() override;

  const Type_handler *type_handler() const override
  {
    return &type_handler_bool;
  }
  longlong val_int() override;
  double val_real() override;
  String *val_str(String*) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_int(thd, ltime, fuzzydate); }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  void print(String *str, enum_query_type query_type) override;
  bool select_transformer(JOIN *join) override;
  void top_level_item() override { abort_on_null=1; }
  bool is_top_level_item() const override { return abort_on_null; }
  bool exists2in_processor(void *opt_arg) override;

  Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override;

  void mark_as_condition_AND_part(TABLE_LIST *embedding) override
  {
    emb_on_expr_nest= embedding;
  }
  void under_not(Item_func_not *upper) override { upper_not= upper; };

  void set_exists_transformed() { exists_transformed= TRUE; }

  friend class select_exists_subselect;
  friend class subselect_uniquesubquery_engine;
  friend class subselect_indexsubquery_engine;
};


TABLE_LIST * const NO_JOIN_NEST=(TABLE_LIST*)0x1;

/*
  Possible methods to execute an IN predicate. These are set by the optimizer
  based on user-set optimizer switches, semantic analysis and cost comparison.
*/
#define SUBS_NOT_TRANSFORMED 0 /* No execution method was chosen for this IN. */
/* The Final decision about the strategy is made. */
#define SUBS_STRATEGY_CHOSEN 1
#define SUBS_SEMI_JOIN 2       /* IN was converted to semi-join. */
#define SUBS_IN_TO_EXISTS 4    /* IN was converted to correlated EXISTS. */
#define SUBS_MATERIALIZATION 8 /* Execute IN via subquery materialization. */
/* Partial matching substrategies of MATERIALIZATION. */
#define SUBS_PARTIAL_MATCH_ROWID_MERGE 16
#define SUBS_PARTIAL_MATCH_TABLE_SCAN 32
/* ALL/ANY will be transformed with max/min optimization */
/*   The subquery has not aggregates, transform it into a MAX/MIN query. */
#define SUBS_MAXMIN_INJECTED 64
/*   The subquery has aggregates, use a special max/min subselect engine. */
#define SUBS_MAXMIN_ENGINE 128


/**
  Representation of IN subquery predicates of the form
  "left_expr IN (SELECT ...)".

  @details
  This class has: 
   - A "subquery execution engine" (as a subclass of Item_subselect) that allows
     it to evaluate subqueries. (and this class participates in execution by
     having was_null variable where part of execution result is stored.
   - Transformation methods (todo: more on this).

  This class is not used directly, it is "wrapped" into Item_in_optimizer
  which provides some small bits of subquery evaluation.
*/

class Item_in_subselect :public Item_exists_subselect
{
protected:
  /*
    Cache of the left operand of the subquery predicate. Allocated in the
    runtime memory root, for each execution, thus need not be freed.
  */
  List<Cached_item> *left_expr_cache;
  bool first_execution;

  /*
    expr & optimizer used in subselect rewriting to store Item for
    all JOIN in UNION
  */
  Item *expr;
  bool was_null;
  /* A bitmap of possible execution strategies for an IN predicate. */
  uchar in_strategy;
  /* Tracker collecting execution parameters of a materialized subquery */
  Subq_materialization_tracker *materialization_tracker;
protected:
  /* Used to trigger on/off conditions that were pushed down to subselect */
  bool *pushed_cond_guards;
  Comp_creator *func;

protected:
  bool init_cond_guards();
  bool select_in_like_transformer(JOIN *join);
  bool single_value_transformer(JOIN *join);
  bool row_value_transformer(JOIN * join);
  bool fix_having(Item *having, st_select_lex *select_lex);
  bool create_single_in_to_exists_cond(JOIN * join,
                                       Item **where_item,
                                       Item **having_item);
  bool create_row_in_to_exists_cond(JOIN * join,
                                    Item **where_item,
                                    Item **having_item);
  Item *left_expr;
  /*
    Important for PS/SP: left_expr_orig is the item that left_expr originally
    pointed at. That item is allocated on the statement arena, while
    left_expr could later be changed to something on the execution arena.
  */
  Item *left_expr_orig;

public:
  /* Priority of this predicate in the convert-to-semi-join-nest process. */
  int sj_convert_priority;
  /* May be TRUE only for the candidates to semi-join conversion */
  bool do_not_convert_to_sj; 
  /*
    Types of left_expr and subquery's select list allow to perform subquery
    materialization. Currently, we set this to FALSE when it as well could
    be TRUE. This is to be properly addressed with fix for BUG#36752.
  */
  bool types_allow_materialization;

  /* 
    Same as above, but they also allow to scan the materialized table. 
  */
  bool sjm_scan_allowed;

  /* 
    JoinTaB Materialization (JTBM) members
  */
  
  /* 
    TRUE <=> This subselect has been converted into non-mergeable semi-join
    table.
  */
  bool is_jtbm_merged;
  
  /* (Applicable if is_jtbm_merged==TRUE) Time required to run the materialized join */
  double jtbm_read_time;

  /* (Applicable if is_jtbm_merged==TRUE) Number of output rows in materialized join */
  double jtbm_record_count;   
  
  /*
    (Applicable if is_jtbm_merged==TRUE) TRUE <=> The materialized subselect is
    a degenerate subselect which produces 0 or 1 rows, which we know at
    optimization phase.
    Examples:
    1. subquery has "Impossible WHERE": 

      SELECT * FROM ot WHERE ot.column IN (SELECT it.col FROM it WHERE 2 > 3)
    
    2. Subquery produces one row which opt_sum.cc is able to get with one lookup:

      SELECT * FROM ot WHERE ot.column IN (SELECT MAX(it.key_col) FROM it)
  */
  bool is_jtbm_const_tab;
  
  /* 
    (Applicable if is_jtbm_const_tab==TRUE) Whether the subquery has produced 
     the row (or not)
  */
  bool jtbm_const_row_found;
  
  /*
    TRUE<=>this is a flattenable semi-join, false otherwise.
  */
  bool is_flattenable_semijoin;

  /*
    TRUE<=>registered in the list of semijoins in outer select
  */
  bool is_registered_semijoin;
  
  List<Field_pair> corresponding_fields;

  /*
    Used to determine how this subselect item is represented in the item tree,
    in case there is a need to locate it there and replace with something else.
    Two options are possible:
      1. This item is there 'as-is'.
      1. This item is wrapped within Item_in_optimizer.
  */
  Item *original_item()
  {
    return (is_flattenable_semijoin && !exists_transformed ?
            (Item*)this :
            (Item*)optimizer);
  }
  
  bool *get_cond_guard(int i)
  {
    return pushed_cond_guards ? pushed_cond_guards + i : NULL;
  }
  void set_cond_guard_var(int i, bool v) 
  { 
    if ( pushed_cond_guards)
      pushed_cond_guards[i]= v;
  }
  bool have_guarded_conds() override { return MY_TEST(pushed_cond_guards); }

  Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery

  /*
    SET to TRUE if IN subquery is converted from an IN predicate
  */
  bool converted_from_in_predicate;

  Item_in_subselect(THD *thd_arg, Item * left_expr, st_select_lex *select_lex);
  Item_in_subselect(THD *thd_arg):
    Item_exists_subselect(thd_arg), left_expr_cache(0), first_execution(TRUE),
    in_strategy(SUBS_NOT_TRANSFORMED), materialization_tracker(NULL),
    pushed_cond_guards(NULL), func(NULL), do_not_convert_to_sj(FALSE),
    is_jtbm_merged(FALSE), is_jtbm_const_tab(FALSE), upper_item(0),
    converted_from_in_predicate(FALSE) {}
  void cleanup() override;
  subs_type substype() override { return IN_SUBS; }
  void reset() override
  {
    eliminated= FALSE;
    value= 0;
    null_value= 0;
    was_null= 0;
  }
  bool select_transformer(JOIN *join) override;
  bool create_in_to_exists_cond(JOIN *join_arg);
  bool inject_in_to_exists_cond(JOIN *join_arg);

  bool exec() override;
  longlong val_int() override;
  double val_real() override;
  String *val_str(String*) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool val_bool() override;
  bool test_limit(st_select_lex_unit *unit);
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override { return IN_PRECEDENCE; }
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  void fix_after_pullout(st_select_lex *new_parent, Item **ref,
                         bool merge) override;
  bool const_item() const override
  {
    return Item_subselect::const_item() && left_expr->const_item();
  }
  void update_used_tables() override;
  bool setup_mat_engine();
  bool init_left_expr_cache();
  /* Inform 'this' that it was computed, and contains a valid result. */
  void set_first_execution() { if (first_execution) first_execution= FALSE; }
  bool expr_cache_is_needed(THD *thd) override;
  inline bool left_expr_has_null();

  void disable_cond_guard_for_const_null_left_expr(int i)
  {
    if (left_expr->can_eval_in_optimize())
    {
      if (left_expr->element_index(i)->is_null())
        set_cond_guard_var(i,FALSE);
    }
  }

  int optimize(double *out_rows, double *cost);
  /*
    Return the identifier that we could use to identify the subquery for the
    user.
  */
  int get_identifier();

  void block_conversion_to_sj () { do_not_convert_to_sj= TRUE; }

  bool test_strategy(uchar strategy)
  { return MY_TEST(in_strategy & strategy); }

  /**
    Test that the IN strategy was chosen for execution. This is so
    when the CHOSEN flag is ON, and there is no other strategy.
  */
  bool test_set_strategy(uchar strategy)
  {
    DBUG_ASSERT(strategy == SUBS_SEMI_JOIN ||
                strategy == SUBS_IN_TO_EXISTS ||
                strategy == SUBS_MATERIALIZATION ||
                strategy == SUBS_PARTIAL_MATCH_ROWID_MERGE ||
                strategy == SUBS_PARTIAL_MATCH_TABLE_SCAN ||
                strategy == SUBS_MAXMIN_INJECTED ||
                strategy == SUBS_MAXMIN_ENGINE);
    return ((in_strategy & SUBS_STRATEGY_CHOSEN) &&
            (in_strategy & ~SUBS_STRATEGY_CHOSEN) == strategy);
  }

  bool is_set_strategy()
  { return MY_TEST(in_strategy & SUBS_STRATEGY_CHOSEN); }

  bool has_strategy()
  { return in_strategy != SUBS_NOT_TRANSFORMED; }

  void add_strategy (uchar strategy)
  {
    DBUG_ENTER("Item_in_subselect::add_strategy");
    DBUG_PRINT("enter", ("current: %u  add: %u",
                         (uint) in_strategy, (uint) strategy));
    DBUG_ASSERT(strategy != SUBS_NOT_TRANSFORMED);
    DBUG_ASSERT(!(strategy & SUBS_STRATEGY_CHOSEN));
    /*
      TODO: PS re-execution breaks this condition, because
      check_and_do_in_subquery_rewrites() is called for each reexecution
      and re-adds the same strategies.
      DBUG_ASSERT(!(in_strategy & SUBS_STRATEGY_CHOSEN));
    */
    in_strategy|= strategy;
    DBUG_VOID_RETURN;
  }

  void reset_strategy(uchar strategy)
  {
    DBUG_ENTER("Item_in_subselect::reset_strategy");
    DBUG_PRINT("enter", ("current: %u  new: %u",
                         (uint) in_strategy, (uint) strategy));
    DBUG_ASSERT(strategy != SUBS_NOT_TRANSFORMED);
    in_strategy= strategy;
    DBUG_VOID_RETURN;
  }

  void set_strategy(uchar strategy)
  {
    DBUG_ENTER("Item_in_subselect::set_strategy");
    DBUG_PRINT("enter", ("current: %u  set: %u",
                         (uint) in_strategy,
                         (uint) (SUBS_STRATEGY_CHOSEN | strategy)));
    /* Check that only one strategy is set for execution. */
    DBUG_ASSERT(strategy == SUBS_SEMI_JOIN ||
                strategy == SUBS_IN_TO_EXISTS ||
                strategy == SUBS_MATERIALIZATION ||
                strategy == SUBS_PARTIAL_MATCH_ROWID_MERGE ||
                strategy == SUBS_PARTIAL_MATCH_TABLE_SCAN ||
                strategy == SUBS_MAXMIN_INJECTED ||
                strategy == SUBS_MAXMIN_ENGINE);
    in_strategy= (SUBS_STRATEGY_CHOSEN | strategy);
    DBUG_VOID_RETURN;
  }

  bool walk(Item_processor processor, bool walk_subquery, void *arg) override
  {
    return left_expr->walk(processor, walk_subquery, arg) ||
           Item_subselect::walk(processor, walk_subquery, arg);
  }

  bool exists2in_processor(void *opt_arg __attribute__((unused))) override
  {
    return 0;
  };

  bool pushdown_cond_for_in_subquery(THD *thd, Item *cond);

  Item_in_subselect *get_IN_subquery() override
  { return this; }
  inline Item** left_exp_ptr()
  { return &left_expr; }
  inline Item* left_exp() const
  { return left_expr; }
  inline Item* left_exp_orig() const
  { return left_expr_orig; }
  void init_subq_materialization_tracker(THD *thd);
  Subq_materialization_tracker *get_materialization_tracker() const
  { return materialization_tracker; }

  friend class Item_ref_null_helper;
  friend class Item_is_not_null_test;
  friend class Item_in_optimizer;
  friend class subselect_indexsubquery_engine;
  friend class subselect_hash_sj_engine;
  friend class subselect_partial_match_engine;
  friend class Item_exists_subselect;
};


/* ALL/ANY/SOME subselect */
class Item_allany_subselect :public Item_in_subselect
{
public:
  chooser_compare_func_creator func_creator;
  bool all;

  Item_allany_subselect(THD *thd_arg, Item * left_expr,
                        chooser_compare_func_creator fc,
                        st_select_lex *select_lex, bool all);

  void cleanup() override;
  // only ALL subquery has upper not
  subs_type substype() override { return all?ALL_SUBS:ANY_SUBS; }
  bool select_transformer(JOIN *join) override;
  void create_comp_func(bool invert) { func= func_creator(invert); }
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override { return CMP_PRECEDENCE; }
  bool is_maxmin_applicable(JOIN *join);
  bool transform_into_max_min(JOIN *join);
  void no_rows_in_result() override;
};


class subselect_engine: public Sql_alloc,
                        public Type_handler_hybrid_field_type
{
protected:
  select_result_interceptor *result; /* results storage class */
  THD *thd; /* pointer to current THD */
  Item_subselect *item; /* item, that use this engine */
  bool maybe_null; /* may be null (first item in select) */
public:

  enum enum_engine_type {ABSTRACT_ENGINE, SINGLE_SELECT_ENGINE,
                         UNION_ENGINE, UNIQUESUBQUERY_ENGINE,
                         INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE,
                         ROWID_MERGE_ENGINE, TABLE_SCAN_ENGINE,
                         SINGLE_COLUMN_ENGINE};

  subselect_engine(Item_subselect *si,
                   select_result_interceptor *res):
    Type_handler_hybrid_field_type(&type_handler_varchar),
    thd(NULL)
  {
    result= res;
    item= si;
    maybe_null= 0;
  }
  virtual ~subselect_engine() = default;; // to satisfy compiler
  virtual void cleanup()= 0;

  /*
    Also sets "thd" for subselect_engine::result.
    Should be called before prepare().
  */
  void set_thd(THD *thd_arg);
  THD * get_thd() { return thd ? thd : current_thd; }
  virtual int prepare(THD *)= 0;
  virtual bool fix_length_and_dec(Item_cache** row)= 0;
  /*
    Execute the engine

    SYNOPSIS
      exec()

    DESCRIPTION
      Execute the engine. The result of execution is subquery value that is
      either captured by previously set up select_result-based 'sink' or
      stored somewhere by the exec() method itself.

      A required side effect: If at least one pushed-down predicate is
      disabled, subselect_engine->no_rows() must return correct result after 
      the exec() call.

    RETURN
      0 - OK
      1 - Either an execution error, or the engine was "changed", and the
          caller should call exec() again for the new engine.
  */
  virtual int exec()= 0;
  virtual uint cols() const= 0; /* return number of columns in select */
  virtual uint8 uncacheable()= 0; /* query is uncacheable */
  virtual void exclude()= 0;
  virtual bool may_be_null() { return maybe_null; };
  virtual table_map upper_select_const_tables()= 0;
  static table_map calc_const_tables(TABLE_LIST *);
  static table_map calc_const_tables(List<TABLE_LIST> &list);
  virtual void print(String *str, enum_query_type query_type)= 0;
  virtual bool change_result(Item_subselect *si,
                             select_result_interceptor *result,
                             bool temp= FALSE)= 0;
  virtual bool no_tables() const = 0;
  /*
    Return true we can guarantee that the subquery will always return one row.
  */
  virtual bool always_returns_one_row() const { return false; }
  virtual bool is_executed() const { return FALSE; }
  /* Check if subquery produced any rows during last query execution */
  virtual bool no_rows() = 0;
  virtual enum_engine_type engine_type() { return ABSTRACT_ENGINE; }
  virtual int get_identifier() { DBUG_ASSERT(0); return 0; }
  virtual void force_reexecution() {}
protected:
  bool set_row(List<Item> &item_list, Item_cache **row);
};

class subselect_single_select_engine: public subselect_engine
{
  bool prepared;       /* simple subselect is prepared */
  bool executed;       /* simple subselect is executed */
  st_select_lex *select_lex; /* corresponding select_lex */
  JOIN * join; /* corresponding JOIN structure */
public:
  subselect_single_select_engine(st_select_lex *select,
				 select_result_interceptor *result,
				 Item_subselect *item);
  void cleanup() override;
  int prepare(THD *thd) override;
  bool fix_length_and_dec(Item_cache** row) override;
  int exec() override;
  uint cols() const override;
  uint8 uncacheable() override;
  void exclude() override;
  table_map upper_select_const_tables() override;
  void print(String *str, enum_query_type query_type) override;
  bool change_result(Item_subselect *si,
                     select_result_interceptor *result,
                     bool temp) override;
  bool no_tables() const override;
  bool always_returns_one_row() const override;
  bool may_be_null() override;
  bool is_executed() const override { return executed; }
  bool no_rows() override;
  enum_engine_type engine_type() override { return SINGLE_SELECT_ENGINE; }
  int get_identifier() override;
  void force_reexecution() override;
  void change_select(st_select_lex *new_select) { select_lex= new_select; }

  friend class subselect_hash_sj_engine;
  friend class Item_in_subselect;
  friend bool execute_degenerate_jtbm_semi_join(THD *thd,
                                                TABLE_LIST *tbl,
                                                Item_in_subselect *subq_pred,
                                                List<Item> &eq_list);
};


class subselect_union_engine: public subselect_engine
{
  st_select_lex_unit *unit;  /* corresponding unit structure */
public:
  subselect_union_engine(st_select_lex_unit *u,
			 select_result_interceptor *result,
			 Item_subselect *item);
  void cleanup() override;
  int prepare(THD *) override;
  bool fix_length_and_dec(Item_cache** row) override;
  int exec() override;
  uint cols() const override;
  uint8 uncacheable() override;
  void exclude() override;
  table_map upper_select_const_tables() override;
  void print(String *str, enum_query_type query_type) override;
  bool change_result(Item_subselect *si,
                     select_result_interceptor *result,
                     bool temp= FALSE) override;
  bool no_tables() const override;
  bool is_executed() const override;
  void force_reexecution() override;
  bool no_rows() override;
  enum_engine_type engine_type() override { return UNION_ENGINE; }
};


struct st_join_table;


/*
  A subquery execution engine that evaluates the subquery by doing one index
  lookup in a unique index.

  This engine is used to resolve subqueries in forms
  
    outer_expr IN (SELECT tbl.unique_key FROM tbl WHERE subq_where) 
    
  or, tuple-based:
  
    (oe1, .. oeN) IN (SELECT uniq_key_part1, ... uniq_key_partK
                      FROM tbl WHERE subqwhere) 
  
  i.e. the subquery is a single table SELECT without GROUP BY, aggregate
  functions, etc.
*/

class subselect_uniquesubquery_engine: public subselect_engine
{
protected:
  st_join_table *tab;
  Item *cond; /* The WHERE condition of subselect */
  /* 
    TRUE<=> last execution produced empty set. Valid only when left
    expression is NULL.
  */
  bool empty_result_set;
public:

  // constructor can assign THD because it will be called after JOIN::prepare
  subselect_uniquesubquery_engine(THD *thd_arg, st_join_table *tab_arg,
				  Item_in_subselect *subs, Item *where)
    :subselect_engine(subs, 0), tab(tab_arg), cond(where)
  {
    thd= thd_arg;
    DBUG_ASSERT(subs);
  }
  ~subselect_uniquesubquery_engine();
  void cleanup() override;
  int prepare(THD *) override;
  bool fix_length_and_dec(Item_cache** row) override;
  int exec() override;
  uint cols() const override { return 1; }
  uint8 uncacheable() override { return UNCACHEABLE_DEPENDENT_INJECTED; }
  void exclude() override;
  table_map upper_select_const_tables() override { return 0; }
  void print(String *str, enum_query_type query_type) override;
  bool change_result(Item_subselect *si,
                     select_result_interceptor *result,
                     bool temp= FALSE) override;
  bool no_tables() const override;
  int index_lookup(); /* TIMOUR: this method needs refactoring. */
  int scan_table();
  bool copy_ref_key(bool skip_constants);
  bool no_rows() override { return empty_result_set; }
  enum_engine_type engine_type() override { return UNIQUESUBQUERY_ENGINE; }
};


class subselect_indexsubquery_engine: public subselect_uniquesubquery_engine
{
  /* FALSE for 'ref', TRUE for 'ref-or-null'. */
  bool check_null;
  /* 
    The "having" clause. This clause (further referred to as "artificial
    having") was inserted by subquery transformation code. It contains 
    Item(s) that have a side-effect: they record whether the subquery has 
    produced a row with NULL certain components. We need to use it for cases
    like
      (oe1, oe2) IN (SELECT t.key, t.no_key FROM t1)
    where we do index lookup on t.key=oe1 but need also to check if there
    was a row such that t.no_key IS NULL.
    
    NOTE: This is currently here and not in the uniquesubquery_engine. Ideally
    it should have been in uniquesubquery_engine in order to allow execution of
    subqueries like
    
      (oe1, oe2) IN (SELECT primary_key, non_key_maybe_null_field FROM tbl)

    We could use uniquesubquery_engine for the first component and let
    Item_is_not_null_test( non_key_maybe_null_field) to handle the second.

    However, subqueries like the above are currently not handled by index
    lookup-based subquery engines, the engine applicability check misses
    them: it doesn't switch the engine for case of artificial having and
    [eq_]ref access (only for artificial having + ref_or_null or no having).
    The above example subquery is handled as a full-blown SELECT with eq_ref
    access to one table.

    Due to this limitation, the "artificial having" currently needs to be 
    checked by only in indexsubquery_engine.
  */
  Item *having;
public:

  // constructor can assign THD because it will be called after JOIN::prepare
  subselect_indexsubquery_engine(THD *thd_arg, st_join_table *tab_arg,
				 Item_in_subselect *subs, Item *where,
                                 Item *having_arg, bool chk_null)
    :subselect_uniquesubquery_engine(thd_arg, tab_arg, subs, where),
     check_null(chk_null),
     having(having_arg)
  { DBUG_ASSERT(subs); }
  int exec() override;
  void print (String *str, enum_query_type query_type) override;
  enum_engine_type engine_type() override { return INDEXSUBQUERY_ENGINE; }
};

/*
  This function is actually defined in sql_parse.cc, but it depends on
  chooser_compare_func_creator defined in this file.
 */
Item * all_any_subquery_creator(THD *thd, Item *left_expr,
                                chooser_compare_func_creator cmp,
                                bool all,
                                SELECT_LEX *select_lex);


inline bool Item_subselect::is_evaluated() const
{
  return engine->is_executed();
}


inline bool Item_subselect::is_uncacheable() const
{
  return engine->uncacheable();
}

/**
  Compute an IN predicate via a hash semi-join. This class is responsible for
  the materialization of the subquery, and the selection of the correct and
  optimal execution method (e.g. direct index lookup, or partial matching) for
  the IN predicate.
*/

class subselect_hash_sj_engine : public subselect_engine
{
public:
  /* The table into which the subquery is materialized. */
  TABLE *tmp_table;
  /* TRUE if the subquery was materialized into a temp table. */
  bool is_materialized;
  /*
    The old engine already chosen at parse time and stored in permanent memory.
    Through this member we can re-create and re-prepare materialize_join for
    each execution of a prepared statement. We also reuse the functionality
    of subselect_single_select_engine::[prepare | cols].
  */
  subselect_single_select_engine *materialize_engine;
  /*
    QEP to execute the subquery and materialize its result into a
    temporary table. Created during the first call to exec().
  */
  JOIN *materialize_join;
  /*
    A conjunction of all the equality conditions between all pairs of expressions
    that are arguments of an IN predicate. We need these to post-filter some
    IN results because index lookups sometimes match values that are actually
    not equal to the search key in SQL terms.
  */
  Item_cond_and *semi_join_conds;
  Name_resolution_context *semi_join_conds_context;


  subselect_hash_sj_engine(THD *thd_arg, Item_in_subselect *in_predicate,
                           subselect_single_select_engine *old_engine)
    : subselect_engine(in_predicate, NULL),
      tmp_table(NULL), is_materialized(FALSE), materialize_engine(old_engine),
      materialize_join(NULL),  semi_join_conds(NULL), lookup_engine(NULL),
      count_partial_match_columns(0), count_null_only_columns(0),
      count_columns_with_nulls(0), strategy(UNDEFINED)
  { DBUG_ASSERT(in_predicate); }
  ~subselect_hash_sj_engine();

  bool init(List<Item> *tmp_columns, uint subquery_id);
  void cleanup() override;
  int prepare(THD *) override;
  int exec() override;
  void print(String *str, enum_query_type query_type) override;
  uint cols() const override { return materialize_engine->cols(); }
  uint8 uncacheable() override { return materialize_engine->uncacheable(); }
  table_map upper_select_const_tables() override { return 0; }
  bool no_rows() override { return !tmp_table->file->stats.records; }
  enum_engine_type engine_type() override { return HASH_SJ_ENGINE; }
  /*
    TODO: factor out all these methods in a base subselect_index_engine class
    because all of them have dummy implementations and should never be called.
  */
  bool fix_length_and_dec(Item_cache** row) override;//=>base class
  void exclude() override; //=>base class
  //=>base class
  bool change_result(Item_subselect *si,
                     select_result_interceptor *result,
                     bool temp= FALSE) override;
  bool no_tables() const override;//=>base class
  /* Possible execution strategies that can be used to compute hash semi-join.*/
  enum exec_strategy {
    UNDEFINED= 0,
    COMPLETE_MATCH, /* Use regular index lookups. */
    PARTIAL_MATCH,  /* Use some partial matching strategy. */
    PARTIAL_MATCH_MERGE, /* Use partial matching through index merging. */
    PARTIAL_MATCH_SCAN,  /* Use partial matching through table scan. */
    SINGLE_COLUMN_MATCH, /* Use simplified matching when there is only
                            one field involved. */
    CONST_RETURN_NULL, /* The result of IN predicate is constant NULL */
    IMPOSSIBLE      /* Subquery materialization is not applicable. */
  };

protected:
  /* The engine used to compute the IN predicate. */
  subselect_engine *lookup_engine;
  /* Keyparts of the only non-NULL composite index in a rowid merge. */
  MY_BITMAP non_null_key_parts;
  /* Keyparts of the single column indexes with NULL, one keypart per index. */
  MY_BITMAP partial_match_key_parts;
  uint count_partial_match_columns;
  uint count_null_only_columns;
  uint count_columns_with_nulls;
  /* The chosen execution strategy. Computed after materialization. */
  exec_strategy strategy;
  exec_strategy get_strategy_using_schema();
  exec_strategy get_strategy_using_data();
  ulonglong rowid_merge_buff_size(bool has_non_null_key,
                                  bool has_covering_null_row,
                                  MY_BITMAP *partial_match_key_parts);
  void choose_partial_match_strategy(uint field_count,
                                     bool has_non_null_key,
                                     bool has_covering_null_row,
                                     MY_BITMAP *partial_match_key_parts);
  bool make_semi_join_conds();
  subselect_uniquesubquery_engine* make_unique_engine();

};


/*
  Distinguish the type of (0-based) row numbers from the type of the index into
  an array of row numbers.
*/
typedef ha_rows rownum_t;


/*
  An Ordered_key is an in-memory table index that allows O(log(N)) time
  lookups of a multi-part key.

  If the index is over a single column, then this column may contain NULLs, and
  the NULLs are stored and tested separately for NULL in O(1) via is_null().
  Multi-part indexes assume that the indexed columns do not contain NULLs.

  TODO:
  = Due to the unnatural assymetry between single and multi-part indexes, it
    makes sense to somehow refactor or extend the class.

  = This class can be refactored into a base abstract interface, and two
    subclasses:
    - one to represent single-column indexes, and
    - another to represent multi-column indexes.
    Such separation would allow slightly more efficient implementation of
    the single-column indexes.
  = The current design requires such indexes to be fully recreated for each
    PS (re)execution, however most of the comprising objects can be reused.
*/

class Ordered_key : public Sql_alloc
{
protected:
  /*
    Index of the key in an array of keys. This index allows to
    construct (sub)sets of keys represented by bitmaps.
  */
  uint keyid;
  /* The table being indexed. */
  TABLE *tbl;
  /* The columns being indexed. */
  Item_field **key_columns;
  /* Number of elements in 'key_columns' (number of key parts). */
  uint key_column_count;
  /*
    An expression, or sequence of expressions that forms the search key.
    The search key is a sequence when it is Item_row. Each element of the
    sequence is accessible via Item::element_index(int i).
  */
  Item *search_key;

/* Value index related members. */
  /*
    The actual value index, consists of a sorted sequence of row numbers.
  */
  rownum_t *key_buff;
  /* Number of elements in key_buff. */
  ha_rows key_buff_elements;
  /* Current element in 'key_buff'. */
  ha_rows cur_key_idx;
  /*
    Mapping from row numbers to row ids. The element row_num_to_rowid[i]
    contains a buffer with the rowid for the row numbered 'i'.
    The memory for this member is not maintanined by this class because
    all Ordered_key indexes of the same table share the same mapping.
  */
  uchar *row_num_to_rowid;
  /*
    A sequence of predicates to compare the search key with the corresponding
    columns of a table row from the index.
  */
  Item_func_lt **compare_pred;

/* Null index related members. */
  MY_BITMAP null_key;
  /* Count of NULLs per column. */
  ha_rows null_count;
  /* The row number that contains the first NULL in a column. */
  rownum_t min_null_row;
  /* The row number that contains the last NULL in a column. */
  rownum_t max_null_row;

protected:
  bool alloc_keys_buffers();
  /*
    Quick sort comparison function that compares two rows of the same table
    indentfied with their row numbers.
  */
  int cmp_keys_by_row_data(const rownum_t a, const rownum_t b) const;
  static int cmp_keys_by_row_data_and_rownum(void *key, const void *a,
                                             const void *b);

  int cmp_key_with_search_key(rownum_t row_num);

public:
  Ordered_key(uint keyid_arg, TABLE *tbl_arg,
              Item *search_key_arg, ha_rows null_count_arg,
              ha_rows min_null_row_arg, ha_rows max_null_row_arg,
              uchar *row_num_to_rowid_arg);
  ~Ordered_key();
  void cleanup();
  /* Initialize a multi-column index. */
  bool init(MY_BITMAP *columns_to_index);
  /* Initialize a single-column index. */
  bool init(int col_idx);

  uint get_column_count() const { return key_column_count; }
  uint get_keyid() const { return keyid; }
  Field *get_field(uint i) const
  {
    DBUG_ASSERT(i < key_column_count);
    return key_columns[i]->field;
  }
  rownum_t get_min_null_row() const { return min_null_row; }
  rownum_t get_max_null_row() const { return max_null_row; }
  MY_BITMAP * get_null_key() { return &null_key; }
  ha_rows get_null_count() const { return null_count; }
  ha_rows get_key_buff_elements() const { return key_buff_elements; }
  /*
    Get the search key element that corresponds to the i-th key part of this
    index.
  */
  Item *get_search_key(uint i) const
  {
    return search_key->element_index(key_columns[i]->field->field_index);
  }
  void add_key(rownum_t row_num)
  {
    /* The caller must know how many elements to add. */
    DBUG_ASSERT(key_buff_elements && cur_key_idx < key_buff_elements);
    key_buff[cur_key_idx]= row_num;
    ++cur_key_idx;
  }

  bool sort_keys();
  inline double null_selectivity() const;

  /*
    Position the current element at the first row that matches the key.
    The key itself is propagated by evaluating the current value(s) of
    this->search_key.
  */
  bool lookup();
  /* Move the current index cursor to the first key. */
  void first()
  {
    DBUG_ASSERT(key_buff_elements);
    cur_key_idx= 0;
  }
  /* TODO */
  bool next_same();
  /* Move the current index cursor to the next key. */
  bool next()
  {
    DBUG_ASSERT(key_buff_elements);
    if (cur_key_idx < key_buff_elements - 1)
    {
      ++cur_key_idx;
      return TRUE;
    }
    return FALSE;
  };
  /* Return the current index element. */
  rownum_t current() const
  {
    DBUG_ASSERT(key_buff_elements && cur_key_idx < key_buff_elements);
    return key_buff[cur_key_idx];
  }

  void set_null(rownum_t row_num)
  {
    bitmap_set_bit(&null_key, (uint)row_num);
  }
  bool is_null(rownum_t row_num) const
  {
    /*
      Indexes consisting of only NULLs do not have a bitmap buffer at all.
      Their only initialized member is 'n_bits', which is equal to the number
      of temp table rows.
    */
    if (null_count == tbl->file->stats.records)
    {
      DBUG_ASSERT(tbl->file->stats.records == null_key.n_bits);
      return TRUE;
    }
    if (row_num > max_null_row || row_num < min_null_row)
      return FALSE;
    return bitmap_is_set(&null_key, (uint)row_num);
  }
  void print(String *str) const;
};


class subselect_partial_match_engine : public subselect_engine
{
protected:
  /* The temporary table that contains a materialized subquery. */
  TABLE *tmp_table;
  /*
    The engine used to check whether an IN predicate is TRUE or not. If not
    TRUE, then subselect_rowid_merge_engine further distinguishes between
    FALSE and UNKNOWN.
  */
  subselect_uniquesubquery_engine *lookup_engine;
  /* A list of equalities between each pair of IN operands. */
  List<Item> *equi_join_conds;
  /*
    True if there is an all NULL row in tmp_table. If so, then if there is
    no complete match, there is a guaranteed partial match.
  */
  bool has_covering_null_row;

  /*
    True if all nullable columns of tmp_table consist of only NULL values.
    If so, then if there is a match in the non-null columns, there is a
    guaranteed partial match.
  */
  bool has_covering_null_columns;
  uint count_columns_with_nulls;

protected:
  virtual bool partial_match()= 0;
public:
  subselect_partial_match_engine(THD *thd,
                                 subselect_uniquesubquery_engine *engine_arg,
                                 TABLE *tmp_table_arg, Item_subselect *item_arg,
                                 select_result_interceptor *result_arg,
                                 List<Item> *equi_join_conds_arg,
                                 bool has_covering_null_row_arg,
                                 bool has_covering_null_columns_arg,
                                 uint count_columns_with_nulls_arg);
  int prepare(THD *thd_arg) override { set_thd(thd_arg); return 0; }
  int exec() override;
  bool fix_length_and_dec(Item_cache**) override { return FALSE; }
  uint cols() const override
  { /* TODO: what is the correct value? */ return 1; }
  uint8 uncacheable() override { return UNCACHEABLE_DEPENDENT; }
  void exclude() override {}
  table_map upper_select_const_tables() override { return 0; }
  bool change_result(Item_subselect*,
                     select_result_interceptor*,
                     bool temp= FALSE) override
  { DBUG_ASSERT(FALSE); return false; }
  bool no_tables() const override { return false; }
  bool no_rows() override
  {
    /*
      TODO: It is completely unclear what is the semantics of this
      method. The current result is computed so that the call to no_rows()
      from Item_in_optimizer::val_int() sets Item_in_optimizer::null_value
      correctly.
    */
    return !(item->get_IN_subquery()->null_value);
  }
  void print(String*, enum_query_type) override;

  friend void subselect_hash_sj_engine::cleanup();
};


class subselect_rowid_merge_engine: public subselect_partial_match_engine
{
protected:
  /*
    Mapping from row numbers to row ids. The rowids are stored sequentially
    in the array - rowid[i] is located in row_num_to_rowid + i * rowid_length.
  */
  uchar *row_num_to_rowid;
  /*
    A subset of all the keys for which there is a match for the same row.
    Used during execution. Computed for each outer reference
  */
  MY_BITMAP matching_keys;
  /*
    The columns of the outer reference that are NULL. Computed for each
    outer reference.
  */
  MY_BITMAP matching_outer_cols;
  /*
    Indexes of row numbers, sorted by <column_value, row_number>. If an
    index may contain NULLs, the NULLs are stored efficiently in a bitmap.

    The indexes are sorted by the selectivity of their NULL sub-indexes, the
    one with the fewer NULLs is first. Thus, if there is any index on
    non-NULL columns, it is contained in keys[0].
  */
  Ordered_key **merge_keys;
  /* The number of elements in merge_keys. */
  uint merge_keys_count;
  /* The NULL bitmaps of merge keys.*/
  MY_BITMAP   **null_bitmaps;
  /*
    An index on all non-NULL columns of 'tmp_table'. The index has the
    logical form: <[v_i1 | ... | v_ik], rownum>. It allows to find the row
    number where the columns c_i1,...,c1_k contain the values v_i1,...,v_ik.
    If such an index exists, it is always the first element of 'merge_keys'.
  */
  Ordered_key *non_null_key;
  /*
    Priority queue of Ordered_key indexes, one per NULLable column.
    This queue is used by the partial match algorithm in method exec().
  */
  QUEUE pq;
protected:
  /*
    Comparison function to compare keys in order of decreasing bitmap
    selectivity.
  */
  static int cmp_keys_by_null_selectivity(const void *k1, const void *k2);
  /*
    Comparison function used by the priority queue pq, the 'smaller' key
    is the one with the smaller current row number.
  */
  static int cmp_keys_by_cur_rownum(void *, const void *k1, const void *k2);

  bool test_null_row(rownum_t row_num);
  bool exists_complementing_null_row(MY_BITMAP *keys_to_complement);
  bool partial_match() override;
public:
  subselect_rowid_merge_engine(THD *thd,
                               subselect_uniquesubquery_engine *engine_arg,
                               TABLE *tmp_table_arg, uint merge_keys_count_arg,
                               bool has_covering_null_row_arg,
                               bool has_covering_null_columns_arg,
                               uint count_columns_with_nulls_arg,
                               Item_subselect *item_arg,
                               select_result_interceptor *result_arg,
                               List<Item> *equi_join_conds_arg)
    :subselect_partial_match_engine(thd, engine_arg, tmp_table_arg,
                                    item_arg, result_arg, equi_join_conds_arg,
                                    has_covering_null_row_arg,
                                    has_covering_null_columns_arg,
                                    count_columns_with_nulls_arg),
    merge_keys_count(merge_keys_count_arg), non_null_key(NULL)
  {}
  ~subselect_rowid_merge_engine();
  bool init(MY_BITMAP *non_null_key_parts, MY_BITMAP *partial_match_key_parts);
  void cleanup() override;
  enum_engine_type engine_type() override { return ROWID_MERGE_ENGINE; }
};


class subselect_table_scan_engine: public subselect_partial_match_engine
{
protected:
  bool partial_match() override;
public:
  subselect_table_scan_engine(THD *thd,
                              subselect_uniquesubquery_engine *engine_arg,
                              TABLE *tmp_table_arg, Item_subselect *item_arg,
                              select_result_interceptor *result_arg,
                              List<Item> *equi_join_conds_arg,
                              bool has_covering_null_row_arg,
                              bool has_covering_null_columns_arg,
                              uint count_columns_with_nulls_arg);
  void cleanup() override;
  enum_engine_type engine_type() override { return TABLE_SCAN_ENGINE; }
};


/*
  An engine to handle NULL-aware Materialization for subqueries
  that compare one column:

    col1 IN (SELECT t2.col2 FROM t2 ...)

  When only one column is used, we need to handle NULL values of
  col1 and col2 but don't need to perform "partial" matches when only
  a subset of compared columns is NULL.
  This allows to save on some data structures.
*/

class subselect_single_column_match_engine:
    public subselect_partial_match_engine
{
protected:
  bool partial_match() override;
public:
  subselect_single_column_match_engine(THD *thd,
                              subselect_uniquesubquery_engine *engine_arg,
                              TABLE *tmp_table_arg, Item_subselect *item_arg,
                              select_result_interceptor *result_arg,
                              List<Item> *equi_join_conds_arg,
                              bool has_covering_null_row_arg,
                              bool has_covering_null_columns_arg,
                              uint count_columns_with_nulls_arg);
  void cleanup() override {}
  enum_engine_type engine_type() override { return SINGLE_COLUMN_ENGINE; }
};

/**
  @brief Subquery materialization tracker

  @details
  Used to track various parameters of the materialized subquery execution,
  such as the execution strategy, sizes of buffers employed, etc
*/
class Subq_materialization_tracker
{
public:
  using Strategy = subselect_hash_sj_engine::exec_strategy;

  Subq_materialization_tracker(MEM_ROOT *mem_root)
    : exec_strategy(Strategy::UNDEFINED),
      partial_match_buffer_size(0),
      partial_match_array_sizes(mem_root),
      loops_count(0),
      index_lookups_count(0),
      partial_matches_count(0)
  {}

  void report_partial_merge_keys(Ordered_key **merge_keys,
                                 uint merge_keys_count);

  void report_exec_strategy(Strategy es)
  {
    exec_strategy= es;
  }

  void report_partial_match_buffer_size(longlong sz)
  {
    partial_match_buffer_size= sz;
  }

  void increment_loops_count()
  {
    loops_count++;
  }

  void increment_index_lookups()
  {
    index_lookups_count++;
  }

  void increment_partial_matches()
  {
    partial_matches_count++;
  }

  void print_json_members(Json_writer *writer) const;
private:
  Strategy exec_strategy;
  ulonglong partial_match_buffer_size;
  Dynamic_array<ha_rows> partial_match_array_sizes;

  /* Number of times subquery predicate was evaluated */
  ulonglong loops_count;

  /*
    Number of times we made a lookup in the materialized temptable
    (we do this when all parts of left_expr are not NULLs)
  */
  ulonglong index_lookups_count;

  /*
    Number of times we had to check for a partial match (either by
    scanning the materialized subquery or by doing a merge)
  */
  ulonglong partial_matches_count;

  const char *get_exec_strategy() const
  {
    switch (exec_strategy)
    {
      case Strategy::UNDEFINED:
        return "undefined";
      case Strategy::COMPLETE_MATCH:
        return "index_lookup";
      case Strategy::PARTIAL_MATCH_MERGE:
        return "index_lookup;array merge for partial match";
      case Strategy::PARTIAL_MATCH_SCAN:
        return "index_lookup;full scan for partial match";
      case Strategy::SINGLE_COLUMN_MATCH:
        return "null-aware index_lookup";
      case Strategy::CONST_RETURN_NULL:
        return "return NULL";
      default:
        return "unsupported";
    }
  }
};

#endif /* ITEM_SUBSELECT_INCLUDED */
server/private/wsrep_mutex.h000064400000002300150400264000012241 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_MUTEX_H
#define WSREP_MUTEX_H

/* wsrep-lib */
#include "wsrep/mutex.hpp"

/* implementation */
#include "my_pthread.h"

class Wsrep_mutex : public wsrep::mutex
{
public:
  Wsrep_mutex(mysql_mutex_t* mutex)
    : m_mutex(mutex)
  { }

  void lock() override
  {
    mysql_mutex_lock(m_mutex);
  }

  void unlock() override
  {
    mysql_mutex_unlock(m_mutex);
  }

  void* native() override
  {
    return m_mutex;
  }
private:
  mysql_mutex_t* m_mutex;
};

#endif /* WSREP_MUTEX_H */
server/private/sql_plugin.h000064400000016575150400264000012057 0ustar00/* Copyright (c) 2005, 2012, Oracle and/or its affiliates.
   Copyright (c) 2009, 2017, 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 */

#ifndef _sql_plugin_h
#define _sql_plugin_h

/*
  the following #define adds server-only members to enum_mysql_show_type,
  that is defined in plugin.h
*/
#define SHOW_always_last SHOW_KEY_CACHE_LONG, \
            SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
            SHOW_LONG_NOFLUSH, SHOW_LEX_STRING, SHOW_ATOMIC_COUNTER_UINT32_T, \
      /* SHOW_*_STATUS must be at the end, SHOW_LONG_STATUS being first */ \
            SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_LONGLONG_STATUS, \
            SHOW_UINT32_STATUS
#include "mariadb.h"
#undef SHOW_always_last

#include "m_string.h"                       /* LEX_STRING */
#include "my_alloc.h"                       /* MEM_ROOT */

class sys_var;
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
enum enum_plugin_load_option { PLUGIN_OFF, PLUGIN_ON, PLUGIN_FORCE,
  PLUGIN_FORCE_PLUS_PERMANENT };
extern const char *global_plugin_typelib_names[];

extern volatile int global_plugin_version;
extern ulong dlopen_count;

#include <my_sys.h>
#include "sql_list.h"

#ifdef DBUG_OFF
#define plugin_ref_to_int(A) A
#define plugin_int_to_ref(A) A
#else
#define plugin_ref_to_int(A) (A ? A[0] : NULL)
#define plugin_int_to_ref(A) &(A)
#endif

/*
  the following flags are valid for plugin_init()
*/
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE    1U
#define PLUGIN_INIT_SKIP_INITIALIZATION  2U

#define INITIAL_LEX_PLUGIN_LIST_SIZE    16

typedef enum enum_mysql_show_type SHOW_TYPE;
typedef struct st_mysql_show_var SHOW_VAR;

#define MYSQL_ANY_PLUGIN         -1

/*
  different values of st_plugin_int::state
  though they look like a bitmap, plugin may only
  be in one of those eigenstates, not in a superposition of them :)
  It's a bitmap, because it makes it easier to test
  "whether the state is one of those..."
*/
#define PLUGIN_IS_FREED         1U
#define PLUGIN_IS_DELETED       2U
#define PLUGIN_IS_UNINITIALIZED 4U
#define PLUGIN_IS_READY         8U
#define PLUGIN_IS_DYING         16U
#define PLUGIN_IS_DISABLED      32U

struct st_ptr_backup {
  void **ptr;
  void *value;
  void save(void **p) { ptr= p; value= *p; }
  void save(const char **p) { save((void**)p); }
  void restore() { *ptr= value; }
};

/* A handle for the dynamic library containing a plugin or plugins. */

struct st_plugin_dl
{
  LEX_CSTRING dl;
  void *handle;
  struct st_maria_plugin *plugins;
  st_ptr_backup *ptr_backup;
  uint nbackups;
  uint ref_count;            /* number of plugins loaded from the library */
  int mysqlversion;
  int mariaversion;
  bool   allocated;
};

/* A handle of a plugin */

struct st_plugin_int
{
  LEX_CSTRING name;
  struct st_maria_plugin *plugin;
  struct st_plugin_dl *plugin_dl;
  st_ptr_backup *ptr_backup;
  uint nbackups;
  uint state;
  uint ref_count;               /* number of threads using the plugin */
  uint locks_total;             /* how many times the plugin was locked */
  void *data;                   /* plugin type specific, e.g. handlerton */
  MEM_ROOT mem_root;            /* memory for dynamic plugin structures */
  sys_var *system_vars;         /* server variables for this plugin */
  enum enum_plugin_load_option load_option; /* OFF, ON, FORCE, F+PERMANENT */
};


extern mysql_mutex_t LOCK_plugin;

/*
  See intern_plugin_lock() for the explanation for the
  conditionally defined plugin_ref type
*/
#ifdef DBUG_OFF
typedef struct st_plugin_int *plugin_ref;
#define plugin_ref_to_int(A) A
#define plugin_int_to_ref(A) A
#define plugin_decl(pi) ((pi)->plugin)
#define plugin_dlib(pi) ((pi)->plugin_dl)
#define plugin_data(pi,cast) ((cast)((pi)->data))
#define plugin_name(pi) (&((pi)->name))
#define plugin_state(pi) ((pi)->state)
#define plugin_load_option(pi) ((pi)->load_option)
#define plugin_equals(p1,p2) ((p1) == (p2))
#else
typedef struct st_plugin_int **plugin_ref;
#define plugin_ref_to_int(A) (A ? A[0] : NULL)
#define plugin_int_to_ref(A) &(A)
#define plugin_decl(pi) ((pi)[0]->plugin)
#define plugin_dlib(pi) ((pi)[0]->plugin_dl)
#define plugin_data(pi,cast) ((cast)((pi)[0]->data))
#define plugin_name(pi) (&((pi)[0]->name))
#define plugin_state(pi) ((pi)[0]->state)
#define plugin_load_option(pi) ((pi)[0]->load_option)
#define plugin_equals(p1,p2) ((p1) && (p2) && (p1)[0] == (p2)[0])
#endif

typedef int (*plugin_type_init)(void *);

extern I_List<i_string> *opt_plugin_load_list_ptr;
extern char *opt_plugin_dir_ptr;
extern MYSQL_PLUGIN_IMPORT char opt_plugin_dir[FN_REFLEN];
extern const LEX_CSTRING plugin_type_names[];
extern ulong plugin_maturity;
extern TYPELIB plugin_maturity_values;
extern const char *plugin_maturity_names[];

extern int plugin_init(int *argc, char **argv, int init_flags);
extern void plugin_shutdown(void);
void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root);
extern bool plugin_is_ready(const LEX_CSTRING *name, int type);
#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C)
#define my_plugin_lock(A,B) plugin_lock(A,B)
extern plugin_ref plugin_lock(THD *thd, plugin_ref ptr);
extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name,
                                      int type);
extern void plugin_unlock(THD *thd, plugin_ref plugin);
extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count);
extern bool mysql_install_plugin(THD *thd, const LEX_CSTRING *name,
                                 const LEX_CSTRING *dl);
extern bool mysql_uninstall_plugin(THD *thd, const LEX_CSTRING *name,
                                   const LEX_CSTRING *dl);
extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
extern void plugin_thdvar_init(THD *thd);
extern void plugin_thdvar_cleanup(THD *thd);
sys_var *find_plugin_sysvar(st_plugin_int *plugin, st_mysql_sys_var *var);
void plugin_opt_set_limits(struct my_option *, const struct st_mysql_sys_var *);
extern SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type);
extern bool check_valid_path(const char *path, size_t length);
extern void plugin_mutex_init();

typedef my_bool (plugin_foreach_func)(THD *thd,
                                      plugin_ref plugin,
                                      void *arg);
#define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D)
extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
                                     int type, uint state_mask, void *arg);
extern void sync_dynamic_session_variables(THD* thd, bool global_lock);

extern bool plugin_dl_foreach(THD *thd, const LEX_CSTRING *dl,
                              plugin_foreach_func *func, void *arg);

extern void sync_dynamic_session_variables(THD* thd, bool global_lock);
#endif

#ifdef WITH_WSREP
extern void wsrep_plugins_pre_init();
extern void wsrep_plugins_post_init();
#endif /* WITH_WSREP */
server/private/assume_aligned.h000064400000004456150400264010012656 0ustar00/*
   Copyright (c) 2020, 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 */

#pragma once

#include <cassert>
#include <cstring>

#ifdef _MSC_VER
template <std::size_t Alignment, class T>
static inline T my_assume_aligned(T ptr)
{
  assert(reinterpret_cast<size_t>(ptr) % Alignment == 0);
  __assume(reinterpret_cast<size_t>(ptr) % Alignment == 0);
  return ptr;
}
#else
template <std::size_t Alignment, class T>
static inline T my_assume_aligned(T ptr)
{
  assert(reinterpret_cast<size_t>(ptr) % Alignment == 0);
  return static_cast<T>(__builtin_assume_aligned(ptr, Alignment));
}
#endif

template <std::size_t Alignment>
inline void *memcpy_aligned(void *dest, const void *src, size_t n)
{
  static_assert(Alignment && !(Alignment & (Alignment - 1)), "power of 2");

  return std::memcpy(my_assume_aligned<Alignment>(dest),
                     my_assume_aligned<Alignment>(src), n);
}
template <std::size_t Alignment>
inline void *memmove_aligned(void *dest, const void *src, size_t n)
{
  static_assert(Alignment && !(Alignment & (Alignment - 1)), "power of 2");

  return std::memmove(my_assume_aligned<Alignment>(dest),
                      my_assume_aligned<Alignment>(src), n);
}
template <std::size_t Alignment>
inline int memcmp_aligned(const void *s1, const void *s2, size_t n)
{
  static_assert(Alignment && !(Alignment & (Alignment - 1)), "power of 2");

  return std::memcmp(my_assume_aligned<Alignment>(s1),
                     my_assume_aligned<Alignment>(s2), n);
}
template <std::size_t Alignment>
inline void *memset_aligned(void *s, int c, size_t n)
{
  static_assert(Alignment && !(Alignment & (Alignment - 1)), "power of 2");

  return std::memset(my_assume_aligned<Alignment>(s), c, n);
}
server/private/hash.h000064400000010541150400264010010611 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
   Copyright (c) 2011, 2013, Monty Program Ab.

   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 */

/* Dynamic hashing of record with different key-length */

#ifndef _hash_h
#define _hash_h

#include "my_sys.h"                             /* DYNAMIC_ARRAY */

/*
  This forward declaration is used from C files where the real
  definition is included before.  Since C does not allow repeated
  typedef declarations, even when identical, the definition may not be
  repeated.
*/
#ifdef	__cplusplus
extern "C" {
#endif

/*
  Overhead to store an element in hash
  Can be used to approximate memory consumption for a hash
 */
#define HASH_OVERHEAD (sizeof(char*)*2)

/* flags for hash_init */
#define HASH_UNIQUE     1       /* hash_insert fails on duplicate key */
#define HASH_THREAD_SPECIFIC 2  /* Mark allocated memory THREAD_SPECIFIC */

typedef uint32 my_hash_value_type;
typedef const uchar *(*my_hash_get_key)(const void *, size_t *, my_bool);
typedef my_hash_value_type (*my_hash_function)(CHARSET_INFO *,
                                               const uchar *, size_t);
typedef void (*my_hash_free_key)(void *);
typedef my_bool (*my_hash_walk_action)(void *,void *);

typedef struct st_hash {
  size_t key_offset,key_length;		/* Length of key if const length */
  size_t blength;
  ulong records;
  uint flags;
  DYNAMIC_ARRAY array;				/* Place for hash_keys */
  my_hash_get_key get_key;
  my_hash_function hash_function;
  void (*free)(void *);
  CHARSET_INFO *charset;
} HASH;

/* A search iterator state */
typedef uint HASH_SEARCH_STATE;

#define my_hash_init(A,B,C,D,E,F,G,H,I) my_hash_init2(A,B,0,C,D,E,F,G,0,H,I)
my_bool my_hash_init2(PSI_memory_key psi_key, HASH *hash, uint growth_size,
                      CHARSET_INFO *charset, ulong default_array_elements,
                      size_t key_offset, size_t key_length,
                      my_hash_get_key get_key, my_hash_function hash_function,
                      void (*free_element)(void*), uint flags);
void my_hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
uchar *my_hash_element(HASH *hash, size_t idx);
uchar *my_hash_search(const HASH *info, const uchar *key, size_t length);
uchar *my_hash_search_using_hash_value(const HASH *info,
                                       my_hash_value_type hash_value,
                                       const uchar *key, size_t length);
my_hash_value_type my_hash_sort(CHARSET_INFO *cs,
                                const uchar *key, size_t length);
#define my_calc_hash(A, B, C) my_hash_sort((A)->charset, B, C)
uchar *my_hash_first(const HASH *info, const uchar *key, size_t length,
                     HASH_SEARCH_STATE *state);
uchar *my_hash_first_from_hash_value(const HASH *info,
                                     my_hash_value_type hash_value,
                                     const uchar *key,
                                     size_t length,
                                     HASH_SEARCH_STATE *state);
uchar *my_hash_next(const HASH *info, const uchar *key, size_t length,
                    HASH_SEARCH_STATE *state);
my_bool my_hash_insert(HASH *info, const uchar *data);
my_bool my_hash_delete(HASH *hash, uchar *record);
my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key,
                       size_t old_key_length);
void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
my_bool my_hash_check(HASH *hash); /* Only in debug library */
my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument);

#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
#define my_hash_inited(H) ((H)->blength != 0)
#define my_hash_init_opt(A,B,C,D,E,F,G,H,I) \
          (!my_hash_inited(B) && my_hash_init(A,B,C,D,E,F,G,H,I))

#ifdef	__cplusplus
}
#endif
#endif
server/private/repl_failsafe.h000064400000003061150400264010012461 0ustar00#ifndef REPL_FAILSAFE_INCLUDED
#define REPL_FAILSAFE_INCLUDED

/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifdef HAVE_REPLICATION

#include "mysql.h"
#include <my_sys.h>
#include "slave.h"

extern Atomic_counter<uint32_t> binlog_dump_thread_count;
typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE,
	      RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER,
	      RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */,
	      RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS;
extern ulong rpl_status;

extern mysql_mutex_t LOCK_rpl_status;
extern mysql_cond_t COND_rpl_status;
extern TYPELIB rpl_role_typelib;
extern const char* rpl_role_type[], *rpl_status_type[];

void change_rpl_status(ulong from_status, ulong to_status);
int find_recovery_captain(THD* thd, MYSQL* mysql);

bool show_slave_hosts(THD* thd);

#endif /* HAVE_REPLICATION */
#endif /* REPL_FAILSAFE_INCLUDED */
server/private/sql_limit.h000064400000006163150400264010011670 0ustar00/*  Copyright (c) 2019, 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 */


#ifndef INCLUDES_MARIADB_SQL_LIMIT_H
#define INCLUDES_MARIADB_SQL_LIMIT_H
/**
  LIMIT/OFFSET parameters for execution.
*/

class Select_limit_counters
{
  ha_rows select_limit_cnt, offset_limit_cnt;
  bool with_ties;

  public:
    Select_limit_counters():
       select_limit_cnt(0), offset_limit_cnt(0), with_ties(false)
       {};
    Select_limit_counters(const Select_limit_counters &orig):
       select_limit_cnt(orig.select_limit_cnt),
       offset_limit_cnt(orig.offset_limit_cnt),
       with_ties(orig.with_ties)
       {};

   void set_limit(ha_rows limit, ha_rows offset, bool with_ties_arg)
   {
      if (limit == 0)
        offset= 0;
      offset_limit_cnt= offset;
      select_limit_cnt= limit;
      with_ties= with_ties_arg;
      /*
        Guard against an overflow condition, where limit + offset exceede
        ha_rows value range. This case covers unreasonably large parameter
        values that do not have any practical use so assuming in this case
        that the query does not have a limit is fine.
      */
      if (select_limit_cnt + offset_limit_cnt >= select_limit_cnt)
        select_limit_cnt+= offset_limit_cnt;
      else
        select_limit_cnt= HA_POS_ERROR;
   }

   void set_single_row()
   {
     offset_limit_cnt= 0;
     select_limit_cnt= 1;
     with_ties= false;
   }

   /* Send the first row, still honoring offset_limit_cnt */
   void send_first_row()
   {
     /* Guard against overflow */
     if ((select_limit_cnt= offset_limit_cnt +1 ) == 0)
       select_limit_cnt= offset_limit_cnt;
     // with_ties= false;   Remove // on merge to 10.6
   }

   bool is_unlimited() const
   { return select_limit_cnt == HA_POS_ERROR; }
   /*
      Set the limit to allow returning an unlimited number of rows. Useful
      for cases when we want to continue execution indefinitely after the limit
      is reached (for example for SQL_CALC_ROWS extension).
   */
   void set_unlimited()
   { select_limit_cnt= HA_POS_ERROR; }

   /* Reset the limit entirely. */
   void clear()
   { select_limit_cnt= HA_POS_ERROR; offset_limit_cnt= 0; with_ties= false;}

   bool check_offset(ha_rows sent) const
   {
     return sent < offset_limit_cnt;
   }
   void remove_offset() { offset_limit_cnt= 0; }

   ha_rows get_select_limit() const
   { return select_limit_cnt; }
   ha_rows get_offset_limit() const
   { return offset_limit_cnt; }
   bool is_with_ties() const
   { return with_ties; }
};

#endif // INCLUDES_MARIADB_SQL_LIMIT_H
server/private/ha_sequence.h000064400000014145150400264010012152 0ustar00#ifndef HA_SEQUENCE_INCLUDED
#define HA_SEQUENCE_INCLUDED
/*
   Copyright (c) 2017 Aliyun and/or its affiliates.
   Copyright (c) 2017 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-1301  USA
*/

#include "sql_sequence.h"
#include "table.h"
#include "handler.h"

extern handlerton *sql_sequence_hton;

/*
  Sequence engine handler.

  The sequence engine is a logic engine. It doesn't store any data.
  All the sequence data stored into the base table which must support
  non rollback writes (HA_CAN_TABLES_WITHOUT_ROLLBACK)

  The sequence data (SEQUENCE class) is stored in TABLE_SHARE->sequence

  TABLE RULES:
      1. When table is created, one row is automaticlly inserted into
         the table. The table will always have one and only one row.
      2. Any inserts or updates to the table will be validated.
      3. Inserts will overwrite the original row.
      4. DELETE and TRUNCATE will not affect the table.
         Instead a warning will be given.
      5. Cache will be reset for any updates.

  CACHE RULES:
    SEQUENCE class is used to cache values that sequence defined.
      1. If hit cache, we can query back the sequence nextval directly
         instead of reading the underlying table.

      2. When run out of values, the sequence engine will reserve new values
         in update the base table.

      3. The cache is invalidated if any update on based table.
*/

class ha_sequence :public handler
{
private:
  handler *file;
  SEQUENCE *sequence;                     /* From table_share->sequence */

public:
  /* Set when handler is write locked */
  bool write_locked;

  ha_sequence(handlerton *hton, TABLE_SHARE *share);
  ~ha_sequence();
  virtual handlerton *storage_ht() const override
  { return file->ht; }

  /* virtual function that are re-implemented for sequence */
  int open(const char *name, int mode, uint test_if_locked) override;
  int create(const char *name, TABLE *form,
             HA_CREATE_INFO *create_info) override;
  handler *clone(const char *name, MEM_ROOT *mem_root) override;
  int write_row(const uchar *buf) override;
  Table_flags table_flags() const override;
  /* One can't update or delete from sequence engine */
  int update_row(const uchar *old_data, const uchar *new_data) override
  { return HA_ERR_WRONG_COMMAND; }
  int delete_row(const uchar *buf) override
  { return HA_ERR_WRONG_COMMAND; }
  /* One can't delete from sequence engine */
  int truncate() override
  { return HA_ERR_WRONG_COMMAND; }
  /* Can't use query cache */
  uint8 table_cache_type() override
  { return HA_CACHE_TBL_NOCACHE; }
  void print_error(int error, myf errflag) override;
  int info(uint) override;
  LEX_CSTRING *engine_name() override { return hton_name(file->ht); }
  int external_lock(THD *thd, int lock_type) override;
  int extra(enum ha_extra_function operation) override;
  /* For ALTER ONLINE TABLE */
  bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
                                  uint table_changes) override;
  enum_alter_inplace_result
  check_if_supported_inplace_alter(TABLE *altered_table,
                                   Alter_inplace_info *ai) override;
  void write_lock() { write_locked= 1;}
  void unlock() { write_locked= 0; }
  bool is_locked() { return write_locked; }

  /* Functions that are directly mapped to the underlying handler */
  int rnd_init(bool scan) override
  { return file->rnd_init(scan); }
  /*
    We need to have a lock here to protect engines like MyISAM from
    simultaneous read and write. For sequence's this is not critical
    as this function is used extremely seldom.
  */
  int rnd_next(uchar *buf) override
  {
    int error;
    table->s->sequence->read_lock(table);
    error= file->rnd_next(buf);
    table->s->sequence->read_unlock(table);
    return error;
  }
  int rnd_end() override
  { return file->rnd_end(); }
  int rnd_pos(uchar *buf, uchar *pos) override
  {
    int error;
    table->s->sequence->read_lock(table);
    error= file->rnd_pos(buf, pos);
    table->s->sequence->read_unlock(table);
    return error;
  }
  void position(const uchar *record) override
  { return file->position(record); }
  const char *table_type() const override
  { return file->table_type(); }
  ulong index_flags(uint inx, uint part, bool all_parts) const override
  { return file->index_flags(inx, part, all_parts); }
  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
                             enum thr_lock_type lock_type) override
  { return file->store_lock(thd, to, lock_type); }
  int close(void) override
  { return file->close(); }
  const char **bas_ext() const
  { return file->bas_ext(); }
  int delete_table(const char*name) override
  { return file->delete_table(name); }
  int rename_table(const char *from, const char *to) override
  { return file->rename_table(from, to); }
  void unbind_psi() override
  { file->unbind_psi(); }
  void rebind_psi() override
  { file->rebind_psi(); }
  int discard_or_import_tablespace(my_bool discard) override;
  bool auto_repair(int error) const override
  { return file->auto_repair(error); }
  int repair(THD* thd, HA_CHECK_OPT* check_opt) override
  { return file->repair(thd, check_opt); }
  bool check_and_repair(THD *thd) override
  { return file->check_and_repair(thd); }
  bool is_crashed() const override
  { return file->is_crashed(); }
  void column_bitmaps_signal() override
  { return file->column_bitmaps_signal(); }

  /* New methods */
  void register_original_handler(handler *file_arg)
  {
    file= file_arg;
    init();                                     /* Update cached_table_flags */
  }
};
#endif
server/private/my_time.h000064400000024342150400264010011335 0ustar00/*
   Copyright (c) 2004, 2011, Oracle and/or its affiliates.
   Copyright (c) 2017, Monty Program Ab.

 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 */

/*
  This is a private header of sql-common library, containing
  declarations for my_time.c
*/

#ifndef _my_time_h_
#define _my_time_h_
#include "mysql_time.h"
#include "my_decimal_limits.h"

C_MODE_START

extern MYSQL_PLUGIN_IMPORT ulonglong log_10_int[20];
extern uchar days_in_month[];

#define MY_TIME_T_MAX LONG_MAX
#define MY_TIME_T_MIN LONG_MIN

/* Time handling defaults */
#define TIMESTAMP_MAX_YEAR 2038
#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1)
#define TIMESTAMP_MAX_VALUE INT_MAX32
#define TIMESTAMP_MIN_VALUE 0

/* two-digit years < this are 20..; >= this are 19.. */
#define YY_PART_YEAR	   70

/*
  check for valid times only if the range of time_t is greater than
  the range of my_time_t
*/
#if SIZEOF_TIME_T > 4 || defined(TIME_T_UNSIGNED)
# define IS_TIME_T_VALID_FOR_TIMESTAMP(x) \
    ((x) <= TIMESTAMP_MAX_VALUE && \
     (x) >= TIMESTAMP_MIN_VALUE)
#else
# define IS_TIME_T_VALID_FOR_TIMESTAMP(x) \
    ((x) >= TIMESTAMP_MIN_VALUE)
#endif

/* Flags to str_to_datetime */

#define C_TIME_NO_ZERO_IN_DATE  (1UL << 23) /* == MODE_NO_ZERO_IN_DATE */
#define C_TIME_NO_ZERO_DATE     (1UL << 24) /* == MODE_NO_ZERO_DATE    */
#define C_TIME_INVALID_DATES    (1UL << 25) /* == MODE_INVALID_DATES   */

#define MYSQL_TIME_WARN_TRUNCATED    1U
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2U
#define MYSQL_TIME_WARN_EDOM         4U
#define MYSQL_TIME_WARN_ZERO_DATE    8U
#define MYSQL_TIME_NOTE_TRUNCATED    16U

#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|\
                                  MYSQL_TIME_WARN_OUT_OF_RANGE|\
                                  MYSQL_TIME_WARN_EDOM|\
                                  MYSQL_TIME_WARN_ZERO_DATE)
#define MYSQL_TIME_WARN_NOTES    (MYSQL_TIME_NOTE_TRUNCATED)

#define MYSQL_TIME_WARN_HAVE_WARNINGS(x) MY_TEST((x) & MYSQL_TIME_WARN_WARNINGS)
#define MYSQL_TIME_WARN_HAVE_NOTES(x) MY_TEST((x) & MYSQL_TIME_WARN_NOTES)

/* Useful constants */
#define SECONDS_IN_24H 86400L

/* Limits for the INTERVAL data type */

 /* Number of hours between '0001-01-01 00h' and '9999-12-31 23h' */
#define TIME_MAX_INTERVAL_HOUR             87649415
#define TIME_MAX_INTERVAL_HOUR_CHAR_LENGTH 8

/* Number of full days between '0001-01-01' and '9999-12-31'*/
#define TIME_MAX_INTERVAL_DAY              3652058 /*87649415/24*/
#define TIME_MAX_INTERVAL_DAY_CHAR_LENGTH  7

/* Limits for the TIME data type */
#define TIME_MAX_HOUR 838
#define TIME_MAX_MINUTE 59
#define TIME_MAX_SECOND 59
#define TIME_MAX_SECOND_PART 999999
#define TIME_SECOND_PART_FACTOR (TIME_MAX_SECOND_PART+1)
#define TIME_SECOND_PART_DIGITS 6
#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + TIME_MAX_SECOND)
#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \
                                TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND)

/*
  Structure to return status from
    str_to_datetime(), str_to_time().
*/
typedef struct st_mysql_time_status
{
  int warnings;
  uint precision;
  uint nanoseconds;
} MYSQL_TIME_STATUS;

static inline void my_time_status_init(MYSQL_TIME_STATUS *status)
{
  status->warnings= 0;
  status->precision= 0;
  status->nanoseconds= 0;
}

my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
                   ulonglong flags, int *was_cut);
my_bool str_to_DDhhmmssff(const char *str, size_t length, MYSQL_TIME *l_time,
                          ulong max_hour, MYSQL_TIME_STATUS *status);
my_bool str_to_datetime_or_date_or_time(const char *str, size_t length,
                                        MYSQL_TIME *to, ulonglong flag,
                                        MYSQL_TIME_STATUS *status,
                                        ulong time_max_hour,
                                        ulong time_err_hour);
my_bool
str_to_datetime_or_date_or_interval_hhmmssff(const char *str, size_t length,
                                             MYSQL_TIME *to, ulonglong flag,
                                             MYSQL_TIME_STATUS *status,
                                             ulong time_max_hour,
                                             ulong time_err_hour);
my_bool
str_to_datetime_or_date_or_interval_day(const char *str, size_t length,
                                        MYSQL_TIME *to, ulonglong flag,
                                        MYSQL_TIME_STATUS *status,
                                        ulong time_max_hour,
                                        ulong time_err_hour);
my_bool str_to_datetime_or_date(const char *str, size_t length, MYSQL_TIME *to,
                                ulonglong flags, MYSQL_TIME_STATUS *status);

longlong number_to_datetime_or_date(longlong nr, ulong sec_part,
                                    MYSQL_TIME *time_res,
                                    ulonglong flags, int *was_cut);
int number_to_time_only(my_bool neg, ulonglong nr, ulong sec_part,
                        ulong max_hour, MYSQL_TIME *to, int *was_cut);

ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong(const MYSQL_TIME *);
double TIME_to_double(const MYSQL_TIME *my_time);

int check_time_range(struct st_mysql_time *my_time, uint dec, int *warning);
my_bool check_datetime_range(const MYSQL_TIME *ltime);


long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);
uint year_2000_handling(uint year);

void my_init_time(void);


/*
  Function to check sanity of a TIMESTAMP value

  DESCRIPTION
    Check if a given MYSQL_TIME value fits in TIMESTAMP range.
    This function doesn't make precise check, but rather a rough
    estimate.

  RETURN VALUES
    TRUE   The value seems sane
    FALSE  The MYSQL_TIME value is definitely out of range
*/

static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
{
  if ((t->year > TIMESTAMP_MAX_YEAR || t->year < TIMESTAMP_MIN_YEAR) ||
      (t->year == TIMESTAMP_MAX_YEAR && (t->month > 1 || t->day > 19)) ||
      (t->year == TIMESTAMP_MIN_YEAR && (t->month < 12 || t->day < 31)))
    return FALSE;

  return TRUE;
}

/* Can't include mysqld_error.h, it needs mysys to build, thus hardcode 2 error values here. */
#ifndef ER_WARN_DATA_OUT_OF_RANGE
#define ER_WARN_DATA_OUT_OF_RANGE 1264
#define ER_WARN_INVALID_TIMESTAMP 1299
#endif

my_time_t 
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, uint *error_code);

void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);

/*
  Required buffer length for my_time_to_str, my_date_to_str,
  my_datetime_to_str and TIME_to_string functions. Note, that the
  caller is still responsible to check that given TIME structure
  has values in valid ranges, otherwise size of the buffer could
  be not enough. We also rely on the fact that even wrong values
  sent using binary protocol fit in this buffer.
*/
#define MAX_DATE_STRING_REP_LENGTH 30
#define AUTO_SEC_PART_DIGITS DECIMAL_NOT_SPECIFIED

int my_interval_DDhhmmssff_to_str(const MYSQL_TIME *, char *to, uint digits);
int my_time_to_str(const MYSQL_TIME *l_time, char *to, uint digits);
int my_date_to_str(const MYSQL_TIME *l_time, char *to);
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to, uint digits);
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to, uint digits);

int my_timeval_to_str(const struct timeval *tm, char *to, uint dec);

static inline longlong sec_part_shift(longlong second_part, uint digits)
{
  return second_part / (longlong)log_10_int[TIME_SECOND_PART_DIGITS - digits];
}
static inline longlong sec_part_unshift(longlong second_part, uint digits)
{
  return second_part * (longlong)log_10_int[TIME_SECOND_PART_DIGITS - digits];
}

/* Date/time rounding and truncation functions */
static inline long my_time_fraction_remainder(long nr, uint decimals)
{
  DBUG_ASSERT(decimals <= TIME_SECOND_PART_DIGITS);
  return nr % (long) log_10_int[TIME_SECOND_PART_DIGITS - decimals];
}
static inline void my_datetime_trunc(MYSQL_TIME *ltime, uint decimals)
{
  ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
}
static inline void my_time_trunc(MYSQL_TIME *ltime, uint decimals)
{
  ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
  if (!ltime->second_part && ltime->neg &&
      !ltime->hour && !ltime->minute && !ltime->second)
    ltime->neg= FALSE;
}
#ifdef _WIN32
#define suseconds_t long
#endif
static inline void my_timeval_trunc(struct timeval *tv, uint decimals)
{
  tv->tv_usec-= (suseconds_t) my_time_fraction_remainder(tv->tv_usec, decimals);
}


#define hrtime_to_my_time(X) ((my_time_t)hrtime_to_time(X))

/* 
  Available interval types used in any statement.

  'interval_type' must be sorted so that simple intervals comes first,
  ie year, quarter, month, week, day, hour, etc. The order based on
  interval size is also important and the intervals should be kept in a
  large to smaller order. (get_interval_value() depends on this)
 
  Note: If you change the order of elements in this enum you should fix 
  order of elements in 'interval_type_to_name' and 'interval_names' 
  arrays 
  
  See also interval_type_to_name, get_interval_value, interval_names, append_interval
*/

enum interval_type
{
  INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK, INTERVAL_DAY,
  INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_MICROSECOND,
  INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE,
  INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND,
  INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND,
  INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST
};

C_MODE_END

#endif /* _my_time_h_ */
server/private/wsrep_mysqld.h000064400000051222150400264010012420 0ustar00/* Copyright 2008-2023 Codership Oy <http://www.codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef WSREP_MYSQLD_H
#define WSREP_MYSQLD_H

#include <wsrep.h>

#ifdef WITH_WSREP

#include <mysql/plugin.h>
#include "mysql/service_wsrep.h"

#include <my_global.h>
#include <my_pthread.h>
#include "log.h"
#include "mysqld.h"

typedef struct st_mysql_show_var SHOW_VAR;
#include <sql_priv.h>
#include "mdl.h"
#include "sql_table.h"
#include "wsrep_mysqld_c.h"

#include "wsrep/provider.hpp"
#include "wsrep/streaming_context.hpp"
#include "wsrep_api.h"
#include <map>

#define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX

class THD;

// Global wsrep parameters

// MySQL wsrep options
extern const char* wsrep_provider;
extern const char* wsrep_provider_options;
extern const char* wsrep_cluster_name;
extern const char* wsrep_cluster_address;
extern const char* wsrep_node_name;
extern const char* wsrep_node_address;
extern const char* wsrep_node_incoming_address;
extern const char* wsrep_data_home_dir;
extern const char* wsrep_dbug_option;
extern long        wsrep_slave_threads;
extern int         wsrep_slave_count_change;
extern ulong       wsrep_debug;
extern my_bool     wsrep_convert_LOCK_to_trx;
extern ulong       wsrep_retry_autocommit;
extern my_bool     wsrep_auto_increment_control;
extern my_bool     wsrep_drupal_282555_workaround;
extern my_bool     wsrep_incremental_data_collection;
extern const char* wsrep_start_position;
extern ulong       wsrep_max_ws_size;
extern ulong       wsrep_max_ws_rows;
extern const char* wsrep_notify_cmd;
extern my_bool     wsrep_certify_nonPK;
extern long int    wsrep_protocol_version;
extern my_bool     wsrep_desync;
extern ulong       wsrep_reject_queries;
extern my_bool     wsrep_recovery;
extern my_bool     wsrep_replicate_myisam;
extern my_bool     wsrep_log_conflicts;
extern ulong       wsrep_mysql_replication_bundle;
extern my_bool     wsrep_load_data_splitting;
extern my_bool     wsrep_restart_slave;
extern my_bool     wsrep_restart_slave_activated;
extern my_bool     wsrep_slave_FK_checks;
extern my_bool     wsrep_slave_UK_checks;
extern ulong       wsrep_trx_fragment_unit;
extern ulong       wsrep_SR_store_type;
extern uint        wsrep_ignore_apply_errors;
extern ulong       wsrep_running_threads;
extern ulong       wsrep_running_applier_threads;
extern ulong       wsrep_running_rollbacker_threads;
extern bool        wsrep_new_cluster;
extern bool        wsrep_gtid_mode;
extern uint32      wsrep_gtid_domain_id;
extern std::atomic <bool > wsrep_thread_create_failed;
extern ulonglong   wsrep_mode;
extern my_bool     wsrep_strict_ddl;

enum enum_wsrep_reject_types {
  WSREP_REJECT_NONE,    /* nothing rejected */
  WSREP_REJECT_ALL,     /* reject all queries, with UNKNOWN_COMMAND error */
  WSREP_REJECT_ALL_KILL /* kill existing connections and reject all queries*/
};

enum enum_wsrep_OSU_method {
    WSREP_OSU_TOI,
    WSREP_OSU_RSU,
    WSREP_OSU_NONE,
};

enum enum_wsrep_sync_wait {
    WSREP_SYNC_WAIT_NONE= 0x0,
    // select, begin
    WSREP_SYNC_WAIT_BEFORE_READ= 0x1,
    WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE= 0x2,
    WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE= 0x4,
    WSREP_SYNC_WAIT_BEFORE_SHOW= 0x8,
    WSREP_SYNC_WAIT_MAX= 0xF
};

enum enum_wsrep_ignore_apply_error {
    WSREP_IGNORE_ERRORS_NONE= 0x0,
    WSREP_IGNORE_ERRORS_ON_RECONCILING_DDL= 0x1,
    WSREP_IGNORE_ERRORS_ON_RECONCILING_DML= 0x2,
    WSREP_IGNORE_ERRORS_ON_DDL= 0x4,
    WSREP_IGNORE_ERRORS_MAX= 0x7
};

/* wsrep_mode features */
enum enum_wsrep_mode {
  WSREP_MODE_STRICT_REPLICATION= (1ULL << 0),
  WSREP_MODE_BINLOG_ROW_FORMAT_ONLY= (1ULL << 1),
  WSREP_MODE_REQUIRED_PRIMARY_KEY= (1ULL << 2),
  WSREP_MODE_REPLICATE_MYISAM= (1ULL << 3),
  WSREP_MODE_REPLICATE_ARIA= (1ULL << 4),
  WSREP_MODE_DISALLOW_LOCAL_GTID= (1ULL << 5),
  WSREP_MODE_BF_MARIABACKUP= (1ULL << 6)
};

// Streaming Replication
#define WSREP_FRAG_BYTES      0
#define WSREP_FRAG_ROWS       1
#define WSREP_FRAG_STATEMENTS 2

#define WSREP_SR_STORE_NONE   0
#define WSREP_SR_STORE_TABLE  1

extern const char *wsrep_fragment_units[];
extern const char *wsrep_SR_store_types[];

// MySQL status variables
extern my_bool     wsrep_connected;
extern const char* wsrep_cluster_state_uuid;
extern long long   wsrep_cluster_conf_id;
extern const char* wsrep_cluster_status;
extern long        wsrep_cluster_size;
extern long        wsrep_local_index;
extern long long   wsrep_local_bf_aborts;
extern const char* wsrep_provider_name;
extern const char* wsrep_provider_version;
extern const char* wsrep_provider_vendor;
extern char*       wsrep_provider_capabilities;
extern char*       wsrep_cluster_capabilities;

int  wsrep_show_status(THD *thd, SHOW_VAR *var, void *buff,
                       system_status_var *status_var, enum_var_type scope);
int  wsrep_show_ready(THD *thd, SHOW_VAR *var, void *buff,
                      system_status_var *, enum_var_type);
void wsrep_free_status(THD *thd);
void wsrep_update_cluster_state_uuid(const char* str);

/* Filters out --wsrep-new-cluster oprtion from argv[]
 * should be called in the very beginning of main() */
void wsrep_filter_new_cluster (int* argc, char* argv[]);

int  wsrep_init();
void wsrep_deinit(bool free_options);

/* Initialize wsrep thread LOCKs and CONDs */
void wsrep_thr_init();
/* Destroy wsrep thread LOCKs and CONDs */
void wsrep_thr_deinit();

void wsrep_recover();
bool wsrep_before_SE(); // initialize wsrep before storage
                        // engines (true) or after (false)
/* wsrep initialization sequence at startup
 * @param before wsrep_before_SE() value */
void wsrep_init_startup(bool before);

/* Recover streaming transactions from fragment storage */
void wsrep_recover_sr_from_storage(THD *);

// Other wsrep global variables
extern my_bool     wsrep_inited; // whether wsrep is initialized ?
extern bool        wsrep_service_started;

extern "C" void wsrep_fire_rollbacker(THD *thd);
extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd);
extern "C" time_t wsrep_thd_query_start(THD *thd);
extern void wsrep_close_client_connections(my_bool wait_to_end,
                                           THD *except_caller_thd= NULL);
extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd);
extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id);

extern int  wsrep_wait_committing_connections_close(int wait_time);
extern void wsrep_close_applier(THD *thd);
extern void wsrep_wait_appliers_close(THD *thd);
extern void wsrep_close_applier_threads(int count);


/* new defines */
extern void wsrep_stop_replication(THD *thd);
extern bool wsrep_start_replication(const char *wsrep_cluster_address);
extern void wsrep_shutdown_replication();
extern bool wsrep_check_mode (enum_wsrep_mode mask);
extern bool wsrep_check_mode_after_open_table (THD *thd, const handlerton *hton,
                                               TABLE_LIST *tables);
extern bool wsrep_check_mode_before_cmd_execute (THD *thd);
extern bool wsrep_must_sync_wait (THD* thd, uint mask= WSREP_SYNC_WAIT_BEFORE_READ);
extern bool wsrep_sync_wait (THD* thd, uint mask= WSREP_SYNC_WAIT_BEFORE_READ);
extern bool wsrep_sync_wait (THD* thd, enum enum_sql_command command);
extern enum wsrep::provider::status
wsrep_sync_wait_upto (THD* thd, wsrep_gtid_t* upto, int timeout);
extern int  wsrep_check_opts();
extern void wsrep_prepend_PATH (const char* path);
extern bool wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* table, wsrep::key_array* keys);
extern bool wsrep_reload_ssl();

/* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno;

/* A wrapper function for MySQL log functions. The call will prefix
   the log message with WSREP and forward the result buffer to fun. */
void WSREP_LOG(void (*fun)(const char* fmt, ...), const char* fmt, ...);

#define WSREP_SYNC_WAIT(thd_, before_)                                  \
    { if (WSREP_CLIENT(thd_) &&                                         \
          wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }

#define WSREP_MYSQL_DB (char *)"mysql"

#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)              \
  if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
    goto wsrep_error_label;

#define WSREP_TO_ISOLATION_BEGIN_CREATE(db_, table_, table_list_, create_info_)	\
  if (WSREP_ON && WSREP(thd) &&                                         \
      wsrep_to_isolation_begin(thd, db_, table_,                        \
                               table_list_, nullptr, nullptr, create_info_))\
    goto wsrep_error_label;

#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_, fk_tables_, create_info_) \
  if (WSREP(thd) && wsrep_thd_is_local(thd) &&                          \
      wsrep_to_isolation_begin(thd, db_, table_,                        \
                               table_list_, alter_info_, fk_tables_, create_info_))

#define WSREP_TO_ISOLATION_END                                          \
  if ((WSREP(thd) && wsrep_thd_is_local_toi(thd)) ||                    \
      wsrep_thd_is_in_rsu(thd))                                         \
    wsrep_to_isolation_end(thd);

/*
  Checks if lex->no_write_to_binlog is set for statements that use LOCAL or
  NO_WRITE_TO_BINLOG.
*/
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)       \
  if (WSREP(thd) && !thd->lex->no_write_to_binlog                       \
      && wsrep_to_isolation_begin(thd, db_, table_, table_list_))       \
    goto wsrep_error_label;


#define WSREP_PROVIDER_EXISTS (WSREP_PROVIDER_EXISTS_)

static inline bool wsrep_cluster_address_exists()
{
  if (mysqld_server_started)
    mysql_mutex_assert_owner(&LOCK_global_system_variables);
  return wsrep_cluster_address && wsrep_cluster_address[0];
}

extern my_bool wsrep_ready_get();
extern void wsrep_ready_wait();

extern mysql_mutex_t LOCK_wsrep_ready;
extern mysql_cond_t  COND_wsrep_ready;
extern mysql_mutex_t LOCK_wsrep_sst;
extern mysql_cond_t  COND_wsrep_sst;
extern mysql_mutex_t LOCK_wsrep_sst_init;
extern mysql_cond_t  COND_wsrep_sst_init;
extern int wsrep_replaying;
extern mysql_mutex_t LOCK_wsrep_replaying;
extern mysql_cond_t  COND_wsrep_replaying;
extern mysql_mutex_t LOCK_wsrep_slave_threads;
extern mysql_cond_t  COND_wsrep_slave_threads;
extern mysql_mutex_t LOCK_wsrep_gtid_wait_upto;
extern mysql_mutex_t LOCK_wsrep_cluster_config;
extern mysql_mutex_t LOCK_wsrep_desync;
extern mysql_mutex_t LOCK_wsrep_SR_pool;
extern mysql_mutex_t LOCK_wsrep_SR_store;
extern mysql_mutex_t LOCK_wsrep_config_state;
extern mysql_mutex_t LOCK_wsrep_group_commit;
extern mysql_mutex_t LOCK_wsrep_joiner_monitor;
extern mysql_mutex_t LOCK_wsrep_donor_monitor;
extern mysql_cond_t  COND_wsrep_joiner_monitor;
extern mysql_cond_t  COND_wsrep_donor_monitor;

extern int           wsrep_to_isolation;
#ifdef GTID_SUPPORT
extern rpl_sidno     wsrep_sidno;
#endif /* GTID_SUPPORT */
extern my_bool       wsrep_preordered_opt;

#ifdef HAVE_PSI_INTERFACE

extern PSI_cond_key  key_COND_wsrep_thd;

extern PSI_mutex_key key_LOCK_wsrep_ready;
extern PSI_mutex_key key_COND_wsrep_ready;
extern PSI_mutex_key key_LOCK_wsrep_sst;
extern PSI_cond_key  key_COND_wsrep_sst;
extern PSI_mutex_key key_LOCK_wsrep_sst_init;
extern PSI_cond_key  key_COND_wsrep_sst_init;
extern PSI_mutex_key key_LOCK_wsrep_sst_thread;
extern PSI_cond_key  key_COND_wsrep_sst_thread;
extern PSI_mutex_key key_LOCK_wsrep_replaying;
extern PSI_cond_key  key_COND_wsrep_replaying;
extern PSI_mutex_key key_LOCK_wsrep_slave_threads;
extern PSI_cond_key  key_COND_wsrep_slave_threads;
extern PSI_mutex_key key_LOCK_wsrep_gtid_wait_upto;
extern PSI_cond_key  key_COND_wsrep_gtid_wait_upto;
extern PSI_mutex_key key_LOCK_wsrep_cluster_config;
extern PSI_mutex_key key_LOCK_wsrep_desync;
extern PSI_mutex_key key_LOCK_wsrep_SR_pool;
extern PSI_mutex_key key_LOCK_wsrep_SR_store;
extern PSI_mutex_key key_LOCK_wsrep_global_seqno;
extern PSI_mutex_key key_LOCK_wsrep_thd_queue;
extern PSI_cond_key  key_COND_wsrep_thd_queue;
extern PSI_mutex_key key_LOCK_wsrep_joiner_monitor;
extern PSI_mutex_key key_LOCK_wsrep_donor_monitor;

extern PSI_file_key key_file_wsrep_gra_log;

extern PSI_thread_key key_wsrep_sst_joiner;
extern PSI_thread_key key_wsrep_sst_donor;
extern PSI_thread_key key_wsrep_rollbacker;
extern PSI_thread_key key_wsrep_applier;
extern PSI_thread_key key_wsrep_sst_joiner_monitor;
extern PSI_thread_key key_wsrep_sst_donor_monitor;
#endif /* HAVE_PSI_INTERFACE */


struct TABLE_LIST;
class Alter_info;
int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_,
                             const TABLE_LIST* table_list,
                             const Alter_info* alter_info= nullptr,
                             const wsrep::key_array *fk_tables= nullptr,
                             const HA_CREATE_INFO* create_info= nullptr);

bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton);
bool wsrep_should_replicate_ddl_iterate(THD* thd, const TABLE_LIST* table_list);

void wsrep_to_isolation_end(THD *thd);

bool wsrep_append_SR_keys(THD *thd);
int wsrep_to_buf_helper(
  THD* thd, const char *query, uint query_len, uchar** buf, size_t* buf_len);
int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len);
int wsrep_create_event_query(THD *thd, uchar** buf, size_t* buf_len);

void wsrep_init_sidno(const wsrep_uuid_t&);
bool wsrep_node_is_donor();
bool wsrep_node_is_synced();

void wsrep_init_SR();
void wsrep_verify_SE_checkpoint(const wsrep_uuid_t& uuid, wsrep_seqno_t seqno);
int wsrep_replay_from_SR_store(THD*, const wsrep_trx_meta_t&);

class Log_event;
int wsrep_ignored_error_code(Log_event* ev, int error);
int wsrep_must_ignore_error(THD* thd);

struct wsrep_server_gtid_t
{
  uint32 domain_id;
  uint32 server_id;
  uint64 seqno;
};
class Wsrep_gtid_server
{
public:
  uint32 domain_id;
  uint32 server_id;
  Wsrep_gtid_server()
    : m_force_signal(false)
    , m_seqno(0)
    , m_committed_seqno(0)
  { }
  void gtid(const wsrep_server_gtid_t& gtid)
  {
    domain_id=  gtid.domain_id;
    server_id=  gtid.server_id;
    m_seqno=    gtid.seqno;
  }
  wsrep_server_gtid_t gtid()
  {
    wsrep_server_gtid_t gtid;
    gtid.domain_id= domain_id;
    gtid.server_id= server_id;
    gtid.seqno=     m_seqno;
    return gtid;
  }
  void seqno(const uint64 seqno) { m_seqno= seqno; }
  uint64 seqno() const { return m_seqno; }
  uint64 seqno_committed() const { return m_committed_seqno; }
  uint64 seqno_inc()
  {
    m_seqno++;
    return m_seqno;
  }
  const wsrep_server_gtid_t& undefined()
  {
    return m_undefined;
  }
  int wait_gtid_upto(const uint64_t seqno, uint timeout)
  {
    int wait_result= 0;
    struct timespec wait_time;
    int ret= 0;
    mysql_cond_t wait_cond;
    mysql_cond_init(key_COND_wsrep_gtid_wait_upto, &wait_cond, NULL);
    set_timespec(wait_time, timeout);
    mysql_mutex_lock(&LOCK_wsrep_gtid_wait_upto);
    std::multimap<uint64, mysql_cond_t*>::iterator it;
    if (seqno > m_seqno)
    {
      try
      {
        it= m_wait_map.insert(std::make_pair(seqno, &wait_cond));
      } 
      catch (std::bad_alloc& e)
      {
         ret= ENOMEM;
      }
      while (!ret && (m_committed_seqno < seqno) && !m_force_signal)
      {
        wait_result= mysql_cond_timedwait(&wait_cond,
                                          &LOCK_wsrep_gtid_wait_upto,
                                          &wait_time);
        if (wait_result == ETIMEDOUT || wait_result == ETIME)
        {
          ret= wait_result;
          break;
        }
      }
      if (ret != ENOMEM)
      {
        m_wait_map.erase(it);
      }
    }
    mysql_mutex_unlock(&LOCK_wsrep_gtid_wait_upto);
    mysql_cond_destroy(&wait_cond);
    return ret;
  }
  void signal_waiters(uint64 seqno, bool signal_all)
  {
    mysql_mutex_lock(&LOCK_wsrep_gtid_wait_upto);
    if (!signal_all && (m_committed_seqno >= seqno))
    {
      mysql_mutex_unlock(&LOCK_wsrep_gtid_wait_upto);
      return;
    }
    m_force_signal= true;
    std::multimap<uint64, mysql_cond_t*>::iterator it_end;
    std::multimap<uint64, mysql_cond_t*>::iterator it_begin;
    if (signal_all)
    {
      it_end= m_wait_map.end();
    }
    else
    {
      it_end= m_wait_map.upper_bound(seqno);
    }
    if (m_committed_seqno < seqno)
    {
      m_committed_seqno= seqno;
    }
    for (it_begin = m_wait_map.begin(); it_begin != it_end; ++it_begin)
    {
      mysql_cond_signal(it_begin->second);
    }
    m_force_signal= false;
    mysql_mutex_unlock(&LOCK_wsrep_gtid_wait_upto);
  }
private:
  const wsrep_server_gtid_t m_undefined= {0,0,0};
  std::multimap<uint64, mysql_cond_t*> m_wait_map;
  bool m_force_signal;
  Atomic_counter<uint64_t> m_seqno;
  Atomic_counter<uint64_t> m_committed_seqno;
};
extern Wsrep_gtid_server wsrep_gtid_server;
void wsrep_init_gtid();
bool wsrep_check_gtid_seqno(const uint32&, const uint32&, uint64&);
bool wsrep_get_binlog_gtid_seqno(wsrep_server_gtid_t&);

int wsrep_append_table_keys(THD* thd,
                            TABLE_LIST* first_table,
                            TABLE_LIST* table_list,
                            Wsrep_service_key_type key_type);

extern void
wsrep_handle_mdl_conflict(MDL_context *requestor_ctx,
                          const MDL_ticket *ticket,
                          const MDL_key *key);

enum wsrep_thread_type {
  WSREP_APPLIER_THREAD=1,
  WSREP_ROLLBACKER_THREAD=2
};

typedef void (*wsrep_thd_processor_fun)(THD*, void *);
class Wsrep_thd_args
{
 public:
 Wsrep_thd_args(wsrep_thd_processor_fun fun,
                wsrep_thread_type thread_type,
                pthread_t thread_id)
   :
  fun_ (fun),
  thread_type_ (thread_type),
  thread_id_ (thread_id)
  { }

  wsrep_thd_processor_fun fun() { return fun_; }
  pthread_t* thread_id() {return &thread_id_; }
  enum wsrep_thread_type thread_type() {return thread_type_;}

 private:

  Wsrep_thd_args(const Wsrep_thd_args&);
  Wsrep_thd_args& operator=(const Wsrep_thd_args&);

  wsrep_thd_processor_fun fun_;
  enum wsrep_thread_type  thread_type_;
  pthread_t thread_id_;
};

void* start_wsrep_THD(void*);

void wsrep_close_threads(THD *thd);
bool wsrep_is_show_query(enum enum_sql_command command);
void wsrep_replay_transaction(THD *thd);
bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
                             TABLE_LIST* src_table,
                             HA_CREATE_INFO *create_info);
bool wsrep_node_is_donor();
bool wsrep_node_is_synced();

/**
 * Check if the wsrep provider (ie the Galera library) is capable of
 * doing streaming replication.
 * @return true if SR capable
 */
bool wsrep_provider_is_SR_capable();

/**
 * Initialize WSREP server instance.
 *
 * @return Zero on success, non-zero on error.
 */
int wsrep_init_server();

/**
 * Initialize WSREP globals. This should be done after server initialization
 * is complete and the server has joined to the cluster.
 *
 */
void wsrep_init_globals();

/**
 * Deinit and release WSREP resources.
 */
void wsrep_deinit_server();

/**
 * Convert streaming fragment unit (WSREP_FRAG_BYTES, WSREP_FRAG_ROWS...)
 * to corresponding wsrep-lib fragment_unit
 */
enum wsrep::streaming_context::fragment_unit wsrep_fragment_unit(ulong unit);

wsrep::key wsrep_prepare_key_for_toi(const char* db, const char* table,
                                     enum wsrep::key::type type);

void wsrep_wait_ready(THD *thd);
void wsrep_ready_set(bool ready_value);

/**
 * Returns true if the given list of tables contains at least one
 * non-temporary table.
 */
bool wsrep_table_list_has_non_temp_tables(THD *thd, TABLE_LIST *tables);

#else /* !WITH_WSREP */

/* These macros are needed to compile MariaDB without WSREP support
 * (e.g. embedded) */

#define WSREP_PROVIDER_EXISTS (0)
#define wsrep_emulate_bin_log (0)
#define wsrep_to_isolation (0)
#define wsrep_before_SE() (0)
#define wsrep_init_startup(X)
#define wsrep_check_opts() (0)
#define wsrep_thr_init() do {} while(0)
#define wsrep_thr_deinit() do {} while(0)
#define wsrep_init_globals() do {} while(0)
#define wsrep_create_appliers(X) do {} while(0)
#define wsrep_cluster_address_exists() (false)
#define WSREP_MYSQL_DB (0)
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) do { } while(0)
#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_, fk_tables_)
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#define WSREP_SYNC_WAIT(thd_, before_)

#endif /* WITH_WSREP */

#endif /* WSREP_MYSQLD_H */
server/private/my_user.h000064400000002146150400264010011353 0ustar00/* Copyright (c) 2005-2007 MySQL AB
   Use is subject to license terms

 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/*
  This is a header for libraries containing functions used in both server and
  only some of clients (but not in libmysql)...
*/

#ifndef _my_user_h_
#define _my_user_h_

C_MODE_START

int parse_user(const char *user_id_str, size_t user_id_len,
               char *user_name_str, size_t *user_name_len,
               char *host_name_str, size_t *host_name_len);

C_MODE_END

#endif /* _my_user_h_ */
server/private/my_decimal.h000064400000034231150400264010011773 0ustar00/* Copyright (c) 2005, 2013, Oracle and/or its affiliates.
   Copyright (c) 2011, 2014, SkySQL Ab.

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/**
  @file

  It is interface module to fixed precision decimals library.

  Most functions use 'uint mask' as parameter, if during operation error
  which fit in this mask is detected then it will be processed automatically
  here. (errors are E_DEC_* constants, see include/decimal.h)

  Most function are just inline wrappers around library calls
*/

#ifndef my_decimal_h
#define my_decimal_h

#include "sql_basic_types.h"

#if defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
#include "sql_string.h"                         /* String */
#endif

C_MODE_START
#include <decimal.h>
#include <my_decimal_limits.h>
C_MODE_END

class String;
class Field;
typedef struct st_mysql_time MYSQL_TIME;

/**
  maximum size of packet length.
*/
#define DECIMAL_MAX_FIELD_SIZE DECIMAL_MAX_PRECISION


inline uint my_decimal_size(decimal_digits_t precision,
                            decimal_digits_t scale)
{
  /*
    Always allocate more space to allow library to put decimal point
    where it want
  */
  return decimal_size(precision, scale) + 1;
}


inline decimal_digits_t my_decimal_int_part(decimal_digits_t precision,
                                            decimal_digits_t decimals)
{
  return (decimal_digits_t) (precision -
                             ((decimals == DECIMAL_NOT_SPECIFIED) ? 0 :
                              decimals));
}


#ifndef MYSQL_CLIENT
int decimal_operation_results(int result, const char *value, const char *type);
#else
inline int decimal_operation_results(int result, const char *value,
                                     const char *type)
{
  return result;
}
#endif /*MYSQL_CLIENT*/


inline int check_result(uint mask, int result)
{
  if (result & mask)
    decimal_operation_results(result, "", "DECIMAL");
  return result;
}


/**
  my_decimal class limits 'decimal_t' type to what we need in MySQL.

  It contains internally all necessary space needed by the instance so
  no extra memory is needed. One should call fix_buffer_pointer() function
  when he moves my_decimal objects in memory.
*/

class my_decimal :public decimal_t
{
  /*
    Several of the routines in strings/decimal.c have had buffer
    overrun/underrun problems. These are *not* caught by valgrind.
    To catch them, we allocate dummy fields around the buffer,
    and test that their values do not change.
   */
#if !defined(DBUG_OFF)
  int foo1;
#endif

  decimal_digit_t buffer[DECIMAL_BUFF_LENGTH];

#if !defined(DBUG_OFF)
  int foo2;
  static const int test_value= 123;
#endif

public:

  my_decimal(const my_decimal &rhs) : decimal_t(rhs)
  {
    init();
    for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
      buffer[i]= rhs.buffer[i];
  }

  my_decimal& operator=(const my_decimal &rhs)
  {
    if (this == &rhs)
      return *this;
    decimal_t::operator=(rhs);
    for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
      buffer[i]= rhs.buffer[i];
    fix_buffer_pointer();
    return *this;
  }

  void init()
  {
#if !defined(DBUG_OFF)
    foo1= test_value;
    foo2= test_value;
#endif
    len= DECIMAL_BUFF_LENGTH;
    buf= buffer;
    TRASH_ALLOC(buffer, sizeof(buffer));
  }

  my_decimal()
  {
    init();
  }
  my_decimal(const uchar *bin, decimal_digits_t prec, decimal_digits_t scale)
  {
    init();
    check_result(E_DEC_FATAL_ERROR, bin2decimal(bin, this, prec, scale));
  }
  my_decimal(Field *field);
  ~my_decimal()
  {
    sanity_check();
  }

  void sanity_check()
  {
    DBUG_SLOW_ASSERT(foo1 == test_value);
    DBUG_SLOW_ASSERT(foo2 == test_value);
  }

  void fix_buffer_pointer() { buf= buffer; }

  bool sign() const { return decimal_t::sign; }
  void sign(bool s) { decimal_t::sign= s; }
  decimal_digits_t precision() const { return (decimal_digits_t) (intg + frac); }
  void set_zero()
  {
    /*
      We need the up-cast here, since my_decimal has sign() member functions,
      which conflicts with decimal_t::sign
      (and decimal_make_zero is a macro, rather than a funcion).
    */
    decimal_make_zero(static_cast<decimal_t*>(this));
  }
  int cmp(const my_decimal *other) const
  {
    return decimal_cmp(this, other);
  }

#ifndef MYSQL_CLIENT
  bool to_bool() const
  {
    return !decimal_is_zero(this);
  }
  double to_double() const
  {
    double res;
    decimal2double(this, &res);
    return res;
  }
  longlong to_longlong(bool unsigned_flag) const;
  /*
    Return the value as a signed or unsigned longlong, depending on the sign.
    - Positive values are returned as unsigned.
    - Negative values are returned as signed.
    This is used by bit SQL operators: | & ^ ~
    as well as by the SQL function BIT_COUNT().
  */
  longlong to_xlonglong() const
  { return to_longlong(!sign()); }

  // Convert to string returning decimal2string() error code
  int to_string_native(String *to, uint prec, uint dec, char filler,
                       uint mask= E_DEC_FATAL_ERROR) const;
  // Convert to string returning the String pointer
  String *to_string(String *to, uint prec, uint dec, char filler) const
  {
    return to_string_native(to, prec, dec, filler) ? NULL : to;
  }
  String *to_string(String *to) const
  {
    return to_string(to, 0, 0, 0);
  }
  String *to_string_round(String *to, decimal_digits_t scale,
                          my_decimal *round_buff) const
  {
    (void) round_to(round_buff, scale, HALF_UP); // QQ: check result?
    return round_buff->to_string(to);
  }
  /* Scale can be negative here when called from truncate() */
  int round_to(my_decimal *to, int scale, decimal_round_mode mode,
               int mask= E_DEC_FATAL_ERROR) const
  {
    return check_result(mask, decimal_round(this, to, scale, mode));
  }
  int to_binary(uchar *bin, int prec, decimal_digits_t scale,
                uint mask= E_DEC_FATAL_ERROR) const;
#endif
  /** Swap two my_decimal values */
  void swap(my_decimal &rhs)
  {
    swap_variables(my_decimal, *this, rhs);
  }
};


#ifndef DBUG_OFF
void print_decimal(const my_decimal *dec);
void print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length);
const char *dbug_decimal_as_string(char *buff, const my_decimal *val);
#else
#define dbug_decimal_as_string(A) NULL
#endif

bool str_set_decimal(uint mask, const my_decimal *val, uint fixed_prec,
                     uint fixed_dec, char filler, String *str,
                     CHARSET_INFO *cs);

extern my_decimal decimal_zero;

inline
void max_my_decimal(my_decimal *to, decimal_digits_t precision,
                    decimal_digits_t frac)
{
  DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&&
              (frac <= DECIMAL_MAX_SCALE));
  max_decimal(precision, frac, to);
}

inline void max_internal_decimal(my_decimal *to)
{
  max_my_decimal(to, DECIMAL_MAX_PRECISION, 0);
}

inline int check_result_and_overflow(uint mask, int result, my_decimal *val)
{
  if (check_result(mask, result) & E_DEC_OVERFLOW)
  {
    bool sign= val->sign();
    val->fix_buffer_pointer();
    max_internal_decimal(val);
    val->sign(sign);
  }
  return result;
}

inline decimal_digits_t my_decimal_length_to_precision(decimal_digits_t length,
                                                       decimal_digits_t scale,
                                                       bool unsigned_flag)
{
  /* Precision can't be negative thus ignore unsigned_flag when length is 0. */
  DBUG_ASSERT(length || !scale);
  return (decimal_digits_t) (length - (scale>0 ? 1:0) -
                             (unsigned_flag || !length ? 0:1));
}

inline decimal_digits_t
my_decimal_precision_to_length_no_truncation(decimal_digits_t precision,
                                             decimal_digits_t scale,
                                             bool unsigned_flag)
{
  /*
    When precision is 0 it means that original length was also 0. Thus
    unsigned_flag is ignored in this case.
  */
  DBUG_ASSERT(precision || !scale);
  return (decimal_digits_t)(precision + (scale > 0 ? 1 : 0) +
                            (unsigned_flag || !precision ? 0 : 1));
}

inline decimal_digits_t
my_decimal_precision_to_length(decimal_digits_t precision,
                               decimal_digits_t scale,
                               bool unsigned_flag)
{
  /*
    When precision is 0 it means that original length was also 0. Thus
    unsigned_flag is ignored in this case.
  */
  DBUG_ASSERT(precision || !scale);
  set_if_smaller(precision, DECIMAL_MAX_PRECISION);
  return my_decimal_precision_to_length_no_truncation(precision, scale,
                                                      unsigned_flag);
}

inline
uint my_decimal_string_length(const my_decimal *d)
{
  /* length of string representation including terminating '\0' */
  return decimal_string_size(d);
}


inline
uint my_decimal_max_length(const my_decimal *d)
{
  /* -1 because we do not count \0 */
  return decimal_string_size(d) - 1;
}


inline
uint my_decimal_get_binary_size(decimal_digits_t precision,
                                decimal_digits_t scale)
{
  return decimal_bin_size(precision, scale);
}


inline
void my_decimal2decimal(const my_decimal *from, my_decimal *to)
{
  *to= *from;
}


inline
int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d,
                      decimal_digits_t prec, decimal_digits_t scale)
{
  return check_result(mask, bin2decimal(bin, d, prec, scale));
}


inline
int my_decimal_set_zero(my_decimal *d)
{
  d->set_zero();
  return 0;
}


inline
bool my_decimal_is_zero(const my_decimal *decimal_value)
{
  return decimal_is_zero(decimal_value);
}


inline bool str_set_decimal(const my_decimal *val, String *str,
                            CHARSET_INFO *cs)
{
  return str_set_decimal(E_DEC_FATAL_ERROR, val, 0, 0, 0, str, cs);
}


bool my_decimal2seconds(const my_decimal *d, ulonglong *sec,
                        ulong *microsec, ulong *nanosec);

my_decimal *seconds2my_decimal(bool sign, ulonglong sec, ulong microsec,
                               my_decimal *d);

#define TIME_to_my_decimal(TIME, DECIMAL)                       \
     seconds2my_decimal((TIME)->neg, TIME_to_ulonglong(TIME),   \
                        (TIME)->second_part, (DECIMAL))

int my_decimal2int(uint mask, const decimal_t *d, bool unsigned_flag,
		   longlong *l, decimal_round_mode round_type= HALF_UP);

inline
int my_decimal2double(uint, const decimal_t *d, double *result)
{
  /* No need to call check_result as this will always succeed */
  return decimal2double(d, result);
}


inline
int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end)
{
  return check_result_and_overflow(mask, string2decimal(str, d, end), d);
}


int str2my_decimal(uint mask, const char *from, size_t length,
                   CHARSET_INFO *charset, my_decimal *decimal_value,
                   const char **end);

inline int str2my_decimal(uint mask, const char *from, size_t length,
                          CHARSET_INFO *charset, my_decimal *decimal_value)
{
  const char *end;
  return str2my_decimal(mask, from, length, charset, decimal_value, &end);
}

#if defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
inline
int string2my_decimal(uint mask, const String *str, my_decimal *d)
{
  const char *end;
  return str2my_decimal(mask, str->ptr(), str->length(), str->charset(),
                        d, &end);
}


my_decimal *date2my_decimal(const MYSQL_TIME *ltime, my_decimal *dec);


#endif /*defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) */

inline
int double2my_decimal(uint mask, double val, my_decimal *d)
{
  return check_result_and_overflow(mask, double2decimal(val, d), d);
}


inline
int int2my_decimal(uint mask, longlong i, my_bool unsigned_flag, my_decimal *d)
{
  return check_result(mask, (unsigned_flag ?
			     ulonglong2decimal((ulonglong)i, d) :
			     longlong2decimal(i, d)));
}

inline
void decimal2my_decimal(decimal_t *from, my_decimal *to)
{
  DBUG_ASSERT(to->len >= from->len);
  to->intg= from->intg;
  to->frac= from->frac;
  to->sign(from->sign);
  memcpy(to->buf, from->buf, to->len*sizeof(decimal_digit_t));
}


inline
void my_decimal_neg(decimal_t *arg)
{
  if (decimal_is_zero(arg))
  {
    arg->sign= 0;
    return;
  }
  decimal_neg(arg);
}


inline
int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a,
		   const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_add(a, b, res),
                                   res);
}


inline
int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a,
		   const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_sub(a, b, res),
                                   res);
}


inline
int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a,
		   const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_mul(a, b, res),
                                   res);
}


inline
int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a,
		   const my_decimal *b, int div_scale_inc)
{
  return check_result_and_overflow(mask,
                                   decimal_div(a, b, res, div_scale_inc),
                                   res);
}


inline
int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a,
		   const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_mod(a, b, res),
                                   res);
}

/**
  @return
    -1 if a<b, 1 if a>b and 0 if a==b
*/
inline
int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
{
  return decimal_cmp(a, b);
}


inline
int my_decimal_intg(const my_decimal *a)
{
  return decimal_intg(a);
}


void my_decimal_trim(ulonglong *precision, decimal_digits_t *scale);


#endif /*my_decimal_h*/

server/private/set_var.h000064400000040247150400264010011337 0ustar00#ifndef SET_VAR_INCLUDED
#define SET_VAR_INCLUDED
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
   Copyright (c) 2009, 2020, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/**
  @file
  "public" interface to sys_var - server configuration variables.
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface                       /* gcc class implementation */
#endif

#include <my_getopt.h>
#include <my_attribute.h>

class sys_var;
class set_var;
class sys_var_pluginvar;
class PolyLock;
class Item_func_set_user_var;

// This include needs to be here since item.h requires enum_var_type :-P
#include "item.h"                          /* Item */
#include "sql_class.h"                     /* THD  */

extern TYPELIB bool_typelib;

struct sys_var_chain
{
  sys_var *first;
  sys_var *last;
};

int mysql_add_sys_var_chain(sys_var *chain);
int mysql_del_sys_var_chain(sys_var *chain);


/**
  A class representing one system variable - that is something
  that can be accessed as @@global.variable_name or @@session.variable_name,
  visible in SHOW xxx VARIABLES and in INFORMATION_SCHEMA.xxx_VARIABLES,
  optionally it can be assigned to, optionally it can have a command-line
  counterpart with the same name.
*/
class sys_var: protected Value_source // for double_from_string_with_check
{
public:
  sys_var *next;
  LEX_CSTRING name;
  bool *test_load;
  enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023,
                   READONLY=1024, ALLOCATED=2048, PARSE_EARLY=4096,
                   NO_SET_STATEMENT=8192, AUTO_SET=16384};
  enum { NO_GETOPT=-1, GETOPT_ONLY_HELP=-2 };
  enum where { CONFIG, COMMAND_LINE, AUTO, SQL, COMPILE_TIME, ENV };

  /**
    Enumeration type to indicate for a system variable whether
    it will be written to the binlog or not.
  */    
  enum binlog_status_enum { VARIABLE_NOT_IN_BINLOG,
                            SESSION_VARIABLE_IN_BINLOG } binlog_status;

  my_option option;     ///< min, max, default values are stored here
  enum where value_origin;
  const char *origin_filename;

protected:
  typedef bool (*on_check_function)(sys_var *self, THD *thd, set_var *var);
  typedef bool (*on_update_function)(sys_var *self, THD *thd, enum_var_type type);

  int flags;            ///< or'ed flag_enum values
  const SHOW_TYPE show_val_type; ///< what value_ptr() returns for sql_show.cc
  PolyLock *guard;      ///< *second* lock that protects the variable
  ptrdiff_t offset;     ///< offset to the value from global_system_variables
  on_check_function on_check;
  on_update_function on_update;
  const char *const deprecation_substitute;

public:
  sys_var(sys_var_chain *chain, const char *name_arg, const char *comment,
          int flag_args, ptrdiff_t off, int getopt_id,
          enum get_opt_arg_type getopt_arg_type, SHOW_TYPE show_val_type_arg,
          longlong def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg,
          on_check_function on_check_func, on_update_function on_update_func,
          const char *substitute);

  virtual ~sys_var() = default;

  /**
    All the cleanup procedures should be performed here
  */
  virtual void cleanup() {}
  /**
    downcast for sys_var_pluginvar. Returns this if it's an instance
    of sys_var_pluginvar, and 0 otherwise.
  */
  virtual sys_var_pluginvar *cast_pluginvar() { return 0; }

  bool check(THD *thd, set_var *var);
  const uchar *value_ptr(THD *thd, enum_var_type type, const LEX_CSTRING *base) const;

  /**
     Update the system variable with the default value from either
     session or global scope.  The default value is stored in the
     'var' argument. Return false when successful.
  */
  bool set_default(THD *thd, set_var *var);
  bool update(THD *thd, set_var *var);

  String *val_str_nolock(String *str, THD *thd, const uchar *value);
  longlong val_int(bool *is_null, THD *thd, enum_var_type type, const LEX_CSTRING *base);
  String *val_str(String *str, THD *thd, enum_var_type type, const LEX_CSTRING *base);
  double val_real(bool *is_null, THD *thd, enum_var_type type, const LEX_CSTRING *base);

  SHOW_TYPE show_type() const { return show_val_type; }
  int scope() const { return flags & SCOPE_MASK; }
  virtual CHARSET_INFO *charset(THD *thd) const
  {
    return system_charset_info;
  }
  bool is_readonly() const { return flags & READONLY; }
  /**
    the following is only true for keycache variables,
    that support the syntax @@keycache_name.variable_name
  */
  bool is_struct() { return option.var_type & GET_ASK_ADDR; }
  bool is_set_stmt_ok() const { return !(flags & NO_SET_STATEMENT); }
  bool is_written_to_binlog(enum_var_type type)
  { return type != OPT_GLOBAL && binlog_status == SESSION_VARIABLE_IN_BINLOG; }
  bool check_update_type(const Item *item)
  {
    Item_result type= item->result_type();
    switch (option.var_type & GET_TYPE_MASK) {
    case GET_INT:
    case GET_UINT:
    case GET_LONG:
    case GET_ULONG:
    case GET_LL:
    case GET_ULL:
      return type != INT_RESULT &&
             (type != DECIMAL_RESULT || item->decimals != 0);
    case GET_STR:
    case GET_STR_ALLOC:
      return type != STRING_RESULT;
    case GET_ENUM:
    case GET_BOOL:
    case GET_SET:
    case GET_FLAGSET:
    case GET_BIT:
      return type != STRING_RESULT && type != INT_RESULT;
    case GET_DOUBLE:
      return type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT;
    default:
      return true;
    }
  }

  bool check_type(enum_var_type type)
  {
    switch (scope())
    {
    case GLOBAL:       return type != OPT_GLOBAL;
    case SESSION:      return false; // always ok
    case ONLY_SESSION: return type == OPT_GLOBAL;
    }
    return true; // keep gcc happy
  }
  bool register_option(DYNAMIC_ARRAY *array, int parse_flags)
  {
    DBUG_ASSERT(parse_flags == GETOPT_ONLY_HELP ||
                parse_flags == PARSE_EARLY || parse_flags == 0);
    if (option.id == NO_GETOPT)
      return 0;
    if (parse_flags == GETOPT_ONLY_HELP)
    {
      if (option.id != GETOPT_ONLY_HELP)
        return 0;
    }
    else
    {
      if (option.id == GETOPT_ONLY_HELP)
        return 0;
      if ((flags & PARSE_EARLY) != parse_flags)
        return 0;
    }
    return insert_dynamic(array, (uchar*)&option);
  }
  void do_deprecated_warning(THD *thd);
  /**
    whether session value of a sysvar is a default one.

    in this simple implementation we don't distinguish between default
    and non-default values. for most variables it's ok, they don't treat
    default values specially. this method is overwritten in descendant
    classes as necessary.
  */
  virtual bool session_is_default(THD *thd) { return false; }

  virtual const uchar *default_value_ptr(THD *thd) const
  { return (uchar*)&option.def_value; }

  virtual bool on_check_access_global(THD *thd) const;
  virtual bool on_check_access_session(THD *thd) const
  {
    return false;
  }

private:
  virtual bool do_check(THD *thd, set_var *var) = 0;
  /**
    save the session default value of the variable in var
  */
  virtual void session_save_default(THD *thd, set_var *var) = 0;
  /**
    save the global default value of the variable in var
  */
  virtual void global_save_default(THD *thd, set_var *var) = 0;
  virtual bool session_update(THD *thd, set_var *var) = 0;
  virtual bool global_update(THD *thd, set_var *var) = 0;

protected:
  /**
    A pointer to a value of the variable for SHOW.
    It must be of show_val_type type (my_bool for SHOW_MY_BOOL,
    int for SHOW_INT, longlong for SHOW_LONGLONG, etc).
  */
  virtual const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const;
  virtual const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const;

  /**
    A pointer to a storage area of the variable, to the raw data.
    Typically it's the same as session_value_ptr(), but it's different,
    for example, for ENUM, that is printed as a string, but stored as a number.
  */
  ATTRIBUTE_NO_UBSAN
  uchar *session_var_ptr(THD *thd) const
  { return ((uchar*)&(thd->variables)) + offset; }

  ATTRIBUTE_NO_UBSAN
  uchar *global_var_ptr() const
  { return ((uchar*)&global_system_variables) + offset; }

  void *max_var_ptr()
  {
    return scope() == SESSION ? (((uchar*)&max_system_variables) + offset) :
                                0;
  }

  friend class Session_sysvars_tracker;
  friend class Session_tracker;
};

#include "sql_plugin.h"                    /* SHOW_HA_ROWS, SHOW_MY_BOOL */


/****************************************************************************
  Classes for parsing of the SET command
****************************************************************************/

/**
  A base class for everything that can be set with SET command.
  It's similar to Items, an instance of this is created by the parser
  for every assigmnent in SET (or elsewhere, e.g. in SELECT).
*/
class set_var_base :public Sql_alloc
{
public:
  set_var_base() = default;
  virtual ~set_var_base() = default;
  virtual int check(THD *thd)=0;           /* To check privileges etc. */
  virtual int update(THD *thd)=0;                  /* To set the value */
  virtual int light_check(THD *thd) { return check(thd); }   /* for PS */
  virtual bool is_system() { return FALSE; }
  /**
    @returns whether this variable is @@@@optimizer_trace.
  */
  virtual bool is_var_optimizer_trace() const { return false; }
};


/**
  Structure for holding unix timestamp and high precision second part.
 */
typedef struct my_time_t_hires
{
  my_time_t unix_time;
  ulong second_part;
} my_time_t_hires;


/**
  set_var_base descendant for assignments to the system variables.
*/
class set_var :public set_var_base
{
public:
  sys_var *var; ///< system variable to be updated
  Item *value;  ///< the expression that provides the new value of the variable
  enum_var_type type;
  union ///< temp storage to hold a value between sys_var::check and ::update
  {
    ulonglong ulonglong_value;          ///< for unsigned integer, set, enum sysvars
    longlong longlong_value;            ///< for signed integer
    double double_value;                ///< for Sys_var_double
    plugin_ref plugin;                  ///< for Sys_var_plugin
    plugin_ref *plugins;                ///< for Sys_var_pluginlist
    Time_zone *time_zone;               ///< for Sys_var_tz
    LEX_STRING string_value;            ///< for Sys_var_charptr and others
    my_time_t_hires timestamp;          ///< for Sys_var_vers_asof
    const void *ptr;                    ///< for Sys_var_struct
  } save_result;
  LEX_CSTRING base; /**< for structured variables, like keycache_name.variable_name */

  set_var(THD *thd, enum_var_type type_arg, sys_var *var_arg,
          const LEX_CSTRING *base_name_arg, Item *value_arg);
  bool is_system() override { return 1; }
  int check(THD *thd) override;
  int update(THD *thd) override;
  int light_check(THD *thd) override;
  bool is_var_optimizer_trace() const override
  {
    extern sys_var *Sys_optimizer_trace_ptr;
    return var == Sys_optimizer_trace_ptr;
  }
};


/* User variables like @my_own_variable */
class set_var_user: public set_var_base
{
  Item_func_set_user_var *user_var_item;
public:
  set_var_user(Item_func_set_user_var *item)
    :user_var_item(item)
  {}
  int check(THD *thd) override;
  int update(THD *thd) override;
  int light_check(THD *thd) override;
};

/* For SET PASSWORD */

class set_var_password: public set_var_base
{
  LEX_USER *user;
public:
  set_var_password(LEX_USER *user_arg) :user(user_arg)
  {}
  int check(THD *thd) override;
  int update(THD *thd) override;
};

/* For SET ROLE */

class set_var_role: public set_var_base
{
  LEX_CSTRING role;
  privilege_t access;
public:
  set_var_role(LEX_CSTRING role_arg) : role(role_arg), access(NO_ACL) {}
  int check(THD *thd) override;
  int update(THD *thd) override;
};

/* For SET DEFAULT ROLE */

class set_var_default_role: public set_var_base
{
  LEX_USER *user, *real_user;
  LEX_CSTRING role;
  const char *real_role;
public:
  set_var_default_role(LEX_USER *user_arg, LEX_CSTRING role_arg) :
    user(user_arg), role(role_arg) {}
  int check(THD *thd) override;
  int update(THD *thd) override;
};

/* For SET NAMES and SET CHARACTER SET */

class set_var_collation_client: public set_var_base
{
  CHARSET_INFO *character_set_client;
  CHARSET_INFO *character_set_results;
  CHARSET_INFO *collation_connection;
public:
  set_var_collation_client(CHARSET_INFO *client_coll_arg,
                           CHARSET_INFO *connection_coll_arg,
                           CHARSET_INFO *result_coll_arg)
    :character_set_client(client_coll_arg),
     character_set_results(result_coll_arg),
     collation_connection(connection_coll_arg)
  {}
  int check(THD *thd) override;
  int update(THD *thd) override;
};


/* optional things, have_* variables */
extern SHOW_COMP_OPTION have_csv, have_innodb;
extern SHOW_COMP_OPTION have_ndbcluster, have_partitioning;
extern SHOW_COMP_OPTION have_profiling;

extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
extern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
extern SHOW_COMP_OPTION have_compress;
extern SHOW_COMP_OPTION have_openssl;

/*
  Prototypes for helper functions
*/
ulong get_system_variable_hash_records(void);
ulonglong get_system_variable_hash_version(void);

SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type);
int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond);

sys_var *find_sys_var(THD *thd, const char *str, size_t length= 0,
                      bool throw_error= false);
int sql_set_variables(THD *thd, List<set_var_base> *var_list, bool free);

#define SYSVAR_AUTOSIZE(VAR,VAL)                        \
  do {                                                  \
    VAR= (VAL);                                         \
    set_sys_var_value_origin(&VAR, sys_var::AUTO);      \
  } while(0)

#define SYSVAR_AUTOSIZE_IF_CHANGED(VAR,VAL,TYPE)        \
  do {                                                  \
    TYPE tmp= (VAL);                                    \
    if (VAR != tmp)                                     \
    {                                                   \
      VAR= (VAL);                                       \
      set_sys_var_value_origin(&VAR, sys_var::AUTO);    \
    }                                                   \
  } while(0)

void set_sys_var_value_origin(void *ptr, enum sys_var::where here,
                              const char *filename= NULL);

enum sys_var::where get_sys_var_value_origin(void *ptr);
inline bool IS_SYSVAR_AUTOSIZE(void *ptr)
{
  enum sys_var::where res= get_sys_var_value_origin(ptr);
  return (res == sys_var::AUTO || res == sys_var::COMPILE_TIME);
}

bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type);

sql_mode_t expand_sql_mode(sql_mode_t sql_mode);
const char *sql_mode_string_representation(uint bit_number);
bool sql_mode_string_representation(THD *thd, sql_mode_t sql_mode,
                                    LEX_CSTRING *ls);
int default_regex_flags_pcre(THD *thd);

extern sys_var *Sys_autocommit_ptr, *Sys_last_gtid_ptr,
  *Sys_character_set_client_ptr, *Sys_character_set_connection_ptr,
  *Sys_character_set_results_ptr;

CHARSET_INFO *get_old_charset_by_name(const char *old_name);

int sys_var_init();
uint sys_var_elements();
int sys_var_add_options(DYNAMIC_ARRAY *long_options, int parse_flags);
void sys_var_end(void);
bool check_has_super(sys_var *self, THD *thd, set_var *var);
plugin_ref *resolve_engine_list(THD *thd, const char *str_arg, size_t str_arg_len,
                                bool error_on_unknown_engine, bool temp_copy);
void free_engine_list(plugin_ref *list);
plugin_ref *copy_engine_list(plugin_ref *list);
plugin_ref *temp_copy_engine_list(THD *thd, plugin_ref *list);
char *pretty_print_engine_list(THD *thd, plugin_ref *list);

#endif
server/private/aligned.h000064400000002160150400264010011267 0ustar00/*
   Copyright (c) 2022, 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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

#if defined __linux__
# include <malloc.h>
#endif

inline void *aligned_malloc(size_t size, size_t alignment)
{
#ifdef _WIN32
  return _aligned_malloc(size, alignment);
#elif defined __linux__
  return memalign(alignment, size);
#else
  void *result;
  if (posix_memalign(&result, alignment, size))
    result= NULL;
  return result;
#endif
}

inline void aligned_free(void *ptr)
{
  IF_WIN(_aligned_free,free)(ptr);
}
server/private/wsrep_var.h000064400000010777150400264010011711 0ustar00/* Copyright (C) 2013-2023 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA. */

#ifndef WSREP_VAR_H
#define WSREP_VAR_H

#include <my_config.h>

#ifdef WITH_WSREP

#define WSREP_CLUSTER_NAME              "my_wsrep_cluster"
#define WSREP_NODE_INCOMING_AUTO        "AUTO"
#define WSREP_START_POSITION_ZERO       "00000000-0000-0000-0000-000000000000:-1"
#define WSREP_START_POSITION_ZERO_GTID  "00000000-0000-0000-0000-000000000000:-1,0-0-0"

// MySQL variables funcs

#include "sql_priv.h"
#include <sql_plugin.h>
#include <mysql/plugin.h>

class sys_var;
class set_var;
class THD;

int wsrep_init_vars();
void wsrep_set_wsrep_on(THD *thd);
void wsrep_free_status_vars();

#define CHECK_ARGS   (sys_var *self, THD* thd, set_var *var)
#define UPDATE_ARGS  (sys_var *self, THD* thd, enum_var_type type)
#define DEFAULT_ARGS (THD* thd, enum_var_type var_type)
#define INIT_ARGS    (const char* opt)

extern bool wsrep_causal_reads_update        UPDATE_ARGS;
extern bool wsrep_on_check                   CHECK_ARGS;
extern bool wsrep_on_update                  UPDATE_ARGS;
extern bool wsrep_sync_wait_update           UPDATE_ARGS;
extern bool wsrep_start_position_check       CHECK_ARGS;
extern bool wsrep_start_position_update      UPDATE_ARGS;
extern bool wsrep_start_position_init        INIT_ARGS;

extern bool wsrep_provider_check             CHECK_ARGS;
extern bool wsrep_provider_update            UPDATE_ARGS;
extern void wsrep_provider_init              INIT_ARGS;

extern bool wsrep_provider_options_check     CHECK_ARGS;
extern bool wsrep_provider_options_update    UPDATE_ARGS;
extern void wsrep_provider_options_init      INIT_ARGS;

extern bool wsrep_cluster_address_check      CHECK_ARGS;
extern bool wsrep_cluster_address_update     UPDATE_ARGS;
extern void wsrep_cluster_address_init       INIT_ARGS;

extern bool wsrep_cluster_name_check         CHECK_ARGS;
extern bool wsrep_cluster_name_update        UPDATE_ARGS;

extern bool wsrep_node_name_check            CHECK_ARGS;
extern bool wsrep_node_name_update           UPDATE_ARGS;

extern bool wsrep_node_address_check         CHECK_ARGS;
extern bool wsrep_node_address_update        UPDATE_ARGS;
extern void wsrep_node_address_init          INIT_ARGS;

extern bool wsrep_sst_method_check           CHECK_ARGS;
extern bool wsrep_sst_method_update          UPDATE_ARGS;
extern void wsrep_sst_method_init            INIT_ARGS;

extern bool wsrep_sst_receive_address_check  CHECK_ARGS;
extern bool wsrep_sst_receive_address_update UPDATE_ARGS;

extern bool wsrep_sst_auth_check             CHECK_ARGS;
extern bool wsrep_sst_auth_update            UPDATE_ARGS;

extern bool wsrep_sst_donor_check            CHECK_ARGS;
extern bool wsrep_sst_donor_update           UPDATE_ARGS;

extern bool wsrep_slave_threads_check        CHECK_ARGS;
extern bool wsrep_slave_threads_update       UPDATE_ARGS;

extern bool wsrep_desync_check               CHECK_ARGS;
extern bool wsrep_desync_update              UPDATE_ARGS;

extern bool wsrep_trx_fragment_size_check    CHECK_ARGS;
extern bool wsrep_trx_fragment_size_update   UPDATE_ARGS;

extern bool wsrep_trx_fragment_unit_update   UPDATE_ARGS;

extern bool wsrep_max_ws_size_check          CHECK_ARGS;
extern bool wsrep_max_ws_size_update         UPDATE_ARGS;

extern bool wsrep_reject_queries_update      UPDATE_ARGS;

extern bool wsrep_debug_update               UPDATE_ARGS;

extern bool wsrep_gtid_seq_no_check          CHECK_ARGS;

extern bool wsrep_gtid_domain_id_update      UPDATE_ARGS;

extern bool wsrep_mode_check                 CHECK_ARGS;
extern bool wsrep_strict_ddl_update          UPDATE_ARGS;
extern bool wsrep_replicate_myisam_update    UPDATE_ARGS;
extern bool wsrep_replicate_myisam_check     CHECK_ARGS;
extern bool wsrep_forced_binlog_format_check CHECK_ARGS;
#else  /* WITH_WSREP */

#define wsrep_provider_init(X)
#define wsrep_init_vars() (0)
#define wsrep_start_position_init(X)

#endif /* WITH_WSREP */
#endif /* WSREP_VAR_H */
server/private/my_handler_errors.h000064400000011422150400264010013403 0ustar00#ifndef MYSYS_MY_HANDLER_ERRORS_INCLUDED
#define MYSYS_MY_HANDLER_ERRORS_INCLUDED

/* Copyright (c) 2008, 2013, Oracle and/or its affiliates.
   Copyright (c) 2011, 2013, SkySQL Ab.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*
  Errors a handler can give you
*/

static const char *handler_error_messages[]=
{
  /* 120 */
  "Didn't find the key on read or update",
  "Duplicate key on write or update",
  "Internal (unspecified) error in handler",
  "Someone has changed the row since it was read (even though the table was locked to prevent it)",
  "Wrong index given to a function",
  "Undefined handler error 125",
  "Index is corrupted",
  "Table file is corrupted",
  "Out of memory in engine",
  "Undefined handler error 129",
  /* 130 */
  "Incorrect file format",
  "Command not supported by the engine",
  "Old database file",
  "No record read before update",
  "Record was already deleted (or record file crashed)",
  "No more room in record file",
  "No more room in index file",
  "No more records (read after end of file)",
  "Unsupported extension used for table",
  "Too big row",
  /* 140 */
  "Wrong create options",
  "Duplicate unique key on write or update",
  "Unknown character set used in table",
  "Conflicting table definitions in sub-tables of MERGE table",
  "Table is crashed and last repair failed",
  "Table was marked as crashed and should be repaired",
  "Lock timed out; Retry transaction",
  "Lock table is full;  Restart program with a larger lock table",
  "Updates are not allowed under a read only transactions",
  "Lock deadlock; Retry transaction",
  /* 150 */
  "Foreign key constraint is incorrectly formed",
  "Cannot add a child row",
  "Cannot delete a parent row",
  "No savepoint with that name",
  "Non unique key block size",
  "The table does not exist in the storage engine",
  "The table already existed in the storage engine",
  "Could not connect to the storage engine",
  "Unexpected null pointer found when using spatial index",
  "The table changed in the storage engine",
  /* 160 */
  "There's no partition in the table for the given value",
  "Row-based binary logging of row failed",
  "Index needed in foreign key constraint",
  "Upholding foreign key constraints would lead to a duplicate key error in some other table",
  "Table needs to be upgraded before it can be used",
  "Table is read only",
  "Failed to get next auto increment value",
  "Failed to set row auto increment value",
  "Unknown (generic) error from engine",
  "Record was not updated. New values were the same as original values",
  /* 170 */
  "It is not possible to log this statement",
  "The event was corrupt, leading to illegal data being read",
  "The table is of a new format not supported by this version",
  "The event could not be processed. No other handler error happened",
  "Fatal error during initialization of handler",
  "File too short; Expected more data in file",
  "Read page with wrong checksum",
  "Too many active concurrent transactions",
  "Record not matching the given partition set",
  "Index column length exceeds limit",
  /* 180 */
  "Index corrupted",
  "Undo record too big",
  "Invalid InnoDB FTS Doc ID",
  "Table is being used in foreign key check",
  "Tablespace already exists",
  "Too many columns",
  "Row in wrong partition",
  "Row is not visible by the current transaction",
  "Operation was interrupted by end user (probably kill command?)",
  "Disk full",
  /* 190 */
  "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You may have retry or dump and restore the table to fix this",
  "Too many words in a FTS phrase or proximity search",
  "Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.",
  "Foreign key cascade delete/update exceeds max depth",
  "Tablespace is missing for a table",
  "Sequence has been run out",
  "Sequence values are conflicting",
  "Error during commit",
  "Cannot select partitions",
  "Cannot initialize encryption. Check that all encryption parameters have been set",
  "Transaction was aborted",
};

#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
server/private/item_vers.h000064400000010356150400264010011667 0ustar00#ifndef ITEM_VERS_INCLUDED
#define ITEM_VERS_INCLUDED
/* Copyright (c) 2017, 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 Street, Fifth Floor, Boston, MA  02110-1301, USA */


/* System Versioning items */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

class Item_func_history: public Item_bool_func
{
public:
  /*
     @param    a  Item_field for row_end system field
  */
  Item_func_history(THD *thd, Item *a): Item_bool_func(thd, a)
  {
    DBUG_ASSERT(a->type() == Item::FIELD_ITEM);
  }

  bool val_bool() override;
  bool fix_length_and_dec() override
  {
    set_maybe_null();
    null_value= 0;
    decimals= 0;
    max_length= 1;
    return FALSE;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("is_history") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_history>(thd, this); }
};

class Item_func_trt_ts: public Item_datetimefunc
{
  TR_table::field_id_t trt_field;
public:
  Item_func_trt_ts(THD *thd, Item* a, TR_table::field_id_t _trt_field);
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING begin_name=  {STRING_WITH_LEN("trt_begin_ts") };
    static LEX_CSTRING commit_name= {STRING_WITH_LEN("trt_commit_ts") };
    return (trt_field == TR_table::FLD_BEGIN_TS) ? begin_name : commit_name;
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_trt_ts>(thd, this); }
  bool fix_length_and_dec() override
  { fix_attributes_datetime(decimals); return FALSE; }
};

class Item_func_trt_id : public Item_longlong_func
{
  TR_table::field_id_t trt_field;
  bool backwards;

  longlong get_by_trx_id(ulonglong trx_id);
  longlong get_by_commit_ts(MYSQL_TIME &commit_ts, bool backwards);

public:
  Item_func_trt_id(THD *thd, Item* a, TR_table::field_id_t _trt_field, bool _backwards= false);
  Item_func_trt_id(THD *thd, Item* a, Item* b, TR_table::field_id_t _trt_field);

  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING trx_name= {STRING_WITH_LEN("trt_trx_id") };
    static LEX_CSTRING commit_name= {STRING_WITH_LEN("trt_commit_id") };
    static LEX_CSTRING iso_name= {STRING_WITH_LEN("trt_iso_level") };

    switch (trt_field) {
    case TR_table::FLD_TRX_ID:
      return trx_name;
    case TR_table::FLD_COMMIT_ID:
      return commit_name;
    case TR_table::FLD_ISO_LEVEL:
      return iso_name;
    default:
      DBUG_ASSERT(0);
    }
    return NULL_clex_str;
  }

  bool fix_length_and_dec() override
  {
    bool res= Item_int_func::fix_length_and_dec();
    max_length= 20;
    return res;
  }

  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_trt_id>(thd, this); }
};

class Item_func_trt_trx_sees : public Item_bool_func
{
protected:
  bool accept_eq;

public:
  Item_func_trt_trx_sees(THD *thd, Item* a, Item* b);
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("trt_trx_sees") };
    return name;
  }
  bool val_bool() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_trt_trx_sees>(thd, this); }
};

class Item_func_trt_trx_sees_eq :
  public Item_func_trt_trx_sees
{
public:
  Item_func_trt_trx_sees_eq(THD *thd, Item* a, Item* b) :
    Item_func_trt_trx_sees(thd, a, b)
  {
    accept_eq= true;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("trt_trx_sees_eq") };
    return name;
  }
};

#endif /* ITEM_VERS_INCLUDED */
server/private/opt_trace.h000064400000020456150400264010011654 0ustar00#ifndef OPT_TRACE_INCLUDED
#define OPT_TRACE_INCLUDED
/* 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-1301  USA */

#include "opt_trace_context.h"  // Opt_trace_context
#include "sql_lex.h"
#include "my_json_writer.h"
#include "sql_select.h"
class Item;
class THD;
struct TABLE_LIST;

/*
   User-visible information about a trace.
*/

struct Opt_trace_info
{
  /**
     String containing trace.
     If trace has been end()ed, this is 0-terminated, which is only to aid
     debugging or unit testing; this property is not relied upon in normal
     server usage.
     If trace has not been ended, this is not 0-terminated. That rare case can
     happen when a substatement reads OPTIMIZER_TRACE (at that stage, the top
     statement is still executing so its trace is not ended yet, but may still
     be read by the sub-statement).
  */
  const char *trace_ptr;
  size_t trace_length;
  //// String containing original query.
  const char *query_ptr;
  size_t query_length;
  const CHARSET_INFO *query_charset;  ///< charset of query string
  /**
    How many bytes this trace is missing (for traces which were truncated
    because of @@@@optimizer-trace-max-mem-size).
    The trace is not extended beyond trace-max-mem-size.
  */
  size_t missing_bytes;
  /*
    Whether user lacks privilege to see this trace.
    If this is set to TRUE, then we return an empty trace
  */
  bool missing_priv;
};

/**
  Instantiate this class to start tracing a THD's actions (generally at a
  statement's start), and to set the "original" query (not transformed, as
  sent by client) for the new trace. Destructor will end the trace.

  @param  thd          the THD
  @param  tbl          list of tables read/written by the statement.
  @param  sql_command  SQL command being prepared or executed
  @param  set_vars     what variables are set by this command (only used if
                       sql_command is SQLCOM_SET_OPTION)
  @param  query        query
  @param  length       query's length
  @param  charset      charset which was used to encode this query
*/


class Opt_trace_start
{
 public:
  Opt_trace_start(THD *thd_arg): ctx(&thd_arg->opt_trace), traceable(false) {}

  void init(THD *thd, TABLE_LIST *tbl,
            enum enum_sql_command sql_command,
            List<set_var_base> *set_vars,
            const char *query,
            size_t query_length,
            const CHARSET_INFO *query_charset);

  ~Opt_trace_start();

 private:
  Opt_trace_context *const ctx;
  /*
    True: the query will be traced
    False: otherwise
  */
  bool traceable;
};

/**
   Prints SELECT query to optimizer trace. It is not the original query (as in
   @c Opt_trace_context::set_query()) but a printout of the parse tree
   (Item-s).
   @param  thd         the THD
   @param  select_lex  query's parse tree
   @param  trace_object  Json_writer object to which the query will be added
*/
void opt_trace_print_expanded_query(THD *thd, SELECT_LEX *select_lex,
                                    Json_writer_object *trace_object);

void add_table_scan_values_to_trace(THD *thd, JOIN_TAB *tab);
void trace_plan_prefix(JOIN *join, uint idx, table_map join_tables);
void print_final_join_order(JOIN *join);
void print_best_access_for_table(THD *thd, POSITION *pos,
                                 enum join_type type);

void trace_condition(THD * thd, const char *name, const char *transform_type,
                    Item *item, const char *table_name= nullptr);


/*
  Security related (need to add a proper comment here)
*/

/**
   If the security context is not that of the connected user, inform the trace
   system that a privilege is missing. With one exception: see below.

   @param thd

   This serves to eliminate the following issue.
   Any information readable by a SELECT may theoretically end up in
   the trace. And a SELECT may read information from other places than tables:
   - from views (reading their bodies)
   - from stored routines (reading their bodies)
   - from files (reading their content), with LOAD_FILE()
   - from the list of connections (reading their queries...), with
   I_S.PROCESSLIST.
   If the connected user has EXECUTE privilege on a routine which does a
   security context change, the routine can retrieve information internally
   (if allowed by the SUID context's privileges), and present only a portion
   of it to the connected user. But with tracing on, all information is
   possibly in the trace. So the connected user receives more information than
   the routine's definer intended to provide.  Fixing this issue would require
   adding, near many privilege checks in the server, a new
   optimizer-trace-specific check done against the connected user's context,
   to verify that the connected user has the right to see the retrieved
   information.

   Instead, our chosen simpler solution is that if we see a security context
   change where SUID user is not the connected user, we disable tracing. With
   only one safe exception: if the connected user has all global privileges
   (because then she/he can find any information anyway). By "all global
   privileges" we mean everything but WITH GRANT OPTION (that latter one isn't
   related to information gathering).

   Read access to I_S.OPTIMIZER_TRACE by another user than the connected user
   is restricted: @see fill_optimizer_trace_info().
*/
void opt_trace_disable_if_no_security_context_access(THD *thd);

void opt_trace_disable_if_no_tables_access(THD *thd, TABLE_LIST *tbl);

/**
   If tracing is on, checks additional privileges for a view, to make sure
   that the user has the right to do SHOW CREATE VIEW. For that:
   - this function checks SHOW VIEW
   - SELECT is tested in opt_trace_disable_if_no_tables_access()
   - SELECT + SHOW VIEW is sufficient for SHOW CREATE VIEW.
   We also check underlying tables.
   If a privilege is missing, notifies the trace system.
   This function should be called when the view's underlying tables have not
   yet been merged.

   @param thd               THD context
   @param view              view to check
   @param underlying_tables underlying tables/views of 'view'
 */

void opt_trace_disable_if_no_view_access(THD *thd, TABLE_LIST *view,
                                         TABLE_LIST *underlying_tables);

/**
  If tracing is on, checks additional privileges on a stored routine, to make
  sure that the user has the right to do SHOW CREATE PROCEDURE/FUNCTION. For
  that, we use the same checks as in those SHOW commands.
  If a privilege is missing, notifies the trace system.

  This function is not redundant with
  opt_trace_disable_if_no_security_context_access().
  Indeed, for a SQL SECURITY INVOKER routine, there is no context change, but
  we must still verify that the invoker can do SHOW CREATE.

  For triggers, see note in sp_head::execute_trigger().

  @param thd
  @param sp  routine to check
 */
void opt_trace_disable_if_no_stored_proc_func_access(THD *thd, sp_head *sp);

/**
   Fills information_schema.OPTIMIZER_TRACE with rows (one per trace)
   @retval 0 ok
   @retval 1 error
*/
int fill_optimizer_trace_info(THD *thd, TABLE_LIST *tables, Item *);

#define OPT_TRACE_TRANSFORM(thd, object_level0, object_level1, \
                            select_number, from, to)             \
  Json_writer_object object_level0(thd);                         \
  Json_writer_object object_level1(thd, "transformation");       \
  object_level1.add_select_number(select_number).add("from", from).add("to", to);

#define OPT_TRACE_VIEWS_TRANSFORM(thd, object_level0, object_level1, \
                                  derived, name, select_number, algorithm) \
    Json_writer_object trace_wrapper(thd);              \
    Json_writer_object trace_derived(thd, derived);     \
    trace_derived.add("table", name).add_select_number(select_number)  \
                 .add("algorithm", algorithm);
#endif
server/private/thr_alarm.h000064400000005564150400264010011650 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

   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 */

/* Prototypes when using thr_alarm library functions */

#ifndef _thr_alarm_h
#define _thr_alarm_h
#ifdef	__cplusplus
extern "C" {
#endif

#ifndef USE_ALARM_THREAD
#define USE_ONE_SIGNAL_HAND		/* One must call process_alarm */
#endif
#ifdef HAVE_rts_threads
#undef USE_ONE_SIGNAL_HAND
#define USE_ALARM_THREAD
#define THR_SERVER_ALARM SIGUSR1
#else
#define THR_SERVER_ALARM SIGALRM
#endif

typedef struct st_alarm_info
{
  time_t next_alarm_time;
  uint active_alarms;
  uint max_used_alarms;
} ALARM_INFO;

void thr_alarm_info(ALARM_INFO *info);
extern my_bool my_disable_thr_alarm;

#ifdef _WIN32
#define DONT_USE_THR_ALARM
#endif
#if defined(DONT_USE_THR_ALARM)

#define USE_ALARM_THREAD
#undef USE_ONE_SIGNAL_HAND

typedef my_bool thr_alarm_t;
typedef my_bool ALARM;

#define thr_alarm_init(A) (*(A))=0
#define thr_alarm_in_use(A) (*(A) != 0)
#define thr_end_alarm(A)
#define thr_alarm(A,B,C) ((*(A)=1)-1)
/* The following should maybe be (*(A)) */
#define thr_got_alarm(A) 0
#define init_thr_alarm(A)
#define thr_alarm_kill(A)
#define resize_thr_alarm(N)
#define end_thr_alarm(A)

#else
#if defined(_WIN32)
typedef struct st_thr_alarm_entry
{
  UINT_PTR crono;
} thr_alarm_entry;

#else /* System with posix threads */

typedef int thr_alarm_entry;

#define thr_got_alarm(thr_alarm) (**(thr_alarm))

#endif /* _WIN32 */

typedef thr_alarm_entry* thr_alarm_t;

typedef struct st_alarm {
  time_t expire_time;
  thr_alarm_entry alarmed;		/* set when alarm is due */
  pthread_t thread;
  my_thread_id thread_id;
  uint index_in_queue;
  my_bool malloced;
} ALARM;

extern uint thr_client_alarm;
extern pthread_t alarm_thread;

#define thr_alarm_init(A) (*(A))=0
#define thr_alarm_in_use(A) (*(A)!= 0)
void init_thr_alarm(uint max_alarm);
void resize_thr_alarm(uint max_alarms);
my_bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff);
void thr_alarm_kill(my_thread_id thread_id);
void thr_end_alarm(thr_alarm_t *alarmed);
void end_thr_alarm(my_bool free_structures);
sig_handler process_alarm(int);
#ifndef thr_got_alarm
my_bool thr_got_alarm(thr_alarm_t *alrm);
#endif


#endif /* DONT_USE_THR_ALARM */

#ifdef	__cplusplus
}
#endif /* __cplusplus */
#endif /* _thr_alarm_h */
server/private/create_tmp_table.h000064400000005370150400264010013164 0ustar00#ifndef CREATE_TMP_TABLE_INCLUDED
#define CREATE_TMP_TABLE_INCLUDED

/* Copyright (c) 2021, 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 */


/*
  Class for creating internal tempory tables in sql_select.cc
*/

class Create_tmp_table: public Data_type_statistics
{
protected:
  // The following members are initialized only in start()
  Field **m_from_field, **m_default_field;
  KEY_PART_INFO *m_key_part_info;
  uchar	*m_group_buff, *m_bitmaps;
  // The following members are initialized in ctor
  uint  m_alloced_field_count;
  bool  m_using_unique_constraint;
  uint m_temp_pool_slot;
  ORDER *m_group;
  bool m_distinct;
  bool m_save_sum_fields;
  bool m_with_cycle;
  ulonglong m_select_options;
  ha_rows m_rows_limit;
  uint m_group_null_items;

  // counter for distinct/other fields
  uint m_field_count[2];
  // counter for distinct/other fields which can be NULL
  uint m_null_count[2];
  // counter for distinct/other  blob fields
  uint m_blobs_count[2];
  // counter for "tails" of bit fields which do not fit in a byte
  uint m_uneven_bit[2];

public:
  enum counter {distinct, other};
  /*
    shows which field we are processing: distinct/other (set in processing
    cycles)
  */
  counter current_counter;
  Create_tmp_table(ORDER *group, bool distinct, bool save_sum_fields,
                   ulonglong select_options, ha_rows rows_limit);
  virtual ~Create_tmp_table() {}
  virtual bool choose_engine(THD *thd, TABLE *table, TMP_TABLE_PARAM *param);
  void add_field(TABLE *table, Field *field, uint fieldnr,
                 bool force_not_null_cols);
  TABLE *start(THD *thd,
               TMP_TABLE_PARAM *param,
               const LEX_CSTRING *table_alias);
  bool add_fields(THD *thd, TABLE *table,
                  TMP_TABLE_PARAM *param, List<Item> &fields);

  bool add_schema_fields(THD *thd, TABLE *table,
                         TMP_TABLE_PARAM *param,
                         const ST_SCHEMA_TABLE &schema_table);

  bool finalize(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
                bool do_not_open, bool keep_row_order);
  void cleanup_on_failure(THD *thd, TABLE *table);
};

#endif /* CREATE_TMP_TABLE_INCLUDED */
server/private/xa.h000064400000003465150400264010010305 0ustar00#ifndef XA_INCLUDED
#define XA_INCLUDED
/*
   Copyright (c) 2000, 2016, Oracle and/or its affiliates.
   Copyright (c) 2009, 2019, 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 Street, Fifth Floor, Boston, MA  02110-1301, USA
*/

class XID_cache_element;
enum xa_states
{
  XA_ACTIVE= 0,
  XA_IDLE,
  XA_PREPARED,
  XA_ROLLBACK_ONLY,
  XA_NO_STATE
};

struct XID_STATE {
  XID_cache_element *xid_cache_element;

  bool check_has_uncommitted_xa() const;
  bool is_explicit_XA() const { return xid_cache_element != 0; }
  void set_error(uint error);
  void set_rollback_only();
  void er_xaer_rmfail() const;
  XID *get_xid() const;
  enum xa_states get_state_code() const;
};

void xid_cache_init(void);
void xid_cache_free(void);
bool xid_cache_insert(XID *xid);
bool xid_cache_insert(THD *thd, XID_STATE *xid_state, XID *xid);
void xid_cache_delete(THD *thd, XID_STATE *xid_state);

bool trans_xa_start(THD *thd);
bool trans_xa_end(THD *thd);
bool trans_xa_prepare(THD *thd);
bool trans_xa_commit(THD *thd);
bool trans_xa_rollback(THD *thd);
bool trans_xa_detach(THD *thd);
bool mysql_xa_recover(THD *thd);

void xa_recover_get_fields(THD *thd, List<Item> *field_list,
                           my_hash_walk_action *action);

#endif /* XA_INCLUDED */
server/private/sql_admin.h000064400000005543150400264010011643 0ustar00/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_TABLE_MAINTENANCE_H
#define SQL_TABLE_MAINTENANCE_H

/* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */
#define SQL_ADMIN_MSG_TEXT_SIZE (128 * 1024)

bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
                              const LEX_CSTRING *key_cache_name);
bool mysql_preload_keys(THD* thd, TABLE_LIST* table_list);
int reassign_keycache_tables(THD* thd, KEY_CACHE *src_cache,
                             KEY_CACHE *dst_cache);
void fill_check_table_metadata_fields(THD *thd, List<Item>* fields);
/**
  Sql_cmd_analyze_table represents the ANALYZE TABLE statement.
*/
class Sql_cmd_analyze_table : public Sql_cmd
{
public:
  /**
    Constructor, used to represent a ANALYZE TABLE statement.
  */
  Sql_cmd_analyze_table() = default;

  ~Sql_cmd_analyze_table() = default;

  bool execute(THD *thd) override;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ANALYZE;
  }
};



/**
  Sql_cmd_check_table represents the CHECK TABLE statement.
*/
class Sql_cmd_check_table : public Sql_cmd
{
public:
  /**
    Constructor, used to represent a CHECK TABLE statement.
  */
  Sql_cmd_check_table() = default;

  ~Sql_cmd_check_table() = default;

  bool execute(THD *thd) override;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_CHECK;
  }
};


/**
  Sql_cmd_optimize_table represents the OPTIMIZE TABLE statement.
*/
class Sql_cmd_optimize_table : public Sql_cmd
{
public:
  /**
    Constructor, used to represent a OPTIMIZE TABLE statement.
  */
  Sql_cmd_optimize_table() = default;

  ~Sql_cmd_optimize_table() = default;

  bool execute(THD *thd) override;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_OPTIMIZE;
  }
};



/**
  Sql_cmd_repair_table represents the REPAIR TABLE statement.
*/
class Sql_cmd_repair_table : public Sql_cmd
{
public:
  /**
    Constructor, used to represent a REPAIR TABLE statement.
  */
  Sql_cmd_repair_table() = default;

  ~Sql_cmd_repair_table() = default;

  bool execute(THD *thd) override;

  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_REPAIR;
  }
};

#endif
server/private/log_event_data_type.h000064400000003542150400264010013705 0ustar00/* Copyright (c) 2024, 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 */

#ifndef LOG_EVENT_DATA_TYPE_H
#define LOG_EVENT_DATA_TYPE_H

class Log_event_data_type
{
public:

  enum {
    CHUNK_SIGNED= 0,
    CHUNK_UNSIGNED= 1,
    CHUNK_DATA_TYPE_NAME= 2
  };

protected:
  LEX_CSTRING m_data_type_name;
  Item_result m_type;
  uint m_charset_number;
  bool m_is_unsigned;

public:

  Log_event_data_type()
   :m_data_type_name({NULL,0}),
    m_type(STRING_RESULT),
    m_charset_number(my_charset_bin.number),
    m_is_unsigned(false)
  { }

  Log_event_data_type(const LEX_CSTRING &data_type_name_arg,
                      Item_result type_arg,
                      uint charset_number_arg,
                      bool is_unsigned_arg)
   :m_data_type_name(data_type_name_arg),
    m_type(type_arg),
    m_charset_number(charset_number_arg),
    m_is_unsigned(is_unsigned_arg)
  { }

  const LEX_CSTRING & data_type_name() const
  {
    return m_data_type_name;
  }
  Item_result type() const
  {
    return m_type;
  }
  uint charset_number() const
  {
    return m_charset_number;
  }
  bool is_unsigned() const
  {
    return m_is_unsigned;
  }

  bool unpack_optional_attributes(const char *str, const char *end);
};

#endif // LOG_EVENT_DATA_TYPE_H
server/private/wsrep_server_service.h000064400000007057150400264010014144 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

#ifndef WSREP_SERVER_SERVICE_H
#define WSREP_SERVER_SERVICE_H

/* wsrep-lib */
#include "wsrep/server_service.hpp"
#include "wsrep/exception.hpp" // not_impemented_error(), remove when finished
#include "wsrep/storage_service.hpp"

class Wsrep_server_state;


/* wsrep::server_service interface implementation */
class Wsrep_server_service : public wsrep::server_service
{
public:
  Wsrep_server_service(Wsrep_server_state& server_state)
    : m_server_state(server_state)
  { }

  wsrep::storage_service* storage_service(wsrep::client_service&) override;

  wsrep::storage_service* storage_service(wsrep::high_priority_service&) override;

  void release_storage_service(wsrep::storage_service*) override;

  wsrep::high_priority_service*
  streaming_applier_service(wsrep::client_service&) override;

  wsrep::high_priority_service*
  streaming_applier_service(wsrep::high_priority_service&) override;

  void release_high_priority_service(wsrep::high_priority_service*) override;

  void background_rollback(wsrep::unique_lock<wsrep::mutex> &,
                           wsrep::client_state &) override;

  void bootstrap() override;
  void log_message(enum wsrep::log::level, const char*) override;

  void log_dummy_write_set(wsrep::client_state&, const wsrep::ws_meta&) override
  { throw wsrep::not_implemented_error(); }

  void log_view(wsrep::high_priority_service*, const wsrep::view&) override;

  void recover_streaming_appliers(wsrep::client_service&) override;
  void recover_streaming_appliers(wsrep::high_priority_service&) override;
  wsrep::view get_view(wsrep::client_service&, const wsrep::id& own_id) override;

  wsrep::gtid get_position(wsrep::client_service&) override;
  void set_position(wsrep::client_service&, const wsrep::gtid&) override;

  void log_state_change(enum wsrep::server_state::state,
                        enum wsrep::server_state::state) override;

  bool sst_before_init() const override;

  std::string sst_request() override;
  int start_sst(const std::string&, const wsrep::gtid&, bool) override;

  int wait_committing_transactions(int) override;

  void debug_sync(const char*) override;
private:
  Wsrep_server_state& m_server_state;
};

/**
   Helper method to create new streaming applier.

   @param orig_thd Original thd context to copy operation context from.
   @param ctx Context string for debug logging.
 */
class Wsrep_applier_service;
Wsrep_applier_service*
wsrep_create_streaming_applier(THD *orig_thd, const char *ctx);

/**
   Helper method to create new storage service.

   @param orig_thd Original thd context to copy operation context from.
   @param ctx Context string for debug logging.
*/
class Wsrep_storage_service;
Wsrep_storage_service*
wsrep_create_storage_service(THD *orig_thd, const char *ctx);

/**
   Suppress all error logging from wsrep/Galera library.
 */
void wsrep_suppress_error_logging();
#endif /* WSREP_SERVER_SERVICE */
server/private/source_revision.h000064400000000103150400264010013075 0ustar00#define SOURCE_REVISION "19644f6821d59ecca0f9b1f44fadb3b887061965"
server/private/sql_db.h000064400000004610150400264010011132 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_DB_INCLUDED
#define SQL_DB_INCLUDED

#include "hash.h"                               /* HASH */

class THD;

int mysql_create_db(THD *thd, const LEX_CSTRING *db, DDL_options_st options,
                    const Schema_specification_st *create);
bool mysql_alter_db(THD *thd, const LEX_CSTRING *db,
                    const Schema_specification_st *create);
bool mysql_rm_db(THD *thd, const LEX_CSTRING *db, bool if_exists);
bool mysql_upgrade_db(THD *thd, const LEX_CSTRING *old_db);
uint mysql_change_db(THD *thd, const LEX_CSTRING *new_db_name,
                     bool force_switch);

bool mysql_opt_change_db(THD *thd,
                         const LEX_CSTRING *new_db_name,
                         LEX_STRING *saved_db_name,
                         bool force_switch,
                         bool *cur_db_changed);
bool my_dboptions_cache_init(void);
void my_dboptions_cache_free(void);
bool check_db_dir_existence(const char *db_name);
bool load_db_opt(THD *thd, const char *path, Schema_specification_st *create);
bool load_db_opt_by_name(THD *thd, const char *db_name,
                         Schema_specification_st *db_create_info);
CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
bool my_dbopt_init(void);
void my_dbopt_cleanup(void);

const char *normalize_db_name(const char *db, char *buffer,
                              size_t buffer_size);

void drop_database_objects(THD *thd, const LEX_CSTRING *path,
                           const LEX_CSTRING *db,
                           bool rm_mysql_schema);
my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error);
#define MY_DB_OPT_FILE "db.opt"

#endif /* SQL_DB_INCLUDED */
server/private/event_db_repository.h000064400000007100150400264010013750 0ustar00#ifndef _EVENT_DB_REPOSITORY_H_
#define _EVENT_DB_REPOSITORY_H_
/* Copyright (c) 2006, 2011, Oracle and/or its affiliates.

   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
*/

/**
  @addtogroup Event_Scheduler
  @{

  @file event_db_repository.h

  Data Dictionary related operations of Event Scheduler.

  This is a private header file of Events module. Please do not include it
  directly. All public declarations of Events module should be stored in
  events.h and event_data_objects.h.
*/

enum enum_events_table_field
{
  ET_FIELD_DB = 0, 
  ET_FIELD_NAME,
  ET_FIELD_BODY,
  ET_FIELD_DEFINER,
  ET_FIELD_EXECUTE_AT,
  ET_FIELD_INTERVAL_EXPR,
  ET_FIELD_TRANSIENT_INTERVAL,
  ET_FIELD_CREATED,
  ET_FIELD_MODIFIED,
  ET_FIELD_LAST_EXECUTED,
  ET_FIELD_STARTS,
  ET_FIELD_ENDS,
  ET_FIELD_STATUS,
  ET_FIELD_ON_COMPLETION,
  ET_FIELD_SQL_MODE,
  ET_FIELD_COMMENT,
  ET_FIELD_ORIGINATOR,
  ET_FIELD_TIME_ZONE,
  ET_FIELD_CHARACTER_SET_CLIENT,
  ET_FIELD_COLLATION_CONNECTION,
  ET_FIELD_DB_COLLATION,
  ET_FIELD_BODY_UTF8,
  ET_FIELD_COUNT /* a cool trick to count the number of fields :) */
};


int
events_table_index_read_for_db(THD *thd, TABLE *schema_table,
                               TABLE *event_table);

int
events_table_scan_all(THD *thd, TABLE *schema_table, TABLE *event_table);


class Event_basic;
class Event_parse_data;

class Event_db_repository
{
public:
  Event_db_repository() = default;

  bool
  create_event(THD *thd, Event_parse_data *parse_data,
               bool *event_already_exists);
  bool
  update_event(THD *thd, Event_parse_data *parse_data, LEX_CSTRING *new_dbname,
               LEX_CSTRING *new_name);

  bool
  drop_event(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *name,
             bool drop_if_exists);

  void
  drop_schema_events(THD *thd, const LEX_CSTRING *schema);

  bool
  find_named_event(const LEX_CSTRING *db, const LEX_CSTRING *name,
                   TABLE *table);

  bool
  load_named_event(THD *thd, const LEX_CSTRING *dbname,
                   const LEX_CSTRING *name,
                   Event_basic *et);

  static bool
  open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table);

  bool
  fill_schema_events(THD *thd, TABLE_LIST *tables, const char *db);

  bool
  update_timing_fields_for_event(THD *thd,
                                 const LEX_CSTRING *event_db_name,
                                 const LEX_CSTRING *event_name,
                                 my_time_t last_executed,
                                 ulonglong status);
public:
  static bool
  check_system_tables(THD *thd);
private:
  bool
  index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, TABLE *event_table,
                            const char *db);

  bool
  table_scan_all_for_i_s(THD *thd, TABLE *schema_table, TABLE *event_table);

private:
  /* Prevent use of these */
  Event_db_repository(const Event_db_repository &);
  void operator=(Event_db_repository &);
};

/**
  @} (End of group Event_Scheduler)
*/
#endif /* _EVENT_DB_REPOSITORY_H_ */
server/private/event_data_objects.h000064400000010133150400264010013506 0ustar00#ifndef _EVENT_DATA_OBJECTS_H_
#define _EVENT_DATA_OBJECTS_H_
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @addtogroup Event_Scheduler
  @{

  @file event_data_objects.h
*/

#include "event_parse_data.h"
#include "thr_lock.h"                           /* thr_lock_type */

class Field;
class THD;
class Time_zone;
struct TABLE;

void init_scheduler_psi_keys(void);

class Event_queue_element_for_exec
{
public:
  Event_queue_element_for_exec() : dbname{nullptr, 0}, name{nullptr, 0} {}
  ~Event_queue_element_for_exec();

  bool
  init(const LEX_CSTRING &dbname, const LEX_CSTRING &name);

  LEX_CSTRING dbname;
  LEX_CSTRING name;
  bool dropped;
  THD *thd;

private:
  /* Prevent use of these */
  Event_queue_element_for_exec(const Event_queue_element_for_exec &);
  void operator=(Event_queue_element_for_exec &);
#ifdef HAVE_PSI_INTERFACE
public:
  PSI_statement_info* get_psi_info()
  {
    return & psi_info;
  }

  static PSI_statement_info psi_info;
#endif
};


class Event_basic
{
protected:
  MEM_ROOT mem_root;

public:

  LEX_CSTRING dbname;
  LEX_CSTRING name;
  LEX_CSTRING definer;// combination of user and host

  Time_zone *time_zone;

  Event_basic();
  virtual ~Event_basic();

  virtual bool
  load_from_row(THD *thd, TABLE *table) = 0;

protected:
  bool
  load_string_fields(Field **fields, ...);

  bool
  load_time_zone(THD *thd, const LEX_CSTRING *tz_name);
};



class Event_queue_element : public Event_basic
{
public:
  int on_completion;
  int status;
  uint32 originator;

  my_time_t last_executed;
  my_time_t execute_at;
  my_time_t starts;
  my_time_t ends;
  bool starts_null;
  bool ends_null;
  bool execute_at_null;

  longlong expression;
  interval_type interval;

  bool dropped;

  uint execution_count;

  Event_queue_element();
  virtual ~Event_queue_element();

  virtual bool
  load_from_row(THD *thd, TABLE *table) override;

  bool
  compute_next_execution_time();

  void
  mark_last_executed(THD *thd);
};


class Event_timed : public Event_queue_element
{
  Event_timed(const Event_timed &);	/* Prevent use of these */
  void operator=(Event_timed &);

public:
  LEX_CSTRING body;

  LEX_CSTRING definer_user;
  LEX_CSTRING definer_host;

  LEX_CSTRING comment;

  ulonglong created;
  ulonglong modified;

  sql_mode_t sql_mode;

  class Stored_program_creation_ctx *creation_ctx;
  LEX_CSTRING body_utf8;

  Event_timed();
  virtual ~Event_timed();

  void
  init();

  virtual bool
  load_from_row(THD *thd, TABLE *table) override;

  int
  get_create_event(THD *thd, String *buf);
};


class Event_job_data : public Event_basic
{
public:
  LEX_CSTRING body;
  LEX_CSTRING definer_user;
  LEX_CSTRING definer_host;

  sql_mode_t sql_mode;

  class Stored_program_creation_ctx *creation_ctx;

  Event_job_data();

  virtual bool
  load_from_row(THD *thd, TABLE *table) override;

  bool
  execute(THD *thd, bool drop);
private:
  bool
  construct_sp_sql(THD *thd, String *sp_sql);
  bool
  construct_drop_event_sql(THD *thd, String *sp_sql);

  Event_job_data(const Event_job_data &);       /* Prevent use of these */
  void operator=(Event_job_data &);
};


/* Compares only the schema part of the identifier */
bool
event_basic_db_equal(const LEX_CSTRING *db, Event_basic *et);

/* Compares the whole identifier*/
bool
event_basic_identifier_equal(const LEX_CSTRING *db, const LEX_CSTRING *name,
                             Event_basic *b);

/**
  @} (End of group Event_Scheduler)
*/

#endif /* _EVENT_DATA_OBJECTS_H_ */
server/private/wsrep_on.h000064400000003266150400264010011530 0ustar00/* Copyright 2022 Codership Oy <http://www.codership.com>

   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 Street, Fifth Floor, Boston, MA 02111-1301 USA */

#ifndef WSREP_ON_H
#define WSREP_ON_H

#ifdef WITH_WSREP

extern bool WSREP_ON_;
extern bool WSREP_PROVIDER_EXISTS_;
extern my_bool wsrep_emulate_bin_log;
extern ulong wsrep_forced_binlog_format;

#define WSREP_ON unlikely(WSREP_ON_)

/* use xxxxxx_NNULL macros when thd pointer is guaranteed to be non-null to
 * avoid compiler warnings (GCC 6 and later) */

#define WSREP_NNULL(thd) \
  (WSREP_PROVIDER_EXISTS_ && thd->variables.wsrep_on)

#define WSREP(thd) \
  (thd && WSREP_NNULL(thd))

#define WSREP_CLIENT_NNULL(thd) \
  (WSREP_NNULL(thd) && thd->wsrep_client_thread)

#define WSREP_CLIENT(thd) \
    (WSREP(thd) && thd->wsrep_client_thread)

#define WSREP_EMULATE_BINLOG_NNULL(thd) \
  (WSREP_NNULL(thd) && wsrep_emulate_bin_log)

#define WSREP_EMULATE_BINLOG(thd) \
  (WSREP(thd) && wsrep_emulate_bin_log)

#else

#define WSREP_ON false
#define WSREP(T)  (0)
#define WSREP_NNULL(T) (0)
#define WSREP_EMULATE_BINLOG(thd) (0)
#define WSREP_EMULATE_BINLOG_NNULL(thd) (0)

#endif
#endif
server/private/datadict.h000064400000003244150400264010011445 0ustar00#ifndef DATADICT_INCLUDED
#define DATADICT_INCLUDED
/* Copyright (c) 2010, Oracle and/or its affiliates.
   Copyright (c) 2017 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 "handler.h"

/*
  Data dictionary API.
*/

enum Table_type
{
  TABLE_TYPE_UNKNOWN,
  TABLE_TYPE_NORMAL,                            /* Normal table */
  TABLE_TYPE_SEQUENCE,
  TABLE_TYPE_VIEW
};

/*
  Take extra care when using dd_frm_type() - it only checks the .frm file,
  and it won't work for any engine that supports discovery.

  Prefer to use ha_table_exists() instead.
  To check whether it's an frm of a view, use dd_frm_is_view().
*/

enum Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
                            LEX_CSTRING *partition_engine_name,
                            LEX_CUSTRING *table_version);

static inline bool dd_frm_is_view(THD *thd, char *path)
{
  return dd_frm_type(thd, path, NULL, NULL, NULL) == TABLE_TYPE_VIEW;
}

bool dd_recreate_table(THD *thd, const char *db, const char *table_name);

#endif // DATADICT_INCLUDED
server/private/handle_connections_win.h000064400000001564150400264010014405 0ustar00/* Copyright (c) 2018 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 Street, Fifth Floor, Boston, MA  02110-1301, USA */

/**
  Handles incoming socket and pipe connections, on Windows.
  Creates new (THD) connections..
*/
extern void handle_connections_win();
extern void network_init_win();
server/private/sql_select.h000064400000255502150400264010012034 0ustar00#ifndef SQL_SELECT_INCLUDED
#define SQL_SELECT_INCLUDED

/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
   Copyright (c) 2008, 2022, 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 */

/**
  @file

  @brief
  classes to use when handling where clause
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#include "procedure.h"
#include "sql_array.h"                        /* Array */
#include "records.h"                          /* READ_RECORD */
#include "opt_range.h"                /* SQL_SELECT, QUICK_SELECT_I */
#include "filesort.h"

#include "cset_narrowing.h"

typedef struct st_join_table JOIN_TAB;
/* Values in optimize */
#define KEY_OPTIMIZE_EXISTS		1U
#define KEY_OPTIMIZE_REF_OR_NULL	2U
#define KEY_OPTIMIZE_EQ	                4U

inline uint get_hash_join_key_no() { return MAX_KEY; }

inline bool is_hash_join_key_no(uint key) { return key == MAX_KEY; }

typedef struct keyuse_t {
  TABLE *table;
  Item	*val;				/**< or value if no field */
  table_map used_tables;
  uint	key, keypart, optimize;
  key_part_map keypart_map;
  ha_rows      ref_table_rows;
  /**
    If true, the comparison this value was created from will not be
    satisfied if val has NULL 'value'.
  */
  bool null_rejecting;
  /*
    !NULL - This KEYUSE was created from an equality that was wrapped into
            an Item_func_trig_cond. This means the equality (and validity of 
            this KEYUSE element) can be turned on and off. The on/off state 
            is indicted by the pointed value:
              *cond_guard == TRUE <=> equality condition is on
              *cond_guard == FALSE <=> equality condition is off

    NULL  - Otherwise (the source equality can't be turned off)
  */
  bool *cond_guard;
  /*
     0..64    <=> This was created from semi-join IN-equality # sj_pred_no.
     MAX_UINT  Otherwise
  */
  uint         sj_pred_no;

  /*
    If this is NULL than KEYUSE is always enabled.
    Otherwise it points to the enabling flag for this keyuse (true <=> enabled)
  */
  bool *validity_ref;

  bool is_for_hash_join() { return is_hash_join_key_no(key); }
} KEYUSE;


struct KEYUSE_EXT: public KEYUSE
{
  /*
    This keyuse can be used only when the partial join being extended
    contains the tables from this table map
  */
  table_map needed_in_prefix;
  /* The enabling flag for keyuses usable for splitting */
  bool validity_var;
};

/// Used when finding key fields
struct KEY_FIELD {
  Field		*field;
  Item_bool_func *cond;
  Item		*val;			///< May be empty if diff constant
  uint		level;
  uint		optimize;
  bool		eq_func;
  /**
    If true, the condition this struct represents will not be satisfied
    when val IS NULL.
  */
  bool          null_rejecting;
  bool         *cond_guard; /* See KEYUSE::cond_guard */
  uint          sj_pred_no; /* See KEYUSE::sj_pred_no */
};


#define NO_KEYPART ((uint)(-1))

class store_key;

const int NO_REF_PART= uint(-1);

typedef struct st_table_ref
{
  bool		key_err;
  /** True if something was read into buffer in join_read_key.  */
  bool          has_record;
  uint          key_parts;                ///< num of ...
  uint          key_length;               ///< length of key_buff
  int           key;                      ///< key no
  uchar         *key_buff;                ///< value to look for with key
  uchar         *key_buff2;               ///< key_buff+key_length
  store_key     **key_copy;               //

  /*
    Bitmap of key parts which refer to constants. key_copy only has copiers for
    non-const key parts.
  */
  key_part_map  const_ref_part_map;

  Item          **items;                  ///< val()'s for each keypart
  /*  
    Array of pointers to trigger variables. Some/all of the pointers may be
    NULL.  The ref access can be used iff
    
      for each used key part i, (!cond_guards[i] || *cond_guards[i]) 

    This array is used by subquery code. The subquery code may inject
    triggered conditions, i.e. conditions that can be 'switched off'. A ref 
    access created from such condition is not valid when at least one of the 
    underlying conditions is switched off (see subquery code for more details)
  */
  bool          **cond_guards;
  /**
    (null_rejecting & (1<<i)) means the condition is '=' and no matching
    rows will be produced if items[i] IS NULL (see add_not_null_conds())
  */
  key_part_map  null_rejecting;
  table_map	depend_map;		  ///< Table depends on these tables.

  /* null byte position in the key_buf. Used for REF_OR_NULL optimization */
  uchar          *null_ref_key;
  /* 
    ref_or_null optimization: number of key part that alternates between
    the lookup value or NULL (there's only one such part). 
    If we're not using ref_or_null, the value is NO_REF_PART
  */
  uint           null_ref_part;

  /*
    The number of times the record associated with this key was used
    in the join.
  */
  ha_rows       use_count;

  /*
    TRUE <=> disable the "cache" as doing lookup with the same key value may
    produce different results (because of Index Condition Pushdown)

  */
  bool          disable_cache;

  /*
    If true, this ref access was constructed from equalities generated by
    LATERAL DERIVED (aka GROUP BY splitting) optimization
  */
  bool          uses_splitting;

  bool tmp_table_index_lookup_init(THD *thd, KEY *tmp_key, Item_iterator &it,
                                   bool value, uint skip= 0);
  bool is_access_triggered();
} TABLE_REF;


/*
  The structs which holds the join connections and join states
*/
enum join_type { JT_UNKNOWN,JT_SYSTEM,JT_CONST,JT_EQ_REF,JT_REF,JT_MAYBE_REF,
		 JT_ALL, JT_RANGE, JT_NEXT, JT_FT, JT_REF_OR_NULL,
		 JT_UNIQUE_SUBQUERY, JT_INDEX_SUBQUERY, JT_INDEX_MERGE,
                 JT_HASH, JT_HASH_RANGE, JT_HASH_NEXT, JT_HASH_INDEX_MERGE};

class JOIN;

enum enum_nested_loop_state
{
  NESTED_LOOP_KILLED= -2, NESTED_LOOP_ERROR= -1,
  NESTED_LOOP_OK= 0, NESTED_LOOP_NO_MORE_ROWS= 1,
  NESTED_LOOP_QUERY_LIMIT= 3, NESTED_LOOP_CURSOR_LIMIT= 4
};


/* Possible sj_strategy values */
enum sj_strategy_enum
{
  SJ_OPT_NONE=0,
  SJ_OPT_DUPS_WEEDOUT=1,
  SJ_OPT_LOOSE_SCAN  =2,
  SJ_OPT_FIRST_MATCH =3,
  SJ_OPT_MATERIALIZE =4,
  SJ_OPT_MATERIALIZE_SCAN=5
};

/* Values for JOIN_TAB::packed_info */
#define TAB_INFO_HAVE_VALUE 1U
#define TAB_INFO_USING_INDEX 2U
#define TAB_INFO_USING_WHERE 4U
#define TAB_INFO_FULL_SCAN_ON_NULL 8U

typedef enum_nested_loop_state
(*Next_select_func)(JOIN *, struct st_join_table *, bool);
Next_select_func setup_end_select_func(JOIN *join);
int rr_sequential(READ_RECORD *info);
int read_record_func_for_rr_and_unpack(READ_RECORD *info);
Item *remove_pushed_top_conjuncts(THD *thd, Item *cond);
Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond,
                                           COND_EQUAL **cond_eq,
                                           List<Item> &new_conds,
                                           Item::cond_result *cond_value);

#include "sql_explain.h"

/**************************************************************************************
 * New EXPLAIN structures END
 *************************************************************************************/

class JOIN_CACHE;
class SJ_TMP_TABLE;
class JOIN_TAB_RANGE;
class AGGR_OP;
class Filesort;
struct SplM_plan_info;
class SplM_opt_info;

typedef struct st_join_table {
  TABLE		*table;
  TABLE_LIST    *tab_list;
  KEYUSE	*keyuse;       /**< pointer to first used key */
  KEY           *hj_key;       /**< descriptor of the used best hash join key
                                    not supported by any index               */
  SQL_SELECT	*select;
  COND		*select_cond;
  COND          *on_precond;    /**< part of on condition to check before
                                     accessing the first inner table         */
  QUICK_SELECT_I *quick;
  /* 
    The value of select_cond before we've attempted to do Index Condition
    Pushdown. We may need to restore everything back if we first choose one
    index but then reconsider (see test_if_skip_sort_order() for such
    scenarios).
    NULL means no index condition pushdown was performed.
  */
  Item          *pre_idx_push_select_cond;
  /*
    Pointer to the associated ON expression. on_expr_ref=!NULL except for
    degenerate joins. 

    Optimization phase: *on_expr_ref!=NULL for tables that are the single
      tables on the inner side of the outer join (t1 LEFT JOIN t2 ON...)

    Execution phase: *on_expr_ref!=NULL for tables that are first inner tables
      within an outer join (which may have multiple tables)
  */
  Item	       **on_expr_ref;
  COND_EQUAL    *cond_equal;    /**< multiple equalities for the on expression */
  st_join_table *first_inner;   /**< first inner table for including outerjoin */
  bool           found;         /**< true after all matches or null complement */
  bool           not_null_compl;/**< true before null complement is added      */
  st_join_table *last_inner;    /**< last table table for embedding outer join */
  st_join_table *first_upper;  /**< first inner table for embedding outer join */
  st_join_table *first_unmatched; /**< used for optimization purposes only     */

  /*
    For join tabs that are inside an SJM bush: root of the bush
  */
  st_join_table *bush_root_tab;

  /* TRUE <=> This join_tab is inside an SJM bush and is the last leaf tab here */
  bool          last_leaf_in_bush;
  
  /*
    ptr  - this is a bush, and ptr points to description of child join_tab
           range
    NULL - this join tab has no bush children
  */
  JOIN_TAB_RANGE *bush_children;
  
  /* Special content for EXPLAIN 'Extra' column or NULL if none */
  enum explain_extra_tag info;
  
  Table_access_tracker *tracker;

  Table_access_tracker *jbuf_tracker;
  Time_and_counter_tracker *jbuf_unpack_tracker;
  Counter_tracker  *jbuf_loops_tracker;
  /* 
    Bitmap of TAB_INFO_* bits that encodes special line for EXPLAIN 'Extra'
    column, or 0 if there is no info.
  */
  uint          packed_info;

  //  READ_RECORD::Setup_func materialize_table;
  READ_RECORD::Setup_func read_first_record;
  Next_select_func next_select;
  READ_RECORD	read_record;
  /* 
    Currently the following two fields are used only for a [NOT] IN subquery
    if it is executed by an alternative full table scan when the left operand of
    the subquery predicate is evaluated to NULL.
  */  
  READ_RECORD::Setup_func save_read_first_record;/* to save read_first_record */
  READ_RECORD::Read_func save_read_record;/* to save read_record.read_record */
  double	worst_seeks;
  key_map	const_keys;			/**< Keys with constant part */
  key_map	checked_keys;			/**< Keys checked in find_best */
  key_map	needed_reg;
  key_map       keys;                           /**< all keys with can be used */

  /* Either #rows in the table or 1 for const table.  */
  ha_rows	records;
  /*
    Number of records that will be scanned (yes scanned, not returned) by the
    best 'independent' access method, i.e. table scan or QUICK_*_SELECT)
  */
  ha_rows       found_records;
  /*
    Cost of accessing the table using "ALL" or range/index_merge access
    method (but not 'index' for some reason), i.e. this matches method which
    E(#records) is in found_records.
  */
  double        read_time;
  
  /* Copy of POSITION::records_read, set by get_best_combination() */
  double        records_read;
  
  /* The selectivity of the conditions that can be pushed to the table */ 
  double        cond_selectivity;  
  
  /* Startup cost for execution */
  double        startup_cost;
    
  double        partial_join_cardinality;

  table_map	dependent,key_dependent;
  /*
     1 - use quick select
     2 - use "Range checked for each record"
  */
  uint		use_quick;
  /*
    Index to use. Note: this is valid only for 'index' access, but not range or
    ref access.
  */
  uint          index;
  uint		status;				///< Save status for cache
  uint		used_fields;
  ulong         used_fieldlength;
  ulong         max_used_fieldlength;
  uint          used_blobs;
  uint          used_null_fields;
  uint          used_uneven_bit_fields;
  enum join_type type;
  /* If first key part is used for any key in 'key_dependent' */
  bool          key_start_dependent;
  bool          cached_eq_ref_table,eq_ref_table;
  bool          shortcut_for_distinct;
  bool          sorted;
  /* 
    If it's not 0 the number stored this field indicates that the index
    scan has been chosen to access the table data and we expect to scan 
    this number of rows for the table.
  */ 
  ha_rows       limit; 
  TABLE_REF	ref;
  /* TRUE <=> condition pushdown supports other tables presence */
  bool          icp_other_tables_ok;
  /* 
    TRUE <=> condition pushed to the index has to be factored out of
    the condition pushed to the table
  */
  bool          idx_cond_fact_out;
  bool          use_join_cache;
  /* TRUE <=> it is prohibited to join this table using join buffer */
  bool          no_forced_join_cache;
  uint          used_join_cache_level;
  JOIN_CACHE	*cache;
  /*
    Index condition for BKA access join
  */
  Item          *cache_idx_cond;
  SQL_SELECT    *cache_select;
  AGGR_OP       *aggr;
  JOIN		*join;
  /*
    Embedding SJ-nest (may be not the direct parent), or NULL if none.
    This variable holds the result of table pullout.
  */
  TABLE_LIST    *emb_sj_nest;

  /* FirstMatch variables (final QEP) */
  struct st_join_table *first_sj_inner_tab;
  struct st_join_table *last_sj_inner_tab;

  /* Variables for semi-join duplicate elimination */
  SJ_TMP_TABLE  *flush_weedout_table;
  SJ_TMP_TABLE  *check_weed_out_table;
  /* for EXPLAIN only: */
  SJ_TMP_TABLE  *first_weedout_table;

  /**
    reference to saved plan and execution statistics
  */
  Explain_table_access *explain_plan;

  /*
    If set, means we should stop join enumeration after we've got the first
    match and return to the specified join tab. May point to
    join->join_tab[-1] which means stop join execution after the first
    match.
  */
  struct st_join_table  *do_firstmatch;
 
  /* 
     ptr  - We're doing a LooseScan, this join tab is the first (i.e. 
            "driving") join tab), and ptr points to the last join tab
            handled by the strategy. loosescan_match_tab->found_match
            should be checked to see if the current value group had a match.
     NULL - Not doing a loose scan on this join tab.
  */
  struct st_join_table *loosescan_match_tab;
  
  /* TRUE <=> we are inside LooseScan range */
  bool inside_loosescan_range;

  /* Buffer to save index tuple to be able to skip duplicates */
  uchar *loosescan_buf;
  
  /* 
    Index used by LooseScan (we store it here separately because ref access
    stores it in tab->ref.key, while range scan stores it in tab->index, etc)
  */
  uint loosescan_key;

  /* Length of key tuple (depends on #keyparts used) to store in the above */
  uint loosescan_key_len;

  /* Used by LooseScan. TRUE<=> there has been a matching record combination */
  bool found_match;
  
  /*
    Used by DuplicateElimination. tab->table->ref must have the rowid
    whenever we have a current record.
  */
  int  keep_current_rowid;

  /* NestedOuterJoins: Bitmap of nested joins this table is part of */
  nested_join_map embedding_map;

  /* Tmp table info */
  TMP_TABLE_PARAM *tmp_table_param;

  /* Sorting related info */
  Filesort *filesort;
  SORT_INFO *filesort_result;
  
  /*
    Non-NULL value means this join_tab must do window function computation
    before reading.
  */
  Window_funcs_computation* window_funcs_step;

  /**
    List of topmost expressions in the select list. The *next* JOIN_TAB
    in the plan should use it to obtain correct values. Same applicable to
    all_fields. These lists are needed because after tmp tables functions
    will be turned to fields. These variables are pointing to
    tmp_fields_list[123]. Valid only for tmp tables and the last non-tmp
    table in the query plan.
    @see JOIN::make_aggr_tables_info()
  */
  List<Item> *fields;
  /** List of all expressions in the select list */
  List<Item> *all_fields;
  /*
    Pointer to the ref array slice which to switch to before sending
    records. Valid only for tmp tables.
  */
  Ref_ptr_array *ref_array;

  /** Number of records saved in tmp table */
  ha_rows send_records;

  /** HAVING condition for checking prior saving a record into tmp table*/
  Item *having;

  /** TRUE <=> remove duplicates on this table. */
  bool distinct;

  /*
    Semi-join strategy to be used for this join table. This is a copy of
    POSITION::sj_strategy field. This field is set up by the
    fix_semijoin_strategies_for_picked_join_order.
  */
  enum sj_strategy_enum sj_strategy;

  uint n_sj_tables;

  bool preread_init_done;

  /* true <=> split optimization has been applied to this materialized table */
  bool is_split_derived;

  /*
    Bitmap of split materialized derived tables that can be filled just before
    this join table is to be joined. All parameters of the split derived tables
    belong to tables preceding this join table.
  */
  table_map split_derived_to_update;

  /*
    Cost info to the range filter used when joining this join table
    (Defined when the best join order has been already chosen)
  */
  Range_rowid_filter_cost_info *range_rowid_filter_info;
  /* Rowid filter to be used when joining this join table */
  Rowid_filter *rowid_filter;
  /* Becomes true just after the used range filter has been built / filled */
  bool is_rowid_filter_built;

  bool build_range_rowid_filter_if_needed();

  void cleanup();
  inline bool is_using_loose_index_scan()
  {
    const SQL_SELECT *sel= get_sql_select();
    return (sel && sel->quick &&
            (sel->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX));
  }
  bool is_using_agg_loose_index_scan ()
  {
    const SQL_SELECT *sel= get_sql_select();
    return (is_using_loose_index_scan() &&
            ((QUICK_GROUP_MIN_MAX_SELECT *)sel->quick)->is_agg_distinct());
  }
  const SQL_SELECT *get_sql_select()
  {
    return filesort ? filesort->select : select;
  }
  bool is_inner_table_of_semi_join_with_first_match()
  {
    return first_sj_inner_tab != NULL;
  }
  bool is_inner_table_of_semijoin()
  {
    return emb_sj_nest != NULL;
  }
  bool is_inner_table_of_outer_join()
  {
    return first_inner != NULL;
  }
  bool is_single_inner_of_semi_join_with_first_match()
  {
    return first_sj_inner_tab == this && last_sj_inner_tab == this;            
  }
  bool is_single_inner_of_outer_join()
  {
    return first_inner == this && first_inner->last_inner == this;
  }
  bool is_first_inner_for_outer_join()
  {
    return first_inner == this;
  }
  bool use_match_flag()
  {
    return is_first_inner_for_outer_join() || first_sj_inner_tab == this ; 
  }
  bool check_only_first_match()
  {
    return is_inner_table_of_semi_join_with_first_match() ||
           (is_inner_table_of_outer_join() &&
            table->reginfo.not_exists_optimize);
  }
  bool is_last_inner_table()
  {
    return (first_inner && first_inner->last_inner == this) ||
           last_sj_inner_tab == this;
  }
  /*
    Check whether the table belongs to a nest of inner tables of an
    outer join or to a nest of inner tables of a semi-join
  */
  bool is_nested_inner()
  {
    if (first_inner && 
        (first_inner != first_inner->last_inner || first_inner->first_upper))
      return TRUE;
    if (first_sj_inner_tab && first_sj_inner_tab != last_sj_inner_tab)
      return TRUE;
    return FALSE;
  }
  struct st_join_table *get_first_inner_table()
  {
    if (first_inner)
      return first_inner;
    return first_sj_inner_tab; 
  }
  void set_select_cond(COND *to, uint line)
  {
    DBUG_PRINT("info", ("select_cond changes %p -> %p at line %u tab %p",
                        select_cond, to, line, this));
    select_cond= to;
  }
  COND *set_cond(COND *new_cond)
  {
    COND *tmp_select_cond= select_cond;
    set_select_cond(new_cond, __LINE__);
    if (select)
      select->cond= new_cond;
    return tmp_select_cond;
  }
  void calc_used_field_length(bool max_fl);
  ulong get_used_fieldlength()
  {
    if (!used_fieldlength)
      calc_used_field_length(FALSE);
    return used_fieldlength;
  }
  ulong get_max_used_fieldlength()
  {
    if (!max_used_fieldlength)
      calc_used_field_length(TRUE);
    return max_used_fieldlength;
  }
  double get_partial_join_cardinality() { return partial_join_cardinality; }
  bool hash_join_is_possible();
  int make_scan_filter();
  bool is_ref_for_hash_join() { return is_hash_join_key_no(ref.key); }
  KEY *get_keyinfo_by_key_no(uint key) 
  {
    return (is_hash_join_key_no(key) ? hj_key : table->key_info+key);
  }
  double scan_time();
  ha_rows get_examined_rows();
  bool preread_init();

  bool pfs_batch_update(JOIN *join);

  bool is_sjm_nest() { return MY_TEST(bush_children); }
  
  /*
    If this join_tab reads a non-merged semi-join (also called jtbm), return
    the select's number.  Otherwise, return 0.
  */
  int get_non_merged_semijoin_select() const
  {
    Item_in_subselect *subq;
    if (table->pos_in_table_list && 
        (subq= table->pos_in_table_list->jtbm_subselect))
    {
      return subq->unit->first_select()->select_number;
    }
    return 0; /* Not a merged semi-join */
  }

  bool access_from_tables_is_allowed(table_map used_tables,
                                     table_map sjm_lookup_tables)
  {
    table_map used_sjm_lookup_tables= used_tables & sjm_lookup_tables;
    return !used_sjm_lookup_tables ||
           (emb_sj_nest && 
            !(used_sjm_lookup_tables & ~emb_sj_nest->sj_inner_tables));
  }

  bool keyuse_is_valid_for_access_in_chosen_plan(JOIN *join, KEYUSE *keyuse);

  void remove_redundant_bnl_scan_conds();

  bool save_explain_data(Explain_table_access *eta, table_map prefix_tables,
                         bool distinct, struct st_join_table *first_top_tab);

  bool use_order() const; ///< Use ordering provided by chosen index?
  bool sort_table();
  bool remove_duplicates();

  void partial_cleanup();
  void add_keyuses_for_splitting();
  SplM_plan_info *choose_best_splitting(uint idx,
                                        table_map remaining_tables,
                                        const POSITION *join_positions,
                                        table_map *spl_pd_boundary);
  bool fix_splitting(SplM_plan_info *spl_plan, table_map excluded_tables,
                     bool is_const_table);
} JOIN_TAB;


#include "sql_join_cache.h"

enum_nested_loop_state
sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
enum_nested_loop_state 
sub_select(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
enum_nested_loop_state
sub_select_postjoin_aggr(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);

enum_nested_loop_state
end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
	       bool end_of_records);
enum_nested_loop_state
end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
		bool end_of_records);


class Semi_join_strategy_picker
{
public:
  /* Called when starting to build a new join prefix */
  virtual void set_empty() = 0;

  /* 
    Update internal state after another table has been added to the join
    prefix
  */
  virtual void set_from_prev(POSITION *prev) = 0;
  
  virtual bool check_qep(JOIN *join,
                         uint idx,
                         table_map remaining_tables, 
                         const JOIN_TAB *new_join_tab,
                         double *record_count,
                         double *read_time,
                         table_map *handled_fanout,
                         sj_strategy_enum *strategy,
                         POSITION *loose_scan_pos) = 0;

  virtual void mark_used() = 0;

  virtual ~Semi_join_strategy_picker() = default;
};


/*
  Duplicate Weedout strategy optimization state
*/

class Duplicate_weedout_picker : public Semi_join_strategy_picker
{
  /* The first table that the strategy will need to handle */
  uint  first_dupsweedout_table;

  /*
    Tables that we will need to have in the prefix to do the weedout step
    (all inner and all outer that the involved semi-joins are correlated with)
  */
  table_map dupsweedout_tables;
  
  bool is_used;
public:
  void set_empty() override
  {
    dupsweedout_tables= 0;
    first_dupsweedout_table= MAX_TABLES;
    is_used= FALSE;
  }
  void set_from_prev(POSITION *prev) override;
  
  bool check_qep(JOIN *join,
                 uint idx,
                 table_map remaining_tables, 
                 const JOIN_TAB *new_join_tab,
                 double *record_count,
                 double *read_time,
                 table_map *handled_fanout,
                 sj_strategy_enum *stratey,
                 POSITION *loose_scan_pos) override;

  void mark_used() override { is_used= TRUE; }
  friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
};


class Firstmatch_picker : public Semi_join_strategy_picker
{
  /*
    Index of the first inner table that we intend to handle with this
    strategy
  */
  uint first_firstmatch_table;
  /*
    Tables that were not in the join prefix when we've started considering 
    FirstMatch strategy.
  */
  table_map first_firstmatch_rtbl;
  /* 
    Tables that need to be in the prefix before we can calculate the cost
    of using FirstMatch strategy.
   */
  table_map firstmatch_need_tables;

  bool is_used;

  bool in_firstmatch_prefix() { return (first_firstmatch_table != MAX_TABLES); }
  void invalidate_firstmatch_prefix() { first_firstmatch_table= MAX_TABLES; }
public:
  void set_empty() override
  {
    invalidate_firstmatch_prefix();
    is_used= FALSE;
  }

  void set_from_prev(POSITION *prev) override;
  bool check_qep(JOIN *join,
                 uint idx,
                 table_map remaining_tables, 
                 const JOIN_TAB *new_join_tab,
                 double *record_count,
                 double *read_time,
                 table_map *handled_fanout,
                 sj_strategy_enum *strategy,
                 POSITION *loose_scan_pos) override;

  void mark_used() override { is_used= TRUE; }
  friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
};


class LooseScan_picker : public Semi_join_strategy_picker
{
public:
  /* The first (i.e. driving) table we're doing loose scan for */
  uint        first_loosescan_table;
  /* 
     Tables that need to be in the prefix before we can calculate the cost
     of using LooseScan strategy.
  */
  table_map   loosescan_need_tables;

  /*
    keyno  -  Planning to do LooseScan on this key. If keyuse is NULL then 
              this is a full index scan, otherwise this is a ref+loosescan
              scan (and keyno matches the KEUSE's)
    MAX_KEY - Not doing a LooseScan
  */
  uint loosescan_key;  // final (one for strategy instance )
  uint loosescan_parts; /* Number of keyparts to be kept distinct */
  
  bool is_used;
  void set_empty() override
  {
    first_loosescan_table= MAX_TABLES; 
    is_used= FALSE;
  }

  void set_from_prev(POSITION *prev) override;
  bool check_qep(JOIN *join,
                 uint idx,
                 table_map remaining_tables, 
                 const JOIN_TAB *new_join_tab,
                 double *record_count,
                 double *read_time,
                 table_map *handled_fanout,
                 sj_strategy_enum *strategy,
                 POSITION *loose_scan_pos) override;
  void mark_used() override { is_used= TRUE; }

  friend class Loose_scan_opt;
  friend void best_access_path(JOIN      *join,
                               JOIN_TAB  *s,
                               table_map remaining_tables,
                               const POSITION *join_positions,
                               uint      idx,
                               bool      disable_jbuf,
                               double    record_count,
                               POSITION *pos,
                               POSITION *loose_scan_pos);
  friend bool get_best_combination(JOIN *join);
  friend int setup_semijoin_loosescan(JOIN *join);
  friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
};


class Sj_materialization_picker : public Semi_join_strategy_picker
{
  bool is_used;

  /* The last inner table (valid once we're after it) */
  uint      sjm_scan_last_inner;
  /*
    Tables that we need to have in the prefix to calculate the correct cost.
    Basically, we need all inner tables and outer tables mentioned in the
    semi-join's ON expression so we can correctly account for fanout.
  */
  table_map sjm_scan_need_tables;

public:
  void set_empty() override
  {
    sjm_scan_need_tables= 0;
    sjm_scan_last_inner= 0;
    is_used= FALSE;
  }
  void set_from_prev(POSITION *prev) override;
  bool check_qep(JOIN *join,
                 uint idx,
                 table_map remaining_tables, 
                 const JOIN_TAB *new_join_tab,
                 double *record_count,
                 double *read_time,
                 table_map *handled_fanout,
                 sj_strategy_enum *strategy,
                 POSITION *loose_scan_pos) override;
  void mark_used() override { is_used= TRUE; }

  friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
};


class Range_rowid_filter_cost_info;
class Rowid_filter;


/**
  Information about a position of table within a join order. Used in join
  optimization.
*/
class POSITION
{
public:
  /* The table that's put into join order */
  JOIN_TAB *table;

  /*
    The "fanout": number of output rows that will be produced (after
    pushed down selection condition is applied) per each row combination of
    previous tables.
  */
  double records_read;

  /* The selectivity of the pushed down conditions */
  double cond_selectivity;

  /* 
    Cost accessing the table in course of the entire complete join execution,
    i.e. cost of one access method use (e.g. 'range' or 'ref' scan ) times 
    number the access method will be invoked.
  */
  double read_time;

  double    prefix_record_count;

  /*
    NULL  -  'index' or 'range' or 'index_merge' or 'ALL' access is used.
    Other - [eq_]ref[_or_null] access is used. Pointer to {t.keypart1 = expr}
  */
  KEYUSE *key;

  /* Cardinality of current partial join ending with this position */
  double partial_join_cardinality;

  /* Info on splitting plan used at this position */
  SplM_plan_info *spl_plan;

  /*
    If spl_plan is NULL the value of spl_pd_boundary is 0. Otherwise
    spl_pd_boundary contains the bitmap of the table from the current
    partial join ending at this position that starts the sub-sequence of
    tables S from which no conditions are allowed to be used in the plan
    spl_plan for the split table joined at this position.
  */
  table_map spl_pd_boundary;

  /* Cost info for the range filter used at this position */
  Range_rowid_filter_cost_info *range_rowid_filter_info;

  /* If ref-based access is used: bitmap of tables this table depends on  */
  table_map ref_depend_map;

  /* tables that may help best_access_path() to find a better key */
  table_map key_dependent;
  /*
    Bitmap of semi-join inner tables that are in the join prefix and for
    which there's no provision for how to eliminate semi-join duplicates
    they produce.
  */
  table_map dups_producing_tables;

  table_map inner_tables_handled_with_other_sjs;

  Duplicate_weedout_picker  dups_weedout_picker;
  Firstmatch_picker         firstmatch_picker;
  LooseScan_picker          loosescan_picker;
  Sj_materialization_picker sjmat_picker;

  /* Cumulative cost and record count for the join prefix */
  Cost_estimate prefix_cost;

  /*
    Current optimization state: Semi-join strategy to be used for this
    and preceding join tables.

    Join optimizer sets this for the *last* join_tab in the
    duplicate-generating range. That is, in order to interpret this field,
    one needs to traverse join->[best_]positions array from right to left.
    When you see a join table with sj_strategy!= SJ_OPT_NONE, some other
    field (depending on the strategy) tells how many preceding positions
    this applies to. The values of covered_preceding_positions->sj_strategy
    must be ignored.
  */
  enum sj_strategy_enum sj_strategy;

  /* Type of join (EQ_REF, REF etc) */
  enum join_type type;
  /*
    Valid only after fix_semijoin_strategies_for_picked_join_order() call:
    if sj_strategy!=SJ_OPT_NONE, this is the number of subsequent tables that
    are covered by the specified semi-join strategy
  */
  uint n_sj_tables;

  /*
    TRUE <=> join buffering will be used. At the moment this is based on
    *very* imprecise guesses made in best_access_path().
  */
  bool use_join_buffer;
  POSITION();
};

typedef Bounds_checked_array<Item_null_result*> Item_null_array;

typedef struct st_rollup
{
  enum State { STATE_NONE, STATE_INITED, STATE_READY };
  State state;
  Item_null_array null_items;
  Ref_ptr_array *ref_pointer_arrays;
  List<Item> *fields;
} ROLLUP;


class JOIN_TAB_RANGE: public Sql_alloc
{
public:
  JOIN_TAB *start;
  JOIN_TAB *end;
};

class Pushdown_query;

/**
  @brief
    Class to perform postjoin aggregation operations

  @details
    The result records are obtained on the put_record() call.
    The aggrgation process is determined by the write_func, it could be:
      end_write          Simply store all records in tmp table.
      end_write_group    Perform grouping using join->group_fields,
                         records are expected to be sorted.
      end_update         Perform grouping using the key generated on tmp
                         table. Input records aren't expected to be sorted.
                         Tmp table uses the heap engine
      end_update_unique  Same as above, but the engine is myisam.

    Lazy table initialization is used - the table will be instantiated and
    rnd/index scan started on the first put_record() call.

*/

class AGGR_OP :public Sql_alloc
{
public:
  JOIN_TAB *join_tab;

  AGGR_OP(JOIN_TAB *tab) : join_tab(tab), write_func(NULL)
  {};

  enum_nested_loop_state put_record() { return put_record(false); };
  /*
    Send the result of operation further (to a next operation/client)
    This function is called after all records were put into tmp table.

    @return return one of enum_nested_loop_state values.
  */
  enum_nested_loop_state end_send();
  /** write_func setter */
  void set_write_func(Next_select_func new_write_func)
  {
    write_func= new_write_func;
  }

private:
  /** Write function that would be used for saving records in tmp table. */
  Next_select_func write_func;
  enum_nested_loop_state put_record(bool end_of_records);
  bool prepare_tmp_table();
};


class JOIN :public Sql_alloc
{
private:
  JOIN(const JOIN &rhs);                        /**< not implemented */
  JOIN& operator=(const JOIN &rhs);             /**< not implemented */

protected:

  /**
    The subset of the state of a JOIN that represents an optimized query
    execution plan. Allows saving/restoring different JOIN plans for the same
    query.
  */
  class Join_plan_state {
  public:
    DYNAMIC_ARRAY keyuse;        /* Copy of the JOIN::keyuse array. */
    POSITION *best_positions;    /* Copy of JOIN::best_positions */
    /* Copies of the JOIN_TAB::keyuse pointers for each JOIN_TAB. */
    KEYUSE **join_tab_keyuse;
    /* Copies of JOIN_TAB::checked_keys for each JOIN_TAB. */
    key_map *join_tab_checked_keys;
    SJ_MATERIALIZATION_INFO **sj_mat_info;
    my_bool error;
  public:
    Join_plan_state(uint tables) : error(0)
    {   
      keyuse.elements= 0;
      keyuse.buffer= NULL;
      keyuse.malloc_flags= 0;
      best_positions= 0;                        /* To detect errors */
      error= my_multi_malloc(PSI_INSTRUMENT_ME, MYF(MY_WME),
                             &best_positions,
                             sizeof(*best_positions) * (tables + 1),
                             &join_tab_keyuse,
                             sizeof(*join_tab_keyuse) * tables,
                             &join_tab_checked_keys,
                             sizeof(*join_tab_checked_keys) * tables,
                             &sj_mat_info,
                             sizeof(sj_mat_info) * tables,
                             NullS) == 0;
    }
    Join_plan_state(JOIN *join);
    ~Join_plan_state()
    {
      delete_dynamic(&keyuse);
      my_free(best_positions);
    }
  };

  /* Results of reoptimizing a JOIN via JOIN::reoptimize(). */
  enum enum_reopt_result {
    REOPT_NEW_PLAN, /* there is a new reoptimized plan */
    REOPT_OLD_PLAN, /* no new improved plan can be found, use the old one */
    REOPT_ERROR,    /* an irrecovarable error occurred during reoptimization */
    REOPT_NONE      /* not yet reoptimized */
  };

  /* Support for plan reoptimization with rewritten conditions. */
  enum_reopt_result reoptimize(Item *added_where, table_map join_tables,
                               Join_plan_state *save_to);
  /* Choose a subquery plan for a table-less subquery. */
  bool choose_tableless_subquery_plan();
  void handle_implicit_grouping_with_window_funcs();

public:
  void save_query_plan(Join_plan_state *save_to);
  void reset_query_plan();
  void restore_query_plan(Join_plan_state *restore_from);

public:
  JOIN_TAB *join_tab, **best_ref;

  /* List of fields that aren't under an aggregate function */
  List<Item_field> non_agg_fields;

  JOIN_TAB **map2table;    ///< mapping between table indexes and JOIN_TABs
  List<JOIN_TAB_RANGE> join_tab_ranges;
  
  /*
    Base tables participating in the join. After join optimization is done, the
    tables are stored in the join order (but the only really important part is 
    that const tables are first).
  */
  TABLE    **table;
  /**
    The table which has an index that allows to produce the requried ordering.
    A special value of 0x1 means that the ordering will be produced by
    passing 1st non-const table to filesort(). NULL means no such table exists.
  */
  TABLE    *sort_by_table;

  /*
    If true, there is ORDER BY x LIMIT n clause and for certain join orders, it
    is possible to short-cut the join execution, i.e. stop it as soon as n
    output rows were produced. See join_limit_shortcut_is_applicable().
  */
  bool    limit_shortcut_applicable;

  /*
    Used during join optimization: if true, we're building a join order that
    will short-cut join execution as soon as #LIMIT rows are produced.
  */
  bool    limit_optimization_mode;

  /* 
    Number of tables in the join. 
    (In MySQL, it is named 'tables' and is also the number of elements in 
     join->join_tab array. In MariaDB, the latter is not true, so we've renamed
     the variable)
  */
  uint	   table_count;
  uint     outer_tables;  /**< Number of tables that are not inside semijoin */
  uint     const_tables;
  /* 
    Number of tables in the top join_tab array. Normally this matches
    (join_tab_ranges.head()->end - join_tab_ranges.head()->start). 
    
    We keep it here so that it is saved/restored with JOIN::restore_tmp.
  */
  uint     top_join_tab_count;
  uint     aggr_tables;     ///< Number of post-join tmp tables 
  uint	   send_group_parts;
  /*
    This represents the number of items in ORDER BY *after* removing
    all const items. This is computed before other optimizations take place,
    such as removal of ORDER BY when it is a prefix of GROUP BY, for example:
    GROUP BY a, b ORDER BY a

    This is used when deciding to send rows, by examining the correct number
    of items in the group_fields list when ORDER BY was previously eliminated.
  */
  uint with_ties_order_count;
  /*
    True if the query has GROUP BY.
    (that is, if group_by != NULL. when DISTINCT is converted into GROUP BY, it
     will set this, too. It is not clear why we need a separate var from 
     group_list)
  */
  bool	   group;
  bool     need_distinct;

  /**
    Indicates that grouping will be performed on the result set during
    query execution. This field belongs to query execution.

    If 'sort_and_group' is set, then the optimizer is going to use on of
    the following algorithms to resolve GROUP BY.

    - If one table, sort the table and then calculate groups on the fly.
    - If more than one table, create a temporary table to hold the join,
      sort it and then resolve group by on the fly.

    The 'on the fly' calculation is done in end_send_group()

    @see make_group_fields, alloc_group_fields, JOIN::exec,
         setup_end_select_func
  */
  bool     sort_and_group; 
  bool     first_record,full_join, no_field_update;
  bool     hash_join;
  bool	   do_send_rows;
  table_map const_table_map;
  /** 
    Bitmap of semijoin tables that the current partial plan decided
    to materialize and access by lookups
  */
  table_map sjm_lookup_tables;
  /** 
    Bitmap of semijoin tables that the chosen plan decided
    to materialize to scan the results of materialization
  */
  table_map sjm_scan_tables;
  /*
    Constant tables for which we have found a row (as opposed to those for
    which we didn't).
  */
  table_map found_const_table_map;
  
  /* Tables removed by table elimination. Set to 0 before the elimination. */
  table_map eliminated_tables;
  /*
     Bitmap of all inner tables from outer joins (set at start of
     make_join_statistics)
  */
  table_map outer_join;
  /* Bitmap of tables used in the select list items */
  table_map select_list_used_tables;
  /* Tables that has HA_NON_COMPARABLE_ROWID (does not support rowid) set */
  table_map not_usable_rowid_map;
  ha_rows  send_records,found_records,join_examined_rows, accepted_rows;

  /*
    LIMIT for the JOIN operation. When not using aggregation or DISITNCT, this 
    is the same as select's LIMIT clause specifies.
    Note that this doesn't take sql_calc_found_rows into account.
  */
  ha_rows row_limit;

  /*
    How many output rows should be produced after GROUP BY.
    (if sql_calc_found_rows is used, LIMIT is ignored)
  */
  ha_rows select_limit;
  /*
    Number of duplicate rows found in UNION.
  */
  ha_rows duplicate_rows;
  /**
    Used to fetch no more than given amount of rows per one
    fetch operation of server side cursor.
    The value is checked in end_send and end_send_group in fashion, similar
    to offset_limit_cnt:
      - fetch_limit= HA_POS_ERROR if there is no cursor.
      - when we open a cursor, we set fetch_limit to 0,
      - on each fetch iteration we add num_rows to fetch to fetch_limit
    NOTE: currently always HA_POS_ERROR.
  */
  ha_rows  fetch_limit;

  /* Finally picked QEP. This is result of join optimization */
  POSITION *best_positions;

  Pushdown_query *pushdown_query;
  JOIN_TAB *original_join_tab;
  uint	   original_table_count;

/******* Join optimization state members start *******/
  /*
    pointer - we're doing optimization for a semi-join materialization nest.
    NULL    - otherwise
  */
  TABLE_LIST *emb_sjm_nest;
  
  /* Current join optimization state */
  POSITION *positions;
  
  /*
    Bitmap of nested joins embedding the position at the end of the current 
    partial join (valid only during join optimizer run).
  */
  nested_join_map cur_embedding_map;
  
  /*
    Bitmap of inner tables of semi-join nests that have a proper subset of
    their tables in the current join prefix. That is, of those semi-join
    nests that have their tables both in and outside of the join prefix.
    (Note: tables that are constants but have not been pulled out of semi-join
    nests are not considered part of semi-join nests)
  */
  table_map cur_sj_inner_tables;

#ifndef DBUG_OFF
  void dbug_verify_sj_inner_tables(uint n_positions) const;
  int dbug_join_tab_array_size;
#endif

  /* We also maintain a stack of join optimization states in * join->positions[] */
/******* Join optimization state members end *******/

  /*
    Tables within complex firstmatch ranges (i.e. those where inner tables are
    interleaved with outer tables). Join buffering cannot be used for these.
  */
  table_map complex_firstmatch_tables;

  Next_select_func first_select;
  /*
    The cost of best complete join plan found so far during optimization,
    after optimization phase - cost of picked join order (not taking into
    account the changes made by test_if_skip_sort_order()).
  */
  double   best_read;
  /*
    Estimated result rows (fanout) of the join operation. If this is a subquery
    that is reexecuted multiple times, this value includes the estiamted # of
    reexecutions. This value is equal to the multiplication of all
    join->positions[i].records_read of a JOIN.
  */
  double   join_record_count;
  List<Item> *fields;

  /* Used only for FETCH ... WITH TIES to identify peers. */
  List<Cached_item> order_fields;
  /* Used during GROUP BY operations to identify when a group has changed. */
  List<Cached_item> group_fields, group_fields_cache;
  THD	   *thd;
  Item_sum  **sum_funcs, ***sum_funcs_end;
  /** second copy of sumfuncs (for queries with 2 temporary tables */
  Item_sum  **sum_funcs2, ***sum_funcs_end2;
  Procedure *procedure;
  Item	    *having;
  Item      *tmp_having; ///< To store having when processed temporary table
  Item      *having_history; ///< Store having for explain
  ORDER     *group_list_for_estimates;
  bool      having_is_correlated;
  ulonglong  select_options;
  /* 
    Bitmap of allowed types of the join caches that
    can be used for join operations
  */
  uint allowed_join_cache_types;
  bool allowed_semijoin_with_cache;
  bool allowed_outer_join_with_cache;
  /* Maximum level of the join caches that can be used for join operations */ 
  uint max_allowed_join_cache_level;
  select_result *result;
  TMP_TABLE_PARAM tmp_table_param;
  MYSQL_LOCK *lock;
  /// unit structure (with global parameters) for this select
  SELECT_LEX_UNIT *unit;
  /// select that processed
  SELECT_LEX *select_lex;
  /** 
    TRUE <=> optimizer must not mark any table as a constant table.
    This is needed for subqueries in form "a IN (SELECT .. UNION SELECT ..):
    when we optimize the select that reads the results of the union from a
    temporary table, we must not mark the temp. table as constant because
    the number of rows in it may vary from one subquery execution to another.
  */
  bool no_const_tables; 
  /*
    This flag is set if we call no_rows_in_result() as par of end_group().
    This is used as a simple speed optimization to avoiding calling
    restore_no_rows_in_result() in ::reinit()
  */
  bool no_rows_in_result_called;

  /**
    This is set if SQL_CALC_ROWS was calculated by filesort()
    and should be taken from the appropriate JOIN_TAB
  */
  bool filesort_found_rows;

  bool subq_exit_fl;
  
  ROLLUP rollup;				///< Used with rollup
  
  bool mixed_implicit_grouping;
  bool select_distinct;				///< Set if SELECT DISTINCT
  /**
    If we have the GROUP BY statement in the query,
    but the group_list was emptied by optimizer, this
    flag is TRUE.
    It happens when fields in the GROUP BY are from
    constant table
  */
  bool group_optimized_away;

  /*
    simple_xxxxx is set if ORDER/GROUP BY doesn't include any references
    to other tables than the first non-constant table in the JOIN.
    It's also set if ORDER/GROUP BY is empty.
    Used for deciding for or against using a temporary table to compute 
    GROUP/ORDER BY.
  */
  bool simple_order, simple_group;

  /*
    ordered_index_usage is set if an ordered index access
    should be used instead of a filesort when computing 
    ORDER/GROUP BY.
  */
  enum
  {
    ordered_index_void,       // No ordered index avail.
    ordered_index_group_by,   // Use index for GROUP BY
    ordered_index_order_by    // Use index for ORDER BY
  } ordered_index_usage;

  /**
    Is set only in case if we have a GROUP BY clause
    and no ORDER BY after constant elimination of 'order'.
  */
  bool no_order;
  /** Is set if we have a GROUP BY and we have ORDER BY on a constant. */
  bool          skip_sort_order;

  bool need_tmp; 
  bool hidden_group_fields;
  /* TRUE if there was full cleunap of the JOIN */
  bool cleaned;
  DYNAMIC_ARRAY keyuse;
  Item::cond_result cond_value, having_value;
  /**
    Impossible where after reading const tables 
    (set in make_join_statistics())
  */
  bool impossible_where; 

  /*
    All fields used in the query processing.

    Initially this is a list of fields from the query's SQL text.

    Then, ORDER/GROUP BY and Window Function code add columns that need to
    be saved to be available in the post-group-by context. These extra columns
    are added to the front, because this->fields_list points to the suffix of
    this list.
  */
  List<Item> all_fields;
  ///Above list changed to use temporary table
  List<Item> tmp_all_fields1, tmp_all_fields2, tmp_all_fields3;
  ///Part, shared with list above, emulate following list
  List<Item> tmp_fields_list1, tmp_fields_list2, tmp_fields_list3;

  /*
    The original field list as it was passed to mysql_select(). This refers
    to select_lex->item_list.
    CAUTION: this list is a suffix of this->all_fields list, that is, it shares
    elements with that list!
  */
  List<Item> &fields_list;
  List<Item> procedure_fields_list;
  int error;

  ORDER *order, *group_list, *proc_param; //hold parameters of mysql_select
  COND *conds;                            // ---"---
  Item *conds_history;                    // store WHERE for explain
  COND *outer_ref_cond;       ///<part of conds containing only outer references
  COND *pseudo_bits_cond;     // part of conds containing special bita
  TABLE_LIST *tables_list;           ///<hold 'tables' parameter of mysql_select
  List<TABLE_LIST> *join_list;       ///< list of joined tables in reverse order
  COND_EQUAL *cond_equal;
  COND_EQUAL *having_equal;
  /*
    Constant codition computed during optimization, but evaluated during
    join execution. Typically expensive conditions that should not be
    evaluated at optimization time.
  */
  Item *exec_const_cond;
  /*
    Constant ORDER and/or GROUP expressions that contain subqueries. Such
    expressions need to evaluated to verify that the subquery indeed
    returns a single row. The evaluation of such expressions is delayed
    until query execution.
  */
  List<Item> exec_const_order_group_cond;
  SQL_SELECT *select;                ///<created in optimisation phase
  JOIN_TAB *return_tab;              ///<used only for outer joins

  /*
    Used pointer reference for this select.
    select_lex->ref_pointer_array contains five "slices" of the same length:
    |========|========|========|========|========|
     ref_ptrs items0   items1   items2   items3
   */
  Ref_ptr_array ref_ptrs;
  // Copy of the initial slice above, to be used with different lists
  Ref_ptr_array items0, items1, items2, items3;
  // Used by rollup, to restore ref_ptrs after overwriting it.
  Ref_ptr_array current_ref_ptrs;

  const char *zero_result_cause; ///< not 0 if exec must return zero result
  
  bool union_part; ///< this subselect is part of union 

  enum join_optimization_state { NOT_OPTIMIZED=0,
                                 OPTIMIZATION_IN_PROGRESS=1,
                                 OPTIMIZATION_PHASE_1_DONE=2,
                                 OPTIMIZATION_DONE=3};
  // state of JOIN optimization
  enum join_optimization_state optimization_state;
  bool initialized; ///< flag to avoid double init_execution calls

  Explain_select *explain;
  
  enum { QEP_NOT_PRESENT_YET, QEP_AVAILABLE, QEP_DELETED} have_query_plan;

  // if keep_current_rowid=true, whether they should be saved in temporary table
  bool tmp_table_keep_current_rowid;

  /*
    Additional WHERE and HAVING predicates to be considered for IN=>EXISTS
    subquery transformation of a JOIN object.
  */
  Item *in_to_exists_where;
  Item *in_to_exists_having;
  
  /* Temporary tables used to weed-out semi-join duplicates */
  List<TABLE> sj_tmp_tables;
  /* SJM nests that are executed with SJ-Materialization strategy */
  List<SJ_MATERIALIZATION_INFO> sjm_info_list;

  /** TRUE <=> ref_pointer_array is set to items3. */
  bool set_group_rpa;
  /** Exec time only: TRUE <=> current group has been sent */
  bool group_sent;
  /**
    TRUE if the query contains an aggregate function but has no GROUP
    BY clause. 
  */
  bool implicit_grouping; 

  bool with_two_phase_optimization;

  /* Saved execution plan for this join */
  Join_plan_state *save_qep;
  /* Info on splittability of the table materialized by this plan*/
  SplM_opt_info *spl_opt_info;
  /* Contains info on keyuses usable for splitting */
  Dynamic_array<KEYUSE_EXT> *ext_keyuses_for_splitting;

  JOIN_TAB *sort_and_group_aggr_tab;
  /*
    Flag is set to true if select_lex was found to be degenerated before
    the optimize_cond() call in JOIN::optimize_inner() method.
  */
  bool is_orig_degenerated;

  JOIN(THD *thd_arg, List<Item> &fields_arg, ulonglong select_options_arg,
       select_result *result_arg)
    :fields_list(fields_arg)
  {
    init(thd_arg, fields_arg, select_options_arg, result_arg);
  }

  void init(THD *thd_arg, List<Item> &fields_arg, ulonglong select_options_arg,
            select_result *result_arg);

  /* True if the plan guarantees that it will be returned zero or one row */
  bool only_const_tables()  { return const_tables == table_count; }
  /* Number of tables actually joined at the top level */
  uint exec_join_tab_cnt() { return tables_list ? top_join_tab_count : 0; }

  /*
    Number of tables in the join which also includes the temporary tables
    created for GROUP BY, DISTINCT , WINDOW FUNCTION etc.
  */
  uint total_join_tab_cnt()
  {
    return exec_join_tab_cnt() + aggr_tables - 1;
  }

  int prepare(TABLE_LIST *tables, COND *conds, uint og_num, ORDER *order,
              bool skip_order_by, ORDER *group, Item *having,
              ORDER *proc_param, SELECT_LEX *select, SELECT_LEX_UNIT *unit);
  bool prepare_stage2();
  int optimize();
  int optimize_inner();
  int optimize_stage2();
  bool build_explain();
  int reinit();
  int init_execution();
  void exec();

  void exec_inner();
  bool prepare_result(List<Item> **columns_list);
  int destroy();
  void restore_tmp();
  bool alloc_func_list();
  bool flatten_subqueries();
  bool optimize_unflattened_subqueries();
  bool optimize_constant_subqueries();
  bool make_range_rowid_filters();
  bool init_range_rowid_filters();
  bool make_sum_func_list(List<Item> &all_fields, List<Item> &send_fields,
			  bool before_group_by);

  /// Initialzes a slice, see comments for ref_ptrs above.
  Ref_ptr_array ref_ptr_array_slice(size_t slice_num)
  {
    size_t slice_sz= select_lex->ref_pointer_array.size() / 5U;
    DBUG_ASSERT(select_lex->ref_pointer_array.size() % 5 == 0);
    DBUG_ASSERT(slice_num < 5U);
    return Ref_ptr_array(&select_lex->ref_pointer_array[slice_num * slice_sz],
                         slice_sz);
  }

  /**
     Overwrites one slice with the contents of another slice.
     In the normal case, dst and src have the same size().
     However: the rollup slices may have smaller size than slice_sz.
   */
  void copy_ref_ptr_array(Ref_ptr_array dst_arr, Ref_ptr_array src_arr)
  {
    DBUG_ASSERT(dst_arr.size() >= src_arr.size());
    if (src_arr.size() == 0)
      return;

    void *dest= dst_arr.array();
    const void *src= src_arr.array();
    memcpy(dest, src, src_arr.size() * src_arr.element_size());
  }

  /// Overwrites 'ref_ptrs' and remembers the the source as 'current'.
  void set_items_ref_array(Ref_ptr_array src_arr)
  {
    copy_ref_ptr_array(ref_ptrs, src_arr);
    current_ref_ptrs= src_arr;
  }

  /// Initializes 'items0' and remembers that it is 'current'.
  void init_items_ref_array()
  {
    items0= ref_ptr_array_slice(1);
    copy_ref_ptr_array(items0, ref_ptrs);
    current_ref_ptrs= items0;
  }

  bool rollup_init();
  bool rollup_process_const_fields();
  bool rollup_make_fields(List<Item> &all_fields, List<Item> &fields,
			  Item_sum ***func);
  int rollup_send_data(uint idx);
  int rollup_write_data(uint idx, TMP_TABLE_PARAM *tmp_table_param, TABLE *table);
  void join_free();
  /** Cleanup this JOIN, possibly for reuse */
  void cleanup(bool full);
  void clear(table_map *cleared_tables);
  void inline clear_sum_funcs();
  bool send_row_on_empty_set()
  {
    return (do_send_rows && implicit_grouping && !group_optimized_away &&
            having_value != Item::COND_FALSE);
  }
  bool empty_result() { return (zero_result_cause && !implicit_grouping); }
  bool change_result(select_result *new_result, select_result *old_result);
  bool is_top_level_join() const
  {
    return (unit == &thd->lex->unit && (unit->fake_select_lex == 0 ||
                                        select_lex == unit->fake_select_lex));
  }
  void cache_const_exprs();
  inline table_map all_tables_map()
  {
    return (table_map(1) << table_count) - 1;
  }
  void drop_unused_derived_keys();
  bool get_best_combination();
  bool add_sorting_to_table(JOIN_TAB *tab, ORDER *order);
  inline void eval_select_list_used_tables();
  /* 
    Return the table for which an index scan can be used to satisfy 
    the sort order needed by the ORDER BY/(implicit) GROUP BY clause 
  */
  JOIN_TAB *get_sort_by_join_tab()
  {
    return (need_tmp || !sort_by_table || skip_sort_order ||
            ((group || tmp_table_param.sum_func_count) && !group_list)) ?
              NULL : join_tab+const_tables;
  }
  bool setup_subquery_caches();
  bool shrink_join_buffers(JOIN_TAB *jt, 
                           ulonglong curr_space,
                           ulonglong needed_space);
  void set_allowed_join_cache_types();
  bool is_allowed_hash_join_access()
  { 
    return MY_TEST(allowed_join_cache_types & JOIN_CACHE_HASHED_BIT) &&
           max_allowed_join_cache_level > JOIN_CACHE_HASHED_BIT;
  }
  /*
    Check if we need to create a temporary table.
    This has to be done if all tables are not already read (const tables)
    and one of the following conditions holds:
    - We are using DISTINCT (simple distinct's are already optimized away)
    - We are using an ORDER BY or GROUP BY on fields not in the first table
    - We are using different ORDER BY and GROUP BY orders
    - The user wants us to buffer the result.
    - We are using WINDOW functions.
    When the WITH ROLLUP modifier is present, we cannot skip temporary table
    creation for the DISTINCT clause just because there are only const tables.
  */
  bool test_if_need_tmp_table()
  {
    return ((const_tables != table_count &&
	    ((select_distinct || !simple_order || !simple_group) ||
	     (group_list && order) ||
             MY_TEST(select_options & OPTION_BUFFER_RESULT))) ||
            (rollup.state != ROLLUP::STATE_NONE && select_distinct) ||
            select_lex->have_window_funcs());
  }
  bool choose_subquery_plan(table_map join_tables);
  void get_partial_cost_and_fanout(int end_tab_idx,
                                   table_map filter_map,
                                   double *read_time_arg, 
                                   double *record_count_arg);
  void get_prefix_cost_and_fanout(uint n_tables, 
                                  double *read_time_arg,
                                  double *record_count_arg);
  double get_examined_rows();
  /* defined in opt_subselect.cc */
  bool transform_max_min_subquery();
  /* True if this JOIN is a subquery under an IN predicate. */
  bool is_in_subquery()
  {
    return (unit->item && unit->item->is_in_predicate());
  }
  bool save_explain_data(Explain_query *output, bool can_overwrite,
                         bool need_tmp_table, bool need_order, bool distinct);
  int save_explain_data_intern(Explain_query *output, bool need_tmp_table,
                               bool need_order, bool distinct,
                               const char *message);
  JOIN_TAB *first_breadth_first_tab() { return join_tab; }
  bool check_two_phase_optimization(THD *thd);
  bool inject_cond_into_where(Item *injected_cond);
  bool check_for_splittable_materialized();
  void add_keyuses_for_splitting();
  bool inject_best_splitting_cond(table_map remaining_tables);
  bool fix_all_splittings_in_plan();
  bool inject_splitting_cond_for_all_tables_with_split_opt();
  void make_notnull_conds_for_range_scans();

  bool transform_in_predicates_into_in_subq(THD *thd);

  bool optimize_upper_rownum_func();

private:
  /**
    Create a temporary table to be used for processing DISTINCT/ORDER
    BY/GROUP BY.

    @note Will modify JOIN object wrt sort/group attributes

    @param tab              the JOIN_TAB object to attach created table to
    @param tmp_table_fields List of items that will be used to define
                            column types of the table.
    @param tmp_table_group  Group key to use for temporary table, NULL if none.
    @param save_sum_fields  If true, do not replace Item_sum items in 
                            @c tmp_fields list with Item_field items referring 
                            to fields in temporary table.

    @returns false on success, true on failure
  */
  bool create_postjoin_aggr_table(JOIN_TAB *tab, List<Item> *tmp_table_fields,
                                  ORDER *tmp_table_group,
                                  bool save_sum_fields,
                                  bool distinct,
                                  bool keep_row_ordermake);
  /**
    Optimize distinct when used on a subset of the tables.

    E.g.,: SELECT DISTINCT t1.a FROM t1,t2 WHERE t1.b=t2.b
    In this case we can stop scanning t2 when we have found one t1.a
  */
  void optimize_distinct();

  void cleanup_item_list(List<Item> &items) const;
  bool add_having_as_table_cond(JOIN_TAB *tab);
  bool make_aggr_tables_info();
  bool add_fields_for_current_rowid(JOIN_TAB *cur, List<Item> *fields);
  void free_pushdown_handlers(List<TABLE_LIST>& join_list);
  void init_join_cache_and_keyread();
  bool prepare_sum_aggregators(THD *thd,Item_sum **func_ptr,
                               bool need_distinct);
  bool transform_in_predicates_into_equalities(THD *thd);
  bool transform_all_conds_and_on_exprs(THD *thd,
                                        Item_transformer transformer);
  bool transform_all_conds_and_on_exprs_in_join_list(THD *thd,
                                                 List<TABLE_LIST> *join_list,
                                                 Item_transformer transformer);
};

enum enum_with_bush_roots { WITH_BUSH_ROOTS, WITHOUT_BUSH_ROOTS};
enum enum_with_const_tables { WITH_CONST_TABLES, WITHOUT_CONST_TABLES};

JOIN_TAB *first_linear_tab(JOIN *join,
                           enum enum_with_bush_roots include_bush_roots,
                           enum enum_with_const_tables const_tbls);
JOIN_TAB *next_linear_tab(JOIN* join, JOIN_TAB* tab, 
                          enum enum_with_bush_roots include_bush_roots);

JOIN_TAB *first_top_level_tab(JOIN *join, enum enum_with_const_tables with_const);
JOIN_TAB *next_top_level_tab(JOIN *join, JOIN_TAB *tab);

typedef struct st_select_check {
  uint const_ref,reg_ref;
} SELECT_CHECK;

extern const char *join_type_str[];

/* Extern functions in sql_select.cc */
void count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param, 
                       List<Item> &fields, bool reset_with_sum_func);
bool setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
		       Ref_ptr_array ref_pointer_array,
		       List<Item> &new_list1, List<Item> &new_list2,
		       uint elements, List<Item> &fields);
void copy_fields(TMP_TABLE_PARAM *param);
bool copy_funcs(Item **func_ptr, const THD *thd);
uint find_shortest_key(TABLE *table, const key_map *usable_keys);
bool is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args);

/* functions from opt_sum.cc */
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);
int opt_sum_query(THD* thd,
                  List<TABLE_LIST> &tables, List<Item> &all_fields, COND *conds);

/* from sql_delete.cc, used by opt_range.cc */
extern "C" int refpos_order_cmp(void *arg, const void *a,const void *b);

/** class to copying an field/item to a key struct */

class store_key :public Sql_alloc
{
public:
  bool null_key; /* TRUE <=> the value of the key has a null part */
  enum store_key_result { STORE_KEY_OK, STORE_KEY_FATAL, STORE_KEY_CONV };
  enum Type { FIELD_STORE_KEY, ITEM_STORE_KEY, CONST_ITEM_STORE_KEY };
  store_key(THD *thd, Field *field_arg, uchar *ptr, uchar *null, uint length)
    :null_key(0), null_ptr(null), err(0)
  {
    to_field=field_arg->new_key_field(thd->mem_root, field_arg->table,
                                      ptr, length, null, 1);
  }
  store_key(store_key &arg)
    :Sql_alloc(), null_key(arg.null_key), to_field(arg.to_field),
             null_ptr(arg.null_ptr), err(arg.err)

  {}
  virtual ~store_key() = default;			/** Not actually needed */
  virtual enum Type type() const=0;
  virtual const char *name() const=0;
  virtual bool store_key_is_const() { return false; }

  /**
    @brief sets ignore truncation warnings mode and calls the real copy method

    @details this function makes sure truncation warnings when preparing the
    key buffers don't end up as errors (because of an enclosing INSERT/UPDATE).
  */
  enum store_key_result copy(THD *thd)
  {
    enum_check_fields org_count_cuted_fields= thd->count_cuted_fields;
    Use_relaxed_field_copy urfc(to_field->table->in_use);

    /* If needed, perform CharsetNarrowing for making ref access lookup keys. */
    Utf8_narrow do_narrow(to_field, do_cset_narrowing);

    store_key_result result= copy_inner();

    do_narrow.stop();

    thd->count_cuted_fields= org_count_cuted_fields;
    return result;
  }

 protected:
  Field *to_field;				// Store data here
  uchar *null_ptr;
  uchar err;

  /*
    This is set to true if we need to do Charset Narrowing when making a lookup
    key.
  */
  bool do_cset_narrowing= false;

  virtual enum store_key_result copy_inner()=0;
};


class store_key_field: public store_key
{
  Copy_field copy_field;
  const char *field_name;
 public:
  store_key_field(THD *thd, Field *to_field_arg, uchar *ptr,
                  uchar *null_ptr_arg,
		  uint length, Field *from_field, const char *name_arg)
    :store_key(thd, to_field_arg,ptr,
	       null_ptr_arg ? null_ptr_arg : from_field->maybe_null() ? &err
	       : (uchar*) 0, length), field_name(name_arg)
  {
    if (to_field)
    {
      copy_field.set(to_field,from_field,0);
      setup_charset_narrowing();
    }
  }  

  enum Type type() const override { return FIELD_STORE_KEY; }
  const char *name() const override { return field_name; }

  void change_source_field(Item_field *fld_item)
  {
    copy_field.set(to_field, fld_item->field, 0);
    field_name= fld_item->full_name();
    setup_charset_narrowing();
  }

  /* Setup CharsetNarrowing if necessary */
  void setup_charset_narrowing()
  {
    do_cset_narrowing=
      Utf8_narrow::should_do_narrowing(copy_field.to_field,
                                            copy_field.from_field->charset());
  }

 protected: 
  enum store_key_result copy_inner() override
  {
    TABLE *table= copy_field.to_field->table;
    MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
                                                 &table->write_set);

    /* 
      It looks like the next statement is needed only for a simplified
      hash function over key values used now in BNLH join.
      When the implementation of this function will be replaced for a proper
      full version this statement probably should be removed.
    */  
    bzero(copy_field.to_ptr,copy_field.to_length);

    copy_field.do_copy(&copy_field);
    dbug_tmp_restore_column_map(&table->write_set, old_map);
    null_key= to_field->is_null();
    return err != 0 ? STORE_KEY_FATAL : STORE_KEY_OK;
  }
};


class store_key_item :public store_key
{
 protected:
  Item *item;
  /*
    Flag that forces usage of save_val() method which save value of the
    item instead of save_in_field() method which saves result.
  */
  bool use_value;
public:
  store_key_item(THD *thd, Field *to_field_arg, uchar *ptr,
                 uchar *null_ptr_arg, uint length, Item *item_arg, bool val)
    :store_key(thd, to_field_arg, ptr,
	       null_ptr_arg ? null_ptr_arg : item_arg->maybe_null() ?
	       &err : (uchar*) 0, length), item(item_arg), use_value(val)
  {
    /* Setup CharsetNarrowing to be done if necessary */
    do_cset_narrowing=
      Utf8_narrow::should_do_narrowing(to_field,
                                       item->collation.collation);
  }
  store_key_item(store_key &arg, Item *new_item, bool val)
    :store_key(arg), item(new_item), use_value(val)
  {}


  enum Type type() const override { return ITEM_STORE_KEY; }
  const char *name() const override { return "func"; }

 protected:  
  enum store_key_result copy_inner() override
  {
    TABLE *table= to_field->table;
    MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
                                                 &table->write_set);
    int res= FALSE;

    /* 
      It looks like the next statement is needed only for a simplified
      hash function over key values used now in BNLH join.
      When the implementation of this function will be replaced for a proper
      full version this statement probably should be removed.
    */  
    to_field->reset();

    if (use_value)
      item->save_val(to_field);
    else
      res= item->save_in_field(to_field, 1);
    /*
     Item::save_in_field() may call Item::val_xxx(). And if this is a subquery
     we need to check for errors executing it and react accordingly
    */
    if (!res && table->in_use->is_error())
      res= 1; /* STORE_KEY_FATAL */
    dbug_tmp_restore_column_map(&table->write_set, old_map);
    null_key= to_field->is_null() || item->null_value;
    return ((err != 0 || res < 0 || res > 2) ? STORE_KEY_FATAL : 
            (store_key_result) res);
  }
};


class store_key_const_item :public store_key_item
{
  bool inited;
public:
  store_key_const_item(THD *thd, Field *to_field_arg, uchar *ptr,
		       uchar *null_ptr_arg, uint length,
		       Item *item_arg)
    :store_key_item(thd, to_field_arg, ptr,
		    null_ptr_arg ? null_ptr_arg : item_arg->maybe_null() ?
		    &err : (uchar*) 0, length, item_arg, FALSE), inited(0)
  {
  }
  store_key_const_item(store_key &arg, Item *new_item)
    :store_key_item(arg, new_item, FALSE), inited(0)
  {}

  enum Type type() const override { return CONST_ITEM_STORE_KEY; }
  const char *name() const override { return "const"; }
  bool store_key_is_const() override { return true; }

protected:  
  enum store_key_result copy_inner() override
  {
    int res;
    if (!inited)
    {
      inited=1;
      TABLE *table= to_field->table;
      MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
                                                   &table->write_set);
      if ((res= item->save_in_field(to_field, 1)))
      {       
        if (!err)
          err= res < 0 ? 1 : res; /* 1=STORE_KEY_FATAL */
      }
      /*
        Item::save_in_field() may call Item::val_xxx(). And if this is a subquery
        we need to check for errors executing it and react accordingly
        */
      if (!err && to_field->table->in_use->is_error())
        err= 1; /* STORE_KEY_FATAL */
      dbug_tmp_restore_column_map(&table->write_set, old_map);
    }
    null_key= to_field->is_null() || item->null_value;
    return (err > 2 ? STORE_KEY_FATAL : (store_key_result) err);
  }
};

void best_access_path(JOIN *join, JOIN_TAB *s,
                      table_map remaining_tables,
                      const POSITION *join_positions, uint idx,
                      bool disable_jbuf, double record_count,
                      POSITION *pos, POSITION *loose_scan_pos);
bool cp_buffer_from_ref(THD *thd, TABLE *table, TABLE_REF *ref);
bool error_if_full_join(JOIN *join);
int report_error(TABLE *table, int error);
int safe_index_read(JOIN_TAB *tab);
int get_quick_record(SQL_SELECT *select);
int setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
                List<Item> &fields, List <Item> &all_fields, ORDER *order,
                bool from_window_spec= false);
int setup_group(THD *thd,  Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
		List<Item> &fields, List<Item> &all_fields, ORDER *order,
		bool *hidden_group_fields, bool from_window_spec= false);
bool fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
                    Ref_ptr_array ref_pointer_array);
int join_read_key2(THD *thd, struct st_join_table *tab, TABLE *table,
                   struct st_table_ref *table_ref);

bool handle_select(THD *thd, LEX *lex, select_result *result,
                   ulong setup_tables_done_option);
bool mysql_select(THD *thd, TABLE_LIST *tables, List<Item> &list,
                  COND *conds, uint og_num, ORDER *order, ORDER *group,
                  Item *having, ORDER *proc_param, ulonglong select_type, 
                  select_result *result, SELECT_LEX_UNIT *unit, 
                  SELECT_LEX *select_lex);
void free_underlaid_joins(THD *thd, SELECT_LEX *select);
bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit,
                         select_result *result);

/*
  General routine to change field->ptr of a NULL-terminated array of Field
  objects. Useful when needed to call val_int, val_str or similar and the
  field data is not in table->record[0] but in some other structure.
  set_key_field_ptr changes all fields of an index using a key_info object.
  All methods presume that there is at least one field to change.
*/


class Virtual_tmp_table: public TABLE
{
  /**
    Destruct collected fields. This method can be called on errors,
    when we could not make the virtual temporary table completely,
    e.g. when some of the fields could not be created or added.

    This is needed to avoid memory leaks, as some fields can be BLOB
    variants and thus can have String onboard. Strings must be destructed
    as they store data on the heap (not on MEM_ROOT).
  */
  void destruct_fields()
  {
    for (uint i= 0; i < s->fields; i++)
    {
      field[i]->free();
      delete field[i];  // to invoke the field destructor
    }
    s->fields= 0;       // safety
  }

protected:
  /**
     The number of the fields that are going to be in the table.
     We remember the number of the fields at init() time, and
     at open() we check that all of the fields were really added.
  */
  uint m_alloced_field_count;

  /**
    Setup field pointers and null-bit pointers.
  */
  void setup_field_pointers();

public:
  /**
    Create a new empty virtual temporary table on the thread mem_root.
    After creation, the caller must:
    - call init()
    - populate the table with new fields using add().
    - call open().
    @param thd         - Current thread.
  */
  static void *operator new(size_t size, THD *thd) throw();
  static void operator delete(void *ptr, size_t size) { TRASH_FREE(ptr, size); }
  static void operator delete(void *, THD *) throw(){}

  Virtual_tmp_table(THD *thd) : m_alloced_field_count(0)
  {
    reset();
    temp_pool_slot= MY_BIT_NONE;
    in_use= thd;
    copy_blobs= true;
    alias.set("", 0, &my_charset_bin);
  }

  ~Virtual_tmp_table()
  {
    if (s)
      destruct_fields();
  }

  /**
    Allocate components for the given number of fields.
     - fields[]
     - s->blob_fields[],
     - bitmaps: def_read_set, def_write_set, tmp_set, eq_join_set, cond_set.
    @param field_count - The number of fields we plan to add to the table.
    @returns false     - on success.
    @returns true      - on error.
  */
  bool init(uint field_count);

  /**
    Add one Field to the end of the field array, update members:
    s->reclength, s->fields, s->blob_fields, s->null_fuelds.
  */
  bool add(Field *new_field)
  {
    DBUG_ASSERT(s->fields < m_alloced_field_count);
    new_field->init(this);
    field[s->fields]= new_field;
    s->reclength+= new_field->pack_length();
    if (!(new_field->flags & NOT_NULL_FLAG))
      s->null_fields++;
    if (new_field->flags & BLOB_FLAG)
    {
      // Note, s->blob_fields was incremented in Field_blob::Field_blob
      DBUG_ASSERT(s->blob_fields);
      DBUG_ASSERT(s->blob_fields <= m_alloced_field_count);
      s->blob_field[s->blob_fields - 1]= s->fields;
    }
    new_field->field_index= s->fields++;
    return false;
  }

  /**
    Add fields from a Spvar_definition list
    @returns false - on success.
    @returns true  - on error.
  */
  bool add(List<Spvar_definition> &field_list);

  /**
    Open a virtual table for read/write:
    - Setup end markers in TABLE::field and TABLE_SHARE::blob_fields,
    - Allocate a buffer in TABLE::record[0].
    - Set field pointers (Field::ptr, Field::null_pos, Field::null_bit) to
      the allocated record.
    This method is called when all of the fields have been added to the table.
    After calling this method the table is ready for read and write operations.
    @return false - on success
    @return true  - on error (e.g. could not allocate the record buffer).
  */
  bool open();

  void set_all_fields_to_null()
  {
    for (uint i= 0; i < s->fields; i++)
      field[i]->set_null();
  }
  /**
    Set all fields from a compatible item list.
    The number of fields in "this" must be equal to the number
    of elements in "value".
  */
  bool sp_set_all_fields_from_item_list(THD *thd, List<Item> &items);

  /**
    Set all fields from a compatible item.
    The number of fields in "this" must be the same with the number
    of elements in "value".
  */
  bool sp_set_all_fields_from_item(THD *thd, Item *value);

  /**
    Find a ROW element index by its name
    Assumes that "this" is used as a storage for a ROW-type SP variable.
    @param [OUT] idx        - the index of the found field is returned here
    @param [IN]  field_name - find a field with this name
    @return      true       - on error (the field was not found)
    @return      false      - on success (idx[0] was set to the field index)
  */
  bool sp_find_field_by_name(uint *idx, const LEX_CSTRING &name) const;

  /**
    Find a ROW element index by its name.
    If the element is not found, and error is issued.
    @param [OUT] idx        - the index of the found field is returned here
    @param [IN]  var_name   - the name of the ROW variable (for error reporting)
    @param [IN]  field_name - find a field with this name
    @return      true       - on error (the field was not found)
    @return      false      - on success (idx[0] was set to the field index)
  */
  bool sp_find_field_by_name_or_error(uint *idx,
                                      const LEX_CSTRING &var_name,
                                      const LEX_CSTRING &field_name) const;
};


/**
  Create a reduced TABLE object with properly set up Field list from a
  list of field definitions.

    The created table doesn't have a table handler associated with
    it, has no keys, no group/distinct, no copy_funcs array.
    The sole purpose of this TABLE object is to use the power of Field
    class to read/write data to/from table->record[0]. Then one can store
    the record in any container (RB tree, hash, etc).
    The table is created in THD mem_root, so are the table's fields.
    Consequently, if you don't BLOB fields, you don't need to free it.

  @param thd         connection handle
  @param field_list  list of column definitions

  @return
    0 if out of memory, or a
    TABLE object ready for read and write in case of success
*/

inline Virtual_tmp_table *
create_virtual_tmp_table(THD *thd, List<Spvar_definition> &field_list)
{
  Virtual_tmp_table *table;
  if (!(table= new(thd) Virtual_tmp_table(thd)))
    return NULL;

  /*
    If "simulate_create_virtual_tmp_table_out_of_memory" debug option
    is enabled, we now enable "simulate_out_of_memory". This effectively
    makes table->init() fail on OOM inside multi_alloc_root().
    This is done to test that ~Virtual_tmp_table() called from the "delete"
    below correcly handles OOM.
  */
  DBUG_EXECUTE_IF("simulate_create_virtual_tmp_table_out_of_memory",
                  DBUG_SET("+d,simulate_out_of_memory"););

  if (table->init(field_list.elements) ||
      table->add(field_list) ||
      table->open())
  {
    delete table;
    return NULL;
  }
  return table;
}


/**
  Create a new virtual temporary table consisting of a single field.
  SUM(DISTINCT expr) and similar numeric aggregate functions use this.
  @param thd    - Current thread
  @param field  - The field that will be added into the table.
  @return NULL  - On error.
  @return !NULL - A pointer to the created table that is ready
                  for read and write.
*/
inline TABLE *
create_virtual_tmp_table(THD *thd, Field *field)
{
  Virtual_tmp_table *table;
  DBUG_ASSERT(field);
  if (!(table= new(thd) Virtual_tmp_table(thd)))
    return NULL;
  if (table->init(1) ||
      table->add(field) ||
      table->open())
  {
    delete table;
    return NULL;
  }
  return table;
}


int test_if_item_cache_changed(List<Cached_item> &list);
int join_init_read_record(JOIN_TAB *tab);
void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key);
inline Item * and_items(THD *thd, Item* cond, Item *item)
{
  return (cond ? (new (thd->mem_root) Item_cond_and(thd, cond, item)) : item);
}
inline Item * or_items(THD *thd, Item* cond, Item *item)
{
  return (cond ? (new (thd->mem_root) Item_cond_or(thd, cond, item)) : item);
}
bool choose_plan(JOIN *join, table_map join_tables);
void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab, 
                                table_map last_remaining_tables, 
                                bool first_alt, uint no_jbuf_before,
                                double *outer_rec_count, double *reopt_cost);
Item_equal *find_item_equal(COND_EQUAL *cond_equal, Field *field,
                            bool *inherited_fl);
extern bool test_if_ref(Item *, 
                 Item_field *left_item,Item *right_item);

inline bool optimizer_flag(const THD *thd, ulonglong flag)
{ 
  return (thd->variables.optimizer_switch & flag);
}

/*
int print_fake_select_lex_join(select_result_sink *result, bool on_the_fly,
                               SELECT_LEX *select_lex, uint8 select_options);
*/

uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select,
                         ha_rows limit, ha_rows *scanned_limit, 
                         bool *need_sort, bool *reverse);
ORDER *simple_remove_const(ORDER *order, COND *where);
bool const_expression_in_where(COND *cond, Item *comp_item,
                               Field *comp_field= NULL,
                               Item **const_item= NULL);
bool cond_is_datetime_is_null(Item *cond);
bool cond_has_datetime_is_null(Item *cond);

/* Table elimination entry point function */
void eliminate_tables(JOIN *join);

/* Index Condition Pushdown entry point function */
void push_index_cond(JOIN_TAB *tab, uint keyno);

#define OPT_LINK_EQUAL_FIELDS    1

/* EXPLAIN-related utility functions */
int print_explain_message_line(select_result_sink *result, 
                               uint8 options, bool is_analyze,
                               uint select_number,
                               const char *select_type,
                               ha_rows *rows,
                               const char *message);
void explain_append_mrr_info(QUICK_RANGE_SELECT *quick, String *res);
int append_possible_keys(MEM_ROOT *alloc, String_list &list, TABLE *table, 
                         key_map possible_keys);
void unpack_to_base_table_fields(TABLE *table);

/****************************************************************************
  Temporary table support for SQL Runtime
 ***************************************************************************/

#define STRING_TOTAL_LENGTH_TO_PACK_ROWS 128
#define AVG_STRING_LENGTH_TO_PACK_ROWS   64
#define RATIO_TO_PACK_ROWS	       2
#define MIN_STRING_LENGTH_TO_PACK_ROWS   10

void calc_group_buffer(TMP_TABLE_PARAM *param, ORDER *group);
TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
			ORDER *group, bool distinct, bool save_sum_fields,
			ulonglong select_options, ha_rows rows_limit,
                        const LEX_CSTRING *alias, bool do_not_open=FALSE,
                        bool keep_row_order= FALSE);
TABLE *create_tmp_table_for_schema(THD *thd, TMP_TABLE_PARAM *param,
                                   const ST_SCHEMA_TABLE &schema_table,
                                   longlong select_options,
                                   const LEX_CSTRING &alias,
                                   bool do_not_open, bool keep_row_order);

void free_tmp_table(THD *thd, TABLE *entry);
bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
                                         TMP_ENGINE_COLUMNDEF *start_recinfo,
                                         TMP_ENGINE_COLUMNDEF **recinfo, 
                                         int error, bool ignore_last_dupp_key_error,
                                         bool *is_duplicate);
bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, 
                               TMP_ENGINE_COLUMNDEF *start_recinfo,
                               TMP_ENGINE_COLUMNDEF **recinfo, 
                               ulonglong options);
bool instantiate_tmp_table(TABLE *table, KEY *keyinfo, 
                           TMP_ENGINE_COLUMNDEF *start_recinfo,
                           TMP_ENGINE_COLUMNDEF **recinfo,
                           ulonglong options);
bool open_tmp_table(TABLE *table);
double prev_record_reads(const POSITION *positions, uint idx, table_map found_ref);
void fix_list_after_tbl_changes(SELECT_LEX *new_parent, List<TABLE_LIST> *tlist);
double get_tmp_table_lookup_cost(THD *thd, double row_count, uint row_size);
double get_tmp_table_write_cost(THD *thd, double row_count, uint row_size);
void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
bool sort_and_filter_keyuse(THD *thd, DYNAMIC_ARRAY *keyuse,
                            bool skip_unprefixed_keyparts);

struct st_cond_statistic
{
  Item *cond;
  Field *field_arg;
  ulong positive;
};
typedef struct st_cond_statistic COND_STATISTIC;

ulong check_selectivity(THD *thd,
                        ulong rows_to_read,
                        TABLE *table,
                        List<COND_STATISTIC> *conds);

class Pushdown_query: public Sql_alloc
{
public:
  SELECT_LEX *select_lex;
  bool store_data_in_temp_table;
  group_by_handler *handler;
  Item *having;

  Pushdown_query(SELECT_LEX *select_lex_arg, group_by_handler *handler_arg)
    : select_lex(select_lex_arg), store_data_in_temp_table(0),
    handler(handler_arg), having(0) {}

  ~Pushdown_query() { delete handler; }

  /* Function that calls the above scan functions */
  int execute(JOIN *);
};

class derived_handler;

class Pushdown_derived: public Sql_alloc
{
public:
  TABLE_LIST *derived;
  derived_handler *handler;

  Pushdown_derived(TABLE_LIST *tbl, derived_handler *h);

  int execute(); 
};


class select_handler;


bool test_if_order_compatible(SQL_I_List<ORDER> &a, SQL_I_List<ORDER> &b);
int test_if_group_changed(List<Cached_item> &list);
int create_sort_index(THD *thd, JOIN *join, JOIN_TAB *tab, Filesort *fsort);

JOIN_TAB *first_explain_order_tab(JOIN* join);
JOIN_TAB *next_explain_order_tab(JOIN* join, JOIN_TAB* tab);

bool is_eliminated_table(table_map eliminated_tables, TABLE_LIST *tbl);

bool check_simple_equality(THD *thd, const Item::Context &ctx,
                           Item *left_item, Item *right_item,
                           COND_EQUAL *cond_equal);

void propagate_new_equalities(THD *thd, Item *cond,
                              List<Item_equal> *new_equalities,
                              COND_EQUAL *inherited,
                              bool *is_simplifiable_cond);

#define PREV_BITS(type, N_BITS) ((type)my_set_bits(N_BITS))


#endif /* SQL_SELECT_INCLUDED */
server/private/sql_sequence.h000064400000012074150400264020012361 0ustar00/* Copyright (c) 2017, 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-1301  USA
*/

#ifndef SQL_SEQUENCE_INCLUDED
#define SQL_SEQUENCE_INCLUDED

#define seq_field_used_min_value 1
#define seq_field_used_max_value 2
#define seq_field_used_start     4
#define seq_field_used_increment 8
#define seq_field_used_cache     16
#define seq_field_used_cycle     32
#define seq_field_used_restart   64
#define seq_field_used_restart_value 128

/* Field position in sequence table for some fields we refer to directly */
#define NEXT_FIELD_NO 0
#define MIN_VALUE_FIELD_NO 1
#define ROUND_FIELD_NO 7

/**
   sequence_definition is used when defining a sequence as part of create
*/

class sequence_definition :public Sql_alloc
{
public:
  sequence_definition():
    min_value(1), max_value(LONGLONG_MAX-1), start(1), increment(1),
      cache(1000), round(0), restart(0), cycle(0), used_fields(0)
  {}
  longlong reserved_until;
  longlong min_value;
  longlong max_value;
  longlong start;
  longlong increment;
  longlong cache;
  ulonglong round;
  longlong restart;              // alter sequence restart value
  bool     cycle;
  uint used_fields;              // Which fields where used in CREATE

  bool check_and_adjust(bool set_reserved_until);
  void store_fields(TABLE *table);
  void read_fields(TABLE *table);
  int write_initial_sequence(TABLE *table);
  int write(TABLE *table, bool all_fields);
  /* This must be called after sequence data has been updated */
  void adjust_values(longlong next_value);
  inline void print_dbug()
  {
    DBUG_PRINT("sequence", ("reserved: %lld  start: %lld  increment: %lld  min_value: %lld  max_value: %lld  cache: %lld  round: %lld",
                      reserved_until, start, increment, min_value,
                        max_value, cache, round));
  }
protected:
  /*
    The following values are the values from sequence_definition
    merged with global auto_increment_offset and auto_increment_increment
  */
  longlong real_increment;
  longlong next_free_value;
};

/**
  SEQUENCE is in charge of managing the sequence values.
  It's also responsible to generate new values and updating the sequence
  table (engine=SQL_SEQUENCE) trough it's specialized handler interface.

  If increment is 0 then the sequence will be be using
  auto_increment_increment and auto_increment_offset variables, just like
  AUTO_INCREMENT is using.
*/

class SEQUENCE :public sequence_definition
{
public:
  enum seq_init { SEQ_UNINTIALIZED, SEQ_IN_PREPARE, SEQ_IN_ALTER,
                  SEQ_READY_TO_USE };
  SEQUENCE();
  ~SEQUENCE();
  int  read_initial_values(TABLE *table);
  int  read_stored_values(TABLE *table);
  void write_lock(TABLE *table);
  void write_unlock(TABLE *table);
  void read_lock(TABLE *table);
  void read_unlock(TABLE *table);
  void copy(sequence_definition *seq)
  {
    sequence_definition::operator= (*seq);
    adjust_values(reserved_until);
    all_values_used= 0;
  }
  longlong next_value(TABLE *table, bool second_round, int *error);
  int set_value(TABLE *table, longlong next_value, ulonglong round_arg,
                bool is_used);
  longlong increment_value(longlong value)
  {
    if (real_increment > 0)
    {
      if (value > max_value - real_increment ||
          value + real_increment > max_value)
        value= max_value + 1;
      else
        value+= real_increment;
    }
    else
    {
      if (value + real_increment < min_value ||
          value < min_value - real_increment)
        value= min_value - 1;
      else
        value+= real_increment;
    }
    return value;
  }

  bool all_values_used;
  seq_init initialized;

private:
  mysql_rwlock_t mutex;
};


/**
  Class to cache last value of NEXT VALUE from the sequence
*/

class SEQUENCE_LAST_VALUE
{
public:
  SEQUENCE_LAST_VALUE(uchar *key_arg, uint length_arg)
    :key(key_arg), length(length_arg)
  {}
  ~SEQUENCE_LAST_VALUE()
  { my_free((void*) key); }
  /* Returns 1 if table hasn't been dropped or re-created */
  bool check_version(TABLE *table);
  void set_version(TABLE *table);

  const uchar *key;
  uint length;
  bool null_value;
  longlong value;
  uchar table_version[MY_UUID_SIZE];
};


class Create_field;
extern bool prepare_sequence_fields(THD *thd, List<Create_field> *fields);
extern bool check_sequence_fields(LEX *lex, List<Create_field> *fields,
                                  const LEX_CSTRING db,
                                  const LEX_CSTRING table_name);
extern bool sequence_insert(THD *thd, LEX *lex, TABLE_LIST *table_list);
#endif /* SQL_SEQUENCE_INCLUDED */
server/private/sql_partition_admin.h000064400000013464150400264020013736 0ustar00/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_PARTITION_ADMIN_H
#define SQL_PARTITION_ADMIN_H

#ifndef WITH_PARTITION_STORAGE_ENGINE

/**
  Stub class that returns a error if the partition storage engine is
  not supported.
*/
class Sql_cmd_partition_unsupported : public Sql_cmd
{
public:
  Sql_cmd_partition_unsupported()
  {}

  ~Sql_cmd_partition_unsupported()
  {}

  /* Override SQLCOM_*, since it is an ALTER command */
  virtual enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }

  bool execute(THD *thd) override;
};


class Sql_cmd_alter_table_exchange_partition :
  public Sql_cmd_partition_unsupported
{
public:
  Sql_cmd_alter_table_exchange_partition()
  {}

  ~Sql_cmd_alter_table_exchange_partition()
  {}
};


class  Sql_cmd_alter_table_analyze_partition :
  public Sql_cmd_partition_unsupported
{
public:
  Sql_cmd_alter_table_analyze_partition()
  {}

  ~Sql_cmd_alter_table_analyze_partition()
  {}
};


class Sql_cmd_alter_table_check_partition :
  public Sql_cmd_partition_unsupported
{
public:
  Sql_cmd_alter_table_check_partition()
  {}

  ~Sql_cmd_alter_table_check_partition()
  {}
};


class Sql_cmd_alter_table_optimize_partition :
  public Sql_cmd_partition_unsupported
{
public:
  Sql_cmd_alter_table_optimize_partition()
  {}

  ~Sql_cmd_alter_table_optimize_partition()
  {}
};


class Sql_cmd_alter_table_repair_partition :
  public Sql_cmd_partition_unsupported
{
public:
  Sql_cmd_alter_table_repair_partition()
  {}

  ~Sql_cmd_alter_table_repair_partition()
  {}
};


class Sql_cmd_alter_table_truncate_partition :
  public Sql_cmd_partition_unsupported
{
public:
  Sql_cmd_alter_table_truncate_partition()
  {}

  ~Sql_cmd_alter_table_truncate_partition()
  {}
};

#else

/**
  Class that represents the ALTER TABLE t1 ANALYZE PARTITION p statement.
*/
class Sql_cmd_alter_table_exchange_partition : public Sql_cmd_common_alter_table
{
public:
  /**
    Constructor, used to represent a ALTER TABLE EXCHANGE PARTITION statement.
  */
  Sql_cmd_alter_table_exchange_partition()
    : Sql_cmd_common_alter_table()
  {}

  ~Sql_cmd_alter_table_exchange_partition() = default;

  bool execute(THD *thd) override;

private:
  bool exchange_partition(THD *thd, TABLE_LIST *, Alter_info *);
};


/**
  Class that represents the ALTER TABLE t1 ANALYZE PARTITION p statement.
*/
class Sql_cmd_alter_table_analyze_partition : public Sql_cmd_analyze_table
{
public:
  /**
    Constructor, used to represent a ALTER TABLE ANALYZE PARTITION statement.
  */
  Sql_cmd_alter_table_analyze_partition()
    : Sql_cmd_analyze_table()
  {}

  ~Sql_cmd_alter_table_analyze_partition() = default;

  bool execute(THD *thd) override;

  /* Override SQLCOM_ANALYZE, since it is an ALTER command */
  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }
};


/**
  Class that represents the ALTER TABLE t1 CHECK PARTITION p statement.
*/
class Sql_cmd_alter_table_check_partition : public Sql_cmd_check_table
{
public:
  /**
    Constructor, used to represent a ALTER TABLE CHECK PARTITION statement.
  */
  Sql_cmd_alter_table_check_partition()
    : Sql_cmd_check_table()
  {}

  ~Sql_cmd_alter_table_check_partition() = default;

  bool execute(THD *thd) override;

  /* Override SQLCOM_CHECK, since it is an ALTER command */
  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }
};


/**
  Class that represents the ALTER TABLE t1 OPTIMIZE PARTITION p statement.
*/
class Sql_cmd_alter_table_optimize_partition : public Sql_cmd_optimize_table
{
public:
  /**
    Constructor, used to represent a ALTER TABLE OPTIMIZE PARTITION statement.
  */
  Sql_cmd_alter_table_optimize_partition()
    : Sql_cmd_optimize_table()
  {}

  ~Sql_cmd_alter_table_optimize_partition() = default;

  bool execute(THD *thd) override;

  /* Override SQLCOM_OPTIMIZE, since it is an ALTER command */
  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }
};


/**
  Class that represents the ALTER TABLE t1 REPAIR PARTITION p statement.
*/
class Sql_cmd_alter_table_repair_partition : public Sql_cmd_repair_table
{
public:
  /**
    Constructor, used to represent a ALTER TABLE REPAIR PARTITION statement.
  */
  Sql_cmd_alter_table_repair_partition()
    : Sql_cmd_repair_table()
  {}

  ~Sql_cmd_alter_table_repair_partition() = default;

  bool execute(THD *thd) override;

  /* Override SQLCOM_REPAIR, since it is an ALTER command */
  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }
};


/**
  Class that represents the ALTER TABLE t1 TRUNCATE PARTITION p statement.
*/
class Sql_cmd_alter_table_truncate_partition : public Sql_cmd_truncate_table
{
public:
  /**
    Constructor, used to represent a ALTER TABLE TRUNCATE PARTITION statement.
  */
  Sql_cmd_alter_table_truncate_partition() = default;

  virtual ~Sql_cmd_alter_table_truncate_partition() = default;

  bool execute(THD *thd) override;

  /* Override SQLCOM_TRUNCATE, since it is an ALTER command */
  enum_sql_command sql_command_code() const override
  {
    return SQLCOM_ALTER_TABLE;
  }
};

#endif /* WITH_PARTITION_STORAGE_ENGINE */
#endif /* SQL_PARTITION_ADMIN_H */
server/private/welcome_copyright_notice.h000064400000002302150400264020014747 0ustar00/* Copyright (c) 2011, 2017, Oracle and/or its affiliates.
   Copyright (c) 2011, 2017, MariaDB

   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 */

#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_

#define COPYRIGHT_NOTICE_CURRENT_YEAR "2018"

/*
  This define specifies copyright notice which is displayed by every MySQL
  program on start, or on help screen.
*/
#define ORACLE_WELCOME_COPYRIGHT_NOTICE(first_year) \
  "Copyright (c) " first_year ", " COPYRIGHT_NOTICE_CURRENT_YEAR \
   ", Oracle, MariaDB Corporation Ab and others.\n"

#endif /* _welcome_copyright_notice_h_ */
server/private/event_parse_data.h000064400000005523150400264020013177 0ustar00/*
   Copyright (c) 2008, 2011, Oracle and/or its affiliates.

   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 */

#ifndef _EVENT_PARSE_DATA_H_
#define _EVENT_PARSE_DATA_H_

#include "sql_alloc.h"

class Item;
class THD;
class sp_name;

#define EVEX_GET_FIELD_FAILED   -2
#define EVEX_BAD_PARAMS         -5
#define EVEX_MICROSECOND_UNSUP  -6
#define EVEX_MAX_INTERVAL_VALUE 1000000000L

class Event_parse_data : public Sql_alloc
{
public:
  /*
    ENABLED = feature can function normally (is turned on)
    SLAVESIDE_DISABLED = feature is turned off on slave
    DISABLED = feature is turned off
  */
  enum enum_status
  {
    ENABLED = 1,
    DISABLED,
    SLAVESIDE_DISABLED  
  };

  enum enum_on_completion
  {
    /*
      On CREATE EVENT, DROP is the DEFAULT as per the docs.
      On ALTER  EVENT, "no change" is the DEFAULT.
    */
    ON_COMPLETION_DEFAULT = 0,
    ON_COMPLETION_DROP,
    ON_COMPLETION_PRESERVE
  };

  int on_completion;
  int status;
  bool status_changed;
  uint32 originator;
  /*
    do_not_create will be set if STARTS time is in the past and
    on_completion == ON_COMPLETION_DROP.
  */
  bool do_not_create;

  bool body_changed;

  LEX_CSTRING dbname;
  LEX_CSTRING name;
  LEX_CSTRING definer;// combination of user and host
  LEX_CSTRING comment;

  Item* item_starts;
  Item* item_ends;
  Item* item_execute_at;

  my_time_t starts;
  my_time_t ends;
  my_time_t execute_at;
  bool starts_null;
  bool ends_null;
  bool execute_at_null;

  sp_name *identifier;
  Item* item_expression;
  longlong expression;
  interval_type interval;

  static Event_parse_data *
  new_instance(THD *thd);

  bool
  check_parse_data(THD *thd);

  bool
  check_dates(THD *thd, int previous_on_completion);

private:

  void
  init_definer(THD *thd);

  void
  init_name(THD *thd, sp_name *spn);

  int
  init_execute_at(THD *thd);

  int
  init_interval(THD *thd);

  int
  init_starts(THD *thd);

  int
  init_ends(THD *thd);

  Event_parse_data();
  ~Event_parse_data();

  void
  report_bad_value(const char *item_name, Item *bad_item);

  void
  check_if_in_the_past(THD *thd, my_time_t ltime_utc);

  Event_parse_data(const Event_parse_data &);	/* Prevent use of these */
  void check_originator_id(THD *thd);
  void operator=(Event_parse_data &);
};
#endif
server/private/sql_locale.h000064400000005215150400264020012007 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_LOCALE_INCLUDED
#define SQL_LOCALE_INCLUDED

typedef struct my_locale_errmsgs
{
  const char *language;
  const char ***errmsgs;
} MY_LOCALE_ERRMSGS;


typedef struct st_typelib TYPELIB;

class MY_LOCALE
{
public:
  uint  number;
  const char *name;
  const char *description;
  const bool is_ascii;
  TYPELIB *month_names;
  TYPELIB *ab_month_names;
  TYPELIB *day_names;
  TYPELIB *ab_day_names;
  uint max_month_name_length;
  uint max_day_name_length;
  uint decimal_point;
  uint thousand_sep;
  const char *grouping;
  MY_LOCALE_ERRMSGS *errmsgs;
  MY_LOCALE(uint number_par,
            const char *name_par, const char *descr_par, bool is_ascii_par,
            TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
            TYPELIB *day_names_par, TYPELIB *ab_day_names_par,
            uint max_month_name_length_par, uint max_day_name_length_par,
            uint decimal_point_par, uint thousand_sep_par,
            const char *grouping_par, MY_LOCALE_ERRMSGS *errmsgs_par) :
    number(number_par),
    name(name_par), description(descr_par), is_ascii(is_ascii_par),
    month_names(month_names_par), ab_month_names(ab_month_names_par),
    day_names(day_names_par), ab_day_names(ab_day_names_par),
    max_month_name_length(max_month_name_length_par),
    max_day_name_length(max_day_name_length_par),
    decimal_point(decimal_point_par),
    thousand_sep(thousand_sep_par),
    grouping(grouping_par),
    errmsgs(errmsgs_par)
  {}
  my_repertoire_t repertoire() const
  { return is_ascii ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_EXTENDED; }
};
/* Exported variables */

extern MY_LOCALE my_locale_en_US;
extern MYSQL_PLUGIN_IMPORT MY_LOCALE *my_locales[];
extern MY_LOCALE *my_default_lc_messages;
extern MY_LOCALE *my_default_lc_time_names;

/* Exported functions */

MY_LOCALE *my_locale_by_name(const char *name);
MY_LOCALE *my_locale_by_number(uint number);
void cleanup_errmsgs(void);

#endif /* SQL_LOCALE_INCLUDED */
server/private/sql_basic_types.h000064400000022470150400264020013057 0ustar00/*
   Copyright (c) 2000, 2016, Oracle and/or its affiliates.
   Copyright (c) 2009, 2016, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */

/* File that includes common types used globally in MariaDB */

#ifndef SQL_TYPES_INCLUDED
#define SQL_TYPES_INCLUDED

typedef ulonglong sql_mode_t;
typedef int64 query_id_t;

enum enum_nullability { NOT_NULL, NULLABLE };


/*
  "fuzzydate" with strict data type control.
  Represents a mixture of *only* data type conversion flags, without rounding.
  Please keep "explicit" in constructors and conversion methods.
*/
class date_conv_mode_t
{
public:
  enum value_t
  {
    CONV_NONE=          0U,
    /*
      FUZZY_DATES is used for the result will only be used for comparison
      purposes. Conversion is as relaxed as possible.
    */
    FUZZY_DATES=        1U,
    TIME_ONLY=          4U,
    INTERVAL_hhmmssff=  8U,
    INTERVAL_DAY=      16U,
    RANGE0_LAST=       INTERVAL_DAY,
    NO_ZERO_IN_DATE=   (1UL << 23),  // MODE_NO_ZERO_IN_DATE
    NO_ZERO_DATE=      (1UL << 24),  // MODE_NO_ZERO_DATE
    INVALID_DATES=     (1UL << 25)   // MODE_INVALID_DATES
  };

  /*
    BIT-OR for all known values. Let's have a separate enum for it.
    - We don't put this value "value_t", to avoid handling it in switch().
    - We don't put this value as a static const inside the class,
      because "gdb" would display it every time when we do "print"
      for a time_round_mode_t value.
    - We can't put into into a function returning this value, because
      it's not allowed to use functions in static_assert.
  */
  enum known_values_t
  {
    KNOWN_MODES= FUZZY_DATES |
                       TIME_ONLY | INTERVAL_hhmmssff | INTERVAL_DAY |
                       NO_ZERO_IN_DATE | NO_ZERO_DATE | INVALID_DATES
  };
private:
  value_t m_mode;
public:

  // Constructors
  explicit date_conv_mode_t(ulonglong fuzzydate)
   :m_mode((value_t) fuzzydate)
  { }

  // Conversion operators
  explicit operator ulonglong() const
  {
    return m_mode;
  }
  explicit operator bool() const
  {
    return m_mode != 0;
  }

  // Unary operators
  ulonglong operator~() const
  {
    return ~m_mode;
  }

  // Dyadic bitwise operators
  date_conv_mode_t operator&(const date_conv_mode_t &other) const
  {
    return date_conv_mode_t(m_mode & other.m_mode);
  }
  date_conv_mode_t operator&(const ulonglong other) const
  {
    return date_conv_mode_t(m_mode & other);
  }

  date_conv_mode_t operator|(const date_conv_mode_t &other) const
  {
    return date_conv_mode_t(m_mode | other.m_mode);
  }

  // Dyadic bitwise assignment operators
  date_conv_mode_t &operator&=(const date_conv_mode_t &other)
  {
    m_mode= value_t(m_mode & other.m_mode);
    return *this;
  }

  date_conv_mode_t &operator|=(const date_conv_mode_t &other)
  {
    m_mode= value_t(m_mode | other.m_mode);
    return *this;
  }
};


/*
  Fractional rounding mode for temporal data types.
*/
class time_round_mode_t
{
public:
  enum value_t
  {
    /*
      Use FRAC_NONE when the value needs no rounding nor truncation,
      because it is already known not to haveany fractional digits outside
      of the requested precision.
    */
    FRAC_NONE= 0,
    FRAC_TRUNCATE= date_conv_mode_t::RANGE0_LAST << 1,  // 32
    FRAC_ROUND=    date_conv_mode_t::RANGE0_LAST << 2   // 64
  };
  // BIT-OR for all known values. See comments in time_conv_mode_t.
  enum known_values_t
  {
    KNOWN_MODES= FRAC_TRUNCATE | FRAC_ROUND
  };
private:
  value_t m_mode;
public:
  // Constructors
  explicit time_round_mode_t(ulonglong mode)
   :m_mode((value_t) mode)
  {
#ifdef MYSQL_SERVER
    DBUG_ASSERT(mode == FRAC_NONE ||
                mode == FRAC_TRUNCATE ||
                mode == FRAC_ROUND);
#endif
  }
  // Conversion operators
  explicit operator ulonglong() const
  {
    return m_mode;
  }
  value_t mode() const
  {
    return m_mode;
  }
  // Comparison operators
  bool operator==(const time_round_mode_t &other)
  {
    return m_mode == other.m_mode;
  }
};


/*
  "fuzzydate" with strict data type control.
  Used as a parameter to get_date() and represents a mixture of:
  - data type conversion flags
  - fractional second rounding flags
  Please keep "explicit" in constructors and conversion methods.
*/
class date_mode_t
{
public:
  enum value_t
  {
    CONV_NONE=         date_conv_mode_t::CONV_NONE,         // 0
    FUZZY_DATES=       date_conv_mode_t::FUZZY_DATES,       // 1
    TIME_ONLY=         date_conv_mode_t::TIME_ONLY,         // 4
    INTERVAL_hhmmssff= date_conv_mode_t::INTERVAL_hhmmssff, // 8
    INTERVAL_DAY=      date_conv_mode_t::INTERVAL_DAY,      // 16
    FRAC_TRUNCATE=     time_round_mode_t::FRAC_TRUNCATE,    // 32
    FRAC_ROUND=        time_round_mode_t::FRAC_ROUND,       // 64
    NO_ZERO_IN_DATE=   date_conv_mode_t::NO_ZERO_IN_DATE,   // (1UL << 23)
    NO_ZERO_DATE=      date_conv_mode_t::NO_ZERO_DATE,      // (1UL << 24)
    INVALID_DATES=     date_conv_mode_t::INVALID_DATES,     // (1UL << 25)
  };
protected:
  value_t m_mode;
public:

  // Constructors
  explicit date_mode_t(ulonglong fuzzydate)
   :m_mode((value_t) fuzzydate)
  { }

  // Conversion operators
  explicit operator ulonglong() const
  {
    return m_mode;
  }
  explicit operator bool() const
  {
    return m_mode != 0;
  }
  explicit operator date_conv_mode_t() const
  {
    return date_conv_mode_t(ulonglong(m_mode) & date_conv_mode_t::KNOWN_MODES);
  }
  explicit operator time_round_mode_t() const
  {
    return time_round_mode_t(ulonglong(m_mode) & time_round_mode_t::KNOWN_MODES);
  }
  // Unary operators
  ulonglong operator~() const
  {
    return ~m_mode;
  }
  bool operator!() const
  {
    return !m_mode;
  }

  // Dyadic bitwise operators
  date_mode_t operator&(const date_mode_t &other) const
  {
    return date_mode_t(m_mode & other.m_mode);
  }
  date_mode_t operator&(ulonglong other) const
  {
    return date_mode_t(m_mode & other);
  }

  date_mode_t operator|(const date_mode_t &other) const
  {
    return date_mode_t(m_mode | other.m_mode);
  }

  // Dyadic bitwise assignment operators
  date_mode_t &operator&=(const date_mode_t &other)
  {
    m_mode= value_t(m_mode & other.m_mode);
    return *this;
  }

  date_mode_t &operator|=(const date_mode_t &other)
  {
    m_mode= value_t(m_mode | other.m_mode);
    return *this;
  }

  date_mode_t &operator|=(const date_conv_mode_t &other)
  {
    m_mode= value_t(m_mode | ulonglong(other));
    return *this;
  }
};


// Bitwise OR out-of-class operators for data type mixtures
static inline date_mode_t operator|(const date_mode_t &a,
                                    const date_conv_mode_t &b)
{
  return date_mode_t(ulonglong(a) | ulonglong(b));
}

static inline date_mode_t operator|(const date_conv_mode_t &a,
                                    const time_round_mode_t &b)
{
  return date_mode_t(ulonglong(a) | ulonglong(b));
}


static inline date_mode_t operator|(const date_conv_mode_t &a,
                                    const date_mode_t &b)
{
  return date_mode_t(ulonglong(a) | ulonglong(b));
}


// Bitwise AND out-of-class operators for data type mixtures
static inline date_conv_mode_t operator&(const date_mode_t &a,
                                         const date_conv_mode_t &b)
{
  return date_conv_mode_t(ulonglong(a) & ulonglong(b));
}

static inline date_conv_mode_t operator&(const date_conv_mode_t &a,
                                         const date_mode_t &b)
{
  return date_conv_mode_t(ulonglong(a) & ulonglong(b));
}

static inline date_conv_mode_t operator&(sql_mode_t &a,
                                         const date_conv_mode_t &b)
{
  return date_conv_mode_t(a & ulonglong(b));
}


static const date_conv_mode_t
  TIME_CONV_NONE              (date_conv_mode_t::CONV_NONE),
  TIME_FUZZY_DATES            (date_conv_mode_t::FUZZY_DATES),
  TIME_TIME_ONLY              (date_conv_mode_t::TIME_ONLY),
  TIME_INTERVAL_hhmmssff      (date_conv_mode_t::INTERVAL_hhmmssff),
  TIME_INTERVAL_DAY           (date_conv_mode_t::INTERVAL_DAY),
  TIME_NO_ZERO_IN_DATE        (date_conv_mode_t::NO_ZERO_IN_DATE),
  TIME_NO_ZERO_DATE           (date_conv_mode_t::NO_ZERO_DATE),
  TIME_INVALID_DATES          (date_conv_mode_t::INVALID_DATES);

// An often used combination
static const date_conv_mode_t
  TIME_NO_ZEROS               (date_conv_mode_t::NO_ZERO_DATE|
                               date_conv_mode_t::NO_ZERO_IN_DATE);

// Flags understood by str_to_xxx, number_to_xxx, check_date
static const date_conv_mode_t
  TIME_MODE_FOR_XXX_TO_DATE   (date_mode_t::NO_ZERO_IN_DATE |
                               date_mode_t::NO_ZERO_DATE    |
                               date_mode_t::INVALID_DATES);

static const time_round_mode_t
  TIME_FRAC_NONE              (time_round_mode_t::FRAC_NONE),
  TIME_FRAC_TRUNCATE          (time_round_mode_t::FRAC_TRUNCATE),
  TIME_FRAC_ROUND             (time_round_mode_t::FRAC_ROUND);


#endif
server/private/wqueue.h000064400000003035150400264020011202 0ustar00/*
   Copyright (c) 2007, 2008, Sun Microsystems, Inc,
   Copyright (c) 2011, 2012, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef WQUEUE_INCLUDED
#define WQUEUE_INCLUDED

#include <my_pthread.h>

/* info about requests in a waiting queue */
typedef struct st_pagecache_wqueue
{
  struct st_my_thread_var *last_thread;         /* circular list of waiting
                                                   threads */
} WQUEUE;

void wqueue_link_into_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_add_and_wait(WQUEUE *wqueue,
                         struct st_my_thread_var *thread,
                         mysql_mutex_t *lock);
void wqueue_release_queue(WQUEUE *wqueue);
void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue);

#endif
server/private/sp_head.h000064400000175775150400264020011317 0ustar00/* -*- C++ -*- */
/*
   Copyright (c) 2002, 2011, Oracle and/or its affiliates.
   Copyright (c) 2020, 2022, MariaDB

   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 */

#ifndef _SP_HEAD_H_
#define _SP_HEAD_H_

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

/*
  It is necessary to include set_var.h instead of item.h because there
  are dependencies on include order for set_var.h and item.h. This
  will be resolved later.
*/
#include "sql_class.h"                          // THD, set_var.h: THD
#include "set_var.h"                            // Item
#include "sp_pcontext.h"                        // sp_pcontext
#include <stddef.h>
#include "sp.h"

/**
  @defgroup Stored_Routines Stored Routines
  @ingroup Runtime_Environment
  @{
*/

uint
sp_get_flags_for_command(LEX *lex);

class sp_instr;
class sp_instr_opt_meta;
class sp_instr_jump_if_not;

/**
  Number of PSI_statement_info instruments
  for internal stored programs statements.
*/
#ifdef HAVE_PSI_INTERFACE
void init_sp_psi_keys(void);
#endif

/*************************************************************************/

/**
  Stored_program_creation_ctx -- base class for creation context of stored
  programs (stored routines, triggers, events).
*/

class Stored_program_creation_ctx :public Default_object_creation_ctx
{
public:
  CHARSET_INFO *get_db_cl()
  {
    return m_db_cl;
  }

public:
  virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) = 0;

protected:
  Stored_program_creation_ctx(THD *thd)
    : Default_object_creation_ctx(thd),
      m_db_cl(thd->variables.collation_database)
  { }

  Stored_program_creation_ctx(CHARSET_INFO *client_cs,
                              CHARSET_INFO *connection_cl,
                              CHARSET_INFO *db_cl)
    : Default_object_creation_ctx(client_cs, connection_cl),
      m_db_cl(db_cl)
  { }

protected:
  void change_env(THD *thd) const override
  {
    thd->variables.collation_database= m_db_cl;

    Default_object_creation_ctx::change_env(thd);
  }

protected:
  /**
    db_cl stores the value of the database collation. Both character set
    and collation attributes are used.

    Database collation is included into the context because it defines the
    default collation for stored-program variables.
  */
  CHARSET_INFO *m_db_cl;
};

/*************************************************************************/

class sp_name : public Sql_alloc,
                public Database_qualified_name
{
public:
  bool       m_explicit_name;                   /**< Prepend the db name? */

  sp_name(const LEX_CSTRING *db, const LEX_CSTRING *name,
          bool use_explicit_name)
    : Database_qualified_name(db, name), m_explicit_name(use_explicit_name)
  {
    if (lower_case_table_names && m_db.length)
      m_db.length= my_casedn_str(files_charset_info, (char*) m_db.str);
  }

  /** Create temporary sp_name object from MDL key. Store in qname_buff */
  sp_name(const MDL_key *key, char *qname_buff);

  ~sp_name() = default;
};


bool
check_routine_name(const LEX_CSTRING *ident);

class sp_head :private Query_arena,
               public Database_qualified_name,
               public Sql_alloc
{
  sp_head(const sp_head &)= delete;
  void operator=(sp_head &)= delete;

protected:
  MEM_ROOT main_mem_root;
#ifdef PROTECT_STATEMENT_MEMROOT
  /*
    The following data member is wholly for debugging purpose.
    It can be used for possible crash analysis to determine how many times
    the stored routine was executed before the mem_root marked read_only
    was requested for a memory chunk. Additionally, a value of this data
    member is output to the log with DBUG_PRINT.
  */
  ulong executed_counter;
#endif
public:
  /** Possible values of m_flags */
  enum {
    HAS_RETURN= 1,              // For FUNCTIONs only: is set if has RETURN
    MULTI_RESULTS= 8,           // Is set if a procedure with SELECT(s)
    CONTAINS_DYNAMIC_SQL= 16,   // Is set if a procedure with PREPARE/EXECUTE
    IS_INVOKED= 32,             // Is set if this sp_head is being used
    HAS_SET_AUTOCOMMIT_STMT= 64,// Is set if a procedure with 'set autocommit'
    /* Is set if a procedure with COMMIT (implicit or explicit) | ROLLBACK */
    HAS_COMMIT_OR_ROLLBACK= 128,
    LOG_SLOW_STATEMENTS= 256,   // Used by events
    LOG_GENERAL_LOG= 512,        // Used by events
    HAS_SQLCOM_RESET= 1024,
    HAS_SQLCOM_FLUSH= 2048,

    /**
      Marks routines that directly (i.e. not by calling other routines)
      change tables. Note that this flag is set automatically based on
      type of statements used in the stored routine and is different
      from routine characteristic provided by user in a form of CONTAINS
      SQL, READS SQL DATA, MODIFIES SQL DATA clauses. The latter are
      accepted by parser but pretty much ignored after that.
      We don't rely on them:
      a) for compatibility reasons.
      b) because in CONTAINS SQL case they don't provide enough
      information anyway.
     */
    MODIFIES_DATA= 4096,
    /*
      Marks routines that have column type references: DECLARE a t1.a%TYPE;
    */
    HAS_COLUMN_TYPE_REFS= 8192,
    /* Set if has FETCH GROUP NEXT ROW instr. Used to ensure that only
       functions with AGGREGATE keyword use the instr. */
    HAS_AGGREGATE_INSTR= 16384
  };

  sp_package *m_parent;
  const Sp_handler *m_handler;
  uint m_flags;                 // Boolean attributes of a stored routine

  /**
    Instrumentation interface for SP.
  */
  PSI_sp_share *m_sp_share;

  Column_definition m_return_field_def; /**< This is used for FUNCTIONs only. */

  const char *m_tmp_query;	///< Temporary pointer to sub query string
private:
  /*
    Private to guarantee that m_chistics.comment is properly set to:
    - a string which is alloced on this->mem_root
    - or (NULL,0)
    set_chistics() makes sure this.
  */
  Sp_chistics m_chistics;
  void set_chistics(const st_sp_chistics &chistics);
  inline void set_chistics_agg_type(enum enum_sp_aggregate_type type)
  {
    m_chistics.agg_type= type;
  }
public:
  sql_mode_t m_sql_mode;		///< For SHOW CREATE and execution
  bool       m_explicit_name;                   /**< Prepend the db name? */
  LEX_CSTRING m_qname;		///< db.name
  LEX_CSTRING m_params;
  LEX_CSTRING m_body;
  LEX_CSTRING m_body_utf8;
  LEX_CSTRING m_defstr;
  AUTHID      m_definer;

  const st_sp_chistics &chistics() const { return m_chistics; }
  const LEX_CSTRING &comment() const { return m_chistics.comment; }
  void set_suid(enum_sp_suid_behaviour suid) { m_chistics.suid= suid; }
  enum_sp_suid_behaviour suid() const { return m_chistics.suid; }
  bool detistic() const { return m_chistics.detistic; }
  enum_sp_data_access daccess() const { return m_chistics.daccess; }
  enum_sp_aggregate_type agg_type() const { return m_chistics.agg_type; }
  /**
    Is this routine being executed?
  */
  virtual bool is_invoked() const { return m_flags & IS_INVOKED; }

  /**
    Get the value of the SP cache version, as remembered
    when the routine was inserted into the cache.
  */
  ulong sp_cache_version() const;

  /** Set the value of the SP cache version.  */
  void set_sp_cache_version(ulong version_arg) const
  {
    m_sp_cache_version= version_arg;
  }

  sp_rcontext *rcontext_create(THD *thd, Field *retval, List<Item> *args);
  sp_rcontext *rcontext_create(THD *thd, Field *retval,
                               Item **args, uint arg_count);
  sp_rcontext *rcontext_create(THD *thd, Field *retval,
                               Row_definition_list *list,
                               bool switch_security_ctx);
  bool eq_routine_spec(const sp_head *) const;
private:
  /**
    Version of the stored routine cache at the moment when the
    routine was added to it. Is used only for functions and
    procedures, not used for triggers or events.  When sp_head is
    created, its version is 0. When it's added to the cache, the
    version is assigned the global value 'Cversion'.
    If later on Cversion is incremented, we know that the routine
    is obsolete and should not be used --
    sp_cache_flush_obsolete() will purge it.
  */
  mutable ulong m_sp_cache_version;
  Stored_program_creation_ctx *m_creation_ctx;
  /**
    Boolean combination of (1<<flag), where flag is a member of
    LEX::enum_binlog_stmt_unsafe.
  */
  uint32 unsafe_flags;

public:
  inline Stored_program_creation_ctx *get_creation_ctx()
  {
    return m_creation_ctx;
  }

  inline void set_creation_ctx(Stored_program_creation_ctx *creation_ctx)
  {
    m_creation_ctx= creation_ctx->clone(mem_root);
  }

  longlong m_created;
  longlong m_modified;
  /** Recursion level of the current SP instance. The levels are numbered from 0 */
  ulong m_recursion_level;
  /**
    A list of diferent recursion level instances for the same procedure.
    For every recursion level we have a sp_head instance. This instances
    connected in the list. The list ordered by increasing recursion level
    (m_recursion_level).
  */
  sp_head *m_next_cached_sp;
  /**
    Pointer to the first element of the above list
  */
  sp_head *m_first_instance;
  /**
    Pointer to the first free (non-INVOKED) routine in the list of
    cached instances for this SP. This pointer is set only for the first
    SP in the list of instences (see above m_first_cached_sp pointer).
    The pointer equal to 0 if we have no free instances.
    For non-first instance value of this pointer meanless (point to itself);
  */
  sp_head *m_first_free_instance;
  /**
    Pointer to the last element in the list of instances of the SP.
    For non-first instance value of this pointer meanless (point to itself);
  */
  sp_head *m_last_cached_sp;
  /**
    Set containing names of stored routines used by this routine.
    Note that unlike elements of similar set for statement elements of this
    set are not linked in one list. Because of this we are able save memory
    by using for this set same objects that are used in 'sroutines' sets
    for statements of which this stored routine consists.
  */
  HASH m_sroutines;
  // Pointers set during parsing
  const char *m_param_begin;
  const char *m_param_end;

private:
  /*
    A pointer to the body start inside the cpp buffer.
    Used only during parsing. Should be removed eventually.
    The affected functions/methods should be fixed to get the cpp body start
    as a parameter, rather than through this member.
  */
  const char *m_cpp_body_begin;

public:
  /*
    Security context for stored routine which should be run under
    definer privileges.
  */
  Security_context m_security_ctx;

  /**
    List of all items (Item_trigger_field objects) representing fields in
    old/new version of row in trigger. We use this list for checking whenever
    all such fields are valid at trigger creation time and for binding these
    fields to TABLE object at table open (although for latter pointer to table
    being opened is probably enough).
  */
  SQL_I_List<Item_trigger_field> m_trg_table_fields;

protected:
  sp_head(MEM_ROOT *mem_root, sp_package *parent, const Sp_handler *handler,
          enum_sp_aggregate_type agg_type);
  virtual ~sp_head();
public:
  static void destroy(sp_head *sp);
  static sp_head *create(sp_package *parent, const Sp_handler *handler,
                         enum_sp_aggregate_type agg_type);

  /// Initialize after we have reset mem_root
  void
  init(LEX *lex);

  /** Copy sp name from parser. */
  void
  init_sp_name(const sp_name *spname);

  /** Set the body-definition start position. */
  void
  set_body_start(THD *thd, const char *cpp_body_start);

  /** Set the statement-definition (body-definition) end position. */
  void
  set_stmt_end(THD *thd, const char *cpp_body_end);

  bool
  execute_trigger(THD *thd,
                  const LEX_CSTRING *db_name,
                  const LEX_CSTRING *table_name,
                  GRANT_INFO *grant_info);

  bool
  execute_function(THD *thd, Item **args, uint argcount, Field *return_fld,
                   sp_rcontext **nctx, Query_arena *call_arena);

  bool
  execute_procedure(THD *thd, List<Item> *args);

  static void
  show_create_routine_get_fields(THD *thd, const Sp_handler *sph,
                                 List<Item> *fields);

  bool
  show_create_routine(THD *thd, const Sp_handler *sph);

  MEM_ROOT *get_main_mem_root() { return &main_mem_root; }

  int
  add_instr(sp_instr *instr);

  bool
  add_instr_jump(THD *thd, sp_pcontext *spcont);

  bool
  add_instr_jump(THD *thd, sp_pcontext *spcont, uint dest);

  bool
  add_instr_jump_forward_with_backpatch(THD *thd, sp_pcontext *spcont,
                                        sp_label *lab);
  bool
  add_instr_jump_forward_with_backpatch(THD *thd, sp_pcontext *spcont)
  {
    return add_instr_jump_forward_with_backpatch(thd, spcont,
                                                 spcont->last_label());
  }

  bool
  add_instr_freturn(THD *thd, sp_pcontext *spcont, Item *item, LEX *lex);

  bool
  add_instr_preturn(THD *thd, sp_pcontext *spcont);

  Item *adjust_assignment_source(THD *thd, Item *val, Item *val2);
  /**
    @param thd                     - the current thd
    @param spcont                  - the current parse context
    @param spv                     - the SP variable
    @param val                     - the value to be assigned to the variable
    @param lex                     - the LEX that was used to create "val"
    @param responsible_to_free_lex - if the generated sp_instr_set should
                                     free "lex".
    @retval true                   - on error
    @retval false                  - on success
  */
  bool set_local_variable(THD *thd, sp_pcontext *spcont,
                          const Sp_rcontext_handler *rh,
                          sp_variable *spv, Item *val, LEX *lex,
                          bool responsible_to_free_lex);
  bool set_local_variable_row_field(THD *thd, sp_pcontext *spcont,
                                    const Sp_rcontext_handler *rh,
                                    sp_variable *spv, uint field_idx,
                                    Item *val, LEX *lex);
  bool set_local_variable_row_field_by_name(THD *thd, sp_pcontext *spcont,
                                            const Sp_rcontext_handler *rh,
                                            sp_variable *spv,
                                            const LEX_CSTRING *field_name,
                                            Item *val, LEX *lex);
  bool check_package_routine_end_name(const LEX_CSTRING &end_name) const;
  bool check_standalone_routine_end_name(const sp_name *end_name) const;
  bool check_group_aggregate_instructions_function() const;
  bool check_group_aggregate_instructions_forbid() const;
  bool check_group_aggregate_instructions_require() const;
private:
  /**
    Generate a code to set a single cursor parameter variable.
    @param thd          - current thd, for mem_root allocations.
    @param param_spcont - the context of the parameter block
    @param idx          - the index of the parameter
    @param prm          - the actual parameter (contains information about
                          the assignment source expression Item,
                          its free list, and its LEX)
  */
  bool add_set_cursor_param_variable(THD *thd,
                                     sp_pcontext *param_spcont, uint idx,
                                     sp_assignment_lex *prm)
  {
    DBUG_ASSERT(idx < param_spcont->context_var_count());
    sp_variable *spvar= param_spcont->get_context_variable(idx);
    /*
      add_instr() gets free_list from m_thd->free_list.
      Initialize it before the set_local_variable() call.
    */
    DBUG_ASSERT(m_thd->free_list == NULL);
    m_thd->free_list= prm->get_free_list();
    if (set_local_variable(thd, param_spcont,
                           &sp_rcontext_handler_local,
                           spvar, prm->get_item(), prm, true))
      return true;
    /*
      Safety:
      The item and its free_list are now fully owned by the sp_instr_set
      instance, created by set_local_variable(). The sp_instr_set instance
      is now responsible for freeing the item and the free_list.
      Reset the "item" and the "free_list" members of "prm",
      to avoid double pointers to the same objects from "prm" and
      from the sp_instr_set instance.
    */
    prm->set_item_and_free_list(NULL, NULL);
    return false;
  }

  /**
    Generate a code to set all cursor parameter variables.
    This method is called only when parameters exists,
    and the number of formal parameters matches the number of actual
    parameters. See also comments to add_open_cursor().
  */
  bool add_set_cursor_param_variables(THD *thd, sp_pcontext *param_spcont,
                                      List<sp_assignment_lex> *parameters)
  {
    DBUG_ASSERT(param_spcont->context_var_count() == parameters->elements);
    sp_assignment_lex *prm;
    List_iterator<sp_assignment_lex> li(*parameters);
    for (uint idx= 0; (prm= li++); idx++)
    {
      if (add_set_cursor_param_variable(thd, param_spcont, idx, prm))
        return true;
    }
    return false;
  }

  /**
    Generate a code to set all cursor parameter variables for a FOR LOOP, e.g.:
      FOR index IN cursor(1,2,3)
    @param
  */
  bool add_set_for_loop_cursor_param_variables(THD *thd,
                                               sp_pcontext *param_spcont,
                                               sp_assignment_lex *param_lex,
                                               Item_args *parameters);

public:
  /**
    Generate a code for an "OPEN cursor" statement.
    @param thd          - current thd, for mem_root allocations
    @param spcont       - the context of the cursor
    @param offset       - the offset of the cursor
    @param param_spcont - the context of the cursor parameter block
    @param parameters   - the list of the OPEN actual parameters

    The caller must make sure that the number of local variables
    in "param_spcont" (formal parameters) matches the number of list elements
    in "parameters" (actual parameters).
    NULL in either of them means 0 parameters.
  */
  bool add_open_cursor(THD *thd, sp_pcontext *spcont,
                       uint offset,
                       sp_pcontext *param_spcont,
                       List<sp_assignment_lex> *parameters);

  /**
    Generate an initiation code for a CURSOR FOR LOOP, e.g.:
      FOR index IN cursor         -- cursor without parameters
      FOR index IN cursor(1,2,3)  -- cursor with parameters

    The code generated by this method does the following during SP run-time:
    - Sets all cursor parameter vartiables from "parameters"
    - Initializes the index ROW-type variable from the cursor
      (the structure is copied from the cursor to the index variable)
    - The cursor gets opened
    - The first records is fetched from the cursor to the variable "index".

    @param thd        - the current thread (for mem_root and error reporting)
    @param spcont     - the current parse context
    @param index      - the loop "index" ROW-type variable
    @param pcursor    - the cursor
    @param coffset    - the cursor offset
    @param param_lex  - the LEX that owns Items in "parameters"
    @param parameters - the cursor parameters Item array
    @retval true      - on error (EOM)
    @retval false     - on success
  */
  bool add_for_loop_open_cursor(THD *thd, sp_pcontext *spcont,
                                sp_variable *index,
                                const sp_pcursor *pcursor, uint coffset,
                                sp_assignment_lex *param_lex,
                                Item_args *parameters);
  /**
    Returns true if any substatement in the routine directly
    (not through another routine) modifies data/changes table.

    @sa Comment for MODIFIES_DATA flag.
  */
  bool modifies_data() const
  { return m_flags & MODIFIES_DATA; }

  inline uint instructions()
  { return m_instr.elements; }

  inline sp_instr *
  last_instruction()
  {
    sp_instr *i;

    get_dynamic(&m_instr, (uchar*)&i, m_instr.elements-1);
    return i;
  }

  bool replace_instr_to_nop(THD *thd, uint ip);

  /*
    Resets lex in 'thd' and keeps a copy of the old one.

    @todo Conflicting comment in sp_head.cc
  */
  bool
  reset_lex(THD *thd);

  bool
  reset_lex(THD *thd, sp_lex_local *sublex);

  /**
    Merge two LEX instances.
    @param oldlex - the upper level LEX we're going to restore to.
    @param sublex - the local lex that have just parsed some substatement.
    @returns      - false on success, true on error (e.g. failed to
                    merge the routine list or the table list).
    This method is shared by:
    - restore_lex(), when the old LEX is popped by sp_head::m_lex.pop()
    - THD::restore_from_local_lex_to_old_lex(), when the old LEX
      is stored in the caller's local variable.
  */
  bool
  merge_lex(THD *thd, LEX *oldlex, LEX *sublex);

  /**
    Restores lex in 'thd' from our copy, but keeps some status from the
    one in 'thd', like ptr, tables, fields, etc.

    @todo Conflicting comment in sp_head.cc
  */
  bool
  restore_lex(THD *thd)
  {
    DBUG_ENTER("sp_head::restore_lex");
    /*
      There is no a need to free the current thd->lex here.
      - In the majority of the cases restore_lex() is called
        on success and thd->lex does not need to be deleted.
      - In cases when restore_lex() is called on error,
        e.g. from sp_create_assignment_instr(), thd->lex is
        already linked to some sp_instr_xxx (using sp_lex_keeper).

      Note, we don't get to here in case of a syntax error
      when the current thd->lex is not yet completely
      initialized and linked. It gets automatically deleted
      by the Bison %destructor in sql_yacc.yy.
    */
    LEX *oldlex= (LEX *) m_lex.pop();
    if (!oldlex)
      DBUG_RETURN(false); // Nothing to restore
    // This restores thd->lex and thd->stmt_lex
    DBUG_RETURN(thd->restore_from_local_lex_to_old_lex(oldlex));
  }

  /**
    Iterate through the LEX stack from the top (the newest) to the bottom
    (the oldest) and find the one that contains a non-zero spname.
    @returns - the address of spname, or NULL of no spname found.
  */
  const sp_name *find_spname_recursive()
  {
    uint count= m_lex.elements;
    for (uint i= 0; i < count; i++)
    {
      const LEX *tmp= m_lex.elem(count - i - 1);
      if (tmp->spname)
        return tmp->spname;
    }
    return NULL;
  }

  /// Put the instruction on the backpatch list, associated with the label.
  int
  push_backpatch(THD *thd, sp_instr *, sp_label *);
  int
  push_backpatch_goto(THD *thd, sp_pcontext *ctx, sp_label *lab);

  /// Update all instruction with this label in the backpatch list to
  /// the current position.
  void
  backpatch(sp_label *);
  void
  backpatch_goto(THD *thd, sp_label *, sp_label *);

  /// Check for unresolved goto label
  bool
  check_unresolved_goto();

  /// Start a new cont. backpatch level. If 'i' is NULL, the level is just incr.
  int
  new_cont_backpatch(sp_instr_opt_meta *i);

  /// Add an instruction to the current level
  int
  add_cont_backpatch(sp_instr_opt_meta *i);

  /// Backpatch (and pop) the current level to the current position.
  void
  do_cont_backpatch();

  /// Add cpush instructions for all cursors declared in the current frame
  bool sp_add_instr_cpush_for_cursors(THD *thd, sp_pcontext *pcontext);

  const LEX_CSTRING *name() const
  { return &m_name; }

  char *create_string(THD *thd, ulong *lenp);

  Field *create_result_field(uint field_max_length, const LEX_CSTRING *field_name,
                             TABLE *table) const;


  /**
    Check and prepare an instance of Column_definition for field creation
    (fill all necessary attributes), for variables, parameters and
    function return values.

    @param[in]  thd          Thread handle
    @param[in]  lex          Yacc parsing context
    @param[out] field_def    An instance of create_field to be filled

    @retval false on success
    @retval true  on error
  */
  bool fill_field_definition(THD *thd, Column_definition *field_def)
  {
    const Type_handler *h= field_def->type_handler();
    return h->Column_definition_fix_attributes(field_def) ||
           field_def->sp_prepare_create_field(thd, mem_root);
  }
  bool row_fill_field_definitions(THD *thd, Row_definition_list *row)
  {
    /*
      Prepare all row fields. This will (among other things)
      - convert VARCHAR lengths from character length to octet length
      - calculate interval lengths for SET and ENUM
    */
    List_iterator<Spvar_definition> it(*row);
    for (Spvar_definition *def= it++; def; def= it++)
    {
      if (fill_spvar_definition(thd, def))
        return true;
    }
    return false;
  }
  /**
    Check and prepare a Column_definition for a variable or a parameter.
  */
  bool fill_spvar_definition(THD *thd, Column_definition *def)
  {
    if (fill_field_definition(thd, def))
      return true;
    def->pack_flag|= FIELDFLAG_MAYBE_NULL;
    return false;
  }
  bool fill_spvar_definition(THD *thd, Column_definition *def,
                             LEX_CSTRING *name)
  {
    def->field_name= *name;
    return fill_spvar_definition(thd, def);
  }

private:
  /**
    Set a column type reference for a parameter definition
  */
  void fill_spvar_using_type_reference(sp_variable *spvar,
                                       Qualified_column_ident *ref)
  {
    spvar->field_def.set_column_type_ref(ref);
    spvar->field_def.field_name= spvar->name;
    m_flags|= sp_head::HAS_COLUMN_TYPE_REFS;
  }

  void fill_spvar_using_table_rowtype_reference(THD *thd,
                                                sp_variable *spvar,
                                                Table_ident *ref)
  {
    spvar->field_def.set_table_rowtype_ref(ref);
    spvar->field_def.field_name= spvar->name;
    fill_spvar_definition(thd, &spvar->field_def);
    m_flags|= sp_head::HAS_COLUMN_TYPE_REFS;
  }

public:
  bool spvar_fill_row(THD *thd, sp_variable *spvar, Row_definition_list *def);
  bool spvar_fill_type_reference(THD *thd, sp_variable *spvar,
                                 const LEX_CSTRING &table,
                                 const LEX_CSTRING &column);
  bool spvar_fill_type_reference(THD *thd, sp_variable *spvar,
                                 const LEX_CSTRING &db,
                                 const LEX_CSTRING &table,
                                 const LEX_CSTRING &column);
  bool spvar_fill_table_rowtype_reference(THD *thd, sp_variable *spvar,
                                          const LEX_CSTRING &table);
  bool spvar_fill_table_rowtype_reference(THD *thd, sp_variable *spvar,
                                          const LEX_CSTRING &db,
                                          const LEX_CSTRING &table);

  void set_c_chistics(const st_sp_chistics &chistics);
  void set_info(longlong created, longlong modified,
		const st_sp_chistics &chistics, sql_mode_t sql_mode);

  void set_definer(const char *definer, size_t definerlen)
  {
    AUTHID tmp;
    tmp.parse(definer, definerlen);
    m_definer.copy(mem_root, &tmp.user, &tmp.host);
  }
  void set_definer(const LEX_CSTRING *user_name, const LEX_CSTRING *host_name)
  {
    m_definer.copy(mem_root, user_name, host_name);
  }

  void reset_thd_mem_root(THD *thd);

  void restore_thd_mem_root(THD *thd);

  /**
    Optimize the code.
  */
  void optimize();

  /**
    Helper used during flow analysis during code optimization.
    See the implementation of <code>opt_mark()</code>.
    @param ip the instruction to add to the leads list
    @param leads the list of remaining paths to explore in the graph that
    represents the code, during flow analysis.
  */
  void add_mark_lead(uint ip, List<sp_instr> *leads);

  inline sp_instr *
  get_instr(uint i)
  {
    sp_instr *ip;

    if (i < m_instr.elements)
      get_dynamic(&m_instr, (uchar*)&ip, i);
    else
      ip= NULL;
    return ip;
  }

#ifdef PROTECT_STATEMENT_MEMROOT
  int has_all_instrs_executed();
  void reset_instrs_executed_counter();
#endif

  /* Add tables used by routine to the table list. */
  bool add_used_tables_to_table_list(THD *thd,
                                     TABLE_LIST ***query_tables_last_ptr,
                                     TABLE_LIST *belong_to_view);

  /**
    Check if this stored routine contains statements disallowed
    in a stored function or trigger, and set an appropriate error message
    if this is the case.
  */
  bool is_not_allowed_in_function(const char *where)
  {
    if (m_flags & CONTAINS_DYNAMIC_SQL)
      my_error(ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0), "Dynamic SQL");
    else if (m_flags & MULTI_RESULTS)
      my_error(ER_SP_NO_RETSET, MYF(0), where);
    else if (m_flags & HAS_SET_AUTOCOMMIT_STMT)
      my_error(ER_SP_CANT_SET_AUTOCOMMIT, MYF(0));
    else if (m_flags & HAS_COMMIT_OR_ROLLBACK)
      my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
    else if (m_flags & HAS_SQLCOM_RESET)
      my_error(ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0), "RESET");
    else if (m_flags & HAS_SQLCOM_FLUSH)
      my_error(ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0), "FLUSH");

    return MY_TEST(m_flags &
                  (CONTAINS_DYNAMIC_SQL | MULTI_RESULTS |
                   HAS_SET_AUTOCOMMIT_STMT | HAS_COMMIT_OR_ROLLBACK |
                   HAS_SQLCOM_RESET | HAS_SQLCOM_FLUSH));
  }

#ifndef DBUG_OFF
  int show_routine_code(THD *thd);
#endif

  /*
    This method is intended for attributes of a routine which need
    to propagate upwards to the Query_tables_list of the caller (when
    a property of a sp_head needs to "taint" the calling statement).
  */
  void propagate_attributes(Query_tables_list *prelocking_ctx)
  {
    DBUG_ENTER("sp_head::propagate_attributes");
    /*
      If this routine needs row-based binary logging, the entire top statement
      too (we cannot switch from statement-based to row-based only for this
      routine, as in statement-based the top-statement may be binlogged and
      the substatements not).
    */
    DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x",
                        prelocking_ctx->get_stmt_unsafe_flags()));
    DBUG_PRINT("info", ("sp_head(%p=%s)->unsafe_flags: 0x%x",
                        this, name()->str, unsafe_flags));
    prelocking_ctx->set_stmt_unsafe_flags(unsafe_flags);
    DBUG_VOID_RETURN;
  }

  sp_pcontext *get_parse_context() { return m_pcont; }

  /*
    Check EXECUTE access:
    - in case of a standalone rotuine, for the routine itself
    - in case of a package routine, for the owner package body
  */
  bool check_execute_access(THD *thd) const;

  virtual sp_package *get_package()
  {
    return NULL;
  }

  virtual void init_psi_share();

protected:

  MEM_ROOT *m_thd_root;		///< Temp. store for thd's mem_root
  THD *m_thd;			///< Set if we have reset mem_root

  sp_pcontext *m_pcont;		///< Parse context
  List<LEX> m_lex;		///< Temp. store for the other lex
  DYNAMIC_ARRAY m_instr;	///< The "instructions"

  enum backpatch_instr_type { GOTO, CPOP, HPOP };
  typedef struct
  {
    sp_label *lab;
    sp_instr *instr;
    backpatch_instr_type instr_type;
  } bp_t;
  List<bp_t> m_backpatch;	///< Instructions needing backpatching
  List<bp_t> m_backpatch_goto; // Instructions needing backpatching (for goto)

  /**
    We need a special list for backpatching of instructions with a continue
    destination (in the case of a continue handler catching an error in
    the test), since it would otherwise interfere with the normal backpatch
    mechanism - e.g. jump_if_not instructions have two different destinations
    which are to be patched differently.
    Since these occur in a more restricted way (always the same "level" in
    the code), we don't need the label.
  */
  List<sp_instr_opt_meta> m_cont_backpatch;
  uint m_cont_level;            // The current cont. backpatch level

  /**
    Multi-set representing optimized list of tables to be locked by this
    routine. Does not include tables which are used by invoked routines.

    @note
    For prelocking-free SPs this multiset is constructed too.
    We do so because the same instance of sp_head may be called both
    in prelocked mode and in non-prelocked mode.
  */
  HASH m_sptabs;

  bool
  execute(THD *thd, bool merge_da_on_success);

  /**
    Perform a forward flow analysis in the generated code.
    Mark reachable instructions, for the optimizer.
  */
  void opt_mark();

  /**
    Merge the list of tables used by query into the multi-set of tables used
    by routine.
  */
  bool merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check);

  /// Put the instruction on the a backpatch list, associated with the label.
  int
  push_backpatch(THD *thd, sp_instr *, sp_label *, List<bp_t> *list,
                 backpatch_instr_type itype);

}; // class sp_head : public Sql_alloc


class sp_package: public sp_head
{
  bool validate_public_routines(THD *thd, sp_package *spec);
  bool validate_private_routines(THD *thd);
public:
  class LexList: public List<LEX>
  {
  public:
    LexList() { elements= 0; }
    // Find a package routine by a non qualified name
    LEX *find(const LEX_CSTRING &name, enum_sp_type type);
    // Find a package routine by a package-qualified name, e.g. 'pkg.proc'
    LEX *find_qualified(const LEX_CSTRING &name, enum_sp_type type);
    // Check if a routine with the given qualified name already exists
    bool check_dup_qualified(const LEX_CSTRING &name, const Sp_handler *sph)
    {
      if (!find_qualified(name, sph->type()))
        return false;
      my_error(ER_SP_ALREADY_EXISTS, MYF(0), sph->type_str(), name.str);
      return true;
    }
    bool check_dup_qualified(const sp_head *sp)
    {
      return check_dup_qualified(sp->m_name, sp->m_handler);
    }
    void cleanup();
  };
  /*
    The LEX for a new package subroutine is initially assigned to
    m_current_routine. After scanning parameters, return type and chistics,
    the parser detects if we have a declaration or a definition, e.g.:
         PROCEDURE p1(a INT);
      vs
         PROCEDURE p1(a INT) AS BEGIN NULL; END;
    (i.e. either semicolon or the "AS" keyword)
    m_current_routine is then added either to m_routine_implementations,
    or m_routine_declarations, and then m_current_routine is set to NULL.
  */
  LEX *m_current_routine;
  LexList m_routine_implementations;
  LexList m_routine_declarations;

  LEX *m_top_level_lex;
  sp_rcontext *m_rcontext;
  uint m_invoked_subroutine_count;
  bool m_is_instantiated;
  bool m_is_cloning_routine;

private:
  sp_package(MEM_ROOT *mem_root,
             LEX *top_level_lex,
             const sp_name *name,
             const Sp_handler *sph);
  ~sp_package();
public:
  static sp_package *create(LEX *top_level_lex, const sp_name *name,
                            const Sp_handler *sph);

  bool add_routine_declaration(LEX *lex)
  {
    return m_routine_declarations.check_dup_qualified(lex->sphead) ||
           m_routine_declarations.push_back(lex, &main_mem_root);
  }
  bool add_routine_implementation(LEX *lex)
  {
    return m_routine_implementations.check_dup_qualified(lex->sphead) ||
           m_routine_implementations.push_back(lex, &main_mem_root);
  }
  sp_package *get_package() override { return this; }
  void init_psi_share() override;
  bool is_invoked() const override
  {
    /*
      Cannot flush a package out of the SP cache when:
      - its initialization block is running
      - one of its subroutine is running
    */
    return sp_head::is_invoked() || m_invoked_subroutine_count > 0;
  }
  sp_variable *find_package_variable(const LEX_CSTRING *name) const
  {
    /*
      sp_head::m_pcont is a special level for routine parameters.
      Variables declared inside CREATE PACKAGE BODY reside in m_children.at(0).
    */
    sp_pcontext *ctx= m_pcont->child_context(0);
    return ctx ? ctx->find_variable(name, true) : NULL;
  }
  bool validate_after_parser(THD *thd);
  bool instantiate_if_needed(THD *thd);
};


class sp_lex_cursor: public sp_lex_local, public Query_arena
{
public:
  sp_lex_cursor(THD *thd, const LEX *oldlex, MEM_ROOT *mem_root_arg)
   :sp_lex_local(thd, oldlex),
    Query_arena(mem_root_arg, STMT_INITIALIZED_FOR_SP)
  { }
  sp_lex_cursor(THD *thd, const LEX *oldlex)
   :sp_lex_local(thd, oldlex),
    Query_arena(thd->lex->sphead->get_main_mem_root(), STMT_INITIALIZED_FOR_SP)
  { }
  ~sp_lex_cursor() { free_items(); }
  bool cleanup_stmt(bool /*restore_set_statement_vars*/) override
  { return false; }
  Query_arena *query_arena() override { return this; }
  bool validate()
  {
    DBUG_ASSERT(sql_command == SQLCOM_SELECT);
    if (result)
    {
      my_error(ER_SP_BAD_CURSOR_SELECT, MYF(0));
      return true;
    }
    return false;
  }
  bool stmt_finalize(THD *thd)
  {
    if (validate())
      return true;
    sp_lex_in_use= true;
    free_list= thd->free_list;
    thd->free_list= NULL;
    return false;
  }
};


//
// "Instructions"...
//

class sp_instr :public Query_arena, public Sql_alloc
{
  sp_instr(const sp_instr &);	/**< Prevent use of these */
  void operator=(sp_instr &);

public:

  uint marked;
  uint m_ip;			///< My index
  sp_pcontext *m_ctx;		///< My parse context
  uint m_lineno;

  /// Should give each a name or type code for debugging purposes?
  sp_instr(uint ip, sp_pcontext *ctx)
    :Query_arena(0, STMT_INITIALIZED_FOR_SP), marked(0), m_ip(ip), m_ctx(ctx)
#ifdef PROTECT_STATEMENT_MEMROOT
  , m_has_been_run(NON_RUN)
#endif
  {}

  virtual ~sp_instr()
  { free_items(); }


  /**
    Execute this instruction

   
    @param thd         Thread handle
    @param[out] nextp  index of the next instruction to execute. (For most
                       instructions this will be the instruction following this
                       one). Note that this parameter is undefined in case of
                       errors, use get_cont_dest() to find the continuation
                       instruction for CONTINUE error handlers.
   
    @retval 0      on success, 
    @retval other  if some error occurred
  */

  virtual int execute(THD *thd, uint *nextp) = 0;

  /**
    Execute <code>open_and_lock_tables()</code> for this statement.
    Open and lock the tables used by this statement, as a pre-requisite
    to execute the core logic of this instruction with
    <code>exec_core()</code>.
    @param thd the current thread
    @param tables the list of tables to open and lock
    @return zero on success, non zero on failure.
  */
  int exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables);

  /**
    Get the continuation destination of this instruction.
    @return the continuation destination
  */
  virtual uint get_cont_dest() const;

  /*
    Execute core function of instruction after all preparations (e.g.
    setting of proper LEX, saving part of the thread context have been
    done).

    Should be implemented for instructions using expressions or whole
    statements (thus having to have own LEX). Used in concert with
    sp_lex_keeper class and its descendants (there are none currently).
  */
  virtual int exec_core(THD *thd, uint *nextp);

  virtual void print(String *str) = 0;

  virtual void backpatch(uint dest, sp_pcontext *dst_ctx)
  {}

  /**
    Mark this instruction as reachable during optimization and return the
    index to the next instruction. Jump instruction will add their
    destination to the leads list.
  */
  virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads)
  {
    marked= 1;
    return m_ip+1;
  }

  /**
    Short-cut jumps to jumps during optimization. This is used by the
    jump instructions' opt_mark() methods. 'start' is the starting point,
    used to prevent the mark sweep from looping for ever. Return the
    end destination.
  */
  virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start)
  {
    return m_ip;
  }

  /**
    Inform the instruction that it has been moved during optimization.
    Most instructions will simply update its index, but jump instructions
    must also take care of their destination pointers. Forward jumps get
    pushed to the backpatch list 'ibp'.
  */
  virtual void opt_move(uint dst, List<sp_instr> *ibp)
  {
    m_ip= dst;
  }
  virtual PSI_statement_info* get_psi_info() = 0;

#ifdef PROTECT_STATEMENT_MEMROOT
  bool has_been_run() const
  {
    return m_has_been_run == RUN;
  }

  void mark_as_qc_used()
  {
    m_has_been_run= QC;
  }

  void mark_as_run()
  {
    if (m_has_been_run == QC)
      m_has_been_run= NON_RUN; // answer was from WC => not really executed
    else
      m_has_been_run= RUN;
  }

  void mark_as_not_run()
  {
    m_has_been_run= NON_RUN;
  }

private:
  enum {NON_RUN, QC, RUN} m_has_been_run;
#endif
}; // class sp_instr : public Sql_alloc


/**
  Auxilary class to which instructions delegate responsibility
  for handling LEX and preparations before executing statement
  or calculating complex expression.

  Exist mainly to avoid having double hierarchy between instruction
  classes.

  @todo
    Add ability to not store LEX and do any preparations if
    expression used is simple.
*/

class sp_lex_keeper
{
  /** Prevent use of these */
  sp_lex_keeper(const sp_lex_keeper &);
  void operator=(sp_lex_keeper &);
public:

  sp_lex_keeper(LEX *lex, bool lex_resp)
    : m_lex(lex), m_lex_resp(lex_resp), 
      lex_query_tables_own_last(NULL)
  {
    lex->sp_lex_in_use= TRUE;
  }
  virtual ~sp_lex_keeper();

  /**
    Prepare execution of instruction using LEX, if requested check whenever
    we have read access to tables used and open/lock them, call instruction's
    exec_core() method, perform cleanup afterwards.
   
    @todo Conflicting comment in sp_head.cc
  */
  int reset_lex_and_exec_core(THD *thd, uint *nextp, bool open_tables,
                              sp_instr* instr);

  int cursor_reset_lex_and_exec_core(THD *thd, uint *nextp, bool open_tables,
                                     sp_instr *instr);

  inline uint sql_command() const
  {
    return (uint)m_lex->sql_command;
  }

  void disable_query_cache()
  {
    m_lex->safe_to_cache_query= 0;
  }

private:

  LEX *m_lex;
  /**
    Indicates whenever this sp_lex_keeper instance responsible
    for LEX deletion.
  */
  bool m_lex_resp;

  /*
    Support for being able to execute this statement in two modes:
    a) inside prelocked mode set by the calling procedure or its ancestor.
    b) outside of prelocked mode, when this statement enters/leaves
       prelocked mode itself.
  */
  
  /**
    List of additional tables this statement needs to lock when it
    enters/leaves prelocked mode on its own.
  */
  TABLE_LIST *prelocking_tables;

  /**
    The value m_lex->query_tables_own_last should be set to this when the
    statement enters/leaves prelocked mode on its own.
  */
  TABLE_LIST **lex_query_tables_own_last;
};


/**
  Call out to some prepared SQL statement.
*/
class sp_instr_stmt : public sp_instr
{
  sp_instr_stmt(const sp_instr_stmt &);	/**< Prevent use of these */
  void operator=(sp_instr_stmt &);

public:

  LEX_STRING m_query;		///< For thd->query

  sp_instr_stmt(uint ip, sp_pcontext *ctx, LEX *lex)
    : sp_instr(ip, ctx), m_lex_keeper(lex, TRUE)
  {
    m_query.str= 0;
    m_query.length= 0;
  }

  virtual ~sp_instr_stmt() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

private:

  sp_lex_keeper m_lex_keeper;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;

}; // class sp_instr_stmt : public sp_instr


class sp_instr_set : public sp_instr
{
  sp_instr_set(const sp_instr_set &);	/**< Prevent use of these */
  void operator=(sp_instr_set &);

public:

  sp_instr_set(uint ip, sp_pcontext *ctx,
               const Sp_rcontext_handler *rh,
	       uint offset, Item *val,
               LEX *lex, bool lex_resp)
    : sp_instr(ip, ctx),
      m_rcontext_handler(rh), m_offset(offset), m_value(val),
      m_lex_keeper(lex, lex_resp)
  {}

  virtual ~sp_instr_set() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

protected:
  sp_rcontext *get_rcontext(THD *thd) const;
  const Sp_rcontext_handler *m_rcontext_handler;
  uint m_offset;		///< Frame offset
  Item *m_value;
  sp_lex_keeper m_lex_keeper;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_set : public sp_instr


/*
  This class handles assignments of a ROW fields:
    DECLARE rec ROW (a INT,b INT);
    SET rec.a= 10;
*/
class sp_instr_set_row_field : public sp_instr_set
{
  sp_instr_set_row_field(const sp_instr_set_row_field &); // Prevent use of this
  void operator=(sp_instr_set_row_field &);
  uint m_field_offset;

public:

  sp_instr_set_row_field(uint ip, sp_pcontext *ctx,
                         const Sp_rcontext_handler *rh,
                         uint offset, uint field_offset,
                         Item *val,
                         LEX *lex, bool lex_resp)
    : sp_instr_set(ip, ctx, rh, offset, val, lex, lex_resp),
      m_field_offset(field_offset)
  {}

  virtual ~sp_instr_set_row_field() = default;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;
}; // class sp_instr_set_field : public sp_instr_set


/**
  This class handles assignment instructions like this:
  DECLARE
    CURSOR cur IS SELECT * FROM t1;
    rec cur%ROWTYPE;
  BEGIN
    rec.column1:= 10; -- This instruction
  END;

  The idea is that during sp_rcontext::create() we do not know the extact
  structure of "rec". It gets resolved at run time, during the corresponding
  sp_instr_cursor_copy_struct::exec_core().

  So sp_instr_set_row_field_by_name searches for ROW fields by name,
  while sp_instr_set_row_field (see above) searches for ROW fields by index.
*/
class sp_instr_set_row_field_by_name : public sp_instr_set
{
  // Prevent use of this
  sp_instr_set_row_field_by_name(const sp_instr_set_row_field &);
  void operator=(sp_instr_set_row_field_by_name &);
  const LEX_CSTRING m_field_name;

public:

  sp_instr_set_row_field_by_name(uint ip, sp_pcontext *ctx,
                                 const Sp_rcontext_handler *rh,
                                 uint offset, const LEX_CSTRING &field_name,
                                 Item *val,
                                 LEX *lex, bool lex_resp)
    : sp_instr_set(ip, ctx, rh, offset, val, lex, lex_resp),
      m_field_name(field_name)
  {}

  virtual ~sp_instr_set_row_field_by_name() = default;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;
}; // class sp_instr_set_field_by_name : public sp_instr_set


/**
  Set NEW/OLD row field value instruction. Used in triggers.
*/
class sp_instr_set_trigger_field : public sp_instr
{
  sp_instr_set_trigger_field(const sp_instr_set_trigger_field &);
  void operator=(sp_instr_set_trigger_field &);

public:

  sp_instr_set_trigger_field(uint ip, sp_pcontext *ctx,
                             Item_trigger_field *trg_fld,
                             Item *val, LEX *lex)
    : sp_instr(ip, ctx),
      trigger_field(trg_fld),
      value(val), m_lex_keeper(lex, TRUE)
  {}

  virtual ~sp_instr_set_trigger_field() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

private:
  Item_trigger_field *trigger_field;
  Item *value;
  sp_lex_keeper m_lex_keeper;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_trigger_field : public sp_instr


/**
  An abstract class for all instructions with destinations that
  needs to be updated by the optimizer.

  Even if not all subclasses will use both the normal destination and
  the continuation destination, we put them both here for simplicity.
*/
class sp_instr_opt_meta : public sp_instr
{
public:

  uint m_dest;			///< Where we will go
  uint m_cont_dest;             ///< Where continue handlers will go

  sp_instr_opt_meta(uint ip, sp_pcontext *ctx)
    : sp_instr(ip, ctx),
      m_dest(0), m_cont_dest(0), m_optdest(0), m_cont_optdest(0)
  {}

  sp_instr_opt_meta(uint ip, sp_pcontext *ctx, uint dest)
    : sp_instr(ip, ctx),
      m_dest(dest), m_cont_dest(0), m_optdest(0), m_cont_optdest(0)
  {}

  virtual ~sp_instr_opt_meta() = default;

  virtual void set_destination(uint old_dest, uint new_dest)
    = 0;

  uint get_cont_dest() const override;

protected:

  sp_instr *m_optdest;		///< Used during optimization
  sp_instr *m_cont_optdest;     ///< Used during optimization

}; // class sp_instr_opt_meta : public sp_instr

class sp_instr_jump : public sp_instr_opt_meta
{
  sp_instr_jump(const sp_instr_jump &);	/**< Prevent use of these */
  void operator=(sp_instr_jump &);

public:

  sp_instr_jump(uint ip, sp_pcontext *ctx)
    : sp_instr_opt_meta(ip, ctx)
  {}

  sp_instr_jump(uint ip, sp_pcontext *ctx, uint dest)
    : sp_instr_opt_meta(ip, ctx, dest)
  {}

  virtual ~sp_instr_jump() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override;

  uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override;

  void opt_move(uint dst, List<sp_instr> *ibp) override;

  void backpatch(uint dest, sp_pcontext *dst_ctx) override
  {
    /* Calling backpatch twice is a logic flaw in jump resolution. */
    DBUG_ASSERT(m_dest == 0);
    m_dest= dest;
  }

  /**
    Update the destination; used by the optimizer.
  */
  void set_destination(uint old_dest, uint new_dest) override
  {
    if (m_dest == old_dest)
      m_dest= new_dest;
  }

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_jump : public sp_instr_opt_meta


class sp_instr_jump_if_not : public sp_instr_jump
{
  sp_instr_jump_if_not(const sp_instr_jump_if_not &); /**< Prevent use of these */
  void operator=(sp_instr_jump_if_not &);

public:

  sp_instr_jump_if_not(uint ip, sp_pcontext *ctx, Item *i, LEX *lex)
    : sp_instr_jump(ip, ctx), m_expr(i),
      m_lex_keeper(lex, TRUE)
  {}

  sp_instr_jump_if_not(uint ip, sp_pcontext *ctx, Item *i, uint dest, LEX *lex)
    : sp_instr_jump(ip, ctx, dest), m_expr(i),
      m_lex_keeper(lex, TRUE)
  {}

  virtual ~sp_instr_jump_if_not() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override;

  /** Override sp_instr_jump's shortcut; we stop here */
  uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
  {
    return m_ip;
  }

  void opt_move(uint dst, List<sp_instr> *ibp) override;

  void set_destination(uint old_dest, uint new_dest) override
  {
    sp_instr_jump::set_destination(old_dest, new_dest);
    if (m_cont_dest == old_dest)
      m_cont_dest= new_dest;
  }

private:

  Item *m_expr;			///< The condition
  sp_lex_keeper m_lex_keeper;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_jump_if_not : public sp_instr_jump


class sp_instr_preturn : public sp_instr
{
  sp_instr_preturn(const sp_instr_preturn &);	/**< Prevent use of these */
  void operator=(sp_instr_preturn &);

public:

  sp_instr_preturn(uint ip, sp_pcontext *ctx)
    : sp_instr(ip, ctx)
  {}

  virtual ~sp_instr_preturn() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override
  {
    marked= 1;
    return UINT_MAX;
  }

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_preturn : public sp_instr


class sp_instr_freturn : public sp_instr
{
  sp_instr_freturn(const sp_instr_freturn &);	/**< Prevent use of these */
  void operator=(sp_instr_freturn &);

public:

  sp_instr_freturn(uint ip, sp_pcontext *ctx,
		   Item *val, const Type_handler *handler, LEX *lex)
    : sp_instr(ip, ctx), m_value(val), m_type_handler(handler),
      m_lex_keeper(lex, TRUE)
  {}

  virtual ~sp_instr_freturn() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override
  {
    marked= 1;
    return UINT_MAX;
  }

protected:

  Item *m_value;
  const Type_handler *m_type_handler;
  sp_lex_keeper m_lex_keeper;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_freturn : public sp_instr


class sp_instr_hpush_jump : public sp_instr_jump
{
  sp_instr_hpush_jump(const sp_instr_hpush_jump &); /**< Prevent use of these */
  void operator=(sp_instr_hpush_jump &);

public:

  sp_instr_hpush_jump(uint ip,
                      sp_pcontext *ctx,
                      sp_handler *handler)
   :sp_instr_jump(ip, ctx),
    m_handler(handler),
    m_opt_hpop(0),
    m_frame(ctx->current_var_count())
  {
    DBUG_ASSERT(m_handler->condition_values.elements == 0);
  }

  virtual ~sp_instr_hpush_jump()
  {
    m_handler->condition_values.empty();
    m_handler= NULL;
  }

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override;

  /** Override sp_instr_jump's shortcut; we stop here. */
  uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
  {
    return m_ip;
  }

  void backpatch(uint dest, sp_pcontext *dst_ctx) override
  {
    DBUG_ASSERT(!m_dest || !m_opt_hpop);
    if (!m_dest)
      m_dest= dest;
    else
      m_opt_hpop= dest;
  }

  void add_condition(sp_condition_value *condition_value)
  { m_handler->condition_values.push_back(condition_value); }

  sp_handler *get_handler()
  { return m_handler; }

private:
  /// Handler.
  sp_handler *m_handler;

  /// hpop marking end of handler scope.
  uint m_opt_hpop;

  // This attribute is needed for SHOW PROCEDURE CODE only (i.e. it's needed in
  // debug version only). It's used in print().
  uint m_frame;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_hpush_jump : public sp_instr_jump


class sp_instr_hpop : public sp_instr
{
  sp_instr_hpop(const sp_instr_hpop &);	/**< Prevent use of these */
  void operator=(sp_instr_hpop &);

public:

  sp_instr_hpop(uint ip, sp_pcontext *ctx, uint count)
    : sp_instr(ip, ctx), m_count(count)
  {}

  virtual ~sp_instr_hpop() = default;

  void update_count(uint count)
  {
    m_count= count;
  }

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

private:

  uint m_count;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_hpop : public sp_instr


class sp_instr_hreturn : public sp_instr_jump
{
  sp_instr_hreturn(const sp_instr_hreturn &);	/**< Prevent use of these */
  void operator=(sp_instr_hreturn &);

public:

  sp_instr_hreturn(uint ip, sp_pcontext *ctx)
   :sp_instr_jump(ip, ctx),
    m_frame(ctx->current_var_count())
  {}

  virtual ~sp_instr_hreturn() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  /* This instruction will not be short cut optimized. */
  uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
  {
    return m_ip;
  }

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override;

private:

  uint m_frame;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_hreturn : public sp_instr_jump


/** This is DECLARE CURSOR */
class sp_instr_cpush : public sp_instr, public sp_cursor
{
  sp_instr_cpush(const sp_instr_cpush &); /**< Prevent use of these */
  void operator=(sp_instr_cpush &);

public:

  sp_instr_cpush(uint ip, sp_pcontext *ctx, LEX *lex, uint offset)
    : sp_instr(ip, ctx), m_lex_keeper(lex, TRUE), m_cursor(offset)
  {}

  virtual ~sp_instr_cpush() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  /**
    This call is used to cleanup the instruction when a sensitive
    cursor is closed. For now stored procedures always use materialized
    cursors and the call is not used.
  */
  bool cleanup_stmt(bool /*restore_set_statement_vars*/) override
  { return false; }
private:

  sp_lex_keeper m_lex_keeper;
  uint m_cursor;                /**< Frame offset (for debugging) */

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_cpush : public sp_instr


class sp_instr_cpop : public sp_instr
{
  sp_instr_cpop(const sp_instr_cpop &); /**< Prevent use of these */
  void operator=(sp_instr_cpop &);

public:

  sp_instr_cpop(uint ip, sp_pcontext *ctx, uint count)
    : sp_instr(ip, ctx), m_count(count)
  {}

  virtual ~sp_instr_cpop() = default;

  void update_count(uint count)
  {
    m_count= count;
  }

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

private:

  uint m_count;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_cpop : public sp_instr


class sp_instr_copen : public sp_instr
{
  sp_instr_copen(const sp_instr_copen &); /**< Prevent use of these */
  void operator=(sp_instr_copen &);

public:

  sp_instr_copen(uint ip, sp_pcontext *ctx, uint c)
    : sp_instr(ip, ctx), m_cursor(c)
  {}

  virtual ~sp_instr_copen() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

private:

  uint m_cursor;		///< Stack index

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_copen : public sp_instr_stmt


/**
  Initialize the structure of a cursor%ROWTYPE variable
  from the LEX containing the cursor SELECT statement.
*/
class sp_instr_cursor_copy_struct: public sp_instr
{
  /**< Prevent use of these */
  sp_instr_cursor_copy_struct(const sp_instr_cursor_copy_struct &);
  void operator=(sp_instr_cursor_copy_struct &);
  sp_lex_keeper m_lex_keeper;
  uint m_cursor;
  uint m_var;
public:
  sp_instr_cursor_copy_struct(uint ip, sp_pcontext *ctx, uint coffs,
                              sp_lex_cursor *lex, uint voffs)
    : sp_instr(ip, ctx), m_lex_keeper(lex, FALSE),
      m_cursor(coffs),
      m_var(voffs)
  {}
  virtual ~sp_instr_cursor_copy_struct() = default;
  int execute(THD *thd, uint *nextp) override;
  int exec_core(THD *thd, uint *nextp) override;
  void print(String *str) override;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
};


class sp_instr_cclose : public sp_instr
{
  sp_instr_cclose(const sp_instr_cclose &); /**< Prevent use of these */
  void operator=(sp_instr_cclose &);

public:

  sp_instr_cclose(uint ip, sp_pcontext *ctx, uint c)
    : sp_instr(ip, ctx), m_cursor(c)
  {}

  virtual ~sp_instr_cclose() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

private:

  uint m_cursor;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_cclose : public sp_instr


class sp_instr_cfetch : public sp_instr
{
  sp_instr_cfetch(const sp_instr_cfetch &); /**< Prevent use of these */
  void operator=(sp_instr_cfetch &);

public:

  sp_instr_cfetch(uint ip, sp_pcontext *ctx, uint c, bool error_on_no_data)
    : sp_instr(ip, ctx), m_cursor(c), m_error_on_no_data(error_on_no_data)
  {
    m_varlist.empty();
  }

  virtual ~sp_instr_cfetch() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  void add_to_varlist(sp_variable *var)
  {
    m_varlist.push_back(var);
  }

private:

  uint m_cursor;
  List<sp_variable> m_varlist;
  bool m_error_on_no_data;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_cfetch : public sp_instr

/*
This class is created for the special fetch instruction
FETCH GROUP NEXT ROW, used in the user-defined aggregate
functions
*/

class sp_instr_agg_cfetch : public sp_instr
{
  sp_instr_agg_cfetch(const sp_instr_cfetch &); /**< Prevent use of these */
  void operator=(sp_instr_cfetch &);

public:

  sp_instr_agg_cfetch(uint ip, sp_pcontext *ctx)
    : sp_instr(ip, ctx){}

  virtual ~sp_instr_agg_cfetch() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_agg_cfetch : public sp_instr




class sp_instr_error : public sp_instr
{
  sp_instr_error(const sp_instr_error &); /**< Prevent use of these */
  void operator=(sp_instr_error &);

public:

  sp_instr_error(uint ip, sp_pcontext *ctx, int errcode)
    : sp_instr(ip, ctx), m_errcode(errcode)
  {}

  virtual ~sp_instr_error() = default;

  int execute(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override
  {
    marked= 1;
    return UINT_MAX;
  }

private:

  int m_errcode;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_error : public sp_instr


class sp_instr_set_case_expr : public sp_instr_opt_meta
{
public:

  sp_instr_set_case_expr(uint ip, sp_pcontext *ctx, uint case_expr_id,
                         Item *case_expr, LEX *lex)
    : sp_instr_opt_meta(ip, ctx),
      m_case_expr_id(case_expr_id), m_case_expr(case_expr),
      m_lex_keeper(lex, TRUE)
  {}

  virtual ~sp_instr_set_case_expr() = default;

  int execute(THD *thd, uint *nextp) override;

  int exec_core(THD *thd, uint *nextp) override;

  void print(String *str) override;

  uint opt_mark(sp_head *sp, List<sp_instr> *leads) override;

  void opt_move(uint dst, List<sp_instr> *ibp) override;

  void set_destination(uint old_dest, uint new_dest) override
  {
    if (m_cont_dest == old_dest)
      m_cont_dest= new_dest;
  }

private:

  uint m_case_expr_id;
  Item *m_case_expr;
  sp_lex_keeper m_lex_keeper;

public:
  PSI_statement_info* get_psi_info() override { return & psi_info; }
  static PSI_statement_info psi_info;
}; // class sp_instr_set_case_expr : public sp_instr_opt_meta

bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access);

#ifndef NO_EMBEDDED_ACCESS_CHECKS
bool
sp_change_security_context(THD *thd, sp_head *sp,
                           Security_context **backup);
void
sp_restore_security_context(THD *thd, Security_context *backup);

bool
set_routine_security_ctx(THD *thd, sp_head *sp, Security_context **save_ctx);
#endif /* NO_EMBEDDED_ACCESS_CHECKS */

TABLE_LIST *
sp_add_to_query_tables(THD *thd, LEX *lex,
		       const LEX_CSTRING *db, const LEX_CSTRING *name,
                       thr_lock_type locktype,
                       enum_mdl_type mdl_type);

/**
  @} (end of group Stored_Routines)
*/

#endif /* _SP_HEAD_H_ */
server/private/my_rnd.h000064400000002050150400264020011153 0ustar00/* Copyright (C) 2013 Monty Program Ab

   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 or later 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef _my_rnd_h
#define _my_rnd_h

C_MODE_START

struct my_rnd_struct {
  unsigned long seed1,seed2,max_value;
  double max_value_dbl;
};

void my_rnd_init(struct my_rnd_struct *rand_st, ulong seed1, ulong seed2);
double my_rnd(struct my_rnd_struct *rand_st);
double my_rnd_ssl(struct my_rnd_struct *rand_st);

C_MODE_END

#endif /* _my_rnd_h */
server/private/wsrep_types.h000064400000001745150400264020012261 0ustar00/* Copyright 2018 Codership Oy <info@codership.com>

   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-1301  USA */

/*
  Wsrep typedefs to better conform to coding style.
 */
#ifndef WSREP_TYPES_H
#define WSREP_TYPES_H

#include "wsrep/seqno.hpp"
#include "wsrep/view.hpp"

typedef wsrep::id Wsrep_id;
typedef wsrep::seqno Wsrep_seqno;
typedef wsrep::view Wsrep_view;

#endif /* WSREP_TYPES_H */
server/private/my_counter.h000064400000003271150400264020012055 0ustar00#ifndef MY_COUNTER_H_INCLUDED
#define MY_COUNTER_H_INCLUDED
/*
   Copyright (C) 2018 MariaDB Foundation

   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-1301  USA
*/

#include <atomic>


template <typename Type> class Atomic_counter
{
  std::atomic<Type> m_counter;

  Type add(Type i) { return m_counter.fetch_add(i, std::memory_order_relaxed); }
  Type sub(Type i) { return m_counter.fetch_sub(i, std::memory_order_relaxed); }

public:
  Atomic_counter(const Atomic_counter<Type> &rhs)
  { m_counter.store(rhs, std::memory_order_relaxed); }
  Atomic_counter(Type val): m_counter(val) {}
  Atomic_counter() = default;

  Type operator++(int) { return add(1); }
  Type operator--(int) { return sub(1); }

  Type operator++() { return add(1) + 1; }
  Type operator--() { return sub(1) - 1; }

  Type operator+=(const Type i) { return add(i) + i; }
  Type operator-=(const Type i) { return sub(i) - i; }

  operator Type() const { return m_counter.load(std::memory_order_relaxed); }
  Type operator=(const Type val)
  { m_counter.store(val, std::memory_order_relaxed); return val; }
};
#endif /* MY_COUNTER_H_INCLUDED */
server/private/my_atomic.h000064400000016161150400264020011654 0ustar00#ifndef MY_ATOMIC_INCLUDED
#define MY_ATOMIC_INCLUDED

/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2018, 2022, MariaDB

   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 */

/*
  This header defines five atomic operations:

  my_atomic_add#(&var, what)
  my_atomic_add#_explicit(&var, what, memory_order)
    'Fetch and Add'
    add 'what' to *var, and return the old value of *var
    All memory orders are valid.

  my_atomic_fas#(&var, what)
  my_atomic_fas#_explicit(&var, what, memory_order)
    'Fetch And Store'
    store 'what' in *var, and return the old value of *var
    All memory orders are valid.

  my_atomic_cas#(&var, &old, new)
  my_atomic_cas#_weak_explicit(&var, &old, new, succ, fail)
  my_atomic_cas#_strong_explicit(&var, &old, new, succ, fail)
    'Compare And Swap'
    if *var is equal to *old, then store 'new' in *var, and return TRUE
    otherwise store *var in *old, and return FALSE
    succ - the memory synchronization ordering for the read-modify-write
    operation if the comparison succeeds. All memory orders are valid.
    fail - the memory synchronization ordering for the load operation if the
    comparison fails. Cannot be MY_MEMORY_ORDER_RELEASE or
    MY_MEMORY_ORDER_ACQ_REL and cannot specify stronger ordering than succ.

    The weak form is allowed to fail spuriously, that is, act as if *var != *old
    even if they are equal. When a compare-and-exchange is in a loop, the weak
    version will yield better performance on some platforms. When a weak
    compare-and-exchange would require a loop and a strong one would not, the
    strong one is preferable.

  my_atomic_load#(&var)
  my_atomic_load#_explicit(&var, memory_order)
    return *var
    Order must be one of MY_MEMORY_ORDER_RELAXED, MY_MEMORY_ORDER_CONSUME,
    MY_MEMORY_ORDER_ACQUIRE, MY_MEMORY_ORDER_SEQ_CST.

  my_atomic_store#(&var, what)
  my_atomic_store#_explicit(&var, what, memory_order)
    store 'what' in *var
    Order must be one of MY_MEMORY_ORDER_RELAXED, MY_MEMORY_ORDER_RELEASE,
    MY_MEMORY_ORDER_SEQ_CST.

  '#' is substituted by a size suffix - 8, 16, 32, 64, or ptr
  (e.g. my_atomic_add8, my_atomic_fas32, my_atomic_casptr).

  The first version orders memory accesses according to MY_MEMORY_ORDER_SEQ_CST,
  the second version (with _explicit suffix) orders memory accesses according to
  given memory order.

  memory_order specifies how non-atomic memory accesses are to be ordered around
  an atomic operation:

  MY_MEMORY_ORDER_RELAXED - there are no constraints on reordering of memory
                            accesses around the atomic variable.
  MY_MEMORY_ORDER_CONSUME - no reads in the current thread dependent on the
                            value currently loaded can be reordered before this
                            load. This ensures that writes to dependent
                            variables in other threads that release the same
                            atomic variable are visible in the current thread.
                            On most platforms, this affects compiler
                            optimization only.
  MY_MEMORY_ORDER_ACQUIRE - no reads in the current thread can be reordered
                            before this load. This ensures that all writes in
                            other threads that release the same atomic variable
                            are visible in the current thread.
  MY_MEMORY_ORDER_RELEASE - no writes in the current thread can be reordered
                            after this store. This ensures that all writes in
                            the current thread are visible in other threads that
                            acquire the same atomic variable.
  MY_MEMORY_ORDER_ACQ_REL - no reads in the current thread can be reordered
                            before this load as well as no writes in the current
                            thread can be reordered after this store. The
                            operation is read-modify-write operation. It is
                            ensured that all writes in another threads that
                            release the same atomic variable are visible before
                            the modification and the modification is visible in
                            other threads that acquire the same atomic variable.
  MY_MEMORY_ORDER_SEQ_CST - The operation has the same semantics as
                            acquire-release operation, and additionally has
                            sequentially-consistent operation ordering.

  We choose implementation as follows: on Windows using Visual C++ the native
  implementation should be preferable. When using gcc we prefer the Solaris
  implementation before the gcc because of stability preference, we choose gcc
  builtins if available.
*/

#if defined(_MSC_VER)
#include "atomic/generic-msvc.h"
#elif defined(HAVE_SOLARIS_ATOMIC)
#include "atomic/solaris.h"
#elif defined(HAVE_GCC_C11_ATOMICS)
#include "atomic/gcc_builtins.h"
#endif

#ifndef MY_MEMORY_ORDER_SEQ_CST
#define MY_MEMORY_ORDER_RELAXED
#define MY_MEMORY_ORDER_CONSUME
#define MY_MEMORY_ORDER_ACQUIRE
#define MY_MEMORY_ORDER_RELEASE
#define MY_MEMORY_ORDER_ACQ_REL
#define MY_MEMORY_ORDER_SEQ_CST

#define my_atomic_store32_explicit(P, D, O) my_atomic_store32((P), (D))
#define my_atomic_store64_explicit(P, D, O) my_atomic_store64((P), (D))
#define my_atomic_storeptr_explicit(P, D, O) my_atomic_storeptr((P), (D))

#define my_atomic_load32_explicit(P, O) my_atomic_load32((P))
#define my_atomic_load64_explicit(P, O) my_atomic_load64((P))
#define my_atomic_loadptr_explicit(P, O) my_atomic_loadptr((P))

#define my_atomic_fas32_explicit(P, D, O) my_atomic_fas32((P), (D))
#define my_atomic_fas64_explicit(P, D, O) my_atomic_fas64((P), (D))
#define my_atomic_fasptr_explicit(P, D, O) my_atomic_fasptr((P), (D))

#define my_atomic_add32_explicit(P, A, O) my_atomic_add32((P), (A))
#define my_atomic_add64_explicit(P, A, O) my_atomic_add64((P), (A))
#define my_atomic_addptr_explicit(P, A, O) my_atomic_addptr((P), (A))

#define my_atomic_cas32_weak_explicit(P, E, D, S, F) \
  my_atomic_cas32((P), (E), (D))
#define my_atomic_cas64_weak_explicit(P, E, D, S, F) \
  my_atomic_cas64((P), (E), (D))
#define my_atomic_casptr_weak_explicit(P, E, D, S, F) \
  my_atomic_casptr((P), (E), (D))

#define my_atomic_cas32_strong_explicit(P, E, D, S, F) \
  my_atomic_cas32((P), (E), (D))
#define my_atomic_cas64_strong_explicit(P, E, D, S, F) \
  my_atomic_cas64((P), (E), (D))
#define my_atomic_casptr_strong_explicit(P, E, D, S, F) \
  my_atomic_casptr((P), (E), (D))
#endif
#endif /* MY_ATOMIC_INCLUDED */
server/private/sql_type_fixedbin_storage.h000064400000012533150400264020015126 0ustar00#ifndef SQL_TYPE_FIXEDBIN_STORAGE
#define SQL_TYPE_FIXEDBIN_STORAGE
/* Copyright (c) 2019,2021 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 */

/*
  This is a common code for plugin (?) types that are generally
  handled like strings, but have their own fixed size on-disk binary storage
  format and their own (variable size) canonical string representation.

  Examples are INET6 and UUID types.

  The MariaDB server uses three binary representations of a data type:

  1. In-memory binary representation (user visible)
    This representation:
    - can be used in INSERT..VALUES (X'AABBCC')
    - can be used in WHERE conditions: WHERE c1=X'AABBCC'
    - is returned by CAST(x AS BINARY(N))
    - is returned by Field::val_native() and Item::val_native()

  2. In-record binary representation (user invisible)
    This representation:
    - is used in records (is pointed by Field::ptr)
    - must be comparable by memcmp()

  3. Binlog binary (row) representation
    Usually, for string data types the binlog representation
    is based on the in-record representation with trailing byte compression:
    - trailing space compression for text string data types
    - trailing zero compression for binary string data types

  We have to have separate in-memory and in-record representations
  because we use HA_KEYTYPE_BINARY for indexing. The engine API
  does not have a way to pass a comparison function as a parameter.

  The default implementation below assumes that:
  - the in-memory and in-record representations are equal
  - the binlog representation is compatible with BINARY(N)
  This is OK for simple data types, like INET6.

  Data type implementations that need different representations
  can override the default implementation (like e.g. UUID does).
*/

/***********************************************************************/

template<size_t NATIVE_LEN, size_t MAX_CHAR_LEN>
class FixedBinTypeStorage
{
protected:
  // The buffer that stores the in-memory binary representation
  char m_buffer[NATIVE_LEN];

  FixedBinTypeStorage() = default;

  FixedBinTypeStorage & set_zero()
  {
    bzero(&m_buffer, sizeof(m_buffer));
    return *this;
  }
public:

  // Initialize from the in-memory binary representation
  FixedBinTypeStorage(const char *str, size_t length)
  {
    if (length != binary_length())
      set_zero();
    else
      memcpy(&m_buffer, str, sizeof(m_buffer));
  }

  // Return the buffer with the in-memory representation
  Lex_cstring to_lex_cstring() const
  {
    return Lex_cstring(m_buffer, sizeof(m_buffer));
  }

  static constexpr uint binary_length() { return NATIVE_LEN; }
  static constexpr uint max_char_length() { return MAX_CHAR_LEN; }

  // Compare the in-memory binary representations of two values
  static int cmp(const LEX_CSTRING &a, const LEX_CSTRING &b)
  {
    DBUG_ASSERT(a.length == binary_length());
    DBUG_ASSERT(b.length == binary_length());
    return memcmp(a.str, b.str, b.length);
  }

  /*
    Convert from the in-memory to the in-record representation.
    Used in Field::store_native().
  */
  static void memory_to_record(char *to, const char *from)
  {
    memcpy(to, from, NATIVE_LEN);
  }
  /*
    Convert from the in-record to the in-memory representation
    Used in Field::val_native().
  */
  static void record_to_memory(char *to, const char *from)
  {
    memcpy(to, from, NATIVE_LEN);
  }

  /*
    Hash the in-record representation
    Used in Field::hash().
  */
  static void hash_record(uchar *ptr, Hasher *hasher)
  {
    hasher->add(&my_charset_bin, ptr, binary_length());
  }

  static bool only_zero_bytes(const char *ptr, size_t length)
  {
    for (uint i= 0 ; i < length; i++)
    {
      if (ptr[i] != 0)
        return false;
    }
    return true;
  }

  static ulong KEY_pack_flags(uint column_nr)
  {
    /*
      Return zero by default. A particular data type can override
      this method return some flags, e.g. HA_PACK_KEY to enable
      key prefix compression.
    */
    return 0;
  }

  /*
    Convert from the in-record to the binlog representation.
    Used in Field::pack(), and in filesort to store the addon fields.
    By default, do what BINARY(N) does.
  */
  static uchar *pack(uchar *to, const uchar *from, uint max_length)
  {
    return StringPack(&my_charset_bin, binary_length()).pack(to, from, max_length);
  }

  /*
    Convert from the in-binary-log to the in-record representation.
    Used in Field::unpack().
    By default, do what BINARY(N) does.
  */
  static const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
                             uint param_data)
  {
    return StringPack(&my_charset_bin, binary_length()).unpack(to, from, from_end,
                                                               param_data);
  }

};
#endif /* SQL_TYPE_FIXEDBIN_STORAGE */
server/private/heap.h000064400000022410150400264020010602 0ustar00/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.

   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
*/

/* This file should be included when using heap_database_functions */
/* Author: Michael Widenius */

#ifndef _heap_h
#define _heap_h
#ifdef	__cplusplus
extern "C" {
#endif

#ifndef _my_base_h
#include <my_base.h>
#endif

#include <my_pthread.h>
#include <thr_lock.h>

#include "my_compare.h"
#include "my_tree.h"

	/* defines used by heap-functions */

#define HP_MAX_LEVELS	4		/* 128^5 records is enough */
#define HP_PTRS_IN_NOD	128

	/* struct used with heap_functions */

typedef struct st_heapinfo		/* Struct from heap_info */
{
  ulong records;			/* Records in database */
  ulong deleted;			/* Deleted records in database */
  ulong max_records;
  ulonglong data_length;
  ulonglong index_length;
  uint reclength;			/* Length of one record */
  int errkey;
  ulonglong auto_increment;
  time_t create_time;
} HEAPINFO;


	/* Structs used by heap-database-handler */

typedef struct st_heap_ptrs
{
  uchar *blocks[HP_PTRS_IN_NOD];		/* pointers to HP_PTRS or records */
} HP_PTRS;

struct st_level_info
{
  /* Number of unused slots in *last_blocks HP_PTRS block (0 for 0th level) */
  uint free_ptrs_in_block;
  
  /*
    Maximum number of records that can be 'contained' inside of each element
    of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for 
    level 2 - HP_PTRS_IN_NOD^2 and so forth.
  */
  ulong records_under_level;

  /*
    Ptr to last allocated HP_PTRS (or records buffer for level 0) on this 
    level.
  */
  HP_PTRS *last_blocks;			
};


/*
  Heap table records and hash index entries are stored in HP_BLOCKs.
  HP_BLOCK is used as a 'growable array' of fixed-size records. Size of record
  is recbuffer bytes.
  The internal representation is as follows:
  HP_BLOCK is a hierarchical structure of 'blocks'.
  A block at level 0 is an array records_in_block records. 
  A block at higher level is an HP_PTRS structure with pointers to blocks at 
  lower levels.
  At the highest level there is one top block. It is stored in HP_BLOCK::root.

  See hp_find_block for a description of how record pointer is obtained from 
  its index.
  See hp_get_new_block 
*/

typedef struct st_heap_block
{
  HP_PTRS *root;                        /* Top-level block */ 
  struct st_level_info level_info[HP_MAX_LEVELS+1];
  uint levels;                          /* number of used levels */
  uint recbuffer;			/* Length of one saved record */
  ulong records_in_block;		/* Records in one heap-block */
  ulong last_allocated; /* number of records there is allocated space for */
  size_t alloc_size;			/* Allocate blocks of this size */
} HP_BLOCK;

struct st_heap_info;			/* For reference */

typedef struct st_hp_keydef		/* Key definition with open */
{
  uint flag;				/* HA_NOSAME | HA_NULL_PART_KEY */
  uint keysegs;				/* Number of key-segment */
  uint length;				/* Length of key (automatic) */
  uint8 algorithm;			/* HASH / BTREE */
  HA_KEYSEG *seg;
  HP_BLOCK block;			/* Where keys are saved */
  /*
    Number of buckets used in hash table. Used only to provide
    #records estimates for heap key scans.
  */
  ha_rows hash_buckets; 
  TREE rb_tree;
  int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
		   const uchar *record, uchar *recpos);
  int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
		   const uchar *record, uchar *recpos, int flag);
  uint (*get_key_length)(struct st_hp_keydef *keydef, const uchar *key);
} HP_KEYDEF;

typedef struct st_heap_share
{
  HP_BLOCK block;
  HP_KEYDEF  *keydef;
  ulonglong data_length,index_length,max_table_size;
  ulonglong auto_increment;
  ulong min_records,max_records;	/* Params to open */
  ulong records;			/* records */
  ulong blength;			/* records rounded up to 2^n */
  ulong deleted;			/* Deleted records in database */
  uint key_stat_version;                /* version to indicate insert/delete */
  uint key_version;                     /* Updated on key change */
  uint file_version;                    /* Update on clear */
  uint reclength;			/* Length of one record */
  uint visible;                         /* Offset to the visible/deleted mark */
  uint changed;
  uint keys,max_key_length;
  uint currently_disabled_keys;    /* saved value from "keys" when disabled */
  uint open_count;
  uchar *del_link;			/* Link to next block with del. rec */
  char * name;			/* Name of "memory-file" */
  time_t create_time;
  THR_LOCK lock;
  my_bool delete_on_close;
  my_bool internal;                     /* Internal temporary table */
  LIST open_list;
  uint auto_key;
  uint auto_key_type;			/* real type of the auto key segment */
} HP_SHARE;

struct st_hp_hash_info;

typedef struct st_heap_info
{
  HP_SHARE *s;
  uchar *current_ptr;
  struct st_hp_hash_info *current_hash_ptr;
  ulong current_record,next_block;
  int lastinx,errkey;
  int  mode;				/* Mode of file (READONLY..) */
  uint opt_flag,update;
  uchar *lastkey;			/* Last used key with rkey */
  uchar *recbuf;                         /* Record buffer for rb-tree keys */
  enum ha_rkey_function last_find_flag;
  TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1];
  TREE_ELEMENT **last_pos;
  uint key_version;                     /* Version at last read */
  uint file_version;                    /* Version at scan */
  uint lastkey_len;
  my_bool implicit_emptied;
  THR_LOCK_DATA lock;
  LIST open_list;
} HP_INFO;


typedef struct st_heap_create_info
{
  HP_KEYDEF *keydef;
  uint auto_key;                        /* keynr [1 - maxkey] for auto key */
  uint auto_key_type;
  uint keys;
  uint reclength;
  ulong max_records;
  ulong min_records;
  ulonglong max_table_size;
  ulonglong auto_increment;
  my_bool with_auto_increment;
  my_bool internal_table;
  /*
    TRUE if heap_create should 'pin' the created share by setting
    open_count to 1. Is only looked at if not internal_table.
  */
  my_bool pin_share;
} HP_CREATE_INFO;

	/* Prototypes for heap-functions */

extern HP_INFO *heap_open(const char *name, int mode);
extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode);
extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode);
extern void heap_release_share(HP_SHARE *share, my_bool internal_table);
extern int heap_close(HP_INFO *info);
extern int heap_write(HP_INFO *info,const uchar *buff);
extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata);
extern int heap_rrnd(HP_INFO *info,uchar *buf,uchar *pos);
extern int heap_scan_init(HP_INFO *info);
extern int heap_scan(HP_INFO *info, uchar *record);
extern int heap_delete(HP_INFO *info,const uchar *buff);
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
extern int heap_create(const char *name,
                       HP_CREATE_INFO *create_info, HP_SHARE **share,
                       my_bool *created_new_share);
extern int heap_delete_table(const char *name);
extern void heap_drop_table(HP_INFO *info);
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
extern int heap_reset(HP_INFO *info);
extern int heap_rename(const char *old_name,const char *new_name);
extern int heap_panic(enum ha_panic_function flag);
extern int heap_rsame(HP_INFO *info,uchar *record,int inx);
extern int heap_rnext(HP_INFO *info,uchar *record);
extern int heap_rprev(HP_INFO *info,uchar *record);
extern int heap_rfirst(HP_INFO *info,uchar *record,int inx);
extern int heap_rlast(HP_INFO *info,uchar *record,int inx);
extern void heap_clear(HP_INFO *info);
extern void heap_clear_keys(HP_INFO *info);
extern int heap_disable_indexes(HP_INFO *info);
extern int heap_enable_indexes(HP_INFO *info);
extern int heap_indexes_are_disabled(HP_INFO *info);
extern void heap_update_auto_increment(HP_INFO *info, const uchar *record);
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx,
                               const key_range *min_key,
                               const key_range *max_key);
int hp_panic(enum ha_panic_function flag);
int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key,
              key_part_map keypart_map, enum ha_rkey_function find_flag);
extern uchar * heap_find(HP_INFO *info,int inx,const uchar *key);
extern int heap_check_heap(const HP_INFO *info, my_bool print_status);
extern uchar *heap_position(HP_INFO *info);

/* The following is for programs that uses the old HEAP interface where
   pointer to rows where a long instead of a (uchar*).
*/

#if defined(WANT_OLD_HEAP_VERSION) || defined(OLD_HEAP_VERSION)
extern int heap_rrnd_old(HP_INFO *info,uchar *buf,ulong pos);
extern ulong heap_position_old(HP_INFO *info);
#endif
#ifdef OLD_HEAP_VERSION
typedef ulong HEAP_PTR;
#define heap_position(A) heap_position_old(A)
#define heap_rrnd(A,B,C) heap_rrnd_old(A,B,C)
#else
typedef uchar *HEAP_PTR;
#endif

#ifdef	__cplusplus
}
#endif
#endif
server/private/threadpool.h000064400000011312150400264020012025 0ustar00/* Copyright (C) 2012, 2020, MariaDB

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#pragma once
#ifdef HAVE_POOL_OF_THREADS
#define MAX_THREAD_GROUPS 100000

/* Threadpool parameters */
extern uint threadpool_min_threads;  /* Minimum threads in pool */
extern uint threadpool_idle_timeout; /* Shutdown idle worker threads  after this timeout */
extern uint threadpool_size; /* Number of parallel executing threads */
extern uint threadpool_max_size;
extern uint threadpool_stall_limit;  /* time interval in milliseconds for stall checks*/
extern uint threadpool_max_threads;  /* Maximum threads in pool */
extern uint threadpool_oversubscribe;  /* Maximum active threads in group */
extern uint threadpool_prio_kickup_timer;  /* Time before low prio item gets prio boost */
extern my_bool threadpool_exact_stats; /* Better queueing time stats for information_schema, at small performance cost */
extern my_bool threadpool_dedicated_listener; /* Listener thread does not pick up work items. */
#ifdef _WIN32
extern uint threadpool_mode; /* Thread pool implementation , windows or generic */
#define TP_MODE_WINDOWS 0
#define TP_MODE_GENERIC 1
#endif

#define DEFAULT_THREADPOOL_STALL_LIMIT 500U

struct TP_connection;
struct st_vio;

extern void tp_callback(TP_connection *c);
extern void tp_timeout_handler(TP_connection *c);



/*
  Threadpool statistics
*/
struct TP_STATISTICS
{
  /* Current number of worker thread. */
  Atomic_counter<uint32_t> num_worker_threads;
};

extern TP_STATISTICS tp_stats;


/* Functions to set threadpool parameters */
extern void tp_set_min_threads(uint val);
extern void tp_set_max_threads(uint val);
extern void tp_set_threadpool_size(uint val);
extern void tp_set_threadpool_stall_limit(uint val);
extern int tp_get_idle_thread_count();
extern int tp_get_thread_count();


enum  TP_PRIORITY {
  TP_PRIORITY_HIGH,
  TP_PRIORITY_LOW,
  TP_PRIORITY_AUTO
};


enum TP_STATE
{
  TP_STATE_IDLE,
  TP_STATE_RUNNING,
  TP_STATE_PENDING
};

/*
  Connection structure, encapsulates THD + structures for asynchronous
  IO and pool.

  Platform specific parts are specified in subclasses called connection_t,
  inside threadpool_win.cc and threadpool_unix.cc
*/

class CONNECT;

struct TP_connection
{
  THD*        thd;
  CONNECT*    connect;
  TP_STATE    state;
  TP_PRIORITY priority;
  TP_connection(CONNECT *c) :
    thd(0),
    connect(c),
    state(TP_STATE_IDLE),
    priority(TP_PRIORITY_HIGH)
  {}

  virtual ~TP_connection() = default;

  /* Initialize io structures windows threadpool, epoll etc */
  virtual int init() = 0;

  virtual void set_io_timeout(int sec) = 0;

  /* Read for the next client command (async) with specified timeout */
  virtual int start_io() = 0;

  virtual void wait_begin(int type)= 0;
  virtual void wait_end() = 0;
  IF_WIN(virtual,) void init_vio(st_vio *){};
};


struct TP_pool
{
  virtual ~TP_pool() = default;
  virtual int init()= 0;
  virtual TP_connection *new_connection(CONNECT *)= 0;
  virtual void add(TP_connection *c)= 0;
  virtual int set_max_threads(uint){ return 0; }
  virtual int set_min_threads(uint){ return 0; }
  virtual int set_pool_size(uint){ return 0; }
  virtual int set_idle_timeout(uint){ return 0; }
  virtual int set_oversubscribe(uint){ return 0; }
  virtual int set_stall_limit(uint){ return 0; }
  virtual int get_thread_count() { return tp_stats.num_worker_threads; }
  virtual int get_idle_thread_count(){ return 0; }
  virtual void resume(TP_connection* c)=0;
};

#ifdef _WIN32

struct TP_pool_win:TP_pool
{
  TP_pool_win();
  int init() override;
  ~TP_pool_win() override;
  TP_connection *new_connection(CONNECT *c) override;
  void add(TP_connection *) override;
  int set_max_threads(uint) override;
  int set_min_threads(uint) override;
  void resume(TP_connection *c) override;
};
#endif

struct TP_pool_generic :TP_pool
{
  TP_pool_generic();
  ~TP_pool_generic();
  int init() override;
  TP_connection *new_connection(CONNECT *c) override;
  void add(TP_connection *) override;
  int set_pool_size(uint) override;
  int set_stall_limit(uint) override;
  int get_idle_thread_count() override;
  void resume(TP_connection* c) override;
};

#endif /* HAVE_POOL_OF_THREADS */
server/private/proxy_protocol.h000064400000001044150400264020012767 0ustar00#include "my_net.h"

struct proxy_peer_info
{
  struct sockaddr_storage peer_addr;
  int port;
  bool is_local_command;
};

extern bool has_proxy_protocol_header(NET *net);
extern int parse_proxy_protocol_header(NET *net, proxy_peer_info *peer_info);
extern bool is_proxy_protocol_allowed(const sockaddr *remote_addr);

extern int init_proxy_protocol_networks(const char *spec);
extern void destroy_proxy_protocol_networks();

extern int  set_proxy_protocol_networks(const char *spec);
extern bool proxy_protocol_networks_valid(const char *spec);

server/private/sql_test.h000064400000003065150400264020011530 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef SQL_TEST_INCLUDED
#define SQL_TEST_INCLUDED

#include "mysqld.h"
#include "opt_trace_context.h"

class JOIN;
struct TABLE_LIST;
typedef class Item COND;
typedef class st_select_lex SELECT_LEX;
struct SORT_FIELD;

#ifndef DBUG_OFF
void print_where(COND *cond,const char *info, enum_query_type query_type);
void TEST_filesort(SORT_FIELD *sortorder,uint s_length);
void TEST_join(JOIN *join);
void print_plan(JOIN* join,uint idx, double record_count, double read_time,
                double current_read_time, const char *info);
void print_keyuse_array(DYNAMIC_ARRAY *keyuse_array);
void print_sjm(SJ_MATERIALIZATION_INFO *sjm);
void dump_TABLE_LIST_graph(SELECT_LEX *select_lex, TABLE_LIST* tl);
#endif
void print_keyuse_array_for_trace(THD *thd, DYNAMIC_ARRAY *keyuse_array);
void mysql_print_status();

#endif /* SQL_TEST_INCLUDED */
server/private/opt_trace_context.h000064400000006333150400264020013417 0ustar00#ifndef OPT_TRACE_CONTEXT_INCLUDED
#define OPT_TRACE_CONTEXT_INCLUDED

#include "sql_array.h"

class Opt_trace_context;
struct Opt_trace_info;
class Json_writer;

class Opt_trace_stmt {
 public:
  /**
     Constructor, starts a trace for information_schema and dbug.
     @param  ctx_arg          context
  */
  Opt_trace_stmt(Opt_trace_context *ctx_arg);
  ~Opt_trace_stmt();
  void set_query(const char *query_ptr, size_t length, const CHARSET_INFO *charset);
  void open_struct(const char *key, char opening_bracket);
  void close_struct(const char *saved_key, char closing_bracket);
  void fill_info(Opt_trace_info* info);
  void add(const char *key, char *opening_bracket, size_t val_length);
  Json_writer* get_current_json() {return current_json;}
  void missing_privilege();
  void disable_tracing_for_children();
  void enable_tracing_for_children();
  bool is_enabled()
  {
   return I_S_disabled == 0;
  }
  void set_allowed_mem_size(size_t mem_size);
  size_t get_length();
  size_t get_truncated_bytes();
  bool get_missing_priv() { return missing_priv; }

private:
  Opt_trace_context *ctx;
  String query;  // store the query sent by the user
  Json_writer *current_json; // stores the trace
  bool missing_priv;  ///< whether user lacks privilege to see this trace
  /*
    0 <=> this trace should be in information_schema.
  !=0 tracing is disabled, this currently happens when we want to trace a
      sub-statement. For now traces are only collect for the top statement
      not for the sub-statments.
  */
  uint I_S_disabled;
};


class Opt_trace_context
{
public:
   Opt_trace_context();
  ~Opt_trace_context();

  void start(THD *thd, TABLE_LIST *tbl,
             enum enum_sql_command sql_command,
             const char *query,
             size_t query_length,
             const CHARSET_INFO *query_charset,
             ulong max_mem_size_arg);
  void end();
  void set_query(const char *query, size_t length, const CHARSET_INFO *charset);
  void delete_traces();
  void set_allowed_mem_size(size_t mem_size);
  size_t remaining_mem_size();

private:
  Opt_trace_stmt* top_trace()
  {
    return *(traces.front());
  }

public:

  /*
    This returns the top trace from the list of traces. This function
    is used when we want to see the contents of the INFORMATION_SCHEMA.OPTIMIZER_TRACE
  table.
  */

  Opt_trace_stmt* get_top_trace()
  {
    if (!traces.elements())
      return NULL;
    return top_trace();
  }

  /*
    This returns the current trace, to which we are still writing and has not been finished
  */

  Json_writer* get_current_json()
  {
    if (!is_started())
      return NULL;
    return current_trace->get_current_json();
  }

  bool empty()
  {
    return static_cast<uint>(traces.elements()) == 0;
  }

  bool is_started()
  {
    return current_trace && current_trace->is_enabled();
  }

  bool disable_tracing_if_required();

  bool enable_tracing_if_required();

  bool is_enabled();

  void missing_privilege();

  static const char *flag_names[];
  enum
  {
    FLAG_DEFAULT = 0,
    FLAG_ENABLED = 1 << 0
  };

private:
  /*
    List of traces (currently it stores only 1 trace)
  */
  Dynamic_array<Opt_trace_stmt*> traces;
  Opt_trace_stmt *current_trace;
  size_t max_mem_size;
};

#endif /* OPT_TRACE_CONTEXT_INCLUDED */
server/private/contributors.h000064400000011416150400264020012426 0ustar00#ifndef CONTRIBUTORS_INCLUDED
#define CONTRIBUTORS_INCLUDED

/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
   Use is subject to license terms.

   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 */

/* Structure of the name list */

struct show_table_contributors_st {
  const char *name;
  const char *location;
  const char *comment;
};

/*
  Output from "SHOW CONTRIBUTORS"

  Get permission before editing.

  Names should be encoded using UTF-8.

  See also https://mariadb.com/kb/en/log-of-mariadb-contributions/
*/

struct show_table_contributors_st show_table_contributors[]= {
  /* MariaDB Foundation sponsors, alphabetical by tier */
  {"Amazon", "https://www.amazon.com/", "Diamond Sponsor of the MariaDB Foundation"},
  {"Acronis", "https://www.acronis.com/", "Platinum Sponsor of the MariaDB Foundation"},
  {"Alibaba Cloud", "https://www.alibabacloud.com/", "Platinum Sponsor of the MariaDB Foundation"},
  {"C<onstructor", "https://www.constructor.org/", "Platinum Sponsor of the MariaDB Foundation"},
  {"Development Bank of Singapore", "https://www.dbs.com/", "Platinum Sponsor of the MariaDB Foundation"},
  {"Intel", "https://www.intel.com/", "Platinum Sponsor of the MariaDB Foundation"},
  {"MariaDB plc", "https://mariadb.com/", "Founding member, Platinum Sponsor of the MariaDB Foundation"},
  {"ServiceNow", "https://servicenow.com/", "Platinum Sponsor of the MariaDB Foundation"},
  {"WebPros", "https://webpros.com/", "Platinum Sponsor of the MariaDB Foundation"},
  {"IBM", "https://www.ibm.com/", "Gold Sponsor of the MariaDB Foundation"},
  {"IONOS", "https://www.ionos.com/", "Gold Sponsor of the MariaDB Foundation"},
  {"Automattic", "https://automattic.com/", "Silver Sponsor of the MariaDB Foundation"},
  {"SkySQL", "https://skysql.com/", "Silver Sponsor of the MariaDB Foundation"},
  {"team.blue", "https://team.blue/", "Silver Sponsor of the MariaDB Foundation"},
  {"Tencent Cloud", "https://cloud.tencent.com/", "Silver Sponsor of the MariaDB Foundation"},
  {"Wikimedia Foundation", "https://www.wikimediafoundation.org/", "Silver Sponsor of the MariaDB Foundation"},
  {"Cyber Leo", "https://cyberleo.com/", "Bronze Sponsor of the MariaDB Foundation"},
  {"Hetzner", "https://www.hetzner.com/", "Bronze Sponsor of the MariaDB Foundation"},
  {"Rumahweb", "https://rumahweb.com/", "Bronze Sponsor of the MariaDB Foundation"},
  {"Tasjeel.ae", "https://tasjeel.ae/", "Bronze Sponsor of the MariaDB Foundation"},
  {"Galera Cluster", "https://galeracluster.com/", "Sponsor of the MariaDB Foundation"},
  {"Percona", "https://www.percona.com/", "Sponsor of the MariaDB Foundation"},
  {"Vettabase", "https://vettabase.com/", "Technology partner of the MariaDB Foundation"},
  {"Booking.com", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Jelastic.com", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Microsoft", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Nexedi", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Open Query", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Planeetta Web Hosting", "", "Previous Sponsor of the MariaDB Foundation"},
  {"SpringbokSQL", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Tencent Games", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Tencent Game DBA", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Tencent TDSQL", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Verkkokauppa", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Virtuozzo", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Visma", "", "Previous Sponsor of the MariaDB Foundation"},
  {"Webyog", "", "Previous Sponsor of the MariaDB Foundation"},

  /* Sponsors of important features */
  {"Google", "USA", "Sponsoring encryption, parallel replication and GTID"},
  {"Facebook", "USA", "Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc"},

  /* Individual contributors, names in historical order, newer first */
  {"Ronald Bradford", "Brisbane, Australia", "EFF contribution for UC2006 Auction"},
  {"Sheeri Kritzer", "Boston, Mass. USA", "EFF contribution for UC2006 Auction"},
  {"Mark Shuttleworth", "London, UK.", "EFF contribution for UC2006 Auction"},
  {NULL, NULL, NULL}
};

#endif /* CONTRIBUTORS_INCLUDED */
server/private/multi_range_read.h000064400000055213150400264020013175 0ustar00/*
   Copyright (c) 2009, 2011, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**
  @defgroup DS-MRR declarations
  @{
*/

/**
  A Disk-Sweep implementation of MRR Interface (DS-MRR for short)

  This is a "plugin"(*) for storage engines that allows to
    1. When doing index scans, read table rows in rowid order;
    2. when making many index lookups, do them in key order and don't
       lookup the same key value multiple times;
    3. Do both #1 and #2, when applicable.
  These changes are expected to speed up query execution for disk-based 
  storage engines running io-bound loads and "big" queries (ie. queries that
  do joins and enumerate lots of records).

  (*) - only conceptually. No dynamic loading or binary compatibility of any
        kind.

  General scheme of things:
   
      SQL Layer code
       |   |   |
       v   v   v 
      -|---|---|---- handler->multi_range_read_XXX() function calls
       |   |   |
      _____________________________________
     / DS-MRR module                       \
     | (order/de-duplicate lookup keys,    |
     | scan indexes in key order,          |
     | order/de-duplicate rowids,          |
     | retrieve full record reads in rowid |
     | order)                              |
     \_____________________________________/
       |   |   |
      -|---|---|----- handler->read_range_first()/read_range_next(), 
       |   |   |      handler->index_read(), handler->rnd_pos() calls.
       |   |   |
       v   v   v
      Storage engine internals


  Currently DS-MRR is used by MyISAM, InnoDB and Maria storage engines.
  Potentially it can be used with any table handler that has disk-based data
  storage and has better performance when reading data in rowid order.
*/

#include "sql_lifo_buffer.h"

class DsMrr_impl;
class Mrr_ordered_index_reader;


/* A structure with key parameters that's shared among several classes */
class Key_parameters
{
public:
  uint         key_tuple_length; /* Length of index lookup tuple, in bytes */
  key_part_map key_tuple_map;    /* keyparts used in index lookup tuples */

  /*
    This is 
      = key_tuple_length   if we copy keys to buffer
      = sizeof(void*)      if we're using pointers to materialized keys.
  */
  uint key_size_in_keybuf;

  /* TRUE <=> don't copy key values, use pointers to them instead.  */
  bool use_key_pointers;

  /* TRUE <=> We can get at most one index tuple for a lookup key */
  bool index_ranges_unique;
};


/**
  A class to enumerate (record, range_id) pairs that match given key value.
  
  @note

  The idea is that we have a Lifo_buffer which holds (key, range_id) pairs
  ordered by key value. From the front of the buffer we see

    (key_val1, range_id1), (key_val1, range_id2) ... (key_val2, range_idN)

  we take the first elements that have the same key value (key_val1 in the
  example above), and make lookup into the table.  The table will have 
  multiple matches for key_val1:
 
                  == Table Index ==
                   ...
     key_val1 ->  key_val1, index_tuple1
                  key_val1, index_tuple2
                   ...
                  key_val1, index_tupleN
                   ...
  
  Our goal is to produce all possible combinations, i.e. we need:
  
    {(key_val1, index_tuple1), range_id1}
    {(key_val1, index_tuple1), range_id2}
       ...           ...               |
    {(key_val1, index_tuple1), range_idN},
                  
    {(key_val1, index_tuple2), range_id1}
    {(key_val1, index_tuple2), range_id2}
        ...          ...               |
    {(key_val1, index_tuple2), range_idN},

        ...          ...          ...                          

    {(key_val1, index_tupleK), range_idN}
*/

class Key_value_records_iterator
{
  /* Use this to get table handler, key buffer and other parameters */
  Mrr_ordered_index_reader *owner;

  /* Iterator to get (key, range_id) pairs from */
  Lifo_buffer_iterator identical_key_it;
  
  /* 
    Last of the identical key values (when we get this pointer from
    identical_key_it, it will be time to stop).
  */
  uchar *last_identical_key_ptr;

  /*
    FALSE <=> we're right after the init() call, the record has been already
    read with owner->file->index_read_map() call
  */
  bool get_next_row;
  
public:
  int init(Mrr_ordered_index_reader *owner_arg);
  int get_next(range_id_t *range_info);
  void move_to_next_key_value();
};


/*
  Buffer manager interface. Mrr_reader objects use it to inqure DsMrr_impl
  to manage buffer space for them.
*/
typedef struct st_buffer_manager
{
public:
  /* Opaque value to be passed as the first argument to all member functions */
  void *arg;
  
  /*
    This is called when we've freed more space from the rowid buffer. The
    callee will get the unused space from the rowid buffer and give it to the
    key buffer.
  */
  void (*redistribute_buffer_space)(void *arg);

  /* 
    This is called when both key and rowid buffers are empty, and so it's time 
    to reset them to their original size (They've lost their original size,
    because we were dynamically growing rowid buffer and shrinking key buffer).
  */
  void (*reset_buffer_sizes)(void *arg);

} Buffer_manager;


/* 
  Mrr_reader - DS-MRR execution strategy abstraction

  A reader produces ([index]_record, range_info) pairs, and requires periodic
  refill operations.

  - one starts using the reader by calling reader->get_next(),
  - when a get_next() call returns HA_ERR_END_OF_FILE, one must call 
    refill_buffer() before they can make more get_next() calls.
  - when refill_buffer() returns HA_ERR_END_OF_FILE, this means the real
    end of stream and get_next() should not be called anymore.

  Both functions can return other error codes, these mean unrecoverable errors
  after which one cannot continue.
*/

class Mrr_reader 
{
public:
  virtual int get_next(range_id_t *range_info) = 0;
  virtual int refill_buffer(bool initial) = 0;
  virtual ~Mrr_reader() = default; /* just to remove compiler warning */
};


/* 
  A common base for readers that do index scans and produce index tuples 
*/

class Mrr_index_reader : public Mrr_reader
{
protected:
  handler *file; /* Handler object to use */
public:
  virtual int init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, 
                   void *seq_init_param, uint n_ranges,
                   uint mode, Key_parameters *key_par, 
                   Lifo_buffer *key_buffer, 
                   Buffer_manager *buf_manager_arg) = 0;

  /* Get pointer to place where every get_next() call will put rowid */
  virtual uchar *get_rowid_ptr() = 0;
  /* Get the rowid (call this after get_next() call) */
  virtual void position();
  virtual bool skip_record(range_id_t range_id, uchar *rowid) = 0;

  virtual void interrupt_read() {}
  virtual void resume_read() {}
};


/*
  A "bypass" index reader that just does and index scan. The index scan is done 
  by calling default MRR implementation (i.e.  handler::multi_range_read_XXX())
  functions.
*/

class Mrr_simple_index_reader : public Mrr_index_reader
{
public:
  int init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
           void *seq_init_param, uint n_ranges,
           uint mode, Key_parameters *key_par,
           Lifo_buffer *key_buffer,
           Buffer_manager *buf_manager_arg) override;
  int get_next(range_id_t *range_info) override;
  int refill_buffer(bool initial) override { return initial? 0: HA_ERR_END_OF_FILE; }
  uchar *get_rowid_ptr() override { return file->ref; }
  bool skip_record(range_id_t range_id, uchar *rowid) override
  {
    return (file->mrr_funcs.skip_record &&
            file->mrr_funcs.skip_record(file->mrr_iter, range_id, rowid));
  }
};


/* 
  A reader that sorts the key values before it makes the index lookups.
*/

class Mrr_ordered_index_reader : public Mrr_index_reader
{
public:
  int init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, 
           void *seq_init_param, uint n_ranges,
           uint mode, Key_parameters *key_par,
           Lifo_buffer *key_buffer,
           Buffer_manager *buf_manager_arg) override;
  int get_next(range_id_t *range_info) override;
  int refill_buffer(bool initial) override;
  uchar *get_rowid_ptr() override { return file->ref; }
  
  bool skip_record(range_id_t range_info, uchar *rowid) override
  {
    return (mrr_funcs.skip_record &&
            mrr_funcs.skip_record(mrr_iter, range_info, rowid));
  }

  bool skip_index_tuple(range_id_t range_info)
  {
    return (mrr_funcs.skip_index_tuple &&
            mrr_funcs.skip_index_tuple(mrr_iter, range_info));
  }
  
  bool set_interruption_temp_buffer(uint rowid_length, uint key_len, 
                                    uint saved_pk_len,
                                    uchar **space_start, uchar *space_end);
  void set_no_interruption_temp_buffer();

  void interrupt_read() override;
  void resume_read() override;
  void position() override;
private:
  Key_value_records_iterator kv_it;

  bool scanning_key_val_iter;
  
  /* Buffer to store (key, range_id) pairs */
  Lifo_buffer *key_buffer;
  
  /* This manages key buffer allocation and sizing for us */
  Buffer_manager *buf_manager;

  Key_parameters  keypar; /* index scan and lookup tuple parameters */

  /* TRUE <=> need range association, buffers hold {rowid, range_id} pairs */
  bool is_mrr_assoc;
  
  /* Range sequence iteration members */
  RANGE_SEQ_IF mrr_funcs;
  range_seq_t mrr_iter;
  
  /* TRUE == reached eof when enumerating ranges */
  bool source_exhausted;
   
  /* 
    Following members are for interrupt_read()/resume_read(). The idea is that 
    in some cases index scan that is done by this object is interrupted by
    rnd_pos() calls made by Mrr_ordered_rndpos_reader. The problem is that
    we're sharing handler->record[0] with that object, and it destroys its
    contents.
    We need to save/restore our current
    - index tuple (for pushed index condition checks)
    - clustered primary key values (again, for pushed index condition checks)
    - rowid of the last record we've retrieved (in case this rowid matches
      multiple ranges and we'll need to return it again)
  */ 
  bool support_scan_interruptions;
  /* Space where we save the rowid of the last record we've returned */
  uchar *saved_rowid;
  
  /* TRUE <=> saved_rowid has the last saved rowid */
  bool have_saved_rowid;
  
  uchar *saved_key_tuple; /* Saved current key tuple */
  uchar *saved_primary_key; /* Saved current primary key tuple */
  
  /*
    TRUE<=> saved_key_tuple (and saved_primary_key when applicable) have
    valid values.
  */
  bool read_was_interrupted;

  static int compare_keys(void *arg, const void *key1, const void *key2);
  static int compare_keys_reverse(void *arg, const void *key1,
                                  const void *key2);

  friend class Key_value_records_iterator; 
  friend class DsMrr_impl;
  friend class Mrr_ordered_rndpos_reader;
};


/* 
  A reader that gets rowids from an Mrr_index_reader, and then sorts them 
  before getting full records with handler->rndpos() calls.
*/

class Mrr_ordered_rndpos_reader : public Mrr_reader 
{
public:
  int init(handler *file, Mrr_index_reader *index_reader, uint mode,
           Lifo_buffer *buf, Rowid_filter *filter);
  int get_next(range_id_t *range_info) override;
  int refill_buffer(bool initial) override;
private:
  handler *file; /* Handler to use */
  
  /* This what we get (rowid, range_info) pairs from */
  Mrr_index_reader *index_reader;

  /* index_reader->get_next() puts rowid here */
  uchar *index_rowid;
  
  /* TRUE <=> index_reader->refill_buffer() call has returned EOF */
  bool index_reader_exhausted;
  
  /* 
    TRUE <=> We should call index_reader->refill_buffer(). This happens if
    1. we've made index_reader->get_next() call which returned EOF
    2. we haven't made any index_reader calls (and our first call should 
       be index_reader->refill_buffer(initial=TRUE)
  */
  bool index_reader_needs_refill;

  /* TRUE <=> need range association, buffers hold {rowid, range_id} pairs */
  bool is_mrr_assoc;
  
  /* 
    When reading from ordered rowid buffer: the rowid element of the last
    buffer element that has rowid identical to this one.
  */
  uchar *last_identical_rowid;

  /* Buffer to store (rowid, range_id) pairs */
  Lifo_buffer *rowid_buffer;
  
  /* Rowid filter to be checked against (if any) */
  Rowid_filter *rowid_filter;

  int refill_from_index_reader();
};


/*
  A primitive "factory" of various Mrr_*_reader classes (the point is to 
  get various kinds of readers without having to allocate them on the heap)
*/

class Mrr_reader_factory
{
public:
  Mrr_ordered_rndpos_reader ordered_rndpos_reader;
  Mrr_ordered_index_reader  ordered_index_reader;
  Mrr_simple_index_reader   simple_index_reader;
};


#define DSMRR_IMPL_SORT_KEYS   HA_MRR_IMPLEMENTATION_FLAG1
#define DSMRR_IMPL_SORT_ROWIDS HA_MRR_IMPLEMENTATION_FLAG2

/*
  DS-MRR implementation for one table. Create/use one object of this class for
  each ha_{myisam/innobase/etc} object. That object will be further referred to
  as "the handler"

  DsMrr_impl supports has the following execution strategies:

  - Bypass DS-MRR, pass all calls to default MRR implementation, which is 
    an MRR-to-non-MRR call converter.
  - Key-Ordered Retrieval
  - Rowid-Ordered Retrieval

  DsMrr_impl will use one of the above strategies, or a combination of them, 
  according to the following diagram:

         (mrr function calls)
                |
                +----------------->-----------------+
                |                                   |
     ___________v______________      _______________v________________
    / default: use lookup keys \    / KEY-ORDERED RETRIEVAL:         \
    | (or ranges) in whatever  |    | sort lookup keys and then make | 
    | order they are supplied  |    | index lookups in index order   |
    \__________________________/    \________________________________/
              | |  |                           |    |
      +---<---+ |  +--------------->-----------|----+
      |         |                              |    |
      |         |              +---------------+    |
      |   ______v___ ______    |     _______________v_______________
      |  / default: read   \   |    / ROWID-ORDERED RETRIEVAL:      \
      |  | table records   |   |    | Before reading table records, |
      v  | in random order |   v    | sort their rowids and then    |
      |  \_________________/   |    | read them in rowid order      |
      |         |              |    \_______________________________/
      |         |              |                    |
      |         |              |                    |
      +-->---+  |  +----<------+-----------<--------+
             |  |  |                                
             v  v  v
      (table records and range_ids)

  The choice of strategy depends on MRR scan properties, table properties
  (whether we're scanning clustered primary key), and @@optimizer_switch
  settings.
  
  Key-Ordered Retrieval
  ---------------------
  The idea is: if MRR scan is essentially a series of lookups on 
   
    tbl.key=value1 OR tbl.key=value2 OR ... OR tbl.key=valueN
  
  then it makes sense to collect and order the set of lookup values, i.e.
   
     sort(value1, value2, .. valueN)

  and then do index lookups in index order. This results in fewer index page
  fetch operations, and we also can avoid making multiple index lookups for the
  same value. That is, if value1=valueN we can easily discover that after
  sorting and make one index lookup for them instead of two.

  Rowid-Ordered Retrieval
  -----------------------
  If we do a regular index scan or a series of index lookups, we'll be hitting
  table records at random. For disk-based engines, this is much slower than 
  reading the same records in disk order. We assume that disk ordering of
  rows is the same as ordering of their rowids (which is provided by 
  handler::cmp_ref())
  In order to retrieve records in different order, we must separate index
  scanning and record fetching, that is, MRR scan uses the following steps:

    1. Scan the index (and only index, that is, with HA_EXTRA_KEYREAD on) and 
        fill a buffer with {rowid, range_id} pairs
    2. Sort the buffer by rowid value
    3. for each {rowid, range_id} pair in the buffer
         get record by rowid and return the {record, range_id} pair
    4. Repeat the above steps until we've exhausted the list of ranges we're
       scanning.

  Buffer space management considerations
  --------------------------------------
  With regards to buffer/memory management, MRR interface specifies that 
   - SQL layer provides multi_range_read_init() with buffer of certain size.
   - MRR implementation may use (i.e. have at its disposal till the end of 
     the MRR scan) all of the buffer, or return the unused end of the buffer 
     to SQL layer.

  DS-MRR needs buffer in order to accumulate and sort rowids and/or keys. When
  we need to accumulate/sort only keys (or only rowids), it is fairly trivial.

  When we need to accumulate/sort both keys and rowids, efficient buffer use
  gets complicated. We need to:
   - First, accumulate keys and sort them
   - Then use the keys (smaller values go first) to obtain rowids. A key is not
     needed after we've got matching rowids for it.
   - Make sure that rowids are accumulated at the front of the buffer, so that we
     can return the end part of the buffer to SQL layer, should there be too
     few rowid values to occupy the buffer.

  All of these goals are achieved by using the following scheme:

     |                    |   We get an empty buffer from SQL layer.   

     |                  *-|    
     |               *----|   First, we fill the buffer with keys. Key_buffer
     |            *-------|   part grows from end of the buffer space to start
     |         *----------|   (In this picture, the buffer is big enough to
     |      *-------------|    accomodate all keys and even have some space left)

     |      *=============|   We want to do key-ordered index scan, so we sort
                              the keys

     |-x      *===========|   Then we use the keys get rowids. Rowids are 
     |----x      *========|   stored from start of buffer space towards the end.
     |--------x     *=====|   The part of the buffer occupied with keys
     |------------x   *===|   gradually frees up space for rowids. In this
     |--------------x   *=|   picture we run out of keys before we've ran out
     |----------------x   |   of buffer space (it can be other way as well).

     |================x   |   Then we sort the rowids.
                     
     |                |~~~|   The unused part of the buffer is at the end, so
                              we can return it to the SQL layer.

     |================*       Sorted rowids are then used to read table records 
                              in disk order

*/

class DsMrr_impl
{
public:
  typedef void (handler::*range_check_toggle_func_t)(bool on);

  void init(handler *h_arg, TABLE *table_arg)
  {
    primary_file= h_arg; 
    table= table_arg;
  }
  int dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, 
                 void *seq_init_param, uint n_ranges, uint mode, 
                 HANDLER_BUFFER *buf);
  void dsmrr_close();
  int dsmrr_next(range_id_t *range_info);

  ha_rows dsmrr_info(uint keyno, uint n_ranges, uint keys, uint key_parts, 
                     uint *bufsz, uint *flags, Cost_estimate *cost);

  ha_rows dsmrr_info_const(uint keyno, RANGE_SEQ_IF *seq, 
                            void *seq_init_param, uint n_ranges, uint *bufsz,
                            uint *flags, Cost_estimate *cost);

  int dsmrr_explain_info(uint mrr_mode, char *str, size_t size);
private:
  /* Buffer to store (key, range_id) pairs */
  Lifo_buffer *key_buffer= nullptr;

  /*
    The "owner" handler object (the one that is expected to "own" this object
    and call its functions).
  */
  handler *primary_file;
  TABLE *table; /* Always equal to primary_file->table */

  /*
    Secondary handler object. (created when needed, we need it when we need 
    to run both index scan and rnd_pos() scan at the same time)
  */
  handler *secondary_file= nullptr;

  /*
    The rowid filter that DS-MRR has "unpushed" from the storage engine.
    If it's present, DS-MRR will use it.
  */
  Rowid_filter *rowid_filter= nullptr;

  uint keyno; /* index we're running the scan on */
  /* TRUE <=> need range association, buffers hold {rowid, range_id} pairs */
  bool is_mrr_assoc;

  Mrr_reader_factory reader_factory;

  Mrr_reader *strategy;
  bool strategy_exhausted;

  Mrr_index_reader *index_strategy;

  /* The whole buffer space that we're using */
  uchar *full_buf;
  uchar *full_buf_end;
  
  /* 
    When using both rowid and key buffers: the boundary between key and rowid
    parts of the buffer. This is the "original" value, actual memory ranges 
    used by key and rowid parts may be different because of dynamic space 
    reallocation between them.
  */
  uchar *rowid_buffer_end;
 
  /*
    One of the following two is used for key buffer: forward is used when 
    we only need key buffer, backward is used when we need both key and rowid
    buffers.
  */
  Forward_lifo_buffer forward_key_buf;
  Backward_lifo_buffer backward_key_buf;

  /*
    Buffer to store (rowid, range_id) pairs, or just rowids if 
    is_mrr_assoc==FALSE
  */
  Forward_lifo_buffer rowid_buffer;
  
  bool choose_mrr_impl(uint keyno, ha_rows rows, uint *flags, uint *bufsz, 
                       Cost_estimate *cost);
  bool get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags,
                               uint *buffer_size, uint extra_mem_overhead,
                               Cost_estimate *cost);
  bool check_cpk_scan(THD *thd, TABLE_SHARE *share, uint keyno, uint mrr_flags);

  bool setup_buffer_sharing(uint key_size_in_keybuf, key_part_map key_tuple_map);

  /* Buffer_manager and its member functions */
  Buffer_manager buf_manager;
  static void redistribute_buffer_space(void *dsmrr_arg);
  static void reset_buffer_sizes(void *dsmrr_arg);
  static void do_nothing(void *dsmrr_arg);

  Lifo_buffer* get_key_buffer() { return key_buffer; }

  friend class Key_value_records_iterator;
  friend class Mrr_ordered_index_reader;
  friend class Mrr_ordered_rndpos_reader;

  int  setup_two_handlers();
  void close_second_handler();
};

/**
  @} (end of group DS-MRR declarations)
*/

server/private/procedure.h000064400000015200150400264020011654 0ustar00#ifndef PROCEDURE_INCLUDED
#define PROCEDURE_INCLUDED

/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   Copyright (c) 2009, 2020, 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 */

/* When using sql procedures */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface				/* gcc class implementation */
#endif

/*
  It is necessary to include set_var.h instead of item.h because there
  are dependencies on include order for set_var.h and item.h. This
  will be resolved later.
*/
#include "sql_class.h"                          /* select_result, set_var.h: THD */
#include "set_var.h"                            /* Item */

#define PROC_NO_SORT 1				/**< Bits in flags */
#define PROC_GROUP   2				/**< proc must have group */

/* Procedure items used by procedures to store values for send_result_set_metadata */

class Item_proc :public Item
{
public:
  Item_proc(THD *thd, const char *name_par): Item(thd)
  {
     this->name.str=    name_par;
     this->name.length= strlen(name_par);
  }
  enum Type type() const override { return Item::PROC_ITEM; }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    /*
      We can get to here when using a CURSOR for a query with PROCEDURE:
        DECLARE c CURSOR FOR SELECT * FROM t1 PROCEDURE analyse();
        OPEN c;
    */
    return create_tmp_field_ex_simple(root, table, src, param);
  }
  virtual void set(double nr)=0;
  virtual void set(const char *str,uint length,CHARSET_INFO *cs)=0;
  virtual void set(longlong nr)=0;
  const Type_handler *type_handler() const override=0;
  void set(const char *str) { set(str,(uint) strlen(str), default_charset()); }
  unsigned int size_of() { return sizeof(*this);}
  bool check_vcol_func_processor(void *arg) override
  {
    DBUG_ASSERT(0); // impossible
    return mark_unsupported_function("proc", arg, VCOL_IMPOSSIBLE);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
  Item* do_get_copy(THD *thd) const override { return 0; }
};

class Item_proc_real :public Item_proc
{
  double value;
public:
  Item_proc_real(THD *thd, const char *name_par, uint dec):
    Item_proc(thd, name_par)
  {
     decimals=dec; max_length=float_length(dec);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  void set(double nr) override { value=nr; }
  void set(longlong nr) override { value=(double) nr; }
  void set(const char *str,uint length,CHARSET_INFO *cs) override
  {
    int err_not_used;
    char *end_not_used;
    value= cs->strntod((char*) str,length, &end_not_used, &err_not_used);
  }
  double val_real() override { return value; }
  longlong val_int() override { return (longlong) value; }
  String *val_str(String *s) override
  {
    s->set_real(value,decimals,default_charset());
    return s;
  }
  my_decimal *val_decimal(my_decimal *) override;
  unsigned int size_of() { return sizeof(*this);}
};

class Item_proc_int :public Item_proc
{
  longlong value;
public:
  Item_proc_int(THD *thd, const char *name_par): Item_proc(thd, name_par)
  { max_length=11; }
  const Type_handler *type_handler() const override
  {
    if (unsigned_flag)
      return &type_handler_ulonglong;
    return &type_handler_slonglong;
  }
  void set(double nr) override { value=(longlong) nr; }
  void set(longlong nr) override { value=nr; }
  void set(const char *str,uint length, CHARSET_INFO *cs) override
  { int err; value= cs->strntoll(str,length,10,NULL,&err); }
  double val_real() override { return (double) value; }
  longlong val_int() override { return value; }
  String *val_str(String *s) override
  { s->set(value, default_charset()); return s; }
  my_decimal *val_decimal(my_decimal *) override;
  unsigned int size_of() { return sizeof(*this);}
  Item *do_get_copy(THD *thd) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
};


class Item_proc_string :public Item_proc
{
  String value;
public:
  Item_proc_string(THD *thd, const char *name_par, uint length):
    Item_proc(thd, name_par)
  {
    this->max_length=length;
    value.set_thread_specific();
  }
  const Type_handler *type_handler() const override
  { return &type_handler_varchar; }
  void set(double nr) override { value.set_real(nr, 2, default_charset()); }
  void set(longlong nr) override { value.set(nr, default_charset()); }
  void set(const char *str, uint length, CHARSET_INFO *cs) override
  { value.copy(str,length,cs); }
  double val_real() override
  {
    int err_not_used;
    char *end_not_used;
    CHARSET_INFO *cs= value.charset();
    return cs->strntod((char*) value.ptr(), value.length(),
		       &end_not_used, &err_not_used);
  }
  longlong val_int() override
  { 
    int err;
    CHARSET_INFO *cs=value.charset();
    return cs->strntoll(value.ptr(), value.length(), 10, NULL, &err);
  }
  String *val_str(String*) override
  {
    return null_value ? (String*) 0 : &value;
  }
  my_decimal *val_decimal(my_decimal *) override;
  void cleanup() override { value.free(); }
  unsigned int size_of() { return sizeof(*this);}  
  Item *do_get_copy(THD *thd) const override { return nullptr; }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
};

/* The procedure class definitions */

class Procedure {
protected:
  List<Item> *fields;
  select_result *result;
public:
  const uint flags;
  ORDER *group,*param_fields;
  Procedure(select_result *res,uint flags_par) :result(res),flags(flags_par),
    group(0),param_fields(0) {}
  virtual ~Procedure() {group=param_fields=0; fields=0; }
  virtual void add(void)=0;
  virtual void end_group(void)=0;
  virtual int send_row(List<Item> &fields)=0;
  virtual bool change_columns(THD *thd, List<Item> &fields)= 0;
  virtual void update_refs(void) {}
  virtual int end_of_records() { return 0; }
};

Procedure *setup_procedure(THD *thd,ORDER *proc_param,select_result *result,
			   List<Item> &field_list,int *error);

#endif /* PROCEDURE_INCLUDED */
server/private/threadpool_generic.h000064400000007601150400264020013527 0ustar00/* Copyright(C) 2019, 2020, MariaDB
 *
 * This program is free software; you can redistribute itand /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 Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/

#if defined (HAVE_POOL_OF_THREADS)
#include <my_global.h>
#include <sql_plist.h>
#include <my_pthread.h>
#include <mysqld.h>
#include <threadpool.h>
#include <violite.h>

#ifdef _WIN32
#include <windows.h>
#include "threadpool_winsockets.h"
/* AIX may define this, too ?*/
#define HAVE_IOCP
#endif


#ifdef _WIN32
typedef HANDLE TP_file_handle;
#else
typedef int TP_file_handle;
#define  INVALID_HANDLE_VALUE -1
#endif

#ifdef __linux__
#include <sys/epoll.h>
typedef struct epoll_event native_event;
#elif defined(HAVE_KQUEUE)
#include <sys/event.h>
typedef struct kevent native_event;
#elif defined (__sun)
#include <port.h>
typedef port_event_t native_event;
#elif defined (HAVE_IOCP)
typedef OVERLAPPED_ENTRY native_event;
#else
#error threadpool is not available on this platform
#endif

struct thread_group_t;

/* Per-thread structure for workers */
struct worker_thread_t
{
  ulonglong  event_count; /* number of request handled by this thread */
  thread_group_t* thread_group;
  worker_thread_t* next_in_list;
  worker_thread_t** prev_in_list;
  mysql_cond_t  cond;
  bool          woken;
};

typedef I_P_List<worker_thread_t, I_P_List_adapter<worker_thread_t,
  & worker_thread_t::next_in_list,
  & worker_thread_t::prev_in_list>,
  I_P_List_counter
>
worker_list_t;

struct TP_connection_generic :public TP_connection
{
  TP_connection_generic(CONNECT* c);
  ~TP_connection_generic();

  int init() override { return 0; }
  void set_io_timeout(int sec) override;
  int  start_io() override;
  void wait_begin(int type) override;
  void wait_end() override;

  thread_group_t* thread_group;
  TP_connection_generic* next_in_queue;
  TP_connection_generic** prev_in_queue;
  ulonglong abs_wait_timeout;
  ulonglong enqueue_time;
  TP_file_handle fd;
  bool bound_to_poll_descriptor;
  int waiting;
  bool fix_group;
#ifdef _WIN32
  win_aiosocket win_sock{};
  void init_vio(st_vio *vio) override
  { win_sock.init(vio);}
#endif

};


typedef I_P_List<TP_connection_generic,
  I_P_List_adapter<TP_connection_generic,
  & TP_connection_generic::next_in_queue,
  & TP_connection_generic::prev_in_queue>,
  I_P_List_counter,
  I_P_List_fast_push_back<TP_connection_generic> >
  connection_queue_t;

const int NQUEUES = 2; /* We have high and low priority queues*/

enum class operation_origin
{
  WORKER,
  LISTENER
};

struct thread_group_counters_t
{
  ulonglong thread_creations;
  ulonglong thread_creations_due_to_stall;
  ulonglong wakes;
  ulonglong wakes_due_to_stall;
  ulonglong throttles;
  ulonglong stalls;
  ulonglong dequeues[2];
  ulonglong polls[2];
};

struct thread_group_t
{
  mysql_mutex_t mutex;
  connection_queue_t queues[NQUEUES];
  worker_list_t waiting_threads;
  worker_thread_t* listener;
  pthread_attr_t* pthread_attr;
  TP_file_handle  pollfd;
  int  thread_count;
  int  active_thread_count;
  int  connection_count;
  /* Stats for the deadlock detection timer routine.*/
  int io_event_count;
  int queue_event_count;
  ulonglong last_thread_creation_time;
  int  shutdown_pipe[2];
  bool shutdown;
  bool stalled;
  thread_group_counters_t counters;
  char pad[CPU_LEVEL1_DCACHE_LINESIZE];
};

#define TP_INCREMENT_GROUP_COUNTER(group,var) do {group->counters.var++;}while(0)

extern thread_group_t* all_groups;
#endif

server/private/discover.h000064400000003042150400264020011503 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef DISCOVER_INCLUDED
#define DISCOVER_INCLUDED

int extension_based_table_discovery(MY_DIR *dirp, const char *ext,
                                    handlerton::discovered_list *tl);

#ifdef MYSQL_SERVER
int readfrm(const char *name, const uchar **data, size_t *length);
int writefile(const char *path, const char *db, const char *table,
              bool tmp_table, const uchar *frmdata, size_t len);

/* a helper to delete an frm file, given a path w/o .frm extension */
inline void deletefrm(const char *path)
{
  char frm_name[FN_REFLEN];
  strxnmov(frm_name, sizeof(frm_name)-1, path, reg_ext, NullS);
  mysql_file_delete(key_file_frm, frm_name, MYF(0));
}

int ext_table_discovery_simple(MY_DIR *dirp,
                               handlerton::discovered_list *result);
#endif

#endif /* DISCOVER_INCLUDED */
server/private/records.h000064400000006113150400264020011330 0ustar00#ifndef SQL_RECORDS_H
#define SQL_RECORDS_H 
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface                      /* gcc class implementation */
#endif

#include "table.h"

struct st_join_table;
class handler;
class THD;
class SQL_SELECT;
class Copy_field;
class SORT_INFO;

struct READ_RECORD;

void end_read_record(READ_RECORD *info);
void free_cache(READ_RECORD *info);

/**
  A context for reading through a single table using a chosen access method:
  index read, scan, etc, use of cache, etc.

  Use by:
  READ_RECORD read_record;
  init_read_record(&read_record, ...);
  while (read_record.read_record())
  {
    ...
  }
  end_read_record();
*/

struct READ_RECORD
{
  typedef int (*Read_func)(READ_RECORD*);
  typedef void (*Unlock_row_func)(st_join_table *);
  typedef int (*Setup_func)(struct st_join_table*);

  TABLE *table;                                 /* Head-form */
  Unlock_row_func unlock_row;
  Read_func read_record_func;
  Read_func read_record_func_and_unpack_calls;
  THD *thd;
  SQL_SELECT *select;
  uint ref_length, reclength, rec_cache_size, error_offset;

  /**
    Counting records when reading result from filesort().
    Used when filesort leaves the result in the filesort buffer.
   */
  ha_rows unpack_counter;

  uchar *ref_pos;				/* pointer to form->refpos */
  uchar *rec_buf;                /* to read field values  after filesort */
  uchar	*cache,*cache_pos,*cache_end,*read_positions;

  /*
    Structure storing information about sorting
  */
  SORT_INFO *sort_info;
  struct st_io_cache *io_cache;
  bool print_error;

  int read_record() { return read_record_func(this); }
  uchar *record() const { return table->record[0]; }

  /* 
    SJ-Materialization runtime may need to read fields from the materialized
    table and unpack them into original table fields:
  */
  Copy_field *copy_field;
  Copy_field *copy_field_end;
public:
  READ_RECORD() : table(NULL), cache(NULL) {}
  ~READ_RECORD() { end_read_record(this); }
};

bool init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
		      SQL_SELECT *select, SORT_INFO *sort,
                      int use_record_cache,
                      bool print_errors, bool disable_rr_cache);
bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
                          bool print_error, uint idx, bool reverse);

void rr_unlock_row(st_join_table *tab);

#endif /* SQL_RECORDS_H */
server/private/my_apc.h000064400000011213150400264020011134 0ustar00#ifndef SQL_MY_APC_INCLUDED
#define SQL_MY_APC_INCLUDED
/*
   Copyright (c) 2011, 2013 Monty Program Ab.

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*
  Interface
  ~~~~~~~~~
   (
    - This is an APC request queue
    - We assume there is a particular owner thread which periodically calls
      process_apc_requests() to serve the call requests.
    - Other threads can post call requests, and block until they are exectued.
  )

  Implementation
  ~~~~~~~~~~~~~~
  - The target has a mutex-guarded request queue.

  - After the request has been put into queue, the requestor waits for request
    to be satisfied. The worker satisifes the request and signals the
    requestor.
*/

class THD;

/*
  Target for asynchronous procedure calls (APCs). 
   - A target is running in some particular thread, 
   - One can make calls to it from other threads.
*/
class Apc_target
{
  mysql_mutex_t *LOCK_thd_kill_ptr;
public:
  Apc_target() : enabled(0), apc_calls(NULL) {} 
  ~Apc_target() { DBUG_ASSERT(!enabled && !apc_calls);}

  void init(mysql_mutex_t *target_mutex);

  /* Destroy the target. The target must be disabled when this call is made. */
  void destroy() { DBUG_ASSERT(!enabled); }

  /* Enter ther state where the target is available for serving APC requests */
  void enable() { enabled++; }

  /*
    Make the target unavailable for serving APC requests.

    @note
      This call will serve all requests that were already enqueued
  */
  void disable()
  {
    DBUG_ASSERT(enabled);
    mysql_mutex_lock(LOCK_thd_kill_ptr);
    bool process= !--enabled && have_apc_requests();
    mysql_mutex_unlock(LOCK_thd_kill_ptr);
    if (unlikely(process))
      process_apc_requests(true);
  }

  void process_apc_requests(bool force);
  /* 
    A lightweight function, intended to be used in frequent checks like this:

      if (apc_target.have_requests()) apc_target.process_apc_requests()
  */
  inline bool have_apc_requests()
  {
    return MY_TEST(apc_calls);
  }

  inline bool is_enabled() { return enabled; }
  
  /* Functor class for calls you can schedule */
  class Apc_call
  {
  public:
    /* This function will be called in the target thread */
    virtual void call_in_target_thread()= 0;
    virtual ~Apc_call() = default;
  };
  
  /* Make a call in the target thread (see function definition for details) */
  bool make_apc_call(THD *caller_thd, Apc_call *call, int timeout_sec, bool *timed_out);

#ifndef DBUG_OFF
  int n_calls_processed; /* Number of calls served by this target */
#endif
private:
  class Call_request;

  /* 
    Non-zero value means we're enabled. It's an int, not bool, because one can
    call enable() N times (and then needs to call disable() N times before the 
    target is really disabled)
  */
  int enabled;

  /* 
    Circular, double-linked list of all enqueued call requests. 
    We use this structure, because we 
     - process requests sequentially: requests are added at the end of the 
       list and removed from the front. With circular list, we can keep one
       pointer, and access both front an back of the list with it.
     - a thread that has posted a request may time out (or be KILLed) and 
       cancel the request, which means we need a fast request-removal
       operation.
  */
  Call_request *apc_calls;
 
  class Call_request
  {
  public:
    Apc_call *call; /* Functor to be called */

    /* The caller will actually wait for "processed==TRUE" */
    bool processed;

    /* Condition that will be signalled when the request has been served */
    mysql_cond_t COND_request;
    
    /* Double linked-list linkage */
    Call_request *next;
    Call_request *prev;
    
    const char *what; /* (debug) state of the request */
  };

  void enqueue_request(Call_request *qe);
  void dequeue_request(Call_request *qe);

  /* return the first call request in queue, or NULL if there are none enqueued */
  Call_request *get_first_in_queue()
  {
    return apc_calls;
  }
};

#ifdef HAVE_PSI_INTERFACE
void init_show_explain_psi_keys(void);
#else
#define init_show_explain_psi_keys() /* no-op */
#endif

#endif //SQL_MY_APC_INCLUDED

server/private/sql_bootstrap.h000064400000003424150400264020012565 0ustar00/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

   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,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */


#ifndef SQL_BOOTSTRAP_H
#define SQL_BOOTSTRAP_H

/**
  The maximum size of a bootstrap query.
  Increase this size if parsing a longer query during bootstrap is necessary.
  The longest query in use depends on the documentation content,
  see the file fill_help_tables.sql
*/
#define MAX_BOOTSTRAP_QUERY_SIZE 60000
/**
  The maximum size of a bootstrap query, expressed in a single line.
  Do not increase this size, use the multiline syntax instead.
*/
#define MAX_BOOTSTRAP_LINE_SIZE 20000
#define MAX_BOOTSTRAP_ERROR_LEN 256

#define READ_BOOTSTRAP_SUCCESS     0
#define READ_BOOTSTRAP_EOF         1
#define READ_BOOTSTRAP_ERROR       2
#define READ_BOOTSTRAP_QUERY_SIZE  3

typedef void *fgets_input_t;
typedef char * (*fgets_fn_t)(char *, size_t, fgets_input_t, int *error);

#ifdef __cplusplus
extern "C" {
#endif
int read_bootstrap_query(char *query, int *query_length, fgets_input_t input,
                           fgets_fn_t fgets_fn,
                           int preserve_delimiter,
                           int *error);
#ifdef __cplusplus
}
#endif

#endif


server/private/pfs_stage_provider.h000064400000003024150400264020013552 0ustar00/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.

  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,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_STAGE_PROVIDER_H
#define PFS_STAGE_PROVIDER_H

/**
  @file include/pfs_stage_provider.h
  Performance schema instrumentation (declarations).
*/

#ifdef HAVE_PSI_STAGE_INTERFACE
#ifdef MYSQL_SERVER
#ifndef EMBEDDED_LIBRARY
#ifndef MYSQL_DYNAMIC_PLUGIN

#include "mysql/psi/psi.h"

#define PSI_STAGE_CALL(M) pfs_ ## M ## _v1

C_MODE_START

void pfs_register_stage_v1(const char *category,
                           PSI_stage_info_v1 **info_array,
                           int count);

PSI_stage_progress* pfs_start_stage_v1(PSI_stage_key key, const char *src_file, int src_line);
PSI_stage_progress* pfs_get_current_stage_progress_v1();

void pfs_end_stage_v1();

C_MODE_END

#endif /* MYSQL_DYNAMIC_PLUGIN */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_SERVER */
#endif /* HAVE_PSI_STAGE_INTERFACE */

#endif

server/private/item_func.h000064400000412717150400264020011653 0ustar00#ifndef ITEM_FUNC_INCLUDED
#define ITEM_FUNC_INCLUDED
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
   Copyright (c) 2009, 2021, MariaDB

   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 Street, Fifth Floor, Boston, MA  02110-1335  USA */


/* Function items used by mysql */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface			/* gcc class implementation */
#endif

#ifdef HAVE_IEEEFP_H
extern "C"				/* Bug in BSDI include file */
{
#include <ieeefp.h>
}
#endif

#include "sql_udf.h"    // udf_handler
#include "my_decimal.h" // string2my_decimal
#include <cmath>


extern int st_append_json(String *s,
             CHARSET_INFO *json_cs, const uchar *js, uint js_len);
class Item_func :public Item_func_or_sum
{
  void sync_with_sum_func_and_with_field(List<Item> &list);
protected:
  virtual bool check_arguments() const
  {
    return check_argument_types_scalar(0, arg_count);
  }
  bool check_argument_types_like_args0() const;
  bool check_argument_types_scalar(uint start, uint end) const;
  bool check_argument_types_traditional_scalar(uint start, uint end) const;
  bool check_argument_types_or_binary(const Type_handler *handler,
                                      uint start, uint end) const;
  bool check_argument_types_can_return_int(uint start, uint end) const;
  bool check_argument_types_can_return_real(uint start, uint end) const;
  bool check_argument_types_can_return_str(uint start, uint end) const;
  bool check_argument_types_can_return_text(uint start, uint end) const;
  bool check_argument_types_can_return_date(uint start, uint end) const;
  bool check_argument_types_can_return_time(uint start, uint end) const;
  void print_cast_temporal(String *str, enum_query_type query_type);

  void print_schema_qualified_name(String *to,
                                   const LEX_CSTRING &schema_name,
                                   const LEX_CSTRING &function_name) const
  {
    // e.g. oracle_schema.func()
    to->append(schema_name);
    to->append('.');
    to->append(function_name);
  }

  void print_sql_mode_qualified_name(String *to,
                                     enum_query_type query_type,
                                     const LEX_CSTRING &function_name) const
  {
    const Schema *func_schema= schema();
    if (!func_schema || func_schema == Schema::find_implied(current_thd))
      to->append(function_name);
    else
      print_schema_qualified_name(to, func_schema->name(), function_name);
  }

  void print_sql_mode_qualified_name(String *to, enum_query_type query_type)
                                                                       const
  {
    return print_sql_mode_qualified_name(to, query_type, func_name_cstring());
  }

public:

  // Print an error message for a builtin-schema qualified function call
  static void wrong_param_count_error(const LEX_CSTRING &schema_name,
                                      const LEX_CSTRING &func_name);

  table_map not_null_tables_cache= 0;

  enum Functype { UNKNOWN_FUNC,EQ_FUNC,EQUAL_FUNC,NE_FUNC,LT_FUNC,LE_FUNC,
		  GE_FUNC,GT_FUNC,FT_FUNC,
		  LIKE_FUNC,ISNULL_FUNC,ISNOTNULL_FUNC,
		  COND_AND_FUNC, COND_OR_FUNC, XOR_FUNC,
                  BETWEEN, IN_FUNC, MULT_EQUAL_FUNC,
		  INTERVAL_FUNC, ISNOTNULLTEST_FUNC,
		  SP_EQUALS_FUNC, SP_DISJOINT_FUNC,SP_INTERSECTS_FUNC,
		  SP_TOUCHES_FUNC,SP_CROSSES_FUNC,SP_WITHIN_FUNC,
		  SP_CONTAINS_FUNC,SP_OVERLAPS_FUNC,
		  SP_STARTPOINT,SP_ENDPOINT,SP_EXTERIORRING,
		  SP_POINTN,SP_GEOMETRYN,SP_INTERIORRINGN, SP_RELATE_FUNC,
                  NOT_FUNC, NOT_ALL_FUNC, TEMPTABLE_ROWID,
                  NOW_FUNC, NOW_UTC_FUNC, SYSDATE_FUNC, TRIG_COND_FUNC,
                  SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC,
                  EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC,
                  NEG_FUNC, GSYSVAR_FUNC, IN_OPTIMIZER_FUNC, DYNCOL_FUNC,
                  JSON_EXTRACT_FUNC, JSON_VALID_FUNC, ROWNUM_FUNC,
                  CASE_SEARCHED_FUNC, // Used by ColumnStore/Spider
                  CASE_SIMPLE_FUNC,   // Used by ColumnStore/spider,
                };

  /*
    A function bitmap. Useful when some operation needs to be applied only
    to certain functions. For now we only need to distinguish some
    comparison predicates.
  */
  enum Bitmap : ulonglong
  {
    BITMAP_NONE= 0,
    BITMAP_EQ=         1ULL << EQ_FUNC,
    BITMAP_EQUAL=      1ULL << EQUAL_FUNC,
    BITMAP_NE=         1ULL << NE_FUNC,
    BITMAP_LT=         1ULL << LT_FUNC,
    BITMAP_LE=         1ULL << LE_FUNC,
    BITMAP_GE=         1ULL << GE_FUNC,
    BITMAP_GT=         1ULL << GT_FUNC,
    BITMAP_LIKE=       1ULL << LIKE_FUNC,
    BITMAP_BETWEEN=    1ULL << BETWEEN,
    BITMAP_IN=         1ULL << IN_FUNC,
    BITMAP_MULT_EQUAL= 1ULL << MULT_EQUAL_FUNC,
    BITMAP_OTHER=      1ULL << 63,
    BITMAP_ALL=        0xFFFFFFFFFFFFFFFFULL,
    BITMAP_ANY_EQUALITY= BITMAP_EQ | BITMAP_EQUAL | BITMAP_MULT_EQUAL,
    BITMAP_EXCEPT_ANY_EQUALITY= BITMAP_ALL & ~BITMAP_ANY_EQUALITY,
  };

  ulonglong bitmap_bit() const
  {
    Functype type= functype();
    return 1ULL << (type > 63 ? 63 : type);
  }

  static scalar_comparison_op functype_to_scalar_comparison_op(Functype type)
  {
    switch (type) {
    case EQ_FUNC:    return SCALAR_CMP_EQ;
    case EQUAL_FUNC: return SCALAR_CMP_EQUAL;
    case LT_FUNC:    return SCALAR_CMP_LT;
    case LE_FUNC:    return SCALAR_CMP_LE;
    case GE_FUNC:    return SCALAR_CMP_GE;
    case GT_FUNC:    return SCALAR_CMP_GT;
    default: break;
    }
    DBUG_ASSERT(0);
    return SCALAR_CMP_EQ;
  }
  enum Type type() const override { return FUNC_ITEM; }
  virtual enum Functype functype() const   { return UNKNOWN_FUNC; }
  Item_func(THD *thd): Item_func_or_sum(thd)
  {
    DBUG_ASSERT(with_flags == item_with_t::NONE);
    with_flags= item_with_t::NONE;
  }
  Item_func(THD *thd, Item *a): Item_func_or_sum(thd, a)
  {
    with_flags= a->with_flags;
  }
  Item_func(THD *thd, Item *a, Item *b):
    Item_func_or_sum(thd, a, b)
  {
    with_flags= a->with_flags | b->with_flags;
  }
  Item_func(THD *thd, Item *a, Item *b, Item *c):
    Item_func_or_sum(thd, a, b, c)
  {
    with_flags|= a->with_flags | b->with_flags | c->with_flags;
  }
  Item_func(THD *thd, Item *a, Item *b, Item *c, Item *d):
    Item_func_or_sum(thd, a, b, c, d)
  {
    with_flags= a->with_flags | b->with_flags | c->with_flags | d->with_flags;
  }
  Item_func(THD *thd, Item *a, Item *b, Item *c, Item *d, Item* e):
    Item_func_or_sum(thd, a, b, c, d, e)
  {
    with_flags= (a->with_flags | b->with_flags | c->with_flags | d->with_flags |
                 e->with_flags);
  }
  Item_func(THD *thd, List<Item> &list):
    Item_func_or_sum(thd, list)
  {
    set_arguments(thd, list);
  }
  // Constructor used for Item_cond_and/or (see Item comment)
  Item_func(THD *thd, Item_func *item):
    Item_func_or_sum(thd, item),
    not_null_tables_cache(item->not_null_tables_cache)
  { }
  bool fix_fields(THD *, Item **ref) override;
  void cleanup() override
  {
    Item_func_or_sum::cleanup();
    used_tables_and_const_cache_init();
  }
  void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
    override;
  void quick_fix_field() override;
  table_map not_null_tables() const override;
  void update_used_tables() override
  {
    used_tables_and_const_cache_init();
    used_tables_and_const_cache_update_and_join(arg_count, args);
  }
  COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
                          bool link_item_fields,
                          COND_EQUAL **cond_equal_ref) override;
  SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override
  {
    DBUG_ENTER("Item_func::get_mm_tree");
    DBUG_RETURN(const_item() ? get_mm_tree_for_const(param) : NULL);
  }
  bool eq(const Item *item, bool binary_cmp) const override;
  virtual Item *key_item() const { return args[0]; }
  void set_arguments(THD *thd, List<Item> &list)
  {
    Item_args::set_arguments(thd, list);
    sync_with_sum_func_and_with_field(list);
    list.empty();                                     // Fields are used
  }
  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
                      List<Item> &fields, uint flags) override;
  void print(String *str, enum_query_type query_type) override;
  void print_op(String *str, enum_query_type query_type);
  void print_args(String *str, uint from, enum_query_type query_type) const;
  void print_args_parenthesized(String *str, enum_query_type query_type) const
  {
    str->append('(');
    print_args(str, 0, query_type);
    str->append(')');
  }
  bool is_null() override
  {
    update_null_value();
    return null_value;
  }
  String *val_str_from_val_str_ascii(String *str, String *str2);

  void signal_divide_by_null();
  friend class udf_handler;
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  { return tmp_table_field_from_field_type(root, table); }
  Item *get_tmp_table_item(THD *thd) override;

  void fix_char_length_ulonglong(ulonglong max_char_length_arg)
  {
    ulonglong max_result_length= max_char_length_arg *
                                 collation.collation->mbmaxlen;
    if (max_result_length >= MAX_BLOB_WIDTH)
    {
      max_length= MAX_BLOB_WIDTH;
      set_maybe_null();
    }
    else
      max_length= (uint32) max_result_length;
  }
  Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
  Item* compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
                Item_transformer transformer, uchar *arg_t) override;
  void traverse_cond(Cond_traverser traverser,
                     void * arg, traverse_order order) override;
  bool eval_not_null_tables(void *opt_arg) override;
  bool find_not_null_fields(table_map allowed) override;
 // bool is_expensive_processor(void *arg);
 // virtual bool is_expensive() { return 0; }
  inline void raise_numeric_overflow(const char *type_name)
  {
    char buf[256];
    String str(buf, sizeof(buf), system_charset_info);
    str.length(0);
    print(&str, QT_NO_DATA_EXPANSION);
    my_error(ER_DATA_OUT_OF_RANGE, MYF(0), type_name, str.c_ptr_safe());
  }
  inline double raise_float_overflow()
  {
    raise_numeric_overflow("DOUBLE");
    return 0.0;
  }
  inline longlong raise_integer_overflow()
  {
    raise_numeric_overflow(unsigned_flag ? "BIGINT UNSIGNED": "BIGINT");
    return 0;
  }
  inline int raise_decimal_overflow()
  {
    raise_numeric_overflow("DECIMAL");
    return E_DEC_OVERFLOW;
  }
  /**
     Throw an error if the input double number is not finite, i.e. is either
     +/-INF or NAN.
  */
  inline double check_float_overflow(double value)
  {
    return std::isfinite(value) ? value : raise_float_overflow();
  }
  /**
    Throw an error if the input BIGINT value represented by the
    (longlong value, bool unsigned flag) pair cannot be returned by the
    function, i.e. is not compatible with this Item's unsigned_flag.
  */
  inline longlong check_integer_overflow(longlong value, bool val_unsigned)
  {
    return check_integer_overflow(Longlong_hybrid(value, val_unsigned));
  }

  // Check if the value is compatible with Item::unsigned_flag.
  inline longlong check_integer_overflow(const Longlong_hybrid &sval)
  {
    Longlong_null res= sval.val_int(unsigned_flag);
    return res.is_null() ? raise_integer_overflow() : res.value();
  }

  // Check if the value is compatible with Item::unsigned_flag.
  longlong check_integer_overflow(const ULonglong_hybrid &uval)
  {
    Longlong_null res= uval.val_int(unsigned_flag);
    return res.is_null() ? raise_integer_overflow() : res.value();
  }

  /**
     Throw an error if the error code of a DECIMAL operation is E_DEC_OVERFLOW.
  */
  inline int check_decimal_overflow(int error)
  {
    return (error == E_DEC_OVERFLOW) ? raise_decimal_overflow() : error;
  }

  bool has_timestamp_args()
  {
    DBUG_ASSERT(fixed());
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->type() == Item::FIELD_ITEM &&
          args[i]->field_type() == MYSQL_TYPE_TIMESTAMP)
        return TRUE;
    }
    return FALSE;
  }

  bool has_date_args()
  {
    DBUG_ASSERT(fixed());
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->type() == Item::FIELD_ITEM &&
          (args[i]->field_type() == MYSQL_TYPE_DATE ||
           args[i]->field_type() == MYSQL_TYPE_DATETIME))
        return TRUE;
    }
    return FALSE;
  }

  bool has_time_args()
  {
    DBUG_ASSERT(fixed());
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->type() == Item::FIELD_ITEM &&
          (args[i]->field_type() == MYSQL_TYPE_TIME ||
           args[i]->field_type() == MYSQL_TYPE_DATETIME))
        return TRUE;
    }
    return FALSE;
  }

  bool has_datetime_args()
  {
    DBUG_ASSERT(fixed());
    for (uint i= 0; i < arg_count; i++)
    {
      if (args[i]->type() == Item::FIELD_ITEM &&
          args[i]->field_type() == MYSQL_TYPE_DATETIME)
        return TRUE;
    }
    return FALSE;
  }

  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  {
    /*
      By default only substitution for a field whose two different values
      are never equal is allowed in the arguments of a function.
      This is overruled for the direct arguments of comparison functions.
    */
    Item_args::propagate_equal_fields(thd, Context_identity(), cond);
    return this;
  }

  bool has_rand_bit()
  {
    return used_tables() & RAND_TABLE_BIT;
  }

  bool excl_dep_on_table(table_map tab_map) override
  {
    if (used_tables() & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT))
      return false; 
    return !(used_tables() & ~tab_map) || 
           Item_args::excl_dep_on_table(tab_map);
  }

  bool excl_dep_on_grouping_fields(st_select_lex *sel) override
  {
    if (has_rand_bit() || with_subquery())
      return false;
    return Item_args::excl_dep_on_grouping_fields(sel);
  }

  bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override
  {
    return Item_args::excl_dep_on_in_subq_left_part(subq_pred);
  }

  /*
    We assume the result of any function that has a TIMESTAMP argument to be
    timezone-dependent, since a TIMESTAMP value in both numeric and string
    contexts is interpreted according to the current timezone.
    The only exception is UNIX_TIMESTAMP() which returns the internal
    representation of a TIMESTAMP argument verbatim, and thus does not depend on
    the timezone.
   */
  bool check_valid_arguments_processor(void *bool_arg) override
  {
    return has_timestamp_args();
  }

  bool find_function_processor (void *arg) override
  {
    return functype() == *(Functype *) arg;
  }

  void no_rows_in_result() override
  {
    for (uint i= 0; i < arg_count; i++)
    {
      args[i]->no_rows_in_result();
    }
  }
  void restore_to_before_no_rows_in_result() override
  {
    for (uint i= 0; i < arg_count; i++)
    {
      args[i]->restore_to_before_no_rows_in_result();
    }
  }
  void convert_const_compared_to_int_field(THD *thd);
  Item_func *get_item_func() override { return this; }
  bool is_simplified_cond_processor(void *) override
  { return const_item() && !val_bool(); }
};


class Item_real_func :public Item_func
{
public:
  Item_real_func(THD *thd): Item_func(thd) { collation= DTCollation_numeric(); }
  Item_real_func(THD *thd, Item *a): Item_func(thd, a)
  { collation= DTCollation_numeric(); }
  Item_real_func(THD *thd, Item *a, Item *b): Item_func(thd, a, b)
  { collation= DTCollation_numeric(); }
  Item_real_func(THD *thd, List<Item> &list): Item_func(thd, list)
  { collation= DTCollation_numeric(); }
  String *val_str(String*str) override;
  my_decimal *val_decimal(my_decimal *decimal_value) override;
  longlong val_int() override
  {
    DBUG_ASSERT(fixed());
    return Converter_double_to_longlong(val_real(), unsigned_flag).result();
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_real(thd, ltime, fuzzydate); }
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  bool fix_length_and_dec() override
  {
    decimals= NOT_FIXED_DEC;
    max_length= float_length(decimals);
    return FALSE;
  }
};


/**
  Functions whose returned field type is determined at fix_fields() time.
*/
class Item_hybrid_func: public Item_func,
                        public Type_handler_hybrid_field_type
{
protected:
  bool fix_attributes(Item **item, uint nitems);
public:
  Item_hybrid_func(THD *thd): Item_func(thd) { }
  Item_hybrid_func(THD *thd, Item *a):  Item_func(thd, a) { }
  Item_hybrid_func(THD *thd, Item *a, Item *b): Item_func(thd, a, b) { }
  Item_hybrid_func(THD *thd, Item *a, Item *b, Item *c):
    Item_func(thd, a, b, c) { }
  Item_hybrid_func(THD *thd, List<Item> &list): Item_func(thd, list) { }
  Item_hybrid_func(THD *thd, Item_hybrid_func *item)
    :Item_func(thd, item), Type_handler_hybrid_field_type(item) { }
  const Type_handler *type_handler() const override
  { return Type_handler_hybrid_field_type::type_handler(); }
  void fix_length_and_dec_long_or_longlong(uint char_length, bool unsigned_arg)
  {
    collation= DTCollation_numeric();
    unsigned_flag= unsigned_arg;
    max_length= char_length;
    set_handler(Type_handler::type_handler_long_or_longlong(char_length,
                                                            unsigned_arg));
  }
  void fix_length_and_dec_ulong_or_ulonglong_by_nbits(uint nbits)
  {
    uint digits= Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits(nbits);
    collation= DTCollation_numeric();
    unsigned_flag= true;
    max_length= digits;
    if (nbits > 32)
      set_handler(&type_handler_ulonglong);
    else
      set_handler(&type_handler_ulong);
  }
};


class Item_handled_func: public Item_func
{
public:
  class Handler
  {
  public:
    virtual ~Handler() = default;
    virtual String *val_str(Item_handled_func *, String *) const= 0;
    virtual String *val_str_ascii(Item_handled_func *, String *) const= 0;
    virtual double val_real(Item_handled_func *) const= 0;
    virtual longlong val_int(Item_handled_func *) const= 0;
    virtual my_decimal *val_decimal(Item_handled_func *, my_decimal *) const= 0;
    virtual bool get_date(THD *thd, Item_handled_func *, MYSQL_TIME *, date_mode_t fuzzydate) const= 0;
    virtual bool val_native(THD *thd, Item_handled_func *, Native *to) const
    {
      DBUG_ASSERT(0);
      to->length(0);
      return true;
    }
    virtual const Type_handler *
      return_type_handler(const Item_handled_func *item) const= 0;
    virtual const Type_handler *
      type_handler_for_create_select(const Item_handled_func *item) const
    {
      return return_type_handler(item);
    }
    virtual bool fix_length_and_dec(Item_handled_func *) const= 0;
  };

  class Handler_str: public Handler
  {
  public:
    String *val_str_ascii(Item_handled_func *item, String *str) const override
    {
      return item->Item::val_str_ascii(str);
    }
    double val_real(Item_handled_func *item) const override
    {
      DBUG_ASSERT(item->fixed());
      StringBuffer<64> tmp;
      String *res= item->val_str(&tmp);
      return res ? item->double_from_string_with_check(res) : 0.0;
    }
    longlong val_int(Item_handled_func *item) const override
    {
      DBUG_ASSERT(item->fixed());
      StringBuffer<22> tmp;
      String *res= item->val_str(&tmp);
      return res ? item->longlong_from_string_with_check(res) : 0;
    }
    my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override
    {
      return item->val_decimal_from_string(to);
    }
    bool get_date(THD *thd, Item_handled_func *item, MYSQL_TIME *to,
                  date_mode_t fuzzydate) const override
    {
      return item->get_date_from_string(thd, to, fuzzydate);
    }
  };

  /**
    Abstract class for functions returning TIME, DATE, DATETIME or string values,
    whose data type depends on parameters and is set at fix_fields time.
  */
  class Handler_temporal: public Handler
  {
  public:
    String *val_str(Item_handled_func *item, String *to) const override
    {
      StringBuffer<MAX_FIELD_WIDTH> ascii_buf;
      return item->val_str_from_val_str_ascii(to, &ascii_buf);
    }
  };

  /**
    Abstract class for functions returning strings,
    which are generated from get_date() results,
    when get_date() can return different MYSQL_TIMESTAMP_XXX per row.
  */
  class Handler_temporal_string: public Handler_temporal
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *) const override
    {
      return &type_handler_string;
    }
    const Type_handler *
      type_handler_for_create_select(const Item_handled_func *item) const override
    {
      return return_type_handler(item)->type_handler_for_tmp_table(item);
    }
    double val_real(Item_handled_func *item) const override
    {
      return Temporal_hybrid(item).to_double();
    }
    longlong val_int(Item_handled_func *item) const override
    {
      return Temporal_hybrid(item).to_longlong();
    }
    my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override
    {
      return Temporal_hybrid(item).to_decimal(to);
    }
    String *val_str_ascii(Item_handled_func *item, String *to) const override
    {
      return Temporal_hybrid(item).to_string(to, item->decimals);
    }
  };


  class Handler_date: public Handler_temporal
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *) const override
    {
      return &type_handler_newdate;
    }
    bool fix_length_and_dec(Item_handled_func *item) const override
    {
      item->fix_attributes_date();
      return false;
    }
    double val_real(Item_handled_func *item) const override
    {
      return Date(item).to_double();
    }
    longlong val_int(Item_handled_func *item) const override
    {
      return Date(item).to_longlong();
    }
    my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override
    {
      return Date(item).to_decimal(to);
    }
    String *val_str_ascii(Item_handled_func *item, String *to) const override
    {
      return Date(item).to_string(to);
    }
  };


  class Handler_time: public Handler_temporal
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *) const override
    {
      return &type_handler_time2;
    }
    double val_real(Item_handled_func *item) const override
    {
      return Time(item).to_double();
    }
    longlong val_int(Item_handled_func *item) const override
    {
      return Time(item).to_longlong();
    }
    my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override
    {
      return Time(item).to_decimal(to);
    }
    String *val_str_ascii(Item_handled_func *item, String *to) const override
    {
      return Time(item).to_string(to, item->decimals);
    }
    bool val_native(THD *thd, Item_handled_func *item, Native *to) const override
    {
      return Time(thd, item).to_native(to, item->decimals);
    }
  };


  class Handler_datetime: public Handler_temporal
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *) const override
    {
      return &type_handler_datetime2;
    }
    double val_real(Item_handled_func *item) const override
    {
      return Datetime(item).to_double();
    }
    longlong val_int(Item_handled_func *item) const override
    {
      return Datetime(item).to_longlong();
    }
    my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override
    {
      return Datetime(item).to_decimal(to);
    }
    String *val_str_ascii(Item_handled_func *item, String *to) const override
    {
      return Datetime(item).to_string(to, item->decimals);
    }
  };


  class Handler_int: public Handler
  {
  public:
    String *val_str(Item_handled_func *item, String *to) const override
    {
      longlong nr= val_int(item);
      if (item->null_value)
        return 0;
      to->set_int(nr, item->unsigned_flag, item->collation.collation);
      return to;
    }
    String *val_str_ascii(Item_handled_func *item, String *to) const override
    {
      return item->Item::val_str_ascii(to);
    }
    double val_real(Item_handled_func *item) const override
    {
      return item->unsigned_flag ? (double) ((ulonglong) val_int(item)) :
                                   (double) val_int(item);
    }
    my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override
    {
      return item->val_decimal_from_int(to);
    }
    bool get_date(THD *thd, Item_handled_func *item,
                  MYSQL_TIME *to, date_mode_t fuzzydate) const override
    {
      return item->get_date_from_int(thd, to, fuzzydate);
    }
    longlong val_int(Item_handled_func *item) const override
    {
      Longlong_null tmp= to_longlong_null(item);
      item->null_value= tmp.is_null();
      return tmp.value();
    }
    virtual Longlong_null to_longlong_null(Item_handled_func *item) const= 0;
  };

  class Handler_slong: public Handler_int
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *item) const override
    {
      return &type_handler_slong;
    }
    bool fix_length_and_dec(Item_handled_func *item) const override
    {
      item->unsigned_flag= false;
      item->collation= DTCollation_numeric();
      item->fix_char_length(11);
      return false;
    }
  };

  class Handler_slong2: public Handler_slong
  {
  public:
    bool fix_length_and_dec(Item_handled_func *func) const override
    {
      bool rc= Handler_slong::fix_length_and_dec(func);
      func->max_length= 2;
      return rc;
    }
  };

  class Handler_ulonglong: public Handler_int
  {
  public:
    const Type_handler *return_type_handler(const Item_handled_func *item) const override
    {
      return &type_handler_ulonglong;
    }
    bool fix_length_and_dec(Item_handled_func *item) const override
    {
      item->unsigned_flag= true;
      item->collation= DTCollation_numeric();
      item->fix_char_length(21);
      return false;
    }
  };

protected:
  const Handler *m_func_handler;
public:
  Item_handled_func(THD *thd, Item *a)
   :Item_func(thd, a), m_func_handler(NULL) { }
  Item_handled_func(THD *thd, Item *a, Item *b)
   :Item_func(thd, a, b), m_func_handler(NULL) { }
  void set_func_handler(const Handler *handler)
  {
    m_func_handler= handler;
  }
  const Type_handler *type_handler() const override
  {
    return m_func_handler->return_type_handler(this);
  }
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  {
    DBUG_ASSERT(fixed());
    const Type_handler *h= m_func_handler->type_handler_for_create_select(this);
    return h->make_and_init_table_field(root, &name,
                                        Record_addr(maybe_null()),
                                        *this, table);
  }
  String *val_str(String *to) override
  {
    return m_func_handler->val_str(this, to);
  }
  String *val_str_ascii(String *to) override
  {
    return m_func_handler->val_str_ascii(this, to);
  }
  double val_real() override
  {
    return m_func_handler->val_real(this);
  }
  longlong val_int() override
  {
    return m_func_handler->val_int(this);
  }
  my_decimal *val_decimal(my_decimal *to) override
  {
    return m_func_handler->val_decimal(this, to);
  }
  bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate) override
  {
    return m_func_handler->get_date(thd, this, to, fuzzydate);
  }
  bool val_native(THD *thd, Native *to) override
  {
    return m_func_handler->val_native(thd, this, to);
  }
};


/**
  Functions that at fix_fields() time determine the returned field type,
  trying to preserve the exact data type of the arguments.

  The descendants have to implement "native" value methods,
  i.e. str_op(), date_op(), int_op(), real_op(), decimal_op().
  fix_fields() chooses which of the above value methods will be
  used during execution time, according to the returned field type.

  For example, if fix_fields() determines that the returned value type
  is MYSQL_TYPE_LONG, then:
  - int_op() is chosen as the execution time native method.
  - val_int() returns the result of int_op() as is.
  - all other methods, i.e. val_real(), val_decimal(), val_str(), get_date(),
    call int_op() first, then convert the result to the requested data type.
*/
class Item_func_hybrid_field_type: public Item_hybrid_func
{
  /*
    Helper methods to make sure that the result of
    decimal_op(), str_op() and date_op() is properly synched with null_value.
  */
  bool date_op_with_null_check(THD *thd, MYSQL_TIME *ltime)
  {
     bool rc= date_op(thd, ltime, date_mode_t(0));
     DBUG_ASSERT(!rc ^ null_value);
     return rc;
  }
  bool time_op_with_null_check(THD *thd, MYSQL_TIME *ltime)
  {
     bool rc= time_op(thd, ltime);
     DBUG_ASSERT(!rc ^ null_value);
     DBUG_ASSERT(rc || ltime->time_type == MYSQL_TIMESTAMP_TIME);
     return rc;
  }
  String *str_op_with_null_check(String *str)
  {
    String *res= str_op(str);
    DBUG_ASSERT((res != NULL) ^ null_value);
    return res;
  }

public:
  // Value methods that involve no conversion
  String *val_str_from_str_op(String *str)
  {
    return str_op_with_null_check(&str_value);
  }
  longlong val_int_from_int_op()
  {
    return int_op();
  }
  double val_real_from_real_op()
  {
    return real_op();
  }

  // Value methods that involve conversion
  String *val_str_from_real_op(String *str);
  String *val_str_from_int_op(String *str);
  String *val_str_from_date_op(String *str);
  String *val_str_from_time_op(String *str);

  my_decimal *val_decimal_from_str_op(my_decimal *dec);
  my_decimal *val_decimal_from_real_op(my_decimal *dec);
  my_decimal *val_decimal_from_int_op(my_decimal *dec);
  my_decimal *val_decimal_from_date_op(my_decimal *dec);
  my_decimal *val_decimal_from_time_op(my_decimal *dec);

  longlong val_int_from_str_op();
  longlong val_int_from_real_op();
  longlong val_int_from_date_op();
  longlong val_int_from_time_op();

  double val_real_from_str_op();
  double val_real_from_date_op();
  double val_real_from_time_op();
  double val_real_from_int_op();

public:
  Item_func_hybrid_field_type(THD *thd):
    Item_hybrid_func(thd)
  { collation= DTCollation_numeric(); }
  Item_func_hybrid_field_type(THD *thd, Item *a):
    Item_hybrid_func(thd, a)
  { collation= DTCollation_numeric(); }
  Item_func_hybrid_field_type(THD *thd, Item *a, Item *b):
    Item_hybrid_func(thd, a, b)
  { collation= DTCollation_numeric(); }
  Item_func_hybrid_field_type(THD *thd, Item *a, Item *b, Item *c):
    Item_hybrid_func(thd, a, b, c)
  { collation= DTCollation_numeric(); }
  Item_func_hybrid_field_type(THD *thd, List<Item> &list):
    Item_hybrid_func(thd, list)
  { collation= DTCollation_numeric(); }

  double val_real() override
  {
    DBUG_ASSERT(fixed());
    return Item_func_hybrid_field_type::type_handler()->
           Item_func_hybrid_field_type_val_real(this);
  }
  longlong val_int() override
  {
    DBUG_ASSERT(!is_cond());
    DBUG_ASSERT(fixed());
    return Item_func_hybrid_field_type::type_handler()->
           Item_func_hybrid_field_type_val_int(this);
  }
  my_decimal *val_decimal(my_decimal *dec) override
  {
    DBUG_ASSERT(fixed());
    return Item_func_hybrid_field_type::type_handler()->
           Item_func_hybrid_field_type_val_decimal(this, dec);
  }
  String *val_str(String*str) override
  {
    DBUG_ASSERT(fixed());
    String *res= Item_func_hybrid_field_type::type_handler()->
                 Item_func_hybrid_field_type_val_str(this, str);
    DBUG_ASSERT(null_value == (res == NULL));
    return res;
  }
  bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override
  {
    DBUG_ASSERT(fixed());
    return Item_func_hybrid_field_type::type_handler()->
           Item_func_hybrid_field_type_get_date_with_warn(thd, this, to, mode);
  }

  bool val_native(THD *thd, Native *to) override
  {
    DBUG_ASSERT(fixed());
    return native_op(thd, to);
  }

  /**
     @brief Performs the operation that this functions implements when the
     result type is INT.

     @return The result of the operation.
  */
  virtual longlong int_op()= 0;
  Longlong_null to_longlong_null_op()
  {
    longlong nr= int_op();
    /*
      C++ does not guarantee the order of parameter evaluation,
      so to make sure "null_value" is passed to the constructor
      after the int_op() call, int_op() is caled on a separate line.
    */
    return Longlong_null(nr, null_value);
  }
  Longlong_hybrid_null to_longlong_hybrid_null_op()
  {
    return Longlong_hybrid_null(to_longlong_null_op(), unsigned_flag);
  }

  /**
     @brief Performs the operation that this functions implements when the
     result type is REAL.

     @return The result of the operation.
  */
  virtual double real_op()= 0;
  Double_null to_double_null_op()
  {
    // val_real() must be caleed on a separate line. See to_longlong_null()
    double nr= real_op();
    return Double_null(nr, null_value);
  }

  /**
     @brief Performs the operation that this functions implements when the
     result type is DECIMAL.

     @param A pointer where the DECIMAL value will be allocated.
     @return 
       - 0 If the result is NULL
       - The same pointer it was given, with the area initialized to the
         result of the operation.
  */
  virtual my_decimal *decimal_op(my_decimal *)= 0;

  /**
     @brief Performs the operation that this functions implements when the
     result type is a string type.

     @return The result of the operation.
  */
  virtual String *str_op(String *)= 0;

  /**
     @brief Performs the operation that this functions implements when
     field type is DATETIME or DATE.
     @return The result of the operation.
  */
  virtual bool date_op(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate)= 0;

  /**
     @brief Performs the operation that this functions implements when
     field type is TIME.
     @return The result of the operation.
  */
  virtual bool time_op(THD *thd, MYSQL_TIME *res)= 0;

  virtual bool native_op(THD *thd, Native *native)= 0;
};


/*
  This class resembles SQL standard CASE-alike expressions:
  CASE and its abbreviations COALESCE, NULLIF, IFNULL, IF.

  <case expression> ::=   <case abbreviation>
                        | <case specification>
*/
class Item_func_case_expression: public Item_func_hybrid_field_type
{
public:
  Item_func_case_expression(THD *thd)
   :Item_func_hybrid_field_type(thd)
  { }
  Item_func_case_expression(THD *thd, Item *a)
   :Item_func_hybrid_field_type(thd, a)
  { }
  Item_func_case_expression(THD *thd, Item *a, Item *b)
   :Item_func_hybrid_field_type(thd, a, b)
  { }
  Item_func_case_expression(THD *thd, Item *a, Item *b, Item *c)
   :Item_func_hybrid_field_type(thd, a, b, c)
  { }
  Item_func_case_expression(THD *thd, List<Item> &list):
    Item_func_hybrid_field_type(thd, list)
  { }
  bool find_not_null_fields(table_map allowed) override { return false; }
};


class Item_func_numhybrid: public Item_func_hybrid_field_type
{
protected:

  inline void fix_decimals()
  {
    DBUG_ASSERT(result_type() == DECIMAL_RESULT);
    if (decimals == NOT_FIXED_DEC)
      set_if_smaller(decimals, max_length - 1);
  }

public:
  Item_func_numhybrid(THD *thd): Item_func_hybrid_field_type(thd)
  { }
  Item_func_numhybrid(THD *thd, Item *a): Item_func_hybrid_field_type(thd, a)
  { }
  Item_func_numhybrid(THD *thd, Item *a, Item *b):
    Item_func_hybrid_field_type(thd, a, b)
  { }
  Item_func_numhybrid(THD *thd, Item *a, Item *b, Item *c):
    Item_func_hybrid_field_type(thd, a, b, c)
  { }
  Item_func_numhybrid(THD *thd, List<Item> &list):
    Item_func_hybrid_field_type(thd, list)
  { }
  String *str_op(String *str) override { DBUG_ASSERT(0); return 0; }
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    DBUG_ASSERT(0);
    return true;
  }
  bool time_op(THD *thd, MYSQL_TIME *ltime) override
  {
    DBUG_ASSERT(0);
    return true;
  }
  bool native_op(THD *thd, Native *to) override
  {
    DBUG_ASSERT(0);
    return true;
  }
};


/* function where type of result detected by first argument */
class Item_func_num1: public Item_func_numhybrid
{
public:
  Item_func_num1(THD *thd, Item *a): Item_func_numhybrid(thd, a) {}
  Item_func_num1(THD *thd, Item *a, Item *b): Item_func_numhybrid(thd, a, b) {}
  bool check_partition_func_processor(void *int_arg) override { return FALSE; }
  bool check_vcol_func_processor(void *arg) override { return FALSE; }
};


/* Base class for operations like '+', '-', '*' */
class Item_num_op :public Item_func_numhybrid
{
protected:
  bool check_arguments() const override
  {
    return false; // Checked by aggregate_for_num_op()
  }
public:
  Item_num_op(THD *thd, Item *a, Item *b): Item_func_numhybrid(thd, a, b) {}
  virtual void result_precision()= 0;

  void print(String *str, enum_query_type query_type) override
  {
    print_op(str, query_type);
  }
  bool fix_type_handler(const Type_aggregator *aggregator);
  void fix_length_and_dec_double()
  {
    aggregate_numeric_attributes_real(args, arg_count);
    max_length= float_length(decimals);
  }
  void fix_length_and_dec_decimal()
  {
    unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
    result_precision();
    fix_decimals();
  }
  void fix_length_and_dec_int()
  {
    unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
    result_precision();
    decimals= 0;
    set_handler(type_handler_long_or_longlong());
  }
  void fix_length_and_dec_temporal(bool downcast_decimal_to_int)
  {
    set_handler(&type_handler_newdecimal);
    fix_length_and_dec_decimal();
    if (decimals == 0 && downcast_decimal_to_int)
      set_handler(type_handler_long_or_longlong());
  }
  bool need_parentheses_in_default() override { return true; }
};


class Item_int_func :public Item_func
{
public:
  /*
    QQ: shouldn't 20 characters be enough:
    Max unsigned =  18,446,744,073,709,551,615 = 20 digits, 20 characters
    Max signed   =   9,223,372,036,854,775,807 = 19 digits, 19 characters
    Min signed   =  -9,223,372,036,854,775,808 = 19 digits, 20 characters
  */
  Item_int_func(THD *thd): Item_func(thd)
  { collation= DTCollation_numeric(); fix_char_length(21); }
  Item_int_func(THD *thd, Item *a): Item_func(thd, a)
  { collation= DTCollation_numeric(); fix_char_length(21); }
  Item_int_func(THD *thd, Item *a, Item *b): Item_func(thd, a, b)
  { collation= DTCollation_numeric(); fix_char_length(21); }
  Item_int_func(THD *thd, Item *a, Item *b, Item *c): Item_func(thd, a, b, c)
  { collation= DTCollation_numeric(); fix_char_length(21); }
  Item_int_func(THD *thd, Item *a, Item *b, Item *c, Item *d):
    Item_func(thd, a, b, c, d)
  { collation= DTCollation_numeric(); fix_char_length(21); }
  Item_int_func(THD *thd, List<Item> &list): Item_func(thd, list)
  { collation= DTCollation_numeric(); fix_char_length(21); }
  Item_int_func(THD *thd, Item_int_func *item) :Item_func(thd, item)
  { collation= DTCollation_numeric(); }
  double val_real() override;
  String *val_str(String*str) override;
  my_decimal *val_decimal(my_decimal *decimal_value) override
  {
    return val_decimal_from_int(decimal_value);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  { return get_date_from_int(thd, ltime, fuzzydate); }
  const Type_handler *type_handler() const override= 0;
  bool fix_length_and_dec() override { return FALSE; }
};


class Item_long_func: public Item_int_func
{
public:
  Item_long_func(THD *thd): Item_int_func(thd) { }
  Item_long_func(THD *thd, Item *a): Item_int_func(thd, a) {}
  Item_long_func(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {}
  Item_long_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {}
  Item_long_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
  Item_long_func(THD *thd, Item_long_func *item) :Item_int_func(thd, item) {}
  const Type_handler *type_handler() const override
  {
    if (unsigned_flag)
      return &type_handler_ulong;
    return &type_handler_slong;
  }
  bool fix_length_and_dec() override { max_length= 11; return FALSE; }
};


class Item_long_ge0_func: public Item_int_func
{
public:
  Item_long_ge0_func(THD *thd): Item_int_func(thd) { }
  Item_long_ge0_func(THD *thd, Item *a): Item_int_func(thd, a) {}
  Item_long_ge0_func(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {}
  Item_long_ge0_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {}
  Item_long_ge0_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
  Item_long_ge0_func(THD *thd, Item_long_ge0_func *item) :Item_int_func(thd, item) {}
  const Type_handler *type_handler() const override
  {
    DBUG_ASSERT(!unsigned_flag);
    return &type_handler_slong_ge0;
  }
  bool fix_length_and_dec() override { max_length= 10; return FALSE; }
};


class Item_func_hash: public Item_int_func
{
public:
  Item_func_hash(THD *thd, List<Item> &item): Item_int_func(thd, item)
  {}
  longlong val_int() override;
  bool fix_length_and_dec() override;
  const Type_handler *type_handler() const override
  { return &type_handler_slong; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_hash>(thd, this); }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<hash>") };
    return name;
  }
};

class Item_func_hash_mariadb_100403: public Item_func_hash
{
public:
  Item_func_hash_mariadb_100403(THD *thd, List<Item> &item)
   :Item_func_hash(thd, item)
  {}
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_hash_mariadb_100403>(thd, this); }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<hash_mariadb_100403>") };
    return name;
  }
};

class Item_longlong_func: public Item_int_func
{
public:
  Item_longlong_func(THD *thd): Item_int_func(thd) { }
  Item_longlong_func(THD *thd, Item *a): Item_int_func(thd, a) {}
  Item_longlong_func(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {}
  Item_longlong_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {}
  Item_longlong_func(THD *thd, Item *a, Item *b, Item *c, Item *d):
    Item_int_func(thd, a, b, c, d) {}
  Item_longlong_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
  Item_longlong_func(THD *thd, Item_longlong_func *item) :Item_int_func(thd, item) {}
  const Type_handler *type_handler() const override
  {
    if (unsigned_flag)
      return &type_handler_ulonglong;
    return &type_handler_slonglong;
  }
};


class Cursor_ref
{
protected:
  LEX_CSTRING m_cursor_name;
  uint m_cursor_offset;
  class sp_cursor *get_open_cursor_or_error();
  Cursor_ref(const LEX_CSTRING *name, uint offset)
   :m_cursor_name(*name), m_cursor_offset(offset)
  { }
  void print_func(String *str, const LEX_CSTRING &func_name);
};



class Item_func_cursor_rowcount: public Item_longlong_func,
                                 public Cursor_ref
{
public:
  Item_func_cursor_rowcount(THD *thd, const LEX_CSTRING *name, uint offset)
   :Item_longlong_func(thd), Cursor_ref(name, offset)
  {
    set_maybe_null();
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("%ROWCOUNT") };
    return name;
  }
  longlong val_int() override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), arg, VCOL_SESSION_FUNC);
  }
  void print(String *str, enum_query_type query_type) override
  {
    return Cursor_ref::print_func(str, func_name_cstring());
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_cursor_rowcount>(thd, this); }
};



class Item_func_connection_id :public Item_long_func
{
  longlong value;

public:
  Item_func_connection_id(THD *thd): Item_long_func(thd) { unsigned_flag=1; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("connection_id") };
    return name;
  }
  bool fix_length_and_dec() override;
  bool fix_fields(THD *thd, Item **ref) override;
  longlong val_int() override { DBUG_ASSERT(fixed()); return value; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_connection_id>(thd, this); }
};


class Item_func_signed :public Item_int_func
{
public:
  Item_func_signed(THD *thd, Item *a): Item_int_func(thd, a)
  {
    unsigned_flag= 0;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_signed") };
    return name;
  }
  const Type_handler *type_handler() const override
  {
    return Type_handler::type_handler_long_or_longlong(max_char_length(),
                                                       false);
  }
  longlong val_int() override
  {
    longlong value= args[0]->val_int_signed_typecast();
    null_value= args[0]->null_value;
    return value;
  }
  void fix_length_and_dec_double()
  {
    fix_char_length(MAX_BIGINT_WIDTH);
  }
  void fix_length_and_dec_sint_ge0()
  {
    uint32 digits= args[0]->decimal_precision();
    DBUG_ASSERT(digits > 0);
    DBUG_ASSERT(digits <= MY_INT64_NUM_DECIMAL_DIGITS);
    fix_char_length(digits + (unsigned_flag ? 0 : 1/*sign*/));
  }
  void fix_length_and_dec_generic()
  {
    uint32 char_length= MY_MIN(args[0]->max_char_length(),
                               MY_INT64_NUM_DECIMAL_DIGITS);
    /*
      args[0]->max_char_length() can return 0.
      Reserve max_length to fit at least one character for one digit,
      plus one character for the sign (if signed).
    */
    set_if_bigger(char_length, 1U + (unsigned_flag ? 0 : 1));
    fix_char_length(char_length);
  }
  void fix_length_and_dec_string()
  {
    /*
      For strings, use decimal_int_part() instead of max_char_length().
      This is important for Item_hex_hybrid:
        SELECT CAST(0x1FFFFFFFF AS SIGNED);
      Length is 5, decimal_int_part() is 13.
    */
    uint32 char_length= MY_MIN(args[0]->decimal_int_part(),
                               MY_INT64_NUM_DECIMAL_DIGITS);
    set_if_bigger(char_length, 1U + (unsigned_flag ? 0 : 1));
    fix_char_length(char_length);
  }
  bool fix_length_and_dec() override
  {
    return args[0]->type_handler()->Item_func_signed_fix_length_and_dec(this);
  }
  void print(String *str, enum_query_type query_type) override;
  decimal_digits_t decimal_precision() const override
  { return args[0]->decimal_precision(); }
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_signed>(thd, this); }
};


class Item_func_unsigned :public Item_func_signed
{
public:
  Item_func_unsigned(THD *thd, Item *a): Item_func_signed(thd, a)
  {
    unsigned_flag= 1;
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_unsigned") };
    return name;
  }
  const Type_handler *type_handler() const override
  {
    if (max_char_length() <= MY_INT32_NUM_DECIMAL_DIGITS - 1)
      return &type_handler_ulong;
    return &type_handler_ulonglong;
  }
  longlong val_int() override
  {
    longlong value= args[0]->val_int_unsigned_typecast();
    null_value= args[0]->null_value;
    return value;
  }
  bool fix_length_and_dec() override
  {
    return args[0]->type_handler()->Item_func_unsigned_fix_length_and_dec(this);
  }
  decimal_digits_t decimal_precision() const override { return max_length; }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_unsigned>(thd, this); }
};


class Item_decimal_typecast :public Item_func
{
  my_decimal decimal_value;
public:
  Item_decimal_typecast(THD *thd, Item *a, uint len, decimal_digits_t dec)
   :Item_func(thd, a)
  {
    decimals= dec;
    collation= DTCollation_numeric();
    fix_char_length(my_decimal_precision_to_length_no_truncation(len, dec,
                                                                 unsigned_flag));
  }
  String *val_str(String *str) override { return VDec(this).to_string(str); }
  double val_real() override { return VDec(this).to_double(); }
  longlong val_int() override { return VDec(this).to_longlong(unsigned_flag); }
  my_decimal *val_decimal(my_decimal*) override;
  bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override
  {
    return decimal_to_datetime_with_warn(thd, VDec(this).ptr(), to, mode,
                                         NULL, NULL);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
  void fix_length_and_dec_generic() {}
  bool fix_length_and_dec() override
  {
    return
      args[0]->type_handler()->Item_decimal_typecast_fix_length_and_dec(this);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("decimal_typecast") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_decimal_typecast>(thd, this); }
};


class Item_real_typecast: public Item_real_func
{
protected:
  double val_real_with_truncate(double max_value);
public:
  Item_real_typecast(THD *thd, Item *a, uint len, uint dec)
   :Item_real_func(thd, a)
  {
    decimals=   (uint8)  dec;
    max_length= (uint32) len;
  }
  bool need_parentheses_in_default() override { return true; }
  void print(String *str, enum_query_type query_type) override;
  void fix_length_and_dec_generic()
  {
    set_maybe_null();
  }
};


class Item_float_typecast :public Item_real_typecast
{
public:
  Item_float_typecast(THD *thd, Item *a)
   :Item_real_typecast(thd, a, MAX_FLOAT_STR_LENGTH, NOT_FIXED_DEC)
  { }
  const Type_handler *type_handler() const override
  { return &type_handler_float; }
  bool fix_length_and_dec() override
  {
    return
      args[0]->type_handler()->Item_float_typecast_fix_length_and_dec(this);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("float_typecast") };
    return name;
  }
  double val_real() override
  {
    return (double) (float) val_real_with_truncate(FLT_MAX);
  }
  String *val_str(String*str) override
  {
    Float nr(Item_float_typecast::val_real());
    if (null_value)
      return 0;
    nr.to_string(str, decimals);
    return str;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_float_typecast>(thd, this); }
};


class Item_double_typecast :public Item_real_typecast
{
public:
  Item_double_typecast(THD *thd, Item *a, uint len, uint dec):
    Item_real_typecast(thd, a, len, dec)
  { }
  bool fix_length_and_dec() override
  {
    return
      args[0]->type_handler()->Item_double_typecast_fix_length_and_dec(this);
  }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("double_typecast") };
    return name;
  }
  double val_real() override { return val_real_with_truncate(DBL_MAX); }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_double_typecast>(thd, this); }
};


class Item_func_additive_op :public Item_num_op
{
public:
  Item_func_additive_op(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {}
  void result_precision() override;
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
};


class Item_func_plus :public Item_func_additive_op
{
public:
  Item_func_plus(THD *thd, Item *a, Item *b):
    Item_func_additive_op(thd, a, b) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("+") };
    return name;
  }
  enum precedence precedence() const override { return ADD_PRECEDENCE; }
  bool fix_length_and_dec() override;
  longlong int_op() override;
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_plus>(thd, this); }
};

class Item_func_minus :public Item_func_additive_op
{
  bool m_depends_on_sql_mode_no_unsigned_subtraction;
public:
  Item_func_minus(THD *thd, Item *a, Item *b):
    Item_func_additive_op(thd, a, b),
    m_depends_on_sql_mode_no_unsigned_subtraction(false)
  { }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("-") };
    return name;
  }
  enum precedence precedence() const override { return ADD_PRECEDENCE; }
  Sql_mode_dependency value_depends_on_sql_mode() const override;
  longlong int_op() override;
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  bool fix_length_and_dec() override;
  void fix_unsigned_flag();
  void fix_length_and_dec_double()
  {
    Item_func_additive_op::fix_length_and_dec_double();
    fix_unsigned_flag();
  }
  void fix_length_and_dec_decimal()
  {
    Item_func_additive_op::fix_length_and_dec_decimal();
    fix_unsigned_flag();
  }
  void fix_length_and_dec_int()
  {
    Item_func_additive_op::fix_length_and_dec_int();
    fix_unsigned_flag();
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_minus>(thd, this); }
};


class Item_func_mul :public Item_num_op
{
public:
  Item_func_mul(THD *thd, Item *a, Item *b):
    Item_num_op(thd, a, b) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("*") };
    return name;
  }
  enum precedence precedence() const override { return MUL_PRECEDENCE; }
  longlong int_op() override;
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  void result_precision() override;
  bool fix_length_and_dec() override;
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_mul>(thd, this); }
};


class Item_func_div :public Item_num_op
{
public:
  uint prec_increment;
  Item_func_div(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {}
  longlong int_op() override { DBUG_ASSERT(0); return 0; }
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("/") };
    return name;
  }
  enum precedence precedence() const override { return MUL_PRECEDENCE; }
  bool fix_length_and_dec() override;
  void fix_length_and_dec_double();
  void fix_length_and_dec_int();
  void result_precision() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_div>(thd, this); }
};


class Item_func_int_div :public Item_int_func
{
public:
  Item_func_int_div(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b)
  {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("DIV") };
    return name;
  }
  enum precedence precedence() const override { return MUL_PRECEDENCE; }
  const Type_handler *type_handler() const override
  { return type_handler_long_or_longlong(); }
  bool fix_length_and_dec() override;
  void print(String *str, enum_query_type query_type) override
  {
    print_op(str, query_type);
  }

  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_int_div>(thd, this); }
};


class Item_func_mod :public Item_num_op
{
public:
  Item_func_mod(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {}
  longlong int_op() override;
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("MOD") };
    return name;
  }
  enum precedence precedence() const override { return MUL_PRECEDENCE; }
  void result_precision() override;
  bool fix_length_and_dec() override;
  void fix_length_and_dec_double()
  {
    Item_num_op::fix_length_and_dec_double();
    unsigned_flag= args[0]->unsigned_flag;
  }
  void fix_length_and_dec_decimal()
  {
    result_precision();
    fix_decimals();
  }
  void fix_length_and_dec_int()
  {
    result_precision();
    DBUG_ASSERT(decimals == 0);
    set_handler(type_handler_long_or_longlong());
  }
  bool check_partition_func_processor(void *int_arg) override {return FALSE;}
  bool check_vcol_func_processor(void *arg) override { return FALSE;}
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_mod>(thd, this); }
};


class Item_func_neg :public Item_func_num1
{
public:
  Item_func_neg(THD *thd, Item *a): Item_func_num1(thd, a) {}
  double real_op() override;
  longlong int_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("-") };
    return name;
  }
  enum Functype functype() const override { return NEG_FUNC; }
  enum precedence precedence() const override { return NEG_PRECEDENCE; }
  void print(String *str, enum_query_type query_type) override
  {
    str->append(func_name_cstring());
    args[0]->print_parenthesised(str, query_type, precedence());
  }
  void fix_length_and_dec_int();
  void fix_length_and_dec_double();
  void fix_length_and_dec_decimal();
  bool fix_length_and_dec() override;
  decimal_digits_t decimal_precision() const  override
  { return args[0]->decimal_precision(); }
  bool need_parentheses_in_default() override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_neg>(thd, this); }
};


class Item_func_abs :public Item_func_num1
{
public:
  Item_func_abs(THD *thd, Item *a): Item_func_num1(thd, a) {}
  double real_op() override;
  longlong int_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("abs") };
    return name;
  }
  void fix_length_and_dec_int();
  void fix_length_and_dec_sint_ge0();
  void fix_length_and_dec_double();
  void fix_length_and_dec_decimal();
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_abs>(thd, this); }
};

// A class to handle logarithmic and trigonometric functions

class Item_dec_func :public Item_real_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_real(0, arg_count); }
 public:
  Item_dec_func(THD *thd, Item *a): Item_real_func(thd, a) {}
  Item_dec_func(THD *thd, Item *a, Item *b): Item_real_func(thd, a, b) {}
  bool fix_length_and_dec() override
  {
    decimals= NOT_FIXED_DEC;
    max_length= float_length(decimals);
    set_maybe_null();
    return FALSE;
  }
};

class Item_func_exp :public Item_dec_func
{
public:
  Item_func_exp(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("exp") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_exp>(thd, this); }
};


class Item_func_ln :public Item_dec_func
{
public:
  Item_func_ln(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ln") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ln>(thd, this); }
};


class Item_func_log :public Item_dec_func
{
public:
  Item_func_log(THD *thd, Item *a): Item_dec_func(thd, a) {}
  Item_func_log(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("log") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_log>(thd, this); }
};


class Item_func_log2 :public Item_dec_func
{
public:
  Item_func_log2(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("log2") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_log2>(thd, this); }
};


class Item_func_log10 :public Item_dec_func
{
public:
  Item_func_log10(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("log10") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_log10>(thd, this); }
};


class Item_func_sqrt :public Item_dec_func
{
public:
  Item_func_sqrt(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sqrt") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sqrt>(thd, this); }
};


class Item_func_pow :public Item_dec_func
{
public:
  Item_func_pow(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("pow") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_pow>(thd, this); }
};


class Item_func_acos :public Item_dec_func
{
public:
  Item_func_acos(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("acos") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_acos>(thd, this); }
};

class Item_func_asin :public Item_dec_func
{
public:
  Item_func_asin(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("asin") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_asin>(thd, this); }
};

class Item_func_atan :public Item_dec_func
{
public:
  Item_func_atan(THD *thd, Item *a): Item_dec_func(thd, a) {}
  Item_func_atan(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("atan") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_atan>(thd, this); }
};

class Item_func_cos :public Item_dec_func
{
public:
  Item_func_cos(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cos") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_cos>(thd, this); }
};

class Item_func_sin :public Item_dec_func
{
public:
  Item_func_sin(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sin") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sin>(thd, this); }
};

class Item_func_tan :public Item_dec_func
{
public:
  Item_func_tan(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("tan") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_tan>(thd, this); }
};

class Item_func_cot :public Item_dec_func
{
public:
  Item_func_cot(THD *thd, Item *a): Item_dec_func(thd, a) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("cot") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_cot>(thd, this); }
};


class Item_func_int_val :public Item_func_hybrid_field_type
{
public:
  Item_func_int_val(THD *thd, Item *a): Item_func_hybrid_field_type(thd, a) {}
  bool check_partition_func_processor(void *int_arg) override { return FALSE; }
  bool check_vcol_func_processor(void *arg) override { return FALSE; }
  virtual decimal_round_mode round_mode() const= 0;
  void fix_length_and_dec_double();
  void fix_length_and_dec_int_or_decimal();
  void fix_length_and_dec_time()
  {
    fix_attributes_time(0);
    set_handler(&type_handler_time2);
  }
  void fix_length_and_dec_datetime()
  {
    fix_attributes_datetime(0);
    set_handler(&type_handler_datetime2);
    // Thinks like CEILING(TIMESTAMP'0000-01-01 23:59:59.9') returns NULL
    set_maybe_null();
  }
  bool fix_length_and_dec() override;
  String *str_op(String *str) override { DBUG_ASSERT(0); return 0; }
  bool native_op(THD *thd, Native *to) override;
};


class Item_func_ceiling :public Item_func_int_val
{
public:
  Item_func_ceiling(THD *thd, Item *a): Item_func_int_val(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ceiling") };
    return name;
  }
  decimal_round_mode round_mode() const override { return CEILING; }
  longlong int_op() override;
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ceiling>(thd, this); }
};


class Item_func_floor :public Item_func_int_val
{
public:
  Item_func_floor(THD *thd, Item *a): Item_func_int_val(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("floor") };
    return name;
  }
  decimal_round_mode round_mode() const override { return FLOOR; }
  longlong int_op() override;
  double real_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_floor>(thd, this); }
};

/* This handles round and truncate */

class Item_func_round :public Item_func_hybrid_field_type
{
  bool truncate;
  void fix_length_and_dec_decimal(uint decimals_to_set);
  void fix_length_and_dec_double(uint decimals_to_set);
  bool test_if_length_can_increase();
public:
  Item_func_round(THD *thd, Item *a, Item *b, bool trunc_arg)
    :Item_func_hybrid_field_type(thd, a, b), truncate(trunc_arg) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING truncate_name= {STRING_WITH_LEN("truncate") };
    static LEX_CSTRING round_name= {STRING_WITH_LEN("round") };
    return truncate ? truncate_name : round_name;
  }
  double real_op() override;
  longlong int_op() override;
  my_decimal *decimal_op(my_decimal *) override;
  bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool time_op(THD *thd, MYSQL_TIME *ltime) override;
  bool native_op(THD *thd, Native *to) override;
  String *str_op(String *str) override
  {
    DBUG_ASSERT(0);
    return NULL;
  }
  void fix_arg_decimal();
  void fix_arg_int(const Type_handler *preferred,
                   const Type_std_attributes *preferred_attributes,
                   bool use_decimal_on_length_increase);
  void fix_arg_slong_ge0();
  void fix_arg_hex_hybrid();
  void fix_arg_double();
  void fix_arg_time();
  void fix_arg_datetime();
  void fix_arg_temporal(const Type_handler *h, uint int_part_length);
  bool fix_length_and_dec() override
  {
    /*
      We don't want to translate ENUM/SET to CHAR here.
      So let's real_type_handler(), not type_handler().
    */
    return args[0]->real_type_handler()->Item_func_round_fix_length_and_dec(this);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_round>(thd, this); }
};


class Item_func_rand :public Item_real_func
{
  struct my_rnd_struct *rand;
  bool first_eval; // TRUE if val_real() is called 1st time
  bool check_arguments() const override
  { return check_argument_types_can_return_int(0, arg_count); }
  void seed_random (Item * val);
public:
  Item_func_rand(THD *thd, Item *a):
    Item_real_func(thd, a), rand(0), first_eval(TRUE) {}
  Item_func_rand(THD *thd): Item_real_func(thd) {}
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("rand") };
    return name;
  }
  bool const_item() const override { return 0; }
  void update_used_tables() override;
  bool fix_fields(THD *thd, Item **ref) override;
  void cleanup() override { first_eval= TRUE; Item_real_func::cleanup(); }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_rand>(thd, this); }
};


class Item_func_rownum final :public Item_longlong_func
{
  /*
    This points to a variable that contains the number of rows
    accpted so far in the result set
  */
  ha_rows *accepted_rows;
  SELECT_LEX *select;
public:
  Item_func_rownum(THD *thd);
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("rownum") };
    return name;
  }
  enum Functype functype() const override { return ROWNUM_FUNC; }
  void update_used_tables() override {}
  bool const_item() const override { return 0; }
  void fix_after_optimize(THD *thd) override;
  bool fix_length_and_dec() override
  {
    unsigned_flag= 1;
    used_tables_cache= RAND_TABLE_BIT;
    const_item_cache=0;
    set_maybe_null();
    return FALSE;
  }
  void cleanup() override
  {
    Item_longlong_func::cleanup();
    /* Ensure we don't point to freed memory */
    accepted_rows= 0;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_IMPOSSIBLE);
  }
  bool check_handler_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override { return 0; }
  /* This function is used in insert, update and delete */
  void store_pointer_to_row_counter(ha_rows *row_counter)
  {
    accepted_rows= row_counter;
  }
};

void fix_rownum_pointers(THD *thd, SELECT_LEX *select_lex, ha_rows *ptr);


class Item_func_sign :public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_real(func_name_cstring()); }
public:
  Item_func_sign(THD *thd, Item *a): Item_long_func(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sign") };
    return name;
  }
  decimal_digits_t decimal_precision() const override { return 1; }
  bool fix_length_and_dec() override { fix_char_length(2); return FALSE; }
  longlong val_int() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sign>(thd, this); }
};


class Item_func_units :public Item_real_func
{
  LEX_CSTRING name;
  double mul,add;
  bool check_arguments() const override
  { return check_argument_types_can_return_real(0, arg_count); }
public:
  Item_func_units(THD *thd, char *name_arg, Item *a, double mul_arg,
                  double add_arg):
    Item_real_func(thd, a), mul(mul_arg), add(add_arg)
  {
    name.str= name_arg;
    name.length= strlen(name_arg);
  }
  double val_real() override;
  LEX_CSTRING func_name_cstring() const override { return name; }
  bool fix_length_and_dec() override
  {
    decimals= NOT_FIXED_DEC;
    max_length= float_length(decimals);
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_units>(thd, this); }
};


/**
  Item_func_min_max does not derive from Item_func_hybrid_field_type
  because the way how its methods val_xxx() and get_date() work depend
  not only by its arguments, but also on the context in which
  LEAST() and GREATEST() appear.
  For example, using Item_func_min_max in a CAST like this:
    CAST(LEAST('11','2') AS SIGNED)
  forces Item_func_min_max to compare the arguments as numbers rather
  than strings.
  Perhaps this should be changed eventually (see MDEV-5893).
*/
class Item_func_min_max :public Item_hybrid_func
{
  String tmp_value;
  int cmp_sign;
protected:
  bool check_arguments() const override
  {
    return false; // Checked by aggregate_for_min_max()
  }
  bool fix_attributes(Item **item, uint nitems);
public:
  Item_func_min_max(THD *thd, List<Item> &list, int cmp_sign_arg):
    Item_hybrid_func(thd, list), cmp_sign(cmp_sign_arg)
  {}
  String *val_str_native(String *str);
  double val_real_native();
  longlong val_int_native();
  longlong val_uint_native();
  my_decimal *val_decimal_native(my_decimal *);
  bool get_date_native(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
  bool get_time_native(THD *thd, MYSQL_TIME *res);

  double val_real() override
  {
    DBUG_ASSERT(fixed());
    return Item_func_min_max::type_handler()->
             Item_func_min_max_val_real(this);
  }
  longlong val_int() override
  {
    DBUG_ASSERT(fixed());
    return Item_func_min_max::type_handler()->
             Item_func_min_max_val_int(this);
  }
  String *val_str(String *str) override
  {
    DBUG_ASSERT(fixed());
    return Item_func_min_max::type_handler()->
             Item_func_min_max_val_str(this, str);
  }
  my_decimal *val_decimal(my_decimal *dec) override
  {
    DBUG_ASSERT(fixed());
    return Item_func_min_max::type_handler()->
             Item_func_min_max_val_decimal(this, dec);
  }
  bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override
  {
    DBUG_ASSERT(fixed());
    return Item_func_min_max::type_handler()->
             Item_func_min_max_get_date(thd, this, res, fuzzydate);
  }
  bool val_native(THD *thd, Native *to) override;
  void aggregate_attributes_real(Item **items, uint nitems)
  {
    /*
      Aggregating attributes for the double data type for LEAST/GREATEST
      is almost the same with aggregating for CASE-alike hybrid functions,
      (CASE..THEN, COALESCE, IF, etc).
      There is one notable difference though, when a numeric argument is mixed
      with a string argument:
      - CASE-alike functions return a string data type in such cases
        COALESCE(10,'x') -> VARCHAR(2) = '10'
      - LEAST/GREATEST returns double:
        GREATEST(10,'10e4') -> DOUBLE = 100000
      As the string argument can represent a number in the scientific notation,
      like in the example above, max_length of the result can be longer than
      max_length of the arguments. To handle this properly, max_length is
      additionally assigned to the result of float_length(decimals).
    */
    Item_func::aggregate_attributes_real(items, nitems);
    max_length= float_length(decimals);
  }
  bool fix_length_and_dec() override
  {
    if (aggregate_for_min_max(func_name_cstring(), args, arg_count))
      return true;
    fix_attributes(args, arg_count);
    return false;
  }
};

class Item_func_min :public Item_func_min_max
{
public:
  Item_func_min(THD *thd, List<Item> &list): Item_func_min_max(thd, list, 1) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("least") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_min>(thd, this); }
};

class Item_func_max :public Item_func_min_max
{
public:
  Item_func_max(THD *thd, List<Item> &list): Item_func_min_max(thd, list, -1) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("greatest") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_max>(thd, this); }
};


/* 
  Objects of this class are used for ROLLUP queries to wrap up 
  each constant item referred to in GROUP BY list. 
*/

class Item_func_rollup_const :public Item_func
{
public:
  Item_func_rollup_const(THD *thd, Item *a): Item_func(thd, a)
  {
    name= a->name;
  }
  double val_real() override { return val_real_from_item(args[0]); }
  longlong val_int() override { return val_int_from_item(args[0]); }
  String *val_str(String *str) override
  { return val_str_from_item(args[0], str); }
  bool val_native(THD *thd, Native *to) override
  { return val_native_from_item(thd, args[0], to); }
  my_decimal *val_decimal(my_decimal *dec) override
    { return val_decimal_from_item(args[0], dec); }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
    { return get_date_from_item(thd, args[0], ltime, fuzzydate); }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("rollup_const") };
    return name;
  }
  bool const_item() const override { return 0; }
  const Type_handler *type_handler() const override
  { return args[0]->type_handler(); }
  bool fix_length_and_dec() override
  {
    Type_std_attributes::set(*args[0]);
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_rollup_const>(thd, this); }
};


class Item_long_func_length: public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_str(func_name_cstring()); }
public:
  Item_long_func_length(THD *thd, Item *a): Item_long_func(thd, a) {}
  bool fix_length_and_dec() override { max_length=10; return FALSE; }
};


class Item_func_octet_length :public Item_long_func_length
{
  String value;
public:
  Item_func_octet_length(THD *thd, Item *a): Item_long_func_length(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("octet_length") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_octet_length>(thd, this); }
};

class Item_func_bit_length :public Item_longlong_func
{
  String value;
public:
  Item_func_bit_length(THD *thd, Item *a): Item_longlong_func(thd, a) {}
  bool fix_length_and_dec() override
  {
    max_length= 11; // 0x100000000*8 = 34,359,738,368
    return FALSE;
  }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("bit_length") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_bit_length>(thd, this); }
};

class Item_func_char_length :public Item_long_func_length
{
  String value;
public:
  Item_func_char_length(THD *thd, Item *a): Item_long_func_length(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("char_length") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_char_length>(thd, this); }
};

class Item_func_coercibility :public Item_long_func
{
  longlong m_cached_collation_derivation;

  bool check_arguments() const override
  { return args[0]->check_type_can_return_str(func_name_cstring()); }
public:
  Item_func_coercibility(THD *thd, Item *a): Item_long_func(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("coercibility") };
    return name;
  }
  bool fix_length_and_dec() override;
  bool eval_not_null_tables(void *) override
  {
    not_null_tables_cache= 0;
    return false;
  }
  bool find_not_null_fields(table_map allowed) override
  {
    return false;
  }
  Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
    override
  { return this; }
  bool const_item() const override { return true; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_coercibility>(thd, this); }
  table_map used_tables() const override { return 0; }
};


/*
  In the corner case LOCATE could return (4,294,967,296 + 1),
  which would not fit into Item_long_func range.
  But string lengths are limited with max_allowed_packet,
  which cannot be bigger than 1024*1024*1024.
*/
class Item_func_locate :public Item_long_func
{
  bool check_arguments() const override
  {
    return check_argument_types_can_return_str(0, 2) ||
           (arg_count > 2 && args[2]->check_type_can_return_int(func_name_cstring()));
  }
  String value1,value2;
  DTCollation cmp_collation;
public:
  Item_func_locate(THD *thd, Item *a, Item *b)
   :Item_long_func(thd, a, b) {}
  Item_func_locate(THD *thd, Item *a, Item *b, Item *c)
   :Item_long_func(thd, a, b, c) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("locate") };
    return name;
  }
  longlong val_int() override;
  bool fix_length_and_dec() override
  {
    max_length= MY_INT32_NUM_DECIMAL_DIGITS;
    return agg_arg_charsets_for_comparison(cmp_collation, args, 2);
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_locate>(thd, this); }
};


class Item_func_field :public Item_long_func
{
  String value,tmp;
  Item_result cmp_type;
  DTCollation cmp_collation;
public:
  Item_func_field(THD *thd, List<Item> &list): Item_long_func(thd, list) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("field") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_field>(thd, this); }
};


class Item_func_ascii :public Item_long_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_str(0, arg_count); }
  String value;
public:
  Item_func_ascii(THD *thd, Item *a): Item_long_func(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ascii") };
    return name;
  }
  bool fix_length_and_dec() override { max_length=3; return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ascii>(thd, this); }
};

class Item_func_ord :public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_str(func_name_cstring()); }
  String value;
public:
  Item_func_ord(THD *thd, Item *a): Item_long_func(thd, a) {}
  bool fix_length_and_dec() override { fix_char_length(7); return FALSE; }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("ord") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_ord>(thd, this); }
};

class Item_func_find_in_set :public Item_long_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_str(0, 2); }
  String value,value2;
  uint enum_value;
  ulonglong enum_bit;
  DTCollation cmp_collation;
public:
  Item_func_find_in_set(THD *thd, Item *a, Item *b):
    Item_long_func(thd, a, b), enum_value(0) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("find_in_set") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_find_in_set>(thd, this); }
};

/* Base class for all bit functions: '~', '|', '^', '&', '>>', '<<' */

class Item_func_bit_operator: public Item_handled_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_int(0, arg_count); }
protected:
  bool fix_length_and_dec_op1_std(const Handler *ha_int, const Handler *ha_dec)
  {
    set_func_handler(args[0]->cmp_type() == INT_RESULT ? ha_int : ha_dec);
    return m_func_handler->fix_length_and_dec(this);
  }
  bool fix_length_and_dec_op2_std(const Handler *ha_int, const Handler *ha_dec)
  {
    set_func_handler(args[0]->cmp_type() == INT_RESULT &&
                     args[1]->cmp_type() == INT_RESULT ? ha_int : ha_dec);
    return m_func_handler->fix_length_and_dec(this);
  }
public:
  Item_func_bit_operator(THD *thd, Item *a)
   :Item_handled_func(thd, a) {}
  Item_func_bit_operator(THD *thd, Item *a, Item *b)
   :Item_handled_func(thd, a, b) {}
  void print(String *str, enum_query_type query_type) override
  {
    print_op(str, query_type);
  }
  bool need_parentheses_in_default() override { return true; }
};

class Item_func_bit_or :public Item_func_bit_operator
{
public:
  Item_func_bit_or(THD *thd, Item *a, Item *b)
   :Item_func_bit_operator(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("|") };
    return name;
  }
  enum precedence precedence() const override { return BITOR_PRECEDENCE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_bit_or>(thd, this); }
};

class Item_func_bit_and :public Item_func_bit_operator
{
public:
  Item_func_bit_and(THD *thd, Item *a, Item *b)
   :Item_func_bit_operator(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("&") };
    return name;
  }
  enum precedence precedence() const override { return BITAND_PRECEDENCE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_bit_and>(thd, this); }
};

class Item_func_bit_count :public Item_handled_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_int(func_name_cstring()); }
public:
  Item_func_bit_count(THD *thd, Item *a): Item_handled_func(thd, a) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("bit_count") };
    return name;
  }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_bit_count>(thd, this); }
};

class Item_func_shift_left :public Item_func_bit_operator
{
public:
  Item_func_shift_left(THD *thd, Item *a, Item *b)
   :Item_func_bit_operator(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("<<") };
    return name;
  }
  enum precedence precedence() const override { return SHIFT_PRECEDENCE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_shift_left>(thd, this); }
};

class Item_func_shift_right :public Item_func_bit_operator
{
public:
  Item_func_shift_right(THD *thd, Item *a, Item *b)
   :Item_func_bit_operator(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN(">>") };
    return name;
  }
  enum precedence precedence() const override { return SHIFT_PRECEDENCE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_shift_right>(thd, this); }
};

class Item_func_bit_neg :public Item_func_bit_operator
{
public:
  Item_func_bit_neg(THD *thd, Item *a): Item_func_bit_operator(thd, a) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("~") };
    return name;
  }
  enum precedence precedence() const override { return NEG_PRECEDENCE; }
  void print(String *str, enum_query_type query_type) override
  {
    str->append(func_name_cstring());
    args[0]->print_parenthesised(str, query_type, precedence());
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_bit_neg>(thd, this); }
};


class Item_func_last_insert_id :public Item_longlong_func
{
  bool check_arguments() const override
  { return check_argument_types_can_return_int(0, arg_count); }
public:
  Item_func_last_insert_id(THD *thd): Item_longlong_func(thd) {}
  Item_func_last_insert_id(THD *thd, Item *a): Item_longlong_func(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("last_insert_id") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    unsigned_flag= true;
    if (arg_count)
      max_length= args[0]->max_length;
    return FALSE;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_last_insert_id>(thd, this); }
};


class Item_func_benchmark :public Item_long_func
{
  bool check_arguments() const override
  {
    return args[0]->check_type_can_return_int(func_name_cstring()) ||
           args[1]->check_type_scalar(func_name_cstring());
  }
public:
  Item_func_benchmark(THD *thd, Item *count_expr, Item *expr):
    Item_long_func(thd, count_expr, expr)
  {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("benchmark") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    max_length=1;
    base_flags&= ~item_base_t::MAYBE_NULL;
    return FALSE;
  }
  void print(String *str, enum_query_type query_type) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_benchmark>(thd, this); }
};


void item_func_sleep_init(void);
void item_func_sleep_free(void);

class Item_func_sleep :public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_can_return_real(func_name_cstring()); }
public:
  Item_func_sleep(THD *thd, Item *a): Item_long_func(thd, a) {}
  bool fix_length_and_dec() override { fix_char_length(1); return FALSE; }
  bool const_item() const override { return 0; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("sleep") };
    return name;
  }
  table_map used_tables() const override
  {
    return used_tables_cache | RAND_TABLE_BIT;
  }
  bool is_expensive() override { return 1; }
  longlong val_int() override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sleep>(thd, this); }
};



#ifdef HAVE_DLOPEN

class Item_udf_func :public Item_func
{
  /**
    Mark "this" as non-deterministic if it uses no tables
    and is not a constant at the same time.
  */
  void set_non_deterministic_if_needed()
  {
    if (!const_item_cache && !used_tables_cache)
      used_tables_cache= RAND_TABLE_BIT;
  }
protected:
  udf_handler udf;
  bool is_expensive_processor(void *arg) override { return TRUE; }

  class VDec_udf: public Dec_ptr_and_buffer
  {
  public:
    VDec_udf(Item_udf_func *func, udf_handler *udf)
    {
      my_bool tmp_null_value;
      m_ptr= udf->val_decimal(&tmp_null_value, &m_buffer);
      DBUG_ASSERT(is_null() == (tmp_null_value != 0));
      func->null_value= is_null();
    }
  };

public:
  Item_udf_func(THD *thd, udf_func *udf_arg):
    Item_func(thd), udf(udf_arg) {}
  Item_udf_func(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_func(thd, list), udf(udf_arg) {}
  LEX_CSTRING func_name_cstring() const override
  {
    const char *tmp= udf.name();
    return { tmp, strlen(tmp) };
  }
  enum Functype functype() const override { return UDF_FUNC; }
  bool fix_fields(THD *thd, Item **ref) override
  {
    DBUG_ASSERT(fixed() == 0);
    bool res= udf.fix_fields(thd, this, arg_count, args);
    set_non_deterministic_if_needed();
    base_flags|= item_base_t::FIXED;
    return res;
  }
  void fix_num_length_and_dec();
  void update_used_tables() override
  {
    /*
      TODO: Make a member in UDF_INIT and return if a UDF is deterministic or
      not.
      Currently UDF_INIT has a member (const_item) that is an in/out 
      parameter to the init() call.
      The code in udf_handler::fix_fields also duplicates the arguments 
      handling code in Item_func::fix_fields().
      
      The lack of information if a UDF is deterministic makes writing
      a correct update_used_tables() for UDFs impossible.
      One solution to this would be :
       - Add a is_deterministic member of UDF_INIT
       - (optionally) deprecate the const_item member of UDF_INIT
       - Take away the duplicate code from udf_handler::fix_fields() and
         make Item_udf_func call Item_func::fix_fields() to process its 
         arguments as for any other function.
       - Store the deterministic flag returned by <udf>_init into the 
       udf_handler. 
       - Don't implement Item_udf_func::fix_fields, implement
       Item_udf_func::fix_length_and_dec() instead (similar to non-UDF
       functions).
       - Override Item_func::update_used_tables to call 
       Item_func::update_used_tables() and add a RAND_TABLE_BIT to the 
       result of Item_func::update_used_tables() if the UDF is 
       non-deterministic.
       - (optionally) rename RAND_TABLE_BIT to NONDETERMINISTIC_BIT to
       better describe its usage.
       
      The above would require a change of the UDF API.
      Until that change is done here's how the current code works:
      We call Item_func::update_used_tables() only when we know that
      the function depends on real non-const tables and is deterministic.
      This can be done only because we know that the optimizer will
      call update_used_tables() only when there's possibly a new const
      table. So update_used_tables() can only make a Item_func more
      constant than it is currently.
      That's why we don't need to do anything if a function is guaranteed
      to return non-constant (it's non-deterministic) or is already a
      const.
    */  
    if ((used_tables_cache & ~PSEUDO_TABLE_BITS) && 
        !(used_tables_cache & RAND_TABLE_BIT))
    {
      Item_func::update_used_tables();
      set_non_deterministic_if_needed();
    }
  }
  void cleanup() override;
  bool eval_not_null_tables(void *opt_arg) override
  {
    not_null_tables_cache= 0;
    return 0;
  }
  bool find_not_null_fields(table_map allowed) override
  {
    return false;
  }
  bool is_expensive() override { return 1; }
  void print(String *str, enum_query_type query_type) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_NON_DETERMINISTIC);
  }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override
  { return false; }
};


class Item_func_udf_float :public Item_udf_func
{
 public:
  Item_func_udf_float(THD *thd, udf_func *udf_arg):
    Item_udf_func(thd, udf_arg) {}
  Item_func_udf_float(THD *thd, udf_func *udf_arg,
                      List<Item> &list):
    Item_udf_func(thd, udf_arg, list) {}
  longlong val_int() override
  {
    DBUG_ASSERT(fixed());
    return Converter_double_to_longlong(Item_func_udf_float::val_real(),
                                        unsigned_flag).result();
  }
  my_decimal *val_decimal(my_decimal *dec_buf) override
  {
    double res=val_real();
    if (null_value)
      return NULL;
    double2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
    return dec_buf;
  }
  double val_real() override;
  String *val_str(String *str) override;
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  bool fix_length_and_dec() override { fix_num_length_and_dec(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_udf_float>(thd, this); }
};


class Item_func_udf_int :public Item_udf_func
{
public:
  Item_func_udf_int(THD *thd, udf_func *udf_arg):
    Item_udf_func(thd, udf_arg) {}
  Item_func_udf_int(THD *thd, udf_func *udf_arg,
                    List<Item> &list):
    Item_udf_func(thd, udf_arg, list) {}
  longlong val_int() override;
  double val_real() override { return (double) Item_func_udf_int::val_int(); }
  my_decimal *val_decimal(my_decimal *decimal_value) override
  {
    return val_decimal_from_int(decimal_value);
  }
  String *val_str(String *str) override;
  const Type_handler *type_handler() const override
  {
    if (unsigned_flag)
      return &type_handler_ulonglong;
    return &type_handler_slonglong;
  }
  bool fix_length_and_dec() override { decimals= 0; max_length= 21; return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_udf_int>(thd, this); }
};


class Item_func_udf_decimal :public Item_udf_func
{
public:
  Item_func_udf_decimal(THD *thd, udf_func *udf_arg):
    Item_udf_func(thd, udf_arg) {}
  Item_func_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_udf_func(thd, udf_arg, list) {}
  longlong val_int() override
  {
    return VDec_udf(this, &udf).to_longlong(unsigned_flag);
  }
  double val_real() override
  {
    return VDec_udf(this, &udf).to_double();
  }
  my_decimal *val_decimal(my_decimal *) override;
  String *val_str(String *str) override
  {
    return VDec_udf(this, &udf).to_string_round(str, decimals);
  }
  const Type_handler *type_handler() const override
  { return &type_handler_newdecimal; }
  bool fix_length_and_dec() override { fix_num_length_and_dec(); return FALSE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_udf_decimal>(thd, this); }
};


class Item_func_udf_str :public Item_udf_func
{
public:
  Item_func_udf_str(THD *thd, udf_func *udf_arg):
    Item_udf_func(thd, udf_arg) {}
  Item_func_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_udf_func(thd, udf_arg, list) {}
  String *val_str(String *) override;
  double val_real() override
  {
    int err_not_used;
    char *end_not_used;
    String *res;
    res= val_str(&str_value);
    return res ? res->charset()->strntod((char*) res->ptr(), res->length(),
                                         &end_not_used, &err_not_used) : 0.0;
  }
  longlong val_int() override
  {
    int err_not_used;
    String *res;  res=val_str(&str_value);
    return res ? res->charset()->strntoll(res->ptr(),res->length(),10,
                                          (char**) 0, &err_not_used) : (longlong) 0;
  }
  my_decimal *val_decimal(my_decimal *dec_buf) override
  {
    String *res=val_str(&str_value);
    if (!res)
      return NULL;
    string2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
    return dec_buf;
  }
  const Type_handler *type_handler() const override
  { return string_type_handler(); }
  bool fix_length_and_dec() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_udf_str>(thd, this); }
};

#else /* Dummy functions to get yy_*.cc files compiled */

class Item_func_udf_float :public Item_real_func
{
 public:
  Item_func_udf_float(THD *thd, udf_func *udf_arg):
    Item_real_func(thd) {}
  Item_func_udf_float(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_real_func(thd, list) {}
  double val_real() { DBUG_ASSERT(fixed()); return 0.0; }
};


class Item_func_udf_int :public Item_int_func
{
public:
  Item_func_udf_int(THD *thd, udf_func *udf_arg):
    Item_int_func(thd) {}
  Item_func_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_int_func(thd, list) {}
  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }
  longlong val_int() { DBUG_ASSERT(fixed()); return 0; }
};


class Item_func_udf_decimal :public Item_int_func
{
public:
  Item_func_udf_decimal(THD *thd, udf_func *udf_arg):
    Item_int_func(thd) {}
  Item_func_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_int_func(thd, list) {}
  const Type_handler *type_handler() const override
  { return &type_handler_slonglong; }
  my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed()); return 0; }
};


class Item_func_udf_str :public Item_func
{
public:
  Item_func_udf_str(THD *thd, udf_func *udf_arg):
    Item_func(thd) {}
  Item_func_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list):
    Item_func(thd, list) {}
  String *val_str(String *)
    { DBUG_ASSERT(fixed()); null_value=1; return 0; }
  double val_real() { DBUG_ASSERT(fixed()); null_value= 1; return 0.0; }
  longlong val_int() { DBUG_ASSERT(fixed()); null_value=1; return 0; }
  bool fix_length_and_dec() override
  { base_flags|= item_base_t::MAYBE_NULL; max_length=0; return FALSE; }
};

#endif /* HAVE_DLOPEN */

void mysql_ull_cleanup(THD *thd);
void mysql_ull_set_explicit_lock_duration(THD *thd);


class Item_func_lock :public Item_long_func
{
 public:
  Item_func_lock(THD *thd): Item_long_func(thd) { }
  Item_func_lock(THD *thd, Item *a): Item_long_func(thd, a) {}
  Item_func_lock(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
  table_map used_tables() const override
  {
    return used_tables_cache | RAND_TABLE_BIT;
  }
  bool const_item() const override { return 0; }
  bool is_expensive() override { return 1; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
};


class Item_func_get_lock final :public Item_func_lock
{
  bool check_arguments() const override
  {
    return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
           args[1]->check_type_can_return_real(func_name_cstring());
  }
  String value;
 public:
  Item_func_get_lock(THD *thd, Item *a, Item *b) :Item_func_lock(thd, a, b) {}
  longlong val_int() override final;
  LEX_CSTRING func_name_cstring() const override final
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("get_lock") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    max_length= 1;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override final
  { return get_item_copy<Item_func_get_lock>(thd, this); }
};


class Item_func_release_all_locks final :public Item_func_lock
{
public:
  Item_func_release_all_locks(THD *thd): Item_func_lock(thd)
  { unsigned_flag= 1; }
  longlong val_int() override final;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("release_all_locks") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override final
  { return get_item_copy<Item_func_release_all_locks>(thd, this); }
};


class Item_func_release_lock final :public Item_func_lock
{
  bool check_arguments() const override
  { return args[0]->check_type_general_purpose_string(func_name_cstring()); }
  String value;
public:
  Item_func_release_lock(THD *thd, Item *a): Item_func_lock(thd, a) {}
  longlong val_int() override final;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("release_lock") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    max_length= 1;
    set_maybe_null();
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override final
  { return get_item_copy<Item_func_release_lock>(thd, this); }
};


/* replication functions */

class Item_master_pos_wait :public Item_longlong_func
{
  bool check_arguments() const override
  {
    return
      args[0]->check_type_general_purpose_string(func_name_cstring()) ||
      args[1]->check_type_can_return_int(func_name_cstring()) ||
      (arg_count > 2 && args[2]->check_type_can_return_int(func_name_cstring())) ||
      (arg_count > 3 && args[3]->check_type_general_purpose_string(func_name_cstring()));
  }
  String value;
public:
  Item_master_pos_wait(THD *thd, Item *a, Item *b)
   :Item_longlong_func(thd, a, b) {}
  Item_master_pos_wait(THD *thd, Item *a, Item *b, Item *c):
    Item_longlong_func(thd, a, b, c) {}
  Item_master_pos_wait(THD *thd, Item *a, Item *b, Item *c, Item *d):
    Item_longlong_func(thd, a, b, c, d) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("master_pos_wait") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    max_length=21;
    set_maybe_null();
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_master_pos_wait>(thd, this); }
};


class Item_master_gtid_wait :public Item_long_func
{
  bool check_arguments() const override
  {
    return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
      (arg_count > 1 && args[1]->check_type_can_return_real(func_name_cstring()));
  }
  String value;
public:
  Item_master_gtid_wait(THD *thd, Item *a)
   :Item_long_func(thd, a) {}
  Item_master_gtid_wait(THD *thd, Item *a, Item *b)
   :Item_long_func(thd, a, b) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("master_gtid_wait") };
    return name;
  }
  bool fix_length_and_dec() override { max_length=2; return FALSE; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_master_gtid_wait>(thd, this); }
};


/* Handling of user definable variables */

class user_var_entry;


/**
  A class to set and get user variables
*/
class Item_func_user_var :public Item_hybrid_func
{
protected:
  user_var_entry *m_var_entry;
public:
  LEX_CSTRING name; // keep it public
  Item_func_user_var(THD *thd, const LEX_CSTRING *a)
    :Item_hybrid_func(thd), m_var_entry(NULL), name(*a) { }
  Item_func_user_var(THD *thd, const LEX_CSTRING *a, Item *b)
    :Item_hybrid_func(thd, b), m_var_entry(NULL), name(*a) { }
  Item_func_user_var(THD *thd, Item_func_user_var *item)
    :Item_hybrid_func(thd, item),
    m_var_entry(item->m_var_entry), name(item->name) { }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    DBUG_ASSERT(fixed());
    return create_tmp_field_ex_from_handler(root, table, src, param,
                                            type_handler());
  }
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  { return create_table_field_from_handler(root, table); }
  bool check_vcol_func_processor(void *arg) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
};


class Item_func_set_user_var :public Item_func_user_var
{
  /*
    The entry_thread_id variable is used:
    1) to skip unnecessary updates of the entry field (see above);
    2) to reset the entry field that was initialized in the other thread
       (for example, an item tree of a trigger that updates user variables
       may be shared between several connections, and the entry_thread_id field
       prevents updates of one connection user variables from a concurrent
       connection calling the same trigger that initially updated some
       user variable it the first connection context).
  */
  my_thread_id entry_thread_id;
  String value;
  my_decimal decimal_buff;
  bool null_item;
  union
  {
    longlong vint;
    double vreal;
    String *vstr;
    my_decimal *vdec;
  } save_result;

public:
  Item_func_set_user_var(THD *thd, const LEX_CSTRING *a, Item *b):
    Item_func_user_var(thd, a, b),
    entry_thread_id(0)
  {}
  Item_func_set_user_var(THD *thd, Item_func_set_user_var *item)
    :Item_func_user_var(thd, item),
    entry_thread_id(item->entry_thread_id),
    value(item->value), decimal_buff(item->decimal_buff),
    null_item(item->null_item), save_result(item->save_result)
  {}

  enum Functype functype() const override { return SUSERVAR_FUNC; }
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *str) override;
  my_decimal *val_decimal(my_decimal *) override;
  double val_result() override;
  longlong val_int_result() override;
  bool val_bool_result() override;
  String *str_result(String *str) override;
  my_decimal *val_decimal_result(my_decimal *) override;
  bool is_null_result() override;
  bool update_hash(void *ptr, size_t length, const Type_handler *th,
                   CHARSET_INFO *cs);
  bool send(Protocol *protocol, st_value *buffer) override;
  void make_send_field(THD *thd, Send_field *tmp_field) override;
  bool check(bool use_result_field);
  void save_item_result(Item *item);
  bool update();
  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec() override;
  void print(String *str, enum_query_type query_type) override;
  enum precedence precedence() const override { return ASSIGN_PRECEDENCE; }
  void print_as_stmt(String *str, enum_query_type query_type);
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("set_user_var") };
    return name;
  }
  int save_in_field(Field *field, bool no_conversions,
                    bool can_use_result_field);
  int save_in_field(Field *field, bool no_conversions) override
  {
    return save_in_field(field, no_conversions, 1);
  }
  void save_org_in_field(Field *field,
                         fast_field_copier data __attribute__ ((__unused__)))
    override
  { (void) save_in_field(field, 1, 0); }
  bool register_field_in_read_map(void *arg) override;
  bool register_field_in_bitmap(void *arg) override;
  bool set_entry(THD *thd, bool create_if_not_exists);
  void cleanup() override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_set_user_var>(thd, this); }
  bool excl_dep_on_table(table_map tab_map) override { return false; }
};


class Item_func_get_user_var :public Item_func_user_var,
                              private Settable_routine_parameter
{
public:
  Item_func_get_user_var(THD *thd, const LEX_CSTRING *a):
    Item_func_user_var(thd, a) {}
  enum Functype functype() const override { return GUSERVAR_FUNC; }
  LEX_CSTRING get_name() { return name; }
  double val_real() override;
  longlong val_int() override;
  my_decimal *val_decimal(my_decimal*) override;
  String *val_str(String* str) override;
  bool fix_length_and_dec() override;
  void print(String *str, enum_query_type query_type) override;
  /*
    We must always return variables as strings to guard against selects of type
    select @t1:=1,@t1,@t:="hello",@t from foo where (@t1:= t2.b)
  */
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("get_user_var") };
    return name;
  }
  bool const_item() const override;
  table_map used_tables() const override
  { return const_item() ? 0 : RAND_TABLE_BIT; }
  bool eq(const Item *item, bool binary_cmp) const override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_get_user_var>(thd, this); }
private:
  bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;

public:
  Settable_routine_parameter *get_settable_routine_parameter() override
  {
    return this;
  }
};


/*
  This item represents user variable used as out parameter (e.g in LOAD DATA),
  and it is supposed to be used only for this purprose. So it is simplified
  a lot. Actually you should never obtain its value.

  The only two reasons for this thing being an Item is possibility to store it
  in List<Item> and desire to place this code somewhere near other functions
  working with user variables.
*/
class Item_user_var_as_out_param :public Item_fixed_hybrid,
                                  public Load_data_outvar
{
  LEX_CSTRING org_name;
  user_var_entry *entry;
public:
  Item_user_var_as_out_param(THD *thd, const LEX_CSTRING *a)
  :Item_fixed_hybrid(thd)
  {
    DBUG_ASSERT(a->length < UINT_MAX32);
    org_name= *a;
    set_name(thd, a->str, a->length, system_charset_info);
  }
  Load_data_outvar *get_load_data_outvar() override
  {
    return this;
  }
  bool load_data_set_null(THD *thd, const Load_data_param *param) override
  {
    set_null_value(param->charset());
    return false;
  }
  bool load_data_set_no_data(THD *thd, const Load_data_param *param) override
  {
    set_null_value(param->charset());
    return false;
  }
  bool load_data_set_value(THD *thd, const char *pos, uint length,
                           const Load_data_param *param) override
  {
    set_value(pos, length, param->charset());
    return false;
  }
  void load_data_print_for_log_event(THD *thd, String *to) const override;
  bool load_data_add_outvar(THD *thd, Load_data_param *param) const override
  {
    return param->add_outvar_user_var(thd);
  }
  uint load_data_fixed_length() const override
  {
    return 0;
  }
  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override
  {
    DBUG_ASSERT(0);
    return NULL;
  }
  /* We should return something different from FIELD_ITEM here */
  enum Type type() const override { return CONST_ITEM;}
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *str) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  my_decimal *val_decimal(my_decimal *decimal_buffer) override;
  /* fix_fields() binds variable name with its entry structure */
  bool fix_fields(THD *thd, Item **ref) override;
  void set_null_value(CHARSET_INFO* cs);
  void set_value(const char *str, uint length, CHARSET_INFO* cs);
  const Type_handler *type_handler() const override
  { return &type_handler_double; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_user_var_as_out_param>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return get_copy(thd); }
};


/* A system variable */

#define GET_SYS_VAR_CACHE_LONG     1
#define GET_SYS_VAR_CACHE_DOUBLE   2
#define GET_SYS_VAR_CACHE_STRING   4

class Item_func_get_system_var :public Item_func
{
  sys_var *var;
  enum_var_type var_type, orig_var_type;
  LEX_CSTRING component;
  longlong cached_llval;
  double cached_dval;
  String cached_strval;
  bool cached_null_value;
  query_id_t used_query_id;
  uchar cache_present;

public:
  Item_func_get_system_var(THD *thd, sys_var *var_arg,
                           enum_var_type var_type_arg,
                           LEX_CSTRING *component_arg, const char *name_arg,
                           size_t name_len_arg);
  enum Functype functype() const override { return GSYSVAR_FUNC; }
  void update_null_value() override;
  bool fix_length_and_dec() override;
  void print(String *str, enum_query_type query_type) override;
  bool const_item() const override { return true; }
  table_map used_tables() const override { return 0; }
  const Type_handler *type_handler() const override;
  double val_real() override;
  longlong val_int() override;
  String* val_str(String*) override;
  my_decimal *val_decimal(my_decimal *dec_buf) override
  { return val_decimal_from_real(dec_buf); }
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
  }
  /* TODO: fix to support views */
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("get_system_var") };
    return name;
  }
  /**
    Indicates whether this system variable is written to the binlog or not.

    Variables are written to the binlog as part of "status_vars" in
    Query_log_event, as an Intvar_log_event, or a Rand_log_event.

    @return true if the variable is written to the binlog, false otherwise.
  */
  bool is_written_to_binlog();
  bool eq(const Item *item, bool binary_cmp) const override;

  void cleanup() override;
  bool check_vcol_func_processor(void *arg) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_get_system_var>(thd, this); }
};


/* for fulltext search */

class Item_func_match :public Item_real_func
{
public:
  uint key, match_flags;
  bool join_key;
  DTCollation cmp_collation;
  FT_INFO *ft_handler;
  TABLE *table;
  Item_func_match *master;   // for master-slave optimization
  Item *concat_ws;           // Item_func_concat_ws
  String value;              // value of concat_ws
  String search_value;       // key_item()'s value converted to cmp_collation

  Item_func_match(THD *thd, List<Item> &a, uint b):
    Item_real_func(thd, a), key(0), match_flags(b), join_key(0), ft_handler(0),
    table(0), master(0), concat_ws(0) { }
  void cleanup() override
  {
    DBUG_ENTER("Item_func_match::cleanup");
    Item_real_func::cleanup();
    if (!master && ft_handler)
      ft_handler->please->close_search(ft_handler);
    ft_handler= 0;
    concat_ws= 0;
    table= 0;           // required by Item_func_match::eq()
    DBUG_VOID_RETURN;
  }
  bool is_expensive_processor(void *arg) override { return TRUE; }
  enum Functype functype() const override { return FT_FUNC; }
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("match") };
    return name;
  }
  bool eval_not_null_tables(void *opt_arg) override
  {
    not_null_tables_cache= 0;
    return 0;
  }
  bool find_not_null_fields(table_map allowed) override
  {
    return false;
  }
  bool fix_fields(THD *thd, Item **ref) override;
  bool eq(const Item *, bool binary_cmp) const override;
  /* The following should be safe, even if we compare doubles */
  longlong val_int() override { DBUG_ASSERT(fixed()); return val_real() != 0.0; }
  double val_real() override;
  void print(String *str, enum_query_type query_type) override;

  bool fix_index();
  bool init_search(THD *thd, bool no_order);
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function("match ... against()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_match>(thd, this); }
  Item *do_build_clone(THD *thd) const override { return nullptr; }
private:
  /**
     Check whether storage engine for given table, 
     allows FTS Boolean search on non-indexed columns.

     @todo A flag should be added to the extended fulltext API so that 
           it may be checked whether search on non-indexed columns are 
           supported. Currently, it is not possible to check for such a 
           flag since @c this->ft_handler is not yet set when this function is 
           called.  The current hack is to assume that search on non-indexed
           columns are supported for engines that does not support the extended
           fulltext API (e.g., MyISAM), while it is not supported for other 
           engines (e.g., InnoDB)

     @param table_arg Table for which storage engine to check

     @retval true if BOOLEAN search on non-indexed columns is supported
     @retval false otherwise
   */
  bool allows_search_on_non_indexed_columns(TABLE* table_arg)
  {
    // Only Boolean search may support non_indexed columns
    if (!(match_flags & FT_BOOL))
      return false;

    DBUG_ASSERT(table_arg && table_arg->file);

    // Assume that if extended fulltext API is not supported,
    // non-indexed columns are allowed.  This will be true for MyISAM.
    if ((table_arg->file->ha_table_flags() & HA_CAN_FULLTEXT_EXT) == 0)
      return true;

    return false;
  }
};


class Item_func_bit_xor : public Item_func_bit_operator
{
public:
  Item_func_bit_xor(THD *thd, Item *a, Item *b)
   :Item_func_bit_operator(thd, a, b) {}
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("^") };
    return name;
  }
  enum precedence precedence() const override { return BITXOR_PRECEDENCE; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_bit_xor>(thd, this); }
};

class Item_func_is_free_lock :public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_general_purpose_string(func_name_cstring()); }
  String value;
public:
  Item_func_is_free_lock(THD *thd, Item *a): Item_long_func(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("is_free_lock") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0;
    max_length=1;
    set_maybe_null();
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_is_free_lock>(thd, this); }
};

class Item_func_is_used_lock :public Item_long_func
{
  bool check_arguments() const override
  { return args[0]->check_type_general_purpose_string(func_name_cstring()); }
  String value;
public:
  Item_func_is_used_lock(THD *thd, Item *a): Item_long_func(thd, a) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("is_used_lock") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals=0; max_length=10;
    set_maybe_null();
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_is_used_lock>(thd, this); }
};


struct Lex_cast_type_st: public Lex_length_and_dec_st
{
private:
  const Type_handler *m_type_handler;
public:
  void set(const Type_handler *handler, const char *length, const char *dec)
  {
    m_type_handler= handler;
    Lex_length_and_dec_st::set(length, dec);
  }
  void set(const Type_handler *handler, Lex_length_and_dec_st length_and_dec)
  {
    m_type_handler= handler;
    Lex_length_and_dec_st::operator=(length_and_dec);
  }
  void set(const Type_handler *handler, const char *length)
  {
    set(handler, length, 0);
  }
  void set(const Type_handler *handler)
  {
    set(handler, 0, 0);
  }
  const Type_handler *type_handler() const { return m_type_handler; }
  Item *create_typecast_item(THD *thd, Item *item,
                             CHARSET_INFO *cs= NULL) const
  {
    return m_type_handler->
      create_typecast_item(thd, item,
                           Type_cast_attributes(length(), dec(), cs));
  }
  Item *create_typecast_item_or_error(THD *thd, Item *item,
                                      CHARSET_INFO *cs= NULL) const;
};


class Item_func_row_count :public Item_longlong_func
{
public:
  Item_func_row_count(THD *thd): Item_longlong_func(thd) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("row_count") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals= 0;
    base_flags&= ~item_base_t::MAYBE_NULL;
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_row_count>(thd, this); }
};


/*
 *
 * Stored FUNCTIONs
 *
 */

class Item_func_sp :public Item_func,
                    public Item_sp
{
private:
  const Sp_handler *m_handler;

  bool execute();

protected:
  bool is_expensive_processor(void *arg) override
  { return is_expensive(); }

  bool check_arguments() const override
  {
    // sp_prepare_func_item() checks that the number of columns is correct
    return false;
  } 
public:

  Item_func_sp(THD *thd, Name_resolution_context *context_arg,
               sp_name *name, const Sp_handler *sph);

  Item_func_sp(THD *thd, Name_resolution_context *context_arg,
               sp_name *name, const Sp_handler *sph, List<Item> &list);

  virtual ~Item_func_sp() = default;

  void update_used_tables() override;

  void cleanup() override;

  LEX_CSTRING func_name_cstring() const override;

  const Type_handler *type_handler() const override;

  Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
                             const Tmp_field_param *param) override;
  Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
  {
    return result_type() != STRING_RESULT ?
           sp_result_field :
           create_table_field_from_handler(root, table);
  }
  void make_send_field(THD *thd, Send_field *tmp_field) override;

  longlong val_int() override
  {
    if (execute())
      return (longlong) 0;
    return sp_result_field->val_int();
  }

  double val_real() override
  {
    if (execute())
      return 0.0;
    return sp_result_field->val_real();
  }

  my_decimal *val_decimal(my_decimal *dec_buf) override
  {
    if (execute())
      return NULL;
    return sp_result_field->val_decimal(dec_buf);
  }

  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
  {
    if (execute())
      return true;
    return sp_result_field->get_date(ltime, fuzzydate);
  }

  String *val_str(String *str) override
  {
    String buf;
    char buff[20];
    buf.set(buff, 20, str->charset());
    buf.length(0);
    if (execute())
      return NULL;
    /*
      result_field will set buf pointing to internal buffer
      of the resul_field. Due to this it will change any time
      when SP is executed. In order to prevent occasional
      corruption of returned value, we make here a copy.
    */
    sp_result_field->val_str(&buf);
    str->copy(buf);
    return str;
  }

  bool val_native(THD *thd, Native *to) override
  {
    if (execute())
      return true;
    return (null_value= sp_result_field->val_native(to));
  }

  void update_null_value() override
  { 
    execute();
  }

  bool change_context_processor(void *cntx) override
  { context= (Name_resolution_context *)cntx; return FALSE; }

  enum Functype functype() const override { return FUNC_SP; }

  bool fix_fields(THD *thd, Item **ref) override;
  bool fix_length_and_dec(void) override;
  bool is_expensive() override;

  inline Field *get_sp_result_field()
  {
    return sp_result_field;
  }
  const sp_name *get_sp_name() const
  {
    return m_name;
  }

  bool check_vcol_func_processor(void *arg) override;
  bool limit_index_condition_pushdown_processor(void *opt_arg) override
  {
    return TRUE;
  }
  Item *do_get_copy(THD *thd) const override { return 0; }
  bool eval_not_null_tables(void *opt_arg) override
  {
    not_null_tables_cache= 0;
    return 0;
  }
  bool excl_dep_on_grouping_fields(st_select_lex *sel) override
  { return false; }
  bool find_not_null_fields(table_map allowed) override
  {
    return false;
  }
};


class Item_func_found_rows :public Item_longlong_func
{
public:
  Item_func_found_rows(THD *thd): Item_longlong_func(thd) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("found_rows") };
    return name;
  }
  bool fix_length_and_dec() override
  {
    decimals= 0;
    base_flags&= ~item_base_t::MAYBE_NULL;
    return FALSE;
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_found_rows>(thd, this); }
};


class Item_func_oracle_sql_rowcount :public Item_longlong_func
{
public:
  Item_func_oracle_sql_rowcount(THD *thd): Item_longlong_func(thd) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("SQL%ROWCOUNT") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override
  {
    str->append(func_name_cstring());
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_oracle_sql_rowcount>(thd, this); }
};


class Item_func_sqlcode: public Item_long_func
{
public:
  Item_func_sqlcode(THD *thd): Item_long_func(thd) { }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("SQLCODE") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override
  {
    str->append(func_name_cstring());
  }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
  }
  bool fix_length_and_dec() override
  {
    base_flags&= ~item_base_t::MAYBE_NULL;
    null_value= false;
    max_length= 11;
    return FALSE;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_sqlcode>(thd, this); }
};


void uuid_short_init();
ulonglong server_uuid_value();

class Item_func_uuid_short :public Item_longlong_func
{
public:
  Item_func_uuid_short(THD *thd): Item_longlong_func(thd) {}
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("uuid_short") };
    return name;
  }
  longlong val_int() override;
  bool const_item() const override { return false; }
  bool fix_length_and_dec() override
  { max_length= 21; unsigned_flag=1; return FALSE; }
  table_map used_tables() const override { return RAND_TABLE_BIT; }
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg,
                                     VCOL_NON_DETERMINISTIC);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_uuid_short>(thd, this); }
};


class Item_func_last_value :public Item_func
{
protected:
  Item *last_value;
public:
  Item_func_last_value(THD *thd, List<Item> &list): Item_func(thd, list) {}
  double val_real() override;
  longlong val_int() override;
  String *val_str(String *) override;
  my_decimal *val_decimal(my_decimal *) override;
  bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
  bool val_native(THD *thd, Native *) override;
  bool fix_length_and_dec() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("last_value") };
    return name;
  }
  const Type_handler *type_handler() const override
  { return last_value->type_handler(); }
  bool eval_not_null_tables(void *) override
  {
    not_null_tables_cache= 0;
    return 0;
  }
  bool find_not_null_fields(table_map allowed) override
  {
    return false;
  }
  bool const_item() const override { return 0; }
  void evaluate_sideeffects();
  void update_used_tables() override
  {
    Item_func::update_used_tables();
    copy_flags(last_value, item_base_t::MAYBE_NULL);
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_last_value>(thd, this); }
};


/* Implementation for sequences: NEXT VALUE FOR sequence and NEXTVAL() */

class Item_func_nextval :public Item_longlong_func
{
protected:
  TABLE_LIST *table_list;
  TABLE *table;
  bool check_access_and_fix_fields(THD *, Item **ref, privilege_t);
public:
  Item_func_nextval(THD *thd, TABLE_LIST *table_list_arg):
  Item_longlong_func(thd), table_list(table_list_arg) {}
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("nextval") };
    return name;
  }
  bool fix_fields(THD *thd, Item **ref) override
  { return check_access_and_fix_fields(thd, ref, INSERT_ACL | SELECT_ACL); }
  bool fix_length_and_dec() override
  {
    unsigned_flag= 0;
    max_length= MAX_BIGINT_WIDTH;
    set_maybe_null();             /* In case of errors */
    return FALSE;
  }
  /*
    update_table() function must be called during the value function
    as in case of DEFAULT the sequence table may not yet be open
    while fix_fields() are called
  */
  void update_table()
  {
    if (!(table= table_list->table))
    {
      /*
        If nextval was used in DEFAULT then next_local points to
        the table_list used by to open the sequence table
      */
      table= table_list->next_local->table;
    }
  }
  bool const_item() const override { return 0; }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_nextval>(thd, this); }
  void print(String *str, enum_query_type query_type) override;
  bool check_vcol_func_processor(void *arg) override
  {
    return mark_unsupported_function(func_name(), "()", arg, VCOL_NEXTVAL);
  }
};


/* Implementation for sequences: LASTVAL(sequence), PostgreSQL style */

class Item_func_lastval :public Item_func_nextval
{
public:
  Item_func_lastval(THD *thd, TABLE_LIST *table_list_arg):
  Item_func_nextval(thd, table_list_arg) {}
  bool fix_fields(THD *thd, Item **ref) override
  { return check_access_and_fix_fields(thd, ref, SELECT_ACL); }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("lastval") };
    return name;
  }
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_lastval>(thd, this); }
};


/* Implementation for sequences: SETVAL(sequence), PostgreSQL style */

class Item_func_setval :public Item_func_nextval
{
  longlong nextval;
  ulonglong round;
  bool is_used;
public:
  Item_func_setval(THD *thd, TABLE_LIST *table_list_arg, longlong nextval_arg,
                   ulonglong round_arg, bool is_used_arg)
    : Item_func_nextval(thd, table_list_arg),
    nextval(nextval_arg), round(round_arg), is_used(is_used_arg)
  {}
  bool fix_fields(THD *thd, Item **ref) override
  { return check_access_and_fix_fields(thd, ref, INSERT_ACL); }
  longlong val_int() override;
  LEX_CSTRING func_name_cstring() const override
  {
    static LEX_CSTRING name= {STRING_WITH_LEN("setval") };
    return name;
  }
  void print(String *str, enum_query_type query_type) override;
  Item *do_get_copy(THD *thd) const override
  { return get_item_copy<Item_func_setval>(thd, this); }
};


Item *get_system_var(THD *thd, enum_var_type var_type,
                     const LEX_CSTRING *name, const LEX_CSTRING *component);
extern bool check_reserved_words(const LEX_CSTRING *name);
double my_double_round(double value, longlong dec, bool dec_unsigned,
                       bool truncate);

extern bool volatile  mqh_used;

bool update_hash(user_var_entry *entry, bool set_null, void *ptr, size_t length,
                 const Type_handler *th, CHARSET_INFO *cs);

#endif /* ITEM_FUNC_INCLUDED */
server/private/lf.h000064400000014476150400264020010303 0ustar00/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

#ifndef INCLUDE_LF_INCLUDED
#define INCLUDE_LF_INCLUDED

#include <my_atomic.h>

C_MODE_START

/*
  wait-free dynamic array, see lf_dynarray.c

  4 levels of 256 elements each mean 4311810304 elements in an array - it
  should be enough for a while
*/
#define LF_DYNARRAY_LEVEL_LENGTH 256
#define LF_DYNARRAY_LEVELS       4

typedef struct {
  void * volatile level[LF_DYNARRAY_LEVELS];
  uint size_of_element;
} LF_DYNARRAY;

typedef int (*lf_dynarray_func)(void *, void *);

void lf_dynarray_init(LF_DYNARRAY *array, uint element_size);
void lf_dynarray_destroy(LF_DYNARRAY *array);

void *lf_dynarray_value(LF_DYNARRAY *array, uint idx);
void *lf_dynarray_lvalue(LF_DYNARRAY *array, uint idx);
int lf_dynarray_iterate(LF_DYNARRAY *array, lf_dynarray_func func, void *arg);

/*
  pin manager for memory allocator, lf_alloc-pin.c
*/

#define LF_PINBOX_PINS 4
#define LF_PURGATORY_SIZE 100

typedef void lf_pinbox_free_func(void *, void *, void*);

typedef struct {
  LF_DYNARRAY pinarray;
  lf_pinbox_free_func *free_func;
  void *free_func_arg;
  uint free_ptr_offset;
  uint32 volatile pinstack_top_ver;         /* this is a versioned pointer */
  uint32 volatile pins_in_array;            /* number of elements in array */
} LF_PINBOX;

typedef struct {
  void * volatile pin[LF_PINBOX_PINS];
  LF_PINBOX *pinbox;
  void  *purgatory;
  uint32 purgatory_count;
  uint32 volatile link;
  /* avoid false sharing */
  char pad[CPU_LEVEL1_DCACHE_LINESIZE];
} LF_PINS;

/* compile-time assert to make sure we have enough pins.  */
#define lf_pin(PINS, PIN, ADDR)                                \
  do {                                                          \
    compile_time_assert(PIN < LF_PINBOX_PINS);                  \
    my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR));              \
  } while(0)

#define lf_unpin(PINS, PIN)        lf_pin(PINS, PIN, NULL)
#define lf_assert_pin(PINS, PIN)   assert((PINS)->pin[PIN] != 0)
#define lf_assert_unpin(PINS, PIN) assert((PINS)->pin[PIN] == 0)

void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset,
                    lf_pinbox_free_func *free_func, void * free_func_arg);
void lf_pinbox_destroy(LF_PINBOX *pinbox);

LF_PINS *lf_pinbox_get_pins(LF_PINBOX *pinbox);
void lf_pinbox_put_pins(LF_PINS *pins);
void lf_pinbox_free(LF_PINS *pins, void *addr);

/*
  memory allocator, lf_alloc-pin.c
*/

typedef struct st_lf_allocator {
  LF_PINBOX pinbox;
  uchar * volatile top;
  uint element_size;
  uint32 volatile mallocs;
  void (*constructor)(uchar *); /* called, when an object is malloc()'ed */
  void (*destructor)(uchar *);  /* called, when an object is free()'d    */
} LF_ALLOCATOR;

void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset);
void lf_alloc_destroy(LF_ALLOCATOR *allocator);
uint lf_alloc_pool_count(LF_ALLOCATOR *allocator);
/*
  shortcut macros to access underlying pinbox functions from an LF_ALLOCATOR
  see lf_pinbox_get_pins() and lf_pinbox_put_pins()
*/
#define lf_alloc_free(PINS, PTR)       lf_pinbox_free((PINS), (PTR))
#define lf_alloc_get_pins(A)           lf_pinbox_get_pins(&(A)->pinbox)
#define lf_alloc_put_pins(PINS)        lf_pinbox_put_pins(PINS)
#define lf_alloc_direct_free(ALLOC, ADDR) \
  do {                                    \
    if ((ALLOC)->destructor)              \
      (ALLOC)->destructor((uchar*) ADDR); \
    my_free(ADDR);                        \
  } while(0)

void *lf_alloc_new(LF_PINS *pins);

C_MODE_END

/*
  extendible hash, lf_hash.cc
*/
#include <hash.h>

C_MODE_START

typedef struct st_lf_hash LF_HASH;
typedef void (*lf_hash_initializer)(LF_HASH *hash, void *dst, const void *src);

#define LF_HASH_UNIQUE 1

/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */
extern const int LF_HASH_OVERHEAD;

struct st_lf_hash {
  LF_DYNARRAY array;                    /* hash itself */
  LF_ALLOCATOR alloc;                   /* allocator for elements */
  my_hash_get_key get_key;              /* see HASH */
  lf_hash_initializer initializer;      /* called when an element is inserted */
  my_hash_function hash_function;       /* see HASH */
  CHARSET_INFO *charset;                /* see HASH */
  uint key_offset, key_length;          /* see HASH */
  uint element_size;                    /* size of memcpy'ed area on insert */
  uint flags;                           /* LF_HASH_UNIQUE, etc */
  int32 volatile size;                  /* size of array */
  int32 volatile count;                 /* number of elements in the hash */
};

void lf_hash_init(LF_HASH *hash, uint element_size, uint flags,
                  uint key_offset, uint key_length, my_hash_get_key get_key,
                  CHARSET_INFO *charset);
void lf_hash_destroy(LF_HASH *hash);
int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data);
void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen);
void *lf_hash_search_using_hash_value(LF_HASH *hash, LF_PINS *pins,
                                      my_hash_value_type hash_value,
                                      const void *key, uint keylen);
int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen);
int lf_hash_iterate(LF_HASH *hash, LF_PINS *pins,
                    my_hash_walk_action action, void *argument);
#define lf_hash_size(hash) \
  my_atomic_load32_explicit(&(hash)->count, MY_MEMORY_ORDER_RELAXED)
/*
  shortcut macros to access underlying pinbox functions from an LF_HASH
  see lf_pinbox_get_pins() and lf_pinbox_put_pins()
*/
#define lf_hash_get_pins(HASH)       lf_alloc_get_pins(&(HASH)->alloc)
#define lf_hash_put_pins(PINS)       lf_pinbox_put_pins(PINS)
#define lf_hash_search_unpin(PINS)   lf_unpin((PINS), 2)
/*
  cleanup
*/

C_MODE_END

#endif

server/private/wsrep_thd.h000064400000025630150400264020011673 0ustar00/* Copyright (C) 2013-2023 Codership Oy <info@codership.com>

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA. */

#ifndef WSREP_THD_H
#define WSREP_THD_H

#include <my_config.h>

#include "mysql/service_wsrep.h"
#include "wsrep/client_state.hpp"
#include "sql_class.h"
#include "wsrep_utils.h"
#include <deque>
class Wsrep_thd_queue
{
public:
  Wsrep_thd_queue(THD* t) : thd(t)
  {
    mysql_mutex_init(key_LOCK_wsrep_thd_queue,
                     &LOCK_wsrep_thd_queue,
                     MY_MUTEX_INIT_FAST);
    mysql_cond_init(key_COND_wsrep_thd_queue, &COND_wsrep_thd_queue, NULL);
  }
  ~Wsrep_thd_queue()
  {
    mysql_mutex_destroy(&LOCK_wsrep_thd_queue);
    mysql_cond_destroy(&COND_wsrep_thd_queue);
  }
  bool push_back(THD* thd)
  {
    DBUG_ASSERT(thd);
    wsp::auto_lock lock(&LOCK_wsrep_thd_queue);
    std::deque<THD*>::iterator it = queue.begin();
    while (it != queue.end())
    {
      if (*it == thd)
      {
        return true;
      }
      it++;
    }
    queue.push_back(thd);
    mysql_cond_signal(&COND_wsrep_thd_queue);
    return false;
  }
  THD* pop_front()
  {
    wsp::auto_lock lock(&LOCK_wsrep_thd_queue);
    while (queue.empty())
    {
      if (thd->killed != NOT_KILLED)
        return NULL;

      thd->mysys_var->current_mutex= &LOCK_wsrep_thd_queue;
      thd->mysys_var->current_cond=  &COND_wsrep_thd_queue;

      mysql_cond_wait(&COND_wsrep_thd_queue, &LOCK_wsrep_thd_queue);

      thd->mysys_var->current_mutex= 0;
      thd->mysys_var->current_cond=  0;
    }
    THD* ret= queue.front();
    queue.pop_front();
    return ret;
  }
private:
  THD*             thd;
  std::deque<THD*> queue;
  mysql_mutex_t    LOCK_wsrep_thd_queue;
  mysql_cond_t     COND_wsrep_thd_queue;
};

int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, void *, system_status_var *,
                          enum enum_var_type scope);
bool wsrep_create_appliers(long threads, bool mutex_protected=false);
void wsrep_create_rollbacker();

bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd);
/*
  Abort transaction for victim_thd. This function is called from
  MDL BF abort codepath.
*/
void wsrep_abort_thd(THD *bf_thd,
                     THD *victim_thd,
                     my_bool signal) __attribute__((nonnull(1,2)));

/**
  Kill wsrep connection with kill_signal. Object thd is not
  guaranteed to exist anymore when this function returns.

  Asserts that the caller holds victim_thd->LOCK_thd_kill,
  victim_thd->LOCK_thd_data.

  @param thd THD object for connection that executes the KILL.
  @param victim_thd THD object for connection to be killed.
  @param kill_signal Kill signal.

  @return Zero if the kill was successful, otherwise non-zero error code.
 */
uint wsrep_kill_thd(THD *thd, THD *victim_thd, killed_state kill_signal);

/*
  Backup kill status for commit.
 */
void wsrep_backup_kill_for_commit(THD *);

/*
  Restore KILL status after commit.
 */
void wsrep_restore_kill_after_commit(THD *);

/*
  Helper methods to deal with thread local storage.
  The purpose of these methods is to hide the details of thread
  local storage handling when operating with wsrep storage access
  and streaming applier THDs

  With one-thread-per-connection thread handling thread specific
  variables are allocated when the thread is started and deallocated
  before thread exits (my_thread_init(), my_thread_end()). However,
  with pool-of-threads thread handling new thread specific variables
  are allocated for each THD separately (see threadpool_add_connection()),
  and the variables in thread local storage are assigned from
  currently active thread (see thread_attach()). This must be taken into
  account when storing/resetting thread local storage and when creating
  streaming applier THDs.
*/

/**
   Create new variables for thread local storage. With
   one-thread-per-connection thread handling this is a no op,
   with pool-of-threads new variables are created via my_thread_init().
   It is assumed that the caller has called wsrep_reset_threadvars() to clear
   the thread local storage before this call.

   @return Zero in case of success, non-zero otherwise.
*/
int wsrep_create_threadvars();

/**
   Delete variables which were created by wsrep_create_threadvars().
   The caller must store variables into thread local storage before
   this call via wsrep_store_threadvars().
*/
void wsrep_delete_threadvars();

/**
   Assign variables from current thread local storage into THD.
   This should be called for THDs whose lifetime is limited to single
   thread execution or which may share the operation context with some
   parent THD (e.g. storage access) and thus don't require separately
   allocated globals.

   With one-thread-per-connection thread handling this is a no-op,
   with pool-of-threads the variables which are currently stored into
   thread local storage are assigned to THD.
*/
void wsrep_assign_from_threadvars(THD *);

/**
   Helper struct to save variables from thread local storage.
 */
struct Wsrep_threadvars
{
  THD* cur_thd;
  st_my_thread_var* mysys_var;
};

/**
   Save variables from thread local storage into Wsrep_threadvars struct.
 */
Wsrep_threadvars wsrep_save_threadvars();

/**
   Restore variables into thread local storage from Wsrep_threadvars struct.
*/
void wsrep_restore_threadvars(const Wsrep_threadvars&);

/**
   Store variables into thread local storage.
*/
void wsrep_store_threadvars(THD *);

/**
   Reset thread local storage.
*/
void wsrep_reset_threadvars(THD *);

/**
   Helper functions to override error status

   In many contexts it is desirable to mask the original error status
   set for THD or it is necessary to change OK status to error.
   This function implements the common logic for the most
   of the cases.

   Rules:
   * If the diagnostics are has OK or EOF status, override it unconditionally
   * If the error is either ER_ERROR_DURING_COMMIT or ER_LOCK_DEADLOCK
     it is usually the correct error status to be returned to client,
     so don't override those by default
 */

static inline void wsrep_override_error(THD *thd, uint error, const char *format= 0, ...)
{
  Diagnostics_area *da= thd->get_stmt_da();
  if (da->is_ok() ||
      da->is_eof() ||
      !da->is_set() ||
      (da->is_error() &&
       da->sql_errno() != error &&
       da->sql_errno() != ER_ERROR_DURING_COMMIT &&
       da->sql_errno() != ER_LOCK_DEADLOCK))
  {
    da->reset_diagnostics_area();
    va_list args;
    va_start(args, format);
    if (!format) format= ER_THD(thd, error);
    my_printv_error(error, format, MYF(0), args);
    va_end(args);
  }
}

static inline void wsrep_override_error(THD* thd,
                                        wsrep::client_error ce,
                                        enum wsrep::provider::status status)
{
  DBUG_ASSERT(ce != wsrep::e_success);
  switch (ce)
  {
  case wsrep::e_error_during_commit:
    if (status == wsrep::provider::error_size_exceeded)
      wsrep_override_error(thd, ER_UNKNOWN_ERROR, "Maximum writeset size exceeded");
    else
      /* TODO: Figure out better error number */
      if (status)
        wsrep_override_error(thd, ER_ERROR_DURING_COMMIT,
                             "Error while appending streaming replication fragment"
                             "(provider status: %s)",
                             wsrep::provider::to_string(status).c_str());
      else
        wsrep_override_error(thd, ER_ERROR_DURING_COMMIT,
                             "Error while appending streaming replication fragment");
    break;
  case wsrep::e_deadlock_error:
    switch (thd->lex->sql_command)
    {
    case SQLCOM_XA_END:
    case SQLCOM_XA_PREPARE:
      wsrep_override_error(thd, ER_XA_RBDEADLOCK);
      break;
    default:
      wsrep_override_error(thd, ER_LOCK_DEADLOCK);
      break;
    }
    break;
  case wsrep::e_interrupted_error:
    wsrep_override_error(thd, ER_QUERY_INTERRUPTED);
    break;
  case wsrep::e_size_exceeded_error:
    wsrep_override_error(thd, ER_UNKNOWN_ERROR, "Maximum writeset size exceeded");
    break;
  case wsrep::e_append_fragment_error:
    /* TODO: Figure out better error number */
    if (status)
      wsrep_override_error(thd, ER_ERROR_DURING_COMMIT,
                           "Error while appending streaming replication fragment"
                           "(provider status: %s)",
                           wsrep::provider::to_string(status).c_str());
    else
      wsrep_override_error(thd, ER_ERROR_DURING_COMMIT,
                           "Error while appending streaming replication fragment");
    break;
  case wsrep::e_not_supported_error:
    wsrep_override_error(thd, ER_NOT_SUPPORTED_YET);
    break;
  case wsrep::e_timeout_error:
    wsrep_override_error(thd, ER_LOCK_WAIT_TIMEOUT);
    break;
  default:
    wsrep_override_error(thd, ER_UNKNOWN_ERROR);
  }
}

/**
   Helper function to log THD wsrep context.

   @param thd Pointer to THD
   @param message Optional message
   @param function Function where the call was made from
 */
static inline void wsrep_log_thd(const THD *thd,
                                 const char *message,
                                 const char *function)
{
  WSREP_DEBUG("%s %s\n"
              "    thd: %llu thd_ptr: %p client_mode: %s client_state: %s trx_state: %s\n"
              "    next_trx_id: %lld trx_id: %lld seqno: %lld\n"
              "    is_streaming: %d fragments: %zu\n"
              "    sql_errno: %u message: %s\n"
#define WSREP_THD_LOG_QUERIES
#ifdef WSREP_THD_LOG_QUERIES
              "    command: %d query: %.72s"
#endif /* WSREP_OBSERVER_LOG_QUERIES */
              ,
              function,
              message ? message : "",
              thd->thread_id,
              thd,
              wsrep_thd_client_mode_str(thd),
              wsrep_thd_client_state_str(thd),
              wsrep_thd_transaction_state_str(thd),
              (long long)thd->wsrep_next_trx_id(),
              (long long)thd->wsrep_trx_id(),
              (long long)wsrep_thd_trx_seqno(thd),
              thd->wsrep_trx().is_streaming(),
              thd->wsrep_sr().fragments().size(),
              (thd->get_stmt_da()->is_error() ? thd->get_stmt_da()->sql_errno() : 0),
              (thd->get_stmt_da()->is_error() ? thd->get_stmt_da()->message() : "")
#ifdef WSREP_THD_LOG_QUERIES
              , thd->lex->sql_command,
              wsrep_thd_query(thd)
#endif /* WSREP_OBSERVER_LOG_QUERIES */
              );
}

#define WSREP_LOG_THD(thd_, message_) wsrep_log_thd(thd_, message_, __FUNCTION__)

#endif /* WSREP_THD_H */
server/private/sql_const.h000064400000025734150400264020011706 0ustar00/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/**
  @file
  File containing constants that can be used throughout the server.

  @note This file shall not contain or include any declarations of any kinds.
*/

#ifndef SQL_CONST_INCLUDED
#define SQL_CONST_INCLUDED

#include <mysql_version.h>

#define LIBLEN FN_REFLEN-FN_LEN			/* Max l{ngd p} dev */
/* extra 4+4 bytes for slave tmp tables */
#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
#define MAX_ALIAS_NAME 256
#define MAX_FIELD_NAME (NAME_LEN+1)             /* Max colum name length +1 */
#define MAX_SYS_VAR_LENGTH 32
#define MAX_KEY MAX_INDEXES                     /* Max used keys */
#define MAX_REF_PARTS 32			/* Max parts used as ref */

/*
  Maximum length of the data part of an index lookup key.

  The "data part" is defined as the value itself, not including the
  NULL-indicator bytes or varchar length bytes ("the Extras"). We need this
  value because there was a bug where length of the Extras were not counted.

  You probably need MAX_KEY_LENGTH, not this constant.
*/
#define MAX_DATA_LENGTH_FOR_KEY 3072
#if SIZEOF_OFF_T > 4
#define MAX_REFLENGTH 8				/* Max length for record ref */
#else
#define MAX_REFLENGTH 4				/* Max length for record ref */
#endif
#define MAX_HOSTNAME  (HOSTNAME_LENGTH + 1)	/* len+1 in mysql.user */
#define MAX_CONNECTION_NAME NAME_LEN

#define MAX_MBWIDTH		3		/* Max multibyte sequence */
#define MAX_FILENAME_MBWIDTH    5
#define MAX_FIELD_CHARLENGTH	255
/*
  In MAX_FIELD_VARCHARLENGTH we reserve extra bytes for the overhead:
  - 2 bytes for the length
  - 1 byte for NULL bits
  to avoid the "Row size too large" error for these three corner definitions:
    CREATE TABLE t1 (c VARBINARY(65533));
    CREATE TABLE t1 (c VARBINARY(65534));
    CREATE TABLE t1 (c VARBINARY(65535));
  Like VARCHAR(65536), they will be converted to BLOB automatically
  in non-strict mode.
*/
#define MAX_FIELD_VARCHARLENGTH	(65535-2-1)
#define MAX_FIELD_BLOBLENGTH UINT_MAX32         /* cf field_blob::get_length() */
#define CONVERT_IF_BIGGER_TO_BLOB 512           /* Threshold *in characters*   */

/* Max column width +1 */
#define MAX_FIELD_WIDTH		(MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1)

#define MAX_BIT_FIELD_LENGTH    64      /* Max length in bits for bit fields */

#define MAX_DATE_WIDTH		10	/* YYYY-MM-DD */
#define MIN_TIME_WIDTH          10      /* -HHH:MM:SS */
#define MAX_TIME_WIDTH          16      /* -DDDDDD HH:MM:SS */
#define MAX_TIME_FULL_WIDTH     23      /* -DDDDDD HH:MM:SS.###### */
#define MAX_DATETIME_FULL_WIDTH 26	/* YYYY-MM-DD HH:MM:SS.###### */
#define MAX_DATETIME_WIDTH	19	/* YYYY-MM-DD HH:MM:SS */
#define MAX_DATETIME_COMPRESSED_WIDTH 14  /* YYYYMMDDHHMMSS */
#define MAX_DATETIME_PRECISION  6

#define MAX_TABLES	(sizeof(table_map)*8-3)	/* Max tables in join */
#define PARAM_TABLE_BIT	(((table_map) 1) << (sizeof(table_map)*8-3))
#define OUTER_REF_TABLE_BIT	(((table_map) 1) << (sizeof(table_map)*8-2))
#define RAND_TABLE_BIT	(((table_map) 1) << (sizeof(table_map)*8-1))
#define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \
                           RAND_TABLE_BIT)
#define CONNECT_STRING_MAXLEN   65535           /* stored in 2 bytes in .frm */
#define MAX_FIELDS	4096			/* Limit in the .frm file */
#define MAX_PARTITIONS  8192

#define MAX_SELECT_NESTING (SELECT_NESTING_MAP_SIZE - 1)

#define MAX_SORT_MEMORY 2048*1024
#define MIN_SORT_MEMORY 1024

/* Some portable defines */

#define STRING_BUFFER_USUAL_SIZE 80

/* Memory allocated when parsing a statement / saving a statement */
#define MEM_ROOT_BLOCK_SIZE       8192
#define MEM_ROOT_PREALLOC         8192
#define TRANS_MEM_ROOT_BLOCK_SIZE 4096
#define TRANS_MEM_ROOT_PREALLOC   4096

#define DEFAULT_ERROR_COUNT	64
#define EXTRA_RECORDS	10			/* Extra records in sort */
#define SCROLL_EXTRA	5			/* Extra scroll-rows. */
#define FIELD_NAME_USED ((uint) 32768)		/* Bit set if fieldname used */
#define FORM_NAME_USED	((uint) 16384)		/* Bit set if formname used */
#define FIELD_NR_MASK	16383			/* To get fieldnumber */
#define FERR		-1			/* Error from my_functions */
#define CREATE_MODE	0			/* Default mode on new files */
#define NAMES_SEP_CHAR	255			/* Char to sep. names */

#define READ_RECORD_BUFFER	(uint) (IO_SIZE*8) /* Pointer_buffer_size */
#define DISK_BUFFER_SIZE	(uint) (IO_SIZE*16) /* Size of diskbuffer */

#define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */
#define FRM_VER_EXPRESSSIONS (FRM_VER+5) /* 11 */
#define FRM_VER_CURRENT  FRM_VER_EXPRESSSIONS

/***************************************************************************
  Configuration parameters
****************************************************************************/

#define ACL_CACHE_SIZE		256
#define MAX_PASSWORD_LENGTH	32
#define HOST_CACHE_SIZE		128
#define MAX_ACCEPT_RETRY	10	// Test accept this many times
#define MAX_FIELDS_BEFORE_HASH	32
#define USER_VARS_HASH_SIZE     16
#define SEQUENCES_HASH_SIZE     16
#define TABLE_OPEN_CACHE_MIN    200
#define TABLE_OPEN_CACHE_DEFAULT 2000
#define TABLE_DEF_CACHE_DEFAULT 400
/**
  We must have room for at least 400 table definitions in the table
  cache, since otherwise there is no chance prepared
  statements that use these many tables can work.
  Prepared statements use table definition cache ids (table_map_id)
  as table version identifiers. If the table definition
  cache size is less than the number of tables used in a statement,
  the contents of the table definition cache is guaranteed to rotate
  between a prepare and execute. This leads to stable validation
  errors. In future we shall use more stable version identifiers,
  for now the only solution is to ensure that the table definition
  cache can contain at least all tables of a given statement.
*/
#define TABLE_DEF_CACHE_MIN     400

/**
 Maximum number of connections default value.
 151 is larger than Apache's default max children,
 to avoid "too many connections" error in a common setup.
*/
#define MAX_CONNECTIONS_DEFAULT 151

/*
  Stack reservation.
  Feel free to raise this by the smallest amount you can to get the
  "execution_constants" test to pass.
*/
#define STACK_MIN_SIZE          16000   // Abort if less stack during eval.

#define STACK_MIN_SIZE_FOR_OPEN (1024*80)
#define STACK_BUFF_ALLOC        352     ///< For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT  10	///< Abort read after this many int.
#endif

/*
  Allocations with MEM_ROOT. We should try to keep these as powers of 2
  and not higher than 32768 to get full benefit of allocators like
  tcmalloc that will for these use a local heap without locks.
*/

#define QUERY_ALLOC_BLOCK_SIZE		32768
#define QUERY_ALLOC_PREALLOC_SIZE   	32768 /* 65536 could be better */
#define TRANS_ALLOC_BLOCK_SIZE		8192
#define TRANS_ALLOC_PREALLOC_SIZE	4096
#define RANGE_ALLOC_BLOCK_SIZE		4096
#define ACL_ALLOC_BLOCK_SIZE		1024
#define UDF_ALLOC_BLOCK_SIZE		1024
#define TABLE_PREALLOC_BLOCK_SIZE	8192
#define TABLE_ALLOC_BLOCK_SIZE		4096
#define WARN_ALLOC_BLOCK_SIZE		2048
#define WARN_ALLOC_PREALLOC_SIZE	1024
#define TMP_TABLE_BLOCK_SIZE            16384
#define TMP_TABLE_PREALLOC_SIZE         32768
#define SHOW_ALLOC_BLOCK_SIZE           32768

/*
  The following parameters is to decide when to use an extra cache to
  optimise seeks when reading a big table in sorted order
*/
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (10L*1024*1024)
#define MIN_ROWS_TO_USE_TABLE_CACHE	 100
#define MIN_ROWS_TO_USE_BULK_INSERT	 100

/**
  The following is used to decide if MySQL should use table scanning
  instead of reading with keys.  The number says how many evaluation of the
  WHERE clause is comparable to reading one extra row from a table.
*/
#define TIME_FOR_COMPARE         5.0	//  5 WHERE compares == one read
#define TIME_FOR_COMPARE_IDX    20.0

#define IDX_BLOCK_COPY_COST  ((double) 1 / TIME_FOR_COMPARE)
#define IDX_LOOKUP_COST      ((double) 1 / 8)
#define MULTI_RANGE_READ_SETUP_COST (IDX_BLOCK_COPY_COST/10)

/**
  Number of comparisons of table rowids equivalent to reading one row from a 
  table.
*/
#define TIME_FOR_COMPARE_ROWID  (TIME_FOR_COMPARE*100)

/* cost1 is better that cost2 only if cost1 + COST_EPS < cost2 */
#define COST_EPS  0.001

/*
  For sequential disk seeks the cost formula is:
    DISK_SEEK_BASE_COST + DISK_SEEK_PROP_COST * #blocks_to_skip  
  
  The cost of average seek 
    DISK_SEEK_BASE_COST + DISK_SEEK_PROP_COST*BLOCKS_IN_AVG_SEEK =1.0.
*/
#define DISK_SEEK_BASE_COST ((double)0.9)

#define BLOCKS_IN_AVG_SEEK  128

#define DISK_SEEK_PROP_COST ((double)0.1/BLOCKS_IN_AVG_SEEK)


/**
  Number of rows in a reference table when refereed through a not unique key.
  This value is only used when we don't know anything about the key
  distribution.
*/
#define MATCHING_ROWS_IN_OTHER_TABLE 10

/*
  Subquery materialization-related constants
*/
#define HEAP_TEMPTABLE_LOOKUP_COST 0.05
#define DISK_TEMPTABLE_LOOKUP_COST 1.0
#define SORT_INDEX_CMP_COST 0.02


#define COST_MAX (DBL_MAX * (1.0 - DBL_EPSILON))

#define COST_ADD(c,d) (COST_MAX - (d) > (c) ? (c) + (d) : COST_MAX)

#define COST_MULT(c,f) (COST_MAX / (f) > (c) ? (c) * (f) : COST_MAX)


#define MY_CHARSET_BIN_MB_MAXLEN 1

/** Don't pack string keys shorter than this (if PACK_KEYS=1 isn't used). */
#define KEY_DEFAULT_PACK_LENGTH 8

/** Characters shown for the command in 'show processlist'. */
#define PROCESS_LIST_WIDTH 100
/* Characters shown for the command in 'information_schema.processlist' */
#define PROCESS_LIST_INFO_WIDTH 65535

#define PRECISION_FOR_DOUBLE 53
#define PRECISION_FOR_FLOAT  24

/* -[digits].E+## */
#define MAX_FLOAT_STR_LENGTH (FLT_DIG + 6)
/* -[digits].E+### */
#define MAX_DOUBLE_STR_LENGTH (DBL_DIG + 7)

/*
  Default time to wait before aborting a new client connection
  that does not respond to "initial server greeting" timely
*/
#define CONNECT_TIMEOUT		10
 /* Wait 5 minutes before removing thread from thread cache */
#define THREAD_CACHE_TIMEOUT	5*60

/* The following can also be changed from the command line */
#define DEFAULT_CONCURRENCY	10
#define DELAYED_LIMIT		100		/**< pause after xxx inserts */
#define DELAYED_QUEUE_SIZE	1000
#define DELAYED_WAIT_TIMEOUT	(5*60)		/**< Wait for delayed insert */
#define MAX_CONNECT_ERRORS	100		///< errors before disabling host

#define LONG_TIMEOUT ((ulong) 3600L*24L*365L)

/**
  Maximum length of time zone name that we support (Time zone name is
  char(64) in db). mysqlbinlog needs it.
*/
#define MAX_TIME_ZONE_NAME_LENGTH       (NAME_LEN + 1)

#define SP_PSI_STATEMENT_INFO_COUNT 19

#endif /* SQL_CONST_INCLUDED */
server/private/uniques.h000064400000010171150400264020011357 0ustar00/* Copyright (c) 2016 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-1301  USA */

#ifndef UNIQUE_INCLUDED
#define UNIQUE_INCLUDED

#include "filesort.h"

/*
   Unique -- class for unique (removing of duplicates).
   Puts all values to the TREE. If the tree becomes too big,
   it's dumped to the file. User can request sorted values, or
   just iterate through them. In the last case tree merging is performed in
   memory simultaneously with iteration, so it should be ~2-3x faster.
 */

class Unique :public Sql_alloc
{
  DYNAMIC_ARRAY file_ptrs;
  ulong max_elements;   /* Total number of elements that will be stored in-memory */
  size_t max_in_memory_size;
  IO_CACHE file;
  TREE tree;
 /* Number of elements filtered out due to min_dupl_count when storing results
    to table. See Unique::get */
  ulong filtered_out_elems;
  uint size;

  uint full_size;   /* Size of element + space needed to store the number of
                       duplicates found for the element. */
  uint min_dupl_count;   /* Minimum number of occurences of element required for
                            it to be written to record_pointers.
                            always 0 for unions, > 0 for intersections */
  bool with_counters;

  bool merge(TABLE *table, uchar *buff, size_t size, bool without_last_merge);
  bool flush();

public:
  ulong elements;
  SORT_INFO sort;
  Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg,
	 uint size_arg, size_t max_in_memory_size_arg,
         uint min_dupl_count_arg= 0);
  ~Unique();
  ulong elements_in_tree() { return tree.elements_in_tree; }
  inline bool unique_add(void *ptr)
  {
    DBUG_ENTER("unique_add");
    DBUG_PRINT("info", ("tree %u - %lu", tree.elements_in_tree, max_elements));
    if (!(tree.flag & TREE_ONLY_DUPS) && 
        tree.elements_in_tree >= max_elements && flush())
      DBUG_RETURN(1);
    DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg));
  }

  bool is_in_memory() { return (my_b_tell(&file) == 0); }
  void close_for_expansion() { tree.flag= TREE_ONLY_DUPS; }

  bool get(TABLE *table);
  
  /* Cost of searching for an element in the tree */
  inline static double get_search_cost(ulonglong tree_elems,
                                       double compare_factor)
  {
    return log((double) tree_elems) / (compare_factor * M_LN2);
  }  

  static double get_use_cost(uint *buffer, size_t nkeys, uint key_size,
                             size_t max_in_memory_size, double compare_factor,
                             bool intersect_fl, bool *in_memory);
  inline static int get_cost_calc_buff_size(size_t nkeys, uint key_size,
                                            size_t max_in_memory_size)
  {
    size_t max_elems_in_tree=
      max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size);

    if (max_elems_in_tree == 0)
      max_elems_in_tree= 1;
    return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree));
  }

  void reset();
  bool walk(TABLE *table, tree_walk_action action, void *walk_action_arg);

  uint get_size() const { return size; }
  size_t get_max_in_memory_size() const { return max_in_memory_size; }

  friend int unique_write_to_file(void* key, element_count count, void *unique);
  friend int unique_write_to_ptrs(void* key, element_count count, void *unique);

  friend int unique_write_to_file_with_count(void *key, element_count count,
                                             void *unique);
  friend int unique_intersect_write_to_ptrs(void *key, element_count count,
                                            void *unique);
};

#endif /* UNIQUE_INCLUDED */
server/private/replication.h000064400000037352150400264020012211 0ustar00/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.

   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,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef REPLICATION_H
#define REPLICATION_H

/***************************************************************************
  NOTE: plugin locking.

  The plugin is locked on Binlog_transmit_observer::transmit_start and is
  unlocked after Binlog_transmit_observer::transmit_stop.  All other
  master observable events happen between these two and don't lock the
  plugin at all.

  Also a plugin is locked on Binlog_relay_IO_observer::thread_start
  and unlocked after Binlog_relay_IO_observer::thread_stop.
***************************************************************************/

#include <mysql.h>

typedef struct st_mysql MYSQL;

#ifdef __cplusplus
extern "C" {
#endif

/**
   Transaction observer flags.
*/
enum Trans_flags {
  /** Transaction is a real transaction */
  TRANS_IS_REAL_TRANS = 1
};

/**
   Transaction observer parameter
*/
typedef struct Trans_param {
  uint32 server_id;
  uint32 flags;

  /*
    The latest binary log file name and position written by current
    transaction, if binary log is disabled or no log event has been
    written into binary log file by current transaction (events
    written into transaction log cache are not counted), these two
    member will be zero.
  */
  const char *log_file;
  my_off_t log_pos;
} Trans_param;

/**
   Observes and extends transaction execution
*/
typedef struct Trans_observer {
  uint32 len;

  /**
     This callback is called after transaction commit
     
     This callback is called right after commit to storage engines for
     transactional tables.

     For non-transactional tables, this is called at the end of the
     statement, before sending statement status, if the statement
     succeeded.

     @note The return value is currently ignored by the server.
     @note This hook is called wo/ any global mutex held

     @param param The parameter for transaction observers

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_commit)(Trans_param *param);

  /**
     This callback is called after transaction rollback

     This callback is called right after rollback to storage engines
     for transactional tables.

     For non-transactional tables, this is called at the end of the
     statement, before sending statement status, if the statement
     failed.

     @note The return value is currently ignored by the server.

     @param param The parameter for transaction observers

     @note This hook is called wo/ any global mutex held

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_rollback)(Trans_param *param);
} Trans_observer;

/**
   Binlog storage flags
*/
enum Binlog_storage_flags {
  /** Binary log was sync:ed */
  BINLOG_STORAGE_IS_SYNCED = 1,

  /** First(or alone) in a group commit */
  BINLOG_GROUP_COMMIT_LEADER = 2,

  /** Last(or alone) in a group commit */
  BINLOG_GROUP_COMMIT_TRAILER = 4
};

/**
   Binlog storage observer parameters
 */
typedef struct Binlog_storage_param {
  uint32 server_id;
} Binlog_storage_param;

/**
   Observe binlog logging storage
*/
typedef struct Binlog_storage_observer {
  uint32 len;

  /**
     This callback is called after binlog has been flushed

     This callback is called after cached events have been flushed to
     binary log file. Whether the binary log file is synchronized to
     disk is indicated by the bit BINLOG_STORAGE_IS_SYNCED in @a flags.

     @note: this hook is called with LOCK_log mutex held

     @param param Observer common parameter
     @param log_file Binlog file name been updated
     @param log_pos Binlog position after update
     @param flags flags for binlog storage

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_flush)(Binlog_storage_param *param,
                     const char *log_file, my_off_t log_pos,
                     uint32 flags);

  /**
     This callback is called after binlog has been synced

     This callback is called after events flushed to disk has been sync:ed
     ("group committed").

     @note: this hook is called with LOCK_after_binlog_sync mutex held

     @param param Observer common parameter
     @param log_file Binlog file name been updated
     @param log_pos Binlog position after update
     @param flags flags for binlog storage

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_sync)(Binlog_storage_param *param,
                    const char *log_file, my_off_t log_pos,
                    uint32 flags);
} Binlog_storage_observer;

/**
   Replication binlog transmitter (binlog dump) observer parameter.
*/
typedef struct Binlog_transmit_param {
  uint32 server_id;
  uint32 flags;
} Binlog_transmit_param;

/**
   Observe and extends the binlog dumping thread.
*/
typedef struct Binlog_transmit_observer {
  uint32 len;
  
  /**
     This callback is called when binlog dumping starts


     @param param Observer common parameter
     @param log_file Binlog file name to transmit from
     @param log_pos Binlog position to transmit from

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*transmit_start)(Binlog_transmit_param *param,
                        const char *log_file, my_off_t log_pos);

  /**
     This callback is called when binlog dumping stops

     @param param Observer common parameter
     
     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*transmit_stop)(Binlog_transmit_param *param);

  /**
     This callback is called to reserve bytes in packet header for event transmission

     This callback is called when resetting transmit packet header to
     reserve bytes for this observer in packet header.

     The @a header buffer is allocated by the server code, and @a size
     is the size of the header buffer. Each observer can only reserve
     a maximum size of @a size in the header.

     @param param Observer common parameter
     @param header Pointer of the header buffer
     @param size Size of the header buffer
     @param len Header length reserved by this observer

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*reserve_header)(Binlog_transmit_param *param,
                        unsigned char *header,
                        unsigned long size,
                        unsigned long *len);

  /**
     This callback is called before sending an event packet to slave

     @param param Observer common parameter
     @param packet Binlog event packet to send
     @param len Length of the event packet
     @param log_file Binlog file name of the event packet to send
     @param log_pos Binlog position of the event packet to send

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*before_send_event)(Binlog_transmit_param *param,
                           unsigned char *packet, unsigned long len,
                           const char *log_file, my_off_t log_pos );

  /**
     This callback is called after sending an event packet to slave

     @param param Observer common parameter
     @param event_buf Binlog event packet buffer sent
     @param len length of the event packet buffer

     @retval 0 Sucess
     @retval 1 Failure
   */
  int (*after_send_event)(Binlog_transmit_param *param,
                          const char *event_buf, unsigned long len);

  /**
     This callback is called after resetting master status

     This is called when executing the command RESET MASTER, and is
     used to reset status variables added by observers.

     @param param Observer common parameter

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_reset_master)(Binlog_transmit_param *param);
} Binlog_transmit_observer;

/**
   Binlog relay IO flags
*/
enum Binlog_relay_IO_flags {
  /** Binary relay log was sync:ed */
  BINLOG_RELAY_IS_SYNCED = 1
};


/**
  Replication binlog relay IO observer parameter
*/
typedef struct Binlog_relay_IO_param {
  uint32 server_id;

  /* Master host, user and port */
  char *host;
  char *user;
  unsigned int port;

  char *master_log_name;
  my_off_t master_log_pos;

  MYSQL *mysql;                        /* the connection to master */
} Binlog_relay_IO_param;

/**
   Observes and extends the service of slave IO thread.
*/
typedef struct Binlog_relay_IO_observer {
  uint32 len;

  /**
     This callback is called when slave IO thread starts

     @param param Observer common parameter

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*thread_start)(Binlog_relay_IO_param *param);

  /**
     This callback is called when slave IO thread stops

     @param param Observer common parameter

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*thread_stop)(Binlog_relay_IO_param *param);

  /**
     This callback is called before slave requesting binlog transmission from master

     This is called before slave issuing BINLOG_DUMP command to master
     to request binlog.

     @param param Observer common parameter
     @param flags binlog dump flags

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*before_request_transmit)(Binlog_relay_IO_param *param, uint32 flags);

  /**
     This callback is called after read an event packet from master

     @param param Observer common parameter
     @param packet The event packet read from master
     @param len Length of the event packet read from master
     @param event_buf The event packet return after process
     @param event_len The length of event packet return after process

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_read_event)(Binlog_relay_IO_param *param,
                          const char *packet, unsigned long len,
                          const char **event_buf, unsigned long *event_len);

  /**
     This callback is called after written an event packet to relay log

     @param param Observer common parameter
     @param event_buf Event packet written to relay log
     @param event_len Length of the event packet written to relay log
     @param flags flags for relay log

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_queue_event)(Binlog_relay_IO_param *param,
                           const char *event_buf, unsigned long event_len,
                           uint32 flags);

  /**
     This callback is called after reset slave relay log IO status
     
     @param param Observer common parameter

     @retval 0 Sucess
     @retval 1 Failure
  */
  int (*after_reset_slave)(Binlog_relay_IO_param *param);
} Binlog_relay_IO_observer;


/**
   Register a transaction observer

   @param observer The transaction observer to register
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer already exists
*/
int register_trans_observer(Trans_observer *observer, void *p);

/**
   Unregister a transaction observer

   @param observer The transaction observer to unregister
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer not exists
*/
int unregister_trans_observer(Trans_observer *observer, void *p);

/**
   Register a binlog storage observer

   @param observer The binlog storage observer to register
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer already exists
*/
int register_binlog_storage_observer(Binlog_storage_observer *observer, void *p);

/**
   Unregister a binlog storage observer

   @param observer The binlog storage observer to unregister
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer not exists
*/
int unregister_binlog_storage_observer(Binlog_storage_observer *observer, void *p);

/**
   Register a binlog transmit observer

   @param observer The binlog transmit observer to register
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer already exists
*/
int register_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p);

/**
   Unregister a binlog transmit observer

   @param observer The binlog transmit observer to unregister
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer not exists
*/
int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p);

/**
   Register a binlog relay IO (slave IO thread) observer

   @param observer The binlog relay IO observer to register
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer already exists
*/
int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p);

/**
   Unregister a binlog relay IO (slave IO thread) observer

   @param observer The binlog relay IO observer to unregister
   @param p pointer to the internal plugin structure

   @retval 0 Sucess
   @retval 1 Observer not exists
*/
int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p);

/**
   Connect to master

   This function can only used in the slave I/O thread context, and
   will use the same master information to do the connection.

   @code
   MYSQL *mysql = mysql_init(NULL);
   if (rpl_connect_master(mysql))
   {
     // do stuff with the connection
   }
   mysql_close(mysql); // close the connection
   @endcode
   
   @param mysql address of MYSQL structure to use, pass NULL will
   create a new one

   @return address of MYSQL structure on success, NULL on failure
*/
MYSQL *rpl_connect_master(MYSQL *mysql);

/**
   Get the value of user variable as an integer.

   This function will return the value of variable @a name as an
   integer. If the original value of the variable is not an integer,
   the value will be converted into an integer.

   @param name     user variable name
   @param value    pointer to return the value
   @param null_value if not NULL, the function will set it to true if
   the value of variable is null, set to false if not

   @retval 0 Success
   @retval 1 Variable not found
*/
int get_user_var_int(const char *name,
                     long long int *value, int *null_value);

/**
   Get the value of user variable as a double precision float number.

   This function will return the value of variable @a name as real
   number. If the original value of the variable is not a real number,
   the value will be converted into a real number.

   @param name     user variable name
   @param value    pointer to return the value
   @param null_value if not NULL, the function will set it to true if
   the value of variable is null, set to false if not

   @retval 0 Success
   @retval 1 Variable not found
*/
int get_user_var_real(const char *name,
                      double *value, int *null_value);

/**
   Get the value of user variable as a string.

   This function will return the value of variable @a name as
   string. If the original value of the variable is not a string,
   the value will be converted into a string.

   @param name     user variable name
   @param value    pointer to the value buffer
   @param len      length of the value buffer
   @param precision precision of the value if it is a float number
   @param null_value if not NULL, the function will set it to true if
   the value of variable is null, set to false if not

   @retval 0 Success
   @retval 1 Variable not found
*/
int get_user_var_str(const char *name,
                     char *value, unsigned long len,
                     unsigned int precision, int *null_value);

  

#ifdef __cplusplus
}
#endif
#endif /* REPLICATION_H */
server/private/embedded_priv.h000064400000003305150400264020012460 0ustar00/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/* Prototypes for the embedded version of MySQL */

#include <sql_common.h>

C_MODE_START
void lib_connection_phase(NET *net, int phase);
void init_embedded_mysql(MYSQL *mysql, ulong client_flag);
void *create_embedded_thd(ulong client_flag);
int check_embedded_connection(MYSQL *mysql, const char *db);
void free_old_query(MYSQL *mysql);
THD *embedded_get_current_thd();
void embedded_set_current_thd(THD *thd);
extern MYSQL_METHODS embedded_methods;

/* This one is used by embedded library to gather returning data */
typedef struct embedded_query_result
{
  MYSQL_ROWS **prev_ptr;
  unsigned int warning_count, server_status;
  struct st_mysql_data *next;
  my_ulonglong affected_rows, insert_id;
  char info[MYSQL_ERRMSG_SIZE];
  MYSQL_FIELD *fields_list;
  unsigned int last_errno;
  char sqlstate[SQLSTATE_LENGTH+1];
} EQR;


typedef struct st_mariadb_field_extension
{
  MARIADB_CONST_STRING metadata[MARIADB_FIELD_ATTR_LAST+1]; /* 10.5 */
} MARIADB_FIELD_EXTENSION;


C_MODE_END
server/private/sql_analyze_stmt.h000064400000030611150400264020013260 0ustar00/*
   Copyright (c) 2015, 2020, 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/*

== ANALYZE-stmt classes ==

This file contains classes for supporting "ANALYZE statement" feature. These are 
a set of data structures that can be used to store the data about how the 
statement executed.

There are two kinds of data collection:

1. Various counters. We assume that incrementing counters has very low
overhead. Because of that, execution code increments counters unconditionally
(even when not running "ANALYZE $statement" commands. You run regular SELECT/
UPDATE/DELETE/etc and the counters are incremented).

As a free bonus, this lets us print detailed information into the slow query
log, should the query be slow.

2. Timing data. Measuring the time it took to run parts of query has noticeable
overhead. Because of that, we measure the time only when running "ANALYZE
$stmt").
*/

/* fake microseconds as cycles if cycles isn't available */

static inline double timer_tracker_frequency()
{
#if (MY_TIMER_ROUTINE_CYCLES)
  return static_cast<double>(sys_timer_info.cycles.frequency);
#else
  return static_cast<double>(sys_timer_info.microseconds.frequency);
#endif
}


class Gap_time_tracker;
void attach_gap_time_tracker(THD *thd, Gap_time_tracker *gap_tracker, ulonglong timeval);
void process_gap_time_tracker(THD *thd, ulonglong timeval);

/*
  A class for tracking time it takes to do a certain action
*/
class Exec_time_tracker
{
protected:
  ulonglong count;
  ulonglong cycles;
  ulonglong last_start;

  ulonglong measure() const
  {
#if (MY_TIMER_ROUTINE_CYCLES)
    return my_timer_cycles();
#else
    return my_timer_microseconds();
#endif
  }

  void cycles_stop_tracking(THD *thd)
  {
    ulonglong end= measure();
    cycles += end - last_start;

    process_gap_time_tracker(thd, end);
    if (my_gap_tracker)
      attach_gap_time_tracker(thd, my_gap_tracker, end);
  }

  /*
    The time spent after stop_tracking() call on this object and any
    subsequent time tracking call will be billed to this tracker.
  */
  Gap_time_tracker *my_gap_tracker;
public:
  Exec_time_tracker() : count(0), cycles(0), my_gap_tracker(NULL) {}

  void set_gap_tracker(Gap_time_tracker *gap_tracker)
  {
    my_gap_tracker= gap_tracker;
  }

  // interface for collecting time
  void start_tracking(THD *thd)
  {
    last_start= measure();
    process_gap_time_tracker(thd, last_start);
  }

  void stop_tracking(THD *thd)
  {
    count++;
    cycles_stop_tracking(thd);
  }

  // interface for getting the time
  ulonglong get_loops() const { return count; }

  inline double cycles_to_ms(ulonglong cycles_arg) const
  {
    // convert 'cycles' to milliseconds.
    return 1000.0 * static_cast<double>(cycles_arg) /
      timer_tracker_frequency();
  }
  double get_time_ms() const
  {
    return cycles_to_ms(cycles);
  }
  ulonglong get_cycles() const
  {
    return cycles;
  }
  bool has_timed_statistics() const { return cycles > 0; }
};


/*
  Tracker for time spent between the calls to Exec_time_tracker's {start|
  stop}_tracking().

  @seealso Gap_time_tracker_data in sql_class.h
*/
class Gap_time_tracker
{
  ulonglong cycles;
public:
  Gap_time_tracker() : cycles(0) {}

  void log_time(ulonglong start, ulonglong end) {
    cycles += end - start;
  }

  double get_time_ms() const
  {
    // convert 'cycles' to milliseconds.
    return 1000.0 * static_cast<double>(cycles) / timer_tracker_frequency();
  }
};


/*
  A class for counting certain actions (in all queries), and optionally
  collecting the timings (in ANALYZE queries).
*/

class Time_and_counter_tracker: public Exec_time_tracker
{
public: 
  const bool timed;
  
  Time_and_counter_tracker(bool timed_arg) : timed(timed_arg)
  {}
   
  /* Loops are counted in both ANALYZE and regular queries, as this is cheap */
  void incr_loops() { count++; }
  
  /*
    Unlike Exec_time_tracker::stop_tracking, we don't increase loops.
  */
  void stop_tracking(THD *thd)
  {
    cycles_stop_tracking(thd);
  }
};

#define ANALYZE_START_TRACKING(thd, tracker) \
  { \
    (tracker)->incr_loops(); \
    if (unlikely((tracker)->timed)) \
    { (tracker)->start_tracking(thd); } \
  }

#define ANALYZE_STOP_TRACKING(thd, tracker) \
  if (unlikely((tracker)->timed)) \
  { (tracker)->stop_tracking(thd); }


/*
  Just a counter to increment one value. Wrapped in a class to be uniform
  with other counters used by ANALYZE.
*/

class Counter_tracker
{
public:
  Counter_tracker() : r_scans(0) {}
  ha_rows r_scans;

  inline void on_scan_init() { r_scans++; }

  bool has_scans() const { return (r_scans != 0); }
  ha_rows get_loops() const { return r_scans; }
};


/*
  A class for collecting read statistics.
  
  The idea is that we run several scans. Each scans gets rows, and then filters
  some of them out.  We count scans, rows, and rows left after filtering.

  (note: at the moment, the class is not actually tied to a physical table. 
   It can be used to track reading from files, buffers, etc).
*/

class Table_access_tracker
{
public:
  Table_access_tracker() : r_scans(0), r_rows(0), r_rows_after_where(0)
  {}

  ha_rows r_scans; /* how many scans were ran on this join_tab */
  ha_rows r_rows; /* How many rows we've got after that */
  ha_rows r_rows_after_where; /* Rows after applying attached part of WHERE */

  double get_avg_rows() const
  {
    return r_scans
      ? static_cast<double>(r_rows) / static_cast<double>(r_scans)
      : 0;
  }

  double get_filtered_after_where() const
  {
    return r_rows > 0
      ? static_cast<double>(r_rows_after_where) /
        static_cast<double>(r_rows)
      : 1.0;
  }

  inline void on_scan_init() { r_scans++; }
  inline void on_record_read() { r_rows++; }
  inline void on_record_after_where() { r_rows_after_where++; }

  bool has_scans() const { return (r_scans != 0); }
  ha_rows get_loops() const { return r_scans; }
};


class Json_writer;

/*
  This stores the data about how filesort executed.

  A few things from here (e.g. r_used_pq, r_limit) belong to the query plan,
  however, these parameters are calculated right during the execution so we 
  can't easily put them into the query plan.

  The class is designed to handle multiple invocations of filesort().
*/

class Filesort_tracker : public Sql_alloc
{
public:
  Filesort_tracker(bool do_timing) :
    time_tracker(do_timing), r_limit(0), r_used_pq(0),
    r_examined_rows(0), r_sorted_rows(0), r_output_rows(0),
    sort_passes(0),
    sort_buffer_size(0),
    r_using_addons(false),
    r_packed_addon_fields(false),
    r_sort_keys_packed(false)
  {}
  
  /* Functions that filesort uses to report various things about its execution */

  inline void report_use(THD *thd, ha_rows r_limit_arg)
  {
    if (!time_tracker.get_loops())
      r_limit= r_limit_arg;
    else
      r_limit= (r_limit != r_limit_arg)? 0: r_limit_arg;

    ANALYZE_START_TRACKING(thd, &time_tracker);
  }
  inline void incr_pq_used() { r_used_pq++; }

  inline void report_row_numbers(ha_rows examined_rows, 
                                 ha_rows sorted_rows,
                                 ha_rows returned_rows) 
  { 
    r_examined_rows += examined_rows;
    r_sorted_rows   += sorted_rows;
    r_output_rows   += returned_rows;
  }

  inline void report_merge_passes_at_start(ulong passes)
  {
    sort_passes -= passes;
  }
  inline void report_merge_passes_at_end(THD *thd, ulong passes)
  {
    ANALYZE_STOP_TRACKING(thd, &time_tracker);
    sort_passes += passes;
  }

  inline void report_sort_buffer_size(size_t bufsize)
  {
    if (sort_buffer_size)
      sort_buffer_size= ulonglong(-1); // multiple buffers of different sizes
    else
      sort_buffer_size= bufsize;
  }

  inline void report_addon_fields_format(bool addons_packed)
  {
    r_using_addons= true;
    r_packed_addon_fields= addons_packed;
  }
  inline void report_sort_keys_format(bool sort_keys_packed)
  {
    r_sort_keys_packed= sort_keys_packed;
  }

  void get_data_format(String *str);

  /* Functions to get the statistics */
  void print_json_members(Json_writer *writer);

  ulonglong get_r_loops() const { return time_tracker.get_loops(); }
  double get_avg_examined_rows() const
  {
    return static_cast<double>(r_examined_rows) /
      static_cast<double>(get_r_loops());
  }
  double get_avg_returned_rows() const
  {
    return static_cast<double>(r_output_rows) /
      static_cast<double>(get_r_loops());
  }
  double get_r_filtered() const
  {
    return r_examined_rows > 0
      ? static_cast<double>(r_sorted_rows) /
        static_cast<double>(r_examined_rows)
      : 1.0;
  }
private:
  Time_and_counter_tracker time_tracker;

  //ulonglong r_loops; /* How many times filesort was invoked */
  /*
    LIMIT is typically a constant. There is never "LIMIT 0".
      HA_POS_ERROR means we never had a limit
      0            means different values of LIMIT were used in 
                   different filesort invocations
      other value  means the same LIMIT value was used every time.
  */
  ulonglong r_limit;
  ulonglong r_used_pq; /* How many times PQ was used */

  /* How many rows were examined (before checking the select->cond) */
  ulonglong r_examined_rows;
  
  /* 
    How many rows were put into sorting (this is examined_rows minus rows that
    didn't pass the WHERE condition)
  */
  ulonglong r_sorted_rows;

  /*
    How many rows were returned. This is equal to r_sorted_rows, unless there
    was a LIMIT N clause in which case filesort would not have returned more
    than N rows.
  */
  ulonglong r_output_rows;

  /* How many sorts in total (divide by r_count to get the average) */
  ulonglong sort_passes;
  
  /* 
    0              - means not used (or not known 
    (ulonglong)-1  - multiple
    other          - value
  */
  ulonglong sort_buffer_size;
  bool r_using_addons;
  bool r_packed_addon_fields;
  bool r_sort_keys_packed;
};


/**
  A class to collect data about how rowid filter is executed.

  It stores information about how rowid filter container is filled,
  containers size and observed selectivity.

  The observed selectivity is calculated in this way.
  Some elements elem_set are checked if they belong to container.
  Observed selectivity is calculated as the count of elem_set
  elements that belong to container devided by all elem_set elements.
*/

class Rowid_filter_tracker : public Sql_alloc
{
private:
  /* A member to track the time to fill the rowid filter */
  Time_and_counter_tracker time_tracker;

  /* Size of the rowid filter container buffer */
  size_t container_buff_size;

  /* Count of elements that were used to fill the rowid filter container */
  uint container_elements;

  /* Elements counts used for observed selectivity calculation */
  uint n_checks;
  uint n_positive_checks;
public:
  Rowid_filter_tracker(bool do_timing) :
    time_tracker(do_timing), container_buff_size(0),
    container_elements(0), n_checks(0), n_positive_checks(0)
  {}

  inline void start_tracking(THD *thd)
  {
    ANALYZE_START_TRACKING(thd, &time_tracker);
  }

  inline void stop_tracking(THD *thd)
  {
    ANALYZE_STOP_TRACKING(thd, &time_tracker);
  }

  /* Save container buffer size in bytes */
  inline void report_container_buff_size(uint elem_size)
  {
   container_buff_size= container_elements * elem_size / 8;
  }

  Time_and_counter_tracker *get_time_tracker()
  {
    return &time_tracker;
  }

  double get_time_fill_container_ms() const
  {
    return time_tracker.get_time_ms();
  }

  void increment_checked_elements_count(bool was_checked)
  {
    n_checks++;
    if (was_checked)
     n_positive_checks++;
  }

  inline void increment_container_elements_count() { container_elements++; }

  uint get_container_elements() const { return container_elements; }

  uint get_container_lookups() { return n_checks; }

  double get_r_selectivity_pct() const
  {
    return n_checks ? static_cast<double>(n_positive_checks) /
                      static_cast<double>(n_checks) : 0;
  }

  size_t get_container_buff_size() const { return container_buff_size; }
};
server/private/sql_expression_cache.h000064400000010407150400264020014071 0ustar00/*
   Copyright (c) 2010, 2011, Monty Program Ab

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef SQL_EXPRESSION_CACHE_INCLUDED
#define SQL_EXPRESSION_CACHE_INCLUDED

#include "sql_select.h"


/**
  Interface for expression cache

  @note
  Parameters of an expression cache interface are set on the creation of the
  cache. They are passed when a cache object of the implementation class is
  constructed. That's why they are not visible in this interface.
*/

extern ulong subquery_cache_miss, subquery_cache_hit;

class Expression_cache :public Sql_alloc
{
public:
  enum result {ERROR, HIT, MISS};

  Expression_cache()= default;
  virtual ~Expression_cache() = default;
  /**
    Shall check the presence of expression value in the cache for a given
    set of values of the expression parameters.  Return the result of the
    expression if it's found in the cache.
  */
  virtual result check_value(Item **value)= 0;
  /**
    Shall put the value of an expression for given set of its parameters
    into the expression cache
  */
  virtual my_bool put_value(Item *value)= 0;

  /**
    Print cache parameters
  */
  virtual void print(String *str, enum_query_type query_type)= 0;

  /**
    Is this cache initialized
  */
  virtual bool is_inited()= 0;
  /**
    Initialize this cache
  */
  virtual void init()= 0;

  /**
    Save this object's statistics into Expression_cache_tracker object
  */
  virtual void update_tracker()= 0;
};

struct st_table_ref;
struct st_join_table;
class Item_field;


class Expression_cache_tracker :public Sql_alloc
{
public:
  enum expr_cache_state {UNINITED, STOPPED, OK};
  Expression_cache_tracker(Expression_cache *c) :
    cache(c), hit(0), miss(0), state(UNINITED)
  {}

private:
  // This can be NULL if the cache is already deleted
  Expression_cache *cache;

public:
  ulong hit, miss;
  enum expr_cache_state state;

  static const char* state_str[3];
  void set(ulong h, ulong m, enum expr_cache_state s)
  {hit= h; miss= m; state= s;}

  void detach_from_cache() { cache= NULL; }
  void fetch_current_stats()
  {
    if (cache)
      cache->update_tracker();
  }
};


/**
  Implementation of expression cache over a temporary table
*/

class Expression_cache_tmptable :public Expression_cache
{
public:
  Expression_cache_tmptable(THD *thd, List<Item> &dependants, Item *value);
  virtual ~Expression_cache_tmptable();
  result check_value(Item **value) override;
  my_bool put_value(Item *value) override;

  void print(String *str, enum_query_type query_type) override;
  bool is_inited() override { return inited; };
  void init() override;

  void set_tracker(Expression_cache_tracker *st)
  {
    tracker= st;
    update_tracker();
  }
  void update_tracker() override
  {
    if (tracker)
    {
      tracker->set(hit, miss, (inited ? (cache_table ?
                                         Expression_cache_tracker::OK :
                                         Expression_cache_tracker::STOPPED) :
                               Expression_cache_tracker::UNINITED));
    }
  }

private:
  void disable_cache();

  /* tmp table parameters */
  TMP_TABLE_PARAM cache_table_param;
  /* temporary table to store this cache */
  TABLE *cache_table;
  /* Thread handle for the temporary table */
  THD *table_thd;
  /* EXPALIN/ANALYZE statistics */
  Expression_cache_tracker *tracker;
  /* TABLE_REF for index lookup */
  struct st_table_ref ref;
  /* Cached result */
  Item_field *cached_result;
  /* List of parameter items */
  List<Item> &items;
  /* Value Item example */
  Item *val;
  /* hit/miss counters */
  ulong hit, miss;
  /* Set on if the object has been successfully initialized with init() */
  bool inited;
};

#endif /* SQL_EXPRESSION_CACHE_INCLUDED */
server/private/my_nosys.h000064400000002636150400264020011555 0ustar00/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

   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 */

/*
  Header to remove use of my_functions in functions where we need speed and
  where calls to posix functions should work
*/
#ifndef _my_nosys_h
#define _my_nosys_h
#ifdef	__cplusplus
extern "C" {
#endif

#ifndef __MY_NOSYS__
#define __MY_NOSYS__

#ifndef HAVE_STDLIB_H
#include <malloc.h>
#endif

#undef my_read
#undef my_write
#undef my_seek
#define my_read(a,b,c,d) my_quick_read(a,b,c,d)
#define my_write(a,b,c,d) my_quick_write(a,b,c)
extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,
                            myf myFlags);
extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count);

#endif /* __MY_NOSYS__ */

#ifdef	__cplusplus
}
#endif
#endif
server/private/group_by_handler.h000064400000006716150400264030013224 0ustar00/*
   Copyright (c) 2014, 2015 SkySQL Ab & MariaDB Foundation

   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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef GROUP_BY_HANDLER_INCLUDED
#define GROUP_BY_HANDLER_INCLUDED

class Select_limit_counters;
/*
  This file implements the group_by_handler interface. This interface
  can be used by storage handlers that can intercept summary or GROUP
  BY queries from MariaDB and itself return the result to the user or
  upper level. It is part of the Storage Engine API

  Both main and sub queries are supported. Here are some examples of what the
  storage engine could intersept:

  SELECT count(*) FROM t1;
  SELECT a,count(*) FROM t1 group by a;
  SELECT a,count(*) as sum FROM t1 where b > 10 group by a, order by sum;
  SELECT a,count(*) FROM t1,t2;
  SELECT a, (select sum(*) from t2 where t1.a=t2.a) from t2;
*/

/**
  The structure describing various parts of the query

  The engine is supposed to take out parts that it can do internally.
  For example, if the engine can return results sorted according to
  the specified order_by clause, it sets Query::order_by=NULL before
  returning.

  At the moment the engine must take group_by (or return an error), and
  optionally can take distinct, where, order_by, and having.

  The engine should not modify the select list. It is the extended SELECT
  clause (extended, because it has more items than the original
  user-specified SELECT clause) and it contains all aggregate functions,
  used in the query.
*/
struct Query
{
  List<Item> *select;
  /* Number of auxiliary fields. */
  int        n_aux;
  bool        distinct;
  TABLE_LIST *from;
  Item       *where;
  ORDER      *group_by;
  ORDER      *order_by;
  Item       *having;
  // LIMIT
  Select_limit_counters *limit;
};

class group_by_handler
{
public:
  THD *thd;
  handlerton *ht;

  /*
    Temporary table where all results should be stored in record[0]
    The table has a field for every item from the Query::select list,
    except for const items and some other exceptions, see
    Create_tmp_table::add_fields() for which items are included and
    which are skipped.
  */
  TABLE *table;

  group_by_handler(THD *thd_arg, handlerton *ht_arg)
    : thd(thd_arg), ht(ht_arg), table(0) {}
  virtual ~group_by_handler() = default;

  /*
    Functions to scan data. All these returns 0 if ok, error code in case
    of error
  */

  /*
    Initialize group_by scan, prepare for next_row().
    If this is a sub query with group by, this can be called many times for
    a query.
  */
  virtual int init_scan()= 0;

  /*
    Return next group by result in table->record[0].
    Return 0 if row found, HA_ERR_END_OF_FILE if last row and other error
    number in case of fatal error.
   */
  virtual int next_row()= 0;

  /* End scanning */
  virtual int end_scan()=0;

  /* Report errors */
  virtual void print_error(int error, myf errflag);
};

#endif //GROUP_BY_HANDLER_INCLUDED
server/private/log_slow.h000064400000004612150400264030011517 0ustar00/* Copyright (C) 2009, 2017, 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 or later 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 Street, Fifth Floor, Boston, MA 02110-1335 USA */

/* Defining what to log to slow log */

#ifndef LOG_SLOW_INCLUDED
#define LOG_SLOW_INCLUDED

#define LOG_SLOW_VERBOSITY_INIT           0
#define LOG_SLOW_VERBOSITY_INNODB         (1U << 0) /* Old option */
#define LOG_SLOW_VERBOSITY_QUERY_PLAN     (1U << 1)
#define LOG_SLOW_VERBOSITY_EXPLAIN        (1U << 2)
#define LOG_SLOW_VERBOSITY_STORAGE_ENGINE (1U << 3) /* Replaces InnoDB */
#define LOG_SLOW_VERBOSITY_WARNINGS       (1U << 4)
#define LOG_SLOW_VERBOSITY_FULL           (1U << 5)

#define LOG_SLOW_VERBOSITY_ENGINE         (LOG_SLOW_VERBOSITY_FULL | \
                                           LOG_SLOW_VERBOSITY_INNODB | \
                                           LOG_SLOW_VERBOSITY_STORAGE_ENGINE)

#define QPLAN_INIT            QPLAN_QC_NO

#define QPLAN_ADMIN           (1U << 0)
#define QPLAN_FILESORT        (1U << 1)
#define QPLAN_FILESORT_DISK   (1U << 2)
#define QPLAN_FILESORT_PRIORITY_QUEUE       (1U << 3)
#define QPLAN_FULL_JOIN       (1U << 4)
#define QPLAN_FULL_SCAN       (1U << 5)
#define QPLAN_NOT_USING_INDEX (1U << 6)
#define QPLAN_QC              (1U << 7)
#define QPLAN_QC_NO           (1U << 8)
#define QPLAN_TMP_TABLE       (1U << 9)
#define QPLAN_TMP_DISK        (1U << 10)

/* ... */
#define QPLAN_STATUS          (1UL << 31) /* not in the slow_log_filter */
#define QPLAN_MAX             (1UL << 31) /* reserved as placeholder */

/* Bits for log_slow_disabled_statements */
#define LOG_SLOW_DISABLE_ADMIN (1 << 0)
#define LOG_SLOW_DISABLE_CALL  (1 << 1)
#define LOG_SLOW_DISABLE_SLAVE (1 << 2)
#define LOG_SLOW_DISABLE_SP    (1 << 3)

/* Bits for log_disabled_statements */
#define LOG_DISABLE_SLAVE (1 << 0)
#define LOG_DISABLE_SP    (1 << 1)

#endif /* LOG_SLOW_INCLUDED */
server/private/myisam.h000064400000042142150400264030011171 0ustar00/*
   Copyright (c) 2000, 2013, Oracle and/or its affiliates.
   Copyright (c) 2009, 2013, Monty Program Ab.

   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 */

/* This file should be included when using myisam_functions */

#ifndef _myisam_h
#define _myisam_h
#ifdef	__cplusplus
extern "C" {
#endif

#include <my_base.h>
#include <m_ctype.h>
#include "keycache.h"
#include "my_compare.h"
#include <myisamchk.h>
#include <mysql/plugin.h>
#include <my_check_opt.h>
/*
  Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details
*/

#if MAX_INDEXES > HA_MAX_POSSIBLE_KEY
#define MI_MAX_KEY                  HA_MAX_POSSIBLE_KEY /* Max allowed keys */
#else
#define MI_MAX_KEY                  MAX_INDEXES         /* Max allowed keys */
#endif

#define MI_MAX_POSSIBLE_KEY_BUFF    HA_MAX_POSSIBLE_KEY_BUFF
/*
  The following defines can be increased if necessary.
  But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
*/
#define MI_MAX_KEY_LENGTH           1000            /* Max length in bytes */
#define MI_MAX_KEY_SEG              16              /* Max segments for key */

#define MI_NAME_IEXT	".MYI"
#define MI_NAME_DEXT	".MYD"

/* Possible values for myisam_block_size (must be power of 2) */
#define MI_KEY_BLOCK_LENGTH	1024	/* default key block length */
#define MI_MIN_KEY_BLOCK_LENGTH	1024	/* Min key block length */
#define MI_MAX_KEY_BLOCK_LENGTH	16384

/*
  In the following macros '_keyno_' is 0 .. keys-1.
  If there can be more keys than bits in the key_map, the highest bit
  is for all upper keys. They cannot be switched individually.
  This means that clearing of high keys is ignored, setting one high key
  sets all high keys.
*/
#define MI_KEYMAP_BITS      (8 * SIZEOF_LONG_LONG)
#define MI_KEYMAP_HIGH_MASK (1ULL << (MI_KEYMAP_BITS - 1))
#define mi_get_mask_all_keys_active(_keys_) \
                            (((_keys_) < MI_KEYMAP_BITS) ? \
                             ((1ULL << (_keys_)) - 1ULL) : \
                             (~ 0ULL))

#if MI_MAX_KEY > MI_KEYMAP_BITS

#define mi_is_key_active(_keymap_,_keyno_) \
                            (((_keyno_) < MI_KEYMAP_BITS) ? \
                             MY_TEST((_keymap_) & (1ULL << (_keyno_))) : \
                             MY_TEST((_keymap_) & MI_KEYMAP_HIGH_MASK))
#define mi_set_key_active(_keymap_,_keyno_) \
                            (_keymap_)|= (((_keyno_) < MI_KEYMAP_BITS) ? \
                                          (1ULL << (_keyno_)) : \
                                          MI_KEYMAP_HIGH_MASK)
#define mi_clear_key_active(_keymap_,_keyno_) \
                            (_keymap_)&= (((_keyno_) < MI_KEYMAP_BITS) ? \
                                          (~ (1ULL << (_keyno_))) : \
                                          (~ (0ULL)) /*ignore*/ )

#else

#define mi_is_key_active(_keymap_,_keyno_) \
                            MY_TEST((_keymap_) & (1ULL << (_keyno_)))
#define mi_set_key_active(_keymap_,_keyno_) \
                            (_keymap_)|= (1ULL << (_keyno_))
#define mi_clear_key_active(_keymap_,_keyno_) \
                            (_keymap_)&= (~ (1ULL << (_keyno_)))

#endif

#define mi_is_any_key_active(_keymap_) \
                            MY_TEST((_keymap_))
#define mi_is_all_keys_active(_keymap_,_keys_) \
                            ((_keymap_) == mi_get_mask_all_keys_active(_keys_))
#define mi_set_all_keys_active(_keymap_,_keys_) \
                            (_keymap_)= mi_get_mask_all_keys_active(_keys_)
#define mi_clear_all_keys_active(_keymap_) \
                            (_keymap_)= 0
#define mi_intersect_keys_active(_to_,_from_) \
                            (_to_)&= (_from_)
#define mi_is_any_intersect_keys_active(_keymap1_,_keys_,_keymap2_) \
                            ((_keymap1_) & (_keymap2_) & \
                             mi_get_mask_all_keys_active(_keys_))
#define mi_copy_keys_active(_to_,_maxkeys_,_from_) \
                            (_to_)= (mi_get_mask_all_keys_active(_maxkeys_) & \
                                     (_from_))

	/* Param to/from mi_info */

typedef struct st_mi_isaminfo		/* Struct from h_info */
{
  ha_rows records;			/* Records in database */
  ha_rows deleted;			/* Deleted records in database */
  my_off_t recpos;			/* Pos for last used record */
  my_off_t newrecpos;			/* Pos if we write new record */
  my_off_t dupp_key_pos;		/* Position to record with dupp key */
  my_off_t data_file_length,		/* Length of data file */
           max_data_file_length,
           index_file_length,
           max_index_file_length,
           delete_length;
  ulong reclength;			/* Recordlength */
  ulong mean_reclength;			/* Mean recordlength (if packed) */
  ulonglong auto_increment;
  ulonglong key_map;			/* Which keys are used */
  char  *data_file_name, *index_file_name;
  uint  keys;				/* Number of keys in use */
  uint	options;			/* HA_OPTION_... used */
  int	errkey,				/* With key was dupplicated on err */
	sortkey;			/* clustered by this key */
  File	filenr;				/* (uniq) filenr for datafile */
  time_t create_time;			/* When table was created */
  time_t check_time;
  time_t update_time;
  uint  reflength;
  ulong record_offset;
  ulong *rec_per_key;			/* for sql optimizing */
} MI_ISAMINFO;


typedef struct st_mi_create_info
{
  const char *index_file_name, *data_file_name;	/* If using symlinks */
  ha_rows max_rows;
  ha_rows reloc_rows;
  ulonglong auto_increment;
  ulonglong data_file_length;
  ulonglong key_file_length;
  uint old_options;
  uint16 language;
  my_bool with_auto_increment;
} MI_CREATE_INFO;

struct st_myisam_info;			/* For reference */
struct st_mi_isam_share;
typedef struct st_myisam_info MI_INFO;
struct st_mi_s_param;

typedef struct st_mi_keydef		/* Key definition with open & info */
{
  struct st_mi_isam_share *share;       /* Pointer to base (set in mi_open) */
  uint16 keysegs;			/* Number of key-segment */
  uint16 flag;				/* NOSAME, PACK_USED */

  uint8  key_alg;			/* BTREE, RTREE */
  uint16 block_length;			/* Length of keyblock (auto) */
  uint16 underflow_block_length;	/* When to execute underflow */
  uint16 keylength;			/* Tot length of keyparts (auto) */
  uint16 minlength;			/* min length of (packed) key (auto) */
  uint16 maxlength;			/* max length of (packed) key (auto) */
  uint16 block_size_index;		/* block_size (auto) */
  uint32 version;			/* For concurrent read/write */
  uint32 ftkey_nr;                      /* full-text index number */

  HA_KEYSEG *seg,*end;
  struct st_mysql_ftparser *parser;     /* Fulltext [pre]parser */
  int (*bin_search)(struct st_myisam_info *info,struct st_mi_keydef *keyinfo,
		    uchar *page,uchar *key,
		    uint key_len,uint comp_flag,uchar * *ret_pos,
		    uchar *buff, my_bool *was_last_key);
  uint (*get_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar * *page,
		  uchar *key);
  int (*pack_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar *next_key,
		  uchar *org_key, uchar *prev_key, uchar *key,
		  struct st_mi_s_param *s_temp);
  void (*store_key)(struct st_mi_keydef *keyinfo, uchar *key_pos,
		    struct st_mi_s_param *s_temp);
  int (*ck_insert)(struct st_myisam_info *inf, uint k_nr, uchar *k, uint klen);
  int (*ck_delete)(struct st_myisam_info *inf, uint k_nr, uchar *k, uint klen);
} MI_KEYDEF;


#define MI_UNIQUE_HASH_LENGTH	4

typedef struct st_unique_def		/* Segment definition of unique */
{
  uint16 keysegs;			/* Number of key-segment */
  uchar key;				/* Mapped to which key */
  uint8 null_are_equal;
  HA_KEYSEG *seg,*end;
} MI_UNIQUEDEF;

typedef struct st_mi_decode_tree	/* Decode huff-table */
{
  uint16 *table;
  uint	 quick_table_bits;
  uchar	 *intervalls;
} MI_DECODE_TREE;


struct st_mi_bit_buff;

/*
  Note that null markers should always be first in a row !
  When creating a column, one should only specify:
  type, length, null_bit and null_pos
*/

typedef struct st_columndef		/* column information */
{
  enum en_fieldtype type;
  uint16 length;			/* length of field */
  uint32 offset;			/* Offset to position in row */
  uint8  null_bit;			/* If column may be 0 */
  uint16 null_pos;			/* position for null marker */

#ifndef NOT_PACKED_DATABASES
  void (*unpack)(struct st_columndef *rec,struct st_mi_bit_buff *buff,
		 uchar *start,uchar *end);
  enum en_fieldtype base_type;
  uint space_length_bits,pack_type;
  MI_DECODE_TREE *huff_tree;
#endif
} MI_COLUMNDEF;

extern char * myisam_log_filename;		/* Name of logfile */
extern ulong myisam_block_size;
extern ulong myisam_concurrent_insert;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_off_t myisam_max_temp_length;
extern ulong myisam_data_pointer_size;

/* usually used to check if a symlink points into the mysql data home */
/* which is normally forbidden                                        */
extern int (*myisam_test_invalid_symlink)(const char *filename);
extern ulonglong myisam_mmap_size, myisam_mmap_used;
extern mysql_mutex_t THR_LOCK_myisam_mmap;

	/* Prototypes for myisam-functions */

extern int mi_close(struct st_myisam_info *file);
extern int mi_delete(struct st_myisam_info *file,const uchar *buff);
extern struct st_myisam_info *mi_open(const char *name,int mode,
				      uint wait_if_locked);
extern int mi_panic(enum ha_panic_function function);
extern int mi_rfirst(struct st_myisam_info *file,uchar *buf,int inx);
extern int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
                   key_part_map keypart_map, enum ha_rkey_function search_flag);
extern int mi_rlast(struct st_myisam_info *file,uchar *buf,int inx);
extern int mi_rnext(struct st_myisam_info *file,uchar *buf,int inx);
extern int mi_rnext_same(struct st_myisam_info *info, uchar *buf);
extern int mi_rprev(struct st_myisam_info *file,uchar *buf,int inx);
extern int mi_rrnd(struct st_myisam_info *file,uchar *buf, my_off_t pos);
extern int mi_scan_init(struct st_myisam_info *file);
extern int mi_scan(struct st_myisam_info *file,uchar *buf);
extern int mi_rsame(struct st_myisam_info *file,uchar *record,int inx);
extern int mi_rsame_with_pos(struct st_myisam_info *file,uchar *record,
			     int inx, my_off_t pos);
extern int mi_update(struct st_myisam_info *file,const uchar *old,
		     const uchar *new_record);
extern int mi_write(struct st_myisam_info *file,const uchar *buff);
extern my_off_t mi_position(struct st_myisam_info *file);
extern int mi_status(struct st_myisam_info *info, MI_ISAMINFO *x, uint flag);
extern int mi_lock_database(struct st_myisam_info *file,int lock_type);
extern int mi_create(const char *name,uint keys,MI_KEYDEF *keydef,
		     uint columns, MI_COLUMNDEF *columndef,
		     uint uniques, MI_UNIQUEDEF *uniquedef,
		     MI_CREATE_INFO *create_info, uint flags);
extern int mi_delete_table(const char *name);
extern int mi_rename(const char *from, const char *to);
extern int mi_extra(struct st_myisam_info *file,
		    enum ha_extra_function function,
		    void *extra_arg);
extern int mi_reset(struct st_myisam_info *file);
extern ha_rows mi_records_in_range(MI_INFO *info,int inx,
                                   const key_range *min_key,
                                   const key_range *max_key,
                                   page_range *pages);
extern int mi_log(int activate_log);
extern int mi_is_changed(struct st_myisam_info *info);
extern int mi_delete_all_rows(struct st_myisam_info *info);
extern ulong _mi_calc_blob_length(uint length , const uchar *pos);
extern uint mi_get_pointer_length(ulonglong file_length, uint def);
extern int mi_make_backup_of_index(struct st_myisam_info *info,
                                   time_t backup_time, myf flags);
#define myisam_max_key_length() HA_MAX_KEY_LENGTH
#define myisam_max_key_segments() HA_MAX_KEY_SEG

#define MEMMAP_EXTRA_MARGIN     7       /* Write this as a suffix for mmap file */
/* this is used to pass to mysql_myisamchk_table */

#define   MYISAMCHK_REPAIR 1  /* equivalent to myisamchk -r */
#define   MYISAMCHK_VERIFY 2  /* Verify, run repair if failure */

typedef uint mi_bit_type;
typedef struct st_sort_key_blocks SORT_KEY_BLOCKS;
typedef struct st_sort_ftbuf SORT_FT_BUF;

typedef struct st_mi_bit_buff
{                                       /* Used for packing of record */
  mi_bit_type current_byte;
  uint bits;
  uchar *pos, *end, *blob_pos, *blob_end;
  uint error;
} MI_BIT_BUFF;

typedef struct st_sort_info
{
  /* sync things */
  mysql_mutex_t mutex;
  mysql_cond_t  cond;
  MI_INFO *info;
  HA_CHECK *param;
  uchar *buff;
  SORT_KEY_BLOCKS *key_block, *key_block_end;
  SORT_FT_BUF *ft_buf;
  my_off_t filelength, dupp, buff_length;
  ha_rows max_records;
  uint current_key, total_keys;
  volatile uint got_error;
  uint threads_running;
  myf myf_rw;
  enum data_file_type new_data_file_type;
} MI_SORT_INFO;

typedef struct st_mi_sort_param
{
  pthread_t thr;
  IO_CACHE read_cache, tempfile, tempfile_for_exceptions;
  DYNAMIC_ARRAY buffpek;
  MI_BIT_BUFF   bit_buff;               /* For parallel repair of packrec. */

  MI_KEYDEF *keyinfo;
  MI_SORT_INFO *sort_info;
  HA_KEYSEG *seg;
  uchar **sort_keys;
  uchar *rec_buff;
  void *wordlist, *wordptr;
  MEM_ROOT wordroot;
  uchar *record;
  MY_TMPDIR *tmpdir;

  /*
    The next two are used to collect statistics, see update_key_parts for
    description.
  */
  ulonglong unique[HA_MAX_KEY_SEG+1];
  ulonglong notnull[HA_MAX_KEY_SEG+1];

  my_off_t pos,max_pos,filepos,start_recpos;
  uint key, key_length,real_key_length;
  uint maxbuffers, find_length;
  ulonglong sortbuff_size;
  ha_rows keys;
  my_bool fix_datafile, master;
  my_bool calc_checksum;                /* calculate table checksum */

  int (*key_cmp)(void *, const void *, const void *);
  int (*key_read)(struct st_mi_sort_param *,void *);
  int (*key_write)(struct st_mi_sort_param *, const void *);
  void (*lock_in_memory)(HA_CHECK *);
  int (*write_keys)(struct st_mi_sort_param *, uchar **,
                    ulonglong , struct st_buffpek *, IO_CACHE *);
  my_off_t (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
  int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *,
                   uint, ulonglong);
} MI_SORT_PARAM;

/* functions in mi_check */
void myisamchk_init(HA_CHECK *param);
int chk_status(HA_CHECK *param, MI_INFO *info);
int chk_del(HA_CHECK *param, MI_INFO *info, ulonglong test_flag);
int chk_size(HA_CHECK *param, MI_INFO *info);
int chk_key(HA_CHECK *param, MI_INFO *info);
int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend);
int mi_repair(HA_CHECK *param, MI_INFO *info, char * name, int rep_quick);
int mi_sort_index(HA_CHECK *param, MI_INFO *info, char * name);
int mi_repair_by_sort(HA_CHECK *param, MI_INFO *info,
		      const char * name, int rep_quick);
int mi_repair_parallel(HA_CHECK *param, MI_INFO *info,
		      const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext,
                      const char * new_ext, time_t backup_time, myf myflags);
int lock_file(HA_CHECK *param, File file, my_off_t start, int lock_type,
	      const char *filetype, const char *filename);
void lock_memory(HA_CHECK *param);
void update_auto_increment_key(HA_CHECK *param, MI_INFO *info,
			       my_bool repair);
int update_state_info(HA_CHECK *param, MI_INFO *info,uint update);
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
                      ulonglong *unique, ulonglong *notnull,
                      ulonglong records);
int filecopy(HA_CHECK *param, File to,File from,my_off_t start,
	     my_off_t length, const char *type);
int movepoint(MI_INFO *info,uchar *record,my_off_t oldpos,
	      my_off_t newpos, uint prot_key);
int write_data_suffix(MI_SORT_INFO *sort_info, my_bool fix_datafile);
int test_if_almost_full(MI_INFO *info);
int recreate_table(HA_CHECK *param, MI_INFO **org_info, char *filename);
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map,
			    my_bool force);

int mi_init_bulk_insert(MI_INFO *info, size_t cache_size, ha_rows rows);
void mi_flush_bulk_insert(MI_INFO *info, uint inx);
int mi_end_bulk_insert(MI_INFO *info, my_bool abort);
int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map,
			   KEY_CACHE *key_cache);
void mi_change_key_cache(KEY_CACHE *old_key_cache,
			 KEY_CACHE *new_key_cache);
int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves);

int write_data_suffix(MI_SORT_INFO *sort_info, my_bool fix_datafile);
int flush_pending_blocks(MI_SORT_PARAM *param);
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param);
int sort_write_record(MI_SORT_PARAM *sort_param);
int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulonglong);
my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows);

#ifdef	__cplusplus
}
#endif
#endif
server/private/config.h000064400000034356150400264030011147 0ustar00/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
 
 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 */

#ifndef MY_CONFIG_H
#define MY_CONFIG_H
#define DOT_FRM_VERSION 6
/* Headers we may want to use. */
#define STDC_HEADERS 1
#define _GNU_SOURCE 1
#define HAVE_ALLOCA_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_ASM_TERMBITS_H 1
#define HAVE_CRYPT_H 1
#define HAVE_CURSES_H 1
/* #undef HAVE_BFD_H */
/* #undef HAVE_NDIR_H */
#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_EXECINFO_H 1
#define HAVE_FCNTL_H 1
#define HAVE_FCNTL_DIRECT 1
#define HAVE_FENV_H 1
#define HAVE_FLOAT_H 1
#define HAVE_FNMATCH_H 1
#define HAVE_FPU_CONTROL_H 1
#define HAVE_GETMNTENT 1
/* #undef HAVE_GETMNTENT_IN_SYS_MNTAB */
/* #undef HAVE_GETMNTINFO */
/* #undef HAVE_GETMNTINFO64 */
/* #undef HAVE_GETMNTINFO_TAKES_statvfs */
#define HAVE_GRP_H 1
/* #undef HAVE_IA64INTRIN_H */
/* #undef HAVE_IEEEFP_H */
#define HAVE_INTTYPES_H 1
/* #undef HAVE_KQUEUE */
#define HAVE_LIMITS_H 1
#define HAVE_LINK_H 1
#define HAVE_LINUX_UNISTD_H 1
#define HAVE_LINUX_MMAN_H 1
#define HAVE_LOCALE_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_PATHS_H 1
#define HAVE_POLL_H 1
#define HAVE_PWD_H 1
#define HAVE_SCHED_H 1
/* #undef HAVE_SELECT_H */
/* #undef HAVE_SOLARIS_LARGE_PAGES */
#define HAVE_STDDEF_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STDINT_H 1
/* #undef HAVE_SYNCH_H */
/* #undef HAVE_SYSENT_H */
#define HAVE_SYS_DIR_H 1
#define HAVE_SYS_FILE_H 1
/* #undef HAVE_SYS_FPU_H */
#define HAVE_SYS_IOCTL_H 1
/* #undef HAVE_SYS_MALLOC_H */
#define HAVE_SYS_MMAN_H 1
/* #undef HAVE_SYS_MNTENT_H */
/* #undef HAVE_SYS_NDIR_H */
/* #undef HAVE_SYS_PTE_H */
/* #undef HAVE_SYS_PTEM_H */
#define HAVE_SYS_PRCTL_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
/* #undef HAVE_SYS_SOCKIO_H */
#define HAVE_SYS_UTSNAME_H 1
#define HAVE_SYS_STAT_H 1
/* #undef HAVE_SYS_STREAM_H */
#define HAVE_SYS_SYSCALL_H 1
#define HAVE_SYS_TIMEB_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_UN_H 1
/* #undef HAVE_SYS_VADVISE_H */
#define HAVE_SYS_STATVFS_H 1
#define HAVE_UCONTEXT_H 1
#define HAVE_TERM_H 1
/* #undef HAVE_TERMBITS_H */
#define HAVE_TERMIOS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_TERMCAP_H 1
#define HAVE_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
/* #undef HAVE_VARARGS_H */
/* #undef HAVE_SYS_UTIME_H */
#define HAVE_SYS_WAIT_H 1
#define HAVE_SYS_PARAM_H 1

/* Libraries */
/* #undef HAVE_LIBWRAP */
#define HAVE_SYSTEMD 1
#define HAVE_SYSTEMD_SD_LISTEN_FDS_WITH_NAMES 1

/* Does "struct timespec" have a "sec" and "nsec" field? */
/* #undef HAVE_TIMESPEC_TS_SEC */

/* Readline */
/* #undef HAVE_HIST_ENTRY */
/* #undef USE_LIBEDIT_INTERFACE */
#define USE_NEW_READLINE_INTERFACE 1

#define FIONREAD_IN_SYS_IOCTL 1
#define GWINSZ_IN_SYS_IOCTL 1
/* #undef TIOCSTAT_IN_SYS_IOCTL */
/* #undef FIONREAD_IN_SYS_FILIO */

/* Functions we may want to use. */
#define HAVE_ACCEPT4 1
#define HAVE_ACCESS 1
#define HAVE_ALARM 1
#define HAVE_ALLOCA 1
/* #undef HAVE_BFILL */
#define HAVE_INDEX 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CRYPT 1
#define HAVE_CUSERID 1
#define HAVE_DLADDR 1
#define HAVE_DLERROR 1
#define HAVE_DLOPEN 1
#define HAVE_FCHMOD 1
#define HAVE_FCNTL 1
#define HAVE_FDATASYNC 1
#define HAVE_DECL_FDATASYNC 1
#define HAVE_FEDISABLEEXCEPT 1
#define HAVE_FESETROUND 1
/* #undef HAVE_FP_EXCEPT */
#define HAVE_FSEEKO 1
#define HAVE_FSYNC 1
#define HAVE_FTIME 1
#define HAVE_GETIFADDRS 1
#define HAVE_GETCWD 1
#define HAVE_GETHOSTBYADDR_R 1
/* #undef HAVE_GETHRTIME */
#define HAVE_GETPAGESIZE 1
/* #undef HAVE_GETPAGESIZES */
#define HAVE_GETPASS 1
/* #undef HAVE_GETPASSPHRASE */
#define HAVE_GETPWNAM 1
#define HAVE_GETPWUID 1
#define HAVE_GETRLIMIT 1
#define HAVE_GETRUSAGE 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETWD 1
#define HAVE_GMTIME_R 1
/* #undef gmtime_r */
#define HAVE_IN_ADDR_T 1
#define HAVE_INITGROUPS 1
#define HAVE_LDIV 1
#define HAVE_LRAND48 1
#define HAVE_LOCALTIME_R 1
#define HAVE_LSTAT 1
/* #define HAVE_MLOCK 1 see Bug#54662 */
#define HAVE_NL_LANGINFO 1
#define HAVE_MADVISE 1
#define HAVE_DECL_MADVISE 1
/* #undef HAVE_DECL_MHA_MAPSIZE_VA */
#define HAVE_MALLINFO 1
/* #undef HAVE_MALLINFO2 */
/* #undef HAVE_MALLOC_ZONE */
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MKSTEMP 1
#define HAVE_MKOSTEMP 1
#define HAVE_MLOCKALL 1
#define HAVE_MMAP 1
#define HAVE_MMAP64 1
#define HAVE_PERROR 1
#define HAVE_POLL 1
#define HAVE_POSIX_FALLOCATE 1
#define HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE 1
#define HAVE_PREAD 1
/* #undef HAVE_READ_REAL_TIME */
/* #undef HAVE_PTHREAD_ATTR_CREATE */
#define HAVE_PTHREAD_ATTR_GETGUARDSIZE 1
#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
#define HAVE_PTHREAD_ATTR_SETSCOPE 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_GETATTR_NP 1
/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
#define HAVE_PTHREAD_GETAFFINITY_NP 1
#define HAVE_PTHREAD_KEY_DELETE 1
/* #undef HAVE_PTHREAD_KILL */
#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
#define HAVE_PTHREAD_SIGMASK 1
/* #undef HAVE_PTHREAD_YIELD_NP */
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define PTHREAD_ONCE_INITIALIZER PTHREAD_ONCE_INIT
#define HAVE_PUTENV 1
/* #undef HAVE_READDIR_R */
#define HAVE_READLINK 1
#define HAVE_REALPATH 1
#define HAVE_RENAME 1
/* #undef HAVE_RWLOCK_INIT */
#define HAVE_SCHED_YIELD 1
#define HAVE_SELECT 1
#define HAVE_SETENV 1
#define HAVE_SETLOCALE 1
#define HAVE_SETMNTENT 1
#define HAVE_SETUPTERM 1
#define HAVE_SIGSET 1
#define HAVE_SIGACTION 1
/* #undef HAVE_SIGTHREADMASK */
#define HAVE_SIGWAIT 1
#define HAVE_SIGWAITINFO 1
#define HAVE_SLEEP 1
#define HAVE_STPCPY 1
#define HAVE_STRERROR 1
#define HAVE_STRCOLL 1
#define HAVE_STRNLEN 1
#define HAVE_STRPBRK 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOULL 1
/* #undef HAVE_TELL */
/* #undef HAVE_THR_YIELD */
#define HAVE_TIME 1
#define HAVE_TIMES 1
#define HAVE_VIDATTR 1
#define HAVE_VIO_READ_BUFF 1
#define HAVE_VASPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_FTRUNCATE 1
#define HAVE_TZNAME 1
/* Symbols we may use */
/* #undef HAVE_SYS_ERRLIST */
/* used by stacktrace functions */
#define HAVE_BACKTRACE 1
#define HAVE_BACKTRACE_SYMBOLS 1
#define HAVE_BACKTRACE_SYMBOLS_FD 1
/* #undef HAVE_PRINTSTACK */
#define HAVE_IPV6 1
/* #undef ss_family */
/* #undef HAVE_SOCKADDR_IN_SIN_LEN */
/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
#define STRUCT_TIMESPEC_HAS_TV_SEC 1
#define STRUCT_TIMESPEC_HAS_TV_NSEC 1

/* this means that valgrind headers and macros are available */
/* #undef HAVE_VALGRIND_MEMCHECK_H */

/* this means WITH_VALGRIND - we change some code paths for valgrind */
/* #undef HAVE_valgrind */

/* Types we may use */
#ifdef __APPLE__
  /*
    Special handling required for OSX to support universal binaries that 
    mix 32 and 64 bit architectures.
  */
  #if(__LP64__)
    #define SIZEOF_LONG 8
  #else
    #define SIZEOF_LONG 4
  #endif
  #define SIZEOF_VOIDP   SIZEOF_LONG
  #define SIZEOF_CHARP   SIZEOF_LONG
  #define SIZEOF_SIZE_T  SIZEOF_LONG
#else
/* No indentation, to fetch the lines from verification scripts */
#define SIZEOF_LONG   8
#define SIZEOF_VOIDP  8
#define SIZEOF_CHARP  8
#define SIZEOF_SIZE_T 8
#endif

#define HAVE_LONG 1
#define HAVE_CHARP 1
#define SIZEOF_INT 4
#define HAVE_INT 1
#define SIZEOF_LONG_LONG 8
#define HAVE_LONG_LONG 1
#define SIZEOF_OFF_T 8
#define HAVE_OFF_T 1
/* #undef SIZEOF_UCHAR */
/* #undef HAVE_UCHAR */
#define SIZEOF_UINT 4
#define HAVE_UINT 1
#define SIZEOF_ULONG 8
#define HAVE_ULONG 1
/* #undef SIZEOF_INT8 */
/* #undef HAVE_INT8 */
/* #undef SIZEOF_UINT8 */
/* #undef HAVE_UINT8 */
/* #undef SIZEOF_INT16 */
/* #undef HAVE_INT16 */
/* #undef SIZEOF_UINT16 */
/* #undef HAVE_UINT16 */
/* #undef SIZEOF_INT32 */
/* #undef HAVE_INT32 */
/* #undef SIZEOF_UINT32 */
/* #undef HAVE_UINT32 */
/* #undef SIZEOF_INT64 */
/* #undef HAVE_INT64 */
/* #undef SIZEOF_UINT64 */
/* #undef HAVE_UINT64 */

#define SOCKET_SIZE_TYPE socklen_t

#define HAVE_MBSTATE_T 1

#define MAX_INDEXES 64

#define QSORT_TYPE_IS_VOID 1
#define RETQSORTTYPE void

#define RETSIGTYPE void
#define VOID_SIGHANDLER 1
#define HAVE_SIGHANDLER_T 1
#define STRUCT_RLIMIT struct rlimit

#ifdef __APPLE__
  #if __BIG_ENDIAN
    #define WORDS_BIGENDIAN 1
  #endif
#else
/* #undef WORDS_BIGENDIAN */
#endif

/* Define to `__inline__' or `__inline' if that's what the C compiler calls
   it, or to nothing if 'inline' is not supported under any name.  */
#define C_HAS_inline 1
#if !(C_HAS_inline)
#ifndef __cplusplus
# define inline 
#endif
#endif


#define TARGET_OS_LINUX 1

#define HAVE_WCTYPE_H 1
#define HAVE_WCHAR_H 1
#define HAVE_LANGINFO_H 1
#define HAVE_MBRLEN 1
#define HAVE_MBSRTOWCS 1
#define HAVE_MBRTOWC 1
#define HAVE_WCWIDTH 1
#define HAVE_ISWLOWER 1
#define HAVE_ISWUPPER 1
#define HAVE_TOWLOWER 1
#define HAVE_TOWUPPER 1
#define HAVE_ISWCTYPE 1
#define HAVE_WCHAR_T 1


#define HAVE_STRCASECMP 1
#define HAVE_TCGETATTR 1

#define HAVE_WEAK_SYMBOL 1
#define HAVE_ABI_CXA_DEMANGLE 1
#define HAVE_ATTRIBUTE_CLEANUP 1

#define HAVE_POSIX_SIGNALS 1
/* #undef HAVE_BSD_SIGNALS */

/* #undef HAVE_SVR3_SIGNALS */
/* #undef HAVE_V7_SIGNALS */
#define HAVE_ERR_remove_thread_state 1
#define HAVE_X509_check_host 1

/* #undef HAVE_SOLARIS_STYLE_GETHOST */

#define HAVE_GCC_C11_ATOMICS 1
/* #undef HAVE_SOLARIS_ATOMIC */
/* #undef NO_FCNTL_NONBLOCK */
#define NO_ALARM 1

/* #undef _LARGE_FILES */
#define _LARGEFILE_SOURCE 1
/* #undef _LARGEFILE64_SOURCE */

#define TIME_WITH_SYS_TIME 1

#define STACK_DIRECTION -1

#define SYSTEM_TYPE "Linux"
#define MACHINE_TYPE "x86_64"
#define DEFAULT_MACHINE "x86_64"
#define HAVE_DTRACE 1

#define SIGNAL_WITH_VIO_CLOSE 1

/* Windows stuff, mostly functions, that have Posix analogs but named differently */
/* #undef S_IROTH */
/* #undef S_IFIFO */
/* #undef IPPROTO_IPV6 */
/* #undef IPV6_V6ONLY */
/* #undef sigset_t */
/* #undef mode_t */
/* #undef SIGQUIT */
/* #undef SIGPIPE */
/* #undef popen */
/* #undef pclose */
/* #undef ssize_t */
/* #undef strcasecmp */
/* #undef strncasecmp */
/* #undef snprintf */
/* #undef strtok_r */
/* #undef strtoll */
/* #undef strtoull */
/* #undef vsnprintf */
#if defined(_MSC_VER) && (_MSC_VER > 1800)
#define tzname _tzname
#define P_tmpdir "C:\\TEMP"
#endif
#if defined(_MSC_VER) && (_MSC_VER > 1310)
# define HAVE_SETENV
#define setenv(a,b,c) _putenv_s(a,b)
#endif
#define PSAPI_VERSION 1     /* for GetProcessMemoryInfo() */

/* We don't want the min/max macros */
#ifdef _WIN32
#define NOMINMAX 1
#endif

/*
  MySQL features
*/
#define LOCAL_INFILE_MODE_OFF  0
#define LOCAL_INFILE_MODE_ON   1
#define LOCAL_INFILE_MODE_AUTO 2
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_AUTO

#define ENABLED_PROFILING 1
/* #undef EXTRA_DEBUG */
/* #undef USE_SYMDIR */

/* Character sets and collations */
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"

#define USE_MB
#define USE_MB_IDENT

/* This should mean case insensitive file system */
/* #undef FN_NO_CASE_SENSE */

#define HAVE_CHARSET_armscii8 1
#define HAVE_CHARSET_ascii 1
#define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1
#define HAVE_CHARSET_cp1251 1
#define HAVE_CHARSET_cp1256 1
#define HAVE_CHARSET_cp1257 1
#define HAVE_CHARSET_cp850 1
#define HAVE_CHARSET_cp852 1 
#define HAVE_CHARSET_cp866 1
#define HAVE_CHARSET_cp932 1
#define HAVE_CHARSET_dec8 1
#define HAVE_CHARSET_eucjpms 1
#define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1
#define HAVE_CHARSET_geostd8 1
#define HAVE_CHARSET_greek 1
#define HAVE_CHARSET_hebrew 1
#define HAVE_CHARSET_hp8 1
#define HAVE_CHARSET_keybcs2 1
#define HAVE_CHARSET_koi8r 1
#define HAVE_CHARSET_koi8u 1
#define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1
#define HAVE_CHARSET_latin5 1
#define HAVE_CHARSET_latin7 1
#define HAVE_CHARSET_macce 1
#define HAVE_CHARSET_macroman 1
#define HAVE_CHARSET_sjis 1
#define HAVE_CHARSET_swe7 1
#define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8mb4 1
#define HAVE_CHARSET_utf8mb3 1
#define HAVE_CHARSET_utf16 1
#define HAVE_CHARSET_utf32 1
#define HAVE_UCA_COLLATIONS 1
#define HAVE_COMPRESS 1
#define HAVE_EncryptAes128Ctr 1
#define HAVE_EncryptAes128Gcm 1
#define HAVE_des 1

/*
  Stuff that always need to be defined (compile breaks without it)
*/
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_QUERY_CACHE 1
#define BIG_TABLES 1

/*
  Important storage engines (those that really need define 
  WITH_<ENGINE>_STORAGE_ENGINE for the whole server)
*/
#define WITH_INNOBASE_STORAGE_ENGINE 1
#define WITH_PARTITION_STORAGE_ENGINE 1
#define WITH_PERFSCHEMA_STORAGE_ENGINE 1
#define WITH_ARIA_STORAGE_ENGINE 1
#define USE_ARIA_FOR_TMP_TABLES 1

#define DEFAULT_MYSQL_HOME "/usr"
#define SHAREDIR "/usr/share/mysql"
#define DEFAULT_BASEDIR "/usr"
#define MYSQL_DATADIR "/var/lib/mysql"
#define DEFAULT_CHARSET_HOME "/usr"
#define PLUGINDIR "/usr/lib64/mysql/plugin"
#define DEFAULT_SYSCONFDIR "/etc"
#define DEFAULT_TMPDIR P_tmpdir

/* #undef SO_EXT */

#define MYSQL_VERSION_MAJOR 10
#define MYSQL_VERSION_MINOR 6
#define MYSQL_VERSION_PATCH 22
#define MYSQL_VERSION_EXTRA ""

#define PACKAGE "mysql"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "MySQL Server"
#define PACKAGE_STRING "MySQL Server 10.6.22"
#define PACKAGE_TARNAME "mysql"
#define PACKAGE_VERSION "10.6.22"
#define VERSION "10.6.22"
#define PROTOCOL_VERSION 10
#define PCRE2_CODE_UNIT_WIDTH 8

#define MALLOC_LIBRARY "system"

/* time_t related defines */

#define SIZEOF_TIME_T 8
/* #undef TIME_T_UNSIGNED */

#ifndef EMBEDDED_LIBRARY
/* #undef WSREP_INTERFACE_VERSION */
#define WITH_WSREP 1
#define WSREP_PROC_INFO 1
#endif

#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif  // !defined(__STDC_FORMAT_MACROS)

#endif

#define HAVE_VFORK 1
server/private/service_versions.h000064400000004001150400264030013252 0ustar00/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
   Copyright (c) 2012, 2021, MariaDB

   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 */

#ifdef _WIN32
#define SERVICE_VERSION __declspec(dllexport) void *
#else
#define SERVICE_VERSION void *
#endif

#define VERSION_debug_sync              0x1000
#define VERSION_kill_statement          0x1000

#define VERSION_base64                  0x0100
#define VERSION_encryption              0x0300
#define VERSION_encryption_scheme       0x0100
#define VERSION_logger                  0x0100
#define VERSION_my_crypt                0x0100
#define VERSION_my_md5                  0x0100
#define VERSION_my_print_error          0x0100
#define VERSION_my_sha1                 0x0101
#define VERSION_my_sha2                 0x0100
#define VERSION_my_snprintf             0x0100
#define VERSION_progress_report         0x0100
#define VERSION_thd_alloc               0x0200
#define VERSION_thd_autoinc             0x0100
#define VERSION_thd_error_context       0x0200
#define VERSION_thd_rnd                 0x0100
#define VERSION_thd_specifics           0x0100
#define VERSION_thd_timezone            0x0100
#define VERSION_thd_wait                0x0100
#define VERSION_wsrep                   0x0500
#define VERSION_json                    0x0100
#define VERSION_sql_service             0x0102
#define VERSION_thd_mdl                 0x0100
#define VERSION_print_check_msg         0x0100
mysql.h000064400000121625150400264030006063 0ustar00/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
                 2012 by MontyProgram AB

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */

/* defines for the libmariadb library */

#ifndef _mysql_h
#define _mysql_h

#ifdef	__cplusplus
extern "C" {
#endif

#ifndef LIBMARIADB
#define LIBMARIADB
#endif
#ifndef MYSQL_CLIENT
#define MYSQL_CLIENT
#endif

#include <stdarg.h>

#if !defined (_global_h) && !defined (MY_GLOBAL_INCLUDED) /* If not standard header */
#include <sys/types.h>
typedef char my_bool;
typedef unsigned long long my_ulonglong;

#if !defined(_WIN32)
#define STDCALL
#else
#define STDCALL __stdcall
#endif

#ifndef my_socket_defined
#define my_socket_defined
#if defined(_WIN64)
#define my_socket unsigned long long
#elif defined(_WIN32)
#define my_socket unsigned int
#else
typedef int my_socket;
#endif
#endif
#endif
#include "mariadb_com.h"
#include "mariadb_version.h"
#include "ma_list.h"
#include "mariadb_ctype.h"


typedef struct st_ma_const_string
{
  const char *str;
  size_t length;
} MARIADB_CONST_STRING;

typedef struct st_ma_const_data
{
  const unsigned char *data;
  size_t length;
} MARIADB_CONST_DATA;


#ifndef ST_MA_USED_MEM_DEFINED
#define ST_MA_USED_MEM_DEFINED
  typedef struct st_ma_used_mem {   /* struct for once_alloc */
    struct st_ma_used_mem *next;    /* Next block in use */
    size_t left;                 /* memory left in block  */
    size_t size;                 /* Size of block */
  } MA_USED_MEM;

  typedef struct st_ma_mem_root {
    MA_USED_MEM *free;
    MA_USED_MEM *used;
    MA_USED_MEM *pre_alloc;
    size_t min_malloc;
    size_t block_size;
    unsigned int block_num;
    unsigned int first_block_usage;
    void (*error_handler)(void);
  } MA_MEM_ROOT;
#endif

extern unsigned int mysql_port;
extern char *mysql_unix_port;
extern unsigned int mariadb_deinitialize_ssl;

#define IS_PRI_KEY(n)	((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n)	((n) & NOT_NULL_FLAG)
#define IS_BLOB(n)	((n) & BLOB_FLAG)
#define IS_NUM(t)	(((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
#define IS_NUM_FIELD(f)	 ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR || (f)->type == MYSQL_TYPE_NEWDECIMAL || (f)->type == MYSQL_TYPE_DECIMAL)

  typedef struct st_mysql_field {
    char *name;			/* Name of column */
    char *org_name;		/* Name of original column (added after 3.23.58) */
    char *table;			/* Table of column if column was a field */
    char *org_table;		/* Name of original table (added after 3.23.58 */
    char *db;                     /* table schema (added after 3.23.58) */
    char *catalog;                /* table catalog (added after 3.23.58) */
    char *def;			/* Default value (set by mysql_list_fields) */
    unsigned long length;		/* Width of column */
    unsigned long max_length;	/* Max width of selected set */
  /* added after 3.23.58 */
    unsigned int name_length;
    unsigned int org_name_length;
    unsigned int table_length;
    unsigned int org_table_length;
    unsigned int db_length;
    unsigned int catalog_length;
    unsigned int def_length;
  /***********************/
    unsigned int flags;		/* Div flags */
    unsigned int decimals;	/* Number of decimals in field */
    unsigned int charsetnr;       /* char set number (added in 4.1) */
    enum enum_field_types type;	/* Type of field. Se mysql_com.h for types */
    void *extension;              /* added in 4.1 */
  } MYSQL_FIELD;

  typedef char **MYSQL_ROW;		/* return data as array of strings */
  typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */

#define SET_CLIENT_ERROR(a, b, c, d) \
  do { \
    (a)->net.last_errno= (b);\
    strncpy((a)->net.sqlstate, (c), SQLSTATE_LENGTH);\
    (a)->net.sqlstate[SQLSTATE_LENGTH]= 0;\
    strncpy((a)->net.last_error, (d) ? (d) : ER((b)), MYSQL_ERRMSG_SIZE - 1);\
    (a)->net.last_error[MYSQL_ERRMSG_SIZE - 1]= 0;\
  } while(0)

/* For mysql_async.c */
#define set_mariadb_error(A,B,C) SET_CLIENT_ERROR((A),(B),(C),0)
extern const char *SQLSTATE_UNKNOWN;
#define unknown_sqlstate SQLSTATE_UNKNOWN

#define CLEAR_CLIENT_ERROR(a) \
  do { \
    (a)->net.last_errno= 0;\
    strcpy((a)->net.sqlstate, "00000");\
    (a)->net.last_error[0]= '\0';\
    if ((a)->net.extension)\
      (a)->net.extension->extended_errno= 0;\
  } while (0)

#define MYSQL_COUNT_ERROR (~(unsigned long long) 0)


  typedef struct st_mysql_rows {
    struct st_mysql_rows *next;		/* list of rows */
    MYSQL_ROW data;
    unsigned long length;
  } MYSQL_ROWS;

  typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;	/* offset to current row */

  typedef struct st_mysql_data {
    MYSQL_ROWS *data;
    void *embedded_info;
    MA_MEM_ROOT alloc;
    unsigned long long rows;
    unsigned int fields;
    void *extension;
  } MYSQL_DATA;

  enum mysql_option 
  {
    MYSQL_OPT_CONNECT_TIMEOUT, 
    MYSQL_OPT_COMPRESS,
    MYSQL_OPT_NAMED_PIPE,
    MYSQL_INIT_COMMAND,
    MYSQL_READ_DEFAULT_FILE,
    MYSQL_READ_DEFAULT_GROUP,
    MYSQL_SET_CHARSET_DIR,
    MYSQL_SET_CHARSET_NAME,
    MYSQL_OPT_LOCAL_INFILE,
    MYSQL_OPT_PROTOCOL,
    MYSQL_SHARED_MEMORY_BASE_NAME,
    MYSQL_OPT_READ_TIMEOUT,
    MYSQL_OPT_WRITE_TIMEOUT,
    MYSQL_OPT_USE_RESULT,
    MYSQL_OPT_USE_REMOTE_CONNECTION,
    MYSQL_OPT_USE_EMBEDDED_CONNECTION,
    MYSQL_OPT_GUESS_CONNECTION,
    MYSQL_SET_CLIENT_IP,
    MYSQL_SECURE_AUTH,
    MYSQL_REPORT_DATA_TRUNCATION,
    MYSQL_OPT_RECONNECT,
    MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
    MYSQL_PLUGIN_DIR,
    MYSQL_DEFAULT_AUTH,
    MYSQL_OPT_BIND,
    MYSQL_OPT_SSL_KEY,
    MYSQL_OPT_SSL_CERT,
    MYSQL_OPT_SSL_CA,
    MYSQL_OPT_SSL_CAPATH,
    MYSQL_OPT_SSL_CIPHER,
    MYSQL_OPT_SSL_CRL,
    MYSQL_OPT_SSL_CRLPATH,
    /* Connection attribute options */
    MYSQL_OPT_CONNECT_ATTR_RESET,
    MYSQL_OPT_CONNECT_ATTR_ADD,
    MYSQL_OPT_CONNECT_ATTR_DELETE,
    MYSQL_SERVER_PUBLIC_KEY,
    MYSQL_ENABLE_CLEARTEXT_PLUGIN,
    MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
    MYSQL_OPT_SSL_ENFORCE,
    MYSQL_OPT_MAX_ALLOWED_PACKET,
    MYSQL_OPT_NET_BUFFER_LENGTH,
    MYSQL_OPT_TLS_VERSION,
    MYSQL_OPT_ZSTD_COMPRESSION_LEVEL,

    /* MariaDB specific */
    MYSQL_PROGRESS_CALLBACK=5999,
    MYSQL_OPT_NONBLOCK,
    /* MariaDB Connector/C specific */
    MYSQL_DATABASE_DRIVER=7000,
    MARIADB_OPT_SSL_FP,             /* deprecated, use MARIADB_OPT_TLS_PEER_FP instead */
    MARIADB_OPT_SSL_FP_LIST,        /* deprecated, use MARIADB_OPT_TLS_PEER_FP_LIST instead */
    MARIADB_OPT_TLS_PASSPHRASE,     /* passphrase for encrypted certificates */
    MARIADB_OPT_TLS_CIPHER_STRENGTH,
    MARIADB_OPT_TLS_VERSION,
    MARIADB_OPT_TLS_PEER_FP,            /* single finger print for server certificate verification */
    MARIADB_OPT_TLS_PEER_FP_LIST,       /* finger print white list for server certificate verification */
    MARIADB_OPT_CONNECTION_READ_ONLY,
    MYSQL_OPT_CONNECT_ATTRS,        /* for mysql_get_optionv */
    MARIADB_OPT_USERDATA,
    MARIADB_OPT_CONNECTION_HANDLER,
    MARIADB_OPT_PORT,
    MARIADB_OPT_UNIXSOCKET,
    MARIADB_OPT_PASSWORD,
    MARIADB_OPT_HOST,
    MARIADB_OPT_USER,
    MARIADB_OPT_SCHEMA,
    MARIADB_OPT_DEBUG,
    MARIADB_OPT_FOUND_ROWS,
    MARIADB_OPT_MULTI_RESULTS,
    MARIADB_OPT_MULTI_STATEMENTS,
    MARIADB_OPT_INTERACTIVE,
    MARIADB_OPT_PROXY_HEADER,
    MARIADB_OPT_IO_WAIT,
    MARIADB_OPT_SKIP_READ_RESPONSE,
    MARIADB_OPT_RESTRICTED_AUTH,
    MARIADB_OPT_RPL_REGISTER_REPLICA,
    MARIADB_OPT_STATUS_CALLBACK,
    MARIADB_OPT_SERVER_PLUGINS
  };

  enum mariadb_value {
    MARIADB_CHARSET_ID,
    MARIADB_CHARSET_NAME,
    MARIADB_CLIENT_ERRORS,
    MARIADB_CLIENT_VERSION,
    MARIADB_CLIENT_VERSION_ID,
    MARIADB_CONNECTION_ASYNC_TIMEOUT,
    MARIADB_CONNECTION_ASYNC_TIMEOUT_MS,
    MARIADB_CONNECTION_MARIADB_CHARSET_INFO,
    MARIADB_CONNECTION_ERROR,
    MARIADB_CONNECTION_ERROR_ID,
    MARIADB_CONNECTION_HOST,
    MARIADB_CONNECTION_INFO,
    MARIADB_CONNECTION_PORT,
    MARIADB_CONNECTION_PROTOCOL_VERSION_ID,
    MARIADB_CONNECTION_PVIO_TYPE,
    MARIADB_CONNECTION_SCHEMA,
    MARIADB_CONNECTION_SERVER_TYPE,
    MARIADB_CONNECTION_SERVER_VERSION,
    MARIADB_CONNECTION_SERVER_VERSION_ID,
    MARIADB_CONNECTION_SOCKET,
    MARIADB_CONNECTION_SQLSTATE,
    MARIADB_CONNECTION_SSL_CIPHER,
    MARIADB_TLS_LIBRARY,
    MARIADB_CONNECTION_TLS_VERSION,
    MARIADB_CONNECTION_TLS_VERSION_ID,
    MARIADB_CONNECTION_TYPE,
    MARIADB_CONNECTION_UNIX_SOCKET,
    MARIADB_CONNECTION_USER,
    MARIADB_MAX_ALLOWED_PACKET,
    MARIADB_NET_BUFFER_LENGTH,
    MARIADB_CONNECTION_SERVER_STATUS,
    MARIADB_CONNECTION_SERVER_CAPABILITIES,
    MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES,
    MARIADB_CONNECTION_CLIENT_CAPABILITIES,
    MARIADB_CONNECTION_BYTES_READ,
    MARIADB_CONNECTION_BYTES_SENT
  };

  enum mysql_status { MYSQL_STATUS_READY,
                      MYSQL_STATUS_GET_RESULT,
                      MYSQL_STATUS_USE_RESULT,
                      MYSQL_STATUS_QUERY_SENT,
                      MYSQL_STATUS_SENDING_LOAD_DATA,
                      MYSQL_STATUS_FETCHING_DATA,
                      MYSQL_STATUS_NEXT_RESULT_PENDING,
                      MYSQL_STATUS_QUIT_SENT, /* object is "destroyed" at this stage */
                      MYSQL_STATUS_STMT_RESULT
  };

  enum mysql_protocol_type
  {
    MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
    MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
  };

struct st_mysql_options {
    unsigned int connect_timeout, read_timeout, write_timeout;
    unsigned int port, protocol;
    unsigned long client_flag;
    char *host,*user,*password,*unix_socket,*db;
    struct st_dynamic_array *init_command;
    char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
    char *ssl_key;				/* PEM key file */
    char *ssl_cert;				/* PEM cert file */
    char *ssl_ca;					/* PEM CA file */
    char *ssl_capath;				/* PEM directory of CA-s? */
    char *ssl_cipher;
    char *shared_memory_base_name;
    unsigned long max_allowed_packet;
    my_bool use_ssl;				/* if to use SSL or not */
    my_bool compress,named_pipe;
    my_bool reconnect, unused_1, unused_2, unused_3;
    enum mysql_option methods_to_use;
    char *bind_address;
    my_bool secure_auth;
    my_bool report_data_truncation; 
    /* function pointers for local infile support */
    int (*local_infile_init)(void **, const char *, void *);
    int (*local_infile_read)(void *, char *, unsigned int);
    void (*local_infile_end)(void *);
    int (*local_infile_error)(void *, char *, unsigned int);
    void *local_infile_userdata;
    struct st_mysql_options_extension *extension;
};

  typedef struct st_mysql {
    NET		net;			/* Communication parameters */
    void  *unused_0;
    char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
    char *info,*db;
    const struct ma_charset_info_st *charset;      /* character set */
    MYSQL_FIELD *fields;
    MA_MEM_ROOT field_alloc;
    unsigned long long affected_rows;
    unsigned long long insert_id;		/* id if insert on table with NEXTNR */
    unsigned long long extra_info;		/* Used by mysqlshow */
    unsigned long thread_id;		/* Id for connection in server */
    unsigned long packet_length;
    unsigned int port;
    unsigned long client_flag;
    unsigned long server_capabilities;
    unsigned int protocol_version;
    unsigned int field_count;
    unsigned int server_status;
    unsigned int server_language;
    unsigned int warning_count;          /* warning count, added in 4.1 protocol */
    struct st_mysql_options options;
    enum mysql_status status;
    my_bool	free_me;		/* If free in mysql_close */
    my_bool	unused_1;
    char	        scramble_buff[20+ 1];
    /* madded after 3.23.58 */
    my_bool       unused_2;
    void          *unused_3, *unused_4, *unused_5, *unused_6;
    LIST          *stmts;
    const struct  st_mariadb_methods *methods;
    void          *thd;
    my_bool       *unbuffered_fetch_owner;
    char          *info_buffer;
    struct st_mariadb_extension *extension;
} MYSQL;

typedef struct st_mysql_res {
  unsigned long long  row_count;
  unsigned int	field_count, current_field;
  MYSQL_FIELD	*fields;
  MYSQL_DATA	*data;
  MYSQL_ROWS	*data_cursor;
  MA_MEM_ROOT	field_alloc;
  MYSQL_ROW	row;			/* If unbuffered read */
  MYSQL_ROW	current_row;		/* buffer to current row */
  unsigned long *lengths;		/* column lengths of current row */
  MYSQL		*handle;		/* for unbuffered reads */
  my_bool	eof;			/* Used my mysql_fetch_row */
  my_bool       is_ps;
} MYSQL_RES;

typedef struct
{
  unsigned long *p_max_allowed_packet;
  unsigned long *p_net_buffer_length;
  void *extension;
} MYSQL_PARAMETERS;


enum mariadb_field_attr_t
{
  MARIADB_FIELD_ATTR_DATA_TYPE_NAME= 0,
  MARIADB_FIELD_ATTR_FORMAT_NAME= 1
};

#define MARIADB_FIELD_ATTR_LAST MARIADB_FIELD_ATTR_FORMAT_NAME


int STDCALL mariadb_field_attr(MARIADB_CONST_STRING *attr,
                               const MYSQL_FIELD *field,
                               enum mariadb_field_attr_t type);

#ifndef _mysql_time_h_
enum enum_mysql_timestamp_type
{
  MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
  MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
};

typedef struct st_mysql_time
{
  unsigned int  year, month, day, hour, minute, second;
  unsigned long second_part;
  my_bool       neg;
  enum enum_mysql_timestamp_type time_type;
} MYSQL_TIME;
#define AUTO_SEC_PART_DIGITS 39
#endif

#define SEC_PART_DIGITS 6
#define MARIADB_INVALID_SOCKET -1

/* Asynchronous API constants */
#define MYSQL_WAIT_READ      1
#define MYSQL_WAIT_WRITE     2
#define MYSQL_WAIT_EXCEPT    4
#define MYSQL_WAIT_TIMEOUT   8

typedef struct character_set
{
  unsigned int      number;     /* character set number              */
  unsigned int      state;      /* character set state               */
  const char        *csname;    /* character set name                */
  const char        *name;      /* collation name                    */
  const char        *comment;   /* comment                           */
  const char        *dir;       /* character set directory           */
  unsigned int      mbminlen;   /* min. length for multibyte strings */
  unsigned int      mbmaxlen;   /* max. length for multibyte strings */
} MY_CHARSET_INFO;

/* Local infile support functions */
#define LOCAL_INFILE_ERROR_LEN 512

#include "mariadb_stmt.h"

#ifndef MYSQL_CLIENT_PLUGIN_HEADER
#define MYSQL_CLIENT_PLUGIN_HEADER                      \
  int type;                                             \
  unsigned int interface_version;                       \
  const char *name;                                     \
  const char *author;                                   \
  const char *desc;                                     \
  unsigned int version[3];                              \
  const char *license;                                  \
  void *mysql_api;                                      \
  int (*init)(char *, size_t, int, va_list);            \
  int (*deinit)(void);                                  \
  int (*options)(const char *option, const void *);
struct st_mysql_client_plugin
{
  MYSQL_CLIENT_PLUGIN_HEADER
};

struct st_mysql_client_plugin *
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
                  int argc, ...);
struct st_mysql_client_plugin * STDCALL
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
                    int argc, va_list args);
struct st_mysql_client_plugin * STDCALL
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
struct st_mysql_client_plugin * STDCALL
mysql_client_register_plugin(struct st_mysql *mysql,
                             struct st_mysql_client_plugin *plugin);
#endif


void STDCALL mysql_set_local_infile_handler(MYSQL *mysql,
        int (*local_infile_init)(void **, const char *, void *),
        int (*local_infile_read)(void *, char *, unsigned int),
        void (*local_infile_end)(void *),
        int (*local_infile_error)(void *, char*, unsigned int),
        void *);

void mysql_set_local_infile_default(MYSQL *mysql);

void my_set_error(MYSQL *mysql, unsigned int error_nr, 
                  const char *sqlstate, const char *format, ...);
/* Functions to get information from the MYSQL and MYSQL_RES structures */
/* Should definitely be used if one uses shared libraries */

my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);
unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
my_bool STDCALL mysql_eof(MYSQL_RES *res);
MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res,
					      unsigned int fieldnr);
MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);
MYSQL_ROWS * STDCALL mysql_row_tell(MYSQL_RES *res);
unsigned int STDCALL mysql_field_tell(MYSQL_RES *res);

unsigned int STDCALL mysql_field_count(MYSQL *mysql);
my_bool STDCALL mysql_more_results(MYSQL *mysql);
int STDCALL mysql_next_result(MYSQL *mysql);
my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
my_bool STDCALL mysql_autocommit(MYSQL *mysql, my_bool mode);
my_bool STDCALL mysql_commit(MYSQL *mysql);
my_bool STDCALL mysql_rollback(MYSQL *mysql);
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
unsigned int STDCALL mysql_errno(MYSQL *mysql);
const char * STDCALL mysql_error(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
const char * STDCALL mysql_character_set_name(MYSQL *mysql);
void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *cs);
int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);

my_bool mariadb_get_infov(MYSQL *mysql, enum mariadb_value value, void *arg, ...);
my_bool STDCALL mariadb_get_info(MYSQL *mysql, enum mariadb_value value, void *arg);
MYSQL *		STDCALL mysql_init(MYSQL *mysql);
int		STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
				      const char *cert, const char *ca,
				      const char *capath, const char *cipher);
const char *	STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
my_bool		STDCALL mysql_change_user(MYSQL *mysql, const char *user, 
					  const char *passwd, const char *db);
MYSQL *		STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
					   const char *user,
					   const char *passwd,
					   const char *db,
					   unsigned int port,
					   const char *unix_socket,
					   unsigned long clientflag);
void		STDCALL mysql_close(MYSQL *sock);
int		STDCALL mysql_select_db(MYSQL *mysql, const char *db);
int		STDCALL mysql_query(MYSQL *mysql, const char *q);
int		STDCALL mysql_send_query(MYSQL *mysql, const char *q,
					 unsigned long length);
my_bool	STDCALL mysql_read_query_result(MYSQL *mysql);
int		STDCALL mysql_real_query(MYSQL *mysql, const char *q,
					 unsigned long length);
int		STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
int		STDCALL mysql_dump_debug_info(MYSQL *mysql);
int		STDCALL mysql_refresh(MYSQL *mysql,
				     unsigned int refresh_options);
int		STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
int		STDCALL mysql_ping(MYSQL *mysql);
char *		STDCALL mysql_stat(MYSQL *mysql);
char *		STDCALL mysql_get_server_info(MYSQL *mysql);
unsigned long   STDCALL mysql_get_server_version(MYSQL *mysql);
char *		STDCALL mysql_get_host_info(MYSQL *mysql);
unsigned int	STDCALL mysql_get_proto_info(MYSQL *mysql);
MYSQL_RES *	STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
MYSQL_RES *	STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
MYSQL_RES *	STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
					 const char *wild);
MYSQL_RES *	STDCALL mysql_list_processes(MYSQL *mysql);
MYSQL_RES *	STDCALL mysql_store_result(MYSQL *mysql);
MYSQL_RES *	STDCALL mysql_use_result(MYSQL *mysql);
int		STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
				      const void *arg);
int		STDCALL mysql_options4(MYSQL *mysql,enum mysql_option option,
				      const void *arg1, const void *arg2);
void		STDCALL mysql_free_result(MYSQL_RES *result);
void		STDCALL mysql_data_seek(MYSQL_RES *result,
					unsigned long long offset);
MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET);
MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
					   MYSQL_FIELD_OFFSET offset);
MYSQL_ROW	STDCALL mysql_fetch_row(MYSQL_RES *result);
unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
MYSQL_FIELD *	STDCALL mysql_fetch_field(MYSQL_RES *result);
unsigned long	STDCALL mysql_escape_string(char *to,const char *from,
					    unsigned long from_length);
unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
					       char *to,const char *from,
					       unsigned long length);
unsigned int	STDCALL mysql_thread_safe(void);
unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_sqlstate(MYSQL *mysql);
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);
void STDCALL mysql_thread_end(void);
my_bool STDCALL mysql_thread_init(void);
int STDCALL mysql_set_server_option(MYSQL *mysql, 
                                    enum enum_mysql_set_option option);
const char * STDCALL mysql_get_client_info(void);
unsigned long STDCALL mysql_get_client_version(void);
my_bool STDCALL mariadb_connection(MYSQL *mysql);
const char * STDCALL mysql_get_server_name(MYSQL *mysql);
MARIADB_CHARSET_INFO * STDCALL mariadb_get_charset_by_name(const char *csname);
MARIADB_CHARSET_INFO * STDCALL mariadb_get_charset_by_nr(unsigned int csnr);
size_t STDCALL mariadb_convert_string(const char *from, size_t *from_len, MARIADB_CHARSET_INFO *from_cs,
                                      char *to, size_t *to_len, MARIADB_CHARSET_INFO *to_cs, int *errorcode);
int mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...);
int mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...);
int STDCALL mysql_get_option(MYSQL *mysql, enum mysql_option option, void *arg);
unsigned long STDCALL mysql_hex_string(char *to, const char *from, unsigned long len);
my_socket STDCALL mysql_get_socket(MYSQL *mysql);
unsigned int STDCALL mysql_get_timeout_value(const MYSQL *mysql);
unsigned int STDCALL mysql_get_timeout_value_ms(const MYSQL *mysql);
my_bool STDCALL mariadb_reconnect(MYSQL *mysql);
int STDCALL mariadb_cancel(MYSQL *mysql);
void STDCALL mysql_debug(const char *debug);
unsigned long STDCALL mysql_net_read_packet(MYSQL *mysql);
unsigned long STDCALL mysql_net_field_length(unsigned char **packet);
my_bool STDCALL mysql_embedded(void);
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);

/* Async API */
int STDCALL mysql_close_start(MYSQL *sock);
int STDCALL mysql_close_cont(MYSQL *sock, int status);
int STDCALL mysql_commit_start(my_bool *ret, MYSQL * mysql);
int STDCALL mysql_commit_cont(my_bool *ret, MYSQL * mysql, int status);
int STDCALL mysql_dump_debug_info_cont(int *ret, MYSQL *mysql, int ready_status);
int STDCALL mysql_dump_debug_info_start(int *ret, MYSQL *mysql);
int STDCALL mysql_rollback_start(my_bool *ret, MYSQL * mysql);
int STDCALL mysql_rollback_cont(my_bool *ret, MYSQL * mysql, int status);
int STDCALL mysql_autocommit_start(my_bool *ret, MYSQL * mysql,
                                   my_bool auto_mode);
int STDCALL mysql_list_fields_cont(MYSQL_RES **ret, MYSQL *mysql, int ready_status);
int STDCALL mysql_list_fields_start(MYSQL_RES **ret, MYSQL *mysql, const char *table,
                        const char *wild);
int STDCALL mysql_autocommit_cont(my_bool *ret, MYSQL * mysql, int status);
int STDCALL mysql_next_result_start(int *ret, MYSQL *mysql);
int STDCALL mysql_next_result_cont(int *ret, MYSQL *mysql, int status);
int STDCALL mysql_select_db_start(int *ret, MYSQL *mysql, const char *db);
int STDCALL mysql_select_db_cont(int *ret, MYSQL *mysql, int ready_status);
int STDCALL mysql_stmt_warning_count(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_next_result_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_next_result_cont(int *ret, MYSQL_STMT *stmt, int status);

int STDCALL mysql_set_character_set_start(int *ret, MYSQL *mysql,
                                                   const char *csname);
int STDCALL mysql_set_character_set_cont(int *ret, MYSQL *mysql,
                                                  int status);
int STDCALL mysql_change_user_start(my_bool *ret, MYSQL *mysql,
                                                const char *user,
                                                const char *passwd,
                                                const char *db);
int STDCALL mysql_change_user_cont(my_bool *ret, MYSQL *mysql,
                                               int status);
int         STDCALL mysql_real_connect_start(MYSQL **ret, MYSQL *mysql,
                                                 const char *host,
                                                 const char *user,
                                                 const char *passwd,
                                                 const char *db,
                                                 unsigned int port,
                                                 const char *unix_socket,
                                                 unsigned long clientflag);
int         STDCALL mysql_real_connect_cont(MYSQL **ret, MYSQL *mysql,
                                                int status);
int             STDCALL mysql_query_start(int *ret, MYSQL *mysql,
                                          const char *q);
int             STDCALL mysql_query_cont(int *ret, MYSQL *mysql,
                                         int status);
int             STDCALL mysql_send_query_start(int *ret, MYSQL *mysql,
                                               const char *q,
                                               unsigned long length);
int             STDCALL mysql_send_query_cont(int *ret, MYSQL *mysql, int status);
int             STDCALL mysql_real_query_start(int *ret, MYSQL *mysql,
                                               const char *q,
                                               unsigned long length);
int             STDCALL mysql_real_query_cont(int *ret, MYSQL *mysql,
                                              int status);
int             STDCALL mysql_store_result_start(MYSQL_RES **ret, MYSQL *mysql);
int             STDCALL mysql_store_result_cont(MYSQL_RES **ret, MYSQL *mysql,
                                                int status);
int             STDCALL mysql_shutdown_start(int *ret, MYSQL *mysql,
                                             enum mysql_enum_shutdown_level
                                             shutdown_level);
int             STDCALL mysql_shutdown_cont(int *ret, MYSQL *mysql,
                                            int status);
int             STDCALL mysql_refresh_start(int *ret, MYSQL *mysql,
                                            unsigned int refresh_options);
int             STDCALL mysql_refresh_cont(int *ret, MYSQL *mysql, int status);
int             STDCALL mysql_kill_start(int *ret, MYSQL *mysql,
                                         unsigned long pid);
int             STDCALL mysql_kill_cont(int *ret, MYSQL *mysql, int status);
int             STDCALL mysql_set_server_option_start(int *ret, MYSQL *mysql,
                                                      enum enum_mysql_set_option
                                                      option);
int             STDCALL mysql_set_server_option_cont(int *ret, MYSQL *mysql,
                                                     int status);
int             STDCALL mysql_ping_start(int *ret, MYSQL *mysql);
int             STDCALL mysql_ping_cont(int *ret, MYSQL *mysql, int status);
int             STDCALL mysql_stat_start(const char **ret, MYSQL *mysql);
int             STDCALL mysql_stat_cont(const char **ret, MYSQL *mysql,
                                        int status);
int             STDCALL mysql_free_result_start(MYSQL_RES *result);
int             STDCALL mysql_free_result_cont(MYSQL_RES *result, int status);
int             STDCALL mysql_fetch_row_start(MYSQL_ROW *ret,
                                              MYSQL_RES *result);
int             STDCALL mysql_fetch_row_cont(MYSQL_ROW *ret, MYSQL_RES *result,
                                             int status);
int             STDCALL mysql_read_query_result_start(my_bool *ret,
                                                      MYSQL *mysql);
int             STDCALL mysql_read_query_result_cont(my_bool *ret,
                                                     MYSQL *mysql, int status);
int             STDCALL mysql_reset_connection_start(int *ret, MYSQL *mysql);
int             STDCALL mysql_reset_connection_cont(int *ret, MYSQL *mysql, int status);
int STDCALL mysql_session_track_get_next(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length);
int STDCALL mysql_session_track_get_first(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length);
int STDCALL mysql_stmt_prepare_start(int *ret, MYSQL_STMT *stmt,const char *query, unsigned long length);
int STDCALL mysql_stmt_prepare_cont(int *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_execute_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_execute_cont(int *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_fetch_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_cont(int *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_store_result_start(int *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_store_result_cont(int *ret, MYSQL_STMT *stmt,int status);
int STDCALL mysql_stmt_close_start(my_bool *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_close_cont(my_bool *ret, MYSQL_STMT * stmt, int status);
int STDCALL mysql_stmt_reset_start(my_bool *ret, MYSQL_STMT * stmt);
int STDCALL mysql_stmt_reset_cont(my_bool *ret, MYSQL_STMT *stmt, int status);
int STDCALL mysql_stmt_free_result_start(my_bool *ret, MYSQL_STMT *stmt);
int STDCALL mysql_stmt_free_result_cont(my_bool *ret, MYSQL_STMT *stmt,
                                        int status);
int STDCALL mysql_stmt_send_long_data_start(my_bool *ret, MYSQL_STMT *stmt,
                                            unsigned int param_number,
                                            const char *data,
                                            unsigned long len);
int STDCALL mysql_stmt_send_long_data_cont(my_bool *ret, MYSQL_STMT *stmt,
                                           int status);
int STDCALL mysql_reset_connection(MYSQL *mysql);

/* API function calls (used by dynamic plugins) */
struct st_mariadb_api {
  unsigned long long (STDCALL *mysql_num_rows)(MYSQL_RES *res);
  unsigned int (STDCALL *mysql_num_fields)(MYSQL_RES *res);
  my_bool (STDCALL *mysql_eof)(MYSQL_RES *res);
  MYSQL_FIELD *(STDCALL *mysql_fetch_field_direct)(MYSQL_RES *res, unsigned int fieldnr);
  MYSQL_FIELD * (STDCALL *mysql_fetch_fields)(MYSQL_RES *res);
  MYSQL_ROWS * (STDCALL *mysql_row_tell)(MYSQL_RES *res);
  unsigned int (STDCALL *mysql_field_tell)(MYSQL_RES *res);
  unsigned int (STDCALL *mysql_field_count)(MYSQL *mysql);
  my_bool (STDCALL *mysql_more_results)(MYSQL *mysql);
  int (STDCALL *mysql_next_result)(MYSQL *mysql);
  unsigned long long (STDCALL *mysql_affected_rows)(MYSQL *mysql);
  my_bool (STDCALL *mysql_autocommit)(MYSQL *mysql, my_bool mode);
  my_bool (STDCALL *mysql_commit)(MYSQL *mysql);
  my_bool (STDCALL *mysql_rollback)(MYSQL *mysql);
  unsigned long long (STDCALL *mysql_insert_id)(MYSQL *mysql);
  unsigned int (STDCALL *mysql_errno)(MYSQL *mysql);
  const char * (STDCALL *mysql_error)(MYSQL *mysql);
  const char * (STDCALL *mysql_info)(MYSQL *mysql);
  unsigned long (STDCALL *mysql_thread_id)(MYSQL *mysql);
  const char * (STDCALL *mysql_character_set_name)(MYSQL *mysql);
  void (STDCALL *mysql_get_character_set_info)(MYSQL *mysql, MY_CHARSET_INFO *cs);
  int (STDCALL *mysql_set_character_set)(MYSQL *mysql, const char *csname);
  my_bool (*mariadb_get_infov)(MYSQL *mysql, enum mariadb_value value, void *arg, ...);
  my_bool (STDCALL *mariadb_get_info)(MYSQL *mysql, enum mariadb_value value, void *arg);
  MYSQL * (STDCALL *mysql_init)(MYSQL *mysql);
  int (STDCALL *mysql_ssl_set)(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher);
  const char * (STDCALL *mysql_get_ssl_cipher)(MYSQL *mysql);
  my_bool (STDCALL *mysql_change_user)(MYSQL *mysql, const char *user, const char *passwd, const char *db);
  MYSQL * (STDCALL *mysql_real_connect)(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag);
  void (STDCALL *mysql_close)(MYSQL *sock);
  int (STDCALL *mysql_select_db)(MYSQL *mysql, const char *db);
  int (STDCALL *mysql_query)(MYSQL *mysql, const char *q);
  int (STDCALL *mysql_send_query)(MYSQL *mysql, const char *q, unsigned long length);
  my_bool (STDCALL *mysql_read_query_result)(MYSQL *mysql);
  int (STDCALL *mysql_real_query)(MYSQL *mysql, const char *q, unsigned long length);
  int (STDCALL *mysql_shutdown)(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
  int (STDCALL *mysql_dump_debug_info)(MYSQL *mysql);
  int (STDCALL *mysql_refresh)(MYSQL *mysql, unsigned int refresh_options);
  int (STDCALL *mysql_kill)(MYSQL *mysql,unsigned long pid);
  int (STDCALL *mysql_ping)(MYSQL *mysql);
  char * (STDCALL *mysql_stat)(MYSQL *mysql);
  char * (STDCALL *mysql_get_server_info)(MYSQL *mysql);
  unsigned long (STDCALL *mysql_get_server_version)(MYSQL *mysql);
  char * (STDCALL *mysql_get_host_info)(MYSQL *mysql);
  unsigned int (STDCALL *mysql_get_proto_info)(MYSQL *mysql);
  MYSQL_RES * (STDCALL *mysql_list_dbs)(MYSQL *mysql,const char *wild);
  MYSQL_RES * (STDCALL *mysql_list_tables)(MYSQL *mysql,const char *wild);
  MYSQL_RES * (STDCALL *mysql_list_fields)(MYSQL *mysql, const char *table, const char *wild);
  MYSQL_RES * (STDCALL *mysql_list_processes)(MYSQL *mysql);
  MYSQL_RES * (STDCALL *mysql_store_result)(MYSQL *mysql);
  MYSQL_RES * (STDCALL *mysql_use_result)(MYSQL *mysql);
  int (STDCALL *mysql_options)(MYSQL *mysql,enum mysql_option option, const void *arg);
  void (STDCALL *mysql_free_result)(MYSQL_RES *result);
  void (STDCALL *mysql_data_seek)(MYSQL_RES *result, unsigned long long offset);
  MYSQL_ROW_OFFSET (STDCALL *mysql_row_seek)(MYSQL_RES *result, MYSQL_ROW_OFFSET);
  MYSQL_FIELD_OFFSET (STDCALL *mysql_field_seek)(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset);
  MYSQL_ROW (STDCALL *mysql_fetch_row)(MYSQL_RES *result);
  unsigned long * (STDCALL *mysql_fetch_lengths)(MYSQL_RES *result);
  MYSQL_FIELD * (STDCALL *mysql_fetch_field)(MYSQL_RES *result);
  unsigned long (STDCALL *mysql_escape_string)(char *to,const char *from, unsigned long from_length);
  unsigned long (STDCALL *mysql_real_escape_string)(MYSQL *mysql, char *to,const char *from, unsigned long length);
  unsigned int (STDCALL *mysql_thread_safe)(void);
  unsigned int (STDCALL *mysql_warning_count)(MYSQL *mysql);
  const char * (STDCALL *mysql_sqlstate)(MYSQL *mysql);
  int (STDCALL *mysql_server_init)(int argc, char **argv, char **groups);
  void (STDCALL *mysql_server_end)(void);
  void (STDCALL *mysql_thread_end)(void);
  my_bool (STDCALL *mysql_thread_init)(void);
  int (STDCALL *mysql_set_server_option)(MYSQL *mysql, enum enum_mysql_set_option option);
  const char * (STDCALL *mysql_get_client_info)(void);
  unsigned long (STDCALL *mysql_get_client_version)(void);
  my_bool (STDCALL *mariadb_connection)(MYSQL *mysql);
  const char * (STDCALL *mysql_get_server_name)(MYSQL *mysql);
  MARIADB_CHARSET_INFO * (STDCALL *mariadb_get_charset_by_name)(const char *csname);
  MARIADB_CHARSET_INFO * (STDCALL *mariadb_get_charset_by_nr)(unsigned int csnr);
  size_t (STDCALL *mariadb_convert_string)(const char *from, size_t *from_len, MARIADB_CHARSET_INFO *from_cs, char *to, size_t *to_len, MARIADB_CHARSET_INFO *to_cs, int *errorcode);
  int (*mysql_optionsv)(MYSQL *mysql,enum mysql_option option, ...);
  int (*mysql_get_optionv)(MYSQL *mysql, enum mysql_option option, void *arg, ...);
  int (STDCALL *mysql_get_option)(MYSQL *mysql, enum mysql_option option, void *arg);
  unsigned long (STDCALL *mysql_hex_string)(char *to, const char *from, unsigned long len);
  my_socket (STDCALL *mysql_get_socket)(MYSQL *mysql);
  unsigned int (STDCALL *mysql_get_timeout_value)(const MYSQL *mysql);
  unsigned int (STDCALL *mysql_get_timeout_value_ms)(const MYSQL *mysql);
  my_bool (STDCALL *mariadb_reconnect)(MYSQL *mysql);
  MYSQL_STMT * (STDCALL *mysql_stmt_init)(MYSQL *mysql);
  int (STDCALL *mysql_stmt_prepare)(MYSQL_STMT *stmt, const char *query, unsigned long length);
  int (STDCALL *mysql_stmt_execute)(MYSQL_STMT *stmt);
  int (STDCALL *mysql_stmt_fetch)(MYSQL_STMT *stmt);
  int (STDCALL *mysql_stmt_fetch_column)(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset);
  int (STDCALL *mysql_stmt_store_result)(MYSQL_STMT *stmt);
  unsigned long (STDCALL *mysql_stmt_param_count)(MYSQL_STMT * stmt);
  my_bool (STDCALL *mysql_stmt_attr_set)(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *attr);
  my_bool (STDCALL *mysql_stmt_attr_get)(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *attr);
  my_bool (STDCALL *mysql_stmt_bind_param)(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
  my_bool (STDCALL *mysql_stmt_bind_result)(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
  my_bool (STDCALL *mysql_stmt_close)(MYSQL_STMT * stmt);
  my_bool (STDCALL *mysql_stmt_reset)(MYSQL_STMT * stmt);
  my_bool (STDCALL *mysql_stmt_free_result)(MYSQL_STMT *stmt);
  my_bool (STDCALL *mysql_stmt_send_long_data)(MYSQL_STMT *stmt, unsigned int param_number, const char *data, unsigned long length);
  MYSQL_RES *(STDCALL *mysql_stmt_result_metadata)(MYSQL_STMT *stmt);
  MYSQL_RES *(STDCALL *mysql_stmt_param_metadata)(MYSQL_STMT *stmt);
  unsigned int (STDCALL *mysql_stmt_errno)(MYSQL_STMT * stmt);
  const char *(STDCALL *mysql_stmt_error)(MYSQL_STMT * stmt);
  const char *(STDCALL *mysql_stmt_sqlstate)(MYSQL_STMT * stmt);
  MYSQL_ROW_OFFSET (STDCALL *mysql_stmt_row_seek)(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET offset);
  MYSQL_ROW_OFFSET (STDCALL *mysql_stmt_row_tell)(MYSQL_STMT *stmt);
  void (STDCALL *mysql_stmt_data_seek)(MYSQL_STMT *stmt, unsigned long long offset);
  unsigned long long (STDCALL *mysql_stmt_num_rows)(MYSQL_STMT *stmt);
  unsigned long long (STDCALL *mysql_stmt_affected_rows)(MYSQL_STMT *stmt);
  unsigned long long (STDCALL *mysql_stmt_insert_id)(MYSQL_STMT *stmt);
  unsigned int (STDCALL *mysql_stmt_field_count)(MYSQL_STMT *stmt);
  int (STDCALL *mysql_stmt_next_result)(MYSQL_STMT *stmt);
  my_bool (STDCALL *mysql_stmt_more_results)(MYSQL_STMT *stmt);
  int (STDCALL *mariadb_stmt_execute_direct)(MYSQL_STMT *stmt, const char *stmtstr, size_t length);
  int (STDCALL *mysql_reset_connection)(MYSQL *mysql);
};
  
/* these methods can be overwritten by db plugins */
struct st_mariadb_methods {
  MYSQL *(*db_connect)(MYSQL *mysql, const char *host, const char *user, const char *passwd,
					   const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag);
  void (*db_close)(MYSQL *mysql);
  int (*db_command)(MYSQL *mysql,enum enum_server_command command, const char *arg,
                    size_t length, my_bool skip_check, void *opt_arg);
  void (*db_skip_result)(MYSQL *mysql);
  int (*db_read_query_result)(MYSQL *mysql);
  MYSQL_DATA *(*db_read_rows)(MYSQL *mysql,MYSQL_FIELD *fields, unsigned int field_count);
  int (*db_read_one_row)(MYSQL *mysql,unsigned int fields,MYSQL_ROW row, unsigned long *lengths);
  /* prepared statements */
  my_bool (*db_supported_buffer_type)(enum enum_field_types type);
  my_bool (*db_read_prepare_response)(MYSQL_STMT *stmt);
  int (*db_read_stmt_result)(MYSQL *mysql);
  my_bool (*db_stmt_get_result_metadata)(MYSQL_STMT *stmt);
  my_bool (*db_stmt_get_param_metadata)(MYSQL_STMT *stmt);
  int (*db_stmt_read_all_rows)(MYSQL_STMT *stmt);
  int (*db_stmt_fetch)(MYSQL_STMT *stmt, unsigned char **row);
  int (*db_stmt_fetch_to_bind)(MYSQL_STMT *stmt, unsigned char *row);
  void (*db_stmt_flush_unbuffered)(MYSQL_STMT *stmt);
  void (*set_error)(MYSQL *mysql, unsigned int error_nr, const char *sqlstate, const char *format, ...);
  void (*invalidate_stmts)(MYSQL *mysql, const char *function_name);
  struct st_mariadb_api *api;
  int (*db_read_execute_response)(MYSQL_STMT *stmt);
  unsigned char* (*db_execute_generate_request)(MYSQL_STMT *stmt, size_t *request_len, my_bool internal);
};

/* synonyms/aliases functions */
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#define mysql_library_init mysql_server_init
#define mysql_library_end mysql_server_end
#define mariadb_connect(hdl, conn_str) mysql_real_connect((hdl),(conn_str), NULL, NULL, NULL, 0, NULL, 0)

/* new api functions */

#define HAVE_MYSQL_REAL_CONNECT


#ifdef	__cplusplus
}
#endif

#endif
my_alloca.h000064400000000224150400264030006645 0ustar00/* Do not edit this file directly, it was auto-generated by cmake */

#warning This file should not be included by clients, include only <mysql.h>

mysqld_error.h000064400000135573150400264030007447 0ustar00/* Autogenerated file, please don't edit */

#ifndef ER_ERROR_FIRST
#define ER_ERROR_FIRST 1000
#define ER_HASHCHK 1000
#define ER_NISAMCHK 1001
#define ER_NO 1002
#define ER_YES 1003
#define ER_CANT_CREATE_FILE 1004
#define ER_CANT_CREATE_TABLE 1005
#define ER_CANT_CREATE_DB 1006
#define ER_DB_CREATE_EXISTS 1007
#define ER_DB_DROP_EXISTS 1008
#define ER_DB_DROP_DELETE 1009
#define ER_DB_DROP_RMDIR 1010
#define ER_CANT_DELETE_FILE 1011
#define ER_CANT_FIND_SYSTEM_REC 1012
#define ER_CANT_GET_STAT 1013
#define ER_CANT_GET_WD 1014
#define ER_CANT_LOCK 1015
#define ER_CANT_OPEN_FILE 1016
#define ER_FILE_NOT_FOUND 1017
#define ER_CANT_READ_DIR 1018
#define ER_CANT_SET_WD 1019
#define ER_CHECKREAD 1020
#define ER_DISK_FULL 1021
#define ER_DUP_KEY 1022
#define ER_ERROR_ON_CLOSE 1023
#define ER_ERROR_ON_READ 1024
#define ER_ERROR_ON_RENAME 1025
#define ER_ERROR_ON_WRITE 1026
#define ER_FILE_USED 1027
#define ER_FILSORT_ABORT 1028
#define ER_FORM_NOT_FOUND 1029
#define ER_GET_ERRNO 1030
#define ER_ILLEGAL_HA 1031
#define ER_KEY_NOT_FOUND 1032
#define ER_NOT_FORM_FILE 1033
#define ER_NOT_KEYFILE 1034
#define ER_OLD_KEYFILE 1035
#define ER_OPEN_AS_READONLY 1036
#define ER_OUTOFMEMORY 1037
#define ER_OUT_OF_SORTMEMORY 1038
#define ER_UNEXPECTED_EOF 1039
#define ER_CON_COUNT_ERROR 1040
#define ER_OUT_OF_RESOURCES 1041
#define ER_BAD_HOST_ERROR 1042
#define ER_HANDSHAKE_ERROR 1043
#define ER_DBACCESS_DENIED_ERROR 1044
#define ER_ACCESS_DENIED_ERROR 1045
#define ER_NO_DB_ERROR 1046
#define ER_UNKNOWN_COM_ERROR 1047
#define ER_BAD_NULL_ERROR 1048
#define ER_BAD_DB_ERROR 1049
#define ER_TABLE_EXISTS_ERROR 1050
#define ER_BAD_TABLE_ERROR 1051
#define ER_NON_UNIQ_ERROR 1052
#define ER_SERVER_SHUTDOWN 1053
#define ER_BAD_FIELD_ERROR 1054
#define ER_WRONG_FIELD_WITH_GROUP 1055
#define ER_WRONG_GROUP_FIELD 1056
#define ER_WRONG_SUM_SELECT 1057
#define ER_WRONG_VALUE_COUNT 1058
#define ER_TOO_LONG_IDENT 1059
#define ER_DUP_FIELDNAME 1060
#define ER_DUP_KEYNAME 1061
#define ER_DUP_ENTRY 1062
#define ER_WRONG_FIELD_SPEC 1063
#define ER_PARSE_ERROR 1064
#define ER_EMPTY_QUERY 1065
#define ER_NONUNIQ_TABLE 1066
#define ER_INVALID_DEFAULT 1067
#define ER_MULTIPLE_PRI_KEY 1068
#define ER_TOO_MANY_KEYS 1069
#define ER_TOO_MANY_KEY_PARTS 1070
#define ER_TOO_LONG_KEY 1071
#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072
#define ER_BLOB_USED_AS_KEY 1073
#define ER_TOO_BIG_FIELDLENGTH 1074
#define ER_WRONG_AUTO_KEY 1075
#define ER_BINLOG_CANT_DELETE_GTID_DOMAIN 1076
#define ER_NORMAL_SHUTDOWN 1077
#define ER_GOT_SIGNAL 1078
#define ER_SHUTDOWN_COMPLETE 1079
#define ER_FORCING_CLOSE 1080
#define ER_IPSOCK_ERROR 1081
#define ER_NO_SUCH_INDEX 1082
#define ER_WRONG_FIELD_TERMINATORS 1083
#define ER_BLOBS_AND_NO_TERMINATED 1084
#define ER_TEXTFILE_NOT_READABLE 1085
#define ER_FILE_EXISTS_ERROR 1086
#define ER_LOAD_INFO 1087
#define ER_ALTER_INFO 1088
#define ER_WRONG_SUB_KEY 1089
#define ER_CANT_REMOVE_ALL_FIELDS 1090
#define ER_CANT_DROP_FIELD_OR_KEY 1091
#define ER_INSERT_INFO 1092
#define ER_UPDATE_TABLE_USED 1093
#define ER_NO_SUCH_THREAD 1094
#define ER_KILL_DENIED_ERROR 1095
#define ER_NO_TABLES_USED 1096
#define ER_TOO_BIG_SET 1097
#define ER_NO_UNIQUE_LOGFILE 1098
#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099
#define ER_TABLE_NOT_LOCKED 1100
#define ER_UNUSED_17 1101
#define ER_WRONG_DB_NAME 1102
#define ER_WRONG_TABLE_NAME 1103
#define ER_TOO_BIG_SELECT 1104
#define ER_UNKNOWN_ERROR 1105
#define ER_UNKNOWN_PROCEDURE 1106
#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107
#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108
#define ER_UNKNOWN_TABLE 1109
#define ER_FIELD_SPECIFIED_TWICE 1110
#define ER_INVALID_GROUP_FUNC_USE 1111
#define ER_UNSUPPORTED_EXTENSION 1112
#define ER_TABLE_MUST_HAVE_COLUMNS 1113
#define ER_RECORD_FILE_FULL 1114
#define ER_UNKNOWN_CHARACTER_SET 1115
#define ER_TOO_MANY_TABLES 1116
#define ER_TOO_MANY_FIELDS 1117
#define ER_TOO_BIG_ROWSIZE 1118
#define ER_STACK_OVERRUN 1119
#define ER_WRONG_OUTER_JOIN 1120
#define ER_NULL_COLUMN_IN_INDEX 1121
#define ER_CANT_FIND_UDF 1122
#define ER_CANT_INITIALIZE_UDF 1123
#define ER_UDF_NO_PATHS 1124
#define ER_UDF_EXISTS 1125
#define ER_CANT_OPEN_LIBRARY 1126
#define ER_CANT_FIND_DL_ENTRY 1127
#define ER_FUNCTION_NOT_DEFINED 1128
#define ER_HOST_IS_BLOCKED 1129
#define ER_HOST_NOT_PRIVILEGED 1130
#define ER_PASSWORD_ANONYMOUS_USER 1131
#define ER_PASSWORD_NOT_ALLOWED 1132
#define ER_PASSWORD_NO_MATCH 1133
#define ER_UPDATE_INFO 1134
#define ER_CANT_CREATE_THREAD 1135
#define ER_WRONG_VALUE_COUNT_ON_ROW 1136
#define ER_CANT_REOPEN_TABLE 1137
#define ER_INVALID_USE_OF_NULL 1138
#define ER_REGEXP_ERROR 1139
#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140
#define ER_NONEXISTING_GRANT 1141
#define ER_TABLEACCESS_DENIED_ERROR 1142
#define ER_COLUMNACCESS_DENIED_ERROR 1143
#define ER_ILLEGAL_GRANT_FOR_TABLE 1144
#define ER_GRANT_WRONG_HOST_OR_USER 1145
#define ER_NO_SUCH_TABLE 1146
#define ER_NONEXISTING_TABLE_GRANT 1147
#define ER_NOT_ALLOWED_COMMAND 1148
#define ER_SYNTAX_ERROR 1149
#define ER_DELAYED_CANT_CHANGE_LOCK 1150
#define ER_TOO_MANY_DELAYED_THREADS 1151
#define ER_ABORTING_CONNECTION 1152
#define ER_NET_PACKET_TOO_LARGE 1153
#define ER_NET_READ_ERROR_FROM_PIPE 1154
#define ER_NET_FCNTL_ERROR 1155
#define ER_NET_PACKETS_OUT_OF_ORDER 1156
#define ER_NET_UNCOMPRESS_ERROR 1157
#define ER_NET_READ_ERROR 1158
#define ER_NET_READ_INTERRUPTED 1159
#define ER_NET_ERROR_ON_WRITE 1160
#define ER_NET_WRITE_INTERRUPTED 1161
#define ER_TOO_LONG_STRING 1162
#define ER_TABLE_CANT_HANDLE_BLOB 1163
#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164
#define ER_DELAYED_INSERT_TABLE_LOCKED 1165
#define ER_WRONG_COLUMN_NAME 1166
#define ER_WRONG_KEY_COLUMN 1167
#define ER_WRONG_MRG_TABLE 1168
#define ER_DUP_UNIQUE 1169
#define ER_BLOB_KEY_WITHOUT_LENGTH 1170
#define ER_PRIMARY_CANT_HAVE_NULL 1171
#define ER_TOO_MANY_ROWS 1172
#define ER_REQUIRES_PRIMARY_KEY 1173
#define ER_NO_RAID_COMPILED 1174
#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175
#define ER_KEY_DOES_NOT_EXISTS 1176
#define ER_CHECK_NO_SUCH_TABLE 1177
#define ER_CHECK_NOT_IMPLEMENTED 1178
#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179
#define ER_ERROR_DURING_COMMIT 1180
#define ER_ERROR_DURING_ROLLBACK 1181
#define ER_ERROR_DURING_FLUSH_LOGS 1182
#define ER_ERROR_DURING_CHECKPOINT 1183
#define ER_NEW_ABORTING_CONNECTION 1184
#define ER_UNUSED_10 1185
#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186
#define ER_INDEX_REBUILD 1187
#define ER_MASTER 1188
#define ER_MASTER_NET_READ 1189
#define ER_MASTER_NET_WRITE 1190
#define ER_FT_MATCHING_KEY_NOT_FOUND 1191
#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192
#define ER_UNKNOWN_SYSTEM_VARIABLE 1193
#define ER_CRASHED_ON_USAGE 1194
#define ER_CRASHED_ON_REPAIR 1195
#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196
#define ER_TRANS_CACHE_FULL 1197
#define ER_SLAVE_MUST_STOP 1198
#define ER_SLAVE_NOT_RUNNING 1199
#define ER_BAD_SLAVE 1200
#define ER_MASTER_INFO 1201
#define ER_SLAVE_THREAD 1202
#define ER_TOO_MANY_USER_CONNECTIONS 1203
#define ER_SET_CONSTANTS_ONLY 1204
#define ER_LOCK_WAIT_TIMEOUT 1205
#define ER_LOCK_TABLE_FULL 1206
#define ER_READ_ONLY_TRANSACTION 1207
#define ER_DROP_DB_WITH_READ_LOCK 1208
#define ER_CREATE_DB_WITH_READ_LOCK 1209
#define ER_WRONG_ARGUMENTS 1210
#define ER_NO_PERMISSION_TO_CREATE_USER 1211
#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212
#define ER_LOCK_DEADLOCK 1213
#define ER_TABLE_CANT_HANDLE_FT 1214
#define ER_CANNOT_ADD_FOREIGN 1215
#define ER_NO_REFERENCED_ROW 1216
#define ER_ROW_IS_REFERENCED 1217
#define ER_CONNECT_TO_MASTER 1218
#define ER_QUERY_ON_MASTER 1219
#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220
#define ER_WRONG_USAGE 1221
#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222
#define ER_CANT_UPDATE_WITH_READLOCK 1223
#define ER_MIXING_NOT_ALLOWED 1224
#define ER_DUP_ARGUMENT 1225
#define ER_USER_LIMIT_REACHED 1226
#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227
#define ER_LOCAL_VARIABLE 1228
#define ER_GLOBAL_VARIABLE 1229
#define ER_NO_DEFAULT 1230
#define ER_WRONG_VALUE_FOR_VAR 1231
#define ER_WRONG_TYPE_FOR_VAR 1232
#define ER_VAR_CANT_BE_READ 1233
#define ER_CANT_USE_OPTION_HERE 1234
#define ER_NOT_SUPPORTED_YET 1235
#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
#define ER_SLAVE_IGNORED_TABLE 1237
#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
#define ER_WRONG_FK_DEF 1239
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
#define ER_OPERAND_COLUMNS 1241
#define ER_SUBQUERY_NO_1_ROW 1242
#define ER_UNKNOWN_STMT_HANDLER 1243
#define ER_CORRUPT_HELP_DB 1244
#define ER_CYCLIC_REFERENCE 1245
#define ER_AUTO_CONVERT 1246
#define ER_ILLEGAL_REFERENCE 1247
#define ER_DERIVED_MUST_HAVE_ALIAS 1248
#define ER_SELECT_REDUCED 1249
#define ER_TABLENAME_NOT_ALLOWED_HERE 1250
#define ER_NOT_SUPPORTED_AUTH_MODE 1251
#define ER_SPATIAL_CANT_HAVE_NULL 1252
#define ER_COLLATION_CHARSET_MISMATCH 1253
#define ER_SLAVE_WAS_RUNNING 1254
#define ER_SLAVE_WAS_NOT_RUNNING 1255
#define ER_TOO_BIG_FOR_UNCOMPRESS 1256
#define ER_ZLIB_Z_MEM_ERROR 1257
#define ER_ZLIB_Z_BUF_ERROR 1258
#define ER_ZLIB_Z_DATA_ERROR 1259
#define ER_CUT_VALUE_GROUP_CONCAT 1260
#define ER_WARN_TOO_FEW_RECORDS 1261
#define ER_WARN_TOO_MANY_RECORDS 1262
#define ER_WARN_NULL_TO_NOTNULL 1263
#define ER_WARN_DATA_OUT_OF_RANGE 1264
#define WARN_DATA_TRUNCATED 1265
#define ER_WARN_USING_OTHER_HANDLER 1266
#define ER_CANT_AGGREGATE_2COLLATIONS 1267
#define ER_DROP_USER 1268
#define ER_REVOKE_GRANTS 1269
#define ER_CANT_AGGREGATE_3COLLATIONS 1270
#define ER_CANT_AGGREGATE_NCOLLATIONS 1271
#define ER_VARIABLE_IS_NOT_STRUCT 1272
#define ER_UNKNOWN_COLLATION 1273
#define ER_SLAVE_IGNORED_SSL_PARAMS 1274
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
#define ER_WARN_FIELD_RESOLVED 1276
#define ER_BAD_SLAVE_UNTIL_COND 1277
#define ER_MISSING_SKIP_SLAVE 1278
#define ER_UNTIL_COND_IGNORED 1279
#define ER_WRONG_NAME_FOR_INDEX 1280
#define ER_WRONG_NAME_FOR_CATALOG 1281
#define ER_WARN_QC_RESIZE 1282
#define ER_BAD_FT_COLUMN 1283
#define ER_UNKNOWN_KEY_CACHE 1284
#define ER_WARN_HOSTNAME_WONT_WORK 1285
#define ER_UNKNOWN_STORAGE_ENGINE 1286
#define ER_WARN_DEPRECATED_SYNTAX 1287
#define ER_NON_UPDATABLE_TABLE 1288
#define ER_FEATURE_DISABLED 1289
#define ER_OPTION_PREVENTS_STATEMENT 1290
#define ER_DUPLICATED_VALUE_IN_TYPE 1291
#define ER_TRUNCATED_WRONG_VALUE 1292
#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
#define ER_INVALID_ON_UPDATE 1294
#define ER_UNSUPPORTED_PS 1295
#define ER_GET_ERRMSG 1296
#define ER_GET_TEMPORARY_ERRMSG 1297
#define ER_UNKNOWN_TIME_ZONE 1298
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_CONFLICTING_DECLARATIONS 1302
#define ER_SP_NO_RECURSIVE_CREATE 1303
#define ER_SP_ALREADY_EXISTS 1304
#define ER_SP_DOES_NOT_EXIST 1305
#define ER_SP_DROP_FAILED 1306
#define ER_SP_STORE_FAILED 1307
#define ER_SP_LILABEL_MISMATCH 1308
#define ER_SP_LABEL_REDEFINE 1309
#define ER_SP_LABEL_MISMATCH 1310
#define ER_SP_UNINIT_VAR 1311
#define ER_SP_BADSELECT 1312
#define ER_SP_BADRETURN 1313
#define ER_SP_BADSTATEMENT 1314
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316
#define ER_QUERY_INTERRUPTED 1317
#define ER_SP_WRONG_NO_OF_ARGS 1318
#define ER_SP_COND_MISMATCH 1319
#define ER_SP_NORETURN 1320
#define ER_SP_NORETURNEND 1321
#define ER_SP_BAD_CURSOR_QUERY 1322
#define ER_SP_BAD_CURSOR_SELECT 1323
#define ER_SP_CURSOR_MISMATCH 1324
#define ER_SP_CURSOR_ALREADY_OPEN 1325
#define ER_SP_CURSOR_NOT_OPEN 1326
#define ER_SP_UNDECLARED_VAR 1327
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328
#define ER_SP_FETCH_NO_DATA 1329
#define ER_SP_DUP_PARAM 1330
#define ER_SP_DUP_VAR 1331
#define ER_SP_DUP_COND 1332
#define ER_SP_DUP_CURS 1333
#define ER_SP_CANT_ALTER 1334
#define ER_SP_SUBSELECT_NYI 1335
#define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1337
#define ER_SP_CURSOR_AFTER_HANDLER 1338
#define ER_SP_CASE_NOT_FOUND 1339
#define ER_FPARSER_TOO_BIG_FILE 1340
#define ER_FPARSER_BAD_HEADER 1341
#define ER_FPARSER_EOF_IN_COMMENT 1342
#define ER_FPARSER_ERROR_IN_PARAMETER 1343
#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344
#define ER_VIEW_NO_EXPLAIN 1345
#define ER_FRM_UNKNOWN_TYPE 1346
#define ER_WRONG_OBJECT 1347
#define ER_NONUPDATEABLE_COLUMN 1348
#define ER_VIEW_SELECT_DERIVED 1349
#define ER_VIEW_SELECT_CLAUSE 1350
#define ER_VIEW_SELECT_VARIABLE 1351
#define ER_VIEW_SELECT_TMPTABLE 1352
#define ER_VIEW_WRONG_LIST 1353
#define ER_WARN_VIEW_MERGE 1354
#define ER_WARN_VIEW_WITHOUT_KEY 1355
#define ER_VIEW_INVALID 1356
#define ER_SP_NO_DROP_SP 1357
#define ER_SP_GOTO_IN_HNDLR 1358
#define ER_TRG_ALREADY_EXISTS 1359
#define ER_TRG_DOES_NOT_EXIST 1360
#define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361
#define ER_TRG_CANT_CHANGE_ROW 1362
#define ER_TRG_NO_SUCH_ROW_IN_TRG 1363
#define ER_NO_DEFAULT_FOR_FIELD 1364
#define ER_DIVISION_BY_ZERO 1365
#define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366
#define ER_ILLEGAL_VALUE_FOR_TYPE 1367
#define ER_VIEW_NONUPD_CHECK 1368
#define ER_VIEW_CHECK_FAILED 1369
#define ER_PROCACCESS_DENIED_ERROR 1370
#define ER_RELAY_LOG_FAIL 1371
#define ER_PASSWD_LENGTH 1372
#define ER_UNKNOWN_TARGET_BINLOG 1373
#define ER_IO_ERR_LOG_INDEX_READ 1374
#define ER_BINLOG_PURGE_PROHIBITED 1375
#define ER_FSEEK_FAIL 1376
#define ER_BINLOG_PURGE_FATAL_ERR 1377
#define ER_LOG_IN_USE 1378
#define ER_LOG_PURGE_UNKNOWN_ERR 1379
#define ER_RELAY_LOG_INIT 1380
#define ER_NO_BINARY_LOGGING 1381
#define ER_RESERVED_SYNTAX 1382
#define ER_WSAS_FAILED 1383
#define ER_DIFF_GROUPS_PROC 1384
#define ER_NO_GROUP_FOR_PROC 1385
#define ER_ORDER_WITH_PROC 1386
#define ER_LOGGING_PROHIBIT_CHANGING_OF 1387
#define ER_NO_FILE_MAPPING 1388
#define ER_WRONG_MAGIC 1389
#define ER_PS_MANY_PARAM 1390
#define ER_KEY_PART_0 1391
#define ER_VIEW_CHECKSUM 1392
#define ER_VIEW_MULTIUPDATE 1393
#define ER_VIEW_NO_INSERT_FIELD_LIST 1394
#define ER_VIEW_DELETE_MERGE_VIEW 1395
#define ER_CANNOT_USER 1396
#define ER_XAER_NOTA 1397
#define ER_XAER_INVAL 1398
#define ER_XAER_RMFAIL 1399
#define ER_XAER_OUTSIDE 1400
#define ER_XAER_RMERR 1401
#define ER_XA_RBROLLBACK 1402
#define ER_NONEXISTING_PROC_GRANT 1403
#define ER_PROC_AUTO_GRANT_FAIL 1404
#define ER_PROC_AUTO_REVOKE_FAIL 1405
#define ER_DATA_TOO_LONG 1406
#define ER_SP_BAD_SQLSTATE 1407
#define ER_STARTUP 1408
#define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409
#define ER_CANT_CREATE_USER_WITH_GRANT 1410
#define ER_WRONG_VALUE_FOR_TYPE 1411
#define ER_TABLE_DEF_CHANGED 1412
#define ER_SP_DUP_HANDLER 1413
#define ER_SP_NOT_VAR_ARG 1414
#define ER_SP_NO_RETSET 1415
#define ER_CANT_CREATE_GEOMETRY_OBJECT 1416
#define ER_FAILED_ROUTINE_BREAK_BINLOG 1417
#define ER_BINLOG_UNSAFE_ROUTINE 1418
#define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419
#define ER_EXEC_STMT_WITH_OPEN_CURSOR 1420
#define ER_STMT_HAS_NO_OPEN_CURSOR 1421
#define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422
#define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423
#define ER_SP_NO_RECURSION 1424
#define ER_TOO_BIG_SCALE 1425
#define ER_TOO_BIG_PRECISION 1426
#define ER_M_BIGGER_THAN_D 1427
#define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428
#define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429
#define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430
#define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431
#define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432
#define ER_FOREIGN_DATA_STRING_INVALID 1433
#define ER_CANT_CREATE_FEDERATED_TABLE 1434
#define ER_TRG_IN_WRONG_SCHEMA 1435
#define ER_STACK_OVERRUN_NEED_MORE 1436
#define ER_TOO_LONG_BODY 1437
#define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438
#define ER_TOO_BIG_DISPLAYWIDTH 1439
#define ER_XAER_DUPID 1440
#define ER_DATETIME_FUNCTION_OVERFLOW 1441
#define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442
#define ER_VIEW_PREVENT_UPDATE 1443
#define ER_PS_NO_RECURSION 1444
#define ER_SP_CANT_SET_AUTOCOMMIT 1445
#define ER_MALFORMED_DEFINER 1446
#define ER_VIEW_FRM_NO_USER 1447
#define ER_VIEW_OTHER_USER 1448
#define ER_NO_SUCH_USER 1449
#define ER_FORBID_SCHEMA_CHANGE 1450
#define ER_ROW_IS_REFERENCED_2 1451
#define ER_NO_REFERENCED_ROW_2 1452
#define ER_SP_BAD_VAR_SHADOW 1453
#define ER_TRG_NO_DEFINER 1454
#define ER_OLD_FILE_FORMAT 1455
#define ER_SP_RECURSION_LIMIT 1456
#define ER_SP_PROC_TABLE_CORRUPT 1457
#define ER_SP_WRONG_NAME 1458
#define ER_TABLE_NEEDS_UPGRADE 1459
#define ER_SP_NO_AGGREGATE 1460
#define ER_MAX_PREPARED_STMT_COUNT_REACHED 1461
#define ER_VIEW_RECURSIVE 1462
#define ER_NON_GROUPING_FIELD_USED 1463
#define ER_TABLE_CANT_HANDLE_SPKEYS 1464
#define ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA 1465
#define ER_REMOVED_SPACES 1466
#define ER_AUTOINC_READ_FAILED 1467
#define ER_USERNAME 1468
#define ER_HOSTNAME 1469
#define ER_WRONG_STRING_LENGTH 1470
#define ER_NON_INSERTABLE_TABLE 1471
#define ER_ADMIN_WRONG_MRG_TABLE 1472
#define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473
#define ER_NAME_BECOMES_EMPTY 1474
#define ER_AMBIGUOUS_FIELD_TERM 1475
#define ER_FOREIGN_SERVER_EXISTS 1476
#define ER_FOREIGN_SERVER_DOESNT_EXIST 1477
#define ER_ILLEGAL_HA_CREATE_OPTION 1478
#define ER_PARTITION_REQUIRES_VALUES_ERROR 1479
#define ER_PARTITION_WRONG_VALUES_ERROR 1480
#define ER_PARTITION_MAXVALUE_ERROR 1481
#define ER_PARTITION_SUBPARTITION_ERROR 1482
#define ER_PARTITION_SUBPART_MIX_ERROR 1483
#define ER_PARTITION_WRONG_NO_PART_ERROR 1484
#define ER_PARTITION_WRONG_NO_SUBPART_ERROR 1485
#define ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR 1486
#define ER_NOT_CONSTANT_EXPRESSION 1487
#define ER_FIELD_NOT_FOUND_PART_ERROR 1488
#define ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR 1489
#define ER_INCONSISTENT_PARTITION_INFO_ERROR 1490
#define ER_PARTITION_FUNC_NOT_ALLOWED_ERROR 1491
#define ER_PARTITIONS_MUST_BE_DEFINED_ERROR 1492
#define ER_RANGE_NOT_INCREASING_ERROR 1493
#define ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR 1494
#define ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR 1495
#define ER_PARTITION_ENTRY_ERROR 1496
#define ER_MIX_HANDLER_ERROR 1497
#define ER_PARTITION_NOT_DEFINED_ERROR 1498
#define ER_TOO_MANY_PARTITIONS_ERROR 1499
#define ER_SUBPARTITION_ERROR 1500
#define ER_CANT_CREATE_HANDLER_FILE 1501
#define ER_BLOB_FIELD_IN_PART_FUNC_ERROR 1502
#define ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF 1503
#define ER_NO_PARTS_ERROR 1504
#define ER_PARTITION_MGMT_ON_NONPARTITIONED 1505
#define ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING 1506
#define ER_DROP_PARTITION_NON_EXISTENT 1507
#define ER_DROP_LAST_PARTITION 1508
#define ER_COALESCE_ONLY_ON_HASH_PARTITION 1509
#define ER_REORG_HASH_ONLY_ON_SAME_NO 1510
#define ER_REORG_NO_PARAM_ERROR 1511
#define ER_ONLY_ON_RANGE_LIST_PARTITION 1512
#define ER_ADD_PARTITION_SUBPART_ERROR 1513
#define ER_ADD_PARTITION_NO_NEW_PARTITION 1514
#define ER_COALESCE_PARTITION_NO_PARTITION 1515
#define ER_REORG_PARTITION_NOT_EXIST 1516
#define ER_SAME_NAME_PARTITION 1517
#define ER_NO_BINLOG_ERROR 1518
#define ER_CONSECUTIVE_REORG_PARTITIONS 1519
#define ER_REORG_OUTSIDE_RANGE 1520
#define ER_PARTITION_FUNCTION_FAILURE 1521
#define ER_PART_STATE_ERROR 1522
#define ER_LIMITED_PART_RANGE 1523
#define ER_PLUGIN_IS_NOT_LOADED 1524
#define ER_WRONG_VALUE 1525
#define ER_NO_PARTITION_FOR_GIVEN_VALUE 1526
#define ER_FILEGROUP_OPTION_ONLY_ONCE 1527
#define ER_CREATE_FILEGROUP_FAILED 1528
#define ER_DROP_FILEGROUP_FAILED 1529
#define ER_TABLESPACE_AUTO_EXTEND_ERROR 1530
#define ER_WRONG_SIZE_NUMBER 1531
#define ER_SIZE_OVERFLOW_ERROR 1532
#define ER_ALTER_FILEGROUP_FAILED 1533
#define ER_BINLOG_ROW_LOGGING_FAILED 1534
#define ER_BINLOG_ROW_WRONG_TABLE_DEF 1535
#define ER_BINLOG_ROW_RBR_TO_SBR 1536
#define ER_EVENT_ALREADY_EXISTS 1537
#define ER_EVENT_STORE_FAILED 1538
#define ER_EVENT_DOES_NOT_EXIST 1539
#define ER_EVENT_CANT_ALTER 1540
#define ER_EVENT_DROP_FAILED 1541
#define ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG 1542
#define ER_EVENT_ENDS_BEFORE_STARTS 1543
#define ER_EVENT_EXEC_TIME_IN_THE_PAST 1544
#define ER_EVENT_OPEN_TABLE_FAILED 1545
#define ER_EVENT_NEITHER_M_EXPR_NOR_M_AT 1546
#define ER_UNUSED_2 1547
#define ER_UNUSED_3 1548
#define ER_EVENT_CANNOT_DELETE 1549
#define ER_EVENT_COMPILE_ERROR 1550
#define ER_EVENT_SAME_NAME 1551
#define ER_EVENT_DATA_TOO_LONG 1552
#define ER_DROP_INDEX_FK 1553
#define ER_WARN_DEPRECATED_SYNTAX_WITH_VER 1554
#define ER_CANT_WRITE_LOCK_LOG_TABLE 1555
#define ER_CANT_LOCK_LOG_TABLE 1556
#define ER_UNUSED_4 1557
#define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE 1558
#define ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR 1559
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT 1560
#define ER_UNUSED_13 1561
#define ER_PARTITION_NO_TEMPORARY 1562
#define ER_PARTITION_CONST_DOMAIN_ERROR 1563
#define ER_PARTITION_FUNCTION_IS_NOT_ALLOWED 1564
#define ER_DDL_LOG_ERROR 1565
#define ER_NULL_IN_VALUES_LESS_THAN 1566
#define ER_WRONG_PARTITION_NAME 1567
#define ER_CANT_CHANGE_TX_CHARACTERISTICS 1568
#define ER_DUP_ENTRY_AUTOINCREMENT_CASE 1569
#define ER_EVENT_MODIFY_QUEUE_ERROR 1570
#define ER_EVENT_SET_VAR_ERROR 1571
#define ER_PARTITION_MERGE_ERROR 1572
#define ER_CANT_ACTIVATE_LOG 1573
#define ER_RBR_NOT_AVAILABLE 1574
#define ER_BASE64_DECODE_ERROR 1575
#define ER_EVENT_RECURSION_FORBIDDEN 1576
#define ER_EVENTS_DB_ERROR 1577
#define ER_ONLY_INTEGERS_ALLOWED 1578
#define ER_UNSUPORTED_LOG_ENGINE 1579
#define ER_BAD_LOG_STATEMENT 1580
#define ER_CANT_RENAME_LOG_TABLE 1581
#define ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 1582
#define ER_WRONG_PARAMETERS_TO_NATIVE_FCT 1583
#define ER_WRONG_PARAMETERS_TO_STORED_FCT 1584
#define ER_NATIVE_FCT_NAME_COLLISION 1585
#define ER_DUP_ENTRY_WITH_KEY_NAME 1586
#define ER_BINLOG_PURGE_EMFILE 1587
#define ER_EVENT_CANNOT_CREATE_IN_THE_PAST 1588
#define ER_EVENT_CANNOT_ALTER_IN_THE_PAST 1589
#define ER_SLAVE_INCIDENT 1590
#define ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT 1591
#define ER_BINLOG_UNSAFE_STATEMENT 1592
#define ER_SLAVE_FATAL_ERROR 1593
#define ER_SLAVE_RELAY_LOG_READ_FAILURE 1594
#define ER_SLAVE_RELAY_LOG_WRITE_FAILURE 1595
#define ER_SLAVE_CREATE_EVENT_FAILURE 1596
#define ER_SLAVE_MASTER_COM_FAILURE 1597
#define ER_BINLOG_LOGGING_IMPOSSIBLE 1598
#define ER_VIEW_NO_CREATION_CTX 1599
#define ER_VIEW_INVALID_CREATION_CTX 1600
#define ER_SR_INVALID_CREATION_CTX 1601
#define ER_TRG_CORRUPTED_FILE 1602
#define ER_TRG_NO_CREATION_CTX 1603
#define ER_TRG_INVALID_CREATION_CTX 1604
#define ER_EVENT_INVALID_CREATION_CTX 1605
#define ER_TRG_CANT_OPEN_TABLE 1606
#define ER_CANT_CREATE_SROUTINE 1607
#define ER_UNUSED_11 1608
#define ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT 1609
#define ER_SLAVE_CORRUPT_EVENT 1610
#define ER_LOAD_DATA_INVALID_COLUMN 1611
#define ER_LOG_PURGE_NO_FILE 1612
#define ER_XA_RBTIMEOUT 1613
#define ER_XA_RBDEADLOCK 1614
#define ER_NEED_REPREPARE 1615
#define ER_DELAYED_NOT_SUPPORTED 1616
#define WARN_NO_MASTER_INFO 1617
#define WARN_OPTION_IGNORED 1618
#define ER_PLUGIN_DELETE_BUILTIN 1619
#define WARN_PLUGIN_BUSY 1620
#define ER_VARIABLE_IS_READONLY 1621
#define ER_WARN_ENGINE_TRANSACTION_ROLLBACK 1622
#define ER_SLAVE_HEARTBEAT_FAILURE 1623
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE 1624
#define ER_UNUSED_14 1625
#define ER_CONFLICT_FN_PARSE_ERROR 1626
#define ER_EXCEPTIONS_WRITE_ERROR 1627
#define ER_TOO_LONG_TABLE_COMMENT 1628
#define ER_TOO_LONG_FIELD_COMMENT 1629
#define ER_FUNC_INEXISTENT_NAME_COLLISION 1630
#define ER_DATABASE_NAME 1631
#define ER_TABLE_NAME 1632
#define ER_PARTITION_NAME 1633
#define ER_SUBPARTITION_NAME 1634
#define ER_TEMPORARY_NAME 1635
#define ER_RENAMED_NAME 1636
#define ER_TOO_MANY_CONCURRENT_TRXS 1637
#define WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED 1638
#define ER_DEBUG_SYNC_TIMEOUT 1639
#define ER_DEBUG_SYNC_HIT_LIMIT 1640
#define ER_DUP_SIGNAL_SET 1641
#define ER_SIGNAL_WARN 1642
#define ER_SIGNAL_NOT_FOUND 1643
#define ER_SIGNAL_EXCEPTION 1644
#define ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 1645
#define ER_SIGNAL_BAD_CONDITION_TYPE 1646
#define WARN_COND_ITEM_TRUNCATED 1647
#define ER_COND_ITEM_TOO_LONG 1648
#define ER_UNKNOWN_LOCALE 1649
#define ER_SLAVE_IGNORE_SERVER_IDS 1650
#define ER_QUERY_CACHE_DISABLED 1651
#define ER_SAME_NAME_PARTITION_FIELD 1652
#define ER_PARTITION_COLUMN_LIST_ERROR 1653
#define ER_WRONG_TYPE_COLUMN_VALUE_ERROR 1654
#define ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR 1655
#define ER_MAXVALUE_IN_VALUES_IN 1656
#define ER_TOO_MANY_VALUES_ERROR 1657
#define ER_ROW_SINGLE_PARTITION_FIELD_ERROR 1658
#define ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD 1659
#define ER_PARTITION_FIELDS_TOO_LONG 1660
#define ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE 1661
#define ER_BINLOG_ROW_MODE_AND_STMT_ENGINE 1662
#define ER_BINLOG_UNSAFE_AND_STMT_ENGINE 1663
#define ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE 1664
#define ER_BINLOG_STMT_MODE_AND_ROW_ENGINE 1665
#define ER_BINLOG_ROW_INJECTION_AND_STMT_MODE 1666
#define ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1667
#define ER_BINLOG_UNSAFE_LIMIT 1668
#define ER_BINLOG_UNSAFE_INSERT_DELAYED 1669
#define ER_BINLOG_UNSAFE_SYSTEM_TABLE 1670
#define ER_BINLOG_UNSAFE_AUTOINC_COLUMNS 1671
#define ER_BINLOG_UNSAFE_UDF 1672
#define ER_BINLOG_UNSAFE_SYSTEM_VARIABLE 1673
#define ER_BINLOG_UNSAFE_SYSTEM_FUNCTION 1674
#define ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS 1675
#define ER_MESSAGE_AND_STATEMENT 1676
#define ER_SLAVE_CONVERSION_FAILED 1677
#define ER_SLAVE_CANT_CREATE_CONVERSION 1678
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT 1679
#define ER_PATH_LENGTH 1680
#define ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT 1681
#define ER_WRONG_NATIVE_TABLE_STRUCTURE 1682
#define ER_WRONG_PERFSCHEMA_USAGE 1683
#define ER_WARN_I_S_SKIPPED_TABLE 1684
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT 1685
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT 1686
#define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687
#define ER_TOO_LONG_INDEX_COMMENT 1688
#define ER_LOCK_ABORTED 1689
#define ER_DATA_OUT_OF_RANGE 1690
#define ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691
#define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692
#define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695
#define ER_FAILED_READ_FROM_PAR_FILE 1696
#define ER_VALUES_IS_NOT_INT_TYPE_ERROR 1697
#define ER_ACCESS_DENIED_NO_PASSWORD_ERROR 1698
#define ER_SET_PASSWORD_AUTH_PLUGIN 1699
#define ER_GRANT_PLUGIN_USER_EXISTS 1700
#define ER_TRUNCATE_ILLEGAL_FK 1701
#define ER_PLUGIN_IS_PERMANENT 1702
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN 1703
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX 1704
#define ER_STMT_CACHE_FULL 1705
#define ER_MULTI_UPDATE_KEY_CONFLICT 1706
#define ER_TABLE_NEEDS_REBUILD 1707
#define WARN_OPTION_BELOW_LIMIT 1708
#define ER_INDEX_COLUMN_TOO_LONG 1709
#define ER_ERROR_IN_TRIGGER_BODY 1710
#define ER_ERROR_IN_UNKNOWN_TRIGGER_BODY 1711
#define ER_INDEX_CORRUPT 1712
#define ER_UNDO_RECORD_TOO_BIG 1713
#define ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT 1714
#define ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE 1715
#define ER_BINLOG_UNSAFE_REPLACE_SELECT 1716
#define ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT 1717
#define ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT 1718
#define ER_BINLOG_UNSAFE_UPDATE_IGNORE 1719
#define ER_UNUSED_15 1720
#define ER_UNUSED_16 1721
#define ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT 1722
#define ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC 1723
#define ER_BINLOG_UNSAFE_INSERT_TWO_KEYS 1724
#define ER_UNUSED_28 1725
#define ER_VERS_NOT_ALLOWED 1726
#define ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST 1727
#define ER_CANNOT_LOAD_FROM_TABLE_V2 1728
#define ER_MASTER_DELAY_VALUE_OUT_OF_RANGE 1729
#define ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT 1730
#define ER_PARTITION_EXCHANGE_DIFFERENT_OPTION 1731
#define ER_PARTITION_EXCHANGE_PART_TABLE 1732
#define ER_PARTITION_EXCHANGE_TEMP_TABLE 1733
#define ER_PARTITION_INSTEAD_OF_SUBPARTITION 1734
#define ER_UNKNOWN_PARTITION 1735
#define ER_TABLES_DIFFERENT_METADATA 1736
#define ER_ROW_DOES_NOT_MATCH_PARTITION 1737
#define ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX 1738
#define ER_WARN_INDEX_NOT_APPLICABLE 1739
#define ER_PARTITION_EXCHANGE_FOREIGN_KEY 1740
#define ER_NO_SUCH_KEY_VALUE 1741
#define ER_VALUE_TOO_LONG 1742
#define ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE 1743
#define ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE 1744
#define ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX 1745
#define ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT 1746
#define ER_PARTITION_CLAUSE_ON_NONPARTITIONED 1747
#define ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET 1748
#define ER_UNUSED_5 1749
#define ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE 1750
#define ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE 1751
#define ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE 1752
#define ER_MTS_FEATURE_IS_NOT_SUPPORTED 1753
#define ER_MTS_UPDATED_DBS_GREATER_MAX 1754
#define ER_MTS_CANT_PARALLEL 1755
#define ER_MTS_INCONSISTENT_DATA 1756
#define ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING 1757
#define ER_DA_INVALID_CONDITION_NUMBER 1758
#define ER_INSECURE_PLAIN_TEXT 1759
#define ER_INSECURE_CHANGE_MASTER 1760
#define ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO 1761
#define ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO 1762
#define ER_SQLTHREAD_WITH_SECURE_SLAVE 1763
#define ER_TABLE_HAS_NO_FT 1764
#define ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER 1765
#define ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION 1766
#define ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST 1767
#define ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL 1768
#define ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION 1769
#define ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL 1770
#define ER_SKIPPING_LOGGED_TRANSACTION 1771
#define ER_MALFORMED_GTID_SET_SPECIFICATION 1772
#define ER_MALFORMED_GTID_SET_ENCODING 1773
#define ER_MALFORMED_GTID_SPECIFICATION 1774
#define ER_GNO_EXHAUSTED 1775
#define ER_BAD_SLAVE_AUTO_POSITION 1776
#define ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON 1777
#define ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET 1778
#define ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON 1779
#define ER_GTID_MODE_REQUIRES_BINLOG 1780
#define ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF 1781
#define ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON 1782
#define ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF 1783
#define ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF 1784
#define ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE 1785
#define ER_GTID_UNSAFE_CREATE_SELECT 1786
#define ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION 1787
#define ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME 1788
#define ER_MASTER_HAS_PURGED_REQUIRED_GTIDS 1789
#define ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID 1790
#define ER_UNKNOWN_EXPLAIN_FORMAT 1791
#define ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION 1792
#define ER_TOO_LONG_TABLE_PARTITION_COMMENT 1793
#define ER_SLAVE_CONFIGURATION 1794
#define ER_INNODB_FT_LIMIT 1795
#define ER_INNODB_NO_FT_TEMP_TABLE 1796
#define ER_INNODB_FT_WRONG_DOCID_COLUMN 1797
#define ER_INNODB_FT_WRONG_DOCID_INDEX 1798
#define ER_INNODB_ONLINE_LOG_TOO_BIG 1799
#define ER_UNKNOWN_ALTER_ALGORITHM 1800
#define ER_UNKNOWN_ALTER_LOCK 1801
#define ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS 1802
#define ER_MTS_RECOVERY_FAILURE 1803
#define ER_MTS_RESET_WORKERS 1804
#define ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 1805
#define ER_SLAVE_SILENT_RETRY_TRANSACTION 1806
#define ER_UNUSED_22 1807
#define ER_TABLE_SCHEMA_MISMATCH 1808
#define ER_TABLE_IN_SYSTEM_TABLESPACE 1809
#define ER_IO_READ_ERROR 1810
#define ER_IO_WRITE_ERROR 1811
#define ER_TABLESPACE_MISSING 1812
#define ER_TABLESPACE_EXISTS 1813
#define ER_TABLESPACE_DISCARDED 1814
#define ER_INTERNAL_ERROR 1815
#define ER_INNODB_IMPORT_ERROR 1816
#define ER_INNODB_INDEX_CORRUPT 1817
#define ER_INVALID_YEAR_COLUMN_LENGTH 1818
#define ER_NOT_VALID_PASSWORD 1819
#define ER_MUST_CHANGE_PASSWORD 1820
#define ER_FK_NO_INDEX_CHILD 1821
#define ER_FK_NO_INDEX_PARENT 1822
#define ER_FK_FAIL_ADD_SYSTEM 1823
#define ER_FK_CANNOT_OPEN_PARENT 1824
#define ER_FK_INCORRECT_OPTION 1825
#define ER_DUP_CONSTRAINT_NAME 1826
#define ER_PASSWORD_FORMAT 1827
#define ER_FK_COLUMN_CANNOT_DROP 1828
#define ER_FK_COLUMN_CANNOT_DROP_CHILD 1829
#define ER_FK_COLUMN_NOT_NULL 1830
#define ER_DUP_INDEX 1831
#define ER_FK_COLUMN_CANNOT_CHANGE 1832
#define ER_FK_COLUMN_CANNOT_CHANGE_CHILD 1833
#define ER_FK_CANNOT_DELETE_PARENT 1834
#define ER_MALFORMED_PACKET 1835
#define ER_READ_ONLY_MODE 1836
#define ER_GTID_NEXT_TYPE_UNDEFINED_GROUP 1837
#define ER_VARIABLE_NOT_SETTABLE_IN_SP 1838
#define ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF 1839
#define ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY 1840
#define ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY 1841
#define ER_GTID_PURGED_WAS_CHANGED 1842
#define ER_GTID_EXECUTED_WAS_CHANGED 1843
#define ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES 1844
#define ER_ALTER_OPERATION_NOT_SUPPORTED 1845
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON 1846
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY 1847
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION 1848
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME 1849
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE 1850
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK 1851
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE 1852
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK 1853
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC 1854
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS 1855
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS 1856
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS 1857
#define ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE 1858
#define ER_DUP_UNKNOWN_IN_INDEX 1859
#define ER_IDENT_CAUSES_TOO_LONG_PATH 1860
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL 1861
#define ER_MUST_CHANGE_PASSWORD_LOGIN 1862
#define ER_ROW_IN_WRONG_PARTITION 1863
#define ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX 1864
#define ER_INNODB_NO_FT_USES_PARSER 1865
#define ER_BINLOG_LOGICAL_CORRUPTION 1866
#define ER_WARN_PURGE_LOG_IN_USE 1867
#define ER_WARN_PURGE_LOG_IS_ACTIVE 1868
#define ER_AUTO_INCREMENT_CONFLICT 1869
#define WARN_ON_BLOCKHOLE_IN_RBR 1870
#define ER_SLAVE_MI_INIT_REPOSITORY 1871
#define ER_SLAVE_RLI_INIT_REPOSITORY 1872
#define ER_ACCESS_DENIED_CHANGE_USER_ERROR 1873
#define ER_INNODB_READ_ONLY 1874
#define ER_STOP_SLAVE_SQL_THREAD_TIMEOUT 1875
#define ER_STOP_SLAVE_IO_THREAD_TIMEOUT 1876
#define ER_TABLE_CORRUPT 1877
#define ER_TEMP_FILE_WRITE_FAILURE 1878
#define ER_INNODB_FT_AUX_NOT_HEX_ID 1879
#define ER_LAST_MYSQL_ERROR_MESSAGE 1880
#define ER_ERROR_LAST_SECTION_1 1880

/* New section */

#define ER_ERROR_FIRST_SECTION_2 1900
#define ER_UNUSED_18 1900
#define ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED 1901
#define ER_UNUSED_19 1902
#define ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN 1903
#define ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN 1904
#define ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN 1905
#define ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN 1906
#define ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN 1907
#define ER_UNUSED_20 1908
#define ER_UNUSED_21 1909
#define ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS 1910
#define ER_UNKNOWN_OPTION 1911
#define ER_BAD_OPTION_VALUE 1912
#define ER_UNUSED_6 1913
#define ER_UNUSED_7 1914
#define ER_UNUSED_8 1915
#define ER_DATA_OVERFLOW 1916
#define ER_DATA_TRUNCATED 1917
#define ER_BAD_DATA 1918
#define ER_DYN_COL_WRONG_FORMAT 1919
#define ER_DYN_COL_IMPLEMENTATION_LIMIT 1920
#define ER_DYN_COL_DATA 1921
#define ER_DYN_COL_WRONG_CHARSET 1922
#define ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES 1923
#define ER_QUERY_CACHE_IS_DISABLED 1924
#define ER_QUERY_CACHE_IS_GLOBALY_DISABLED 1925
#define ER_VIEW_ORDERBY_IGNORED 1926
#define ER_CONNECTION_KILLED 1927
#define ER_UNUSED_12 1928
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION 1929
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION 1930
#define ER_QUERY_RESULT_INCOMPLETE 1931
#define ER_NO_SUCH_TABLE_IN_ENGINE 1932
#define ER_TARGET_NOT_EXPLAINABLE 1933
#define ER_CONNECTION_ALREADY_EXISTS 1934
#define ER_MASTER_LOG_PREFIX 1935
#define ER_CANT_START_STOP_SLAVE 1936
#define ER_SLAVE_STARTED 1937
#define ER_SLAVE_STOPPED 1938
#define ER_SQL_DISCOVER_ERROR 1939
#define ER_FAILED_GTID_STATE_INIT 1940
#define ER_INCORRECT_GTID_STATE 1941
#define ER_CANNOT_UPDATE_GTID_STATE 1942
#define ER_DUPLICATE_GTID_DOMAIN 1943
#define ER_GTID_OPEN_TABLE_FAILED 1944
#define ER_GTID_POSITION_NOT_FOUND_IN_BINLOG 1945
#define ER_CANNOT_LOAD_SLAVE_GTID_STATE 1946
#define ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG 1947
#define ER_MASTER_GTID_POS_MISSING_DOMAIN 1948
#define ER_UNTIL_REQUIRES_USING_GTID 1949
#define ER_GTID_STRICT_OUT_OF_ORDER 1950
#define ER_GTID_START_FROM_BINLOG_HOLE 1951
#define ER_SLAVE_UNEXPECTED_MASTER_SWITCH 1952
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO 1953
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO 1954
#define ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2 1955
#define ER_BINLOG_MUST_BE_EMPTY 1956
#define ER_NO_SUCH_QUERY 1957
#define ER_BAD_BASE64_DATA 1958
#define ER_INVALID_ROLE 1959
#define ER_INVALID_CURRENT_USER 1960
#define ER_CANNOT_GRANT_ROLE 1961
#define ER_CANNOT_REVOKE_ROLE 1962
#define ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE 1963
#define ER_PRIOR_COMMIT_FAILED 1964
#define ER_IT_IS_A_VIEW 1965
#define ER_SLAVE_SKIP_NOT_IN_GTID 1966
#define ER_TABLE_DEFINITION_TOO_BIG 1967
#define ER_PLUGIN_INSTALLED 1968
#define ER_STATEMENT_TIMEOUT 1969
#define ER_SUBQUERIES_NOT_SUPPORTED 1970
#define ER_SET_STATEMENT_NOT_SUPPORTED 1971
#define ER_UNUSED_9 1972
#define ER_USER_CREATE_EXISTS 1973
#define ER_USER_DROP_EXISTS 1974
#define ER_ROLE_CREATE_EXISTS 1975
#define ER_ROLE_DROP_EXISTS 1976
#define ER_CANNOT_CONVERT_CHARACTER 1977
#define ER_INVALID_DEFAULT_VALUE_FOR_FIELD 1978
#define ER_KILL_QUERY_DENIED_ERROR 1979
#define ER_NO_EIS_FOR_FIELD 1980
#define ER_WARN_AGGFUNC_DEPENDENCE 1981
#define WARN_INNODB_PARTITION_OPTION_IGNORED 1982
#define ER_ERROR_LAST_SECTION_2 1982

/* New section */

#define ER_ERROR_FIRST_SECTION_3 2000
#define ER_ERROR_LAST_SECTION_3 2000

/* New section */

#define ER_ERROR_FIRST_SECTION_4 3000
#define ER_FILE_CORRUPT 3000
#define ER_ERROR_ON_MASTER 3001
#define ER_INCONSISTENT_ERROR 3002
#define ER_STORAGE_ENGINE_NOT_LOADED 3003
#define ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER 3004
#define ER_WARN_LEGACY_SYNTAX_CONVERTED 3005
#define ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN 3006
#define ER_CANNOT_DISCARD_TEMPORARY_TABLE 3007
#define ER_FK_DEPTH_EXCEEDED 3008
#define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 3009
#define ER_WARN_TRIGGER_DOESNT_HAVE_CREATED 3010
#define ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL 3011
#define ER_EXPLAIN_NOT_SUPPORTED 3012
#define ER_INVALID_FIELD_SIZE 3013
#define ER_MISSING_HA_CREATE_OPTION 3014
#define ER_ENGINE_OUT_OF_MEMORY 3015
#define ER_PASSWORD_EXPIRE_ANONYMOUS_USER 3016
#define ER_SLAVE_SQL_THREAD_MUST_STOP 3017
#define ER_NO_FT_MATERIALIZED_SUBQUERY 3018
#define ER_INNODB_UNDO_LOG_FULL 3019
#define ER_INVALID_ARGUMENT_FOR_LOGARITHM 3020
#define ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP 3021
#define ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO 3022
#define ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS 3023
#define ER_UNUSED_1 3024
#define ER_NON_RO_SELECT_DISABLE_TIMER 3025
#define ER_DUP_LIST_ENTRY 3026
#define ER_SQL_MODE_NO_EFFECT 3027
#define ER_AGGREGATE_ORDER_FOR_UNION 3028
#define ER_AGGREGATE_ORDER_NON_AGG_QUERY 3029
#define ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR 3030
#define ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER 3031
#define ER_SERVER_OFFLINE_MODE 3032
#define ER_GIS_DIFFERENT_SRIDS 3033
#define ER_GIS_UNSUPPORTED_ARGUMENT 3034
#define ER_GIS_UNKNOWN_ERROR 3035
#define ER_GIS_UNKNOWN_EXCEPTION 3036
#define ER_GIS_INVALID_DATA 3037
#define ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION 3038
#define ER_BOOST_GEOMETRY_CENTROID_EXCEPTION 3039
#define ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION 3040
#define ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION 3041
#define ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION 3042
#define ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION 3043
#define ER_STD_BAD_ALLOC_ERROR 3044
#define ER_STD_DOMAIN_ERROR 3045
#define ER_STD_LENGTH_ERROR 3046
#define ER_STD_INVALID_ARGUMENT 3047
#define ER_STD_OUT_OF_RANGE_ERROR 3048
#define ER_STD_OVERFLOW_ERROR 3049
#define ER_STD_RANGE_ERROR 3050
#define ER_STD_UNDERFLOW_ERROR 3051
#define ER_STD_LOGIC_ERROR 3052
#define ER_STD_RUNTIME_ERROR 3053
#define ER_STD_UNKNOWN_EXCEPTION 3054
#define ER_GIS_DATA_WRONG_ENDIANESS 3055
#define ER_CHANGE_MASTER_PASSWORD_LENGTH 3056
#define ER_USER_LOCK_WRONG_NAME 3057
#define ER_USER_LOCK_DEADLOCK 3058
#define ER_REPLACE_INACCESSIBLE_ROWS 3059
#define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS 3060
#define ER_ERROR_LAST_SECTION_4 3060

/* New section */

#define ER_ERROR_FIRST_SECTION_5 4000
#define ER_UNUSED_26 4000
#define ER_UNUSED_27 4001
#define ER_WITH_COL_WRONG_LIST 4002
#define ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE 4003
#define ER_DUP_QUERY_NAME 4004
#define ER_RECURSIVE_WITHOUT_ANCHORS 4005
#define ER_UNACCEPTABLE_MUTUAL_RECURSION 4006
#define ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED 4007
#define ER_NOT_STANDARD_COMPLIANT_RECURSIVE 4008
#define ER_WRONG_WINDOW_SPEC_NAME 4009
#define ER_DUP_WINDOW_NAME 4010
#define ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC 4011
#define ER_ORDER_LIST_IN_REFERENCING_WINDOW_SPEC 4012
#define ER_WINDOW_FRAME_IN_REFERENCED_WINDOW_SPEC 4013
#define ER_BAD_COMBINATION_OF_WINDOW_FRAME_BOUND_SPECS 4014
#define ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION 4015
#define ER_WINDOW_FUNCTION_IN_WINDOW_SPEC 4016
#define ER_NOT_ALLOWED_WINDOW_FRAME 4017
#define ER_NO_ORDER_LIST_IN_WINDOW_SPEC 4018
#define ER_RANGE_FRAME_NEEDS_SIMPLE_ORDERBY 4019
#define ER_WRONG_TYPE_FOR_ROWS_FRAME 4020
#define ER_WRONG_TYPE_FOR_RANGE_FRAME 4021
#define ER_FRAME_EXCLUSION_NOT_SUPPORTED 4022
#define ER_WINDOW_FUNCTION_DONT_HAVE_FRAME 4023
#define ER_INVALID_NTILE_ARGUMENT 4024
#define ER_CONSTRAINT_FAILED 4025
#define ER_EXPRESSION_IS_TOO_BIG 4026
#define ER_ERROR_EVALUATING_EXPRESSION 4027
#define ER_CALCULATING_DEFAULT_VALUE 4028
#define ER_EXPRESSION_REFERS_TO_UNINIT_FIELD 4029
#define ER_PARTITION_DEFAULT_ERROR 4030
#define ER_REFERENCED_TRG_DOES_NOT_EXIST 4031
#define ER_INVALID_DEFAULT_PARAM 4032
#define ER_BINLOG_NON_SUPPORTED_BULK 4033
#define ER_BINLOG_UNCOMPRESS_ERROR 4034
#define ER_JSON_BAD_CHR 4035
#define ER_JSON_NOT_JSON_CHR 4036
#define ER_JSON_EOS 4037
#define ER_JSON_SYNTAX 4038
#define ER_JSON_ESCAPING 4039
#define ER_JSON_DEPTH 4040
#define ER_JSON_PATH_EOS 4041
#define ER_JSON_PATH_SYNTAX 4042
#define ER_JSON_PATH_DEPTH 4043
#define ER_JSON_PATH_NO_WILDCARD 4044
#define ER_JSON_PATH_ARRAY 4045
#define ER_JSON_ONE_OR_ALL 4046
#define ER_UNSUPPORTED_COMPRESSED_TABLE 4047
#define ER_GEOJSON_INCORRECT 4048
#define ER_GEOJSON_TOO_FEW_POINTS 4049
#define ER_GEOJSON_NOT_CLOSED 4050
#define ER_JSON_PATH_EMPTY 4051
#define ER_SLAVE_SAME_ID 4052
#define ER_FLASHBACK_NOT_SUPPORTED 4053
#define ER_KEYS_OUT_OF_ORDER 4054
#define ER_OVERLAPPING_KEYS 4055
#define ER_REQUIRE_ROW_BINLOG_FORMAT 4056
#define ER_ISOLATION_MODE_NOT_SUPPORTED 4057
#define ER_ON_DUPLICATE_DISABLED 4058
#define ER_UPDATES_WITH_CONSISTENT_SNAPSHOT 4059
#define ER_ROLLBACK_ONLY 4060
#define ER_ROLLBACK_TO_SAVEPOINT 4061
#define ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT 4062
#define ER_UNSUPPORTED_COLLATION 4063
#define ER_METADATA_INCONSISTENCY 4064
#define ER_CF_DIFFERENT 4065
#define ER_RDB_TTL_DURATION_FORMAT 4066
#define ER_RDB_STATUS_GENERAL 4067
#define ER_RDB_STATUS_MSG 4068
#define ER_RDB_TTL_UNSUPPORTED 4069
#define ER_RDB_TTL_COL_FORMAT 4070
#define ER_PER_INDEX_CF_DEPRECATED 4071
#define ER_KEY_CREATE_DURING_ALTER 4072
#define ER_SK_POPULATE_DURING_ALTER 4073
#define ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG 4074
#define ER_NET_OK_PACKET_TOO_LARGE 4075
#define ER_GEOJSON_EMPTY_COORDINATES 4076
#define ER_MYROCKS_CANT_NOPAD_COLLATION 4077
#define ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION 4078
#define ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION 4079
#define ER_WRONG_PARAMCOUNT_TO_CURSOR 4080
#define ER_UNKNOWN_STRUCTURED_VARIABLE 4081
#define ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD 4082
#define ER_END_IDENTIFIER_DOES_NOT_MATCH 4083
#define ER_SEQUENCE_RUN_OUT 4084
#define ER_SEQUENCE_INVALID_DATA 4085
#define ER_SEQUENCE_INVALID_TABLE_STRUCTURE 4086
#define ER_SEQUENCE_ACCESS_ERROR 4087
#define ER_SEQUENCE_BINLOG_FORMAT 4088
#define ER_NOT_SEQUENCE 4089
#define ER_NOT_SEQUENCE2 4090
#define ER_UNKNOWN_SEQUENCES 4091
#define ER_UNKNOWN_VIEW 4092
#define ER_WRONG_INSERT_INTO_SEQUENCE 4093
#define ER_SP_STACK_TRACE 4094
#define ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY 4095
#define ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED 4096
#define ER_COMPRESSED_COLUMN_USED_AS_KEY 4097
#define ER_UNKNOWN_COMPRESSION_METHOD 4098
#define ER_WRONG_NUMBER_OF_VALUES_IN_TVC 4099
#define ER_FIELD_REFERENCE_IN_TVC 4100
#define ER_WRONG_TYPE_FOR_PERCENTILE_FUNC 4101
#define ER_ARGUMENT_NOT_CONSTANT 4102
#define ER_ARGUMENT_OUT_OF_RANGE 4103
#define ER_WRONG_TYPE_OF_ARGUMENT 4104
#define ER_NOT_AGGREGATE_FUNCTION 4105
#define ER_INVALID_AGGREGATE_FUNCTION 4106
#define ER_INVALID_VALUE_TO_LIMIT 4107
#define ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT 4108
#define ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING 4109
#define ER_VERS_FIELD_WRONG_TYPE 4110
#define ER_VERS_ENGINE_UNSUPPORTED 4111
#define ER_UNUSED_23 4112
#define ER_PARTITION_WRONG_TYPE 4113
#define WARN_VERS_PART_FULL 4114
#define WARN_VERS_PARAMETERS 4115
#define ER_VERS_DROP_PARTITION_INTERVAL 4116
#define ER_UNUSED_25 4117
#define WARN_VERS_PART_NON_HISTORICAL 4118
#define ER_VERS_ALTER_NOT_ALLOWED 4119
#define ER_VERS_ALTER_ENGINE_PROHIBITED 4120
#define ER_VERS_RANGE_PROHIBITED 4121
#define ER_CONFLICTING_FOR_SYSTEM_TIME 4122
#define ER_VERS_TABLE_MUST_HAVE_COLUMNS 4123
#define ER_VERS_NOT_VERSIONED 4124
#define ER_MISSING 4125
#define ER_VERS_PERIOD_COLUMNS 4126
#define ER_PART_WRONG_VALUE 4127
#define ER_VERS_WRONG_PARTS 4128
#define ER_VERS_NO_TRX_ID 4129
#define ER_VERS_ALTER_SYSTEM_FIELD 4130
#define ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION 4131
#define ER_VERS_DB_NOT_SUPPORTED 4132
#define ER_VERS_TRT_IS_DISABLED 4133
#define ER_VERS_DUPLICATE_ROW_START_END 4134
#define ER_VERS_ALREADY_VERSIONED 4135
#define ER_UNUSED_24 4136
#define ER_VERS_NOT_SUPPORTED 4137
#define ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED 4138
#define ER_INDEX_FILE_FULL 4139
#define ER_UPDATED_COLUMN_ONLY_ONCE 4140
#define ER_EMPTY_ROW_IN_TVC 4141
#define ER_VERS_QUERY_IN_PARTITION 4142
#define ER_KEY_DOESNT_SUPPORT 4143
#define ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD 4144
#define ER_BACKUP_LOCK_IS_ACTIVE 4145
#define ER_BACKUP_NOT_RUNNING 4146
#define ER_BACKUP_WRONG_STAGE 4147
#define ER_BACKUP_STAGE_FAILED 4148
#define ER_BACKUP_UNKNOWN_STAGE 4149
#define ER_USER_IS_BLOCKED 4150
#define ER_ACCOUNT_HAS_BEEN_LOCKED 4151
#define ER_PERIOD_TEMPORARY_NOT_ALLOWED 4152
#define ER_PERIOD_TYPES_MISMATCH 4153
#define ER_MORE_THAN_ONE_PERIOD 4154
#define ER_PERIOD_FIELD_WRONG_ATTRIBUTES 4155
#define ER_PERIOD_NOT_FOUND 4156
#define ER_PERIOD_COLUMNS_UPDATED 4157
#define ER_PERIOD_CONSTRAINT_DROP 4158
#define ER_TOO_LONG_KEYPART 4159
#define ER_TOO_LONG_DATABASE_COMMENT 4160
#define ER_UNKNOWN_DATA_TYPE 4161
#define ER_UNKNOWN_OPERATOR 4162
#define ER_WARN_HISTORY_ROW_START_TIME 4163
#define ER_PART_STARTS_BEYOND_INTERVAL 4164
#define ER_GALERA_REPLICATION_NOT_SUPPORTED 4165
#define ER_LOAD_INFILE_CAPABILITY_DISABLED 4166
#define ER_NO_SECURE_TRANSPORTS_CONFIGURED 4167
#define ER_SLAVE_IGNORED_SHARED_TABLE 4168
#define ER_NO_AUTOINCREMENT_WITH_UNIQUE 4169
#define ER_KEY_CONTAINS_PERIOD_FIELDS 4170
#define ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS 4171
#define ER_NOT_ALLOWED_IN_THIS_CONTEXT 4172
#define ER_DATA_WAS_COMMITED_UNDER_ROLLBACK 4173
#define ER_PK_INDEX_CANT_BE_IGNORED 4174
#define ER_BINLOG_UNSAFE_SKIP_LOCKED 4175
#define ER_JSON_TABLE_ERROR_ON_FIELD 4176
#define ER_JSON_TABLE_ALIAS_REQUIRED 4177
#define ER_JSON_TABLE_SCALAR_EXPECTED 4178
#define ER_JSON_TABLE_MULTIPLE_MATCHES 4179
#define ER_WITH_TIES_NEEDS_ORDER 4180
#define ER_REMOVED_ORPHAN_TRIGGER 4181
#define ER_STORAGE_ENGINE_DISABLED 4182
#define ER_ERROR_LAST 4182
#endif /* ER_ERROR_FIRST */
mysql_version.h000064400000000346150400264030007624 0ustar00/* Do not edit this file directly, it was auto-generated by cmake */

#warning This file should not be included by clients, include only <mysql.h>

#include <mariadb_version.h>
#define LIBMYSQL_VERSION MARIADB_CLIENT_VERSION_STR

my_sys.h000064400000000224150400264030006230 0ustar00/* Do not edit this file directly, it was auto-generated by cmake */

#warning This file should not be included by clients, include only <mysql.h>

ma_tls.h000064400000010371150400264030006170 0ustar00#ifndef _ma_tls_h_
#define _ma_tls_h_

enum enum_pvio_tls_type {
  SSL_TYPE_DEFAULT=0,
#ifdef _WIN32
  SSL_TYPE_SCHANNEL,
#endif
  SSL_TYPE_OPENSSL,
  SSL_TYPE_GNUTLS
};

#define PROTOCOL_SSLV3    0
#define PROTOCOL_TLS_1_0  1
#define PROTOCOL_TLS_1_1  2
#define PROTOCOL_TLS_1_2  3
#define PROTOCOL_TLS_1_3  4
#define PROTOCOL_UNKNOWN  5
#define PROTOCOL_MAX PROTOCOL_TLS_1_3

#define TLS_VERSION_LENGTH 64
extern char tls_library_version[TLS_VERSION_LENGTH];

typedef struct st_ma_pvio_tls {
  void *data;
  MARIADB_PVIO *pvio;
  void *ssl;
} MARIADB_TLS;

/* Function prototypes */

/* ma_tls_start
   initializes the ssl library
   Parameter:
     errmsg      pointer to error message buffer
     errmsg_len  length of error message buffer
   Returns:
     0           success
     1           if an error occurred
   Notes:
     On success the global variable ma_tls_initialized will be set to 1
*/
int ma_tls_start(char *errmsg, size_t errmsg_len);

/* ma_tls_end
   unloads/deinitializes ssl library and unsets global variable
   ma_tls_initialized
*/
void ma_tls_end(void);

/* ma_tls_init
   creates a new SSL structure for a SSL connection and loads
   client certificates

   Parameters:
     MYSQL        a mysql structure
   Returns:
     void *       a pointer to internal SSL structure
*/
void * ma_tls_init(MYSQL *mysql);

/* ma_tls_connect
   performs SSL handshake
   Parameters:
     MARIADB_TLS   MariaDB SSL container
   Returns:
     0             success
     1             error
*/
my_bool ma_tls_connect(MARIADB_TLS *ctls);

/* ma_tls_read
   reads up to length bytes from socket
   Parameters:
     ctls         MariaDB SSL container
     buffer       read buffer
     length       buffer length
   Returns:
     0-n          bytes read
     -1           if an error occurred
*/
ssize_t ma_tls_read(MARIADB_TLS *ctls, const uchar* buffer, size_t length);

/* ma_tls_write
   write buffer to socket
   Parameters:
     ctls         MariaDB SSL container
     buffer       write buffer
     length       buffer length
   Returns:
     0-n          bytes written
     -1           if an error occurred
*/
ssize_t ma_tls_write(MARIADB_TLS *ctls, const uchar* buffer, size_t length);

/* ma_tls_close
   closes SSL connection and frees SSL structure which was previously
   created by ma_tls_init call
   Parameters:
     MARIADB_TLS  MariaDB SSL container
   Returns:
     0            success
     1            error
*/
my_bool ma_tls_close(MARIADB_TLS *ctls);

/* ma_tls_verify_server_cert
   validation check of server certificate
   Parameter:
     MARIADB_TLS  MariaDB SSL container
   Returns:
     ß            success
     1            error
*/
int ma_tls_verify_server_cert(MARIADB_TLS *ctls);

/* ma_tls_get_cipher
   returns cipher for current ssl connection
   Parameter:
     MARIADB_TLS  MariaDB SSL container
   Returns: 
     cipher in use or
     NULL on error
*/
const char *ma_tls_get_cipher(MARIADB_TLS *ssl);

/* ma_tls_get_finger_print
   returns SHA1 finger print of server certificate
   Parameter:
     MARIADB_TLS  MariaDB SSL container
     fp           buffer for fingerprint
     fp_len       buffer length
   Returns:
     actual size of finger print
*/
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int fp_len);

/* ma_tls_get_protocol_version 
   returns protocol version number in use
   Parameter:
     MARIADB_TLS    MariaDB SSL container
   Returns:
     protocol number
*/
int ma_tls_get_protocol_version(MARIADB_TLS *ctls);
const char *ma_pvio_tls_get_protocol_version(MARIADB_TLS *ctls);
int ma_pvio_tls_get_protocol_version_id(MARIADB_TLS *ctls);
void ma_tls_set_connection(MYSQL *mysql);

/* Function prototypes */
MARIADB_TLS *ma_pvio_tls_init(MYSQL *mysql);
my_bool ma_pvio_tls_connect(MARIADB_TLS *ctls);
ssize_t ma_pvio_tls_read(MARIADB_TLS *ctls, const uchar *buffer, size_t length);
ssize_t ma_pvio_tls_write(MARIADB_TLS *ctls, const uchar *buffer, size_t length);
my_bool ma_pvio_tls_close(MARIADB_TLS *ctls);
int ma_pvio_tls_verify_server_cert(MARIADB_TLS *ctls);
const char *ma_pvio_tls_cipher(MARIADB_TLS *ctls);
my_bool ma_pvio_tls_check_fp(MARIADB_TLS *ctls, const char *fp, const char *fp_list);
my_bool ma_pvio_start_ssl(MARIADB_PVIO *pvio);
void ma_pvio_tls_set_connection(MYSQL *mysql);
void ma_pvio_tls_end();

#endif /* _ma_tls_h_ */
mariadb_version.h000064400000002275150400264030010061 0ustar00/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
   This file is public domain and comes with NO WARRANTY of any kind */

/* Version numbers for protocol & mysqld */

#ifndef _mariadb_version_h_
#define _mariadb_version_h_

#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
#define PROTOCOL_VERSION		10
#define MARIADB_CLIENT_VERSION_STR	"10.6.22"
#define MARIADB_BASE_VERSION		"mariadb-10.6"
#define MARIADB_VERSION_ID		100622
#define MARIADB_PORT	        	3306
#define MARIADB_UNIX_ADDR               "/var/lib/mysql/mysql.sock"
#ifndef MYSQL_UNIX_ADDR
#define MYSQL_UNIX_ADDR MARIADB_UNIX_ADDR
#endif
#ifndef MYSQL_PORT
#define MYSQL_PORT MARIADB_PORT
#endif

#define MYSQL_CONFIG_NAME               "my"
#define MYSQL_VERSION_ID                100622
#define MYSQL_SERVER_VERSION            "10.6.22-MariaDB"

#define MARIADB_PACKAGE_VERSION "3.3.16"
#define MARIADB_PACKAGE_VERSION_ID 30316
#define MARIADB_SYSTEM_TYPE "Linux"
#define MARIADB_MACHINE_TYPE "x86_64"
#define MARIADB_PLUGINDIR "/usr/lib64/mysql/plugin"

/* mysqld compile time options */
#ifndef MYSQL_CHARSET
#define MYSQL_CHARSET			""
#endif
#endif

/* Source information */
#define CC_SOURCE_REVISION ""

#endif /* _mariadb_version_h_ */
mariadb_rpl.h000064400000045667150400264030007205 0ustar00/* Copyright (C) 2018-2022 MariaDB Corporation AB

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
 
   This library 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
   Library General Public License for more details.
 
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */
#ifndef _mariadb_rpl_h_
#define _mariadb_rpl_h_

#ifdef	__cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <mariadb/ma_io.h>

#define MARIADB_RPL_VERSION 0x0002
#define MARIADB_RPL_REQUIRED_VERSION 0x0002

#define RPL_BINLOG_MAGIC (const uchar*) "\xFE\x62\x69\x6E"
#define RPL_BINLOG_MAGIC_SIZE 4

/* Protocol flags */
#define MARIADB_RPL_BINLOG_DUMP_NON_BLOCK 1
#define MARIADB_RPL_BINLOG_SEND_ANNOTATE_ROWS 2
#define MARIADB_RPL_IGNORE_HEARTBEAT (1 << 17)

#define EVENT_HEADER_OFS 20

#define FL_STMT_END 1

/* GTID flags */ 

/* FL_STANDALONE is set in case there is no terminating COMMIT event. */
#define FL_STANDALONE            0x01

/* FL_GROUP_COMMIT_ID is set when event group is part of a group commit */
#define FL_GROUP_COMMIT_ID       0x02

/* FL_TRANSACTIONAL is set for an event group that can be safely rolled back
    (no MyISAM, eg.).
  */
#define FL_TRANSACTIONAL         0x04
  /*
    FL_ALLOW_PARALLEL reflects the (negation of the) value of
    @@SESSION.skip_parallel_replication at the time of commit.
  */
#define FL_ALLOW_PARALLEL        0x08;
  /*
    FL_WAITED is set if a row lock wait (or other wait) is detected during the
    execution of the transaction.
  */
#define FL_WAITED                0x10
  /* FL_DDL is set for event group containing DDL. */
#define FL_DDL                   0x20
  /* FL_PREPARED_XA is set for XA transaction. */
#define FL_PREPARED_XA           0x40
  /* FL_"COMMITTED or ROLLED-BACK"_XA is set for XA transaction. */
#define FL_COMPLETED_XA          0x80


/* SEMI SYNCHRONOUS REPLICATION */
#define SEMI_SYNC_INDICATOR 0xEF
#define SEMI_SYNC_ACK_REQ   0x01

/* Options */
enum mariadb_rpl_option {
  MARIADB_RPL_FILENAME,       /* Filename and length */
  MARIADB_RPL_START,          /* Start position */
  MARIADB_RPL_SERVER_ID,      /* Server ID */
  MARIADB_RPL_FLAGS,          /* Protocol flags */
  MARIADB_RPL_GTID_CALLBACK,  /* GTID callback function */
  MARIADB_RPL_GTID_DATA,      /* GTID data */
  MARIADB_RPL_BUFFER,
  MARIADB_RPL_VERIFY_CHECKSUM,
  MARIADB_RPL_UNCOMPRESS,
  MARIADB_RPL_HOST,
  MARIADB_RPL_PORT,
  MARIADB_RPL_EXTRACT_VALUES,
  MARIADB_RPL_SEMI_SYNC,
};

/* Event types: From MariaDB Server sql/log_event.h */
enum mariadb_rpl_event {
  UNKNOWN_EVENT= 0,
  START_EVENT_V3= 1,
  QUERY_EVENT= 2,
  STOP_EVENT= 3,
  ROTATE_EVENT= 4,
  INTVAR_EVENT= 5,
  LOAD_EVENT= 6,
  SLAVE_EVENT= 7,
  CREATE_FILE_EVENT= 8,
  APPEND_BLOCK_EVENT= 9,
  EXEC_LOAD_EVENT= 10,
  DELETE_FILE_EVENT= 11,
  NEW_LOAD_EVENT= 12,
  RAND_EVENT= 13,
  USER_VAR_EVENT= 14,
  FORMAT_DESCRIPTION_EVENT= 15,
  XID_EVENT= 16,
  BEGIN_LOAD_QUERY_EVENT= 17,
  EXECUTE_LOAD_QUERY_EVENT= 18,
  TABLE_MAP_EVENT = 19,

  PRE_GA_WRITE_ROWS_EVENT = 20, /* deprecated */
  PRE_GA_UPDATE_ROWS_EVENT = 21, /* deprecated */
  PRE_GA_DELETE_ROWS_EVENT = 22, /* deprecated */

  WRITE_ROWS_EVENT_V1 = 23,
  UPDATE_ROWS_EVENT_V1 = 24,
  DELETE_ROWS_EVENT_V1 = 25,
  INCIDENT_EVENT= 26,
  HEARTBEAT_LOG_EVENT= 27,
  IGNORABLE_LOG_EVENT= 28,
  ROWS_QUERY_LOG_EVENT= 29,
  WRITE_ROWS_EVENT = 30,
  UPDATE_ROWS_EVENT = 31,
  DELETE_ROWS_EVENT = 32,
  GTID_LOG_EVENT= 33,
  ANONYMOUS_GTID_LOG_EVENT= 34,
  PREVIOUS_GTIDS_LOG_EVENT= 35,
  TRANSACTION_CONTEXT_EVENT= 36,
  VIEW_CHANGE_EVENT= 37,
  XA_PREPARE_LOG_EVENT= 38,
  PARTIAL_UPDATE_ROWS_EVENT = 39,

  /*
    Add new events here - right above this comment!
    Existing events (except ENUM_END_EVENT) should never change their numbers
  */

  /* New MySQL events are to be added right above this comment */
  MYSQL_EVENTS_END,

  MARIA_EVENTS_BEGIN= 160,
  ANNOTATE_ROWS_EVENT= 160,
  BINLOG_CHECKPOINT_EVENT= 161,
  GTID_EVENT= 162,
  GTID_LIST_EVENT= 163,
  START_ENCRYPTION_EVENT= 164,
  QUERY_COMPRESSED_EVENT = 165,
  WRITE_ROWS_COMPRESSED_EVENT_V1 = 166,
  UPDATE_ROWS_COMPRESSED_EVENT_V1 = 167,
  DELETE_ROWS_COMPRESSED_EVENT_V1 = 168,
  WRITE_ROWS_COMPRESSED_EVENT = 169,
  UPDATE_ROWS_COMPRESSED_EVENT = 170,
  DELETE_ROWS_COMPRESSED_EVENT = 171,

  /* Add new MariaDB events here - right above this comment!  */

  ENUM_END_EVENT /* end marker */
};

/* ROWS_EVENT flags */

#define STMT_END_F                    0x01
#define NO_FOREIGN_KEY_CHECKS_F       0x02
#define RELAXED_UNIQUE_KEY_CHECKS_F   0x04
#define COMPLETE_ROWS_F               0x08
#define NO_CHECK_CONSTRAINT_CHECKS_F  0x80


enum mariadb_rpl_status_code {
  Q_FLAGS2_CODE= 0x00,
  Q_SQL_MODE_CODE= 0x01,
  Q_CATALOG_CODE= 0x02,
  Q_AUTO_INCREMENT_CODE= 0x03,
  Q_CHARSET_CODE= 0x04,
  Q_TIMEZONE_CODE= 0x05,
  Q_CATALOG_NZ_CODE= 0x06,
  Q_LC_TIME_NAMES_CODE= 0x07,
  Q_CHARSET_DATABASE_CODE= 0x08,
  Q_TABLE_MAP_FOR_UPDATE_CODE= 0x09,
  Q_MASTER_DATA_WRITTEN_CODE= 0x0A,
  Q_INVOKERS_CODE= 0x0B,
  Q_UPDATED_DB_NAMES_CODE= 0x0C,
  Q_MICROSECONDS_CODE= 0x0D,
  Q_COMMIT_TS_CODE= 0x0E,  /* unused */
  Q_COMMIT_TS2_CODE= 0x0F, /* unused */
  Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP_CODE= 0x10,
  Q_DDL_LOGGED_WITH_XID_CODE= 0x11,
  Q_DEFAULT_COLLATION_FOR_UTF8_CODE= 0x12,
  Q_SQL_REQUIRE_PRIMARY_KEY_CODE= 0x13,
  Q_DEFAULT_TABLE_ENCRYPTION_CODE= 0x14,
  Q_HRNOW= 128,  /* second part: 3 bytes */
  Q_XID= 129    /* xid: 8 bytes */
};

#ifdef DEFAULT_CHARSET
#undef DEFAULT_CHARSET
#endif

enum opt_metadata_field_type
{
  SIGNEDNESS = 1,
  DEFAULT_CHARSET,
  COLUMN_CHARSET,
  COLUMN_NAME,
  SET_STR_VALUE,
  ENUM_STR_VALUE,
  GEOMETRY_TYPE, 
  SIMPLE_PRIMARY_KEY,
  PRIMARY_KEY_WITH_PREFIX,
  ENUM_AND_SET_DEFAULT_CHARSET,
  ENUM_AND_SET_COLUMN_CHARSET
};

/* QFLAGS2 codes */
#define OPTION_AUTO_IS_NULL                   0x00040000
#define OPTION_NOT_AUTOCOMMIT                 0x00080000
#define OPTION_NO_FOREIGN_KEY_CHECKS          0x04000000
#define OPTION_RELAXED_UNIQUE_CHECKS          0x08000000

/* SQL modes */
#define MODE_REAL_AS_FLOAT                    0x00000001
#define MODE_PIPES_AS_CONCAT                  0x00000002
#define MODE_ANSI_QUOTES                      0x00000004
#define MODE_IGNORE_SPACE                     0x00000008
#define MODE_NOT_USED                         0x00000010
#define MODE_ONLY_FULL_GROUP_BY               0x00000020
#define MODE_NO_UNSIGNED_SUBTRACTION          0x00000040
#define MODE_NO_DIR_IN_CREATE                 0x00000080
#define MODE_POSTGRESQL                       0x00000100
#define MODE_ORACLE                           0x00000200
#define MODE_MSSQL                            0x00000400
#define MODE_DB2                              0x00000800
#define MODE_MAXDB                            0x00001000
#define MODE_NO_KEY_OPTIONS                   0x00002000
#define MODE_NO_TABLE_OPTIONS                 0x00004000
#define MODE_NO_FIELD_OPTIONS                 0x00008000
#define MODE_MYSQL323                         0x00010000
#define MODE_MYSQL40                          0x00020000
#define MODE_ANSI                             0x00040000
#define MODE_NO_AUTO_VALUE_ON_ZERO            0x00080000
#define MODE_NO_BACKSLASH_ESCAPES             0x00100000
#define MODE_STRICT_TRANS_TABLES              0x00200000
#define MODE_STRICT_ALL_TABLES                0x00400000
#define MODE_NO_ZERO_IN_DATE                  0x00800000
#define MODE_NO_ZERO_DATE                     0x01000000
#define MODE_INVALID_DATES                    0x02000000
#define MODE_ERROR_FOR_DIVISION_BY_ZERO       0x04000000
#define MODE_TRADITIONAL                      0x08000000
#define MODE_NO_AUTO_CREATE_USER              0x10000000
#define MODE_HIGH_NOT_PRECEDENCE              0x20000000
#define MODE_NO_ENGINE_SUBSTITUTION           0x40000000
#define MODE_PAD_CHAR_TO_FULL_LENGTH          0x80000000

/* Log Event flags */

/* used in FOMRAT_DESCRIPTION_EVENT. Indicates if it
   is the active binary log.
   Note: When reading data via COM_BINLOG_DUMP this
         flag is never set.
*/ 
#define LOG_EVENT_BINLOG_IN_USE_F           0x0001

/* Looks like this flag is no longer in use */
#define LOG_EVENT_FORCED_ROTATE_F           0x0002

/* Log entry depends on thread, e.g. when using user variables
   or temporary tables */
#define LOG_EVENT_THREAD_SPECIFIC_F         0x0004

/* Indicates that the USE command can be suppressed before
   executing a statement: e.g. DRIP SCHEMA  */
#define LOG_EVENT_SUPPRESS_USE_F            0x0008

/* ??? */
#define LOG_EVENT_UPDATE_TABLE_MAP_F        0x0010

/* Artifical event */
#define LOG_EVENT_ARTIFICIAL_F              0x0020

/* ??? */
#define LOG_EVENT_RELAY_LOG_F               0x0040

/* If an event is not supported, and LOG_EVENT_IGNORABLE_F was not
   set, an error will be reported. */
#define LOG_EVENT_IGNORABLE_F               0x0080

/* ??? */
#define LOG_EVENT_NO_FILTER_F               0x0100

/* ?? */
#define LOG_EVENT_MTS_ISOLATE_F             0x0200

/* if session variable @@skip_repliation was set, this flag will be
   reported for events which should be skipped. */
#define LOG_EVENT_SKIP_REPLICATION_F        0x8000

typedef struct {
  char *str;
  size_t length;
} MARIADB_STRING;

enum mariadb_row_event_type {
  WRITE_ROWS= 0,
  UPDATE_ROWS= 1,
  DELETE_ROWS= 2
};

/* Global transaction id */
typedef struct st_mariadb_gtid {
  unsigned int domain_id;
  unsigned int server_id;
  unsigned long long sequence_nr;
} MARIADB_GTID;


/* Generic replication handle */
typedef struct st_mariadb_rpl {
  unsigned int version;
  MYSQL *mysql;
  char *filename;
  uint32_t filename_length;
  uint32_t server_id;
  unsigned long start_position;
  uint16_t flags;
  uint8_t fd_header_len; /* header len from last format description event */
  uint8_t use_checksum;
  uint8_t artificial_checksum;
  uint8_t verify_checksum;
  uint8_t post_header_len[ENUM_END_EVENT];
  MA_FILE *fp;
  uint32_t error_no;
  char error_msg[MYSQL_ERRMSG_SIZE];
  uint8_t uncompress;
  char *host;
  uint32_t port;
  uint8_t extract_values;
  char nonce[12];
  uint8_t encrypted;
  uint8_t is_semi_sync;
}MARIADB_RPL;

typedef struct st_mariadb_rpl_value {
  enum enum_field_types field_type;
  uint8_t is_null;
  uint8_t is_signed;
  union {
    int64_t ll;
    uint64_t ull;
    float f;
    double d;
    MYSQL_TIME tm;
    MARIADB_STRING str;
  } val;
} MARIADB_RPL_VALUE;

typedef struct st_rpl_mariadb_row {
  uint32_t column_count;
  MARIADB_RPL_VALUE *columns;
  struct st_rpl_mariadb_row *next;
} MARIADB_RPL_ROW;

/* Event header */
struct st_mariadb_rpl_rotate_event {
  unsigned long long position;
  MARIADB_STRING filename;
};

struct st_mariadb_rpl_query_event {
  uint32_t thread_id;
  uint32_t seconds;
  MARIADB_STRING database;
  uint32_t errornr;
  MARIADB_STRING status;
  MARIADB_STRING statement;
};

struct st_mariadb_rpl_previous_gtid_event {
  MARIADB_CONST_DATA content;
};

struct st_mariadb_rpl_gtid_list_event {
  uint32_t gtid_cnt;
  MARIADB_GTID *gtid;
};

struct st_mariadb_rpl_format_description_event
{
  uint16_t format;
  char *server_version;
  uint32_t timestamp;
  uint8_t header_len;
  MARIADB_STRING post_header_lengths;
};

struct st_mariadb_rpl_checkpoint_event {
  MARIADB_STRING filename;
};

struct st_mariadb_rpl_xid_event {
  uint64_t transaction_nr;
};

struct st_mariadb_rpl_gtid_event {
  uint64_t sequence_nr;
  uint32_t domain_id;
  uint8_t flags;
  uint64_t commit_id;
  uint32_t format_id;
  uint8_t gtrid_len;
  uint8_t bqual_len;
  MARIADB_STRING xid;
};

struct st_mariadb_rpl_annotate_rows_event {
  MARIADB_STRING statement;
};

struct st_mariadb_rpl_table_map_event {
  unsigned long long table_id;
  MARIADB_STRING database;
  MARIADB_STRING table;
  uint32_t column_count;
  MARIADB_STRING column_types;
  MARIADB_STRING metadata;
  unsigned char *null_indicator;
  unsigned char *signed_indicator;
  MARIADB_CONST_DATA column_names;
  MARIADB_CONST_DATA geometry_types;
  uint32_t default_charset;
  MARIADB_CONST_DATA column_charsets;
  MARIADB_CONST_DATA simple_primary_keys;
  MARIADB_CONST_DATA prefixed_primary_keys;
  MARIADB_CONST_DATA set_values;
  MARIADB_CONST_DATA enum_values;
  uint8_t enum_set_default_charset;
  MARIADB_CONST_DATA enum_set_column_charsets;
};

struct st_mariadb_rpl_rand_event {
  unsigned long long first_seed;
  unsigned long long second_seed;
};

struct st_mariadb_rpl_intvar_event {
  unsigned long long value;
  uint8_t type;
};

struct st_mariadb_begin_load_query_event {
  uint32_t file_id;
  unsigned char *data;
};

struct st_mariadb_start_encryption_event {
  uint8_t scheme;
  uint32_t key_version;
  char nonce[12];
};

struct st_mariadb_execute_load_query_event {
  uint32_t thread_id;
  uint32_t execution_time;
  MARIADB_STRING schema;
  uint16_t error_code;
  uint32_t file_id;
  uint32_t ofs1;
  uint32_t ofs2;
  uint8_t duplicate_flag;
  MARIADB_STRING status_vars;
  MARIADB_STRING statement;
};

struct st_mariadb_rpl_uservar_event {
  MARIADB_STRING name;
  uint8_t is_null;
  uint8_t type;
  uint32_t charset_nr;
  MARIADB_STRING value;
  uint8_t flags;
};

struct st_mariadb_rpl_rows_event {
  enum mariadb_row_event_type type;
  uint64_t table_id;
  uint16_t flags;
  uint32_t column_count;
  unsigned char *column_bitmap;
  unsigned char *column_update_bitmap;
  unsigned char *null_bitmap;
  size_t row_data_size;
  void *row_data;
  size_t extra_data_size;
  void *extra_data;
  uint8_t compressed;
  uint32_t row_count;
};

struct st_mariadb_rpl_heartbeat_event {
  uint32_t timestamp;
  uint32_t next_position;
  uint8_t type;
  uint16_t flags;
};

struct st_mariadb_rpl_xa_prepare_log_event {
  uint8_t one_phase;
  uint32_t format_id;
  uint32_t gtrid_len;
  uint32_t bqual_len;
  MARIADB_STRING xid;
};

struct st_mariadb_gtid_log_event {
  uint8_t commit_flag;
  char    source_id[16];
  uint64_t sequence_nr;
};

typedef struct st_mariadb_rpl_event
{
  /* common header */
  MA_MEM_ROOT memroot;
  unsigned char *raw_data;
  size_t raw_data_size;
  size_t raw_data_ofs;
  unsigned int checksum;
  char ok;
  enum mariadb_rpl_event event_type;
  unsigned int timestamp;
  unsigned int server_id;
  unsigned int event_length;
  unsigned int next_event_pos;
  unsigned short flags;
  /****************/
  union {
    struct st_mariadb_rpl_rotate_event rotate;
    struct st_mariadb_rpl_query_event query;
    struct st_mariadb_rpl_format_description_event format_description;
    struct st_mariadb_rpl_gtid_list_event gtid_list;
    struct st_mariadb_rpl_checkpoint_event checkpoint;
    struct st_mariadb_rpl_xid_event xid;
    struct st_mariadb_rpl_gtid_event gtid;
    struct st_mariadb_rpl_annotate_rows_event annotate_rows;
    struct st_mariadb_rpl_table_map_event table_map;
    struct st_mariadb_rpl_rand_event rand;
    struct st_mariadb_rpl_intvar_event intvar;
    struct st_mariadb_rpl_uservar_event uservar;
    struct st_mariadb_rpl_rows_event rows;
    struct st_mariadb_rpl_heartbeat_event heartbeat;
    struct st_mariadb_rpl_xa_prepare_log_event xa_prepare_log;
    struct st_mariadb_begin_load_query_event begin_load_query;
    struct st_mariadb_execute_load_query_event execute_load_query;
    struct st_mariadb_gtid_log_event gtid_log;
    struct st_mariadb_start_encryption_event start_encryption;
    struct st_mariadb_rpl_previous_gtid_event previous_gtid;
  } event;
  /* Added in C/C 3.3.0 */
  uint8_t is_semi_sync;
  uint8_t semi_sync_flags;
  /* Added in C/C 3.3.5 */
  MARIADB_RPL *rpl;
} MARIADB_RPL_EVENT;

/* compression uses myisampack format */
#define myisam_uint1korr(B) ((uint8_t)(*B))
#define myisam_sint1korr(B) ((int8_t)(*B))
#define myisam_uint2korr(B)\
((uint16_t)(((uint16_t)(((const uchar*)(B))[1])) | ((uint16_t) (((const uchar*) (B))[0]) << 8)))
#define myisam_sint2korr(B)\
((int16_t)(((int16_t)(((const uchar*)(B))[1])) | ((int16_t) (((const uchar*) (B))[0]) << 8)))
#define myisam_uint3korr(B)\
((uint32_t)(((uint32_t)(((const uchar*)(B))[2])) |\
(((uint32_t)(((const uchar*)(B))[1])) << 8) |\
(((uint32_t)(((const uchar*)(B))[0])) << 16)))
#define myisam_sint3korr(B)\
((int32_t)(((int32_t)(((const uchar*)(B))[2])) |\
(((int32_t)(((const uchar*)(B))[1])) << 8) |\
(((int32_t)(((const uchar*)(B))[0])) << 16)))
#define myisam_uint4korr(B)\
((uint32_t)(((uint32_t)(((const uchar*)(B))[3])) |\
(((uint32_t)(((const uchar*)(B))[2])) << 8) |\
(((uint32_t)(((const uchar*) (B))[1])) << 16) |\
(((uint32_t)(((const uchar*) (B))[0])) << 24)))
#define myisam_sint4korr(B)\
((int32_t)(((int32_t)(((const uchar*)(B))[3])) |\
(((int32_t)(((const uchar*)(B))[2])) << 8) |\
(((int32_t)(((const uchar*) (B))[1])) << 16) |\
(((int32_t)(((const uchar*) (B))[0])) << 24)))
#define mi_uint5korr(B)\
((uint64_t)(((uint32_t) (((const uchar*) (B))[4])) |\
(((uint32_t) (((const uchar*) (B))[3])) << 8) |\
(((uint32_t) (((const uchar*) (B))[2])) << 16) |\
(((uint32_t) (((const uchar*) (B))[1])) << 24)) |\
(((uint64_t) (((const uchar*) (B))[0])) << 32))

#define RPL_SAFEGUARD(rpl, event, condition) \
if (!(condition))\
{\
  my_set_error((rpl)->mysql, CR_BINLOG_ERROR, SQLSTATE_UNKNOWN, 0,\
                (rpl)->filename_length, (rpl)->filename,\
                (rpl)->start_position,\
                "Packet corrupted");\
  mariadb_free_rpl_event((event));\
  return 0;\
}

#define mariadb_rpl_init(a) mariadb_rpl_init_ex((a), MARIADB_RPL_VERSION)
#define rpl_clear_error(rpl)\
(rpl)->error_no= (rpl)->error_msg[0]= 0

#define IS_ROW_VERSION2(a)\
  ((a) == WRITE_ROWS_EVENT  || (a) == UPDATE_ROWS_EVENT || \
   (a) == DELETE_ROWS_EVENT || (a) == WRITE_ROWS_COMPRESSED_EVENT ||\
   (a) == UPDATE_ROWS_COMPRESSED_EVENT || (a) == DELETE_ROWS_COMPRESSED_EVENT)

#define IS_ROW_EVENT(a)\
((a)->event_type == WRITE_ROWS_COMPRESSED_EVENT_V1 ||\
(a)->event_type == UPDATE_ROWS_COMPRESSED_EVENT_V1 ||\
(a)->event_type == DELETE_ROWS_COMPRESSED_EVENT_V1 ||\
(a)->event_type == WRITE_ROWS_EVENT_V1 ||\
(a)->event_type == UPDATE_ROWS_EVENT_V1 ||\
(a)->event_type == DELETE_ROWS_EVENT_V1 ||\
(a)->event_type == WRITE_ROWS_EVENT ||\
(a)->event_type == UPDATE_ROWS_EVENT ||\
(a)->event_type == DELETE_ROWS_EVENT)

/* Function prototypes */
MARIADB_RPL * STDCALL mariadb_rpl_init_ex(MYSQL *mysql, unsigned int version);
const char * STDCALL mariadb_rpl_error(MARIADB_RPL *rpl);
uint32_t STDCALL mariadb_rpl_errno(MARIADB_RPL *rpl);

int STDCALL mariadb_rpl_optionsv(MARIADB_RPL *rpl, enum mariadb_rpl_option, ...);
int STDCALL mariadb_rpl_get_optionsv(MARIADB_RPL *rpl, enum mariadb_rpl_option, ...);

int STDCALL mariadb_rpl_open(MARIADB_RPL *rpl);
void STDCALL mariadb_rpl_close(MARIADB_RPL *rpl);
MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVENT *event);
void STDCALL mariadb_free_rpl_event(MARIADB_RPL_EVENT *event);

MARIADB_RPL_ROW * STDCALL
mariadb_rpl_extract_rows(MARIADB_RPL *rpl,
                         MARIADB_RPL_EVENT *tm_event,
                         MARIADB_RPL_EVENT *row_event);

#ifdef	__cplusplus
}
#endif
#endif
mariadb/ma_io.h000064400000003126150400264030007374 0ustar00/* Copyright (C) 2015 MariaDB Corporation AB

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */

#ifndef _ma_io_h_
#define _ma_io_h_


#ifdef HAVE_REMOTEIO
#include <curl/curl.h>
#endif

enum enum_file_type {
  MA_FILE_NONE=0,
  MA_FILE_LOCAL=1,
  MA_FILE_REMOTE=2
};

typedef struct
{
  enum enum_file_type type;
  void *ptr;
} MA_FILE;

#ifdef HAVE_REMOTEIO
struct st_rio_methods {
  MA_FILE *(*mopen)(const char *url, const char *mode);
  int (*mclose)(MA_FILE *ptr);
  int (*mfeof)(MA_FILE *file);
  size_t (*mread)(void *ptr, size_t size, size_t nmemb, MA_FILE *file);
  char * (*mgets)(char *ptr, size_t size, MA_FILE *file);
};
#endif

/* function prototypes */
MA_FILE *ma_open(const char *location, const char *mode, MYSQL *mysql);
int ma_close(MA_FILE *file);
int ma_feof(MA_FILE *file);
size_t ma_read(void *ptr, size_t size, size_t nmemb, MA_FILE *file);
char *ma_gets(char *ptr, size_t size, MA_FILE *file);

#endif
mariadb_stmt.h000064400000022642150400264030007363 0ustar00/************************************************************************
  
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA 

   Part of this code includes code from PHP's mysqlnd extension
   (written by Andrey Hristov, Georg Richter and Ulf Wendel), freely
   available from http://www.php.net/software

*************************************************************************/

#define MYSQL_NO_DATA 100
#define MYSQL_DATA_TRUNCATED 101
#define MYSQL_DEFAULT_PREFETCH_ROWS (unsigned long) 1

/* Bind flags */
#define MADB_BIND_DUMMY 1

#define MARIADB_STMT_BULK_SUPPORTED(stmt)\
  ((stmt)->mysql && \
  (!((stmt)->mysql->server_capabilities & CLIENT_MYSQL) &&\
    ((stmt)->mysql->extension->mariadb_server_capabilities & \
    (MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32))))

#define CLEAR_CLIENT_STMT_ERROR(a) \
do { \
  (a)->last_errno= 0;\
  strcpy((a)->sqlstate, "00000");\
  (a)->last_error[0]= 0;\
} while (0)

#define MYSQL_PS_SKIP_RESULT_W_LEN  -1
#define MYSQL_PS_SKIP_RESULT_STR    -2
#define STMT_ID_LENGTH 4


typedef struct st_mysql_stmt MYSQL_STMT;

typedef MYSQL_RES* (*mysql_stmt_use_or_store_func)(MYSQL_STMT *);

enum enum_stmt_attr_type
{
  STMT_ATTR_UPDATE_MAX_LENGTH,
  STMT_ATTR_CURSOR_TYPE,
  STMT_ATTR_PREFETCH_ROWS,

  /* MariaDB only */
  STMT_ATTR_PREBIND_PARAMS=200,
  STMT_ATTR_ARRAY_SIZE,
  STMT_ATTR_ROW_SIZE,
  STMT_ATTR_STATE,
  STMT_ATTR_CB_USER_DATA,
  STMT_ATTR_CB_PARAM,
  STMT_ATTR_CB_RESULT
};

enum enum_cursor_type
{
  CURSOR_TYPE_NO_CURSOR= 0,
  CURSOR_TYPE_READ_ONLY= 1,
  CURSOR_TYPE_FOR_UPDATE= 2,
  CURSOR_TYPE_SCROLLABLE= 4
};

enum enum_indicator_type
{
  STMT_INDICATOR_NTS=-1,
  STMT_INDICATOR_NONE=0,
  STMT_INDICATOR_NULL=1,
  STMT_INDICATOR_DEFAULT=2,
  STMT_INDICATOR_IGNORE=3,
  STMT_INDICATOR_IGNORE_ROW=4
};

/*
  bulk PS flags
*/
#define STMT_BULK_FLAG_CLIENT_SEND_TYPES 128
#define STMT_BULK_FLAG_INSERT_ID_REQUEST 64

typedef enum mysql_stmt_state
{
  MYSQL_STMT_INITTED = 0,
  MYSQL_STMT_PREPARED,
  MYSQL_STMT_EXECUTED,
  MYSQL_STMT_WAITING_USE_OR_STORE,
  MYSQL_STMT_USE_OR_STORE_CALLED,
  MYSQL_STMT_USER_FETCHING, /* fetch_row_buff or fetch_row_unbuf */
  MYSQL_STMT_FETCH_DONE
} enum_mysqlnd_stmt_state;

typedef struct st_mysql_bind
{
  unsigned long  *length;          /* output length pointer */
  my_bool        *is_null;         /* Pointer to null indicator */
  void           *buffer;          /* buffer to get/put data */
  /* set this if you want to track data truncations happened during fetch */
  my_bool        *error;
  union {
    unsigned char *row_ptr;        /* for the current data position */
    char *indicator;               /* indicator variable */
  } u;
  void (*store_param_func)(NET *net, struct st_mysql_bind *param);
  void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
                       unsigned char **row);
  void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
          unsigned char **row);
  /* output buffer length, must be set when fetching str/binary */
  unsigned long  buffer_length;
  unsigned long  offset;           /* offset position for char/binary fetch */
  unsigned long  length_value;     /* Used if length is 0 */
  unsigned int   flags;            /* special flags, e.g. for dummy bind  */
  unsigned int   pack_length;      /* Internal length for packed data */
  enum enum_field_types buffer_type;  /* buffer type */
  my_bool        error_value;      /* used if error is 0 */
  my_bool        is_unsigned;      /* set if integer type is unsigned */
  my_bool        long_data_used;   /* If used with mysql_send_long_data */
  my_bool        is_null_value;    /* Used if is_null is 0 */
  void           *extension;
} MYSQL_BIND;

typedef struct st_mysqlnd_upsert_result
{
  unsigned int  warning_count;
  unsigned int  server_status;
  unsigned long long affected_rows;
  unsigned long long last_insert_id;
} mysql_upsert_status;

typedef struct st_mysql_cmd_buffer
{
  unsigned char   *buffer;
  size_t     length;
} MYSQL_CMD_BUFFER;

typedef struct st_mysql_error_info
{
  unsigned int error_no;
  char error[MYSQL_ERRMSG_SIZE+1];
  char sqlstate[SQLSTATE_LENGTH + 1];
} mysql_error_info;

typedef int  (*mysql_stmt_fetch_row_func)(MYSQL_STMT *stmt, unsigned char **row);
typedef void (*ps_result_callback)(void *data, unsigned int column, unsigned char **row);
typedef my_bool (*ps_param_callback)(void *data, MYSQL_BIND *bind, unsigned int row_nr);

struct st_mysql_stmt
{
  MA_MEM_ROOT              mem_root;
  MYSQL                    *mysql;
  unsigned long            stmt_id;
  unsigned long            flags;/* cursor is set here */
  enum_mysqlnd_stmt_state  state;
  MYSQL_FIELD              *fields;
  unsigned int             field_count;
  unsigned int             param_count;
  unsigned char            send_types_to_server;
  MYSQL_BIND               *params;
  MYSQL_BIND               *bind;
  MYSQL_DATA               result;  /* we don't use mysqlnd's result set logic */
  MYSQL_ROWS               *result_cursor;
  my_bool                  bind_result_done;
  my_bool                  bind_param_done;

  mysql_upsert_status      upsert_status;

  unsigned int last_errno;
  char last_error[MYSQL_ERRMSG_SIZE+1];
  char sqlstate[SQLSTATE_LENGTH + 1];

  my_bool                  update_max_length;
  unsigned long            prefetch_rows;
  LIST                     list;

  my_bool                  cursor_exists;

  void                     *extension;
  mysql_stmt_fetch_row_func fetch_row_func;
  unsigned int             execute_count;/* count how many times the stmt was executed */
  mysql_stmt_use_or_store_func default_rset_handler;
  unsigned char            *request_buffer;
  unsigned int             array_size;
  size_t row_size;
  unsigned int prebind_params;
  void *user_data;
  ps_result_callback result_callback;
  ps_param_callback param_callback;
  size_t request_length;
};

typedef void (*ps_field_fetch_func)(MYSQL_BIND *r_param, const MYSQL_FIELD * field, unsigned char **row);
typedef struct st_mysql_perm_bind {
  ps_field_fetch_func func;
  /* should be signed int */
  int pack_len;
  unsigned long max_len;
} MYSQL_PS_CONVERSION;

extern MYSQL_PS_CONVERSION mysql_ps_fetch_functions[MYSQL_TYPE_GEOMETRY + 1];
unsigned long ma_net_safe_read(MYSQL *mysql);
void mysql_init_ps_subsystem(void);
unsigned long net_field_length(unsigned char **packet);
int ma_simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
          	       size_t length, my_bool skipp_check, void *opt_arg);
void stmt_set_error(MYSQL_STMT *stmt,
                  unsigned int error_nr,
                  const char *sqlstate,
                  const char *format,
                  ...);
/*
 *  function prototypes
 */
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length);
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *attr);
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *attr);
my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, unsigned int param_number, const char *data, unsigned long length);
MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt);
MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET offset);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt);
void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, unsigned long long offset);
unsigned long long STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt);
unsigned long long STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
unsigned long long STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt);
my_bool STDCALL mysql_stmt_more_results(MYSQL_STMT *stmt);
int STDCALL mariadb_stmt_execute_direct(MYSQL_STMT *stmt, const char *stmt_str, size_t length);
MYSQL_FIELD * STDCALL mariadb_stmt_fetch_fields(MYSQL_STMT *stmt);
mariadb_com.h000064400000044522150400264030007153 0ustar00/************************************************************************************
    Copyright (C) 2000, 2012 MySQL AB & MySQL Finland AB & TCX DataKonsult AB,
                 Monty Program AB
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not see <http://www.gnu.org/licenses>
   or write to the Free Software Foundation, Inc., 
   51 Franklin St., Fifth Floor, Boston, MA 02110, USA

   Part of this code includes code from the PHP project which
   is freely available from http://www.php.net
*************************************************************************************/

/*
** Common definition between mysql server & client
*/

#ifndef _mysql_com_h
#define _mysql_com_h


#define NAME_CHAR_LEN   64
#define NAME_LEN	256		/* Field/table name length */
#define HOSTNAME_LENGTH 255
#define SYSTEM_MB_MAX_CHAR_LENGTH 4
#define USERNAME_CHAR_LENGTH 128
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH)
#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
#define SCRAMBLE_LENGTH 20
#define SCRAMBLE_LENGTH_323 8

#define LOCAL_HOST	"localhost"
#define LOCAL_HOST_NAMEDPIPE "."

#if defined(_WIN32) && !defined( _CUSTOMCONFIG_)
#define MARIADB_NAMEDPIPE "MySQL"
#define MYSQL_SERVICENAME "MySql"
#endif /* _WIN32 */

/* for use in mysql client tools only */
#define MYSQL_AUTODETECT_CHARSET_NAME "auto"
#define BINCMP_FLAG       131072

enum Item_result {STRING_RESULT,REAL_RESULT,INT_RESULT,ROW_RESULT,DECIMAL_RESULT};

enum mysql_enum_shutdown_level
{
  SHUTDOWN_DEFAULT = 0,
  KILL_QUERY= 254,
  KILL_CONNECTION= 255
};

enum enum_server_command
{
  COM_SLEEP = 0,
  COM_QUIT,
  COM_INIT_DB,
  COM_QUERY,
  COM_FIELD_LIST,
  COM_CREATE_DB,
  COM_DROP_DB,
  COM_REFRESH,
  COM_SHUTDOWN,
  COM_STATISTICS,
  COM_PROCESS_INFO,
  COM_CONNECT,
  COM_PROCESS_KILL,
  COM_DEBUG,
  COM_PING,
  COM_TIME = 15,
  COM_DELAYED_INSERT,
  COM_CHANGE_USER,
  COM_BINLOG_DUMP,
  COM_TABLE_DUMP,
  COM_CONNECT_OUT = 20,
  COM_REGISTER_SLAVE,
  COM_STMT_PREPARE = 22,
  COM_STMT_EXECUTE = 23,
  COM_STMT_SEND_LONG_DATA = 24,
  COM_STMT_CLOSE = 25,
  COM_STMT_RESET = 26,
  COM_SET_OPTION = 27,
  COM_STMT_FETCH = 28,
  COM_DAEMON= 29,
  COM_UNSUPPORTED= 30,
  COM_RESET_CONNECTION = 31,
  COM_STMT_BULK_EXECUTE = 250,
  COM_RESERVED_1 = 254, /* former COM_MULTI, now removed */
  COM_END
};


#define NOT_NULL_FLAG	1		/* Field can't be NULL */
#define PRI_KEY_FLAG	2		/* Field is part of a primary key */
#define UNIQUE_KEY_FLAG 4		/* Field is part of a unique key */
#define MULTIPLE_KEY_FLAG 8		/* Field is part of a key */
#define BLOB_FLAG	16		/* Field is a blob */
#define UNSIGNED_FLAG	32		/* Field is unsigned */
#define ZEROFILL_FLAG	64		/* Field is zerofill */
#define BINARY_FLAG	128
/* The following are only sent to new clients */
#define ENUM_FLAG	256		/* field is an enum */
#define AUTO_INCREMENT_FLAG 512		/* field is a autoincrement field */
#define TIMESTAMP_FLAG	1024		/* Field is a timestamp */
#define SET_FLAG	2048		/* field is a set */
/* new since 3.23.58 */
#define NO_DEFAULT_VALUE_FLAG 4096	/* Field doesn't have default value */
#define ON_UPDATE_NOW_FLAG 8192         /* Field is set to NOW on UPDATE */
/* end new */
#define NUM_FLAG	32768		/* Field is num (for clients) */
#define PART_KEY_FLAG	16384		/* Intern; Part of some key */
#define GROUP_FLAG	32768		/* Intern: Group field */
#define UNIQUE_FLAG	65536		/* Intern: Used by sql_yacc */

#define REFRESH_GRANT		1	/* Refresh grant tables */
#define REFRESH_LOG		2	/* Start on new log file */
#define REFRESH_TABLES		4	/* close all tables */
#define REFRESH_HOSTS		8	/* Flush host cache */
#define REFRESH_STATUS		16	/* Flush status variables */
#define REFRESH_THREADS		32	/* Flush thread cache */
#define REFRESH_SLAVE           64      /* Reset master info and restart slave
					   thread */
#define REFRESH_MASTER          128     /* Remove all bin logs in the index
					   and truncate the index */

/* The following can't be set with mysql_refresh() */
#define REFRESH_READ_LOCK	16384	/* Lock tables for read */
#define REFRESH_FAST		32768	/* Intern flag */

#define CLIENT_MYSQL          1
#define CLIENT_FOUND_ROWS	    2	/* Found instead of affected rows */
#define CLIENT_LONG_FLAG	    4	/* Get all column flags */
#define CLIENT_CONNECT_WITH_DB	    8	/* One can specify db on connect */
#define CLIENT_NO_SCHEMA	   16	/* Don't allow database.table.column */
#define CLIENT_COMPRESS		   32	/* Can use compression protocol */
#define CLIENT_ODBC		   64	/* Odbc client */
#define CLIENT_LOCAL_FILES	  128	/* Can use LOAD DATA LOCAL */
#define CLIENT_IGNORE_SPACE	  256	/* Ignore spaces before '(' */
#define CLIENT_INTERACTIVE	  1024	/* This is an interactive client */
#define CLIENT_SSL                2048     /* Switch to SSL after handshake */
#define CLIENT_IGNORE_SIGPIPE     4096     /* IGNORE sigpipes */
#define CLIENT_TRANSACTIONS	  8192	/* Client knows about transactions */
/* added in 4.x */
#define CLIENT_PROTOCOL_41         512
#define CLIENT_RESERVED          16384
#define CLIENT_SECURE_CONNECTION 32768  
#define CLIENT_MULTI_STATEMENTS  (1UL << 16)
#define CLIENT_MULTI_RESULTS     (1UL << 17)
#define CLIENT_PS_MULTI_RESULTS  (1UL << 18)
#define CLIENT_PLUGIN_AUTH       (1UL << 19)
#define CLIENT_CONNECT_ATTRS     (1UL << 20)
#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21)
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22)
#define CLIENT_SESSION_TRACKING  (1UL << 23)
#define CLIENT_ZSTD_COMPRESSION  (1UL << 26)
#define CLIENT_PROGRESS          (1UL << 29) /* client supports progress indicator */
#define CLIENT_PROGRESS_OBSOLETE  CLIENT_PROGRESS 
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define CLIENT_SSL_VERIFY_SERVER_CERT_OBSOLETE CLIENT_SSL_VERIFY_SERVER_CERT
#define CLIENT_REMEMBER_OPTIONS  (1UL << 31)

/* MariaDB specific capabilities */
#define MARIADB_CLIENT_FLAGS 0xFFFFFFFF00000000ULL
#define MARIADB_CLIENT_PROGRESS (1ULL << 32)
#define MARIADB_CLIENT_RESERVED_1 (1ULL << 33) /* Former COM_MULTI, don't use */
#define MARIADB_CLIENT_STMT_BULK_OPERATIONS (1ULL << 34)
/* support of extended data type/format information, since 10.5.0 */
#define MARIADB_CLIENT_EXTENDED_METADATA (1ULL << 35)
/* Do not resend metadata for prepared statements, since 10.6*/
#define MARIADB_CLIENT_CACHE_METADATA (1ULL << 36)

#define IS_MARIADB_EXTENDED_SERVER(mysql)\
        (!(mysql->server_capabilities & CLIENT_MYSQL))

#define MARIADB_CLIENT_SUPPORTED_FLAGS (MARIADB_CLIENT_PROGRESS |\
                                       MARIADB_CLIENT_STMT_BULK_OPERATIONS|\
                                       MARIADB_CLIENT_EXTENDED_METADATA|\
                                       MARIADB_CLIENT_CACHE_METADATA)

#define CLIENT_SUPPORTED_FLAGS  (CLIENT_MYSQL |\
                                 CLIENT_FOUND_ROWS |\
                                 CLIENT_LONG_FLAG |\
                                 CLIENT_CONNECT_WITH_DB |\
                                 CLIENT_NO_SCHEMA |\
                                 CLIENT_COMPRESS |\
                                 CLIENT_ODBC |\
                                 CLIENT_LOCAL_FILES |\
                                 CLIENT_IGNORE_SPACE |\
                                 CLIENT_INTERACTIVE |\
                                 CLIENT_SSL |\
                                 CLIENT_IGNORE_SIGPIPE |\
                                 CLIENT_TRANSACTIONS |\
                                 CLIENT_PROTOCOL_41 |\
                                 CLIENT_RESERVED |\
                                 CLIENT_SECURE_CONNECTION |\
                                 CLIENT_MULTI_STATEMENTS |\
                                 CLIENT_MULTI_RESULTS |\
                                 CLIENT_PROGRESS |\
                                 CLIENT_SSL_VERIFY_SERVER_CERT |\
                                 CLIENT_REMEMBER_OPTIONS |\
                                 CLIENT_PLUGIN_AUTH |\
                                 CLIENT_SESSION_TRACKING |\
                                 CLIENT_CONNECT_ATTRS)
#define CLIENT_ALLOWED_FLAGS     (CLIENT_SUPPORTED_FLAGS |\
                                 CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA |\
                                 CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS |\
                                 CLIENT_ZSTD_COMPRESSION |\
                                 CLIENT_PS_MULTI_RESULTS |\
                                 CLIENT_REMEMBER_OPTIONS)
#define CLIENT_CAPABILITIES	    (CLIENT_MYSQL | \
                                 CLIENT_LONG_FLAG |\
                                 CLIENT_TRANSACTIONS |\
                                 CLIENT_SECURE_CONNECTION |\
                                 CLIENT_MULTI_RESULTS | \
                                 CLIENT_PS_MULTI_RESULTS |\
                                 CLIENT_PROTOCOL_41 |\
                                 CLIENT_PLUGIN_AUTH |\
                                 CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
                                 CLIENT_SESSION_TRACKING |\
                                 CLIENT_CONNECT_ATTRS)

#define CLIENT_DEFAULT_FLAGS ((CLIENT_SUPPORTED_FLAGS & ~CLIENT_COMPRESS)\
                                                      & ~CLIENT_SSL)

#define SERVER_STATUS_IN_TRANS               1	/* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT             2	/* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXIST            8
#define SERVER_QUERY_NO_GOOD_INDEX_USED     16
#define SERVER_QUERY_NO_INDEX_USED          32
#define SERVER_STATUS_CURSOR_EXISTS         64
#define SERVER_STATUS_LAST_ROW_SENT        128
#define SERVER_STATUS_DB_DROPPED           256 
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
#define SERVER_STATUS_METADATA_CHANGED    1024
#define SERVER_QUERY_WAS_SLOW             2048
#define SERVER_PS_OUT_PARAMS              4096
#define SERVER_STATUS_IN_TRANS_READONLY   8192
#define SERVER_SESSION_STATE_CHANGED     16384
#define SERVER_STATUS_ANSI_QUOTES        32768

#define MYSQL_ERRMSG_SIZE	512
#define NET_READ_TIMEOUT	30		/* Timeout on read */
#define NET_WRITE_TIMEOUT	60		/* Timeout on write */
#define NET_WAIT_TIMEOUT	(8*60*60)	/* Wait for new query */

/* for server integration (mysqlbinlog) */
#define LIST_PROCESS_HOST_LEN 64
#define MYSQL50_TABLE_NAME_PREFIX         "#mysql50#"
#define MYSQL50_TABLE_NAME_PREFIX_LENGTH  (sizeof(MYSQL50_TABLE_NAME_PREFIX)-1)
#define SAFE_NAME_LEN (NAME_LEN + MYSQL50_TABLE_NAME_PREFIX_LENGTH)

struct st_ma_pvio;
typedef struct st_ma_pvio MARIADB_PVIO;

#define MAX_CHAR_WIDTH		255	/* Max length for a CHAR column */
#define MAX_BLOB_WIDTH		8192	/* Default width for blob */

/* the following defines were added for PHP's mysqli and pdo extensions: 
   see: CONC-56
*/
#define MAX_TINYINT_WIDTH     3
#define MAX_SMALLINT_WIDTH    5
#define MAX_MEDIUMINT_WIDTH   8
#define MAX_INT_WIDTH        10
#define MAX_BIGINT_WIDTH     20

struct st_ma_connection_plugin;


typedef struct st_net {
  MARIADB_PVIO *pvio;
  unsigned char *buff;
  unsigned char *buff_end,*write_pos,*read_pos;
  my_socket fd;					/* For Perl DBI/dbd */
  unsigned long remain_in_buf,length;
  unsigned long buf_length, where_b;
  unsigned long max_packet, max_packet_size;
  unsigned int pkt_nr, compress_pkt_nr;
  unsigned int write_timeout, read_timeout, retry_count;
  int fcntl;
  unsigned int *return_status;
  unsigned char reading_or_writing;
  char save_char;
  char unused_1;
  my_bool unused_2;
  my_bool compress;
  my_bool unused_3;
  void *unused_4;
  unsigned int last_errno;
  unsigned char error;
  my_bool unused_5;
  my_bool unused_6;
  char last_error[MYSQL_ERRMSG_SIZE];
  char sqlstate[SQLSTATE_LENGTH+1];
  struct st_mariadb_net_extension *extension;
} NET;

#define packet_error ((unsigned int) -1)

/* used by mysql_set_server_option */
enum enum_mysql_set_option
{
  MYSQL_OPTION_MULTI_STATEMENTS_ON,
  MYSQL_OPTION_MULTI_STATEMENTS_OFF
};

/* for status callback function */
enum enum_mariadb_status_info
{
  STATUS_TYPE= 0,
  SESSION_TRACK_TYPE
};

enum enum_session_state_type
{
  SESSION_TRACK_SYSTEM_VARIABLES= 0,
  SESSION_TRACK_SCHEMA,
  SESSION_TRACK_STATE_CHANGE,
  /* currently not supported by MariaDB Server */
  SESSION_TRACK_GTIDS,
  SESSION_TRACK_TRANSACTION_CHARACTERISTICS,
  SESSION_TRACK_TRANSACTION_STATE /* make sure that SESSION_TRACK_END always points
                                    to last element of enum !! */
};

#define SESSION_TRACK_BEGIN 0
#define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_STATE
#define SESSION_TRACK_TYPES (SESSION_TRACK_END + 1)

/* SESSION_TRACK_TRANSACTION_TYPE was renamed to SESSION_TRACK_TRANSACTION_STATE
   in 3e699a1738cdfb0a2c5b8eabfa8301b8d11cf711.
   This is a workaround to prevent breaking of travis and buildbot tests.
   TODO: Remove this after server fixes */
#define SESSION_TRACK_TRANSACTION_TYPE SESSION_TRACK_TRANSACTION_STATE

enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
                        MYSQL_TYPE_SHORT,  MYSQL_TYPE_LONG,
                        MYSQL_TYPE_FLOAT,  MYSQL_TYPE_DOUBLE,
                        MYSQL_TYPE_NULL,   MYSQL_TYPE_TIMESTAMP,
                        MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
                        MYSQL_TYPE_DATE,   MYSQL_TYPE_TIME,
                        MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
                        MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
                        MYSQL_TYPE_BIT,
                        /*
                          the following types are not used by client,
                          only for mysqlbinlog!!
                        */
                        MYSQL_TYPE_TIMESTAMP2,
                        MYSQL_TYPE_DATETIME2,
                        MYSQL_TYPE_TIME2,
                        /* --------------------------------------------- */
                        MYSQL_TYPE_JSON=245,
                        MYSQL_TYPE_NEWDECIMAL=246,
                        MYSQL_TYPE_ENUM=247,
                        MYSQL_TYPE_SET=248,
                        MYSQL_TYPE_TINY_BLOB=249,
                        MYSQL_TYPE_MEDIUM_BLOB=250,
                        MYSQL_TYPE_LONG_BLOB=251,
                        MYSQL_TYPE_BLOB=252,
                        MYSQL_TYPE_VAR_STRING=253,
                        MYSQL_TYPE_STRING=254,
                        MYSQL_TYPE_GEOMETRY=255,
                        MAX_NO_FIELD_TYPES };

#define FIELD_TYPE_CHAR FIELD_TYPE_TINY		/* For compatibility */
#define FIELD_TYPE_INTERVAL FIELD_TYPE_ENUM	/* For compatibility */
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
#define FIELD_TYPE_LONG MYSQL_TYPE_LONG
#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT
#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE
#define FIELD_TYPE_NULL MYSQL_TYPE_NULL
#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP
#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG
#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24
#define FIELD_TYPE_DATE MYSQL_TYPE_DATE
#define FIELD_TYPE_TIME MYSQL_TYPE_TIME
#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME
#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR
#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE
#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM
#define FIELD_TYPE_SET MYSQL_TYPE_SET
#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB
#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB
#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB
#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING
#define FIELD_TYPE_STRING MYSQL_TYPE_STRING
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
#define FIELD_TYPE_BIT MYSQL_TYPE_BIT

extern unsigned long max_allowed_packet;
extern unsigned long net_buffer_length;

#define net_new_transaction(net) ((net)->pkt_nr=0)

int	ma_net_init(NET *net, MARIADB_PVIO *pvio);
void	ma_net_end(NET *net);
void	ma_net_clear(NET *net);
int	ma_net_flush(NET *net);
int	ma_net_write(NET *net,const unsigned char *packet, size_t len);
int	ma_net_write_command(NET *net,unsigned char command,const char *packet,
			  size_t len, my_bool disable_flush);
int	ma_net_real_write(NET *net,const char *packet, size_t len);
extern unsigned long ma_net_read(NET *net);

struct rand_struct {
  unsigned long seed1,seed2,max_value;
  double max_value_dbl;
};

  /* The following is for user defined functions */

typedef struct st_udf_args
{
  unsigned int arg_count;		/* Number of arguments */
  enum Item_result *arg_type;		/* Pointer to item_results */
  char **args;				/* Pointer to argument */
  unsigned long *lengths;		/* Length of string arguments */
  char *maybe_null;			/* Set to 1 for all maybe_null args */
} UDF_ARGS;

  /* This holds information about the result */

typedef struct st_udf_init
{
  my_bool maybe_null;			/* 1 if function can return NULL */
  unsigned int decimals;		/* for real functions */
  unsigned int max_length;		/* For string functions */
  char	  *ptr;				/* free pointer for function data */
  my_bool const_item;			/* 0 if result is independent of arguments */
} UDF_INIT;

/* Connection types */
#define MARIADB_CONNECTION_UNIXSOCKET   0
#define MARIADB_CONNECTION_TCP          1
#define MARIADB_CONNECTION_NAMEDPIPE    2
#define MARIADB_CONNECTION_SHAREDMEM    3

  /* Constants when using compression */
#define NET_HEADER_SIZE 4		/* standard header size */
#define COMP_HEADER_SIZE 3		/* compression header extra size */

  /* Prototypes to password functions */
#define native_password_plugin_name "mysql_native_password"
#define old_password_plugin_name    "mysql_old_password"

#ifdef __cplusplus
extern "C" {
#endif
  
char *ma_scramble_323(char *to,const char *message,const char *password);
void ma_scramble_41(const unsigned char *buffer, const char *scramble, const char *password);
void ma_hash_password(unsigned long *result, const char *password, size_t len);
void ma_make_scrambled_password(char *to,const char *password);

/* Some other useful functions */

void mariadb_load_defaults(const char *conf_file, const char **groups,
		   int *argc, char ***argv);
my_bool ma_thread_init(void);
void ma_thread_end(void);

#ifdef __cplusplus
}
#endif

#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */

#endif
errmsg.h000064400000011461150400264030006211 0ustar00/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
                 2012-2016 SkySQL AB, MariaDB Corporation AB
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */

/* Error messages for mysql clients */
/* error messages for the demon is in share/language/errmsg.sys */
#ifndef _errmsg_h_
#define _errmsg_h_

#ifdef	__cplusplus
extern "C" {
#endif
void	init_client_errs(void);
extern const char *client_errors[];	/* Error messages */
extern const char *mariadb_client_errors[];	/* Error messages */
#ifdef	__cplusplus
}
#endif

#define CR_MIN_ERROR		2000	/* For easier client code */
#define CR_MAX_ERROR		2999
#define CER_MIN_ERROR           5000
#define CER_MAX_ERROR           5999
#define CLIENT_ERRMAP		2	/* Errormap used by ma_error() */

#define ER_UNKNOWN_ERROR_CODE "Unknown or undefined error code (%d)"

#define CR_UNKNOWN_ERROR	2000
#define CR_SOCKET_CREATE_ERROR	2001
#define CR_CONNECTION_ERROR	2002
#define CR_CONN_HOST_ERROR	2003 /* never sent to a client, message only */
#define CR_IPSOCK_ERROR		2004
#define CR_UNKNOWN_HOST		2005
#define CR_SERVER_GONE_ERROR	2006 /* disappeared _between_ queries */
#define CR_VERSION_ERROR	2007
#define CR_OUT_OF_MEMORY	2008
#define CR_WRONG_HOST_INFO	2009
#define CR_LOCALHOST_CONNECTION 2010
#define CR_TCP_CONNECTION	2011
#define CR_SERVER_HANDSHAKE_ERR 2012
#define CR_SERVER_LOST		2013 /* disappeared _during_ a query */
#define CR_COMMANDS_OUT_OF_SYNC 2014
#define CR_NAMEDPIPE_CONNECTION 2015
#define CR_NAMEDPIPEWAIT_ERROR 2016
#define CR_NAMEDPIPEOPEN_ERROR 2017
#define CR_NAMEDPIPESETSTATE_ERROR 2018
#define CR_CANT_READ_CHARSET	2019
#define CR_NET_PACKET_TOO_LARGE 2020
#define CR_SSL_CONNECTION_ERROR 2026
#define CR_MALFORMED_PACKET     2027
#define CR_NO_PREPARE_STMT      2030
#define CR_PARAMS_NOT_BOUND     2031
#define CR_INVALID_PARAMETER_NO  2034
#define CR_INVALID_BUFFER_USE    2035
#define CR_UNSUPPORTED_PARAM_TYPE 2036

#define CR_SHARED_MEMORY_CONNECTION 2037
#define CR_SHARED_MEMORY_CONNECT_ERROR 2038

#define CR_CONN_UNKNOWN_PROTOCOL 2047
#define CR_SECURE_AUTH          2049
#define CR_NO_DATA              2051
#define CR_NO_STMT_METADATA     2052
#define CR_NOT_IMPLEMENTED      2054
#define CR_SERVER_LOST_EXTENDED 2055 /* never sent to a client, message only */
#define CR_STMT_CLOSED          2056
#define CR_NEW_STMT_METADATA    2057
#define CR_ALREADY_CONNECTED    2058
#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
#define CR_DUPLICATE_CONNECTION_ATTR 2060
#define CR_AUTH_PLUGIN_ERR 2061
/* Always last, if you add new error codes please update the
   value for CR_MYSQL_LAST_ERROR */
#define CR_MYSQL_LAST_ERROR CR_AUTH_PLUGIN_ERR

/* 
 * MariaDB Connector/C errors: 
 */
#define CR_EVENT_CREATE_FAILED 5000
#define CR_BIND_ADDR_FAILED    5001
#define CR_ASYNC_NOT_SUPPORTED 5002
#define CR_FUNCTION_NOT_SUPPORTED 5003
#define CR_FILE_NOT_FOUND 5004
#define CR_FILE_READ 5005
#define CR_BULK_WITHOUT_PARAMETERS 5006
#define CR_INVALID_STMT 5007
#define CR_VERSION_MISMATCH 5008
#define CR_INVALID_PARAMETER 5009
#define CR_PLUGIN_NOT_ALLOWED 5010
#define CR_CONNSTR_PARSE_ERROR 5011
#define CR_ERR_LOAD_PLUGIN 5012
#define CR_ERR_NET_READ 5013
#define CR_ERR_NET_WRITE 5014
#define CR_ERR_NET_UNCOMPRESS 5015
#define CR_ERR_STMT_PARAM_CALLBACK 5016
#define CR_ERR_BINLOG_UNCOMPRESS 5017
#define CR_ERR_CHECKSUM_VERIFICATION_ERROR 5018
#define CR_ERR_UNSUPPORTED_BINLOG_FORMAT 5019
#define CR_UNKNOWN_BINLOG_EVENT 5020
#define CR_BINLOG_ERROR 5021
#define CR_BINLOG_INVALID_FILE 5022
#define CR_BINLOG_SEMI_SYNC_ERROR 5023
#define CR_INVALID_CLIENT_FLAG 5024
#define CR_ERR_MISSING_ERROR_INFO 5026

/* Always last, if you add new error codes please update the
   value for CR_MARIADB_LAST_ERROR */
#define CR_MARIADB_LAST_ERROR CR_ERR_MISSING_ERROR_INFO

#endif

#define IS_MYSQL_ERROR(code) ((code) > CR_MIN_ERROR && (code) <= CR_MYSQL_LAST_ERROR)
#define IS_MARIADB_ERROR(code) ((code) > CER_MIN_ERROR && (code) <= CR_MARIADB_LAST_ERROR)

#define ER(code) IS_MYSQL_ERROR((code)) ? client_errors[(code) - CR_MIN_ERROR] : \
                 IS_MARIADB_ERROR((code)) ?  mariadb_client_errors[(code) - CER_MIN_ERROR] : \
                 "Unknown or undefined error code" 
#define CER(code) ER((code))

ma_pvio.h000064400000010744150400264030006347 0ustar00#ifndef _ma_pvio_h_
#define _ma_pvio_h_
#define cio_defined

#ifdef HAVE_TLS
#include <ma_tls.h>
#else
#define MARIADB_TLS void
#endif

/* CONC-492: Allow to build plugins outside of MariaDB Connector/C
   source tree wnen ma_global.h was not included. */
#if !defined(_global_h) && !defined(MY_GLOBAL_INCLUDED)
typedef unsigned char uchar;
#endif

#define PVIO_SET_ERROR if (pvio->set_error) \
                        pvio->set_error

#define PVIO_READ_AHEAD_CACHE_SIZE 16384
#define PVIO_READ_AHEAD_CACHE_MIN_SIZE 2048
#define PVIO_EINTR_TRIES 2

struct st_ma_pvio_methods;
typedef struct st_ma_pvio_methods PVIO_METHODS;

#define IS_PVIO_ASYNC(a) \
  ((a)->mysql && (a)->mysql->options.extension && (a)->mysql->options.extension->async_context)

#define IS_PVIO_ASYNC_ACTIVE(a) \
  (IS_PVIO_ASYNC(a)&& (a)->mysql->options.extension->async_context->active)

#define IS_MYSQL_ASYNC(a) \
  ((a)->options.extension && (a)->options.extension->async_context)

#define IS_MYSQL_ASYNC_ACTIVE(a) \
  (IS_MYSQL_ASYNC(a)&& (a)->options.extension->async_context->active)

enum enum_pvio_timeout {
  PVIO_CONNECT_TIMEOUT= 0,
  PVIO_READ_TIMEOUT,
  PVIO_WRITE_TIMEOUT 
};

enum enum_pvio_io_event
{
  VIO_IO_EVENT_READ,
  VIO_IO_EVENT_WRITE,
  VIO_IO_EVENT_CONNECT
};

enum enum_pvio_type {
  PVIO_TYPE_UNIXSOCKET= 0,
  PVIO_TYPE_SOCKET,
  PVIO_TYPE_NAMEDPIPE,
  PVIO_TYPE_SHAREDMEM,
};

enum enum_pvio_operation {
  PVIO_READ= 0,
  PVIO_WRITE=1
};

#define SHM_DEFAULT_NAME "MYSQL"

struct st_pvio_callback;

typedef struct st_pvio_callback {
  void (*callback)(MYSQL *mysql, uchar *buffer, size_t size);
  struct st_pvio_callback *next;
} PVIO_CALLBACK;

struct st_ma_pvio {
  void *data;
  /* read ahead cache */
  uchar *cache;
  uchar *cache_pos;
  size_t cache_size;
  enum enum_pvio_type type;
  int timeout[3];
  int ssl_type;  /* todo: change to enum (ssl plugins) */
  MARIADB_TLS *ctls;
  MYSQL *mysql;
  PVIO_METHODS *methods;
  void (*set_error)(MYSQL *mysql, unsigned int error_nr, const char *sqlstate, const char *format, ...);
  void (*callback)(MARIADB_PVIO *pvio, my_bool is_read, const uchar *buffer, size_t length);
  size_t bytes_read;
  size_t bytes_sent;
};

typedef struct st_ma_pvio_cinfo
{
  const char *host;
  const char *unix_socket;
  int port;
  enum enum_pvio_type type;
  MYSQL *mysql;
} MA_PVIO_CINFO;

struct st_ma_pvio_methods
{
  my_bool (*set_timeout)(MARIADB_PVIO *pvio, enum enum_pvio_timeout type, int timeout);
  int (*get_timeout)(MARIADB_PVIO *pvio, enum enum_pvio_timeout type);
  ssize_t (*read)(MARIADB_PVIO *pvio, uchar *buffer, size_t length);
  ssize_t (*async_read)(MARIADB_PVIO *pvio, uchar *buffer, size_t length);
  ssize_t (*write)(MARIADB_PVIO *pvio, const uchar *buffer, size_t length);
  ssize_t (*async_write)(MARIADB_PVIO *pvio, const uchar *buffer, size_t length);
  int (*wait_io_or_timeout)(MARIADB_PVIO *pvio, my_bool is_read, int timeout);
  int (*blocking)(MARIADB_PVIO *pvio, my_bool value, my_bool *old_value);
  my_bool (*connect)(MARIADB_PVIO *pvio, MA_PVIO_CINFO *cinfo);
  my_bool (*close)(MARIADB_PVIO *pvio);
  int (*fast_send)(MARIADB_PVIO *pvio);
  int (*keepalive)(MARIADB_PVIO *pvio);
  my_bool (*get_handle)(MARIADB_PVIO *pvio, void *handle);
  my_bool (*is_blocking)(MARIADB_PVIO *pvio);
  my_bool (*is_alive)(MARIADB_PVIO *pvio);
  my_bool (*has_data)(MARIADB_PVIO *pvio, ssize_t *data_len);
  int(*shutdown)(MARIADB_PVIO *pvio);
};

/* Function prototypes */
MARIADB_PVIO *ma_pvio_init(MA_PVIO_CINFO *cinfo);
void ma_pvio_close(MARIADB_PVIO *pvio);
ssize_t ma_pvio_cache_read(MARIADB_PVIO *pvio, uchar *buffer, size_t length);
ssize_t ma_pvio_read(MARIADB_PVIO *pvio, uchar *buffer, size_t length);
ssize_t ma_pvio_write(MARIADB_PVIO *pvio, const uchar *buffer, size_t length);
int ma_pvio_get_timeout(MARIADB_PVIO *pvio, enum enum_pvio_timeout type);
my_bool ma_pvio_set_timeout(MARIADB_PVIO *pvio, enum enum_pvio_timeout type, int timeout);
int ma_pvio_fast_send(MARIADB_PVIO *pvio);
int ma_pvio_keepalive(MARIADB_PVIO *pvio);
my_socket ma_pvio_get_socket(MARIADB_PVIO *pvio);
my_bool ma_pvio_is_blocking(MARIADB_PVIO *pvio);
my_bool ma_pvio_blocking(MARIADB_PVIO *pvio, my_bool block, my_bool *previous_mode);
my_bool ma_pvio_is_blocking(MARIADB_PVIO *pvio);
int ma_pvio_wait_io_or_timeout(MARIADB_PVIO *pvio, my_bool is_read, int timeout);
my_bool ma_pvio_connect(MARIADB_PVIO *pvio, MA_PVIO_CINFO *cinfo);
my_bool ma_pvio_is_alive(MARIADB_PVIO *pvio);
my_bool ma_pvio_get_handle(MARIADB_PVIO *pvio, void *handle);
my_bool ma_pvio_has_data(MARIADB_PVIO *pvio, ssize_t *length);

#endif /* _ma_pvio_h_ */
ma_list.h000064400000003123150400264030006336 0ustar00/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library 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
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   MA 02111-1301, USA */

#ifndef _list_h_
#define _list_h_

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct st_list {
  struct st_list *prev,*next;
  void *data;
} LIST;

typedef int (*list_walk_action)(void *,void *);

extern LIST *list_add(LIST *root,LIST *element);
extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *list);
extern int list_walk(LIST *list,list_walk_action action,char * argument);

#define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))
#define list_pop(A) do {LIST *old=(A); (A)=list_delete(old,old) ; ma_free((char *) old,MYF(MY_FAE)); } while(0)

#ifdef	__cplusplus
}
#endif
#endif